From: Andrea Amorese Date: Tue, 31 Aug 2021 11:34:18 +0000 (+0200) Subject: Built motion from commit 6d4ee81d.|2.5.34 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22thisimagedoesnotexist.png/%22javascript:;//%22%7B%7Blicense.fax?a=commitdiff_plain;h=88fd65358fa89461bec5844f3799413e1f0d836f;p=motion2.git Built motion from commit 6d4ee81d.|2.5.34 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 50dd2e3..bbca9b7 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-08-31T10:25:11.510Z", + "time": "2021-08-31T11:21:54.169Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 5b84f15..dcf219d 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-08-31T10:25:11.510Z", + "time": "2021-08-31T11:21:54.169Z", "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 4f9ff50..8e8008a 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 _0x68b3=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x3ef2af,_0x1ed2e4){var _0x5d82b7=function(_0x2d546d){while(--_0x2d546d){_0x3ef2af['push'](_0x3ef2af['shift']());}};_0x5d82b7(++_0x1ed2e4);}(_0x68b3,0x1d8));var _0x368b=function(_0x5ec9dc,_0x4f3e1d){_0x5ec9dc=_0x5ec9dc-0x0;var _0x117ebe=_0x68b3[_0x5ec9dc];return _0x117ebe;};'use strict';var Sequelize=require(_0x368b('0x0'));module[_0x368b('0x1')]={'name':{'type':Sequelize[_0x368b('0x2')],'get':function(_0xa371c){return this[_0x368b('0x3')]('action');}},'action':{'type':Sequelize[_0x368b('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x368b('0x5'),_0x368b('0x6'),_0x368b('0x7'),'jscripty',_0x368b('0x8'),_0x368b('0x9'),_0x368b('0xa'),_0x368b('0xb')]],'msg':_0x368b('0xc')}},'comment':_0x368b('0xc')},'data1':{'type':Sequelize[_0x368b('0x4')](0x1000),'comment':_0x368b('0xd')},'data2':{'type':Sequelize[_0x368b('0x4')](0x1000),'comment':_0x368b('0xe')},'data3':{'type':Sequelize[_0x368b('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x368b('0x4')](0x1000),'comments':_0x368b('0xf')},'data5':{'type':Sequelize[_0x368b('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth]'},'data6':{'type':Sequelize[_0x368b('0x4')],'comments':_0x368b('0x10')},'data7':{'type':Sequelize[_0x368b('0x11')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x41fe=['integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x3bca0c,_0x4a125e){var _0x1b2a94=function(_0x52a5f7){while(--_0x52a5f7){_0x3bca0c['push'](_0x3bca0c['shift']());}};_0x1b2a94(++_0x4a125e);}(_0x41fe,0xd1));var _0xe41f=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x41fe[_0x26b80e];return _0x84a8a8;};'use strict';var Sequelize=require(_0xe41f('0x0'));module[_0xe41f('0x1')]={'name':{'type':Sequelize[_0xe41f('0x2')],'get':function(_0x2c527f){return this[_0xe41f('0x3')](_0xe41f('0x4'));}},'action':{'type':Sequelize[_0xe41f('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xe41f('0x6'),_0xe41f('0x7'),_0xe41f('0x8'),_0xe41f('0x9'),_0xe41f('0xa'),_0xe41f('0xb'),_0xe41f('0xc'),_0xe41f('0xd')]],'msg':_0xe41f('0xe')}},'comment':_0xe41f('0xe')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xe41f('0xf')},'data2':{'type':Sequelize[_0xe41f('0x5')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xe41f('0x5')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xe41f('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth]'},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xe41f('0x10')],'comments':_0xe41f('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index a3e2ec3..cb32036 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 _0x33e9=['request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','sendStatus','error','stack','send','body','Action','find','then','catch','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0x33e9,0x92));var _0x933e=function(_0x22f63d,_0x3e4d7a){_0x22f63d=_0x22f63d-0x0;var _0x53fd03=_0x33e9[_0x22f63d];return _0x53fd03;};'use strict';var emlformat=require(_0x933e('0x0'));var rimraf=require(_0x933e('0x1'));var zipdir=require(_0x933e('0x2'));var jsonpatch=require(_0x933e('0x3'));var rp=require(_0x933e('0x4'));var moment=require('moment');var BPromise=require(_0x933e('0x5'));var Mustache=require(_0x933e('0x6'));var util=require(_0x933e('0x7'));var path=require(_0x933e('0x8'));var sox=require('sox');var csv=require(_0x933e('0x9'));var ejs=require(_0x933e('0xa'));var fs=require('fs');var fs_extra=require(_0x933e('0xb'));var _=require(_0x933e('0xc'));var squel=require(_0x933e('0xd'));var crypto=require(_0x933e('0xe'));var jsforce=require(_0x933e('0xf'));var deskjs=require(_0x933e('0x10'));var toCsv=require(_0x933e('0x9'));var querystring=require('querystring');var Papa=require(_0x933e('0x11'));var Redis=require(_0x933e('0x12'));var authService=require(_0x933e('0x13'));var qs=require(_0x933e('0x14'));var as=require(_0x933e('0x15'));var hardwareService=require(_0x933e('0x16'));var logger=require(_0x933e('0x17'))(_0x933e('0x18'));var utils=require(_0x933e('0x19'));var config=require(_0x933e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x933e('0x1b'))['db'];function respondWithStatusCode(_0x15df24,_0xd6610f){_0xd6610f=_0xd6610f||0xcc;return function(_0x4197f0){if(_0x4197f0){return _0x15df24['sendStatus'](_0xd6610f);}return _0x15df24[_0x933e('0x1c')](_0xd6610f)[_0x933e('0x1d')]();};}function respondWithResult(_0x2a39a7,_0x269385){_0x269385=_0x269385||0xc8;return function(_0x5da773){if(_0x5da773){return _0x2a39a7['status'](_0x269385)['json'](_0x5da773);}};}function respondWithFilteredResult(_0x3cb8f0,_0x1098c2){return function(_0x4219fe){if(_0x4219fe){var _0xf5ad5b=typeof _0x1098c2[_0x933e('0x1e')]===_0x933e('0x1f')&&typeof _0x1098c2[_0x933e('0x20')]===_0x933e('0x1f');var _0x56cc7e=_0x4219fe['count'];var _0x810b62=_0xf5ad5b?0x0:_0x1098c2['offset'];var _0x20efb7=_0xf5ad5b?_0x4219fe[_0x933e('0x21')]:_0x1098c2[_0x933e('0x1e')]+_0x1098c2[_0x933e('0x20')];var _0x29007b;if(_0x20efb7>=_0x56cc7e){_0x20efb7=_0x56cc7e;_0x29007b=0xc8;}else{_0x29007b=0xce;}_0x3cb8f0['status'](_0x29007b);return _0x3cb8f0[_0x933e('0x22')](_0x933e('0x23'),_0x810b62+'-'+_0x20efb7+'/'+_0x56cc7e)[_0x933e('0x24')](_0x4219fe);}return null;};}function patchUpdates(_0x229cc7){return function(_0x5edd41){try{jsonpatch['apply'](_0x5edd41,_0x229cc7,!![]);}catch(_0x1bda3f){return BPromise[_0x933e('0x25')](_0x1bda3f);}return _0x5edd41[_0x933e('0x26')]();};}function saveUpdates(_0x18753b,_0x5d9616){return function(_0x46fbbe){if(_0x46fbbe){return _0x46fbbe[_0x933e('0x27')](_0x18753b)['then'](function(_0x474f5b){return _0x474f5b;});}return null;};}function removeEntity(_0x188777,_0x3d1d40){return function(_0x23361c){if(_0x23361c){return _0x23361c[_0x933e('0x28')]()['then'](function(){_0x188777[_0x933e('0x1c')](0xcc)[_0x933e('0x1d')]();});}};}function handleEntityNotFound(_0x49853d,_0x4ce55c){return function(_0x2ae54d){if(!_0x2ae54d){_0x49853d[_0x933e('0x29')](0x194);}return _0x2ae54d;};}function handleError(_0x402a3f,_0x694617){_0x694617=_0x694617||0x1f4;return function(_0x37bd12){logger[_0x933e('0x2a')](_0x37bd12[_0x933e('0x2b')]);if(_0x37bd12['name']){delete _0x37bd12['name'];}_0x402a3f['status'](_0x694617)[_0x933e('0x2c')](_0x37bd12);};}exports['update']=function(_0x3137d8,_0x2dfc68){if(_0x3137d8[_0x933e('0x2d')]['id']){delete _0x3137d8[_0x933e('0x2d')]['id'];}return db[_0x933e('0x2e')][_0x933e('0x2f')]({'where':{'id':_0x3137d8['params']['id']}})[_0x933e('0x30')](handleEntityNotFound(_0x2dfc68,null))[_0x933e('0x30')](saveUpdates(_0x3137d8[_0x933e('0x2d')],null))[_0x933e('0x30')](respondWithResult(_0x2dfc68,null))[_0x933e('0x31')](handleError(_0x2dfc68,null));};exports['destroy']=function(_0x1fe9b0,_0x51733a){return db[_0x933e('0x2e')][_0x933e('0x2f')]({'where':{'id':_0x1fe9b0['params']['id']}})['then'](handleEntityNotFound(_0x51733a,null))[_0x933e('0x30')](removeEntity(_0x51733a,null))['catch'](handleError(_0x51733a,null));}; \ No newline at end of file +var _0xef14=['json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','body','Action','params','catch','find','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status'];(function(_0x1c67e4,_0x4fb7c1){var _0x35f59=function(_0x4b5a7a){while(--_0x4b5a7a){_0x1c67e4['push'](_0x1c67e4['shift']());}};_0x35f59(++_0x4fb7c1);}(_0xef14,0x1aa));var _0x4ef1=function(_0xcd322f,_0x1985a3){_0xcd322f=_0xcd322f-0x0;var _0x7dc7cf=_0xef14[_0xcd322f];return _0x7dc7cf;};'use strict';var emlformat=require(_0x4ef1('0x0'));var rimraf=require(_0x4ef1('0x1'));var zipdir=require(_0x4ef1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ef1('0x3'));var moment=require('moment');var BPromise=require(_0x4ef1('0x4'));var Mustache=require('mustache');var util=require(_0x4ef1('0x5'));var path=require(_0x4ef1('0x6'));var sox=require(_0x4ef1('0x7'));var csv=require(_0x4ef1('0x8'));var ejs=require(_0x4ef1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ef1('0xa'));var squel=require('squel');var crypto=require(_0x4ef1('0xb'));var jsforce=require(_0x4ef1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4ef1('0x8'));var querystring=require(_0x4ef1('0xd'));var Papa=require('papaparse');var Redis=require(_0x4ef1('0xe'));var authService=require(_0x4ef1('0xf'));var qs=require(_0x4ef1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ef1('0x11'))(_0x4ef1('0x12'));var utils=require(_0x4ef1('0x13'));var config=require(_0x4ef1('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x496fed,_0x4780c9){_0x4780c9=_0x4780c9||0xcc;return function(_0x2eafab){if(_0x2eafab){return _0x496fed[_0x4ef1('0x15')](_0x4780c9);}return _0x496fed['status'](_0x4780c9)[_0x4ef1('0x16')]();};}function respondWithResult(_0x2b1373,_0x1c4479){_0x1c4479=_0x1c4479||0xc8;return function(_0x21a31d){if(_0x21a31d){return _0x2b1373[_0x4ef1('0x17')](_0x1c4479)[_0x4ef1('0x18')](_0x21a31d);}};}function respondWithFilteredResult(_0x1c6371,_0x338e0a){return function(_0xde3145){if(_0xde3145){var _0x27368a=typeof _0x338e0a[_0x4ef1('0x19')]===_0x4ef1('0x1a')&&typeof _0x338e0a[_0x4ef1('0x1b')]===_0x4ef1('0x1a');var _0x1a86ef=_0xde3145[_0x4ef1('0x1c')];var _0x22b525=_0x27368a?0x0:_0x338e0a[_0x4ef1('0x19')];var _0xf89731=_0x27368a?_0xde3145[_0x4ef1('0x1c')]:_0x338e0a[_0x4ef1('0x19')]+_0x338e0a[_0x4ef1('0x1b')];var _0x4da2f0;if(_0xf89731>=_0x1a86ef){_0xf89731=_0x1a86ef;_0x4da2f0=0xc8;}else{_0x4da2f0=0xce;}_0x1c6371[_0x4ef1('0x17')](_0x4da2f0);return _0x1c6371[_0x4ef1('0x1d')](_0x4ef1('0x1e'),_0x22b525+'-'+_0xf89731+'/'+_0x1a86ef)[_0x4ef1('0x18')](_0xde3145);}return null;};}function patchUpdates(_0x44a1b2){return function(_0xd4e03a){try{jsonpatch['apply'](_0xd4e03a,_0x44a1b2,!![]);}catch(_0x1c70d5){return BPromise[_0x4ef1('0x1f')](_0x1c70d5);}return _0xd4e03a[_0x4ef1('0x20')]();};}function saveUpdates(_0x3dba85,_0x56a18c){return function(_0x483222){if(_0x483222){return _0x483222[_0x4ef1('0x21')](_0x3dba85)['then'](function(_0x3d6b45){return _0x3d6b45;});}return null;};}function removeEntity(_0x530c2a,_0x5d3e0b){return function(_0x859fff){if(_0x859fff){return _0x859fff[_0x4ef1('0x22')]()[_0x4ef1('0x23')](function(){_0x530c2a[_0x4ef1('0x17')](0xcc)[_0x4ef1('0x16')]();});}};}function handleEntityNotFound(_0xd29b08,_0x2fc891){return function(_0x2a60c0){if(!_0x2a60c0){_0xd29b08[_0x4ef1('0x15')](0x194);}return _0x2a60c0;};}function handleError(_0x227d16,_0x1cd3aa){_0x1cd3aa=_0x1cd3aa||0x1f4;return function(_0x4e94de){logger[_0x4ef1('0x24')](_0x4e94de[_0x4ef1('0x25')]);if(_0x4e94de[_0x4ef1('0x26')]){delete _0x4e94de[_0x4ef1('0x26')];}_0x227d16[_0x4ef1('0x17')](_0x1cd3aa)[_0x4ef1('0x27')](_0x4e94de);};}exports[_0x4ef1('0x21')]=function(_0x35e7cb,_0x27dac4){if(_0x35e7cb[_0x4ef1('0x28')]['id']){delete _0x35e7cb[_0x4ef1('0x28')]['id'];}return db[_0x4ef1('0x29')]['find']({'where':{'id':_0x35e7cb[_0x4ef1('0x2a')]['id']}})[_0x4ef1('0x23')](handleEntityNotFound(_0x27dac4,null))[_0x4ef1('0x23')](saveUpdates(_0x35e7cb[_0x4ef1('0x28')],null))[_0x4ef1('0x23')](respondWithResult(_0x27dac4,null))[_0x4ef1('0x2b')](handleError(_0x27dac4,null));};exports[_0x4ef1('0x22')]=function(_0x127690,_0x54b964){return db['Action'][_0x4ef1('0x2c')]({'where':{'id':_0x127690['params']['id']}})['then'](handleEntityNotFound(_0x54b964,null))[_0x4ef1('0x23')](removeEntity(_0x54b964,null))[_0x4ef1('0x2b')](handleError(_0x54b964,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index f68e419..543b9c2 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 _0x2357=['bluebird','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','api','moment'];(function(_0x4220d5,_0x249b4e){var _0x55e795=function(_0xf85ab8){while(--_0xf85ab8){_0x4220d5['push'](_0x4220d5['shift']());}};_0x55e795(++_0x249b4e);}(_0x2357,0x68));var _0x7235=function(_0x2de753,_0x4a544d){_0x2de753=_0x2de753-0x0;var _0x8e70a5=_0x2357[_0x2de753];return _0x8e70a5;};'use strict';var _=require(_0x7235('0x0'));var util=require(_0x7235('0x1'));var logger=require('../../config/logger')(_0x7235('0x2'));var moment=require(_0x7235('0x3'));var BPromise=require(_0x7235('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7235('0x5'));var rimraf=require('rimraf');var config=require(_0x7235('0x6'));var attributes=require(_0x7235('0x7'));module[_0x7235('0x8')]=function(_0x34202b,_0x3d601c){return _0x34202b[_0x7235('0x9')](_0x7235('0xa'),attributes,{'tableName':_0x7235('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6a1=['lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./action.attributes','exports','define','tools_actions'];(function(_0x15b51c,_0x49d742){var _0x54bdf3=function(_0x5c663a){while(--_0x5c663a){_0x15b51c['push'](_0x15b51c['shift']());}};_0x54bdf3(++_0x49d742);}(_0xb6a1,0x14a));var _0x1b6a=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xb6a1[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x1b6a('0x0'));var util=require(_0x1b6a('0x1'));var logger=require(_0x1b6a('0x2'))(_0x1b6a('0x3'));var moment=require('moment');var BPromise=require(_0x1b6a('0x4'));var rp=require(_0x1b6a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b6a('0x6'));var attributes=require(_0x1b6a('0x7'));module[_0x1b6a('0x8')]=function(_0x24a9c6,_0x4a9684){return _0x24a9c6[_0x1b6a('0x9')]('Action',attributes,{'tableName':_0x1b6a('0xa'),'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 0930cfe..de7f71b 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x4975,0x86));var _0x5497=function(_0xd2ff9a,_0x451c7a){_0xd2ff9a=_0xd2ff9a-0x0;var _0x113f16=_0x4975[_0xd2ff9a];return _0x113f16;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0x326f=['info','Action,\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(_0x1d94c8,_0x43f20e){var _0x27ff1b=function(_0x4a22fd){while(--_0x4a22fd){_0x1d94c8['push'](_0x1d94c8['shift']());}};_0x27ff1b(++_0x43f20e);}(_0x326f,0xd1));var _0xf326=function(_0x135128,_0x62d9b){_0x135128=_0x135128-0x0;var _0x579ef3=_0x326f[_0x135128];return _0x579ef3;};'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')]('Action,\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')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 4ecd914..9d9c3fb 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 _0xf1aa=['../../components/interaction/service','put','/:id','delete','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x2ec42b,_0x355ec5){var _0x1dedb0=function(_0x160606){while(--_0x160606){_0x2ec42b['push'](_0x2ec42b['shift']());}};_0x1dedb0(++_0x355ec5);}(_0xf1aa,0x180));var _0xaf1a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf1aa[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xaf1a('0x0'));var util=require(_0xaf1a('0x1'));var path=require('path');var timeout=require(_0xaf1a('0x2'));var express=require(_0xaf1a('0x3'));var router=express[_0xaf1a('0x4')]();var fs_extra=require(_0xaf1a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaf1a('0x6'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0xaf1a('0x7')](_0xaf1a('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xaf1a('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1f15=['./action.controller','/:id','isAuthenticated','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3a9635,_0x1ab817){var _0x10d08c=function(_0x222242){while(--_0x222242){_0x3a9635['push'](_0x3a9635['shift']());}};_0x10d08c(++_0x1ab817);}(_0x1f15,0x1a6));var _0x51f1=function(_0xa5e64d,_0x31d8d8){_0xa5e64d=_0xa5e64d-0x0;var _0x4a6b15=_0x1f15[_0xa5e64d];return _0x4a6b15;};'use strict';var multer=require(_0x51f1('0x0'));var util=require(_0x51f1('0x1'));var path=require(_0x51f1('0x2'));var timeout=require(_0x51f1('0x3'));var express=require(_0x51f1('0x4'));var router=express[_0x51f1('0x5')]();var fs_extra=require(_0x51f1('0x6'));var auth=require(_0x51f1('0x7'));var interaction=require(_0x51f1('0x8'));var config=require(_0x51f1('0x9'));var controller=require(_0x51f1('0xa'));router['put'](_0x51f1('0xb'),auth[_0x51f1('0xc')](),controller['update']);router[_0x51f1('0xd')](_0x51f1('0xb'),auth[_0x51f1('0xc')](),controller[_0x51f1('0xe')]);module[_0x51f1('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index f2aa79f..ad49e1a 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 _0x8958=['TEXT','exports'];(function(_0x487a0b,_0x33c302){var _0x4cb1ba=function(_0x2a3615){while(--_0x2a3615){_0x487a0b['push'](_0x487a0b['shift']());}};_0x4cb1ba(++_0x33c302);}(_0x8958,0x93));var _0x8895=function(_0x51796b,_0x29b154){_0x51796b=_0x51796b-0x0;var _0x5984a1=_0x8958[_0x51796b];return _0x5984a1;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x1883=['exports','STRING','TEXT','sequelize'];(function(_0x1fd7f5,_0x1dfc07){var _0x38aaaf=function(_0x247cd3){while(--_0x247cd3){_0x1fd7f5['push'](_0x1fd7f5['shift']());}};_0x38aaaf(++_0x1dfc07);}(_0x1883,0xab));var _0x3188=function(_0x2109ff,_0x59366e){_0x2109ff=_0x2109ff-0x0;var _0x1b22e6=_0x1883[_0x2109ff];return _0x1b22e6;};'use strict';var Sequelize=require(_0x3188('0x0'));module[_0x3188('0x1')]={'name':{'type':Sequelize[_0x3188('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3188('0x2')]},'parent':{'type':Sequelize[_0x3188('0x2')]},'table':{'type':Sequelize[_0x3188('0x2')]},'conditions':{'type':Sequelize[_0x3188('0x3')]},'joins':{'type':Sequelize[_0x3188('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 7b78113..37a43c9 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 _0x7cdc=['DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','condition','value','ValidationErrorItem','AnalyticMetric','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','DESC','field','alias','joins','parse','parentKey','foreignTable','foreignKey','format','conditions','clone','toString','sequelize','SELECT','cross_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','fullPath','%s-%s.%s','randomstring','generate','output','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','QueryTypes','run','left_join','COUNT(DISTINCT\x20%s)','getFields','%s.%s\x20=\x20%s.%s','debug','Limited\x20Query:','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','CustomReports','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','includeAll','include','findAll','catch','show','keys','length','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)'];(function(_0x5c795c,_0x3f3dce){var _0x4cb374=function(_0x443acd){while(--_0x443acd){_0x5c795c['push'](_0x5c795c['shift']());}};_0x4cb374(++_0x3f3dce);}(_0x7cdc,0x190));var _0xc7cd=function(_0x1efca4,_0x3cc95f){_0x1efca4=_0x1efca4-0x0;var _0x569629=_0x7cdc[_0x1efca4];return _0x569629;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc7cd('0x0'));var zipdir=require(_0xc7cd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc7cd('0x2'));var moment=require(_0xc7cd('0x3'));var BPromise=require(_0xc7cd('0x4'));var Mustache=require('mustache');var util=require(_0xc7cd('0x5'));var path=require(_0xc7cd('0x6'));var sox=require('sox');var csv=require(_0xc7cd('0x7'));var ejs=require(_0xc7cd('0x8'));var fs=require('fs');var fs_extra=require(_0xc7cd('0x9'));var _=require(_0xc7cd('0xa'));var squel=require(_0xc7cd('0xb'));var crypto=require(_0xc7cd('0xc'));var jsforce=require(_0xc7cd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc7cd('0x7'));var querystring=require('querystring');var Papa=require(_0xc7cd('0xe'));var Redis=require(_0xc7cd('0xf'));var authService=require(_0xc7cd('0x10'));var qs=require(_0xc7cd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc7cd('0x12'));var logger=require(_0xc7cd('0x13'))(_0xc7cd('0x14'));var utils=require(_0xc7cd('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc7cd('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0xc7cd('0x17'))[_0xc7cd('0x18')];function respondWithStatusCode(_0x1e2d07,_0x346e83){_0x346e83=_0x346e83||0xcc;return function(_0x508a48){if(_0x508a48){return _0x1e2d07[_0xc7cd('0x19')](_0x346e83);}return _0x1e2d07[_0xc7cd('0x1a')](_0x346e83)['end']();};}function respondWithResult(_0x3c9781,_0x5aa9a0){_0x5aa9a0=_0x5aa9a0||0xc8;return function(_0x25db6c){if(_0x25db6c){return _0x3c9781['status'](_0x5aa9a0)[_0xc7cd('0x1b')](_0x25db6c);}};}function respondWithFilteredResult(_0x2bbe07,_0x2f04cb){return function(_0x317b0b){if(_0x317b0b){var _0x494658=typeof _0x2f04cb[_0xc7cd('0x1c')]===_0xc7cd('0x1d')&&typeof _0x2f04cb[_0xc7cd('0x1e')]===_0xc7cd('0x1d');var _0xe93ad5=_0x317b0b[_0xc7cd('0x1f')];var _0x2d5825=_0x494658?0x0:_0x2f04cb[_0xc7cd('0x1c')];var _0xae5511=_0x494658?_0x317b0b['count']:_0x2f04cb[_0xc7cd('0x1c')]+_0x2f04cb['limit'];var _0xfcceb0;if(_0xae5511>=_0xe93ad5){_0xae5511=_0xe93ad5;_0xfcceb0=0xc8;}else{_0xfcceb0=0xce;}_0x2bbe07[_0xc7cd('0x1a')](_0xfcceb0);return _0x2bbe07[_0xc7cd('0x20')](_0xc7cd('0x21'),_0x2d5825+'-'+_0xae5511+'/'+_0xe93ad5)[_0xc7cd('0x1b')](_0x317b0b);}return null;};}function patchUpdates(_0x571012){return function(_0x27b5d5){try{jsonpatch[_0xc7cd('0x22')](_0x27b5d5,_0x571012,!![]);}catch(_0xf6b9db){return BPromise[_0xc7cd('0x23')](_0xf6b9db);}return _0x27b5d5['save']();};}function saveUpdates(_0x255330,_0x3bbe69){return function(_0x275f0b){if(_0x275f0b){return _0x275f0b[_0xc7cd('0x24')](_0x255330)['then'](function(_0x4e47b0){return _0x4e47b0;});}return null;};}function removeEntity(_0x4f2259,_0x3b92a2){return function(_0x577e4a){if(_0x577e4a){return _0x577e4a[_0xc7cd('0x25')]()[_0xc7cd('0x26')](function(){var _0x2932fe=_0x577e4a[_0xc7cd('0x27')]({'plain':!![]});var _0x4450a5=_0xc7cd('0x28');return db['UserProfileResource'][_0xc7cd('0x25')]({'where':{'type':_0x4450a5,'resourceId':_0x2932fe['id']}})[_0xc7cd('0x26')](function(){return _0x577e4a;});})[_0xc7cd('0x26')](function(){_0x4f2259[_0xc7cd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x325792,_0x3994ae){return function(_0x104046){if(!_0x104046){_0x325792[_0xc7cd('0x19')](0x194);}return _0x104046;};}function handleError(_0x4ed88b,_0x19aa4a){_0x19aa4a=_0x19aa4a||0x1f4;return function(_0x22be13){logger['error'](_0x22be13['stack']);if(_0x22be13[_0xc7cd('0x29')]){delete _0x22be13[_0xc7cd('0x29')];}_0x4ed88b[_0xc7cd('0x1a')](_0x19aa4a)[_0xc7cd('0x2a')](_0x22be13);};}exports['index']=function(_0x1d5d4c,_0x82be3){var _0x5ed4d5={},_0x1b7f72={},_0x4ed12a={'count':0x0,'rows':[]};var _0x2ede39=_[_0xc7cd('0x2b')](db[_0xc7cd('0x2c')][_0xc7cd('0x2d')],function(_0x15d4cf){return{'name':_0x15d4cf[_0xc7cd('0x2e')],'type':_0x15d4cf[_0xc7cd('0x2f')][_0xc7cd('0x30')]};});_0x1b7f72['model']=_['map'](_0x2ede39,_0xc7cd('0x29'));_0x1b7f72['query']=_['keys'](_0x1d5d4c[_0xc7cd('0x31')]);_0x1b7f72[_0xc7cd('0x32')]=_[_0xc7cd('0x33')](_0x1b7f72[_0xc7cd('0x34')],_0x1b7f72['query']);_0x5ed4d5[_0xc7cd('0x35')]=_[_0xc7cd('0x33')](_0x1b7f72[_0xc7cd('0x34')],qs[_0xc7cd('0x36')](_0x1d5d4c[_0xc7cd('0x31')]['fields']));_0x5ed4d5[_0xc7cd('0x35')]=_0x5ed4d5[_0xc7cd('0x35')]['length']?_0x5ed4d5[_0xc7cd('0x35')]:_0x1b7f72[_0xc7cd('0x34')];if(!_0x1d5d4c[_0xc7cd('0x31')][_0xc7cd('0x37')]('nolimit')){_0x5ed4d5[_0xc7cd('0x1e')]=qs[_0xc7cd('0x1e')](_0x1d5d4c[_0xc7cd('0x31')][_0xc7cd('0x1e')]);_0x5ed4d5[_0xc7cd('0x1c')]=qs[_0xc7cd('0x1c')](_0x1d5d4c[_0xc7cd('0x31')][_0xc7cd('0x1c')]);}_0x5ed4d5[_0xc7cd('0x38')]=qs[_0xc7cd('0x39')](_0x1d5d4c['query'][_0xc7cd('0x39')]);_0x5ed4d5['where']=qs[_0xc7cd('0x32')](_[_0xc7cd('0x3a')](_0x1d5d4c[_0xc7cd('0x31')],_0x1b7f72[_0xc7cd('0x32')]),_0x2ede39);if(_0x1d5d4c[_0xc7cd('0x31')][_0xc7cd('0x3b')]){_0x5ed4d5['where']=_['merge'](_0x5ed4d5[_0xc7cd('0x3c')],{'$or':_[_0xc7cd('0x2b')](_0x2ede39,function(_0x6b2a7d){if(_0x6b2a7d['type']!==_0xc7cd('0x3d')){var _0x8271c4={};_0x8271c4[_0x6b2a7d[_0xc7cd('0x29')]]={'$like':'%'+_0x1d5d4c[_0xc7cd('0x31')][_0xc7cd('0x3b')]+'%'};return _0x8271c4;}})});}_0x5ed4d5=_['merge']({},_0x5ed4d5,_0x1d5d4c['options']);var _0x44ae6f={'where':_0x5ed4d5[_0xc7cd('0x3c')]};return db[_0xc7cd('0x2c')]['count'](_0x44ae6f)[_0xc7cd('0x26')](function(_0x25f6c9){_0x4ed12a[_0xc7cd('0x1f')]=_0x25f6c9;if(_0x1d5d4c[_0xc7cd('0x31')][_0xc7cd('0x3e')]){_0x5ed4d5[_0xc7cd('0x3f')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xc7cd('0x40')](_0x5ed4d5);})[_0xc7cd('0x26')](function(_0x1c85f0){_0x4ed12a['rows']=_0x1c85f0;return _0x4ed12a;})['then'](respondWithFilteredResult(_0x82be3,_0x5ed4d5))[_0xc7cd('0x41')](handleError(_0x82be3,null));};exports[_0xc7cd('0x42')]=function(_0x328a56,_0x3ca461){var _0x7d4ed8={'raw':![],'where':{'id':_0x328a56['params']['id']}},_0x538106={};_0x538106[_0xc7cd('0x34')]=_[_0xc7cd('0x43')](db[_0xc7cd('0x2c')][_0xc7cd('0x2d')]);_0x538106[_0xc7cd('0x31')]=_[_0xc7cd('0x43')](_0x328a56['query']);_0x538106[_0xc7cd('0x32')]=_[_0xc7cd('0x33')](_0x538106[_0xc7cd('0x34')],_0x538106[_0xc7cd('0x31')]);_0x7d4ed8[_0xc7cd('0x35')]=_[_0xc7cd('0x33')](_0x538106[_0xc7cd('0x34')],qs[_0xc7cd('0x36')](_0x328a56[_0xc7cd('0x31')][_0xc7cd('0x36')]));_0x7d4ed8[_0xc7cd('0x35')]=_0x7d4ed8[_0xc7cd('0x35')][_0xc7cd('0x44')]?_0x7d4ed8[_0xc7cd('0x35')]:_0x538106['model'];if(_0x328a56[_0xc7cd('0x31')][_0xc7cd('0x3e')]){_0x7d4ed8['include']=[{'all':!![]}];}_0x7d4ed8=_[_0xc7cd('0x45')]({},_0x7d4ed8,_0x328a56[_0xc7cd('0x46')]);return db[_0xc7cd('0x2c')][_0xc7cd('0x47')](_0x7d4ed8)[_0xc7cd('0x26')](handleEntityNotFound(_0x3ca461,null))[_0xc7cd('0x26')](respondWithResult(_0x3ca461,null))[_0xc7cd('0x41')](handleError(_0x3ca461,null));};exports[_0xc7cd('0x48')]=function(_0x38eda8,_0x11a0a3){return db[_0xc7cd('0x2c')][_0xc7cd('0x48')](_0x38eda8[_0xc7cd('0x49')],{})[_0xc7cd('0x26')](function(_0x553c68){var _0x598aa0=_0x38eda8['user']['get']({'plain':!![]});if(!_0x598aa0)throw new Error(_0xc7cd('0x4a'));if(_0x598aa0[_0xc7cd('0x4b')]===_0xc7cd('0x4c')){var _0xe6ec8d=_0x553c68[_0xc7cd('0x27')]({'plain':!![]});var _0x32d9e9=_0xc7cd('0x4d');return db[_0xc7cd('0x4e')][_0xc7cd('0x47')]({'where':{'name':_0x32d9e9,'userProfileId':_0x598aa0[_0xc7cd('0x4f')]},'raw':!![]})[_0xc7cd('0x26')](function(_0x330149){if(_0x330149&&_0x330149[_0xc7cd('0x50')]===0x0){return db[_0xc7cd('0x51')][_0xc7cd('0x48')]({'name':_0xe6ec8d['name'],'resourceId':_0xe6ec8d['id'],'type':_0xc7cd('0x28'),'sectionId':_0x330149['id']},{})[_0xc7cd('0x26')](function(){return _0x553c68;});}else{return _0x553c68;}})[_0xc7cd('0x41')](function(_0x558700){logger['error'](_0xc7cd('0x52'),_0x558700);throw _0x558700;});}return _0x553c68;})['then'](respondWithResult(_0x11a0a3,0xc9))['catch'](handleError(_0x11a0a3,null));};exports['update']=function(_0x15548d,_0x208b93){if(_0x15548d[_0xc7cd('0x49')]['id']){delete _0x15548d[_0xc7cd('0x49')]['id'];}return db['AnalyticCustomReport'][_0xc7cd('0x47')]({'where':{'id':_0x15548d[_0xc7cd('0x53')]['id']}})[_0xc7cd('0x26')](handleEntityNotFound(_0x208b93,null))[_0xc7cd('0x26')](saveUpdates(_0x15548d[_0xc7cd('0x49')],null))[_0xc7cd('0x26')](respondWithResult(_0x208b93,null))[_0xc7cd('0x41')](handleError(_0x208b93,null));};exports[_0xc7cd('0x25')]=function(_0x426ed7,_0x568d3d){return db[_0xc7cd('0x2c')][_0xc7cd('0x47')]({'where':{'id':_0x426ed7[_0xc7cd('0x53')]['id']}})['then'](handleEntityNotFound(_0x568d3d,null))['then'](removeEntity(_0x568d3d,null))[_0xc7cd('0x41')](handleError(_0x568d3d,null));};exports[_0xc7cd('0x54')]=function(_0x55a427,_0x3294e7){var _0x3b2c02=0xa;var _0x23b802=[_0xc7cd('0x55'),'left_join',_0xc7cd('0x56'),'cross_join'];var _0x2389b8={'SUM':_0xc7cd('0x57'),'COUNT':_0xc7cd('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc7cd('0x59'),'MIN':_0xc7cd('0x5a'),'AVG':_0xc7cd('0x5b'),'GROUP_CONCAT':_0xc7cd('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc7cd('0x5d')};var _0xc4eaef={'SEC_TO_TIME':_0xc7cd('0x5e'),'DATE':_0xc7cd('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xc7cd('0x60'),'UNIX_TIMESTAMP':_0xc7cd('0x61')};var _0x1e6481=function(_0x2d3091){return!_[_0xc7cd('0x62')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xc7cd('0x63'),'IS\x20NOT\x20EMPTY'],_0x2d3091);};var _0x5df73c=function(_0x4a71af){if(!_0x4a71af||!_0x4a71af[_0xc7cd('0x64')]['length']){return'';}for(var _0x37436e='(',_0x105347=0x0;_0x105347<_0x4a71af[_0xc7cd('0x64')]['length'];_0x105347+=0x1){_0x105347>0x0&&(_0x37436e+='\x20'+_0x4a71af[_0xc7cd('0x65')]+'\x20');_0x37436e+=_0x4a71af[_0xc7cd('0x64')][_0x105347][_0xc7cd('0x66')]?_0x5df73c(_0x4a71af[_0xc7cd('0x64')][_0x105347][_0xc7cd('0x66')]):_0x4a71af[_0xc7cd('0x64')][_0x105347]['field']+'\x20'+_0x4a71af['rules'][_0x105347][_0xc7cd('0x67')]+(_0x1e6481(_0x4a71af['rules'][_0x105347]['condition'])?'\x20'+_0x4a71af[_0xc7cd('0x64')][_0x105347][_0xc7cd('0x68')]:'');}return _0x37436e+')';};var _0x20e997={'where':{'id':_0x55a427[_0xc7cd('0x53')]['id']}},_0x25f4cb,_0xeb8e3c,_0x3f4be6,_0x50d66e,_0x1257f3;_0x20e997=_[_0xc7cd('0x45')]({},_0x20e997,_0x55a427[_0xc7cd('0x46')]);return db[_0xc7cd('0x2c')]['find'](_0x20e997)[_0xc7cd('0x26')](function(_0xfc0d64){if(_0xfc0d64){_0x25f4cb=_0xfc0d64;return _0xfc0d64['getFields']();}return null;})[_0xc7cd('0x26')](function(_0x5ccf85){if(_0x5ccf85){if(!_0x5ccf85[_0xc7cd('0x44')]){throw new db['Sequelize'][(_0xc7cd('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xeb8e3c=_0x5ccf85;return db[_0xc7cd('0x6a')][_0xc7cd('0x40')]({'raw':!![]});}return null;})['then'](function(_0xf4dc9d){if(_0xf4dc9d){_0x3f4be6=_['keyBy'](_0xf4dc9d,'id');var _0x266ef3;var _0x30bb8d=squel[_0xc7cd('0x6b')]();_0x30bb8d[_0xc7cd('0x6c')](_0x25f4cb[_0xc7cd('0x6d')]);for(var _0x537f82=0x0;_0x537f82<_0xeb8e3c[_0xc7cd('0x44')];_0x537f82+=0x1){_0x266ef3=_0xeb8e3c[_0x537f82][_0xc7cd('0x6e')]?_0x3f4be6[_0xeb8e3c[_0x537f82][_0xc7cd('0x6e')]][_0xc7cd('0x6f')]:_0xeb8e3c[_0x537f82]['field'];_0x266ef3=_0xeb8e3c[_0x537f82][_0xc7cd('0x70')]?_['replace'](_0x2389b8[_0xeb8e3c[_0x537f82][_0xc7cd('0x70')]],'%s',_0x266ef3):_0x266ef3;_0x266ef3=_0xeb8e3c[_0x537f82]['format']?_[_0xc7cd('0x71')](_0xc4eaef[_0xeb8e3c[_0x537f82]['format']],'%s',_0x266ef3):_0x266ef3;if(_0xeb8e3c[_0x537f82][_0xc7cd('0x72')]){_0x30bb8d[_0xc7cd('0x66')](_0x266ef3);}_0xeb8e3c[_0x537f82][_0xc7cd('0x73')]&&_0x30bb8d[_0xc7cd('0x38')](_0x266ef3,_0xeb8e3c[_0x537f82][_0xc7cd('0x73')]===_0xc7cd('0x74')?![]:!![]);_0x30bb8d[_0xc7cd('0x75')](_0x266ef3,_0xeb8e3c[_0x537f82][_0xc7cd('0x76')]||_0x266ef3);}if(_0x25f4cb[_0xc7cd('0x77')]){_0x25f4cb[_0xc7cd('0x77')]=JSON[_0xc7cd('0x78')](_0x25f4cb[_0xc7cd('0x77')]);for(var _0x5c17f6=0x0;_0x5c17f6<_0x25f4cb[_0xc7cd('0x77')][_0xc7cd('0x44')];_0x5c17f6+=0x1){if(_0x25f4cb['joins'][_0x5c17f6][_0xc7cd('0x2f')]&&_[_0xc7cd('0x62')](_0x23b802,_0x25f4cb[_0xc7cd('0x77')][_0x5c17f6][_0xc7cd('0x2f')])&&_0x25f4cb[_0xc7cd('0x77')][_0x5c17f6][_0xc7cd('0x79')]&&_0x25f4cb[_0xc7cd('0x77')][_0x5c17f6][_0xc7cd('0x7a')]&&_0x25f4cb[_0xc7cd('0x77')][_0x5c17f6][_0xc7cd('0x7b')]){_0x30bb8d[_0x25f4cb[_0xc7cd('0x77')][_0x5c17f6][_0xc7cd('0x2f')]](_0x25f4cb[_0xc7cd('0x77')][_0x5c17f6][_0xc7cd('0x7a')],null,util[_0xc7cd('0x7c')]('%s.%s\x20=\x20%s.%s',_0x25f4cb[_0xc7cd('0x6d')],_0x25f4cb[_0xc7cd('0x77')][_0x5c17f6][_0xc7cd('0x79')],_0x25f4cb[_0xc7cd('0x77')][_0x5c17f6][_0xc7cd('0x7a')],_0x25f4cb[_0xc7cd('0x77')][_0x5c17f6][_0xc7cd('0x7b')]));}}}if(_0x25f4cb[_0xc7cd('0x7d')]){_0x25f4cb[_0xc7cd('0x7d')]=JSON['parse'](_0x25f4cb[_0xc7cd('0x7d')]);_0x30bb8d[_0xc7cd('0x3c')](_0x5df73c(_0x25f4cb[_0xc7cd('0x7d')][_0xc7cd('0x66')]));}_0x1257f3=_0x30bb8d[_0xc7cd('0x7e')]();_0x30bb8d['limit'](_0x3b2c02);_0x30bb8d['offset'](0x0);logger['debug']('Limited\x20Query:',_0x30bb8d[_0xc7cd('0x7f')]());return dbH['sequelize'][_0xc7cd('0x31')](_0x30bb8d[_0xc7cd('0x7f')](),{'type':dbH[_0xc7cd('0x80')]['QueryTypes'][_0xc7cd('0x81')]});}})[_0xc7cd('0x26')](respondWithResult(_0x3294e7,null))[_0xc7cd('0x41')](handleError(_0x3294e7,null));};function runReport(_0x9e91d3,_0x6c2b03,_0x5e8de0){var _0x435bc9=_0x6c2b03[_0xc7cd('0x29')];var _0x19b5f3=0xa;var _0x421a38=[_0xc7cd('0x55'),'left_join',_0xc7cd('0x56'),_0xc7cd('0x82')];var _0x23b016={'SUM':_0xc7cd('0x57'),'COUNT':_0xc7cd('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc7cd('0x59'),'MIN':'MIN(%s)','AVG':_0xc7cd('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc7cd('0x83'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3fb3f3={'SEC_TO_TIME':_0xc7cd('0x5e'),'DATE':_0xc7cd('0x5f'),'HOUR':_0xc7cd('0x84'),'ROUND':_0xc7cd('0x60'),'UNIX_TIMESTAMP':_0xc7cd('0x61')};var _0x4e2abe=function(_0x27e3f9){return!_[_0xc7cd('0x62')]([_0xc7cd('0x85'),_0xc7cd('0x86'),_0xc7cd('0x63'),_0xc7cd('0x87')],_0x27e3f9);};var _0x17f986=function(_0x5e60b6){if(!_0x5e60b6||!_0x5e60b6[_0xc7cd('0x64')]['length']){return'';}for(var _0x3ab39f='(',_0x15aecf=0x0;_0x15aecf<_0x5e60b6['rules'][_0xc7cd('0x44')];_0x15aecf+=0x1){_0x15aecf>0x0&&(_0x3ab39f+='\x20'+_0x5e60b6['operator']+'\x20');_0x3ab39f+=_0x5e60b6['rules'][_0x15aecf]['group']?_0x17f986(_0x5e60b6[_0xc7cd('0x64')][_0x15aecf][_0xc7cd('0x66')]):_0x5e60b6[_0xc7cd('0x64')][_0x15aecf][_0xc7cd('0x75')]+'\x20'+_0x5e60b6[_0xc7cd('0x64')][_0x15aecf]['condition']+(_0x4e2abe(_0x5e60b6[_0xc7cd('0x64')][_0x15aecf][_0xc7cd('0x67')])?'\x20'+_0x5e60b6['rules'][_0x15aecf][_0xc7cd('0x68')]:'');}return _0x3ab39f+')';};var _0x5bcd73={'where':{'id':_0x9e91d3['id']}},_0x2c1dda,_0x3e1b7b,_0x3f1d23,_0x27fc71,_0x24348d;_0x5bcd73=_[_0xc7cd('0x45')]({},_0x5bcd73,_0x5e8de0);return db[_0xc7cd('0x2c')][_0xc7cd('0x47')](_0x5bcd73)[_0xc7cd('0x26')](function(_0x3dbcf1){if(_0x3dbcf1){_0x2c1dda=_0x3dbcf1;return _0x3dbcf1['getFields']();}return null;})['then'](function(_0x3d9a83){if(_0x3d9a83){if(!_0x3d9a83[_0xc7cd('0x44')]){throw new db[(_0xc7cd('0x88'))][(_0xc7cd('0x69'))](_0xc7cd('0x89'),0x193);}_0x3e1b7b=_0x3d9a83;return db['AnalyticMetric'][_0xc7cd('0x40')]({'raw':!![]});}return null;})[_0xc7cd('0x26')](function(_0x12527d){if(_0x12527d){_0x3f1d23=_[_0xc7cd('0x8a')](_0x12527d,'id');var _0x1cc786;var _0x4ee78e=squel['select']();_0x4ee78e[_0xc7cd('0x6c')](_0x2c1dda[_0xc7cd('0x6d')]);for(var _0x548a3f=0x0;_0x548a3f<_0x3e1b7b[_0xc7cd('0x44')];_0x548a3f+=0x1){_0x1cc786=_0x3e1b7b[_0x548a3f][_0xc7cd('0x6e')]?_0x3f1d23[_0x3e1b7b[_0x548a3f][_0xc7cd('0x6e')]][_0xc7cd('0x6f')]:_0x3e1b7b[_0x548a3f][_0xc7cd('0x75')];_0x1cc786=_0x3e1b7b[_0x548a3f]['function']?_[_0xc7cd('0x71')](_0x23b016[_0x3e1b7b[_0x548a3f][_0xc7cd('0x70')]],'%s',_0x1cc786):_0x1cc786;_0x1cc786=_0x3e1b7b[_0x548a3f]['format']?_[_0xc7cd('0x71')](_0x3fb3f3[_0x3e1b7b[_0x548a3f][_0xc7cd('0x7c')]],'%s',_0x1cc786):_0x1cc786;if(_0x3e1b7b[_0x548a3f][_0xc7cd('0x72')]){_0x4ee78e[_0xc7cd('0x66')](_0x1cc786);}_0x3e1b7b[_0x548a3f][_0xc7cd('0x73')]&&_0x4ee78e['order'](_0x1cc786,_0x3e1b7b[_0x548a3f]['orderBy']===_0xc7cd('0x74')?![]:!![]);_0x4ee78e[_0xc7cd('0x75')](_0x1cc786,_0x3e1b7b[_0x548a3f]['alias']||_0x1cc786);}if(_0x2c1dda[_0xc7cd('0x77')]){_0x2c1dda['joins']=JSON[_0xc7cd('0x78')](_0x2c1dda[_0xc7cd('0x77')]);for(var _0x27c2ad=0x0;_0x27c2ad<_0x2c1dda[_0xc7cd('0x77')][_0xc7cd('0x44')];_0x27c2ad+=0x1){if(_0x2c1dda[_0xc7cd('0x77')][_0x27c2ad][_0xc7cd('0x2f')]&&_[_0xc7cd('0x62')](_0x421a38,_0x2c1dda[_0xc7cd('0x77')][_0x27c2ad][_0xc7cd('0x2f')])&&_0x2c1dda[_0xc7cd('0x77')][_0x27c2ad][_0xc7cd('0x79')]&&_0x2c1dda[_0xc7cd('0x77')][_0x27c2ad][_0xc7cd('0x7a')]&&_0x2c1dda[_0xc7cd('0x77')][_0x27c2ad][_0xc7cd('0x7b')]){_0x4ee78e[_0x2c1dda[_0xc7cd('0x77')][_0x27c2ad][_0xc7cd('0x2f')]](_0x2c1dda[_0xc7cd('0x77')][_0x27c2ad][_0xc7cd('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2c1dda['table'],_0x2c1dda[_0xc7cd('0x77')][_0x27c2ad][_0xc7cd('0x79')],_0x2c1dda['joins'][_0x27c2ad][_0xc7cd('0x7a')],_0x2c1dda[_0xc7cd('0x77')][_0x27c2ad][_0xc7cd('0x7b')]));}}}if(_0x2c1dda[_0xc7cd('0x7d')]){_0x2c1dda[_0xc7cd('0x7d')]=JSON['parse'](_0x2c1dda[_0xc7cd('0x7d')]);_0x4ee78e[_0xc7cd('0x3c')](_0x17f986(_0x2c1dda['conditions'][_0xc7cd('0x66')]));}_0x24348d=_0x4ee78e[_0xc7cd('0x7e')]();_0x4ee78e[_0xc7cd('0x1e')](_0x19b5f3);_0x4ee78e['offset'](0x0);return;}})[_0xc7cd('0x26')](function(){if(_0x6c2b03['output']==='web'){return null;}var _0x53cc00=_[_0xc7cd('0x45')](_0x6c2b03,{'name':_0x6c2b03[_0xc7cd('0x8b')]||_0x6c2b03[_0xc7cd('0x29')]||_0x2c1dda[_0xc7cd('0x29')],'basename':_0x435bc9,'savename':util[_0xc7cd('0x7c')](_0xc7cd('0x8c'),_0x6c2b03[_0xc7cd('0x29')]||_0x2c1dda[_0xc7cd('0x29')],require(_0xc7cd('0x8d'))[_0xc7cd('0x8e')](0x4),_0x6c2b03[_0xc7cd('0x8f')]||'csv'),'reportId':_0x2c1dda['id'],'reportType':_0xc7cd('0x90')});return db['AnalyticExtractedReport']['create'](_0x53cc00,{'raw':!![]});})[_0xc7cd('0x26')](function(_0x4bbbf1){if(_0x2c1dda[_0xc7cd('0x6d')]===_0xc7cd('0x91')){_0x24348d[_0xc7cd('0x3c')](_0x2c1dda[_0xc7cd('0x6d')]+_0xc7cd('0x92'),_0x6c2b03[_0xc7cd('0x93')],_0x6c2b03[_0xc7cd('0x94')]);}else{_0x24348d[_0xc7cd('0x3c')](_0x2c1dda[_0xc7cd('0x6d')]+_0xc7cd('0x95'),_0x6c2b03['startDate'],_0x6c2b03[_0xc7cd('0x94')]);}if(_0x4bbbf1){logger[_0xc7cd('0x96')](_0xc7cd('0x97'),_0x24348d[_0xc7cd('0x7f')]());require(_0xc7cd('0x98'))[_0xc7cd('0x99')](path[_0xc7cd('0x55')](__dirname,_0xc7cd('0x9a'),_0x4bbbf1[_0xc7cd('0x8f')]),[_0x4bbbf1['id'],_0x24348d[_0xc7cd('0x7f')](),path[_0xc7cd('0x55')](__dirname,_0xc7cd('0x9b'),_0x4bbbf1['savename']),_0x435bc9]);return _0x4bbbf1;}else{var _0x5f2495=squel[_0xc7cd('0x6b')]();_0x5f2495['from']('('+_0x24348d[_0xc7cd('0x7f')]()+')',_0xc7cd('0x9c'));_0x5f2495[_0xc7cd('0x75')]('COUNT(*)','count');_0x24348d[_0xc7cd('0x1e')](_0x6c2b03[_0xc7cd('0x1e')]||_0x19b5f3);_0x24348d[_0xc7cd('0x1c')](_0x6c2b03[_0xc7cd('0x1c')]||0x0);return dbH['sequelize']['query'](_0x5f2495[_0xc7cd('0x7f')](),{'type':dbH[_0xc7cd('0x80')][_0xc7cd('0x9d')]['SELECT']})[_0xc7cd('0x26')](function(_0x5edd12){if(!_0x5edd12[_0xc7cd('0x44')]){_0x27fc71=0x0;}else{_0x27fc71=_0x5edd12[0x0][_0xc7cd('0x1f')]||0x0;}return dbH[_0xc7cd('0x80')]['query'](_0x24348d[_0xc7cd('0x7f')](),{'type':dbH[_0xc7cd('0x80')][_0xc7cd('0x9d')][_0xc7cd('0x81')]});})[_0xc7cd('0x26')](function(_0x332a04){return{'rows':_0x332a04||[],'count':_0x27fc71};});}});}exports[_0xc7cd('0x9e')]=function(_0x3e210d,_0x1601b4){return runReport(_0x3e210d['params'],_0x3e210d['query'],_0x3e210d[_0xc7cd('0x46')])['then'](respondWithResult(_0x1601b4,null))[_0xc7cd('0x41')](handleError(_0x1601b4,null));};exports['runReport']=runReport;exports[_0xc7cd('0x31')]=function(_0x4f5356,_0x34da29){var _0x462a1f=0xa;var _0x1fdbd7=[_0xc7cd('0x55'),_0xc7cd('0x9f'),_0xc7cd('0x56'),_0xc7cd('0x82')];var _0x103955={'SUM':_0xc7cd('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc7cd('0xa0'),'MAX':'MAX(%s)','MIN':_0xc7cd('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xc7cd('0x5c'),'GROUP_CONCAT ASC':_0xc7cd('0x83'),'GROUP_CONCAT DESC':_0xc7cd('0x5d')};var _0x31b609={'SEC_TO_TIME':_0xc7cd('0x5e'),'DATE':_0xc7cd('0x5f'),'HOUR':_0xc7cd('0x84'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc7cd('0x61')};var _0x46c720=function(_0xd9feab){return!_['includes']([_0xc7cd('0x85'),_0xc7cd('0x86'),_0xc7cd('0x63'),'IS\x20NOT\x20EMPTY'],_0xd9feab);};var _0x1bb9af=function(_0x23ed3d){if(!_0x23ed3d||!_0x23ed3d[_0xc7cd('0x64')][_0xc7cd('0x44')]){return'';}for(var _0x3de390='(',_0x47d8ca=0x0;_0x47d8ca<_0x23ed3d[_0xc7cd('0x64')][_0xc7cd('0x44')];_0x47d8ca+=0x1){_0x47d8ca>0x0&&(_0x3de390+='\x20'+_0x23ed3d[_0xc7cd('0x65')]+'\x20');_0x3de390+=_0x23ed3d[_0xc7cd('0x64')][_0x47d8ca][_0xc7cd('0x66')]?_0x1bb9af(_0x23ed3d[_0xc7cd('0x64')][_0x47d8ca]['group']):_0x23ed3d[_0xc7cd('0x64')][_0x47d8ca]['field']+'\x20'+_0x23ed3d[_0xc7cd('0x64')][_0x47d8ca][_0xc7cd('0x67')]+(_0x46c720(_0x23ed3d['rules'][_0x47d8ca][_0xc7cd('0x67')])?'\x20'+_0x23ed3d[_0xc7cd('0x64')][_0x47d8ca]['value']:'');}return _0x3de390+')';};var _0x46d4e5={'where':{'id':_0x4f5356[_0xc7cd('0x53')]['id']}},_0x37ccc4,_0x169cef,_0x5cdc6c,_0x1d291c,_0x232357;_0x46d4e5=_[_0xc7cd('0x45')]({},_0x46d4e5,_0x4f5356[_0xc7cd('0x46')]);return db[_0xc7cd('0x2c')][_0xc7cd('0x47')](_0x46d4e5)[_0xc7cd('0x26')](function(_0x4d3c6f){if(_0x4d3c6f){_0x37ccc4=_0x4d3c6f;return _0x4d3c6f[_0xc7cd('0xa1')]();}return null;})[_0xc7cd('0x26')](function(_0x33c3f4){if(_0x33c3f4){if(!_0x33c3f4[_0xc7cd('0x44')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc7cd('0x89'),0x193);}_0x169cef=_0x33c3f4;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xc7cd('0x26')](function(_0x352936){if(_0x352936){_0x5cdc6c=_['keyBy'](_0x352936,'id');var _0x5cbc31;var _0xaa68de=squel[_0xc7cd('0x6b')]();_0xaa68de[_0xc7cd('0x6c')](_0x37ccc4[_0xc7cd('0x6d')]);for(var _0x4ce227=0x0;_0x4ce227<_0x169cef['length'];_0x4ce227+=0x1){_0x5cbc31=_0x169cef[_0x4ce227][_0xc7cd('0x6e')]?_0x5cdc6c[_0x169cef[_0x4ce227]['MetricId']][_0xc7cd('0x6f')]:_0x169cef[_0x4ce227][_0xc7cd('0x75')];_0x5cbc31=_0x169cef[_0x4ce227]['function']?_[_0xc7cd('0x71')](_0x103955[_0x169cef[_0x4ce227]['function']],'%s',_0x5cbc31):_0x5cbc31;_0x5cbc31=_0x169cef[_0x4ce227]['format']?_[_0xc7cd('0x71')](_0x31b609[_0x169cef[_0x4ce227]['format']],'%s',_0x5cbc31):_0x5cbc31;if(_0x169cef[_0x4ce227][_0xc7cd('0x72')]){_0xaa68de['group'](_0x5cbc31);}_0x169cef[_0x4ce227]['orderBy']&&_0xaa68de[_0xc7cd('0x38')](_0x5cbc31,_0x169cef[_0x4ce227][_0xc7cd('0x73')]===_0xc7cd('0x74')?![]:!![]);_0xaa68de[_0xc7cd('0x75')](_0x5cbc31,_0x169cef[_0x4ce227][_0xc7cd('0x76')]||_0x5cbc31);}if(_0x37ccc4[_0xc7cd('0x77')]){_0x37ccc4['joins']=JSON[_0xc7cd('0x78')](_0x37ccc4[_0xc7cd('0x77')]);for(var _0xfcd37=0x0;_0xfcd37<_0x37ccc4[_0xc7cd('0x77')]['length'];_0xfcd37+=0x1){if(_0x37ccc4[_0xc7cd('0x77')][_0xfcd37][_0xc7cd('0x2f')]&&_[_0xc7cd('0x62')](_0x1fdbd7,_0x37ccc4['joins'][_0xfcd37]['type'])&&_0x37ccc4[_0xc7cd('0x77')][_0xfcd37][_0xc7cd('0x79')]&&_0x37ccc4[_0xc7cd('0x77')][_0xfcd37][_0xc7cd('0x7a')]&&_0x37ccc4['joins'][_0xfcd37]['foreignKey']){_0xaa68de[_0x37ccc4[_0xc7cd('0x77')][_0xfcd37][_0xc7cd('0x2f')]](_0x37ccc4[_0xc7cd('0x77')][_0xfcd37][_0xc7cd('0x7a')],null,util[_0xc7cd('0x7c')](_0xc7cd('0xa2'),_0x37ccc4[_0xc7cd('0x6d')],_0x37ccc4['joins'][_0xfcd37][_0xc7cd('0x79')],_0x37ccc4[_0xc7cd('0x77')][_0xfcd37]['foreignTable'],_0x37ccc4['joins'][_0xfcd37][_0xc7cd('0x7b')]));}}}if(_0x37ccc4[_0xc7cd('0x7d')]){_0x37ccc4[_0xc7cd('0x7d')]=JSON[_0xc7cd('0x78')](_0x37ccc4[_0xc7cd('0x7d')]);_0xaa68de['where'](_0x1bb9af(_0x37ccc4[_0xc7cd('0x7d')][_0xc7cd('0x66')]));}_0x232357=_0xaa68de[_0xc7cd('0x7e')]();_0xaa68de[_0xc7cd('0x1e')](_0x462a1f);_0xaa68de['offset'](0x0);logger[_0xc7cd('0xa3')](_0xc7cd('0xa4'),_0xaa68de[_0xc7cd('0x7f')]());return dbH[_0xc7cd('0x80')]['query'](_0xaa68de['toString'](),{'type':dbH[_0xc7cd('0x80')]['QueryTypes'][_0xc7cd('0x81')]});}})[_0xc7cd('0x26')](function(){return{'sql':_0x232357[_0xc7cd('0x7f')]()};})[_0xc7cd('0x26')](respondWithResult(_0x34da29,null))['catch'](handleError(_0x34da29,null));}; \ No newline at end of file +var _0x6149=['run','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','update','UserProfileResource','destroy','then','error','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','AnalyticCustomReport','count','includeAll','include','findAll','catch','show','params','rawAttributes','length','create','body','user','get','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','toString','sequelize','join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','SEC_TO_TIME(%s)','HOUR(%s)','IS\x20NULL','IS\x20NOT\x20EMPTY','value','keyBy','select','groupBy','web','fullPath','%s-%s.%s','generate','output','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','SELECT'];(function(_0x42fad8,_0x27d529){var _0x1f1705=function(_0x55ff33){while(--_0x55ff33){_0x42fad8['push'](_0x42fad8['shift']());}};_0x1f1705(++_0x27d529);}(_0x6149,0xaa));var _0x9614=function(_0x538406,_0x25c40b){_0x538406=_0x538406-0x0;var _0x18f8fd=_0x6149[_0x538406];return _0x18f8fd;};'use strict';var emlformat=require(_0x9614('0x0'));var rimraf=require(_0x9614('0x1'));var zipdir=require(_0x9614('0x2'));var jsonpatch=require(_0x9614('0x3'));var rp=require(_0x9614('0x4'));var moment=require(_0x9614('0x5'));var BPromise=require(_0x9614('0x6'));var Mustache=require(_0x9614('0x7'));var util=require(_0x9614('0x8'));var path=require('path');var sox=require(_0x9614('0x9'));var csv=require(_0x9614('0xa'));var ejs=require(_0x9614('0xb'));var fs=require('fs');var fs_extra=require(_0x9614('0xc'));var _=require(_0x9614('0xd'));var squel=require(_0x9614('0xe'));var crypto=require(_0x9614('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9614('0xa'));var querystring=require(_0x9614('0x10'));var Papa=require('papaparse');var Redis=require(_0x9614('0x11'));var authService=require(_0x9614('0x12'));var qs=require(_0x9614('0x13'));var as=require(_0x9614('0x14'));var hardwareService=require(_0x9614('0x15'));var logger=require(_0x9614('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x9614('0x17'));var licenseUtil=require(_0x9614('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x9614('0x19'))['dbH'];function respondWithStatusCode(_0x6bbb13,_0x3380c2){_0x3380c2=_0x3380c2||0xcc;return function(_0x2328a1){if(_0x2328a1){return _0x6bbb13[_0x9614('0x1a')](_0x3380c2);}return _0x6bbb13[_0x9614('0x1b')](_0x3380c2)[_0x9614('0x1c')]();};}function respondWithResult(_0x50f391,_0x235e63){_0x235e63=_0x235e63||0xc8;return function(_0x3a60cd){if(_0x3a60cd){return _0x50f391[_0x9614('0x1b')](_0x235e63)[_0x9614('0x1d')](_0x3a60cd);}};}function respondWithFilteredResult(_0xb0c54a,_0x5dc8af){return function(_0x5d85d5){if(_0x5d85d5){var _0x40af1e=typeof _0x5dc8af[_0x9614('0x1e')]===_0x9614('0x1f')&&typeof _0x5dc8af[_0x9614('0x20')]===_0x9614('0x1f');var _0x2da904=_0x5d85d5['count'];var _0x53d08c=_0x40af1e?0x0:_0x5dc8af[_0x9614('0x1e')];var _0x500b5c=_0x40af1e?_0x5d85d5['count']:_0x5dc8af['offset']+_0x5dc8af['limit'];var _0x1a3d4b;if(_0x500b5c>=_0x2da904){_0x500b5c=_0x2da904;_0x1a3d4b=0xc8;}else{_0x1a3d4b=0xce;}_0xb0c54a[_0x9614('0x1b')](_0x1a3d4b);return _0xb0c54a[_0x9614('0x21')](_0x9614('0x22'),_0x53d08c+'-'+_0x500b5c+'/'+_0x2da904)[_0x9614('0x1d')](_0x5d85d5);}return null;};}function patchUpdates(_0x1f7a0f){return function(_0x1d307e){try{jsonpatch['apply'](_0x1d307e,_0x1f7a0f,!![]);}catch(_0x95e90){return BPromise[_0x9614('0x23')](_0x95e90);}return _0x1d307e['save']();};}function saveUpdates(_0x4d80f8,_0x64ab93){return function(_0x3a6c19){if(_0x3a6c19){return _0x3a6c19[_0x9614('0x24')](_0x4d80f8)['then'](function(_0x427710){return _0x427710;});}return null;};}function removeEntity(_0xe160a4,_0x5988d4){return function(_0xcb05dc){if(_0xcb05dc){return _0xcb05dc['destroy']()['then'](function(){var _0x3a0f2f=_0xcb05dc['get']({'plain':!![]});var _0x3c906d='CustomReports';return db[_0x9614('0x25')][_0x9614('0x26')]({'where':{'type':_0x3c906d,'resourceId':_0x3a0f2f['id']}})[_0x9614('0x27')](function(){return _0xcb05dc;});})[_0x9614('0x27')](function(){_0xe160a4[_0x9614('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f36fe,_0x324855){return function(_0x26c0f9){if(!_0x26c0f9){_0x3f36fe[_0x9614('0x1a')](0x194);}return _0x26c0f9;};}function handleError(_0x41236f,_0x51c541){_0x51c541=_0x51c541||0x1f4;return function(_0x256df8){logger[_0x9614('0x28')](_0x256df8[_0x9614('0x29')]);if(_0x256df8[_0x9614('0x2a')]){delete _0x256df8['name'];}_0x41236f[_0x9614('0x1b')](_0x51c541)[_0x9614('0x2b')](_0x256df8);};}exports[_0x9614('0x2c')]=function(_0xf78a08,_0x4a0d20){var _0x2b7886={},_0x591b2d={},_0x15321a={'count':0x0,'rows':[]};var _0x9f09e6=_[_0x9614('0x2d')](db['AnalyticCustomReport']['rawAttributes'],function(_0x79d39a){return{'name':_0x79d39a[_0x9614('0x2e')],'type':_0x79d39a[_0x9614('0x2f')]['key']};});_0x591b2d['model']=_[_0x9614('0x2d')](_0x9f09e6,'name');_0x591b2d[_0x9614('0x30')]=_[_0x9614('0x31')](_0xf78a08[_0x9614('0x30')]);_0x591b2d[_0x9614('0x32')]=_[_0x9614('0x33')](_0x591b2d[_0x9614('0x34')],_0x591b2d['query']);_0x2b7886[_0x9614('0x35')]=_[_0x9614('0x33')](_0x591b2d[_0x9614('0x34')],qs[_0x9614('0x36')](_0xf78a08[_0x9614('0x30')]['fields']));_0x2b7886['attributes']=_0x2b7886[_0x9614('0x35')]['length']?_0x2b7886[_0x9614('0x35')]:_0x591b2d[_0x9614('0x34')];if(!_0xf78a08[_0x9614('0x30')][_0x9614('0x37')](_0x9614('0x38'))){_0x2b7886['limit']=qs[_0x9614('0x20')](_0xf78a08['query'][_0x9614('0x20')]);_0x2b7886[_0x9614('0x1e')]=qs[_0x9614('0x1e')](_0xf78a08['query'][_0x9614('0x1e')]);}_0x2b7886[_0x9614('0x39')]=qs[_0x9614('0x3a')](_0xf78a08[_0x9614('0x30')][_0x9614('0x3a')]);_0x2b7886[_0x9614('0x3b')]=qs[_0x9614('0x32')](_[_0x9614('0x3c')](_0xf78a08['query'],_0x591b2d[_0x9614('0x32')]),_0x9f09e6);if(_0xf78a08[_0x9614('0x30')][_0x9614('0x3d')]){_0x2b7886[_0x9614('0x3b')]=_[_0x9614('0x3e')](_0x2b7886[_0x9614('0x3b')],{'$or':_[_0x9614('0x2d')](_0x9f09e6,function(_0x521777){if(_0x521777[_0x9614('0x2f')]!=='VIRTUAL'){var _0xefa9cb={};_0xefa9cb[_0x521777['name']]={'$like':'%'+_0xf78a08[_0x9614('0x30')][_0x9614('0x3d')]+'%'};return _0xefa9cb;}})});}_0x2b7886=_[_0x9614('0x3e')]({},_0x2b7886,_0xf78a08[_0x9614('0x3f')]);var _0x47d945={'where':_0x2b7886[_0x9614('0x3b')]};return db[_0x9614('0x40')][_0x9614('0x41')](_0x47d945)[_0x9614('0x27')](function(_0x502253){_0x15321a[_0x9614('0x41')]=_0x502253;if(_0xf78a08['query'][_0x9614('0x42')]){_0x2b7886[_0x9614('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x9614('0x44')](_0x2b7886);})[_0x9614('0x27')](function(_0x2a3f81){_0x15321a['rows']=_0x2a3f81;return _0x15321a;})['then'](respondWithFilteredResult(_0x4a0d20,_0x2b7886))[_0x9614('0x45')](handleError(_0x4a0d20,null));};exports[_0x9614('0x46')]=function(_0x1e60e9,_0x4ddd4b){var _0x555d8b={'raw':![],'where':{'id':_0x1e60e9[_0x9614('0x47')]['id']}},_0x4425bb={};_0x4425bb['model']=_[_0x9614('0x31')](db[_0x9614('0x40')][_0x9614('0x48')]);_0x4425bb[_0x9614('0x30')]=_['keys'](_0x1e60e9['query']);_0x4425bb[_0x9614('0x32')]=_[_0x9614('0x33')](_0x4425bb[_0x9614('0x34')],_0x4425bb[_0x9614('0x30')]);_0x555d8b[_0x9614('0x35')]=_['intersection'](_0x4425bb[_0x9614('0x34')],qs[_0x9614('0x36')](_0x1e60e9['query']['fields']));_0x555d8b[_0x9614('0x35')]=_0x555d8b[_0x9614('0x35')][_0x9614('0x49')]?_0x555d8b[_0x9614('0x35')]:_0x4425bb[_0x9614('0x34')];if(_0x1e60e9[_0x9614('0x30')][_0x9614('0x42')]){_0x555d8b['include']=[{'all':!![]}];}_0x555d8b=_['merge']({},_0x555d8b,_0x1e60e9[_0x9614('0x3f')]);return db[_0x9614('0x40')]['find'](_0x555d8b)[_0x9614('0x27')](handleEntityNotFound(_0x4ddd4b,null))['then'](respondWithResult(_0x4ddd4b,null))[_0x9614('0x45')](handleError(_0x4ddd4b,null));};exports[_0x9614('0x4a')]=function(_0x3d7925,_0x169df5){return db['AnalyticCustomReport'][_0x9614('0x4a')](_0x3d7925[_0x9614('0x4b')],{})[_0x9614('0x27')](function(_0x19a4cb){var _0x56e752=_0x3d7925[_0x9614('0x4c')][_0x9614('0x4d')]({'plain':!![]});if(!_0x56e752)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56e752['role']===_0x9614('0x4c')){var _0x2f1154=_0x19a4cb[_0x9614('0x4d')]({'plain':!![]});var _0x28795e=_0x9614('0x4e');return db[_0x9614('0x4f')]['find']({'where':{'name':_0x28795e,'userProfileId':_0x56e752[_0x9614('0x50')]},'raw':!![]})[_0x9614('0x27')](function(_0x320cda){if(_0x320cda&&_0x320cda[_0x9614('0x51')]===0x0){return db[_0x9614('0x25')][_0x9614('0x4a')]({'name':_0x2f1154[_0x9614('0x2a')],'resourceId':_0x2f1154['id'],'type':_0x9614('0x52'),'sectionId':_0x320cda['id']},{})[_0x9614('0x27')](function(){return _0x19a4cb;});}else{return _0x19a4cb;}})[_0x9614('0x45')](function(_0x5d42ae){logger[_0x9614('0x28')](_0x9614('0x53'),_0x5d42ae);throw _0x5d42ae;});}return _0x19a4cb;})[_0x9614('0x27')](respondWithResult(_0x169df5,0xc9))['catch'](handleError(_0x169df5,null));};exports[_0x9614('0x24')]=function(_0x427f59,_0x52ce08){if(_0x427f59['body']['id']){delete _0x427f59[_0x9614('0x4b')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x427f59[_0x9614('0x47')]['id']}})['then'](handleEntityNotFound(_0x52ce08,null))[_0x9614('0x27')](saveUpdates(_0x427f59[_0x9614('0x4b')],null))[_0x9614('0x27')](respondWithResult(_0x52ce08,null))['catch'](handleError(_0x52ce08,null));};exports[_0x9614('0x26')]=function(_0x22ca96,_0x571ac8){return db['AnalyticCustomReport'][_0x9614('0x54')]({'where':{'id':_0x22ca96['params']['id']}})['then'](handleEntityNotFound(_0x571ac8,null))[_0x9614('0x27')](removeEntity(_0x571ac8,null))[_0x9614('0x45')](handleError(_0x571ac8,null));};exports[_0x9614('0x55')]=function(_0x393616,_0x159130){var _0x43b9e8=0xa;var _0x3712e8=['join',_0x9614('0x56'),_0x9614('0x57'),_0x9614('0x58')];var _0x213ada={'SUM':_0x9614('0x59'),'COUNT':_0x9614('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9614('0x5b'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x9614('0x5c'),'GROUP_CONCAT ASC':_0x9614('0x5d'),'GROUP_CONCAT DESC':_0x9614('0x5e')};var _0x16308d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9614('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x9614('0x60'),'UNIX_TIMESTAMP':_0x9614('0x61')};var _0x45f89b=function(_0x594e3c){return!_[_0x9614('0x62')](['IS\x20NULL',_0x9614('0x63'),_0x9614('0x64'),'IS\x20NOT\x20EMPTY'],_0x594e3c);};var _0x244f64=function(_0x1705b1){if(!_0x1705b1||!_0x1705b1[_0x9614('0x65')]['length']){return'';}for(var _0x5a32c7='(',_0x39f0a2=0x0;_0x39f0a2<_0x1705b1[_0x9614('0x65')][_0x9614('0x49')];_0x39f0a2+=0x1){_0x39f0a2>0x0&&(_0x5a32c7+='\x20'+_0x1705b1[_0x9614('0x66')]+'\x20');_0x5a32c7+=_0x1705b1['rules'][_0x39f0a2][_0x9614('0x67')]?_0x244f64(_0x1705b1['rules'][_0x39f0a2][_0x9614('0x67')]):_0x1705b1[_0x9614('0x65')][_0x39f0a2][_0x9614('0x68')]+'\x20'+_0x1705b1[_0x9614('0x65')][_0x39f0a2][_0x9614('0x69')]+(_0x45f89b(_0x1705b1[_0x9614('0x65')][_0x39f0a2][_0x9614('0x69')])?'\x20'+_0x1705b1[_0x9614('0x65')][_0x39f0a2]['value']:'');}return _0x5a32c7+')';};var _0x398f14={'where':{'id':_0x393616['params']['id']}},_0x3733ca,_0x54fe24,_0xcad205,_0x1122ee,_0x5b50da;_0x398f14=_[_0x9614('0x3e')]({},_0x398f14,_0x393616[_0x9614('0x3f')]);return db[_0x9614('0x40')][_0x9614('0x54')](_0x398f14)[_0x9614('0x27')](function(_0x3cfdd8){if(_0x3cfdd8){_0x3733ca=_0x3cfdd8;return _0x3cfdd8[_0x9614('0x6a')]();}return null;})[_0x9614('0x27')](function(_0x42f119){if(_0x42f119){if(!_0x42f119[_0x9614('0x49')]){throw new db[(_0x9614('0x6b'))][(_0x9614('0x6c'))](_0x9614('0x6d'),0x193);}_0x54fe24=_0x42f119;return db[_0x9614('0x6e')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x175270){if(_0x175270){_0xcad205=_['keyBy'](_0x175270,'id');var _0x3a41ae;var _0x334187=squel['select']();_0x334187[_0x9614('0x6f')](_0x3733ca[_0x9614('0x70')]);for(var _0x57651f=0x0;_0x57651f<_0x54fe24[_0x9614('0x49')];_0x57651f+=0x1){_0x3a41ae=_0x54fe24[_0x57651f][_0x9614('0x71')]?_0xcad205[_0x54fe24[_0x57651f][_0x9614('0x71')]][_0x9614('0x72')]:_0x54fe24[_0x57651f][_0x9614('0x68')];_0x3a41ae=_0x54fe24[_0x57651f][_0x9614('0x73')]?_[_0x9614('0x74')](_0x213ada[_0x54fe24[_0x57651f][_0x9614('0x73')]],'%s',_0x3a41ae):_0x3a41ae;_0x3a41ae=_0x54fe24[_0x57651f][_0x9614('0x75')]?_[_0x9614('0x74')](_0x16308d[_0x54fe24[_0x57651f][_0x9614('0x75')]],'%s',_0x3a41ae):_0x3a41ae;if(_0x54fe24[_0x57651f]['groupBy']){_0x334187[_0x9614('0x67')](_0x3a41ae);}_0x54fe24[_0x57651f][_0x9614('0x76')]&&_0x334187[_0x9614('0x39')](_0x3a41ae,_0x54fe24[_0x57651f][_0x9614('0x76')]===_0x9614('0x77')?![]:!![]);_0x334187[_0x9614('0x68')](_0x3a41ae,_0x54fe24[_0x57651f][_0x9614('0x78')]||_0x3a41ae);}if(_0x3733ca['joins']){_0x3733ca[_0x9614('0x79')]=JSON[_0x9614('0x7a')](_0x3733ca[_0x9614('0x79')]);for(var _0x3ca530=0x0;_0x3ca530<_0x3733ca[_0x9614('0x79')][_0x9614('0x49')];_0x3ca530+=0x1){if(_0x3733ca[_0x9614('0x79')][_0x3ca530][_0x9614('0x2f')]&&_[_0x9614('0x62')](_0x3712e8,_0x3733ca[_0x9614('0x79')][_0x3ca530]['type'])&&_0x3733ca['joins'][_0x3ca530][_0x9614('0x7b')]&&_0x3733ca['joins'][_0x3ca530][_0x9614('0x7c')]&&_0x3733ca['joins'][_0x3ca530]['foreignKey']){_0x334187[_0x3733ca[_0x9614('0x79')][_0x3ca530][_0x9614('0x2f')]](_0x3733ca[_0x9614('0x79')][_0x3ca530]['foreignTable'],null,util[_0x9614('0x75')](_0x9614('0x7d'),_0x3733ca[_0x9614('0x70')],_0x3733ca[_0x9614('0x79')][_0x3ca530][_0x9614('0x7b')],_0x3733ca[_0x9614('0x79')][_0x3ca530][_0x9614('0x7c')],_0x3733ca[_0x9614('0x79')][_0x3ca530][_0x9614('0x7e')]));}}}if(_0x3733ca['conditions']){_0x3733ca['conditions']=JSON['parse'](_0x3733ca['conditions']);_0x334187['where'](_0x244f64(_0x3733ca[_0x9614('0x7f')]['group']));}_0x5b50da=_0x334187[_0x9614('0x80')]();_0x334187[_0x9614('0x20')](_0x43b9e8);_0x334187['offset'](0x0);logger[_0x9614('0x81')]('Limited\x20Query:',_0x334187[_0x9614('0x82')]());return dbH[_0x9614('0x83')][_0x9614('0x30')](_0x334187[_0x9614('0x82')](),{'type':dbH[_0x9614('0x83')]['QueryTypes']['SELECT']});}})['then'](respondWithResult(_0x159130,null))[_0x9614('0x45')](handleError(_0x159130,null));};function runReport(_0x980901,_0x47b636,_0x39cc05){var _0x13cdc6=_0x47b636[_0x9614('0x2a')];var _0x4e06e7=0xa;var _0x46feaa=[_0x9614('0x84'),_0x9614('0x56'),_0x9614('0x57'),_0x9614('0x58')];var _0x36ea42={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9614('0x85'),'MAX':_0x9614('0x5b'),'MIN':_0x9614('0x86'),'AVG':_0x9614('0x87'),'GROUP_CONCAT':_0x9614('0x5c'),'GROUP_CONCAT ASC':_0x9614('0x5d'),'GROUP_CONCAT DESC':_0x9614('0x5e')};var _0xdb990e={'SEC_TO_TIME':_0x9614('0x88'),'DATE':_0x9614('0x5f'),'HOUR':_0x9614('0x89'),'ROUND':_0x9614('0x60'),'UNIX_TIMESTAMP':_0x9614('0x61')};var _0x470223=function(_0x2bfc79){return!_[_0x9614('0x62')]([_0x9614('0x8a'),'IS\x20NOT\x20NULL',_0x9614('0x64'),_0x9614('0x8b')],_0x2bfc79);};var _0x316f4f=function(_0x4849ca){if(!_0x4849ca||!_0x4849ca[_0x9614('0x65')][_0x9614('0x49')]){return'';}for(var _0x5eb92c='(',_0x222f7d=0x0;_0x222f7d<_0x4849ca[_0x9614('0x65')]['length'];_0x222f7d+=0x1){_0x222f7d>0x0&&(_0x5eb92c+='\x20'+_0x4849ca[_0x9614('0x66')]+'\x20');_0x5eb92c+=_0x4849ca[_0x9614('0x65')][_0x222f7d][_0x9614('0x67')]?_0x316f4f(_0x4849ca[_0x9614('0x65')][_0x222f7d][_0x9614('0x67')]):_0x4849ca[_0x9614('0x65')][_0x222f7d][_0x9614('0x68')]+'\x20'+_0x4849ca[_0x9614('0x65')][_0x222f7d][_0x9614('0x69')]+(_0x470223(_0x4849ca[_0x9614('0x65')][_0x222f7d][_0x9614('0x69')])?'\x20'+_0x4849ca[_0x9614('0x65')][_0x222f7d][_0x9614('0x8c')]:'');}return _0x5eb92c+')';};var _0x5023ad={'where':{'id':_0x980901['id']}},_0xc9a244,_0x3cd612,_0x147ea9,_0x210e9d,_0x46924f;_0x5023ad=_[_0x9614('0x3e')]({},_0x5023ad,_0x39cc05);return db['AnalyticCustomReport']['find'](_0x5023ad)[_0x9614('0x27')](function(_0x222fc6){if(_0x222fc6){_0xc9a244=_0x222fc6;return _0x222fc6[_0x9614('0x6a')]();}return null;})[_0x9614('0x27')](function(_0x39bca3){if(_0x39bca3){if(!_0x39bca3[_0x9614('0x49')]){throw new db[(_0x9614('0x6b'))]['ValidationErrorItem'](_0x9614('0x6d'),0x193);}_0x3cd612=_0x39bca3;return db[_0x9614('0x6e')][_0x9614('0x44')]({'raw':!![]});}return null;})[_0x9614('0x27')](function(_0x2800ad){if(_0x2800ad){_0x147ea9=_[_0x9614('0x8d')](_0x2800ad,'id');var _0x1e3dad;var _0x48e340=squel[_0x9614('0x8e')]();_0x48e340[_0x9614('0x6f')](_0xc9a244['table']);for(var _0x434f43=0x0;_0x434f43<_0x3cd612[_0x9614('0x49')];_0x434f43+=0x1){_0x1e3dad=_0x3cd612[_0x434f43]['MetricId']?_0x147ea9[_0x3cd612[_0x434f43][_0x9614('0x71')]]['metric']:_0x3cd612[_0x434f43][_0x9614('0x68')];_0x1e3dad=_0x3cd612[_0x434f43][_0x9614('0x73')]?_[_0x9614('0x74')](_0x36ea42[_0x3cd612[_0x434f43]['function']],'%s',_0x1e3dad):_0x1e3dad;_0x1e3dad=_0x3cd612[_0x434f43]['format']?_[_0x9614('0x74')](_0xdb990e[_0x3cd612[_0x434f43][_0x9614('0x75')]],'%s',_0x1e3dad):_0x1e3dad;if(_0x3cd612[_0x434f43][_0x9614('0x8f')]){_0x48e340['group'](_0x1e3dad);}_0x3cd612[_0x434f43]['orderBy']&&_0x48e340[_0x9614('0x39')](_0x1e3dad,_0x3cd612[_0x434f43][_0x9614('0x76')]===_0x9614('0x77')?![]:!![]);_0x48e340[_0x9614('0x68')](_0x1e3dad,_0x3cd612[_0x434f43][_0x9614('0x78')]||_0x1e3dad);}if(_0xc9a244[_0x9614('0x79')]){_0xc9a244[_0x9614('0x79')]=JSON[_0x9614('0x7a')](_0xc9a244[_0x9614('0x79')]);for(var _0xa1d571=0x0;_0xa1d571<_0xc9a244[_0x9614('0x79')]['length'];_0xa1d571+=0x1){if(_0xc9a244[_0x9614('0x79')][_0xa1d571][_0x9614('0x2f')]&&_[_0x9614('0x62')](_0x46feaa,_0xc9a244[_0x9614('0x79')][_0xa1d571][_0x9614('0x2f')])&&_0xc9a244['joins'][_0xa1d571][_0x9614('0x7b')]&&_0xc9a244[_0x9614('0x79')][_0xa1d571][_0x9614('0x7c')]&&_0xc9a244[_0x9614('0x79')][_0xa1d571]['foreignKey']){_0x48e340[_0xc9a244[_0x9614('0x79')][_0xa1d571]['type']](_0xc9a244['joins'][_0xa1d571][_0x9614('0x7c')],null,util['format'](_0x9614('0x7d'),_0xc9a244[_0x9614('0x70')],_0xc9a244[_0x9614('0x79')][_0xa1d571]['parentKey'],_0xc9a244['joins'][_0xa1d571][_0x9614('0x7c')],_0xc9a244[_0x9614('0x79')][_0xa1d571][_0x9614('0x7e')]));}}}if(_0xc9a244[_0x9614('0x7f')]){_0xc9a244[_0x9614('0x7f')]=JSON['parse'](_0xc9a244['conditions']);_0x48e340[_0x9614('0x3b')](_0x316f4f(_0xc9a244[_0x9614('0x7f')][_0x9614('0x67')]));}_0x46924f=_0x48e340[_0x9614('0x80')]();_0x48e340[_0x9614('0x20')](_0x4e06e7);_0x48e340[_0x9614('0x1e')](0x0);return;}})[_0x9614('0x27')](function(){if(_0x47b636['output']===_0x9614('0x90')){return null;}var _0x5ebf2b=_[_0x9614('0x3e')](_0x47b636,{'name':_0x47b636[_0x9614('0x91')]||_0x47b636[_0x9614('0x2a')]||_0xc9a244[_0x9614('0x2a')],'basename':_0x13cdc6,'savename':util[_0x9614('0x75')](_0x9614('0x92'),_0x47b636[_0x9614('0x2a')]||_0xc9a244[_0x9614('0x2a')],require('randomstring')[_0x9614('0x93')](0x4),_0x47b636[_0x9614('0x94')]||'csv'),'reportId':_0xc9a244['id'],'reportType':_0x9614('0x95')});return db[_0x9614('0x96')][_0x9614('0x4a')](_0x5ebf2b,{'raw':!![]});})[_0x9614('0x27')](function(_0x30a150){if(_0xc9a244[_0x9614('0x70')]===_0x9614('0x97')){_0x46924f[_0x9614('0x3b')](_0xc9a244['table']+_0x9614('0x98'),_0x47b636[_0x9614('0x99')],_0x47b636[_0x9614('0x9a')]);}else{_0x46924f[_0x9614('0x3b')](_0xc9a244[_0x9614('0x70')]+_0x9614('0x9b'),_0x47b636[_0x9614('0x99')],_0x47b636[_0x9614('0x9a')]);}if(_0x30a150){logger[_0x9614('0x9c')](_0x9614('0x9d'),_0x46924f['toString']());require(_0x9614('0x9e'))[_0x9614('0x9f')](path[_0x9614('0x84')](__dirname,_0x9614('0xa0'),_0x30a150[_0x9614('0x94')]),[_0x30a150['id'],_0x46924f[_0x9614('0x82')](),path[_0x9614('0x84')](__dirname,_0x9614('0xa1'),_0x30a150['savename']),_0x13cdc6]);return _0x30a150;}else{var _0x5801d9=squel[_0x9614('0x8e')]();_0x5801d9[_0x9614('0x6f')]('('+_0x46924f[_0x9614('0x82')]()+')',_0x9614('0xa2'));_0x5801d9[_0x9614('0x68')](_0x9614('0xa3'),'count');_0x46924f[_0x9614('0x20')](_0x47b636[_0x9614('0x20')]||_0x4e06e7);_0x46924f[_0x9614('0x1e')](_0x47b636[_0x9614('0x1e')]||0x0);return dbH[_0x9614('0x83')]['query'](_0x5801d9[_0x9614('0x82')](),{'type':dbH[_0x9614('0x83')][_0x9614('0xa4')][_0x9614('0xa5')]})['then'](function(_0x544b56){if(!_0x544b56['length']){_0x210e9d=0x0;}else{_0x210e9d=_0x544b56[0x0][_0x9614('0x41')]||0x0;}return dbH[_0x9614('0x83')][_0x9614('0x30')](_0x46924f[_0x9614('0x82')](),{'type':dbH[_0x9614('0x83')][_0x9614('0xa4')][_0x9614('0xa5')]});})['then'](function(_0x2cace0){return{'rows':_0x2cace0||[],'count':_0x210e9d};});}});}exports[_0x9614('0xa6')]=function(_0x39a1af,_0x48bc10){return runReport(_0x39a1af[_0x9614('0x47')],_0x39a1af[_0x9614('0x30')],_0x39a1af[_0x9614('0x3f')])[_0x9614('0x27')](respondWithResult(_0x48bc10,null))[_0x9614('0x45')](handleError(_0x48bc10,null));};exports['runReport']=runReport;exports[_0x9614('0x30')]=function(_0x2242ed,_0x54ab12){var _0x49ff5d=0xa;var _0x419c9d=['join',_0x9614('0x56'),_0x9614('0x57'),_0x9614('0x58')];var _0x13074f={'SUM':_0x9614('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9614('0x85'),'MAX':_0x9614('0x5b'),'MIN':'MIN(%s)','AVG':_0x9614('0x87'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9614('0x5e')};var _0xd29f13={'SEC_TO_TIME':_0x9614('0x88'),'DATE':_0x9614('0x5f'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9614('0x61')};var _0x326c10=function(_0x19fb6a){return!_[_0x9614('0x62')]([_0x9614('0x8a'),_0x9614('0x63'),_0x9614('0x64'),'IS\x20NOT\x20EMPTY'],_0x19fb6a);};var _0x576f7e=function(_0x99eccd){if(!_0x99eccd||!_0x99eccd['rules'][_0x9614('0x49')]){return'';}for(var _0x892fe1='(',_0x3b2bdd=0x0;_0x3b2bdd<_0x99eccd[_0x9614('0x65')][_0x9614('0x49')];_0x3b2bdd+=0x1){_0x3b2bdd>0x0&&(_0x892fe1+='\x20'+_0x99eccd[_0x9614('0x66')]+'\x20');_0x892fe1+=_0x99eccd['rules'][_0x3b2bdd][_0x9614('0x67')]?_0x576f7e(_0x99eccd[_0x9614('0x65')][_0x3b2bdd][_0x9614('0x67')]):_0x99eccd[_0x9614('0x65')][_0x3b2bdd][_0x9614('0x68')]+'\x20'+_0x99eccd[_0x9614('0x65')][_0x3b2bdd][_0x9614('0x69')]+(_0x326c10(_0x99eccd[_0x9614('0x65')][_0x3b2bdd]['condition'])?'\x20'+_0x99eccd[_0x9614('0x65')][_0x3b2bdd]['value']:'');}return _0x892fe1+')';};var _0x452271={'where':{'id':_0x2242ed[_0x9614('0x47')]['id']}},_0x5d7d2a,_0x41f2c0,_0xcc87a0,_0x376ce5,_0x5e7956;_0x452271=_[_0x9614('0x3e')]({},_0x452271,_0x2242ed['options']);return db[_0x9614('0x40')]['find'](_0x452271)[_0x9614('0x27')](function(_0x35cf5a){if(_0x35cf5a){_0x5d7d2a=_0x35cf5a;return _0x35cf5a[_0x9614('0x6a')]();}return null;})[_0x9614('0x27')](function(_0x5491be){if(_0x5491be){if(!_0x5491be[_0x9614('0x49')]){throw new db['Sequelize'][(_0x9614('0x6c'))](_0x9614('0x6d'),0x193);}_0x41f2c0=_0x5491be;return db[_0x9614('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x9614('0x27')](function(_0x3fb3eb){if(_0x3fb3eb){_0xcc87a0=_['keyBy'](_0x3fb3eb,'id');var _0x45223d;var _0x497d89=squel[_0x9614('0x8e')]();_0x497d89[_0x9614('0x6f')](_0x5d7d2a[_0x9614('0x70')]);for(var _0x26316a=0x0;_0x26316a<_0x41f2c0[_0x9614('0x49')];_0x26316a+=0x1){_0x45223d=_0x41f2c0[_0x26316a]['MetricId']?_0xcc87a0[_0x41f2c0[_0x26316a]['MetricId']][_0x9614('0x72')]:_0x41f2c0[_0x26316a][_0x9614('0x68')];_0x45223d=_0x41f2c0[_0x26316a]['function']?_['replace'](_0x13074f[_0x41f2c0[_0x26316a][_0x9614('0x73')]],'%s',_0x45223d):_0x45223d;_0x45223d=_0x41f2c0[_0x26316a]['format']?_['replace'](_0xd29f13[_0x41f2c0[_0x26316a][_0x9614('0x75')]],'%s',_0x45223d):_0x45223d;if(_0x41f2c0[_0x26316a][_0x9614('0x8f')]){_0x497d89[_0x9614('0x67')](_0x45223d);}_0x41f2c0[_0x26316a][_0x9614('0x76')]&&_0x497d89['order'](_0x45223d,_0x41f2c0[_0x26316a][_0x9614('0x76')]===_0x9614('0x77')?![]:!![]);_0x497d89[_0x9614('0x68')](_0x45223d,_0x41f2c0[_0x26316a]['alias']||_0x45223d);}if(_0x5d7d2a[_0x9614('0x79')]){_0x5d7d2a[_0x9614('0x79')]=JSON[_0x9614('0x7a')](_0x5d7d2a[_0x9614('0x79')]);for(var _0x1e6995=0x0;_0x1e6995<_0x5d7d2a[_0x9614('0x79')]['length'];_0x1e6995+=0x1){if(_0x5d7d2a[_0x9614('0x79')][_0x1e6995][_0x9614('0x2f')]&&_['includes'](_0x419c9d,_0x5d7d2a[_0x9614('0x79')][_0x1e6995][_0x9614('0x2f')])&&_0x5d7d2a[_0x9614('0x79')][_0x1e6995]['parentKey']&&_0x5d7d2a[_0x9614('0x79')][_0x1e6995]['foreignTable']&&_0x5d7d2a['joins'][_0x1e6995]['foreignKey']){_0x497d89[_0x5d7d2a['joins'][_0x1e6995][_0x9614('0x2f')]](_0x5d7d2a[_0x9614('0x79')][_0x1e6995]['foreignTable'],null,util[_0x9614('0x75')](_0x9614('0x7d'),_0x5d7d2a[_0x9614('0x70')],_0x5d7d2a[_0x9614('0x79')][_0x1e6995]['parentKey'],_0x5d7d2a[_0x9614('0x79')][_0x1e6995][_0x9614('0x7c')],_0x5d7d2a[_0x9614('0x79')][_0x1e6995][_0x9614('0x7e')]));}}}if(_0x5d7d2a['conditions']){_0x5d7d2a[_0x9614('0x7f')]=JSON[_0x9614('0x7a')](_0x5d7d2a[_0x9614('0x7f')]);_0x497d89[_0x9614('0x3b')](_0x576f7e(_0x5d7d2a[_0x9614('0x7f')]['group']));}_0x5e7956=_0x497d89[_0x9614('0x80')]();_0x497d89[_0x9614('0x20')](_0x49ff5d);_0x497d89[_0x9614('0x1e')](0x0);logger[_0x9614('0x81')](_0x9614('0xa7'),_0x497d89[_0x9614('0x82')]());return dbH[_0x9614('0x83')][_0x9614('0x30')](_0x497d89[_0x9614('0x82')](),{'type':dbH[_0x9614('0x83')][_0x9614('0xa4')][_0x9614('0xa5')]});}})[_0x9614('0x27')](function(){return{'sql':_0x5e7956[_0x9614('0x82')]()};})[_0x9614('0x27')](respondWithResult(_0x54ab12,null))[_0x9614('0x45')](handleError(_0x54ab12,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 3207071..f7882ff 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 _0x81fa=['../../config/environment','./analyticCustomReport.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x208832,_0x9d6d2b){var _0x50269d=function(_0x3d37e3){while(--_0x3d37e3){_0x208832['push'](_0x208832['shift']());}};_0x50269d(++_0x9d6d2b);}(_0x81fa,0x137));var _0xa81f=function(_0x4a724f,_0x5b001a){_0x4a724f=_0x4a724f-0x0;var _0x35adab=_0x81fa[_0x4a724f];return _0x35adab;};'use strict';var _=require(_0xa81f('0x0'));var util=require(_0xa81f('0x1'));var logger=require(_0xa81f('0x2'))(_0xa81f('0x3'));var moment=require(_0xa81f('0x4'));var BPromise=require(_0xa81f('0x5'));var rp=require(_0xa81f('0x6'));var fs=require('fs');var path=require(_0xa81f('0x7'));var rimraf=require('rimraf');var config=require(_0xa81f('0x8'));var attributes=require(_0xa81f('0x9'));module['exports']=function(_0x401f23,_0x14230a){return _0x401f23[_0xa81f('0xa')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08f9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','analytics_custom_reports','lodash'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0x08f9,0x1c2));var _0x908f=function(_0x20d043,_0x136865){_0x20d043=_0x20d043-0x0;var _0xd60556=_0x08f9[_0x20d043];return _0xd60556;};'use strict';var _=require(_0x908f('0x0'));var util=require('util');var logger=require(_0x908f('0x1'))(_0x908f('0x2'));var moment=require(_0x908f('0x3'));var BPromise=require(_0x908f('0x4'));var rp=require(_0x908f('0x5'));var fs=require('fs');var path=require(_0x908f('0x6'));var rimraf=require(_0x908f('0x7'));var config=require(_0x908f('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x908f('0x9')]=function(_0x21b80a,_0x3c9ea1){return _0x21b80a['define']('AnalyticCustomReport',attributes,{'tableName':_0x908f('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index bedf665..bd6ffb9 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 _0x5de9=['message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x26f919,_0x432760){var _0x5195a=function(_0x3d3a9d){while(--_0x3d3a9d){_0x26f919['push'](_0x26f919['shift']());}};_0x5195a(++_0x432760);}(_0x5de9,0x167));var _0x95de=function(_0x55fb83,_0x1d3856){_0x55fb83=_0x55fb83-0x0;var _0x59a87a=_0x5de9[_0x55fb83];return _0x59a87a;};'use strict';var _=require('lodash');var util=require(_0x95de('0x0'));var moment=require(_0x95de('0x1'));var BPromise=require(_0x95de('0x2'));var rs=require(_0x95de('0x3'));var fs=require('fs');var Redis=require(_0x95de('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x95de('0x5'));var logger=require(_0x95de('0x6'))(_0x95de('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3cba65,_0x18c81d,_0x224e29){return new BPromise(function(_0x193289,_0x1f0b38){return client[_0x95de('0x8')](_0x3cba65,_0x224e29)['then'](function(_0x129920){logger[_0x95de('0x9')](_0x95de('0xa'),_0x18c81d,_0x95de('0xb'));logger[_0x95de('0xc')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x18c81d,'request\x20sent',JSON['stringify'](_0x129920));if(_0x129920[_0x95de('0xd')]){if(_0x129920['error'][_0x95de('0xe')]===0x1f4){logger[_0x95de('0xd')](_0x95de('0xa'),_0x18c81d,_0x129920[_0x95de('0xd')]['message']);return _0x1f0b38(_0x129920['error']['message']);}logger[_0x95de('0xd')](_0x95de('0xa'),_0x18c81d,_0x129920[_0x95de('0xd')][_0x95de('0xf')]);return _0x193289(_0x129920[_0x95de('0xd')]['message']);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x18c81d,_0x95de('0xb'));_0x193289(_0x129920['result'][_0x95de('0xf')]);}})[_0x95de('0x10')](function(_0x798d2c){logger['error'](_0x95de('0xa'),_0x18c81d,_0x798d2c);_0x1f0b38(_0x798d2c);});});} \ No newline at end of file +var _0xa199=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x3deca4,_0x669c82){var _0x35d6fe=function(_0x2245b3){while(--_0x2245b3){_0x3deca4['push'](_0x3deca4['shift']());}};_0x35d6fe(++_0x669c82);}(_0xa199,0x15b));var _0x9a19=function(_0xd707b9,_0x24ab69){_0xd707b9=_0xd707b9-0x0;var _0xf81c9e=_0xa199[_0xd707b9];return _0xf81c9e;};'use strict';var _=require(_0x9a19('0x0'));var util=require(_0x9a19('0x1'));var moment=require(_0x9a19('0x2'));var BPromise=require(_0x9a19('0x3'));var rs=require(_0x9a19('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a19('0x5'))['db'];var utils=require(_0x9a19('0x6'));var logger=require(_0x9a19('0x7'))(_0x9a19('0x8'));var config=require(_0x9a19('0x9'));var jayson=require(_0x9a19('0xa'));var client=jayson[_0x9a19('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x172244,_0x41155a,_0x2d65b5){return new BPromise(function(_0x483f81,_0x4d1168){return client[_0x9a19('0xc')](_0x172244,_0x2d65b5)[_0x9a19('0xd')](function(_0xf3755a){logger[_0x9a19('0xe')](_0x9a19('0xf'),_0x41155a,_0x9a19('0x10'));logger[_0x9a19('0x11')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x41155a,_0x9a19('0x10'),JSON[_0x9a19('0x12')](_0xf3755a));if(_0xf3755a['error']){if(_0xf3755a[_0x9a19('0x13')]['code']===0x1f4){logger['error'](_0x9a19('0xf'),_0x41155a,_0xf3755a[_0x9a19('0x13')][_0x9a19('0x14')]);return _0x4d1168(_0xf3755a[_0x9a19('0x13')][_0x9a19('0x14')]);}logger[_0x9a19('0x13')](_0x9a19('0xf'),_0x41155a,_0xf3755a['error']['message']);return _0x483f81(_0xf3755a[_0x9a19('0x13')][_0x9a19('0x14')]);}else{logger[_0x9a19('0xe')](_0x9a19('0xf'),_0x41155a,_0x9a19('0x10'));_0x483f81(_0xf3755a[_0x9a19('0x15')][_0x9a19('0x14')]);}})[_0x9a19('0x16')](function(_0x5c29af){logger[_0x9a19('0x13')](_0x9a19('0xf'),_0x41155a,_0x5c29af);_0x4d1168(_0x5c29af);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 1e5400d..4344b47 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 _0x7a04=['../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','/:id/query','post','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x453ef9,_0x2f5a9a){var _0x2f40a3=function(_0x4f8c08){while(--_0x4f8c08){_0x453ef9['push'](_0x453ef9['shift']());}};_0x2f40a3(++_0x2f5a9a);}(_0x7a04,0xb0));var _0x47a0=function(_0x3942da,_0x49b37b){_0x3942da=_0x3942da-0x0;var _0x4cfe1b=_0x7a04[_0x3942da];return _0x4cfe1b;};'use strict';var multer=require(_0x47a0('0x0'));var util=require('util');var path=require(_0x47a0('0x1'));var timeout=require(_0x47a0('0x2'));var express=require(_0x47a0('0x3'));var router=express[_0x47a0('0x4')]();var fs_extra=require(_0x47a0('0x5'));var auth=require(_0x47a0('0x6'));var interaction=require(_0x47a0('0x7'));var config=require(_0x47a0('0x8'));var controller=require(_0x47a0('0x9'));router[_0x47a0('0xa')]('/',auth[_0x47a0('0xb')](),controller[_0x47a0('0xc')]);router[_0x47a0('0xa')](_0x47a0('0xd'),auth['isAuthenticated'](),controller[_0x47a0('0xe')]);router[_0x47a0('0xa')](_0x47a0('0xf'),auth['isAuthenticated'](),controller['preview']);router[_0x47a0('0xa')](_0x47a0('0x10'),auth[_0x47a0('0xb')](),controller['run']);router[_0x47a0('0xa')](_0x47a0('0x11'),auth[_0x47a0('0xb')](),controller['query']);router[_0x47a0('0x12')]('/',auth[_0x47a0('0xb')](),controller['create']);router[_0x47a0('0x13')]('/:id',auth[_0x47a0('0xb')](),controller[_0x47a0('0x14')]);router['delete'](_0x47a0('0xd'),auth[_0x47a0('0xb')](),controller[_0x47a0('0x15')]);module[_0x47a0('0x16')]=router; \ No newline at end of file +var _0x2eee=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/preview','preview','/:id/query','query','create','put','/:id','update','delete','exports','multer','util','connect-timeout','Router'];(function(_0x537e72,_0x52125e){var _0x2d43d2=function(_0x4b275a){while(--_0x4b275a){_0x537e72['push'](_0x537e72['shift']());}};_0x2d43d2(++_0x52125e);}(_0x2eee,0x128));var _0xe2ee=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0x2eee[_0x2fee96];return _0x2e6ad1;};'use strict';var multer=require(_0xe2ee('0x0'));var util=require(_0xe2ee('0x1'));var path=require('path');var timeout=require(_0xe2ee('0x2'));var express=require('express');var router=express[_0xe2ee('0x3')]();var fs_extra=require(_0xe2ee('0x4'));var auth=require(_0xe2ee('0x5'));var interaction=require(_0xe2ee('0x6'));var config=require(_0xe2ee('0x7'));var controller=require('./analyticCustomReport.controller');router[_0xe2ee('0x8')]('/',auth[_0xe2ee('0x9')](),controller['index']);router[_0xe2ee('0x8')]('/:id',auth[_0xe2ee('0x9')](),controller['show']);router[_0xe2ee('0x8')](_0xe2ee('0xa'),auth[_0xe2ee('0x9')](),controller[_0xe2ee('0xb')]);router['get']('/:id/run',auth[_0xe2ee('0x9')](),controller['run']);router[_0xe2ee('0x8')](_0xe2ee('0xc'),auth[_0xe2ee('0x9')](),controller[_0xe2ee('0xd')]);router['post']('/',auth[_0xe2ee('0x9')](),controller[_0xe2ee('0xe')]);router[_0xe2ee('0xf')](_0xe2ee('0x10'),auth['isAuthenticated'](),controller[_0xe2ee('0x11')]);router[_0xe2ee('0x12')]('/:id',auth[_0xe2ee('0x9')](),controller['destroy']);module[_0xe2ee('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 6dc19ed..2d5499a 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 _0x71ab=['TEXT','exports','STRING'];(function(_0x43c3a2,_0x1281a1){var _0x438c3a=function(_0x539cb3){while(--_0x539cb3){_0x43c3a2['push'](_0x43c3a2['shift']());}};_0x438c3a(++_0x1281a1);}(_0x71ab,0x64));var _0xb71a=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x71ab[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}}; \ No newline at end of file +var _0x31f0=['sequelize','STRING','TEXT'];(function(_0xbd69b0,_0x30a5d0){var _0x17a820=function(_0x5402ab){while(--_0x5402ab){_0xbd69b0['push'](_0xbd69b0['shift']());}};_0x17a820(++_0x30a5d0);}(_0x31f0,0xb7));var _0x031f=function(_0x315fa2,_0x3761b4){_0x315fa2=_0x315fa2-0x0;var _0x1175fc=_0x31f0[_0x315fa2];return _0x1175fc;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 7a2ae46..ab2cea4 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x4915ac,_0x5c48b7){var _0x59cb13=function(_0x2fda43){while(--_0x2fda43){_0x4915ac['push'](_0x4915ac['shift']());}};_0x59cb13(++_0x5c48b7);}(_0x2675,0x75));var _0x5267=function(_0x2fe734,_0x229ee5){_0x2fe734=_0x2fe734-0x0;var _0x3a41ed=_0x2675[_0x2fe734];return _0x3a41ed;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));}; \ No newline at end of file +var _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6d38,0x1ef));var _0x86d3=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x6d38[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index e44ded2..14fbb4a 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 _0x44ee=['path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3dfb8a,_0x43498e){var _0x1927a5=function(_0x15efef){while(--_0x15efef){_0x3dfb8a['push'](_0x3dfb8a['shift']());}};_0x1927a5(++_0x43498e);}(_0x44ee,0x1e7));var _0xe44e=function(_0x5807ad,_0x1bfe3b){_0x5807ad=_0x5807ad-0x0;var _0x50cfad=_0x44ee[_0x5807ad];return _0x50cfad;};'use strict';var _=require(_0xe44e('0x0'));var util=require(_0xe44e('0x1'));var logger=require(_0xe44e('0x2'))('api');var moment=require(_0xe44e('0x3'));var BPromise=require(_0xe44e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe44e('0x5'));var rimraf=require(_0xe44e('0x6'));var config=require('../../config/environment');var attributes=require(_0xe44e('0x7'));module[_0xe44e('0x8')]=function(_0x17a048,_0x2668e0){return _0x17a048[_0xe44e('0x9')](_0xe44e('0xa'),attributes,{'tableName':_0xe44e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd81=['./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x580d0c,_0x2d778c){var _0x4a56b7=function(_0x97c50f){while(--_0x97c50f){_0x580d0c['push'](_0x580d0c['shift']());}};_0x4a56b7(++_0x2d778c);}(_0xfd81,0x74));var _0x1fd8=function(_0xc1ede1,_0x27c567){_0xc1ede1=_0xc1ede1-0x0;var _0x36f293=_0xfd81[_0xc1ede1];return _0x36f293;};'use strict';var _=require(_0x1fd8('0x0'));var util=require(_0x1fd8('0x1'));var logger=require(_0x1fd8('0x2'))(_0x1fd8('0x3'));var moment=require(_0x1fd8('0x4'));var BPromise=require(_0x1fd8('0x5'));var rp=require(_0x1fd8('0x6'));var fs=require('fs');var path=require(_0x1fd8('0x7'));var rimraf=require(_0x1fd8('0x8'));var config=require(_0x1fd8('0x9'));var attributes=require(_0x1fd8('0xa'));module[_0x1fd8('0xb')]=function(_0x35ef2,_0x4c3bc1){return _0x35ef2['define'](_0x1fd8('0xc'),attributes,{'tableName':_0x1fd8('0xd'),'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 38b8a7d..c1908f8 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 _0x2151=['../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','moment','bluebird','../../mysqldb'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x2151,0xf9));var _0x1215=function(_0x5350c0,_0x36326a){_0x5350c0=_0x5350c0-0x0;var _0x1283db=_0x2151[_0x5350c0];return _0x1283db;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1215('0x0'));var BPromise=require(_0x1215('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1215('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1215('0x3'));var jayson=require(_0x1215('0x4'));var client=jayson[_0x1215('0x5')][_0x1215('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2f55f5,_0x3902b1,_0x3a03f1){return new BPromise(function(_0x151d62,_0x276c4c){return client[_0x1215('0x7')](_0x2f55f5,_0x3a03f1)[_0x1215('0x8')](function(_0x4622cc){logger['info'](_0x1215('0x9'),_0x3902b1,_0x1215('0xa'));logger[_0x1215('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3902b1,'request\x20sent',JSON['stringify'](_0x4622cc));if(_0x4622cc[_0x1215('0xc')]){if(_0x4622cc[_0x1215('0xc')][_0x1215('0xd')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x3902b1,_0x4622cc[_0x1215('0xc')][_0x1215('0xe')]);return _0x276c4c(_0x4622cc['error'][_0x1215('0xe')]);}logger[_0x1215('0xc')](_0x1215('0x9'),_0x3902b1,_0x4622cc['error']['message']);return _0x151d62(_0x4622cc[_0x1215('0xc')][_0x1215('0xe')]);}else{logger[_0x1215('0xf')](_0x1215('0x9'),_0x3902b1,_0x1215('0xa'));_0x151d62(_0x4622cc[_0x1215('0x10')]['message']);}})[_0x1215('0x11')](function(_0xa08ef3){logger['error'](_0x1215('0x9'),_0x3902b1,_0xa08ef3);_0x276c4c(_0xa08ef3);});});} \ No newline at end of file +var _0xb6cb=['then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x329e45,_0x2a09db){var _0x25c632=function(_0x257b65){while(--_0x257b65){_0x329e45['push'](_0x329e45['shift']());}};_0x25c632(++_0x2a09db);}(_0xb6cb,0x94));var _0xbb6c=function(_0xcd26a9,_0x512e77){_0xcd26a9=_0xcd26a9-0x0;var _0x3afcbc=_0xb6cb[_0xcd26a9];return _0x3afcbc;};'use strict';var _=require(_0xbb6c('0x0'));var util=require(_0xbb6c('0x1'));var moment=require(_0xbb6c('0x2'));var BPromise=require(_0xbb6c('0x3'));var rs=require(_0xbb6c('0x4'));var fs=require('fs');var Redis=require(_0xbb6c('0x5'));var db=require(_0xbb6c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb6c('0x7'))(_0xbb6c('0x8'));var config=require(_0xbb6c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbb6c('0xa')][_0xbb6c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa51950,_0x3055f0,_0x34a95c){return new BPromise(function(_0x1fa8ba,_0x4517a8){return client[_0xbb6c('0xc')](_0xa51950,_0x34a95c)[_0xbb6c('0xd')](function(_0x25a6f6){logger[_0xbb6c('0xe')](_0xbb6c('0xf'),_0x3055f0,'request\x20sent');logger[_0xbb6c('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3055f0,_0xbb6c('0x11'),JSON[_0xbb6c('0x12')](_0x25a6f6));if(_0x25a6f6[_0xbb6c('0x13')]){if(_0x25a6f6[_0xbb6c('0x13')][_0xbb6c('0x14')]===0x1f4){logger['error'](_0xbb6c('0xf'),_0x3055f0,_0x25a6f6[_0xbb6c('0x13')][_0xbb6c('0x15')]);return _0x4517a8(_0x25a6f6[_0xbb6c('0x13')][_0xbb6c('0x15')]);}logger[_0xbb6c('0x13')](_0xbb6c('0xf'),_0x3055f0,_0x25a6f6['error'][_0xbb6c('0x15')]);return _0x1fa8ba(_0x25a6f6[_0xbb6c('0x13')][_0xbb6c('0x15')]);}else{logger['info'](_0xbb6c('0xf'),_0x3055f0,_0xbb6c('0x11'));_0x1fa8ba(_0x25a6f6[_0xbb6c('0x16')][_0xbb6c('0x15')]);}})['catch'](function(_0x49583c){logger[_0xbb6c('0x13')](_0xbb6c('0xf'),_0x3055f0,_0x49583c);_0x4517a8(_0x49583c);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 6f54e8a..e4bd839 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 _0x0429=['update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','post','create','put'];(function(_0xbc0e96,_0x49dd51){var _0x22ebd5=function(_0x3aa4c5){while(--_0x3aa4c5){_0xbc0e96['push'](_0xbc0e96['shift']());}};_0x22ebd5(++_0x49dd51);}(_0x0429,0x145));var _0x9042=function(_0x379816,_0x2502f3){_0x379816=_0x379816-0x0;var _0x2188d5=_0x0429[_0x379816];return _0x2188d5;};'use strict';var multer=require(_0x9042('0x0'));var util=require(_0x9042('0x1'));var path=require('path');var timeout=require(_0x9042('0x2'));var express=require(_0x9042('0x3'));var router=express[_0x9042('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9042('0x5'));var interaction=require(_0x9042('0x6'));var config=require(_0x9042('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x9042('0x8')]('/',auth[_0x9042('0x9')](),controller[_0x9042('0xa')]);router[_0x9042('0x8')](_0x9042('0xb'),auth[_0x9042('0x9')](),controller[_0x9042('0xc')]);router[_0x9042('0x8')](_0x9042('0xd'),auth['isAuthenticated'](),controller[_0x9042('0xe')]);router[_0x9042('0x8')](_0x9042('0xf'),auth['isAuthenticated'](),controller[_0x9042('0x10')]);router[_0x9042('0x8')]('/:id/query',auth[_0x9042('0x9')](),controller['query']);router[_0x9042('0x11')]('/',auth[_0x9042('0x9')](),controller[_0x9042('0x12')]);router[_0x9042('0x13')](_0x9042('0xb'),auth[_0x9042('0x9')](),controller[_0x9042('0x14')]);router['delete']('/:id',auth[_0x9042('0x9')](),controller[_0x9042('0x15')]);module[_0x9042('0x16')]=router; \ No newline at end of file +var _0x228d=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','run','query','post','create','put','update','destroy'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x228d,0xfe));var _0xd228=function(_0x5e2eb5,_0x3f4e6c){_0x5e2eb5=_0x5e2eb5-0x0;var _0x180baf=_0x228d[_0x5e2eb5];return _0x180baf;};'use strict';var multer=require(_0xd228('0x0'));var util=require(_0xd228('0x1'));var path=require(_0xd228('0x2'));var timeout=require(_0xd228('0x3'));var express=require('express');var router=express[_0xd228('0x4')]();var fs_extra=require(_0xd228('0x5'));var auth=require(_0xd228('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd228('0x7'));var controller=require(_0xd228('0x8'));router[_0xd228('0x9')]('/',auth[_0xd228('0xa')](),controller[_0xd228('0xb')]);router[_0xd228('0x9')](_0xd228('0xc'),auth[_0xd228('0xa')](),controller[_0xd228('0xd')]);router['get'](_0xd228('0xe'),auth[_0xd228('0xa')](),controller['preview']);router[_0xd228('0x9')]('/:id/run',auth['isAuthenticated'](),controller[_0xd228('0xf')]);router['get']('/:id/query',auth[_0xd228('0xa')](),controller[_0xd228('0x10')]);router[_0xd228('0x11')]('/',auth[_0xd228('0xa')](),controller[_0xd228('0x12')]);router[_0xd228('0x13')](_0xd228('0xc'),auth[_0xd228('0xa')](),controller[_0xd228('0x14')]);router['delete'](_0xd228('0xc'),auth[_0xd228('0xa')](),controller[_0xd228('0x15')]);module[_0xd228('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 3f697e0..424531c 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 _0x8ce6=['UNSIGNED','exports','STRING','ENUM','csv','pdf','DATE','Loading','manual','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ce6,0x1cd));var _0x68ce=function(_0x143a05,_0x144e53){_0x143a05=_0x143a05-0x0;var _0x39a6c6=_0x8ce6[_0x143a05];return _0x39a6c6;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x68ce('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x68ce('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x68ce('0x2')](_0x68ce('0x3'),_0x68ce('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0x68ce('0x3')},'savename':{'type':Sequelize[_0x68ce('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x68ce('0x5')]},'endDate':{'type':Sequelize[_0x68ce('0x5')]},'status':{'type':Sequelize[_0x68ce('0x1')],'defaultValue':_0x68ce('0x6')},'type':{'type':Sequelize['ENUM'](_0x68ce('0x7'),'scheduled'),'allowNull':![],'defaultValue':_0x68ce('0x7')},'reportId':{'type':Sequelize[_0x68ce('0x8')](0xb)[_0x68ce('0x9')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x910f=['ENUM','csv','xlsx','DATE','Loading','manual','UNSIGNED','sequelize','exports','STRING'];(function(_0x11e69,_0x34c97b){var _0x20568e=function(_0x41b032){while(--_0x41b032){_0x11e69['push'](_0x11e69['shift']());}};_0x20568e(++_0x34c97b);}(_0x910f,0x165));var _0xf910=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x910f[_0x9fd887];return _0x1a54ab;};'use strict';var Sequelize=require(_0xf910('0x0'));var moment=require('moment');module[_0xf910('0x1')]={'name':{'type':Sequelize[_0xf910('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xf910('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xf910('0x3')](_0xf910('0x4'),'pdf',_0xf910('0x5')),'allowNull':![],'defaultValue':_0xf910('0x4')},'savename':{'type':Sequelize[_0xf910('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xf910('0x6')]},'endDate':{'type':Sequelize[_0xf910('0x6')]},'status':{'type':Sequelize[_0xf910('0x2')],'defaultValue':_0xf910('0x7')},'type':{'type':Sequelize['ENUM']('manual','scheduled'),'allowNull':![],'defaultValue':_0xf910('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xf910('0x9')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index fce361c..dc4dfff 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 _0xd588=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','AnalyticExtractedReport','includeAll','findAll','rows','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util'];(function(_0x36e58e,_0x118c33){var _0xa3b36=function(_0x2a7ca4){while(--_0x2a7ca4){_0x36e58e['push'](_0x36e58e['shift']());}};_0xa3b36(++_0x118c33);}(_0xd588,0xba));var _0x8d58=function(_0x2c2d83,_0x1fc9fb){_0x2c2d83=_0x2c2d83-0x0;var _0x5128db=_0xd588[_0x2c2d83];return _0x5128db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d58('0x0'));var zipdir=require(_0x8d58('0x1'));var jsonpatch=require(_0x8d58('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8d58('0x3'));var Mustache=require(_0x8d58('0x4'));var util=require(_0x8d58('0x5'));var path=require('path');var sox=require(_0x8d58('0x6'));var csv=require(_0x8d58('0x7'));var ejs=require(_0x8d58('0x8'));var fs=require('fs');var fs_extra=require(_0x8d58('0x9'));var _=require(_0x8d58('0xa'));var squel=require('squel');var crypto=require(_0x8d58('0xb'));var jsforce=require(_0x8d58('0xc'));var deskjs=require(_0x8d58('0xd'));var toCsv=require(_0x8d58('0x7'));var querystring=require('querystring');var Papa=require(_0x8d58('0xe'));var Redis=require('ioredis');var authService=require(_0x8d58('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d58('0x10'));var logger=require('../../config/logger')(_0x8d58('0x11'));var utils=require(_0x8d58('0x12'));var config=require(_0x8d58('0x13'));var licenseUtil=require(_0x8d58('0x14'));var db=require(_0x8d58('0x15'))['db'];function respondWithStatusCode(_0x59b238,_0xa24a1f){_0xa24a1f=_0xa24a1f||0xcc;return function(_0x4af0e2){if(_0x4af0e2){return _0x59b238['sendStatus'](_0xa24a1f);}return _0x59b238[_0x8d58('0x16')](_0xa24a1f)[_0x8d58('0x17')]();};}function respondWithResult(_0x62cb43,_0x23f8c8){_0x23f8c8=_0x23f8c8||0xc8;return function(_0x4f9da2){if(_0x4f9da2){return _0x62cb43[_0x8d58('0x16')](_0x23f8c8)[_0x8d58('0x18')](_0x4f9da2);}};}function respondWithFilteredResult(_0x3a5380,_0x349c0f){return function(_0x13afd9){if(_0x13afd9){var _0x81d81f=typeof _0x349c0f[_0x8d58('0x19')]===_0x8d58('0x1a')&&typeof _0x349c0f[_0x8d58('0x1b')]===_0x8d58('0x1a');var _0x5e1ac2=_0x13afd9[_0x8d58('0x1c')];var _0x3728c8=_0x81d81f?0x0:_0x349c0f[_0x8d58('0x19')];var _0x66709a=_0x81d81f?_0x13afd9['count']:_0x349c0f['offset']+_0x349c0f[_0x8d58('0x1b')];var _0x5c93e5;if(_0x66709a>=_0x5e1ac2){_0x66709a=_0x5e1ac2;_0x5c93e5=0xc8;}else{_0x5c93e5=0xce;}_0x3a5380[_0x8d58('0x16')](_0x5c93e5);return _0x3a5380[_0x8d58('0x1d')](_0x8d58('0x1e'),_0x3728c8+'-'+_0x66709a+'/'+_0x5e1ac2)[_0x8d58('0x18')](_0x13afd9);}return null;};}function patchUpdates(_0x54f153){return function(_0x5c6967){try{jsonpatch[_0x8d58('0x1f')](_0x5c6967,_0x54f153,!![]);}catch(_0x3d6b72){return BPromise[_0x8d58('0x20')](_0x3d6b72);}return _0x5c6967[_0x8d58('0x21')]();};}function saveUpdates(_0x29b378,_0x19bcdc){return function(_0x48df44){if(_0x48df44){return _0x48df44[_0x8d58('0x22')](_0x29b378)[_0x8d58('0x23')](function(_0xd66ac){return _0xd66ac;});}return null;};}function removeEntity(_0xb40023,_0x4dc534){return function(_0x523456){if(_0x523456){return _0x523456[_0x8d58('0x24')]()[_0x8d58('0x23')](function(){var _0x26e77e=_0x523456[_0x8d58('0x25')]({'plain':!![]});var _0x101dbc='ExtractedReports';return db[_0x8d58('0x26')][_0x8d58('0x24')]({'where':{'type':_0x101dbc,'resourceId':_0x26e77e['id']}})[_0x8d58('0x23')](function(){return _0x523456;});})['then'](function(){_0xb40023[_0x8d58('0x16')](0xcc)[_0x8d58('0x17')]();});}};}function handleEntityNotFound(_0x23f9a0,_0x27fdbd){return function(_0xfdce53){if(!_0xfdce53){_0x23f9a0[_0x8d58('0x27')](0x194);}return _0xfdce53;};}function handleError(_0x2359c4,_0x306c9f){_0x306c9f=_0x306c9f||0x1f4;return function(_0x5a6901){logger[_0x8d58('0x28')](_0x5a6901['stack']);if(_0x5a6901[_0x8d58('0x29')]){delete _0x5a6901[_0x8d58('0x29')];}_0x2359c4['status'](_0x306c9f)[_0x8d58('0x2a')](_0x5a6901);};}exports[_0x8d58('0x2b')]=function(_0xb83d10,_0x3ca443){var _0x3ca7b7={},_0x231f7d={},_0x433d2a={'count':0x0,'rows':[]};var _0x24f6d2=_['map'](db['AnalyticExtractedReport'][_0x8d58('0x2c')],function(_0x161735){return{'name':_0x161735[_0x8d58('0x2d')],'type':_0x161735[_0x8d58('0x2e')][_0x8d58('0x2f')]};});_0x231f7d[_0x8d58('0x30')]=_[_0x8d58('0x31')](_0x24f6d2,_0x8d58('0x29'));_0x231f7d[_0x8d58('0x32')]=_[_0x8d58('0x33')](_0xb83d10[_0x8d58('0x32')]);_0x231f7d[_0x8d58('0x34')]=_[_0x8d58('0x35')](_0x231f7d[_0x8d58('0x30')],_0x231f7d[_0x8d58('0x32')]);_0x3ca7b7['attributes']=_['intersection'](_0x231f7d[_0x8d58('0x30')],qs['fields'](_0xb83d10[_0x8d58('0x32')][_0x8d58('0x36')]));_0x3ca7b7['attributes']=_0x3ca7b7[_0x8d58('0x37')][_0x8d58('0x38')]?_0x3ca7b7[_0x8d58('0x37')]:_0x231f7d[_0x8d58('0x30')];if(!_0xb83d10[_0x8d58('0x32')][_0x8d58('0x39')](_0x8d58('0x3a'))){_0x3ca7b7[_0x8d58('0x1b')]=qs[_0x8d58('0x1b')](_0xb83d10['query'][_0x8d58('0x1b')]);_0x3ca7b7['offset']=qs[_0x8d58('0x19')](_0xb83d10['query'][_0x8d58('0x19')]);}_0x3ca7b7[_0x8d58('0x3b')]=qs[_0x8d58('0x3c')](_0xb83d10['query'][_0x8d58('0x3c')]);_0x3ca7b7['where']=qs['filters'](_['pick'](_0xb83d10[_0x8d58('0x32')],_0x231f7d['filters']),_0x24f6d2);if(_0xb83d10[_0x8d58('0x32')][_0x8d58('0x3d')]){_0x3ca7b7[_0x8d58('0x3e')]=_['merge'](_0x3ca7b7[_0x8d58('0x3e')],{'$or':_['map'](_0x24f6d2,function(_0x5a39b5){if(_0x5a39b5['type']!==_0x8d58('0x3f')){var _0x51c8ee={};_0x51c8ee[_0x5a39b5[_0x8d58('0x29')]]={'$like':'%'+_0xb83d10[_0x8d58('0x32')][_0x8d58('0x3d')]+'%'};return _0x51c8ee;}})});}_0x3ca7b7=_[_0x8d58('0x40')]({},_0x3ca7b7,_0xb83d10[_0x8d58('0x41')]);var _0x296bc2={'where':_0x3ca7b7[_0x8d58('0x3e')]};return db[_0x8d58('0x42')]['count'](_0x296bc2)[_0x8d58('0x23')](function(_0x23b566){_0x433d2a[_0x8d58('0x1c')]=_0x23b566;if(_0xb83d10[_0x8d58('0x32')][_0x8d58('0x43')]){_0x3ca7b7['include']=[{'all':!![]}];}return db[_0x8d58('0x42')][_0x8d58('0x44')](_0x3ca7b7);})[_0x8d58('0x23')](function(_0x4efe87){_0x433d2a[_0x8d58('0x45')]=_0x4efe87;return _0x433d2a;})['then'](respondWithFilteredResult(_0x3ca443,_0x3ca7b7))['catch'](handleError(_0x3ca443,null));};exports['show']=function(_0x36edc1,_0x1abe34){var _0x207d97={'raw':!![],'where':{'id':_0x36edc1[_0x8d58('0x46')]['id']}},_0x15424b={};_0x15424b['model']=_['keys'](db[_0x8d58('0x42')][_0x8d58('0x2c')]);_0x15424b[_0x8d58('0x32')]=_[_0x8d58('0x33')](_0x36edc1['query']);_0x15424b[_0x8d58('0x34')]=_[_0x8d58('0x35')](_0x15424b['model'],_0x15424b[_0x8d58('0x32')]);_0x207d97[_0x8d58('0x37')]=_['intersection'](_0x15424b[_0x8d58('0x30')],qs['fields'](_0x36edc1[_0x8d58('0x32')][_0x8d58('0x36')]));_0x207d97[_0x8d58('0x37')]=_0x207d97[_0x8d58('0x37')][_0x8d58('0x38')]?_0x207d97[_0x8d58('0x37')]:_0x15424b[_0x8d58('0x30')];if(_0x36edc1[_0x8d58('0x32')][_0x8d58('0x43')]){_0x207d97['include']=[{'all':!![]}];}_0x207d97=_[_0x8d58('0x40')]({},_0x207d97,_0x36edc1[_0x8d58('0x41')]);return db[_0x8d58('0x42')][_0x8d58('0x47')](_0x207d97)['then'](handleEntityNotFound(_0x1abe34,null))[_0x8d58('0x23')](respondWithResult(_0x1abe34,null))[_0x8d58('0x48')](handleError(_0x1abe34,null));};exports['create']=function(_0x405abe,_0x23f005){return db['AnalyticExtractedReport'][_0x8d58('0x49')](_0x405abe[_0x8d58('0x4a')],{})[_0x8d58('0x23')](function(_0xe1dbdd){var _0x2229f3=_0x405abe['user'][_0x8d58('0x25')]({'plain':!![]});if(!_0x2229f3)throw new Error(_0x8d58('0x4b'));if(_0x2229f3[_0x8d58('0x4c')]===_0x8d58('0x4d')){var _0xca2749=_0xe1dbdd[_0x8d58('0x25')]({'plain':!![]});var _0x2099fd=_0x8d58('0x4e');return db[_0x8d58('0x4f')]['find']({'where':{'name':_0x2099fd,'userProfileId':_0x2229f3[_0x8d58('0x50')]},'raw':!![]})[_0x8d58('0x23')](function(_0xb10869){if(_0xb10869&&_0xb10869[_0x8d58('0x51')]===0x0){return db[_0x8d58('0x26')][_0x8d58('0x49')]({'name':_0xca2749[_0x8d58('0x29')],'resourceId':_0xca2749['id'],'type':_0xb10869[_0x8d58('0x29')],'sectionId':_0xb10869['id']},{})[_0x8d58('0x23')](function(){return _0xe1dbdd;});}else{return _0xe1dbdd;}})[_0x8d58('0x48')](function(_0x30055f){logger[_0x8d58('0x28')](_0x8d58('0x52'),_0x30055f);throw _0x30055f;});}return _0xe1dbdd;})[_0x8d58('0x23')](respondWithResult(_0x23f005,0xc9))[_0x8d58('0x48')](handleError(_0x23f005,null));};exports['update']=function(_0x5f0859,_0x1cc70c){if(_0x5f0859[_0x8d58('0x4a')]['id']){delete _0x5f0859[_0x8d58('0x4a')]['id'];}return db['AnalyticExtractedReport'][_0x8d58('0x47')]({'where':{'id':_0x5f0859[_0x8d58('0x46')]['id']}})[_0x8d58('0x23')](handleEntityNotFound(_0x1cc70c,null))[_0x8d58('0x23')](saveUpdates(_0x5f0859[_0x8d58('0x4a')],null))['then'](respondWithResult(_0x1cc70c,null))[_0x8d58('0x48')](handleError(_0x1cc70c,null));};exports[_0x8d58('0x24')]=function(_0x2a51f9,_0x482fc9){return db[_0x8d58('0x42')][_0x8d58('0x47')]({'where':{'id':_0x2a51f9[_0x8d58('0x46')]['id']}})[_0x8d58('0x23')](handleEntityNotFound(_0x482fc9,null))[_0x8d58('0x23')](removeEntity(_0x482fc9,null))[_0x8d58('0x48')](handleError(_0x482fc9,null));};exports[_0x8d58('0x53')]=function(_0x43f7ae,_0x32c4ea,_0x501da2){return db[_0x8d58('0x42')][_0x8d58('0x47')]({'where':{'id':_0x43f7ae[_0x8d58('0x46')]['id']},'attributes':['name',_0x8d58('0x54'),'savename',_0x8d58('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x32c4ea,null))['then'](function(_0x52b935){if(_0x52b935){if(!fs[_0x8d58('0x56')](path[_0x8d58('0x57')](config[_0x8d58('0x58')],_0x8d58('0x59'),_0x52b935[_0x8d58('0x5a')]))){throw new db['Sequelize'][(_0x8d58('0x5b'))](_0x8d58('0x5c'));}if(_0x43f7ae[_0x8d58('0x32')][_0x8d58('0x5d')]){return _0x32c4ea[_0x8d58('0x27')](0xc8);}return _0x32c4ea[_0x8d58('0x53')](path[_0x8d58('0x57')](config[_0x8d58('0x58')],_0x8d58('0x59'),_0x52b935[_0x8d58('0x5a')]),util[_0x8d58('0x5e')](_0x8d58('0x5f'),_0x52b935[_0x8d58('0x54')]||_0x52b935[_0x8d58('0x29')],_0x52b935[_0x8d58('0x55')]['toLowerCase']()));}})[_0x8d58('0x48')](handleError(_0x32c4ea,null));}; \ No newline at end of file +var _0x04fe=['existsSync','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','root','toLowerCase','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','apply','reject','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','order','sort','pick','filter','merge','where','VIRTUAL','count','includeAll','findAll','rows','show','params','fields','include','options','catch','create','body','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','download','basename','output'];(function(_0x5bc105,_0x1d7b42){var _0x44307b=function(_0x2e0efa){while(--_0x2e0efa){_0x5bc105['push'](_0x5bc105['shift']());}};_0x44307b(++_0x1d7b42);}(_0x04fe,0x65));var _0xe04f=function(_0x189e68,_0x4b25b9){_0x189e68=_0x189e68-0x0;var _0x183d06=_0x04fe[_0x189e68];return _0x183d06;};'use strict';var emlformat=require(_0xe04f('0x0'));var rimraf=require(_0xe04f('0x1'));var zipdir=require(_0xe04f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe04f('0x3'));var moment=require('moment');var BPromise=require(_0xe04f('0x4'));var Mustache=require(_0xe04f('0x5'));var util=require(_0xe04f('0x6'));var path=require(_0xe04f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe04f('0x8'));var fs=require('fs');var fs_extra=require(_0xe04f('0x9'));var _=require(_0xe04f('0xa'));var squel=require(_0xe04f('0xb'));var crypto=require('crypto');var jsforce=require(_0xe04f('0xc'));var deskjs=require(_0xe04f('0xd'));var toCsv=require(_0xe04f('0xe'));var querystring=require('querystring');var Papa=require(_0xe04f('0xf'));var Redis=require(_0xe04f('0x10'));var authService=require(_0xe04f('0x11'));var qs=require(_0xe04f('0x12'));var as=require(_0xe04f('0x13'));var hardwareService=require(_0xe04f('0x14'));var logger=require(_0xe04f('0x15'))(_0xe04f('0x16'));var utils=require(_0xe04f('0x17'));var config=require(_0xe04f('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10ca06,_0x98615e){_0x98615e=_0x98615e||0xcc;return function(_0x3b7524){if(_0x3b7524){return _0x10ca06[_0xe04f('0x19')](_0x98615e);}return _0x10ca06[_0xe04f('0x1a')](_0x98615e)[_0xe04f('0x1b')]();};}function respondWithResult(_0x4ab027,_0x2a2e30){_0x2a2e30=_0x2a2e30||0xc8;return function(_0x2237a6){if(_0x2237a6){return _0x4ab027[_0xe04f('0x1a')](_0x2a2e30)[_0xe04f('0x1c')](_0x2237a6);}};}function respondWithFilteredResult(_0x583a74,_0x2920f8){return function(_0xcf0492){if(_0xcf0492){var _0x3df233=typeof _0x2920f8[_0xe04f('0x1d')]==='undefined'&&typeof _0x2920f8[_0xe04f('0x1e')]===_0xe04f('0x1f');var _0x3f9228=_0xcf0492['count'];var _0x5469db=_0x3df233?0x0:_0x2920f8['offset'];var _0x364d88=_0x3df233?_0xcf0492['count']:_0x2920f8[_0xe04f('0x1d')]+_0x2920f8['limit'];var _0x2f8025;if(_0x364d88>=_0x3f9228){_0x364d88=_0x3f9228;_0x2f8025=0xc8;}else{_0x2f8025=0xce;}_0x583a74[_0xe04f('0x1a')](_0x2f8025);return _0x583a74['set']('Content-Range',_0x5469db+'-'+_0x364d88+'/'+_0x3f9228)[_0xe04f('0x1c')](_0xcf0492);}return null;};}function patchUpdates(_0x3c4520){return function(_0x1cb87c){try{jsonpatch[_0xe04f('0x20')](_0x1cb87c,_0x3c4520,!![]);}catch(_0xa660c6){return BPromise[_0xe04f('0x21')](_0xa660c6);}return _0x1cb87c['save']();};}function saveUpdates(_0xd8b37b,_0xc2d876){return function(_0x5c704c){if(_0x5c704c){return _0x5c704c['update'](_0xd8b37b)[_0xe04f('0x22')](function(_0x1b2bcd){return _0x1b2bcd;});}return null;};}function removeEntity(_0x251d9f,_0x2f44ed){return function(_0x1057fa){if(_0x1057fa){return _0x1057fa[_0xe04f('0x23')]()['then'](function(){var _0x9f38fb=_0x1057fa['get']({'plain':!![]});var _0x38b4ae=_0xe04f('0x24');return db[_0xe04f('0x25')]['destroy']({'where':{'type':_0x38b4ae,'resourceId':_0x9f38fb['id']}})[_0xe04f('0x22')](function(){return _0x1057fa;});})[_0xe04f('0x22')](function(){_0x251d9f[_0xe04f('0x1a')](0xcc)[_0xe04f('0x1b')]();});}};}function handleEntityNotFound(_0x33daa6,_0x7af19b){return function(_0x52b6f5){if(!_0x52b6f5){_0x33daa6['sendStatus'](0x194);}return _0x52b6f5;};}function handleError(_0x5dfbd4,_0x88f4d6){_0x88f4d6=_0x88f4d6||0x1f4;return function(_0x5c595c){logger[_0xe04f('0x26')](_0x5c595c[_0xe04f('0x27')]);if(_0x5c595c[_0xe04f('0x28')]){delete _0x5c595c[_0xe04f('0x28')];}_0x5dfbd4['status'](_0x88f4d6)['send'](_0x5c595c);};}exports[_0xe04f('0x29')]=function(_0x127d88,_0x1a84de){var _0x3ab1f9={},_0x5acebf={},_0x144be6={'count':0x0,'rows':[]};var _0x48470c=_[_0xe04f('0x2a')](db[_0xe04f('0x2b')][_0xe04f('0x2c')],function(_0x1fa7b0){return{'name':_0x1fa7b0[_0xe04f('0x2d')],'type':_0x1fa7b0[_0xe04f('0x2e')]['key']};});_0x5acebf[_0xe04f('0x2f')]=_[_0xe04f('0x2a')](_0x48470c,_0xe04f('0x28'));_0x5acebf[_0xe04f('0x30')]=_[_0xe04f('0x31')](_0x127d88[_0xe04f('0x30')]);_0x5acebf[_0xe04f('0x32')]=_[_0xe04f('0x33')](_0x5acebf[_0xe04f('0x2f')],_0x5acebf[_0xe04f('0x30')]);_0x3ab1f9[_0xe04f('0x34')]=_[_0xe04f('0x33')](_0x5acebf[_0xe04f('0x2f')],qs['fields'](_0x127d88[_0xe04f('0x30')]['fields']));_0x3ab1f9[_0xe04f('0x34')]=_0x3ab1f9[_0xe04f('0x34')][_0xe04f('0x35')]?_0x3ab1f9[_0xe04f('0x34')]:_0x5acebf[_0xe04f('0x2f')];if(!_0x127d88[_0xe04f('0x30')]['hasOwnProperty']('nolimit')){_0x3ab1f9[_0xe04f('0x1e')]=qs['limit'](_0x127d88[_0xe04f('0x30')][_0xe04f('0x1e')]);_0x3ab1f9[_0xe04f('0x1d')]=qs[_0xe04f('0x1d')](_0x127d88['query']['offset']);}_0x3ab1f9[_0xe04f('0x36')]=qs[_0xe04f('0x37')](_0x127d88[_0xe04f('0x30')][_0xe04f('0x37')]);_0x3ab1f9['where']=qs[_0xe04f('0x32')](_[_0xe04f('0x38')](_0x127d88[_0xe04f('0x30')],_0x5acebf['filters']),_0x48470c);if(_0x127d88['query'][_0xe04f('0x39')]){_0x3ab1f9['where']=_[_0xe04f('0x3a')](_0x3ab1f9[_0xe04f('0x3b')],{'$or':_['map'](_0x48470c,function(_0x48c2cc){if(_0x48c2cc[_0xe04f('0x2e')]!==_0xe04f('0x3c')){var _0x7e8507={};_0x7e8507[_0x48c2cc[_0xe04f('0x28')]]={'$like':'%'+_0x127d88[_0xe04f('0x30')][_0xe04f('0x39')]+'%'};return _0x7e8507;}})});}_0x3ab1f9=_[_0xe04f('0x3a')]({},_0x3ab1f9,_0x127d88['options']);var _0x1838c6={'where':_0x3ab1f9['where']};return db['AnalyticExtractedReport']['count'](_0x1838c6)[_0xe04f('0x22')](function(_0x10a3d7){_0x144be6[_0xe04f('0x3d')]=_0x10a3d7;if(_0x127d88[_0xe04f('0x30')][_0xe04f('0x3e')]){_0x3ab1f9['include']=[{'all':!![]}];}return db[_0xe04f('0x2b')][_0xe04f('0x3f')](_0x3ab1f9);})['then'](function(_0x31475b){_0x144be6[_0xe04f('0x40')]=_0x31475b;return _0x144be6;})[_0xe04f('0x22')](respondWithFilteredResult(_0x1a84de,_0x3ab1f9))['catch'](handleError(_0x1a84de,null));};exports[_0xe04f('0x41')]=function(_0x2c0c46,_0x3839fc){var _0x57ef27={'raw':!![],'where':{'id':_0x2c0c46[_0xe04f('0x42')]['id']}},_0x22e5b1={};_0x22e5b1[_0xe04f('0x2f')]=_[_0xe04f('0x31')](db['AnalyticExtractedReport'][_0xe04f('0x2c')]);_0x22e5b1[_0xe04f('0x30')]=_['keys'](_0x2c0c46['query']);_0x22e5b1['filters']=_[_0xe04f('0x33')](_0x22e5b1['model'],_0x22e5b1[_0xe04f('0x30')]);_0x57ef27[_0xe04f('0x34')]=_['intersection'](_0x22e5b1[_0xe04f('0x2f')],qs[_0xe04f('0x43')](_0x2c0c46[_0xe04f('0x30')][_0xe04f('0x43')]));_0x57ef27[_0xe04f('0x34')]=_0x57ef27['attributes'][_0xe04f('0x35')]?_0x57ef27['attributes']:_0x22e5b1[_0xe04f('0x2f')];if(_0x2c0c46['query'][_0xe04f('0x3e')]){_0x57ef27[_0xe04f('0x44')]=[{'all':!![]}];}_0x57ef27=_[_0xe04f('0x3a')]({},_0x57ef27,_0x2c0c46[_0xe04f('0x45')]);return db[_0xe04f('0x2b')]['find'](_0x57ef27)['then'](handleEntityNotFound(_0x3839fc,null))['then'](respondWithResult(_0x3839fc,null))[_0xe04f('0x46')](handleError(_0x3839fc,null));};exports[_0xe04f('0x47')]=function(_0x91c625,_0x3e1db2){return db[_0xe04f('0x2b')][_0xe04f('0x47')](_0x91c625[_0xe04f('0x48')],{})['then'](function(_0x2bfdb7){var _0x4f8dd2=_0x91c625[_0xe04f('0x49')][_0xe04f('0x4a')]({'plain':!![]});if(!_0x4f8dd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f8dd2[_0xe04f('0x4b')]==='user'){var _0x15de54=_0x2bfdb7[_0xe04f('0x4a')]({'plain':!![]});var _0x1c6691=_0xe04f('0x24');return db[_0xe04f('0x4c')][_0xe04f('0x4d')]({'where':{'name':_0x1c6691,'userProfileId':_0x4f8dd2[_0xe04f('0x4e')]},'raw':!![]})[_0xe04f('0x22')](function(_0x4f12a9){if(_0x4f12a9&&_0x4f12a9[_0xe04f('0x4f')]===0x0){return db['UserProfileResource'][_0xe04f('0x47')]({'name':_0x15de54[_0xe04f('0x28')],'resourceId':_0x15de54['id'],'type':_0x4f12a9[_0xe04f('0x28')],'sectionId':_0x4f12a9['id']},{})[_0xe04f('0x22')](function(){return _0x2bfdb7;});}else{return _0x2bfdb7;}})[_0xe04f('0x46')](function(_0x3f925a){logger[_0xe04f('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f925a);throw _0x3f925a;});}return _0x2bfdb7;})[_0xe04f('0x22')](respondWithResult(_0x3e1db2,0xc9))[_0xe04f('0x46')](handleError(_0x3e1db2,null));};exports['update']=function(_0x17c67c,_0x55f23){if(_0x17c67c['body']['id']){delete _0x17c67c['body']['id'];}return db[_0xe04f('0x2b')][_0xe04f('0x4d')]({'where':{'id':_0x17c67c['params']['id']}})[_0xe04f('0x22')](handleEntityNotFound(_0x55f23,null))['then'](saveUpdates(_0x17c67c[_0xe04f('0x48')],null))[_0xe04f('0x22')](respondWithResult(_0x55f23,null))[_0xe04f('0x46')](handleError(_0x55f23,null));};exports[_0xe04f('0x23')]=function(_0xb4bc9a,_0xa393d2){return db[_0xe04f('0x2b')][_0xe04f('0x4d')]({'where':{'id':_0xb4bc9a[_0xe04f('0x42')]['id']}})[_0xe04f('0x22')](handleEntityNotFound(_0xa393d2,null))['then'](removeEntity(_0xa393d2,null))['catch'](handleError(_0xa393d2,null));};exports[_0xe04f('0x50')]=function(_0x2892a0,_0x33922e,_0x33ac7d){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x2892a0[_0xe04f('0x42')]['id']},'attributes':[_0xe04f('0x28'),_0xe04f('0x51'),'savename',_0xe04f('0x52')],'raw':!![]})[_0xe04f('0x22')](handleEntityNotFound(_0x33922e,null))[_0xe04f('0x22')](function(_0x5cb915){if(_0x5cb915){if(!fs[_0xe04f('0x53')](path['join'](config['root'],_0xe04f('0x54'),_0x5cb915[_0xe04f('0x55')]))){throw new db['Sequelize'][(_0xe04f('0x56'))](_0xe04f('0x57'));}if(_0x2892a0[_0xe04f('0x30')][_0xe04f('0x58')]){return _0x33922e[_0xe04f('0x19')](0xc8);}return _0x33922e[_0xe04f('0x50')](path[_0xe04f('0x59')](config[_0xe04f('0x5a')],'server/files/reports',_0x5cb915[_0xe04f('0x55')]),util['format']('%s.%s',_0x5cb915[_0xe04f('0x51')]||_0x5cb915[_0xe04f('0x28')],_0x5cb915[_0xe04f('0x52')][_0xe04f('0x5b')]()));}})[_0xe04f('0x46')](handleError(_0x33922e,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 7147360..07c55a7 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 _0xcba4=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','analytics_extracted_reports','../../config/logger','moment'];(function(_0x86e23c,_0x5c6ba0){var _0x26a8a6=function(_0x5e5ad9){while(--_0x5e5ad9){_0x86e23c['push'](_0x86e23c['shift']());}};_0x26a8a6(++_0x5c6ba0);}(_0xcba4,0x6c));var _0x4cba=function(_0x29a81e,_0x2c2a3f){_0x29a81e=_0x29a81e-0x0;var _0x20c9cc=_0xcba4[_0x29a81e];return _0x20c9cc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4cba('0x0'))('api');var moment=require(_0x4cba('0x1'));var BPromise=require(_0x4cba('0x2'));var rp=require(_0x4cba('0x3'));var fs=require('fs');var path=require(_0x4cba('0x4'));var rimraf=require(_0x4cba('0x5'));var config=require(_0x4cba('0x6'));var attributes=require(_0x4cba('0x7'));module['exports']=function(_0xaccf9a,_0x1bc328){return _0xaccf9a[_0x4cba('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0x4cba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf40=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','analytics_extracted_reports','util','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdf40,0x136));var _0x0df4=function(_0x2f0057,_0x448b27){_0x2f0057=_0x2f0057-0x0;var _0x17f2c3=_0xdf40[_0x2f0057];return _0x17f2c3;};'use strict';var _=require('lodash');var util=require(_0x0df4('0x0'));var logger=require(_0x0df4('0x1'))(_0x0df4('0x2'));var moment=require(_0x0df4('0x3'));var BPromise=require(_0x0df4('0x4'));var rp=require(_0x0df4('0x5'));var fs=require('fs');var path=require(_0x0df4('0x6'));var rimraf=require(_0x0df4('0x7'));var config=require(_0x0df4('0x8'));var attributes=require('./analyticExtractedReport.attributes');module[_0x0df4('0x9')]=function(_0x60461d,_0x49dcdf){return _0x60461d[_0x0df4('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x0df4('0xb'),'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 ad7e36e..39e649a 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 _0x0718=['info','debug','request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x54b343,_0x49dd80){var _0x2fa5dc=function(_0x19006f){while(--_0x19006f){_0x54b343['push'](_0x54b343['shift']());}};_0x2fa5dc(++_0x49dd80);}(_0x0718,0x18a));var _0x8071=function(_0x585219,_0x23ba0b){_0x585219=_0x585219-0x0;var _0x32c6fe=_0x0718[_0x585219];return _0x32c6fe;};'use strict';var _=require(_0x8071('0x0'));var util=require('util');var moment=require(_0x8071('0x1'));var BPromise=require(_0x8071('0x2'));var rs=require(_0x8071('0x3'));var fs=require('fs');var Redis=require(_0x8071('0x4'));var db=require(_0x8071('0x5'))['db'];var utils=require(_0x8071('0x6'));var logger=require(_0x8071('0x7'))(_0x8071('0x8'));var config=require(_0x8071('0x9'));var jayson=require(_0x8071('0xa'));var client=jayson[_0x8071('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e1e35,_0x1e011c,_0x4d38ac){return new BPromise(function(_0x52d2e3,_0x4d8cd4){return client[_0x8071('0xc')](_0x1e1e35,_0x4d38ac)[_0x8071('0xd')](function(_0x5bbb8f){logger[_0x8071('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e011c,'request\x20sent');logger[_0x8071('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1e011c,_0x8071('0x10'),JSON[_0x8071('0x11')](_0x5bbb8f));if(_0x5bbb8f[_0x8071('0x12')]){if(_0x5bbb8f[_0x8071('0x12')][_0x8071('0x13')]===0x1f4){logger['error'](_0x8071('0x14'),_0x1e011c,_0x5bbb8f[_0x8071('0x12')]['message']);return _0x4d8cd4(_0x5bbb8f[_0x8071('0x12')][_0x8071('0x15')]);}logger[_0x8071('0x12')](_0x8071('0x14'),_0x1e011c,_0x5bbb8f[_0x8071('0x12')][_0x8071('0x15')]);return _0x52d2e3(_0x5bbb8f[_0x8071('0x12')]['message']);}else{logger['info'](_0x8071('0x14'),_0x1e011c,_0x8071('0x10'));_0x52d2e3(_0x5bbb8f[_0x8071('0x16')][_0x8071('0x15')]);}})[_0x8071('0x17')](function(_0x1d79e1){logger[_0x8071('0x12')](_0x8071('0x14'),_0x1e011c,_0x1d79e1);_0x4d8cd4(_0x1d79e1);});});} \ No newline at end of file +var _0x4790=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x1e8abf,_0x2eda49){var _0x4f2681=function(_0x54b566){while(--_0x54b566){_0x1e8abf['push'](_0x1e8abf['shift']());}};_0x4f2681(++_0x2eda49);}(_0x4790,0x84));var _0x0479=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x4790[_0x111e94];return _0x3de107;};'use strict';var _=require(_0x0479('0x0'));var util=require(_0x0479('0x1'));var moment=require(_0x0479('0x2'));var BPromise=require(_0x0479('0x3'));var rs=require(_0x0479('0x4'));var fs=require('fs');var Redis=require(_0x0479('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0479('0x6'));var logger=require(_0x0479('0x7'))(_0x0479('0x8'));var config=require(_0x0479('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0479('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2612e3,_0x42ef9e,_0x480830){return new BPromise(function(_0x1b6e6c,_0x3e885d){return client[_0x0479('0xb')](_0x2612e3,_0x480830)[_0x0479('0xc')](function(_0x417637){logger['info'](_0x0479('0xd'),_0x42ef9e,_0x0479('0xe'));logger['debug'](_0x0479('0xf'),_0x42ef9e,_0x0479('0xe'),JSON['stringify'](_0x417637));if(_0x417637['error']){if(_0x417637[_0x0479('0x10')][_0x0479('0x11')]===0x1f4){logger['error'](_0x0479('0xd'),_0x42ef9e,_0x417637[_0x0479('0x10')][_0x0479('0x12')]);return _0x3e885d(_0x417637['error'][_0x0479('0x12')]);}logger[_0x0479('0x10')](_0x0479('0xd'),_0x42ef9e,_0x417637['error']['message']);return _0x1b6e6c(_0x417637['error'][_0x0479('0x12')]);}else{logger[_0x0479('0x13')](_0x0479('0xd'),_0x42ef9e,_0x0479('0xe'));_0x1b6e6c(_0x417637[_0x0479('0x14')][_0x0479('0x12')]);}})[_0x0479('0x15')](function(_0x4a79aa){logger[_0x0479('0x10')](_0x0479('0xd'),_0x42ef9e,_0x4a79aa);_0x3e885d(_0x4a79aa);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index cc7e29e..8382a39 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 _0xd62a=['isAuthenticated','index','/:id','/:id/download','put','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x310a54,_0x212d9a){var _0x4e4caa=function(_0x6baec9){while(--_0x6baec9){_0x310a54['push'](_0x310a54['shift']());}};_0x4e4caa(++_0x212d9a);}(_0xd62a,0x7f));var _0xad62=function(_0x3e50b9,_0x4dc066){_0x3e50b9=_0x3e50b9-0x0;var _0x355479=_0xd62a[_0x3e50b9];return _0x355479;};'use strict';var multer=require(_0xad62('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xad62('0x1'));var router=express[_0xad62('0x2')]();var fs_extra=require(_0xad62('0x3'));var auth=require(_0xad62('0x4'));var interaction=require(_0xad62('0x5'));var config=require(_0xad62('0x6'));var controller=require(_0xad62('0x7'));router[_0xad62('0x8')]('/',auth[_0xad62('0x9')](),controller[_0xad62('0xa')]);router[_0xad62('0x8')](_0xad62('0xb'),auth[_0xad62('0x9')](),controller['show']);router[_0xad62('0x8')](_0xad62('0xc'),auth[_0xad62('0x9')](),controller['download']);router['post']('/',auth[_0xad62('0x9')](),controller['create']);router[_0xad62('0xd')](_0xad62('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xad62('0xe')](_0xad62('0xb'),auth['isAuthenticated'](),controller[_0xad62('0xf')]);module[_0xad62('0x10')]=router; \ No newline at end of file +var _0x3ff0=['get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x56eca1,_0x55c0fa){var _0x4f098f=function(_0x35f128){while(--_0x35f128){_0x56eca1['push'](_0x56eca1['shift']());}};_0x4f098f(++_0x55c0fa);}(_0x3ff0,0x14c));var _0x03ff=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0x3ff0[_0x11155f];return _0xd07e48;};'use strict';var multer=require(_0x03ff('0x0'));var util=require(_0x03ff('0x1'));var path=require(_0x03ff('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x03ff('0x3'));var auth=require(_0x03ff('0x4'));var interaction=require(_0x03ff('0x5'));var config=require(_0x03ff('0x6'));var controller=require(_0x03ff('0x7'));router[_0x03ff('0x8')]('/',auth[_0x03ff('0x9')](),controller[_0x03ff('0xa')]);router['get'](_0x03ff('0xb'),auth['isAuthenticated'](),controller[_0x03ff('0xc')]);router['get'](_0x03ff('0xd'),auth[_0x03ff('0x9')](),controller[_0x03ff('0xe')]);router[_0x03ff('0xf')]('/',auth[_0x03ff('0x9')](),controller[_0x03ff('0x10')]);router['put'](_0x03ff('0xb'),auth[_0x03ff('0x9')](),controller[_0x03ff('0x11')]);router['delete'](_0x03ff('0xb'),auth[_0x03ff('0x9')](),controller[_0x03ff('0x12')]);module[_0x03ff('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index e44c6b1..ed2ae2d 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 _0x0d36=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x49a8f0,_0x2579c8){var _0x4e55e9=function(_0x909b7a){while(--_0x909b7a){_0x49a8f0['push'](_0x49a8f0['shift']());}};_0x4e55e9(++_0x2579c8);}(_0x0d36,0x9a));var _0x60d3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0d36[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x60d3('0x0'));module['exports']={'field':{'type':Sequelize[_0x60d3('0x1')]},'alias':{'type':Sequelize[_0x60d3('0x2')]},'function':{'type':Sequelize[_0x60d3('0x2')]},'format':{'type':Sequelize[_0x60d3('0x2')]},'groupBy':{'type':Sequelize[_0x60d3('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x60d3('0x2')]},'custom':{'type':Sequelize[_0x60d3('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xba42=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x5d8623,_0x225c42){var _0x260db7=function(_0x35758c){while(--_0x35758c){_0x5d8623['push'](_0x5d8623['shift']());}};_0x260db7(++_0x225c42);}(_0xba42,0xc5));var _0x2ba4=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xba42[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0x2ba4('0x0'));module[_0x2ba4('0x1')]={'field':{'type':Sequelize[_0x2ba4('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x2ba4('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x2ba4('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2ba4('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index e0feb10..a06d9d5 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 _0x406c=['mustache','util','path','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','name','status','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','AnalyticFieldReport','includeAll','include','findAll','catch','show','keys','create','body','bulkCreate','find','params','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x277107,_0x3420dc){var _0x1da046=function(_0x47122d){while(--_0x47122d){_0x277107['push'](_0x277107['shift']());}};_0x1da046(++_0x3420dc);}(_0x406c,0x1e1));var _0xc406=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x406c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc406('0x0'));var rimraf=require(_0xc406('0x1'));var zipdir=require(_0xc406('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc406('0x3'));var moment=require('moment');var BPromise=require(_0xc406('0x4'));var Mustache=require(_0xc406('0x5'));var util=require(_0xc406('0x6'));var path=require(_0xc406('0x7'));var sox=require('sox');var csv=require(_0xc406('0x8'));var ejs=require(_0xc406('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc406('0xa'));var crypto=require(_0xc406('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc406('0xc'));var toCsv=require(_0xc406('0x8'));var querystring=require('querystring');var Papa=require(_0xc406('0xd'));var Redis=require(_0xc406('0xe'));var authService=require(_0xc406('0xf'));var qs=require(_0xc406('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc406('0x11'));var logger=require(_0xc406('0x12'))(_0xc406('0x13'));var utils=require(_0xc406('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc406('0x15'))['db'];function respondWithStatusCode(_0x4f10fc,_0x4efa0f){_0x4efa0f=_0x4efa0f||0xcc;return function(_0x46d76f){if(_0x46d76f){return _0x4f10fc[_0xc406('0x16')](_0x4efa0f);}return _0x4f10fc['status'](_0x4efa0f)[_0xc406('0x17')]();};}function respondWithResult(_0xb2fae,_0x4095e9){_0x4095e9=_0x4095e9||0xc8;return function(_0x2922b9){if(_0x2922b9){return _0xb2fae['status'](_0x4095e9)[_0xc406('0x18')](_0x2922b9);}};}function respondWithFilteredResult(_0x245856,_0x33c3dd){return function(_0x5e9e11){if(_0x5e9e11){var _0xd9fcea=typeof _0x33c3dd['offset']===_0xc406('0x19')&&typeof _0x33c3dd['limit']==='undefined';var _0x23b7bf=_0x5e9e11[_0xc406('0x1a')];var _0x31a6f1=_0xd9fcea?0x0:_0x33c3dd[_0xc406('0x1b')];var _0x3d0add=_0xd9fcea?_0x5e9e11[_0xc406('0x1a')]:_0x33c3dd[_0xc406('0x1b')]+_0x33c3dd[_0xc406('0x1c')];var _0x761cbc;if(_0x3d0add>=_0x23b7bf){_0x3d0add=_0x23b7bf;_0x761cbc=0xc8;}else{_0x761cbc=0xce;}_0x245856['status'](_0x761cbc);return _0x245856[_0xc406('0x1d')](_0xc406('0x1e'),_0x31a6f1+'-'+_0x3d0add+'/'+_0x23b7bf)['json'](_0x5e9e11);}return null;};}function patchUpdates(_0x1d10df){return function(_0x207a1e){try{jsonpatch[_0xc406('0x1f')](_0x207a1e,_0x1d10df,!![]);}catch(_0x44e524){return BPromise[_0xc406('0x20')](_0x44e524);}return _0x207a1e['save']();};}function saveUpdates(_0x4154b0,_0x471c42){return function(_0x13edf2){if(_0x13edf2){return _0x13edf2[_0xc406('0x21')](_0x4154b0)['then'](function(_0x58470f){return _0x58470f;});}return null;};}function removeEntity(_0x5a9855,_0x37ca8f){return function(_0x5c69fa){if(_0x5c69fa){return _0x5c69fa[_0xc406('0x22')]()[_0xc406('0x23')](function(){_0x5a9855['status'](0xcc)[_0xc406('0x17')]();});}};}function handleEntityNotFound(_0x168dfc,_0x2a86d4){return function(_0x521c81){if(!_0x521c81){_0x168dfc[_0xc406('0x16')](0x194);}return _0x521c81;};}function handleError(_0x31566d,_0x440449){_0x440449=_0x440449||0x1f4;return function(_0x4fcc51){logger[_0xc406('0x24')](_0x4fcc51['stack']);if(_0x4fcc51[_0xc406('0x25')]){delete _0x4fcc51['name'];}_0x31566d[_0xc406('0x26')](_0x440449)[_0xc406('0x27')](_0x4fcc51);};}exports[_0xc406('0x28')]=function(_0xe23cc,_0x2db61c){var _0xdc6da6={},_0x363bfc={},_0x2297c8={'count':0x0,'rows':[]};var _0x23dc1f=_[_0xc406('0x29')](db['AnalyticFieldReport'][_0xc406('0x2a')],function(_0x3be46a){return{'name':_0x3be46a[_0xc406('0x2b')],'type':_0x3be46a[_0xc406('0x2c')][_0xc406('0x2d')]};});_0x363bfc[_0xc406('0x2e')]=_[_0xc406('0x29')](_0x23dc1f,_0xc406('0x25'));_0x363bfc[_0xc406('0x2f')]=_['keys'](_0xe23cc[_0xc406('0x2f')]);_0x363bfc[_0xc406('0x30')]=_[_0xc406('0x31')](_0x363bfc['model'],_0x363bfc['query']);_0xdc6da6[_0xc406('0x32')]=_[_0xc406('0x31')](_0x363bfc[_0xc406('0x2e')],qs[_0xc406('0x33')](_0xe23cc['query'][_0xc406('0x33')]));_0xdc6da6['attributes']=_0xdc6da6['attributes'][_0xc406('0x34')]?_0xdc6da6['attributes']:_0x363bfc[_0xc406('0x2e')];if(!_0xe23cc[_0xc406('0x2f')][_0xc406('0x35')](_0xc406('0x36'))){_0xdc6da6[_0xc406('0x1c')]=qs['limit'](_0xe23cc[_0xc406('0x2f')][_0xc406('0x1c')]);_0xdc6da6['offset']=qs[_0xc406('0x1b')](_0xe23cc[_0xc406('0x2f')][_0xc406('0x1b')]);}_0xdc6da6[_0xc406('0x37')]=qs['sort'](_0xe23cc[_0xc406('0x2f')][_0xc406('0x38')]);_0xdc6da6[_0xc406('0x39')]=qs[_0xc406('0x30')](_[_0xc406('0x3a')](_0xe23cc[_0xc406('0x2f')],_0x363bfc[_0xc406('0x30')]),_0x23dc1f);if(_0xe23cc[_0xc406('0x2f')][_0xc406('0x3b')]){_0xdc6da6[_0xc406('0x39')]=_['merge'](_0xdc6da6[_0xc406('0x39')],{'$or':_[_0xc406('0x29')](_0x23dc1f,function(_0x287c96){if(_0x287c96[_0xc406('0x2c')]!==_0xc406('0x3c')){var _0x28d1da={};_0x28d1da[_0x287c96['name']]={'$like':'%'+_0xe23cc['query'][_0xc406('0x3b')]+'%'};return _0x28d1da;}})});}_0xdc6da6=_[_0xc406('0x3d')]({},_0xdc6da6,_0xe23cc[_0xc406('0x3e')]);var _0x2e5656={'where':_0xdc6da6[_0xc406('0x39')]};return db[_0xc406('0x3f')][_0xc406('0x1a')](_0x2e5656)[_0xc406('0x23')](function(_0x271e97){_0x2297c8['count']=_0x271e97;if(_0xe23cc[_0xc406('0x2f')][_0xc406('0x40')]){_0xdc6da6[_0xc406('0x41')]=[{'all':!![]}];}return db[_0xc406('0x3f')][_0xc406('0x42')](_0xdc6da6);})['then'](function(_0x147341){_0x2297c8['rows']=_0x147341;return _0x2297c8;})[_0xc406('0x23')](respondWithFilteredResult(_0x2db61c,_0xdc6da6))[_0xc406('0x43')](handleError(_0x2db61c,null));};exports[_0xc406('0x44')]=function(_0x1f75d2,_0x321f81){var _0x272b7e={'raw':![],'where':{'id':_0x1f75d2['params']['id']}},_0x3b2553={};_0x3b2553[_0xc406('0x2e')]=_[_0xc406('0x45')](db[_0xc406('0x3f')][_0xc406('0x2a')]);_0x3b2553[_0xc406('0x2f')]=_[_0xc406('0x45')](_0x1f75d2[_0xc406('0x2f')]);_0x3b2553['filters']=_[_0xc406('0x31')](_0x3b2553[_0xc406('0x2e')],_0x3b2553[_0xc406('0x2f')]);_0x272b7e[_0xc406('0x32')]=_['intersection'](_0x3b2553[_0xc406('0x2e')],qs['fields'](_0x1f75d2[_0xc406('0x2f')][_0xc406('0x33')]));_0x272b7e[_0xc406('0x32')]=_0x272b7e[_0xc406('0x32')][_0xc406('0x34')]?_0x272b7e[_0xc406('0x32')]:_0x3b2553['model'];if(_0x1f75d2['query'][_0xc406('0x40')]){_0x272b7e[_0xc406('0x41')]=[{'all':!![]}];}_0x272b7e=_[_0xc406('0x3d')]({},_0x272b7e,_0x1f75d2[_0xc406('0x3e')]);return db['AnalyticFieldReport']['find'](_0x272b7e)[_0xc406('0x23')](handleEntityNotFound(_0x321f81,null))[_0xc406('0x23')](respondWithResult(_0x321f81,null))[_0xc406('0x43')](handleError(_0x321f81,null));};exports[_0xc406('0x46')]=function(_0x1c8321,_0xc982b0){return db[_0xc406('0x3f')][_0xc406('0x46')](_0x1c8321[_0xc406('0x47')],{})[_0xc406('0x23')](respondWithResult(_0xc982b0,0xc9))[_0xc406('0x43')](handleError(_0xc982b0,null));};exports['bulkCreate']=function(_0x1b24d5,_0x4a1f4f){return db[_0xc406('0x3f')][_0xc406('0x48')](_0x1b24d5['body'],{'raw':![],'individualHooks':!![]})[_0xc406('0x23')](respondWithResult(_0x4a1f4f,0xc9))[_0xc406('0x43')](handleError(_0x4a1f4f,null));};exports['update']=function(_0x2f56ea,_0x5f4722){if(_0x2f56ea[_0xc406('0x47')]['id']){delete _0x2f56ea['body']['id'];}return db['AnalyticFieldReport'][_0xc406('0x49')]({'where':{'id':_0x2f56ea[_0xc406('0x4a')]['id']}})[_0xc406('0x23')](handleEntityNotFound(_0x5f4722,null))[_0xc406('0x23')](saveUpdates(_0x2f56ea[_0xc406('0x47')],null))[_0xc406('0x23')](respondWithResult(_0x5f4722,null))[_0xc406('0x43')](handleError(_0x5f4722,null));};exports['destroy']=function(_0x1dfb6a,_0x13ceff){return db[_0xc406('0x3f')][_0xc406('0x49')]({'where':{'id':_0x1dfb6a[_0xc406('0x4a')]['id']}})[_0xc406('0x23')](handleEntityNotFound(_0x13ceff,null))[_0xc406('0x23')](removeEntity(_0x13ceff,null))[_0xc406('0x43')](handleError(_0x13ceff,null));};exports['bulkDestroy']=function(_0x3ea60f,_0xdc9036){return db['AnalyticFieldReport'][_0xc406('0x22')]({'where':{'id':_0x3ea60f['query'][_0xc406('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xdc9036,0xcc))[_0xc406('0x43')](handleError(_0xdc9036,null));};exports[_0xc406('0x4c')]=function(_0x5a488f,_0x6caa2,_0x5c8722){return db[_0xc406('0x4d')][_0xc406('0x4e')]({'where':{'id':_0x5a488f[_0xc406('0x4a')]['id']}})[_0xc406('0x23')](handleEntityNotFound(_0x6caa2,null))['then'](function(_0x242346){if(_0x242346){return db[_0xc406('0x4f')]['transaction'](function(_0x550a3e){return db[_0xc406('0x3f')][_0xc406('0x22')]({'where':{'CustomReportId':_0x5a488f[_0xc406('0x4a')]['id']},'transaction':_0x550a3e})['then'](function(_0x86b705){var _0x2b8470=_[_0xc406('0x29')](_0x5a488f['body'],function(_0x551342){delete _0x551342['id'];_0x551342[_0xc406('0x50')]=_0x5a488f[_0xc406('0x4a')]['id'];return _0x551342;});return db['AnalyticFieldReport'][_0xc406('0x48')](_0x2b8470,{'transaction':_0x550a3e});});})[_0xc406('0x23')](function(){return db[_0xc406('0x3f')]['findAll']({'where':{'CustomReportId':_0x5a488f[_0xc406('0x4a')]['id']}});});}})['then'](respondWithResult(_0x6caa2,null))[_0xc406('0x43')](handleError(_0x6caa2,null));}; \ No newline at end of file +var _0x0f15=['status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','end','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','find','create','body','bulkCreate','destroy','params','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3879a1,_0x12df62){var _0x43986b=function(_0x30ef20){while(--_0x30ef20){_0x3879a1['push'](_0x3879a1['shift']());}};_0x43986b(++_0x12df62);}(_0x0f15,0xd6));var _0x50f1=function(_0x41eb44,_0x229d85){_0x41eb44=_0x41eb44-0x0;var _0x334ba7=_0x0f15[_0x41eb44];return _0x334ba7;};'use strict';var emlformat=require(_0x50f1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x50f1('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x50f1('0x2'));var Mustache=require('mustache');var util=require(_0x50f1('0x3'));var path=require(_0x50f1('0x4'));var sox=require(_0x50f1('0x5'));var csv=require(_0x50f1('0x6'));var ejs=require(_0x50f1('0x7'));var fs=require('fs');var fs_extra=require(_0x50f1('0x8'));var _=require(_0x50f1('0x9'));var squel=require('squel');var crypto=require(_0x50f1('0xa'));var jsforce=require(_0x50f1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x50f1('0x6'));var querystring=require(_0x50f1('0xc'));var Papa=require(_0x50f1('0xd'));var Redis=require(_0x50f1('0xe'));var authService=require(_0x50f1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x50f1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x50f1('0x11'))(_0x50f1('0x12'));var utils=require('../../config/utils');var config=require(_0x50f1('0x13'));var licenseUtil=require(_0x50f1('0x14'));var db=require(_0x50f1('0x15'))['db'];function respondWithStatusCode(_0x8732b4,_0xc51ef9){_0xc51ef9=_0xc51ef9||0xcc;return function(_0x5e5c02){if(_0x5e5c02){return _0x8732b4[_0x50f1('0x16')](_0xc51ef9);}return _0x8732b4['status'](_0xc51ef9)['end']();};}function respondWithResult(_0x26bc97,_0x757a8b){_0x757a8b=_0x757a8b||0xc8;return function(_0x3a71b7){if(_0x3a71b7){return _0x26bc97[_0x50f1('0x17')](_0x757a8b)[_0x50f1('0x18')](_0x3a71b7);}};}function respondWithFilteredResult(_0x56e920,_0xed9dac){return function(_0x1c6af3){if(_0x1c6af3){var _0x2e93db=typeof _0xed9dac['offset']===_0x50f1('0x19')&&typeof _0xed9dac[_0x50f1('0x1a')]===_0x50f1('0x19');var _0xc3fed3=_0x1c6af3[_0x50f1('0x1b')];var _0x202272=_0x2e93db?0x0:_0xed9dac['offset'];var _0x35c249=_0x2e93db?_0x1c6af3[_0x50f1('0x1b')]:_0xed9dac[_0x50f1('0x1c')]+_0xed9dac[_0x50f1('0x1a')];var _0x402fea;if(_0x35c249>=_0xc3fed3){_0x35c249=_0xc3fed3;_0x402fea=0xc8;}else{_0x402fea=0xce;}_0x56e920[_0x50f1('0x17')](_0x402fea);return _0x56e920['set'](_0x50f1('0x1d'),_0x202272+'-'+_0x35c249+'/'+_0xc3fed3)[_0x50f1('0x18')](_0x1c6af3);}return null;};}function patchUpdates(_0x14c13f){return function(_0xb7b703){try{jsonpatch[_0x50f1('0x1e')](_0xb7b703,_0x14c13f,!![]);}catch(_0x2674b0){return BPromise[_0x50f1('0x1f')](_0x2674b0);}return _0xb7b703[_0x50f1('0x20')]();};}function saveUpdates(_0x2820ee,_0x450d2e){return function(_0x418887){if(_0x418887){return _0x418887['update'](_0x2820ee)['then'](function(_0x5e19fb){return _0x5e19fb;});}return null;};}function removeEntity(_0x4d2c22,_0x50927d){return function(_0x40efc2){if(_0x40efc2){return _0x40efc2['destroy']()[_0x50f1('0x21')](function(){_0x4d2c22[_0x50f1('0x17')](0xcc)[_0x50f1('0x22')]();});}};}function handleEntityNotFound(_0x1c51d2,_0x25bbf8){return function(_0x5ccb21){if(!_0x5ccb21){_0x1c51d2['sendStatus'](0x194);}return _0x5ccb21;};}function handleError(_0x53e4bd,_0x3847bd){_0x3847bd=_0x3847bd||0x1f4;return function(_0x437ca3){logger[_0x50f1('0x23')](_0x437ca3[_0x50f1('0x24')]);if(_0x437ca3['name']){delete _0x437ca3[_0x50f1('0x25')];}_0x53e4bd[_0x50f1('0x17')](_0x3847bd)['send'](_0x437ca3);};}exports[_0x50f1('0x26')]=function(_0x56d925,_0x2efea7){var _0x9ab9e3={},_0x46b1dd={},_0x3ce7a5={'count':0x0,'rows':[]};var _0x3a1301=_[_0x50f1('0x27')](db[_0x50f1('0x28')][_0x50f1('0x29')],function(_0x3a9e59){return{'name':_0x3a9e59[_0x50f1('0x2a')],'type':_0x3a9e59[_0x50f1('0x2b')][_0x50f1('0x2c')]};});_0x46b1dd[_0x50f1('0x2d')]=_[_0x50f1('0x27')](_0x3a1301,_0x50f1('0x25'));_0x46b1dd[_0x50f1('0x2e')]=_[_0x50f1('0x2f')](_0x56d925['query']);_0x46b1dd[_0x50f1('0x30')]=_[_0x50f1('0x31')](_0x46b1dd[_0x50f1('0x2d')],_0x46b1dd[_0x50f1('0x2e')]);_0x9ab9e3[_0x50f1('0x32')]=_[_0x50f1('0x31')](_0x46b1dd[_0x50f1('0x2d')],qs[_0x50f1('0x33')](_0x56d925['query']['fields']));_0x9ab9e3['attributes']=_0x9ab9e3[_0x50f1('0x32')][_0x50f1('0x34')]?_0x9ab9e3['attributes']:_0x46b1dd[_0x50f1('0x2d')];if(!_0x56d925['query'][_0x50f1('0x35')](_0x50f1('0x36'))){_0x9ab9e3['limit']=qs[_0x50f1('0x1a')](_0x56d925[_0x50f1('0x2e')][_0x50f1('0x1a')]);_0x9ab9e3[_0x50f1('0x1c')]=qs[_0x50f1('0x1c')](_0x56d925[_0x50f1('0x2e')][_0x50f1('0x1c')]);}_0x9ab9e3[_0x50f1('0x37')]=qs[_0x50f1('0x38')](_0x56d925['query'][_0x50f1('0x38')]);_0x9ab9e3['where']=qs['filters'](_['pick'](_0x56d925[_0x50f1('0x2e')],_0x46b1dd[_0x50f1('0x30')]),_0x3a1301);if(_0x56d925[_0x50f1('0x2e')][_0x50f1('0x39')]){_0x9ab9e3[_0x50f1('0x3a')]=_[_0x50f1('0x3b')](_0x9ab9e3[_0x50f1('0x3a')],{'$or':_[_0x50f1('0x27')](_0x3a1301,function(_0x469edc){if(_0x469edc[_0x50f1('0x2b')]!==_0x50f1('0x3c')){var _0x329ca0={};_0x329ca0[_0x469edc[_0x50f1('0x25')]]={'$like':'%'+_0x56d925[_0x50f1('0x2e')][_0x50f1('0x39')]+'%'};return _0x329ca0;}})});}_0x9ab9e3=_[_0x50f1('0x3b')]({},_0x9ab9e3,_0x56d925[_0x50f1('0x3d')]);var _0x52c052={'where':_0x9ab9e3[_0x50f1('0x3a')]};return db['AnalyticFieldReport']['count'](_0x52c052)[_0x50f1('0x21')](function(_0x845f0c){_0x3ce7a5[_0x50f1('0x1b')]=_0x845f0c;if(_0x56d925[_0x50f1('0x2e')][_0x50f1('0x3e')]){_0x9ab9e3['include']=[{'all':!![]}];}return db[_0x50f1('0x28')][_0x50f1('0x3f')](_0x9ab9e3);})[_0x50f1('0x21')](function(_0x374041){_0x3ce7a5[_0x50f1('0x40')]=_0x374041;return _0x3ce7a5;})[_0x50f1('0x21')](respondWithFilteredResult(_0x2efea7,_0x9ab9e3))[_0x50f1('0x41')](handleError(_0x2efea7,null));};exports[_0x50f1('0x42')]=function(_0x1a750d,_0x560b3c){var _0x5e9e4d={'raw':![],'where':{'id':_0x1a750d['params']['id']}},_0x70b7b2={};_0x70b7b2[_0x50f1('0x2d')]=_[_0x50f1('0x2f')](db[_0x50f1('0x28')][_0x50f1('0x29')]);_0x70b7b2[_0x50f1('0x2e')]=_[_0x50f1('0x2f')](_0x1a750d[_0x50f1('0x2e')]);_0x70b7b2['filters']=_['intersection'](_0x70b7b2['model'],_0x70b7b2['query']);_0x5e9e4d[_0x50f1('0x32')]=_[_0x50f1('0x31')](_0x70b7b2['model'],qs['fields'](_0x1a750d['query'][_0x50f1('0x33')]));_0x5e9e4d['attributes']=_0x5e9e4d[_0x50f1('0x32')]['length']?_0x5e9e4d['attributes']:_0x70b7b2[_0x50f1('0x2d')];if(_0x1a750d[_0x50f1('0x2e')][_0x50f1('0x3e')]){_0x5e9e4d['include']=[{'all':!![]}];}_0x5e9e4d=_[_0x50f1('0x3b')]({},_0x5e9e4d,_0x1a750d[_0x50f1('0x3d')]);return db[_0x50f1('0x28')][_0x50f1('0x43')](_0x5e9e4d)[_0x50f1('0x21')](handleEntityNotFound(_0x560b3c,null))[_0x50f1('0x21')](respondWithResult(_0x560b3c,null))[_0x50f1('0x41')](handleError(_0x560b3c,null));};exports[_0x50f1('0x44')]=function(_0x1a03fc,_0x311e65){return db[_0x50f1('0x28')][_0x50f1('0x44')](_0x1a03fc[_0x50f1('0x45')],{})[_0x50f1('0x21')](respondWithResult(_0x311e65,0xc9))[_0x50f1('0x41')](handleError(_0x311e65,null));};exports[_0x50f1('0x46')]=function(_0x37efa6,_0x912d43){return db['AnalyticFieldReport'][_0x50f1('0x46')](_0x37efa6[_0x50f1('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x912d43,0xc9))[_0x50f1('0x41')](handleError(_0x912d43,null));};exports['update']=function(_0x5f229f,_0x3cde0a){if(_0x5f229f[_0x50f1('0x45')]['id']){delete _0x5f229f[_0x50f1('0x45')]['id'];}return db[_0x50f1('0x28')]['find']({'where':{'id':_0x5f229f['params']['id']}})[_0x50f1('0x21')](handleEntityNotFound(_0x3cde0a,null))[_0x50f1('0x21')](saveUpdates(_0x5f229f['body'],null))[_0x50f1('0x21')](respondWithResult(_0x3cde0a,null))[_0x50f1('0x41')](handleError(_0x3cde0a,null));};exports[_0x50f1('0x47')]=function(_0x4327e0,_0x4b6c81){return db[_0x50f1('0x28')][_0x50f1('0x43')]({'where':{'id':_0x4327e0[_0x50f1('0x48')]['id']}})[_0x50f1('0x21')](handleEntityNotFound(_0x4b6c81,null))['then'](removeEntity(_0x4b6c81,null))[_0x50f1('0x41')](handleError(_0x4b6c81,null));};exports['bulkDestroy']=function(_0x54dec4,_0x252186){return db[_0x50f1('0x28')][_0x50f1('0x47')]({'where':{'id':_0x54dec4['query'][_0x50f1('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x50f1('0x21')](respondWithResult(_0x252186,0xcc))[_0x50f1('0x41')](handleError(_0x252186,null));};exports[_0x50f1('0x4a')]=function(_0x50dea4,_0x428311,_0xccca6b){return db[_0x50f1('0x4b')][_0x50f1('0x4c')]({'where':{'id':_0x50dea4[_0x50f1('0x48')]['id']}})[_0x50f1('0x21')](handleEntityNotFound(_0x428311,null))[_0x50f1('0x21')](function(_0xa7d332){if(_0xa7d332){return db['sequelize'][_0x50f1('0x4d')](function(_0xa3772d){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x50dea4[_0x50f1('0x48')]['id']},'transaction':_0xa3772d})[_0x50f1('0x21')](function(_0x3e49d5){var _0xf2bfa0=_['map'](_0x50dea4[_0x50f1('0x45')],function(_0x27c4ea){delete _0x27c4ea['id'];_0x27c4ea[_0x50f1('0x4e')]=_0x50dea4[_0x50f1('0x48')]['id'];return _0x27c4ea;});return db[_0x50f1('0x28')]['bulkCreate'](_0xf2bfa0,{'transaction':_0xa3772d});});})[_0x50f1('0x21')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x50dea4[_0x50f1('0x48')]['id']}});});}})[_0x50f1('0x21')](respondWithResult(_0x428311,null))[_0x50f1('0x41')](handleError(_0x428311,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 62973e8..50b28b0 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 _0x9dc1=['api','moment','bluebird','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger'];(function(_0x171ca9,_0x2bb32d){var _0x31668f=function(_0x437a37){while(--_0x437a37){_0x171ca9['push'](_0x171ca9['shift']());}};_0x31668f(++_0x2bb32d);}(_0x9dc1,0xf0));var _0x19dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9dc1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x19dc('0x0'));var util=require('util');var logger=require(_0x19dc('0x1'))(_0x19dc('0x2'));var moment=require(_0x19dc('0x3'));var BPromise=require(_0x19dc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x19dc('0x5'));var config=require(_0x19dc('0x6'));var attributes=require(_0x19dc('0x7'));module[_0x19dc('0x8')]=function(_0x59848b,_0x161866){return _0x59848b['define'](_0x19dc('0x9'),attributes,{'tableName':_0x19dc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53e3=['api','moment','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger'];(function(_0x237160,_0x1be8ec){var _0x1b2492=function(_0x5243b4){while(--_0x5243b4){_0x237160['push'](_0x237160['shift']());}};_0x1b2492(++_0x1be8ec);}(_0x53e3,0xb2));var _0x353e=function(_0x1aec15,_0x10b26c){_0x1aec15=_0x1aec15-0x0;var _0x28b124=_0x53e3[_0x1aec15];return _0x28b124;};'use strict';var _=require(_0x353e('0x0'));var util=require('util');var logger=require(_0x353e('0x1'))(_0x353e('0x2'));var moment=require(_0x353e('0x3'));var BPromise=require('bluebird');var rp=require(_0x353e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x353e('0x5'));var config=require(_0x353e('0x6'));var attributes=require(_0x353e('0x7'));module[_0x353e('0x8')]=function(_0x390b3f,_0x18579c){return _0x390b3f[_0x353e('0x9')](_0x353e('0xa'),attributes,{'tableName':_0x353e('0xb'),'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 250782b..d125c1b 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 _0xc7cf=['result','catch','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info'];(function(_0x208d69,_0x5bbfd1){var _0x42702c=function(_0x1b247a){while(--_0x1b247a){_0x208d69['push'](_0x208d69['shift']());}};_0x42702c(++_0x5bbfd1);}(_0xc7cf,0x1ca));var _0xfc7c=function(_0x47d6dc,_0xc036cc){_0x47d6dc=_0x47d6dc-0x0;var _0x1a1c93=_0xc7cf[_0x47d6dc];return _0x1a1c93;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfc7c('0x0'));var BPromise=require(_0xfc7c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc7c('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfc7c('0x3'))(_0xfc7c('0x4'));var config=require(_0xfc7c('0x5'));var jayson=require(_0xfc7c('0x6'));var client=jayson[_0xfc7c('0x7')][_0xfc7c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x49b378,_0x176ecc,_0x178604){return new BPromise(function(_0x41539e,_0x51ba83){return client[_0xfc7c('0x9')](_0x49b378,_0x178604)['then'](function(_0x329b9c){logger['info'](_0xfc7c('0xa'),_0x176ecc,'request\x20sent');logger[_0xfc7c('0xb')](_0xfc7c('0xc'),_0x176ecc,_0xfc7c('0xd'),JSON['stringify'](_0x329b9c));if(_0x329b9c[_0xfc7c('0xe')]){if(_0x329b9c[_0xfc7c('0xe')]['code']===0x1f4){logger[_0xfc7c('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x176ecc,_0x329b9c[_0xfc7c('0xe')][_0xfc7c('0xf')]);return _0x51ba83(_0x329b9c['error'][_0xfc7c('0xf')]);}logger[_0xfc7c('0xe')](_0xfc7c('0xa'),_0x176ecc,_0x329b9c[_0xfc7c('0xe')]['message']);return _0x41539e(_0x329b9c[_0xfc7c('0xe')][_0xfc7c('0xf')]);}else{logger[_0xfc7c('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x176ecc,'request\x20sent');_0x41539e(_0x329b9c[_0xfc7c('0x11')][_0xfc7c('0xf')]);}})[_0xfc7c('0x12')](function(_0x25a8ea){logger['error'](_0xfc7c('0xa'),_0x176ecc,_0x25a8ea);_0x51ba83(_0x25a8ea);});});} \ No newline at end of file +var _0x9b59=['result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x3522d8,_0x40233e){var _0x38d499=function(_0x5d823c){while(--_0x5d823c){_0x3522d8['push'](_0x3522d8['shift']());}};_0x38d499(++_0x40233e);}(_0x9b59,0x74));var _0x99b5=function(_0x10ae21,_0x502de1){_0x10ae21=_0x10ae21-0x0;var _0x2a1237=_0x9b59[_0x10ae21];return _0x2a1237;};'use strict';var _=require(_0x99b5('0x0'));var util=require(_0x99b5('0x1'));var moment=require(_0x99b5('0x2'));var BPromise=require(_0x99b5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99b5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x99b5('0x5'));var logger=require(_0x99b5('0x6'))(_0x99b5('0x7'));var config=require(_0x99b5('0x8'));var jayson=require(_0x99b5('0x9'));var client=jayson[_0x99b5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bc983,_0x37fda5,_0x41b2d2){return new BPromise(function(_0x4317f2,_0x2ad78a){return client[_0x99b5('0xb')](_0x3bc983,_0x41b2d2)[_0x99b5('0xc')](function(_0x4c5123){logger['info'](_0x99b5('0xd'),_0x37fda5,_0x99b5('0xe'));logger[_0x99b5('0xf')](_0x99b5('0x10'),_0x37fda5,_0x99b5('0xe'),JSON[_0x99b5('0x11')](_0x4c5123));if(_0x4c5123[_0x99b5('0x12')]){if(_0x4c5123[_0x99b5('0x12')][_0x99b5('0x13')]===0x1f4){logger[_0x99b5('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x37fda5,_0x4c5123['error'][_0x99b5('0x14')]);return _0x2ad78a(_0x4c5123[_0x99b5('0x12')]['message']);}logger[_0x99b5('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x37fda5,_0x4c5123['error'][_0x99b5('0x14')]);return _0x4317f2(_0x4c5123['error'][_0x99b5('0x14')]);}else{logger[_0x99b5('0x15')](_0x99b5('0xd'),_0x37fda5,'request\x20sent');_0x4317f2(_0x4c5123[_0x99b5('0x16')]['message']);}})['catch'](function(_0x258ee0){logger[_0x99b5('0x12')](_0x99b5('0xd'),_0x37fda5,_0x258ee0);_0x2ad78a(_0x258ee0);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 9bf7335..97d6390 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(_0x3d7775,_0x369083){var _0x28a482=function(_0x1d8b42){while(--_0x1d8b42){_0x3d7775['push'](_0x3d7775['shift']());}};_0x28a482(++_0x369083);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x15648d,_0x1ed0b8){var _0x2a80bd=function(_0x5d3ef7){while(--_0x5d3ef7){_0x15648d['push'](_0x15648d['shift']());}};_0x2a80bd(++_0x1ed0b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 3717531..91b9ded 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 _0xd8cc=['TEXT','sequelize','exports','STRING'];(function(_0x46b7dd,_0x46def2){var _0x10a9f3=function(_0xea1c39){while(--_0xea1c39){_0x46b7dd['push'](_0x46b7dd['shift']());}};_0x10a9f3(++_0x46def2);}(_0xd8cc,0xc9));var _0xcd8c=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0xd8cc[_0x235f49];return _0x551139;};'use strict';var Sequelize=require(_0xcd8c('0x0'));module[_0xcd8c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xcd8c('0x2')]},'metric':{'type':Sequelize[_0xcd8c('0x3')]},'description':{'type':Sequelize[_0xcd8c('0x2')]}}; \ No newline at end of file +var _0xbee3=['exports','STRING','TEXT'];(function(_0x212348,_0x55415c){var _0x1696e9=function(_0x2b87cb){while(--_0x2b87cb){_0x212348['push'](_0x212348['shift']());}};_0x1696e9(++_0x55415c);}(_0xbee3,0xd5));var _0x3bee=function(_0x3da212,_0x578b5a){_0x3da212=_0x3da212-0x0;var _0x33b6f1=_0xbee3[_0x3da212];return _0x33b6f1;};'use strict';var Sequelize=require('sequelize');module[_0x3bee('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x3bee('0x1')]},'metric':{'type':Sequelize[_0x3bee('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index bd1497d..b12bce1 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 _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(_0x1686a4,_0x3abe8d){var _0x34705c=function(_0x35ae02){while(--_0x35ae02){_0x1686a4['push'](_0x1686a4['shift']());}};_0x34705c(++_0x3abe8d);}(_0xe5b3,0x133));var _0x3e5b=function(_0x44574e,_0x4fcda3){_0x44574e=_0x44574e-0x0;var _0x159260=_0xe5b3[_0x44574e];return _0x159260;};'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 +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(_0x2bb649,_0x2e75f5){var _0x10487c=function(_0x59ceee){while(--_0x59ceee){_0x2bb649['push'](_0x2bb649['shift']());}};_0x10487c(++_0x2e75f5);}(_0x24ca,0x1bc));var _0xa24c=function(_0x344adc,_0x183c37){_0x344adc=_0x344adc-0x0;var _0x4014b2=_0x24ca[_0x344adc];return _0x4014b2;};'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 diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 842c549..289cbc9 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 _0xf3a7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','util','../../config/logger','api'];(function(_0x12428f,_0xed4e38){var _0x4595ae=function(_0x463b9a){while(--_0x463b9a){_0x12428f['push'](_0x12428f['shift']());}};_0x4595ae(++_0xed4e38);}(_0xf3a7,0x99));var _0x7f3a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf3a7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x7f3a('0x0'));var logger=require(_0x7f3a('0x1'))(_0x7f3a('0x2'));var moment=require(_0x7f3a('0x3'));var BPromise=require(_0x7f3a('0x4'));var rp=require(_0x7f3a('0x5'));var fs=require('fs');var path=require(_0x7f3a('0x6'));var rimraf=require(_0x7f3a('0x7'));var config=require(_0x7f3a('0x8'));var attributes=require(_0x7f3a('0x9'));module['exports']=function(_0x44f952,_0x2d86c1){return _0x44f952[_0x7f3a('0xa')](_0x7f3a('0xb'),attributes,{'tableName':_0x7f3a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cd0=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util'];(function(_0x15e750,_0x521bd4){var _0x551053=function(_0x2b0f64){while(--_0x2b0f64){_0x15e750['push'](_0x15e750['shift']());}};_0x551053(++_0x521bd4);}(_0x2cd0,0x10f));var _0x02cd=function(_0x4aac14,_0x361b03){_0x4aac14=_0x4aac14-0x0;var _0x2b58dc=_0x2cd0[_0x4aac14];return _0x2b58dc;};'use strict';var _=require(_0x02cd('0x0'));var util=require(_0x02cd('0x1'));var logger=require(_0x02cd('0x2'))(_0x02cd('0x3'));var moment=require(_0x02cd('0x4'));var BPromise=require(_0x02cd('0x5'));var rp=require(_0x02cd('0x6'));var fs=require('fs');var path=require(_0x02cd('0x7'));var rimraf=require('rimraf');var config=require(_0x02cd('0x8'));var attributes=require(_0x02cd('0x9'));module[_0x02cd('0xa')]=function(_0x17860f,_0x5172cc){return _0x17860f[_0x02cd('0xb')](_0x02cd('0xc'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 99e027b..4d31ce4 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 _0xc027=['client','http','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','lodash','util','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise'];(function(_0x54ec1a,_0x1ea2e6){var _0x225cfc=function(_0x330b64){while(--_0x330b64){_0x54ec1a['push'](_0x54ec1a['shift']());}};_0x225cfc(++_0x1ea2e6);}(_0xc027,0x185));var _0x7c02=function(_0x3a6fe8,_0x4aaa6b){_0x3a6fe8=_0x3a6fe8-0x0;var _0x248ad4=_0xc027[_0x3a6fe8];return _0x248ad4;};'use strict';var _=require(_0x7c02('0x0'));var util=require(_0x7c02('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7c02('0x2'));var fs=require('fs');var Redis=require(_0x7c02('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7c02('0x4'))('rpc');var config=require(_0x7c02('0x5'));var jayson=require(_0x7c02('0x6'));var client=jayson[_0x7c02('0x7')][_0x7c02('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7690f7,_0x455857,_0x1e4ec3){return new BPromise(function(_0x1e31ca,_0x542796){return client['request'](_0x7690f7,_0x1e4ec3)[_0x7c02('0x9')](function(_0x12cab5){logger[_0x7c02('0xa')](_0x7c02('0xb'),_0x455857,'request\x20sent');logger[_0x7c02('0xc')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x455857,_0x7c02('0xd'),JSON['stringify'](_0x12cab5));if(_0x12cab5['error']){if(_0x12cab5['error']['code']===0x1f4){logger[_0x7c02('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x455857,_0x12cab5[_0x7c02('0xe')][_0x7c02('0xf')]);return _0x542796(_0x12cab5['error']['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x455857,_0x12cab5[_0x7c02('0xe')][_0x7c02('0xf')]);return _0x1e31ca(_0x12cab5[_0x7c02('0xe')][_0x7c02('0xf')]);}else{logger[_0x7c02('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x455857,_0x7c02('0xd'));_0x1e31ca(_0x12cab5[_0x7c02('0x10')]['message']);}})[_0x7c02('0x11')](function(_0x533111){logger[_0x7c02('0xe')](_0x7c02('0xb'),_0x455857,_0x533111);_0x542796(_0x533111);});});} \ No newline at end of file +var _0x9b16=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1fcf1b,_0x214549){var _0x5d2952=function(_0x3331b7){while(--_0x3331b7){_0x1fcf1b['push'](_0x1fcf1b['shift']());}};_0x5d2952(++_0x214549);}(_0x9b16,0xb3));var _0x69b1=function(_0x51e675,_0xabd4cb){_0x51e675=_0x51e675-0x0;var _0x49a5f7=_0x9b16[_0x51e675];return _0x49a5f7;};'use strict';var _=require(_0x69b1('0x0'));var util=require('util');var moment=require(_0x69b1('0x1'));var BPromise=require(_0x69b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x69b1('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x69b1('0x4'));var jayson=require(_0x69b1('0x5'));var client=jayson[_0x69b1('0x6')][_0x69b1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e07f9,_0x5001df,_0x768175){return new BPromise(function(_0x1e7a65,_0x38dead){return client[_0x69b1('0x8')](_0x4e07f9,_0x768175)[_0x69b1('0x9')](function(_0x5c9951){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x5001df,_0x69b1('0xa'));logger[_0x69b1('0xb')](_0x69b1('0xc'),_0x5001df,_0x69b1('0xa'),JSON[_0x69b1('0xd')](_0x5c9951));if(_0x5c9951[_0x69b1('0xe')]){if(_0x5c9951['error'][_0x69b1('0xf')]===0x1f4){logger[_0x69b1('0xe')](_0x69b1('0x10'),_0x5001df,_0x5c9951[_0x69b1('0xe')][_0x69b1('0x11')]);return _0x38dead(_0x5c9951['error'][_0x69b1('0x11')]);}logger['error'](_0x69b1('0x10'),_0x5001df,_0x5c9951['error']['message']);return _0x1e7a65(_0x5c9951[_0x69b1('0xe')][_0x69b1('0x11')]);}else{logger[_0x69b1('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x5001df,_0x69b1('0xa'));_0x1e7a65(_0x5c9951[_0x69b1('0x13')][_0x69b1('0x11')]);}})[_0x69b1('0x14')](function(_0x146b0b){logger[_0x69b1('0xe')](_0x69b1('0x10'),_0x5001df,_0x146b0b);_0x38dead(_0x146b0b);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 8d801df..f9815be 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 _0xd5b2=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','show','isAuthenticated','create','put','update','delete','destroy','exports'];(function(_0x525ea4,_0x131af9){var _0x46a223=function(_0x29b1dd){while(--_0x29b1dd){_0x525ea4['push'](_0x525ea4['shift']());}};_0x46a223(++_0x131af9);}(_0xd5b2,0x10e));var _0x2d5b=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xd5b2[_0x33032e];return _0x13316b;};'use strict';var multer=require('multer');var util=require(_0x2d5b('0x0'));var path=require(_0x2d5b('0x1'));var timeout=require('connect-timeout');var express=require(_0x2d5b('0x2'));var router=express[_0x2d5b('0x3')]();var fs_extra=require(_0x2d5b('0x4'));var auth=require(_0x2d5b('0x5'));var interaction=require(_0x2d5b('0x6'));var config=require(_0x2d5b('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2d5b('0x8')]);router['get'](_0x2d5b('0x9'),auth['isAuthenticated'](),controller[_0x2d5b('0xa')]);router['post']('/',auth[_0x2d5b('0xb')](),controller[_0x2d5b('0xc')]);router[_0x2d5b('0xd')](_0x2d5b('0x9'),auth[_0x2d5b('0xb')](),controller[_0x2d5b('0xe')]);router[_0x2d5b('0xf')](_0x2d5b('0x9'),auth[_0x2d5b('0xb')](),controller[_0x2d5b('0x10')]);module[_0x2d5b('0x11')]=router; \ No newline at end of file +var _0x644f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','/:id','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x644f,0x177));var _0xf644=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0x644f[_0x5678b5];return _0x4c09a5;};'use strict';var multer=require('multer');var util=require(_0xf644('0x0'));var path=require(_0xf644('0x1'));var timeout=require(_0xf644('0x2'));var express=require(_0xf644('0x3'));var router=express[_0xf644('0x4')]();var fs_extra=require(_0xf644('0x5'));var auth=require(_0xf644('0x6'));var interaction=require(_0xf644('0x7'));var config=require(_0xf644('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xf644('0x9')](),controller[_0xf644('0xa')]);router[_0xf644('0xb')]('/:id',auth[_0xf644('0x9')](),controller[_0xf644('0xc')]);router[_0xf644('0xd')]('/',auth[_0xf644('0x9')](),controller[_0xf644('0xe')]);router['put'](_0xf644('0xf'),auth[_0xf644('0x9')](),controller[_0xf644('0x10')]);router[_0xf644('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf644('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index feafcdd..c9848d7 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 _0xb7c6=['sequelize','TEXT'];(function(_0x48545b,_0x5de8a3){var _0x163958=function(_0x2ca22e){while(--_0x2ca22e){_0x48545b['push'](_0x48545b['shift']());}};_0x163958(++_0x5de8a3);}(_0xb7c6,0x136));var _0x6b7c=function(_0x473d62,_0x57313b){_0x473d62=_0x473d62-0x0;var _0x1653e4=_0xb7c6[_0x473d62];return _0x1653e4;};'use strict';var Sequelize=require(_0x6b7c('0x0'));module['exports']={'tree':{'type':Sequelize[_0x6b7c('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x5fae=['sequelize','exports','TEXT'];(function(_0x2e9d8e,_0x3a377e){var _0x4dfc9b=function(_0x499ec4){while(--_0x499ec4){_0x2e9d8e['push'](_0x2e9d8e['shift']());}};_0x4dfc9b(++_0x3a377e);}(_0x5fae,0x159));var _0xe5fa=function(_0x3e8662,_0x591bd1){_0x3e8662=_0x3e8662-0x0;var _0xa09455=_0x5fae[_0x3e8662];return _0xa09455;};'use strict';var Sequelize=require(_0xe5fa('0x0'));module[_0xe5fa('0x1')]={'tree':{'type':Sequelize[_0xe5fa('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 4d79fd0..ec9539b 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 _0x4fdc=['include','findAll','catch','params','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','AnalyticTreeReport','includeAll'];(function(_0x3c22f7,_0x1fb12a){var _0x537f59=function(_0x471688){while(--_0x471688){_0x3c22f7['push'](_0x3c22f7['shift']());}};_0x537f59(++_0x1fb12a);}(_0x4fdc,0x12c));var _0xc4fd=function(_0x4345d7,_0x161da2){_0x4345d7=_0x4345d7-0x0;var _0x3c0ebf=_0x4fdc[_0x4345d7];return _0x3c0ebf;};'use strict';var emlformat=require(_0xc4fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc4fd('0x1'));var jsonpatch=require(_0xc4fd('0x2'));var rp=require(_0xc4fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc4fd('0x4'));var util=require(_0xc4fd('0x5'));var path=require(_0xc4fd('0x6'));var sox=require(_0xc4fd('0x7'));var csv=require(_0xc4fd('0x8'));var ejs=require(_0xc4fd('0x9'));var fs=require('fs');var fs_extra=require(_0xc4fd('0xa'));var _=require(_0xc4fd('0xb'));var squel=require(_0xc4fd('0xc'));var crypto=require(_0xc4fd('0xd'));var jsforce=require(_0xc4fd('0xe'));var deskjs=require(_0xc4fd('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc4fd('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc4fd('0x11'));var qs=require(_0xc4fd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4fd('0x13'));var logger=require(_0xc4fd('0x14'))(_0xc4fd('0x15'));var utils=require(_0xc4fd('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc4fd('0x17'))['db'];function respondWithStatusCode(_0x39e03b,_0x3fedcd){_0x3fedcd=_0x3fedcd||0xcc;return function(_0x55ad5c){if(_0x55ad5c){return _0x39e03b['sendStatus'](_0x3fedcd);}return _0x39e03b[_0xc4fd('0x18')](_0x3fedcd)[_0xc4fd('0x19')]();};}function respondWithResult(_0x51d744,_0x16d8e8){_0x16d8e8=_0x16d8e8||0xc8;return function(_0x6da140){if(_0x6da140){return _0x51d744['status'](_0x16d8e8)[_0xc4fd('0x1a')](_0x6da140);}};}function respondWithFilteredResult(_0x318b1a,_0x237a74){return function(_0x5a26fa){if(_0x5a26fa){var _0x42b3dc=typeof _0x237a74[_0xc4fd('0x1b')]==='undefined'&&typeof _0x237a74[_0xc4fd('0x1c')]===_0xc4fd('0x1d');var _0x5c7920=_0x5a26fa[_0xc4fd('0x1e')];var _0x2c9a04=_0x42b3dc?0x0:_0x237a74[_0xc4fd('0x1b')];var _0x2f8e6a=_0x42b3dc?_0x5a26fa['count']:_0x237a74['offset']+_0x237a74[_0xc4fd('0x1c')];var _0x4c50a4;if(_0x2f8e6a>=_0x5c7920){_0x2f8e6a=_0x5c7920;_0x4c50a4=0xc8;}else{_0x4c50a4=0xce;}_0x318b1a['status'](_0x4c50a4);return _0x318b1a[_0xc4fd('0x1f')]('Content-Range',_0x2c9a04+'-'+_0x2f8e6a+'/'+_0x5c7920)['json'](_0x5a26fa);}return null;};}function patchUpdates(_0xe00d0){return function(_0x50830f){try{jsonpatch[_0xc4fd('0x20')](_0x50830f,_0xe00d0,!![]);}catch(_0x36ba6d){return BPromise[_0xc4fd('0x21')](_0x36ba6d);}return _0x50830f[_0xc4fd('0x22')]();};}function saveUpdates(_0x14f31a,_0x499845){return function(_0x4b7235){if(_0x4b7235){return _0x4b7235['update'](_0x14f31a)[_0xc4fd('0x23')](function(_0x2e45ec){return _0x2e45ec;});}return null;};}function removeEntity(_0xaf510c,_0x305ba3){return function(_0x389881){if(_0x389881){return _0x389881[_0xc4fd('0x24')]()[_0xc4fd('0x23')](function(){_0xaf510c[_0xc4fd('0x18')](0xcc)[_0xc4fd('0x19')]();});}};}function handleEntityNotFound(_0x3a4c70,_0x2850ba){return function(_0x402947){if(!_0x402947){_0x3a4c70[_0xc4fd('0x25')](0x194);}return _0x402947;};}function handleError(_0x48f44d,_0xadf921){_0xadf921=_0xadf921||0x1f4;return function(_0x359be4){logger[_0xc4fd('0x26')](_0x359be4[_0xc4fd('0x27')]);if(_0x359be4[_0xc4fd('0x28')]){delete _0x359be4[_0xc4fd('0x28')];}_0x48f44d[_0xc4fd('0x18')](_0xadf921)[_0xc4fd('0x29')](_0x359be4);};}exports[_0xc4fd('0x2a')]=function(_0x44ac0e,_0x9f29d3){var _0x5e7852={},_0xde3c4={},_0x2d787e={'count':0x0,'rows':[]};var _0xfd66b3=_[_0xc4fd('0x2b')](db['AnalyticTreeReport']['rawAttributes'],function(_0x19cb07){return{'name':_0x19cb07[_0xc4fd('0x2c')],'type':_0x19cb07['type'][_0xc4fd('0x2d')]};});_0xde3c4[_0xc4fd('0x2e')]=_['map'](_0xfd66b3,_0xc4fd('0x28'));_0xde3c4[_0xc4fd('0x2f')]=_[_0xc4fd('0x30')](_0x44ac0e[_0xc4fd('0x2f')]);_0xde3c4[_0xc4fd('0x31')]=_[_0xc4fd('0x32')](_0xde3c4[_0xc4fd('0x2e')],_0xde3c4[_0xc4fd('0x2f')]);_0x5e7852['attributes']=_[_0xc4fd('0x32')](_0xde3c4[_0xc4fd('0x2e')],qs['fields'](_0x44ac0e[_0xc4fd('0x2f')][_0xc4fd('0x33')]));_0x5e7852['attributes']=_0x5e7852[_0xc4fd('0x34')][_0xc4fd('0x35')]?_0x5e7852[_0xc4fd('0x34')]:_0xde3c4['model'];if(!_0x44ac0e[_0xc4fd('0x2f')][_0xc4fd('0x36')](_0xc4fd('0x37'))){_0x5e7852[_0xc4fd('0x1c')]=qs['limit'](_0x44ac0e[_0xc4fd('0x2f')][_0xc4fd('0x1c')]);_0x5e7852[_0xc4fd('0x1b')]=qs[_0xc4fd('0x1b')](_0x44ac0e[_0xc4fd('0x2f')][_0xc4fd('0x1b')]);}_0x5e7852[_0xc4fd('0x38')]=qs['sort'](_0x44ac0e[_0xc4fd('0x2f')][_0xc4fd('0x39')]);_0x5e7852[_0xc4fd('0x3a')]=qs[_0xc4fd('0x31')](_['pick'](_0x44ac0e[_0xc4fd('0x2f')],_0xde3c4[_0xc4fd('0x31')]),_0xfd66b3);if(_0x44ac0e[_0xc4fd('0x2f')]['filter']){_0x5e7852['where']=_[_0xc4fd('0x3b')](_0x5e7852['where'],{'$or':_[_0xc4fd('0x2b')](_0xfd66b3,function(_0x46404b){if(_0x46404b[_0xc4fd('0x3c')]!==_0xc4fd('0x3d')){var _0x2d3452={};_0x2d3452[_0x46404b[_0xc4fd('0x28')]]={'$like':'%'+_0x44ac0e[_0xc4fd('0x2f')][_0xc4fd('0x3e')]+'%'};return _0x2d3452;}})});}_0x5e7852=_[_0xc4fd('0x3b')]({},_0x5e7852,_0x44ac0e['options']);var _0x2178ca={'where':_0x5e7852[_0xc4fd('0x3a')]};return db[_0xc4fd('0x3f')][_0xc4fd('0x1e')](_0x2178ca)[_0xc4fd('0x23')](function(_0x501578){_0x2d787e[_0xc4fd('0x1e')]=_0x501578;if(_0x44ac0e[_0xc4fd('0x2f')][_0xc4fd('0x40')]){_0x5e7852[_0xc4fd('0x41')]=[{'all':!![]}];}return db[_0xc4fd('0x3f')][_0xc4fd('0x42')](_0x5e7852);})[_0xc4fd('0x23')](function(_0x4a8bbc){_0x2d787e['rows']=_0x4a8bbc;return _0x2d787e;})[_0xc4fd('0x23')](respondWithFilteredResult(_0x9f29d3,_0x5e7852))[_0xc4fd('0x43')](handleError(_0x9f29d3,null));};exports['show']=function(_0x49828d,_0x370d5d){var _0x39758e={'raw':!![],'where':{'id':_0x49828d[_0xc4fd('0x44')]['id']}},_0x42d578={};_0x42d578[_0xc4fd('0x2e')]=_[_0xc4fd('0x30')](db[_0xc4fd('0x3f')]['rawAttributes']);_0x42d578[_0xc4fd('0x2f')]=_[_0xc4fd('0x30')](_0x49828d[_0xc4fd('0x2f')]);_0x42d578[_0xc4fd('0x31')]=_[_0xc4fd('0x32')](_0x42d578['model'],_0x42d578['query']);_0x39758e['attributes']=_[_0xc4fd('0x32')](_0x42d578[_0xc4fd('0x2e')],qs[_0xc4fd('0x33')](_0x49828d[_0xc4fd('0x2f')][_0xc4fd('0x33')]));_0x39758e[_0xc4fd('0x34')]=_0x39758e[_0xc4fd('0x34')][_0xc4fd('0x35')]?_0x39758e[_0xc4fd('0x34')]:_0x42d578[_0xc4fd('0x2e')];if(_0x49828d[_0xc4fd('0x2f')][_0xc4fd('0x40')]){_0x39758e[_0xc4fd('0x41')]=[{'all':!![]}];}_0x39758e=_[_0xc4fd('0x3b')]({},_0x39758e,_0x49828d['options']);return db[_0xc4fd('0x3f')][_0xc4fd('0x45')](_0x39758e)[_0xc4fd('0x23')](handleEntityNotFound(_0x370d5d,null))['then'](respondWithResult(_0x370d5d,null))[_0xc4fd('0x43')](handleError(_0x370d5d,null));};exports[_0xc4fd('0x46')]=function(_0x2a45d6,_0x536eb2){return db[_0xc4fd('0x3f')][_0xc4fd('0x46')](_0x2a45d6[_0xc4fd('0x47')],{})[_0xc4fd('0x23')](respondWithResult(_0x536eb2,0xc9))['catch'](handleError(_0x536eb2,null));};exports[_0xc4fd('0x48')]=function(_0x24b124,_0x4dd5a8){if(_0x24b124[_0xc4fd('0x47')]['id']){delete _0x24b124[_0xc4fd('0x47')]['id'];}return db[_0xc4fd('0x3f')]['find']({'where':{'id':_0x24b124[_0xc4fd('0x44')]['id']}})[_0xc4fd('0x23')](handleEntityNotFound(_0x4dd5a8,null))['then'](saveUpdates(_0x24b124[_0xc4fd('0x47')],null))['then'](respondWithResult(_0x4dd5a8,null))[_0xc4fd('0x43')](handleError(_0x4dd5a8,null));};exports[_0xc4fd('0x24')]=function(_0x11ea25,_0x29396c){return db[_0xc4fd('0x3f')][_0xc4fd('0x45')]({'where':{'id':_0x11ea25[_0xc4fd('0x44')]['id']}})[_0xc4fd('0x23')](handleEntityNotFound(_0x29396c,null))[_0xc4fd('0x23')](removeEntity(_0x29396c,null))[_0xc4fd('0x43')](handleError(_0x29396c,null));}; \ No newline at end of file +var _0x4c9b=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','json','apply','save','then','destroy','end','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x103722,_0x18533b){var _0x22f5c8=function(_0x272a8e){while(--_0x272a8e){_0x103722['push'](_0x103722['shift']());}};_0x22f5c8(++_0x18533b);}(_0x4c9b,0x1c6));var _0xb4c9=function(_0x204a52,_0x9f6d1c){_0x204a52=_0x204a52-0x0;var _0x389d2c=_0x4c9b[_0x204a52];return _0x389d2c;};'use strict';var emlformat=require(_0xb4c9('0x0'));var rimraf=require(_0xb4c9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb4c9('0x2'));var rp=require(_0xb4c9('0x3'));var moment=require(_0xb4c9('0x4'));var BPromise=require(_0xb4c9('0x5'));var Mustache=require(_0xb4c9('0x6'));var util=require('util');var path=require(_0xb4c9('0x7'));var sox=require(_0xb4c9('0x8'));var csv=require(_0xb4c9('0x9'));var ejs=require(_0xb4c9('0xa'));var fs=require('fs');var fs_extra=require(_0xb4c9('0xb'));var _=require('lodash');var squel=require(_0xb4c9('0xc'));var crypto=require(_0xb4c9('0xd'));var jsforce=require(_0xb4c9('0xe'));var deskjs=require(_0xb4c9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb4c9('0x10'));var Papa=require('papaparse');var Redis=require(_0xb4c9('0x11'));var authService=require(_0xb4c9('0x12'));var qs=require(_0xb4c9('0x13'));var as=require(_0xb4c9('0x14'));var hardwareService=require(_0xb4c9('0x15'));var logger=require(_0xb4c9('0x16'))(_0xb4c9('0x17'));var utils=require(_0xb4c9('0x18'));var config=require(_0xb4c9('0x19'));var licenseUtil=require(_0xb4c9('0x1a'));var db=require(_0xb4c9('0x1b'))['db'];function respondWithStatusCode(_0x3e8236,_0x4e96e3){_0x4e96e3=_0x4e96e3||0xcc;return function(_0x5b4496){if(_0x5b4496){return _0x3e8236[_0xb4c9('0x1c')](_0x4e96e3);}return _0x3e8236[_0xb4c9('0x1d')](_0x4e96e3)['end']();};}function respondWithResult(_0x2d8234,_0x31fbec){_0x31fbec=_0x31fbec||0xc8;return function(_0x636dd2){if(_0x636dd2){return _0x2d8234[_0xb4c9('0x1d')](_0x31fbec)['json'](_0x636dd2);}};}function respondWithFilteredResult(_0x1096f0,_0x441ed7){return function(_0x3cffa8){if(_0x3cffa8){var _0x378e97=typeof _0x441ed7['offset']===_0xb4c9('0x1e')&&typeof _0x441ed7[_0xb4c9('0x1f')]===_0xb4c9('0x1e');var _0x410ffb=_0x3cffa8[_0xb4c9('0x20')];var _0xb84390=_0x378e97?0x0:_0x441ed7[_0xb4c9('0x21')];var _0x231aba=_0x378e97?_0x3cffa8[_0xb4c9('0x20')]:_0x441ed7['offset']+_0x441ed7[_0xb4c9('0x1f')];var _0x19f48c;if(_0x231aba>=_0x410ffb){_0x231aba=_0x410ffb;_0x19f48c=0xc8;}else{_0x19f48c=0xce;}_0x1096f0['status'](_0x19f48c);return _0x1096f0[_0xb4c9('0x22')]('Content-Range',_0xb84390+'-'+_0x231aba+'/'+_0x410ffb)[_0xb4c9('0x23')](_0x3cffa8);}return null;};}function patchUpdates(_0x1fa859){return function(_0x5e4ecc){try{jsonpatch[_0xb4c9('0x24')](_0x5e4ecc,_0x1fa859,!![]);}catch(_0x2bddf8){return BPromise['reject'](_0x2bddf8);}return _0x5e4ecc[_0xb4c9('0x25')]();};}function saveUpdates(_0x57c9f4,_0x38960e){return function(_0x500d8f){if(_0x500d8f){return _0x500d8f['update'](_0x57c9f4)[_0xb4c9('0x26')](function(_0x1d5d20){return _0x1d5d20;});}return null;};}function removeEntity(_0x3b6eea,_0x4b446b){return function(_0x2dc6ed){if(_0x2dc6ed){return _0x2dc6ed[_0xb4c9('0x27')]()['then'](function(){_0x3b6eea['status'](0xcc)[_0xb4c9('0x28')]();});}};}function handleEntityNotFound(_0x29e977,_0x34e34c){return function(_0x5f34eb){if(!_0x5f34eb){_0x29e977[_0xb4c9('0x1c')](0x194);}return _0x5f34eb;};}function handleError(_0x4fe143,_0x30176b){_0x30176b=_0x30176b||0x1f4;return function(_0x39b44e){logger[_0xb4c9('0x29')](_0x39b44e[_0xb4c9('0x2a')]);if(_0x39b44e['name']){delete _0x39b44e[_0xb4c9('0x2b')];}_0x4fe143[_0xb4c9('0x1d')](_0x30176b)[_0xb4c9('0x2c')](_0x39b44e);};}exports[_0xb4c9('0x2d')]=function(_0x172535,_0x5f49fb){var _0x220242={},_0x2b2f0e={},_0x40e363={'count':0x0,'rows':[]};var _0x287b2d=_[_0xb4c9('0x2e')](db[_0xb4c9('0x2f')][_0xb4c9('0x30')],function(_0x59e9ce){return{'name':_0x59e9ce['fieldName'],'type':_0x59e9ce['type'][_0xb4c9('0x31')]};});_0x2b2f0e[_0xb4c9('0x32')]=_[_0xb4c9('0x2e')](_0x287b2d,'name');_0x2b2f0e[_0xb4c9('0x33')]=_[_0xb4c9('0x34')](_0x172535['query']);_0x2b2f0e[_0xb4c9('0x35')]=_[_0xb4c9('0x36')](_0x2b2f0e[_0xb4c9('0x32')],_0x2b2f0e['query']);_0x220242[_0xb4c9('0x37')]=_[_0xb4c9('0x36')](_0x2b2f0e['model'],qs[_0xb4c9('0x38')](_0x172535[_0xb4c9('0x33')]['fields']));_0x220242[_0xb4c9('0x37')]=_0x220242['attributes'][_0xb4c9('0x39')]?_0x220242[_0xb4c9('0x37')]:_0x2b2f0e['model'];if(!_0x172535['query'][_0xb4c9('0x3a')](_0xb4c9('0x3b'))){_0x220242[_0xb4c9('0x1f')]=qs[_0xb4c9('0x1f')](_0x172535[_0xb4c9('0x33')][_0xb4c9('0x1f')]);_0x220242[_0xb4c9('0x21')]=qs[_0xb4c9('0x21')](_0x172535[_0xb4c9('0x33')][_0xb4c9('0x21')]);}_0x220242[_0xb4c9('0x3c')]=qs[_0xb4c9('0x3d')](_0x172535[_0xb4c9('0x33')][_0xb4c9('0x3d')]);_0x220242[_0xb4c9('0x3e')]=qs[_0xb4c9('0x35')](_[_0xb4c9('0x3f')](_0x172535[_0xb4c9('0x33')],_0x2b2f0e[_0xb4c9('0x35')]),_0x287b2d);if(_0x172535[_0xb4c9('0x33')][_0xb4c9('0x40')]){_0x220242['where']=_[_0xb4c9('0x41')](_0x220242[_0xb4c9('0x3e')],{'$or':_['map'](_0x287b2d,function(_0x3e0b25){if(_0x3e0b25[_0xb4c9('0x42')]!==_0xb4c9('0x43')){var _0x3caa9f={};_0x3caa9f[_0x3e0b25['name']]={'$like':'%'+_0x172535['query'][_0xb4c9('0x40')]+'%'};return _0x3caa9f;}})});}_0x220242=_[_0xb4c9('0x41')]({},_0x220242,_0x172535[_0xb4c9('0x44')]);var _0x1e1834={'where':_0x220242[_0xb4c9('0x3e')]};return db[_0xb4c9('0x2f')][_0xb4c9('0x20')](_0x1e1834)[_0xb4c9('0x26')](function(_0x5100d2){_0x40e363[_0xb4c9('0x20')]=_0x5100d2;if(_0x172535[_0xb4c9('0x33')][_0xb4c9('0x45')]){_0x220242[_0xb4c9('0x46')]=[{'all':!![]}];}return db[_0xb4c9('0x2f')][_0xb4c9('0x47')](_0x220242);})[_0xb4c9('0x26')](function(_0x5ebcb5){_0x40e363[_0xb4c9('0x48')]=_0x5ebcb5;return _0x40e363;})[_0xb4c9('0x26')](respondWithFilteredResult(_0x5f49fb,_0x220242))[_0xb4c9('0x49')](handleError(_0x5f49fb,null));};exports[_0xb4c9('0x4a')]=function(_0x454551,_0x28c84a){var _0xd2fcdb={'raw':!![],'where':{'id':_0x454551[_0xb4c9('0x4b')]['id']}},_0x478c04={};_0x478c04[_0xb4c9('0x32')]=_['keys'](db[_0xb4c9('0x2f')][_0xb4c9('0x30')]);_0x478c04[_0xb4c9('0x33')]=_[_0xb4c9('0x34')](_0x454551[_0xb4c9('0x33')]);_0x478c04[_0xb4c9('0x35')]=_[_0xb4c9('0x36')](_0x478c04[_0xb4c9('0x32')],_0x478c04[_0xb4c9('0x33')]);_0xd2fcdb[_0xb4c9('0x37')]=_['intersection'](_0x478c04[_0xb4c9('0x32')],qs['fields'](_0x454551['query']['fields']));_0xd2fcdb['attributes']=_0xd2fcdb[_0xb4c9('0x37')]['length']?_0xd2fcdb[_0xb4c9('0x37')]:_0x478c04[_0xb4c9('0x32')];if(_0x454551[_0xb4c9('0x33')][_0xb4c9('0x45')]){_0xd2fcdb['include']=[{'all':!![]}];}_0xd2fcdb=_[_0xb4c9('0x41')]({},_0xd2fcdb,_0x454551['options']);return db[_0xb4c9('0x2f')][_0xb4c9('0x4c')](_0xd2fcdb)[_0xb4c9('0x26')](handleEntityNotFound(_0x28c84a,null))['then'](respondWithResult(_0x28c84a,null))['catch'](handleError(_0x28c84a,null));};exports['create']=function(_0xe987bb,_0x2f3863){return db[_0xb4c9('0x2f')][_0xb4c9('0x4d')](_0xe987bb['body'],{})[_0xb4c9('0x26')](respondWithResult(_0x2f3863,0xc9))[_0xb4c9('0x49')](handleError(_0x2f3863,null));};exports['update']=function(_0x3b382c,_0x3262e4){if(_0x3b382c[_0xb4c9('0x4e')]['id']){delete _0x3b382c[_0xb4c9('0x4e')]['id'];}return db['AnalyticTreeReport'][_0xb4c9('0x4c')]({'where':{'id':_0x3b382c['params']['id']}})[_0xb4c9('0x26')](handleEntityNotFound(_0x3262e4,null))[_0xb4c9('0x26')](saveUpdates(_0x3b382c[_0xb4c9('0x4e')],null))[_0xb4c9('0x26')](respondWithResult(_0x3262e4,null))[_0xb4c9('0x49')](handleError(_0x3262e4,null));};exports[_0xb4c9('0x27')]=function(_0x26570e,_0x4a932f){return db['AnalyticTreeReport'][_0xb4c9('0x4c')]({'where':{'id':_0x26570e[_0xb4c9('0x4b')]['id']}})[_0xb4c9('0x26')](handleEntityNotFound(_0x4a932f,null))['then'](removeEntity(_0x4a932f,null))['catch'](handleError(_0x4a932f,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 3a2d7e1..e905b0b 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 _0x4bda=['define','analytics_report_trees','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x505884,_0x1e899d){var _0x35a679=function(_0x565436){while(--_0x565436){_0x505884['push'](_0x505884['shift']());}};_0x35a679(++_0x1e899d);}(_0x4bda,0x13a));var _0xa4bd=function(_0x186099,_0x3d29b3){_0x186099=_0x186099-0x0;var _0x2701cb=_0x4bda[_0x186099];return _0x2701cb;};'use strict';var _=require(_0xa4bd('0x0'));var util=require(_0xa4bd('0x1'));var logger=require(_0xa4bd('0x2'))(_0xa4bd('0x3'));var moment=require('moment');var BPromise=require(_0xa4bd('0x4'));var rp=require(_0xa4bd('0x5'));var fs=require('fs');var path=require(_0xa4bd('0x6'));var rimraf=require(_0xa4bd('0x7'));var config=require(_0xa4bd('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0xa4bd('0x9')]=function(_0x5713f5,_0x4f1475){return _0x5713f5[_0xa4bd('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0xa4bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a97=['exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x1634d8,_0x201ed9){var _0x218a1f=function(_0x1dede4){while(--_0x1dede4){_0x1634d8['push'](_0x1634d8['shift']());}};_0x218a1f(++_0x201ed9);}(_0x4a97,0x163));var _0x74a9=function(_0x33c70e,_0xd8cb0b){_0x33c70e=_0x33c70e-0x0;var _0x5a33e5=_0x4a97[_0x33c70e];return _0x5a33e5;};'use strict';var _=require(_0x74a9('0x0'));var util=require(_0x74a9('0x1'));var logger=require(_0x74a9('0x2'))(_0x74a9('0x3'));var moment=require('moment');var BPromise=require(_0x74a9('0x4'));var rp=require(_0x74a9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x74a9('0x6'));var config=require(_0x74a9('0x7'));var attributes=require(_0x74a9('0x8'));module[_0x74a9('0x9')]=function(_0x5d32da,_0x33954a){return _0x5d32da[_0x74a9('0xa')](_0x74a9('0xb'),attributes,{'tableName':_0x74a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index d3076d3..9b2b70d 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(_0x28f69e,_0x1c92a5){var _0x44a11c=function(_0x224d4b){while(--_0x224d4b){_0x28f69e['push'](_0x28f69e['shift']());}};_0x44a11c(++_0x1c92a5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x33f5d5,_0x4ac89e){var _0x397d8c=function(_0x5ab938){while(--_0x5ab938){_0x33f5d5['push'](_0x33f5d5['shift']());}};_0x397d8c(++_0x4ac89e);}(_0x1261,0x144));var _0x1126=function(_0x361e5d,_0x15e1a4){_0x361e5d=_0x361e5d-0x0;var _0x4c303d=_0x1261[_0x361e5d];return _0x4c303d;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 6b338ae..4ee07a2 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 _0x3aec=['get','isAuthenticated','post','create','put','/:id','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x455680,_0x3891d0){var _0x19d21c=function(_0xa165ee){while(--_0xa165ee){_0x455680['push'](_0x455680['shift']());}};_0x19d21c(++_0x3891d0);}(_0x3aec,0xb2));var _0xc3ae=function(_0x15b380,_0x1a3c5f){_0x15b380=_0x15b380-0x0;var _0x232c5c=_0x3aec[_0x15b380];return _0x232c5c;};'use strict';var multer=require('multer');var util=require(_0xc3ae('0x0'));var path=require('path');var timeout=require(_0xc3ae('0x1'));var express=require(_0xc3ae('0x2'));var router=express[_0xc3ae('0x3')]();var fs_extra=require(_0xc3ae('0x4'));var auth=require(_0xc3ae('0x5'));var interaction=require(_0xc3ae('0x6'));var config=require(_0xc3ae('0x7'));var controller=require(_0xc3ae('0x8'));router[_0xc3ae('0x9')]('/',auth[_0xc3ae('0xa')](),controller['index']);router[_0xc3ae('0x9')]('/:id',auth[_0xc3ae('0xa')](),controller['show']);router[_0xc3ae('0xb')]('/',auth['isAuthenticated'](),controller[_0xc3ae('0xc')]);router[_0xc3ae('0xd')](_0xc3ae('0xe'),auth[_0xc3ae('0xa')](),controller['update']);router['delete'](_0xc3ae('0xe'),auth[_0xc3ae('0xa')](),controller[_0xc3ae('0xf')]);module[_0xc3ae('0x10')]=router; \ No newline at end of file +var _0x31d4=['multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','create','put','update','/:id','destroy','exports'];(function(_0x6204d8,_0x3b0d2c){var _0x3b0910=function(_0x351104){while(--_0x351104){_0x6204d8['push'](_0x6204d8['shift']());}};_0x3b0910(++_0x3b0d2c);}(_0x31d4,0x6c));var _0x431d=function(_0x324f7d,_0x3a0184){_0x324f7d=_0x324f7d-0x0;var _0x158d1e=_0x31d4[_0x324f7d];return _0x158d1e;};'use strict';var multer=require(_0x431d('0x0'));var util=require(_0x431d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x431d('0x2')]();var fs_extra=require(_0x431d('0x3'));var auth=require(_0x431d('0x4'));var interaction=require(_0x431d('0x5'));var config=require(_0x431d('0x6'));var controller=require('./analyticTreeReport.controller');router[_0x431d('0x7')]('/',auth['isAuthenticated'](),controller[_0x431d('0x8')]);router[_0x431d('0x7')]('/:id',auth[_0x431d('0x9')](),controller[_0x431d('0xa')]);router[_0x431d('0xb')]('/',auth['isAuthenticated'](),controller[_0x431d('0xc')]);router[_0x431d('0xd')]('/:id',auth[_0x431d('0x9')](),controller[_0x431d('0xe')]);router['delete'](_0x431d('0xf'),auth[_0x431d('0x9')](),controller[_0x431d('0x10')]);module[_0x431d('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index c507fb3..9855c00 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 _0x7f90=['STRING','sequelize','exports'];(function(_0x3a37b1,_0x2a88b6){var _0x39bf2c=function(_0x316fba){while(--_0x316fba){_0x3a37b1['push'](_0x3a37b1['shift']());}};_0x39bf2c(++_0x2a88b6);}(_0x7f90,0xf4));var _0x07f9=function(_0x4b0211,_0x17f347){_0x4b0211=_0x4b0211-0x0;var _0x1906fc=_0x7f90[_0x4b0211];return _0x1906fc;};'use strict';var Sequelize=require(_0x07f9('0x0'));module[_0x07f9('0x1')]={'name':{'type':Sequelize[_0x07f9('0x2')]},'basename':{'type':Sequelize[_0x07f9('0x2')]},'type':{'type':Sequelize[_0x07f9('0x2')]}}; \ No newline at end of file +var _0xd382=['sequelize','exports','STRING'];(function(_0x2a6d45,_0x3c9321){var _0x295253=function(_0x51d622){while(--_0x51d622){_0x2a6d45['push'](_0x2a6d45['shift']());}};_0x295253(++_0x3c9321);}(_0xd382,0x1b6));var _0x2d38=function(_0x20d781,_0x50bdfe){_0x20d781=_0x20d781-0x0;var _0x270932=_0xd382[_0x20d781];return _0x270932;};'use strict';var Sequelize=require(_0x2d38('0x0'));module[_0x2d38('0x1')]={'name':{'type':Sequelize[_0x2d38('0x2')]},'basename':{'type':Sequelize[_0x2d38('0x2')]},'type':{'type':Sequelize[_0x2d38('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index f68c4c5..8a4b1b3 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 _0x87ea=['findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','rimraf','zip-dir','fast-json-patch','request-promise','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','type','VIRTUAL','options','then','includeAll','findAll','rows','catch','show','include','find','clone','params','get','omit','createdAt','body','updatedAt','file','originalname','basename','filename','mimetype','create'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0x87ea,0xbc));var _0xa87e=function(_0x2cfb48,_0x24b83b){_0x2cfb48=_0x2cfb48-0x0;var _0xc4594f=_0x87ea[_0x2cfb48];return _0xc4594f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa87e('0x0'));var zipdir=require(_0xa87e('0x1'));var jsonpatch=require(_0xa87e('0x2'));var rp=require(_0xa87e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa87e('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xa87e('0x5'));var ejs=require(_0xa87e('0x6'));var fs=require('fs');var fs_extra=require(_0xa87e('0x7'));var _=require(_0xa87e('0x8'));var squel=require(_0xa87e('0x9'));var crypto=require(_0xa87e('0xa'));var jsforce=require(_0xa87e('0xb'));var deskjs=require(_0xa87e('0xc'));var toCsv=require(_0xa87e('0x5'));var querystring=require(_0xa87e('0xd'));var Papa=require(_0xa87e('0xe'));var Redis=require(_0xa87e('0xf'));var authService=require(_0xa87e('0x10'));var qs=require(_0xa87e('0x11'));var as=require(_0xa87e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa87e('0x13'))(_0xa87e('0x14'));var utils=require(_0xa87e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa87e('0x16'));var db=require(_0xa87e('0x17'))['db'];function respondWithStatusCode(_0x2908c3,_0x2ccd99){_0x2ccd99=_0x2ccd99||0xcc;return function(_0xf23dba){if(_0xf23dba){return _0x2908c3[_0xa87e('0x18')](_0x2ccd99);}return _0x2908c3[_0xa87e('0x19')](_0x2ccd99)[_0xa87e('0x1a')]();};}function respondWithResult(_0x1246e3,_0x4a0fa2){_0x4a0fa2=_0x4a0fa2||0xc8;return function(_0xea985a){if(_0xea985a){return _0x1246e3['status'](_0x4a0fa2)[_0xa87e('0x1b')](_0xea985a);}};}function respondWithFilteredResult(_0x1f04d1,_0x428ef2){return function(_0x175b2c){if(_0x175b2c){var _0xf1fb6d=typeof _0x428ef2[_0xa87e('0x1c')]===_0xa87e('0x1d')&&typeof _0x428ef2[_0xa87e('0x1e')]==='undefined';var _0x5ae1cb=_0x175b2c[_0xa87e('0x1f')];var _0x1b8f01=_0xf1fb6d?0x0:_0x428ef2[_0xa87e('0x1c')];var _0x2421d7=_0xf1fb6d?_0x175b2c['count']:_0x428ef2[_0xa87e('0x1c')]+_0x428ef2[_0xa87e('0x1e')];var _0x238b11;if(_0x2421d7>=_0x5ae1cb){_0x2421d7=_0x5ae1cb;_0x238b11=0xc8;}else{_0x238b11=0xce;}_0x1f04d1[_0xa87e('0x19')](_0x238b11);return _0x1f04d1[_0xa87e('0x20')](_0xa87e('0x21'),_0x1b8f01+'-'+_0x2421d7+'/'+_0x5ae1cb)[_0xa87e('0x1b')](_0x175b2c);}return null;};}function patchUpdates(_0x403ade){return function(_0x49a41b){try{jsonpatch[_0xa87e('0x22')](_0x49a41b,_0x403ade,!![]);}catch(_0x3183cf){return BPromise[_0xa87e('0x23')](_0x3183cf);}return _0x49a41b['save']();};}function saveUpdates(_0x470549,_0x2091a5){return function(_0x4f513b){if(_0x4f513b){return _0x4f513b[_0xa87e('0x24')](_0x470549)['then'](function(_0x16e4aa){return _0x16e4aa;});}return null;};}function removeEntity(_0x455439,_0x3555a1){return function(_0x4304da){if(_0x4304da){return _0x4304da[_0xa87e('0x25')]()['then'](function(){_0x455439['status'](0xcc)[_0xa87e('0x1a')]();});}};}function handleEntityNotFound(_0x20c711,_0x3136cd){return function(_0x486a14){if(!_0x486a14){_0x20c711[_0xa87e('0x18')](0x194);}return _0x486a14;};}function handleError(_0x177a9b,_0x3a265b){_0x3a265b=_0x3a265b||0x1f4;return function(_0x3ca9d9){logger[_0xa87e('0x26')](_0x3ca9d9[_0xa87e('0x27')]);if(_0x3ca9d9['name']){delete _0x3ca9d9[_0xa87e('0x28')];}_0x177a9b[_0xa87e('0x19')](_0x3a265b)[_0xa87e('0x29')](_0x3ca9d9);};}exports[_0xa87e('0x2a')]=function(_0x567648,_0x353ba6){var _0x2c1b33={},_0x4a8e3c={},_0x543cbb={'count':0x0,'rows':[]};var _0x40e700=_[_0xa87e('0x2b')](db[_0xa87e('0x2c')][_0xa87e('0x2d')],function(_0x1fbe95){return{'name':_0x1fbe95[_0xa87e('0x2e')],'type':_0x1fbe95['type'][_0xa87e('0x2f')]};});_0x4a8e3c[_0xa87e('0x30')]=_['map'](_0x40e700,'name');_0x4a8e3c[_0xa87e('0x31')]=_[_0xa87e('0x32')](_0x567648[_0xa87e('0x31')]);_0x4a8e3c[_0xa87e('0x33')]=_[_0xa87e('0x34')](_0x4a8e3c[_0xa87e('0x30')],_0x4a8e3c[_0xa87e('0x31')]);_0x2c1b33[_0xa87e('0x35')]=_[_0xa87e('0x34')](_0x4a8e3c[_0xa87e('0x30')],qs[_0xa87e('0x36')](_0x567648[_0xa87e('0x31')][_0xa87e('0x36')]));_0x2c1b33[_0xa87e('0x35')]=_0x2c1b33[_0xa87e('0x35')][_0xa87e('0x37')]?_0x2c1b33['attributes']:_0x4a8e3c['model'];if(!_0x567648['query'][_0xa87e('0x38')]('nolimit')){_0x2c1b33[_0xa87e('0x1e')]=qs[_0xa87e('0x1e')](_0x567648[_0xa87e('0x31')][_0xa87e('0x1e')]);_0x2c1b33['offset']=qs[_0xa87e('0x1c')](_0x567648[_0xa87e('0x31')]['offset']);}_0x2c1b33['order']=qs[_0xa87e('0x39')](_0x567648[_0xa87e('0x31')][_0xa87e('0x39')]);_0x2c1b33['where']=qs['filters'](_['pick'](_0x567648[_0xa87e('0x31')],_0x4a8e3c[_0xa87e('0x33')]),_0x40e700);if(_0x567648[_0xa87e('0x31')][_0xa87e('0x3a')]){_0x2c1b33[_0xa87e('0x3b')]=_[_0xa87e('0x3c')](_0x2c1b33[_0xa87e('0x3b')],{'$or':_[_0xa87e('0x2b')](_0x40e700,function(_0x4333c0){if(_0x4333c0[_0xa87e('0x3d')]!==_0xa87e('0x3e')){var _0xa53760={};_0xa53760[_0x4333c0['name']]={'$like':'%'+_0x567648['query'][_0xa87e('0x3a')]+'%'};return _0xa53760;}})});}_0x2c1b33=_['merge']({},_0x2c1b33,_0x567648[_0xa87e('0x3f')]);var _0x29f834={'where':_0x2c1b33[_0xa87e('0x3b')]};return db[_0xa87e('0x2c')][_0xa87e('0x1f')](_0x29f834)[_0xa87e('0x40')](function(_0x824392){_0x543cbb[_0xa87e('0x1f')]=_0x824392;if(_0x567648[_0xa87e('0x31')][_0xa87e('0x41')]){_0x2c1b33['include']=[{'all':!![]}];}return db[_0xa87e('0x2c')][_0xa87e('0x42')](_0x2c1b33);})['then'](function(_0x467d76){_0x543cbb[_0xa87e('0x43')]=_0x467d76;return _0x543cbb;})[_0xa87e('0x40')](respondWithFilteredResult(_0x353ba6,_0x2c1b33))[_0xa87e('0x44')](handleError(_0x353ba6,null));};exports[_0xa87e('0x45')]=function(_0x30204f,_0x367163){var _0x4a523c={'raw':!![],'where':{'id':_0x30204f['params']['id']}},_0x1a9639={};_0x1a9639['model']=_[_0xa87e('0x32')](db[_0xa87e('0x2c')][_0xa87e('0x2d')]);_0x1a9639['query']=_[_0xa87e('0x32')](_0x30204f['query']);_0x1a9639['filters']=_[_0xa87e('0x34')](_0x1a9639[_0xa87e('0x30')],_0x1a9639[_0xa87e('0x31')]);_0x4a523c[_0xa87e('0x35')]=_['intersection'](_0x1a9639[_0xa87e('0x30')],qs[_0xa87e('0x36')](_0x30204f[_0xa87e('0x31')][_0xa87e('0x36')]));_0x4a523c[_0xa87e('0x35')]=_0x4a523c[_0xa87e('0x35')][_0xa87e('0x37')]?_0x4a523c[_0xa87e('0x35')]:_0x1a9639[_0xa87e('0x30')];if(_0x30204f[_0xa87e('0x31')][_0xa87e('0x41')]){_0x4a523c[_0xa87e('0x46')]=[{'all':!![]}];}_0x4a523c=_['merge']({},_0x4a523c,_0x30204f['options']);return db[_0xa87e('0x2c')][_0xa87e('0x47')](_0x4a523c)[_0xa87e('0x40')](handleEntityNotFound(_0x367163,null))[_0xa87e('0x40')](respondWithResult(_0x367163,null))[_0xa87e('0x44')](handleError(_0x367163,null));};exports[_0xa87e('0x48')]=function(_0x3db436,_0x49883d){var _0x2d0d13={'where':{'id':_0x3db436[_0xa87e('0x49')]['id']}},_0x3b1b05={};_0x3b1b05[_0xa87e('0x30')]=_[_0xa87e('0x32')](db['Attachment'][_0xa87e('0x2d')]);_0x2d0d13[_0xa87e('0x35')]=_[_0xa87e('0x34')](_0x3b1b05[_0xa87e('0x30')],qs[_0xa87e('0x36')](_0x3db436['query'][_0xa87e('0x36')]));_0x2d0d13[_0xa87e('0x35')]=_0x2d0d13['attributes']['length']?_0x2d0d13[_0xa87e('0x35')]:_0x3b1b05[_0xa87e('0x30')];if(_0x3db436[_0xa87e('0x31')][_0xa87e('0x41')]){_0x2d0d13[_0xa87e('0x46')]=[{'all':!![]}];}_0x2d0d13=_[_0xa87e('0x3c')]({},_0x2d0d13,_0x3db436[_0xa87e('0x3f')]);return db[_0xa87e('0x2c')][_0xa87e('0x47')](_0x2d0d13)[_0xa87e('0x40')](handleEntityNotFound(_0x49883d,null))[_0xa87e('0x40')](function(_0x234bfe){if(_0x234bfe){var _0x3c8f44=_0x234bfe[_0xa87e('0x4a')]({'plain':!![]});_0x3c8f44=qs[_0xa87e('0x4b')](_0x3c8f44,['id',_0xa87e('0x4c'),'updatedAt']);_0x3db436[_0xa87e('0x4d')]=_[_0xa87e('0x4b')](_0x3db436[_0xa87e('0x4d')],['id',_0xa87e('0x4c'),_0xa87e('0x4e')]);return db[_0xa87e('0x2c')]['create'](_['merge'](_0x3c8f44,_0x3db436[_0xa87e('0x4d')]),{'include':_0x3db436['query'][_0xa87e('0x41')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x49883d,0xc9))['catch'](handleError(_0x49883d,null));};exports['update']=function(_0x502a73,_0x4e1b85){if(_0x502a73[_0xa87e('0x4d')]['id']){delete _0x502a73['body']['id'];}return db[_0xa87e('0x2c')][_0xa87e('0x47')]({'where':{'id':_0x502a73[_0xa87e('0x49')]['id']}})[_0xa87e('0x40')](handleEntityNotFound(_0x4e1b85,null))[_0xa87e('0x40')](saveUpdates(_0x502a73[_0xa87e('0x4d')],null))[_0xa87e('0x40')](respondWithResult(_0x4e1b85,null))['catch'](handleError(_0x4e1b85,null));};exports[_0xa87e('0x25')]=function(_0x41e9ba,_0x3d39df){return db[_0xa87e('0x2c')][_0xa87e('0x47')]({'where':{'id':_0x41e9ba[_0xa87e('0x49')]['id']}})[_0xa87e('0x40')](handleEntityNotFound(_0x3d39df,null))[_0xa87e('0x40')](removeEntity(_0x3d39df,null))[_0xa87e('0x44')](handleError(_0x3d39df,null));};exports['create']=function(_0x5ebffd,_0x5b1274,_0x1c5b8e){_0x5ebffd[_0xa87e('0x4d')][_0xa87e('0x28')]=_0x5ebffd[_0xa87e('0x4f')][_0xa87e('0x50')];_0x5ebffd[_0xa87e('0x4d')][_0xa87e('0x51')]=_0x5ebffd['file'][_0xa87e('0x52')];_0x5ebffd[_0xa87e('0x4d')][_0xa87e('0x3d')]=_0x5ebffd['file'][_0xa87e('0x53')];return db[_0xa87e('0x2c')][_0xa87e('0x54')](_0x5ebffd[_0xa87e('0x4d')])['then'](respondWithResult(_0x5b1274,0xc9))[_0xa87e('0x44')](handleError(_0x5b1274,null));};exports['download']=function(_0x4124f5,_0x1f9722,_0x3af1f0){return db[_0xa87e('0x2c')][_0xa87e('0x55')]({'where':{'id':_0x4124f5[_0xa87e('0x49')]['id']},'raw':!![]})[_0xa87e('0x40')](handleEntityNotFound(_0x1f9722,null))[_0xa87e('0x40')](function(_0x29eee0){if(_0x29eee0){var _0x2a0278=_0x29eee0[_0xa87e('0x56')]!==null;var _0x118623=path[_0xa87e('0x57')](config[_0xa87e('0x58')],_0xa87e('0x59'));if(_0x2a0278){_0x118623=path[_0xa87e('0x57')](_0x118623,_0xa87e('0x5a'));}var _0x4ef5b1=path['join'](_0x118623,_0x29eee0['basename']);return _0x1f9722['download'](_0x4ef5b1);}})[_0xa87e('0x44')](handleError(_0x1f9722,null));}; \ No newline at end of file +var _0x69bf=['update','then','destroy','error','stack','name','send','index','Attachment','fieldName','type','key','model','map','keys','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','include','catch','show','params','rawAttributes','intersection','find','get','omit','createdAt','updatedAt','create','body','file','originalname','basename','filename','mimetype','download','findOne','server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0x69bf,0x136));var _0xf69b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x69bf[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xf69b('0x0'));var rimraf=require(_0xf69b('0x1'));var zipdir=require(_0xf69b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf69b('0x3'));var moment=require(_0xf69b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf69b('0x5'));var util=require(_0xf69b('0x6'));var path=require('path');var sox=require(_0xf69b('0x7'));var csv=require(_0xf69b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf69b('0x9'));var _=require('lodash');var squel=require(_0xf69b('0xa'));var crypto=require(_0xf69b('0xb'));var jsforce=require(_0xf69b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf69b('0x8'));var querystring=require(_0xf69b('0xd'));var Papa=require(_0xf69b('0xe'));var Redis=require(_0xf69b('0xf'));var authService=require(_0xf69b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf69b('0x11'));var hardwareService=require(_0xf69b('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xf69b('0x13'));var config=require(_0xf69b('0x14'));var licenseUtil=require(_0xf69b('0x15'));var db=require(_0xf69b('0x16'))['db'];function respondWithStatusCode(_0x5352a3,_0x525965){_0x525965=_0x525965||0xcc;return function(_0x1812e1){if(_0x1812e1){return _0x5352a3[_0xf69b('0x17')](_0x525965);}return _0x5352a3[_0xf69b('0x18')](_0x525965)[_0xf69b('0x19')]();};}function respondWithResult(_0x6586ae,_0x323ce2){_0x323ce2=_0x323ce2||0xc8;return function(_0x2a9144){if(_0x2a9144){return _0x6586ae[_0xf69b('0x18')](_0x323ce2)[_0xf69b('0x1a')](_0x2a9144);}};}function respondWithFilteredResult(_0x18c73e,_0x3721e4){return function(_0x378d8b){if(_0x378d8b){var _0x10c110=typeof _0x3721e4['offset']===_0xf69b('0x1b')&&typeof _0x3721e4[_0xf69b('0x1c')]==='undefined';var _0x1c1229=_0x378d8b[_0xf69b('0x1d')];var _0x817052=_0x10c110?0x0:_0x3721e4[_0xf69b('0x1e')];var _0x1aab1b=_0x10c110?_0x378d8b[_0xf69b('0x1d')]:_0x3721e4[_0xf69b('0x1e')]+_0x3721e4[_0xf69b('0x1c')];var _0x50df12;if(_0x1aab1b>=_0x1c1229){_0x1aab1b=_0x1c1229;_0x50df12=0xc8;}else{_0x50df12=0xce;}_0x18c73e[_0xf69b('0x18')](_0x50df12);return _0x18c73e[_0xf69b('0x1f')](_0xf69b('0x20'),_0x817052+'-'+_0x1aab1b+'/'+_0x1c1229)[_0xf69b('0x1a')](_0x378d8b);}return null;};}function patchUpdates(_0x5e6ef4){return function(_0x8425e0){try{jsonpatch['apply'](_0x8425e0,_0x5e6ef4,!![]);}catch(_0x12eb59){return BPromise[_0xf69b('0x21')](_0x12eb59);}return _0x8425e0['save']();};}function saveUpdates(_0x1bd827,_0x551ad7){return function(_0x49400c){if(_0x49400c){return _0x49400c[_0xf69b('0x22')](_0x1bd827)[_0xf69b('0x23')](function(_0x238e80){return _0x238e80;});}return null;};}function removeEntity(_0x1dea28,_0x125fc7){return function(_0xb2f4e7){if(_0xb2f4e7){return _0xb2f4e7[_0xf69b('0x24')]()[_0xf69b('0x23')](function(){_0x1dea28[_0xf69b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x185458,_0x37a7cc){return function(_0x2ba07a){if(!_0x2ba07a){_0x185458[_0xf69b('0x17')](0x194);}return _0x2ba07a;};}function handleError(_0x59628a,_0x294483){_0x294483=_0x294483||0x1f4;return function(_0x4a08d1){logger[_0xf69b('0x25')](_0x4a08d1[_0xf69b('0x26')]);if(_0x4a08d1[_0xf69b('0x27')]){delete _0x4a08d1['name'];}_0x59628a[_0xf69b('0x18')](_0x294483)[_0xf69b('0x28')](_0x4a08d1);};}exports[_0xf69b('0x29')]=function(_0x1f0229,_0x4d137a){var _0x34a4d3={},_0x4fb793={},_0x15340f={'count':0x0,'rows':[]};var _0x226239=_['map'](db[_0xf69b('0x2a')]['rawAttributes'],function(_0x9f5b8d){return{'name':_0x9f5b8d[_0xf69b('0x2b')],'type':_0x9f5b8d[_0xf69b('0x2c')][_0xf69b('0x2d')]};});_0x4fb793[_0xf69b('0x2e')]=_[_0xf69b('0x2f')](_0x226239,_0xf69b('0x27'));_0x4fb793['query']=_[_0xf69b('0x30')](_0x1f0229[_0xf69b('0x31')]);_0x4fb793['filters']=_['intersection'](_0x4fb793[_0xf69b('0x2e')],_0x4fb793[_0xf69b('0x31')]);_0x34a4d3[_0xf69b('0x32')]=_['intersection'](_0x4fb793['model'],qs[_0xf69b('0x33')](_0x1f0229[_0xf69b('0x31')][_0xf69b('0x33')]));_0x34a4d3[_0xf69b('0x32')]=_0x34a4d3[_0xf69b('0x32')][_0xf69b('0x34')]?_0x34a4d3[_0xf69b('0x32')]:_0x4fb793[_0xf69b('0x2e')];if(!_0x1f0229['query'][_0xf69b('0x35')](_0xf69b('0x36'))){_0x34a4d3[_0xf69b('0x1c')]=qs['limit'](_0x1f0229[_0xf69b('0x31')][_0xf69b('0x1c')]);_0x34a4d3[_0xf69b('0x1e')]=qs[_0xf69b('0x1e')](_0x1f0229[_0xf69b('0x31')][_0xf69b('0x1e')]);}_0x34a4d3['order']=qs[_0xf69b('0x37')](_0x1f0229[_0xf69b('0x31')][_0xf69b('0x37')]);_0x34a4d3['where']=qs[_0xf69b('0x38')](_['pick'](_0x1f0229[_0xf69b('0x31')],_0x4fb793[_0xf69b('0x38')]),_0x226239);if(_0x1f0229[_0xf69b('0x31')][_0xf69b('0x39')]){_0x34a4d3[_0xf69b('0x3a')]=_['merge'](_0x34a4d3[_0xf69b('0x3a')],{'$or':_[_0xf69b('0x2f')](_0x226239,function(_0x442640){if(_0x442640[_0xf69b('0x2c')]!==_0xf69b('0x3b')){var _0x1a9452={};_0x1a9452[_0x442640['name']]={'$like':'%'+_0x1f0229[_0xf69b('0x31')][_0xf69b('0x39')]+'%'};return _0x1a9452;}})});}_0x34a4d3=_[_0xf69b('0x3c')]({},_0x34a4d3,_0x1f0229[_0xf69b('0x3d')]);var _0x3dbb77={'where':_0x34a4d3[_0xf69b('0x3a')]};return db[_0xf69b('0x2a')][_0xf69b('0x1d')](_0x3dbb77)[_0xf69b('0x23')](function(_0x24fc8e){_0x15340f[_0xf69b('0x1d')]=_0x24fc8e;if(_0x1f0229[_0xf69b('0x31')][_0xf69b('0x3e')]){_0x34a4d3[_0xf69b('0x3f')]=[{'all':!![]}];}return db[_0xf69b('0x2a')]['findAll'](_0x34a4d3);})['then'](function(_0x52c67f){_0x15340f['rows']=_0x52c67f;return _0x15340f;})[_0xf69b('0x23')](respondWithFilteredResult(_0x4d137a,_0x34a4d3))[_0xf69b('0x40')](handleError(_0x4d137a,null));};exports[_0xf69b('0x41')]=function(_0x4cdaf7,_0x439838){var _0x4c69ea={'raw':!![],'where':{'id':_0x4cdaf7[_0xf69b('0x42')]['id']}},_0x287e46={};_0x287e46[_0xf69b('0x2e')]=_[_0xf69b('0x30')](db[_0xf69b('0x2a')][_0xf69b('0x43')]);_0x287e46[_0xf69b('0x31')]=_['keys'](_0x4cdaf7[_0xf69b('0x31')]);_0x287e46[_0xf69b('0x38')]=_[_0xf69b('0x44')](_0x287e46[_0xf69b('0x2e')],_0x287e46[_0xf69b('0x31')]);_0x4c69ea[_0xf69b('0x32')]=_[_0xf69b('0x44')](_0x287e46[_0xf69b('0x2e')],qs[_0xf69b('0x33')](_0x4cdaf7[_0xf69b('0x31')]['fields']));_0x4c69ea['attributes']=_0x4c69ea[_0xf69b('0x32')][_0xf69b('0x34')]?_0x4c69ea['attributes']:_0x287e46['model'];if(_0x4cdaf7[_0xf69b('0x31')]['includeAll']){_0x4c69ea['include']=[{'all':!![]}];}_0x4c69ea=_['merge']({},_0x4c69ea,_0x4cdaf7[_0xf69b('0x3d')]);return db[_0xf69b('0x2a')]['find'](_0x4c69ea)[_0xf69b('0x23')](handleEntityNotFound(_0x439838,null))[_0xf69b('0x23')](respondWithResult(_0x439838,null))[_0xf69b('0x40')](handleError(_0x439838,null));};exports['clone']=function(_0x4b14f8,_0x593eb1){var _0x24e601={'where':{'id':_0x4b14f8[_0xf69b('0x42')]['id']}},_0x332790={};_0x332790[_0xf69b('0x2e')]=_['keys'](db['Attachment'][_0xf69b('0x43')]);_0x24e601[_0xf69b('0x32')]=_[_0xf69b('0x44')](_0x332790['model'],qs['fields'](_0x4b14f8['query'][_0xf69b('0x33')]));_0x24e601['attributes']=_0x24e601[_0xf69b('0x32')][_0xf69b('0x34')]?_0x24e601[_0xf69b('0x32')]:_0x332790['model'];if(_0x4b14f8[_0xf69b('0x31')]['includeAll']){_0x24e601[_0xf69b('0x3f')]=[{'all':!![]}];}_0x24e601=_[_0xf69b('0x3c')]({},_0x24e601,_0x4b14f8[_0xf69b('0x3d')]);return db[_0xf69b('0x2a')][_0xf69b('0x45')](_0x24e601)[_0xf69b('0x23')](handleEntityNotFound(_0x593eb1,null))['then'](function(_0x1e5514){if(_0x1e5514){var _0x31f952=_0x1e5514[_0xf69b('0x46')]({'plain':!![]});_0x31f952=qs[_0xf69b('0x47')](_0x31f952,['id',_0xf69b('0x48'),_0xf69b('0x49')]);_0x4b14f8['body']=_['omit'](_0x4b14f8['body'],['id',_0xf69b('0x48'),_0xf69b('0x49')]);return db[_0xf69b('0x2a')][_0xf69b('0x4a')](_['merge'](_0x31f952,_0x4b14f8[_0xf69b('0x4b')]),{'include':_0x4b14f8[_0xf69b('0x31')][_0xf69b('0x3e')]?[{'all':!![]}]:undefined});}})[_0xf69b('0x23')](respondWithResult(_0x593eb1,0xc9))['catch'](handleError(_0x593eb1,null));};exports[_0xf69b('0x22')]=function(_0x403f85,_0x4dcc9c){if(_0x403f85[_0xf69b('0x4b')]['id']){delete _0x403f85['body']['id'];}return db[_0xf69b('0x2a')][_0xf69b('0x45')]({'where':{'id':_0x403f85[_0xf69b('0x42')]['id']}})[_0xf69b('0x23')](handleEntityNotFound(_0x4dcc9c,null))[_0xf69b('0x23')](saveUpdates(_0x403f85['body'],null))[_0xf69b('0x23')](respondWithResult(_0x4dcc9c,null))['catch'](handleError(_0x4dcc9c,null));};exports[_0xf69b('0x24')]=function(_0x28a76e,_0x21a97f){return db[_0xf69b('0x2a')][_0xf69b('0x45')]({'where':{'id':_0x28a76e['params']['id']}})[_0xf69b('0x23')](handleEntityNotFound(_0x21a97f,null))[_0xf69b('0x23')](removeEntity(_0x21a97f,null))[_0xf69b('0x40')](handleError(_0x21a97f,null));};exports['create']=function(_0x431d16,_0x37211f,_0x4a781c){_0x431d16[_0xf69b('0x4b')][_0xf69b('0x27')]=_0x431d16[_0xf69b('0x4c')][_0xf69b('0x4d')];_0x431d16[_0xf69b('0x4b')][_0xf69b('0x4e')]=_0x431d16['file'][_0xf69b('0x4f')];_0x431d16['body'][_0xf69b('0x2c')]=_0x431d16[_0xf69b('0x4c')][_0xf69b('0x50')];return db['Attachment'][_0xf69b('0x4a')](_0x431d16[_0xf69b('0x4b')])[_0xf69b('0x23')](respondWithResult(_0x37211f,0xc9))[_0xf69b('0x40')](handleError(_0x37211f,null));};exports[_0xf69b('0x51')]=function(_0x1b0af4,_0xca2b9e,_0x20c01f){return db['Attachment'][_0xf69b('0x52')]({'where':{'id':_0x1b0af4[_0xf69b('0x42')]['id']},'raw':!![]})[_0xf69b('0x23')](handleEntityNotFound(_0xca2b9e,null))[_0xf69b('0x23')](function(_0x145c59){if(_0x145c59){var _0x3770d5=_0x145c59['ChatOfflineMessageId']!==null;var _0x4dead5=path['join'](config['root'],_0xf69b('0x53'));if(_0x3770d5){_0x4dead5=path[_0xf69b('0x54')](_0x4dead5,_0xf69b('0x55'));}var _0x851adb=path['join'](_0x4dead5,_0x145c59[_0xf69b('0x4e')]);return _0xca2b9e[_0xf69b('0x51')](_0x851adb);}})[_0xf69b('0x40')](handleError(_0xca2b9e,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index ccab836..7a005b1 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 _0x3fb5=['Attachment','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x4f4b8a,_0x58b2b3){var _0x31a9f0=function(_0x42e092){while(--_0x42e092){_0x4f4b8a['push'](_0x4f4b8a['shift']());}};_0x31a9f0(++_0x58b2b3);}(_0x3fb5,0x187));var _0x53fb=function(_0x5cbd35,_0x29b204){_0x5cbd35=_0x5cbd35-0x0;var _0x30c074=_0x3fb5[_0x5cbd35];return _0x30c074;};'use strict';var _=require('lodash');var util=require(_0x53fb('0x0'));var logger=require(_0x53fb('0x1'))(_0x53fb('0x2'));var moment=require(_0x53fb('0x3'));var BPromise=require(_0x53fb('0x4'));var rp=require(_0x53fb('0x5'));var fs=require('fs');var path=require(_0x53fb('0x6'));var rimraf=require(_0x53fb('0x7'));var config=require(_0x53fb('0x8'));var attributes=require(_0x53fb('0x9'));module[_0x53fb('0xa')]=function(_0x4cdae7,_0x57d3ed){return _0x4cdae7[_0x53fb('0xb')](_0x53fb('0xc'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4ef=['define','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports'];(function(_0x27d94f,_0x18ae26){var _0x3a0f7b=function(_0x42a4e9){while(--_0x42a4e9){_0x27d94f['push'](_0x27d94f['shift']());}};_0x3a0f7b(++_0x18ae26);}(_0xc4ef,0x144));var _0xfc4e=function(_0x3c487b,_0x44c5e2){_0x3c487b=_0x3c487b-0x0;var _0x1d65f6=_0xc4ef[_0x3c487b];return _0x1d65f6;};'use strict';var _=require(_0xfc4e('0x0'));var util=require(_0xfc4e('0x1'));var logger=require(_0xfc4e('0x2'))(_0xfc4e('0x3'));var moment=require(_0xfc4e('0x4'));var BPromise=require(_0xfc4e('0x5'));var rp=require(_0xfc4e('0x6'));var fs=require('fs');var path=require(_0xfc4e('0x7'));var rimraf=require(_0xfc4e('0x8'));var config=require(_0xfc4e('0x9'));var attributes=require(_0xfc4e('0xa'));module[_0xfc4e('0xb')]=function(_0x3f2910,_0x496a05){return _0x3f2910[_0xfc4e('0xc')]('Attachment',attributes,{'tableName':_0xfc4e('0xd'),'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 43788e1..2489488 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 _0x1e69=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','CreateAttachment','Attachment','create','body','options','raw','then','catch','util','moment'];(function(_0xdaa7ec,_0x24b032){var _0x2810a6=function(_0x9e4747){while(--_0x9e4747){_0xdaa7ec['push'](_0xdaa7ec['shift']());}};_0x2810a6(++_0x24b032);}(_0x1e69,0x85));var _0x91e6=function(_0x33f750,_0x3a0638){_0x33f750=_0x33f750-0x0;var _0xd2186a=_0x1e69[_0x33f750];return _0xd2186a;};'use strict';var _=require('lodash');var util=require(_0x91e6('0x0'));var moment=require(_0x91e6('0x1'));var BPromise=require(_0x91e6('0x2'));var rs=require(_0x91e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x91e6('0x4'));var logger=require(_0x91e6('0x5'))(_0x91e6('0x6'));var config=require(_0x91e6('0x7'));var jayson=require(_0x91e6('0x8'));var client=jayson[_0x91e6('0x9')][_0x91e6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2733bf,_0x1347c3,_0x375184){return new BPromise(function(_0x266fe6,_0x46edd7){return client[_0x91e6('0xb')](_0x2733bf,_0x375184)['then'](function(_0x57682b){logger[_0x91e6('0xc')](_0x91e6('0xd'),_0x1347c3,_0x91e6('0xe'));logger[_0x91e6('0xf')]('Attachment,\x20%s,\x20%s,\x20%s',_0x1347c3,_0x91e6('0xe'),JSON[_0x91e6('0x10')](_0x57682b));if(_0x57682b[_0x91e6('0x11')]){if(_0x57682b[_0x91e6('0x11')]['code']===0x1f4){logger[_0x91e6('0x11')](_0x91e6('0xd'),_0x1347c3,_0x57682b[_0x91e6('0x11')][_0x91e6('0x12')]);return _0x46edd7(_0x57682b[_0x91e6('0x11')][_0x91e6('0x12')]);}logger[_0x91e6('0x11')]('Attachment,\x20%s,\x20%s',_0x1347c3,_0x57682b[_0x91e6('0x11')][_0x91e6('0x12')]);return _0x266fe6(_0x57682b[_0x91e6('0x11')][_0x91e6('0x12')]);}else{logger['info'](_0x91e6('0xd'),_0x1347c3,_0x91e6('0xe'));_0x266fe6(_0x57682b['result'][_0x91e6('0x12')]);}})['catch'](function(_0x57d30d){logger['error']('Attachment,\x20%s,\x20%s',_0x1347c3,_0x57d30d);_0x46edd7(_0x57d30d);});});}exports[_0x91e6('0x13')]=function(_0xdc9327){var _0x4b53b0=this;return new Promise(function(_0x5bda45,_0x368329){return db[_0x91e6('0x14')][_0x91e6('0x15')](_0xdc9327[_0x91e6('0x16')],{'raw':_0xdc9327[_0x91e6('0x17')]?_0xdc9327[_0x91e6('0x17')][_0x91e6('0x18')]===undefined?!![]:![]:!![]})[_0x91e6('0x19')](function(_0x604e03){logger[_0x91e6('0xc')]('CreateAttachment',_0xdc9327);logger[_0x91e6('0xf')](_0x91e6('0x13'),_0xdc9327,JSON[_0x91e6('0x10')](_0x604e03));_0x5bda45(_0x604e03);})[_0x91e6('0x1a')](function(_0x29172b){logger[_0x91e6('0x11')]('CreateAttachment',_0x29172b['message'],_0xdc9327);_0x368329(_0x4b53b0[_0x91e6('0x11')](0x1f4,_0x29172b[_0x91e6('0x12')]));});});}; \ No newline at end of file +var _0x8664=['options','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','create','body'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0x8664,0x11a));var _0x4866=function(_0xd1179e,_0x5c65de){_0xd1179e=_0xd1179e-0x0;var _0x1c7c8e=_0x8664[_0xd1179e];return _0x1c7c8e;};'use strict';var _=require(_0x4866('0x0'));var util=require(_0x4866('0x1'));var moment=require(_0x4866('0x2'));var BPromise=require(_0x4866('0x3'));var rs=require(_0x4866('0x4'));var fs=require('fs');var Redis=require(_0x4866('0x5'));var db=require(_0x4866('0x6'))['db'];var utils=require(_0x4866('0x7'));var logger=require(_0x4866('0x8'))('rpc');var config=require(_0x4866('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4866('0xa')][_0x4866('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x439f55,_0x10f7c1,_0x2b4bb0){return new BPromise(function(_0x142f18,_0x4e07e3){return client[_0x4866('0xc')](_0x439f55,_0x2b4bb0)[_0x4866('0xd')](function(_0x10a369){logger[_0x4866('0xe')](_0x4866('0xf'),_0x10f7c1,'request\x20sent');logger[_0x4866('0x10')](_0x4866('0x11'),_0x10f7c1,'request\x20sent',JSON[_0x4866('0x12')](_0x10a369));if(_0x10a369[_0x4866('0x13')]){if(_0x10a369['error']['code']===0x1f4){logger['error'](_0x4866('0xf'),_0x10f7c1,_0x10a369[_0x4866('0x13')][_0x4866('0x14')]);return _0x4e07e3(_0x10a369[_0x4866('0x13')][_0x4866('0x14')]);}logger[_0x4866('0x13')]('Attachment,\x20%s,\x20%s',_0x10f7c1,_0x10a369[_0x4866('0x13')][_0x4866('0x14')]);return _0x142f18(_0x10a369['error'][_0x4866('0x14')]);}else{logger[_0x4866('0xe')](_0x4866('0xf'),_0x10f7c1,_0x4866('0x15'));_0x142f18(_0x10a369[_0x4866('0x16')][_0x4866('0x14')]);}})[_0x4866('0x17')](function(_0x653916){logger[_0x4866('0x13')]('Attachment,\x20%s,\x20%s',_0x10f7c1,_0x653916);_0x4e07e3(_0x653916);});});}exports['CreateAttachment']=function(_0x423490){var _0x137ddf=this;return new Promise(function(_0x176c99,_0x51038a){return db['Attachment'][_0x4866('0x18')](_0x423490[_0x4866('0x19')],{'raw':_0x423490['options']?_0x423490[_0x4866('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x4866('0xd')](function(_0x579621){logger[_0x4866('0xe')](_0x4866('0x1b'),_0x423490);logger[_0x4866('0x10')](_0x4866('0x1b'),_0x423490,JSON[_0x4866('0x12')](_0x579621));_0x176c99(_0x579621);})['catch'](function(_0x5d1401){logger[_0x4866('0x13')](_0x4866('0x1b'),_0x5d1401[_0x4866('0x14')],_0x423490);_0x51038a(_0x137ddf['error'](0x1f4,_0x5d1401[_0x4866('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 9114d8a..e9e05a6 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0x4fe4f4,_0x277fab){_0x4fe4f4=_0x4fe4f4-0x0;var _0x2f26c2=_0xdb28[_0x4fe4f4];return _0x2f26c2;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file +var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x420242,_0x26bdde){var _0x26ab29=function(_0x3266f8){while(--_0x3266f8){_0x420242['push'](_0x420242['shift']());}};_0x26ab29(++_0x26bdde);}(_0xadb5,0xad));var _0x5adb=function(_0x2e0cb8,_0x4fb008){_0x2e0cb8=_0x2e0cb8-0x0;var _0x5bae14=_0xadb5[_0x2e0cb8];return _0x5bae14;};'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('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 4a1b020..2b4d6ee 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 _0x3194=['map','emails','value','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','login','authenticate','profile','email','callback','google','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find'];(function(_0x288c17,_0x2961fd){var _0x445a6e=function(_0x208cd1){while(--_0x208cd1){_0x288c17['push'](_0x288c17['shift']());}};_0x445a6e(++_0x2961fd);}(_0x3194,0xc4));var _0x4319=function(_0x3b75ab,_0x5dd686){_0x3b75ab=_0x3b75ab-0x0;var _0xd3eae2=_0x3194[_0x3b75ab];return _0xd3eae2;};'use strict';var _=require(_0x4319('0x0'));var passport=require(_0x4319('0x1'));var GoogleStrategy=require(_0x4319('0x2'))[_0x4319('0x3')];var moment=require('moment');var db=require(_0x4319('0x4'))['db'];var config=require(_0x4319('0x5'));var signToken=require(_0x4319('0x6'))['signToken'];var utils=require(_0x4319('0x7'));exports[_0x4319('0x8')]=passport[_0x4319('0x9')]('google',{'failureRedirect':'/login','scope':[_0x4319('0xa'),_0x4319('0xb')],'session':![]});exports[_0x4319('0xc')]=passport[_0x4319('0x9')](_0x4319('0xd'),{'failureRedirect':'/login','session':![]});passport[_0x4319('0xe')](new GoogleStrategy({'clientID':config[_0x4319('0xd')]?config['google'][_0x4319('0xf')]:'id','clientSecret':config[_0x4319('0xd')]?config['google'][_0x4319('0x10')]:_0x4319('0x11'),'callbackURL':config['google']?config[_0x4319('0xd')][_0x4319('0x12')]:''},function(_0x5191a5,_0x39c6c5,_0x2ac612,_0x4ed91e){var _0x468052,_0x42bffe;return db[_0x4319('0x13')][_0x4319('0x14')]({'where':{'id':0x1},'attributes':[_0x4319('0x15'),_0x4319('0x16')],'raw':!![]})[_0x4319('0x17')](function(_0x37e171){_0x468052=_0x37e171;return db[_0x4319('0x18')][_0x4319('0x19')]({'where':{'email':_[_0x4319('0x1a')](_0x2ac612[_0x4319('0x1b')],_0x4319('0x1c')),'role':{'$or':[_0x4319('0x1d'),_0x4319('0x1e'),'agent']}}});})[_0x4319('0x17')](function(_0x109688){_0x42bffe=_0x109688;if(_0x42bffe){if(_0x42bffe['disabled']){return _0x4ed91e(_0x4319('0x1f'));}else if(_0x468052[_0x4319('0x16')]>0x0){if(_0x42bffe[_0x4319('0x20')]){if(moment(_0x42bffe['blockedAt'])[_0x4319('0x21')](_0x468052[_0x4319('0x16')],'minutes')>moment()){return _0x4ed91e(_0x4319('0x1f'));}else{return utils[_0x4319('0x22')](_0x42bffe,0x0,![],null)[_0x4319('0x17')](function(){return utils[_0x4319('0x23')](_0x42bffe);})['then'](function(){return _0x4ed91e(null,_0x42bffe);});}}else{return utils['getLicense'](_0x42bffe)[_0x4319('0x17')](function(){return _0x4ed91e(null,_0x42bffe);});}}else{return utils['getLicense'](_0x42bffe)[_0x4319('0x17')](function(){return _0x4ed91e(null,_0x42bffe);});}}return _0x4ed91e(_0x4319('0x1f'));})[_0x4319('0x24')](function(_0x43e86){_0x4ed91e(_0x43e86);});})); \ No newline at end of file +var _0xf5e9=['clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../config/environment','../../components/auth/service','signToken','authenticate','google','/login','profile','email','callback','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','then','find','map','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','add','minutes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5e9,0x17f));var _0x9f5e=function(_0x5a7da7,_0x4f132a){_0x5a7da7=_0x5a7da7-0x0;var _0x14459e=_0xf5e9[_0x5a7da7];return _0x14459e;};'use strict';var _=require(_0x9f5e('0x0'));var passport=require(_0x9f5e('0x1'));var GoogleStrategy=require(_0x9f5e('0x2'))[_0x9f5e('0x3')];var moment=require(_0x9f5e('0x4'));var db=require('../../mysqldb')['db'];var config=require(_0x9f5e('0x5'));var signToken=require(_0x9f5e('0x6'))[_0x9f5e('0x7')];var utils=require('../../config/utils');exports['login']=passport[_0x9f5e('0x8')](_0x9f5e('0x9'),{'failureRedirect':_0x9f5e('0xa'),'scope':[_0x9f5e('0xb'),_0x9f5e('0xc')],'session':![]});exports[_0x9f5e('0xd')]=passport[_0x9f5e('0x8')]('google',{'failureRedirect':_0x9f5e('0xa'),'session':![]});passport[_0x9f5e('0xe')](new GoogleStrategy({'clientID':config[_0x9f5e('0x9')]?config[_0x9f5e('0x9')][_0x9f5e('0xf')]:'id','clientSecret':config[_0x9f5e('0x9')]?config['google'][_0x9f5e('0x10')]:_0x9f5e('0x11'),'callbackURL':config[_0x9f5e('0x9')]?config[_0x9f5e('0x9')][_0x9f5e('0x12')]:''},function(_0x422e97,_0x10209f,_0x45d6c9,_0x4e038b){var _0x3c8dc4,_0x429e03;return db[_0x9f5e('0x13')][_0x9f5e('0x14')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x9f5e('0x15')](function(_0x5055be){_0x3c8dc4=_0x5055be;return db['User'][_0x9f5e('0x16')]({'where':{'email':_[_0x9f5e('0x17')](_0x45d6c9[_0x9f5e('0x18')],_0x9f5e('0x19')),'role':{'$or':[_0x9f5e('0x1a'),_0x9f5e('0x1b'),_0x9f5e('0x1c')]}}});})[_0x9f5e('0x15')](function(_0x241f07){_0x429e03=_0x241f07;if(_0x429e03){if(_0x429e03[_0x9f5e('0x1d')]){return _0x4e038b(_0x9f5e('0x1e'));}else if(_0x3c8dc4[_0x9f5e('0x1f')]>0x0){if(_0x429e03[_0x9f5e('0x20')]){if(moment(_0x429e03['blockedAt'])[_0x9f5e('0x21')](_0x3c8dc4['blockDuration'],_0x9f5e('0x22'))>moment()){return _0x4e038b(_0x9f5e('0x1e'));}else{return utils[_0x9f5e('0x23')](_0x429e03,0x0,![],null)[_0x9f5e('0x15')](function(){return utils[_0x9f5e('0x24')](_0x429e03);})[_0x9f5e('0x15')](function(){return _0x4e038b(null,_0x429e03);});}}else{return utils[_0x9f5e('0x24')](_0x429e03)[_0x9f5e('0x15')](function(){return _0x4e038b(null,_0x429e03);});}}else{return utils[_0x9f5e('0x24')](_0x429e03)['then'](function(){return _0x4e038b(null,_0x429e03);});}}return _0x4e038b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x9f5e('0x25')](function(_0x2afe0e){_0x4e038b(_0x2afe0e);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 8f4631a..9a8d461 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 _0x6e1f=['../user/user.controller.js','../../components/auth/service','get','login','/callback','setTokenCookie','Router'];(function(_0x1e81ea,_0x3b2735){var _0x361d94=function(_0x5eb33c){while(--_0x5eb33c){_0x1e81ea['push'](_0x1e81ea['shift']());}};_0x361d94(++_0x3b2735);}(_0x6e1f,0x110));var _0xf6e1=function(_0x2a2ccf,_0x10469b){_0x2a2ccf=_0x2a2ccf-0x0;var _0x4cd42d=_0x6e1f[_0x2a2ccf];return _0x4cd42d;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0xf6e1('0x0')]();var controller=require('./authGoogle.controller');var userController=require(_0xf6e1('0x1'));var authService=require(_0xf6e1('0x2'));router[_0xf6e1('0x3')]('/',controller[_0xf6e1('0x4')]);router[_0xf6e1('0x3')](_0xf6e1('0x5'),controller['callback'],authService['isMiddleware'],userController[_0xf6e1('0x4')],authService[_0xf6e1('0x6')]);module['exports']=router; \ No newline at end of file +var _0xabd2=['../user/user.controller.js','../../components/auth/service','get','login','/callback','setTokenCookie','exports','express','Router','./authGoogle.controller'];(function(_0x194e12,_0x2f8d3e){var _0x16788c=function(_0x59b79e){while(--_0x59b79e){_0x194e12['push'](_0x194e12['shift']());}};_0x16788c(++_0x2f8d3e);}(_0xabd2,0x93));var _0x2abd=function(_0x2e27ea,_0x3bea3d){_0x2e27ea=_0x2e27ea-0x0;var _0x13f47e=_0xabd2[_0x2e27ea];return _0x13f47e;};'use strict';var express=require(_0x2abd('0x0'));var passport=require('passport');var router=express[_0x2abd('0x1')]();var controller=require(_0x2abd('0x2'));var userController=require(_0x2abd('0x3'));var authService=require(_0x2abd('0x4'));router[_0x2abd('0x5')]('/',controller[_0x2abd('0x6')]);router[_0x2abd('0x5')](_0x2abd('0x7'),controller['callback'],authService['isMiddleware'],userController[_0x2abd('0x6')],authService[_0x2abd('0x8')]);module[_0x2abd('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index a7beb39..83a945a 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 _0x23a8=['secure','authentication','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','login','local','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','findOne','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','save','xCally\x20Motion\x20Password\x20Reset','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','passport','Strategy','lodash','randomstring','../../mysqldb','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','user','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port'];(function(_0x523b5c,_0x1ff139){var _0x149905=function(_0x64045e){while(--_0x64045e){_0x523b5c['push'](_0x523b5c['shift']());}};_0x149905(++_0x1ff139);}(_0x23a8,0x172));var _0x823a=function(_0x1b7bc5,_0x522147){_0x1b7bc5=_0x1b7bc5-0x0;var _0x782b36=_0x23a8[_0x1b7bc5];return _0x782b36;};'use strict';var util=require('util');var passport=require(_0x823a('0x0'));var LocalStrategy=require('passport-local')[_0x823a('0x1')];var jayson=require('jayson/promise');var _=require(_0x823a('0x2'));var rs=require(_0x823a('0x3'));var moment=require('moment');var db=require(_0x823a('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x823a('0x5'));var client=jayson[_0x823a('0x6')][_0x823a('0x7')]({'port':0x232b});function localAuthenticate(_0x35ae11,_0x5dca10,_0x472eb5,_0x3f35db){var _0x59866f,_0x42c0f2;return db[_0x823a('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0x823a('0x9'),_0x823a('0xa')],'raw':!![]})[_0x823a('0xb')](function(_0x40e936){_0x59866f=_0x40e936;return _0x35ae11['findOne']({'attributes':['id',_0x823a('0xc'),_0x823a('0xd'),_0x823a('0xe'),_0x823a('0xf'),_0x823a('0x10'),_0x823a('0x11'),_0x823a('0x12'),_0x823a('0x13')],'where':{'name':_0x5dca10,'role':{'$or':['admin',_0x823a('0x14'),'agent']}}});})[_0x823a('0xb')](function(_0x29d2cf){if(!_0x29d2cf||_0x29d2cf&&_0x29d2cf[_0x823a('0xc')]!==_0x5dca10){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x42c0f2=_0x29d2cf;return _0x42c0f2;}})['then'](function(){_0x42c0f2[_0x823a('0x15')](_0x472eb5,function(_0x3dc596,_0x208182){var _0x54989a=_0x42c0f2['loginAttempts']+0x1;if(_0x3dc596){return _0x3f35db(_0x3dc596);}else if(!_0x208182){if(_0x42c0f2['disabled']){return _0x3f35db(null,![],{'message':_0x823a('0x16')});}else if(_0x59866f[_0x823a('0x9')]>0x0){if(_0x42c0f2[_0x823a('0x11')]){if(_0x59866f[_0x823a('0xa')]>0x0){if(moment(_0x42c0f2[_0x823a('0x12')])[_0x823a('0x17')](_0x59866f[_0x823a('0xa')],_0x823a('0x18'))>moment()){return _0x3f35db(null,![],{'message':_0x823a('0x16')});}else{return utils[_0x823a('0x19')](_0x42c0f2,_0x54989a,![],null)[_0x823a('0xb')](function(){return _0x3f35db(null,![],{'message':_0x823a('0x16')});});}}else{return _0x3f35db(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x54989a>=_0x59866f[_0x823a('0x9')]){return utils[_0x823a('0x19')](_0x42c0f2,0x0,!![],moment())[_0x823a('0xb')](function(){return _0x3f35db(null,![],{'message':_0x823a('0x16')});});}else{return utils[_0x823a('0x19')](_0x42c0f2,_0x54989a,![],null)[_0x823a('0xb')](function(){return _0x3f35db(null,![],{'message':_0x823a('0x16')});});}}}else{return _0x3f35db(null,![],{'message':_0x823a('0x16')});}}else{if(_0x42c0f2[_0x823a('0x10')]){return _0x3f35db(null,![],{'message':_0x823a('0x16')});}else if(_0x59866f['allowedLoginAttempts']>0x0){if(_0x42c0f2[_0x823a('0x11')]){if(_0x59866f['blockDuration']>0x0){if(moment(_0x42c0f2['blockedAt'])[_0x823a('0x17')](_0x59866f[_0x823a('0xa')],'minutes')>moment()){return _0x3f35db(null,![],{'message':_0x823a('0x16')});}else{return utils['clearBlockUser'](_0x42c0f2,0x0,![],null)[_0x823a('0xb')](function(){return utils['getLicense'](_0x42c0f2);})[_0x823a('0xb')](function(){return _0x3f35db(null,_0x42c0f2);});}}else{return _0x3f35db(null,![],{'message':_0x823a('0x16')});}}else{return utils['clearBlockUser'](_0x42c0f2,0x0,![],null)[_0x823a('0xb')](function(){return utils[_0x823a('0x1a')](_0x42c0f2);})['then'](function(){return _0x3f35db(null,_0x42c0f2);})[_0x823a('0x1b')](function(_0xbca8f9){return _0x3f35db(null,![],_0xbca8f9);});}}else{if(_0x42c0f2[_0x823a('0x11')]){return _0x3f35db(null,![],{'message':_0x823a('0x16')});}else{return utils['getLicense'](_0x42c0f2)[_0x823a('0xb')](function(){return _0x3f35db(null,_0x42c0f2);});}}}});})[_0x823a('0x1b')](function(_0x27e237){return _0x3f35db(null,![],_0x27e237);});}function sendServiceMail(_0x35cf4d){return db[_0x823a('0x1c')]['find']({'where':{'service':!![]},'attributes':['id',_0x823a('0xc'),_0x823a('0x1d')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x823a('0xb')](function(_0xd6b128){if(!_0xd6b128){throw new Error(_0x823a('0x1e'));}var _0x5699ad={'tls':{'rejectUnauthorized':![]}};if(_0xd6b128[_0x823a('0x1f')][_0x823a('0x20')]){_0x5699ad[_0x823a('0x20')]=_0xd6b128[_0x823a('0x1f')][_0x823a('0x20')];}else{_0x5699ad[_0x823a('0x21')]=_0xd6b128[_0x823a('0x1f')][_0x823a('0x21')];_0x5699ad[_0x823a('0x22')]=_0xd6b128[_0x823a('0x1f')][_0x823a('0x22')];_0x5699ad[_0x823a('0x23')]=_0xd6b128[_0x823a('0x1f')][_0x823a('0x23')];}if(_0xd6b128[_0x823a('0x1f')][_0x823a('0x24')]){_0x5699ad['auth']={'user':_0xd6b128[_0x823a('0x1f')][_0x823a('0x14')],'pass':_0xd6b128[_0x823a('0x1f')][_0x823a('0x25')]};}var _0x263b07={'account':_0x5699ad,'message':_[_0x823a('0x26')]({'from':util[_0x823a('0x27')](_0x823a('0x28'),_0xd6b128['name'],_0xd6b128[_0x823a('0x1d')]||_0xd6b128[_0x823a('0x1f')]['user'])},_0x35cf4d)};return client['request'](_0x823a('0x29'),_0x263b07);})[_0x823a('0xb')](function(_0x489843){if(_0x489843[_0x823a('0x2a')]){throw new Error(util['format'](_0x823a('0x2b'),_0x489843[_0x823a('0x2a')]['message']||JSON[_0x823a('0x2c')](_0x489843[_0x823a('0x2a')])));}return!![];});}function handleError(_0x448788,_0xa1c8b8,_0x36683d){return _0x448788[_0x823a('0x2d')](_0xa1c8b8||0x1f4)[_0x823a('0x2e')]({'message':_0x36683d?_0x36683d['message']||_0x36683d:''});}exports[_0x823a('0x2f')]=function(_0x24bf6b,_0xb43e7a,_0x536607){passport[_0x823a('0x15')](_0x823a('0x30'),function(_0x41b191,_0x14cd0c,_0x1d2cb4){var _0x3cc3fb=_0x41b191||_0x1d2cb4;if(_0x3cc3fb){return handleError(_0xb43e7a,0x191,_0x3cc3fb);}if(!_0x14cd0c){return handleError(_0xb43e7a,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x5dc2d7={'payload':{'id':_0x14cd0c['id'],'role':_0x14cd0c[_0x823a('0xf')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5dc2d7)[_0x823a('0xb')](function(_0x3bdd5b){_0xb43e7a[_0x823a('0x31')]({'id':_0x14cd0c['id'],'token':_0x3bdd5b,'statusCall':'','isAlreadyLogged':_0x14cd0c[_0x823a('0x32')]});});}})(_0x24bf6b,_0xb43e7a,_0x536607);};exports['forgot']=function(_0x2f6643,_0x55904e,_0x5d4aa6){if(!_0x2f6643[_0x823a('0x33')][_0x823a('0x1d')]){return handleError(_0x55904e,0x1f4,{'message':_0x823a('0x34')});}var _0x27ea1a=rs[_0x823a('0x35')]();_0x2f6643['body'][_0x823a('0x1d')]=_0x2f6643[_0x823a('0x33')][_0x823a('0x1d')][_0x823a('0x36')]()[_0x823a('0x37')]();var _0x2e0b70;return db[_0x823a('0x8')][_0x823a('0x38')]({'where':{'id':0x1},'attributes':[_0x823a('0x9'),'blockDuration'],'raw':!![]})[_0x823a('0xb')](function(_0x33f681){_0x2e0b70=_0x33f681;return db[_0x823a('0x39')][_0x823a('0x3a')]({'where':{'email':_0x2f6643[_0x823a('0x33')][_0x823a('0x1d')]}});})[_0x823a('0xb')](function(_0x2870b0){if(!_0x2870b0){throw new Error(_0x823a('0x3b'));}if(_0x2870b0[_0x823a('0x10')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x2870b0[_0x823a('0x11')]){if(moment(_0x2870b0[_0x823a('0x12')])['add'](_0x2e0b70['blockDuration'],_0x823a('0x18'))>moment()){throw new Error(_0x823a('0x3c'));}else{_0x2870b0['blocked']=![];_0x2870b0['blockedAt']=null;}}_0x2870b0['resetPasswordToken']=_0x27ea1a;_0x2870b0['resetPasswordExpires']=Date[_0x823a('0x3d')]()+0x36ee80;return _0x2870b0[_0x823a('0x3e')]();})[_0x823a('0xb')](function(){return sendServiceMail({'to':_0x2f6643['body'][_0x823a('0x1d')],'subject':_0x823a('0x3f'),'text':'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'+_0x823a('0x40')+_0x2f6643[_0x823a('0x41')][_0x823a('0x21')]+_0x823a('0x42')+_0x27ea1a+'\x0a\x0a'+_0x823a('0x43')});})[_0x823a('0xb')](function(){_0x55904e[_0x823a('0x2d')](0xc8)[_0x823a('0x2e')]({'message':'Reset\x20Email\x20sent!'});})[_0x823a('0x1b')](function(_0x22ba2a){return handleError(_0x55904e,0x1f4,_0x22ba2a);});};exports[_0x823a('0x44')]=function(_0x2b653f,_0x342764,_0x1c8af5){return db['User'][_0x823a('0x3a')]({'where':{'resetPasswordToken':_0x2b653f[_0x823a('0x45')][_0x823a('0x46')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x5287de){if(!_0x5287de){throw new Error(_0x823a('0x47'));}return db['Setting'][_0x823a('0x38')]({'attributes':['id','securePassword',_0x823a('0x48'),_0x823a('0x49')]})[_0x823a('0xb')](function(_0x2a4d9a){if(_0x2a4d9a[_0x823a('0x4a')])authService[_0x823a('0x4b')](_0x2b653f[_0x823a('0x33')][_0x823a('0xd')]);if(!_0x2a4d9a[_0x823a('0x48')]||!_0x5287de[_0x823a('0x4c')])return _0x5287de;authService[_0x823a('0x4d')](_0x2b653f[_0x823a('0x33')][_0x823a('0xd')],_0x5287de[_0x823a('0x4c')],_0x2a4d9a[_0x823a('0x49')]);return _0x5287de;})[_0x823a('0xb')](function(){_0x5287de['password']=_0x2b653f['body'][_0x823a('0xd')];_0x5287de[_0x823a('0x4e')]=null;_0x5287de['resetPasswordExpires']=null;return _0x5287de[_0x823a('0x3e')]();});})[_0x823a('0xb')](function(){_0x342764[_0x823a('0x2d')](0xc8)[_0x823a('0x2e')]({'message':_0x823a('0x4f')});})['catch'](function(_0x3c7fa1){return handleError(_0x342764,0x1f4,_0x3c7fa1);});};passport[_0x823a('0x50')](new LocalStrategy({'usernameField':_0x823a('0xc'),'passwordField':_0x823a('0xd')},function(_0x511dbb,_0x194757,_0x6f2675){return localAuthenticate(db[_0x823a('0x39')],_0x511dbb,_0x194757,_0x6f2675);})); \ No newline at end of file +var _0x81dc=['disabled','blocked','blockedAt','admin','agent','authenticate','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','add','getLicense','catch','MailAccount','email','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','Reset\x20Email\x20sent!','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash','../../mysqldb','../../components/auth/service','client','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt'];(function(_0x493bcc,_0x3e9066){var _0x51ddd9=function(_0x5985ad){while(--_0x5985ad){_0x493bcc['push'](_0x493bcc['shift']());}};_0x51ddd9(++_0x3e9066);}(_0x81dc,0x1e9));var _0xc81d=function(_0x4a0e68,_0x45c08c){_0x4a0e68=_0x4a0e68-0x0;var _0x4fb274=_0x81dc[_0x4a0e68];return _0x4fb274;};'use strict';var util=require('util');var passport=require(_0xc81d('0x0'));var LocalStrategy=require(_0xc81d('0x1'))[_0xc81d('0x2')];var jayson=require(_0xc81d('0x3'));var _=require(_0xc81d('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require(_0xc81d('0x5'))['db'];var authService=require(_0xc81d('0x6'));var utils=require('../../config/utils');var client=jayson[_0xc81d('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x474057,_0x526591,_0x353e56,_0x46fec5){var _0x24ad98,_0x33b3aa;return db['Setting'][_0xc81d('0x8')]({'where':{'id':0x1},'attributes':[_0xc81d('0x9'),_0xc81d('0xa')],'raw':!![]})[_0xc81d('0xb')](function(_0xf488e8){_0x24ad98=_0xf488e8;return _0x474057[_0xc81d('0x8')]({'attributes':['id',_0xc81d('0xc'),_0xc81d('0xd'),_0xc81d('0xe'),'role',_0xc81d('0xf'),_0xc81d('0x10'),_0xc81d('0x11'),'loginAttempts'],'where':{'name':_0x526591,'role':{'$or':[_0xc81d('0x12'),'user',_0xc81d('0x13')]}}});})['then'](function(_0x508047){if(!_0x508047||_0x508047&&_0x508047['name']!==_0x526591){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x33b3aa=_0x508047;return _0x33b3aa;}})[_0xc81d('0xb')](function(){_0x33b3aa[_0xc81d('0x14')](_0x353e56,function(_0x3c49e7,_0x47856e){var _0x25d574=_0x33b3aa['loginAttempts']+0x1;if(_0x3c49e7){return _0x46fec5(_0x3c49e7);}else if(!_0x47856e){if(_0x33b3aa[_0xc81d('0xf')]){return _0x46fec5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x24ad98[_0xc81d('0x9')]>0x0){if(_0x33b3aa['blocked']){if(_0x24ad98[_0xc81d('0xa')]>0x0){if(moment(_0x33b3aa[_0xc81d('0x11')])['add'](_0x24ad98['blockDuration'],_0xc81d('0x15'))>moment()){return _0x46fec5(null,![],{'message':_0xc81d('0x16')});}else{return utils['clearBlockUser'](_0x33b3aa,_0x25d574,![],null)['then'](function(){return _0x46fec5(null,![],{'message':_0xc81d('0x16')});});}}else{return _0x46fec5(null,![],{'message':_0xc81d('0x16')});}}else{if(_0x25d574>=_0x24ad98[_0xc81d('0x9')]){return utils['clearBlockUser'](_0x33b3aa,0x0,!![],moment())['then'](function(){return _0x46fec5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xc81d('0x17')](_0x33b3aa,_0x25d574,![],null)[_0xc81d('0xb')](function(){return _0x46fec5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x46fec5(null,![],{'message':_0xc81d('0x16')});}}else{if(_0x33b3aa[_0xc81d('0xf')]){return _0x46fec5(null,![],{'message':_0xc81d('0x16')});}else if(_0x24ad98[_0xc81d('0x9')]>0x0){if(_0x33b3aa[_0xc81d('0x10')]){if(_0x24ad98['blockDuration']>0x0){if(moment(_0x33b3aa[_0xc81d('0x11')])[_0xc81d('0x18')](_0x24ad98['blockDuration'],'minutes')>moment()){return _0x46fec5(null,![],{'message':_0xc81d('0x16')});}else{return utils['clearBlockUser'](_0x33b3aa,0x0,![],null)[_0xc81d('0xb')](function(){return utils[_0xc81d('0x19')](_0x33b3aa);})[_0xc81d('0xb')](function(){return _0x46fec5(null,_0x33b3aa);});}}else{return _0x46fec5(null,![],{'message':_0xc81d('0x16')});}}else{return utils[_0xc81d('0x17')](_0x33b3aa,0x0,![],null)[_0xc81d('0xb')](function(){return utils[_0xc81d('0x19')](_0x33b3aa);})['then'](function(){return _0x46fec5(null,_0x33b3aa);})['catch'](function(_0x2f004f){return _0x46fec5(null,![],_0x2f004f);});}}else{if(_0x33b3aa[_0xc81d('0x10')]){return _0x46fec5(null,![],{'message':_0xc81d('0x16')});}else{return utils[_0xc81d('0x19')](_0x33b3aa)[_0xc81d('0xb')](function(){return _0x46fec5(null,_0x33b3aa);});}}}});})[_0xc81d('0x1a')](function(_0x2a2429){return _0x46fec5(null,![],_0x2a2429);});}function sendServiceMail(_0x5ccd3c){return db[_0xc81d('0x1b')]['find']({'where':{'service':!![]},'attributes':['id',_0xc81d('0xc'),_0xc81d('0x1c')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})['then'](function(_0x153253){if(!_0x153253){throw new Error(_0xc81d('0x1d'));}var _0x5f4cc2={'tls':{'rejectUnauthorized':![]}};if(_0x153253[_0xc81d('0x1e')][_0xc81d('0x1f')]){_0x5f4cc2[_0xc81d('0x1f')]=_0x153253['Smtp'][_0xc81d('0x1f')];}else{_0x5f4cc2[_0xc81d('0x20')]=_0x153253[_0xc81d('0x1e')][_0xc81d('0x20')];_0x5f4cc2['port']=_0x153253['Smtp']['port'];_0x5f4cc2[_0xc81d('0x21')]=_0x153253[_0xc81d('0x1e')][_0xc81d('0x21')];}if(_0x153253[_0xc81d('0x1e')]['authentication']){_0x5f4cc2[_0xc81d('0x22')]={'user':_0x153253[_0xc81d('0x1e')][_0xc81d('0x23')],'pass':_0x153253[_0xc81d('0x1e')][_0xc81d('0x24')]};}var _0x21b0f4={'account':_0x5f4cc2,'message':_['merge']({'from':util[_0xc81d('0x25')](_0xc81d('0x26'),_0x153253['name'],_0x153253[_0xc81d('0x1c')]||_0x153253['Smtp'][_0xc81d('0x23')])},_0x5ccd3c)};return client[_0xc81d('0x27')](_0xc81d('0x28'),_0x21b0f4);})['then'](function(_0x564b24){if(_0x564b24[_0xc81d('0x29')]){throw new Error(util[_0xc81d('0x25')](_0xc81d('0x2a'),_0x564b24['error']['message']||JSON[_0xc81d('0x2b')](_0x564b24[_0xc81d('0x29')])));}return!![];});}function handleError(_0x5defc1,_0x16d53a,_0x1e51bd){return _0x5defc1[_0xc81d('0x2c')](_0x16d53a||0x1f4)[_0xc81d('0x2d')]({'message':_0x1e51bd?_0x1e51bd[_0xc81d('0x2e')]||_0x1e51bd:''});}exports[_0xc81d('0x2f')]=function(_0x4bef4a,_0x1c39ba,_0x2f7507){passport[_0xc81d('0x14')](_0xc81d('0x30'),function(_0x216c24,_0x2c23e9,_0x284bc4){var _0xee31c3=_0x216c24||_0x284bc4;if(_0xee31c3){return handleError(_0x1c39ba,0x191,_0xee31c3);}if(!_0x2c23e9){return handleError(_0x1c39ba,0x194,{'message':_0xc81d('0x31')});}else{var _0x15bc4b={'payload':{'id':_0x2c23e9['id'],'role':_0x2c23e9['role']},'options':{'expiresIn':0x15180}};return authService[_0xc81d('0x32')](_0x15bc4b)[_0xc81d('0xb')](function(_0x7d964b){_0x1c39ba['json']({'id':_0x2c23e9['id'],'token':_0x7d964b,'statusCall':'','isAlreadyLogged':_0x2c23e9[_0xc81d('0x33')]});});}})(_0x4bef4a,_0x1c39ba,_0x2f7507);};exports[_0xc81d('0x34')]=function(_0x48a4f6,_0x5a1fb4,_0x3851e3){if(!_0x48a4f6[_0xc81d('0x35')][_0xc81d('0x1c')]){return handleError(_0x5a1fb4,0x1f4,{'message':_0xc81d('0x36')});}var _0x5e5740=rs[_0xc81d('0x37')]();_0x48a4f6[_0xc81d('0x35')][_0xc81d('0x1c')]=_0x48a4f6[_0xc81d('0x35')][_0xc81d('0x1c')][_0xc81d('0x38')]()[_0xc81d('0x39')]();var _0x59e9b7;return db[_0xc81d('0x3a')]['findOne']({'where':{'id':0x1},'attributes':[_0xc81d('0x9'),'blockDuration'],'raw':!![]})[_0xc81d('0xb')](function(_0x420ca5){_0x59e9b7=_0x420ca5;return db[_0xc81d('0x3b')][_0xc81d('0x3c')]({'where':{'email':_0x48a4f6[_0xc81d('0x35')]['email']}});})[_0xc81d('0xb')](function(_0x4225f6){if(!_0x4225f6){throw new Error(_0xc81d('0x3d'));}if(_0x4225f6[_0xc81d('0xf')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x4225f6[_0xc81d('0x10')]){if(moment(_0x4225f6[_0xc81d('0x11')])[_0xc81d('0x18')](_0x59e9b7[_0xc81d('0xa')],_0xc81d('0x15'))>moment()){throw new Error(_0xc81d('0x3e'));}else{_0x4225f6['blocked']=![];_0x4225f6[_0xc81d('0x11')]=null;}}_0x4225f6[_0xc81d('0x3f')]=_0x5e5740;_0x4225f6[_0xc81d('0x40')]=Date[_0xc81d('0x41')]()+0x36ee80;return _0x4225f6[_0xc81d('0x42')]();})[_0xc81d('0xb')](function(){return sendServiceMail({'to':_0x48a4f6[_0xc81d('0x35')][_0xc81d('0x1c')],'subject':_0xc81d('0x43'),'text':_0xc81d('0x44')+_0xc81d('0x45')+_0xc81d('0x46')+_0x48a4f6[_0xc81d('0x47')]['host']+_0xc81d('0x48')+_0x5e5740+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xc81d('0xb')](function(){_0x5a1fb4['status'](0xc8)[_0xc81d('0x2d')]({'message':_0xc81d('0x49')});})['catch'](function(_0x5ac526){return handleError(_0x5a1fb4,0x1f4,_0x5ac526);});};exports['reset']=function(_0x2264e3,_0x2c8dd0,_0x23d6f7){return db['User'][_0xc81d('0x3c')]({'where':{'resetPasswordToken':_0x2264e3[_0xc81d('0x4a')][_0xc81d('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xc81d('0x41')]()}}})[_0xc81d('0xb')](function(_0x4f0fc2){if(!_0x4f0fc2){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xc81d('0x3a')][_0xc81d('0x8')]({'attributes':['id',_0xc81d('0x4c'),_0xc81d('0x4d'),_0xc81d('0x4e')]})[_0xc81d('0xb')](function(_0x91d99f){if(_0x91d99f['securePassword'])authService[_0xc81d('0x4f')](_0x2264e3[_0xc81d('0x35')][_0xc81d('0xd')]);if(!_0x91d99f[_0xc81d('0x4d')]||!_0x4f0fc2[_0xc81d('0x50')])return _0x4f0fc2;authService[_0xc81d('0x51')](_0x2264e3[_0xc81d('0x35')][_0xc81d('0xd')],_0x4f0fc2[_0xc81d('0x50')],_0x91d99f[_0xc81d('0x4e')]);return _0x4f0fc2;})['then'](function(){_0x4f0fc2[_0xc81d('0xd')]=_0x2264e3[_0xc81d('0x35')][_0xc81d('0xd')];_0x4f0fc2[_0xc81d('0x3f')]=null;_0x4f0fc2[_0xc81d('0x40')]=null;return _0x4f0fc2[_0xc81d('0x42')]();});})['then'](function(){_0x2c8dd0['status'](0xc8)['send']({'message':_0xc81d('0x52')});})[_0xc81d('0x1a')](function(_0x25b7db){return handleError(_0x2c8dd0,0x1f4,_0x25b7db);});};passport[_0xc81d('0x53')](new LocalStrategy({'usernameField':_0xc81d('0xc'),'passwordField':'password'},function(_0x580268,_0x2f9e10,_0xd4b89b){return localAuthenticate(db[_0xc81d('0x3b')],_0x580268,_0x2f9e10,_0xd4b89b);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 26c9e21..484716d 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 _0x6ee6=['login','forgot','/reset/:token','reset','express','post'];(function(_0x49a489,_0x7e7866){var _0x4b32ac=function(_0x5c7140){while(--_0x5c7140){_0x49a489['push'](_0x49a489['shift']());}};_0x4b32ac(++_0x7e7866);}(_0x6ee6,0x1c6));var _0x66ee=function(_0x3c2666,_0x15fd23){_0x3c2666=_0x3c2666-0x0;var _0x10c814=_0x6ee6[_0x3c2666];return _0x10c814;};'use strict';var express=require(_0x66ee('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0x66ee('0x1')]('/',controller[_0x66ee('0x2')]);router[_0x66ee('0x1')]('/forgot',controller[_0x66ee('0x3')]);router[_0x66ee('0x1')](_0x66ee('0x4'),controller[_0x66ee('0x5')]);module['exports']=router; \ No newline at end of file +var _0xecc5=['/forgot','forgot','/reset/:token','reset','exports','Router','./authLocal.controller','post','login'];(function(_0x4dc16b,_0xb58e2c){var _0x30a136=function(_0xcc1ee7){while(--_0xcc1ee7){_0x4dc16b['push'](_0x4dc16b['shift']());}};_0x30a136(++_0xb58e2c);}(_0xecc5,0x1be));var _0x5ecc=function(_0x923619,_0x2af4f4){_0x923619=_0x923619-0x0;var _0xf855df=_0xecc5[_0x923619];return _0xf855df;};'use strict';var express=require('express');var router=express[_0x5ecc('0x0')]();var controller=require(_0x5ecc('0x1'));router[_0x5ecc('0x2')]('/',controller[_0x5ecc('0x3')]);router[_0x5ecc('0x2')](_0x5ecc('0x4'),controller[_0x5ecc('0x5')]);router[_0x5ecc('0x2')](_0x5ecc('0x6'),controller[_0x5ecc('0x7')]);module[_0x5ecc('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 2e58be8..446fc42 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 _0x9d3c=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9d3c,0x147));var _0xc9d3=function(_0x248f4d,_0x1707c8){_0x248f4d=_0x248f4d-0x0;var _0x5565c6=_0x9d3c[_0x248f4d];return _0x5565c6;};'use strict';var Sequelize=require('sequelize');module[_0xc9d3('0x0')]={'name':{'type':Sequelize[_0xc9d3('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xc9d3('0x1')]},'description':{'type':Sequelize[_0xc9d3('0x1')]},'status':{'type':Sequelize[_0xc9d3('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xc9d3('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x4280=['sequelize'];(function(_0x2f20c5,_0x54129f){var _0x5f2169=function(_0x19cda0){while(--_0x19cda0){_0x2f20c5['push'](_0x2f20c5['shift']());}};_0x5f2169(++_0x54129f);}(_0x4280,0xf0));var _0x0428=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4280[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0428('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 2e341b2..18a05a4 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 _0x06b2=['lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','save','then','destroy','error','name','send','index','map','Automation','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','fields','options','find','create','body','update','Condition','addConditions','ids','getConditions','findOne','addActions','Action','omit','getActions','order','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x5cb5b1,_0xafc0d6){var _0x22d423=function(_0x1c60c1){while(--_0x1c60c1){_0x5cb5b1['push'](_0x5cb5b1['shift']());}};_0x22d423(++_0xafc0d6);}(_0x06b2,0x1e1));var _0x206b=function(_0x36f1f4,_0x3e8b5a){_0x36f1f4=_0x36f1f4-0x0;var _0x1678ad=_0x06b2[_0x36f1f4];return _0x1678ad;};'use strict';var emlformat=require(_0x206b('0x0'));var rimraf=require(_0x206b('0x1'));var zipdir=require(_0x206b('0x2'));var jsonpatch=require(_0x206b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x206b('0x4'));var Mustache=require(_0x206b('0x5'));var util=require('util');var path=require(_0x206b('0x6'));var sox=require(_0x206b('0x7'));var csv=require(_0x206b('0x8'));var ejs=require(_0x206b('0x9'));var fs=require('fs');var fs_extra=require(_0x206b('0xa'));var _=require(_0x206b('0xb'));var squel=require(_0x206b('0xc'));var crypto=require(_0x206b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x206b('0x8'));var querystring=require(_0x206b('0xe'));var Papa=require(_0x206b('0xf'));var Redis=require(_0x206b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x206b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x206b('0x12'));var logger=require(_0x206b('0x13'))(_0x206b('0x14'));var utils=require('../../config/utils');var config=require(_0x206b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x206b('0x16'))['db'];function respondWithStatusCode(_0xa6bece,_0x10c438){_0x10c438=_0x10c438||0xcc;return function(_0x753fc){if(_0x753fc){return _0xa6bece[_0x206b('0x17')](_0x10c438);}return _0xa6bece['status'](_0x10c438)[_0x206b('0x18')]();};}function respondWithResult(_0x5ab87d,_0x4c2440){_0x4c2440=_0x4c2440||0xc8;return function(_0x53cc49){if(_0x53cc49){return _0x5ab87d[_0x206b('0x19')](_0x4c2440)[_0x206b('0x1a')](_0x53cc49);}};}function respondWithFilteredResult(_0x30f731,_0x20519b){return function(_0x2bb9cb){if(_0x2bb9cb){var _0x68e407=typeof _0x20519b[_0x206b('0x1b')]===_0x206b('0x1c')&&typeof _0x20519b['limit']===_0x206b('0x1c');var _0x55f3e4=_0x2bb9cb[_0x206b('0x1d')];var _0x4534d5=_0x68e407?0x0:_0x20519b[_0x206b('0x1b')];var _0x550a79=_0x68e407?_0x2bb9cb[_0x206b('0x1d')]:_0x20519b['offset']+_0x20519b[_0x206b('0x1e')];var _0x38eaeb;if(_0x550a79>=_0x55f3e4){_0x550a79=_0x55f3e4;_0x38eaeb=0xc8;}else{_0x38eaeb=0xce;}_0x30f731['status'](_0x38eaeb);return _0x30f731[_0x206b('0x1f')](_0x206b('0x20'),_0x4534d5+'-'+_0x550a79+'/'+_0x55f3e4)[_0x206b('0x1a')](_0x2bb9cb);}return null;};}function patchUpdates(_0x1a87f2){return function(_0x47d394){try{jsonpatch['apply'](_0x47d394,_0x1a87f2,!![]);}catch(_0x3f8f13){return BPromise['reject'](_0x3f8f13);}return _0x47d394[_0x206b('0x21')]();};}function saveUpdates(_0x3cc188,_0x520f40){return function(_0x26b977){if(_0x26b977){return _0x26b977['update'](_0x3cc188)[_0x206b('0x22')](function(_0x364951){return _0x364951;});}return null;};}function removeEntity(_0x5e6d8c,_0x829537){return function(_0x55e0ee){if(_0x55e0ee){return _0x55e0ee[_0x206b('0x23')]()[_0x206b('0x22')](function(){_0x5e6d8c['status'](0xcc)[_0x206b('0x18')]();});}};}function handleEntityNotFound(_0x50ddbc,_0x19bb4b){return function(_0xe50606){if(!_0xe50606){_0x50ddbc[_0x206b('0x17')](0x194);}return _0xe50606;};}function handleError(_0x1ab8e1,_0xa4f1c3){_0xa4f1c3=_0xa4f1c3||0x1f4;return function(_0xf54fe1){logger[_0x206b('0x24')](_0xf54fe1['stack']);if(_0xf54fe1[_0x206b('0x25')]){delete _0xf54fe1[_0x206b('0x25')];}_0x1ab8e1[_0x206b('0x19')](_0xa4f1c3)[_0x206b('0x26')](_0xf54fe1);};}exports[_0x206b('0x27')]=function(_0x2ae6f1,_0x119c56){var _0x3b8296={},_0x368fdd={},_0x355c24={'count':0x0,'rows':[]};var _0x3b6bf0=_[_0x206b('0x28')](db[_0x206b('0x29')]['rawAttributes'],function(_0x507d30){return{'name':_0x507d30[_0x206b('0x2a')],'type':_0x507d30[_0x206b('0x2b')]['key']};});_0x368fdd[_0x206b('0x2c')]=_['map'](_0x3b6bf0,_0x206b('0x25'));_0x368fdd[_0x206b('0x2d')]=_[_0x206b('0x2e')](_0x2ae6f1[_0x206b('0x2d')]);_0x368fdd[_0x206b('0x2f')]=_[_0x206b('0x30')](_0x368fdd[_0x206b('0x2c')],_0x368fdd[_0x206b('0x2d')]);_0x3b8296[_0x206b('0x31')]=_[_0x206b('0x30')](_0x368fdd[_0x206b('0x2c')],qs['fields'](_0x2ae6f1[_0x206b('0x2d')]['fields']));_0x3b8296[_0x206b('0x31')]=_0x3b8296[_0x206b('0x31')][_0x206b('0x32')]?_0x3b8296[_0x206b('0x31')]:_0x368fdd[_0x206b('0x2c')];if(!_0x2ae6f1['query'][_0x206b('0x33')](_0x206b('0x34'))){_0x3b8296[_0x206b('0x1e')]=qs[_0x206b('0x1e')](_0x2ae6f1['query'][_0x206b('0x1e')]);_0x3b8296[_0x206b('0x1b')]=qs[_0x206b('0x1b')](_0x2ae6f1[_0x206b('0x2d')][_0x206b('0x1b')]);}_0x3b8296['order']=qs[_0x206b('0x35')](_0x2ae6f1[_0x206b('0x2d')]['sort']);_0x3b8296[_0x206b('0x36')]=qs[_0x206b('0x2f')](_[_0x206b('0x37')](_0x2ae6f1['query'],_0x368fdd['filters']),_0x3b6bf0);if(_0x2ae6f1[_0x206b('0x2d')][_0x206b('0x38')]){_0x3b8296['where']=_[_0x206b('0x39')](_0x3b8296[_0x206b('0x36')],{'$or':_[_0x206b('0x28')](_0x3b6bf0,function(_0x16bb96){if(_0x16bb96[_0x206b('0x2b')]!==_0x206b('0x3a')){var _0x501a47={};_0x501a47[_0x16bb96['name']]={'$like':'%'+_0x2ae6f1[_0x206b('0x2d')][_0x206b('0x38')]+'%'};return _0x501a47;}})});}_0x3b8296=_[_0x206b('0x39')]({},_0x3b8296,_0x2ae6f1['options']);var _0x3c03f9={'where':_0x3b8296[_0x206b('0x36')]};return db[_0x206b('0x29')][_0x206b('0x1d')](_0x3c03f9)[_0x206b('0x22')](function(_0xdf16af){_0x355c24['count']=_0xdf16af;if(_0x2ae6f1[_0x206b('0x2d')][_0x206b('0x3b')]){_0x3b8296[_0x206b('0x3c')]=[{'all':!![]}];}return db[_0x206b('0x29')]['findAll'](_0x3b8296);})[_0x206b('0x22')](function(_0x27bd23){_0x355c24[_0x206b('0x3d')]=_0x27bd23;return _0x355c24;})['then'](respondWithFilteredResult(_0x119c56,_0x3b8296))[_0x206b('0x3e')](handleError(_0x119c56,null));};exports[_0x206b('0x3f')]=function(_0xc2d51e,_0x1cef8a){var _0x361b41={'raw':![],'where':{'id':_0xc2d51e[_0x206b('0x40')]['id']}},_0x47ecdb={};_0x47ecdb[_0x206b('0x2c')]=_[_0x206b('0x2e')](db['Automation'][_0x206b('0x41')]);_0x47ecdb[_0x206b('0x2d')]=_[_0x206b('0x2e')](_0xc2d51e[_0x206b('0x2d')]);_0x47ecdb['filters']=_[_0x206b('0x30')](_0x47ecdb[_0x206b('0x2c')],_0x47ecdb[_0x206b('0x2d')]);_0x361b41[_0x206b('0x31')]=_[_0x206b('0x30')](_0x47ecdb[_0x206b('0x2c')],qs[_0x206b('0x42')](_0xc2d51e[_0x206b('0x2d')][_0x206b('0x42')]));_0x361b41[_0x206b('0x31')]=_0x361b41[_0x206b('0x31')][_0x206b('0x32')]?_0x361b41[_0x206b('0x31')]:_0x47ecdb['model'];if(_0xc2d51e[_0x206b('0x2d')][_0x206b('0x3b')]){_0x361b41['include']=[{'all':!![]}];}_0x361b41=_[_0x206b('0x39')]({},_0x361b41,_0xc2d51e[_0x206b('0x43')]);return db[_0x206b('0x29')][_0x206b('0x44')](_0x361b41)[_0x206b('0x22')](handleEntityNotFound(_0x1cef8a,null))['then'](respondWithResult(_0x1cef8a,null))[_0x206b('0x3e')](handleError(_0x1cef8a,null));};exports[_0x206b('0x45')]=function(_0x52165f,_0x3e33b1){return db[_0x206b('0x29')][_0x206b('0x45')](_0x52165f[_0x206b('0x46')],{})[_0x206b('0x22')](respondWithResult(_0x3e33b1,0xc9))[_0x206b('0x3e')](handleError(_0x3e33b1,null));};exports[_0x206b('0x47')]=function(_0x14942f,_0x5b6ec6){if(_0x14942f[_0x206b('0x46')]['id']){delete _0x14942f['body']['id'];}return db[_0x206b('0x29')][_0x206b('0x44')]({'where':{'id':_0x14942f[_0x206b('0x40')]['id']}})[_0x206b('0x22')](handleEntityNotFound(_0x5b6ec6,null))['then'](saveUpdates(_0x14942f[_0x206b('0x46')],null))['then'](respondWithResult(_0x5b6ec6,null))[_0x206b('0x3e')](handleError(_0x5b6ec6,null));};exports[_0x206b('0x23')]=function(_0x2c725d,_0x2b9bb8){return db[_0x206b('0x29')]['find']({'where':{'id':_0x2c725d[_0x206b('0x40')]['id']}})[_0x206b('0x22')](handleEntityNotFound(_0x2b9bb8,null))[_0x206b('0x22')](removeEntity(_0x2b9bb8,null))[_0x206b('0x3e')](handleError(_0x2b9bb8,null));};exports['addConditions']=function(_0x8be662,_0x1bd45a,_0x39221a){return db[_0x206b('0x48')][_0x206b('0x44')]({'where':{'id':_0x8be662[_0x206b('0x40')]['id']}})[_0x206b('0x22')](handleEntityNotFound(_0x1bd45a,null))[_0x206b('0x22')](function(_0x39c206){if(_0x39c206){return _0x39c206[_0x206b('0x49')](_0x8be662[_0x206b('0x46')][_0x206b('0x4a')],_['omit'](_0x8be662[_0x206b('0x46')],[_0x206b('0x4a'),'id'])||{});}})[_0x206b('0x22')](respondWithResult(_0x1bd45a,null))[_0x206b('0x3e')](handleError(_0x1bd45a,null));};exports[_0x206b('0x4b')]=function(_0x3ed117,_0x1a68d5,_0x2496c1){var _0x2516dc={};var _0x345b1c={};var _0x4b4dc1;var _0x3811c0;return db[_0x206b('0x29')][_0x206b('0x4c')]({'where':{'id':_0x3ed117['params']['id']}})['then'](handleEntityNotFound(_0x1a68d5,null))[_0x206b('0x22')](function(_0x5e8d77){if(_0x5e8d77){_0x4b4dc1=_0x5e8d77;_0x345b1c[_0x206b('0x2c')]=_['keys'](db[_0x206b('0x48')][_0x206b('0x41')]);_0x345b1c['query']=_[_0x206b('0x2e')](_0x3ed117[_0x206b('0x2d')]);_0x345b1c[_0x206b('0x2f')]=_[_0x206b('0x30')](_0x345b1c[_0x206b('0x2c')],_0x345b1c[_0x206b('0x2d')]);_0x2516dc[_0x206b('0x31')]=_[_0x206b('0x30')](_0x345b1c['model'],qs[_0x206b('0x42')](_0x3ed117[_0x206b('0x2d')][_0x206b('0x42')]));_0x2516dc[_0x206b('0x31')]=_0x2516dc[_0x206b('0x31')][_0x206b('0x32')]?_0x2516dc[_0x206b('0x31')]:_0x345b1c[_0x206b('0x2c')];_0x2516dc['order']=qs[_0x206b('0x35')](_0x3ed117[_0x206b('0x2d')][_0x206b('0x35')]);_0x2516dc[_0x206b('0x36')]=qs['filters'](_[_0x206b('0x37')](_0x3ed117['query'],_0x345b1c[_0x206b('0x2f')]));if(_0x3ed117[_0x206b('0x2d')][_0x206b('0x38')]){_0x2516dc[_0x206b('0x36')]=_['merge'](_0x2516dc[_0x206b('0x36')],{'$or':_[_0x206b('0x28')](_0x2516dc[_0x206b('0x31')],function(_0x391f6b){var _0x3bc6a3={};_0x3bc6a3[_0x391f6b]={'$like':'%'+_0x3ed117[_0x206b('0x2d')][_0x206b('0x38')]+'%'};return _0x3bc6a3;})});}_0x2516dc=_[_0x206b('0x39')]({},_0x2516dc,_0x3ed117[_0x206b('0x43')]);return _0x4b4dc1[_0x206b('0x4b')](_0x2516dc);}})['then'](function(_0x4ffba7){if(_0x4ffba7){_0x3811c0=_0x4ffba7[_0x206b('0x32')];if(!_0x3ed117[_0x206b('0x2d')][_0x206b('0x33')]('nolimit')){_0x2516dc[_0x206b('0x1e')]=qs[_0x206b('0x1e')](_0x3ed117[_0x206b('0x2d')][_0x206b('0x1e')]);_0x2516dc[_0x206b('0x1b')]=qs[_0x206b('0x1b')](_0x3ed117[_0x206b('0x2d')][_0x206b('0x1b')]);}return _0x4b4dc1[_0x206b('0x4b')](_0x2516dc);}})[_0x206b('0x22')](function(_0xc96efa){if(_0xc96efa){return _0xc96efa?{'count':_0x3811c0,'rows':_0xc96efa}:null;}})['then'](respondWithResult(_0x1a68d5,null))[_0x206b('0x3e')](handleError(_0x1a68d5,null));};exports[_0x206b('0x4d')]=function(_0xdd7739,_0x43c2ed,_0x175b5b){return db[_0x206b('0x4e')][_0x206b('0x44')]({'where':{'id':_0xdd7739[_0x206b('0x40')]['id']}})[_0x206b('0x22')](handleEntityNotFound(_0x43c2ed,null))[_0x206b('0x22')](function(_0x31025a){if(_0x31025a){return _0x31025a[_0x206b('0x4d')](_0xdd7739[_0x206b('0x46')][_0x206b('0x4a')],_[_0x206b('0x4f')](_0xdd7739[_0x206b('0x46')],['ids','id'])||{});}})[_0x206b('0x22')](respondWithResult(_0x43c2ed,null))[_0x206b('0x3e')](handleError(_0x43c2ed,null));};exports[_0x206b('0x50')]=function(_0x47453c,_0x29a25d,_0x12726b){var _0x1cde4f={};var _0x1a45ce={};var _0x138f78;var _0x30fc51;return db['Automation'][_0x206b('0x4c')]({'where':{'id':_0x47453c['params']['id']}})[_0x206b('0x22')](handleEntityNotFound(_0x29a25d,null))[_0x206b('0x22')](function(_0x3089da){if(_0x3089da){_0x138f78=_0x3089da;_0x1a45ce['model']=_[_0x206b('0x2e')](db[_0x206b('0x4e')]['rawAttributes']);_0x1a45ce[_0x206b('0x2d')]=_[_0x206b('0x2e')](_0x47453c[_0x206b('0x2d')]);_0x1a45ce['filters']=_['intersection'](_0x1a45ce[_0x206b('0x2c')],_0x1a45ce[_0x206b('0x2d')]);_0x1cde4f['attributes']=_[_0x206b('0x30')](_0x1a45ce[_0x206b('0x2c')],qs[_0x206b('0x42')](_0x47453c['query']['fields']));_0x1cde4f[_0x206b('0x31')]=_0x1cde4f['attributes'][_0x206b('0x32')]?_0x1cde4f[_0x206b('0x31')]:_0x1a45ce[_0x206b('0x2c')];_0x1cde4f[_0x206b('0x51')]=qs[_0x206b('0x35')](_0x47453c[_0x206b('0x2d')][_0x206b('0x35')]);_0x1cde4f[_0x206b('0x36')]=qs[_0x206b('0x2f')](_[_0x206b('0x37')](_0x47453c[_0x206b('0x2d')],_0x1a45ce[_0x206b('0x2f')]));if(_0x47453c[_0x206b('0x2d')][_0x206b('0x38')]){_0x1cde4f[_0x206b('0x36')]=_['merge'](_0x1cde4f['where'],{'$or':_[_0x206b('0x28')](_0x1cde4f[_0x206b('0x31')],function(_0x1216e3){var _0x304b2f={};_0x304b2f[_0x1216e3]={'$like':'%'+_0x47453c[_0x206b('0x2d')]['filter']+'%'};return _0x304b2f;})});}_0x1cde4f=_[_0x206b('0x39')]({},_0x1cde4f,_0x47453c[_0x206b('0x43')]);return _0x138f78['getActions'](_0x1cde4f);}})[_0x206b('0x22')](function(_0x2392d5){if(_0x2392d5){_0x30fc51=_0x2392d5['length'];if(!_0x47453c[_0x206b('0x2d')][_0x206b('0x33')](_0x206b('0x34'))){_0x1cde4f[_0x206b('0x1e')]=qs[_0x206b('0x1e')](_0x47453c['query'][_0x206b('0x1e')]);_0x1cde4f[_0x206b('0x1b')]=qs[_0x206b('0x1b')](_0x47453c[_0x206b('0x2d')][_0x206b('0x1b')]);}return _0x138f78[_0x206b('0x50')](_0x1cde4f);}})[_0x206b('0x22')](function(_0x255e89){if(_0x255e89){return _0x255e89?{'count':_0x30fc51,'rows':_0x255e89}:null;}})['then'](respondWithResult(_0x29a25d,null))[_0x206b('0x3e')](handleError(_0x29a25d,null));}; \ No newline at end of file +var _0xefec=['undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','Automation','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','update','addConditions','Condition','ids','omit','getConditions','findOne','hasOwnProperty','Action','addActions','getActions','pick','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x18ac15,_0x4f76ba){var _0x31fd73=function(_0x5112da){while(--_0x5112da){_0x18ac15['push'](_0x18ac15['shift']());}};_0x31fd73(++_0x4f76ba);}(_0xefec,0x1e3));var _0xcefe=function(_0x3df30e,_0x4c5e6f){_0x3df30e=_0x3df30e-0x0;var _0x531356=_0xefec[_0x3df30e];return _0x531356;};'use strict';var emlformat=require(_0xcefe('0x0'));var rimraf=require(_0xcefe('0x1'));var zipdir=require(_0xcefe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcefe('0x3'));var moment=require(_0xcefe('0x4'));var BPromise=require(_0xcefe('0x5'));var Mustache=require(_0xcefe('0x6'));var util=require(_0xcefe('0x7'));var path=require(_0xcefe('0x8'));var sox=require('sox');var csv=require(_0xcefe('0x9'));var ejs=require(_0xcefe('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcefe('0xb'));var crypto=require('crypto');var jsforce=require(_0xcefe('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcefe('0x9'));var querystring=require('querystring');var Papa=require(_0xcefe('0xd'));var Redis=require(_0xcefe('0xe'));var authService=require(_0xcefe('0xf'));var qs=require(_0xcefe('0x10'));var as=require(_0xcefe('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcefe('0x12'))('api');var utils=require(_0xcefe('0x13'));var config=require(_0xcefe('0x14'));var licenseUtil=require(_0xcefe('0x15'));var db=require(_0xcefe('0x16'))['db'];function respondWithStatusCode(_0x43b886,_0x32911c){_0x32911c=_0x32911c||0xcc;return function(_0x1be5d7){if(_0x1be5d7){return _0x43b886[_0xcefe('0x17')](_0x32911c);}return _0x43b886['status'](_0x32911c)[_0xcefe('0x18')]();};}function respondWithResult(_0x218850,_0x3712ed){_0x3712ed=_0x3712ed||0xc8;return function(_0x325b6c){if(_0x325b6c){return _0x218850[_0xcefe('0x19')](_0x3712ed)[_0xcefe('0x1a')](_0x325b6c);}};}function respondWithFilteredResult(_0x415616,_0x171eae){return function(_0x17e462){if(_0x17e462){var _0x42e30d=typeof _0x171eae['offset']===_0xcefe('0x1b')&&typeof _0x171eae[_0xcefe('0x1c')]===_0xcefe('0x1b');var _0x636244=_0x17e462[_0xcefe('0x1d')];var _0x56d2d7=_0x42e30d?0x0:_0x171eae[_0xcefe('0x1e')];var _0x4dee43=_0x42e30d?_0x17e462[_0xcefe('0x1d')]:_0x171eae['offset']+_0x171eae['limit'];var _0x1091c6;if(_0x4dee43>=_0x636244){_0x4dee43=_0x636244;_0x1091c6=0xc8;}else{_0x1091c6=0xce;}_0x415616[_0xcefe('0x19')](_0x1091c6);return _0x415616[_0xcefe('0x1f')](_0xcefe('0x20'),_0x56d2d7+'-'+_0x4dee43+'/'+_0x636244)[_0xcefe('0x1a')](_0x17e462);}return null;};}function patchUpdates(_0x52b135){return function(_0x4ee464){try{jsonpatch[_0xcefe('0x21')](_0x4ee464,_0x52b135,!![]);}catch(_0xf4060d){return BPromise['reject'](_0xf4060d);}return _0x4ee464[_0xcefe('0x22')]();};}function saveUpdates(_0x5a08fe,_0x4568e8){return function(_0x4d6462){if(_0x4d6462){return _0x4d6462['update'](_0x5a08fe)[_0xcefe('0x23')](function(_0x545528){return _0x545528;});}return null;};}function removeEntity(_0x4bff31,_0xe362d0){return function(_0x29b9bc){if(_0x29b9bc){return _0x29b9bc[_0xcefe('0x24')]()[_0xcefe('0x23')](function(){_0x4bff31['status'](0xcc)[_0xcefe('0x18')]();});}};}function handleEntityNotFound(_0x27afe2,_0x2af208){return function(_0x1c760c){if(!_0x1c760c){_0x27afe2[_0xcefe('0x17')](0x194);}return _0x1c760c;};}function handleError(_0x178903,_0x27abee){_0x27abee=_0x27abee||0x1f4;return function(_0xfb3995){logger[_0xcefe('0x25')](_0xfb3995[_0xcefe('0x26')]);if(_0xfb3995[_0xcefe('0x27')]){delete _0xfb3995[_0xcefe('0x27')];}_0x178903[_0xcefe('0x19')](_0x27abee)[_0xcefe('0x28')](_0xfb3995);};}exports[_0xcefe('0x29')]=function(_0x3334fe,_0xbeba97){var _0x3735b3={},_0x1be554={},_0x22bec5={'count':0x0,'rows':[]};var _0x898432=_[_0xcefe('0x2a')](db['Automation'][_0xcefe('0x2b')],function(_0x164154){return{'name':_0x164154[_0xcefe('0x2c')],'type':_0x164154[_0xcefe('0x2d')][_0xcefe('0x2e')]};});_0x1be554[_0xcefe('0x2f')]=_[_0xcefe('0x2a')](_0x898432,_0xcefe('0x27'));_0x1be554[_0xcefe('0x30')]=_['keys'](_0x3334fe[_0xcefe('0x30')]);_0x1be554[_0xcefe('0x31')]=_[_0xcefe('0x32')](_0x1be554[_0xcefe('0x2f')],_0x1be554['query']);_0x3735b3['attributes']=_[_0xcefe('0x32')](_0x1be554[_0xcefe('0x2f')],qs[_0xcefe('0x33')](_0x3334fe[_0xcefe('0x30')]['fields']));_0x3735b3[_0xcefe('0x34')]=_0x3735b3[_0xcefe('0x34')][_0xcefe('0x35')]?_0x3735b3[_0xcefe('0x34')]:_0x1be554[_0xcefe('0x2f')];if(!_0x3334fe['query']['hasOwnProperty'](_0xcefe('0x36'))){_0x3735b3['limit']=qs['limit'](_0x3334fe[_0xcefe('0x30')][_0xcefe('0x1c')]);_0x3735b3['offset']=qs['offset'](_0x3334fe[_0xcefe('0x30')][_0xcefe('0x1e')]);}_0x3735b3[_0xcefe('0x37')]=qs['sort'](_0x3334fe[_0xcefe('0x30')][_0xcefe('0x38')]);_0x3735b3['where']=qs[_0xcefe('0x31')](_['pick'](_0x3334fe['query'],_0x1be554[_0xcefe('0x31')]),_0x898432);if(_0x3334fe[_0xcefe('0x30')][_0xcefe('0x39')]){_0x3735b3[_0xcefe('0x3a')]=_[_0xcefe('0x3b')](_0x3735b3[_0xcefe('0x3a')],{'$or':_['map'](_0x898432,function(_0x5b3195){if(_0x5b3195[_0xcefe('0x2d')]!=='VIRTUAL'){var _0x153a9a={};_0x153a9a[_0x5b3195[_0xcefe('0x27')]]={'$like':'%'+_0x3334fe[_0xcefe('0x30')]['filter']+'%'};return _0x153a9a;}})});}_0x3735b3=_['merge']({},_0x3735b3,_0x3334fe['options']);var _0xc1f823={'where':_0x3735b3[_0xcefe('0x3a')]};return db[_0xcefe('0x3c')][_0xcefe('0x1d')](_0xc1f823)[_0xcefe('0x23')](function(_0x4ae582){_0x22bec5[_0xcefe('0x1d')]=_0x4ae582;if(_0x3334fe[_0xcefe('0x30')][_0xcefe('0x3d')]){_0x3735b3[_0xcefe('0x3e')]=[{'all':!![]}];}return db[_0xcefe('0x3c')][_0xcefe('0x3f')](_0x3735b3);})[_0xcefe('0x23')](function(_0x63981){_0x22bec5[_0xcefe('0x40')]=_0x63981;return _0x22bec5;})['then'](respondWithFilteredResult(_0xbeba97,_0x3735b3))[_0xcefe('0x41')](handleError(_0xbeba97,null));};exports[_0xcefe('0x42')]=function(_0x21212a,_0x4847f3){var _0x138500={'raw':![],'where':{'id':_0x21212a[_0xcefe('0x43')]['id']}},_0x4a7854={};_0x4a7854[_0xcefe('0x2f')]=_[_0xcefe('0x44')](db['Automation'][_0xcefe('0x2b')]);_0x4a7854[_0xcefe('0x30')]=_[_0xcefe('0x44')](_0x21212a['query']);_0x4a7854[_0xcefe('0x31')]=_[_0xcefe('0x32')](_0x4a7854[_0xcefe('0x2f')],_0x4a7854[_0xcefe('0x30')]);_0x138500[_0xcefe('0x34')]=_[_0xcefe('0x32')](_0x4a7854[_0xcefe('0x2f')],qs['fields'](_0x21212a['query'][_0xcefe('0x33')]));_0x138500[_0xcefe('0x34')]=_0x138500['attributes'][_0xcefe('0x35')]?_0x138500[_0xcefe('0x34')]:_0x4a7854[_0xcefe('0x2f')];if(_0x21212a['query'][_0xcefe('0x3d')]){_0x138500[_0xcefe('0x3e')]=[{'all':!![]}];}_0x138500=_['merge']({},_0x138500,_0x21212a[_0xcefe('0x45')]);return db[_0xcefe('0x3c')][_0xcefe('0x46')](_0x138500)[_0xcefe('0x23')](handleEntityNotFound(_0x4847f3,null))['then'](respondWithResult(_0x4847f3,null))['catch'](handleError(_0x4847f3,null));};exports[_0xcefe('0x47')]=function(_0x317f9b,_0x22e4af){return db[_0xcefe('0x3c')][_0xcefe('0x47')](_0x317f9b[_0xcefe('0x48')],{})[_0xcefe('0x23')](respondWithResult(_0x22e4af,0xc9))[_0xcefe('0x41')](handleError(_0x22e4af,null));};exports[_0xcefe('0x49')]=function(_0x241b9d,_0x528ab3){if(_0x241b9d[_0xcefe('0x48')]['id']){delete _0x241b9d[_0xcefe('0x48')]['id'];}return db[_0xcefe('0x3c')][_0xcefe('0x46')]({'where':{'id':_0x241b9d[_0xcefe('0x43')]['id']}})[_0xcefe('0x23')](handleEntityNotFound(_0x528ab3,null))[_0xcefe('0x23')](saveUpdates(_0x241b9d[_0xcefe('0x48')],null))['then'](respondWithResult(_0x528ab3,null))[_0xcefe('0x41')](handleError(_0x528ab3,null));};exports[_0xcefe('0x24')]=function(_0x121d28,_0x5adad0){return db[_0xcefe('0x3c')]['find']({'where':{'id':_0x121d28[_0xcefe('0x43')]['id']}})[_0xcefe('0x23')](handleEntityNotFound(_0x5adad0,null))['then'](removeEntity(_0x5adad0,null))[_0xcefe('0x41')](handleError(_0x5adad0,null));};exports[_0xcefe('0x4a')]=function(_0x458782,_0x24b512,_0x3089c5){return db[_0xcefe('0x4b')]['find']({'where':{'id':_0x458782[_0xcefe('0x43')]['id']}})[_0xcefe('0x23')](handleEntityNotFound(_0x24b512,null))[_0xcefe('0x23')](function(_0x1ed051){if(_0x1ed051){return _0x1ed051[_0xcefe('0x4a')](_0x458782[_0xcefe('0x48')][_0xcefe('0x4c')],_[_0xcefe('0x4d')](_0x458782['body'],[_0xcefe('0x4c'),'id'])||{});}})[_0xcefe('0x23')](respondWithResult(_0x24b512,null))[_0xcefe('0x41')](handleError(_0x24b512,null));};exports[_0xcefe('0x4e')]=function(_0x873290,_0x13b15d,_0x3992ae){var _0x4979ba={};var _0x21132c={};var _0x1659fe;var _0x5ba35e;return db[_0xcefe('0x3c')][_0xcefe('0x4f')]({'where':{'id':_0x873290[_0xcefe('0x43')]['id']}})[_0xcefe('0x23')](handleEntityNotFound(_0x13b15d,null))[_0xcefe('0x23')](function(_0x21fe8d){if(_0x21fe8d){_0x1659fe=_0x21fe8d;_0x21132c[_0xcefe('0x2f')]=_['keys'](db[_0xcefe('0x4b')][_0xcefe('0x2b')]);_0x21132c[_0xcefe('0x30')]=_[_0xcefe('0x44')](_0x873290[_0xcefe('0x30')]);_0x21132c[_0xcefe('0x31')]=_[_0xcefe('0x32')](_0x21132c['model'],_0x21132c[_0xcefe('0x30')]);_0x4979ba['attributes']=_[_0xcefe('0x32')](_0x21132c[_0xcefe('0x2f')],qs[_0xcefe('0x33')](_0x873290['query'][_0xcefe('0x33')]));_0x4979ba['attributes']=_0x4979ba['attributes'][_0xcefe('0x35')]?_0x4979ba[_0xcefe('0x34')]:_0x21132c[_0xcefe('0x2f')];_0x4979ba[_0xcefe('0x37')]=qs['sort'](_0x873290[_0xcefe('0x30')]['sort']);_0x4979ba['where']=qs[_0xcefe('0x31')](_['pick'](_0x873290[_0xcefe('0x30')],_0x21132c[_0xcefe('0x31')]));if(_0x873290[_0xcefe('0x30')][_0xcefe('0x39')]){_0x4979ba[_0xcefe('0x3a')]=_[_0xcefe('0x3b')](_0x4979ba[_0xcefe('0x3a')],{'$or':_[_0xcefe('0x2a')](_0x4979ba['attributes'],function(_0x50a0c8){var _0x11d2ee={};_0x11d2ee[_0x50a0c8]={'$like':'%'+_0x873290[_0xcefe('0x30')][_0xcefe('0x39')]+'%'};return _0x11d2ee;})});}_0x4979ba=_['merge']({},_0x4979ba,_0x873290[_0xcefe('0x45')]);return _0x1659fe[_0xcefe('0x4e')](_0x4979ba);}})['then'](function(_0x5d4411){if(_0x5d4411){_0x5ba35e=_0x5d4411[_0xcefe('0x35')];if(!_0x873290[_0xcefe('0x30')][_0xcefe('0x50')](_0xcefe('0x36'))){_0x4979ba['limit']=qs[_0xcefe('0x1c')](_0x873290['query'][_0xcefe('0x1c')]);_0x4979ba['offset']=qs[_0xcefe('0x1e')](_0x873290[_0xcefe('0x30')]['offset']);}return _0x1659fe['getConditions'](_0x4979ba);}})[_0xcefe('0x23')](function(_0x1e0b4e){if(_0x1e0b4e){return _0x1e0b4e?{'count':_0x5ba35e,'rows':_0x1e0b4e}:null;}})[_0xcefe('0x23')](respondWithResult(_0x13b15d,null))[_0xcefe('0x41')](handleError(_0x13b15d,null));};exports['addActions']=function(_0x54d181,_0x37a06b,_0x37dc87){return db[_0xcefe('0x51')][_0xcefe('0x46')]({'where':{'id':_0x54d181['params']['id']}})[_0xcefe('0x23')](handleEntityNotFound(_0x37a06b,null))[_0xcefe('0x23')](function(_0x180ae7){if(_0x180ae7){return _0x180ae7[_0xcefe('0x52')](_0x54d181[_0xcefe('0x48')][_0xcefe('0x4c')],_['omit'](_0x54d181[_0xcefe('0x48')],['ids','id'])||{});}})[_0xcefe('0x23')](respondWithResult(_0x37a06b,null))['catch'](handleError(_0x37a06b,null));};exports[_0xcefe('0x53')]=function(_0x4c2be0,_0x4446ff,_0xc0930b){var _0x105c79={};var _0x4f6e2d={};var _0x3806e9;var _0x2b84bf;return db['Automation'][_0xcefe('0x4f')]({'where':{'id':_0x4c2be0['params']['id']}})['then'](handleEntityNotFound(_0x4446ff,null))[_0xcefe('0x23')](function(_0x53ddb5){if(_0x53ddb5){_0x3806e9=_0x53ddb5;_0x4f6e2d[_0xcefe('0x2f')]=_[_0xcefe('0x44')](db[_0xcefe('0x51')]['rawAttributes']);_0x4f6e2d[_0xcefe('0x30')]=_[_0xcefe('0x44')](_0x4c2be0[_0xcefe('0x30')]);_0x4f6e2d[_0xcefe('0x31')]=_[_0xcefe('0x32')](_0x4f6e2d['model'],_0x4f6e2d[_0xcefe('0x30')]);_0x105c79['attributes']=_[_0xcefe('0x32')](_0x4f6e2d[_0xcefe('0x2f')],qs[_0xcefe('0x33')](_0x4c2be0['query'][_0xcefe('0x33')]));_0x105c79['attributes']=_0x105c79[_0xcefe('0x34')][_0xcefe('0x35')]?_0x105c79['attributes']:_0x4f6e2d['model'];_0x105c79['order']=qs[_0xcefe('0x38')](_0x4c2be0[_0xcefe('0x30')]['sort']);_0x105c79[_0xcefe('0x3a')]=qs[_0xcefe('0x31')](_[_0xcefe('0x54')](_0x4c2be0[_0xcefe('0x30')],_0x4f6e2d[_0xcefe('0x31')]));if(_0x4c2be0[_0xcefe('0x30')][_0xcefe('0x39')]){_0x105c79[_0xcefe('0x3a')]=_['merge'](_0x105c79[_0xcefe('0x3a')],{'$or':_[_0xcefe('0x2a')](_0x105c79[_0xcefe('0x34')],function(_0x5c6dd8){var _0x59e5b2={};_0x59e5b2[_0x5c6dd8]={'$like':'%'+_0x4c2be0['query'][_0xcefe('0x39')]+'%'};return _0x59e5b2;})});}_0x105c79=_[_0xcefe('0x3b')]({},_0x105c79,_0x4c2be0[_0xcefe('0x45')]);return _0x3806e9[_0xcefe('0x53')](_0x105c79);}})[_0xcefe('0x23')](function(_0x52aae9){if(_0x52aae9){_0x2b84bf=_0x52aae9[_0xcefe('0x35')];if(!_0x4c2be0[_0xcefe('0x30')][_0xcefe('0x50')](_0xcefe('0x36'))){_0x105c79[_0xcefe('0x1c')]=qs['limit'](_0x4c2be0[_0xcefe('0x30')]['limit']);_0x105c79[_0xcefe('0x1e')]=qs['offset'](_0x4c2be0[_0xcefe('0x30')][_0xcefe('0x1e')]);}return _0x3806e9[_0xcefe('0x53')](_0x105c79);}})['then'](function(_0x31d69b){if(_0x31d69b){return _0x31d69b?{'count':_0x2b84bf,'rows':_0x31d69b}:null;}})[_0xcefe('0x23')](respondWithResult(_0x4446ff,null))[_0xcefe('0x41')](handleError(_0x4446ff,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 9bb46de..dafa315 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 _0x48bb=['tools_automations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','define','Automation'];(function(_0x499c7f,_0x2d8184){var _0x433bee=function(_0xd1543a){while(--_0xd1543a){_0x499c7f['push'](_0x499c7f['shift']());}};_0x433bee(++_0x2d8184);}(_0x48bb,0x1c3));var _0xb48b=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0x48bb[_0x496738];return _0xee1381;};'use strict';var _=require(_0xb48b('0x0'));var util=require(_0xb48b('0x1'));var logger=require(_0xb48b('0x2'))('api');var moment=require(_0xb48b('0x3'));var BPromise=require(_0xb48b('0x4'));var rp=require(_0xb48b('0x5'));var fs=require('fs');var path=require(_0xb48b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./automation.attributes');module['exports']=function(_0xdaa15a,_0x2d9151){return _0xdaa15a[_0xb48b('0x7')](_0xb48b('0x8'),attributes,{'tableName':_0xb48b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7535=['../../config/environment','./automation.attributes','define','Automation','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0x7535,0x7c));var _0x5753=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0x7535[_0x519756];return _0x37047e;};'use strict';var _=require(_0x5753('0x0'));var util=require(_0x5753('0x1'));var logger=require(_0x5753('0x2'))('api');var moment=require(_0x5753('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5753('0x4'));var rimraf=require(_0x5753('0x5'));var config=require(_0x5753('0x6'));var attributes=require(_0x5753('0x7'));module['exports']=function(_0x119701,_0x5960dc){return _0x119701[_0x5753('0x8')](_0x5753('0x9'),attributes,{'tableName':'tools_automations','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 328adf6..db3e946 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 _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x2645e6,_0x195163){var _0x4eedf1=function(_0x145fd1){while(--_0x145fd1){_0x2645e6['push'](_0x2645e6['shift']());}};_0x4eedf1(++_0x195163);}(_0x14a0,0x8e));var _0x014a=function(_0x3e3226,_0x360a09){_0x3e3226=_0x3e3226-0x0;var _0x3ac72a=_0x14a0[_0x3e3226];return _0x3ac72a;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('Automation,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('Automation,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file +var _0x98d8=['randomstring','ioredis','../../mysqldb','rpc','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x17c1da,_0x36ecce){var _0x5552f5=function(_0x1cfc88){while(--_0x1cfc88){_0x17c1da['push'](_0x17c1da['shift']());}};_0x5552f5(++_0x36ecce);}(_0x98d8,0xce));var _0x898d=function(_0x295b1a,_0x1e31a){_0x295b1a=_0x295b1a-0x0;var _0x2bb42b=_0x98d8[_0x295b1a];return _0x2bb42b;};'use strict';var _=require(_0x898d('0x0'));var util=require(_0x898d('0x1'));var moment=require(_0x898d('0x2'));var BPromise=require(_0x898d('0x3'));var rs=require(_0x898d('0x4'));var fs=require('fs');var Redis=require(_0x898d('0x5'));var db=require(_0x898d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x898d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x898d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16b99a,_0x4e8c68,_0x1de5df){return new BPromise(function(_0x4fe1bf,_0x3e9ba6){return client[_0x898d('0x9')](_0x16b99a,_0x1de5df)[_0x898d('0xa')](function(_0x40f217){logger[_0x898d('0xb')](_0x898d('0xc'),_0x4e8c68,_0x898d('0xd'));logger[_0x898d('0xe')](_0x898d('0xf'),_0x4e8c68,_0x898d('0xd'),JSON[_0x898d('0x10')](_0x40f217));if(_0x40f217[_0x898d('0x11')]){if(_0x40f217[_0x898d('0x11')][_0x898d('0x12')]===0x1f4){logger[_0x898d('0x11')]('Automation,\x20%s,\x20%s',_0x4e8c68,_0x40f217[_0x898d('0x11')][_0x898d('0x13')]);return _0x3e9ba6(_0x40f217['error'][_0x898d('0x13')]);}logger[_0x898d('0x11')](_0x898d('0xc'),_0x4e8c68,_0x40f217[_0x898d('0x11')][_0x898d('0x13')]);return _0x4fe1bf(_0x40f217[_0x898d('0x11')][_0x898d('0x13')]);}else{logger['info'](_0x898d('0xc'),_0x4e8c68,_0x898d('0xd'));_0x4fe1bf(_0x40f217['result']['message']);}})[_0x898d('0x14')](function(_0x42a098){logger[_0x898d('0x11')](_0x898d('0xc'),_0x4e8c68,_0x42a098);_0x3e9ba6(_0x42a098);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index d629e56..17e7342 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 _0x6208=['index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','update','delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated'];(function(_0xaf158f,_0x1f7500){var _0x3bef5d=function(_0x272859){while(--_0x272859){_0xaf158f['push'](_0xaf158f['shift']());}};_0x3bef5d(++_0x1f7500);}(_0x6208,0x17d));var _0x8620=function(_0x3f2228,_0x3b27d5){_0x3f2228=_0x3f2228-0x0;var _0x285ae4=_0x6208[_0x3f2228];return _0x285ae4;};'use strict';var multer=require(_0x8620('0x0'));var util=require('util');var path=require(_0x8620('0x1'));var timeout=require(_0x8620('0x2'));var express=require('express');var router=express[_0x8620('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8620('0x4'));var interaction=require(_0x8620('0x5'));var config=require(_0x8620('0x6'));var controller=require(_0x8620('0x7'));router[_0x8620('0x8')]('/',auth[_0x8620('0x9')](),controller[_0x8620('0xa')]);router['get'](_0x8620('0xb'),auth[_0x8620('0x9')](),controller[_0x8620('0xc')]);router[_0x8620('0x8')](_0x8620('0xd'),auth[_0x8620('0x9')](),controller[_0x8620('0xe')]);router[_0x8620('0x8')](_0x8620('0xf'),auth['isAuthenticated'](),controller[_0x8620('0x10')]);router[_0x8620('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8620('0x11')](_0x8620('0xd'),auth[_0x8620('0x9')](),controller[_0x8620('0x12')]);router[_0x8620('0x11')](_0x8620('0xf'),auth['isAuthenticated'](),controller[_0x8620('0x13')]);router['put'](_0x8620('0xb'),auth[_0x8620('0x9')](),controller[_0x8620('0x14')]);router[_0x8620('0x15')]('/:id',auth[_0x8620('0x9')](),controller[_0x8620('0x16')]);module['exports']=router; \ No newline at end of file +var _0xbab0=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x5f42f1,_0x956be5){var _0x5534ee=function(_0x532333){while(--_0x532333){_0x5f42f1['push'](_0x5f42f1['shift']());}};_0x5534ee(++_0x956be5);}(_0xbab0,0x183));var _0x0bab=function(_0x5f5205,_0x6c342){_0x5f5205=_0x5f5205-0x0;var _0x2dcf9f=_0xbab0[_0x5f5205];return _0x2dcf9f;};'use strict';var multer=require(_0x0bab('0x0'));var util=require(_0x0bab('0x1'));var path=require(_0x0bab('0x2'));var timeout=require(_0x0bab('0x3'));var express=require('express');var router=express[_0x0bab('0x4')]();var fs_extra=require(_0x0bab('0x5'));var auth=require(_0x0bab('0x6'));var interaction=require(_0x0bab('0x7'));var config=require(_0x0bab('0x8'));var controller=require(_0x0bab('0x9'));router[_0x0bab('0xa')]('/',auth[_0x0bab('0xb')](),controller[_0x0bab('0xc')]);router[_0x0bab('0xa')]('/:id',auth[_0x0bab('0xb')](),controller[_0x0bab('0xd')]);router['get'](_0x0bab('0xe'),auth[_0x0bab('0xb')](),controller[_0x0bab('0xf')]);router[_0x0bab('0xa')](_0x0bab('0x10'),auth['isAuthenticated'](),controller[_0x0bab('0x11')]);router[_0x0bab('0x12')]('/',auth[_0x0bab('0xb')](),controller[_0x0bab('0x13')]);router['post'](_0x0bab('0xe'),auth[_0x0bab('0xb')](),controller['addConditions']);router[_0x0bab('0x12')](_0x0bab('0x10'),auth[_0x0bab('0xb')](),controller[_0x0bab('0x14')]);router['put'](_0x0bab('0x15'),auth[_0x0bab('0xb')](),controller[_0x0bab('0x16')]);router[_0x0bab('0x17')](_0x0bab('0x15'),auth[_0x0bab('0xb')](),controller[_0x0bab('0x18')]);module[_0x0bab('0x19')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index fb66b3c..ac1e895 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 _0xb8ae=['always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','name','ENUM','STRING','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xb8ae,0x1c0));var _0xeb8a=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xb8ae[_0x35885a];return _0xe86249;};'use strict';var Sequelize=require('sequelize');module[_0xeb8a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xeb8a('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xeb8a('0x2')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xeb8a('0x3')]},'active':{'type':Sequelize[_0xeb8a('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xeb8a('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xeb8a('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xeb8a('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xeb8a('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0xeb8a('0x5')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xeb8a('0x5')](0x3)[_0xeb8a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeb8a('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xeb8a('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeb8a('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0xeb8a('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeb8a('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xeb8a('0x5')](0x5)[_0xeb8a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xeb8a('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeb8a('0xb')},'dialGlobalMaxRetry':{'type':Sequelize[_0xeb8a('0x5')](0x3)[_0xeb8a('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xeb8a('0xc')},'dialTimezone':{'type':Sequelize[_0xeb8a('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xeb8a('0x3')],'defaultValue':_0xeb8a('0xd')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xeb8a('0xe'),_0xeb8a('0xf'),_0xeb8a('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xeb8a('0x4')],'defaultValue':0x0,'comment':_0xeb8a('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xeb8a('0x5')](0x9)[_0xeb8a('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xeb8a('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xeb8a('0x5')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xeb8a('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xeb8a('0x5')](0x9)[_0xeb8a('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xeb8a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xeb8a('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0xeb8a('0x5')](0x9)[_0xeb8a('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xeb8a('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xeb8a('0x5')](0x9)[_0xeb8a('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xeb8a('0x5')](0x5)[_0xeb8a('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xeb8a('0x5')](0x9)[_0xeb8a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xeb8a('0x15'),'ASC'),'defaultValue':_0xeb8a('0x15')},'dialPrefix':{'type':Sequelize[_0xeb8a('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xeb8a('0x5')](0x3)[_0xeb8a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xeb8a('0x16')},'dialCutDigit':{'type':Sequelize[_0xeb8a('0x5')](0x3)[_0xeb8a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xeb8a('0x17')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xeb8a('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeb8a('0x18')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xeb8a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeb8a('0x19')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeb8a('0x1a')},'dialDropRetryFrequency':{'type':Sequelize[_0xeb8a('0x5')](0x5)[_0xeb8a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeb8a('0x1b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xeb8a('0x5')](0x3)[_0xeb8a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeb8a('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeb8a('0x1d')},'dialMachineMaxRetry':{'type':Sequelize[_0xeb8a('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xeb8a('0x5')](0x5)[_0xeb8a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeb8a('0x1e')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xeb8a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeb8a('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xeb8a('0x5')](0x5)[_0xeb8a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeb8a('0x20')}}; \ No newline at end of file +var _0xaa56=['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)','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','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\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)'];(function(_0x165f01,_0x368fe0){var _0x425b96=function(_0x2425a7){while(--_0x2425a7){_0x165f01['push'](_0x165f01['shift']());}};_0x425b96(++_0x368fe0);}(_0xaa56,0xc6));var _0x6aa5=function(_0x375c6c,_0x48b546){_0x375c6c=_0x375c6c-0x0;var _0x42ef3e=_0xaa56[_0x375c6c];return _0x42ef3e;};'use strict';var Sequelize=require('sequelize');module[_0x6aa5('0x0')]={'name':{'type':Sequelize[_0x6aa5('0x1')],'unique':_0x6aa5('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x6aa5('0x3')),'allowNull':![],'defaultValue':_0x6aa5('0x3')},'description':{'type':Sequelize[_0x6aa5('0x1')]},'active':{'type':Sequelize[_0x6aa5('0x4')],'defaultValue':0x0,'comment':_0x6aa5('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x6aa5('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x6aa5('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6aa5('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x6aa5('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6aa5('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x6aa5('0x8')](0x3)[_0x6aa5('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6aa5('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6aa5('0x8')](0x5)[_0x6aa5('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6aa5('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x6aa5('0x8')](0x3)[_0x6aa5('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6aa5('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x6aa5('0x8')](0x5)[_0x6aa5('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6aa5('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6aa5('0x6')],'defaultValue':0x3,'comment':_0x6aa5('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6aa5('0x8')](0x5)[_0x6aa5('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x6aa5('0xe')},'dialTimezone':{'type':Sequelize[_0x6aa5('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6aa5('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x6aa5('0xf')](_0x6aa5('0x10'),'never',_0x6aa5('0x11')),'defaultValue':_0x6aa5('0x10')},'dialAMDActive':{'type':Sequelize[_0x6aa5('0x4')],'defaultValue':0x0,'comment':_0x6aa5('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x6aa5('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x6aa5('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x6aa5('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6aa5('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x6aa5('0x8')](0x9)[_0x6aa5('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x6aa5('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6aa5('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x6aa5('0x8')](0x9)[_0x6aa5('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6aa5('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x6aa5('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6aa5('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6aa5('0x8')](0x5)[_0x6aa5('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6aa5('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x6aa5('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x6aa5('0xf')]('DESC',_0x6aa5('0x1a')),'defaultValue':_0x6aa5('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x6aa5('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6aa5('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x6aa5('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6aa5('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x6aa5('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6aa5('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x6aa5('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6aa5('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6aa5('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x6aa5('0x8')](0x5)[_0x6aa5('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6aa5('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6aa5('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6aa5('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x6aa5('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6aa5('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x6aa5('0x8')](0x5)[_0x6aa5('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6aa5('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6aa5('0x8')](0x3)[_0x6aa5('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6aa5('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6aa5('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6aa5('0x26')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 2caa45e..34312e6 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 _0x3dbc=['COALESCE(phone,\x27\x27)','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','get','role','IvrCampaigns','UserProfileSection','userProfileId','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','hasOwnProperty','CampaignId','CmHopper','findAll','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen'];(function(_0x5be6d2,_0xaf1bd1){var _0x4dcb20=function(_0x13e62d){while(--_0x13e62d){_0x5be6d2['push'](_0x5be6d2['shift']());}};_0x4dcb20(++_0xaf1bd1);}(_0x3dbc,0x1a1));var _0xc3db=function(_0x2f6233,_0x90172){_0x2f6233=_0x2f6233-0x0;var _0x1c9c36=_0x3dbc[_0x2f6233];return _0x1c9c36;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc3db('0x0'));var zipdir=require(_0xc3db('0x1'));var jsonpatch=require(_0xc3db('0x2'));var rp=require(_0xc3db('0x3'));var moment=require(_0xc3db('0x4'));var BPromise=require(_0xc3db('0x5'));var Mustache=require(_0xc3db('0x6'));var util=require('util');var path=require(_0xc3db('0x7'));var sox=require(_0xc3db('0x8'));var csv=require(_0xc3db('0x9'));var ejs=require(_0xc3db('0xa'));var fs=require('fs');var fs_extra=require(_0xc3db('0xb'));var _=require(_0xc3db('0xc'));var squel=require(_0xc3db('0xd'));var crypto=require(_0xc3db('0xe'));var jsforce=require(_0xc3db('0xf'));var deskjs=require(_0xc3db('0x10'));var toCsv=require(_0xc3db('0x9'));var querystring=require('querystring');var Papa=require(_0xc3db('0x11'));var Redis=require('ioredis');var authService=require(_0xc3db('0x12'));var qs=require(_0xc3db('0x13'));var as=require(_0xc3db('0x14'));var hardwareService=require(_0xc3db('0x15'));var logger=require(_0xc3db('0x16'))('api');var utils=require(_0xc3db('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc3db('0x18'))['db'];function respondWithStatusCode(_0x590875,_0x1ff546){_0x1ff546=_0x1ff546||0xcc;return function(_0x18d13e){if(_0x18d13e){return _0x590875[_0xc3db('0x19')](_0x1ff546);}return _0x590875[_0xc3db('0x1a')](_0x1ff546)['end']();};}function respondWithResult(_0x2c8bcc,_0x5c0e4c){_0x5c0e4c=_0x5c0e4c||0xc8;return function(_0x29c468){if(_0x29c468){return _0x2c8bcc[_0xc3db('0x1a')](_0x5c0e4c)[_0xc3db('0x1b')](_0x29c468);}};}function respondWithFilteredResult(_0xbe5600,_0x2eb288){return function(_0xacafd2){if(_0xacafd2){var _0x302f32=typeof _0x2eb288[_0xc3db('0x1c')]===_0xc3db('0x1d')&&typeof _0x2eb288['limit']===_0xc3db('0x1d');var _0x285721=_0xacafd2[_0xc3db('0x1e')];var _0x1fdadc=_0x302f32?0x0:_0x2eb288[_0xc3db('0x1c')];var _0x1a719b=_0x302f32?_0xacafd2[_0xc3db('0x1e')]:_0x2eb288[_0xc3db('0x1c')]+_0x2eb288[_0xc3db('0x1f')];var _0x4c7f23;if(_0x1a719b>=_0x285721){_0x1a719b=_0x285721;_0x4c7f23=0xc8;}else{_0x4c7f23=0xce;}_0xbe5600[_0xc3db('0x1a')](_0x4c7f23);return _0xbe5600['set'](_0xc3db('0x20'),_0x1fdadc+'-'+_0x1a719b+'/'+_0x285721)[_0xc3db('0x1b')](_0xacafd2);}return null;};}function patchUpdates(_0x186f73){return function(_0x58e878){try{jsonpatch[_0xc3db('0x21')](_0x58e878,_0x186f73,!![]);}catch(_0x20240e){return BPromise[_0xc3db('0x22')](_0x20240e);}return _0x58e878[_0xc3db('0x23')]();};}function saveUpdates(_0x3d1f84,_0x51b204){return function(_0x582194){if(_0x582194){return _0x582194[_0xc3db('0x24')](_0x3d1f84)[_0xc3db('0x25')](function(_0x1be8e3){return _0x1be8e3;});}return null;};}function removeEntity(_0x4f924c,_0x4c249b){return function(_0x3d2b9f){if(_0x3d2b9f){return _0x3d2b9f[_0xc3db('0x26')]()[_0xc3db('0x25')](function(){var _0x975db8=_0x3d2b9f['get']({'plain':!![]});var _0x543c40='IvrCampaigns';return db[_0xc3db('0x27')][_0xc3db('0x26')]({'where':{'type':_0x543c40,'resourceId':_0x975db8['id']}})[_0xc3db('0x25')](function(){return _0x3d2b9f;});})[_0xc3db('0x25')](function(){_0x4f924c[_0xc3db('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7648d,_0x56f270){return function(_0x113d14){if(!_0x113d14){_0x7648d[_0xc3db('0x19')](0x194);}return _0x113d14;};}function handleError(_0x183892,_0x481bd1){_0x481bd1=_0x481bd1||0x1f4;return function(_0x7d83d3){logger['error'](_0x7d83d3[_0xc3db('0x28')]);if(_0x7d83d3[_0xc3db('0x29')]){delete _0x7d83d3[_0xc3db('0x29')];}_0x183892[_0xc3db('0x1a')](_0x481bd1)[_0xc3db('0x2a')](_0x7d83d3);};}exports[_0xc3db('0x2b')]=function(_0x39f080,_0x47e6ca){var _0x54f7ff={},_0x5d8227={},_0x10e257={'count':0x0,'rows':[]};var _0x2748da=_[_0xc3db('0x2c')](db[_0xc3db('0x2d')][_0xc3db('0x2e')],function(_0x39f950){return{'name':_0x39f950[_0xc3db('0x2f')],'type':_0x39f950[_0xc3db('0x30')][_0xc3db('0x31')]};});_0x5d8227[_0xc3db('0x32')]=_['map'](_0x2748da,'name');_0x5d8227[_0xc3db('0x33')]=_[_0xc3db('0x34')](_0x39f080['query']);_0x5d8227['filters']=_[_0xc3db('0x35')](_0x5d8227[_0xc3db('0x32')],_0x5d8227['query']);_0x54f7ff[_0xc3db('0x36')]=_['intersection'](_0x5d8227[_0xc3db('0x32')],qs[_0xc3db('0x37')](_0x39f080[_0xc3db('0x33')][_0xc3db('0x37')]));_0x54f7ff[_0xc3db('0x36')]=_0x54f7ff[_0xc3db('0x36')]['length']?_0x54f7ff[_0xc3db('0x36')]:_0x5d8227['model'];if(!_0x39f080[_0xc3db('0x33')]['hasOwnProperty'](_0xc3db('0x38'))){_0x54f7ff['limit']=qs[_0xc3db('0x1f')](_0x39f080[_0xc3db('0x33')][_0xc3db('0x1f')]);_0x54f7ff['offset']=qs[_0xc3db('0x1c')](_0x39f080[_0xc3db('0x33')][_0xc3db('0x1c')]);}_0x54f7ff[_0xc3db('0x39')]=qs[_0xc3db('0x3a')](_0x39f080[_0xc3db('0x33')][_0xc3db('0x3a')]);_0x54f7ff['where']=qs[_0xc3db('0x3b')](_[_0xc3db('0x3c')](_0x39f080[_0xc3db('0x33')],_0x5d8227['filters']),_0x2748da);if(_0x39f080['query'][_0xc3db('0x3d')]){_0x54f7ff['where']=_[_0xc3db('0x3e')](_0x54f7ff[_0xc3db('0x3f')],{'$or':_[_0xc3db('0x2c')](_0x2748da,function(_0x30d9ec){if(_0x30d9ec[_0xc3db('0x30')]!==_0xc3db('0x40')){var _0x52f359={};_0x52f359[_0x30d9ec[_0xc3db('0x29')]]={'$like':'%'+_0x39f080[_0xc3db('0x33')][_0xc3db('0x3d')]+'%'};return _0x52f359;}})});}_0x54f7ff=_[_0xc3db('0x3e')]({},_0x54f7ff,_0x39f080[_0xc3db('0x41')]);var _0x1c3b61={'where':_0x54f7ff[_0xc3db('0x3f')]};return db[_0xc3db('0x2d')][_0xc3db('0x1e')](_0x1c3b61)[_0xc3db('0x25')](function(_0x4d43b0){_0x10e257['count']=_0x4d43b0;if(_0x39f080['query'][_0xc3db('0x42')]){_0x54f7ff[_0xc3db('0x43')]=[{'all':!![]}];}return db[_0xc3db('0x2d')]['findAll'](_0x54f7ff);})[_0xc3db('0x25')](function(_0x474ca5){_0x10e257[_0xc3db('0x44')]=_0x474ca5;return _0x10e257;})[_0xc3db('0x25')](respondWithFilteredResult(_0x47e6ca,_0x54f7ff))[_0xc3db('0x45')](handleError(_0x47e6ca,null));};exports[_0xc3db('0x46')]=function(_0x2559c5,_0x38cbb9){var _0xfe398b={'raw':![],'where':{'id':_0x2559c5[_0xc3db('0x47')]['id']}},_0x424243={};_0x424243['model']=_[_0xc3db('0x34')](db[_0xc3db('0x2d')][_0xc3db('0x2e')]);_0x424243[_0xc3db('0x33')]=_[_0xc3db('0x34')](_0x2559c5['query']);_0x424243['filters']=_['intersection'](_0x424243[_0xc3db('0x32')],_0x424243[_0xc3db('0x33')]);_0xfe398b[_0xc3db('0x36')]=_['intersection'](_0x424243[_0xc3db('0x32')],qs[_0xc3db('0x37')](_0x2559c5[_0xc3db('0x33')][_0xc3db('0x37')]));_0xfe398b[_0xc3db('0x36')]=_0xfe398b[_0xc3db('0x36')][_0xc3db('0x48')]?_0xfe398b['attributes']:_0x424243[_0xc3db('0x32')];if(_0x2559c5[_0xc3db('0x33')]['includeAll']){_0xfe398b['include']=[{'all':!![]}];}_0xfe398b=_[_0xc3db('0x3e')]({},_0xfe398b,_0x2559c5[_0xc3db('0x41')]);return db[_0xc3db('0x2d')][_0xc3db('0x49')](_0xfe398b)[_0xc3db('0x25')](handleEntityNotFound(_0x38cbb9,null))[_0xc3db('0x25')](respondWithResult(_0x38cbb9,null))['catch'](handleError(_0x38cbb9,null));};exports[_0xc3db('0x4a')]=function(_0x3cb093,_0x1f0521){return db[_0xc3db('0x2d')]['create'](_0x3cb093['body'],{})[_0xc3db('0x25')](function(_0x234970){var _0x254467=_0x3cb093['user'][_0xc3db('0x4b')]({'plain':!![]});if(!_0x254467)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x254467[_0xc3db('0x4c')]==='user'){var _0x1ab554=_0x234970[_0xc3db('0x4b')]({'plain':!![]});var _0x240815=_0xc3db('0x4d');return db[_0xc3db('0x4e')][_0xc3db('0x49')]({'where':{'name':_0x240815,'userProfileId':_0x254467[_0xc3db('0x4f')]},'raw':!![]})['then'](function(_0x257382){if(_0x257382&&_0x257382['autoAssociation']===0x0){return db[_0xc3db('0x27')]['create']({'name':_0x1ab554[_0xc3db('0x29')],'resourceId':_0x1ab554['id'],'type':_0x257382[_0xc3db('0x29')],'sectionId':_0x257382['id']},{})[_0xc3db('0x25')](function(){return _0x234970;});}else{return _0x234970;}})[_0xc3db('0x45')](function(_0x14eb0f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14eb0f);throw _0x14eb0f;});}return _0x234970;})[_0xc3db('0x25')](respondWithResult(_0x1f0521,0xc9))[_0xc3db('0x45')](handleError(_0x1f0521,null));};exports['clone']=function(_0x218d49,_0x445bea){var _0x174e5a={'where':{'id':_0x218d49[_0xc3db('0x47')]['id']}},_0x311803={};_0x311803['model']=_[_0xc3db('0x34')](db[_0xc3db('0x2d')][_0xc3db('0x2e')]);_0x174e5a[_0xc3db('0x36')]=_[_0xc3db('0x35')](_0x311803['model'],qs[_0xc3db('0x37')](_0x218d49[_0xc3db('0x33')][_0xc3db('0x37')]));_0x174e5a[_0xc3db('0x36')]=_0x174e5a['attributes'][_0xc3db('0x48')]?_0x174e5a['attributes']:_0x311803[_0xc3db('0x32')];if(_0x218d49[_0xc3db('0x33')][_0xc3db('0x42')]){_0x174e5a[_0xc3db('0x43')]=[{'all':!![]}];}_0x174e5a=_[_0xc3db('0x3e')]({},_0x174e5a,_0x218d49['options']);return db[_0xc3db('0x2d')][_0xc3db('0x49')](_0x174e5a)['then'](handleEntityNotFound(_0x445bea,null))['then'](function(_0x581bcb){if(_0x581bcb){var _0x5e0f49=_0x581bcb[_0xc3db('0x4b')]({'plain':!![]});_0x5e0f49=qs[_0xc3db('0x50')](_0x5e0f49,['id',_0xc3db('0x51'),_0xc3db('0x52')]);_0x218d49['body']=_['omit'](_0x218d49['body'],['id',_0xc3db('0x51'),_0xc3db('0x52')]);return db[_0xc3db('0x2d')]['create'](_[_0xc3db('0x3e')](_0x5e0f49,_0x218d49[_0xc3db('0x53')]),{'include':_0x218d49[_0xc3db('0x33')][_0xc3db('0x42')]?[{'all':!![]}]:undefined})[_0xc3db('0x25')](function(_0x490bfc){var _0x51f362=_0x218d49[_0xc3db('0x54')][_0xc3db('0x4b')]({'plain':!![]});if(!_0x51f362)throw new Error(_0xc3db('0x55'));if(_0x51f362[_0xc3db('0x4c')]===_0xc3db('0x54')){var _0x4dbd10=_0x490bfc[_0xc3db('0x4b')]({'plain':!![]});var _0x3d59d1=_0xc3db('0x4d');return db[_0xc3db('0x4e')][_0xc3db('0x49')]({'where':{'name':_0x3d59d1,'userProfileId':_0x51f362[_0xc3db('0x4f')]},'raw':!![]})['then'](function(_0x3bd94d){if(_0x3bd94d&&_0x3bd94d[_0xc3db('0x56')]===0x0){return db['UserProfileResource'][_0xc3db('0x4a')]({'name':_0x4dbd10[_0xc3db('0x29')],'resourceId':_0x4dbd10['id'],'type':_0x3bd94d[_0xc3db('0x29')],'sectionId':_0x3bd94d['id']},{})[_0xc3db('0x25')](function(){return _0x490bfc;});}else{return _0x490bfc;}})[_0xc3db('0x45')](function(_0xf352ad){logger[_0xc3db('0x57')](_0xc3db('0x58'),_0xf352ad);throw _0xf352ad;});}return _0x490bfc;});}})[_0xc3db('0x25')](respondWithResult(_0x445bea,0xc9))[_0xc3db('0x45')](handleError(_0x445bea,null));};exports[_0xc3db('0x24')]=function(_0x239d3e,_0xcead3a){if(_0x239d3e[_0xc3db('0x53')]['id']){delete _0x239d3e[_0xc3db('0x53')]['id'];}return db[_0xc3db('0x2d')][_0xc3db('0x49')]({'where':{'id':_0x239d3e[_0xc3db('0x47')]['id']}})[_0xc3db('0x25')](handleEntityNotFound(_0xcead3a,null))[_0xc3db('0x25')](saveUpdates(_0x239d3e[_0xc3db('0x53')],null))[_0xc3db('0x25')](respondWithResult(_0xcead3a,null))['catch'](handleError(_0xcead3a,null));};exports[_0xc3db('0x26')]=function(_0x57a716,_0x51ebe7){return db[_0xc3db('0x2d')][_0xc3db('0x49')]({'where':{'id':_0x57a716[_0xc3db('0x47')]['id']}})[_0xc3db('0x25')](handleEntityNotFound(_0x51ebe7,null))[_0xc3db('0x25')](removeEntity(_0x51ebe7,null))[_0xc3db('0x45')](handleError(_0x51ebe7,null));};exports[_0xc3db('0x59')]=function(_0x1ba679,_0x57bd7f,_0x260e01){var _0xe1ebdb={'raw':!![],'where':{}};var _0x5820f3={};var _0x12ae29={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x1ba679[_0xc3db('0x47')]['id']}})[_0xc3db('0x25')](handleEntityNotFound(_0x57bd7f,null))[_0xc3db('0x25')](function(_0x6e8384){if(_0x6e8384){_0x5820f3['model']=_['keys'](db['CmHopper'][_0xc3db('0x2e')]);_0x5820f3['query']=_[_0xc3db('0x34')](_0x1ba679[_0xc3db('0x33')]);_0x5820f3[_0xc3db('0x3b')]=_[_0xc3db('0x35')](_0x5820f3[_0xc3db('0x32')],_0x5820f3['query']);_0xe1ebdb[_0xc3db('0x36')]=_[_0xc3db('0x35')](_0x5820f3[_0xc3db('0x32')],qs[_0xc3db('0x37')](_0x1ba679[_0xc3db('0x33')][_0xc3db('0x37')]));_0xe1ebdb[_0xc3db('0x36')]=_0xe1ebdb[_0xc3db('0x36')]['length']?_0xe1ebdb['attributes']:_0x5820f3[_0xc3db('0x32')];if(!_0x1ba679[_0xc3db('0x33')][_0xc3db('0x5a')](_0xc3db('0x38'))){_0xe1ebdb[_0xc3db('0x1f')]=qs['limit'](_0x1ba679[_0xc3db('0x33')][_0xc3db('0x1f')]);_0xe1ebdb['offset']=qs[_0xc3db('0x1c')](_0x1ba679['query'][_0xc3db('0x1c')]);}_0xe1ebdb[_0xc3db('0x39')]=qs[_0xc3db('0x3a')](_0x1ba679[_0xc3db('0x33')][_0xc3db('0x3a')]);_0xe1ebdb[_0xc3db('0x3f')]=qs[_0xc3db('0x3b')](_[_0xc3db('0x3c')](_0x1ba679[_0xc3db('0x33')],_0x5820f3[_0xc3db('0x3b')]));_0xe1ebdb[_0xc3db('0x3f')][_0xc3db('0x5b')]=_0x6e8384['id'];if(_0x1ba679[_0xc3db('0x33')]['filter']){_0xe1ebdb[_0xc3db('0x3f')]=_['merge'](_0xe1ebdb['where'],{'$or':_[_0xc3db('0x2c')](_0xe1ebdb['attributes'],function(_0x427215){var _0x270801={};_0x270801[_0x427215]={'$like':'%'+_0x1ba679['query'][_0xc3db('0x3d')]+'%'};return _0x270801;})});}_0xe1ebdb=_[_0xc3db('0x3e')]({},_0xe1ebdb,_0x1ba679[_0xc3db('0x41')]);return db[_0xc3db('0x5c')][_0xc3db('0x1e')]({'where':_0xe1ebdb['where']})['then'](function(_0x5e432e){_0x12ae29[_0xc3db('0x1e')]=_0x5e432e;if(_0x1ba679[_0xc3db('0x33')][_0xc3db('0x42')]){_0xe1ebdb[_0xc3db('0x43')]=[{'all':!![]}];}return db['CmHopper'][_0xc3db('0x5d')](_0xe1ebdb);})[_0xc3db('0x25')](function(_0x41e771){_0x12ae29[_0xc3db('0x44')]=_0x41e771;return _0x12ae29;});}})['then'](respondWithFilteredResult(_0x57bd7f,_0xe1ebdb))['catch'](handleError(_0x57bd7f,null));};exports[_0xc3db('0x5e')]=function(_0x43f308,_0x4b4e9e,_0x548803){var _0x1911e1={'raw':!![],'where':{}};var _0x1b65c={};var _0x6f705c={'count':0x0,'rows':[]};return db['Campaign'][_0xc3db('0x5f')]({'where':{'id':_0x43f308['params']['id']}})['then'](handleEntityNotFound(_0x4b4e9e,null))[_0xc3db('0x25')](function(_0xf4add2){if(_0xf4add2){_0x1b65c[_0xc3db('0x32')]=_[_0xc3db('0x34')](db[_0xc3db('0x60')][_0xc3db('0x2e')]);_0x1b65c[_0xc3db('0x33')]=_[_0xc3db('0x34')](_0x43f308['query']);_0x1b65c[_0xc3db('0x3b')]=_['intersection'](_0x1b65c['model'],_0x1b65c['query']);_0x1911e1[_0xc3db('0x36')]=_[_0xc3db('0x35')](_0x1b65c[_0xc3db('0x32')],qs['fields'](_0x43f308['query']['fields']));_0x1911e1[_0xc3db('0x36')]=_0x1911e1[_0xc3db('0x36')]['length']?_0x1911e1[_0xc3db('0x36')]:_0x1b65c[_0xc3db('0x32')];if(!_0x43f308[_0xc3db('0x33')]['hasOwnProperty'](_0xc3db('0x38'))){_0x1911e1[_0xc3db('0x1f')]=qs['limit'](_0x43f308[_0xc3db('0x33')][_0xc3db('0x1f')]);_0x1911e1['offset']=qs['offset'](_0x43f308[_0xc3db('0x33')][_0xc3db('0x1c')]);}_0x1911e1[_0xc3db('0x39')]=qs[_0xc3db('0x3a')](_0x43f308[_0xc3db('0x33')][_0xc3db('0x3a')]);_0x1911e1[_0xc3db('0x3f')]=qs['filters'](_[_0xc3db('0x3c')](_0x43f308[_0xc3db('0x33')],_0x1b65c[_0xc3db('0x3b')]));_0x1911e1[_0xc3db('0x3f')][_0xc3db('0x5b')]=_0xf4add2['id'];if(_0x43f308[_0xc3db('0x33')][_0xc3db('0x3d')]){_0x1911e1[_0xc3db('0x3f')]=_[_0xc3db('0x3e')](_0x1911e1[_0xc3db('0x3f')],{'$or':_[_0xc3db('0x2c')](_0x1911e1[_0xc3db('0x36')],function(_0x32c220){var _0x257c06={};_0x257c06[_0x32c220]={'$like':'%'+_0x43f308[_0xc3db('0x33')][_0xc3db('0x3d')]+'%'};return _0x257c06;})});}_0x1911e1=_[_0xc3db('0x3e')]({},_0x1911e1,_0x43f308[_0xc3db('0x41')]);return db[_0xc3db('0x60')][_0xc3db('0x1e')]({'where':_0x1911e1[_0xc3db('0x3f')]})[_0xc3db('0x25')](function(_0x15a58c){_0x6f705c['count']=_0x15a58c;if(_0x43f308['query'][_0xc3db('0x42')]){_0x1911e1[_0xc3db('0x43')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x1911e1);})[_0xc3db('0x25')](function(_0x508759){_0x6f705c['rows']=_0x508759;return _0x6f705c;});}})['then'](respondWithFilteredResult(_0x4b4e9e,_0x1911e1))['catch'](handleError(_0x4b4e9e,null));};exports['getHopperFinals']=function(_0x2bff0d,_0x860cbb,_0x462995){var _0x508550={'raw':!![],'where':{}};var _0x382271={};var _0xf2ec3f={'count':0x0,'rows':[]};return db['Campaign'][_0xc3db('0x5f')]({'where':{'id':_0x2bff0d['params']['id']}})[_0xc3db('0x25')](handleEntityNotFound(_0x860cbb,null))[_0xc3db('0x25')](function(_0x34bab4){if(_0x34bab4){_0x382271['model']=_[_0xc3db('0x34')](db[_0xc3db('0x61')][_0xc3db('0x2e')]);_0x382271['query']=_[_0xc3db('0x34')](_0x2bff0d[_0xc3db('0x33')]);_0x382271[_0xc3db('0x3b')]=_[_0xc3db('0x35')](_0x382271[_0xc3db('0x32')],_0x382271[_0xc3db('0x33')]);_0x508550[_0xc3db('0x36')]=_[_0xc3db('0x35')](_0x382271['model'],qs[_0xc3db('0x37')](_0x2bff0d['query']['fields']));_0x508550[_0xc3db('0x36')]=_0x508550[_0xc3db('0x36')]['length']?_0x508550['attributes']:_0x382271[_0xc3db('0x32')];if(!_0x2bff0d['query'][_0xc3db('0x5a')](_0xc3db('0x38'))){_0x508550[_0xc3db('0x1f')]=qs['limit'](_0x2bff0d[_0xc3db('0x33')][_0xc3db('0x1f')]);_0x508550[_0xc3db('0x1c')]=qs['offset'](_0x2bff0d['query'][_0xc3db('0x1c')]);}_0x508550[_0xc3db('0x39')]=qs['sort'](_0x2bff0d[_0xc3db('0x33')]['sort']);_0x508550[_0xc3db('0x3f')]=qs[_0xc3db('0x3b')](_[_0xc3db('0x3c')](_0x2bff0d[_0xc3db('0x33')],_0x382271[_0xc3db('0x3b')]));_0x508550[_0xc3db('0x3f')][_0xc3db('0x5b')]=_0x34bab4['id'];if(_0x2bff0d[_0xc3db('0x33')]['filter']){_0x508550[_0xc3db('0x3f')]=_[_0xc3db('0x3e')](_0x508550[_0xc3db('0x3f')],{'$or':_['map'](_0x508550['attributes'],function(_0x5db3e1){var _0x109a5f={};_0x109a5f[_0x5db3e1]={'$like':'%'+_0x2bff0d[_0xc3db('0x33')]['filter']+'%'};return _0x109a5f;})});}_0x508550=_['merge']({},_0x508550,_0x2bff0d[_0xc3db('0x41')]);return db[_0xc3db('0x61')][_0xc3db('0x1e')]({'where':_0x508550[_0xc3db('0x3f')]})[_0xc3db('0x25')](function(_0x83533b){_0xf2ec3f[_0xc3db('0x1e')]=_0x83533b;if(_0x2bff0d['query'][_0xc3db('0x42')]){_0x508550[_0xc3db('0x43')]=[{'all':!![]}];}return db[_0xc3db('0x61')][_0xc3db('0x5d')](_0x508550);})['then'](function(_0x30cc14){_0xf2ec3f[_0xc3db('0x44')]=_0x30cc14;return _0xf2ec3f;});}})[_0xc3db('0x25')](respondWithFilteredResult(_0x860cbb,_0x508550))[_0xc3db('0x45')](handleError(_0x860cbb,null));};exports[_0xc3db('0x62')]=function(_0x9fc15b,_0x1a24d2,_0x20b747){var _0x156165={'raw':!![],'where':{}};var _0x24d54f={};var _0x2e47e1={'count':0x0,'rows':[]};return db[_0xc3db('0x2d')]['findOne']({'where':{'id':_0x9fc15b[_0xc3db('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a24d2,null))[_0xc3db('0x25')](function(_0x369a13){if(_0x369a13){_0x24d54f['model']=_[_0xc3db('0x34')](db[_0xc3db('0x63')][_0xc3db('0x2e')]);_0x24d54f[_0xc3db('0x33')]=_[_0xc3db('0x34')](_0x9fc15b[_0xc3db('0x33')]);_0x24d54f['filters']=_[_0xc3db('0x35')](_0x24d54f[_0xc3db('0x32')],_0x24d54f[_0xc3db('0x33')]);_0x156165['attributes']=_[_0xc3db('0x35')](_0x24d54f[_0xc3db('0x32')],qs['fields'](_0x9fc15b[_0xc3db('0x33')][_0xc3db('0x37')]));_0x156165[_0xc3db('0x36')]=_0x156165[_0xc3db('0x36')][_0xc3db('0x48')]?_0x156165[_0xc3db('0x36')]:_0x24d54f[_0xc3db('0x32')];if(!_0x9fc15b[_0xc3db('0x33')][_0xc3db('0x5a')](_0xc3db('0x38'))){_0x156165[_0xc3db('0x1f')]=qs[_0xc3db('0x1f')](_0x9fc15b[_0xc3db('0x33')][_0xc3db('0x1f')]);_0x156165[_0xc3db('0x1c')]=qs[_0xc3db('0x1c')](_0x9fc15b[_0xc3db('0x33')][_0xc3db('0x1c')]);}_0x156165[_0xc3db('0x39')]=qs[_0xc3db('0x3a')](_0x9fc15b[_0xc3db('0x33')][_0xc3db('0x3a')]);_0x156165[_0xc3db('0x3f')]=qs[_0xc3db('0x3b')](_['pick'](_0x9fc15b['query'],_0x24d54f[_0xc3db('0x3b')]));_0x156165[_0xc3db('0x3f')][_0xc3db('0x5b')]=_0x369a13['id'];if(_0x9fc15b[_0xc3db('0x33')]['filter']){_0x156165[_0xc3db('0x3f')]=_['merge'](_0x156165[_0xc3db('0x3f')],{'$or':_[_0xc3db('0x2c')](_0x156165[_0xc3db('0x36')],function(_0x40ff42){var _0x4cc489={};_0x4cc489[_0x40ff42]={'$like':'%'+_0x9fc15b['query'][_0xc3db('0x3d')]+'%'};return _0x4cc489;})});}_0x156165=_[_0xc3db('0x3e')]({},_0x156165,_0x9fc15b['options']);return db[_0xc3db('0x63')]['count']({'where':_0x156165[_0xc3db('0x3f')]})['then'](function(_0x1d4b31){_0x2e47e1['count']=_0x1d4b31;if(_0x9fc15b[_0xc3db('0x33')][_0xc3db('0x42')]){_0x156165[_0xc3db('0x43')]=[{'all':!![]}];}return db[_0xc3db('0x63')][_0xc3db('0x5d')](_0x156165);})[_0xc3db('0x25')](function(_0x2f28ae){_0x2e47e1[_0xc3db('0x44')]=_0x2f28ae;return _0x2e47e1;});}})[_0xc3db('0x25')](respondWithFilteredResult(_0x1a24d2,_0x156165))[_0xc3db('0x45')](handleError(_0x1a24d2,null));};exports[_0xc3db('0x64')]=function(_0x9303b9,_0x18a45a,_0x587703){var _0x3c4d7c={};var _0x381e07={};var _0xd7d9aa;var _0x34c12c;return db[_0xc3db('0x2d')][_0xc3db('0x5f')]({'where':{'id':_0x9303b9[_0xc3db('0x47')]['id']}})[_0xc3db('0x25')](handleEntityNotFound(_0x18a45a,null))[_0xc3db('0x25')](function(_0x582b42){if(_0x582b42){_0xd7d9aa=_0x582b42;_0x381e07['model']=_['keys'](db[_0xc3db('0x65')][_0xc3db('0x2e')]);_0x381e07['query']=_[_0xc3db('0x34')](_0x9303b9['query']);_0x381e07[_0xc3db('0x3b')]=_[_0xc3db('0x35')](_0x381e07['model'],_0x381e07[_0xc3db('0x33')]);_0x3c4d7c[_0xc3db('0x36')]=_[_0xc3db('0x35')](_0x381e07[_0xc3db('0x32')],qs[_0xc3db('0x37')](_0x9303b9[_0xc3db('0x33')][_0xc3db('0x37')]));_0x3c4d7c['attributes']=_0x3c4d7c[_0xc3db('0x36')][_0xc3db('0x48')]?_0x3c4d7c[_0xc3db('0x36')]:_0x381e07[_0xc3db('0x32')];_0x3c4d7c[_0xc3db('0x39')]=qs[_0xc3db('0x3a')](_0x9303b9[_0xc3db('0x33')][_0xc3db('0x3a')]);_0x3c4d7c[_0xc3db('0x3f')]=qs[_0xc3db('0x3b')](_['pick'](_0x9303b9[_0xc3db('0x33')],_0x381e07[_0xc3db('0x3b')]));if(_0x9303b9['query'][_0xc3db('0x3d')]){_0x3c4d7c['where']=_[_0xc3db('0x3e')](_0x3c4d7c['where'],{'$or':_[_0xc3db('0x2c')](_0x3c4d7c[_0xc3db('0x36')],function(_0x56f8d5){var _0xc71bed={};_0xc71bed[_0x56f8d5]={'$like':'%'+_0x9303b9[_0xc3db('0x33')]['filter']+'%'};return _0xc71bed;})});}_0x3c4d7c=_['merge']({},_0x3c4d7c,_0x9303b9[_0xc3db('0x41')]);return _0xd7d9aa[_0xc3db('0x64')](_0x3c4d7c);}})[_0xc3db('0x25')](function(_0x4597b7){if(_0x4597b7){_0x34c12c=_0x4597b7['length'];if(!_0x9303b9['query'][_0xc3db('0x5a')](_0xc3db('0x38'))){_0x3c4d7c['limit']=qs[_0xc3db('0x1f')](_0x9303b9['query']['limit']);_0x3c4d7c[_0xc3db('0x1c')]=qs[_0xc3db('0x1c')](_0x9303b9[_0xc3db('0x33')]['offset']);}return _0xd7d9aa[_0xc3db('0x64')](_0x3c4d7c);}})['then'](function(_0x2691c9){if(_0x2691c9){return _0x2691c9?{'count':_0x34c12c,'rows':_0x2691c9}:null;}})['then'](respondWithResult(_0x18a45a,null))[_0xc3db('0x45')](handleError(_0x18a45a,null));};exports[_0xc3db('0x66')]=function(_0x2226d5,_0x22541e,_0x2ed619){var _0x5aa521,_0x3d7a9c;return db[_0xc3db('0x2d')][_0xc3db('0x49')]({'where':{'id':_0x2226d5[_0xc3db('0x47')]['id']}})[_0xc3db('0x25')](handleEntityNotFound(_0x22541e,null))[_0xc3db('0x25')](function(_0x5955b1){if(_0x5955b1){_0x3d7a9c=_0x5955b1;return _0x5955b1[_0xc3db('0x66')](_0x2226d5['body'][_0xc3db('0x67')],_[_0xc3db('0x50')](_0x2226d5[_0xc3db('0x53')],[_0xc3db('0x67'),'id'])||{});}return null;})['spread'](function(_0x162d42){var _0x36fde7;_0x5aa521=_0x162d42||[];var _0x1fbc62=[];if(_0x162d42){for(var _0x594944=0x0;_0x594944<_0x162d42['length'];_0x594944+=0x1){var _0x277319=_0x162d42[_0x594944][_0xc3db('0x4b')]({'plain':!![]});_0x3d7a9c[_0xc3db('0x68')]=_0x2226d5[_0xc3db('0x53')][_0xc3db('0x68')]?_0x2226d5[_0xc3db('0x53')][_0xc3db('0x68')]:_0x3d7a9c['dialCheckDuplicateType'];switch(_0x3d7a9c[_0xc3db('0x68')]){case _0xc3db('0x69'):_0x36fde7=squel[_0xc3db('0x6a')]()[_0xc3db('0x6b')](_0xc3db('0x6c'))[_0xc3db('0x6d')]([_0xc3db('0x6e'),'scheduledAt',_0xc3db('0x6f'),_0xc3db('0x70'),_0xc3db('0x5b'),_0xc3db('0x51'),_0xc3db('0x52')],squel[_0xc3db('0x71')]()['field']('phone','phone')[_0xc3db('0x72')](_0xc3db('0x73'),_0xc3db('0x74'))[_0xc3db('0x72')]('id','ContactId')['field'](_0x277319[_0xc3db('0x75')][_0xc3db('0x76')](),_0xc3db('0x70'))[_0xc3db('0x72')](_0x2226d5[_0xc3db('0x47')]['id'][_0xc3db('0x76')](),_0xc3db('0x5b'))['field']('NOW()',_0xc3db('0x51'))[_0xc3db('0x72')]('NOW()',_0xc3db('0x52'))[_0xc3db('0x77')](_0xc3db('0x78'))[_0xc3db('0x3f')](_0xc3db('0x79'))[_0xc3db('0x3f')](_0xc3db('0x7a'),_0x277319[_0xc3db('0x75')][_0xc3db('0x76')]())[_0xc3db('0x3f')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xc3db('0x7b'),squel[_0xc3db('0x71')]()[_0xc3db('0x72')]('COALESCE(calleridnum,\x27\x27)')['from'](_0xc3db('0x7c'))[_0xc3db('0x3f')](_0xc3db('0x7d'),_0x2226d5[_0xc3db('0x47')]['id']['toString']()))[_0xc3db('0x3f')](_0xc3db('0x7b'),squel[_0xc3db('0x71')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0xc3db('0x6c'))[_0xc3db('0x3f')](_0xc3db('0x7d'),_0x2226d5[_0xc3db('0x47')]['id'][_0xc3db('0x76')]())))['toString']();break;case _0xc3db('0x7e'):_0x36fde7=squel[_0xc3db('0x6a')]()[_0xc3db('0x6b')]('cm_hopper')[_0xc3db('0x6d')](['phone',_0xc3db('0x74'),_0xc3db('0x6f'),_0xc3db('0x70'),'CampaignId',_0xc3db('0x51'),'updatedAt'],squel[_0xc3db('0x71')]()[_0xc3db('0x72')]('phone',_0xc3db('0x6e'))['field']('NOW()',_0xc3db('0x74'))['field']('id',_0xc3db('0x6f'))[_0xc3db('0x72')](_0x277319['CmListId'][_0xc3db('0x76')](),_0xc3db('0x70'))[_0xc3db('0x72')](_0x2226d5[_0xc3db('0x47')]['id']['toString'](),_0xc3db('0x5b'))['field'](_0xc3db('0x73'),_0xc3db('0x51'))[_0xc3db('0x72')](_0xc3db('0x73'),_0xc3db('0x52'))['from']('cm_contacts')['where'](_0xc3db('0x79'))[_0xc3db('0x3f')]('ListId\x20=\x20?',_0x277319['CmListId'][_0xc3db('0x76')]())[_0xc3db('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0xc3db('0x3f')](_0xc3db('0x7b'),squel['select']()['field'](_0xc3db('0x7f'))['from'](_0xc3db('0x6c'))[_0xc3db('0x3f')](_0xc3db('0x7d'),_0x2226d5[_0xc3db('0x47')]['id'][_0xc3db('0x76')]())))[_0xc3db('0x76')]();break;default:_0x36fde7=squel[_0xc3db('0x6a')]()['into'](_0xc3db('0x6c'))[_0xc3db('0x6d')]([_0xc3db('0x6e'),_0xc3db('0x74'),_0xc3db('0x6f'),_0xc3db('0x70'),'CampaignId','createdAt','updatedAt'],squel[_0xc3db('0x71')]()[_0xc3db('0x72')](_0xc3db('0x6e'),_0xc3db('0x6e'))[_0xc3db('0x72')](_0xc3db('0x73'),_0xc3db('0x74'))[_0xc3db('0x72')]('id',_0xc3db('0x6f'))['field'](_0x277319[_0xc3db('0x75')][_0xc3db('0x76')](),'ListId')[_0xc3db('0x72')](_0x2226d5['params']['id'][_0xc3db('0x76')](),'CampaignId')['field'](_0xc3db('0x73'),_0xc3db('0x51'))[_0xc3db('0x72')](_0xc3db('0x73'),_0xc3db('0x52'))[_0xc3db('0x77')](_0xc3db('0x78'))[_0xc3db('0x3f')](_0xc3db('0x79'))[_0xc3db('0x3f')](_0xc3db('0x7a'),_0x277319['CmListId'][_0xc3db('0x76')]())[_0xc3db('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0xc3db('0x76')]();}_0x1fbc62[_0xc3db('0x80')](db[_0xc3db('0x81')][_0xc3db('0x33')](_0x36fde7));}return BPromise[_0xc3db('0x82')](_0x1fbc62);}})[_0xc3db('0x25')](function(){return _0x5aa521;})[_0xc3db('0x25')](respondWithResult(_0x22541e,null))[_0xc3db('0x45')](handleError(_0x22541e,null));};exports[_0xc3db('0x83')]=function(_0x29cb99,_0x4f82c,_0x4f040d){return db[_0xc3db('0x2d')][_0xc3db('0x49')]({'where':{'id':_0x29cb99[_0xc3db('0x47')]['id']}})[_0xc3db('0x25')](handleEntityNotFound(_0x4f82c,null))[_0xc3db('0x25')](function(_0x2cd39c){if(_0x2cd39c){return _0x2cd39c['removeLists'](_0x29cb99['query']['ids']);}})[_0xc3db('0x25')](function(_0x35b17c){if(_0x35b17c){return db['CmHopper']['destroy']({'where':{'ListId':_0x29cb99[_0xc3db('0x33')][_0xc3db('0x67')],'CampaignId':_0x29cb99[_0xc3db('0x47')]['id']}})[_0xc3db('0x25')](function(){return _0x35b17c;});}})[_0xc3db('0x25')](respondWithStatusCode(_0x4f82c,null))[_0xc3db('0x45')](handleError(_0x4f82c,null));};exports[_0xc3db('0x84')]=function(_0x48baae,_0x508263,_0x17386f){var _0x5e1c8a={};var _0x5d0623={};var _0x2231b1;var _0x4103d9;return db[_0xc3db('0x2d')][_0xc3db('0x5f')]({'where':{'id':_0x48baae[_0xc3db('0x47')]['id']}})['then'](handleEntityNotFound(_0x508263,null))[_0xc3db('0x25')](function(_0x1516b5){if(_0x1516b5){_0x2231b1=_0x1516b5;_0x5d0623[_0xc3db('0x32')]=_[_0xc3db('0x34')](db[_0xc3db('0x65')][_0xc3db('0x2e')]);_0x5d0623['query']=_[_0xc3db('0x34')](_0x48baae[_0xc3db('0x33')]);_0x5d0623['filters']=_[_0xc3db('0x35')](_0x5d0623[_0xc3db('0x32')],_0x5d0623[_0xc3db('0x33')]);_0x5e1c8a[_0xc3db('0x36')]=_[_0xc3db('0x35')](_0x5d0623['model'],qs['fields'](_0x48baae[_0xc3db('0x33')]['fields']));_0x5e1c8a[_0xc3db('0x36')]=_0x5e1c8a[_0xc3db('0x36')][_0xc3db('0x48')]?_0x5e1c8a[_0xc3db('0x36')]:_0x5d0623[_0xc3db('0x32')];_0x5e1c8a['order']=qs[_0xc3db('0x3a')](_0x48baae[_0xc3db('0x33')][_0xc3db('0x3a')]);_0x5e1c8a['where']=qs[_0xc3db('0x3b')](_['pick'](_0x48baae[_0xc3db('0x33')],_0x5d0623[_0xc3db('0x3b')]));if(_0x48baae[_0xc3db('0x33')][_0xc3db('0x3d')]){_0x5e1c8a[_0xc3db('0x3f')]=_[_0xc3db('0x3e')](_0x5e1c8a[_0xc3db('0x3f')],{'$or':_['map'](_0x5e1c8a[_0xc3db('0x36')],function(_0x3a980e){var _0x345e64={};_0x345e64[_0x3a980e]={'$like':'%'+_0x48baae['query']['filter']+'%'};return _0x345e64;})});}_0x5e1c8a=_[_0xc3db('0x3e')]({},_0x5e1c8a,_0x48baae['options']);return _0x2231b1[_0xc3db('0x84')](_0x5e1c8a);}})[_0xc3db('0x25')](function(_0x49c7fb){if(_0x49c7fb){_0x4103d9=_0x49c7fb[_0xc3db('0x48')];if(!_0x48baae[_0xc3db('0x33')][_0xc3db('0x5a')](_0xc3db('0x38'))){_0x5e1c8a[_0xc3db('0x1f')]=qs[_0xc3db('0x1f')](_0x48baae['query'][_0xc3db('0x1f')]);_0x5e1c8a[_0xc3db('0x1c')]=qs[_0xc3db('0x1c')](_0x48baae[_0xc3db('0x33')][_0xc3db('0x1c')]);}return _0x2231b1[_0xc3db('0x84')](_0x5e1c8a);}})[_0xc3db('0x25')](function(_0x49aa98){if(_0x49aa98){return _0x49aa98?{'count':_0x4103d9,'rows':_0x49aa98}:null;}})['then'](respondWithResult(_0x508263,null))[_0xc3db('0x45')](handleError(_0x508263,null));};exports[_0xc3db('0x85')]=function(_0x499040,_0x296684,_0x2ff25d){var _0x32ae60,_0x404f73;return db['Campaign']['find']({'where':{'id':_0x499040[_0xc3db('0x47')]['id']}})[_0xc3db('0x25')](handleEntityNotFound(_0x296684,null))[_0xc3db('0x25')](function(_0x465512){if(_0x465512){_0x404f73=_0x465512;return _0x465512['addBlackLists'](_0x499040['body'][_0xc3db('0x67')],_[_0xc3db('0x50')](_0x499040['body'],[_0xc3db('0x67'),'id'])||{});}return null;})['spread'](function(_0x2d07a1){var _0x5f540a;_0x32ae60=_0x2d07a1||[];var _0x386a51=[];if(_0x2d07a1){for(var _0xa62546=0x0;_0xa62546<_0x2d07a1[_0xc3db('0x48')];_0xa62546+=0x1){var _0x1290ed=_0x2d07a1[_0xa62546][_0xc3db('0x4b')]({'plain':!![]});_0x5f540a=squel[_0xc3db('0x6a')]()[_0xc3db('0x6b')](_0xc3db('0x86'))[_0xc3db('0x6d')](['phone','ContactId',_0xc3db('0x70'),'CampaignId',_0xc3db('0x51'),_0xc3db('0x52')],squel[_0xc3db('0x71')]()[_0xc3db('0x72')]('phone',_0xc3db('0x6e'))['field']('id',_0xc3db('0x6f'))['field'](_0x1290ed[_0xc3db('0x75')][_0xc3db('0x76')](),_0xc3db('0x70'))[_0xc3db('0x72')](_0x499040[_0xc3db('0x47')]['id'][_0xc3db('0x76')](),'CampaignId')[_0xc3db('0x72')](_0xc3db('0x73'),_0xc3db('0x51'))[_0xc3db('0x72')](_0xc3db('0x73'),'updatedAt')[_0xc3db('0x77')](_0xc3db('0x78'))[_0xc3db('0x3f')](_0xc3db('0x79'))['where'](_0xc3db('0x7a'),_0x1290ed[_0xc3db('0x75')][_0xc3db('0x76')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xc3db('0x76')]();_0x386a51[_0xc3db('0x80')](db['sequelize'][_0xc3db('0x33')](_0x5f540a));}return BPromise[_0xc3db('0x82')](_0x386a51);}})[_0xc3db('0x25')](function(){return _0x32ae60;})['then'](respondWithResult(_0x296684,null))[_0xc3db('0x45')](handleError(_0x296684,null));};exports[_0xc3db('0x87')]=function(_0x501354,_0x1663da,_0x37aef5){return db['Campaign'][_0xc3db('0x49')]({'where':{'id':_0x501354[_0xc3db('0x47')]['id']}})[_0xc3db('0x25')](handleEntityNotFound(_0x1663da,null))['then'](function(_0x3c75f9){if(_0x3c75f9){return _0x3c75f9[_0xc3db('0x87')](_0x501354[_0xc3db('0x33')]['ids']);}})[_0xc3db('0x25')](function(_0x36d125){if(_0x36d125){return db['CmHopperBlack'][_0xc3db('0x26')]({'where':{'ListId':_0x501354['query']['ids'],'CampaignId':_0x501354['params']['id']}})[_0xc3db('0x25')](function(){return _0x36d125;});}})[_0xc3db('0x25')](respondWithStatusCode(_0x1663da,null))['catch'](handleError(_0x1663da,null));}; \ No newline at end of file +var _0xdfaf=['error','name','index','map','Campaign','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','merge','options','omit','createdAt','updatedAt','IvrCampaigns','UserProfileSection','UserProfileResource','destroy','getHoppers','findOne','CmHopper','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','fromQuery','cm_contacts','ListId\x20=\x20?','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','deletedAt\x20IS\x20NULL','push','sequelize','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','sendStatus'];(function(_0x51d269,_0x1972d4){var _0x15d897=function(_0x3cc856){while(--_0x3cc856){_0x51d269['push'](_0x51d269['shift']());}};_0x15d897(++_0x1972d4);}(_0xdfaf,0x1ee));var _0xfdfa=function(_0xa02f8c,_0x1d27a6){_0xa02f8c=_0xa02f8c-0x0;var _0x1172e0=_0xdfaf[_0xa02f8c];return _0x1172e0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfdfa('0x0'));var jsonpatch=require(_0xfdfa('0x1'));var rp=require(_0xfdfa('0x2'));var moment=require(_0xfdfa('0x3'));var BPromise=require(_0xfdfa('0x4'));var Mustache=require(_0xfdfa('0x5'));var util=require(_0xfdfa('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfdfa('0x7'));var fs=require('fs');var fs_extra=require(_0xfdfa('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfdfa('0x9'));var jsforce=require(_0xfdfa('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfdfa('0xb'));var Papa=require(_0xfdfa('0xc'));var Redis=require('ioredis');var authService=require(_0xfdfa('0xd'));var qs=require(_0xfdfa('0xe'));var as=require(_0xfdfa('0xf'));var hardwareService=require(_0xfdfa('0x10'));var logger=require(_0xfdfa('0x11'))(_0xfdfa('0x12'));var utils=require(_0xfdfa('0x13'));var config=require(_0xfdfa('0x14'));var licenseUtil=require(_0xfdfa('0x15'));var db=require(_0xfdfa('0x16'))['db'];function respondWithStatusCode(_0x39f078,_0x2bf5b8){_0x2bf5b8=_0x2bf5b8||0xcc;return function(_0x100ebf){if(_0x100ebf){return _0x39f078['sendStatus'](_0x2bf5b8);}return _0x39f078[_0xfdfa('0x17')](_0x2bf5b8)[_0xfdfa('0x18')]();};}function respondWithResult(_0xe0d280,_0x485bf5){_0x485bf5=_0x485bf5||0xc8;return function(_0x482643){if(_0x482643){return _0xe0d280['status'](_0x485bf5)[_0xfdfa('0x19')](_0x482643);}};}function respondWithFilteredResult(_0x3cef1d,_0x2f0592){return function(_0x1d544c){if(_0x1d544c){var _0x37c332=typeof _0x2f0592[_0xfdfa('0x1a')]===_0xfdfa('0x1b')&&typeof _0x2f0592[_0xfdfa('0x1c')]===_0xfdfa('0x1b');var _0x32fda8=_0x1d544c[_0xfdfa('0x1d')];var _0x568c8a=_0x37c332?0x0:_0x2f0592[_0xfdfa('0x1a')];var _0x4599fd=_0x37c332?_0x1d544c[_0xfdfa('0x1d')]:_0x2f0592['offset']+_0x2f0592[_0xfdfa('0x1c')];var _0x463251;if(_0x4599fd>=_0x32fda8){_0x4599fd=_0x32fda8;_0x463251=0xc8;}else{_0x463251=0xce;}_0x3cef1d['status'](_0x463251);return _0x3cef1d[_0xfdfa('0x1e')]('Content-Range',_0x568c8a+'-'+_0x4599fd+'/'+_0x32fda8)[_0xfdfa('0x19')](_0x1d544c);}return null;};}function patchUpdates(_0x4b20e0){return function(_0xda41a1){try{jsonpatch[_0xfdfa('0x1f')](_0xda41a1,_0x4b20e0,!![]);}catch(_0x13534c){return BPromise[_0xfdfa('0x20')](_0x13534c);}return _0xda41a1[_0xfdfa('0x21')]();};}function saveUpdates(_0x2447a3,_0x40e703){return function(_0x393208){if(_0x393208){return _0x393208[_0xfdfa('0x22')](_0x2447a3)[_0xfdfa('0x23')](function(_0x2878ec){return _0x2878ec;});}return null;};}function removeEntity(_0x1138a7,_0x37d9e1){return function(_0x103b51){if(_0x103b51){return _0x103b51['destroy']()[_0xfdfa('0x23')](function(){var _0x361e86=_0x103b51[_0xfdfa('0x24')]({'plain':!![]});var _0x5cca55='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x5cca55,'resourceId':_0x361e86['id']}})[_0xfdfa('0x23')](function(){return _0x103b51;});})[_0xfdfa('0x23')](function(){_0x1138a7[_0xfdfa('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa09508,_0x7ec796){return function(_0x58aec7){if(!_0x58aec7){_0xa09508[_0xfdfa('0x25')](0x194);}return _0x58aec7;};}function handleError(_0x24d742,_0x144264){_0x144264=_0x144264||0x1f4;return function(_0x39d054){logger[_0xfdfa('0x26')](_0x39d054['stack']);if(_0x39d054['name']){delete _0x39d054[_0xfdfa('0x27')];}_0x24d742[_0xfdfa('0x17')](_0x144264)['send'](_0x39d054);};}exports[_0xfdfa('0x28')]=function(_0x8977ab,_0x58203f){var _0x44a87f={},_0x42e6d6={},_0x5b78c5={'count':0x0,'rows':[]};var _0x451a60=_[_0xfdfa('0x29')](db[_0xfdfa('0x2a')][_0xfdfa('0x2b')],function(_0x57ad35){return{'name':_0x57ad35[_0xfdfa('0x2c')],'type':_0x57ad35['type']['key']};});_0x42e6d6[_0xfdfa('0x2d')]=_[_0xfdfa('0x29')](_0x451a60,_0xfdfa('0x27'));_0x42e6d6['query']=_[_0xfdfa('0x2e')](_0x8977ab[_0xfdfa('0x2f')]);_0x42e6d6[_0xfdfa('0x30')]=_[_0xfdfa('0x31')](_0x42e6d6[_0xfdfa('0x2d')],_0x42e6d6[_0xfdfa('0x2f')]);_0x44a87f[_0xfdfa('0x32')]=_[_0xfdfa('0x31')](_0x42e6d6['model'],qs['fields'](_0x8977ab['query'][_0xfdfa('0x33')]));_0x44a87f['attributes']=_0x44a87f[_0xfdfa('0x32')][_0xfdfa('0x34')]?_0x44a87f[_0xfdfa('0x32')]:_0x42e6d6[_0xfdfa('0x2d')];if(!_0x8977ab['query'][_0xfdfa('0x35')](_0xfdfa('0x36'))){_0x44a87f['limit']=qs[_0xfdfa('0x1c')](_0x8977ab['query']['limit']);_0x44a87f[_0xfdfa('0x1a')]=qs['offset'](_0x8977ab['query']['offset']);}_0x44a87f[_0xfdfa('0x37')]=qs[_0xfdfa('0x38')](_0x8977ab[_0xfdfa('0x2f')][_0xfdfa('0x38')]);_0x44a87f[_0xfdfa('0x39')]=qs[_0xfdfa('0x30')](_[_0xfdfa('0x3a')](_0x8977ab['query'],_0x42e6d6[_0xfdfa('0x30')]),_0x451a60);if(_0x8977ab[_0xfdfa('0x2f')][_0xfdfa('0x3b')]){_0x44a87f[_0xfdfa('0x39')]=_['merge'](_0x44a87f[_0xfdfa('0x39')],{'$or':_[_0xfdfa('0x29')](_0x451a60,function(_0x340811){if(_0x340811[_0xfdfa('0x3c')]!==_0xfdfa('0x3d')){var _0x329df5={};_0x329df5[_0x340811[_0xfdfa('0x27')]]={'$like':'%'+_0x8977ab[_0xfdfa('0x2f')][_0xfdfa('0x3b')]+'%'};return _0x329df5;}})});}_0x44a87f=_['merge']({},_0x44a87f,_0x8977ab['options']);var _0x12c79c={'where':_0x44a87f[_0xfdfa('0x39')]};return db['Campaign'][_0xfdfa('0x1d')](_0x12c79c)['then'](function(_0x241164){_0x5b78c5['count']=_0x241164;if(_0x8977ab[_0xfdfa('0x2f')][_0xfdfa('0x3e')]){_0x44a87f[_0xfdfa('0x3f')]=[{'all':!![]}];}return db['Campaign'][_0xfdfa('0x40')](_0x44a87f);})[_0xfdfa('0x23')](function(_0x42f4d6){_0x5b78c5[_0xfdfa('0x41')]=_0x42f4d6;return _0x5b78c5;})[_0xfdfa('0x23')](respondWithFilteredResult(_0x58203f,_0x44a87f))[_0xfdfa('0x42')](handleError(_0x58203f,null));};exports[_0xfdfa('0x43')]=function(_0x2ab34a,_0x1d879a){var _0x5ca31d={'raw':![],'where':{'id':_0x2ab34a[_0xfdfa('0x44')]['id']}},_0x153cf1={};_0x153cf1['model']=_[_0xfdfa('0x2e')](db['Campaign'][_0xfdfa('0x2b')]);_0x153cf1[_0xfdfa('0x2f')]=_[_0xfdfa('0x2e')](_0x2ab34a[_0xfdfa('0x2f')]);_0x153cf1['filters']=_[_0xfdfa('0x31')](_0x153cf1[_0xfdfa('0x2d')],_0x153cf1[_0xfdfa('0x2f')]);_0x5ca31d['attributes']=_['intersection'](_0x153cf1[_0xfdfa('0x2d')],qs[_0xfdfa('0x33')](_0x2ab34a[_0xfdfa('0x2f')][_0xfdfa('0x33')]));_0x5ca31d[_0xfdfa('0x32')]=_0x5ca31d[_0xfdfa('0x32')][_0xfdfa('0x34')]?_0x5ca31d[_0xfdfa('0x32')]:_0x153cf1[_0xfdfa('0x2d')];if(_0x2ab34a[_0xfdfa('0x2f')][_0xfdfa('0x3e')]){_0x5ca31d[_0xfdfa('0x3f')]=[{'all':!![]}];}_0x5ca31d=_['merge']({},_0x5ca31d,_0x2ab34a['options']);return db[_0xfdfa('0x2a')][_0xfdfa('0x45')](_0x5ca31d)['then'](handleEntityNotFound(_0x1d879a,null))['then'](respondWithResult(_0x1d879a,null))[_0xfdfa('0x42')](handleError(_0x1d879a,null));};exports[_0xfdfa('0x46')]=function(_0x160f5c,_0xf149ff){return db[_0xfdfa('0x2a')][_0xfdfa('0x46')](_0x160f5c[_0xfdfa('0x47')],{})[_0xfdfa('0x23')](function(_0x211969){var _0xe1b6a8=_0x160f5c[_0xfdfa('0x48')][_0xfdfa('0x24')]({'plain':!![]});if(!_0xe1b6a8)throw new Error(_0xfdfa('0x49'));if(_0xe1b6a8[_0xfdfa('0x4a')]===_0xfdfa('0x48')){var _0x883f58=_0x211969[_0xfdfa('0x24')]({'plain':!![]});var _0x59ce18='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x59ce18,'userProfileId':_0xe1b6a8[_0xfdfa('0x4b')]},'raw':!![]})[_0xfdfa('0x23')](function(_0x553a04){if(_0x553a04&&_0x553a04[_0xfdfa('0x4c')]===0x0){return db['UserProfileResource'][_0xfdfa('0x46')]({'name':_0x883f58[_0xfdfa('0x27')],'resourceId':_0x883f58['id'],'type':_0x553a04[_0xfdfa('0x27')],'sectionId':_0x553a04['id']},{})[_0xfdfa('0x23')](function(){return _0x211969;});}else{return _0x211969;}})[_0xfdfa('0x42')](function(_0x4f6e9f){logger['error'](_0xfdfa('0x4d'),_0x4f6e9f);throw _0x4f6e9f;});}return _0x211969;})[_0xfdfa('0x23')](respondWithResult(_0xf149ff,0xc9))['catch'](handleError(_0xf149ff,null));};exports[_0xfdfa('0x4e')]=function(_0x33a9e2,_0x21ed5e){var _0x155032={'where':{'id':_0x33a9e2[_0xfdfa('0x44')]['id']}},_0x52950a={};_0x52950a[_0xfdfa('0x2d')]=_['keys'](db[_0xfdfa('0x2a')][_0xfdfa('0x2b')]);_0x155032[_0xfdfa('0x32')]=_[_0xfdfa('0x31')](_0x52950a[_0xfdfa('0x2d')],qs[_0xfdfa('0x33')](_0x33a9e2[_0xfdfa('0x2f')][_0xfdfa('0x33')]));_0x155032['attributes']=_0x155032['attributes'][_0xfdfa('0x34')]?_0x155032['attributes']:_0x52950a[_0xfdfa('0x2d')];if(_0x33a9e2[_0xfdfa('0x2f')][_0xfdfa('0x3e')]){_0x155032[_0xfdfa('0x3f')]=[{'all':!![]}];}_0x155032=_[_0xfdfa('0x4f')]({},_0x155032,_0x33a9e2[_0xfdfa('0x50')]);return db[_0xfdfa('0x2a')]['find'](_0x155032)[_0xfdfa('0x23')](handleEntityNotFound(_0x21ed5e,null))[_0xfdfa('0x23')](function(_0x5c7fb6){if(_0x5c7fb6){var _0x1f898f=_0x5c7fb6[_0xfdfa('0x24')]({'plain':!![]});_0x1f898f=qs[_0xfdfa('0x51')](_0x1f898f,['id',_0xfdfa('0x52'),_0xfdfa('0x53')]);_0x33a9e2[_0xfdfa('0x47')]=_['omit'](_0x33a9e2[_0xfdfa('0x47')],['id',_0xfdfa('0x52'),'updatedAt']);return db[_0xfdfa('0x2a')]['create'](_[_0xfdfa('0x4f')](_0x1f898f,_0x33a9e2[_0xfdfa('0x47')]),{'include':_0x33a9e2[_0xfdfa('0x2f')][_0xfdfa('0x3e')]?[{'all':!![]}]:undefined})[_0xfdfa('0x23')](function(_0x31fa9c){var _0x5ada56=_0x33a9e2[_0xfdfa('0x48')][_0xfdfa('0x24')]({'plain':!![]});if(!_0x5ada56)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ada56[_0xfdfa('0x4a')]===_0xfdfa('0x48')){var _0x2b6245=_0x31fa9c[_0xfdfa('0x24')]({'plain':!![]});var _0x963c90=_0xfdfa('0x54');return db[_0xfdfa('0x55')][_0xfdfa('0x45')]({'where':{'name':_0x963c90,'userProfileId':_0x5ada56[_0xfdfa('0x4b')]},'raw':!![]})['then'](function(_0x545d16){if(_0x545d16&&_0x545d16['autoAssociation']===0x0){return db[_0xfdfa('0x56')][_0xfdfa('0x46')]({'name':_0x2b6245[_0xfdfa('0x27')],'resourceId':_0x2b6245['id'],'type':_0x545d16[_0xfdfa('0x27')],'sectionId':_0x545d16['id']},{})['then'](function(){return _0x31fa9c;});}else{return _0x31fa9c;}})['catch'](function(_0x5ebd0e){logger[_0xfdfa('0x26')](_0xfdfa('0x4d'),_0x5ebd0e);throw _0x5ebd0e;});}return _0x31fa9c;});}})[_0xfdfa('0x23')](respondWithResult(_0x21ed5e,0xc9))[_0xfdfa('0x42')](handleError(_0x21ed5e,null));};exports[_0xfdfa('0x22')]=function(_0x299722,_0x442464){if(_0x299722['body']['id']){delete _0x299722[_0xfdfa('0x47')]['id'];}return db['Campaign'][_0xfdfa('0x45')]({'where':{'id':_0x299722[_0xfdfa('0x44')]['id']}})[_0xfdfa('0x23')](handleEntityNotFound(_0x442464,null))[_0xfdfa('0x23')](saveUpdates(_0x299722[_0xfdfa('0x47')],null))[_0xfdfa('0x23')](respondWithResult(_0x442464,null))[_0xfdfa('0x42')](handleError(_0x442464,null));};exports[_0xfdfa('0x57')]=function(_0x17a8b1,_0x4d0967){return db['Campaign'][_0xfdfa('0x45')]({'where':{'id':_0x17a8b1[_0xfdfa('0x44')]['id']}})[_0xfdfa('0x23')](handleEntityNotFound(_0x4d0967,null))[_0xfdfa('0x23')](removeEntity(_0x4d0967,null))[_0xfdfa('0x42')](handleError(_0x4d0967,null));};exports[_0xfdfa('0x58')]=function(_0x2b04aa,_0x283c07,_0x33d974){var _0x37f70f={'raw':!![],'where':{}};var _0x95ada2={};var _0xb0cfa4={'count':0x0,'rows':[]};return db['Campaign'][_0xfdfa('0x59')]({'where':{'id':_0x2b04aa[_0xfdfa('0x44')]['id']}})[_0xfdfa('0x23')](handleEntityNotFound(_0x283c07,null))[_0xfdfa('0x23')](function(_0x598ba6){if(_0x598ba6){_0x95ada2[_0xfdfa('0x2d')]=_['keys'](db[_0xfdfa('0x5a')]['rawAttributes']);_0x95ada2['query']=_['keys'](_0x2b04aa[_0xfdfa('0x2f')]);_0x95ada2[_0xfdfa('0x30')]=_['intersection'](_0x95ada2['model'],_0x95ada2['query']);_0x37f70f['attributes']=_[_0xfdfa('0x31')](_0x95ada2[_0xfdfa('0x2d')],qs[_0xfdfa('0x33')](_0x2b04aa['query'][_0xfdfa('0x33')]));_0x37f70f[_0xfdfa('0x32')]=_0x37f70f['attributes']['length']?_0x37f70f[_0xfdfa('0x32')]:_0x95ada2[_0xfdfa('0x2d')];if(!_0x2b04aa['query'][_0xfdfa('0x35')](_0xfdfa('0x36'))){_0x37f70f['limit']=qs[_0xfdfa('0x1c')](_0x2b04aa[_0xfdfa('0x2f')][_0xfdfa('0x1c')]);_0x37f70f[_0xfdfa('0x1a')]=qs[_0xfdfa('0x1a')](_0x2b04aa[_0xfdfa('0x2f')][_0xfdfa('0x1a')]);}_0x37f70f[_0xfdfa('0x37')]=qs[_0xfdfa('0x38')](_0x2b04aa['query'][_0xfdfa('0x38')]);_0x37f70f['where']=qs[_0xfdfa('0x30')](_[_0xfdfa('0x3a')](_0x2b04aa[_0xfdfa('0x2f')],_0x95ada2[_0xfdfa('0x30')]));_0x37f70f[_0xfdfa('0x39')]['CampaignId']=_0x598ba6['id'];if(_0x2b04aa['query'][_0xfdfa('0x3b')]){_0x37f70f[_0xfdfa('0x39')]=_[_0xfdfa('0x4f')](_0x37f70f[_0xfdfa('0x39')],{'$or':_[_0xfdfa('0x29')](_0x37f70f[_0xfdfa('0x32')],function(_0x4c12b2){var _0x28d0db={};_0x28d0db[_0x4c12b2]={'$like':'%'+_0x2b04aa[_0xfdfa('0x2f')][_0xfdfa('0x3b')]+'%'};return _0x28d0db;})});}_0x37f70f=_[_0xfdfa('0x4f')]({},_0x37f70f,_0x2b04aa[_0xfdfa('0x50')]);return db[_0xfdfa('0x5a')][_0xfdfa('0x1d')]({'where':_0x37f70f[_0xfdfa('0x39')]})[_0xfdfa('0x23')](function(_0x2543f4){_0xb0cfa4['count']=_0x2543f4;if(_0x2b04aa[_0xfdfa('0x2f')]['includeAll']){_0x37f70f[_0xfdfa('0x3f')]=[{'all':!![]}];}return db['CmHopper'][_0xfdfa('0x40')](_0x37f70f);})[_0xfdfa('0x23')](function(_0x131c13){_0xb0cfa4['rows']=_0x131c13;return _0xb0cfa4;});}})[_0xfdfa('0x23')](respondWithFilteredResult(_0x283c07,_0x37f70f))[_0xfdfa('0x42')](handleError(_0x283c07,null));};exports['getHopperHistories']=function(_0x1feb98,_0xd322b7,_0x10e28d){var _0xeae12c={'raw':!![],'where':{}};var _0x1cca08={};var _0x47310e={'count':0x0,'rows':[]};return db[_0xfdfa('0x2a')]['findOne']({'where':{'id':_0x1feb98['params']['id']}})[_0xfdfa('0x23')](handleEntityNotFound(_0xd322b7,null))[_0xfdfa('0x23')](function(_0x50393d){if(_0x50393d){_0x1cca08[_0xfdfa('0x2d')]=_[_0xfdfa('0x2e')](db[_0xfdfa('0x5b')][_0xfdfa('0x2b')]);_0x1cca08[_0xfdfa('0x2f')]=_['keys'](_0x1feb98[_0xfdfa('0x2f')]);_0x1cca08[_0xfdfa('0x30')]=_[_0xfdfa('0x31')](_0x1cca08[_0xfdfa('0x2d')],_0x1cca08[_0xfdfa('0x2f')]);_0xeae12c['attributes']=_[_0xfdfa('0x31')](_0x1cca08[_0xfdfa('0x2d')],qs[_0xfdfa('0x33')](_0x1feb98['query'][_0xfdfa('0x33')]));_0xeae12c[_0xfdfa('0x32')]=_0xeae12c[_0xfdfa('0x32')][_0xfdfa('0x34')]?_0xeae12c['attributes']:_0x1cca08[_0xfdfa('0x2d')];if(!_0x1feb98['query']['hasOwnProperty'](_0xfdfa('0x36'))){_0xeae12c[_0xfdfa('0x1c')]=qs['limit'](_0x1feb98[_0xfdfa('0x2f')]['limit']);_0xeae12c[_0xfdfa('0x1a')]=qs['offset'](_0x1feb98[_0xfdfa('0x2f')][_0xfdfa('0x1a')]);}_0xeae12c[_0xfdfa('0x37')]=qs['sort'](_0x1feb98['query']['sort']);_0xeae12c[_0xfdfa('0x39')]=qs[_0xfdfa('0x30')](_[_0xfdfa('0x3a')](_0x1feb98[_0xfdfa('0x2f')],_0x1cca08[_0xfdfa('0x30')]));_0xeae12c[_0xfdfa('0x39')][_0xfdfa('0x5c')]=_0x50393d['id'];if(_0x1feb98[_0xfdfa('0x2f')][_0xfdfa('0x3b')]){_0xeae12c[_0xfdfa('0x39')]=_[_0xfdfa('0x4f')](_0xeae12c[_0xfdfa('0x39')],{'$or':_[_0xfdfa('0x29')](_0xeae12c['attributes'],function(_0x4e865a){var _0x2b7ee0={};_0x2b7ee0[_0x4e865a]={'$like':'%'+_0x1feb98[_0xfdfa('0x2f')][_0xfdfa('0x3b')]+'%'};return _0x2b7ee0;})});}_0xeae12c=_[_0xfdfa('0x4f')]({},_0xeae12c,_0x1feb98['options']);return db['CmHopperHistory'][_0xfdfa('0x1d')]({'where':_0xeae12c[_0xfdfa('0x39')]})['then'](function(_0x3420ff){_0x47310e[_0xfdfa('0x1d')]=_0x3420ff;if(_0x1feb98[_0xfdfa('0x2f')]['includeAll']){_0xeae12c['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0xeae12c);})[_0xfdfa('0x23')](function(_0x53b4a0){_0x47310e['rows']=_0x53b4a0;return _0x47310e;});}})[_0xfdfa('0x23')](respondWithFilteredResult(_0xd322b7,_0xeae12c))[_0xfdfa('0x42')](handleError(_0xd322b7,null));};exports[_0xfdfa('0x5d')]=function(_0x384473,_0x246671,_0x4aa06b){var _0x554a6d={'raw':!![],'where':{}};var _0x2b7bef={};var _0xff03db={'count':0x0,'rows':[]};return db[_0xfdfa('0x2a')][_0xfdfa('0x59')]({'where':{'id':_0x384473[_0xfdfa('0x44')]['id']}})[_0xfdfa('0x23')](handleEntityNotFound(_0x246671,null))[_0xfdfa('0x23')](function(_0x4165cd){if(_0x4165cd){_0x2b7bef[_0xfdfa('0x2d')]=_['keys'](db[_0xfdfa('0x5e')]['rawAttributes']);_0x2b7bef[_0xfdfa('0x2f')]=_['keys'](_0x384473['query']);_0x2b7bef[_0xfdfa('0x30')]=_[_0xfdfa('0x31')](_0x2b7bef[_0xfdfa('0x2d')],_0x2b7bef['query']);_0x554a6d['attributes']=_[_0xfdfa('0x31')](_0x2b7bef[_0xfdfa('0x2d')],qs[_0xfdfa('0x33')](_0x384473['query']['fields']));_0x554a6d[_0xfdfa('0x32')]=_0x554a6d['attributes'][_0xfdfa('0x34')]?_0x554a6d['attributes']:_0x2b7bef[_0xfdfa('0x2d')];if(!_0x384473[_0xfdfa('0x2f')][_0xfdfa('0x35')](_0xfdfa('0x36'))){_0x554a6d[_0xfdfa('0x1c')]=qs['limit'](_0x384473[_0xfdfa('0x2f')]['limit']);_0x554a6d['offset']=qs['offset'](_0x384473[_0xfdfa('0x2f')]['offset']);}_0x554a6d[_0xfdfa('0x37')]=qs[_0xfdfa('0x38')](_0x384473['query'][_0xfdfa('0x38')]);_0x554a6d[_0xfdfa('0x39')]=qs[_0xfdfa('0x30')](_['pick'](_0x384473[_0xfdfa('0x2f')],_0x2b7bef[_0xfdfa('0x30')]));_0x554a6d[_0xfdfa('0x39')][_0xfdfa('0x5c')]=_0x4165cd['id'];if(_0x384473['query'][_0xfdfa('0x3b')]){_0x554a6d['where']=_[_0xfdfa('0x4f')](_0x554a6d[_0xfdfa('0x39')],{'$or':_[_0xfdfa('0x29')](_0x554a6d['attributes'],function(_0x2fa548){var _0x39f9e3={};_0x39f9e3[_0x2fa548]={'$like':'%'+_0x384473[_0xfdfa('0x2f')]['filter']+'%'};return _0x39f9e3;})});}_0x554a6d=_[_0xfdfa('0x4f')]({},_0x554a6d,_0x384473['options']);return db[_0xfdfa('0x5e')][_0xfdfa('0x1d')]({'where':_0x554a6d['where']})['then'](function(_0x3ec21f){_0xff03db['count']=_0x3ec21f;if(_0x384473[_0xfdfa('0x2f')]['includeAll']){_0x554a6d[_0xfdfa('0x3f')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xfdfa('0x40')](_0x554a6d);})['then'](function(_0x38ce95){_0xff03db['rows']=_0x38ce95;return _0xff03db;});}})['then'](respondWithFilteredResult(_0x246671,_0x554a6d))[_0xfdfa('0x42')](handleError(_0x246671,null));};exports[_0xfdfa('0x5f')]=function(_0x2677f6,_0x486ccf,_0x111b88){var _0xd3751d={'raw':!![],'where':{}};var _0x3da91d={};var _0x572870={'count':0x0,'rows':[]};return db[_0xfdfa('0x2a')][_0xfdfa('0x59')]({'where':{'id':_0x2677f6[_0xfdfa('0x44')]['id']}})[_0xfdfa('0x23')](handleEntityNotFound(_0x486ccf,null))[_0xfdfa('0x23')](function(_0x5260cf){if(_0x5260cf){_0x3da91d[_0xfdfa('0x2d')]=_[_0xfdfa('0x2e')](db[_0xfdfa('0x60')]['rawAttributes']);_0x3da91d[_0xfdfa('0x2f')]=_[_0xfdfa('0x2e')](_0x2677f6[_0xfdfa('0x2f')]);_0x3da91d['filters']=_[_0xfdfa('0x31')](_0x3da91d['model'],_0x3da91d[_0xfdfa('0x2f')]);_0xd3751d[_0xfdfa('0x32')]=_[_0xfdfa('0x31')](_0x3da91d[_0xfdfa('0x2d')],qs[_0xfdfa('0x33')](_0x2677f6['query'][_0xfdfa('0x33')]));_0xd3751d[_0xfdfa('0x32')]=_0xd3751d['attributes']['length']?_0xd3751d[_0xfdfa('0x32')]:_0x3da91d[_0xfdfa('0x2d')];if(!_0x2677f6[_0xfdfa('0x2f')][_0xfdfa('0x35')](_0xfdfa('0x36'))){_0xd3751d[_0xfdfa('0x1c')]=qs[_0xfdfa('0x1c')](_0x2677f6['query'][_0xfdfa('0x1c')]);_0xd3751d[_0xfdfa('0x1a')]=qs[_0xfdfa('0x1a')](_0x2677f6[_0xfdfa('0x2f')][_0xfdfa('0x1a')]);}_0xd3751d['order']=qs[_0xfdfa('0x38')](_0x2677f6['query'][_0xfdfa('0x38')]);_0xd3751d[_0xfdfa('0x39')]=qs[_0xfdfa('0x30')](_[_0xfdfa('0x3a')](_0x2677f6[_0xfdfa('0x2f')],_0x3da91d[_0xfdfa('0x30')]));_0xd3751d[_0xfdfa('0x39')][_0xfdfa('0x5c')]=_0x5260cf['id'];if(_0x2677f6[_0xfdfa('0x2f')][_0xfdfa('0x3b')]){_0xd3751d[_0xfdfa('0x39')]=_[_0xfdfa('0x4f')](_0xd3751d[_0xfdfa('0x39')],{'$or':_[_0xfdfa('0x29')](_0xd3751d[_0xfdfa('0x32')],function(_0x1421cb){var _0x505c98={};_0x505c98[_0x1421cb]={'$like':'%'+_0x2677f6[_0xfdfa('0x2f')][_0xfdfa('0x3b')]+'%'};return _0x505c98;})});}_0xd3751d=_[_0xfdfa('0x4f')]({},_0xd3751d,_0x2677f6[_0xfdfa('0x50')]);return db[_0xfdfa('0x60')][_0xfdfa('0x1d')]({'where':_0xd3751d['where']})[_0xfdfa('0x23')](function(_0x16f2b0){_0x572870[_0xfdfa('0x1d')]=_0x16f2b0;if(_0x2677f6[_0xfdfa('0x2f')]['includeAll']){_0xd3751d[_0xfdfa('0x3f')]=[{'all':!![]}];}return db[_0xfdfa('0x60')]['findAll'](_0xd3751d);})['then'](function(_0x141bcf){_0x572870[_0xfdfa('0x41')]=_0x141bcf;return _0x572870;});}})[_0xfdfa('0x23')](respondWithFilteredResult(_0x486ccf,_0xd3751d))[_0xfdfa('0x42')](handleError(_0x486ccf,null));};exports[_0xfdfa('0x61')]=function(_0x165c72,_0x400f5d,_0x17a20f){var _0x35dc9c={};var _0x102f25={};var _0x5adf63;var _0x1f226a;return db[_0xfdfa('0x2a')][_0xfdfa('0x59')]({'where':{'id':_0x165c72[_0xfdfa('0x44')]['id']}})[_0xfdfa('0x23')](handleEntityNotFound(_0x400f5d,null))[_0xfdfa('0x23')](function(_0x161c45){if(_0x161c45){_0x5adf63=_0x161c45;_0x102f25[_0xfdfa('0x2d')]=_[_0xfdfa('0x2e')](db['CmList']['rawAttributes']);_0x102f25['query']=_['keys'](_0x165c72['query']);_0x102f25[_0xfdfa('0x30')]=_[_0xfdfa('0x31')](_0x102f25['model'],_0x102f25['query']);_0x35dc9c[_0xfdfa('0x32')]=_['intersection'](_0x102f25['model'],qs[_0xfdfa('0x33')](_0x165c72[_0xfdfa('0x2f')][_0xfdfa('0x33')]));_0x35dc9c['attributes']=_0x35dc9c[_0xfdfa('0x32')][_0xfdfa('0x34')]?_0x35dc9c[_0xfdfa('0x32')]:_0x102f25[_0xfdfa('0x2d')];_0x35dc9c[_0xfdfa('0x37')]=qs['sort'](_0x165c72[_0xfdfa('0x2f')][_0xfdfa('0x38')]);_0x35dc9c[_0xfdfa('0x39')]=qs[_0xfdfa('0x30')](_['pick'](_0x165c72[_0xfdfa('0x2f')],_0x102f25[_0xfdfa('0x30')]));if(_0x165c72[_0xfdfa('0x2f')]['filter']){_0x35dc9c[_0xfdfa('0x39')]=_[_0xfdfa('0x4f')](_0x35dc9c[_0xfdfa('0x39')],{'$or':_[_0xfdfa('0x29')](_0x35dc9c[_0xfdfa('0x32')],function(_0x15a75c){var _0x26c251={};_0x26c251[_0x15a75c]={'$like':'%'+_0x165c72[_0xfdfa('0x2f')][_0xfdfa('0x3b')]+'%'};return _0x26c251;})});}_0x35dc9c=_['merge']({},_0x35dc9c,_0x165c72[_0xfdfa('0x50')]);return _0x5adf63[_0xfdfa('0x61')](_0x35dc9c);}})['then'](function(_0x415d1b){if(_0x415d1b){_0x1f226a=_0x415d1b[_0xfdfa('0x34')];if(!_0x165c72[_0xfdfa('0x2f')]['hasOwnProperty'](_0xfdfa('0x36'))){_0x35dc9c[_0xfdfa('0x1c')]=qs[_0xfdfa('0x1c')](_0x165c72[_0xfdfa('0x2f')]['limit']);_0x35dc9c[_0xfdfa('0x1a')]=qs[_0xfdfa('0x1a')](_0x165c72[_0xfdfa('0x2f')][_0xfdfa('0x1a')]);}return _0x5adf63['getLists'](_0x35dc9c);}})[_0xfdfa('0x23')](function(_0x256067){if(_0x256067){return _0x256067?{'count':_0x1f226a,'rows':_0x256067}:null;}})[_0xfdfa('0x23')](respondWithResult(_0x400f5d,null))[_0xfdfa('0x42')](handleError(_0x400f5d,null));};exports[_0xfdfa('0x62')]=function(_0x5032e5,_0x47d0a8,_0xbb3056){var _0x2a63e9,_0x281ac9;return db[_0xfdfa('0x2a')]['find']({'where':{'id':_0x5032e5[_0xfdfa('0x44')]['id']}})['then'](handleEntityNotFound(_0x47d0a8,null))[_0xfdfa('0x23')](function(_0xffe6f1){if(_0xffe6f1){_0x281ac9=_0xffe6f1;return _0xffe6f1['addLists'](_0x5032e5[_0xfdfa('0x47')][_0xfdfa('0x63')],_['omit'](_0x5032e5[_0xfdfa('0x47')],[_0xfdfa('0x63'),'id'])||{});}return null;})[_0xfdfa('0x64')](function(_0x44f150){var _0x12d6e1;_0x2a63e9=_0x44f150||[];var _0x7ea7b5=[];if(_0x44f150){for(var _0x2cb8ba=0x0;_0x2cb8ba<_0x44f150[_0xfdfa('0x34')];_0x2cb8ba+=0x1){var _0xe51dd9=_0x44f150[_0x2cb8ba][_0xfdfa('0x24')]({'plain':!![]});_0x281ac9[_0xfdfa('0x65')]=_0x5032e5[_0xfdfa('0x47')][_0xfdfa('0x65')]?_0x5032e5[_0xfdfa('0x47')][_0xfdfa('0x65')]:_0x281ac9[_0xfdfa('0x65')];switch(_0x281ac9['dialCheckDuplicateType']){case _0xfdfa('0x66'):_0x12d6e1=squel['insert']()[_0xfdfa('0x67')](_0xfdfa('0x68'))['fromQuery']([_0xfdfa('0x69'),_0xfdfa('0x6a'),_0xfdfa('0x6b'),_0xfdfa('0x6c'),_0xfdfa('0x5c'),_0xfdfa('0x52'),'updatedAt'],squel[_0xfdfa('0x6d')]()[_0xfdfa('0x6e')](_0xfdfa('0x69'),_0xfdfa('0x69'))[_0xfdfa('0x6e')](_0xfdfa('0x6f'),_0xfdfa('0x6a'))[_0xfdfa('0x6e')]('id',_0xfdfa('0x6b'))['field'](_0xe51dd9[_0xfdfa('0x70')]['toString'](),_0xfdfa('0x6c'))[_0xfdfa('0x6e')](_0x5032e5['params']['id'][_0xfdfa('0x71')](),'CampaignId')[_0xfdfa('0x6e')](_0xfdfa('0x6f'),'createdAt')[_0xfdfa('0x6e')](_0xfdfa('0x6f'),_0xfdfa('0x53'))[_0xfdfa('0x72')]('cm_contacts')[_0xfdfa('0x39')]('deletedAt\x20IS\x20NULL')[_0xfdfa('0x39')]('ListId\x20=\x20?',_0xe51dd9[_0xfdfa('0x70')]['toString']())['where'](_0xfdfa('0x73'))[_0xfdfa('0x39')](_0xfdfa('0x74'),squel[_0xfdfa('0x6d')]()[_0xfdfa('0x6e')](_0xfdfa('0x75'))[_0xfdfa('0x72')](_0xfdfa('0x76'))['where'](_0xfdfa('0x77'),_0x5032e5[_0xfdfa('0x44')]['id']['toString']()))[_0xfdfa('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xfdfa('0x6d')]()['field'](_0xfdfa('0x78'))[_0xfdfa('0x72')](_0xfdfa('0x68'))[_0xfdfa('0x39')](_0xfdfa('0x77'),_0x5032e5[_0xfdfa('0x44')]['id'][_0xfdfa('0x71')]())))[_0xfdfa('0x71')]();break;case'onlyIfOpen':_0x12d6e1=squel[_0xfdfa('0x79')]()[_0xfdfa('0x67')](_0xfdfa('0x68'))[_0xfdfa('0x7a')]([_0xfdfa('0x69'),_0xfdfa('0x6a'),_0xfdfa('0x6b'),_0xfdfa('0x6c'),_0xfdfa('0x5c'),_0xfdfa('0x52'),'updatedAt'],squel[_0xfdfa('0x6d')]()[_0xfdfa('0x6e')](_0xfdfa('0x69'),_0xfdfa('0x69'))[_0xfdfa('0x6e')](_0xfdfa('0x6f'),_0xfdfa('0x6a'))[_0xfdfa('0x6e')]('id',_0xfdfa('0x6b'))['field'](_0xe51dd9['CmListId'][_0xfdfa('0x71')](),_0xfdfa('0x6c'))[_0xfdfa('0x6e')](_0x5032e5['params']['id'][_0xfdfa('0x71')](),_0xfdfa('0x5c'))[_0xfdfa('0x6e')]('NOW()','createdAt')['field'](_0xfdfa('0x6f'),_0xfdfa('0x53'))[_0xfdfa('0x72')](_0xfdfa('0x7b'))[_0xfdfa('0x39')]('deletedAt\x20IS\x20NULL')[_0xfdfa('0x39')](_0xfdfa('0x7c'),_0xe51dd9[_0xfdfa('0x70')][_0xfdfa('0x71')]())[_0xfdfa('0x39')](_0xfdfa('0x73'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xfdfa('0x6d')]()[_0xfdfa('0x6e')](_0xfdfa('0x78'))['from'](_0xfdfa('0x68'))[_0xfdfa('0x39')](_0xfdfa('0x77'),_0x5032e5[_0xfdfa('0x44')]['id'][_0xfdfa('0x71')]())))[_0xfdfa('0x71')]();break;default:_0x12d6e1=squel['insert']()[_0xfdfa('0x67')](_0xfdfa('0x68'))['fromQuery']([_0xfdfa('0x69'),_0xfdfa('0x6a'),'ContactId',_0xfdfa('0x6c'),_0xfdfa('0x5c'),'createdAt','updatedAt'],squel[_0xfdfa('0x6d')]()[_0xfdfa('0x6e')]('phone','phone')[_0xfdfa('0x6e')]('NOW()',_0xfdfa('0x6a'))['field']('id',_0xfdfa('0x6b'))[_0xfdfa('0x6e')](_0xe51dd9['CmListId'][_0xfdfa('0x71')](),_0xfdfa('0x6c'))['field'](_0x5032e5[_0xfdfa('0x44')]['id'][_0xfdfa('0x71')](),_0xfdfa('0x5c'))[_0xfdfa('0x6e')](_0xfdfa('0x6f'),_0xfdfa('0x52'))[_0xfdfa('0x6e')]('NOW()',_0xfdfa('0x53'))[_0xfdfa('0x72')]('cm_contacts')[_0xfdfa('0x39')]('deletedAt\x20IS\x20NULL')[_0xfdfa('0x39')](_0xfdfa('0x7c'),_0xe51dd9[_0xfdfa('0x70')][_0xfdfa('0x71')]())[_0xfdfa('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0xfdfa('0x71')]();}_0x7ea7b5['push'](db['sequelize'][_0xfdfa('0x2f')](_0x12d6e1));}return BPromise[_0xfdfa('0x7d')](_0x7ea7b5);}})[_0xfdfa('0x23')](function(){return _0x2a63e9;})[_0xfdfa('0x23')](respondWithResult(_0x47d0a8,null))[_0xfdfa('0x42')](handleError(_0x47d0a8,null));};exports['removeLists']=function(_0x1fa831,_0x243844,_0x5d069e){return db['Campaign'][_0xfdfa('0x45')]({'where':{'id':_0x1fa831[_0xfdfa('0x44')]['id']}})['then'](handleEntityNotFound(_0x243844,null))[_0xfdfa('0x23')](function(_0x1a7bfc){if(_0x1a7bfc){return _0x1a7bfc[_0xfdfa('0x7e')](_0x1fa831[_0xfdfa('0x2f')][_0xfdfa('0x63')]);}})['then'](function(_0x476b81){if(_0x476b81){return db[_0xfdfa('0x5a')]['destroy']({'where':{'ListId':_0x1fa831[_0xfdfa('0x2f')][_0xfdfa('0x63')],'CampaignId':_0x1fa831[_0xfdfa('0x44')]['id']}})[_0xfdfa('0x23')](function(){return _0x476b81;});}})[_0xfdfa('0x23')](respondWithStatusCode(_0x243844,null))[_0xfdfa('0x42')](handleError(_0x243844,null));};exports[_0xfdfa('0x7f')]=function(_0x1ced78,_0x4472c4,_0x5e9ea7){var _0x47a0a6={};var _0x5f1f41={};var _0x3b52f2;var _0xa6bed7;return db['Campaign'][_0xfdfa('0x59')]({'where':{'id':_0x1ced78[_0xfdfa('0x44')]['id']}})['then'](handleEntityNotFound(_0x4472c4,null))[_0xfdfa('0x23')](function(_0x518a45){if(_0x518a45){_0x3b52f2=_0x518a45;_0x5f1f41['model']=_[_0xfdfa('0x2e')](db['CmList']['rawAttributes']);_0x5f1f41[_0xfdfa('0x2f')]=_[_0xfdfa('0x2e')](_0x1ced78[_0xfdfa('0x2f')]);_0x5f1f41['filters']=_['intersection'](_0x5f1f41['model'],_0x5f1f41[_0xfdfa('0x2f')]);_0x47a0a6[_0xfdfa('0x32')]=_['intersection'](_0x5f1f41[_0xfdfa('0x2d')],qs[_0xfdfa('0x33')](_0x1ced78['query'][_0xfdfa('0x33')]));_0x47a0a6[_0xfdfa('0x32')]=_0x47a0a6['attributes']['length']?_0x47a0a6[_0xfdfa('0x32')]:_0x5f1f41[_0xfdfa('0x2d')];_0x47a0a6[_0xfdfa('0x37')]=qs[_0xfdfa('0x38')](_0x1ced78[_0xfdfa('0x2f')][_0xfdfa('0x38')]);_0x47a0a6[_0xfdfa('0x39')]=qs['filters'](_['pick'](_0x1ced78[_0xfdfa('0x2f')],_0x5f1f41[_0xfdfa('0x30')]));if(_0x1ced78['query'][_0xfdfa('0x3b')]){_0x47a0a6[_0xfdfa('0x39')]=_['merge'](_0x47a0a6[_0xfdfa('0x39')],{'$or':_[_0xfdfa('0x29')](_0x47a0a6[_0xfdfa('0x32')],function(_0x138a36){var _0x12e208={};_0x12e208[_0x138a36]={'$like':'%'+_0x1ced78['query'][_0xfdfa('0x3b')]+'%'};return _0x12e208;})});}_0x47a0a6=_[_0xfdfa('0x4f')]({},_0x47a0a6,_0x1ced78[_0xfdfa('0x50')]);return _0x3b52f2[_0xfdfa('0x7f')](_0x47a0a6);}})[_0xfdfa('0x23')](function(_0x399453){if(_0x399453){_0xa6bed7=_0x399453[_0xfdfa('0x34')];if(!_0x1ced78['query'][_0xfdfa('0x35')](_0xfdfa('0x36'))){_0x47a0a6[_0xfdfa('0x1c')]=qs[_0xfdfa('0x1c')](_0x1ced78['query']['limit']);_0x47a0a6[_0xfdfa('0x1a')]=qs[_0xfdfa('0x1a')](_0x1ced78[_0xfdfa('0x2f')][_0xfdfa('0x1a')]);}return _0x3b52f2[_0xfdfa('0x7f')](_0x47a0a6);}})[_0xfdfa('0x23')](function(_0x5fe088){if(_0x5fe088){return _0x5fe088?{'count':_0xa6bed7,'rows':_0x5fe088}:null;}})[_0xfdfa('0x23')](respondWithResult(_0x4472c4,null))['catch'](handleError(_0x4472c4,null));};exports[_0xfdfa('0x80')]=function(_0x497d57,_0x5357a2,_0x11deaa){var _0x50a9b8,_0x473dcf;return db[_0xfdfa('0x2a')][_0xfdfa('0x45')]({'where':{'id':_0x497d57[_0xfdfa('0x44')]['id']}})[_0xfdfa('0x23')](handleEntityNotFound(_0x5357a2,null))[_0xfdfa('0x23')](function(_0x50fdae){if(_0x50fdae){_0x473dcf=_0x50fdae;return _0x50fdae[_0xfdfa('0x80')](_0x497d57[_0xfdfa('0x47')][_0xfdfa('0x63')],_[_0xfdfa('0x51')](_0x497d57[_0xfdfa('0x47')],[_0xfdfa('0x63'),'id'])||{});}return null;})[_0xfdfa('0x64')](function(_0x52e3f5){var _0xf416fa;_0x50a9b8=_0x52e3f5||[];var _0x2b32f0=[];if(_0x52e3f5){for(var _0x2b993b=0x0;_0x2b993b<_0x52e3f5[_0xfdfa('0x34')];_0x2b993b+=0x1){var _0x940f82=_0x52e3f5[_0x2b993b][_0xfdfa('0x24')]({'plain':!![]});_0xf416fa=squel[_0xfdfa('0x79')]()[_0xfdfa('0x67')](_0xfdfa('0x81'))[_0xfdfa('0x7a')]([_0xfdfa('0x69'),_0xfdfa('0x6b'),_0xfdfa('0x6c'),_0xfdfa('0x5c'),_0xfdfa('0x52'),_0xfdfa('0x53')],squel[_0xfdfa('0x6d')]()[_0xfdfa('0x6e')](_0xfdfa('0x69'),_0xfdfa('0x69'))[_0xfdfa('0x6e')]('id',_0xfdfa('0x6b'))[_0xfdfa('0x6e')](_0x940f82[_0xfdfa('0x70')][_0xfdfa('0x71')](),_0xfdfa('0x6c'))[_0xfdfa('0x6e')](_0x497d57[_0xfdfa('0x44')]['id'][_0xfdfa('0x71')](),_0xfdfa('0x5c'))[_0xfdfa('0x6e')](_0xfdfa('0x6f'),_0xfdfa('0x52'))[_0xfdfa('0x6e')]('NOW()',_0xfdfa('0x53'))[_0xfdfa('0x72')](_0xfdfa('0x7b'))[_0xfdfa('0x39')](_0xfdfa('0x82'))[_0xfdfa('0x39')](_0xfdfa('0x7c'),_0x940f82[_0xfdfa('0x70')][_0xfdfa('0x71')]())['where'](_0xfdfa('0x73')))[_0xfdfa('0x71')]();_0x2b32f0[_0xfdfa('0x83')](db[_0xfdfa('0x84')]['query'](_0xf416fa));}return BPromise[_0xfdfa('0x7d')](_0x2b32f0);}})[_0xfdfa('0x23')](function(){return _0x50a9b8;})[_0xfdfa('0x23')](respondWithResult(_0x5357a2,null))[_0xfdfa('0x42')](handleError(_0x5357a2,null));};exports['removeBlackLists']=function(_0x3ae16b,_0x478cd5,_0x8c903a){return db['Campaign'][_0xfdfa('0x45')]({'where':{'id':_0x3ae16b[_0xfdfa('0x44')]['id']}})[_0xfdfa('0x23')](handleEntityNotFound(_0x478cd5,null))['then'](function(_0x98fcd5){if(_0x98fcd5){return _0x98fcd5['removeBlackLists'](_0x3ae16b[_0xfdfa('0x2f')]['ids']);}})[_0xfdfa('0x23')](function(_0x2e7654){if(_0x2e7654){return db[_0xfdfa('0x60')][_0xfdfa('0x57')]({'where':{'ListId':_0x3ae16b[_0xfdfa('0x2f')][_0xfdfa('0x63')],'CampaignId':_0x3ae16b['params']['id']}})[_0xfdfa('0x23')](function(){return _0x2e7654;});}})[_0xfdfa('0x23')](respondWithStatusCode(_0x478cd5,null))[_0xfdfa('0x42')](handleError(_0x478cd5,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 497f85d..9d5cca8 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(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x251597,_0x3ffa57){var _0x4c8d25=function(_0x2bc575){while(--_0x2bc575){_0x251597['push'](_0x251597['shift']());}};_0x4c8d25(++_0x3ffa57);}(_0x7a54,0x106));var _0x47a5=function(_0x21bd26,_0x3af357){_0x21bd26=_0x21bd26-0x0;var _0x5244ed=_0x7a54[_0x21bd26];return _0x5244ed;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 5735f5f..2093cd0 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 _0xa0bc=['client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCampaign','findAll','options','raw','attributes','limit','include','map','model','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x76b53c,_0x4b5994){var _0x4eb193=function(_0xf652d0){while(--_0xf652d0){_0x76b53c['push'](_0x76b53c['shift']());}};_0x4eb193(++_0x4b5994);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xca0b('0x0'));var moment=require(_0xca0b('0x1'));var BPromise=require('bluebird');var rs=require(_0xca0b('0x2'));var fs=require('fs');var Redis=require(_0xca0b('0x3'));var db=require(_0xca0b('0x4'))['db'];var utils=require(_0xca0b('0x5'));var logger=require(_0xca0b('0x6'))(_0xca0b('0x7'));var config=require(_0xca0b('0x8'));var jayson=require(_0xca0b('0x9'));var client=jayson[_0xca0b('0xa')][_0xca0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbe64c7,_0x30202d,_0xa506a4){return new BPromise(function(_0x19acc2,_0x55a1de){return client[_0xca0b('0xc')](_0xbe64c7,_0xa506a4)[_0xca0b('0xd')](function(_0x3e3909){logger[_0xca0b('0xe')](_0xca0b('0xf'),_0x30202d,_0xca0b('0x10'));logger['debug'](_0xca0b('0x11'),_0x30202d,_0xca0b('0x10'),JSON[_0xca0b('0x12')](_0x3e3909));if(_0x3e3909[_0xca0b('0x13')]){if(_0x3e3909[_0xca0b('0x13')][_0xca0b('0x14')]===0x1f4){logger[_0xca0b('0x13')](_0xca0b('0xf'),_0x30202d,_0x3e3909[_0xca0b('0x13')][_0xca0b('0x15')]);return _0x55a1de(_0x3e3909['error'][_0xca0b('0x15')]);}logger[_0xca0b('0x13')](_0xca0b('0xf'),_0x30202d,_0x3e3909['error'][_0xca0b('0x15')]);return _0x19acc2(_0x3e3909[_0xca0b('0x13')][_0xca0b('0x15')]);}else{logger[_0xca0b('0xe')](_0xca0b('0xf'),_0x30202d,_0xca0b('0x10'));_0x19acc2(_0x3e3909['result'][_0xca0b('0x15')]);}})[_0xca0b('0x16')](function(_0x4d9b16){logger[_0xca0b('0x13')]('Campaign,\x20%s,\x20%s',_0x30202d,_0x4d9b16);_0x55a1de(_0x4d9b16);});});}exports[_0xca0b('0x17')]=function(_0x5050b7){var _0x236503=this;return new Promise(function(_0x32eff7,_0x97be82){return db['Campaign'][_0xca0b('0x18')]({'raw':_0x5050b7[_0xca0b('0x19')]?_0x5050b7['options'][_0xca0b('0x1a')]===undefined?!![]:![]:!![],'where':_0x5050b7[_0xca0b('0x19')]?_0x5050b7[_0xca0b('0x19')]['where']||null:null,'attributes':_0x5050b7[_0xca0b('0x19')]?_0x5050b7[_0xca0b('0x19')][_0xca0b('0x1b')]||null:null,'limit':_0x5050b7[_0xca0b('0x19')]?_0x5050b7[_0xca0b('0x19')][_0xca0b('0x1c')]||null:null,'include':_0x5050b7['options']?_0x5050b7[_0xca0b('0x19')][_0xca0b('0x1d')]?_[_0xca0b('0x1e')](_0x5050b7['options']['include'],function(_0x11f5c3){return{'model':db[_0x11f5c3[_0xca0b('0x1f')]],'as':_0x11f5c3['as'],'attributes':_0x11f5c3[_0xca0b('0x1b')],'include':_0x11f5c3[_0xca0b('0x1d')]?_[_0xca0b('0x1e')](_0x11f5c3['include'],function(_0xe122e8){return{'model':db[_0xe122e8[_0xca0b('0x1f')]],'as':_0xe122e8['as'],'attributes':_0xe122e8[_0xca0b('0x1b')],'include':_0xe122e8[_0xca0b('0x1d')]?_[_0xca0b('0x1e')](_0xe122e8['include'],function(_0x4d2d1a){return{'model':db[_0x4d2d1a['model']],'as':_0x4d2d1a['as'],'attributes':_0x4d2d1a[_0xca0b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xca0b('0xd')](function(_0x3fd832){logger[_0xca0b('0xe')](_0xca0b('0x17'),_0x5050b7);logger['debug'](_0xca0b('0x17'),_0x5050b7,JSON[_0xca0b('0x12')](_0x3fd832));_0x32eff7(_0x3fd832);})[_0xca0b('0x16')](function(_0x20f0d5){logger[_0xca0b('0x13')](_0xca0b('0x17'),_0x20f0d5[_0xca0b('0x15')],_0x5050b7);_0x97be82(_0x236503['error'](0x1f4,_0x20f0d5[_0xca0b('0x15')]));});});}; \ No newline at end of file +var _0x1c42=['debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetCampaign','Campaign','findAll','options','raw','limit','include','map','model','attributes','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x44dd23,_0x18657){var _0x1fb4c6=function(_0x288d3d){while(--_0x288d3d){_0x44dd23['push'](_0x44dd23['shift']());}};_0x1fb4c6(++_0x18657);}(_0x1c42,0x13a));var _0x21c4=function(_0x2087e3,_0xca21){_0x2087e3=_0x2087e3-0x0;var _0x687341=_0x1c42[_0x2087e3];return _0x687341;};'use strict';var _=require('lodash');var util=require(_0x21c4('0x0'));var moment=require(_0x21c4('0x1'));var BPromise=require(_0x21c4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x21c4('0x3'));var db=require(_0x21c4('0x4'))['db'];var utils=require(_0x21c4('0x5'));var logger=require(_0x21c4('0x6'))(_0x21c4('0x7'));var config=require(_0x21c4('0x8'));var jayson=require(_0x21c4('0x9'));var client=jayson[_0x21c4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x247ec9,_0x472df1,_0x54b2ea){return new BPromise(function(_0x184e75,_0x57e04f){return client[_0x21c4('0xb')](_0x247ec9,_0x54b2ea)[_0x21c4('0xc')](function(_0x1fac06){logger[_0x21c4('0xd')](_0x21c4('0xe'),_0x472df1,_0x21c4('0xf'));logger[_0x21c4('0x10')](_0x21c4('0x11'),_0x472df1,_0x21c4('0xf'),JSON['stringify'](_0x1fac06));if(_0x1fac06[_0x21c4('0x12')]){if(_0x1fac06['error'][_0x21c4('0x13')]===0x1f4){logger['error'](_0x21c4('0xe'),_0x472df1,_0x1fac06[_0x21c4('0x12')][_0x21c4('0x14')]);return _0x57e04f(_0x1fac06[_0x21c4('0x12')][_0x21c4('0x14')]);}logger[_0x21c4('0x12')](_0x21c4('0xe'),_0x472df1,_0x1fac06[_0x21c4('0x12')][_0x21c4('0x14')]);return _0x184e75(_0x1fac06[_0x21c4('0x12')][_0x21c4('0x14')]);}else{logger[_0x21c4('0xd')](_0x21c4('0xe'),_0x472df1,'request\x20sent');_0x184e75(_0x1fac06['result'][_0x21c4('0x14')]);}})[_0x21c4('0x15')](function(_0x230dce){logger[_0x21c4('0x12')](_0x21c4('0xe'),_0x472df1,_0x230dce);_0x57e04f(_0x230dce);});});}exports[_0x21c4('0x16')]=function(_0x38fa2b){var _0x9cd43c=this;return new Promise(function(_0x2309f6,_0x113604){return db[_0x21c4('0x17')][_0x21c4('0x18')]({'raw':_0x38fa2b[_0x21c4('0x19')]?_0x38fa2b[_0x21c4('0x19')][_0x21c4('0x1a')]===undefined?!![]:![]:!![],'where':_0x38fa2b[_0x21c4('0x19')]?_0x38fa2b['options']['where']||null:null,'attributes':_0x38fa2b[_0x21c4('0x19')]?_0x38fa2b[_0x21c4('0x19')]['attributes']||null:null,'limit':_0x38fa2b[_0x21c4('0x19')]?_0x38fa2b['options'][_0x21c4('0x1b')]||null:null,'include':_0x38fa2b[_0x21c4('0x19')]?_0x38fa2b[_0x21c4('0x19')][_0x21c4('0x1c')]?_[_0x21c4('0x1d')](_0x38fa2b[_0x21c4('0x19')][_0x21c4('0x1c')],function(_0x473128){return{'model':db[_0x473128[_0x21c4('0x1e')]],'as':_0x473128['as'],'attributes':_0x473128['attributes'],'include':_0x473128['include']?_[_0x21c4('0x1d')](_0x473128['include'],function(_0x59af96){return{'model':db[_0x59af96[_0x21c4('0x1e')]],'as':_0x59af96['as'],'attributes':_0x59af96[_0x21c4('0x1f')],'include':_0x59af96[_0x21c4('0x1c')]?_[_0x21c4('0x1d')](_0x59af96[_0x21c4('0x1c')],function(_0x4923c4){return{'model':db[_0x4923c4[_0x21c4('0x1e')]],'as':_0x4923c4['as'],'attributes':_0x4923c4[_0x21c4('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2be1d7){logger[_0x21c4('0xd')](_0x21c4('0x16'),_0x38fa2b);logger['debug']('GetCampaign',_0x38fa2b,JSON[_0x21c4('0x20')](_0x2be1d7));_0x2309f6(_0x2be1d7);})[_0x21c4('0x15')](function(_0x46582f){logger[_0x21c4('0x12')](_0x21c4('0x16'),_0x46582f[_0x21c4('0x14')],_0x38fa2b);_0x113604(_0x9cd43c['error'](0x1f4,_0x46582f['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index b09eced..a81841d 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 _0x5d7b=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','getLists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','/:id/blacklists','addBlackLists','put','update'];(function(_0x4cab19,_0x5b8244){var _0x4574d7=function(_0x3e4d42){while(--_0x3e4d42){_0x4cab19['push'](_0x4cab19['shift']());}};_0x4574d7(++_0x5b8244);}(_0x5d7b,0x1e2));var _0xb5d7=function(_0x39204a,_0x55286f){_0x39204a=_0x39204a-0x0;var _0x129eef=_0x5d7b[_0x39204a];return _0x129eef;};'use strict';var multer=require(_0xb5d7('0x0'));var util=require(_0xb5d7('0x1'));var path=require(_0xb5d7('0x2'));var timeout=require(_0xb5d7('0x3'));var express=require(_0xb5d7('0x4'));var router=express[_0xb5d7('0x5')]();var fs_extra=require(_0xb5d7('0x6'));var auth=require(_0xb5d7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb5d7('0x8'));var controller=require('./campaign.controller');router[_0xb5d7('0x9')]('/',auth[_0xb5d7('0xa')](),controller[_0xb5d7('0xb')]);router[_0xb5d7('0x9')](_0xb5d7('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb5d7('0x9')](_0xb5d7('0xd'),auth[_0xb5d7('0xa')](),controller[_0xb5d7('0xe')]);router['get'](_0xb5d7('0xf'),auth[_0xb5d7('0xa')](),controller[_0xb5d7('0x10')]);router[_0xb5d7('0x9')]('/:id/hopper_finals',auth[_0xb5d7('0xa')](),controller['getHopperFinals']);router['get'](_0xb5d7('0x11'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xb5d7('0x9')]('/:id/lists',auth[_0xb5d7('0xa')](),controller[_0xb5d7('0x12')]);router[_0xb5d7('0x9')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xb5d7('0x13')]);router[_0xb5d7('0x14')]('/',auth['isAuthenticated'](),controller[_0xb5d7('0x15')]);router[_0xb5d7('0x14')](_0xb5d7('0x16'),auth[_0xb5d7('0xa')](),controller[_0xb5d7('0x17')]);router[_0xb5d7('0x14')](_0xb5d7('0x18'),auth['isAuthenticated'](),controller[_0xb5d7('0x19')]);router['post'](_0xb5d7('0x1a'),auth['isAuthenticated'](),controller[_0xb5d7('0x1b')]);router[_0xb5d7('0x1c')](_0xb5d7('0xc'),auth[_0xb5d7('0xa')](),controller[_0xb5d7('0x1d')]);router[_0xb5d7('0x1e')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xb5d7('0x1e')](_0xb5d7('0x18'),auth[_0xb5d7('0xa')](),controller['removeLists']);router[_0xb5d7('0x1e')](_0xb5d7('0x1a'),auth[_0xb5d7('0xa')](),controller['removeBlackLists']);module[_0xb5d7('0x1f')]=router; \ No newline at end of file +var _0x7d82=['multer','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getBlackLists','post','create','addLists','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7d82,0x174));var _0x27d8=function(_0x529151,_0x2cc57d){_0x529151=_0x529151-0x0;var _0x496bc5=_0x7d82[_0x529151];return _0x496bc5;};'use strict';var multer=require(_0x27d8('0x0'));var util=require('util');var path=require(_0x27d8('0x1'));var timeout=require('connect-timeout');var express=require(_0x27d8('0x2'));var router=express[_0x27d8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x27d8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x27d8('0x5'));var controller=require('./campaign.controller');router[_0x27d8('0x6')]('/',auth[_0x27d8('0x7')](),controller[_0x27d8('0x8')]);router[_0x27d8('0x6')](_0x27d8('0x9'),auth['isAuthenticated'](),controller[_0x27d8('0xa')]);router[_0x27d8('0x6')](_0x27d8('0xb'),auth[_0x27d8('0x7')](),controller[_0x27d8('0xc')]);router[_0x27d8('0x6')](_0x27d8('0xd'),auth[_0x27d8('0x7')](),controller[_0x27d8('0xe')]);router[_0x27d8('0x6')]('/:id/hopper_finals',auth[_0x27d8('0x7')](),controller[_0x27d8('0xf')]);router[_0x27d8('0x6')](_0x27d8('0x10'),auth['isAuthenticated'](),controller[_0x27d8('0x11')]);router[_0x27d8('0x6')](_0x27d8('0x12'),auth[_0x27d8('0x7')](),controller['getLists']);router[_0x27d8('0x6')]('/:id/blacklists',auth[_0x27d8('0x7')](),controller[_0x27d8('0x13')]);router[_0x27d8('0x14')]('/',auth[_0x27d8('0x7')](),controller[_0x27d8('0x15')]);router[_0x27d8('0x14')]('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0x27d8('0x14')]('/:id/lists',auth[_0x27d8('0x7')](),controller[_0x27d8('0x16')]);router[_0x27d8('0x14')](_0x27d8('0x17'),auth[_0x27d8('0x7')](),controller[_0x27d8('0x18')]);router[_0x27d8('0x19')](_0x27d8('0x9'),auth['isAuthenticated'](),controller[_0x27d8('0x1a')]);router[_0x27d8('0x1b')]('/:id',auth[_0x27d8('0x7')](),controller[_0x27d8('0x1c')]);router[_0x27d8('0x1b')](_0x27d8('0x12'),auth[_0x27d8('0x7')](),controller[_0x27d8('0x1d')]);router[_0x27d8('0x1b')](_0x27d8('0x17'),auth['isAuthenticated'](),controller[_0x27d8('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index d11585a..1319d0a 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 _0xe924=['getDataValue','key','exports','VIRTUAL'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xe924,0x1ea));var _0x4e92=function(_0x5050cd,_0x504a1a){_0x5050cd=_0x5050cd-0x0;var _0x29d2be=_0xe924[_0x5050cd];return _0x29d2be;};'use strict';var Sequelize=require('sequelize');module[_0x4e92('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x4e92('0x1')],'get':function(){return this[_0x4e92('0x2')](_0x4e92('0x3'));}}}; \ No newline at end of file +var _0x15d6=['STRING','TEXT','getDataValue','key'];(function(_0x359842,_0xd7d82d){var _0x317362=function(_0x5cc5fb){while(--_0x5cc5fb){_0x359842['push'](_0x359842['shift']());}};_0x317362(++_0xd7d82d);}(_0x15d6,0x100));var _0x615d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x15d6[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x615d('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x615d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x615d('0x0')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x615d('0x2')](_0x615d('0x3'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 818516a..17952c9 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 _0x40c0=['sendStatus','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','keys','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','CannedAnswers','UserProfileResource'];(function(_0xb4cda4,_0x2633ed){var _0x547fc1=function(_0x43df27){while(--_0x43df27){_0xb4cda4['push'](_0xb4cda4['shift']());}};_0x547fc1(++_0x2633ed);}(_0x40c0,0x80));var _0x040c=function(_0x11948e,_0x54dae6){_0x11948e=_0x11948e-0x0;var _0x4f2d84=_0x40c0[_0x11948e];return _0x4f2d84;};'use strict';var emlformat=require(_0x040c('0x0'));var rimraf=require(_0x040c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x040c('0x2'));var moment=require(_0x040c('0x3'));var BPromise=require(_0x040c('0x4'));var Mustache=require(_0x040c('0x5'));var util=require('util');var path=require(_0x040c('0x6'));var sox=require('sox');var csv=require(_0x040c('0x7'));var ejs=require(_0x040c('0x8'));var fs=require('fs');var fs_extra=require(_0x040c('0x9'));var _=require(_0x040c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x040c('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x040c('0xc'));var Redis=require(_0x040c('0xd'));var authService=require(_0x040c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x040c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x040c('0x10'))(_0x040c('0x11'));var utils=require(_0x040c('0x12'));var config=require(_0x040c('0x13'));var licenseUtil=require(_0x040c('0x14'));var db=require(_0x040c('0x15'))['db'];function respondWithStatusCode(_0x3d866a,_0x4f6b68){_0x4f6b68=_0x4f6b68||0xcc;return function(_0x2b284c){if(_0x2b284c){return _0x3d866a['sendStatus'](_0x4f6b68);}return _0x3d866a[_0x040c('0x16')](_0x4f6b68)[_0x040c('0x17')]();};}function respondWithResult(_0x140515,_0x44ac1c){_0x44ac1c=_0x44ac1c||0xc8;return function(_0x571028){if(_0x571028){return _0x140515['status'](_0x44ac1c)[_0x040c('0x18')](_0x571028);}};}function respondWithFilteredResult(_0x52650f,_0x4b2512){return function(_0xdd61c8){if(_0xdd61c8){var _0x97c914=typeof _0x4b2512[_0x040c('0x19')]===_0x040c('0x1a')&&typeof _0x4b2512[_0x040c('0x1b')]===_0x040c('0x1a');var _0x1e166b=_0xdd61c8[_0x040c('0x1c')];var _0x2cbf2e=_0x97c914?0x0:_0x4b2512[_0x040c('0x19')];var _0x5be084=_0x97c914?_0xdd61c8[_0x040c('0x1c')]:_0x4b2512[_0x040c('0x19')]+_0x4b2512[_0x040c('0x1b')];var _0x4051ef;if(_0x5be084>=_0x1e166b){_0x5be084=_0x1e166b;_0x4051ef=0xc8;}else{_0x4051ef=0xce;}_0x52650f[_0x040c('0x16')](_0x4051ef);return _0x52650f[_0x040c('0x1d')](_0x040c('0x1e'),_0x2cbf2e+'-'+_0x5be084+'/'+_0x1e166b)[_0x040c('0x18')](_0xdd61c8);}return null;};}function patchUpdates(_0x484713){return function(_0x20263b){try{jsonpatch[_0x040c('0x1f')](_0x20263b,_0x484713,!![]);}catch(_0x2acbf1){return BPromise['reject'](_0x2acbf1);}return _0x20263b['save']();};}function saveUpdates(_0x5090fe,_0x420d27){return function(_0x43127a){if(_0x43127a){return _0x43127a[_0x040c('0x20')](_0x5090fe)[_0x040c('0x21')](function(_0x5af0dc){return _0x5af0dc;});}return null;};}function removeEntity(_0x7049a1,_0xd45404){return function(_0x87371e){if(_0x87371e){return _0x87371e[_0x040c('0x22')]()[_0x040c('0x21')](function(){var _0x46b0b8=_0x87371e[_0x040c('0x23')]({'plain':!![]});var _0x755acb=_0x040c('0x24');return db[_0x040c('0x25')]['destroy']({'where':{'type':_0x755acb,'resourceId':_0x46b0b8['id']}})[_0x040c('0x21')](function(){return _0x87371e;});})[_0x040c('0x21')](function(){_0x7049a1['status'](0xcc)[_0x040c('0x17')]();});}};}function handleEntityNotFound(_0x358305,_0x5ba181){return function(_0x36896f){if(!_0x36896f){_0x358305[_0x040c('0x26')](0x194);}return _0x36896f;};}function handleError(_0x5655c7,_0x3ffa58){_0x3ffa58=_0x3ffa58||0x1f4;return function(_0x484cf5){logger[_0x040c('0x27')](_0x484cf5['stack']);if(_0x484cf5['name']){delete _0x484cf5[_0x040c('0x28')];}_0x5655c7[_0x040c('0x16')](_0x3ffa58)[_0x040c('0x29')](_0x484cf5);};}exports[_0x040c('0x2a')]=function(_0x3ba3b8,_0x490723){var _0x46ee2e={},_0xa600aa={},_0x415d06={'count':0x0,'rows':[]};var _0x292e24=_[_0x040c('0x2b')](db[_0x040c('0x2c')][_0x040c('0x2d')],function(_0x3b980d){return{'name':_0x3b980d[_0x040c('0x2e')],'type':_0x3b980d[_0x040c('0x2f')][_0x040c('0x30')]};});_0xa600aa['model']=_['map'](_0x292e24,_0x040c('0x28'));_0xa600aa['query']=_['keys'](_0x3ba3b8['query']);_0xa600aa[_0x040c('0x31')]=_[_0x040c('0x32')](_0xa600aa['model'],_0xa600aa[_0x040c('0x33')]);_0x46ee2e[_0x040c('0x34')]=_[_0x040c('0x32')](_0xa600aa[_0x040c('0x35')],qs[_0x040c('0x36')](_0x3ba3b8[_0x040c('0x33')]['fields']));_0x46ee2e[_0x040c('0x34')]=_0x46ee2e[_0x040c('0x34')][_0x040c('0x37')]?_0x46ee2e[_0x040c('0x34')]:_0xa600aa['model'];if(!_0x3ba3b8[_0x040c('0x33')][_0x040c('0x38')](_0x040c('0x39'))){_0x46ee2e['limit']=qs[_0x040c('0x1b')](_0x3ba3b8[_0x040c('0x33')][_0x040c('0x1b')]);_0x46ee2e[_0x040c('0x19')]=qs[_0x040c('0x19')](_0x3ba3b8[_0x040c('0x33')][_0x040c('0x19')]);}_0x46ee2e[_0x040c('0x3a')]=qs['sort'](_0x3ba3b8[_0x040c('0x33')][_0x040c('0x3b')]);_0x46ee2e[_0x040c('0x3c')]=qs['filters'](_[_0x040c('0x3d')](_0x3ba3b8[_0x040c('0x33')],_0xa600aa[_0x040c('0x31')]),_0x292e24);if(_0x3ba3b8[_0x040c('0x33')]['filter']){_0x46ee2e[_0x040c('0x3c')]=_['merge'](_0x46ee2e['where'],{'$or':[{'key':{'$like':'%'+_0x3ba3b8[_0x040c('0x33')][_0x040c('0x3e')]+'%'}},{'value':{'$like':'%'+_0x3ba3b8[_0x040c('0x33')][_0x040c('0x3e')]+'%'}}]});}_0x46ee2e=_[_0x040c('0x3f')]({},_0x46ee2e,_0x3ba3b8[_0x040c('0x40')]);var _0x7ed117={'where':_0x46ee2e[_0x040c('0x3c')]};return db[_0x040c('0x2c')][_0x040c('0x1c')](_0x7ed117)[_0x040c('0x21')](function(_0x5c0273){_0x415d06[_0x040c('0x1c')]=_0x5c0273;if(_0x3ba3b8[_0x040c('0x33')][_0x040c('0x41')]){_0x46ee2e[_0x040c('0x42')]=[{'all':!![]}];}return db[_0x040c('0x2c')][_0x040c('0x43')](_0x46ee2e);})[_0x040c('0x21')](function(_0x5d1d21){_0x415d06['rows']=_0x5d1d21;return _0x415d06;})[_0x040c('0x21')](respondWithFilteredResult(_0x490723,_0x46ee2e))[_0x040c('0x44')](handleError(_0x490723,null));};exports['show']=function(_0x3a1598,_0x26ff0f){var _0x18bb87={'raw':!![],'where':{'id':_0x3a1598['params']['id']}},_0x140aaf={};_0x140aaf[_0x040c('0x35')]=_['keys'](db['CannedAnswer'][_0x040c('0x2d')]);_0x140aaf[_0x040c('0x33')]=_[_0x040c('0x45')](_0x3a1598[_0x040c('0x33')]);_0x140aaf[_0x040c('0x31')]=_['intersection'](_0x140aaf[_0x040c('0x35')],_0x140aaf[_0x040c('0x33')]);_0x18bb87[_0x040c('0x34')]=_[_0x040c('0x32')](_0x140aaf['model'],qs['fields'](_0x3a1598[_0x040c('0x33')][_0x040c('0x36')]));_0x18bb87[_0x040c('0x34')]=_0x18bb87[_0x040c('0x34')]['length']?_0x18bb87[_0x040c('0x34')]:_0x140aaf[_0x040c('0x35')];if(_0x3a1598[_0x040c('0x33')]['includeAll']){_0x18bb87[_0x040c('0x42')]=[{'all':!![]}];}_0x18bb87=_[_0x040c('0x3f')]({},_0x18bb87,_0x3a1598[_0x040c('0x40')]);return db[_0x040c('0x2c')][_0x040c('0x46')](_0x18bb87)[_0x040c('0x21')](handleEntityNotFound(_0x26ff0f,null))[_0x040c('0x21')](respondWithResult(_0x26ff0f,null))[_0x040c('0x44')](handleError(_0x26ff0f,null));};exports['update']=function(_0x305999,_0x459ac6){if(_0x305999['body']['id']){delete _0x305999[_0x040c('0x47')]['id'];}return db[_0x040c('0x2c')][_0x040c('0x46')]({'where':{'id':_0x305999[_0x040c('0x48')]['id']}})[_0x040c('0x21')](handleEntityNotFound(_0x459ac6,null))['then'](saveUpdates(_0x305999['body'],null))['then'](respondWithResult(_0x459ac6,null))[_0x040c('0x44')](handleError(_0x459ac6,null));};exports['destroy']=function(_0xa57c1f,_0x334b65){return db[_0x040c('0x2c')]['find']({'where':{'id':_0xa57c1f['params']['id']}})[_0x040c('0x21')](handleEntityNotFound(_0x334b65,null))[_0x040c('0x21')](removeEntity(_0x334b65,null))['catch'](handleError(_0x334b65,null));};exports[_0x040c('0x49')]=function(_0x7df365,_0x40171a){var _0x2f29b1={'key':_0x7df365['body']['key']};if(_0x7df365[_0x040c('0x47')]['MailAccountId']){_0x2f29b1[_0x040c('0x4a')]=_0x7df365[_0x040c('0x47')]['MailAccountId'];}else if(_0x7df365[_0x040c('0x47')]['SmsAccountId']){_0x2f29b1[_0x040c('0x4b')]=_0x7df365[_0x040c('0x47')]['SmsAccountId'];}else if(_0x7df365['body']['OpenchannelAccountId']){_0x2f29b1[_0x040c('0x4c')]=_0x7df365['body']['OpenchannelAccountId'];}else if(_0x7df365[_0x040c('0x47')]['ChatWebsiteId']){_0x2f29b1[_0x040c('0x4d')]=_0x7df365[_0x040c('0x47')][_0x040c('0x4d')];}return db['CannedAnswer'][_0x040c('0x46')]({'where':_0x2f29b1})[_0x040c('0x21')](function(_0x123879){if(_0x123879){throw new db[(_0x040c('0x4e'))][(_0x040c('0x4f'))]('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer']['create'](_0x7df365[_0x040c('0x47')]);})['then'](function(_0x27e54b){var _0x238bda=_0x7df365[_0x040c('0x50')][_0x040c('0x23')]({'plain':!![]});if(!_0x238bda)throw new Error(_0x040c('0x51'));if(_0x238bda['role']==='user'){var _0x4b3d22=_0x27e54b[_0x040c('0x23')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x040c('0x24'),'userProfileId':_0x238bda['userProfileId']},'raw':!![]})[_0x040c('0x21')](function(_0x2f8eb9){if(_0x2f8eb9&&_0x2f8eb9['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4b3d22[_0x040c('0x28')],'resourceId':_0x4b3d22['id'],'type':_0x2f8eb9['name'],'sectionId':_0x2f8eb9['id']},{})[_0x040c('0x21')](function(){return _0x27e54b;});}else{return _0x27e54b;}})[_0x040c('0x44')](function(_0x5a5f3d){logger[_0x040c('0x27')](_0x040c('0x52'),_0x5a5f3d);throw _0x5a5f3d;});}return _0x27e54b;})[_0x040c('0x21')](respondWithResult(_0x40171a,0xc9))[_0x040c('0x44')](handleError(_0x40171a,null));}; \ No newline at end of file +var _0x684d=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','end','error','stack','name','map','CannedAnswer','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','role','UserProfileSection','CannedAnswers','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xc7f7af,_0x556d56){var _0x171f01=function(_0x4aa2a1){while(--_0x4aa2a1){_0xc7f7af['push'](_0xc7f7af['shift']());}};_0x171f01(++_0x556d56);}(_0x684d,0xef));var _0xd684=function(_0x5a4d3b,_0x5efea3){_0x5a4d3b=_0x5a4d3b-0x0;var _0xa4b6b5=_0x684d[_0x5a4d3b];return _0xa4b6b5;};'use strict';var emlformat=require(_0xd684('0x0'));var rimraf=require(_0xd684('0x1'));var zipdir=require(_0xd684('0x2'));var jsonpatch=require(_0xd684('0x3'));var rp=require(_0xd684('0x4'));var moment=require(_0xd684('0x5'));var BPromise=require(_0xd684('0x6'));var Mustache=require('mustache');var util=require(_0xd684('0x7'));var path=require(_0xd684('0x8'));var sox=require(_0xd684('0x9'));var csv=require(_0xd684('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd684('0xb'));var squel=require('squel');var crypto=require(_0xd684('0xc'));var jsforce=require(_0xd684('0xd'));var deskjs=require(_0xd684('0xe'));var toCsv=require(_0xd684('0xa'));var querystring=require(_0xd684('0xf'));var Papa=require(_0xd684('0x10'));var Redis=require(_0xd684('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd684('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd684('0x13'));var logger=require(_0xd684('0x14'))(_0xd684('0x15'));var utils=require(_0xd684('0x16'));var config=require(_0xd684('0x17'));var licenseUtil=require(_0xd684('0x18'));var db=require(_0xd684('0x19'))['db'];function respondWithStatusCode(_0x5c3609,_0x9ba6f6){_0x9ba6f6=_0x9ba6f6||0xcc;return function(_0x2d9cf1){if(_0x2d9cf1){return _0x5c3609[_0xd684('0x1a')](_0x9ba6f6);}return _0x5c3609['status'](_0x9ba6f6)['end']();};}function respondWithResult(_0x4fcee2,_0x29e2ca){_0x29e2ca=_0x29e2ca||0xc8;return function(_0x23ba7f){if(_0x23ba7f){return _0x4fcee2[_0xd684('0x1b')](_0x29e2ca)[_0xd684('0x1c')](_0x23ba7f);}};}function respondWithFilteredResult(_0x53076f,_0x42b786){return function(_0x4fc9a9){if(_0x4fc9a9){var _0x4b950a=typeof _0x42b786[_0xd684('0x1d')]===_0xd684('0x1e')&&typeof _0x42b786[_0xd684('0x1f')]===_0xd684('0x1e');var _0x3e3d9c=_0x4fc9a9['count'];var _0x249982=_0x4b950a?0x0:_0x42b786[_0xd684('0x1d')];var _0x7b3b8b=_0x4b950a?_0x4fc9a9[_0xd684('0x20')]:_0x42b786[_0xd684('0x1d')]+_0x42b786[_0xd684('0x1f')];var _0x2c696b;if(_0x7b3b8b>=_0x3e3d9c){_0x7b3b8b=_0x3e3d9c;_0x2c696b=0xc8;}else{_0x2c696b=0xce;}_0x53076f[_0xd684('0x1b')](_0x2c696b);return _0x53076f[_0xd684('0x21')](_0xd684('0x22'),_0x249982+'-'+_0x7b3b8b+'/'+_0x3e3d9c)[_0xd684('0x1c')](_0x4fc9a9);}return null;};}function patchUpdates(_0x498a86){return function(_0x27cde9){try{jsonpatch[_0xd684('0x23')](_0x27cde9,_0x498a86,!![]);}catch(_0x775471){return BPromise['reject'](_0x775471);}return _0x27cde9['save']();};}function saveUpdates(_0x34f76c,_0x46f730){return function(_0x355658){if(_0x355658){return _0x355658[_0xd684('0x24')](_0x34f76c)[_0xd684('0x25')](function(_0x1edeab){return _0x1edeab;});}return null;};}function removeEntity(_0x41647a,_0x38b77c){return function(_0x458985){if(_0x458985){return _0x458985[_0xd684('0x26')]()[_0xd684('0x25')](function(){var _0x2f525b=_0x458985[_0xd684('0x27')]({'plain':!![]});var _0x58896b='CannedAnswers';return db[_0xd684('0x28')][_0xd684('0x26')]({'where':{'type':_0x58896b,'resourceId':_0x2f525b['id']}})[_0xd684('0x25')](function(){return _0x458985;});})[_0xd684('0x25')](function(){_0x41647a[_0xd684('0x1b')](0xcc)[_0xd684('0x29')]();});}};}function handleEntityNotFound(_0x21bda0,_0x549915){return function(_0x56d618){if(!_0x56d618){_0x21bda0[_0xd684('0x1a')](0x194);}return _0x56d618;};}function handleError(_0x58b132,_0x597f1c){_0x597f1c=_0x597f1c||0x1f4;return function(_0x593ddf){logger[_0xd684('0x2a')](_0x593ddf[_0xd684('0x2b')]);if(_0x593ddf['name']){delete _0x593ddf[_0xd684('0x2c')];}_0x58b132[_0xd684('0x1b')](_0x597f1c)['send'](_0x593ddf);};}exports['index']=function(_0xb8d47d,_0x2b5460){var _0x3c5151={},_0x2aa855={},_0x23dc3f={'count':0x0,'rows':[]};var _0x2d9056=_[_0xd684('0x2d')](db[_0xd684('0x2e')][_0xd684('0x2f')],function(_0x5f491f){return{'name':_0x5f491f['fieldName'],'type':_0x5f491f['type'][_0xd684('0x30')]};});_0x2aa855[_0xd684('0x31')]=_['map'](_0x2d9056,_0xd684('0x2c'));_0x2aa855[_0xd684('0x32')]=_[_0xd684('0x33')](_0xb8d47d['query']);_0x2aa855['filters']=_[_0xd684('0x34')](_0x2aa855[_0xd684('0x31')],_0x2aa855[_0xd684('0x32')]);_0x3c5151['attributes']=_[_0xd684('0x34')](_0x2aa855[_0xd684('0x31')],qs[_0xd684('0x35')](_0xb8d47d['query'][_0xd684('0x35')]));_0x3c5151[_0xd684('0x36')]=_0x3c5151[_0xd684('0x36')][_0xd684('0x37')]?_0x3c5151['attributes']:_0x2aa855[_0xd684('0x31')];if(!_0xb8d47d[_0xd684('0x32')]['hasOwnProperty'](_0xd684('0x38'))){_0x3c5151['limit']=qs[_0xd684('0x1f')](_0xb8d47d['query'][_0xd684('0x1f')]);_0x3c5151['offset']=qs['offset'](_0xb8d47d['query'][_0xd684('0x1d')]);}_0x3c5151[_0xd684('0x39')]=qs[_0xd684('0x3a')](_0xb8d47d[_0xd684('0x32')]['sort']);_0x3c5151['where']=qs[_0xd684('0x3b')](_[_0xd684('0x3c')](_0xb8d47d['query'],_0x2aa855[_0xd684('0x3b')]),_0x2d9056);if(_0xb8d47d[_0xd684('0x32')][_0xd684('0x3d')]){_0x3c5151[_0xd684('0x3e')]=_['merge'](_0x3c5151['where'],{'$or':[{'key':{'$like':'%'+_0xb8d47d['query'][_0xd684('0x3d')]+'%'}},{'value':{'$like':'%'+_0xb8d47d[_0xd684('0x32')][_0xd684('0x3d')]+'%'}}]});}_0x3c5151=_[_0xd684('0x3f')]({},_0x3c5151,_0xb8d47d[_0xd684('0x40')]);var _0x2ae2e0={'where':_0x3c5151[_0xd684('0x3e')]};return db[_0xd684('0x2e')][_0xd684('0x20')](_0x2ae2e0)['then'](function(_0x2f83f8){_0x23dc3f[_0xd684('0x20')]=_0x2f83f8;if(_0xb8d47d[_0xd684('0x32')][_0xd684('0x41')]){_0x3c5151['include']=[{'all':!![]}];}return db[_0xd684('0x2e')][_0xd684('0x42')](_0x3c5151);})[_0xd684('0x25')](function(_0x13dd5a){_0x23dc3f[_0xd684('0x43')]=_0x13dd5a;return _0x23dc3f;})[_0xd684('0x25')](respondWithFilteredResult(_0x2b5460,_0x3c5151))[_0xd684('0x44')](handleError(_0x2b5460,null));};exports[_0xd684('0x45')]=function(_0x3cab41,_0x3e54c2){var _0x3da56d={'raw':!![],'where':{'id':_0x3cab41[_0xd684('0x46')]['id']}},_0x36e246={};_0x36e246[_0xd684('0x31')]=_[_0xd684('0x33')](db[_0xd684('0x2e')][_0xd684('0x2f')]);_0x36e246[_0xd684('0x32')]=_[_0xd684('0x33')](_0x3cab41[_0xd684('0x32')]);_0x36e246[_0xd684('0x3b')]=_[_0xd684('0x34')](_0x36e246['model'],_0x36e246['query']);_0x3da56d[_0xd684('0x36')]=_[_0xd684('0x34')](_0x36e246[_0xd684('0x31')],qs['fields'](_0x3cab41['query'][_0xd684('0x35')]));_0x3da56d['attributes']=_0x3da56d['attributes'][_0xd684('0x37')]?_0x3da56d[_0xd684('0x36')]:_0x36e246[_0xd684('0x31')];if(_0x3cab41['query']['includeAll']){_0x3da56d[_0xd684('0x47')]=[{'all':!![]}];}_0x3da56d=_[_0xd684('0x3f')]({},_0x3da56d,_0x3cab41[_0xd684('0x40')]);return db['CannedAnswer'][_0xd684('0x48')](_0x3da56d)['then'](handleEntityNotFound(_0x3e54c2,null))[_0xd684('0x25')](respondWithResult(_0x3e54c2,null))[_0xd684('0x44')](handleError(_0x3e54c2,null));};exports[_0xd684('0x24')]=function(_0x3848e7,_0x4b6a39){if(_0x3848e7[_0xd684('0x49')]['id']){delete _0x3848e7['body']['id'];}return db['CannedAnswer'][_0xd684('0x48')]({'where':{'id':_0x3848e7[_0xd684('0x46')]['id']}})['then'](handleEntityNotFound(_0x4b6a39,null))[_0xd684('0x25')](saveUpdates(_0x3848e7[_0xd684('0x49')],null))['then'](respondWithResult(_0x4b6a39,null))[_0xd684('0x44')](handleError(_0x4b6a39,null));};exports['destroy']=function(_0x99920f,_0x3b4a7d){return db['CannedAnswer']['find']({'where':{'id':_0x99920f[_0xd684('0x46')]['id']}})[_0xd684('0x25')](handleEntityNotFound(_0x3b4a7d,null))['then'](removeEntity(_0x3b4a7d,null))[_0xd684('0x44')](handleError(_0x3b4a7d,null));};exports['create']=function(_0x27de96,_0x4bb5b2){var _0x4a8fea={'key':_0x27de96[_0xd684('0x49')][_0xd684('0x30')]};if(_0x27de96[_0xd684('0x49')]['MailAccountId']){_0x4a8fea[_0xd684('0x4a')]=_0x27de96[_0xd684('0x49')][_0xd684('0x4a')];}else if(_0x27de96[_0xd684('0x49')][_0xd684('0x4b')]){_0x4a8fea[_0xd684('0x4b')]=_0x27de96[_0xd684('0x49')][_0xd684('0x4b')];}else if(_0x27de96[_0xd684('0x49')][_0xd684('0x4c')]){_0x4a8fea[_0xd684('0x4c')]=_0x27de96[_0xd684('0x49')][_0xd684('0x4c')];}else if(_0x27de96[_0xd684('0x49')]['ChatWebsiteId']){_0x4a8fea['ChatWebsiteId']=_0x27de96['body'][_0xd684('0x4d')];}return db[_0xd684('0x2e')][_0xd684('0x48')]({'where':_0x4a8fea})[_0xd684('0x25')](function(_0x3a253e){if(_0x3a253e){throw new db[(_0xd684('0x4e'))][(_0xd684('0x4f'))](_0xd684('0x50'));}return db[_0xd684('0x2e')][_0xd684('0x51')](_0x27de96['body']);})[_0xd684('0x25')](function(_0x1a66f7){var _0xea87e1=_0x27de96[_0xd684('0x52')]['get']({'plain':!![]});if(!_0xea87e1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xea87e1[_0xd684('0x53')]==='user'){var _0x313969=_0x1a66f7[_0xd684('0x27')]({'plain':!![]});return db[_0xd684('0x54')][_0xd684('0x48')]({'where':{'name':_0xd684('0x55'),'userProfileId':_0xea87e1['userProfileId']},'raw':!![]})[_0xd684('0x25')](function(_0x15bef2){if(_0x15bef2&&_0x15bef2[_0xd684('0x56')]===0x0){return db[_0xd684('0x28')][_0xd684('0x51')]({'name':_0x313969[_0xd684('0x2c')],'resourceId':_0x313969['id'],'type':_0x15bef2[_0xd684('0x2c')],'sectionId':_0x15bef2['id']},{})['then'](function(){return _0x1a66f7;});}else{return _0x1a66f7;}})['catch'](function(_0x113457){logger[_0xd684('0x2a')](_0xd684('0x57'),_0x113457);throw _0x113457;});}return _0x1a66f7;})[_0xd684('0x25')](respondWithResult(_0x4bb5b2,0xc9))[_0xd684('0x44')](handleError(_0x4bb5b2,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index a380b92..ba8d5d2 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 _0xde2b=['path','rimraf','exports','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0xde2b,0xcc));var _0xbde2=function(_0x17bdf9,_0x1ea029){_0x17bdf9=_0x17bdf9-0x0;var _0x21899c=_0xde2b[_0x17bdf9];return _0x21899c;};'use strict';var _=require(_0xbde2('0x0'));var util=require(_0xbde2('0x1'));var logger=require('../../config/logger')(_0xbde2('0x2'));var moment=require(_0xbde2('0x3'));var BPromise=require(_0xbde2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbde2('0x5'));var rimraf=require(_0xbde2('0x6'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0xbde2('0x7')]=function(_0x496300,_0xd86639){return _0x496300['define']('CannedAnswer',attributes,{'tableName':_0xbde2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbde2('0x9'),'collate':_0xbde2('0xa')});}; \ No newline at end of file +var _0xa2c2=['./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4f2e8f,_0x595cd3){var _0xcc3cd6=function(_0x170ea1){while(--_0x170ea1){_0x4f2e8f['push'](_0x4f2e8f['shift']());}};_0xcc3cd6(++_0x595cd3);}(_0xa2c2,0xa0));var _0x2a2c=function(_0x4bb38e,_0x24352c){_0x4bb38e=_0x4bb38e-0x0;var _0x5f2f5a=_0xa2c2[_0x4bb38e];return _0x5f2f5a;};'use strict';var _=require(_0x2a2c('0x0'));var util=require(_0x2a2c('0x1'));var logger=require(_0x2a2c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2a2c('0x3'));var rp=require(_0x2a2c('0x4'));var fs=require('fs');var path=require(_0x2a2c('0x5'));var rimraf=require(_0x2a2c('0x6'));var config=require(_0x2a2c('0x7'));var attributes=require(_0x2a2c('0x8'));module[_0x2a2c('0x9')]=function(_0x377897,_0x22a86d){return _0x377897[_0x2a2c('0xa')](_0x2a2c('0xb'),attributes,{'tableName':_0x2a2c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2a2c('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 984f834..3874641 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(_0x17e606,_0x46b3bf){var _0x28cebb=function(_0x512aa8){while(--_0x512aa8){_0x17e606['push'](_0x17e606['shift']());}};_0x28cebb(++_0x46b3bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x17b771,_0x471643){var _0x3150da=function(_0x101ef4){while(--_0x101ef4){_0x17b771['push'](_0x17b771['shift']());}};_0x3150da(++_0x471643);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 b5ac671..46f4d5b 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 _0xd58c=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','show','post','create','update'];(function(_0x4041c0,_0x339630){var _0x3c2f16=function(_0x19cbbd){while(--_0x19cbbd){_0x4041c0['push'](_0x4041c0['shift']());}};_0x3c2f16(++_0x339630);}(_0xd58c,0x74));var _0xcd58=function(_0x3f6dbd,_0x2a9e36){_0x3f6dbd=_0x3f6dbd-0x0;var _0x4bbd34=_0xd58c[_0x3f6dbd];return _0x4bbd34;};'use strict';var multer=require(_0xcd58('0x0'));var util=require(_0xcd58('0x1'));var path=require(_0xcd58('0x2'));var timeout=require(_0xcd58('0x3'));var express=require(_0xcd58('0x4'));var router=express[_0xcd58('0x5')]();var fs_extra=require(_0xcd58('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xcd58('0x7'));var config=require(_0xcd58('0x8'));var controller=require(_0xcd58('0x9'));router[_0xcd58('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcd58('0xa')](_0xcd58('0xb'),auth[_0xcd58('0xc')](),controller[_0xcd58('0xd')]);router[_0xcd58('0xe')]('/',auth[_0xcd58('0xc')](),controller[_0xcd58('0xf')]);router['put'](_0xcd58('0xb'),auth['isAuthenticated'](),controller[_0xcd58('0x10')]);router['delete'](_0xcd58('0xb'),auth[_0xcd58('0xc')](),controller[_0xcd58('0x11')]);module[_0xcd58('0x12')]=router; \ No newline at end of file +var _0xe334=['update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x51f5aa,_0x198023){var _0x4aedc2=function(_0x2f7130){while(--_0x2f7130){_0x51f5aa['push'](_0x51f5aa['shift']());}};_0x4aedc2(++_0x198023);}(_0xe334,0x7a));var _0x4e33=function(_0x19db96,_0x1114e1){_0x19db96=_0x19db96-0x0;var _0x4bc014=_0xe334[_0x19db96];return _0x4bc014;};'use strict';var multer=require(_0x4e33('0x0'));var util=require(_0x4e33('0x1'));var path=require(_0x4e33('0x2'));var timeout=require(_0x4e33('0x3'));var express=require(_0x4e33('0x4'));var router=express[_0x4e33('0x5')]();var fs_extra=require(_0x4e33('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4e33('0x7'));var config=require(_0x4e33('0x8'));var controller=require(_0x4e33('0x9'));router['get']('/',auth[_0x4e33('0xa')](),controller[_0x4e33('0xb')]);router[_0x4e33('0xc')](_0x4e33('0xd'),auth['isAuthenticated'](),controller[_0x4e33('0xe')]);router[_0x4e33('0xf')]('/',auth[_0x4e33('0xa')](),controller[_0x4e33('0x10')]);router[_0x4e33('0x11')]('/:id',auth[_0x4e33('0xa')](),controller[_0x4e33('0x12')]);router['delete'](_0x4e33('0xd'),auth[_0x4e33('0xa')](),controller[_0x4e33('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 500cbf2..dc1a096 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 _0x32e3=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x2ad99b,_0x44fc9b){var _0x17b435=function(_0x3fe9a4){while(--_0x3fe9a4){_0x2ad99b['push'](_0x2ad99b['shift']());}};_0x17b435(++_0x44fc9b);}(_0x32e3,0x104));var _0x332e=function(_0x23654c,_0x4eff64){_0x23654c=_0x23654c-0x0;var _0x4a6afa=_0x32e3[_0x23654c];return _0x4a6afa;};'use strict';var Sequelize=require('sequelize');module[_0x332e('0x0')]={'calldate':{'type':Sequelize[_0x332e('0x1')],'allowNull':![],'defaultValue':_0x332e('0x2')},'clid':{'type':Sequelize[_0x332e('0x3')]},'src':{'type':Sequelize[_0x332e('0x3')]},'dst':{'type':Sequelize[_0x332e('0x3')]},'dcontext':{'type':Sequelize[_0x332e('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x332e('0x3')]},'lastapp':{'type':Sequelize[_0x332e('0x3')]},'lastdata':{'type':Sequelize[_0x332e('0x3')]},'duration':{'type':Sequelize[_0x332e('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x332e('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x332e('0x3')]},'amaflags':{'type':Sequelize[_0x332e('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x332e('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x332e('0x3')]},'sequence':{'type':Sequelize[_0x332e('0x3')]},'peeraccount':{'type':Sequelize[_0x332e('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8bf7=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x4ed17b,_0x2b1745){var _0x24b248=function(_0x136ab1){while(--_0x136ab1){_0x4ed17b['push'](_0x4ed17b['shift']());}};_0x24b248(++_0x2b1745);}(_0x8bf7,0x139));var _0x78bf=function(_0x44fef9,_0xd6b931){_0x44fef9=_0x44fef9-0x0;var _0x1429b7=_0x8bf7[_0x44fef9];return _0x1429b7;};'use strict';var Sequelize=require(_0x78bf('0x0'));module[_0x78bf('0x1')]={'calldate':{'type':Sequelize[_0x78bf('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x78bf('0x3')]},'src':{'type':Sequelize[_0x78bf('0x3')]},'dst':{'type':Sequelize[_0x78bf('0x3')]},'dcontext':{'type':Sequelize[_0x78bf('0x3')]},'channel':{'type':Sequelize[_0x78bf('0x3')]},'dstchannel':{'type':Sequelize[_0x78bf('0x3')]},'lastapp':{'type':Sequelize[_0x78bf('0x3')]},'lastdata':{'type':Sequelize[_0x78bf('0x3')]},'duration':{'type':Sequelize[_0x78bf('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x78bf('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x78bf('0x3')]},'amaflags':{'type':Sequelize[_0x78bf('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x78bf('0x3')]},'userfield':{'type':Sequelize[_0x78bf('0x3')]},'uniqueid':{'type':Sequelize[_0x78bf('0x3')]},'linkedid':{'type':Sequelize[_0x78bf('0x3')]},'sequence':{'type':Sequelize[_0x78bf('0x3')]},'peeraccount':{'type':Sequelize[_0x78bf('0x3')]},'type':{'type':Sequelize[_0x78bf('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 232ff39..ebf7cf5 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(_0x20cfbd,_0xcf9801){var _0x1155a0=function(_0x137b92){while(--_0x137b92){_0x20cfbd['push'](_0x20cfbd['shift']());}};_0x1155a0(++_0xcf9801);}(_0x86f4,0x18a));var _0x486f=function(_0x196f82,_0x38cf0b){_0x196f82=_0x196f82-0x0;var _0x196e3d=_0x86f4[_0x196f82];return _0x196e3d;};'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 _0x8d0a=['type','query','keys','filters','intersection','model','attributes','fields','length','limit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','json','save','update','then','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8d0a,0x65));var _0xa8d0=function(_0x3bf405,_0xdaad9b){_0x3bf405=_0x3bf405-0x0;var _0x1bfd6a=_0x8d0a[_0x3bf405];return _0x1bfd6a;};'use strict';var emlformat=require(_0xa8d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa8d0('0x1'));var jsonpatch=require(_0xa8d0('0x2'));var rp=require(_0xa8d0('0x3'));var moment=require(_0xa8d0('0x4'));var BPromise=require(_0xa8d0('0x5'));var Mustache=require(_0xa8d0('0x6'));var util=require(_0xa8d0('0x7'));var path=require(_0xa8d0('0x8'));var sox=require(_0xa8d0('0x9'));var csv=require('to-csv');var ejs=require(_0xa8d0('0xa'));var fs=require('fs');var fs_extra=require(_0xa8d0('0xb'));var _=require(_0xa8d0('0xc'));var squel=require(_0xa8d0('0xd'));var crypto=require(_0xa8d0('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa8d0('0xf'));var querystring=require(_0xa8d0('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa8d0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8d0('0x12'));var logger=require(_0xa8d0('0x13'))(_0xa8d0('0x14'));var utils=require(_0xa8d0('0x15'));var config=require(_0xa8d0('0x16'));var licenseUtil=require(_0xa8d0('0x17'));var db=require(_0xa8d0('0x18'))['db'];function respondWithStatusCode(_0x3bf335,_0x329583){_0x329583=_0x329583||0xcc;return function(_0x1bfcb6){if(_0x1bfcb6){return _0x3bf335[_0xa8d0('0x19')](_0x329583);}return _0x3bf335['status'](_0x329583)[_0xa8d0('0x1a')]();};}function respondWithResult(_0x478f66,_0x5a9193){_0x5a9193=_0x5a9193||0xc8;return function(_0x32ea3e){if(_0x32ea3e){return _0x478f66[_0xa8d0('0x1b')](_0x5a9193)['json'](_0x32ea3e);}};}function respondWithFilteredResult(_0x31da9f,_0x459e9d){return function(_0x2946d5){if(_0x2946d5){var _0x44a48e=typeof _0x459e9d[_0xa8d0('0x1c')]===_0xa8d0('0x1d')&&typeof _0x459e9d['limit']===_0xa8d0('0x1d');var _0x470b4a=_0x2946d5['count'];var _0x2f0b00=_0x44a48e?0x0:_0x459e9d[_0xa8d0('0x1c')];var _0x53d168=_0x44a48e?_0x2946d5[_0xa8d0('0x1e')]:_0x459e9d[_0xa8d0('0x1c')]+_0x459e9d['limit'];var _0x582a54;if(_0x53d168>=_0x470b4a){_0x53d168=_0x470b4a;_0x582a54=0xc8;}else{_0x582a54=0xce;}_0x31da9f[_0xa8d0('0x1b')](_0x582a54);return _0x31da9f[_0xa8d0('0x1f')]('Content-Range',_0x2f0b00+'-'+_0x53d168+'/'+_0x470b4a)[_0xa8d0('0x20')](_0x2946d5);}return null;};}function patchUpdates(_0x356a52){return function(_0x446e6f){try{jsonpatch['apply'](_0x446e6f,_0x356a52,!![]);}catch(_0x36891d){return BPromise['reject'](_0x36891d);}return _0x446e6f[_0xa8d0('0x21')]();};}function saveUpdates(_0x4df8a9,_0x337677){return function(_0x27c798){if(_0x27c798){return _0x27c798[_0xa8d0('0x22')](_0x4df8a9)[_0xa8d0('0x23')](function(_0x41667d){return _0x41667d;});}return null;};}function removeEntity(_0x5754b7,_0x47d0d2){return function(_0x265dce){if(_0x265dce){return _0x265dce['destroy']()[_0xa8d0('0x23')](function(){_0x5754b7[_0xa8d0('0x1b')](0xcc)[_0xa8d0('0x1a')]();});}};}function handleEntityNotFound(_0x1ddb63,_0x17bdfc){return function(_0x5b9560){if(!_0x5b9560){_0x1ddb63[_0xa8d0('0x19')](0x194);}return _0x5b9560;};}function handleError(_0x1a396a,_0x26c3cc){_0x26c3cc=_0x26c3cc||0x1f4;return function(_0x2f692d){logger[_0xa8d0('0x24')](_0x2f692d[_0xa8d0('0x25')]);if(_0x2f692d[_0xa8d0('0x26')]){delete _0x2f692d[_0xa8d0('0x26')];}_0x1a396a['status'](_0x26c3cc)[_0xa8d0('0x27')](_0x2f692d);};}exports[_0xa8d0('0x28')]=function(_0xd7943a,_0x13ea0d){var _0x243cc3={},_0x111a4c={},_0x573641={'count':0x0,'rows':[]};var _0x3b0609=_[_0xa8d0('0x29')](db[_0xa8d0('0x2a')][_0xa8d0('0x2b')],function(_0x4c46fc){return{'name':_0x4c46fc[_0xa8d0('0x2c')],'type':_0x4c46fc[_0xa8d0('0x2d')]['key']};});_0x111a4c['model']=_[_0xa8d0('0x29')](_0x3b0609,_0xa8d0('0x26'));_0x111a4c[_0xa8d0('0x2e')]=_[_0xa8d0('0x2f')](_0xd7943a[_0xa8d0('0x2e')]);_0x111a4c[_0xa8d0('0x30')]=_[_0xa8d0('0x31')](_0x111a4c[_0xa8d0('0x32')],_0x111a4c[_0xa8d0('0x2e')]);_0x243cc3[_0xa8d0('0x33')]=_[_0xa8d0('0x31')](_0x111a4c[_0xa8d0('0x32')],qs['fields'](_0xd7943a['query'][_0xa8d0('0x34')]));_0x243cc3['attributes']=_0x243cc3[_0xa8d0('0x33')][_0xa8d0('0x35')]?_0x243cc3[_0xa8d0('0x33')]:_0x111a4c[_0xa8d0('0x32')];if(!_0xd7943a[_0xa8d0('0x2e')]['hasOwnProperty']('nolimit')){_0x243cc3[_0xa8d0('0x36')]=qs[_0xa8d0('0x36')](_0xd7943a[_0xa8d0('0x2e')][_0xa8d0('0x36')]);_0x243cc3[_0xa8d0('0x1c')]=qs[_0xa8d0('0x1c')](_0xd7943a['query'][_0xa8d0('0x1c')]);}_0x243cc3[_0xa8d0('0x37')]=qs[_0xa8d0('0x38')](_0xd7943a['query'][_0xa8d0('0x38')]);_0x243cc3[_0xa8d0('0x39')]=qs[_0xa8d0('0x30')](_[_0xa8d0('0x3a')](_0xd7943a[_0xa8d0('0x2e')],_0x111a4c[_0xa8d0('0x30')]),_0x3b0609);if(_0xd7943a[_0xa8d0('0x2e')]['filter']){_0x243cc3[_0xa8d0('0x39')]=_[_0xa8d0('0x3b')](_0x243cc3[_0xa8d0('0x39')],{'$or':_[_0xa8d0('0x29')](_0x3b0609,function(_0x2a37d3){if(_0x2a37d3[_0xa8d0('0x2d')]!=='VIRTUAL'){var _0xad4f40={};_0xad4f40[_0x2a37d3[_0xa8d0('0x26')]]={'$like':'%'+_0xd7943a[_0xa8d0('0x2e')][_0xa8d0('0x3c')]+'%'};return _0xad4f40;}})});}_0x243cc3=_[_0xa8d0('0x3b')]({},_0x243cc3,_0xd7943a[_0xa8d0('0x3d')]);var _0x1c1e05={'where':_0x243cc3[_0xa8d0('0x39')]};return db['Cdr'][_0xa8d0('0x1e')](_0x1c1e05)['then'](function(_0x3cfcc7){_0x573641[_0xa8d0('0x1e')]=_0x3cfcc7;if(_0xd7943a[_0xa8d0('0x2e')][_0xa8d0('0x3e')]){_0x243cc3[_0xa8d0('0x3f')]=[{'all':!![]}];}return db[_0xa8d0('0x2a')][_0xa8d0('0x40')](_0x243cc3);})[_0xa8d0('0x23')](function(_0x2f563a){_0x573641[_0xa8d0('0x41')]=_0x2f563a;return _0x573641;})[_0xa8d0('0x23')](respondWithFilteredResult(_0x13ea0d,_0x243cc3))[_0xa8d0('0x42')](handleError(_0x13ea0d,null));};exports['show']=function(_0x185626,_0x168479){var _0x39798a={'raw':!![],'where':{'id':_0x185626[_0xa8d0('0x43')]['id']}},_0x271203={};_0x271203[_0xa8d0('0x32')]=_['keys'](db[_0xa8d0('0x2a')][_0xa8d0('0x2b')]);_0x271203[_0xa8d0('0x2e')]=_[_0xa8d0('0x2f')](_0x185626[_0xa8d0('0x2e')]);_0x271203[_0xa8d0('0x30')]=_[_0xa8d0('0x31')](_0x271203[_0xa8d0('0x32')],_0x271203['query']);_0x39798a[_0xa8d0('0x33')]=_['intersection'](_0x271203[_0xa8d0('0x32')],qs[_0xa8d0('0x34')](_0x185626[_0xa8d0('0x2e')][_0xa8d0('0x34')]));_0x39798a['attributes']=_0x39798a[_0xa8d0('0x33')][_0xa8d0('0x35')]?_0x39798a['attributes']:_0x271203[_0xa8d0('0x32')];if(_0x185626[_0xa8d0('0x2e')][_0xa8d0('0x3e')]){_0x39798a['include']=[{'all':!![]}];}_0x39798a=_['merge']({},_0x39798a,_0x185626[_0xa8d0('0x3d')]);return db[_0xa8d0('0x2a')][_0xa8d0('0x44')](_0x39798a)[_0xa8d0('0x23')](handleEntityNotFound(_0x168479,null))['then'](respondWithResult(_0x168479,null))[_0xa8d0('0x42')](handleError(_0x168479,null));};exports[_0xa8d0('0x45')]=function(_0x289bff,_0x352adc){return db[_0xa8d0('0x2a')]['create'](_0x289bff[_0xa8d0('0x46')],{})['then'](respondWithResult(_0x352adc,0xc9))[_0xa8d0('0x42')](handleError(_0x352adc,null));};exports[_0xa8d0('0x22')]=function(_0x3dd3ae,_0x5a2aef){if(_0x3dd3ae[_0xa8d0('0x46')]['id']){delete _0x3dd3ae[_0xa8d0('0x46')]['id'];}return db[_0xa8d0('0x2a')][_0xa8d0('0x44')]({'where':{'id':_0x3dd3ae[_0xa8d0('0x43')]['id']}})['then'](handleEntityNotFound(_0x5a2aef,null))[_0xa8d0('0x23')](saveUpdates(_0x3dd3ae[_0xa8d0('0x46')],null))['then'](respondWithResult(_0x5a2aef,null))[_0xa8d0('0x42')](handleError(_0x5a2aef,null));};exports[_0xa8d0('0x47')]=function(_0x20b617,_0x1abc35){return db[_0xa8d0('0x2a')][_0xa8d0('0x44')]({'where':{'id':_0x20b617[_0xa8d0('0x43')]['id']}})['then'](handleEntityNotFound(_0x1abc35,null))[_0xa8d0('0x23')](removeEntity(_0x1abc35,null))['catch'](handleError(_0x1abc35,null));};exports['describe']=function(_0x1cb44a,_0x19fd43){return db['Cdr'][_0xa8d0('0x48')]()[_0xa8d0('0x23')](respondWithResult(_0x19fd43,null))[_0xa8d0('0x42')](handleError(_0x19fd43,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index d49b9e1..f0cbf67 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(_0x37b7aa,_0x3209dd){var _0x16ccb6=function(_0x541c88){while(--_0x541c88){_0x37b7aa['push'](_0x37b7aa['shift']());}};_0x16ccb6(++_0x3209dd);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x13332c,_0x516b5a){var _0x4571ca=function(_0x25e091){while(--_0x25e091){_0x13332c['push'](_0x13332c['shift']());}};_0x4571ca(++_0x516b5a);}(_0x7a54,0x106));var _0x47a5=function(_0x596464,_0x4464a4){_0x596464=_0x596464-0x0;var _0x91e869=_0x7a54[_0x596464];return _0x91e869;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 64606ac..a46192e 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 _0x129c=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message'];(function(_0x1cd7f1,_0x44236f){var _0x5adfde=function(_0x409537){while(--_0x409537){_0x1cd7f1['push'](_0x1cd7f1['shift']());}};_0x5adfde(++_0x44236f);}(_0x129c,0x7a));var _0xc129=function(_0x37a590,_0x250344){_0x37a590=_0x37a590-0x0;var _0x3c8e83=_0x129c[_0x37a590];return _0x3c8e83;};'use strict';var _=require(_0xc129('0x0'));var util=require(_0xc129('0x1'));var moment=require(_0xc129('0x2'));var BPromise=require(_0xc129('0x3'));var rs=require(_0xc129('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc129('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc129('0x6'))(_0xc129('0x7'));var config=require(_0xc129('0x8'));var jayson=require(_0xc129('0x9'));var client=jayson[_0xc129('0xa')][_0xc129('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26d1dc,_0x48fd51,_0x3ac34c){return new BPromise(function(_0x36b2f1,_0x4894b5){return client[_0xc129('0xc')](_0x26d1dc,_0x3ac34c)[_0xc129('0xd')](function(_0x11cffc){logger[_0xc129('0xe')]('Cdr,\x20%s,\x20%s',_0x48fd51,_0xc129('0xf'));logger['debug'](_0xc129('0x10'),_0x48fd51,_0xc129('0xf'),JSON[_0xc129('0x11')](_0x11cffc));if(_0x11cffc[_0xc129('0x12')]){if(_0x11cffc[_0xc129('0x12')][_0xc129('0x13')]===0x1f4){logger[_0xc129('0x12')](_0xc129('0x14'),_0x48fd51,_0x11cffc[_0xc129('0x12')]['message']);return _0x4894b5(_0x11cffc[_0xc129('0x12')][_0xc129('0x15')]);}logger[_0xc129('0x12')]('Cdr,\x20%s,\x20%s',_0x48fd51,_0x11cffc[_0xc129('0x12')][_0xc129('0x15')]);return _0x36b2f1(_0x11cffc[_0xc129('0x12')][_0xc129('0x15')]);}else{logger[_0xc129('0xe')](_0xc129('0x14'),_0x48fd51,_0xc129('0xf'));_0x36b2f1(_0x11cffc[_0xc129('0x16')]['message']);}})[_0xc129('0x17')](function(_0x3662fc){logger[_0xc129('0x12')](_0xc129('0x14'),_0x48fd51,_0x3662fc);_0x4894b5(_0x3662fc);});});} \ No newline at end of file +var _0x80bc=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x1428a7,_0x3728f5){var _0x1198eb=function(_0x154dcf){while(--_0x154dcf){_0x1428a7['push'](_0x1428a7['shift']());}};_0x1198eb(++_0x3728f5);}(_0x80bc,0x1cd));var _0xc80b=function(_0x422ac3,_0x48bbd4){_0x422ac3=_0x422ac3-0x0;var _0x53c0d4=_0x80bc[_0x422ac3];return _0x53c0d4;};'use strict';var _=require(_0xc80b('0x0'));var util=require('util');var moment=require(_0xc80b('0x1'));var BPromise=require(_0xc80b('0x2'));var rs=require(_0xc80b('0x3'));var fs=require('fs');var Redis=require(_0xc80b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc80b('0x5'));var logger=require(_0xc80b('0x6'))(_0xc80b('0x7'));var config=require('../../config/environment');var jayson=require(_0xc80b('0x8'));var client=jayson[_0xc80b('0x9')][_0xc80b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c184e,_0x563919,_0x2fb591){return new BPromise(function(_0x44e151,_0x56e56){return client[_0xc80b('0xb')](_0x2c184e,_0x2fb591)[_0xc80b('0xc')](function(_0x3b349f){logger[_0xc80b('0xd')](_0xc80b('0xe'),_0x563919,_0xc80b('0xf'));logger[_0xc80b('0x10')]('Cdr,\x20%s,\x20%s,\x20%s',_0x563919,_0xc80b('0xf'),JSON[_0xc80b('0x11')](_0x3b349f));if(_0x3b349f[_0xc80b('0x12')]){if(_0x3b349f[_0xc80b('0x12')]['code']===0x1f4){logger[_0xc80b('0x12')]('Cdr,\x20%s,\x20%s',_0x563919,_0x3b349f['error']['message']);return _0x56e56(_0x3b349f['error'][_0xc80b('0x13')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x563919,_0x3b349f[_0xc80b('0x12')]['message']);return _0x44e151(_0x3b349f[_0xc80b('0x12')][_0xc80b('0x13')]);}else{logger[_0xc80b('0xd')](_0xc80b('0xe'),_0x563919,_0xc80b('0xf'));_0x44e151(_0x3b349f[_0xc80b('0x14')][_0xc80b('0x13')]);}})[_0xc80b('0x15')](function(_0x54f21e){logger[_0xc80b('0x12')](_0xc80b('0xe'),_0x563919,_0x54f21e);_0x56e56(_0x54f21e);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 744f768..3b71aad 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 _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(_0x3cad60,_0x461848){var _0x4d3d28=function(_0xfa695){while(--_0xfa695){_0x3cad60['push'](_0x3cad60['shift']());}};_0x4d3d28(++_0x461848);}(_0xb10b,0x12a));var _0xbb10=function(_0xd5f3ac,_0x5a575a){_0xd5f3ac=_0xd5f3ac-0x0;var _0x38aed8=_0xb10b[_0xd5f3ac];return _0x38aed8;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x35f677,_0x4cc714){var _0x321dec=function(_0x256c3f){while(--_0x256c3f){_0x35f677['push'](_0x35f677['shift']());}};_0x321dec(++_0x4cc714);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 329515e..f4e8286 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 _0x3b80=['sequelize','TEXT','STRING'];(function(_0x2ec0ce,_0x5e152e){var _0x4b55da=function(_0x143c44){while(--_0x143c44){_0x2ec0ce['push'](_0x2ec0ce['shift']());}};_0x4b55da(++_0x5e152e);}(_0x3b80,0x198));var _0x03b8=function(_0x13c15b,_0x339f78){_0x13c15b=_0x13c15b-0x0;var _0xae5a09=_0x3b80[_0x13c15b];return _0xae5a09;};'use strict';var Sequelize=require(_0x03b8('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x03b8('0x1')]()},'description':{'type':Sequelize[_0x03b8('0x2')]},'interval':{'type':Sequelize[_0x03b8('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x3e72=['STRING','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x3e72,0x18d));var _0x23e7=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0x3e72[_0x8ba19a];return _0x2bd8b4;};'use strict';var Sequelize=require(_0x23e7('0x0'));module[_0x23e7('0x1')]={'priority':{'type':Sequelize[_0x23e7('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x23e7('0x3')},'appdata':{'type':Sequelize[_0x23e7('0x4')]()},'description':{'type':Sequelize[_0x23e7('0x5')]},'interval':{'type':Sequelize[_0x23e7('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 74b225e..9e22c49 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 _0xa25c=['end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','intersection','fields','attributes','length','includeAll','merge','options','find','catch','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x1a258d,_0x180304){var _0xefd859=function(_0x569939){while(--_0x569939){_0x1a258d['push'](_0x1a258d['shift']());}};_0xefd859(++_0x180304);}(_0xa25c,0x13f));var _0xca25=function(_0x449e84,_0x505ae7){_0x449e84=_0x449e84-0x0;var _0x72d311=_0xa25c[_0x449e84];return _0x72d311;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca25('0x0'));var zipdir=require(_0xca25('0x1'));var jsonpatch=require(_0xca25('0x2'));var rp=require(_0xca25('0x3'));var moment=require(_0xca25('0x4'));var BPromise=require(_0xca25('0x5'));var Mustache=require(_0xca25('0x6'));var util=require(_0xca25('0x7'));var path=require('path');var sox=require(_0xca25('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca25('0x9'));var _=require('lodash');var squel=require(_0xca25('0xa'));var crypto=require(_0xca25('0xb'));var jsforce=require(_0xca25('0xc'));var deskjs=require(_0xca25('0xd'));var toCsv=require(_0xca25('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xca25('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xca25('0x10'));var as=require(_0xca25('0x11'));var hardwareService=require(_0xca25('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xca25('0x13'));var licenseUtil=require(_0xca25('0x14'));var db=require(_0xca25('0x15'))['db'];function respondWithStatusCode(_0x5697aa,_0x534bca){_0x534bca=_0x534bca||0xcc;return function(_0x2a7a97){if(_0x2a7a97){return _0x5697aa['sendStatus'](_0x534bca);}return _0x5697aa[_0xca25('0x16')](_0x534bca)[_0xca25('0x17')]();};}function respondWithResult(_0x35093c,_0x1a3207){_0x1a3207=_0x1a3207||0xc8;return function(_0x307e9e){if(_0x307e9e){return _0x35093c[_0xca25('0x16')](_0x1a3207)[_0xca25('0x18')](_0x307e9e);}};}function respondWithFilteredResult(_0x33aa25,_0x2a1af3){return function(_0x42bc1e){if(_0x42bc1e){var _0x2b5cef=typeof _0x2a1af3['offset']===_0xca25('0x19')&&typeof _0x2a1af3[_0xca25('0x1a')]==='undefined';var _0x411230=_0x42bc1e[_0xca25('0x1b')];var _0x3705a0=_0x2b5cef?0x0:_0x2a1af3[_0xca25('0x1c')];var _0x155cf2=_0x2b5cef?_0x42bc1e['count']:_0x2a1af3[_0xca25('0x1c')]+_0x2a1af3[_0xca25('0x1a')];var _0x143243;if(_0x155cf2>=_0x411230){_0x155cf2=_0x411230;_0x143243=0xc8;}else{_0x143243=0xce;}_0x33aa25[_0xca25('0x16')](_0x143243);return _0x33aa25[_0xca25('0x1d')]('Content-Range',_0x3705a0+'-'+_0x155cf2+'/'+_0x411230)[_0xca25('0x18')](_0x42bc1e);}return null;};}function patchUpdates(_0x3598c7){return function(_0x235d92){try{jsonpatch[_0xca25('0x1e')](_0x235d92,_0x3598c7,!![]);}catch(_0x327719){return BPromise[_0xca25('0x1f')](_0x327719);}return _0x235d92[_0xca25('0x20')]();};}function saveUpdates(_0x54c91a,_0x48fdf5){return function(_0x23f69a){if(_0x23f69a){return _0x23f69a[_0xca25('0x21')](_0x54c91a)[_0xca25('0x22')](function(_0x1596dd){return _0x1596dd;});}return null;};}function removeEntity(_0x2615d4,_0x40e5e2){return function(_0x8cec43){if(_0x8cec43){return _0x8cec43[_0xca25('0x23')]()[_0xca25('0x22')](function(){_0x2615d4[_0xca25('0x16')](0xcc)[_0xca25('0x17')]();});}};}function handleEntityNotFound(_0x20dc6d,_0x4dffad){return function(_0x1aa848){if(!_0x1aa848){_0x20dc6d[_0xca25('0x24')](0x194);}return _0x1aa848;};}function handleError(_0x7ceacb,_0x374cde){_0x374cde=_0x374cde||0x1f4;return function(_0x220546){logger['error'](_0x220546[_0xca25('0x25')]);if(_0x220546[_0xca25('0x26')]){delete _0x220546[_0xca25('0x26')];}_0x7ceacb[_0xca25('0x16')](_0x374cde)[_0xca25('0x27')](_0x220546);};}exports[_0xca25('0x28')]=function(_0xfd888c,_0x1660a5){var _0x3e72cb={'raw':!![],'where':{'id':_0xfd888c[_0xca25('0x29')]['id']}},_0x7b67f4={};_0x7b67f4[_0xca25('0x2a')]=_[_0xca25('0x2b')](db[_0xca25('0x2c')][_0xca25('0x2d')]);_0x7b67f4[_0xca25('0x2e')]=_[_0xca25('0x2b')](_0xfd888c[_0xca25('0x2e')]);_0x7b67f4['filters']=_[_0xca25('0x2f')](_0x7b67f4[_0xca25('0x2a')],_0x7b67f4[_0xca25('0x2e')]);_0x3e72cb['attributes']=_[_0xca25('0x2f')](_0x7b67f4[_0xca25('0x2a')],qs[_0xca25('0x30')](_0xfd888c[_0xca25('0x2e')][_0xca25('0x30')]));_0x3e72cb[_0xca25('0x31')]=_0x3e72cb['attributes'][_0xca25('0x32')]?_0x3e72cb['attributes']:_0x7b67f4[_0xca25('0x2a')];if(_0xfd888c[_0xca25('0x2e')][_0xca25('0x33')]){_0x3e72cb['include']=[{'all':!![]}];}_0x3e72cb=_[_0xca25('0x34')]({},_0x3e72cb,_0xfd888c[_0xca25('0x35')]);return db[_0xca25('0x2c')][_0xca25('0x36')](_0x3e72cb)[_0xca25('0x22')](handleEntityNotFound(_0x1660a5,null))['then'](respondWithResult(_0x1660a5,null))[_0xca25('0x37')](handleError(_0x1660a5,null));};exports[_0xca25('0x21')]=function(_0x13649a,_0x1d118a){if(_0x13649a[_0xca25('0x38')]['id']){delete _0x13649a[_0xca25('0x38')]['id'];}return db[_0xca25('0x2c')]['find']({'where':{'id':_0x13649a['params']['id']}})[_0xca25('0x22')](handleEntityNotFound(_0x1d118a,null))[_0xca25('0x22')](saveUpdates(_0x13649a['body'],null))['then'](respondWithResult(_0x1d118a,null))[_0xca25('0x37')](handleError(_0x1d118a,null));};exports[_0xca25('0x23')]=function(_0x321272,_0x5f44cb){return db[_0xca25('0x2c')][_0xca25('0x36')]({'where':{'id':_0x321272[_0xca25('0x29')]['id']}})[_0xca25('0x22')](handleEntityNotFound(_0x5f44cb,null))[_0xca25('0x22')](removeEntity(_0x5f44cb,null))[_0xca25('0x37')](handleError(_0x5f44cb,null));}; \ No newline at end of file +var _0x2f3a=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','apply','save','update','then','destroy','error','name','show','model','ChatApplication','rawAttributes','query','keys','intersection','attributes','fields','length','include','find','catch','params','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0xff2444,_0x5a1ad8){var _0x5bc486=function(_0x19bef9){while(--_0x19bef9){_0xff2444['push'](_0xff2444['shift']());}};_0x5bc486(++_0x5a1ad8);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x4e3da9,_0x5265a9){_0x4e3da9=_0x4e3da9-0x0;var _0x31a915=_0x2f3a[_0x4e3da9];return _0x31a915;};'use strict';var emlformat=require(_0xa2f3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa2f3('0x1'));var rp=require(_0xa2f3('0x2'));var moment=require(_0xa2f3('0x3'));var BPromise=require(_0xa2f3('0x4'));var Mustache=require(_0xa2f3('0x5'));var util=require(_0xa2f3('0x6'));var path=require('path');var sox=require(_0xa2f3('0x7'));var csv=require('to-csv');var ejs=require(_0xa2f3('0x8'));var fs=require('fs');var fs_extra=require(_0xa2f3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa2f3('0xa'));var jsforce=require(_0xa2f3('0xb'));var deskjs=require(_0xa2f3('0xc'));var toCsv=require(_0xa2f3('0xd'));var querystring=require('querystring');var Papa=require(_0xa2f3('0xe'));var Redis=require(_0xa2f3('0xf'));var authService=require(_0xa2f3('0x10'));var qs=require(_0xa2f3('0x11'));var as=require(_0xa2f3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2f3('0x13'))(_0xa2f3('0x14'));var utils=require('../../config/utils');var config=require(_0xa2f3('0x15'));var licenseUtil=require(_0xa2f3('0x16'));var db=require(_0xa2f3('0x17'))['db'];function respondWithStatusCode(_0x58f6df,_0x6aa8f2){_0x6aa8f2=_0x6aa8f2||0xcc;return function(_0x194281){if(_0x194281){return _0x58f6df[_0xa2f3('0x18')](_0x6aa8f2);}return _0x58f6df[_0xa2f3('0x19')](_0x6aa8f2)[_0xa2f3('0x1a')]();};}function respondWithResult(_0xd4f9db,_0x3907fe){_0x3907fe=_0x3907fe||0xc8;return function(_0x4544d4){if(_0x4544d4){return _0xd4f9db[_0xa2f3('0x19')](_0x3907fe)['json'](_0x4544d4);}};}function respondWithFilteredResult(_0xdc3967,_0x33bf10){return function(_0x74fb58){if(_0x74fb58){var _0x51d297=typeof _0x33bf10[_0xa2f3('0x1b')]===_0xa2f3('0x1c')&&typeof _0x33bf10['limit']==='undefined';var _0xb1fe06=_0x74fb58[_0xa2f3('0x1d')];var _0x2db0d2=_0x51d297?0x0:_0x33bf10[_0xa2f3('0x1b')];var _0x205578=_0x51d297?_0x74fb58[_0xa2f3('0x1d')]:_0x33bf10[_0xa2f3('0x1b')]+_0x33bf10[_0xa2f3('0x1e')];var _0x550d68;if(_0x205578>=_0xb1fe06){_0x205578=_0xb1fe06;_0x550d68=0xc8;}else{_0x550d68=0xce;}_0xdc3967[_0xa2f3('0x19')](_0x550d68);return _0xdc3967[_0xa2f3('0x1f')]('Content-Range',_0x2db0d2+'-'+_0x205578+'/'+_0xb1fe06)['json'](_0x74fb58);}return null;};}function patchUpdates(_0x2f74a0){return function(_0x53af81){try{jsonpatch[_0xa2f3('0x20')](_0x53af81,_0x2f74a0,!![]);}catch(_0x147fb7){return BPromise['reject'](_0x147fb7);}return _0x53af81[_0xa2f3('0x21')]();};}function saveUpdates(_0x3e055d,_0x14d989){return function(_0x2685bb){if(_0x2685bb){return _0x2685bb[_0xa2f3('0x22')](_0x3e055d)[_0xa2f3('0x23')](function(_0x37f8c2){return _0x37f8c2;});}return null;};}function removeEntity(_0xa02908,_0x49a589){return function(_0x81af9b){if(_0x81af9b){return _0x81af9b[_0xa2f3('0x24')]()[_0xa2f3('0x23')](function(){_0xa02908[_0xa2f3('0x19')](0xcc)[_0xa2f3('0x1a')]();});}};}function handleEntityNotFound(_0x2e6332,_0x1be0c1){return function(_0x5347de){if(!_0x5347de){_0x2e6332['sendStatus'](0x194);}return _0x5347de;};}function handleError(_0x2f4248,_0x4319f3){_0x4319f3=_0x4319f3||0x1f4;return function(_0x1dd4ec){logger[_0xa2f3('0x25')](_0x1dd4ec['stack']);if(_0x1dd4ec[_0xa2f3('0x26')]){delete _0x1dd4ec[_0xa2f3('0x26')];}_0x2f4248[_0xa2f3('0x19')](_0x4319f3)['send'](_0x1dd4ec);};}exports[_0xa2f3('0x27')]=function(_0x4ec4ab,_0x1ceea4){var _0x5b868c={'raw':!![],'where':{'id':_0x4ec4ab['params']['id']}},_0x452142={};_0x452142[_0xa2f3('0x28')]=_['keys'](db[_0xa2f3('0x29')][_0xa2f3('0x2a')]);_0x452142[_0xa2f3('0x2b')]=_[_0xa2f3('0x2c')](_0x4ec4ab[_0xa2f3('0x2b')]);_0x452142['filters']=_[_0xa2f3('0x2d')](_0x452142[_0xa2f3('0x28')],_0x452142[_0xa2f3('0x2b')]);_0x5b868c[_0xa2f3('0x2e')]=_[_0xa2f3('0x2d')](_0x452142[_0xa2f3('0x28')],qs[_0xa2f3('0x2f')](_0x4ec4ab[_0xa2f3('0x2b')][_0xa2f3('0x2f')]));_0x5b868c['attributes']=_0x5b868c[_0xa2f3('0x2e')][_0xa2f3('0x30')]?_0x5b868c[_0xa2f3('0x2e')]:_0x452142[_0xa2f3('0x28')];if(_0x4ec4ab[_0xa2f3('0x2b')]['includeAll']){_0x5b868c[_0xa2f3('0x31')]=[{'all':!![]}];}_0x5b868c=_['merge']({},_0x5b868c,_0x4ec4ab['options']);return db[_0xa2f3('0x29')][_0xa2f3('0x32')](_0x5b868c)['then'](handleEntityNotFound(_0x1ceea4,null))[_0xa2f3('0x23')](respondWithResult(_0x1ceea4,null))[_0xa2f3('0x33')](handleError(_0x1ceea4,null));};exports['update']=function(_0x386f66,_0x3cb618){if(_0x386f66['body']['id']){delete _0x386f66['body']['id'];}return db[_0xa2f3('0x29')][_0xa2f3('0x32')]({'where':{'id':_0x386f66[_0xa2f3('0x34')]['id']}})[_0xa2f3('0x23')](handleEntityNotFound(_0x3cb618,null))['then'](saveUpdates(_0x386f66[_0xa2f3('0x35')],null))['then'](respondWithResult(_0x3cb618,null))[_0xa2f3('0x33')](handleError(_0x3cb618,null));};exports['destroy']=function(_0x5ac995,_0x37cd82){return db[_0xa2f3('0x29')]['find']({'where':{'id':_0x5ac995[_0xa2f3('0x34')]['id']}})['then'](handleEntityNotFound(_0x37cd82,null))[_0xa2f3('0x23')](removeEntity(_0x37cd82,null))[_0xa2f3('0x33')](handleError(_0x37cd82,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index e840896..2465526 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 _0x5c37=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','chat_applications','lodash','util'];(function(_0x5b214c,_0x5c523b){var _0x403272=function(_0x12681d){while(--_0x12681d){_0x5b214c['push'](_0x5b214c['shift']());}};_0x403272(++_0x5c523b);}(_0x5c37,0x11e));var _0x75c3=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0x5c37[_0x1793de];return _0x4f0309;};'use strict';var _=require(_0x75c3('0x0'));var util=require(_0x75c3('0x1'));var logger=require(_0x75c3('0x2'))(_0x75c3('0x3'));var moment=require(_0x75c3('0x4'));var BPromise=require(_0x75c3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x75c3('0x6'));var rimraf=require(_0x75c3('0x7'));var config=require(_0x75c3('0x8'));var attributes=require('./chatApplication.attributes');module[_0x75c3('0x9')]=function(_0xbbeb0d,_0x19dc3b){return _0xbbeb0d[_0x75c3('0xa')]('ChatApplication',attributes,{'tableName':_0x75c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8eca=['../../config/logger','moment','bluebird','request-promise','path','rimraf','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x457493,_0x3d7a8b){var _0x5dec87=function(_0x376036){while(--_0x376036){_0x457493['push'](_0x457493['shift']());}};_0x5dec87(++_0x3d7a8b);}(_0x8eca,0x1e2));var _0xa8ec=function(_0x284b4d,_0x3834db){_0x284b4d=_0x284b4d-0x0;var _0x477540=_0x8eca[_0x284b4d];return _0x477540;};'use strict';var _=require(_0xa8ec('0x0'));var util=require(_0xa8ec('0x1'));var logger=require(_0xa8ec('0x2'))('api');var moment=require(_0xa8ec('0x3'));var BPromise=require(_0xa8ec('0x4'));var rp=require(_0xa8ec('0x5'));var fs=require('fs');var path=require(_0xa8ec('0x6'));var rimraf=require(_0xa8ec('0x7'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module['exports']=function(_0x5363ad,_0x278798){return _0x5363ad['define'](_0xa8ec('0x8'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa8ec('0x9'),'collate':_0xa8ec('0xa')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 8a5296d..af9e0ac 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 _0x53ad=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x584dd9,_0x199318){var _0x9673fd=function(_0x268f9a){while(--_0x268f9a){_0x584dd9['push'](_0x584dd9['shift']());}};_0x9673fd(++_0x199318);}(_0x53ad,0x11d));var _0xd53a=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x53ad[_0x37c22c];return _0x119d79;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd53a('0x0'));var rs=require(_0xd53a('0x1'));var fs=require('fs');var Redis=require(_0xd53a('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd53a('0x3'))(_0xd53a('0x4'));var config=require(_0xd53a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd53a('0x6')][_0xd53a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5d5360,_0x209ac6,_0x2d6c7a){return new BPromise(function(_0x289240,_0x45ce1c){return client[_0xd53a('0x8')](_0x5d5360,_0x2d6c7a)[_0xd53a('0x9')](function(_0x30a159){logger[_0xd53a('0xa')](_0xd53a('0xb'),_0x209ac6,_0xd53a('0xc'));logger[_0xd53a('0xd')](_0xd53a('0xe'),_0x209ac6,_0xd53a('0xc'),JSON[_0xd53a('0xf')](_0x30a159));if(_0x30a159[_0xd53a('0x10')]){if(_0x30a159['error']['code']===0x1f4){logger['error'](_0xd53a('0xb'),_0x209ac6,_0x30a159[_0xd53a('0x10')][_0xd53a('0x11')]);return _0x45ce1c(_0x30a159[_0xd53a('0x10')][_0xd53a('0x11')]);}logger['error'](_0xd53a('0xb'),_0x209ac6,_0x30a159['error'][_0xd53a('0x11')]);return _0x289240(_0x30a159[_0xd53a('0x10')]['message']);}else{logger[_0xd53a('0xa')](_0xd53a('0xb'),_0x209ac6,_0xd53a('0xc'));_0x289240(_0x30a159[_0xd53a('0x12')]['message']);}})['catch'](function(_0x2a0687){logger['error'](_0xd53a('0xb'),_0x209ac6,_0x2a0687);_0x45ce1c(_0x2a0687);});});} \ No newline at end of file +var _0x675d=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','result','util','moment','bluebird','ioredis'];(function(_0x16e1b1,_0x3402c2){var _0x3b03ad=function(_0x405ca4){while(--_0x405ca4){_0x16e1b1['push'](_0x16e1b1['shift']());}};_0x3b03ad(++_0x3402c2);}(_0x675d,0x114));var _0xd675=function(_0xe507b3,_0x164db2){_0xe507b3=_0xe507b3-0x0;var _0x1ac09c=_0x675d[_0xe507b3];return _0x1ac09c;};'use strict';var _=require('lodash');var util=require(_0xd675('0x0'));var moment=require(_0xd675('0x1'));var BPromise=require(_0xd675('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd675('0x3'));var db=require(_0xd675('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd675('0x5'))(_0xd675('0x6'));var config=require('../../config/environment');var jayson=require(_0xd675('0x7'));var client=jayson[_0xd675('0x8')][_0xd675('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3aa828,_0x48beb4,_0x202905){return new BPromise(function(_0x155e16,_0xe2bf9e){return client[_0xd675('0xa')](_0x3aa828,_0x202905)[_0xd675('0xb')](function(_0x4ccb10){logger['info'](_0xd675('0xc'),_0x48beb4,_0xd675('0xd'));logger['debug'](_0xd675('0xe'),_0x48beb4,_0xd675('0xd'),JSON['stringify'](_0x4ccb10));if(_0x4ccb10[_0xd675('0xf')]){if(_0x4ccb10[_0xd675('0xf')][_0xd675('0x10')]===0x1f4){logger[_0xd675('0xf')](_0xd675('0xc'),_0x48beb4,_0x4ccb10['error'][_0xd675('0x11')]);return _0xe2bf9e(_0x4ccb10['error'][_0xd675('0x11')]);}logger['error'](_0xd675('0xc'),_0x48beb4,_0x4ccb10[_0xd675('0xf')][_0xd675('0x11')]);return _0x155e16(_0x4ccb10[_0xd675('0xf')]['message']);}else{logger[_0xd675('0x12')](_0xd675('0xc'),_0x48beb4,_0xd675('0xd'));_0x155e16(_0x4ccb10[_0xd675('0x13')]['message']);}})['catch'](function(_0x5e9c99){logger['error'](_0xd675('0xc'),_0x48beb4,_0x5e9c99);_0xe2bf9e(_0x5e9c99);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 2cfd1c5..c771672 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 _0x1bf6=['isAuthenticated','show','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id'];(function(_0x2b3c86,_0x1641d9){var _0x22c3dc=function(_0x38ee2d){while(--_0x38ee2d){_0x2b3c86['push'](_0x2b3c86['shift']());}};_0x22c3dc(++_0x1641d9);}(_0x1bf6,0x163));var _0x61bf=function(_0x5ec3d1,_0x457d4f){_0x5ec3d1=_0x5ec3d1-0x0;var _0x2c624c=_0x1bf6[_0x5ec3d1];return _0x2c624c;};'use strict';var multer=require(_0x61bf('0x0'));var util=require(_0x61bf('0x1'));var path=require(_0x61bf('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x61bf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x61bf('0x4'));var interaction=require(_0x61bf('0x5'));var config=require(_0x61bf('0x6'));var controller=require(_0x61bf('0x7'));router['get'](_0x61bf('0x8'),auth[_0x61bf('0x9')](),controller[_0x61bf('0xa')]);router['put'](_0x61bf('0x8'),auth['isAuthenticated'](),controller[_0x61bf('0xb')]);router['delete'](_0x61bf('0x8'),auth[_0x61bf('0x9')](),controller[_0x61bf('0xc')]);module[_0x61bf('0xd')]=router; \ No newline at end of file +var _0x023f=['put','update','delete','destroy','express','Router','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x023f,0x1b4));var _0xf023=function(_0x58118c,_0x2ca817){_0x58118c=_0x58118c-0x0;var _0x4a98dc=_0x023f[_0x58118c];return _0x4a98dc;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf023('0x0'));var router=express[_0xf023('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xf023('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xf023('0x3'));var controller=require(_0xf023('0x4'));router[_0xf023('0x5')](_0xf023('0x6'),auth[_0xf023('0x7')](),controller['show']);router[_0xf023('0x8')]('/:id',auth[_0xf023('0x7')](),controller[_0xf023('0x9')]);router[_0xf023('0xa')](_0xf023('0x6'),auth[_0xf023('0x7')](),controller[_0xf023('0xb')]);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 1c29eea..eedce9d 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 _0xc033=['BOOLEAN','sequelize','exports'];(function(_0x1f0d60,_0x58a2c2){var _0x148a20=function(_0x96e0a3){while(--_0x96e0a3){_0x1f0d60['push'](_0x1f0d60['shift']());}};_0x148a20(++_0x58a2c2);}(_0xc033,0xd3));var _0x3c03=function(_0x245f7e,_0x5a211f){_0x245f7e=_0x245f7e-0x0;var _0x35ad11=_0xc033[_0x245f7e];return _0x35ad11;};'use strict';var Sequelize=require(_0x3c03('0x0'));module[_0x3c03('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x3c03('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xee7f=['STRING','BOOLEAN','sequelize','exports'];(function(_0x186339,_0x2a828a){var _0x128945=function(_0x92fcd4){while(--_0x92fcd4){_0x186339['push'](_0x186339['shift']());}};_0x128945(++_0x2a828a);}(_0xee7f,0x18a));var _0xfee7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xee7f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xfee7('0x0'));module[_0xfee7('0x1')]={'name':{'type':Sequelize[_0xfee7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xfee7('0x2')]},'write':{'type':Sequelize[_0xfee7('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 9afd35b..006f34b 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 _0x1798=['removeMembers','addMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','nolimit','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatGroup','include','findAll','rows','catch','show','create','body','find','params','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User'];(function(_0x5c2050,_0x42f1e8){var _0x7d01e3=function(_0x4756f7){while(--_0x4756f7){_0x5c2050['push'](_0x5c2050['shift']());}};_0x7d01e3(++_0x42f1e8);}(_0x1798,0x68));var _0x8179=function(_0xf7be7f,_0x2db8ac){_0xf7be7f=_0xf7be7f-0x0;var _0xaf9a5c=_0x1798[_0xf7be7f];return _0xaf9a5c;};'use strict';var emlformat=require(_0x8179('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8179('0x1'));var rp=require('request-promise');var moment=require(_0x8179('0x2'));var BPromise=require(_0x8179('0x3'));var Mustache=require(_0x8179('0x4'));var util=require(_0x8179('0x5'));var path=require(_0x8179('0x6'));var sox=require(_0x8179('0x7'));var csv=require(_0x8179('0x8'));var ejs=require(_0x8179('0x9'));var fs=require('fs');var fs_extra=require(_0x8179('0xa'));var _=require(_0x8179('0xb'));var squel=require('squel');var crypto=require(_0x8179('0xc'));var jsforce=require(_0x8179('0xd'));var deskjs=require(_0x8179('0xe'));var toCsv=require(_0x8179('0x8'));var querystring=require(_0x8179('0xf'));var Papa=require(_0x8179('0x10'));var Redis=require(_0x8179('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8179('0x12'));var as=require(_0x8179('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8179('0x14'));var utils=require(_0x8179('0x15'));var config=require(_0x8179('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8179('0x17'))['db'];config[_0x8179('0x18')]=_[_0x8179('0x19')](config['redis'],{'host':_0x8179('0x1a'),'port':0x18eb});var socket=require(_0x8179('0x1b'))(new Redis(config[_0x8179('0x18')]));require(_0x8179('0x1c'))[_0x8179('0x1d')](socket);function respondWithStatusCode(_0x29876f,_0x298440){_0x298440=_0x298440||0xcc;return function(_0x2ac537){if(_0x2ac537){return _0x29876f[_0x8179('0x1e')](_0x298440);}return _0x29876f[_0x8179('0x1f')](_0x298440)[_0x8179('0x20')]();};}function respondWithResult(_0x5bd180,_0x43340f){_0x43340f=_0x43340f||0xc8;return function(_0x2a70e1){if(_0x2a70e1){return _0x5bd180['status'](_0x43340f)[_0x8179('0x21')](_0x2a70e1);}};}function respondWithFilteredResult(_0x86ac6b,_0x3c08d5){return function(_0x14ab45){if(_0x14ab45){var _0x37c3af=typeof _0x3c08d5['offset']===_0x8179('0x22')&&typeof _0x3c08d5[_0x8179('0x23')]===_0x8179('0x22');var _0x6d0f55=_0x14ab45['count'];var _0x2dba23=_0x37c3af?0x0:_0x3c08d5[_0x8179('0x24')];var _0x4c815b=_0x37c3af?_0x14ab45[_0x8179('0x25')]:_0x3c08d5[_0x8179('0x24')]+_0x3c08d5[_0x8179('0x23')];var _0x5d2eb8;if(_0x4c815b>=_0x6d0f55){_0x4c815b=_0x6d0f55;_0x5d2eb8=0xc8;}else{_0x5d2eb8=0xce;}_0x86ac6b[_0x8179('0x1f')](_0x5d2eb8);return _0x86ac6b[_0x8179('0x26')](_0x8179('0x27'),_0x2dba23+'-'+_0x4c815b+'/'+_0x6d0f55)[_0x8179('0x21')](_0x14ab45);}return null;};}function patchUpdates(_0x464ae0){return function(_0x1f2420){try{jsonpatch['apply'](_0x1f2420,_0x464ae0,!![]);}catch(_0x243ad1){return BPromise[_0x8179('0x28')](_0x243ad1);}return _0x1f2420[_0x8179('0x29')]();};}function saveUpdates(_0x1c1f79,_0x49bf01){return function(_0x252b8d){if(_0x252b8d){return _0x252b8d[_0x8179('0x2a')](_0x1c1f79)[_0x8179('0x2b')](function(_0x2cbba0){return _0x2cbba0;});}return null;};}function removeEntity(_0x27054f,_0x3eca39){return function(_0x3bc06f){if(_0x3bc06f){return _0x3bc06f[_0x8179('0x2c')]()[_0x8179('0x2b')](function(){_0x27054f['status'](0xcc)[_0x8179('0x20')]();});}};}function handleEntityNotFound(_0x5f2c5b,_0x1bfd67){return function(_0x56771e){if(!_0x56771e){_0x5f2c5b['sendStatus'](0x194);}return _0x56771e;};}function handleError(_0x3b8947,_0x415ea4){_0x415ea4=_0x415ea4||0x1f4;return function(_0x15f12d){logger[_0x8179('0x2d')](_0x15f12d[_0x8179('0x2e')]);if(_0x15f12d[_0x8179('0x2f')]){delete _0x15f12d[_0x8179('0x2f')];}_0x3b8947[_0x8179('0x1f')](_0x415ea4)[_0x8179('0x30')](_0x15f12d);};}exports[_0x8179('0x31')]=function(_0x1dc1a3,_0x763fe0){var _0x1271fc={},_0x359779={},_0x23710b={'count':0x0,'rows':[]};var _0x32d2bb=_[_0x8179('0x32')](db['ChatGroup'][_0x8179('0x33')],function(_0x1be879){return{'name':_0x1be879['fieldName'],'type':_0x1be879['type']['key']};});_0x359779[_0x8179('0x34')]=_[_0x8179('0x32')](_0x32d2bb,_0x8179('0x2f'));_0x359779[_0x8179('0x35')]=_[_0x8179('0x36')](_0x1dc1a3[_0x8179('0x35')]);_0x359779[_0x8179('0x37')]=_[_0x8179('0x38')](_0x359779[_0x8179('0x34')],_0x359779[_0x8179('0x35')]);_0x1271fc[_0x8179('0x39')]=_['intersection'](_0x359779['model'],qs[_0x8179('0x3a')](_0x1dc1a3[_0x8179('0x35')][_0x8179('0x3a')]));_0x1271fc['attributes']=_0x1271fc['attributes'][_0x8179('0x3b')]?_0x1271fc[_0x8179('0x39')]:_0x359779[_0x8179('0x34')];if(!_0x1dc1a3[_0x8179('0x35')][_0x8179('0x3c')]('nolimit')){_0x1271fc[_0x8179('0x23')]=qs[_0x8179('0x23')](_0x1dc1a3[_0x8179('0x35')][_0x8179('0x23')]);_0x1271fc[_0x8179('0x24')]=qs[_0x8179('0x24')](_0x1dc1a3[_0x8179('0x35')]['offset']);}_0x1271fc[_0x8179('0x3d')]=qs['sort'](_0x1dc1a3[_0x8179('0x35')][_0x8179('0x3e')]);_0x1271fc[_0x8179('0x3f')]=qs['filters'](_[_0x8179('0x40')](_0x1dc1a3[_0x8179('0x35')],_0x359779['filters']),_0x32d2bb);if(_0x1dc1a3[_0x8179('0x35')][_0x8179('0x41')]){_0x1271fc[_0x8179('0x3f')]=_[_0x8179('0x42')](_0x1271fc[_0x8179('0x3f')],{'$or':_[_0x8179('0x32')](_0x32d2bb,function(_0x3a65fd){if(_0x3a65fd[_0x8179('0x43')]!==_0x8179('0x44')){var _0x237c52={};_0x237c52[_0x3a65fd[_0x8179('0x2f')]]={'$like':'%'+_0x1dc1a3['query'][_0x8179('0x41')]+'%'};return _0x237c52;}})});}_0x1271fc=_[_0x8179('0x42')]({},_0x1271fc,_0x1dc1a3[_0x8179('0x45')]);var _0xfc6fa1={'where':_0x1271fc[_0x8179('0x3f')]};return db[_0x8179('0x46')][_0x8179('0x25')](_0xfc6fa1)[_0x8179('0x2b')](function(_0x249bdd){_0x23710b['count']=_0x249bdd;if(_0x1dc1a3['query']['includeAll']){_0x1271fc[_0x8179('0x47')]=[{'all':!![]}];}return db['ChatGroup'][_0x8179('0x48')](_0x1271fc);})['then'](function(_0x1c73b7){_0x23710b[_0x8179('0x49')]=_0x1c73b7;return _0x23710b;})[_0x8179('0x2b')](respondWithFilteredResult(_0x763fe0,_0x1271fc))[_0x8179('0x4a')](handleError(_0x763fe0,null));};exports[_0x8179('0x4b')]=function(_0x581d1c,_0x9cb81e){var _0x58df18={'raw':!![],'where':{'id':_0x581d1c['params']['id']}},_0x2073d7={};_0x2073d7[_0x8179('0x34')]=_[_0x8179('0x36')](db['ChatGroup'][_0x8179('0x33')]);_0x2073d7[_0x8179('0x35')]=_['keys'](_0x581d1c[_0x8179('0x35')]);_0x2073d7[_0x8179('0x37')]=_[_0x8179('0x38')](_0x2073d7[_0x8179('0x34')],_0x2073d7[_0x8179('0x35')]);_0x58df18[_0x8179('0x39')]=_[_0x8179('0x38')](_0x2073d7[_0x8179('0x34')],qs[_0x8179('0x3a')](_0x581d1c[_0x8179('0x35')][_0x8179('0x3a')]));_0x58df18[_0x8179('0x39')]=_0x58df18[_0x8179('0x39')]['length']?_0x58df18[_0x8179('0x39')]:_0x2073d7['model'];if(_0x581d1c[_0x8179('0x35')]['includeAll']){_0x58df18[_0x8179('0x47')]=[{'all':!![]}];}_0x58df18=_[_0x8179('0x42')]({},_0x58df18,_0x581d1c[_0x8179('0x45')]);return db[_0x8179('0x46')]['find'](_0x58df18)[_0x8179('0x2b')](handleEntityNotFound(_0x9cb81e,null))['then'](respondWithResult(_0x9cb81e,null))[_0x8179('0x4a')](handleError(_0x9cb81e,null));};exports[_0x8179('0x4c')]=function(_0x444c1e,_0x1acf14){return db[_0x8179('0x46')][_0x8179('0x4c')](_0x444c1e['body'],{})[_0x8179('0x2b')](respondWithResult(_0x1acf14,0xc9))['catch'](handleError(_0x1acf14,null));};exports[_0x8179('0x2a')]=function(_0x5eb14d,_0x432198){if(_0x5eb14d[_0x8179('0x4d')]['id']){delete _0x5eb14d['body']['id'];}return db['ChatGroup'][_0x8179('0x4e')]({'where':{'id':_0x5eb14d[_0x8179('0x4f')]['id']}})[_0x8179('0x2b')](handleEntityNotFound(_0x432198,null))[_0x8179('0x2b')](saveUpdates(_0x5eb14d[_0x8179('0x4d')],null))['then'](respondWithResult(_0x432198,null))[_0x8179('0x4a')](handleError(_0x432198,null));};exports[_0x8179('0x2c')]=function(_0x386a7d,_0x18a1df){return db[_0x8179('0x46')][_0x8179('0x4e')]({'where':{'id':_0x386a7d[_0x8179('0x4f')]['id']}})[_0x8179('0x2b')](handleEntityNotFound(_0x18a1df,null))[_0x8179('0x2b')](removeEntity(_0x18a1df,null))['catch'](handleError(_0x18a1df,null));};exports[_0x8179('0x50')]=function(_0x2e878c,_0x2c86f4){return db['ChatGroup']['describe']()[_0x8179('0x2b')](respondWithResult(_0x2c86f4,null))['catch'](handleError(_0x2c86f4,null));};exports[_0x8179('0x51')]=function(_0x31b026,_0x3fe4be,_0x29f668){return db[_0x8179('0x52')][_0x8179('0x25')]({'where':{'ChatGroupId':_0x31b026[_0x8179('0x4f')]['id'],'ToId':_0x31b026[_0x8179('0x53')]['id'],'read':![]}})[_0x8179('0x2b')](function(_0x295f93){return{'id':_['toInteger'](_0x31b026[_0x8179('0x4f')]['id']),'count':_0x295f93};})[_0x8179('0x2b')](respondWithResult(_0x3fe4be,null))['catch'](handleError(_0x3fe4be,null));};exports[_0x8179('0x54')]=function(_0x4f1e88,_0x44bbf9,_0x258894){return db[_0x8179('0x46')][_0x8179('0x4e')]({'where':{'id':_0x4f1e88[_0x8179('0x4f')]['id']}})['then'](handleEntityNotFound(_0x44bbf9,null))[_0x8179('0x2b')](function(_0x39e47a){if(_0x39e47a){return _0x39e47a[_0x8179('0x54')](_0x4f1e88[_0x8179('0x4d')][_0x8179('0x55')],_[_0x8179('0x56')](_0x4f1e88[_0x8179('0x4d')],[_0x8179('0x55'),'id'])||{});}})[_0x8179('0x2b')](respondWithResult(_0x44bbf9,null))['catch'](handleError(_0x44bbf9,null));};exports[_0x8179('0x57')]=function(_0x11638a,_0x282b73,_0x2cb222){var _0x1709c0={};var _0x367f85={};var _0x489499;var _0x4cd817;return db[_0x8179('0x46')][_0x8179('0x58')]({'where':{'id':_0x11638a[_0x8179('0x4f')]['id']}})[_0x8179('0x2b')](handleEntityNotFound(_0x282b73,null))['then'](function(_0x52d527){if(_0x52d527){_0x489499=_0x52d527;_0x367f85[_0x8179('0x34')]=_[_0x8179('0x36')](db[_0x8179('0x59')][_0x8179('0x33')]);_0x367f85[_0x8179('0x35')]=_[_0x8179('0x36')](_0x11638a[_0x8179('0x35')]);_0x367f85[_0x8179('0x37')]=_[_0x8179('0x38')](_0x367f85['model'],_0x367f85[_0x8179('0x35')]);_0x1709c0[_0x8179('0x39')]=_[_0x8179('0x38')](_0x367f85['model'],qs[_0x8179('0x3a')](_0x11638a[_0x8179('0x35')][_0x8179('0x3a')]));_0x1709c0['attributes']=_0x1709c0['attributes'][_0x8179('0x3b')]?_0x1709c0[_0x8179('0x39')]:_0x367f85['model'];_0x1709c0[_0x8179('0x3d')]=qs[_0x8179('0x3e')](_0x11638a['query'][_0x8179('0x3e')]);_0x1709c0['where']=qs[_0x8179('0x37')](_[_0x8179('0x40')](_0x11638a[_0x8179('0x35')],_0x367f85[_0x8179('0x37')]));if(_0x11638a[_0x8179('0x35')]['filter']){_0x1709c0[_0x8179('0x3f')]=_[_0x8179('0x42')](_0x1709c0[_0x8179('0x3f')],{'$or':_[_0x8179('0x32')](_0x1709c0[_0x8179('0x39')],function(_0x2c564a){var _0x4dd8ec={};_0x4dd8ec[_0x2c564a]={'$like':'%'+_0x11638a['query'][_0x8179('0x41')]+'%'};return _0x4dd8ec;})});}_0x1709c0=_[_0x8179('0x42')]({},_0x1709c0,_0x11638a[_0x8179('0x45')]);return _0x489499[_0x8179('0x57')](_0x1709c0);}})[_0x8179('0x2b')](function(_0x2aadc0){if(_0x2aadc0){_0x4cd817=_0x2aadc0[_0x8179('0x3b')];if(!_0x11638a['query'][_0x8179('0x3c')]('nolimit')){_0x1709c0[_0x8179('0x23')]=qs['limit'](_0x11638a['query'][_0x8179('0x23')]);_0x1709c0[_0x8179('0x24')]=qs[_0x8179('0x24')](_0x11638a['query']['offset']);}return _0x489499[_0x8179('0x57')](_0x1709c0);}})[_0x8179('0x2b')](function(_0x515849){if(_0x515849){return _0x515849?{'count':_0x4cd817,'rows':_0x515849}:null;}})[_0x8179('0x2b')](respondWithResult(_0x282b73,null))['catch'](handleError(_0x282b73,null));};exports[_0x8179('0x5a')]=function(_0x192621,_0x331f05,_0xb6709a){return db[_0x8179('0x46')]['find']({'where':{'id':_0x192621['params']['id']}})[_0x8179('0x2b')](handleEntityNotFound(_0x331f05,null))['then'](function(_0x5571f5){if(_0x5571f5){return _0x5571f5[_0x8179('0x5a')](_0x192621['query'][_0x8179('0x55')]);}})[_0x8179('0x2b')](respondWithStatusCode(_0x331f05,null))[_0x8179('0x4a')](handleError(_0x331f05,null));};exports[_0x8179('0x5b')]=function(_0x498e8c,_0xde448,_0x48b72a){if(_0x498e8c['body']['id']){delete _0x498e8c[_0x8179('0x4d')]['id'];}return db[_0x8179('0x46')][_0x8179('0x4e')]({'where':{'id':_0x498e8c['params']['id']}})[_0x8179('0x2b')](handleEntityNotFound(_0xde448,null))[_0x8179('0x2b')](function(_0x231354){if(_0x231354){_0x498e8c['body']['ChatGroupId']=_0x231354['id'];return db[_0x8179('0x52')][_0x8179('0x4c')](_0x498e8c[_0x8179('0x4d')]);}})[_0x8179('0x2b')](respondWithResult(_0xde448,null))[_0x8179('0x4a')](handleError(_0xde448,null));};exports['getMessages']=function(_0x103cf1,_0x1f71c5,_0x455ea6){var _0x53ab5a={};var _0x360220={};var _0x2a5605;var _0x546a5c;return db[_0x8179('0x46')]['findOne']({'where':{'id':_0x103cf1[_0x8179('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1f71c5,null))[_0x8179('0x2b')](function(_0x560699){if(_0x560699){_0x2a5605=_0x560699;_0x360220[_0x8179('0x34')]=_['keys'](db[_0x8179('0x52')][_0x8179('0x33')]);_0x360220[_0x8179('0x35')]=_[_0x8179('0x36')](_0x103cf1['query']);_0x360220['filters']=_[_0x8179('0x38')](_0x360220['model'],_0x360220[_0x8179('0x35')]);_0x53ab5a['attributes']=_['intersection'](_0x360220[_0x8179('0x34')],qs[_0x8179('0x3a')](_0x103cf1[_0x8179('0x35')][_0x8179('0x3a')]));_0x53ab5a[_0x8179('0x39')]=_0x53ab5a[_0x8179('0x39')][_0x8179('0x3b')]?_0x53ab5a[_0x8179('0x39')]:_0x360220['model'];_0x53ab5a[_0x8179('0x3d')]=qs[_0x8179('0x3e')](_0x103cf1[_0x8179('0x35')][_0x8179('0x3e')]);_0x53ab5a[_0x8179('0x3f')]=qs['filters'](_[_0x8179('0x40')](_0x103cf1[_0x8179('0x35')],_0x360220['filters']));if(_0x103cf1[_0x8179('0x35')][_0x8179('0x41')]){_0x53ab5a[_0x8179('0x3f')]=_[_0x8179('0x42')](_0x53ab5a[_0x8179('0x3f')],{'$or':_[_0x8179('0x32')](_0x53ab5a[_0x8179('0x39')],function(_0x4f0979){var _0x3f2afd={};_0x3f2afd[_0x4f0979]={'$like':'%'+_0x103cf1[_0x8179('0x35')][_0x8179('0x41')]+'%'};return _0x3f2afd;})});}if(_0x103cf1[_0x8179('0x35')]['$gte']){var _0x3f3aaf=_0x103cf1[_0x8179('0x35')]['$gte'][_0x8179('0x5c')](',');var _0x4a2f17={};_0x4a2f17[_0x3f3aaf[0x0]]={'$gte':moment(_0x3f3aaf[0x1])[_0x8179('0x5d')](_0x8179('0x5e'))};_0x53ab5a[_0x8179('0x3f')]=_['merge'](_0x53ab5a[_0x8179('0x3f')],_0x4a2f17);}_0x53ab5a=_['merge']({},_0x53ab5a,_0x103cf1[_0x8179('0x45')]);return _0x2a5605[_0x8179('0x5f')](_0x53ab5a);}})[_0x8179('0x2b')](function(_0x337a6f){if(_0x337a6f){_0x546a5c=_0x337a6f[_0x8179('0x3b')];if(!_0x103cf1['query']['hasOwnProperty'](_0x8179('0x60'))){_0x53ab5a[_0x8179('0x23')]=qs['limit'](_0x103cf1[_0x8179('0x35')][_0x8179('0x23')]);_0x53ab5a[_0x8179('0x24')]=qs[_0x8179('0x24')](_0x103cf1[_0x8179('0x35')]['offset']);}return _0x2a5605[_0x8179('0x5f')](_0x53ab5a);}})[_0x8179('0x2b')](function(_0xab0386){if(_0xab0386){return _0xab0386?{'count':_0x546a5c,'rows':_0xab0386}:null;}})[_0x8179('0x2b')](respondWithResult(_0x1f71c5,null))['catch'](handleError(_0x1f71c5,null));}; \ No newline at end of file +var _0xa45b=['save','update','destroy','then','error','stack','name','send','index','map','ChatGroup','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','rows','catch','params','rawAttributes','length','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','getMembers','findOne','User','pick','removeMembers','ids','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','status','end','undefined','count','offset','limit','Content-Range','apply','reject'];(function(_0x47a40b,_0x443ecf){var _0x19610c=function(_0x4b8ce1){while(--_0x4b8ce1){_0x47a40b['push'](_0x47a40b['shift']());}};_0x19610c(++_0x443ecf);}(_0xa45b,0x1ab));var _0xba45=function(_0x599f9d,_0x45a89c){_0x599f9d=_0x599f9d-0x0;var _0x4647bb=_0xa45b[_0x599f9d];return _0x4647bb;};'use strict';var emlformat=require(_0xba45('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xba45('0x1'));var rp=require(_0xba45('0x2'));var moment=require(_0xba45('0x3'));var BPromise=require(_0xba45('0x4'));var Mustache=require(_0xba45('0x5'));var util=require('util');var path=require(_0xba45('0x6'));var sox=require(_0xba45('0x7'));var csv=require('to-csv');var ejs=require(_0xba45('0x8'));var fs=require('fs');var fs_extra=require(_0xba45('0x9'));var _=require(_0xba45('0xa'));var squel=require(_0xba45('0xb'));var crypto=require(_0xba45('0xc'));var jsforce=require(_0xba45('0xd'));var deskjs=require(_0xba45('0xe'));var toCsv=require(_0xba45('0xf'));var querystring=require(_0xba45('0x10'));var Papa=require(_0xba45('0x11'));var Redis=require(_0xba45('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xba45('0x13'));var as=require(_0xba45('0x14'));var hardwareService=require(_0xba45('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xba45('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xba45('0x17'));var db=require('../../mysqldb')['db'];config[_0xba45('0x18')]=_[_0xba45('0x19')](config['redis'],{'host':_0xba45('0x1a'),'port':0x18eb});var socket=require(_0xba45('0x1b'))(new Redis(config[_0xba45('0x18')]));require(_0xba45('0x1c'))['register'](socket);function respondWithStatusCode(_0x4c46e0,_0x3ef738){_0x3ef738=_0x3ef738||0xcc;return function(_0x4a48df){if(_0x4a48df){return _0x4c46e0['sendStatus'](_0x3ef738);}return _0x4c46e0[_0xba45('0x1d')](_0x3ef738)[_0xba45('0x1e')]();};}function respondWithResult(_0x492e62,_0x526da5){_0x526da5=_0x526da5||0xc8;return function(_0x4392d4){if(_0x4392d4){return _0x492e62['status'](_0x526da5)['json'](_0x4392d4);}};}function respondWithFilteredResult(_0x4547c2,_0x4c2559){return function(_0x177eab){if(_0x177eab){var _0x4b4c15=typeof _0x4c2559['offset']===_0xba45('0x1f')&&typeof _0x4c2559['limit']===_0xba45('0x1f');var _0x40556f=_0x177eab[_0xba45('0x20')];var _0x4c5e50=_0x4b4c15?0x0:_0x4c2559['offset'];var _0x387796=_0x4b4c15?_0x177eab[_0xba45('0x20')]:_0x4c2559[_0xba45('0x21')]+_0x4c2559[_0xba45('0x22')];var _0x5b0a56;if(_0x387796>=_0x40556f){_0x387796=_0x40556f;_0x5b0a56=0xc8;}else{_0x5b0a56=0xce;}_0x4547c2[_0xba45('0x1d')](_0x5b0a56);return _0x4547c2['set'](_0xba45('0x23'),_0x4c5e50+'-'+_0x387796+'/'+_0x40556f)['json'](_0x177eab);}return null;};}function patchUpdates(_0x537b32){return function(_0x23cb1d){try{jsonpatch[_0xba45('0x24')](_0x23cb1d,_0x537b32,!![]);}catch(_0x338f21){return BPromise[_0xba45('0x25')](_0x338f21);}return _0x23cb1d[_0xba45('0x26')]();};}function saveUpdates(_0x2d8483,_0x5c2d03){return function(_0x5665d6){if(_0x5665d6){return _0x5665d6[_0xba45('0x27')](_0x2d8483)['then'](function(_0x1ec3b8){return _0x1ec3b8;});}return null;};}function removeEntity(_0x305a9b,_0x5dfd9d){return function(_0x238182){if(_0x238182){return _0x238182[_0xba45('0x28')]()[_0xba45('0x29')](function(){_0x305a9b[_0xba45('0x1d')](0xcc)[_0xba45('0x1e')]();});}};}function handleEntityNotFound(_0x3098e4,_0x4d2eb9){return function(_0x502c5c){if(!_0x502c5c){_0x3098e4['sendStatus'](0x194);}return _0x502c5c;};}function handleError(_0x1f3d10,_0x4bb374){_0x4bb374=_0x4bb374||0x1f4;return function(_0x526ad4){logger[_0xba45('0x2a')](_0x526ad4[_0xba45('0x2b')]);if(_0x526ad4[_0xba45('0x2c')]){delete _0x526ad4[_0xba45('0x2c')];}_0x1f3d10['status'](_0x4bb374)[_0xba45('0x2d')](_0x526ad4);};}exports[_0xba45('0x2e')]=function(_0x413cfa,_0x2d225f){var _0x57c860={},_0x3ed448={},_0x185f0f={'count':0x0,'rows':[]};var _0x419fba=_[_0xba45('0x2f')](db[_0xba45('0x30')]['rawAttributes'],function(_0x9b12ed){return{'name':_0x9b12ed[_0xba45('0x31')],'type':_0x9b12ed[_0xba45('0x32')]['key']};});_0x3ed448[_0xba45('0x33')]=_['map'](_0x419fba,_0xba45('0x2c'));_0x3ed448[_0xba45('0x34')]=_[_0xba45('0x35')](_0x413cfa[_0xba45('0x34')]);_0x3ed448['filters']=_[_0xba45('0x36')](_0x3ed448['model'],_0x3ed448[_0xba45('0x34')]);_0x57c860[_0xba45('0x37')]=_['intersection'](_0x3ed448[_0xba45('0x33')],qs[_0xba45('0x38')](_0x413cfa['query'][_0xba45('0x38')]));_0x57c860['attributes']=_0x57c860['attributes']['length']?_0x57c860[_0xba45('0x37')]:_0x3ed448[_0xba45('0x33')];if(!_0x413cfa[_0xba45('0x34')][_0xba45('0x39')](_0xba45('0x3a'))){_0x57c860[_0xba45('0x22')]=qs[_0xba45('0x22')](_0x413cfa[_0xba45('0x34')][_0xba45('0x22')]);_0x57c860[_0xba45('0x21')]=qs['offset'](_0x413cfa[_0xba45('0x34')]['offset']);}_0x57c860[_0xba45('0x3b')]=qs['sort'](_0x413cfa[_0xba45('0x34')][_0xba45('0x3c')]);_0x57c860[_0xba45('0x3d')]=qs[_0xba45('0x3e')](_['pick'](_0x413cfa[_0xba45('0x34')],_0x3ed448['filters']),_0x419fba);if(_0x413cfa[_0xba45('0x34')][_0xba45('0x3f')]){_0x57c860[_0xba45('0x3d')]=_[_0xba45('0x40')](_0x57c860[_0xba45('0x3d')],{'$or':_[_0xba45('0x2f')](_0x419fba,function(_0x38b002){if(_0x38b002[_0xba45('0x32')]!=='VIRTUAL'){var _0x2e873f={};_0x2e873f[_0x38b002[_0xba45('0x2c')]]={'$like':'%'+_0x413cfa[_0xba45('0x34')][_0xba45('0x3f')]+'%'};return _0x2e873f;}})});}_0x57c860=_[_0xba45('0x40')]({},_0x57c860,_0x413cfa[_0xba45('0x41')]);var _0x91dad1={'where':_0x57c860[_0xba45('0x3d')]};return db['ChatGroup'][_0xba45('0x20')](_0x91dad1)[_0xba45('0x29')](function(_0x2bb669){_0x185f0f[_0xba45('0x20')]=_0x2bb669;if(_0x413cfa[_0xba45('0x34')]['includeAll']){_0x57c860['include']=[{'all':!![]}];}return db[_0xba45('0x30')]['findAll'](_0x57c860);})['then'](function(_0x5bca70){_0x185f0f[_0xba45('0x42')]=_0x5bca70;return _0x185f0f;})['then'](respondWithFilteredResult(_0x2d225f,_0x57c860))[_0xba45('0x43')](handleError(_0x2d225f,null));};exports['show']=function(_0x69e221,_0x44b5e9){var _0x4ec104={'raw':!![],'where':{'id':_0x69e221[_0xba45('0x44')]['id']}},_0x5744b9={};_0x5744b9['model']=_[_0xba45('0x35')](db[_0xba45('0x30')][_0xba45('0x45')]);_0x5744b9[_0xba45('0x34')]=_['keys'](_0x69e221[_0xba45('0x34')]);_0x5744b9['filters']=_[_0xba45('0x36')](_0x5744b9['model'],_0x5744b9[_0xba45('0x34')]);_0x4ec104[_0xba45('0x37')]=_[_0xba45('0x36')](_0x5744b9['model'],qs[_0xba45('0x38')](_0x69e221[_0xba45('0x34')][_0xba45('0x38')]));_0x4ec104[_0xba45('0x37')]=_0x4ec104[_0xba45('0x37')][_0xba45('0x46')]?_0x4ec104[_0xba45('0x37')]:_0x5744b9[_0xba45('0x33')];if(_0x69e221[_0xba45('0x34')]['includeAll']){_0x4ec104['include']=[{'all':!![]}];}_0x4ec104=_[_0xba45('0x40')]({},_0x4ec104,_0x69e221[_0xba45('0x41')]);return db[_0xba45('0x30')][_0xba45('0x47')](_0x4ec104)['then'](handleEntityNotFound(_0x44b5e9,null))['then'](respondWithResult(_0x44b5e9,null))['catch'](handleError(_0x44b5e9,null));};exports[_0xba45('0x48')]=function(_0x53dce6,_0x413572){return db[_0xba45('0x30')][_0xba45('0x48')](_0x53dce6['body'],{})[_0xba45('0x29')](respondWithResult(_0x413572,0xc9))['catch'](handleError(_0x413572,null));};exports[_0xba45('0x27')]=function(_0x32a172,_0x34fc38){if(_0x32a172['body']['id']){delete _0x32a172['body']['id'];}return db[_0xba45('0x30')][_0xba45('0x47')]({'where':{'id':_0x32a172[_0xba45('0x44')]['id']}})['then'](handleEntityNotFound(_0x34fc38,null))[_0xba45('0x29')](saveUpdates(_0x32a172[_0xba45('0x49')],null))[_0xba45('0x29')](respondWithResult(_0x34fc38,null))[_0xba45('0x43')](handleError(_0x34fc38,null));};exports[_0xba45('0x28')]=function(_0x16fc19,_0x178b28){return db[_0xba45('0x30')][_0xba45('0x47')]({'where':{'id':_0x16fc19[_0xba45('0x44')]['id']}})[_0xba45('0x29')](handleEntityNotFound(_0x178b28,null))[_0xba45('0x29')](removeEntity(_0x178b28,null))[_0xba45('0x43')](handleError(_0x178b28,null));};exports['describe']=function(_0x445843,_0x503ef2){return db[_0xba45('0x30')][_0xba45('0x4a')]()['then'](respondWithResult(_0x503ef2,null))['catch'](handleError(_0x503ef2,null));};exports[_0xba45('0x4b')]=function(_0x47f5a1,_0x2b8094,_0x55c1a9){return db[_0xba45('0x4c')][_0xba45('0x20')]({'where':{'ChatGroupId':_0x47f5a1['params']['id'],'ToId':_0x47f5a1[_0xba45('0x4d')]['id'],'read':![]}})[_0xba45('0x29')](function(_0x53da13){return{'id':_[_0xba45('0x4e')](_0x47f5a1[_0xba45('0x44')]['id']),'count':_0x53da13};})['then'](respondWithResult(_0x2b8094,null))[_0xba45('0x43')](handleError(_0x2b8094,null));};exports[_0xba45('0x4f')]=function(_0xa3cdaa,_0x4bde2a,_0x30a065){return db[_0xba45('0x30')][_0xba45('0x47')]({'where':{'id':_0xa3cdaa[_0xba45('0x44')]['id']}})[_0xba45('0x29')](handleEntityNotFound(_0x4bde2a,null))['then'](function(_0x23843f){if(_0x23843f){return _0x23843f[_0xba45('0x4f')](_0xa3cdaa[_0xba45('0x49')]['ids'],_[_0xba45('0x50')](_0xa3cdaa[_0xba45('0x49')],['ids','id'])||{});}})[_0xba45('0x29')](respondWithResult(_0x4bde2a,null))[_0xba45('0x43')](handleError(_0x4bde2a,null));};exports[_0xba45('0x51')]=function(_0x25ab7c,_0x1c2dad,_0x48da52){var _0x1265da={};var _0x12b55e={};var _0x4f4bfd;var _0x3b4f8f;return db[_0xba45('0x30')][_0xba45('0x52')]({'where':{'id':_0x25ab7c[_0xba45('0x44')]['id']}})[_0xba45('0x29')](handleEntityNotFound(_0x1c2dad,null))[_0xba45('0x29')](function(_0xe10448){if(_0xe10448){_0x4f4bfd=_0xe10448;_0x12b55e['model']=_[_0xba45('0x35')](db[_0xba45('0x53')]['rawAttributes']);_0x12b55e[_0xba45('0x34')]=_[_0xba45('0x35')](_0x25ab7c[_0xba45('0x34')]);_0x12b55e[_0xba45('0x3e')]=_[_0xba45('0x36')](_0x12b55e[_0xba45('0x33')],_0x12b55e['query']);_0x1265da[_0xba45('0x37')]=_[_0xba45('0x36')](_0x12b55e[_0xba45('0x33')],qs[_0xba45('0x38')](_0x25ab7c['query'][_0xba45('0x38')]));_0x1265da[_0xba45('0x37')]=_0x1265da[_0xba45('0x37')][_0xba45('0x46')]?_0x1265da[_0xba45('0x37')]:_0x12b55e[_0xba45('0x33')];_0x1265da[_0xba45('0x3b')]=qs[_0xba45('0x3c')](_0x25ab7c['query'][_0xba45('0x3c')]);_0x1265da[_0xba45('0x3d')]=qs['filters'](_[_0xba45('0x54')](_0x25ab7c['query'],_0x12b55e['filters']));if(_0x25ab7c[_0xba45('0x34')]['filter']){_0x1265da['where']=_['merge'](_0x1265da[_0xba45('0x3d')],{'$or':_[_0xba45('0x2f')](_0x1265da['attributes'],function(_0x646be4){var _0x4e3bb7={};_0x4e3bb7[_0x646be4]={'$like':'%'+_0x25ab7c[_0xba45('0x34')][_0xba45('0x3f')]+'%'};return _0x4e3bb7;})});}_0x1265da=_[_0xba45('0x40')]({},_0x1265da,_0x25ab7c[_0xba45('0x41')]);return _0x4f4bfd[_0xba45('0x51')](_0x1265da);}})[_0xba45('0x29')](function(_0x2593cb){if(_0x2593cb){_0x3b4f8f=_0x2593cb['length'];if(!_0x25ab7c[_0xba45('0x34')]['hasOwnProperty'](_0xba45('0x3a'))){_0x1265da[_0xba45('0x22')]=qs['limit'](_0x25ab7c[_0xba45('0x34')][_0xba45('0x22')]);_0x1265da[_0xba45('0x21')]=qs[_0xba45('0x21')](_0x25ab7c[_0xba45('0x34')][_0xba45('0x21')]);}return _0x4f4bfd[_0xba45('0x51')](_0x1265da);}})[_0xba45('0x29')](function(_0xc129ed){if(_0xc129ed){return _0xc129ed?{'count':_0x3b4f8f,'rows':_0xc129ed}:null;}})[_0xba45('0x29')](respondWithResult(_0x1c2dad,null))[_0xba45('0x43')](handleError(_0x1c2dad,null));};exports['removeMembers']=function(_0x2682ec,_0xce42ef,_0x1fd80f){return db[_0xba45('0x30')][_0xba45('0x47')]({'where':{'id':_0x2682ec[_0xba45('0x44')]['id']}})[_0xba45('0x29')](handleEntityNotFound(_0xce42ef,null))[_0xba45('0x29')](function(_0x18a3ec){if(_0x18a3ec){return _0x18a3ec[_0xba45('0x55')](_0x2682ec['query'][_0xba45('0x56')]);}})[_0xba45('0x29')](respondWithStatusCode(_0xce42ef,null))['catch'](handleError(_0xce42ef,null));};exports['addMessage']=function(_0x30cc05,_0x26ef7e,_0x3ee893){if(_0x30cc05[_0xba45('0x49')]['id']){delete _0x30cc05[_0xba45('0x49')]['id'];}return db['ChatGroup'][_0xba45('0x47')]({'where':{'id':_0x30cc05['params']['id']}})['then'](handleEntityNotFound(_0x26ef7e,null))[_0xba45('0x29')](function(_0x145fd6){if(_0x145fd6){_0x30cc05['body'][_0xba45('0x57')]=_0x145fd6['id'];return db[_0xba45('0x4c')][_0xba45('0x48')](_0x30cc05[_0xba45('0x49')]);}})[_0xba45('0x29')](respondWithResult(_0x26ef7e,null))[_0xba45('0x43')](handleError(_0x26ef7e,null));};exports[_0xba45('0x58')]=function(_0x7bf777,_0xbbdaa8,_0x380c09){var _0x4ea7f8={};var _0x3c9ead={};var _0x3c70b1;var _0x2708ec;return db[_0xba45('0x30')][_0xba45('0x52')]({'where':{'id':_0x7bf777[_0xba45('0x44')]['id']}})['then'](handleEntityNotFound(_0xbbdaa8,null))[_0xba45('0x29')](function(_0x29a7e5){if(_0x29a7e5){_0x3c70b1=_0x29a7e5;_0x3c9ead[_0xba45('0x33')]=_['keys'](db[_0xba45('0x4c')][_0xba45('0x45')]);_0x3c9ead[_0xba45('0x34')]=_[_0xba45('0x35')](_0x7bf777[_0xba45('0x34')]);_0x3c9ead[_0xba45('0x3e')]=_[_0xba45('0x36')](_0x3c9ead['model'],_0x3c9ead[_0xba45('0x34')]);_0x4ea7f8[_0xba45('0x37')]=_[_0xba45('0x36')](_0x3c9ead['model'],qs[_0xba45('0x38')](_0x7bf777['query'][_0xba45('0x38')]));_0x4ea7f8['attributes']=_0x4ea7f8['attributes']['length']?_0x4ea7f8[_0xba45('0x37')]:_0x3c9ead['model'];_0x4ea7f8['order']=qs[_0xba45('0x3c')](_0x7bf777[_0xba45('0x34')][_0xba45('0x3c')]);_0x4ea7f8['where']=qs[_0xba45('0x3e')](_[_0xba45('0x54')](_0x7bf777[_0xba45('0x34')],_0x3c9ead[_0xba45('0x3e')]));if(_0x7bf777[_0xba45('0x34')]['filter']){_0x4ea7f8['where']=_['merge'](_0x4ea7f8[_0xba45('0x3d')],{'$or':_['map'](_0x4ea7f8[_0xba45('0x37')],function(_0x261cc0){var _0x276f8f={};_0x276f8f[_0x261cc0]={'$like':'%'+_0x7bf777[_0xba45('0x34')][_0xba45('0x3f')]+'%'};return _0x276f8f;})});}if(_0x7bf777['query'][_0xba45('0x59')]){var _0x638e7b=_0x7bf777[_0xba45('0x34')][_0xba45('0x59')][_0xba45('0x5a')](',');var _0x9a661f={};_0x9a661f[_0x638e7b[0x0]]={'$gte':moment(_0x638e7b[0x1])[_0xba45('0x5b')](_0xba45('0x5c'))};_0x4ea7f8[_0xba45('0x3d')]=_['merge'](_0x4ea7f8[_0xba45('0x3d')],_0x9a661f);}_0x4ea7f8=_[_0xba45('0x40')]({},_0x4ea7f8,_0x7bf777[_0xba45('0x41')]);return _0x3c70b1[_0xba45('0x58')](_0x4ea7f8);}})[_0xba45('0x29')](function(_0x1a31fb){if(_0x1a31fb){_0x2708ec=_0x1a31fb[_0xba45('0x46')];if(!_0x7bf777['query'][_0xba45('0x39')](_0xba45('0x3a'))){_0x4ea7f8[_0xba45('0x22')]=qs[_0xba45('0x22')](_0x7bf777['query'][_0xba45('0x22')]);_0x4ea7f8[_0xba45('0x21')]=qs[_0xba45('0x21')](_0x7bf777[_0xba45('0x34')][_0xba45('0x21')]);}return _0x3c70b1[_0xba45('0x58')](_0x4ea7f8);}})[_0xba45('0x29')](function(_0x4a168f){if(_0x4a168f){return _0x4a168f?{'count':_0x2708ec,'rows':_0x4a168f}:null;}})[_0xba45('0x29')](respondWithResult(_0xbbdaa8,null))[_0xba45('0x43')](handleError(_0xbbdaa8,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index dd76c87..b8173a8 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 _0x27eb=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2c7523,_0x13384c){var _0x2b97b5=function(_0x30deb5){while(--_0x30deb5){_0x2c7523['push'](_0x2c7523['shift']());}};_0x2b97b5(++_0x13384c);}(_0x27eb,0xd0));var _0xb27e=function(_0x1cfca7,_0x5b73b4){_0x1cfca7=_0x1cfca7-0x0;var _0x3bf2fb=_0x27eb[_0x1cfca7];return _0x3bf2fb;};'use strict';var EventEmitter=require(_0xb27e('0x0'));var ChatGroup=require(_0xb27e('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb27e('0x2'),'afterUpdate':_0xb27e('0x3'),'afterDestroy':_0xb27e('0x4')};function emitEvent(_0x5c9b37){return function(_0x2ed7d7,_0x1d82eb,_0x2aab8e){ChatGroupEvents[_0xb27e('0x5')](_0x5c9b37+':'+_0x2ed7d7['id'],_0x2ed7d7);ChatGroupEvents['emit'](_0x5c9b37,_0x2ed7d7);_0x2aab8e(null);};}for(var e in events){if(events[_0xb27e('0x6')](e)){var event=events[e];ChatGroup[_0xb27e('0x7')](e,emitEvent(event));}}module[_0xb27e('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0xa1c9=['../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa1c9,0x135));var _0x9a1c=function(_0x52fa77,_0x2b381b){_0x52fa77=_0x52fa77-0x0;var _0x477535=_0xa1c9[_0x52fa77];return _0x477535;};'use strict';var EventEmitter=require(_0x9a1c('0x0'));var ChatGroup=require(_0x9a1c('0x1'))['db'][_0x9a1c('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9a1c('0x3')](0x0);var events={'afterCreate':_0x9a1c('0x4'),'afterUpdate':_0x9a1c('0x5'),'afterDestroy':_0x9a1c('0x6')};function emitEvent(_0x3f6d12){return function(_0x3467bc,_0x5d23eb,_0x14875a){ChatGroupEvents[_0x9a1c('0x7')](_0x3f6d12+':'+_0x3467bc['id'],_0x3467bc);ChatGroupEvents[_0x9a1c('0x7')](_0x3f6d12,_0x3467bc);_0x14875a(null);};}for(var e in events){if(events[_0x9a1c('0x8')](e)){var event=events[e];ChatGroup[_0x9a1c('0x9')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 5411015..b65ee35 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 _0x2a0b=['bluebird','rimraf','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','util','api','moment'];(function(_0x19feef,_0x1d4d77){var _0x52f355=function(_0xe99201){while(--_0xe99201){_0x19feef['push'](_0x19feef['shift']());}};_0x52f355(++_0x1d4d77);}(_0x2a0b,0x1f0));var _0xb2a0=function(_0x28bf1b,_0xb746a7){_0x28bf1b=_0x28bf1b-0x0;var _0x42824a=_0x2a0b[_0x28bf1b];return _0x42824a;};'use strict';var _=require(_0xb2a0('0x0'));var util=require(_0xb2a0('0x1'));var logger=require('../../config/logger')(_0xb2a0('0x2'));var moment=require(_0xb2a0('0x3'));var BPromise=require(_0xb2a0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb2a0('0x5'));var config=require('../../config/environment');var attributes=require(_0xb2a0('0x6'));module['exports']=function(_0xc89f1c,_0x464761){return _0xc89f1c[_0xb2a0('0x7')](_0xb2a0('0x8'),attributes,{'tableName':_0xb2a0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1db8=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatGroup','chat_groups'];(function(_0x3fd275,_0xf0cd7){var _0xe4f14f=function(_0x23971d){while(--_0x23971d){_0x3fd275['push'](_0x3fd275['shift']());}};_0xe4f14f(++_0xf0cd7);}(_0x1db8,0x168));var _0x81db=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x1db8[_0x38537f];return _0x141e23;};'use strict';var _=require(_0x81db('0x0'));var util=require('util');var logger=require(_0x81db('0x1'))(_0x81db('0x2'));var moment=require(_0x81db('0x3'));var BPromise=require(_0x81db('0x4'));var rp=require(_0x81db('0x5'));var fs=require('fs');var path=require(_0x81db('0x6'));var rimraf=require(_0x81db('0x7'));var config=require(_0x81db('0x8'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x4e0c52,_0x5dbfb0){return _0x4e0c52[_0x81db('0x9')](_0x81db('0xa'),attributes,{'tableName':_0x81db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 5d10373..bc98220 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 _0x44f6=['stringify','error','message','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x51c9c1,_0x32ab51){var _0x7445cd=function(_0x4c7311){while(--_0x4c7311){_0x51c9c1['push'](_0x51c9c1['shift']());}};_0x7445cd(++_0x32ab51);}(_0x44f6,0xa4));var _0x644f=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0x44f6[_0x593564];return _0x211a89;};'use strict';var _=require(_0x644f('0x0'));var util=require(_0x644f('0x1'));var moment=require(_0x644f('0x2'));var BPromise=require(_0x644f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x644f('0x4'))['db'];var utils=require(_0x644f('0x5'));var logger=require(_0x644f('0x6'))(_0x644f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x644f('0x8')][_0x644f('0x9')]({'port':0x232a});config[_0x644f('0xa')]=_[_0x644f('0xb')](config[_0x644f('0xa')],{'host':_0x644f('0xc'),'port':0x18eb});var socket=require(_0x644f('0xd'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x18eee9,_0x12210d,_0x1b7bc9){return new BPromise(function(_0x485c0a,_0x486476){return client[_0x644f('0xe')](_0x18eee9,_0x1b7bc9)[_0x644f('0xf')](function(_0x2e8c6b){logger[_0x644f('0x10')](_0x644f('0x11'),_0x12210d,_0x644f('0x12'));logger['debug'](_0x644f('0x13'),_0x12210d,_0x644f('0x12'),JSON[_0x644f('0x14')](_0x2e8c6b));if(_0x2e8c6b[_0x644f('0x15')]){if(_0x2e8c6b[_0x644f('0x15')]['code']===0x1f4){logger['error'](_0x644f('0x11'),_0x12210d,_0x2e8c6b[_0x644f('0x15')][_0x644f('0x16')]);return _0x486476(_0x2e8c6b[_0x644f('0x15')][_0x644f('0x16')]);}logger[_0x644f('0x15')](_0x644f('0x11'),_0x12210d,_0x2e8c6b[_0x644f('0x15')][_0x644f('0x16')]);return _0x485c0a(_0x2e8c6b[_0x644f('0x15')][_0x644f('0x16')]);}else{logger['info'](_0x644f('0x11'),_0x12210d,_0x644f('0x12'));_0x485c0a(_0x2e8c6b['result'][_0x644f('0x16')]);}})['catch'](function(_0x15a0a2){logger[_0x644f('0x15')](_0x644f('0x11'),_0x12210d,_0x15a0a2);_0x486476(_0x15a0a2);});});} \ No newline at end of file +var _0x25b4=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','then','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1f2401,_0x4fe3b1){var _0x13bc93=function(_0xecae20){while(--_0xecae20){_0x1f2401['push'](_0x1f2401['shift']());}};_0x13bc93(++_0x4fe3b1);}(_0x25b4,0x1ab));var _0x425b=function(_0x57b236,_0x30614e){_0x57b236=_0x57b236-0x0;var _0x4feb29=_0x25b4[_0x57b236];return _0x4feb29;};'use strict';var _=require(_0x425b('0x0'));var util=require('util');var moment=require(_0x425b('0x1'));var BPromise=require(_0x425b('0x2'));var rs=require(_0x425b('0x3'));var fs=require('fs');var Redis=require(_0x425b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x425b('0x5'));var logger=require(_0x425b('0x6'))(_0x425b('0x7'));var config=require(_0x425b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x425b('0x9')][_0x425b('0xa')]({'port':0x232a});config[_0x425b('0xb')]=_[_0x425b('0xc')](config[_0x425b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x425b('0xd'))(new Redis(config['redis']));require(_0x425b('0xe'))[_0x425b('0xf')](socket);function respondWithRpcPromise(_0x173c16,_0x444fd4,_0x3f3860){return new BPromise(function(_0x588f2b,_0x532add){return client['request'](_0x173c16,_0x3f3860)[_0x425b('0x10')](function(_0x164561){logger['info'](_0x425b('0x11'),_0x444fd4,_0x425b('0x12'));logger['debug'](_0x425b('0x13'),_0x444fd4,_0x425b('0x12'),JSON['stringify'](_0x164561));if(_0x164561[_0x425b('0x14')]){if(_0x164561['error'][_0x425b('0x15')]===0x1f4){logger[_0x425b('0x14')](_0x425b('0x11'),_0x444fd4,_0x164561[_0x425b('0x14')][_0x425b('0x16')]);return _0x532add(_0x164561[_0x425b('0x14')][_0x425b('0x16')]);}logger[_0x425b('0x14')](_0x425b('0x11'),_0x444fd4,_0x164561['error'][_0x425b('0x16')]);return _0x588f2b(_0x164561[_0x425b('0x14')][_0x425b('0x16')]);}else{logger['info'](_0x425b('0x11'),_0x444fd4,_0x425b('0x12'));_0x588f2b(_0x164561[_0x425b('0x17')][_0x425b('0x16')]);}})[_0x425b('0x18')](function(_0x32e912){logger[_0x425b('0x14')](_0x425b('0x11'),_0x444fd4,_0x32e912);_0x532add(_0x32e912);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 95d58f8..ae14194 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 _0xa198=['./chatGroup.events','save','remove','emit','removeListener','length'];(function(_0x2f19ca,_0x148403){var _0x4daab6=function(_0x96c06f){while(--_0x96c06f){_0x2f19ca['push'](_0x2f19ca['shift']());}};_0x4daab6(++_0x148403);}(_0xa198,0x108));var _0x8a19=function(_0x4956ee,_0x593e19){_0x4956ee=_0x4956ee-0x0;var _0x8dcca=_0xa198[_0x4956ee];return _0x8dcca;};'use strict';var ChatGroupEvents=require(_0x8a19('0x0'));var events=[_0x8a19('0x1'),_0x8a19('0x2'),'update'];function createListener(_0x3c842e,_0x408468){return function(_0x54ecf3){_0x408468[_0x8a19('0x3')](_0x3c842e,_0x54ecf3);};}function removeListener(_0x1df58e,_0x195bdb){return function(){ChatGroupEvents[_0x8a19('0x4')](_0x1df58e,_0x195bdb);};}exports['register']=function(_0x52f0f7){for(var _0x1fa892=0x0,_0x240f41=events[_0x8a19('0x5')];_0x1fa892<_0x240f41;_0x1fa892++){var _0x232f53=events[_0x1fa892];var _0x52edfa=createListener('chatGroup:'+_0x232f53,_0x52f0f7);ChatGroupEvents['on'](_0x232f53,_0x52edfa);}}; \ No newline at end of file +var _0x45cf=['./chatGroup.events','update','emit','removeListener','register'];(function(_0x569697,_0x3dd135){var _0x48cef7=function(_0x47ca27){while(--_0x47ca27){_0x569697['push'](_0x569697['shift']());}};_0x48cef7(++_0x3dd135);}(_0x45cf,0xe1));var _0xf45c=function(_0x183482,_0x146db8){_0x183482=_0x183482-0x0;var _0x4816e6=_0x45cf[_0x183482];return _0x4816e6;};'use strict';var ChatGroupEvents=require(_0xf45c('0x0'));var events=['save','remove',_0xf45c('0x1')];function createListener(_0x3d7967,_0x5811fd){return function(_0x5e09bd){_0x5811fd[_0xf45c('0x2')](_0x3d7967,_0x5e09bd);};}function removeListener(_0x28e6f7,_0x469f8e){return function(){ChatGroupEvents[_0xf45c('0x3')](_0x28e6f7,_0x469f8e);};}exports[_0xf45c('0x4')]=function(_0xc25b5d){for(var _0x42e893=0x0,_0x1d0abe=events['length'];_0x42e893<_0x1d0abe;_0x42e893++){var _0x18dc9a=events[_0x42e893];var _0x3824ae=createListener('chatGroup:'+_0x18dc9a,_0xc25b5d);ChatGroupEvents['on'](_0x18dc9a,_0x3824ae);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index d9e4e98..464d3d6 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 _0x15ef=['post','addMembers','put','update','delete','destroy','removeMembers','multer','util','express','Router','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x15ef,0x1db));var _0xf15e=function(_0xebec55,_0x3f4f14){_0xebec55=_0xebec55-0x0;var _0x355d91=_0x15ef[_0xebec55];return _0x355d91;};'use strict';var multer=require(_0xf15e('0x0'));var util=require(_0xf15e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf15e('0x2'));var router=express[_0xf15e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf15e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf15e('0x5'));var controller=require(_0xf15e('0x6'));router[_0xf15e('0x7')]('/',auth[_0xf15e('0x8')](),controller['index']);router['get'](_0xf15e('0x9'),auth[_0xf15e('0x8')](),controller[_0xf15e('0xa')]);router[_0xf15e('0x7')](_0xf15e('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf15e('0x7')](_0xf15e('0xc'),auth['isAuthenticated'](),controller[_0xf15e('0xd')]);router[_0xf15e('0x7')](_0xf15e('0xe'),auth[_0xf15e('0x8')](),controller[_0xf15e('0xf')]);router['get'](_0xf15e('0x10'),auth[_0xf15e('0x8')](),controller[_0xf15e('0x11')]);router['post']('/',auth[_0xf15e('0x8')](),controller[_0xf15e('0x12')]);router[_0xf15e('0x13')](_0xf15e('0xe'),auth[_0xf15e('0x8')](),controller[_0xf15e('0x14')]);router[_0xf15e('0x13')]('/:id/messages',auth[_0xf15e('0x8')](),controller['addMessage']);router[_0xf15e('0x15')](_0xf15e('0xb'),auth[_0xf15e('0x8')](),controller[_0xf15e('0x16')]);router[_0xf15e('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xf15e('0x18')]);router[_0xf15e('0x17')](_0xf15e('0xe'),auth[_0xf15e('0x8')](),controller[_0xf15e('0x19')]);module['exports']=router; \ No newline at end of file +var _0xae36=['/:id/unread','getUnread','/:id/messages','getMessages','post','create','/:id/members','addMembers','put','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','describe','/:id','show'];(function(_0x5a11ee,_0x5d23dc){var _0x30cb79=function(_0x5eabd0){while(--_0x5eabd0){_0x5a11ee['push'](_0x5a11ee['shift']());}};_0x30cb79(++_0x5d23dc);}(_0xae36,0x11b));var _0x6ae3=function(_0x262a69,_0x1f67fe){_0x262a69=_0x262a69-0x0;var _0x43ca44=_0xae36[_0x262a69];return _0x43ca44;};'use strict';var multer=require('multer');var util=require(_0x6ae3('0x0'));var path=require(_0x6ae3('0x1'));var timeout=require(_0x6ae3('0x2'));var express=require(_0x6ae3('0x3'));var router=express[_0x6ae3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6ae3('0x5'));var config=require(_0x6ae3('0x6'));var controller=require(_0x6ae3('0x7'));router['get']('/',auth[_0x6ae3('0x8')](),controller[_0x6ae3('0x9')]);router[_0x6ae3('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x6ae3('0xb')]);router['get'](_0x6ae3('0xc'),auth[_0x6ae3('0x8')](),controller[_0x6ae3('0xd')]);router['get'](_0x6ae3('0xe'),auth[_0x6ae3('0x8')](),controller[_0x6ae3('0xf')]);router[_0x6ae3('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x6ae3('0x10'),auth[_0x6ae3('0x8')](),controller[_0x6ae3('0x11')]);router[_0x6ae3('0x12')]('/',auth[_0x6ae3('0x8')](),controller[_0x6ae3('0x13')]);router[_0x6ae3('0x12')](_0x6ae3('0x14'),auth[_0x6ae3('0x8')](),controller[_0x6ae3('0x15')]);router['post'](_0x6ae3('0x10'),auth['isAuthenticated'](),controller['addMessage']);router[_0x6ae3('0x16')](_0x6ae3('0xc'),auth[_0x6ae3('0x8')](),controller['update']);router[_0x6ae3('0x17')](_0x6ae3('0xc'),auth[_0x6ae3('0x8')](),controller[_0x6ae3('0x18')]);router['delete'](_0x6ae3('0x14'),auth[_0x6ae3('0x8')](),controller[_0x6ae3('0x19')]);module[_0x6ae3('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index cd8cc84..0f987c0 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 _0xd547=['DATE','BOOLEAN','INTEGER','ENUM','star','TEXT','STRING'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xd547,0x1c1));var _0x7d54=function(_0x1e8dd5,_0x571f6d){_0x1e8dd5=_0x1e8dd5-0x0;var _0x9aa844=_0xd547[_0x1e8dd5];return _0x9aa844;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x7d54('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7d54('0x1')]},'ratingType':{'type':Sequelize[_0x7d54('0x2')](_0x7d54('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x7d54('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x7d54('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7d54('0x5')]},'secondDisposition':{'type':Sequelize[_0x7d54('0x5')]},'thirdDisposition':{'type':Sequelize[_0x7d54('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x7d54('0x5')]},'osVersion':{'type':Sequelize[_0x7d54('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x7d54('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x7d54('0x4')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x7d54('0x4')]('long')},'read1stAt':{'type':Sequelize[_0x7d54('0x6')]},'lastMsgAt':{'type':Sequelize[_0x7d54('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x7d54('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x7d54('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x7d54('0x0')],'defaultValue':![]}}; \ No newline at end of file +var _0x38d0=['DATE','STRING','ENUM','exports','BOOLEAN','INTEGER','star','thumb','TEXT'];(function(_0x1bca50,_0x5ae547){var _0x49352b=function(_0x5c6cda){while(--_0x5c6cda){_0x1bca50['push'](_0x1bca50['shift']());}};_0x49352b(++_0x5ae547);}(_0x38d0,0x123));var _0x038d=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x38d0[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require('sequelize');module[_0x038d('0x0')]={'closed':{'type':Sequelize[_0x038d('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x038d('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x038d('0x3'),_0x038d('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x038d('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x038d('0x6')]},'disposition':{'type':Sequelize[_0x038d('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x038d('0x7')]},'note':{'type':Sequelize[_0x038d('0x7')]},'browserName':{'type':Sequelize[_0x038d('0x7')]},'browserVersion':{'type':Sequelize[_0x038d('0x7')]},'osName':{'type':Sequelize[_0x038d('0x7')]},'osVersion':{'type':Sequelize[_0x038d('0x7')]},'deviceModel':{'type':Sequelize[_0x038d('0x7')]},'deviceVendor':{'type':Sequelize[_0x038d('0x7')]},'deviceType':{'type':Sequelize[_0x038d('0x7')]},'referer':{'type':Sequelize[_0x038d('0x5')]},'customerIp':{'type':Sequelize[_0x038d('0x7')]},'formData':{'type':Sequelize[_0x038d('0x5')]('long')},'read1stAt':{'type':Sequelize[_0x038d('0x6')]},'lastMsgAt':{'type':Sequelize[_0x038d('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x038d('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x038d('0x7')]},'customerPort':{'type':Sequelize[_0x038d('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x038d('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x038d('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index f8e8a55..d05cf88 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 _0xd7d1=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','create','destroy','describe','createVidaooSession','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','update','disposition','file','basename','filename','Attachment','attachmentDownload','closed','json','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','close','mailTranscript','root','transcript-%s.txt','now','pathTranscript','Messages','format','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_fullname','direction','secret','appendFileSync','MailAccount','Smtp','service','host','secure','auth','pass','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','alias','findAll','addTags','setTags','ids','omit','spread','emit','chatInteractionTags:save','removeTags','download','unix','tmp','server','files','attachments','transcript-%d-%s.zip','lastName','ChatWebsite','get','mkdirSync','Chat','Account','Owner','N.A.','browserName','osName','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','limit','undefined','count','offset','set','apply','reject','save','stack','name','send','contact','agent','interaction','account','map','fullname','TagIds','forEach','Tags','push','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','select','field','color','tools_tags','u.fullname','from','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','value','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','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','buildExpression','body','some','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x32b5a1,_0x5a67e2){_0x32b5a1=_0x32b5a1-0x0;var _0x43a67f=_0xd7d1[_0x32b5a1];return _0x43a67f;};'use strict';var emlformat=require(_0x1d7d('0x0'));var rimraf=require(_0x1d7d('0x1'));var zipdir=require(_0x1d7d('0x2'));var jsonpatch=require(_0x1d7d('0x3'));var rp=require(_0x1d7d('0x4'));var moment=require(_0x1d7d('0x5'));var BPromise=require(_0x1d7d('0x6'));var Mustache=require(_0x1d7d('0x7'));var util=require(_0x1d7d('0x8'));var path=require(_0x1d7d('0x9'));var sox=require(_0x1d7d('0xa'));var csv=require(_0x1d7d('0xb'));var ejs=require(_0x1d7d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xb'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x1d7d('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d7d('0x18'))(_0x1d7d('0x19'));var utils=require(_0x1d7d('0x1a'));var config=require(_0x1d7d('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d7d('0x1c'))['db'];config['redis']=_['defaults'](config[_0x1d7d('0x1d')],{'host':_0x1d7d('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1d7d('0x1f'))[_0x1d7d('0x20')](socket);var jayson=require(_0x1d7d('0x21'));var client=jayson[_0x1d7d('0x22')][_0x1d7d('0x23')]({'port':0x232b});var client9004=jayson['client'][_0x1d7d('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x1de6cc,_0x51cbca,_0xb90a8c,_0x162c3a){return new BPromise(function(_0x3c3417,_0x47826a){var _0x40db4d=_0x162c3a||client;return _0x40db4d['request'](_0x1de6cc,_0xb90a8c)[_0x1d7d('0x24')](function(_0x191024){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x51cbca,_0x1d7d('0x25'));logger[_0x1d7d('0x26')](_0x1d7d('0x27'),_0x51cbca,_0x1d7d('0x25'),JSON[_0x1d7d('0x28')](_0x191024));if(_0x191024[_0x1d7d('0x29')]){if(_0x191024['error'][_0x1d7d('0x2a')]===0x1f4){logger[_0x1d7d('0x29')](_0x1d7d('0x2b'),_0x51cbca,_0x191024['error'][_0x1d7d('0x2c')]);return _0x47826a(_0x191024[_0x1d7d('0x29')]['message']);}logger['error'](_0x1d7d('0x2b'),_0x51cbca,_0x191024[_0x1d7d('0x29')][_0x1d7d('0x2c')]);return _0x3c3417(_0x191024['error'][_0x1d7d('0x2c')]);}else{logger[_0x1d7d('0x2d')](_0x1d7d('0x2b'),_0x51cbca,_0x1d7d('0x25'));_0x3c3417(_0x191024['result'][_0x1d7d('0x2c')]);}})[_0x1d7d('0x2e')](function(_0x5c8257){logger['error'](_0x1d7d('0x2b'),_0x51cbca,_0x5c8257);_0x47826a(_0x5c8257);});});}function respondWithStatusCode(_0x52c618,_0x38c323){_0x38c323=_0x38c323||0xcc;return function(_0x2d4de4){if(_0x2d4de4){return _0x52c618[_0x1d7d('0x2f')](_0x38c323);}return _0x52c618[_0x1d7d('0x30')](_0x38c323)[_0x1d7d('0x31')]();};}function respondWithResult(_0x59f827,_0x1c2616){_0x1c2616=_0x1c2616||0xc8;return function(_0x98c1ad){if(_0x98c1ad){return _0x59f827[_0x1d7d('0x30')](_0x1c2616)['json'](_0x98c1ad);}};}function respondWithFilteredResult(_0x78adbe,_0x1a935a){return function(_0x23ad85){if(_0x23ad85){var _0x482367=typeof _0x1a935a['offset']==='undefined'&&typeof _0x1a935a[_0x1d7d('0x32')]===_0x1d7d('0x33');var _0x559f19=_0x23ad85[_0x1d7d('0x34')];var _0x3e4136=_0x482367?0x0:_0x1a935a[_0x1d7d('0x35')];var _0x3336ab=_0x482367?_0x23ad85[_0x1d7d('0x34')]:_0x1a935a[_0x1d7d('0x35')]+_0x1a935a[_0x1d7d('0x32')];var _0x803dc9;if(_0x3336ab>=_0x559f19){_0x3336ab=_0x559f19;_0x803dc9=0xc8;}else{_0x803dc9=0xce;}_0x78adbe[_0x1d7d('0x30')](_0x803dc9);return _0x78adbe[_0x1d7d('0x36')]('Content-Range',_0x3e4136+'-'+_0x3336ab+'/'+_0x559f19)['json'](_0x23ad85);}return null;};}function patchUpdates(_0x2e4402){return function(_0x2266a6){try{jsonpatch[_0x1d7d('0x37')](_0x2266a6,_0x2e4402,!![]);}catch(_0x40318f){return BPromise[_0x1d7d('0x38')](_0x40318f);}return _0x2266a6[_0x1d7d('0x39')]();};}function saveUpdates(_0x1aee3c,_0x40aca9){return function(_0x2fa3f4){if(_0x2fa3f4){return _0x2fa3f4['update'](_0x1aee3c)[_0x1d7d('0x24')](function(_0xf9d3e4){return _0xf9d3e4;});}return null;};}function removeEntity(_0x13a974,_0x30fb9a){return function(_0x4cc364){if(_0x4cc364){return _0x4cc364['destroy']()[_0x1d7d('0x24')](function(){_0x13a974[_0x1d7d('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x103c77,_0x3fea2e){return function(_0x568092){if(!_0x568092){_0x103c77['sendStatus'](0x194);}return _0x568092;};}function handleError(_0x26f81c,_0xc77f24){_0xc77f24=_0xc77f24||0x1f4;return function(_0x406f57){logger[_0x1d7d('0x29')](_0x406f57[_0x1d7d('0x3a')]);if(_0x406f57[_0x1d7d('0x3b')]){delete _0x406f57[_0x1d7d('0x3b')];}_0x26f81c[_0x1d7d('0x30')](_0xc77f24)[_0x1d7d('0x3c')](_0x406f57);};}function getMustacheRender(_0x318b9a,_0x4fcdcc){return Mustache['render'](_0x318b9a,_['merge'](_0x4fcdcc['body'],{'contact':_0x4fcdcc[_0x1d7d('0x3d')],'message':_0x4fcdcc['message'],'agent':_0x4fcdcc[_0x1d7d('0x3e')],'interaction':_0x4fcdcc[_0x1d7d('0x3f')],'account':_0x4fcdcc[_0x1d7d('0x40')]}))||'';}function getInteractionUsers(_0x515199,_0x5a4052){return new BPromise(function(_0x16a4e0,_0x153979){try{if(_0x5a4052[_0x515199['id']]){_0x515199['Users']=_[_0x1d7d('0x41')](_0x5a4052[_0x515199['id']],function(_0xa53806){return{'id':_0xa53806['id'],'fullname':_0xa53806[_0x1d7d('0x42')]};});}}catch(_0x2100f6){_0x153979(_0x2100f6);}_0x16a4e0(_0x515199);});}function getInteractionTags(_0x5eef0a,_0x1db8e8){return new BPromise(function(_0x42c229,_0x4239fa){try{if(_0x5eef0a[_0x1d7d('0x43')]){_0x5eef0a['Tags']=[];_0x5eef0a[_0x1d7d('0x43')]['split'](',')[_0x1d7d('0x44')](function(_0x31b850){_0x5eef0a[_0x1d7d('0x45')][_0x1d7d('0x46')](_0x1db8e8[_0x31b850]);});}delete _0x5eef0a[_0x1d7d('0x43')];}catch(_0x4becec){_0x4239fa(_0x4becec);}_0x42c229(_0x5eef0a);});}function updateChatInteraction(_0x59b8e7,_0x33582a,_0xe57fa5){return new BPromise(function(_0x1637fc,_0x4bed84){return getInteractionUsers(_0x59b8e7,_0xe57fa5)['then'](function(_0x12f397){return getInteractionTags(_0x12f397,_0x33582a);})['then'](function(_0x86e7bc){_0x1637fc(_0x86e7bc);})[_0x1d7d('0x2e')](function(_0x1d1064){_0x4bed84(_0x1d1064);});});}exports[_0x1d7d('0x47')]=function(_0x1e2ea8,_0x370e8d){var _0x72f5d7={},_0x51cb15={},_0x3ccd44={'count':0x0,'rows':[]};var _0x8b0c22=_['map'](db[_0x1d7d('0x48')][_0x1d7d('0x49')],function(_0x40599b){return{'name':_0x40599b[_0x1d7d('0x4a')],'type':_0x40599b[_0x1d7d('0x4b')][_0x1d7d('0x4c')]};});_0x51cb15[_0x1d7d('0x4d')]=_[_0x1d7d('0x41')](_0x8b0c22,_0x1d7d('0x3b'));_0x51cb15[_0x1d7d('0x4e')]=_[_0x1d7d('0x4f')](_0x1e2ea8[_0x1d7d('0x4e')]);_0x51cb15['filters']=_[_0x1d7d('0x50')](_0x51cb15['model'],_0x51cb15[_0x1d7d('0x4e')]);_0x72f5d7['attributes']=_[_0x1d7d('0x50')](_0x51cb15[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0x1e2ea8[_0x1d7d('0x4e')]['fields']));_0x72f5d7[_0x1d7d('0x52')]=_0x72f5d7['attributes']['length']?_0x72f5d7[_0x1d7d('0x52')]:_0x51cb15['model'];if(!_0x1e2ea8['query'][_0x1d7d('0x53')](_0x1d7d('0x54'))){_0x72f5d7['limit']=qs[_0x1d7d('0x32')](_0x1e2ea8[_0x1d7d('0x4e')]['limit']);_0x72f5d7[_0x1d7d('0x35')]=qs[_0x1d7d('0x35')](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x35')]);}_0x72f5d7['order']=qs['sort'](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x55')]);_0x72f5d7[_0x1d7d('0x56')]=qs[_0x1d7d('0x57')](_[_0x1d7d('0x58')](_0x1e2ea8['query'],_0x51cb15[_0x1d7d('0x57')]),_0x8b0c22);var _0x24e0b7=[];var _0x344b66=squel[_0x1d7d('0x59')]()[_0x1d7d('0x5a')]('id')[_0x1d7d('0x5a')](_0x1d7d('0x3b'))[_0x1d7d('0x5a')](_0x1d7d('0x5b'))['from'](_0x1d7d('0x5c'));var _0x41ad41=squel[_0x1d7d('0x59')]()['field']('u.id')[_0x1d7d('0x5a')](_0x1d7d('0x5d'))[_0x1d7d('0x5a')]('ui.ChatInteractionId')[_0x1d7d('0x5e')](_0x1d7d('0x5f'),'ui')['left_join'](_0x1d7d('0x60'),'u',_0x1d7d('0x61'));var _0x3fc216=squel[_0x1d7d('0x59')]()['from'](_0x1d7d('0x62'),'i')[_0x1d7d('0x63')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x1d7d('0x63')](_0x1d7d('0x60'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x1d7d('0x64'),'a',_0x1d7d('0x65'))[_0x1d7d('0x63')](_0x1d7d('0x66'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x1d7d('0x63')]('chat_interaction_has_tags','it',_0x1d7d('0x67'))[_0x1d7d('0x63')](_0x1d7d('0x5c'),'t',_0x1d7d('0x68'));var _0x5a4bd7=squel[_0x1d7d('0x69')]();var _0x1ea966=[];var _0x193135=squel[_0x1d7d('0x69')]();var _0x28ec14;if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x6a')]){_0x28ec14=as[_0x1d7d('0x6b')](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x6a')]);var _0x44a187=_0x28ec14[_0x1d7d('0x6c')];for(var _0x301a67=0x0;_0x301a67<_0x28ec14[_0x1d7d('0x6d')][_0x1d7d('0x6e')];_0x301a67++){var _0x520d3c=_0x28ec14[_0x1d7d('0x6d')][_0x301a67];var _0x566d27='i';var _0x1c9fe7=_[_0x1d7d('0x6f')](_0x8b0c22,[_0x1d7d('0x3b'),_0x520d3c[_0x1d7d('0x5a')]]);if(!_0x1c9fe7){switch(_0x520d3c[_0x1d7d('0x5a')]){case _0x1d7d('0x70'):if(_0x520d3c['value']==0x1){_0x3fc216[_0x1d7d('0x71')]('`'+_0x520d3c[_0x1d7d('0x5a')]+'`\x20=\x200');}else{_0x3fc216[_0x1d7d('0x71')]('`'+_0x520d3c['field']+_0x1d7d('0x72'));}break;case _0x1d7d('0x73'):if(_0x520d3c[_0x1d7d('0x74')]===_0x1d7d('0x75')){if(_0x520d3c[_0x1d7d('0x76')][_0x1d7d('0x77')]('\x20')['length']>0x1){_0x5a4bd7[_0x44a187](_0x1d7d('0x78'),qs[_0x1d7d('0x79')](_0x520d3c['value']),null);}else{var _0x3289c2='%'+_0x520d3c[_0x1d7d('0x76')]+'%';_0x5a4bd7[_0x44a187](_0x1d7d('0x7a'),_0x3289c2,_0x3289c2,_0x3289c2);}}else{_0x1c9fe7=_['find'](_0x8b0c22,[_0x1d7d('0x3b'),_0x1d7d('0x7b')]);_0x520d3c[_0x1d7d('0x5a')]=_0x1d7d('0x7b');_0x2e26d4=as['buildExpression'](_0x566d27,_0x1c9fe7[_0x1d7d('0x4b')],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')]['end']);}break;case _0x1d7d('0x7e'):var _0x10dea3=_0x520d3c['value'][_0x1d7d('0x77')](',')[_0x1d7d('0x41')](function(_0x17c174){return Number(_0x17c174);});_0x10dea3[_0x1d7d('0x44')](function(_0x47d27e){_0x193135['or'](_0x1d7d('0x7f'),'%,'+_0x47d27e+',%');});_0x1ea966=_['union'](_0x1ea966,_0x10dea3);break;case _0x1d7d('0x80'):if(_0x520d3c[_0x1d7d('0x74')]===_0x1d7d('0x75')){_0x5a4bd7[_0x44a187]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x520d3c[_0x1d7d('0x76')]+'%',null);}else{_0x1c9fe7=_[_0x1d7d('0x6f')](_0x8b0c22,[_0x1d7d('0x3b'),'UserId']);_0x520d3c[_0x1d7d('0x5a')]='UserId';_0x2e26d4=as[_0x1d7d('0x81')](_0x566d27,_0x1c9fe7[_0x1d7d('0x4b')],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x31')]);}break;case _0x1d7d('0x82'):_0x2e26d4=as[_0x1d7d('0x81')]('me',null,_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')]['start'],_0x2e26d4['value'][_0x1d7d('0x31')]);break;}}else{var _0x2e26d4=as[_0x1d7d('0x81')](_0x566d27,_0x1c9fe7['type'],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4['value'][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')]['end']);}}}else{var _0x1f55a2=_(_0x1e2ea8[_0x1d7d('0x4e')])['keys']()[_0x1d7d('0x41')](function(_0x40ee1f){return _[_0x1d7d('0x83')](_0x8b0c22,['name',_0x40ee1f])?_0x40ee1f:undefined;})['compact']()[_0x1d7d('0x76')]();if(!_[_0x1d7d('0x84')](_0x1f55a2)){_0x1f55a2['forEach'](function(_0x33430c){if(_0x33430c===_0x1d7d('0x85')){_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x86'),[]['concat'](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]));}else if(_0x33430c===_0x1d7d('0x87')){var _0x22cdd1=JSON[_0x1d7d('0x88')](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c])[_0x1d7d('0x89')];var _0x42a83c=JSON[_0x1d7d('0x88')](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c])[_0x1d7d('0x8a')];_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x8b'),_0x22cdd1,_0x42a83c);}else{if(_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]==='null'){_0x3fc216[_0x1d7d('0x56')]('i.'+_0x33430c+_0x1d7d('0x8c'));}else{_0x3fc216['where']('i.'+_0x33430c+_0x1d7d('0x8d'),_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]);}}});}if(_0x1e2ea8['query']['read']){if(_0x1e2ea8['query'][_0x1d7d('0x8e')]==0x1){_0x3fc216[_0x1d7d('0x71')](_0x1d7d('0x8f'));}else{_0x3fc216[_0x1d7d('0x71')]('`unreadMessages`\x20>\x200');}}if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]){_0x1ea966=_[_0x1d7d('0x91')](_0x1e2ea8[_0x1d7d('0x4e')]['tag'])?_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]:new Array(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]);_0x1ea966[_0x1d7d('0x44')](function(_0x2a7229){_0x193135['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2a7229+',%');});}if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x92')]){var _0x57aba7=_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x92')][_0x1d7d('0x93')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1d7d('0x94')](_0x57aba7)){_0x5a4bd7['or']('i.id\x20LIKE\x20?',_0x57aba7+'%');}else{_0x5a4bd7['or'](_0x1d7d('0x95'),qs[_0x1d7d('0x79')](_0x57aba7))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x57aba7+'%');}}}_0x3fc216[_0x1d7d('0x56')](_0x5a4bd7);_0x3fc216[_0x1d7d('0x96')](_0x1d7d('0x97'));var _0xc3c42f={'type':db[_0x1d7d('0x98')][_0x1d7d('0x99')][_0x1d7d('0x9a')],'raw':!![]};var _0x155e88=_0x3fc216[_0x1d7d('0x9b')]();_0x155e88[_0x1d7d('0x5a')](_0x1d7d('0x97'));_0x155e88[_0x1d7d('0x5a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x72f5d7[_0x1d7d('0x9c')]){_0x72f5d7[_0x1d7d('0x9c')][_0x1d7d('0x44')](function(_0x395818){var _0x247289=_0x395818[0x0]===_0x1d7d('0x9d')?_0x395818[0x0]:'i.'+_0x395818[0x0];_0x3fc216[_0x1d7d('0x9c')](_0x247289,_0x395818[0x1]===_0x1d7d('0x9e')?![]:!![]);});}if(!_[_0x1d7d('0x84')](_0x1ea966)){_0x3fc216[_0x1d7d('0x71')](_0x193135);_0x155e88[_0x1d7d('0x56')](_0x1d7d('0x9f'),_0x1ea966);}BPromise['resolve']()[_0x1d7d('0x24')](function(){if(!_0x28ec14){if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x85')])return;_0x155e88[_0x1d7d('0x56')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0xa0'));return;}if(_0x1e2ea8[_0x1d7d('0xa1')][_0x1d7d('0xa2')]!=='agent')return;return _0x1e2ea8['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x10925b){if(_[_0x1d7d('0x84')](_0x10925b)){_0x155e88['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0xa3'));}else{_0x155e88[_0x1d7d('0x56')](_0x1d7d('0x86'),_[_0x1d7d('0x41')](_0x10925b,'id'));_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x86'),_[_0x1d7d('0x41')](_0x10925b,'id'));}});})[_0x1d7d('0x24')](function(){if(_0x1e2ea8[_0x1d7d('0xa1')]['role']===_0x1d7d('0x3e')&&!_0x28ec14&&!_0x1e2ea8['query'][_0x1d7d('0x85')])return[];return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x155e88['toString'](),_0xc3c42f);})[_0x1d7d('0x24')](function(_0x40464c){_0x3ccd44[_0x1d7d('0x34')]=_0x40464c[_0x1d7d('0x6e')];if(_0x3ccd44[_0x1d7d('0x34')]===0x0)return[];return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x344b66[_0x1d7d('0xa5')](),_0xc3c42f)[_0x1d7d('0x24')](function(_0x74e3fe){_0x24e0b7=_[_0x1d7d('0xa6')](_0x74e3fe,'id');_0xc3c42f=_[_0x1d7d('0xa7')](_0xc3c42f,{'model':db[_0x1d7d('0x48')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x51')]){_0x72f5d7[_0x1d7d('0x52')][_0x1d7d('0x44')](function(_0x2aac19){_0x3fc216[_0x1d7d('0x5a')]('i.'+_0x2aac19);});}else{_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xa8'),_0x1d7d('0x70'));_0x3fc216[_0x1d7d('0x5a')]('a.key',_0x1d7d('0xa9'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xaa'),'Account.mandatoryDisposition');_0x3fc216[_0x1d7d('0x5a')]('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');_0x3fc216['field']('i.*');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xab'),_0x1d7d('0xac'));_0x3fc216['field'](_0x1d7d('0xad'),'Contact.lastName');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xae'),_0x1d7d('0xaf'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb0'),_0x1d7d('0xb1'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb2'),_0x1d7d('0xb3'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb4'),'Contact.fax');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb5'),_0x1d7d('0xb6'));_0x3fc216['field'](_0x1d7d('0xb7'),_0x1d7d('0xb8'));_0x3fc216[_0x1d7d('0x5a')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x72f5d7[_0x1d7d('0x32')])_0x3fc216['limit'](_0x72f5d7[_0x1d7d('0x32')]);if(_0x72f5d7[_0x1d7d('0x35')])_0x3fc216['offset'](_0x72f5d7[_0x1d7d('0x35')]);return db[_0x1d7d('0xa4')]['query'](_0x3fc216[_0x1d7d('0xa5')](),_0xc3c42f);})[_0x1d7d('0x24')](function(_0x45b5e2){if(_0x45b5e2[_0x1d7d('0x6e')]>0x0)_0x41ad41['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x1d7d('0x41')](_0x45b5e2,'id'));return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x41ad41[_0x1d7d('0xa5')](),_0xc3c42f)[_0x1d7d('0x24')](function(_0xa5c005){var _0x1af86a=_[_0x1d7d('0xb9')](_0xa5c005,_0x1d7d('0xba'));var _0x434500=[];_0x45b5e2[_0x1d7d('0x44')](function(_0x26781c){_0x434500[_0x1d7d('0x46')](updateChatInteraction(_0x26781c,_0x24e0b7,_0x1af86a));});return BPromise[_0x1d7d('0xbb')](_0x434500);});});})[_0x1d7d('0x24')](function(_0x39924a){_0x3ccd44[_0x1d7d('0xbc')]=_0x39924a;return _0x3ccd44;})[_0x1d7d('0x24')](respondWithFilteredResult(_0x370e8d,_0x72f5d7))['catch'](handleError(_0x370e8d,null));};exports[_0x1d7d('0xbd')]=function(_0x45e83d,_0x16ce51){var _0x20b99d={'raw':![],'where':{'id':_0x45e83d[_0x1d7d('0xbe')]['id']}},_0x5ca824={};_0x5ca824[_0x1d7d('0x4d')]=_[_0x1d7d('0x4f')](db[_0x1d7d('0x48')]['rawAttributes']);_0x5ca824[_0x1d7d('0x4e')]=_['keys'](_0x45e83d[_0x1d7d('0x4e')]);_0x5ca824[_0x1d7d('0x57')]=_[_0x1d7d('0x50')](_0x5ca824['model'],_0x5ca824[_0x1d7d('0x4e')]);_0x20b99d['attributes']=_[_0x1d7d('0x50')](_0x5ca824[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0x45e83d[_0x1d7d('0x4e')]['fields']));_0x20b99d[_0x1d7d('0x52')]=_0x20b99d['attributes'][_0x1d7d('0x6e')]?_0x20b99d[_0x1d7d('0x52')]:_0x5ca824['model'];if(_0x45e83d[_0x1d7d('0x4e')][_0x1d7d('0xbf')]){_0x20b99d[_0x1d7d('0xc0')]=[{'all':!![]}];}_0x20b99d=_[_0x1d7d('0xa7')]({},_0x20b99d,_0x45e83d['options']);return db['ChatInteraction']['find'](_0x20b99d)[_0x1d7d('0x24')](handleEntityNotFound(_0x16ce51,null))[_0x1d7d('0x24')](respondWithResult(_0x16ce51,null))[_0x1d7d('0x2e')](handleError(_0x16ce51,null));};exports[_0x1d7d('0xc1')]=function(_0x458f92,_0x55ea3b){return db[_0x1d7d('0x48')][_0x1d7d('0xc1')](_0x458f92[_0x1d7d('0x82')],{})[_0x1d7d('0x24')](respondWithResult(_0x55ea3b,0xc9))['catch'](handleError(_0x55ea3b,null));};exports['update']=function(_0xbde512,_0x21995f){if(_0xbde512[_0x1d7d('0x82')]['id']){delete _0xbde512[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0xbde512['params']['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x21995f,null))['then'](saveUpdates(_0xbde512[_0x1d7d('0x82')],null))[_0x1d7d('0x24')](respondWithResult(_0x21995f,null))['catch'](handleError(_0x21995f,null));};exports[_0x1d7d('0xc2')]=function(_0x5a754a,_0x13566e){return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0x5a754a[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x13566e,null))['then'](removeEntity(_0x13566e,null))[_0x1d7d('0x2e')](handleError(_0x13566e,null));};exports['describe']=function(_0x303d6f,_0x5bf0de){return db['ChatInteraction'][_0x1d7d('0xc3')]()[_0x1d7d('0x24')](respondWithResult(_0x5bf0de,null))[_0x1d7d('0x2e')](handleError(_0x5bf0de,null));};exports[_0x1d7d('0xc4')]=function(_0x8ce169,_0x3f119f){var _0x14d3fb=_0x8ce169[_0x1d7d('0xbe')]['id'];var _0x3d5fff;var _0x3b7543;var _0x3e94d6;return db[_0x1d7d('0x48')]['findOne']({'where':{'id':_0x14d3fb}})['then'](function(_0x1f2d68){_0x3d5fff=_0x1f2d68;return db['ChatWebsite'][_0x1d7d('0xc5')]({'where':{'id':_0x1f2d68['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x1d7d('0xc6'),_0x1d7d('0xc7'),_0x1d7d('0xc8'),_0x1d7d('0xc9')],'raw':!![]});})[_0x1d7d('0x24')](function(_0xd919b1){if(_0xd919b1&&_0xd919b1[_0x1d7d('0xca')]&&_0xd919b1[_0x1d7d('0xc6')]){_0x3b7543=_0xd919b1;var _0x5690c={'interaction':{'id':_0x14d3fb},'agent':{'id':_0x8ce169['user']['id'],'name':_0x8ce169['user'][_0x1d7d('0x3b')],'fullname':_0x8ce169['user'][_0x1d7d('0x42')],'email':_0x8ce169[_0x1d7d('0xa1')][_0x1d7d('0xcb')]},'contact':_0x8ce169[_0x1d7d('0x82')][_0x1d7d('0x3d')],'account':_0x8ce169[_0x1d7d('0x82')][_0x1d7d('0x40')]};var _0x3774f8={'rejectUnauthorized':![],'method':_0x1d7d('0xcc'),'url':_0x1d7d('0xcd'),'headers':{'X-APIKEY':_0xd919b1[_0x1d7d('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x8ce169[_0x1d7d('0xa1')]['email']],'buttons':null,'topic':_0x3b7543['vidaooTopic'],'note':_[_0x1d7d('0xce')](_0x3b7543[_0x1d7d('0xc8')])?null:getMustacheRender(_0x3b7543[_0x1d7d('0xc8')],_0x5690c),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x3b7543[_0x1d7d('0xc9')])){var _0x470f5e=getMustacheRender(_0x3b7543['vidaooMetadata'],_0x5690c);var _0x1f0d9f=JSON['parse'](_0x470f5e);_0x3774f8[_0x1d7d('0x82')]['metadata']=_0x1f0d9f;}}catch(_0x1f50d4){throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xd0'));}return rp(_0x3774f8);}else{throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xd1'));}})[_0x1d7d('0x24')](function(_0x4f1602){_0x3e94d6=_0x4f1602;if(_0x3e94d6['id']){var _0x202d85={'body':_0x3e94d6[_0x1d7d('0xd2')],'ChatWebsiteId':_0x3b7543['id'],'ChatInteractionId':_0x3d5fff['id'],'direction':_0x1d7d('0xd3'),'UserId':_0x8ce169[_0x1d7d('0xa1')]['id']};return db[_0x1d7d('0xd4')][_0x1d7d('0xc1')](_0x202d85,{});}else{throw new db['Sequelize'][(_0x1d7d('0xcf'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x1d7d('0x24')](function(){return _0x3d5fff[_0x1d7d('0xd5')]({'vidaooSessionId':_0x3e94d6['id']});})['then'](respondWithResult(_0x3f119f,null))[_0x1d7d('0x2e')](handleError(_0x3f119f,null));};exports[_0x1d7d('0xd6')]=function(_0x3e7f3c,_0x454679){if(_0x3e7f3c['body']['id']){delete _0x3e7f3c[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x3e7f3c['params']['id']},'include':[{'model':db[_0x1d7d('0xd7')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x454679,null))['then'](saveUpdates(_0x3e7f3c[_0x1d7d('0x82')],null))['then'](respondWithResult(_0x454679,null))[_0x1d7d('0x2e')](handleError(_0x454679,null));};exports[_0x1d7d('0xd8')]=function(_0x4abfb1,_0x4caa84,_0x561f33){if(_0x4abfb1[_0x1d7d('0x82')]['id']){delete _0x4abfb1[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x4abfb1[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](function(_0x54616b){if(!_0x54616b){logger['error'](_0x1d7d('0xd9'),'abandon',0x194,'entity\x20not\x20found');_0x4caa84[_0x1d7d('0x2f')](0x194);}else{if(_0x54616b[_0x1d7d('0xda')]){throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xdb'));}}return _0x54616b;})[_0x1d7d('0x24')](function(_0x19427f){if(_0x19427f){return _0x19427f[_0x1d7d('0xdc')]({'closed':_0x4abfb1['body']['closed'],'disposition':_0x4abfb1[_0x1d7d('0x82')][_0x1d7d('0xdd')]})[_0x1d7d('0x24')](function(_0x4d8a36){return _0x4d8a36;});}})[_0x1d7d('0x24')](function(_0x216585){return respondWithRpcPromise('AbandonInteraction',_0x1d7d('0xd8'),_0x4abfb1[_0x1d7d('0x82')],client9004);})[_0x1d7d('0x24')](respondWithResult(_0x4caa84,null))['catch'](handleError(_0x4caa84,null));};exports['attachmentUpload']=function(_0x854f68,_0x205d6f,_0x149415){_0x854f68[_0x1d7d('0x82')][_0x1d7d('0x3b')]=_0x854f68[_0x1d7d('0xde')]['originalname'];_0x854f68[_0x1d7d('0x82')][_0x1d7d('0xdf')]=_0x854f68['file'][_0x1d7d('0xe0')];_0x854f68[_0x1d7d('0x82')]['type']=_0x854f68['file']['mimetype'];return db[_0x1d7d('0xe1')][_0x1d7d('0xc1')](_0x854f68[_0x1d7d('0x82')])[_0x1d7d('0x24')](respondWithResult(_0x205d6f,0xc9))[_0x1d7d('0x2e')](handleError(_0x205d6f,null));};exports[_0x1d7d('0xe2')]=function(_0x3e358c,_0x2eae3c,_0x3838ef){return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0x3e358c[_0x1d7d('0xbe')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2eae3c,null))['then'](function(_0x545b09){if(_0x545b09){if(_0x545b09[_0x1d7d('0xe3')]){return _0x2eae3c[_0x1d7d('0x30')](0x193)[_0x1d7d('0xe4')]({'status':0x193,'message':_0x1d7d('0xe5')});}return db[_0x1d7d('0xe1')][_0x1d7d('0xc5')]({'where':{'id':_0x3e358c[_0x1d7d('0x4e')][_0x1d7d('0xe6')]},'raw':!![]})['then'](handleEntityNotFound(_0x2eae3c,null));}})['then'](function(_0x549144){if(_0x549144){var _0x2a4feb=_0x549144[_0x1d7d('0xe7')]!==null;var _0x4df896=path[_0x1d7d('0xe8')](config['root'],_0x1d7d('0xe9'));if(_0x2a4feb){_0x4df896=path[_0x1d7d('0xe8')](_0x4df896,_0x1d7d('0xea'));}var _0x37eb97=path[_0x1d7d('0xe8')](_0x4df896,_0x549144[_0x1d7d('0xdf')]);return _0x2eae3c['download'](_0x37eb97);}})[_0x1d7d('0x2e')](handleError(_0x2eae3c,null));};exports[_0x1d7d('0xeb')]=function(_0x185697,_0x4d5753){var _0x55929b=null;var _0x43ce7f=null;var _0x2b0486=null;var _0x337c32=null;if(_0x185697['body']['id']){delete _0x185697[_0x1d7d('0x82')]['id'];}if(_0x185697['body'][_0x1d7d('0xec')]){_0x337c32=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server/files/chat/upload/',util['format'](_0x1d7d('0xee'),Date[_0x1d7d('0xef')]()));_0x185697[_0x1d7d('0x82')][_0x1d7d('0xf0')]=_0x337c32;}return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0x185697[_0x1d7d('0xbe')]['id']},'include':[{'model':db[_0x1d7d('0xd4')],'as':_0x1d7d('0xf1'),'include':[{'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80')}]}]})['then'](handleEntityNotFound(_0x4d5753,null))[_0x1d7d('0x24')](saveUpdates(_0x185697[_0x1d7d('0x82')],null))[_0x1d7d('0x24')](function(_0x551a56){if(_0x551a56){_0x55929b=_0x551a56;return db['ChatWebsite'][_0x1d7d('0x6f')]({'where':{'id':_0x55929b['ChatWebsiteId']}});}})[_0x1d7d('0x24')](function(_0x1d47d9){if(_0x1d47d9){_0x2b0486=_0x1d47d9;return db[_0x1d7d('0xd7')]['find']({'where':{'id':_0x55929b[_0x1d7d('0x7b')]}});}})['then'](function(_0x5c0be4){if(_0x5c0be4){_0x43ce7f=_0x5c0be4;if(_0x337c32){var _0x46b9e5=null;for(var _0x385e15=0x1;_0x385e15<_0x55929b['Messages'][_0x1d7d('0x6e')];++_0x385e15){_0x46b9e5=_0x55929b[_0x1d7d('0xf1')][_0x385e15];var _0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')]('%s%d',_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5['UserId']):_0x1d7d('0xf4');var _0x474f68=_0x185697['body'][_0x1d7d('0xf5')]||util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x1d7d('0xf7'),_0x46b9e5[_0x1d7d('0x7b')]);switch(_0x2b0486[_0x1d7d('0xf8')]){case _0x1d7d('0xf9'):_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5[_0x1d7d('0xda')]):_0x1d7d('0xf4');break;case'agent_alias':_0x20543c=_0x46b9e5['UserId']?_0x46b9e5[_0x1d7d('0x80')]['alias']||_0x46b9e5['User'][_0x1d7d('0x42')]:'System';break;case _0x1d7d('0xfa'):_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?_0x46b9e5[_0x1d7d('0x80')]['fullname']:_0x1d7d('0xf4');break;default:_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5[_0x1d7d('0xda')]):_0x1d7d('0xf4');}var _0x353bb1=util[_0x1d7d('0xf2')]('[%s]\x20%s:\x20%s\x0a',moment(_0x46b9e5[_0x1d7d('0x87')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x46b9e5[_0x1d7d('0xfb')]==='in'?_0x474f68:_0x20543c,_0x46b9e5['body']);if(!_0x46b9e5[_0x1d7d('0xfc')]){fs[_0x1d7d('0xfd')](_0x337c32,_0x353bb1);}}return db[_0x1d7d('0xfe')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1d7d('0xff'),'raw':!![]}]});}}})[_0x1d7d('0x24')](function(_0x5c2113){if(_0x5c2113&&_0x5c2113[_0x1d7d('0xff')]&&_0x185697[_0x1d7d('0x82')]){var _0x129d4b={'tls':{'rejectUnauthorized':![]}};if(_0x5c2113['Smtp']['service']){_0x129d4b[_0x1d7d('0x100')]=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x100')];}else{_0x129d4b['host']=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x101')];_0x129d4b['port']=_0x5c2113['Smtp']['port'];_0x129d4b[_0x1d7d('0x102')]=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x102')];}if(_0x5c2113['Smtp']['authentication']){_0x129d4b[_0x1d7d('0x103')]={'user':_0x5c2113[_0x1d7d('0xff')]['user'],'pass':_0x5c2113['Smtp'][_0x1d7d('0x104')]};}return respondWithRpcPromise(_0x1d7d('0x105'),'sendMail',{'account':_0x129d4b,'message':{'from':util[_0x1d7d('0xf2')]('\x22%s\x22\x20<%s>',_0x5c2113[_0x1d7d('0x3b')],_0x5c2113[_0x1d7d('0xcb')]||_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0xa1')]),'to':_0x185697[_0x1d7d('0x82')][_0x1d7d('0xec')],'subject':_0x1d7d('0x106'),'text':util[_0x1d7d('0xf2')](_0x1d7d('0x107'),_0x185697[_0x1d7d('0x82')][_0x1d7d('0xec')]),'attachments':[{'path':_0x337c32}]}})['then'](function(){return _0x55929b;})[_0x1d7d('0x2e')](function(_0x18c505){console[_0x1d7d('0x29')](_0x18c505);});}else{return _0x55929b;}})['then'](respondWithStatusCode(_0x4d5753,0xc8))['catch'](handleError(_0x4d5753,null));};exports[_0x1d7d('0x108')]=function(_0x1b41b5,_0x5b79bd,_0xb87340){return db[_0x1d7d('0xd4')][_0x1d7d('0x6f')]({'where':{'id':_0x1b41b5[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x5b79bd,null))[_0x1d7d('0x24')](function(_0x537520){if(_0x537520){return _0x537520[_0x1d7d('0x108')](_0x1b41b5['body']['ids'],_['omit'](_0x1b41b5[_0x1d7d('0x82')],['ids','id'])||{});}})[_0x1d7d('0x24')](respondWithResult(_0x5b79bd,null))[_0x1d7d('0x2e')](handleError(_0x5b79bd,null));};exports['getMessages']=function(_0x1ce79d,_0x7dbbc9,_0x286ddd){var _0x1484b1={'raw':![],'where':{}};var _0x5be0c4={};var _0x50be17={'count':0x0,'rows':[]};return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0x1ce79d[_0x1d7d('0xbe')]['id']}})['then'](handleEntityNotFound(_0x7dbbc9,null))['then'](function(_0x81fadf){if(_0x81fadf){_0x5be0c4['model']=_[_0x1d7d('0x4f')](db[_0x1d7d('0xd4')][_0x1d7d('0x49')]);_0x5be0c4[_0x1d7d('0x4e')]=_['keys'](_0x1ce79d[_0x1d7d('0x4e')]);_0x5be0c4['filters']=_[_0x1d7d('0x50')](_0x5be0c4[_0x1d7d('0x4d')],_0x5be0c4[_0x1d7d('0x4e')]);_0x1484b1['attributes']=_[_0x1d7d('0x50')](_0x5be0c4[_0x1d7d('0x4d')],qs['fields'](_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x51')]));_0x1484b1[_0x1d7d('0x52')]=_0x1484b1[_0x1d7d('0x52')]['length']?_0x1484b1[_0x1d7d('0x52')]:_0x5be0c4[_0x1d7d('0x4d')];if(!_0x1ce79d[_0x1d7d('0x4e')]['hasOwnProperty']('nolimit')){_0x1484b1[_0x1d7d('0x32')]=qs['limit'](_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x32')]);_0x1484b1[_0x1d7d('0x35')]=qs['offset'](_0x1ce79d[_0x1d7d('0x4e')]['offset']);}_0x1484b1[_0x1d7d('0x9c')]=qs['sort'](_0x1ce79d[_0x1d7d('0x4e')]['sort']);_0x1484b1['where']=qs[_0x1d7d('0x57')](_[_0x1d7d('0x58')](_0x1ce79d[_0x1d7d('0x4e')],_0x5be0c4[_0x1d7d('0x57')]));_0x1484b1[_0x1d7d('0x56')]['ChatInteractionId']=_0x81fadf['id'];if(_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x92')]){_0x1484b1[_0x1d7d('0x56')]=_['merge'](_0x1484b1[_0x1d7d('0x56')],{'$or':_['map'](_0x1484b1['attributes'],function(_0x19ee24){var _0x3cdad2={};_0x3cdad2[_0x19ee24]={'$like':'%'+_0x1ce79d['query'][_0x1d7d('0x92')]+'%'};return _0x3cdad2;})});}if(_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x89')]){var _0x24984d=_0x1ce79d[_0x1d7d('0x4e')]['$gte'][_0x1d7d('0x77')](',');var _0x5a2144={};_0x5a2144[_0x24984d[0x0]]={'$gte':moment(_0x24984d[0x1])[_0x1d7d('0xf2')](_0x1d7d('0x109'))};_0x1484b1[_0x1d7d('0x56')]=_['merge'](_0x1484b1['where'],_0x5a2144);}_0x1484b1=_['merge']({},_0x1484b1,_0x1ce79d['options']);return db['ChatMessage'][_0x1d7d('0x34')]({'where':_0x1484b1[_0x1d7d('0x56')]})[_0x1d7d('0x24')](function(_0x1e83dc){_0x50be17[_0x1d7d('0x34')]=_0x1e83dc;if(_0x1ce79d['query']['includeAll']){_0x1484b1[_0x1d7d('0xc0')]=[{'all':!![]}];}return db[_0x1d7d('0xd4')]['findAll'](_0x1484b1);})[_0x1d7d('0x24')](function(_0x2d0232){_0x50be17[_0x1d7d('0xbc')]=_0x2d0232;return _0x50be17;});}})['then'](respondWithFilteredResult(_0x7dbbc9,_0x1484b1))[_0x1d7d('0x2e')](handleError(_0x7dbbc9,null));};exports[_0x1d7d('0x10a')]=function(_0xb42210,_0x3844b6,_0x1181b6){var _0x530493={'where':{}},_0x53cdb8={},_0x960917={'count':0x0,'rows':[]};return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0xb42210[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x3844b6,null))['then'](function(_0x339603){if(_0x339603){_0x53cdb8[_0x1d7d('0x4d')]=_['keys'](db['ChatMessage'][_0x1d7d('0x49')]);_0x53cdb8['query']=_[_0x1d7d('0x4f')](_0xb42210[_0x1d7d('0x4e')]);_0x53cdb8[_0x1d7d('0x57')]=_[_0x1d7d('0x50')](_0x53cdb8[_0x1d7d('0x4d')],_0x53cdb8[_0x1d7d('0x4e')]);_0x530493[_0x1d7d('0x52')]=_['intersection'](_0x53cdb8[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0xb42210[_0x1d7d('0x4e')]['fields']));_0x530493[_0x1d7d('0x52')]=_0x530493[_0x1d7d('0x52')]['length']?_0x530493[_0x1d7d('0x52')]:_0x53cdb8['model'];if(!_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x53')](_0x1d7d('0x54'))){_0x530493[_0x1d7d('0x32')]=qs[_0x1d7d('0x32')](_0xb42210['query'][_0x1d7d('0x32')]);_0x530493[_0x1d7d('0x35')]=qs['offset'](_0xb42210['query'][_0x1d7d('0x35')]);}_0x530493[_0x1d7d('0x9c')]=qs['sort'](_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x55')]);_0x530493[_0x1d7d('0x56')]=qs[_0x1d7d('0x57')](_['pick'](_0xb42210['query'],_0x53cdb8[_0x1d7d('0x57')]));_0x530493[_0x1d7d('0x56')][_0x1d7d('0xba')]=_0x339603['id'];if(_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x92')]){_0x530493[_0x1d7d('0x56')]=_[_0x1d7d('0xa7')](_0x530493[_0x1d7d('0x56')],{'$or':_[_0x1d7d('0x41')](_0x530493[_0x1d7d('0x52')],function(_0x3dfeb8){var _0x4726cb={};_0x4726cb[_0x3dfeb8]={'$like':'%'+_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x92')]+'%'};return _0x4726cb;})});}_0x530493[_0x1d7d('0x56')][_0x1d7d('0xfc')]=![];if(_0xb42210[_0x1d7d('0x4e')]['id']){_0x530493['where']['id']={'$gt':_0xb42210[_0x1d7d('0x4e')]['id']};}_0x530493=_['merge']({},_0x530493,_0xb42210['options']);return db[_0x1d7d('0xd4')][_0x1d7d('0x34')]({'where':_0x530493[_0x1d7d('0x56')]})[_0x1d7d('0x24')](function(_0x1e2b03){_0x960917['count']=_0x1e2b03;_0x530493[_0x1d7d('0xc0')]=[];if(_0xb42210[_0x1d7d('0x4e')]['includeAgent']){_0x530493[_0x1d7d('0xc0')]['push']({'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80'),'attributes':['id',_0x1d7d('0x42'),_0x1d7d('0x10b')]});}if(_0xb42210[_0x1d7d('0x4e')]['includeAll']){_0x530493[_0x1d7d('0xc0')]=[{'all':!![]}];}return db[_0x1d7d('0xd4')][_0x1d7d('0x10c')](_0x530493);})[_0x1d7d('0x24')](function(_0x2d1258){_0x960917[_0x1d7d('0xbc')]=_0x2d1258;return _0x960917;});}})[_0x1d7d('0x24')](respondWithFilteredResult(_0x3844b6,_0x530493))[_0x1d7d('0x2e')](handleError(_0x3844b6,null));};exports[_0x1d7d('0x10d')]=function(_0x34b43f,_0x14a937,_0x291f26){return db['ChatInteraction'][_0x1d7d('0x6f')]({'where':{'id':_0x34b43f[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x14a937,null))['then'](function(_0x59b044){if(_0x59b044){return _0x59b044[_0x1d7d('0x10e')](_0x34b43f['body'][_0x1d7d('0x10f')],_[_0x1d7d('0x110')](_0x34b43f[_0x1d7d('0x82')],[_0x1d7d('0x10f'),'id'])||{})[_0x1d7d('0x111')](function(){return db[_0x1d7d('0x7e')]['findAll']({'attributes':['id',_0x1d7d('0x3b'),'color'],'where':{'id':_0x34b43f['body'][_0x1d7d('0x10f')]}});})[_0x1d7d('0x24')](function(_0x5b1ae1){socket[_0x1d7d('0x112')](_0x1d7d('0x113'),{'id':Number(_0x34b43f['params']['id']),'tags':_0x5b1ae1||[]});return{'id':Number(_0x34b43f[_0x1d7d('0xbe')]['id']),'tags':_0x5b1ae1||[]};});}})['then'](respondWithResult(_0x14a937,null))[_0x1d7d('0x2e')](handleError(_0x14a937,null));};exports[_0x1d7d('0x114')]=function(_0x7c3bd8,_0x552481,_0x2c91d5){return db['ChatInteraction'][_0x1d7d('0x6f')]({'where':{'id':_0x7c3bd8[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x552481,null))[_0x1d7d('0x24')](function(_0xf5e9f8){if(_0xf5e9f8){return _0xf5e9f8['removeTags'](_0x7c3bd8['query'][_0x1d7d('0x10f')]);}})[_0x1d7d('0x24')](respondWithStatusCode(_0x552481,null))['catch'](handleError(_0x552481,null));};exports[_0x1d7d('0x115')]=function(_0x210be0,_0x5f1b69){var _0x44c5ac=moment()[_0x1d7d('0x116')]()['toString']();var _0x39cae3=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server','files',_0x1d7d('0x117'));var _0x1eec70=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],_0x1d7d('0x118'),_0x1d7d('0x119'),_0x1d7d('0x11a'));var _0x3ded4b=path['join'](_0x39cae3,_0x44c5ac);var _0xe65d48=util[_0x1d7d('0xf2')](_0x1d7d('0x11b'),_0x210be0[_0x1d7d('0xbe')]['id'],_0x44c5ac);var _0x3b440c=path['join'](_0x39cae3,_0xe65d48);var _0x473472=[];_0x473472[_0x1d7d('0x46')]({'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80'),'attributes':['id',_0x1d7d('0x42')],'raw':!![]});_0x473472[_0x1d7d('0x46')]({'model':db[_0x1d7d('0xd7')],'as':_0x1d7d('0x73'),'attributes':['id','firstName',_0x1d7d('0x11c')],'raw':!![]});if(_0x210be0[_0x1d7d('0x4e')][_0x1d7d('0x11a')]){_0x473472[_0x1d7d('0x46')]({'model':db['Attachment'],'as':_0x1d7d('0xe1'),'raw':!![]});}var _0x2aab28=[{'model':db[_0x1d7d('0xd4')],'as':_0x1d7d('0xf1'),'attributes':['id','body',_0x1d7d('0x87'),_0x1d7d('0xfb'),'secret',_0x1d7d('0x8e')],'include':_0x473472}];_0x2aab28['push']({'model':db[_0x1d7d('0x11d')],'as':'Account','attributes':['id','name']});_0x2aab28[_0x1d7d('0x46')]({'model':db[_0x1d7d('0x80')],'as':'Owner','attributes':['id','fullname']});return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x210be0[_0x1d7d('0xbe')]['id']},'include':_0x2aab28})[_0x1d7d('0x24')](handleEntityNotFound(_0x5f1b69,null))[_0x1d7d('0x24')](function(_0x4e8473){if(_0x4e8473){var _0x194822=_0x4e8473[_0x1d7d('0x11e')]({'plain':!![]});fs[_0x1d7d('0x11f')](_0x3ded4b);var _0x3e93bb={'channel':_0x1d7d('0x120'),'account':_0x194822[_0x1d7d('0x121')]['name'],'agent':_0x194822['Owner']?_0x194822[_0x1d7d('0x122')][_0x1d7d('0x42')]:_0x1d7d('0x123'),'createdAt':moment(_0x194822[_0x1d7d('0x87')])[_0x1d7d('0xf2')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x194822[_0x1d7d('0xe3')]?moment(_0x194822['closedAt'])['format'](_0x1d7d('0x109'))[_0x1d7d('0xa5')]():'','disposition':_0x194822[_0x1d7d('0xdd')],'chatInfo':{'browser':_0x194822[_0x1d7d('0x124')],'os':_0x194822[_0x1d7d('0x125')],'referer':_0x194822['referer'],'customerIp':_0x194822[_0x1d7d('0x126')],'customerPort':_0x194822[_0x1d7d('0x127')]?_0x194822[_0x1d7d('0x127')]:_0x1d7d('0x123')},'messages':_(_0x194822[_0x1d7d('0xf1')])[_0x1d7d('0x128')]()['filter']({'secret':![]})[_0x1d7d('0x41')](function(_0x6ea91f){if(_0x6ea91f[_0x1d7d('0xe1')]){var _0x2b3cbd=path[_0x1d7d('0xe8')](_0x1eec70,_0x6ea91f[_0x1d7d('0xe1')][_0x1d7d('0xdf')]);if(fs['existsSync'](_0x2b3cbd)){fs[_0x1d7d('0x129')](_0x2b3cbd)[_0x1d7d('0x12a')](fs[_0x1d7d('0x12b')](path[_0x1d7d('0xe8')](_0x3ded4b,_0x6ea91f[_0x1d7d('0xe1')]['basename'])));}}return{'date':moment(_0x6ea91f[_0x1d7d('0x87')])[_0x1d7d('0xf2')](_0x1d7d('0x109'))[_0x1d7d('0xa5')](),'sender':_0x6ea91f['direction']==='out'?_0x6ea91f[_0x1d7d('0x80')]?_0x6ea91f[_0x1d7d('0x80')][_0x1d7d('0x42')]:_0x1d7d('0xf4'):_0x6ea91f[_0x1d7d('0x73')]['firstName']+(_0x6ea91f[_0x1d7d('0x73')][_0x1d7d('0x11c')]?'\x20'+_0x6ea91f[_0x1d7d('0x73')]['lastName']:''),'body':_0x6ea91f[_0x1d7d('0xe1')]?_0x6ea91f[_0x1d7d('0xe1')][_0x1d7d('0xdf')]:_0x6ea91f[_0x1d7d('0x82')],'direction':_0x6ea91f['direction']===_0x1d7d('0xd3')?'A':'C','secret':_0x6ea91f[_0x1d7d('0xfc')],'read':_0x6ea91f[_0x1d7d('0x8e')],'attachment':_0x6ea91f['Attachment']};})[_0x1d7d('0x76')]()};return ejs[_0x1d7d('0x12c')](path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server','views',_0x1d7d('0x12d')),{'interaction':_0x3e93bb})[_0x1d7d('0x24')](function(_0x43f4cb){var _0x21d65a=path[_0x1d7d('0xe8')](_0x3ded4b,'transcript-'+_0x194822['id']+'-'+_0x44c5ac+_0x1d7d('0x12e'));var _0x4d0682={'path':_0x21d65a,'channel':_0x1d7d('0x120'),'interactionId':_0x194822['id']};return pdf[_0x1d7d('0x12f')](_0x43f4cb,_0x4d0682);})['then'](function(){return new BPromise(function(_0x29f93c,_0x582183){zipdir(_0x3ded4b,{'saveTo':_0x3b440c},function(_0x12250e,_0x19127b){if(_0x12250e)return _0x582183(_0x12250e);return _0x29f93c(_0x19127b);});})['then'](function(){return new BPromise(function(_0x35f2d1,_0x588610){rimraf(_0x3ded4b,function(_0x35f18d){if(_0x35f18d)_0x588610(_0x35f18d);return _0x35f2d1();});});})[_0x1d7d('0x24')](function(){return _0x5f1b69[_0x1d7d('0x115')](_0x3b440c,_0xe65d48,function(_0x10263c){if(_0x10263c){console['log']('err',_0x10263c);}else{fs[_0x1d7d('0x130')](_0x3b440c);}});});});}else{return _0x5f1b69[_0x1d7d('0x2f')](0xc8);}})[_0x1d7d('0x2e')](handleError(_0x5f1b69,null));}; \ No newline at end of file +var _0x7880=['parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','agent','sequelize','toString','keyBy','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','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','include','options','create','destroy','describe','createVidaooSession','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','update','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','findOne','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','transcript-%s.txt','now','Messages','%s%d','agentAlias','customer','format','website_alias','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailServerOut','Smtp','service','host','port','secure','pass','SendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','pick','YYYY-MM-DD\x20HH:mm:ss','includeAll','getMyMessages','secret','includeAgent','findAll','addTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Owner','get','mkdirSync','Account','closedAt','browserName','customerPort','N.A.','tail','createReadStream','createWriteStream','direction','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','client','then','info','request\x20sent','debug','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','name','send','merge','contact','interaction','account','fullname','Tags','TagIds','split','forEach','push','index','map','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','select','field','color','from','tools_tags','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','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)','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?','UserId','start','body','some','isEmpty','concat','createdAt'];(function(_0x50be94,_0x10fb47){var _0x32863a=function(_0xfadec8){while(--_0xfadec8){_0x50be94['push'](_0x50be94['shift']());}};_0x32863a(++_0x10fb47);}(_0x7880,0x1f4));var _0x0788=function(_0xb85fd5,_0x3362ae){_0xb85fd5=_0xb85fd5-0x0;var _0x34228e=_0x7880[_0xb85fd5];return _0x34228e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var pdf=require(_0x0788('0x14'));var hardwareService=require(_0x0788('0x15'));var logger=require('../../config/logger')(_0x0788('0x16'));var utils=require(_0x0788('0x17'));var config=require(_0x0788('0x18'));var licenseUtil=require(_0x0788('0x19'));var db=require(_0x0788('0x1a'))['db'];config[_0x0788('0x1b')]=_[_0x0788('0x1c')](config['redis'],{'host':_0x0788('0x1d'),'port':0x18eb});var socket=require(_0x0788('0x1e'))(new Redis(config[_0x0788('0x1b')]));require(_0x0788('0x1f'))['register'](socket);var jayson=require(_0x0788('0x20'));var client=jayson['client'][_0x0788('0x21')]({'port':0x232b});var client9004=jayson[_0x0788('0x22')][_0x0788('0x21')]({'port':0x232c});function respondWithRpcPromise(_0xb406fb,_0x2ddd1a,_0x430e34,_0x5e1a29){return new BPromise(function(_0x573822,_0x17d805){var _0x461d9d=_0x5e1a29||client;return _0x461d9d['request'](_0xb406fb,_0x430e34)[_0x0788('0x23')](function(_0x415f19){logger[_0x0788('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x2ddd1a,_0x0788('0x25'));logger[_0x0788('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2ddd1a,_0x0788('0x25'),JSON['stringify'](_0x415f19));if(_0x415f19[_0x0788('0x27')]){if(_0x415f19['error'][_0x0788('0x28')]===0x1f4){logger[_0x0788('0x27')](_0x0788('0x29'),_0x2ddd1a,_0x415f19[_0x0788('0x27')][_0x0788('0x2a')]);return _0x17d805(_0x415f19['error']['message']);}logger[_0x0788('0x27')](_0x0788('0x29'),_0x2ddd1a,_0x415f19[_0x0788('0x27')][_0x0788('0x2a')]);return _0x573822(_0x415f19['error']['message']);}else{logger[_0x0788('0x24')](_0x0788('0x29'),_0x2ddd1a,_0x0788('0x25'));_0x573822(_0x415f19['result']['message']);}})[_0x0788('0x2b')](function(_0xa1f7dc){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2ddd1a,_0xa1f7dc);_0x17d805(_0xa1f7dc);});});}function respondWithStatusCode(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0xcc;return function(_0x57fda1){if(_0x57fda1){return _0x5a54a5[_0x0788('0x2c')](_0x44798c);}return _0x5a54a5[_0x0788('0x2d')](_0x44798c)[_0x0788('0x2e')]();};}function respondWithResult(_0x18fc0e,_0xf9ba32){_0xf9ba32=_0xf9ba32||0xc8;return function(_0xb2f4a5){if(_0xb2f4a5){return _0x18fc0e[_0x0788('0x2d')](_0xf9ba32)[_0x0788('0x2f')](_0xb2f4a5);}};}function respondWithFilteredResult(_0x5b7594,_0x5a5178){return function(_0x3c5246){if(_0x3c5246){var _0x40d345=typeof _0x5a5178['offset']==='undefined'&&typeof _0x5a5178[_0x0788('0x30')]===_0x0788('0x31');var _0x20fcd8=_0x3c5246[_0x0788('0x32')];var _0x44cbfb=_0x40d345?0x0:_0x5a5178[_0x0788('0x33')];var _0x327d67=_0x40d345?_0x3c5246[_0x0788('0x32')]:_0x5a5178[_0x0788('0x33')]+_0x5a5178[_0x0788('0x30')];var _0x5ec0ed;if(_0x327d67>=_0x20fcd8){_0x327d67=_0x20fcd8;_0x5ec0ed=0xc8;}else{_0x5ec0ed=0xce;}_0x5b7594[_0x0788('0x2d')](_0x5ec0ed);return _0x5b7594[_0x0788('0x34')](_0x0788('0x35'),_0x44cbfb+'-'+_0x327d67+'/'+_0x20fcd8)[_0x0788('0x2f')](_0x3c5246);}return null;};}function patchUpdates(_0xce4534){return function(_0x458193){try{jsonpatch[_0x0788('0x36')](_0x458193,_0xce4534,!![]);}catch(_0x15d67a){return BPromise[_0x0788('0x37')](_0x15d67a);}return _0x458193[_0x0788('0x38')]();};}function saveUpdates(_0x4fa055,_0x4ae132){return function(_0x5947d3){if(_0x5947d3){return _0x5947d3['update'](_0x4fa055)['then'](function(_0x586a06){return _0x586a06;});}return null;};}function removeEntity(_0x208a89,_0x38a4ae){return function(_0x2130e3){if(_0x2130e3){return _0x2130e3['destroy']()[_0x0788('0x23')](function(){_0x208a89[_0x0788('0x2d')](0xcc)[_0x0788('0x2e')]();});}};}function handleEntityNotFound(_0xaea11d,_0x57c4d8){return function(_0x2ed940){if(!_0x2ed940){_0xaea11d['sendStatus'](0x194);}return _0x2ed940;};}function handleError(_0x322465,_0x4fcde3){_0x4fcde3=_0x4fcde3||0x1f4;return function(_0x9d1edb){logger[_0x0788('0x27')](_0x9d1edb['stack']);if(_0x9d1edb[_0x0788('0x39')]){delete _0x9d1edb[_0x0788('0x39')];}_0x322465['status'](_0x4fcde3)[_0x0788('0x3a')](_0x9d1edb);};}function getMustacheRender(_0x5eb693,_0x295024){return Mustache['render'](_0x5eb693,_[_0x0788('0x3b')](_0x295024['body'],{'contact':_0x295024[_0x0788('0x3c')],'message':_0x295024['message'],'agent':_0x295024['agent'],'interaction':_0x295024[_0x0788('0x3d')],'account':_0x295024[_0x0788('0x3e')]}))||'';}function getInteractionUsers(_0x2e48cf,_0x2d17b0){return new BPromise(function(_0x8cfffc,_0x53da74){try{if(_0x2d17b0[_0x2e48cf['id']]){_0x2e48cf['Users']=_['map'](_0x2d17b0[_0x2e48cf['id']],function(_0x4d539a){return{'id':_0x4d539a['id'],'fullname':_0x4d539a[_0x0788('0x3f')]};});}}catch(_0x1202c4){_0x53da74(_0x1202c4);}_0x8cfffc(_0x2e48cf);});}function getInteractionTags(_0x45b247,_0x358a22){return new BPromise(function(_0x362c49,_0x5993ad){try{if(_0x45b247['TagIds']){_0x45b247[_0x0788('0x40')]=[];_0x45b247[_0x0788('0x41')][_0x0788('0x42')](',')[_0x0788('0x43')](function(_0x236b63){_0x45b247[_0x0788('0x40')][_0x0788('0x44')](_0x358a22[_0x236b63]);});}delete _0x45b247[_0x0788('0x41')];}catch(_0x347984){_0x5993ad(_0x347984);}_0x362c49(_0x45b247);});}function updateChatInteraction(_0x50e8f5,_0x5581e6,_0x441aec){return new BPromise(function(_0x1d579d,_0x9e8ee){return getInteractionUsers(_0x50e8f5,_0x441aec)['then'](function(_0x5ab353){return getInteractionTags(_0x5ab353,_0x5581e6);})['then'](function(_0x172424){_0x1d579d(_0x172424);})[_0x0788('0x2b')](function(_0x25501b){_0x9e8ee(_0x25501b);});});}exports[_0x0788('0x45')]=function(_0x2737d8,_0x1928f3){var _0x1ab634={},_0x15b90c={},_0x4bd0d9={'count':0x0,'rows':[]};var _0x15c618=_[_0x0788('0x46')](db[_0x0788('0x47')][_0x0788('0x48')],function(_0x58eb04){return{'name':_0x58eb04[_0x0788('0x49')],'type':_0x58eb04[_0x0788('0x4a')]['key']};});_0x15b90c['model']=_['map'](_0x15c618,_0x0788('0x39'));_0x15b90c['query']=_[_0x0788('0x4b')](_0x2737d8[_0x0788('0x4c')]);_0x15b90c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x15b90c[_0x0788('0x4f')],_0x15b90c[_0x0788('0x4c')]);_0x1ab634[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x15b90c['model'],qs['fields'](_0x2737d8[_0x0788('0x4c')][_0x0788('0x51')]));_0x1ab634[_0x0788('0x50')]=_0x1ab634['attributes'][_0x0788('0x52')]?_0x1ab634[_0x0788('0x50')]:_0x15b90c[_0x0788('0x4f')];if(!_0x2737d8[_0x0788('0x4c')][_0x0788('0x53')]('nolimit')){_0x1ab634['limit']=qs[_0x0788('0x30')](_0x2737d8[_0x0788('0x4c')]['limit']);_0x1ab634[_0x0788('0x33')]=qs['offset'](_0x2737d8[_0x0788('0x4c')][_0x0788('0x33')]);}_0x1ab634[_0x0788('0x54')]=qs[_0x0788('0x55')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x55')]);_0x1ab634[_0x0788('0x56')]=qs[_0x0788('0x4d')](_['pick'](_0x2737d8[_0x0788('0x4c')],_0x15b90c[_0x0788('0x4d')]),_0x15c618);var _0x3f2f1b=[];var _0x5ef557=squel[_0x0788('0x57')]()[_0x0788('0x58')]('id')['field'](_0x0788('0x39'))[_0x0788('0x58')](_0x0788('0x59'))[_0x0788('0x5a')](_0x0788('0x5b'));var _0x347cc8=squel['select']()['field'](_0x0788('0x5c'))[_0x0788('0x58')]('u.fullname')[_0x0788('0x58')](_0x0788('0x5d'))[_0x0788('0x5a')](_0x0788('0x5e'),'ui')[_0x0788('0x5f')](_0x0788('0x60'),'u',_0x0788('0x61'));var _0xeedd30=squel[_0x0788('0x57')]()[_0x0788('0x5a')](_0x0788('0x62'),'i')[_0x0788('0x5f')]('cm_contacts','c',_0x0788('0x63'))[_0x0788('0x5f')](_0x0788('0x60'),'o','o.id\x20=\x20i.UserId')[_0x0788('0x5f')](_0x0788('0x64'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0x0788('0x65'),'me',_0x0788('0x66'))[_0x0788('0x5f')](_0x0788('0x67'),'it',_0x0788('0x68'))[_0x0788('0x5f')]('tools_tags','t',_0x0788('0x69'));var _0x3be076=squel[_0x0788('0x6a')]();var _0x47be71=[];var _0x533f71=squel[_0x0788('0x6a')]();var _0x5419d9;if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x6b')]){_0x5419d9=as[_0x0788('0x6c')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x6b')]);var _0x348d25=_0x5419d9[_0x0788('0x6d')];for(var _0x29c912=0x0;_0x29c912<_0x5419d9[_0x0788('0x6e')][_0x0788('0x52')];_0x29c912++){var _0x59fcbc=_0x5419d9[_0x0788('0x6e')][_0x29c912];var _0x446170='i';var _0x602e3b=_[_0x0788('0x6f')](_0x15c618,['name',_0x59fcbc[_0x0788('0x58')]]);if(!_0x602e3b){switch(_0x59fcbc[_0x0788('0x58')]){case _0x0788('0x70'):if(_0x59fcbc[_0x0788('0x71')]==0x1){_0xeedd30[_0x0788('0x72')]('`'+_0x59fcbc['field']+_0x0788('0x73'));}else{_0xeedd30['having']('`'+_0x59fcbc[_0x0788('0x58')]+_0x0788('0x74'));}break;case _0x0788('0x75'):if(_0x59fcbc[_0x0788('0x76')]===_0x0788('0x77')){if(_0x59fcbc[_0x0788('0x71')][_0x0788('0x42')]('\x20')[_0x0788('0x52')]>0x1){_0x3be076[_0x348d25](_0x0788('0x78'),qs['getFullTextValue'](_0x59fcbc[_0x0788('0x71')]),null);}else{var _0x2dea6c='%'+_0x59fcbc[_0x0788('0x71')]+'%';_0x3be076[_0x348d25]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2dea6c,_0x2dea6c,_0x2dea6c);}}else{_0x602e3b=_['find'](_0x15c618,[_0x0788('0x39'),_0x0788('0x79')]);_0x59fcbc[_0x0788('0x58')]='ContactId';_0x35c612=as[_0x0788('0x7a')](_0x446170,_0x602e3b[_0x0788('0x4a')],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')]['start'],_0x35c612['value']['end']);}break;case _0x0788('0x7c'):var _0x2a55f2=_0x59fcbc[_0x0788('0x71')]['split'](',')['map'](function(_0xaa2d4d){return Number(_0xaa2d4d);});_0x2a55f2['forEach'](function(_0x955bfa){_0x533f71['or'](_0x0788('0x7d'),'%,'+_0x955bfa+',%');});_0x47be71=_[_0x0788('0x7e')](_0x47be71,_0x2a55f2);break;case _0x0788('0x7f'):if(_0x59fcbc[_0x0788('0x76')]===_0x0788('0x77')){_0x3be076[_0x348d25](_0x0788('0x80'),'%'+_0x59fcbc[_0x0788('0x71')]+'%',null);}else{_0x602e3b=_[_0x0788('0x6f')](_0x15c618,[_0x0788('0x39'),'UserId']);_0x59fcbc[_0x0788('0x58')]=_0x0788('0x81');_0x35c612=as['buildExpression'](_0x446170,_0x602e3b['type'],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')][_0x0788('0x82')],_0x35c612[_0x0788('0x71')][_0x0788('0x2e')]);}break;case _0x0788('0x83'):_0x35c612=as['buildExpression']('me',null,_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')][_0x0788('0x82')],_0x35c612[_0x0788('0x71')]['end']);break;}}else{var _0x35c612=as[_0x0788('0x7a')](_0x446170,_0x602e3b[_0x0788('0x4a')],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612['value']['start'],_0x35c612[_0x0788('0x71')][_0x0788('0x2e')]);}}}else{var _0x5513f7=_(_0x2737d8[_0x0788('0x4c')])[_0x0788('0x4b')]()[_0x0788('0x46')](function(_0x2b10fe){return _[_0x0788('0x84')](_0x15c618,[_0x0788('0x39'),_0x2b10fe])?_0x2b10fe:undefined;})['compact']()[_0x0788('0x71')]();if(!_[_0x0788('0x85')](_0x5513f7)){_0x5513f7[_0x0788('0x43')](function(_0x515dd8){if(_0x515dd8==='ChatWebsiteId'){_0xeedd30[_0x0788('0x56')]('i.ChatWebsiteId\x20IN\x20?',[][_0x0788('0x86')](_0x2737d8[_0x0788('0x4c')][_0x515dd8]));}else if(_0x515dd8===_0x0788('0x87')){var _0xa4b3f8=JSON[_0x0788('0x88')](_0x2737d8[_0x0788('0x4c')][_0x515dd8])[_0x0788('0x89')];var _0x216ea9=JSON[_0x0788('0x88')](_0x2737d8['query'][_0x515dd8])[_0x0788('0x8a')];_0xeedd30[_0x0788('0x56')](_0x0788('0x8b'),_0xa4b3f8,_0x216ea9);}else{if(_0x2737d8['query'][_0x515dd8]===_0x0788('0x8c')){_0xeedd30[_0x0788('0x56')]('i.'+_0x515dd8+_0x0788('0x8d'));}else{_0xeedd30['where']('i.'+_0x515dd8+_0x0788('0x8e'),_0x2737d8[_0x0788('0x4c')][_0x515dd8]);}}});}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x8f')]){if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x8f')]==0x1){_0xeedd30[_0x0788('0x72')](_0x0788('0x90'));}else{_0xeedd30[_0x0788('0x72')]('`unreadMessages`\x20>\x200');}}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')]){_0x47be71=_[_0x0788('0x92')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')])?_0x2737d8['query'][_0x0788('0x91')]:new Array(_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')]);_0x47be71['forEach'](function(_0x1788d1){_0x533f71['or'](_0x0788('0x7d'),'%,'+_0x1788d1+',%');});}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x93')]){var _0x2b74df=_0x2737d8['query'][_0x0788('0x93')][_0x0788('0x94')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x0788('0x95')](_0x2b74df)){_0x3be076['or'](_0x0788('0x96'),_0x2b74df+'%');}else{_0x3be076['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0788('0x97')](_0x2b74df))['or'](_0x0788('0x98'),_0x2b74df+'%');}}}_0xeedd30[_0x0788('0x56')](_0x3be076);_0xeedd30['group'](_0x0788('0x99'));var _0x42c537={'type':db[_0x0788('0x9a')]['QueryTypes'][_0x0788('0x9b')],'raw':!![]};var _0x1b3046=_0xeedd30[_0x0788('0x9c')]();_0x1b3046[_0x0788('0x58')](_0x0788('0x99'));_0x1b3046[_0x0788('0x58')](_0x0788('0x9d'),_0x0788('0x70'));if(_0x1ab634['order']){_0x1ab634[_0x0788('0x54')][_0x0788('0x43')](function(_0x121f1d){var _0x31c921=_0x121f1d[0x0]==='contactName'?_0x121f1d[0x0]:'i.'+_0x121f1d[0x0];_0xeedd30['order'](_0x31c921,_0x121f1d[0x1]===_0x0788('0x9e')?![]:!![]);});}if(!_[_0x0788('0x85')](_0x47be71)){_0xeedd30['having'](_0x533f71);_0x1b3046[_0x0788('0x56')](_0x0788('0x9f'),_0x47be71);}BPromise[_0x0788('0xa0')]()['then'](function(){if(!_0x5419d9){if(_0x2737d8['query'][_0x0788('0xa1')])return;_0x1b3046[_0x0788('0x56')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0xeedd30['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2737d8[_0x0788('0xa2')][_0x0788('0xa3')]!=='agent')return;return _0x2737d8[_0x0788('0xa2')][_0x0788('0xa4')]({'attributes':['id'],'raw':!![]})[_0x0788('0x23')](function(_0x41fe7a){if(_[_0x0788('0x85')](_0x41fe7a)){_0x1b3046['where'](_0x0788('0xa5'));_0xeedd30['where'](_0x0788('0xa5'));}else{_0x1b3046['where'](_0x0788('0xa6'),_[_0x0788('0x46')](_0x41fe7a,'id'));_0xeedd30[_0x0788('0x56')](_0x0788('0xa6'),_[_0x0788('0x46')](_0x41fe7a,'id'));}});})[_0x0788('0x23')](function(){if(_0x2737d8[_0x0788('0xa2')][_0x0788('0xa3')]===_0x0788('0xa7')&&!_0x5419d9&&!_0x2737d8[_0x0788('0x4c')][_0x0788('0xa1')])return[];return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x1b3046['toString'](),_0x42c537);})['then'](function(_0x50363e){_0x4bd0d9[_0x0788('0x32')]=_0x50363e[_0x0788('0x52')];if(_0x4bd0d9[_0x0788('0x32')]===0x0)return[];return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x5ef557[_0x0788('0xa9')](),_0x42c537)[_0x0788('0x23')](function(_0x16838d){_0x3f2f1b=_[_0x0788('0xaa')](_0x16838d,'id');_0x42c537=_[_0x0788('0x3b')](_0x42c537,{'model':db[_0x0788('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2737d8['query']['fields']){_0x1ab634[_0x0788('0x50')][_0x0788('0x43')](function(_0x104a70){_0xeedd30[_0x0788('0x58')]('i.'+_0x104a70);});}else{_0xeedd30[_0x0788('0x58')](_0x0788('0x9d'),_0x0788('0x70'));_0xeedd30[_0x0788('0x58')]('a.key','Account.key');_0xeedd30[_0x0788('0x58')](_0x0788('0xab'),_0x0788('0xac'));_0xeedd30[_0x0788('0x58')](_0x0788('0xad'),_0x0788('0xae'));_0xeedd30['field'](_0x0788('0xaf'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb0'),_0x0788('0xb1'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb2'),_0x0788('0xb3'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb4'),'Contact.email');_0xeedd30[_0x0788('0x58')](_0x0788('0xb5'),_0x0788('0xb6'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb7'),_0x0788('0xb8'));_0xeedd30['field'](_0x0788('0xb9'),_0x0788('0xba'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbb'),_0x0788('0xbc'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbd'),_0x0788('0xbe'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbf'),'TagIds');}if(_0x1ab634[_0x0788('0x30')])_0xeedd30['limit'](_0x1ab634[_0x0788('0x30')]);if(_0x1ab634['offset'])_0xeedd30[_0x0788('0x33')](_0x1ab634['offset']);return db[_0x0788('0xa8')][_0x0788('0x4c')](_0xeedd30[_0x0788('0xa9')](),_0x42c537);})[_0x0788('0x23')](function(_0x5242eb){if(_0x5242eb[_0x0788('0x52')]>0x0)_0x347cc8[_0x0788('0x56')](_0x0788('0xc0'),_['map'](_0x5242eb,'id'));return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x347cc8['toString'](),_0x42c537)[_0x0788('0x23')](function(_0x4645aa){var _0x37e9a9=_[_0x0788('0xc1')](_0x4645aa,_0x0788('0xc2'));var _0xab471b=[];_0x5242eb[_0x0788('0x43')](function(_0x563533){_0xab471b[_0x0788('0x44')](updateChatInteraction(_0x563533,_0x3f2f1b,_0x37e9a9));});return BPromise[_0x0788('0xc3')](_0xab471b);});});})[_0x0788('0x23')](function(_0x3f3e06){_0x4bd0d9[_0x0788('0xc4')]=_0x3f3e06;return _0x4bd0d9;})[_0x0788('0x23')](respondWithFilteredResult(_0x1928f3,_0x1ab634))[_0x0788('0x2b')](handleError(_0x1928f3,null));};exports[_0x0788('0xc5')]=function(_0x5761b1,_0x5130c4){var _0x26233b={'raw':![],'where':{'id':_0x5761b1[_0x0788('0xc6')]['id']}},_0x42f6df={};_0x42f6df[_0x0788('0x4f')]=_[_0x0788('0x4b')](db[_0x0788('0x47')][_0x0788('0x48')]);_0x42f6df['query']=_[_0x0788('0x4b')](_0x5761b1['query']);_0x42f6df['filters']=_[_0x0788('0x4e')](_0x42f6df[_0x0788('0x4f')],_0x42f6df['query']);_0x26233b[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x42f6df[_0x0788('0x4f')],qs[_0x0788('0x51')](_0x5761b1[_0x0788('0x4c')][_0x0788('0x51')]));_0x26233b['attributes']=_0x26233b[_0x0788('0x50')][_0x0788('0x52')]?_0x26233b['attributes']:_0x42f6df[_0x0788('0x4f')];if(_0x5761b1[_0x0788('0x4c')]['includeAll']){_0x26233b[_0x0788('0xc7')]=[{'all':!![]}];}_0x26233b=_[_0x0788('0x3b')]({},_0x26233b,_0x5761b1[_0x0788('0xc8')]);return db[_0x0788('0x47')][_0x0788('0x6f')](_0x26233b)[_0x0788('0x23')](handleEntityNotFound(_0x5130c4,null))[_0x0788('0x23')](respondWithResult(_0x5130c4,null))['catch'](handleError(_0x5130c4,null));};exports[_0x0788('0xc9')]=function(_0x2e0529,_0x1f9944){return db[_0x0788('0x47')]['create'](_0x2e0529[_0x0788('0x83')],{})[_0x0788('0x23')](respondWithResult(_0x1f9944,0xc9))['catch'](handleError(_0x1f9944,null));};exports['update']=function(_0x691225,_0x15a70b){if(_0x691225[_0x0788('0x83')]['id']){delete _0x691225[_0x0788('0x83')]['id'];}return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x691225['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x15a70b,null))[_0x0788('0x23')](saveUpdates(_0x691225[_0x0788('0x83')],null))[_0x0788('0x23')](respondWithResult(_0x15a70b,null))[_0x0788('0x2b')](handleError(_0x15a70b,null));};exports[_0x0788('0xca')]=function(_0xc5e64a,_0x3539d4){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0xc5e64a[_0x0788('0xc6')]['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x3539d4,null))[_0x0788('0x23')](removeEntity(_0x3539d4,null))[_0x0788('0x2b')](handleError(_0x3539d4,null));};exports[_0x0788('0xcb')]=function(_0x150a05,_0x1e0fb7){return db['ChatInteraction'][_0x0788('0xcb')]()[_0x0788('0x23')](respondWithResult(_0x1e0fb7,null))[_0x0788('0x2b')](handleError(_0x1e0fb7,null));};exports[_0x0788('0xcc')]=function(_0x57b44e,_0x191e15){var _0x5d0919=_0x57b44e[_0x0788('0xc6')]['id'];var _0x563e4c;var _0x51da2c;var _0x34a12a;return db[_0x0788('0x47')]['findOne']({'where':{'id':_0x5d0919}})[_0x0788('0x23')](function(_0x522e02){_0x563e4c=_0x522e02;return db[_0x0788('0xcd')]['findOne']({'where':{'id':_0x522e02[_0x0788('0xa1')]},'attributes':['id',_0x0788('0xce'),_0x0788('0xcf'),_0x0788('0xd0'),_0x0788('0xd1'),_0x0788('0xd2')],'raw':!![]});})['then'](function(_0x473491){if(_0x473491&&_0x473491['vidaooApiKey']&&_0x473491[_0x0788('0xcf')]){_0x51da2c=_0x473491;var _0x1222f8={'interaction':{'id':_0x5d0919},'agent':{'id':_0x57b44e['user']['id'],'name':_0x57b44e['user']['name'],'fullname':_0x57b44e[_0x0788('0xa2')]['fullname'],'email':_0x57b44e['user']['email']},'contact':_0x57b44e['body']['contact'],'account':_0x57b44e['body'][_0x0788('0x3e')]};var _0x3c2aa3={'rejectUnauthorized':![],'method':'POST','url':_0x0788('0xd3'),'headers':{'X-APIKEY':_0x473491['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x57b44e[_0x0788('0xa2')]['email']],'buttons':null,'topic':_0x51da2c[_0x0788('0xd0')],'note':_[_0x0788('0xd4')](_0x51da2c[_0x0788('0xd1')])?null:getMustacheRender(_0x51da2c[_0x0788('0xd1')],_0x1222f8),'metadata':null},'redirect':_0x0788('0xd5'),'json':!![]};try{if(!_[_0x0788('0xd4')](_0x51da2c[_0x0788('0xd2')])){var _0x37439f=getMustacheRender(_0x51da2c[_0x0788('0xd2')],_0x1222f8);var _0xf87649=JSON['parse'](_0x37439f);_0x3c2aa3[_0x0788('0x83')]['metadata']=_0xf87649;}}catch(_0x3bd7f3){throw new db['Sequelize']['ValidationError'](_0x0788('0xd6'));}return rp(_0x3c2aa3);}else{throw new db[(_0x0788('0x9a'))][(_0x0788('0xd7'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x0788('0x23')](function(_0x1b52f6){_0x34a12a=_0x1b52f6;if(_0x34a12a['id']){var _0x5be647={'body':_0x34a12a['join_url'],'ChatWebsiteId':_0x51da2c['id'],'ChatInteractionId':_0x563e4c['id'],'direction':_0x0788('0xd8'),'UserId':_0x57b44e[_0x0788('0xa2')]['id']};return db[_0x0788('0xd9')]['create'](_0x5be647,{});}else{throw new db['Sequelize'][(_0x0788('0xd7'))](_0x0788('0xda'));}})[_0x0788('0x23')](function(){return _0x563e4c[_0x0788('0xdb')]({'vidaooSessionId':_0x34a12a['id']});})[_0x0788('0x23')](respondWithResult(_0x191e15,null))[_0x0788('0x2b')](handleError(_0x191e15,null));};exports[_0x0788('0xdc')]=function(_0x252780,_0x3d3272){if(_0x252780['body']['id']){delete _0x252780[_0x0788('0x83')]['id'];}return db['ChatInteraction'][_0x0788('0x6f')]({'where':{'id':_0x252780[_0x0788('0xc6')]['id']},'include':[{'model':db[_0x0788('0xdd')],'as':_0x0788('0x75')}]})[_0x0788('0x23')](handleEntityNotFound(_0x3d3272,null))['then'](saveUpdates(_0x252780[_0x0788('0x83')],null))[_0x0788('0x23')](respondWithResult(_0x3d3272,null))['catch'](handleError(_0x3d3272,null));};exports[_0x0788('0xde')]=function(_0x881d27,_0x47ce3c,_0x1c9b6f){if(_0x881d27['body']['id']){delete _0x881d27[_0x0788('0x83')]['id'];}return db[_0x0788('0x47')]['find']({'where':{'id':_0x881d27[_0x0788('0xc6')]['id']}})[_0x0788('0x23')](function(_0x207b55){if(!_0x207b55){logger[_0x0788('0x27')](_0x0788('0xdf'),_0x0788('0xde'),0x194,_0x0788('0xe0'));_0x47ce3c[_0x0788('0x2c')](0x194);}else{if(_0x207b55['UserId']){throw new db[(_0x0788('0x9a'))][(_0x0788('0xd7'))](_0x0788('0xe1'));}}return _0x207b55;})['then'](function(_0x5ac0bc){if(_0x5ac0bc){return _0x5ac0bc[_0x0788('0xe2')]({'closed':_0x881d27[_0x0788('0x83')][_0x0788('0xe3')],'disposition':_0x881d27[_0x0788('0x83')][_0x0788('0xe4')]})[_0x0788('0x23')](function(_0x48e56d){return _0x48e56d;});}})[_0x0788('0x23')](function(_0x227eaf){return respondWithRpcPromise(_0x0788('0xe5'),_0x0788('0xde'),_0x881d27[_0x0788('0x83')],client9004);})[_0x0788('0x23')](respondWithResult(_0x47ce3c,null))[_0x0788('0x2b')](handleError(_0x47ce3c,null));};exports[_0x0788('0xe6')]=function(_0x1fc335,_0x27c428,_0x1ce4f2){_0x1fc335[_0x0788('0x83')][_0x0788('0x39')]=_0x1fc335[_0x0788('0xe7')][_0x0788('0xe8')];_0x1fc335[_0x0788('0x83')][_0x0788('0xe9')]=_0x1fc335[_0x0788('0xe7')][_0x0788('0xea')];_0x1fc335[_0x0788('0x83')][_0x0788('0x4a')]=_0x1fc335['file'][_0x0788('0xeb')];return db[_0x0788('0xec')][_0x0788('0xc9')](_0x1fc335[_0x0788('0x83')])['then'](respondWithResult(_0x27c428,0xc9))[_0x0788('0x2b')](handleError(_0x27c428,null));};exports[_0x0788('0xed')]=function(_0x5eb3f1,_0xb63553,_0x4a34e2){return db['ChatInteraction']['findOne']({'where':{'id':_0x5eb3f1['params']['id']},'raw':!![]})[_0x0788('0x23')](handleEntityNotFound(_0xb63553,null))[_0x0788('0x23')](function(_0x4cc536){if(_0x4cc536){if(_0x4cc536[_0x0788('0xe3')]){return _0xb63553[_0x0788('0x2d')](0x193)[_0x0788('0x2f')]({'status':0x193,'message':_0x0788('0xee')});}return db[_0x0788('0xec')][_0x0788('0xef')]({'where':{'id':_0x5eb3f1[_0x0788('0x4c')][_0x0788('0xf0')]},'raw':!![]})[_0x0788('0x23')](handleEntityNotFound(_0xb63553,null));}})['then'](function(_0x2047bc){if(_0x2047bc){var _0x38fd71=_0x2047bc['ChatOfflineMessageId']!==null;var _0x224ef9=path[_0x0788('0xf1')](config[_0x0788('0xf2')],_0x0788('0xf3'));if(_0x38fd71){_0x224ef9=path[_0x0788('0xf1')](_0x224ef9,_0x0788('0xf4'));}var _0x2399b9=path[_0x0788('0xf1')](_0x224ef9,_0x2047bc[_0x0788('0xe9')]);return _0xb63553[_0x0788('0xf5')](_0x2399b9);}})[_0x0788('0x2b')](handleError(_0xb63553,null));};exports[_0x0788('0xf6')]=function(_0x31c746,_0x4f696c){var _0x11de9c=null;var _0xf690e0=null;var _0x4a492c=null;var _0x523faa=null;if(_0x31c746[_0x0788('0x83')]['id']){delete _0x31c746[_0x0788('0x83')]['id'];}if(_0x31c746['body'][_0x0788('0xf7')]){_0x523faa=path[_0x0788('0xf1')](config[_0x0788('0xf2')],'server/files/chat/upload/',util['format'](_0x0788('0xf8'),Date[_0x0788('0xf9')]()));_0x31c746['body']['pathTranscript']=_0x523faa;}return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x31c746['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x0788('0xfa'),'include':[{'model':db[_0x0788('0x7f')],'as':'User'}]}]})[_0x0788('0x23')](handleEntityNotFound(_0x4f696c,null))[_0x0788('0x23')](saveUpdates(_0x31c746['body'],null))[_0x0788('0x23')](function(_0x21be45){if(_0x21be45){_0x11de9c=_0x21be45;return db[_0x0788('0xcd')][_0x0788('0x6f')]({'where':{'id':_0x11de9c[_0x0788('0xa1')]}});}})['then'](function(_0x36acad){if(_0x36acad){_0x4a492c=_0x36acad;return db[_0x0788('0xdd')][_0x0788('0x6f')]({'where':{'id':_0x11de9c[_0x0788('0x79')]}});}})[_0x0788('0x23')](function(_0x569b4d){if(_0x569b4d){_0xf690e0=_0x569b4d;if(_0x523faa){var _0x31ffc7=null;for(var _0x59aece=0x1;_0x59aece<_0x11de9c['Messages'][_0x0788('0x52')];++_0x59aece){_0x31ffc7=_0x11de9c[_0x0788('0xfa')][_0x59aece];var _0x3787d3=_0x31ffc7[_0x0788('0x81')]?util['format'](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7[_0x0788('0x81')]):'System';var _0x3ea229=_0x31c746[_0x0788('0x83')][_0x0788('0xfd')]||util[_0x0788('0xfe')](_0x0788('0xfb'),'Visitor',_0x31ffc7[_0x0788('0x79')]);switch(_0x4a492c['agentIdentifier']){case _0x0788('0xff'):_0x3787d3=_0x31ffc7[_0x0788('0x81')]?util[_0x0788('0xfe')](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7['UserId']):_0x0788('0x100');break;case'agent_alias':_0x3787d3=_0x31ffc7[_0x0788('0x81')]?_0x31ffc7['User'][_0x0788('0x101')]||_0x31ffc7[_0x0788('0x7f')]['fullname']:_0x0788('0x100');break;case _0x0788('0x102'):_0x3787d3=_0x31ffc7[_0x0788('0x81')]?_0x31ffc7[_0x0788('0x7f')][_0x0788('0x3f')]:_0x0788('0x100');break;default:_0x3787d3=_0x31ffc7[_0x0788('0x81')]?util[_0x0788('0xfe')](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7[_0x0788('0x81')]):'System';}var _0x303d5=util['format'](_0x0788('0x103'),moment(_0x31ffc7['createdAt'])[_0x0788('0xfe')](_0x0788('0x104')),_0x31ffc7['direction']==='in'?_0x3ea229:_0x3787d3,_0x31ffc7['body']);if(!_0x31ffc7['secret']){fs[_0x0788('0x105')](_0x523faa,_0x303d5);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x0788('0x106')],'as':_0x0788('0x107'),'raw':!![]}]});}}})[_0x0788('0x23')](function(_0x5c5464){if(_0x5c5464&&_0x5c5464[_0x0788('0x107')]&&_0x31c746[_0x0788('0x83')]){var _0x14420b={'tls':{'rejectUnauthorized':![]}};if(_0x5c5464['Smtp']['service']){_0x14420b[_0x0788('0x108')]=_0x5c5464[_0x0788('0x107')][_0x0788('0x108')];}else{_0x14420b['host']=_0x5c5464[_0x0788('0x107')][_0x0788('0x109')];_0x14420b[_0x0788('0x10a')]=_0x5c5464['Smtp']['port'];_0x14420b[_0x0788('0x10b')]=_0x5c5464['Smtp'][_0x0788('0x10b')];}if(_0x5c5464[_0x0788('0x107')]['authentication']){_0x14420b['auth']={'user':_0x5c5464[_0x0788('0x107')][_0x0788('0xa2')],'pass':_0x5c5464['Smtp'][_0x0788('0x10c')]};}return respondWithRpcPromise(_0x0788('0x10d'),'sendMail',{'account':_0x14420b,'message':{'from':util[_0x0788('0xfe')](_0x0788('0x10e'),_0x5c5464[_0x0788('0x39')],_0x5c5464[_0x0788('0x10f')]||_0x5c5464['Smtp'][_0x0788('0xa2')]),'to':_0x31c746[_0x0788('0x83')][_0x0788('0xf7')],'subject':_0x0788('0x110'),'text':util[_0x0788('0xfe')](_0x0788('0x111'),_0x31c746[_0x0788('0x83')][_0x0788('0xf7')]),'attachments':[{'path':_0x523faa}]}})[_0x0788('0x23')](function(){return _0x11de9c;})['catch'](function(_0x1b5b80){console[_0x0788('0x27')](_0x1b5b80);});}else{return _0x11de9c;}})['then'](respondWithStatusCode(_0x4f696c,0xc8))[_0x0788('0x2b')](handleError(_0x4f696c,null));};exports[_0x0788('0x112')]=function(_0x5522e3,_0x5f1a46,_0x248f60){return db[_0x0788('0xd9')][_0x0788('0x6f')]({'where':{'id':_0x5522e3['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x5f1a46,null))[_0x0788('0x23')](function(_0x36d7f9){if(_0x36d7f9){return _0x36d7f9['addMessage'](_0x5522e3[_0x0788('0x83')][_0x0788('0x113')],_['omit'](_0x5522e3['body'],['ids','id'])||{});}})[_0x0788('0x23')](respondWithResult(_0x5f1a46,null))[_0x0788('0x2b')](handleError(_0x5f1a46,null));};exports[_0x0788('0x114')]=function(_0x20f429,_0x364f26,_0x351665){var _0x1ba9fb={'raw':![],'where':{}};var _0x56b11c={};var _0x4f36bd={'count':0x0,'rows':[]};return db[_0x0788('0x47')][_0x0788('0xef')]({'where':{'id':_0x20f429[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x364f26,null))[_0x0788('0x23')](function(_0x1c7980){if(_0x1c7980){_0x56b11c[_0x0788('0x4f')]=_[_0x0788('0x4b')](db['ChatMessage']['rawAttributes']);_0x56b11c[_0x0788('0x4c')]=_[_0x0788('0x4b')](_0x20f429[_0x0788('0x4c')]);_0x56b11c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x56b11c[_0x0788('0x4f')],_0x56b11c[_0x0788('0x4c')]);_0x1ba9fb[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x56b11c['model'],qs[_0x0788('0x51')](_0x20f429[_0x0788('0x4c')][_0x0788('0x51')]));_0x1ba9fb[_0x0788('0x50')]=_0x1ba9fb[_0x0788('0x50')][_0x0788('0x52')]?_0x1ba9fb[_0x0788('0x50')]:_0x56b11c['model'];if(!_0x20f429[_0x0788('0x4c')][_0x0788('0x53')](_0x0788('0x115'))){_0x1ba9fb['limit']=qs[_0x0788('0x30')](_0x20f429[_0x0788('0x4c')][_0x0788('0x30')]);_0x1ba9fb[_0x0788('0x33')]=qs[_0x0788('0x33')](_0x20f429['query']['offset']);}_0x1ba9fb['order']=qs[_0x0788('0x55')](_0x20f429[_0x0788('0x4c')][_0x0788('0x55')]);_0x1ba9fb[_0x0788('0x56')]=qs[_0x0788('0x4d')](_[_0x0788('0x116')](_0x20f429[_0x0788('0x4c')],_0x56b11c['filters']));_0x1ba9fb[_0x0788('0x56')][_0x0788('0xc2')]=_0x1c7980['id'];if(_0x20f429[_0x0788('0x4c')][_0x0788('0x93')]){_0x1ba9fb['where']=_[_0x0788('0x3b')](_0x1ba9fb[_0x0788('0x56')],{'$or':_[_0x0788('0x46')](_0x1ba9fb[_0x0788('0x50')],function(_0xccb2e6){var _0x4cc769={};_0x4cc769[_0xccb2e6]={'$like':'%'+_0x20f429[_0x0788('0x4c')][_0x0788('0x93')]+'%'};return _0x4cc769;})});}if(_0x20f429[_0x0788('0x4c')][_0x0788('0x89')]){var _0x4785ac=_0x20f429[_0x0788('0x4c')][_0x0788('0x89')][_0x0788('0x42')](',');var _0x4455dc={};_0x4455dc[_0x4785ac[0x0]]={'$gte':moment(_0x4785ac[0x1])['format'](_0x0788('0x117'))};_0x1ba9fb['where']=_[_0x0788('0x3b')](_0x1ba9fb[_0x0788('0x56')],_0x4455dc);}_0x1ba9fb=_[_0x0788('0x3b')]({},_0x1ba9fb,_0x20f429[_0x0788('0xc8')]);return db[_0x0788('0xd9')][_0x0788('0x32')]({'where':_0x1ba9fb[_0x0788('0x56')]})['then'](function(_0x3eb474){_0x4f36bd[_0x0788('0x32')]=_0x3eb474;if(_0x20f429['query'][_0x0788('0x118')]){_0x1ba9fb[_0x0788('0xc7')]=[{'all':!![]}];}return db[_0x0788('0xd9')]['findAll'](_0x1ba9fb);})['then'](function(_0x1aa86f){_0x4f36bd[_0x0788('0xc4')]=_0x1aa86f;return _0x4f36bd;});}})['then'](respondWithFilteredResult(_0x364f26,_0x1ba9fb))['catch'](handleError(_0x364f26,null));};exports[_0x0788('0x119')]=function(_0x4d6a60,_0x114658,_0x4b11b9){var _0x9af662={'where':{}},_0x257e1c={},_0x35a6bc={'count':0x0,'rows':[]};return db[_0x0788('0x47')]['findOne']({'where':{'id':_0x4d6a60['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x114658,null))[_0x0788('0x23')](function(_0x278a6f){if(_0x278a6f){_0x257e1c[_0x0788('0x4f')]=_['keys'](db[_0x0788('0xd9')][_0x0788('0x48')]);_0x257e1c[_0x0788('0x4c')]=_[_0x0788('0x4b')](_0x4d6a60['query']);_0x257e1c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x257e1c['model'],_0x257e1c[_0x0788('0x4c')]);_0x9af662[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x257e1c[_0x0788('0x4f')],qs[_0x0788('0x51')](_0x4d6a60[_0x0788('0x4c')]['fields']));_0x9af662[_0x0788('0x50')]=_0x9af662[_0x0788('0x50')][_0x0788('0x52')]?_0x9af662[_0x0788('0x50')]:_0x257e1c['model'];if(!_0x4d6a60[_0x0788('0x4c')]['hasOwnProperty'](_0x0788('0x115'))){_0x9af662['limit']=qs['limit'](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x30')]);_0x9af662[_0x0788('0x33')]=qs[_0x0788('0x33')](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x33')]);}_0x9af662[_0x0788('0x54')]=qs[_0x0788('0x55')](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x55')]);_0x9af662['where']=qs['filters'](_['pick'](_0x4d6a60[_0x0788('0x4c')],_0x257e1c[_0x0788('0x4d')]));_0x9af662[_0x0788('0x56')][_0x0788('0xc2')]=_0x278a6f['id'];if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x93')]){_0x9af662[_0x0788('0x56')]=_[_0x0788('0x3b')](_0x9af662['where'],{'$or':_[_0x0788('0x46')](_0x9af662[_0x0788('0x50')],function(_0x4a4297){var _0x1fb846={};_0x1fb846[_0x4a4297]={'$like':'%'+_0x4d6a60[_0x0788('0x4c')][_0x0788('0x93')]+'%'};return _0x1fb846;})});}_0x9af662['where'][_0x0788('0x11a')]=![];if(_0x4d6a60[_0x0788('0x4c')]['id']){_0x9af662[_0x0788('0x56')]['id']={'$gt':_0x4d6a60[_0x0788('0x4c')]['id']};}_0x9af662=_[_0x0788('0x3b')]({},_0x9af662,_0x4d6a60[_0x0788('0xc8')]);return db[_0x0788('0xd9')][_0x0788('0x32')]({'where':_0x9af662[_0x0788('0x56')]})[_0x0788('0x23')](function(_0x292d07){_0x35a6bc[_0x0788('0x32')]=_0x292d07;_0x9af662[_0x0788('0xc7')]=[];if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x11b')]){_0x9af662['include'][_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x7f'),'attributes':['id','fullname',_0x0788('0x101')]});}if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x118')]){_0x9af662['include']=[{'all':!![]}];}return db[_0x0788('0xd9')][_0x0788('0x11c')](_0x9af662);})['then'](function(_0xa44dc3){_0x35a6bc[_0x0788('0xc4')]=_0xa44dc3;return _0x35a6bc;});}})[_0x0788('0x23')](respondWithFilteredResult(_0x114658,_0x9af662))['catch'](handleError(_0x114658,null));};exports[_0x0788('0x11d')]=function(_0x5b0417,_0x4d5e94,_0x1fb141){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x5b0417[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x4d5e94,null))[_0x0788('0x23')](function(_0x5bf415){if(_0x5bf415){return _0x5bf415['setTags'](_0x5b0417['body'][_0x0788('0x113')],_['omit'](_0x5b0417['body'],['ids','id'])||{})[_0x0788('0x11e')](function(){return db[_0x0788('0x7c')][_0x0788('0x11c')]({'attributes':['id',_0x0788('0x39'),_0x0788('0x59')],'where':{'id':_0x5b0417[_0x0788('0x83')][_0x0788('0x113')]}});})[_0x0788('0x23')](function(_0x109d90){socket[_0x0788('0x11f')](_0x0788('0x120'),{'id':Number(_0x5b0417[_0x0788('0xc6')]['id']),'tags':_0x109d90||[]});return{'id':Number(_0x5b0417[_0x0788('0xc6')]['id']),'tags':_0x109d90||[]};});}})['then'](respondWithResult(_0x4d5e94,null))[_0x0788('0x2b')](handleError(_0x4d5e94,null));};exports['removeTags']=function(_0x26343c,_0x30334c,_0x1d18bc){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x26343c[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x30334c,null))[_0x0788('0x23')](function(_0x10266b){if(_0x10266b){return _0x10266b[_0x0788('0x121')](_0x26343c[_0x0788('0x4c')][_0x0788('0x113')]);}})[_0x0788('0x23')](respondWithStatusCode(_0x30334c,null))['catch'](handleError(_0x30334c,null));};exports['download']=function(_0x1fb76f,_0x17ca71){var _0xbae24f=moment()[_0x0788('0x122')]()[_0x0788('0xa9')]();var _0x525754=path['join'](config['root'],_0x0788('0x123'),_0x0788('0x124'),_0x0788('0x125'));var _0x2d51ef=path[_0x0788('0xf1')](config[_0x0788('0xf2')],_0x0788('0x123'),_0x0788('0x124'),_0x0788('0x126'));var _0x5ecd59=path['join'](_0x525754,_0xbae24f);var _0xf63471=util[_0x0788('0xfe')](_0x0788('0x127'),_0x1fb76f[_0x0788('0xc6')]['id'],_0xbae24f);var _0x390cdf=path[_0x0788('0xf1')](_0x525754,_0xf63471);var _0x40a75d=[];_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x7f'),'attributes':['id',_0x0788('0x3f')],'raw':!![]});_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0xdd')],'as':'Contact','attributes':['id',_0x0788('0x128'),_0x0788('0x129')],'raw':!![]});if(_0x1fb76f[_0x0788('0x4c')][_0x0788('0x126')]){_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0xec')],'as':_0x0788('0xec'),'raw':!![]});}var _0x4cf323=[{'model':db[_0x0788('0xd9')],'as':_0x0788('0xfa'),'attributes':['id','body',_0x0788('0x87'),'direction',_0x0788('0x11a'),_0x0788('0x8f')],'include':_0x40a75d}];_0x4cf323['push']({'model':db[_0x0788('0xcd')],'as':'Account','attributes':['id',_0x0788('0x39')]});_0x4cf323[_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x12a'),'attributes':['id',_0x0788('0x3f')]});return db['ChatInteraction'][_0x0788('0x6f')]({'where':{'id':_0x1fb76f['params']['id']},'include':_0x4cf323})['then'](handleEntityNotFound(_0x17ca71,null))[_0x0788('0x23')](function(_0x1fa39f){if(_0x1fa39f){var _0x19b030=_0x1fa39f[_0x0788('0x12b')]({'plain':!![]});fs[_0x0788('0x12c')](_0x5ecd59);var _0x35fc5b={'channel':'Chat','account':_0x19b030[_0x0788('0x12d')]['name'],'agent':_0x19b030[_0x0788('0x12a')]?_0x19b030[_0x0788('0x12a')][_0x0788('0x3f')]:'N.A.','createdAt':moment(_0x19b030['createdAt'])[_0x0788('0xfe')](_0x0788('0x117'))['toString'](),'closedAt':_0x19b030[_0x0788('0xe3')]?moment(_0x19b030[_0x0788('0x12e')])[_0x0788('0xfe')](_0x0788('0x117'))[_0x0788('0xa9')]():'','disposition':_0x19b030[_0x0788('0xe4')],'chatInfo':{'browser':_0x19b030[_0x0788('0x12f')],'os':_0x19b030['osName'],'referer':_0x19b030['referer'],'customerIp':_0x19b030['customerIp'],'customerPort':_0x19b030[_0x0788('0x130')]?_0x19b030['customerPort']:_0x0788('0x131')},'messages':_(_0x19b030[_0x0788('0xfa')])[_0x0788('0x132')]()[_0x0788('0x93')]({'secret':![]})[_0x0788('0x46')](function(_0x3ff416){if(_0x3ff416[_0x0788('0xec')]){var _0x7d6cf9=path[_0x0788('0xf1')](_0x2d51ef,_0x3ff416[_0x0788('0xec')][_0x0788('0xe9')]);if(fs['existsSync'](_0x7d6cf9)){fs[_0x0788('0x133')](_0x7d6cf9)['pipe'](fs[_0x0788('0x134')](path[_0x0788('0xf1')](_0x5ecd59,_0x3ff416[_0x0788('0xec')][_0x0788('0xe9')])));}}return{'date':moment(_0x3ff416[_0x0788('0x87')])[_0x0788('0xfe')](_0x0788('0x117'))[_0x0788('0xa9')](),'sender':_0x3ff416[_0x0788('0x135')]===_0x0788('0xd8')?_0x3ff416['User']?_0x3ff416[_0x0788('0x7f')][_0x0788('0x3f')]:_0x0788('0x100'):_0x3ff416[_0x0788('0x75')]['firstName']+(_0x3ff416[_0x0788('0x75')][_0x0788('0x129')]?'\x20'+_0x3ff416['Contact'][_0x0788('0x129')]:''),'body':_0x3ff416['Attachment']?_0x3ff416[_0x0788('0xec')]['basename']:_0x3ff416[_0x0788('0x83')],'direction':_0x3ff416[_0x0788('0x135')]===_0x0788('0xd8')?'A':'C','secret':_0x3ff416['secret'],'read':_0x3ff416[_0x0788('0x8f')],'attachment':_0x3ff416['Attachment']};})[_0x0788('0x71')]()};return ejs[_0x0788('0x136')](path[_0x0788('0xf1')](config[_0x0788('0xf2')],'server','views',_0x0788('0x137')),{'interaction':_0x35fc5b})['then'](function(_0x45962d){var _0x4cc133=path[_0x0788('0xf1')](_0x5ecd59,_0x0788('0x138')+_0x19b030['id']+'-'+_0xbae24f+_0x0788('0x139'));var _0x52452f={'path':_0x4cc133,'channel':_0x0788('0x13a'),'interactionId':_0x19b030['id']};return pdf[_0x0788('0x13b')](_0x45962d,_0x52452f);})[_0x0788('0x23')](function(){return new BPromise(function(_0xe2d72d,_0x5401a8){zipdir(_0x5ecd59,{'saveTo':_0x390cdf},function(_0x5b289e,_0x4191b4){if(_0x5b289e)return _0x5401a8(_0x5b289e);return _0xe2d72d(_0x4191b4);});})[_0x0788('0x23')](function(){return new BPromise(function(_0x5440c6,_0x2dbb74){rimraf(_0x5ecd59,function(_0x8a89c0){if(_0x8a89c0)_0x2dbb74(_0x8a89c0);return _0x5440c6();});});})['then'](function(){return _0x17ca71['download'](_0x390cdf,_0xf63471,function(_0x2487db){if(_0x2487db){console['log'](_0x0788('0x13c'),_0x2487db);}else{fs[_0x0788('0x13d')](_0x390cdf);}});});});}else{return _0x17ca71[_0x0788('0x2c')](0xc8);}})['catch'](handleError(_0x17ca71,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index cb7565d..96be4e6 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 _0x1ca3=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','ChatInteraction','ChatMessage','save','update','remove','setDataValue'];(function(_0x432bd0,_0xeba007){var _0x15a2f6=function(_0x157026){while(--_0x157026){_0x432bd0['push'](_0x432bd0['shift']());}};_0x15a2f6(++_0xeba007);}(_0x1ca3,0x180));var _0x31ca=function(_0x40c9e1,_0x12fda9){_0x40c9e1=_0x40c9e1-0x0;var _0xc5661b=_0x1ca3[_0x40c9e1];return _0xc5661b;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x31ca('0x0')];var ChatMessage=require('../../mysqldb')['db'][_0x31ca('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x31ca('0x2'),'afterUpdate':_0x31ca('0x3'),'afterDestroy':_0x31ca('0x4')};function emitEvent(_0x272037){return function(_0x1c19f7,_0x20e0e8,_0x24fda2){_0x1c19f7['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0xfc2831){_0x1c19f7[_0x31ca('0x5')](_0x31ca('0x6'),_0xfc2831[_0x31ca('0x7')](function(_0x4140c2){return{'id':_0x4140c2['id']};}));return ChatMessage[_0x31ca('0x8')]({'where':{'ChatInteractionId':_0x1c19f7['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1501f0){_0x1c19f7[_0x31ca('0x5')](_0x31ca('0x9'),_0x1501f0[_0x31ca('0xa')]);ChatInteractionEvents[_0x31ca('0xb')](_0x272037+':'+_0x1c19f7['id'],_0x1c19f7);ChatInteractionEvents[_0x31ca('0xb')](_0x272037,_0x1c19f7);_0x24fda2(null);})[_0x31ca('0xc')](_0x24fda2(null));};}for(var e in events){if(events[_0x31ca('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x31ca('0xe')]=ChatInteractionEvents; \ No newline at end of file +var _0x6f9e=['setMaxListeners','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x6f9e,0xfd));var _0xe6f9=function(_0x2d325b,_0x2202fd){_0x2d325b=_0x2d325b-0x0;var _0xf600f0=_0x6f9e[_0x2d325b];return _0xf600f0;};'use strict';var EventEmitter=require(_0xe6f9('0x0'));var ChatInteraction=require(_0xe6f9('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xe6f9('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xe6f9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe6f9('0x3'),'afterDestroy':_0xe6f9('0x4')};function emitEvent(_0x5ce818){return function(_0x37af94,_0x51709c,_0x573408){_0x37af94['getUsers']({'attributes':['id'],'raw':!![]})[_0xe6f9('0x5')](function(_0x37dec5){_0x37af94[_0xe6f9('0x6')](_0xe6f9('0x7'),_0x37dec5[_0xe6f9('0x8')](function(_0x1e8896){return{'id':_0x1e8896['id']};}));return ChatMessage[_0xe6f9('0x9')]({'where':{'ChatInteractionId':_0x37af94['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe6f9('0x5')](function(_0x46cd49){_0x37af94[_0xe6f9('0x6')](_0xe6f9('0xa'),_0x46cd49[_0xe6f9('0xb')]);ChatInteractionEvents[_0xe6f9('0xc')](_0x5ce818+':'+_0x37af94['id'],_0x37af94);ChatInteractionEvents[_0xe6f9('0xc')](_0x5ce818,_0x37af94);_0x573408(null);})[_0xe6f9('0xd')](_0x573408(null));};}for(var e in events){if(events[_0xe6f9('0xe')](e)){var event=events[e];ChatInteraction[_0xe6f9('0xf')](e,emitEvent(event));}}module[_0xe6f9('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index f6cc86d..f0e8206 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 _0xf879=['lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x337090,_0x56effb){var _0x19b216=function(_0x4aab69){while(--_0x4aab69){_0x337090['push'](_0x337090['shift']());}};_0x19b216(++_0x56effb);}(_0xf879,0xa0));var _0x9f87=function(_0x3e11ec,_0x582479){_0x3e11ec=_0x3e11ec-0x0;var _0x49dbf7=_0xf879[_0x3e11ec];return _0x49dbf7;};'use strict';var _=require(_0x9f87('0x0'));var util=require('util');var logger=require(_0x9f87('0x1'))('api');var moment=require(_0x9f87('0x2'));var BPromise=require(_0x9f87('0x3'));var rp=require(_0x9f87('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f87('0x5'));var config=require(_0x9f87('0x6'));var attributes=require(_0x9f87('0x7'));module[_0x9f87('0x8')]=function(_0x1765c1,_0x508c40){return _0x1765c1['define'](_0x9f87('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51cc56,_0x3a0864,_0xf9f9a8){if(_0x51cc56['changed'](_0x9f87('0xa'))){_0x51cc56[_0x9f87('0xb')]=moment()[_0x9f87('0xc')](_0x9f87('0xd'));}_0xf9f9a8(null,_0x51cc56);}},'charset':_0x9f87('0xe'),'collate':_0x9f87('0xf')});}; \ No newline at end of file +var _0xbb0c=['./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','rimraf'];(function(_0x2bc0e2,_0x32c1e3){var _0x483198=function(_0x59fbac){while(--_0x59fbac){_0x2bc0e2['push'](_0x2bc0e2['shift']());}};_0x483198(++_0x32c1e3);}(_0xbb0c,0x8c));var _0xcbb0=function(_0x26d77c,_0xdd25a3){_0x26d77c=_0x26d77c-0x0;var _0x9d8f5c=_0xbb0c[_0x26d77c];return _0x9d8f5c;};'use strict';var _=require(_0xcbb0('0x0'));var util=require(_0xcbb0('0x1'));var logger=require('../../config/logger')(_0xcbb0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcbb0('0x3'));var config=require('../../config/environment');var attributes=require(_0xcbb0('0x4'));module[_0xcbb0('0x5')]=function(_0x42fbce,_0x555c86){return _0x42fbce[_0xcbb0('0x6')](_0xcbb0('0x7'),attributes,{'tableName':_0xcbb0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3eb84d,_0x54c685,_0x259858){if(_0x3eb84d[_0xcbb0('0x9')](_0xcbb0('0xa'))){_0x3eb84d[_0xcbb0('0xb')]=moment()[_0xcbb0('0xc')](_0xcbb0('0xd'));}_0x259858(null,_0x3eb84d);}},'charset':_0xcbb0('0xe'),'collate':_0xcbb0('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 89ee4b9..ed8423f 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 _0xfbd1=['http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','UpdateChatInteraction','update','options','raw','where','attributes','stringify','ChatInteraction','find','addTags','body','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x34e9de,_0x395f50){var _0x510c12=function(_0x338d02){while(--_0x338d02){_0x34e9de['push'](_0x34e9de['shift']());}};_0x510c12(++_0x395f50);}(_0xfbd1,0x72));var _0x1fbd=function(_0x448422,_0x362248){_0x448422=_0x448422-0x0;var _0xcc0afd=_0xfbd1[_0x448422];return _0xcc0afd;};'use strict';var _=require(_0x1fbd('0x0'));var util=require('util');var moment=require(_0x1fbd('0x1'));var BPromise=require(_0x1fbd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fbd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fbd('0x4'));var logger=require(_0x1fbd('0x5'))(_0x1fbd('0x6'));var config=require(_0x1fbd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1fbd('0x8')][_0x1fbd('0x9')]({'port':0x232a});config[_0x1fbd('0xa')]=_[_0x1fbd('0xb')](config['redis'],{'host':_0x1fbd('0xc'),'port':0x18eb});var socket=require(_0x1fbd('0xd'))(new Redis(config[_0x1fbd('0xa')]));require(_0x1fbd('0xe'))[_0x1fbd('0xf')](socket);function respondWithRpcPromise(_0x1cf62d,_0xc7f7ba,_0x313f54){return new BPromise(function(_0x1363d8,_0x5d3329){return client[_0x1fbd('0x10')](_0x1cf62d,_0x313f54)[_0x1fbd('0x11')](function(_0x2e1479){logger[_0x1fbd('0x12')](_0x1fbd('0x13'),_0xc7f7ba,_0x1fbd('0x14'));logger[_0x1fbd('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xc7f7ba,_0x1fbd('0x14'),JSON['stringify'](_0x2e1479));if(_0x2e1479[_0x1fbd('0x16')]){if(_0x2e1479[_0x1fbd('0x16')][_0x1fbd('0x17')]===0x1f4){logger[_0x1fbd('0x16')](_0x1fbd('0x13'),_0xc7f7ba,_0x2e1479[_0x1fbd('0x16')][_0x1fbd('0x18')]);return _0x5d3329(_0x2e1479[_0x1fbd('0x16')][_0x1fbd('0x18')]);}logger['error'](_0x1fbd('0x13'),_0xc7f7ba,_0x2e1479[_0x1fbd('0x16')][_0x1fbd('0x18')]);return _0x1363d8(_0x2e1479[_0x1fbd('0x16')][_0x1fbd('0x18')]);}else{logger[_0x1fbd('0x12')](_0x1fbd('0x13'),_0xc7f7ba,'request\x20sent');_0x1363d8(_0x2e1479[_0x1fbd('0x19')]['message']);}})[_0x1fbd('0x1a')](function(_0x28b536){logger[_0x1fbd('0x16')](_0x1fbd('0x13'),_0xc7f7ba,_0x28b536);_0x5d3329(_0x28b536);});});}exports[_0x1fbd('0x1b')]=function(_0x5b4dc4){var _0x242075=this;return new Promise(function(_0x3aaf95,_0x56c19d){return db['ChatInteraction'][_0x1fbd('0x1c')](_0x5b4dc4['body'],{'raw':_0x5b4dc4[_0x1fbd('0x1d')]?_0x5b4dc4[_0x1fbd('0x1d')][_0x1fbd('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b4dc4[_0x1fbd('0x1d')]?_0x5b4dc4[_0x1fbd('0x1d')][_0x1fbd('0x1f')]||null:null,'attributes':_0x5b4dc4['options']?_0x5b4dc4[_0x1fbd('0x1d')][_0x1fbd('0x20')]||null:null,'limit':_0x5b4dc4['options']?_0x5b4dc4[_0x1fbd('0x1d')]['limit']||null:null})[_0x1fbd('0x11')](function(_0x245ac4){logger[_0x1fbd('0x12')](_0x1fbd('0x1b'),_0x5b4dc4);logger[_0x1fbd('0x15')]('UpdateChatInteraction',_0x5b4dc4,JSON[_0x1fbd('0x21')](_0x245ac4));_0x3aaf95(_0x245ac4);})['catch'](function(_0x21a9de){logger[_0x1fbd('0x16')](_0x1fbd('0x1b'),_0x21a9de[_0x1fbd('0x18')],_0x5b4dc4);_0x56c19d(_0x242075[_0x1fbd('0x16')](0x1f4,_0x21a9de['message']));});});};exports['AddTagsToChatInteraction']=function(_0x310259){return new Promise(function(_0x3ec080,_0x108e14){return db[_0x1fbd('0x22')][_0x1fbd('0x23')]({'where':_0x310259[_0x1fbd('0x1d')]?_0x310259['options']['where']||null:null})['then'](function(_0x60b22f){if(_0x60b22f){return _0x60b22f[_0x1fbd('0x24')](_0x310259[_0x1fbd('0x25')]['ids'],_[_0x1fbd('0x26')](_0x310259[_0x1fbd('0x25')],['ids','id'])||{});}})[_0x1fbd('0x27')](function(_0x1be0f2){logger[_0x1fbd('0x12')]('AddTags',_0x310259);logger[_0x1fbd('0x15')]('AddTags',_0x310259,JSON[_0x1fbd('0x21')](_0x1be0f2));_0x3ec080(_0x1be0f2);})[_0x1fbd('0x1a')](function(_0x250d83){logger[_0x1fbd('0x16')](_0x1fbd('0x28'),_0x250d83['message'],_0x310259);_0x108e14(_this[_0x1fbd('0x16')](0x1f4,_0x250d83['message']));});});}; \ No newline at end of file +var _0x594b=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','request\x20sent','catch','UpdateChatInteraction','ChatInteraction','update','options','where','attributes','limit','AddTagsToChatInteraction','find','addTags','body','ids','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x344596,_0x4b07b1){var _0x888f0b=function(_0x5123c6){while(--_0x5123c6){_0x344596['push'](_0x344596['shift']());}};_0x888f0b(++_0x4b07b1);}(_0x594b,0x1bc));var _0xb594=function(_0x94b35e,_0x2b6997){_0x94b35e=_0x94b35e-0x0;var _0x506243=_0x594b[_0x94b35e];return _0x506243;};'use strict';var _=require(_0xb594('0x0'));var util=require(_0xb594('0x1'));var moment=require(_0xb594('0x2'));var BPromise=require('bluebird');var rs=require(_0xb594('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb594('0x4'))['db'];var utils=require(_0xb594('0x5'));var logger=require(_0xb594('0x6'))(_0xb594('0x7'));var config=require(_0xb594('0x8'));var jayson=require(_0xb594('0x9'));var client=jayson[_0xb594('0xa')]['http']({'port':0x232a});config[_0xb594('0xb')]=_[_0xb594('0xc')](config['redis'],{'host':_0xb594('0xd'),'port':0x18eb});var socket=require(_0xb594('0xe'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xb594('0xf')](socket);function respondWithRpcPromise(_0x27716d,_0x2d63b9,_0x2fb952){return new BPromise(function(_0x5ed30e,_0x24891f){return client[_0xb594('0x10')](_0x27716d,_0x2fb952)[_0xb594('0x11')](function(_0x2129d8){logger[_0xb594('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x2d63b9,'request\x20sent');logger[_0xb594('0x13')](_0xb594('0x14'),_0x2d63b9,'request\x20sent',JSON[_0xb594('0x15')](_0x2129d8));if(_0x2129d8[_0xb594('0x16')]){if(_0x2129d8[_0xb594('0x16')][_0xb594('0x17')]===0x1f4){logger[_0xb594('0x16')](_0xb594('0x18'),_0x2d63b9,_0x2129d8['error'][_0xb594('0x19')]);return _0x24891f(_0x2129d8[_0xb594('0x16')][_0xb594('0x19')]);}logger[_0xb594('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2d63b9,_0x2129d8[_0xb594('0x16')][_0xb594('0x19')]);return _0x5ed30e(_0x2129d8[_0xb594('0x16')][_0xb594('0x19')]);}else{logger[_0xb594('0x12')](_0xb594('0x18'),_0x2d63b9,_0xb594('0x1a'));_0x5ed30e(_0x2129d8['result'][_0xb594('0x19')]);}})[_0xb594('0x1b')](function(_0x512368){logger[_0xb594('0x16')](_0xb594('0x18'),_0x2d63b9,_0x512368);_0x24891f(_0x512368);});});}exports[_0xb594('0x1c')]=function(_0x30606f){var _0xf3bc85=this;return new Promise(function(_0x1f6a13,_0xa6c60b){return db[_0xb594('0x1d')][_0xb594('0x1e')](_0x30606f['body'],{'raw':_0x30606f[_0xb594('0x1f')]?_0x30606f[_0xb594('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30606f[_0xb594('0x1f')]?_0x30606f[_0xb594('0x1f')][_0xb594('0x20')]||null:null,'attributes':_0x30606f[_0xb594('0x1f')]?_0x30606f['options'][_0xb594('0x21')]||null:null,'limit':_0x30606f[_0xb594('0x1f')]?_0x30606f[_0xb594('0x1f')][_0xb594('0x22')]||null:null})[_0xb594('0x11')](function(_0x420c51){logger[_0xb594('0x12')]('UpdateChatInteraction',_0x30606f);logger[_0xb594('0x13')](_0xb594('0x1c'),_0x30606f,JSON[_0xb594('0x15')](_0x420c51));_0x1f6a13(_0x420c51);})[_0xb594('0x1b')](function(_0x57f927){logger[_0xb594('0x16')](_0xb594('0x1c'),_0x57f927[_0xb594('0x19')],_0x30606f);_0xa6c60b(_0xf3bc85['error'](0x1f4,_0x57f927[_0xb594('0x19')]));});});};exports[_0xb594('0x23')]=function(_0x11f633){return new Promise(function(_0x4d70f5,_0x4a2e2b){return db[_0xb594('0x1d')][_0xb594('0x24')]({'where':_0x11f633[_0xb594('0x1f')]?_0x11f633[_0xb594('0x1f')][_0xb594('0x20')]||null:null})[_0xb594('0x11')](function(_0x52e8de){if(_0x52e8de){return _0x52e8de[_0xb594('0x25')](_0x11f633['body']['ids'],_['omit'](_0x11f633[_0xb594('0x26')],[_0xb594('0x27'),'id'])||{});}})['spread'](function(_0x46ae27){logger[_0xb594('0x12')](_0xb594('0x28'),_0x11f633);logger[_0xb594('0x13')](_0xb594('0x28'),_0x11f633,JSON[_0xb594('0x15')](_0x46ae27));_0x4d70f5(_0x46ae27);})[_0xb594('0x1b')](function(_0x1feb40){logger[_0xb594('0x16')](_0xb594('0x28'),_0x1feb40[_0xb594('0x19')],_0x11f633);_0x4a2e2b(_this[_0xb594('0x16')](0x1f4,_0x1feb40[_0xb594('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index d7ac17b..73eb44b 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 _0xea09=['removeListener','register','length','chatInteraction:','remove','emit'];(function(_0x59c196,_0xc31aef){var _0xaf6597=function(_0x48cf64){while(--_0x48cf64){_0x59c196['push'](_0x59c196['shift']());}};_0xaf6597(++_0xc31aef);}(_0xea09,0xd0));var _0x9ea0=function(_0x17f6a9,_0x1bc94d){_0x17f6a9=_0x17f6a9-0x0;var _0x2e3569=_0xea09[_0x17f6a9];return _0x2e3569;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x9ea0('0x0'),'update'];function createListener(_0x575b2f,_0x5615d5){return function(_0x24ccf8){_0x5615d5[_0x9ea0('0x1')](_0x575b2f,_0x24ccf8);};}function removeListener(_0x5cd3a7,_0x5a679f){return function(){ChatInteractionEvents[_0x9ea0('0x2')](_0x5cd3a7,_0x5a679f);};}exports[_0x9ea0('0x3')]=function(_0x53dd70){for(var _0x37dd11=0x0,_0x1e2eb1=events[_0x9ea0('0x4')];_0x37dd11<_0x1e2eb1;_0x37dd11++){var _0x10133b=events[_0x37dd11];var _0xc4f0f3=createListener(_0x9ea0('0x5')+_0x10133b,_0x53dd70);ChatInteractionEvents['on'](_0x10133b,_0xc4f0f3);}}; \ No newline at end of file +var _0xfe52=['chatInteraction:','./chatInteraction.events','save','remove','emit','register','length'];(function(_0x5e7661,_0x5aa521){var _0x1866cf=function(_0x133c22){while(--_0x133c22){_0x5e7661['push'](_0x5e7661['shift']());}};_0x1866cf(++_0x5aa521);}(_0xfe52,0x1c1));var _0x2fe5=function(_0x22b857,_0x2b9c4a){_0x22b857=_0x22b857-0x0;var _0x405778=_0xfe52[_0x22b857];return _0x405778;};'use strict';var ChatInteractionEvents=require(_0x2fe5('0x0'));var events=[_0x2fe5('0x1'),_0x2fe5('0x2'),'update'];function createListener(_0x500ca3,_0x9df226){return function(_0x39683a){_0x9df226[_0x2fe5('0x3')](_0x500ca3,_0x39683a);};}function removeListener(_0x424d85,_0x37fb28){return function(){ChatInteractionEvents['removeListener'](_0x424d85,_0x37fb28);};}exports[_0x2fe5('0x4')]=function(_0xc65664){for(var _0x654959=0x0,_0x19210b=events[_0x2fe5('0x5')];_0x654959<_0x19210b;_0x654959++){var _0x4defaf=events[_0x654959];var _0x1ce8a2=createListener(_0x2fe5('0x6')+_0x4defaf,_0xc65664);ChatInteractionEvents['on'](_0x4defaf,_0x1ce8a2);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 5b32387..8dd1a3d 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 _0x192b=['put','tracked','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','/:id/vidaoo','join','%s-%s','now','originalname','single','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags'];(function(_0x4b89d,_0x87fbb5){var _0x230f1f=function(_0x290c61){while(--_0x290c61){_0x4b89d['push'](_0x4b89d['shift']());}};_0x230f1f(++_0x87fbb5);}(_0x192b,0x164));var _0xb192=function(_0x31288f,_0x26c9c6){_0x31288f=_0x31288f-0x0;var _0x3ace50=_0x192b[_0x31288f];return _0x3ace50;};'use strict';var multer=require('multer');var util=require(_0xb192('0x0'));var path=require(_0xb192('0x1'));var timeout=require(_0xb192('0x2'));var express=require('express');var router=express[_0xb192('0x3')]();var fs_extra=require(_0xb192('0x4'));var auth=require(_0xb192('0x5'));var interaction=require(_0xb192('0x6'));var config=require(_0xb192('0x7'));var controller=require(_0xb192('0x8'));router['get']('/',auth[_0xb192('0x9')](),controller[_0xb192('0xa')]);router[_0xb192('0xb')](_0xb192('0xc'),auth['isAuthenticated'](),controller[_0xb192('0xd')]);router[_0xb192('0xb')](_0xb192('0xe'),auth[_0xb192('0xf')](),controller[_0xb192('0x10')]);router[_0xb192('0xb')]('/:id/attachment_download',auth[_0xb192('0xf')](),controller[_0xb192('0x11')]);router['get'](_0xb192('0x12'),auth[_0xb192('0x9')](),controller[_0xb192('0x13')]);router[_0xb192('0xb')](_0xb192('0x14'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0xb192('0xb')](_0xb192('0x15'),auth['isAuthenticated'](),controller[_0xb192('0x16')]);router[_0xb192('0x17')]('/',auth[_0xb192('0x9')](),controller['create']);router[_0xb192('0x17')](_0xb192('0x18'),auth[_0xb192('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1b8c72,_0x185e34,_0x4de9fe){_0x4de9fe(null,path[_0xb192('0x19')](config['root'],'server/files/attachments/'));},'filename':function(_0x36de0f,_0x58ca0f,_0x430a9a){_0x430a9a(null,util['format'](_0xb192('0x1a'),Date[_0xb192('0x1b')](),_0x58ca0f[_0xb192('0x1c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb192('0x17')]('/:id/attachment_upload',upload[_0xb192('0x1d')]('file'),controller[_0xb192('0x1e')]);router[_0xb192('0x17')](_0xb192('0x12'),auth['isChatInteractionAuthorized'](),controller[_0xb192('0x1f')]);router['post'](_0xb192('0x20'),auth[_0xb192('0x9')](),interaction['tracked'](_0xb192('0x21'),_0xb192('0x22')),controller[_0xb192('0x23')]);router[_0xb192('0x24')](_0xb192('0xe'),auth[_0xb192('0x9')](),interaction[_0xb192('0x25')](_0xb192('0x21'),_0xb192('0x26')),controller['update']);router[_0xb192('0x24')](_0xb192('0x27'),controller[_0xb192('0x28')]);router[_0xb192('0x24')](_0xb192('0x29'),auth[_0xb192('0xf')](),controller[_0xb192('0x2a')]);router[_0xb192('0x24')]('/:id/close',controller[_0xb192('0x2b')]);router[_0xb192('0x2c')](_0xb192('0xe'),auth['isAuthenticated'](),interaction[_0xb192('0x25')](_0xb192('0x21'),_0xb192('0x2d')),controller[_0xb192('0x2e')]);router[_0xb192('0x2c')]('/:id/tags',auth[_0xb192('0x9')](),controller[_0xb192('0x2f')]);module[_0xb192('0x30')]=router; \ No newline at end of file +var _0xdcdf=['/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','getMessages','getMyMessages','download','post','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','attachmentUpload','tracked','chatinteraction:addtags','addTags','update','put','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','chat','chatinteraction:destroy','destroy','/:id/tags','removeTags','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x2a3059,_0x59214e){var _0x24b64c=function(_0x1286df){while(--_0x1286df){_0x2a3059['push'](_0x2a3059['shift']());}};_0x24b64c(++_0x59214e);}(_0xdcdf,0x16f));var _0xfdcd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdcdf[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfdcd('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfdcd('0x1'));var router=express['Router']();var fs_extra=require(_0xfdcd('0x2'));var auth=require(_0xfdcd('0x3'));var interaction=require(_0xfdcd('0x4'));var config=require(_0xfdcd('0x5'));var controller=require('./chatInteraction.controller');router[_0xfdcd('0x6')]('/',auth[_0xfdcd('0x7')](),controller[_0xfdcd('0x8')]);router[_0xfdcd('0x6')](_0xfdcd('0x9'),auth[_0xfdcd('0x7')](),controller[_0xfdcd('0xa')]);router['get'](_0xfdcd('0xb'),auth[_0xfdcd('0xc')](),controller[_0xfdcd('0xd')]);router['get'](_0xfdcd('0xe'),auth[_0xfdcd('0xc')](),controller['attachmentDownload']);router[_0xfdcd('0x6')]('/:id/messages',auth['isAuthenticated'](),controller[_0xfdcd('0xf')]);router[_0xfdcd('0x6')]('/:id/my_messages',auth[_0xfdcd('0xc')](),controller[_0xfdcd('0x10')]);router[_0xfdcd('0x6')]('/:id/download',auth[_0xfdcd('0x7')](),controller[_0xfdcd('0x11')]);router[_0xfdcd('0x12')]('/',auth[_0xfdcd('0x7')](),controller['create']);router['post']('/:id/vidaoo',auth[_0xfdcd('0x7')](),controller[_0xfdcd('0x13')]);var upload=multer({'storage':multer[_0xfdcd('0x14')]({'destination':function(_0x3f5ed5,_0x1a277b,_0x243b19){_0x243b19(null,path[_0xfdcd('0x15')](config[_0xfdcd('0x16')],_0xfdcd('0x17')));},'filename':function(_0x5cea02,_0x38feae,_0x28e0c5){_0x28e0c5(null,util[_0xfdcd('0x18')](_0xfdcd('0x19'),Date[_0xfdcd('0x1a')](),_0x38feae['originalname'][_0xfdcd('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xfdcd('0x12')](_0xfdcd('0x1c'),upload[_0xfdcd('0x1d')]('file'),controller[_0xfdcd('0x1e')]);router[_0xfdcd('0x12')]('/:id/messages',auth[_0xfdcd('0xc')](),controller['addMessage']);router[_0xfdcd('0x12')]('/:id/tags',auth[_0xfdcd('0x7')](),interaction[_0xfdcd('0x1f')]('chat',_0xfdcd('0x20')),controller[_0xfdcd('0x21')]);router['put'](_0xfdcd('0xb'),auth[_0xfdcd('0x7')](),interaction['tracked']('chat','chatinteraction:update'),controller[_0xfdcd('0x22')]);router[_0xfdcd('0x23')](_0xfdcd('0x24'),controller[_0xfdcd('0x25')]);router[_0xfdcd('0x23')](_0xfdcd('0x26'),auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xfdcd('0x23')](_0xfdcd('0x27'),controller[_0xfdcd('0x28')]);router[_0xfdcd('0x29')](_0xfdcd('0xb'),auth[_0xfdcd('0x7')](),interaction[_0xfdcd('0x1f')](_0xfdcd('0x2a'),_0xfdcd('0x2b')),controller[_0xfdcd('0x2c')]);router[_0xfdcd('0x29')](_0xfdcd('0x2d'),auth[_0xfdcd('0x7')](),controller[_0xfdcd('0x2e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index cd6e942..f5f2271 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 _0x2998=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x2998,0x1c1));var _0x8299=function(_0x41d319,_0x43b8fc){_0x41d319=_0x41d319-0x0;var _0x466f55=_0x2998[_0x41d319];return _0x466f55;};'use strict';var Sequelize=require(_0x8299('0x0'));module['exports']={'body':{'type':Sequelize[_0x8299('0x1')](_0x8299('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8299('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8299('0x4')]}}; \ No newline at end of file +var _0xa995=['INTEGER','sequelize','TEXT','medium','BOOLEAN'];(function(_0x18e97c,_0x39c67b){var _0x4a7804=function(_0x30b1b3){while(--_0x30b1b3){_0x18e97c['push'](_0x18e97c['shift']());}};_0x4a7804(++_0x39c67b);}(_0xa995,0x6a));var _0x5a99=function(_0x169199,_0x2958dc){_0x169199=_0x169199-0x0;var _0x11425e=_0xa995[_0x169199];return _0x11425e;};'use strict';var Sequelize=require(_0x5a99('0x0'));module['exports']={'body':{'type':Sequelize[_0x5a99('0x1')](_0x5a99('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5a99('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5a99('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 38c1600..ca49e07 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 _0x2b71=['describe','get','messages','lastMessageAt','createdAt','lastMessage','getUsers','User','findAll','admin','user','fullname','role','internal','online','allowmessenger','showWebBar','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','agent','resourceId','push','ToId','read','-createdAt','all','rimraf','fast-json-patch','request-promise','moment','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','rows','catch','show','params','filters','include','create','body','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b71,0xe8));var _0x12b7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2b71[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x12b7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x12b7('0x1'));var rp=require(_0x12b7('0x2'));var moment=require(_0x12b7('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');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(_0x12b7('0x4'));var _=require('lodash');var squel=require(_0x12b7('0x5'));var crypto=require(_0x12b7('0x6'));var jsforce=require('jsforce');var deskjs=require(_0x12b7('0x7'));var toCsv=require(_0x12b7('0x8'));var querystring=require(_0x12b7('0x9'));var Papa=require(_0x12b7('0xa'));var Redis=require(_0x12b7('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x12b7('0xc'));var as=require(_0x12b7('0xd'));var hardwareService=require(_0x12b7('0xe'));var logger=require('../../config/logger')(_0x12b7('0xf'));var utils=require(_0x12b7('0x10'));var config=require(_0x12b7('0x11'));var licenseUtil=require(_0x12b7('0x12'));var db=require(_0x12b7('0x13'))['db'];config[_0x12b7('0x14')]=_[_0x12b7('0x15')](config[_0x12b7('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x12b7('0x16'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x12b7('0x17')](socket);function respondWithStatusCode(_0x29e1fc,_0x26bde4){_0x26bde4=_0x26bde4||0xcc;return function(_0x6984c2){if(_0x6984c2){return _0x29e1fc[_0x12b7('0x18')](_0x26bde4);}return _0x29e1fc[_0x12b7('0x19')](_0x26bde4)[_0x12b7('0x1a')]();};}function respondWithResult(_0x477d97,_0x5ac055){_0x5ac055=_0x5ac055||0xc8;return function(_0x44efde){if(_0x44efde){return _0x477d97[_0x12b7('0x19')](_0x5ac055)[_0x12b7('0x1b')](_0x44efde);}};}function respondWithFilteredResult(_0x2d0650,_0x3c41de){return function(_0xa608c9){if(_0xa608c9){var _0xa960d=typeof _0x3c41de[_0x12b7('0x1c')]===_0x12b7('0x1d')&&typeof _0x3c41de[_0x12b7('0x1e')]===_0x12b7('0x1d');var _0x3bbb4e=_0xa608c9[_0x12b7('0x1f')];var _0x491c25=_0xa960d?0x0:_0x3c41de[_0x12b7('0x1c')];var _0x3e4e64=_0xa960d?_0xa608c9[_0x12b7('0x1f')]:_0x3c41de['offset']+_0x3c41de[_0x12b7('0x1e')];var _0x4a920a;if(_0x3e4e64>=_0x3bbb4e){_0x3e4e64=_0x3bbb4e;_0x4a920a=0xc8;}else{_0x4a920a=0xce;}_0x2d0650[_0x12b7('0x19')](_0x4a920a);return _0x2d0650[_0x12b7('0x20')](_0x12b7('0x21'),_0x491c25+'-'+_0x3e4e64+'/'+_0x3bbb4e)[_0x12b7('0x1b')](_0xa608c9);}return null;};}function patchUpdates(_0xc9fa25){return function(_0x1f9ebb){try{jsonpatch[_0x12b7('0x22')](_0x1f9ebb,_0xc9fa25,!![]);}catch(_0x190280){return BPromise['reject'](_0x190280);}return _0x1f9ebb[_0x12b7('0x23')]();};}function saveUpdates(_0x500aba,_0x2f73e6){return function(_0x10277a){if(_0x10277a){return _0x10277a[_0x12b7('0x24')](_0x500aba)[_0x12b7('0x25')](function(_0x84201e){return _0x84201e;});}return null;};}function removeEntity(_0x17b51b,_0x25ea18){return function(_0x24583c){if(_0x24583c){return _0x24583c['destroy']()['then'](function(){_0x17b51b[_0x12b7('0x19')](0xcc)[_0x12b7('0x1a')]();});}};}function handleEntityNotFound(_0x454673,_0x2d0936){return function(_0x1bf0ae){if(!_0x1bf0ae){_0x454673[_0x12b7('0x18')](0x194);}return _0x1bf0ae;};}function handleError(_0x1d5514,_0x1f631e){_0x1f631e=_0x1f631e||0x1f4;return function(_0x1449c7){logger[_0x12b7('0x26')](_0x1449c7[_0x12b7('0x27')]);if(_0x1449c7[_0x12b7('0x28')]){delete _0x1449c7[_0x12b7('0x28')];}_0x1d5514['status'](_0x1f631e)[_0x12b7('0x29')](_0x1449c7);};}exports[_0x12b7('0x2a')]=function(_0x5ad700,_0x1be684){var _0x430fe5={},_0x1187ae={},_0x4412c7={'count':0x0,'rows':[]};var _0x4f731b=_[_0x12b7('0x2b')](db[_0x12b7('0x2c')][_0x12b7('0x2d')],function(_0x265ae7){return{'name':_0x265ae7[_0x12b7('0x2e')],'type':_0x265ae7[_0x12b7('0x2f')][_0x12b7('0x30')]};});_0x1187ae[_0x12b7('0x31')]=_[_0x12b7('0x2b')](_0x4f731b,_0x12b7('0x28'));_0x1187ae[_0x12b7('0x32')]=_[_0x12b7('0x33')](_0x5ad700[_0x12b7('0x32')]);_0x1187ae['filters']=_[_0x12b7('0x34')](_0x1187ae[_0x12b7('0x31')],_0x1187ae['query']);_0x430fe5[_0x12b7('0x35')]=_[_0x12b7('0x34')](_0x1187ae[_0x12b7('0x31')],qs[_0x12b7('0x36')](_0x5ad700['query'][_0x12b7('0x36')]));_0x430fe5['attributes']=_0x430fe5[_0x12b7('0x35')][_0x12b7('0x37')]?_0x430fe5[_0x12b7('0x35')]:_0x1187ae[_0x12b7('0x31')];if(!_0x5ad700[_0x12b7('0x32')][_0x12b7('0x38')](_0x12b7('0x39'))){_0x430fe5['limit']=qs['limit'](_0x5ad700[_0x12b7('0x32')]['limit']);_0x430fe5[_0x12b7('0x1c')]=qs[_0x12b7('0x1c')](_0x5ad700[_0x12b7('0x32')]['offset']);}_0x430fe5[_0x12b7('0x3a')]=qs[_0x12b7('0x3b')](_0x5ad700['query']['sort']);_0x430fe5[_0x12b7('0x3c')]=qs['filters'](_['pick'](_0x5ad700[_0x12b7('0x32')],_0x1187ae['filters']),_0x4f731b);if(_0x5ad700[_0x12b7('0x32')][_0x12b7('0x3d')]){_0x430fe5[_0x12b7('0x3c')]=_[_0x12b7('0x3e')](_0x430fe5['where'],{'$or':_['map'](_0x4f731b,function(_0x399f49){if(_0x399f49['type']!=='VIRTUAL'){var _0x315694={};_0x315694[_0x399f49[_0x12b7('0x28')]]={'$like':'%'+_0x5ad700[_0x12b7('0x32')][_0x12b7('0x3d')]+'%'};return _0x315694;}})});}_0x430fe5=_[_0x12b7('0x3e')]({},_0x430fe5,_0x5ad700[_0x12b7('0x3f')]);var _0x5cbddd={'where':_0x430fe5[_0x12b7('0x3c')]};return db[_0x12b7('0x2c')][_0x12b7('0x1f')](_0x5cbddd)[_0x12b7('0x25')](function(_0x452e34){_0x4412c7[_0x12b7('0x1f')]=_0x452e34;if(_0x5ad700['query'][_0x12b7('0x40')]){_0x430fe5['include']=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x430fe5);})[_0x12b7('0x25')](function(_0x276301){_0x4412c7[_0x12b7('0x41')]=_0x276301;return _0x4412c7;})[_0x12b7('0x25')](respondWithFilteredResult(_0x1be684,_0x430fe5))[_0x12b7('0x42')](handleError(_0x1be684,null));};exports[_0x12b7('0x43')]=function(_0x479cb9,_0x512937){var _0x425036={'raw':!![],'where':{'id':_0x479cb9[_0x12b7('0x44')]['id']}},_0x32736d={};_0x32736d['model']=_[_0x12b7('0x33')](db[_0x12b7('0x2c')][_0x12b7('0x2d')]);_0x32736d[_0x12b7('0x32')]=_['keys'](_0x479cb9[_0x12b7('0x32')]);_0x32736d[_0x12b7('0x45')]=_[_0x12b7('0x34')](_0x32736d['model'],_0x32736d[_0x12b7('0x32')]);_0x425036[_0x12b7('0x35')]=_[_0x12b7('0x34')](_0x32736d[_0x12b7('0x31')],qs['fields'](_0x479cb9[_0x12b7('0x32')]['fields']));_0x425036[_0x12b7('0x35')]=_0x425036[_0x12b7('0x35')][_0x12b7('0x37')]?_0x425036[_0x12b7('0x35')]:_0x32736d['model'];if(_0x479cb9['query'][_0x12b7('0x40')]){_0x425036[_0x12b7('0x46')]=[{'all':!![]}];}_0x425036=_[_0x12b7('0x3e')]({},_0x425036,_0x479cb9['options']);return db[_0x12b7('0x2c')]['find'](_0x425036)['then'](handleEntityNotFound(_0x512937,null))['then'](respondWithResult(_0x512937,null))[_0x12b7('0x42')](handleError(_0x512937,null));};exports[_0x12b7('0x47')]=function(_0x5ca4f6,_0x22f23b){return db[_0x12b7('0x2c')][_0x12b7('0x47')](_0x5ca4f6[_0x12b7('0x48')],{})[_0x12b7('0x25')](respondWithResult(_0x22f23b,0xc9))[_0x12b7('0x42')](handleError(_0x22f23b,null));};exports[_0x12b7('0x24')]=function(_0x5e502b,_0x8df147){if(_0x5e502b['body']['id']){delete _0x5e502b[_0x12b7('0x48')]['id'];}return db['ChatInternalMessage'][_0x12b7('0x49')]({'where':{'id':_0x5e502b[_0x12b7('0x44')]['id']}})[_0x12b7('0x25')](handleEntityNotFound(_0x8df147,null))[_0x12b7('0x25')](saveUpdates(_0x5e502b[_0x12b7('0x48')],null))[_0x12b7('0x25')](respondWithResult(_0x8df147,null))['catch'](handleError(_0x8df147,null));};exports['destroy']=function(_0x260d03,_0x918f79){return db[_0x12b7('0x2c')][_0x12b7('0x49')]({'where':{'id':_0x260d03[_0x12b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x918f79,null))[_0x12b7('0x25')](removeEntity(_0x918f79,null))[_0x12b7('0x42')](handleError(_0x918f79,null));};exports[_0x12b7('0x4a')]=function(_0x23fdc5,_0x3f2ce1){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0x3f2ce1,null))[_0x12b7('0x42')](handleError(_0x3f2ce1,null));};function wrapUser(_0x8110c5){return function(_0x34cc5e){var _0x27c46d=_0x8110c5[_0x12b7('0x4b')]({'plain':!![]});_0x27c46d[_0x12b7('0x4c')]=[];if(_0x34cc5e){_0x27c46d[_0x12b7('0x4d')]=_0x34cc5e[_0x12b7('0x4e')];_0x27c46d[_0x12b7('0x4f')]=_0x34cc5e;}else{_0x27c46d[_0x12b7('0x4d')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x27c46d[_0x12b7('0x4f')]={};}return _0x27c46d;};}exports[_0x12b7('0x50')]=function(_0x589943,_0x44d4e5,_0xb8306c){var _0xbf452d=[];return db[_0x12b7('0x51')][_0x12b7('0x52')]({'where':{'role':['agent',_0x12b7('0x53'),_0x12b7('0x54')]},'attributes':['id',_0x12b7('0x55'),_0x12b7('0x28'),_0x12b7('0x56'),'userpic',_0x12b7('0x57'),_0x12b7('0x58'),'lastLoginAt',_0x12b7('0x59'),_0x12b7('0x5a')],'order':qs[_0x12b7('0x3b')]('-online'),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0x12b7('0x28'),_0x12b7('0x2f')],'through':{'attributes':[]}}]})[_0x12b7('0x25')](function(_0x204e52){if(_0x204e52){var _0x1e1969=_0x589943[_0x12b7('0x54')][_0x12b7('0x4b')]({'plain':!![]});if(!_0x1e1969)throw new Error(_0x12b7('0x5b'));if(_0x1e1969[_0x12b7('0x56')]===_0x12b7('0x54')){return db[_0x12b7('0x5c')][_0x12b7('0x49')]({'where':{'name':'Agents','userProfileId':_0x1e1969[_0x12b7('0x5d')]},'raw':!![]})[_0x12b7('0x25')](function(_0x17b1bb){if(_0x17b1bb){if(_0x17b1bb[_0x12b7('0x5e')]===0x0){return db['UserProfileResource'][_0x12b7('0x52')]({'where':{'sectionId':_0x17b1bb['id']},'raw':!![]})[_0x12b7('0x25')](function(_0x2572cf){var _0x19402a=[];if(_['isEmpty'](_0x2572cf)){_0x19402a=_[_0x12b7('0x3d')](_0x204e52,function(_0x37a7d5){if(_0x37a7d5[_0x12b7('0x56')]!==_0x12b7('0x5f')){return _0x37a7d5;}});return _0x19402a;}else{for(var _0x4793e8=0x0;_0x4793e8<_0x204e52['length'];_0x4793e8++){var _0x1a1e20=_0x204e52[_0x4793e8];if(_0x1a1e20[_0x12b7('0x56')]==='agent'){var _0x13f883=_['find'](_0x2572cf,function(_0x53852f){return _0x53852f[_0x12b7('0x60')]===_0x1a1e20['id'];});if(_0x13f883)_0x19402a[_0x12b7('0x61')](_0x1a1e20);}else{_0x19402a['push'](_0x1a1e20);}}return _0x19402a;}});}else{return _0x204e52;}}else{var _0x337bcf=_[_0x12b7('0x3d')](_0x204e52,function(_0x1eb309){if(_0x1eb309['role']!==_0x12b7('0x5f')){return _0x1eb309;}});return _0x337bcf;}});}else{return _0x204e52;}}})[_0x12b7('0x25')](function(_0x4173ed){var _0x2eee23=[];if(_0x4173ed){_0xbf452d=_0x4173ed;for(var _0x2d02a1=0x0;_0x2d02a1<_0x4173ed[_0x12b7('0x37')];_0x2d02a1+=0x1){_0xbf452d[_0x2d02a1]['messages']=[];_0x2eee23[_0x12b7('0x61')](db['ChatInternalMessage'][_0x12b7('0x49')]({'where':{'FromId':[_0x589943[_0x12b7('0x54')]['id'],_0x4173ed[_0x2d02a1]['id']],'ToId':[_0x589943[_0x12b7('0x54')]['id'],_0x4173ed[_0x2d02a1]['id']],'ChatGroupId':null},'attributes':['id',_0x12b7('0x4e'),'FromId',_0x12b7('0x62'),_0x12b7('0x63'),_0x12b7('0x48')],'order':qs['sort'](_0x12b7('0x64')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x12b7('0x25')](wrapUser(_0x4173ed[_0x2d02a1])));}return BPromise[_0x12b7('0x65')](_0x2eee23);}return[];})[_0x12b7('0x25')](function(_0x3931bf){return{'rows':_0x3931bf,'count':_0x3931bf['length']};})[_0x12b7('0x25')](respondWithResult(_0x44d4e5,null))[_0x12b7('0x42')](handleError(_0x44d4e5,null));}; \ No newline at end of file +var _0x5a15=['fields','length','nolimit','order','sort','pick','filter','merge','where','options','count','include','findAll','show','params','includeAll','catch','create','update','body','find','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','-createdAt','all','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','json','offset','undefined','limit','set','apply','reject','destroy','then','end','sendStatus','stack','name','map','ChatInternalMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a15,0x10e));var _0x55a1=function(_0x20683d,_0x5965e1){_0x20683d=_0x20683d-0x0;var _0x10cef6=_0x5a15[_0x20683d];return _0x10cef6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x55a1('0x0'));var jsonpatch=require(_0x55a1('0x1'));var rp=require(_0x55a1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x55a1('0x3'));var util=require(_0x55a1('0x4'));var path=require(_0x55a1('0x5'));var sox=require(_0x55a1('0x6'));var csv=require('to-csv');var ejs=require(_0x55a1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x55a1('0x8'));var squel=require(_0x55a1('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x55a1('0xa'));var toCsv=require(_0x55a1('0xb'));var querystring=require(_0x55a1('0xc'));var Papa=require('papaparse');var Redis=require(_0x55a1('0xd'));var authService=require(_0x55a1('0xe'));var qs=require(_0x55a1('0xf'));var as=require(_0x55a1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x55a1('0x11'))(_0x55a1('0x12'));var utils=require(_0x55a1('0x13'));var config=require(_0x55a1('0x14'));var licenseUtil=require(_0x55a1('0x15'));var db=require(_0x55a1('0x16'))['db'];config[_0x55a1('0x17')]=_[_0x55a1('0x18')](config[_0x55a1('0x17')],{'host':_0x55a1('0x19'),'port':0x18eb});var socket=require(_0x55a1('0x1a'))(new Redis(config[_0x55a1('0x17')]));require(_0x55a1('0x1b'))[_0x55a1('0x1c')](socket);function respondWithStatusCode(_0x51fac2,_0x83145a){_0x83145a=_0x83145a||0xcc;return function(_0x2d47ce){if(_0x2d47ce){return _0x51fac2['sendStatus'](_0x83145a);}return _0x51fac2[_0x55a1('0x1d')](_0x83145a)['end']();};}function respondWithResult(_0xd6391e,_0x282f65){_0x282f65=_0x282f65||0xc8;return function(_0x5741eb){if(_0x5741eb){return _0xd6391e[_0x55a1('0x1d')](_0x282f65)[_0x55a1('0x1e')](_0x5741eb);}};}function respondWithFilteredResult(_0xc8e43a,_0x54350d){return function(_0x3df3e4){if(_0x3df3e4){var _0x25e9f0=typeof _0x54350d[_0x55a1('0x1f')]===_0x55a1('0x20')&&typeof _0x54350d[_0x55a1('0x21')]===_0x55a1('0x20');var _0x17ea48=_0x3df3e4['count'];var _0x229a4d=_0x25e9f0?0x0:_0x54350d['offset'];var _0xa6b729=_0x25e9f0?_0x3df3e4['count']:_0x54350d[_0x55a1('0x1f')]+_0x54350d[_0x55a1('0x21')];var _0x1d763b;if(_0xa6b729>=_0x17ea48){_0xa6b729=_0x17ea48;_0x1d763b=0xc8;}else{_0x1d763b=0xce;}_0xc8e43a['status'](_0x1d763b);return _0xc8e43a[_0x55a1('0x22')]('Content-Range',_0x229a4d+'-'+_0xa6b729+'/'+_0x17ea48)[_0x55a1('0x1e')](_0x3df3e4);}return null;};}function patchUpdates(_0x3ae781){return function(_0x16dc25){try{jsonpatch[_0x55a1('0x23')](_0x16dc25,_0x3ae781,!![]);}catch(_0x45d004){return BPromise[_0x55a1('0x24')](_0x45d004);}return _0x16dc25['save']();};}function saveUpdates(_0x377266,_0x3d55f1){return function(_0x23684d){if(_0x23684d){return _0x23684d['update'](_0x377266)['then'](function(_0x4761ba){return _0x4761ba;});}return null;};}function removeEntity(_0xb2309c,_0x1147d5){return function(_0x402622){if(_0x402622){return _0x402622[_0x55a1('0x25')]()[_0x55a1('0x26')](function(){_0xb2309c[_0x55a1('0x1d')](0xcc)[_0x55a1('0x27')]();});}};}function handleEntityNotFound(_0x3fcda8,_0x474493){return function(_0x1166d3){if(!_0x1166d3){_0x3fcda8[_0x55a1('0x28')](0x194);}return _0x1166d3;};}function handleError(_0x18efa1,_0x200835){_0x200835=_0x200835||0x1f4;return function(_0x5cebe4){logger['error'](_0x5cebe4[_0x55a1('0x29')]);if(_0x5cebe4['name']){delete _0x5cebe4[_0x55a1('0x2a')];}_0x18efa1[_0x55a1('0x1d')](_0x200835)['send'](_0x5cebe4);};}exports['index']=function(_0x4502eb,_0x4106ad){var _0x56d45d={},_0x38e2a5={},_0x35707d={'count':0x0,'rows':[]};var _0x269032=_[_0x55a1('0x2b')](db[_0x55a1('0x2c')][_0x55a1('0x2d')],function(_0x2eae41){return{'name':_0x2eae41[_0x55a1('0x2e')],'type':_0x2eae41[_0x55a1('0x2f')]['key']};});_0x38e2a5[_0x55a1('0x30')]=_['map'](_0x269032,_0x55a1('0x2a'));_0x38e2a5['query']=_[_0x55a1('0x31')](_0x4502eb[_0x55a1('0x32')]);_0x38e2a5[_0x55a1('0x33')]=_[_0x55a1('0x34')](_0x38e2a5[_0x55a1('0x30')],_0x38e2a5[_0x55a1('0x32')]);_0x56d45d[_0x55a1('0x35')]=_[_0x55a1('0x34')](_0x38e2a5[_0x55a1('0x30')],qs[_0x55a1('0x36')](_0x4502eb[_0x55a1('0x32')][_0x55a1('0x36')]));_0x56d45d['attributes']=_0x56d45d[_0x55a1('0x35')][_0x55a1('0x37')]?_0x56d45d[_0x55a1('0x35')]:_0x38e2a5[_0x55a1('0x30')];if(!_0x4502eb[_0x55a1('0x32')]['hasOwnProperty'](_0x55a1('0x38'))){_0x56d45d['limit']=qs[_0x55a1('0x21')](_0x4502eb[_0x55a1('0x32')][_0x55a1('0x21')]);_0x56d45d[_0x55a1('0x1f')]=qs[_0x55a1('0x1f')](_0x4502eb[_0x55a1('0x32')][_0x55a1('0x1f')]);}_0x56d45d[_0x55a1('0x39')]=qs[_0x55a1('0x3a')](_0x4502eb[_0x55a1('0x32')][_0x55a1('0x3a')]);_0x56d45d['where']=qs['filters'](_[_0x55a1('0x3b')](_0x4502eb[_0x55a1('0x32')],_0x38e2a5[_0x55a1('0x33')]),_0x269032);if(_0x4502eb['query'][_0x55a1('0x3c')]){_0x56d45d['where']=_[_0x55a1('0x3d')](_0x56d45d[_0x55a1('0x3e')],{'$or':_[_0x55a1('0x2b')](_0x269032,function(_0x191266){if(_0x191266['type']!=='VIRTUAL'){var _0x7b370b={};_0x7b370b[_0x191266['name']]={'$like':'%'+_0x4502eb[_0x55a1('0x32')][_0x55a1('0x3c')]+'%'};return _0x7b370b;}})});}_0x56d45d=_[_0x55a1('0x3d')]({},_0x56d45d,_0x4502eb[_0x55a1('0x3f')]);var _0x2e0f60={'where':_0x56d45d['where']};return db[_0x55a1('0x2c')][_0x55a1('0x40')](_0x2e0f60)[_0x55a1('0x26')](function(_0x529002){_0x35707d['count']=_0x529002;if(_0x4502eb['query']['includeAll']){_0x56d45d[_0x55a1('0x41')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x55a1('0x42')](_0x56d45d);})[_0x55a1('0x26')](function(_0xdaf2ba){_0x35707d['rows']=_0xdaf2ba;return _0x35707d;})[_0x55a1('0x26')](respondWithFilteredResult(_0x4106ad,_0x56d45d))['catch'](handleError(_0x4106ad,null));};exports[_0x55a1('0x43')]=function(_0x19c5fb,_0x2a9157){var _0x4a26a2={'raw':!![],'where':{'id':_0x19c5fb[_0x55a1('0x44')]['id']}},_0x32c750={};_0x32c750[_0x55a1('0x30')]=_['keys'](db[_0x55a1('0x2c')][_0x55a1('0x2d')]);_0x32c750[_0x55a1('0x32')]=_[_0x55a1('0x31')](_0x19c5fb['query']);_0x32c750[_0x55a1('0x33')]=_[_0x55a1('0x34')](_0x32c750[_0x55a1('0x30')],_0x32c750[_0x55a1('0x32')]);_0x4a26a2[_0x55a1('0x35')]=_[_0x55a1('0x34')](_0x32c750['model'],qs[_0x55a1('0x36')](_0x19c5fb[_0x55a1('0x32')]['fields']));_0x4a26a2[_0x55a1('0x35')]=_0x4a26a2[_0x55a1('0x35')]['length']?_0x4a26a2[_0x55a1('0x35')]:_0x32c750['model'];if(_0x19c5fb[_0x55a1('0x32')][_0x55a1('0x45')]){_0x4a26a2[_0x55a1('0x41')]=[{'all':!![]}];}_0x4a26a2=_[_0x55a1('0x3d')]({},_0x4a26a2,_0x19c5fb[_0x55a1('0x3f')]);return db[_0x55a1('0x2c')]['find'](_0x4a26a2)[_0x55a1('0x26')](handleEntityNotFound(_0x2a9157,null))[_0x55a1('0x26')](respondWithResult(_0x2a9157,null))[_0x55a1('0x46')](handleError(_0x2a9157,null));};exports['create']=function(_0x5705d6,_0x5928fb){return db[_0x55a1('0x2c')][_0x55a1('0x47')](_0x5705d6['body'],{})[_0x55a1('0x26')](respondWithResult(_0x5928fb,0xc9))[_0x55a1('0x46')](handleError(_0x5928fb,null));};exports[_0x55a1('0x48')]=function(_0x231b07,_0x204c5d){if(_0x231b07[_0x55a1('0x49')]['id']){delete _0x231b07[_0x55a1('0x49')]['id'];}return db['ChatInternalMessage'][_0x55a1('0x4a')]({'where':{'id':_0x231b07['params']['id']}})['then'](handleEntityNotFound(_0x204c5d,null))[_0x55a1('0x26')](saveUpdates(_0x231b07[_0x55a1('0x49')],null))[_0x55a1('0x26')](respondWithResult(_0x204c5d,null))[_0x55a1('0x46')](handleError(_0x204c5d,null));};exports['destroy']=function(_0xd33d51,_0x3ee498){return db['ChatInternalMessage'][_0x55a1('0x4a')]({'where':{'id':_0xd33d51['params']['id']}})[_0x55a1('0x26')](handleEntityNotFound(_0x3ee498,null))['then'](removeEntity(_0x3ee498,null))[_0x55a1('0x46')](handleError(_0x3ee498,null));};exports[_0x55a1('0x4b')]=function(_0x4a1a2e,_0x5d6c52){return db[_0x55a1('0x2c')][_0x55a1('0x4b')]()[_0x55a1('0x26')](respondWithResult(_0x5d6c52,null))[_0x55a1('0x46')](handleError(_0x5d6c52,null));};function wrapUser(_0x1fe3c8){return function(_0x3a0fba){var _0x444f8e=_0x1fe3c8[_0x55a1('0x4c')]({'plain':!![]});_0x444f8e[_0x55a1('0x4d')]=[];if(_0x3a0fba){_0x444f8e[_0x55a1('0x4e')]=_0x3a0fba['createdAt'];_0x444f8e[_0x55a1('0x4f')]=_0x3a0fba;}else{_0x444f8e['lastMessageAt']=moment(0x0)[_0x55a1('0x50')](_0x55a1('0x51'));_0x444f8e[_0x55a1('0x4f')]={};}return _0x444f8e;};}exports['getUsers']=function(_0x4dd222,_0x1a2371,_0x2d1cb2){var _0x2c1701=[];return db['User']['findAll']({'where':{'role':[_0x55a1('0x52'),_0x55a1('0x53'),_0x55a1('0x54')]},'attributes':['id',_0x55a1('0x55'),'name',_0x55a1('0x56'),_0x55a1('0x57'),_0x55a1('0x58'),_0x55a1('0x59'),_0x55a1('0x5a'),_0x55a1('0x5b'),_0x55a1('0x5c')],'order':qs[_0x55a1('0x3a')]('-online'),'include':[{'model':db[_0x55a1('0x5d')],'as':_0x55a1('0x5e'),'attributes':['id',_0x55a1('0x2a'),_0x55a1('0x2f')],'through':{'attributes':[]}}]})[_0x55a1('0x26')](function(_0x2fa356){if(_0x2fa356){var _0x3a17ad=_0x4dd222[_0x55a1('0x54')][_0x55a1('0x4c')]({'plain':!![]});if(!_0x3a17ad)throw new Error(_0x55a1('0x5f'));if(_0x3a17ad[_0x55a1('0x56')]===_0x55a1('0x54')){return db[_0x55a1('0x60')][_0x55a1('0x4a')]({'where':{'name':_0x55a1('0x61'),'userProfileId':_0x3a17ad[_0x55a1('0x62')]},'raw':!![]})['then'](function(_0x51027b){if(_0x51027b){if(_0x51027b[_0x55a1('0x63')]===0x0){return db[_0x55a1('0x64')][_0x55a1('0x42')]({'where':{'sectionId':_0x51027b['id']},'raw':!![]})[_0x55a1('0x26')](function(_0x5d026e){var _0x40d598=[];if(_['isEmpty'](_0x5d026e)){_0x40d598=_['filter'](_0x2fa356,function(_0x6b21f1){if(_0x6b21f1[_0x55a1('0x56')]!=='agent'){return _0x6b21f1;}});return _0x40d598;}else{for(var _0x17dda6=0x0;_0x17dda6<_0x2fa356[_0x55a1('0x37')];_0x17dda6++){var _0x291791=_0x2fa356[_0x17dda6];if(_0x291791[_0x55a1('0x56')]===_0x55a1('0x52')){var _0x1e6872=_[_0x55a1('0x4a')](_0x5d026e,function(_0x4fc50f){return _0x4fc50f[_0x55a1('0x65')]===_0x291791['id'];});if(_0x1e6872)_0x40d598[_0x55a1('0x66')](_0x291791);}else{_0x40d598[_0x55a1('0x66')](_0x291791);}}return _0x40d598;}});}else{return _0x2fa356;}}else{var _0x465f5e=_[_0x55a1('0x3c')](_0x2fa356,function(_0x1a2805){if(_0x1a2805[_0x55a1('0x56')]!==_0x55a1('0x52')){return _0x1a2805;}});return _0x465f5e;}});}else{return _0x2fa356;}}})[_0x55a1('0x26')](function(_0x51a4fc){var _0xa1779b=[];if(_0x51a4fc){_0x2c1701=_0x51a4fc;for(var _0x392fb1=0x0;_0x392fb1<_0x51a4fc[_0x55a1('0x37')];_0x392fb1+=0x1){_0x2c1701[_0x392fb1]['messages']=[];_0xa1779b['push'](db['ChatInternalMessage'][_0x55a1('0x4a')]({'where':{'FromId':[_0x4dd222[_0x55a1('0x54')]['id'],_0x51a4fc[_0x392fb1]['id']],'ToId':[_0x4dd222['user']['id'],_0x51a4fc[_0x392fb1]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x55a1('0x67'),_0x55a1('0x68'),_0x55a1('0x69'),'body'],'order':qs['sort'](_0x55a1('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x51a4fc[_0x392fb1])));}return BPromise[_0x55a1('0x6b')](_0xa1779b);}return[];})[_0x55a1('0x26')](function(_0x20f406){return{'rows':_0x20f406,'count':_0x20f406['length']};})[_0x55a1('0x26')](respondWithResult(_0x1a2371,null))[_0x55a1('0x46')](handleError(_0x1a2371,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 8a587f5..b07b9cc 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 _0xfaf6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','ChatInternalMessage'];(function(_0x57923a,_0xf2a3df){var _0x4ea5e6=function(_0x438e07){while(--_0x438e07){_0x57923a['push'](_0x57923a['shift']());}};_0x4ea5e6(++_0xf2a3df);}(_0xfaf6,0xcd));var _0x6faf=function(_0x382e51,_0x508172){_0x382e51=_0x382e51-0x0;var _0x1dbe60=_0xfaf6[_0x382e51];return _0x1dbe60;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x6faf('0x0'))['db'][_0x6faf('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6faf('0x2')](0x0);var events={'afterCreate':_0x6faf('0x3'),'afterUpdate':_0x6faf('0x4'),'afterDestroy':_0x6faf('0x5')};function emitEvent(_0x48a72e){return function(_0x49745b,_0x1d8c3e,_0x111a35){ChatInternalMessageEvents[_0x6faf('0x6')](_0x48a72e+':'+_0x49745b['id'],_0x49745b);ChatInternalMessageEvents[_0x6faf('0x6')](_0x48a72e,_0x49745b);_0x111a35(null);};}for(var e in events){if(events[_0x6faf('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x6faf('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x0129=['remove','emit','hook','exports','events','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0129,0x100));var _0x9012=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0129[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x9012('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x9012('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x9012('0x2')](0x0);var events={'afterCreate':_0x9012('0x3'),'afterUpdate':_0x9012('0x4'),'afterDestroy':_0x9012('0x5')};function emitEvent(_0x12f852){return function(_0x4651e9,_0xd40bc9,_0x67e89f){ChatInternalMessageEvents[_0x9012('0x6')](_0x12f852+':'+_0x4651e9['id'],_0x4651e9);ChatInternalMessageEvents[_0x9012('0x6')](_0x12f852,_0x4651e9);_0x67e89f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x9012('0x7')](e,emitEvent(event));}}module[_0x9012('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 16a98d5..fe4f364 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 _0x1362=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','ChatInternalMessage'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1362,0x199));var _0x2136=function(_0x4e6de5,_0x32c309){_0x4e6de5=_0x4e6de5-0x0;var _0x4bc896=_0x1362[_0x4e6de5];return _0x4bc896;};'use strict';var _=require(_0x2136('0x0'));var util=require(_0x2136('0x1'));var logger=require(_0x2136('0x2'))(_0x2136('0x3'));var moment=require(_0x2136('0x4'));var BPromise=require('bluebird');var rp=require(_0x2136('0x5'));var fs=require('fs');var path=require(_0x2136('0x6'));var rimraf=require(_0x2136('0x7'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x2136('0x8')]=function(_0x34960d,_0x4da212){return _0x34960d[_0x2136('0x9')](_0x2136('0xa'),attributes,{'tableName':_0x2136('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2136('0xc'),'collate':_0x2136('0xd')});}; \ No newline at end of file +var _0x7de0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage'];(function(_0x2c4216,_0x3ddc64){var _0xe06f00=function(_0xea8d6a){while(--_0xea8d6a){_0x2c4216['push'](_0x2c4216['shift']());}};_0xe06f00(++_0x3ddc64);}(_0x7de0,0x1ad));var _0x07de=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x7de0[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x07de('0x0'));var util=require(_0x07de('0x1'));var logger=require(_0x07de('0x2'))(_0x07de('0x3'));var moment=require(_0x07de('0x4'));var BPromise=require(_0x07de('0x5'));var rp=require(_0x07de('0x6'));var fs=require('fs');var path=require(_0x07de('0x7'));var rimraf=require('rimraf');var config=require(_0x07de('0x8'));var attributes=require(_0x07de('0x9'));module[_0x07de('0xa')]=function(_0x3c4106,_0x364c1c){return _0x3c4106[_0x07de('0xb')](_0x07de('0xc'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index fe89a44..32a2cad 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 _0xb734=['ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xef4ef0,_0x3c72f9){var _0x39b60b=function(_0x1d824c){while(--_0x1d824c){_0xef4ef0['push'](_0xef4ef0['shift']());}};_0x39b60b(++_0x3c72f9);}(_0xb734,0xe3));var _0x4b73=function(_0x4fa0ea,_0x2cd534){_0x4fa0ea=_0x4fa0ea-0x0;var _0x51d027=_0xb734[_0x4fa0ea];return _0x51d027;};'use strict';var _=require(_0x4b73('0x0'));var util=require(_0x4b73('0x1'));var moment=require(_0x4b73('0x2'));var BPromise=require(_0x4b73('0x3'));var rs=require(_0x4b73('0x4'));var fs=require('fs');var Redis=require(_0x4b73('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4b73('0x6'));var config=require(_0x4b73('0x7'));var jayson=require(_0x4b73('0x8'));var client=jayson[_0x4b73('0x9')][_0x4b73('0xa')]({'port':0x232a});config[_0x4b73('0xb')]=_[_0x4b73('0xc')](config['redis'],{'host':_0x4b73('0xd'),'port':0x18eb});var socket=require(_0x4b73('0xe'))(new Redis(config['redis']));require(_0x4b73('0xf'))['register'](socket);function respondWithRpcPromise(_0x16d30e,_0x359f34,_0x59f2a4){return new BPromise(function(_0x12aef0,_0x43f5d8){return client[_0x4b73('0x10')](_0x16d30e,_0x59f2a4)[_0x4b73('0x11')](function(_0x226c6d){logger[_0x4b73('0x12')](_0x4b73('0x13'),_0x359f34,_0x4b73('0x14'));logger[_0x4b73('0x15')](_0x4b73('0x16'),_0x359f34,_0x4b73('0x14'),JSON[_0x4b73('0x17')](_0x226c6d));if(_0x226c6d['error']){if(_0x226c6d[_0x4b73('0x18')][_0x4b73('0x19')]===0x1f4){logger['error'](_0x4b73('0x13'),_0x359f34,_0x226c6d[_0x4b73('0x18')]['message']);return _0x43f5d8(_0x226c6d[_0x4b73('0x18')][_0x4b73('0x1a')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x359f34,_0x226c6d[_0x4b73('0x18')][_0x4b73('0x1a')]);return _0x12aef0(_0x226c6d['error']['message']);}else{logger[_0x4b73('0x12')](_0x4b73('0x13'),_0x359f34,'request\x20sent');_0x12aef0(_0x226c6d[_0x4b73('0x1b')][_0x4b73('0x1a')]);}})[_0x4b73('0x1c')](function(_0x379448){logger[_0x4b73('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x359f34,_0x379448);_0x43f5d8(_0x379448);});});} \ No newline at end of file +var _0xa4b7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa4b7,0xbf));var _0x7a4b=function(_0x12b113,_0x18320c){_0x12b113=_0x12b113-0x0;var _0x391e0d=_0xa4b7[_0x12b113];return _0x391e0d;};'use strict';var _=require(_0x7a4b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7a4b('0x1'));var rs=require(_0x7a4b('0x2'));var fs=require('fs');var Redis=require(_0x7a4b('0x3'));var db=require(_0x7a4b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a4b('0x5'))('rpc');var config=require(_0x7a4b('0x6'));var jayson=require(_0x7a4b('0x7'));var client=jayson[_0x7a4b('0x8')][_0x7a4b('0x9')]({'port':0x232a});config[_0x7a4b('0xa')]=_[_0x7a4b('0xb')](config[_0x7a4b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7a4b('0xc'))(new Redis(config[_0x7a4b('0xa')]));require(_0x7a4b('0xd'))[_0x7a4b('0xe')](socket);function respondWithRpcPromise(_0x43ebeb,_0x1eb956,_0x1fd9c2){return new BPromise(function(_0x3bb417,_0x181d29){return client['request'](_0x43ebeb,_0x1fd9c2)['then'](function(_0x4f25a7){logger[_0x7a4b('0xf')](_0x7a4b('0x10'),_0x1eb956,'request\x20sent');logger['debug'](_0x7a4b('0x11'),_0x1eb956,_0x7a4b('0x12'),JSON['stringify'](_0x4f25a7));if(_0x4f25a7[_0x7a4b('0x13')]){if(_0x4f25a7['error'][_0x7a4b('0x14')]===0x1f4){logger[_0x7a4b('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x1eb956,_0x4f25a7[_0x7a4b('0x13')][_0x7a4b('0x15')]);return _0x181d29(_0x4f25a7[_0x7a4b('0x13')]['message']);}logger[_0x7a4b('0x13')](_0x7a4b('0x10'),_0x1eb956,_0x4f25a7[_0x7a4b('0x13')]['message']);return _0x3bb417(_0x4f25a7[_0x7a4b('0x13')]['message']);}else{logger[_0x7a4b('0xf')](_0x7a4b('0x10'),_0x1eb956,_0x7a4b('0x12'));_0x3bb417(_0x4f25a7[_0x7a4b('0x16')]['message']);}})[_0x7a4b('0x17')](function(_0x101f75){logger[_0x7a4b('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x1eb956,_0x101f75);_0x181d29(_0x101f75);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index f62f963..285db2e 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 _0x9531=['update','emit','removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x55bcee,_0x4c64dd){var _0x4756f5=function(_0x33614f){while(--_0x33614f){_0x55bcee['push'](_0x55bcee['shift']());}};_0x4756f5(++_0x4c64dd);}(_0x9531,0x18d));var _0x1953=function(_0x6921a7,_0x21ed78){_0x6921a7=_0x6921a7-0x0;var _0x107765=_0x9531[_0x6921a7];return _0x107765;};'use strict';var ChatInternalMessageEvents=require(_0x1953('0x0'));var events=[_0x1953('0x1'),_0x1953('0x2'),_0x1953('0x3')];function createListener(_0x2f6ddf,_0x55e1ec){return function(_0x394a66){_0x55e1ec[_0x1953('0x4')](_0x2f6ddf,_0x394a66);};}function removeListener(_0x43ab9e,_0x52e0d0){return function(){ChatInternalMessageEvents[_0x1953('0x5')](_0x43ab9e,_0x52e0d0);};}exports['register']=function(_0x397319){for(var _0x37beb9=0x0,_0x190a64=events[_0x1953('0x6')];_0x37beb9<_0x190a64;_0x37beb9++){var _0x4e2286=events[_0x37beb9];var _0x52cf91=createListener(_0x1953('0x7')+_0x4e2286,_0x397319);ChatInternalMessageEvents['on'](_0x4e2286,_0x52cf91);}}; \ No newline at end of file +var _0xda52=['save','remove','emit','removeListener','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x46eaa4,_0xb05645){var _0x32bf42=function(_0x2a35e6){while(--_0x2a35e6){_0x46eaa4['push'](_0x46eaa4['shift']());}};_0x32bf42(++_0xb05645);}(_0xda52,0x185));var _0x2da5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda52[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0x2da5('0x0'));var events=[_0x2da5('0x1'),_0x2da5('0x2'),'update'];function createListener(_0xdca195,_0x5b8d75){return function(_0xbedb75){_0x5b8d75[_0x2da5('0x3')](_0xdca195,_0xbedb75);};}function removeListener(_0x94faaf,_0x57a8ca){return function(){ChatInternalMessageEvents[_0x2da5('0x4')](_0x94faaf,_0x57a8ca);};}exports['register']=function(_0x2339d5){for(var _0x260434=0x0,_0x323a5c=events['length'];_0x260434<_0x323a5c;_0x260434++){var _0x2c0c37=events[_0x260434];var _0x5986dd=createListener(_0x2da5('0x5')+_0x2c0c37,_0x2339d5);ChatInternalMessageEvents['on'](_0x2c0c37,_0x5986dd);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index c67b20d..c4ea37d 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 _0xd6f8=['show','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','/:id'];(function(_0x6f33be,_0x45c176){var _0x1f4b6a=function(_0x3ad21e){while(--_0x3ad21e){_0x6f33be['push'](_0x6f33be['shift']());}};_0x1f4b6a(++_0x45c176);}(_0xd6f8,0x154));var _0x8d6f=function(_0x49d931,_0x121258){_0x49d931=_0x49d931-0x0;var _0x491a2a=_0xd6f8[_0x49d931];return _0x491a2a;};'use strict';var multer=require(_0x8d6f('0x0'));var util=require(_0x8d6f('0x1'));var path=require(_0x8d6f('0x2'));var timeout=require('connect-timeout');var express=require(_0x8d6f('0x3'));var router=express[_0x8d6f('0x4')]();var fs_extra=require(_0x8d6f('0x5'));var auth=require(_0x8d6f('0x6'));var interaction=require(_0x8d6f('0x7'));var config=require(_0x8d6f('0x8'));var controller=require(_0x8d6f('0x9'));router[_0x8d6f('0xa')]('/',auth[_0x8d6f('0xb')](),controller[_0x8d6f('0xc')]);router['get'](_0x8d6f('0xd'),auth[_0x8d6f('0xb')](),controller[_0x8d6f('0xe')]);router['get'](_0x8d6f('0xf'),auth['isAuthenticated'](),controller['getUsers']);router[_0x8d6f('0xa')](_0x8d6f('0x10'),auth[_0x8d6f('0xb')](),controller[_0x8d6f('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',controller[_0x8d6f('0x12')]);router[_0x8d6f('0x13')](_0x8d6f('0x10'),auth['isAuthenticated'](),controller[_0x8d6f('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa8f0=['getUsers','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/users'];(function(_0x4fe406,_0x5a7878){var _0x5ace5f=function(_0x2a7a6c){while(--_0x2a7a6c){_0x4fe406['push'](_0x4fe406['shift']());}};_0x5ace5f(++_0x5a7878);}(_0xa8f0,0x141));var _0x0a8f=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xa8f0[_0x2080a3];return _0x8d7d17;};'use strict';var multer=require(_0x0a8f('0x0'));var util=require(_0x0a8f('0x1'));var path=require(_0x0a8f('0x2'));var timeout=require(_0x0a8f('0x3'));var express=require(_0x0a8f('0x4'));var router=express[_0x0a8f('0x5')]();var fs_extra=require(_0x0a8f('0x6'));var auth=require(_0x0a8f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0a8f('0x8'));var controller=require('./chatInternalMessage.controller');router[_0x0a8f('0x9')]('/',auth['isAuthenticated'](),controller[_0x0a8f('0xa')]);router[_0x0a8f('0x9')](_0x0a8f('0xb'),auth[_0x0a8f('0xc')](),controller[_0x0a8f('0xd')]);router[_0x0a8f('0x9')](_0x0a8f('0xe'),auth['isAuthenticated'](),controller[_0x0a8f('0xf')]);router[_0x0a8f('0x9')](_0x0a8f('0x10'),auth[_0x0a8f('0xc')](),controller[_0x0a8f('0x11')]);router[_0x0a8f('0x12')]('/',auth[_0x0a8f('0xc')](),controller[_0x0a8f('0x13')]);router[_0x0a8f('0x14')](_0x0a8f('0x10'),controller[_0x0a8f('0x15')]);router['delete'](_0x0a8f('0x10'),auth[_0x0a8f('0xc')](),controller[_0x0a8f('0x16')]);module[_0x0a8f('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 63cb061..30a94c6 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 _0xee4e=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x5e8aa3,_0x33c5bf){var _0x1be345=function(_0x443110){while(--_0x443110){_0x5e8aa3['push'](_0x5e8aa3['shift']());}};_0x1be345(++_0x33c5bf);}(_0xee4e,0x122));var _0xeee4=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xee4e[_0x4d8ed9];return _0x1e2140;};'use strict';var Sequelize=require(_0xeee4('0x0'));module[_0xeee4('0x1')]={'body':{'type':Sequelize[_0xeee4('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xeee4('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xeee4('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xeee4('0x4')]('in',_0xeee4('0x5')),'defaultValue':_0xeee4('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xeee4('0x6')]},'providerName':{'type':Sequelize[_0xeee4('0x7')]},'providerResponse':{'type':Sequelize[_0xeee4('0x2')]}}; \ No newline at end of file +var _0xa2cb=['exports','medium','BOOLEAN','ENUM','out','sequelize'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa2cb,0x7d));var _0xba2c=function(_0x28635a,_0xa51d49){_0x28635a=_0x28635a-0x0;var _0x2e8c5b=_0xa2cb[_0x28635a];return _0x2e8c5b;};'use strict';var Sequelize=require(_0xba2c('0x0'));module[_0xba2c('0x1')]={'body':{'type':Sequelize['TEXT'](_0xba2c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xba2c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xba2c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xba2c('0x4')]('in',_0xba2c('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 87dd1cc..c536af2 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 _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','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','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x4dae27,_0x3764ea){var _0x40ec39=function(_0x2966df){while(--_0x2966df){_0x4dae27['push'](_0x4dae27['shift']());}};_0x40ec39(++_0x3764ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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'];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);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));}; \ No newline at end of file +var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','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','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x3d5d4b,_0x183b9d){var _0xcf6ebd=function(_0x122e0c){while(--_0x122e0c){_0x3d5d4b['push'](_0x3d5d4b['shift']());}};_0xcf6ebd(++_0x183b9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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'];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);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 760c9ca..255bb97 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 _0x87b5=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x87b5,0x1b6));var _0x587b=function(_0x2454a5,_0x55e1c3){_0x2454a5=_0x2454a5-0x0;var _0x47ad47=_0x87b5[_0x2454a5];return _0x47ad47;};'use strict';var EventEmitter=require(_0x587b('0x0'));var ChatMessage=require(_0x587b('0x1'))['db'][_0x587b('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x587b('0x3')](0x0);var events={'afterCreate':_0x587b('0x4'),'afterUpdate':_0x587b('0x5'),'afterDestroy':_0x587b('0x6')};function emitEvent(_0x57f99a){return function(_0x1b7b7e,_0x511173,_0xe3a589){ChatMessageEvents[_0x587b('0x7')](_0x57f99a+':'+_0x1b7b7e['id'],_0x1b7b7e);ChatMessageEvents[_0x587b('0x7')](_0x57f99a,_0x1b7b7e);_0xe3a589(null);};}for(var e in events){if(events[_0x587b('0x8')](e)){var event=events[e];ChatMessage[_0x587b('0x9')](e,emitEvent(event));}}module[_0x587b('0xa')]=ChatMessageEvents; \ No newline at end of file +var _0x0b82=['save','emit','hook','exports','events','ChatMessage'];(function(_0x3a9cae,_0x29b84a){var _0x342f94=function(_0x910cdc){while(--_0x910cdc){_0x3a9cae['push'](_0x3a9cae['shift']());}};_0x342f94(++_0x29b84a);}(_0x0b82,0x1c0));var _0x20b8=function(_0x261dac,_0x341e85){_0x261dac=_0x261dac-0x0;var _0x540675=_0x0b82[_0x261dac];return _0x540675;};'use strict';var EventEmitter=require(_0x20b8('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x20b8('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x20b8('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2974b4){return function(_0x2275cd,_0x4bb73e,_0x309b08){ChatMessageEvents[_0x20b8('0x3')](_0x2974b4+':'+_0x2275cd['id'],_0x2275cd);ChatMessageEvents[_0x20b8('0x3')](_0x2974b4,_0x2275cd);_0x309b08(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x20b8('0x4')](e,emitEvent(event));}}module[_0x20b8('0x5')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 8970373..875f08b 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 _0x62ee=['update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x62ee,0xbf));var _0xe62e=function(_0xbe3532,_0x5f2761){_0xbe3532=_0xbe3532-0x0;var _0x53cdee=_0x62ee[_0xbe3532];return _0x53cdee;};'use strict';var _=require(_0xe62e('0x0'));var util=require(_0xe62e('0x1'));var logger=require('../../config/logger')(_0xe62e('0x2'));var moment=require(_0xe62e('0x3'));var BPromise=require(_0xe62e('0x4'));var rp=require(_0xe62e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe62e('0x6'));var config=require(_0xe62e('0x7'));var attributes=require(_0xe62e('0x8'));module[_0xe62e('0x9')]=function(_0x3ad470,_0x5e818b){return _0x3ad470[_0xe62e('0xa')](_0xe62e('0xb'),attributes,{'tableName':_0xe62e('0xc'),'paranoid':![],'indexes':[{'name':_0xe62e('0xd'),'fields':[_0xe62e('0xe')],'type':_0xe62e('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf2cb08,_0x558bff,_0x225ca6){var _0x162030=_0x3ad470[_0xe62e('0x10')];var _0x804c0e=_0xf2cb08[_0xe62e('0x11')]({'plain':!![]});if(_0x804c0e[_0xe62e('0x12')][_0xe62e('0x13')]()==='in'||_0x804c0e[_0xe62e('0x12')][_0xe62e('0x13')]()===_0xe62e('0x14')&&!_0x804c0e[_0xe62e('0x15')]&&!_[_0xe62e('0x16')](_0x804c0e['UserId'])){_0x162030[_0xe62e('0x17')][_0xe62e('0x18')]({'where':{'id':_0x804c0e['ChatInteractionId']}})[_0xe62e('0x19')](function(_0x1dfa7c){if(_0x1dfa7c){_0x1dfa7c[_0xe62e('0x1a')]({'lastMsgAt':_0x804c0e[_0xe62e('0x1b')],'lastMsgDirection':_0x804c0e[_0xe62e('0x12')][_0xe62e('0x13')]()});}})[_0xe62e('0x1c')](function(_0x5a77c5){console['error'](_0x5a77c5);});}_0x225ca6();}},'charset':_0xe62e('0x1d'),'collate':_0xe62e('0x1e')});}; \ No newline at end of file +var _0xad47=['findOne','ChatInteractionId','createdAt','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','ChatInteraction'];(function(_0x5679a9,_0x39d840){var _0x361cd8=function(_0x26a718){while(--_0x26a718){_0x5679a9['push'](_0x5679a9['shift']());}};_0x361cd8(++_0x39d840);}(_0xad47,0xad));var _0x7ad4=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xad47[_0x56916d];return _0x2b7f1f;};'use strict';var _=require(_0x7ad4('0x0'));var util=require(_0x7ad4('0x1'));var logger=require(_0x7ad4('0x2'))(_0x7ad4('0x3'));var moment=require(_0x7ad4('0x4'));var BPromise=require(_0x7ad4('0x5'));var rp=require(_0x7ad4('0x6'));var fs=require('fs');var path=require(_0x7ad4('0x7'));var rimraf=require(_0x7ad4('0x8'));var config=require(_0x7ad4('0x9'));var attributes=require(_0x7ad4('0xa'));module[_0x7ad4('0xb')]=function(_0x1eb29b,_0x1f969d){return _0x1eb29b['define'](_0x7ad4('0xc'),attributes,{'tableName':_0x7ad4('0xd'),'paranoid':![],'indexes':[{'name':_0x7ad4('0xe'),'fields':['body'],'type':_0x7ad4('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b34b0,_0x16989e,_0x32e6d5){var _0x161356=_0x1eb29b[_0x7ad4('0x10')];var _0x3ba7c8=_0x4b34b0['get']({'plain':!![]});if(_0x3ba7c8[_0x7ad4('0x11')][_0x7ad4('0x12')]()==='in'||_0x3ba7c8['direction'][_0x7ad4('0x12')]()==='out'&&!_0x3ba7c8[_0x7ad4('0x13')]&&!_[_0x7ad4('0x14')](_0x3ba7c8[_0x7ad4('0x15')])){_0x161356[_0x7ad4('0x16')][_0x7ad4('0x17')]({'where':{'id':_0x3ba7c8[_0x7ad4('0x18')]}})['then'](function(_0x35fbb3){if(_0x35fbb3){_0x35fbb3['update']({'lastMsgAt':_0x3ba7c8[_0x7ad4('0x19')],'lastMsgDirection':_0x3ba7c8[_0x7ad4('0x11')][_0x7ad4('0x12')]()});}})['catch'](function(_0x1c8d59){console[_0x7ad4('0x1a')](_0x1c8d59);});}_0x32e6d5();}},'charset':'utf8mb4','collate':_0x7ad4('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 55230cb..8bdde68 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 _0xc86e=['jayson/promise','http','redis','localhost','socket.io-emitter','./chatMessage.socket','then','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','ChatMessage,\x20%s,\x20%s','error','message','info','result','catch','ChatMessage','create','options','CreateChatMessage','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x331691,_0xfa0b1){var _0x3a8919=function(_0x547ce5){while(--_0x547ce5){_0x331691['push'](_0x331691['shift']());}};_0x3a8919(++_0xfa0b1);}(_0xc86e,0xd0));var _0xec86=function(_0x251a9d,_0x440fd6){_0x251a9d=_0x251a9d-0x0;var _0xe01ccb=_0xc86e[_0x251a9d];return _0xe01ccb;};'use strict';var _=require(_0xec86('0x0'));var util=require(_0xec86('0x1'));var moment=require('moment');var BPromise=require(_0xec86('0x2'));var rs=require(_0xec86('0x3'));var fs=require('fs');var Redis=require(_0xec86('0x4'));var db=require(_0xec86('0x5'))['db'];var utils=require(_0xec86('0x6'));var logger=require(_0xec86('0x7'))(_0xec86('0x8'));var config=require('../../config/environment');var jayson=require(_0xec86('0x9'));var client=jayson['client'][_0xec86('0xa')]({'port':0x232a});config[_0xec86('0xb')]=_['defaults'](config[_0xec86('0xb')],{'host':_0xec86('0xc'),'port':0x18eb});var socket=require(_0xec86('0xd'))(new Redis(config[_0xec86('0xb')]));require(_0xec86('0xe'))['register'](socket);function respondWithRpcPromise(_0x36c6be,_0x25927c,_0x255c6b){return new BPromise(function(_0x466d6a,_0x2d23e3){return client['request'](_0x36c6be,_0x255c6b)[_0xec86('0xf')](function(_0x50ab19){logger['info']('ChatMessage,\x20%s,\x20%s',_0x25927c,'request\x20sent');logger['debug'](_0xec86('0x10'),_0x25927c,_0xec86('0x11'),JSON[_0xec86('0x12')](_0x50ab19));if(_0x50ab19['error']){if(_0x50ab19['error'][_0xec86('0x13')]===0x1f4){logger['error'](_0xec86('0x14'),_0x25927c,_0x50ab19[_0xec86('0x15')][_0xec86('0x16')]);return _0x2d23e3(_0x50ab19[_0xec86('0x15')]['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x25927c,_0x50ab19[_0xec86('0x15')][_0xec86('0x16')]);return _0x466d6a(_0x50ab19[_0xec86('0x15')][_0xec86('0x16')]);}else{logger[_0xec86('0x17')](_0xec86('0x14'),_0x25927c,_0xec86('0x11'));_0x466d6a(_0x50ab19[_0xec86('0x18')]['message']);}})[_0xec86('0x19')](function(_0x28728a){logger[_0xec86('0x15')](_0xec86('0x14'),_0x25927c,_0x28728a);_0x2d23e3(_0x28728a);});});}exports['CreateChatMessage']=function(_0xd6367f){var _0x2c2b4f=this;return new Promise(function(_0x14ea50,_0x534b25){return db[_0xec86('0x1a')][_0xec86('0x1b')](_0xd6367f['body'],{'raw':_0xd6367f[_0xec86('0x1c')]?_0xd6367f['options']['raw']===undefined?!![]:![]:!![]})[_0xec86('0xf')](function(_0x57be52){logger[_0xec86('0x17')](_0xec86('0x1d'),_0xd6367f);logger[_0xec86('0x1e')](_0xec86('0x1d'),_0xd6367f,JSON['stringify'](_0x57be52));_0x14ea50(_0x57be52);})['catch'](function(_0x20d7d5){logger[_0xec86('0x15')](_0xec86('0x1d'),_0x20d7d5['message'],_0xd6367f);_0x534b25(_0x2c2b4f[_0xec86('0x15')](0x1f4,_0x20d7d5[_0xec86('0x16')]));});});}; \ No newline at end of file +var _0x6b89=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','defaults','redis','localhost','./chatMessage.socket','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','CreateChatMessage','ChatMessage','create','options','raw'];(function(_0x547af,_0x17abff){var _0x22f7f4=function(_0x5f0384){while(--_0x5f0384){_0x547af['push'](_0x547af['shift']());}};_0x22f7f4(++_0x17abff);}(_0x6b89,0x186));var _0x96b8=function(_0x1526da,_0x552b95){_0x1526da=_0x1526da-0x0;var _0x40049a=_0x6b89[_0x1526da];return _0x40049a;};'use strict';var _=require('lodash');var util=require(_0x96b8('0x0'));var moment=require(_0x96b8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96b8('0x2'));var db=require(_0x96b8('0x3'))['db'];var utils=require(_0x96b8('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x96b8('0x5'));var jayson=require(_0x96b8('0x6'));var client=jayson['client'][_0x96b8('0x7')]({'port':0x232a});config['redis']=_[_0x96b8('0x8')](config[_0x96b8('0x9')],{'host':_0x96b8('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x96b8('0xb'))['register'](socket);function respondWithRpcPromise(_0x3824a4,_0x3e6237,_0x3d331c){return new BPromise(function(_0x23d805,_0x47d6aa){return client[_0x96b8('0xc')](_0x3824a4,_0x3d331c)[_0x96b8('0xd')](function(_0x17883a){logger['info'](_0x96b8('0xe'),_0x3e6237,_0x96b8('0xf'));logger[_0x96b8('0x10')](_0x96b8('0x11'),_0x3e6237,'request\x20sent',JSON[_0x96b8('0x12')](_0x17883a));if(_0x17883a['error']){if(_0x17883a['error'][_0x96b8('0x13')]===0x1f4){logger[_0x96b8('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3e6237,_0x17883a[_0x96b8('0x14')][_0x96b8('0x15')]);return _0x47d6aa(_0x17883a['error']['message']);}logger[_0x96b8('0x14')](_0x96b8('0xe'),_0x3e6237,_0x17883a[_0x96b8('0x14')][_0x96b8('0x15')]);return _0x23d805(_0x17883a['error'][_0x96b8('0x15')]);}else{logger[_0x96b8('0x16')](_0x96b8('0xe'),_0x3e6237,_0x96b8('0xf'));_0x23d805(_0x17883a[_0x96b8('0x17')]['message']);}})[_0x96b8('0x18')](function(_0x36af6e){logger[_0x96b8('0x14')](_0x96b8('0xe'),_0x3e6237,_0x36af6e);_0x47d6aa(_0x36af6e);});});}exports[_0x96b8('0x19')]=function(_0x41dd91){var _0x29fe7d=this;return new Promise(function(_0x1624d6,_0xab29d6){return db[_0x96b8('0x1a')][_0x96b8('0x1b')](_0x41dd91['body'],{'raw':_0x41dd91[_0x96b8('0x1c')]?_0x41dd91[_0x96b8('0x1c')][_0x96b8('0x1d')]===undefined?!![]:![]:!![]})[_0x96b8('0xd')](function(_0x1a428b){logger[_0x96b8('0x16')](_0x96b8('0x19'),_0x41dd91);logger['debug'](_0x96b8('0x19'),_0x41dd91,JSON[_0x96b8('0x12')](_0x1a428b));_0x1624d6(_0x1a428b);})[_0x96b8('0x18')](function(_0x4ddccb){logger[_0x96b8('0x14')](_0x96b8('0x19'),_0x4ddccb[_0x96b8('0x15')],_0x41dd91);_0xab29d6(_0x29fe7d['error'](0x1f4,_0x4ddccb['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 451819a..b955cbd 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 _0x90b5=['chatMessage:','./chatMessage.events','remove','update','register','length'];(function(_0x5082d1,_0x4d7cd8){var _0x3adedc=function(_0x12ac9a){while(--_0x12ac9a){_0x5082d1['push'](_0x5082d1['shift']());}};_0x3adedc(++_0x4d7cd8);}(_0x90b5,0x139));var _0x590b=function(_0x678c26,_0x16b906){_0x678c26=_0x678c26-0x0;var _0x565724=_0x90b5[_0x678c26];return _0x565724;};'use strict';var ChatMessageEvents=require(_0x590b('0x0'));var events=['save',_0x590b('0x1'),_0x590b('0x2')];function createListener(_0xf402e8,_0xa7594d){return function(_0x5dd1b2){_0xa7594d['emit'](_0xf402e8,_0x5dd1b2);};}function removeListener(_0x2318b8,_0x27e96f){return function(){ChatMessageEvents['removeListener'](_0x2318b8,_0x27e96f);};}exports[_0x590b('0x3')]=function(_0x2059e4){for(var _0x88a5f9=0x0,_0x5e54fe=events[_0x590b('0x4')];_0x88a5f9<_0x5e54fe;_0x88a5f9++){var _0x3663a0=events[_0x88a5f9];var _0x3ec156=createListener(_0x590b('0x5')+_0x3663a0,_0x2059e4);ChatMessageEvents['on'](_0x3663a0,_0x3ec156);}}; \ No newline at end of file +var _0x39d9=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x5903a8,_0x4ce508){var _0x5a5b08=function(_0x1bcb6c){while(--_0x1bcb6c){_0x5903a8['push'](_0x5903a8['shift']());}};_0x5a5b08(++_0x4ce508);}(_0x39d9,0x17f));var _0x939d=function(_0x334282,_0x1339fd){_0x334282=_0x334282-0x0;var _0xc94768=_0x39d9[_0x334282];return _0xc94768;};'use strict';var ChatMessageEvents=require(_0x939d('0x0'));var events=[_0x939d('0x1'),_0x939d('0x2'),_0x939d('0x3')];function createListener(_0x3834f0,_0x201b6a){return function(_0x367c79){_0x201b6a[_0x939d('0x4')](_0x3834f0,_0x367c79);};}function removeListener(_0x57ab6c,_0x2a9e29){return function(){ChatMessageEvents[_0x939d('0x5')](_0x57ab6c,_0x2a9e29);};}exports[_0x939d('0x6')]=function(_0x48b22f){for(var _0x41c89f=0x0,_0x537fd2=events[_0x939d('0x7')];_0x41c89f<_0x537fd2;_0x41c89f++){var _0x1bac28=events[_0x41c89f];var _0x20546a=createListener(_0x939d('0x8')+_0x1bac28,_0x48b22f);ChatMessageEvents['on'](_0x1bac28,_0x20546a);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index be98cdc..9dc4ef6 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 _0x8e54=['isAuthenticated','index','describe','/:id','show','post','tracked','chat','create','put','update','reject','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x8e54,0x123));var _0x48e5=function(_0x9cde2,_0xe718b8){_0x9cde2=_0x9cde2-0x0;var _0x23e68e=_0x8e54[_0x9cde2];return _0x23e68e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x48e5('0x0'));var express=require(_0x48e5('0x1'));var router=express[_0x48e5('0x2')]();var fs_extra=require(_0x48e5('0x3'));var auth=require(_0x48e5('0x4'));var interaction=require(_0x48e5('0x5'));var config=require(_0x48e5('0x6'));var controller=require('./chatMessage.controller');router[_0x48e5('0x7')]('/',auth[_0x48e5('0x8')](),controller[_0x48e5('0x9')]);router[_0x48e5('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x48e5('0xa')]);router[_0x48e5('0x7')](_0x48e5('0xb'),auth['isAuthenticated'](),controller[_0x48e5('0xc')]);router[_0x48e5('0xd')]('/',auth[_0x48e5('0x8')](),interaction[_0x48e5('0xe')](_0x48e5('0xf'),'chatmessage:create'),controller[_0x48e5('0x10')]);router[_0x48e5('0x11')](_0x48e5('0xb'),controller[_0x48e5('0x12')]);router[_0x48e5('0x11')]('/:id/accept',auth[_0x48e5('0x8')](),controller['accept']);router[_0x48e5('0x11')]('/:id/reject',auth[_0x48e5('0x8')](),controller[_0x48e5('0x13')]);router[_0x48e5('0x14')](_0x48e5('0xb'),auth[_0x48e5('0x8')](),controller[_0x48e5('0x15')]);module[_0x48e5('0x16')]=router; \ No newline at end of file +var _0x569a=['show','post','chat','chatmessage:create','create','update','put','accept','reject','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','index','/describe','describe','isAuthenticated'];(function(_0x5b0c36,_0x5c9219){var _0x4e8312=function(_0x2c6ce8){while(--_0x2c6ce8){_0x5b0c36['push'](_0x5b0c36['shift']());}};_0x4e8312(++_0x5c9219);}(_0x569a,0xd3));var _0xa569=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x569a[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xa569('0x0'));var util=require(_0xa569('0x1'));var path=require('path');var timeout=require(_0xa569('0x2'));var express=require(_0xa569('0x3'));var router=express[_0xa569('0x4')]();var fs_extra=require(_0xa569('0x5'));var auth=require(_0xa569('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa569('0x7'));var controller=require(_0xa569('0x8'));router[_0xa569('0x9')]('/',auth['isAuthenticated'](),controller[_0xa569('0xa')]);router[_0xa569('0x9')](_0xa569('0xb'),auth['isAuthenticated'](),controller[_0xa569('0xc')]);router[_0xa569('0x9')]('/:id',auth[_0xa569('0xd')](),controller[_0xa569('0xe')]);router[_0xa569('0xf')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xa569('0x10'),_0xa569('0x11')),controller[_0xa569('0x12')]);router['put']('/:id',controller[_0xa569('0x13')]);router[_0xa569('0x14')]('/:id/accept',auth[_0xa569('0xd')](),controller[_0xa569('0x15')]);router[_0xa569('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0xa569('0x16')]);router['delete']('/:id',auth[_0xa569('0xd')](),controller[_0xa569('0x17')]);module[_0xa569('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 8ffb6a5..262df50 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 _0xbbe6=['exports','sequelize'];(function(_0x406fb7,_0x28a9ed){var _0x236234=function(_0x4b4b43){while(--_0x4b4b43){_0x406fb7['push'](_0x406fb7['shift']());}};_0x236234(++_0x28a9ed);}(_0xbbe6,0x125));var _0x6bbe=function(_0xa528e5,_0xfbf573){_0xa528e5=_0xa528e5-0x0;var _0x43923c=_0xbbe6[_0xa528e5];return _0x43923c;};'use strict';var Sequelize=require(_0x6bbe('0x0'));module[_0x6bbe('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x1433=['TEXT','medium','sequelize','exports'];(function(_0x2caf32,_0x35c5d8){var _0xa8587d=function(_0xaf6feb){while(--_0xaf6feb){_0x2caf32['push'](_0x2caf32['shift']());}};_0xa8587d(++_0x35c5d8);}(_0x1433,0x152));var _0x3143=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1433[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x3143('0x0'));module[_0x3143('0x1')]={'body':{'type':Sequelize[_0x3143('0x2')](_0x3143('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index ce6078c..aae4f34 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x7a54,0x106));var _0x47a5=function(_0x25bfcc,_0x44d635){_0x25bfcc=_0x25bfcc-0x0;var _0x268179=_0x7a54[_0x25bfcc];return _0x268179;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x4935b8,_0x35b34a){var _0x63d1d2=function(_0x3ead8b){while(--_0x3ead8b){_0x4935b8['push'](_0x4935b8['shift']());}};_0x63d1d2(++_0x35b34a);}(_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 diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 4b29950..7df076b 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 _0xd4de=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5e9c1c,_0x4532be){var _0x192fbe=function(_0x4d0c93){while(--_0x4d0c93){_0x5e9c1c['push'](_0x5e9c1c['shift']());}};_0x192fbe(++_0x4532be);}(_0xd4de,0x173));var _0xed4d=function(_0x9456d4,_0x2300dc){_0x9456d4=_0x9456d4-0x0;var _0x32b95e=_0xd4de[_0x9456d4];return _0x32b95e;};'use strict';var _=require('lodash');var util=require(_0xed4d('0x0'));var logger=require(_0xed4d('0x1'))('api');var moment=require('moment');var BPromise=require(_0xed4d('0x2'));var rp=require(_0xed4d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed4d('0x4'));var config=require(_0xed4d('0x5'));var attributes=require(_0xed4d('0x6'));module[_0xed4d('0x7')]=function(_0x192309,_0x4e25e3){return _0x192309[_0xed4d('0x8')](_0xed4d('0x9'),attributes,{'tableName':_0xed4d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xed4d('0xb'),'collate':_0xed4d('0xc')});}; \ No newline at end of file +var _0xb96d=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x39c846,_0x444606){var _0x1c696a=function(_0x760648){while(--_0x760648){_0x39c846['push'](_0x39c846['shift']());}};_0x1c696a(++_0x444606);}(_0xb96d,0xa1));var _0xdb96=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xb96d[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0xdb96('0x0'));var util=require('util');var logger=require(_0xdb96('0x1'))(_0xdb96('0x2'));var moment=require(_0xdb96('0x3'));var BPromise=require(_0xdb96('0x4'));var rp=require(_0xdb96('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb96('0x6'));var config=require('../../config/environment');var attributes=require(_0xdb96('0x7'));module[_0xdb96('0x8')]=function(_0x4e84cb,_0x5bbce8){return _0x4e84cb[_0xdb96('0x9')](_0xdb96('0xa'),attributes,{'tableName':_0xdb96('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb96('0xc'),'collate':_0xdb96('0xd')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 0e3afa8..0fe566d 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 _0x61d7=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1170f1,_0x20bda0){var _0x534c52=function(_0x189f22){while(--_0x189f22){_0x1170f1['push'](_0x1170f1['shift']());}};_0x534c52(++_0x20bda0);}(_0x61d7,0x1dd));var _0x761d=function(_0x4e08f6,_0x52999e){_0x4e08f6=_0x4e08f6-0x0;var _0x795ff7=_0x61d7[_0x4e08f6];return _0x795ff7;};'use strict';var _=require('lodash');var util=require(_0x761d('0x0'));var moment=require(_0x761d('0x1'));var BPromise=require(_0x761d('0x2'));var rs=require(_0x761d('0x3'));var fs=require('fs');var Redis=require(_0x761d('0x4'));var db=require(_0x761d('0x5'))['db'];var utils=require(_0x761d('0x6'));var logger=require(_0x761d('0x7'))(_0x761d('0x8'));var config=require(_0x761d('0x9'));var jayson=require(_0x761d('0xa'));var client=jayson[_0x761d('0xb')][_0x761d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5684fb,_0x4091d5,_0x28b077){return new BPromise(function(_0x4ba88f,_0x405b8b){return client[_0x761d('0xd')](_0x5684fb,_0x28b077)[_0x761d('0xe')](function(_0x21026a){logger[_0x761d('0xf')](_0x761d('0x10'),_0x4091d5,_0x761d('0x11'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x4091d5,_0x761d('0x11'),JSON[_0x761d('0x12')](_0x21026a));if(_0x21026a[_0x761d('0x13')]){if(_0x21026a['error'][_0x761d('0x14')]===0x1f4){logger['error'](_0x761d('0x10'),_0x4091d5,_0x21026a[_0x761d('0x13')][_0x761d('0x15')]);return _0x405b8b(_0x21026a[_0x761d('0x13')][_0x761d('0x15')]);}logger[_0x761d('0x13')](_0x761d('0x10'),_0x4091d5,_0x21026a[_0x761d('0x13')][_0x761d('0x15')]);return _0x4ba88f(_0x21026a[_0x761d('0x13')][_0x761d('0x15')]);}else{logger[_0x761d('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4091d5,'request\x20sent');_0x4ba88f(_0x21026a['result'][_0x761d('0x15')]);}})[_0x761d('0x16')](function(_0x542a54){logger[_0x761d('0x13')](_0x761d('0x10'),_0x4091d5,_0x542a54);_0x405b8b(_0x542a54);});});} \ No newline at end of file +var _0x772d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','util'];(function(_0x2b8d9e,_0x38f52a){var _0x380e14=function(_0xfc9680){while(--_0xfc9680){_0x2b8d9e['push'](_0x2b8d9e['shift']());}};_0x380e14(++_0x38f52a);}(_0x772d,0x197));var _0xd772=function(_0x360896,_0x594187){_0x360896=_0x360896-0x0;var _0x43515c=_0x772d[_0x360896];return _0x43515c;};'use strict';var _=require('lodash');var util=require(_0xd772('0x0'));var moment=require(_0xd772('0x1'));var BPromise=require(_0xd772('0x2'));var rs=require(_0xd772('0x3'));var fs=require('fs');var Redis=require(_0xd772('0x4'));var db=require(_0xd772('0x5'))['db'];var utils=require(_0xd772('0x6'));var logger=require(_0xd772('0x7'))(_0xd772('0x8'));var config=require(_0xd772('0x9'));var jayson=require(_0xd772('0xa'));var client=jayson[_0xd772('0xb')][_0xd772('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x29ce3e,_0x596e75,_0x3a8687){return new BPromise(function(_0xb99ca9,_0x55f068){return client[_0xd772('0xd')](_0x29ce3e,_0x3a8687)['then'](function(_0x3d3807){logger[_0xd772('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x596e75,_0xd772('0xf'));logger[_0xd772('0x10')](_0xd772('0x11'),_0x596e75,'request\x20sent',JSON['stringify'](_0x3d3807));if(_0x3d3807[_0xd772('0x12')]){if(_0x3d3807[_0xd772('0x12')][_0xd772('0x13')]===0x1f4){logger['error'](_0xd772('0x14'),_0x596e75,_0x3d3807[_0xd772('0x12')]['message']);return _0x55f068(_0x3d3807[_0xd772('0x12')][_0xd772('0x15')]);}logger[_0xd772('0x12')](_0xd772('0x14'),_0x596e75,_0x3d3807[_0xd772('0x12')]['message']);return _0xb99ca9(_0x3d3807[_0xd772('0x12')]['message']);}else{logger[_0xd772('0xe')](_0xd772('0x14'),_0x596e75,'request\x20sent');_0xb99ca9(_0x3d3807[_0xd772('0x16')][_0xd772('0x15')]);}})[_0xd772('0x17')](function(_0x22046d){logger[_0xd772('0x12')](_0xd772('0x14'),_0x596e75,_0x22046d);_0x55f068(_0x22046d);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 5cd1b78..7f3f165 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 _0x2ee5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x19f7ad,_0x588cfe){var _0x3b2360=function(_0x478acd){while(--_0x478acd){_0x19f7ad['push'](_0x19f7ad['shift']());}};_0x3b2360(++_0x588cfe);}(_0x2ee5,0x199));var _0x52ee=function(_0x4eab74,_0x38a4ee){_0x4eab74=_0x4eab74-0x0;var _0x125548=_0x2ee5[_0x4eab74];return _0x125548;};'use strict';var multer=require(_0x52ee('0x0'));var util=require(_0x52ee('0x1'));var path=require(_0x52ee('0x2'));var timeout=require(_0x52ee('0x3'));var express=require(_0x52ee('0x4'));var router=express[_0x52ee('0x5')]();var fs_extra=require(_0x52ee('0x6'));var auth=require(_0x52ee('0x7'));var interaction=require(_0x52ee('0x8'));var config=require(_0x52ee('0x9'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x52ee('0xa')](_0x52ee('0xb'),auth[_0x52ee('0xc')](),controller[_0x52ee('0xd')]);router['get']('/:id',auth[_0x52ee('0xc')](),controller[_0x52ee('0xe')]);router[_0x52ee('0xf')]('/',auth[_0x52ee('0xc')](),controller[_0x52ee('0x10')]);router[_0x52ee('0x11')](_0x52ee('0x12'),auth[_0x52ee('0xc')](),controller[_0x52ee('0x13')]);router[_0x52ee('0x14')](_0x52ee('0x12'),auth['isAuthenticated'](),controller[_0x52ee('0x15')]);module[_0x52ee('0x16')]=router; \ No newline at end of file +var _0x2ede=['/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','create'];(function(_0x383ca5,_0x2b899b){var _0x1d80ab=function(_0x175cb9){while(--_0x175cb9){_0x383ca5['push'](_0x383ca5['shift']());}};_0x1d80ab(++_0x2b899b);}(_0x2ede,0x17e));var _0xe2ed=function(_0x2bc066,_0x29aeaa){_0x2bc066=_0x2bc066-0x0;var _0x3b6962=_0x2ede[_0x2bc066];return _0x3b6962;};'use strict';var multer=require(_0xe2ed('0x0'));var util=require(_0xe2ed('0x1'));var path=require(_0xe2ed('0x2'));var timeout=require(_0xe2ed('0x3'));var express=require(_0xe2ed('0x4'));var router=express[_0xe2ed('0x5')]();var fs_extra=require(_0xe2ed('0x6'));var auth=require(_0xe2ed('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe2ed('0x8'));router[_0xe2ed('0x9')]('/',auth[_0xe2ed('0xa')](),controller[_0xe2ed('0xb')]);router[_0xe2ed('0x9')]('/describe',auth[_0xe2ed('0xa')](),controller[_0xe2ed('0xc')]);router[_0xe2ed('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xe2ed('0xa')](),controller[_0xe2ed('0xd')]);router['put'](_0xe2ed('0xe'),auth['isAuthenticated'](),controller[_0xe2ed('0xf')]);router[_0xe2ed('0x10')](_0xe2ed('0xe'),auth[_0xe2ed('0xa')](),controller['destroy']);module[_0xe2ed('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index ba0448c..f610637 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 _0x46a2=['STRING','ENUM','mouseOver','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x46a2,0xf3));var _0x246a=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x46a2[_0x5416db];return _0x243e35;};'use strict';var Sequelize=require('sequelize');module[_0x246a('0x0')]={'name':{'type':Sequelize[_0x246a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x246a('0x2')](_0x246a('0x3'),'timeout'),'defaultValue':_0x246a('0x3')},'selector':{'type':Sequelize[_0x246a('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xfcb0=['exports','ENUM','mouseOver','timeout','STRING','INTEGER','sequelize'];(function(_0xc04991,_0x21336e){var _0x406622=function(_0x2b6bd7){while(--_0x2b6bd7){_0xc04991['push'](_0xc04991['shift']());}};_0x406622(++_0x21336e);}(_0xfcb0,0xbc));var _0x0fcb=function(_0x48b0ae,_0x1cb48d){_0x48b0ae=_0x48b0ae-0x0;var _0x5d4d6d=_0xfcb0[_0x48b0ae];return _0x5d4d6d;};'use strict';var Sequelize=require(_0x0fcb('0x0'));module[_0x0fcb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x0fcb('0x2')](_0x0fcb('0x3'),_0x0fcb('0x4')),'defaultValue':_0x0fcb('0x3')},'selector':{'type':Sequelize[_0x0fcb('0x5')]},'timeout':{'type':Sequelize[_0x0fcb('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 76c4f91..c23dc30 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 _0x304b=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','destroy','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x304b,0xfb));var _0xb304=function(_0x1c4459,_0x4cde43){_0x1c4459=_0x1c4459-0x0;var _0x238195=_0x304b[_0x1c4459];return _0x238195;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb304('0x0'));var zipdir=require(_0xb304('0x1'));var jsonpatch=require(_0xb304('0x2'));var rp=require(_0xb304('0x3'));var moment=require(_0xb304('0x4'));var BPromise=require(_0xb304('0x5'));var Mustache=require(_0xb304('0x6'));var util=require(_0xb304('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb304('0x8'));var ejs=require(_0xb304('0x9'));var fs=require('fs');var fs_extra=require(_0xb304('0xa'));var _=require(_0xb304('0xb'));var squel=require(_0xb304('0xc'));var crypto=require(_0xb304('0xd'));var jsforce=require(_0xb304('0xe'));var deskjs=require(_0xb304('0xf'));var toCsv=require(_0xb304('0x8'));var querystring=require('querystring');var Papa=require(_0xb304('0x10'));var Redis=require(_0xb304('0x11'));var authService=require(_0xb304('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb304('0x13'));var hardwareService=require(_0xb304('0x14'));var logger=require(_0xb304('0x15'))(_0xb304('0x16'));var utils=require(_0xb304('0x17'));var config=require(_0xb304('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb304('0x19'))['db'];function respondWithStatusCode(_0x1f4ddb,_0x2f8cae){_0x2f8cae=_0x2f8cae||0xcc;return function(_0x743f7d){if(_0x743f7d){return _0x1f4ddb['sendStatus'](_0x2f8cae);}return _0x1f4ddb[_0xb304('0x1a')](_0x2f8cae)[_0xb304('0x1b')]();};}function respondWithResult(_0x733030,_0x44b7a7){_0x44b7a7=_0x44b7a7||0xc8;return function(_0x1ba608){if(_0x1ba608){return _0x733030[_0xb304('0x1a')](_0x44b7a7)[_0xb304('0x1c')](_0x1ba608);}};}function respondWithFilteredResult(_0x1a15c9,_0x218d92){return function(_0x22ac4b){if(_0x22ac4b){var _0x3d20b5=typeof _0x218d92[_0xb304('0x1d')]===_0xb304('0x1e')&&typeof _0x218d92['limit']===_0xb304('0x1e');var _0x5166c5=_0x22ac4b['count'];var _0x79ca93=_0x3d20b5?0x0:_0x218d92[_0xb304('0x1d')];var _0x45f368=_0x3d20b5?_0x22ac4b[_0xb304('0x1f')]:_0x218d92[_0xb304('0x1d')]+_0x218d92['limit'];var _0x272b37;if(_0x45f368>=_0x5166c5){_0x45f368=_0x5166c5;_0x272b37=0xc8;}else{_0x272b37=0xce;}_0x1a15c9['status'](_0x272b37);return _0x1a15c9[_0xb304('0x20')](_0xb304('0x21'),_0x79ca93+'-'+_0x45f368+'/'+_0x5166c5)['json'](_0x22ac4b);}return null;};}function patchUpdates(_0x49d49e){return function(_0x586394){try{jsonpatch[_0xb304('0x22')](_0x586394,_0x49d49e,!![]);}catch(_0x1dab9e){return BPromise[_0xb304('0x23')](_0x1dab9e);}return _0x586394[_0xb304('0x24')]();};}function saveUpdates(_0x5cf81a,_0x218b9d){return function(_0x3694c4){if(_0x3694c4){return _0x3694c4[_0xb304('0x25')](_0x5cf81a)[_0xb304('0x26')](function(_0x4f10ab){return _0x4f10ab;});}return null;};}function removeEntity(_0x5802d5,_0x4ab7ed){return function(_0x2fd41b){if(_0x2fd41b){return _0x2fd41b['destroy']()[_0xb304('0x26')](function(){_0x5802d5['status'](0xcc)[_0xb304('0x1b')]();});}};}function handleEntityNotFound(_0x148f48,_0x2b5271){return function(_0x4de541){if(!_0x4de541){_0x148f48[_0xb304('0x27')](0x194);}return _0x4de541;};}function handleError(_0x4fcf90,_0x36444d){_0x36444d=_0x36444d||0x1f4;return function(_0x4f46d2){logger[_0xb304('0x28')](_0x4f46d2[_0xb304('0x29')]);if(_0x4f46d2['name']){delete _0x4f46d2['name'];}_0x4fcf90[_0xb304('0x1a')](_0x36444d)[_0xb304('0x2a')](_0x4f46d2);};}exports[_0xb304('0x2b')]=function(_0xdfe560,_0x1d468d){var _0x19ecc6={'raw':!![],'where':{'id':_0xdfe560[_0xb304('0x2c')]['id']}},_0x36af11={};_0x36af11[_0xb304('0x2d')]=_[_0xb304('0x2e')](db['ChatProactiveAction'][_0xb304('0x2f')]);_0x36af11[_0xb304('0x30')]=_['keys'](_0xdfe560['query']);_0x36af11[_0xb304('0x31')]=_[_0xb304('0x32')](_0x36af11[_0xb304('0x2d')],_0x36af11['query']);_0x19ecc6[_0xb304('0x33')]=_[_0xb304('0x32')](_0x36af11['model'],qs[_0xb304('0x34')](_0xdfe560[_0xb304('0x30')][_0xb304('0x34')]));_0x19ecc6[_0xb304('0x33')]=_0x19ecc6[_0xb304('0x33')]['length']?_0x19ecc6[_0xb304('0x33')]:_0x36af11[_0xb304('0x2d')];if(_0xdfe560[_0xb304('0x30')][_0xb304('0x35')]){_0x19ecc6[_0xb304('0x36')]=[{'all':!![]}];}_0x19ecc6=_[_0xb304('0x37')]({},_0x19ecc6,_0xdfe560[_0xb304('0x38')]);return db[_0xb304('0x39')][_0xb304('0x3a')](_0x19ecc6)[_0xb304('0x26')](handleEntityNotFound(_0x1d468d,null))[_0xb304('0x26')](respondWithResult(_0x1d468d,null))[_0xb304('0x3b')](handleError(_0x1d468d,null));};exports[_0xb304('0x3c')]=function(_0xddb57a,_0x273300){return db[_0xb304('0x39')][_0xb304('0x3c')](_0xddb57a[_0xb304('0x3d')],{})['then'](respondWithResult(_0x273300,0xc9))[_0xb304('0x3b')](handleError(_0x273300,null));};exports[_0xb304('0x25')]=function(_0x48715b,_0x3c81ec){if(_0x48715b['body']['id']){delete _0x48715b[_0xb304('0x3d')]['id'];}return db[_0xb304('0x39')][_0xb304('0x3a')]({'where':{'id':_0x48715b[_0xb304('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3c81ec,null))[_0xb304('0x26')](saveUpdates(_0x48715b['body'],null))['then'](respondWithResult(_0x3c81ec,null))[_0xb304('0x3b')](handleError(_0x3c81ec,null));};exports[_0xb304('0x3e')]=function(_0x1d6edd,_0x510748){return db['ChatProactiveAction'][_0xb304('0x3a')]({'where':{'id':_0x1d6edd[_0xb304('0x2c')]['id']}})[_0xb304('0x26')](handleEntityNotFound(_0x510748,null))[_0xb304('0x26')](removeEntity(_0x510748,null))[_0xb304('0x3b')](handleError(_0x510748,null));}; \ No newline at end of file +var _0x9b67=['keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','merge','create','body','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','params','model'];(function(_0x2d1bf0,_0x147ba2){var _0x3e1b7b=function(_0x44de80){while(--_0x44de80){_0x2d1bf0['push'](_0x2d1bf0['shift']());}};_0x3e1b7b(++_0x147ba2);}(_0x9b67,0xf6));var _0x79b6=function(_0x3fd453,_0x5972f7){_0x3fd453=_0x3fd453-0x0;var _0x55e571=_0x9b67[_0x3fd453];return _0x55e571;};'use strict';var emlformat=require(_0x79b6('0x0'));var rimraf=require(_0x79b6('0x1'));var zipdir=require(_0x79b6('0x2'));var jsonpatch=require(_0x79b6('0x3'));var rp=require(_0x79b6('0x4'));var moment=require('moment');var BPromise=require(_0x79b6('0x5'));var Mustache=require(_0x79b6('0x6'));var util=require('util');var path=require('path');var sox=require(_0x79b6('0x7'));var csv=require(_0x79b6('0x8'));var ejs=require(_0x79b6('0x9'));var fs=require('fs');var fs_extra=require(_0x79b6('0xa'));var _=require(_0x79b6('0xb'));var squel=require(_0x79b6('0xc'));var crypto=require(_0x79b6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x79b6('0xe'));var toCsv=require(_0x79b6('0x8'));var querystring=require(_0x79b6('0xf'));var Papa=require(_0x79b6('0x10'));var Redis=require(_0x79b6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x79b6('0x12'));var as=require(_0x79b6('0x13'));var hardwareService=require(_0x79b6('0x14'));var logger=require(_0x79b6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x79b6('0x16'));var licenseUtil=require(_0x79b6('0x17'));var db=require(_0x79b6('0x18'))['db'];function respondWithStatusCode(_0x526727,_0xc05a77){_0xc05a77=_0xc05a77||0xcc;return function(_0x2df08d){if(_0x2df08d){return _0x526727[_0x79b6('0x19')](_0xc05a77);}return _0x526727[_0x79b6('0x1a')](_0xc05a77)[_0x79b6('0x1b')]();};}function respondWithResult(_0x40478d,_0x19d5b2){_0x19d5b2=_0x19d5b2||0xc8;return function(_0x3ef1fa){if(_0x3ef1fa){return _0x40478d[_0x79b6('0x1a')](_0x19d5b2)[_0x79b6('0x1c')](_0x3ef1fa);}};}function respondWithFilteredResult(_0x2ac966,_0x3563cc){return function(_0x1e8bf1){if(_0x1e8bf1){var _0x4cf491=typeof _0x3563cc[_0x79b6('0x1d')]===_0x79b6('0x1e')&&typeof _0x3563cc[_0x79b6('0x1f')]===_0x79b6('0x1e');var _0x2a8788=_0x1e8bf1[_0x79b6('0x20')];var _0x131bc5=_0x4cf491?0x0:_0x3563cc[_0x79b6('0x1d')];var _0x3ff583=_0x4cf491?_0x1e8bf1[_0x79b6('0x20')]:_0x3563cc[_0x79b6('0x1d')]+_0x3563cc[_0x79b6('0x1f')];var _0x1361f6;if(_0x3ff583>=_0x2a8788){_0x3ff583=_0x2a8788;_0x1361f6=0xc8;}else{_0x1361f6=0xce;}_0x2ac966['status'](_0x1361f6);return _0x2ac966[_0x79b6('0x21')]('Content-Range',_0x131bc5+'-'+_0x3ff583+'/'+_0x2a8788)[_0x79b6('0x1c')](_0x1e8bf1);}return null;};}function patchUpdates(_0x532e65){return function(_0x28b9c2){try{jsonpatch[_0x79b6('0x22')](_0x28b9c2,_0x532e65,!![]);}catch(_0x299bed){return BPromise['reject'](_0x299bed);}return _0x28b9c2[_0x79b6('0x23')]();};}function saveUpdates(_0x30dc0b,_0x53208a){return function(_0x565f86){if(_0x565f86){return _0x565f86[_0x79b6('0x24')](_0x30dc0b)[_0x79b6('0x25')](function(_0x9bd2cc){return _0x9bd2cc;});}return null;};}function removeEntity(_0x268826,_0x3b2a2a){return function(_0x488102){if(_0x488102){return _0x488102[_0x79b6('0x26')]()[_0x79b6('0x25')](function(){_0x268826[_0x79b6('0x1a')](0xcc)[_0x79b6('0x1b')]();});}};}function handleEntityNotFound(_0x4c275d,_0x53c03c){return function(_0x40ef76){if(!_0x40ef76){_0x4c275d[_0x79b6('0x19')](0x194);}return _0x40ef76;};}function handleError(_0x37b01b,_0xc25c99){_0xc25c99=_0xc25c99||0x1f4;return function(_0x4adf15){logger[_0x79b6('0x27')](_0x4adf15['stack']);if(_0x4adf15[_0x79b6('0x28')]){delete _0x4adf15[_0x79b6('0x28')];}_0x37b01b[_0x79b6('0x1a')](_0xc25c99)[_0x79b6('0x29')](_0x4adf15);};}exports['show']=function(_0x1484e5,_0x310832){var _0x53b463={'raw':!![],'where':{'id':_0x1484e5[_0x79b6('0x2a')]['id']}},_0x158221={};_0x158221[_0x79b6('0x2b')]=_[_0x79b6('0x2c')](db[_0x79b6('0x2d')][_0x79b6('0x2e')]);_0x158221['query']=_[_0x79b6('0x2c')](_0x1484e5[_0x79b6('0x2f')]);_0x158221[_0x79b6('0x30')]=_[_0x79b6('0x31')](_0x158221[_0x79b6('0x2b')],_0x158221[_0x79b6('0x2f')]);_0x53b463['attributes']=_[_0x79b6('0x31')](_0x158221[_0x79b6('0x2b')],qs[_0x79b6('0x32')](_0x1484e5['query']['fields']));_0x53b463[_0x79b6('0x33')]=_0x53b463[_0x79b6('0x33')][_0x79b6('0x34')]?_0x53b463[_0x79b6('0x33')]:_0x158221[_0x79b6('0x2b')];if(_0x1484e5[_0x79b6('0x2f')]['includeAll']){_0x53b463['include']=[{'all':!![]}];}_0x53b463=_[_0x79b6('0x35')]({},_0x53b463,_0x1484e5['options']);return db[_0x79b6('0x2d')]['find'](_0x53b463)[_0x79b6('0x25')](handleEntityNotFound(_0x310832,null))[_0x79b6('0x25')](respondWithResult(_0x310832,null))['catch'](handleError(_0x310832,null));};exports[_0x79b6('0x36')]=function(_0x1bb0b6,_0x507d7b){return db[_0x79b6('0x2d')]['create'](_0x1bb0b6[_0x79b6('0x37')],{})[_0x79b6('0x25')](respondWithResult(_0x507d7b,0xc9))[_0x79b6('0x38')](handleError(_0x507d7b,null));};exports[_0x79b6('0x24')]=function(_0x33eeb2,_0x732849){if(_0x33eeb2[_0x79b6('0x37')]['id']){delete _0x33eeb2[_0x79b6('0x37')]['id'];}return db[_0x79b6('0x2d')][_0x79b6('0x39')]({'where':{'id':_0x33eeb2['params']['id']}})['then'](handleEntityNotFound(_0x732849,null))['then'](saveUpdates(_0x33eeb2[_0x79b6('0x37')],null))[_0x79b6('0x25')](respondWithResult(_0x732849,null))['catch'](handleError(_0x732849,null));};exports[_0x79b6('0x26')]=function(_0x483aa8,_0x179a98){return db[_0x79b6('0x2d')][_0x79b6('0x39')]({'where':{'id':_0x483aa8['params']['id']}})[_0x79b6('0x25')](handleEntityNotFound(_0x179a98,null))['then'](removeEntity(_0x179a98,null))[_0x79b6('0x38')](handleError(_0x179a98,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index f110ccf..c7b66dd 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 _0x0062=['bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment'];(function(_0x136307,_0x42a269){var _0x59c19b=function(_0x7537d7){while(--_0x7537d7){_0x136307['push'](_0x136307['shift']());}};_0x59c19b(++_0x42a269);}(_0x0062,0xa5));var _0x2006=function(_0x3de873,_0x174b5f){_0x3de873=_0x3de873-0x0;var _0x380b8c=_0x0062[_0x3de873];return _0x380b8c;};'use strict';var _=require(_0x2006('0x0'));var util=require(_0x2006('0x1'));var logger=require(_0x2006('0x2'))('api');var moment=require(_0x2006('0x3'));var BPromise=require(_0x2006('0x4'));var rp=require(_0x2006('0x5'));var fs=require('fs');var path=require(_0x2006('0x6'));var rimraf=require('rimraf');var config=require(_0x2006('0x7'));var attributes=require(_0x2006('0x8'));module[_0x2006('0x9')]=function(_0x5851a8,_0x4df631){return _0x5851a8[_0x2006('0xa')](_0x2006('0xb'),attributes,{'tableName':_0x2006('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x575b=['../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','api','bluebird','request-promise','rimraf'];(function(_0x87ab2b,_0x10c488){var _0x9e2d6d=function(_0x2e6d66){while(--_0x2e6d66){_0x87ab2b['push'](_0x87ab2b['shift']());}};_0x9e2d6d(++_0x10c488);}(_0x575b,0x11c));var _0xb575=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x575b[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb575('0x0'));var moment=require('moment');var BPromise=require(_0xb575('0x1'));var rp=require(_0xb575('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb575('0x3'));var config=require(_0xb575('0x4'));var attributes=require(_0xb575('0x5'));module[_0xb575('0x6')]=function(_0x3ac6a4,_0x14afbe){return _0x3ac6a4[_0xb575('0x7')]('ChatProactiveAction',attributes,{'tableName':_0xb575('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index d972d59..4d5d82e 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 _0x7514=['request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','code','message','error','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x14dd95,_0x2066e3){var _0x22777d=function(_0x290b2d){while(--_0x290b2d){_0x14dd95['push'](_0x14dd95['shift']());}};_0x22777d(++_0x2066e3);}(_0x7514,0x96));var _0x4751=function(_0x5f4cb7,_0x4ac610){_0x5f4cb7=_0x5f4cb7-0x0;var _0x14ac3c=_0x7514[_0x5f4cb7];return _0x14ac3c;};'use strict';var _=require('lodash');var util=require(_0x4751('0x0'));var moment=require(_0x4751('0x1'));var BPromise=require(_0x4751('0x2'));var rs=require(_0x4751('0x3'));var fs=require('fs');var Redis=require(_0x4751('0x4'));var db=require(_0x4751('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4751('0x6'))(_0x4751('0x7'));var config=require(_0x4751('0x8'));var jayson=require(_0x4751('0x9'));var client=jayson[_0x4751('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x399bed,_0x268360,_0x2517da){return new BPromise(function(_0x2fc521,_0x1054d0){return client[_0x4751('0xb')](_0x399bed,_0x2517da)[_0x4751('0xc')](function(_0x4c2cb7){logger[_0x4751('0xd')](_0x4751('0xe'),_0x268360,_0x4751('0xf'));logger[_0x4751('0x10')](_0x4751('0x11'),_0x268360,_0x4751('0xf'),JSON[_0x4751('0x12')](_0x4c2cb7));if(_0x4c2cb7['error']){if(_0x4c2cb7['error'][_0x4751('0x13')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x268360,_0x4c2cb7['error'][_0x4751('0x14')]);return _0x1054d0(_0x4c2cb7[_0x4751('0x15')]['message']);}logger[_0x4751('0x15')](_0x4751('0xe'),_0x268360,_0x4c2cb7[_0x4751('0x15')]['message']);return _0x2fc521(_0x4c2cb7[_0x4751('0x15')][_0x4751('0x14')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x268360,'request\x20sent');_0x2fc521(_0x4c2cb7['result'][_0x4751('0x14')]);}})[_0x4751('0x16')](function(_0x59c792){logger[_0x4751('0x15')](_0x4751('0xe'),_0x268360,_0x59c792);_0x1054d0(_0x59c792);});});} \ No newline at end of file +var _0x97e1=['rpc','../../config/environment','jayson/promise','client','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x272d90,_0x5e70ff){var _0x2bf4a2=function(_0x544da6){while(--_0x544da6){_0x272d90['push'](_0x272d90['shift']());}};_0x2bf4a2(++_0x5e70ff);}(_0x97e1,0x176));var _0x197e=function(_0x46a671,_0x758e9a){_0x46a671=_0x46a671-0x0;var _0x526d75=_0x97e1[_0x46a671];return _0x526d75;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x197e('0x0'));var rs=require(_0x197e('0x1'));var fs=require('fs');var Redis=require(_0x197e('0x2'));var db=require(_0x197e('0x3'))['db'];var utils=require(_0x197e('0x4'));var logger=require(_0x197e('0x5'))(_0x197e('0x6'));var config=require(_0x197e('0x7'));var jayson=require(_0x197e('0x8'));var client=jayson[_0x197e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28ebe8,_0x4904bb,_0x24d58a){return new BPromise(function(_0x4cf5fb,_0x1cdc3f){return client[_0x197e('0xa')](_0x28ebe8,_0x24d58a)['then'](function(_0x84c22c){logger[_0x197e('0xb')](_0x197e('0xc'),_0x4904bb,_0x197e('0xd'));logger['debug'](_0x197e('0xe'),_0x4904bb,_0x197e('0xd'),JSON[_0x197e('0xf')](_0x84c22c));if(_0x84c22c[_0x197e('0x10')]){if(_0x84c22c[_0x197e('0x10')]['code']===0x1f4){logger[_0x197e('0x10')](_0x197e('0xc'),_0x4904bb,_0x84c22c[_0x197e('0x10')][_0x197e('0x11')]);return _0x1cdc3f(_0x84c22c[_0x197e('0x10')]['message']);}logger[_0x197e('0x10')](_0x197e('0xc'),_0x4904bb,_0x84c22c[_0x197e('0x10')]['message']);return _0x4cf5fb(_0x84c22c[_0x197e('0x10')][_0x197e('0x11')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x4904bb,'request\x20sent');_0x4cf5fb(_0x84c22c[_0x197e('0x12')][_0x197e('0x11')]);}})[_0x197e('0x13')](function(_0x12f8c3){logger[_0x197e('0x10')](_0x197e('0xc'),_0x4904bb,_0x12f8c3);_0x1cdc3f(_0x12f8c3);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index d3afdb5..fea9ba5 100644 --- a/server/api/chatProactiveAction/index.js +++ b/server/api/chatProactiveAction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dfd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x492740,_0x272992){var _0x5bfa06=function(_0x45af17){while(--_0x45af17){_0x492740['push'](_0x492740['shift']());}};_0x5bfa06(++_0x272992);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var fs_extra=require(_0xd7df('0x6'));var auth=require(_0xd7df('0x7'));var interaction=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var controller=require(_0xd7df('0xa'));router[_0xd7df('0xb')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0xe')]);router[_0xd7df('0xf')]('/',auth[_0xd7df('0xd')](),controller['create']);router[_0xd7df('0x10')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0x11')]);router['delete'](_0xd7df('0xc'),auth['isAuthenticated'](),controller[_0xd7df('0x12')]);module['exports']=router; \ No newline at end of file +var _0xeec6=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','put','update','delete','exports'];(function(_0x401d67,_0xeb1592){var _0x25076b=function(_0x233577){while(--_0x233577){_0x401d67['push'](_0x401d67['shift']());}};_0x25076b(++_0xeb1592);}(_0xeec6,0x1c2));var _0x6eec=function(_0x57da0a,_0x284aed){_0x57da0a=_0x57da0a-0x0;var _0x3145d5=_0xeec6[_0x57da0a];return _0x3145d5;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get'](_0x6eec('0xa'),auth[_0x6eec('0xb')](),controller['show']);router[_0x6eec('0xc')]('/',auth[_0x6eec('0xb')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xb')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6eec('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 22119e6..a4d591a 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 _0x2555=['name','ENUM','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x349a9e,_0x473cb8){var _0x24c207=function(_0x22f148){while(--_0x22f148){_0x349a9e['push'](_0x349a9e['shift']());}};_0x24c207(++_0x473cb8);}(_0x2555,0x100));var _0x5255=function(_0x1cfab8,_0x428570){_0x1cfab8=_0x1cfab8-0x0;var _0x10649c=_0x2555[_0x1cfab8];return _0x10649c;};'use strict';var Sequelize=require(_0x5255('0x0'));module[_0x5255('0x1')]={'name':{'type':Sequelize[_0x5255('0x2')],'unique':_0x5255('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5255('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5255('0x4')]('rrmemory',_0x5255('0x5'),_0x5255('0x6'))}}; \ No newline at end of file +var _0xaa4d=['INTEGER','beepall','roundrobin','sequelize','STRING','name'];(function(_0x3d9f47,_0x6a785b){var _0x25797f=function(_0x29e77d){while(--_0x29e77d){_0x3d9f47['push'](_0x3d9f47['shift']());}};_0x25797f(++_0x6a785b);}(_0xaa4d,0x105));var _0xdaa4=function(_0x97ab47,_0x5cdab2){_0x97ab47=_0x97ab47-0x0;var _0x2d291f=_0xaa4d[_0x97ab47];return _0x2d291f;};'use strict';var Sequelize=require(_0xdaa4('0x0'));module['exports']={'name':{'type':Sequelize[_0xdaa4('0x1')],'unique':_0xdaa4('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xdaa4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xdaa4('0x4'),_0xdaa4('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index e5f21a4..3a57fa4 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 _0x56b1=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','json','offset','undefined','limit','count','status','set','save','update','then','get','ChatQueues','UserProfileResource','destroy','sendStatus','stack','name','index','map','ChatQueue','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','includeAll','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','findOne','sort','ChatQueueId','UserChatQueue','UserId','agent','chatPause','createdAt','rows','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Team','User','Agents','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x7d42c9,_0x53721d){var _0x542f15=function(_0x1243d2){while(--_0x1243d2){_0x7d42c9['push'](_0x7d42c9['shift']());}};_0x542f15(++_0x53721d);}(_0x56b1,0x8a));var _0x156b=function(_0x5e6f49,_0x530c3f){_0x5e6f49=_0x5e6f49-0x0;var _0x3bd0ca=_0x56b1[_0x5e6f49];return _0x3bd0ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x156b('0x0'));var zipdir=require(_0x156b('0x1'));var jsonpatch=require(_0x156b('0x2'));var rp=require(_0x156b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x156b('0x4'));var util=require(_0x156b('0x5'));var path=require(_0x156b('0x6'));var sox=require(_0x156b('0x7'));var csv=require(_0x156b('0x8'));var ejs=require(_0x156b('0x9'));var fs=require('fs');var fs_extra=require(_0x156b('0xa'));var _=require(_0x156b('0xb'));var squel=require(_0x156b('0xc'));var crypto=require(_0x156b('0xd'));var jsforce=require(_0x156b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x156b('0x8'));var querystring=require(_0x156b('0xf'));var Papa=require('papaparse');var Redis=require(_0x156b('0x10'));var authService=require(_0x156b('0x11'));var qs=require(_0x156b('0x12'));var as=require(_0x156b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x156b('0x14'));var utils=require(_0x156b('0x15'));var config=require(_0x156b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x156b('0x17'))['db'];config[_0x156b('0x18')]=_[_0x156b('0x19')](config[_0x156b('0x18')],{'host':_0x156b('0x1a'),'port':0x18eb});var socket=require(_0x156b('0x1b'))(new Redis(config['redis']));require(_0x156b('0x1c'))['register'](socket);var jayson=require(_0x156b('0x1d'));var client=jayson[_0x156b('0x1e')][_0x156b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x576e43,_0x311063,_0x26b918,_0x3413ae){return new BPromise(function(_0x58fbb5,_0x454e71){var _0x2c314e=_0x3413ae||client;return _0x2c314e[_0x156b('0x20')](_0x576e43,_0x26b918)['then'](function(_0x45c664){logger[_0x156b('0x21')](_0x156b('0x22'),_0x311063,'request\x20sent');logger[_0x156b('0x23')](_0x156b('0x24'),_0x311063,_0x156b('0x25'),JSON[_0x156b('0x26')](_0x45c664));if(_0x45c664[_0x156b('0x27')]){if(_0x45c664['error'][_0x156b('0x28')]===0x1f4){logger[_0x156b('0x27')](_0x156b('0x22'),_0x311063,_0x45c664[_0x156b('0x27')][_0x156b('0x29')]);return _0x454e71(_0x45c664['error'][_0x156b('0x29')]);}logger[_0x156b('0x27')]('ChatQueue,\x20%s,\x20%s',_0x311063,_0x45c664[_0x156b('0x27')][_0x156b('0x29')]);return _0x58fbb5(_0x45c664[_0x156b('0x27')][_0x156b('0x29')]);}else{logger[_0x156b('0x21')](_0x156b('0x22'),_0x311063,_0x156b('0x25'));_0x58fbb5(_0x45c664[_0x156b('0x2a')][_0x156b('0x29')]);}})[_0x156b('0x2b')](function(_0x46c313){logger['error'](_0x156b('0x22'),_0x311063,_0x46c313);_0x454e71(_0x46c313);});});}function respondWithStatusCode(_0x339a60,_0x323b8f){_0x323b8f=_0x323b8f||0xcc;return function(_0x29fce5){if(_0x29fce5){return _0x339a60['sendStatus'](_0x323b8f);}return _0x339a60['status'](_0x323b8f)[_0x156b('0x2c')]();};}function respondWithResult(_0x579e6f,_0x34f559){_0x34f559=_0x34f559||0xc8;return function(_0x59d68b){if(_0x59d68b){return _0x579e6f['status'](_0x34f559)[_0x156b('0x2d')](_0x59d68b);}};}function respondWithFilteredResult(_0x150245,_0x2c9613){return function(_0x4280e0){if(_0x4280e0){var _0x169215=typeof _0x2c9613[_0x156b('0x2e')]===_0x156b('0x2f')&&typeof _0x2c9613[_0x156b('0x30')]===_0x156b('0x2f');var _0x5e68a3=_0x4280e0['count'];var _0x32d5bd=_0x169215?0x0:_0x2c9613['offset'];var _0x5b4bf0=_0x169215?_0x4280e0[_0x156b('0x31')]:_0x2c9613[_0x156b('0x2e')]+_0x2c9613[_0x156b('0x30')];var _0x17edd4;if(_0x5b4bf0>=_0x5e68a3){_0x5b4bf0=_0x5e68a3;_0x17edd4=0xc8;}else{_0x17edd4=0xce;}_0x150245[_0x156b('0x32')](_0x17edd4);return _0x150245[_0x156b('0x33')]('Content-Range',_0x32d5bd+'-'+_0x5b4bf0+'/'+_0x5e68a3)[_0x156b('0x2d')](_0x4280e0);}return null;};}function patchUpdates(_0x2c7c8b){return function(_0xf1ad83){try{jsonpatch['apply'](_0xf1ad83,_0x2c7c8b,!![]);}catch(_0x5401a6){return BPromise['reject'](_0x5401a6);}return _0xf1ad83[_0x156b('0x34')]();};}function saveUpdates(_0x2e5cdc,_0xafb9b2){return function(_0x9c73c1){if(_0x9c73c1){return _0x9c73c1[_0x156b('0x35')](_0x2e5cdc)[_0x156b('0x36')](function(_0x5a9878){return _0x5a9878;});}return null;};}function removeEntity(_0x131c0e,_0x452f1d){return function(_0x4e790a){if(_0x4e790a){return _0x4e790a['destroy']()[_0x156b('0x36')](function(){var _0x1c7c04=_0x4e790a[_0x156b('0x37')]({'plain':!![]});var _0x86c011=_0x156b('0x38');return db[_0x156b('0x39')][_0x156b('0x3a')]({'where':{'type':_0x86c011,'resourceId':_0x1c7c04['id']}})['then'](function(){return _0x4e790a;});})['then'](function(){_0x131c0e[_0x156b('0x32')](0xcc)[_0x156b('0x2c')]();});}};}function handleEntityNotFound(_0x2bdde4,_0xd9abb9){return function(_0x2abd03){if(!_0x2abd03){_0x2bdde4[_0x156b('0x3b')](0x194);}return _0x2abd03;};}function handleError(_0x310f1c,_0x5859e9){_0x5859e9=_0x5859e9||0x1f4;return function(_0x229422){logger[_0x156b('0x27')](_0x229422[_0x156b('0x3c')]);if(_0x229422[_0x156b('0x3d')]){delete _0x229422['name'];}_0x310f1c[_0x156b('0x32')](_0x5859e9)['send'](_0x229422);};}exports[_0x156b('0x3e')]=function(_0x547aea,_0x1f8979){var _0x23c73e={},_0x7fa674={},_0x4596d5={'count':0x0,'rows':[]};var _0x43a7b4=_[_0x156b('0x3f')](db[_0x156b('0x40')][_0x156b('0x41')],function(_0x8afb19){return{'name':_0x8afb19['fieldName'],'type':_0x8afb19['type'][_0x156b('0x42')]};});_0x7fa674['model']=_['map'](_0x43a7b4,_0x156b('0x3d'));_0x7fa674[_0x156b('0x43')]=_[_0x156b('0x44')](_0x547aea[_0x156b('0x43')]);_0x7fa674[_0x156b('0x45')]=_[_0x156b('0x46')](_0x7fa674[_0x156b('0x47')],_0x7fa674['query']);_0x23c73e[_0x156b('0x48')]=_['intersection'](_0x7fa674['model'],qs['fields'](_0x547aea[_0x156b('0x43')][_0x156b('0x49')]));_0x23c73e['attributes']=_0x23c73e['attributes'][_0x156b('0x4a')]?_0x23c73e[_0x156b('0x48')]:_0x7fa674[_0x156b('0x47')];if(!_0x547aea[_0x156b('0x43')][_0x156b('0x4b')](_0x156b('0x4c'))){_0x23c73e[_0x156b('0x30')]=qs['limit'](_0x547aea[_0x156b('0x43')]['limit']);_0x23c73e[_0x156b('0x2e')]=qs[_0x156b('0x2e')](_0x547aea[_0x156b('0x43')][_0x156b('0x2e')]);}_0x23c73e[_0x156b('0x4d')]=qs['sort'](_0x547aea[_0x156b('0x43')]['sort']);_0x23c73e[_0x156b('0x4e')]=qs[_0x156b('0x45')](_[_0x156b('0x4f')](_0x547aea[_0x156b('0x43')],_0x7fa674['filters']),_0x43a7b4);if(_0x547aea[_0x156b('0x43')][_0x156b('0x50')]){_0x23c73e['where']=_[_0x156b('0x51')](_0x23c73e['where'],{'$or':_['map'](_0x43a7b4,function(_0xfdb654){if(_0xfdb654['type']!==_0x156b('0x52')){var _0x2d0cd3={};_0x2d0cd3[_0xfdb654[_0x156b('0x3d')]]={'$like':'%'+_0x547aea[_0x156b('0x43')]['filter']+'%'};return _0x2d0cd3;}})});}_0x23c73e=_[_0x156b('0x51')]({},_0x23c73e,_0x547aea[_0x156b('0x53')]);var _0x23cfb1={'where':_0x23c73e[_0x156b('0x4e')]};return db[_0x156b('0x40')][_0x156b('0x31')](_0x23cfb1)[_0x156b('0x36')](function(_0x2228b1){_0x4596d5[_0x156b('0x31')]=_0x2228b1;if(_0x547aea[_0x156b('0x43')]['includeAll']){_0x23c73e[_0x156b('0x54')]=[{'all':!![]}];}return db[_0x156b('0x40')][_0x156b('0x55')](_0x23c73e);})['then'](function(_0x3302e1){_0x4596d5['rows']=_0x3302e1;return _0x4596d5;})[_0x156b('0x36')](respondWithFilteredResult(_0x1f8979,_0x23c73e))['catch'](handleError(_0x1f8979,null));};exports[_0x156b('0x56')]=function(_0x37f9fe,_0x56ca92){var _0x4b25f8={'raw':!![],'where':{'id':_0x37f9fe[_0x156b('0x57')]['id']}},_0x377a45={};_0x377a45['model']=_['keys'](db[_0x156b('0x40')][_0x156b('0x41')]);_0x377a45[_0x156b('0x43')]=_['keys'](_0x37f9fe[_0x156b('0x43')]);_0x377a45[_0x156b('0x45')]=_[_0x156b('0x46')](_0x377a45[_0x156b('0x47')],_0x377a45['query']);_0x4b25f8[_0x156b('0x48')]=_[_0x156b('0x46')](_0x377a45[_0x156b('0x47')],qs[_0x156b('0x49')](_0x37f9fe[_0x156b('0x43')][_0x156b('0x49')]));_0x4b25f8['attributes']=_0x4b25f8[_0x156b('0x48')][_0x156b('0x4a')]?_0x4b25f8['attributes']:_0x377a45[_0x156b('0x47')];if(_0x37f9fe['query'][_0x156b('0x58')]){_0x4b25f8[_0x156b('0x54')]=[{'all':!![]}];}_0x4b25f8=_[_0x156b('0x51')]({},_0x4b25f8,_0x37f9fe[_0x156b('0x53')]);return db[_0x156b('0x40')][_0x156b('0x59')](_0x4b25f8)[_0x156b('0x36')](handleEntityNotFound(_0x56ca92,null))[_0x156b('0x36')](respondWithResult(_0x56ca92,null))[_0x156b('0x2b')](handleError(_0x56ca92,null));};exports[_0x156b('0x5a')]=function(_0x24edb1,_0xb30fb4){return db['ChatQueue']['create'](_0x24edb1[_0x156b('0x5b')],{})[_0x156b('0x36')](function(_0x151695){var _0x32a33e=_0x24edb1[_0x156b('0x5c')][_0x156b('0x37')]({'plain':!![]});if(!_0x32a33e)throw new Error(_0x156b('0x5d'));if(_0x32a33e[_0x156b('0x5e')]==='user'){var _0xe5e825=_0x151695[_0x156b('0x37')]({'plain':!![]});var _0x5746ee=_0x156b('0x38');return db[_0x156b('0x5f')][_0x156b('0x59')]({'where':{'name':_0x5746ee,'userProfileId':_0x32a33e[_0x156b('0x60')]},'raw':!![]})['then'](function(_0x1ec433){if(_0x1ec433&&_0x1ec433[_0x156b('0x61')]===0x0){return db[_0x156b('0x39')]['create']({'name':_0xe5e825[_0x156b('0x3d')],'resourceId':_0xe5e825['id'],'type':_0x1ec433[_0x156b('0x3d')],'sectionId':_0x1ec433['id']},{})[_0x156b('0x36')](function(){return _0x151695;});}else{return _0x151695;}})['catch'](function(_0x570ddf){logger['error'](_0x156b('0x62'),_0x570ddf);throw _0x570ddf;});}return _0x151695;})[_0x156b('0x36')](respondWithResult(_0xb30fb4,0xc9))[_0x156b('0x2b')](handleError(_0xb30fb4,null));};exports[_0x156b('0x35')]=function(_0x580bfd,_0x3d0f13){if(_0x580bfd[_0x156b('0x5b')]['id']){delete _0x580bfd[_0x156b('0x5b')]['id'];}return db[_0x156b('0x40')][_0x156b('0x59')]({'where':{'id':_0x580bfd['params']['id']}})[_0x156b('0x36')](handleEntityNotFound(_0x3d0f13,null))['then'](saveUpdates(_0x580bfd['body'],null))[_0x156b('0x36')](respondWithResult(_0x3d0f13,null))[_0x156b('0x2b')](handleError(_0x3d0f13,null));};exports[_0x156b('0x3a')]=function(_0x277c98,_0x441330){return db[_0x156b('0x40')][_0x156b('0x59')]({'where':{'id':_0x277c98[_0x156b('0x57')]['id']}})[_0x156b('0x36')](handleEntityNotFound(_0x441330,null))[_0x156b('0x36')](removeEntity(_0x441330,null))[_0x156b('0x2b')](handleError(_0x441330,null));};exports[_0x156b('0x63')]=function(_0x35fc70,_0x170845){return db[_0x156b('0x40')]['describe']()[_0x156b('0x36')](respondWithResult(_0x170845,null))[_0x156b('0x2b')](handleError(_0x170845,null));};exports['getMembers']=function(_0x453984,_0xe38f0f,_0x282f45){var _0x1c2ff8={'raw':!![],'where':{}},_0x20293f={},_0xa856fc;return db['ChatQueue'][_0x156b('0x64')]({'where':{'id':_0x453984[_0x156b('0x57')]['id']}})[_0x156b('0x36')](handleEntityNotFound(_0xe38f0f,null))[_0x156b('0x36')](function(_0x50d919){if(_0x50d919){_0xa856fc=_0x50d919[_0x156b('0x37')]({'plain':!![]});_0x20293f[_0x156b('0x47')]=_['keys'](db['UserChatQueue'][_0x156b('0x41')]);_0x20293f[_0x156b('0x43')]=_[_0x156b('0x44')](_0x453984[_0x156b('0x43')]);_0x20293f[_0x156b('0x45')]=_['intersection'](_0x20293f[_0x156b('0x47')],_0x20293f[_0x156b('0x43')]);_0x1c2ff8['attributes']=_['intersection'](_0x20293f['model'],qs['fields'](_0x453984[_0x156b('0x43')][_0x156b('0x49')]));_0x1c2ff8[_0x156b('0x48')]=_0x1c2ff8[_0x156b('0x48')][_0x156b('0x4a')]?_0x1c2ff8['attributes']:_0x20293f['model'];if(!_0x453984[_0x156b('0x43')][_0x156b('0x4b')](_0x156b('0x4c'))){_0x1c2ff8[_0x156b('0x30')]=qs[_0x156b('0x30')](_0x453984[_0x156b('0x43')][_0x156b('0x30')]);_0x1c2ff8[_0x156b('0x2e')]=qs['offset'](_0x453984[_0x156b('0x43')][_0x156b('0x2e')]);}_0x1c2ff8[_0x156b('0x4d')]=qs['sort'](_0x453984[_0x156b('0x43')][_0x156b('0x65')]);_0x1c2ff8[_0x156b('0x4e')]=qs['filters'](_[_0x156b('0x4f')](_0x453984[_0x156b('0x43')],_0x20293f[_0x156b('0x45')]));_0x1c2ff8['where'][_0x156b('0x66')]=_0x50d919['id'];if(_0x453984[_0x156b('0x43')][_0x156b('0x50')]){_0x1c2ff8[_0x156b('0x4e')]=_[_0x156b('0x51')](_0x1c2ff8[_0x156b('0x4e')],{'$or':_[_0x156b('0x3f')](_0x1c2ff8[_0x156b('0x48')],function(_0x18ec59){var _0x1c8ba7={};_0x1c8ba7[_0x18ec59]={'$like':'%'+_0x453984[_0x156b('0x43')]['filter']+'%'};return _0x1c8ba7;})});}_0x1c2ff8=_['merge']({},_0x1c2ff8,_0x453984['options']);return db[_0x156b('0x67')][_0x156b('0x55')](_0x1c2ff8);}})['then'](function(_0x5e3e00){if(_0x5e3e00){return db['User']['findAndCountAll']({'where':{'id':_[_0x156b('0x3f')](_0x5e3e00,_0x156b('0x68')),'role':_0x156b('0x69')},'attributes':['id',_0x156b('0x3d'),_0x156b('0x6a'),'updatedAt',_0x156b('0x6b')]});}})['then'](function(_0x55b7c1){if(_0x55b7c1){return{'count':_0x55b7c1[_0x156b('0x31')],'rows':_[_0x156b('0x3f')](_0x55b7c1[_0x156b('0x6c')],function(_0x47a700){return{'membername':_0x47a700[_0x156b('0x3d')],'UserId':_0x47a700['id'],'queue_name':_0xa856fc['name'],'ChatQueueId':_0xa856fc['id'],'interface':util['format'](_0x156b('0x6d'),_0x156b('0x6e'),_0x47a700['name']),'penalty':0x0,'paused':_0x47a700['chatPause'],'createdAt':_0x47a700[_0x156b('0x6b')],'updatedAt':_0x47a700[_0x156b('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x156b('0x36')](respondWithFilteredResult(_0xe38f0f,_0x1c2ff8))['catch'](handleError(_0xe38f0f,null));};exports['getTeams']=function(_0x341634,_0x3afe46,_0x5b0675){var _0x28a492={};var _0x6b0c66={};var _0x507998;var _0xa05f44;return db[_0x156b('0x40')]['findOne']({'where':{'id':_0x341634[_0x156b('0x57')]['id']}})['then'](handleEntityNotFound(_0x3afe46,null))[_0x156b('0x36')](function(_0x536138){if(_0x536138){_0x507998=_0x536138;_0x6b0c66[_0x156b('0x47')]=_[_0x156b('0x44')](db['Team'][_0x156b('0x41')]);_0x6b0c66[_0x156b('0x43')]=_['keys'](_0x341634[_0x156b('0x43')]);_0x6b0c66[_0x156b('0x45')]=_['intersection'](_0x6b0c66[_0x156b('0x47')],_0x6b0c66[_0x156b('0x43')]);_0x28a492[_0x156b('0x48')]=_[_0x156b('0x46')](_0x6b0c66[_0x156b('0x47')],qs['fields'](_0x341634['query']['fields']));_0x28a492[_0x156b('0x48')]=_0x28a492['attributes'][_0x156b('0x4a')]?_0x28a492[_0x156b('0x48')]:_0x6b0c66[_0x156b('0x47')];_0x28a492['order']=qs['sort'](_0x341634[_0x156b('0x43')]['sort']);_0x28a492[_0x156b('0x4e')]=qs['filters'](_[_0x156b('0x4f')](_0x341634['query'],_0x6b0c66[_0x156b('0x45')]));if(_0x341634[_0x156b('0x43')][_0x156b('0x50')]){_0x28a492[_0x156b('0x4e')]=_[_0x156b('0x51')](_0x28a492[_0x156b('0x4e')],{'$or':_['map'](_0x28a492['attributes'],function(_0x14595a){var _0x279d13={};_0x279d13[_0x14595a]={'$like':'%'+_0x341634[_0x156b('0x43')][_0x156b('0x50')]+'%'};return _0x279d13;})});}_0x28a492=_['merge']({},_0x28a492,_0x341634[_0x156b('0x53')]);return _0x507998['getTeams'](_0x28a492);}})[_0x156b('0x36')](function(_0x335ea5){if(_0x335ea5){_0xa05f44=_0x335ea5[_0x156b('0x4a')];if(!_0x341634['query'][_0x156b('0x4b')]('nolimit')){_0x28a492[_0x156b('0x30')]=qs[_0x156b('0x30')](_0x341634[_0x156b('0x43')][_0x156b('0x30')]);_0x28a492['offset']=qs[_0x156b('0x2e')](_0x341634['query'][_0x156b('0x2e')]);}return _0x507998[_0x156b('0x70')](_0x28a492);}})[_0x156b('0x36')](function(_0x22d14c){if(_0x22d14c){return _0x22d14c?{'count':_0xa05f44,'rows':_0x22d14c}:null;}})['then'](respondWithResult(_0x3afe46,null))[_0x156b('0x2b')](handleError(_0x3afe46,null));};exports[_0x156b('0x71')]=function(_0x2d4631,_0x269c0f,_0xcf85cc){var _0x3192b5=_0x2d4631['body'][_0x156b('0x72')];return db[_0x156b('0x73')][_0x156b('0x55')]({'where':{'id':_0x3192b5},'attributes':['id'],'include':[{'model':db[_0x156b('0x74')],'as':_0x156b('0x75'),'attributes':['id',_0x156b('0x3d'),'online',_0x156b('0x76'),_0x156b('0x77')],'raw':!![]}]})[_0x156b('0x36')](function(_0x4b5fed){if(_0x4b5fed){var _0x47c3ed=_[_0x156b('0x78')](_0x4b5fed,function(_0x1c6d82){var _0x4a68cb=_0x1c6d82['get']({'plain':!![]});return _0x4a68cb[_0x156b('0x75')];});return db['ChatQueue'][_0x156b('0x59')]({'where':{'id':_0x2d4631['params']['id']}})[_0x156b('0x36')](function(_0x4e4b08){return db['sequelize'][_0x156b('0x79')](function(_0x5310ae){return _0x4e4b08[_0x156b('0x71')](_0x3192b5,{'transaction':_0x5310ae})['then'](function(){return BPromise[_0x156b('0x7a')](_0x47c3ed,function(_0x2c5d86){return db[_0x156b('0x67')][_0x156b('0x7b')]({'where':{'UserId':_0x2c5d86['id'],'ChatQueueId':_0x2d4631['params']['id']},'transaction':_0x5310ae});});})[_0x156b('0x36')](function(){_0x47c3ed[_0x156b('0x7c')](function(_0x1cea2f){socket['emit'](_0x156b('0x7d'),{'UserId':_0x1cea2f['id'],'ChatQueueId':_0x4e4b08['id']});});});});});}})[_0x156b('0x36')](respondWithStatusCode(_0x269c0f,null))[_0x156b('0x2b')](handleError(_0x269c0f,null));};exports[_0x156b('0x7e')]=function(_0x5daf4a,_0x30e21a,_0x5e09c4){return db[_0x156b('0x73')]['findAll']({'where':{'id':_0x5daf4a[_0x156b('0x43')][_0x156b('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x156b('0x75'),'attributes':['id'],'raw':!![]}]})[_0x156b('0x36')](handleEntityNotFound(_0x30e21a,null))['then'](function(_0x5aed40){var _0x449243=_[_0x156b('0x3f')](_0x5aed40,'id');var _0x5d42b7=[];var _0x44e3b2=[];var _0x988ce4=squel['select']();_0x988ce4[_0x156b('0x7f')](_0x156b('0x80'))[_0x156b('0x81')](_0x156b('0x82'),'tq')[_0x156b('0x83')](_0x156b('0x84'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x156b('0x85'),_0x5daf4a[_0x156b('0x57')]['id']);for(var _0x321abf=0x0;_0x321abf<_0x5aed40[_0x156b('0x4a')];_0x321abf+=0x1){let _0x255f48=_0x5aed40[_0x321abf];for(var _0x40f1bb=0x0;_0x40f1bb<_0x255f48['Agents'][_0x156b('0x4a')];_0x40f1bb+=0x1){let _0x2d79e4=_0x255f48[_0x156b('0x75')][_0x40f1bb];var _0x4c2c7e=_0x988ce4[_0x156b('0x86')]();_0x4c2c7e[_0x156b('0x4e')](_0x156b('0x87'),_0x2d79e4['id']);_0x44e3b2[_0x156b('0x88')](db[_0x156b('0x89')][_0x156b('0x43')](_0x4c2c7e[_0x156b('0x8a')](),{'type':db[_0x156b('0x89')][_0x156b('0x8b')][_0x156b('0x8c')]})[_0x156b('0x36')](function(_0x2118c1){if(_0x2118c1['length']===0x1){return _0x2d79e4['id'];}else{var _0x5aa422=_[_0x156b('0x8d')](_[_0x156b('0x3f')](_0x2118c1,_0x156b('0x8e')),function(_0x31ccb9){return _['includes'](_0x449243,_0x31ccb9);});if(_0x5aa422){return _0x2d79e4['id'];}}}));}}return BPromise[_0x156b('0x8f')](_0x44e3b2)[_0x156b('0x36')](function(_0x47cbc0){_0x5d42b7=_(_0x5d42b7)[_0x156b('0x90')](_0x47cbc0)['compact']()['value']();return db['ChatQueue'][_0x156b('0x59')]({'where':{'id':_0x5daf4a[_0x156b('0x57')]['id']}})[_0x156b('0x36')](function(_0x4dd70e){return db[_0x156b('0x89')][_0x156b('0x79')](function(_0x26eadc){return _0x4dd70e[_0x156b('0x7e')](_0x5daf4a[_0x156b('0x43')][_0x156b('0x72')],{'transaction':_0x26eadc})['then'](function(){if(!_[_0x156b('0x91')](_0x5d42b7)){return _0x4dd70e[_0x156b('0x92')](_0x5d42b7,{'transaction':_0x26eadc});}})['then'](function(){_0x5d42b7[_0x156b('0x7c')](function(_0xe73bc9){socket['emit'](_0x156b('0x93'),{'UserId':_0xe73bc9,'ChatQueueId':_0x4dd70e['id']});});});});});});})[_0x156b('0x36')](respondWithStatusCode(_0x30e21a,null))[_0x156b('0x2b')](handleError(_0x30e21a,null));};exports[_0x156b('0x94')]=function(_0x326cad,_0x51b673,_0x217671){return db[_0x156b('0x40')][_0x156b('0x59')]({'where':{'id':_0x326cad[_0x156b('0x57')]['id']}})[_0x156b('0x36')](handleEntityNotFound(_0x51b673,null))[_0x156b('0x36')](function(_0x3fbb6d){if(_0x3fbb6d){return _0x3fbb6d[_0x156b('0x94')](_0x326cad[_0x156b('0x5b')][_0x156b('0x72')],_[_0x156b('0x95')](_0x326cad[_0x156b('0x5b')],[_0x156b('0x72'),'id'])||{})[_0x156b('0x96')](function(_0x4e47d0){for(var _0x2192ea=0x0;_0x2192ea<_0x326cad[_0x156b('0x5b')][_0x156b('0x72')][_0x156b('0x4a')];_0x2192ea+=0x1){socket[_0x156b('0x97')](_0x156b('0x7d'),{'UserId':Number(_0x326cad[_0x156b('0x5b')][_0x156b('0x72')][_0x2192ea]),'ChatQueueId':Number(_0x326cad[_0x156b('0x57')]['id'])});}return _0x4e47d0;});}})[_0x156b('0x36')](respondWithResult(_0x51b673,null))[_0x156b('0x2b')](handleError(_0x51b673,null));};exports[_0x156b('0x92')]=function(_0x34e90e,_0x272d54,_0x7f9e5e){return db[_0x156b('0x40')]['find']({'where':{'id':_0x34e90e[_0x156b('0x57')]['id']}})['then'](handleEntityNotFound(_0x272d54,null))[_0x156b('0x36')](function(_0x29882f){if(_0x29882f){return _0x29882f[_0x156b('0x92')](_0x34e90e[_0x156b('0x43')][_0x156b('0x72')])[_0x156b('0x36')](function(){if(_[_0x156b('0x98')](_0x34e90e[_0x156b('0x43')][_0x156b('0x72')])){for(var _0x2aa384=0x0;_0x2aa384<_0x34e90e[_0x156b('0x43')][_0x156b('0x72')][_0x156b('0x4a')];_0x2aa384+=0x1){socket[_0x156b('0x97')](_0x156b('0x93'),{'UserId':Number(_0x34e90e[_0x156b('0x43')][_0x156b('0x72')][_0x2aa384]),'ChatQueueId':Number(_0x34e90e[_0x156b('0x57')]['id'])});}}else{socket[_0x156b('0x97')](_0x156b('0x93'),{'UserId':Number(_0x34e90e[_0x156b('0x43')][_0x156b('0x72')]),'ChatQueueId':Number(_0x34e90e[_0x156b('0x57')]['id'])});}});}})[_0x156b('0x36')](respondWithStatusCode(_0x272d54,null))['catch'](handleError(_0x272d54,null));};exports[_0x156b('0x99')]=function(_0x399eb1,_0x4c9979,_0x5b0942){var _0x2c7409={};var _0x4affbc={};var _0x2c6b76;var _0x256534;return db[_0x156b('0x40')][_0x156b('0x64')]({'where':{'id':_0x399eb1['params']['id']}})['then'](handleEntityNotFound(_0x4c9979,null))['then'](function(_0x410cd1){if(_0x410cd1){_0x2c6b76=_0x410cd1;_0x4affbc[_0x156b('0x47')]=_[_0x156b('0x44')](db[_0x156b('0x74')]['rawAttributes']);_0x4affbc[_0x156b('0x43')]=_[_0x156b('0x44')](_0x399eb1[_0x156b('0x43')]);_0x4affbc[_0x156b('0x45')]=_[_0x156b('0x46')](_0x4affbc['model'],_0x4affbc[_0x156b('0x43')]);_0x2c7409[_0x156b('0x48')]=_[_0x156b('0x46')](_0x4affbc['model'],qs['fields'](_0x399eb1[_0x156b('0x43')]['fields']));_0x2c7409['attributes']=_0x2c7409[_0x156b('0x48')]['length']?_0x2c7409['attributes']:_0x4affbc[_0x156b('0x47')];_0x2c7409[_0x156b('0x4d')]=qs[_0x156b('0x65')](_0x399eb1[_0x156b('0x43')][_0x156b('0x65')]);_0x2c7409[_0x156b('0x4e')]=qs['filters'](_[_0x156b('0x4f')](_0x399eb1[_0x156b('0x43')],_0x4affbc[_0x156b('0x45')]));if(_0x399eb1['query']['filter']){_0x2c7409[_0x156b('0x4e')]=_['merge'](_0x2c7409[_0x156b('0x4e')],{'$or':_['map'](_0x2c7409[_0x156b('0x48')],function(_0x4eca7a){var _0x319f4c={};_0x319f4c[_0x4eca7a]={'$like':'%'+_0x399eb1[_0x156b('0x43')]['filter']+'%'};return _0x319f4c;})});}_0x2c7409=_[_0x156b('0x51')]({},_0x2c7409,_0x399eb1[_0x156b('0x53')]);return _0x2c6b76[_0x156b('0x99')](_0x2c7409);}})['then'](function(_0x572a4a){if(_0x572a4a){_0x256534=_0x572a4a[_0x156b('0x4a')];if(!_0x399eb1[_0x156b('0x43')][_0x156b('0x4b')](_0x156b('0x4c'))){_0x2c7409['limit']=qs[_0x156b('0x30')](_0x399eb1['query'][_0x156b('0x30')]);_0x2c7409[_0x156b('0x2e')]=qs[_0x156b('0x2e')](_0x399eb1[_0x156b('0x43')][_0x156b('0x2e')]);}return _0x2c6b76[_0x156b('0x99')](_0x2c7409);}})[_0x156b('0x36')](function(_0x519c4a){if(_0x519c4a){return _0x519c4a?{'count':_0x256534,'rows':_0x519c4a}:null;}})['then'](respondWithResult(_0x4c9979,null))[_0x156b('0x2b')](handleError(_0x4c9979,null));}; \ No newline at end of file +var _0xeaf0=['apply','reject','save','update','get','ChatQueues','UserProfileResource','end','sendStatus','name','index','map','ChatQueue','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','findOne','fields','order','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','online','voicePause','flatMap','Agents','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','ids','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','json','offset','limit','count','Content-Range'];(function(_0x1a08d5,_0x25a039){var _0x1aabc4=function(_0x3cd7b7){while(--_0x3cd7b7){_0x1a08d5['push'](_0x1a08d5['shift']());}};_0x1aabc4(++_0x25a039);}(_0xeaf0,0xfd));var _0x0eaf=function(_0x6d948e,_0x240e7c){_0x6d948e=_0x6d948e-0x0;var _0x1affc4=_0xeaf0[_0x6d948e];return _0x1affc4;};'use strict';var emlformat=require(_0x0eaf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0eaf('0x1'));var rp=require(_0x0eaf('0x2'));var moment=require(_0x0eaf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0eaf('0x4'));var util=require(_0x0eaf('0x5'));var path=require(_0x0eaf('0x6'));var sox=require('sox');var csv=require(_0x0eaf('0x7'));var ejs=require(_0x0eaf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0eaf('0x9'));var squel=require(_0x0eaf('0xa'));var crypto=require(_0x0eaf('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0eaf('0x7'));var querystring=require('querystring');var Papa=require(_0x0eaf('0xc'));var Redis=require(_0x0eaf('0xd'));var authService=require(_0x0eaf('0xe'));var qs=require(_0x0eaf('0xf'));var as=require(_0x0eaf('0x10'));var hardwareService=require(_0x0eaf('0x11'));var logger=require(_0x0eaf('0x12'))(_0x0eaf('0x13'));var utils=require(_0x0eaf('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0eaf('0x15'));var db=require(_0x0eaf('0x16'))['db'];config['redis']=_[_0x0eaf('0x17')](config[_0x0eaf('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x0eaf('0x19'))(new Redis(config['redis']));require(_0x0eaf('0x1a'))[_0x0eaf('0x1b')](socket);var jayson=require(_0x0eaf('0x1c'));var client=jayson[_0x0eaf('0x1d')][_0x0eaf('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x512537,_0xc41490,_0x485d99,_0x362fa7){return new BPromise(function(_0x2624d7,_0x35814c){var _0x3a8967=_0x362fa7||client;return _0x3a8967[_0x0eaf('0x1f')](_0x512537,_0x485d99)[_0x0eaf('0x20')](function(_0x1837ae){logger[_0x0eaf('0x21')](_0x0eaf('0x22'),_0xc41490,_0x0eaf('0x23'));logger['debug'](_0x0eaf('0x24'),_0xc41490,_0x0eaf('0x23'),JSON[_0x0eaf('0x25')](_0x1837ae));if(_0x1837ae[_0x0eaf('0x26')]){if(_0x1837ae[_0x0eaf('0x26')]['code']===0x1f4){logger[_0x0eaf('0x26')](_0x0eaf('0x22'),_0xc41490,_0x1837ae[_0x0eaf('0x26')][_0x0eaf('0x27')]);return _0x35814c(_0x1837ae[_0x0eaf('0x26')][_0x0eaf('0x27')]);}logger[_0x0eaf('0x26')](_0x0eaf('0x22'),_0xc41490,_0x1837ae[_0x0eaf('0x26')][_0x0eaf('0x27')]);return _0x2624d7(_0x1837ae[_0x0eaf('0x26')][_0x0eaf('0x27')]);}else{logger[_0x0eaf('0x21')](_0x0eaf('0x22'),_0xc41490,'request\x20sent');_0x2624d7(_0x1837ae['result'][_0x0eaf('0x27')]);}})[_0x0eaf('0x28')](function(_0x34e34a){logger['error']('ChatQueue,\x20%s,\x20%s',_0xc41490,_0x34e34a);_0x35814c(_0x34e34a);});});}function respondWithStatusCode(_0x59369d,_0x1a5728){_0x1a5728=_0x1a5728||0xcc;return function(_0x3ccab9){if(_0x3ccab9){return _0x59369d['sendStatus'](_0x1a5728);}return _0x59369d[_0x0eaf('0x29')](_0x1a5728)['end']();};}function respondWithResult(_0x4089bb,_0x5df3f2){_0x5df3f2=_0x5df3f2||0xc8;return function(_0x5e8789){if(_0x5e8789){return _0x4089bb['status'](_0x5df3f2)[_0x0eaf('0x2a')](_0x5e8789);}};}function respondWithFilteredResult(_0x336910,_0x4feee3){return function(_0x36a6aa){if(_0x36a6aa){var _0xec5a20=typeof _0x4feee3[_0x0eaf('0x2b')]==='undefined'&&typeof _0x4feee3[_0x0eaf('0x2c')]==='undefined';var _0x58d938=_0x36a6aa['count'];var _0x4947e4=_0xec5a20?0x0:_0x4feee3[_0x0eaf('0x2b')];var _0x3223d7=_0xec5a20?_0x36a6aa[_0x0eaf('0x2d')]:_0x4feee3[_0x0eaf('0x2b')]+_0x4feee3[_0x0eaf('0x2c')];var _0x10cf3c;if(_0x3223d7>=_0x58d938){_0x3223d7=_0x58d938;_0x10cf3c=0xc8;}else{_0x10cf3c=0xce;}_0x336910[_0x0eaf('0x29')](_0x10cf3c);return _0x336910['set'](_0x0eaf('0x2e'),_0x4947e4+'-'+_0x3223d7+'/'+_0x58d938)[_0x0eaf('0x2a')](_0x36a6aa);}return null;};}function patchUpdates(_0x3e10e0){return function(_0x467bbf){try{jsonpatch[_0x0eaf('0x2f')](_0x467bbf,_0x3e10e0,!![]);}catch(_0x594dc4){return BPromise[_0x0eaf('0x30')](_0x594dc4);}return _0x467bbf[_0x0eaf('0x31')]();};}function saveUpdates(_0x8008fb,_0x284084){return function(_0x32b4bb){if(_0x32b4bb){return _0x32b4bb[_0x0eaf('0x32')](_0x8008fb)[_0x0eaf('0x20')](function(_0x5d58ed){return _0x5d58ed;});}return null;};}function removeEntity(_0x57fd85,_0x94d5f6){return function(_0x56a0e9){if(_0x56a0e9){return _0x56a0e9['destroy']()[_0x0eaf('0x20')](function(){var _0xd96225=_0x56a0e9[_0x0eaf('0x33')]({'plain':!![]});var _0x2c9380=_0x0eaf('0x34');return db[_0x0eaf('0x35')]['destroy']({'where':{'type':_0x2c9380,'resourceId':_0xd96225['id']}})[_0x0eaf('0x20')](function(){return _0x56a0e9;});})['then'](function(){_0x57fd85[_0x0eaf('0x29')](0xcc)[_0x0eaf('0x36')]();});}};}function handleEntityNotFound(_0x30638b,_0x1ec81f){return function(_0x308c0a){if(!_0x308c0a){_0x30638b[_0x0eaf('0x37')](0x194);}return _0x308c0a;};}function handleError(_0x20f8fc,_0x245ee5){_0x245ee5=_0x245ee5||0x1f4;return function(_0x29306a){logger[_0x0eaf('0x26')](_0x29306a['stack']);if(_0x29306a[_0x0eaf('0x38')]){delete _0x29306a[_0x0eaf('0x38')];}_0x20f8fc[_0x0eaf('0x29')](_0x245ee5)['send'](_0x29306a);};}exports[_0x0eaf('0x39')]=function(_0x4d4a6c,_0x298056){var _0x3a72c4={},_0x5af79e={},_0x46364a={'count':0x0,'rows':[]};var _0x26da9a=_[_0x0eaf('0x3a')](db[_0x0eaf('0x3b')][_0x0eaf('0x3c')],function(_0x1b4c3e){return{'name':_0x1b4c3e[_0x0eaf('0x3d')],'type':_0x1b4c3e[_0x0eaf('0x3e')]['key']};});_0x5af79e['model']=_[_0x0eaf('0x3a')](_0x26da9a,_0x0eaf('0x38'));_0x5af79e[_0x0eaf('0x3f')]=_['keys'](_0x4d4a6c[_0x0eaf('0x3f')]);_0x5af79e[_0x0eaf('0x40')]=_[_0x0eaf('0x41')](_0x5af79e[_0x0eaf('0x42')],_0x5af79e[_0x0eaf('0x3f')]);_0x3a72c4[_0x0eaf('0x43')]=_[_0x0eaf('0x41')](_0x5af79e[_0x0eaf('0x42')],qs['fields'](_0x4d4a6c[_0x0eaf('0x3f')]['fields']));_0x3a72c4[_0x0eaf('0x43')]=_0x3a72c4[_0x0eaf('0x43')]['length']?_0x3a72c4[_0x0eaf('0x43')]:_0x5af79e[_0x0eaf('0x42')];if(!_0x4d4a6c[_0x0eaf('0x3f')][_0x0eaf('0x44')](_0x0eaf('0x45'))){_0x3a72c4['limit']=qs['limit'](_0x4d4a6c[_0x0eaf('0x3f')][_0x0eaf('0x2c')]);_0x3a72c4[_0x0eaf('0x2b')]=qs[_0x0eaf('0x2b')](_0x4d4a6c[_0x0eaf('0x3f')]['offset']);}_0x3a72c4['order']=qs[_0x0eaf('0x46')](_0x4d4a6c[_0x0eaf('0x3f')][_0x0eaf('0x46')]);_0x3a72c4[_0x0eaf('0x47')]=qs['filters'](_[_0x0eaf('0x48')](_0x4d4a6c[_0x0eaf('0x3f')],_0x5af79e[_0x0eaf('0x40')]),_0x26da9a);if(_0x4d4a6c[_0x0eaf('0x3f')][_0x0eaf('0x49')]){_0x3a72c4['where']=_[_0x0eaf('0x4a')](_0x3a72c4[_0x0eaf('0x47')],{'$or':_['map'](_0x26da9a,function(_0x5ae95f){if(_0x5ae95f['type']!=='VIRTUAL'){var _0x53639b={};_0x53639b[_0x5ae95f[_0x0eaf('0x38')]]={'$like':'%'+_0x4d4a6c[_0x0eaf('0x3f')]['filter']+'%'};return _0x53639b;}})});}_0x3a72c4=_[_0x0eaf('0x4a')]({},_0x3a72c4,_0x4d4a6c[_0x0eaf('0x4b')]);var _0x4873da={'where':_0x3a72c4['where']};return db[_0x0eaf('0x3b')][_0x0eaf('0x2d')](_0x4873da)['then'](function(_0x2e2871){_0x46364a['count']=_0x2e2871;if(_0x4d4a6c[_0x0eaf('0x3f')][_0x0eaf('0x4c')]){_0x3a72c4[_0x0eaf('0x4d')]=[{'all':!![]}];}return db['ChatQueue'][_0x0eaf('0x4e')](_0x3a72c4);})['then'](function(_0x17eb4d){_0x46364a['rows']=_0x17eb4d;return _0x46364a;})[_0x0eaf('0x20')](respondWithFilteredResult(_0x298056,_0x3a72c4))[_0x0eaf('0x28')](handleError(_0x298056,null));};exports[_0x0eaf('0x4f')]=function(_0x35c45f,_0x26e1b0){var _0xac32f0={'raw':!![],'where':{'id':_0x35c45f[_0x0eaf('0x50')]['id']}},_0x4fd72a={};_0x4fd72a['model']=_[_0x0eaf('0x51')](db[_0x0eaf('0x3b')][_0x0eaf('0x3c')]);_0x4fd72a[_0x0eaf('0x3f')]=_[_0x0eaf('0x51')](_0x35c45f[_0x0eaf('0x3f')]);_0x4fd72a[_0x0eaf('0x40')]=_[_0x0eaf('0x41')](_0x4fd72a['model'],_0x4fd72a[_0x0eaf('0x3f')]);_0xac32f0[_0x0eaf('0x43')]=_[_0x0eaf('0x41')](_0x4fd72a[_0x0eaf('0x42')],qs['fields'](_0x35c45f[_0x0eaf('0x3f')]['fields']));_0xac32f0[_0x0eaf('0x43')]=_0xac32f0[_0x0eaf('0x43')][_0x0eaf('0x52')]?_0xac32f0[_0x0eaf('0x43')]:_0x4fd72a['model'];if(_0x35c45f[_0x0eaf('0x3f')][_0x0eaf('0x4c')]){_0xac32f0[_0x0eaf('0x4d')]=[{'all':!![]}];}_0xac32f0=_[_0x0eaf('0x4a')]({},_0xac32f0,_0x35c45f[_0x0eaf('0x4b')]);return db[_0x0eaf('0x3b')][_0x0eaf('0x53')](_0xac32f0)[_0x0eaf('0x20')](handleEntityNotFound(_0x26e1b0,null))[_0x0eaf('0x20')](respondWithResult(_0x26e1b0,null))[_0x0eaf('0x28')](handleError(_0x26e1b0,null));};exports[_0x0eaf('0x54')]=function(_0x4f23b7,_0x42ba8d){return db[_0x0eaf('0x3b')][_0x0eaf('0x54')](_0x4f23b7[_0x0eaf('0x55')],{})[_0x0eaf('0x20')](function(_0x502045){var _0x4d7844=_0x4f23b7[_0x0eaf('0x56')][_0x0eaf('0x33')]({'plain':!![]});if(!_0x4d7844)throw new Error(_0x0eaf('0x57'));if(_0x4d7844[_0x0eaf('0x58')]===_0x0eaf('0x56')){var _0x211d10=_0x502045[_0x0eaf('0x33')]({'plain':!![]});var _0x35fa53=_0x0eaf('0x34');return db[_0x0eaf('0x59')]['find']({'where':{'name':_0x35fa53,'userProfileId':_0x4d7844[_0x0eaf('0x5a')]},'raw':!![]})['then'](function(_0x2e6b4f){if(_0x2e6b4f&&_0x2e6b4f['autoAssociation']===0x0){return db[_0x0eaf('0x35')][_0x0eaf('0x54')]({'name':_0x211d10[_0x0eaf('0x38')],'resourceId':_0x211d10['id'],'type':_0x2e6b4f[_0x0eaf('0x38')],'sectionId':_0x2e6b4f['id']},{})[_0x0eaf('0x20')](function(){return _0x502045;});}else{return _0x502045;}})['catch'](function(_0x3ced82){logger[_0x0eaf('0x26')](_0x0eaf('0x5b'),_0x3ced82);throw _0x3ced82;});}return _0x502045;})['then'](respondWithResult(_0x42ba8d,0xc9))['catch'](handleError(_0x42ba8d,null));};exports['update']=function(_0x23ba26,_0x17d237){if(_0x23ba26[_0x0eaf('0x55')]['id']){delete _0x23ba26['body']['id'];}return db[_0x0eaf('0x3b')][_0x0eaf('0x53')]({'where':{'id':_0x23ba26[_0x0eaf('0x50')]['id']}})[_0x0eaf('0x20')](handleEntityNotFound(_0x17d237,null))[_0x0eaf('0x20')](saveUpdates(_0x23ba26['body'],null))[_0x0eaf('0x20')](respondWithResult(_0x17d237,null))[_0x0eaf('0x28')](handleError(_0x17d237,null));};exports[_0x0eaf('0x5c')]=function(_0x8704e2,_0x227911){return db[_0x0eaf('0x3b')]['find']({'where':{'id':_0x8704e2['params']['id']}})['then'](handleEntityNotFound(_0x227911,null))['then'](removeEntity(_0x227911,null))[_0x0eaf('0x28')](handleError(_0x227911,null));};exports[_0x0eaf('0x5d')]=function(_0x395163,_0x371ee7){return db[_0x0eaf('0x3b')][_0x0eaf('0x5d')]()[_0x0eaf('0x20')](respondWithResult(_0x371ee7,null))[_0x0eaf('0x28')](handleError(_0x371ee7,null));};exports[_0x0eaf('0x5e')]=function(_0x4b25d7,_0x36bae8,_0x4d70e5){var _0x4a9f4d={'raw':!![],'where':{}},_0x3f8937={},_0x406d42;return db[_0x0eaf('0x3b')][_0x0eaf('0x5f')]({'where':{'id':_0x4b25d7[_0x0eaf('0x50')]['id']}})[_0x0eaf('0x20')](handleEntityNotFound(_0x36bae8,null))['then'](function(_0x4f337e){if(_0x4f337e){_0x406d42=_0x4f337e[_0x0eaf('0x33')]({'plain':!![]});_0x3f8937[_0x0eaf('0x42')]=_['keys'](db['UserChatQueue'][_0x0eaf('0x3c')]);_0x3f8937[_0x0eaf('0x3f')]=_[_0x0eaf('0x51')](_0x4b25d7['query']);_0x3f8937[_0x0eaf('0x40')]=_[_0x0eaf('0x41')](_0x3f8937['model'],_0x3f8937[_0x0eaf('0x3f')]);_0x4a9f4d[_0x0eaf('0x43')]=_[_0x0eaf('0x41')](_0x3f8937['model'],qs[_0x0eaf('0x60')](_0x4b25d7['query']['fields']));_0x4a9f4d[_0x0eaf('0x43')]=_0x4a9f4d[_0x0eaf('0x43')]['length']?_0x4a9f4d['attributes']:_0x3f8937[_0x0eaf('0x42')];if(!_0x4b25d7[_0x0eaf('0x3f')]['hasOwnProperty']('nolimit')){_0x4a9f4d[_0x0eaf('0x2c')]=qs['limit'](_0x4b25d7[_0x0eaf('0x3f')][_0x0eaf('0x2c')]);_0x4a9f4d['offset']=qs[_0x0eaf('0x2b')](_0x4b25d7[_0x0eaf('0x3f')][_0x0eaf('0x2b')]);}_0x4a9f4d[_0x0eaf('0x61')]=qs[_0x0eaf('0x46')](_0x4b25d7['query'][_0x0eaf('0x46')]);_0x4a9f4d['where']=qs[_0x0eaf('0x40')](_['pick'](_0x4b25d7[_0x0eaf('0x3f')],_0x3f8937[_0x0eaf('0x40')]));_0x4a9f4d[_0x0eaf('0x47')]['ChatQueueId']=_0x4f337e['id'];if(_0x4b25d7[_0x0eaf('0x3f')][_0x0eaf('0x49')]){_0x4a9f4d[_0x0eaf('0x47')]=_['merge'](_0x4a9f4d['where'],{'$or':_['map'](_0x4a9f4d[_0x0eaf('0x43')],function(_0x166584){var _0x337b23={};_0x337b23[_0x166584]={'$like':'%'+_0x4b25d7[_0x0eaf('0x3f')][_0x0eaf('0x49')]+'%'};return _0x337b23;})});}_0x4a9f4d=_[_0x0eaf('0x4a')]({},_0x4a9f4d,_0x4b25d7[_0x0eaf('0x4b')]);return db[_0x0eaf('0x62')][_0x0eaf('0x4e')](_0x4a9f4d);}})[_0x0eaf('0x20')](function(_0x352a4c){if(_0x352a4c){return db[_0x0eaf('0x63')][_0x0eaf('0x64')]({'where':{'id':_['map'](_0x352a4c,_0x0eaf('0x65')),'role':_0x0eaf('0x66')},'attributes':['id',_0x0eaf('0x38'),_0x0eaf('0x67'),_0x0eaf('0x68'),_0x0eaf('0x69')]});}})['then'](function(_0x5e3e65){if(_0x5e3e65){return{'count':_0x5e3e65[_0x0eaf('0x2d')],'rows':_[_0x0eaf('0x3a')](_0x5e3e65[_0x0eaf('0x6a')],function(_0x13023f){return{'membername':_0x13023f[_0x0eaf('0x38')],'UserId':_0x13023f['id'],'queue_name':_0x406d42[_0x0eaf('0x38')],'ChatQueueId':_0x406d42['id'],'interface':util[_0x0eaf('0x6b')](_0x0eaf('0x6c'),_0x0eaf('0x6d'),_0x13023f['name']),'penalty':0x0,'paused':_0x13023f[_0x0eaf('0x67')],'createdAt':_0x13023f[_0x0eaf('0x69')],'updatedAt':_0x13023f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0eaf('0x20')](respondWithFilteredResult(_0x36bae8,_0x4a9f4d))[_0x0eaf('0x28')](handleError(_0x36bae8,null));};exports[_0x0eaf('0x6e')]=function(_0x325773,_0x5d0874,_0xf49c22){var _0x1abc7d={};var _0x6515a5={};var _0xd80762;var _0x38a115;return db['ChatQueue'][_0x0eaf('0x5f')]({'where':{'id':_0x325773[_0x0eaf('0x50')]['id']}})['then'](handleEntityNotFound(_0x5d0874,null))[_0x0eaf('0x20')](function(_0x19caa7){if(_0x19caa7){_0xd80762=_0x19caa7;_0x6515a5[_0x0eaf('0x42')]=_[_0x0eaf('0x51')](db[_0x0eaf('0x6f')][_0x0eaf('0x3c')]);_0x6515a5[_0x0eaf('0x3f')]=_[_0x0eaf('0x51')](_0x325773['query']);_0x6515a5['filters']=_[_0x0eaf('0x41')](_0x6515a5[_0x0eaf('0x42')],_0x6515a5[_0x0eaf('0x3f')]);_0x1abc7d[_0x0eaf('0x43')]=_['intersection'](_0x6515a5[_0x0eaf('0x42')],qs[_0x0eaf('0x60')](_0x325773[_0x0eaf('0x3f')][_0x0eaf('0x60')]));_0x1abc7d[_0x0eaf('0x43')]=_0x1abc7d[_0x0eaf('0x43')][_0x0eaf('0x52')]?_0x1abc7d[_0x0eaf('0x43')]:_0x6515a5[_0x0eaf('0x42')];_0x1abc7d['order']=qs[_0x0eaf('0x46')](_0x325773[_0x0eaf('0x3f')]['sort']);_0x1abc7d[_0x0eaf('0x47')]=qs[_0x0eaf('0x40')](_['pick'](_0x325773[_0x0eaf('0x3f')],_0x6515a5[_0x0eaf('0x40')]));if(_0x325773['query']['filter']){_0x1abc7d[_0x0eaf('0x47')]=_[_0x0eaf('0x4a')](_0x1abc7d[_0x0eaf('0x47')],{'$or':_[_0x0eaf('0x3a')](_0x1abc7d[_0x0eaf('0x43')],function(_0x41e365){var _0x199752={};_0x199752[_0x41e365]={'$like':'%'+_0x325773[_0x0eaf('0x3f')][_0x0eaf('0x49')]+'%'};return _0x199752;})});}_0x1abc7d=_['merge']({},_0x1abc7d,_0x325773[_0x0eaf('0x4b')]);return _0xd80762[_0x0eaf('0x6e')](_0x1abc7d);}})[_0x0eaf('0x20')](function(_0xe2cdc0){if(_0xe2cdc0){_0x38a115=_0xe2cdc0[_0x0eaf('0x52')];if(!_0x325773['query'][_0x0eaf('0x44')](_0x0eaf('0x45'))){_0x1abc7d['limit']=qs[_0x0eaf('0x2c')](_0x325773[_0x0eaf('0x3f')][_0x0eaf('0x2c')]);_0x1abc7d[_0x0eaf('0x2b')]=qs['offset'](_0x325773[_0x0eaf('0x3f')]['offset']);}return _0xd80762[_0x0eaf('0x6e')](_0x1abc7d);}})['then'](function(_0x3e802e){if(_0x3e802e){return _0x3e802e?{'count':_0x38a115,'rows':_0x3e802e}:null;}})[_0x0eaf('0x20')](respondWithResult(_0x5d0874,null))[_0x0eaf('0x28')](handleError(_0x5d0874,null));};exports['addTeams']=function(_0x58613b,_0x8e7a0c,_0x2a4758){var _0x3b33aa=_0x58613b[_0x0eaf('0x55')]['ids'];return db[_0x0eaf('0x6f')][_0x0eaf('0x4e')]({'where':{'id':_0x3b33aa},'attributes':['id'],'include':[{'model':db[_0x0eaf('0x63')],'as':'Agents','attributes':['id','name',_0x0eaf('0x70'),_0x0eaf('0x71'),'interface'],'raw':!![]}]})['then'](function(_0x1ce618){if(_0x1ce618){var _0xdd1551=_[_0x0eaf('0x72')](_0x1ce618,function(_0x386432){var _0x245644=_0x386432[_0x0eaf('0x33')]({'plain':!![]});return _0x245644[_0x0eaf('0x73')];});return db[_0x0eaf('0x3b')][_0x0eaf('0x53')]({'where':{'id':_0x58613b[_0x0eaf('0x50')]['id']}})[_0x0eaf('0x20')](function(_0x1278d6){return db['sequelize']['transaction'](function(_0x458644){return _0x1278d6['addTeams'](_0x3b33aa,{'transaction':_0x458644})[_0x0eaf('0x20')](function(){return BPromise[_0x0eaf('0x74')](_0xdd1551,function(_0x4d8670){return db[_0x0eaf('0x62')][_0x0eaf('0x75')]({'where':{'UserId':_0x4d8670['id'],'ChatQueueId':_0x58613b[_0x0eaf('0x50')]['id']},'transaction':_0x458644});});})[_0x0eaf('0x20')](function(){_0xdd1551[_0x0eaf('0x76')](function(_0x3d3d79){socket[_0x0eaf('0x77')]('userChatQueue:save',{'UserId':_0x3d3d79['id'],'ChatQueueId':_0x1278d6['id']});});});});});}})[_0x0eaf('0x20')](respondWithStatusCode(_0x8e7a0c,null))['catch'](handleError(_0x8e7a0c,null));};exports[_0x0eaf('0x78')]=function(_0x5e0069,_0x128ba8,_0x23ee67){return db[_0x0eaf('0x6f')][_0x0eaf('0x4e')]({'where':{'id':_0x5e0069[_0x0eaf('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0eaf('0x63')],'as':_0x0eaf('0x73'),'attributes':['id'],'raw':!![]}]})[_0x0eaf('0x20')](handleEntityNotFound(_0x128ba8,null))[_0x0eaf('0x20')](function(_0x9d38e0){var _0x42a0a9=_[_0x0eaf('0x3a')](_0x9d38e0,'id');var _0x470d5a=[];var _0xd53143=[];var _0x43dc47=squel[_0x0eaf('0x79')]();_0x43dc47[_0x0eaf('0x7a')](_0x0eaf('0x7b'))['from'](_0x0eaf('0x7c'),'tq')['join'](_0x0eaf('0x7d'),'ut',_0x0eaf('0x7e'))['where'](_0x0eaf('0x7f'),_0x5e0069[_0x0eaf('0x50')]['id']);for(var _0x5c7800=0x0;_0x5c7800<_0x9d38e0[_0x0eaf('0x52')];_0x5c7800+=0x1){let _0x56147f=_0x9d38e0[_0x5c7800];for(var _0x190f71=0x0;_0x190f71<_0x56147f['Agents'][_0x0eaf('0x52')];_0x190f71+=0x1){let _0x30b1d7=_0x56147f[_0x0eaf('0x73')][_0x190f71];var _0x50dbfd=_0x43dc47[_0x0eaf('0x80')]();_0x50dbfd[_0x0eaf('0x47')](_0x0eaf('0x81'),_0x30b1d7['id']);_0xd53143[_0x0eaf('0x82')](db[_0x0eaf('0x83')][_0x0eaf('0x3f')](_0x50dbfd[_0x0eaf('0x84')](),{'type':db[_0x0eaf('0x83')][_0x0eaf('0x85')][_0x0eaf('0x86')]})[_0x0eaf('0x20')](function(_0x266f8c){if(_0x266f8c[_0x0eaf('0x52')]===0x1){return _0x30b1d7['id'];}else{var _0x5d68b4=_[_0x0eaf('0x87')](_[_0x0eaf('0x3a')](_0x266f8c,_0x0eaf('0x88')),function(_0x166f00){return _[_0x0eaf('0x89')](_0x42a0a9,_0x166f00);});if(_0x5d68b4){return _0x30b1d7['id'];}}}));}}return BPromise['all'](_0xd53143)[_0x0eaf('0x20')](function(_0x4624be){_0x470d5a=_(_0x470d5a)[_0x0eaf('0x8a')](_0x4624be)[_0x0eaf('0x8b')]()['value']();return db[_0x0eaf('0x3b')][_0x0eaf('0x53')]({'where':{'id':_0x5e0069['params']['id']}})[_0x0eaf('0x20')](function(_0x5f544d){return db['sequelize']['transaction'](function(_0x4f3d07){return _0x5f544d[_0x0eaf('0x78')](_0x5e0069['query'][_0x0eaf('0x8c')],{'transaction':_0x4f3d07})[_0x0eaf('0x20')](function(){if(!_[_0x0eaf('0x8d')](_0x470d5a)){return _0x5f544d[_0x0eaf('0x8e')](_0x470d5a,{'transaction':_0x4f3d07});}})['then'](function(){_0x470d5a[_0x0eaf('0x76')](function(_0x55a8ce){socket[_0x0eaf('0x77')](_0x0eaf('0x8f'),{'UserId':_0x55a8ce,'ChatQueueId':_0x5f544d['id']});});});});});});})[_0x0eaf('0x20')](respondWithStatusCode(_0x128ba8,null))[_0x0eaf('0x28')](handleError(_0x128ba8,null));};exports[_0x0eaf('0x90')]=function(_0x1be989,_0x3d3929,_0x27f96b){return db[_0x0eaf('0x3b')][_0x0eaf('0x53')]({'where':{'id':_0x1be989[_0x0eaf('0x50')]['id']}})[_0x0eaf('0x20')](handleEntityNotFound(_0x3d3929,null))[_0x0eaf('0x20')](function(_0x511cfe){if(_0x511cfe){return _0x511cfe[_0x0eaf('0x90')](_0x1be989['body'][_0x0eaf('0x8c')],_[_0x0eaf('0x91')](_0x1be989[_0x0eaf('0x55')],[_0x0eaf('0x8c'),'id'])||{})[_0x0eaf('0x92')](function(_0x241fd5){for(var _0x28c212=0x0;_0x28c212<_0x1be989[_0x0eaf('0x55')]['ids'][_0x0eaf('0x52')];_0x28c212+=0x1){socket[_0x0eaf('0x77')](_0x0eaf('0x93'),{'UserId':Number(_0x1be989[_0x0eaf('0x55')][_0x0eaf('0x8c')][_0x28c212]),'ChatQueueId':Number(_0x1be989[_0x0eaf('0x50')]['id'])});}return _0x241fd5;});}})[_0x0eaf('0x20')](respondWithResult(_0x3d3929,null))[_0x0eaf('0x28')](handleError(_0x3d3929,null));};exports[_0x0eaf('0x8e')]=function(_0x21ecd9,_0x49c2c8,_0x52f588){return db[_0x0eaf('0x3b')][_0x0eaf('0x53')]({'where':{'id':_0x21ecd9[_0x0eaf('0x50')]['id']}})['then'](handleEntityNotFound(_0x49c2c8,null))[_0x0eaf('0x20')](function(_0x4b49fe){if(_0x4b49fe){return _0x4b49fe[_0x0eaf('0x8e')](_0x21ecd9['query'][_0x0eaf('0x8c')])[_0x0eaf('0x20')](function(){if(_[_0x0eaf('0x94')](_0x21ecd9['query'][_0x0eaf('0x8c')])){for(var _0x4f8a6a=0x0;_0x4f8a6a<_0x21ecd9[_0x0eaf('0x3f')]['ids'][_0x0eaf('0x52')];_0x4f8a6a+=0x1){socket['emit'](_0x0eaf('0x8f'),{'UserId':Number(_0x21ecd9[_0x0eaf('0x3f')][_0x0eaf('0x8c')][_0x4f8a6a]),'ChatQueueId':Number(_0x21ecd9[_0x0eaf('0x50')]['id'])});}}else{socket[_0x0eaf('0x77')](_0x0eaf('0x8f'),{'UserId':Number(_0x21ecd9[_0x0eaf('0x3f')][_0x0eaf('0x8c')]),'ChatQueueId':Number(_0x21ecd9[_0x0eaf('0x50')]['id'])});}});}})[_0x0eaf('0x20')](respondWithStatusCode(_0x49c2c8,null))[_0x0eaf('0x28')](handleError(_0x49c2c8,null));};exports[_0x0eaf('0x95')]=function(_0x4be5fd,_0x440b3d,_0x14ddab){var _0xce9a56={};var _0x4369ce={};var _0x2c41f9;var _0x4d6bf6;return db['ChatQueue'][_0x0eaf('0x5f')]({'where':{'id':_0x4be5fd[_0x0eaf('0x50')]['id']}})[_0x0eaf('0x20')](handleEntityNotFound(_0x440b3d,null))[_0x0eaf('0x20')](function(_0x32790b){if(_0x32790b){_0x2c41f9=_0x32790b;_0x4369ce[_0x0eaf('0x42')]=_[_0x0eaf('0x51')](db[_0x0eaf('0x63')]['rawAttributes']);_0x4369ce[_0x0eaf('0x3f')]=_['keys'](_0x4be5fd[_0x0eaf('0x3f')]);_0x4369ce[_0x0eaf('0x40')]=_[_0x0eaf('0x41')](_0x4369ce[_0x0eaf('0x42')],_0x4369ce['query']);_0xce9a56[_0x0eaf('0x43')]=_['intersection'](_0x4369ce[_0x0eaf('0x42')],qs[_0x0eaf('0x60')](_0x4be5fd[_0x0eaf('0x3f')][_0x0eaf('0x60')]));_0xce9a56[_0x0eaf('0x43')]=_0xce9a56[_0x0eaf('0x43')][_0x0eaf('0x52')]?_0xce9a56[_0x0eaf('0x43')]:_0x4369ce[_0x0eaf('0x42')];_0xce9a56[_0x0eaf('0x61')]=qs['sort'](_0x4be5fd['query'][_0x0eaf('0x46')]);_0xce9a56[_0x0eaf('0x47')]=qs[_0x0eaf('0x40')](_[_0x0eaf('0x48')](_0x4be5fd[_0x0eaf('0x3f')],_0x4369ce[_0x0eaf('0x40')]));if(_0x4be5fd[_0x0eaf('0x3f')][_0x0eaf('0x49')]){_0xce9a56[_0x0eaf('0x47')]=_[_0x0eaf('0x4a')](_0xce9a56['where'],{'$or':_[_0x0eaf('0x3a')](_0xce9a56[_0x0eaf('0x43')],function(_0x3567d5){var _0x59c214={};_0x59c214[_0x3567d5]={'$like':'%'+_0x4be5fd[_0x0eaf('0x3f')][_0x0eaf('0x49')]+'%'};return _0x59c214;})});}_0xce9a56=_['merge']({},_0xce9a56,_0x4be5fd[_0x0eaf('0x4b')]);return _0x2c41f9['getAgents'](_0xce9a56);}})[_0x0eaf('0x20')](function(_0x1f6d25){if(_0x1f6d25){_0x4d6bf6=_0x1f6d25[_0x0eaf('0x52')];if(!_0x4be5fd[_0x0eaf('0x3f')][_0x0eaf('0x44')](_0x0eaf('0x45'))){_0xce9a56[_0x0eaf('0x2c')]=qs[_0x0eaf('0x2c')](_0x4be5fd[_0x0eaf('0x3f')][_0x0eaf('0x2c')]);_0xce9a56[_0x0eaf('0x2b')]=qs[_0x0eaf('0x2b')](_0x4be5fd[_0x0eaf('0x3f')][_0x0eaf('0x2b')]);}return _0x2c41f9['getAgents'](_0xce9a56);}})[_0x0eaf('0x20')](function(_0x4a4a96){if(_0x4a4a96){return _0x4a4a96?{'count':_0x4d6bf6,'rows':_0x4a4a96}:null;}})[_0x0eaf('0x20')](respondWithResult(_0x440b3d,null))[_0x0eaf('0x28')](handleError(_0x440b3d,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index c0bd530..dda408a 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 _0x7351=['ChatQueue','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x435fa1,_0x58550a){var _0x845f9f=function(_0x89867e){while(--_0x89867e){_0x435fa1['push'](_0x435fa1['shift']());}};_0x845f9f(++_0x58550a);}(_0x7351,0x139));var _0x1735=function(_0xc9694f,_0x1ba7d1){_0xc9694f=_0xc9694f-0x0;var _0xfd8128=_0x7351[_0xc9694f];return _0xfd8128;};'use strict';var EventEmitter=require(_0x1735('0x0'));var ChatQueue=require(_0x1735('0x1'))['db'][_0x1735('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1735('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1735('0x4')};function emitEvent(_0x1aa6c0){return function(_0x182866,_0x10d710,_0x45abff){ChatQueueEvents[_0x1735('0x5')](_0x1aa6c0+':'+_0x182866['id'],_0x182866);ChatQueueEvents['emit'](_0x1aa6c0,_0x182866);_0x45abff(null);};}for(var e in events){if(events[_0x1735('0x6')](e)){var event=events[e];ChatQueue[_0x1735('0x7')](e,emitEvent(event));}}module[_0x1735('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x2aff=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x169ff3,_0x13fb48){var _0x4f8172=function(_0x22a3af){while(--_0x22a3af){_0x169ff3['push'](_0x169ff3['shift']());}};_0x4f8172(++_0x13fb48);}(_0x2aff,0x6b));var _0xf2af=function(_0x112af0,_0x833f55){_0x112af0=_0x112af0-0x0;var _0x1b329e=_0x2aff[_0x112af0];return _0x1b329e;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xf2af('0x0'))['db'][_0xf2af('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf2af('0x2')](0x0);var events={'afterCreate':_0xf2af('0x3'),'afterUpdate':_0xf2af('0x4'),'afterDestroy':_0xf2af('0x5')};function emitEvent(_0x1a3e68){return function(_0x228d29,_0x26decd,_0x154b38){ChatQueueEvents[_0xf2af('0x6')](_0x1a3e68+':'+_0x228d29['id'],_0x228d29);ChatQueueEvents[_0xf2af('0x6')](_0x1a3e68,_0x228d29);_0x154b38(null);};}for(var e in events){if(events[_0xf2af('0x7')](e)){var event=events[e];ChatQueue[_0xf2af('0x8')](e,emitEvent(event));}}module[_0xf2af('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index e33d5ab..84edf0f 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 _0x0fc9=['util','../../config/logger','moment','bluebird','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues'];(function(_0x1d9518,_0x558400){var _0x825bac=function(_0xb1314c){while(--_0xb1314c){_0x1d9518['push'](_0x1d9518['shift']());}};_0x825bac(++_0x558400);}(_0x0fc9,0x82));var _0x90fc=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0fc9[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x90fc('0x0'));var logger=require(_0x90fc('0x1'))('api');var moment=require(_0x90fc('0x2'));var BPromise=require(_0x90fc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x90fc('0x4'));var config=require('../../config/environment');var attributes=require(_0x90fc('0x5'));module[_0x90fc('0x6')]=function(_0x7d26f,_0x1ec7b1){return _0x7d26f[_0x90fc('0x7')](_0x90fc('0x8'),attributes,{'tableName':_0x90fc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6b6=['../../config/logger','api','rimraf','../../config/environment','./chatQueue.attributes','ChatQueue','lodash','util'];(function(_0x58990d,_0x18e5a8){var _0x2af8d7=function(_0x6819a1){while(--_0x6819a1){_0x58990d['push'](_0x58990d['shift']());}};_0x2af8d7(++_0x18e5a8);}(_0xd6b6,0xee));var _0x6d6b=function(_0xbf9cf4,_0x17db62){_0xbf9cf4=_0xbf9cf4-0x0;var _0x47ba5d=_0xd6b6[_0xbf9cf4];return _0x47ba5d;};'use strict';var _=require(_0x6d6b('0x0'));var util=require(_0x6d6b('0x1'));var logger=require(_0x6d6b('0x2'))(_0x6d6b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d6b('0x4'));var config=require(_0x6d6b('0x5'));var attributes=require(_0x6d6b('0x6'));module['exports']=function(_0x46297c,_0x2f2d22){return _0x46297c['define'](_0x6d6b('0x7'),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 9c5e520..94f9e62 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 _0x0caf=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','map','model','then','debug','ShowChatQueue','find','where','bluebird'];(function(_0x372b25,_0x27c75f){var _0x4ca6cb=function(_0x361373){while(--_0x361373){_0x372b25['push'](_0x372b25['shift']());}};_0x4ca6cb(++_0x27c75f);}(_0x0caf,0x9f));var _0xf0ca=function(_0x14d8cf,_0x555050){_0x14d8cf=_0x14d8cf-0x0;var _0x4bd7a5=_0x0caf[_0x14d8cf];return _0x4bd7a5;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf0ca('0x0'));var rs=require(_0xf0ca('0x1'));var fs=require('fs');var Redis=require(_0xf0ca('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf0ca('0x3'))(_0xf0ca('0x4'));var config=require('../../config/environment');var jayson=require(_0xf0ca('0x5'));var client=jayson[_0xf0ca('0x6')][_0xf0ca('0x7')]({'port':0x232a});config['redis']=_[_0xf0ca('0x8')](config[_0xf0ca('0x9')],{'host':_0xf0ca('0xa'),'port':0x18eb});var socket=require(_0xf0ca('0xb'))(new Redis(config[_0xf0ca('0x9')]));require(_0xf0ca('0xc'))[_0xf0ca('0xd')](socket);function respondWithRpcPromise(_0x5bbec7,_0x11aa70,_0x78f205){return new BPromise(function(_0x1542b6,_0xa3f45){return client[_0xf0ca('0xe')](_0x5bbec7,_0x78f205)['then'](function(_0x49aa3d){logger[_0xf0ca('0xf')]('ChatQueue,\x20%s,\x20%s',_0x11aa70,_0xf0ca('0x10'));logger['debug'](_0xf0ca('0x11'),_0x11aa70,_0xf0ca('0x10'),JSON[_0xf0ca('0x12')](_0x49aa3d));if(_0x49aa3d[_0xf0ca('0x13')]){if(_0x49aa3d[_0xf0ca('0x13')][_0xf0ca('0x14')]===0x1f4){logger['error'](_0xf0ca('0x15'),_0x11aa70,_0x49aa3d['error']['message']);return _0xa3f45(_0x49aa3d[_0xf0ca('0x13')][_0xf0ca('0x16')]);}logger[_0xf0ca('0x13')](_0xf0ca('0x15'),_0x11aa70,_0x49aa3d[_0xf0ca('0x13')]['message']);return _0x1542b6(_0x49aa3d['error'][_0xf0ca('0x16')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x11aa70,_0xf0ca('0x10'));_0x1542b6(_0x49aa3d[_0xf0ca('0x17')][_0xf0ca('0x16')]);}})[_0xf0ca('0x18')](function(_0x3a1466){logger[_0xf0ca('0x13')]('ChatQueue,\x20%s,\x20%s',_0x11aa70,_0x3a1466);_0xa3f45(_0x3a1466);});});}exports[_0xf0ca('0x19')]=function(_0x58bed2){var _0x10bd95=this;return new Promise(function(_0x1409c4,_0x50f742){return db[_0xf0ca('0x1a')][_0xf0ca('0x1b')]({'raw':_0x58bed2[_0xf0ca('0x1c')]?_0x58bed2[_0xf0ca('0x1c')][_0xf0ca('0x1d')]===undefined?!![]:![]:!![],'where':_0x58bed2[_0xf0ca('0x1c')]?_0x58bed2[_0xf0ca('0x1c')]['where']||null:null,'attributes':_0x58bed2[_0xf0ca('0x1c')]?_0x58bed2[_0xf0ca('0x1c')][_0xf0ca('0x1e')]||null:null,'limit':_0x58bed2[_0xf0ca('0x1c')]?_0x58bed2[_0xf0ca('0x1c')][_0xf0ca('0x1f')]||null:null,'include':_0x58bed2['options']?_0x58bed2['options'][_0xf0ca('0x20')]?_[_0xf0ca('0x21')](_0x58bed2[_0xf0ca('0x1c')][_0xf0ca('0x20')],function(_0x106f8e){return{'model':db[_0x106f8e[_0xf0ca('0x22')]],'as':_0x106f8e['as'],'attributes':_0x106f8e[_0xf0ca('0x1e')],'include':_0x106f8e[_0xf0ca('0x20')]?_['map'](_0x106f8e['include'],function(_0x22c0f0){return{'model':db[_0x22c0f0[_0xf0ca('0x22')]],'as':_0x22c0f0['as'],'attributes':_0x22c0f0['attributes'],'include':_0x22c0f0[_0xf0ca('0x20')]?_[_0xf0ca('0x21')](_0x22c0f0[_0xf0ca('0x20')],function(_0x2aaae9){return{'model':db[_0x2aaae9['model']],'as':_0x2aaae9['as'],'attributes':_0x2aaae9[_0xf0ca('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf0ca('0x23')](function(_0x35b78c){logger[_0xf0ca('0xf')](_0xf0ca('0x19'),_0x58bed2);logger[_0xf0ca('0x24')](_0xf0ca('0x19'),_0x58bed2,JSON['stringify'](_0x35b78c));_0x1409c4(_0x35b78c);})[_0xf0ca('0x18')](function(_0x4ba8ac){logger[_0xf0ca('0x13')]('GetChatQueue',_0x4ba8ac[_0xf0ca('0x16')],_0x58bed2);_0x50f742(_0x10bd95[_0xf0ca('0x13')](0x1f4,_0x4ba8ac[_0xf0ca('0x16')]));});});};exports[_0xf0ca('0x25')]=function(_0x35bcd7){var _0x2c39f3=this;return new Promise(function(_0x108281,_0x3be90c){return db[_0xf0ca('0x1a')][_0xf0ca('0x26')]({'raw':_0x35bcd7[_0xf0ca('0x1c')]?_0x35bcd7[_0xf0ca('0x1c')][_0xf0ca('0x1d')]===undefined?!![]:![]:!![],'where':_0x35bcd7[_0xf0ca('0x1c')]?_0x35bcd7['options'][_0xf0ca('0x27')]||null:null,'attributes':_0x35bcd7[_0xf0ca('0x1c')]?_0x35bcd7[_0xf0ca('0x1c')][_0xf0ca('0x1e')]||null:null,'include':_0x35bcd7['options']?_0x35bcd7[_0xf0ca('0x1c')]['include']?_[_0xf0ca('0x21')](_0x35bcd7['options'][_0xf0ca('0x20')],function(_0x2c218b){return{'model':db[_0x2c218b['model']],'as':_0x2c218b['as'],'attributes':_0x2c218b[_0xf0ca('0x1e')],'include':_0x2c218b['include']?_['map'](_0x2c218b[_0xf0ca('0x20')],function(_0x459169){return{'model':db[_0x459169[_0xf0ca('0x22')]],'as':_0x459169['as'],'attributes':_0x459169[_0xf0ca('0x1e')],'include':_0x459169[_0xf0ca('0x20')]?_['map'](_0x459169[_0xf0ca('0x20')],function(_0x448969){return{'model':db[_0x448969[_0xf0ca('0x22')]],'as':_0x448969['as'],'attributes':_0x448969[_0xf0ca('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf0ca('0x23')](function(_0x46219a){logger['info'](_0xf0ca('0x25'),_0x35bcd7);logger[_0xf0ca('0x24')](_0xf0ca('0x25'),_0x35bcd7,JSON[_0xf0ca('0x12')](_0x46219a));_0x108281(_0x46219a);})['catch'](function(_0x206df2){logger['error'](_0xf0ca('0x25'),_0x206df2[_0xf0ca('0x16')],_0x35bcd7);_0x3be90c(_0x2c39f3[_0xf0ca('0x13')](0x1f4,_0x206df2[_0xf0ca('0x16')]));});});}; \ No newline at end of file +var _0x945a=['where','attributes','limit','include','map','model','GetChatQueue','stringify','ShowChatQueue','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','ChatQueue','options','raw'];(function(_0x2ffe,_0x668fec){var _0x272bed=function(_0x2e8b53){while(--_0x2e8b53){_0x2ffe['push'](_0x2ffe['shift']());}};_0x272bed(++_0x668fec);}(_0x945a,0x1d2));var _0xa945=function(_0x4d2db4,_0x2caad8){_0x4d2db4=_0x4d2db4-0x0;var _0x1cf122=_0x945a[_0x4d2db4];return _0x1cf122;};'use strict';var _=require('lodash');var util=require(_0xa945('0x0'));var moment=require(_0xa945('0x1'));var BPromise=require(_0xa945('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa945('0x3'));var db=require(_0xa945('0x4'))['db'];var utils=require(_0xa945('0x5'));var logger=require(_0xa945('0x6'))('rpc');var config=require(_0xa945('0x7'));var jayson=require(_0xa945('0x8'));var client=jayson[_0xa945('0x9')][_0xa945('0xa')]({'port':0x232a});config[_0xa945('0xb')]=_[_0xa945('0xc')](config['redis'],{'host':_0xa945('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa945('0xb')]));require(_0xa945('0xe'))['register'](socket);function respondWithRpcPromise(_0xb5ea9d,_0xdf6472,_0x2542dc){return new BPromise(function(_0xf72320,_0x1848f0){return client[_0xa945('0xf')](_0xb5ea9d,_0x2542dc)[_0xa945('0x10')](function(_0x5c852f){logger[_0xa945('0x11')](_0xa945('0x12'),_0xdf6472,_0xa945('0x13'));logger[_0xa945('0x14')](_0xa945('0x15'),_0xdf6472,_0xa945('0x13'),JSON['stringify'](_0x5c852f));if(_0x5c852f['error']){if(_0x5c852f[_0xa945('0x16')][_0xa945('0x17')]===0x1f4){logger[_0xa945('0x16')]('ChatQueue,\x20%s,\x20%s',_0xdf6472,_0x5c852f[_0xa945('0x16')]['message']);return _0x1848f0(_0x5c852f[_0xa945('0x16')]['message']);}logger[_0xa945('0x16')]('ChatQueue,\x20%s,\x20%s',_0xdf6472,_0x5c852f['error']['message']);return _0xf72320(_0x5c852f[_0xa945('0x16')]['message']);}else{logger[_0xa945('0x11')](_0xa945('0x12'),_0xdf6472,_0xa945('0x13'));_0xf72320(_0x5c852f['result'][_0xa945('0x18')]);}})['catch'](function(_0x573135){logger[_0xa945('0x16')]('ChatQueue,\x20%s,\x20%s',_0xdf6472,_0x573135);_0x1848f0(_0x573135);});});}exports['GetChatQueue']=function(_0x1097ed){var _0x7215df=this;return new Promise(function(_0x3d5b6e,_0x56561b){return db[_0xa945('0x19')]['findAll']({'raw':_0x1097ed[_0xa945('0x1a')]?_0x1097ed[_0xa945('0x1a')][_0xa945('0x1b')]===undefined?!![]:![]:!![],'where':_0x1097ed[_0xa945('0x1a')]?_0x1097ed[_0xa945('0x1a')][_0xa945('0x1c')]||null:null,'attributes':_0x1097ed[_0xa945('0x1a')]?_0x1097ed[_0xa945('0x1a')][_0xa945('0x1d')]||null:null,'limit':_0x1097ed[_0xa945('0x1a')]?_0x1097ed['options'][_0xa945('0x1e')]||null:null,'include':_0x1097ed[_0xa945('0x1a')]?_0x1097ed[_0xa945('0x1a')][_0xa945('0x1f')]?_[_0xa945('0x20')](_0x1097ed[_0xa945('0x1a')][_0xa945('0x1f')],function(_0x2d6f87){return{'model':db[_0x2d6f87[_0xa945('0x21')]],'as':_0x2d6f87['as'],'attributes':_0x2d6f87['attributes'],'include':_0x2d6f87[_0xa945('0x1f')]?_[_0xa945('0x20')](_0x2d6f87[_0xa945('0x1f')],function(_0x3c5439){return{'model':db[_0x3c5439['model']],'as':_0x3c5439['as'],'attributes':_0x3c5439['attributes'],'include':_0x3c5439['include']?_[_0xa945('0x20')](_0x3c5439[_0xa945('0x1f')],function(_0x1f5253){return{'model':db[_0x1f5253[_0xa945('0x21')]],'as':_0x1f5253['as'],'attributes':_0x1f5253['attributes']};}):[]};}):[]};}):[]:[]})[_0xa945('0x10')](function(_0xbff8af){logger[_0xa945('0x11')](_0xa945('0x22'),_0x1097ed);logger[_0xa945('0x14')](_0xa945('0x22'),_0x1097ed,JSON[_0xa945('0x23')](_0xbff8af));_0x3d5b6e(_0xbff8af);})['catch'](function(_0x17ba5b){logger[_0xa945('0x16')]('GetChatQueue',_0x17ba5b[_0xa945('0x18')],_0x1097ed);_0x56561b(_0x7215df[_0xa945('0x16')](0x1f4,_0x17ba5b[_0xa945('0x18')]));});});};exports[_0xa945('0x24')]=function(_0x268542){var _0x4b5e65=this;return new Promise(function(_0x10cd29,_0x25e992){return db[_0xa945('0x19')]['find']({'raw':_0x268542[_0xa945('0x1a')]?_0x268542[_0xa945('0x1a')][_0xa945('0x1b')]===undefined?!![]:![]:!![],'where':_0x268542[_0xa945('0x1a')]?_0x268542['options'][_0xa945('0x1c')]||null:null,'attributes':_0x268542[_0xa945('0x1a')]?_0x268542[_0xa945('0x1a')][_0xa945('0x1d')]||null:null,'include':_0x268542['options']?_0x268542['options'][_0xa945('0x1f')]?_[_0xa945('0x20')](_0x268542['options'][_0xa945('0x1f')],function(_0x4a8de6){return{'model':db[_0x4a8de6[_0xa945('0x21')]],'as':_0x4a8de6['as'],'attributes':_0x4a8de6[_0xa945('0x1d')],'include':_0x4a8de6['include']?_[_0xa945('0x20')](_0x4a8de6[_0xa945('0x1f')],function(_0x4efa6d){return{'model':db[_0x4efa6d[_0xa945('0x21')]],'as':_0x4efa6d['as'],'attributes':_0x4efa6d[_0xa945('0x1d')],'include':_0x4efa6d[_0xa945('0x1f')]?_[_0xa945('0x20')](_0x4efa6d[_0xa945('0x1f')],function(_0x48d979){return{'model':db[_0x48d979['model']],'as':_0x48d979['as'],'attributes':_0x48d979[_0xa945('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fede7){logger[_0xa945('0x11')](_0xa945('0x24'),_0x268542);logger['debug'](_0xa945('0x24'),_0x268542,JSON['stringify'](_0x2fede7));_0x10cd29(_0x2fede7);})[_0xa945('0x25')](function(_0x1689ed){logger[_0xa945('0x16')](_0xa945('0x24'),_0x1689ed[_0xa945('0x18')],_0x268542);_0x25e992(_0x4b5e65['error'](0x1f4,_0x1689ed[_0xa945('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index d844844..bc4a474 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 _0x4b84=['./chatQueue.events','save','emit','length'];(function(_0x3d0e4c,_0x757e20){var _0x112709=function(_0x47d949){while(--_0x47d949){_0x3d0e4c['push'](_0x3d0e4c['shift']());}};_0x112709(++_0x757e20);}(_0x4b84,0x1cc));var _0x44b8=function(_0x46b22a,_0x5bf83a){_0x46b22a=_0x46b22a-0x0;var _0x44c2e8=_0x4b84[_0x46b22a];return _0x44c2e8;};'use strict';var ChatQueueEvents=require(_0x44b8('0x0'));var events=[_0x44b8('0x1'),'remove','update'];function createListener(_0x765943,_0x519db3){return function(_0x4b8ad8){_0x519db3[_0x44b8('0x2')](_0x765943,_0x4b8ad8);};}function removeListener(_0x31282a,_0x39ad16){return function(){ChatQueueEvents['removeListener'](_0x31282a,_0x39ad16);};}exports['register']=function(_0x55f25d){for(var _0x996a8b=0x0,_0x54274b=events[_0x44b8('0x3')];_0x996a8b<_0x54274b;_0x996a8b++){var _0x5947f7=events[_0x996a8b];var _0x3e87c5=createListener('chatQueue:'+_0x5947f7,_0x55f25d);ChatQueueEvents['on'](_0x5947f7,_0x3e87c5);}}; \ No newline at end of file +var _0xedd9=['removeListener','register','length','chatQueue:','save','remove','update','emit'];(function(_0x30347,_0x29012f){var _0x5ce687=function(_0x461e35){while(--_0x461e35){_0x30347['push'](_0x30347['shift']());}};_0x5ce687(++_0x29012f);}(_0xedd9,0xfc));var _0x9edd=function(_0x23d6da,_0x29b3b3){_0x23d6da=_0x23d6da-0x0;var _0x2a42ba=_0xedd9[_0x23d6da];return _0x2a42ba;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){ChatQueueEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);ChatQueueEvents['on'](_0x571af9,_0x172522);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index b75347c..f6cbca7 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3e74,0x175));var _0x43e7=function(_0x4aedc3,_0x18a6e9){_0x4aedc3=_0x4aedc3-0x0;var _0x4c3c4e=_0x3e74[_0x4aedc3];return _0x4c3c4e;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file +var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3e74,0x175));var _0x43e7=function(_0x51e592,_0x428509){_0x51e592=_0x51e592-0x0;var _0x1d005f=_0x3e74[_0x51e592];return _0x1d005f;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index be0866b..2329ab7 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 _0xc7b3=['DATE','moment','sequelize','exports','STRING'];(function(_0x24ac95,_0x35e646){var _0x57b1ad=function(_0x24c02c){while(--_0x24c02c){_0x24ac95['push'](_0x24ac95['shift']());}};_0x57b1ad(++_0x35e646);}(_0xc7b3,0x10a));var _0x3c7b=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc7b3[_0x16b9ed];return _0x66b1f8;};'use strict';var moment=require(_0x3c7b('0x0'));var Sequelize=require(_0x3c7b('0x1'));module[_0x3c7b('0x2')]={'uniqueid':{'type':Sequelize[_0x3c7b('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3c7b('0x4')]},'leaveAt':{'type':Sequelize[_0x3c7b('0x4')]},'acceptAt':{'type':Sequelize[_0x3c7b('0x4')]},'exitAt':{'type':Sequelize[_0x3c7b('0x4')]},'reason':{'type':Sequelize[_0x3c7b('0x3')]}}; \ No newline at end of file +var _0x22f2=['sequelize','exports','STRING','DATE','moment'];(function(_0x4c8256,_0xa7c341){var _0x1803ef=function(_0x3c71e0){while(--_0x3c71e0){_0x4c8256['push'](_0x4c8256['shift']());}};_0x1803ef(++_0xa7c341);}(_0x22f2,0xd6));var _0x222f=function(_0x3ce2fb,_0x3585da){_0x3ce2fb=_0x3ce2fb-0x0;var _0x323301=_0x22f2[_0x3ce2fb];return _0x323301;};'use strict';var moment=require(_0x222f('0x0'));var Sequelize=require(_0x222f('0x1'));module[_0x222f('0x2')]={'uniqueid':{'type':Sequelize[_0x222f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x222f('0x3')]},'joinAt':{'type':Sequelize[_0x222f('0x4')]},'leaveAt':{'type':Sequelize[_0x222f('0x4')]},'acceptAt':{'type':Sequelize[_0x222f('0x4')]},'exitAt':{'type':Sequelize[_0x222f('0x4')]},'reason':{'type':Sequelize[_0x222f('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 7c6c3bc..2176794 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 _0x647c=['find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','destroy','then','end','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ChatQueueReport','include','rows','catch','show','params','includeAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x647c,0x1d3));var _0xc647=function(_0x4cf2bb,_0xc26020){_0x4cf2bb=_0x4cf2bb-0x0;var _0x44e779=_0x647c[_0x4cf2bb];return _0x44e779;};'use strict';var emlformat=require(_0xc647('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc647('0x1'));var jsonpatch=require(_0xc647('0x2'));var rp=require('request-promise');var moment=require(_0xc647('0x3'));var BPromise=require(_0xc647('0x4'));var Mustache=require(_0xc647('0x5'));var util=require(_0xc647('0x6'));var path=require(_0xc647('0x7'));var sox=require('sox');var csv=require(_0xc647('0x8'));var ejs=require(_0xc647('0x9'));var fs=require('fs');var fs_extra=require(_0xc647('0xa'));var _=require(_0xc647('0xb'));var squel=require(_0xc647('0xc'));var crypto=require(_0xc647('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc647('0x8'));var querystring=require(_0xc647('0xe'));var Papa=require(_0xc647('0xf'));var Redis=require('ioredis');var authService=require(_0xc647('0x10'));var qs=require(_0xc647('0x11'));var as=require(_0xc647('0x12'));var hardwareService=require(_0xc647('0x13'));var logger=require(_0xc647('0x14'))(_0xc647('0x15'));var utils=require(_0xc647('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc647('0x17'));var db=require(_0xc647('0x18'))['db'];function respondWithStatusCode(_0x333ed0,_0x3afba2){_0x3afba2=_0x3afba2||0xcc;return function(_0x145933){if(_0x145933){return _0x333ed0[_0xc647('0x19')](_0x3afba2);}return _0x333ed0[_0xc647('0x1a')](_0x3afba2)['end']();};}function respondWithResult(_0x4d3dc3,_0x7e11a0){_0x7e11a0=_0x7e11a0||0xc8;return function(_0x4b57f1){if(_0x4b57f1){return _0x4d3dc3[_0xc647('0x1a')](_0x7e11a0)['json'](_0x4b57f1);}};}function respondWithFilteredResult(_0x353831,_0x46d496){return function(_0x2be197){if(_0x2be197){var _0x5a479a=typeof _0x46d496[_0xc647('0x1b')]===_0xc647('0x1c')&&typeof _0x46d496['limit']===_0xc647('0x1c');var _0x1c1db0=_0x2be197[_0xc647('0x1d')];var _0x407756=_0x5a479a?0x0:_0x46d496[_0xc647('0x1b')];var _0x1f502b=_0x5a479a?_0x2be197['count']:_0x46d496['offset']+_0x46d496[_0xc647('0x1e')];var _0x2b1f5a;if(_0x1f502b>=_0x1c1db0){_0x1f502b=_0x1c1db0;_0x2b1f5a=0xc8;}else{_0x2b1f5a=0xce;}_0x353831[_0xc647('0x1a')](_0x2b1f5a);return _0x353831[_0xc647('0x1f')](_0xc647('0x20'),_0x407756+'-'+_0x1f502b+'/'+_0x1c1db0)[_0xc647('0x21')](_0x2be197);}return null;};}function patchUpdates(_0x5494b7){return function(_0x35b36d){try{jsonpatch[_0xc647('0x22')](_0x35b36d,_0x5494b7,!![]);}catch(_0x13f94d){return BPromise[_0xc647('0x23')](_0x13f94d);}return _0x35b36d['save']();};}function saveUpdates(_0x397f3d,_0x25ec1b){return function(_0x15efba){if(_0x15efba){return _0x15efba['update'](_0x397f3d)['then'](function(_0x24dd5c){return _0x24dd5c;});}return null;};}function removeEntity(_0xf829b3,_0x4d1887){return function(_0x560bdf){if(_0x560bdf){return _0x560bdf[_0xc647('0x24')]()[_0xc647('0x25')](function(){_0xf829b3[_0xc647('0x1a')](0xcc)[_0xc647('0x26')]();});}};}function handleEntityNotFound(_0x3f2f37,_0x4fb1a3){return function(_0x1a99be){if(!_0x1a99be){_0x3f2f37[_0xc647('0x19')](0x194);}return _0x1a99be;};}function handleError(_0x2deb49,_0x5cbd31){_0x5cbd31=_0x5cbd31||0x1f4;return function(_0x5027){logger['error'](_0x5027['stack']);if(_0x5027['name']){delete _0x5027[_0xc647('0x27')];}_0x2deb49[_0xc647('0x1a')](_0x5cbd31)[_0xc647('0x28')](_0x5027);};}exports[_0xc647('0x29')]=function(_0x39119e,_0x39fc93){var _0x139e21={},_0x1f4e56={},_0x2432fe={'count':0x0,'rows':[]};var _0x2b7947=_['map'](db['ChatQueueReport'][_0xc647('0x2a')],function(_0x4652e4){return{'name':_0x4652e4[_0xc647('0x2b')],'type':_0x4652e4[_0xc647('0x2c')][_0xc647('0x2d')]};});_0x1f4e56['model']=_[_0xc647('0x2e')](_0x2b7947,'name');_0x1f4e56[_0xc647('0x2f')]=_[_0xc647('0x30')](_0x39119e[_0xc647('0x2f')]);_0x1f4e56['filters']=_[_0xc647('0x31')](_0x1f4e56[_0xc647('0x32')],_0x1f4e56[_0xc647('0x2f')]);_0x139e21[_0xc647('0x33')]=_[_0xc647('0x31')](_0x1f4e56[_0xc647('0x32')],qs[_0xc647('0x34')](_0x39119e[_0xc647('0x2f')][_0xc647('0x34')]));_0x139e21[_0xc647('0x33')]=_0x139e21[_0xc647('0x33')][_0xc647('0x35')]?_0x139e21['attributes']:_0x1f4e56[_0xc647('0x32')];if(!_0x39119e[_0xc647('0x2f')][_0xc647('0x36')](_0xc647('0x37'))){_0x139e21[_0xc647('0x1e')]=qs['limit'](_0x39119e['query'][_0xc647('0x1e')]);_0x139e21[_0xc647('0x1b')]=qs[_0xc647('0x1b')](_0x39119e[_0xc647('0x2f')][_0xc647('0x1b')]);}_0x139e21[_0xc647('0x38')]=qs[_0xc647('0x39')](_0x39119e[_0xc647('0x2f')][_0xc647('0x39')]);_0x139e21[_0xc647('0x3a')]=qs[_0xc647('0x3b')](_[_0xc647('0x3c')](_0x39119e[_0xc647('0x2f')],_0x1f4e56[_0xc647('0x3b')]),_0x2b7947);if(_0x39119e['query'][_0xc647('0x3d')]){_0x139e21[_0xc647('0x3a')]=_[_0xc647('0x3e')](_0x139e21[_0xc647('0x3a')],{'$or':_['map'](_0x2b7947,function(_0x3c1c99){if(_0x3c1c99[_0xc647('0x2c')]!==_0xc647('0x3f')){var _0x42d248={};_0x42d248[_0x3c1c99['name']]={'$like':'%'+_0x39119e[_0xc647('0x2f')]['filter']+'%'};return _0x42d248;}})});}_0x139e21=_['merge']({},_0x139e21,_0x39119e[_0xc647('0x40')]);var _0x3b1296={'where':_0x139e21['where']};return db[_0xc647('0x41')][_0xc647('0x1d')](_0x3b1296)[_0xc647('0x25')](function(_0x30ea19){_0x2432fe['count']=_0x30ea19;if(_0x39119e[_0xc647('0x2f')]['includeAll']){_0x139e21[_0xc647('0x42')]=[{'all':!![]}];}return db[_0xc647('0x41')]['findAll'](_0x139e21);})['then'](function(_0x317b9d){_0x2432fe[_0xc647('0x43')]=_0x317b9d;return _0x2432fe;})[_0xc647('0x25')](respondWithFilteredResult(_0x39fc93,_0x139e21))[_0xc647('0x44')](handleError(_0x39fc93,null));};exports[_0xc647('0x45')]=function(_0x283254,_0x4dabc6){var _0x31a908={'raw':!![],'where':{'id':_0x283254[_0xc647('0x46')]['id']}},_0x1693ab={};_0x1693ab[_0xc647('0x32')]=_['keys'](db[_0xc647('0x41')][_0xc647('0x2a')]);_0x1693ab[_0xc647('0x2f')]=_[_0xc647('0x30')](_0x283254['query']);_0x1693ab[_0xc647('0x3b')]=_['intersection'](_0x1693ab[_0xc647('0x32')],_0x1693ab[_0xc647('0x2f')]);_0x31a908[_0xc647('0x33')]=_['intersection'](_0x1693ab[_0xc647('0x32')],qs[_0xc647('0x34')](_0x283254[_0xc647('0x2f')]['fields']));_0x31a908[_0xc647('0x33')]=_0x31a908[_0xc647('0x33')][_0xc647('0x35')]?_0x31a908[_0xc647('0x33')]:_0x1693ab[_0xc647('0x32')];if(_0x283254['query'][_0xc647('0x47')]){_0x31a908[_0xc647('0x42')]=[{'all':!![]}];}_0x31a908=_[_0xc647('0x3e')]({},_0x31a908,_0x283254[_0xc647('0x40')]);return db['ChatQueueReport'][_0xc647('0x48')](_0x31a908)[_0xc647('0x25')](handleEntityNotFound(_0x4dabc6,null))[_0xc647('0x25')](respondWithResult(_0x4dabc6,null))[_0xc647('0x44')](handleError(_0x4dabc6,null));};exports[_0xc647('0x49')]=function(_0x27ead8,_0x16d88f){return db[_0xc647('0x41')][_0xc647('0x49')](_0x27ead8[_0xc647('0x4a')],{})[_0xc647('0x25')](respondWithResult(_0x16d88f,0xc9))[_0xc647('0x44')](handleError(_0x16d88f,null));};exports[_0xc647('0x4b')]=function(_0x6fc8d9,_0x3aa8cd){if(_0x6fc8d9[_0xc647('0x4a')]['id']){delete _0x6fc8d9[_0xc647('0x4a')]['id'];}return db['ChatQueueReport'][_0xc647('0x48')]({'where':{'id':_0x6fc8d9[_0xc647('0x46')]['id']}})['then'](handleEntityNotFound(_0x3aa8cd,null))[_0xc647('0x25')](saveUpdates(_0x6fc8d9[_0xc647('0x4a')],null))[_0xc647('0x25')](respondWithResult(_0x3aa8cd,null))['catch'](handleError(_0x3aa8cd,null));};exports[_0xc647('0x24')]=function(_0x58b617,_0x4a4023){return db[_0xc647('0x41')][_0xc647('0x48')]({'where':{'id':_0x58b617['params']['id']}})[_0xc647('0x25')](handleEntityNotFound(_0x4a4023,null))['then'](removeEntity(_0x4a4023,null))[_0xc647('0x44')](handleError(_0x4a4023,null));};exports[_0xc647('0x4c')]=function(_0x26e012,_0x4c163c){return db[_0xc647('0x41')]['describe']()[_0xc647('0x25')](respondWithResult(_0x4c163c,null))[_0xc647('0x44')](handleError(_0x4c163c,null));}; \ No newline at end of file +var _0x5232=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','reject','save','then','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','include','ChatQueueReport','findAll','show','params','includeAll','options','catch','create','body','update','find'];(function(_0x4f0e62,_0x28e44f){var _0x117ab8=function(_0x1a74bb){while(--_0x1a74bb){_0x4f0e62['push'](_0x4f0e62['shift']());}};_0x117ab8(++_0x28e44f);}(_0x5232,0x1c9));var _0x2523=function(_0x437d7f,_0x1feb46){_0x437d7f=_0x437d7f-0x0;var _0x31058c=_0x5232[_0x437d7f];return _0x31058c;};'use strict';var emlformat=require(_0x2523('0x0'));var rimraf=require(_0x2523('0x1'));var zipdir=require(_0x2523('0x2'));var jsonpatch=require(_0x2523('0x3'));var rp=require(_0x2523('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2523('0x5'));var util=require(_0x2523('0x6'));var path=require('path');var sox=require(_0x2523('0x7'));var csv=require(_0x2523('0x8'));var ejs=require(_0x2523('0x9'));var fs=require('fs');var fs_extra=require(_0x2523('0xa'));var _=require(_0x2523('0xb'));var squel=require(_0x2523('0xc'));var crypto=require(_0x2523('0xd'));var jsforce=require(_0x2523('0xe'));var deskjs=require(_0x2523('0xf'));var toCsv=require(_0x2523('0x8'));var querystring=require(_0x2523('0x10'));var Papa=require(_0x2523('0x11'));var Redis=require('ioredis');var authService=require(_0x2523('0x12'));var qs=require(_0x2523('0x13'));var as=require(_0x2523('0x14'));var hardwareService=require(_0x2523('0x15'));var logger=require(_0x2523('0x16'))(_0x2523('0x17'));var utils=require('../../config/utils');var config=require(_0x2523('0x18'));var licenseUtil=require(_0x2523('0x19'));var db=require(_0x2523('0x1a'))['db'];function respondWithStatusCode(_0x99685a,_0x5176d5){_0x5176d5=_0x5176d5||0xcc;return function(_0x37f270){if(_0x37f270){return _0x99685a[_0x2523('0x1b')](_0x5176d5);}return _0x99685a['status'](_0x5176d5)[_0x2523('0x1c')]();};}function respondWithResult(_0x2cd6e1,_0xc9898b){_0xc9898b=_0xc9898b||0xc8;return function(_0xc09a01){if(_0xc09a01){return _0x2cd6e1['status'](_0xc9898b)[_0x2523('0x1d')](_0xc09a01);}};}function respondWithFilteredResult(_0x5974a6,_0x3f9b51){return function(_0x1ac5d3){if(_0x1ac5d3){var _0x173218=typeof _0x3f9b51[_0x2523('0x1e')]==='undefined'&&typeof _0x3f9b51[_0x2523('0x1f')]===_0x2523('0x20');var _0x108159=_0x1ac5d3[_0x2523('0x21')];var _0x1ce828=_0x173218?0x0:_0x3f9b51[_0x2523('0x1e')];var _0x4f2a85=_0x173218?_0x1ac5d3[_0x2523('0x21')]:_0x3f9b51[_0x2523('0x1e')]+_0x3f9b51['limit'];var _0x2819aa;if(_0x4f2a85>=_0x108159){_0x4f2a85=_0x108159;_0x2819aa=0xc8;}else{_0x2819aa=0xce;}_0x5974a6[_0x2523('0x22')](_0x2819aa);return _0x5974a6[_0x2523('0x23')](_0x2523('0x24'),_0x1ce828+'-'+_0x4f2a85+'/'+_0x108159)['json'](_0x1ac5d3);}return null;};}function patchUpdates(_0x4f94c9){return function(_0x4e9498){try{jsonpatch['apply'](_0x4e9498,_0x4f94c9,!![]);}catch(_0x1d52dc){return BPromise[_0x2523('0x25')](_0x1d52dc);}return _0x4e9498[_0x2523('0x26')]();};}function saveUpdates(_0x3baae5,_0x1c39d8){return function(_0x578a83){if(_0x578a83){return _0x578a83['update'](_0x3baae5)['then'](function(_0x50e34e){return _0x50e34e;});}return null;};}function removeEntity(_0x14a685,_0x4847c1){return function(_0x4fc304){if(_0x4fc304){return _0x4fc304['destroy']()[_0x2523('0x27')](function(){_0x14a685[_0x2523('0x22')](0xcc)[_0x2523('0x1c')]();});}};}function handleEntityNotFound(_0x393956,_0xd47858){return function(_0x5495f4){if(!_0x5495f4){_0x393956[_0x2523('0x1b')](0x194);}return _0x5495f4;};}function handleError(_0x45366f,_0x3a8b48){_0x3a8b48=_0x3a8b48||0x1f4;return function(_0x1a8b0c){logger[_0x2523('0x28')](_0x1a8b0c[_0x2523('0x29')]);if(_0x1a8b0c[_0x2523('0x2a')]){delete _0x1a8b0c[_0x2523('0x2a')];}_0x45366f[_0x2523('0x22')](_0x3a8b48)['send'](_0x1a8b0c);};}exports[_0x2523('0x2b')]=function(_0x1565a8,_0x53b772){var _0x304dd4={},_0x52b25d={},_0x4cb11f={'count':0x0,'rows':[]};var _0x5e0ada=_[_0x2523('0x2c')](db['ChatQueueReport'][_0x2523('0x2d')],function(_0x577c90){return{'name':_0x577c90[_0x2523('0x2e')],'type':_0x577c90[_0x2523('0x2f')]['key']};});_0x52b25d[_0x2523('0x30')]=_['map'](_0x5e0ada,_0x2523('0x2a'));_0x52b25d[_0x2523('0x31')]=_[_0x2523('0x32')](_0x1565a8[_0x2523('0x31')]);_0x52b25d[_0x2523('0x33')]=_[_0x2523('0x34')](_0x52b25d['model'],_0x52b25d[_0x2523('0x31')]);_0x304dd4[_0x2523('0x35')]=_[_0x2523('0x34')](_0x52b25d['model'],qs[_0x2523('0x36')](_0x1565a8['query'][_0x2523('0x36')]));_0x304dd4[_0x2523('0x35')]=_0x304dd4[_0x2523('0x35')][_0x2523('0x37')]?_0x304dd4[_0x2523('0x35')]:_0x52b25d[_0x2523('0x30')];if(!_0x1565a8[_0x2523('0x31')]['hasOwnProperty'](_0x2523('0x38'))){_0x304dd4[_0x2523('0x1f')]=qs[_0x2523('0x1f')](_0x1565a8[_0x2523('0x31')][_0x2523('0x1f')]);_0x304dd4['offset']=qs[_0x2523('0x1e')](_0x1565a8[_0x2523('0x31')][_0x2523('0x1e')]);}_0x304dd4[_0x2523('0x39')]=qs['sort'](_0x1565a8[_0x2523('0x31')]['sort']);_0x304dd4[_0x2523('0x3a')]=qs['filters'](_[_0x2523('0x3b')](_0x1565a8[_0x2523('0x31')],_0x52b25d[_0x2523('0x33')]),_0x5e0ada);if(_0x1565a8[_0x2523('0x31')][_0x2523('0x3c')]){_0x304dd4[_0x2523('0x3a')]=_[_0x2523('0x3d')](_0x304dd4[_0x2523('0x3a')],{'$or':_['map'](_0x5e0ada,function(_0x24aea8){if(_0x24aea8[_0x2523('0x2f')]!==_0x2523('0x3e')){var _0x2cd540={};_0x2cd540[_0x24aea8[_0x2523('0x2a')]]={'$like':'%'+_0x1565a8['query'][_0x2523('0x3c')]+'%'};return _0x2cd540;}})});}_0x304dd4=_[_0x2523('0x3d')]({},_0x304dd4,_0x1565a8['options']);var _0x4a5171={'where':_0x304dd4[_0x2523('0x3a')]};return db['ChatQueueReport'][_0x2523('0x21')](_0x4a5171)[_0x2523('0x27')](function(_0x200a6d){_0x4cb11f[_0x2523('0x21')]=_0x200a6d;if(_0x1565a8['query']['includeAll']){_0x304dd4[_0x2523('0x3f')]=[{'all':!![]}];}return db[_0x2523('0x40')][_0x2523('0x41')](_0x304dd4);})[_0x2523('0x27')](function(_0x14104c){_0x4cb11f['rows']=_0x14104c;return _0x4cb11f;})['then'](respondWithFilteredResult(_0x53b772,_0x304dd4))['catch'](handleError(_0x53b772,null));};exports[_0x2523('0x42')]=function(_0x19f453,_0xceff81){var _0x574e6e={'raw':!![],'where':{'id':_0x19f453[_0x2523('0x43')]['id']}},_0x24e0e1={};_0x24e0e1['model']=_[_0x2523('0x32')](db[_0x2523('0x40')][_0x2523('0x2d')]);_0x24e0e1[_0x2523('0x31')]=_[_0x2523('0x32')](_0x19f453['query']);_0x24e0e1[_0x2523('0x33')]=_[_0x2523('0x34')](_0x24e0e1[_0x2523('0x30')],_0x24e0e1[_0x2523('0x31')]);_0x574e6e['attributes']=_[_0x2523('0x34')](_0x24e0e1[_0x2523('0x30')],qs[_0x2523('0x36')](_0x19f453[_0x2523('0x31')]['fields']));_0x574e6e['attributes']=_0x574e6e[_0x2523('0x35')]['length']?_0x574e6e[_0x2523('0x35')]:_0x24e0e1[_0x2523('0x30')];if(_0x19f453[_0x2523('0x31')][_0x2523('0x44')]){_0x574e6e[_0x2523('0x3f')]=[{'all':!![]}];}_0x574e6e=_['merge']({},_0x574e6e,_0x19f453[_0x2523('0x45')]);return db[_0x2523('0x40')]['find'](_0x574e6e)[_0x2523('0x27')](handleEntityNotFound(_0xceff81,null))[_0x2523('0x27')](respondWithResult(_0xceff81,null))[_0x2523('0x46')](handleError(_0xceff81,null));};exports['create']=function(_0x337993,_0x1a1268){return db[_0x2523('0x40')][_0x2523('0x47')](_0x337993[_0x2523('0x48')],{})['then'](respondWithResult(_0x1a1268,0xc9))[_0x2523('0x46')](handleError(_0x1a1268,null));};exports[_0x2523('0x49')]=function(_0x4d0727,_0x569caa){if(_0x4d0727['body']['id']){delete _0x4d0727['body']['id'];}return db[_0x2523('0x40')][_0x2523('0x4a')]({'where':{'id':_0x4d0727[_0x2523('0x43')]['id']}})[_0x2523('0x27')](handleEntityNotFound(_0x569caa,null))[_0x2523('0x27')](saveUpdates(_0x4d0727[_0x2523('0x48')],null))[_0x2523('0x27')](respondWithResult(_0x569caa,null))['catch'](handleError(_0x569caa,null));};exports['destroy']=function(_0x5ec3e2,_0x66d07c){return db[_0x2523('0x40')]['find']({'where':{'id':_0x5ec3e2[_0x2523('0x43')]['id']}})[_0x2523('0x27')](handleEntityNotFound(_0x66d07c,null))[_0x2523('0x27')](removeEntity(_0x66d07c,null))['catch'](handleError(_0x66d07c,null));};exports[_0x2523('0x4b')]=function(_0x7de3e8,_0x22ad10){return db['ChatQueueReport']['describe']()[_0x2523('0x27')](respondWithResult(_0x22ad10,null))[_0x2523('0x46')](handleError(_0x22ad10,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 8163fd6..4fdcd75 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x107f87,_0x2fc1b3){var _0x1a18fe=function(_0x4d737c){while(--_0x4d737c){_0x107f87['push'](_0x107f87['shift']());}};_0x1a18fe(++_0x2fc1b3);}(_0xe706,0xa3));var _0x6e70=function(_0x1abb18,_0x3960ec){_0x1abb18=_0x1abb18-0x0;var _0x2a4e44=_0xe706[_0x1abb18];return _0x2a4e44;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x12946c,_0x4beef9){var _0x3b25b0=function(_0x5b0872){while(--_0x5b0872){_0x12946c['push'](_0x12946c['shift']());}};_0x3b25b0(++_0x4beef9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 2c05d37..b5fd66a 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 _0xa1a4=['client','http','request','then','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','info','result','catch','ChatQueueReport','create','options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','body','limit','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x49a837,_0xbc87df){var _0x1596f0=function(_0x5226b1){while(--_0x5226b1){_0x49a837['push'](_0x49a837['shift']());}};_0x1596f0(++_0xbc87df);}(_0xa1a4,0x11f));var _0x4a1a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa1a4[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x4a1a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4a1a('0x1'));var rs=require(_0x4a1a('0x2'));var fs=require('fs');var Redis=require(_0x4a1a('0x3'));var db=require(_0x4a1a('0x4'))['db'];var utils=require(_0x4a1a('0x5'));var logger=require(_0x4a1a('0x6'))(_0x4a1a('0x7'));var config=require(_0x4a1a('0x8'));var jayson=require(_0x4a1a('0x9'));var client=jayson[_0x4a1a('0xa')][_0x4a1a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16bb6d,_0x4b90f0,_0x6109cc){return new BPromise(function(_0x51c432,_0xcd0771){return client[_0x4a1a('0xc')](_0x16bb6d,_0x6109cc)[_0x4a1a('0xd')](function(_0x27238a){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x4b90f0,'request\x20sent');logger['debug'](_0x4a1a('0xe'),_0x4b90f0,_0x4a1a('0xf'),JSON[_0x4a1a('0x10')](_0x27238a));if(_0x27238a[_0x4a1a('0x11')]){if(_0x27238a[_0x4a1a('0x11')]['code']===0x1f4){logger[_0x4a1a('0x11')](_0x4a1a('0x12'),_0x4b90f0,_0x27238a[_0x4a1a('0x11')][_0x4a1a('0x13')]);return _0xcd0771(_0x27238a[_0x4a1a('0x11')][_0x4a1a('0x13')]);}logger['error'](_0x4a1a('0x12'),_0x4b90f0,_0x27238a[_0x4a1a('0x11')][_0x4a1a('0x13')]);return _0x51c432(_0x27238a['error'][_0x4a1a('0x13')]);}else{logger[_0x4a1a('0x14')](_0x4a1a('0x12'),_0x4b90f0,'request\x20sent');_0x51c432(_0x27238a[_0x4a1a('0x15')][_0x4a1a('0x13')]);}})[_0x4a1a('0x16')](function(_0x36c55d){logger[_0x4a1a('0x11')](_0x4a1a('0x12'),_0x4b90f0,_0x36c55d);_0xcd0771(_0x36c55d);});});}exports['CreateChatQueueReport']=function(_0x477c9e){var _0xad38b0=this;return new Promise(function(_0x5e1376,_0x356f06){return db[_0x4a1a('0x17')][_0x4a1a('0x18')](_0x477c9e['body'],{'raw':_0x477c9e[_0x4a1a('0x19')]?_0x477c9e[_0x4a1a('0x19')][_0x4a1a('0x1a')]===undefined?!![]:![]:!![]})[_0x4a1a('0xd')](function(_0x5e6f2f){logger[_0x4a1a('0x14')](_0x4a1a('0x1b'),_0x477c9e);logger['debug'](_0x4a1a('0x1b'),_0x477c9e,JSON['stringify'](_0x5e6f2f));_0x5e1376(_0x5e6f2f);})['catch'](function(_0x308fe5){logger[_0x4a1a('0x11')]('CreateChatQueueReport',_0x308fe5['message'],_0x477c9e);_0x356f06(_0xad38b0[_0x4a1a('0x11')](0x1f4,_0x308fe5[_0x4a1a('0x13')]));});});};exports[_0x4a1a('0x1c')]=function(_0x46e0af){var _0x7ed1c5=this;return new Promise(function(_0x54800a,_0xcb5804){return db['ChatQueueReport'][_0x4a1a('0x1d')](_0x46e0af[_0x4a1a('0x1e')],{'raw':_0x46e0af['options']?_0x46e0af[_0x4a1a('0x19')][_0x4a1a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46e0af[_0x4a1a('0x19')]?_0x46e0af['options']['where']||null:null,'attributes':_0x46e0af[_0x4a1a('0x19')]?_0x46e0af[_0x4a1a('0x19')]['attributes']||null:null,'limit':_0x46e0af[_0x4a1a('0x19')]?_0x46e0af[_0x4a1a('0x19')][_0x4a1a('0x1f')]||null:null})[_0x4a1a('0xd')](function(_0x347571){logger[_0x4a1a('0x14')](_0x4a1a('0x1c'),_0x46e0af);logger[_0x4a1a('0x20')]('UpdateChatQueueReport',_0x46e0af,JSON[_0x4a1a('0x10')](_0x347571));_0x54800a(_0x347571);})[_0x4a1a('0x16')](function(_0x1e1999){logger[_0x4a1a('0x11')](_0x4a1a('0x1c'),_0x1e1999[_0x4a1a('0x13')],_0x46e0af);_0xcb5804(_0x7ed1c5['error'](0x1f4,_0x1e1999['message']));});});}; \ No newline at end of file +var _0x9813=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','CreateChatQueueReport','ChatQueueReport','update','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xfd4695,_0x44cb97){var _0x5a6582=function(_0x3078ae){while(--_0x3078ae){_0xfd4695['push'](_0xfd4695['shift']());}};_0x5a6582(++_0x44cb97);}(_0x9813,0x112));var _0x3981=function(_0x490747,_0x2d7d50){_0x490747=_0x490747-0x0;var _0x13dbb4=_0x9813[_0x490747];return _0x13dbb4;};'use strict';var _=require(_0x3981('0x0'));var util=require(_0x3981('0x1'));var moment=require(_0x3981('0x2'));var BPromise=require(_0x3981('0x3'));var rs=require(_0x3981('0x4'));var fs=require('fs');var Redis=require(_0x3981('0x5'));var db=require(_0x3981('0x6'))['db'];var utils=require(_0x3981('0x7'));var logger=require('../../config/logger')(_0x3981('0x8'));var config=require(_0x3981('0x9'));var jayson=require(_0x3981('0xa'));var client=jayson[_0x3981('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x308326,_0x51899b,_0x2f1280){return new BPromise(function(_0x3042af,_0x108d17){return client[_0x3981('0xc')](_0x308326,_0x2f1280)[_0x3981('0xd')](function(_0x1588b2){logger[_0x3981('0xe')](_0x3981('0xf'),_0x51899b,_0x3981('0x10'));logger[_0x3981('0x11')](_0x3981('0x12'),_0x51899b,'request\x20sent',JSON[_0x3981('0x13')](_0x1588b2));if(_0x1588b2['error']){if(_0x1588b2[_0x3981('0x14')][_0x3981('0x15')]===0x1f4){logger[_0x3981('0x14')](_0x3981('0xf'),_0x51899b,_0x1588b2['error'][_0x3981('0x16')]);return _0x108d17(_0x1588b2[_0x3981('0x14')][_0x3981('0x16')]);}logger[_0x3981('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x51899b,_0x1588b2[_0x3981('0x14')][_0x3981('0x16')]);return _0x3042af(_0x1588b2['error'][_0x3981('0x16')]);}else{logger[_0x3981('0xe')](_0x3981('0xf'),_0x51899b,_0x3981('0x10'));_0x3042af(_0x1588b2[_0x3981('0x17')][_0x3981('0x16')]);}})[_0x3981('0x18')](function(_0x110874){logger['error'](_0x3981('0xf'),_0x51899b,_0x110874);_0x108d17(_0x110874);});});}exports['CreateChatQueueReport']=function(_0x51cb8a){var _0x4935f1=this;return new Promise(function(_0x2c7395,_0x5163ab){return db['ChatQueueReport'][_0x3981('0x19')](_0x51cb8a[_0x3981('0x1a')],{'raw':_0x51cb8a['options']?_0x51cb8a[_0x3981('0x1b')][_0x3981('0x1c')]===undefined?!![]:![]:!![]})[_0x3981('0xd')](function(_0x4fd294){logger[_0x3981('0xe')](_0x3981('0x1d'),_0x51cb8a);logger[_0x3981('0x11')]('CreateChatQueueReport',_0x51cb8a,JSON[_0x3981('0x13')](_0x4fd294));_0x2c7395(_0x4fd294);})[_0x3981('0x18')](function(_0x3bd0f2){logger['error']('CreateChatQueueReport',_0x3bd0f2[_0x3981('0x16')],_0x51cb8a);_0x5163ab(_0x4935f1[_0x3981('0x14')](0x1f4,_0x3bd0f2[_0x3981('0x16')]));});});};exports['UpdateChatQueueReport']=function(_0x4e6362){var _0x5e0707=this;return new Promise(function(_0xfb28f5,_0x462f5){return db[_0x3981('0x1e')][_0x3981('0x1f')](_0x4e6362['body'],{'raw':_0x4e6362[_0x3981('0x1b')]?_0x4e6362['options'][_0x3981('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e6362['options']?_0x4e6362[_0x3981('0x1b')]['where']||null:null,'attributes':_0x4e6362[_0x3981('0x1b')]?_0x4e6362[_0x3981('0x1b')][_0x3981('0x20')]||null:null,'limit':_0x4e6362[_0x3981('0x1b')]?_0x4e6362['options'][_0x3981('0x21')]||null:null})['then'](function(_0x428dbb){logger[_0x3981('0xe')](_0x3981('0x22'),_0x4e6362);logger[_0x3981('0x11')](_0x3981('0x22'),_0x4e6362,JSON[_0x3981('0x13')](_0x428dbb));_0xfb28f5(_0x428dbb);})[_0x3981('0x18')](function(_0x5adc0c){logger['error'](_0x3981('0x22'),_0x5adc0c[_0x3981('0x16')],_0x4e6362);_0x462f5(_0x5e0707[_0x3981('0x14')](0x1f4,_0x5adc0c[_0x3981('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index ffedf97..f149ea9 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 _0x46f3=['../../config/environment','./chatQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','multer','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x2327f5,_0x3728be){var _0x2584c7=function(_0x46a233){while(--_0x46a233){_0x2327f5['push'](_0x2327f5['shift']());}};_0x2584c7(++_0x3728be);}(_0x46f3,0x12a));var _0x346f=function(_0x1cc980,_0x406fc1){_0x1cc980=_0x1cc980-0x0;var _0x50905f=_0x46f3[_0x1cc980];return _0x50905f;};'use strict';var multer=require(_0x346f('0x0'));var util=require(_0x346f('0x1'));var path=require('path');var timeout=require(_0x346f('0x2'));var express=require(_0x346f('0x3'));var router=express[_0x346f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x346f('0x5'));var config=require(_0x346f('0x6'));var controller=require(_0x346f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x346f('0x8')]);router[_0x346f('0x9')](_0x346f('0xa'),auth[_0x346f('0xb')](),controller[_0x346f('0xc')]);router['get'](_0x346f('0xd'),auth[_0x346f('0xb')](),controller[_0x346f('0xe')]);router[_0x346f('0xf')]('/',auth[_0x346f('0xb')](),controller['create']);router[_0x346f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x346f('0x11')]);router[_0x346f('0x12')](_0x346f('0xd'),auth[_0x346f('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0163=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0xb833b1,_0x1c3d3f){var _0x1ab87a=function(_0x1c9f6c){while(--_0x1c9f6c){_0xb833b1['push'](_0xb833b1['shift']());}};_0x1ab87a(++_0x1c3d3f);}(_0x0163,0xc3));var _0x3016=function(_0x5b3c90,_0x45b28c){_0x5b3c90=_0x5b3c90-0x0;var _0xd1ae5e=_0x0163[_0x5b3c90];return _0xd1ae5e;};'use strict';var multer=require('multer');var util=require(_0x3016('0x0'));var path=require(_0x3016('0x1'));var timeout=require(_0x3016('0x2'));var express=require(_0x3016('0x3'));var router=express[_0x3016('0x4')]();var fs_extra=require(_0x3016('0x5'));var auth=require(_0x3016('0x6'));var interaction=require(_0x3016('0x7'));var config=require(_0x3016('0x8'));var controller=require(_0x3016('0x9'));router[_0x3016('0xa')]('/',auth[_0x3016('0xb')](),controller['index']);router['get'](_0x3016('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x3016('0xa')](_0x3016('0xd'),auth[_0x3016('0xb')](),controller[_0x3016('0xe')]);router[_0x3016('0xf')]('/',auth[_0x3016('0xb')](),controller[_0x3016('0x10')]);router[_0x3016('0x11')](_0x3016('0xd'),auth[_0x3016('0xb')](),controller['update']);router[_0x3016('0x12')](_0x3016('0xd'),auth['isAuthenticated'](),controller[_0x3016('0x13')]);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 3848eab..19c50c6 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x48b487,_0x3a4fd3){var _0x11d0a3=function(_0x4bc892){while(--_0x4bc892){_0x48b487['push'](_0x48b487['shift']());}};_0x11d0a3(++_0x3a4fd3);}(_0x70e0,0x17b));var _0x070e=function(_0x397cf1,_0x1907f7){_0x397cf1=_0x397cf1-0x0;var _0x20746c=_0x70e0[_0x397cf1];return _0x20746c;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x807de4,_0x469b42){var _0x3224f3=function(_0x15ba3d){while(--_0x15ba3d){_0x807de4['push'](_0x807de4['shift']());}};_0x3224f3(++_0x469b42);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0xcb91[_0x4695ba];return _0x524b7d;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 43e6fa7..a488fc8 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 _0x2125=['include','findAll','catch','params','rawAttributes','find','create','update','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','offset','undefined','count','limit','status','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x3e681e,_0x42c7ef){var _0x1644a1=function(_0x1e51ab){while(--_0x1e51ab){_0x3e681e['push'](_0x3e681e['shift']());}};_0x1644a1(++_0x42c7ef);}(_0x2125,0xa2));var _0x5212=function(_0x41a936,_0x420694){_0x41a936=_0x41a936-0x0;var _0x378dbc=_0x2125[_0x41a936];return _0x378dbc;};'use strict';var emlformat=require(_0x5212('0x0'));var rimraf=require(_0x5212('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5212('0x2'));var rp=require(_0x5212('0x3'));var moment=require(_0x5212('0x4'));var BPromise=require(_0x5212('0x5'));var Mustache=require(_0x5212('0x6'));var util=require('util');var path=require('path');var sox=require(_0x5212('0x7'));var csv=require(_0x5212('0x8'));var ejs=require(_0x5212('0x9'));var fs=require('fs');var fs_extra=require(_0x5212('0xa'));var _=require(_0x5212('0xb'));var squel=require(_0x5212('0xc'));var crypto=require(_0x5212('0xd'));var jsforce=require(_0x5212('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5212('0x8'));var querystring=require(_0x5212('0xf'));var Papa=require(_0x5212('0x10'));var Redis=require(_0x5212('0x11'));var authService=require(_0x5212('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5212('0x13'));var logger=require(_0x5212('0x14'))(_0x5212('0x15'));var utils=require(_0x5212('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5212('0x17'));var db=require(_0x5212('0x18'))['db'];function respondWithStatusCode(_0x62a8bd,_0x5efccf){_0x5efccf=_0x5efccf||0xcc;return function(_0x79e9b7){if(_0x79e9b7){return _0x62a8bd['sendStatus'](_0x5efccf);}return _0x62a8bd['status'](_0x5efccf)[_0x5212('0x19')]();};}function respondWithResult(_0x3bd078,_0x1d9e62){_0x1d9e62=_0x1d9e62||0xc8;return function(_0x22a872){if(_0x22a872){return _0x3bd078['status'](_0x1d9e62)['json'](_0x22a872);}};}function respondWithFilteredResult(_0x1b03a8,_0xd4e121){return function(_0x5d0fa1){if(_0x5d0fa1){var _0x7afea1=typeof _0xd4e121[_0x5212('0x1a')]===_0x5212('0x1b')&&typeof _0xd4e121['limit']==='undefined';var _0x38fece=_0x5d0fa1[_0x5212('0x1c')];var _0x5dd981=_0x7afea1?0x0:_0xd4e121[_0x5212('0x1a')];var _0x2d240e=_0x7afea1?_0x5d0fa1['count']:_0xd4e121['offset']+_0xd4e121[_0x5212('0x1d')];var _0xf13c5c;if(_0x2d240e>=_0x38fece){_0x2d240e=_0x38fece;_0xf13c5c=0xc8;}else{_0xf13c5c=0xce;}_0x1b03a8[_0x5212('0x1e')](_0xf13c5c);return _0x1b03a8[_0x5212('0x1f')](_0x5212('0x20'),_0x5dd981+'-'+_0x2d240e+'/'+_0x38fece)[_0x5212('0x21')](_0x5d0fa1);}return null;};}function patchUpdates(_0x57954c){return function(_0x545335){try{jsonpatch[_0x5212('0x22')](_0x545335,_0x57954c,!![]);}catch(_0x8a513c){return BPromise[_0x5212('0x23')](_0x8a513c);}return _0x545335[_0x5212('0x24')]();};}function saveUpdates(_0x4e5134,_0x1a2e45){return function(_0x850ed){if(_0x850ed){return _0x850ed['update'](_0x4e5134)[_0x5212('0x25')](function(_0x66d618){return _0x66d618;});}return null;};}function removeEntity(_0x4909a8,_0x15b991){return function(_0x518419){if(_0x518419){return _0x518419[_0x5212('0x26')]()[_0x5212('0x25')](function(){_0x4909a8[_0x5212('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44bed9,_0x3d867f){return function(_0x2367e5){if(!_0x2367e5){_0x44bed9['sendStatus'](0x194);}return _0x2367e5;};}function handleError(_0x303081,_0x434ad5){_0x434ad5=_0x434ad5||0x1f4;return function(_0x8ced9f){logger['error'](_0x8ced9f[_0x5212('0x27')]);if(_0x8ced9f[_0x5212('0x28')]){delete _0x8ced9f['name'];}_0x303081['status'](_0x434ad5)[_0x5212('0x29')](_0x8ced9f);};}exports[_0x5212('0x2a')]=function(_0x1a9667,_0x3f1921){var _0x1c102c={},_0x15ebbf={},_0x19d8ae={'count':0x0,'rows':[]};var _0x2f5f6a=_[_0x5212('0x2b')](db[_0x5212('0x2c')]['rawAttributes'],function(_0x3ded87){return{'name':_0x3ded87[_0x5212('0x2d')],'type':_0x3ded87[_0x5212('0x2e')][_0x5212('0x2f')]};});_0x15ebbf[_0x5212('0x30')]=_['map'](_0x2f5f6a,'name');_0x15ebbf[_0x5212('0x31')]=_[_0x5212('0x32')](_0x1a9667[_0x5212('0x31')]);_0x15ebbf[_0x5212('0x33')]=_[_0x5212('0x34')](_0x15ebbf[_0x5212('0x30')],_0x15ebbf[_0x5212('0x31')]);_0x1c102c[_0x5212('0x35')]=_[_0x5212('0x34')](_0x15ebbf[_0x5212('0x30')],qs[_0x5212('0x36')](_0x1a9667['query'][_0x5212('0x36')]));_0x1c102c['attributes']=_0x1c102c['attributes'][_0x5212('0x37')]?_0x1c102c[_0x5212('0x35')]:_0x15ebbf[_0x5212('0x30')];if(!_0x1a9667[_0x5212('0x31')][_0x5212('0x38')](_0x5212('0x39'))){_0x1c102c[_0x5212('0x1d')]=qs[_0x5212('0x1d')](_0x1a9667[_0x5212('0x31')][_0x5212('0x1d')]);_0x1c102c[_0x5212('0x1a')]=qs[_0x5212('0x1a')](_0x1a9667['query'][_0x5212('0x1a')]);}_0x1c102c['order']=qs[_0x5212('0x3a')](_0x1a9667[_0x5212('0x31')][_0x5212('0x3a')]);_0x1c102c[_0x5212('0x3b')]=qs[_0x5212('0x33')](_[_0x5212('0x3c')](_0x1a9667[_0x5212('0x31')],_0x15ebbf[_0x5212('0x33')]),_0x2f5f6a);if(_0x1a9667[_0x5212('0x31')][_0x5212('0x3d')]){_0x1c102c[_0x5212('0x3b')]=_[_0x5212('0x3e')](_0x1c102c[_0x5212('0x3b')],{'$or':_[_0x5212('0x2b')](_0x2f5f6a,function(_0x4459f4){if(_0x4459f4[_0x5212('0x2e')]!==_0x5212('0x3f')){var _0x283ed6={};_0x283ed6[_0x4459f4[_0x5212('0x28')]]={'$like':'%'+_0x1a9667[_0x5212('0x31')][_0x5212('0x3d')]+'%'};return _0x283ed6;}})});}_0x1c102c=_[_0x5212('0x3e')]({},_0x1c102c,_0x1a9667[_0x5212('0x40')]);var _0x972349={'where':_0x1c102c[_0x5212('0x3b')]};return db[_0x5212('0x2c')][_0x5212('0x1c')](_0x972349)[_0x5212('0x25')](function(_0x4b7ce6){_0x19d8ae['count']=_0x4b7ce6;if(_0x1a9667[_0x5212('0x31')][_0x5212('0x41')]){_0x1c102c[_0x5212('0x42')]=[{'all':!![]}];}return db[_0x5212('0x2c')][_0x5212('0x43')](_0x1c102c);})[_0x5212('0x25')](function(_0x169b48){_0x19d8ae['rows']=_0x169b48;return _0x19d8ae;})[_0x5212('0x25')](respondWithFilteredResult(_0x3f1921,_0x1c102c))[_0x5212('0x44')](handleError(_0x3f1921,null));};exports['show']=function(_0x3df9d7,_0x588431){var _0x4be2e5={'raw':!![],'where':{'id':_0x3df9d7[_0x5212('0x45')]['id']}},_0x59d0ae={};_0x59d0ae[_0x5212('0x30')]=_[_0x5212('0x32')](db['ChatTransferReport'][_0x5212('0x46')]);_0x59d0ae[_0x5212('0x31')]=_['keys'](_0x3df9d7[_0x5212('0x31')]);_0x59d0ae[_0x5212('0x33')]=_[_0x5212('0x34')](_0x59d0ae[_0x5212('0x30')],_0x59d0ae['query']);_0x4be2e5[_0x5212('0x35')]=_[_0x5212('0x34')](_0x59d0ae[_0x5212('0x30')],qs[_0x5212('0x36')](_0x3df9d7['query'][_0x5212('0x36')]));_0x4be2e5[_0x5212('0x35')]=_0x4be2e5[_0x5212('0x35')][_0x5212('0x37')]?_0x4be2e5[_0x5212('0x35')]:_0x59d0ae['model'];if(_0x3df9d7['query'][_0x5212('0x41')]){_0x4be2e5[_0x5212('0x42')]=[{'all':!![]}];}_0x4be2e5=_[_0x5212('0x3e')]({},_0x4be2e5,_0x3df9d7['options']);return db[_0x5212('0x2c')][_0x5212('0x47')](_0x4be2e5)[_0x5212('0x25')](handleEntityNotFound(_0x588431,null))[_0x5212('0x25')](respondWithResult(_0x588431,null))[_0x5212('0x44')](handleError(_0x588431,null));};exports[_0x5212('0x48')]=function(_0x4292fc,_0x190fb6){return db['ChatTransferReport'][_0x5212('0x48')](_0x4292fc['body'],{})[_0x5212('0x25')](respondWithResult(_0x190fb6,0xc9))[_0x5212('0x44')](handleError(_0x190fb6,null));};exports[_0x5212('0x49')]=function(_0x2bab31,_0x2f5dc6){if(_0x2bab31['body']['id']){delete _0x2bab31[_0x5212('0x4a')]['id'];}return db[_0x5212('0x2c')]['find']({'where':{'id':_0x2bab31[_0x5212('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f5dc6,null))['then'](saveUpdates(_0x2bab31[_0x5212('0x4a')],null))['then'](respondWithResult(_0x2f5dc6,null))[_0x5212('0x44')](handleError(_0x2f5dc6,null));};exports[_0x5212('0x26')]=function(_0x5cd04b,_0x3ad872){return db[_0x5212('0x2c')][_0x5212('0x47')]({'where':{'id':_0x5cd04b[_0x5212('0x45')]['id']}})[_0x5212('0x25')](handleEntityNotFound(_0x3ad872,null))[_0x5212('0x25')](removeEntity(_0x3ad872,null))['catch'](handleError(_0x3ad872,null));};exports[_0x5212('0x4b')]=function(_0x5dac1f,_0x10263f){return db[_0x5212('0x2c')]['describe']()[_0x5212('0x25')](respondWithResult(_0x10263f,null))[_0x5212('0x44')](handleError(_0x10263f,null));}; \ No newline at end of file +var _0xac97=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','options','find','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','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','../../config/license/util','status','json','offset','undefined','limit','count','reject','save','then','end','sendStatus','stack','name','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x58252d,_0x2070b3){var _0x55a98c=function(_0x4a2a1e){while(--_0x4a2a1e){_0x58252d['push'](_0x58252d['shift']());}};_0x55a98c(++_0x2070b3);}(_0xac97,0xf3));var _0x7ac9=function(_0x42f82f,_0x46e11e){_0x42f82f=_0x42f82f-0x0;var _0x3e2284=_0xac97[_0x42f82f];return _0x3e2284;};'use strict';var emlformat=require(_0x7ac9('0x0'));var rimraf=require(_0x7ac9('0x1'));var zipdir=require(_0x7ac9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7ac9('0x3'));var BPromise=require(_0x7ac9('0x4'));var Mustache=require('mustache');var util=require(_0x7ac9('0x5'));var path=require(_0x7ac9('0x6'));var sox=require(_0x7ac9('0x7'));var csv=require(_0x7ac9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ac9('0x9'));var _=require(_0x7ac9('0xa'));var squel=require(_0x7ac9('0xb'));var crypto=require(_0x7ac9('0xc'));var jsforce=require(_0x7ac9('0xd'));var deskjs=require(_0x7ac9('0xe'));var toCsv=require(_0x7ac9('0x8'));var querystring=require(_0x7ac9('0xf'));var Papa=require(_0x7ac9('0x10'));var Redis=require(_0x7ac9('0x11'));var authService=require(_0x7ac9('0x12'));var qs=require(_0x7ac9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7ac9('0x14'));var utils=require(_0x7ac9('0x15'));var config=require(_0x7ac9('0x16'));var licenseUtil=require(_0x7ac9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x480f9f,_0x2a00a0){_0x2a00a0=_0x2a00a0||0xcc;return function(_0x232e4f){if(_0x232e4f){return _0x480f9f['sendStatus'](_0x2a00a0);}return _0x480f9f[_0x7ac9('0x18')](_0x2a00a0)['end']();};}function respondWithResult(_0x43a09f,_0x497fee){_0x497fee=_0x497fee||0xc8;return function(_0x21a79f){if(_0x21a79f){return _0x43a09f['status'](_0x497fee)[_0x7ac9('0x19')](_0x21a79f);}};}function respondWithFilteredResult(_0x4d0e5b,_0xb3a121){return function(_0x2bec9b){if(_0x2bec9b){var _0x2e5645=typeof _0xb3a121[_0x7ac9('0x1a')]===_0x7ac9('0x1b')&&typeof _0xb3a121[_0x7ac9('0x1c')]===_0x7ac9('0x1b');var _0x56b0e9=_0x2bec9b['count'];var _0x4c7870=_0x2e5645?0x0:_0xb3a121[_0x7ac9('0x1a')];var _0x13f601=_0x2e5645?_0x2bec9b[_0x7ac9('0x1d')]:_0xb3a121[_0x7ac9('0x1a')]+_0xb3a121[_0x7ac9('0x1c')];var _0x2a34cc;if(_0x13f601>=_0x56b0e9){_0x13f601=_0x56b0e9;_0x2a34cc=0xc8;}else{_0x2a34cc=0xce;}_0x4d0e5b['status'](_0x2a34cc);return _0x4d0e5b['set']('Content-Range',_0x4c7870+'-'+_0x13f601+'/'+_0x56b0e9)['json'](_0x2bec9b);}return null;};}function patchUpdates(_0x30f0c8){return function(_0x356369){try{jsonpatch['apply'](_0x356369,_0x30f0c8,!![]);}catch(_0x441650){return BPromise[_0x7ac9('0x1e')](_0x441650);}return _0x356369[_0x7ac9('0x1f')]();};}function saveUpdates(_0x1f3ad2,_0x16cd55){return function(_0x399a8d){if(_0x399a8d){return _0x399a8d['update'](_0x1f3ad2)[_0x7ac9('0x20')](function(_0x14cca5){return _0x14cca5;});}return null;};}function removeEntity(_0x47255f,_0x1bdf3d){return function(_0x5a7bf6){if(_0x5a7bf6){return _0x5a7bf6['destroy']()[_0x7ac9('0x20')](function(){_0x47255f['status'](0xcc)[_0x7ac9('0x21')]();});}};}function handleEntityNotFound(_0x571b0b,_0x1f3725){return function(_0xdcb833){if(!_0xdcb833){_0x571b0b[_0x7ac9('0x22')](0x194);}return _0xdcb833;};}function handleError(_0x560ee7,_0x49b84f){_0x49b84f=_0x49b84f||0x1f4;return function(_0x44e930){logger['error'](_0x44e930[_0x7ac9('0x23')]);if(_0x44e930[_0x7ac9('0x24')]){delete _0x44e930[_0x7ac9('0x24')];}_0x560ee7[_0x7ac9('0x18')](_0x49b84f)['send'](_0x44e930);};}exports['index']=function(_0x228804,_0x36259d){var _0x8dff28={},_0x337739={},_0xffff6e={'count':0x0,'rows':[]};var _0x3f9052=_['map'](db[_0x7ac9('0x25')][_0x7ac9('0x26')],function(_0x3a5d0a){return{'name':_0x3a5d0a[_0x7ac9('0x27')],'type':_0x3a5d0a[_0x7ac9('0x28')][_0x7ac9('0x29')]};});_0x337739[_0x7ac9('0x2a')]=_[_0x7ac9('0x2b')](_0x3f9052,_0x7ac9('0x24'));_0x337739[_0x7ac9('0x2c')]=_[_0x7ac9('0x2d')](_0x228804[_0x7ac9('0x2c')]);_0x337739[_0x7ac9('0x2e')]=_[_0x7ac9('0x2f')](_0x337739[_0x7ac9('0x2a')],_0x337739[_0x7ac9('0x2c')]);_0x8dff28['attributes']=_['intersection'](_0x337739[_0x7ac9('0x2a')],qs[_0x7ac9('0x30')](_0x228804['query'][_0x7ac9('0x30')]));_0x8dff28[_0x7ac9('0x31')]=_0x8dff28[_0x7ac9('0x31')][_0x7ac9('0x32')]?_0x8dff28[_0x7ac9('0x31')]:_0x337739['model'];if(!_0x228804[_0x7ac9('0x2c')][_0x7ac9('0x33')](_0x7ac9('0x34'))){_0x8dff28['limit']=qs[_0x7ac9('0x1c')](_0x228804['query'][_0x7ac9('0x1c')]);_0x8dff28[_0x7ac9('0x1a')]=qs[_0x7ac9('0x1a')](_0x228804[_0x7ac9('0x2c')][_0x7ac9('0x1a')]);}_0x8dff28[_0x7ac9('0x35')]=qs['sort'](_0x228804[_0x7ac9('0x2c')][_0x7ac9('0x36')]);_0x8dff28[_0x7ac9('0x37')]=qs[_0x7ac9('0x2e')](_[_0x7ac9('0x38')](_0x228804['query'],_0x337739['filters']),_0x3f9052);if(_0x228804[_0x7ac9('0x2c')][_0x7ac9('0x39')]){_0x8dff28['where']=_[_0x7ac9('0x3a')](_0x8dff28[_0x7ac9('0x37')],{'$or':_[_0x7ac9('0x2b')](_0x3f9052,function(_0x2d0ce4){if(_0x2d0ce4[_0x7ac9('0x28')]!==_0x7ac9('0x3b')){var _0x5e7632={};_0x5e7632[_0x2d0ce4[_0x7ac9('0x24')]]={'$like':'%'+_0x228804[_0x7ac9('0x2c')][_0x7ac9('0x39')]+'%'};return _0x5e7632;}})});}_0x8dff28=_[_0x7ac9('0x3a')]({},_0x8dff28,_0x228804['options']);var _0x39fb38={'where':_0x8dff28[_0x7ac9('0x37')]};return db[_0x7ac9('0x25')][_0x7ac9('0x1d')](_0x39fb38)[_0x7ac9('0x20')](function(_0x599710){_0xffff6e[_0x7ac9('0x1d')]=_0x599710;if(_0x228804[_0x7ac9('0x2c')][_0x7ac9('0x3c')]){_0x8dff28[_0x7ac9('0x3d')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x7ac9('0x3e')](_0x8dff28);})[_0x7ac9('0x20')](function(_0x553a99){_0xffff6e[_0x7ac9('0x3f')]=_0x553a99;return _0xffff6e;})['then'](respondWithFilteredResult(_0x36259d,_0x8dff28))[_0x7ac9('0x40')](handleError(_0x36259d,null));};exports['show']=function(_0x27f54e,_0x17b37d){var _0x326ce0={'raw':!![],'where':{'id':_0x27f54e['params']['id']}},_0x3be601={};_0x3be601[_0x7ac9('0x2a')]=_[_0x7ac9('0x2d')](db['ChatTransferReport']['rawAttributes']);_0x3be601[_0x7ac9('0x2c')]=_['keys'](_0x27f54e[_0x7ac9('0x2c')]);_0x3be601['filters']=_[_0x7ac9('0x2f')](_0x3be601[_0x7ac9('0x2a')],_0x3be601[_0x7ac9('0x2c')]);_0x326ce0[_0x7ac9('0x31')]=_[_0x7ac9('0x2f')](_0x3be601[_0x7ac9('0x2a')],qs['fields'](_0x27f54e['query'][_0x7ac9('0x30')]));_0x326ce0[_0x7ac9('0x31')]=_0x326ce0[_0x7ac9('0x31')]['length']?_0x326ce0['attributes']:_0x3be601[_0x7ac9('0x2a')];if(_0x27f54e[_0x7ac9('0x2c')][_0x7ac9('0x3c')]){_0x326ce0[_0x7ac9('0x3d')]=[{'all':!![]}];}_0x326ce0=_[_0x7ac9('0x3a')]({},_0x326ce0,_0x27f54e[_0x7ac9('0x41')]);return db[_0x7ac9('0x25')][_0x7ac9('0x42')](_0x326ce0)[_0x7ac9('0x20')](handleEntityNotFound(_0x17b37d,null))['then'](respondWithResult(_0x17b37d,null))['catch'](handleError(_0x17b37d,null));};exports[_0x7ac9('0x43')]=function(_0x1cec58,_0x300c0d){return db[_0x7ac9('0x25')][_0x7ac9('0x43')](_0x1cec58[_0x7ac9('0x44')],{})[_0x7ac9('0x20')](respondWithResult(_0x300c0d,0xc9))['catch'](handleError(_0x300c0d,null));};exports['update']=function(_0x1a8208,_0x9497c8){if(_0x1a8208['body']['id']){delete _0x1a8208[_0x7ac9('0x44')]['id'];}return db['ChatTransferReport'][_0x7ac9('0x42')]({'where':{'id':_0x1a8208['params']['id']}})[_0x7ac9('0x20')](handleEntityNotFound(_0x9497c8,null))[_0x7ac9('0x20')](saveUpdates(_0x1a8208['body'],null))['then'](respondWithResult(_0x9497c8,null))['catch'](handleError(_0x9497c8,null));};exports[_0x7ac9('0x45')]=function(_0x5dc02e,_0x1ffc1d){return db[_0x7ac9('0x25')]['find']({'where':{'id':_0x5dc02e[_0x7ac9('0x46')]['id']}})[_0x7ac9('0x20')](handleEntityNotFound(_0x1ffc1d,null))[_0x7ac9('0x20')](removeEntity(_0x1ffc1d,null))[_0x7ac9('0x40')](handleError(_0x1ffc1d,null));};exports[_0x7ac9('0x47')]=function(_0x59b270,_0x323cea){return db[_0x7ac9('0x25')]['describe']()[_0x7ac9('0x20')](respondWithResult(_0x323cea,null))['catch'](handleError(_0x323cea,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index a910996..3d8e0c9 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 _0x4af0=['./chatTransferReport.attributes','exports','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x3bceea,_0x58af75){var _0x30a8d3=function(_0x1550b5){while(--_0x1550b5){_0x3bceea['push'](_0x3bceea['shift']());}};_0x30a8d3(++_0x58af75);}(_0x4af0,0xa0));var _0x04af=function(_0x412445,_0x3c8c90){_0x412445=_0x412445-0x0;var _0x2fe53d=_0x4af0[_0x412445];return _0x2fe53d;};'use strict';var _=require(_0x04af('0x0'));var util=require(_0x04af('0x1'));var logger=require(_0x04af('0x2'))(_0x04af('0x3'));var moment=require(_0x04af('0x4'));var BPromise=require(_0x04af('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x04af('0x6'));var rimraf=require('rimraf');var config=require(_0x04af('0x7'));var attributes=require(_0x04af('0x8'));module[_0x04af('0x9')]=function(_0x145f2c,_0x576db7){return _0x145f2c['define'](_0x04af('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x04af('0xb'),'fields':[_0x04af('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x60c1=['request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','uniqueid','lodash','api','bluebird'];(function(_0x5be1a9,_0x68854){var _0x11f381=function(_0x32543f){while(--_0x32543f){_0x5be1a9['push'](_0x5be1a9['shift']());}};_0x11f381(++_0x68854);}(_0x60c1,0x11b));var _0x160c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x60c1[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x160c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x160c('0x1'));var moment=require('moment');var BPromise=require(_0x160c('0x2'));var rp=require(_0x160c('0x3'));var fs=require('fs');var path=require(_0x160c('0x4'));var rimraf=require(_0x160c('0x5'));var config=require(_0x160c('0x6'));var attributes=require(_0x160c('0x7'));module[_0x160c('0x8')]=function(_0x4178af,_0x5113bc){return _0x4178af['define'](_0x160c('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x160c('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 72aa52b..65675e1 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 _0x5a5f=['client','http','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5b2a4a,_0x3c58c0){var _0x570cfd=function(_0x1e816a){while(--_0x1e816a){_0x5b2a4a['push'](_0x5b2a4a['shift']());}};_0x570cfd(++_0x3c58c0);}(_0x5a5f,0x1bf));var _0xf5a5=function(_0x597bf3,_0x3a2bd8){_0x597bf3=_0x597bf3-0x0;var _0x4db0db=_0x5a5f[_0x597bf3];return _0x4db0db;};'use strict';var _=require(_0xf5a5('0x0'));var util=require(_0xf5a5('0x1'));var moment=require(_0xf5a5('0x2'));var BPromise=require(_0xf5a5('0x3'));var rs=require(_0xf5a5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf5a5('0x5'))(_0xf5a5('0x6'));var config=require(_0xf5a5('0x7'));var jayson=require(_0xf5a5('0x8'));var client=jayson[_0xf5a5('0x9')][_0xf5a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x544228,_0xfa50c,_0x2cd1c6){return new BPromise(function(_0x192b89,_0x380a2c){return client[_0xf5a5('0xb')](_0x544228,_0x2cd1c6)[_0xf5a5('0xc')](function(_0x33b890){logger[_0xf5a5('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0xfa50c,_0xf5a5('0xe'));logger[_0xf5a5('0xf')](_0xf5a5('0x10'),_0xfa50c,_0xf5a5('0xe'),JSON[_0xf5a5('0x11')](_0x33b890));if(_0x33b890[_0xf5a5('0x12')]){if(_0x33b890[_0xf5a5('0x12')][_0xf5a5('0x13')]===0x1f4){logger[_0xf5a5('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0xfa50c,_0x33b890['error'][_0xf5a5('0x14')]);return _0x380a2c(_0x33b890[_0xf5a5('0x12')][_0xf5a5('0x14')]);}logger['error'](_0xf5a5('0x15'),_0xfa50c,_0x33b890['error'][_0xf5a5('0x14')]);return _0x192b89(_0x33b890[_0xf5a5('0x12')][_0xf5a5('0x14')]);}else{logger[_0xf5a5('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0xfa50c,_0xf5a5('0xe'));_0x192b89(_0x33b890[_0xf5a5('0x16')][_0xf5a5('0x14')]);}})[_0xf5a5('0x17')](function(_0x19d8bc){logger['error'](_0xf5a5('0x15'),_0xfa50c,_0x19d8bc);_0x380a2c(_0x19d8bc);});});} \ No newline at end of file +var _0x0f64=['request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0xf19b15,_0x4f36ca){var _0x112420=function(_0x3e2889){while(--_0x3e2889){_0xf19b15['push'](_0xf19b15['shift']());}};_0x112420(++_0x4f36ca);}(_0x0f64,0x1d5));var _0x40f6=function(_0xa3d7bc,_0x488d4e){_0xa3d7bc=_0xa3d7bc-0x0;var _0x34175d=_0x0f64[_0xa3d7bc];return _0x34175d;};'use strict';var _=require(_0x40f6('0x0'));var util=require(_0x40f6('0x1'));var moment=require(_0x40f6('0x2'));var BPromise=require(_0x40f6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40f6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x40f6('0x5'));var logger=require('../../config/logger')(_0x40f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x40f6('0x7'));var client=jayson[_0x40f6('0x8')][_0x40f6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x386784,_0x4db34e,_0x209b0c){return new BPromise(function(_0x22d477,_0xa4a090){return client[_0x40f6('0xa')](_0x386784,_0x209b0c)[_0x40f6('0xb')](function(_0x56206d){logger[_0x40f6('0xc')](_0x40f6('0xd'),_0x4db34e,_0x40f6('0xe'));logger[_0x40f6('0xf')](_0x40f6('0x10'),_0x4db34e,_0x40f6('0xe'),JSON[_0x40f6('0x11')](_0x56206d));if(_0x56206d[_0x40f6('0x12')]){if(_0x56206d['error'][_0x40f6('0x13')]===0x1f4){logger['error'](_0x40f6('0xd'),_0x4db34e,_0x56206d[_0x40f6('0x12')][_0x40f6('0x14')]);return _0xa4a090(_0x56206d['error']['message']);}logger[_0x40f6('0x12')](_0x40f6('0xd'),_0x4db34e,_0x56206d[_0x40f6('0x12')][_0x40f6('0x14')]);return _0x22d477(_0x56206d[_0x40f6('0x12')][_0x40f6('0x14')]);}else{logger[_0x40f6('0xc')](_0x40f6('0xd'),_0x4db34e,_0x40f6('0xe'));_0x22d477(_0x56206d[_0x40f6('0x15')]['message']);}})[_0x40f6('0x16')](function(_0x42f91b){logger[_0x40f6('0x12')](_0x40f6('0xd'),_0x4db34e,_0x42f91b);_0xa4a090(_0x42f91b);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 2bbe499..a7df14b 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 _0xf8b3=['isAuthenticated','show','post','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x13c4f8,_0x433521){var _0x5a8f4b=function(_0x1df845){while(--_0x1df845){_0x13c4f8['push'](_0x13c4f8['shift']());}};_0x5a8f4b(++_0x433521);}(_0xf8b3,0xf9));var _0x3f8b=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0xf8b3[_0x16629d];return _0x56ccee;};'use strict';var multer=require(_0x3f8b('0x0'));var util=require(_0x3f8b('0x1'));var path=require(_0x3f8b('0x2'));var timeout=require(_0x3f8b('0x3'));var express=require(_0x3f8b('0x4'));var router=express[_0x3f8b('0x5')]();var fs_extra=require(_0x3f8b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3f8b('0x7'));var config=require(_0x3f8b('0x8'));var controller=require(_0x3f8b('0x9'));router[_0x3f8b('0xa')]('/',auth[_0x3f8b('0xb')](),controller['index']);router[_0x3f8b('0xa')]('/describe',auth[_0x3f8b('0xb')](),controller['describe']);router[_0x3f8b('0xa')]('/:id',auth[_0x3f8b('0xb')](),controller[_0x3f8b('0xc')]);router[_0x3f8b('0xd')]('/',auth[_0x3f8b('0xb')](),controller['create']);router[_0x3f8b('0xe')]('/:id',auth[_0x3f8b('0xb')](),controller[_0x3f8b('0xf')]);router[_0x3f8b('0x10')](_0x3f8b('0x11'),auth['isAuthenticated'](),controller[_0x3f8b('0x12')]);module[_0x3f8b('0x13')]=router; \ No newline at end of file +var _0xad52=['isAuthenticated','index','/describe','show','post','put','/:id','update','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x178586,_0x37045b){var _0x1764ad=function(_0x4b3b91){while(--_0x4b3b91){_0x178586['push'](_0x178586['shift']());}};_0x1764ad(++_0x37045b);}(_0xad52,0x1e4));var _0x2ad5=function(_0xe714b1,_0x29f3dd){_0xe714b1=_0xe714b1-0x0;var _0x5ea994=_0xad52[_0xe714b1];return _0x5ea994;};'use strict';var multer=require(_0x2ad5('0x0'));var util=require(_0x2ad5('0x1'));var path=require(_0x2ad5('0x2'));var timeout=require(_0x2ad5('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2ad5('0x4'));var auth=require(_0x2ad5('0x5'));var interaction=require(_0x2ad5('0x6'));var config=require(_0x2ad5('0x7'));var controller=require(_0x2ad5('0x8'));router[_0x2ad5('0x9')]('/',auth[_0x2ad5('0xa')](),controller[_0x2ad5('0xb')]);router[_0x2ad5('0x9')](_0x2ad5('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x2ad5('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x2ad5('0xd')]);router[_0x2ad5('0xe')]('/',auth[_0x2ad5('0xa')](),controller['create']);router[_0x2ad5('0xf')](_0x2ad5('0x10'),auth['isAuthenticated'](),controller[_0x2ad5('0x11')]);router['delete'](_0x2ad5('0x10'),auth[_0x2ad5('0xa')](),controller[_0x2ad5('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 4640bf2..c8130ce 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 _0x51c1=['Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','input','name','text','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note'];(function(_0x20f34e,_0x30dd69){var _0x5a407f=function(_0x5a198f){while(--_0x5a198f){_0x20f34e['push'](_0x20f34e['shift']());}};_0x5a407f(++_0x30dd69);}(_0x51c1,0x1d8));var _0x151c=function(_0x1c289a,_0x277fe7){_0x1c289a=_0x1c289a-0x0;var _0x28d68e=_0x51c1[_0x1c289a];return _0x28d68e;};'use strict';var Sequelize=require(_0x151c('0x0'));var rs=require(_0x151c('0x1'));module[_0x151c('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x151c('0x3')],'allowNull':![],'unique':_0x151c('0x4')},'description':{'type':Sequelize[_0x151c('0x3')]},'mapKey':{'type':Sequelize[_0x151c('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x5')},'key':{'type':Sequelize[_0x151c('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x6')},'customerAlias':{'type':Sequelize[_0x151c('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x151c('0x3')],'allowNull':![],'defaultValue':_0x151c('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x151c('0x3')],'allowNull':![],'defaultValue':_0x151c('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x151c('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x151c('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x151c('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x151c('0xb')](_0x151c('0xc'),_0x151c('0xd')),'defaultValue':_0x151c('0xc')},'header_online':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0xe')},'start_chat_button':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0xf')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x151c('0x10')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x151c('0x11')},'download_transcript':{'type':Sequelize[_0x151c('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x151c('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x12')},'defaultWhiteLabel':{'type':Sequelize[_0x151c('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x151c('0x13')]},'closingQuestion':{'type':Sequelize[_0x151c('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x14')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x151c('0x15')},'noteTitle':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x16')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x151c('0x17')},'closingMessage':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x18')},'closingMessageButton':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x10')},'skipMessageButton':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x19')},'conditionAgreement':{'type':Sequelize[_0x151c('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x151c('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x1a')},'ratingType':{'type':Sequelize['ENUM']('star',_0x151c('0x1b')),'defaultValue':_0x151c('0x1c')},'ratingStarsNumber':{'type':Sequelize[_0x151c('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x151c('0x13')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x151c('0x1d'),'variable':null,'config':{'placeholder':_0x151c('0x1e'),'type':_0x151c('0x1f'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x151c('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x151c('0x5'),'type':_0x151c('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x151c('0x20')]('onlineForm')?JSON['parse'](this[_0x151c('0x20')](_0x151c('0x21'))):{};},'set':function(_0x49e4c5){return this[_0x151c('0x22')](_0x151c('0x21'),JSON[_0x151c('0x23')](_0x49e4c5));}},'offlineForm':{'type':Sequelize[_0x151c('0x13')],'defaultValue':function(){return JSON[_0x151c('0x23')]({'items':[{'type':_0x151c('0x1d'),'props':{'title':_0x151c('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x151c('0x5'),'type':'email'},'variable':null},{'type':_0x151c('0x24'),'config':{'placeholder':_0x151c('0x25')},'props':{'title':_0x151c('0x25'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x151c('0x20')]('offlineForm')?JSON[_0x151c('0x26')](this['getDataValue']('offlineForm')):{};},'set':function(_0x337f10){return this[_0x151c('0x22')]('offlineForm',JSON['stringify'](_0x337f10));}},'token':{'type':Sequelize[_0x151c('0x3')],'defaultValue':function(){return rs[_0x151c('0x27')]();}},'autoclose':{'type':Sequelize[_0x151c('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x151c('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x151c('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x151c('0x3')]},'forwardOffline':{'type':Sequelize[_0x151c('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x151c('0x3')]},'waitingTitle':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x28')},'waitingMessage':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x29')},'offlineMessageSubject':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x2a')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x151c('0x2b')},'enableUnmanagedNote':{'type':Sequelize[_0x151c('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x2c')},'skipUnmanaged':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x19')},'sendUnmanaged':{'type':Sequelize[_0x151c('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x151c('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x151c('0x13')]},'showAgentAvatar':{'type':Sequelize[_0x151c('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x151c('0x3')]},'notificationTemplate':{'type':Sequelize[_0x151c('0x13')],'defaultValue':function(){return _0x151c('0x2d');}},'notificationSound':{'type':Sequelize[_0x151c('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x151c('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x2e')},'waitForTheAssignedAgent':{'type':Sequelize[_0x151c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x151c('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x151c('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x2f')},'defaultTitle':{'type':Sequelize[_0x151c('0x3')]},'customerAvatar':{'type':Sequelize[_0x151c('0x13')]},'showCustomerAvatar':{'type':Sequelize[_0x151c('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x151c('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x151c('0x3')],'allowNull':![],'defaultValue':_0x151c('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x151c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x151c('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x151c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x151c('0x3')],'defaultValue':_0x151c('0x31')},'systemAvatar':{'type':Sequelize[_0x151c('0x13')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x151c('0x9')],'comment':_0x151c('0x32')},'mandatoryDisposition':{'type':Sequelize[_0x151c('0xa')],'defaultValue':![],'comment':_0x151c('0x33'),'set':function(_0x1eb9e7){if(!_0x1eb9e7)this['setDataValue'](_0x151c('0x34'),null);this[_0x151c('0x22')](_0x151c('0x35'),_0x1eb9e7);}},'vidaooEscalation':{'type':Sequelize[_0x151c('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x151c('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x151c('0x3')],'defaultValue':function(){return _0x151c('0x36');}},'vidaooMetadata':{'type':Sequelize[_0x151c('0x13')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x151c('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x151c('0x13')]}}; \ No newline at end of file +var _0xe811=['stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','bottom_right','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','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','ENUM','thumb','TEXT','input','text','name','getDataValue','setDataValue','onlineForm'];(function(_0x535a0d,_0x3a752f){var _0x39a4a3=function(_0x255dfa){while(--_0x255dfa){_0x535a0d['push'](_0x535a0d['shift']());}};_0x39a4a3(++_0x3a752f);}(_0xe811,0x11c));var _0x1e81=function(_0x22c725,_0x4882fd){_0x22c725=_0x22c725-0x0;var _0x55a32e=_0xe811[_0x22c725];return _0x55a32e;};'use strict';var Sequelize=require(_0x1e81('0x0'));var rs=require(_0x1e81('0x1'));module[_0x1e81('0x2')]={'name':{'type':Sequelize[_0x1e81('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x1e81('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x1e81('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':_0x1e81('0x4')},'key':{'type':Sequelize[_0x1e81('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':_0x1e81('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1e81('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1e81('0x3')],'allowNull':![],'defaultValue':_0x1e81('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1e81('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1e81('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1e81('0x3')]},'animation':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x1e81('0xa'),_0x1e81('0xb')),'defaultValue':_0x1e81('0xa')},'header_online':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':_0x1e81('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x1e81('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x1e81('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':_0x1e81('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':_0x1e81('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':_0x1e81('0x11')},'noteTitle':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':_0x1e81('0x12')},'placeholderMessage':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':_0x1e81('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x1e81('0x14')},'conditionAgreement':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x1e81('0x15')},'ratingType':{'type':Sequelize[_0x1e81('0x16')]('star',_0x1e81('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x1e81('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1e81('0x18')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x1e81('0x19'),'variable':null,'config':{'placeholder':'name','type':_0x1e81('0x1a'),'required':!![]},'props':{'title':_0x1e81('0x1b'),'helpText':''}},{'type':_0x1e81('0x19'),'props':{'title':_0x1e81('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x1e81('0x4'),'type':_0x1e81('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x1e81('0x1c')]('onlineForm')?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x4063){return this[_0x1e81('0x1d')](_0x1e81('0x1e'),JSON[_0x1e81('0x1f')](_0x4063));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x1e81('0x19'),'props':{'title':_0x1e81('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x1e81('0x4'),'type':'email'},'variable':null},{'type':_0x1e81('0x20'),'config':{'placeholder':_0x1e81('0x21')},'props':{'title':_0x1e81('0x21'),'helpText':_0x1e81('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x1e81('0x23'))?JSON[_0x1e81('0x24')](this[_0x1e81('0x1c')](_0x1e81('0x23'))):{};},'set':function(_0x31c4ce){return this[_0x1e81('0x1d')](_0x1e81('0x23'),JSON[_0x1e81('0x1f')](_0x31c4ce));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1e81('0x3')]},'waitingTitle':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1e81('0x14')},'sendUnmanaged':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1e81('0x18')]},'showAgentAvatar':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1e81('0x3')]},'notificationTemplate':{'type':Sequelize[_0x1e81('0x18')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x1e81('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x1e81('0x25')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':_0x1e81('0x26')},'defaultTitle':{'type':Sequelize[_0x1e81('0x3')]},'customerAvatar':{'type':Sequelize[_0x1e81('0x18')]},'showCustomerAvatar':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x1e81('0x3')],'allowNull':![],'defaultValue':_0x1e81('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1e81('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1e81('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':_0x1e81('0x28')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1e81('0x8')],'comment':_0x1e81('0x29')},'mandatoryDisposition':{'type':Sequelize[_0x1e81('0x9')],'defaultValue':![],'comment':_0x1e81('0x2a'),'set':function(_0x298205){if(!_0x298205)this[_0x1e81('0x1d')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x298205);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x1e81('0x3')]},'vidaooTopic':{'type':Sequelize[_0x1e81('0x3')],'allowNull':![],'defaultValue':_0x1e81('0x2b')},'vidaooNote':{'type':Sequelize[_0x1e81('0x3')],'defaultValue':function(){return _0x1e81('0x2c');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1e81('0x18')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 0cd5e36..d5a34c2 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 _0x8629=['showCustomerAvatar','download','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','DESC','ChatApplication','Applications','account','applications','list','priority','asc','Contacts','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','%s\x20%s','version','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','all','some','server/files/chat/iframe.ejs','remote','stringify','remoteAddress','replace','alignment','color','textColor','color_button','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','order','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','custom','isNil','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','agentAvatar','getCustomerAvatar','server/files/images/avatars/customer_avatar.png'];(function(_0x715306,_0x2d99c3){var _0x536371=function(_0x22c1d2){while(--_0x22c1d2){_0x715306['push'](_0x715306['shift']());}};_0x536371(++_0x2d99c3);}(_0x8629,0xb5));var _0x9862=function(_0x913fe8,_0x3ae0fd){_0x913fe8=_0x913fe8-0x0;var _0x1426c0=_0x8629[_0x913fe8];return _0x1426c0;};'use strict';var emlformat=require(_0x9862('0x0'));var rimraf=require(_0x9862('0x1'));var zipdir=require(_0x9862('0x2'));var jsonpatch=require(_0x9862('0x3'));var rp=require('request-promise');var moment=require(_0x9862('0x4'));var BPromise=require(_0x9862('0x5'));var Mustache=require('mustache');var util=require(_0x9862('0x6'));var path=require(_0x9862('0x7'));var sox=require(_0x9862('0x8'));var csv=require(_0x9862('0x9'));var ejs=require(_0x9862('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9862('0xb'));var crypto=require('crypto');var jsforce=require(_0x9862('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9862('0x9'));var querystring=require(_0x9862('0xd'));var Papa=require('papaparse');var Redis=require(_0x9862('0xe'));var authService=require(_0x9862('0xf'));var qs=require(_0x9862('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9862('0x11'));var logger=require(_0x9862('0x12'))('api');var utils=require(_0x9862('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9862('0x14'));var db=require('../../mysqldb')['db'];config[_0x9862('0x15')]=_[_0x9862('0x16')](config[_0x9862('0x15')],{'host':_0x9862('0x17'),'port':0x18eb});var socket=require(_0x9862('0x18'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x9862('0x19')](socket);var jayson=require(_0x9862('0x1a'));var client=jayson[_0x9862('0x1b')][_0x9862('0x1c')]({'port':0x232c});var client9002=jayson[_0x9862('0x1b')][_0x9862('0x1c')]({'port':0x232a});var client9003=jayson[_0x9862('0x1b')][_0x9862('0x1c')]({'port':0x232b});var client9001=jayson[_0x9862('0x1b')]['http']({'port':0x2329});function respondWithRpcPromise(_0x5b6d98,_0x3f9b41,_0x1cb543,_0x154b1b){return new BPromise(function(_0x5d6a39,_0xd7075a){var _0xf23806=_0x154b1b||client;return _0xf23806[_0x9862('0x1d')](_0x5b6d98,_0x1cb543)[_0x9862('0x1e')](function(_0xf148f7){logger['info'](_0x9862('0x1f'),_0x3f9b41,_0x9862('0x20'));logger[_0x9862('0x21')](_0x9862('0x22'),_0x3f9b41,_0x9862('0x20'),JSON['stringify'](_0xf148f7));if(_0xf148f7[_0x9862('0x23')]){if(_0xf148f7[_0x9862('0x23')][_0x9862('0x24')]===0x1f4){logger[_0x9862('0x23')](_0x9862('0x1f'),_0x3f9b41,_0xf148f7[_0x9862('0x23')][_0x9862('0x25')]);return _0xd7075a(_0xf148f7['error'][_0x9862('0x25')]);}logger['error'](_0x9862('0x1f'),_0x3f9b41,_0xf148f7[_0x9862('0x23')][_0x9862('0x25')]);return _0x5d6a39(_0xf148f7[_0x9862('0x23')]['message']);}else{logger[_0x9862('0x26')](_0x9862('0x1f'),_0x3f9b41,_0x9862('0x20'));_0x5d6a39(_0xf148f7[_0x9862('0x27')][_0x9862('0x25')]);}})[_0x9862('0x28')](function(_0x44275f){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x3f9b41,_0x44275f);_0xd7075a(_0x44275f);});});}function respondWithStatusCode(_0x2ea10a,_0x2882a7){_0x2882a7=_0x2882a7||0xcc;return function(_0x1a7b89){if(_0x1a7b89){return _0x2ea10a[_0x9862('0x29')](_0x2882a7);}return _0x2ea10a[_0x9862('0x2a')](_0x2882a7)['end']();};}function respondWithResult(_0x3d6e13,_0x8dd1fa){_0x8dd1fa=_0x8dd1fa||0xc8;return function(_0x532f39){if(_0x532f39){return _0x3d6e13[_0x9862('0x2a')](_0x8dd1fa)[_0x9862('0x2b')](_0x532f39);}};}function respondWithFilteredResult(_0x4454d7,_0x1dbe1e){return function(_0x49ca41){if(_0x49ca41){var _0x221ab0=typeof _0x1dbe1e['offset']===_0x9862('0x2c')&&typeof _0x1dbe1e[_0x9862('0x2d')]===_0x9862('0x2c');var _0x4bcc94=_0x49ca41['count'];var _0x36f16b=_0x221ab0?0x0:_0x1dbe1e[_0x9862('0x2e')];var _0x47e803=_0x221ab0?_0x49ca41['count']:_0x1dbe1e[_0x9862('0x2e')]+_0x1dbe1e[_0x9862('0x2d')];var _0x4a878e;if(_0x47e803>=_0x4bcc94){_0x47e803=_0x4bcc94;_0x4a878e=0xc8;}else{_0x4a878e=0xce;}_0x4454d7[_0x9862('0x2a')](_0x4a878e);return _0x4454d7[_0x9862('0x2f')](_0x9862('0x30'),_0x36f16b+'-'+_0x47e803+'/'+_0x4bcc94)[_0x9862('0x2b')](_0x49ca41);}return null;};}function patchUpdates(_0x2c9a86){return function(_0x1339da){try{jsonpatch[_0x9862('0x31')](_0x1339da,_0x2c9a86,!![]);}catch(_0x130286){return BPromise[_0x9862('0x32')](_0x130286);}return _0x1339da[_0x9862('0x33')]();};}function saveUpdates(_0xa6e58c,_0x42b190){return function(_0x5d15a3){if(_0x5d15a3){return _0x5d15a3[_0x9862('0x34')](_0xa6e58c)[_0x9862('0x1e')](function(_0x3787c8){return _0x3787c8;});}return null;};}function removeEntity(_0x30c800,_0x357b76){return function(_0x586588){if(_0x586588){return _0x586588[_0x9862('0x35')]()[_0x9862('0x1e')](function(){var _0x4b5b87=_0x586588[_0x9862('0x36')]({'plain':!![]});var _0x5737b1=_0x9862('0x37');return db[_0x9862('0x38')]['destroy']({'where':{'type':_0x5737b1,'resourceId':_0x4b5b87['id']}})[_0x9862('0x1e')](function(){return _0x586588;});})['then'](function(){_0x30c800[_0x9862('0x2a')](0xcc)[_0x9862('0x39')]();});}};}function handleEntityNotFound(_0x154ef4,_0x3a820a){return function(_0x515729){if(!_0x515729){_0x154ef4[_0x9862('0x29')](0x194);}return _0x515729;};}function handleError(_0xc1d76c,_0x3cedeb){_0x3cedeb=_0x3cedeb||0x1f4;return function(_0x22ead1){logger['error'](_0x22ead1[_0x9862('0x3a')]);if(_0x22ead1[_0x9862('0x3b')]){delete _0x22ead1[_0x9862('0x3b')];}_0xc1d76c[_0x9862('0x2a')](_0x3cedeb)[_0x9862('0x3c')](_0x22ead1);};}exports['index']=function(_0x10977a,_0x138e2c){var _0x536e30={'include':[{'model':db[_0x9862('0x3d')],'as':_0x9862('0x3e')}]},_0x2a7b63={},_0x56d171={'count':0x0,'rows':[]};var _0x4b229c=_[_0x9862('0x3f')](db[_0x9862('0x40')][_0x9862('0x41')],function(_0x544983){return{'name':_0x544983[_0x9862('0x42')],'type':_0x544983['type']['key']};});_0x2a7b63[_0x9862('0x43')]=_['map'](_0x4b229c,_0x9862('0x3b'));_0x2a7b63[_0x9862('0x44')]=_[_0x9862('0x45')](_0x10977a[_0x9862('0x44')]);_0x2a7b63['filters']=_['intersection'](_0x2a7b63['model'],_0x2a7b63['query']);_0x536e30['attributes']=_[_0x9862('0x46')](_0x2a7b63[_0x9862('0x43')],qs[_0x9862('0x47')](_0x10977a[_0x9862('0x44')][_0x9862('0x47')]));_0x536e30[_0x9862('0x48')]=_0x536e30[_0x9862('0x48')][_0x9862('0x49')]?_0x536e30[_0x9862('0x48')]:_0x2a7b63[_0x9862('0x43')];if(!_0x10977a['query'][_0x9862('0x4a')]('nolimit')){_0x536e30['limit']=qs[_0x9862('0x2d')](_0x10977a[_0x9862('0x44')]['limit']);_0x536e30['offset']=qs[_0x9862('0x2e')](_0x10977a[_0x9862('0x44')][_0x9862('0x2e')]);}_0x536e30['order']=qs[_0x9862('0x4b')](_0x10977a['query'][_0x9862('0x4b')]);_0x536e30[_0x9862('0x4c')]=qs[_0x9862('0x4d')](_[_0x9862('0x4e')](_0x10977a['query'],_0x2a7b63[_0x9862('0x4d')]),_0x4b229c);if(_0x10977a[_0x9862('0x44')][_0x9862('0x4f')]){_0x536e30['where']=_[_0x9862('0x50')](_0x536e30[_0x9862('0x4c')],{'$or':_[_0x9862('0x3f')](_0x4b229c,function(_0x39519f){if(_0x39519f[_0x9862('0x51')]!==_0x9862('0x52')){var _0x311d0f={};_0x311d0f[_0x39519f[_0x9862('0x3b')]]={'$like':'%'+_0x10977a['query'][_0x9862('0x4f')]+'%'};return _0x311d0f;}})});}_0x536e30=_[_0x9862('0x50')]({},_0x536e30,_0x10977a[_0x9862('0x53')]);var _0x3239f={'where':_0x536e30[_0x9862('0x4c')]};return db[_0x9862('0x40')][_0x9862('0x54')](_0x3239f)['then'](function(_0x3e852b){_0x56d171[_0x9862('0x54')]=_0x3e852b;if(_0x10977a[_0x9862('0x44')][_0x9862('0x55')]){_0x536e30['include']=[{'all':!![]}];}return db[_0x9862('0x40')][_0x9862('0x56')](_0x536e30);})['then'](function(_0x28e5de){_0x56d171['rows']=_0x28e5de;return _0x56d171;})['then'](respondWithFilteredResult(_0x138e2c,_0x536e30))[_0x9862('0x28')](handleError(_0x138e2c,null));};exports[_0x9862('0x57')]=function(_0x13b505,_0x4a7881){var _0x4e21bb={'raw':![],'where':{'id':_0x13b505['params']['id']},'include':[{'model':db[_0x9862('0x3d')],'as':_0x9862('0x3e')}]},_0x30b0d7={};_0x30b0d7['model']=_[_0x9862('0x45')](db['ChatWebsite']['rawAttributes']);_0x30b0d7[_0x9862('0x44')]=_[_0x9862('0x45')](_0x13b505[_0x9862('0x44')]);_0x30b0d7[_0x9862('0x4d')]=_[_0x9862('0x46')](_0x30b0d7[_0x9862('0x43')],_0x30b0d7[_0x9862('0x44')]);_0x4e21bb[_0x9862('0x48')]=_[_0x9862('0x46')](_0x30b0d7['model'],qs[_0x9862('0x47')](_0x13b505['query'][_0x9862('0x47')]));_0x4e21bb[_0x9862('0x48')]=_0x4e21bb[_0x9862('0x48')]['length']?_0x4e21bb[_0x9862('0x48')]:_0x30b0d7[_0x9862('0x43')];if(_0x13b505[_0x9862('0x44')][_0x9862('0x55')]){_0x4e21bb[_0x9862('0x58')]=[{'all':!![]}];}_0x4e21bb=_['merge']({},_0x4e21bb,_0x13b505['options']);return db[_0x9862('0x40')][_0x9862('0x59')](_0x4e21bb)['then'](handleEntityNotFound(_0x4a7881,null))['then'](respondWithResult(_0x4a7881,null))['catch'](handleError(_0x4a7881,null));};exports[_0x9862('0x5a')]=function(_0x4dd811,_0x4836bd){return db[_0x9862('0x40')][_0x9862('0x5a')](_0x4dd811[_0x9862('0x5b')],{})[_0x9862('0x1e')](function(_0xa6489b){var _0x5cc950=_0x4dd811[_0x9862('0x5c')][_0x9862('0x36')]({'plain':!![]});if(!_0x5cc950)throw new Error(_0x9862('0x5d'));if(_0x5cc950[_0x9862('0x5e')]===_0x9862('0x5c')){var _0x1fccc0=_0xa6489b['get']({'plain':!![]});var _0x8f66bb='ChatWebsites';return db['UserProfileSection'][_0x9862('0x59')]({'where':{'name':_0x8f66bb,'userProfileId':_0x5cc950['userProfileId']},'raw':!![]})[_0x9862('0x1e')](function(_0x4f9956){if(_0x4f9956&&_0x4f9956[_0x9862('0x5f')]===0x0){return db[_0x9862('0x38')][_0x9862('0x5a')]({'name':_0x1fccc0['name'],'resourceId':_0x1fccc0['id'],'type':_0x4f9956[_0x9862('0x3b')],'sectionId':_0x4f9956['id']},{})[_0x9862('0x1e')](function(){return _0xa6489b;});}else{return _0xa6489b;}})[_0x9862('0x28')](function(_0x22d2d1){logger[_0x9862('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22d2d1);throw _0x22d2d1;});}return _0xa6489b;})['then'](respondWithResult(_0x4836bd,0xc9))['catch'](handleError(_0x4836bd,null));};exports[_0x9862('0x34')]=function(_0x1cfdb0,_0x4648f9){if(_0x1cfdb0[_0x9862('0x5b')]['id']){delete _0x1cfdb0['body']['id'];}return db[_0x9862('0x40')][_0x9862('0x59')]({'where':{'id':_0x1cfdb0[_0x9862('0x60')]['id']},'include':[{'model':db[_0x9862('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x9862('0x1e')](handleEntityNotFound(_0x4648f9,null))[_0x9862('0x1e')](saveUpdates(_0x1cfdb0[_0x9862('0x5b')],null))[_0x9862('0x1e')](respondWithResult(_0x4648f9,null))[_0x9862('0x28')](handleError(_0x4648f9,null));};exports[_0x9862('0x35')]=function(_0x113f8f,_0x5220f4){return db[_0x9862('0x40')]['find']({'where':{'id':_0x113f8f[_0x9862('0x60')]['id']}})['then'](handleEntityNotFound(_0x5220f4,null))[_0x9862('0x1e')](removeEntity(_0x5220f4,null))[_0x9862('0x28')](handleError(_0x5220f4,null));};exports[_0x9862('0x61')]=function(_0xf8836b,_0x14183f){return db['ChatWebsite'][_0x9862('0x61')]()[_0x9862('0x1e')](respondWithResult(_0x14183f,null))['catch'](handleError(_0x14183f,null));};exports[_0x9862('0x62')]=function(_0x22a810,_0x58e127,_0x238d51){if(_0x22a810['body']['id']){delete _0x22a810[_0x9862('0x5b')]['id'];}return db[_0x9862('0x40')][_0x9862('0x59')]({'where':{'id':_0x22a810['params']['id']}})[_0x9862('0x1e')](handleEntityNotFound(_0x58e127,null))[_0x9862('0x1e')](function(_0x12a864){if(_0x12a864){_0x22a810[_0x9862('0x5b')][_0x9862('0x63')]=_0x12a864['id'];return db[_0x9862('0x64')]['create'](_0x22a810[_0x9862('0x5b')]);}})['then'](respondWithResult(_0x58e127,null))[_0x9862('0x28')](handleError(_0x58e127,null));};exports[_0x9862('0x65')]=function(_0x2b129a,_0x459b6d,_0x36d35a){var _0xac66b8={'raw':![],'where':{}};var _0x16be05={};var _0x23abd3={'count':0x0,'rows':[]};return db[_0x9862('0x40')][_0x9862('0x66')]({'where':{'id':_0x2b129a[_0x9862('0x60')]['id']}})[_0x9862('0x1e')](handleEntityNotFound(_0x459b6d,null))[_0x9862('0x1e')](function(_0x5681cd){if(_0x5681cd){_0x16be05['model']=_[_0x9862('0x45')](db[_0x9862('0x64')][_0x9862('0x41')]);_0x16be05[_0x9862('0x44')]=_[_0x9862('0x45')](_0x2b129a[_0x9862('0x44')]);_0x16be05[_0x9862('0x4d')]=_[_0x9862('0x46')](_0x16be05[_0x9862('0x43')],_0x16be05[_0x9862('0x44')]);_0xac66b8['attributes']=_[_0x9862('0x46')](_0x16be05[_0x9862('0x43')],qs[_0x9862('0x47')](_0x2b129a[_0x9862('0x44')][_0x9862('0x47')]));_0xac66b8[_0x9862('0x48')]=_0xac66b8[_0x9862('0x48')][_0x9862('0x49')]?_0xac66b8['attributes']:_0x16be05[_0x9862('0x43')];if(!_0x2b129a[_0x9862('0x44')][_0x9862('0x4a')](_0x9862('0x67'))){_0xac66b8['limit']=qs[_0x9862('0x2d')](_0x2b129a[_0x9862('0x44')][_0x9862('0x2d')]);_0xac66b8[_0x9862('0x2e')]=qs['offset'](_0x2b129a[_0x9862('0x44')][_0x9862('0x2e')]);}_0xac66b8[_0x9862('0x68')]=qs[_0x9862('0x4b')](_0x2b129a[_0x9862('0x44')][_0x9862('0x4b')]);_0xac66b8[_0x9862('0x4c')]=qs[_0x9862('0x4d')](_['pick'](_0x2b129a[_0x9862('0x44')],_0x16be05['filters']));_0xac66b8[_0x9862('0x4c')][_0x9862('0x63')]=_0x5681cd['id'];if(_0x2b129a[_0x9862('0x44')]['filter']){_0xac66b8['where']=_[_0x9862('0x50')](_0xac66b8['where'],{'$or':_[_0x9862('0x3f')](_0xac66b8[_0x9862('0x48')],function(_0x5b9bd2){var _0x5df626={};_0x5df626[_0x5b9bd2]={'$like':'%'+_0x2b129a[_0x9862('0x44')][_0x9862('0x4f')]+'%'};return _0x5df626;})});}_0xac66b8=_[_0x9862('0x50')]({},_0xac66b8,_0x2b129a[_0x9862('0x53')]);return db[_0x9862('0x64')]['count']({'where':_0xac66b8['where']})[_0x9862('0x1e')](function(_0x279294){_0x23abd3['count']=_0x279294;if(_0x2b129a[_0x9862('0x44')][_0x9862('0x55')]){_0xac66b8[_0x9862('0x58')]=[{'all':!![]}];}return db[_0x9862('0x64')][_0x9862('0x56')](_0xac66b8);})[_0x9862('0x1e')](function(_0x19a493){_0x23abd3[_0x9862('0x69')]=_0x19a493;return _0x23abd3;});}})[_0x9862('0x1e')](respondWithFilteredResult(_0x459b6d,_0xac66b8))[_0x9862('0x28')](handleError(_0x459b6d,null));};exports[_0x9862('0x6a')]=function(_0x115fd9,_0x30a740,_0x5c6650){return db[_0x9862('0x40')]['find']({'where':{'id':_0x115fd9[_0x9862('0x60')]['id']}})[_0x9862('0x1e')](handleEntityNotFound(_0x30a740,null))[_0x9862('0x1e')](function(_0x37d309){if(_0x37d309){return _0x37d309[_0x9862('0x6a')](_0x115fd9[_0x9862('0x44')][_0x9862('0x6b')]);}})['then'](respondWithStatusCode(_0x30a740,null))[_0x9862('0x28')](handleError(_0x30a740,null));};exports[_0x9862('0x6c')]=function(_0x5d95d8,_0x452687,_0x33449e){if(_0x5d95d8[_0x9862('0x5b')]['id']){delete _0x5d95d8[_0x9862('0x5b')]['id'];}return db[_0x9862('0x40')][_0x9862('0x59')]({'where':{'id':_0x5d95d8[_0x9862('0x60')]['id']}})[_0x9862('0x1e')](handleEntityNotFound(_0x452687,null))['then'](function(_0x4ae8a0){if(_0x4ae8a0){_0x5d95d8[_0x9862('0x5b')][_0x9862('0x63')]=_0x4ae8a0['id'];return db['CannedAnswer'][_0x9862('0x5a')](_0x5d95d8[_0x9862('0x5b')]);}})[_0x9862('0x1e')](respondWithResult(_0x452687,null))['catch'](handleError(_0x452687,null));};exports[_0x9862('0x6d')]=function(_0x300525,_0x4edb75,_0x19f500){var _0x186615={'raw':![],'where':{}};var _0x489d1f={};var _0x1dc563={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x9862('0x66')]({'where':{'id':_0x300525[_0x9862('0x60')]['id']}})[_0x9862('0x1e')](handleEntityNotFound(_0x4edb75,null))['then'](function(_0x22270f){if(_0x22270f){_0x489d1f[_0x9862('0x43')]=_['keys'](db[_0x9862('0x6e')][_0x9862('0x41')]);_0x489d1f['query']=_['keys'](_0x300525[_0x9862('0x44')]);_0x489d1f[_0x9862('0x4d')]=_['intersection'](_0x489d1f[_0x9862('0x43')],_0x489d1f['query']);_0x186615[_0x9862('0x48')]=_['intersection'](_0x489d1f['model'],qs[_0x9862('0x47')](_0x300525[_0x9862('0x44')]['fields']));_0x186615[_0x9862('0x48')]=_0x186615['attributes'][_0x9862('0x49')]?_0x186615[_0x9862('0x48')]:_0x489d1f['model'];if(!_0x300525['query'][_0x9862('0x4a')]('nolimit')){_0x186615[_0x9862('0x2d')]=qs[_0x9862('0x2d')](_0x300525[_0x9862('0x44')]['limit']);_0x186615['offset']=qs['offset'](_0x300525['query'][_0x9862('0x2e')]);}_0x186615[_0x9862('0x68')]=qs[_0x9862('0x4b')](_0x300525[_0x9862('0x44')]['sort']);_0x186615[_0x9862('0x4c')]=qs[_0x9862('0x4d')](_[_0x9862('0x4e')](_0x300525['query'],_0x489d1f[_0x9862('0x4d')]));_0x186615[_0x9862('0x4c')][_0x9862('0x63')]=_0x22270f['id'];if(_0x300525['query'][_0x9862('0x4f')]){_0x186615['where']=_['merge'](_0x186615[_0x9862('0x4c')],{'$or':_[_0x9862('0x3f')](_0x186615[_0x9862('0x48')],function(_0x43dfce){var _0x1b0381={};_0x1b0381[_0x43dfce]={'$like':'%'+_0x300525[_0x9862('0x44')][_0x9862('0x4f')]+'%'};return _0x1b0381;})});}_0x186615=_['merge']({},_0x186615,_0x300525[_0x9862('0x53')]);return db['CannedAnswer']['count']({'where':_0x186615[_0x9862('0x4c')]})['then'](function(_0x2c87d4){_0x1dc563['count']=_0x2c87d4;if(_0x300525[_0x9862('0x44')][_0x9862('0x55')]){_0x186615['include']=[{'all':!![]}];}return db[_0x9862('0x6e')][_0x9862('0x56')](_0x186615);})[_0x9862('0x1e')](function(_0x8bd818){_0x1dc563['rows']=_0x8bd818;return _0x1dc563;});}})[_0x9862('0x1e')](respondWithFilteredResult(_0x4edb75,_0x186615))[_0x9862('0x28')](handleError(_0x4edb75,null));};exports[_0x9862('0x6f')]=function(_0x1ffe95,_0x154de3,_0x390722){return db['ChatWebsite'][_0x9862('0x59')]({'where':{'id':_0x1ffe95['params']['id']}})[_0x9862('0x1e')](handleEntityNotFound(_0x154de3,null))[_0x9862('0x1e')](function(_0x575a5d){if(_0x575a5d){return _0x575a5d[_0x9862('0x6f')](_0x1ffe95['query']['ids']);}})[_0x9862('0x1e')](respondWithStatusCode(_0x154de3,null))[_0x9862('0x28')](handleError(_0x154de3,null));};exports[_0x9862('0x70')]=function(_0x78041c,_0x428100,_0x252f13){_0x78041c[_0x9862('0x5b')][_0x9862('0x71')]=_0x78041c[_0x9862('0x72')][_0x9862('0x73')];return db[_0x9862('0x40')][_0x9862('0x59')]({'where':{'id':_0x78041c[_0x9862('0x60')]['id']}})[_0x9862('0x1e')](handleEntityNotFound(_0x428100,null))[_0x9862('0x1e')](saveUpdates(_0x78041c[_0x9862('0x5b')],null))[_0x9862('0x1e')](respondWithResult(_0x428100,null))[_0x9862('0x28')](handleError(_0x428100,null));};exports['addAvatar']=function(_0x47ed46,_0x5d4aae,_0x23f961){_0x47ed46[_0x9862('0x5b')]['agentAvatar']=_0x47ed46[_0x9862('0x72')]['filename'];return db[_0x9862('0x40')][_0x9862('0x59')]({'where':{'id':_0x47ed46[_0x9862('0x60')]['id']}})[_0x9862('0x1e')](handleEntityNotFound(_0x5d4aae,null))['then'](saveUpdates(_0x47ed46[_0x9862('0x5b')],null))[_0x9862('0x1e')](respondWithResult(_0x5d4aae,null))['catch'](handleError(_0x5d4aae,null));};exports[_0x9862('0x74')]=function(_0xf5bf82,_0x7b5f48,_0x5915c7){_0xf5bf82[_0x9862('0x5b')][_0x9862('0x75')]=_0xf5bf82[_0x9862('0x72')]['filename'];return db[_0x9862('0x40')][_0x9862('0x59')]({'where':{'id':_0xf5bf82['params']['id']}})[_0x9862('0x1e')](handleEntityNotFound(_0x7b5f48,null))[_0x9862('0x1e')](saveUpdates(_0xf5bf82[_0x9862('0x5b')],null))[_0x9862('0x1e')](respondWithResult(_0x7b5f48,null))['catch'](handleError(_0x7b5f48,null));};exports[_0x9862('0x76')]=function(_0x3cc20b,_0x57003e,_0x29b421){_0x3cc20b[_0x9862('0x5b')]['systemAvatar']=_0x3cc20b['file'][_0x9862('0x73')];return db[_0x9862('0x40')]['find']({'where':{'id':_0x3cc20b[_0x9862('0x60')]['id']}})['then'](handleEntityNotFound(_0x57003e,null))[_0x9862('0x1e')](saveUpdates(_0x3cc20b[_0x9862('0x5b')],null))[_0x9862('0x1e')](respondWithResult(_0x57003e,null))[_0x9862('0x28')](handleError(_0x57003e,null));};exports[_0x9862('0x77')]=function(_0x415cdc,_0x45614e,_0x3c2bb0){var _0x1cfaee=path[_0x9862('0x78')](config['root'],'server/files/images/logos/default_logo.svg');var _0x39ecc0={'where':{'id':_0x415cdc[_0x9862('0x60')]['id']},'attributes':['id',_0x9862('0x71')],'raw':!![]};var _0x48795a=![];return require('../../config/license/util')['getLicense']()['then'](function(_0x3ddec8){if(_0x3ddec8){_0x48795a=_0x3ddec8[_0x9862('0x79')];}})[_0x9862('0x1e')](function(){return db['ChatWebsite'][_0x9862('0x59')](_0x39ecc0);})['then'](handleEntityNotFound(_0x45614e,null))[_0x9862('0x1e')](function(_0x36b65b){if(_0x36b65b){if(!_[_0x9862('0x7a')](_0x36b65b[_0x9862('0x71')])){if(fs[_0x9862('0x7b')](path[_0x9862('0x78')](config[_0x9862('0x7c')],_0x9862('0x7d'),_0x36b65b[_0x9862('0x71')]))&&_0x48795a){_0x1cfaee=path[_0x9862('0x78')](config[_0x9862('0x7c')],_0x9862('0x7d'),_0x36b65b['sitepic']);}}return _0x45614e['download'](_0x1cfaee);}})[_0x9862('0x28')](handleError(_0x45614e,null));};exports[_0x9862('0x7e')]=function(_0x20af33,_0x2b14fd,_0x1640e3){var _0x412daf=path[_0x9862('0x78')](config[_0x9862('0x7c')],_0x9862('0x7f'));var _0x599107={'where':{'id':_0x20af33['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x9862('0x40')]['find'](_0x599107)[_0x9862('0x1e')](handleEntityNotFound(_0x2b14fd,null))[_0x9862('0x1e')](function(_0x3e5310){if(_0x3e5310){if(!_[_0x9862('0x7a')](_0x3e5310['agentAvatar'])){if(fs[_0x9862('0x7b')](path['join'](config[_0x9862('0x7c')],_0x9862('0x80'),_0x3e5310['agentAvatar']))){_0x412daf=path[_0x9862('0x78')](config[_0x9862('0x7c')],_0x9862('0x80'),_0x3e5310[_0x9862('0x81')]);}}return _0x2b14fd['download'](_0x412daf);}})[_0x9862('0x28')](handleError(_0x2b14fd,null));};exports[_0x9862('0x82')]=function(_0x143049,_0x165b20,_0x4b6d41){var _0x6ab355=path['join'](config[_0x9862('0x7c')],_0x9862('0x83'));var _0x2b8fe8={'where':{'id':_0x143049[_0x9862('0x60')]['id']},'attributes':['id','customerAvatar',_0x9862('0x84')],'raw':!![]};return db[_0x9862('0x40')][_0x9862('0x59')](_0x2b8fe8)[_0x9862('0x1e')](handleEntityNotFound(_0x165b20,null))[_0x9862('0x1e')](function(_0x2a4bbf){if(_0x2a4bbf){if(!_[_0x9862('0x7a')](_0x2a4bbf['customerAvatar'])){if(fs['existsSync'](path[_0x9862('0x78')](config[_0x9862('0x7c')],_0x9862('0x80'),_0x2a4bbf[_0x9862('0x75')]))&&_0x2a4bbf[_0x9862('0x84')]){_0x6ab355=path[_0x9862('0x78')](config[_0x9862('0x7c')],_0x9862('0x80'),_0x2a4bbf[_0x9862('0x75')]);}}return _0x165b20[_0x9862('0x85')](_0x6ab355);}})[_0x9862('0x28')](handleError(_0x165b20,null));};exports['getSystemAvatar']=function(_0x5b3b31,_0xb4ee83,_0x2ec3c0){var _0x32f5db=path['join'](config['root'],_0x9862('0x86'));var _0x434877={'where':{'id':_0x5b3b31[_0x9862('0x60')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x9862('0x40')][_0x9862('0x59')](_0x434877)['then'](handleEntityNotFound(_0xb4ee83,null))[_0x9862('0x1e')](function(_0x48b8ff){if(_0x48b8ff){if(!_[_0x9862('0x7a')](_0x48b8ff[_0x9862('0x87')])){if(fs[_0x9862('0x7b')](path[_0x9862('0x78')](config['root'],'server/files/images/avatars/',_0x48b8ff[_0x9862('0x87')]))){_0x32f5db=path[_0x9862('0x78')](config[_0x9862('0x7c')],'server/files/images/avatars/',_0x48b8ff[_0x9862('0x87')]);}}return _0xb4ee83[_0x9862('0x85')](_0x32f5db);}})[_0x9862('0x28')](handleError(_0xb4ee83,null));};exports[_0x9862('0x88')]=function(_0xe158b1,_0x106206,_0x474f71){var _0x7003c=require(_0x9862('0x89'));var _0x4be0c3=new _0x7003c();var _0x206f5e=_0x4be0c3[_0x9862('0x8a')](_0xe158b1[_0x9862('0x8b')][_0x9862('0x8c')])[_0x9862('0x8d')]();var _0x458135={'body':_0xe158b1[_0x9862('0x5b')],'channel':'chat'};var _0x17f09b=[];var _0x45f805=[];var _0xd2709c={};var _0x5e02e2=![];return db['CmContact'][_0x9862('0x61')]()[_0x9862('0x1e')](function(_0x56fb52){if(!_0x56fb52){throw new db[(_0x9862('0x8e'))][(_0x9862('0x8f'))](_0x9862('0x90'));}_0x17f09b=_[_0x9862('0x91')](_[_0x9862('0x45')](_0x56fb52),[_0x9862('0x92'),_0x9862('0x93')]);_0x45f805=_[_0x9862('0x91')](_['keys'](_0x56fb52),['createdAt',_0x9862('0x93'),_0x9862('0x94'),_0x9862('0x95')]);if(_0xe158b1[_0x9862('0x5b')]['id']){delete _0xe158b1['body']['id'];}if(_[_0x9862('0x7a')](_0xe158b1[_0x9862('0x5b')][_0x9862('0x96')])){throw new db[(_0x9862('0x8e'))][(_0x9862('0x8f'))](_0x9862('0x97'));}if(_[_0x9862('0x7a')](_0xe158b1[_0x9862('0x5b')][_0x9862('0x5b')])||_0xe158b1[_0x9862('0x5b')][_0x9862('0x5b')]===''){throw new db['Sequelize'][(_0x9862('0x8f'))](_0x9862('0x98'));}if(_[_0x9862('0x7a')](_0xe158b1[_0x9862('0x5b')][_0x9862('0x99')])){throw new db['Sequelize'][(_0x9862('0x8f'))](_0x9862('0x9a')+_0x45f805);}if(!_['includes'](_0x45f805,_0xe158b1[_0x9862('0x5b')][_0x9862('0x99')])){throw new db[(_0x9862('0x8e'))][(_0x9862('0x8f'))](_0x9862('0x9b')+_0x45f805);}_0xd2709c[_0xe158b1['body'][_0x9862('0x99')]]=_0xe158b1[_0x9862('0x5b')]['from'];})[_0x9862('0x1e')](function(){return db['ChatWebsite']['find']({'where':{'id':_0xe158b1[_0x9862('0x60')]['id']},'include':[{'model':db[_0x9862('0x9c')],'as':_0x9862('0x9d'),'include':[{'model':db[_0x9862('0x9e')],'as':'Contacts','where':_0xd2709c,'limit':0x1,'order':[[_0x9862('0x93'),_0x9862('0x9f')]]}]},{'model':db[_0x9862('0xa0')],'as':_0x9862('0xa1')}]});})[_0x9862('0x1e')](handleEntityNotFound(_0x106206,null))[_0x9862('0x1e')](function(_0x3fff42){if(_0x3fff42&&_0x3fff42[_0x9862('0x9d')]){_0x458135[_0x9862('0xa2')]=_0x3fff42;_0x458135[_0x9862('0xa3')]=_0x3fff42[_0x9862('0xa1')];_0x458135[_0x9862('0xa4')]=_0x3fff42[_0x9862('0x9d')];_0x458135[_0x9862('0xa3')]=_['orderBy'](_0x458135[_0x9862('0xa3')],[_0x9862('0xa5')],[_0x9862('0xa6')]);if(_0x458135[_0x9862('0xa2')][_0x9862('0xa1')]){delete _0x458135[_0x9862('0xa2')][_0x9862('0xa1')];}if(_0x458135[_0x9862('0xa2')]['List']&&_0x458135[_0x9862('0xa2')]['List'][_0x9862('0xa7')][_0x9862('0x49')]){return _0x458135[_0x9862('0xa2')][_0x9862('0x9d')]['Contacts'][0x0];}var _0x55eab6=_[_0x9862('0x16')](_0xe158b1[_0x9862('0x5b')],{'firstName':_0xe158b1['body'][_0x9862('0x96')],'ListId':_0x3fff42[_0x9862('0x95')]});_0x55eab6[_0xe158b1[_0x9862('0x5b')][_0x9862('0x99')]]=_0xe158b1[_0x9862('0x5b')]['from'];return db['CmContact'][_0x9862('0x5a')](_0x55eab6,{'fields':_0x17f09b,'raw':!![]});}})[_0x9862('0x1e')](handleEntityNotFound(_0x106206,null))[_0x9862('0x1e')](function(_0xa65841){_0x458135[_0x9862('0xa8')]=_0xa65841;var _0x4a9bd9=_0xe158b1['body'][_0x9862('0xa9')];if(_0xe158b1[_0x9862('0x8b')][_0x9862('0xaa')]){_0x4a9bd9=_0xe158b1[_0x9862('0x8b')][_0x9862('0xaa')];}else if(_0xe158b1[_0x9862('0x8b')][_0x9862('0xab')]){_0x4a9bd9=_[_0x9862('0xac')](_0xe158b1['headers'][_0x9862('0xab')][_0x9862('0xad')](','));}if(_0xa65841){var _0x33c4e8={'ContactId':_0xa65841['id'],'ChatWebsiteId':_0xe158b1[_0x9862('0x60')]['id'],'from':(_0xa65841[_0x9862('0xae')]||'')+'\x20'+(_0xa65841[_0x9862('0xaf')]||''),'customerIp':_0x4a9bd9,'customerPort':_0xe158b1[_0x9862('0x8b')][_0x9862('0xb0')]?_0xe158b1[_0x9862('0x8b')]['x-real-port']:null,'referer':_0xe158b1[_0x9862('0x5b')][_0x9862('0xb1')],'browserName':_0x206f5e[_0x9862('0xb2')]['name']&&_0x206f5e[_0x9862('0xb2')]['version']?util['format'](_0x9862('0xb3'),_0x206f5e[_0x9862('0xb2')][_0x9862('0x3b')],_0x206f5e[_0x9862('0xb2')][_0x9862('0xb4')]):_0x9862('0xb5'),'browserVersion':_0x206f5e['browser'][_0x9862('0xb4')]||_0x9862('0xb5'),'osName':util[_0x9862('0xb6')](_0x9862('0xb3'),_0x206f5e['os'][_0x9862('0x3b')],_0x206f5e['os'][_0x9862('0xb4')]),'osVersion':_0x206f5e['os'][_0x9862('0xb4')],'deviceModel':_0x206f5e[_0x9862('0xb7')][_0x9862('0x43')]&&_0x206f5e['device'][_0x9862('0xb8')]?util[_0x9862('0xb6')](_0x9862('0xb9'),_0x206f5e['device'][_0x9862('0x43')],_0x206f5e[_0x9862('0xb7')]['vendor'],_0x206f5e['device']['type']):null,'deviceVendor':_0x206f5e[_0x9862('0xb7')][_0x9862('0xb8')],'deviceType':_0x206f5e['device'][_0x9862('0x51')],'formData':JSON['stringify'](_0xe158b1[_0x9862('0x5b')])};var _0xaf3f7e={'ChatWebsiteId':_0xe158b1[_0x9862('0x60')]['id'],'closed':![]};if(_0xe158b1['body'][_0x9862('0xba')]){_0xaf3f7e[_0x9862('0xba')]=_0xe158b1[_0x9862('0x5b')][_0x9862('0xba')];return db[_0x9862('0xbb')][_0x9862('0x59')]({'where':_0xaf3f7e})[_0x9862('0x1e')](function(_0x44e276){if(_0x44e276){return[_0x44e276,![]];}_0x33c4e8['threadId']=_0xe158b1[_0x9862('0x5b')]['threadId'];_0x33c4e8[_0x9862('0xbc')]=_0xe158b1[_0x9862('0x5b')]['externalUrl'];return db[_0x9862('0xbb')][_0x9862('0x5a')](_0x33c4e8)['then'](function(_0x19f2b4){return[_0x19f2b4,!![]];});});}_0xaf3f7e[_0x9862('0xbd')]=_0xa65841['id'];if(_0xe158b1[_0x9862('0x5b')][_0x9862('0xbe')]&&_0xe158b1[_0x9862('0x5b')]['interaction']['id']){_0xaf3f7e['id']=_0xe158b1[_0x9862('0x5b')][_0x9862('0xbe')]['id'];return db[_0x9862('0xbb')][_0x9862('0x59')]({'where':_0xaf3f7e})[_0x9862('0x1e')](function(_0x581381){if(_0x581381){return[_0x581381,![]];}return db['ChatInteraction'][_0x9862('0x5a')](_0x33c4e8)[_0x9862('0x1e')](function(_0x387369){return[_0x387369,!![]];});});}return db['ChatInteraction'][_0x9862('0x5a')](_0x33c4e8)[_0x9862('0x1e')](function(_0x253932){return[_0x253932,!![]];});}})[_0x9862('0xbf')](function(_0x4aa17e,_0x16d2d9){if(_0x4aa17e){_0x5e02e2=_0x16d2d9;if(!_0x16d2d9){var _0x4eed42={'from':(_0x458135[_0x9862('0xa8')][_0x9862('0xae')]||'')+'\x20'+(_0x458135[_0x9862('0xa8')][_0x9862('0xaf')]||'')};if(_0xe158b1[_0x9862('0x5b')][_0x9862('0xba')]&&_0xe158b1[_0x9862('0x5b')]['messageId']&&_0xe158b1[_0x9862('0x5b')][_0x9862('0xba')]!=_0xe158b1[_0x9862('0x5b')]['messageId']){_0x4eed42[_0x9862('0xba')]=_0xe158b1['body']['messageId'];}return _0x4aa17e[_0x9862('0x34')](_0x4eed42);}else{return _0x4aa17e;}}})[_0x9862('0x1e')](function(_0x3a419a){_0x458135['interaction']=_0x3a419a[_0x9862('0x36')]({'plain':!![]});_0x458135['interaction'][_0x9862('0xc0')]=_0x5e02e2;if(_0x458135[_0x9862('0xbe')]['created']){if(_0x458135['account'][_0x9862('0xc1')]){_0x458135[_0x9862('0xa3')][_0x9862('0xc2')]({'id':0x0,'priority':_0x458135[_0x9862('0xa3')]['length']+0x1,'app':_0x9862('0xc3'),'appdata':_0x9862('0xc4'),'interval':_0x9862('0xc5')});}}return db[_0x9862('0xc6')]['create']({'body':_0xe158b1[_0x9862('0x5b')][_0x9862('0x5b')],'ChatWebsiteId':_0xe158b1['params']['id'],'ChatInteractionId':_0x3a419a['id'],'direction':'in','ContactId':_0x458135[_0x9862('0xa8')]['id'],'AttachmentId':_0xe158b1['body'][_0x9862('0xc7')]});})[_0x9862('0x1e')](function(_0xe12418){_0x458135['message']=_0xe12418;if(_0x458135[_0x9862('0xbe')][_0x9862('0xc8')]){return db[_0x9862('0xc9')][_0x9862('0x59')]({'attributes':['id',_0x9862('0x3b')],'where':{'id':_0x458135[_0x9862('0xbe')][_0x9862('0xc8')]}})[_0x9862('0x1e')](function(_0x3dce3e){if(_0x3dce3e){_0x458135[_0x9862('0xa3')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9862('0xca'),'appdata':_0x3dce3e[_0x9862('0x3b')]+','+(_0x458135[_0x9862('0xa2')][_0x9862('0xcb')]||0xa),'interval':_0x9862('0xc5')});_0x458135[_0x9862('0xcc')]=!![];}return respondWithRpcPromise(_0x9862('0xcd'),_0x9862('0xce'),_0x458135);});}return respondWithRpcPromise('Start',_0x9862('0xce'),_0x458135);})[_0x9862('0x1e')](function(_0x1e57e2){respondWithRpcPromise(_0x9862('0xcf'),_0x9862('0xcf'),{'event':_0x9862('0x88'),'message':_0x1e57e2},client9002);return _0x1e57e2;})['then'](respondWithResult(_0x106206,null))[_0x9862('0x28')](handleError(_0x106206,null));};exports[_0x9862('0xd0')]=function(_0xa1a65,_0x561143,_0x3a84e9){var _0x4e5208,_0x295b5f,_0x51ae99;var _0x2f6e44=[];var _0x2d12a3=[];var _0x2dfc0e={};var _0x2efc6e=_0xa1a65[_0x9862('0xd1')]||[];var _0x3d383d=[];var _0x47e7ee;return db['CmContact'][_0x9862('0x61')]()[_0x9862('0x1e')](function(_0x1b0b60){if(!_0x1b0b60){throw new db[(_0x9862('0x8e'))][(_0x9862('0x8f'))](_0x9862('0x90'));}_0x2d12a3=_[_0x9862('0x91')](_[_0x9862('0x45')](_0x1b0b60),[_0x9862('0x92'),'updatedAt']);_0x2f6e44=_[_0x9862('0x91')](_[_0x9862('0x45')](_0x1b0b60),['createdAt',_0x9862('0x93'),'CompanyId',_0x9862('0x95')]);if(_0xa1a65['body']['id']){delete _0xa1a65[_0x9862('0x5b')]['id'];}if(_[_0x9862('0x7a')](_0xa1a65[_0x9862('0x5b')][_0x9862('0x96')])){throw _0x561143['status'](0x1f4)[_0x9862('0x3c')](new db[(_0x9862('0x8e'))][(_0x9862('0x8f'))](_0x9862('0x97')));}if(_[_0x9862('0x7a')](_0xa1a65[_0x9862('0x5b')]['body'])||_0xa1a65[_0x9862('0x5b')][_0x9862('0x5b')]===''){throw _0x561143[_0x9862('0x2a')](0x1f4)[_0x9862('0x3c')](new db[(_0x9862('0x8e'))][(_0x9862('0x8f'))](_0x9862('0x98')));}if(_['isNil'](_0xa1a65['body'][_0x9862('0xd2')])){throw _0x561143['status'](0x1f4)['send'](new db['Sequelize'][(_0x9862('0x8f'))](_0x9862('0xd3')+_0x2f6e44));}if(!_[_0x9862('0xd4')](_0x2f6e44,_0xa1a65[_0x9862('0x5b')][_0x9862('0xd2')])){throw _0x561143['status'](0x1f4)['send'](new db[(_0x9862('0x8e'))]['ValidationError'](_0x9862('0xd5')+_0x2f6e44));}_0x2dfc0e[_0xa1a65[_0x9862('0x5b')]['mapKeyOffline']]=_0xa1a65[_0x9862('0x5b')][_0x9862('0x96')];})[_0x9862('0x1e')](function(){return db['ChatWebsite'][_0x9862('0x59')]({'where':{'id':_0xa1a65[_0x9862('0x60')]['id']},'include':[{'model':db[_0x9862('0x9c')],'as':_0x9862('0x9d')},{'model':db[_0x9862('0xd6')],'as':_0x9862('0xd6')}]});})['then'](handleEntityNotFound(_0x561143,null))['then'](function(_0x5b2085){if(_0x5b2085&&_0x5b2085[_0x9862('0x9d')]){_0x295b5f=_0x5b2085;var _0x3214b8=_[_0x9862('0x16')](_0xa1a65[_0x9862('0x5b')],{'firstName':_0xa1a65['body'][_0x9862('0x96')],'phone':_0xa1a65[_0x9862('0x5b')][_0x9862('0x96')],'ListId':_0x5b2085[_0x9862('0x95')]});_0x3214b8[_0xa1a65[_0x9862('0x5b')][_0x9862('0xd2')]]=_0xa1a65[_0x9862('0x5b')][_0x9862('0x96')];return db[_0x9862('0x9e')][_0x9862('0xd7')]({'where':_0x2dfc0e,'defaults':_0x3214b8});}})[_0x9862('0xbf')](function(_0x2e1a23){if(_0x2e1a23){_0x51ae99=_0x2e1a23;var _0x5722bc=fs[_0x9862('0xd8')](path[_0x9862('0x78')](config[_0x9862('0x7c')],_0x9862('0xd9')),_0x9862('0xda'));var _0x4b8a16=ejs[_0x9862('0xdb')](_0x5722bc,{'body':_[_0x9862('0xdc')](_0xa1a65[_0x9862('0x5b')][_0x9862('0x5b')]),'bodyTitle':_0x295b5f[_0x9862('0xdd')]});return db[_0x9862('0xde')]['create']({'body':_0x4b8a16,'ContactId':_0x2e1a23['id'],'ChatWebsiteId':_0x295b5f['id']});}})[_0x9862('0x1e')](function(_0x4fb2f8){_0x47e7ee=_0x4fb2f8;if(_0x2efc6e['length']){var _0x5ddd38=_0x2efc6e[_0x9862('0x3f')](function(_0x3f11a3){return{'name':_0x3f11a3[_0x9862('0xdf')],'basename':_0x3f11a3[_0x9862('0x73')],'type':_0x3f11a3[_0x9862('0xe0')],'ChatOfflineMessageId':_0x4fb2f8['id']};});_0x3d383d=_0x5ddd38[_0x9862('0x3f')](_0x54a1c2=>{var _0x5232f1={'filename':_0x54a1c2[_0x9862('0x3b')],'path':path[_0x9862('0x78')](config[_0x9862('0x7c')],'server',_0x9862('0xd1'),_0x9862('0xe1'),_0x9862('0xe2'),_0x54a1c2[_0x9862('0xe3')])};return _0x5232f1;});if(!_0x295b5f[_0x9862('0xe4')]){return db[_0x9862('0xe5')][_0x9862('0xe6')](function(_0x43ee37){return db[_0x9862('0xe7')][_0x9862('0xe8')](_0x5ddd38,{'transaction':_0x43ee37});});}}})[_0x9862('0x1e')](function(){if(_0x47e7ee){_0x4e5208=_0x47e7ee;return db[_0x9862('0xd6')][_0x9862('0x66')]({'where':{'active':!![]},'include':[{'model':db[_0x9862('0xe9')],'as':'Smtp','raw':!![]}]});}})[_0x9862('0x1e')](function(_0x4a90b1){if(_0x4a90b1&&_0x4a90b1[_0x9862('0xea')]&&_0x295b5f[_0x9862('0xeb')]&&_0x295b5f[_0x9862('0xec')]){var _0x5461be={'tls':{'rejectUnauthorized':![]}};if(_0x4a90b1[_0x9862('0xea')]['service']){_0x5461be['service']=_0x4a90b1[_0x9862('0xea')][_0x9862('0xed')];}else{_0x5461be[_0x9862('0xee')]=_0x4a90b1['Smtp'][_0x9862('0xee')];_0x5461be[_0x9862('0xef')]=_0x4a90b1[_0x9862('0xea')][_0x9862('0xef')];_0x5461be[_0x9862('0xf0')]=_0x4a90b1['Smtp'][_0x9862('0xf0')];}if(_0x4a90b1[_0x9862('0xea')][_0x9862('0xf1')]){_0x5461be[_0x9862('0xf2')]={'user':_0x4a90b1[_0x9862('0xea')][_0x9862('0x5c')],'pass':_0x4a90b1[_0x9862('0xea')][_0x9862('0xf3')]};}return respondWithRpcPromise('SendMail',_0x9862('0xf4'),{'account':_0x5461be,'message':{'from':util['format'](_0x9862('0xf5'),_0x4a90b1[_0x9862('0x3b')],_0x4a90b1[_0x9862('0xf6')]||_0x4a90b1[_0x9862('0xea')][_0x9862('0x5c')]),'to':_0x295b5f[_0x9862('0xec')],'subject':_0x295b5f[_0x9862('0xf7')],'html':_0x4e5208[_0x9862('0x5b')],'attachments':_0x3d383d}},client9003)[_0x9862('0x1e')](function(){return _0x4e5208;})[_0x9862('0x28')](function(_0x3e18a2){console[_0x9862('0x23')](_0x3e18a2);});}})[_0x9862('0x1e')](function(){if(_0x295b5f&&_0x295b5f[_0x9862('0xe4')]&&_0x295b5f[_0x9862('0xf8')]){var _0x2bfa9c=[];if(_0x2efc6e[_0x9862('0x49')]){_0x2bfa9c=_0x2efc6e[_0x9862('0x3f')](function(_0x40b8e4){return{'name':_0x40b8e4['originalname'],'basename':_0x40b8e4['filename'],'type':_0x40b8e4['mimetype'],'ChatOfflineMessageId':_0x47e7ee['id']};});}var _0x1fa365;if(!_[_0x9862('0x7a')](_0x295b5f[_0x9862('0xf9')])){var _0x51f6f0=_[_0x9862('0x3f')](_0xa1a65[_0x9862('0x5b')],function(_0x4b79b9){return _0x4b79b9;});var _0x396a50=_['toPairsIn'](_0x51f6f0)[0x0];var _0x1e5fbe=_[_0x9862('0xfa')](_0x396a50,function(_0x241d2c){return _0x241d2c;});_0x1fa365=_0x1e5fbe[0x1][_0x295b5f[_0x9862('0xf9')]];}var _0x45a78b={'from':_0x51ae99[_0x9862('0xf6')],'firstName':_0x51ae99[_0x9862('0xae')],'lastName':_0x51ae99[_0x9862('0xaf')],'mapKey':_0x9862('0xf6'),'message':{'from':_0x51ae99[_0x9862('0xf6')],'to':_0x295b5f[_0x9862('0xd6')][_0x9862('0xf6')],'cc':'','subject':_[_0x9862('0x7a')](_0x1fa365)?_0x295b5f[_0x9862('0xf7')]:_0x1fa365,'messageId':'','sentAt':new Date(),'attach':_0x2bfa9c[_0x9862('0x49')],'attachments':_0x2bfa9c,'originChannel':_0x9862('0xfb'),'ChatWebsiteId':_0x295b5f['id'],'ChatOfflineMessageId':_0x4e5208['id'],'originTo':_0x295b5f[_0x9862('0xd6')][_0x9862('0xf6')]},'body':_0x4e5208[_0x9862('0x5b')]};var _0x12f4e7={'account':{'id':_0x295b5f[_0x9862('0xf8')]},'body':_0x45a78b,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0x9862('0xfc'),_0x12f4e7,client9001)[_0x9862('0x1e')](function(){return _0x4e5208;})[_0x9862('0x28')](function(_0x5a8b9f){console[_0x9862('0x23')](_0x5a8b9f);});}return;})[_0x9862('0x1e')](function(){if(_0x4e5208){return _0x4e5208;}})[_0x9862('0x1e')](respondWithResult(_0x561143,null))[_0x9862('0x28')](function(_0x123c79){console['error'](_0x9862('0x28'),_0x123c79);for(var _0xb50a78 of _0x2efc6e){var _0x26573f=path[_0x9862('0x78')](config[_0x9862('0x7c')],'server',_0x9862('0xd1'),_0x9862('0xe1'),_0x9862('0xe2'),_0xb50a78['filename']);fs_extra[_0x9862('0xfd')](_0x26573f)[_0x9862('0x28')](function(_0x22534d){console[_0x9862('0x23')](_0x9862('0xfe'),_0x26573f,_0x22534d);});}});};exports[_0x9862('0xff')]=function(_0x444c46,_0x1f438c,_0x1c349f){return db[_0x9862('0xbb')][_0x9862('0x59')]({'where':{'id':_0x444c46[_0x9862('0x60')]['id']}})['then'](handleEntityNotFound(_0x1f438c,null))[_0x9862('0x1e')](function(_0x509ccb){if(_0x509ccb){return _0x509ccb[_0x9862('0xff')](_0x444c46['body'][_0x9862('0x6b')],_[_0x9862('0x100')](_0x444c46['body'],[_0x9862('0x6b'),'id'])||{});}})[_0x9862('0x1e')](respondWithResult(_0x1f438c,null))[_0x9862('0x28')](handleError(_0x1f438c,null));};exports[_0x9862('0x101')]=function(_0x1c6223,_0x2815f9,_0x571733){var _0x220c29={'raw':![],'where':{}};var _0x2a820d={};var _0x1b96bb={'count':0x0,'rows':[]};return db[_0x9862('0x40')][_0x9862('0x66')]({'where':{'id':_0x1c6223[_0x9862('0x60')]['id']}})[_0x9862('0x1e')](handleEntityNotFound(_0x2815f9,null))[_0x9862('0x1e')](function(_0x5e25a5){if(_0x5e25a5){_0x2a820d['model']=_[_0x9862('0x45')](db[_0x9862('0xbb')][_0x9862('0x41')]);_0x2a820d[_0x9862('0x44')]=_[_0x9862('0x45')](_0x1c6223[_0x9862('0x44')]);_0x2a820d[_0x9862('0x4d')]=_[_0x9862('0x46')](_0x2a820d[_0x9862('0x43')],_0x2a820d['query']);_0x220c29[_0x9862('0x48')]=_[_0x9862('0x46')](_0x2a820d['model'],qs[_0x9862('0x47')](_0x1c6223['query'][_0x9862('0x47')]));_0x220c29[_0x9862('0x48')]=_0x220c29[_0x9862('0x48')][_0x9862('0x49')]?_0x220c29[_0x9862('0x48')]:_0x2a820d[_0x9862('0x43')];if(!_0x1c6223[_0x9862('0x44')]['hasOwnProperty']('nolimit')){_0x220c29[_0x9862('0x2d')]=qs['limit'](_0x1c6223[_0x9862('0x44')][_0x9862('0x2d')]);_0x220c29[_0x9862('0x2e')]=qs[_0x9862('0x2e')](_0x1c6223[_0x9862('0x44')][_0x9862('0x2e')]);}_0x220c29[_0x9862('0x68')]=qs[_0x9862('0x4b')](_0x1c6223[_0x9862('0x44')][_0x9862('0x4b')]);_0x220c29[_0x9862('0x4c')]=qs[_0x9862('0x4d')](_['pick'](_0x1c6223[_0x9862('0x44')],_0x2a820d[_0x9862('0x4d')]));_0x220c29[_0x9862('0x4c')][_0x9862('0x63')]=_0x5e25a5['id'];if(_0x1c6223[_0x9862('0x44')][_0x9862('0x4f')]){_0x220c29['where']=_[_0x9862('0x50')](_0x220c29[_0x9862('0x4c')],{'$or':_[_0x9862('0x3f')](_0x220c29[_0x9862('0x48')],function(_0x29e6f7){var _0x4b90df={};_0x4b90df[_0x29e6f7]={'$like':'%'+_0x1c6223['query'][_0x9862('0x4f')]+'%'};return _0x4b90df;})});}_0x220c29=_[_0x9862('0x50')]({},_0x220c29,_0x1c6223[_0x9862('0x53')]);return db[_0x9862('0xbb')][_0x9862('0x54')]({'where':_0x220c29['where']})[_0x9862('0x1e')](function(_0x16df09){_0x1b96bb[_0x9862('0x54')]=_0x16df09;if(_0x1c6223[_0x9862('0x44')][_0x9862('0x55')]){_0x220c29['include']=[{'model':db[_0x9862('0x9e')],'as':_0x9862('0x102'),'required':![]},{'model':db[_0x9862('0xc9')],'as':_0x9862('0x103'),'attributes':['name',_0x9862('0x104'),_0x9862('0x105')],'required':![]},{'model':db['Tag'],'as':_0x9862('0x106'),'attributes':['id',_0x9862('0x3b'),'color'],'where':_0x1c6223['query'][_0x9862('0x107')]?{'id':_0x1c6223[_0x9862('0x44')][_0x9862('0x107')]}:undefined,'required':_0x1c6223[_0x9862('0x44')]['tag']?!![]:![]}];}return db[_0x9862('0xbb')][_0x9862('0x56')](_0x220c29);})[_0x9862('0x1e')](function(_0xc9712a){_0x1b96bb[_0x9862('0x69')]=_0xc9712a;return _0x1b96bb;});}})[_0x9862('0x1e')](respondWithFilteredResult(_0x2815f9,_0x220c29))['catch'](handleError(_0x2815f9,null));};function iftimePromise(_0x186dc2,_0x231c7d){return respondWithRpcPromise(_0x9862('0x108'),_0x9862('0x109'),{'command':_0x231c7d[_0x9862('0x10a')]?util[_0x9862('0xb6')]('iftime\x20%s,%s',_0x186dc2[_0x9862('0x10b')],_0x231c7d['timezone']):util['format'](_0x9862('0x10c'),_0x186dc2[_0x9862('0x10b')])},client9002)[_0x9862('0x1e')](function(_0x40f44f){var _0x5e7cca=_0x40f44f&&_0x40f44f[_0x9862('0x10d')](_0x9862('0x10e'))>=0x0?!![]:![];logger[_0x9862('0x26')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x231c7d['id'],_0x186dc2['id'],_0x186dc2[_0x9862('0x10b')],_0x5e7cca?_0x9862('0x10f'):_0x9862('0x110'),_0x231c7d[_0x9862('0x10a')]?_0x231c7d[_0x9862('0x10a')]:_0x9862('0x111'));return _0x5e7cca;})[_0x9862('0x28')](function(_0xe9d5dd){logger[_0x9862('0x23')](_0x9862('0x112'),_0x231c7d['id'],_0x186dc2['id'],_0x186dc2['interval'],util[_0x9862('0x113')](_0xe9d5dd,{'showHidden':![],'depth':null}),_0x231c7d['timezone']?_0x231c7d[_0x9862('0x10a')]:_0x9862('0x111'));return![];});}exports[_0x9862('0x109')]=function(_0xca64e0,_0x42380b,_0x7635bc){var _0x2ae1ce=0x0;var _0x30b310=0x0;var _0x3e17a9=![];var _0x2cdcd5;var _0x9778e7;return db[_0x9862('0x40')][_0x9862('0x59')]({'where':{'id':_0xca64e0[_0x9862('0x60')]['id']},'include':[{'model':db[_0x9862('0x114')],'as':_0x9862('0x114'),'include':[{'model':db[_0x9862('0x114')],'as':_0x9862('0x115'),'attributes':['id',_0x9862('0x10b')],'raw':!![]}]}]})[_0x9862('0x1e')](handleEntityNotFound(_0x42380b,null))[_0x9862('0x1e')](function(_0x20cc20){if(_0x20cc20){_0x2cdcd5=_0x20cc20;return _0x20cc20[_0x9862('0x116')]({'raw':!![]});}})[_0x9862('0x1e')](function(_0x5e10e0){if(_0x2cdcd5){if(_0x5e10e0){_0x9778e7=_0x5e10e0;}}return require(_0x9862('0x14'))['getLicense']();})[_0x9862('0x1e')](function(_0x15f8c9){if(_0x15f8c9){_0x30b310=_0x15f8c9[_0x9862('0x117')];_0x3e17a9=_0x15f8c9[_0x9862('0x79')];}})['then'](function(){return db[_0x9862('0xbb')][_0x9862('0x54')]({'where':{'closed':![]}});})[_0x9862('0x1e')](function(_0x2ad5d1){_0x2ae1ce=_0x2ad5d1;if(_0x30b310&&_0x2ad5d1>_0x30b310){return db[_0x9862('0x118')][_0x9862('0x66')]({'where':{'id':0x1}})[_0x9862('0x1e')](function(_0x28e9f7){if(_0x28e9f7){_0x28e9f7[_0x9862('0x119')]('chatLicenseExceeded');}});}})[_0x9862('0x1e')](function(){if(_0x2cdcd5['Interval']&&_0x2cdcd5['Interval'][_0x9862('0x115')]){var _0x58e592=[];for(var _0x146471=0x0;_0x146471<_0x2cdcd5[_0x9862('0x114')][_0x9862('0x115')][_0x9862('0x49')];_0x146471++){var _0x4f8458=_0x2cdcd5[_0x9862('0x114')]['Intervals'][_0x146471][_0x9862('0x36')]({'plain':!![]});_0x58e592[_0x9862('0xc2')](iftimePromise(_0x4f8458,_0x2cdcd5));}return BPromise[_0x9862('0x11a')](_0x58e592)['then'](function(_0x4293c4){return _[_0x9862('0x11b')](_0x4293c4);});}else{return!![];}})[_0x9862('0x1e')](function(_0x3f17f3){var _0x3ba3cd=fs[_0x9862('0xd8')](path[_0x9862('0x78')](config[_0x9862('0x7c')],_0x9862('0x11c')),'utf8');var _0x532fb2={'remote':_0x2cdcd5[_0x9862('0x11d')],'query':querystring[_0x9862('0x11e')](_[_0x9862('0x50')](_0x2cdcd5[_0x9862('0x36')]({'plain':!![]}),{'customerIp':_0xca64e0[_0x9862('0x8b')][_0x9862('0xab')]||_0xca64e0[_0x9862('0x8b')]['x-real-ip']||_0xca64e0['connection'][_0x9862('0x11f')]||_0xca64e0['ip'],'referer':_0xca64e0[_0x9862('0x8b')]['referer'],'openedInteractions':_0x2ae1ce,'maxInteractions':_0x30b310,'virtual':_0x3e17a9[_0x9862('0x117')],'online':_0x3f17f3,'custom':_0x3e17a9}))[_0x9862('0x120')](/'/g,'\x5c\x27')};_0x42380b['send'](ejs['render'](Mustache[_0x9862('0xdb')](_0x3ba3cd,_0x532fb2),{'proactiveActions':_0x9778e7,'alignment':_0x2cdcd5[_0x9862('0x121')],'verticalAlignment':_0x2cdcd5['verticalAlignment'],'div_color':_0x2cdcd5[_0x9862('0x122')],'text_color':_0x2cdcd5[_0x9862('0x123')],'button_color':_0x2cdcd5[_0x9862('0x124')],'background_color':_0x2cdcd5[_0x9862('0x125')]}));})[_0x9862('0x28')](handleError(_0x42380b,null));};exports[_0x9862('0x126')]=function(_0x59b688,_0x2d60e3,_0x179075){return db[_0x9862('0x40')][_0x9862('0x66')]({'where':{'id':_0x59b688['params']['id']}})[_0x9862('0x1e')](handleEntityNotFound(_0x2d60e3,null))[_0x9862('0x1e')](function(_0x5cc39d){if(_0x5cc39d){return db[_0x9862('0xe5')][_0x9862('0xe6')](function(_0x346789){return db[_0x9862('0xa0')][_0x9862('0x35')]({'where':{'ChatWebsiteId':_0x59b688[_0x9862('0x60')]['id']},'transaction':_0x346789})[_0x9862('0x1e')](function(_0x2746bc){var _0x9f0d1d=_[_0x9862('0x3f')](_0x59b688['body'],function(_0x224cee){_0x224cee[_0x9862('0x63')]=_0x59b688[_0x9862('0x60')]['id'];return _0x224cee;});return db[_0x9862('0xa0')]['bulkCreate'](_0x9f0d1d,{'transaction':_0x346789});});})[_0x9862('0x1e')](function(){return db[_0x9862('0xa0')][_0x9862('0x127')]({'where':{'ChatWebsiteId':_0x59b688[_0x9862('0x60')]['id']},'order':_0x9862('0xa5')});});}})['then'](respondWithResult(_0x2d60e3,null))['catch'](handleError(_0x2d60e3,null));};exports[_0x9862('0x128')]=function(_0x49d6fb,_0x2c5e19,_0x2eaf72){var _0x5edf33={};var _0x493aa4={};var _0x1ce1dc;var _0x2def0a;return db[_0x9862('0x40')][_0x9862('0x66')]({'where':{'id':_0x49d6fb[_0x9862('0x60')]['id']}})['then'](handleEntityNotFound(_0x2c5e19,null))['then'](function(_0x2fff6a){if(_0x2fff6a){_0x1ce1dc=_0x2fff6a;_0x493aa4[_0x9862('0x43')]=_[_0x9862('0x45')](db['ChatApplication'][_0x9862('0x41')]);_0x493aa4[_0x9862('0x44')]=_[_0x9862('0x45')](_0x49d6fb['query']);_0x493aa4[_0x9862('0x4d')]=_[_0x9862('0x46')](_0x493aa4[_0x9862('0x43')],_0x493aa4['query']);_0x5edf33[_0x9862('0x48')]=_[_0x9862('0x46')](_0x493aa4[_0x9862('0x43')],qs[_0x9862('0x47')](_0x49d6fb[_0x9862('0x44')][_0x9862('0x47')]));_0x5edf33[_0x9862('0x48')]=_0x5edf33['attributes']['length']?_0x5edf33['attributes']:_0x493aa4[_0x9862('0x43')];_0x5edf33[_0x9862('0x68')]=qs[_0x9862('0x4b')](_0x49d6fb[_0x9862('0x44')]['sort']);_0x5edf33[_0x9862('0x4c')]=qs[_0x9862('0x4d')](_[_0x9862('0x4e')](_0x49d6fb[_0x9862('0x44')],_0x493aa4[_0x9862('0x4d')]));if(_0x49d6fb[_0x9862('0x44')]['filter']){_0x5edf33[_0x9862('0x4c')]=_['merge'](_0x5edf33[_0x9862('0x4c')],{'$or':_['map'](_0x5edf33[_0x9862('0x48')],function(_0x262288){var _0x332a64={};_0x332a64[_0x262288]={'$like':'%'+_0x49d6fb[_0x9862('0x44')]['filter']+'%'};return _0x332a64;})});}_0x5edf33=_['merge']({},_0x5edf33,_0x49d6fb[_0x9862('0x53')]);return _0x1ce1dc['getApplications'](_0x5edf33);}})['then'](function(_0x15432f){if(_0x15432f){_0x2def0a=_0x15432f[_0x9862('0x49')];if(!_0x49d6fb['query']['hasOwnProperty'](_0x9862('0x67'))){_0x5edf33[_0x9862('0x2d')]=qs[_0x9862('0x2d')](_0x49d6fb[_0x9862('0x44')]['limit']);_0x5edf33[_0x9862('0x2e')]=qs[_0x9862('0x2e')](_0x49d6fb[_0x9862('0x44')]['offset']);}return _0x1ce1dc[_0x9862('0x128')](_0x5edf33);}})[_0x9862('0x1e')](function(_0x2bf9f5){if(_0x2bf9f5){return _0x2bf9f5?{'count':_0x2def0a,'rows':_0x2bf9f5}:null;}})['then'](respondWithResult(_0x2c5e19,null))['catch'](handleError(_0x2c5e19,null));};exports[_0x9862('0x129')]=function(_0x2ba2d8,_0x3b648d,_0x40e784){return db[_0x9862('0x12a')]['find']({'where':{'id':_0x2ba2d8['params']['id']}})[_0x9862('0x1e')](handleEntityNotFound(_0x3b648d,null))[_0x9862('0x1e')](function(_0x5a89bf){if(_0x5a89bf){return _0x5a89bf[_0x9862('0x129')](_0x2ba2d8[_0x9862('0x5b')][_0x9862('0x6b')],_[_0x9862('0x100')](_0x2ba2d8[_0x9862('0x5b')],[_0x9862('0x6b'),'id'])||{});}})[_0x9862('0x1e')](respondWithResult(_0x3b648d,null))['catch'](handleError(_0x3b648d,null));};exports[_0x9862('0x116')]=function(_0x449156,_0x1f57f1,_0x120991){var _0x4a786b={};var _0x4c56f7={};var _0x3a2eb1;var _0x271a4c;return db[_0x9862('0x40')][_0x9862('0x66')]({'where':{'id':_0x449156[_0x9862('0x60')]['id']}})[_0x9862('0x1e')](handleEntityNotFound(_0x1f57f1,null))['then'](function(_0x503fa4){if(_0x503fa4){_0x3a2eb1=_0x503fa4;_0x4c56f7[_0x9862('0x43')]=_[_0x9862('0x45')](db[_0x9862('0x12b')]['rawAttributes']);_0x4c56f7['query']=_[_0x9862('0x45')](_0x449156['query']);_0x4c56f7[_0x9862('0x4d')]=_[_0x9862('0x46')](_0x4c56f7[_0x9862('0x43')],_0x4c56f7[_0x9862('0x44')]);_0x4a786b[_0x9862('0x48')]=_[_0x9862('0x46')](_0x4c56f7[_0x9862('0x43')],qs[_0x9862('0x47')](_0x449156[_0x9862('0x44')]['fields']));_0x4a786b[_0x9862('0x48')]=_0x4a786b[_0x9862('0x48')][_0x9862('0x49')]?_0x4a786b['attributes']:_0x4c56f7[_0x9862('0x43')];_0x4a786b['order']=qs[_0x9862('0x4b')](_0x449156[_0x9862('0x44')]['sort']);_0x4a786b[_0x9862('0x4c')]=qs['filters'](_[_0x9862('0x4e')](_0x449156[_0x9862('0x44')],_0x4c56f7['filters']));if(_0x449156[_0x9862('0x44')][_0x9862('0x4f')]){_0x4a786b['where']=_['merge'](_0x4a786b[_0x9862('0x4c')],{'$or':_[_0x9862('0x3f')](_0x4a786b[_0x9862('0x48')],function(_0x5db868){var _0x1fbd98={};_0x1fbd98[_0x5db868]={'$like':'%'+_0x449156[_0x9862('0x44')]['filter']+'%'};return _0x1fbd98;})});}_0x4a786b=_[_0x9862('0x50')]({},_0x4a786b,_0x449156[_0x9862('0x53')]);return _0x3a2eb1[_0x9862('0x116')](_0x4a786b);}})[_0x9862('0x1e')](function(_0x12fdb5){if(_0x12fdb5){_0x271a4c=_0x12fdb5[_0x9862('0x49')];if(!_0x449156[_0x9862('0x44')][_0x9862('0x4a')](_0x9862('0x67'))){_0x4a786b[_0x9862('0x2d')]=qs[_0x9862('0x2d')](_0x449156['query'][_0x9862('0x2d')]);_0x4a786b[_0x9862('0x2e')]=qs[_0x9862('0x2e')](_0x449156[_0x9862('0x44')][_0x9862('0x2e')]);}return _0x3a2eb1[_0x9862('0x116')](_0x4a786b);}})[_0x9862('0x1e')](function(_0x406b01){if(_0x406b01){return _0x406b01?{'count':_0x271a4c,'rows':_0x406b01}:null;}})[_0x9862('0x1e')](respondWithResult(_0x1f57f1,null))['catch'](handleError(_0x1f57f1,null));};exports[_0x9862('0x12c')]=function(_0x1b7a74,_0x8dbe0a,_0x2191a4){var _0x1a3ee6=_0x1b7a74[_0x9862('0x44')]['online']===_0x9862('0x12d')?'offlineForm':'onlineForm';return db[_0x9862('0x40')]['find']({'attributes':['id',_0x1a3ee6],'where':{'id':_0x1b7a74[_0x9862('0x60')]['id']}})[_0x9862('0x1e')](handleEntityNotFound(_0x8dbe0a,null))[_0x9862('0x1e')](function(_0x4e808e){if(_0x4e808e){var _0x3ea63f=_0x4e808e[_0x1a3ee6];var _0x51f390=_0x3ea63f&&_0x3ea63f[_0x9862('0x12e')]?_0x3ea63f['items']:[];_0x8dbe0a[_0x9862('0x3c')]({'fromKey':_['isNil'](_0x3ea63f[_0x9862('0x12f')])?undefined:_0x3ea63f[_0x9862('0x12f')],'count':_0x51f390[_0x9862('0x49')],'rows':_0x51f390});}})[_0x9862('0x28')](handleError(_0x8dbe0a,null));};exports[_0x9862('0x130')]=function(_0x5c72e9,_0x2c9236,_0xa0e45d){var _0x7f23f9={'raw':![],'where':{}};var _0x364238={};var _0x3fdce8={'count':0x0,'rows':[]};return db[_0x9862('0x40')][_0x9862('0x66')]({'where':{'id':_0x5c72e9[_0x9862('0x60')]['id']}})['then'](handleEntityNotFound(_0x2c9236,null))[_0x9862('0x1e')](function(_0x31e28d){if(_0x31e28d){_0x364238['model']=_['keys'](db[_0x9862('0xde')][_0x9862('0x41')]);_0x364238[_0x9862('0x44')]=_['keys'](_0x5c72e9[_0x9862('0x44')]);_0x364238[_0x9862('0x4d')]=_['intersection'](_0x364238['model'],_0x364238[_0x9862('0x44')]);_0x7f23f9[_0x9862('0x48')]=_[_0x9862('0x46')](_0x364238[_0x9862('0x43')],qs[_0x9862('0x47')](_0x5c72e9['query']['fields']));_0x7f23f9['attributes']=_0x7f23f9[_0x9862('0x48')][_0x9862('0x49')]?_0x7f23f9[_0x9862('0x48')]:_0x364238[_0x9862('0x43')];if(!_0x5c72e9[_0x9862('0x44')][_0x9862('0x4a')](_0x9862('0x67'))){_0x7f23f9[_0x9862('0x2d')]=qs[_0x9862('0x2d')](_0x5c72e9[_0x9862('0x44')]['limit']);_0x7f23f9[_0x9862('0x2e')]=qs['offset'](_0x5c72e9[_0x9862('0x44')][_0x9862('0x2e')]);}_0x7f23f9[_0x9862('0x68')]=qs['sort'](_0x5c72e9[_0x9862('0x44')]['sort']);_0x7f23f9[_0x9862('0x4c')]=qs[_0x9862('0x4d')](_['pick'](_0x5c72e9[_0x9862('0x44')],_0x364238[_0x9862('0x4d')]));_0x7f23f9[_0x9862('0x4c')][_0x9862('0x63')]=_0x31e28d['id'];if(_0x5c72e9[_0x9862('0x44')]['filter']){_0x7f23f9['where']=_[_0x9862('0x50')](_0x7f23f9[_0x9862('0x4c')],{'$or':_[_0x9862('0x3f')](_0x7f23f9[_0x9862('0x48')],function(_0x360b7a){var _0x24823d={};_0x24823d[_0x360b7a]={'$like':'%'+_0x5c72e9[_0x9862('0x44')]['filter']+'%'};return _0x24823d;})});}_0x7f23f9=_['merge']({},_0x7f23f9,_0x5c72e9[_0x9862('0x53')]);return db[_0x9862('0xde')][_0x9862('0x54')]({'where':_0x7f23f9[_0x9862('0x4c')]})[_0x9862('0x1e')](function(_0x5c2720){_0x3fdce8[_0x9862('0x54')]=_0x5c2720;if(_0x5c72e9[_0x9862('0x44')][_0x9862('0x55')]){_0x7f23f9['include']=[{'all':!![]}];}else{_0x7f23f9[_0x9862('0x58')]=[{'model':db[_0x9862('0x9e')],'as':_0x9862('0x102'),'required':![]},{'model':db[_0x9862('0xe7')],'as':_0x9862('0x131'),'required':![]}];}return db[_0x9862('0xde')][_0x9862('0x56')](_0x7f23f9);})['then'](function(_0x5009f7){_0x3fdce8['rows']=_0x5009f7;return _0x3fdce8;});}})[_0x9862('0x1e')](respondWithFilteredResult(_0x2c9236,_0x7f23f9))[_0x9862('0x28')](handleError(_0x2c9236,null));};exports[_0x9862('0x132')]=function(_0x12f077,_0x348b03,_0x522b09){return db[_0x9862('0x40')][_0x9862('0x59')]({'where':{'id':_0x12f077[_0x9862('0x60')]['id']}})[_0x9862('0x1e')](handleEntityNotFound(_0x348b03,null))[_0x9862('0x1e')](function(_0x48f00c){if(_0x48f00c){return _0x48f00c[_0x9862('0x132')](_0x12f077['body'][_0x9862('0x6b')],_[_0x9862('0x100')](_0x12f077['body'],[_0x9862('0x6b'),'id'])||{})[_0x9862('0xbf')](function(_0x54b13d){for(var _0x27f203=0x0;_0x27f203<_0x12f077['body']['ids'][_0x9862('0x49')];_0x27f203+=0x1){socket[_0x9862('0x133')](_0x9862('0x134'),{'UserId':Number(_0x12f077[_0x9862('0x5b')][_0x9862('0x6b')][_0x27f203]),'ChatWebsiteId':Number(_0x12f077[_0x9862('0x60')]['id'])});}return _0x54b13d;});}})[_0x9862('0x1e')](respondWithResult(_0x348b03,null))['catch'](handleError(_0x348b03,null));};exports['removeAgents']=function(_0x436398,_0x179525,_0x5d4786){return db['ChatWebsite'][_0x9862('0x59')]({'where':{'id':_0x436398[_0x9862('0x60')]['id']}})[_0x9862('0x1e')](handleEntityNotFound(_0x179525,null))[_0x9862('0x1e')](function(_0x352624){if(_0x352624){return _0x352624[_0x9862('0x135')](_0x436398[_0x9862('0x44')]['ids'])[_0x9862('0x1e')](function(){if(_[_0x9862('0x136')](_0x436398[_0x9862('0x44')][_0x9862('0x6b')])){for(var _0x5256b0=0x0;_0x5256b0<_0x436398[_0x9862('0x44')][_0x9862('0x6b')][_0x9862('0x49')];_0x5256b0+=0x1){socket[_0x9862('0x133')](_0x9862('0x137'),{'UserId':Number(_0x436398[_0x9862('0x44')][_0x9862('0x6b')][_0x5256b0]),'ChatWebsiteId':Number(_0x436398[_0x9862('0x60')]['id'])});}}else{socket['emit'](_0x9862('0x137'),{'UserId':Number(_0x436398[_0x9862('0x44')]['ids']),'ChatWebsiteId':Number(_0x436398[_0x9862('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x179525,null))[_0x9862('0x28')](handleError(_0x179525,null));};exports[_0x9862('0x138')]=function(_0x1ec2e2,_0x4c3bbd,_0x42758c){var _0x5e8631={};var _0x210ac8={};var _0x39b885;var _0x4b869e;return db[_0x9862('0x40')][_0x9862('0x66')]({'where':{'id':_0x1ec2e2['params']['id']}})['then'](handleEntityNotFound(_0x4c3bbd,null))[_0x9862('0x1e')](function(_0xd4440){if(_0xd4440){_0x39b885=_0xd4440;_0x210ac8[_0x9862('0x43')]=_[_0x9862('0x45')](db[_0x9862('0xc9')]['rawAttributes']);_0x210ac8[_0x9862('0x44')]=_[_0x9862('0x45')](_0x1ec2e2[_0x9862('0x44')]);_0x210ac8[_0x9862('0x4d')]=_[_0x9862('0x46')](_0x210ac8[_0x9862('0x43')],_0x210ac8[_0x9862('0x44')]);_0x5e8631[_0x9862('0x48')]=_['intersection'](_0x210ac8[_0x9862('0x43')],qs['fields'](_0x1ec2e2[_0x9862('0x44')]['fields']));_0x5e8631['attributes']=_0x5e8631[_0x9862('0x48')]['length']?_0x5e8631[_0x9862('0x48')]:_0x210ac8['model'];_0x5e8631[_0x9862('0x68')]=qs[_0x9862('0x4b')](_0x1ec2e2['query'][_0x9862('0x4b')]);_0x5e8631[_0x9862('0x4c')]=qs[_0x9862('0x4d')](_['pick'](_0x1ec2e2['query'],_0x210ac8[_0x9862('0x4d')]));if(_0x1ec2e2[_0x9862('0x44')][_0x9862('0x4f')]){_0x5e8631[_0x9862('0x4c')]=_[_0x9862('0x50')](_0x5e8631[_0x9862('0x4c')],{'$or':_[_0x9862('0x3f')](_0x5e8631[_0x9862('0x48')],function(_0x5b4c92){var _0x439c30={};_0x439c30[_0x5b4c92]={'$like':'%'+_0x1ec2e2['query'][_0x9862('0x4f')]+'%'};return _0x439c30;})});}_0x5e8631=_[_0x9862('0x50')]({},_0x5e8631,_0x1ec2e2['options']);return _0x39b885[_0x9862('0x138')](_0x5e8631);}})[_0x9862('0x1e')](function(_0x65e372){if(_0x65e372){_0x4b869e=_0x65e372[_0x9862('0x49')];if(!_0x1ec2e2[_0x9862('0x44')]['hasOwnProperty'](_0x9862('0x67'))){_0x5e8631[_0x9862('0x2d')]=qs[_0x9862('0x2d')](_0x1ec2e2[_0x9862('0x44')]['limit']);_0x5e8631[_0x9862('0x2e')]=qs[_0x9862('0x2e')](_0x1ec2e2[_0x9862('0x44')][_0x9862('0x2e')]);}return _0x39b885[_0x9862('0x138')](_0x5e8631);}})[_0x9862('0x1e')](function(_0x4e394e){if(_0x4e394e){return _0x4e394e?{'count':_0x4b869e,'rows':_0x4e394e}:null;}})['then'](respondWithResult(_0x4c3bbd,null))['catch'](handleError(_0x4c3bbd,null));}; \ No newline at end of file +var _0x0174=['Start','startRouting','EventManager','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','server','files','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','MailAccountId','subjectOffline','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Owner','fullname','internal','Tag','color','tag','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','License','all','some','server/files/chat/iframe.ejs','remote','stringify','x-real-ip','connection','remoteAddress','referer','virtual','replace','textColor','color_button','backgroundColor','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','online','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','ChatWebsites','UserProfileResource','sendStatus','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','name','query','keys','attributes','fields','length','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','Pause','intersection','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','addLogo','sitepic','addAvatar','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','Applications','applications','priority','asc','account','contact','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','format','%s\x20%s','version','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','User','unshift','waitForTheAssignedAgent','forcedOwnership'];(function(_0x11e4ce,_0x19c034){var _0x16344e=function(_0x36456e){while(--_0x36456e){_0x11e4ce['push'](_0x11e4ce['shift']());}};_0x16344e(++_0x19c034);}(_0x0174,0x6b));var _0x4017=function(_0x51f855,_0x1189af){_0x51f855=_0x51f855-0x0;var _0x478a4a=_0x0174[_0x51f855];return _0x478a4a;};'use strict';var emlformat=require(_0x4017('0x0'));var rimraf=require(_0x4017('0x1'));var zipdir=require(_0x4017('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4017('0x3'));var BPromise=require(_0x4017('0x4'));var Mustache=require(_0x4017('0x5'));var util=require(_0x4017('0x6'));var path=require(_0x4017('0x7'));var sox=require(_0x4017('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4017('0x9'));var _=require(_0x4017('0xa'));var squel=require(_0x4017('0xb'));var crypto=require(_0x4017('0xc'));var jsforce=require(_0x4017('0xd'));var deskjs=require(_0x4017('0xe'));var toCsv=require(_0x4017('0xf'));var querystring=require(_0x4017('0x10'));var Papa=require(_0x4017('0x11'));var Redis=require('ioredis');var authService=require(_0x4017('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4017('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4017('0x14'));var utils=require('../../config/utils');var config=require(_0x4017('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4017('0x16'))['db'];config[_0x4017('0x17')]=_[_0x4017('0x18')](config['redis'],{'host':_0x4017('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4017('0x17')]));require(_0x4017('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x4017('0x1b')][_0x4017('0x1c')]({'port':0x232c});var client9002=jayson[_0x4017('0x1b')][_0x4017('0x1c')]({'port':0x232a});var client9003=jayson[_0x4017('0x1b')][_0x4017('0x1c')]({'port':0x232b});var client9001=jayson[_0x4017('0x1b')]['http']({'port':0x2329});function respondWithRpcPromise(_0x4b2e30,_0x3a9744,_0x561fa7,_0x6fabf7){return new BPromise(function(_0x2146fb,_0x36b48d){var _0x5498f2=_0x6fabf7||client;return _0x5498f2[_0x4017('0x1d')](_0x4b2e30,_0x561fa7)[_0x4017('0x1e')](function(_0x5575e2){logger[_0x4017('0x1f')](_0x4017('0x20'),_0x3a9744,'request\x20sent');logger[_0x4017('0x21')](_0x4017('0x22'),_0x3a9744,_0x4017('0x23'),JSON['stringify'](_0x5575e2));if(_0x5575e2[_0x4017('0x24')]){if(_0x5575e2['error'][_0x4017('0x25')]===0x1f4){logger[_0x4017('0x24')](_0x4017('0x20'),_0x3a9744,_0x5575e2[_0x4017('0x24')][_0x4017('0x26')]);return _0x36b48d(_0x5575e2[_0x4017('0x24')][_0x4017('0x26')]);}logger[_0x4017('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x3a9744,_0x5575e2['error']['message']);return _0x2146fb(_0x5575e2[_0x4017('0x24')][_0x4017('0x26')]);}else{logger[_0x4017('0x1f')](_0x4017('0x20'),_0x3a9744,_0x4017('0x23'));_0x2146fb(_0x5575e2[_0x4017('0x27')]['message']);}})[_0x4017('0x28')](function(_0x3edde6){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x3a9744,_0x3edde6);_0x36b48d(_0x3edde6);});});}function respondWithStatusCode(_0x1d6124,_0xd19708){_0xd19708=_0xd19708||0xcc;return function(_0x50d540){if(_0x50d540){return _0x1d6124['sendStatus'](_0xd19708);}return _0x1d6124[_0x4017('0x29')](_0xd19708)[_0x4017('0x2a')]();};}function respondWithResult(_0x5cb272,_0x571d10){_0x571d10=_0x571d10||0xc8;return function(_0x5a612f){if(_0x5a612f){return _0x5cb272[_0x4017('0x29')](_0x571d10)[_0x4017('0x2b')](_0x5a612f);}};}function respondWithFilteredResult(_0x1e25ce,_0x155708){return function(_0x1e9a96){if(_0x1e9a96){var _0x35d036=typeof _0x155708[_0x4017('0x2c')]===_0x4017('0x2d')&&typeof _0x155708[_0x4017('0x2e')]===_0x4017('0x2d');var _0x57af7d=_0x1e9a96[_0x4017('0x2f')];var _0x44c95d=_0x35d036?0x0:_0x155708[_0x4017('0x2c')];var _0x4614d9=_0x35d036?_0x1e9a96[_0x4017('0x2f')]:_0x155708['offset']+_0x155708['limit'];var _0xa1208b;if(_0x4614d9>=_0x57af7d){_0x4614d9=_0x57af7d;_0xa1208b=0xc8;}else{_0xa1208b=0xce;}_0x1e25ce['status'](_0xa1208b);return _0x1e25ce[_0x4017('0x30')](_0x4017('0x31'),_0x44c95d+'-'+_0x4614d9+'/'+_0x57af7d)[_0x4017('0x2b')](_0x1e9a96);}return null;};}function patchUpdates(_0x560967){return function(_0x54147e){try{jsonpatch[_0x4017('0x32')](_0x54147e,_0x560967,!![]);}catch(_0x3cb5a8){return BPromise[_0x4017('0x33')](_0x3cb5a8);}return _0x54147e[_0x4017('0x34')]();};}function saveUpdates(_0x52ca4a,_0x11a623){return function(_0x6b0036){if(_0x6b0036){return _0x6b0036[_0x4017('0x35')](_0x52ca4a)[_0x4017('0x1e')](function(_0x186b32){return _0x186b32;});}return null;};}function removeEntity(_0x53abfc,_0x32bccd){return function(_0x543e22){if(_0x543e22){return _0x543e22[_0x4017('0x36')]()[_0x4017('0x1e')](function(){var _0xad9544=_0x543e22['get']({'plain':!![]});var _0x590745=_0x4017('0x37');return db[_0x4017('0x38')][_0x4017('0x36')]({'where':{'type':_0x590745,'resourceId':_0xad9544['id']}})['then'](function(){return _0x543e22;});})[_0x4017('0x1e')](function(){_0x53abfc['status'](0xcc)[_0x4017('0x2a')]();});}};}function handleEntityNotFound(_0x653679,_0x1db208){return function(_0x507609){if(!_0x507609){_0x653679[_0x4017('0x39')](0x194);}return _0x507609;};}function handleError(_0x480961,_0x2eb749){_0x2eb749=_0x2eb749||0x1f4;return function(_0x4c6576){logger[_0x4017('0x24')](_0x4c6576['stack']);if(_0x4c6576['name']){delete _0x4c6576['name'];}_0x480961[_0x4017('0x29')](_0x2eb749)['send'](_0x4c6576);};}exports[_0x4017('0x3a')]=function(_0x48047f,_0x5ea0b9){var _0xcc67b4={'include':[{'model':db['Pause'],'as':_0x4017('0x3b')}]},_0x20c119={},_0x15be75={'count':0x0,'rows':[]};var _0x5942b6=_[_0x4017('0x3c')](db[_0x4017('0x3d')][_0x4017('0x3e')],function(_0x47e075){return{'name':_0x47e075[_0x4017('0x3f')],'type':_0x47e075[_0x4017('0x40')][_0x4017('0x41')]};});_0x20c119[_0x4017('0x42')]=_[_0x4017('0x3c')](_0x5942b6,_0x4017('0x43'));_0x20c119[_0x4017('0x44')]=_[_0x4017('0x45')](_0x48047f[_0x4017('0x44')]);_0x20c119['filters']=_['intersection'](_0x20c119[_0x4017('0x42')],_0x20c119['query']);_0xcc67b4[_0x4017('0x46')]=_['intersection'](_0x20c119[_0x4017('0x42')],qs[_0x4017('0x47')](_0x48047f[_0x4017('0x44')][_0x4017('0x47')]));_0xcc67b4[_0x4017('0x46')]=_0xcc67b4[_0x4017('0x46')][_0x4017('0x48')]?_0xcc67b4[_0x4017('0x46')]:_0x20c119[_0x4017('0x42')];if(!_0x48047f[_0x4017('0x44')]['hasOwnProperty']('nolimit')){_0xcc67b4[_0x4017('0x2e')]=qs['limit'](_0x48047f[_0x4017('0x44')][_0x4017('0x2e')]);_0xcc67b4[_0x4017('0x2c')]=qs['offset'](_0x48047f[_0x4017('0x44')][_0x4017('0x2c')]);}_0xcc67b4[_0x4017('0x49')]=qs[_0x4017('0x4a')](_0x48047f['query'][_0x4017('0x4a')]);_0xcc67b4[_0x4017('0x4b')]=qs[_0x4017('0x4c')](_[_0x4017('0x4d')](_0x48047f[_0x4017('0x44')],_0x20c119[_0x4017('0x4c')]),_0x5942b6);if(_0x48047f[_0x4017('0x44')][_0x4017('0x4e')]){_0xcc67b4['where']=_['merge'](_0xcc67b4[_0x4017('0x4b')],{'$or':_[_0x4017('0x3c')](_0x5942b6,function(_0x46f616){if(_0x46f616[_0x4017('0x40')]!==_0x4017('0x4f')){var _0x140c15={};_0x140c15[_0x46f616[_0x4017('0x43')]]={'$like':'%'+_0x48047f[_0x4017('0x44')][_0x4017('0x4e')]+'%'};return _0x140c15;}})});}_0xcc67b4=_[_0x4017('0x50')]({},_0xcc67b4,_0x48047f[_0x4017('0x51')]);var _0x12e1a3={'where':_0xcc67b4[_0x4017('0x4b')]};return db[_0x4017('0x3d')][_0x4017('0x2f')](_0x12e1a3)[_0x4017('0x1e')](function(_0x34599f){_0x15be75[_0x4017('0x2f')]=_0x34599f;if(_0x48047f[_0x4017('0x44')]['includeAll']){_0xcc67b4[_0x4017('0x52')]=[{'all':!![]}];}return db[_0x4017('0x3d')][_0x4017('0x53')](_0xcc67b4);})[_0x4017('0x1e')](function(_0x575b09){_0x15be75[_0x4017('0x54')]=_0x575b09;return _0x15be75;})[_0x4017('0x1e')](respondWithFilteredResult(_0x5ea0b9,_0xcc67b4))['catch'](handleError(_0x5ea0b9,null));};exports[_0x4017('0x55')]=function(_0x2c093e,_0x391966){var _0x41765b={'raw':![],'where':{'id':_0x2c093e[_0x4017('0x56')]['id']},'include':[{'model':db[_0x4017('0x57')],'as':_0x4017('0x3b')}]},_0x4e6ea6={};_0x4e6ea6['model']=_[_0x4017('0x45')](db[_0x4017('0x3d')][_0x4017('0x3e')]);_0x4e6ea6[_0x4017('0x44')]=_[_0x4017('0x45')](_0x2c093e[_0x4017('0x44')]);_0x4e6ea6[_0x4017('0x4c')]=_[_0x4017('0x58')](_0x4e6ea6['model'],_0x4e6ea6['query']);_0x41765b[_0x4017('0x46')]=_['intersection'](_0x4e6ea6[_0x4017('0x42')],qs[_0x4017('0x47')](_0x2c093e[_0x4017('0x44')][_0x4017('0x47')]));_0x41765b['attributes']=_0x41765b[_0x4017('0x46')][_0x4017('0x48')]?_0x41765b[_0x4017('0x46')]:_0x4e6ea6[_0x4017('0x42')];if(_0x2c093e[_0x4017('0x44')][_0x4017('0x59')]){_0x41765b[_0x4017('0x52')]=[{'all':!![]}];}_0x41765b=_[_0x4017('0x50')]({},_0x41765b,_0x2c093e[_0x4017('0x51')]);return db[_0x4017('0x3d')][_0x4017('0x5a')](_0x41765b)[_0x4017('0x1e')](handleEntityNotFound(_0x391966,null))[_0x4017('0x1e')](respondWithResult(_0x391966,null))[_0x4017('0x28')](handleError(_0x391966,null));};exports[_0x4017('0x5b')]=function(_0x563410,_0x3d49c8){return db['ChatWebsite'][_0x4017('0x5b')](_0x563410[_0x4017('0x5c')],{})[_0x4017('0x1e')](function(_0x76b988){var _0xc7ebcd=_0x563410[_0x4017('0x5d')][_0x4017('0x5e')]({'plain':!![]});if(!_0xc7ebcd)throw new Error(_0x4017('0x5f'));if(_0xc7ebcd[_0x4017('0x60')]==='user'){var _0x311f74=_0x76b988[_0x4017('0x5e')]({'plain':!![]});var _0x5074a9=_0x4017('0x37');return db['UserProfileSection'][_0x4017('0x5a')]({'where':{'name':_0x5074a9,'userProfileId':_0xc7ebcd['userProfileId']},'raw':!![]})[_0x4017('0x1e')](function(_0x5793b7){if(_0x5793b7&&_0x5793b7[_0x4017('0x61')]===0x0){return db[_0x4017('0x38')][_0x4017('0x5b')]({'name':_0x311f74['name'],'resourceId':_0x311f74['id'],'type':_0x5793b7[_0x4017('0x43')],'sectionId':_0x5793b7['id']},{})['then'](function(){return _0x76b988;});}else{return _0x76b988;}})['catch'](function(_0x388268){logger[_0x4017('0x24')](_0x4017('0x62'),_0x388268);throw _0x388268;});}return _0x76b988;})['then'](respondWithResult(_0x3d49c8,0xc9))[_0x4017('0x28')](handleError(_0x3d49c8,null));};exports[_0x4017('0x35')]=function(_0x2c2e16,_0x1fe1db){if(_0x2c2e16['body']['id']){delete _0x2c2e16['body']['id'];}return db[_0x4017('0x3d')][_0x4017('0x5a')]({'where':{'id':_0x2c2e16[_0x4017('0x56')]['id']},'include':[{'model':db[_0x4017('0x57')],'as':_0x4017('0x3b')}]})[_0x4017('0x1e')](handleEntityNotFound(_0x1fe1db,null))['then'](saveUpdates(_0x2c2e16['body'],null))[_0x4017('0x1e')](respondWithResult(_0x1fe1db,null))[_0x4017('0x28')](handleError(_0x1fe1db,null));};exports['destroy']=function(_0x2d667e,_0x79eca4){return db[_0x4017('0x3d')][_0x4017('0x5a')]({'where':{'id':_0x2d667e['params']['id']}})[_0x4017('0x1e')](handleEntityNotFound(_0x79eca4,null))[_0x4017('0x1e')](removeEntity(_0x79eca4,null))[_0x4017('0x28')](handleError(_0x79eca4,null));};exports[_0x4017('0x63')]=function(_0x70db84,_0x8ad26d){return db[_0x4017('0x3d')][_0x4017('0x63')]()['then'](respondWithResult(_0x8ad26d,null))['catch'](handleError(_0x8ad26d,null));};exports[_0x4017('0x64')]=function(_0x220e08,_0x589e22,_0x550100){if(_0x220e08[_0x4017('0x5c')]['id']){delete _0x220e08[_0x4017('0x5c')]['id'];}return db[_0x4017('0x3d')][_0x4017('0x5a')]({'where':{'id':_0x220e08[_0x4017('0x56')]['id']}})[_0x4017('0x1e')](handleEntityNotFound(_0x589e22,null))[_0x4017('0x1e')](function(_0x17048b){if(_0x17048b){_0x220e08[_0x4017('0x5c')][_0x4017('0x65')]=_0x17048b['id'];return db[_0x4017('0x66')][_0x4017('0x5b')](_0x220e08[_0x4017('0x5c')]);}})[_0x4017('0x1e')](respondWithResult(_0x589e22,null))[_0x4017('0x28')](handleError(_0x589e22,null));};exports[_0x4017('0x67')]=function(_0x13e98d,_0x39d7db,_0x10c388){var _0x1aa596={'raw':![],'where':{}};var _0x5b86e6={};var _0x46b885={'count':0x0,'rows':[]};return db[_0x4017('0x3d')][_0x4017('0x68')]({'where':{'id':_0x13e98d[_0x4017('0x56')]['id']}})[_0x4017('0x1e')](handleEntityNotFound(_0x39d7db,null))[_0x4017('0x1e')](function(_0x20c880){if(_0x20c880){_0x5b86e6['model']=_[_0x4017('0x45')](db['Disposition'][_0x4017('0x3e')]);_0x5b86e6['query']=_['keys'](_0x13e98d['query']);_0x5b86e6[_0x4017('0x4c')]=_['intersection'](_0x5b86e6[_0x4017('0x42')],_0x5b86e6['query']);_0x1aa596[_0x4017('0x46')]=_[_0x4017('0x58')](_0x5b86e6[_0x4017('0x42')],qs[_0x4017('0x47')](_0x13e98d[_0x4017('0x44')][_0x4017('0x47')]));_0x1aa596[_0x4017('0x46')]=_0x1aa596[_0x4017('0x46')][_0x4017('0x48')]?_0x1aa596[_0x4017('0x46')]:_0x5b86e6[_0x4017('0x42')];if(!_0x13e98d[_0x4017('0x44')][_0x4017('0x69')]('nolimit')){_0x1aa596[_0x4017('0x2e')]=qs[_0x4017('0x2e')](_0x13e98d[_0x4017('0x44')]['limit']);_0x1aa596[_0x4017('0x2c')]=qs[_0x4017('0x2c')](_0x13e98d[_0x4017('0x44')]['offset']);}_0x1aa596[_0x4017('0x49')]=qs[_0x4017('0x4a')](_0x13e98d[_0x4017('0x44')][_0x4017('0x4a')]);_0x1aa596[_0x4017('0x4b')]=qs[_0x4017('0x4c')](_[_0x4017('0x4d')](_0x13e98d[_0x4017('0x44')],_0x5b86e6[_0x4017('0x4c')]));_0x1aa596[_0x4017('0x4b')][_0x4017('0x65')]=_0x20c880['id'];if(_0x13e98d[_0x4017('0x44')][_0x4017('0x4e')]){_0x1aa596[_0x4017('0x4b')]=_[_0x4017('0x50')](_0x1aa596[_0x4017('0x4b')],{'$or':_['map'](_0x1aa596[_0x4017('0x46')],function(_0x41b1eb){var _0xf5869d={};_0xf5869d[_0x41b1eb]={'$like':'%'+_0x13e98d['query'][_0x4017('0x4e')]+'%'};return _0xf5869d;})});}_0x1aa596=_[_0x4017('0x50')]({},_0x1aa596,_0x13e98d[_0x4017('0x51')]);return db[_0x4017('0x66')][_0x4017('0x2f')]({'where':_0x1aa596[_0x4017('0x4b')]})[_0x4017('0x1e')](function(_0x56acc9){_0x46b885['count']=_0x56acc9;if(_0x13e98d[_0x4017('0x44')][_0x4017('0x59')]){_0x1aa596[_0x4017('0x52')]=[{'all':!![]}];}return db[_0x4017('0x66')][_0x4017('0x53')](_0x1aa596);})['then'](function(_0x7e4365){_0x46b885[_0x4017('0x54')]=_0x7e4365;return _0x46b885;});}})['then'](respondWithFilteredResult(_0x39d7db,_0x1aa596))[_0x4017('0x28')](handleError(_0x39d7db,null));};exports['removeDispositions']=function(_0x3542bc,_0x27503a,_0x2a2c43){return db[_0x4017('0x3d')]['find']({'where':{'id':_0x3542bc['params']['id']}})['then'](handleEntityNotFound(_0x27503a,null))[_0x4017('0x1e')](function(_0x4a2fd2){if(_0x4a2fd2){return _0x4a2fd2[_0x4017('0x6a')](_0x3542bc[_0x4017('0x44')][_0x4017('0x6b')]);}})[_0x4017('0x1e')](respondWithStatusCode(_0x27503a,null))['catch'](handleError(_0x27503a,null));};exports[_0x4017('0x6c')]=function(_0x13de50,_0x109d94,_0x6d3105){if(_0x13de50['body']['id']){delete _0x13de50['body']['id'];}return db[_0x4017('0x3d')][_0x4017('0x5a')]({'where':{'id':_0x13de50[_0x4017('0x56')]['id']}})[_0x4017('0x1e')](handleEntityNotFound(_0x109d94,null))['then'](function(_0x42b9b5){if(_0x42b9b5){_0x13de50[_0x4017('0x5c')][_0x4017('0x65')]=_0x42b9b5['id'];return db[_0x4017('0x6d')][_0x4017('0x5b')](_0x13de50[_0x4017('0x5c')]);}})[_0x4017('0x1e')](respondWithResult(_0x109d94,null))[_0x4017('0x28')](handleError(_0x109d94,null));};exports[_0x4017('0x6e')]=function(_0x469b9b,_0x2d1804,_0x41c19e){var _0x26f3ce={'raw':![],'where':{}};var _0x88d61={};var _0x14c235={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x469b9b['params']['id']}})[_0x4017('0x1e')](handleEntityNotFound(_0x2d1804,null))[_0x4017('0x1e')](function(_0x1a7b92){if(_0x1a7b92){_0x88d61[_0x4017('0x42')]=_[_0x4017('0x45')](db[_0x4017('0x6d')][_0x4017('0x3e')]);_0x88d61[_0x4017('0x44')]=_[_0x4017('0x45')](_0x469b9b[_0x4017('0x44')]);_0x88d61[_0x4017('0x4c')]=_[_0x4017('0x58')](_0x88d61['model'],_0x88d61['query']);_0x26f3ce[_0x4017('0x46')]=_[_0x4017('0x58')](_0x88d61['model'],qs[_0x4017('0x47')](_0x469b9b[_0x4017('0x44')][_0x4017('0x47')]));_0x26f3ce['attributes']=_0x26f3ce[_0x4017('0x46')][_0x4017('0x48')]?_0x26f3ce[_0x4017('0x46')]:_0x88d61[_0x4017('0x42')];if(!_0x469b9b[_0x4017('0x44')][_0x4017('0x69')](_0x4017('0x6f'))){_0x26f3ce['limit']=qs['limit'](_0x469b9b[_0x4017('0x44')][_0x4017('0x2e')]);_0x26f3ce[_0x4017('0x2c')]=qs[_0x4017('0x2c')](_0x469b9b[_0x4017('0x44')][_0x4017('0x2c')]);}_0x26f3ce['order']=qs[_0x4017('0x4a')](_0x469b9b['query'][_0x4017('0x4a')]);_0x26f3ce[_0x4017('0x4b')]=qs[_0x4017('0x4c')](_[_0x4017('0x4d')](_0x469b9b['query'],_0x88d61[_0x4017('0x4c')]));_0x26f3ce[_0x4017('0x4b')][_0x4017('0x65')]=_0x1a7b92['id'];if(_0x469b9b[_0x4017('0x44')][_0x4017('0x4e')]){_0x26f3ce[_0x4017('0x4b')]=_['merge'](_0x26f3ce[_0x4017('0x4b')],{'$or':_[_0x4017('0x3c')](_0x26f3ce[_0x4017('0x46')],function(_0x220351){var _0x5befb4={};_0x5befb4[_0x220351]={'$like':'%'+_0x469b9b[_0x4017('0x44')][_0x4017('0x4e')]+'%'};return _0x5befb4;})});}_0x26f3ce=_[_0x4017('0x50')]({},_0x26f3ce,_0x469b9b[_0x4017('0x51')]);return db[_0x4017('0x6d')][_0x4017('0x2f')]({'where':_0x26f3ce[_0x4017('0x4b')]})['then'](function(_0x464780){_0x14c235['count']=_0x464780;if(_0x469b9b[_0x4017('0x44')][_0x4017('0x59')]){_0x26f3ce[_0x4017('0x52')]=[{'all':!![]}];}return db[_0x4017('0x6d')][_0x4017('0x53')](_0x26f3ce);})[_0x4017('0x1e')](function(_0x46097d){_0x14c235[_0x4017('0x54')]=_0x46097d;return _0x14c235;});}})[_0x4017('0x1e')](respondWithFilteredResult(_0x2d1804,_0x26f3ce))['catch'](handleError(_0x2d1804,null));};exports[_0x4017('0x70')]=function(_0x219798,_0xec1ad,_0x2eb822){return db[_0x4017('0x3d')][_0x4017('0x5a')]({'where':{'id':_0x219798[_0x4017('0x56')]['id']}})[_0x4017('0x1e')](handleEntityNotFound(_0xec1ad,null))[_0x4017('0x1e')](function(_0x38f33d){if(_0x38f33d){return _0x38f33d[_0x4017('0x70')](_0x219798[_0x4017('0x44')][_0x4017('0x6b')]);}})[_0x4017('0x1e')](respondWithStatusCode(_0xec1ad,null))[_0x4017('0x28')](handleError(_0xec1ad,null));};exports[_0x4017('0x71')]=function(_0x3cee77,_0x25f420,_0x226af7){_0x3cee77[_0x4017('0x5c')][_0x4017('0x72')]=_0x3cee77['file']['filename'];return db['ChatWebsite'][_0x4017('0x5a')]({'where':{'id':_0x3cee77[_0x4017('0x56')]['id']}})[_0x4017('0x1e')](handleEntityNotFound(_0x25f420,null))[_0x4017('0x1e')](saveUpdates(_0x3cee77[_0x4017('0x5c')],null))[_0x4017('0x1e')](respondWithResult(_0x25f420,null))[_0x4017('0x28')](handleError(_0x25f420,null));};exports[_0x4017('0x73')]=function(_0x51924f,_0x451be0,_0x475bc2){_0x51924f[_0x4017('0x5c')]['agentAvatar']=_0x51924f[_0x4017('0x74')][_0x4017('0x75')];return db[_0x4017('0x3d')][_0x4017('0x5a')]({'where':{'id':_0x51924f[_0x4017('0x56')]['id']}})[_0x4017('0x1e')](handleEntityNotFound(_0x451be0,null))[_0x4017('0x1e')](saveUpdates(_0x51924f[_0x4017('0x5c')],null))['then'](respondWithResult(_0x451be0,null))[_0x4017('0x28')](handleError(_0x451be0,null));};exports[_0x4017('0x76')]=function(_0x2fc1f8,_0x2b384c,_0xcd0ff4){_0x2fc1f8['body'][_0x4017('0x77')]=_0x2fc1f8[_0x4017('0x74')][_0x4017('0x75')];return db[_0x4017('0x3d')]['find']({'where':{'id':_0x2fc1f8[_0x4017('0x56')]['id']}})['then'](handleEntityNotFound(_0x2b384c,null))[_0x4017('0x1e')](saveUpdates(_0x2fc1f8['body'],null))['then'](respondWithResult(_0x2b384c,null))[_0x4017('0x28')](handleError(_0x2b384c,null));};exports[_0x4017('0x78')]=function(_0x6ce0c9,_0xf4946c,_0x4a817a){_0x6ce0c9[_0x4017('0x5c')][_0x4017('0x79')]=_0x6ce0c9['file'][_0x4017('0x75')];return db['ChatWebsite'][_0x4017('0x5a')]({'where':{'id':_0x6ce0c9[_0x4017('0x56')]['id']}})['then'](handleEntityNotFound(_0xf4946c,null))['then'](saveUpdates(_0x6ce0c9[_0x4017('0x5c')],null))[_0x4017('0x1e')](respondWithResult(_0xf4946c,null))[_0x4017('0x28')](handleError(_0xf4946c,null));};exports[_0x4017('0x7a')]=function(_0x1c306e,_0x4ad95c,_0x36c0cc){var _0x3fec62=path[_0x4017('0x7b')](config['root'],_0x4017('0x7c'));var _0x9eec09={'where':{'id':_0x1c306e['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x2611c6=![];return require(_0x4017('0x7d'))[_0x4017('0x7e')]()[_0x4017('0x1e')](function(_0x5d8602){if(_0x5d8602){_0x2611c6=_0x5d8602[_0x4017('0x7f')];}})[_0x4017('0x1e')](function(){return db[_0x4017('0x3d')][_0x4017('0x5a')](_0x9eec09);})[_0x4017('0x1e')](handleEntityNotFound(_0x4ad95c,null))['then'](function(_0x265584){if(_0x265584){if(!_[_0x4017('0x80')](_0x265584['sitepic'])){if(fs[_0x4017('0x81')](path['join'](config[_0x4017('0x82')],_0x4017('0x83'),_0x265584['sitepic']))&&_0x2611c6){_0x3fec62=path[_0x4017('0x7b')](config['root'],_0x4017('0x83'),_0x265584['sitepic']);}}return _0x4ad95c[_0x4017('0x84')](_0x3fec62);}})[_0x4017('0x28')](handleError(_0x4ad95c,null));};exports[_0x4017('0x85')]=function(_0x5a91eb,_0x22aea0,_0x40de49){var _0x2a7b61=path[_0x4017('0x7b')](config[_0x4017('0x82')],'server/files/images/avatars/default_avatar.png');var _0x5e9d06={'where':{'id':_0x5a91eb[_0x4017('0x56')]['id']},'attributes':['id',_0x4017('0x86')],'raw':!![]};return db[_0x4017('0x3d')]['find'](_0x5e9d06)['then'](handleEntityNotFound(_0x22aea0,null))[_0x4017('0x1e')](function(_0x2709bd){if(_0x2709bd){if(!_[_0x4017('0x80')](_0x2709bd[_0x4017('0x86')])){if(fs[_0x4017('0x81')](path[_0x4017('0x7b')](config[_0x4017('0x82')],_0x4017('0x87'),_0x2709bd[_0x4017('0x86')]))){_0x2a7b61=path[_0x4017('0x7b')](config[_0x4017('0x82')],_0x4017('0x87'),_0x2709bd[_0x4017('0x86')]);}}return _0x22aea0[_0x4017('0x84')](_0x2a7b61);}})[_0x4017('0x28')](handleError(_0x22aea0,null));};exports[_0x4017('0x88')]=function(_0x3f73d0,_0x5e2448,_0x2b0cd3){var _0x2b592c=path[_0x4017('0x7b')](config['root'],_0x4017('0x89'));var _0x2a08b3={'where':{'id':_0x3f73d0['params']['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x4017('0x3d')][_0x4017('0x5a')](_0x2a08b3)[_0x4017('0x1e')](handleEntityNotFound(_0x5e2448,null))[_0x4017('0x1e')](function(_0x4ec81a){if(_0x4ec81a){if(!_['isNil'](_0x4ec81a['customerAvatar'])){if(fs[_0x4017('0x81')](path[_0x4017('0x7b')](config[_0x4017('0x82')],'server/files/images/avatars/',_0x4ec81a[_0x4017('0x77')]))&&_0x4ec81a[_0x4017('0x8a')]){_0x2b592c=path[_0x4017('0x7b')](config['root'],'server/files/images/avatars/',_0x4ec81a[_0x4017('0x77')]);}}return _0x5e2448[_0x4017('0x84')](_0x2b592c);}})[_0x4017('0x28')](handleError(_0x5e2448,null));};exports['getSystemAvatar']=function(_0xb74bcb,_0x2f061a,_0x12a0ff){var _0x5c0d38=path['join'](config[_0x4017('0x82')],_0x4017('0x8b'));var _0x31e1ef={'where':{'id':_0xb74bcb[_0x4017('0x56')]['id']},'attributes':['id',_0x4017('0x79')],'raw':!![]};return db['ChatWebsite'][_0x4017('0x5a')](_0x31e1ef)[_0x4017('0x1e')](handleEntityNotFound(_0x2f061a,null))[_0x4017('0x1e')](function(_0xb1626f){if(_0xb1626f){if(!_[_0x4017('0x80')](_0xb1626f[_0x4017('0x79')])){if(fs[_0x4017('0x81')](path[_0x4017('0x7b')](config['root'],_0x4017('0x87'),_0xb1626f[_0x4017('0x79')]))){_0x5c0d38=path['join'](config['root'],_0x4017('0x87'),_0xb1626f[_0x4017('0x79')]);}}return _0x2f061a['download'](_0x5c0d38);}})['catch'](handleError(_0x2f061a,null));};exports[_0x4017('0x8c')]=function(_0x489794,_0x57e569,_0xe20e79){var _0x50001d=require(_0x4017('0x8d'));var _0xae355e=new _0x50001d();var _0x33da94=_0xae355e[_0x4017('0x8e')](_0x489794[_0x4017('0x8f')][_0x4017('0x90')])[_0x4017('0x91')]();var _0x2e5675={'body':_0x489794[_0x4017('0x5c')],'channel':_0x4017('0x92')};var _0x5a6d44=[];var _0x41ec75=[];var _0x216ad5={};var _0x244a7b=![];return db[_0x4017('0x93')]['describe']()[_0x4017('0x1e')](function(_0x2f11c3){if(!_0x2f11c3){throw new db[(_0x4017('0x94'))][(_0x4017('0x95'))](_0x4017('0x96'));}_0x5a6d44=_['difference'](_[_0x4017('0x45')](_0x2f11c3),[_0x4017('0x97'),_0x4017('0x98')]);_0x41ec75=_[_0x4017('0x99')](_['keys'](_0x2f11c3),[_0x4017('0x97'),_0x4017('0x98'),_0x4017('0x9a'),_0x4017('0x9b')]);if(_0x489794['body']['id']){delete _0x489794['body']['id'];}if(_[_0x4017('0x80')](_0x489794[_0x4017('0x5c')][_0x4017('0x9c')])){throw new db['Sequelize'][(_0x4017('0x95'))](_0x4017('0x9d'));}if(_[_0x4017('0x80')](_0x489794[_0x4017('0x5c')][_0x4017('0x5c')])||_0x489794[_0x4017('0x5c')][_0x4017('0x5c')]===''){throw new db[(_0x4017('0x94'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4017('0x80')](_0x489794[_0x4017('0x5c')][_0x4017('0x9e')])){throw new db[(_0x4017('0x94'))][(_0x4017('0x95'))](_0x4017('0x9f')+_0x41ec75);}if(!_['includes'](_0x41ec75,_0x489794[_0x4017('0x5c')][_0x4017('0x9e')])){throw new db[(_0x4017('0x94'))][(_0x4017('0x95'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x41ec75);}_0x216ad5[_0x489794[_0x4017('0x5c')]['mapKey']]=_0x489794['body'][_0x4017('0x9c')];})[_0x4017('0x1e')](function(){return db['ChatWebsite'][_0x4017('0x5a')]({'where':{'id':_0x489794['params']['id']},'include':[{'model':db['CmList'],'as':_0x4017('0xa0'),'include':[{'model':db[_0x4017('0x93')],'as':_0x4017('0xa1'),'where':_0x216ad5,'limit':0x1,'order':[[_0x4017('0x98'),_0x4017('0xa2')]]}]},{'model':db[_0x4017('0xa3')],'as':_0x4017('0xa4')}]});})[_0x4017('0x1e')](handleEntityNotFound(_0x57e569,null))['then'](function(_0x22f789){if(_0x22f789&&_0x22f789[_0x4017('0xa0')]){_0x2e5675['account']=_0x22f789;_0x2e5675[_0x4017('0xa5')]=_0x22f789[_0x4017('0xa4')];_0x2e5675['list']=_0x22f789[_0x4017('0xa0')];_0x2e5675[_0x4017('0xa5')]=_['orderBy'](_0x2e5675[_0x4017('0xa5')],[_0x4017('0xa6')],[_0x4017('0xa7')]);if(_0x2e5675[_0x4017('0xa8')][_0x4017('0xa4')]){delete _0x2e5675[_0x4017('0xa8')][_0x4017('0xa4')];}if(_0x2e5675['account'][_0x4017('0xa0')]&&_0x2e5675[_0x4017('0xa8')]['List'][_0x4017('0xa1')][_0x4017('0x48')]){return _0x2e5675[_0x4017('0xa8')]['List'][_0x4017('0xa1')][0x0];}var _0x772bb3=_[_0x4017('0x18')](_0x489794[_0x4017('0x5c')],{'firstName':_0x489794[_0x4017('0x5c')]['from'],'ListId':_0x22f789[_0x4017('0x9b')]});_0x772bb3[_0x489794[_0x4017('0x5c')][_0x4017('0x9e')]]=_0x489794[_0x4017('0x5c')][_0x4017('0x9c')];return db[_0x4017('0x93')]['create'](_0x772bb3,{'fields':_0x5a6d44,'raw':!![]});}})[_0x4017('0x1e')](handleEntityNotFound(_0x57e569,null))[_0x4017('0x1e')](function(_0x3075dc){_0x2e5675[_0x4017('0xa9')]=_0x3075dc;var _0x544e58=_0x489794[_0x4017('0x5c')]['customerIp'];if(_0x489794[_0x4017('0x8f')][_0x4017('0xaa')]){_0x544e58=_0x489794['headers'][_0x4017('0xaa')];}else if(_0x489794[_0x4017('0x8f')][_0x4017('0xab')]){_0x544e58=_[_0x4017('0xac')](_0x489794[_0x4017('0x8f')][_0x4017('0xab')][_0x4017('0xad')](','));}if(_0x3075dc){var _0x524827={'ContactId':_0x3075dc['id'],'ChatWebsiteId':_0x489794[_0x4017('0x56')]['id'],'from':(_0x3075dc[_0x4017('0xae')]||'')+'\x20'+(_0x3075dc[_0x4017('0xaf')]||''),'customerIp':_0x544e58,'customerPort':_0x489794['headers']['x-real-port']?_0x489794[_0x4017('0x8f')][_0x4017('0xb0')]:null,'referer':_0x489794[_0x4017('0x5c')]['referer'],'browserName':_0x33da94['browser'][_0x4017('0x43')]&&_0x33da94[_0x4017('0xb1')]['version']?util[_0x4017('0xb2')](_0x4017('0xb3'),_0x33da94[_0x4017('0xb1')][_0x4017('0x43')],_0x33da94[_0x4017('0xb1')][_0x4017('0xb4')]):_0x4017('0xb5'),'browserVersion':_0x33da94[_0x4017('0xb1')][_0x4017('0xb4')]||_0x4017('0xb5'),'osName':util['format'](_0x4017('0xb3'),_0x33da94['os'][_0x4017('0x43')],_0x33da94['os'][_0x4017('0xb4')]),'osVersion':_0x33da94['os'][_0x4017('0xb4')],'deviceModel':_0x33da94[_0x4017('0xb6')][_0x4017('0x42')]&&_0x33da94['device'][_0x4017('0xb7')]?util[_0x4017('0xb2')]('%s\x20%s\x20%s',_0x33da94[_0x4017('0xb6')][_0x4017('0x42')],_0x33da94[_0x4017('0xb6')][_0x4017('0xb7')],_0x33da94[_0x4017('0xb6')][_0x4017('0x40')]):null,'deviceVendor':_0x33da94[_0x4017('0xb6')]['vendor'],'deviceType':_0x33da94[_0x4017('0xb6')][_0x4017('0x40')],'formData':JSON['stringify'](_0x489794[_0x4017('0x5c')])};var _0x3578d4={'ChatWebsiteId':_0x489794[_0x4017('0x56')]['id'],'closed':![]};if(_0x489794[_0x4017('0x5c')][_0x4017('0xb8')]){_0x3578d4[_0x4017('0xb8')]=_0x489794[_0x4017('0x5c')][_0x4017('0xb8')];return db[_0x4017('0xb9')][_0x4017('0x5a')]({'where':_0x3578d4})[_0x4017('0x1e')](function(_0x3bf5ef){if(_0x3bf5ef){return[_0x3bf5ef,![]];}_0x524827['threadId']=_0x489794[_0x4017('0x5c')][_0x4017('0xb8')];_0x524827[_0x4017('0xba')]=_0x489794[_0x4017('0x5c')]['externalUrl'];return db['ChatInteraction'][_0x4017('0x5b')](_0x524827)[_0x4017('0x1e')](function(_0x53fbfb){return[_0x53fbfb,!![]];});});}_0x3578d4[_0x4017('0xbb')]=_0x3075dc['id'];if(_0x489794['body'][_0x4017('0xbc')]&&_0x489794[_0x4017('0x5c')][_0x4017('0xbc')]['id']){_0x3578d4['id']=_0x489794[_0x4017('0x5c')][_0x4017('0xbc')]['id'];return db['ChatInteraction'][_0x4017('0x5a')]({'where':_0x3578d4})[_0x4017('0x1e')](function(_0x10c76a){if(_0x10c76a){return[_0x10c76a,![]];}return db['ChatInteraction']['create'](_0x524827)['then'](function(_0x1d2a84){return[_0x1d2a84,!![]];});});}return db[_0x4017('0xb9')][_0x4017('0x5b')](_0x524827)[_0x4017('0x1e')](function(_0x1a8e4d){return[_0x1a8e4d,!![]];});}})['spread'](function(_0x4adba4,_0x3fb1d6){if(_0x4adba4){_0x244a7b=_0x3fb1d6;if(!_0x3fb1d6){var _0x1a58f1={'from':(_0x2e5675[_0x4017('0xa9')][_0x4017('0xae')]||'')+'\x20'+(_0x2e5675[_0x4017('0xa9')]['lastName']||'')};if(_0x489794[_0x4017('0x5c')][_0x4017('0xb8')]&&_0x489794[_0x4017('0x5c')]['messageId']&&_0x489794[_0x4017('0x5c')][_0x4017('0xb8')]!=_0x489794['body'][_0x4017('0xbd')]){_0x1a58f1[_0x4017('0xb8')]=_0x489794[_0x4017('0x5c')][_0x4017('0xbd')];}return _0x4adba4[_0x4017('0x35')](_0x1a58f1);}else{return _0x4adba4;}}})['then'](function(_0x2d8afe){_0x2e5675[_0x4017('0xbc')]=_0x2d8afe[_0x4017('0x5e')]({'plain':!![]});_0x2e5675[_0x4017('0xbc')][_0x4017('0xbe')]=_0x244a7b;if(_0x2e5675[_0x4017('0xbc')][_0x4017('0xbe')]){if(_0x2e5675['account'][_0x4017('0xbf')]){_0x2e5675[_0x4017('0xa5')][_0x4017('0xc0')]({'id':0x0,'priority':_0x2e5675['applications'][_0x4017('0x48')]+0x1,'app':_0x4017('0xc1'),'appdata':'unmanaged','interval':_0x4017('0xc2')});}}return db[_0x4017('0xc3')][_0x4017('0x5b')]({'body':_0x489794[_0x4017('0x5c')][_0x4017('0x5c')],'ChatWebsiteId':_0x489794[_0x4017('0x56')]['id'],'ChatInteractionId':_0x2d8afe['id'],'direction':'in','ContactId':_0x2e5675[_0x4017('0xa9')]['id'],'AttachmentId':_0x489794[_0x4017('0x5c')][_0x4017('0xc4')]});})[_0x4017('0x1e')](function(_0x3af2fd){_0x2e5675[_0x4017('0x26')]=_0x3af2fd;if(_0x2e5675[_0x4017('0xbc')]['UserId']){return db[_0x4017('0xc5')][_0x4017('0x5a')]({'attributes':['id',_0x4017('0x43')],'where':{'id':_0x2e5675[_0x4017('0xbc')]['UserId']}})[_0x4017('0x1e')](function(_0x5abad0){if(_0x5abad0){_0x2e5675[_0x4017('0xa5')][_0x4017('0xc6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5abad0[_0x4017('0x43')]+','+(_0x2e5675['account'][_0x4017('0xc7')]||0xa),'interval':_0x4017('0xc2')});_0x2e5675[_0x4017('0xc8')]=!![];}return respondWithRpcPromise(_0x4017('0xc9'),_0x4017('0xca'),_0x2e5675);});}return respondWithRpcPromise(_0x4017('0xc9'),_0x4017('0xca'),_0x2e5675);})['then'](function(_0x1118a2){respondWithRpcPromise(_0x4017('0xcb'),_0x4017('0xcb'),{'event':'notify','message':_0x1118a2},client9002);return _0x1118a2;})[_0x4017('0x1e')](respondWithResult(_0x57e569,null))[_0x4017('0x28')](handleError(_0x57e569,null));};exports['offline']=function(_0x2cf7d9,_0x28d881,_0x40d435){var _0x2221c5,_0x3d6e13,_0x244fff;var _0x21d794=[];var _0x414893=[];var _0x511c84={};var _0xbff152=_0x2cf7d9['files']||[];var _0xec5a3d=[];var _0x5b9ff5;return db[_0x4017('0x93')][_0x4017('0x63')]()[_0x4017('0x1e')](function(_0x32e12f){if(!_0x32e12f){throw new db[(_0x4017('0x94'))][(_0x4017('0x95'))](_0x4017('0x96'));}_0x414893=_['difference'](_[_0x4017('0x45')](_0x32e12f),[_0x4017('0x97'),'updatedAt']);_0x21d794=_[_0x4017('0x99')](_[_0x4017('0x45')](_0x32e12f),[_0x4017('0x97'),_0x4017('0x98'),_0x4017('0x9a'),_0x4017('0x9b')]);if(_0x2cf7d9[_0x4017('0x5c')]['id']){delete _0x2cf7d9['body']['id'];}if(_[_0x4017('0x80')](_0x2cf7d9[_0x4017('0x5c')]['from'])){throw _0x28d881['status'](0x1f4)[_0x4017('0xcc')](new db[(_0x4017('0x94'))][(_0x4017('0x95'))](_0x4017('0x9d')));}if(_['isNil'](_0x2cf7d9[_0x4017('0x5c')][_0x4017('0x5c')])||_0x2cf7d9[_0x4017('0x5c')]['body']===''){throw _0x28d881[_0x4017('0x29')](0x1f4)[_0x4017('0xcc')](new db[(_0x4017('0x94'))][(_0x4017('0x95'))](_0x4017('0xcd')));}if(_[_0x4017('0x80')](_0x2cf7d9[_0x4017('0x5c')][_0x4017('0xce')])){throw _0x28d881[_0x4017('0x29')](0x1f4)[_0x4017('0xcc')](new db['Sequelize'][(_0x4017('0x95'))](_0x4017('0xcf')+_0x21d794));}if(!_['includes'](_0x21d794,_0x2cf7d9[_0x4017('0x5c')][_0x4017('0xce')])){throw _0x28d881[_0x4017('0x29')](0x1f4)[_0x4017('0xcc')](new db[(_0x4017('0x94'))][(_0x4017('0x95'))](_0x4017('0xd0')+_0x21d794));}_0x511c84[_0x2cf7d9[_0x4017('0x5c')][_0x4017('0xce')]]=_0x2cf7d9[_0x4017('0x5c')]['from'];})[_0x4017('0x1e')](function(){return db[_0x4017('0x3d')][_0x4017('0x5a')]({'where':{'id':_0x2cf7d9[_0x4017('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x4017('0xd1')],'as':_0x4017('0xd1')}]});})[_0x4017('0x1e')](handleEntityNotFound(_0x28d881,null))[_0x4017('0x1e')](function(_0xf04ab8){if(_0xf04ab8&&_0xf04ab8[_0x4017('0xa0')]){_0x3d6e13=_0xf04ab8;var _0x1493fb=_[_0x4017('0x18')](_0x2cf7d9[_0x4017('0x5c')],{'firstName':_0x2cf7d9[_0x4017('0x5c')][_0x4017('0x9c')],'phone':_0x2cf7d9['body']['from'],'ListId':_0xf04ab8[_0x4017('0x9b')]});_0x1493fb[_0x2cf7d9[_0x4017('0x5c')][_0x4017('0xce')]]=_0x2cf7d9['body']['from'];return db[_0x4017('0x93')][_0x4017('0xd2')]({'where':_0x511c84,'defaults':_0x1493fb});}})[_0x4017('0xd3')](function(_0xc77bc2){if(_0xc77bc2){_0x244fff=_0xc77bc2;var _0x47eaa2=fs[_0x4017('0xd4')](path[_0x4017('0x7b')](config[_0x4017('0x82')],_0x4017('0xd5')),_0x4017('0xd6'));var _0x1cab5e=ejs[_0x4017('0xd7')](_0x47eaa2,{'body':_[_0x4017('0xd8')](_0x2cf7d9[_0x4017('0x5c')][_0x4017('0x5c')]),'bodyTitle':_0x3d6e13[_0x4017('0xd9')]});return db['ChatOfflineMessage']['create']({'body':_0x1cab5e,'ContactId':_0xc77bc2['id'],'ChatWebsiteId':_0x3d6e13['id']});}})[_0x4017('0x1e')](function(_0x1d93a3){_0x5b9ff5=_0x1d93a3;if(_0xbff152[_0x4017('0x48')]){var _0x288b0b=_0xbff152[_0x4017('0x3c')](function(_0x24c60f){return{'name':_0x24c60f[_0x4017('0xda')],'basename':_0x24c60f[_0x4017('0x75')],'type':_0x24c60f[_0x4017('0xdb')],'ChatOfflineMessageId':_0x1d93a3['id']};});_0xec5a3d=_0x288b0b[_0x4017('0x3c')](_0x39a3e0=>{var _0x3a4a7e={'filename':_0x39a3e0[_0x4017('0x43')],'path':path[_0x4017('0x7b')](config[_0x4017('0x82')],_0x4017('0xdc'),_0x4017('0xdd'),_0x4017('0xde'),_0x4017('0xdf'),_0x39a3e0['basename'])};return _0x3a4a7e;});if(!_0x3d6e13[_0x4017('0xe0')]){return db[_0x4017('0xe1')][_0x4017('0xe2')](function(_0x59b7f5){return db[_0x4017('0xe3')][_0x4017('0xe4')](_0x288b0b,{'transaction':_0x59b7f5});});}}})[_0x4017('0x1e')](function(){if(_0x5b9ff5){_0x2221c5=_0x5b9ff5;return db['MailAccount'][_0x4017('0x68')]({'where':{'active':!![]},'include':[{'model':db[_0x4017('0xe5')],'as':_0x4017('0xe6'),'raw':!![]}]});}})[_0x4017('0x1e')](function(_0x5e78e7){if(_0x5e78e7&&_0x5e78e7[_0x4017('0xe6')]&&_0x3d6e13[_0x4017('0xe7')]&&_0x3d6e13['forwardOfflineAddress']){var _0x3b5e3e={'tls':{'rejectUnauthorized':![]}};if(_0x5e78e7[_0x4017('0xe6')]['service']){_0x3b5e3e[_0x4017('0xe8')]=_0x5e78e7[_0x4017('0xe6')][_0x4017('0xe8')];}else{_0x3b5e3e[_0x4017('0xe9')]=_0x5e78e7[_0x4017('0xe6')][_0x4017('0xe9')];_0x3b5e3e[_0x4017('0xea')]=_0x5e78e7[_0x4017('0xe6')]['port'];_0x3b5e3e[_0x4017('0xeb')]=_0x5e78e7[_0x4017('0xe6')][_0x4017('0xeb')];}if(_0x5e78e7[_0x4017('0xe6')]['authentication']){_0x3b5e3e[_0x4017('0xec')]={'user':_0x5e78e7[_0x4017('0xe6')][_0x4017('0x5d')],'pass':_0x5e78e7[_0x4017('0xe6')][_0x4017('0xed')]};}return respondWithRpcPromise(_0x4017('0xee'),_0x4017('0xef'),{'account':_0x3b5e3e,'message':{'from':util['format'](_0x4017('0xf0'),_0x5e78e7[_0x4017('0x43')],_0x5e78e7[_0x4017('0xf1')]||_0x5e78e7['Smtp'][_0x4017('0x5d')]),'to':_0x3d6e13[_0x4017('0xf2')],'subject':_0x3d6e13['offlineMessageSubject'],'html':_0x2221c5['body'],'attachments':_0xec5a3d}},client9003)[_0x4017('0x1e')](function(){return _0x2221c5;})[_0x4017('0x28')](function(_0xcd2f9a){console[_0x4017('0x24')](_0xcd2f9a);});}})[_0x4017('0x1e')](function(){if(_0x3d6e13&&_0x3d6e13[_0x4017('0xe0')]&&_0x3d6e13[_0x4017('0xf3')]){var _0x3322f6=[];if(_0xbff152[_0x4017('0x48')]){_0x3322f6=_0xbff152[_0x4017('0x3c')](function(_0x1a492e){return{'name':_0x1a492e[_0x4017('0xda')],'basename':_0x1a492e[_0x4017('0x75')],'type':_0x1a492e[_0x4017('0xdb')],'ChatOfflineMessageId':_0x5b9ff5['id']};});}var _0x5ed7df;if(!_[_0x4017('0x80')](_0x3d6e13['subjectOffline'])){var _0x5307b2=_[_0x4017('0x3c')](_0x2cf7d9[_0x4017('0x5c')],function(_0x140d1c){return _0x140d1c;});var _0x27ca2b=_['toPairsIn'](_0x5307b2)[0x0];var _0x429cba=_['mapValues'](_0x27ca2b,function(_0xad1668){return _0xad1668;});_0x5ed7df=_0x429cba[0x1][_0x3d6e13[_0x4017('0xf4')]];}var _0x2232d2={'from':_0x244fff[_0x4017('0xf1')],'firstName':_0x244fff['firstName'],'lastName':_0x244fff['lastName'],'mapKey':'email','message':{'from':_0x244fff[_0x4017('0xf1')],'to':_0x3d6e13[_0x4017('0xd1')]['email'],'cc':'','subject':_[_0x4017('0x80')](_0x5ed7df)?_0x3d6e13[_0x4017('0xf5')]:_0x5ed7df,'messageId':'','sentAt':new Date(),'attach':_0x3322f6['length'],'attachments':_0x3322f6,'originChannel':_0x4017('0xf6'),'ChatWebsiteId':_0x3d6e13['id'],'ChatOfflineMessageId':_0x2221c5['id'],'originTo':_0x3d6e13[_0x4017('0xd1')][_0x4017('0xf1')]},'body':_0x2221c5['body']};var _0x5a5eec={'account':{'id':_0x3d6e13[_0x4017('0xf3')]},'body':_0x2232d2,'log':_0x4017('0xf7')};return respondWithRpcPromise(_0x4017('0xf7'),_0x4017('0xf8'),_0x5a5eec,client9001)[_0x4017('0x1e')](function(){return _0x2221c5;})[_0x4017('0x28')](function(_0x1ad36e){console['error'](_0x1ad36e);});}return;})[_0x4017('0x1e')](function(){if(_0x2221c5){return _0x2221c5;}})['then'](respondWithResult(_0x28d881,null))[_0x4017('0x28')](function(_0x15c8a0){console[_0x4017('0x24')](_0x4017('0x28'),_0x15c8a0);for(var _0x5a4e70 of _0xbff152){var _0x2354c7=path[_0x4017('0x7b')](config[_0x4017('0x82')],_0x4017('0xdc'),_0x4017('0xdd'),_0x4017('0xde'),'offline-chat',_0x5a4e70[_0x4017('0x75')]);fs_extra[_0x4017('0xf9')](_0x2354c7)[_0x4017('0x28')](function(_0x262edb){console[_0x4017('0x24')](_0x4017('0xfa'),_0x2354c7,_0x262edb);});}});};exports[_0x4017('0xfb')]=function(_0x52cbda,_0x2a00e1,_0x540282){return db[_0x4017('0xb9')]['find']({'where':{'id':_0x52cbda[_0x4017('0x56')]['id']}})[_0x4017('0x1e')](handleEntityNotFound(_0x2a00e1,null))[_0x4017('0x1e')](function(_0x380e37){if(_0x380e37){return _0x380e37['addInteraction'](_0x52cbda[_0x4017('0x5c')][_0x4017('0x6b')],_['omit'](_0x52cbda[_0x4017('0x5c')],[_0x4017('0x6b'),'id'])||{});}})[_0x4017('0x1e')](respondWithResult(_0x2a00e1,null))['catch'](handleError(_0x2a00e1,null));};exports['getInteractions']=function(_0x409637,_0x3e2eda,_0xf0d78b){var _0x14a861={'raw':![],'where':{}};var _0x402f6f={};var _0x5209e8={'count':0x0,'rows':[]};return db[_0x4017('0x3d')]['findOne']({'where':{'id':_0x409637[_0x4017('0x56')]['id']}})[_0x4017('0x1e')](handleEntityNotFound(_0x3e2eda,null))[_0x4017('0x1e')](function(_0x41488a){if(_0x41488a){_0x402f6f[_0x4017('0x42')]=_['keys'](db['ChatInteraction'][_0x4017('0x3e')]);_0x402f6f[_0x4017('0x44')]=_[_0x4017('0x45')](_0x409637['query']);_0x402f6f[_0x4017('0x4c')]=_[_0x4017('0x58')](_0x402f6f[_0x4017('0x42')],_0x402f6f[_0x4017('0x44')]);_0x14a861['attributes']=_[_0x4017('0x58')](_0x402f6f['model'],qs[_0x4017('0x47')](_0x409637[_0x4017('0x44')][_0x4017('0x47')]));_0x14a861[_0x4017('0x46')]=_0x14a861['attributes'][_0x4017('0x48')]?_0x14a861[_0x4017('0x46')]:_0x402f6f['model'];if(!_0x409637[_0x4017('0x44')]['hasOwnProperty']('nolimit')){_0x14a861[_0x4017('0x2e')]=qs['limit'](_0x409637[_0x4017('0x44')][_0x4017('0x2e')]);_0x14a861[_0x4017('0x2c')]=qs['offset'](_0x409637[_0x4017('0x44')][_0x4017('0x2c')]);}_0x14a861[_0x4017('0x49')]=qs['sort'](_0x409637['query'][_0x4017('0x4a')]);_0x14a861['where']=qs[_0x4017('0x4c')](_[_0x4017('0x4d')](_0x409637[_0x4017('0x44')],_0x402f6f[_0x4017('0x4c')]));_0x14a861[_0x4017('0x4b')][_0x4017('0x65')]=_0x41488a['id'];if(_0x409637['query'][_0x4017('0x4e')]){_0x14a861[_0x4017('0x4b')]=_[_0x4017('0x50')](_0x14a861['where'],{'$or':_[_0x4017('0x3c')](_0x14a861[_0x4017('0x46')],function(_0xb1ebd4){var _0x542f9e={};_0x542f9e[_0xb1ebd4]={'$like':'%'+_0x409637['query'][_0x4017('0x4e')]+'%'};return _0x542f9e;})});}_0x14a861=_['merge']({},_0x14a861,_0x409637[_0x4017('0x51')]);return db[_0x4017('0xb9')][_0x4017('0x2f')]({'where':_0x14a861[_0x4017('0x4b')]})['then'](function(_0x4e5908){_0x5209e8['count']=_0x4e5908;if(_0x409637[_0x4017('0x44')]['includeAll']){_0x14a861[_0x4017('0x52')]=[{'model':db[_0x4017('0x93')],'as':'Contact','required':![]},{'model':db[_0x4017('0xc5')],'as':_0x4017('0xfc'),'attributes':[_0x4017('0x43'),_0x4017('0xfd'),_0x4017('0xfe')],'required':![]},{'model':db[_0x4017('0xff')],'as':'Tags','attributes':['id',_0x4017('0x43'),_0x4017('0x100')],'where':_0x409637[_0x4017('0x44')][_0x4017('0x101')]?{'id':_0x409637[_0x4017('0x44')]['tag']}:undefined,'required':_0x409637[_0x4017('0x44')][_0x4017('0x101')]?!![]:![]}];}return db[_0x4017('0xb9')][_0x4017('0x53')](_0x14a861);})[_0x4017('0x1e')](function(_0xc35f1b){_0x5209e8[_0x4017('0x54')]=_0xc35f1b;return _0x5209e8;});}})['then'](respondWithFilteredResult(_0x3e2eda,_0x14a861))[_0x4017('0x28')](handleError(_0x3e2eda,null));};function iftimePromise(_0x327dbe,_0x2e4686){return respondWithRpcPromise('Command','getSnippet',{'command':_0x2e4686[_0x4017('0x102')]?util[_0x4017('0xb2')](_0x4017('0x103'),_0x327dbe[_0x4017('0x104')],_0x2e4686[_0x4017('0x102')]):util[_0x4017('0xb2')](_0x4017('0x105'),_0x327dbe[_0x4017('0x104')])},client9002)[_0x4017('0x1e')](function(_0x5d14cf){var _0x2d7f13=_0x5d14cf&&_0x5d14cf['indexOf'](_0x4017('0x106'))>=0x0?!![]:![];logger[_0x4017('0x1f')](_0x4017('0x107'),_0x2e4686['id'],_0x327dbe['id'],_0x327dbe[_0x4017('0x104')],_0x2d7f13?_0x4017('0x108'):_0x4017('0x109'),_0x2e4686[_0x4017('0x102')]?_0x2e4686[_0x4017('0x102')]:'No\x20timezone');return _0x2d7f13;})[_0x4017('0x28')](function(_0x4ffa7f){logger[_0x4017('0x24')](_0x4017('0x107'),_0x2e4686['id'],_0x327dbe['id'],_0x327dbe['interval'],util[_0x4017('0x10a')](_0x4ffa7f,{'showHidden':![],'depth':null}),_0x2e4686[_0x4017('0x102')]?_0x2e4686[_0x4017('0x102')]:_0x4017('0x10b'));return![];});}exports['getSnippet']=function(_0x4b784d,_0x2c02b6,_0xf5473e){var _0x57248f=0x0;var _0xad8a6b=0x0;var _0x15078d=![];var _0x23a107;var _0xeb882b;return db['ChatWebsite'][_0x4017('0x5a')]({'where':{'id':_0x4b784d['params']['id']},'include':[{'model':db[_0x4017('0x10c')],'as':_0x4017('0x10c'),'include':[{'model':db['Interval'],'as':_0x4017('0x10d'),'attributes':['id',_0x4017('0x104')],'raw':!![]}]}]})[_0x4017('0x1e')](handleEntityNotFound(_0x2c02b6,null))[_0x4017('0x1e')](function(_0x3088fc){if(_0x3088fc){_0x23a107=_0x3088fc;return _0x3088fc[_0x4017('0x10e')]({'raw':!![]});}})['then'](function(_0x400ff4){if(_0x23a107){if(_0x400ff4){_0xeb882b=_0x400ff4;}}return require(_0x4017('0x7d'))[_0x4017('0x7e')]();})['then'](function(_0x274ccf){if(_0x274ccf){_0xad8a6b=_0x274ccf['virtual'];_0x15078d=_0x274ccf[_0x4017('0x7f')];}})[_0x4017('0x1e')](function(){return db['ChatInteraction'][_0x4017('0x2f')]({'where':{'closed':![]}});})[_0x4017('0x1e')](function(_0x4e40c7){_0x57248f=_0x4e40c7;if(_0xad8a6b&&_0x4e40c7>_0xad8a6b){return db[_0x4017('0x10f')][_0x4017('0x68')]({'where':{'id':0x1}})[_0x4017('0x1e')](function(_0x116c60){if(_0x116c60){_0x116c60['increment']('chatLicenseExceeded');}});}})[_0x4017('0x1e')](function(){if(_0x23a107[_0x4017('0x10c')]&&_0x23a107[_0x4017('0x10c')][_0x4017('0x10d')]){var _0x5638b7=[];for(var _0x13900d=0x0;_0x13900d<_0x23a107[_0x4017('0x10c')][_0x4017('0x10d')][_0x4017('0x48')];_0x13900d++){var _0x3ecb5c=_0x23a107[_0x4017('0x10c')]['Intervals'][_0x13900d][_0x4017('0x5e')]({'plain':!![]});_0x5638b7[_0x4017('0xc0')](iftimePromise(_0x3ecb5c,_0x23a107));}return BPromise[_0x4017('0x110')](_0x5638b7)[_0x4017('0x1e')](function(_0x3f278d){return _[_0x4017('0x111')](_0x3f278d);});}else{return!![];}})[_0x4017('0x1e')](function(_0x44bd71){var _0x184c51=fs[_0x4017('0xd4')](path['join'](config[_0x4017('0x82')],_0x4017('0x112')),'utf8');var _0x373e2b={'remote':_0x23a107[_0x4017('0x113')],'query':querystring[_0x4017('0x114')](_[_0x4017('0x50')](_0x23a107['get']({'plain':!![]}),{'customerIp':_0x4b784d[_0x4017('0x8f')][_0x4017('0xab')]||_0x4b784d['headers'][_0x4017('0x115')]||_0x4b784d[_0x4017('0x116')][_0x4017('0x117')]||_0x4b784d['ip'],'referer':_0x4b784d[_0x4017('0x8f')][_0x4017('0x118')],'openedInteractions':_0x57248f,'maxInteractions':_0xad8a6b,'virtual':_0x15078d[_0x4017('0x119')],'online':_0x44bd71,'custom':_0x15078d}))[_0x4017('0x11a')](/'/g,'\x5c\x27')};_0x2c02b6[_0x4017('0xcc')](ejs[_0x4017('0xd7')](Mustache[_0x4017('0xd7')](_0x184c51,_0x373e2b),{'proactiveActions':_0xeb882b,'alignment':_0x23a107['alignment'],'verticalAlignment':_0x23a107['verticalAlignment'],'div_color':_0x23a107[_0x4017('0x100')],'text_color':_0x23a107[_0x4017('0x11b')],'button_color':_0x23a107[_0x4017('0x11c')],'background_color':_0x23a107[_0x4017('0x11d')]}));})[_0x4017('0x28')](handleError(_0x2c02b6,null));};exports['addApplications']=function(_0xc7a393,_0x2a7a89,_0x370669){return db[_0x4017('0x3d')]['findOne']({'where':{'id':_0xc7a393[_0x4017('0x56')]['id']}})[_0x4017('0x1e')](handleEntityNotFound(_0x2a7a89,null))[_0x4017('0x1e')](function(_0x4eb78f){if(_0x4eb78f){return db[_0x4017('0xe1')][_0x4017('0xe2')](function(_0x82203a){return db[_0x4017('0xa3')][_0x4017('0x36')]({'where':{'ChatWebsiteId':_0xc7a393['params']['id']},'transaction':_0x82203a})[_0x4017('0x1e')](function(_0x37a834){var _0x42124c=_['map'](_0xc7a393['body'],function(_0x80618c){_0x80618c['ChatWebsiteId']=_0xc7a393[_0x4017('0x56')]['id'];return _0x80618c;});return db['ChatApplication']['bulkCreate'](_0x42124c,{'transaction':_0x82203a});});})[_0x4017('0x1e')](function(){return db[_0x4017('0xa3')][_0x4017('0x11e')]({'where':{'ChatWebsiteId':_0xc7a393[_0x4017('0x56')]['id']},'order':_0x4017('0xa6')});});}})[_0x4017('0x1e')](respondWithResult(_0x2a7a89,null))[_0x4017('0x28')](handleError(_0x2a7a89,null));};exports[_0x4017('0x11f')]=function(_0x3aa70b,_0x2a7e70,_0x6516af){var _0x274308={};var _0x495e47={};var _0x268788;var _0x5d0254;return db[_0x4017('0x3d')][_0x4017('0x68')]({'where':{'id':_0x3aa70b['params']['id']}})['then'](handleEntityNotFound(_0x2a7e70,null))[_0x4017('0x1e')](function(_0x48954c){if(_0x48954c){_0x268788=_0x48954c;_0x495e47['model']=_[_0x4017('0x45')](db[_0x4017('0xa3')]['rawAttributes']);_0x495e47[_0x4017('0x44')]=_[_0x4017('0x45')](_0x3aa70b[_0x4017('0x44')]);_0x495e47['filters']=_[_0x4017('0x58')](_0x495e47[_0x4017('0x42')],_0x495e47[_0x4017('0x44')]);_0x274308['attributes']=_['intersection'](_0x495e47[_0x4017('0x42')],qs[_0x4017('0x47')](_0x3aa70b[_0x4017('0x44')][_0x4017('0x47')]));_0x274308[_0x4017('0x46')]=_0x274308[_0x4017('0x46')][_0x4017('0x48')]?_0x274308[_0x4017('0x46')]:_0x495e47['model'];_0x274308['order']=qs[_0x4017('0x4a')](_0x3aa70b[_0x4017('0x44')][_0x4017('0x4a')]);_0x274308[_0x4017('0x4b')]=qs[_0x4017('0x4c')](_[_0x4017('0x4d')](_0x3aa70b['query'],_0x495e47[_0x4017('0x4c')]));if(_0x3aa70b[_0x4017('0x44')][_0x4017('0x4e')]){_0x274308['where']=_[_0x4017('0x50')](_0x274308[_0x4017('0x4b')],{'$or':_[_0x4017('0x3c')](_0x274308[_0x4017('0x46')],function(_0x1f05c8){var _0x4ccace={};_0x4ccace[_0x1f05c8]={'$like':'%'+_0x3aa70b[_0x4017('0x44')]['filter']+'%'};return _0x4ccace;})});}_0x274308=_[_0x4017('0x50')]({},_0x274308,_0x3aa70b[_0x4017('0x51')]);return _0x268788[_0x4017('0x11f')](_0x274308);}})[_0x4017('0x1e')](function(_0x2052d1){if(_0x2052d1){_0x5d0254=_0x2052d1[_0x4017('0x48')];if(!_0x3aa70b[_0x4017('0x44')][_0x4017('0x69')](_0x4017('0x6f'))){_0x274308[_0x4017('0x2e')]=qs['limit'](_0x3aa70b['query'][_0x4017('0x2e')]);_0x274308[_0x4017('0x2c')]=qs[_0x4017('0x2c')](_0x3aa70b[_0x4017('0x44')][_0x4017('0x2c')]);}return _0x268788[_0x4017('0x11f')](_0x274308);}})['then'](function(_0x4c64b9){if(_0x4c64b9){return _0x4c64b9?{'count':_0x5d0254,'rows':_0x4c64b9}:null;}})[_0x4017('0x1e')](respondWithResult(_0x2a7e70,null))[_0x4017('0x28')](handleError(_0x2a7e70,null));};exports[_0x4017('0x120')]=function(_0x5392b9,_0x39a810,_0x27dd90){return db[_0x4017('0x121')][_0x4017('0x5a')]({'where':{'id':_0x5392b9[_0x4017('0x56')]['id']}})[_0x4017('0x1e')](handleEntityNotFound(_0x39a810,null))[_0x4017('0x1e')](function(_0x3a0fa1){if(_0x3a0fa1){return _0x3a0fa1[_0x4017('0x120')](_0x5392b9['body'][_0x4017('0x6b')],_[_0x4017('0x122')](_0x5392b9[_0x4017('0x5c')],['ids','id'])||{});}})['then'](respondWithResult(_0x39a810,null))[_0x4017('0x28')](handleError(_0x39a810,null));};exports[_0x4017('0x10e')]=function(_0x1bce3a,_0x5ac31f,_0xf188ea){var _0x53e0df={};var _0x30d500={};var _0xdfb97d;var _0x5ee835;return db[_0x4017('0x3d')][_0x4017('0x68')]({'where':{'id':_0x1bce3a['params']['id']}})['then'](handleEntityNotFound(_0x5ac31f,null))[_0x4017('0x1e')](function(_0xcc8a3a){if(_0xcc8a3a){_0xdfb97d=_0xcc8a3a;_0x30d500['model']=_[_0x4017('0x45')](db[_0x4017('0x123')]['rawAttributes']);_0x30d500[_0x4017('0x44')]=_['keys'](_0x1bce3a[_0x4017('0x44')]);_0x30d500[_0x4017('0x4c')]=_[_0x4017('0x58')](_0x30d500[_0x4017('0x42')],_0x30d500[_0x4017('0x44')]);_0x53e0df[_0x4017('0x46')]=_[_0x4017('0x58')](_0x30d500[_0x4017('0x42')],qs[_0x4017('0x47')](_0x1bce3a[_0x4017('0x44')][_0x4017('0x47')]));_0x53e0df[_0x4017('0x46')]=_0x53e0df[_0x4017('0x46')][_0x4017('0x48')]?_0x53e0df[_0x4017('0x46')]:_0x30d500[_0x4017('0x42')];_0x53e0df[_0x4017('0x49')]=qs[_0x4017('0x4a')](_0x1bce3a[_0x4017('0x44')]['sort']);_0x53e0df[_0x4017('0x4b')]=qs[_0x4017('0x4c')](_[_0x4017('0x4d')](_0x1bce3a[_0x4017('0x44')],_0x30d500[_0x4017('0x4c')]));if(_0x1bce3a['query'][_0x4017('0x4e')]){_0x53e0df[_0x4017('0x4b')]=_[_0x4017('0x50')](_0x53e0df['where'],{'$or':_[_0x4017('0x3c')](_0x53e0df[_0x4017('0x46')],function(_0x2394c3){var _0x3441ac={};_0x3441ac[_0x2394c3]={'$like':'%'+_0x1bce3a[_0x4017('0x44')][_0x4017('0x4e')]+'%'};return _0x3441ac;})});}_0x53e0df=_['merge']({},_0x53e0df,_0x1bce3a[_0x4017('0x51')]);return _0xdfb97d[_0x4017('0x10e')](_0x53e0df);}})[_0x4017('0x1e')](function(_0x3f0a7c){if(_0x3f0a7c){_0x5ee835=_0x3f0a7c[_0x4017('0x48')];if(!_0x1bce3a[_0x4017('0x44')][_0x4017('0x69')](_0x4017('0x6f'))){_0x53e0df['limit']=qs[_0x4017('0x2e')](_0x1bce3a[_0x4017('0x44')]['limit']);_0x53e0df[_0x4017('0x2c')]=qs[_0x4017('0x2c')](_0x1bce3a[_0x4017('0x44')]['offset']);}return _0xdfb97d[_0x4017('0x10e')](_0x53e0df);}})[_0x4017('0x1e')](function(_0x2d26a5){if(_0x2d26a5){return _0x2d26a5?{'count':_0x5ee835,'rows':_0x2d26a5}:null;}})[_0x4017('0x1e')](respondWithResult(_0x5ac31f,null))[_0x4017('0x28')](handleError(_0x5ac31f,null));};exports[_0x4017('0x124')]=function(_0x1bba67,_0x1fca04,_0xadabdd){var _0x56d5e1=_0x1bba67['query'][_0x4017('0x125')]==='false'?_0x4017('0x126'):'onlineForm';return db[_0x4017('0x3d')][_0x4017('0x5a')]({'attributes':['id',_0x56d5e1],'where':{'id':_0x1bba67['params']['id']}})[_0x4017('0x1e')](handleEntityNotFound(_0x1fca04,null))['then'](function(_0x1fd97f){if(_0x1fd97f){var _0xfc1bef=_0x1fd97f[_0x56d5e1];var _0x2b0b8c=_0xfc1bef&&_0xfc1bef[_0x4017('0x127')]?_0xfc1bef['items']:[];_0x1fca04[_0x4017('0xcc')]({'fromKey':_['isNil'](_0xfc1bef[_0x4017('0x128')])?undefined:_0xfc1bef['fromKey'],'count':_0x2b0b8c[_0x4017('0x48')],'rows':_0x2b0b8c});}})[_0x4017('0x28')](handleError(_0x1fca04,null));};exports[_0x4017('0x129')]=function(_0x5acb4c,_0x5770f6,_0x3e44b8){var _0x4b1828={'raw':![],'where':{}};var _0x4bec09={};var _0x5e0fc0={'count':0x0,'rows':[]};return db[_0x4017('0x3d')][_0x4017('0x68')]({'where':{'id':_0x5acb4c['params']['id']}})[_0x4017('0x1e')](handleEntityNotFound(_0x5770f6,null))[_0x4017('0x1e')](function(_0x429720){if(_0x429720){_0x4bec09[_0x4017('0x42')]=_[_0x4017('0x45')](db[_0x4017('0x12a')]['rawAttributes']);_0x4bec09[_0x4017('0x44')]=_[_0x4017('0x45')](_0x5acb4c[_0x4017('0x44')]);_0x4bec09[_0x4017('0x4c')]=_[_0x4017('0x58')](_0x4bec09['model'],_0x4bec09['query']);_0x4b1828[_0x4017('0x46')]=_[_0x4017('0x58')](_0x4bec09['model'],qs[_0x4017('0x47')](_0x5acb4c['query']['fields']));_0x4b1828[_0x4017('0x46')]=_0x4b1828[_0x4017('0x46')]['length']?_0x4b1828[_0x4017('0x46')]:_0x4bec09[_0x4017('0x42')];if(!_0x5acb4c[_0x4017('0x44')][_0x4017('0x69')](_0x4017('0x6f'))){_0x4b1828[_0x4017('0x2e')]=qs[_0x4017('0x2e')](_0x5acb4c[_0x4017('0x44')]['limit']);_0x4b1828[_0x4017('0x2c')]=qs['offset'](_0x5acb4c[_0x4017('0x44')]['offset']);}_0x4b1828[_0x4017('0x49')]=qs[_0x4017('0x4a')](_0x5acb4c[_0x4017('0x44')][_0x4017('0x4a')]);_0x4b1828[_0x4017('0x4b')]=qs[_0x4017('0x4c')](_['pick'](_0x5acb4c['query'],_0x4bec09[_0x4017('0x4c')]));_0x4b1828['where'][_0x4017('0x65')]=_0x429720['id'];if(_0x5acb4c['query'][_0x4017('0x4e')]){_0x4b1828[_0x4017('0x4b')]=_[_0x4017('0x50')](_0x4b1828[_0x4017('0x4b')],{'$or':_[_0x4017('0x3c')](_0x4b1828['attributes'],function(_0x23a2bd){var _0x403a60={};_0x403a60[_0x23a2bd]={'$like':'%'+_0x5acb4c[_0x4017('0x44')][_0x4017('0x4e')]+'%'};return _0x403a60;})});}_0x4b1828=_['merge']({},_0x4b1828,_0x5acb4c['options']);return db['ChatOfflineMessage'][_0x4017('0x2f')]({'where':_0x4b1828[_0x4017('0x4b')]})[_0x4017('0x1e')](function(_0x20359d){_0x5e0fc0['count']=_0x20359d;if(_0x5acb4c[_0x4017('0x44')][_0x4017('0x59')]){_0x4b1828[_0x4017('0x52')]=[{'all':!![]}];}else{_0x4b1828[_0x4017('0x52')]=[{'model':db[_0x4017('0x93')],'as':_0x4017('0x12b'),'required':![]},{'model':db[_0x4017('0xe3')],'as':_0x4017('0x12c'),'required':![]}];}return db[_0x4017('0x12a')][_0x4017('0x53')](_0x4b1828);})[_0x4017('0x1e')](function(_0x3d1001){_0x5e0fc0[_0x4017('0x54')]=_0x3d1001;return _0x5e0fc0;});}})['then'](respondWithFilteredResult(_0x5770f6,_0x4b1828))[_0x4017('0x28')](handleError(_0x5770f6,null));};exports['addAgents']=function(_0x4d6ca1,_0x2d5b8e,_0x4deb47){return db['ChatWebsite'][_0x4017('0x5a')]({'where':{'id':_0x4d6ca1[_0x4017('0x56')]['id']}})['then'](handleEntityNotFound(_0x2d5b8e,null))['then'](function(_0x1f4ce6){if(_0x1f4ce6){return _0x1f4ce6[_0x4017('0x12d')](_0x4d6ca1[_0x4017('0x5c')][_0x4017('0x6b')],_[_0x4017('0x122')](_0x4d6ca1[_0x4017('0x5c')],[_0x4017('0x6b'),'id'])||{})[_0x4017('0xd3')](function(_0x19e649){for(var _0x126960=0x0;_0x126960<_0x4d6ca1[_0x4017('0x5c')][_0x4017('0x6b')][_0x4017('0x48')];_0x126960+=0x1){socket[_0x4017('0x12e')](_0x4017('0x12f'),{'UserId':Number(_0x4d6ca1[_0x4017('0x5c')][_0x4017('0x6b')][_0x126960]),'ChatWebsiteId':Number(_0x4d6ca1[_0x4017('0x56')]['id'])});}return _0x19e649;});}})[_0x4017('0x1e')](respondWithResult(_0x2d5b8e,null))[_0x4017('0x28')](handleError(_0x2d5b8e,null));};exports[_0x4017('0x130')]=function(_0x37e74e,_0x2eaa28,_0x5cffe3){return db[_0x4017('0x3d')]['find']({'where':{'id':_0x37e74e['params']['id']}})['then'](handleEntityNotFound(_0x2eaa28,null))[_0x4017('0x1e')](function(_0x2e7f4b){if(_0x2e7f4b){return _0x2e7f4b[_0x4017('0x130')](_0x37e74e['query'][_0x4017('0x6b')])[_0x4017('0x1e')](function(){if(_[_0x4017('0x131')](_0x37e74e['query'][_0x4017('0x6b')])){for(var _0x42d28f=0x0;_0x42d28f<_0x37e74e['query'][_0x4017('0x6b')][_0x4017('0x48')];_0x42d28f+=0x1){socket[_0x4017('0x12e')](_0x4017('0x132'),{'UserId':Number(_0x37e74e['query'][_0x4017('0x6b')][_0x42d28f]),'ChatWebsiteId':Number(_0x37e74e[_0x4017('0x56')]['id'])});}}else{socket['emit'](_0x4017('0x132'),{'UserId':Number(_0x37e74e[_0x4017('0x44')]['ids']),'ChatWebsiteId':Number(_0x37e74e[_0x4017('0x56')]['id'])});}});}})[_0x4017('0x1e')](respondWithStatusCode(_0x2eaa28,null))['catch'](handleError(_0x2eaa28,null));};exports['getAgents']=function(_0x28b20c,_0x539555,_0x5e4268){var _0x1e545d={};var _0x54867f={};var _0x517000;var _0x247163;return db[_0x4017('0x3d')][_0x4017('0x68')]({'where':{'id':_0x28b20c[_0x4017('0x56')]['id']}})[_0x4017('0x1e')](handleEntityNotFound(_0x539555,null))[_0x4017('0x1e')](function(_0x5217f0){if(_0x5217f0){_0x517000=_0x5217f0;_0x54867f[_0x4017('0x42')]=_[_0x4017('0x45')](db[_0x4017('0xc5')]['rawAttributes']);_0x54867f['query']=_[_0x4017('0x45')](_0x28b20c[_0x4017('0x44')]);_0x54867f[_0x4017('0x4c')]=_['intersection'](_0x54867f[_0x4017('0x42')],_0x54867f['query']);_0x1e545d[_0x4017('0x46')]=_[_0x4017('0x58')](_0x54867f['model'],qs['fields'](_0x28b20c['query'][_0x4017('0x47')]));_0x1e545d[_0x4017('0x46')]=_0x1e545d[_0x4017('0x46')][_0x4017('0x48')]?_0x1e545d[_0x4017('0x46')]:_0x54867f[_0x4017('0x42')];_0x1e545d['order']=qs[_0x4017('0x4a')](_0x28b20c[_0x4017('0x44')][_0x4017('0x4a')]);_0x1e545d[_0x4017('0x4b')]=qs['filters'](_[_0x4017('0x4d')](_0x28b20c['query'],_0x54867f[_0x4017('0x4c')]));if(_0x28b20c[_0x4017('0x44')][_0x4017('0x4e')]){_0x1e545d['where']=_[_0x4017('0x50')](_0x1e545d[_0x4017('0x4b')],{'$or':_[_0x4017('0x3c')](_0x1e545d[_0x4017('0x46')],function(_0x55eca9){var _0x44a882={};_0x44a882[_0x55eca9]={'$like':'%'+_0x28b20c[_0x4017('0x44')][_0x4017('0x4e')]+'%'};return _0x44a882;})});}_0x1e545d=_[_0x4017('0x50')]({},_0x1e545d,_0x28b20c[_0x4017('0x51')]);return _0x517000[_0x4017('0x133')](_0x1e545d);}})[_0x4017('0x1e')](function(_0x29353a){if(_0x29353a){_0x247163=_0x29353a[_0x4017('0x48')];if(!_0x28b20c[_0x4017('0x44')][_0x4017('0x69')](_0x4017('0x6f'))){_0x1e545d[_0x4017('0x2e')]=qs[_0x4017('0x2e')](_0x28b20c[_0x4017('0x44')][_0x4017('0x2e')]);_0x1e545d[_0x4017('0x2c')]=qs[_0x4017('0x2c')](_0x28b20c['query'][_0x4017('0x2c')]);}return _0x517000[_0x4017('0x133')](_0x1e545d);}})[_0x4017('0x1e')](function(_0x414a82){if(_0x414a82){return _0x414a82?{'count':_0x247163,'rows':_0x414a82}:null;}})['then'](respondWithResult(_0x539555,null))[_0x4017('0x28')](handleError(_0x539555,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 620bed1..4463ace 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 _0x4a80=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','ChatWebsite'];(function(_0x1f0213,_0x3c3c9e){var _0x2048c4=function(_0x26d0c6){while(--_0x26d0c6){_0x1f0213['push'](_0x1f0213['shift']());}};_0x2048c4(++_0x3c3c9e);}(_0x4a80,0xbe));var _0x04a8=function(_0x2a19e7,_0x53aa4d){_0x2a19e7=_0x2a19e7-0x0;var _0xdb7b37=_0x4a80[_0x2a19e7];return _0xdb7b37;};'use strict';var EventEmitter=require(_0x04a8('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x04a8('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x04a8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x04a8('0x3'),'afterDestroy':_0x04a8('0x4')};function emitEvent(_0x256369){return function(_0x1e36fc,_0x85c22,_0xde2f6a){ChatWebsiteEvents[_0x04a8('0x5')](_0x256369+':'+_0x1e36fc['id'],_0x1e36fc);ChatWebsiteEvents[_0x04a8('0x5')](_0x256369,_0x1e36fc);_0xde2f6a(null);};}for(var e in events){if(events[_0x04a8('0x6')](e)){var event=events[e];ChatWebsite[_0x04a8('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0xa1db=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x32de9f,_0xf3b6e9){var _0x532e62=function(_0xd0becf){while(--_0xd0becf){_0x32de9f['push'](_0x32de9f['shift']());}};_0x532e62(++_0xf3b6e9);}(_0xa1db,0xb0));var _0xba1d=function(_0x309a5e,_0x1ec246){_0x309a5e=_0x309a5e-0x0;var _0x1d21f1=_0xa1db[_0x309a5e];return _0x1d21f1;};'use strict';var EventEmitter=require(_0xba1d('0x0'));var ChatWebsite=require(_0xba1d('0x1'))['db'][_0xba1d('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xba1d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xba1d('0x4')};function emitEvent(_0x281396){return function(_0x5c8c8b,_0x256502,_0x314523){ChatWebsiteEvents[_0xba1d('0x5')](_0x281396+':'+_0x5c8c8b['id'],_0x5c8c8b);ChatWebsiteEvents[_0xba1d('0x5')](_0x281396,_0x5c8c8b);_0x314523(null);};}for(var e in events){if(events[_0xba1d('0x6')](e)){var event=events[e];ChatWebsite[_0xba1d('0x7')](e,emitEvent(event));}}module[_0xba1d('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 3a0bc72..1cd8033 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 _0xa784=['chat_websites','util','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x42c3ea,_0x2cae04){var _0x294a04=function(_0x265626){while(--_0x265626){_0x42c3ea['push'](_0x42c3ea['shift']());}};_0x294a04(++_0x2cae04);}(_0xa784,0x140));var _0x4a78=function(_0x30622d,_0x1b5817){_0x30622d=_0x30622d-0x0;var _0x1ac8d6=_0xa784[_0x30622d];return _0x1ac8d6;};'use strict';var _=require('lodash');var util=require(_0x4a78('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4a78('0x1'));var BPromise=require(_0x4a78('0x2'));var rp=require(_0x4a78('0x3'));var fs=require('fs');var path=require(_0x4a78('0x4'));var rimraf=require('rimraf');var config=require(_0x4a78('0x5'));var attributes=require(_0x4a78('0x6'));module[_0x4a78('0x7')]=function(_0x3b7698,_0x40eabc){return _0x3b7698[_0x4a78('0x8')](_0x4a78('0x9'),attributes,{'tableName':_0x4a78('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7380=['moment','bluebird','request-promise','rimraf','../../config/environment','define','chat_websites','util','../../config/logger','api'];(function(_0x2c86ea,_0x300f11){var _0x454243=function(_0x372d86){while(--_0x372d86){_0x2c86ea['push'](_0x2c86ea['shift']());}};_0x454243(++_0x300f11);}(_0x7380,0x1dd));var _0x0738=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0x7380[_0x18fb16];return _0x147b0d;};'use strict';var _=require('lodash');var util=require(_0x0738('0x0'));var logger=require(_0x0738('0x1'))(_0x0738('0x2'));var moment=require(_0x0738('0x3'));var BPromise=require(_0x0738('0x4'));var rp=require(_0x0738('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0738('0x6'));var config=require(_0x0738('0x7'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x478364,_0x383b46){return _0x478364[_0x0738('0x8')]('ChatWebsite',attributes,{'tableName':_0x0738('0x9'),'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 1986c28..b63a1af 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 _0x76d4=['localhost','register','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0x76d4,0x75));var _0x476d=function(_0x3f8b6b,_0xe15f86){_0x3f8b6b=_0x3f8b6b-0x0;var _0x7b0516=_0x76d4[_0x3f8b6b];return _0x7b0516;};'use strict';var _=require(_0x476d('0x0'));var util=require('util');var moment=require(_0x476d('0x1'));var BPromise=require(_0x476d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x476d('0x3'))['db'];var utils=require(_0x476d('0x4'));var logger=require(_0x476d('0x5'))(_0x476d('0x6'));var config=require(_0x476d('0x7'));var jayson=require(_0x476d('0x8'));var client=jayson[_0x476d('0x9')][_0x476d('0xa')]({'port':0x232a});config[_0x476d('0xb')]=_[_0x476d('0xc')](config[_0x476d('0xb')],{'host':_0x476d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0x476d('0xe')](socket);function respondWithRpcPromise(_0x5f003c,_0x1e3943,_0x25aed8){return new BPromise(function(_0x448b3c,_0x197461){return client[_0x476d('0xf')](_0x5f003c,_0x25aed8)['then'](function(_0x5a59c6){logger['info'](_0x476d('0x10'),_0x1e3943,_0x476d('0x11'));logger[_0x476d('0x12')](_0x476d('0x13'),_0x1e3943,'request\x20sent',JSON[_0x476d('0x14')](_0x5a59c6));if(_0x5a59c6[_0x476d('0x15')]){if(_0x5a59c6['error']['code']===0x1f4){logger['error'](_0x476d('0x10'),_0x1e3943,_0x5a59c6[_0x476d('0x15')][_0x476d('0x16')]);return _0x197461(_0x5a59c6[_0x476d('0x15')][_0x476d('0x16')]);}logger[_0x476d('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x1e3943,_0x5a59c6[_0x476d('0x15')][_0x476d('0x16')]);return _0x448b3c(_0x5a59c6[_0x476d('0x15')]['message']);}else{logger[_0x476d('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1e3943,_0x476d('0x11'));_0x448b3c(_0x5a59c6[_0x476d('0x18')]['message']);}})[_0x476d('0x19')](function(_0x12f733){logger[_0x476d('0x15')](_0x476d('0x10'),_0x1e3943,_0x12f733);_0x197461(_0x12f733);});});} \ No newline at end of file +var _0xaf1a=['./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xaf1a,0x1a5));var _0xaaf1=function(_0x4f032d,_0x52d5a7){_0x4f032d=_0x4f032d-0x0;var _0x580049=_0xaf1a[_0x4f032d];return _0x580049;};'use strict';var _=require(_0xaaf1('0x0'));var util=require('util');var moment=require(_0xaaf1('0x1'));var BPromise=require(_0xaaf1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaaf1('0x3'));var db=require(_0xaaf1('0x4'))['db'];var utils=require(_0xaaf1('0x5'));var logger=require('../../config/logger')(_0xaaf1('0x6'));var config=require(_0xaaf1('0x7'));var jayson=require(_0xaaf1('0x8'));var client=jayson[_0xaaf1('0x9')][_0xaaf1('0xa')]({'port':0x232a});config[_0xaaf1('0xb')]=_[_0xaaf1('0xc')](config[_0xaaf1('0xb')],{'host':_0xaaf1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaaf1('0xb')]));require(_0xaaf1('0xe'))[_0xaaf1('0xf')](socket);function respondWithRpcPromise(_0x3c2001,_0x4e0f5a,_0xe576d0){return new BPromise(function(_0xc758b9,_0x3a85bf){return client[_0xaaf1('0x10')](_0x3c2001,_0xe576d0)[_0xaaf1('0x11')](function(_0x2cec91){logger['info'](_0xaaf1('0x12'),_0x4e0f5a,_0xaaf1('0x13'));logger[_0xaaf1('0x14')](_0xaaf1('0x15'),_0x4e0f5a,'request\x20sent',JSON[_0xaaf1('0x16')](_0x2cec91));if(_0x2cec91[_0xaaf1('0x17')]){if(_0x2cec91[_0xaaf1('0x17')][_0xaaf1('0x18')]===0x1f4){logger[_0xaaf1('0x17')](_0xaaf1('0x12'),_0x4e0f5a,_0x2cec91[_0xaaf1('0x17')][_0xaaf1('0x19')]);return _0x3a85bf(_0x2cec91[_0xaaf1('0x17')]['message']);}logger[_0xaaf1('0x17')](_0xaaf1('0x12'),_0x4e0f5a,_0x2cec91[_0xaaf1('0x17')][_0xaaf1('0x19')]);return _0xc758b9(_0x2cec91['error'][_0xaaf1('0x19')]);}else{logger[_0xaaf1('0x1a')](_0xaaf1('0x12'),_0x4e0f5a,'request\x20sent');_0xc758b9(_0x2cec91[_0xaaf1('0x1b')]['message']);}})[_0xaaf1('0x1c')](function(_0x48378b){logger[_0xaaf1('0x17')](_0xaaf1('0x12'),_0x4e0f5a,_0x48378b);_0x3a85bf(_0x48378b);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index ef4f1d2..b9ecf2c 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 _0xe787=['chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener','register','length'];(function(_0x52096b,_0x20bab4){var _0x2b1cc7=function(_0x3f7021){while(--_0x3f7021){_0x52096b['push'](_0x52096b['shift']());}};_0x2b1cc7(++_0x20bab4);}(_0xe787,0xa3));var _0x7e78=function(_0x45aa72,_0x8af642){_0x45aa72=_0x45aa72-0x0;var _0x75adaa=_0xe787[_0x45aa72];return _0x75adaa;};'use strict';var ChatWebsiteEvents=require(_0x7e78('0x0'));var events=[_0x7e78('0x1'),_0x7e78('0x2'),_0x7e78('0x3')];function createListener(_0x1e3c2e,_0xbd1751){return function(_0x20d438){_0xbd1751[_0x7e78('0x4')](_0x1e3c2e,_0x20d438);};}function removeListener(_0x10626f,_0x5dbbe6){return function(){ChatWebsiteEvents[_0x7e78('0x5')](_0x10626f,_0x5dbbe6);};}exports[_0x7e78('0x6')]=function(_0xcf568e){for(var _0x5664a0=0x0,_0x5ebbb1=events[_0x7e78('0x7')];_0x5664a0<_0x5ebbb1;_0x5664a0++){var _0x469e84=events[_0x5664a0];var _0xc29747=createListener(_0x7e78('0x8')+_0x469e84,_0xcf568e);ChatWebsiteEvents['on'](_0x469e84,_0xc29747);}}; \ No newline at end of file +var _0x7328=['save','remove','update','emit','removeListener','length','chatWebsite:','./chatWebsite.events'];(function(_0x416ab7,_0x35d6c5){var _0x3b53be=function(_0x5a26c6){while(--_0x5a26c6){_0x416ab7['push'](_0x416ab7['shift']());}};_0x3b53be(++_0x35d6c5);}(_0x7328,0xcf));var _0x8732=function(_0x538560,_0x4dad68){_0x538560=_0x538560-0x0;var _0xc480ef=_0x7328[_0x538560];return _0xc480ef;};'use strict';var ChatWebsiteEvents=require(_0x8732('0x0'));var events=[_0x8732('0x1'),_0x8732('0x2'),_0x8732('0x3')];function createListener(_0x171850,_0x4f70f0){return function(_0x2d1d44){_0x4f70f0[_0x8732('0x4')](_0x171850,_0x2d1d44);};}function removeListener(_0x3d96a1,_0x5c962a){return function(){ChatWebsiteEvents[_0x8732('0x5')](_0x3d96a1,_0x5c962a);};}exports['register']=function(_0x1ba0d1){for(var _0x34ba82=0x0,_0x588999=events[_0x8732('0x6')];_0x34ba82<_0x588999;_0x34ba82++){var _0x2fe806=events[_0x34ba82];var _0x2f08da=createListener(_0x8732('0x7')+_0x2fe806,_0x1ba0d1);ChatWebsiteEvents['on'](_0x2fe806,_0x2f08da);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 212a058..e010a9e 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 _0xd763=['addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','getAgents','create','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','originalname','single','addLogo','server/files/images/avatars/','%s-%s','file','addAvatar','addCustomerAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','addApplications','/:id/users'];(function(_0x5e649a,_0x1ccc94){var _0x2558da=function(_0x1b7010){while(--_0x1b7010){_0x5e649a['push'](_0x5e649a['shift']());}};_0x2558da(++_0x1ccc94);}(_0xd763,0x1be));var _0x3d76=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xd763[_0x5c2e3e];return _0x53f64a;};'use strict';var multer=require(_0x3d76('0x0'));var util=require(_0x3d76('0x1'));var path=require('path');var timeout=require(_0x3d76('0x2'));var express=require(_0x3d76('0x3'));var router=express['Router']();var fs_extra=require(_0x3d76('0x4'));var auth=require(_0x3d76('0x5'));var interaction=require(_0x3d76('0x6'));var config=require(_0x3d76('0x7'));var controller=require(_0x3d76('0x8'));router[_0x3d76('0x9')]('/',auth[_0x3d76('0xa')](),controller['index']);router[_0x3d76('0x9')](_0x3d76('0xb'),auth[_0x3d76('0xa')](),controller[_0x3d76('0xc')]);router['get'](_0x3d76('0xd'),auth[_0x3d76('0xa')](),controller[_0x3d76('0xe')]);router[_0x3d76('0x9')](_0x3d76('0xf'),auth[_0x3d76('0xa')](),controller[_0x3d76('0x10')]);router[_0x3d76('0x9')](_0x3d76('0x11'),auth[_0x3d76('0xa')](),controller[_0x3d76('0x12')]);router[_0x3d76('0x9')](_0x3d76('0x13'),controller[_0x3d76('0x14')]);router['get'](_0x3d76('0x15'),controller[_0x3d76('0x16')]);router[_0x3d76('0x9')](_0x3d76('0x17'),controller['getCustomerAvatar']);router[_0x3d76('0x9')](_0x3d76('0x18'),controller[_0x3d76('0x19')]);router[_0x3d76('0x9')](_0x3d76('0x1a'),auth[_0x3d76('0xa')](),controller['getInteractions']);router[_0x3d76('0x9')](_0x3d76('0x1b'),controller[_0x3d76('0x1c')]);router[_0x3d76('0x9')](_0x3d76('0x1d'),auth['isAuthenticated'](),controller[_0x3d76('0x1e')]);router[_0x3d76('0x9')](_0x3d76('0x1f'),auth[_0x3d76('0xa')](),controller[_0x3d76('0x20')]);router['get']('/:id/fields',controller[_0x3d76('0x21')]);router[_0x3d76('0x9')]('/:id/offline_messages',auth[_0x3d76('0xa')](),controller[_0x3d76('0x22')]);router[_0x3d76('0x9')]('/:id/users',auth[_0x3d76('0xa')](),controller[_0x3d76('0x23')]);router['post']('/',auth[_0x3d76('0xa')](),controller[_0x3d76('0x24')]);router[_0x3d76('0x25')](_0x3d76('0xf'),auth[_0x3d76('0xa')](),controller[_0x3d76('0x26')]);router[_0x3d76('0x25')](_0x3d76('0x11'),auth['isAuthenticated'](),controller[_0x3d76('0x27')]);var upload=multer({'storage':multer[_0x3d76('0x28')]({'destination':function(_0x5cd2cf,_0x3a46ae,_0x96eb22){_0x96eb22(null,path[_0x3d76('0x29')](config[_0x3d76('0x2a')],_0x3d76('0x2b')));},'filename':function(_0xb2b710,_0x4f316d,_0x270ade){_0x270ade(null,util[_0x3d76('0x2c')]('%s-%s',Date[_0x3d76('0x2d')](),_0x4f316d[_0x3d76('0x2e')]));}})});router[_0x3d76('0x25')](_0x3d76('0x13'),upload[_0x3d76('0x2f')]('file'),controller[_0x3d76('0x30')]);var upload=multer({'storage':multer[_0x3d76('0x28')]({'destination':function(_0x3c9232,_0x4b7eca,_0x353b17){_0x353b17(null,path[_0x3d76('0x29')](config['root'],_0x3d76('0x31')));},'filename':function(_0x4e526e,_0x13b286,_0x52c222){_0x52c222(null,util[_0x3d76('0x2c')](_0x3d76('0x32'),Date[_0x3d76('0x2d')](),_0x13b286['originalname']));}})});router['post'](_0x3d76('0x15'),upload[_0x3d76('0x2f')](_0x3d76('0x33')),controller[_0x3d76('0x34')]);var upload=multer({'storage':multer[_0x3d76('0x28')]({'destination':function(_0x59f5e5,_0x37af22,_0x929f5a){_0x929f5a(null,path[_0x3d76('0x29')](config[_0x3d76('0x2a')],'server/files/images/avatars/'));},'filename':function(_0x2c1cee,_0x2d4af1,_0x9c2fb8){_0x9c2fb8(null,util[_0x3d76('0x2c')](_0x3d76('0x32'),Date[_0x3d76('0x2d')](),_0x2d4af1['originalname']));}})});router[_0x3d76('0x25')]('/:id/customer_avatar',upload[_0x3d76('0x2f')]('file'),controller[_0x3d76('0x35')]);var upload=multer({'storage':multer[_0x3d76('0x28')]({'destination':function(_0x40b3d6,_0x316cc4,_0xc53d3c){_0xc53d3c(null,path['join'](config[_0x3d76('0x2a')],_0x3d76('0x31')));},'filename':function(_0x9494fc,_0x14efcb,_0x2676cf){_0x2676cf(null,util[_0x3d76('0x2c')](_0x3d76('0x32'),Date['now'](),_0x14efcb[_0x3d76('0x2e')]));}})});router[_0x3d76('0x25')](_0x3d76('0x18'),upload[_0x3d76('0x2f')](_0x3d76('0x33')),controller['addSystemAvatar']);router[_0x3d76('0x25')](_0x3d76('0x36'),controller[_0x3d76('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x3d76('0x28')]({'destination':function(_0xf2eb74,_0x18e16f,_0x34ac90){const _0x5dd691=path[_0x3d76('0x29')](config[_0x3d76('0x2a')],'server/files',_0x3d76('0x38'),_0x3d76('0x39'));fs_extra[_0x3d76('0x3a')](_0x5dd691,function(){_0x34ac90(null,_0x5dd691);});},'filename':function(_0x38db14,_0x5181fb,_0x3e17fd){const _0x28d5d5=_0x5181fb[_0x3d76('0x2e')][_0x3d76('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5f3dfd=path['extname'](_0x28d5d5);const _0x137430=Date['now']()+'-'+_0x28d5d5[_0x3d76('0x3b')](_0x5f3dfd,'')+_0x5f3dfd;_0x3e17fd(null,_0x137430);}})});router[_0x3d76('0x25')](_0x3d76('0x3c'),offlineUploadMulter[_0x3d76('0x3d')](),controller[_0x3d76('0x3e')]);router[_0x3d76('0x25')](_0x3d76('0x1a'),auth[_0x3d76('0xa')](),controller['addInteraction']);router[_0x3d76('0x25')](_0x3d76('0x1d'),auth['isAuthenticated'](),controller[_0x3d76('0x3f')]);router['post'](_0x3d76('0x1f'),auth[_0x3d76('0xa')](),controller['addProactiveActions']);router[_0x3d76('0x25')](_0x3d76('0x40'),auth[_0x3d76('0xa')](),controller[_0x3d76('0x41')]);router[_0x3d76('0x42')](_0x3d76('0xd'),auth[_0x3d76('0xa')](),controller[_0x3d76('0x43')]);router['delete'](_0x3d76('0xd'),auth[_0x3d76('0xa')](),controller[_0x3d76('0x44')]);router[_0x3d76('0x45')](_0x3d76('0xf'),auth[_0x3d76('0xa')](),controller[_0x3d76('0x46')]);router[_0x3d76('0x45')](_0x3d76('0x11'),auth[_0x3d76('0xa')](),controller[_0x3d76('0x47')]);router[_0x3d76('0x45')]('/:id/users',auth['isAuthenticated'](),controller[_0x3d76('0x48')]);module['exports']=router; \ No newline at end of file +var _0x0253=['replace','extname','/:id/offline','any','offline','addApplications','/:id/proactive_actions','addProactiveActions','/:id/users','update','delete','destroy','removeDispositions','removeAgents','exports','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','/:id/offline_messages','create','post','/:id/dispositions','/:id/canned_answers','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','diskStorage','server/files/images/avatars/','/:id/avatar','addAvatar','addCustomerAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir'];(function(_0x267584,_0xc122a9){var _0x6a6921=function(_0x2db07c){while(--_0x2db07c){_0x267584['push'](_0x267584['shift']());}};_0x6a6921(++_0xc122a9);}(_0x0253,0x117));var _0x3025=function(_0xebd52f,_0x49f7c3){_0xebd52f=_0xebd52f-0x0;var _0x24dc34=_0x0253[_0xebd52f];return _0x24dc34;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3025('0x0'));var timeout=require('connect-timeout');var express=require(_0x3025('0x1'));var router=express['Router']();var fs_extra=require(_0x3025('0x2'));var auth=require(_0x3025('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3025('0x4'));var controller=require(_0x3025('0x5'));router[_0x3025('0x6')]('/',auth[_0x3025('0x7')](),controller[_0x3025('0x8')]);router[_0x3025('0x6')](_0x3025('0x9'),auth[_0x3025('0x7')](),controller[_0x3025('0xa')]);router['get'](_0x3025('0xb'),auth[_0x3025('0x7')](),controller['show']);router['get']('/:id/dispositions',auth[_0x3025('0x7')](),controller[_0x3025('0xc')]);router['get']('/:id/canned_answers',auth[_0x3025('0x7')](),controller[_0x3025('0xd')]);router[_0x3025('0x6')](_0x3025('0xe'),controller[_0x3025('0xf')]);router[_0x3025('0x6')]('/:id/avatar',controller[_0x3025('0x10')]);router[_0x3025('0x6')](_0x3025('0x11'),controller['getCustomerAvatar']);router['get']('/:id/system_avatar',controller[_0x3025('0x12')]);router['get'](_0x3025('0x13'),auth[_0x3025('0x7')](),controller['getInteractions']);router[_0x3025('0x6')](_0x3025('0x14'),controller[_0x3025('0x15')]);router[_0x3025('0x6')](_0x3025('0x16'),auth[_0x3025('0x7')](),controller[_0x3025('0x17')]);router[_0x3025('0x6')]('/:id/proactive_actions',auth[_0x3025('0x7')](),controller[_0x3025('0x18')]);router['get'](_0x3025('0x19'),controller['getFields']);router[_0x3025('0x6')](_0x3025('0x1a'),auth[_0x3025('0x7')](),controller['getOfflineMessages']);router[_0x3025('0x6')]('/:id/users',auth[_0x3025('0x7')](),controller['getAgents']);router['post']('/',auth[_0x3025('0x7')](),controller[_0x3025('0x1b')]);router[_0x3025('0x1c')](_0x3025('0x1d'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x3025('0x1c')](_0x3025('0x1e'),auth[_0x3025('0x7')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x38f536,_0x70666,_0x31b599){_0x31b599(null,path[_0x3025('0x1f')](config[_0x3025('0x20')],_0x3025('0x21')));},'filename':function(_0xa17e48,_0x34550c,_0x4668e8){_0x4668e8(null,util[_0x3025('0x22')](_0x3025('0x23'),Date[_0x3025('0x24')](),_0x34550c[_0x3025('0x25')]));}})});router[_0x3025('0x1c')](_0x3025('0xe'),upload[_0x3025('0x26')](_0x3025('0x27')),controller['addLogo']);var upload=multer({'storage':multer[_0x3025('0x28')]({'destination':function(_0x98474f,_0x2c3251,_0x2ecc5f){_0x2ecc5f(null,path[_0x3025('0x1f')](config[_0x3025('0x20')],_0x3025('0x29')));},'filename':function(_0x446848,_0x16c1e0,_0x3719ab){_0x3719ab(null,util[_0x3025('0x22')](_0x3025('0x23'),Date[_0x3025('0x24')](),_0x16c1e0['originalname']));}})});router[_0x3025('0x1c')](_0x3025('0x2a'),upload[_0x3025('0x26')]('file'),controller[_0x3025('0x2b')]);var upload=multer({'storage':multer[_0x3025('0x28')]({'destination':function(_0x13ff06,_0x52094e,_0x1c1b97){_0x1c1b97(null,path[_0x3025('0x1f')](config[_0x3025('0x20')],'server/files/images/avatars/'));},'filename':function(_0x5c007f,_0x37d01d,_0x4603b3){_0x4603b3(null,util[_0x3025('0x22')](_0x3025('0x23'),Date[_0x3025('0x24')](),_0x37d01d[_0x3025('0x25')]));}})});router[_0x3025('0x1c')](_0x3025('0x11'),upload[_0x3025('0x26')]('file'),controller[_0x3025('0x2c')]);var upload=multer({'storage':multer[_0x3025('0x28')]({'destination':function(_0x4217b5,_0x2e8c6c,_0x44298d){_0x44298d(null,path[_0x3025('0x1f')](config[_0x3025('0x20')],_0x3025('0x29')));},'filename':function(_0x1fa024,_0x56451c,_0x2d7980){_0x2d7980(null,util[_0x3025('0x22')](_0x3025('0x23'),Date['now'](),_0x56451c[_0x3025('0x25')]));}})});router[_0x3025('0x1c')]('/:id/system_avatar',upload[_0x3025('0x26')](_0x3025('0x27')),controller['addSystemAvatar']);router[_0x3025('0x1c')](_0x3025('0x2d'),controller[_0x3025('0x2e')]);const offlineUploadMulter=multer({'storage':multer[_0x3025('0x28')]({'destination':function(_0x5658c8,_0x55a465,_0x406f53){const _0x49738b=path['join'](config[_0x3025('0x20')],_0x3025('0x2f'),_0x3025('0x30'),_0x3025('0x31'));fs_extra[_0x3025('0x32')](_0x49738b,function(){_0x406f53(null,_0x49738b);});},'filename':function(_0xfe68e4,_0xc6c476,_0x445af4){const _0x587dd2=_0xc6c476[_0x3025('0x25')][_0x3025('0x33')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x101c78=path[_0x3025('0x34')](_0x587dd2);const _0x3efcf1=Date['now']()+'-'+_0x587dd2['replace'](_0x101c78,'')+_0x101c78;_0x445af4(null,_0x3efcf1);}})});router[_0x3025('0x1c')](_0x3025('0x35'),offlineUploadMulter[_0x3025('0x36')](),controller[_0x3025('0x37')]);router[_0x3025('0x1c')](_0x3025('0x13'),auth[_0x3025('0x7')](),controller['addInteraction']);router[_0x3025('0x1c')](_0x3025('0x16'),auth['isAuthenticated'](),controller[_0x3025('0x38')]);router['post'](_0x3025('0x39'),auth[_0x3025('0x7')](),controller[_0x3025('0x3a')]);router[_0x3025('0x1c')](_0x3025('0x3b'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x3025('0xb'),auth[_0x3025('0x7')](),controller[_0x3025('0x3c')]);router[_0x3025('0x3d')]('/:id',auth[_0x3025('0x7')](),controller[_0x3025('0x3e')]);router[_0x3025('0x3d')](_0x3025('0x1d'),auth[_0x3025('0x7')](),controller[_0x3025('0x3f')]);router[_0x3025('0x3d')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x3025('0x3d')](_0x3025('0x3b'),auth[_0x3025('0x7')](),controller[_0x3025('0x40')]);module[_0x3025('0x41')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 6712d1d..c199949 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 _0xc5c8=['sequelize','exports','STRING','AmazonAWS'];(function(_0x4ef724,_0x2eaa8f){var _0x16b426=function(_0x2c336b){while(--_0x2c336b){_0x4ef724['push'](_0x4ef724['shift']());}};_0x16b426(++_0x2eaa8f);}(_0xc5c8,0x118));var _0x8c5c=function(_0x4e8970,_0x3c67c3){_0x4e8970=_0x4e8970-0x0;var _0x477b89=_0xc5c8[_0x4e8970];return _0x477b89;};'use strict';var Sequelize=require(_0x8c5c('0x0'));module[_0x8c5c('0x1')]={'name':{'type':Sequelize[_0x8c5c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x8c5c('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x8c5c('0x2')]}}; \ No newline at end of file +var _0x9b69=['exports','STRING','Google','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9b69,0xa3));var _0x99b6=function(_0x296d3f,_0x36f7b0){_0x296d3f=_0x296d3f-0x0;var _0x3da84c=_0x9b69[_0x296d3f];return _0x3da84c;};'use strict';var Sequelize=require(_0x99b6('0x0'));module[_0x99b6('0x1')]={'name':{'type':Sequelize[_0x99b6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x99b6('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x99b6('0x2')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index ea62333..acc5f21 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 _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','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','CloudProvider','fieldName','type','key'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xadb5,0xad));var _0x5adb=function(_0x2e59a7,_0x1d7aaa){_0x2e59a7=_0x2e59a7-0x0;var _0x486527=_0xadb5[_0x2e59a7];return _0x486527;};'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['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file +var _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x38d095,_0x5addfe){var _0x1701b6=function(_0x4c68b7){while(--_0x4c68b7){_0x38d095['push'](_0x38d095['shift']());}};_0x1701b6(++_0x5addfe);}(_0xdb28,0x106));var _0x8db2=function(_0x4e6e52,_0x2bd34a){_0x4e6e52=_0x4e6e52-0x0;var _0x2d134a=_0xdb28[_0x4e6e52];return _0x2d134a;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 59c0a7e..17ce377 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 _0xa4dc=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','lodash','util'];(function(_0x16697e,_0x112bf8){var _0x218ede=function(_0x1104dd){while(--_0x1104dd){_0x16697e['push'](_0x16697e['shift']());}};_0x218ede(++_0x112bf8);}(_0xa4dc,0x132));var _0xca4d=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xa4dc[_0x616290];return _0x453879;};'use strict';var _=require(_0xca4d('0x0'));var util=require(_0xca4d('0x1'));var logger=require(_0xca4d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xca4d('0x3'));var rp=require(_0xca4d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca4d('0x5'));var config=require(_0xca4d('0x6'));var attributes=require(_0xca4d('0x7'));module[_0xca4d('0x8')]=function(_0x47e48c,_0x1f3390){return _0x47e48c[_0xca4d('0x9')](_0xca4d('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a5f=['bluebird','request-promise','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment'];(function(_0x1aaf7f,_0x1d7b2a){var _0x50db06=function(_0x1348b5){while(--_0x1348b5){_0x1aaf7f['push'](_0x1aaf7f['shift']());}};_0x50db06(++_0x1d7b2a);}(_0x9a5f,0x7d));var _0xf9a5=function(_0x3559c4,_0x47580b){_0x3559c4=_0x3559c4-0x0;var _0x124053=_0x9a5f[_0x3559c4];return _0x124053;};'use strict';var _=require(_0xf9a5('0x0'));var util=require(_0xf9a5('0x1'));var logger=require(_0xf9a5('0x2'))(_0xf9a5('0x3'));var moment=require(_0xf9a5('0x4'));var BPromise=require(_0xf9a5('0x5'));var rp=require(_0xf9a5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf9a5('0x7'));var attributes=require(_0xf9a5('0x8'));module[_0xf9a5('0x9')]=function(_0x10b764,_0x480872){return _0x10b764[_0xf9a5('0xa')](_0xf9a5('0xb'),attributes,{'tableName':_0xf9a5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index a0e15f0..e287ac2 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 _0xf7d9=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x446e7a,_0x373a4b){var _0x31658c=function(_0x5eecb0){while(--_0x5eecb0){_0x446e7a['push'](_0x446e7a['shift']());}};_0x31658c(++_0x373a4b);}(_0xf7d9,0x122));var _0x9f7d=function(_0x3d43a6,_0x278e31){_0x3d43a6=_0x3d43a6-0x0;var _0x412a18=_0xf7d9[_0x3d43a6];return _0x412a18;};'use strict';var _=require(_0x9f7d('0x0'));var util=require(_0x9f7d('0x1'));var moment=require(_0x9f7d('0x2'));var BPromise=require(_0x9f7d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f7d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f7d('0x5'))(_0x9f7d('0x6'));var config=require(_0x9f7d('0x7'));var jayson=require(_0x9f7d('0x8'));var client=jayson[_0x9f7d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc6b9,_0xf09259,_0x2333e8){return new BPromise(function(_0x218628,_0x2893a5){return client[_0x9f7d('0xa')](_0x4dc6b9,_0x2333e8)[_0x9f7d('0xb')](function(_0x5290e2){logger[_0x9f7d('0xc')](_0x9f7d('0xd'),_0xf09259,'request\x20sent');logger[_0x9f7d('0xe')](_0x9f7d('0xf'),_0xf09259,_0x9f7d('0x10'),JSON['stringify'](_0x5290e2));if(_0x5290e2[_0x9f7d('0x11')]){if(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x12')]===0x1f4){logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x5290e2[_0x9f7d('0x11')]['message']);return _0x2893a5(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x13')]);}logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x5290e2['error'][_0x9f7d('0x13')]);return _0x218628(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x13')]);}else{logger[_0x9f7d('0xc')](_0x9f7d('0xd'),_0xf09259,_0x9f7d('0x10'));_0x218628(_0x5290e2[_0x9f7d('0x14')]['message']);}})['catch'](function(_0x402609){logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x402609);_0x2893a5(_0x402609);});});} \ No newline at end of file +var _0x18f3=['rpc','../../config/environment','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x18f3,0x19f));var _0x318f=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x18f3[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x318f('0x0'));var moment=require(_0x318f('0x1'));var BPromise=require(_0x318f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x318f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x318f('0x4'))(_0x318f('0x5'));var config=require(_0x318f('0x6'));var jayson=require(_0x318f('0x7'));var client=jayson['client'][_0x318f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3579e8,_0x49188c,_0x59abcf){return new BPromise(function(_0x4618c1,_0x547785){return client[_0x318f('0x9')](_0x3579e8,_0x59abcf)[_0x318f('0xa')](function(_0x1479df){logger[_0x318f('0xb')](_0x318f('0xc'),_0x49188c,_0x318f('0xd'));logger[_0x318f('0xe')](_0x318f('0xf'),_0x49188c,_0x318f('0xd'),JSON[_0x318f('0x10')](_0x1479df));if(_0x1479df[_0x318f('0x11')]){if(_0x1479df[_0x318f('0x11')][_0x318f('0x12')]===0x1f4){logger[_0x318f('0x11')](_0x318f('0xc'),_0x49188c,_0x1479df['error']['message']);return _0x547785(_0x1479df[_0x318f('0x11')][_0x318f('0x13')]);}logger[_0x318f('0x11')](_0x318f('0xc'),_0x49188c,_0x1479df[_0x318f('0x11')][_0x318f('0x13')]);return _0x4618c1(_0x1479df[_0x318f('0x11')]['message']);}else{logger[_0x318f('0xb')]('CloudProvider,\x20%s,\x20%s',_0x49188c,'request\x20sent');_0x4618c1(_0x1479df[_0x318f('0x14')][_0x318f('0x13')]);}})['catch'](function(_0x594af8){logger[_0x318f('0x11')]('CloudProvider,\x20%s,\x20%s',_0x49188c,_0x594af8);_0x547785(_0x594af8);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 03459c5..7fb79b2 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 _0x218e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x24f870,_0x2c8a88){var _0x5d065b=function(_0x168247){while(--_0x168247){_0x24f870['push'](_0x24f870['shift']());}};_0x5d065b(++_0x2c8a88);}(_0x218e,0x1c8));var _0xe218=function(_0x348854,_0x152055){_0x348854=_0x348854-0x0;var _0x33cd93=_0x218e[_0x348854];return _0x33cd93;};'use strict';var multer=require(_0xe218('0x0'));var util=require(_0xe218('0x1'));var path=require(_0xe218('0x2'));var timeout=require(_0xe218('0x3'));var express=require(_0xe218('0x4'));var router=express[_0xe218('0x5')]();var fs_extra=require(_0xe218('0x6'));var auth=require(_0xe218('0x7'));var interaction=require(_0xe218('0x8'));var config=require('../../config/environment');var controller=require(_0xe218('0x9'));router[_0xe218('0xa')]('/',auth[_0xe218('0xb')](),controller['index']);router['get'](_0xe218('0xc'),auth[_0xe218('0xb')](),controller[_0xe218('0xd')]);router[_0xe218('0xe')]('/',auth[_0xe218('0xb')](),controller[_0xe218('0xf')]);router['put'](_0xe218('0xc'),auth['isAuthenticated'](),controller[_0xe218('0x10')]);router[_0xe218('0x11')](_0xe218('0xc'),auth['isAuthenticated'](),controller[_0xe218('0x12')]);module[_0xe218('0x13')]=router; \ No newline at end of file +var _0x3351=['isAuthenticated','index','/:id','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cloudProvider.controller'];(function(_0x1d3319,_0x31ae54){var _0x3349d9=function(_0x31b9fa){while(--_0x31b9fa){_0x1d3319['push'](_0x1d3319['shift']());}};_0x3349d9(++_0x31ae54);}(_0x3351,0x116));var _0x1335=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x3351[_0x373dee];return _0x46798f;};'use strict';var multer=require(_0x1335('0x0'));var util=require(_0x1335('0x1'));var path=require(_0x1335('0x2'));var timeout=require(_0x1335('0x3'));var express=require(_0x1335('0x4'));var router=express[_0x1335('0x5')]();var fs_extra=require(_0x1335('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1335('0x7'));var config=require(_0x1335('0x8'));var controller=require(_0x1335('0x9'));router['get']('/',auth[_0x1335('0xa')](),controller[_0x1335('0xb')]);router['get'](_0x1335('0xc'),auth['isAuthenticated'](),controller[_0x1335('0xd')]);router[_0x1335('0xe')]('/',auth[_0x1335('0xa')](),controller['create']);router[_0x1335('0xf')]('/:id',auth[_0x1335('0xa')](),controller[_0x1335('0x10')]);router['delete']('/:id',auth[_0x1335('0xa')](),controller[_0x1335('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index baa45f4..777ae2e 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 _0xbb97=['exports','STRING','name'];(function(_0x32ada1,_0xc2a521){var _0x4edb29=function(_0x2d36dc){while(--_0x2d36dc){_0x32ada1['push'](_0x32ada1['shift']());}};_0x4edb29(++_0xc2a521);}(_0xbb97,0xa8));var _0x7bb9=function(_0x36119b,_0x319337){_0x36119b=_0x36119b-0x0;var _0x13dff8=_0xbb97[_0x36119b];return _0x13dff8;};'use strict';var Sequelize=require('sequelize');module[_0x7bb9('0x0')]={'name':{'type':Sequelize[_0x7bb9('0x1')],'unique':_0x7bb9('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7bb9('0x1')]},'companyId':{'type':Sequelize[_0x7bb9('0x1')]},'website':{'type':Sequelize[_0x7bb9('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7bb9('0x1')]},'street':{'type':Sequelize[_0x7bb9('0x1')]},'postalCode':{'type':Sequelize[_0x7bb9('0x1')]},'city':{'type':Sequelize[_0x7bb9('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7bb9('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x7bb9('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x7bb9('0x1')]},'sCity':{'type':Sequelize[_0x7bb9('0x1')]},'sCountry':{'type':Sequelize[_0x7bb9('0x1')]},'description':{'type':Sequelize[_0x7bb9('0x1')]}}; \ No newline at end of file +var _0xa8b1=['sequelize','STRING','name'];(function(_0x432262,_0xe5e597){var _0x5e5ee1=function(_0xaf90d6){while(--_0xaf90d6){_0x432262['push'](_0x432262['shift']());}};_0x5e5ee1(++_0xe5e597);}(_0xa8b1,0xae));var _0x1a8b=function(_0x44bf9f,_0x12af43){_0x44bf9f=_0x44bf9f-0x0;var _0x1f00d3=_0xa8b1[_0x44bf9f];return _0x1f00d3;};'use strict';var Sequelize=require(_0x1a8b('0x0'));module['exports']={'name':{'type':Sequelize[_0x1a8b('0x1')],'unique':_0x1a8b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1a8b('0x1')]},'companyId':{'type':Sequelize[_0x1a8b('0x1')]},'website':{'type':Sequelize[_0x1a8b('0x1')]},'phone':{'type':Sequelize[_0x1a8b('0x1')]},'fax':{'type':Sequelize[_0x1a8b('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x1a8b('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1a8b('0x1')]},'country':{'type':Sequelize[_0x1a8b('0x1')]},'email':{'type':Sequelize[_0x1a8b('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1a8b('0x1')]},'sStreet':{'type':Sequelize[_0x1a8b('0x1')]},'sPostalCode':{'type':Sequelize[_0x1a8b('0x1')]},'sCity':{'type':Sequelize[_0x1a8b('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1a8b('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 2c95ade..3d62ce3 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 _0x9e56=['rows','catch','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','describe','addContacts','CmContact','ids','omit','getContacts','findOne','order','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','end','stack','name','send','index','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','offset','sort','where','pick','merge','map','filter','include','CmCompany'];(function(_0x50ab87,_0x21a433){var _0x47b30d=function(_0xa3385){while(--_0xa3385){_0x50ab87['push'](_0x50ab87['shift']());}};_0x47b30d(++_0x21a433);}(_0x9e56,0x1a2));var _0x69e5=function(_0x3cb09b,_0x31c2a5){_0x3cb09b=_0x3cb09b-0x0;var _0x242048=_0x9e56[_0x3cb09b];return _0x242048;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x69e5('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x69e5('0x1'));var moment=require(_0x69e5('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x69e5('0x3'));var util=require('util');var path=require('path');var sox=require(_0x69e5('0x4'));var csv=require(_0x69e5('0x5'));var ejs=require(_0x69e5('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x69e5('0x7'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x69e5('0x8'));var authService=require(_0x69e5('0x9'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x69e5('0xa'));var logger=require(_0x69e5('0xb'))(_0x69e5('0xc'));var utils=require(_0x69e5('0xd'));var config=require('../../config/environment');var licenseUtil=require(_0x69e5('0xe'));var db=require(_0x69e5('0xf'))['db'];function respondWithStatusCode(_0x1a0807,_0x1adb78){_0x1adb78=_0x1adb78||0xcc;return function(_0x10d00b){if(_0x10d00b){return _0x1a0807[_0x69e5('0x10')](_0x1adb78);}return _0x1a0807[_0x69e5('0x11')](_0x1adb78)['end']();};}function respondWithResult(_0x4bc3d8,_0x56ba97){_0x56ba97=_0x56ba97||0xc8;return function(_0xe8390){if(_0xe8390){return _0x4bc3d8['status'](_0x56ba97)[_0x69e5('0x12')](_0xe8390);}};}function respondWithFilteredResult(_0x4b98b3,_0x49f035){return function(_0x536a39){if(_0x536a39){var _0x281f86=typeof _0x49f035['offset']===_0x69e5('0x13')&&typeof _0x49f035[_0x69e5('0x14')]===_0x69e5('0x13');var _0x32fbb9=_0x536a39[_0x69e5('0x15')];var _0x205376=_0x281f86?0x0:_0x49f035['offset'];var _0x9a9481=_0x281f86?_0x536a39[_0x69e5('0x15')]:_0x49f035['offset']+_0x49f035['limit'];var _0x1a741a;if(_0x9a9481>=_0x32fbb9){_0x9a9481=_0x32fbb9;_0x1a741a=0xc8;}else{_0x1a741a=0xce;}_0x4b98b3['status'](_0x1a741a);return _0x4b98b3[_0x69e5('0x16')](_0x69e5('0x17'),_0x205376+'-'+_0x9a9481+'/'+_0x32fbb9)[_0x69e5('0x12')](_0x536a39);}return null;};}function patchUpdates(_0x5e1f3c){return function(_0x35a710){try{jsonpatch[_0x69e5('0x18')](_0x35a710,_0x5e1f3c,!![]);}catch(_0x1b645a){return BPromise[_0x69e5('0x19')](_0x1b645a);}return _0x35a710[_0x69e5('0x1a')]();};}function saveUpdates(_0x4bf57e,_0x89721d){return function(_0xae8c3d){if(_0xae8c3d){return _0xae8c3d[_0x69e5('0x1b')](_0x4bf57e)[_0x69e5('0x1c')](function(_0x35967f){return _0x35967f;});}return null;};}function removeEntity(_0x14f2a6,_0x4a40ae){return function(_0x354cc2){if(_0x354cc2){return _0x354cc2[_0x69e5('0x1d')]()[_0x69e5('0x1c')](function(){var _0xe0a107=_0x354cc2[_0x69e5('0x1e')]({'plain':!![]});var _0x646f2f=_0x69e5('0x1f');return db[_0x69e5('0x20')][_0x69e5('0x1d')]({'where':{'type':_0x646f2f,'resourceId':_0xe0a107['id']}})['then'](function(){return _0x354cc2;});})['then'](function(){_0x14f2a6['status'](0xcc)[_0x69e5('0x21')]();});}};}function handleEntityNotFound(_0x33a406,_0x505c66){return function(_0x3d7c60){if(!_0x3d7c60){_0x33a406[_0x69e5('0x10')](0x194);}return _0x3d7c60;};}function handleError(_0x5b3272,_0x31d8e8){_0x31d8e8=_0x31d8e8||0x1f4;return function(_0x424e1a){logger['error'](_0x424e1a[_0x69e5('0x22')]);if(_0x424e1a[_0x69e5('0x23')]){delete _0x424e1a[_0x69e5('0x23')];}_0x5b3272[_0x69e5('0x11')](_0x31d8e8)[_0x69e5('0x24')](_0x424e1a);};}exports[_0x69e5('0x25')]=function(_0x89ccda,_0x29b883){var _0x6c5652={},_0x217f8c={},_0x407fa5={'count':0x0,'rows':[]};return db['CmCompany']['describe']()['then'](function(_0x26cc80){_0x217f8c[_0x69e5('0x26')]=_[_0x69e5('0x27')](_0x26cc80);_0x217f8c[_0x69e5('0x28')]=_[_0x69e5('0x27')](_0x89ccda[_0x69e5('0x28')]);_0x217f8c[_0x69e5('0x29')]=_[_0x69e5('0x2a')](_0x217f8c[_0x69e5('0x26')],_0x217f8c[_0x69e5('0x28')]);_0x6c5652['attributes']=_[_0x69e5('0x2a')](_0x217f8c[_0x69e5('0x26')],qs[_0x69e5('0x2b')](_0x89ccda[_0x69e5('0x28')][_0x69e5('0x2b')]));_0x6c5652[_0x69e5('0x2c')]=_0x6c5652['attributes'][_0x69e5('0x2d')]?_0x6c5652[_0x69e5('0x2c')]:_0x217f8c[_0x69e5('0x26')];if(!_0x89ccda[_0x69e5('0x28')][_0x69e5('0x2e')]('nolimit')){_0x6c5652[_0x69e5('0x14')]=qs['limit'](_0x89ccda['query']['limit']);_0x6c5652[_0x69e5('0x2f')]=qs[_0x69e5('0x2f')](_0x89ccda[_0x69e5('0x28')][_0x69e5('0x2f')]);}_0x6c5652['order']=qs['sort'](_0x89ccda[_0x69e5('0x28')][_0x69e5('0x30')]);_0x6c5652[_0x69e5('0x31')]=qs[_0x69e5('0x29')](_[_0x69e5('0x32')](_0x89ccda[_0x69e5('0x28')],_0x217f8c[_0x69e5('0x29')]),_0x26cc80);if(_0x89ccda['query']['filter']){_0x6c5652['where']=_[_0x69e5('0x33')](_0x6c5652[_0x69e5('0x31')],{'$or':_[_0x69e5('0x34')](_0x6c5652[_0x69e5('0x2c')],function(_0x4f83f2){var _0x1307cb={};_0x1307cb[_0x4f83f2]={'$like':'%'+_0x89ccda[_0x69e5('0x28')][_0x69e5('0x35')]+'%'};return _0x1307cb;})});}_0x6c5652=_[_0x69e5('0x33')]({},_0x6c5652,_0x89ccda['options']);var _0x335a53={'where':_0x6c5652[_0x69e5('0x31')]};return db['CmCompany'][_0x69e5('0x15')](_0x335a53)[_0x69e5('0x1c')](function(_0x3aa5da){_0x407fa5[_0x69e5('0x15')]=_0x3aa5da;if(_0x89ccda[_0x69e5('0x28')]['includeAll']){_0x6c5652[_0x69e5('0x36')]=[{'all':!![]}];}return db[_0x69e5('0x37')]['findAll'](_0x6c5652);})['then'](function(_0x132ce9){_0x407fa5[_0x69e5('0x38')]=_0x132ce9;return _0x407fa5;})['then'](respondWithFilteredResult(_0x29b883,_0x6c5652))['catch'](handleError(_0x29b883,null));})[_0x69e5('0x39')](handleError(_0x29b883,null));};exports['show']=function(_0x4127d2,_0x529481){var _0x5874a9={'raw':![],'where':{'id':_0x4127d2[_0x69e5('0x3a')]['id']}},_0x27ce1d={};_0x27ce1d[_0x69e5('0x26')]=_[_0x69e5('0x27')](db[_0x69e5('0x37')]['rawAttributes']);_0x27ce1d[_0x69e5('0x28')]=_[_0x69e5('0x27')](_0x4127d2[_0x69e5('0x28')]);_0x27ce1d[_0x69e5('0x29')]=_[_0x69e5('0x2a')](_0x27ce1d[_0x69e5('0x26')],_0x27ce1d['query']);_0x5874a9['attributes']=_[_0x69e5('0x2a')](_0x27ce1d[_0x69e5('0x26')],qs[_0x69e5('0x2b')](_0x4127d2[_0x69e5('0x28')][_0x69e5('0x2b')]));_0x5874a9[_0x69e5('0x2c')]=_0x5874a9[_0x69e5('0x2c')]['length']?_0x5874a9[_0x69e5('0x2c')]:_0x27ce1d[_0x69e5('0x26')];if(_0x4127d2[_0x69e5('0x28')][_0x69e5('0x3b')]){_0x5874a9['include']=[{'all':!![]}];}_0x5874a9=_['merge']({},_0x5874a9,_0x4127d2[_0x69e5('0x3c')]);return db[_0x69e5('0x37')][_0x69e5('0x3d')](_0x5874a9)[_0x69e5('0x1c')](handleEntityNotFound(_0x529481,null))['then'](respondWithResult(_0x529481,null))[_0x69e5('0x39')](handleError(_0x529481,null));};exports[_0x69e5('0x3e')]=function(_0x35c1e3,_0x44fcf8){return db[_0x69e5('0x37')]['create'](_0x35c1e3[_0x69e5('0x3f')],{})[_0x69e5('0x1c')](function(_0x2943be){var _0x56aed1=_0x35c1e3[_0x69e5('0x40')][_0x69e5('0x1e')]({'plain':!![]});if(!_0x56aed1)throw new Error(_0x69e5('0x41'));if(_0x56aed1[_0x69e5('0x42')]===_0x69e5('0x40')){var _0x4f60e8=_0x2943be['get']({'plain':!![]});var _0x271293=_0x69e5('0x1f');return db[_0x69e5('0x43')]['find']({'where':{'name':_0x271293,'userProfileId':_0x56aed1[_0x69e5('0x44')]},'raw':!![]})['then'](function(_0x10862e){if(_0x10862e&&_0x10862e[_0x69e5('0x45')]===0x0){return db[_0x69e5('0x20')][_0x69e5('0x3e')]({'name':_0x4f60e8[_0x69e5('0x23')],'resourceId':_0x4f60e8['id'],'type':_0x10862e[_0x69e5('0x23')],'sectionId':_0x10862e['id']},{})['then'](function(){return _0x2943be;});}else{return _0x2943be;}})[_0x69e5('0x39')](function(_0x58813f){logger[_0x69e5('0x46')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58813f);throw _0x58813f;});}return _0x2943be;})[_0x69e5('0x1c')](respondWithResult(_0x44fcf8,0xc9))[_0x69e5('0x39')](handleError(_0x44fcf8,null));};exports[_0x69e5('0x1b')]=function(_0x54614f,_0x2da748){if(_0x54614f[_0x69e5('0x3f')]['id']){delete _0x54614f[_0x69e5('0x3f')]['id'];}return db['CmCompany'][_0x69e5('0x3d')]({'where':{'id':_0x54614f[_0x69e5('0x3a')]['id']}})[_0x69e5('0x1c')](handleEntityNotFound(_0x2da748,null))[_0x69e5('0x1c')](saveUpdates(_0x54614f[_0x69e5('0x3f')],null))[_0x69e5('0x1c')](respondWithResult(_0x2da748,null))['catch'](handleError(_0x2da748,null));};exports[_0x69e5('0x1d')]=function(_0x3d095d,_0x31b2e2){return db['CmCompany']['find']({'where':{'id':_0x3d095d[_0x69e5('0x3a')]['id']}})['then'](handleEntityNotFound(_0x31b2e2,null))[_0x69e5('0x1c')](removeEntity(_0x31b2e2,null))[_0x69e5('0x39')](handleError(_0x31b2e2,null));};exports[_0x69e5('0x47')]=function(_0x4df9b2,_0xc916e6){return db['CmCompany'][_0x69e5('0x47')]()[_0x69e5('0x1c')](respondWithResult(_0xc916e6,null))[_0x69e5('0x39')](handleError(_0xc916e6,null));};exports[_0x69e5('0x48')]=function(_0x583480,_0x1bb4b1,_0x12bf0e){return db[_0x69e5('0x49')][_0x69e5('0x3d')]({'where':{'id':_0x583480[_0x69e5('0x3a')]['id']}})[_0x69e5('0x1c')](handleEntityNotFound(_0x1bb4b1,null))[_0x69e5('0x1c')](function(_0x3e819d){if(_0x3e819d){return _0x3e819d[_0x69e5('0x48')](_0x583480['body'][_0x69e5('0x4a')],_[_0x69e5('0x4b')](_0x583480['body'],[_0x69e5('0x4a'),'id'])||{});}})[_0x69e5('0x1c')](respondWithResult(_0x1bb4b1,null))[_0x69e5('0x39')](handleError(_0x1bb4b1,null));};exports[_0x69e5('0x4c')]=function(_0x2836ca,_0x2010b7,_0xe12d1){var _0x5e7ca0={};var _0x6f88fa={};var _0x189e31;var _0x30e82f;return db[_0x69e5('0x37')][_0x69e5('0x4d')]({'where':{'id':_0x2836ca[_0x69e5('0x3a')]['id']}})[_0x69e5('0x1c')](handleEntityNotFound(_0x2010b7,null))[_0x69e5('0x1c')](function(_0x1b00ce){if(_0x1b00ce){_0x189e31=_0x1b00ce;_0x6f88fa[_0x69e5('0x26')]=_[_0x69e5('0x27')](db[_0x69e5('0x49')]['rawAttributes']);_0x6f88fa['query']=_['keys'](_0x2836ca['query']);_0x6f88fa[_0x69e5('0x29')]=_[_0x69e5('0x2a')](_0x6f88fa[_0x69e5('0x26')],_0x6f88fa[_0x69e5('0x28')]);_0x5e7ca0[_0x69e5('0x2c')]=_[_0x69e5('0x2a')](_0x6f88fa['model'],qs[_0x69e5('0x2b')](_0x2836ca['query']['fields']));_0x5e7ca0[_0x69e5('0x2c')]=_0x5e7ca0[_0x69e5('0x2c')][_0x69e5('0x2d')]?_0x5e7ca0[_0x69e5('0x2c')]:_0x6f88fa[_0x69e5('0x26')];_0x5e7ca0[_0x69e5('0x4e')]=qs[_0x69e5('0x30')](_0x2836ca[_0x69e5('0x28')][_0x69e5('0x30')]);_0x5e7ca0[_0x69e5('0x31')]=qs[_0x69e5('0x29')](_['pick'](_0x2836ca[_0x69e5('0x28')],_0x6f88fa[_0x69e5('0x29')]));if(_0x2836ca['query'][_0x69e5('0x35')]){_0x5e7ca0[_0x69e5('0x31')]=_[_0x69e5('0x33')](_0x5e7ca0[_0x69e5('0x31')],{'$or':_[_0x69e5('0x34')](_0x5e7ca0[_0x69e5('0x2c')],function(_0x420ed7){var _0x3f3085={};_0x3f3085[_0x420ed7]={'$like':'%'+_0x2836ca[_0x69e5('0x28')]['filter']+'%'};return _0x3f3085;})});}_0x5e7ca0=_['merge']({},_0x5e7ca0,_0x2836ca[_0x69e5('0x3c')]);return _0x189e31['getContacts'](_0x5e7ca0);}})[_0x69e5('0x1c')](function(_0x23d710){if(_0x23d710){_0x30e82f=_0x23d710[_0x69e5('0x2d')];if(!_0x2836ca[_0x69e5('0x28')][_0x69e5('0x2e')]('nolimit')){_0x5e7ca0['limit']=qs[_0x69e5('0x14')](_0x2836ca[_0x69e5('0x28')][_0x69e5('0x14')]);_0x5e7ca0[_0x69e5('0x2f')]=qs['offset'](_0x2836ca['query']['offset']);}return _0x189e31[_0x69e5('0x4c')](_0x5e7ca0);}})[_0x69e5('0x1c')](function(_0x5916db){if(_0x5916db){return _0x5916db?{'count':_0x30e82f,'rows':_0x5916db}:null;}})[_0x69e5('0x1c')](respondWithResult(_0x2010b7,null))['catch'](handleError(_0x2010b7,null));}; \ No newline at end of file +var _0x4328=['fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','eml-format','rimraf','zip-dir'];(function(_0x3a710f,_0x1b30bc){var _0x552589=function(_0xe3d7ae){while(--_0xe3d7ae){_0x3a710f['push'](_0x3a710f['shift']());}};_0x552589(++_0x1b30bc);}(_0x4328,0x105));var _0x8432=function(_0x1b4e57,_0x3a381b){_0x1b4e57=_0x1b4e57-0x0;var _0x3b3f6e=_0x4328[_0x1b4e57];return _0x3b3f6e;};'use strict';var emlformat=require(_0x8432('0x0'));var rimraf=require(_0x8432('0x1'));var zipdir=require(_0x8432('0x2'));var jsonpatch=require(_0x8432('0x3'));var rp=require(_0x8432('0x4'));var moment=require('moment');var BPromise=require(_0x8432('0x5'));var Mustache=require('mustache');var util=require(_0x8432('0x6'));var path=require('path');var sox=require(_0x8432('0x7'));var csv=require(_0x8432('0x8'));var ejs=require(_0x8432('0x9'));var fs=require('fs');var fs_extra=require(_0x8432('0xa'));var _=require(_0x8432('0xb'));var squel=require(_0x8432('0xc'));var crypto=require(_0x8432('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8432('0x8'));var querystring=require(_0x8432('0xe'));var Papa=require(_0x8432('0xf'));var Redis=require(_0x8432('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8432('0x11'));var as=require(_0x8432('0x12'));var hardwareService=require(_0x8432('0x13'));var logger=require(_0x8432('0x14'))(_0x8432('0x15'));var utils=require(_0x8432('0x16'));var config=require(_0x8432('0x17'));var licenseUtil=require(_0x8432('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48f1f4,_0x4b43e1){_0x4b43e1=_0x4b43e1||0xcc;return function(_0x477446){if(_0x477446){return _0x48f1f4[_0x8432('0x19')](_0x4b43e1);}return _0x48f1f4['status'](_0x4b43e1)[_0x8432('0x1a')]();};}function respondWithResult(_0x24ef11,_0x404dea){_0x404dea=_0x404dea||0xc8;return function(_0x436f28){if(_0x436f28){return _0x24ef11[_0x8432('0x1b')](_0x404dea)[_0x8432('0x1c')](_0x436f28);}};}function respondWithFilteredResult(_0x1182fa,_0x202420){return function(_0x1f72f9){if(_0x1f72f9){var _0x56864b=typeof _0x202420[_0x8432('0x1d')]==='undefined'&&typeof _0x202420[_0x8432('0x1e')]===_0x8432('0x1f');var _0x2d147a=_0x1f72f9[_0x8432('0x20')];var _0x5c439f=_0x56864b?0x0:_0x202420['offset'];var _0xc2913e=_0x56864b?_0x1f72f9['count']:_0x202420['offset']+_0x202420[_0x8432('0x1e')];var _0x4347e2;if(_0xc2913e>=_0x2d147a){_0xc2913e=_0x2d147a;_0x4347e2=0xc8;}else{_0x4347e2=0xce;}_0x1182fa[_0x8432('0x1b')](_0x4347e2);return _0x1182fa[_0x8432('0x21')]('Content-Range',_0x5c439f+'-'+_0xc2913e+'/'+_0x2d147a)[_0x8432('0x1c')](_0x1f72f9);}return null;};}function patchUpdates(_0x4a7ee3){return function(_0x4656d1){try{jsonpatch[_0x8432('0x22')](_0x4656d1,_0x4a7ee3,!![]);}catch(_0x195e60){return BPromise[_0x8432('0x23')](_0x195e60);}return _0x4656d1[_0x8432('0x24')]();};}function saveUpdates(_0x2f4252,_0x223d9a){return function(_0x36d82b){if(_0x36d82b){return _0x36d82b[_0x8432('0x25')](_0x2f4252)[_0x8432('0x26')](function(_0x492883){return _0x492883;});}return null;};}function removeEntity(_0x2bc8dd,_0x5c8fce){return function(_0x57a686){if(_0x57a686){return _0x57a686[_0x8432('0x27')]()[_0x8432('0x26')](function(){var _0x160dac=_0x57a686[_0x8432('0x28')]({'plain':!![]});var _0x46201b='Companies';return db[_0x8432('0x29')]['destroy']({'where':{'type':_0x46201b,'resourceId':_0x160dac['id']}})[_0x8432('0x26')](function(){return _0x57a686;});})[_0x8432('0x26')](function(){_0x2bc8dd[_0x8432('0x1b')](0xcc)[_0x8432('0x1a')]();});}};}function handleEntityNotFound(_0x1f69f2,_0x52a958){return function(_0x4e2a83){if(!_0x4e2a83){_0x1f69f2[_0x8432('0x19')](0x194);}return _0x4e2a83;};}function handleError(_0x1f1dbe,_0x11a6bc){_0x11a6bc=_0x11a6bc||0x1f4;return function(_0x568c9d){logger[_0x8432('0x2a')](_0x568c9d[_0x8432('0x2b')]);if(_0x568c9d[_0x8432('0x2c')]){delete _0x568c9d['name'];}_0x1f1dbe['status'](_0x11a6bc)[_0x8432('0x2d')](_0x568c9d);};}exports[_0x8432('0x2e')]=function(_0x206686,_0x530182){var _0x2c4924={},_0x53e3ba={},_0x46318e={'count':0x0,'rows':[]};return db[_0x8432('0x2f')][_0x8432('0x30')]()[_0x8432('0x26')](function(_0x2c0120){_0x53e3ba[_0x8432('0x31')]=_['keys'](_0x2c0120);_0x53e3ba[_0x8432('0x32')]=_[_0x8432('0x33')](_0x206686[_0x8432('0x32')]);_0x53e3ba[_0x8432('0x34')]=_[_0x8432('0x35')](_0x53e3ba['model'],_0x53e3ba[_0x8432('0x32')]);_0x2c4924[_0x8432('0x36')]=_['intersection'](_0x53e3ba[_0x8432('0x31')],qs[_0x8432('0x37')](_0x206686[_0x8432('0x32')][_0x8432('0x37')]));_0x2c4924[_0x8432('0x36')]=_0x2c4924['attributes'][_0x8432('0x38')]?_0x2c4924['attributes']:_0x53e3ba[_0x8432('0x31')];if(!_0x206686[_0x8432('0x32')][_0x8432('0x39')](_0x8432('0x3a'))){_0x2c4924[_0x8432('0x1e')]=qs['limit'](_0x206686[_0x8432('0x32')]['limit']);_0x2c4924[_0x8432('0x1d')]=qs[_0x8432('0x1d')](_0x206686['query']['offset']);}_0x2c4924[_0x8432('0x3b')]=qs[_0x8432('0x3c')](_0x206686['query'][_0x8432('0x3c')]);_0x2c4924[_0x8432('0x3d')]=qs['filters'](_[_0x8432('0x3e')](_0x206686[_0x8432('0x32')],_0x53e3ba[_0x8432('0x34')]),_0x2c0120);if(_0x206686[_0x8432('0x32')]['filter']){_0x2c4924[_0x8432('0x3d')]=_[_0x8432('0x3f')](_0x2c4924[_0x8432('0x3d')],{'$or':_[_0x8432('0x40')](_0x2c4924['attributes'],function(_0x517aa3){var _0x37e62f={};_0x37e62f[_0x517aa3]={'$like':'%'+_0x206686['query'][_0x8432('0x41')]+'%'};return _0x37e62f;})});}_0x2c4924=_[_0x8432('0x3f')]({},_0x2c4924,_0x206686[_0x8432('0x42')]);var _0x58aee2={'where':_0x2c4924[_0x8432('0x3d')]};return db[_0x8432('0x2f')][_0x8432('0x20')](_0x58aee2)['then'](function(_0x735156){_0x46318e[_0x8432('0x20')]=_0x735156;if(_0x206686[_0x8432('0x32')][_0x8432('0x43')]){_0x2c4924[_0x8432('0x44')]=[{'all':!![]}];}return db[_0x8432('0x2f')][_0x8432('0x45')](_0x2c4924);})[_0x8432('0x26')](function(_0x3ad291){_0x46318e[_0x8432('0x46')]=_0x3ad291;return _0x46318e;})[_0x8432('0x26')](respondWithFilteredResult(_0x530182,_0x2c4924))[_0x8432('0x47')](handleError(_0x530182,null));})[_0x8432('0x47')](handleError(_0x530182,null));};exports[_0x8432('0x48')]=function(_0x1a5d35,_0x49d793){var _0x5e4919={'raw':![],'where':{'id':_0x1a5d35[_0x8432('0x49')]['id']}},_0x5b14a8={};_0x5b14a8[_0x8432('0x31')]=_[_0x8432('0x33')](db[_0x8432('0x2f')][_0x8432('0x4a')]);_0x5b14a8[_0x8432('0x32')]=_[_0x8432('0x33')](_0x1a5d35[_0x8432('0x32')]);_0x5b14a8[_0x8432('0x34')]=_[_0x8432('0x35')](_0x5b14a8['model'],_0x5b14a8[_0x8432('0x32')]);_0x5e4919['attributes']=_[_0x8432('0x35')](_0x5b14a8[_0x8432('0x31')],qs[_0x8432('0x37')](_0x1a5d35[_0x8432('0x32')][_0x8432('0x37')]));_0x5e4919[_0x8432('0x36')]=_0x5e4919['attributes'][_0x8432('0x38')]?_0x5e4919[_0x8432('0x36')]:_0x5b14a8[_0x8432('0x31')];if(_0x1a5d35[_0x8432('0x32')][_0x8432('0x43')]){_0x5e4919[_0x8432('0x44')]=[{'all':!![]}];}_0x5e4919=_[_0x8432('0x3f')]({},_0x5e4919,_0x1a5d35[_0x8432('0x42')]);return db[_0x8432('0x2f')][_0x8432('0x4b')](_0x5e4919)[_0x8432('0x26')](handleEntityNotFound(_0x49d793,null))[_0x8432('0x26')](respondWithResult(_0x49d793,null))[_0x8432('0x47')](handleError(_0x49d793,null));};exports['create']=function(_0x271cd9,_0x936b61){return db[_0x8432('0x2f')][_0x8432('0x4c')](_0x271cd9[_0x8432('0x4d')],{})[_0x8432('0x26')](function(_0x3359aa){var _0xd5270d=_0x271cd9[_0x8432('0x4e')][_0x8432('0x28')]({'plain':!![]});if(!_0xd5270d)throw new Error(_0x8432('0x4f'));if(_0xd5270d['role']==='user'){var _0x2f2217=_0x3359aa['get']({'plain':!![]});var _0x3b9a2e=_0x8432('0x50');return db[_0x8432('0x51')][_0x8432('0x4b')]({'where':{'name':_0x3b9a2e,'userProfileId':_0xd5270d['userProfileId']},'raw':!![]})[_0x8432('0x26')](function(_0x414a79){if(_0x414a79&&_0x414a79['autoAssociation']===0x0){return db[_0x8432('0x29')][_0x8432('0x4c')]({'name':_0x2f2217[_0x8432('0x2c')],'resourceId':_0x2f2217['id'],'type':_0x414a79[_0x8432('0x2c')],'sectionId':_0x414a79['id']},{})[_0x8432('0x26')](function(){return _0x3359aa;});}else{return _0x3359aa;}})[_0x8432('0x47')](function(_0x1e765c){logger[_0x8432('0x2a')](_0x8432('0x52'),_0x1e765c);throw _0x1e765c;});}return _0x3359aa;})[_0x8432('0x26')](respondWithResult(_0x936b61,0xc9))[_0x8432('0x47')](handleError(_0x936b61,null));};exports[_0x8432('0x25')]=function(_0x18d4e6,_0x371ada){if(_0x18d4e6['body']['id']){delete _0x18d4e6[_0x8432('0x4d')]['id'];}return db[_0x8432('0x2f')][_0x8432('0x4b')]({'where':{'id':_0x18d4e6[_0x8432('0x49')]['id']}})[_0x8432('0x26')](handleEntityNotFound(_0x371ada,null))[_0x8432('0x26')](saveUpdates(_0x18d4e6[_0x8432('0x4d')],null))['then'](respondWithResult(_0x371ada,null))[_0x8432('0x47')](handleError(_0x371ada,null));};exports[_0x8432('0x27')]=function(_0x1958f2,_0xb348d1){return db[_0x8432('0x2f')]['find']({'where':{'id':_0x1958f2['params']['id']}})[_0x8432('0x26')](handleEntityNotFound(_0xb348d1,null))['then'](removeEntity(_0xb348d1,null))[_0x8432('0x47')](handleError(_0xb348d1,null));};exports[_0x8432('0x30')]=function(_0x317fb7,_0x190e5c){return db[_0x8432('0x2f')][_0x8432('0x30')]()[_0x8432('0x26')](respondWithResult(_0x190e5c,null))[_0x8432('0x47')](handleError(_0x190e5c,null));};exports[_0x8432('0x53')]=function(_0x54fc0e,_0x493dcd,_0x4d166d){return db[_0x8432('0x54')]['find']({'where':{'id':_0x54fc0e[_0x8432('0x49')]['id']}})['then'](handleEntityNotFound(_0x493dcd,null))['then'](function(_0x38a7aa){if(_0x38a7aa){return _0x38a7aa['addContacts'](_0x54fc0e[_0x8432('0x4d')][_0x8432('0x55')],_[_0x8432('0x56')](_0x54fc0e[_0x8432('0x4d')],[_0x8432('0x55'),'id'])||{});}})[_0x8432('0x26')](respondWithResult(_0x493dcd,null))[_0x8432('0x47')](handleError(_0x493dcd,null));};exports[_0x8432('0x57')]=function(_0x18419b,_0x44b669,_0x50d935){var _0x3b1125={};var _0x5bfd5d={};var _0x556930;var _0x288378;return db[_0x8432('0x2f')]['findOne']({'where':{'id':_0x18419b[_0x8432('0x49')]['id']}})[_0x8432('0x26')](handleEntityNotFound(_0x44b669,null))[_0x8432('0x26')](function(_0x1669f5){if(_0x1669f5){_0x556930=_0x1669f5;_0x5bfd5d['model']=_['keys'](db[_0x8432('0x54')][_0x8432('0x4a')]);_0x5bfd5d['query']=_[_0x8432('0x33')](_0x18419b[_0x8432('0x32')]);_0x5bfd5d[_0x8432('0x34')]=_[_0x8432('0x35')](_0x5bfd5d[_0x8432('0x31')],_0x5bfd5d[_0x8432('0x32')]);_0x3b1125[_0x8432('0x36')]=_[_0x8432('0x35')](_0x5bfd5d[_0x8432('0x31')],qs[_0x8432('0x37')](_0x18419b[_0x8432('0x32')]['fields']));_0x3b1125['attributes']=_0x3b1125[_0x8432('0x36')][_0x8432('0x38')]?_0x3b1125[_0x8432('0x36')]:_0x5bfd5d[_0x8432('0x31')];_0x3b1125[_0x8432('0x3b')]=qs[_0x8432('0x3c')](_0x18419b['query']['sort']);_0x3b1125[_0x8432('0x3d')]=qs[_0x8432('0x34')](_[_0x8432('0x3e')](_0x18419b[_0x8432('0x32')],_0x5bfd5d[_0x8432('0x34')]));if(_0x18419b[_0x8432('0x32')][_0x8432('0x41')]){_0x3b1125[_0x8432('0x3d')]=_[_0x8432('0x3f')](_0x3b1125[_0x8432('0x3d')],{'$or':_[_0x8432('0x40')](_0x3b1125[_0x8432('0x36')],function(_0x1804be){var _0x27803f={};_0x27803f[_0x1804be]={'$like':'%'+_0x18419b[_0x8432('0x32')][_0x8432('0x41')]+'%'};return _0x27803f;})});}_0x3b1125=_['merge']({},_0x3b1125,_0x18419b[_0x8432('0x42')]);return _0x556930[_0x8432('0x57')](_0x3b1125);}})['then'](function(_0x2c9dfd){if(_0x2c9dfd){_0x288378=_0x2c9dfd[_0x8432('0x38')];if(!_0x18419b[_0x8432('0x32')][_0x8432('0x39')](_0x8432('0x3a'))){_0x3b1125[_0x8432('0x1e')]=qs[_0x8432('0x1e')](_0x18419b['query']['limit']);_0x3b1125['offset']=qs[_0x8432('0x1d')](_0x18419b['query'][_0x8432('0x1d')]);}return _0x556930[_0x8432('0x57')](_0x3b1125);}})['then'](function(_0x52087c){if(_0x52087c){return _0x52087c?{'count':_0x288378,'rows':_0x52087c}:null;}})['then'](respondWithResult(_0x44b669,null))[_0x8432('0x47')](handleError(_0x44b669,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 3bc5150..03beec7 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 _0xf296=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','cm_companies','lodash'];(function(_0x129216,_0x5c208d){var _0x2a0306=function(_0x319d86){while(--_0x319d86){_0x129216['push'](_0x129216['shift']());}};_0x2a0306(++_0x5c208d);}(_0xf296,0x1a6));var _0x6f29=function(_0x25abbe,_0x53b462){_0x25abbe=_0x25abbe-0x0;var _0x55c770=_0xf296[_0x25abbe];return _0x55c770;};'use strict';var _=require(_0x6f29('0x0'));var util=require('util');var logger=require(_0x6f29('0x1'))(_0x6f29('0x2'));var moment=require(_0x6f29('0x3'));var BPromise=require(_0x6f29('0x4'));var rp=require(_0x6f29('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6f29('0x6'));var attributes=require('./cmCompany.attributes');module[_0x6f29('0x7')]=function(_0x42f6f6,_0x5ac7e0){return _0x42f6f6['define']('CmCompany',attributes,{'tableName':_0x6f29('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe27f=['exports','define','CmCompany','cm_companies','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x4b0bce,_0x6c5d0){var _0x39b702=function(_0x47d616){while(--_0x47d616){_0x4b0bce['push'](_0x4b0bce['shift']());}};_0x39b702(++_0x6c5d0);}(_0xe27f,0xc8));var _0xfe27=function(_0x3db10e,_0x51fa42){_0x3db10e=_0x3db10e-0x0;var _0x368153=_0xe27f[_0x3db10e];return _0x368153;};'use strict';var _=require(_0xfe27('0x0'));var util=require(_0xfe27('0x1'));var logger=require('../../config/logger')(_0xfe27('0x2'));var moment=require(_0xfe27('0x3'));var BPromise=require(_0xfe27('0x4'));var rp=require(_0xfe27('0x5'));var fs=require('fs');var path=require(_0xfe27('0x6'));var rimraf=require(_0xfe27('0x7'));var config=require(_0xfe27('0x8'));var attributes=require(_0xfe27('0x9'));module[_0xfe27('0xa')]=function(_0x1924c9,_0x87317e){return _0x1924c9[_0xfe27('0xb')](_0xfe27('0xc'),attributes,{'tableName':_0xfe27('0xd'),'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 fcc5c9c..d4f27db 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 _0x0d5b=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','../../config/utils','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x432e12,_0x178596){var _0x10c9ed=function(_0x5ee5b9){while(--_0x5ee5b9){_0x432e12['push'](_0x432e12['shift']());}};_0x10c9ed(++_0x178596);}(_0x0d5b,0x14d));var _0xb0d5=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x0d5b[_0x17928f];return _0x500b63;};'use strict';var _=require(_0xb0d5('0x0'));var util=require(_0xb0d5('0x1'));var moment=require(_0xb0d5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb0d5('0x3'));var logger=require('../../config/logger')(_0xb0d5('0x4'));var config=require(_0xb0d5('0x5'));var jayson=require(_0xb0d5('0x6'));var client=jayson[_0xb0d5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6fedc4,_0x22f99e,_0x4693d9){return new BPromise(function(_0x31c878,_0x52c2db){return client['request'](_0x6fedc4,_0x4693d9)[_0xb0d5('0x8')](function(_0x2cb168){logger[_0xb0d5('0x9')](_0xb0d5('0xa'),_0x22f99e,_0xb0d5('0xb'));logger[_0xb0d5('0xc')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x22f99e,_0xb0d5('0xb'),JSON[_0xb0d5('0xd')](_0x2cb168));if(_0x2cb168['error']){if(_0x2cb168[_0xb0d5('0xe')]['code']===0x1f4){logger[_0xb0d5('0xe')]('CmCompany,\x20%s,\x20%s',_0x22f99e,_0x2cb168[_0xb0d5('0xe')][_0xb0d5('0xf')]);return _0x52c2db(_0x2cb168[_0xb0d5('0xe')]['message']);}logger[_0xb0d5('0xe')](_0xb0d5('0xa'),_0x22f99e,_0x2cb168[_0xb0d5('0xe')][_0xb0d5('0xf')]);return _0x31c878(_0x2cb168[_0xb0d5('0xe')][_0xb0d5('0xf')]);}else{logger['info'](_0xb0d5('0xa'),_0x22f99e,_0xb0d5('0xb'));_0x31c878(_0x2cb168[_0xb0d5('0x10')][_0xb0d5('0xf')]);}})[_0xb0d5('0x11')](function(_0x35d1b6){logger[_0xb0d5('0xe')](_0xb0d5('0xa'),_0x22f99e,_0x35d1b6);_0x52c2db(_0x35d1b6);});});} \ No newline at end of file +var _0xfb59=['message','result','catch','lodash','util','moment','randomstring','../../config/logger','rpc','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x343090,_0x433a80){var _0x3ff3e8=function(_0x16c811){while(--_0x16c811){_0x343090['push'](_0x343090['shift']());}};_0x3ff3e8(++_0x433a80);}(_0xfb59,0x16b));var _0x9fb5=function(_0x2bdd6f,_0x20103c){_0x2bdd6f=_0x2bdd6f-0x0;var _0x423aa6=_0xfb59[_0x2bdd6f];return _0x423aa6;};'use strict';var _=require(_0x9fb5('0x0'));var util=require(_0x9fb5('0x1'));var moment=require(_0x9fb5('0x2'));var BPromise=require('bluebird');var rs=require(_0x9fb5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9fb5('0x4'))(_0x9fb5('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9fb5('0x6')][_0x9fb5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x6bb454,_0x3a3c3e,_0x17d57a){return new BPromise(function(_0x374704,_0x405d07){return client[_0x9fb5('0x8')](_0x6bb454,_0x17d57a)[_0x9fb5('0x9')](function(_0x4d5ace){logger[_0x9fb5('0xa')](_0x9fb5('0xb'),_0x3a3c3e,_0x9fb5('0xc'));logger['debug'](_0x9fb5('0xd'),_0x3a3c3e,_0x9fb5('0xc'),JSON[_0x9fb5('0xe')](_0x4d5ace));if(_0x4d5ace[_0x9fb5('0xf')]){if(_0x4d5ace[_0x9fb5('0xf')][_0x9fb5('0x10')]===0x1f4){logger[_0x9fb5('0xf')](_0x9fb5('0xb'),_0x3a3c3e,_0x4d5ace['error'][_0x9fb5('0x11')]);return _0x405d07(_0x4d5ace[_0x9fb5('0xf')][_0x9fb5('0x11')]);}logger['error'](_0x9fb5('0xb'),_0x3a3c3e,_0x4d5ace[_0x9fb5('0xf')]['message']);return _0x374704(_0x4d5ace[_0x9fb5('0xf')][_0x9fb5('0x11')]);}else{logger[_0x9fb5('0xa')](_0x9fb5('0xb'),_0x3a3c3e,_0x9fb5('0xc'));_0x374704(_0x4d5ace[_0x9fb5('0x12')][_0x9fb5('0x11')]);}})[_0x9fb5('0x13')](function(_0x4884f1){logger[_0x9fb5('0xf')](_0x9fb5('0xb'),_0x3a3c3e,_0x4884f1);_0x405d07(_0x4884f1);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 6de5844..bee7d9b 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 _0xdcb7=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id/contacts','getContacts','post','create','update'];(function(_0x1645c4,_0x3c1f97){var _0x44a99f=function(_0x4cb66f){while(--_0x4cb66f){_0x1645c4['push'](_0x1645c4['shift']());}};_0x44a99f(++_0x3c1f97);}(_0xdcb7,0x8d));var _0x7dcb=function(_0x339fde,_0x4b7638){_0x339fde=_0x339fde-0x0;var _0x5b5db5=_0xdcb7[_0x339fde];return _0x5b5db5;};'use strict';var multer=require(_0x7dcb('0x0'));var util=require(_0x7dcb('0x1'));var path=require(_0x7dcb('0x2'));var timeout=require(_0x7dcb('0x3'));var express=require(_0x7dcb('0x4'));var router=express[_0x7dcb('0x5')]();var fs_extra=require(_0x7dcb('0x6'));var auth=require(_0x7dcb('0x7'));var interaction=require(_0x7dcb('0x8'));var config=require(_0x7dcb('0x9'));var controller=require('./cmCompany.controller');router[_0x7dcb('0xa')]('/',auth[_0x7dcb('0xb')](),controller[_0x7dcb('0xc')]);router[_0x7dcb('0xa')](_0x7dcb('0xd'),auth['isAuthenticated'](),controller[_0x7dcb('0xe')]);router[_0x7dcb('0xa')]('/:id',auth[_0x7dcb('0xb')](),controller['show']);router[_0x7dcb('0xa')](_0x7dcb('0xf'),auth[_0x7dcb('0xb')](),controller[_0x7dcb('0x10')]);router[_0x7dcb('0x11')]('/',auth['isAuthenticated'](),controller[_0x7dcb('0x12')]);router[_0x7dcb('0x11')](_0x7dcb('0xf'),auth['isAuthenticated'](),controller['addContacts']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7dcb('0x13')]);router[_0x7dcb('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x7dcb('0x15')]);module[_0x7dcb('0x16')]=router; \ No newline at end of file +var _0x9fd6=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','/:id','/:id/contacts','getContacts','create','post','addContacts','update','delete','destroy','exports','multer','path','express'];(function(_0x5549d8,_0x5d354b){var _0x5e4c6e=function(_0x1d51b5){while(--_0x1d51b5){_0x5549d8['push'](_0x5549d8['shift']());}};_0x5e4c6e(++_0x5d354b);}(_0x9fd6,0xfa));var _0x69fd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9fd6[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x69fd('0x0'));var util=require('util');var path=require(_0x69fd('0x1'));var timeout=require('connect-timeout');var express=require(_0x69fd('0x2'));var router=express[_0x69fd('0x3')]();var fs_extra=require(_0x69fd('0x4'));var auth=require(_0x69fd('0x5'));var interaction=require(_0x69fd('0x6'));var config=require(_0x69fd('0x7'));var controller=require(_0x69fd('0x8'));router['get']('/',auth[_0x69fd('0x9')](),controller[_0x69fd('0xa')]);router[_0x69fd('0xb')](_0x69fd('0xc'),auth[_0x69fd('0x9')](),controller['describe']);router['get'](_0x69fd('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x69fd('0xe'),auth[_0x69fd('0x9')](),controller[_0x69fd('0xf')]);router['post']('/',auth[_0x69fd('0x9')](),controller[_0x69fd('0x10')]);router[_0x69fd('0x11')](_0x69fd('0xe'),auth['isAuthenticated'](),controller[_0x69fd('0x12')]);router['put'](_0x69fd('0xd'),auth[_0x69fd('0x9')](),controller[_0x69fd('0x13')]);router[_0x69fd('0x14')](_0x69fd('0xd'),auth['isAuthenticated'](),controller[_0x69fd('0x15')]);module[_0x69fd('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 356c48a..df93b16 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 _0xed85=['sequelize','exports','STRING','TEXT','INTEGER','NOW','lodash'];(function(_0x285260,_0x15f9ad){var _0xa73eb5=function(_0x1ac5d6){while(--_0x1ac5d6){_0x285260['push'](_0x285260['shift']());}};_0xa73eb5(++_0x15f9ad);}(_0xed85,0xd1));var _0x5ed8=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0xed85[_0x490be3];return _0x3f5140;};'use strict';var _=require(_0x5ed8('0x0'));var Sequelize=require(_0x5ed8('0x1'));module[_0x5ed8('0x2')]={'firstName':{'type':Sequelize[_0x5ed8('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x5ed8('0x3')]},'street':{'type':Sequelize[_0x5ed8('0x3')]},'postalCode':{'type':Sequelize[_0x5ed8('0x3')]},'city':{'type':Sequelize[_0x5ed8('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x5ed8('0x3')]},'description':{'type':Sequelize[_0x5ed8('0x4')]},'phone':{'type':Sequelize[_0x5ed8('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x5ed8('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x5ed8('0x3')]},'teams':{'type':Sequelize[_0x5ed8('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x5ed8('0x3')]},'wechat':{'type':Sequelize[_0x5ed8('0x3')]},'telegram':{'type':Sequelize[_0x5ed8('0x3')]},'UserId':{'type':Sequelize[_0x5ed8('0x5')]},'priority':{'type':Sequelize[_0x5ed8('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x5ed8('0x6')]}}; \ No newline at end of file +var _0x34d7=['INTEGER','UNSIGNED','DATE','lodash','sequelize','exports','STRING','TEXT'];(function(_0x32cbe0,_0x403849){var _0x532da5=function(_0x30f0b4){while(--_0x30f0b4){_0x32cbe0['push'](_0x32cbe0['shift']());}};_0x532da5(++_0x403849);}(_0x34d7,0x14b));var _0x734d=function(_0x392368,_0x1e14a5){_0x392368=_0x392368-0x0;var _0x33efe7=_0x34d7[_0x392368];return _0x33efe7;};'use strict';var _=require(_0x734d('0x0'));var Sequelize=require(_0x734d('0x1'));module[_0x734d('0x2')]={'firstName':{'type':Sequelize[_0x734d('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x734d('0x3')]},'country':{'type':Sequelize[_0x734d('0x3')]},'dateOfBirth':{'type':Sequelize[_0x734d('0x3')]},'description':{'type':Sequelize[_0x734d('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x734d('0x3')]},'fax':{'type':Sequelize[_0x734d('0x3')]},'email':{'type':Sequelize[_0x734d('0x3')]},'url':{'type':Sequelize[_0x734d('0x3')]},'facebook':{'type':Sequelize[_0x734d('0x3')]},'fb_data':{'type':Sequelize[_0x734d('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x734d('0x3')]},'teams':{'type':Sequelize[_0x734d('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x734d('0x3')]},'wechat':{'type':Sequelize[_0x734d('0x3')]},'telegram':{'type':Sequelize[_0x734d('0x3')]},'UserId':{'type':Sequelize[_0x734d('0x5')]},'priority':{'type':Sequelize[_0x734d('0x5')](0x2)[_0x734d('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x734d('0x7')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 2356d26..f7a6adc 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 _0x0f1e=['fieldType','datetime','castTo','DATE','buildExpression','text','value','start','filter','isNil','Contact','isEmpty','forEach','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','QueryTypes','SELECT','c.id','order','DESC','having','t.id\x20IN\x20?','resolve','agent','user','c.ListId\x20IS\x20NULL','role','ListId','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.mobile','c.fax','c.email','c.ListId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','catch','tags','displayName','findAll','columnName','custom','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','destroy','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','create','each','duplicates','$or','findOrCreate','show','params','$and','cf_%d','omit','format','table','id\x20=\x20?','toParam','values','phone','getTags','setTags','ids','getHoppers','ContactId','options','includeAll','include','rows','getHopperHistories','CmHopperHistory','rawAttributes','getHopperFinals','getJscriptySessions','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','filename','chmodSync','0777','child_process','../../components/import/cm/csv','File\x20uploaded\x20correctly!','file','meta','import','binding','No\x20firstName\x20column\x20specified','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','VoiceCallReport','startCase','Website','closed','closedAt','disposition','secondDisposition','Account','key','Owner','color','browserName','customerIp','customerPort','osName','ratingType','ratingValue','subject','substatus','flatten','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','select','field','from','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','expr','search','parseSearch','sqlOperator','conditions','find','Tag','split','map','union','User','uc.UserId\x20=\x20?','dateOfBirth'];(function(_0x31cd19,_0x3d8476){var _0x3252fc=function(_0xc04a88){while(--_0xc04a88){_0x31cd19['push'](_0x31cd19['shift']());}};_0x3252fc(++_0x3d8476);}(_0x0f1e,0xc6));var _0xe0f1=function(_0x2bc2c0,_0x34cdd2){_0x2bc2c0=_0x2bc2c0-0x0;var _0x56de0=_0x0f1e[_0x2bc2c0];return _0x56de0;};'use strict';var emlformat=require(_0xe0f1('0x0'));var rimraf=require(_0xe0f1('0x1'));var zipdir=require(_0xe0f1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0f1('0x3'));var moment=require('moment');var BPromise=require(_0xe0f1('0x4'));var Mustache=require(_0xe0f1('0x5'));var util=require(_0xe0f1('0x6'));var path=require(_0xe0f1('0x7'));var sox=require(_0xe0f1('0x8'));var csv=require(_0xe0f1('0x9'));var ejs=require(_0xe0f1('0xa'));var fs=require('fs');var fs_extra=require(_0xe0f1('0xb'));var _=require(_0xe0f1('0xc'));var squel=require(_0xe0f1('0xd'));var crypto=require('crypto');var jsforce=require(_0xe0f1('0xe'));var deskjs=require(_0xe0f1('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe0f1('0x10'));var Papa=require(_0xe0f1('0x11'));var Redis=require(_0xe0f1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe0f1('0x13'));var as=require(_0xe0f1('0x14'));var hardwareService=require(_0xe0f1('0x15'));var logger=require(_0xe0f1('0x16'))(_0xe0f1('0x17'));var utils=require(_0xe0f1('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe0f1('0x19'));var db=require(_0xe0f1('0x1a'))['db'];config[_0xe0f1('0x1b')]=_[_0xe0f1('0x1c')](config[_0xe0f1('0x1b')],{'host':_0xe0f1('0x1d'),'port':0x18eb});var socket=require(_0xe0f1('0x1e'))(new Redis(config[_0xe0f1('0x1b')]));require(_0xe0f1('0x1f'))['register'](socket);function respondWithStatusCode(_0x34fbb0,_0x18379b){_0x18379b=_0x18379b||0xcc;return function(_0x575cc1){if(_0x575cc1){return _0x34fbb0['sendStatus'](_0x18379b);}return _0x34fbb0[_0xe0f1('0x20')](_0x18379b)[_0xe0f1('0x21')]();};}function respondWithResult(_0x2bef59,_0x13ddeb){_0x13ddeb=_0x13ddeb||0xc8;return function(_0x20d351){if(_0x20d351){return _0x2bef59[_0xe0f1('0x20')](_0x13ddeb)[_0xe0f1('0x22')](_0x20d351);}};}function respondWithFilteredResult(_0x4db880,_0x533936){return function(_0x58d43e){if(_0x58d43e){var _0x148b74=typeof _0x533936[_0xe0f1('0x23')]==='undefined'&&typeof _0x533936[_0xe0f1('0x24')]===_0xe0f1('0x25');var _0x1435c6=_0x58d43e[_0xe0f1('0x26')];var _0x1d439f=_0x148b74?0x0:_0x533936[_0xe0f1('0x23')];var _0x26850d=_0x148b74?_0x58d43e['count']:_0x533936[_0xe0f1('0x23')]+_0x533936[_0xe0f1('0x24')];var _0x2bcdc9;if(_0x26850d>=_0x1435c6){_0x26850d=_0x1435c6;_0x2bcdc9=0xc8;}else{_0x2bcdc9=0xce;}_0x4db880['status'](_0x2bcdc9);return _0x4db880[_0xe0f1('0x27')](_0xe0f1('0x28'),_0x1d439f+'-'+_0x26850d+'/'+_0x1435c6)[_0xe0f1('0x22')](_0x58d43e);}return null;};}function patchUpdates(_0x155b45){return function(_0x4a61bd){try{jsonpatch[_0xe0f1('0x29')](_0x4a61bd,_0x155b45,!![]);}catch(_0x46363c){return BPromise[_0xe0f1('0x2a')](_0x46363c);}return _0x4a61bd[_0xe0f1('0x2b')]();};}function saveUpdates(_0x1c4aca,_0x31875b){return function(_0x3dc6b7){if(_0x3dc6b7){return _0x3dc6b7[_0xe0f1('0x2c')](_0x1c4aca)['then'](function(_0xe7b5c5){return _0xe7b5c5;});}return null;};}function removeEntity(_0x4d55d7,_0x349b6a){return function(_0x985848){if(_0x985848){return _0x985848['destroy']()[_0xe0f1('0x2d')](function(){_0x4d55d7[_0xe0f1('0x20')](0xcc)[_0xe0f1('0x21')]();});}};}function handleEntityNotFound(_0x165722,_0x4f9da9){return function(_0x4e3262){if(!_0x4e3262){_0x165722['sendStatus'](0x194);}return _0x4e3262;};}function handleError(_0x4c14f6,_0x4a9ca0){_0x4a9ca0=_0x4a9ca0||0x1f4;return function(_0x315da3){logger[_0xe0f1('0x2e')](_0x315da3['stack']);if(_0x315da3['name']){delete _0x315da3[_0xe0f1('0x2f')];}_0x4c14f6['status'](_0x4a9ca0)[_0xe0f1('0x30')](_0x315da3);};}exports[_0xe0f1('0x31')]=function(_0x1030c2,_0x3e1120){var _0x82b5c2={},_0x2a4fb4={},_0x5ceb59={'count':0x0,'rows':[]};return db[_0xe0f1('0x32')][_0xe0f1('0x33')]()[_0xe0f1('0x2d')](function(_0x1a6270){var _0x14c3d5=[];for(var _0x43f9cc=0x0;_0x43f9cc0x1){_0x586438['or'](_0xe0f1('0x74'),qs[_0xe0f1('0x75')](_0x4da389),null);}else{if(qs[_0xe0f1('0x76')](_0x4da389)){_0x586438['or']('c.id\x20LIKE\x20?',_0x4da389+'%');_0x586438['or'](_0xe0f1('0x77'),_0x4da389+'%');_0x586438['or'](_0xe0f1('0x78'),_0x4da389+'%');_0x586438['or'](_0xe0f1('0x79'),_0x4da389+'%');}else if(qs[_0xe0f1('0x7a')](_0x4da389)){_0x586438['or'](_0xe0f1('0x7b'),_0x4da389+'%');}else{_0x586438['or'](_0xe0f1('0x7c'),'%'+_0x4da389+'%');_0x586438['or'](_0xe0f1('0x7d'),'%'+_0x4da389+'%');_0x586438['or'](_0xe0f1('0x7b'),'%'+_0x4da389+'%');}}}}_0x583897['where'](_0x586438);_0x583897[_0xe0f1('0x7e')]('c.id');var _0x11848c={'type':db['Sequelize'][_0xe0f1('0x7f')][_0xe0f1('0x80')],'raw':!![]};var _0x39f583=_0x583897['clone']()[_0xe0f1('0x4a')](_0xe0f1('0x81'));if(_0x82b5c2[_0xe0f1('0x82')]){_0x82b5c2[_0xe0f1('0x82')][_0xe0f1('0x6b')](function(_0x1c602d){_0x583897['order']('c.'+_0x1c602d[0x0],_0x1c602d[0x1]===_0xe0f1('0x83')?![]:!![]);});}if(!_['isEmpty'](_0x2b0b68)){_0x583897[_0xe0f1('0x84')](_0x4ba815);_0x39f583[_0xe0f1('0x47')](_0xe0f1('0x85'),_0x2b0b68);}BPromise[_0xe0f1('0x86')]()[_0xe0f1('0x2d')](function(){if(!_0x213e3f)return;if(_0x1030c2['user']['role']!==_0xe0f1('0x87'))return;if(!_['some'](_0x213e3f[_0xe0f1('0x56')],[_0xe0f1('0x4a'),'User'])){return _0x1030c2[_0xe0f1('0x88')]['getLists']({'attributes':['id'],'raw':!![]})[_0xe0f1('0x2d')](function(_0x114cfe){if(_[_0xe0f1('0x6a')](_0x114cfe)){_0x39f583[_0xe0f1('0x47')](_0xe0f1('0x89'));_0x583897['where'](_0xe0f1('0x89'));}else{_0x39f583[_0xe0f1('0x47')](_0xe0f1('0x6c'),_[_0xe0f1('0x5a')](_0x114cfe,'id'));_0x583897['where']('c.ListId\x20IN\x20?',_[_0xe0f1('0x5a')](_0x114cfe,'id'));}});}})[_0xe0f1('0x2d')](function(){if(_0x1030c2[_0xe0f1('0x88')][_0xe0f1('0x8a')]===_0xe0f1('0x87')&&!_0x213e3f&&!_0x1030c2[_0xe0f1('0x3f')][_0xe0f1('0x8b')])return[];return db[_0xe0f1('0x8c')][_0xe0f1('0x3f')](_0x39f583[_0xe0f1('0x8d')](),_0x11848c);})[_0xe0f1('0x2d')](function(_0x24ea1c){_0x5ceb59[_0xe0f1('0x26')]=_0x24ea1c[_0xe0f1('0x35')];if(_0x5ceb59[_0xe0f1('0x26')]===0x0)return[];return db['sequelize'][_0xe0f1('0x3f')](_0x814bb['toString'](),_0x11848c)[_0xe0f1('0x2d')](function(_0x37c2fa){_0x2b349b=_[_0xe0f1('0x8e')](_0x37c2fa,'id');_0x11848c=_[_0xe0f1('0x8f')](_0x11848c,{'model':db[_0xe0f1('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1030c2[_0xe0f1('0x3f')]['fields']){_0x82b5c2[_0xe0f1('0x42')][_0xe0f1('0x6b')](function(_0x155cfd){_0x583897[_0xe0f1('0x4a')]('c.'+_0x155cfd);});}else{_0x583897[_0xe0f1('0x4a')](_0xe0f1('0x81'));_0x583897[_0xe0f1('0x4a')](_0xe0f1('0x90'));_0x583897[_0xe0f1('0x4a')](_0xe0f1('0x91'));_0x583897[_0xe0f1('0x4a')]('c.phone');_0x583897['field'](_0xe0f1('0x92'));_0x583897[_0xe0f1('0x4a')](_0xe0f1('0x93'));_0x583897[_0xe0f1('0x4a')](_0xe0f1('0x94'));_0x583897[_0xe0f1('0x4a')](_0xe0f1('0x95'));_0x583897['field']('c.createdAt');_0x583897['field']('c.deletedAt');_0x583897[_0xe0f1('0x4a')]('c.CompanyId');_0x583897[_0xe0f1('0x4a')](_0xe0f1('0x96'),_0xe0f1('0x97'));}if(_0x82b5c2[_0xe0f1('0x24')])_0x583897['limit'](_0x82b5c2[_0xe0f1('0x24')]);if(_0x82b5c2[_0xe0f1('0x23')])_0x583897['offset'](_0x82b5c2['offset']);return db[_0xe0f1('0x8c')][_0xe0f1('0x3f')](_0x583897[_0xe0f1('0x8d')](),_0x11848c);});})[_0xe0f1('0x2d')](function(_0x46cbbb){_0x46cbbb[_0xe0f1('0x6b')](function(_0x342498){if(_0x342498['TagIds']){_0x342498[_0xe0f1('0x98')]=[];_0x342498['TagIds'][_0xe0f1('0x59')](',')['forEach'](function(_0x28f175){_0x342498['Tags'][_0xe0f1('0x38')](_0x2b349b[_0x28f175]);});}delete _0x342498[_0xe0f1('0x97')];});_0x5ceb59['rows']=_0x46cbbb;return _0x5ceb59;})['then'](respondWithFilteredResult(_0x3e1120,_0x82b5c2));})[_0xe0f1('0x99')](handleError(_0x3e1120,null));};exports['destroy']=function(_0x31b5a6,_0x1f8e75){return db['CmContact'][_0xe0f1('0x57')]({'where':{'id':_0x31b5a6['params']['id']}})['then'](handleEntityNotFound(_0x1f8e75,null))[_0xe0f1('0x2d')](removeEntity(_0x1f8e75,null))['catch'](handleError(_0x1f8e75,null));};exports['describe']=function(_0x1a5df6,_0x4c3b22){return db[_0xe0f1('0x32')][_0xe0f1('0x33')]()[_0xe0f1('0x2d')](function(_0xc80741){delete _0xc80741[_0xe0f1('0x9a')];for(var _0x43be43=0x0;_0x43be43=_0x48fefb){_0x18765a=_0x48fefb;_0x3f1c74=0xc8;}else{_0x3f1c74=0xce;}_0x3754b[_0xc150('0x1b')](_0x3f1c74);return _0x3754b[_0xc150('0x22')](_0xc150('0x23'),_0x552464+'-'+_0x18765a+'/'+_0x48fefb)[_0xc150('0x1d')](_0x42f87f);}return null;};}function patchUpdates(_0xf74170){return function(_0x194051){try{jsonpatch[_0xc150('0x24')](_0x194051,_0xf74170,!![]);}catch(_0x34d57e){return BPromise[_0xc150('0x25')](_0x34d57e);}return _0x194051[_0xc150('0x26')]();};}function saveUpdates(_0x152acd,_0xd02c9a){return function(_0x490873){if(_0x490873){return _0x490873[_0xc150('0x27')](_0x152acd)['then'](function(_0x1b9662){return _0x1b9662;});}return null;};}function removeEntity(_0x168ee5,_0xf62d4e){return function(_0x4ec8d6){if(_0x4ec8d6){return _0x4ec8d6[_0xc150('0x28')]()[_0xc150('0x29')](function(){_0x168ee5['status'](0xcc)[_0xc150('0x1c')]();});}};}function handleEntityNotFound(_0x35d35f,_0x40ad65){return function(_0x538f82){if(!_0x538f82){_0x35d35f[_0xc150('0x1a')](0x194);}return _0x538f82;};}function handleError(_0x2dc019,_0x430d21){_0x430d21=_0x430d21||0x1f4;return function(_0x1c5312){logger['error'](_0x1c5312[_0xc150('0x2a')]);if(_0x1c5312[_0xc150('0x2b')]){delete _0x1c5312[_0xc150('0x2b')];}_0x2dc019[_0xc150('0x1b')](_0x430d21)[_0xc150('0x2c')](_0x1c5312);};}exports[_0xc150('0x2d')]=function(_0x3eeb88,_0x4da58e){var _0x35603f={},_0x3e0487={},_0x27fa99={'count':0x0,'rows':[]};return db[_0xc150('0x2e')][_0xc150('0x2f')]()[_0xc150('0x29')](function(_0x94b260){var _0x2446b8=[];for(var _0x56cab5=0x0;_0x56cab50x1){_0x28d02d['or'](_0xc150('0x6d'),qs[_0xc150('0x6e')](_0x2214a3),null);}else{if(qs[_0xc150('0x6f')](_0x2214a3)){_0x28d02d['or'](_0xc150('0x70'),_0x2214a3+'%');_0x28d02d['or']('c.phone\x20LIKE\x20?',_0x2214a3+'%');_0x28d02d['or']('c.mobile\x20LIKE\x20?',_0x2214a3+'%');_0x28d02d['or'](_0xc150('0x71'),_0x2214a3+'%');}else if(qs[_0xc150('0x72')](_0x2214a3)){_0x28d02d['or']('c.email\x20LIKE\x20?',_0x2214a3+'%');}else{_0x28d02d['or'](_0xc150('0x73'),'%'+_0x2214a3+'%');_0x28d02d['or'](_0xc150('0x74'),'%'+_0x2214a3+'%');_0x28d02d['or'](_0xc150('0x75'),'%'+_0x2214a3+'%');}}}}_0x43c606['where'](_0x28d02d);_0x43c606[_0xc150('0x76')](_0xc150('0x77'));var _0x14d366={'type':db['Sequelize']['QueryTypes'][_0xc150('0x78')],'raw':!![]};var _0x41c7d0=_0x43c606[_0xc150('0x79')]()['field'](_0xc150('0x77'));if(_0x35603f[_0xc150('0x3d')]){_0x35603f[_0xc150('0x3d')][_0xc150('0x53')](function(_0x2595d5){_0x43c606[_0xc150('0x3d')]('c.'+_0x2595d5[0x0],_0x2595d5[0x1]===_0xc150('0x7a')?![]:!![]);});}if(!_[_0xc150('0x63')](_0x8d67d7)){_0x43c606[_0xc150('0x7b')](_0x568d29);_0x41c7d0[_0xc150('0x65')](_0xc150('0x7c'),_0x8d67d7);}BPromise['resolve']()[_0xc150('0x29')](function(){if(!_0x198784)return;if(_0x3eeb88['user']['role']!=='agent')return;if(!_['some'](_0x198784[_0xc150('0x4d')],['field','User'])){return _0x3eeb88[_0xc150('0x7d')][_0xc150('0x7e')]({'attributes':['id'],'raw':!![]})[_0xc150('0x29')](function(_0x19631c){if(_[_0xc150('0x63')](_0x19631c)){_0x41c7d0[_0xc150('0x65')](_0xc150('0x7f'));_0x43c606[_0xc150('0x65')](_0xc150('0x7f'));}else{_0x41c7d0[_0xc150('0x65')]('c.ListId\x20IN\x20?',_['map'](_0x19631c,'id'));_0x43c606[_0xc150('0x65')](_0xc150('0x66'),_['map'](_0x19631c,'id'));}});}})[_0xc150('0x29')](function(){if(_0x3eeb88['user'][_0xc150('0x80')]==='agent'&&!_0x198784&&!_0x3eeb88[_0xc150('0x36')]['ListId'])return[];return db[_0xc150('0x81')][_0xc150('0x36')](_0x41c7d0[_0xc150('0x82')](),_0x14d366);})['then'](function(_0x48007a){_0x27fa99[_0xc150('0x20')]=_0x48007a[_0xc150('0x31')];if(_0x27fa99['count']===0x0)return[];return db['sequelize']['query'](_0x5cb9b1[_0xc150('0x82')](),_0x14d366)[_0xc150('0x29')](function(_0x4900bd){_0x4d9be4=_[_0xc150('0x83')](_0x4900bd,'id');_0x14d366=_[_0xc150('0x84')](_0x14d366,{'model':db[_0xc150('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3eeb88[_0xc150('0x36')][_0xc150('0x3a')]){_0x35603f[_0xc150('0x39')]['forEach'](function(_0x1f0c1f){_0x43c606[_0xc150('0x41')]('c.'+_0x1f0c1f);});}else{_0x43c606['field']('c.id');_0x43c606['field'](_0xc150('0x85'));_0x43c606[_0xc150('0x41')](_0xc150('0x86'));_0x43c606[_0xc150('0x41')](_0xc150('0x87'));_0x43c606[_0xc150('0x41')]('c.mobile');_0x43c606['field']('c.fax');_0x43c606[_0xc150('0x41')](_0xc150('0x88'));_0x43c606[_0xc150('0x41')](_0xc150('0x89'));_0x43c606[_0xc150('0x41')](_0xc150('0x8a'));_0x43c606['field']('c.deletedAt');_0x43c606['field']('c.CompanyId');_0x43c606['field'](_0xc150('0x8b'),_0xc150('0x8c'));}if(_0x35603f[_0xc150('0x21')])_0x43c606[_0xc150('0x21')](_0x35603f[_0xc150('0x21')]);if(_0x35603f[_0xc150('0x1e')])_0x43c606[_0xc150('0x1e')](_0x35603f[_0xc150('0x1e')]);return db[_0xc150('0x81')][_0xc150('0x36')](_0x43c606['toString'](),_0x14d366);});})[_0xc150('0x29')](function(_0x212972){_0x212972[_0xc150('0x53')](function(_0x3c0d46){if(_0x3c0d46[_0xc150('0x8c')]){_0x3c0d46[_0xc150('0x8d')]=[];_0x3c0d46['TagIds'][_0xc150('0x51')](',')[_0xc150('0x53')](function(_0x3afc8d){_0x3c0d46['Tags'][_0xc150('0x61')](_0x4d9be4[_0x3afc8d]);});}delete _0x3c0d46['TagIds'];});_0x27fa99[_0xc150('0x8e')]=_0x212972;return _0x27fa99;})['then'](respondWithFilteredResult(_0x4da58e,_0x35603f));})[_0xc150('0x8f')](handleError(_0x4da58e,null));};exports[_0xc150('0x28')]=function(_0x1aaf07,_0x17eb64){return db[_0xc150('0x2e')][_0xc150('0x4e')]({'where':{'id':_0x1aaf07[_0xc150('0x90')]['id']}})[_0xc150('0x29')](handleEntityNotFound(_0x17eb64,null))['then'](removeEntity(_0x17eb64,null))[_0xc150('0x8f')](handleError(_0x17eb64,null));};exports[_0xc150('0x2f')]=function(_0x2ae22a,_0x554000){return db['CmContact'][_0xc150('0x2f')]()[_0xc150('0x29')](function(_0x3d1b34){delete _0x3d1b34['tags'];for(var _0x5e1cd6=0x0;_0x5e1cd6{}\s\\|]/g,'-');_0xe303c3(null,util[_0x8015('0x24')](_0x8015('0x25'),path[_0x8015('0x26')](_0x409036[_0x8015('0x23')],path[_0x8015('0x27')](_0x409036[_0x8015('0x23')])),Date[_0x8015('0x28')](),path[_0x8015('0x27')](_0x409036[_0x8015('0x23')])));}})});router[_0x8015('0x1d')]('/csv',upload[_0x8015('0x29')](_0x8015('0x2a')),controller[_0x8015('0x2b')]);var upload=multer({'storage':multer[_0x8015('0x2c')]({'destination':function(_0x161e70,_0xa867ce,_0x331d73){_0x331d73(null,path[_0x8015('0x21')](config[_0x8015('0x2d')],_0x8015('0x22')));},'filename':function(_0x2bc7b3,_0x5060a0,_0x129df2){_0x5060a0[_0x8015('0x23')]=_0x5060a0[_0x8015('0x23')][_0x8015('0x2e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x129df2(null,util[_0x8015('0x24')](_0x8015('0x25'),path[_0x8015('0x26')](_0x5060a0['originalname'],path[_0x8015('0x27')](_0x5060a0[_0x8015('0x23')])),Date[_0x8015('0x28')](),path[_0x8015('0x27')](_0x5060a0[_0x8015('0x23')])));}})});router['post'](_0x8015('0x2f'),upload[_0x8015('0x29')]('file'),controller[_0x8015('0x30')]);router[_0x8015('0x1d')](_0x8015('0x31'),auth['isAuthenticated'](),controller['import']);router[_0x8015('0x32')](_0x8015('0xf'),auth['isAuthenticated'](),controller[_0x8015('0x33')]);router[_0x8015('0x34')](_0x8015('0xf'),auth[_0x8015('0xa')](),controller['destroy']);module[_0x8015('0x35')]=router; \ No newline at end of file +var _0x7346=['getJscriptySessions','/:id/journey','getJourney','post','/merge','/create_many','/:id/tags','diskStorage','join','originalname','replace','format','%s-%s%s','basename','now','extname','/csv','single','file','uploadCsv','server/files/tmp','/upload','upload','/upload/:id','import','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','getTags','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions'];(function(_0x10453e,_0x3b43ec){var _0x3db50d=function(_0x428ae0){while(--_0x428ae0){_0x10453e['push'](_0x10453e['shift']());}};_0x3db50d(++_0x3b43ec);}(_0x7346,0xad));var _0x6734=function(_0x1c30b2,_0x20966e){_0x1c30b2=_0x1c30b2-0x0;var _0x254d37=_0x7346[_0x1c30b2];return _0x254d37;};'use strict';var multer=require(_0x6734('0x0'));var util=require(_0x6734('0x1'));var path=require('path');var timeout=require(_0x6734('0x2'));var express=require('express');var router=express[_0x6734('0x3')]();var fs_extra=require(_0x6734('0x4'));var auth=require(_0x6734('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmContact.controller');router[_0x6734('0x6')]('/',auth[_0x6734('0x7')](),controller[_0x6734('0x8')]);router[_0x6734('0x6')](_0x6734('0x9'),auth['isAuthenticated'](),controller[_0x6734('0xa')]);router[_0x6734('0x6')](_0x6734('0xb'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/tags',auth[_0x6734('0x7')](),controller[_0x6734('0xc')]);router['get']('/:id/hoppers',auth[_0x6734('0x7')](),controller[_0x6734('0xd')]);router[_0x6734('0x6')](_0x6734('0xe'),auth[_0x6734('0x7')](),controller[_0x6734('0xf')]);router['get'](_0x6734('0x10'),auth[_0x6734('0x7')](),controller[_0x6734('0x11')]);router[_0x6734('0x6')](_0x6734('0x12'),auth['isAuthenticated'](),controller[_0x6734('0x13')]);router[_0x6734('0x6')](_0x6734('0x14'),auth[_0x6734('0x7')](),controller[_0x6734('0x15')]);router[_0x6734('0x16')](_0x6734('0x17'),auth[_0x6734('0x7')](),controller['merge']);router[_0x6734('0x16')]('/',auth[_0x6734('0x7')](),controller['create']);router[_0x6734('0x16')](_0x6734('0x18'),auth[_0x6734('0x7')](),controller['bulkCreate']);router[_0x6734('0x16')](_0x6734('0x19'),auth[_0x6734('0x7')](),controller['setTags']);var upload=multer({'storage':multer[_0x6734('0x1a')]({'destination':function(_0x44ea6d,_0x202253,_0x78714){_0x78714(null,path[_0x6734('0x1b')](config['root'],'server/files/tmp'));},'filename':function(_0xae2cf3,_0x4d6d4f,_0x45adde){_0x4d6d4f[_0x6734('0x1c')]=_0x4d6d4f[_0x6734('0x1c')][_0x6734('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x45adde(null,util[_0x6734('0x1e')](_0x6734('0x1f'),path[_0x6734('0x20')](_0x4d6d4f[_0x6734('0x1c')],path['extname'](_0x4d6d4f[_0x6734('0x1c')])),Date[_0x6734('0x21')](),path[_0x6734('0x22')](_0x4d6d4f[_0x6734('0x1c')])));}})});router[_0x6734('0x16')](_0x6734('0x23'),upload[_0x6734('0x24')](_0x6734('0x25')),controller[_0x6734('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d1834,_0x33fc89,_0x3fcfe6){_0x3fcfe6(null,path[_0x6734('0x1b')](config['root'],_0x6734('0x27')));},'filename':function(_0x3d8d5d,_0x460b9d,_0x100522){_0x460b9d[_0x6734('0x1c')]=_0x460b9d[_0x6734('0x1c')][_0x6734('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x100522(null,util[_0x6734('0x1e')](_0x6734('0x1f'),path['basename'](_0x460b9d['originalname'],path[_0x6734('0x22')](_0x460b9d[_0x6734('0x1c')])),Date[_0x6734('0x21')](),path[_0x6734('0x22')](_0x460b9d[_0x6734('0x1c')])));}})});router[_0x6734('0x16')](_0x6734('0x28'),upload[_0x6734('0x24')]('file'),controller[_0x6734('0x29')]);router['post'](_0x6734('0x2a'),auth['isAuthenticated'](),controller[_0x6734('0x2b')]);router[_0x6734('0x2c')]('/:id',auth[_0x6734('0x7')](),controller[_0x6734('0x2d')]);router['delete']('/:id',auth[_0x6734('0x7')](),controller[_0x6734('0x2e')]);module[_0x6734('0x2f')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 8c90f16..a78742b 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 _0x499d=['select','values','setDataValue','stringify','BOOLEAN','voice','sequelize','VIRTUAL','alias','STRING','name','TEXT','long','getDataValue','type'];(function(_0x29e746,_0x525849){var _0x12f371=function(_0x18d7ee){while(--_0x18d7ee){_0x29e746['push'](_0x29e746['shift']());}};_0x12f371(++_0x525849);}(_0x499d,0x1e6));var _0xd499=function(_0x2b9225,_0x43fb28){_0x2b9225=_0x2b9225-0x0;var _0x502391=_0x499d[_0x2b9225];return _0x502391;};'use strict';var Sequelize=require(_0xd499('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xd499('0x1')],'get':function(_0xbe9672){return this['getDataValue'](_0xd499('0x2'));}},'alias':{'type':Sequelize[_0xd499('0x3')],'allowNull':![],'set':function(_0x1db750){this['setDataValue'](_0xd499('0x2'),_0x1db750?_0x1db750:this['getDataValue'](_0xd499('0x4')));}},'type':{'type':Sequelize[_0xd499('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0xd499('0x5')](_0xd499('0x6')),'get':function(){if(this[_0xd499('0x7')](_0xd499('0x8'))===_0xd499('0x9')){return JSON['parse'](this[_0xd499('0x7')](_0xd499('0xa')));}else{return this['getDataValue']('values');}},'set':function(_0x4b0e43){if(Array['isArray'](_0x4b0e43)){this[_0xd499('0xb')](_0xd499('0xa'),JSON[_0xd499('0xc')](_0x4b0e43));}else{this[_0xd499('0xb')](_0xd499('0xa'),_0x4b0e43);}}},'required':{'type':Sequelize[_0xd499('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xd499('0xe'))}}; \ No newline at end of file +var _0x199d=['ENUM','voice','lodash','exports','getDataValue','alias','STRING','name','long','type','select','parse','values','setDataValue','stringify','BOOLEAN'];(function(_0x58dfa3,_0x25ae67){var _0x18dfa3=function(_0x47ad39){while(--_0x47ad39){_0x58dfa3['push'](_0x58dfa3['shift']());}};_0x18dfa3(++_0x25ae67);}(_0x199d,0x92));var _0xd199=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0x199d[_0xe45118];return _0x15e15d;};'use strict';var Sequelize=require('sequelize');var _=require(_0xd199('0x0'));module[_0xd199('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x497f86){return this[_0xd199('0x2')](_0xd199('0x3'));}},'alias':{'type':Sequelize[_0xd199('0x4')],'allowNull':![],'set':function(_0x2b4e8e){this['setDataValue'](_0xd199('0x3'),_0x2b4e8e?_0x2b4e8e:this['getDataValue'](_0xd199('0x5')));}},'type':{'type':Sequelize[_0xd199('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xd199('0x6')),'get':function(){if(this[_0xd199('0x2')](_0xd199('0x7'))===_0xd199('0x8')){return JSON[_0xd199('0x9')](this[_0xd199('0x2')](_0xd199('0xa')));}else{return this['getDataValue'](_0xd199('0xa'));}},'set':function(_0xbbd2ab){if(Array['isArray'](_0xbbd2ab)){this[_0xd199('0xb')]('values',JSON[_0xd199('0xc')](_0xbbd2ab));}else{this[_0xd199('0xb')]('values',_0xbbd2ab);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xd199('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xd199('0xe')](_0xd199('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 43196f1..7122959 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 _0x5bf0=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','CmCustomField','rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','find','body','transaction','Sequelize','text','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','format','cf_%d','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x5bf0,0x1a0));var _0x05bf=function(_0x12ebf4,_0x201ba0){_0x12ebf4=_0x12ebf4-0x0;var _0xcb50f=_0x5bf0[_0x12ebf4];return _0xcb50f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x05bf('0x0'));var zipdir=require(_0x05bf('0x1'));var jsonpatch=require(_0x05bf('0x2'));var rp=require(_0x05bf('0x3'));var moment=require(_0x05bf('0x4'));var BPromise=require(_0x05bf('0x5'));var Mustache=require(_0x05bf('0x6'));var util=require(_0x05bf('0x7'));var path=require(_0x05bf('0x8'));var sox=require(_0x05bf('0x9'));var csv=require(_0x05bf('0xa'));var ejs=require(_0x05bf('0xb'));var fs=require('fs');var fs_extra=require(_0x05bf('0xc'));var _=require(_0x05bf('0xd'));var squel=require(_0x05bf('0xe'));var crypto=require(_0x05bf('0xf'));var jsforce=require(_0x05bf('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x05bf('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x05bf('0x12'));var as=require(_0x05bf('0x13'));var hardwareService=require(_0x05bf('0x14'));var logger=require(_0x05bf('0x15'))(_0x05bf('0x16'));var utils=require(_0x05bf('0x17'));var config=require(_0x05bf('0x18'));var licenseUtil=require(_0x05bf('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59348f,_0x2d18d7){_0x2d18d7=_0x2d18d7||0xcc;return function(_0x469001){if(_0x469001){return _0x59348f[_0x05bf('0x1a')](_0x2d18d7);}return _0x59348f['status'](_0x2d18d7)[_0x05bf('0x1b')]();};}function respondWithResult(_0x346503,_0x31bd15){_0x31bd15=_0x31bd15||0xc8;return function(_0x2f07cb){if(_0x2f07cb){return _0x346503[_0x05bf('0x1c')](_0x31bd15)[_0x05bf('0x1d')](_0x2f07cb);}};}function respondWithFilteredResult(_0x2d82e3,_0x117cb5){return function(_0x1e2844){if(_0x1e2844){var _0x32caa6=typeof _0x117cb5[_0x05bf('0x1e')]===_0x05bf('0x1f')&&typeof _0x117cb5['limit']===_0x05bf('0x1f');var _0x5e122f=_0x1e2844['count'];var _0x39afb5=_0x32caa6?0x0:_0x117cb5['offset'];var _0x34f5d2=_0x32caa6?_0x1e2844[_0x05bf('0x20')]:_0x117cb5[_0x05bf('0x1e')]+_0x117cb5[_0x05bf('0x21')];var _0x3a3043;if(_0x34f5d2>=_0x5e122f){_0x34f5d2=_0x5e122f;_0x3a3043=0xc8;}else{_0x3a3043=0xce;}_0x2d82e3[_0x05bf('0x1c')](_0x3a3043);return _0x2d82e3[_0x05bf('0x22')](_0x05bf('0x23'),_0x39afb5+'-'+_0x34f5d2+'/'+_0x5e122f)[_0x05bf('0x1d')](_0x1e2844);}return null;};}function patchUpdates(_0x1cd5cb){return function(_0x9406a5){try{jsonpatch[_0x05bf('0x24')](_0x9406a5,_0x1cd5cb,!![]);}catch(_0x44652d){return BPromise['reject'](_0x44652d);}return _0x9406a5[_0x05bf('0x25')]();};}function saveUpdates(_0xfafb81,_0x46c7f5){return function(_0x51e88b){if(_0x51e88b){return _0x51e88b[_0x05bf('0x26')](_0xfafb81)[_0x05bf('0x27')](function(_0x2cd7dc){return _0x2cd7dc;});}return null;};}function removeEntity(_0x464434,_0x50cb51){return function(_0x48b5e6){if(_0x48b5e6){return _0x48b5e6['destroy']()[_0x05bf('0x27')](function(){_0x464434['status'](0xcc)[_0x05bf('0x1b')]();});}};}function handleEntityNotFound(_0x599f08,_0x1e3ec1){return function(_0xe5419b){if(!_0xe5419b){_0x599f08[_0x05bf('0x1a')](0x194);}return _0xe5419b;};}function handleError(_0x18a135,_0x158fee){_0x158fee=_0x158fee||0x1f4;return function(_0x393dad){logger[_0x05bf('0x28')](_0x393dad[_0x05bf('0x29')]);if(_0x393dad[_0x05bf('0x2a')]){delete _0x393dad[_0x05bf('0x2a')];}_0x18a135[_0x05bf('0x1c')](_0x158fee)[_0x05bf('0x2b')](_0x393dad);};}exports[_0x05bf('0x2c')]=function(_0x59ab42,_0x2b8e6f){var _0x371665={},_0xa21435={},_0x2b167a={'count':0x0,'rows':[]};var _0x560089=_[_0x05bf('0x2d')](db[_0x05bf('0x2e')][_0x05bf('0x2f')],function(_0x2c5b1c){return{'name':_0x2c5b1c['fieldName'],'type':_0x2c5b1c['type']['key']};});_0xa21435[_0x05bf('0x30')]=_['differenceBy'](_['map'](_0x560089,_0x05bf('0x2a')),[_0x05bf('0x2a')]);_0xa21435['query']=_['keys'](_0x59ab42[_0x05bf('0x31')]);_0xa21435[_0x05bf('0x32')]=_[_0x05bf('0x33')](_0xa21435[_0x05bf('0x30')],_0xa21435[_0x05bf('0x31')]);_0x371665[_0x05bf('0x34')]=_[_0x05bf('0x33')](_0xa21435[_0x05bf('0x30')],qs[_0x05bf('0x35')](_0x59ab42['query'][_0x05bf('0x35')]));_0x371665[_0x05bf('0x34')]=_0x371665[_0x05bf('0x34')][_0x05bf('0x36')]?_0x371665[_0x05bf('0x34')]:_0xa21435[_0x05bf('0x30')];if(!_0x59ab42[_0x05bf('0x31')]['hasOwnProperty'](_0x05bf('0x37'))){_0x371665[_0x05bf('0x21')]=qs[_0x05bf('0x21')](_0x59ab42[_0x05bf('0x31')][_0x05bf('0x21')]);_0x371665[_0x05bf('0x1e')]=qs[_0x05bf('0x1e')](_0x59ab42[_0x05bf('0x31')][_0x05bf('0x1e')]);}_0x371665[_0x05bf('0x38')]=qs[_0x05bf('0x39')](_0x59ab42[_0x05bf('0x31')][_0x05bf('0x39')]);_0x371665[_0x05bf('0x3a')]=qs[_0x05bf('0x32')](_['pick'](_0x59ab42[_0x05bf('0x31')],_0xa21435[_0x05bf('0x32')]),_0x560089);if(_0x59ab42[_0x05bf('0x31')][_0x05bf('0x3b')]){_0x371665[_0x05bf('0x3a')]=_['merge'](_0x371665['where'],{'$or':_['map'](_0x560089,function(_0x175c1e){if(_0x175c1e[_0x05bf('0x3c')]!=='VIRTUAL'){var _0x54876e={};_0x54876e[_0x175c1e[_0x05bf('0x2a')]]={'$like':'%'+_0x59ab42[_0x05bf('0x31')]['filter']+'%'};return _0x54876e;}})});}_0x371665=_[_0x05bf('0x3d')]({},_0x371665,_0x59ab42[_0x05bf('0x3e')]);var _0xfea150={'where':_0x371665[_0x05bf('0x3a')]};return db[_0x05bf('0x2e')][_0x05bf('0x20')](_0xfea150)['then'](function(_0x220af6){_0x2b167a[_0x05bf('0x20')]=_0x220af6;if(_0x59ab42[_0x05bf('0x31')]['includeAll']){_0x371665[_0x05bf('0x3f')]=[{'all':!![]}];}return db['CmCustomField'][_0x05bf('0x40')](_0x371665);})[_0x05bf('0x27')](function(_0xccb3ff){_0x2b167a[_0x05bf('0x41')]=_0xccb3ff;return _0x2b167a;})[_0x05bf('0x27')](respondWithFilteredResult(_0x2b8e6f,_0x371665))[_0x05bf('0x42')](handleError(_0x2b8e6f,null));};exports[_0x05bf('0x43')]=function(_0x2af6d6,_0x242584){var _0x5293d9={'raw':!![],'where':{'id':_0x2af6d6[_0x05bf('0x44')]['id']}},_0x270120={};_0x270120[_0x05bf('0x30')]=_[_0x05bf('0x45')](db[_0x05bf('0x2e')][_0x05bf('0x2f')]);_0x270120[_0x05bf('0x31')]=_[_0x05bf('0x45')](_0x2af6d6[_0x05bf('0x31')]);_0x270120[_0x05bf('0x32')]=_[_0x05bf('0x33')](_0x270120['model'],_0x270120['query']);_0x5293d9[_0x05bf('0x34')]=_['intersection'](_0x270120[_0x05bf('0x30')],qs['fields'](_0x2af6d6[_0x05bf('0x31')][_0x05bf('0x35')]));_0x5293d9[_0x05bf('0x34')]=_0x5293d9[_0x05bf('0x34')][_0x05bf('0x36')]?_0x5293d9['attributes']:_0x270120[_0x05bf('0x30')];if(_0x2af6d6[_0x05bf('0x31')][_0x05bf('0x46')]){_0x5293d9[_0x05bf('0x3f')]=[{'all':!![]}];}_0x5293d9=_[_0x05bf('0x3d')]({},_0x5293d9,_0x2af6d6['options']);return db['CmCustomField'][_0x05bf('0x47')](_0x5293d9)[_0x05bf('0x27')](handleEntityNotFound(_0x242584,null))[_0x05bf('0x27')](respondWithResult(_0x242584,null))[_0x05bf('0x42')](handleError(_0x242584,null));};exports['update']=function(_0x51ab5f,_0x3ec467){if(_0x51ab5f[_0x05bf('0x48')]['id']){delete _0x51ab5f[_0x05bf('0x48')]['id'];}return db[_0x05bf('0x2e')]['find']({'where':{'id':_0x51ab5f[_0x05bf('0x44')]['id']}})[_0x05bf('0x27')](handleEntityNotFound(_0x3ec467,null))[_0x05bf('0x27')](saveUpdates(_0x51ab5f[_0x05bf('0x48')],null))[_0x05bf('0x27')](respondWithResult(_0x3ec467,null))[_0x05bf('0x42')](handleError(_0x3ec467,null));};exports['destroy']=function(_0x53dcbd,_0x31faa0){return db[_0x05bf('0x2e')][_0x05bf('0x47')]({'where':{'id':_0x53dcbd[_0x05bf('0x44')]['id']}})[_0x05bf('0x27')](handleEntityNotFound(_0x31faa0,null))[_0x05bf('0x27')](removeEntity(_0x31faa0,null))['catch'](handleError(_0x31faa0,null));};exports['create']=function(_0x410f59,_0x11e9f5){var _0x3353dd;return db['sequelize'][_0x05bf('0x49')](function(_0x4ebaa9){return db['CmCustomField']['create'](_0x410f59[_0x05bf('0x48')],{'transaction':_0x4ebaa9})[_0x05bf('0x27')](function(_0x436008){_0x3353dd=_0x436008;var _0x469b65={'type':db[_0x05bf('0x4a')]['TEXT'],'transaction':_0x4ebaa9};switch(_0x410f59[_0x05bf('0x48')][_0x05bf('0x3c')]){case _0x05bf('0x4b'):_0x469b65[_0x05bf('0x3c')]=db[_0x05bf('0x4a')]['TEXT'];break;case'number':_0x469b65[_0x05bf('0x3c')]=db['Sequelize']['INTEGER'];break;case _0x05bf('0x4c'):_0x469b65[_0x05bf('0x3c')]=db[_0x05bf('0x4a')][_0x05bf('0x4d')];_0x469b65[_0x05bf('0x4e')]=![];break;default:}return db[_0x05bf('0x4f')][_0x05bf('0x50')][_0x05bf('0x51')]('cm_contacts',util[_0x05bf('0x52')](_0x05bf('0x53'),_0x3353dd['id']),_0x469b65);})[_0x05bf('0x27')](function(){return _0x3353dd;});})[_0x05bf('0x27')](respondWithResult(_0x11e9f5,0xc9))[_0x05bf('0x42')](handleError(_0x11e9f5,null));}; \ No newline at end of file +var _0x66eb=['path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','destroy','error','name','map','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','CmCustomField','then','includeAll','include','findAll','rows','catch','show','params','length','options','find','body','create','sequelize','transaction','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','queryInterface','addColumn','format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x66eb,0x1b2));var _0xb66e=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x66eb[_0x48d6a3];return _0x38bfa0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb66e('0x0'));var zipdir=require(_0xb66e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb66e('0x2'));var moment=require(_0xb66e('0x3'));var BPromise=require(_0xb66e('0x4'));var Mustache=require(_0xb66e('0x5'));var util=require('util');var path=require(_0xb66e('0x6'));var sox=require('sox');var csv=require(_0xb66e('0x7'));var ejs=require(_0xb66e('0x8'));var fs=require('fs');var fs_extra=require(_0xb66e('0x9'));var _=require(_0xb66e('0xa'));var squel=require('squel');var crypto=require(_0xb66e('0xb'));var jsforce=require(_0xb66e('0xc'));var deskjs=require(_0xb66e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb66e('0xe'));var Papa=require(_0xb66e('0xf'));var Redis=require(_0xb66e('0x10'));var authService=require(_0xb66e('0x11'));var qs=require(_0xb66e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb66e('0x13'));var logger=require('../../config/logger')(_0xb66e('0x14'));var utils=require(_0xb66e('0x15'));var config=require(_0xb66e('0x16'));var licenseUtil=require(_0xb66e('0x17'));var db=require(_0xb66e('0x18'))['db'];function respondWithStatusCode(_0x411ffe,_0x2e3d20){_0x2e3d20=_0x2e3d20||0xcc;return function(_0x545f98){if(_0x545f98){return _0x411ffe[_0xb66e('0x19')](_0x2e3d20);}return _0x411ffe['status'](_0x2e3d20)[_0xb66e('0x1a')]();};}function respondWithResult(_0x190bf3,_0x4d6fb6){_0x4d6fb6=_0x4d6fb6||0xc8;return function(_0x3b7711){if(_0x3b7711){return _0x190bf3[_0xb66e('0x1b')](_0x4d6fb6)['json'](_0x3b7711);}};}function respondWithFilteredResult(_0x14966b,_0x42e677){return function(_0x5ead65){if(_0x5ead65){var _0x4b0f2e=typeof _0x42e677[_0xb66e('0x1c')]==='undefined'&&typeof _0x42e677[_0xb66e('0x1d')]===_0xb66e('0x1e');var _0x2b4514=_0x5ead65['count'];var _0x258201=_0x4b0f2e?0x0:_0x42e677[_0xb66e('0x1c')];var _0x55df4e=_0x4b0f2e?_0x5ead65[_0xb66e('0x1f')]:_0x42e677['offset']+_0x42e677[_0xb66e('0x1d')];var _0x394d75;if(_0x55df4e>=_0x2b4514){_0x55df4e=_0x2b4514;_0x394d75=0xc8;}else{_0x394d75=0xce;}_0x14966b['status'](_0x394d75);return _0x14966b[_0xb66e('0x20')](_0xb66e('0x21'),_0x258201+'-'+_0x55df4e+'/'+_0x2b4514)[_0xb66e('0x22')](_0x5ead65);}return null;};}function patchUpdates(_0x5291d4){return function(_0x46e3fe){try{jsonpatch[_0xb66e('0x23')](_0x46e3fe,_0x5291d4,!![]);}catch(_0x458fdd){return BPromise[_0xb66e('0x24')](_0x458fdd);}return _0x46e3fe['save']();};}function saveUpdates(_0x4b1daa,_0x1f0b2f){return function(_0xc603de){if(_0xc603de){return _0xc603de[_0xb66e('0x25')](_0x4b1daa)['then'](function(_0xce2ac9){return _0xce2ac9;});}return null;};}function removeEntity(_0x24d90e,_0x268d7d){return function(_0x293002){if(_0x293002){return _0x293002[_0xb66e('0x26')]()['then'](function(){_0x24d90e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4218f3,_0x54c85e){return function(_0x4abb88){if(!_0x4abb88){_0x4218f3['sendStatus'](0x194);}return _0x4abb88;};}function handleError(_0x215001,_0x51fe47){_0x51fe47=_0x51fe47||0x1f4;return function(_0x40aa70){logger[_0xb66e('0x27')](_0x40aa70['stack']);if(_0x40aa70[_0xb66e('0x28')]){delete _0x40aa70['name'];}_0x215001[_0xb66e('0x1b')](_0x51fe47)['send'](_0x40aa70);};}exports['index']=function(_0x2dbd75,_0xb9ae7f){var _0x2213d7={},_0x4cfabd={},_0x491403={'count':0x0,'rows':[]};var _0x4d2b92=_[_0xb66e('0x29')](db['CmCustomField'][_0xb66e('0x2a')],function(_0x48f449){return{'name':_0x48f449[_0xb66e('0x2b')],'type':_0x48f449[_0xb66e('0x2c')][_0xb66e('0x2d')]};});_0x4cfabd['model']=_[_0xb66e('0x2e')](_[_0xb66e('0x29')](_0x4d2b92,_0xb66e('0x28')),[_0xb66e('0x28')]);_0x4cfabd[_0xb66e('0x2f')]=_[_0xb66e('0x30')](_0x2dbd75[_0xb66e('0x2f')]);_0x4cfabd[_0xb66e('0x31')]=_[_0xb66e('0x32')](_0x4cfabd[_0xb66e('0x33')],_0x4cfabd[_0xb66e('0x2f')]);_0x2213d7[_0xb66e('0x34')]=_[_0xb66e('0x32')](_0x4cfabd[_0xb66e('0x33')],qs[_0xb66e('0x35')](_0x2dbd75['query']['fields']));_0x2213d7[_0xb66e('0x34')]=_0x2213d7[_0xb66e('0x34')]['length']?_0x2213d7[_0xb66e('0x34')]:_0x4cfabd['model'];if(!_0x2dbd75[_0xb66e('0x2f')][_0xb66e('0x36')](_0xb66e('0x37'))){_0x2213d7[_0xb66e('0x1d')]=qs[_0xb66e('0x1d')](_0x2dbd75[_0xb66e('0x2f')][_0xb66e('0x1d')]);_0x2213d7[_0xb66e('0x1c')]=qs[_0xb66e('0x1c')](_0x2dbd75[_0xb66e('0x2f')][_0xb66e('0x1c')]);}_0x2213d7[_0xb66e('0x38')]=qs[_0xb66e('0x39')](_0x2dbd75[_0xb66e('0x2f')][_0xb66e('0x39')]);_0x2213d7['where']=qs[_0xb66e('0x31')](_[_0xb66e('0x3a')](_0x2dbd75['query'],_0x4cfabd[_0xb66e('0x31')]),_0x4d2b92);if(_0x2dbd75[_0xb66e('0x2f')][_0xb66e('0x3b')]){_0x2213d7[_0xb66e('0x3c')]=_[_0xb66e('0x3d')](_0x2213d7[_0xb66e('0x3c')],{'$or':_[_0xb66e('0x29')](_0x4d2b92,function(_0x43c572){if(_0x43c572['type']!==_0xb66e('0x3e')){var _0x39ca16={};_0x39ca16[_0x43c572[_0xb66e('0x28')]]={'$like':'%'+_0x2dbd75[_0xb66e('0x2f')][_0xb66e('0x3b')]+'%'};return _0x39ca16;}})});}_0x2213d7=_[_0xb66e('0x3d')]({},_0x2213d7,_0x2dbd75['options']);var _0x49c568={'where':_0x2213d7['where']};return db[_0xb66e('0x3f')]['count'](_0x49c568)[_0xb66e('0x40')](function(_0x35a25d){_0x491403[_0xb66e('0x1f')]=_0x35a25d;if(_0x2dbd75['query'][_0xb66e('0x41')]){_0x2213d7[_0xb66e('0x42')]=[{'all':!![]}];}return db['CmCustomField'][_0xb66e('0x43')](_0x2213d7);})['then'](function(_0x116fc8){_0x491403[_0xb66e('0x44')]=_0x116fc8;return _0x491403;})['then'](respondWithFilteredResult(_0xb9ae7f,_0x2213d7))[_0xb66e('0x45')](handleError(_0xb9ae7f,null));};exports[_0xb66e('0x46')]=function(_0x2960b9,_0x345472){var _0x2db0e1={'raw':!![],'where':{'id':_0x2960b9[_0xb66e('0x47')]['id']}},_0x425a7e={};_0x425a7e[_0xb66e('0x33')]=_[_0xb66e('0x30')](db['CmCustomField'][_0xb66e('0x2a')]);_0x425a7e[_0xb66e('0x2f')]=_[_0xb66e('0x30')](_0x2960b9[_0xb66e('0x2f')]);_0x425a7e[_0xb66e('0x31')]=_['intersection'](_0x425a7e[_0xb66e('0x33')],_0x425a7e[_0xb66e('0x2f')]);_0x2db0e1[_0xb66e('0x34')]=_[_0xb66e('0x32')](_0x425a7e[_0xb66e('0x33')],qs[_0xb66e('0x35')](_0x2960b9[_0xb66e('0x2f')][_0xb66e('0x35')]));_0x2db0e1['attributes']=_0x2db0e1[_0xb66e('0x34')][_0xb66e('0x48')]?_0x2db0e1[_0xb66e('0x34')]:_0x425a7e['model'];if(_0x2960b9[_0xb66e('0x2f')]['includeAll']){_0x2db0e1[_0xb66e('0x42')]=[{'all':!![]}];}_0x2db0e1=_[_0xb66e('0x3d')]({},_0x2db0e1,_0x2960b9[_0xb66e('0x49')]);return db['CmCustomField'][_0xb66e('0x4a')](_0x2db0e1)[_0xb66e('0x40')](handleEntityNotFound(_0x345472,null))['then'](respondWithResult(_0x345472,null))[_0xb66e('0x45')](handleError(_0x345472,null));};exports[_0xb66e('0x25')]=function(_0x34cc90,_0x9eb868){if(_0x34cc90[_0xb66e('0x4b')]['id']){delete _0x34cc90[_0xb66e('0x4b')]['id'];}return db['CmCustomField'][_0xb66e('0x4a')]({'where':{'id':_0x34cc90[_0xb66e('0x47')]['id']}})['then'](handleEntityNotFound(_0x9eb868,null))[_0xb66e('0x40')](saveUpdates(_0x34cc90[_0xb66e('0x4b')],null))[_0xb66e('0x40')](respondWithResult(_0x9eb868,null))['catch'](handleError(_0x9eb868,null));};exports[_0xb66e('0x26')]=function(_0x7c57af,_0x34278b){return db['CmCustomField']['find']({'where':{'id':_0x7c57af[_0xb66e('0x47')]['id']}})['then'](handleEntityNotFound(_0x34278b,null))[_0xb66e('0x40')](removeEntity(_0x34278b,null))[_0xb66e('0x45')](handleError(_0x34278b,null));};exports[_0xb66e('0x4c')]=function(_0x2ba387,_0x1fa5b6){var _0x7c1bdd;return db[_0xb66e('0x4d')][_0xb66e('0x4e')](function(_0x142847){return db['CmCustomField'][_0xb66e('0x4c')](_0x2ba387[_0xb66e('0x4b')],{'transaction':_0x142847})[_0xb66e('0x40')](function(_0x428a62){_0x7c1bdd=_0x428a62;var _0x2336da={'type':db['Sequelize'][_0xb66e('0x4f')],'transaction':_0x142847};switch(_0x2ba387[_0xb66e('0x4b')][_0xb66e('0x2c')]){case _0xb66e('0x50'):_0x2336da[_0xb66e('0x2c')]=db[_0xb66e('0x51')][_0xb66e('0x4f')];break;case'number':_0x2336da[_0xb66e('0x2c')]=db[_0xb66e('0x51')][_0xb66e('0x52')];break;case _0xb66e('0x53'):_0x2336da['type']=db['Sequelize'][_0xb66e('0x54')];_0x2336da['defaultValue']=![];break;default:}return db[_0xb66e('0x4d')][_0xb66e('0x55')][_0xb66e('0x56')]('cm_contacts',util[_0xb66e('0x57')]('cf_%d',_0x7c1bdd['id']),_0x2336da);})[_0xb66e('0x40')](function(){return _0x7c1bdd;});})['then'](respondWithResult(_0x1fa5b6,0xc9))['catch'](handleError(_0x1fa5b6,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 11605f4..df4921d 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 _0xc128=['CmCustomField','cm_custom_fields','util','api','request-promise','./cmCustomField.attributes','exports','define'];(function(_0x37455e,_0x1c1bc9){var _0x1b8aa0=function(_0x459eb){while(--_0x459eb){_0x37455e['push'](_0x37455e['shift']());}};_0x1b8aa0(++_0x1c1bc9);}(_0xc128,0x14a));var _0x8c12=function(_0x3c2a65,_0x1fcf1c){_0x3c2a65=_0x3c2a65-0x0;var _0x456c5e=_0xc128[_0x3c2a65];return _0x456c5e;};'use strict';var _=require('lodash');var util=require(_0x8c12('0x0'));var logger=require('../../config/logger')(_0x8c12('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8c12('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8c12('0x3'));module[_0x8c12('0x4')]=function(_0x47a0e8,_0x4e53f7){return _0x47a0e8[_0x8c12('0x5')](_0x8c12('0x6'),attributes,{'tableName':_0x8c12('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b24=['CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cmCustomField.attributes','exports','define'];(function(_0x45eac8,_0x368705){var _0x1564d8=function(_0x4d5bed){while(--_0x4d5bed){_0x45eac8['push'](_0x45eac8['shift']());}};_0x1564d8(++_0x368705);}(_0x9b24,0x195));var _0x49b2=function(_0x118aa5,_0x3e5626){_0x118aa5=_0x118aa5-0x0;var _0x5f0a27=_0x9b24[_0x118aa5];return _0x5f0a27;};'use strict';var _=require(_0x49b2('0x0'));var util=require(_0x49b2('0x1'));var logger=require(_0x49b2('0x2'))(_0x49b2('0x3'));var moment=require(_0x49b2('0x4'));var BPromise=require(_0x49b2('0x5'));var rp=require(_0x49b2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x49b2('0x7'));var attributes=require(_0x49b2('0x8'));module[_0x49b2('0x9')]=function(_0x478a9f,_0x57b9f5){return _0x478a9f[_0x49b2('0xa')](_0x49b2('0xb'),attributes,{'tableName':_0x49b2('0xc'),'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 ef0005a..6cc5213 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 _0x7c7e=['request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x19bf9d,_0x29536c){var _0x7497b=function(_0xbb9eef){while(--_0xbb9eef){_0x19bf9d['push'](_0x19bf9d['shift']());}};_0x7497b(++_0x29536c);}(_0x7c7e,0x15f));var _0xe7c7=function(_0x207228,_0x3c8dd0){_0x207228=_0x207228-0x0;var _0x496f9b=_0x7c7e[_0x207228];return _0x496f9b;};'use strict';var _=require(_0xe7c7('0x0'));var util=require(_0xe7c7('0x1'));var moment=require(_0xe7c7('0x2'));var BPromise=require(_0xe7c7('0x3'));var rs=require(_0xe7c7('0x4'));var fs=require('fs');var Redis=require(_0xe7c7('0x5'));var db=require(_0xe7c7('0x6'))['db'];var utils=require(_0xe7c7('0x7'));var logger=require('../../config/logger')(_0xe7c7('0x8'));var config=require(_0xe7c7('0x9'));var jayson=require(_0xe7c7('0xa'));var client=jayson[_0xe7c7('0xb')][_0xe7c7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x222f98,_0x4a895d,_0x4a663c){return new BPromise(function(_0x1fb93d,_0x5491e4){return client[_0xe7c7('0xd')](_0x222f98,_0x4a663c)[_0xe7c7('0xe')](function(_0x59193a){logger[_0xe7c7('0xf')](_0xe7c7('0x10'),_0x4a895d,_0xe7c7('0x11'));logger[_0xe7c7('0x12')](_0xe7c7('0x13'),_0x4a895d,_0xe7c7('0x11'),JSON[_0xe7c7('0x14')](_0x59193a));if(_0x59193a[_0xe7c7('0x15')]){if(_0x59193a[_0xe7c7('0x15')][_0xe7c7('0x16')]===0x1f4){logger[_0xe7c7('0x15')](_0xe7c7('0x10'),_0x4a895d,_0x59193a['error'][_0xe7c7('0x17')]);return _0x5491e4(_0x59193a[_0xe7c7('0x15')][_0xe7c7('0x17')]);}logger[_0xe7c7('0x15')]('CmCustomField,\x20%s,\x20%s',_0x4a895d,_0x59193a[_0xe7c7('0x15')][_0xe7c7('0x17')]);return _0x1fb93d(_0x59193a[_0xe7c7('0x15')]['message']);}else{logger[_0xe7c7('0xf')](_0xe7c7('0x10'),_0x4a895d,'request\x20sent');_0x1fb93d(_0x59193a[_0xe7c7('0x18')]['message']);}})[_0xe7c7('0x19')](function(_0x3cf74b){logger[_0xe7c7('0x15')](_0xe7c7('0x10'),_0x4a895d,_0x3cf74b);_0x5491e4(_0x3cf74b);});});} \ No newline at end of file +var _0x96c0=['http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0x96c0,0x140));var _0x096c=function(_0x4e668f,_0x41fa68){_0x4e668f=_0x4e668f-0x0;var _0x139a90=_0x96c0[_0x4e668f];return _0x139a90;};'use strict';var _=require('lodash');var util=require(_0x096c('0x0'));var moment=require(_0x096c('0x1'));var BPromise=require(_0x096c('0x2'));var rs=require(_0x096c('0x3'));var fs=require('fs');var Redis=require(_0x096c('0x4'));var db=require(_0x096c('0x5'))['db'];var utils=require(_0x096c('0x6'));var logger=require(_0x096c('0x7'))(_0x096c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x096c('0x9')][_0x096c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6e025a,_0x1ec501,_0x5ca5db){return new BPromise(function(_0x36fea4,_0x3b9aa1){return client[_0x096c('0xb')](_0x6e025a,_0x5ca5db)['then'](function(_0x4446ba){logger[_0x096c('0xc')](_0x096c('0xd'),_0x1ec501,_0x096c('0xe'));logger[_0x096c('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x1ec501,_0x096c('0xe'),JSON[_0x096c('0x10')](_0x4446ba));if(_0x4446ba[_0x096c('0x11')]){if(_0x4446ba[_0x096c('0x11')][_0x096c('0x12')]===0x1f4){logger[_0x096c('0x11')](_0x096c('0xd'),_0x1ec501,_0x4446ba[_0x096c('0x11')][_0x096c('0x13')]);return _0x3b9aa1(_0x4446ba[_0x096c('0x11')][_0x096c('0x13')]);}logger[_0x096c('0x11')](_0x096c('0xd'),_0x1ec501,_0x4446ba[_0x096c('0x11')][_0x096c('0x13')]);return _0x36fea4(_0x4446ba[_0x096c('0x11')][_0x096c('0x13')]);}else{logger[_0x096c('0xc')](_0x096c('0xd'),_0x1ec501,_0x096c('0xe'));_0x36fea4(_0x4446ba[_0x096c('0x14')][_0x096c('0x13')]);}})[_0x096c('0x15')](function(_0x338407){logger[_0x096c('0x11')](_0x096c('0xd'),_0x1ec501,_0x338407);_0x3b9aa1(_0x338407);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index f32f86d..922ddfa 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 _0xbcba=['put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id'];(function(_0x3ee99e,_0x4affec){var _0x1b56e1=function(_0x3857a2){while(--_0x3857a2){_0x3ee99e['push'](_0x3ee99e['shift']());}};_0x1b56e1(++_0x4affec);}(_0xbcba,0x6d));var _0xabcb=function(_0x3c11bd,_0x4e1f83){_0x3c11bd=_0x3c11bd-0x0;var _0x48d520=_0xbcba[_0x3c11bd];return _0x48d520;};'use strict';var multer=require(_0xabcb('0x0'));var util=require(_0xabcb('0x1'));var path=require('path');var timeout=require(_0xabcb('0x2'));var express=require(_0xabcb('0x3'));var router=express[_0xabcb('0x4')]();var fs_extra=require(_0xabcb('0x5'));var auth=require(_0xabcb('0x6'));var interaction=require(_0xabcb('0x7'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0xabcb('0x8')]('/',auth[_0xabcb('0x9')](),controller['index']);router['get'](_0xabcb('0xa'),auth[_0xabcb('0x9')](),controller['show']);router['post']('/',auth[_0xabcb('0x9')](),controller['create']);router[_0xabcb('0xb')](_0xabcb('0xa'),auth[_0xabcb('0x9')](),controller[_0xabcb('0xc')]);router['delete'](_0xabcb('0xa'),auth[_0xabcb('0x9')](),controller[_0xabcb('0xd')]);module[_0xabcb('0xe')]=router; \ No newline at end of file +var _0x5e11=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','destroy'];(function(_0x4c7156,_0xdbfbad){var _0xb36180=function(_0x3d23da){while(--_0x3d23da){_0x4c7156['push'](_0x4c7156['shift']());}};_0xb36180(++_0xdbfbad);}(_0x5e11,0x1c3));var _0x15e1=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x5e11[_0x47fd36];return _0x21a0fc;};'use strict';var multer=require(_0x15e1('0x0'));var util=require('util');var path=require(_0x15e1('0x1'));var timeout=require(_0x15e1('0x2'));var express=require(_0x15e1('0x3'));var router=express[_0x15e1('0x4')]();var fs_extra=require(_0x15e1('0x5'));var auth=require(_0x15e1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x15e1('0x7'));var controller=require('./cmCustomField.controller');router[_0x15e1('0x8')]('/',auth[_0x15e1('0x9')](),controller[_0x15e1('0xa')]);router[_0x15e1('0x8')](_0x15e1('0xb'),auth['isAuthenticated'](),controller[_0x15e1('0xc')]);router[_0x15e1('0xd')]('/',auth[_0x15e1('0x9')](),controller[_0x15e1('0xe')]);router['put'](_0x15e1('0xb'),auth[_0x15e1('0x9')](),controller[_0x15e1('0xf')]);router['delete'](_0x15e1('0xb'),auth[_0x15e1('0x9')](),controller[_0x15e1('0x10')]);module[_0x15e1('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 8dc3185..821ca54 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 _0x2a3d=['BOOLEAN','DATE','format','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0x2a3d,0x1e6));var _0xd2a3=function(_0x3fa2e0,_0x5b7a69){_0x3fa2e0=_0x3fa2e0-0x0;var _0x5c6ccd=_0x2a3d[_0x3fa2e0];return _0x5c6ccd;};'use strict';var moment=require(_0xd2a3('0x0'));var Sequelize=require(_0xd2a3('0x1'));module[_0xd2a3('0x2')]={'phone':{'type':Sequelize[_0xd2a3('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xd2a3('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xd2a3('0x5')],'defaultValue':moment()[_0xd2a3('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xd2a3('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd2a3('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd2a3('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd2a3('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xd2a3('0x7')](0x2)[_0xd2a3('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xd2a3('0x7')],'unique':_0xd2a3('0x9')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xd2a3('0x9')},'UserId':{'type':Sequelize[_0xd2a3('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xd2a3('0x7')],'unique':_0xd2a3('0x9')},'CampaignId':{'type':Sequelize[_0xd2a3('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd2a3('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd2a3('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd2a3('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0x20a9=['UNSIGNED','contactListQueue','moment','exports','STRING','BOOLEAN','format','INTEGER','DATE'];(function(_0x2d6b1c,_0x595f23){var _0x15a215=function(_0x952ebe){while(--_0x952ebe){_0x2d6b1c['push'](_0x2d6b1c['shift']());}};_0x15a215(++_0x595f23);}(_0x20a9,0xd1));var _0x920a=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x20a9[_0x3c2a69];return _0x596bc8;};'use strict';var moment=require(_0x920a('0x0'));var Sequelize=require('sequelize');module[_0x920a('0x1')]={'phone':{'type':Sequelize[_0x920a('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x920a('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x920a('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x920a('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x920a('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x920a('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x920a('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x920a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x920a('0x6')]},'priority':{'type':Sequelize[_0x920a('0x5')](0x2)[_0x920a('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x920a('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x920a('0x5')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x920a('0x5')],'unique':_0x920a('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x920a('0x5')],'unique':_0x920a('0x8')},'CampaignId':{'type':Sequelize[_0x920a('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x920a('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x920a('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x920a('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x920a('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x920a('0x5')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index fd280e6..1d37591 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 _0x3415=['$like','$notLike','$iLike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','describe','find','CampaignId','VoiceQueue','Campaign','VoiceQueueId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getPreview','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','isEmpty','hopperIds','priority','ASC','DESC','literal','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','UPDATE','CmCompany','Company','CmList','List','Queue','getOpenContacts','getVoiceQueues','isNumber','json','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','count','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','send','map','CmHopper','fieldName','type','key','model','query','keys','filters','concat','$or','$gte','$lt','$lte','$ne','$eq','$not','$notBetween'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3415,0xf0));var _0x5341=function(_0x494587,_0x3fe631){_0x494587=_0x494587-0x0;var _0x1d2692=_0x3415[_0x494587];return _0x1d2692;};'use strict';var emlformat=require(_0x5341('0x0'));var rimraf=require(_0x5341('0x1'));var zipdir=require(_0x5341('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5341('0x3'));var moment=require(_0x5341('0x4'));var BPromise=require(_0x5341('0x5'));var Mustache=require(_0x5341('0x6'));var util=require(_0x5341('0x7'));var path=require(_0x5341('0x8'));var sox=require(_0x5341('0x9'));var csv=require(_0x5341('0xa'));var ejs=require(_0x5341('0xb'));var fs=require('fs');var fs_extra=require(_0x5341('0xc'));var _=require('lodash');var squel=require(_0x5341('0xd'));var crypto=require('crypto');var jsforce=require(_0x5341('0xe'));var deskjs=require(_0x5341('0xf'));var toCsv=require(_0x5341('0xa'));var querystring=require(_0x5341('0x10'));var Papa=require(_0x5341('0x11'));var Redis=require(_0x5341('0x12'));var authService=require(_0x5341('0x13'));var qs=require(_0x5341('0x14'));var as=require(_0x5341('0x15'));var hardwareService=require(_0x5341('0x16'));var logger=require(_0x5341('0x17'))('api');var utils=require(_0x5341('0x18'));var config=require(_0x5341('0x19'));var licenseUtil=require(_0x5341('0x1a'));var db=require(_0x5341('0x1b'))['db'];function respondWithStatusCode(_0x43039e,_0x2caaab){_0x2caaab=_0x2caaab||0xcc;return function(_0x1f5537){if(_0x1f5537){return _0x43039e['sendStatus'](_0x2caaab);}return _0x43039e['status'](_0x2caaab)[_0x5341('0x1c')]();};}function respondWithResult(_0x344144,_0x1561ac){_0x1561ac=_0x1561ac||0xc8;return function(_0x50a4b3){if(_0x50a4b3){return _0x344144[_0x5341('0x1d')](_0x1561ac)['json'](_0x50a4b3);}};}function respondWithFilteredResult(_0x556ec8,_0x4ddf1f){return function(_0x2d3b37){if(_0x2d3b37){var _0x4ee393=typeof _0x4ddf1f[_0x5341('0x1e')]==='undefined'&&typeof _0x4ddf1f['limit']==='undefined';var _0x5e3ba3=_0x2d3b37[_0x5341('0x1f')];var _0x2aac69=_0x4ee393?0x0:_0x4ddf1f[_0x5341('0x1e')];var _0x593074=_0x4ee393?_0x2d3b37[_0x5341('0x1f')]:_0x4ddf1f[_0x5341('0x1e')]+_0x4ddf1f[_0x5341('0x20')];var _0x611ce5;if(_0x593074>=_0x5e3ba3){_0x593074=_0x5e3ba3;_0x611ce5=0xc8;}else{_0x611ce5=0xce;}_0x556ec8[_0x5341('0x1d')](_0x611ce5);return _0x556ec8[_0x5341('0x21')](_0x5341('0x22'),_0x2aac69+'-'+_0x593074+'/'+_0x5e3ba3)['json'](_0x2d3b37);}return null;};}function patchUpdates(_0x229ff3){return function(_0x51e1a2){try{jsonpatch[_0x5341('0x23')](_0x51e1a2,_0x229ff3,!![]);}catch(_0xf2ac60){return BPromise['reject'](_0xf2ac60);}return _0x51e1a2[_0x5341('0x24')]();};}function saveUpdates(_0x2d350e,_0x1a169a){return function(_0x587eb0){if(_0x587eb0){return _0x587eb0[_0x5341('0x25')](_0x2d350e)[_0x5341('0x26')](function(_0x24b6b8){return _0x24b6b8;});}return null;};}function removeEntity(_0x8c009f,_0x171a13){return function(_0x2b5d45){if(_0x2b5d45){return _0x2b5d45[_0x5341('0x27')]()[_0x5341('0x26')](function(){_0x8c009f[_0x5341('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54ccec,_0x40a7db){return function(_0x15cdef){if(!_0x15cdef){_0x54ccec[_0x5341('0x28')](0x194);}return _0x15cdef;};}function handleError(_0x11b0ac,_0x217926){_0x217926=_0x217926||0x1f4;return function(_0x3194ff){logger[_0x5341('0x29')](_0x3194ff['stack']);if(_0x3194ff[_0x5341('0x2a')]){delete _0x3194ff[_0x5341('0x2a')];}_0x11b0ac[_0x5341('0x1d')](_0x217926)[_0x5341('0x2b')](_0x3194ff);};}exports['index']=function(_0x543664,_0x68e0e4){var _0x183047={},_0x1dc046={},_0x23f8eb={'count':0x0,'rows':[]};var _0xb332e4=_[_0x5341('0x2c')](db[_0x5341('0x2d')]['rawAttributes'],function(_0xa9146f){return{'name':_0xa9146f[_0x5341('0x2e')],'type':_0xa9146f[_0x5341('0x2f')][_0x5341('0x30')]};});_0x1dc046[_0x5341('0x31')]=_[_0x5341('0x2c')](_0xb332e4,_0x5341('0x2a'));_0x1dc046[_0x5341('0x32')]=_[_0x5341('0x33')](_0x543664[_0x5341('0x32')]);_0x1dc046[_0x5341('0x34')]=_['intersection'](_0x1dc046[_0x5341('0x31')],_0x1dc046['query']);_0x1dc046['filters']=_[_0x5341('0x35')](_0x1dc046['filters'],['$and',_0x5341('0x36'),'$gt',_0x5341('0x37'),_0x5341('0x38'),_0x5341('0x39'),_0x5341('0x3a'),_0x5341('0x3b'),_0x5341('0x3c'),'$between',_0x5341('0x3d'),'$in','$notIn',_0x5341('0x3e'),_0x5341('0x3f'),_0x5341('0x40'),'$notILike',_0x5341('0x3e'),_0x5341('0x41'),_0x5341('0x42'),_0x5341('0x43'),_0x5341('0x44')]);_0x183047[_0x5341('0x45')]=_[_0x5341('0x46')](_0x1dc046[_0x5341('0x31')],qs['fields'](_0x543664[_0x5341('0x32')][_0x5341('0x47')]));_0x183047[_0x5341('0x45')]=_0x183047[_0x5341('0x45')][_0x5341('0x48')]?_0x183047[_0x5341('0x45')]:_0x1dc046[_0x5341('0x31')];if(!_0x543664['query'][_0x5341('0x49')](_0x5341('0x4a'))){_0x183047['limit']=qs['limit'](_0x543664[_0x5341('0x32')][_0x5341('0x20')]);_0x183047[_0x5341('0x1e')]=qs['offset'](_0x543664[_0x5341('0x32')][_0x5341('0x1e')]);}_0x183047[_0x5341('0x4b')]=qs['sort'](_0x543664[_0x5341('0x32')][_0x5341('0x4c')]);_0x183047[_0x5341('0x4d')]=qs['filters'](_[_0x5341('0x4e')](_0x543664[_0x5341('0x32')],_0x1dc046[_0x5341('0x34')]),_0xb332e4);if(_0x543664[_0x5341('0x32')]['filter']){_0x183047[_0x5341('0x4d')]=_[_0x5341('0x4f')](_0x183047['where'],{'$or':_[_0x5341('0x2c')](_0xb332e4,function(_0x2770b9){if(_0x2770b9[_0x5341('0x2f')]!==_0x5341('0x50')){var _0x7eefea={};_0x7eefea[_0x2770b9[_0x5341('0x2a')]]={'$like':'%'+_0x543664[_0x5341('0x32')]['filter']+'%'};return _0x7eefea;}})});}_0x183047=_[_0x5341('0x4f')]({},_0x183047,_0x543664[_0x5341('0x51')]);var _0x34e5ba={'where':_0x183047[_0x5341('0x4d')]};return db[_0x5341('0x2d')][_0x5341('0x1f')](_0x34e5ba)[_0x5341('0x26')](function(_0xf08dfb){_0x23f8eb[_0x5341('0x1f')]=_0xf08dfb;if(_0x543664[_0x5341('0x32')][_0x5341('0x52')]){_0x183047[_0x5341('0x53')]=[{'all':!![]}];}return db['CmHopper'][_0x5341('0x54')](_0x183047);})[_0x5341('0x26')](function(_0x130cc1){_0x23f8eb[_0x5341('0x55')]=_0x130cc1;return _0x23f8eb;})[_0x5341('0x26')](respondWithFilteredResult(_0x68e0e4,_0x183047))[_0x5341('0x56')](handleError(_0x68e0e4,null));};exports[_0x5341('0x57')]=function(_0x2f0c3f,_0x5d2d1b){var _0x252961={'raw':!![],'where':{'id':_0x2f0c3f[_0x5341('0x58')]['id']}},_0x4d672a={};_0x4d672a[_0x5341('0x31')]=_['keys'](db['CmHopper'][_0x5341('0x59')]);_0x4d672a['query']=_[_0x5341('0x33')](_0x2f0c3f[_0x5341('0x32')]);_0x4d672a[_0x5341('0x34')]=_['intersection'](_0x4d672a['model'],_0x4d672a[_0x5341('0x32')]);_0x252961[_0x5341('0x45')]=_[_0x5341('0x46')](_0x4d672a[_0x5341('0x31')],qs[_0x5341('0x47')](_0x2f0c3f['query'][_0x5341('0x47')]));_0x252961[_0x5341('0x45')]=_0x252961[_0x5341('0x45')][_0x5341('0x48')]?_0x252961['attributes']:_0x4d672a[_0x5341('0x31')];if(_0x2f0c3f[_0x5341('0x32')]['includeAll']){_0x252961[_0x5341('0x53')]=[{'all':!![]}];}_0x252961=_[_0x5341('0x4f')]({},_0x252961,_0x2f0c3f[_0x5341('0x51')]);return db[_0x5341('0x2d')]['find'](_0x252961)[_0x5341('0x26')](handleEntityNotFound(_0x5d2d1b,null))[_0x5341('0x26')](respondWithResult(_0x5d2d1b,null))[_0x5341('0x56')](handleError(_0x5d2d1b,null));};exports[_0x5341('0x5a')]=function(_0xd21716,_0x24cd7c){return db['CmHopper'][_0x5341('0x5a')](_0xd21716['body'],{})[_0x5341('0x26')](respondWithResult(_0x24cd7c,0xc9))[_0x5341('0x56')](handleError(_0x24cd7c,null));};exports[_0x5341('0x25')]=function(_0x5462b4,_0x4a9837){if(_0x5462b4[_0x5341('0x5b')]['id']){delete _0x5462b4[_0x5341('0x5b')]['id'];}return db[_0x5341('0x2d')]['find']({'where':{'id':_0x5462b4[_0x5341('0x58')]['id']}})[_0x5341('0x26')](handleEntityNotFound(_0x4a9837,null))[_0x5341('0x26')](saveUpdates(_0x5462b4[_0x5341('0x5b')],null))['then'](respondWithResult(_0x4a9837,null))['catch'](handleError(_0x4a9837,null));};exports['describe']=function(_0x46c4f3,_0x38ce22){return db[_0x5341('0x2d')][_0x5341('0x5c')]()[_0x5341('0x26')](respondWithResult(_0x38ce22,null))[_0x5341('0x56')](handleError(_0x38ce22,null));};exports[_0x5341('0x27')]=function(_0x16bb17,_0x4e3ecc){var _0x2a78ab;return db['CmHopper'][_0x5341('0x5d')]({'where':{'id':_0x16bb17[_0x5341('0x58')]['id']}})['then'](handleEntityNotFound(_0x4e3ecc,null))[_0x5341('0x26')](function(_0x13411b){if(_0x13411b){return _0x13411b[_0x5341('0x27')]()[_0x5341('0x26')](function(_0x3fa602){return _0x3fa602;});}})['then'](function(_0x3d22bc){_0x2a78ab=_0x3d22bc;if(_0x3d22bc){if(_0x3d22bc['VoiceQueueId']||_0x3d22bc[_0x5341('0x5e')]){return db[_0x3d22bc['VoiceQueueId']?_0x5341('0x5f'):_0x5341('0x60')]['find']({'where':{'id':_0x3d22bc[_0x5341('0x61')]?_0x3d22bc[_0x5341('0x61')]:_0x3d22bc[_0x5341('0x5e')]},'attributes':['id',_0x5341('0x2a')],'raw':!![]});}}})[_0x5341('0x26')](function(_0x4f7b28){var _0xc02c4f={};if(_0x4f7b28){_['merge'](_0xc02c4f,_[_0x5341('0x62')](_0x2a78ab[_0x5341('0x63')],[_0x5341('0x64'),_0x5341('0x65'),'id']));_0xc02c4f[_0x5341('0x66')]=0x15;_0xc02c4f[_0x5341('0x67')]=_0x5341('0x68');_0xc02c4f['campaign']=_0x4f7b28[_0x5341('0x2a')];_0xc02c4f[_0x5341('0x69')]=_0x16bb17['user']['name'];_0xc02c4f[_0x5341('0x6a')]=_0x16bb17[_0x5341('0x6b')]['id'];_0xc02c4f['deleted']=!![];_0xc02c4f[_0x5341('0x6c')]=moment()[_0x5341('0x6d')](_0x5341('0x6e'));_0xc02c4f[_0x5341('0x6f')]=_0x2a78ab[_0x5341('0x70')];_0xc02c4f[_0x5341('0x71')]=_0x2a78ab[_0x5341('0x61')]?_0x5341('0x72'):_0x5341('0x73');return db[_0x5341('0x74')][_0x5341('0x5d')]({'where':{'id':_0xc02c4f[_0x5341('0x75')]},'attributes':[_0x5341('0x76'),_0x5341('0x77')]})['then'](function(_0xa1e79d){if(!_['isNil'](_0x4e3ecc)&&!_[_0x5341('0x78')](_0xa1e79d[_0x5341('0x76')])){_0xc02c4f[_0x5341('0x79')]=_0xa1e79d['firstName'];if(!_[_0x5341('0x78')](_0xa1e79d['lastName'])){_0xc02c4f[_0x5341('0x79')]+='\x20'+_0xa1e79d[_0x5341('0x77')];}}})[_0x5341('0x7a')](function(){return db['CmHopperFinal'][_0x5341('0x5a')](_0xc02c4f);});}})[_0x5341('0x26')](function(){return _0x4e3ecc[_0x5341('0x1d')](0xcc)[_0x5341('0x1c')]();})[_0x5341('0x56')](handleError(_0x4e3ecc,null));};exports[_0x5341('0x7b')]=function(_0x365983,_0x49f70a,_0x101f96){var _0x219eb3=[];return db[_0x5341('0x74')][_0x5341('0x5c')]()[_0x5341('0x26')](function(_0xf19fe7){_0x219eb3=_[_0x5341('0x33')](_0xf19fe7);return _0x365983[_0x5341('0x6b')]['getVoiceQueues']({'where':{'type':_0x5341('0x7c'),'dialActive':!![],'dialMethod':_0x5341('0x7d')},'attributes':['id',_0x5341('0x7e')],'raw':!![]});})[_0x5341('0x26')](function(_0x467917){if(_0x467917&&_0x467917[_0x5341('0x48')]){return db[_0x5341('0x7f')][_0x5341('0x80')](function(_0x3f53cf){var _0x516c7a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5341('0x6d')](_0x5341('0x6e'))},'VoiceQueueId':{'$in':_[_0x5341('0x2c')](_0x467917,'id')},'$or':[{'UserId':null},{'UserId':_0x365983[_0x5341('0x6b')]['id']}]};var _0x2136f2=[];if(_0x365983['body']['direction']&&_0x365983[_0x5341('0x5b')][_0x5341('0x81')]==='prev'){if(!_[_0x5341('0x82')](_0x365983[_0x5341('0x5b')][_0x5341('0x83')])){_0x516c7a['id']={'$in':_0x365983[_0x5341('0x5b')][_0x5341('0x83')]};}_0x2136f2=[[_0x5341('0x84'),_0x5341('0x85')],['scheduledAt',_0x467917[0x0][_0x5341('0x7e')]==='ASC'?_0x5341('0x86'):_0x5341('0x85')],db[_0x5341('0x7f')][_0x5341('0x87')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x5341('0x86')]];}else{if(!_['isEmpty'](_0x365983[_0x5341('0x5b')][_0x5341('0x83')])){_0x516c7a['id']={'$notIn':_0x365983['body']['hopperIds']};}_0x2136f2=[[_0x5341('0x84'),_0x5341('0x86')],[_0x5341('0x88'),_0x467917[0x0][_0x5341('0x7e')]],db[_0x5341('0x7f')][_0x5341('0x87')](_0x5341('0x89')),['id',_0x5341('0x85')]];}return db[_0x5341('0x2d')]['findOne']({'attributes':['id',_0x5341('0x8a')],'where':_0x516c7a,'order':_0x2136f2,'transaction':_0x3f53cf,'lock':_0x3f53cf['LOCK'][_0x5341('0x8b')],'include':[{'model':db[_0x5341('0x74')],'as':'Contact','attributes':_0x219eb3,'include':[{'model':db[_0x5341('0x8c')],'as':_0x5341('0x8d'),'attributes':['id','name']}]},{'model':db[_0x5341('0x8e')],'as':_0x5341('0x8f'),'attributes':['id',_0x5341('0x2a')]},{'model':db[_0x5341('0x5f')],'as':_0x5341('0x90'),'attributes':['id','name','dialActive']}]})[_0x5341('0x26')](function(_0x1b2e4e){if(_0x1b2e4e){return _0x1b2e4e[_0x5341('0x25')]({'UserId':_0x365983[_0x5341('0x6b')]['id']},{'transaction':_0x3f53cf});}});});}})[_0x5341('0x26')](handleEntityNotFound(_0x49f70a,null))[_0x5341('0x26')](respondWithResult(_0x49f70a,null))[_0x5341('0x56')](handleError(_0x49f70a,null));};exports[_0x5341('0x91')]=function(_0x1f6e3d,_0x1efd13,_0x52c861){return _0x1f6e3d[_0x5341('0x6b')][_0x5341('0x92')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x5341('0x7d')},'attributes':['id'],'raw':!![]})['then'](function(_0x4a8049){if(_0x4a8049&&_0x4a8049['length']){return db[_0x5341('0x2d')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x5341('0x6e'))},'VoiceQueueId':{'$in':_['map'](_0x4a8049,'id')},'$or':[{'UserId':null},{'UserId':_0x1f6e3d[_0x5341('0x6b')]['id']}]}});}return 0x0;})[_0x5341('0x26')](function(_0xd59049){if(!_['isNil'](_0xd59049)&&_[_0x5341('0x93')](_0xd59049)){return _0x1efd13[_0x5341('0x1d')](0xc8)[_0x5341('0x94')]({'contacts':_0xd59049});}else{logger[_0x5341('0x29')](_0x5341('0x95'),_0x5341('0x91'),0x194,_0x5341('0x96'));_0x1efd13[_0x5341('0x28')](0x194);}})[_0x5341('0x56')](handleError(_0x1efd13,null));}; \ No newline at end of file +var _0xfdca=['prev','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','sequelize','findOne','scheduledat','LOCK','Contact','CmCompany','Company','Queue','dialActive','update','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','then','destroy','error','stack','name','index','map','CmHopper','rawAttributes','type','key','model','keys','filters','intersection','query','$and','$or','$gt','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notILike','$contained','$any','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','params','find','catch','create','body','describe','VoiceQueueId','VoiceQueue','Campaign','merge','omit','dataValues','updatedAt','campaign','UserId','user','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmContact','getVoiceQueues','preview','direction'];(function(_0x5609a7,_0x464eeb){var _0x30449e=function(_0x2b78f3){while(--_0x2b78f3){_0x5609a7['push'](_0x5609a7['shift']());}};_0x30449e(++_0x464eeb);}(_0xfdca,0xa8));var _0xafdc=function(_0x4fbba1,_0x1f75e5){_0x4fbba1=_0x4fbba1-0x0;var _0x4a3c41=_0xfdca[_0x4fbba1];return _0x4a3c41;};'use strict';var emlformat=require(_0xafdc('0x0'));var rimraf=require(_0xafdc('0x1'));var zipdir=require(_0xafdc('0x2'));var jsonpatch=require(_0xafdc('0x3'));var rp=require(_0xafdc('0x4'));var moment=require(_0xafdc('0x5'));var BPromise=require(_0xafdc('0x6'));var Mustache=require(_0xafdc('0x7'));var util=require(_0xafdc('0x8'));var path=require(_0xafdc('0x9'));var sox=require(_0xafdc('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xafdc('0xb'));var _=require('lodash');var squel=require(_0xafdc('0xc'));var crypto=require(_0xafdc('0xd'));var jsforce=require(_0xafdc('0xe'));var deskjs=require(_0xafdc('0xf'));var toCsv=require(_0xafdc('0x10'));var querystring=require(_0xafdc('0x11'));var Papa=require(_0xafdc('0x12'));var Redis=require(_0xafdc('0x13'));var authService=require(_0xafdc('0x14'));var qs=require(_0xafdc('0x15'));var as=require(_0xafdc('0x16'));var hardwareService=require(_0xafdc('0x17'));var logger=require(_0xafdc('0x18'))(_0xafdc('0x19'));var utils=require(_0xafdc('0x1a'));var config=require(_0xafdc('0x1b'));var licenseUtil=require(_0xafdc('0x1c'));var db=require(_0xafdc('0x1d'))['db'];function respondWithStatusCode(_0x106a2f,_0x5169b4){_0x5169b4=_0x5169b4||0xcc;return function(_0x54b5e1){if(_0x54b5e1){return _0x106a2f[_0xafdc('0x1e')](_0x5169b4);}return _0x106a2f[_0xafdc('0x1f')](_0x5169b4)[_0xafdc('0x20')]();};}function respondWithResult(_0xcc2c8,_0xa0f6fe){_0xa0f6fe=_0xa0f6fe||0xc8;return function(_0x1255e2){if(_0x1255e2){return _0xcc2c8['status'](_0xa0f6fe)[_0xafdc('0x21')](_0x1255e2);}};}function respondWithFilteredResult(_0x267003,_0x3fab47){return function(_0x5a4286){if(_0x5a4286){var _0x315dc9=typeof _0x3fab47[_0xafdc('0x22')]==='undefined'&&typeof _0x3fab47[_0xafdc('0x23')]===_0xafdc('0x24');var _0x48175d=_0x5a4286[_0xafdc('0x25')];var _0x54017d=_0x315dc9?0x0:_0x3fab47[_0xafdc('0x22')];var _0x16dc52=_0x315dc9?_0x5a4286[_0xafdc('0x25')]:_0x3fab47['offset']+_0x3fab47['limit'];var _0x361adb;if(_0x16dc52>=_0x48175d){_0x16dc52=_0x48175d;_0x361adb=0xc8;}else{_0x361adb=0xce;}_0x267003[_0xafdc('0x1f')](_0x361adb);return _0x267003['set'](_0xafdc('0x26'),_0x54017d+'-'+_0x16dc52+'/'+_0x48175d)[_0xafdc('0x21')](_0x5a4286);}return null;};}function patchUpdates(_0x2228ff){return function(_0x1052f5){try{jsonpatch['apply'](_0x1052f5,_0x2228ff,!![]);}catch(_0x2d9f61){return BPromise[_0xafdc('0x27')](_0x2d9f61);}return _0x1052f5[_0xafdc('0x28')]();};}function saveUpdates(_0x20cc37,_0x27f535){return function(_0x1540cc){if(_0x1540cc){return _0x1540cc['update'](_0x20cc37)[_0xafdc('0x29')](function(_0xbc02e9){return _0xbc02e9;});}return null;};}function removeEntity(_0x5948ac,_0x21ca82){return function(_0x3ebb48){if(_0x3ebb48){return _0x3ebb48[_0xafdc('0x2a')]()[_0xafdc('0x29')](function(){_0x5948ac[_0xafdc('0x1f')](0xcc)[_0xafdc('0x20')]();});}};}function handleEntityNotFound(_0x21f53f,_0x423603){return function(_0x5103f1){if(!_0x5103f1){_0x21f53f[_0xafdc('0x1e')](0x194);}return _0x5103f1;};}function handleError(_0x3f6caf,_0x2afa9f){_0x2afa9f=_0x2afa9f||0x1f4;return function(_0x2a82d9){logger[_0xafdc('0x2b')](_0x2a82d9[_0xafdc('0x2c')]);if(_0x2a82d9['name']){delete _0x2a82d9[_0xafdc('0x2d')];}_0x3f6caf[_0xafdc('0x1f')](_0x2afa9f)['send'](_0x2a82d9);};}exports[_0xafdc('0x2e')]=function(_0x39ffd4,_0x456fdc){var _0x5ce34e={},_0x4716d7={},_0x123ea4={'count':0x0,'rows':[]};var _0x37e568=_[_0xafdc('0x2f')](db[_0xafdc('0x30')][_0xafdc('0x31')],function(_0x3e158c){return{'name':_0x3e158c['fieldName'],'type':_0x3e158c[_0xafdc('0x32')][_0xafdc('0x33')]};});_0x4716d7[_0xafdc('0x34')]=_[_0xafdc('0x2f')](_0x37e568,'name');_0x4716d7['query']=_[_0xafdc('0x35')](_0x39ffd4['query']);_0x4716d7[_0xafdc('0x36')]=_[_0xafdc('0x37')](_0x4716d7[_0xafdc('0x34')],_0x4716d7[_0xafdc('0x38')]);_0x4716d7['filters']=_['concat'](_0x4716d7['filters'],[_0xafdc('0x39'),_0xafdc('0x3a'),_0xafdc('0x3b'),_0xafdc('0x3c'),_0xafdc('0x3d'),'$lte',_0xafdc('0x3e'),_0xafdc('0x3f'),_0xafdc('0x40'),_0xafdc('0x41'),_0xafdc('0x42'),_0xafdc('0x43'),_0xafdc('0x44'),_0xafdc('0x45'),'$notLike','$iLike',_0xafdc('0x46'),_0xafdc('0x45'),'$overlap','$contains',_0xafdc('0x47'),_0xafdc('0x48')]);_0x5ce34e[_0xafdc('0x49')]=_[_0xafdc('0x37')](_0x4716d7[_0xafdc('0x34')],qs[_0xafdc('0x4a')](_0x39ffd4['query'][_0xafdc('0x4a')]));_0x5ce34e[_0xafdc('0x49')]=_0x5ce34e[_0xafdc('0x49')][_0xafdc('0x4b')]?_0x5ce34e[_0xafdc('0x49')]:_0x4716d7[_0xafdc('0x34')];if(!_0x39ffd4[_0xafdc('0x38')]['hasOwnProperty'](_0xafdc('0x4c'))){_0x5ce34e[_0xafdc('0x23')]=qs[_0xafdc('0x23')](_0x39ffd4[_0xafdc('0x38')][_0xafdc('0x23')]);_0x5ce34e['offset']=qs[_0xafdc('0x22')](_0x39ffd4[_0xafdc('0x38')][_0xafdc('0x22')]);}_0x5ce34e[_0xafdc('0x4d')]=qs['sort'](_0x39ffd4[_0xafdc('0x38')][_0xafdc('0x4e')]);_0x5ce34e[_0xafdc('0x4f')]=qs[_0xafdc('0x36')](_[_0xafdc('0x50')](_0x39ffd4[_0xafdc('0x38')],_0x4716d7[_0xafdc('0x36')]),_0x37e568);if(_0x39ffd4['query'][_0xafdc('0x51')]){_0x5ce34e[_0xafdc('0x4f')]=_['merge'](_0x5ce34e[_0xafdc('0x4f')],{'$or':_[_0xafdc('0x2f')](_0x37e568,function(_0x17735d){if(_0x17735d[_0xafdc('0x32')]!==_0xafdc('0x52')){var _0x54122f={};_0x54122f[_0x17735d[_0xafdc('0x2d')]]={'$like':'%'+_0x39ffd4['query']['filter']+'%'};return _0x54122f;}})});}_0x5ce34e=_['merge']({},_0x5ce34e,_0x39ffd4[_0xafdc('0x53')]);var _0x287a40={'where':_0x5ce34e[_0xafdc('0x4f')]};return db[_0xafdc('0x30')][_0xafdc('0x25')](_0x287a40)['then'](function(_0x3e77c2){_0x123ea4['count']=_0x3e77c2;if(_0x39ffd4[_0xafdc('0x38')][_0xafdc('0x54')]){_0x5ce34e[_0xafdc('0x55')]=[{'all':!![]}];}return db['CmHopper'][_0xafdc('0x56')](_0x5ce34e);})[_0xafdc('0x29')](function(_0x439ab2){_0x123ea4['rows']=_0x439ab2;return _0x123ea4;})[_0xafdc('0x29')](respondWithFilteredResult(_0x456fdc,_0x5ce34e))['catch'](handleError(_0x456fdc,null));};exports['show']=function(_0x2401a7,_0x2caf2c){var _0x55e6c6={'raw':!![],'where':{'id':_0x2401a7[_0xafdc('0x57')]['id']}},_0x2c8ac2={};_0x2c8ac2[_0xafdc('0x34')]=_[_0xafdc('0x35')](db[_0xafdc('0x30')]['rawAttributes']);_0x2c8ac2[_0xafdc('0x38')]=_['keys'](_0x2401a7[_0xafdc('0x38')]);_0x2c8ac2[_0xafdc('0x36')]=_[_0xafdc('0x37')](_0x2c8ac2['model'],_0x2c8ac2['query']);_0x55e6c6['attributes']=_[_0xafdc('0x37')](_0x2c8ac2[_0xafdc('0x34')],qs[_0xafdc('0x4a')](_0x2401a7[_0xafdc('0x38')]['fields']));_0x55e6c6[_0xafdc('0x49')]=_0x55e6c6[_0xafdc('0x49')]['length']?_0x55e6c6['attributes']:_0x2c8ac2[_0xafdc('0x34')];if(_0x2401a7[_0xafdc('0x38')][_0xafdc('0x54')]){_0x55e6c6['include']=[{'all':!![]}];}_0x55e6c6=_['merge']({},_0x55e6c6,_0x2401a7[_0xafdc('0x53')]);return db[_0xafdc('0x30')][_0xafdc('0x58')](_0x55e6c6)[_0xafdc('0x29')](handleEntityNotFound(_0x2caf2c,null))[_0xafdc('0x29')](respondWithResult(_0x2caf2c,null))[_0xafdc('0x59')](handleError(_0x2caf2c,null));};exports[_0xafdc('0x5a')]=function(_0x59b664,_0x1f23ef){return db['CmHopper'][_0xafdc('0x5a')](_0x59b664[_0xafdc('0x5b')],{})[_0xafdc('0x29')](respondWithResult(_0x1f23ef,0xc9))[_0xafdc('0x59')](handleError(_0x1f23ef,null));};exports['update']=function(_0x51aec3,_0x384038){if(_0x51aec3[_0xafdc('0x5b')]['id']){delete _0x51aec3[_0xafdc('0x5b')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x51aec3[_0xafdc('0x57')]['id']}})[_0xafdc('0x29')](handleEntityNotFound(_0x384038,null))['then'](saveUpdates(_0x51aec3[_0xafdc('0x5b')],null))['then'](respondWithResult(_0x384038,null))[_0xafdc('0x59')](handleError(_0x384038,null));};exports[_0xafdc('0x5c')]=function(_0x32cab3,_0x3ad72e){return db[_0xafdc('0x30')][_0xafdc('0x5c')]()[_0xafdc('0x29')](respondWithResult(_0x3ad72e,null))[_0xafdc('0x59')](handleError(_0x3ad72e,null));};exports['destroy']=function(_0x3ea43a,_0x222f3b){var _0x4a501b;return db[_0xafdc('0x30')][_0xafdc('0x58')]({'where':{'id':_0x3ea43a['params']['id']}})[_0xafdc('0x29')](handleEntityNotFound(_0x222f3b,null))['then'](function(_0x41c042){if(_0x41c042){return _0x41c042[_0xafdc('0x2a')]()[_0xafdc('0x29')](function(_0x218609){return _0x218609;});}})['then'](function(_0x34c78d){_0x4a501b=_0x34c78d;if(_0x34c78d){if(_0x34c78d[_0xafdc('0x5d')]||_0x34c78d['CampaignId']){return db[_0x34c78d['VoiceQueueId']?_0xafdc('0x5e'):_0xafdc('0x5f')][_0xafdc('0x58')]({'where':{'id':_0x34c78d['VoiceQueueId']?_0x34c78d[_0xafdc('0x5d')]:_0x34c78d['CampaignId']},'attributes':['id',_0xafdc('0x2d')],'raw':!![]});}}})[_0xafdc('0x29')](function(_0x27edae){var _0x310307={};if(_0x27edae){_[_0xafdc('0x60')](_0x310307,_[_0xafdc('0x61')](_0x4a501b[_0xafdc('0x62')],['createdAt',_0xafdc('0x63'),'id']));_0x310307['state']=0x15;_0x310307['statedesc']='deleted';_0x310307[_0xafdc('0x64')]=_0x27edae[_0xafdc('0x2d')];_0x310307['membername']=_0x3ea43a['user'][_0xafdc('0x2d')];_0x310307[_0xafdc('0x65')]=_0x3ea43a[_0xafdc('0x66')]['id'];_0x310307[_0xafdc('0x67')]=!![];_0x310307[_0xafdc('0x68')]=moment()[_0xafdc('0x69')](_0xafdc('0x6a'));_0x310307[_0xafdc('0x6b')]=_0x4a501b[_0xafdc('0x6c')];_0x310307[_0xafdc('0x6d')]=_0x4a501b[_0xafdc('0x5d')]?'queue':'ivr';return db['CmContact'][_0xafdc('0x58')]({'where':{'id':_0x310307['ContactId']},'attributes':[_0xafdc('0x6e'),_0xafdc('0x6f')]})['then'](function(_0x2bc964){if(!_[_0xafdc('0x70')](_0x222f3b)&&!_[_0xafdc('0x70')](_0x2bc964[_0xafdc('0x6e')])){_0x310307['calleridname']=_0x2bc964[_0xafdc('0x6e')];if(!_[_0xafdc('0x70')](_0x2bc964[_0xafdc('0x6f')])){_0x310307[_0xafdc('0x71')]+='\x20'+_0x2bc964[_0xafdc('0x6f')];}}})[_0xafdc('0x72')](function(){return db[_0xafdc('0x73')]['create'](_0x310307);});}})['then'](function(){return _0x222f3b['status'](0xcc)[_0xafdc('0x20')]();})[_0xafdc('0x59')](handleError(_0x222f3b,null));};exports['getPreview']=function(_0x4b44b5,_0x29c1d9,_0x55026f){var _0x3f4f5e=[];return db[_0xafdc('0x74')][_0xafdc('0x5c')]()['then'](function(_0x324653){_0x3f4f5e=_[_0xafdc('0x35')](_0x324653);return _0x4b44b5[_0xafdc('0x66')][_0xafdc('0x75')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xafdc('0x76')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0xafdc('0x29')](function(_0x221923){if(_0x221923&&_0x221923[_0xafdc('0x4b')]){return db['sequelize']['transaction'](function(_0x4e089f){var _0x2cd65f={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xafdc('0x69')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x221923,'id')},'$or':[{'UserId':null},{'UserId':_0x4b44b5[_0xafdc('0x66')]['id']}]};var _0x51f3b4=[];if(_0x4b44b5['body'][_0xafdc('0x77')]&&_0x4b44b5[_0xafdc('0x5b')][_0xafdc('0x77')]===_0xafdc('0x78')){if(!_['isEmpty'](_0x4b44b5['body'][_0xafdc('0x79')])){_0x2cd65f['id']={'$in':_0x4b44b5[_0xafdc('0x5b')][_0xafdc('0x79')]};}_0x51f3b4=[[_0xafdc('0x7a'),_0xafdc('0x7b')],[_0xafdc('0x7c'),_0x221923[0x0][_0xafdc('0x7d')]===_0xafdc('0x7b')?_0xafdc('0x7e'):'ASC'],db['sequelize'][_0xafdc('0x7f')](_0xafdc('0x80')),['id','DESC']];}else{if(!_[_0xafdc('0x81')](_0x4b44b5['body'][_0xafdc('0x79')])){_0x2cd65f['id']={'$notIn':_0x4b44b5[_0xafdc('0x5b')][_0xafdc('0x79')]};}_0x51f3b4=[[_0xafdc('0x7a'),'DESC'],['scheduledAt',_0x221923[0x0][_0xafdc('0x7d')]],db[_0xafdc('0x82')][_0xafdc('0x7f')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xafdc('0x7b')]];}return db[_0xafdc('0x30')][_0xafdc('0x83')]({'attributes':['id',_0xafdc('0x84')],'where':_0x2cd65f,'order':_0x51f3b4,'transaction':_0x4e089f,'lock':_0x4e089f[_0xafdc('0x85')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xafdc('0x86'),'attributes':_0x3f4f5e,'include':[{'model':db[_0xafdc('0x87')],'as':_0xafdc('0x88'),'attributes':['id',_0xafdc('0x2d')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0xafdc('0x2d')]},{'model':db[_0xafdc('0x5e')],'as':_0xafdc('0x89'),'attributes':['id',_0xafdc('0x2d'),_0xafdc('0x8a')]}]})[_0xafdc('0x29')](function(_0x486f9b){if(_0x486f9b){return _0x486f9b[_0xafdc('0x8b')]({'UserId':_0x4b44b5[_0xafdc('0x66')]['id']},{'transaction':_0x4e089f});}});});}})[_0xafdc('0x29')](handleEntityNotFound(_0x29c1d9,null))[_0xafdc('0x29')](respondWithResult(_0x29c1d9,null))[_0xafdc('0x59')](handleError(_0x29c1d9,null));};exports[_0xafdc('0x8c')]=function(_0x231c6d,_0x2cf449,_0x20b3b3){return _0x231c6d[_0xafdc('0x66')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xafdc('0x76')},'attributes':['id'],'raw':!![]})[_0xafdc('0x29')](function(_0x3584db){if(_0x3584db&&_0x3584db[_0xafdc('0x4b')]){return db[_0xafdc('0x30')][_0xafdc('0x25')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xafdc('0x6a'))},'VoiceQueueId':{'$in':_[_0xafdc('0x2f')](_0x3584db,'id')},'$or':[{'UserId':null},{'UserId':_0x231c6d[_0xafdc('0x66')]['id']}]}});}return 0x0;})[_0xafdc('0x29')](function(_0x1d698a){if(!_[_0xafdc('0x70')](_0x1d698a)&&_[_0xafdc('0x8d')](_0x1d698a)){return _0x2cf449[_0xafdc('0x1f')](0xc8)[_0xafdc('0x21')]({'contacts':_0x1d698a});}else{logger[_0xafdc('0x2b')](_0xafdc('0x8e'),_0xafdc('0x8c'),0x194,_0xafdc('0x8f'));_0x2cf449[_0xafdc('0x1e')](0x194);}})[_0xafdc('0x59')](handleError(_0x2cf449,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 2b9ab9e..5895c5e 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 _0x2a07=['api','moment','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0x2a07,0x74));var _0x72a0=function(_0x362d16,_0x31c1a2){_0x362d16=_0x362d16-0x0;var _0x5596de=_0x2a07[_0x362d16];return _0x5596de;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[{'name':_0x72a0('0xe'),'fields':[_0x72a0('0xe')]},{'name':_0x72a0('0xf'),'fields':[_0x72a0('0xf')]},{'name':_0x72a0('0x10'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4c60=['../../config/logger','api','bluebird','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c60,0xc1));var _0x04c6=function(_0x507f21,_0x4628a7){_0x507f21=_0x507f21-0x0;var _0x5a3c6e=_0x4c60[_0x507f21];return _0x5a3c6e;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x04c6('0x5'));module[_0x04c6('0x6')]=function(_0x2054da,_0x12bd5d){return _0x2054da[_0x04c6('0x7')](_0x04c6('0x8'),attributes,{'tableName':_0x04c6('0x9'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x04c6('0xa')]},{'name':_0x04c6('0xb'),'fields':[_0x04c6('0xb')]},{'name':_0x04c6('0xc'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 6c551b7..bfb348c 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 _0x774e=['body','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','order','UPDATE','User','voicePause','length','push','includes','update','all','MoveContactManagedDialer','transaction','CmHopperFinal','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','LOCK','GetCmHopperPreview','keys','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowCmHopper','CreateCmHopper','create','UpdateCmHopper'];(function(_0x34ed78,_0x23c534){var _0x5cb6c6=function(_0x48e58e){while(--_0x48e58e){_0x34ed78['push'](_0x34ed78['shift']());}};_0x5cb6c6(++_0x23c534);}(_0x774e,0x1d0));var _0xe774=function(_0x2ffff0,_0x53edc8){_0x2ffff0=_0x2ffff0-0x0;var _0x51d19d=_0x774e[_0x2ffff0];return _0x51d19d;};'use strict';var _=require(_0xe774('0x0'));var util=require(_0xe774('0x1'));var moment=require('moment');var BPromise=require(_0xe774('0x2'));var rs=require(_0xe774('0x3'));var fs=require('fs');var Redis=require(_0xe774('0x4'));var db=require(_0xe774('0x5'))['db'];var utils=require(_0xe774('0x6'));var logger=require(_0xe774('0x7'))(_0xe774('0x8'));var config=require(_0xe774('0x9'));var jayson=require(_0xe774('0xa'));var client=jayson[_0xe774('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47e335,_0x23264f,_0x34849c){return new BPromise(function(_0x111d91,_0x1a8659){return client[_0xe774('0xc')](_0x47e335,_0x34849c)[_0xe774('0xd')](function(_0x2a1d83){logger[_0xe774('0xe')](_0xe774('0xf'),_0x23264f,_0xe774('0x10'));logger[_0xe774('0x11')](_0xe774('0x12'),_0x23264f,'request\x20sent',JSON[_0xe774('0x13')](_0x2a1d83));if(_0x2a1d83[_0xe774('0x14')]){if(_0x2a1d83[_0xe774('0x14')][_0xe774('0x15')]===0x1f4){logger[_0xe774('0x14')](_0xe774('0xf'),_0x23264f,_0x2a1d83[_0xe774('0x14')]['message']);return _0x1a8659(_0x2a1d83[_0xe774('0x14')][_0xe774('0x16')]);}logger[_0xe774('0x14')](_0xe774('0xf'),_0x23264f,_0x2a1d83[_0xe774('0x14')][_0xe774('0x16')]);return _0x111d91(_0x2a1d83[_0xe774('0x14')]['message']);}else{logger['info'](_0xe774('0xf'),_0x23264f,_0xe774('0x10'));_0x111d91(_0x2a1d83[_0xe774('0x17')][_0xe774('0x16')]);}})['catch'](function(_0x5d0f56){logger[_0xe774('0x14')](_0xe774('0xf'),_0x23264f,_0x5d0f56);_0x1a8659(_0x5d0f56);});});}exports[_0xe774('0x18')]=function(_0x5cd5b0){var _0x58ef2d=this;return new Promise(function(_0x29013c,_0x5298fe){return db[_0xe774('0x19')][_0xe774('0x1a')]({'raw':_0x5cd5b0[_0xe774('0x1b')]?_0x5cd5b0[_0xe774('0x1b')][_0xe774('0x1c')]===undefined?!![]:![]:!![],'where':_0x5cd5b0[_0xe774('0x1b')]?_0x5cd5b0[_0xe774('0x1b')][_0xe774('0x1d')]||null:null,'attributes':_0x5cd5b0[_0xe774('0x1b')]?_0x5cd5b0[_0xe774('0x1b')][_0xe774('0x1e')]||null:null,'limit':_0x5cd5b0[_0xe774('0x1b')]?_0x5cd5b0[_0xe774('0x1b')][_0xe774('0x1f')]||null:null,'include':_0x5cd5b0[_0xe774('0x1b')]?_0x5cd5b0[_0xe774('0x1b')][_0xe774('0x20')]?_[_0xe774('0x21')](_0x5cd5b0['options']['include'],function(_0x199e0b){return{'model':db[_0x199e0b[_0xe774('0x22')]],'as':_0x199e0b['as'],'attributes':_0x199e0b[_0xe774('0x1e')],'include':_0x199e0b[_0xe774('0x20')]?_[_0xe774('0x21')](_0x199e0b[_0xe774('0x20')],function(_0xd222eb){return{'model':db[_0xd222eb[_0xe774('0x22')]],'as':_0xd222eb['as'],'attributes':_0xd222eb[_0xe774('0x1e')],'include':_0xd222eb[_0xe774('0x20')]?_[_0xe774('0x21')](_0xd222eb[_0xe774('0x20')],function(_0x2ba47e){return{'model':db[_0x2ba47e[_0xe774('0x22')]],'as':_0x2ba47e['as'],'attributes':_0x2ba47e['attributes']};}):[]};}):[]};}):[]:[]})[_0xe774('0xd')](function(_0x8e1fd){logger[_0xe774('0xe')]('GetCmHopper',_0x5cd5b0);logger['debug'](_0xe774('0x18'),_0x5cd5b0,JSON[_0xe774('0x13')](_0x8e1fd));_0x29013c(_0x8e1fd);})[_0xe774('0x23')](function(_0x1299e9){logger[_0xe774('0x14')](_0xe774('0x18'),_0x1299e9['message'],_0x5cd5b0);_0x5298fe(_0x58ef2d[_0xe774('0x14')](0x1f4,_0x1299e9['message']));});});};exports['ShowCmHopper']=function(_0x2b6d68){var _0x1ba7ca=this;return new Promise(function(_0x4b3502,_0x80b0c2){return db[_0xe774('0x19')]['find']({'raw':_0x2b6d68[_0xe774('0x1b')]?_0x2b6d68[_0xe774('0x1b')][_0xe774('0x1c')]===undefined?!![]:![]:!![],'where':_0x2b6d68['options']?_0x2b6d68[_0xe774('0x1b')][_0xe774('0x1d')]||null:null,'attributes':_0x2b6d68[_0xe774('0x1b')]?_0x2b6d68[_0xe774('0x1b')]['attributes']||null:null,'include':_0x2b6d68['options']?_0x2b6d68[_0xe774('0x1b')][_0xe774('0x20')]?_[_0xe774('0x21')](_0x2b6d68['options'][_0xe774('0x20')],function(_0x54fc94){return{'model':db[_0x54fc94[_0xe774('0x22')]],'as':_0x54fc94['as'],'attributes':_0x54fc94[_0xe774('0x1e')],'include':_0x54fc94[_0xe774('0x20')]?_[_0xe774('0x21')](_0x54fc94[_0xe774('0x20')],function(_0x47685f){return{'model':db[_0x47685f[_0xe774('0x22')]],'as':_0x47685f['as'],'attributes':_0x47685f['attributes'],'include':_0x47685f[_0xe774('0x20')]?_[_0xe774('0x21')](_0x47685f[_0xe774('0x20')],function(_0x5a8a29){return{'model':db[_0x5a8a29[_0xe774('0x22')]],'as':_0x5a8a29['as'],'attributes':_0x5a8a29[_0xe774('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe774('0xd')](function(_0x29a572){logger[_0xe774('0xe')](_0xe774('0x24'),_0x2b6d68);logger[_0xe774('0x11')](_0xe774('0x24'),_0x2b6d68,JSON['stringify'](_0x29a572));_0x4b3502(_0x29a572);})[_0xe774('0x23')](function(_0x3fb7b4){logger[_0xe774('0x14')]('ShowCmHopper',_0x3fb7b4[_0xe774('0x16')],_0x2b6d68);_0x80b0c2(_0x1ba7ca[_0xe774('0x14')](0x1f4,_0x3fb7b4[_0xe774('0x16')]));});});};exports[_0xe774('0x25')]=function(_0x403ec2){var _0x37a1b6=this;return new Promise(function(_0x179492,_0x394ab8){return db[_0xe774('0x19')][_0xe774('0x26')](_0x403ec2['body'],{'raw':_0x403ec2[_0xe774('0x1b')]?_0x403ec2[_0xe774('0x1b')][_0xe774('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5a769c){logger[_0xe774('0xe')](_0xe774('0x25'),_0x403ec2);logger[_0xe774('0x11')](_0xe774('0x25'),_0x403ec2,JSON[_0xe774('0x13')](_0x5a769c));_0x179492(_0x5a769c);})[_0xe774('0x23')](function(_0x3a4083){logger[_0xe774('0x14')](_0xe774('0x25'),_0x3a4083[_0xe774('0x16')],_0x403ec2);_0x394ab8(_0x37a1b6[_0xe774('0x14')](0x1f4,_0x3a4083[_0xe774('0x16')]));});});};exports[_0xe774('0x27')]=function(_0x4551cc){var _0x11ed8=this;return new Promise(function(_0x1bcd01,_0xd177bb){return db[_0xe774('0x19')]['update'](_0x4551cc[_0xe774('0x28')],{'raw':_0x4551cc[_0xe774('0x1b')]?_0x4551cc['options'][_0xe774('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4551cc[_0xe774('0x1b')]?_0x4551cc[_0xe774('0x1b')][_0xe774('0x1d')]||null:null,'attributes':_0x4551cc['options']?_0x4551cc[_0xe774('0x1b')][_0xe774('0x1e')]||null:null,'limit':_0x4551cc['options']?_0x4551cc[_0xe774('0x1b')]['limit']||null:null})[_0xe774('0xd')](function(_0x4ddd6b){logger[_0xe774('0xe')](_0xe774('0x27'),_0x4551cc);logger[_0xe774('0x11')](_0xe774('0x27'),_0x4551cc,JSON['stringify'](_0x4ddd6b));_0x1bcd01(_0x4ddd6b);})[_0xe774('0x23')](function(_0x4281bc){logger[_0xe774('0x14')](_0xe774('0x27'),_0x4281bc[_0xe774('0x16')],_0x4551cc);_0xd177bb(_0x11ed8[_0xe774('0x14')](0x1f4,_0x4281bc[_0xe774('0x16')]));});});};exports[_0xe774('0x29')]=function(_0x177f60){var _0x2706f6=this;return new Promise(function(_0x47a7d3,_0x1f9b08){return db[_0xe774('0x19')][_0xe774('0x2a')]({'where':_0x177f60[_0xe774('0x1b')]?_0x177f60['options'][_0xe774('0x1d')]||null:null})['then'](function(_0x19110c){logger[_0xe774('0xe')]('DestroyCmHopper',_0x177f60);logger[_0xe774('0x11')]('DestroyCmHopper',_0x177f60,JSON[_0xe774('0x13')](_0x19110c));_0x47a7d3(_0x19110c);})[_0xe774('0x23')](function(_0x2ce728){logger[_0xe774('0x14')](_0xe774('0x29'),_0x2ce728[_0xe774('0x16')],_0x177f60);_0x1f9b08(_0x2706f6['error'](0x1f4,_0x2ce728[_0xe774('0x16')]));});});};exports[_0xe774('0x2b')]=function(_0x127098){var _0x52cb50=this;return new Promise(function(_0x5a8a3a,_0x5edbed){return db[_0xe774('0x2c')][_0xe774('0x2d')]()['then'](function(_0x4f3e49){return db[_0xe774('0x2e')]['transaction'](function(_0x1ae576){return db[_0xe774('0x19')][_0xe774('0x1a')]({'where':_0x127098['options']?_0x127098[_0xe774('0x1b')][_0xe774('0x1d')]||null:null,'attributes':_0x127098[_0xe774('0x1b')]?_0x127098[_0xe774('0x1b')][_0xe774('0x1e')]||null:null,'limit':_0x127098[_0xe774('0x1b')]?_0x127098['options'][_0xe774('0x1f')]||null:null,'order':_0x127098[_0xe774('0x1b')]?_0x127098['options'][_0xe774('0x2f')]||null:null,'transaction':_0x1ae576,'lock':_0x1ae576['LOCK'][_0xe774('0x30')],'include':[{'model':db[_0xe774('0x2c')],'as':'Contact','attributes':_['keys'](_0x4f3e49)},{'model':db[_0xe774('0x31')],'as':'Agent','attributes':['id','name',_0xe774('0x32')]}]})[_0xe774('0xd')](function(_0x33ab1c){var _0x1e711a=[];var _0x19269a=[];for(var _0xc81a0a=0x0;_0xc81a0a<_0x33ab1c[_0xe774('0x33')];_0xc81a0a+=0x1){var _0x335ac2=_0x33ab1c[_0xc81a0a]['UserId'];if(_0x335ac2===null){_0x1e711a[_0xe774('0x34')](_0x33ab1c[_0xc81a0a]['update'](_0x127098[_0xe774('0x28')],{'transaction':_0x1ae576}));}else if(!_0x19269a[_0xe774('0x35')](_0x335ac2)){_0x19269a[_0xe774('0x34')](_0x335ac2);_0x1e711a[_0xe774('0x34')](_0x33ab1c[_0xc81a0a][_0xe774('0x36')](_0x127098[_0xe774('0x28')],{'transaction':_0x1ae576}));}}return BPromise[_0xe774('0x37')](_0x1e711a);});})[_0xe774('0xd')](function(_0x4e1a82){logger['info'](_0xe774('0x2b'),_0x127098);logger[_0xe774('0x11')](_0xe774('0x2b'),_0x127098,JSON['stringify'](_0x4e1a82));_0x5a8a3a(_0x4e1a82);})['catch'](function(_0x575300){logger['error'](_0xe774('0x2b'),_0x575300[_0xe774('0x16')],_0x127098);_0x5edbed(_0x52cb50[_0xe774('0x14')](0x1f4,_0x575300[_0xe774('0x16')]));});});});};exports[_0xe774('0x38')]=function(_0x2a61b3){var _0x458b2b=this;return new Promise(function(_0x3edd10,_0x2604cf){return db[_0xe774('0x2e')][_0xe774('0x39')](function(_0x1be3de){return db[_0xe774('0x3a')][_0xe774('0x26')](_0x2a61b3[_0xe774('0x28')],{'raw':_0x2a61b3[_0xe774('0x1b')]?_0x2a61b3[_0xe774('0x1b')][_0xe774('0x1c')]===undefined?!![]:![]:!![],'transaction':_0x1be3de})[_0xe774('0xd')](function(){return db['CmHopper'][_0xe774('0x2a')]({'where':_0x2a61b3[_0xe774('0x1b')]?_0x2a61b3[_0xe774('0x1b')][_0xe774('0x1d')]||null:null,'transaction':_0x1be3de});});})[_0xe774('0xd')](function(_0x4f429f){logger['info'](_0xe774('0x38'),_0x2a61b3);logger['debug'](_0xe774('0x38'),_0x2a61b3,JSON['stringify'](_0x4f429f));_0x3edd10(_0x4f429f);})['catch'](function(_0x34e1f1){logger[_0xe774('0x14')](_0xe774('0x38'),_0x34e1f1[_0xe774('0x16')],_0x2a61b3);_0x2604cf(_0x458b2b['error'](0x1f4,_0x34e1f1['message']));});});};exports[_0xe774('0x3b')]=function(_0x123d58){var _0x1c1ea3=this;return new Promise(function(_0x54bc0f,_0x130cae){return db['CmHopper'][_0xe774('0x1a')]({'raw':_0x123d58[_0xe774('0x1b')]?_0x123d58['options'][_0xe774('0x1c')]===undefined?!![]:![]:!![],'where':_0x123d58['options']?_0x123d58[_0xe774('0x1b')][_0xe774('0x1d')]||null:null,'attributes':[[db[_0xe774('0x2e')]['fn']('COUNT',db[_0xe774('0x2e')]['fn']('IF',db[_0xe774('0x2e')][_0xe774('0x3c')](_0xe774('0x3d')+util[_0xe774('0x3e')](_0xe774('0x3f'),moment()[_0xe774('0x3e')](_0xe774('0x40')))+_0xe774('0x41')))),_0xe774('0x42')]]})[_0xe774('0xd')](function(_0x1821d0){logger['info'](_0xe774('0x3b'),_0x123d58);logger[_0xe774('0x11')](_0xe774('0x3b'),_0x123d58,JSON[_0xe774('0x13')](_0x1821d0));_0x54bc0f(_0x1821d0);})[_0xe774('0x23')](function(_0x482b26){logger[_0xe774('0x14')](_0xe774('0x3b'),_0x482b26[_0xe774('0x16')],_0x123d58);_0x130cae(_0x1c1ea3['error'](0x1f4,_0x482b26[_0xe774('0x16')]));});});};exports[_0xe774('0x43')]=function(_0x54ecd2){var _0x5ce823=this;return new Promise(function(_0x3214ed,_0x54bde8){return db[_0xe774('0x2c')]['describe']()[_0xe774('0xd')](function(_0x2a4c2a){return db[_0xe774('0x2e')][_0xe774('0x39')](function(_0x44db80){return db[_0xe774('0x19')][_0xe774('0x1a')]({'where':_0x54ecd2['options']?_0x54ecd2[_0xe774('0x1b')]['where']||null:null,'attributes':_0x54ecd2[_0xe774('0x1b')]?_0x54ecd2[_0xe774('0x1b')][_0xe774('0x1e')]||null:null,'limit':0x1,'order':_0x54ecd2['options']?_0x54ecd2[_0xe774('0x1b')][_0xe774('0x2f')]||null:null,'group':db[_0xe774('0x19')][_0xe774('0x44')],'transaction':_0x44db80,'lock':_0x44db80[_0xe774('0x45')]['UPDATE'],'include':_0x54ecd2['options']?_0x54ecd2[_0xe774('0x1b')][_0xe774('0x20')]?_[_0xe774('0x21')](_0x54ecd2['options'][_0xe774('0x20')],function(_0x534c6c){return{'model':db[_0x534c6c[_0xe774('0x22')]],'as':_0x534c6c['as'],'attributes':_0x534c6c[_0xe774('0x1e')],'include':_0x534c6c[_0xe774('0x20')]?_[_0xe774('0x21')](_0x534c6c[_0xe774('0x20')],function(_0x482504){return{'model':db[_0x482504[_0xe774('0x22')]],'as':_0x482504['as'],'attributes':_0x482504[_0xe774('0x1e')],'include':_0x482504['include']?_['map'](_0x482504[_0xe774('0x20')],function(_0x5c670c){return{'model':db[_0x5c670c['model']],'as':_0x5c670c['as'],'attributes':_0x5c670c['attributes']};}):[]};}):[]};}):[]:[]})[_0xe774('0xd')](function(_0x3f20ca){var _0x2a1a9c=[];for(var _0x202790=0x0;_0x202790<_0x3f20ca[_0xe774('0x33')];_0x202790+=0x1){_0x2a1a9c['push'](_0x3f20ca[_0x202790][_0xe774('0x36')](_0x54ecd2[_0xe774('0x28')],{'transaction':_0x44db80}));}return BPromise[_0xe774('0x37')](_0x2a1a9c);});})[_0xe774('0xd')](function(_0x3175f4){logger[_0xe774('0xe')]('GetContactRecallMe',_0x54ecd2);logger[_0xe774('0x11')](_0xe774('0x43'),_0x54ecd2,JSON[_0xe774('0x13')](_0x3175f4));_0x3214ed(_0x3175f4);})[_0xe774('0x23')](function(_0xd2affa){logger[_0xe774('0x14')]('GetContactRecallMe',_0xd2affa[_0xe774('0x16')],_0x54ecd2);_0x54bde8(_0x5ce823[_0xe774('0x14')](0x1f4,_0xd2affa['message']));});});});};exports[_0xe774('0x46')]=function(_0x22f1fd){var _0x49e8fa=this;return new Promise(function(_0x37a24e,_0x46dadc){db[_0xe774('0x2c')][_0xe774('0x2d')]()[_0xe774('0xd')](function(_0x37eaa8){return db[_0xe774('0x19')][_0xe774('0x1a')]({'raw':_0x22f1fd[_0xe774('0x1b')]?_0x22f1fd[_0xe774('0x1b')][_0xe774('0x1c')]===undefined?!![]:![]:!![],'where':_0x22f1fd['options']?_0x22f1fd['options'][_0xe774('0x1d')]||null:null,'attributes':_0x22f1fd[_0xe774('0x1b')]?_0x22f1fd[_0xe774('0x1b')][_0xe774('0x1e')]||null:null,'limit':_0x22f1fd['options']?_0x22f1fd[_0xe774('0x1b')][_0xe774('0x1f')]||null:null,'include':_0x22f1fd[_0xe774('0x1b')]?_0x22f1fd['options']['include']?_[_0xe774('0x21')](_0x22f1fd[_0xe774('0x1b')][_0xe774('0x20')],function(_0x4349e1){return{'model':db[_0x4349e1[_0xe774('0x22')]],'as':_0x4349e1['as'],'attributes':_0x4349e1['as']==='Contact'?_[_0xe774('0x47')](_0x37eaa8):_0x4349e1['attributes'],'include':_0x4349e1[_0xe774('0x20')]?_[_0xe774('0x21')](_0x4349e1[_0xe774('0x20')],function(_0x223a10){return{'model':db[_0x223a10[_0xe774('0x22')]],'as':_0x223a10['as'],'attributes':_0x223a10[_0xe774('0x1e')],'include':_0x223a10[_0xe774('0x20')]?_[_0xe774('0x21')](_0x223a10['include'],function(_0x12682f){return{'model':db[_0x12682f['model']],'as':_0x12682f['as'],'attributes':_0x12682f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x29a127){logger[_0xe774('0xe')](_0xe774('0x18'),_0x22f1fd);logger[_0xe774('0x11')](_0xe774('0x18'),_0x22f1fd,JSON[_0xe774('0x13')](_0x29a127));_0x37a24e(_0x29a127);})[_0xe774('0x23')](function(_0x583be4){logger[_0xe774('0x14')](_0xe774('0x18'),_0x583be4[_0xe774('0x16')],_0x22f1fd);_0x46dadc(_0x49e8fa[_0xe774('0x14')](0x1f4,_0x583be4[_0xe774('0x16')]));});});});}; \ No newline at end of file +var _0x3263=['../../config/logger','../../config/environment','jayson/promise','client','then','info','CmHopper,\x20%s,\x20%s','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetCmHopper','CmHopper','options','raw','where','attributes','map','include','model','stringify','find','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','limit','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','findAll','order','UPDATE','Contact','keys','Agent','name','voicePause','length','UserId','push','includes','all','MoveContactManagedDialer','transaction','CmHopperFinal','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','GetContactRecallMe','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x227787,_0x389123){var _0xcf13ea=function(_0xc32ba7){while(--_0xc32ba7){_0x227787['push'](_0x227787['shift']());}};_0xcf13ea(++_0x389123);}(_0x3263,0x153));var _0x3326=function(_0x19b1c2,_0x205062){_0x19b1c2=_0x19b1c2-0x0;var _0x4e1ae5=_0x3263[_0x19b1c2];return _0x4e1ae5;};'use strict';var _=require(_0x3326('0x0'));var util=require(_0x3326('0x1'));var moment=require(_0x3326('0x2'));var BPromise=require(_0x3326('0x3'));var rs=require(_0x3326('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3326('0x5'));var logger=require(_0x3326('0x6'))('rpc');var config=require(_0x3326('0x7'));var jayson=require(_0x3326('0x8'));var client=jayson[_0x3326('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d84c1,_0x5692e9,_0x3926df){return new BPromise(function(_0xec72e3,_0x6e2f34){return client['request'](_0x3d84c1,_0x3926df)[_0x3326('0xa')](function(_0x3cfda7){logger[_0x3326('0xb')](_0x3326('0xc'),_0x5692e9,'request\x20sent');logger[_0x3326('0xd')](_0x3326('0xe'),_0x5692e9,'request\x20sent',JSON['stringify'](_0x3cfda7));if(_0x3cfda7[_0x3326('0xf')]){if(_0x3cfda7[_0x3326('0xf')][_0x3326('0x10')]===0x1f4){logger[_0x3326('0xf')]('CmHopper,\x20%s,\x20%s',_0x5692e9,_0x3cfda7[_0x3326('0xf')][_0x3326('0x11')]);return _0x6e2f34(_0x3cfda7['error'][_0x3326('0x11')]);}logger[_0x3326('0xf')](_0x3326('0xc'),_0x5692e9,_0x3cfda7[_0x3326('0xf')][_0x3326('0x11')]);return _0xec72e3(_0x3cfda7['error']['message']);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x5692e9,_0x3326('0x12'));_0xec72e3(_0x3cfda7[_0x3326('0x13')][_0x3326('0x11')]);}})[_0x3326('0x14')](function(_0x1967fe){logger[_0x3326('0xf')](_0x3326('0xc'),_0x5692e9,_0x1967fe);_0x6e2f34(_0x1967fe);});});}exports[_0x3326('0x15')]=function(_0x589727){var _0x127599=this;return new Promise(function(_0x1711cb,_0x52660d){return db[_0x3326('0x16')]['findAll']({'raw':_0x589727['options']?_0x589727[_0x3326('0x17')][_0x3326('0x18')]===undefined?!![]:![]:!![],'where':_0x589727[_0x3326('0x17')]?_0x589727['options'][_0x3326('0x19')]||null:null,'attributes':_0x589727[_0x3326('0x17')]?_0x589727[_0x3326('0x17')][_0x3326('0x1a')]||null:null,'limit':_0x589727[_0x3326('0x17')]?_0x589727[_0x3326('0x17')]['limit']||null:null,'include':_0x589727['options']?_0x589727['options']['include']?_[_0x3326('0x1b')](_0x589727['options'][_0x3326('0x1c')],function(_0x527397){return{'model':db[_0x527397[_0x3326('0x1d')]],'as':_0x527397['as'],'attributes':_0x527397[_0x3326('0x1a')],'include':_0x527397[_0x3326('0x1c')]?_['map'](_0x527397['include'],function(_0x28a356){return{'model':db[_0x28a356[_0x3326('0x1d')]],'as':_0x28a356['as'],'attributes':_0x28a356[_0x3326('0x1a')],'include':_0x28a356[_0x3326('0x1c')]?_[_0x3326('0x1b')](_0x28a356[_0x3326('0x1c')],function(_0x449e51){return{'model':db[_0x449e51[_0x3326('0x1d')]],'as':_0x449e51['as'],'attributes':_0x449e51[_0x3326('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x530c96){logger[_0x3326('0xb')](_0x3326('0x15'),_0x589727);logger['debug'](_0x3326('0x15'),_0x589727,JSON[_0x3326('0x1e')](_0x530c96));_0x1711cb(_0x530c96);})['catch'](function(_0x269d0b){logger[_0x3326('0xf')](_0x3326('0x15'),_0x269d0b[_0x3326('0x11')],_0x589727);_0x52660d(_0x127599[_0x3326('0xf')](0x1f4,_0x269d0b[_0x3326('0x11')]));});});};exports['ShowCmHopper']=function(_0x259bb9){var _0x255e8e=this;return new Promise(function(_0x132f2a,_0x33dc98){return db[_0x3326('0x16')][_0x3326('0x1f')]({'raw':_0x259bb9[_0x3326('0x17')]?_0x259bb9[_0x3326('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x259bb9[_0x3326('0x17')]?_0x259bb9['options'][_0x3326('0x19')]||null:null,'attributes':_0x259bb9['options']?_0x259bb9[_0x3326('0x17')][_0x3326('0x1a')]||null:null,'include':_0x259bb9[_0x3326('0x17')]?_0x259bb9[_0x3326('0x17')][_0x3326('0x1c')]?_[_0x3326('0x1b')](_0x259bb9[_0x3326('0x17')][_0x3326('0x1c')],function(_0x50d153){return{'model':db[_0x50d153[_0x3326('0x1d')]],'as':_0x50d153['as'],'attributes':_0x50d153[_0x3326('0x1a')],'include':_0x50d153[_0x3326('0x1c')]?_[_0x3326('0x1b')](_0x50d153[_0x3326('0x1c')],function(_0x1e66d5){return{'model':db[_0x1e66d5[_0x3326('0x1d')]],'as':_0x1e66d5['as'],'attributes':_0x1e66d5['attributes'],'include':_0x1e66d5[_0x3326('0x1c')]?_[_0x3326('0x1b')](_0x1e66d5['include'],function(_0x22d525){return{'model':db[_0x22d525[_0x3326('0x1d')]],'as':_0x22d525['as'],'attributes':_0x22d525[_0x3326('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3326('0xa')](function(_0x17669d){logger['info'](_0x3326('0x20'),_0x259bb9);logger[_0x3326('0xd')]('ShowCmHopper',_0x259bb9,JSON[_0x3326('0x1e')](_0x17669d));_0x132f2a(_0x17669d);})['catch'](function(_0x56231a){logger[_0x3326('0xf')](_0x3326('0x20'),_0x56231a[_0x3326('0x11')],_0x259bb9);_0x33dc98(_0x255e8e[_0x3326('0xf')](0x1f4,_0x56231a[_0x3326('0x11')]));});});};exports[_0x3326('0x21')]=function(_0x1f024f){var _0x263da8=this;return new Promise(function(_0x3d1e3c,_0xd454c4){return db[_0x3326('0x16')][_0x3326('0x22')](_0x1f024f[_0x3326('0x23')],{'raw':_0x1f024f[_0x3326('0x17')]?_0x1f024f['options'][_0x3326('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x343d41){logger['info'](_0x3326('0x21'),_0x1f024f);logger[_0x3326('0xd')](_0x3326('0x21'),_0x1f024f,JSON[_0x3326('0x1e')](_0x343d41));_0x3d1e3c(_0x343d41);})['catch'](function(_0x2c6cfb){logger[_0x3326('0xf')](_0x3326('0x21'),_0x2c6cfb[_0x3326('0x11')],_0x1f024f);_0xd454c4(_0x263da8['error'](0x1f4,_0x2c6cfb[_0x3326('0x11')]));});});};exports[_0x3326('0x24')]=function(_0x57b138){var _0x1fa73e=this;return new Promise(function(_0x77f329,_0x3ae466){return db[_0x3326('0x16')][_0x3326('0x25')](_0x57b138[_0x3326('0x23')],{'raw':_0x57b138[_0x3326('0x17')]?_0x57b138[_0x3326('0x17')][_0x3326('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57b138['options']?_0x57b138[_0x3326('0x17')]['where']||null:null,'attributes':_0x57b138[_0x3326('0x17')]?_0x57b138[_0x3326('0x17')][_0x3326('0x1a')]||null:null,'limit':_0x57b138[_0x3326('0x17')]?_0x57b138['options'][_0x3326('0x26')]||null:null})[_0x3326('0xa')](function(_0x19602e){logger[_0x3326('0xb')](_0x3326('0x24'),_0x57b138);logger[_0x3326('0xd')](_0x3326('0x24'),_0x57b138,JSON['stringify'](_0x19602e));_0x77f329(_0x19602e);})[_0x3326('0x14')](function(_0x5f4ea6){logger[_0x3326('0xf')](_0x3326('0x24'),_0x5f4ea6[_0x3326('0x11')],_0x57b138);_0x3ae466(_0x1fa73e[_0x3326('0xf')](0x1f4,_0x5f4ea6[_0x3326('0x11')]));});});};exports[_0x3326('0x27')]=function(_0x51f558){var _0x565681=this;return new Promise(function(_0x518087,_0x321cb2){return db[_0x3326('0x16')][_0x3326('0x28')]({'where':_0x51f558[_0x3326('0x17')]?_0x51f558['options'][_0x3326('0x19')]||null:null})[_0x3326('0xa')](function(_0x249f31){logger['info'](_0x3326('0x27'),_0x51f558);logger[_0x3326('0xd')](_0x3326('0x27'),_0x51f558,JSON['stringify'](_0x249f31));_0x518087(_0x249f31);})[_0x3326('0x14')](function(_0x300e68){logger[_0x3326('0xf')](_0x3326('0x27'),_0x300e68[_0x3326('0x11')],_0x51f558);_0x321cb2(_0x565681[_0x3326('0xf')](0x1f4,_0x300e68[_0x3326('0x11')]));});});};exports[_0x3326('0x29')]=function(_0x424d17){var _0x1f66a0=this;return new Promise(function(_0x17ab4b,_0x389aab){return db[_0x3326('0x2a')][_0x3326('0x2b')]()[_0x3326('0xa')](function(_0x398548){return db[_0x3326('0x2c')]['transaction'](function(_0x5043bb){return db['CmHopper'][_0x3326('0x2d')]({'where':_0x424d17[_0x3326('0x17')]?_0x424d17[_0x3326('0x17')][_0x3326('0x19')]||null:null,'attributes':_0x424d17[_0x3326('0x17')]?_0x424d17[_0x3326('0x17')][_0x3326('0x1a')]||null:null,'limit':_0x424d17[_0x3326('0x17')]?_0x424d17[_0x3326('0x17')][_0x3326('0x26')]||null:null,'order':_0x424d17['options']?_0x424d17[_0x3326('0x17')][_0x3326('0x2e')]||null:null,'transaction':_0x5043bb,'lock':_0x5043bb['LOCK'][_0x3326('0x2f')],'include':[{'model':db[_0x3326('0x2a')],'as':_0x3326('0x30'),'attributes':_[_0x3326('0x31')](_0x398548)},{'model':db['User'],'as':_0x3326('0x32'),'attributes':['id',_0x3326('0x33'),_0x3326('0x34')]}]})['then'](function(_0x360c20){var _0x285bdb=[];var _0x36f057=[];for(var _0xa750ef=0x0;_0xa750ef<_0x360c20[_0x3326('0x35')];_0xa750ef+=0x1){var _0x410c62=_0x360c20[_0xa750ef][_0x3326('0x36')];if(_0x410c62===null){_0x285bdb[_0x3326('0x37')](_0x360c20[_0xa750ef]['update'](_0x424d17[_0x3326('0x23')],{'transaction':_0x5043bb}));}else if(!_0x36f057[_0x3326('0x38')](_0x410c62)){_0x36f057['push'](_0x410c62);_0x285bdb[_0x3326('0x37')](_0x360c20[_0xa750ef][_0x3326('0x25')](_0x424d17[_0x3326('0x23')],{'transaction':_0x5043bb}));}}return BPromise[_0x3326('0x39')](_0x285bdb);});})[_0x3326('0xa')](function(_0x280a62){logger[_0x3326('0xb')](_0x3326('0x29'),_0x424d17);logger[_0x3326('0xd')](_0x3326('0x29'),_0x424d17,JSON['stringify'](_0x280a62));_0x17ab4b(_0x280a62);})[_0x3326('0x14')](function(_0x49340b){logger[_0x3326('0xf')](_0x3326('0x29'),_0x49340b[_0x3326('0x11')],_0x424d17);_0x389aab(_0x1f66a0[_0x3326('0xf')](0x1f4,_0x49340b['message']));});});});};exports[_0x3326('0x3a')]=function(_0x587849){var _0x76e936=this;return new Promise(function(_0x3853cf,_0x53122c){return db[_0x3326('0x2c')][_0x3326('0x3b')](function(_0x446247){return db[_0x3326('0x3c')][_0x3326('0x22')](_0x587849[_0x3326('0x23')],{'raw':_0x587849['options']?_0x587849[_0x3326('0x17')][_0x3326('0x18')]===undefined?!![]:![]:!![],'transaction':_0x446247})[_0x3326('0xa')](function(){return db[_0x3326('0x16')][_0x3326('0x28')]({'where':_0x587849[_0x3326('0x17')]?_0x587849[_0x3326('0x17')][_0x3326('0x19')]||null:null,'transaction':_0x446247});});})[_0x3326('0xa')](function(_0x1d1854){logger[_0x3326('0xb')](_0x3326('0x3a'),_0x587849);logger[_0x3326('0xd')]('MoveContactManagedDialer',_0x587849,JSON[_0x3326('0x1e')](_0x1d1854));_0x3853cf(_0x1d1854);})[_0x3326('0x14')](function(_0x21d68a){logger[_0x3326('0xf')](_0x3326('0x3a'),_0x21d68a['message'],_0x587849);_0x53122c(_0x76e936[_0x3326('0xf')](0x1f4,_0x21d68a[_0x3326('0x11')]));});});};exports[_0x3326('0x3d')]=function(_0x1f0997){var _0xa730d6=this;return new Promise(function(_0x553637,_0x275997){return db[_0x3326('0x16')][_0x3326('0x2d')]({'raw':_0x1f0997[_0x3326('0x17')]?_0x1f0997['options'][_0x3326('0x18')]===undefined?!![]:![]:!![],'where':_0x1f0997['options']?_0x1f0997[_0x3326('0x17')]['where']||null:null,'attributes':[[db[_0x3326('0x2c')]['fn'](_0x3326('0x3e'),db[_0x3326('0x2c')]['fn']('IF',db['sequelize'][_0x3326('0x3f')](_0x3326('0x40')+util['format'](_0x3326('0x41'),moment()[_0x3326('0x42')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x3326('0x43')))),'contactsRescheduled']]})[_0x3326('0xa')](function(_0x3bb9fb){logger[_0x3326('0xb')]('CountReScheduled',_0x1f0997);logger[_0x3326('0xd')](_0x3326('0x3d'),_0x1f0997,JSON[_0x3326('0x1e')](_0x3bb9fb));_0x553637(_0x3bb9fb);})['catch'](function(_0x19b712){logger['error'](_0x3326('0x3d'),_0x19b712[_0x3326('0x11')],_0x1f0997);_0x275997(_0xa730d6[_0x3326('0xf')](0x1f4,_0x19b712['message']));});});};exports['GetContactRecallMe']=function(_0x42f5a2){var _0x5e4c11=this;return new Promise(function(_0x287faa,_0x3d077c){return db[_0x3326('0x2a')][_0x3326('0x2b')]()['then'](function(_0x2a8a35){return db[_0x3326('0x2c')]['transaction'](function(_0x39bc0a){return db[_0x3326('0x16')][_0x3326('0x2d')]({'where':_0x42f5a2['options']?_0x42f5a2[_0x3326('0x17')][_0x3326('0x19')]||null:null,'attributes':_0x42f5a2[_0x3326('0x17')]?_0x42f5a2[_0x3326('0x17')]['attributes']||null:null,'limit':0x1,'order':_0x42f5a2['options']?_0x42f5a2[_0x3326('0x17')][_0x3326('0x2e')]||null:null,'group':db['CmHopper'][_0x3326('0x36')],'transaction':_0x39bc0a,'lock':_0x39bc0a['LOCK'][_0x3326('0x2f')],'include':_0x42f5a2['options']?_0x42f5a2['options'][_0x3326('0x1c')]?_[_0x3326('0x1b')](_0x42f5a2['options'][_0x3326('0x1c')],function(_0x1c3413){return{'model':db[_0x1c3413[_0x3326('0x1d')]],'as':_0x1c3413['as'],'attributes':_0x1c3413[_0x3326('0x1a')],'include':_0x1c3413[_0x3326('0x1c')]?_[_0x3326('0x1b')](_0x1c3413[_0x3326('0x1c')],function(_0x3f8ddf){return{'model':db[_0x3f8ddf[_0x3326('0x1d')]],'as':_0x3f8ddf['as'],'attributes':_0x3f8ddf[_0x3326('0x1a')],'include':_0x3f8ddf[_0x3326('0x1c')]?_[_0x3326('0x1b')](_0x3f8ddf[_0x3326('0x1c')],function(_0x3bbba1){return{'model':db[_0x3bbba1[_0x3326('0x1d')]],'as':_0x3bbba1['as'],'attributes':_0x3bbba1[_0x3326('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3326('0xa')](function(_0x4d8d24){var _0x2ada0b=[];for(var _0x4567e2=0x0;_0x4567e2<_0x4d8d24['length'];_0x4567e2+=0x1){_0x2ada0b[_0x3326('0x37')](_0x4d8d24[_0x4567e2][_0x3326('0x25')](_0x42f5a2[_0x3326('0x23')],{'transaction':_0x39bc0a}));}return BPromise[_0x3326('0x39')](_0x2ada0b);});})[_0x3326('0xa')](function(_0x12ec40){logger[_0x3326('0xb')]('GetContactRecallMe',_0x42f5a2);logger[_0x3326('0xd')](_0x3326('0x44'),_0x42f5a2,JSON[_0x3326('0x1e')](_0x12ec40));_0x287faa(_0x12ec40);})['catch'](function(_0x250496){logger['error'](_0x3326('0x44'),_0x250496[_0x3326('0x11')],_0x42f5a2);_0x3d077c(_0x5e4c11[_0x3326('0xf')](0x1f4,_0x250496[_0x3326('0x11')]));});});});};exports['GetCmHopperPreview']=function(_0x48a521){var _0x4079f5=this;return new Promise(function(_0x1b86ae,_0x460be5){db[_0x3326('0x2a')]['describe']()['then'](function(_0x8bb996){return db['CmHopper'][_0x3326('0x2d')]({'raw':_0x48a521[_0x3326('0x17')]?_0x48a521['options'][_0x3326('0x18')]===undefined?!![]:![]:!![],'where':_0x48a521[_0x3326('0x17')]?_0x48a521[_0x3326('0x17')][_0x3326('0x19')]||null:null,'attributes':_0x48a521[_0x3326('0x17')]?_0x48a521[_0x3326('0x17')][_0x3326('0x1a')]||null:null,'limit':_0x48a521['options']?_0x48a521[_0x3326('0x17')]['limit']||null:null,'include':_0x48a521[_0x3326('0x17')]?_0x48a521[_0x3326('0x17')][_0x3326('0x1c')]?_[_0x3326('0x1b')](_0x48a521['options'][_0x3326('0x1c')],function(_0x2760a7){return{'model':db[_0x2760a7[_0x3326('0x1d')]],'as':_0x2760a7['as'],'attributes':_0x2760a7['as']===_0x3326('0x30')?_[_0x3326('0x31')](_0x8bb996):_0x2760a7['attributes'],'include':_0x2760a7[_0x3326('0x1c')]?_[_0x3326('0x1b')](_0x2760a7[_0x3326('0x1c')],function(_0x3fe372){return{'model':db[_0x3fe372[_0x3326('0x1d')]],'as':_0x3fe372['as'],'attributes':_0x3fe372[_0x3326('0x1a')],'include':_0x3fe372[_0x3326('0x1c')]?_[_0x3326('0x1b')](_0x3fe372['include'],function(_0x2c4831){return{'model':db[_0x2c4831['model']],'as':_0x2c4831['as'],'attributes':_0x2c4831[_0x3326('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3326('0xa')](function(_0x504db3){logger['info'](_0x3326('0x15'),_0x48a521);logger['debug'](_0x3326('0x15'),_0x48a521,JSON[_0x3326('0x1e')](_0x504db3));_0x1b86ae(_0x504db3);})[_0x3326('0x14')](function(_0x32e815){logger['error'](_0x3326('0x15'),_0x32e815[_0x3326('0x11')],_0x48a521);_0x460be5(_0x4079f5['error'](0x1f4,_0x32e815[_0x3326('0x11')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index eadf71f..ff98359 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 _0x94b7=['describe','/opencontacts','getOpenContacts','/:id','show','post','create','getPreview','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe'];(function(_0x3ccbc7,_0x3093c8){var _0x50c97a=function(_0x4af44d){while(--_0x4af44d){_0x3ccbc7['push'](_0x3ccbc7['shift']());}};_0x50c97a(++_0x3093c8);}(_0x94b7,0x1c6));var _0x794b=function(_0x4947be,_0x5ed0ae){_0x4947be=_0x4947be-0x0;var _0x4c387a=_0x94b7[_0x4947be];return _0x4c387a;};'use strict';var multer=require(_0x794b('0x0'));var util=require(_0x794b('0x1'));var path=require(_0x794b('0x2'));var timeout=require(_0x794b('0x3'));var express=require('express');var router=express[_0x794b('0x4')]();var fs_extra=require(_0x794b('0x5'));var auth=require(_0x794b('0x6'));var interaction=require(_0x794b('0x7'));var config=require(_0x794b('0x8'));var controller=require(_0x794b('0x9'));router[_0x794b('0xa')]('/',auth[_0x794b('0xb')](),controller[_0x794b('0xc')]);router[_0x794b('0xa')](_0x794b('0xd'),auth[_0x794b('0xb')](),controller[_0x794b('0xe')]);router[_0x794b('0xa')](_0x794b('0xf'),auth[_0x794b('0xb')](),controller[_0x794b('0x10')]);router[_0x794b('0xa')](_0x794b('0x11'),auth['isAuthenticated'](),controller[_0x794b('0x12')]);router[_0x794b('0x13')]('/',auth['isAuthenticated'](),controller[_0x794b('0x14')]);router['post']('/preview',auth[_0x794b('0xb')](),controller[_0x794b('0x15')]);router[_0x794b('0x16')](_0x794b('0x11'),auth[_0x794b('0xb')](),controller[_0x794b('0x17')]);router[_0x794b('0x18')](_0x794b('0x11'),auth['isAuthenticated'](),controller[_0x794b('0x19')]);module['exports']=router; \ No newline at end of file +var _0x639c=['post','create','/preview','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','show'];(function(_0x5c10fc,_0x1116d9){var _0x44391b=function(_0x2de5b2){while(--_0x2de5b2){_0x5c10fc['push'](_0x5c10fc['shift']());}};_0x44391b(++_0x1116d9);}(_0x639c,0xc8));var _0xc639=function(_0x5ae8f7,_0x330d91){_0x5ae8f7=_0x5ae8f7-0x0;var _0x54c636=_0x639c[_0x5ae8f7];return _0x54c636;};'use strict';var multer=require(_0xc639('0x0'));var util=require(_0xc639('0x1'));var path=require(_0xc639('0x2'));var timeout=require(_0xc639('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc639('0x4'));var auth=require(_0xc639('0x5'));var interaction=require(_0xc639('0x6'));var config=require(_0xc639('0x7'));var controller=require(_0xc639('0x8'));router[_0xc639('0x9')]('/',auth[_0xc639('0xa')](),controller[_0xc639('0xb')]);router['get'](_0xc639('0xc'),auth['isAuthenticated'](),controller[_0xc639('0xd')]);router['get'](_0xc639('0xe'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0xc639('0x9')]('/:id',auth[_0xc639('0xa')](),controller[_0xc639('0xf')]);router[_0xc639('0x10')]('/',auth['isAuthenticated'](),controller[_0xc639('0x11')]);router['post'](_0xc639('0x12'),auth[_0xc639('0xa')](),controller['getPreview']);router[_0xc639('0x13')](_0xc639('0x14'),auth[_0xc639('0xa')](),controller[_0xc639('0x15')]);router[_0xc639('0x16')](_0xc639('0x14'),auth[_0xc639('0xa')](),controller[_0xc639('0x17')]);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 f2cddcc..fc6387d 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 _0x4c60=['exports','STRING','contactListQueue','INTEGER','moment','sequelize'];(function(_0x411d5a,_0x21411b){var _0x4c97b1=function(_0x5e8395){while(--_0x5e8395){_0x411d5a['push'](_0x411d5a['shift']());}};_0x4c97b1(++_0x21411b);}(_0x4c60,0x166));var _0x04c6=function(_0x3ad16a,_0x39a96b){_0x3ad16a=_0x3ad16a-0x0;var _0x2ecf02=_0x4c60[_0x3ad16a];return _0x2ecf02;};'use strict';var moment=require(_0x04c6('0x0'));var Sequelize=require(_0x04c6('0x1'));module[_0x04c6('0x2')]={'phone':{'type':Sequelize[_0x04c6('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x04c6('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x04c6('0x5')],'unique':_0x04c6('0x4')}}; \ No newline at end of file +var _0x5d58=['INTEGER','contactListQueue'];(function(_0x17ba2e,_0x5d4009){var _0x2f8e7d=function(_0x5890d1){while(--_0x5890d1){_0x17ba2e['push'](_0x17ba2e['shift']());}};_0x2f8e7d(++_0x5d4009);}(_0x5d58,0x187));var _0x85d5=function(_0x37662b,_0x2337e1){_0x37662b=_0x37662b-0x0;var _0x1b977c=_0x5d58[_0x37662b];return _0x1b977c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x85d5('0x0')},'ListId':{'type':Sequelize[_0x85d5('0x1')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x85d5('0x1')],'unique':_0x85d5('0x0')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index d114ec0..0542c5e 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 _0x66a9=['pick','filter','VIRTUAL','options','CmHopperBlack','includeAll','include','findAll','catch','show','params','keys','merge','update','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','then','destroy','stack','map','rawAttributes','fieldName','key','name','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','where'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x66a9,0x1a3));var _0x966a=function(_0x5622d6,_0x40809a){_0x5622d6=_0x5622d6-0x0;var _0x411cae=_0x66a9[_0x5622d6];return _0x411cae;};'use strict';var emlformat=require(_0x966a('0x0'));var rimraf=require(_0x966a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x966a('0x2'));var rp=require(_0x966a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x966a('0x4'));var util=require(_0x966a('0x5'));var path=require(_0x966a('0x6'));var sox=require(_0x966a('0x7'));var csv=require('to-csv');var ejs=require(_0x966a('0x8'));var fs=require('fs');var fs_extra=require(_0x966a('0x9'));var _=require(_0x966a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x966a('0xb'));var toCsv=require(_0x966a('0xc'));var querystring=require(_0x966a('0xd'));var Papa=require(_0x966a('0xe'));var Redis=require(_0x966a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x966a('0x10'));var as=require(_0x966a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x966a('0x12'))(_0x966a('0x13'));var utils=require(_0x966a('0x14'));var config=require(_0x966a('0x15'));var licenseUtil=require(_0x966a('0x16'));var db=require(_0x966a('0x17'))['db'];function respondWithStatusCode(_0x1e2dac,_0x1a215f){_0x1a215f=_0x1a215f||0xcc;return function(_0x3c875f){if(_0x3c875f){return _0x1e2dac[_0x966a('0x18')](_0x1a215f);}return _0x1e2dac['status'](_0x1a215f)['end']();};}function respondWithResult(_0x134156,_0x53685c){_0x53685c=_0x53685c||0xc8;return function(_0xbfca53){if(_0xbfca53){return _0x134156[_0x966a('0x19')](_0x53685c)[_0x966a('0x1a')](_0xbfca53);}};}function respondWithFilteredResult(_0x5c3f67,_0x11e093){return function(_0x907635){if(_0x907635){var _0x5ea71a=typeof _0x11e093[_0x966a('0x1b')]===_0x966a('0x1c')&&typeof _0x11e093[_0x966a('0x1d')]===_0x966a('0x1c');var _0x42d3d5=_0x907635['count'];var _0x867e0f=_0x5ea71a?0x0:_0x11e093['offset'];var _0x563aa9=_0x5ea71a?_0x907635[_0x966a('0x1e')]:_0x11e093['offset']+_0x11e093['limit'];var _0x5f56ce;if(_0x563aa9>=_0x42d3d5){_0x563aa9=_0x42d3d5;_0x5f56ce=0xc8;}else{_0x5f56ce=0xce;}_0x5c3f67[_0x966a('0x19')](_0x5f56ce);return _0x5c3f67['set']('Content-Range',_0x867e0f+'-'+_0x563aa9+'/'+_0x42d3d5)[_0x966a('0x1a')](_0x907635);}return null;};}function patchUpdates(_0xc1c9f0){return function(_0x93106a){try{jsonpatch['apply'](_0x93106a,_0xc1c9f0,!![]);}catch(_0x573f51){return BPromise['reject'](_0x573f51);}return _0x93106a['save']();};}function saveUpdates(_0x30b37e,_0x55e811){return function(_0x3fd3b1){if(_0x3fd3b1){return _0x3fd3b1['update'](_0x30b37e)[_0x966a('0x1f')](function(_0x31aa8b){return _0x31aa8b;});}return null;};}function removeEntity(_0x5d80f8,_0x57e049){return function(_0x4a90d4){if(_0x4a90d4){return _0x4a90d4[_0x966a('0x20')]()[_0x966a('0x1f')](function(){_0x5d80f8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25bd2c,_0x26b2e3){return function(_0x4c3a23){if(!_0x4c3a23){_0x25bd2c[_0x966a('0x18')](0x194);}return _0x4c3a23;};}function handleError(_0x407bb5,_0x437d80){_0x437d80=_0x437d80||0x1f4;return function(_0x445f62){logger['error'](_0x445f62[_0x966a('0x21')]);if(_0x445f62['name']){delete _0x445f62['name'];}_0x407bb5['status'](_0x437d80)['send'](_0x445f62);};}exports['index']=function(_0x43e26e,_0x34aad6){var _0x5bfac1={},_0x5d3310={},_0x763d1d={'count':0x0,'rows':[]};var _0x32447d=_[_0x966a('0x22')](db['CmHopperBlack'][_0x966a('0x23')],function(_0x5a9815){return{'name':_0x5a9815[_0x966a('0x24')],'type':_0x5a9815['type'][_0x966a('0x25')]};});_0x5d3310['model']=_['map'](_0x32447d,_0x966a('0x26'));_0x5d3310['query']=_['keys'](_0x43e26e[_0x966a('0x27')]);_0x5d3310[_0x966a('0x28')]=_['intersection'](_0x5d3310[_0x966a('0x29')],_0x5d3310[_0x966a('0x27')]);_0x5bfac1['attributes']=_[_0x966a('0x2a')](_0x5d3310[_0x966a('0x29')],qs[_0x966a('0x2b')](_0x43e26e[_0x966a('0x27')][_0x966a('0x2b')]));_0x5bfac1[_0x966a('0x2c')]=_0x5bfac1['attributes'][_0x966a('0x2d')]?_0x5bfac1[_0x966a('0x2c')]:_0x5d3310['model'];if(!_0x43e26e[_0x966a('0x27')]['hasOwnProperty'](_0x966a('0x2e'))){_0x5bfac1[_0x966a('0x1d')]=qs['limit'](_0x43e26e[_0x966a('0x27')][_0x966a('0x1d')]);_0x5bfac1[_0x966a('0x1b')]=qs[_0x966a('0x1b')](_0x43e26e[_0x966a('0x27')]['offset']);}_0x5bfac1[_0x966a('0x2f')]=qs[_0x966a('0x30')](_0x43e26e['query'][_0x966a('0x30')]);_0x5bfac1[_0x966a('0x31')]=qs['filters'](_[_0x966a('0x32')](_0x43e26e[_0x966a('0x27')],_0x5d3310['filters']),_0x32447d);if(_0x43e26e[_0x966a('0x27')][_0x966a('0x33')]){_0x5bfac1[_0x966a('0x31')]=_['merge'](_0x5bfac1[_0x966a('0x31')],{'$or':_[_0x966a('0x22')](_0x32447d,function(_0x568600){if(_0x568600['type']!==_0x966a('0x34')){var _0x4d9bfb={};_0x4d9bfb[_0x568600[_0x966a('0x26')]]={'$like':'%'+_0x43e26e[_0x966a('0x27')][_0x966a('0x33')]+'%'};return _0x4d9bfb;}})});}_0x5bfac1=_['merge']({},_0x5bfac1,_0x43e26e[_0x966a('0x35')]);var _0x3beceb={'where':_0x5bfac1[_0x966a('0x31')]};return db[_0x966a('0x36')][_0x966a('0x1e')](_0x3beceb)[_0x966a('0x1f')](function(_0x4bca7f){_0x763d1d[_0x966a('0x1e')]=_0x4bca7f;if(_0x43e26e[_0x966a('0x27')][_0x966a('0x37')]){_0x5bfac1[_0x966a('0x38')]=[{'all':!![]}];}return db[_0x966a('0x36')][_0x966a('0x39')](_0x5bfac1);})[_0x966a('0x1f')](function(_0x2e5001){_0x763d1d['rows']=_0x2e5001;return _0x763d1d;})[_0x966a('0x1f')](respondWithFilteredResult(_0x34aad6,_0x5bfac1))[_0x966a('0x3a')](handleError(_0x34aad6,null));};exports[_0x966a('0x3b')]=function(_0x31d726,_0x390909){var _0x505279={'raw':!![],'where':{'id':_0x31d726[_0x966a('0x3c')]['id']}},_0x5083bb={};_0x5083bb[_0x966a('0x29')]=_['keys'](db['CmHopperBlack'][_0x966a('0x23')]);_0x5083bb['query']=_[_0x966a('0x3d')](_0x31d726[_0x966a('0x27')]);_0x5083bb[_0x966a('0x28')]=_[_0x966a('0x2a')](_0x5083bb['model'],_0x5083bb['query']);_0x505279['attributes']=_['intersection'](_0x5083bb[_0x966a('0x29')],qs[_0x966a('0x2b')](_0x31d726['query'][_0x966a('0x2b')]));_0x505279[_0x966a('0x2c')]=_0x505279[_0x966a('0x2c')][_0x966a('0x2d')]?_0x505279[_0x966a('0x2c')]:_0x5083bb['model'];if(_0x31d726[_0x966a('0x27')]['includeAll']){_0x505279['include']=[{'all':!![]}];}_0x505279=_[_0x966a('0x3e')]({},_0x505279,_0x31d726['options']);return db['CmHopperBlack']['find'](_0x505279)['then'](handleEntityNotFound(_0x390909,null))['then'](respondWithResult(_0x390909,null))[_0x966a('0x3a')](handleError(_0x390909,null));};exports[_0x966a('0x3f')]=function(_0x56918f,_0x2cf650){if(_0x56918f[_0x966a('0x40')]['id']){delete _0x56918f[_0x966a('0x40')]['id'];}return db[_0x966a('0x36')][_0x966a('0x41')]({'where':{'id':_0x56918f[_0x966a('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2cf650,null))['then'](saveUpdates(_0x56918f['body'],null))['then'](respondWithResult(_0x2cf650,null))[_0x966a('0x3a')](handleError(_0x2cf650,null));};exports[_0x966a('0x20')]=function(_0x66ae52,_0x3aee6c){return db[_0x966a('0x36')]['find']({'where':{'id':_0x66ae52[_0x966a('0x3c')]['id']}})[_0x966a('0x1f')](handleEntityNotFound(_0x3aee6c,null))[_0x966a('0x1f')](removeEntity(_0x3aee6c,null))[_0x966a('0x3a')](handleError(_0x3aee6c,null));};exports[_0x966a('0x42')]=function(_0x71a66d,_0x4dfc73){return db[_0x966a('0x36')][_0x966a('0x42')]()['then'](respondWithResult(_0x4dfc73,null))['catch'](handleError(_0x4dfc73,null));}; \ No newline at end of file +var _0x92f8=['body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperBlack','includeAll','include','findAll','rows','catch','show','params','keys','length','find'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0x92f8,0xe4));var _0x892f=function(_0x3f85b6,_0x297abc){_0x3f85b6=_0x3f85b6-0x0;var _0xe3a86f=_0x92f8[_0x3f85b6];return _0xe3a86f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x892f('0x0'));var zipdir=require(_0x892f('0x1'));var jsonpatch=require(_0x892f('0x2'));var rp=require(_0x892f('0x3'));var moment=require(_0x892f('0x4'));var BPromise=require(_0x892f('0x5'));var Mustache=require(_0x892f('0x6'));var util=require(_0x892f('0x7'));var path=require('path');var sox=require(_0x892f('0x8'));var csv=require('to-csv');var ejs=require(_0x892f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x892f('0xa'));var squel=require(_0x892f('0xb'));var crypto=require(_0x892f('0xc'));var jsforce=require(_0x892f('0xd'));var deskjs=require(_0x892f('0xe'));var toCsv=require(_0x892f('0xf'));var querystring=require(_0x892f('0x10'));var Papa=require(_0x892f('0x11'));var Redis=require(_0x892f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x892f('0x13'));var as=require(_0x892f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x892f('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x892f('0x16'));var db=require(_0x892f('0x17'))['db'];function respondWithStatusCode(_0x5158e3,_0xb666b8){_0xb666b8=_0xb666b8||0xcc;return function(_0x2db7be){if(_0x2db7be){return _0x5158e3['sendStatus'](_0xb666b8);}return _0x5158e3[_0x892f('0x18')](_0xb666b8)[_0x892f('0x19')]();};}function respondWithResult(_0x1c6088,_0x1d2445){_0x1d2445=_0x1d2445||0xc8;return function(_0x2f6f22){if(_0x2f6f22){return _0x1c6088['status'](_0x1d2445)[_0x892f('0x1a')](_0x2f6f22);}};}function respondWithFilteredResult(_0x20a3db,_0x289886){return function(_0x3412f7){if(_0x3412f7){var _0x5397cd=typeof _0x289886['offset']===_0x892f('0x1b')&&typeof _0x289886['limit']===_0x892f('0x1b');var _0x358a10=_0x3412f7[_0x892f('0x1c')];var _0x29859b=_0x5397cd?0x0:_0x289886[_0x892f('0x1d')];var _0x5edbee=_0x5397cd?_0x3412f7[_0x892f('0x1c')]:_0x289886['offset']+_0x289886[_0x892f('0x1e')];var _0xc32363;if(_0x5edbee>=_0x358a10){_0x5edbee=_0x358a10;_0xc32363=0xc8;}else{_0xc32363=0xce;}_0x20a3db[_0x892f('0x18')](_0xc32363);return _0x20a3db[_0x892f('0x1f')](_0x892f('0x20'),_0x29859b+'-'+_0x5edbee+'/'+_0x358a10)[_0x892f('0x1a')](_0x3412f7);}return null;};}function patchUpdates(_0x36d3bd){return function(_0x15c004){try{jsonpatch[_0x892f('0x21')](_0x15c004,_0x36d3bd,!![]);}catch(_0x181bb6){return BPromise[_0x892f('0x22')](_0x181bb6);}return _0x15c004['save']();};}function saveUpdates(_0x51be5a,_0x4856af){return function(_0x3220ae){if(_0x3220ae){return _0x3220ae[_0x892f('0x23')](_0x51be5a)[_0x892f('0x24')](function(_0x3519b4){return _0x3519b4;});}return null;};}function removeEntity(_0x27eb42,_0x314cfd){return function(_0x5d7edf){if(_0x5d7edf){return _0x5d7edf['destroy']()['then'](function(){_0x27eb42[_0x892f('0x18')](0xcc)[_0x892f('0x19')]();});}};}function handleEntityNotFound(_0x3a7e3c,_0x4d4c6c){return function(_0x3ab8d8){if(!_0x3ab8d8){_0x3a7e3c['sendStatus'](0x194);}return _0x3ab8d8;};}function handleError(_0x66cf58,_0x3f5acd){_0x3f5acd=_0x3f5acd||0x1f4;return function(_0x481167){logger['error'](_0x481167['stack']);if(_0x481167[_0x892f('0x25')]){delete _0x481167[_0x892f('0x25')];}_0x66cf58[_0x892f('0x18')](_0x3f5acd)[_0x892f('0x26')](_0x481167);};}exports[_0x892f('0x27')]=function(_0x33f845,_0x38b1f9){var _0x3c21b9={},_0x3e9e1e={},_0x58fd60={'count':0x0,'rows':[]};var _0x237a8e=_['map'](db['CmHopperBlack'][_0x892f('0x28')],function(_0x24b76e){return{'name':_0x24b76e[_0x892f('0x29')],'type':_0x24b76e[_0x892f('0x2a')][_0x892f('0x2b')]};});_0x3e9e1e[_0x892f('0x2c')]=_[_0x892f('0x2d')](_0x237a8e,_0x892f('0x25'));_0x3e9e1e[_0x892f('0x2e')]=_['keys'](_0x33f845['query']);_0x3e9e1e[_0x892f('0x2f')]=_[_0x892f('0x30')](_0x3e9e1e[_0x892f('0x2c')],_0x3e9e1e[_0x892f('0x2e')]);_0x3c21b9[_0x892f('0x31')]=_[_0x892f('0x30')](_0x3e9e1e[_0x892f('0x2c')],qs['fields'](_0x33f845[_0x892f('0x2e')][_0x892f('0x32')]));_0x3c21b9[_0x892f('0x31')]=_0x3c21b9[_0x892f('0x31')]['length']?_0x3c21b9[_0x892f('0x31')]:_0x3e9e1e['model'];if(!_0x33f845[_0x892f('0x2e')][_0x892f('0x33')](_0x892f('0x34'))){_0x3c21b9[_0x892f('0x1e')]=qs['limit'](_0x33f845[_0x892f('0x2e')][_0x892f('0x1e')]);_0x3c21b9[_0x892f('0x1d')]=qs[_0x892f('0x1d')](_0x33f845[_0x892f('0x2e')][_0x892f('0x1d')]);}_0x3c21b9[_0x892f('0x35')]=qs[_0x892f('0x36')](_0x33f845[_0x892f('0x2e')][_0x892f('0x36')]);_0x3c21b9[_0x892f('0x37')]=qs[_0x892f('0x2f')](_[_0x892f('0x38')](_0x33f845[_0x892f('0x2e')],_0x3e9e1e[_0x892f('0x2f')]),_0x237a8e);if(_0x33f845[_0x892f('0x2e')][_0x892f('0x39')]){_0x3c21b9[_0x892f('0x37')]=_[_0x892f('0x3a')](_0x3c21b9[_0x892f('0x37')],{'$or':_[_0x892f('0x2d')](_0x237a8e,function(_0x5a3d74){if(_0x5a3d74[_0x892f('0x2a')]!==_0x892f('0x3b')){var _0x96b297={};_0x96b297[_0x5a3d74['name']]={'$like':'%'+_0x33f845['query'][_0x892f('0x39')]+'%'};return _0x96b297;}})});}_0x3c21b9=_[_0x892f('0x3a')]({},_0x3c21b9,_0x33f845[_0x892f('0x3c')]);var _0x36c809={'where':_0x3c21b9[_0x892f('0x37')]};return db[_0x892f('0x3d')][_0x892f('0x1c')](_0x36c809)[_0x892f('0x24')](function(_0x1717ab){_0x58fd60[_0x892f('0x1c')]=_0x1717ab;if(_0x33f845[_0x892f('0x2e')][_0x892f('0x3e')]){_0x3c21b9[_0x892f('0x3f')]=[{'all':!![]}];}return db[_0x892f('0x3d')][_0x892f('0x40')](_0x3c21b9);})[_0x892f('0x24')](function(_0x23e66f){_0x58fd60[_0x892f('0x41')]=_0x23e66f;return _0x58fd60;})[_0x892f('0x24')](respondWithFilteredResult(_0x38b1f9,_0x3c21b9))[_0x892f('0x42')](handleError(_0x38b1f9,null));};exports[_0x892f('0x43')]=function(_0x19eb4e,_0x19dc83){var _0x453c58={'raw':!![],'where':{'id':_0x19eb4e[_0x892f('0x44')]['id']}},_0x203b03={};_0x203b03['model']=_[_0x892f('0x45')](db[_0x892f('0x3d')][_0x892f('0x28')]);_0x203b03[_0x892f('0x2e')]=_[_0x892f('0x45')](_0x19eb4e[_0x892f('0x2e')]);_0x203b03[_0x892f('0x2f')]=_[_0x892f('0x30')](_0x203b03[_0x892f('0x2c')],_0x203b03[_0x892f('0x2e')]);_0x453c58[_0x892f('0x31')]=_[_0x892f('0x30')](_0x203b03[_0x892f('0x2c')],qs[_0x892f('0x32')](_0x19eb4e[_0x892f('0x2e')][_0x892f('0x32')]));_0x453c58[_0x892f('0x31')]=_0x453c58['attributes'][_0x892f('0x46')]?_0x453c58['attributes']:_0x203b03[_0x892f('0x2c')];if(_0x19eb4e[_0x892f('0x2e')][_0x892f('0x3e')]){_0x453c58[_0x892f('0x3f')]=[{'all':!![]}];}_0x453c58=_['merge']({},_0x453c58,_0x19eb4e[_0x892f('0x3c')]);return db['CmHopperBlack'][_0x892f('0x47')](_0x453c58)[_0x892f('0x24')](handleEntityNotFound(_0x19dc83,null))[_0x892f('0x24')](respondWithResult(_0x19dc83,null))[_0x892f('0x42')](handleError(_0x19dc83,null));};exports['update']=function(_0x3c5e82,_0x136722){if(_0x3c5e82[_0x892f('0x48')]['id']){delete _0x3c5e82[_0x892f('0x48')]['id'];}return db['CmHopperBlack'][_0x892f('0x47')]({'where':{'id':_0x3c5e82['params']['id']}})[_0x892f('0x24')](handleEntityNotFound(_0x136722,null))[_0x892f('0x24')](saveUpdates(_0x3c5e82[_0x892f('0x48')],null))[_0x892f('0x24')](respondWithResult(_0x136722,null))[_0x892f('0x42')](handleError(_0x136722,null));};exports[_0x892f('0x49')]=function(_0x3acfda,_0x42b069){return db['CmHopperBlack'][_0x892f('0x47')]({'where':{'id':_0x3acfda[_0x892f('0x44')]['id']}})[_0x892f('0x24')](handleEntityNotFound(_0x42b069,null))[_0x892f('0x24')](removeEntity(_0x42b069,null))['catch'](handleError(_0x42b069,null));};exports[_0x892f('0x4a')]=function(_0x1d5b4f,_0x4862ae){return db['CmHopperBlack'][_0x892f('0x4a')]()[_0x892f('0x24')](respondWithResult(_0x4862ae,null))[_0x892f('0x42')](handleError(_0x4862ae,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 338bc9d..3e66a7f 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 _0x4fa3=['path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x9b5bb2,_0x5db315){var _0x2e1e92=function(_0x5621c9){while(--_0x5621c9){_0x9b5bb2['push'](_0x9b5bb2['shift']());}};_0x2e1e92(++_0x5db315);}(_0x4fa3,0x1e8));var _0x34fa=function(_0x5601a3,_0x127f4d){_0x5601a3=_0x5601a3-0x0;var _0x40a2f3=_0x4fa3[_0x5601a3];return _0x40a2f3;};'use strict';var _=require(_0x34fa('0x0'));var util=require('util');var logger=require(_0x34fa('0x1'))(_0x34fa('0x2'));var moment=require(_0x34fa('0x3'));var BPromise=require(_0x34fa('0x4'));var rp=require(_0x34fa('0x5'));var fs=require('fs');var path=require(_0x34fa('0x6'));var rimraf=require(_0x34fa('0x7'));var config=require(_0x34fa('0x8'));var attributes=require(_0x34fa('0x9'));module[_0x34fa('0xa')]=function(_0x1b622b,_0x1a8e4f){return _0x1b622b[_0x34fa('0xb')]('CmHopperBlack',attributes,{'tableName':_0x34fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3510=['moment','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','../../config/logger'];(function(_0x38ccc9,_0x30f969){var _0x15dc30=function(_0x129bf0){while(--_0x129bf0){_0x38ccc9['push'](_0x38ccc9['shift']());}};_0x15dc30(++_0x30f969);}(_0x3510,0x1ee));var _0x0351=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x3510[_0x5608a3];return _0x1ed50a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0351('0x0'))('api');var moment=require(_0x0351('0x1'));var BPromise=require('bluebird');var rp=require(_0x0351('0x2'));var fs=require('fs');var path=require(_0x0351('0x3'));var rimraf=require(_0x0351('0x4'));var config=require(_0x0351('0x5'));var attributes=require(_0x0351('0x6'));module[_0x0351('0x7')]=function(_0x4b7010,_0x41b8a8){return _0x4b7010[_0x0351('0x8')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','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 c693822..61a4811 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 _0xa1e4=['where','attributes','limit','include','model','map','stringify','UpdateCmHopperBlack','update','body','destroy','DestroyCmHopperBlack','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetCmHopperBlack','options','raw'];(function(_0x4cbb8e,_0x1047c8){var _0x17846f=function(_0x29e1e0){while(--_0x29e1e0){_0x4cbb8e['push'](_0x4cbb8e['shift']());}};_0x17846f(++_0x1047c8);}(_0xa1e4,0x162));var _0x4a1e=function(_0x472173,_0x140ece){_0x472173=_0x472173-0x0;var _0x5abc10=_0xa1e4[_0x472173];return _0x5abc10;};'use strict';var _=require(_0x4a1e('0x0'));var util=require('util');var moment=require(_0x4a1e('0x1'));var BPromise=require(_0x4a1e('0x2'));var rs=require(_0x4a1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a1e('0x4'))['db'];var utils=require(_0x4a1e('0x5'));var logger=require('../../config/logger')(_0x4a1e('0x6'));var config=require(_0x4a1e('0x7'));var jayson=require(_0x4a1e('0x8'));var client=jayson[_0x4a1e('0x9')][_0x4a1e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ec0a2,_0x18e2df,_0x449e33){return new BPromise(function(_0x3326ce,_0x44ae13){return client[_0x4a1e('0xb')](_0x1ec0a2,_0x449e33)[_0x4a1e('0xc')](function(_0xdaace9){logger[_0x4a1e('0xd')](_0x4a1e('0xe'),_0x18e2df,'request\x20sent');logger[_0x4a1e('0xf')](_0x4a1e('0x10'),_0x18e2df,'request\x20sent',JSON['stringify'](_0xdaace9));if(_0xdaace9['error']){if(_0xdaace9[_0x4a1e('0x11')][_0x4a1e('0x12')]===0x1f4){logger[_0x4a1e('0x11')](_0x4a1e('0xe'),_0x18e2df,_0xdaace9[_0x4a1e('0x11')]['message']);return _0x44ae13(_0xdaace9['error'][_0x4a1e('0x13')]);}logger[_0x4a1e('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x18e2df,_0xdaace9[_0x4a1e('0x11')][_0x4a1e('0x13')]);return _0x3326ce(_0xdaace9['error'][_0x4a1e('0x13')]);}else{logger[_0x4a1e('0xd')](_0x4a1e('0xe'),_0x18e2df,_0x4a1e('0x14'));_0x3326ce(_0xdaace9[_0x4a1e('0x15')][_0x4a1e('0x13')]);}})[_0x4a1e('0x16')](function(_0x311a3c){logger[_0x4a1e('0x11')](_0x4a1e('0xe'),_0x18e2df,_0x311a3c);_0x44ae13(_0x311a3c);});});}exports[_0x4a1e('0x17')]=function(_0x43b4f4){var _0x2e774c=this;return new Promise(function(_0x462212,_0x414b4b){return db['CmHopperBlack']['findAll']({'raw':_0x43b4f4[_0x4a1e('0x18')]?_0x43b4f4[_0x4a1e('0x18')][_0x4a1e('0x19')]===undefined?!![]:![]:!![],'where':_0x43b4f4[_0x4a1e('0x18')]?_0x43b4f4[_0x4a1e('0x18')][_0x4a1e('0x1a')]||null:null,'attributes':_0x43b4f4[_0x4a1e('0x18')]?_0x43b4f4['options'][_0x4a1e('0x1b')]||null:null,'limit':_0x43b4f4['options']?_0x43b4f4[_0x4a1e('0x18')][_0x4a1e('0x1c')]||null:null,'include':_0x43b4f4[_0x4a1e('0x18')]?_0x43b4f4[_0x4a1e('0x18')][_0x4a1e('0x1d')]?_['map'](_0x43b4f4['options'][_0x4a1e('0x1d')],function(_0x28fd7f){return{'model':db[_0x28fd7f[_0x4a1e('0x1e')]],'as':_0x28fd7f['as'],'attributes':_0x28fd7f[_0x4a1e('0x1b')],'include':_0x28fd7f[_0x4a1e('0x1d')]?_[_0x4a1e('0x1f')](_0x28fd7f[_0x4a1e('0x1d')],function(_0x5c0302){return{'model':db[_0x5c0302[_0x4a1e('0x1e')]],'as':_0x5c0302['as'],'attributes':_0x5c0302['attributes'],'include':_0x5c0302['include']?_[_0x4a1e('0x1f')](_0x5c0302[_0x4a1e('0x1d')],function(_0x3feeb8){return{'model':db[_0x3feeb8['model']],'as':_0x3feeb8['as'],'attributes':_0x3feeb8[_0x4a1e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4a1e('0xc')](function(_0x21145e){logger[_0x4a1e('0xd')](_0x4a1e('0x17'),_0x43b4f4);logger[_0x4a1e('0xf')]('GetCmHopperBlack',_0x43b4f4,JSON[_0x4a1e('0x20')](_0x21145e));_0x462212(_0x21145e);})[_0x4a1e('0x16')](function(_0x53e259){logger[_0x4a1e('0x11')]('GetCmHopperBlack',_0x53e259[_0x4a1e('0x13')],_0x43b4f4);_0x414b4b(_0x2e774c[_0x4a1e('0x11')](0x1f4,_0x53e259[_0x4a1e('0x13')]));});});};exports[_0x4a1e('0x21')]=function(_0x57cff7){var _0x1ed429=this;return new Promise(function(_0x184aae,_0x487dd6){return db['CmHopperBlack'][_0x4a1e('0x22')](_0x57cff7[_0x4a1e('0x23')],{'raw':_0x57cff7[_0x4a1e('0x18')]?_0x57cff7[_0x4a1e('0x18')][_0x4a1e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57cff7['options']?_0x57cff7[_0x4a1e('0x18')]['where']||null:null,'attributes':_0x57cff7[_0x4a1e('0x18')]?_0x57cff7[_0x4a1e('0x18')]['attributes']||null:null,'limit':_0x57cff7[_0x4a1e('0x18')]?_0x57cff7[_0x4a1e('0x18')][_0x4a1e('0x1c')]||null:null})[_0x4a1e('0xc')](function(_0x540d75){logger[_0x4a1e('0xd')](_0x4a1e('0x21'),_0x57cff7);logger[_0x4a1e('0xf')]('UpdateCmHopperBlack',_0x57cff7,JSON[_0x4a1e('0x20')](_0x540d75));_0x184aae(_0x540d75);})['catch'](function(_0x196d54){logger['error']('UpdateCmHopperBlack',_0x196d54[_0x4a1e('0x13')],_0x57cff7);_0x487dd6(_0x1ed429[_0x4a1e('0x11')](0x1f4,_0x196d54[_0x4a1e('0x13')]));});});};exports['DestroyCmHopperBlack']=function(_0x1fd604){var _0x2837ad=this;return new Promise(function(_0x5ac1cc,_0x4545be){return db['CmHopperBlack'][_0x4a1e('0x24')]({'where':_0x1fd604[_0x4a1e('0x18')]?_0x1fd604[_0x4a1e('0x18')][_0x4a1e('0x1a')]||null:null})['then'](function(_0x272043){logger['info'](_0x4a1e('0x25'),_0x1fd604);logger[_0x4a1e('0xf')](_0x4a1e('0x25'),_0x1fd604,JSON[_0x4a1e('0x20')](_0x272043));_0x5ac1cc(_0x272043);})['catch'](function(_0x56c60d){logger[_0x4a1e('0x11')](_0x4a1e('0x25'),_0x56c60d[_0x4a1e('0x13')],_0x1fd604);_0x4545be(_0x2837ad[_0x4a1e('0x11')](0x1f4,_0x56c60d[_0x4a1e('0x13')]));});});}; \ No newline at end of file +var _0xbccf=['../../config/utils','../../config/logger','../../config/environment','client','request','then','request\x20sent','debug','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','model','map','update','body','info','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x209340,_0x31aafe){var _0x5e5c7b=function(_0x410b3f){while(--_0x410b3f){_0x209340['push'](_0x209340['shift']());}};_0x5e5c7b(++_0x31aafe);}(_0xbccf,0x162));var _0xfbcc=function(_0xf31767,_0x381746){_0xf31767=_0xf31767-0x0;var _0x24bd0c=_0xbccf[_0xf31767];return _0x24bd0c;};'use strict';var _=require(_0xfbcc('0x0'));var util=require(_0xfbcc('0x1'));var moment=require(_0xfbcc('0x2'));var BPromise=require(_0xfbcc('0x3'));var rs=require(_0xfbcc('0x4'));var fs=require('fs');var Redis=require(_0xfbcc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbcc('0x6'));var logger=require(_0xfbcc('0x7'))('rpc');var config=require(_0xfbcc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfbcc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cd623,_0x1b8b6f,_0x267229){return new BPromise(function(_0x2016d4,_0x12a262){return client[_0xfbcc('0xa')](_0x1cd623,_0x267229)[_0xfbcc('0xb')](function(_0x4ae37f){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x1b8b6f,_0xfbcc('0xc'));logger[_0xfbcc('0xd')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x1b8b6f,_0xfbcc('0xc'),JSON[_0xfbcc('0xe')](_0x4ae37f));if(_0x4ae37f['error']){if(_0x4ae37f[_0xfbcc('0xf')][_0xfbcc('0x10')]===0x1f4){logger['error'](_0xfbcc('0x11'),_0x1b8b6f,_0x4ae37f[_0xfbcc('0xf')][_0xfbcc('0x12')]);return _0x12a262(_0x4ae37f[_0xfbcc('0xf')]['message']);}logger['error'](_0xfbcc('0x11'),_0x1b8b6f,_0x4ae37f[_0xfbcc('0xf')][_0xfbcc('0x12')]);return _0x2016d4(_0x4ae37f[_0xfbcc('0xf')]['message']);}else{logger['info'](_0xfbcc('0x11'),_0x1b8b6f,_0xfbcc('0xc'));_0x2016d4(_0x4ae37f[_0xfbcc('0x13')][_0xfbcc('0x12')]);}})[_0xfbcc('0x14')](function(_0x5667c9){logger[_0xfbcc('0xf')](_0xfbcc('0x11'),_0x1b8b6f,_0x5667c9);_0x12a262(_0x5667c9);});});}exports[_0xfbcc('0x15')]=function(_0x21b21f){var _0x14a079=this;return new Promise(function(_0x25b34f,_0x268e90){return db[_0xfbcc('0x16')]['findAll']({'raw':_0x21b21f[_0xfbcc('0x17')]?_0x21b21f[_0xfbcc('0x17')][_0xfbcc('0x18')]===undefined?!![]:![]:!![],'where':_0x21b21f[_0xfbcc('0x17')]?_0x21b21f[_0xfbcc('0x17')][_0xfbcc('0x19')]||null:null,'attributes':_0x21b21f['options']?_0x21b21f['options'][_0xfbcc('0x1a')]||null:null,'limit':_0x21b21f[_0xfbcc('0x17')]?_0x21b21f[_0xfbcc('0x17')][_0xfbcc('0x1b')]||null:null,'include':_0x21b21f[_0xfbcc('0x17')]?_0x21b21f[_0xfbcc('0x17')][_0xfbcc('0x1c')]?_['map'](_0x21b21f[_0xfbcc('0x17')][_0xfbcc('0x1c')],function(_0x5b5e79){return{'model':db[_0x5b5e79[_0xfbcc('0x1d')]],'as':_0x5b5e79['as'],'attributes':_0x5b5e79[_0xfbcc('0x1a')],'include':_0x5b5e79['include']?_['map'](_0x5b5e79[_0xfbcc('0x1c')],function(_0xdf5034){return{'model':db[_0xdf5034[_0xfbcc('0x1d')]],'as':_0xdf5034['as'],'attributes':_0xdf5034[_0xfbcc('0x1a')],'include':_0xdf5034[_0xfbcc('0x1c')]?_[_0xfbcc('0x1e')](_0xdf5034[_0xfbcc('0x1c')],function(_0x582053){return{'model':db[_0x582053['model']],'as':_0x582053['as'],'attributes':_0x582053[_0xfbcc('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45f9b0){logger['info'](_0xfbcc('0x15'),_0x21b21f);logger['debug']('GetCmHopperBlack',_0x21b21f,JSON[_0xfbcc('0xe')](_0x45f9b0));_0x25b34f(_0x45f9b0);})['catch'](function(_0x48ecbf){logger['error'](_0xfbcc('0x15'),_0x48ecbf[_0xfbcc('0x12')],_0x21b21f);_0x268e90(_0x14a079[_0xfbcc('0xf')](0x1f4,_0x48ecbf[_0xfbcc('0x12')]));});});};exports['UpdateCmHopperBlack']=function(_0x135378){var _0x1c20ff=this;return new Promise(function(_0x30338b,_0x19b37b){return db[_0xfbcc('0x16')][_0xfbcc('0x1f')](_0x135378[_0xfbcc('0x20')],{'raw':_0x135378[_0xfbcc('0x17')]?_0x135378['options'][_0xfbcc('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x135378['options']?_0x135378[_0xfbcc('0x17')]['where']||null:null,'attributes':_0x135378[_0xfbcc('0x17')]?_0x135378['options'][_0xfbcc('0x1a')]||null:null,'limit':_0x135378['options']?_0x135378[_0xfbcc('0x17')][_0xfbcc('0x1b')]||null:null})[_0xfbcc('0xb')](function(_0x23586a){logger[_0xfbcc('0x21')](_0xfbcc('0x22'),_0x135378);logger[_0xfbcc('0xd')]('UpdateCmHopperBlack',_0x135378,JSON[_0xfbcc('0xe')](_0x23586a));_0x30338b(_0x23586a);})[_0xfbcc('0x14')](function(_0x54a9e5){logger[_0xfbcc('0xf')]('UpdateCmHopperBlack',_0x54a9e5[_0xfbcc('0x12')],_0x135378);_0x19b37b(_0x1c20ff[_0xfbcc('0xf')](0x1f4,_0x54a9e5['message']));});});};exports[_0xfbcc('0x23')]=function(_0xf4fa2c){var _0x3bdd7f=this;return new Promise(function(_0x80349a,_0x124ef2){return db[_0xfbcc('0x16')]['destroy']({'where':_0xf4fa2c['options']?_0xf4fa2c['options'][_0xfbcc('0x19')]||null:null})[_0xfbcc('0xb')](function(_0x5910fe){logger[_0xfbcc('0x21')](_0xfbcc('0x23'),_0xf4fa2c);logger[_0xfbcc('0xd')](_0xfbcc('0x23'),_0xf4fa2c,JSON[_0xfbcc('0xe')](_0x5910fe));_0x80349a(_0x5910fe);})[_0xfbcc('0x14')](function(_0x192e97){logger['error'](_0xfbcc('0x23'),_0x192e97[_0xfbcc('0x12')],_0xf4fa2c);_0x124ef2(_0x3bdd7f['error'](0x1f4,_0x192e97[_0xfbcc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index ab174b7..dfa8070 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 _0x2a07=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x17d469,_0x5064ea){var _0x34dc00=function(_0xde7620){while(--_0xde7620){_0x17d469['push'](_0x17d469['shift']());}};_0x34dc00(++_0x5064ea);}(_0x2a07,0x74));var _0x72a0=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x2a07[_0x24259d];return _0x5a701;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var fs_extra=require(_0x72a0('0x5'));var auth=require(_0x72a0('0x6'));var interaction=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var controller=require(_0x72a0('0x9'));router[_0x72a0('0xa')]('/',auth[_0x72a0('0xb')](),controller[_0x72a0('0xc')]);router[_0x72a0('0xa')](_0x72a0('0xd'),auth[_0x72a0('0xb')](),controller[_0x72a0('0xe')]);router[_0x72a0('0xa')](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x10')]);router['put'](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller['update']);router[_0x72a0('0x11')](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x12')]);module[_0x72a0('0x13')]=router; \ No newline at end of file +var _0xed1c=['describe','/:id','show','put','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe'];(function(_0x2a9fbb,_0x131305){var _0x48d733=function(_0x2ce7a7){while(--_0x2ce7a7){_0x2a9fbb['push'](_0x2a9fbb['shift']());}};_0x48d733(++_0x131305);}(_0xed1c,0xe4));var _0xced1=function(_0x73a95a,_0x122b6f){_0x73a95a=_0x73a95a-0x0;var _0x3b2957=_0xed1c[_0x73a95a];return _0x3b2957;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xced1('0x2'));var auth=require(_0xced1('0x3'));var interaction=require(_0xced1('0x4'));var config=require('../../config/environment');var controller=require(_0xced1('0x5'));router[_0xced1('0x6')]('/',auth[_0xced1('0x7')](),controller[_0xced1('0x8')]);router['get'](_0xced1('0x9'),auth[_0xced1('0x7')](),controller[_0xced1('0xa')]);router[_0xced1('0x6')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0xc')]);router[_0xced1('0xd')]('/:id',auth[_0xced1('0x7')](),controller['update']);router[_0xced1('0xe')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0xf')]);module[_0xced1('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 658ac87..7b21c5c 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 _0x41f3=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE','getDataValue','endtime','followuptime','diff','seconds'];(function(_0x1a36c6,_0x570912){var _0x370b04=function(_0x21192d){while(--_0x21192d){_0x1a36c6['push'](_0x1a36c6['shift']());}};_0x370b04(++_0x570912);}(_0x41f3,0x182));var _0x341f=function(_0x353226,_0x4084cd){_0x353226=_0x353226-0x0;var _0x4d6621=_0x41f3[_0x353226];return _0x4d6621;};'use strict';var Sequelize=require(_0x341f('0x0'));var moment=require('moment');module[_0x341f('0x1')]={'state':{'type':Sequelize[_0x341f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x341f('0x3')]},'scheduledat':{'type':Sequelize[_0x341f('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x341f('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x341f('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x341f('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x341f('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x341f('0x3')]},'originatecalleridname':{'type':Sequelize[_0x341f('0x3')]},'calleridnum':{'type':Sequelize[_0x341f('0x3')]},'calleridname':{'type':Sequelize[_0x341f('0x3')]},'starttime':{'type':Sequelize[_0x341f('0x4')]},'responsetime':{'type':Sequelize[_0x341f('0x4')]},'answertime':{'type':Sequelize[_0x341f('0x4')]},'droptime':{'type':Sequelize[_0x341f('0x4')]},'endtime':{'type':Sequelize[_0x341f('0x4')]},'ringtime':{'type':Sequelize[_0x341f('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x341f('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x341f('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x341f('0x3')]},'campaign':{'type':Sequelize[_0x341f('0x3')]},'campaigntype':{'type':Sequelize[_0x341f('0x3')]},'membername':{'type':Sequelize[_0x341f('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x341f('0x3')]},'secondDisposition':{'type':Sequelize[_0x341f('0x3')]},'thirdDisposition':{'type':Sequelize[_0x341f('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x46291f){var _0x2db2ec=this[_0x341f('0x5')](_0x341f('0x6'));if(_0x2db2ec&&_0x46291f){this['setDataValue'](_0x341f('0x7'),moment(_0x46291f)[_0x341f('0x8')](moment(_0x2db2ec),_0x341f('0x9')));}return this['setDataValue']('dispositionat',_0x46291f);}},'amd':{'type':Sequelize[_0x341f('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x341f('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x341f('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x341f('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x341f('0x4')]},'deleted':{'type':Sequelize[_0x341f('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x341f('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x341f('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x341f('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x341f('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x341f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb792=['seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','endtime','setDataValue','followuptime','diff'];(function(_0x2d70ba,_0x3ea95c){var _0x217b6c=function(_0x44275e){while(--_0x44275e){_0x2d70ba['push'](_0x2d70ba['shift']());}};_0x217b6c(++_0x3ea95c);}(_0xb792,0x78));var _0x2b79=function(_0x87b30c,_0x9e83f6){_0x87b30c=_0x87b30c-0x0;var _0x31019a=_0xb792[_0x87b30c];return _0x31019a;};'use strict';var Sequelize=require(_0x2b79('0x0'));var moment=require(_0x2b79('0x1'));module[_0x2b79('0x2')]={'state':{'type':Sequelize[_0x2b79('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x2b79('0x4')]},'scheduledat':{'type':Sequelize[_0x2b79('0x5')]},'countbusyretry':{'type':Sequelize[_0x2b79('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2b79('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2b79('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x2b79('0x4')]},'originatecalleridname':{'type':Sequelize[_0x2b79('0x4')]},'calleridnum':{'type':Sequelize[_0x2b79('0x4')]},'calleridname':{'type':Sequelize[_0x2b79('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x2b79('0x5')]},'answertime':{'type':Sequelize[_0x2b79('0x5')]},'droptime':{'type':Sequelize[_0x2b79('0x5')]},'endtime':{'type':Sequelize[_0x2b79('0x5')]},'ringtime':{'type':Sequelize[_0x2b79('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2b79('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2b79('0x4')]},'campaign':{'type':Sequelize[_0x2b79('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x2b79('0x4')]},'reason':{'type':Sequelize[_0x2b79('0x4')]},'disposition':{'type':Sequelize[_0x2b79('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2b79('0x4')]},'dispositionat':{'type':Sequelize[_0x2b79('0x5')],'set':function(_0x290841){var _0x55335e=this['getDataValue'](_0x2b79('0x6'));if(_0x55335e&&_0x290841){this[_0x2b79('0x7')](_0x2b79('0x8'),moment(_0x290841)[_0x2b79('0x9')](moment(_0x55335e),_0x2b79('0xa')));}return this[_0x2b79('0x7')](_0x2b79('0xb'),_0x290841);}},'amd':{'type':Sequelize[_0x2b79('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x2b79('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x2b79('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2b79('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x2b79('0x5')]},'callback':{'type':Sequelize[_0x2b79('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2b79('0x5')]},'deleted':{'type':Sequelize[_0x2b79('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2b79('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x2b79('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2b79('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2b79('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2b79('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index a0954b1..68eb577 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 _0x71ab=['json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','CmHopperFinal','findAll','rows','catch','show','params','rawAttributes','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','dropContacts','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','state','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x4e3048,_0x320b59){var _0x2654f3=function(_0x1fb4a1){while(--_0x1fb4a1){_0x4e3048['push'](_0x4e3048['shift']());}};_0x2654f3(++_0x320b59);}(_0x71ab,0x64));var _0xb71a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x71ab[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];function respondWithStatusCode(_0x50030d,_0x50b43b){_0x50b43b=_0x50b43b||0xcc;return function(_0x3346a5){if(_0x3346a5){return _0x50030d[_0xb71a('0x19')](_0x50b43b);}return _0x50030d[_0xb71a('0x1a')](_0x50b43b)[_0xb71a('0x1b')]();};}function respondWithResult(_0x483d77,_0x47ee48){_0x47ee48=_0x47ee48||0xc8;return function(_0x5364e3){if(_0x5364e3){return _0x483d77[_0xb71a('0x1a')](_0x47ee48)[_0xb71a('0x1c')](_0x5364e3);}};}function respondWithFilteredResult(_0x15252a,_0x42fc55){return function(_0x3cd0f0){if(_0x3cd0f0){var _0x1e9363=typeof _0x42fc55[_0xb71a('0x1d')]===_0xb71a('0x1e')&&typeof _0x42fc55[_0xb71a('0x1f')]==='undefined';var _0x1ca65e=_0x3cd0f0[_0xb71a('0x20')];var _0x374c8c=_0x1e9363?0x0:_0x42fc55[_0xb71a('0x1d')];var _0x2bdb61=_0x1e9363?_0x3cd0f0[_0xb71a('0x20')]:_0x42fc55[_0xb71a('0x1d')]+_0x42fc55[_0xb71a('0x1f')];var _0x20bdfe;if(_0x2bdb61>=_0x1ca65e){_0x2bdb61=_0x1ca65e;_0x20bdfe=0xc8;}else{_0x20bdfe=0xce;}_0x15252a[_0xb71a('0x1a')](_0x20bdfe);return _0x15252a[_0xb71a('0x21')]('Content-Range',_0x374c8c+'-'+_0x2bdb61+'/'+_0x1ca65e)['json'](_0x3cd0f0);}return null;};}function patchUpdates(_0x1358f2){return function(_0x578fe4){try{jsonpatch['apply'](_0x578fe4,_0x1358f2,!![]);}catch(_0x4d8871){return BPromise[_0xb71a('0x22')](_0x4d8871);}return _0x578fe4['save']();};}function saveUpdates(_0x76d6dc,_0x4227c7){return function(_0x3ac77b){if(_0x3ac77b){return _0x3ac77b[_0xb71a('0x23')](_0x76d6dc)[_0xb71a('0x24')](function(_0x14b2a1){return _0x14b2a1;});}return null;};}function removeEntity(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(_0x5f3f19){return _0x5f3f19[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){_0x2f4fac[_0xb71a('0x1a')](0xcc)[_0xb71a('0x1b')]();});}};}function handleEntityNotFound(_0x3401f7,_0x1a010d){return function(_0x20ed75){if(!_0x20ed75){_0x3401f7[_0xb71a('0x19')](0x194);}return _0x20ed75;};}function handleError(_0x31085b,_0x2a847a){_0x2a847a=_0x2a847a||0x1f4;return function(_0x45b849){logger[_0xb71a('0x26')](_0x45b849[_0xb71a('0x27')]);if(_0x45b849['name']){delete _0x45b849[_0xb71a('0x28')];}_0x31085b[_0xb71a('0x1a')](_0x2a847a)[_0xb71a('0x29')](_0x45b849);};}exports[_0xb71a('0x2a')]=function(_0x2fbd73,_0x38178c){var _0x44826e={},_0x25364c={},_0x42c086={'count':0x0,'rows':[]};var _0x421fcf=_[_0xb71a('0x2b')](db['CmHopperFinal']['rawAttributes'],function(_0x3112d3){return{'name':_0x3112d3['fieldName'],'type':_0x3112d3[_0xb71a('0x2c')][_0xb71a('0x2d')]};});_0x25364c['model']=_[_0xb71a('0x2b')](_0x421fcf,_0xb71a('0x28'));_0x25364c[_0xb71a('0x2e')]=_[_0xb71a('0x2f')](_0x2fbd73[_0xb71a('0x2e')]);_0x25364c[_0xb71a('0x30')]=_['intersection'](_0x25364c[_0xb71a('0x31')],_0x25364c[_0xb71a('0x2e')]);_0x44826e[_0xb71a('0x32')]=_[_0xb71a('0x33')](_0x25364c['model'],qs[_0xb71a('0x34')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x34')]));_0x44826e[_0xb71a('0x32')]=_0x44826e[_0xb71a('0x32')][_0xb71a('0x35')]?_0x44826e[_0xb71a('0x32')]:_0x25364c[_0xb71a('0x31')];if(!_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x36')]('nolimit')){_0x44826e['limit']=qs[_0xb71a('0x1f')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1f')]);_0x44826e[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1d')]);}_0x44826e['order']=qs[_0xb71a('0x37')](_0x2fbd73['query'][_0xb71a('0x37')]);_0x44826e[_0xb71a('0x38')]=qs[_0xb71a('0x30')](_[_0xb71a('0x39')](_0x2fbd73['query'],_0x25364c[_0xb71a('0x30')]),_0x421fcf);if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]){_0x44826e[_0xb71a('0x38')]=_[_0xb71a('0x3b')](_0x44826e[_0xb71a('0x38')],{'$or':_[_0xb71a('0x2b')](_0x421fcf,function(_0x2756b9){if(_0x2756b9[_0xb71a('0x2c')]!=='VIRTUAL'){var _0x24a3af={};_0x24a3af[_0x2756b9['name']]={'$like':'%'+_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]+'%'};return _0x24a3af;}})});}_0x44826e=_[_0xb71a('0x3b')]({},_0x44826e,_0x2fbd73[_0xb71a('0x3c')]);var _0xce7b8a={'where':_0x44826e[_0xb71a('0x38')]};return db['CmHopperFinal']['count'](_0xce7b8a)['then'](function(_0x35fea9){_0x42c086['count']=_0x35fea9;if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x44826e[_0xb71a('0x3e')]=[{'all':!![]}];}return db[_0xb71a('0x3f')][_0xb71a('0x40')](_0x44826e);})[_0xb71a('0x24')](function(_0x59530a){_0x42c086[_0xb71a('0x41')]=_0x59530a;return _0x42c086;})[_0xb71a('0x24')](respondWithFilteredResult(_0x38178c,_0x44826e))[_0xb71a('0x42')](handleError(_0x38178c,null));};exports[_0xb71a('0x43')]=function(_0x7d305,_0x2f08d2){var _0x55cbca={'raw':!![],'where':{'id':_0x7d305[_0xb71a('0x44')]['id']}},_0x2afff3={};_0x2afff3[_0xb71a('0x31')]=_[_0xb71a('0x2f')](db[_0xb71a('0x3f')][_0xb71a('0x45')]);_0x2afff3[_0xb71a('0x2e')]=_['keys'](_0x7d305['query']);_0x2afff3[_0xb71a('0x30')]=_[_0xb71a('0x33')](_0x2afff3[_0xb71a('0x31')],_0x2afff3[_0xb71a('0x2e')]);_0x55cbca['attributes']=_[_0xb71a('0x33')](_0x2afff3['model'],qs[_0xb71a('0x34')](_0x7d305[_0xb71a('0x2e')]['fields']));_0x55cbca[_0xb71a('0x32')]=_0x55cbca[_0xb71a('0x32')][_0xb71a('0x35')]?_0x55cbca[_0xb71a('0x32')]:_0x2afff3['model'];if(_0x7d305[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x55cbca[_0xb71a('0x3e')]=[{'all':!![]}];}_0x55cbca=_['merge']({},_0x55cbca,_0x7d305[_0xb71a('0x3c')]);return db[_0xb71a('0x3f')][_0xb71a('0x46')](_0x55cbca)['then'](handleEntityNotFound(_0x2f08d2,null))[_0xb71a('0x24')](respondWithResult(_0x2f08d2,null))[_0xb71a('0x42')](handleError(_0x2f08d2,null));};exports[_0xb71a('0x47')]=function(_0x1f29b7,_0x365bed){return db['CmHopperFinal'][_0xb71a('0x47')]()[_0xb71a('0x24')](respondWithResult(_0x365bed,null))[_0xb71a('0x42')](handleError(_0x365bed,null));};exports[_0xb71a('0x23')]=function(_0x489c1f,_0x48fbde){if(_0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')]){delete _0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')];}return db[_0xb71a('0x3f')][_0xb71a('0x46')]({'where':{'uniqueid':_0x489c1f[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x48fbde,null))[_0xb71a('0x24')](saveUpdates(_0x489c1f[_0xb71a('0x48')],null))['then'](respondWithResult(_0x48fbde,null))[_0xb71a('0x42')](handleError(_0x48fbde,null));};exports[_0xb71a('0x4a')]=function(_0x500196,_0x1c0536,_0x58116c){return db[_0xb71a('0x3f')][_0xb71a('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x500196[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x54')))),'dropContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x55')))),_0xb71a('0x56')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x59')))),_0xb71a('0x5a')]]})['then'](handleEntityNotFound(_0x1c0536,null))[_0xb71a('0x24')](respondWithResult(_0x1c0536,null))[_0xb71a('0x42')](handleError(_0x1c0536,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x181a9f,_0xe55672,_0x38de3a){return db[_0xb71a('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x181a9f[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x5b')))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb71a('0x5c')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x55')))),'abandonedContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x59')))),_0xb71a('0x5a')]]})[_0xb71a('0x24')](handleEntityNotFound(_0xe55672,null))[_0xb71a('0x24')](respondWithResult(_0xe55672,null))['catch'](handleError(_0xe55672,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x15b8be,_0x2dd470,_0x38a8a1){return db[_0xb71a('0x5d')][_0xb71a('0x46')]({'where':{'id':_0x15b8be[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x2dd470,null))['then'](function(_0x45f4b2){var _0x27c15e;if(_0x45f4b2){_0x27c15e=squel['insert']()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),_0xb71a('0x63'),'VoiceQueueId',_0xb71a('0x64'),_0xb71a('0x65')],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),_0xb71a('0x69'))[_0xb71a('0x67')](_0xb71a('0x6a'),'scheduledAt')[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))[_0xb71a('0x67')]('ANY_VALUE(VoiceQueueId)',_0xb71a('0x6d'))['field'](_0xb71a('0x6a'),_0xb71a('0x64'))['field'](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x15b8be[_0xb71a('0x48')]['state'][_0xb71a('0x70')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')]('VoiceQueueId\x20=\x20?',_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel[_0xb71a('0x66')]()[_0xb71a('0x67')]('calleridnum')[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))[_0xb71a('0x70')]();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x27c15e);}return[];})['then'](respondWithResult(_0x2dd470,null))[_0xb71a('0x42')](handleError(_0x2dd470,null));};exports[_0xb71a('0x76')]=function(_0x28bc74,_0x575a0a,_0x1a658e){return db[_0xb71a('0x77')]['find']({'where':{'id':_0x28bc74[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x575a0a,null))[_0xb71a('0x24')](function(_0x21b9b5){var _0x4abfd6;if(_0x21b9b5){_0x4abfd6=squel[_0xb71a('0x78')]()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),'ListId',_0xb71a('0x79'),_0xb71a('0x64'),'updatedAt'],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),'phone')[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x61'))[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))['field']('ANY_VALUE(CampaignId)',_0xb71a('0x79'))[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x64'))[_0xb71a('0x67')](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x28bc74[_0xb71a('0x48')][_0xb71a('0x7a')][_0xb71a('0x70')]())[_0xb71a('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')](_0xb71a('0x7b'),_0x28bc74['params']['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x7c'))[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id']['toString']())[_0xb71a('0x38')](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))['toString']();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x4abfd6);}return[];})[_0xb71a('0x24')](respondWithResult(_0x575a0a,null))[_0xb71a('0x42')](handleError(_0x575a0a,null));};exports[_0xb71a('0x7d')]=function(_0x18dfb3,_0x38ffc1,_0x442ec0){return db[_0xb71a('0x7e')][_0xb71a('0x7f')]({'where':{'VoiceQueueId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x6d')],'CampaignId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x79')],'ContactId':_0x18dfb3[_0xb71a('0x48')]['ContactId']}})[_0xb71a('0x24')](handleEntityNotFound(_0x38ffc1,null))[_0xb71a('0x24')](function(_0x243c90){if(_0x243c90){return _0x243c90;}return null;})['then'](respondWithResult(_0x38ffc1,null))['catch'](handleError(_0x38ffc1,null));}; \ No newline at end of file +var _0x5d58=['calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','CmHopperFinal','include','findAll','rows','show','params','rawAttributes','keys','length','includeAll','merge','describe','catch','body','find','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)'];(function(_0xe6aba1,_0x4ff2b4){var _0x56482c=function(_0x130be4){while(--_0x130be4){_0xe6aba1['push'](_0xe6aba1['shift']());}};_0x56482c(++_0x4ff2b4);}(_0x5d58,0x187));var _0x85d5=function(_0x1b4cf6,_0xcb3c1b){_0x1b4cf6=_0x1b4cf6-0x0;var _0x418c74=_0x5d58[_0x1b4cf6];return _0x418c74;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x85d5('0x0'));var BPromise=require(_0x85d5('0x1'));var Mustache=require('mustache');var util=require(_0x85d5('0x2'));var path=require(_0x85d5('0x3'));var sox=require('sox');var csv=require(_0x85d5('0x4'));var ejs=require(_0x85d5('0x5'));var fs=require('fs');var fs_extra=require(_0x85d5('0x6'));var _=require(_0x85d5('0x7'));var squel=require('squel');var crypto=require(_0x85d5('0x8'));var jsforce=require(_0x85d5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x85d5('0x4'));var querystring=require('querystring');var Papa=require(_0x85d5('0xa'));var Redis=require(_0x85d5('0xb'));var authService=require(_0x85d5('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85d5('0xd'))(_0x85d5('0xe'));var utils=require(_0x85d5('0xf'));var config=require(_0x85d5('0x10'));var licenseUtil=require(_0x85d5('0x11'));var db=require(_0x85d5('0x12'))['db'];function respondWithStatusCode(_0x31409d,_0x5897af){_0x5897af=_0x5897af||0xcc;return function(_0x4bbf2a){if(_0x4bbf2a){return _0x31409d['sendStatus'](_0x5897af);}return _0x31409d[_0x85d5('0x13')](_0x5897af)[_0x85d5('0x14')]();};}function respondWithResult(_0x339d4f,_0x1704f0){_0x1704f0=_0x1704f0||0xc8;return function(_0x18a20c){if(_0x18a20c){return _0x339d4f[_0x85d5('0x13')](_0x1704f0)[_0x85d5('0x15')](_0x18a20c);}};}function respondWithFilteredResult(_0x586382,_0x18e977){return function(_0x2d7c95){if(_0x2d7c95){var _0x1621ed=typeof _0x18e977[_0x85d5('0x16')]===_0x85d5('0x17')&&typeof _0x18e977[_0x85d5('0x18')]===_0x85d5('0x17');var _0x12bef9=_0x2d7c95[_0x85d5('0x19')];var _0x17acb0=_0x1621ed?0x0:_0x18e977[_0x85d5('0x16')];var _0x432bd6=_0x1621ed?_0x2d7c95[_0x85d5('0x19')]:_0x18e977[_0x85d5('0x16')]+_0x18e977[_0x85d5('0x18')];var _0x26981b;if(_0x432bd6>=_0x12bef9){_0x432bd6=_0x12bef9;_0x26981b=0xc8;}else{_0x26981b=0xce;}_0x586382[_0x85d5('0x13')](_0x26981b);return _0x586382[_0x85d5('0x1a')]('Content-Range',_0x17acb0+'-'+_0x432bd6+'/'+_0x12bef9)[_0x85d5('0x15')](_0x2d7c95);}return null;};}function patchUpdates(_0x133fa9){return function(_0x5f5755){try{jsonpatch[_0x85d5('0x1b')](_0x5f5755,_0x133fa9,!![]);}catch(_0x1264ca){return BPromise['reject'](_0x1264ca);}return _0x5f5755['save']();};}function saveUpdates(_0x347337,_0x5a1b9a){return function(_0x2f2bae){if(_0x2f2bae){return _0x2f2bae['update'](_0x347337)[_0x85d5('0x1c')](function(_0x1f8d27){return _0x1f8d27;});}return null;};}function removeEntity(_0x560b3a,_0x4e11c4){return function(_0x4da71b){if(_0x4da71b){return _0x4da71b['destroy']()[_0x85d5('0x1c')](function(){_0x560b3a[_0x85d5('0x13')](0xcc)[_0x85d5('0x14')]();});}};}function handleEntityNotFound(_0x466bbd,_0x12fea3){return function(_0xef2405){if(!_0xef2405){_0x466bbd['sendStatus'](0x194);}return _0xef2405;};}function handleError(_0x7e9a11,_0x4f8c66){_0x4f8c66=_0x4f8c66||0x1f4;return function(_0x1b3fae){logger[_0x85d5('0x1d')](_0x1b3fae[_0x85d5('0x1e')]);if(_0x1b3fae['name']){delete _0x1b3fae[_0x85d5('0x1f')];}_0x7e9a11[_0x85d5('0x13')](_0x4f8c66)[_0x85d5('0x20')](_0x1b3fae);};}exports[_0x85d5('0x21')]=function(_0x4605c5,_0x56031f){var _0x1cbef1={},_0x476c8b={},_0x330f8a={'count':0x0,'rows':[]};var _0x22a961=_[_0x85d5('0x22')](db['CmHopperFinal']['rawAttributes'],function(_0x2ce7a9){return{'name':_0x2ce7a9[_0x85d5('0x23')],'type':_0x2ce7a9[_0x85d5('0x24')][_0x85d5('0x25')]};});_0x476c8b[_0x85d5('0x26')]=_['map'](_0x22a961,_0x85d5('0x1f'));_0x476c8b[_0x85d5('0x27')]=_['keys'](_0x4605c5['query']);_0x476c8b[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x476c8b['model'],_0x476c8b[_0x85d5('0x27')]);_0x1cbef1['attributes']=_[_0x85d5('0x29')](_0x476c8b[_0x85d5('0x26')],qs['fields'](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x1cbef1[_0x85d5('0x2b')]=_0x1cbef1[_0x85d5('0x2b')]['length']?_0x1cbef1['attributes']:_0x476c8b[_0x85d5('0x26')];if(!_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2c')](_0x85d5('0x2d'))){_0x1cbef1[_0x85d5('0x18')]=qs[_0x85d5('0x18')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x18')]);_0x1cbef1[_0x85d5('0x16')]=qs['offset'](_0x4605c5['query'][_0x85d5('0x16')]);}_0x1cbef1[_0x85d5('0x2e')]=qs[_0x85d5('0x2f')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2f')]);_0x1cbef1[_0x85d5('0x30')]=qs[_0x85d5('0x28')](_[_0x85d5('0x31')](_0x4605c5['query'],_0x476c8b[_0x85d5('0x28')]),_0x22a961);if(_0x4605c5[_0x85d5('0x27')][_0x85d5('0x32')]){_0x1cbef1[_0x85d5('0x30')]=_['merge'](_0x1cbef1[_0x85d5('0x30')],{'$or':_[_0x85d5('0x22')](_0x22a961,function(_0x3282d3){if(_0x3282d3[_0x85d5('0x24')]!=='VIRTUAL'){var _0x34caed={};_0x34caed[_0x3282d3['name']]={'$like':'%'+_0x4605c5['query'][_0x85d5('0x32')]+'%'};return _0x34caed;}})});}_0x1cbef1=_['merge']({},_0x1cbef1,_0x4605c5[_0x85d5('0x33')]);var _0x5ddba7={'where':_0x1cbef1['where']};return db[_0x85d5('0x34')][_0x85d5('0x19')](_0x5ddba7)[_0x85d5('0x1c')](function(_0x1beffc){_0x330f8a[_0x85d5('0x19')]=_0x1beffc;if(_0x4605c5['query']['includeAll']){_0x1cbef1[_0x85d5('0x35')]=[{'all':!![]}];}return db[_0x85d5('0x34')][_0x85d5('0x36')](_0x1cbef1);})[_0x85d5('0x1c')](function(_0xdd8b3e){_0x330f8a[_0x85d5('0x37')]=_0xdd8b3e;return _0x330f8a;})['then'](respondWithFilteredResult(_0x56031f,_0x1cbef1))['catch'](handleError(_0x56031f,null));};exports[_0x85d5('0x38')]=function(_0x52c99b,_0xfbf466){var _0x18e94d={'raw':!![],'where':{'id':_0x52c99b[_0x85d5('0x39')]['id']}},_0x7dd430={};_0x7dd430[_0x85d5('0x26')]=_['keys'](db['CmHopperFinal'][_0x85d5('0x3a')]);_0x7dd430[_0x85d5('0x27')]=_[_0x85d5('0x3b')](_0x52c99b[_0x85d5('0x27')]);_0x7dd430[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],_0x7dd430[_0x85d5('0x27')]);_0x18e94d[_0x85d5('0x2b')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],qs[_0x85d5('0x2a')](_0x52c99b[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x18e94d[_0x85d5('0x2b')]=_0x18e94d[_0x85d5('0x2b')][_0x85d5('0x3c')]?_0x18e94d['attributes']:_0x7dd430['model'];if(_0x52c99b[_0x85d5('0x27')][_0x85d5('0x3d')]){_0x18e94d[_0x85d5('0x35')]=[{'all':!![]}];}_0x18e94d=_[_0x85d5('0x3e')]({},_0x18e94d,_0x52c99b[_0x85d5('0x33')]);return db[_0x85d5('0x34')]['find'](_0x18e94d)[_0x85d5('0x1c')](handleEntityNotFound(_0xfbf466,null))['then'](respondWithResult(_0xfbf466,null))['catch'](handleError(_0xfbf466,null));};exports[_0x85d5('0x3f')]=function(_0x13ab32,_0x12a03){return db[_0x85d5('0x34')][_0x85d5('0x3f')]()['then'](respondWithResult(_0x12a03,null))[_0x85d5('0x40')](handleError(_0x12a03,null));};exports['update']=function(_0x1f2ef9,_0xd8db57){if(_0x1f2ef9[_0x85d5('0x41')]['uniqueid']){delete _0x1f2ef9['body']['uniqueid'];}return db[_0x85d5('0x34')][_0x85d5('0x42')]({'where':{'uniqueid':_0x1f2ef9[_0x85d5('0x39')]['id']}})['then'](handleEntityNotFound(_0xd8db57,null))['then'](saveUpdates(_0x1f2ef9[_0x85d5('0x41')],null))[_0x85d5('0x1c')](respondWithResult(_0xd8db57,null))[_0x85d5('0x40')](handleError(_0xd8db57,null));};exports[_0x85d5('0x43')]=function(_0x4b2dce,_0x3f69ea,_0x29442a){return db[_0x85d5('0x34')][_0x85d5('0x36')]({'raw':![],'where':{'VoiceQueueId':_0x4b2dce[_0x85d5('0x39')]['id']},'attributes':[[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x47')))),_0x85d5('0x48')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x49')))),_0x85d5('0x4a')],[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x4b')))),_0x85d5('0x4c')],[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x85d5('0x4d')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x85d5('0x4e')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x4f')))),_0x85d5('0x50')],[db['sequelize']['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')]('`state`\x20=\x2022,\x201,\x20null'))),_0x85d5('0x51')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x52')))),_0x85d5('0x53')]]})['then'](handleEntityNotFound(_0x3f69ea,null))[_0x85d5('0x1c')](respondWithResult(_0x3f69ea,null))[_0x85d5('0x40')](handleError(_0x3f69ea,null));};exports[_0x85d5('0x54')]=function(_0x561bde,_0x34aa42,_0x1c3e2c){return db['CmHopperFinal'][_0x85d5('0x36')]({'raw':![],'where':{'CampaignId':_0x561bde['params']['id']},'attributes':[[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x47')))),'noSuchContacts'],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x49')))),_0x85d5('0x4a')],[db[_0x85d5('0x44')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x85d5('0x44')]['literal'](_0x85d5('0x4b')))),_0x85d5('0x4c')],[db['sequelize']['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')]('`state`\x20=\x208,\x201,\x20null'))),_0x85d5('0x4d')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize']['literal'](_0x85d5('0x55')))),'dropContacts'],[db['sequelize']['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x85d5('0x50')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db['sequelize']['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x56')))),_0x85d5('0x51')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x85d5('0x53')]]})[_0x85d5('0x1c')](handleEntityNotFound(_0x34aa42,null))[_0x85d5('0x1c')](respondWithResult(_0x34aa42,null))['catch'](handleError(_0x34aa42,null));};exports[_0x85d5('0x57')]=function(_0x1fdefb,_0x496586,_0x2dbd18){return db[_0x85d5('0x58')][_0x85d5('0x42')]({'where':{'id':_0x1fdefb[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x496586,null))['then'](function(_0x35ba15){var _0x1b96eb;if(_0x35ba15){_0x1b96eb=squel[_0x85d5('0x59')]()[_0x85d5('0x5a')](_0x85d5('0x5b'))['fromQuery']([_0x85d5('0x5c'),_0x85d5('0x5d'),_0x85d5('0x5e'),_0x85d5('0x5f'),_0x85d5('0x60'),_0x85d5('0x61'),_0x85d5('0x62')],squel[_0x85d5('0x63')]()[_0x85d5('0x64')](_0x85d5('0x65'),'phone')[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x5d'))[_0x85d5('0x64')](_0x85d5('0x67'),_0x85d5('0x5e'))['field'](_0x85d5('0x68'),'ListId')['field'](_0x85d5('0x69'),_0x85d5('0x60'))[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x61'))[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x62'))[_0x85d5('0x6a')]('cm_hopper_final')[_0x85d5('0x30')](_0x85d5('0x6b'),_0x1fdefb[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6d'),_0x1fdefb[_0x85d5('0x41')][_0x85d5('0x6e')][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6f'))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')]('phone')['from'](_0x85d5('0x5b'))['where'](_0x85d5('0x6b'),_0x1fdefb[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]()))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')](_0x85d5('0x71'))[_0x85d5('0x6a')]('cm_hopper_final')[_0x85d5('0x30')](_0x85d5('0x6b'),_0x1fdefb['params']['id'][_0x85d5('0x6c')]())['where'](_0x85d5('0x72')))[_0x85d5('0x73')](_0x85d5('0x5e')))[_0x85d5('0x6c')]();return db['sequelize'][_0x85d5('0x27')](_0x1b96eb);}return[];})[_0x85d5('0x1c')](respondWithResult(_0x496586,null))['catch'](handleError(_0x496586,null));};exports[_0x85d5('0x74')]=function(_0x14e4e8,_0x57f26b,_0x45b1e2){return db[_0x85d5('0x75')][_0x85d5('0x42')]({'where':{'id':_0x14e4e8['params']['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x57f26b,null))[_0x85d5('0x1c')](function(_0x2dacf7){var _0x387a3b;if(_0x2dacf7){_0x387a3b=squel[_0x85d5('0x59')]()[_0x85d5('0x5a')]('cm_hopper')[_0x85d5('0x76')]([_0x85d5('0x5c'),'scheduledAt',_0x85d5('0x5e'),'ListId',_0x85d5('0x77'),_0x85d5('0x61'),_0x85d5('0x62')],squel['select']()[_0x85d5('0x64')](_0x85d5('0x65'),_0x85d5('0x5c'))[_0x85d5('0x64')](_0x85d5('0x66'),'scheduledAt')[_0x85d5('0x64')](_0x85d5('0x67'),_0x85d5('0x5e'))[_0x85d5('0x64')]('ANY_VALUE(ListId)',_0x85d5('0x5f'))[_0x85d5('0x64')](_0x85d5('0x78'),'CampaignId')[_0x85d5('0x64')]('NOW()',_0x85d5('0x61'))[_0x85d5('0x64')]('NOW()','updatedAt')[_0x85d5('0x6a')](_0x85d5('0x79'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6d'),_0x14e4e8['body'][_0x85d5('0x6e')][_0x85d5('0x6c')]())[_0x85d5('0x30')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x85d5('0x30')](_0x85d5('0x70'),squel['select']()[_0x85d5('0x64')](_0x85d5('0x5c'))[_0x85d5('0x6a')](_0x85d5('0x5b'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id']['toString']()))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')]('calleridnum')[_0x85d5('0x6a')](_0x85d5('0x79'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id']['toString']())['where'](_0x85d5('0x72')))['group'](_0x85d5('0x5e')))[_0x85d5('0x6c')]();return db[_0x85d5('0x44')][_0x85d5('0x27')](_0x387a3b);}return[];})[_0x85d5('0x1c')](respondWithResult(_0x57f26b,null))[_0x85d5('0x40')](handleError(_0x57f26b,null));};exports[_0x85d5('0x7b')]=function(_0x48553d,_0xedb32d,_0x5366bc){return db[_0x85d5('0x7c')][_0x85d5('0x7d')]({'where':{'VoiceQueueId':_0x48553d[_0x85d5('0x41')]['VoiceQueueId'],'CampaignId':_0x48553d[_0x85d5('0x41')][_0x85d5('0x77')],'ContactId':_0x48553d[_0x85d5('0x41')]['ContactId']}})['then'](handleEntityNotFound(_0xedb32d,null))[_0x85d5('0x1c')](function(_0x428fd4){if(_0x428fd4){return _0x428fd4;}return null;})['then'](respondWithResult(_0xedb32d,null))[_0x85d5('0x40')](handleError(_0xedb32d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 0947c11..d025c05 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 _0xfe5a=['cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','define'];(function(_0x4b446a,_0x3afcd7){var _0x23fc8c=function(_0x17498f){while(--_0x17498f){_0x4b446a['push'](_0x4b446a['shift']());}};_0x23fc8c(++_0x3afcd7);}(_0xfe5a,0x148));var _0xafe5=function(_0x3bc870,_0x101afa){_0x3bc870=_0x3bc870-0x0;var _0x5690dd=_0xfe5a[_0x3bc870];return _0x5690dd;};'use strict';var _=require(_0xafe5('0x0'));var util=require(_0xafe5('0x1'));var logger=require(_0xafe5('0x2'))(_0xafe5('0x3'));var moment=require(_0xafe5('0x4'));var BPromise=require(_0xafe5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xafe5('0x6'));var rimraf=require(_0xafe5('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0xafe5('0x8')]=function(_0x18d3ac,_0x3ff7bb){return _0x18d3ac[_0xafe5('0x9')]('CmHopperFinal',attributes,{'tableName':_0xafe5('0xa'),'paranoid':![],'indexes':[{'name':_0xafe5('0xb'),'fields':[_0xafe5('0xb')]},{'name':_0xafe5('0xc'),'fields':[_0xafe5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c73=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','calleridnum','lodash','util'];(function(_0x5d5f03,_0x4d8cfc){var _0x4e1cb8=function(_0x1f84a){while(--_0x1f84a){_0x5d5f03['push'](_0x5d5f03['shift']());}};_0x4e1cb8(++_0x4d8cfc);}(_0x6c73,0x177));var _0x36c7=function(_0x530db1,_0x2b9531){_0x530db1=_0x530db1-0x0;var _0x31c1f2=_0x6c73[_0x530db1];return _0x31c1f2;};'use strict';var _=require(_0x36c7('0x0'));var util=require(_0x36c7('0x1'));var logger=require(_0x36c7('0x2'))(_0x36c7('0x3'));var moment=require(_0x36c7('0x4'));var BPromise=require(_0x36c7('0x5'));var rp=require(_0x36c7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x36c7('0x7'));var config=require(_0x36c7('0x8'));var attributes=require(_0x36c7('0x9'));module[_0x36c7('0xa')]=function(_0x57d958,_0x1a6fce){return _0x57d958[_0x36c7('0xb')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x36c7('0xc'),'fields':['calleridnum']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 5e207a4..2f0cbe5 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4708dd,_0x501afa){var _0x1ccf51=function(_0x5de102){while(--_0x5de102){_0x4708dd['push'](_0x4708dd['shift']());}};_0x1ccf51(++_0x501afa);}(_0x7a54,0x106));var _0x47a5=function(_0x43d299,_0x27513d){_0x43d299=_0x43d299-0x0;var _0x6f383b=_0x7a54[_0x43d299];return _0x6f383b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _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(_0x513710,_0x1c1e32){var _0x369347=function(_0x5d48da){while(--_0x5d48da){_0x513710['push'](_0x513710['shift']());}};_0x369347(++_0x1c1e32);}(_0xb10b,0x12a));var _0xbb10=function(_0x53286a,_0x485c92){_0x53286a=_0x53286a-0x0;var _0x5730ff=_0xb10b[_0x53286a];return _0x5730ff;};'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 4eba540..22d132a 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 _0x5d7b=['/:id','/campaign/countAttributes/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe'];(function(_0x1989b6,_0x36b9bb){var _0x39a8f9=function(_0x36bdd4){while(--_0x36bdd4){_0x1989b6['push'](_0x1989b6['shift']());}};_0x39a8f9(++_0x36b9bb);}(_0x5d7b,0xfb));var _0xb5d7=function(_0x22541c,_0x5e7c24){_0x22541c=_0x22541c-0x0;var _0x2c5667=_0x5d7b[_0x22541c];return _0x2c5667;};'use strict';var multer=require(_0xb5d7('0x0'));var util=require(_0xb5d7('0x1'));var path=require(_0xb5d7('0x2'));var timeout=require(_0xb5d7('0x3'));var express=require(_0xb5d7('0x4'));var router=express[_0xb5d7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb5d7('0x6'));var interaction=require(_0xb5d7('0x7'));var config=require(_0xb5d7('0x8'));var controller=require(_0xb5d7('0x9'));router[_0xb5d7('0xa')]('/',auth[_0xb5d7('0xb')](),controller['index']);router[_0xb5d7('0xa')]('/describe',auth[_0xb5d7('0xb')](),controller[_0xb5d7('0xc')]);router[_0xb5d7('0xa')](_0xb5d7('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xb5d7('0xa')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router[_0xb5d7('0xa')](_0xb5d7('0xe'),auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router['post']('/voice/queue/moveContacts/:id',auth[_0xb5d7('0xb')](),controller[_0xb5d7('0xf')]);router[_0xb5d7('0x10')](_0xb5d7('0x11'),auth['isAuthenticated'](),controller[_0xb5d7('0x12')]);router['post'](_0xb5d7('0x13'),auth['isAuthenticated'](),controller[_0xb5d7('0x14')]);router[_0xb5d7('0x15')](_0xb5d7('0xd'),auth[_0xb5d7('0xb')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x9025=['checkContactHopper','put','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','post'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x9025,0x17c));var _0x5902=function(_0x69a2a4,_0x391552){_0x69a2a4=_0x69a2a4-0x0;var _0x3496da=_0x9025[_0x69a2a4];return _0x3496da;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5902('0x0'));var express=require(_0x5902('0x1'));var router=express[_0x5902('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5902('0x3'));var interaction=require(_0x5902('0x4'));var config=require(_0x5902('0x5'));var controller=require(_0x5902('0x6'));router[_0x5902('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x5902('0x8')](),controller[_0x5902('0x9')]);router['get'](_0x5902('0xa'),auth[_0x5902('0x8')](),controller[_0x5902('0xb')]);router[_0x5902('0x7')](_0x5902('0xc'),auth['isAuthenticated'](),controller[_0x5902('0xd')]);router[_0x5902('0x7')](_0x5902('0xe'),auth[_0x5902('0x8')](),controller[_0x5902('0xf')]);router['post']('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller[_0x5902('0x10')]);router['post'](_0x5902('0x11'),auth[_0x5902('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x5902('0x12')]('/checkContactHopper',auth[_0x5902('0x8')](),controller[_0x5902('0x13')]);router[_0x5902('0x14')](_0x5902('0xa'),auth[_0x5902('0x8')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index c675a69..c1599b9 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 _0x379a=['INTEGER','STRING','DATE','BOOLEAN'];(function(_0x2b716b,_0x9001ae){var _0x4b4499=function(_0x3faaea){while(--_0x3faaea){_0x2b716b['push'](_0x2b716b['shift']());}};_0x4b4499(++_0x9001ae);}(_0x379a,0x1c4));var _0xa379=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x379a[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xa379('0x0')](0x2)},'statedesc':{'type':Sequelize[_0xa379('0x1')]},'scheduledat':{'type':Sequelize[_0xa379('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa379('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa379('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa379('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa379('0x1')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xa379('0x1')]},'calleridnum':{'type':Sequelize[_0xa379('0x1')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xa379('0x2')]},'responsetime':{'type':Sequelize[_0xa379('0x2')]},'answertime':{'type':Sequelize[_0xa379('0x2')]},'droptime':{'type':Sequelize[_0xa379('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xa379('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa379('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa379('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa379('0x1')]},'campaign':{'type':Sequelize[_0xa379('0x1')]},'campaigntype':{'type':Sequelize[_0xa379('0x1')]},'membername':{'type':Sequelize[_0xa379('0x1')]},'reason':{'type':Sequelize[_0xa379('0x1')]},'amd':{'type':Sequelize[_0xa379('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0xa379('0x3')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa379('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa379('0x2')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xa379('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa379('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa379('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa379('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7ff6=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x524d91,_0x5a1414){var _0x20ac79=function(_0x4abfe1){while(--_0x4abfe1){_0x524d91['push'](_0x524d91['shift']());}};_0x20ac79(++_0x5a1414);}(_0x7ff6,0xf9));var _0x67ff=function(_0x8c3071,_0x1b2f28){_0x8c3071=_0x8c3071-0x0;var _0x8f8dc7=_0x7ff6[_0x8c3071];return _0x8f8dc7;};'use strict';var Sequelize=require(_0x67ff('0x0'));module[_0x67ff('0x1')]={'state':{'type':Sequelize[_0x67ff('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x67ff('0x3')]},'scheduledat':{'type':Sequelize[_0x67ff('0x4')]},'countbusyretry':{'type':Sequelize[_0x67ff('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x67ff('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x67ff('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x67ff('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x67ff('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x67ff('0x3')]},'originatecalleridname':{'type':Sequelize[_0x67ff('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x67ff('0x3')]},'starttime':{'type':Sequelize[_0x67ff('0x4')]},'responsetime':{'type':Sequelize[_0x67ff('0x4')]},'answertime':{'type':Sequelize[_0x67ff('0x4')]},'droptime':{'type':Sequelize[_0x67ff('0x4')]},'endtime':{'type':Sequelize[_0x67ff('0x4')]},'ringtime':{'type':Sequelize[_0x67ff('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x67ff('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x67ff('0x3')]},'campaigntype':{'type':Sequelize[_0x67ff('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x67ff('0x3')]},'amd':{'type':Sequelize[_0x67ff('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x67ff('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x67ff('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x67ff('0x4')]},'recallme':{'type':Sequelize[_0x67ff('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x67ff('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x67ff('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x67ff('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x67ff('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index b5ccce3..d93ea92 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 _0x1f18=['crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','end','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body','describe','uniqueid','moment','mustache','util','path','sox','lodash','squel'];(function(_0x147f47,_0x37b0cf){var _0x47d5e6=function(_0x2162c3){while(--_0x2162c3){_0x147f47['push'](_0x147f47['shift']());}};_0x47d5e6(++_0x37b0cf);}(_0x1f18,0xcb));var _0x81f1=function(_0x5c0151,_0x27c535){_0x5c0151=_0x5c0151-0x0;var _0xe114d8=_0x1f18[_0x5c0151];return _0xe114d8;};'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(_0x81f1('0x0'));var BPromise=require('bluebird');var Mustache=require(_0x81f1('0x1'));var util=require(_0x81f1('0x2'));var path=require(_0x81f1('0x3'));var sox=require(_0x81f1('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x81f1('0x5'));var squel=require(_0x81f1('0x6'));var crypto=require(_0x81f1('0x7'));var jsforce=require(_0x81f1('0x8'));var deskjs=require(_0x81f1('0x9'));var toCsv=require('to-csv');var querystring=require(_0x81f1('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x81f1('0xb'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81f1('0xc'));var logger=require(_0x81f1('0xd'))('api');var utils=require(_0x81f1('0xe'));var config=require(_0x81f1('0xf'));var licenseUtil=require(_0x81f1('0x10'));var db=require(_0x81f1('0x11'))['db'];function respondWithStatusCode(_0x4898d0,_0x3bfa85){_0x3bfa85=_0x3bfa85||0xcc;return function(_0x2d9a1c){if(_0x2d9a1c){return _0x4898d0[_0x81f1('0x12')](_0x3bfa85);}return _0x4898d0[_0x81f1('0x13')](_0x3bfa85)['end']();};}function respondWithResult(_0x34dcab,_0x5f23a7){_0x5f23a7=_0x5f23a7||0xc8;return function(_0x31d0f4){if(_0x31d0f4){return _0x34dcab[_0x81f1('0x13')](_0x5f23a7)[_0x81f1('0x14')](_0x31d0f4);}};}function respondWithFilteredResult(_0x1863ee,_0x5579b5){return function(_0x5d7d43){if(_0x5d7d43){var _0xbd3492=typeof _0x5579b5['offset']===_0x81f1('0x15')&&typeof _0x5579b5[_0x81f1('0x16')]===_0x81f1('0x15');var _0x120027=_0x5d7d43[_0x81f1('0x17')];var _0x5b3ba1=_0xbd3492?0x0:_0x5579b5[_0x81f1('0x18')];var _0x40adcf=_0xbd3492?_0x5d7d43[_0x81f1('0x17')]:_0x5579b5['offset']+_0x5579b5[_0x81f1('0x16')];var _0xb54d84;if(_0x40adcf>=_0x120027){_0x40adcf=_0x120027;_0xb54d84=0xc8;}else{_0xb54d84=0xce;}_0x1863ee['status'](_0xb54d84);return _0x1863ee[_0x81f1('0x19')](_0x81f1('0x1a'),_0x5b3ba1+'-'+_0x40adcf+'/'+_0x120027)['json'](_0x5d7d43);}return null;};}function patchUpdates(_0x3daf2a){return function(_0x20d141){try{jsonpatch[_0x81f1('0x1b')](_0x20d141,_0x3daf2a,!![]);}catch(_0x19f5bb){return BPromise['reject'](_0x19f5bb);}return _0x20d141[_0x81f1('0x1c')]();};}function saveUpdates(_0x4ce5ed,_0x386cd3){return function(_0x3c3f58){if(_0x3c3f58){return _0x3c3f58['update'](_0x4ce5ed)[_0x81f1('0x1d')](function(_0xdcf2a0){return _0xdcf2a0;});}return null;};}function removeEntity(_0x48ab97,_0x40d82f){return function(_0x1b9217){if(_0x1b9217){return _0x1b9217['destroy']()[_0x81f1('0x1d')](function(){_0x48ab97['status'](0xcc)[_0x81f1('0x1e')]();});}};}function handleEntityNotFound(_0x245848,_0x5276cb){return function(_0x5e8331){if(!_0x5e8331){_0x245848[_0x81f1('0x12')](0x194);}return _0x5e8331;};}function handleError(_0x38a2a7,_0x496205){_0x496205=_0x496205||0x1f4;return function(_0x31d052){logger[_0x81f1('0x1f')](_0x31d052[_0x81f1('0x20')]);if(_0x31d052[_0x81f1('0x21')]){delete _0x31d052[_0x81f1('0x21')];}_0x38a2a7[_0x81f1('0x13')](_0x496205)[_0x81f1('0x22')](_0x31d052);};}exports[_0x81f1('0x23')]=function(_0x16342b,_0x47473e){var _0x4f598b={},_0xf9d42c={},_0x2cb0e7={'count':0x0,'rows':[]};var _0xe779c6=_[_0x81f1('0x24')](db[_0x81f1('0x25')][_0x81f1('0x26')],function(_0x1a4f23){return{'name':_0x1a4f23[_0x81f1('0x27')],'type':_0x1a4f23[_0x81f1('0x28')][_0x81f1('0x29')]};});_0xf9d42c[_0x81f1('0x2a')]=_['map'](_0xe779c6,_0x81f1('0x21'));_0xf9d42c[_0x81f1('0x2b')]=_['keys'](_0x16342b[_0x81f1('0x2b')]);_0xf9d42c[_0x81f1('0x2c')]=_['intersection'](_0xf9d42c[_0x81f1('0x2a')],_0xf9d42c[_0x81f1('0x2b')]);_0x4f598b[_0x81f1('0x2d')]=_[_0x81f1('0x2e')](_0xf9d42c['model'],qs[_0x81f1('0x2f')](_0x16342b[_0x81f1('0x2b')][_0x81f1('0x2f')]));_0x4f598b[_0x81f1('0x2d')]=_0x4f598b[_0x81f1('0x2d')][_0x81f1('0x30')]?_0x4f598b[_0x81f1('0x2d')]:_0xf9d42c[_0x81f1('0x2a')];if(!_0x16342b[_0x81f1('0x2b')][_0x81f1('0x31')](_0x81f1('0x32'))){_0x4f598b['limit']=qs[_0x81f1('0x16')](_0x16342b['query']['limit']);_0x4f598b[_0x81f1('0x18')]=qs[_0x81f1('0x18')](_0x16342b[_0x81f1('0x2b')][_0x81f1('0x18')]);}_0x4f598b[_0x81f1('0x33')]=qs[_0x81f1('0x34')](_0x16342b[_0x81f1('0x2b')][_0x81f1('0x34')]);_0x4f598b[_0x81f1('0x35')]=qs[_0x81f1('0x2c')](_[_0x81f1('0x36')](_0x16342b[_0x81f1('0x2b')],_0xf9d42c[_0x81f1('0x2c')]),_0xe779c6);if(_0x16342b[_0x81f1('0x2b')]['filter']){_0x4f598b['where']=_['merge'](_0x4f598b[_0x81f1('0x35')],{'$or':_[_0x81f1('0x24')](_0xe779c6,function(_0x56389a){if(_0x56389a[_0x81f1('0x28')]!==_0x81f1('0x37')){var _0x351fe9={};_0x351fe9[_0x56389a[_0x81f1('0x21')]]={'$like':'%'+_0x16342b[_0x81f1('0x2b')][_0x81f1('0x38')]+'%'};return _0x351fe9;}})});}_0x4f598b=_['merge']({},_0x4f598b,_0x16342b[_0x81f1('0x39')]);var _0x19e3c8={'where':_0x4f598b[_0x81f1('0x35')]};return db['CmHopperHistory'][_0x81f1('0x17')](_0x19e3c8)[_0x81f1('0x1d')](function(_0x2dcc2d){_0x2cb0e7[_0x81f1('0x17')]=_0x2dcc2d;if(_0x16342b[_0x81f1('0x2b')][_0x81f1('0x3a')]){_0x4f598b[_0x81f1('0x3b')]=[{'all':!![]}];}return db[_0x81f1('0x25')][_0x81f1('0x3c')](_0x4f598b);})[_0x81f1('0x1d')](function(_0xfafd64){_0x2cb0e7[_0x81f1('0x3d')]=_0xfafd64;return _0x2cb0e7;})[_0x81f1('0x1d')](respondWithFilteredResult(_0x47473e,_0x4f598b))[_0x81f1('0x3e')](handleError(_0x47473e,null));};exports[_0x81f1('0x3f')]=function(_0x13982b,_0x3e8a8b){var _0x169c8d={'raw':!![],'where':{'id':_0x13982b[_0x81f1('0x40')]['id']}},_0x1f93cc={};_0x1f93cc['model']=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x1f93cc[_0x81f1('0x2b')]=_['keys'](_0x13982b[_0x81f1('0x2b')]);_0x1f93cc[_0x81f1('0x2c')]=_[_0x81f1('0x2e')](_0x1f93cc[_0x81f1('0x2a')],_0x1f93cc[_0x81f1('0x2b')]);_0x169c8d[_0x81f1('0x2d')]=_[_0x81f1('0x2e')](_0x1f93cc[_0x81f1('0x2a')],qs[_0x81f1('0x2f')](_0x13982b['query']['fields']));_0x169c8d[_0x81f1('0x2d')]=_0x169c8d['attributes'][_0x81f1('0x30')]?_0x169c8d['attributes']:_0x1f93cc['model'];if(_0x13982b[_0x81f1('0x2b')]['includeAll']){_0x169c8d[_0x81f1('0x3b')]=[{'all':!![]}];}_0x169c8d=_[_0x81f1('0x41')]({},_0x169c8d,_0x13982b[_0x81f1('0x39')]);return db['CmHopperHistory']['find'](_0x169c8d)[_0x81f1('0x1d')](handleEntityNotFound(_0x3e8a8b,null))[_0x81f1('0x1d')](respondWithResult(_0x3e8a8b,null))[_0x81f1('0x3e')](handleError(_0x3e8a8b,null));};exports[_0x81f1('0x42')]=function(_0x31fa75,_0x2f48e2){return db[_0x81f1('0x25')][_0x81f1('0x42')](_0x31fa75[_0x81f1('0x43')],{})[_0x81f1('0x1d')](respondWithResult(_0x2f48e2,0xc9))[_0x81f1('0x3e')](handleError(_0x2f48e2,null));};exports[_0x81f1('0x44')]=function(_0x95f3b4,_0x3f0e76){return db[_0x81f1('0x25')][_0x81f1('0x44')]()['then'](respondWithResult(_0x3f0e76,null))['catch'](handleError(_0x3f0e76,null));};exports['update']=function(_0x4e0251,_0x32dca6){if(_0x4e0251['body'][_0x81f1('0x45')]){delete _0x4e0251[_0x81f1('0x43')][_0x81f1('0x45')];}return db[_0x81f1('0x25')]['find']({'where':{'uniqueid':_0x4e0251[_0x81f1('0x40')]['id']}})['then'](handleEntityNotFound(_0x32dca6,null))['then'](saveUpdates(_0x4e0251[_0x81f1('0x43')],null))[_0x81f1('0x1d')](respondWithResult(_0x32dca6,null))[_0x81f1('0x3e')](handleError(_0x32dca6,null));}; \ No newline at end of file +var _0x93da=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','CmHopperHistory','includeAll','include','findAll','rows','params','keys','catch','create','body','describe','update','uniqueid','find','eml-format','rimraf'];(function(_0x253635,_0x589a5f){var _0x25b000=function(_0x2a5da2){while(--_0x2a5da2){_0x253635['push'](_0x253635['shift']());}};_0x25b000(++_0x589a5f);}(_0x93da,0x12a));var _0xa93d=function(_0x44f575,_0x1df8c5){_0x44f575=_0x44f575-0x0;var _0x4d61e8=_0x93da[_0x44f575];return _0x4d61e8;};'use strict';var emlformat=require(_0xa93d('0x0'));var rimraf=require(_0xa93d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa93d('0x2'));var rp=require(_0xa93d('0x3'));var moment=require(_0xa93d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa93d('0x5'));var util=require(_0xa93d('0x6'));var path=require(_0xa93d('0x7'));var sox=require(_0xa93d('0x8'));var csv=require(_0xa93d('0x9'));var ejs=require(_0xa93d('0xa'));var fs=require('fs');var fs_extra=require(_0xa93d('0xb'));var _=require(_0xa93d('0xc'));var squel=require(_0xa93d('0xd'));var crypto=require(_0xa93d('0xe'));var jsforce=require(_0xa93d('0xf'));var deskjs=require(_0xa93d('0x10'));var toCsv=require(_0xa93d('0x9'));var querystring=require('querystring');var Papa=require(_0xa93d('0x11'));var Redis=require(_0xa93d('0x12'));var authService=require(_0xa93d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa93d('0x14'));var logger=require(_0xa93d('0x15'))(_0xa93d('0x16'));var utils=require(_0xa93d('0x17'));var config=require(_0xa93d('0x18'));var licenseUtil=require(_0xa93d('0x19'));var db=require(_0xa93d('0x1a'))['db'];function respondWithStatusCode(_0x111c60,_0x5e9870){_0x5e9870=_0x5e9870||0xcc;return function(_0x59306b){if(_0x59306b){return _0x111c60[_0xa93d('0x1b')](_0x5e9870);}return _0x111c60[_0xa93d('0x1c')](_0x5e9870)[_0xa93d('0x1d')]();};}function respondWithResult(_0x3bb996,_0x4aea2a){_0x4aea2a=_0x4aea2a||0xc8;return function(_0x31c713){if(_0x31c713){return _0x3bb996[_0xa93d('0x1c')](_0x4aea2a)['json'](_0x31c713);}};}function respondWithFilteredResult(_0x20154b,_0x43ded1){return function(_0x48c5c5){if(_0x48c5c5){var _0x194338=typeof _0x43ded1[_0xa93d('0x1e')]==='undefined'&&typeof _0x43ded1[_0xa93d('0x1f')]===_0xa93d('0x20');var _0x32d206=_0x48c5c5[_0xa93d('0x21')];var _0x1ebc81=_0x194338?0x0:_0x43ded1[_0xa93d('0x1e')];var _0x5f7b06=_0x194338?_0x48c5c5[_0xa93d('0x21')]:_0x43ded1[_0xa93d('0x1e')]+_0x43ded1[_0xa93d('0x1f')];var _0xe68696;if(_0x5f7b06>=_0x32d206){_0x5f7b06=_0x32d206;_0xe68696=0xc8;}else{_0xe68696=0xce;}_0x20154b[_0xa93d('0x1c')](_0xe68696);return _0x20154b['set'](_0xa93d('0x22'),_0x1ebc81+'-'+_0x5f7b06+'/'+_0x32d206)[_0xa93d('0x23')](_0x48c5c5);}return null;};}function patchUpdates(_0xe6e0){return function(_0x17ffd0){try{jsonpatch['apply'](_0x17ffd0,_0xe6e0,!![]);}catch(_0x12208e){return BPromise['reject'](_0x12208e);}return _0x17ffd0['save']();};}function saveUpdates(_0x15f899,_0x34d2bc){return function(_0x30bd12){if(_0x30bd12){return _0x30bd12['update'](_0x15f899)[_0xa93d('0x24')](function(_0x22edb3){return _0x22edb3;});}return null;};}function removeEntity(_0x566bf3,_0x16df08){return function(_0xcb9e40){if(_0xcb9e40){return _0xcb9e40['destroy']()[_0xa93d('0x24')](function(){_0x566bf3[_0xa93d('0x1c')](0xcc)[_0xa93d('0x1d')]();});}};}function handleEntityNotFound(_0x8ec91b,_0x155864){return function(_0x528ec9){if(!_0x528ec9){_0x8ec91b['sendStatus'](0x194);}return _0x528ec9;};}function handleError(_0x4cc46d,_0x3d3cc3){_0x3d3cc3=_0x3d3cc3||0x1f4;return function(_0xe8e48d){logger[_0xa93d('0x25')](_0xe8e48d[_0xa93d('0x26')]);if(_0xe8e48d[_0xa93d('0x27')]){delete _0xe8e48d[_0xa93d('0x27')];}_0x4cc46d[_0xa93d('0x1c')](_0x3d3cc3)[_0xa93d('0x28')](_0xe8e48d);};}exports[_0xa93d('0x29')]=function(_0x22d24b,_0x30c7de){var _0x3e18df={},_0x39a5d0={},_0x246157={'count':0x0,'rows':[]};var _0x4acae7=_[_0xa93d('0x2a')](db['CmHopperHistory'][_0xa93d('0x2b')],function(_0x577de5){return{'name':_0x577de5[_0xa93d('0x2c')],'type':_0x577de5[_0xa93d('0x2d')]['key']};});_0x39a5d0[_0xa93d('0x2e')]=_[_0xa93d('0x2a')](_0x4acae7,_0xa93d('0x27'));_0x39a5d0[_0xa93d('0x2f')]=_['keys'](_0x22d24b[_0xa93d('0x2f')]);_0x39a5d0[_0xa93d('0x30')]=_[_0xa93d('0x31')](_0x39a5d0[_0xa93d('0x2e')],_0x39a5d0[_0xa93d('0x2f')]);_0x3e18df['attributes']=_[_0xa93d('0x31')](_0x39a5d0['model'],qs[_0xa93d('0x32')](_0x22d24b['query'][_0xa93d('0x32')]));_0x3e18df[_0xa93d('0x33')]=_0x3e18df[_0xa93d('0x33')][_0xa93d('0x34')]?_0x3e18df[_0xa93d('0x33')]:_0x39a5d0[_0xa93d('0x2e')];if(!_0x22d24b['query']['hasOwnProperty'](_0xa93d('0x35'))){_0x3e18df[_0xa93d('0x1f')]=qs[_0xa93d('0x1f')](_0x22d24b[_0xa93d('0x2f')][_0xa93d('0x1f')]);_0x3e18df[_0xa93d('0x1e')]=qs[_0xa93d('0x1e')](_0x22d24b[_0xa93d('0x2f')][_0xa93d('0x1e')]);}_0x3e18df[_0xa93d('0x36')]=qs['sort'](_0x22d24b[_0xa93d('0x2f')][_0xa93d('0x37')]);_0x3e18df['where']=qs[_0xa93d('0x30')](_[_0xa93d('0x38')](_0x22d24b[_0xa93d('0x2f')],_0x39a5d0[_0xa93d('0x30')]),_0x4acae7);if(_0x22d24b[_0xa93d('0x2f')][_0xa93d('0x39')]){_0x3e18df[_0xa93d('0x3a')]=_[_0xa93d('0x3b')](_0x3e18df[_0xa93d('0x3a')],{'$or':_[_0xa93d('0x2a')](_0x4acae7,function(_0x3592f4){if(_0x3592f4[_0xa93d('0x2d')]!=='VIRTUAL'){var _0x45aa99={};_0x45aa99[_0x3592f4[_0xa93d('0x27')]]={'$like':'%'+_0x22d24b['query'][_0xa93d('0x39')]+'%'};return _0x45aa99;}})});}_0x3e18df=_[_0xa93d('0x3b')]({},_0x3e18df,_0x22d24b[_0xa93d('0x3c')]);var _0x40a915={'where':_0x3e18df[_0xa93d('0x3a')]};return db[_0xa93d('0x3d')]['count'](_0x40a915)[_0xa93d('0x24')](function(_0x48bbad){_0x246157['count']=_0x48bbad;if(_0x22d24b['query'][_0xa93d('0x3e')]){_0x3e18df[_0xa93d('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xa93d('0x40')](_0x3e18df);})['then'](function(_0x154e5f){_0x246157[_0xa93d('0x41')]=_0x154e5f;return _0x246157;})[_0xa93d('0x24')](respondWithFilteredResult(_0x30c7de,_0x3e18df))['catch'](handleError(_0x30c7de,null));};exports['show']=function(_0x4aaab3,_0x118f80){var _0x29cd49={'raw':!![],'where':{'id':_0x4aaab3[_0xa93d('0x42')]['id']}},_0x5173f3={};_0x5173f3['model']=_[_0xa93d('0x43')](db[_0xa93d('0x3d')][_0xa93d('0x2b')]);_0x5173f3['query']=_[_0xa93d('0x43')](_0x4aaab3[_0xa93d('0x2f')]);_0x5173f3[_0xa93d('0x30')]=_[_0xa93d('0x31')](_0x5173f3[_0xa93d('0x2e')],_0x5173f3[_0xa93d('0x2f')]);_0x29cd49[_0xa93d('0x33')]=_[_0xa93d('0x31')](_0x5173f3[_0xa93d('0x2e')],qs[_0xa93d('0x32')](_0x4aaab3[_0xa93d('0x2f')]['fields']));_0x29cd49[_0xa93d('0x33')]=_0x29cd49[_0xa93d('0x33')][_0xa93d('0x34')]?_0x29cd49['attributes']:_0x5173f3[_0xa93d('0x2e')];if(_0x4aaab3[_0xa93d('0x2f')]['includeAll']){_0x29cd49[_0xa93d('0x3f')]=[{'all':!![]}];}_0x29cd49=_['merge']({},_0x29cd49,_0x4aaab3[_0xa93d('0x3c')]);return db['CmHopperHistory']['find'](_0x29cd49)[_0xa93d('0x24')](handleEntityNotFound(_0x118f80,null))[_0xa93d('0x24')](respondWithResult(_0x118f80,null))[_0xa93d('0x44')](handleError(_0x118f80,null));};exports[_0xa93d('0x45')]=function(_0x859b5,_0x3de4a8){return db[_0xa93d('0x3d')][_0xa93d('0x45')](_0x859b5[_0xa93d('0x46')],{})[_0xa93d('0x24')](respondWithResult(_0x3de4a8,0xc9))[_0xa93d('0x44')](handleError(_0x3de4a8,null));};exports[_0xa93d('0x47')]=function(_0x4ed0b0,_0x5556d3){return db['CmHopperHistory']['describe']()[_0xa93d('0x24')](respondWithResult(_0x5556d3,null))[_0xa93d('0x44')](handleError(_0x5556d3,null));};exports[_0xa93d('0x48')]=function(_0x56e8d6,_0x3cd66a){if(_0x56e8d6['body'][_0xa93d('0x49')]){delete _0x56e8d6[_0xa93d('0x46')][_0xa93d('0x49')];}return db[_0xa93d('0x3d')][_0xa93d('0x4a')]({'where':{'uniqueid':_0x56e8d6[_0xa93d('0x42')]['id']}})['then'](handleEntityNotFound(_0x3cd66a,null))[_0xa93d('0x24')](saveUpdates(_0x56e8d6[_0xa93d('0x46')],null))['then'](respondWithResult(_0x3cd66a,null))[_0xa93d('0x44')](handleError(_0x3cd66a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 98b6d5f..85631b1 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 _0xce62=['exports','define','CmHopperHistory','endtime','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./cmHopperHistory.attributes'];(function(_0x1fd0d5,_0x3cb655){var _0x57d242=function(_0xcdb4){while(--_0xcdb4){_0x1fd0d5['push'](_0x1fd0d5['shift']());}};_0x57d242(++_0x3cb655);}(_0xce62,0x83));var _0x2ce6=function(_0x124e5e,_0x9bd040){_0x124e5e=_0x124e5e-0x0;var _0x2b87a1=_0xce62[_0x124e5e];return _0x2b87a1;};'use strict';var _=require(_0x2ce6('0x0'));var util=require(_0x2ce6('0x1'));var logger=require('../../config/logger')(_0x2ce6('0x2'));var moment=require(_0x2ce6('0x3'));var BPromise=require(_0x2ce6('0x4'));var rp=require(_0x2ce6('0x5'));var fs=require('fs');var path=require(_0x2ce6('0x6'));var rimraf=require(_0x2ce6('0x7'));var config=require('../../config/environment');var attributes=require(_0x2ce6('0x8'));module[_0x2ce6('0x9')]=function(_0x422f72,_0x9bbac8){return _0x422f72[_0x2ce6('0xa')](_0x2ce6('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x2ce6('0xc'),'fields':[_0x2ce6('0xc')]},{'name':'uniqueid','fields':[_0x2ce6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa24d=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa24d,0x1c1));var _0xda24=function(_0x2492dc,_0x3284a7){_0x2492dc=_0x2492dc-0x0;var _0x310431=_0xa24d[_0x2492dc];return _0x310431;};'use strict';var _=require(_0xda24('0x0'));var util=require(_0xda24('0x1'));var logger=require(_0xda24('0x2'))(_0xda24('0x3'));var moment=require(_0xda24('0x4'));var BPromise=require(_0xda24('0x5'));var rp=require(_0xda24('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xda24('0x7'));var config=require(_0xda24('0x8'));var attributes=require(_0xda24('0x9'));module[_0xda24('0xa')]=function(_0x561d74,_0x3557cb){return _0x561d74[_0xda24('0xb')]('CmHopperHistory',attributes,{'tableName':_0xda24('0xc'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xda24('0xd')]},{'name':_0xda24('0xe'),'fields':[_0xda24('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 37bb4f6..ede649c 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 _0xa571=['CreateCmHopperHistory','CmHopperHistory','create','body','options','AvgHandleTime','findAll','raw','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa571,0x107));var _0x1a57=function(_0x15f1f8,_0x15e5c8){_0x15f1f8=_0x15f1f8-0x0;var _0x53215d=_0xa571[_0x15f1f8];return _0x53215d;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var moment=require(_0x1a57('0x2'));var BPromise=require(_0x1a57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a57('0x4'));var db=require(_0x1a57('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a57('0x6'));var config=require('../../config/environment');var jayson=require(_0x1a57('0x7'));var client=jayson[_0x1a57('0x8')][_0x1a57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5352,_0x2492f5,_0x924873){return new BPromise(function(_0x5d9f45,_0x3edb40){return client[_0x1a57('0xa')](_0x3c5352,_0x924873)[_0x1a57('0xb')](function(_0x58e266){logger[_0x1a57('0xc')](_0x1a57('0xd'),_0x2492f5,_0x1a57('0xe'));logger[_0x1a57('0xf')](_0x1a57('0x10'),_0x2492f5,_0x1a57('0xe'),JSON[_0x1a57('0x11')](_0x58e266));if(_0x58e266[_0x1a57('0x12')]){if(_0x58e266['error']['code']===0x1f4){logger[_0x1a57('0x12')](_0x1a57('0xd'),_0x2492f5,_0x58e266[_0x1a57('0x12')]['message']);return _0x3edb40(_0x58e266[_0x1a57('0x12')][_0x1a57('0x13')]);}logger['error'](_0x1a57('0xd'),_0x2492f5,_0x58e266['error'][_0x1a57('0x13')]);return _0x5d9f45(_0x58e266[_0x1a57('0x12')][_0x1a57('0x13')]);}else{logger[_0x1a57('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x2492f5,_0x1a57('0xe'));_0x5d9f45(_0x58e266['result']['message']);}})[_0x1a57('0x14')](function(_0x1c537f){logger[_0x1a57('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x2492f5,_0x1c537f);_0x3edb40(_0x1c537f);});});}exports[_0x1a57('0x15')]=function(_0x1662a3){var _0x80f8c1=this;return new Promise(function(_0x53bb20,_0x3daa66){return db[_0x1a57('0x16')][_0x1a57('0x17')](_0x1662a3[_0x1a57('0x18')],{'raw':_0x1662a3[_0x1a57('0x19')]?_0x1662a3['options']['raw']===undefined?!![]:![]:!![]})[_0x1a57('0xb')](function(_0x21e811){logger[_0x1a57('0xc')]('CreateCmHopperHistory',_0x1662a3);logger['debug']('CreateCmHopperHistory',_0x1662a3,JSON[_0x1a57('0x11')](_0x21e811));_0x53bb20(_0x21e811);})[_0x1a57('0x14')](function(_0x3f52b9){logger[_0x1a57('0x12')](_0x1a57('0x15'),_0x3f52b9[_0x1a57('0x13')],_0x1662a3);_0x3daa66(_0x80f8c1[_0x1a57('0x12')](0x1f4,_0x3f52b9[_0x1a57('0x13')]));});});};exports[_0x1a57('0x1a')]=function(_0x35d5dc){var _0x29e7cd=this;return new Promise(function(_0x36b17e,_0x26cdd3){return db[_0x1a57('0x16')][_0x1a57('0x1b')]({'raw':_0x35d5dc[_0x1a57('0x19')]?_0x35d5dc[_0x1a57('0x19')][_0x1a57('0x1c')]===undefined?!![]:![]:!![],'where':_0x35d5dc[_0x1a57('0x19')]?_0x35d5dc[_0x1a57('0x19')][_0x1a57('0x1d')]||null:null,'attributes':[[db[_0x1a57('0x1e')]['fn']('COUNT',db['sequelize'][_0x1a57('0x1f')]('id')),_0x1a57('0x20')],[db['sequelize']['fn'](_0x1a57('0x21'),db['sequelize']['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0x1a57('0x23')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db['sequelize'][_0x1a57('0x22')](_0x1a57('0x24')))),_0x1a57('0x25')],[db[_0x1a57('0x1e')]['fn']('COUNT',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x26')))),_0x1a57('0x27')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x28'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')]['literal'](_0x1a57('0x29')))),_0x1a57('0x2a')],[db['sequelize']['fn']('AVG',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x2b')))),_0x1a57('0x2c')]]})[_0x1a57('0xb')](function(_0xe80d94){logger[_0x1a57('0xc')](_0x1a57('0x1a'),_0x35d5dc);logger[_0x1a57('0xf')](_0x1a57('0x1a'),_0x35d5dc,JSON[_0x1a57('0x11')](_0xe80d94));_0x36b17e(_0xe80d94);})[_0x1a57('0x14')](function(_0x1a6231){logger[_0x1a57('0x12')](_0x1a57('0x1a'),_0x1a6231[_0x1a57('0x13')],_0x35d5dc);_0x26cdd3(_0x29e7cd[_0x1a57('0x12')](0x1f4,_0x1a6231['message']));});});};exports[_0x1a57('0x2d')]=function(_0x173671){var _0x137920=this;return new Promise(function(_0x3dad7c,_0x58b7dc){return db[_0x1a57('0x16')][_0x1a57('0x1b')]({'raw':_0x173671[_0x1a57('0x19')]?_0x173671[_0x1a57('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x173671['options']?_0x173671['options']['where']||null:null,'attributes':[[_0x1a57('0x2e'),_0x1a57('0x2f')],[db[_0x1a57('0x1e')]['fn']('COUNT',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x30')))),'outboundNoSuchCallsDay'],[db[_0x1a57('0x1e')]['fn']('COUNT',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')]('`state`\x20=\x203,\x201,\x20null'))),_0x1a57('0x31')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')]['literal'](_0x1a57('0x32')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0x1a57('0x21'),db['sequelize']['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x33')))),'outboundBusyCallsDay'],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')]['literal'](_0x1a57('0x34')))),_0x1a57('0x35')],[db['sequelize']['fn'](_0x1a57('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x1a57('0x22')](_0x1a57('0x36')))),_0x1a57('0x37')],[db[_0x1a57('0x1e')]['fn']('COUNT',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x38')))),_0x1a57('0x39')],[db['sequelize']['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')]('`state`\x20=\x2012,\x201,\x20null'))),_0x1a57('0x3a')],[db['sequelize']['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x3b')))),_0x1a57('0x3c')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x3d')))),_0x1a57('0x3e')],[db['sequelize']['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x3f')))),_0x1a57('0x40')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')]('`state`\x20=\x2016,\x201,\x20null'))),_0x1a57('0x41')],[db[_0x1a57('0x1e')]['fn']('COUNT',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')]['literal'](_0x1a57('0x42')))),_0x1a57('0x40')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x1a57('0x43')]],'group':[_0x1a57('0x2e')]})['then'](function(_0x5e510e){logger['info'](_0x1a57('0x2d'),_0x173671);logger[_0x1a57('0xf')](_0x1a57('0x2d'),_0x173671,JSON[_0x1a57('0x11')](_0x5e510e));_0x3dad7c(_0x5e510e);})[_0x1a57('0x14')](function(_0x33379c){logger[_0x1a57('0x12')](_0x1a57('0x2d'),_0x33379c['message'],_0x173671);_0x58b7dc(_0x137920['error'](0x1f4,_0x33379c['message']));});});};exports['GetCampaignHopperHistory']=function(_0x554208){var _0xd0261c=this;return new Promise(function(_0x13c04d,_0xcba9f0){return db[_0x1a57('0x16')][_0x1a57('0x1b')]({'raw':_0x554208[_0x1a57('0x19')]?_0x554208[_0x1a57('0x19')][_0x1a57('0x1c')]===undefined?!![]:![]:!![],'where':_0x554208['options']?_0x554208['options']['where']||null:null,'attributes':[[_0x1a57('0x2e'),'name'],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')][_0x1a57('0x1f')]('id')),_0x1a57('0x44')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x1a57('0x32')))),_0x1a57('0x45')]],'group':[_0x1a57('0x2e')]})[_0x1a57('0xb')](function(_0x2db770){logger[_0x1a57('0xc')](_0x1a57('0x46'),_0x554208);logger['debug']('GetCampaignHopperHistory',_0x554208,JSON[_0x1a57('0x11')](_0x2db770));_0x13c04d(_0x2db770);})[_0x1a57('0x14')](function(_0x231154){logger[_0x1a57('0x12')](_0x1a57('0x46'),_0x231154[_0x1a57('0x13')],_0x554208);_0xcba9f0(_0xd0261c['error'](0x1f4,_0x231154['message']));});});}; \ No newline at end of file +var _0x6de9=['outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','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=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','then','debug','stringify','AvgHandleTime','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay'];(function(_0x10091d,_0x43c401){var _0x243f99=function(_0x3f34cc){while(--_0x3f34cc){_0x10091d['push'](_0x10091d['shift']());}};_0x243f99(++_0x43c401);}(_0x6de9,0xe6));var _0x96de=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6de9[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x96de('0x0'));var util=require(_0x96de('0x1'));var moment=require(_0x96de('0x2'));var BPromise=require(_0x96de('0x3'));var rs=require(_0x96de('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96de('0x5'))['db'];var utils=require(_0x96de('0x6'));var logger=require('../../config/logger')(_0x96de('0x7'));var config=require(_0x96de('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x96de('0x9')][_0x96de('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20ed57,_0x46afa4,_0x48e213){return new BPromise(function(_0x8624be,_0x14fad5){return client[_0x96de('0xb')](_0x20ed57,_0x48e213)['then'](function(_0x415b5f){logger[_0x96de('0xc')](_0x96de('0xd'),_0x46afa4,'request\x20sent');logger['debug'](_0x96de('0xe'),_0x46afa4,_0x96de('0xf'),JSON['stringify'](_0x415b5f));if(_0x415b5f[_0x96de('0x10')]){if(_0x415b5f[_0x96de('0x10')]['code']===0x1f4){logger['error'](_0x96de('0xd'),_0x46afa4,_0x415b5f[_0x96de('0x10')]['message']);return _0x14fad5(_0x415b5f[_0x96de('0x10')]['message']);}logger['error'](_0x96de('0xd'),_0x46afa4,_0x415b5f[_0x96de('0x10')][_0x96de('0x11')]);return _0x8624be(_0x415b5f[_0x96de('0x10')][_0x96de('0x11')]);}else{logger['info'](_0x96de('0xd'),_0x46afa4,_0x96de('0xf'));_0x8624be(_0x415b5f[_0x96de('0x12')][_0x96de('0x11')]);}})[_0x96de('0x13')](function(_0x198663){logger[_0x96de('0x10')](_0x96de('0xd'),_0x46afa4,_0x198663);_0x14fad5(_0x198663);});});}exports[_0x96de('0x14')]=function(_0x9701bb){var _0x321bf4=this;return new Promise(function(_0x389a4d,_0xe0878b){return db[_0x96de('0x15')][_0x96de('0x16')](_0x9701bb[_0x96de('0x17')],{'raw':_0x9701bb[_0x96de('0x18')]?_0x9701bb[_0x96de('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x96de('0x19')](function(_0x3d543f){logger[_0x96de('0xc')]('CreateCmHopperHistory',_0x9701bb);logger[_0x96de('0x1a')]('CreateCmHopperHistory',_0x9701bb,JSON[_0x96de('0x1b')](_0x3d543f));_0x389a4d(_0x3d543f);})[_0x96de('0x13')](function(_0x175a42){logger[_0x96de('0x10')](_0x96de('0x14'),_0x175a42[_0x96de('0x11')],_0x9701bb);_0xe0878b(_0x321bf4[_0x96de('0x10')](0x1f4,_0x175a42[_0x96de('0x11')]));});});};exports[_0x96de('0x1c')]=function(_0x4f20b2){var _0x21ab49=this;return new Promise(function(_0x5e06c7,_0x427665){return db[_0x96de('0x15')][_0x96de('0x1d')]({'raw':_0x4f20b2[_0x96de('0x18')]?_0x4f20b2[_0x96de('0x18')][_0x96de('0x1e')]===undefined?!![]:![]:!![],'where':_0x4f20b2[_0x96de('0x18')]?_0x4f20b2[_0x96de('0x18')][_0x96de('0x1f')]||null:null,'attributes':[[db[_0x96de('0x20')]['fn'](_0x96de('0x21'),db[_0x96de('0x20')][_0x96de('0x22')]('id')),_0x96de('0x23')],[db['sequelize']['fn'](_0x96de('0x21'),db[_0x96de('0x20')]['fn']('IF',db[_0x96de('0x20')][_0x96de('0x24')](_0x96de('0x25')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0x96de('0x21'),db[_0x96de('0x20')]['fn']('IF',db[_0x96de('0x20')][_0x96de('0x24')](_0x96de('0x26')))),_0x96de('0x27')],[db['sequelize']['fn']('COUNT',db[_0x96de('0x20')]['fn']('IF',db[_0x96de('0x20')][_0x96de('0x24')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x96de('0x20')]['fn'](_0x96de('0x28'),db['sequelize']['fn']('IF',db[_0x96de('0x20')][_0x96de('0x24')](_0x96de('0x29')))),_0x96de('0x2a')],[db[_0x96de('0x20')]['fn'](_0x96de('0x28'),db[_0x96de('0x20')]['fn']('IF',db['sequelize'][_0x96de('0x24')](_0x96de('0x2b')))),_0x96de('0x2c')]]})[_0x96de('0x19')](function(_0xe3316b){logger[_0x96de('0xc')](_0x96de('0x1c'),_0x4f20b2);logger['debug']('AvgHandleTime',_0x4f20b2,JSON[_0x96de('0x1b')](_0xe3316b));_0x5e06c7(_0xe3316b);})[_0x96de('0x13')](function(_0x211d03){logger['error']('AvgHandleTime',_0x211d03[_0x96de('0x11')],_0x4f20b2);_0x427665(_0x21ab49[_0x96de('0x10')](0x1f4,_0x211d03['message']));});});};exports[_0x96de('0x2d')]=function(_0x164e69){var _0x56666d=this;return new Promise(function(_0xac1177,_0x2974fa){return db['CmHopperHistory'][_0x96de('0x1d')]({'raw':_0x164e69[_0x96de('0x18')]?_0x164e69[_0x96de('0x18')][_0x96de('0x1e')]===undefined?!![]:![]:!![],'where':_0x164e69['options']?_0x164e69['options'][_0x96de('0x1f')]||null:null,'attributes':[['campaign',_0x96de('0x2e')],[db[_0x96de('0x20')]['fn']('COUNT',db[_0x96de('0x20')]['fn']('IF',db[_0x96de('0x20')][_0x96de('0x24')]('`state`\x20=\x200,\x201,\x20null'))),_0x96de('0x2f')],[db[_0x96de('0x20')]['fn'](_0x96de('0x21'),db[_0x96de('0x20')]['fn']('IF',db[_0x96de('0x20')][_0x96de('0x24')](_0x96de('0x30')))),_0x96de('0x31')],[db[_0x96de('0x20')]['fn']('COUNT',db[_0x96de('0x20')]['fn']('IF',db[_0x96de('0x20')][_0x96de('0x24')](_0x96de('0x25')))),'outboundAnswerCallsDay'],[db[_0x96de('0x20')]['fn']('COUNT',db[_0x96de('0x20')]['fn']('IF',db[_0x96de('0x20')][_0x96de('0x24')]('`state`\x20=\x205,\x201,\x20null'))),_0x96de('0x32')],[db[_0x96de('0x20')]['fn'](_0x96de('0x21'),db[_0x96de('0x20')]['fn']('IF',db['sequelize']['literal'](_0x96de('0x33')))),'outboundCongestionCallsDay'],[db[_0x96de('0x20')]['fn'](_0x96de('0x21'),db[_0x96de('0x20')]['fn']('IF',db[_0x96de('0x20')][_0x96de('0x24')](_0x96de('0x34')))),_0x96de('0x35')],[db[_0x96de('0x20')]['fn'](_0x96de('0x21'),db[_0x96de('0x20')]['fn']('IF',db[_0x96de('0x20')][_0x96de('0x24')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x96de('0x36')],[db['sequelize']['fn'](_0x96de('0x21'),db[_0x96de('0x20')]['fn']('IF',db[_0x96de('0x20')][_0x96de('0x24')](_0x96de('0x37')))),_0x96de('0x38')],[db[_0x96de('0x20')]['fn'](_0x96de('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x96de('0x24')](_0x96de('0x39')))),_0x96de('0x3a')],[db[_0x96de('0x20')]['fn'](_0x96de('0x21'),db[_0x96de('0x20')]['fn']('IF',db[_0x96de('0x20')][_0x96de('0x24')](_0x96de('0x3b')))),_0x96de('0x3c')],[db[_0x96de('0x20')]['fn'](_0x96de('0x21'),db[_0x96de('0x20')]['fn']('IF',db[_0x96de('0x20')][_0x96de('0x24')](_0x96de('0x3d')))),_0x96de('0x3e')],[db[_0x96de('0x20')]['fn'](_0x96de('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x96de('0x24')](_0x96de('0x3f')))),_0x96de('0x40')],[db[_0x96de('0x20')]['fn'](_0x96de('0x21'),db[_0x96de('0x20')]['fn']('IF',db[_0x96de('0x20')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x96de('0x3e')],[db['sequelize']['fn'](_0x96de('0x21'),db[_0x96de('0x20')]['fn']('IF',db['sequelize']['literal'](_0x96de('0x41')))),_0x96de('0x42')]],'group':[_0x96de('0x43')]})[_0x96de('0x19')](function(_0x5e9875){logger['info'](_0x96de('0x2d'),_0x164e69);logger[_0x96de('0x1a')](_0x96de('0x2d'),_0x164e69,JSON[_0x96de('0x1b')](_0x5e9875));_0xac1177(_0x5e9875);})['catch'](function(_0x28303b){logger[_0x96de('0x10')](_0x96de('0x2d'),_0x28303b[_0x96de('0x11')],_0x164e69);_0x2974fa(_0x56666d[_0x96de('0x10')](0x1f4,_0x28303b[_0x96de('0x11')]));});});};exports[_0x96de('0x44')]=function(_0x428e5e){var _0x1f542c=this;return new Promise(function(_0x4ef7b6,_0x5f5221){return db['CmHopperHistory'][_0x96de('0x1d')]({'raw':_0x428e5e[_0x96de('0x18')]?_0x428e5e[_0x96de('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x428e5e[_0x96de('0x18')]?_0x428e5e['options'][_0x96de('0x1f')]||null:null,'attributes':[[_0x96de('0x43'),_0x96de('0x2e')],[db['sequelize']['fn'](_0x96de('0x21'),db['sequelize'][_0x96de('0x22')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn']('COUNT',db[_0x96de('0x20')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x96de('0x45')]],'group':[_0x96de('0x43')]})['then'](function(_0x49c25b){logger['info'](_0x96de('0x44'),_0x428e5e);logger['debug']('GetCampaignHopperHistory',_0x428e5e,JSON[_0x96de('0x1b')](_0x49c25b));_0x4ef7b6(_0x49c25b);})[_0x96de('0x13')](function(_0x212bec){logger['error'](_0x96de('0x44'),_0x212bec['message'],_0x428e5e);_0x5f5221(_0x1f542c[_0x96de('0x10')](0x1f4,_0x212bec[_0x96de('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 32db581..69bd63f 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 _0x8ee9=['/:id','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe'];(function(_0x57c07a,_0x25fc27){var _0x19d4d2=function(_0x1b0cf6){while(--_0x1b0cf6){_0x57c07a['push'](_0x57c07a['shift']());}};_0x19d4d2(++_0x25fc27);}(_0x8ee9,0x99));var _0x98ee=function(_0x20c5a8,_0x54d270){_0x20c5a8=_0x20c5a8-0x0;var _0x29e545=_0x8ee9[_0x20c5a8];return _0x29e545;};'use strict';var multer=require(_0x98ee('0x0'));var util=require(_0x98ee('0x1'));var path=require(_0x98ee('0x2'));var timeout=require(_0x98ee('0x3'));var express=require(_0x98ee('0x4'));var router=express[_0x98ee('0x5')]();var fs_extra=require(_0x98ee('0x6'));var auth=require(_0x98ee('0x7'));var interaction=require(_0x98ee('0x8'));var config=require(_0x98ee('0x9'));var controller=require(_0x98ee('0xa'));router[_0x98ee('0xb')]('/',auth[_0x98ee('0xc')](),controller['index']);router[_0x98ee('0xb')](_0x98ee('0xd'),auth[_0x98ee('0xc')](),controller[_0x98ee('0xe')]);router[_0x98ee('0xb')](_0x98ee('0xf'),auth[_0x98ee('0xc')](),controller['show']);router[_0x98ee('0x10')]('/',auth[_0x98ee('0xc')](),controller[_0x98ee('0x11')]);router[_0x98ee('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x98ee('0x13')]);module[_0x98ee('0x14')]=router; \ No newline at end of file +var _0x2729=['put','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x2729,0x191));var _0x9272=function(_0xbb9455,_0x5a058e){_0xbb9455=_0xbb9455-0x0;var _0x4b7fe1=_0x2729[_0xbb9455];return _0x4b7fe1;};'use strict';var multer=require(_0x9272('0x0'));var util=require(_0x9272('0x1'));var path=require(_0x9272('0x2'));var timeout=require(_0x9272('0x3'));var express=require('express');var router=express[_0x9272('0x4')]();var fs_extra=require(_0x9272('0x5'));var auth=require(_0x9272('0x6'));var interaction=require(_0x9272('0x7'));var config=require(_0x9272('0x8'));var controller=require(_0x9272('0x9'));router[_0x9272('0xa')]('/',auth[_0x9272('0xb')](),controller[_0x9272('0xc')]);router[_0x9272('0xa')]('/describe',auth[_0x9272('0xb')](),controller['describe']);router[_0x9272('0xa')](_0x9272('0xd'),auth[_0x9272('0xb')](),controller[_0x9272('0xe')]);router[_0x9272('0xf')]('/',auth[_0x9272('0xb')](),controller[_0x9272('0x10')]);router[_0x9272('0x11')](_0x9272('0xd'),auth[_0x9272('0xb')](),controller['update']);module[_0x9272('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 840f5c6..955a084 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 _0xe9e8=['name','sequelize','exports','STRING'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xe9e8,0x179));var _0x8e9e=function(_0x5437fd,_0x396cda){_0x5437fd=_0x5437fd-0x0;var _0x1a2e4f=_0xe9e8[_0x5437fd];return _0x1a2e4f;};'use strict';var Sequelize=require(_0x8e9e('0x0'));module[_0x8e9e('0x1')]={'name':{'type':Sequelize[_0x8e9e('0x2')],'unique':_0x8e9e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8e9e('0x2')]},'dialPrefix':{'type':Sequelize[_0x8e9e('0x2')]}}; \ No newline at end of file +var _0xefbf=['STRING','sequelize','exports'];(function(_0x223e07,_0x49ee45){var _0x4633a5=function(_0x404c07){while(--_0x404c07){_0x223e07['push'](_0x223e07['shift']());}};_0x4633a5(++_0x49ee45);}(_0xefbf,0xa3));var _0xfefb=function(_0x111b18,_0x4acb2e){_0x111b18=_0x111b18-0x0;var _0x6151e0=_0xefbf[_0x111b18];return _0x6151e0;};'use strict';var Sequelize=require(_0xfefb('0x0'));module[_0xfefb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xfefb('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 4047295..ca2e3fa 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 _0x87cb=['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','redis','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','end','error','stack','name','send','CmList','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','findAll','catch','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','Disposition','getDispositions','sort','rows','removeDispositions','CmContact','tags','join','isArray','each','omit','ids','success','dataValues','errors','push','getContacts','CmCustomField','concat','CustomFields','format','order','raw','getContactsCsv','cf_%d','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','text/csv','addCustomField','findOne','sequelize','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x377b59,_0x1f167d){var _0x2cae54=function(_0x292df1){while(--_0x292df1){_0x377b59['push'](_0x377b59['shift']());}};_0x2cae54(++_0x1f167d);}(_0x87cb,0x19e));var _0xb87c=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x87cb[_0x2dadb9];return _0x2f0097;};'use strict';var emlformat=require(_0xb87c('0x0'));var rimraf=require(_0xb87c('0x1'));var zipdir=require(_0xb87c('0x2'));var jsonpatch=require(_0xb87c('0x3'));var rp=require(_0xb87c('0x4'));var moment=require(_0xb87c('0x5'));var BPromise=require(_0xb87c('0x6'));var Mustache=require('mustache');var util=require(_0xb87c('0x7'));var path=require(_0xb87c('0x8'));var sox=require(_0xb87c('0x9'));var csv=require(_0xb87c('0xa'));var ejs=require(_0xb87c('0xb'));var fs=require('fs');var fs_extra=require(_0xb87c('0xc'));var _=require(_0xb87c('0xd'));var squel=require(_0xb87c('0xe'));var crypto=require(_0xb87c('0xf'));var jsforce=require(_0xb87c('0x10'));var deskjs=require(_0xb87c('0x11'));var toCsv=require(_0xb87c('0xa'));var querystring=require(_0xb87c('0x12'));var Papa=require('papaparse');var Redis=require(_0xb87c('0x13'));var authService=require(_0xb87c('0x14'));var qs=require(_0xb87c('0x15'));var as=require(_0xb87c('0x16'));var hardwareService=require(_0xb87c('0x17'));var logger=require('../../config/logger')(_0xb87c('0x18'));var utils=require(_0xb87c('0x19'));var config=require(_0xb87c('0x1a'));var licenseUtil=require(_0xb87c('0x1b'));var db=require('../../mysqldb')['db'];config[_0xb87c('0x1c')]=_['defaults'](config[_0xb87c('0x1c')],{'host':_0xb87c('0x1d'),'port':0x18eb});var socket=require(_0xb87c('0x1e'))(new Redis(config[_0xb87c('0x1c')]));require('./cmList.socket')[_0xb87c('0x1f')](socket);function respondWithStatusCode(_0x2e6ec9,_0x1a119b){_0x1a119b=_0x1a119b||0xcc;return function(_0x3ef223){if(_0x3ef223){return _0x2e6ec9[_0xb87c('0x20')](_0x1a119b);}return _0x2e6ec9[_0xb87c('0x21')](_0x1a119b)['end']();};}function respondWithResult(_0x290082,_0x284d78){_0x284d78=_0x284d78||0xc8;return function(_0xf7ba5d){if(_0xf7ba5d){return _0x290082[_0xb87c('0x21')](_0x284d78)[_0xb87c('0x22')](_0xf7ba5d);}};}function respondWithFilteredResult(_0x23c476,_0x410810){return function(_0x43d5ca){if(_0x43d5ca){var _0x4948a4=typeof _0x410810['offset']===_0xb87c('0x23')&&typeof _0x410810[_0xb87c('0x24')]===_0xb87c('0x23');var _0x35c292=_0x43d5ca[_0xb87c('0x25')];var _0x59f301=_0x4948a4?0x0:_0x410810[_0xb87c('0x26')];var _0x55a4c4=_0x4948a4?_0x43d5ca[_0xb87c('0x25')]:_0x410810[_0xb87c('0x26')]+_0x410810[_0xb87c('0x24')];var _0x3b2b9d;if(_0x55a4c4>=_0x35c292){_0x55a4c4=_0x35c292;_0x3b2b9d=0xc8;}else{_0x3b2b9d=0xce;}_0x23c476['status'](_0x3b2b9d);return _0x23c476[_0xb87c('0x27')](_0xb87c('0x28'),_0x59f301+'-'+_0x55a4c4+'/'+_0x35c292)[_0xb87c('0x22')](_0x43d5ca);}return null;};}function patchUpdates(_0x3fe03a){return function(_0x4f41fc){try{jsonpatch[_0xb87c('0x29')](_0x4f41fc,_0x3fe03a,!![]);}catch(_0x4f7ad4){return BPromise[_0xb87c('0x2a')](_0x4f7ad4);}return _0x4f41fc[_0xb87c('0x2b')]();};}function saveUpdates(_0x398e1b,_0x372b2b){return function(_0x2066ff){if(_0x2066ff){return _0x2066ff[_0xb87c('0x2c')](_0x398e1b)['then'](function(_0x131960){return _0x131960;});}return null;};}function removeEntity(_0x1038a3,_0x399f0e){return function(_0x425ac6){if(_0x425ac6){return _0x425ac6['destroy']()[_0xb87c('0x2d')](function(){var _0x3dab69=_0x425ac6['get']({'plain':!![]});var _0x3b6d63='Lists';return db[_0xb87c('0x2e')][_0xb87c('0x2f')]({'where':{'type':_0x3b6d63,'resourceId':_0x3dab69['id']}})['then'](function(){return _0x425ac6;});})['then'](function(){_0x1038a3[_0xb87c('0x21')](0xcc)[_0xb87c('0x30')]();});}};}function handleEntityNotFound(_0x3fb2d2,_0x260db9){return function(_0x3ec57b){if(!_0x3ec57b){_0x3fb2d2['sendStatus'](0x194);}return _0x3ec57b;};}function handleError(_0x3fafd9,_0x31defa){_0x31defa=_0x31defa||0x1f4;return function(_0x286975){logger[_0xb87c('0x31')](_0x286975[_0xb87c('0x32')]);if(_0x286975[_0xb87c('0x33')]){delete _0x286975[_0xb87c('0x33')];}_0x3fafd9[_0xb87c('0x21')](_0x31defa)[_0xb87c('0x34')](_0x286975);};}exports['index']=function(_0xe837e,_0x351f7e){var _0x28fd70={},_0x4aa9cd={},_0x3d7257={'count':0x0,'rows':[]};var _0x2ccf52=_['map'](db[_0xb87c('0x35')][_0xb87c('0x36')],function(_0x4be854){return{'name':_0x4be854[_0xb87c('0x37')],'type':_0x4be854[_0xb87c('0x38')]['key']};});_0x4aa9cd[_0xb87c('0x39')]=_[_0xb87c('0x3a')](_0x2ccf52,_0xb87c('0x33'));_0x4aa9cd['query']=_[_0xb87c('0x3b')](_0xe837e[_0xb87c('0x3c')]);_0x4aa9cd[_0xb87c('0x3d')]=_[_0xb87c('0x3e')](_0x4aa9cd[_0xb87c('0x39')],_0x4aa9cd[_0xb87c('0x3c')]);_0x28fd70['attributes']=_[_0xb87c('0x3e')](_0x4aa9cd['model'],qs['fields'](_0xe837e[_0xb87c('0x3c')][_0xb87c('0x3f')]));_0x28fd70['attributes']=_0x28fd70[_0xb87c('0x40')][_0xb87c('0x41')]?_0x28fd70[_0xb87c('0x40')]:_0x4aa9cd[_0xb87c('0x39')];if(!_0xe837e[_0xb87c('0x3c')][_0xb87c('0x42')](_0xb87c('0x43'))){_0x28fd70[_0xb87c('0x24')]=qs[_0xb87c('0x24')](_0xe837e[_0xb87c('0x3c')][_0xb87c('0x24')]);_0x28fd70[_0xb87c('0x26')]=qs[_0xb87c('0x26')](_0xe837e[_0xb87c('0x3c')][_0xb87c('0x26')]);}_0x28fd70['order']=qs['sort'](_0xe837e[_0xb87c('0x3c')]['sort']);_0x28fd70[_0xb87c('0x44')]=qs[_0xb87c('0x3d')](_[_0xb87c('0x45')](_0xe837e[_0xb87c('0x3c')],_0x4aa9cd['filters']),_0x2ccf52);if(_0xe837e['query'][_0xb87c('0x46')]){_0x28fd70['where']=_[_0xb87c('0x47')](_0x28fd70['where'],{'$or':_[_0xb87c('0x3a')](_0x2ccf52,function(_0x2026c3){if(_0x2026c3['type']!==_0xb87c('0x48')){var _0x1519e2={};_0x1519e2[_0x2026c3[_0xb87c('0x33')]]={'$like':'%'+_0xe837e[_0xb87c('0x3c')][_0xb87c('0x46')]+'%'};return _0x1519e2;}})});}_0x28fd70=_[_0xb87c('0x47')]({},_0x28fd70,_0xe837e[_0xb87c('0x49')]);var _0x28603e={'where':_0x28fd70['where']};return db[_0xb87c('0x35')][_0xb87c('0x25')](_0x28603e)[_0xb87c('0x2d')](function(_0xdcfe3a){_0x3d7257[_0xb87c('0x25')]=_0xdcfe3a;if(_0xe837e['query']['includeAll']){_0x28fd70['include']=[{'all':!![]}];}return db[_0xb87c('0x35')][_0xb87c('0x4a')](_0x28fd70);})[_0xb87c('0x2d')](function(_0x50842d){_0x3d7257['rows']=_0x50842d;return _0x3d7257;})[_0xb87c('0x2d')](respondWithFilteredResult(_0x351f7e,_0x28fd70))[_0xb87c('0x4b')](handleError(_0x351f7e,null));};exports['show']=function(_0x39ec7e,_0x56e3a2){var _0x232469={'raw':![],'where':{'id':_0x39ec7e[_0xb87c('0x4c')]['id']}},_0x1605cd={};_0x1605cd[_0xb87c('0x39')]=_[_0xb87c('0x3b')](db[_0xb87c('0x35')][_0xb87c('0x36')]);_0x1605cd[_0xb87c('0x3c')]=_[_0xb87c('0x3b')](_0x39ec7e[_0xb87c('0x3c')]);_0x1605cd['filters']=_[_0xb87c('0x3e')](_0x1605cd[_0xb87c('0x39')],_0x1605cd[_0xb87c('0x3c')]);_0x232469[_0xb87c('0x40')]=_[_0xb87c('0x3e')](_0x1605cd[_0xb87c('0x39')],qs[_0xb87c('0x3f')](_0x39ec7e[_0xb87c('0x3c')]['fields']));_0x232469['attributes']=_0x232469[_0xb87c('0x40')][_0xb87c('0x41')]?_0x232469[_0xb87c('0x40')]:_0x1605cd[_0xb87c('0x39')];if(_0x39ec7e[_0xb87c('0x3c')][_0xb87c('0x4d')]){_0x232469['include']=[{'all':!![]}];}_0x232469=_[_0xb87c('0x47')]({},_0x232469,_0x39ec7e[_0xb87c('0x49')]);return db['CmList'][_0xb87c('0x4e')](_0x232469)[_0xb87c('0x2d')](handleEntityNotFound(_0x56e3a2,null))[_0xb87c('0x2d')](respondWithResult(_0x56e3a2,null))[_0xb87c('0x4b')](handleError(_0x56e3a2,null));};exports[_0xb87c('0x4f')]=function(_0x41d273,_0x3fceb1){return db[_0xb87c('0x35')][_0xb87c('0x4f')](_0x41d273[_0xb87c('0x50')],{})[_0xb87c('0x2d')](function(_0x3d5237){var _0x5bbcf3=_0x41d273[_0xb87c('0x51')][_0xb87c('0x52')]({'plain':!![]});if(!_0x5bbcf3)throw new Error(_0xb87c('0x53'));if(_0x5bbcf3[_0xb87c('0x54')]==='user'){var _0x439c36=_0x3d5237['get']({'plain':!![]});var _0x1859cf=_0xb87c('0x55');return db[_0xb87c('0x56')][_0xb87c('0x4e')]({'where':{'name':_0x1859cf,'userProfileId':_0x5bbcf3['userProfileId']},'raw':!![]})[_0xb87c('0x2d')](function(_0x241cde){if(_0x241cde&&_0x241cde[_0xb87c('0x57')]===0x0){return db[_0xb87c('0x2e')][_0xb87c('0x4f')]({'name':_0x439c36['name'],'resourceId':_0x439c36['id'],'type':_0x241cde[_0xb87c('0x33')],'sectionId':_0x241cde['id']},{})[_0xb87c('0x2d')](function(){return _0x3d5237;});}else{return _0x3d5237;}})[_0xb87c('0x4b')](function(_0x20cbc3){logger[_0xb87c('0x31')](_0xb87c('0x58'),_0x20cbc3);throw _0x20cbc3;});}return _0x3d5237;})['then'](respondWithResult(_0x3fceb1,0xc9))[_0xb87c('0x4b')](handleError(_0x3fceb1,null));};exports['update']=function(_0x2ae09e,_0x183a41){if(_0x2ae09e['body']['id']){delete _0x2ae09e[_0xb87c('0x50')]['id'];}return db[_0xb87c('0x35')][_0xb87c('0x4e')]({'where':{'id':_0x2ae09e[_0xb87c('0x4c')]['id']}})[_0xb87c('0x2d')](handleEntityNotFound(_0x183a41,null))[_0xb87c('0x2d')](saveUpdates(_0x2ae09e['body'],null))[_0xb87c('0x2d')](respondWithResult(_0x183a41,null))[_0xb87c('0x4b')](handleError(_0x183a41,null));};exports[_0xb87c('0x2f')]=function(_0x5cd768,_0x54c148){return db[_0xb87c('0x35')][_0xb87c('0x4e')]({'where':{'id':_0x5cd768['params']['id']}})[_0xb87c('0x2d')](handleEntityNotFound(_0x54c148,null))['then'](removeEntity(_0x54c148,null))['catch'](handleError(_0x54c148,null));};exports[_0xb87c('0x59')]=function(_0x541af1,_0x1f67e5){return db[_0xb87c('0x35')]['describe']()[_0xb87c('0x2d')](respondWithResult(_0x1f67e5,null))[_0xb87c('0x4b')](handleError(_0x1f67e5,null));};exports['addDisposition']=function(_0x14a29d,_0xbfe04c,_0x14bea4){if(_0x14a29d[_0xb87c('0x50')]['id']){delete _0x14a29d[_0xb87c('0x50')]['id'];}return db[_0xb87c('0x35')]['find']({'where':{'id':_0x14a29d[_0xb87c('0x4c')]['id']}})[_0xb87c('0x2d')](handleEntityNotFound(_0xbfe04c,null))[_0xb87c('0x2d')](function(_0x117cc4){if(_0x117cc4){_0x14a29d[_0xb87c('0x50')][_0xb87c('0x5a')]=_0x117cc4['id'];return db[_0xb87c('0x5b')][_0xb87c('0x4f')](_0x14a29d['body']);}})[_0xb87c('0x2d')](respondWithResult(_0xbfe04c,null))[_0xb87c('0x4b')](handleError(_0xbfe04c,null));};exports[_0xb87c('0x5c')]=function(_0x4acc2a,_0x2f385b,_0x536d8f){var _0x5963d4={'raw':![],'where':{}};var _0x30817d={};var _0x4adc6e={'count':0x0,'rows':[]};return db[_0xb87c('0x35')]['findOne']({'where':{'id':_0x4acc2a[_0xb87c('0x4c')]['id']}})[_0xb87c('0x2d')](handleEntityNotFound(_0x2f385b,null))['then'](function(_0xa67238){if(_0xa67238){_0x30817d[_0xb87c('0x39')]=_[_0xb87c('0x3b')](db[_0xb87c('0x5b')][_0xb87c('0x36')]);_0x30817d['query']=_[_0xb87c('0x3b')](_0x4acc2a['query']);_0x30817d[_0xb87c('0x3d')]=_[_0xb87c('0x3e')](_0x30817d[_0xb87c('0x39')],_0x30817d['query']);_0x5963d4[_0xb87c('0x40')]=_[_0xb87c('0x3e')](_0x30817d[_0xb87c('0x39')],qs[_0xb87c('0x3f')](_0x4acc2a[_0xb87c('0x3c')][_0xb87c('0x3f')]));_0x5963d4['attributes']=_0x5963d4[_0xb87c('0x40')][_0xb87c('0x41')]?_0x5963d4[_0xb87c('0x40')]:_0x30817d['model'];if(!_0x4acc2a[_0xb87c('0x3c')][_0xb87c('0x42')]('nolimit')){_0x5963d4[_0xb87c('0x24')]=qs[_0xb87c('0x24')](_0x4acc2a[_0xb87c('0x3c')][_0xb87c('0x24')]);_0x5963d4[_0xb87c('0x26')]=qs[_0xb87c('0x26')](_0x4acc2a[_0xb87c('0x3c')][_0xb87c('0x26')]);}_0x5963d4['order']=qs[_0xb87c('0x5d')](_0x4acc2a[_0xb87c('0x3c')]['sort']);_0x5963d4[_0xb87c('0x44')]=qs[_0xb87c('0x3d')](_[_0xb87c('0x45')](_0x4acc2a['query'],_0x30817d['filters']));_0x5963d4[_0xb87c('0x44')][_0xb87c('0x5a')]=_0xa67238['id'];if(_0x4acc2a[_0xb87c('0x3c')][_0xb87c('0x46')]){_0x5963d4[_0xb87c('0x44')]=_['merge'](_0x5963d4[_0xb87c('0x44')],{'$or':_[_0xb87c('0x3a')](_0x5963d4[_0xb87c('0x40')],function(_0x1359d2){var _0x27bd87={};_0x27bd87[_0x1359d2]={'$like':'%'+_0x4acc2a[_0xb87c('0x3c')][_0xb87c('0x46')]+'%'};return _0x27bd87;})});}_0x5963d4=_[_0xb87c('0x47')]({},_0x5963d4,_0x4acc2a[_0xb87c('0x49')]);return db[_0xb87c('0x5b')][_0xb87c('0x25')]({'where':_0x5963d4[_0xb87c('0x44')]})[_0xb87c('0x2d')](function(_0x4cb8ff){_0x4adc6e[_0xb87c('0x25')]=_0x4cb8ff;if(_0x4acc2a[_0xb87c('0x3c')][_0xb87c('0x4d')]){_0x5963d4['include']=[{'all':!![]}];}return db[_0xb87c('0x5b')][_0xb87c('0x4a')](_0x5963d4);})[_0xb87c('0x2d')](function(_0x4b5af9){_0x4adc6e[_0xb87c('0x5e')]=_0x4b5af9;return _0x4adc6e;});}})['then'](respondWithFilteredResult(_0x2f385b,_0x5963d4))[_0xb87c('0x4b')](handleError(_0x2f385b,null));};exports[_0xb87c('0x5f')]=function(_0x1d4d8a,_0x1a1eff,_0x2873e3){return db[_0xb87c('0x35')][_0xb87c('0x4e')]({'where':{'id':_0x1d4d8a['params']['id']}})['then'](handleEntityNotFound(_0x1a1eff,null))[_0xb87c('0x2d')](function(_0x38f886){if(_0x38f886){return _0x38f886[_0xb87c('0x5f')](_0x1d4d8a[_0xb87c('0x3c')]['ids']);}})[_0xb87c('0x2d')](respondWithStatusCode(_0x1a1eff,null))[_0xb87c('0x4b')](handleError(_0x1a1eff,null));};exports['addContacts']=function(_0x1d8c89,_0x1f4004,_0x3cf2e3){return db['CmList'][_0xb87c('0x4e')]({'where':{'id':_0x1d8c89['params']['id']}})[_0xb87c('0x2d')](handleEntityNotFound(_0x1f4004,null))[_0xb87c('0x2d')](function(_0x545c97){if(_0x545c97){var _0x3e62eb=[];var _0x1852c0={'success':[],'errors':[]};return db[_0xb87c('0x60')][_0xb87c('0x59')]()[_0xb87c('0x2d')](function(_0x19ad5e){if(_0x1d8c89['body'][_0xb87c('0x61')]&&_['isArray'](_0x1d8c89[_0xb87c('0x50')][_0xb87c('0x61')])){if(_0x1d8c89[_0xb87c('0x50')][_0xb87c('0x61')]['length']){_0x1d8c89[_0xb87c('0x50')][_0xb87c('0x61')]=_0x1d8c89[_0xb87c('0x50')]['tags'][_0xb87c('0x62')](';')+';';}else{_0x1d8c89['body'][_0xb87c('0x61')]=null;}}else{_0x1d8c89[_0xb87c('0x50')][_0xb87c('0x61')]=null;}if(_0x1d8c89[_0xb87c('0x50')]&&_[_0xb87c('0x63')](_0x1d8c89[_0xb87c('0x50')])){for(var _0x334432=0x0;_0x334432<_0x1d8c89[_0xb87c('0x50')][_0xb87c('0x41')];_0x334432+=0x1){_0x1d8c89[_0xb87c('0x50')][_0x334432]['ListId']=_0x1d8c89['params']['id'];_0x3e62eb['push'](_0x1d8c89[_0xb87c('0x50')][_0x334432]);}return BPromise[_0xb87c('0x64')](_0x3e62eb,function(_0x44c38f){return db[_0xb87c('0x60')][_0xb87c('0x4f')](_[_0xb87c('0x65')](_0x44c38f,[_0xb87c('0x66'),'id'])||{},{'fields':_[_0xb87c('0x3b')](_0x19ad5e),'raw':!![]})['then'](function(_0x46f8bc){_0x1852c0[_0xb87c('0x67')]['push'](_0x46f8bc[_0xb87c('0x68')]);})[_0xb87c('0x4b')](function(_0x3fac0b){_0x1852c0[_0xb87c('0x69')][_0xb87c('0x6a')]({'data':_0x44c38f,'error':_0x3fac0b['message']});});})[_0xb87c('0x2d')](function(_0xfb30e1){return _0x1852c0;})[_0xb87c('0x4b')](function(_0x3ffb15){return _0x3ffb15;});}else{_0x1f4004[_0xb87c('0x21')](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0x1f4004,null))[_0xb87c('0x4b')](handleError(_0x1f4004,null));};exports[_0xb87c('0x6b')]=function(_0x2ad7e8,_0x16e6ae,_0x481fce){var _0xda037;return db[_0xb87c('0x35')][_0xb87c('0x4e')]({'where':{'id':_0x2ad7e8[_0xb87c('0x4c')]['id']},'include':[{'model':db[_0xb87c('0x6c')],'as':'CustomFields'}]})[_0xb87c('0x2d')](handleEntityNotFound(_0x16e6ae,null))[_0xb87c('0x2d')](function(_0x567cc1){if(_0x567cc1){_0xda037=_0x567cc1;return db['CmContact']['rawAttributes'];}})['then'](function(_0x560468){if(_0x560468){var _0x110123={};var _0x586bfe={};_0x586bfe[_0xb87c('0x39')]=_[_0xb87c('0x6d')](_['keys'](_0x560468),_['map'](_0xda037[_0xb87c('0x6e')],function(_0x59980a){return util[_0xb87c('0x6f')]('cf_%d',_0x59980a['id']);}));_0x586bfe[_0xb87c('0x3c')]=_[_0xb87c('0x3b')](_0x2ad7e8[_0xb87c('0x3c')]);_0x586bfe['filters']=_[_0xb87c('0x3e')](_0x586bfe[_0xb87c('0x39')],_0x586bfe['query']);_0x110123[_0xb87c('0x40')]=_[_0xb87c('0x3e')](_0x586bfe[_0xb87c('0x39')],qs[_0xb87c('0x3f')](_0x2ad7e8[_0xb87c('0x3c')][_0xb87c('0x3f')]));_0x110123[_0xb87c('0x40')]=_0x110123[_0xb87c('0x40')]['length']?_0x110123['attributes']:_0x586bfe[_0xb87c('0x39')];if(!_0x2ad7e8[_0xb87c('0x3c')][_0xb87c('0x42')]('nolimit')){_0x110123[_0xb87c('0x24')]=qs[_0xb87c('0x24')](_0x2ad7e8[_0xb87c('0x3c')][_0xb87c('0x24')]);_0x110123['offset']=qs['offset'](_0x2ad7e8['query'][_0xb87c('0x26')]);}_0x110123[_0xb87c('0x70')]=qs[_0xb87c('0x5d')](_0x2ad7e8[_0xb87c('0x3c')][_0xb87c('0x5d')]);_0x110123[_0xb87c('0x44')]=qs[_0xb87c('0x3d')](_[_0xb87c('0x45')](_0x2ad7e8[_0xb87c('0x3c')],_0x586bfe[_0xb87c('0x3d')]));_0x110123[_0xb87c('0x71')]=!![];if(_0x2ad7e8[_0xb87c('0x3c')]['filter']){_0x110123[_0xb87c('0x44')]=_[_0xb87c('0x47')](_0x110123['where'],{'$or':_[_0xb87c('0x3a')](_0x110123[_0xb87c('0x40')],function(_0x53fedc){var _0x5b8abe={};_0x5b8abe[_0x53fedc]={'$like':'%'+_0x2ad7e8[_0xb87c('0x3c')][_0xb87c('0x46')]+'%'};return _0x5b8abe;})});}_0x110123=_[_0xb87c('0x47')]({},_0x110123,_0x2ad7e8[_0xb87c('0x49')]);return _0xda037[_0xb87c('0x6b')](_0x110123);}})[_0xb87c('0x2d')](respondWithResult(_0x16e6ae,null))['catch'](handleError(_0x16e6ae,null));};exports[_0xb87c('0x72')]=function(_0x344682,_0xf230f3,_0x5a095f){var _0x4058c1;return db[_0xb87c('0x35')][_0xb87c('0x4e')]({'where':{'id':_0x344682['params']['id']},'include':[{'model':db[_0xb87c('0x6c')],'as':_0xb87c('0x6e')}]})['then'](handleEntityNotFound(_0xf230f3,null))[_0xb87c('0x2d')](function(_0x298dbf){if(_0x298dbf){_0x4058c1=_0x298dbf;return db[_0xb87c('0x60')]['rawAttributes'];}})[_0xb87c('0x2d')](function(_0x8338a9){if(_0x8338a9){var _0x170673={};var _0x2e091a={};_0x2e091a['model']=_[_0xb87c('0x6d')](_[_0xb87c('0x3b')](_0x8338a9),_[_0xb87c('0x3a')](_0x4058c1[_0xb87c('0x6e')],function(_0x1f07af){return util['format'](_0xb87c('0x73'),_0x1f07af['id']);}));_0x2e091a[_0xb87c('0x3c')]=_[_0xb87c('0x3b')](_0x344682['query']);_0x2e091a[_0xb87c('0x3d')]=_[_0xb87c('0x3e')](_0x2e091a[_0xb87c('0x39')],_0x2e091a[_0xb87c('0x3c')]);_0x170673[_0xb87c('0x40')]=_[_0xb87c('0x3e')](_0x2e091a['model'],qs['fields'](_0x344682[_0xb87c('0x3c')][_0xb87c('0x3f')]));_0x170673[_0xb87c('0x40')]=_0x170673[_0xb87c('0x40')][_0xb87c('0x41')]?_0x170673[_0xb87c('0x40')]:_0x2e091a['model'];if(!_0x344682[_0xb87c('0x3c')][_0xb87c('0x42')]('nolimit')){_0x170673[_0xb87c('0x24')]=qs[_0xb87c('0x24')](_0x344682['query'][_0xb87c('0x24')]);_0x170673[_0xb87c('0x26')]=qs[_0xb87c('0x26')](_0x344682[_0xb87c('0x3c')][_0xb87c('0x26')]);}_0x170673['order']=qs[_0xb87c('0x5d')](_0x344682['query']['sort']);_0x170673[_0xb87c('0x44')]=qs[_0xb87c('0x3d')](_[_0xb87c('0x45')](_0x344682[_0xb87c('0x3c')],_0x2e091a[_0xb87c('0x3d')]));_0x170673[_0xb87c('0x71')]=!![];if(_0x344682[_0xb87c('0x3c')][_0xb87c('0x46')]){_0x170673[_0xb87c('0x44')]=_[_0xb87c('0x47')](_0x170673['where'],{'$or':_[_0xb87c('0x3a')](_0x170673['attributes'],function(_0xc0dd3b){var _0x5247c3={};_0x5247c3[_0xc0dd3b]={'$like':'%'+_0x344682[_0xb87c('0x3c')][_0xb87c('0x46')]+'%'};return _0x5247c3;})});}_0x170673=_[_0xb87c('0x47')]({},_0x170673,_0x344682[_0xb87c('0x49')]);return _0x4058c1['getContacts'](_0x170673);}})['then'](function(_0x2959ad){if(!_[_0xb87c('0x74')](_0x2959ad)){var _0x50b71b=toCsv(_0x2959ad);var _0x4e1f07=Date[_0xb87c('0x75')]();fs['writeFileSync'](util[_0xb87c('0x6f')](_0xb87c('0x76'),_0x4058c1['id'],_0x4e1f07),_0x50b71b);_0xf230f3[_0xb87c('0x77')]('Content-disposition','attachment;\x20filename='+util[_0xb87c('0x6f')]('list_%d_%s.csv',_0x4058c1['id'],_0x4e1f07));_0xf230f3[_0xb87c('0x77')]('Content-type',_0xb87c('0x78'));return _0xf230f3['download'](util[_0xb87c('0x6f')](_0xb87c('0x76'),_0x4058c1['id'],_0x4e1f07));}else{return _0xf230f3[_0xb87c('0x20')](0xcc);}})[_0xb87c('0x4b')](handleError(_0xf230f3,null));};exports[_0xb87c('0x79')]=function(_0x58cba1,_0x5bf959,_0x584e2d){var _0x40e4fb;delete _0x58cba1[_0xb87c('0x50')]['id'];return db[_0xb87c('0x35')][_0xb87c('0x7a')]({'where':{'id':_0x58cba1[_0xb87c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5bf959,null))[_0xb87c('0x2d')](function(_0xf8a2dc){if(_0xf8a2dc){return db[_0xb87c('0x7b')]['transaction'](function(_0x3de3da){return db[_0xb87c('0x6c')][_0xb87c('0x4f')](_0x58cba1[_0xb87c('0x50')],{'transaction':_0x3de3da})[_0xb87c('0x2d')](function(_0x4b8bc2){_0x40e4fb=_0x4b8bc2;return _0xf8a2dc['addCustomFields'](_0x4b8bc2,{'transaction':_0x3de3da});})[_0xb87c('0x2d')](function(){var _0x423f5e={'type':db[_0xb87c('0x7c')][_0xb87c('0x7d')],'transaction':_0x3de3da};switch(_0x58cba1[_0xb87c('0x50')][_0xb87c('0x38')]){case _0xb87c('0x7e'):_0x423f5e[_0xb87c('0x38')]=db['Sequelize'][_0xb87c('0x7d')];break;case _0xb87c('0x7f'):_0x423f5e[_0xb87c('0x38')]=db[_0xb87c('0x7c')][_0xb87c('0x80')];break;case _0xb87c('0x81'):_0x423f5e[_0xb87c('0x38')]=db[_0xb87c('0x7c')][_0xb87c('0x82')];_0x423f5e[_0xb87c('0x83')]=![];break;default:}return db[_0xb87c('0x7b')]['queryInterface'][_0xb87c('0x84')]('cm_contacts',util[_0xb87c('0x6f')]('cf_%s',_0x40e4fb['id']),_0x423f5e);})[_0xb87c('0x2d')](function(){return _0x40e4fb;});});}})['then'](respondWithResult(_0x5bf959,null))['catch'](handleError(_0x5bf959,null));};exports['getCustomFields']=function(_0x45d382,_0x45a584,_0x37c3fd){var _0x500b48={};var _0x51698f={};var _0x72ea18;var _0x4c1699;return db[_0xb87c('0x35')]['findOne']({'where':{'id':_0x45d382[_0xb87c('0x4c')]['id']}})[_0xb87c('0x2d')](handleEntityNotFound(_0x45a584,null))[_0xb87c('0x2d')](function(_0xb2c9cd){if(_0xb2c9cd){_0x72ea18=_0xb2c9cd;_0x51698f[_0xb87c('0x39')]=_['keys'](db[_0xb87c('0x6c')][_0xb87c('0x36')]);_0x51698f[_0xb87c('0x3c')]=_['keys'](_0x45d382[_0xb87c('0x3c')]);_0x51698f[_0xb87c('0x3d')]=_[_0xb87c('0x3e')](_0x51698f[_0xb87c('0x39')],_0x51698f[_0xb87c('0x3c')]);_0x500b48['attributes']=_[_0xb87c('0x3e')](_0x51698f['model'],qs[_0xb87c('0x3f')](_0x45d382[_0xb87c('0x3c')][_0xb87c('0x3f')]));_0x500b48[_0xb87c('0x40')]=_0x500b48[_0xb87c('0x40')]['length']?_0x500b48[_0xb87c('0x40')]:_0x51698f[_0xb87c('0x39')];_0x500b48[_0xb87c('0x70')]=qs[_0xb87c('0x5d')](_0x45d382[_0xb87c('0x3c')][_0xb87c('0x5d')]);_0x500b48['where']=qs[_0xb87c('0x3d')](_['pick'](_0x45d382['query'],_0x51698f[_0xb87c('0x3d')]));_0x500b48['where']=_[_0xb87c('0x47')](_0x500b48[_0xb87c('0x44')],{'$or':[{'ListId':_0xb2c9cd['id']},{'ListId':null}]});if(_0x45d382['query'][_0xb87c('0x46')]){_0x500b48[_0xb87c('0x44')]=_[_0xb87c('0x47')](_0x500b48[_0xb87c('0x44')],{'$or':_['map'](_0x500b48[_0xb87c('0x40')],function(_0x3a8799){var _0x45cf98={};_0x45cf98[_0x3a8799]={'$like':'%'+_0x45d382[_0xb87c('0x3c')][_0xb87c('0x46')]+'%'};return _0x45cf98;})});}_0x500b48=_['merge']({},_0x500b48,_0x45d382[_0xb87c('0x49')]);return db[_0xb87c('0x6c')][_0xb87c('0x85')](_0x500b48);}})[_0xb87c('0x2d')](respondWithResult(_0x45a584,null))['catch'](handleError(_0x45a584,null));};exports[_0xb87c('0x86')]=function(_0x203b61,_0x40b375,_0x10c606){return db['CmList'][_0xb87c('0x4e')]({'where':{'id':_0x203b61[_0xb87c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x40b375,null))[_0xb87c('0x2d')](function(_0x1071bd){if(_0x1071bd){return _0x1071bd['addAgents'](_0x203b61['body']['ids'],_[_0xb87c('0x65')](_0x203b61[_0xb87c('0x50')],[_0xb87c('0x66'),'id'])||{})[_0xb87c('0x87')](function(_0x304632){for(var _0x28bf88=0x0;_0x28bf88<_0x203b61[_0xb87c('0x50')]['ids'][_0xb87c('0x41')];_0x28bf88+=0x1){socket[_0xb87c('0x88')](_0xb87c('0x89'),{'UserId':Number(_0x203b61[_0xb87c('0x50')][_0xb87c('0x66')][_0x28bf88]),'CmListId':Number(_0x203b61[_0xb87c('0x4c')]['id'])});}return _0x304632;});}})[_0xb87c('0x2d')](respondWithResult(_0x40b375,null))[_0xb87c('0x4b')](handleError(_0x40b375,null));};exports[_0xb87c('0x8a')]=function(_0xdea6fe,_0x26a5c1,_0x418d0b){return db['CmList'][_0xb87c('0x4e')]({'where':{'id':_0xdea6fe[_0xb87c('0x4c')]['id']}})[_0xb87c('0x2d')](handleEntityNotFound(_0x26a5c1,null))['then'](function(_0x24184f){if(_0x24184f){return _0x24184f[_0xb87c('0x8a')](_0xdea6fe[_0xb87c('0x3c')][_0xb87c('0x66')])['then'](function(){if(_['isArray'](_0xdea6fe[_0xb87c('0x3c')]['ids'])){for(var _0x5d7ae5=0x0;_0x5d7ae5<_0xdea6fe['query'][_0xb87c('0x66')][_0xb87c('0x41')];_0x5d7ae5+=0x1){socket[_0xb87c('0x88')](_0xb87c('0x8b'),{'UserId':Number(_0xdea6fe['query'][_0xb87c('0x66')][_0x5d7ae5]),'CmListId':Number(_0xdea6fe[_0xb87c('0x4c')]['id'])});}}else{socket[_0xb87c('0x88')](_0xb87c('0x8b'),{'UserId':Number(_0xdea6fe['query'][_0xb87c('0x66')]),'CmListId':Number(_0xdea6fe['params']['id'])});}});}})[_0xb87c('0x2d')](respondWithStatusCode(_0x26a5c1,null))[_0xb87c('0x4b')](handleError(_0x26a5c1,null));};exports[_0xb87c('0x8c')]=function(_0x26b9f5,_0x7d47e5,_0x48feac){var _0x438c51={};var _0x5a525a={};var _0x18f4bf;var _0x1275bf;return db['CmList'][_0xb87c('0x7a')]({'where':{'id':_0x26b9f5[_0xb87c('0x4c')]['id']}})[_0xb87c('0x2d')](handleEntityNotFound(_0x7d47e5,null))[_0xb87c('0x2d')](function(_0x43fe7f){if(_0x43fe7f){_0x18f4bf=_0x43fe7f;_0x5a525a[_0xb87c('0x39')]=_['keys'](db['User'][_0xb87c('0x36')]);_0x5a525a[_0xb87c('0x3c')]=_['keys'](_0x26b9f5['query']);_0x5a525a['filters']=_[_0xb87c('0x3e')](_0x5a525a['model'],_0x5a525a['query']);_0x438c51[_0xb87c('0x40')]=_[_0xb87c('0x3e')](_0x5a525a[_0xb87c('0x39')],qs['fields'](_0x26b9f5[_0xb87c('0x3c')][_0xb87c('0x3f')]));_0x438c51[_0xb87c('0x40')]=_0x438c51[_0xb87c('0x40')][_0xb87c('0x41')]?_0x438c51[_0xb87c('0x40')]:_0x5a525a[_0xb87c('0x39')];_0x438c51[_0xb87c('0x70')]=qs[_0xb87c('0x5d')](_0x26b9f5[_0xb87c('0x3c')][_0xb87c('0x5d')]);_0x438c51[_0xb87c('0x44')]=qs[_0xb87c('0x3d')](_[_0xb87c('0x45')](_0x26b9f5[_0xb87c('0x3c')],_0x5a525a[_0xb87c('0x3d')]));if(_0x26b9f5[_0xb87c('0x3c')][_0xb87c('0x46')]){_0x438c51[_0xb87c('0x44')]=_[_0xb87c('0x47')](_0x438c51[_0xb87c('0x44')],{'$or':_[_0xb87c('0x3a')](_0x438c51[_0xb87c('0x40')],function(_0x28ace3){var _0x34eed6={};_0x34eed6[_0x28ace3]={'$like':'%'+_0x26b9f5[_0xb87c('0x3c')]['filter']+'%'};return _0x34eed6;})});}_0x438c51=_['merge']({},_0x438c51,_0x26b9f5[_0xb87c('0x49')]);return _0x18f4bf[_0xb87c('0x8c')](_0x438c51);}})[_0xb87c('0x2d')](function(_0x5e59c3){if(_0x5e59c3){_0x1275bf=_0x5e59c3[_0xb87c('0x41')];if(!_0x26b9f5[_0xb87c('0x3c')][_0xb87c('0x42')](_0xb87c('0x43'))){_0x438c51[_0xb87c('0x24')]=qs[_0xb87c('0x24')](_0x26b9f5[_0xb87c('0x3c')][_0xb87c('0x24')]);_0x438c51[_0xb87c('0x26')]=qs[_0xb87c('0x26')](_0x26b9f5[_0xb87c('0x3c')]['offset']);}return _0x18f4bf['getAgents'](_0x438c51);}})[_0xb87c('0x2d')](function(_0x47b3d1){if(_0x47b3d1){return _0x47b3d1?{'count':_0x1275bf,'rows':_0x47b3d1}:null;}})[_0xb87c('0x2d')](respondWithResult(_0x7d47e5,null))[_0xb87c('0x4b')](handleError(_0x7d47e5,null));}; \ No newline at end of file +var _0x5ae5=['cf_%d','raw','getContactsCsv','now','writeFileSync','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','INTEGER','BOOLEAN','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','name','send','index','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','CmList','includeAll','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','options','include','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','success','errors','message','getContacts','CmCustomField','concat','CustomFields','format'];(function(_0x4d43cb,_0x3b4cdf){var _0x2f32c5=function(_0x1ca2bc){while(--_0x1ca2bc){_0x4d43cb['push'](_0x4d43cb['shift']());}};_0x2f32c5(++_0x3b4cdf);}(_0x5ae5,0xae));var _0x55ae=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x5ae5[_0xb0f7c3];return _0x28ea68;};'use strict';var emlformat=require(_0x55ae('0x0'));var rimraf=require(_0x55ae('0x1'));var zipdir=require(_0x55ae('0x2'));var jsonpatch=require(_0x55ae('0x3'));var rp=require(_0x55ae('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x55ae('0x5'));var util=require(_0x55ae('0x6'));var path=require(_0x55ae('0x7'));var sox=require('sox');var csv=require(_0x55ae('0x8'));var ejs=require(_0x55ae('0x9'));var fs=require('fs');var fs_extra=require(_0x55ae('0xa'));var _=require('lodash');var squel=require(_0x55ae('0xb'));var crypto=require(_0x55ae('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x55ae('0xd'));var toCsv=require(_0x55ae('0x8'));var querystring=require(_0x55ae('0xe'));var Papa=require(_0x55ae('0xf'));var Redis=require(_0x55ae('0x10'));var authService=require(_0x55ae('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x55ae('0x12'))(_0x55ae('0x13'));var utils=require(_0x55ae('0x14'));var config=require(_0x55ae('0x15'));var licenseUtil=require(_0x55ae('0x16'));var db=require(_0x55ae('0x17'))['db'];config[_0x55ae('0x18')]=_['defaults'](config[_0x55ae('0x18')],{'host':_0x55ae('0x19'),'port':0x18eb});var socket=require(_0x55ae('0x1a'))(new Redis(config[_0x55ae('0x18')]));require(_0x55ae('0x1b'))['register'](socket);function respondWithStatusCode(_0x4e2b8d,_0x35a6d2){_0x35a6d2=_0x35a6d2||0xcc;return function(_0x19989b){if(_0x19989b){return _0x4e2b8d[_0x55ae('0x1c')](_0x35a6d2);}return _0x4e2b8d[_0x55ae('0x1d')](_0x35a6d2)[_0x55ae('0x1e')]();};}function respondWithResult(_0x40595c,_0x2ac6f2){_0x2ac6f2=_0x2ac6f2||0xc8;return function(_0x236f97){if(_0x236f97){return _0x40595c[_0x55ae('0x1d')](_0x2ac6f2)[_0x55ae('0x1f')](_0x236f97);}};}function respondWithFilteredResult(_0x51a42f,_0x5efb38){return function(_0x34baba){if(_0x34baba){var _0x26bd44=typeof _0x5efb38[_0x55ae('0x20')]===_0x55ae('0x21')&&typeof _0x5efb38[_0x55ae('0x22')]===_0x55ae('0x21');var _0x3c9052=_0x34baba[_0x55ae('0x23')];var _0x1636e1=_0x26bd44?0x0:_0x5efb38[_0x55ae('0x20')];var _0x151910=_0x26bd44?_0x34baba[_0x55ae('0x23')]:_0x5efb38[_0x55ae('0x20')]+_0x5efb38[_0x55ae('0x22')];var _0x1263b7;if(_0x151910>=_0x3c9052){_0x151910=_0x3c9052;_0x1263b7=0xc8;}else{_0x1263b7=0xce;}_0x51a42f[_0x55ae('0x1d')](_0x1263b7);return _0x51a42f[_0x55ae('0x24')](_0x55ae('0x25'),_0x1636e1+'-'+_0x151910+'/'+_0x3c9052)[_0x55ae('0x1f')](_0x34baba);}return null;};}function patchUpdates(_0x5114f8){return function(_0x5156c5){try{jsonpatch[_0x55ae('0x26')](_0x5156c5,_0x5114f8,!![]);}catch(_0x4ec661){return BPromise[_0x55ae('0x27')](_0x4ec661);}return _0x5156c5[_0x55ae('0x28')]();};}function saveUpdates(_0x3535e0,_0x243f20){return function(_0x308563){if(_0x308563){return _0x308563[_0x55ae('0x29')](_0x3535e0)[_0x55ae('0x2a')](function(_0x5d0147){return _0x5d0147;});}return null;};}function removeEntity(_0x834193,_0x4e51c3){return function(_0x5dac5b){if(_0x5dac5b){return _0x5dac5b[_0x55ae('0x2b')]()[_0x55ae('0x2a')](function(){var _0x4e72c4=_0x5dac5b[_0x55ae('0x2c')]({'plain':!![]});var _0x1621ba=_0x55ae('0x2d');return db[_0x55ae('0x2e')][_0x55ae('0x2b')]({'where':{'type':_0x1621ba,'resourceId':_0x4e72c4['id']}})[_0x55ae('0x2a')](function(){return _0x5dac5b;});})[_0x55ae('0x2a')](function(){_0x834193[_0x55ae('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26851d,_0x5733c0){return function(_0x37db29){if(!_0x37db29){_0x26851d[_0x55ae('0x1c')](0x194);}return _0x37db29;};}function handleError(_0x68f339,_0x3993a7){_0x3993a7=_0x3993a7||0x1f4;return function(_0x32c0ec){logger[_0x55ae('0x2f')](_0x32c0ec['stack']);if(_0x32c0ec[_0x55ae('0x30')]){delete _0x32c0ec[_0x55ae('0x30')];}_0x68f339[_0x55ae('0x1d')](_0x3993a7)[_0x55ae('0x31')](_0x32c0ec);};}exports[_0x55ae('0x32')]=function(_0x349f25,_0x421d97){var _0x5e227d={},_0xe8ef85={},_0x36ac4a={'count':0x0,'rows':[]};var _0x5156c4=_['map'](db['CmList'][_0x55ae('0x33')],function(_0x2c4086){return{'name':_0x2c4086['fieldName'],'type':_0x2c4086['type']['key']};});_0xe8ef85[_0x55ae('0x34')]=_['map'](_0x5156c4,_0x55ae('0x30'));_0xe8ef85[_0x55ae('0x35')]=_[_0x55ae('0x36')](_0x349f25[_0x55ae('0x35')]);_0xe8ef85[_0x55ae('0x37')]=_['intersection'](_0xe8ef85['model'],_0xe8ef85[_0x55ae('0x35')]);_0x5e227d[_0x55ae('0x38')]=_[_0x55ae('0x39')](_0xe8ef85['model'],qs[_0x55ae('0x3a')](_0x349f25[_0x55ae('0x35')][_0x55ae('0x3a')]));_0x5e227d[_0x55ae('0x38')]=_0x5e227d[_0x55ae('0x38')][_0x55ae('0x3b')]?_0x5e227d[_0x55ae('0x38')]:_0xe8ef85['model'];if(!_0x349f25[_0x55ae('0x35')][_0x55ae('0x3c')](_0x55ae('0x3d'))){_0x5e227d[_0x55ae('0x22')]=qs['limit'](_0x349f25[_0x55ae('0x35')][_0x55ae('0x22')]);_0x5e227d[_0x55ae('0x20')]=qs[_0x55ae('0x20')](_0x349f25[_0x55ae('0x35')][_0x55ae('0x20')]);}_0x5e227d[_0x55ae('0x3e')]=qs[_0x55ae('0x3f')](_0x349f25[_0x55ae('0x35')][_0x55ae('0x3f')]);_0x5e227d['where']=qs[_0x55ae('0x37')](_[_0x55ae('0x40')](_0x349f25[_0x55ae('0x35')],_0xe8ef85['filters']),_0x5156c4);if(_0x349f25[_0x55ae('0x35')][_0x55ae('0x41')]){_0x5e227d[_0x55ae('0x42')]=_[_0x55ae('0x43')](_0x5e227d[_0x55ae('0x42')],{'$or':_[_0x55ae('0x44')](_0x5156c4,function(_0x503e66){if(_0x503e66[_0x55ae('0x45')]!==_0x55ae('0x46')){var _0x2ac525={};_0x2ac525[_0x503e66['name']]={'$like':'%'+_0x349f25[_0x55ae('0x35')][_0x55ae('0x41')]+'%'};return _0x2ac525;}})});}_0x5e227d=_[_0x55ae('0x43')]({},_0x5e227d,_0x349f25['options']);var _0x5bf1a2={'where':_0x5e227d[_0x55ae('0x42')]};return db[_0x55ae('0x47')][_0x55ae('0x23')](_0x5bf1a2)[_0x55ae('0x2a')](function(_0x5556c8){_0x36ac4a[_0x55ae('0x23')]=_0x5556c8;if(_0x349f25['query'][_0x55ae('0x48')]){_0x5e227d['include']=[{'all':!![]}];}return db[_0x55ae('0x47')][_0x55ae('0x49')](_0x5e227d);})[_0x55ae('0x2a')](function(_0x66b548){_0x36ac4a['rows']=_0x66b548;return _0x36ac4a;})[_0x55ae('0x2a')](respondWithFilteredResult(_0x421d97,_0x5e227d))[_0x55ae('0x4a')](handleError(_0x421d97,null));};exports[_0x55ae('0x4b')]=function(_0x5b5921,_0x4dafde){var _0x2f3719={'raw':![],'where':{'id':_0x5b5921[_0x55ae('0x4c')]['id']}},_0x5bf88f={};_0x5bf88f[_0x55ae('0x34')]=_[_0x55ae('0x36')](db[_0x55ae('0x47')][_0x55ae('0x33')]);_0x5bf88f['query']=_[_0x55ae('0x36')](_0x5b5921[_0x55ae('0x35')]);_0x5bf88f[_0x55ae('0x37')]=_[_0x55ae('0x39')](_0x5bf88f[_0x55ae('0x34')],_0x5bf88f[_0x55ae('0x35')]);_0x2f3719[_0x55ae('0x38')]=_['intersection'](_0x5bf88f[_0x55ae('0x34')],qs['fields'](_0x5b5921[_0x55ae('0x35')][_0x55ae('0x3a')]));_0x2f3719[_0x55ae('0x38')]=_0x2f3719[_0x55ae('0x38')][_0x55ae('0x3b')]?_0x2f3719[_0x55ae('0x38')]:_0x5bf88f[_0x55ae('0x34')];if(_0x5b5921['query'][_0x55ae('0x48')]){_0x2f3719['include']=[{'all':!![]}];}_0x2f3719=_[_0x55ae('0x43')]({},_0x2f3719,_0x5b5921['options']);return db[_0x55ae('0x47')][_0x55ae('0x4d')](_0x2f3719)[_0x55ae('0x2a')](handleEntityNotFound(_0x4dafde,null))[_0x55ae('0x2a')](respondWithResult(_0x4dafde,null))['catch'](handleError(_0x4dafde,null));};exports[_0x55ae('0x4e')]=function(_0xa04675,_0x433db6){return db[_0x55ae('0x47')][_0x55ae('0x4e')](_0xa04675[_0x55ae('0x4f')],{})[_0x55ae('0x2a')](function(_0xee6219){var _0x23fc3d=_0xa04675[_0x55ae('0x50')][_0x55ae('0x2c')]({'plain':!![]});if(!_0x23fc3d)throw new Error(_0x55ae('0x51'));if(_0x23fc3d['role']===_0x55ae('0x50')){var _0x278298=_0xee6219[_0x55ae('0x2c')]({'plain':!![]});var _0x5c1615=_0x55ae('0x2d');return db[_0x55ae('0x52')][_0x55ae('0x4d')]({'where':{'name':_0x5c1615,'userProfileId':_0x23fc3d[_0x55ae('0x53')]},'raw':!![]})[_0x55ae('0x2a')](function(_0x5e18a3){if(_0x5e18a3&&_0x5e18a3[_0x55ae('0x54')]===0x0){return db[_0x55ae('0x2e')][_0x55ae('0x4e')]({'name':_0x278298[_0x55ae('0x30')],'resourceId':_0x278298['id'],'type':_0x5e18a3[_0x55ae('0x30')],'sectionId':_0x5e18a3['id']},{})['then'](function(){return _0xee6219;});}else{return _0xee6219;}})['catch'](function(_0xf4ca31){logger[_0x55ae('0x2f')](_0x55ae('0x55'),_0xf4ca31);throw _0xf4ca31;});}return _0xee6219;})[_0x55ae('0x2a')](respondWithResult(_0x433db6,0xc9))[_0x55ae('0x4a')](handleError(_0x433db6,null));};exports[_0x55ae('0x29')]=function(_0x364161,_0x1cc877){if(_0x364161[_0x55ae('0x4f')]['id']){delete _0x364161['body']['id'];}return db[_0x55ae('0x47')][_0x55ae('0x4d')]({'where':{'id':_0x364161[_0x55ae('0x4c')]['id']}})[_0x55ae('0x2a')](handleEntityNotFound(_0x1cc877,null))['then'](saveUpdates(_0x364161['body'],null))[_0x55ae('0x2a')](respondWithResult(_0x1cc877,null))[_0x55ae('0x4a')](handleError(_0x1cc877,null));};exports[_0x55ae('0x2b')]=function(_0x2b5fd3,_0xb92cf8){return db[_0x55ae('0x47')][_0x55ae('0x4d')]({'where':{'id':_0x2b5fd3['params']['id']}})[_0x55ae('0x2a')](handleEntityNotFound(_0xb92cf8,null))[_0x55ae('0x2a')](removeEntity(_0xb92cf8,null))[_0x55ae('0x4a')](handleError(_0xb92cf8,null));};exports[_0x55ae('0x56')]=function(_0x4b0d5f,_0x2ac3af){return db[_0x55ae('0x47')][_0x55ae('0x56')]()[_0x55ae('0x2a')](respondWithResult(_0x2ac3af,null))[_0x55ae('0x4a')](handleError(_0x2ac3af,null));};exports[_0x55ae('0x57')]=function(_0xadbd73,_0x405e95,_0x17c797){if(_0xadbd73[_0x55ae('0x4f')]['id']){delete _0xadbd73[_0x55ae('0x4f')]['id'];}return db['CmList']['find']({'where':{'id':_0xadbd73[_0x55ae('0x4c')]['id']}})['then'](handleEntityNotFound(_0x405e95,null))['then'](function(_0x31815f){if(_0x31815f){_0xadbd73['body'][_0x55ae('0x58')]=_0x31815f['id'];return db[_0x55ae('0x59')][_0x55ae('0x4e')](_0xadbd73['body']);}})[_0x55ae('0x2a')](respondWithResult(_0x405e95,null))[_0x55ae('0x4a')](handleError(_0x405e95,null));};exports[_0x55ae('0x5a')]=function(_0x5ad337,_0x48d4ac,_0xd6ada2){var _0x386208={'raw':![],'where':{}};var _0xc3fed9={};var _0x784f97={'count':0x0,'rows':[]};return db[_0x55ae('0x47')]['findOne']({'where':{'id':_0x5ad337[_0x55ae('0x4c')]['id']}})[_0x55ae('0x2a')](handleEntityNotFound(_0x48d4ac,null))['then'](function(_0x417bea){if(_0x417bea){_0xc3fed9[_0x55ae('0x34')]=_[_0x55ae('0x36')](db[_0x55ae('0x59')][_0x55ae('0x33')]);_0xc3fed9[_0x55ae('0x35')]=_[_0x55ae('0x36')](_0x5ad337[_0x55ae('0x35')]);_0xc3fed9[_0x55ae('0x37')]=_[_0x55ae('0x39')](_0xc3fed9['model'],_0xc3fed9['query']);_0x386208[_0x55ae('0x38')]=_['intersection'](_0xc3fed9[_0x55ae('0x34')],qs[_0x55ae('0x3a')](_0x5ad337[_0x55ae('0x35')][_0x55ae('0x3a')]));_0x386208[_0x55ae('0x38')]=_0x386208[_0x55ae('0x38')]['length']?_0x386208[_0x55ae('0x38')]:_0xc3fed9[_0x55ae('0x34')];if(!_0x5ad337['query'][_0x55ae('0x3c')](_0x55ae('0x3d'))){_0x386208[_0x55ae('0x22')]=qs[_0x55ae('0x22')](_0x5ad337['query']['limit']);_0x386208['offset']=qs[_0x55ae('0x20')](_0x5ad337['query'][_0x55ae('0x20')]);}_0x386208[_0x55ae('0x3e')]=qs[_0x55ae('0x3f')](_0x5ad337[_0x55ae('0x35')][_0x55ae('0x3f')]);_0x386208[_0x55ae('0x42')]=qs[_0x55ae('0x37')](_[_0x55ae('0x40')](_0x5ad337[_0x55ae('0x35')],_0xc3fed9[_0x55ae('0x37')]));_0x386208['where'][_0x55ae('0x58')]=_0x417bea['id'];if(_0x5ad337[_0x55ae('0x35')][_0x55ae('0x41')]){_0x386208[_0x55ae('0x42')]=_[_0x55ae('0x43')](_0x386208[_0x55ae('0x42')],{'$or':_['map'](_0x386208[_0x55ae('0x38')],function(_0x446da7){var _0x32012e={};_0x32012e[_0x446da7]={'$like':'%'+_0x5ad337[_0x55ae('0x35')][_0x55ae('0x41')]+'%'};return _0x32012e;})});}_0x386208=_[_0x55ae('0x43')]({},_0x386208,_0x5ad337[_0x55ae('0x5b')]);return db['Disposition'][_0x55ae('0x23')]({'where':_0x386208[_0x55ae('0x42')]})['then'](function(_0x52e64d){_0x784f97[_0x55ae('0x23')]=_0x52e64d;if(_0x5ad337[_0x55ae('0x35')][_0x55ae('0x48')]){_0x386208[_0x55ae('0x5c')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x386208);})[_0x55ae('0x2a')](function(_0x1e4c86){_0x784f97[_0x55ae('0x5d')]=_0x1e4c86;return _0x784f97;});}})[_0x55ae('0x2a')](respondWithFilteredResult(_0x48d4ac,_0x386208))[_0x55ae('0x4a')](handleError(_0x48d4ac,null));};exports[_0x55ae('0x5e')]=function(_0x41628f,_0x2ec3d7,_0x5c85e7){return db[_0x55ae('0x47')]['find']({'where':{'id':_0x41628f[_0x55ae('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2ec3d7,null))[_0x55ae('0x2a')](function(_0x11b11f){if(_0x11b11f){return _0x11b11f[_0x55ae('0x5e')](_0x41628f['query'][_0x55ae('0x5f')]);}})[_0x55ae('0x2a')](respondWithStatusCode(_0x2ec3d7,null))[_0x55ae('0x4a')](handleError(_0x2ec3d7,null));};exports[_0x55ae('0x60')]=function(_0x1102ee,_0x5cd9f3,_0x241438){return db[_0x55ae('0x47')]['find']({'where':{'id':_0x1102ee['params']['id']}})['then'](handleEntityNotFound(_0x5cd9f3,null))[_0x55ae('0x2a')](function(_0x117d45){if(_0x117d45){var _0x200919=[];var _0x37ac90={'success':[],'errors':[]};return db[_0x55ae('0x61')][_0x55ae('0x56')]()[_0x55ae('0x2a')](function(_0x40fde7){if(_0x1102ee['body'][_0x55ae('0x62')]&&_[_0x55ae('0x63')](_0x1102ee[_0x55ae('0x4f')][_0x55ae('0x62')])){if(_0x1102ee[_0x55ae('0x4f')][_0x55ae('0x62')][_0x55ae('0x3b')]){_0x1102ee['body'][_0x55ae('0x62')]=_0x1102ee[_0x55ae('0x4f')]['tags'][_0x55ae('0x64')](';')+';';}else{_0x1102ee[_0x55ae('0x4f')][_0x55ae('0x62')]=null;}}else{_0x1102ee[_0x55ae('0x4f')][_0x55ae('0x62')]=null;}if(_0x1102ee[_0x55ae('0x4f')]&&_[_0x55ae('0x63')](_0x1102ee[_0x55ae('0x4f')])){for(var _0x128a93=0x0;_0x128a93<_0x1102ee['body'][_0x55ae('0x3b')];_0x128a93+=0x1){_0x1102ee[_0x55ae('0x4f')][_0x128a93]['ListId']=_0x1102ee['params']['id'];_0x200919[_0x55ae('0x65')](_0x1102ee[_0x55ae('0x4f')][_0x128a93]);}return BPromise['each'](_0x200919,function(_0x2ebfc3){return db[_0x55ae('0x61')][_0x55ae('0x4e')](_['omit'](_0x2ebfc3,['ids','id'])||{},{'fields':_[_0x55ae('0x36')](_0x40fde7),'raw':!![]})[_0x55ae('0x2a')](function(_0x1a385e){_0x37ac90[_0x55ae('0x66')][_0x55ae('0x65')](_0x1a385e['dataValues']);})[_0x55ae('0x4a')](function(_0x19f004){_0x37ac90[_0x55ae('0x67')][_0x55ae('0x65')]({'data':_0x2ebfc3,'error':_0x19f004[_0x55ae('0x68')]});});})[_0x55ae('0x2a')](function(_0x58e060){return _0x37ac90;})[_0x55ae('0x4a')](function(_0x323045){return _0x323045;});}else{_0x5cd9f3['status'](0x190)[_0x55ae('0x1f')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x55ae('0x2a')](respondWithResult(_0x5cd9f3,null))[_0x55ae('0x4a')](handleError(_0x5cd9f3,null));};exports[_0x55ae('0x69')]=function(_0x2c40ce,_0x3d028b,_0x2dc8dc){var _0x45ac37;return db['CmList'][_0x55ae('0x4d')]({'where':{'id':_0x2c40ce[_0x55ae('0x4c')]['id']},'include':[{'model':db[_0x55ae('0x6a')],'as':'CustomFields'}]})[_0x55ae('0x2a')](handleEntityNotFound(_0x3d028b,null))[_0x55ae('0x2a')](function(_0x1c1e7f){if(_0x1c1e7f){_0x45ac37=_0x1c1e7f;return db[_0x55ae('0x61')][_0x55ae('0x33')];}})[_0x55ae('0x2a')](function(_0x11fc18){if(_0x11fc18){var _0x2ce214={};var _0xed13c2={};_0xed13c2[_0x55ae('0x34')]=_[_0x55ae('0x6b')](_[_0x55ae('0x36')](_0x11fc18),_[_0x55ae('0x44')](_0x45ac37[_0x55ae('0x6c')],function(_0x2f1c57){return util[_0x55ae('0x6d')](_0x55ae('0x6e'),_0x2f1c57['id']);}));_0xed13c2['query']=_[_0x55ae('0x36')](_0x2c40ce['query']);_0xed13c2[_0x55ae('0x37')]=_[_0x55ae('0x39')](_0xed13c2['model'],_0xed13c2['query']);_0x2ce214[_0x55ae('0x38')]=_[_0x55ae('0x39')](_0xed13c2[_0x55ae('0x34')],qs[_0x55ae('0x3a')](_0x2c40ce[_0x55ae('0x35')][_0x55ae('0x3a')]));_0x2ce214[_0x55ae('0x38')]=_0x2ce214[_0x55ae('0x38')][_0x55ae('0x3b')]?_0x2ce214[_0x55ae('0x38')]:_0xed13c2['model'];if(!_0x2c40ce['query'][_0x55ae('0x3c')](_0x55ae('0x3d'))){_0x2ce214[_0x55ae('0x22')]=qs[_0x55ae('0x22')](_0x2c40ce[_0x55ae('0x35')]['limit']);_0x2ce214['offset']=qs[_0x55ae('0x20')](_0x2c40ce['query'][_0x55ae('0x20')]);}_0x2ce214[_0x55ae('0x3e')]=qs[_0x55ae('0x3f')](_0x2c40ce['query'][_0x55ae('0x3f')]);_0x2ce214[_0x55ae('0x42')]=qs[_0x55ae('0x37')](_[_0x55ae('0x40')](_0x2c40ce[_0x55ae('0x35')],_0xed13c2[_0x55ae('0x37')]));_0x2ce214[_0x55ae('0x6f')]=!![];if(_0x2c40ce[_0x55ae('0x35')][_0x55ae('0x41')]){_0x2ce214['where']=_['merge'](_0x2ce214['where'],{'$or':_[_0x55ae('0x44')](_0x2ce214['attributes'],function(_0x5dfdbf){var _0x5aeabf={};_0x5aeabf[_0x5dfdbf]={'$like':'%'+_0x2c40ce[_0x55ae('0x35')][_0x55ae('0x41')]+'%'};return _0x5aeabf;})});}_0x2ce214=_[_0x55ae('0x43')]({},_0x2ce214,_0x2c40ce['options']);return _0x45ac37[_0x55ae('0x69')](_0x2ce214);}})[_0x55ae('0x2a')](respondWithResult(_0x3d028b,null))[_0x55ae('0x4a')](handleError(_0x3d028b,null));};exports[_0x55ae('0x70')]=function(_0x59ae86,_0x33651c,_0x413934){var _0x5d1c02;return db[_0x55ae('0x47')][_0x55ae('0x4d')]({'where':{'id':_0x59ae86[_0x55ae('0x4c')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x55ae('0x2a')](handleEntityNotFound(_0x33651c,null))[_0x55ae('0x2a')](function(_0x2c0ab6){if(_0x2c0ab6){_0x5d1c02=_0x2c0ab6;return db[_0x55ae('0x61')][_0x55ae('0x33')];}})[_0x55ae('0x2a')](function(_0x396f55){if(_0x396f55){var _0x32d5ec={};var _0x1f0042={};_0x1f0042[_0x55ae('0x34')]=_[_0x55ae('0x6b')](_[_0x55ae('0x36')](_0x396f55),_[_0x55ae('0x44')](_0x5d1c02[_0x55ae('0x6c')],function(_0x27c740){return util['format'](_0x55ae('0x6e'),_0x27c740['id']);}));_0x1f0042['query']=_[_0x55ae('0x36')](_0x59ae86[_0x55ae('0x35')]);_0x1f0042[_0x55ae('0x37')]=_[_0x55ae('0x39')](_0x1f0042[_0x55ae('0x34')],_0x1f0042[_0x55ae('0x35')]);_0x32d5ec['attributes']=_['intersection'](_0x1f0042[_0x55ae('0x34')],qs[_0x55ae('0x3a')](_0x59ae86[_0x55ae('0x35')][_0x55ae('0x3a')]));_0x32d5ec[_0x55ae('0x38')]=_0x32d5ec[_0x55ae('0x38')][_0x55ae('0x3b')]?_0x32d5ec['attributes']:_0x1f0042[_0x55ae('0x34')];if(!_0x59ae86[_0x55ae('0x35')]['hasOwnProperty']('nolimit')){_0x32d5ec[_0x55ae('0x22')]=qs['limit'](_0x59ae86[_0x55ae('0x35')]['limit']);_0x32d5ec[_0x55ae('0x20')]=qs['offset'](_0x59ae86['query']['offset']);}_0x32d5ec[_0x55ae('0x3e')]=qs[_0x55ae('0x3f')](_0x59ae86['query'][_0x55ae('0x3f')]);_0x32d5ec[_0x55ae('0x42')]=qs['filters'](_[_0x55ae('0x40')](_0x59ae86['query'],_0x1f0042[_0x55ae('0x37')]));_0x32d5ec[_0x55ae('0x6f')]=!![];if(_0x59ae86[_0x55ae('0x35')]['filter']){_0x32d5ec[_0x55ae('0x42')]=_[_0x55ae('0x43')](_0x32d5ec[_0x55ae('0x42')],{'$or':_[_0x55ae('0x44')](_0x32d5ec['attributes'],function(_0x2e0183){var _0x410eab={};_0x410eab[_0x2e0183]={'$like':'%'+_0x59ae86[_0x55ae('0x35')][_0x55ae('0x41')]+'%'};return _0x410eab;})});}_0x32d5ec=_[_0x55ae('0x43')]({},_0x32d5ec,_0x59ae86[_0x55ae('0x5b')]);return _0x5d1c02[_0x55ae('0x69')](_0x32d5ec);}})[_0x55ae('0x2a')](function(_0x1d788f){if(!_['isEmpty'](_0x1d788f)){var _0x47debc=toCsv(_0x1d788f);var _0x1532f1=Date[_0x55ae('0x71')]();fs[_0x55ae('0x72')](util[_0x55ae('0x6d')]('/tmp/list_%d_%s.csv',_0x5d1c02['id'],_0x1532f1),_0x47debc);_0x33651c['setHeader'](_0x55ae('0x73'),_0x55ae('0x74')+util[_0x55ae('0x6d')](_0x55ae('0x75'),_0x5d1c02['id'],_0x1532f1));_0x33651c['setHeader'](_0x55ae('0x76'),_0x55ae('0x77'));return _0x33651c[_0x55ae('0x78')](util[_0x55ae('0x6d')](_0x55ae('0x79'),_0x5d1c02['id'],_0x1532f1));}else{return _0x33651c[_0x55ae('0x1c')](0xcc);}})[_0x55ae('0x4a')](handleError(_0x33651c,null));};exports['addCustomField']=function(_0x3b25e2,_0x195055,_0x2663db){var _0x5af834;delete _0x3b25e2['body']['id'];return db['CmList']['findOne']({'where':{'id':_0x3b25e2[_0x55ae('0x4c')]['id']}})[_0x55ae('0x2a')](handleEntityNotFound(_0x195055,null))[_0x55ae('0x2a')](function(_0x36253d){if(_0x36253d){return db[_0x55ae('0x7a')][_0x55ae('0x7b')](function(_0x1c8d42){return db[_0x55ae('0x6a')]['create'](_0x3b25e2['body'],{'transaction':_0x1c8d42})[_0x55ae('0x2a')](function(_0x2c3204){_0x5af834=_0x2c3204;return _0x36253d[_0x55ae('0x7c')](_0x2c3204,{'transaction':_0x1c8d42});})[_0x55ae('0x2a')](function(){var _0x84b156={'type':db[_0x55ae('0x7d')][_0x55ae('0x7e')],'transaction':_0x1c8d42};switch(_0x3b25e2['body'][_0x55ae('0x45')]){case _0x55ae('0x7f'):_0x84b156['type']=db[_0x55ae('0x7d')][_0x55ae('0x7e')];break;case'number':_0x84b156[_0x55ae('0x45')]=db['Sequelize'][_0x55ae('0x80')];break;case'switch':_0x84b156[_0x55ae('0x45')]=db[_0x55ae('0x7d')][_0x55ae('0x81')];_0x84b156['defaultValue']=![];break;default:}return db[_0x55ae('0x7a')]['queryInterface']['addColumn'](_0x55ae('0x82'),util['format'](_0x55ae('0x83'),_0x5af834['id']),_0x84b156);})[_0x55ae('0x2a')](function(){return _0x5af834;});});}})[_0x55ae('0x2a')](respondWithResult(_0x195055,null))[_0x55ae('0x4a')](handleError(_0x195055,null));};exports[_0x55ae('0x84')]=function(_0x31180c,_0x458a42,_0x53a2ed){var _0x249aa0={};var _0x46d09a={};var _0x4494ab;var _0x33f452;return db[_0x55ae('0x47')]['findOne']({'where':{'id':_0x31180c[_0x55ae('0x4c')]['id']}})[_0x55ae('0x2a')](handleEntityNotFound(_0x458a42,null))[_0x55ae('0x2a')](function(_0x46f818){if(_0x46f818){_0x4494ab=_0x46f818;_0x46d09a[_0x55ae('0x34')]=_[_0x55ae('0x36')](db[_0x55ae('0x6a')][_0x55ae('0x33')]);_0x46d09a[_0x55ae('0x35')]=_['keys'](_0x31180c[_0x55ae('0x35')]);_0x46d09a[_0x55ae('0x37')]=_[_0x55ae('0x39')](_0x46d09a[_0x55ae('0x34')],_0x46d09a[_0x55ae('0x35')]);_0x249aa0['attributes']=_['intersection'](_0x46d09a[_0x55ae('0x34')],qs[_0x55ae('0x3a')](_0x31180c['query'][_0x55ae('0x3a')]));_0x249aa0[_0x55ae('0x38')]=_0x249aa0['attributes']['length']?_0x249aa0[_0x55ae('0x38')]:_0x46d09a[_0x55ae('0x34')];_0x249aa0[_0x55ae('0x3e')]=qs[_0x55ae('0x3f')](_0x31180c['query']['sort']);_0x249aa0[_0x55ae('0x42')]=qs[_0x55ae('0x37')](_[_0x55ae('0x40')](_0x31180c['query'],_0x46d09a[_0x55ae('0x37')]));_0x249aa0['where']=_[_0x55ae('0x43')](_0x249aa0[_0x55ae('0x42')],{'$or':[{'ListId':_0x46f818['id']},{'ListId':null}]});if(_0x31180c[_0x55ae('0x35')]['filter']){_0x249aa0[_0x55ae('0x42')]=_[_0x55ae('0x43')](_0x249aa0[_0x55ae('0x42')],{'$or':_[_0x55ae('0x44')](_0x249aa0[_0x55ae('0x38')],function(_0x236b71){var _0x15fcf0={};_0x15fcf0[_0x236b71]={'$like':'%'+_0x31180c[_0x55ae('0x35')][_0x55ae('0x41')]+'%'};return _0x15fcf0;})});}_0x249aa0=_[_0x55ae('0x43')]({},_0x249aa0,_0x31180c[_0x55ae('0x5b')]);return db[_0x55ae('0x6a')][_0x55ae('0x85')](_0x249aa0);}})[_0x55ae('0x2a')](respondWithResult(_0x458a42,null))[_0x55ae('0x4a')](handleError(_0x458a42,null));};exports[_0x55ae('0x86')]=function(_0x5eec33,_0x49de42,_0x5a2a6a){return db['CmList'][_0x55ae('0x4d')]({'where':{'id':_0x5eec33[_0x55ae('0x4c')]['id']}})['then'](handleEntityNotFound(_0x49de42,null))[_0x55ae('0x2a')](function(_0x48dc31){if(_0x48dc31){return _0x48dc31['addAgents'](_0x5eec33[_0x55ae('0x4f')][_0x55ae('0x5f')],_['omit'](_0x5eec33[_0x55ae('0x4f')],[_0x55ae('0x5f'),'id'])||{})[_0x55ae('0x87')](function(_0x2fae34){for(var _0x3fbdc8=0x0;_0x3fbdc8<_0x5eec33[_0x55ae('0x4f')][_0x55ae('0x5f')]['length'];_0x3fbdc8+=0x1){socket[_0x55ae('0x88')](_0x55ae('0x89'),{'UserId':Number(_0x5eec33['body'][_0x55ae('0x5f')][_0x3fbdc8]),'CmListId':Number(_0x5eec33[_0x55ae('0x4c')]['id'])});}return _0x2fae34;});}})[_0x55ae('0x2a')](respondWithResult(_0x49de42,null))[_0x55ae('0x4a')](handleError(_0x49de42,null));};exports[_0x55ae('0x8a')]=function(_0x3ffe72,_0xf591eb,_0x4b3fe1){return db[_0x55ae('0x47')]['find']({'where':{'id':_0x3ffe72['params']['id']}})[_0x55ae('0x2a')](handleEntityNotFound(_0xf591eb,null))[_0x55ae('0x2a')](function(_0x466403){if(_0x466403){return _0x466403[_0x55ae('0x8a')](_0x3ffe72[_0x55ae('0x35')][_0x55ae('0x5f')])[_0x55ae('0x2a')](function(){if(_[_0x55ae('0x63')](_0x3ffe72['query'][_0x55ae('0x5f')])){for(var _0x130f37=0x0;_0x130f37<_0x3ffe72[_0x55ae('0x35')][_0x55ae('0x5f')][_0x55ae('0x3b')];_0x130f37+=0x1){socket[_0x55ae('0x88')]('userCmList:remove',{'UserId':Number(_0x3ffe72['query'][_0x55ae('0x5f')][_0x130f37]),'CmListId':Number(_0x3ffe72[_0x55ae('0x4c')]['id'])});}}else{socket[_0x55ae('0x88')](_0x55ae('0x8b'),{'UserId':Number(_0x3ffe72[_0x55ae('0x35')][_0x55ae('0x5f')]),'CmListId':Number(_0x3ffe72[_0x55ae('0x4c')]['id'])});}});}})[_0x55ae('0x2a')](respondWithStatusCode(_0xf591eb,null))[_0x55ae('0x4a')](handleError(_0xf591eb,null));};exports[_0x55ae('0x8c')]=function(_0x3f5e3f,_0x9afd2a,_0x4ace04){var _0x48d75e={};var _0x2df8fc={};var _0x17cab9;var _0x5240b5;return db[_0x55ae('0x47')]['findOne']({'where':{'id':_0x3f5e3f['params']['id']}})[_0x55ae('0x2a')](handleEntityNotFound(_0x9afd2a,null))[_0x55ae('0x2a')](function(_0x43e2ac){if(_0x43e2ac){_0x17cab9=_0x43e2ac;_0x2df8fc[_0x55ae('0x34')]=_[_0x55ae('0x36')](db[_0x55ae('0x8d')][_0x55ae('0x33')]);_0x2df8fc[_0x55ae('0x35')]=_[_0x55ae('0x36')](_0x3f5e3f[_0x55ae('0x35')]);_0x2df8fc[_0x55ae('0x37')]=_[_0x55ae('0x39')](_0x2df8fc[_0x55ae('0x34')],_0x2df8fc[_0x55ae('0x35')]);_0x48d75e[_0x55ae('0x38')]=_[_0x55ae('0x39')](_0x2df8fc['model'],qs[_0x55ae('0x3a')](_0x3f5e3f[_0x55ae('0x35')][_0x55ae('0x3a')]));_0x48d75e[_0x55ae('0x38')]=_0x48d75e['attributes']['length']?_0x48d75e['attributes']:_0x2df8fc[_0x55ae('0x34')];_0x48d75e[_0x55ae('0x3e')]=qs[_0x55ae('0x3f')](_0x3f5e3f[_0x55ae('0x35')][_0x55ae('0x3f')]);_0x48d75e[_0x55ae('0x42')]=qs[_0x55ae('0x37')](_[_0x55ae('0x40')](_0x3f5e3f[_0x55ae('0x35')],_0x2df8fc[_0x55ae('0x37')]));if(_0x3f5e3f['query'][_0x55ae('0x41')]){_0x48d75e[_0x55ae('0x42')]=_['merge'](_0x48d75e[_0x55ae('0x42')],{'$or':_[_0x55ae('0x44')](_0x48d75e[_0x55ae('0x38')],function(_0x5e32c2){var _0x573841={};_0x573841[_0x5e32c2]={'$like':'%'+_0x3f5e3f[_0x55ae('0x35')][_0x55ae('0x41')]+'%'};return _0x573841;})});}_0x48d75e=_[_0x55ae('0x43')]({},_0x48d75e,_0x3f5e3f[_0x55ae('0x5b')]);return _0x17cab9[_0x55ae('0x8c')](_0x48d75e);}})[_0x55ae('0x2a')](function(_0x494d5a){if(_0x494d5a){_0x5240b5=_0x494d5a[_0x55ae('0x3b')];if(!_0x3f5e3f['query']['hasOwnProperty'](_0x55ae('0x3d'))){_0x48d75e['limit']=qs[_0x55ae('0x22')](_0x3f5e3f['query'][_0x55ae('0x22')]);_0x48d75e[_0x55ae('0x20')]=qs[_0x55ae('0x20')](_0x3f5e3f[_0x55ae('0x35')]['offset']);}return _0x17cab9[_0x55ae('0x8c')](_0x48d75e);}})[_0x55ae('0x2a')](function(_0x5a656b){if(_0x5a656b){return _0x5a656b?{'count':_0x5240b5,'rows':_0x5a656b}:null;}})['then'](respondWithResult(_0x9afd2a,null))[_0x55ae('0x4a')](handleError(_0x9afd2a,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index c8dcf02..9076bc9 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x43b5e1,_0x1ff414){var _0x94e6be=function(_0x532e63){while(--_0x532e63){_0x43b5e1['push'](_0x43b5e1['shift']());}};_0x94e6be(++_0x1ff414);}(_0x814b,0x1a2));var _0xb814=function(_0x4a4c78,_0x13d5b7){_0x4a4c78=_0x4a4c78-0x0;var _0xd58f32=_0x814b[_0x4a4c78];return _0xd58f32;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file +var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x258bb2,_0x185d88){_0x258bb2=_0x258bb2-0x0;var _0x2a1ad0=_0x3e74[_0x258bb2];return _0x2a1ad0;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index e14e60d..2a12f49 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 _0x4522=['path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','../../config/logger','api','moment','request-promise'];(function(_0x27b22d,_0x2a039d){var _0x2fb11a=function(_0x56ce1c){while(--_0x56ce1c){_0x27b22d['push'](_0x27b22d['shift']());}};_0x2fb11a(++_0x2a039d);}(_0x4522,0x1a0));var _0x2452=function(_0x183518,_0x51e545){_0x183518=_0x183518-0x0;var _0x40afaf=_0x4522[_0x183518];return _0x40afaf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2452('0x0'))(_0x2452('0x1'));var moment=require(_0x2452('0x2'));var BPromise=require('bluebird');var rp=require(_0x2452('0x3'));var fs=require('fs');var path=require(_0x2452('0x4'));var rimraf=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var attributes=require(_0x2452('0x7'));module[_0x2452('0x8')]=function(_0x15fc69,_0x226578){return _0x15fc69[_0x2452('0x9')](_0x2452('0xa'),attributes,{'tableName':_0x2452('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4eb=['./cmList.attributes','exports','define','cm_lists','lodash','bluebird','rimraf','../../config/environment'];(function(_0x4dd1d2,_0x368e7){var _0x4ca6fe=function(_0x3439ea){while(--_0x3439ea){_0x4dd1d2['push'](_0x4dd1d2['shift']());}};_0x4ca6fe(++_0x368e7);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5b6cba,_0x30c853){_0x5b6cba=_0x5b6cba-0x0;var _0x5cc743=_0xf4eb[_0x5b6cba];return _0x5cc743;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf4e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var attributes=require(_0xbf4e('0x4'));module[_0xbf4e('0x5')]=function(_0xa4dcf5,_0x2fcfed){return _0xa4dcf5[_0xbf4e('0x6')]('CmList',attributes,{'tableName':_0xbf4e('0x7'),'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 1362b33..cc8722a 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 _0xe27b=['jayson/promise','client','defaults','socket.io-emitter','redis','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe27b,0xd8));var _0xbe27=function(_0x34f45f,_0xcf14b7){_0x34f45f=_0x34f45f-0x0;var _0x34d887=_0xe27b[_0x34f45f];return _0x34d887;};'use strict';var _=require(_0xbe27('0x0'));var util=require(_0xbe27('0x1'));var moment=require(_0xbe27('0x2'));var BPromise=require('bluebird');var rs=require(_0xbe27('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe27('0x4'))['db'];var utils=require(_0xbe27('0x5'));var logger=require(_0xbe27('0x6'))(_0xbe27('0x7'));var config=require(_0xbe27('0x8'));var jayson=require(_0xbe27('0x9'));var client=jayson[_0xbe27('0xa')]['http']({'port':0x232a});config['redis']=_[_0xbe27('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbe27('0xc'))(new Redis(config[_0xbe27('0xd')]));require('./cmList.socket')[_0xbe27('0xe')](socket);function respondWithRpcPromise(_0x31c16b,_0x326b23,_0x2e19d2){return new BPromise(function(_0x5c6233,_0x282760){return client[_0xbe27('0xf')](_0x31c16b,_0x2e19d2)[_0xbe27('0x10')](function(_0x3399f3){logger['info'](_0xbe27('0x11'),_0x326b23,_0xbe27('0x12'));logger['debug'](_0xbe27('0x13'),_0x326b23,_0xbe27('0x12'),JSON[_0xbe27('0x14')](_0x3399f3));if(_0x3399f3[_0xbe27('0x15')]){if(_0x3399f3['error']['code']===0x1f4){logger[_0xbe27('0x15')](_0xbe27('0x11'),_0x326b23,_0x3399f3[_0xbe27('0x15')][_0xbe27('0x16')]);return _0x282760(_0x3399f3[_0xbe27('0x15')][_0xbe27('0x16')]);}logger[_0xbe27('0x15')](_0xbe27('0x11'),_0x326b23,_0x3399f3[_0xbe27('0x15')][_0xbe27('0x16')]);return _0x5c6233(_0x3399f3[_0xbe27('0x15')]['message']);}else{logger[_0xbe27('0x17')]('CmList,\x20%s,\x20%s',_0x326b23,_0xbe27('0x12'));_0x5c6233(_0x3399f3['result'][_0xbe27('0x16')]);}})[_0xbe27('0x18')](function(_0x11d338){logger[_0xbe27('0x15')]('CmList,\x20%s,\x20%s',_0x326b23,_0x11d338);_0x282760(_0x11d338);});});} \ No newline at end of file +var _0xe285=['http','redis','socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0xebdc99,_0x2552da){var _0x562428=function(_0x171fd0){while(--_0x171fd0){_0xebdc99['push'](_0xebdc99['shift']());}};_0x562428(++_0x2552da);}(_0xe285,0x6f));var _0x5e28=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xe285[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x5e28('0x0'));var util=require(_0x5e28('0x1'));var moment=require(_0x5e28('0x2'));var BPromise=require(_0x5e28('0x3'));var rs=require(_0x5e28('0x4'));var fs=require('fs');var Redis=require(_0x5e28('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5e28('0x6'))(_0x5e28('0x7'));var config=require(_0x5e28('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5e28('0x9')]({'port':0x232a});config[_0x5e28('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5e28('0xb'))(new Redis(config[_0x5e28('0xa')]));require('./cmList.socket')[_0x5e28('0xc')](socket);function respondWithRpcPromise(_0x2893a6,_0x37e140,_0x14f7a3){return new BPromise(function(_0xae4ddb,_0x308f21){return client[_0x5e28('0xd')](_0x2893a6,_0x14f7a3)[_0x5e28('0xe')](function(_0x51af54){logger[_0x5e28('0xf')](_0x5e28('0x10'),_0x37e140,_0x5e28('0x11'));logger['debug'](_0x5e28('0x12'),_0x37e140,_0x5e28('0x11'),JSON[_0x5e28('0x13')](_0x51af54));if(_0x51af54[_0x5e28('0x14')]){if(_0x51af54[_0x5e28('0x14')]['code']===0x1f4){logger[_0x5e28('0x14')](_0x5e28('0x10'),_0x37e140,_0x51af54[_0x5e28('0x14')][_0x5e28('0x15')]);return _0x308f21(_0x51af54[_0x5e28('0x14')][_0x5e28('0x15')]);}logger['error'](_0x5e28('0x10'),_0x37e140,_0x51af54[_0x5e28('0x14')][_0x5e28('0x15')]);return _0xae4ddb(_0x51af54['error'][_0x5e28('0x15')]);}else{logger[_0x5e28('0xf')](_0x5e28('0x10'),_0x37e140,_0x5e28('0x11'));_0xae4ddb(_0x51af54[_0x5e28('0x16')][_0x5e28('0x15')]);}})[_0x5e28('0x17')](function(_0x169d58){logger['error']('CmList,\x20%s,\x20%s',_0x37e140,_0x169d58);_0x308f21(_0x169d58);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 0fb383e..4322308 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 _0x8b4c=['remove','update','emit','removeListener','length','cmList:','./cmList.events','save'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8b4c,0xfe));var _0xc8b4=function(_0x139ddf,_0xdab31d){_0x139ddf=_0x139ddf-0x0;var _0x5e4464=_0x8b4c[_0x139ddf];return _0x5e4464;};'use strict';var CmListEvents=require(_0xc8b4('0x0'));var events=[_0xc8b4('0x1'),_0xc8b4('0x2'),_0xc8b4('0x3')];function createListener(_0x4e432f,_0x69499){return function(_0x4d1074){_0x69499[_0xc8b4('0x4')](_0x4e432f,_0x4d1074);};}function removeListener(_0x396e75,_0x4ad3db){return function(){CmListEvents[_0xc8b4('0x5')](_0x396e75,_0x4ad3db);};}exports['register']=function(_0x1ee109){for(var _0x312c73=0x0,_0x2bd99d=events[_0xc8b4('0x6')];_0x312c73<_0x2bd99d;_0x312c73++){var _0x2f36e9=events[_0x312c73];var _0x2e826a=createListener(_0xc8b4('0x7')+_0x2f36e9,_0x1ee109);CmListEvents['on'](_0x2f36e9,_0x2e826a);}}; \ No newline at end of file +var _0x11b9=['removeListener','register','length','save','remove'];(function(_0x45f70f,_0x29ca5b){var _0xdaad73=function(_0x1f5a6d){while(--_0x1f5a6d){_0x45f70f['push'](_0x45f70f['shift']());}};_0xdaad73(++_0x29ca5b);}(_0x11b9,0x1d9));var _0x911b=function(_0x20c2a5,_0x3bf05a){_0x20c2a5=_0x20c2a5-0x0;var _0x59e4b9=_0x11b9[_0x20c2a5];return _0x59e4b9;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x911b('0x0'),_0x911b('0x1'),'update'];function createListener(_0x501e5e,_0x2d165c){return function(_0x5a43f8){_0x2d165c['emit'](_0x501e5e,_0x5a43f8);};}function removeListener(_0x35d531,_0x479e80){return function(){CmListEvents[_0x911b('0x2')](_0x35d531,_0x479e80);};}exports[_0x911b('0x3')]=function(_0x26758c){for(var _0x24adfd=0x0,_0x20868a=events[_0x911b('0x4')];_0x24adfd<_0x20868a;_0x24adfd++){var _0x3a0bf0=events[_0x24adfd];var _0x37f167=createListener('cmList:'+_0x3a0bf0,_0x26758c);CmListEvents['on'](_0x3a0bf0,_0x37f167);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 5a45212..7468393 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 _0x7fc7=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getCustomFields','post','create','/:id/fields','/:id/users','addAgents','put','update','destroy','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fc7,0x7d));var _0x77fc=function(_0x44f61d,_0x28fb5e){_0x44f61d=_0x44f61d-0x0;var _0x1e6d96=_0x7fc7[_0x44f61d];return _0x1e6d96;};'use strict';var multer=require(_0x77fc('0x0'));var util=require(_0x77fc('0x1'));var path=require('path');var timeout=require(_0x77fc('0x2'));var express=require(_0x77fc('0x3'));var router=express['Router']();var fs_extra=require(_0x77fc('0x4'));var auth=require(_0x77fc('0x5'));var interaction=require(_0x77fc('0x6'));var config=require(_0x77fc('0x7'));var controller=require(_0x77fc('0x8'));router[_0x77fc('0x9')]('/',auth[_0x77fc('0xa')](),controller[_0x77fc('0xb')]);router[_0x77fc('0x9')]('/describe',auth[_0x77fc('0xa')](),controller[_0x77fc('0xc')]);router[_0x77fc('0x9')](_0x77fc('0xd'),auth[_0x77fc('0xa')](),controller[_0x77fc('0xe')]);router['get'](_0x77fc('0xf'),auth[_0x77fc('0xa')](),controller[_0x77fc('0x10')]);router[_0x77fc('0x9')](_0x77fc('0x11'),auth[_0x77fc('0xa')](),controller[_0x77fc('0x12')]);router[_0x77fc('0x9')](_0x77fc('0x13'),auth[_0x77fc('0xa')](),controller['getContactsCsv']);router['get']('/:id/fields',auth[_0x77fc('0xa')](),controller[_0x77fc('0x14')]);router['get']('/:id/users',auth[_0x77fc('0xa')](),controller['getAgents']);router[_0x77fc('0x15')]('/',auth['isAuthenticated'](),controller[_0x77fc('0x16')]);router['post']('/:id/dispositions',auth[_0x77fc('0xa')](),controller['addDisposition']);router['post']('/:id/contacts',auth[_0x77fc('0xa')](),controller['addContacts']);router[_0x77fc('0x15')](_0x77fc('0x17'),auth[_0x77fc('0xa')](),controller['addCustomField']);router[_0x77fc('0x15')](_0x77fc('0x18'),auth[_0x77fc('0xa')](),controller[_0x77fc('0x19')]);router[_0x77fc('0x1a')]('/:id',auth[_0x77fc('0xa')](),controller[_0x77fc('0x1b')]);router['delete'](_0x77fc('0xd'),auth['isAuthenticated'](),controller[_0x77fc('0x1c')]);router[_0x77fc('0x1d')](_0x77fc('0xf'),auth[_0x77fc('0xa')](),controller['removeDispositions']);router[_0x77fc('0x1d')]('/:id/users',auth[_0x77fc('0xa')](),controller['removeAgents']);module[_0x77fc('0x1e')]=router; \ No newline at end of file +var _0x4a3f=['addDisposition','post','addContacts','addCustomField','/:id/users','delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getCustomFields','create'];(function(_0x4e9274,_0x49576e){var _0x8b474c=function(_0x204cca){while(--_0x204cca){_0x4e9274['push'](_0x4e9274['shift']());}};_0x8b474c(++_0x49576e);}(_0x4a3f,0x101));var _0xf4a3=function(_0x460666,_0x24bfa0){_0x460666=_0x460666-0x0;var _0x555cbf=_0x4a3f[_0x460666];return _0x555cbf;};'use strict';var multer=require(_0xf4a3('0x0'));var util=require(_0xf4a3('0x1'));var path=require(_0xf4a3('0x2'));var timeout=require(_0xf4a3('0x3'));var express=require(_0xf4a3('0x4'));var router=express[_0xf4a3('0x5')]();var fs_extra=require(_0xf4a3('0x6'));var auth=require(_0xf4a3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf4a3('0x8'));var controller=require(_0xf4a3('0x9'));router[_0xf4a3('0xa')]('/',auth[_0xf4a3('0xb')](),controller[_0xf4a3('0xc')]);router[_0xf4a3('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xf4a3('0xd')]);router[_0xf4a3('0xa')](_0xf4a3('0xe'),auth[_0xf4a3('0xb')](),controller[_0xf4a3('0xf')]);router[_0xf4a3('0xa')](_0xf4a3('0x10'),auth[_0xf4a3('0xb')](),controller[_0xf4a3('0x11')]);router[_0xf4a3('0xa')](_0xf4a3('0x12'),auth[_0xf4a3('0xb')](),controller['getContacts']);router[_0xf4a3('0xa')](_0xf4a3('0x13'),auth[_0xf4a3('0xb')](),controller['getContactsCsv']);router[_0xf4a3('0xa')]('/:id/fields',auth[_0xf4a3('0xb')](),controller[_0xf4a3('0x14')]);router[_0xf4a3('0xa')]('/:id/users',auth[_0xf4a3('0xb')](),controller['getAgents']);router['post']('/',auth[_0xf4a3('0xb')](),controller[_0xf4a3('0x15')]);router['post']('/:id/dispositions',auth[_0xf4a3('0xb')](),controller[_0xf4a3('0x16')]);router[_0xf4a3('0x17')](_0xf4a3('0x12'),auth['isAuthenticated'](),controller[_0xf4a3('0x18')]);router['post']('/:id/fields',auth['isAuthenticated'](),controller[_0xf4a3('0x19')]);router['post'](_0xf4a3('0x1a'),auth[_0xf4a3('0xb')](),controller['addAgents']);router['put']('/:id',auth[_0xf4a3('0xb')](),controller['update']);router[_0xf4a3('0x1b')](_0xf4a3('0xe'),auth[_0xf4a3('0xb')](),controller[_0xf4a3('0x1c')]);router['delete'](_0xf4a3('0x10'),auth['isAuthenticated'](),controller[_0xf4a3('0x1d')]);router[_0xf4a3('0x1b')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xf4a3('0x1e')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 85adc33..449146a 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 _0x9541=['sequelize','exports','VIRTUAL','getDataValue','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9541,0x1d6));var _0x1954=function(_0x176c73,_0x16881b){_0x176c73=_0x176c73-0x0;var _0x8dd709=_0x9541[_0x176c73];return _0x8dd709;};'use strict';var Sequelize=require(_0x1954('0x0'));module[_0x1954('0x1')]={'name':{'type':Sequelize[_0x1954('0x2')],'get':function(_0x20a488){return this[_0x1954('0x3')]('field');}},'field':{'type':Sequelize[_0x1954('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x1954('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x1954('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x4b98=['exports','VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x424d73,_0x412247){var _0x4367df=function(_0x3df23f){while(--_0x3df23f){_0x424d73['push'](_0x424d73['shift']());}};_0x4367df(++_0x412247);}(_0x4b98,0x161));var _0x84b9=function(_0x126d77,_0x2b217d){_0x126d77=_0x126d77-0x0;var _0x36266a=_0x4b98[_0x126d77];return _0x36266a;};'use strict';var Sequelize=require(_0x84b9('0x0'));module[_0x84b9('0x1')]={'name':{'type':Sequelize[_0x84b9('0x2')],'get':function(_0x1df39d){return this[_0x84b9('0x3')](_0x84b9('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x84b9('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x84b9('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index f4e65ae..5df7dff 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(_0x3eb92f,_0x25d0cd){var _0x334030=function(_0x3f3b67){while(--_0x3f3b67){_0x3eb92f['push'](_0x3eb92f['shift']());}};_0x334030(++_0x25d0cd);}(_0x7a54,0x106));var _0x47a5=function(_0xc81109,_0x1fde52){_0xc81109=_0xc81109-0x0;var _0x1a7944=_0x7a54[_0xc81109];return _0x1a7944;};'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(_0x1a110f,_0x19e326){var _0x204840=function(_0x353512){while(--_0x353512){_0x1a110f['push'](_0x1a110f['shift']());}};_0x204840(++_0x19e326);}(_0x7a54,0x106));var _0x47a5=function(_0x1d4c5c,_0xc94f86){_0x1d4c5c=_0x1d4c5c-0x0;var _0x109efa=_0x7a54[_0x1d4c5c];return _0x109efa;};'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 55d107b..7fca6d1 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 _0x0965=['rimraf','../../config/environment','./condition.attributes','tools_conditions','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2c5548,_0x56765d){var _0xbdff70=function(_0xd5b0a2){while(--_0xd5b0a2){_0x2c5548['push'](_0x2c5548['shift']());}};_0xbdff70(++_0x56765d);}(_0x0965,0xae));var _0x5096=function(_0x10602b,_0x4ee101){_0x10602b=_0x10602b-0x0;var _0x3b6e91=_0x0965[_0x10602b];return _0x3b6e91;};'use strict';var _=require(_0x5096('0x0'));var util=require(_0x5096('0x1'));var logger=require(_0x5096('0x2'))(_0x5096('0x3'));var moment=require('moment');var BPromise=require(_0x5096('0x4'));var rp=require(_0x5096('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5096('0x6'));var config=require(_0x5096('0x7'));var attributes=require(_0x5096('0x8'));module['exports']=function(_0x4739d3,_0x4dce27){return _0x4739d3['define']('Condition',attributes,{'tableName':_0x5096('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x85f0=['../../config/environment','./condition.attributes','exports','tools_conditions','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x170b20,_0x49fc52){var _0xbe0395=function(_0x410eea){while(--_0x410eea){_0x170b20['push'](_0x170b20['shift']());}};_0xbe0395(++_0x49fc52);}(_0x85f0,0xb8));var _0x085f=function(_0x4e170e,_0x207e58){_0x4e170e=_0x4e170e-0x0;var _0x338291=_0x85f0[_0x4e170e];return _0x338291;};'use strict';var _=require('lodash');var util=require(_0x085f('0x0'));var logger=require(_0x085f('0x1'))(_0x085f('0x2'));var moment=require('moment');var BPromise=require(_0x085f('0x3'));var rp=require(_0x085f('0x4'));var fs=require('fs');var path=require(_0x085f('0x5'));var rimraf=require('rimraf');var config=require(_0x085f('0x6'));var attributes=require(_0x085f('0x7'));module[_0x085f('0x8')]=function(_0x53468c,_0xd171be){return _0x53468c['define']('Condition',attributes,{'tableName':_0x085f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 8829d35..9e7abf1 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 _0xb912=['request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s'];(function(_0x4a5e70,_0x193ad8){var _0x3d7b50=function(_0x14b5dd){while(--_0x14b5dd){_0x4a5e70['push'](_0x4a5e70['shift']());}};_0x3d7b50(++_0x193ad8);}(_0xb912,0x180));var _0x2b91=function(_0x4d2558,_0x585c55){_0x4d2558=_0x4d2558-0x0;var _0x54e797=_0xb912[_0x4d2558];return _0x54e797;};'use strict';var _=require(_0x2b91('0x0'));var util=require(_0x2b91('0x1'));var moment=require(_0x2b91('0x2'));var BPromise=require(_0x2b91('0x3'));var rs=require(_0x2b91('0x4'));var fs=require('fs');var Redis=require(_0x2b91('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b91('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2b91('0x7'));var jayson=require(_0x2b91('0x8'));var client=jayson[_0x2b91('0x9')][_0x2b91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52bb2c,_0x513632,_0x44ba09){return new BPromise(function(_0x530f1d,_0x27c18e){return client[_0x2b91('0xb')](_0x52bb2c,_0x44ba09)[_0x2b91('0xc')](function(_0x20f25f){logger[_0x2b91('0xd')](_0x2b91('0xe'),_0x513632,_0x2b91('0xf'));logger[_0x2b91('0x10')](_0x2b91('0x11'),_0x513632,'request\x20sent',JSON[_0x2b91('0x12')](_0x20f25f));if(_0x20f25f[_0x2b91('0x13')]){if(_0x20f25f[_0x2b91('0x13')]['code']===0x1f4){logger['error'](_0x2b91('0xe'),_0x513632,_0x20f25f[_0x2b91('0x13')][_0x2b91('0x14')]);return _0x27c18e(_0x20f25f['error'][_0x2b91('0x14')]);}logger['error']('Condition,\x20%s,\x20%s',_0x513632,_0x20f25f[_0x2b91('0x13')][_0x2b91('0x14')]);return _0x530f1d(_0x20f25f[_0x2b91('0x13')][_0x2b91('0x14')]);}else{logger[_0x2b91('0xd')](_0x2b91('0xe'),_0x513632,_0x2b91('0xf'));_0x530f1d(_0x20f25f['result'][_0x2b91('0x14')]);}})['catch'](function(_0x1b54fd){logger['error']('Condition,\x20%s,\x20%s',_0x513632,_0x1b54fd);_0x27c18e(_0x1b54fd);});});} \ No newline at end of file +var _0x59c4=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x18218c,_0x57aefb){var _0xc0149a=function(_0x11e645){while(--_0x11e645){_0x18218c['push'](_0x18218c['shift']());}};_0xc0149a(++_0x57aefb);}(_0x59c4,0x1a0));var _0x459c=function(_0x406f82,_0x38f053){_0x406f82=_0x406f82-0x0;var _0x258b17=_0x59c4[_0x406f82];return _0x258b17;};'use strict';var _=require(_0x459c('0x0'));var util=require(_0x459c('0x1'));var moment=require('moment');var BPromise=require(_0x459c('0x2'));var rs=require(_0x459c('0x3'));var fs=require('fs');var Redis=require(_0x459c('0x4'));var db=require(_0x459c('0x5'))['db'];var utils=require(_0x459c('0x6'));var logger=require(_0x459c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x459c('0x8'));var client=jayson[_0x459c('0x9')][_0x459c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb23f0b,_0x6bee49,_0x199729){return new BPromise(function(_0x39d8e6,_0x9822d4){return client[_0x459c('0xb')](_0xb23f0b,_0x199729)[_0x459c('0xc')](function(_0x242a97){logger['info'](_0x459c('0xd'),_0x6bee49,_0x459c('0xe'));logger[_0x459c('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x6bee49,_0x459c('0xe'),JSON[_0x459c('0x10')](_0x242a97));if(_0x242a97['error']){if(_0x242a97[_0x459c('0x11')][_0x459c('0x12')]===0x1f4){logger[_0x459c('0x11')]('Condition,\x20%s,\x20%s',_0x6bee49,_0x242a97[_0x459c('0x11')][_0x459c('0x13')]);return _0x9822d4(_0x242a97[_0x459c('0x11')][_0x459c('0x13')]);}logger[_0x459c('0x11')](_0x459c('0xd'),_0x6bee49,_0x242a97['error'][_0x459c('0x13')]);return _0x39d8e6(_0x242a97[_0x459c('0x11')]['message']);}else{logger[_0x459c('0x14')](_0x459c('0xd'),_0x6bee49,_0x459c('0xe'));_0x39d8e6(_0x242a97[_0x459c('0x15')]['message']);}})[_0x459c('0x16')](function(_0x6cd09a){logger[_0x459c('0x11')](_0x459c('0xd'),_0x6bee49,_0x6cd09a);_0x9822d4(_0x6cd09a);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index dd4342c..65569de 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 _0x7e79=['fs-extra','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','multer','util','path','express','Router'];(function(_0x534c8f,_0x500079){var _0x5a57f5=function(_0x38ec0a){while(--_0x38ec0a){_0x534c8f['push'](_0x534c8f['shift']());}};_0x5a57f5(++_0x500079);}(_0x7e79,0x87));var _0x97e7=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x7e79[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0x97e7('0x0'));var util=require(_0x97e7('0x1'));var path=require(_0x97e7('0x2'));var timeout=require('connect-timeout');var express=require(_0x97e7('0x3'));var router=express[_0x97e7('0x4')]();var fs_extra=require(_0x97e7('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x97e7('0x6'));var controller=require(_0x97e7('0x7'));router[_0x97e7('0x8')](_0x97e7('0x9'),auth[_0x97e7('0xa')](),controller[_0x97e7('0xb')]);router[_0x97e7('0xc')](_0x97e7('0x9'),auth[_0x97e7('0xa')](),controller[_0x97e7('0xd')]);module['exports']=router; \ No newline at end of file +var _0xd929=['express','fs-extra','../../components/auth/service','./condition.controller','/:id','isAuthenticated','update','destroy','exports','util','path'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0xd929,0x15e));var _0x9d92=function(_0x4be8f3,_0x33f04e){_0x4be8f3=_0x4be8f3-0x0;var _0x1bfb36=_0xd929[_0x4be8f3];return _0x1bfb36;};'use strict';var multer=require('multer');var util=require(_0x9d92('0x0'));var path=require(_0x9d92('0x1'));var timeout=require('connect-timeout');var express=require(_0x9d92('0x2'));var router=express['Router']();var fs_extra=require(_0x9d92('0x3'));var auth=require(_0x9d92('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9d92('0x5'));router['put'](_0x9d92('0x6'),auth[_0x9d92('0x7')](),controller[_0x9d92('0x8')]);router['delete'](_0x9d92('0x6'),auth[_0x9d92('0x7')](),controller[_0x9d92('0x9')]);module[_0x9d92('0xa')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index bbe1980..2c69275 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x3f684b,_0x6a2dc8){var _0x28a061=function(_0x2a58c1){while(--_0x2a58c1){_0x3f684b['push'](_0x3f684b['shift']());}};_0x28a061(++_0x6a2dc8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x1858cf,_0x26f4f3){var _0xe2fcf1=function(_0x4059e8){while(--_0x4059e8){_0x1858cf['push'](_0x1858cf['shift']());}};_0xe2fcf1(++_0x26f4f3);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 392c664..f31b451 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 _0xba6e=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','multibar-chart','pie-chart','attrSerie1','attrSerie3','attrVoiceQueues','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','findOne','pick','getItems','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','then','get','destroy','error','name','send','index','map','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','Dashboard','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','UserProfileResource'];(function(_0x1c8cc6,_0x411e5c){var _0x522936=function(_0x38d044){while(--_0x38d044){_0x1c8cc6['push'](_0x1c8cc6['shift']());}};_0x522936(++_0x411e5c);}(_0xba6e,0x18a));var _0xeba6=function(_0x588f83,_0x1e743a){_0x588f83=_0x588f83-0x0;var _0xba072a=_0xba6e[_0x588f83];return _0xba072a;};'use strict';var emlformat=require(_0xeba6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeba6('0x1'));var jsonpatch=require(_0xeba6('0x2'));var rp=require(_0xeba6('0x3'));var moment=require(_0xeba6('0x4'));var BPromise=require(_0xeba6('0x5'));var Mustache=require(_0xeba6('0x6'));var util=require(_0xeba6('0x7'));var path=require(_0xeba6('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeba6('0x9'));var fs=require('fs');var fs_extra=require(_0xeba6('0xa'));var _=require(_0xeba6('0xb'));var squel=require(_0xeba6('0xc'));var crypto=require(_0xeba6('0xd'));var jsforce=require(_0xeba6('0xe'));var deskjs=require(_0xeba6('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xeba6('0x10'));var Redis=require(_0xeba6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xeba6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeba6('0x13'));var logger=require(_0xeba6('0x14'))('api');var utils=require(_0xeba6('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xeba6('0x16')]=_[_0xeba6('0x17')](config['redis'],{'host':_0xeba6('0x18'),'port':0x18eb});var socket=require(_0xeba6('0x19'))(new Redis(config[_0xeba6('0x16')]));require(_0xeba6('0x1a'))[_0xeba6('0x1b')](socket);function respondWithStatusCode(_0x2978e9,_0xbfa6d1){_0xbfa6d1=_0xbfa6d1||0xcc;return function(_0x288b8b){if(_0x288b8b){return _0x2978e9[_0xeba6('0x1c')](_0xbfa6d1);}return _0x2978e9[_0xeba6('0x1d')](_0xbfa6d1)[_0xeba6('0x1e')]();};}function respondWithResult(_0x39cfd0,_0x2e8444){_0x2e8444=_0x2e8444||0xc8;return function(_0x126641){if(_0x126641){return _0x39cfd0[_0xeba6('0x1d')](_0x2e8444)['json'](_0x126641);}};}function respondWithFilteredResult(_0x4cf6cb,_0x3640ad){return function(_0x531402){if(_0x531402){var _0x5b8699=typeof _0x3640ad[_0xeba6('0x1f')]===_0xeba6('0x20')&&typeof _0x3640ad[_0xeba6('0x21')]===_0xeba6('0x20');var _0x46b726=_0x531402[_0xeba6('0x22')];var _0x3e478d=_0x5b8699?0x0:_0x3640ad[_0xeba6('0x1f')];var _0x3736fa=_0x5b8699?_0x531402['count']:_0x3640ad[_0xeba6('0x1f')]+_0x3640ad[_0xeba6('0x21')];var _0x2357b5;if(_0x3736fa>=_0x46b726){_0x3736fa=_0x46b726;_0x2357b5=0xc8;}else{_0x2357b5=0xce;}_0x4cf6cb[_0xeba6('0x1d')](_0x2357b5);return _0x4cf6cb['set'](_0xeba6('0x23'),_0x3e478d+'-'+_0x3736fa+'/'+_0x46b726)['json'](_0x531402);}return null;};}function patchUpdates(_0x5d20c9){return function(_0x449c54){try{jsonpatch[_0xeba6('0x24')](_0x449c54,_0x5d20c9,!![]);}catch(_0x308d0e){return BPromise[_0xeba6('0x25')](_0x308d0e);}return _0x449c54['save']();};}function saveUpdates(_0x4ea0b9,_0x476d71){return function(_0x47a926){if(_0x47a926){return _0x47a926[_0xeba6('0x26')](_0x4ea0b9)[_0xeba6('0x27')](function(_0x4394e1){return _0x4394e1;});}return null;};}function removeEntity(_0x5c0a1c,_0x1bfcdb){return function(_0x82c48e){if(_0x82c48e){return _0x82c48e['destroy']()['then'](function(){var _0x5a4d61=_0x82c48e[_0xeba6('0x28')]({'plain':!![]});var _0x7e2c5c='CustomDashboards';return db['UserProfileResource'][_0xeba6('0x29')]({'where':{'type':_0x7e2c5c,'resourceId':_0x5a4d61['id']}})[_0xeba6('0x27')](function(){return _0x82c48e;});})[_0xeba6('0x27')](function(){_0x5c0a1c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a4e67,_0x7b6203){return function(_0x502085){if(!_0x502085){_0x1a4e67[_0xeba6('0x1c')](0x194);}return _0x502085;};}function handleError(_0x35e820,_0x571d84){_0x571d84=_0x571d84||0x1f4;return function(_0x1e6cd5){logger[_0xeba6('0x2a')](_0x1e6cd5['stack']);if(_0x1e6cd5[_0xeba6('0x2b')]){delete _0x1e6cd5[_0xeba6('0x2b')];}_0x35e820[_0xeba6('0x1d')](_0x571d84)[_0xeba6('0x2c')](_0x1e6cd5);};}exports[_0xeba6('0x2d')]=function(_0x5aca0c,_0x3ed026){var _0x52cccb={},_0x5b104c={},_0x47a4ad={'count':0x0,'rows':[]};var _0x3ab9df=_[_0xeba6('0x2e')](db['Dashboard'][_0xeba6('0x2f')],function(_0x3aa4e8){return{'name':_0x3aa4e8['fieldName'],'type':_0x3aa4e8[_0xeba6('0x30')][_0xeba6('0x31')]};});_0x5b104c[_0xeba6('0x32')]=_['map'](_0x3ab9df,'name');_0x5b104c['query']=_[_0xeba6('0x33')](_0x5aca0c[_0xeba6('0x34')]);_0x5b104c['filters']=_[_0xeba6('0x35')](_0x5b104c[_0xeba6('0x32')],_0x5b104c['query']);_0x52cccb[_0xeba6('0x36')]=_[_0xeba6('0x35')](_0x5b104c['model'],qs[_0xeba6('0x37')](_0x5aca0c[_0xeba6('0x34')][_0xeba6('0x37')]));_0x52cccb[_0xeba6('0x36')]=_0x52cccb['attributes'][_0xeba6('0x38')]?_0x52cccb['attributes']:_0x5b104c[_0xeba6('0x32')];if(!_0x5aca0c[_0xeba6('0x34')][_0xeba6('0x39')](_0xeba6('0x3a'))){_0x52cccb[_0xeba6('0x21')]=qs[_0xeba6('0x21')](_0x5aca0c['query'][_0xeba6('0x21')]);_0x52cccb[_0xeba6('0x1f')]=qs['offset'](_0x5aca0c['query'][_0xeba6('0x1f')]);}_0x52cccb[_0xeba6('0x3b')]=qs['sort'](_0x5aca0c[_0xeba6('0x34')][_0xeba6('0x3c')]);_0x52cccb[_0xeba6('0x3d')]=qs[_0xeba6('0x3e')](_['pick'](_0x5aca0c['query'],_0x5b104c[_0xeba6('0x3e')]),_0x3ab9df);if(_0x5aca0c['query'][_0xeba6('0x3f')]){_0x52cccb[_0xeba6('0x3d')]=_[_0xeba6('0x40')](_0x52cccb[_0xeba6('0x3d')],{'$or':_[_0xeba6('0x2e')](_0x3ab9df,function(_0x3e5e5a){if(_0x3e5e5a[_0xeba6('0x30')]!==_0xeba6('0x41')){var _0x53de5d={};_0x53de5d[_0x3e5e5a[_0xeba6('0x2b')]]={'$like':'%'+_0x5aca0c[_0xeba6('0x34')][_0xeba6('0x3f')]+'%'};return _0x53de5d;}})});}_0x52cccb=_['merge']({},_0x52cccb,_0x5aca0c[_0xeba6('0x42')]);var _0x3ff17e={'where':_0x52cccb[_0xeba6('0x3d')]};return db[_0xeba6('0x43')][_0xeba6('0x22')](_0x3ff17e)['then'](function(_0x3c3ace){_0x47a4ad[_0xeba6('0x22')]=_0x3c3ace;if(_0x5aca0c[_0xeba6('0x34')][_0xeba6('0x44')]){_0x52cccb[_0xeba6('0x45')]=[{'all':!![]}];}return db[_0xeba6('0x43')][_0xeba6('0x46')](_0x52cccb);})[_0xeba6('0x27')](function(_0xf696ca){_0x47a4ad[_0xeba6('0x47')]=_0xf696ca;return _0x47a4ad;})[_0xeba6('0x27')](respondWithFilteredResult(_0x3ed026,_0x52cccb))[_0xeba6('0x48')](handleError(_0x3ed026,null));};exports[_0xeba6('0x49')]=function(_0xc486c2,_0x4ef078){var _0x537bc0={'raw':![],'where':{'id':_0xc486c2[_0xeba6('0x4a')]['id']}},_0x39b5f2={};_0x39b5f2[_0xeba6('0x32')]=_[_0xeba6('0x33')](db[_0xeba6('0x43')]['rawAttributes']);_0x39b5f2[_0xeba6('0x34')]=_[_0xeba6('0x33')](_0xc486c2['query']);_0x39b5f2['filters']=_['intersection'](_0x39b5f2[_0xeba6('0x32')],_0x39b5f2[_0xeba6('0x34')]);_0x537bc0[_0xeba6('0x36')]=_['intersection'](_0x39b5f2[_0xeba6('0x32')],qs[_0xeba6('0x37')](_0xc486c2['query'][_0xeba6('0x37')]));_0x537bc0[_0xeba6('0x36')]=_0x537bc0[_0xeba6('0x36')][_0xeba6('0x38')]?_0x537bc0['attributes']:_0x39b5f2['model'];if(_0xc486c2['query'][_0xeba6('0x44')]){_0x537bc0[_0xeba6('0x45')]=[{'all':!![]}];}_0x537bc0=_[_0xeba6('0x40')]({},_0x537bc0,_0xc486c2[_0xeba6('0x42')]);return db[_0xeba6('0x43')][_0xeba6('0x4b')](_0x537bc0)['then'](handleEntityNotFound(_0x4ef078,null))[_0xeba6('0x27')](respondWithResult(_0x4ef078,null))[_0xeba6('0x48')](handleError(_0x4ef078,null));};exports[_0xeba6('0x4c')]=function(_0x19bec2,_0x57cc26){return db['Dashboard']['create'](_0x19bec2[_0xeba6('0x4d')],{})['then'](function(_0x2158c6){var _0x3e02a5=_0x19bec2[_0xeba6('0x4e')]['get']({'plain':!![]});if(!_0x3e02a5)throw new Error(_0xeba6('0x4f'));if(_0x3e02a5[_0xeba6('0x50')]==='user'){var _0x18be8a=_0x2158c6['get']({'plain':!![]});var _0x1e09ae=_0xeba6('0x51');return db[_0xeba6('0x52')][_0xeba6('0x4b')]({'where':{'name':_0x1e09ae,'userProfileId':_0x3e02a5[_0xeba6('0x53')]},'raw':!![]})[_0xeba6('0x27')](function(_0x1f25ff){if(_0x1f25ff&&_0x1f25ff[_0xeba6('0x54')]===0x0){return db[_0xeba6('0x55')][_0xeba6('0x4c')]({'name':_0x18be8a[_0xeba6('0x2b')],'resourceId':_0x18be8a['id'],'type':_0x1f25ff[_0xeba6('0x2b')],'sectionId':_0x1f25ff['id']},{})[_0xeba6('0x27')](function(){return _0x2158c6;});}else{return _0x2158c6;}})[_0xeba6('0x48')](function(_0x38e3b2){logger[_0xeba6('0x2a')](_0xeba6('0x56'),_0x38e3b2);throw _0x38e3b2;});}return _0x2158c6;})[_0xeba6('0x27')](respondWithResult(_0x57cc26,0xc9))['catch'](handleError(_0x57cc26,null));};exports[_0xeba6('0x57')]=function(_0x258ba7,_0x1a937f){var _0x203e6c={'where':{'id':_0x258ba7[_0xeba6('0x4a')]['id']}},_0x5ab1ea={};_0x5ab1ea['model']=_['keys'](db[_0xeba6('0x43')]['rawAttributes']);_0x203e6c['attributes']=_[_0xeba6('0x35')](_0x5ab1ea['model'],qs['fields'](_0x258ba7['query']['fields']));_0x203e6c[_0xeba6('0x36')]=_0x203e6c[_0xeba6('0x36')][_0xeba6('0x38')]?_0x203e6c[_0xeba6('0x36')]:_0x5ab1ea[_0xeba6('0x32')];if(_0x258ba7[_0xeba6('0x34')][_0xeba6('0x44')]){_0x203e6c['include']=[{'all':!![]}];}_0x203e6c=_[_0xeba6('0x40')]({},_0x203e6c,_0x258ba7[_0xeba6('0x42')]);return db[_0xeba6('0x43')][_0xeba6('0x4b')](_0x203e6c)[_0xeba6('0x27')](handleEntityNotFound(_0x1a937f,null))[_0xeba6('0x27')](function(_0x1474c1){if(_0x1474c1){var _0x17448c=_0x1474c1[_0xeba6('0x28')]({'plain':!![]});_0x17448c=qs['omit'](_0x17448c,['id',_0xeba6('0x58'),_0xeba6('0x59')]);_0x258ba7[_0xeba6('0x4d')]=_[_0xeba6('0x5a')](_0x258ba7[_0xeba6('0x4d')],['id',_0xeba6('0x58'),_0xeba6('0x59')]);return db[_0xeba6('0x43')][_0xeba6('0x4c')](_['merge'](_0x17448c,_0x258ba7[_0xeba6('0x4d')]),{'include':_0x258ba7[_0xeba6('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0xeba6('0x27')](function(_0x189462){var _0x2be7d3=_0x258ba7[_0xeba6('0x4e')][_0xeba6('0x28')]({'plain':!![]});if(!_0x2be7d3)throw new Error(_0xeba6('0x4f'));if(_0x2be7d3[_0xeba6('0x50')]===_0xeba6('0x4e')){var _0x59193f=_0x189462['get']({'plain':!![]});var _0x241fda=_0xeba6('0x51');return db[_0xeba6('0x52')][_0xeba6('0x4b')]({'where':{'name':_0x241fda,'userProfileId':_0x2be7d3[_0xeba6('0x53')]},'raw':!![]})[_0xeba6('0x27')](function(_0x3fbb90){if(_0x3fbb90&&_0x3fbb90[_0xeba6('0x54')]===0x0){return db[_0xeba6('0x55')][_0xeba6('0x4c')]({'name':_0x59193f[_0xeba6('0x2b')],'resourceId':_0x59193f['id'],'type':_0x3fbb90['name'],'sectionId':_0x3fbb90['id']},{})['then'](function(){return _0x189462;});}else{return _0x189462;}})['catch'](function(_0x15a9f4){logger[_0xeba6('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15a9f4);throw _0x15a9f4;});}return _0x189462;});}})[_0xeba6('0x27')](respondWithResult(_0x1a937f,0xc9))[_0xeba6('0x48')](handleError(_0x1a937f,null));};exports['update']=function(_0x594cc0,_0x6b18b7){if(_0x594cc0[_0xeba6('0x4d')]['id']){delete _0x594cc0[_0xeba6('0x4d')]['id'];}return db[_0xeba6('0x43')][_0xeba6('0x4b')]({'where':{'id':_0x594cc0['params']['id']}})[_0xeba6('0x27')](handleEntityNotFound(_0x6b18b7,null))[_0xeba6('0x27')](saveUpdates(_0x594cc0[_0xeba6('0x4d')],null))[_0xeba6('0x27')](respondWithResult(_0x6b18b7,null))[_0xeba6('0x48')](handleError(_0x6b18b7,null));};exports[_0xeba6('0x29')]=function(_0x5ea576,_0x4f32a4){return db[_0xeba6('0x43')][_0xeba6('0x4b')]({'where':{'id':_0x5ea576[_0xeba6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f32a4,null))['then'](removeEntity(_0x4f32a4,null))[_0xeba6('0x48')](handleError(_0x4f32a4,null));};function widgetAttributes(_0x3001d8){try{switch(_0x3001d8[_0xeba6('0x30')]){case'iframe':return[{'name':_0xeba6('0x5b'),'value':_0x3001d8[_0xeba6('0x5b')]||(_0x3001d8[_0xeba6('0x5c')]&&_0x3001d8[_0xeba6('0x5c')][0x0]?_0x3001d8['attrs'][0x0][_0xeba6('0x5d')]:undefined)||_0xeba6('0x5e')}];case _0xeba6('0x5f'):return[{'name':_0xeba6('0x60'),'value':_0x3001d8[_0xeba6('0x60')]||(_0x3001d8['attrs']&&_0x3001d8[_0xeba6('0x5c')][0x0]?_0x3001d8['attrs'][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0xeba6('0x61'),'value':_0x3001d8[_0xeba6('0x61')]||(_0x3001d8[_0xeba6('0x5c')]&&_0x3001d8[_0xeba6('0x5c')][0x0]?_0x3001d8[_0xeba6('0x5c')][0x0][_0xeba6('0x5d')]:undefined)||_0xeba6('0x62')},{'name':_0xeba6('0x63'),'value':_0x3001d8[_0xeba6('0x63')]||(_0x3001d8['attrs']&&_0x3001d8[_0xeba6('0x5c')][0x1]?_0x3001d8[_0xeba6('0x5c')][0x1][_0xeba6('0x5d')]:undefined)||'0.00'},{'name':_0xeba6('0x64'),'value':_0x3001d8[_0xeba6('0x64')]||(_0x3001d8[_0xeba6('0x5c')]&&_0x3001d8[_0xeba6('0x5c')][0x2]?_0x3001d8[_0xeba6('0x5c')][0x2][_0xeba6('0x5d')]:undefined)||0xc}];case _0xeba6('0x65'):return[{'name':_0xeba6('0x66'),'value':_0x3001d8[_0xeba6('0x66')]||(_0x3001d8[_0xeba6('0x5c')]&&_0x3001d8[_0xeba6('0x5c')][0x0]?_0x3001d8['attrs'][0x0][_0xeba6('0x5d')]:undefined)||_0xeba6('0x67')},{'name':'attrVoiceQueues','value':_0x3001d8['attrVoiceQueues']||(_0x3001d8[_0xeba6('0x5c')]&&_0x3001d8['attrs'][0x1]?_0x3001d8[_0xeba6('0x5c')][0x1][_0xeba6('0x5d')]:undefined)||[]},{'name':_0xeba6('0x64'),'value':_0x3001d8[_0xeba6('0x64')]||(_0x3001d8[_0xeba6('0x5c')]&&_0x3001d8[_0xeba6('0x5c')][0x2]?_0x3001d8['attrs'][0x2]['value']:undefined)||0x14}];case _0xeba6('0x68'):case _0xeba6('0x69'):return[{'name':_0xeba6('0x6a'),'value':_0x3001d8[_0xeba6('0x6a')]||(_0x3001d8[_0xeba6('0x5c')]&&_0x3001d8[_0xeba6('0x5c')][0x0]?_0x3001d8['attrs'][0x0][_0xeba6('0x5d')]:undefined)||_0xeba6('0x67')},{'name':'attrSerie2','value':_0x3001d8['attrSerie2']||(_0x3001d8[_0xeba6('0x5c')]&&_0x3001d8[_0xeba6('0x5c')][0x1]?_0x3001d8[_0xeba6('0x5c')][0x1][_0xeba6('0x5d')]:undefined)||null},{'name':_0xeba6('0x6b'),'value':_0x3001d8[_0xeba6('0x6b')]||(_0x3001d8[_0xeba6('0x5c')]&&_0x3001d8[_0xeba6('0x5c')][0x2]?_0x3001d8[_0xeba6('0x5c')][0x2][_0xeba6('0x5d')]:undefined)||null},{'name':_0xeba6('0x6c'),'value':_0x3001d8['attrVoiceQueues']||(_0x3001d8[_0xeba6('0x5c')]&&_0x3001d8[_0xeba6('0x5c')][0x3]?_0x3001d8['attrs'][0x3][_0xeba6('0x5d')]:undefined)||[]}];case _0xeba6('0x6d'):return[{'name':'attrReport','type':_0x3001d8[_0xeba6('0x6e')]||(_0x3001d8[_0xeba6('0x5c')]&&_0x3001d8[_0xeba6('0x5c')][0x0]?_0x3001d8[_0xeba6('0x5c')][0x0][_0xeba6('0x30')]:undefined)||null,'value':_0x3001d8[_0xeba6('0x6f')]||(_0x3001d8[_0xeba6('0x5c')]&&_0x3001d8['attrs'][0x0]?_0x3001d8[_0xeba6('0x5c')][0x0][_0xeba6('0x5d')]:undefined)||null},{'name':_0xeba6('0x70'),'value':_0x3001d8[_0xeba6('0x70')]||(_0x3001d8[_0xeba6('0x5c')]&&_0x3001d8[_0xeba6('0x5c')][0x1]?_0x3001d8['attrs'][0x1][_0xeba6('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x563742){logger[_0xeba6('0x2a')](_0xeba6('0x71'),JSON[_0xeba6('0x72')](_0x563742));return[];}}exports[_0xeba6('0x73')]=function(_0x147b2a,_0x361cf4,_0x3618d2){if(_0x147b2a[_0xeba6('0x4d')]['id']){delete _0x147b2a[_0xeba6('0x4d')]['id'];}return db[_0xeba6('0x43')][_0xeba6('0x4b')]({'where':{'id':_0x147b2a[_0xeba6('0x4a')]['id']}})[_0xeba6('0x27')](handleEntityNotFound(_0x361cf4,null))[_0xeba6('0x27')](function(_0x34fbbb){if(_0x34fbbb){_0x147b2a[_0xeba6('0x4d')]['DashboardId']=_0x34fbbb['id'];_0x147b2a[_0xeba6('0x4d')][_0xeba6('0x5c')]=widgetAttributes(_0x147b2a[_0xeba6('0x4d')]);return db[_0xeba6('0x74')][_0xeba6('0x4c')](_0x147b2a['body']);}})[_0xeba6('0x27')](respondWithResult(_0x361cf4,null))[_0xeba6('0x48')](handleError(_0x361cf4,null));};exports['getItems']=function(_0x125fab,_0x118a64,_0x3b951f){var _0x3d77dc={};var _0x5da098={};var _0xda384c;var _0x560aa9;return db[_0xeba6('0x43')][_0xeba6('0x75')]({'where':{'id':_0x125fab[_0xeba6('0x4a')]['id']}})[_0xeba6('0x27')](handleEntityNotFound(_0x118a64,null))[_0xeba6('0x27')](function(_0x1c0630){if(_0x1c0630){_0xda384c=_0x1c0630;_0x5da098['model']=_['keys'](db['DashboardItem'][_0xeba6('0x2f')]);_0x5da098[_0xeba6('0x34')]=_[_0xeba6('0x33')](_0x125fab[_0xeba6('0x34')]);_0x5da098[_0xeba6('0x3e')]=_['intersection'](_0x5da098['model'],_0x5da098[_0xeba6('0x34')]);_0x3d77dc['attributes']=_[_0xeba6('0x35')](_0x5da098['model'],qs[_0xeba6('0x37')](_0x125fab[_0xeba6('0x34')][_0xeba6('0x37')]));_0x3d77dc[_0xeba6('0x36')]=_0x3d77dc[_0xeba6('0x36')]['length']?_0x3d77dc[_0xeba6('0x36')]:_0x5da098['model'];_0x3d77dc[_0xeba6('0x3b')]=qs[_0xeba6('0x3c')](_0x125fab['query'][_0xeba6('0x3c')]);_0x3d77dc['where']=qs['filters'](_[_0xeba6('0x76')](_0x125fab['query'],_0x5da098['filters']));if(_0x125fab[_0xeba6('0x34')][_0xeba6('0x3f')]){_0x3d77dc['where']=_[_0xeba6('0x40')](_0x3d77dc[_0xeba6('0x3d')],{'$or':_[_0xeba6('0x2e')](_0x3d77dc[_0xeba6('0x36')],function(_0x5eb3f0){var _0x184ab8={};_0x184ab8[_0x5eb3f0]={'$like':'%'+_0x125fab[_0xeba6('0x34')][_0xeba6('0x3f')]+'%'};return _0x184ab8;})});}_0x3d77dc=_[_0xeba6('0x40')]({},_0x3d77dc,_0x125fab['options']);return _0xda384c['getItems'](_0x3d77dc);}})['then'](function(_0x10dcaa){if(_0x10dcaa){_0x560aa9=_0x10dcaa['length'];if(!_0x125fab['query'][_0xeba6('0x39')](_0xeba6('0x3a'))){_0x3d77dc['limit']=qs[_0xeba6('0x21')](_0x125fab[_0xeba6('0x34')][_0xeba6('0x21')]);_0x3d77dc[_0xeba6('0x1f')]=qs[_0xeba6('0x1f')](_0x125fab[_0xeba6('0x34')][_0xeba6('0x1f')]);}return _0xda384c[_0xeba6('0x77')](_0x3d77dc);}})['then'](function(_0x4a6397){if(_0x4a6397){return _0x4a6397?{'count':_0x560aa9,'rows':_0x4a6397}:null;}})[_0xeba6('0x27')](respondWithResult(_0x118a64,null))[_0xeba6('0x48')](handleError(_0x118a64,null));}; \ No newline at end of file +var _0xe158=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','end','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','sendStatus','error','send','index','map','rawAttributes','fieldName','type','key','model','name','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','Dashboard','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','clone','omit','createdAt','updatedAt','UserProfileSection','autoAssociation','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','addItem','DashboardId','DashboardItem','getItems','findOne','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0xe158,0x1df));var _0x8e15=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0xe158[_0x213518];return _0x1baf75;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8e15('0x0'));var zipdir=require(_0x8e15('0x1'));var jsonpatch=require(_0x8e15('0x2'));var rp=require(_0x8e15('0x3'));var moment=require(_0x8e15('0x4'));var BPromise=require(_0x8e15('0x5'));var Mustache=require('mustache');var util=require(_0x8e15('0x6'));var path=require('path');var sox=require(_0x8e15('0x7'));var csv=require(_0x8e15('0x8'));var ejs=require(_0x8e15('0x9'));var fs=require('fs');var fs_extra=require(_0x8e15('0xa'));var _=require('lodash');var squel=require(_0x8e15('0xb'));var crypto=require(_0x8e15('0xc'));var jsforce=require(_0x8e15('0xd'));var deskjs=require(_0x8e15('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8e15('0xf'));var Papa=require(_0x8e15('0x10'));var Redis=require('ioredis');var authService=require(_0x8e15('0x11'));var qs=require(_0x8e15('0x12'));var as=require(_0x8e15('0x13'));var hardwareService=require(_0x8e15('0x14'));var logger=require('../../config/logger')(_0x8e15('0x15'));var utils=require(_0x8e15('0x16'));var config=require(_0x8e15('0x17'));var licenseUtil=require(_0x8e15('0x18'));var db=require(_0x8e15('0x19'))['db'];config[_0x8e15('0x1a')]=_[_0x8e15('0x1b')](config[_0x8e15('0x1a')],{'host':_0x8e15('0x1c'),'port':0x18eb});var socket=require(_0x8e15('0x1d'))(new Redis(config[_0x8e15('0x1a')]));require(_0x8e15('0x1e'))[_0x8e15('0x1f')](socket);function respondWithStatusCode(_0x3669c4,_0x2aa733){_0x2aa733=_0x2aa733||0xcc;return function(_0x5e3212){if(_0x5e3212){return _0x3669c4['sendStatus'](_0x2aa733);}return _0x3669c4['status'](_0x2aa733)[_0x8e15('0x20')]();};}function respondWithResult(_0x97ba3e,_0x4b16ca){_0x4b16ca=_0x4b16ca||0xc8;return function(_0xbe1b45){if(_0xbe1b45){return _0x97ba3e[_0x8e15('0x21')](_0x4b16ca)[_0x8e15('0x22')](_0xbe1b45);}};}function respondWithFilteredResult(_0x174a87,_0x50e0be){return function(_0x3695a8){if(_0x3695a8){var _0x3e75df=typeof _0x50e0be[_0x8e15('0x23')]==='undefined'&&typeof _0x50e0be['limit']===_0x8e15('0x24');var _0x3af082=_0x3695a8[_0x8e15('0x25')];var _0x3f36f5=_0x3e75df?0x0:_0x50e0be[_0x8e15('0x23')];var _0x2aa2bc=_0x3e75df?_0x3695a8[_0x8e15('0x25')]:_0x50e0be[_0x8e15('0x23')]+_0x50e0be[_0x8e15('0x26')];var _0x231758;if(_0x2aa2bc>=_0x3af082){_0x2aa2bc=_0x3af082;_0x231758=0xc8;}else{_0x231758=0xce;}_0x174a87[_0x8e15('0x21')](_0x231758);return _0x174a87['set'](_0x8e15('0x27'),_0x3f36f5+'-'+_0x2aa2bc+'/'+_0x3af082)['json'](_0x3695a8);}return null;};}function patchUpdates(_0x32d100){return function(_0x5be06a){try{jsonpatch['apply'](_0x5be06a,_0x32d100,!![]);}catch(_0x439cf9){return BPromise[_0x8e15('0x28')](_0x439cf9);}return _0x5be06a[_0x8e15('0x29')]();};}function saveUpdates(_0x5f2003,_0x16dfc9){return function(_0x66ede3){if(_0x66ede3){return _0x66ede3[_0x8e15('0x2a')](_0x5f2003)[_0x8e15('0x2b')](function(_0xda3d45){return _0xda3d45;});}return null;};}function removeEntity(_0x25341c,_0x716ace){return function(_0x2e61d1){if(_0x2e61d1){return _0x2e61d1[_0x8e15('0x2c')]()['then'](function(){var _0x1b16e3=_0x2e61d1[_0x8e15('0x2d')]({'plain':!![]});var _0xae64=_0x8e15('0x2e');return db[_0x8e15('0x2f')][_0x8e15('0x2c')]({'where':{'type':_0xae64,'resourceId':_0x1b16e3['id']}})[_0x8e15('0x2b')](function(){return _0x2e61d1;});})[_0x8e15('0x2b')](function(){_0x25341c[_0x8e15('0x21')](0xcc)[_0x8e15('0x20')]();});}};}function handleEntityNotFound(_0x41f622,_0x180333){return function(_0x54e830){if(!_0x54e830){_0x41f622[_0x8e15('0x30')](0x194);}return _0x54e830;};}function handleError(_0x52077f,_0x2ed85a){_0x2ed85a=_0x2ed85a||0x1f4;return function(_0xa9eae4){logger[_0x8e15('0x31')](_0xa9eae4['stack']);if(_0xa9eae4['name']){delete _0xa9eae4['name'];}_0x52077f[_0x8e15('0x21')](_0x2ed85a)[_0x8e15('0x32')](_0xa9eae4);};}exports[_0x8e15('0x33')]=function(_0x182b5d,_0x2cb7ae){var _0x30e456={},_0x46368c={},_0x304e1d={'count':0x0,'rows':[]};var _0x3e4179=_[_0x8e15('0x34')](db['Dashboard'][_0x8e15('0x35')],function(_0x430f64){return{'name':_0x430f64[_0x8e15('0x36')],'type':_0x430f64[_0x8e15('0x37')][_0x8e15('0x38')]};});_0x46368c[_0x8e15('0x39')]=_[_0x8e15('0x34')](_0x3e4179,_0x8e15('0x3a'));_0x46368c[_0x8e15('0x3b')]=_['keys'](_0x182b5d[_0x8e15('0x3b')]);_0x46368c['filters']=_['intersection'](_0x46368c[_0x8e15('0x39')],_0x46368c[_0x8e15('0x3b')]);_0x30e456[_0x8e15('0x3c')]=_[_0x8e15('0x3d')](_0x46368c[_0x8e15('0x39')],qs[_0x8e15('0x3e')](_0x182b5d[_0x8e15('0x3b')][_0x8e15('0x3e')]));_0x30e456[_0x8e15('0x3c')]=_0x30e456[_0x8e15('0x3c')][_0x8e15('0x3f')]?_0x30e456[_0x8e15('0x3c')]:_0x46368c[_0x8e15('0x39')];if(!_0x182b5d[_0x8e15('0x3b')][_0x8e15('0x40')]('nolimit')){_0x30e456['limit']=qs['limit'](_0x182b5d[_0x8e15('0x3b')][_0x8e15('0x26')]);_0x30e456['offset']=qs[_0x8e15('0x23')](_0x182b5d[_0x8e15('0x3b')][_0x8e15('0x23')]);}_0x30e456[_0x8e15('0x41')]=qs[_0x8e15('0x42')](_0x182b5d['query'][_0x8e15('0x42')]);_0x30e456[_0x8e15('0x43')]=qs['filters'](_[_0x8e15('0x44')](_0x182b5d[_0x8e15('0x3b')],_0x46368c[_0x8e15('0x45')]),_0x3e4179);if(_0x182b5d['query'][_0x8e15('0x46')]){_0x30e456[_0x8e15('0x43')]=_[_0x8e15('0x47')](_0x30e456['where'],{'$or':_[_0x8e15('0x34')](_0x3e4179,function(_0xb845c5){if(_0xb845c5[_0x8e15('0x37')]!==_0x8e15('0x48')){var _0x249188={};_0x249188[_0xb845c5['name']]={'$like':'%'+_0x182b5d[_0x8e15('0x3b')]['filter']+'%'};return _0x249188;}})});}_0x30e456=_[_0x8e15('0x47')]({},_0x30e456,_0x182b5d[_0x8e15('0x49')]);var _0x60ec24={'where':_0x30e456[_0x8e15('0x43')]};return db[_0x8e15('0x4a')][_0x8e15('0x25')](_0x60ec24)[_0x8e15('0x2b')](function(_0x19ed0b){_0x304e1d[_0x8e15('0x25')]=_0x19ed0b;if(_0x182b5d[_0x8e15('0x3b')][_0x8e15('0x4b')]){_0x30e456['include']=[{'all':!![]}];}return db[_0x8e15('0x4a')][_0x8e15('0x4c')](_0x30e456);})[_0x8e15('0x2b')](function(_0x396811){_0x304e1d[_0x8e15('0x4d')]=_0x396811;return _0x304e1d;})[_0x8e15('0x2b')](respondWithFilteredResult(_0x2cb7ae,_0x30e456))[_0x8e15('0x4e')](handleError(_0x2cb7ae,null));};exports[_0x8e15('0x4f')]=function(_0x197b5f,_0x596fe0){var _0x30e968={'raw':![],'where':{'id':_0x197b5f[_0x8e15('0x50')]['id']}},_0x23fdb5={};_0x23fdb5[_0x8e15('0x39')]=_[_0x8e15('0x51')](db[_0x8e15('0x4a')]['rawAttributes']);_0x23fdb5[_0x8e15('0x3b')]=_['keys'](_0x197b5f[_0x8e15('0x3b')]);_0x23fdb5[_0x8e15('0x45')]=_[_0x8e15('0x3d')](_0x23fdb5[_0x8e15('0x39')],_0x23fdb5[_0x8e15('0x3b')]);_0x30e968[_0x8e15('0x3c')]=_['intersection'](_0x23fdb5[_0x8e15('0x39')],qs['fields'](_0x197b5f[_0x8e15('0x3b')]['fields']));_0x30e968[_0x8e15('0x3c')]=_0x30e968[_0x8e15('0x3c')][_0x8e15('0x3f')]?_0x30e968['attributes']:_0x23fdb5['model'];if(_0x197b5f['query'][_0x8e15('0x4b')]){_0x30e968[_0x8e15('0x52')]=[{'all':!![]}];}_0x30e968=_['merge']({},_0x30e968,_0x197b5f[_0x8e15('0x49')]);return db['Dashboard'][_0x8e15('0x53')](_0x30e968)[_0x8e15('0x2b')](handleEntityNotFound(_0x596fe0,null))['then'](respondWithResult(_0x596fe0,null))[_0x8e15('0x4e')](handleError(_0x596fe0,null));};exports['create']=function(_0x34dbc4,_0x348cac){return db[_0x8e15('0x4a')][_0x8e15('0x54')](_0x34dbc4[_0x8e15('0x55')],{})[_0x8e15('0x2b')](function(_0x22983e){var _0x40b0cb=_0x34dbc4[_0x8e15('0x56')][_0x8e15('0x2d')]({'plain':!![]});if(!_0x40b0cb)throw new Error(_0x8e15('0x57'));if(_0x40b0cb[_0x8e15('0x58')]===_0x8e15('0x56')){var _0x1916f2=_0x22983e['get']({'plain':!![]});var _0x5a760c=_0x8e15('0x2e');return db['UserProfileSection']['find']({'where':{'name':_0x5a760c,'userProfileId':_0x40b0cb[_0x8e15('0x59')]},'raw':!![]})[_0x8e15('0x2b')](function(_0x3445ce){if(_0x3445ce&&_0x3445ce['autoAssociation']===0x0){return db[_0x8e15('0x2f')][_0x8e15('0x54')]({'name':_0x1916f2[_0x8e15('0x3a')],'resourceId':_0x1916f2['id'],'type':_0x3445ce[_0x8e15('0x3a')],'sectionId':_0x3445ce['id']},{})['then'](function(){return _0x22983e;});}else{return _0x22983e;}})[_0x8e15('0x4e')](function(_0x139aa1){logger[_0x8e15('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x139aa1);throw _0x139aa1;});}return _0x22983e;})[_0x8e15('0x2b')](respondWithResult(_0x348cac,0xc9))[_0x8e15('0x4e')](handleError(_0x348cac,null));};exports[_0x8e15('0x5a')]=function(_0x2f391d,_0x3e4b89){var _0x5abe47={'where':{'id':_0x2f391d[_0x8e15('0x50')]['id']}},_0x516281={};_0x516281[_0x8e15('0x39')]=_['keys'](db[_0x8e15('0x4a')][_0x8e15('0x35')]);_0x5abe47['attributes']=_[_0x8e15('0x3d')](_0x516281['model'],qs['fields'](_0x2f391d[_0x8e15('0x3b')][_0x8e15('0x3e')]));_0x5abe47[_0x8e15('0x3c')]=_0x5abe47[_0x8e15('0x3c')][_0x8e15('0x3f')]?_0x5abe47[_0x8e15('0x3c')]:_0x516281[_0x8e15('0x39')];if(_0x2f391d[_0x8e15('0x3b')]['includeAll']){_0x5abe47[_0x8e15('0x52')]=[{'all':!![]}];}_0x5abe47=_[_0x8e15('0x47')]({},_0x5abe47,_0x2f391d['options']);return db[_0x8e15('0x4a')][_0x8e15('0x53')](_0x5abe47)[_0x8e15('0x2b')](handleEntityNotFound(_0x3e4b89,null))['then'](function(_0x14c5c9){if(_0x14c5c9){var _0x998d1a=_0x14c5c9[_0x8e15('0x2d')]({'plain':!![]});_0x998d1a=qs[_0x8e15('0x5b')](_0x998d1a,['id',_0x8e15('0x5c'),_0x8e15('0x5d')]);_0x2f391d[_0x8e15('0x55')]=_['omit'](_0x2f391d[_0x8e15('0x55')],['id',_0x8e15('0x5c'),_0x8e15('0x5d')]);return db[_0x8e15('0x4a')][_0x8e15('0x54')](_[_0x8e15('0x47')](_0x998d1a,_0x2f391d['body']),{'include':_0x2f391d[_0x8e15('0x3b')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x7d1eb3){var _0x52308c=_0x2f391d[_0x8e15('0x56')][_0x8e15('0x2d')]({'plain':!![]});if(!_0x52308c)throw new Error(_0x8e15('0x57'));if(_0x52308c[_0x8e15('0x58')]==='user'){var _0x558fc4=_0x7d1eb3[_0x8e15('0x2d')]({'plain':!![]});var _0x38b2d3=_0x8e15('0x2e');return db[_0x8e15('0x5e')][_0x8e15('0x53')]({'where':{'name':_0x38b2d3,'userProfileId':_0x52308c[_0x8e15('0x59')]},'raw':!![]})[_0x8e15('0x2b')](function(_0xc2fa1a){if(_0xc2fa1a&&_0xc2fa1a[_0x8e15('0x5f')]===0x0){return db[_0x8e15('0x2f')]['create']({'name':_0x558fc4[_0x8e15('0x3a')],'resourceId':_0x558fc4['id'],'type':_0xc2fa1a['name'],'sectionId':_0xc2fa1a['id']},{})[_0x8e15('0x2b')](function(){return _0x7d1eb3;});}else{return _0x7d1eb3;}})[_0x8e15('0x4e')](function(_0x1f09df){logger[_0x8e15('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f09df);throw _0x1f09df;});}return _0x7d1eb3;});}})[_0x8e15('0x2b')](respondWithResult(_0x3e4b89,0xc9))[_0x8e15('0x4e')](handleError(_0x3e4b89,null));};exports[_0x8e15('0x2a')]=function(_0x3bce78,_0x3d62d6){if(_0x3bce78['body']['id']){delete _0x3bce78[_0x8e15('0x55')]['id'];}return db[_0x8e15('0x4a')][_0x8e15('0x53')]({'where':{'id':_0x3bce78[_0x8e15('0x50')]['id']}})[_0x8e15('0x2b')](handleEntityNotFound(_0x3d62d6,null))[_0x8e15('0x2b')](saveUpdates(_0x3bce78[_0x8e15('0x55')],null))[_0x8e15('0x2b')](respondWithResult(_0x3d62d6,null))[_0x8e15('0x4e')](handleError(_0x3d62d6,null));};exports['destroy']=function(_0x49737a,_0x1da90b){return db['Dashboard'][_0x8e15('0x53')]({'where':{'id':_0x49737a[_0x8e15('0x50')]['id']}})['then'](handleEntityNotFound(_0x1da90b,null))[_0x8e15('0x2b')](removeEntity(_0x1da90b,null))['catch'](handleError(_0x1da90b,null));};function widgetAttributes(_0x495cbf){try{switch(_0x495cbf[_0x8e15('0x37')]){case _0x8e15('0x60'):return[{'name':_0x8e15('0x61'),'value':_0x495cbf[_0x8e15('0x61')]||(_0x495cbf[_0x8e15('0x62')]&&_0x495cbf[_0x8e15('0x62')][0x0]?_0x495cbf['attrs'][0x0][_0x8e15('0x63')]:undefined)||_0x8e15('0x64')}];case _0x8e15('0x65'):return[{'name':_0x8e15('0x66'),'value':_0x495cbf['attrPath']||(_0x495cbf[_0x8e15('0x62')]&&_0x495cbf[_0x8e15('0x62')][0x0]?_0x495cbf['attrs'][0x0][_0x8e15('0x63')]:undefined)||''}];case _0x8e15('0x67'):return[{'name':_0x8e15('0x68'),'value':_0x495cbf[_0x8e15('0x68')]||(_0x495cbf[_0x8e15('0x62')]&&_0x495cbf[_0x8e15('0x62')][0x0]?_0x495cbf[_0x8e15('0x62')][0x0][_0x8e15('0x63')]:undefined)||'HH:mm:ss'},{'name':_0x8e15('0x69'),'value':_0x495cbf['attrTimezone']||(_0x495cbf[_0x8e15('0x62')]&&_0x495cbf[_0x8e15('0x62')][0x1]?_0x495cbf[_0x8e15('0x62')][0x1][_0x8e15('0x63')]:undefined)||_0x8e15('0x6a')},{'name':_0x8e15('0x6b'),'value':_0x495cbf[_0x8e15('0x6b')]||(_0x495cbf[_0x8e15('0x62')]&&_0x495cbf['attrs'][0x2]?_0x495cbf[_0x8e15('0x62')][0x2][_0x8e15('0x63')]:undefined)||0xc}];case'counter':return[{'name':_0x8e15('0x6c'),'value':_0x495cbf['attrMetric']||(_0x495cbf[_0x8e15('0x62')]&&_0x495cbf[_0x8e15('0x62')][0x0]?_0x495cbf[_0x8e15('0x62')][0x0][_0x8e15('0x63')]:undefined)||_0x8e15('0x6d')},{'name':'attrVoiceQueues','value':_0x495cbf[_0x8e15('0x6e')]||(_0x495cbf[_0x8e15('0x62')]&&_0x495cbf[_0x8e15('0x62')][0x1]?_0x495cbf[_0x8e15('0x62')][0x1][_0x8e15('0x63')]:undefined)||[]},{'name':_0x8e15('0x6b'),'value':_0x495cbf['attrFontSize']||(_0x495cbf[_0x8e15('0x62')]&&_0x495cbf[_0x8e15('0x62')][0x2]?_0x495cbf[_0x8e15('0x62')][0x2]['value']:undefined)||0x14}];case _0x8e15('0x6f'):case'pie-chart':return[{'name':_0x8e15('0x70'),'value':_0x495cbf['attrSerie1']||(_0x495cbf[_0x8e15('0x62')]&&_0x495cbf[_0x8e15('0x62')][0x0]?_0x495cbf[_0x8e15('0x62')][0x0][_0x8e15('0x63')]:undefined)||'total'},{'name':_0x8e15('0x71'),'value':_0x495cbf['attrSerie2']||(_0x495cbf['attrs']&&_0x495cbf[_0x8e15('0x62')][0x1]?_0x495cbf[_0x8e15('0x62')][0x1][_0x8e15('0x63')]:undefined)||null},{'name':_0x8e15('0x72'),'value':_0x495cbf['attrSerie3']||(_0x495cbf[_0x8e15('0x62')]&&_0x495cbf[_0x8e15('0x62')][0x2]?_0x495cbf[_0x8e15('0x62')][0x2][_0x8e15('0x63')]:undefined)||null},{'name':_0x8e15('0x6e'),'value':_0x495cbf['attrVoiceQueues']||(_0x495cbf['attrs']&&_0x495cbf[_0x8e15('0x62')][0x3]?_0x495cbf[_0x8e15('0x62')][0x3][_0x8e15('0x63')]:undefined)||[]}];case _0x8e15('0x73'):return[{'name':'attrReport','type':_0x495cbf['reportType']||(_0x495cbf[_0x8e15('0x62')]&&_0x495cbf[_0x8e15('0x62')][0x0]?_0x495cbf['attrs'][0x0][_0x8e15('0x37')]:undefined)||null,'value':_0x495cbf[_0x8e15('0x74')]||(_0x495cbf[_0x8e15('0x62')]&&_0x495cbf[_0x8e15('0x62')][0x0]?_0x495cbf[_0x8e15('0x62')][0x0][_0x8e15('0x63')]:undefined)||null},{'name':'attrRefresh','value':_0x495cbf[_0x8e15('0x75')]||(_0x495cbf[_0x8e15('0x62')]&&_0x495cbf[_0x8e15('0x62')][0x1]?_0x495cbf[_0x8e15('0x62')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0xe5b17d){logger[_0x8e15('0x31')]('widgetAttributes:\x20%s',JSON['stringify'](_0xe5b17d));return[];}}exports[_0x8e15('0x76')]=function(_0x487374,_0xa33a01,_0x513850){if(_0x487374[_0x8e15('0x55')]['id']){delete _0x487374['body']['id'];}return db['Dashboard'][_0x8e15('0x53')]({'where':{'id':_0x487374['params']['id']}})[_0x8e15('0x2b')](handleEntityNotFound(_0xa33a01,null))[_0x8e15('0x2b')](function(_0xa9afa7){if(_0xa9afa7){_0x487374[_0x8e15('0x55')][_0x8e15('0x77')]=_0xa9afa7['id'];_0x487374['body'][_0x8e15('0x62')]=widgetAttributes(_0x487374[_0x8e15('0x55')]);return db[_0x8e15('0x78')][_0x8e15('0x54')](_0x487374[_0x8e15('0x55')]);}})[_0x8e15('0x2b')](respondWithResult(_0xa33a01,null))[_0x8e15('0x4e')](handleError(_0xa33a01,null));};exports[_0x8e15('0x79')]=function(_0x125fd7,_0x3d6c59,_0x3971dc){var _0x249185={};var _0x12d860={};var _0xe4fbd5;var _0x500d9e;return db[_0x8e15('0x4a')][_0x8e15('0x7a')]({'where':{'id':_0x125fd7[_0x8e15('0x50')]['id']}})[_0x8e15('0x2b')](handleEntityNotFound(_0x3d6c59,null))[_0x8e15('0x2b')](function(_0x86fa8b){if(_0x86fa8b){_0xe4fbd5=_0x86fa8b;_0x12d860[_0x8e15('0x39')]=_['keys'](db[_0x8e15('0x78')]['rawAttributes']);_0x12d860[_0x8e15('0x3b')]=_[_0x8e15('0x51')](_0x125fd7[_0x8e15('0x3b')]);_0x12d860[_0x8e15('0x45')]=_['intersection'](_0x12d860[_0x8e15('0x39')],_0x12d860[_0x8e15('0x3b')]);_0x249185[_0x8e15('0x3c')]=_[_0x8e15('0x3d')](_0x12d860[_0x8e15('0x39')],qs[_0x8e15('0x3e')](_0x125fd7[_0x8e15('0x3b')]['fields']));_0x249185[_0x8e15('0x3c')]=_0x249185[_0x8e15('0x3c')][_0x8e15('0x3f')]?_0x249185[_0x8e15('0x3c')]:_0x12d860[_0x8e15('0x39')];_0x249185[_0x8e15('0x41')]=qs[_0x8e15('0x42')](_0x125fd7[_0x8e15('0x3b')][_0x8e15('0x42')]);_0x249185[_0x8e15('0x43')]=qs[_0x8e15('0x45')](_['pick'](_0x125fd7[_0x8e15('0x3b')],_0x12d860['filters']));if(_0x125fd7['query'][_0x8e15('0x46')]){_0x249185[_0x8e15('0x43')]=_[_0x8e15('0x47')](_0x249185[_0x8e15('0x43')],{'$or':_[_0x8e15('0x34')](_0x249185[_0x8e15('0x3c')],function(_0x200aee){var _0xad3147={};_0xad3147[_0x200aee]={'$like':'%'+_0x125fd7['query']['filter']+'%'};return _0xad3147;})});}_0x249185=_[_0x8e15('0x47')]({},_0x249185,_0x125fd7['options']);return _0xe4fbd5['getItems'](_0x249185);}})[_0x8e15('0x2b')](function(_0x11c6e2){if(_0x11c6e2){_0x500d9e=_0x11c6e2['length'];if(!_0x125fd7[_0x8e15('0x3b')]['hasOwnProperty'](_0x8e15('0x7b'))){_0x249185['limit']=qs[_0x8e15('0x26')](_0x125fd7[_0x8e15('0x3b')][_0x8e15('0x26')]);_0x249185[_0x8e15('0x23')]=qs[_0x8e15('0x23')](_0x125fd7[_0x8e15('0x3b')][_0x8e15('0x23')]);}return _0xe4fbd5[_0x8e15('0x79')](_0x249185);}})[_0x8e15('0x2b')](function(_0x2f2b24){if(_0x2f2b24){return _0x2f2b24?{'count':_0x500d9e,'rows':_0x2f2b24}:null;}})[_0x8e15('0x2b')](respondWithResult(_0x3d6c59,null))['catch'](handleError(_0x3d6c59,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 7bd4e42..5d8d780 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 _0xf52b=['exports','events','../../mysqldb','save','update','remove','emit','hook'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xf52b,0x119));var _0xbf52=function(_0x15f3c0,_0x165a64){_0x15f3c0=_0x15f3c0-0x0;var _0x1adfe0=_0xf52b[_0x15f3c0];return _0x1adfe0;};'use strict';var EventEmitter=require(_0xbf52('0x0'));var Dashboard=require(_0xbf52('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbf52('0x2'),'afterUpdate':_0xbf52('0x3'),'afterDestroy':_0xbf52('0x4')};function emitEvent(_0x125f43){return function(_0x1a5393,_0x5e02de,_0x344f3e){DashboardEvents['emit'](_0x125f43+':'+_0x1a5393['id'],_0x1a5393);DashboardEvents[_0xbf52('0x5')](_0x125f43,_0x1a5393);_0x344f3e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xbf52('0x6')](e,emitEvent(event));}}module[_0xbf52('0x7')]=DashboardEvents; \ No newline at end of file +var _0xfc8c=['update','hasOwnProperty','exports','events','../../mysqldb','Dashboard','setMaxListeners','save'];(function(_0x166e71,_0x3a1cd4){var _0x2ebc75=function(_0x4889d9){while(--_0x4889d9){_0x166e71['push'](_0x166e71['shift']());}};_0x2ebc75(++_0x3a1cd4);}(_0xfc8c,0x6b));var _0xcfc8=function(_0x55d7c2,_0x4ce6fb){_0x55d7c2=_0x55d7c2-0x0;var _0x1755ef=_0xfc8c[_0x55d7c2];return _0x1755ef;};'use strict';var EventEmitter=require(_0xcfc8('0x0'));var Dashboard=require(_0xcfc8('0x1'))['db'][_0xcfc8('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xcfc8('0x3')](0x0);var events={'afterCreate':_0xcfc8('0x4'),'afterUpdate':_0xcfc8('0x5'),'afterDestroy':'remove'};function emitEvent(_0x36b866){return function(_0x3f8a7c,_0x59e9c,_0x411628){DashboardEvents['emit'](_0x36b866+':'+_0x3f8a7c['id'],_0x3f8a7c);DashboardEvents['emit'](_0x36b866,_0x3f8a7c);_0x411628(null);};}for(var e in events){if(events[_0xcfc8('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xcfc8('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 7d355ad..8b68a03 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 _0x6bfc=['bluebird','../../config/environment','exports','define','Dashboard','lodash','util'];(function(_0x4a65ea,_0x5c2de1){var _0x9fe624=function(_0x1ac42e){while(--_0x1ac42e){_0x4a65ea['push'](_0x4a65ea['shift']());}};_0x9fe624(++_0x5c2de1);}(_0x6bfc,0x1da));var _0xc6bf=function(_0x161860,_0x5a724c){_0x161860=_0x161860-0x0;var _0x11b40c=_0x6bfc[_0x161860];return _0x11b40c;};'use strict';var _=require(_0xc6bf('0x0'));var util=require(_0xc6bf('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc6bf('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc6bf('0x3'));var attributes=require('./dashboard.attributes');module[_0xc6bf('0x4')]=function(_0x1d53cc,_0xef5682){return _0x1d53cc[_0xc6bf('0x5')](_0xc6bf('0x6'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d57=['rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','dashboards','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x53639c,_0x539bea){var _0x4102cb=function(_0x43ae6b){while(--_0x43ae6b){_0x53639c['push'](_0x53639c['shift']());}};_0x4102cb(++_0x539bea);}(_0x8d57,0xaf));var _0x78d5=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x8d57[_0x521929];return _0x632436;};'use strict';var _=require('lodash');var util=require(_0x78d5('0x0'));var logger=require(_0x78d5('0x1'))(_0x78d5('0x2'));var moment=require(_0x78d5('0x3'));var BPromise=require(_0x78d5('0x4'));var rp=require(_0x78d5('0x5'));var fs=require('fs');var path=require(_0x78d5('0x6'));var rimraf=require(_0x78d5('0x7'));var config=require(_0x78d5('0x8'));var attributes=require(_0x78d5('0x9'));module['exports']=function(_0x30fb1f,_0x3c6152){return _0x30fb1f[_0x78d5('0xa')](_0x78d5('0xb'),attributes,{'tableName':_0x78d5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 6141bf8..f368ba2 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 _0x7101=['redis','localhost','register','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','Dashboard,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2f2d09,_0x518078){var _0x2f5427=function(_0x29de5e){while(--_0x29de5e){_0x2f2d09['push'](_0x2f2d09['shift']());}};_0x2f5427(++_0x518078);}(_0x7101,0xcd));var _0x1710=function(_0x4d453c,_0x311b8c){_0x4d453c=_0x4d453c-0x0;var _0x4c80ac=_0x7101[_0x4d453c];return _0x4c80ac;};'use strict';var _=require(_0x1710('0x0'));var util=require(_0x1710('0x1'));var moment=require('moment');var BPromise=require(_0x1710('0x2'));var rs=require(_0x1710('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1710('0x4'))['db'];var utils=require(_0x1710('0x5'));var logger=require(_0x1710('0x6'))(_0x1710('0x7'));var config=require(_0x1710('0x8'));var jayson=require(_0x1710('0x9'));var client=jayson['client'][_0x1710('0xa')]({'port':0x232a});config[_0x1710('0xb')]=_['defaults'](config[_0x1710('0xb')],{'host':_0x1710('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1710('0xb')]));require('./dashboard.socket')[_0x1710('0xd')](socket);function respondWithRpcPromise(_0x2176be,_0x213609,_0x1afdd7){return new BPromise(function(_0x4a8a03,_0x2c2d93){return client['request'](_0x2176be,_0x1afdd7)[_0x1710('0xe')](function(_0x4ad090){logger[_0x1710('0xf')]('Dashboard,\x20%s,\x20%s',_0x213609,_0x1710('0x10'));logger[_0x1710('0x11')](_0x1710('0x12'),_0x213609,_0x1710('0x10'),JSON['stringify'](_0x4ad090));if(_0x4ad090[_0x1710('0x13')]){if(_0x4ad090[_0x1710('0x13')][_0x1710('0x14')]===0x1f4){logger[_0x1710('0x13')]('Dashboard,\x20%s,\x20%s',_0x213609,_0x4ad090[_0x1710('0x13')][_0x1710('0x15')]);return _0x2c2d93(_0x4ad090[_0x1710('0x13')][_0x1710('0x15')]);}logger[_0x1710('0x13')](_0x1710('0x16'),_0x213609,_0x4ad090[_0x1710('0x13')][_0x1710('0x15')]);return _0x4a8a03(_0x4ad090[_0x1710('0x13')][_0x1710('0x15')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x213609,_0x1710('0x10'));_0x4a8a03(_0x4ad090['result'][_0x1710('0x15')]);}})[_0x1710('0x17')](function(_0x471eeb){logger['error'](_0x1710('0x16'),_0x213609,_0x471eeb);_0x2c2d93(_0x471eeb);});});} \ No newline at end of file +var _0x866e=['code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./dashboard.socket','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x265907,_0x16812a){var _0x4d1d7d=function(_0x26fd50){while(--_0x26fd50){_0x265907['push'](_0x265907['shift']());}};_0x4d1d7d(++_0x16812a);}(_0x866e,0x18d));var _0xe866=function(_0x2b8d51,_0x3f762d){_0x2b8d51=_0x2b8d51-0x0;var _0x29a2a6=_0x866e[_0x2b8d51];return _0x29a2a6;};'use strict';var _=require(_0xe866('0x0'));var util=require(_0xe866('0x1'));var moment=require(_0xe866('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe866('0x3'));var db=require(_0xe866('0x4'))['db'];var utils=require(_0xe866('0x5'));var logger=require(_0xe866('0x6'))(_0xe866('0x7'));var config=require(_0xe866('0x8'));var jayson=require(_0xe866('0x9'));var client=jayson[_0xe866('0xa')][_0xe866('0xb')]({'port':0x232a});config[_0xe866('0xc')]=_['defaults'](config[_0xe866('0xc')],{'host':_0xe866('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe866('0xc')]));require(_0xe866('0xe'))['register'](socket);function respondWithRpcPromise(_0x1e5b30,_0x2f03b6,_0x4dd1fc){return new BPromise(function(_0x1d35c3,_0x4f28fc){return client[_0xe866('0xf')](_0x1e5b30,_0x4dd1fc)[_0xe866('0x10')](function(_0xd354b5){logger['info'](_0xe866('0x11'),_0x2f03b6,_0xe866('0x12'));logger[_0xe866('0x13')](_0xe866('0x14'),_0x2f03b6,_0xe866('0x12'),JSON[_0xe866('0x15')](_0xd354b5));if(_0xd354b5[_0xe866('0x16')]){if(_0xd354b5[_0xe866('0x16')][_0xe866('0x17')]===0x1f4){logger[_0xe866('0x16')](_0xe866('0x11'),_0x2f03b6,_0xd354b5[_0xe866('0x16')][_0xe866('0x18')]);return _0x4f28fc(_0xd354b5[_0xe866('0x16')]['message']);}logger[_0xe866('0x16')]('Dashboard,\x20%s,\x20%s',_0x2f03b6,_0xd354b5[_0xe866('0x16')][_0xe866('0x18')]);return _0x1d35c3(_0xd354b5[_0xe866('0x16')][_0xe866('0x18')]);}else{logger[_0xe866('0x19')](_0xe866('0x11'),_0x2f03b6,_0xe866('0x12'));_0x1d35c3(_0xd354b5[_0xe866('0x1a')][_0xe866('0x18')]);}})[_0xe866('0x1b')](function(_0x5508e5){logger[_0xe866('0x16')](_0xe866('0x11'),_0x2f03b6,_0x5508e5);_0x4f28fc(_0x5508e5);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 26d1a15..e9521f4 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 _0x7ef9=['emit','removeListener','length','./dashboard.events','save','remove'];(function(_0x51d1ac,_0x4aa9bd){var _0x5b0e2d=function(_0x2d3db6){while(--_0x2d3db6){_0x51d1ac['push'](_0x51d1ac['shift']());}};_0x5b0e2d(++_0x4aa9bd);}(_0x7ef9,0x93));var _0x97ef=function(_0x39da58,_0x17b28d){_0x39da58=_0x39da58-0x0;var _0x309064=_0x7ef9[_0x39da58];return _0x309064;};'use strict';var DashboardEvents=require(_0x97ef('0x0'));var events=[_0x97ef('0x1'),_0x97ef('0x2'),'update'];function createListener(_0x2730cd,_0x468cd7){return function(_0x4a2562){_0x468cd7[_0x97ef('0x3')](_0x2730cd,_0x4a2562);};}function removeListener(_0x3ac790,_0x361e6a){return function(){DashboardEvents[_0x97ef('0x4')](_0x3ac790,_0x361e6a);};}exports['register']=function(_0x12be7e){for(var _0x5ea217=0x0,_0x219ba3=events[_0x97ef('0x5')];_0x5ea217<_0x219ba3;_0x5ea217++){var _0x51dadd=events[_0x5ea217];var _0x561974=createListener('dashboard:'+_0x51dadd,_0x12be7e);DashboardEvents['on'](_0x51dadd,_0x561974);}}; \ No newline at end of file +var _0xb28d=['removeListener','register','length','dashboard:','./dashboard.events','save','remove','update','emit'];(function(_0x48084f,_0x2d1e50){var _0x215480=function(_0x3662ef){while(--_0x3662ef){_0x48084f['push'](_0x48084f['shift']());}};_0x215480(++_0x2d1e50);}(_0xb28d,0x9d));var _0xdb28=function(_0x2d6dc4,_0x5e2d29){_0x2d6dc4=_0x2d6dc4-0x0;var _0x52991e=_0xb28d[_0x2d6dc4];return _0x52991e;};'use strict';var DashboardEvents=require(_0xdb28('0x0'));var events=[_0xdb28('0x1'),_0xdb28('0x2'),_0xdb28('0x3')];function createListener(_0x8494b7,_0x290c7c){return function(_0x3056b1){_0x290c7c[_0xdb28('0x4')](_0x8494b7,_0x3056b1);};}function removeListener(_0x1962a7,_0x3f3a60){return function(){DashboardEvents[_0xdb28('0x5')](_0x1962a7,_0x3f3a60);};}exports[_0xdb28('0x6')]=function(_0x7f6dc2){for(var _0x5518a4=0x0,_0x57b73c=events[_0xdb28('0x7')];_0x5518a4<_0x57b73c;_0x5518a4++){var _0x4b79d8=events[_0x5518a4];var _0x40c465=createListener(_0xdb28('0x8')+_0x4b79d8,_0x7f6dc2);DashboardEvents['on'](_0x4b79d8,_0x40c465);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index effabcb..a9eafbd 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 _0x7b77=['put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','./dashboard.controller','get','isAuthenticated','/:id','show','getItems','post','create','/:id/clone'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7b77,0x93));var _0x77b7=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0x7b77[_0x48e1ec];return _0x3b33eb;};'use strict';var multer=require(_0x77b7('0x0'));var util=require('util');var path=require(_0x77b7('0x1'));var timeout=require(_0x77b7('0x2'));var express=require(_0x77b7('0x3'));var router=express[_0x77b7('0x4')]();var fs_extra=require(_0x77b7('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x77b7('0x6'));router[_0x77b7('0x7')]('/',auth[_0x77b7('0x8')](),controller['index']);router[_0x77b7('0x7')](_0x77b7('0x9'),auth[_0x77b7('0x8')](),controller[_0x77b7('0xa')]);router[_0x77b7('0x7')]('/:id/items',auth[_0x77b7('0x8')](),controller[_0x77b7('0xb')]);router[_0x77b7('0xc')]('/',auth[_0x77b7('0x8')](),controller[_0x77b7('0xd')]);router[_0x77b7('0xc')](_0x77b7('0xe'),auth[_0x77b7('0x8')](),controller['clone']);router[_0x77b7('0xc')]('/:id/items',auth[_0x77b7('0x8')](),controller['addItem']);router[_0x77b7('0xf')]('/:id',auth[_0x77b7('0x8')](),controller['update']);router[_0x77b7('0x10')](_0x77b7('0x9'),auth[_0x77b7('0x8')](),controller[_0x77b7('0x11')]);module['exports']=router; \ No newline at end of file +var _0x54a5=['clone','/:id/items','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','getItems','post','isAuthenticated'];(function(_0x2cf5bf,_0x10ffb3){var _0x4bfa07=function(_0x534753){while(--_0x534753){_0x2cf5bf['push'](_0x2cf5bf['shift']());}};_0x4bfa07(++_0x10ffb3);}(_0x54a5,0x146));var _0x554a=function(_0x1ae44a,_0x4a9881){_0x1ae44a=_0x1ae44a-0x0;var _0x3f15f2=_0x54a5[_0x1ae44a];return _0x3f15f2;};'use strict';var multer=require(_0x554a('0x0'));var util=require(_0x554a('0x1'));var path=require(_0x554a('0x2'));var timeout=require(_0x554a('0x3'));var express=require('express');var router=express[_0x554a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x554a('0x5'));var config=require(_0x554a('0x6'));var controller=require(_0x554a('0x7'));router[_0x554a('0x8')]('/',auth['isAuthenticated'](),controller[_0x554a('0x9')]);router[_0x554a('0x8')](_0x554a('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x554a('0x8')]('/:id/items',auth['isAuthenticated'](),controller[_0x554a('0xb')]);router[_0x554a('0xc')]('/',auth[_0x554a('0xd')](),controller['create']);router[_0x554a('0xc')]('/:id/clone',auth['isAuthenticated'](),controller[_0x554a('0xe')]);router[_0x554a('0xc')](_0x554a('0xf'),auth[_0x554a('0xd')](),controller['addItem']);router['put'](_0x554a('0xa'),auth[_0x554a('0xd')](),controller[_0x554a('0x10')]);router[_0x554a('0x11')](_0x554a('0xa'),auth['isAuthenticated'](),controller[_0x554a('0x12')]);module[_0x554a('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 9c4094a..c30f234 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 _0xba34=['attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','parse','getDataValue'];(function(_0x1d211b,_0x475f3b){var _0x47c88b=function(_0x3126f5){while(--_0x3126f5){_0x1d211b['push'](_0x1d211b['shift']());}};_0x47c88b(++_0x475f3b);}(_0xba34,0x119));var _0x4ba3=function(_0x14558a,_0x1c11a4){_0x14558a=_0x14558a-0x0;var _0x12a6c1=_0xba34[_0x14558a];return _0x12a6c1;};'use strict';var Sequelize=require(_0x4ba3('0x0'));var squel=require(_0x4ba3('0x1'));var _=require(_0x4ba3('0x2'));module[_0x4ba3('0x3')]={'title':{'type':Sequelize[_0x4ba3('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON[_0x4ba3('0x5')](this[_0x4ba3('0x6')](_0x4ba3('0x7')));}catch(_0x1011ec){return[];}},'set':function(_0x3590a1){try{this[_0x4ba3('0x8')](_0x4ba3('0x7'),JSON['stringify'](_0x3590a1));}catch(_0x6254fb){this[_0x4ba3('0x8')](_0x4ba3('0x7'),JSON[_0x4ba3('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x4ba3('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x4ba3('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4ba3('0xa')]},'col':{'type':Sequelize[_0x4ba3('0xa')]},'background':{'type':Sequelize[_0x4ba3('0x4')],'allowNull':![],'defaultValue':_0x4ba3('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4ba3('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x4ba3('0x4')]},'titleFontSize':{'type':Sequelize[_0x4ba3('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x326f=['#2196f3','sequelize','exports','STRING','TEXT','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff'];(function(_0xfbb408,_0x5b4407){var _0x379d4d=function(_0x41be1a){while(--_0x41be1a){_0xfbb408['push'](_0xfbb408['shift']());}};_0x379d4d(++_0x5b4407);}(_0x326f,0xd1));var _0xf326=function(_0x276302,_0xed21d6){_0x276302=_0x276302-0x0;var _0x80a066=_0x326f[_0x276302];return _0x80a066;};'use strict';var Sequelize=require(_0xf326('0x0'));var squel=require('squel');var _=require('lodash');module[_0xf326('0x1')]={'title':{'type':Sequelize[_0xf326('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf326('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xf326('0x3')](_0xf326('0x4')),'get':function(){try{return JSON[_0xf326('0x5')](this[_0xf326('0x6')](_0xf326('0x7')));}catch(_0x1b5a56){return[];}},'set':function(_0x3ace29){try{this['setDataValue'](_0xf326('0x7'),JSON[_0xf326('0x8')](_0x3ace29));}catch(_0x165f95){this[_0xf326('0x9')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xf326('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xf326('0xa')]},'col':{'type':Sequelize[_0xf326('0xa')]},'background':{'type':Sequelize[_0xf326('0x2')],'allowNull':![],'defaultValue':_0xf326('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf326('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xf326('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 667a1c1..750d1e1 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 _0xcabc=['custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','total','attrVoiceQueues','attrFontSize','multibar-chart','attrSerie2','attrSerie3','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','error','stack','name','show','params','keys','DashboardItem','rawAttributes','query','model','attributes','fields','include','merge','options','find','catch','iframe','attrs','value'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcabc,0x16a));var _0xccab=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xcabc[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xccab('0x0'));var zipdir=require(_0xccab('0x1'));var jsonpatch=require(_0xccab('0x2'));var rp=require(_0xccab('0x3'));var moment=require(_0xccab('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xccab('0x5'));var util=require(_0xccab('0x6'));var path=require('path');var sox=require(_0xccab('0x7'));var csv=require(_0xccab('0x8'));var ejs=require(_0xccab('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xccab('0xa'));var squel=require(_0xccab('0xb'));var crypto=require(_0xccab('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xccab('0xd'));var toCsv=require(_0xccab('0x8'));var querystring=require('querystring');var Papa=require(_0xccab('0xe'));var Redis=require(_0xccab('0xf'));var authService=require(_0xccab('0x10'));var qs=require(_0xccab('0x11'));var as=require(_0xccab('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xccab('0x13'));var utils=require(_0xccab('0x14'));var config=require(_0xccab('0x15'));var licenseUtil=require(_0xccab('0x16'));var db=require(_0xccab('0x17'))['db'];config[_0xccab('0x18')]=_[_0xccab('0x19')](config['redis'],{'host':_0xccab('0x1a'),'port':0x18eb});var socket=require(_0xccab('0x1b'))(new Redis(config['redis']));require(_0xccab('0x1c'))['register'](socket);function respondWithStatusCode(_0x55c22c,_0x2c2cc8){_0x2c2cc8=_0x2c2cc8||0xcc;return function(_0x149e57){if(_0x149e57){return _0x55c22c[_0xccab('0x1d')](_0x2c2cc8);}return _0x55c22c['status'](_0x2c2cc8)[_0xccab('0x1e')]();};}function respondWithResult(_0x45bdec,_0x5afd11){_0x5afd11=_0x5afd11||0xc8;return function(_0x160e66){if(_0x160e66){return _0x45bdec[_0xccab('0x1f')](_0x5afd11)[_0xccab('0x20')](_0x160e66);}};}function respondWithFilteredResult(_0x2aace1,_0x13409f){return function(_0x5157c6){if(_0x5157c6){var _0x4ba1c2=typeof _0x13409f[_0xccab('0x21')]==='undefined'&&typeof _0x13409f[_0xccab('0x22')]===_0xccab('0x23');var _0x10c8fc=_0x5157c6['count'];var _0x4bcf9b=_0x4ba1c2?0x0:_0x13409f[_0xccab('0x21')];var _0x37da0b=_0x4ba1c2?_0x5157c6[_0xccab('0x24')]:_0x13409f['offset']+_0x13409f[_0xccab('0x22')];var _0x51a221;if(_0x37da0b>=_0x10c8fc){_0x37da0b=_0x10c8fc;_0x51a221=0xc8;}else{_0x51a221=0xce;}_0x2aace1[_0xccab('0x1f')](_0x51a221);return _0x2aace1[_0xccab('0x25')]('Content-Range',_0x4bcf9b+'-'+_0x37da0b+'/'+_0x10c8fc)[_0xccab('0x20')](_0x5157c6);}return null;};}function patchUpdates(_0x1fbb90){return function(_0x436675){try{jsonpatch[_0xccab('0x26')](_0x436675,_0x1fbb90,!![]);}catch(_0xcce228){return BPromise[_0xccab('0x27')](_0xcce228);}return _0x436675[_0xccab('0x28')]();};}function saveUpdates(_0x427654,_0x325683){return function(_0x286e19){if(_0x286e19){return _0x286e19['update'](_0x427654)[_0xccab('0x29')](function(_0x3532d4){return _0x3532d4;});}return null;};}function removeEntity(_0x58e32b,_0x41370b){return function(_0x40b88c){if(_0x40b88c){return _0x40b88c[_0xccab('0x2a')]()[_0xccab('0x29')](function(){_0x58e32b[_0xccab('0x1f')](0xcc)[_0xccab('0x1e')]();});}};}function handleEntityNotFound(_0xaff45e,_0x313f92){return function(_0x3c3946){if(!_0x3c3946){_0xaff45e[_0xccab('0x1d')](0x194);}return _0x3c3946;};}function handleError(_0x274968,_0x2ae0c9){_0x2ae0c9=_0x2ae0c9||0x1f4;return function(_0x23912f){logger[_0xccab('0x2b')](_0x23912f[_0xccab('0x2c')]);if(_0x23912f['name']){delete _0x23912f[_0xccab('0x2d')];}_0x274968[_0xccab('0x1f')](_0x2ae0c9)['send'](_0x23912f);};}exports[_0xccab('0x2e')]=function(_0x54b7c9,_0x272dcd){var _0x2c13b1={'raw':![],'where':{'id':_0x54b7c9[_0xccab('0x2f')]['id']}},_0x98cf31={};_0x98cf31['model']=_[_0xccab('0x30')](db[_0xccab('0x31')][_0xccab('0x32')]);_0x98cf31[_0xccab('0x33')]=_['keys'](_0x54b7c9[_0xccab('0x33')]);_0x98cf31['filters']=_['intersection'](_0x98cf31[_0xccab('0x34')],_0x98cf31['query']);_0x2c13b1[_0xccab('0x35')]=_['intersection'](_0x98cf31[_0xccab('0x34')],qs['fields'](_0x54b7c9[_0xccab('0x33')][_0xccab('0x36')]));_0x2c13b1[_0xccab('0x35')]=_0x2c13b1[_0xccab('0x35')]['length']?_0x2c13b1[_0xccab('0x35')]:_0x98cf31[_0xccab('0x34')];if(_0x54b7c9[_0xccab('0x33')]['includeAll']){_0x2c13b1[_0xccab('0x37')]=[{'all':!![]}];}_0x2c13b1=_[_0xccab('0x38')]({},_0x2c13b1,_0x54b7c9[_0xccab('0x39')]);return db['DashboardItem'][_0xccab('0x3a')](_0x2c13b1)['then'](handleEntityNotFound(_0x272dcd,null))[_0xccab('0x29')](respondWithResult(_0x272dcd,null))['catch'](handleError(_0x272dcd,null));};exports[_0xccab('0x2a')]=function(_0x26c68d,_0x4a6231){return db[_0xccab('0x31')][_0xccab('0x3a')]({'where':{'id':_0x26c68d[_0xccab('0x2f')]['id']}})[_0xccab('0x29')](handleEntityNotFound(_0x4a6231,null))[_0xccab('0x29')](removeEntity(_0x4a6231,null))[_0xccab('0x3b')](handleError(_0x4a6231,null));};function widgetAttributes(_0x1eefac){try{switch(_0x1eefac['type']){case _0xccab('0x3c'):return[{'name':'attrUrl','value':_0x1eefac['attrUrl']||(_0x1eefac['attrs']&&_0x1eefac[_0xccab('0x3d')][0x0]?_0x1eefac[_0xccab('0x3d')][0x0][_0xccab('0x3e')]:undefined)||'https://'}];case _0xccab('0x3f'):return[{'name':_0xccab('0x40'),'value':_0x1eefac[_0xccab('0x40')]||(_0x1eefac[_0xccab('0x3d')]&&_0x1eefac[_0xccab('0x3d')][0x0]?_0x1eefac[_0xccab('0x3d')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0xccab('0x41'),'value':_0x1eefac[_0xccab('0x41')]||(_0x1eefac[_0xccab('0x3d')]&&_0x1eefac[_0xccab('0x3d')][0x0]?_0x1eefac['attrs'][0x0][_0xccab('0x3e')]:undefined)||_0xccab('0x42')},{'name':_0xccab('0x43'),'value':_0x1eefac['attrTimezone']||(_0x1eefac[_0xccab('0x3d')]&&_0x1eefac[_0xccab('0x3d')][0x1]?_0x1eefac[_0xccab('0x3d')][0x1][_0xccab('0x3e')]:undefined)||_0xccab('0x44')},{'name':'attrFontSize','value':_0x1eefac['attrFontSize']||(_0x1eefac['attrs']&&_0x1eefac[_0xccab('0x3d')][0x2]?_0x1eefac[_0xccab('0x3d')][0x2]['value']:undefined)||0xc}];case _0xccab('0x45'):return[{'name':_0xccab('0x46'),'value':_0x1eefac[_0xccab('0x46')]||(_0x1eefac[_0xccab('0x3d')]&&_0x1eefac[_0xccab('0x3d')][0x0]?_0x1eefac['attrs'][0x0][_0xccab('0x3e')]:undefined)||_0xccab('0x47')},{'name':'attrVoiceQueues','value':_0x1eefac[_0xccab('0x48')]||(_0x1eefac[_0xccab('0x3d')]&&_0x1eefac['attrs'][0x1]?_0x1eefac['attrs'][0x1][_0xccab('0x3e')]:undefined)||[]},{'name':_0xccab('0x49'),'value':_0x1eefac[_0xccab('0x49')]||(_0x1eefac[_0xccab('0x3d')]&&_0x1eefac['attrs'][0x2]?_0x1eefac['attrs'][0x2][_0xccab('0x3e')]:undefined)||0x14}];case _0xccab('0x4a'):case'pie-chart':return[{'name':'attrSerie1','value':_0x1eefac['attrSerie1']||(_0x1eefac[_0xccab('0x3d')]&&_0x1eefac[_0xccab('0x3d')][0x0]?_0x1eefac['attrs'][0x0][_0xccab('0x3e')]:undefined)||_0xccab('0x47')},{'name':_0xccab('0x4b'),'value':_0x1eefac['attrSerie2']||(_0x1eefac[_0xccab('0x3d')]&&_0x1eefac['attrs'][0x1]?_0x1eefac[_0xccab('0x3d')][0x1][_0xccab('0x3e')]:undefined)||null},{'name':'attrSerie3','value':_0x1eefac[_0xccab('0x4c')]||(_0x1eefac[_0xccab('0x3d')]&&_0x1eefac['attrs'][0x2]?_0x1eefac[_0xccab('0x3d')][0x2][_0xccab('0x3e')]:undefined)||null},{'name':_0xccab('0x48'),'value':_0x1eefac[_0xccab('0x48')]||(_0x1eefac[_0xccab('0x3d')]&&_0x1eefac[_0xccab('0x3d')][0x3]?_0x1eefac['attrs'][0x3][_0xccab('0x3e')]:undefined)||[]}];case'web-report':return[{'name':_0xccab('0x4d'),'type':_0x1eefac[_0xccab('0x4e')]||(_0x1eefac[_0xccab('0x3d')]&&_0x1eefac[_0xccab('0x3d')][0x0]?_0x1eefac[_0xccab('0x3d')][0x0][_0xccab('0x4f')]:undefined)||null,'value':_0x1eefac['attrReport']||(_0x1eefac[_0xccab('0x3d')]&&_0x1eefac[_0xccab('0x3d')][0x0]?_0x1eefac['attrs'][0x0][_0xccab('0x3e')]:undefined)||null},{'name':_0xccab('0x50'),'value':_0x1eefac[_0xccab('0x50')]||(_0x1eefac['attrs']&&_0x1eefac['attrs'][0x1]?_0x1eefac[_0xccab('0x3d')][0x1][_0xccab('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x21a0e8){logger['error'](_0xccab('0x51'),JSON['stringify'](_0x21a0e8));return[];}}exports[_0xccab('0x52')]=function(_0x46a4b8,_0x5d5442){if(_0x46a4b8['body']){_0x46a4b8['body']['attrs']=widgetAttributes(_0x46a4b8['body']);}return db['DashboardItem'][_0xccab('0x52')](_0x46a4b8[_0xccab('0x53')],{})[_0xccab('0x29')](respondWithResult(_0x5d5442,0xc9))['catch'](handleError(_0x5d5442,null));};exports[_0xccab('0x54')]=function(_0x45b2fb,_0x2d175a){if(_0x45b2fb[_0xccab('0x53')]['id']){delete _0x45b2fb[_0xccab('0x53')]['id'];}_0x45b2fb[_0xccab('0x53')][_0xccab('0x3d')]=widgetAttributes(_0x45b2fb[_0xccab('0x53')]);return db[_0xccab('0x31')][_0xccab('0x3a')]({'where':{'id':_0x45b2fb[_0xccab('0x2f')]['id']}})[_0xccab('0x29')](handleEntityNotFound(_0x2d175a,null))['then'](saveUpdates(_0x45b2fb[_0xccab('0x53')],null))['then'](respondWithResult(_0x2d175a,null))[_0xccab('0x3b')](handleError(_0x2d175a,null));}; \ No newline at end of file +var _0xd336=['clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','params','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','redis','defaults','socket.io-emitter','./dashboardItem.socket','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','DashboardItem','find','catch','type','attrUrl','attrs','value','https://','attrPath'];(function(_0x1ace27,_0x47a309){var _0x55d62e=function(_0x38c177){while(--_0x38c177){_0x1ace27['push'](_0x1ace27['shift']());}};_0x55d62e(++_0x47a309);}(_0xd336,0xc2));var _0x6d33=function(_0x5aa373,_0x54c7f4){_0x5aa373=_0x5aa373-0x0;var _0x590e8e=_0xd336[_0x5aa373];return _0x590e8e;};'use strict';var emlformat=require(_0x6d33('0x0'));var rimraf=require(_0x6d33('0x1'));var zipdir=require(_0x6d33('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d33('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6d33('0x4'));var util=require('util');var path=require(_0x6d33('0x5'));var sox=require(_0x6d33('0x6'));var csv=require('to-csv');var ejs=require(_0x6d33('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d33('0x8'));var squel=require(_0x6d33('0x9'));var crypto=require(_0x6d33('0xa'));var jsforce=require(_0x6d33('0xb'));var deskjs=require(_0x6d33('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6d33('0xd'));var Redis=require('ioredis');var authService=require(_0x6d33('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6d33('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d33('0x10'))(_0x6d33('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6d33('0x12'));var db=require('../../mysqldb')['db'];config[_0x6d33('0x13')]=_[_0x6d33('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6d33('0x15'))(new Redis(config['redis']));require(_0x6d33('0x16'))['register'](socket);function respondWithStatusCode(_0xff4c5b,_0xfc4883){_0xfc4883=_0xfc4883||0xcc;return function(_0x28f568){if(_0x28f568){return _0xff4c5b['sendStatus'](_0xfc4883);}return _0xff4c5b['status'](_0xfc4883)[_0x6d33('0x17')]();};}function respondWithResult(_0x1e8512,_0x18bfa0){_0x18bfa0=_0x18bfa0||0xc8;return function(_0x474f8a){if(_0x474f8a){return _0x1e8512[_0x6d33('0x18')](_0x18bfa0)[_0x6d33('0x19')](_0x474f8a);}};}function respondWithFilteredResult(_0x3fce08,_0x568185){return function(_0x645fc7){if(_0x645fc7){var _0x5ad943=typeof _0x568185[_0x6d33('0x1a')]===_0x6d33('0x1b')&&typeof _0x568185[_0x6d33('0x1c')]===_0x6d33('0x1b');var _0x5b5bd4=_0x645fc7[_0x6d33('0x1d')];var _0x3b9528=_0x5ad943?0x0:_0x568185[_0x6d33('0x1a')];var _0x4a2bdb=_0x5ad943?_0x645fc7[_0x6d33('0x1d')]:_0x568185[_0x6d33('0x1a')]+_0x568185['limit'];var _0x4fc2eb;if(_0x4a2bdb>=_0x5b5bd4){_0x4a2bdb=_0x5b5bd4;_0x4fc2eb=0xc8;}else{_0x4fc2eb=0xce;}_0x3fce08[_0x6d33('0x18')](_0x4fc2eb);return _0x3fce08[_0x6d33('0x1e')](_0x6d33('0x1f'),_0x3b9528+'-'+_0x4a2bdb+'/'+_0x5b5bd4)['json'](_0x645fc7);}return null;};}function patchUpdates(_0x535ea2){return function(_0x7c38d2){try{jsonpatch[_0x6d33('0x20')](_0x7c38d2,_0x535ea2,!![]);}catch(_0x3a3217){return BPromise[_0x6d33('0x21')](_0x3a3217);}return _0x7c38d2[_0x6d33('0x22')]();};}function saveUpdates(_0x1d7749,_0x5cd488){return function(_0x5a6f6a){if(_0x5a6f6a){return _0x5a6f6a[_0x6d33('0x23')](_0x1d7749)[_0x6d33('0x24')](function(_0x20a698){return _0x20a698;});}return null;};}function removeEntity(_0x4cabc9,_0x317a68){return function(_0x49ab92){if(_0x49ab92){return _0x49ab92[_0x6d33('0x25')]()['then'](function(){_0x4cabc9[_0x6d33('0x18')](0xcc)[_0x6d33('0x17')]();});}};}function handleEntityNotFound(_0xbea448,_0x4ad291){return function(_0x18ebba){if(!_0x18ebba){_0xbea448[_0x6d33('0x26')](0x194);}return _0x18ebba;};}function handleError(_0x25ee26,_0x2e8c34){_0x2e8c34=_0x2e8c34||0x1f4;return function(_0x288049){logger[_0x6d33('0x27')](_0x288049[_0x6d33('0x28')]);if(_0x288049[_0x6d33('0x29')]){delete _0x288049[_0x6d33('0x29')];}_0x25ee26[_0x6d33('0x18')](_0x2e8c34)[_0x6d33('0x2a')](_0x288049);};}exports['show']=function(_0x28ff81,_0x5e3905){var _0x45a17d={'raw':![],'where':{'id':_0x28ff81['params']['id']}},_0x3173bc={};_0x3173bc[_0x6d33('0x2b')]=_['keys'](db['DashboardItem'][_0x6d33('0x2c')]);_0x3173bc[_0x6d33('0x2d')]=_[_0x6d33('0x2e')](_0x28ff81[_0x6d33('0x2d')]);_0x3173bc[_0x6d33('0x2f')]=_[_0x6d33('0x30')](_0x3173bc[_0x6d33('0x2b')],_0x3173bc['query']);_0x45a17d[_0x6d33('0x31')]=_['intersection'](_0x3173bc[_0x6d33('0x2b')],qs[_0x6d33('0x32')](_0x28ff81[_0x6d33('0x2d')][_0x6d33('0x32')]));_0x45a17d[_0x6d33('0x31')]=_0x45a17d[_0x6d33('0x31')][_0x6d33('0x33')]?_0x45a17d[_0x6d33('0x31')]:_0x3173bc[_0x6d33('0x2b')];if(_0x28ff81[_0x6d33('0x2d')][_0x6d33('0x34')]){_0x45a17d[_0x6d33('0x35')]=[{'all':!![]}];}_0x45a17d=_[_0x6d33('0x36')]({},_0x45a17d,_0x28ff81['options']);return db[_0x6d33('0x37')][_0x6d33('0x38')](_0x45a17d)[_0x6d33('0x24')](handleEntityNotFound(_0x5e3905,null))[_0x6d33('0x24')](respondWithResult(_0x5e3905,null))[_0x6d33('0x39')](handleError(_0x5e3905,null));};exports['destroy']=function(_0x12de1f,_0x15582d){return db[_0x6d33('0x37')][_0x6d33('0x38')]({'where':{'id':_0x12de1f['params']['id']}})[_0x6d33('0x24')](handleEntityNotFound(_0x15582d,null))['then'](removeEntity(_0x15582d,null))[_0x6d33('0x39')](handleError(_0x15582d,null));};function widgetAttributes(_0x1bf8f2){try{switch(_0x1bf8f2[_0x6d33('0x3a')]){case'iframe':return[{'name':_0x6d33('0x3b'),'value':_0x1bf8f2['attrUrl']||(_0x1bf8f2[_0x6d33('0x3c')]&&_0x1bf8f2[_0x6d33('0x3c')][0x0]?_0x1bf8f2[_0x6d33('0x3c')][0x0][_0x6d33('0x3d')]:undefined)||_0x6d33('0x3e')}];case'custom':return[{'name':'attrPath','value':_0x1bf8f2[_0x6d33('0x3f')]||(_0x1bf8f2[_0x6d33('0x3c')]&&_0x1bf8f2[_0x6d33('0x3c')][0x0]?_0x1bf8f2[_0x6d33('0x3c')][0x0][_0x6d33('0x3d')]:undefined)||''}];case _0x6d33('0x40'):return[{'name':'attrHourFormat','value':_0x1bf8f2[_0x6d33('0x41')]||(_0x1bf8f2[_0x6d33('0x3c')]&&_0x1bf8f2[_0x6d33('0x3c')][0x0]?_0x1bf8f2[_0x6d33('0x3c')][0x0][_0x6d33('0x3d')]:undefined)||_0x6d33('0x42')},{'name':_0x6d33('0x43'),'value':_0x1bf8f2[_0x6d33('0x43')]||(_0x1bf8f2[_0x6d33('0x3c')]&&_0x1bf8f2[_0x6d33('0x3c')][0x1]?_0x1bf8f2[_0x6d33('0x3c')][0x1]['value']:undefined)||_0x6d33('0x44')},{'name':_0x6d33('0x45'),'value':_0x1bf8f2[_0x6d33('0x45')]||(_0x1bf8f2[_0x6d33('0x3c')]&&_0x1bf8f2[_0x6d33('0x3c')][0x2]?_0x1bf8f2['attrs'][0x2][_0x6d33('0x3d')]:undefined)||0xc}];case'counter':return[{'name':_0x6d33('0x46'),'value':_0x1bf8f2[_0x6d33('0x46')]||(_0x1bf8f2['attrs']&&_0x1bf8f2[_0x6d33('0x3c')][0x0]?_0x1bf8f2['attrs'][0x0]['value']:undefined)||_0x6d33('0x47')},{'name':'attrVoiceQueues','value':_0x1bf8f2[_0x6d33('0x48')]||(_0x1bf8f2[_0x6d33('0x3c')]&&_0x1bf8f2[_0x6d33('0x3c')][0x1]?_0x1bf8f2[_0x6d33('0x3c')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x1bf8f2[_0x6d33('0x45')]||(_0x1bf8f2[_0x6d33('0x3c')]&&_0x1bf8f2['attrs'][0x2]?_0x1bf8f2[_0x6d33('0x3c')][0x2][_0x6d33('0x3d')]:undefined)||0x14}];case'multibar-chart':case _0x6d33('0x49'):return[{'name':_0x6d33('0x4a'),'value':_0x1bf8f2[_0x6d33('0x4a')]||(_0x1bf8f2[_0x6d33('0x3c')]&&_0x1bf8f2['attrs'][0x0]?_0x1bf8f2[_0x6d33('0x3c')][0x0]['value']:undefined)||'total'},{'name':_0x6d33('0x4b'),'value':_0x1bf8f2['attrSerie2']||(_0x1bf8f2[_0x6d33('0x3c')]&&_0x1bf8f2[_0x6d33('0x3c')][0x1]?_0x1bf8f2[_0x6d33('0x3c')][0x1]['value']:undefined)||null},{'name':_0x6d33('0x4c'),'value':_0x1bf8f2[_0x6d33('0x4c')]||(_0x1bf8f2['attrs']&&_0x1bf8f2[_0x6d33('0x3c')][0x2]?_0x1bf8f2['attrs'][0x2][_0x6d33('0x3d')]:undefined)||null},{'name':_0x6d33('0x48'),'value':_0x1bf8f2['attrVoiceQueues']||(_0x1bf8f2['attrs']&&_0x1bf8f2['attrs'][0x3]?_0x1bf8f2[_0x6d33('0x3c')][0x3][_0x6d33('0x3d')]:undefined)||[]}];case _0x6d33('0x4d'):return[{'name':_0x6d33('0x4e'),'type':_0x1bf8f2[_0x6d33('0x4f')]||(_0x1bf8f2[_0x6d33('0x3c')]&&_0x1bf8f2[_0x6d33('0x3c')][0x0]?_0x1bf8f2[_0x6d33('0x3c')][0x0][_0x6d33('0x3a')]:undefined)||null,'value':_0x1bf8f2['attrReport']||(_0x1bf8f2[_0x6d33('0x3c')]&&_0x1bf8f2[_0x6d33('0x3c')][0x0]?_0x1bf8f2['attrs'][0x0][_0x6d33('0x3d')]:undefined)||null},{'name':_0x6d33('0x50'),'value':_0x1bf8f2[_0x6d33('0x50')]||(_0x1bf8f2[_0x6d33('0x3c')]&&_0x1bf8f2[_0x6d33('0x3c')][0x1]?_0x1bf8f2[_0x6d33('0x3c')][0x1][_0x6d33('0x3d')]:undefined)||0x0}];default:return[];}}catch(_0x1584d7){logger[_0x6d33('0x27')](_0x6d33('0x51'),JSON[_0x6d33('0x52')](_0x1584d7));return[];}}exports[_0x6d33('0x53')]=function(_0x4f8815,_0x39f9a2){if(_0x4f8815[_0x6d33('0x54')]){_0x4f8815[_0x6d33('0x54')][_0x6d33('0x3c')]=widgetAttributes(_0x4f8815['body']);}return db[_0x6d33('0x37')][_0x6d33('0x53')](_0x4f8815[_0x6d33('0x54')],{})[_0x6d33('0x24')](respondWithResult(_0x39f9a2,0xc9))[_0x6d33('0x39')](handleError(_0x39f9a2,null));};exports[_0x6d33('0x23')]=function(_0x57f9af,_0x1156cb){if(_0x57f9af[_0x6d33('0x54')]['id']){delete _0x57f9af['body']['id'];}_0x57f9af[_0x6d33('0x54')][_0x6d33('0x3c')]=widgetAttributes(_0x57f9af['body']);return db['DashboardItem'][_0x6d33('0x38')]({'where':{'id':_0x57f9af[_0x6d33('0x55')]['id']}})[_0x6d33('0x24')](handleEntityNotFound(_0x1156cb,null))['then'](saveUpdates(_0x57f9af['body'],null))['then'](respondWithResult(_0x1156cb,null))['catch'](handleError(_0x1156cb,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 344da6b..7fa1355 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 _0x9173=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','save','update','remove'];(function(_0x148b89,_0x384c79){var _0x65dd36=function(_0x193280){while(--_0x193280){_0x148b89['push'](_0x148b89['shift']());}};_0x65dd36(++_0x384c79);}(_0x9173,0xc2));var _0x3917=function(_0x351f62,_0x138d4e){_0x351f62=_0x351f62-0x0;var _0x26c265=_0x9173[_0x351f62];return _0x26c265;};'use strict';var EventEmitter=require(_0x3917('0x0'));var DashboardItem=require(_0x3917('0x1'))['db'][_0x3917('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3917('0x3'),'afterUpdate':_0x3917('0x4'),'afterDestroy':_0x3917('0x5')};function emitEvent(_0x9f6877){return function(_0x33b166,_0x59d7b7,_0x47eb7e){DashboardItemEvents[_0x3917('0x6')](_0x9f6877+':'+_0x33b166['id'],_0x33b166);DashboardItemEvents[_0x3917('0x6')](_0x9f6877,_0x33b166);_0x47eb7e(null);};}for(var e in events){if(events[_0x3917('0x7')](e)){var event=events[e];DashboardItem[_0x3917('0x8')](e,emitEvent(event));}}module[_0x3917('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0x466b=['hasOwnProperty','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','emit'];(function(_0x484825,_0x31b82d){var _0x21af01=function(_0x50d637){while(--_0x50d637){_0x484825['push'](_0x484825['shift']());}};_0x21af01(++_0x31b82d);}(_0x466b,0x13d));var _0xb466=function(_0x204119,_0x1bd9f8){_0x204119=_0x204119-0x0;var _0x5699ae=_0x466b[_0x204119];return _0x5699ae;};'use strict';var EventEmitter=require(_0xb466('0x0'));var DashboardItem=require(_0xb466('0x1'))['db'][_0xb466('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xb466('0x3')](0x0);var events={'afterCreate':_0xb466('0x4'),'afterUpdate':_0xb466('0x5'),'afterDestroy':'remove'};function emitEvent(_0x192ac5){return function(_0x4f2272,_0x1e6dc9,_0x30baa2){DashboardItemEvents[_0xb466('0x6')](_0x192ac5+':'+_0x4f2272['id'],_0x4f2272);DashboardItemEvents['emit'](_0x192ac5,_0x4f2272);_0x30baa2(null);};}for(var e in events){if(events[_0xb466('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xb466('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index ad42c6e..e029992 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 _0x94ca=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94ca,0xde));var _0xa94c=function(_0x23f422,_0x2f2945){_0x23f422=_0x23f422-0x0;var _0x16be63=_0x94ca[_0x23f422];return _0x16be63;};'use strict';var _=require(_0xa94c('0x0'));var util=require(_0xa94c('0x1'));var logger=require(_0xa94c('0x2'))(_0xa94c('0x3'));var moment=require(_0xa94c('0x4'));var BPromise=require(_0xa94c('0x5'));var rp=require(_0xa94c('0x6'));var fs=require('fs');var path=require(_0xa94c('0x7'));var rimraf=require(_0xa94c('0x8'));var config=require(_0xa94c('0x9'));var attributes=require(_0xa94c('0xa'));module[_0xa94c('0xb')]=function(_0x60c649,_0x4fb3d0){return _0x60c649[_0xa94c('0xc')](_0xa94c('0xd'),attributes,{'tableName':_0xa94c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa78e=['DashboardItem','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x46fb69,_0x5c8a01){var _0x10a393=function(_0x20d41f){while(--_0x20d41f){_0x46fb69['push'](_0x46fb69['shift']());}};_0x10a393(++_0x5c8a01);}(_0xa78e,0x1e1));var _0xea78=function(_0x576d7e,_0x46b7d9){_0x576d7e=_0x576d7e-0x0;var _0x2f599f=_0xa78e[_0x576d7e];return _0x2f599f;};'use strict';var _=require(_0xea78('0x0'));var util=require(_0xea78('0x1'));var logger=require(_0xea78('0x2'))('api');var moment=require('moment');var BPromise=require(_0xea78('0x3'));var rp=require(_0xea78('0x4'));var fs=require('fs');var path=require(_0xea78('0x5'));var rimraf=require('rimraf');var config=require(_0xea78('0x6'));var attributes=require(_0xea78('0x7'));module[_0xea78('0x8')]=function(_0x3cb08c,_0x1c5825){return _0x3cb08c['define'](_0xea78('0x9'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 0d03937..ccd7439 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 _0x12db=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x12db,0x9b));var _0xb12d=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0x12db[_0x581af1];return _0x54c22e;};'use strict';var _=require('lodash');var util=require(_0xb12d('0x0'));var moment=require(_0xb12d('0x1'));var BPromise=require('bluebird');var rs=require(_0xb12d('0x2'));var fs=require('fs');var Redis=require(_0xb12d('0x3'));var db=require(_0xb12d('0x4'))['db'];var utils=require(_0xb12d('0x5'));var logger=require(_0xb12d('0x6'))(_0xb12d('0x7'));var config=require(_0xb12d('0x8'));var jayson=require(_0xb12d('0x9'));var client=jayson[_0xb12d('0xa')][_0xb12d('0xb')]({'port':0x232a});config[_0xb12d('0xc')]=_[_0xb12d('0xd')](config[_0xb12d('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb12d('0xe'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0xb12d('0xf')](socket);function respondWithRpcPromise(_0x187c91,_0x5c47cf,_0x2541f7){return new BPromise(function(_0x31709f,_0x26477f){return client[_0xb12d('0x10')](_0x187c91,_0x2541f7)[_0xb12d('0x11')](function(_0x12c7a6){logger[_0xb12d('0x12')](_0xb12d('0x13'),_0x5c47cf,_0xb12d('0x14'));logger['debug'](_0xb12d('0x15'),_0x5c47cf,_0xb12d('0x14'),JSON[_0xb12d('0x16')](_0x12c7a6));if(_0x12c7a6[_0xb12d('0x17')]){if(_0x12c7a6['error'][_0xb12d('0x18')]===0x1f4){logger[_0xb12d('0x17')](_0xb12d('0x13'),_0x5c47cf,_0x12c7a6[_0xb12d('0x17')][_0xb12d('0x19')]);return _0x26477f(_0x12c7a6['error']['message']);}logger[_0xb12d('0x17')](_0xb12d('0x13'),_0x5c47cf,_0x12c7a6[_0xb12d('0x17')]['message']);return _0x31709f(_0x12c7a6['error'][_0xb12d('0x19')]);}else{logger[_0xb12d('0x12')](_0xb12d('0x13'),_0x5c47cf,_0xb12d('0x14'));_0x31709f(_0x12c7a6[_0xb12d('0x1a')]['message']);}})['catch'](function(_0xc3166c){logger['error'](_0xb12d('0x13'),_0x5c47cf,_0xc3166c);_0x26477f(_0xc3166c);});});} \ No newline at end of file +var _0x1fba=['catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','info','DashboardItem,\x20%s,\x20%s'];(function(_0x362e76,_0x275889){var _0x4b6b29=function(_0x1cec25){while(--_0x1cec25){_0x362e76['push'](_0x362e76['shift']());}};_0x4b6b29(++_0x275889);}(_0x1fba,0x12c));var _0xa1fb=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0x1fba[_0x4e6eb2];return _0x4e0c1c;};'use strict';var _=require('lodash');var util=require(_0xa1fb('0x0'));var moment=require('moment');var BPromise=require(_0xa1fb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa1fb('0x2'));var db=require(_0xa1fb('0x3'))['db'];var utils=require(_0xa1fb('0x4'));var logger=require('../../config/logger')(_0xa1fb('0x5'));var config=require(_0xa1fb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa1fb('0x7')][_0xa1fb('0x8')]({'port':0x232a});config[_0xa1fb('0x9')]=_[_0xa1fb('0xa')](config[_0xa1fb('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xa1fb('0xb'))(new Redis(config[_0xa1fb('0x9')]));require(_0xa1fb('0xc'))[_0xa1fb('0xd')](socket);function respondWithRpcPromise(_0x27c81e,_0x535a01,_0x308d97){return new BPromise(function(_0x1c7cf8,_0x168b50){return client[_0xa1fb('0xe')](_0x27c81e,_0x308d97)['then'](function(_0x516cf3){logger['info']('DashboardItem,\x20%s,\x20%s',_0x535a01,_0xa1fb('0xf'));logger['debug'](_0xa1fb('0x10'),_0x535a01,_0xa1fb('0xf'),JSON['stringify'](_0x516cf3));if(_0x516cf3[_0xa1fb('0x11')]){if(_0x516cf3[_0xa1fb('0x11')][_0xa1fb('0x12')]===0x1f4){logger[_0xa1fb('0x11')]('DashboardItem,\x20%s,\x20%s',_0x535a01,_0x516cf3[_0xa1fb('0x11')][_0xa1fb('0x13')]);return _0x168b50(_0x516cf3[_0xa1fb('0x11')][_0xa1fb('0x13')]);}logger[_0xa1fb('0x11')]('DashboardItem,\x20%s,\x20%s',_0x535a01,_0x516cf3['error'][_0xa1fb('0x13')]);return _0x1c7cf8(_0x516cf3['error']['message']);}else{logger[_0xa1fb('0x14')](_0xa1fb('0x15'),_0x535a01,'request\x20sent');_0x1c7cf8(_0x516cf3['result'][_0xa1fb('0x13')]);}})[_0xa1fb('0x16')](function(_0x33792c){logger[_0xa1fb('0x11')](_0xa1fb('0x15'),_0x535a01,_0x33792c);_0x168b50(_0x33792c);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index c3559ae..be8efc5 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 _0x6942=['emit','removeListener','register','length','./dashboardItem.events','save','remove','update'];(function(_0x3efe9b,_0x5b41a8){var _0x132073=function(_0x34459e){while(--_0x34459e){_0x3efe9b['push'](_0x3efe9b['shift']());}};_0x132073(++_0x5b41a8);}(_0x6942,0xe4));var _0x2694=function(_0x1f4f60,_0x44f861){_0x1f4f60=_0x1f4f60-0x0;var _0x22bc4c=_0x6942[_0x1f4f60];return _0x22bc4c;};'use strict';var DashboardItemEvents=require(_0x2694('0x0'));var events=[_0x2694('0x1'),_0x2694('0x2'),_0x2694('0x3')];function createListener(_0x37a155,_0x488550){return function(_0x2b7929){_0x488550[_0x2694('0x4')](_0x37a155,_0x2b7929);};}function removeListener(_0x228d97,_0x5cdb58){return function(){DashboardItemEvents[_0x2694('0x5')](_0x228d97,_0x5cdb58);};}exports[_0x2694('0x6')]=function(_0x36157b){for(var _0x5c7ea7=0x0,_0x31afbb=events[_0x2694('0x7')];_0x5c7ea7<_0x31afbb;_0x5c7ea7++){var _0x43caa8=events[_0x5c7ea7];var _0x1a64eb=createListener('dashboardItem:'+_0x43caa8,_0x36157b);DashboardItemEvents['on'](_0x43caa8,_0x1a64eb);}}; \ No newline at end of file +var _0x4d6d=['./dashboardItem.events','save','remove','emit','register','length','dashboardItem:'];(function(_0x264f48,_0x2c82d8){var _0xb99167=function(_0x4a6be7){while(--_0x4a6be7){_0x264f48['push'](_0x264f48['shift']());}};_0xb99167(++_0x2c82d8);}(_0x4d6d,0x15e));var _0xd4d6=function(_0x60cd08,_0x48fcd0){_0x60cd08=_0x60cd08-0x0;var _0x3e22b5=_0x4d6d[_0x60cd08];return _0x3e22b5;};'use strict';var DashboardItemEvents=require(_0xd4d6('0x0'));var events=[_0xd4d6('0x1'),_0xd4d6('0x2'),'update'];function createListener(_0x3cc553,_0x41af6f){return function(_0x6a19c2){_0x41af6f[_0xd4d6('0x3')](_0x3cc553,_0x6a19c2);};}function removeListener(_0xbbb29d,_0x48f13d){return function(){DashboardItemEvents['removeListener'](_0xbbb29d,_0x48f13d);};}exports[_0xd4d6('0x4')]=function(_0x38801e){for(var _0x3b68d1=0x0,_0x36e1e0=events[_0xd4d6('0x5')];_0x3b68d1<_0x36e1e0;_0x3b68d1++){var _0x36e625=events[_0x3b68d1];var _0x255abc=createListener(_0xd4d6('0x6')+_0x36e625,_0x38801e);DashboardItemEvents['on'](_0x36e625,_0x255abc);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index c4ec656..24c2c57 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 _0x69a0=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','post','create','delete'];(function(_0x445988,_0x19a6fe){var _0x2a2fd0=function(_0x378fd){while(--_0x378fd){_0x445988['push'](_0x445988['shift']());}};_0x2a2fd0(++_0x19a6fe);}(_0x69a0,0x111));var _0x069a=function(_0x81b9b,_0x544c3e){_0x81b9b=_0x81b9b-0x0;var _0x329ff9=_0x69a0[_0x81b9b];return _0x329ff9;};'use strict';var multer=require(_0x069a('0x0'));var util=require(_0x069a('0x1'));var path=require(_0x069a('0x2'));var timeout=require(_0x069a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x069a('0x4'));var auth=require(_0x069a('0x5'));var interaction=require(_0x069a('0x6'));var config=require(_0x069a('0x7'));var controller=require(_0x069a('0x8'));router[_0x069a('0x9')](_0x069a('0xa'),auth[_0x069a('0xb')](),controller['show']);router[_0x069a('0xc')]('/',auth[_0x069a('0xb')](),controller[_0x069a('0xd')]);router['put'](_0x069a('0xa'),auth[_0x069a('0xb')](),controller['update']);router[_0x069a('0xe')](_0x069a('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x069a('0xf')]=router; \ No newline at end of file +var _0x3c4c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3f848d,_0x4ce235){var _0x21dea6=function(_0x1c043f){while(--_0x1c043f){_0x3f848d['push'](_0x3f848d['shift']());}};_0x21dea6(++_0x4ce235);}(_0x3c4c,0xed));var _0xc3c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x3c4c[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xc3c4('0x0'));var util=require(_0xc3c4('0x1'));var path=require(_0xc3c4('0x2'));var timeout=require('connect-timeout');var express=require(_0xc3c4('0x3'));var router=express[_0xc3c4('0x4')]();var fs_extra=require(_0xc3c4('0x5'));var auth=require(_0xc3c4('0x6'));var interaction=require(_0xc3c4('0x7'));var config=require(_0xc3c4('0x8'));var controller=require(_0xc3c4('0x9'));router[_0xc3c4('0xa')](_0xc3c4('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xc3c4('0xc')]('/',auth[_0xc3c4('0xd')](),controller[_0xc3c4('0xe')]);router[_0xc3c4('0xf')](_0xc3c4('0xb'),auth[_0xc3c4('0xd')](),controller[_0xc3c4('0x10')]);router[_0xc3c4('0x11')]('/:id',auth[_0xc3c4('0xd')](),controller[_0xc3c4('0x12')]);module[_0xc3c4('0x13')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index ea1f4f9..4038dfd 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 _0xd1c7=['STRING','ENUM','first','sequelize','exports'];(function(_0x556c31,_0x27f18a){var _0x954887=function(_0x58be32){while(--_0x58be32){_0x556c31['push'](_0x556c31['shift']());}};_0x954887(++_0x27f18a);}(_0xd1c7,0x13e));var _0x7d1c=function(_0x4973ff,_0x30abe4){_0x4973ff=_0x4973ff-0x0;var _0x4dd6b6=_0xd1c7[_0x4973ff];return _0x4dd6b6;};'use strict';var Sequelize=require(_0x7d1c('0x0'));module[_0x7d1c('0x1')]={'name':{'type':Sequelize[_0x7d1c('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x7d1c('0x3')]('first','second','third'),'allowNull':![],'defaultValue':_0x7d1c('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4fd3=['third','STRING','ENUM','first','second'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x4fd3,0xf2));var _0x34fd=function(_0x3819bc,_0x3a35bf){_0x3819bc=_0x3819bc-0x0;var _0x249cf4=_0x4fd3[_0x3819bc];return _0x249cf4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x34fd('0x0')](_0x34fd('0x1'),_0x34fd('0x2'),_0x34fd('0x3')),'allowNull':![],'defaultValue':_0x34fd('0x1')},'description':{'type':Sequelize[_0x34fd('0x4')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index b57e3e9..7645485 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 _0xe935=['includeAll','include','findAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','params','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','Disposition'];(function(_0x5f6a8a,_0x45f474){var _0x2cce4d=function(_0x590b80){while(--_0x590b80){_0x5f6a8a['push'](_0x5f6a8a['shift']());}};_0x2cce4d(++_0x45f474);}(_0xe935,0x10b));var _0x5e93=function(_0x212de2,_0x4ea54c){_0x212de2=_0x212de2-0x0;var _0x46fad5=_0xe935[_0x212de2];return _0x46fad5;};'use strict';var emlformat=require(_0x5e93('0x0'));var rimraf=require(_0x5e93('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e93('0x2'));var rp=require('request-promise');var moment=require(_0x5e93('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5e93('0x4'));var util=require(_0x5e93('0x5'));var path=require('path');var sox=require(_0x5e93('0x6'));var csv=require(_0x5e93('0x7'));var ejs=require(_0x5e93('0x8'));var fs=require('fs');var fs_extra=require(_0x5e93('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e93('0xa'));var jsforce=require(_0x5e93('0xb'));var deskjs=require(_0x5e93('0xc'));var toCsv=require(_0x5e93('0x7'));var querystring=require(_0x5e93('0xd'));var Papa=require(_0x5e93('0xe'));var Redis=require(_0x5e93('0xf'));var authService=require(_0x5e93('0x10'));var qs=require(_0x5e93('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e93('0x12'));var logger=require(_0x5e93('0x13'))(_0x5e93('0x14'));var utils=require(_0x5e93('0x15'));var config=require(_0x5e93('0x16'));var licenseUtil=require(_0x5e93('0x17'));var db=require(_0x5e93('0x18'))['db'];function respondWithStatusCode(_0x5f2284,_0x3e138){_0x3e138=_0x3e138||0xcc;return function(_0x5ec147){if(_0x5ec147){return _0x5f2284[_0x5e93('0x19')](_0x3e138);}return _0x5f2284['status'](_0x3e138)[_0x5e93('0x1a')]();};}function respondWithResult(_0x5590df,_0x3c35b4){_0x3c35b4=_0x3c35b4||0xc8;return function(_0x3e5a23){if(_0x3e5a23){return _0x5590df[_0x5e93('0x1b')](_0x3c35b4)[_0x5e93('0x1c')](_0x3e5a23);}};}function respondWithFilteredResult(_0x479c4c,_0x45c0ef){return function(_0x377d57){if(_0x377d57){var _0x129812=typeof _0x45c0ef[_0x5e93('0x1d')]==='undefined'&&typeof _0x45c0ef[_0x5e93('0x1e')]===_0x5e93('0x1f');var _0x106cb8=_0x377d57['count'];var _0x4a5a6f=_0x129812?0x0:_0x45c0ef[_0x5e93('0x1d')];var _0x35220e=_0x129812?_0x377d57[_0x5e93('0x20')]:_0x45c0ef['offset']+_0x45c0ef[_0x5e93('0x1e')];var _0x5d4134;if(_0x35220e>=_0x106cb8){_0x35220e=_0x106cb8;_0x5d4134=0xc8;}else{_0x5d4134=0xce;}_0x479c4c[_0x5e93('0x1b')](_0x5d4134);return _0x479c4c[_0x5e93('0x21')](_0x5e93('0x22'),_0x4a5a6f+'-'+_0x35220e+'/'+_0x106cb8)[_0x5e93('0x1c')](_0x377d57);}return null;};}function patchUpdates(_0x334c12){return function(_0x432d32){try{jsonpatch[_0x5e93('0x23')](_0x432d32,_0x334c12,!![]);}catch(_0x13af7c){return BPromise[_0x5e93('0x24')](_0x13af7c);}return _0x432d32[_0x5e93('0x25')]();};}function saveUpdates(_0x4af2e0,_0x4899a1){return function(_0x3a4f3b){if(_0x3a4f3b){return _0x3a4f3b[_0x5e93('0x26')](_0x4af2e0)[_0x5e93('0x27')](function(_0x146753){return _0x146753;});}return null;};}function removeEntity(_0x16eae6,_0x8ae2d4){return function(_0x4eff7b){if(_0x4eff7b){return _0x4eff7b[_0x5e93('0x28')]()[_0x5e93('0x27')](function(){var _0x3c5a1f=_0x4eff7b[_0x5e93('0x29')]({'plain':!![]});var _0x13d426=_0x5e93('0x2a');return db['UserProfileResource'][_0x5e93('0x28')]({'where':{'type':_0x13d426,'resourceId':_0x3c5a1f['id']}})[_0x5e93('0x27')](function(){return _0x4eff7b;});})[_0x5e93('0x27')](function(){_0x16eae6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c0e3c,_0x30e373){return function(_0x17b685){if(!_0x17b685){_0x3c0e3c[_0x5e93('0x19')](0x194);}return _0x17b685;};}function handleError(_0x5b49ec,_0x1e49f6){_0x1e49f6=_0x1e49f6||0x1f4;return function(_0x2033d8){logger['error'](_0x2033d8[_0x5e93('0x2b')]);if(_0x2033d8[_0x5e93('0x2c')]){delete _0x2033d8[_0x5e93('0x2c')];}_0x5b49ec[_0x5e93('0x1b')](_0x1e49f6)[_0x5e93('0x2d')](_0x2033d8);};}exports[_0x5e93('0x2e')]=function(_0x32acd8,_0x48a1d3){var _0x3f811d={},_0x286f6a={},_0x2c09fd={'count':0x0,'rows':[]};var _0x11e557=_[_0x5e93('0x2f')](db['Disposition'][_0x5e93('0x30')],function(_0x4e91a4){return{'name':_0x4e91a4[_0x5e93('0x31')],'type':_0x4e91a4[_0x5e93('0x32')][_0x5e93('0x33')]};});_0x286f6a['model']=_[_0x5e93('0x2f')](_0x11e557,_0x5e93('0x2c'));_0x286f6a['query']=_[_0x5e93('0x34')](_0x32acd8[_0x5e93('0x35')]);_0x286f6a['filters']=_[_0x5e93('0x36')](_0x286f6a[_0x5e93('0x37')],_0x286f6a[_0x5e93('0x35')]);_0x3f811d[_0x5e93('0x38')]=_[_0x5e93('0x36')](_0x286f6a[_0x5e93('0x37')],qs['fields'](_0x32acd8[_0x5e93('0x35')][_0x5e93('0x39')]));_0x3f811d[_0x5e93('0x38')]=_0x3f811d[_0x5e93('0x38')][_0x5e93('0x3a')]?_0x3f811d[_0x5e93('0x38')]:_0x286f6a['model'];if(!_0x32acd8[_0x5e93('0x35')]['hasOwnProperty'](_0x5e93('0x3b'))){_0x3f811d[_0x5e93('0x1e')]=qs['limit'](_0x32acd8[_0x5e93('0x35')]['limit']);_0x3f811d[_0x5e93('0x1d')]=qs[_0x5e93('0x1d')](_0x32acd8['query'][_0x5e93('0x1d')]);}_0x3f811d[_0x5e93('0x3c')]=qs['sort'](_0x32acd8['query']['sort']);_0x3f811d[_0x5e93('0x3d')]=qs[_0x5e93('0x3e')](_[_0x5e93('0x3f')](_0x32acd8[_0x5e93('0x35')],_0x286f6a[_0x5e93('0x3e')]),_0x11e557);if(_0x32acd8[_0x5e93('0x35')][_0x5e93('0x40')]){_0x3f811d['where']=_[_0x5e93('0x41')](_0x3f811d[_0x5e93('0x3d')],{'$or':_[_0x5e93('0x2f')](_0x11e557,function(_0x25a1ca){if(_0x25a1ca[_0x5e93('0x32')]!==_0x5e93('0x42')){var _0x30e94f={};_0x30e94f[_0x25a1ca[_0x5e93('0x2c')]]={'$like':'%'+_0x32acd8[_0x5e93('0x35')][_0x5e93('0x40')]+'%'};return _0x30e94f;}})});}_0x3f811d=_[_0x5e93('0x41')]({},_0x3f811d,_0x32acd8[_0x5e93('0x43')]);var _0x5b1564={'where':_0x3f811d[_0x5e93('0x3d')]};return db[_0x5e93('0x44')][_0x5e93('0x20')](_0x5b1564)[_0x5e93('0x27')](function(_0x59029a){_0x2c09fd[_0x5e93('0x20')]=_0x59029a;if(_0x32acd8[_0x5e93('0x35')][_0x5e93('0x45')]){_0x3f811d[_0x5e93('0x46')]=[{'all':!![]}];}return db['Disposition'][_0x5e93('0x47')](_0x3f811d);})[_0x5e93('0x27')](function(_0x585901){_0x2c09fd['rows']=_0x585901;return _0x2c09fd;})[_0x5e93('0x27')](respondWithFilteredResult(_0x48a1d3,_0x3f811d))['catch'](handleError(_0x48a1d3,null));};exports['show']=function(_0x335d0c,_0x486ad9){var _0x5bd6b2={'raw':!![],'where':{'id':_0x335d0c['params']['id']}},_0x4b35f2={};_0x4b35f2[_0x5e93('0x37')]=_['keys'](db[_0x5e93('0x44')]['rawAttributes']);_0x4b35f2[_0x5e93('0x35')]=_['keys'](_0x335d0c[_0x5e93('0x35')]);_0x4b35f2[_0x5e93('0x3e')]=_[_0x5e93('0x36')](_0x4b35f2[_0x5e93('0x37')],_0x4b35f2[_0x5e93('0x35')]);_0x5bd6b2['attributes']=_[_0x5e93('0x36')](_0x4b35f2[_0x5e93('0x37')],qs['fields'](_0x335d0c['query'][_0x5e93('0x39')]));_0x5bd6b2[_0x5e93('0x38')]=_0x5bd6b2[_0x5e93('0x38')][_0x5e93('0x3a')]?_0x5bd6b2[_0x5e93('0x38')]:_0x4b35f2[_0x5e93('0x37')];if(_0x335d0c[_0x5e93('0x35')][_0x5e93('0x45')]){_0x5bd6b2[_0x5e93('0x46')]=[{'all':!![]}];}_0x5bd6b2=_['merge']({},_0x5bd6b2,_0x335d0c['options']);return db['Disposition'][_0x5e93('0x48')](_0x5bd6b2)[_0x5e93('0x27')](handleEntityNotFound(_0x486ad9,null))[_0x5e93('0x27')](respondWithResult(_0x486ad9,null))[_0x5e93('0x49')](handleError(_0x486ad9,null));};exports[_0x5e93('0x4a')]=function(_0x3e330f,_0x3fe9b0){return db[_0x5e93('0x44')][_0x5e93('0x4a')](_0x3e330f[_0x5e93('0x4b')],{})['then'](function(_0x524abb){var _0xce035c=_0x3e330f[_0x5e93('0x4c')][_0x5e93('0x29')]({'plain':!![]});if(!_0xce035c)throw new Error(_0x5e93('0x4d'));if(_0xce035c[_0x5e93('0x4e')]===_0x5e93('0x4c')){var _0x4fb618=_0x524abb[_0x5e93('0x29')]({'plain':!![]});var _0x4f6aa8=_0x5e93('0x2a');return db[_0x5e93('0x4f')][_0x5e93('0x48')]({'where':{'name':_0x4f6aa8,'userProfileId':_0xce035c['userProfileId']},'raw':!![]})[_0x5e93('0x27')](function(_0x11830d){if(_0x11830d&&_0x11830d[_0x5e93('0x50')]===0x0){return db[_0x5e93('0x51')]['create']({'name':_0x4fb618['name'],'resourceId':_0x4fb618['id'],'type':_0x11830d[_0x5e93('0x2c')],'sectionId':_0x11830d['id']},{})[_0x5e93('0x27')](function(){return _0x524abb;});}else{return _0x524abb;}})[_0x5e93('0x49')](function(_0x52e50e){logger[_0x5e93('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52e50e);throw _0x52e50e;});}return _0x524abb;})[_0x5e93('0x27')](respondWithResult(_0x3fe9b0,0xc9))[_0x5e93('0x49')](handleError(_0x3fe9b0,null));};exports['update']=function(_0x470302,_0x3651c1){if(_0x470302[_0x5e93('0x4b')]['id']){delete _0x470302[_0x5e93('0x4b')]['id'];}return db[_0x5e93('0x44')]['find']({'where':{'id':_0x470302['params']['id']}})[_0x5e93('0x27')](handleEntityNotFound(_0x3651c1,null))[_0x5e93('0x27')](saveUpdates(_0x470302[_0x5e93('0x4b')],null))['then'](respondWithResult(_0x3651c1,null))['catch'](handleError(_0x3651c1,null));};exports[_0x5e93('0x28')]=function(_0x2dbaed,_0x4d219b){return db[_0x5e93('0x44')]['find']({'where':{'id':_0x2dbaed[_0x5e93('0x53')]['id']}})[_0x5e93('0x27')](handleEntityNotFound(_0x4d219b,null))['then'](removeEntity(_0x4d219b,null))['catch'](handleError(_0x4d219b,null));}; \ No newline at end of file +var _0x958f=['options','includeAll','rows','catch','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','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','sendStatus','status','json','limit','undefined','count','offset','set','apply','save','then','destroy','get','Dispositions','end','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge'];(function(_0x284176,_0x338fb9){var _0x39d541=function(_0x37d0ce){while(--_0x37d0ce){_0x284176['push'](_0x284176['shift']());}};_0x39d541(++_0x338fb9);}(_0x958f,0x16e));var _0xf958=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x958f[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf958('0x0'));var zipdir=require(_0xf958('0x1'));var jsonpatch=require(_0xf958('0x2'));var rp=require(_0xf958('0x3'));var moment=require(_0xf958('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf958('0x5'));var util=require(_0xf958('0x6'));var path=require('path');var sox=require(_0xf958('0x7'));var csv=require('to-csv');var ejs=require(_0xf958('0x8'));var fs=require('fs');var fs_extra=require(_0xf958('0x9'));var _=require(_0xf958('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf958('0xb'));var deskjs=require(_0xf958('0xc'));var toCsv=require(_0xf958('0xd'));var querystring=require(_0xf958('0xe'));var Papa=require(_0xf958('0xf'));var Redis=require(_0xf958('0x10'));var authService=require(_0xf958('0x11'));var qs=require(_0xf958('0x12'));var as=require(_0xf958('0x13'));var hardwareService=require(_0xf958('0x14'));var logger=require(_0xf958('0x15'))(_0xf958('0x16'));var utils=require(_0xf958('0x17'));var config=require(_0xf958('0x18'));var licenseUtil=require(_0xf958('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x517877,_0x50dc33){_0x50dc33=_0x50dc33||0xcc;return function(_0x310c5f){if(_0x310c5f){return _0x517877[_0xf958('0x1a')](_0x50dc33);}return _0x517877['status'](_0x50dc33)['end']();};}function respondWithResult(_0x501db1,_0x5b16dc){_0x5b16dc=_0x5b16dc||0xc8;return function(_0x3e4555){if(_0x3e4555){return _0x501db1[_0xf958('0x1b')](_0x5b16dc)[_0xf958('0x1c')](_0x3e4555);}};}function respondWithFilteredResult(_0x4d4e56,_0x39cca9){return function(_0x3ce89d){if(_0x3ce89d){var _0x25dd16=typeof _0x39cca9['offset']==='undefined'&&typeof _0x39cca9[_0xf958('0x1d')]===_0xf958('0x1e');var _0x4706f2=_0x3ce89d[_0xf958('0x1f')];var _0x17d644=_0x25dd16?0x0:_0x39cca9[_0xf958('0x20')];var _0x4b8377=_0x25dd16?_0x3ce89d[_0xf958('0x1f')]:_0x39cca9[_0xf958('0x20')]+_0x39cca9[_0xf958('0x1d')];var _0xfcc760;if(_0x4b8377>=_0x4706f2){_0x4b8377=_0x4706f2;_0xfcc760=0xc8;}else{_0xfcc760=0xce;}_0x4d4e56['status'](_0xfcc760);return _0x4d4e56[_0xf958('0x21')]('Content-Range',_0x17d644+'-'+_0x4b8377+'/'+_0x4706f2)[_0xf958('0x1c')](_0x3ce89d);}return null;};}function patchUpdates(_0x2a7b34){return function(_0x236f7f){try{jsonpatch[_0xf958('0x22')](_0x236f7f,_0x2a7b34,!![]);}catch(_0x4c0eff){return BPromise['reject'](_0x4c0eff);}return _0x236f7f[_0xf958('0x23')]();};}function saveUpdates(_0x136533,_0x10260e){return function(_0x52364d){if(_0x52364d){return _0x52364d['update'](_0x136533)[_0xf958('0x24')](function(_0x54b73d){return _0x54b73d;});}return null;};}function removeEntity(_0x51c693,_0xce04b2){return function(_0x19a5c6){if(_0x19a5c6){return _0x19a5c6[_0xf958('0x25')]()[_0xf958('0x24')](function(){var _0x28bfb7=_0x19a5c6[_0xf958('0x26')]({'plain':!![]});var _0x5abda5=_0xf958('0x27');return db['UserProfileResource'][_0xf958('0x25')]({'where':{'type':_0x5abda5,'resourceId':_0x28bfb7['id']}})[_0xf958('0x24')](function(){return _0x19a5c6;});})['then'](function(){_0x51c693[_0xf958('0x1b')](0xcc)[_0xf958('0x28')]();});}};}function handleEntityNotFound(_0x5b84ca,_0x503499){return function(_0x1175ac){if(!_0x1175ac){_0x5b84ca[_0xf958('0x1a')](0x194);}return _0x1175ac;};}function handleError(_0x2327aa,_0x457166){_0x457166=_0x457166||0x1f4;return function(_0x2aade6){logger[_0xf958('0x29')](_0x2aade6[_0xf958('0x2a')]);if(_0x2aade6[_0xf958('0x2b')]){delete _0x2aade6['name'];}_0x2327aa[_0xf958('0x1b')](_0x457166)[_0xf958('0x2c')](_0x2aade6);};}exports[_0xf958('0x2d')]=function(_0x199cd3,_0x1745be){var _0x3ba4f7={},_0x5ce874={},_0x3c79e2={'count':0x0,'rows':[]};var _0x37a183=_[_0xf958('0x2e')](db[_0xf958('0x2f')][_0xf958('0x30')],function(_0x4f9d67){return{'name':_0x4f9d67[_0xf958('0x31')],'type':_0x4f9d67[_0xf958('0x32')][_0xf958('0x33')]};});_0x5ce874[_0xf958('0x34')]=_[_0xf958('0x2e')](_0x37a183,'name');_0x5ce874[_0xf958('0x35')]=_[_0xf958('0x36')](_0x199cd3[_0xf958('0x35')]);_0x5ce874[_0xf958('0x37')]=_['intersection'](_0x5ce874[_0xf958('0x34')],_0x5ce874['query']);_0x3ba4f7[_0xf958('0x38')]=_[_0xf958('0x39')](_0x5ce874[_0xf958('0x34')],qs[_0xf958('0x3a')](_0x199cd3[_0xf958('0x35')]['fields']));_0x3ba4f7['attributes']=_0x3ba4f7[_0xf958('0x38')][_0xf958('0x3b')]?_0x3ba4f7[_0xf958('0x38')]:_0x5ce874['model'];if(!_0x199cd3['query'][_0xf958('0x3c')](_0xf958('0x3d'))){_0x3ba4f7[_0xf958('0x1d')]=qs[_0xf958('0x1d')](_0x199cd3['query'][_0xf958('0x1d')]);_0x3ba4f7['offset']=qs['offset'](_0x199cd3[_0xf958('0x35')][_0xf958('0x20')]);}_0x3ba4f7[_0xf958('0x3e')]=qs[_0xf958('0x3f')](_0x199cd3['query'][_0xf958('0x3f')]);_0x3ba4f7['where']=qs[_0xf958('0x37')](_[_0xf958('0x40')](_0x199cd3[_0xf958('0x35')],_0x5ce874[_0xf958('0x37')]),_0x37a183);if(_0x199cd3[_0xf958('0x35')][_0xf958('0x41')]){_0x3ba4f7[_0xf958('0x42')]=_['merge'](_0x3ba4f7[_0xf958('0x42')],{'$or':_['map'](_0x37a183,function(_0x139db4){if(_0x139db4[_0xf958('0x32')]!==_0xf958('0x43')){var _0x5595cb={};_0x5595cb[_0x139db4[_0xf958('0x2b')]]={'$like':'%'+_0x199cd3[_0xf958('0x35')][_0xf958('0x41')]+'%'};return _0x5595cb;}})});}_0x3ba4f7=_[_0xf958('0x44')]({},_0x3ba4f7,_0x199cd3[_0xf958('0x45')]);var _0x9e1804={'where':_0x3ba4f7[_0xf958('0x42')]};return db[_0xf958('0x2f')]['count'](_0x9e1804)[_0xf958('0x24')](function(_0x2e1a61){_0x3c79e2[_0xf958('0x1f')]=_0x2e1a61;if(_0x199cd3[_0xf958('0x35')][_0xf958('0x46')]){_0x3ba4f7['include']=[{'all':!![]}];}return db[_0xf958('0x2f')]['findAll'](_0x3ba4f7);})['then'](function(_0x487dcf){_0x3c79e2[_0xf958('0x47')]=_0x487dcf;return _0x3c79e2;})[_0xf958('0x24')](respondWithFilteredResult(_0x1745be,_0x3ba4f7))[_0xf958('0x48')](handleError(_0x1745be,null));};exports['show']=function(_0x5892a2,_0x4e9b14){var _0x18e4e3={'raw':!![],'where':{'id':_0x5892a2['params']['id']}},_0x1ac392={};_0x1ac392[_0xf958('0x34')]=_[_0xf958('0x36')](db[_0xf958('0x2f')][_0xf958('0x30')]);_0x1ac392[_0xf958('0x35')]=_[_0xf958('0x36')](_0x5892a2['query']);_0x1ac392[_0xf958('0x37')]=_[_0xf958('0x39')](_0x1ac392[_0xf958('0x34')],_0x1ac392[_0xf958('0x35')]);_0x18e4e3[_0xf958('0x38')]=_[_0xf958('0x39')](_0x1ac392[_0xf958('0x34')],qs[_0xf958('0x3a')](_0x5892a2['query'][_0xf958('0x3a')]));_0x18e4e3[_0xf958('0x38')]=_0x18e4e3[_0xf958('0x38')][_0xf958('0x3b')]?_0x18e4e3['attributes']:_0x1ac392[_0xf958('0x34')];if(_0x5892a2[_0xf958('0x35')][_0xf958('0x46')]){_0x18e4e3[_0xf958('0x49')]=[{'all':!![]}];}_0x18e4e3=_[_0xf958('0x44')]({},_0x18e4e3,_0x5892a2[_0xf958('0x45')]);return db['Disposition'][_0xf958('0x4a')](_0x18e4e3)[_0xf958('0x24')](handleEntityNotFound(_0x4e9b14,null))[_0xf958('0x24')](respondWithResult(_0x4e9b14,null))[_0xf958('0x48')](handleError(_0x4e9b14,null));};exports['create']=function(_0x449e6f,_0x2b8db3){return db[_0xf958('0x2f')][_0xf958('0x4b')](_0x449e6f['body'],{})[_0xf958('0x24')](function(_0x275243){var _0xb6a543=_0x449e6f[_0xf958('0x4c')][_0xf958('0x26')]({'plain':!![]});if(!_0xb6a543)throw new Error(_0xf958('0x4d'));if(_0xb6a543[_0xf958('0x4e')]===_0xf958('0x4c')){var _0x433455=_0x275243[_0xf958('0x26')]({'plain':!![]});var _0x37f75c=_0xf958('0x27');return db[_0xf958('0x4f')]['find']({'where':{'name':_0x37f75c,'userProfileId':_0xb6a543[_0xf958('0x50')]},'raw':!![]})[_0xf958('0x24')](function(_0x315a21){if(_0x315a21&&_0x315a21[_0xf958('0x51')]===0x0){return db[_0xf958('0x52')][_0xf958('0x4b')]({'name':_0x433455['name'],'resourceId':_0x433455['id'],'type':_0x315a21['name'],'sectionId':_0x315a21['id']},{})['then'](function(){return _0x275243;});}else{return _0x275243;}})[_0xf958('0x48')](function(_0x2960d4){logger[_0xf958('0x29')](_0xf958('0x53'),_0x2960d4);throw _0x2960d4;});}return _0x275243;})['then'](respondWithResult(_0x2b8db3,0xc9))[_0xf958('0x48')](handleError(_0x2b8db3,null));};exports[_0xf958('0x54')]=function(_0x877e9b,_0x3a1207){if(_0x877e9b[_0xf958('0x55')]['id']){delete _0x877e9b[_0xf958('0x55')]['id'];}return db['Disposition'][_0xf958('0x4a')]({'where':{'id':_0x877e9b['params']['id']}})[_0xf958('0x24')](handleEntityNotFound(_0x3a1207,null))[_0xf958('0x24')](saveUpdates(_0x877e9b[_0xf958('0x55')],null))[_0xf958('0x24')](respondWithResult(_0x3a1207,null))[_0xf958('0x48')](handleError(_0x3a1207,null));};exports[_0xf958('0x25')]=function(_0x4e041a,_0x13cbba){return db[_0xf958('0x2f')][_0xf958('0x4a')]({'where':{'id':_0x4e041a[_0xf958('0x56')]['id']}})['then'](handleEntityNotFound(_0x13cbba,null))[_0xf958('0x24')](removeEntity(_0x13cbba,null))[_0xf958('0x48')](handleError(_0x13cbba,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 7619c61..ad51061 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 _0x894f=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','Disposition','tools_dispositions','name_voice','name','name_chat','ChatWebsiteId','MailAccountId','name_sms','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util'];(function(_0x1874fa,_0x119f7e){var _0xb76952=function(_0x2508dc){while(--_0x2508dc){_0x1874fa['push'](_0x1874fa['shift']());}};_0xb76952(++_0x119f7e);}(_0x894f,0x9f));var _0xf894=function(_0x509eb3,_0x3a0e31){_0x509eb3=_0x509eb3-0x0;var _0x28ba3d=_0x894f[_0x509eb3];return _0x28ba3d;};'use strict';var _=require('lodash');var util=require(_0xf894('0x0'));var logger=require(_0xf894('0x1'))(_0xf894('0x2'));var moment=require('moment');var BPromise=require(_0xf894('0x3'));var rp=require(_0xf894('0x4'));var fs=require('fs');var path=require(_0xf894('0x5'));var rimraf=require('rimraf');var config=require(_0xf894('0x6'));var attributes=require('./disposition.attributes');module['exports']=function(_0x1b7bf7,_0x2131b8){return _0x1b7bf7['define'](_0xf894('0x7'),attributes,{'tableName':_0xf894('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xf894('0x9'),'fields':[_0xf894('0xa'),'ListId']},{'unique':!![],'name':_0xf894('0xb'),'fields':['name',_0xf894('0xc')]},{'unique':!![],'name':'name_mail','fields':[_0xf894('0xa'),_0xf894('0xd')]},{'unique':!![],'name':_0xf894('0xe'),'fields':[_0xf894('0xa'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':['name',_0xf894('0xf')]},{'unique':!![],'name':_0xf894('0x10'),'fields':['name',_0xf894('0x11')]},{'unique':!![],'name':_0xf894('0x12'),'fields':['name',_0xf894('0x13')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf309=['name_mail','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','ChatWebsiteId'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0xf309,0x1b1));var _0x9f30=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xf309[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x9f30('0x0'));var util=require(_0x9f30('0x1'));var logger=require(_0x9f30('0x2'))('api');var moment=require(_0x9f30('0x3'));var BPromise=require(_0x9f30('0x4'));var rp=require(_0x9f30('0x5'));var fs=require('fs');var path=require(_0x9f30('0x6'));var rimraf=require('rimraf');var config=require(_0x9f30('0x7'));var attributes=require(_0x9f30('0x8'));module[_0x9f30('0x9')]=function(_0x5363d3,_0x404c84){return _0x5363d3[_0x9f30('0xa')](_0x9f30('0xb'),attributes,{'tableName':_0x9f30('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x9f30('0xd'),'fields':[_0x9f30('0xe'),_0x9f30('0xf')]},{'unique':!![],'name':'name_chat','fields':[_0x9f30('0xe'),_0x9f30('0x10')]},{'unique':!![],'name':_0x9f30('0x11'),'fields':[_0x9f30('0xe'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0x9f30('0xe'),_0x9f30('0x12')]},{'unique':!![],'name':_0x9f30('0x13'),'fields':[_0x9f30('0xe'),_0x9f30('0x14')]},{'unique':!![],'name':_0x9f30('0x15'),'fields':['name',_0x9f30('0x16')]},{'unique':!![],'name':_0x9f30('0x17'),'fields':[_0x9f30('0xe'),_0x9f30('0x18')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 2bd2a21..0174db1 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(_0xb4deee,_0x586b6c){var _0x3c55e7=function(_0x4e0f3e){while(--_0x4e0f3e){_0xb4deee['push'](_0xb4deee['shift']());}};_0x3c55e7(++_0x586b6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','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(_0x19577c,_0x1cd73d){var _0x4e1154=function(_0x4f2a71){while(--_0x4f2a71){_0x19577c['push'](_0x19577c['shift']());}};_0x4e1154(++_0x1cd73d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 be8ff99..f732420 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 _0xe2dc=['get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./disposition.controller'];(function(_0x1dd532,_0x36e81c){var _0x3732aa=function(_0x19d50a){while(--_0x19d50a){_0x1dd532['push'](_0x1dd532['shift']());}};_0x3732aa(++_0x36e81c);}(_0xe2dc,0xab));var _0xce2d=function(_0x49890f,_0x5794c9){_0x49890f=_0x49890f-0x0;var _0x1a9fcd=_0xe2dc[_0x49890f];return _0x1a9fcd;};'use strict';var multer=require(_0xce2d('0x0'));var util=require(_0xce2d('0x1'));var path=require(_0xce2d('0x2'));var timeout=require(_0xce2d('0x3'));var express=require(_0xce2d('0x4'));var router=express[_0xce2d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xce2d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xce2d('0x7'));var controller=require(_0xce2d('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xce2d('0x9')](_0xce2d('0xa'),auth[_0xce2d('0xb')](),controller[_0xce2d('0xc')]);router[_0xce2d('0xd')]('/',auth[_0xce2d('0xb')](),controller[_0xce2d('0xe')]);router[_0xce2d('0xf')](_0xce2d('0xa'),auth[_0xce2d('0xb')](),controller[_0xce2d('0x10')]);router[_0xce2d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xce2d('0x12')]);module[_0xce2d('0x13')]=router; \ No newline at end of file +var _0x3ee8=['../../components/interaction/service','../../config/environment','./disposition.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','path','connect-timeout','Router'];(function(_0x92fe9e,_0x312448){var _0x1d7484=function(_0x552b8f){while(--_0x552b8f){_0x92fe9e['push'](_0x92fe9e['shift']());}};_0x1d7484(++_0x312448);}(_0x3ee8,0x96));var _0x83ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ee8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x83ee('0x0'));var timeout=require(_0x83ee('0x1'));var express=require('express');var router=express[_0x83ee('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x83ee('0x3'));var config=require(_0x83ee('0x4'));var controller=require(_0x83ee('0x5'));router[_0x83ee('0x6')]('/',auth['isAuthenticated'](),controller[_0x83ee('0x7')]);router['get'](_0x83ee('0x8'),auth[_0x83ee('0x9')](),controller[_0x83ee('0xa')]);router[_0x83ee('0xb')]('/',auth['isAuthenticated'](),controller[_0x83ee('0xc')]);router[_0x83ee('0xd')](_0x83ee('0x8'),auth[_0x83ee('0x9')](),controller[_0x83ee('0xe')]);router[_0x83ee('0xf')](_0x83ee('0x8'),auth[_0x83ee('0x9')](),controller['destroy']);module[_0x83ee('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 1e0141c..970e46f 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 _0x87a0=['ENUM','yes','localstationid','2400','7200','12000','14400','4800','INTEGER','IAX','KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x15f3c0,_0x165a64){var _0x1adfe0=function(_0x212cfc){while(--_0x212cfc){_0x15f3c0['push'](_0x15f3c0['shift']());}};_0x1adfe0(++_0x165a64);}(_0x87a0,0xb5));var _0x087a=function(_0x32edad,_0x3191c6){_0x32edad=_0x32edad-0x0;var _0x2a3305=_0x87a0[_0x32edad];return _0x2a3305;};'use strict';var Sequelize=require(_0x087a('0x0'));module[_0x087a('0x1')]={'name':{'type':Sequelize[_0x087a('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x087a('0x2')]},'ecm':{'type':Sequelize[_0x087a('0x3')](_0x087a('0x4'),'no'),'defaultValue':_0x087a('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x087a('0x2')],'unique':_0x087a('0x5')},'minrate':{'type':Sequelize[_0x087a('0x3')](_0x087a('0x6'),'4800',_0x087a('0x7'),'9600',_0x087a('0x8'),_0x087a('0x9')),'defaultValue':_0x087a('0xa')},'maxrate':{'type':Sequelize[_0x087a('0x3')](_0x087a('0x6'),_0x087a('0xa'),_0x087a('0x7'),'9600','12000',_0x087a('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x087a('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x087a('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x087a('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x087a('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x087a('0x3')]('SIP',_0x087a('0xc'),'DADHI',_0x087a('0xd')),'defaultValue':_0x087a('0xe')},'key':{'type':Sequelize[_0x087a('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x087a('0xf')],'defaultValue':function(){return _0x087a('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x087a('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x087a('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x087a('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x087a('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x087a('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x087a('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x087a('0x13'),'set':function(_0x4fae7e){if(!_0x4fae7e)this['setDataValue'](_0x087a('0x14'),null);this[_0x087a('0x15')](_0x087a('0x16'),_0x4fae7e);}}}; \ No newline at end of file +var _0x25a4=['12000','14400','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','setDataValue','mandatoryDispositionPauseId','sequelize','STRING','yes','xCALLY\x20Motion\x20Fax','ENUM','2400','4800','7200','9600'];(function(_0x1bca56,_0x56bc1b){var _0x29cf18=function(_0x22c955){while(--_0x22c955){_0x1bca56['push'](_0x1bca56['shift']());}};_0x29cf18(++_0x56bc1b);}(_0x25a4,0x1eb));var _0x425a=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x25a4[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x425a('0x0'));module['exports']={'name':{'type':Sequelize[_0x425a('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x425a('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x425a('0x2'),'no'),'defaultValue':_0x425a('0x2')},'headerinfo':{'type':Sequelize[_0x425a('0x1')],'defaultValue':_0x425a('0x3')},'localstationid':{'type':Sequelize[_0x425a('0x1')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x425a('0x4')](_0x425a('0x5'),_0x425a('0x6'),_0x425a('0x7'),_0x425a('0x8'),_0x425a('0x9'),_0x425a('0xa')),'defaultValue':_0x425a('0x6')},'maxrate':{'type':Sequelize[_0x425a('0x4')](_0x425a('0x5'),_0x425a('0x6'),_0x425a('0x7'),_0x425a('0x8'),_0x425a('0x9'),'14400'),'defaultValue':_0x425a('0xa')},'modem':{'type':Sequelize[_0x425a('0x1')],'defaultValue':_0x425a('0xb')},'gateway':{'type':Sequelize[_0x425a('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x425a('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x425a('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x425a('0x4')](_0x425a('0xd'),_0x425a('0xe'),'DADHI',_0x425a('0xf')),'defaultValue':_0x425a('0xd')},'key':{'type':Sequelize[_0x425a('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x425a('0x10');}},'notificationSound':{'type':Sequelize[_0x425a('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x425a('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x425a('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x425a('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x425a('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x425a('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x425a('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x425a('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x364491){if(!_0x364491)this[_0x425a('0x12')](_0x425a('0x13'),null);this[_0x425a('0x12')]('mandatoryDisposition',_0x364491);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 87df74e..3fd0e1b 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 _0x4945=['findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','appdata','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','FAXOPT(','push','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','updateAccountApplications','update','tech','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','CmList','List','Contacts','updatedAt','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','defaults','Send\x20Fax\x20failed','user','out','filename','Messages','Contact\x20not\x20found','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','client','http','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','Pause','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','getDispositions','findOne','sort','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','includeAll','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','internal','Tag','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate'];(function(_0x485f26,_0x3ea4e3){var _0x2b7a80=function(_0x188a9e){while(--_0x188a9e){_0x485f26['push'](_0x485f26['shift']());}};_0x2b7a80(++_0x3ea4e3);}(_0x4945,0x1c9));var _0x5494=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x4945[_0xbd08b4];return _0x314f1e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5494('0x0'));var zipdir=require(_0x5494('0x1'));var jsonpatch=require(_0x5494('0x2'));var rp=require('request-promise');var moment=require(_0x5494('0x3'));var BPromise=require(_0x5494('0x4'));var Mustache=require(_0x5494('0x5'));var util=require(_0x5494('0x6'));var path=require(_0x5494('0x7'));var sox=require(_0x5494('0x8'));var csv=require(_0x5494('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5494('0xa'));var _=require(_0x5494('0xb'));var squel=require(_0x5494('0xc'));var crypto=require(_0x5494('0xd'));var jsforce=require(_0x5494('0xe'));var deskjs=require(_0x5494('0xf'));var toCsv=require(_0x5494('0x9'));var querystring=require(_0x5494('0x10'));var Papa=require('papaparse');var Redis=require(_0x5494('0x11'));var authService=require(_0x5494('0x12'));var qs=require(_0x5494('0x13'));var as=require(_0x5494('0x14'));var hardwareService=require(_0x5494('0x15'));var logger=require(_0x5494('0x16'))(_0x5494('0x17'));var utils=require(_0x5494('0x18'));var config=require(_0x5494('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5494('0x1a'))['db'];config[_0x5494('0x1b')]=_['defaults'](config[_0x5494('0x1b')],{'host':_0x5494('0x1c'),'port':0x18eb});var socket=require(_0x5494('0x1d'))(new Redis(config['redis']));require(_0x5494('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5494('0x1f')][_0x5494('0x20')]({'port':0x232c});var client9002=jayson[_0x5494('0x1f')][_0x5494('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2b22af,_0xd550a7,_0x4d557b,_0x334f8f){return new BPromise(function(_0x29155a,_0x572fc0){var _0x1948a6=_0x334f8f||client;return _0x1948a6['request'](_0x2b22af,_0x4d557b)[_0x5494('0x21')](function(_0x3ca429){logger['info'](_0x5494('0x22'),_0xd550a7,_0x5494('0x23'));logger[_0x5494('0x24')](_0x5494('0x25'),_0xd550a7,_0x5494('0x23'),JSON[_0x5494('0x26')](_0x3ca429));if(_0x3ca429[_0x5494('0x27')]){if(_0x3ca429['error'][_0x5494('0x28')]===0x1f4){logger[_0x5494('0x27')](_0x5494('0x22'),_0xd550a7,_0x3ca429['error']['message']);return _0x572fc0(_0x3ca429[_0x5494('0x27')][_0x5494('0x29')]);}logger['error'](_0x5494('0x22'),_0xd550a7,_0x3ca429[_0x5494('0x27')][_0x5494('0x29')]);return _0x29155a(_0x3ca429[_0x5494('0x27')][_0x5494('0x29')]);}else{logger[_0x5494('0x2a')](_0x5494('0x22'),_0xd550a7,_0x5494('0x23'));_0x29155a(_0x3ca429[_0x5494('0x2b')][_0x5494('0x29')]);}})[_0x5494('0x2c')](function(_0x16b948){logger[_0x5494('0x27')](_0x5494('0x22'),_0xd550a7,_0x16b948);_0x572fc0(_0x16b948);});});}function respondWithStatusCode(_0xa2cd6e,_0x520ee6){_0x520ee6=_0x520ee6||0xcc;return function(_0x501722){if(_0x501722){return _0xa2cd6e['sendStatus'](_0x520ee6);}return _0xa2cd6e['status'](_0x520ee6)[_0x5494('0x2d')]();};}function respondWithResult(_0x39d326,_0x41f159){_0x41f159=_0x41f159||0xc8;return function(_0x55c0ca){if(_0x55c0ca){return _0x39d326[_0x5494('0x2e')](_0x41f159)[_0x5494('0x2f')](_0x55c0ca);}};}function respondWithFilteredResult(_0x345676,_0x4820ee){return function(_0x47893e){if(_0x47893e){var _0x267abd=typeof _0x4820ee[_0x5494('0x30')]==='undefined'&&typeof _0x4820ee['limit']===_0x5494('0x31');var _0x1d2a75=_0x47893e[_0x5494('0x32')];var _0x537379=_0x267abd?0x0:_0x4820ee[_0x5494('0x30')];var _0x4a47e1=_0x267abd?_0x47893e['count']:_0x4820ee[_0x5494('0x30')]+_0x4820ee[_0x5494('0x33')];var _0x537a7d;if(_0x4a47e1>=_0x1d2a75){_0x4a47e1=_0x1d2a75;_0x537a7d=0xc8;}else{_0x537a7d=0xce;}_0x345676[_0x5494('0x2e')](_0x537a7d);return _0x345676[_0x5494('0x34')](_0x5494('0x35'),_0x537379+'-'+_0x4a47e1+'/'+_0x1d2a75)['json'](_0x47893e);}return null;};}function patchUpdates(_0x1ed1d5){return function(_0xf64eef){try{jsonpatch[_0x5494('0x36')](_0xf64eef,_0x1ed1d5,!![]);}catch(_0x5e3e54){return BPromise['reject'](_0x5e3e54);}return _0xf64eef['save']();};}function saveUpdates(_0x526479,_0x29816e){return function(_0x156dfb){if(_0x156dfb){return _0x156dfb['update'](_0x526479)[_0x5494('0x21')](function(_0x5e6e76){return _0x5e6e76;});}return null;};}function removeEntity(_0x216ba8,_0x506beb){return function(_0x538f76){if(_0x538f76){return _0x538f76[_0x5494('0x37')]()['then'](function(){var _0x3c3c10=_0x538f76[_0x5494('0x38')]({'plain':!![]});var _0x4da435=_0x5494('0x39');return db[_0x5494('0x3a')][_0x5494('0x37')]({'where':{'type':_0x4da435,'resourceId':_0x3c3c10['id']}})[_0x5494('0x21')](function(){return _0x538f76;});})[_0x5494('0x21')](function(){_0x216ba8['status'](0xcc)[_0x5494('0x2d')]();});}};}function handleEntityNotFound(_0x5c469c,_0x28d73b){return function(_0x3bb33b){if(!_0x3bb33b){_0x5c469c['sendStatus'](0x194);}return _0x3bb33b;};}function handleError(_0x2ddfe9,_0x5a92d9){_0x5a92d9=_0x5a92d9||0x1f4;return function(_0x4dcbaa){logger['error'](_0x4dcbaa[_0x5494('0x3b')]);if(_0x4dcbaa[_0x5494('0x3c')]){delete _0x4dcbaa[_0x5494('0x3c')];}_0x2ddfe9['status'](_0x5a92d9)[_0x5494('0x3d')](_0x4dcbaa);};}exports['index']=function(_0x2ac668,_0x5c793b){var _0x2eea04={'include':[{'model':db['Pause'],'as':_0x5494('0x3e')}]},_0x125a96={},_0x599480={'count':0x0,'rows':[]};var _0x606cd2=_[_0x5494('0x3f')](db[_0x5494('0x40')][_0x5494('0x41')],function(_0x185fff){return{'name':_0x185fff[_0x5494('0x42')],'type':_0x185fff[_0x5494('0x43')][_0x5494('0x44')]};});_0x125a96[_0x5494('0x45')]=_[_0x5494('0x3f')](_0x606cd2,'name');_0x125a96['query']=_[_0x5494('0x46')](_0x2ac668[_0x5494('0x47')]);_0x125a96[_0x5494('0x48')]=_[_0x5494('0x49')](_0x125a96['model'],_0x125a96[_0x5494('0x47')]);_0x2eea04[_0x5494('0x4a')]=_['intersection'](_0x125a96['model'],qs[_0x5494('0x4b')](_0x2ac668[_0x5494('0x47')][_0x5494('0x4b')]));_0x2eea04['attributes']=_0x2eea04[_0x5494('0x4a')][_0x5494('0x4c')]?_0x2eea04['attributes']:_0x125a96[_0x5494('0x45')];if(!_0x2ac668['query'][_0x5494('0x4d')](_0x5494('0x4e'))){_0x2eea04['limit']=qs[_0x5494('0x33')](_0x2ac668[_0x5494('0x47')][_0x5494('0x33')]);_0x2eea04[_0x5494('0x30')]=qs[_0x5494('0x30')](_0x2ac668[_0x5494('0x47')]['offset']);}_0x2eea04[_0x5494('0x4f')]=qs['sort'](_0x2ac668[_0x5494('0x47')]['sort']);_0x2eea04[_0x5494('0x50')]=qs[_0x5494('0x48')](_[_0x5494('0x51')](_0x2ac668[_0x5494('0x47')],_0x125a96[_0x5494('0x48')]),_0x606cd2);if(_0x2ac668[_0x5494('0x47')][_0x5494('0x52')]){_0x2eea04[_0x5494('0x50')]=_[_0x5494('0x53')](_0x2eea04['where'],{'$or':_[_0x5494('0x3f')](_0x606cd2,function(_0x33601b){if(_0x33601b[_0x5494('0x43')]!==_0x5494('0x54')){var _0x44ed43={};_0x44ed43[_0x33601b[_0x5494('0x3c')]]={'$like':'%'+_0x2ac668[_0x5494('0x47')][_0x5494('0x52')]+'%'};return _0x44ed43;}})});}_0x2eea04=_['merge']({},_0x2eea04,_0x2ac668[_0x5494('0x55')]);var _0x3f38b0={'where':_0x2eea04[_0x5494('0x50')]};return db[_0x5494('0x40')][_0x5494('0x32')](_0x3f38b0)[_0x5494('0x21')](function(_0x15f723){_0x599480[_0x5494('0x32')]=_0x15f723;if(_0x2ac668[_0x5494('0x47')]['includeAll']){_0x2eea04[_0x5494('0x56')]=[{'all':!![]}];}return db[_0x5494('0x40')][_0x5494('0x57')](_0x2eea04);})[_0x5494('0x21')](function(_0xbde54b){_0x599480[_0x5494('0x58')]=_0xbde54b;return _0x599480;})['then'](respondWithFilteredResult(_0x5c793b,_0x2eea04))['catch'](handleError(_0x5c793b,null));};exports[_0x5494('0x59')]=function(_0x50d85f,_0x10051e){var _0xa63480={'raw':![],'where':{'id':_0x50d85f[_0x5494('0x5a')]['id']},'include':[{'model':db[_0x5494('0x5b')],'as':_0x5494('0x3e')}]},_0x31c2a7={};_0x31c2a7['model']=_[_0x5494('0x46')](db['FaxAccount']['rawAttributes']);_0x31c2a7['query']=_[_0x5494('0x46')](_0x50d85f[_0x5494('0x47')]);_0x31c2a7['filters']=_[_0x5494('0x49')](_0x31c2a7[_0x5494('0x45')],_0x31c2a7[_0x5494('0x47')]);_0xa63480['attributes']=_[_0x5494('0x49')](_0x31c2a7['model'],qs[_0x5494('0x4b')](_0x50d85f['query']['fields']));_0xa63480[_0x5494('0x4a')]=_0xa63480[_0x5494('0x4a')][_0x5494('0x4c')]?_0xa63480[_0x5494('0x4a')]:_0x31c2a7['model'];if(_0x50d85f[_0x5494('0x47')]['includeAll']){_0xa63480['include']=[{'all':!![]}];}_0xa63480=_['merge']({},_0xa63480,_0x50d85f[_0x5494('0x55')]);return db[_0x5494('0x40')][_0x5494('0x5c')](_0xa63480)[_0x5494('0x21')](handleEntityNotFound(_0x10051e,null))[_0x5494('0x21')](respondWithResult(_0x10051e,null))['catch'](handleError(_0x10051e,null));};exports[_0x5494('0x5d')]=function(_0x17d2fe,_0x441912){return db[_0x5494('0x40')][_0x5494('0x5d')](_0x17d2fe['body'],{})['then'](function(_0x409e4e){var _0xbc73ca=_0x17d2fe['user']['get']({'plain':!![]});if(!_0xbc73ca)throw new Error(_0x5494('0x5e'));if(_0xbc73ca[_0x5494('0x5f')]==='user'){var _0x263e72=_0x409e4e[_0x5494('0x38')]({'plain':!![]});var _0x3166f0=_0x5494('0x39');return db[_0x5494('0x60')]['find']({'where':{'name':_0x3166f0,'userProfileId':_0xbc73ca[_0x5494('0x61')]},'raw':!![]})[_0x5494('0x21')](function(_0x560cee){if(_0x560cee&&_0x560cee[_0x5494('0x62')]===0x0){return db[_0x5494('0x3a')][_0x5494('0x5d')]({'name':_0x263e72[_0x5494('0x3c')],'resourceId':_0x263e72['id'],'type':_0x560cee[_0x5494('0x3c')],'sectionId':_0x560cee['id']},{})[_0x5494('0x21')](function(){return _0x409e4e;});}else{return _0x409e4e;}})['catch'](function(_0x353921){logger[_0x5494('0x27')](_0x5494('0x63'),_0x353921);throw _0x353921;});}return _0x409e4e;})[_0x5494('0x21')](respondWithResult(_0x441912,0xc9))['catch'](handleError(_0x441912,null));};exports['update']=function(_0x1b004f,_0x5e50c5){if(_0x1b004f[_0x5494('0x64')]['id']){delete _0x1b004f[_0x5494('0x64')]['id'];}return db['FaxAccount'][_0x5494('0x5c')]({'where':{'id':_0x1b004f[_0x5494('0x5a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x5494('0x21')](handleEntityNotFound(_0x5e50c5,null))['then'](saveUpdates(_0x1b004f['body'],null))[_0x5494('0x21')](respondWithResult(_0x5e50c5,null))[_0x5494('0x2c')](handleError(_0x5e50c5,null));};exports['destroy']=function(_0x392c5b,_0x3f30ef){return db[_0x5494('0x40')]['find']({'where':{'id':_0x392c5b[_0x5494('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3f30ef,null))[_0x5494('0x21')](removeEntity(_0x3f30ef,null))[_0x5494('0x2c')](handleError(_0x3f30ef,null));};exports['describe']=function(_0x389e35,_0x10c120){return db[_0x5494('0x40')][_0x5494('0x65')]()[_0x5494('0x21')](respondWithResult(_0x10c120,null))[_0x5494('0x2c')](handleError(_0x10c120,null));};exports[_0x5494('0x66')]=function(_0x3970cd,_0x506efd,_0x420fa8){if(_0x3970cd['body']['id']){delete _0x3970cd['body']['id'];}return db[_0x5494('0x40')][_0x5494('0x5c')]({'where':{'id':_0x3970cd['params']['id']}})[_0x5494('0x21')](handleEntityNotFound(_0x506efd,null))['then'](function(_0xb45ba0){if(_0xb45ba0){_0x3970cd[_0x5494('0x64')][_0x5494('0x67')]=_0xb45ba0['id'];return db['Disposition']['create'](_0x3970cd['body']);}})[_0x5494('0x21')](respondWithResult(_0x506efd,null))[_0x5494('0x2c')](handleError(_0x506efd,null));};exports[_0x5494('0x68')]=function(_0x1448bd,_0x2b280a,_0x4c81ce){var _0x34ba5f={'raw':![],'where':{}};var _0x31cf1c={};var _0x578c87={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5494('0x69')]({'where':{'id':_0x1448bd[_0x5494('0x5a')]['id']}})[_0x5494('0x21')](handleEntityNotFound(_0x2b280a,null))['then'](function(_0x429abe){if(_0x429abe){_0x31cf1c['model']=_[_0x5494('0x46')](db['Disposition'][_0x5494('0x41')]);_0x31cf1c[_0x5494('0x47')]=_[_0x5494('0x46')](_0x1448bd['query']);_0x31cf1c[_0x5494('0x48')]=_['intersection'](_0x31cf1c[_0x5494('0x45')],_0x31cf1c[_0x5494('0x47')]);_0x34ba5f[_0x5494('0x4a')]=_['intersection'](_0x31cf1c[_0x5494('0x45')],qs[_0x5494('0x4b')](_0x1448bd[_0x5494('0x47')][_0x5494('0x4b')]));_0x34ba5f[_0x5494('0x4a')]=_0x34ba5f[_0x5494('0x4a')][_0x5494('0x4c')]?_0x34ba5f[_0x5494('0x4a')]:_0x31cf1c['model'];if(!_0x1448bd[_0x5494('0x47')][_0x5494('0x4d')](_0x5494('0x4e'))){_0x34ba5f[_0x5494('0x33')]=qs[_0x5494('0x33')](_0x1448bd[_0x5494('0x47')][_0x5494('0x33')]);_0x34ba5f['offset']=qs['offset'](_0x1448bd[_0x5494('0x47')]['offset']);}_0x34ba5f[_0x5494('0x4f')]=qs[_0x5494('0x6a')](_0x1448bd[_0x5494('0x47')][_0x5494('0x6a')]);_0x34ba5f[_0x5494('0x50')]=qs[_0x5494('0x48')](_['pick'](_0x1448bd[_0x5494('0x47')],_0x31cf1c[_0x5494('0x48')]));_0x34ba5f['where'][_0x5494('0x67')]=_0x429abe['id'];if(_0x1448bd[_0x5494('0x47')]['filter']){_0x34ba5f[_0x5494('0x50')]=_[_0x5494('0x53')](_0x34ba5f[_0x5494('0x50')],{'$or':_['map'](_0x34ba5f[_0x5494('0x4a')],function(_0x159516){var _0x27c163={};_0x27c163[_0x159516]={'$like':'%'+_0x1448bd[_0x5494('0x47')][_0x5494('0x52')]+'%'};return _0x27c163;})});}_0x34ba5f=_['merge']({},_0x34ba5f,_0x1448bd[_0x5494('0x55')]);return db[_0x5494('0x6b')][_0x5494('0x32')]({'where':_0x34ba5f[_0x5494('0x50')]})[_0x5494('0x21')](function(_0x722490){_0x578c87[_0x5494('0x32')]=_0x722490;if(_0x1448bd[_0x5494('0x47')]['includeAll']){_0x34ba5f[_0x5494('0x56')]=[{'all':!![]}];}return db[_0x5494('0x6b')]['findAll'](_0x34ba5f);})[_0x5494('0x21')](function(_0x109028){_0x578c87[_0x5494('0x58')]=_0x109028;return _0x578c87;});}})[_0x5494('0x21')](respondWithFilteredResult(_0x2b280a,_0x34ba5f))[_0x5494('0x2c')](handleError(_0x2b280a,null));};exports[_0x5494('0x6c')]=function(_0x161550,_0x30050d,_0x3780f8){return db[_0x5494('0x40')][_0x5494('0x5c')]({'where':{'id':_0x161550[_0x5494('0x5a')]['id']}})['then'](handleEntityNotFound(_0x30050d,null))[_0x5494('0x21')](function(_0x26f840){if(_0x26f840){return _0x26f840[_0x5494('0x6c')](_0x161550[_0x5494('0x47')][_0x5494('0x6d')]);}})['then'](respondWithStatusCode(_0x30050d,null))[_0x5494('0x2c')](handleError(_0x30050d,null));};exports[_0x5494('0x6e')]=function(_0x18db26,_0x1924f3,_0x35ed92){if(_0x18db26['body']['id']){delete _0x18db26[_0x5494('0x64')]['id'];}return db[_0x5494('0x40')]['find']({'where':{'id':_0x18db26[_0x5494('0x5a')]['id']}})[_0x5494('0x21')](handleEntityNotFound(_0x1924f3,null))['then'](function(_0x59e5f1){if(_0x59e5f1){_0x18db26[_0x5494('0x64')]['FaxAccountId']=_0x59e5f1['id'];return db[_0x5494('0x6f')][_0x5494('0x5d')](_0x18db26[_0x5494('0x64')]);}})[_0x5494('0x21')](respondWithResult(_0x1924f3,null))[_0x5494('0x2c')](handleError(_0x1924f3,null));};exports['getAnswers']=function(_0x17be8c,_0x1605a7,_0x4656b4){var _0x5d3a7b={'raw':![],'where':{}};var _0x34aeda={};var _0x4928cf={'count':0x0,'rows':[]};return db[_0x5494('0x40')]['findOne']({'where':{'id':_0x17be8c['params']['id']}})['then'](handleEntityNotFound(_0x1605a7,null))[_0x5494('0x21')](function(_0x315bb3){if(_0x315bb3){_0x34aeda[_0x5494('0x45')]=_[_0x5494('0x46')](db['CannedAnswer']['rawAttributes']);_0x34aeda[_0x5494('0x47')]=_[_0x5494('0x46')](_0x17be8c[_0x5494('0x47')]);_0x34aeda['filters']=_[_0x5494('0x49')](_0x34aeda[_0x5494('0x45')],_0x34aeda[_0x5494('0x47')]);_0x5d3a7b['attributes']=_[_0x5494('0x49')](_0x34aeda['model'],qs['fields'](_0x17be8c[_0x5494('0x47')][_0x5494('0x4b')]));_0x5d3a7b[_0x5494('0x4a')]=_0x5d3a7b[_0x5494('0x4a')]['length']?_0x5d3a7b[_0x5494('0x4a')]:_0x34aeda['model'];if(!_0x17be8c[_0x5494('0x47')][_0x5494('0x4d')](_0x5494('0x4e'))){_0x5d3a7b[_0x5494('0x33')]=qs['limit'](_0x17be8c[_0x5494('0x47')][_0x5494('0x33')]);_0x5d3a7b[_0x5494('0x30')]=qs[_0x5494('0x30')](_0x17be8c[_0x5494('0x47')][_0x5494('0x30')]);}_0x5d3a7b[_0x5494('0x4f')]=qs[_0x5494('0x6a')](_0x17be8c[_0x5494('0x47')][_0x5494('0x6a')]);_0x5d3a7b[_0x5494('0x50')]=qs[_0x5494('0x48')](_['pick'](_0x17be8c['query'],_0x34aeda[_0x5494('0x48')]));_0x5d3a7b[_0x5494('0x50')]['FaxAccountId']=_0x315bb3['id'];if(_0x17be8c[_0x5494('0x47')][_0x5494('0x52')]){_0x5d3a7b[_0x5494('0x50')]=_['merge'](_0x5d3a7b['where'],{'$or':_['map'](_0x5d3a7b[_0x5494('0x4a')],function(_0x450c21){var _0x2d8f65={};_0x2d8f65[_0x450c21]={'$like':'%'+_0x17be8c['query'][_0x5494('0x52')]+'%'};return _0x2d8f65;})});}_0x5d3a7b=_['merge']({},_0x5d3a7b,_0x17be8c[_0x5494('0x55')]);return db[_0x5494('0x6f')]['count']({'where':_0x5d3a7b[_0x5494('0x50')]})[_0x5494('0x21')](function(_0x2246ff){_0x4928cf[_0x5494('0x32')]=_0x2246ff;if(_0x17be8c[_0x5494('0x47')][_0x5494('0x70')]){_0x5d3a7b[_0x5494('0x56')]=[{'all':!![]}];}return db[_0x5494('0x6f')][_0x5494('0x57')](_0x5d3a7b);})[_0x5494('0x21')](function(_0x4e5573){_0x4928cf[_0x5494('0x58')]=_0x4e5573;return _0x4928cf;});}})[_0x5494('0x21')](respondWithFilteredResult(_0x1605a7,_0x5d3a7b))[_0x5494('0x2c')](handleError(_0x1605a7,null));};exports[_0x5494('0x71')]=function(_0x3b91d9,_0xf8a6db,_0x4b13d3){return db[_0x5494('0x40')][_0x5494('0x5c')]({'where':{'id':_0x3b91d9[_0x5494('0x5a')]['id']}})[_0x5494('0x21')](handleEntityNotFound(_0xf8a6db,null))['then'](function(_0x4fd64e){if(_0x4fd64e){return _0x4fd64e['removeAnswers'](_0x3b91d9['query'][_0x5494('0x6d')]);}})[_0x5494('0x21')](respondWithStatusCode(_0xf8a6db,null))[_0x5494('0x2c')](handleError(_0xf8a6db,null));};exports[_0x5494('0x72')]=function(_0x1cc3e7,_0x186c80,_0x5518b9){return db['FaxInteraction']['find']({'where':{'id':_0x1cc3e7[_0x5494('0x5a')]['id']}})[_0x5494('0x21')](handleEntityNotFound(_0x186c80,null))[_0x5494('0x21')](function(_0xde6edc){if(_0xde6edc){return _0xde6edc[_0x5494('0x72')](_0x1cc3e7[_0x5494('0x64')][_0x5494('0x6d')],_[_0x5494('0x73')](_0x1cc3e7[_0x5494('0x64')],[_0x5494('0x6d'),'id'])||{});}})[_0x5494('0x21')](respondWithResult(_0x186c80,null))['catch'](handleError(_0x186c80,null));};exports[_0x5494('0x74')]=function(_0x1f1f5f,_0x52ab08,_0x3662ac){var _0x3c79cd={'raw':![],'where':{}};var _0x2eba78={};var _0x42bf0f={'count':0x0,'rows':[]};return db[_0x5494('0x40')]['findOne']({'where':{'id':_0x1f1f5f[_0x5494('0x5a')]['id']}})[_0x5494('0x21')](handleEntityNotFound(_0x52ab08,null))[_0x5494('0x21')](function(_0x404754){if(_0x404754){_0x2eba78[_0x5494('0x45')]=_['keys'](db[_0x5494('0x75')]['rawAttributes']);_0x2eba78['query']=_[_0x5494('0x46')](_0x1f1f5f[_0x5494('0x47')]);_0x2eba78[_0x5494('0x48')]=_[_0x5494('0x49')](_0x2eba78['model'],_0x2eba78[_0x5494('0x47')]);_0x3c79cd[_0x5494('0x4a')]=_[_0x5494('0x49')](_0x2eba78['model'],qs[_0x5494('0x4b')](_0x1f1f5f['query'][_0x5494('0x4b')]));_0x3c79cd[_0x5494('0x4a')]=_0x3c79cd[_0x5494('0x4a')]['length']?_0x3c79cd[_0x5494('0x4a')]:_0x2eba78[_0x5494('0x45')];if(!_0x1f1f5f[_0x5494('0x47')]['hasOwnProperty'](_0x5494('0x4e'))){_0x3c79cd[_0x5494('0x33')]=qs[_0x5494('0x33')](_0x1f1f5f[_0x5494('0x47')]['limit']);_0x3c79cd['offset']=qs[_0x5494('0x30')](_0x1f1f5f[_0x5494('0x47')][_0x5494('0x30')]);}_0x3c79cd[_0x5494('0x4f')]=qs[_0x5494('0x6a')](_0x1f1f5f[_0x5494('0x47')][_0x5494('0x6a')]);_0x3c79cd[_0x5494('0x50')]=qs[_0x5494('0x48')](_[_0x5494('0x51')](_0x1f1f5f[_0x5494('0x47')],_0x2eba78[_0x5494('0x48')]));_0x3c79cd[_0x5494('0x50')][_0x5494('0x67')]=_0x404754['id'];if(_0x1f1f5f[_0x5494('0x47')]['filter']){_0x3c79cd[_0x5494('0x50')]=_[_0x5494('0x53')](_0x3c79cd[_0x5494('0x50')],{'$or':_[_0x5494('0x3f')](_0x3c79cd['attributes'],function(_0x1169ed){var _0x290e80={};_0x290e80[_0x1169ed]={'$like':'%'+_0x1f1f5f['query'][_0x5494('0x52')]+'%'};return _0x290e80;})});}_0x3c79cd=_['merge']({},_0x3c79cd,_0x1f1f5f[_0x5494('0x55')]);return db[_0x5494('0x75')][_0x5494('0x32')]({'where':_0x3c79cd[_0x5494('0x50')]})[_0x5494('0x21')](function(_0x5eae4b){_0x42bf0f['count']=_0x5eae4b;if(_0x1f1f5f[_0x5494('0x47')][_0x5494('0x70')]){_0x3c79cd[_0x5494('0x56')]=[{'model':db[_0x5494('0x76')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x5494('0x3c'),'fullname',_0x5494('0x77')],'required':![]},{'model':db[_0x5494('0x78')],'as':'Tags','attributes':['id',_0x5494('0x3c'),_0x5494('0x79')],'where':_0x1f1f5f['query'][_0x5494('0x7a')]?{'id':_0x1f1f5f[_0x5494('0x47')][_0x5494('0x7a')]}:undefined,'required':_0x1f1f5f[_0x5494('0x47')][_0x5494('0x7a')]?!![]:![]}];}return db[_0x5494('0x75')][_0x5494('0x57')](_0x3c79cd);})['then'](function(_0x440b19){_0x42bf0f[_0x5494('0x58')]=_0x440b19;return _0x42bf0f;});}})[_0x5494('0x21')](respondWithFilteredResult(_0x52ab08,_0x3c79cd))[_0x5494('0x2c')](handleError(_0x52ab08,null));};exports[_0x5494('0x7b')]=function(_0x449513,_0x24cd40,_0x4917e0){return db[_0x5494('0x40')]['findOne']({'where':{'id':_0x449513[_0x5494('0x5a')]['id']}})['then'](handleEntityNotFound(_0x24cd40,null))[_0x5494('0x21')](function(_0x20fa12){if(_0x20fa12){return db[_0x5494('0x7c')][_0x5494('0x7d')](function(_0x5047d6){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x449513['params']['id']},'transaction':_0x5047d6})['then'](function(_0x331bda){var _0x467b7e=_[_0x5494('0x3f')](_0x449513[_0x5494('0x64')],function(_0x5d541d){_0x5d541d[_0x5494('0x67')]=_0x449513['params']['id'];return _0x5d541d;});return db[_0x5494('0x7e')][_0x5494('0x7f')](_0x467b7e,{'transaction':_0x5047d6});});})[_0x5494('0x21')](function(){return db[_0x5494('0x7e')][_0x5494('0x80')]({'where':{'FaxAccountId':_0x449513[_0x5494('0x5a')]['id']},'order':_0x5494('0x81')});});}})[_0x5494('0x21')](respondWithResult(_0x24cd40,null))[_0x5494('0x2c')](handleError(_0x24cd40,null));};exports[_0x5494('0x82')]=function(_0x443a94,_0x46ff9d,_0x1d9f17){var _0x52d8ed={};var _0x5d4526={};var _0xeb0d22;var _0x537500;return db[_0x5494('0x40')][_0x5494('0x69')]({'where':{'id':_0x443a94[_0x5494('0x5a')]['id']}})[_0x5494('0x21')](handleEntityNotFound(_0x46ff9d,null))[_0x5494('0x21')](function(_0x53192a){if(_0x53192a){_0xeb0d22=_0x53192a;_0x5d4526[_0x5494('0x45')]=_[_0x5494('0x46')](db[_0x5494('0x7e')][_0x5494('0x41')]);_0x5d4526['query']=_[_0x5494('0x46')](_0x443a94[_0x5494('0x47')]);_0x5d4526[_0x5494('0x48')]=_[_0x5494('0x49')](_0x5d4526['model'],_0x5d4526['query']);_0x52d8ed['attributes']=_[_0x5494('0x49')](_0x5d4526['model'],qs[_0x5494('0x4b')](_0x443a94[_0x5494('0x47')]['fields']));_0x52d8ed[_0x5494('0x4a')]=_0x52d8ed['attributes'][_0x5494('0x4c')]?_0x52d8ed[_0x5494('0x4a')]:_0x5d4526[_0x5494('0x45')];_0x52d8ed[_0x5494('0x4f')]=qs[_0x5494('0x6a')](_0x443a94[_0x5494('0x47')][_0x5494('0x6a')]);_0x52d8ed[_0x5494('0x50')]=qs[_0x5494('0x48')](_[_0x5494('0x51')](_0x443a94[_0x5494('0x47')],_0x5d4526[_0x5494('0x48')]));if(_0x443a94[_0x5494('0x47')][_0x5494('0x52')]){_0x52d8ed['where']=_['merge'](_0x52d8ed[_0x5494('0x50')],{'$or':_[_0x5494('0x3f')](_0x52d8ed[_0x5494('0x4a')],function(_0x2f24e2){var _0x322b1e={};_0x322b1e[_0x2f24e2]={'$like':'%'+_0x443a94['query'][_0x5494('0x52')]+'%'};return _0x322b1e;})});}_0x52d8ed=_[_0x5494('0x53')]({},_0x52d8ed,_0x443a94['options']);return _0xeb0d22[_0x5494('0x82')](_0x52d8ed);}})[_0x5494('0x21')](function(_0x26bdab){if(_0x26bdab){_0x537500=_0x26bdab[_0x5494('0x4c')];if(!_0x443a94[_0x5494('0x47')][_0x5494('0x4d')]('nolimit')){_0x52d8ed[_0x5494('0x33')]=qs['limit'](_0x443a94['query'][_0x5494('0x33')]);_0x52d8ed[_0x5494('0x30')]=qs['offset'](_0x443a94['query'][_0x5494('0x30')]);}return _0xeb0d22[_0x5494('0x82')](_0x52d8ed);}})[_0x5494('0x21')](function(_0x3be7ed){if(_0x3be7ed){return _0x3be7ed?{'count':_0x537500,'rows':_0x3be7ed}:null;}})[_0x5494('0x21')](respondWithResult(_0x46ff9d,null))[_0x5494('0x2c')](handleError(_0x46ff9d,null));};function Extension(_0x28a9c3,_0x36b60d,_0x391e98,_0x53b1f8){this[_0x5494('0x83')]=_0x5494('0x84');this[_0x5494('0x85')]=_0x28a9c3[_0x5494('0x86')];this[_0x5494('0x87')]=_0x53b1f8;this['type']='system';this['description']='Fax\x20Extension';this['FaxAccountId']=_0x28a9c3['id'];this[_0x5494('0x81')]=_0x36b60d;this[_0x5494('0x88')]=_0x391e98;}function createExtensionsReciveFax(_0xc7bbac){var _0x497fce=0x1;var _0x51d746=[];_0x51d746['push'](new Extension(_0xc7bbac,_0x497fce,'',_0x5494('0x89')));_0x497fce+=0x1;_0x51d746['push'](new Extension(_0xc7bbac,_0x497fce,_0x5494('0x8a'),_0x5494('0x8b')));_0x497fce+=0x1;for(var _0x2c589b in _0xc7bbac){if(_0xc7bbac[_0x5494('0x4d')](_0x2c589b)&&(_0x2c589b===_0x5494('0x8c')||_0x2c589b===_0x5494('0x86')||_0x2c589b===_0x5494('0x8d')||_0x2c589b===_0x5494('0x8e')||_0x2c589b===_0x5494('0x8f')||_0x2c589b==='maxrate'||_0x2c589b===_0x5494('0x90')||_0x2c589b===_0x5494('0x91')||_0x2c589b===_0x5494('0x92'))){_0x51d746['push'](new Extension(_0xc7bbac,_0x497fce,_0x5494('0x93')+_0x2c589b+')='+_0xc7bbac[_0x2c589b],_0x5494('0x8b')));_0x497fce+=0x1;}}_0x51d746[_0x5494('0x94')](new Extension(_0xc7bbac,_0x497fce,'6','Wait'));_0x497fce+=0x1;_0x51d746[_0x5494('0x94')](new Extension(_0xc7bbac,_0x497fce,_0x5494('0x95'),'ReceiveFax'));_0x497fce=0x0;return _0x51d746;}exports[_0x5494('0x96')]=function(_0x10507f,_0x426517,_0x5c06be){var _0x19b665;return db[_0x5494('0x7c')][_0x5494('0x7d')](function(_0xa749ff){return db[_0x5494('0x40')][_0x5494('0x5d')](_0x10507f[_0x5494('0x64')],{'transaction':_0xa749ff})['then'](function(_0x5ad18a){_0x19b665=_0x5ad18a['get']({'plain':!![]});return db[_0x5494('0x97')]['bulkCreate'](createExtensionsReciveFax(_0x19b665),{'transaction':_0xa749ff});});})[_0x5494('0x21')](function(){return _0x19b665;})[_0x5494('0x21')](respondWithResult(_0x426517,null))[_0x5494('0x2c')](handleError(_0x426517,null));};exports[_0x5494('0x98')]=function(_0x194f48,_0x1a7c65,_0x53f918){var _0x4a48ef;return db[_0x5494('0x7c')][_0x5494('0x7d')](function(_0x25ebd4){return db[_0x5494('0x40')][_0x5494('0x99')](_0x194f48[_0x5494('0x64')],{'where':{'id':_0x194f48['body']['id']},'transaction':_0x25ebd4})[_0x5494('0x21')](function(_0x229725){return db[_0x5494('0x97')][_0x5494('0x37')]({'where':{'FaxAccountId':_0x194f48[_0x5494('0x64')]['id']},'transaction':_0x25ebd4})[_0x5494('0x21')](function(_0x289f34){return db[_0x5494('0x97')][_0x5494('0x7f')](createExtensionsReciveFax(_['omit'](_0x194f48[_0x5494('0x64')],[_0x5494('0x9a'),_0x5494('0x44'),_0x5494('0x9b'),'updatedAt',_0x5494('0x9c'),_0x5494('0x9d')])),{'transaction':_0x25ebd4});});});})[_0x5494('0x21')](function(){return db[_0x5494('0x40')][_0x5494('0x9e')](_0x194f48['body']['id']);})[_0x5494('0x21')](respondWithResult(_0x1a7c65,null))['catch'](handleError(_0x1a7c65,null));};exports[_0x5494('0x9f')]=function(_0x457ba5,_0x5836eb,_0x23e608){var _0x5c698b={'raw':!![],'where':{}};var _0x6fd923={};var _0x169f37={'count':0x0,'rows':[]};return db[_0x5494('0x40')][_0x5494('0x69')]({'where':{'id':_0x457ba5['params']['id']}})[_0x5494('0x21')](handleEntityNotFound(_0x5836eb,null))[_0x5494('0x21')](function(_0x490ec7){if(_0x490ec7){_0x6fd923[_0x5494('0x45')]=_[_0x5494('0x46')](db[_0x5494('0xa0')]['rawAttributes']);_0x6fd923[_0x5494('0x47')]=_[_0x5494('0x46')](_0x457ba5[_0x5494('0x47')]);_0x6fd923[_0x5494('0x48')]=_['intersection'](_0x6fd923['model'],_0x6fd923[_0x5494('0x47')]);_0x5c698b['attributes']=_[_0x5494('0x49')](_0x6fd923['model'],qs[_0x5494('0x4b')](_0x457ba5['query']['fields']));_0x5c698b[_0x5494('0x4a')]=_0x5c698b[_0x5494('0x4a')][_0x5494('0x4c')]?_0x5c698b['attributes']:_0x6fd923['model'];if(!_0x457ba5[_0x5494('0x47')][_0x5494('0x4d')](_0x5494('0x4e'))){_0x5c698b[_0x5494('0x33')]=qs[_0x5494('0x33')](_0x457ba5[_0x5494('0x47')][_0x5494('0x33')]);_0x5c698b[_0x5494('0x30')]=qs[_0x5494('0x30')](_0x457ba5[_0x5494('0x47')][_0x5494('0x30')]);}_0x5c698b[_0x5494('0x4f')]=qs[_0x5494('0x6a')](_0x457ba5[_0x5494('0x47')][_0x5494('0x6a')]);_0x5c698b[_0x5494('0x50')]=qs[_0x5494('0x48')](_[_0x5494('0x51')](_0x457ba5['query'],_0x6fd923[_0x5494('0x48')]));_0x5c698b['where'][_0x5494('0x67')]=_0x490ec7['id'];if(_0x457ba5[_0x5494('0x47')][_0x5494('0x52')]){_0x5c698b['where']=_['merge'](_0x5c698b[_0x5494('0x50')],{'$or':_['map'](_0x5c698b[_0x5494('0x4a')],function(_0x5c5e26){var _0x33a75c={};_0x33a75c[_0x5c5e26]={'$like':'%'+_0x457ba5[_0x5494('0x47')]['filter']+'%'};return _0x33a75c;})});}if(_0x457ba5['query']['$gte']){var _0x348423=_0x457ba5['query'][_0x5494('0xa1')][_0x5494('0xa2')](',');var _0x267ea3={};_0x267ea3[_0x348423[0x0]]={'$gte':moment(_0x348423[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x5c698b['where']=_[_0x5494('0x53')](_0x5c698b['where'],_0x267ea3);}_0x5c698b=_[_0x5494('0x53')]({},_0x5c698b,_0x457ba5['options']);return db[_0x5494('0xa0')][_0x5494('0x32')]({'where':_0x5c698b['where']})[_0x5494('0x21')](function(_0x3dc101){_0x169f37[_0x5494('0x32')]=_0x3dc101;if(_0x457ba5[_0x5494('0x47')]['includeAll']){_0x5c698b[_0x5494('0x56')]=[{'all':!![]}];}return db[_0x5494('0xa0')][_0x5494('0x57')](_0x5c698b);})[_0x5494('0x21')](function(_0x264cbd){_0x169f37['rows']=_0x264cbd;return _0x169f37;});}})[_0x5494('0x21')](respondWithFilteredResult(_0x5836eb,_0x5c698b))[_0x5494('0x2c')](handleError(_0x5836eb,null));};exports[_0x5494('0x3d')]=function(_0x2e0f4b,_0x2aa474,_0x37b8f7){var _0x502121,_0x5968a0={},_0x41ed05;if(_0x2e0f4b[_0x5494('0x64')]['to']){_0x41ed05=_0x2e0f4b[_0x5494('0x64')]['to'][0x0];}return db[_0x5494('0x40')][_0x5494('0x5c')]({'where':{'id':_0x2e0f4b[_0x5494('0x5a')]['id']},'include':[{'model':db[_0x5494('0xa3')],'as':_0x5494('0xa4'),'include':[{'model':db[_0x5494('0x76')],'as':_0x5494('0xa5'),'where':{'fax':_0x41ed05},'limit':0x1,'order':[[_0x5494('0xa6'),_0x5494('0xa7')]]}]}]})[_0x5494('0x21')](handleEntityNotFound(_0x2aa474,null))[_0x5494('0x21')](function(_0x1bb9a3){_0x502121=_0x1bb9a3;if(_0x2e0f4b[_0x5494('0x64')][_0x5494('0xa8')]&&_0x2e0f4b[_0x5494('0x64')][_0x5494('0xa8')][_0x5494('0x4c')]){for(var _0x106551=0x0;_0x106551<_0x2e0f4b[_0x5494('0x64')]['attachments'][_0x5494('0x4c')];_0x106551+=0x1){_0x2e0f4b[_0x5494('0x64')][_0x5494('0xa8')][_0x106551]={'filename':_0x2e0f4b[_0x5494('0x64')][_0x5494('0xa8')][_0x106551][_0x5494('0x3c')],'id':_0x2e0f4b[_0x5494('0x64')]['attachments'][_0x106551]['id'],'path':path[_0x5494('0xa9')](config[_0x5494('0xaa')],_0x5494('0xab'),_0x2e0f4b[_0x5494('0x64')][_0x5494('0xa8')][_0x106551]['basename'])};}}return respondWithRpcPromise(_0x5494('0xac'),'CheckAfterSend',{'FaxAccountId':_[_0x5494('0xad')](_0x2e0f4b[_0x5494('0x5a')]['id'])?undefined:_0x2e0f4b['params']['id'],'path':_[_0x5494('0xad')](_0x2e0f4b[_0x5494('0x64')]['attachments'][0x0][_0x5494('0x7')])?undefined:_0x2e0f4b[_0x5494('0x64')]['attachments'][0x0][_0x5494('0x7')],'fax':_['isNil'](_0x2e0f4b[_0x5494('0x64')]['to'][0x0])?undefined:_0x2e0f4b[_0x5494('0x64')]['to'][0x0]},client9002);})[_0x5494('0x21')](function(){if(_0x502121){if(_['isNil'](_0x2e0f4b['body']['from'])){_0x2e0f4b['body'][_0x5494('0xae')]=util[_0x5494('0xaf')](_0x5494('0xb0'),_0x502121['name'],_0x502121[_0x5494('0xb1')]);}if(_0x502121[_0x5494('0xa4')]){if(_0x502121[_0x5494('0xa4')]['Contacts'][_0x5494('0x4c')]){return _0x502121[_0x5494('0xa4')]['Contacts'][0x0];}else{return db[_0x5494('0x76')]['create'](_[_0x5494('0xb2')](_0x2e0f4b[_0x5494('0x64')],{'firstName':_0x2e0f4b[_0x5494('0x64')]['to'][0x0],'phone':_0x2e0f4b['body']['to'][0x0],'fax':_0x2e0f4b[_0x5494('0x64')]['to'][0x0],'ListId':_0x502121[_0x5494('0x9d')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x5494('0xb3'));}})[_0x5494('0x21')](function(_0x1e2518){if(_0x1e2518){return db[_0x5494('0x75')][_0x5494('0x5c')]({'where':{'ContactId':_0x1e2518['id'],'closed':![],'FaxAccountId':_0x502121['id']}})[_0x5494('0x21')](function(_0x36e8f1){if(_0x36e8f1){return[_0x36e8f1,![]];}return db[_0x5494('0x75')][_0x5494('0x5d')]({'UserId':_0x2e0f4b[_0x5494('0xb4')]['id'],'ContactId':_0x1e2518['id'],'FaxAccountId':_0x502121['id'],'fax':_0x2e0f4b[_0x5494('0x64')]['to'][0x0],'firstMsgDirection':_0x5494('0xb5'),'Messages':[_['merge'](_0x2e0f4b[_0x5494('0x64')],{'read':![],'body':_0x2e0f4b['body'][_0x5494('0xa8')][0x0][_0x5494('0xb6')],'FaxAccountId':_0x502121['id'],'UserId':_0x2e0f4b['user']['id'],'ContactId':_0x1e2518['id'],'AttachmentId':_0x2e0f4b['body']['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x5494('0xa0')],'as':_0x5494('0xb7')}]})[_0x5494('0x21')](function(_0x36c04d){return[_0x36c04d,!![]];});});}else{throw new Error(_0x5494('0xb8'));}})['spread'](function(_0x2bd8f0,_0x1b5cd7){if(_0x1b5cd7){return _0x2bd8f0;}return db['FaxMessage'][_0x5494('0x5d')]({'direction':'out','read':![],'body':_0x2e0f4b[_0x5494('0x64')][_0x5494('0xa8')][0x0][_0x5494('0xb6')],'FaxAccountId':_0x502121['id'],'FaxInteractionId':_0x2bd8f0['id'],'UserId':_0x2e0f4b[_0x5494('0xb4')]['id'],'ContactId':_0x2bd8f0['ContactId'],'AttachmentId':_0x2e0f4b[_0x5494('0x64')][_0x5494('0xa8')][0x0]['id']})[_0x5494('0x21')](function(_0x2caa3f){_0x2bd8f0['dataValues'][_0x5494('0xb7')]=[];_0x2bd8f0[_0x5494('0xb9')]['Messages'][_0x5494('0x94')](_0x2caa3f[_0x5494('0xb9')]);return _0x2bd8f0;});})[_0x5494('0x21')](function(_0x481d65){respondWithRpcPromise(_0x5494('0xba'),_0x5494('0xba'),{'FaxAccountId':_[_0x5494('0xad')](_0x2e0f4b['params']['id'])?undefined:_0x2e0f4b[_0x5494('0x5a')]['id'],'path':_[_0x5494('0xad')](_0x2e0f4b['body'][_0x5494('0xa8')][0x0][_0x5494('0x7')])?undefined:_0x2e0f4b['body'][_0x5494('0xa8')][0x0]['path'],'fax':_[_0x5494('0xad')](_0x2e0f4b[_0x5494('0x64')]['to'][0x0])?undefined:_0x2e0f4b[_0x5494('0x64')]['to'][0x0],'AttachmentId':_0x2e0f4b[_0x5494('0x64')][_0x5494('0xa8')][0x0]['id']},client9002)['then'](function(_0x298246){logger[_0x5494('0x2a')](_0x5494('0xbb'),_0x298246);})[_0x5494('0x2c')](function(_0x3a48d5){logger[_0x5494('0x2a')](_0x5494('0xbb'),_0x3a48d5);});return _0x481d65;})[_0x5494('0x21')](respondWithResult(_0x2aa474,null))[_0x5494('0x2c')](handleError(_0x2aa474,null));};exports[_0x5494('0xbc')]=function(_0x2e26f2,_0x58a46c,_0x541749){return db[_0x5494('0x40')]['find']({'where':{'id':_0x2e26f2[_0x5494('0x5a')]['id']}})[_0x5494('0x21')](handleEntityNotFound(_0x58a46c,null))[_0x5494('0x21')](function(_0x2ec64c){if(_0x2ec64c){return _0x2ec64c[_0x5494('0xbc')](_0x2e26f2[_0x5494('0x64')]['ids'],_[_0x5494('0x73')](_0x2e26f2[_0x5494('0x64')],['ids','id'])||{})[_0x5494('0xbd')](function(_0x1e581b){for(var _0x2186a1=0x0;_0x2186a1<_0x2e26f2[_0x5494('0x64')][_0x5494('0x6d')]['length'];_0x2186a1+=0x1){socket[_0x5494('0xbe')]('userFaxAccount:save',{'UserId':Number(_0x2e26f2['body'][_0x5494('0x6d')][_0x2186a1]),'FaxAccountId':Number(_0x2e26f2[_0x5494('0x5a')]['id'])});}return _0x1e581b;});}})['then'](respondWithResult(_0x58a46c,null))[_0x5494('0x2c')](handleError(_0x58a46c,null));};exports['removeAgents']=function(_0x237648,_0x4723da,_0x14b9bd){return db[_0x5494('0x40')]['find']({'where':{'id':_0x237648['params']['id']}})[_0x5494('0x21')](handleEntityNotFound(_0x4723da,null))[_0x5494('0x21')](function(_0x2e47ad){if(_0x2e47ad){return _0x2e47ad[_0x5494('0xbf')](_0x237648[_0x5494('0x47')][_0x5494('0x6d')])[_0x5494('0x21')](function(){if(_[_0x5494('0xc0')](_0x237648['query'][_0x5494('0x6d')])){for(var _0x3ce81b=0x0;_0x3ce81b<_0x237648[_0x5494('0x47')][_0x5494('0x6d')]['length'];_0x3ce81b+=0x1){socket[_0x5494('0xbe')]('userFaxAccount:remove',{'UserId':Number(_0x237648[_0x5494('0x47')]['ids'][_0x3ce81b]),'FaxAccountId':Number(_0x237648[_0x5494('0x5a')]['id'])});}}else{socket[_0x5494('0xbe')](_0x5494('0xc1'),{'UserId':Number(_0x237648[_0x5494('0x47')][_0x5494('0x6d')]),'FaxAccountId':Number(_0x237648[_0x5494('0x5a')]['id'])});}});}})[_0x5494('0x21')](respondWithStatusCode(_0x4723da,null))[_0x5494('0x2c')](handleError(_0x4723da,null));};exports[_0x5494('0xc2')]=function(_0x1a33cd,_0x399cbb,_0x309752){var _0x2711e8={};var _0x2c66b4={};var _0x1fee95;var _0x4a0812;return db[_0x5494('0x40')][_0x5494('0x69')]({'where':{'id':_0x1a33cd[_0x5494('0x5a')]['id']}})[_0x5494('0x21')](handleEntityNotFound(_0x399cbb,null))[_0x5494('0x21')](function(_0x36eec5){if(_0x36eec5){_0x1fee95=_0x36eec5;_0x2c66b4[_0x5494('0x45')]=_[_0x5494('0x46')](db['User'][_0x5494('0x41')]);_0x2c66b4[_0x5494('0x47')]=_[_0x5494('0x46')](_0x1a33cd[_0x5494('0x47')]);_0x2c66b4[_0x5494('0x48')]=_[_0x5494('0x49')](_0x2c66b4['model'],_0x2c66b4[_0x5494('0x47')]);_0x2711e8[_0x5494('0x4a')]=_['intersection'](_0x2c66b4[_0x5494('0x45')],qs['fields'](_0x1a33cd[_0x5494('0x47')]['fields']));_0x2711e8[_0x5494('0x4a')]=_0x2711e8['attributes'][_0x5494('0x4c')]?_0x2711e8[_0x5494('0x4a')]:_0x2c66b4[_0x5494('0x45')];_0x2711e8['order']=qs['sort'](_0x1a33cd[_0x5494('0x47')]['sort']);_0x2711e8[_0x5494('0x50')]=qs[_0x5494('0x48')](_[_0x5494('0x51')](_0x1a33cd[_0x5494('0x47')],_0x2c66b4[_0x5494('0x48')]));if(_0x1a33cd[_0x5494('0x47')][_0x5494('0x52')]){_0x2711e8[_0x5494('0x50')]=_['merge'](_0x2711e8['where'],{'$or':_[_0x5494('0x3f')](_0x2711e8['attributes'],function(_0x167277){var _0x494553={};_0x494553[_0x167277]={'$like':'%'+_0x1a33cd['query']['filter']+'%'};return _0x494553;})});}_0x2711e8=_['merge']({},_0x2711e8,_0x1a33cd['options']);return _0x1fee95[_0x5494('0xc2')](_0x2711e8);}})['then'](function(_0x16cad1){if(_0x16cad1){_0x4a0812=_0x16cad1['length'];if(!_0x1a33cd['query'][_0x5494('0x4d')](_0x5494('0x4e'))){_0x2711e8[_0x5494('0x33')]=qs['limit'](_0x1a33cd[_0x5494('0x47')]['limit']);_0x2711e8[_0x5494('0x30')]=qs[_0x5494('0x30')](_0x1a33cd['query'][_0x5494('0x30')]);}return _0x1fee95[_0x5494('0xc2')](_0x2711e8);}})[_0x5494('0x21')](function(_0x428a05){if(_0x428a05){return _0x428a05?{'count':_0x4a0812,'rows':_0x428a05}:null;}})['then'](respondWithResult(_0x399cbb,null))['catch'](handleError(_0x399cbb,null));}; \ No newline at end of file +var _0x3e16=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','destroy','FaxAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','keys','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','getDispositions','removeDispositions','ids','addAnswer','FaxAccountId','getAnswers','findOne','CannedAnswer','addInteraction','FaxInteraction','omit','CmContact','User','Owner','internal','Tags','tag','addApplications','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','push','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','minrate','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','sequelize','VoiceExtension','updateAccountApplications','tech','createdAt','findById','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','updatedAt','DESC','attachments','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','List\x20not\x20found','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x5180c3,_0x4b35f7){var _0x55c975=function(_0x4746cb){while(--_0x4746cb){_0x5180c3['push'](_0x5180c3['shift']());}};_0x55c975(++_0x4b35f7);}(_0x3e16,0xba));var _0x63e1=function(_0x22835e,_0x14ffec){_0x22835e=_0x22835e-0x0;var _0xb85ef9=_0x3e16[_0x22835e];return _0xb85ef9;};'use strict';var emlformat=require(_0x63e1('0x0'));var rimraf=require(_0x63e1('0x1'));var zipdir=require(_0x63e1('0x2'));var jsonpatch=require(_0x63e1('0x3'));var rp=require(_0x63e1('0x4'));var moment=require('moment');var BPromise=require(_0x63e1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x63e1('0x6'));var sox=require(_0x63e1('0x7'));var csv=require(_0x63e1('0x8'));var ejs=require(_0x63e1('0x9'));var fs=require('fs');var fs_extra=require(_0x63e1('0xa'));var _=require(_0x63e1('0xb'));var squel=require(_0x63e1('0xc'));var crypto=require(_0x63e1('0xd'));var jsforce=require(_0x63e1('0xe'));var deskjs=require(_0x63e1('0xf'));var toCsv=require(_0x63e1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x63e1('0x10'));var authService=require(_0x63e1('0x11'));var qs=require(_0x63e1('0x12'));var as=require(_0x63e1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x63e1('0x14'))(_0x63e1('0x15'));var utils=require(_0x63e1('0x16'));var config=require(_0x63e1('0x17'));var licenseUtil=require(_0x63e1('0x18'));var db=require(_0x63e1('0x19'))['db'];config[_0x63e1('0x1a')]=_[_0x63e1('0x1b')](config[_0x63e1('0x1a')],{'host':_0x63e1('0x1c'),'port':0x18eb});var socket=require(_0x63e1('0x1d'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x63e1('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x63e1('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x63e1('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dc80c,_0x278f91,_0x43fdb5,_0x1fc578){return new BPromise(function(_0x11440e,_0xbe93e1){var _0x24f0fc=_0x1fc578||client;return _0x24f0fc['request'](_0x2dc80c,_0x43fdb5)[_0x63e1('0x20')](function(_0x547cd1){logger[_0x63e1('0x21')]('FaxAccount,\x20%s,\x20%s',_0x278f91,_0x63e1('0x22'));logger[_0x63e1('0x23')](_0x63e1('0x24'),_0x278f91,_0x63e1('0x22'),JSON[_0x63e1('0x25')](_0x547cd1));if(_0x547cd1[_0x63e1('0x26')]){if(_0x547cd1[_0x63e1('0x26')][_0x63e1('0x27')]===0x1f4){logger[_0x63e1('0x26')]('FaxAccount,\x20%s,\x20%s',_0x278f91,_0x547cd1[_0x63e1('0x26')]['message']);return _0xbe93e1(_0x547cd1[_0x63e1('0x26')][_0x63e1('0x28')]);}logger[_0x63e1('0x26')]('FaxAccount,\x20%s,\x20%s',_0x278f91,_0x547cd1[_0x63e1('0x26')]['message']);return _0x11440e(_0x547cd1[_0x63e1('0x26')][_0x63e1('0x28')]);}else{logger[_0x63e1('0x21')](_0x63e1('0x29'),_0x278f91,_0x63e1('0x22'));_0x11440e(_0x547cd1[_0x63e1('0x2a')]['message']);}})[_0x63e1('0x2b')](function(_0x4f06d4){logger[_0x63e1('0x26')]('FaxAccount,\x20%s,\x20%s',_0x278f91,_0x4f06d4);_0xbe93e1(_0x4f06d4);});});}function respondWithStatusCode(_0x315fa2,_0x35cfb0){_0x35cfb0=_0x35cfb0||0xcc;return function(_0x17cb1e){if(_0x17cb1e){return _0x315fa2[_0x63e1('0x2c')](_0x35cfb0);}return _0x315fa2['status'](_0x35cfb0)[_0x63e1('0x2d')]();};}function respondWithResult(_0x348af3,_0x29e3de){_0x29e3de=_0x29e3de||0xc8;return function(_0x440f37){if(_0x440f37){return _0x348af3[_0x63e1('0x2e')](_0x29e3de)[_0x63e1('0x2f')](_0x440f37);}};}function respondWithFilteredResult(_0x3020db,_0x38c7ac){return function(_0x5f5187){if(_0x5f5187){var _0x1cd118=typeof _0x38c7ac[_0x63e1('0x30')]==='undefined'&&typeof _0x38c7ac[_0x63e1('0x31')]===_0x63e1('0x32');var _0x444f01=_0x5f5187[_0x63e1('0x33')];var _0x229713=_0x1cd118?0x0:_0x38c7ac[_0x63e1('0x30')];var _0x261257=_0x1cd118?_0x5f5187['count']:_0x38c7ac[_0x63e1('0x30')]+_0x38c7ac[_0x63e1('0x31')];var _0x25ea87;if(_0x261257>=_0x444f01){_0x261257=_0x444f01;_0x25ea87=0xc8;}else{_0x25ea87=0xce;}_0x3020db[_0x63e1('0x2e')](_0x25ea87);return _0x3020db[_0x63e1('0x34')](_0x63e1('0x35'),_0x229713+'-'+_0x261257+'/'+_0x444f01)[_0x63e1('0x2f')](_0x5f5187);}return null;};}function patchUpdates(_0x3a1fa7){return function(_0xd98424){try{jsonpatch[_0x63e1('0x36')](_0xd98424,_0x3a1fa7,!![]);}catch(_0x49c4ec){return BPromise[_0x63e1('0x37')](_0x49c4ec);}return _0xd98424['save']();};}function saveUpdates(_0x38ef20,_0x9a29b8){return function(_0x42b05c){if(_0x42b05c){return _0x42b05c['update'](_0x38ef20)[_0x63e1('0x20')](function(_0x4e24bf){return _0x4e24bf;});}return null;};}function removeEntity(_0x518d89,_0x5e038d){return function(_0x1a9584){if(_0x1a9584){return _0x1a9584[_0x63e1('0x38')]()[_0x63e1('0x20')](function(){var _0x4876f8=_0x1a9584['get']({'plain':!![]});var _0x2b7876=_0x63e1('0x39');return db[_0x63e1('0x3a')][_0x63e1('0x38')]({'where':{'type':_0x2b7876,'resourceId':_0x4876f8['id']}})[_0x63e1('0x20')](function(){return _0x1a9584;});})[_0x63e1('0x20')](function(){_0x518d89[_0x63e1('0x2e')](0xcc)[_0x63e1('0x2d')]();});}};}function handleEntityNotFound(_0x459cf2,_0x2fdadd){return function(_0x192deb){if(!_0x192deb){_0x459cf2['sendStatus'](0x194);}return _0x192deb;};}function handleError(_0x325fbb,_0x592838){_0x592838=_0x592838||0x1f4;return function(_0x7af0ad){logger['error'](_0x7af0ad[_0x63e1('0x3b')]);if(_0x7af0ad['name']){delete _0x7af0ad[_0x63e1('0x3c')];}_0x325fbb['status'](_0x592838)['send'](_0x7af0ad);};}exports[_0x63e1('0x3d')]=function(_0x3db682,_0x38075e){var _0x477359={'include':[{'model':db[_0x63e1('0x3e')],'as':_0x63e1('0x3f')}]},_0x44cd00={},_0x5868a9={'count':0x0,'rows':[]};var _0x48a5d8=_[_0x63e1('0x40')](db[_0x63e1('0x41')][_0x63e1('0x42')],function(_0x47b4fa){return{'name':_0x47b4fa[_0x63e1('0x43')],'type':_0x47b4fa[_0x63e1('0x44')][_0x63e1('0x45')]};});_0x44cd00[_0x63e1('0x46')]=_[_0x63e1('0x40')](_0x48a5d8,_0x63e1('0x3c'));_0x44cd00['query']=_['keys'](_0x3db682[_0x63e1('0x47')]);_0x44cd00[_0x63e1('0x48')]=_[_0x63e1('0x49')](_0x44cd00[_0x63e1('0x46')],_0x44cd00[_0x63e1('0x47')]);_0x477359['attributes']=_[_0x63e1('0x49')](_0x44cd00[_0x63e1('0x46')],qs['fields'](_0x3db682[_0x63e1('0x47')][_0x63e1('0x4a')]));_0x477359[_0x63e1('0x4b')]=_0x477359[_0x63e1('0x4b')][_0x63e1('0x4c')]?_0x477359[_0x63e1('0x4b')]:_0x44cd00['model'];if(!_0x3db682[_0x63e1('0x47')][_0x63e1('0x4d')](_0x63e1('0x4e'))){_0x477359[_0x63e1('0x31')]=qs[_0x63e1('0x31')](_0x3db682[_0x63e1('0x47')]['limit']);_0x477359[_0x63e1('0x30')]=qs['offset'](_0x3db682['query'][_0x63e1('0x30')]);}_0x477359[_0x63e1('0x4f')]=qs[_0x63e1('0x50')](_0x3db682[_0x63e1('0x47')]['sort']);_0x477359[_0x63e1('0x51')]=qs[_0x63e1('0x48')](_[_0x63e1('0x52')](_0x3db682[_0x63e1('0x47')],_0x44cd00[_0x63e1('0x48')]),_0x48a5d8);if(_0x3db682[_0x63e1('0x47')][_0x63e1('0x53')]){_0x477359['where']=_['merge'](_0x477359[_0x63e1('0x51')],{'$or':_[_0x63e1('0x40')](_0x48a5d8,function(_0x2202ad){if(_0x2202ad[_0x63e1('0x44')]!==_0x63e1('0x54')){var _0x3eac2b={};_0x3eac2b[_0x2202ad['name']]={'$like':'%'+_0x3db682[_0x63e1('0x47')][_0x63e1('0x53')]+'%'};return _0x3eac2b;}})});}_0x477359=_[_0x63e1('0x55')]({},_0x477359,_0x3db682[_0x63e1('0x56')]);var _0x42393b={'where':_0x477359[_0x63e1('0x51')]};return db['FaxAccount'][_0x63e1('0x33')](_0x42393b)[_0x63e1('0x20')](function(_0x4d8ab3){_0x5868a9[_0x63e1('0x33')]=_0x4d8ab3;if(_0x3db682[_0x63e1('0x47')][_0x63e1('0x57')]){_0x477359['include']=[{'all':!![]}];}return db[_0x63e1('0x41')][_0x63e1('0x58')](_0x477359);})[_0x63e1('0x20')](function(_0x531583){_0x5868a9[_0x63e1('0x59')]=_0x531583;return _0x5868a9;})[_0x63e1('0x20')](respondWithFilteredResult(_0x38075e,_0x477359))[_0x63e1('0x2b')](handleError(_0x38075e,null));};exports[_0x63e1('0x5a')]=function(_0x2228f0,_0x10880c){var _0x322fb3={'raw':![],'where':{'id':_0x2228f0[_0x63e1('0x5b')]['id']},'include':[{'model':db[_0x63e1('0x3e')],'as':_0x63e1('0x3f')}]},_0x39029c={};_0x39029c[_0x63e1('0x46')]=_[_0x63e1('0x5c')](db[_0x63e1('0x41')]['rawAttributes']);_0x39029c[_0x63e1('0x47')]=_[_0x63e1('0x5c')](_0x2228f0['query']);_0x39029c['filters']=_[_0x63e1('0x49')](_0x39029c[_0x63e1('0x46')],_0x39029c[_0x63e1('0x47')]);_0x322fb3[_0x63e1('0x4b')]=_[_0x63e1('0x49')](_0x39029c[_0x63e1('0x46')],qs[_0x63e1('0x4a')](_0x2228f0[_0x63e1('0x47')][_0x63e1('0x4a')]));_0x322fb3[_0x63e1('0x4b')]=_0x322fb3['attributes'][_0x63e1('0x4c')]?_0x322fb3[_0x63e1('0x4b')]:_0x39029c[_0x63e1('0x46')];if(_0x2228f0['query'][_0x63e1('0x57')]){_0x322fb3[_0x63e1('0x5d')]=[{'all':!![]}];}_0x322fb3=_['merge']({},_0x322fb3,_0x2228f0[_0x63e1('0x56')]);return db[_0x63e1('0x41')][_0x63e1('0x5e')](_0x322fb3)[_0x63e1('0x20')](handleEntityNotFound(_0x10880c,null))[_0x63e1('0x20')](respondWithResult(_0x10880c,null))['catch'](handleError(_0x10880c,null));};exports[_0x63e1('0x5f')]=function(_0x444e9c,_0x22446f){return db['FaxAccount'][_0x63e1('0x5f')](_0x444e9c[_0x63e1('0x60')],{})['then'](function(_0x431197){var _0x26c4b4=_0x444e9c[_0x63e1('0x61')][_0x63e1('0x62')]({'plain':!![]});if(!_0x26c4b4)throw new Error(_0x63e1('0x63'));if(_0x26c4b4[_0x63e1('0x64')]===_0x63e1('0x61')){var _0x17f3d1=_0x431197['get']({'plain':!![]});var _0x475fe4=_0x63e1('0x39');return db[_0x63e1('0x65')][_0x63e1('0x5e')]({'where':{'name':_0x475fe4,'userProfileId':_0x26c4b4['userProfileId']},'raw':!![]})[_0x63e1('0x20')](function(_0x276662){if(_0x276662&&_0x276662[_0x63e1('0x66')]===0x0){return db['UserProfileResource'][_0x63e1('0x5f')]({'name':_0x17f3d1[_0x63e1('0x3c')],'resourceId':_0x17f3d1['id'],'type':_0x276662[_0x63e1('0x3c')],'sectionId':_0x276662['id']},{})['then'](function(){return _0x431197;});}else{return _0x431197;}})['catch'](function(_0x3ecef3){logger[_0x63e1('0x26')](_0x63e1('0x67'),_0x3ecef3);throw _0x3ecef3;});}return _0x431197;})['then'](respondWithResult(_0x22446f,0xc9))[_0x63e1('0x2b')](handleError(_0x22446f,null));};exports[_0x63e1('0x68')]=function(_0x20d900,_0x2cb1f9){if(_0x20d900[_0x63e1('0x60')]['id']){delete _0x20d900[_0x63e1('0x60')]['id'];}return db[_0x63e1('0x41')][_0x63e1('0x5e')]({'where':{'id':_0x20d900[_0x63e1('0x5b')]['id']},'include':[{'model':db[_0x63e1('0x3e')],'as':_0x63e1('0x3f')}]})[_0x63e1('0x20')](handleEntityNotFound(_0x2cb1f9,null))[_0x63e1('0x20')](saveUpdates(_0x20d900[_0x63e1('0x60')],null))[_0x63e1('0x20')](respondWithResult(_0x2cb1f9,null))['catch'](handleError(_0x2cb1f9,null));};exports[_0x63e1('0x38')]=function(_0x5ec0e1,_0xa25caa){return db[_0x63e1('0x41')][_0x63e1('0x5e')]({'where':{'id':_0x5ec0e1[_0x63e1('0x5b')]['id']}})['then'](handleEntityNotFound(_0xa25caa,null))[_0x63e1('0x20')](removeEntity(_0xa25caa,null))['catch'](handleError(_0xa25caa,null));};exports[_0x63e1('0x69')]=function(_0x4ea51b,_0x274b1b){return db[_0x63e1('0x41')]['describe']()[_0x63e1('0x20')](respondWithResult(_0x274b1b,null))['catch'](handleError(_0x274b1b,null));};exports[_0x63e1('0x6a')]=function(_0x2eb9a7,_0x3cd8ac,_0x2fa3ac){if(_0x2eb9a7[_0x63e1('0x60')]['id']){delete _0x2eb9a7[_0x63e1('0x60')]['id'];}return db[_0x63e1('0x41')]['find']({'where':{'id':_0x2eb9a7[_0x63e1('0x5b')]['id']}})[_0x63e1('0x20')](handleEntityNotFound(_0x3cd8ac,null))['then'](function(_0xf60d25){if(_0xf60d25){_0x2eb9a7[_0x63e1('0x60')]['FaxAccountId']=_0xf60d25['id'];return db[_0x63e1('0x6b')][_0x63e1('0x5f')](_0x2eb9a7[_0x63e1('0x60')]);}})[_0x63e1('0x20')](respondWithResult(_0x3cd8ac,null))[_0x63e1('0x2b')](handleError(_0x3cd8ac,null));};exports[_0x63e1('0x6c')]=function(_0x310f8a,_0x374033,_0x4d475f){var _0x3284d9={'raw':![],'where':{}};var _0x265f36={};var _0x32ea0b={'count':0x0,'rows':[]};return db[_0x63e1('0x41')]['findOne']({'where':{'id':_0x310f8a[_0x63e1('0x5b')]['id']}})['then'](handleEntityNotFound(_0x374033,null))[_0x63e1('0x20')](function(_0x5ab228){if(_0x5ab228){_0x265f36[_0x63e1('0x46')]=_[_0x63e1('0x5c')](db['Disposition'][_0x63e1('0x42')]);_0x265f36[_0x63e1('0x47')]=_[_0x63e1('0x5c')](_0x310f8a['query']);_0x265f36[_0x63e1('0x48')]=_[_0x63e1('0x49')](_0x265f36[_0x63e1('0x46')],_0x265f36[_0x63e1('0x47')]);_0x3284d9[_0x63e1('0x4b')]=_['intersection'](_0x265f36[_0x63e1('0x46')],qs[_0x63e1('0x4a')](_0x310f8a[_0x63e1('0x47')]['fields']));_0x3284d9['attributes']=_0x3284d9[_0x63e1('0x4b')][_0x63e1('0x4c')]?_0x3284d9[_0x63e1('0x4b')]:_0x265f36['model'];if(!_0x310f8a[_0x63e1('0x47')]['hasOwnProperty'](_0x63e1('0x4e'))){_0x3284d9['limit']=qs['limit'](_0x310f8a[_0x63e1('0x47')][_0x63e1('0x31')]);_0x3284d9[_0x63e1('0x30')]=qs[_0x63e1('0x30')](_0x310f8a[_0x63e1('0x47')][_0x63e1('0x30')]);}_0x3284d9['order']=qs['sort'](_0x310f8a[_0x63e1('0x47')][_0x63e1('0x50')]);_0x3284d9[_0x63e1('0x51')]=qs[_0x63e1('0x48')](_['pick'](_0x310f8a[_0x63e1('0x47')],_0x265f36[_0x63e1('0x48')]));_0x3284d9['where']['FaxAccountId']=_0x5ab228['id'];if(_0x310f8a[_0x63e1('0x47')][_0x63e1('0x53')]){_0x3284d9[_0x63e1('0x51')]=_[_0x63e1('0x55')](_0x3284d9[_0x63e1('0x51')],{'$or':_[_0x63e1('0x40')](_0x3284d9[_0x63e1('0x4b')],function(_0x402175){var _0x1ded1c={};_0x1ded1c[_0x402175]={'$like':'%'+_0x310f8a[_0x63e1('0x47')][_0x63e1('0x53')]+'%'};return _0x1ded1c;})});}_0x3284d9=_[_0x63e1('0x55')]({},_0x3284d9,_0x310f8a[_0x63e1('0x56')]);return db[_0x63e1('0x6b')][_0x63e1('0x33')]({'where':_0x3284d9[_0x63e1('0x51')]})[_0x63e1('0x20')](function(_0x3341fc){_0x32ea0b[_0x63e1('0x33')]=_0x3341fc;if(_0x310f8a[_0x63e1('0x47')][_0x63e1('0x57')]){_0x3284d9[_0x63e1('0x5d')]=[{'all':!![]}];}return db[_0x63e1('0x6b')][_0x63e1('0x58')](_0x3284d9);})['then'](function(_0x1cf4b9){_0x32ea0b[_0x63e1('0x59')]=_0x1cf4b9;return _0x32ea0b;});}})[_0x63e1('0x20')](respondWithFilteredResult(_0x374033,_0x3284d9))[_0x63e1('0x2b')](handleError(_0x374033,null));};exports[_0x63e1('0x6d')]=function(_0xbd6418,_0x3e5f91,_0x389f6a){return db[_0x63e1('0x41')][_0x63e1('0x5e')]({'where':{'id':_0xbd6418['params']['id']}})[_0x63e1('0x20')](handleEntityNotFound(_0x3e5f91,null))[_0x63e1('0x20')](function(_0x1b5cb4){if(_0x1b5cb4){return _0x1b5cb4['removeDispositions'](_0xbd6418[_0x63e1('0x47')][_0x63e1('0x6e')]);}})['then'](respondWithStatusCode(_0x3e5f91,null))[_0x63e1('0x2b')](handleError(_0x3e5f91,null));};exports[_0x63e1('0x6f')]=function(_0x14b100,_0x10dcdc,_0x3951d2){if(_0x14b100[_0x63e1('0x60')]['id']){delete _0x14b100['body']['id'];}return db[_0x63e1('0x41')][_0x63e1('0x5e')]({'where':{'id':_0x14b100[_0x63e1('0x5b')]['id']}})[_0x63e1('0x20')](handleEntityNotFound(_0x10dcdc,null))['then'](function(_0x377485){if(_0x377485){_0x14b100['body'][_0x63e1('0x70')]=_0x377485['id'];return db['CannedAnswer'][_0x63e1('0x5f')](_0x14b100[_0x63e1('0x60')]);}})[_0x63e1('0x20')](respondWithResult(_0x10dcdc,null))['catch'](handleError(_0x10dcdc,null));};exports[_0x63e1('0x71')]=function(_0x49339c,_0xbc44ce,_0x41eec5){var _0x1b5ebd={'raw':![],'where':{}};var _0x3929cb={};var _0x20f3de={'count':0x0,'rows':[]};return db[_0x63e1('0x41')][_0x63e1('0x72')]({'where':{'id':_0x49339c[_0x63e1('0x5b')]['id']}})[_0x63e1('0x20')](handleEntityNotFound(_0xbc44ce,null))[_0x63e1('0x20')](function(_0x331999){if(_0x331999){_0x3929cb[_0x63e1('0x46')]=_['keys'](db['CannedAnswer'][_0x63e1('0x42')]);_0x3929cb['query']=_[_0x63e1('0x5c')](_0x49339c[_0x63e1('0x47')]);_0x3929cb[_0x63e1('0x48')]=_[_0x63e1('0x49')](_0x3929cb[_0x63e1('0x46')],_0x3929cb[_0x63e1('0x47')]);_0x1b5ebd[_0x63e1('0x4b')]=_[_0x63e1('0x49')](_0x3929cb[_0x63e1('0x46')],qs['fields'](_0x49339c[_0x63e1('0x47')]['fields']));_0x1b5ebd[_0x63e1('0x4b')]=_0x1b5ebd[_0x63e1('0x4b')][_0x63e1('0x4c')]?_0x1b5ebd[_0x63e1('0x4b')]:_0x3929cb['model'];if(!_0x49339c[_0x63e1('0x47')]['hasOwnProperty']('nolimit')){_0x1b5ebd['limit']=qs[_0x63e1('0x31')](_0x49339c['query'][_0x63e1('0x31')]);_0x1b5ebd['offset']=qs['offset'](_0x49339c['query'][_0x63e1('0x30')]);}_0x1b5ebd[_0x63e1('0x4f')]=qs[_0x63e1('0x50')](_0x49339c[_0x63e1('0x47')][_0x63e1('0x50')]);_0x1b5ebd['where']=qs['filters'](_[_0x63e1('0x52')](_0x49339c[_0x63e1('0x47')],_0x3929cb['filters']));_0x1b5ebd['where'][_0x63e1('0x70')]=_0x331999['id'];if(_0x49339c[_0x63e1('0x47')][_0x63e1('0x53')]){_0x1b5ebd[_0x63e1('0x51')]=_[_0x63e1('0x55')](_0x1b5ebd[_0x63e1('0x51')],{'$or':_[_0x63e1('0x40')](_0x1b5ebd['attributes'],function(_0x276988){var _0x5481ba={};_0x5481ba[_0x276988]={'$like':'%'+_0x49339c[_0x63e1('0x47')][_0x63e1('0x53')]+'%'};return _0x5481ba;})});}_0x1b5ebd=_[_0x63e1('0x55')]({},_0x1b5ebd,_0x49339c[_0x63e1('0x56')]);return db['CannedAnswer'][_0x63e1('0x33')]({'where':_0x1b5ebd[_0x63e1('0x51')]})[_0x63e1('0x20')](function(_0x4ba2d3){_0x20f3de['count']=_0x4ba2d3;if(_0x49339c['query']['includeAll']){_0x1b5ebd[_0x63e1('0x5d')]=[{'all':!![]}];}return db[_0x63e1('0x73')][_0x63e1('0x58')](_0x1b5ebd);})['then'](function(_0x41a8c2){_0x20f3de[_0x63e1('0x59')]=_0x41a8c2;return _0x20f3de;});}})[_0x63e1('0x20')](respondWithFilteredResult(_0xbc44ce,_0x1b5ebd))[_0x63e1('0x2b')](handleError(_0xbc44ce,null));};exports['removeAnswers']=function(_0x454445,_0x392a4b,_0x4419e3){return db[_0x63e1('0x41')][_0x63e1('0x5e')]({'where':{'id':_0x454445['params']['id']}})[_0x63e1('0x20')](handleEntityNotFound(_0x392a4b,null))[_0x63e1('0x20')](function(_0x56b993){if(_0x56b993){return _0x56b993['removeAnswers'](_0x454445['query']['ids']);}})['then'](respondWithStatusCode(_0x392a4b,null))['catch'](handleError(_0x392a4b,null));};exports[_0x63e1('0x74')]=function(_0x3d582d,_0x19beee,_0xaf204){return db[_0x63e1('0x75')][_0x63e1('0x5e')]({'where':{'id':_0x3d582d[_0x63e1('0x5b')]['id']}})[_0x63e1('0x20')](handleEntityNotFound(_0x19beee,null))[_0x63e1('0x20')](function(_0x212e8b){if(_0x212e8b){return _0x212e8b[_0x63e1('0x74')](_0x3d582d[_0x63e1('0x60')]['ids'],_[_0x63e1('0x76')](_0x3d582d[_0x63e1('0x60')],[_0x63e1('0x6e'),'id'])||{});}})[_0x63e1('0x20')](respondWithResult(_0x19beee,null))[_0x63e1('0x2b')](handleError(_0x19beee,null));};exports['getInteractions']=function(_0x43f85c,_0x2ef015,_0x50ec46){var _0xf9dc47={'raw':![],'where':{}};var _0x31a116={};var _0x5228d1={'count':0x0,'rows':[]};return db[_0x63e1('0x41')][_0x63e1('0x72')]({'where':{'id':_0x43f85c[_0x63e1('0x5b')]['id']}})[_0x63e1('0x20')](handleEntityNotFound(_0x2ef015,null))['then'](function(_0x13c9b9){if(_0x13c9b9){_0x31a116[_0x63e1('0x46')]=_['keys'](db[_0x63e1('0x75')][_0x63e1('0x42')]);_0x31a116['query']=_[_0x63e1('0x5c')](_0x43f85c[_0x63e1('0x47')]);_0x31a116[_0x63e1('0x48')]=_[_0x63e1('0x49')](_0x31a116[_0x63e1('0x46')],_0x31a116[_0x63e1('0x47')]);_0xf9dc47[_0x63e1('0x4b')]=_[_0x63e1('0x49')](_0x31a116[_0x63e1('0x46')],qs[_0x63e1('0x4a')](_0x43f85c[_0x63e1('0x47')][_0x63e1('0x4a')]));_0xf9dc47[_0x63e1('0x4b')]=_0xf9dc47['attributes']['length']?_0xf9dc47['attributes']:_0x31a116[_0x63e1('0x46')];if(!_0x43f85c['query'][_0x63e1('0x4d')]('nolimit')){_0xf9dc47['limit']=qs['limit'](_0x43f85c[_0x63e1('0x47')]['limit']);_0xf9dc47[_0x63e1('0x30')]=qs[_0x63e1('0x30')](_0x43f85c[_0x63e1('0x47')]['offset']);}_0xf9dc47[_0x63e1('0x4f')]=qs[_0x63e1('0x50')](_0x43f85c['query'][_0x63e1('0x50')]);_0xf9dc47[_0x63e1('0x51')]=qs['filters'](_[_0x63e1('0x52')](_0x43f85c[_0x63e1('0x47')],_0x31a116[_0x63e1('0x48')]));_0xf9dc47[_0x63e1('0x51')][_0x63e1('0x70')]=_0x13c9b9['id'];if(_0x43f85c[_0x63e1('0x47')]['filter']){_0xf9dc47[_0x63e1('0x51')]=_[_0x63e1('0x55')](_0xf9dc47[_0x63e1('0x51')],{'$or':_[_0x63e1('0x40')](_0xf9dc47[_0x63e1('0x4b')],function(_0x18ef74){var _0x1376f2={};_0x1376f2[_0x18ef74]={'$like':'%'+_0x43f85c[_0x63e1('0x47')][_0x63e1('0x53')]+'%'};return _0x1376f2;})});}_0xf9dc47=_[_0x63e1('0x55')]({},_0xf9dc47,_0x43f85c[_0x63e1('0x56')]);return db[_0x63e1('0x75')][_0x63e1('0x33')]({'where':_0xf9dc47['where']})[_0x63e1('0x20')](function(_0x2a4ffb){_0x5228d1[_0x63e1('0x33')]=_0x2a4ffb;if(_0x43f85c[_0x63e1('0x47')][_0x63e1('0x57')]){_0xf9dc47[_0x63e1('0x5d')]=[{'model':db[_0x63e1('0x77')],'as':'Contact','required':![]},{'model':db[_0x63e1('0x78')],'as':_0x63e1('0x79'),'attributes':[_0x63e1('0x3c'),'fullname',_0x63e1('0x7a')],'required':![]},{'model':db['Tag'],'as':_0x63e1('0x7b'),'attributes':['id',_0x63e1('0x3c'),'color'],'where':_0x43f85c[_0x63e1('0x47')]['tag']?{'id':_0x43f85c[_0x63e1('0x47')][_0x63e1('0x7c')]}:undefined,'required':_0x43f85c['query'][_0x63e1('0x7c')]?!![]:![]}];}return db[_0x63e1('0x75')][_0x63e1('0x58')](_0xf9dc47);})[_0x63e1('0x20')](function(_0x59d2d2){_0x5228d1[_0x63e1('0x59')]=_0x59d2d2;return _0x5228d1;});}})[_0x63e1('0x20')](respondWithFilteredResult(_0x2ef015,_0xf9dc47))[_0x63e1('0x2b')](handleError(_0x2ef015,null));};exports[_0x63e1('0x7d')]=function(_0x2fee2c,_0x3cf160,_0x3087e8){return db[_0x63e1('0x41')]['findOne']({'where':{'id':_0x2fee2c[_0x63e1('0x5b')]['id']}})[_0x63e1('0x20')](handleEntityNotFound(_0x3cf160,null))[_0x63e1('0x20')](function(_0x12c199){if(_0x12c199){return db['sequelize'][_0x63e1('0x7e')](function(_0x1f391c){return db[_0x63e1('0x7f')][_0x63e1('0x38')]({'where':{'FaxAccountId':_0x2fee2c[_0x63e1('0x5b')]['id']},'transaction':_0x1f391c})[_0x63e1('0x20')](function(_0x2471b5){var _0x3a2720=_[_0x63e1('0x40')](_0x2fee2c['body'],function(_0x5f3372){_0x5f3372['FaxAccountId']=_0x2fee2c[_0x63e1('0x5b')]['id'];return _0x5f3372;});return db[_0x63e1('0x7f')][_0x63e1('0x80')](_0x3a2720,{'transaction':_0x1f391c});});})[_0x63e1('0x20')](function(){return db[_0x63e1('0x7f')][_0x63e1('0x81')]({'where':{'FaxAccountId':_0x2fee2c[_0x63e1('0x5b')]['id']},'order':_0x63e1('0x82')});});}})[_0x63e1('0x20')](respondWithResult(_0x3cf160,null))['catch'](handleError(_0x3cf160,null));};exports[_0x63e1('0x83')]=function(_0x3c586b,_0x2b452a,_0x58b7d9){var _0x3a3f95={};var _0x1b2b8c={};var _0x1347f9;var _0x36889f;return db[_0x63e1('0x41')][_0x63e1('0x72')]({'where':{'id':_0x3c586b[_0x63e1('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2b452a,null))[_0x63e1('0x20')](function(_0x2c73fe){if(_0x2c73fe){_0x1347f9=_0x2c73fe;_0x1b2b8c[_0x63e1('0x46')]=_[_0x63e1('0x5c')](db[_0x63e1('0x7f')]['rawAttributes']);_0x1b2b8c['query']=_[_0x63e1('0x5c')](_0x3c586b[_0x63e1('0x47')]);_0x1b2b8c[_0x63e1('0x48')]=_[_0x63e1('0x49')](_0x1b2b8c[_0x63e1('0x46')],_0x1b2b8c[_0x63e1('0x47')]);_0x3a3f95[_0x63e1('0x4b')]=_[_0x63e1('0x49')](_0x1b2b8c[_0x63e1('0x46')],qs[_0x63e1('0x4a')](_0x3c586b[_0x63e1('0x47')]['fields']));_0x3a3f95[_0x63e1('0x4b')]=_0x3a3f95[_0x63e1('0x4b')]['length']?_0x3a3f95['attributes']:_0x1b2b8c[_0x63e1('0x46')];_0x3a3f95[_0x63e1('0x4f')]=qs[_0x63e1('0x50')](_0x3c586b[_0x63e1('0x47')]['sort']);_0x3a3f95['where']=qs[_0x63e1('0x48')](_[_0x63e1('0x52')](_0x3c586b[_0x63e1('0x47')],_0x1b2b8c[_0x63e1('0x48')]));if(_0x3c586b['query'][_0x63e1('0x53')]){_0x3a3f95[_0x63e1('0x51')]=_[_0x63e1('0x55')](_0x3a3f95[_0x63e1('0x51')],{'$or':_[_0x63e1('0x40')](_0x3a3f95[_0x63e1('0x4b')],function(_0x291656){var _0x1284d8={};_0x1284d8[_0x291656]={'$like':'%'+_0x3c586b[_0x63e1('0x47')][_0x63e1('0x53')]+'%'};return _0x1284d8;})});}_0x3a3f95=_[_0x63e1('0x55')]({},_0x3a3f95,_0x3c586b[_0x63e1('0x56')]);return _0x1347f9[_0x63e1('0x83')](_0x3a3f95);}})[_0x63e1('0x20')](function(_0x5b9046){if(_0x5b9046){_0x36889f=_0x5b9046[_0x63e1('0x4c')];if(!_0x3c586b[_0x63e1('0x47')][_0x63e1('0x4d')](_0x63e1('0x4e'))){_0x3a3f95[_0x63e1('0x31')]=qs['limit'](_0x3c586b['query']['limit']);_0x3a3f95[_0x63e1('0x30')]=qs['offset'](_0x3c586b[_0x63e1('0x47')][_0x63e1('0x30')]);}return _0x1347f9[_0x63e1('0x83')](_0x3a3f95);}})[_0x63e1('0x20')](function(_0x287c07){if(_0x287c07){return _0x287c07?{'count':_0x36889f,'rows':_0x287c07}:null;}})[_0x63e1('0x20')](respondWithResult(_0x2b452a,null))[_0x63e1('0x2b')](handleError(_0x2b452a,null));};function Extension(_0x1b4940,_0x3e9ebe,_0xabb149,_0x38df93){this[_0x63e1('0x84')]=_0x63e1('0x85');this[_0x63e1('0x86')]=_0x1b4940[_0x63e1('0x87')];this[_0x63e1('0x88')]=_0x38df93;this['type']=_0x63e1('0x89');this[_0x63e1('0x8a')]=_0x63e1('0x8b');this[_0x63e1('0x70')]=_0x1b4940['id'];this['priority']=_0x3e9ebe;this['appdata']=_0xabb149;}function createExtensionsReciveFax(_0x3a21ac){var _0x22b591=0x1;var _0x1f868a=[];_0x1f868a['push'](new Extension(_0x3a21ac,_0x22b591,'','Answer'));_0x22b591+=0x1;_0x1f868a[_0x63e1('0x8c')](new Extension(_0x3a21ac,_0x22b591,_0x63e1('0x8d'),_0x63e1('0x8e')));_0x22b591+=0x1;for(var _0x1ac7cd in _0x3a21ac){if(_0x3a21ac['hasOwnProperty'](_0x1ac7cd)&&(_0x1ac7cd===_0x63e1('0x8f')||_0x1ac7cd===_0x63e1('0x87')||_0x1ac7cd===_0x63e1('0x90')||_0x1ac7cd==='faxdetect'||_0x1ac7cd===_0x63e1('0x91')||_0x1ac7cd===_0x63e1('0x92')||_0x1ac7cd===_0x63e1('0x93')||_0x1ac7cd==='modem'||_0x1ac7cd==='t38timeout')){_0x1f868a[_0x63e1('0x8c')](new Extension(_0x3a21ac,_0x22b591,_0x63e1('0x94')+_0x1ac7cd+')='+_0x3a21ac[_0x1ac7cd],_0x63e1('0x8e')));_0x22b591+=0x1;}}_0x1f868a[_0x63e1('0x8c')](new Extension(_0x3a21ac,_0x22b591,'6',_0x63e1('0x95')));_0x22b591+=0x1;_0x1f868a['push'](new Extension(_0x3a21ac,_0x22b591,_0x63e1('0x96'),_0x63e1('0x97')));_0x22b591=0x0;return _0x1f868a;}exports[_0x63e1('0x98')]=function(_0x1f1a73,_0xd4c946,_0x39e00e){var _0x4eaf10;return db[_0x63e1('0x99')][_0x63e1('0x7e')](function(_0x23cac1){return db[_0x63e1('0x41')][_0x63e1('0x5f')](_0x1f1a73['body'],{'transaction':_0x23cac1})[_0x63e1('0x20')](function(_0x3244b2){_0x4eaf10=_0x3244b2['get']({'plain':!![]});return db[_0x63e1('0x9a')]['bulkCreate'](createExtensionsReciveFax(_0x4eaf10),{'transaction':_0x23cac1});});})['then'](function(){return _0x4eaf10;})['then'](respondWithResult(_0xd4c946,null))[_0x63e1('0x2b')](handleError(_0xd4c946,null));};exports[_0x63e1('0x9b')]=function(_0x26a33b,_0x359b3c,_0x55e1ec){var _0x4c7836;return db[_0x63e1('0x99')][_0x63e1('0x7e')](function(_0x3349af){return db[_0x63e1('0x41')][_0x63e1('0x68')](_0x26a33b[_0x63e1('0x60')],{'where':{'id':_0x26a33b[_0x63e1('0x60')]['id']},'transaction':_0x3349af})[_0x63e1('0x20')](function(_0x1bb34c){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x26a33b['body']['id']},'transaction':_0x3349af})[_0x63e1('0x20')](function(_0x437fac){return db['VoiceExtension'][_0x63e1('0x80')](createExtensionsReciveFax(_['omit'](_0x26a33b[_0x63e1('0x60')],[_0x63e1('0x9c'),_0x63e1('0x45'),_0x63e1('0x9d'),'updatedAt','TrunkId','ListId'])),{'transaction':_0x3349af});});});})[_0x63e1('0x20')](function(){return db['FaxAccount'][_0x63e1('0x9e')](_0x26a33b[_0x63e1('0x60')]['id']);})[_0x63e1('0x20')](respondWithResult(_0x359b3c,null))[_0x63e1('0x2b')](handleError(_0x359b3c,null));};exports['getMessages']=function(_0x327e70,_0x5b716b,_0x5be2b7){var _0x399d55={'raw':!![],'where':{}};var _0x31405f={};var _0x5659cf={'count':0x0,'rows':[]};return db['FaxAccount'][_0x63e1('0x72')]({'where':{'id':_0x327e70[_0x63e1('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5b716b,null))['then'](function(_0x58d3c3){if(_0x58d3c3){_0x31405f[_0x63e1('0x46')]=_[_0x63e1('0x5c')](db['FaxMessage'][_0x63e1('0x42')]);_0x31405f[_0x63e1('0x47')]=_['keys'](_0x327e70[_0x63e1('0x47')]);_0x31405f[_0x63e1('0x48')]=_[_0x63e1('0x49')](_0x31405f['model'],_0x31405f['query']);_0x399d55[_0x63e1('0x4b')]=_[_0x63e1('0x49')](_0x31405f[_0x63e1('0x46')],qs[_0x63e1('0x4a')](_0x327e70[_0x63e1('0x47')][_0x63e1('0x4a')]));_0x399d55[_0x63e1('0x4b')]=_0x399d55[_0x63e1('0x4b')][_0x63e1('0x4c')]?_0x399d55[_0x63e1('0x4b')]:_0x31405f['model'];if(!_0x327e70['query']['hasOwnProperty'](_0x63e1('0x4e'))){_0x399d55[_0x63e1('0x31')]=qs[_0x63e1('0x31')](_0x327e70[_0x63e1('0x47')][_0x63e1('0x31')]);_0x399d55['offset']=qs[_0x63e1('0x30')](_0x327e70[_0x63e1('0x47')][_0x63e1('0x30')]);}_0x399d55['order']=qs['sort'](_0x327e70['query'][_0x63e1('0x50')]);_0x399d55[_0x63e1('0x51')]=qs[_0x63e1('0x48')](_[_0x63e1('0x52')](_0x327e70['query'],_0x31405f[_0x63e1('0x48')]));_0x399d55[_0x63e1('0x51')][_0x63e1('0x70')]=_0x58d3c3['id'];if(_0x327e70[_0x63e1('0x47')][_0x63e1('0x53')]){_0x399d55[_0x63e1('0x51')]=_[_0x63e1('0x55')](_0x399d55[_0x63e1('0x51')],{'$or':_[_0x63e1('0x40')](_0x399d55[_0x63e1('0x4b')],function(_0x595450){var _0x1ef0ea={};_0x1ef0ea[_0x595450]={'$like':'%'+_0x327e70[_0x63e1('0x47')][_0x63e1('0x53')]+'%'};return _0x1ef0ea;})});}if(_0x327e70[_0x63e1('0x47')][_0x63e1('0x9f')]){var _0x4a0066=_0x327e70[_0x63e1('0x47')][_0x63e1('0x9f')][_0x63e1('0xa0')](',');var _0x4a9bf0={};_0x4a9bf0[_0x4a0066[0x0]]={'$gte':moment(_0x4a0066[0x1])[_0x63e1('0xa1')](_0x63e1('0xa2'))};_0x399d55[_0x63e1('0x51')]=_[_0x63e1('0x55')](_0x399d55[_0x63e1('0x51')],_0x4a9bf0);}_0x399d55=_[_0x63e1('0x55')]({},_0x399d55,_0x327e70[_0x63e1('0x56')]);return db[_0x63e1('0xa3')][_0x63e1('0x33')]({'where':_0x399d55[_0x63e1('0x51')]})[_0x63e1('0x20')](function(_0x15f296){_0x5659cf[_0x63e1('0x33')]=_0x15f296;if(_0x327e70['query'][_0x63e1('0x57')]){_0x399d55['include']=[{'all':!![]}];}return db[_0x63e1('0xa3')][_0x63e1('0x58')](_0x399d55);})[_0x63e1('0x20')](function(_0x387162){_0x5659cf['rows']=_0x387162;return _0x5659cf;});}})[_0x63e1('0x20')](respondWithFilteredResult(_0x5b716b,_0x399d55))[_0x63e1('0x2b')](handleError(_0x5b716b,null));};exports['send']=function(_0x106ed0,_0x3c6a4b,_0x58ff13){var _0x594c38,_0x2ca54e={},_0x25540c;if(_0x106ed0[_0x63e1('0x60')]['to']){_0x25540c=_0x106ed0[_0x63e1('0x60')]['to'][0x0];}return db[_0x63e1('0x41')]['find']({'where':{'id':_0x106ed0[_0x63e1('0x5b')]['id']},'include':[{'model':db[_0x63e1('0xa4')],'as':_0x63e1('0xa5'),'include':[{'model':db['CmContact'],'as':_0x63e1('0xa6'),'where':{'fax':_0x25540c},'limit':0x1,'order':[[_0x63e1('0xa7'),_0x63e1('0xa8')]]}]}]})[_0x63e1('0x20')](handleEntityNotFound(_0x3c6a4b,null))['then'](function(_0x3b9b6e){_0x594c38=_0x3b9b6e;if(_0x106ed0[_0x63e1('0x60')][_0x63e1('0xa9')]&&_0x106ed0[_0x63e1('0x60')][_0x63e1('0xa9')][_0x63e1('0x4c')]){for(var _0xf71c57=0x0;_0xf71c57<_0x106ed0[_0x63e1('0x60')][_0x63e1('0xa9')][_0x63e1('0x4c')];_0xf71c57+=0x1){_0x106ed0[_0x63e1('0x60')][_0x63e1('0xa9')][_0xf71c57]={'filename':_0x106ed0[_0x63e1('0x60')][_0x63e1('0xa9')][_0xf71c57][_0x63e1('0x3c')],'id':_0x106ed0[_0x63e1('0x60')]['attachments'][_0xf71c57]['id'],'path':path['join'](config['root'],_0x63e1('0xaa'),_0x106ed0[_0x63e1('0x60')]['attachments'][_0xf71c57][_0x63e1('0xab')])};}}return respondWithRpcPromise('CheckAfterSend',_0x63e1('0xac'),{'FaxAccountId':_[_0x63e1('0xad')](_0x106ed0[_0x63e1('0x5b')]['id'])?undefined:_0x106ed0[_0x63e1('0x5b')]['id'],'path':_[_0x63e1('0xad')](_0x106ed0['body'][_0x63e1('0xa9')][0x0][_0x63e1('0x6')])?undefined:_0x106ed0['body'][_0x63e1('0xa9')][0x0][_0x63e1('0x6')],'fax':_[_0x63e1('0xad')](_0x106ed0[_0x63e1('0x60')]['to'][0x0])?undefined:_0x106ed0[_0x63e1('0x60')]['to'][0x0]},client9002);})[_0x63e1('0x20')](function(){if(_0x594c38){if(_[_0x63e1('0xad')](_0x106ed0[_0x63e1('0x60')][_0x63e1('0xae')])){_0x106ed0[_0x63e1('0x60')][_0x63e1('0xae')]=util['format']('\x22%s\x22\x20<%s>',_0x594c38[_0x63e1('0x3c')],_0x594c38[_0x63e1('0xaf')]);}if(_0x594c38[_0x63e1('0xa5')]){if(_0x594c38['List'][_0x63e1('0xa6')][_0x63e1('0x4c')]){return _0x594c38[_0x63e1('0xa5')]['Contacts'][0x0];}else{return db[_0x63e1('0x77')]['create'](_[_0x63e1('0x1b')](_0x106ed0[_0x63e1('0x60')],{'firstName':_0x106ed0[_0x63e1('0x60')]['to'][0x0],'phone':_0x106ed0['body']['to'][0x0],'fax':_0x106ed0[_0x63e1('0x60')]['to'][0x0],'ListId':_0x594c38['ListId']}));}}else{throw new Error(_0x63e1('0xb0'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x1f41a5){if(_0x1f41a5){return db[_0x63e1('0x75')][_0x63e1('0x5e')]({'where':{'ContactId':_0x1f41a5['id'],'closed':![],'FaxAccountId':_0x594c38['id']}})['then'](function(_0x1253db){if(_0x1253db){return[_0x1253db,![]];}return db[_0x63e1('0x75')][_0x63e1('0x5f')]({'UserId':_0x106ed0['user']['id'],'ContactId':_0x1f41a5['id'],'FaxAccountId':_0x594c38['id'],'fax':_0x106ed0[_0x63e1('0x60')]['to'][0x0],'firstMsgDirection':_0x63e1('0xb1'),'Messages':[_[_0x63e1('0x55')](_0x106ed0[_0x63e1('0x60')],{'read':![],'body':_0x106ed0[_0x63e1('0x60')][_0x63e1('0xa9')][0x0][_0x63e1('0xb2')],'FaxAccountId':_0x594c38['id'],'UserId':_0x106ed0[_0x63e1('0x61')]['id'],'ContactId':_0x1f41a5['id'],'AttachmentId':_0x106ed0[_0x63e1('0x60')][_0x63e1('0xa9')][0x0]['id']})]},{'include':[{'model':db[_0x63e1('0xa3')],'as':_0x63e1('0xb3')}]})['then'](function(_0x4cdb4e){return[_0x4cdb4e,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x63e1('0xb4')](function(_0x57f6f5,_0x25606c){if(_0x25606c){return _0x57f6f5;}return db[_0x63e1('0xa3')][_0x63e1('0x5f')]({'direction':_0x63e1('0xb1'),'read':![],'body':_0x106ed0[_0x63e1('0x60')]['attachments'][0x0]['filename'],'FaxAccountId':_0x594c38['id'],'FaxInteractionId':_0x57f6f5['id'],'UserId':_0x106ed0[_0x63e1('0x61')]['id'],'ContactId':_0x57f6f5[_0x63e1('0xb5')],'AttachmentId':_0x106ed0['body'][_0x63e1('0xa9')][0x0]['id']})[_0x63e1('0x20')](function(_0x15a956){_0x57f6f5[_0x63e1('0xb6')][_0x63e1('0xb3')]=[];_0x57f6f5['dataValues'][_0x63e1('0xb3')][_0x63e1('0x8c')](_0x15a956['dataValues']);return _0x57f6f5;});})[_0x63e1('0x20')](function(_0x5e8c48){respondWithRpcPromise(_0x63e1('0xb7'),_0x63e1('0xb7'),{'FaxAccountId':_[_0x63e1('0xad')](_0x106ed0[_0x63e1('0x5b')]['id'])?undefined:_0x106ed0[_0x63e1('0x5b')]['id'],'path':_[_0x63e1('0xad')](_0x106ed0['body']['attachments'][0x0][_0x63e1('0x6')])?undefined:_0x106ed0[_0x63e1('0x60')][_0x63e1('0xa9')][0x0][_0x63e1('0x6')],'fax':_[_0x63e1('0xad')](_0x106ed0[_0x63e1('0x60')]['to'][0x0])?undefined:_0x106ed0[_0x63e1('0x60')]['to'][0x0],'AttachmentId':_0x106ed0['body'][_0x63e1('0xa9')][0x0]['id']},client9002)[_0x63e1('0x20')](function(_0xf870b1){logger[_0x63e1('0x21')](_0x63e1('0xb8'),_0xf870b1);})[_0x63e1('0x2b')](function(_0x1d7ddc){logger[_0x63e1('0x21')](_0x63e1('0xb8'),_0x1d7ddc);});return _0x5e8c48;})[_0x63e1('0x20')](respondWithResult(_0x3c6a4b,null))[_0x63e1('0x2b')](handleError(_0x3c6a4b,null));};exports[_0x63e1('0xb9')]=function(_0x160fba,_0x1dea42,_0x1a54c1){return db['FaxAccount'][_0x63e1('0x5e')]({'where':{'id':_0x160fba[_0x63e1('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1dea42,null))[_0x63e1('0x20')](function(_0x37f3d3){if(_0x37f3d3){return _0x37f3d3[_0x63e1('0xb9')](_0x160fba[_0x63e1('0x60')]['ids'],_[_0x63e1('0x76')](_0x160fba[_0x63e1('0x60')],[_0x63e1('0x6e'),'id'])||{})[_0x63e1('0xb4')](function(_0x3d381d){for(var _0x337b56=0x0;_0x337b56<_0x160fba[_0x63e1('0x60')][_0x63e1('0x6e')][_0x63e1('0x4c')];_0x337b56+=0x1){socket[_0x63e1('0xba')](_0x63e1('0xbb'),{'UserId':Number(_0x160fba[_0x63e1('0x60')][_0x63e1('0x6e')][_0x337b56]),'FaxAccountId':Number(_0x160fba[_0x63e1('0x5b')]['id'])});}return _0x3d381d;});}})['then'](respondWithResult(_0x1dea42,null))[_0x63e1('0x2b')](handleError(_0x1dea42,null));};exports[_0x63e1('0xbc')]=function(_0x2d4769,_0x59df05,_0x4c5ab7){return db[_0x63e1('0x41')][_0x63e1('0x5e')]({'where':{'id':_0x2d4769[_0x63e1('0x5b')]['id']}})[_0x63e1('0x20')](handleEntityNotFound(_0x59df05,null))[_0x63e1('0x20')](function(_0x3afdc4){if(_0x3afdc4){return _0x3afdc4[_0x63e1('0xbc')](_0x2d4769[_0x63e1('0x47')]['ids'])[_0x63e1('0x20')](function(){if(_[_0x63e1('0xbd')](_0x2d4769[_0x63e1('0x47')]['ids'])){for(var _0x206611=0x0;_0x206611<_0x2d4769['query'][_0x63e1('0x6e')]['length'];_0x206611+=0x1){socket[_0x63e1('0xba')](_0x63e1('0xbe'),{'UserId':Number(_0x2d4769[_0x63e1('0x47')][_0x63e1('0x6e')][_0x206611]),'FaxAccountId':Number(_0x2d4769[_0x63e1('0x5b')]['id'])});}}else{socket[_0x63e1('0xba')](_0x63e1('0xbe'),{'UserId':Number(_0x2d4769[_0x63e1('0x47')]['ids']),'FaxAccountId':Number(_0x2d4769[_0x63e1('0x5b')]['id'])});}});}})[_0x63e1('0x20')](respondWithStatusCode(_0x59df05,null))[_0x63e1('0x2b')](handleError(_0x59df05,null));};exports[_0x63e1('0xbf')]=function(_0x1b35f6,_0x577eff,_0x2832af){var _0x9676c1={};var _0x328aa0={};var _0x42bb7e;var _0x1772ae;return db['FaxAccount'][_0x63e1('0x72')]({'where':{'id':_0x1b35f6[_0x63e1('0x5b')]['id']}})['then'](handleEntityNotFound(_0x577eff,null))[_0x63e1('0x20')](function(_0x5028ad){if(_0x5028ad){_0x42bb7e=_0x5028ad;_0x328aa0[_0x63e1('0x46')]=_[_0x63e1('0x5c')](db[_0x63e1('0x78')][_0x63e1('0x42')]);_0x328aa0['query']=_[_0x63e1('0x5c')](_0x1b35f6[_0x63e1('0x47')]);_0x328aa0['filters']=_['intersection'](_0x328aa0[_0x63e1('0x46')],_0x328aa0[_0x63e1('0x47')]);_0x9676c1[_0x63e1('0x4b')]=_[_0x63e1('0x49')](_0x328aa0[_0x63e1('0x46')],qs[_0x63e1('0x4a')](_0x1b35f6[_0x63e1('0x47')]['fields']));_0x9676c1['attributes']=_0x9676c1[_0x63e1('0x4b')][_0x63e1('0x4c')]?_0x9676c1[_0x63e1('0x4b')]:_0x328aa0[_0x63e1('0x46')];_0x9676c1['order']=qs[_0x63e1('0x50')](_0x1b35f6[_0x63e1('0x47')][_0x63e1('0x50')]);_0x9676c1[_0x63e1('0x51')]=qs[_0x63e1('0x48')](_['pick'](_0x1b35f6[_0x63e1('0x47')],_0x328aa0[_0x63e1('0x48')]));if(_0x1b35f6[_0x63e1('0x47')][_0x63e1('0x53')]){_0x9676c1['where']=_['merge'](_0x9676c1[_0x63e1('0x51')],{'$or':_[_0x63e1('0x40')](_0x9676c1[_0x63e1('0x4b')],function(_0x2b40eb){var _0x19a014={};_0x19a014[_0x2b40eb]={'$like':'%'+_0x1b35f6[_0x63e1('0x47')]['filter']+'%'};return _0x19a014;})});}_0x9676c1=_[_0x63e1('0x55')]({},_0x9676c1,_0x1b35f6[_0x63e1('0x56')]);return _0x42bb7e[_0x63e1('0xbf')](_0x9676c1);}})[_0x63e1('0x20')](function(_0x1111ca){if(_0x1111ca){_0x1772ae=_0x1111ca['length'];if(!_0x1b35f6[_0x63e1('0x47')]['hasOwnProperty'](_0x63e1('0x4e'))){_0x9676c1[_0x63e1('0x31')]=qs[_0x63e1('0x31')](_0x1b35f6[_0x63e1('0x47')]['limit']);_0x9676c1['offset']=qs[_0x63e1('0x30')](_0x1b35f6['query'][_0x63e1('0x30')]);}return _0x42bb7e['getAgents'](_0x9676c1);}})['then'](function(_0x587086){if(_0x587086){return _0x587086?{'count':_0x1772ae,'rows':_0x587086}:null;}})[_0x63e1('0x20')](respondWithResult(_0x577eff,null))[_0x63e1('0x2b')](handleError(_0x577eff,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index cbb47b0..5738057 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 _0x1d10=['../../mysqldb','FaxAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1d10,0x1dc));var _0x01d1=function(_0x345ec6,_0x5c621b){_0x345ec6=_0x345ec6-0x0;var _0x346469=_0x1d10[_0x345ec6];return _0x346469;};'use strict';var EventEmitter=require(_0x01d1('0x0'));var FaxAccount=require(_0x01d1('0x1'))['db'][_0x01d1('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x01d1('0x3')](0x0);var events={'afterCreate':_0x01d1('0x4'),'afterUpdate':_0x01d1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5adbc8){return function(_0x2b69fc,_0xc87eda,_0xe5b34){FaxAccountEvents['emit'](_0x5adbc8+':'+_0x2b69fc['id'],_0x2b69fc);FaxAccountEvents[_0x01d1('0x6')](_0x5adbc8,_0x2b69fc);_0xe5b34(null);};}for(var e in events){if(events[_0x01d1('0x7')](e)){var event=events[e];FaxAccount[_0x01d1('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0xcd03=['hook','exports','events','FaxAccount','save','update','remove','emit','hasOwnProperty'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xcd03,0x14f));var _0x3cd0=function(_0x4313af,_0x2e1e1e){_0x4313af=_0x4313af-0x0;var _0x2f31c3=_0xcd03[_0x4313af];return _0x2f31c3;};'use strict';var EventEmitter=require(_0x3cd0('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x3cd0('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3cd0('0x2'),'afterUpdate':_0x3cd0('0x3'),'afterDestroy':_0x3cd0('0x4')};function emitEvent(_0x943d62){return function(_0x10841e,_0x4fdf59,_0x2ef9a3){FaxAccountEvents[_0x3cd0('0x5')](_0x943d62+':'+_0x10841e['id'],_0x10841e);FaxAccountEvents[_0x3cd0('0x5')](_0x943d62,_0x10841e);_0x2ef9a3(null);};}for(var e in events){if(events[_0x3cd0('0x6')](e)){var event=events[e];FaxAccount[_0x3cd0('0x7')](e,emitEvent(event));}}module[_0x3cd0('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 3b34788..d6c1523 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 _0xbd2d=['bluebird','request-promise','../../config/environment','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xbd2d,0xec));var _0xdbd2=function(_0x47ce62,_0x4b5c0f){_0x47ce62=_0x47ce62-0x0;var _0x56fae5=_0xbd2d[_0x47ce62];return _0x56fae5;};'use strict';var _=require(_0xdbd2('0x0'));var util=require(_0xdbd2('0x1'));var logger=require(_0xdbd2('0x2'))(_0xdbd2('0x3'));var moment=require('moment');var BPromise=require(_0xdbd2('0x4'));var rp=require(_0xdbd2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdbd2('0x6'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x3263ca,_0x4f4342){return _0x3263ca[_0xdbd2('0x7')](_0xdbd2('0x8'),attributes,{'tableName':_0xdbd2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b40=['./faxAccount.attributes','exports','FaxAccount','fax_accounts','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3c9c2e,_0x1e7d40){var _0x269196=function(_0x1cb3c7){while(--_0x1cb3c7){_0x3c9c2e['push'](_0x3c9c2e['shift']());}};_0x269196(++_0x1e7d40);}(_0x5b40,0xca));var _0x05b4=function(_0x502b8b,_0xfd3c6b){_0x502b8b=_0x502b8b-0x0;var _0x234379=_0x5b40[_0x502b8b];return _0x234379;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x05b4('0x0'))(_0x05b4('0x1'));var moment=require(_0x05b4('0x2'));var BPromise=require(_0x05b4('0x3'));var rp=require(_0x05b4('0x4'));var fs=require('fs');var path=require(_0x05b4('0x5'));var rimraf=require('rimraf');var config=require(_0x05b4('0x6'));var attributes=require(_0x05b4('0x7'));module[_0x05b4('0x8')]=function(_0x19d946,_0x375774){return _0x19d946['define'](_0x05b4('0x9'),attributes,{'tableName':_0x05b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 1af69e5..adb3979 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 _0x71d7=['*,*,*,*','created','FaxMessage','AttachmentId','UserId','User','name','interaction','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetFaxAccount','FaxAccount','options','raw','attributes','limit','include','model','map','NotifyFaxAccount','body','fax','describe','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','keys','CompanyId','isNil','from','from\x20is\x20mandatory','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','CmContact','DESC','FaxApplication','Applications','List','applications','asc','Contacts','length','ListId','contact','FaxInteraction','create','spread','get','autoclose','push','close','unmanaged'];(function(_0x3f9584,_0x5ab12c){var _0x9d54c=function(_0x2882df){while(--_0x2882df){_0x3f9584['push'](_0x3f9584['shift']());}};_0x9d54c(++_0x5ab12c);}(_0x71d7,0xc0));var _0x771d=function(_0x339bab,_0x2fa020){_0x339bab=_0x339bab-0x0;var _0x3f95ba=_0x71d7[_0x339bab];return _0x3f95ba;};'use strict';var _=require('lodash');var util=require(_0x771d('0x0'));var moment=require(_0x771d('0x1'));var BPromise=require(_0x771d('0x2'));var rs=require(_0x771d('0x3'));var fs=require('fs');var Redis=require(_0x771d('0x4'));var db=require(_0x771d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x771d('0x6'))(_0x771d('0x7'));var config=require(_0x771d('0x8'));var jayson=require(_0x771d('0x9'));var client=jayson[_0x771d('0xa')]['http']({'port':0x232c});config['redis']=_[_0x771d('0xb')](config['redis'],{'host':_0x771d('0xc'),'port':0x18eb});var socket=require(_0x771d('0xd'))(new Redis(config[_0x771d('0xe')]));require(_0x771d('0xf'))[_0x771d('0x10')](socket);function respondWithRpcPromise(_0x598682,_0x3ab36d,_0x201de1){return new BPromise(function(_0x2406b7,_0xb1055c){return client[_0x771d('0x11')](_0x598682,_0x201de1)[_0x771d('0x12')](function(_0x1e13fb){logger[_0x771d('0x13')](_0x771d('0x14'),_0x3ab36d,_0x771d('0x15'));logger[_0x771d('0x16')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3ab36d,_0x771d('0x15'),JSON[_0x771d('0x17')](_0x1e13fb));if(_0x1e13fb[_0x771d('0x18')]){if(_0x1e13fb[_0x771d('0x18')]['code']===0x1f4){logger[_0x771d('0x18')](_0x771d('0x14'),_0x3ab36d,_0x1e13fb['error'][_0x771d('0x19')]);return _0xb1055c(_0x1e13fb[_0x771d('0x18')]['message']);}logger['error'](_0x771d('0x14'),_0x3ab36d,_0x1e13fb[_0x771d('0x18')]['message']);return _0x2406b7(_0x1e13fb['error'][_0x771d('0x19')]);}else{logger[_0x771d('0x13')](_0x771d('0x14'),_0x3ab36d,_0x771d('0x15'));_0x2406b7(_0x1e13fb[_0x771d('0x1a')][_0x771d('0x19')]);}})[_0x771d('0x1b')](function(_0xcad22c){logger[_0x771d('0x18')](_0x771d('0x14'),_0x3ab36d,_0xcad22c);_0xb1055c(_0xcad22c);});});}exports[_0x771d('0x1c')]=function(_0x4f910d){var _0xbffc71=this;return new Promise(function(_0x1def72,_0x4112f5){return db[_0x771d('0x1d')]['findAll']({'raw':_0x4f910d[_0x771d('0x1e')]?_0x4f910d['options'][_0x771d('0x1f')]===undefined?!![]:![]:!![],'where':_0x4f910d['options']?_0x4f910d[_0x771d('0x1e')]['where']||null:null,'attributes':_0x4f910d[_0x771d('0x1e')]?_0x4f910d[_0x771d('0x1e')][_0x771d('0x20')]||null:null,'limit':_0x4f910d['options']?_0x4f910d[_0x771d('0x1e')][_0x771d('0x21')]||null:null,'include':_0x4f910d[_0x771d('0x1e')]?_0x4f910d[_0x771d('0x1e')]['include']?_['map'](_0x4f910d['options'][_0x771d('0x22')],function(_0x4b545d){return{'model':db[_0x4b545d[_0x771d('0x23')]],'as':_0x4b545d['as'],'attributes':_0x4b545d[_0x771d('0x20')],'include':_0x4b545d[_0x771d('0x22')]?_[_0x771d('0x24')](_0x4b545d[_0x771d('0x22')],function(_0x30a7ac){return{'model':db[_0x30a7ac[_0x771d('0x23')]],'as':_0x30a7ac['as'],'attributes':_0x30a7ac[_0x771d('0x20')],'include':_0x30a7ac['include']?_[_0x771d('0x24')](_0x30a7ac[_0x771d('0x22')],function(_0x5df099){return{'model':db[_0x5df099[_0x771d('0x23')]],'as':_0x5df099['as'],'attributes':_0x5df099['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5964b0){logger[_0x771d('0x13')](_0x771d('0x1c'),_0x4f910d);logger[_0x771d('0x16')](_0x771d('0x1c'),_0x4f910d,JSON[_0x771d('0x17')](_0x5964b0));_0x1def72(_0x5964b0);})[_0x771d('0x1b')](function(_0x1026f8){logger[_0x771d('0x18')](_0x771d('0x1c'),_0x1026f8[_0x771d('0x19')],_0x4f910d);_0x4112f5(_0xbffc71[_0x771d('0x18')](0x1f4,_0x1026f8['message']));});});};exports[_0x771d('0x25')]=function(_0x32046f,_0x1686e6,_0x276752){var _0x258899=this;return new Promise(function(_0x1a04f4,_0x46fb2a){var _0x53b7f0={'body':_0x32046f[_0x771d('0x26')],'channel':_0x771d('0x27')};var _0x30e697=[];var _0x5d5a3d=[];var _0x394ef7={};return db['CmContact'][_0x771d('0x28')]()[_0x771d('0x12')](function(_0x54a2bf){if(!_0x54a2bf){throw new db['Sequelize'][(_0x771d('0x29'))](_0x771d('0x2a'));}_0x30e697=_[_0x771d('0x2b')](_['keys'](_0x54a2bf),[_0x771d('0x2c'),_0x771d('0x2d')]);_0x5d5a3d=_[_0x771d('0x2b')](_[_0x771d('0x2e')](_0x54a2bf),[_0x771d('0x2c'),_0x771d('0x2d'),_0x771d('0x2f'),'ListId']);if(_0x32046f[_0x771d('0x26')]['id']){delete _0x32046f['body']['id'];}if(_[_0x771d('0x30')](_0x32046f[_0x771d('0x26')][_0x771d('0x31')])){throw new db['Sequelize'][(_0x771d('0x29'))](_0x771d('0x32'));}if(_[_0x771d('0x30')](_0x32046f[_0x771d('0x26')][_0x771d('0x26')])||_0x32046f[_0x771d('0x26')]['body']===''){throw new db[(_0x771d('0x33'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x771d('0x30')](_0x32046f[_0x771d('0x26')][_0x771d('0x34')])){throw new db[(_0x771d('0x33'))][(_0x771d('0x29'))](_0x771d('0x35')+_0x5d5a3d);}if(!_[_0x771d('0x36')](_0x5d5a3d,_0x32046f[_0x771d('0x26')]['mapKey'])){throw new db[(_0x771d('0x33'))][(_0x771d('0x29'))](_0x771d('0x37')+_0x5d5a3d);}_0x394ef7[_0x32046f[_0x771d('0x26')]['mapKey']]=_0x32046f[_0x771d('0x26')]['from'];})[_0x771d('0x12')](function(){return db['FaxAccount'][_0x771d('0x38')]({'where':{'id':_0x32046f[_0x771d('0x39')]['id']},'include':[{'model':db[_0x771d('0x3a')],'as':'List','include':[{'model':db[_0x771d('0x3b')],'as':'Contacts','where':_0x394ef7,'limit':0x1,'order':[[_0x771d('0x2d'),_0x771d('0x3c')]]}]},{'model':db[_0x771d('0x3d')],'as':_0x771d('0x3e')}]});})[_0x771d('0x12')](function(_0xc91b08){if(_0xc91b08&&_0xc91b08[_0x771d('0x3f')]){var _0x630fbe=_0xc91b08['get']({'plain':!![]});_0x53b7f0[_0x771d('0x39')]=_0x630fbe;_0x53b7f0[_0x771d('0x40')]=_0x630fbe[_0x771d('0x3e')];_0x53b7f0['list']=_0x630fbe[_0x771d('0x3f')];_0x53b7f0[_0x771d('0x40')]=_['orderBy'](_0x53b7f0['applications'],['priority'],[_0x771d('0x41')]);if(_0x53b7f0['account'][_0x771d('0x3e')]){delete _0x53b7f0[_0x771d('0x39')][_0x771d('0x3e')];}if(_0x53b7f0[_0x771d('0x39')]['List']&&_0x53b7f0['account']['List'][_0x771d('0x42')][_0x771d('0x43')]){return _0x53b7f0[_0x771d('0x39')][_0x771d('0x3f')][_0x771d('0x42')][0x0];}var _0x3e9798=_['defaults'](_0x32046f['body'],{'firstName':_0x32046f['body'][_0x771d('0x31')],'ListId':_0x630fbe[_0x771d('0x44')]});_0x3e9798[_0x32046f[_0x771d('0x26')]['mapKey']]=_0x32046f[_0x771d('0x26')][_0x771d('0x31')];return db[_0x771d('0x3b')]['create'](_0x3e9798,{'fields':_0x30e697,'raw':!![]});}})[_0x771d('0x12')](function(_0x17d8ed){_0x53b7f0[_0x771d('0x45')]=_0x17d8ed;if(_0x17d8ed){var _0x3bd14f={'ContactId':_0x17d8ed['id'],'FaxAccountId':_0x32046f[_0x771d('0x39')]['id'],'fax':_0x17d8ed[_0x771d('0x27')]};return db[_0x771d('0x46')]['find']({'where':{'ContactId':_0x17d8ed['id'],'closed':![],'FaxAccountId':_0x32046f[_0x771d('0x39')]['id']}})[_0x771d('0x12')](function(_0x4c6895){if(_0x4c6895){return[_0x4c6895,![]];}return db[_0x771d('0x46')][_0x771d('0x47')](_0x3bd14f)[_0x771d('0x12')](function(_0x418661){return[_0x418661,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x771d('0x48')](function(_0x2b7fe4,_0x2cc943){var _0x21245a=_0x2b7fe4[_0x771d('0x49')]({'plain':!![]});if(_0x2cc943){if(_0x53b7f0[_0x771d('0x39')][_0x771d('0x4a')]){_0x53b7f0[_0x771d('0x40')][_0x771d('0x4b')]({'id':0x0,'priority':_0x53b7f0[_0x771d('0x40')][_0x771d('0x43')]+0x1,'app':_0x771d('0x4c'),'appdata':_0x771d('0x4d'),'interval':_0x771d('0x4e')});}_0x21245a[_0x771d('0x4f')]=!![];}else{_0x21245a['created']=![];}_0x53b7f0['interaction']=_0x21245a;return db[_0x771d('0x50')][_0x771d('0x47')]({'body':_0x32046f['body'][_0x771d('0x26')],'FaxAccountId':_0x32046f[_0x771d('0x39')]['id'],'FaxInteractionId':_0x2b7fe4['id'],'direction':'in','ContactId':_0x2b7fe4['ContactId'],'AttachmentId':_0x32046f[_0x771d('0x26')][_0x771d('0x51')]});})[_0x771d('0x12')](function(_0x5e87f7){_0x53b7f0['message']=_0x5e87f7;if(_0x53b7f0['interaction'][_0x771d('0x52')]){return db[_0x771d('0x53')]['find']({'attributes':['id',_0x771d('0x54')],'where':{'id':_0x53b7f0[_0x771d('0x55')]['UserId']}})[_0x771d('0x12')](function(_0x13fcc0){if(_0x13fcc0){_0x53b7f0[_0x771d('0x40')]['unshift']({'id':0x0,'priority':0x0,'app':_0x771d('0x56'),'appdata':_0x13fcc0[_0x771d('0x54')]+','+(_0x53b7f0[_0x771d('0x39')][_0x771d('0x57')]||0xa),'interval':_0x771d('0x4e')});}return respondWithRpcPromise(_0x771d('0x58'),_0x771d('0x59'),_0x53b7f0);});}return respondWithRpcPromise('Start',_0x771d('0x59'),_0x53b7f0);})['then'](function(_0x25539d){_0x1a04f4(_0x25539d);})[_0x771d('0x1b')](function(_0x188ac3){_0x46fb2a(_0x258899[_0x771d('0x18')](0x1f4,_0x188ac3['message']));});});}; \ No newline at end of file +var _0x1020=['localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','include','model','map','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','asc','length','CmContact','create','contact','FaxInteraction','Contact\x20not\x20found','spread','push','close','unmanaged','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults'];(function(_0x3e9da2,_0x371e32){var _0x1081bb=function(_0x1024c0){while(--_0x1024c0){_0x3e9da2['push'](_0x3e9da2['shift']());}};_0x1081bb(++_0x371e32);}(_0x1020,0x1c1));var _0x0102=function(_0x336ca2,_0x1a813a){_0x336ca2=_0x336ca2-0x0;var _0xda59a6=_0x1020[_0x336ca2];return _0xda59a6;};'use strict';var _=require(_0x0102('0x0'));var util=require('util');var moment=require(_0x0102('0x1'));var BPromise=require('bluebird');var rs=require(_0x0102('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0102('0x3'))['db'];var utils=require(_0x0102('0x4'));var logger=require(_0x0102('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0102('0x6'));var client=jayson[_0x0102('0x7')][_0x0102('0x8')]({'port':0x232c});config[_0x0102('0x9')]=_[_0x0102('0xa')](config[_0x0102('0x9')],{'host':_0x0102('0xb'),'port':0x18eb});var socket=require(_0x0102('0xc'))(new Redis(config[_0x0102('0x9')]));require(_0x0102('0xd'))[_0x0102('0xe')](socket);function respondWithRpcPromise(_0x1483ca,_0x35261f,_0x5c9118){return new BPromise(function(_0x3016bf,_0x4af40a){return client[_0x0102('0xf')](_0x1483ca,_0x5c9118)[_0x0102('0x10')](function(_0x37b870){logger[_0x0102('0x11')](_0x0102('0x12'),_0x35261f,'request\x20sent');logger[_0x0102('0x13')](_0x0102('0x14'),_0x35261f,_0x0102('0x15'),JSON[_0x0102('0x16')](_0x37b870));if(_0x37b870[_0x0102('0x17')]){if(_0x37b870[_0x0102('0x17')]['code']===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x35261f,_0x37b870['error'][_0x0102('0x18')]);return _0x4af40a(_0x37b870['error'][_0x0102('0x18')]);}logger[_0x0102('0x17')](_0x0102('0x12'),_0x35261f,_0x37b870['error'][_0x0102('0x18')]);return _0x3016bf(_0x37b870['error']['message']);}else{logger[_0x0102('0x11')](_0x0102('0x12'),_0x35261f,_0x0102('0x15'));_0x3016bf(_0x37b870[_0x0102('0x19')][_0x0102('0x18')]);}})[_0x0102('0x1a')](function(_0x262978){logger[_0x0102('0x17')]('FaxAccount,\x20%s,\x20%s',_0x35261f,_0x262978);_0x4af40a(_0x262978);});});}exports[_0x0102('0x1b')]=function(_0x4e0e00){var _0x2aec2f=this;return new Promise(function(_0x12fea5,_0x19e9c3){return db[_0x0102('0x1c')][_0x0102('0x1d')]({'raw':_0x4e0e00[_0x0102('0x1e')]?_0x4e0e00[_0x0102('0x1e')][_0x0102('0x1f')]===undefined?!![]:![]:!![],'where':_0x4e0e00[_0x0102('0x1e')]?_0x4e0e00[_0x0102('0x1e')][_0x0102('0x20')]||null:null,'attributes':_0x4e0e00[_0x0102('0x1e')]?_0x4e0e00[_0x0102('0x1e')][_0x0102('0x21')]||null:null,'limit':_0x4e0e00[_0x0102('0x1e')]?_0x4e0e00[_0x0102('0x1e')]['limit']||null:null,'include':_0x4e0e00[_0x0102('0x1e')]?_0x4e0e00[_0x0102('0x1e')][_0x0102('0x22')]?_['map'](_0x4e0e00[_0x0102('0x1e')]['include'],function(_0x40026c){return{'model':db[_0x40026c[_0x0102('0x23')]],'as':_0x40026c['as'],'attributes':_0x40026c['attributes'],'include':_0x40026c[_0x0102('0x22')]?_[_0x0102('0x24')](_0x40026c['include'],function(_0x329fea){return{'model':db[_0x329fea[_0x0102('0x23')]],'as':_0x329fea['as'],'attributes':_0x329fea[_0x0102('0x21')],'include':_0x329fea[_0x0102('0x22')]?_[_0x0102('0x24')](_0x329fea[_0x0102('0x22')],function(_0x5710eb){return{'model':db[_0x5710eb[_0x0102('0x23')]],'as':_0x5710eb['as'],'attributes':_0x5710eb['attributes']};}):[]};}):[]};}):[]:[]})[_0x0102('0x10')](function(_0x270456){logger[_0x0102('0x11')](_0x0102('0x1b'),_0x4e0e00);logger[_0x0102('0x13')](_0x0102('0x1b'),_0x4e0e00,JSON['stringify'](_0x270456));_0x12fea5(_0x270456);})[_0x0102('0x1a')](function(_0x5ad28f){logger['error'](_0x0102('0x1b'),_0x5ad28f[_0x0102('0x18')],_0x4e0e00);_0x19e9c3(_0x2aec2f[_0x0102('0x17')](0x1f4,_0x5ad28f[_0x0102('0x18')]));});});};exports['NotifyFaxAccount']=function(_0x50a150,_0x312480,_0x57555c){var _0x261962=this;return new Promise(function(_0x1ee6ee,_0x288f1d){var _0x59e536={'body':_0x50a150[_0x0102('0x25')],'channel':_0x0102('0x26')};var _0x5afa55=[];var _0x3b4f7e=[];var _0x5c69d0={};return db['CmContact'][_0x0102('0x27')]()[_0x0102('0x10')](function(_0x32d318){if(!_0x32d318){throw new db[(_0x0102('0x28'))][(_0x0102('0x29'))](_0x0102('0x2a'));}_0x5afa55=_[_0x0102('0x2b')](_[_0x0102('0x2c')](_0x32d318),[_0x0102('0x2d'),_0x0102('0x2e')]);_0x3b4f7e=_['difference'](_['keys'](_0x32d318),[_0x0102('0x2d'),_0x0102('0x2e'),_0x0102('0x2f'),_0x0102('0x30')]);if(_0x50a150[_0x0102('0x25')]['id']){delete _0x50a150['body']['id'];}if(_[_0x0102('0x31')](_0x50a150['body']['from'])){throw new db[(_0x0102('0x28'))][(_0x0102('0x29'))](_0x0102('0x32'));}if(_[_0x0102('0x31')](_0x50a150[_0x0102('0x25')][_0x0102('0x25')])||_0x50a150[_0x0102('0x25')]['body']===''){throw new db[(_0x0102('0x28'))][(_0x0102('0x29'))](_0x0102('0x33'));}if(_[_0x0102('0x31')](_0x50a150[_0x0102('0x25')][_0x0102('0x34')])){throw new db['Sequelize']['ValidationError'](_0x0102('0x35')+_0x3b4f7e);}if(!_[_0x0102('0x36')](_0x3b4f7e,_0x50a150[_0x0102('0x25')][_0x0102('0x34')])){throw new db[(_0x0102('0x28'))][(_0x0102('0x29'))](_0x0102('0x37')+_0x3b4f7e);}_0x5c69d0[_0x50a150[_0x0102('0x25')][_0x0102('0x34')]]=_0x50a150[_0x0102('0x25')][_0x0102('0x38')];})[_0x0102('0x10')](function(){return db[_0x0102('0x1c')][_0x0102('0x39')]({'where':{'id':_0x50a150[_0x0102('0x3a')]['id']},'include':[{'model':db[_0x0102('0x3b')],'as':_0x0102('0x3c'),'include':[{'model':db['CmContact'],'as':_0x0102('0x3d'),'where':_0x5c69d0,'limit':0x1,'order':[['updatedAt',_0x0102('0x3e')]]}]},{'model':db[_0x0102('0x3f')],'as':_0x0102('0x40')}]});})['then'](function(_0x221765){if(_0x221765&&_0x221765[_0x0102('0x3c')]){var _0x573509=_0x221765[_0x0102('0x41')]({'plain':!![]});_0x59e536[_0x0102('0x3a')]=_0x573509;_0x59e536[_0x0102('0x42')]=_0x573509[_0x0102('0x40')];_0x59e536[_0x0102('0x43')]=_0x573509[_0x0102('0x3c')];_0x59e536[_0x0102('0x42')]=_[_0x0102('0x44')](_0x59e536[_0x0102('0x42')],['priority'],[_0x0102('0x45')]);if(_0x59e536[_0x0102('0x3a')][_0x0102('0x40')]){delete _0x59e536[_0x0102('0x3a')][_0x0102('0x40')];}if(_0x59e536[_0x0102('0x3a')][_0x0102('0x3c')]&&_0x59e536[_0x0102('0x3a')][_0x0102('0x3c')][_0x0102('0x3d')][_0x0102('0x46')]){return _0x59e536[_0x0102('0x3a')][_0x0102('0x3c')]['Contacts'][0x0];}var _0xd850e1=_[_0x0102('0xa')](_0x50a150[_0x0102('0x25')],{'firstName':_0x50a150[_0x0102('0x25')]['from'],'ListId':_0x573509[_0x0102('0x30')]});_0xd850e1[_0x50a150[_0x0102('0x25')][_0x0102('0x34')]]=_0x50a150[_0x0102('0x25')][_0x0102('0x38')];return db[_0x0102('0x47')][_0x0102('0x48')](_0xd850e1,{'fields':_0x5afa55,'raw':!![]});}})[_0x0102('0x10')](function(_0x2641df){_0x59e536[_0x0102('0x49')]=_0x2641df;if(_0x2641df){var _0x3d98db={'ContactId':_0x2641df['id'],'FaxAccountId':_0x50a150[_0x0102('0x3a')]['id'],'fax':_0x2641df['fax']};return db['FaxInteraction'][_0x0102('0x39')]({'where':{'ContactId':_0x2641df['id'],'closed':![],'FaxAccountId':_0x50a150[_0x0102('0x3a')]['id']}})[_0x0102('0x10')](function(_0x1ef91b){if(_0x1ef91b){return[_0x1ef91b,![]];}return db[_0x0102('0x4a')][_0x0102('0x48')](_0x3d98db)['then'](function(_0x15908a){return[_0x15908a,!![]];});});}else{throw new Error(_0x0102('0x4b'));}})[_0x0102('0x4c')](function(_0xfa8a81,_0xd11c22){var _0x51ad65=_0xfa8a81[_0x0102('0x41')]({'plain':!![]});if(_0xd11c22){if(_0x59e536[_0x0102('0x3a')]['autoclose']){_0x59e536[_0x0102('0x42')][_0x0102('0x4d')]({'id':0x0,'priority':_0x59e536[_0x0102('0x42')]['length']+0x1,'app':_0x0102('0x4e'),'appdata':_0x0102('0x4f'),'interval':'*,*,*,*'});}_0x51ad65[_0x0102('0x50')]=!![];}else{_0x51ad65[_0x0102('0x50')]=![];}_0x59e536[_0x0102('0x51')]=_0x51ad65;return db[_0x0102('0x52')][_0x0102('0x48')]({'body':_0x50a150[_0x0102('0x25')][_0x0102('0x25')],'FaxAccountId':_0x50a150['account']['id'],'FaxInteractionId':_0xfa8a81['id'],'direction':'in','ContactId':_0xfa8a81[_0x0102('0x53')],'AttachmentId':_0x50a150['body'][_0x0102('0x54')]});})[_0x0102('0x10')](function(_0x47d633){_0x59e536['message']=_0x47d633;if(_0x59e536[_0x0102('0x51')][_0x0102('0x55')]){return db['User']['find']({'attributes':['id',_0x0102('0x56')],'where':{'id':_0x59e536[_0x0102('0x51')][_0x0102('0x55')]}})[_0x0102('0x10')](function(_0x5a2e4e){if(_0x5a2e4e){_0x59e536[_0x0102('0x42')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0102('0x57'),'appdata':_0x5a2e4e[_0x0102('0x56')]+','+(_0x59e536[_0x0102('0x3a')][_0x0102('0x58')]||0xa),'interval':_0x0102('0x59')});}return respondWithRpcPromise(_0x0102('0x5a'),_0x0102('0x5b'),_0x59e536);});}return respondWithRpcPromise(_0x0102('0x5a'),_0x0102('0x5b'),_0x59e536);})[_0x0102('0x10')](function(_0x548cb2){_0x1ee6ee(_0x548cb2);})[_0x0102('0x1a')](function(_0x5619a5){_0x288f1d(_0x261962[_0x0102('0x17')](0x1f4,_0x5619a5[_0x0102('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index ba27ba5..717883d 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 _0x5ffb=['removeListener','length','faxAccount:','./faxAccount.events','save','update','emit'];(function(_0x11458d,_0x92a94){var _0x484150=function(_0x3fb1c4){while(--_0x3fb1c4){_0x11458d['push'](_0x11458d['shift']());}};_0x484150(++_0x92a94);}(_0x5ffb,0xab));var _0xb5ff=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5ffb[_0x321bb2];return _0x9c12ed;};'use strict';var FaxAccountEvents=require(_0xb5ff('0x0'));var events=[_0xb5ff('0x1'),'remove',_0xb5ff('0x2')];function createListener(_0x528bc2,_0x33b3f6){return function(_0x177fbc){_0x33b3f6[_0xb5ff('0x3')](_0x528bc2,_0x177fbc);};}function removeListener(_0x2223d2,_0x53f06d){return function(){FaxAccountEvents[_0xb5ff('0x4')](_0x2223d2,_0x53f06d);};}exports['register']=function(_0x4779d1){for(var _0x517fdc=0x0,_0x2f62e3=events[_0xb5ff('0x5')];_0x517fdc<_0x2f62e3;_0x517fdc++){var _0x85dd15=events[_0x517fdc];var _0x2130f2=createListener(_0xb5ff('0x6')+_0x85dd15,_0x4779d1);FaxAccountEvents['on'](_0x85dd15,_0x2130f2);}}; \ No newline at end of file +var _0x0ffb=['register','faxAccount:','./faxAccount.events','remove','update','removeListener'];(function(_0x45b8ca,_0x361efb){var _0x589fb8=function(_0x204979){while(--_0x204979){_0x45b8ca['push'](_0x45b8ca['shift']());}};_0x589fb8(++_0x361efb);}(_0x0ffb,0xce));var _0xb0ff=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0ffb[_0xa464c9];return _0x3d73c4;};'use strict';var FaxAccountEvents=require(_0xb0ff('0x0'));var events=['save',_0xb0ff('0x1'),_0xb0ff('0x2')];function createListener(_0x3cd7ac,_0x5cd1eb){return function(_0xfd26fd){_0x5cd1eb['emit'](_0x3cd7ac,_0xfd26fd);};}function removeListener(_0x3c6347,_0x54eb38){return function(){FaxAccountEvents[_0xb0ff('0x3')](_0x3c6347,_0x54eb38);};}exports[_0xb0ff('0x4')]=function(_0x2f9307){for(var _0x2bcde9=0x0,_0x535169=events['length'];_0x2bcde9<_0x535169;_0x2bcde9++){var _0x16e876=events[_0x2bcde9];var _0x138a37=createListener(_0xb0ff('0x5')+_0x16e876,_0x2f9307);FaxAccountEvents['on'](_0x16e876,_0x138a37);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index fa98731..e2434f5 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(_0x4841da,_0x1a5d31){var _0x8befd1=function(_0x17c9fc){while(--_0x17c9fc){_0x4841da['push'](_0x4841da['shift']());}};_0x8befd1(++_0x1a5d31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x23de89,_0x2d81c8){var _0x5bc644=function(_0x2d0300){while(--_0x2d0300){_0x23de89['push'](_0x23de89['shift']());}};_0x5bc644(++_0x2d81c8);}(_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 9ef497d..0a004e6 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 _0xc76b=['*,*,*,*','INTEGER','noop','TEXT','STRING'];(function(_0x452568,_0x4ff94a){var _0x5b0781=function(_0x138b8d){while(--_0x138b8d){_0x452568['push'](_0x452568['shift']());}};_0x5b0781(++_0x4ff94a);}(_0xc76b,0x123));var _0xbc76=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xc76b[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xbc76('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbc76('0x1')},'appdata':{'type':Sequelize[_0xbc76('0x2')]()},'description':{'type':Sequelize[_0xbc76('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbc76('0x4')}}; \ No newline at end of file +var _0x98a2=['*,*,*,*','sequelize','STRING','noop'];(function(_0x91e09c,_0x7960a6){var _0x58ed46=function(_0x1ca4cb){while(--_0x1ca4cb){_0x91e09c['push'](_0x91e09c['shift']());}};_0x58ed46(++_0x7960a6);}(_0x98a2,0xf5));var _0x298a=function(_0x2c44f4,_0x524334){_0x2c44f4=_0x2c44f4-0x0;var _0x5b578a=_0x98a2[_0x2c44f4];return _0x5b578a;};'use strict';var Sequelize=require(_0x298a('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x298a('0x1')],'allowNull':![],'defaultValue':_0x298a('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x298a('0x1')],'defaultValue':_0x298a('0x3')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 5e131da..e7fc616 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 _0x0678=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','offset','undefined','limit','count','status','set','Content-Range','json','apply','save','update','then','end','sendStatus','error','name','index','map','FaxApplication','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','length','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0678,0xc8));var _0x8067=function(_0x116c53,_0x30e717){_0x116c53=_0x116c53-0x0;var _0x429ac9=_0x0678[_0x116c53];return _0x429ac9;};'use strict';var emlformat=require(_0x8067('0x0'));var rimraf=require(_0x8067('0x1'));var zipdir=require(_0x8067('0x2'));var jsonpatch=require(_0x8067('0x3'));var rp=require(_0x8067('0x4'));var moment=require(_0x8067('0x5'));var BPromise=require(_0x8067('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8067('0x7'));var sox=require('sox');var csv=require(_0x8067('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8067('0x9'));var _=require(_0x8067('0xa'));var squel=require(_0x8067('0xb'));var crypto=require(_0x8067('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8067('0xd'));var toCsv=require(_0x8067('0x8'));var querystring=require(_0x8067('0xe'));var Papa=require(_0x8067('0xf'));var Redis=require('ioredis');var authService=require(_0x8067('0x10'));var qs=require(_0x8067('0x11'));var as=require(_0x8067('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8067('0x13'));var utils=require(_0x8067('0x14'));var config=require(_0x8067('0x15'));var licenseUtil=require(_0x8067('0x16'));var db=require(_0x8067('0x17'))['db'];function respondWithStatusCode(_0x3c87f0,_0x14ce15){_0x14ce15=_0x14ce15||0xcc;return function(_0x12bde2){if(_0x12bde2){return _0x3c87f0['sendStatus'](_0x14ce15);}return _0x3c87f0['status'](_0x14ce15)['end']();};}function respondWithResult(_0x46f379,_0x5c7de2){_0x5c7de2=_0x5c7de2||0xc8;return function(_0x29a869){if(_0x29a869){return _0x46f379['status'](_0x5c7de2)['json'](_0x29a869);}};}function respondWithFilteredResult(_0x6ce872,_0x5ee11e){return function(_0x139ae0){if(_0x139ae0){var _0x4e7ff9=typeof _0x5ee11e[_0x8067('0x18')]===_0x8067('0x19')&&typeof _0x5ee11e[_0x8067('0x1a')]===_0x8067('0x19');var _0x49740e=_0x139ae0[_0x8067('0x1b')];var _0x1a95c3=_0x4e7ff9?0x0:_0x5ee11e[_0x8067('0x18')];var _0x446eda=_0x4e7ff9?_0x139ae0[_0x8067('0x1b')]:_0x5ee11e[_0x8067('0x18')]+_0x5ee11e['limit'];var _0x37f676;if(_0x446eda>=_0x49740e){_0x446eda=_0x49740e;_0x37f676=0xc8;}else{_0x37f676=0xce;}_0x6ce872[_0x8067('0x1c')](_0x37f676);return _0x6ce872[_0x8067('0x1d')](_0x8067('0x1e'),_0x1a95c3+'-'+_0x446eda+'/'+_0x49740e)[_0x8067('0x1f')](_0x139ae0);}return null;};}function patchUpdates(_0x41077f){return function(_0x405ff7){try{jsonpatch[_0x8067('0x20')](_0x405ff7,_0x41077f,!![]);}catch(_0x39be57){return BPromise['reject'](_0x39be57);}return _0x405ff7[_0x8067('0x21')]();};}function saveUpdates(_0x2d67d2,_0x242e87){return function(_0x53a445){if(_0x53a445){return _0x53a445[_0x8067('0x22')](_0x2d67d2)[_0x8067('0x23')](function(_0x1a1b40){return _0x1a1b40;});}return null;};}function removeEntity(_0x214b99,_0x114b05){return function(_0x1607fa){if(_0x1607fa){return _0x1607fa['destroy']()[_0x8067('0x23')](function(){_0x214b99[_0x8067('0x1c')](0xcc)[_0x8067('0x24')]();});}};}function handleEntityNotFound(_0x443772,_0x3793cc){return function(_0x2907c8){if(!_0x2907c8){_0x443772[_0x8067('0x25')](0x194);}return _0x2907c8;};}function handleError(_0x24eec8,_0x2dcb86){_0x2dcb86=_0x2dcb86||0x1f4;return function(_0x4a8efe){logger[_0x8067('0x26')](_0x4a8efe['stack']);if(_0x4a8efe['name']){delete _0x4a8efe[_0x8067('0x27')];}_0x24eec8[_0x8067('0x1c')](_0x2dcb86)['send'](_0x4a8efe);};}exports[_0x8067('0x28')]=function(_0x1a1a67,_0x5d803b){var _0xc4540a={},_0x390be4={},_0x3338b2={'count':0x0,'rows':[]};var _0x10b2f2=_[_0x8067('0x29')](db[_0x8067('0x2a')][_0x8067('0x2b')],function(_0x50e790){return{'name':_0x50e790[_0x8067('0x2c')],'type':_0x50e790[_0x8067('0x2d')][_0x8067('0x2e')]};});_0x390be4['model']=_[_0x8067('0x29')](_0x10b2f2,_0x8067('0x27'));_0x390be4[_0x8067('0x2f')]=_['keys'](_0x1a1a67['query']);_0x390be4['filters']=_[_0x8067('0x30')](_0x390be4['model'],_0x390be4['query']);_0xc4540a[_0x8067('0x31')]=_[_0x8067('0x30')](_0x390be4[_0x8067('0x32')],qs[_0x8067('0x33')](_0x1a1a67[_0x8067('0x2f')][_0x8067('0x33')]));_0xc4540a[_0x8067('0x31')]=_0xc4540a[_0x8067('0x31')]['length']?_0xc4540a['attributes']:_0x390be4['model'];if(!_0x1a1a67['query']['hasOwnProperty'](_0x8067('0x34'))){_0xc4540a[_0x8067('0x1a')]=qs['limit'](_0x1a1a67['query'][_0x8067('0x1a')]);_0xc4540a[_0x8067('0x18')]=qs[_0x8067('0x18')](_0x1a1a67[_0x8067('0x2f')][_0x8067('0x18')]);}_0xc4540a[_0x8067('0x35')]=qs[_0x8067('0x36')](_0x1a1a67[_0x8067('0x2f')][_0x8067('0x36')]);_0xc4540a['where']=qs[_0x8067('0x37')](_['pick'](_0x1a1a67[_0x8067('0x2f')],_0x390be4[_0x8067('0x37')]),_0x10b2f2);if(_0x1a1a67[_0x8067('0x2f')][_0x8067('0x38')]){_0xc4540a[_0x8067('0x39')]=_[_0x8067('0x3a')](_0xc4540a['where'],{'$or':_[_0x8067('0x29')](_0x10b2f2,function(_0x5531e){if(_0x5531e[_0x8067('0x2d')]!==_0x8067('0x3b')){var _0x4c19c9={};_0x4c19c9[_0x5531e[_0x8067('0x27')]]={'$like':'%'+_0x1a1a67[_0x8067('0x2f')][_0x8067('0x38')]+'%'};return _0x4c19c9;}})});}_0xc4540a=_['merge']({},_0xc4540a,_0x1a1a67[_0x8067('0x3c')]);var _0x659963={'where':_0xc4540a['where']};return db[_0x8067('0x2a')][_0x8067('0x1b')](_0x659963)[_0x8067('0x23')](function(_0x3c733e){_0x3338b2[_0x8067('0x1b')]=_0x3c733e;if(_0x1a1a67[_0x8067('0x2f')][_0x8067('0x3d')]){_0xc4540a[_0x8067('0x3e')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0xc4540a);})[_0x8067('0x23')](function(_0x1eac01){_0x3338b2[_0x8067('0x3f')]=_0x1eac01;return _0x3338b2;})[_0x8067('0x23')](respondWithFilteredResult(_0x5d803b,_0xc4540a))[_0x8067('0x40')](handleError(_0x5d803b,null));};exports['show']=function(_0xf17e2e,_0x59b789){var _0x1995e1={'raw':!![],'where':{'id':_0xf17e2e[_0x8067('0x41')]['id']}},_0x4a496e={};_0x4a496e[_0x8067('0x32')]=_[_0x8067('0x42')](db[_0x8067('0x2a')]['rawAttributes']);_0x4a496e[_0x8067('0x2f')]=_[_0x8067('0x42')](_0xf17e2e[_0x8067('0x2f')]);_0x4a496e[_0x8067('0x37')]=_[_0x8067('0x30')](_0x4a496e[_0x8067('0x32')],_0x4a496e[_0x8067('0x2f')]);_0x1995e1[_0x8067('0x31')]=_[_0x8067('0x30')](_0x4a496e[_0x8067('0x32')],qs['fields'](_0xf17e2e['query'][_0x8067('0x33')]));_0x1995e1[_0x8067('0x31')]=_0x1995e1[_0x8067('0x31')][_0x8067('0x43')]?_0x1995e1[_0x8067('0x31')]:_0x4a496e[_0x8067('0x32')];if(_0xf17e2e[_0x8067('0x2f')][_0x8067('0x3d')]){_0x1995e1[_0x8067('0x3e')]=[{'all':!![]}];}_0x1995e1=_[_0x8067('0x3a')]({},_0x1995e1,_0xf17e2e['options']);return db[_0x8067('0x2a')][_0x8067('0x44')](_0x1995e1)[_0x8067('0x23')](handleEntityNotFound(_0x59b789,null))[_0x8067('0x23')](respondWithResult(_0x59b789,null))[_0x8067('0x40')](handleError(_0x59b789,null));};exports[_0x8067('0x45')]=function(_0x174f33,_0x34dc2b){return db[_0x8067('0x2a')]['create'](_0x174f33[_0x8067('0x46')],{})[_0x8067('0x23')](respondWithResult(_0x34dc2b,0xc9))[_0x8067('0x40')](handleError(_0x34dc2b,null));};exports['update']=function(_0x31bbdb,_0x89bea2){if(_0x31bbdb['body']['id']){delete _0x31bbdb[_0x8067('0x46')]['id'];}return db[_0x8067('0x2a')][_0x8067('0x44')]({'where':{'id':_0x31bbdb[_0x8067('0x41')]['id']}})[_0x8067('0x23')](handleEntityNotFound(_0x89bea2,null))['then'](saveUpdates(_0x31bbdb[_0x8067('0x46')],null))['then'](respondWithResult(_0x89bea2,null))[_0x8067('0x40')](handleError(_0x89bea2,null));};exports[_0x8067('0x47')]=function(_0xf61181,_0x14c70e){return db[_0x8067('0x2a')][_0x8067('0x44')]({'where':{'id':_0xf61181[_0x8067('0x41')]['id']}})['then'](handleEntityNotFound(_0x14c70e,null))['then'](removeEntity(_0x14c70e,null))[_0x8067('0x40')](handleError(_0x14c70e,null));}; \ No newline at end of file +var _0xbff4=['save','update','then','destroy','name','send','index','FaxApplication','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject'];(function(_0x4bfade,_0xb26c0e){var _0x272465=function(_0x3b38cb){while(--_0x3b38cb){_0x4bfade['push'](_0x4bfade['shift']());}};_0x272465(++_0xb26c0e);}(_0xbff4,0x75));var _0x4bff=function(_0x5a905e,_0x31aa4a){_0x5a905e=_0x5a905e-0x0;var _0x4124d6=_0xbff4[_0x5a905e];return _0x4124d6;};'use strict';var emlformat=require(_0x4bff('0x0'));var rimraf=require(_0x4bff('0x1'));var zipdir=require(_0x4bff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4bff('0x3'));var Mustache=require(_0x4bff('0x4'));var util=require('util');var path=require(_0x4bff('0x5'));var sox=require(_0x4bff('0x6'));var csv=require(_0x4bff('0x7'));var ejs=require(_0x4bff('0x8'));var fs=require('fs');var fs_extra=require(_0x4bff('0x9'));var _=require(_0x4bff('0xa'));var squel=require('squel');var crypto=require(_0x4bff('0xb'));var jsforce=require(_0x4bff('0xc'));var deskjs=require(_0x4bff('0xd'));var toCsv=require(_0x4bff('0x7'));var querystring=require(_0x4bff('0xe'));var Papa=require(_0x4bff('0xf'));var Redis=require(_0x4bff('0x10'));var authService=require(_0x4bff('0x11'));var qs=require(_0x4bff('0x12'));var as=require(_0x4bff('0x13'));var hardwareService=require(_0x4bff('0x14'));var logger=require(_0x4bff('0x15'))(_0x4bff('0x16'));var utils=require(_0x4bff('0x17'));var config=require(_0x4bff('0x18'));var licenseUtil=require(_0x4bff('0x19'));var db=require(_0x4bff('0x1a'))['db'];function respondWithStatusCode(_0x2b27f6,_0x3783b1){_0x3783b1=_0x3783b1||0xcc;return function(_0x1015d9){if(_0x1015d9){return _0x2b27f6[_0x4bff('0x1b')](_0x3783b1);}return _0x2b27f6[_0x4bff('0x1c')](_0x3783b1)[_0x4bff('0x1d')]();};}function respondWithResult(_0x53bba3,_0xd8311b){_0xd8311b=_0xd8311b||0xc8;return function(_0x3a5fc1){if(_0x3a5fc1){return _0x53bba3[_0x4bff('0x1c')](_0xd8311b)[_0x4bff('0x1e')](_0x3a5fc1);}};}function respondWithFilteredResult(_0x33ef47,_0x138deb){return function(_0x1faa61){if(_0x1faa61){var _0x501bce=typeof _0x138deb[_0x4bff('0x1f')]===_0x4bff('0x20')&&typeof _0x138deb[_0x4bff('0x21')]===_0x4bff('0x20');var _0x3d98d1=_0x1faa61['count'];var _0x857697=_0x501bce?0x0:_0x138deb[_0x4bff('0x1f')];var _0x375d7f=_0x501bce?_0x1faa61['count']:_0x138deb['offset']+_0x138deb[_0x4bff('0x21')];var _0x45dbe7;if(_0x375d7f>=_0x3d98d1){_0x375d7f=_0x3d98d1;_0x45dbe7=0xc8;}else{_0x45dbe7=0xce;}_0x33ef47[_0x4bff('0x1c')](_0x45dbe7);return _0x33ef47['set'](_0x4bff('0x22'),_0x857697+'-'+_0x375d7f+'/'+_0x3d98d1)['json'](_0x1faa61);}return null;};}function patchUpdates(_0x4acb85){return function(_0x1a4e98){try{jsonpatch[_0x4bff('0x23')](_0x1a4e98,_0x4acb85,!![]);}catch(_0x4141b7){return BPromise[_0x4bff('0x24')](_0x4141b7);}return _0x1a4e98[_0x4bff('0x25')]();};}function saveUpdates(_0x2fe243,_0x9e98cc){return function(_0x1f2afd){if(_0x1f2afd){return _0x1f2afd[_0x4bff('0x26')](_0x2fe243)[_0x4bff('0x27')](function(_0x29b72a){return _0x29b72a;});}return null;};}function removeEntity(_0x4e67a3,_0x5db8a6){return function(_0x401805){if(_0x401805){return _0x401805[_0x4bff('0x28')]()[_0x4bff('0x27')](function(){_0x4e67a3['status'](0xcc)[_0x4bff('0x1d')]();});}};}function handleEntityNotFound(_0x5c061a,_0x271f07){return function(_0x3acf42){if(!_0x3acf42){_0x5c061a[_0x4bff('0x1b')](0x194);}return _0x3acf42;};}function handleError(_0x14023a,_0x1af8d1){_0x1af8d1=_0x1af8d1||0x1f4;return function(_0x32dbd1){logger['error'](_0x32dbd1['stack']);if(_0x32dbd1[_0x4bff('0x29')]){delete _0x32dbd1['name'];}_0x14023a[_0x4bff('0x1c')](_0x1af8d1)[_0x4bff('0x2a')](_0x32dbd1);};}exports[_0x4bff('0x2b')]=function(_0x4698f4,_0x1cc149){var _0x1c21ce={},_0x310978={},_0x367328={'count':0x0,'rows':[]};var _0x57cd8a=_['map'](db[_0x4bff('0x2c')][_0x4bff('0x2d')],function(_0x77434){return{'name':_0x77434[_0x4bff('0x2e')],'type':_0x77434[_0x4bff('0x2f')][_0x4bff('0x30')]};});_0x310978[_0x4bff('0x31')]=_[_0x4bff('0x32')](_0x57cd8a,_0x4bff('0x29'));_0x310978['query']=_[_0x4bff('0x33')](_0x4698f4[_0x4bff('0x34')]);_0x310978['filters']=_[_0x4bff('0x35')](_0x310978[_0x4bff('0x31')],_0x310978[_0x4bff('0x34')]);_0x1c21ce[_0x4bff('0x36')]=_[_0x4bff('0x35')](_0x310978[_0x4bff('0x31')],qs['fields'](_0x4698f4[_0x4bff('0x34')][_0x4bff('0x37')]));_0x1c21ce[_0x4bff('0x36')]=_0x1c21ce[_0x4bff('0x36')][_0x4bff('0x38')]?_0x1c21ce[_0x4bff('0x36')]:_0x310978[_0x4bff('0x31')];if(!_0x4698f4[_0x4bff('0x34')][_0x4bff('0x39')]('nolimit')){_0x1c21ce[_0x4bff('0x21')]=qs[_0x4bff('0x21')](_0x4698f4[_0x4bff('0x34')][_0x4bff('0x21')]);_0x1c21ce[_0x4bff('0x1f')]=qs[_0x4bff('0x1f')](_0x4698f4[_0x4bff('0x34')][_0x4bff('0x1f')]);}_0x1c21ce[_0x4bff('0x3a')]=qs['sort'](_0x4698f4['query'][_0x4bff('0x3b')]);_0x1c21ce['where']=qs[_0x4bff('0x3c')](_[_0x4bff('0x3d')](_0x4698f4[_0x4bff('0x34')],_0x310978['filters']),_0x57cd8a);if(_0x4698f4[_0x4bff('0x34')][_0x4bff('0x3e')]){_0x1c21ce[_0x4bff('0x3f')]=_[_0x4bff('0x40')](_0x1c21ce[_0x4bff('0x3f')],{'$or':_[_0x4bff('0x32')](_0x57cd8a,function(_0x5ca9e6){if(_0x5ca9e6[_0x4bff('0x2f')]!==_0x4bff('0x41')){var _0x5ca83a={};_0x5ca83a[_0x5ca9e6['name']]={'$like':'%'+_0x4698f4['query'][_0x4bff('0x3e')]+'%'};return _0x5ca83a;}})});}_0x1c21ce=_[_0x4bff('0x40')]({},_0x1c21ce,_0x4698f4[_0x4bff('0x42')]);var _0x366f7e={'where':_0x1c21ce[_0x4bff('0x3f')]};return db[_0x4bff('0x2c')][_0x4bff('0x43')](_0x366f7e)[_0x4bff('0x27')](function(_0x283cc3){_0x367328[_0x4bff('0x43')]=_0x283cc3;if(_0x4698f4[_0x4bff('0x34')][_0x4bff('0x44')]){_0x1c21ce[_0x4bff('0x45')]=[{'all':!![]}];}return db[_0x4bff('0x2c')]['findAll'](_0x1c21ce);})['then'](function(_0x472a30){_0x367328[_0x4bff('0x46')]=_0x472a30;return _0x367328;})[_0x4bff('0x27')](respondWithFilteredResult(_0x1cc149,_0x1c21ce))[_0x4bff('0x47')](handleError(_0x1cc149,null));};exports[_0x4bff('0x48')]=function(_0x54d2fa,_0x3d92e9){var _0x5a718b={'raw':!![],'where':{'id':_0x54d2fa[_0x4bff('0x49')]['id']}},_0x386e07={};_0x386e07[_0x4bff('0x31')]=_[_0x4bff('0x33')](db[_0x4bff('0x2c')]['rawAttributes']);_0x386e07[_0x4bff('0x34')]=_[_0x4bff('0x33')](_0x54d2fa[_0x4bff('0x34')]);_0x386e07[_0x4bff('0x3c')]=_['intersection'](_0x386e07[_0x4bff('0x31')],_0x386e07[_0x4bff('0x34')]);_0x5a718b[_0x4bff('0x36')]=_[_0x4bff('0x35')](_0x386e07[_0x4bff('0x31')],qs['fields'](_0x54d2fa[_0x4bff('0x34')][_0x4bff('0x37')]));_0x5a718b[_0x4bff('0x36')]=_0x5a718b[_0x4bff('0x36')][_0x4bff('0x38')]?_0x5a718b[_0x4bff('0x36')]:_0x386e07['model'];if(_0x54d2fa[_0x4bff('0x34')][_0x4bff('0x44')]){_0x5a718b['include']=[{'all':!![]}];}_0x5a718b=_['merge']({},_0x5a718b,_0x54d2fa[_0x4bff('0x42')]);return db[_0x4bff('0x2c')][_0x4bff('0x4a')](_0x5a718b)[_0x4bff('0x27')](handleEntityNotFound(_0x3d92e9,null))[_0x4bff('0x27')](respondWithResult(_0x3d92e9,null))['catch'](handleError(_0x3d92e9,null));};exports[_0x4bff('0x4b')]=function(_0x366e26,_0x2e8410){return db[_0x4bff('0x2c')][_0x4bff('0x4b')](_0x366e26['body'],{})[_0x4bff('0x27')](respondWithResult(_0x2e8410,0xc9))[_0x4bff('0x47')](handleError(_0x2e8410,null));};exports['update']=function(_0x16c7f9,_0x1e6571){if(_0x16c7f9[_0x4bff('0x4c')]['id']){delete _0x16c7f9[_0x4bff('0x4c')]['id'];}return db[_0x4bff('0x2c')][_0x4bff('0x4a')]({'where':{'id':_0x16c7f9[_0x4bff('0x49')]['id']}})[_0x4bff('0x27')](handleEntityNotFound(_0x1e6571,null))[_0x4bff('0x27')](saveUpdates(_0x16c7f9['body'],null))[_0x4bff('0x27')](respondWithResult(_0x1e6571,null))[_0x4bff('0x47')](handleError(_0x1e6571,null));};exports[_0x4bff('0x28')]=function(_0x5f5623,_0x412ec3){return db['FaxApplication'][_0x4bff('0x4a')]({'where':{'id':_0x5f5623['params']['id']}})[_0x4bff('0x27')](handleEntityNotFound(_0x412ec3,null))['then'](removeEntity(_0x412ec3,null))[_0x4bff('0x47')](handleError(_0x412ec3,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index e9d9c8d..bf6bbdf 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 _0x308c=['FaxApplication','fax_applications','utf8mb4','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x308c,0xc7));var _0xc308=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x308c[_0x122096];return _0x3d1966;};'use strict';var _=require(_0xc308('0x0'));var util=require('util');var logger=require(_0xc308('0x1'))(_0xc308('0x2'));var moment=require(_0xc308('0x3'));var BPromise=require('bluebird');var rp=require(_0xc308('0x4'));var fs=require('fs');var path=require(_0xc308('0x5'));var rimraf=require(_0xc308('0x6'));var config=require(_0xc308('0x7'));var attributes=require(_0xc308('0x8'));module[_0xc308('0x9')]=function(_0x4cf335,_0x18791f){return _0x4cf335[_0xc308('0xa')](_0xc308('0xb'),attributes,{'tableName':_0xc308('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc308('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xca39=['bluebird','request-promise','path','rimraf','exports','fax_applications','utf8mb4','util','api','moment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xca39,0xd9));var _0x9ca3=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xca39[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x9ca3('0x0'));var logger=require('../../config/logger')(_0x9ca3('0x1'));var moment=require(_0x9ca3('0x2'));var BPromise=require(_0x9ca3('0x3'));var rp=require(_0x9ca3('0x4'));var fs=require('fs');var path=require(_0x9ca3('0x5'));var rimraf=require(_0x9ca3('0x6'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0x9ca3('0x7')]=function(_0x49654e,_0x129392){return _0x49654e['define']('FaxApplication',attributes,{'tableName':_0x9ca3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ca3('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index e6fea30..7712a64 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 _0x8649=['info','result','UpdateFaxApplication','FaxApplication','update','body','options','where','limit','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message'];(function(_0x515362,_0x1d853c){var _0x4d7b5c=function(_0x562f5f){while(--_0x562f5f){_0x515362['push'](_0x515362['shift']());}};_0x4d7b5c(++_0x1d853c);}(_0x8649,0x7a));var _0x9864=function(_0x480c41,_0x3b93c3){_0x480c41=_0x480c41-0x0;var _0x1d9731=_0x8649[_0x480c41];return _0x1d9731;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9864('0x0'));var BPromise=require(_0x9864('0x1'));var rs=require(_0x9864('0x2'));var fs=require('fs');var Redis=require(_0x9864('0x3'));var db=require(_0x9864('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9864('0x5'))('rpc');var config=require(_0x9864('0x6'));var jayson=require(_0x9864('0x7'));var client=jayson[_0x9864('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2438a5,_0x3a1873,_0x46b7d4){return new BPromise(function(_0x54c95c,_0x4b1307){return client['request'](_0x2438a5,_0x46b7d4)[_0x9864('0x9')](function(_0x40479b){logger['info']('FaxApplication,\x20%s,\x20%s',_0x3a1873,_0x9864('0xa'));logger[_0x9864('0xb')](_0x9864('0xc'),_0x3a1873,_0x9864('0xa'),JSON[_0x9864('0xd')](_0x40479b));if(_0x40479b['error']){if(_0x40479b[_0x9864('0xe')][_0x9864('0xf')]===0x1f4){logger[_0x9864('0xe')](_0x9864('0x10'),_0x3a1873,_0x40479b['error']['message']);return _0x4b1307(_0x40479b[_0x9864('0xe')][_0x9864('0x11')]);}logger[_0x9864('0xe')](_0x9864('0x10'),_0x3a1873,_0x40479b['error'][_0x9864('0x11')]);return _0x54c95c(_0x40479b[_0x9864('0xe')][_0x9864('0x11')]);}else{logger[_0x9864('0x12')](_0x9864('0x10'),_0x3a1873,'request\x20sent');_0x54c95c(_0x40479b[_0x9864('0x13')]['message']);}})['catch'](function(_0x4d1fc7){logger[_0x9864('0xe')](_0x9864('0x10'),_0x3a1873,_0x4d1fc7);_0x4b1307(_0x4d1fc7);});});}exports[_0x9864('0x14')]=function(_0x41e162){var _0x1e9326=this;return new Promise(function(_0x490103,_0x30c40c){return db[_0x9864('0x15')][_0x9864('0x16')](_0x41e162[_0x9864('0x17')],{'raw':_0x41e162[_0x9864('0x18')]?_0x41e162['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41e162['options']?_0x41e162[_0x9864('0x18')][_0x9864('0x19')]||null:null,'attributes':_0x41e162[_0x9864('0x18')]?_0x41e162[_0x9864('0x18')]['attributes']||null:null,'limit':_0x41e162['options']?_0x41e162['options'][_0x9864('0x1a')]||null:null})[_0x9864('0x9')](function(_0x59cd4e){logger['info'](_0x9864('0x14'),_0x41e162);logger[_0x9864('0xb')](_0x9864('0x14'),_0x41e162,JSON[_0x9864('0xd')](_0x59cd4e));_0x490103(_0x59cd4e);})[_0x9864('0x1b')](function(_0x84d0b){logger[_0x9864('0xe')](_0x9864('0x14'),_0x84d0b[_0x9864('0x11')],_0x41e162);_0x30c40c(_0x1e9326[_0x9864('0xe')](0x1f4,_0x84d0b[_0x9864('0x11')]));});});}; \ No newline at end of file +var _0x8412=['stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','FaxApplication,\x20%s,\x20%s','message','catch','UpdateFaxApplication','FaxApplication','update','body','raw','options','where','attributes','limit','then'];(function(_0x986612,_0x486043){var _0x43a050=function(_0x4361c4){while(--_0x4361c4){_0x986612['push'](_0x986612['shift']());}};_0x43a050(++_0x486043);}(_0x8412,0xe1));var _0x2841=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0x8412[_0xa9a245];return _0x2d0eaa;};'use strict';var _=require(_0x2841('0x0'));var util=require(_0x2841('0x1'));var moment=require(_0x2841('0x2'));var BPromise=require(_0x2841('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2841('0x4'));var db=require(_0x2841('0x5'))['db'];var utils=require(_0x2841('0x6'));var logger=require(_0x2841('0x7'))(_0x2841('0x8'));var config=require(_0x2841('0x9'));var jayson=require(_0x2841('0xa'));var client=jayson['client'][_0x2841('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27be9e,_0x576670,_0x55429b){return new BPromise(function(_0x25782a,_0x5ea3f0){return client['request'](_0x27be9e,_0x55429b)['then'](function(_0x1fb518){logger[_0x2841('0xc')]('FaxApplication,\x20%s,\x20%s',_0x576670,_0x2841('0xd'));logger[_0x2841('0xe')](_0x2841('0xf'),_0x576670,_0x2841('0xd'),JSON['stringify'](_0x1fb518));if(_0x1fb518[_0x2841('0x10')]){if(_0x1fb518['error'][_0x2841('0x11')]===0x1f4){logger['error'](_0x2841('0x12'),_0x576670,_0x1fb518[_0x2841('0x10')][_0x2841('0x13')]);return _0x5ea3f0(_0x1fb518['error'][_0x2841('0x13')]);}logger['error'](_0x2841('0x12'),_0x576670,_0x1fb518[_0x2841('0x10')][_0x2841('0x13')]);return _0x25782a(_0x1fb518[_0x2841('0x10')][_0x2841('0x13')]);}else{logger[_0x2841('0xc')]('FaxApplication,\x20%s,\x20%s',_0x576670,'request\x20sent');_0x25782a(_0x1fb518['result'][_0x2841('0x13')]);}})[_0x2841('0x14')](function(_0x4dc795){logger[_0x2841('0x10')](_0x2841('0x12'),_0x576670,_0x4dc795);_0x5ea3f0(_0x4dc795);});});}exports[_0x2841('0x15')]=function(_0x3df5dc){var _0x28a256=this;return new Promise(function(_0x41438d,_0xcb2838){return db[_0x2841('0x16')][_0x2841('0x17')](_0x3df5dc[_0x2841('0x18')],{'raw':_0x3df5dc['options']?_0x3df5dc['options'][_0x2841('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3df5dc['options']?_0x3df5dc[_0x2841('0x1a')][_0x2841('0x1b')]||null:null,'attributes':_0x3df5dc['options']?_0x3df5dc[_0x2841('0x1a')][_0x2841('0x1c')]||null:null,'limit':_0x3df5dc[_0x2841('0x1a')]?_0x3df5dc[_0x2841('0x1a')][_0x2841('0x1d')]||null:null})[_0x2841('0x1e')](function(_0xb756ea){logger[_0x2841('0xc')](_0x2841('0x15'),_0x3df5dc);logger[_0x2841('0xe')](_0x2841('0x15'),_0x3df5dc,JSON[_0x2841('0x1f')](_0xb756ea));_0x41438d(_0xb756ea);})[_0x2841('0x14')](function(_0x13fed0){logger[_0x2841('0x10')](_0x2841('0x15'),_0x13fed0[_0x2841('0x13')],_0x3df5dc);_0xcb2838(_0x28a256[_0x2841('0x10')](0x1f4,_0x13fed0['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 14bd63b..1fef53c 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 _0xefda=['post','create','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xefda,0x96));var _0xaefd=function(_0x16e95b,_0x41ebba){_0x16e95b=_0x16e95b-0x0;var _0x160dcc=_0xefda[_0x16e95b];return _0x160dcc;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['show']);router[_0xaefd('0xc')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaefd('0xe')]);router[_0xaefd('0xf')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x10')]);module[_0xaefd('0x11')]=router; \ No newline at end of file +var _0xb62e=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','get','show','post','/:id','update','delete','destroy','exports','multer','util'];(function(_0x538ad2,_0xc16100){var _0x21a38f=function(_0x13c0ed){while(--_0x13c0ed){_0x538ad2['push'](_0x538ad2['shift']());}};_0x21a38f(++_0xc16100);}(_0xb62e,0x1de));var _0xeb62=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb62e[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var fs_extra=require(_0xeb62('0x5'));var auth=require(_0xeb62('0x6'));var interaction=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var controller=require(_0xeb62('0x9'));router['get']('/',auth[_0xeb62('0xa')](),controller[_0xeb62('0xb')]);router[_0xeb62('0xc')]('/:id',auth[_0xeb62('0xa')](),controller[_0xeb62('0xd')]);router[_0xeb62('0xe')]('/',auth[_0xeb62('0xa')](),controller['create']);router['put'](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x10')]);router[_0xeb62('0x11')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x12')]);module[_0xeb62('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 5229a15..65af8a7 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 _0x70c5=['ENUM','out','exports','BOOLEAN','DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70c5,0x1dc));var _0x570c=function(_0x26c72d,_0x307558){_0x26c72d=_0x26c72d-0x0;var _0x8b3454=_0x70c5[_0x26c72d];return _0x8b3454;};'use strict';var Sequelize=require('sequelize');module[_0x570c('0x0')]={'closed':{'type':Sequelize[_0x570c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x570c('0x2')]},'disposition':{'type':Sequelize[_0x570c('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x570c('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x570c('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x570c('0x4')]('in',_0x570c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x570c('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x570c('0x4')]('in',_0x570c('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xaa89=['BOOLEAN','STRING','DATE','ENUM','out','sequelize'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xaa89,0xef));var _0x9aa8=function(_0x221b8c,_0x2c7afc){_0x221b8c=_0x221b8c-0x0;var _0x3fab9f=_0xaa89[_0x221b8c];return _0x3fab9f;};'use strict';var Sequelize=require(_0x9aa8('0x0'));module['exports']={'closed':{'type':Sequelize[_0x9aa8('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x9aa8('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9aa8('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x9aa8('0x3')]},'fax':{'type':Sequelize[_0x9aa8('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x9aa8('0x4')]('in',_0x9aa8('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9aa8('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x9aa8('0x4')]('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 f0773c1..784c7f2 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 _0x8bb8=['field','color','from','tools_tags','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','length','conditions','find','unreadMessages','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','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','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','i.FaxAccountId\x20IN\x20?','createdAt','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.fax\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','a.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','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','rawAttributes','includeAll','include','options','create','destroy','describe','addMessage','ids','getMessages','findOne','FaxMessage','hasOwnProperty','merge','$gte','split','addTags','omit','spread','findAll','emit','faxInteractionTags:save','removeTags','unix','join','server','files','tmp','root','Attachment','Messages','get','basename','existsSync','createReadStream','createWriteStream','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','reject','save','update','then','error','stack','name','send','Users','map','fullname','TagIds','forEach','Tags','push','catch','index','FaxInteraction','fieldName','type','query','keys','intersection','model','fields','attributes','sort','where','filters','pick','select'];(function(_0x5af483,_0x21b407){var _0x560bc5=function(_0x2268b9){while(--_0x2268b9){_0x5af483['push'](_0x5af483['shift']());}};_0x560bc5(++_0x21b407);}(_0x8bb8,0x159));var _0x88bb=function(_0x11031b,_0x27581f){_0x11031b=_0x11031b-0x0;var _0x1b701c=_0x8bb8[_0x11031b];return _0x1b701c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x88bb('0x0'));var zipdir=require(_0x88bb('0x1'));var jsonpatch=require(_0x88bb('0x2'));var rp=require(_0x88bb('0x3'));var moment=require(_0x88bb('0x4'));var BPromise=require(_0x88bb('0x5'));var Mustache=require(_0x88bb('0x6'));var util=require(_0x88bb('0x7'));var path=require(_0x88bb('0x8'));var sox=require(_0x88bb('0x9'));var csv=require('to-csv');var ejs=require(_0x88bb('0xa'));var fs=require('fs');var fs_extra=require(_0x88bb('0xb'));var _=require(_0x88bb('0xc'));var squel=require('squel');var crypto=require(_0x88bb('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x88bb('0xe'));var Redis=require(_0x88bb('0xf'));var authService=require(_0x88bb('0x10'));var qs=require(_0x88bb('0x11'));var as=require(_0x88bb('0x12'));var hardwareService=require(_0x88bb('0x13'));var logger=require(_0x88bb('0x14'))(_0x88bb('0x15'));var utils=require(_0x88bb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x88bb('0x17'));var db=require(_0x88bb('0x18'))['db'];config[_0x88bb('0x19')]=_[_0x88bb('0x1a')](config[_0x88bb('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x88bb('0x1b'))(new Redis(config[_0x88bb('0x19')]));require(_0x88bb('0x1c'))[_0x88bb('0x1d')](socket);function respondWithStatusCode(_0x2b173c,_0xbb790c){_0xbb790c=_0xbb790c||0xcc;return function(_0x10d943){if(_0x10d943){return _0x2b173c[_0x88bb('0x1e')](_0xbb790c);}return _0x2b173c[_0x88bb('0x1f')](_0xbb790c)[_0x88bb('0x20')]();};}function respondWithResult(_0x6babd7,_0x2253c7){_0x2253c7=_0x2253c7||0xc8;return function(_0x26f94b){if(_0x26f94b){return _0x6babd7[_0x88bb('0x1f')](_0x2253c7)[_0x88bb('0x21')](_0x26f94b);}};}function respondWithFilteredResult(_0x429ab7,_0x1feb67){return function(_0xd4e6ae){if(_0xd4e6ae){var _0x2d0a74=typeof _0x1feb67[_0x88bb('0x22')]==='undefined'&&typeof _0x1feb67[_0x88bb('0x23')]===_0x88bb('0x24');var _0x50243b=_0xd4e6ae[_0x88bb('0x25')];var _0x290854=_0x2d0a74?0x0:_0x1feb67[_0x88bb('0x22')];var _0x4ea27e=_0x2d0a74?_0xd4e6ae[_0x88bb('0x25')]:_0x1feb67[_0x88bb('0x22')]+_0x1feb67[_0x88bb('0x23')];var _0x520693;if(_0x4ea27e>=_0x50243b){_0x4ea27e=_0x50243b;_0x520693=0xc8;}else{_0x520693=0xce;}_0x429ab7[_0x88bb('0x1f')](_0x520693);return _0x429ab7['set']('Content-Range',_0x290854+'-'+_0x4ea27e+'/'+_0x50243b)['json'](_0xd4e6ae);}return null;};}function patchUpdates(_0x1370a6){return function(_0x4caaf3){try{jsonpatch['apply'](_0x4caaf3,_0x1370a6,!![]);}catch(_0x3d9eec){return BPromise[_0x88bb('0x26')](_0x3d9eec);}return _0x4caaf3[_0x88bb('0x27')]();};}function saveUpdates(_0x44180c,_0x3e854a){return function(_0x48eca9){if(_0x48eca9){return _0x48eca9[_0x88bb('0x28')](_0x44180c)[_0x88bb('0x29')](function(_0x207177){return _0x207177;});}return null;};}function removeEntity(_0x43b15f,_0x526ebc){return function(_0x787368){if(_0x787368){return _0x787368['destroy']()[_0x88bb('0x29')](function(){_0x43b15f[_0x88bb('0x1f')](0xcc)[_0x88bb('0x20')]();});}};}function handleEntityNotFound(_0x118a01,_0x4bc023){return function(_0x24f87b){if(!_0x24f87b){_0x118a01[_0x88bb('0x1e')](0x194);}return _0x24f87b;};}function handleError(_0xcf4b45,_0xc8c51f){_0xc8c51f=_0xc8c51f||0x1f4;return function(_0x1e0733){logger[_0x88bb('0x2a')](_0x1e0733[_0x88bb('0x2b')]);if(_0x1e0733[_0x88bb('0x2c')]){delete _0x1e0733['name'];}_0xcf4b45[_0x88bb('0x1f')](_0xc8c51f)[_0x88bb('0x2d')](_0x1e0733);};}function getInteractionUsers(_0x595dfe,_0x39f935){return new BPromise(function(_0x4a02b5,_0x25a3e0){try{if(_0x39f935[_0x595dfe['id']]){_0x595dfe[_0x88bb('0x2e')]=_[_0x88bb('0x2f')](_0x39f935[_0x595dfe['id']],function(_0x133eea){return{'id':_0x133eea['id'],'fullname':_0x133eea[_0x88bb('0x30')]};});}}catch(_0x1eacc4){_0x25a3e0(_0x1eacc4);}_0x4a02b5(_0x595dfe);});}function getInteractionTags(_0x4d7a25,_0x51aa18){return new BPromise(function(_0x368c2c,_0x3fb119){try{if(_0x4d7a25[_0x88bb('0x31')]){_0x4d7a25['Tags']=[];_0x4d7a25[_0x88bb('0x31')]['split'](',')[_0x88bb('0x32')](function(_0x4b10c9){_0x4d7a25[_0x88bb('0x33')][_0x88bb('0x34')](_0x51aa18[_0x4b10c9]);});}delete _0x4d7a25[_0x88bb('0x31')];}catch(_0x20e7a3){_0x3fb119(_0x20e7a3);}_0x368c2c(_0x4d7a25);});}function updateFaxInteraction(_0x1b1e95,_0x3601d2,_0x2378f6){return new BPromise(function(_0x22da2b,_0xa65f5){return getInteractionUsers(_0x1b1e95,_0x2378f6)[_0x88bb('0x29')](function(_0x2a90b9){return getInteractionTags(_0x2a90b9,_0x3601d2);})[_0x88bb('0x29')](function(_0x56a933){_0x22da2b(_0x56a933);})[_0x88bb('0x35')](function(_0x21a045){_0xa65f5(_0x21a045);});});}exports[_0x88bb('0x36')]=function(_0x51deb7,_0x282336){var _0x29971c={},_0x3abe70={},_0x59933={'count':0x0,'rows':[]};var _0x4a3c94=_[_0x88bb('0x2f')](db[_0x88bb('0x37')]['rawAttributes'],function(_0x5a3a81){return{'name':_0x5a3a81[_0x88bb('0x38')],'type':_0x5a3a81[_0x88bb('0x39')]['key']};});_0x3abe70['model']=_[_0x88bb('0x2f')](_0x4a3c94,'name');_0x3abe70[_0x88bb('0x3a')]=_[_0x88bb('0x3b')](_0x51deb7['query']);_0x3abe70['filters']=_['intersection'](_0x3abe70['model'],_0x3abe70[_0x88bb('0x3a')]);_0x29971c['attributes']=_[_0x88bb('0x3c')](_0x3abe70[_0x88bb('0x3d')],qs[_0x88bb('0x3e')](_0x51deb7[_0x88bb('0x3a')][_0x88bb('0x3e')]));_0x29971c[_0x88bb('0x3f')]=_0x29971c['attributes']['length']?_0x29971c[_0x88bb('0x3f')]:_0x3abe70[_0x88bb('0x3d')];if(!_0x51deb7[_0x88bb('0x3a')]['hasOwnProperty']('nolimit')){_0x29971c['limit']=qs[_0x88bb('0x23')](_0x51deb7[_0x88bb('0x3a')][_0x88bb('0x23')]);_0x29971c[_0x88bb('0x22')]=qs[_0x88bb('0x22')](_0x51deb7[_0x88bb('0x3a')][_0x88bb('0x22')]);}_0x29971c['order']=qs[_0x88bb('0x40')](_0x51deb7['query'][_0x88bb('0x40')]);_0x29971c[_0x88bb('0x41')]=qs[_0x88bb('0x42')](_[_0x88bb('0x43')](_0x51deb7[_0x88bb('0x3a')],_0x3abe70['filters']),_0x4a3c94);var _0x2e08d8=[];var _0xf6017a=squel[_0x88bb('0x44')]()[_0x88bb('0x45')]('id')['field'](_0x88bb('0x2c'))['field'](_0x88bb('0x46'))[_0x88bb('0x47')](_0x88bb('0x48'));var _0x202211=squel[_0x88bb('0x44')]()[_0x88bb('0x45')]('u.id')[_0x88bb('0x45')](_0x88bb('0x49'))[_0x88bb('0x45')](_0x88bb('0x4a'))[_0x88bb('0x47')](_0x88bb('0x4b'),'ui')[_0x88bb('0x4c')]('users','u',_0x88bb('0x4d'));var _0xf3b75a=squel[_0x88bb('0x44')]()['from'](_0x88bb('0x4e'),'i')['left_join'](_0x88bb('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x88bb('0x4c')](_0x88bb('0x50'),'o',_0x88bb('0x51'))['left_join'](_0x88bb('0x52'),'a',_0x88bb('0x53'))['left_join']('fax_messages','me',_0x88bb('0x54'))[_0x88bb('0x4c')](_0x88bb('0x55'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x88bb('0x4c')](_0x88bb('0x48'),'t',_0x88bb('0x56'));var _0x5b24c0=squel[_0x88bb('0x57')]();var _0x3d3772=[];var _0x1862eb=squel['expr']();var _0x8c3b18;if(_0x51deb7['query'][_0x88bb('0x58')]){_0x8c3b18=as[_0x88bb('0x59')](_0x51deb7[_0x88bb('0x3a')]['search']);var _0x1c45ca=_0x8c3b18[_0x88bb('0x5a')];for(var _0x77d606=0x0;_0x77d606<_0x8c3b18['conditions'][_0x88bb('0x5b')];_0x77d606++){var _0x5f204=_0x8c3b18[_0x88bb('0x5c')][_0x77d606];var _0x918be1='i';var _0x3d56cd=_[_0x88bb('0x5d')](_0x4a3c94,[_0x88bb('0x2c'),_0x5f204['field']]);if(!_0x3d56cd){switch(_0x5f204[_0x88bb('0x45')]){case _0x88bb('0x5e'):if(_0x5f204['value']==0x1){_0xf3b75a[_0x88bb('0x5f')]('`'+_0x5f204['field']+'`\x20=\x200');}else{_0xf3b75a[_0x88bb('0x5f')]('`'+_0x5f204[_0x88bb('0x45')]+_0x88bb('0x60'));}break;case _0x88bb('0x61'):if(_0x5f204[_0x88bb('0x62')]===_0x88bb('0x63')){if(_0x5f204['value']['split']('\x20')[_0x88bb('0x5b')]>0x1){_0x5b24c0[_0x1c45ca](_0x88bb('0x64'),qs[_0x88bb('0x65')](_0x5f204[_0x88bb('0x66')]),null);}else{var _0x464fbb='%'+_0x5f204['value']+'%';_0x5b24c0[_0x1c45ca](_0x88bb('0x67'),_0x464fbb,_0x464fbb,_0x464fbb);}}else{_0x3d56cd=_[_0x88bb('0x5d')](_0x4a3c94,[_0x88bb('0x2c'),_0x88bb('0x68')]);_0x5f204['field']=_0x88bb('0x68');_0xc66810=as[_0x88bb('0x69')](_0x918be1,_0x3d56cd[_0x88bb('0x39')],_0x5f204);_0x5b24c0[_0x1c45ca](_0xc66810[_0x88bb('0x6a')],_0xc66810['value'][_0x88bb('0x6b')],_0xc66810['value'][_0x88bb('0x20')]);}break;case _0x88bb('0x6c'):var _0x75460b=_0x5f204[_0x88bb('0x66')]['split'](',')[_0x88bb('0x2f')](function(_0x3ef872){return Number(_0x3ef872);});_0x75460b['forEach'](function(_0x581e68){_0x1862eb['or'](_0x88bb('0x6d'),'%,'+_0x581e68+',%');});_0x3d3772=_[_0x88bb('0x6e')](_0x3d3772,_0x75460b);break;case'User':if(_0x5f204[_0x88bb('0x62')]===_0x88bb('0x63')){_0x5b24c0[_0x1c45ca](_0x88bb('0x6f'),'%'+_0x5f204[_0x88bb('0x66')]+'%',null);}else{_0x3d56cd=_[_0x88bb('0x5d')](_0x4a3c94,['name','UserId']);_0x5f204[_0x88bb('0x45')]='UserId';_0xc66810=as['buildExpression'](_0x918be1,_0x3d56cd[_0x88bb('0x39')],_0x5f204);_0x5b24c0[_0x1c45ca](_0xc66810[_0x88bb('0x6a')],_0xc66810[_0x88bb('0x66')][_0x88bb('0x6b')],_0xc66810[_0x88bb('0x66')][_0x88bb('0x20')]);}break;case _0x88bb('0x70'):_0xc66810=as[_0x88bb('0x69')]('me',null,_0x5f204);_0x5b24c0[_0x1c45ca](_0xc66810['text'],_0xc66810[_0x88bb('0x66')][_0x88bb('0x6b')],_0xc66810['value'][_0x88bb('0x20')]);break;}}else{var _0xc66810=as[_0x88bb('0x69')](_0x918be1,_0x3d56cd['type'],_0x5f204);_0x5b24c0[_0x1c45ca](_0xc66810[_0x88bb('0x6a')],_0xc66810[_0x88bb('0x66')][_0x88bb('0x6b')],_0xc66810['value'][_0x88bb('0x20')]);}}}else{var _0x589192=_(_0x51deb7[_0x88bb('0x3a')])[_0x88bb('0x3b')]()[_0x88bb('0x2f')](function(_0x2fe5cc){return _[_0x88bb('0x71')](_0x4a3c94,[_0x88bb('0x2c'),_0x2fe5cc])?_0x2fe5cc:undefined;})[_0x88bb('0x72')]()[_0x88bb('0x66')]();if(!_[_0x88bb('0x73')](_0x589192)){_0x589192[_0x88bb('0x32')](function(_0x578b1a){if(_0x578b1a===_0x88bb('0x74')){_0xf3b75a[_0x88bb('0x41')](_0x88bb('0x75'),[]['concat'](_0x51deb7[_0x88bb('0x3a')][_0x578b1a]));}else if(_0x578b1a===_0x88bb('0x76')){var _0x3f797a=JSON['parse'](_0x51deb7[_0x88bb('0x3a')][_0x578b1a])['$gte'];var _0x193efc=JSON['parse'](_0x51deb7[_0x88bb('0x3a')][_0x578b1a])[_0x88bb('0x77')];_0xf3b75a[_0x88bb('0x41')](_0x88bb('0x78'),_0x3f797a,_0x193efc);}else{if(_0x51deb7[_0x88bb('0x3a')][_0x578b1a]===_0x88bb('0x79')){_0xf3b75a[_0x88bb('0x41')]('i.'+_0x578b1a+'\x20IS\x20NULL');}else{_0xf3b75a[_0x88bb('0x41')]('i.'+_0x578b1a+'\x20=\x20?',_0x51deb7[_0x88bb('0x3a')][_0x578b1a]);}}});}if(_0x51deb7[_0x88bb('0x3a')][_0x88bb('0x7a')]){if(_0x51deb7['query'][_0x88bb('0x7a')]==0x1){_0xf3b75a[_0x88bb('0x5f')](_0x88bb('0x7b'));}else{_0xf3b75a[_0x88bb('0x5f')](_0x88bb('0x7c'));}}if(_0x51deb7['query'][_0x88bb('0x7d')]){_0x3d3772=_['isArray'](_0x51deb7[_0x88bb('0x3a')][_0x88bb('0x7d')])?_0x51deb7[_0x88bb('0x3a')]['tag']:new Array(_0x51deb7['query'][_0x88bb('0x7d')]);_0x3d3772[_0x88bb('0x32')](function(_0x262e1b){_0x1862eb['or'](_0x88bb('0x6d'),'%,'+_0x262e1b+',%');});}if(_0x51deb7['query']['filter']){var _0x237b42=_0x51deb7[_0x88bb('0x3a')][_0x88bb('0x7e')]['replace']('\x5c','\x5c\x5c')[_0x88bb('0x7f')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x237b42)){_0x5b24c0['or']('i.id\x20LIKE\x20?',_0x237b42+'%')['or'](_0x88bb('0x80'),_0x237b42+'%');}_0x5b24c0['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x237b42+'%');}}_0xf3b75a[_0x88bb('0x41')](_0x5b24c0);_0xf3b75a[_0x88bb('0x81')](_0x88bb('0x82'));var _0x3c0cb3={'type':db[_0x88bb('0x83')]['QueryTypes'][_0x88bb('0x84')],'raw':!![]};var _0x577ff2=_0xf3b75a[_0x88bb('0x85')]();_0x577ff2[_0x88bb('0x45')](_0x88bb('0x82'));_0x577ff2[_0x88bb('0x45')](_0x88bb('0x86'),_0x88bb('0x5e'));if(_0x29971c[_0x88bb('0x87')]){_0x29971c[_0x88bb('0x87')][_0x88bb('0x32')](function(_0x19266b){var _0x3f2cec=_0x19266b[0x0]===_0x88bb('0x88')?_0x19266b[0x0]:'i.'+_0x19266b[0x0];_0xf3b75a[_0x88bb('0x87')](_0x3f2cec,_0x19266b[0x1]===_0x88bb('0x89')?![]:!![]);});}if(!_[_0x88bb('0x73')](_0x3d3772)){_0xf3b75a[_0x88bb('0x5f')](_0x1862eb);_0x577ff2['where']('t.id\x20IN\x20?',_0x3d3772);}BPromise[_0x88bb('0x8a')]()[_0x88bb('0x29')](function(){if(!_0x8c3b18){if(_0x51deb7[_0x88bb('0x3a')][_0x88bb('0x74')])return;_0x577ff2[_0x88bb('0x41')](_0x88bb('0x8b'));_0xf3b75a[_0x88bb('0x41')](_0x88bb('0x8b'));return;}if(_0x51deb7[_0x88bb('0x8c')][_0x88bb('0x8d')]!==_0x88bb('0x8e'))return;return _0x51deb7['user']['getFaxAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x34e015){if(_['isEmpty'](_0x34e015)){_0x577ff2[_0x88bb('0x41')](_0x88bb('0x8f'));_0xf3b75a[_0x88bb('0x41')](_0x88bb('0x8f'));}else{_0x577ff2['where'](_0x88bb('0x75'),_[_0x88bb('0x2f')](_0x34e015,'id'));_0xf3b75a['where'](_0x88bb('0x75'),_['map'](_0x34e015,'id'));}});})[_0x88bb('0x29')](function(){if(_0x51deb7['user'][_0x88bb('0x8d')]===_0x88bb('0x8e')&&!_0x8c3b18&&!_0x51deb7[_0x88bb('0x3a')][_0x88bb('0x74')])return[];return db[_0x88bb('0x90')][_0x88bb('0x3a')](_0x577ff2[_0x88bb('0x91')](),_0x3c0cb3);})[_0x88bb('0x29')](function(_0x3ca3ab){_0x59933[_0x88bb('0x25')]=_0x3ca3ab[_0x88bb('0x5b')];if(_0x59933[_0x88bb('0x25')]===0x0)return[];return db['sequelize'][_0x88bb('0x3a')](_0xf6017a[_0x88bb('0x91')](),_0x3c0cb3)[_0x88bb('0x29')](function(_0x5a4697){_0x2e08d8=_[_0x88bb('0x92')](_0x5a4697,'id');_0x3c0cb3=_['merge'](_0x3c0cb3,{'model':db[_0x88bb('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x51deb7['query']['fields']){_0x29971c[_0x88bb('0x3f')][_0x88bb('0x32')](function(_0x3e2df8){_0xf3b75a[_0x88bb('0x45')]('i.'+_0x3e2df8);});}else{_0xf3b75a[_0x88bb('0x45')](_0x88bb('0x86'),_0x88bb('0x5e'));_0xf3b75a[_0x88bb('0x45')](_0x88bb('0x93'),'Account.key');_0xf3b75a['field'](_0x88bb('0x94'),'Account.mandatoryDisposition');_0xf3b75a['field'](_0x88bb('0x95'),_0x88bb('0x88'));_0xf3b75a[_0x88bb('0x45')]('i.*');_0xf3b75a[_0x88bb('0x45')](_0x88bb('0x96'),'Contact.firstName');_0xf3b75a[_0x88bb('0x45')]('c.lastName',_0x88bb('0x97'));_0xf3b75a[_0x88bb('0x45')](_0x88bb('0x98'),'Contact.email');_0xf3b75a['field'](_0x88bb('0x99'),_0x88bb('0x9a'));_0xf3b75a[_0x88bb('0x45')](_0x88bb('0x9b'),_0x88bb('0x9c'));_0xf3b75a[_0x88bb('0x45')](_0x88bb('0x9d'),_0x88bb('0x9e'));_0xf3b75a[_0x88bb('0x45')](_0x88bb('0x9f'),'Owner.fullname');_0xf3b75a['field'](_0x88bb('0xa0'),_0x88bb('0xa1'));_0xf3b75a[_0x88bb('0x45')](_0x88bb('0xa2'),_0x88bb('0x31'));}if(_0x29971c['limit'])_0xf3b75a['limit'](_0x29971c[_0x88bb('0x23')]);if(_0x29971c[_0x88bb('0x22')])_0xf3b75a[_0x88bb('0x22')](_0x29971c[_0x88bb('0x22')]);return db[_0x88bb('0x90')]['query'](_0xf3b75a['toString'](),_0x3c0cb3);})[_0x88bb('0x29')](function(_0x47242c){if(_0x47242c['length']>0x0)_0x202211[_0x88bb('0x41')](_0x88bb('0xa3'),_[_0x88bb('0x2f')](_0x47242c,'id'));return db[_0x88bb('0x90')][_0x88bb('0x3a')](_0x202211['toString'](),_0x3c0cb3)[_0x88bb('0x29')](function(_0x2cd6bc){var _0x47294a=_[_0x88bb('0xa4')](_0x2cd6bc,_0x88bb('0xa5'));var _0x1310eb=[];_0x47242c[_0x88bb('0x32')](function(_0x3946ad){_0x1310eb['push'](updateFaxInteraction(_0x3946ad,_0x2e08d8,_0x47294a));});return BPromise[_0x88bb('0xa6')](_0x1310eb);});});})[_0x88bb('0x29')](function(_0x305b75){_0x59933[_0x88bb('0xa7')]=_0x305b75;return _0x59933;})[_0x88bb('0x29')](respondWithFilteredResult(_0x282336,_0x29971c))[_0x88bb('0x35')](handleError(_0x282336,null));};exports[_0x88bb('0xa8')]=function(_0x25c74c,_0x241a83){var _0x351405={'raw':![],'where':{'id':_0x25c74c[_0x88bb('0xa9')]['id']}},_0x1a0596={};_0x1a0596[_0x88bb('0x3d')]=_['keys'](db[_0x88bb('0x37')][_0x88bb('0xaa')]);_0x1a0596[_0x88bb('0x3a')]=_['keys'](_0x25c74c[_0x88bb('0x3a')]);_0x1a0596[_0x88bb('0x42')]=_[_0x88bb('0x3c')](_0x1a0596[_0x88bb('0x3d')],_0x1a0596['query']);_0x351405['attributes']=_[_0x88bb('0x3c')](_0x1a0596['model'],qs[_0x88bb('0x3e')](_0x25c74c[_0x88bb('0x3a')][_0x88bb('0x3e')]));_0x351405[_0x88bb('0x3f')]=_0x351405[_0x88bb('0x3f')]['length']?_0x351405[_0x88bb('0x3f')]:_0x1a0596[_0x88bb('0x3d')];if(_0x25c74c[_0x88bb('0x3a')][_0x88bb('0xab')]){_0x351405[_0x88bb('0xac')]=[{'all':!![]}];}_0x351405=_['merge']({},_0x351405,_0x25c74c[_0x88bb('0xad')]);return db[_0x88bb('0x37')]['find'](_0x351405)[_0x88bb('0x29')](handleEntityNotFound(_0x241a83,null))['then'](respondWithResult(_0x241a83,null))['catch'](handleError(_0x241a83,null));};exports[_0x88bb('0xae')]=function(_0x44c0fc,_0x2c3fe6){return db[_0x88bb('0x37')][_0x88bb('0xae')](_0x44c0fc[_0x88bb('0x70')],{})['then'](respondWithResult(_0x2c3fe6,0xc9))['catch'](handleError(_0x2c3fe6,null));};exports[_0x88bb('0x28')]=function(_0x24bad8,_0x5097ab){if(_0x24bad8[_0x88bb('0x70')]['id']){delete _0x24bad8[_0x88bb('0x70')]['id'];}return db[_0x88bb('0x37')][_0x88bb('0x5d')]({'where':{'id':_0x24bad8[_0x88bb('0xa9')]['id']}})['then'](handleEntityNotFound(_0x5097ab,null))[_0x88bb('0x29')](saveUpdates(_0x24bad8['body'],null))[_0x88bb('0x29')](respondWithResult(_0x5097ab,null))[_0x88bb('0x35')](handleError(_0x5097ab,null));};exports[_0x88bb('0xaf')]=function(_0x1ceb04,_0x21383f){return db[_0x88bb('0x37')][_0x88bb('0x5d')]({'where':{'id':_0x1ceb04[_0x88bb('0xa9')]['id']}})[_0x88bb('0x29')](handleEntityNotFound(_0x21383f,null))[_0x88bb('0x29')](removeEntity(_0x21383f,null))[_0x88bb('0x35')](handleError(_0x21383f,null));};exports[_0x88bb('0xb0')]=function(_0x48415e,_0x56606c){return db[_0x88bb('0x37')]['describe']()[_0x88bb('0x29')](respondWithResult(_0x56606c,null))[_0x88bb('0x35')](handleError(_0x56606c,null));};exports['addMessage']=function(_0x6958b4,_0x29415f,_0x5cd205){return db['FaxMessage'][_0x88bb('0x5d')]({'where':{'id':_0x6958b4['params']['id']}})['then'](handleEntityNotFound(_0x29415f,null))[_0x88bb('0x29')](function(_0x32cfc6){if(_0x32cfc6){return _0x32cfc6[_0x88bb('0xb1')](_0x6958b4[_0x88bb('0x70')]['ids'],_['omit'](_0x6958b4[_0x88bb('0x70')],[_0x88bb('0xb2'),'id'])||{});}})[_0x88bb('0x29')](respondWithResult(_0x29415f,null))[_0x88bb('0x35')](handleError(_0x29415f,null));};exports[_0x88bb('0xb3')]=function(_0x5f3211,_0x851e1b,_0x5bfbdd){var _0x17aa77={'raw':![],'where':{}};var _0x432a02={};var _0x28fd7d={'count':0x0,'rows':[]};return db[_0x88bb('0x37')][_0x88bb('0xb4')]({'where':{'id':_0x5f3211[_0x88bb('0xa9')]['id']}})[_0x88bb('0x29')](handleEntityNotFound(_0x851e1b,null))['then'](function(_0x51f657){if(_0x51f657){_0x432a02[_0x88bb('0x3d')]=_[_0x88bb('0x3b')](db[_0x88bb('0xb5')][_0x88bb('0xaa')]);_0x432a02[_0x88bb('0x3a')]=_['keys'](_0x5f3211['query']);_0x432a02[_0x88bb('0x42')]=_[_0x88bb('0x3c')](_0x432a02[_0x88bb('0x3d')],_0x432a02[_0x88bb('0x3a')]);_0x17aa77['attributes']=_[_0x88bb('0x3c')](_0x432a02[_0x88bb('0x3d')],qs[_0x88bb('0x3e')](_0x5f3211['query'][_0x88bb('0x3e')]));_0x17aa77['attributes']=_0x17aa77[_0x88bb('0x3f')]['length']?_0x17aa77[_0x88bb('0x3f')]:_0x432a02[_0x88bb('0x3d')];if(!_0x5f3211[_0x88bb('0x3a')][_0x88bb('0xb6')]('nolimit')){_0x17aa77['limit']=qs[_0x88bb('0x23')](_0x5f3211['query'][_0x88bb('0x23')]);_0x17aa77['offset']=qs[_0x88bb('0x22')](_0x5f3211[_0x88bb('0x3a')][_0x88bb('0x22')]);}_0x17aa77['order']=qs[_0x88bb('0x40')](_0x5f3211[_0x88bb('0x3a')][_0x88bb('0x40')]);_0x17aa77[_0x88bb('0x41')]=qs[_0x88bb('0x42')](_[_0x88bb('0x43')](_0x5f3211[_0x88bb('0x3a')],_0x432a02[_0x88bb('0x42')]));_0x17aa77[_0x88bb('0x41')][_0x88bb('0xa5')]=_0x51f657['id'];if(_0x5f3211['query'][_0x88bb('0x7e')]){_0x17aa77[_0x88bb('0x41')]=_[_0x88bb('0xb7')](_0x17aa77[_0x88bb('0x41')],{'$or':_['map'](_0x17aa77[_0x88bb('0x3f')],function(_0x14094d){var _0x27ae34={};_0x27ae34[_0x14094d]={'$like':'%'+_0x5f3211[_0x88bb('0x3a')]['filter']+'%'};return _0x27ae34;})});}if(_0x5f3211[_0x88bb('0x3a')][_0x88bb('0xb8')]){var _0x47e549=_0x5f3211[_0x88bb('0x3a')]['$gte'][_0x88bb('0xb9')](',');var _0x27c505={};_0x27c505[_0x47e549[0x0]]={'$gte':moment(_0x47e549[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x17aa77['where']=_[_0x88bb('0xb7')](_0x17aa77[_0x88bb('0x41')],_0x27c505);}_0x17aa77=_['merge']({},_0x17aa77,_0x5f3211[_0x88bb('0xad')]);return db[_0x88bb('0xb5')][_0x88bb('0x25')]({'where':_0x17aa77[_0x88bb('0x41')]})[_0x88bb('0x29')](function(_0x5e9378){_0x28fd7d[_0x88bb('0x25')]=_0x5e9378;if(_0x5f3211['query']['includeAll']){_0x17aa77['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x17aa77);})['then'](function(_0x283606){_0x28fd7d[_0x88bb('0xa7')]=_0x283606;return _0x28fd7d;});}})['then'](respondWithFilteredResult(_0x851e1b,_0x17aa77))[_0x88bb('0x35')](handleError(_0x851e1b,null));};exports[_0x88bb('0xba')]=function(_0x4e1261,_0x1f125f,_0xc68c35){return db[_0x88bb('0x37')][_0x88bb('0x5d')]({'where':{'id':_0x4e1261[_0x88bb('0xa9')]['id']}})[_0x88bb('0x29')](handleEntityNotFound(_0x1f125f,null))[_0x88bb('0x29')](function(_0x22d0ef){if(_0x22d0ef){return _0x22d0ef['setTags'](_0x4e1261[_0x88bb('0x70')][_0x88bb('0xb2')],_[_0x88bb('0xbb')](_0x4e1261[_0x88bb('0x70')],[_0x88bb('0xb2'),'id'])||{})[_0x88bb('0xbc')](function(){return db[_0x88bb('0x6c')][_0x88bb('0xbd')]({'attributes':['id','name',_0x88bb('0x46')],'where':{'id':_0x4e1261[_0x88bb('0x70')]['ids']}});})[_0x88bb('0x29')](function(_0x305e79){socket[_0x88bb('0xbe')](_0x88bb('0xbf'),{'id':Number(_0x4e1261[_0x88bb('0xa9')]['id']),'tags':_0x305e79||[]});return{'id':Number(_0x4e1261['params']['id']),'tags':_0x305e79||[]};});}})[_0x88bb('0x29')](respondWithResult(_0x1f125f,null))[_0x88bb('0x35')](handleError(_0x1f125f,null));};exports[_0x88bb('0xc0')]=function(_0x51e40,_0x59574b,_0x2aa712){return db[_0x88bb('0x37')][_0x88bb('0x5d')]({'where':{'id':_0x51e40[_0x88bb('0xa9')]['id']}})['then'](handleEntityNotFound(_0x59574b,null))[_0x88bb('0x29')](function(_0x4304de){if(_0x4304de){return _0x4304de[_0x88bb('0xc0')](_0x51e40[_0x88bb('0x3a')][_0x88bb('0xb2')]);}})[_0x88bb('0x29')](respondWithStatusCode(_0x59574b,null))[_0x88bb('0x35')](handleError(_0x59574b,null));};exports['download']=function(_0x16c9b2,_0x5d6455){var _0x583ebc=moment()[_0x88bb('0xc1')]()['toString']();var _0x3022cd=path[_0x88bb('0xc2')](config['root'],_0x88bb('0xc3'),_0x88bb('0xc4'),_0x88bb('0xc5'));var _0x1086e1=path['join'](config[_0x88bb('0xc6')],_0x88bb('0xc3'),_0x88bb('0xc4'),'attachments');var _0x5ea80b=path[_0x88bb('0xc2')](_0x3022cd,_0x583ebc);var _0x1d29fa=util['format']('transcript-%d-%s.zip',_0x16c9b2[_0x88bb('0xa9')]['id'],_0x583ebc);var _0x50eca6=path[_0x88bb('0xc2')](_0x3022cd,_0x1d29fa);var _0x2309d4=[];_0x2309d4['push']({'model':db[_0x88bb('0xc7')],'as':_0x88bb('0xc7'),'raw':!![]});var _0x210d0c=[{'model':db[_0x88bb('0xb5')],'as':_0x88bb('0xc8'),'attributes':['id',_0x88bb('0x70'),'createdAt'],'include':_0x2309d4}];return db[_0x88bb('0x37')][_0x88bb('0x5d')]({'where':{'id':_0x16c9b2[_0x88bb('0xa9')]['id']},'include':_0x210d0c})[_0x88bb('0x29')](handleEntityNotFound(_0x5d6455,null))[_0x88bb('0x29')](function(_0x1693ff){if(_0x1693ff&&_0x1693ff[_0x88bb('0xc8')]){var _0x4559d9=_0x1693ff[_0x88bb('0xc9')]({'plain':!![]});fs['mkdirSync'](_0x5ea80b);for(var _0x53967b=0x0;_0x53967b<_0x4559d9[_0x88bb('0xc8')][_0x88bb('0x5b')];_0x53967b++){var _0x2122dc=_0x4559d9[_0x88bb('0xc8')][_0x53967b][_0x88bb('0xc7')];if(_0x2122dc){var _0x4c3633=path[_0x88bb('0xc2')](_0x1086e1,_0x2122dc[_0x88bb('0xca')]);if(fs[_0x88bb('0xcb')](_0x4c3633)){fs[_0x88bb('0xcc')](_0x4c3633)['pipe'](fs[_0x88bb('0xcd')](path['join'](_0x5ea80b,_0x2122dc[_0x88bb('0xca')])));}}}return BPromise[_0x88bb('0x8a')]()['then'](function(){return new BPromise(function(_0xb03b46,_0x4cf367){zipdir(_0x5ea80b,{'saveTo':_0x50eca6},function(_0x2c1d8d,_0x1ce344){if(_0x2c1d8d)return _0x4cf367(_0x2c1d8d);return _0xb03b46(_0x1ce344);});})[_0x88bb('0x29')](function(){return new BPromise(function(_0x29effc,_0x15daa0){rimraf(_0x5ea80b,function(_0x29133a){if(_0x29133a)_0x15daa0(_0x29133a);return _0x29effc();});});})[_0x88bb('0x29')](function(){return _0x5d6455['download'](_0x50eca6,_0x1d29fa,function(_0x276e73){if(_0x276e73){console['log']('err',_0x276e73);}else{fs[_0x88bb('0xce')](_0x50eca6);}});});});}else{return _0x5d6455[_0x88bb('0x1e')](0xc8);}})[_0x88bb('0x35')](handleError(_0x5d6455,null));}; \ No newline at end of file +var _0x955e=['jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','catch','index','FaxInteraction','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','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_accounts','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','length','conditions','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?','find','ContactId','buildExpression','text','Tag','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','start','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','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','contactName','i.*','c.firstName','c.lastName','Contact.lastName','c.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.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','show','rawAttributes','include','options','create','body','describe','addMessage','FaxMessage','params','ids','omit','findOne','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','setTags','spread','findAll','emit','faxInteractionTags:save','removeTags','download','unix','join','server','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','createReadStream','createWriteStream','log','err','unlinkSync','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x3a3fea,_0x52394f){var _0x1a427a=function(_0x714027){while(--_0x714027){_0x3a3fea['push'](_0x3a3fea['shift']());}};_0x1a427a(++_0x52394f);}(_0x955e,0xca));var _0xe955=function(_0x91d019,_0x5223c4){_0x91d019=_0x91d019-0x0;var _0x19de1f=_0x955e[_0x91d019];return _0x19de1f;};'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(_0xe955('0x0'));var moment=require(_0xe955('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xe955('0x2'));var util=require('util');var path=require('path');var sox=require(_0xe955('0x3'));var csv=require(_0xe955('0x4'));var ejs=require(_0xe955('0x5'));var fs=require('fs');var fs_extra=require(_0xe955('0x6'));var _=require('lodash');var squel=require(_0xe955('0x7'));var crypto=require(_0xe955('0x8'));var jsforce=require(_0xe955('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe955('0xa'));var Papa=require(_0xe955('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe955('0xc'));var as=require(_0xe955('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe955('0xe'))(_0xe955('0xf'));var utils=require(_0xe955('0x10'));var config=require(_0xe955('0x11'));var licenseUtil=require(_0xe955('0x12'));var db=require(_0xe955('0x13'))['db'];config[_0xe955('0x14')]=_[_0xe955('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe955('0x14')]));require(_0xe955('0x16'))[_0xe955('0x17')](socket);function respondWithStatusCode(_0x6b64d8,_0x563bd7){_0x563bd7=_0x563bd7||0xcc;return function(_0x16e35b){if(_0x16e35b){return _0x6b64d8[_0xe955('0x18')](_0x563bd7);}return _0x6b64d8[_0xe955('0x19')](_0x563bd7)[_0xe955('0x1a')]();};}function respondWithResult(_0x5bff95,_0x1147f9){_0x1147f9=_0x1147f9||0xc8;return function(_0x5b0e5a){if(_0x5b0e5a){return _0x5bff95['status'](_0x1147f9)[_0xe955('0x1b')](_0x5b0e5a);}};}function respondWithFilteredResult(_0xc3badc,_0x49d830){return function(_0x4ad077){if(_0x4ad077){var _0x146b8c=typeof _0x49d830[_0xe955('0x1c')]===_0xe955('0x1d')&&typeof _0x49d830[_0xe955('0x1e')]===_0xe955('0x1d');var _0x27df16=_0x4ad077[_0xe955('0x1f')];var _0x2e8af6=_0x146b8c?0x0:_0x49d830[_0xe955('0x1c')];var _0x7e819a=_0x146b8c?_0x4ad077[_0xe955('0x1f')]:_0x49d830[_0xe955('0x1c')]+_0x49d830[_0xe955('0x1e')];var _0x2853c3;if(_0x7e819a>=_0x27df16){_0x7e819a=_0x27df16;_0x2853c3=0xc8;}else{_0x2853c3=0xce;}_0xc3badc[_0xe955('0x19')](_0x2853c3);return _0xc3badc[_0xe955('0x20')](_0xe955('0x21'),_0x2e8af6+'-'+_0x7e819a+'/'+_0x27df16)[_0xe955('0x1b')](_0x4ad077);}return null;};}function patchUpdates(_0x28c140){return function(_0x3739f1){try{jsonpatch[_0xe955('0x22')](_0x3739f1,_0x28c140,!![]);}catch(_0x507f17){return BPromise[_0xe955('0x23')](_0x507f17);}return _0x3739f1[_0xe955('0x24')]();};}function saveUpdates(_0x272c39,_0x8140a1){return function(_0x3d6084){if(_0x3d6084){return _0x3d6084[_0xe955('0x25')](_0x272c39)['then'](function(_0x184203){return _0x184203;});}return null;};}function removeEntity(_0x3be69b,_0x2ca420){return function(_0x11900d){if(_0x11900d){return _0x11900d[_0xe955('0x26')]()[_0xe955('0x27')](function(){_0x3be69b[_0xe955('0x19')](0xcc)[_0xe955('0x1a')]();});}};}function handleEntityNotFound(_0xd195c7,_0x4b3d88){return function(_0x441f05){if(!_0x441f05){_0xd195c7['sendStatus'](0x194);}return _0x441f05;};}function handleError(_0x519a62,_0x645f69){_0x645f69=_0x645f69||0x1f4;return function(_0x5dd46f){logger[_0xe955('0x28')](_0x5dd46f[_0xe955('0x29')]);if(_0x5dd46f[_0xe955('0x2a')]){delete _0x5dd46f[_0xe955('0x2a')];}_0x519a62[_0xe955('0x19')](_0x645f69)[_0xe955('0x2b')](_0x5dd46f);};}function getInteractionUsers(_0x16c751,_0x43b56d){return new BPromise(function(_0x3b76e0,_0x3eddc1){try{if(_0x43b56d[_0x16c751['id']]){_0x16c751['Users']=_[_0xe955('0x2c')](_0x43b56d[_0x16c751['id']],function(_0x494e9d){return{'id':_0x494e9d['id'],'fullname':_0x494e9d[_0xe955('0x2d')]};});}}catch(_0xb7df28){_0x3eddc1(_0xb7df28);}_0x3b76e0(_0x16c751);});}function getInteractionTags(_0x4f32ce,_0x10c238){return new BPromise(function(_0x2b0714,_0x5a48e4){try{if(_0x4f32ce[_0xe955('0x2e')]){_0x4f32ce[_0xe955('0x2f')]=[];_0x4f32ce[_0xe955('0x2e')][_0xe955('0x30')](',')[_0xe955('0x31')](function(_0x2b662e){_0x4f32ce[_0xe955('0x2f')][_0xe955('0x32')](_0x10c238[_0x2b662e]);});}delete _0x4f32ce[_0xe955('0x2e')];}catch(_0x313c6d){_0x5a48e4(_0x313c6d);}_0x2b0714(_0x4f32ce);});}function updateFaxInteraction(_0x53b4dd,_0x125040,_0x4cf247){return new BPromise(function(_0x3f18fe,_0x4ace61){return getInteractionUsers(_0x53b4dd,_0x4cf247)[_0xe955('0x27')](function(_0x2bcc50){return getInteractionTags(_0x2bcc50,_0x125040);})['then'](function(_0x46badd){_0x3f18fe(_0x46badd);})[_0xe955('0x33')](function(_0x48ac01){_0x4ace61(_0x48ac01);});});}exports[_0xe955('0x34')]=function(_0x10ca08,_0x436a3b){var _0x5c2b83={},_0x1cbd0e={},_0x2459fb={'count':0x0,'rows':[]};var _0x309bc1=_['map'](db[_0xe955('0x35')]['rawAttributes'],function(_0x10259c){return{'name':_0x10259c[_0xe955('0x36')],'type':_0x10259c['type'][_0xe955('0x37')]};});_0x1cbd0e[_0xe955('0x38')]=_['map'](_0x309bc1,_0xe955('0x2a'));_0x1cbd0e[_0xe955('0x39')]=_[_0xe955('0x3a')](_0x10ca08[_0xe955('0x39')]);_0x1cbd0e[_0xe955('0x3b')]=_['intersection'](_0x1cbd0e[_0xe955('0x38')],_0x1cbd0e[_0xe955('0x39')]);_0x5c2b83[_0xe955('0x3c')]=_[_0xe955('0x3d')](_0x1cbd0e['model'],qs[_0xe955('0x3e')](_0x10ca08[_0xe955('0x39')]['fields']));_0x5c2b83[_0xe955('0x3c')]=_0x5c2b83[_0xe955('0x3c')]['length']?_0x5c2b83[_0xe955('0x3c')]:_0x1cbd0e[_0xe955('0x38')];if(!_0x10ca08[_0xe955('0x39')][_0xe955('0x3f')](_0xe955('0x40'))){_0x5c2b83[_0xe955('0x1e')]=qs[_0xe955('0x1e')](_0x10ca08[_0xe955('0x39')][_0xe955('0x1e')]);_0x5c2b83[_0xe955('0x1c')]=qs[_0xe955('0x1c')](_0x10ca08[_0xe955('0x39')]['offset']);}_0x5c2b83[_0xe955('0x41')]=qs[_0xe955('0x42')](_0x10ca08['query'][_0xe955('0x42')]);_0x5c2b83[_0xe955('0x43')]=qs[_0xe955('0x3b')](_[_0xe955('0x44')](_0x10ca08[_0xe955('0x39')],_0x1cbd0e[_0xe955('0x3b')]),_0x309bc1);var _0x35b2d0=[];var _0xae0709=squel[_0xe955('0x45')]()[_0xe955('0x46')]('id')[_0xe955('0x46')](_0xe955('0x2a'))[_0xe955('0x46')](_0xe955('0x47'))[_0xe955('0x48')]('tools_tags');var _0x30f13b=squel[_0xe955('0x45')]()['field']('u.id')[_0xe955('0x46')]('u.fullname')['field'](_0xe955('0x49'))[_0xe955('0x48')](_0xe955('0x4a'),'ui')[_0xe955('0x4b')](_0xe955('0x4c'),'u',_0xe955('0x4d'));var _0x5c63b0=squel[_0xe955('0x45')]()[_0xe955('0x48')](_0xe955('0x4e'),'i')[_0xe955('0x4b')](_0xe955('0x4f'),'c',_0xe955('0x50'))['left_join'](_0xe955('0x4c'),'o',_0xe955('0x51'))[_0xe955('0x4b')](_0xe955('0x52'),'a','a.id\x20=\x20i.FaxAccountId')[_0xe955('0x4b')]('fax_messages','me',_0xe955('0x53'))[_0xe955('0x4b')](_0xe955('0x54'),'it','it.FaxInteractionId\x20=\x20i.id')[_0xe955('0x4b')](_0xe955('0x55'),'t',_0xe955('0x56'));var _0x1a26f8=squel['expr']();var _0x3f4fa0=[];var _0x34286b=squel[_0xe955('0x57')]();var _0x18844d;if(_0x10ca08[_0xe955('0x39')][_0xe955('0x58')]){_0x18844d=as['parseSearch'](_0x10ca08[_0xe955('0x39')][_0xe955('0x58')]);var _0x253329=_0x18844d[_0xe955('0x59')];for(var _0x21a8bc=0x0;_0x21a8bc<_0x18844d['conditions'][_0xe955('0x5a')];_0x21a8bc++){var _0x55ca19=_0x18844d[_0xe955('0x5b')][_0x21a8bc];var _0x593c9d='i';var _0x4549de=_['find'](_0x309bc1,['name',_0x55ca19[_0xe955('0x46')]]);if(!_0x4549de){switch(_0x55ca19[_0xe955('0x46')]){case _0xe955('0x5c'):if(_0x55ca19[_0xe955('0x5d')]==0x1){_0x5c63b0[_0xe955('0x5e')]('`'+_0x55ca19['field']+_0xe955('0x5f'));}else{_0x5c63b0[_0xe955('0x5e')]('`'+_0x55ca19[_0xe955('0x46')]+_0xe955('0x60'));}break;case _0xe955('0x61'):if(_0x55ca19[_0xe955('0x62')]===_0xe955('0x63')){if(_0x55ca19[_0xe955('0x5d')][_0xe955('0x30')]('\x20')[_0xe955('0x5a')]>0x1){_0x1a26f8[_0x253329](_0xe955('0x64'),qs[_0xe955('0x65')](_0x55ca19[_0xe955('0x5d')]),null);}else{var _0x549eed='%'+_0x55ca19[_0xe955('0x5d')]+'%';_0x1a26f8[_0x253329](_0xe955('0x66'),_0x549eed,_0x549eed,_0x549eed);}}else{_0x4549de=_[_0xe955('0x67')](_0x309bc1,[_0xe955('0x2a'),_0xe955('0x68')]);_0x55ca19['field']=_0xe955('0x68');_0x4ce2ab=as[_0xe955('0x69')](_0x593c9d,_0x4549de['type'],_0x55ca19);_0x1a26f8[_0x253329](_0x4ce2ab[_0xe955('0x6a')],_0x4ce2ab[_0xe955('0x5d')]['start'],_0x4ce2ab[_0xe955('0x5d')][_0xe955('0x1a')]);}break;case _0xe955('0x6b'):var _0x24f0e2=_0x55ca19[_0xe955('0x5d')][_0xe955('0x30')](',')[_0xe955('0x2c')](function(_0x505e4d){return Number(_0x505e4d);});_0x24f0e2[_0xe955('0x31')](function(_0x2061cd){_0x34286b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2061cd+',%');});_0x3f4fa0=_['union'](_0x3f4fa0,_0x24f0e2);break;case'User':if(_0x55ca19[_0xe955('0x62')]==='$substring'){_0x1a26f8[_0x253329](_0xe955('0x6c'),'%'+_0x55ca19[_0xe955('0x5d')]+'%',null);}else{_0x4549de=_[_0xe955('0x67')](_0x309bc1,['name',_0xe955('0x6d')]);_0x55ca19['field']=_0xe955('0x6d');_0x4ce2ab=as[_0xe955('0x69')](_0x593c9d,_0x4549de[_0xe955('0x6e')],_0x55ca19);_0x1a26f8[_0x253329](_0x4ce2ab[_0xe955('0x6a')],_0x4ce2ab['value'][_0xe955('0x6f')],_0x4ce2ab['value'][_0xe955('0x1a')]);}break;case'body':_0x4ce2ab=as[_0xe955('0x69')]('me',null,_0x55ca19);_0x1a26f8[_0x253329](_0x4ce2ab[_0xe955('0x6a')],_0x4ce2ab[_0xe955('0x5d')][_0xe955('0x6f')],_0x4ce2ab['value'][_0xe955('0x1a')]);break;}}else{var _0x4ce2ab=as[_0xe955('0x69')](_0x593c9d,_0x4549de[_0xe955('0x6e')],_0x55ca19);_0x1a26f8[_0x253329](_0x4ce2ab[_0xe955('0x6a')],_0x4ce2ab[_0xe955('0x5d')]['start'],_0x4ce2ab[_0xe955('0x5d')][_0xe955('0x1a')]);}}}else{var _0x253db4=_(_0x10ca08[_0xe955('0x39')])['keys']()['map'](function(_0x18a8ce){return _['some'](_0x309bc1,[_0xe955('0x2a'),_0x18a8ce])?_0x18a8ce:undefined;})['compact']()[_0xe955('0x5d')]();if(!_[_0xe955('0x70')](_0x253db4)){_0x253db4[_0xe955('0x31')](function(_0x527215){if(_0x527215===_0xe955('0x71')){_0x5c63b0['where'](_0xe955('0x72'),[]['concat'](_0x10ca08[_0xe955('0x39')][_0x527215]));}else if(_0x527215===_0xe955('0x73')){var _0x205bf8=JSON[_0xe955('0x74')](_0x10ca08[_0xe955('0x39')][_0x527215])[_0xe955('0x75')];var _0x441b2d=JSON[_0xe955('0x74')](_0x10ca08[_0xe955('0x39')][_0x527215])[_0xe955('0x76')];_0x5c63b0[_0xe955('0x43')](_0xe955('0x77'),_0x205bf8,_0x441b2d);}else{if(_0x10ca08[_0xe955('0x39')][_0x527215]===_0xe955('0x78')){_0x5c63b0[_0xe955('0x43')]('i.'+_0x527215+'\x20IS\x20NULL');}else{_0x5c63b0[_0xe955('0x43')]('i.'+_0x527215+_0xe955('0x79'),_0x10ca08[_0xe955('0x39')][_0x527215]);}}});}if(_0x10ca08[_0xe955('0x39')][_0xe955('0x7a')]){if(_0x10ca08[_0xe955('0x39')][_0xe955('0x7a')]==0x1){_0x5c63b0[_0xe955('0x5e')](_0xe955('0x7b'));}else{_0x5c63b0[_0xe955('0x5e')](_0xe955('0x7c'));}}if(_0x10ca08[_0xe955('0x39')][_0xe955('0x7d')]){_0x3f4fa0=_['isArray'](_0x10ca08[_0xe955('0x39')][_0xe955('0x7d')])?_0x10ca08[_0xe955('0x39')]['tag']:new Array(_0x10ca08[_0xe955('0x39')][_0xe955('0x7d')]);_0x3f4fa0[_0xe955('0x31')](function(_0x1d688e){_0x34286b['or'](_0xe955('0x7e'),'%,'+_0x1d688e+',%');});}if(_0x10ca08['query'][_0xe955('0x7f')]){var _0x394d3c=_0x10ca08[_0xe955('0x39')][_0xe955('0x7f')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x394d3c)){_0x1a26f8['or'](_0xe955('0x80'),_0x394d3c+'%')['or'](_0xe955('0x81'),_0x394d3c+'%');}_0x1a26f8['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x394d3c+'%');}}_0x5c63b0[_0xe955('0x43')](_0x1a26f8);_0x5c63b0[_0xe955('0x82')](_0xe955('0x83'));var _0x5df64d={'type':db[_0xe955('0x84')]['QueryTypes'][_0xe955('0x85')],'raw':!![]};var _0x49dd68=_0x5c63b0[_0xe955('0x86')]();_0x49dd68['field'](_0xe955('0x83'));_0x49dd68[_0xe955('0x46')](_0xe955('0x87'),_0xe955('0x5c'));if(_0x5c2b83[_0xe955('0x41')]){_0x5c2b83[_0xe955('0x41')][_0xe955('0x31')](function(_0x896f61){var _0xfb67fc=_0x896f61[0x0]==='contactName'?_0x896f61[0x0]:'i.'+_0x896f61[0x0];_0x5c63b0[_0xe955('0x41')](_0xfb67fc,_0x896f61[0x1]===_0xe955('0x88')?![]:!![]);});}if(!_['isEmpty'](_0x3f4fa0)){_0x5c63b0[_0xe955('0x5e')](_0x34286b);_0x49dd68['where'](_0xe955('0x89'),_0x3f4fa0);}BPromise[_0xe955('0x8a')]()[_0xe955('0x27')](function(){if(!_0x18844d){if(_0x10ca08[_0xe955('0x39')][_0xe955('0x71')])return;_0x49dd68[_0xe955('0x43')](_0xe955('0x8b'));_0x5c63b0[_0xe955('0x43')](_0xe955('0x8b'));return;}if(_0x10ca08[_0xe955('0x8c')][_0xe955('0x8d')]!==_0xe955('0x8e'))return;return _0x10ca08[_0xe955('0x8c')][_0xe955('0x8f')]({'attributes':['id'],'raw':!![]})[_0xe955('0x27')](function(_0x8fd6d9){if(_[_0xe955('0x70')](_0x8fd6d9)){_0x49dd68[_0xe955('0x43')]('i.FaxAccountId\x20IS\x20NULL');_0x5c63b0['where'](_0xe955('0x90'));}else{_0x49dd68[_0xe955('0x43')](_0xe955('0x72'),_[_0xe955('0x2c')](_0x8fd6d9,'id'));_0x5c63b0['where']('i.FaxAccountId\x20IN\x20?',_[_0xe955('0x2c')](_0x8fd6d9,'id'));}});})[_0xe955('0x27')](function(){if(_0x10ca08[_0xe955('0x8c')][_0xe955('0x8d')]===_0xe955('0x8e')&&!_0x18844d&&!_0x10ca08[_0xe955('0x39')][_0xe955('0x71')])return[];return db[_0xe955('0x91')][_0xe955('0x39')](_0x49dd68[_0xe955('0x92')](),_0x5df64d);})[_0xe955('0x27')](function(_0x7008b8){_0x2459fb[_0xe955('0x1f')]=_0x7008b8[_0xe955('0x5a')];if(_0x2459fb[_0xe955('0x1f')]===0x0)return[];return db[_0xe955('0x91')][_0xe955('0x39')](_0xae0709['toString'](),_0x5df64d)['then'](function(_0x397e59){_0x35b2d0=_[_0xe955('0x93')](_0x397e59,'id');_0x5df64d=_[_0xe955('0x94')](_0x5df64d,{'model':db[_0xe955('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x10ca08[_0xe955('0x39')][_0xe955('0x3e')]){_0x5c2b83[_0xe955('0x3c')]['forEach'](function(_0x5657cd){_0x5c63b0[_0xe955('0x46')]('i.'+_0x5657cd);});}else{_0x5c63b0['field'](_0xe955('0x87'),_0xe955('0x5c'));_0x5c63b0[_0xe955('0x46')](_0xe955('0x95'),'Account.key');_0x5c63b0[_0xe955('0x46')]('a.mandatoryDisposition',_0xe955('0x96'));_0x5c63b0['field'](_0xe955('0x97'),_0xe955('0x98'));_0x5c63b0[_0xe955('0x46')](_0xe955('0x99'));_0x5c63b0[_0xe955('0x46')](_0xe955('0x9a'),'Contact.firstName');_0x5c63b0['field'](_0xe955('0x9b'),_0xe955('0x9c'));_0x5c63b0[_0xe955('0x46')](_0xe955('0x9d'),'Contact.email');_0x5c63b0['field'](_0xe955('0x9e'),_0xe955('0x9f'));_0x5c63b0[_0xe955('0x46')](_0xe955('0xa0'),'Contact.mobile');_0x5c63b0[_0xe955('0x46')](_0xe955('0xa1'),_0xe955('0xa2'));_0x5c63b0[_0xe955('0x46')](_0xe955('0xa3'),_0xe955('0xa4'));_0x5c63b0[_0xe955('0x46')](_0xe955('0xa5'),_0xe955('0xa6'));_0x5c63b0['field'](_0xe955('0xa7'),_0xe955('0x2e'));}if(_0x5c2b83[_0xe955('0x1e')])_0x5c63b0[_0xe955('0x1e')](_0x5c2b83[_0xe955('0x1e')]);if(_0x5c2b83[_0xe955('0x1c')])_0x5c63b0[_0xe955('0x1c')](_0x5c2b83[_0xe955('0x1c')]);return db[_0xe955('0x91')][_0xe955('0x39')](_0x5c63b0['toString'](),_0x5df64d);})[_0xe955('0x27')](function(_0xd11549){if(_0xd11549['length']>0x0)_0x30f13b[_0xe955('0x43')](_0xe955('0xa8'),_[_0xe955('0x2c')](_0xd11549,'id'));return db[_0xe955('0x91')][_0xe955('0x39')](_0x30f13b[_0xe955('0x92')](),_0x5df64d)[_0xe955('0x27')](function(_0x419d9a){var _0xa2ba17=_[_0xe955('0xa9')](_0x419d9a,_0xe955('0xaa'));var _0x1bab03=[];_0xd11549[_0xe955('0x31')](function(_0x2435dd){_0x1bab03['push'](updateFaxInteraction(_0x2435dd,_0x35b2d0,_0xa2ba17));});return BPromise[_0xe955('0xab')](_0x1bab03);});});})[_0xe955('0x27')](function(_0x1ec614){_0x2459fb['rows']=_0x1ec614;return _0x2459fb;})[_0xe955('0x27')](respondWithFilteredResult(_0x436a3b,_0x5c2b83))['catch'](handleError(_0x436a3b,null));};exports[_0xe955('0xac')]=function(_0x57b316,_0x37e8bc){var _0x31ab70={'raw':![],'where':{'id':_0x57b316['params']['id']}},_0x2fc36e={};_0x2fc36e[_0xe955('0x38')]=_[_0xe955('0x3a')](db['FaxInteraction'][_0xe955('0xad')]);_0x2fc36e['query']=_[_0xe955('0x3a')](_0x57b316[_0xe955('0x39')]);_0x2fc36e[_0xe955('0x3b')]=_[_0xe955('0x3d')](_0x2fc36e['model'],_0x2fc36e[_0xe955('0x39')]);_0x31ab70[_0xe955('0x3c')]=_[_0xe955('0x3d')](_0x2fc36e[_0xe955('0x38')],qs[_0xe955('0x3e')](_0x57b316[_0xe955('0x39')][_0xe955('0x3e')]));_0x31ab70[_0xe955('0x3c')]=_0x31ab70[_0xe955('0x3c')][_0xe955('0x5a')]?_0x31ab70[_0xe955('0x3c')]:_0x2fc36e[_0xe955('0x38')];if(_0x57b316[_0xe955('0x39')]['includeAll']){_0x31ab70[_0xe955('0xae')]=[{'all':!![]}];}_0x31ab70=_[_0xe955('0x94')]({},_0x31ab70,_0x57b316[_0xe955('0xaf')]);return db[_0xe955('0x35')][_0xe955('0x67')](_0x31ab70)['then'](handleEntityNotFound(_0x37e8bc,null))[_0xe955('0x27')](respondWithResult(_0x37e8bc,null))[_0xe955('0x33')](handleError(_0x37e8bc,null));};exports[_0xe955('0xb0')]=function(_0x2810a0,_0xc9dc49){return db['FaxInteraction'][_0xe955('0xb0')](_0x2810a0[_0xe955('0xb1')],{})[_0xe955('0x27')](respondWithResult(_0xc9dc49,0xc9))[_0xe955('0x33')](handleError(_0xc9dc49,null));};exports[_0xe955('0x25')]=function(_0x10166d,_0x11e29d){if(_0x10166d['body']['id']){delete _0x10166d['body']['id'];}return db[_0xe955('0x35')][_0xe955('0x67')]({'where':{'id':_0x10166d['params']['id']}})['then'](handleEntityNotFound(_0x11e29d,null))[_0xe955('0x27')](saveUpdates(_0x10166d['body'],null))[_0xe955('0x27')](respondWithResult(_0x11e29d,null))[_0xe955('0x33')](handleError(_0x11e29d,null));};exports['destroy']=function(_0x5b07f1,_0x45d849){return db[_0xe955('0x35')][_0xe955('0x67')]({'where':{'id':_0x5b07f1['params']['id']}})[_0xe955('0x27')](handleEntityNotFound(_0x45d849,null))[_0xe955('0x27')](removeEntity(_0x45d849,null))[_0xe955('0x33')](handleError(_0x45d849,null));};exports[_0xe955('0xb2')]=function(_0xf8965d,_0x456aa7){return db['FaxInteraction'][_0xe955('0xb2')]()[_0xe955('0x27')](respondWithResult(_0x456aa7,null))[_0xe955('0x33')](handleError(_0x456aa7,null));};exports[_0xe955('0xb3')]=function(_0x41fbb7,_0x19b217,_0x46e233){return db[_0xe955('0xb4')][_0xe955('0x67')]({'where':{'id':_0x41fbb7[_0xe955('0xb5')]['id']}})[_0xe955('0x27')](handleEntityNotFound(_0x19b217,null))[_0xe955('0x27')](function(_0x1bef69){if(_0x1bef69){return _0x1bef69['addMessage'](_0x41fbb7[_0xe955('0xb1')][_0xe955('0xb6')],_[_0xe955('0xb7')](_0x41fbb7['body'],[_0xe955('0xb6'),'id'])||{});}})[_0xe955('0x27')](respondWithResult(_0x19b217,null))[_0xe955('0x33')](handleError(_0x19b217,null));};exports['getMessages']=function(_0x357ca9,_0x363372,_0x49aad8){var _0x4e216d={'raw':![],'where':{}};var _0x5a1026={};var _0x1af9db={'count':0x0,'rows':[]};return db[_0xe955('0x35')][_0xe955('0xb8')]({'where':{'id':_0x357ca9[_0xe955('0xb5')]['id']}})['then'](handleEntityNotFound(_0x363372,null))['then'](function(_0x2cc513){if(_0x2cc513){_0x5a1026[_0xe955('0x38')]=_['keys'](db[_0xe955('0xb4')][_0xe955('0xad')]);_0x5a1026[_0xe955('0x39')]=_[_0xe955('0x3a')](_0x357ca9['query']);_0x5a1026[_0xe955('0x3b')]=_[_0xe955('0x3d')](_0x5a1026[_0xe955('0x38')],_0x5a1026[_0xe955('0x39')]);_0x4e216d[_0xe955('0x3c')]=_[_0xe955('0x3d')](_0x5a1026[_0xe955('0x38')],qs[_0xe955('0x3e')](_0x357ca9['query'][_0xe955('0x3e')]));_0x4e216d[_0xe955('0x3c')]=_0x4e216d[_0xe955('0x3c')][_0xe955('0x5a')]?_0x4e216d[_0xe955('0x3c')]:_0x5a1026[_0xe955('0x38')];if(!_0x357ca9[_0xe955('0x39')][_0xe955('0x3f')]('nolimit')){_0x4e216d[_0xe955('0x1e')]=qs['limit'](_0x357ca9[_0xe955('0x39')][_0xe955('0x1e')]);_0x4e216d[_0xe955('0x1c')]=qs[_0xe955('0x1c')](_0x357ca9[_0xe955('0x39')][_0xe955('0x1c')]);}_0x4e216d[_0xe955('0x41')]=qs[_0xe955('0x42')](_0x357ca9[_0xe955('0x39')][_0xe955('0x42')]);_0x4e216d['where']=qs[_0xe955('0x3b')](_['pick'](_0x357ca9[_0xe955('0x39')],_0x5a1026[_0xe955('0x3b')]));_0x4e216d[_0xe955('0x43')][_0xe955('0xaa')]=_0x2cc513['id'];if(_0x357ca9[_0xe955('0x39')][_0xe955('0x7f')]){_0x4e216d[_0xe955('0x43')]=_[_0xe955('0x94')](_0x4e216d[_0xe955('0x43')],{'$or':_[_0xe955('0x2c')](_0x4e216d[_0xe955('0x3c')],function(_0x263f62){var _0x2c8247={};_0x2c8247[_0x263f62]={'$like':'%'+_0x357ca9['query'][_0xe955('0x7f')]+'%'};return _0x2c8247;})});}if(_0x357ca9[_0xe955('0x39')][_0xe955('0x75')]){var _0x1a9069=_0x357ca9['query']['$gte'][_0xe955('0x30')](',');var _0x6248a1={};_0x6248a1[_0x1a9069[0x0]]={'$gte':moment(_0x1a9069[0x1])[_0xe955('0xb9')](_0xe955('0xba'))};_0x4e216d['where']=_[_0xe955('0x94')](_0x4e216d[_0xe955('0x43')],_0x6248a1);}_0x4e216d=_[_0xe955('0x94')]({},_0x4e216d,_0x357ca9[_0xe955('0xaf')]);return db[_0xe955('0xb4')][_0xe955('0x1f')]({'where':_0x4e216d[_0xe955('0x43')]})[_0xe955('0x27')](function(_0x2abe23){_0x1af9db[_0xe955('0x1f')]=_0x2abe23;if(_0x357ca9[_0xe955('0x39')][_0xe955('0xbb')]){_0x4e216d[_0xe955('0xae')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x4e216d);})[_0xe955('0x27')](function(_0x29d81a){_0x1af9db['rows']=_0x29d81a;return _0x1af9db;});}})[_0xe955('0x27')](respondWithFilteredResult(_0x363372,_0x4e216d))['catch'](handleError(_0x363372,null));};exports['addTags']=function(_0x3d2330,_0x22ab41,_0xb38a4){return db[_0xe955('0x35')]['find']({'where':{'id':_0x3d2330[_0xe955('0xb5')]['id']}})['then'](handleEntityNotFound(_0x22ab41,null))[_0xe955('0x27')](function(_0x5923d7){if(_0x5923d7){return _0x5923d7[_0xe955('0xbc')](_0x3d2330[_0xe955('0xb1')]['ids'],_[_0xe955('0xb7')](_0x3d2330[_0xe955('0xb1')],[_0xe955('0xb6'),'id'])||{})[_0xe955('0xbd')](function(){return db[_0xe955('0x6b')][_0xe955('0xbe')]({'attributes':['id','name',_0xe955('0x47')],'where':{'id':_0x3d2330[_0xe955('0xb1')][_0xe955('0xb6')]}});})[_0xe955('0x27')](function(_0x1e1f6e){socket[_0xe955('0xbf')](_0xe955('0xc0'),{'id':Number(_0x3d2330[_0xe955('0xb5')]['id']),'tags':_0x1e1f6e||[]});return{'id':Number(_0x3d2330[_0xe955('0xb5')]['id']),'tags':_0x1e1f6e||[]};});}})[_0xe955('0x27')](respondWithResult(_0x22ab41,null))['catch'](handleError(_0x22ab41,null));};exports[_0xe955('0xc1')]=function(_0x1ae583,_0x232546,_0x4b6e8a){return db[_0xe955('0x35')][_0xe955('0x67')]({'where':{'id':_0x1ae583[_0xe955('0xb5')]['id']}})[_0xe955('0x27')](handleEntityNotFound(_0x232546,null))[_0xe955('0x27')](function(_0x358d3c){if(_0x358d3c){return _0x358d3c[_0xe955('0xc1')](_0x1ae583['query'][_0xe955('0xb6')]);}})[_0xe955('0x27')](respondWithStatusCode(_0x232546,null))[_0xe955('0x33')](handleError(_0x232546,null));};exports[_0xe955('0xc2')]=function(_0x5e9f4d,_0x51bc43){var _0x4ace55=moment()[_0xe955('0xc3')]()[_0xe955('0x92')]();var _0x21241d=path[_0xe955('0xc4')](config['root'],_0xe955('0xc5'),'files',_0xe955('0xc6'));var _0x27a95e=path[_0xe955('0xc4')](config['root'],'server','files',_0xe955('0xc7'));var _0x1afa0e=path['join'](_0x21241d,_0x4ace55);var _0x47b6e6=util[_0xe955('0xb9')](_0xe955('0xc8'),_0x5e9f4d[_0xe955('0xb5')]['id'],_0x4ace55);var _0x5f5d2b=path[_0xe955('0xc4')](_0x21241d,_0x47b6e6);var _0x48ecb6=[];_0x48ecb6[_0xe955('0x32')]({'model':db[_0xe955('0xc9')],'as':_0xe955('0xc9'),'raw':!![]});var _0x2129a1=[{'model':db[_0xe955('0xb4')],'as':'Messages','attributes':['id',_0xe955('0xb1'),_0xe955('0x73')],'include':_0x48ecb6}];return db['FaxInteraction'][_0xe955('0x67')]({'where':{'id':_0x5e9f4d[_0xe955('0xb5')]['id']},'include':_0x2129a1})['then'](handleEntityNotFound(_0x51bc43,null))['then'](function(_0x102290){if(_0x102290&&_0x102290[_0xe955('0xca')]){var _0xee613a=_0x102290[_0xe955('0xcb')]({'plain':!![]});fs[_0xe955('0xcc')](_0x1afa0e);for(var _0x1032ca=0x0;_0x1032ca<_0xee613a[_0xe955('0xca')]['length'];_0x1032ca++){var _0x4b4c95=_0xee613a[_0xe955('0xca')][_0x1032ca][_0xe955('0xc9')];if(_0x4b4c95){var _0x2ea177=path[_0xe955('0xc4')](_0x27a95e,_0x4b4c95[_0xe955('0xcd')]);if(fs['existsSync'](_0x2ea177)){fs[_0xe955('0xce')](_0x2ea177)['pipe'](fs[_0xe955('0xcf')](path[_0xe955('0xc4')](_0x1afa0e,_0x4b4c95[_0xe955('0xcd')])));}}}return BPromise[_0xe955('0x8a')]()[_0xe955('0x27')](function(){return new BPromise(function(_0x334d7a,_0x3e95ce){zipdir(_0x1afa0e,{'saveTo':_0x5f5d2b},function(_0x301e6b,_0x19f6ef){if(_0x301e6b)return _0x3e95ce(_0x301e6b);return _0x334d7a(_0x19f6ef);});})['then'](function(){return new BPromise(function(_0x3c9e4f,_0x25e680){rimraf(_0x1afa0e,function(_0x267f71){if(_0x267f71)_0x25e680(_0x267f71);return _0x3c9e4f();});});})['then'](function(){return _0x51bc43[_0xe955('0xc2')](_0x5f5d2b,_0x47b6e6,function(_0x5e5dce){if(_0x5e5dce){console[_0xe955('0xd0')](_0xe955('0xd1'),_0x5e5dce);}else{fs[_0xe955('0xd2')](_0x5f5d2b);}});});});}else{return _0x51bc43[_0xe955('0x18')](0xc8);}})[_0xe955('0x33')](handleError(_0x51bc43,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 3d4eee5..b9bb222 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 _0x8934=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll'];(function(_0x1d7b83,_0x302616){var _0x43f16f=function(_0x1316b2){while(--_0x1316b2){_0x1d7b83['push'](_0x1d7b83['shift']());}};_0x43f16f(++_0x302616);}(_0x8934,0x1d4));var _0x4893=function(_0x11e0bb,_0x5cb520){_0x11e0bb=_0x11e0bb-0x0;var _0x4dc145=_0x8934[_0x11e0bb];return _0x4dc145;};'use strict';var EventEmitter=require(_0x4893('0x0'));var FaxInteraction=require(_0x4893('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x4893('0x1'))['db'][_0x4893('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x4893('0x3')](0x0);var events={'afterCreate':_0x4893('0x4'),'afterUpdate':_0x4893('0x5'),'afterDestroy':_0x4893('0x6')};function emitEvent(_0x48360a){return function(_0x2af2bb,_0x20112b,_0x37a0e7){_0x2af2bb[_0x4893('0x7')]({'attributes':['id'],'raw':!![]})[_0x4893('0x8')](function(_0x1a6fc8){_0x2af2bb['setDataValue'](_0x4893('0x9'),_0x1a6fc8[_0x4893('0xa')](function(_0x31e569){return{'id':_0x31e569['id']};}));return FaxMessage[_0x4893('0xb')]({'where':{'FaxInteractionId':_0x2af2bb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4893('0x8')](function(_0x22e9e4){_0x2af2bb[_0x4893('0xc')](_0x4893('0xd'),_0x22e9e4[_0x4893('0xe')]);FaxInteractionEvents['emit'](_0x48360a+':'+_0x2af2bb['id'],_0x2af2bb);FaxInteractionEvents[_0x4893('0xf')](_0x48360a,_0x2af2bb);_0x37a0e7(null);})[_0x4893('0x10')](_0x37a0e7(null));};}for(var e in events){if(events[_0x4893('0x11')](e)){var event=events[e];FaxInteraction[_0x4893('0x12')](e,emitEvent(event));}}module[_0x4893('0x13')]=FaxInteractionEvents; \ No newline at end of file +var _0x2595=['FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','findAll','unreadMessages','emit','catch','hook','exports','events','../../mysqldb'];(function(_0x3c4e14,_0xf3f9c){var _0x191342=function(_0x1ede27){while(--_0x1ede27){_0x3c4e14['push'](_0x3c4e14['shift']());}};_0x191342(++_0xf3f9c);}(_0x2595,0xec));var _0x5259=function(_0xfcdda0,_0x32479b){_0xfcdda0=_0xfcdda0-0x0;var _0x17ebe3=_0x2595[_0xfcdda0];return _0x17ebe3;};'use strict';var EventEmitter=require(_0x5259('0x0'));var FaxInteraction=require(_0x5259('0x1'))['db'][_0x5259('0x2')];var FaxMessage=require(_0x5259('0x1'))['db'][_0x5259('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x5259('0x4')](0x0);var events={'afterCreate':_0x5259('0x5'),'afterUpdate':_0x5259('0x6'),'afterDestroy':_0x5259('0x7')};function emitEvent(_0x43ea9c){return function(_0x343a22,_0x579dc4,_0x32ba95){_0x343a22['getUsers']({'attributes':['id'],'raw':!![]})[_0x5259('0x8')](function(_0xb56e22){_0x343a22[_0x5259('0x9')](_0x5259('0xa'),_0xb56e22['map'](function(_0x416dda){return{'id':_0x416dda['id']};}));return FaxMessage[_0x5259('0xb')]({'where':{'FaxInteractionId':_0x343a22['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5259('0x8')](function(_0xfe9cab){_0x343a22[_0x5259('0x9')](_0x5259('0xc'),_0xfe9cab['length']);FaxInteractionEvents[_0x5259('0xd')](_0x43ea9c+':'+_0x343a22['id'],_0x343a22);FaxInteractionEvents[_0x5259('0xd')](_0x43ea9c,_0x343a22);_0x32ba95(null);})[_0x5259('0xe')](_0x32ba95(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x5259('0xf')](e,emitEvent(event));}}module[_0x5259('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 5b0737c..4f01936 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 _0xfdb5=['exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x41ab3e,_0x1c075e){var _0x49d578=function(_0x560081){while(--_0x560081){_0x41ab3e['push'](_0x41ab3e['shift']());}};_0x49d578(++_0x1c075e);}(_0xfdb5,0x18f));var _0x5fdb=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xfdb5[_0x5834bc];return _0x3e183a;};'use strict';var _=require(_0x5fdb('0x0'));var util=require('util');var logger=require(_0x5fdb('0x1'))(_0x5fdb('0x2'));var moment=require(_0x5fdb('0x3'));var BPromise=require(_0x5fdb('0x4'));var rp=require(_0x5fdb('0x5'));var fs=require('fs');var path=require(_0x5fdb('0x6'));var rimraf=require(_0x5fdb('0x7'));var config=require(_0x5fdb('0x8'));var attributes=require('./faxInteraction.attributes');module[_0x5fdb('0x9')]=function(_0x4b690d,_0x8195ae){return _0x4b690d[_0x5fdb('0xa')](_0x5fdb('0xb'),attributes,{'tableName':_0x5fdb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x591cb2,_0xb82680,_0x53cef8){if(_0x591cb2[_0x5fdb('0xd')](_0x5fdb('0xe'))){_0x591cb2[_0x5fdb('0xf')]=moment()['format'](_0x5fdb('0x10'));}_0x53cef8(null,_0x591cb2);}}});}; \ No newline at end of file +var _0xf61e=['fax_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define'];(function(_0x363816,_0xc20c5a){var _0x368201=function(_0x57dae1){while(--_0x57dae1){_0x363816['push'](_0x363816['shift']());}};_0x368201(++_0xc20c5a);}(_0xf61e,0x191));var _0xef61=function(_0x2ed258,_0x12dc9a){_0x2ed258=_0x2ed258-0x0;var _0x3052d8=_0xf61e[_0x2ed258];return _0x3052d8;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var logger=require(_0xef61('0x2'))(_0xef61('0x3'));var moment=require(_0xef61('0x4'));var BPromise=require(_0xef61('0x5'));var rp=require(_0xef61('0x6'));var fs=require('fs');var path=require(_0xef61('0x7'));var rimraf=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var attributes=require(_0xef61('0xa'));module[_0xef61('0xb')]=function(_0x5b00b2,_0x9e17f4){return _0x5b00b2[_0xef61('0xc')]('FaxInteraction',attributes,{'tableName':_0xef61('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x277fa1,_0x106e7f,_0x4dba00){if(_0x277fa1['changed'](_0xef61('0xe'))){_0x277fa1[_0xef61('0xf')]=moment()[_0xef61('0x10')](_0xef61('0x11'));}_0x4dba00(null,_0x277fa1);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 2238b85..55d02a3 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 _0x77de=['register','request','then','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','FaxInteraction,\x20%s,\x20%s','info','catch','UpdateFaxInteraction','update','body','options','where','attributes','limit','debug','stringify','FaxInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x77de,0x1b4));var _0xe77d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x77de[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xe77d('0x0'));var util=require(_0xe77d('0x1'));var moment=require(_0xe77d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe77d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe77d('0x4'));var logger=require(_0xe77d('0x5'))(_0xe77d('0x6'));var config=require(_0xe77d('0x7'));var jayson=require(_0xe77d('0x8'));var client=jayson[_0xe77d('0x9')][_0xe77d('0xa')]({'port':0x232a});config[_0xe77d('0xb')]=_[_0xe77d('0xc')](config[_0xe77d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe77d('0xd'))(new Redis(config[_0xe77d('0xb')]));require(_0xe77d('0xe'))[_0xe77d('0xf')](socket);function respondWithRpcPromise(_0x4d3ee5,_0x40a590,_0x135495){return new BPromise(function(_0x1ca901,_0x6f911c){return client[_0xe77d('0x10')](_0x4d3ee5,_0x135495)[_0xe77d('0x11')](function(_0x34a126){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x40a590,_0xe77d('0x12'));logger['debug'](_0xe77d('0x13'),_0x40a590,_0xe77d('0x12'),JSON['stringify'](_0x34a126));if(_0x34a126[_0xe77d('0x14')]){if(_0x34a126['error'][_0xe77d('0x15')]===0x1f4){logger[_0xe77d('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x40a590,_0x34a126['error'][_0xe77d('0x16')]);return _0x6f911c(_0x34a126['error'][_0xe77d('0x16')]);}logger[_0xe77d('0x14')](_0xe77d('0x17'),_0x40a590,_0x34a126[_0xe77d('0x14')][_0xe77d('0x16')]);return _0x1ca901(_0x34a126['error'][_0xe77d('0x16')]);}else{logger[_0xe77d('0x18')](_0xe77d('0x17'),_0x40a590,_0xe77d('0x12'));_0x1ca901(_0x34a126['result']['message']);}})[_0xe77d('0x19')](function(_0x5364a3){logger['error'](_0xe77d('0x17'),_0x40a590,_0x5364a3);_0x6f911c(_0x5364a3);});});}exports[_0xe77d('0x1a')]=function(_0x4bbeff){var _0x815a9d=this;return new Promise(function(_0x1cf815,_0x6aebfd){return db['FaxInteraction'][_0xe77d('0x1b')](_0x4bbeff[_0xe77d('0x1c')],{'raw':_0x4bbeff['options']?_0x4bbeff[_0xe77d('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bbeff[_0xe77d('0x1d')]?_0x4bbeff[_0xe77d('0x1d')][_0xe77d('0x1e')]||null:null,'attributes':_0x4bbeff[_0xe77d('0x1d')]?_0x4bbeff['options'][_0xe77d('0x1f')]||null:null,'limit':_0x4bbeff[_0xe77d('0x1d')]?_0x4bbeff['options'][_0xe77d('0x20')]||null:null})[_0xe77d('0x11')](function(_0xd07182){logger[_0xe77d('0x18')](_0xe77d('0x1a'),_0x4bbeff);logger[_0xe77d('0x21')](_0xe77d('0x1a'),_0x4bbeff,JSON[_0xe77d('0x22')](_0xd07182));_0x1cf815(_0xd07182);})[_0xe77d('0x19')](function(_0x519fa0){logger[_0xe77d('0x14')]('UpdateFaxInteraction',_0x519fa0[_0xe77d('0x16')],_0x4bbeff);_0x6aebfd(_0x815a9d[_0xe77d('0x14')](0x1f4,_0x519fa0[_0xe77d('0x16')]));});});};exports['AddTagsToFaxInteraction']=function(_0x30cba1){return new Promise(function(_0x2c0b13,_0x1fc880){return db[_0xe77d('0x23')][_0xe77d('0x24')]({'where':_0x30cba1[_0xe77d('0x1d')]?_0x30cba1[_0xe77d('0x1d')][_0xe77d('0x1e')]||null:null})[_0xe77d('0x11')](function(_0x49981a){if(_0x49981a){return _0x49981a[_0xe77d('0x25')](_0x30cba1[_0xe77d('0x1c')][_0xe77d('0x26')],_['omit'](_0x30cba1[_0xe77d('0x1c')],[_0xe77d('0x26'),'id'])||{});}})[_0xe77d('0x27')](function(_0x1b4141){logger[_0xe77d('0x18')](_0xe77d('0x28'),_0x30cba1);logger[_0xe77d('0x21')]('AddTags',_0x30cba1,JSON[_0xe77d('0x22')](_0x1b4141));_0x2c0b13(_0x1b4141);})[_0xe77d('0x19')](function(_0x475f30){logger[_0xe77d('0x14')](_0xe77d('0x28'),_0x475f30[_0xe77d('0x16')],_0x30cba1);_0x1fc880(_this[_0xe77d('0x14')](0x1f4,_0x475f30[_0xe77d('0x16')]));});});}; \ No newline at end of file +var _0x98ce=['raw','options','where','attributes','debug','stringify','AddTagsToFaxInteraction','find','addTags','body','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxInteraction,\x20%s,\x20%s,\x20%s','error','FaxInteraction,\x20%s,\x20%s','request\x20sent','result','message','catch','UpdateFaxInteraction','update'];(function(_0xb6bd0,_0x3606bb){var _0x2be42a=function(_0xcc25b){while(--_0xcc25b){_0xb6bd0['push'](_0xb6bd0['shift']());}};_0x2be42a(++_0x3606bb);}(_0x98ce,0x19d));var _0xe98c=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x98ce[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xe98c('0x0'));var util=require(_0xe98c('0x1'));var moment=require(_0xe98c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe98c('0x3'));var fs=require('fs');var Redis=require(_0xe98c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe98c('0x5'));var logger=require(_0xe98c('0x6'))(_0xe98c('0x7'));var config=require(_0xe98c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe98c('0x9')][_0xe98c('0xa')]({'port':0x232a});config[_0xe98c('0xb')]=_[_0xe98c('0xc')](config[_0xe98c('0xb')],{'host':_0xe98c('0xd'),'port':0x18eb});var socket=require(_0xe98c('0xe'))(new Redis(config[_0xe98c('0xb')]));require('./faxInteraction.socket')[_0xe98c('0xf')](socket);function respondWithRpcPromise(_0x365abd,_0x1f54ac,_0x3bfa57){return new BPromise(function(_0x227953,_0x138fa8){return client['request'](_0x365abd,_0x3bfa57)[_0xe98c('0x10')](function(_0x1310b9){logger[_0xe98c('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x1f54ac,'request\x20sent');logger['debug'](_0xe98c('0x12'),_0x1f54ac,'request\x20sent',JSON['stringify'](_0x1310b9));if(_0x1310b9[_0xe98c('0x13')]){if(_0x1310b9[_0xe98c('0x13')]['code']===0x1f4){logger[_0xe98c('0x13')](_0xe98c('0x14'),_0x1f54ac,_0x1310b9[_0xe98c('0x13')]['message']);return _0x138fa8(_0x1310b9[_0xe98c('0x13')]['message']);}logger[_0xe98c('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x1f54ac,_0x1310b9['error']['message']);return _0x227953(_0x1310b9['error']['message']);}else{logger['info'](_0xe98c('0x14'),_0x1f54ac,_0xe98c('0x15'));_0x227953(_0x1310b9[_0xe98c('0x16')][_0xe98c('0x17')]);}})[_0xe98c('0x18')](function(_0x134568){logger[_0xe98c('0x13')](_0xe98c('0x14'),_0x1f54ac,_0x134568);_0x138fa8(_0x134568);});});}exports[_0xe98c('0x19')]=function(_0x40f2e4){var _0xe79258=this;return new Promise(function(_0x4a8a22,_0x5a8874){return db['FaxInteraction'][_0xe98c('0x1a')](_0x40f2e4['body'],{'raw':_0x40f2e4['options']?_0x40f2e4['options'][_0xe98c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40f2e4[_0xe98c('0x1c')]?_0x40f2e4['options'][_0xe98c('0x1d')]||null:null,'attributes':_0x40f2e4[_0xe98c('0x1c')]?_0x40f2e4[_0xe98c('0x1c')][_0xe98c('0x1e')]||null:null,'limit':_0x40f2e4[_0xe98c('0x1c')]?_0x40f2e4[_0xe98c('0x1c')]['limit']||null:null})['then'](function(_0x2f375f){logger[_0xe98c('0x11')](_0xe98c('0x19'),_0x40f2e4);logger[_0xe98c('0x1f')](_0xe98c('0x19'),_0x40f2e4,JSON[_0xe98c('0x20')](_0x2f375f));_0x4a8a22(_0x2f375f);})['catch'](function(_0x367ca0){logger[_0xe98c('0x13')](_0xe98c('0x19'),_0x367ca0[_0xe98c('0x17')],_0x40f2e4);_0x5a8874(_0xe79258['error'](0x1f4,_0x367ca0[_0xe98c('0x17')]));});});};exports[_0xe98c('0x21')]=function(_0x21fa6f){return new Promise(function(_0xc7477e,_0x4759be){return db['FaxInteraction'][_0xe98c('0x22')]({'where':_0x21fa6f[_0xe98c('0x1c')]?_0x21fa6f[_0xe98c('0x1c')][_0xe98c('0x1d')]||null:null})[_0xe98c('0x10')](function(_0x1143b7){if(_0x1143b7){return _0x1143b7[_0xe98c('0x23')](_0x21fa6f[_0xe98c('0x24')]['ids'],_['omit'](_0x21fa6f[_0xe98c('0x24')],[_0xe98c('0x25'),'id'])||{});}})[_0xe98c('0x26')](function(_0x3d8005){logger[_0xe98c('0x11')](_0xe98c('0x27'),_0x21fa6f);logger[_0xe98c('0x1f')](_0xe98c('0x27'),_0x21fa6f,JSON[_0xe98c('0x20')](_0x3d8005));_0xc7477e(_0x3d8005);})[_0xe98c('0x18')](function(_0x3a461b){logger['error'](_0xe98c('0x27'),_0x3a461b[_0xe98c('0x17')],_0x21fa6f);_0x4759be(_this[_0xe98c('0x13')](0x1f4,_0x3a461b[_0xe98c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 07e6c97..a112c5a 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 _0x42a9=['remove','update','emit','removeListener','faxInteraction:','./faxInteraction.events'];(function(_0x56450f,_0x6e48bb){var _0x5f084c=function(_0x549fb4){while(--_0x549fb4){_0x56450f['push'](_0x56450f['shift']());}};_0x5f084c(++_0x6e48bb);}(_0x42a9,0x83));var _0x942a=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x42a9[_0x1cc8fe];return _0x230054;};'use strict';var FaxInteractionEvents=require(_0x942a('0x0'));var events=['save',_0x942a('0x1'),_0x942a('0x2')];function createListener(_0xf84e4a,_0x5f1101){return function(_0x198876){_0x5f1101[_0x942a('0x3')](_0xf84e4a,_0x198876);};}function removeListener(_0x123a16,_0x1e3a54){return function(){FaxInteractionEvents[_0x942a('0x4')](_0x123a16,_0x1e3a54);};}exports['register']=function(_0x328420){for(var _0x18d9dd=0x0,_0x322bae=events['length'];_0x18d9dd<_0x322bae;_0x18d9dd++){var _0x31e223=events[_0x18d9dd];var _0x382d41=createListener(_0x942a('0x5')+_0x31e223,_0x328420);FaxInteractionEvents['on'](_0x31e223,_0x382d41);}}; \ No newline at end of file +var _0x7b1c=['remove','emit','length','faxInteraction:','./faxInteraction.events','save'];(function(_0x5e0b96,_0x578c9c){var _0x3ca7bc=function(_0x4516a2){while(--_0x4516a2){_0x5e0b96['push'](_0x5e0b96['shift']());}};_0x3ca7bc(++_0x578c9c);}(_0x7b1c,0x19c));var _0xc7b1=function(_0x5e34fe,_0x480b18){_0x5e34fe=_0x5e34fe-0x0;var _0x1a23e7=_0x7b1c[_0x5e34fe];return _0x1a23e7;};'use strict';var FaxInteractionEvents=require(_0xc7b1('0x0'));var events=[_0xc7b1('0x1'),_0xc7b1('0x2'),'update'];function createListener(_0x4101a3,_0x28d452){return function(_0x2e4beb){_0x28d452[_0xc7b1('0x3')](_0x4101a3,_0x2e4beb);};}function removeListener(_0x357b88,_0x37247b){return function(){FaxInteractionEvents['removeListener'](_0x357b88,_0x37247b);};}exports['register']=function(_0x29c69b){for(var _0x57bec7=0x0,_0x3a6b89=events[_0xc7b1('0x4')];_0x57bec7<_0x3a6b89;_0x57bec7++){var _0x16aa79=events[_0x57bec7];var _0x28f54e=createListener(_0xc7b1('0x5')+_0x16aa79,_0x29c69b);FaxInteractionEvents['on'](_0x16aa79,_0x28f54e);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 3c16dc6..0a9155b 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 _0xf01c=['/:id/download','download','post','addMessage','tracked','fax','faxinteraction:addtags','addTags','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages'];(function(_0x18d661,_0x972ca4){var _0x3c9e0f=function(_0x111800){while(--_0x111800){_0x18d661['push'](_0x18d661['shift']());}};_0x3c9e0f(++_0x972ca4);}(_0xf01c,0x157));var _0xcf01=function(_0x3a47db,_0x3fdf7c){_0x3a47db=_0x3a47db-0x0;var _0x1156c3=_0xf01c[_0x3a47db];return _0x1156c3;};'use strict';var multer=require('multer');var util=require(_0xcf01('0x0'));var path=require(_0xcf01('0x1'));var timeout=require(_0xcf01('0x2'));var express=require('express');var router=express[_0xcf01('0x3')]();var fs_extra=require(_0xcf01('0x4'));var auth=require(_0xcf01('0x5'));var interaction=require(_0xcf01('0x6'));var config=require(_0xcf01('0x7'));var controller=require(_0xcf01('0x8'));router['get']('/',auth[_0xcf01('0x9')](),controller[_0xcf01('0xa')]);router[_0xcf01('0xb')](_0xcf01('0xc'),auth[_0xcf01('0x9')](),controller[_0xcf01('0xd')]);router['get'](_0xcf01('0xe'),auth[_0xcf01('0x9')](),controller[_0xcf01('0xf')]);router['get'](_0xcf01('0x10'),auth[_0xcf01('0x9')](),controller['getMessages']);router[_0xcf01('0xb')](_0xcf01('0x11'),auth['isAuthenticated'](),controller[_0xcf01('0x12')]);router[_0xcf01('0x13')]('/',auth[_0xcf01('0x9')](),controller['create']);router[_0xcf01('0x13')]('/:id/messages',auth[_0xcf01('0x9')](),controller[_0xcf01('0x14')]);router[_0xcf01('0x13')]('/:id/tags',auth[_0xcf01('0x9')](),interaction[_0xcf01('0x15')](_0xcf01('0x16'),_0xcf01('0x17')),controller[_0xcf01('0x18')]);router[_0xcf01('0x19')](_0xcf01('0xe'),auth[_0xcf01('0x9')](),interaction[_0xcf01('0x15')]('fax','faxinteraction:update'),controller[_0xcf01('0x1a')]);router[_0xcf01('0x1b')](_0xcf01('0xe'),auth[_0xcf01('0x9')](),interaction[_0xcf01('0x15')]('fax','faxinteraction:destroy'),controller[_0xcf01('0x1c')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0xcf01('0x1d')]=router; \ No newline at end of file +var _0x289f=['../../config/environment','./faxInteraction.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x28896a,_0x4dc100){var _0x5a4f2b=function(_0x56c353){while(--_0x56c353){_0x28896a['push'](_0x28896a['shift']());}};_0x5a4f2b(++_0x4dc100);}(_0x289f,0x7d));var _0xf289=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x289f[_0x2dadb9];return _0x2f0097;};'use strict';var multer=require(_0xf289('0x0'));var util=require('util');var path=require(_0xf289('0x1'));var timeout=require(_0xf289('0x2'));var express=require('express');var router=express[_0xf289('0x3')]();var fs_extra=require(_0xf289('0x4'));var auth=require(_0xf289('0x5'));var interaction=require(_0xf289('0x6'));var config=require(_0xf289('0x7'));var controller=require(_0xf289('0x8'));router[_0xf289('0x9')]('/',auth['isAuthenticated'](),controller[_0xf289('0xa')]);router['get'](_0xf289('0xb'),auth[_0xf289('0xc')](),controller['describe']);router[_0xf289('0x9')](_0xf289('0xd'),auth[_0xf289('0xc')](),controller[_0xf289('0xe')]);router['get'](_0xf289('0xf'),auth[_0xf289('0xc')](),controller[_0xf289('0x10')]);router['get'](_0xf289('0x11'),auth[_0xf289('0xc')](),controller[_0xf289('0x12')]);router[_0xf289('0x13')]('/',auth[_0xf289('0xc')](),controller['create']);router['post'](_0xf289('0xf'),auth[_0xf289('0xc')](),controller[_0xf289('0x14')]);router[_0xf289('0x13')](_0xf289('0x15'),auth['isAuthenticated'](),interaction[_0xf289('0x16')](_0xf289('0x17'),_0xf289('0x18')),controller[_0xf289('0x19')]);router['put'](_0xf289('0xd'),auth[_0xf289('0xc')](),interaction[_0xf289('0x16')]('fax',_0xf289('0x1a')),controller[_0xf289('0x1b')]);router[_0xf289('0x1c')]('/:id',auth[_0xf289('0xc')](),interaction[_0xf289('0x16')](_0xf289('0x17'),_0xf289('0x1d')),controller[_0xf289('0x1e')]);router[_0xf289('0x1c')](_0xf289('0x15'),auth[_0xf289('0xc')](),controller[_0xf289('0x1f')]);module[_0xf289('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 4683529..fb03fbc 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 _0x0506=['sequelize','exports','TEXT','out','DATE'];(function(_0x96bf2c,_0x44ddfa){var _0x24a895=function(_0x5e5881){while(--_0x5e5881){_0x96bf2c['push'](_0x96bf2c['shift']());}};_0x24a895(++_0x44ddfa);}(_0x0506,0x1d1));var _0x6050=function(_0x238e3a,_0x2a9504){_0x238e3a=_0x238e3a-0x0;var _0x27a882=_0x0506[_0x238e3a];return _0x27a882;};'use strict';var Sequelize=require(_0x6050('0x0'));module[_0x6050('0x1')]={'body':{'type':Sequelize[_0x6050('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x6050('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x6050('0x4')]}}; \ No newline at end of file +var _0x79a8=['out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x199db2,_0x2e775d){var _0x1ebd4d=function(_0x5519bf){while(--_0x5519bf){_0x199db2['push'](_0x199db2['shift']());}};_0x1ebd4d(++_0x2e775d);}(_0x79a8,0x1d0));var _0x879a=function(_0x33dda7,_0x59117d){_0x33dda7=_0x33dda7-0x0;var _0x56de5=_0x79a8[_0x33dda7];return _0x56de5;};'use strict';var Sequelize=require(_0x879a('0x0'));module['exports']={'body':{'type':Sequelize[_0x879a('0x1')](_0x879a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x879a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x879a('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x879a('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x879a('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index de252cb..215bbb3 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 _0x0e5e=['show','params','includeAll','find','catch','body','describe','fax-interactions','accept','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','SELECT','contact','User','fullname','email','internal','manual','channel','EventManager','acceptmessage','reject','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','interface','event','rejectmessage','create','CmContact','findOne','isNil','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','AttachmentId','download','join','root','attachments','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','redis','defaults','localhost','register','jayson/promise','http','client','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','offset','limit','Content-Range','json','apply','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','where','filter','merge','options','count','include','FaxMessage','findAll','rows'];(function(_0x1b5015,_0x407cd7){var _0x199bfe=function(_0x5f20a3){while(--_0x5f20a3){_0x1b5015['push'](_0x1b5015['shift']());}};_0x199bfe(++_0x407cd7);}(_0x0e5e,0xc8));var _0xe0e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0e5e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe0e5('0x0'));var rimraf=require(_0xe0e5('0x1'));var zipdir=require(_0xe0e5('0x2'));var jsonpatch=require(_0xe0e5('0x3'));var rp=require(_0xe0e5('0x4'));var moment=require(_0xe0e5('0x5'));var BPromise=require(_0xe0e5('0x6'));var Mustache=require(_0xe0e5('0x7'));var util=require('util');var path=require(_0xe0e5('0x8'));var sox=require(_0xe0e5('0x9'));var csv=require(_0xe0e5('0xa'));var ejs=require(_0xe0e5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe0e5('0xc'));var squel=require(_0xe0e5('0xd'));var crypto=require(_0xe0e5('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe0e5('0xa'));var querystring=require(_0xe0e5('0xf'));var Papa=require(_0xe0e5('0x10'));var Redis=require(_0xe0e5('0x11'));var authService=require(_0xe0e5('0x12'));var qs=require(_0xe0e5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0e5('0x14'));var logger=require(_0xe0e5('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe0e5('0x16'));var db=require('../../mysqldb')['db'];config[_0xe0e5('0x17')]=_[_0xe0e5('0x18')](config[_0xe0e5('0x17')],{'host':_0xe0e5('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')[_0xe0e5('0x1a')](socket);var jayson=require(_0xe0e5('0x1b'));var client=jayson['client'][_0xe0e5('0x1c')]({'port':0x232c});var client9002=jayson[_0xe0e5('0x1d')][_0xe0e5('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1c4280,_0x24c70d,_0x664a02,_0x31419d){return new BPromise(function(_0x3735a9,_0x59f844){var _0x182703=_0x31419d||client;return _0x182703[_0xe0e5('0x1e')](_0x1c4280,_0x664a02)[_0xe0e5('0x1f')](function(_0x430f3b){logger[_0xe0e5('0x20')](_0xe0e5('0x21'),_0x24c70d,_0xe0e5('0x22'));logger[_0xe0e5('0x23')](_0xe0e5('0x24'),_0x24c70d,'request\x20sent',JSON['stringify'](_0x430f3b));if(_0x430f3b[_0xe0e5('0x25')]){if(_0x430f3b[_0xe0e5('0x25')][_0xe0e5('0x26')]===0x1f4){logger[_0xe0e5('0x25')](_0xe0e5('0x21'),_0x24c70d,_0x430f3b['error'][_0xe0e5('0x27')]);return _0x59f844(_0x430f3b[_0xe0e5('0x25')][_0xe0e5('0x27')]);}logger[_0xe0e5('0x25')](_0xe0e5('0x21'),_0x24c70d,_0x430f3b[_0xe0e5('0x25')]['message']);return _0x3735a9(_0x430f3b[_0xe0e5('0x25')][_0xe0e5('0x27')]);}else{logger[_0xe0e5('0x20')](_0xe0e5('0x21'),_0x24c70d,_0xe0e5('0x22'));_0x3735a9(_0x430f3b['result'][_0xe0e5('0x27')]);}})['catch'](function(_0x12707c){logger['error'](_0xe0e5('0x21'),_0x24c70d,_0x12707c);_0x59f844(_0x12707c);});});}function respondWithStatusCode(_0x2991f7,_0x929194){_0x929194=_0x929194||0xcc;return function(_0x10aa47){if(_0x10aa47){return _0x2991f7[_0xe0e5('0x28')](_0x929194);}return _0x2991f7[_0xe0e5('0x29')](_0x929194)[_0xe0e5('0x2a')]();};}function respondWithResult(_0x508ab3,_0x4817da){_0x4817da=_0x4817da||0xc8;return function(_0x520d3a){if(_0x520d3a){return _0x508ab3[_0xe0e5('0x29')](_0x4817da)['json'](_0x520d3a);}};}function respondWithFilteredResult(_0x5a99ef,_0x577f58){return function(_0x5e7d43){if(_0x5e7d43){var _0x30f684=typeof _0x577f58[_0xe0e5('0x2b')]==='undefined'&&typeof _0x577f58[_0xe0e5('0x2c')]==='undefined';var _0x256751=_0x5e7d43['count'];var _0x58fcb8=_0x30f684?0x0:_0x577f58['offset'];var _0x27d390=_0x30f684?_0x5e7d43['count']:_0x577f58[_0xe0e5('0x2b')]+_0x577f58[_0xe0e5('0x2c')];var _0x39cc50;if(_0x27d390>=_0x256751){_0x27d390=_0x256751;_0x39cc50=0xc8;}else{_0x39cc50=0xce;}_0x5a99ef[_0xe0e5('0x29')](_0x39cc50);return _0x5a99ef['set'](_0xe0e5('0x2d'),_0x58fcb8+'-'+_0x27d390+'/'+_0x256751)[_0xe0e5('0x2e')](_0x5e7d43);}return null;};}function patchUpdates(_0xe757bd){return function(_0x172f85){try{jsonpatch[_0xe0e5('0x2f')](_0x172f85,_0xe757bd,!![]);}catch(_0x249507){return BPromise['reject'](_0x249507);}return _0x172f85[_0xe0e5('0x30')]();};}function saveUpdates(_0x47b863,_0x5d50c9){return function(_0xf32c91){if(_0xf32c91){return _0xf32c91[_0xe0e5('0x31')](_0x47b863)[_0xe0e5('0x1f')](function(_0x4b166d){return _0x4b166d;});}return null;};}function removeEntity(_0x3d30e0,_0x17e27f){return function(_0x337d67){if(_0x337d67){return _0x337d67[_0xe0e5('0x32')]()[_0xe0e5('0x1f')](function(){_0x3d30e0[_0xe0e5('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16c23a,_0x4a8a9d){return function(_0x7a6106){if(!_0x7a6106){_0x16c23a[_0xe0e5('0x28')](0x194);}return _0x7a6106;};}function handleError(_0x3d0d77,_0x1e8315){_0x1e8315=_0x1e8315||0x1f4;return function(_0x323384){logger[_0xe0e5('0x25')](_0x323384[_0xe0e5('0x33')]);if(_0x323384['name']){delete _0x323384[_0xe0e5('0x34')];}_0x3d0d77[_0xe0e5('0x29')](_0x1e8315)[_0xe0e5('0x35')](_0x323384);};}exports[_0xe0e5('0x36')]=function(_0x34863d,_0x559396){var _0x88e828={},_0x864d11={},_0x3a0b63={'count':0x0,'rows':[]};var _0x209989=_[_0xe0e5('0x37')](db['FaxMessage'][_0xe0e5('0x38')],function(_0x32aea8){return{'name':_0x32aea8[_0xe0e5('0x39')],'type':_0x32aea8['type'][_0xe0e5('0x3a')]};});_0x864d11['model']=_['map'](_0x209989,'name');_0x864d11[_0xe0e5('0x3b')]=_[_0xe0e5('0x3c')](_0x34863d[_0xe0e5('0x3b')]);_0x864d11[_0xe0e5('0x3d')]=_[_0xe0e5('0x3e')](_0x864d11[_0xe0e5('0x3f')],_0x864d11['query']);_0x88e828[_0xe0e5('0x40')]=_['intersection'](_0x864d11[_0xe0e5('0x3f')],qs[_0xe0e5('0x41')](_0x34863d['query'][_0xe0e5('0x41')]));_0x88e828[_0xe0e5('0x40')]=_0x88e828[_0xe0e5('0x40')][_0xe0e5('0x42')]?_0x88e828[_0xe0e5('0x40')]:_0x864d11['model'];if(!_0x34863d[_0xe0e5('0x3b')]['hasOwnProperty'](_0xe0e5('0x43'))){_0x88e828['limit']=qs[_0xe0e5('0x2c')](_0x34863d[_0xe0e5('0x3b')][_0xe0e5('0x2c')]);_0x88e828[_0xe0e5('0x2b')]=qs[_0xe0e5('0x2b')](_0x34863d[_0xe0e5('0x3b')][_0xe0e5('0x2b')]);}_0x88e828[_0xe0e5('0x44')]=qs['sort'](_0x34863d['query'][_0xe0e5('0x45')]);_0x88e828['where']=qs['filters'](_[_0xe0e5('0x46')](_0x34863d[_0xe0e5('0x3b')],_0x864d11[_0xe0e5('0x3d')]),_0x209989);if(_0x34863d[_0xe0e5('0x3b')]['filter']){_0x88e828[_0xe0e5('0x47')]=_['merge'](_0x88e828[_0xe0e5('0x47')],{'$or':_[_0xe0e5('0x37')](_0x209989,function(_0x26a50f){if(_0x26a50f['type']!=='VIRTUAL'){var _0xcca2fd={};_0xcca2fd[_0x26a50f['name']]={'$like':'%'+_0x34863d[_0xe0e5('0x3b')][_0xe0e5('0x48')]+'%'};return _0xcca2fd;}})});}_0x88e828=_[_0xe0e5('0x49')]({},_0x88e828,_0x34863d[_0xe0e5('0x4a')]);var _0x1795e0={'where':_0x88e828[_0xe0e5('0x47')]};return db['FaxMessage'][_0xe0e5('0x4b')](_0x1795e0)[_0xe0e5('0x1f')](function(_0x13588c){_0x3a0b63[_0xe0e5('0x4b')]=_0x13588c;if(_0x34863d[_0xe0e5('0x3b')]['includeAll']){_0x88e828[_0xe0e5('0x4c')]=[{'all':!![]}];}return db[_0xe0e5('0x4d')][_0xe0e5('0x4e')](_0x88e828);})[_0xe0e5('0x1f')](function(_0x55a4e5){_0x3a0b63[_0xe0e5('0x4f')]=_0x55a4e5;return _0x3a0b63;})[_0xe0e5('0x1f')](respondWithFilteredResult(_0x559396,_0x88e828))['catch'](handleError(_0x559396,null));};exports[_0xe0e5('0x50')]=function(_0x5b9a52,_0x557140){var _0x58dd1d={'raw':!![],'where':{'id':_0x5b9a52[_0xe0e5('0x51')]['id']}},_0x13a3b8={};_0x13a3b8['model']=_[_0xe0e5('0x3c')](db[_0xe0e5('0x4d')][_0xe0e5('0x38')]);_0x13a3b8[_0xe0e5('0x3b')]=_['keys'](_0x5b9a52[_0xe0e5('0x3b')]);_0x13a3b8[_0xe0e5('0x3d')]=_[_0xe0e5('0x3e')](_0x13a3b8[_0xe0e5('0x3f')],_0x13a3b8['query']);_0x58dd1d[_0xe0e5('0x40')]=_[_0xe0e5('0x3e')](_0x13a3b8[_0xe0e5('0x3f')],qs['fields'](_0x5b9a52[_0xe0e5('0x3b')][_0xe0e5('0x41')]));_0x58dd1d[_0xe0e5('0x40')]=_0x58dd1d[_0xe0e5('0x40')][_0xe0e5('0x42')]?_0x58dd1d[_0xe0e5('0x40')]:_0x13a3b8[_0xe0e5('0x3f')];if(_0x5b9a52[_0xe0e5('0x3b')][_0xe0e5('0x52')]){_0x58dd1d[_0xe0e5('0x4c')]=[{'all':!![]}];}_0x58dd1d=_[_0xe0e5('0x49')]({},_0x58dd1d,_0x5b9a52[_0xe0e5('0x4a')]);return db[_0xe0e5('0x4d')][_0xe0e5('0x53')](_0x58dd1d)[_0xe0e5('0x1f')](handleEntityNotFound(_0x557140,null))[_0xe0e5('0x1f')](respondWithResult(_0x557140,null))[_0xe0e5('0x54')](handleError(_0x557140,null));};exports[_0xe0e5('0x31')]=function(_0x390477,_0x1b438e){if(_0x390477['body']['id']){delete _0x390477[_0xe0e5('0x55')]['id'];}return db['FaxMessage'][_0xe0e5('0x53')]({'where':{'id':_0x390477[_0xe0e5('0x51')]['id']}})[_0xe0e5('0x1f')](handleEntityNotFound(_0x1b438e,null))[_0xe0e5('0x1f')](saveUpdates(_0x390477[_0xe0e5('0x55')],null))[_0xe0e5('0x1f')](respondWithResult(_0x1b438e,null))['catch'](handleError(_0x1b438e,null));};exports[_0xe0e5('0x32')]=function(_0x1f57ac,_0xf81c47){return db[_0xe0e5('0x4d')]['find']({'where':{'id':_0x1f57ac['params']['id']}})['then'](handleEntityNotFound(_0xf81c47,null))[_0xe0e5('0x1f')](removeEntity(_0xf81c47,null))[_0xe0e5('0x54')](handleError(_0xf81c47,null));};exports['describe']=function(_0x589f53,_0x14db9a){return db[_0xe0e5('0x4d')][_0xe0e5('0x56')]()['then'](respondWithResult(_0x14db9a,null))[_0xe0e5('0x54')](handleError(_0x14db9a,null));};var interaction_log=require(_0xe0e5('0x15'))(_0xe0e5('0x57'));exports[_0xe0e5('0x58')]=function(_0x498dfe,_0x440883,_0x1f354a){var _0x5541e3={'agent':{},'channel':'fax'};if(_0x498dfe[_0xe0e5('0x55')]['id']){delete _0x498dfe['body']['id'];}_0x498dfe[_0xe0e5('0x55')]['read']=!![];_0x498dfe['body']['readAt']=moment()['format'](_0xe0e5('0x59'));_0x498dfe[_0xe0e5('0x55')][_0xe0e5('0x5a')]=_0x498dfe[_0xe0e5('0x55')][_0xe0e5('0x5a')]||_0x498dfe[_0xe0e5('0x5b')]['id'];_0x5541e3[_0xe0e5('0x5c')]['id']=_0x498dfe[_0xe0e5('0x55')][_0xe0e5('0x5a')];return db['FaxMessage'][_0xe0e5('0x53')]({'where':{'id':_0x498dfe['params']['id'],'UserId':null}})[_0xe0e5('0x1f')](handleEntityNotFound(_0x440883,null))[_0xe0e5('0x1f')](saveUpdates(_0x498dfe['body'],null))[_0xe0e5('0x1f')](function(_0x22ecb9){if(_0x22ecb9){_0x5541e3[_0xe0e5('0x27')]=_0x22ecb9[_0xe0e5('0x5d')]({'plain':!![]});return db[_0xe0e5('0x5e')][_0xe0e5('0x53')]({'where':{'id':_0x22ecb9[_0xe0e5('0x5f')]}});}return null;})[_0xe0e5('0x1f')](handleEntityNotFound(_0x440883,null))[_0xe0e5('0x1f')](function(_0x1f0a76){if(_0x1f0a76){return _0x1f0a76[_0xe0e5('0x31')]({'UserId':_0x498dfe['body'][_0xe0e5('0x5a')],'read1stAt':_['isNil'](_0x1f0a76['read1stAt'])?moment()[_0xe0e5('0x60')](_0xe0e5('0x59')):undefined});}return null;})['then'](function(_0x62c4c7){if(_0x62c4c7){_0x5541e3[_0xe0e5('0x61')]=_0x62c4c7[_0xe0e5('0x5d')]({'plain':!![]});interaction_log['info'](_0xe0e5('0x62'),_0x498dfe['user']['id'],_0x498dfe['user'][_0xe0e5('0x34')],_0x498dfe[_0xe0e5('0x5b')][_0xe0e5('0x63')],_0x5541e3[_0xe0e5('0x61')]['id'],_0x498dfe[_0xe0e5('0x55')]?JSON[_0xe0e5('0x64')](_0x498dfe[_0xe0e5('0x55')]):_0xe0e5('0x65'));return respondWithRpcPromise(_0xe0e5('0x66'),_0xe0e5('0x67'),_0x5541e3);}return null;})[_0xe0e5('0x1f')](function(_0x6c70aa){var _0x443698='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x6c70aa[_0xe0e5('0x27')][_0xe0e5('0x68')];return db[_0xe0e5('0x69')][_0xe0e5('0x3b')](_0x443698,{'type':db['Sequelize']['QueryTypes'][_0xe0e5('0x6a')],'raw':!![]})[_0xe0e5('0x1f')](function(_0x310ce1){return _0x310ce1;});})[_0xe0e5('0x1f')](function(_0x98e6a4){if(_0x98e6a4){_0x5541e3[_0xe0e5('0x27')][_0xe0e5('0x6b')]=_0x98e6a4[0x0];if(!_0x498dfe[_0xe0e5('0x55')][_0xe0e5('0x5a')])return;return db[_0xe0e5('0x6c')][_0xe0e5('0x53')]({'where':{'id':_0x498dfe[_0xe0e5('0x55')][_0xe0e5('0x5a')],'role':'agent'},'attributes':['id',_0xe0e5('0x34'),_0xe0e5('0x6d'),_0xe0e5('0x6e'),_0xe0e5('0x6f')],'raw':!![]});}return null;})['then'](function(_0x5e2b8d){if(!_0x5e2b8d)return null;_0x5541e3[_0xe0e5('0x27')][_0xe0e5('0x5c')]=_0x5e2b8d;return _0x5541e3;})[_0xe0e5('0x1f')](function(_0x2ff36e){if(_0x2ff36e){if(_0x498dfe[_0xe0e5('0x55')][_0xe0e5('0x70')]){_0x5541e3[_0xe0e5('0x27')]['interface']=util['format']('SIP/%s',_0x498dfe['user']['name']);_0x5541e3['message'][_0xe0e5('0x71')]=_0x5541e3[_0xe0e5('0x71')];_0x5541e3[_0xe0e5('0x27')]['event']=_0xe0e5('0x58');return respondWithRpcPromise(_0xe0e5('0x72'),_0xe0e5('0x72'),{'event':_0xe0e5('0x73'),'message':_0x5541e3[_0xe0e5('0x27')]},client9002)[_0xe0e5('0x1f')](function(){return _0x5541e3;});}return _0x5541e3;}return null;})['then'](respondWithResult(_0x440883,null))[_0xe0e5('0x54')](handleError(_0x440883,null));};var interaction_log=require('../../config/logger')(_0xe0e5('0x57'));exports[_0xe0e5('0x74')]=function(_0x27ffc7,_0x431dae,_0x717418){var _0x47d760={'agent':{},'channel':_0xe0e5('0x75')};if(_0x27ffc7[_0xe0e5('0x55')]['id']){delete _0x27ffc7['body']['id'];}_0x27ffc7[_0xe0e5('0x55')]['UserId']=_0x27ffc7['body'][_0xe0e5('0x5a')]||_0x27ffc7[_0xe0e5('0x5b')]['id'];_0x47d760[_0xe0e5('0x5c')]['id']=_0x27ffc7['body']['UserId'];return db[_0xe0e5('0x4d')][_0xe0e5('0x53')]({'where':{'id':_0x27ffc7[_0xe0e5('0x51')]['id'],'UserId':null}})[_0xe0e5('0x1f')](handleEntityNotFound(_0x431dae,null))[_0xe0e5('0x1f')](function(_0x5a70c6){if(_0x5a70c6){_0x47d760[_0xe0e5('0x27')]=_0x5a70c6['get']({'plain':!![]});return db[_0xe0e5('0x5e')]['find']({'where':{'id':_0x5a70c6['FaxInteractionId']}});}return null;})[_0xe0e5('0x1f')](handleEntityNotFound(_0x431dae,null))['then'](function(_0x51a026){if(_0x51a026){_0x47d760[_0xe0e5('0x61')]=_0x51a026[_0xe0e5('0x5d')]({'plain':!![]});interaction_log['info'](_0xe0e5('0x76'),_0x27ffc7[_0xe0e5('0x5b')]['id'],_0x27ffc7[_0xe0e5('0x5b')][_0xe0e5('0x34')],_0x27ffc7['user'][_0xe0e5('0x63')],_0x47d760[_0xe0e5('0x61')]['id'],_0x27ffc7[_0xe0e5('0x55')]?JSON[_0xe0e5('0x64')](_0x27ffc7[_0xe0e5('0x55')]):'null');return respondWithRpcPromise(_0xe0e5('0x77'),_0xe0e5('0x78'),_0x47d760);}return null;})[_0xe0e5('0x1f')](function(_0x694470){var _0x1a10b7=_0xe0e5('0x79')+_0x694470[_0xe0e5('0x27')][_0xe0e5('0x68')];return db[_0xe0e5('0x69')][_0xe0e5('0x3b')](_0x1a10b7,{'type':db[_0xe0e5('0x7a')]['QueryTypes'][_0xe0e5('0x6a')],'raw':!![]})['then'](function(_0x2adfdb){return _0x2adfdb;});})['then'](function(_0x2f0649){if(_0x2f0649){_0x47d760[_0xe0e5('0x27')][_0xe0e5('0x6b')]=_0x2f0649[0x0];if(!_0x27ffc7[_0xe0e5('0x55')][_0xe0e5('0x5a')])return;return db['User'][_0xe0e5('0x53')]({'where':{'id':_0x27ffc7[_0xe0e5('0x55')][_0xe0e5('0x5a')],'role':_0xe0e5('0x5c')},'attributes':['id',_0xe0e5('0x34'),_0xe0e5('0x6d'),_0xe0e5('0x6e'),_0xe0e5('0x6f')],'raw':!![]});}return null;})[_0xe0e5('0x1f')](function(_0x3d8e0b){if(!_0x3d8e0b)return null;_0x47d760['message']['agent']=_0x3d8e0b;return _0x47d760;})[_0xe0e5('0x1f')](function(_0x2e2d11){if(_0x2e2d11){_0x2e2d11[_0xe0e5('0x27')][_0xe0e5('0x7b')]=util[_0xe0e5('0x60')]('SIP/%s',_0x27ffc7[_0xe0e5('0x5b')][_0xe0e5('0x34')]);_0x2e2d11[_0xe0e5('0x27')][_0xe0e5('0x71')]=_0x47d760[_0xe0e5('0x71')];_0x2e2d11[_0xe0e5('0x27')][_0xe0e5('0x7c')]='reject';respondWithRpcPromise(_0xe0e5('0x72'),'EventManager',{'event':_0xe0e5('0x7d'),'message':_0x2e2d11['message']},client9002);return _0x47d760;}return null;})[_0xe0e5('0x1f')](respondWithResult(_0x431dae,null))[_0xe0e5('0x54')](handleError(_0x431dae,null));};exports['create']=function(_0x19ae27,_0x228ce3){var _0x1519ae;return db[_0xe0e5('0x4d')][_0xe0e5('0x7e')](_0x19ae27[_0xe0e5('0x55')],{})[_0xe0e5('0x1f')](function(_0x101f04){_0x1519ae=_0x101f04;return db[_0xe0e5('0x7f')][_0xe0e5('0x80')]({'where':{'id':_0x1519ae['ContactId']}});})['then'](function(_0x218106){if(_[_0xe0e5('0x81')](_0x218106)){return;}else{_0x1519ae[_0xe0e5('0x75')]=_0x218106[_0xe0e5('0x75')];return db[_0xe0e5('0x82')][_0xe0e5('0x80')]({'where':{'id':_0x1519ae['AttachmentId']}});}})[_0xe0e5('0x1f')](function(_0x39cffc){return respondWithRpcPromise(_0xe0e5('0x83'),_0xe0e5('0x83'),{'FaxAccountId':_[_0xe0e5('0x81')](_0x19ae27[_0xe0e5('0x55')])?undefined:_0x19ae27['body'][_0xe0e5('0x84')],'path':_[_0xe0e5('0x81')](_0x39cffc)?undefined:util[_0xe0e5('0x60')](_0xe0e5('0x85'),_0x39cffc['basename']),'fax':_[_0xe0e5('0x81')](_0x1519ae[_0xe0e5('0x75')])?undefined:_0x1519ae[_0xe0e5('0x75')],'AttachmentId':_0x1519ae[_0xe0e5('0x86')]},client9002);})['then'](respondWithResult(_0x228ce3,0xc9))[_0xe0e5('0x54')](handleError(_0x228ce3,null));};exports[_0xe0e5('0x87')]=function(_0x52fddd,_0x252a3a){var _0x1437a2=path[_0xe0e5('0x88')](config[_0xe0e5('0x89')],'server','files',_0xe0e5('0x8a'));return db[_0xe0e5('0x4d')][_0xe0e5('0x53')]({'where':{'id':_0x52fddd[_0xe0e5('0x51')]['id']},'include':[{'model':db[_0xe0e5('0x82')],'as':_0xe0e5('0x82')}]})[_0xe0e5('0x1f')](handleEntityNotFound(_0x252a3a,null))['then'](function(_0x58685e){if(_0x58685e){return _0x252a3a[_0xe0e5('0x87')](path['join'](_0x1437a2,_0x58685e[_0xe0e5('0x82')][_0xe0e5('0x8b')]));}})['catch'](handleError(_0x252a3a,null));}; \ No newline at end of file +var _0xf7f4=['offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','index','map','FaxMessage','rawAttributes','fieldName','key','model','keys','intersection','query','fields','attributes','hasOwnProperty','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','length','find','catch','body','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','email','internal','interface','SIP/%s','channel','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','QueryTypes','User','rejectmessage','create','CmContact','findOne','isNil','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','Attachment','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','client','http','then','FaxMessage,\x20%s,\x20%s','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','status','end','json'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0xf7f4,0xe9));var _0x4f7f=function(_0x44d00e,_0x3f76a0){_0x44d00e=_0x44d00e-0x0;var _0x24ffcf=_0xf7f4[_0x44d00e];return _0x24ffcf;};'use strict';var emlformat=require(_0x4f7f('0x0'));var rimraf=require(_0x4f7f('0x1'));var zipdir=require(_0x4f7f('0x2'));var jsonpatch=require(_0x4f7f('0x3'));var rp=require(_0x4f7f('0x4'));var moment=require(_0x4f7f('0x5'));var BPromise=require(_0x4f7f('0x6'));var Mustache=require(_0x4f7f('0x7'));var util=require('util');var path=require(_0x4f7f('0x8'));var sox=require(_0x4f7f('0x9'));var csv=require(_0x4f7f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4f7f('0xb'));var _=require(_0x4f7f('0xc'));var squel=require(_0x4f7f('0xd'));var crypto=require('crypto');var jsforce=require(_0x4f7f('0xe'));var deskjs=require(_0x4f7f('0xf'));var toCsv=require(_0x4f7f('0xa'));var querystring=require(_0x4f7f('0x10'));var Papa=require('papaparse');var Redis=require(_0x4f7f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4f7f('0x12'));var hardwareService=require(_0x4f7f('0x13'));var logger=require(_0x4f7f('0x14'))(_0x4f7f('0x15'));var utils=require(_0x4f7f('0x16'));var config=require(_0x4f7f('0x17'));var licenseUtil=require(_0x4f7f('0x18'));var db=require(_0x4f7f('0x19'))['db'];config[_0x4f7f('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4f7f('0x1b'))(new Redis(config[_0x4f7f('0x1a')]));require('./faxMessage.socket')[_0x4f7f('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4f7f('0x1d')][_0x4f7f('0x1e')]({'port':0x232c});var client9002=jayson[_0x4f7f('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13afd2,_0x25d4ca,_0x1e85f2,_0x2a4581){return new BPromise(function(_0x459b25,_0x2ad968){var _0x5d99b4=_0x2a4581||client;return _0x5d99b4['request'](_0x13afd2,_0x1e85f2)[_0x4f7f('0x1f')](function(_0x936b77){logger['info'](_0x4f7f('0x20'),_0x25d4ca,'request\x20sent');logger['debug'](_0x4f7f('0x21'),_0x25d4ca,'request\x20sent',JSON[_0x4f7f('0x22')](_0x936b77));if(_0x936b77[_0x4f7f('0x23')]){if(_0x936b77[_0x4f7f('0x23')]['code']===0x1f4){logger[_0x4f7f('0x23')](_0x4f7f('0x20'),_0x25d4ca,_0x936b77['error'][_0x4f7f('0x24')]);return _0x2ad968(_0x936b77[_0x4f7f('0x23')][_0x4f7f('0x24')]);}logger[_0x4f7f('0x23')]('FaxMessage,\x20%s,\x20%s',_0x25d4ca,_0x936b77['error'][_0x4f7f('0x24')]);return _0x459b25(_0x936b77[_0x4f7f('0x23')]['message']);}else{logger[_0x4f7f('0x25')](_0x4f7f('0x20'),_0x25d4ca,_0x4f7f('0x26'));_0x459b25(_0x936b77[_0x4f7f('0x27')][_0x4f7f('0x24')]);}})['catch'](function(_0x883ffd){logger[_0x4f7f('0x23')](_0x4f7f('0x20'),_0x25d4ca,_0x883ffd);_0x2ad968(_0x883ffd);});});}function respondWithStatusCode(_0x2283ff,_0x1ba76f){_0x1ba76f=_0x1ba76f||0xcc;return function(_0xf607b3){if(_0xf607b3){return _0x2283ff['sendStatus'](_0x1ba76f);}return _0x2283ff[_0x4f7f('0x28')](_0x1ba76f)[_0x4f7f('0x29')]();};}function respondWithResult(_0x593c86,_0x164490){_0x164490=_0x164490||0xc8;return function(_0x577249){if(_0x577249){return _0x593c86['status'](_0x164490)[_0x4f7f('0x2a')](_0x577249);}};}function respondWithFilteredResult(_0x49ac02,_0xc25feb){return function(_0x3a7e3b){if(_0x3a7e3b){var _0xb56d33=typeof _0xc25feb[_0x4f7f('0x2b')]===_0x4f7f('0x2c')&&typeof _0xc25feb[_0x4f7f('0x2d')]===_0x4f7f('0x2c');var _0x4b6769=_0x3a7e3b[_0x4f7f('0x2e')];var _0x29937f=_0xb56d33?0x0:_0xc25feb[_0x4f7f('0x2b')];var _0x2e040c=_0xb56d33?_0x3a7e3b[_0x4f7f('0x2e')]:_0xc25feb[_0x4f7f('0x2b')]+_0xc25feb[_0x4f7f('0x2d')];var _0x1cfbb6;if(_0x2e040c>=_0x4b6769){_0x2e040c=_0x4b6769;_0x1cfbb6=0xc8;}else{_0x1cfbb6=0xce;}_0x49ac02[_0x4f7f('0x28')](_0x1cfbb6);return _0x49ac02['set'](_0x4f7f('0x2f'),_0x29937f+'-'+_0x2e040c+'/'+_0x4b6769)[_0x4f7f('0x2a')](_0x3a7e3b);}return null;};}function patchUpdates(_0x881040){return function(_0x7fb8d8){try{jsonpatch[_0x4f7f('0x30')](_0x7fb8d8,_0x881040,!![]);}catch(_0x2119cd){return BPromise[_0x4f7f('0x31')](_0x2119cd);}return _0x7fb8d8[_0x4f7f('0x32')]();};}function saveUpdates(_0x3b7a22,_0x504d64){return function(_0x1d8093){if(_0x1d8093){return _0x1d8093[_0x4f7f('0x33')](_0x3b7a22)[_0x4f7f('0x1f')](function(_0x3bdb7e){return _0x3bdb7e;});}return null;};}function removeEntity(_0x2e13f0,_0x1cee72){return function(_0x8e715c){if(_0x8e715c){return _0x8e715c[_0x4f7f('0x34')]()[_0x4f7f('0x1f')](function(){_0x2e13f0['status'](0xcc)[_0x4f7f('0x29')]();});}};}function handleEntityNotFound(_0x5abb25,_0x1b8f53){return function(_0x15cdeb){if(!_0x15cdeb){_0x5abb25[_0x4f7f('0x35')](0x194);}return _0x15cdeb;};}function handleError(_0x30cb8b,_0x449b67){_0x449b67=_0x449b67||0x1f4;return function(_0x2a4caa){logger[_0x4f7f('0x23')](_0x2a4caa[_0x4f7f('0x36')]);if(_0x2a4caa[_0x4f7f('0x37')]){delete _0x2a4caa[_0x4f7f('0x37')];}_0x30cb8b[_0x4f7f('0x28')](_0x449b67)['send'](_0x2a4caa);};}exports[_0x4f7f('0x38')]=function(_0x3e54d6,_0x35978e){var _0x2b3065={},_0x1afecd={},_0x2762a9={'count':0x0,'rows':[]};var _0x7a0750=_[_0x4f7f('0x39')](db[_0x4f7f('0x3a')][_0x4f7f('0x3b')],function(_0x14e77a){return{'name':_0x14e77a[_0x4f7f('0x3c')],'type':_0x14e77a['type'][_0x4f7f('0x3d')]};});_0x1afecd[_0x4f7f('0x3e')]=_[_0x4f7f('0x39')](_0x7a0750,'name');_0x1afecd['query']=_[_0x4f7f('0x3f')](_0x3e54d6['query']);_0x1afecd['filters']=_[_0x4f7f('0x40')](_0x1afecd['model'],_0x1afecd[_0x4f7f('0x41')]);_0x2b3065['attributes']=_[_0x4f7f('0x40')](_0x1afecd[_0x4f7f('0x3e')],qs[_0x4f7f('0x42')](_0x3e54d6['query'][_0x4f7f('0x42')]));_0x2b3065[_0x4f7f('0x43')]=_0x2b3065['attributes']['length']?_0x2b3065['attributes']:_0x1afecd['model'];if(!_0x3e54d6[_0x4f7f('0x41')][_0x4f7f('0x44')]('nolimit')){_0x2b3065[_0x4f7f('0x2d')]=qs[_0x4f7f('0x2d')](_0x3e54d6[_0x4f7f('0x41')][_0x4f7f('0x2d')]);_0x2b3065[_0x4f7f('0x2b')]=qs[_0x4f7f('0x2b')](_0x3e54d6[_0x4f7f('0x41')]['offset']);}_0x2b3065[_0x4f7f('0x45')]=qs[_0x4f7f('0x46')](_0x3e54d6[_0x4f7f('0x41')][_0x4f7f('0x46')]);_0x2b3065['where']=qs[_0x4f7f('0x47')](_[_0x4f7f('0x48')](_0x3e54d6['query'],_0x1afecd[_0x4f7f('0x47')]),_0x7a0750);if(_0x3e54d6[_0x4f7f('0x41')][_0x4f7f('0x49')]){_0x2b3065[_0x4f7f('0x4a')]=_[_0x4f7f('0x4b')](_0x2b3065['where'],{'$or':_[_0x4f7f('0x39')](_0x7a0750,function(_0x5b18bb){if(_0x5b18bb[_0x4f7f('0x4c')]!==_0x4f7f('0x4d')){var _0xf2d168={};_0xf2d168[_0x5b18bb[_0x4f7f('0x37')]]={'$like':'%'+_0x3e54d6['query'][_0x4f7f('0x49')]+'%'};return _0xf2d168;}})});}_0x2b3065=_['merge']({},_0x2b3065,_0x3e54d6[_0x4f7f('0x4e')]);var _0x362a84={'where':_0x2b3065['where']};return db[_0x4f7f('0x3a')][_0x4f7f('0x2e')](_0x362a84)['then'](function(_0x598f34){_0x2762a9[_0x4f7f('0x2e')]=_0x598f34;if(_0x3e54d6[_0x4f7f('0x41')][_0x4f7f('0x4f')]){_0x2b3065[_0x4f7f('0x50')]=[{'all':!![]}];}return db['FaxMessage'][_0x4f7f('0x51')](_0x2b3065);})[_0x4f7f('0x1f')](function(_0x4bcd9a){_0x2762a9[_0x4f7f('0x52')]=_0x4bcd9a;return _0x2762a9;})[_0x4f7f('0x1f')](respondWithFilteredResult(_0x35978e,_0x2b3065))['catch'](handleError(_0x35978e,null));};exports['show']=function(_0x5e8a0d,_0xdb3d){var _0xed0645={'raw':!![],'where':{'id':_0x5e8a0d[_0x4f7f('0x53')]['id']}},_0x358a68={};_0x358a68[_0x4f7f('0x3e')]=_[_0x4f7f('0x3f')](db[_0x4f7f('0x3a')][_0x4f7f('0x3b')]);_0x358a68[_0x4f7f('0x41')]=_[_0x4f7f('0x3f')](_0x5e8a0d[_0x4f7f('0x41')]);_0x358a68[_0x4f7f('0x47')]=_[_0x4f7f('0x40')](_0x358a68[_0x4f7f('0x3e')],_0x358a68[_0x4f7f('0x41')]);_0xed0645[_0x4f7f('0x43')]=_['intersection'](_0x358a68[_0x4f7f('0x3e')],qs['fields'](_0x5e8a0d[_0x4f7f('0x41')]['fields']));_0xed0645[_0x4f7f('0x43')]=_0xed0645[_0x4f7f('0x43')][_0x4f7f('0x54')]?_0xed0645[_0x4f7f('0x43')]:_0x358a68[_0x4f7f('0x3e')];if(_0x5e8a0d[_0x4f7f('0x41')][_0x4f7f('0x4f')]){_0xed0645['include']=[{'all':!![]}];}_0xed0645=_[_0x4f7f('0x4b')]({},_0xed0645,_0x5e8a0d[_0x4f7f('0x4e')]);return db[_0x4f7f('0x3a')][_0x4f7f('0x55')](_0xed0645)['then'](handleEntityNotFound(_0xdb3d,null))['then'](respondWithResult(_0xdb3d,null))[_0x4f7f('0x56')](handleError(_0xdb3d,null));};exports['update']=function(_0x7d87b2,_0x5940af){if(_0x7d87b2[_0x4f7f('0x57')]['id']){delete _0x7d87b2[_0x4f7f('0x57')]['id'];}return db[_0x4f7f('0x3a')][_0x4f7f('0x55')]({'where':{'id':_0x7d87b2[_0x4f7f('0x53')]['id']}})[_0x4f7f('0x1f')](handleEntityNotFound(_0x5940af,null))['then'](saveUpdates(_0x7d87b2[_0x4f7f('0x57')],null))[_0x4f7f('0x1f')](respondWithResult(_0x5940af,null))[_0x4f7f('0x56')](handleError(_0x5940af,null));};exports[_0x4f7f('0x34')]=function(_0x54fe2e,_0x4734f6){return db[_0x4f7f('0x3a')][_0x4f7f('0x55')]({'where':{'id':_0x54fe2e['params']['id']}})['then'](handleEntityNotFound(_0x4734f6,null))['then'](removeEntity(_0x4734f6,null))[_0x4f7f('0x56')](handleError(_0x4734f6,null));};exports['describe']=function(_0x4ec941,_0x271611){return db[_0x4f7f('0x3a')][_0x4f7f('0x58')]()[_0x4f7f('0x1f')](respondWithResult(_0x271611,null))[_0x4f7f('0x56')](handleError(_0x271611,null));};var interaction_log=require(_0x4f7f('0x14'))(_0x4f7f('0x59'));exports[_0x4f7f('0x5a')]=function(_0x2fec51,_0x46c9a2,_0x146776){var _0x3b921d={'agent':{},'channel':_0x4f7f('0x5b')};if(_0x2fec51[_0x4f7f('0x57')]['id']){delete _0x2fec51[_0x4f7f('0x57')]['id'];}_0x2fec51[_0x4f7f('0x57')]['read']=!![];_0x2fec51['body'][_0x4f7f('0x5c')]=moment()[_0x4f7f('0x5d')](_0x4f7f('0x5e'));_0x2fec51[_0x4f7f('0x57')][_0x4f7f('0x5f')]=_0x2fec51[_0x4f7f('0x57')][_0x4f7f('0x5f')]||_0x2fec51[_0x4f7f('0x60')]['id'];_0x3b921d[_0x4f7f('0x61')]['id']=_0x2fec51[_0x4f7f('0x57')]['UserId'];return db[_0x4f7f('0x3a')][_0x4f7f('0x55')]({'where':{'id':_0x2fec51['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x46c9a2,null))[_0x4f7f('0x1f')](saveUpdates(_0x2fec51[_0x4f7f('0x57')],null))[_0x4f7f('0x1f')](function(_0x50188e){if(_0x50188e){_0x3b921d[_0x4f7f('0x24')]=_0x50188e[_0x4f7f('0x62')]({'plain':!![]});return db[_0x4f7f('0x63')][_0x4f7f('0x55')]({'where':{'id':_0x50188e[_0x4f7f('0x64')]}});}return null;})[_0x4f7f('0x1f')](handleEntityNotFound(_0x46c9a2,null))['then'](function(_0x541227){if(_0x541227){return _0x541227[_0x4f7f('0x33')]({'UserId':_0x2fec51[_0x4f7f('0x57')][_0x4f7f('0x5f')],'read1stAt':_['isNil'](_0x541227[_0x4f7f('0x65')])?moment()[_0x4f7f('0x5d')](_0x4f7f('0x5e')):undefined});}return null;})[_0x4f7f('0x1f')](function(_0x5121fa){if(_0x5121fa){_0x3b921d[_0x4f7f('0x66')]=_0x5121fa['get']({'plain':!![]});interaction_log[_0x4f7f('0x25')](_0x4f7f('0x67'),_0x2fec51[_0x4f7f('0x60')]['id'],_0x2fec51[_0x4f7f('0x60')][_0x4f7f('0x37')],_0x2fec51[_0x4f7f('0x60')][_0x4f7f('0x68')],_0x3b921d['interaction']['id'],_0x2fec51['body']?JSON[_0x4f7f('0x22')](_0x2fec51[_0x4f7f('0x57')]):'null');return respondWithRpcPromise(_0x4f7f('0x69'),_0x4f7f('0x6a'),_0x3b921d);}return null;})['then'](function(_0x3ebe70){var _0x2bb0de=_0x4f7f('0x6b')+_0x3ebe70[_0x4f7f('0x24')]['ContactId'];return db[_0x4f7f('0x6c')][_0x4f7f('0x41')](_0x2bb0de,{'type':db[_0x4f7f('0x6d')]['QueryTypes'][_0x4f7f('0x6e')],'raw':!![]})[_0x4f7f('0x1f')](function(_0x59e0fb){return _0x59e0fb;});})['then'](function(_0x2d620f){if(_0x2d620f){_0x3b921d[_0x4f7f('0x24')]['contact']=_0x2d620f[0x0];if(!_0x2fec51[_0x4f7f('0x57')][_0x4f7f('0x5f')])return;return db['User'][_0x4f7f('0x55')]({'where':{'id':_0x2fec51[_0x4f7f('0x57')][_0x4f7f('0x5f')],'role':'agent'},'attributes':['id',_0x4f7f('0x37'),'fullname',_0x4f7f('0x6f'),_0x4f7f('0x70')],'raw':!![]});}return null;})[_0x4f7f('0x1f')](function(_0x5049e3){if(!_0x5049e3)return null;_0x3b921d['message']['agent']=_0x5049e3;return _0x3b921d;})[_0x4f7f('0x1f')](function(_0x42910d){if(_0x42910d){if(_0x2fec51[_0x4f7f('0x57')]['manual']){_0x3b921d['message'][_0x4f7f('0x71')]=util[_0x4f7f('0x5d')](_0x4f7f('0x72'),_0x2fec51[_0x4f7f('0x60')][_0x4f7f('0x37')]);_0x3b921d[_0x4f7f('0x24')][_0x4f7f('0x73')]=_0x3b921d['channel'];_0x3b921d[_0x4f7f('0x24')]['event']=_0x4f7f('0x5a');return respondWithRpcPromise('EventManager',_0x4f7f('0x74'),{'event':'acceptmessage','message':_0x3b921d['message']},client9002)[_0x4f7f('0x1f')](function(){return _0x3b921d;});}return _0x3b921d;}return null;})[_0x4f7f('0x1f')](respondWithResult(_0x46c9a2,null))[_0x4f7f('0x56')](handleError(_0x46c9a2,null));};var interaction_log=require(_0x4f7f('0x14'))(_0x4f7f('0x59'));exports['reject']=function(_0x5603d5,_0xaefa9b,_0x399a86){var _0x137aab={'agent':{},'channel':_0x4f7f('0x5b')};if(_0x5603d5['body']['id']){delete _0x5603d5['body']['id'];}_0x5603d5[_0x4f7f('0x57')][_0x4f7f('0x5f')]=_0x5603d5['body'][_0x4f7f('0x5f')]||_0x5603d5[_0x4f7f('0x60')]['id'];_0x137aab[_0x4f7f('0x61')]['id']=_0x5603d5[_0x4f7f('0x57')][_0x4f7f('0x5f')];return db[_0x4f7f('0x3a')][_0x4f7f('0x55')]({'where':{'id':_0x5603d5[_0x4f7f('0x53')]['id'],'UserId':null}})[_0x4f7f('0x1f')](handleEntityNotFound(_0xaefa9b,null))['then'](function(_0x311323){if(_0x311323){_0x137aab[_0x4f7f('0x24')]=_0x311323['get']({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x311323[_0x4f7f('0x64')]}});}return null;})[_0x4f7f('0x1f')](handleEntityNotFound(_0xaefa9b,null))['then'](function(_0x5376b9){if(_0x5376b9){_0x137aab[_0x4f7f('0x66')]=_0x5376b9[_0x4f7f('0x62')]({'plain':!![]});interaction_log['info'](_0x4f7f('0x75'),_0x5603d5[_0x4f7f('0x60')]['id'],_0x5603d5[_0x4f7f('0x60')][_0x4f7f('0x37')],_0x5603d5[_0x4f7f('0x60')]['role'],_0x137aab['interaction']['id'],_0x5603d5[_0x4f7f('0x57')]?JSON['stringify'](_0x5603d5[_0x4f7f('0x57')]):_0x4f7f('0x76'));return respondWithRpcPromise(_0x4f7f('0x77'),_0x4f7f('0x78'),_0x137aab);}return null;})['then'](function(_0x451485){var _0x664780=_0x4f7f('0x6b')+_0x451485['message'][_0x4f7f('0x79')];return db['sequelize'][_0x4f7f('0x41')](_0x664780,{'type':db[_0x4f7f('0x6d')][_0x4f7f('0x7a')]['SELECT'],'raw':!![]})[_0x4f7f('0x1f')](function(_0x5c1856){return _0x5c1856;});})[_0x4f7f('0x1f')](function(_0x47f6cc){if(_0x47f6cc){_0x137aab[_0x4f7f('0x24')]['contact']=_0x47f6cc[0x0];if(!_0x5603d5['body'][_0x4f7f('0x5f')])return;return db[_0x4f7f('0x7b')][_0x4f7f('0x55')]({'where':{'id':_0x5603d5[_0x4f7f('0x57')][_0x4f7f('0x5f')],'role':_0x4f7f('0x61')},'attributes':['id','name','fullname','email',_0x4f7f('0x70')],'raw':!![]});}return null;})[_0x4f7f('0x1f')](function(_0x5baeb8){if(!_0x5baeb8)return null;_0x137aab[_0x4f7f('0x24')][_0x4f7f('0x61')]=_0x5baeb8;return _0x137aab;})[_0x4f7f('0x1f')](function(_0x528352){if(_0x528352){_0x528352[_0x4f7f('0x24')][_0x4f7f('0x71')]=util[_0x4f7f('0x5d')](_0x4f7f('0x72'),_0x5603d5[_0x4f7f('0x60')][_0x4f7f('0x37')]);_0x528352[_0x4f7f('0x24')][_0x4f7f('0x73')]=_0x137aab[_0x4f7f('0x73')];_0x528352[_0x4f7f('0x24')]['event']=_0x4f7f('0x31');respondWithRpcPromise(_0x4f7f('0x74'),_0x4f7f('0x74'),{'event':_0x4f7f('0x7c'),'message':_0x528352['message']},client9002);return _0x137aab;}return null;})[_0x4f7f('0x1f')](respondWithResult(_0xaefa9b,null))[_0x4f7f('0x56')](handleError(_0xaefa9b,null));};exports[_0x4f7f('0x7d')]=function(_0x3f299d,_0x3c9a3e){var _0x6045e2;return db[_0x4f7f('0x3a')]['create'](_0x3f299d[_0x4f7f('0x57')],{})[_0x4f7f('0x1f')](function(_0x59655a){_0x6045e2=_0x59655a;return db[_0x4f7f('0x7e')][_0x4f7f('0x7f')]({'where':{'id':_0x6045e2['ContactId']}});})['then'](function(_0x5cb9d0){if(_[_0x4f7f('0x80')](_0x5cb9d0)){return;}else{_0x6045e2['fax']=_0x5cb9d0['fax'];return db['Attachment'][_0x4f7f('0x7f')]({'where':{'id':_0x6045e2[_0x4f7f('0x81')]}});}})[_0x4f7f('0x1f')](function(_0x1b0713){return respondWithRpcPromise(_0x4f7f('0x82'),'SendFax',{'FaxAccountId':_['isNil'](_0x3f299d['body'])?undefined:_0x3f299d[_0x4f7f('0x57')][_0x4f7f('0x83')],'path':_[_0x4f7f('0x80')](_0x1b0713)?undefined:util[_0x4f7f('0x5d')](_0x4f7f('0x84'),_0x1b0713[_0x4f7f('0x85')]),'fax':_[_0x4f7f('0x80')](_0x6045e2[_0x4f7f('0x5b')])?undefined:_0x6045e2[_0x4f7f('0x5b')],'AttachmentId':_0x6045e2[_0x4f7f('0x81')]},client9002);})[_0x4f7f('0x1f')](respondWithResult(_0x3c9a3e,0xc9))[_0x4f7f('0x56')](handleError(_0x3c9a3e,null));};exports[_0x4f7f('0x86')]=function(_0x19450b,_0x3f5d29){var _0x17b818=path[_0x4f7f('0x87')](config[_0x4f7f('0x88')],'server','files','attachments');return db['FaxMessage'][_0x4f7f('0x55')]({'where':{'id':_0x19450b[_0x4f7f('0x53')]['id']},'include':[{'model':db[_0x4f7f('0x89')],'as':_0x4f7f('0x89')}]})[_0x4f7f('0x1f')](handleEntityNotFound(_0x3f5d29,null))['then'](function(_0x4b8da8){if(_0x4b8da8){return _0x3f5d29['download'](path['join'](_0x17b818,_0x4b8da8[_0x4f7f('0x89')][_0x4f7f('0x85')]));}})[_0x4f7f('0x56')](handleError(_0x3f5d29,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 79b040d..e88340e 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 _0x0309=['hook','events','../../mysqldb','FaxMessage','setMaxListeners','save','remove'];(function(_0x1a5dc4,_0x47a784){var _0x1f4f67=function(_0xa7477c){while(--_0xa7477c){_0x1a5dc4['push'](_0x1a5dc4['shift']());}};_0x1f4f67(++_0x47a784);}(_0x0309,0x8d));var _0x9030=function(_0x570ce1,_0x44b802){_0x570ce1=_0x570ce1-0x0;var _0x6aaa79=_0x0309[_0x570ce1];return _0x6aaa79;};'use strict';var EventEmitter=require(_0x9030('0x0'));var FaxMessage=require(_0x9030('0x1'))['db'][_0x9030('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x9030('0x3')](0x0);var events={'afterCreate':_0x9030('0x4'),'afterUpdate':'update','afterDestroy':_0x9030('0x5')};function emitEvent(_0x1131fd){return function(_0x4aa8c5,_0x52abf3,_0x300f73){FaxMessageEvents['emit'](_0x1131fd+':'+_0x4aa8c5['id'],_0x4aa8c5);FaxMessageEvents['emit'](_0x1131fd,_0x4aa8c5);_0x300f73(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x9030('0x6')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x41ec=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x3daeba,_0x130354){var _0x34500d=function(_0x449f53){while(--_0x449f53){_0x3daeba['push'](_0x3daeba['shift']());}};_0x34500d(++_0x130354);}(_0x41ec,0x143));var _0xc41e=function(_0x12cd9c,_0xef062d){_0x12cd9c=_0x12cd9c-0x0;var _0x942ee=_0x41ec[_0x12cd9c];return _0x942ee;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xc41e('0x0'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc41e('0x1')](0x0);var events={'afterCreate':_0xc41e('0x2'),'afterUpdate':'update','afterDestroy':_0xc41e('0x3')};function emitEvent(_0x19ed31){return function(_0xd3f764,_0xf79325,_0xaa14e8){FaxMessageEvents[_0xc41e('0x4')](_0x19ed31+':'+_0xd3f764['id'],_0xd3f764);FaxMessageEvents[_0xc41e('0x4')](_0x19ed31,_0xd3f764);_0xaa14e8(null);};}for(var e in events){if(events[_0xc41e('0x5')](e)){var event=events[e];FaxMessage[_0xc41e('0x6')](e,emitEvent(event));}}module[_0xc41e('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 296365a..a7ef4f9 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 _0xf927=['findOne','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','FaxInteraction'];(function(_0x172711,_0x3211f6){var _0x3c6260=function(_0x56329e){while(--_0x56329e){_0x172711['push'](_0x172711['shift']());}};_0x3c6260(++_0x3211f6);}(_0xf927,0x1c7));var _0x7f92=function(_0x5dceb8,_0x5aa068){_0x5dceb8=_0x5dceb8-0x0;var _0x24569e=_0xf927[_0x5dceb8];return _0x24569e;};'use strict';var _=require('lodash');var util=require(_0x7f92('0x0'));var logger=require(_0x7f92('0x1'))(_0x7f92('0x2'));var moment=require(_0x7f92('0x3'));var BPromise=require(_0x7f92('0x4'));var rp=require(_0x7f92('0x5'));var fs=require('fs');var path=require(_0x7f92('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7f92('0x7'));module[_0x7f92('0x8')]=function(_0x3600f0,_0x4387a9){return _0x3600f0[_0x7f92('0x9')]('FaxMessage',attributes,{'tableName':_0x7f92('0xa'),'paranoid':![],'indexes':[{'name':_0x7f92('0xb'),'fields':[_0x7f92('0xc')],'type':_0x7f92('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32c8e2,_0x9d3a62,_0x1a89d2){var _0x598159=_0x3600f0[_0x7f92('0xe')];var _0x4f23c8=_0x32c8e2['get']({'plain':!![]});if(_0x4f23c8[_0x7f92('0xf')][_0x7f92('0x10')]()==='in'||_0x4f23c8[_0x7f92('0xf')][_0x7f92('0x10')]()===_0x7f92('0x11')&&!_0x4f23c8['secret']&&!_[_0x7f92('0x12')](_0x4f23c8[_0x7f92('0x13')])){_0x598159[_0x7f92('0x14')][_0x7f92('0x15')]({'where':{'id':_0x4f23c8['FaxInteractionId']}})[_0x7f92('0x16')](function(_0x3f97a4){if(_0x3f97a4){_0x3f97a4['update']({'lastMsgAt':_0x4f23c8[_0x7f92('0x17')],'lastMsgDirection':_0x4f23c8[_0x7f92('0xf')][_0x7f92('0x10')]()});}})[_0x7f92('0x18')](function(_0x10f563){console[_0x7f92('0x19')](_0x10f563);});}_0x1a89d2();}},'charset':_0x7f92('0x1a'),'collate':_0x7f92('0x1b')});}; \ No newline at end of file +var _0x56ba=['models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','fax_messages','body','FULLTEXT'];(function(_0x332192,_0x4139b5){var _0x7766e0=function(_0x1d0f32){while(--_0x1d0f32){_0x332192['push'](_0x332192['shift']());}};_0x7766e0(++_0x4139b5);}(_0x56ba,0x136));var _0xa56b=function(_0x4fbee2,_0x47d02a){_0x4fbee2=_0x4fbee2-0x0;var _0x5e6132=_0x56ba[_0x4fbee2];return _0x5e6132;};'use strict';var _=require(_0xa56b('0x0'));var util=require(_0xa56b('0x1'));var logger=require(_0xa56b('0x2'))(_0xa56b('0x3'));var moment=require(_0xa56b('0x4'));var BPromise=require('bluebird');var rp=require(_0xa56b('0x5'));var fs=require('fs');var path=require(_0xa56b('0x6'));var rimraf=require(_0xa56b('0x7'));var config=require(_0xa56b('0x8'));var attributes=require('./faxMessage.attributes');module[_0xa56b('0x9')]=function(_0x3df82c,_0x5e0817){return _0x3df82c[_0xa56b('0xa')]('FaxMessage',attributes,{'tableName':_0xa56b('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xa56b('0xc')],'type':_0xa56b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3360a2,_0xab44ca,_0x3ed73a){var _0x5ead8a=_0x3df82c[_0xa56b('0xe')];var _0x232b81=_0x3360a2[_0xa56b('0xf')]({'plain':!![]});if(_0x232b81[_0xa56b('0x10')][_0xa56b('0x11')]()==='in'||_0x232b81[_0xa56b('0x10')]['toLowerCase']()==='out'&&!_0x232b81[_0xa56b('0x12')]&&!_[_0xa56b('0x13')](_0x232b81[_0xa56b('0x14')])){_0x5ead8a[_0xa56b('0x15')][_0xa56b('0x16')]({'where':{'id':_0x232b81[_0xa56b('0x17')]}})['then'](function(_0x30375c){if(_0x30375c){_0x30375c[_0xa56b('0x18')]({'lastMsgAt':_0x232b81[_0xa56b('0x19')],'lastMsgDirection':_0x232b81['direction'][_0xa56b('0x11')]()});}})['catch'](function(_0x48911d){console['error'](_0x48911d);});}_0x3ed73a();}},'charset':'utf8mb4','collate':_0xa56b('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 083f54e..419d67b 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 _0x668b=['./faxMessage.socket','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxMessage','FaxMessage','create','body','raw','UpdateFaxMessage','update','options','where','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x48cb9e,_0x3b2c00){var _0x215e83=function(_0xeee0c0){while(--_0xeee0c0){_0x48cb9e['push'](_0x48cb9e['shift']());}};_0x215e83(++_0x3b2c00);}(_0x668b,0x140));var _0xb668=function(_0x51a6d6,_0x3c9c49){_0x51a6d6=_0x51a6d6-0x0;var _0x5ef1a8=_0x668b[_0x51a6d6];return _0x5ef1a8;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var moment=require('moment');var BPromise=require(_0xb668('0x2'));var rs=require(_0xb668('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb668('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb668('0x5'))(_0xb668('0x6'));var config=require(_0xb668('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb668('0x8')][_0xb668('0x9')]({'port':0x232a});config[_0xb668('0xa')]=_[_0xb668('0xb')](config[_0xb668('0xa')],{'host':_0xb668('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb668('0xa')]));require(_0xb668('0xd'))[_0xb668('0xe')](socket);function respondWithRpcPromise(_0x16d50d,_0x39b79c,_0x3606a7){return new BPromise(function(_0x45bc39,_0x3616e9){return client['request'](_0x16d50d,_0x3606a7)[_0xb668('0xf')](function(_0x27dbf7){logger[_0xb668('0x10')](_0xb668('0x11'),_0x39b79c,_0xb668('0x12'));logger[_0xb668('0x13')](_0xb668('0x14'),_0x39b79c,_0xb668('0x12'),JSON[_0xb668('0x15')](_0x27dbf7));if(_0x27dbf7[_0xb668('0x16')]){if(_0x27dbf7[_0xb668('0x16')][_0xb668('0x17')]===0x1f4){logger[_0xb668('0x16')](_0xb668('0x11'),_0x39b79c,_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);return _0x3616e9(_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);}logger[_0xb668('0x16')](_0xb668('0x11'),_0x39b79c,_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);return _0x45bc39(_0x27dbf7['error'][_0xb668('0x18')]);}else{logger['info'](_0xb668('0x11'),_0x39b79c,_0xb668('0x12'));_0x45bc39(_0x27dbf7['result'][_0xb668('0x18')]);}})[_0xb668('0x19')](function(_0x53ff78){logger[_0xb668('0x16')]('FaxMessage,\x20%s,\x20%s',_0x39b79c,_0x53ff78);_0x3616e9(_0x53ff78);});});}exports[_0xb668('0x1a')]=function(_0x178a5d){var _0x253ba5=this;return new Promise(function(_0x12805a,_0x5d33ae){return db[_0xb668('0x1b')][_0xb668('0x1c')](_0x178a5d[_0xb668('0x1d')],{'raw':_0x178a5d['options']?_0x178a5d['options'][_0xb668('0x1e')]===undefined?!![]:![]:!![]})[_0xb668('0xf')](function(_0x517eee){logger[_0xb668('0x10')]('CreateFaxMessage',_0x178a5d);logger[_0xb668('0x13')]('CreateFaxMessage',_0x178a5d,JSON[_0xb668('0x15')](_0x517eee));_0x12805a(_0x517eee);})[_0xb668('0x19')](function(_0x3f84c7){logger[_0xb668('0x16')](_0xb668('0x1a'),_0x3f84c7[_0xb668('0x18')],_0x178a5d);_0x5d33ae(_0x253ba5['error'](0x1f4,_0x3f84c7[_0xb668('0x18')]));});});};exports[_0xb668('0x1f')]=function(_0x2ab8c2){var _0x49abfd=this;return new Promise(function(_0x5e0cee,_0xe62fce){return db[_0xb668('0x1b')][_0xb668('0x20')](_0x2ab8c2['body'],{'raw':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2[_0xb668('0x21')][_0xb668('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ab8c2['options']?_0x2ab8c2['options'][_0xb668('0x22')]||null:null,'attributes':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2['options'][_0xb668('0x23')]||null:null,'limit':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2[_0xb668('0x21')][_0xb668('0x24')]||null:null})[_0xb668('0xf')](function(_0x5f36b5){logger[_0xb668('0x10')](_0xb668('0x1f'),_0x2ab8c2);logger['debug'](_0xb668('0x1f'),_0x2ab8c2,JSON['stringify'](_0x5f36b5));_0x5e0cee(_0x5f36b5);})[_0xb668('0x19')](function(_0x406cc5){logger[_0xb668('0x16')](_0xb668('0x1f'),_0x406cc5[_0xb668('0x18')],_0x2ab8c2);_0xe62fce(_0x49abfd[_0xb668('0x16')](0x1f4,_0x406cc5[_0xb668('0x18')]));});});}; \ No newline at end of file +var _0x70e0=['FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','CreateFaxMessage','FaxMessage','create','body','options','stringify','catch','update','raw','where','limit','UpdateFaxMessage','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info'];(function(_0x17dcd1,_0x3b7ccb){var _0x12af77=function(_0x5c3bac){while(--_0x5c3bac){_0x17dcd1['push'](_0x17dcd1['shift']());}};_0x12af77(++_0x3b7ccb);}(_0x70e0,0x17b));var _0x070e=function(_0x5dc19a,_0x30ed15){_0x5dc19a=_0x5dc19a-0x0;var _0x43722d=_0x70e0[_0x5dc19a];return _0x43722d;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x070e('0x9')],{'host':_0x070e('0xa'),'port':0x18eb});var socket=require(_0x070e('0xb'))(new Redis(config[_0x070e('0x9')]));require(_0x070e('0xc'))[_0x070e('0xd')](socket);function respondWithRpcPromise(_0x11ffa8,_0x4e99e6,_0x49b2fb){return new BPromise(function(_0x50f4eb,_0x2e3e5e){return client[_0x070e('0xe')](_0x11ffa8,_0x49b2fb)[_0x070e('0xf')](function(_0xa927a2){logger[_0x070e('0x10')](_0x070e('0x11'),_0x4e99e6,_0x070e('0x12'));logger[_0x070e('0x13')](_0x070e('0x14'),_0x4e99e6,_0x070e('0x12'),JSON['stringify'](_0xa927a2));if(_0xa927a2['error']){if(_0xa927a2[_0x070e('0x15')]['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x4e99e6,_0xa927a2[_0x070e('0x15')][_0x070e('0x16')]);return _0x2e3e5e(_0xa927a2['error']['message']);}logger[_0x070e('0x15')](_0x070e('0x11'),_0x4e99e6,_0xa927a2[_0x070e('0x15')][_0x070e('0x16')]);return _0x50f4eb(_0xa927a2['error']['message']);}else{logger[_0x070e('0x10')](_0x070e('0x11'),_0x4e99e6,_0x070e('0x12'));_0x50f4eb(_0xa927a2[_0x070e('0x17')][_0x070e('0x16')]);}})['catch'](function(_0x3938b5){logger[_0x070e('0x15')](_0x070e('0x11'),_0x4e99e6,_0x3938b5);_0x2e3e5e(_0x3938b5);});});}exports[_0x070e('0x18')]=function(_0x259893){var _0x5c16fd=this;return new Promise(function(_0x5b2f48,_0x4e958f){return db[_0x070e('0x19')][_0x070e('0x1a')](_0x259893[_0x070e('0x1b')],{'raw':_0x259893['options']?_0x259893[_0x070e('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x070e('0xf')](function(_0x3f6985){logger[_0x070e('0x10')](_0x070e('0x18'),_0x259893);logger[_0x070e('0x13')](_0x070e('0x18'),_0x259893,JSON[_0x070e('0x1d')](_0x3f6985));_0x5b2f48(_0x3f6985);})[_0x070e('0x1e')](function(_0x595c7e){logger[_0x070e('0x15')](_0x070e('0x18'),_0x595c7e[_0x070e('0x16')],_0x259893);_0x4e958f(_0x5c16fd['error'](0x1f4,_0x595c7e[_0x070e('0x16')]));});});};exports['UpdateFaxMessage']=function(_0x4a2dbd){var _0x2ccbd7=this;return new Promise(function(_0x25f6e,_0x41deb1){return db[_0x070e('0x19')][_0x070e('0x1f')](_0x4a2dbd['body'],{'raw':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x21')]||null:null,'attributes':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')]['attributes']||null:null,'limit':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x22')]||null:null})['then'](function(_0x5c5f0d){logger[_0x070e('0x10')](_0x070e('0x23'),_0x4a2dbd);logger[_0x070e('0x13')]('UpdateFaxMessage',_0x4a2dbd,JSON[_0x070e('0x1d')](_0x5c5f0d));_0x25f6e(_0x5c5f0d);})[_0x070e('0x1e')](function(_0x3a9425){logger[_0x070e('0x15')]('UpdateFaxMessage',_0x3a9425['message'],_0x4a2dbd);_0x41deb1(_0x2ccbd7['error'](0x1f4,_0x3a9425['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 4d073da..d30e1fe 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 _0x94cf=['save','remove','update','emit','removeListener','register','length','faxMessage:','./faxMessage.events'];(function(_0x45e5e7,_0x5801d4){var _0x20cecb=function(_0x2af9ac){while(--_0x2af9ac){_0x45e5e7['push'](_0x45e5e7['shift']());}};_0x20cecb(++_0x5801d4);}(_0x94cf,0x1e5));var _0xf94c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94cf[_0x3dd15e];return _0x231fd0;};'use strict';var FaxMessageEvents=require(_0xf94c('0x0'));var events=[_0xf94c('0x1'),_0xf94c('0x2'),_0xf94c('0x3')];function createListener(_0x5e032a,_0x2d1d8b){return function(_0x55d931){_0x2d1d8b[_0xf94c('0x4')](_0x5e032a,_0x55d931);};}function removeListener(_0x45425b,_0x20b45f){return function(){FaxMessageEvents[_0xf94c('0x5')](_0x45425b,_0x20b45f);};}exports[_0xf94c('0x6')]=function(_0x2db8e0){for(var _0x1f9ae7=0x0,_0x2d4d55=events[_0xf94c('0x7')];_0x1f9ae7<_0x2d4d55;_0x1f9ae7++){var _0x122e6a=events[_0x1f9ae7];var _0x266a58=createListener(_0xf94c('0x8')+_0x122e6a,_0x2db8e0);FaxMessageEvents['on'](_0x122e6a,_0x266a58);}}; \ No newline at end of file +var _0x72e7=['removeListener','register','length','./faxMessage.events','save','remove','update','emit'];(function(_0x49f1ee,_0x5c5319){var _0x405342=function(_0xd5f33e){while(--_0xd5f33e){_0x49f1ee['push'](_0x49f1ee['shift']());}};_0x405342(++_0x5c5319);}(_0x72e7,0x12b));var _0x772e=function(_0x41ccfd,_0x211b71){_0x41ccfd=_0x41ccfd-0x0;var _0x18cb49=_0x72e7[_0x41ccfd];return _0x18cb49;};'use strict';var FaxMessageEvents=require(_0x772e('0x0'));var events=[_0x772e('0x1'),_0x772e('0x2'),_0x772e('0x3')];function createListener(_0x51e8c9,_0x450849){return function(_0x197c97){_0x450849[_0x772e('0x4')](_0x51e8c9,_0x197c97);};}function removeListener(_0x277689,_0x1d8e4d){return function(){FaxMessageEvents[_0x772e('0x5')](_0x277689,_0x1d8e4d);};}exports[_0x772e('0x6')]=function(_0x57f076){for(var _0x5d83a8=0x0,_0x4639a1=events[_0x772e('0x7')];_0x5d83a8<_0x4639a1;_0x5d83a8++){var _0x3aa147=events[_0x5d83a8];var _0x1943bb=createListener('faxMessage:'+_0x3aa147,_0x57f076);FaxMessageEvents['on'](_0x3aa147,_0x1943bb);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 3308663..50a1935 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 _0xbdb7=['accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','index','get','describe','show','/:id/download','isAuthenticated','download','post','tracked','put','/:id','update'];(function(_0x3f5dc5,_0xa76303){var _0x3f96bc=function(_0xb7c83f){while(--_0xb7c83f){_0x3f5dc5['push'](_0x3f5dc5['shift']());}};_0x3f96bc(++_0xa76303);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x28ef4e,_0x202aa3){_0x28ef4e=_0x28ef4e-0x0;var _0x1aa097=_0xbdb7[_0x28ef4e];return _0x1aa097;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xb')](_0x7bdb('0xe'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0x11')]('/',auth[_0x7bdb('0xf')](),interaction[_0x7bdb('0x12')]('fax','faxmessage:create'),controller['create']);router[_0x7bdb('0x13')](_0x7bdb('0x14'),auth['isAuthenticated'](),controller[_0x7bdb('0x15')]);router['put']('/:id/accept',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x16')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x7bdb('0x17')]);router[_0x7bdb('0x18')](_0x7bdb('0x14'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x19')]);module[_0x7bdb('0x1a')]=router; \ No newline at end of file +var _0xf45e=['get','isAuthenticated','index','/describe','describe','/:id','show','download','post','tracked','fax','create','put','update','/:id/reject','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller'];(function(_0x21c50d,_0x3660a7){var _0x3958da=function(_0x3edee9){while(--_0x3edee9){_0x21c50d['push'](_0x21c50d['shift']());}};_0x3958da(++_0x3660a7);}(_0xf45e,0x115));var _0xef45=function(_0x39046f,_0x588a92){_0x39046f=_0x39046f-0x0;var _0x3a9e11=_0xf45e[_0x39046f];return _0x3a9e11;};'use strict';var multer=require(_0xef45('0x0'));var util=require('util');var path=require(_0xef45('0x1'));var timeout=require('connect-timeout');var express=require(_0xef45('0x2'));var router=express[_0xef45('0x3')]();var fs_extra=require(_0xef45('0x4'));var auth=require(_0xef45('0x5'));var interaction=require(_0xef45('0x6'));var config=require(_0xef45('0x7'));var controller=require(_0xef45('0x8'));router[_0xef45('0x9')]('/',auth[_0xef45('0xa')](),controller[_0xef45('0xb')]);router[_0xef45('0x9')](_0xef45('0xc'),auth[_0xef45('0xa')](),controller[_0xef45('0xd')]);router[_0xef45('0x9')](_0xef45('0xe'),auth[_0xef45('0xa')](),controller[_0xef45('0xf')]);router[_0xef45('0x9')]('/:id/download',auth[_0xef45('0xa')](),controller[_0xef45('0x10')]);router[_0xef45('0x11')]('/',auth[_0xef45('0xa')](),interaction[_0xef45('0x12')](_0xef45('0x13'),'faxmessage:create'),controller[_0xef45('0x14')]);router[_0xef45('0x15')](_0xef45('0xe'),auth[_0xef45('0xa')](),controller[_0xef45('0x16')]);router['put']('/:id/accept',auth[_0xef45('0xa')](),controller['accept']);router[_0xef45('0x15')](_0xef45('0x17'),auth[_0xef45('0xa')](),controller['reject']);router['delete'](_0xef45('0xe'),auth['isAuthenticated'](),controller[_0xef45('0x18')]);module[_0xef45('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index c7bb5f2..7eaddc3 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 _0xc273=['exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x3f81ca,_0xcbae4c){var _0x351bc8=function(_0x1df8a9){while(--_0x1df8a9){_0x3f81ca['push'](_0x3f81ca['shift']());}};_0x351bc8(++_0xcbae4c);}(_0xc273,0x197));var _0x3c27=function(_0x871ef5,_0x58880b){_0x871ef5=_0x871ef5-0x0;var _0x1f62ea=_0xc273[_0x871ef5];return _0x1f62ea;};'use strict';var Sequelize=require(_0x3c27('0x0'));module[_0x3c27('0x1')]={'name':{'type':Sequelize[_0x3c27('0x2')],'unique':_0x3c27('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3c27('0x2')]},'timeout':{'type':Sequelize[_0x3c27('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3c27('0x5'),_0x3c27('0x6'),_0x3c27('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0355=['STRING','name','INTEGER','rrmemory','sequelize','exports'];(function(_0x5d6667,_0x3f1502){var _0x11449c=function(_0x3d9289){while(--_0x3d9289){_0x5d6667['push'](_0x5d6667['shift']());}};_0x11449c(++_0x3f1502);}(_0x0355,0xca));var _0x5035=function(_0x12a89,_0x59fe53){_0x12a89=_0x12a89-0x0;var _0x2eb391=_0x0355[_0x12a89];return _0x2eb391;};'use strict';var Sequelize=require(_0x5035('0x0'));module[_0x5035('0x1')]={'name':{'type':Sequelize[_0x5035('0x2')],'unique':_0x5035('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5035('0x2')]},'timeout':{'type':Sequelize[_0x5035('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5035('0x5'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index b4f66ed..125629c 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 _0xa636=['json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','FaxQueue','includeAll','rows','params','find','catch','create','body','user','role','get','FaxQueues','UserProfileSection','autoAssociation','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','findAll','User','findAndCountAll','agent','updatedAt','createdAt','format','getTeams','Team','ids','voicePause','interface','flatMap','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','./faxQueue.socket','register','sendStatus','end'];(function(_0x454e77,_0x15351d){var _0x363259=function(_0x2b5b6d){while(--_0x2b5b6d){_0x454e77['push'](_0x454e77['shift']());}};_0x363259(++_0x15351d);}(_0xa636,0x6a));var _0x6a63=function(_0x5eb442,_0xe2ae2e){_0x5eb442=_0x5eb442-0x0;var _0x53aad0=_0xa636[_0x5eb442];return _0x53aad0;};'use strict';var emlformat=require(_0x6a63('0x0'));var rimraf=require(_0x6a63('0x1'));var zipdir=require(_0x6a63('0x2'));var jsonpatch=require(_0x6a63('0x3'));var rp=require(_0x6a63('0x4'));var moment=require(_0x6a63('0x5'));var BPromise=require(_0x6a63('0x6'));var Mustache=require('mustache');var util=require(_0x6a63('0x7'));var path=require(_0x6a63('0x8'));var sox=require(_0x6a63('0x9'));var csv=require(_0x6a63('0xa'));var ejs=require(_0x6a63('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6a63('0xc'));var crypto=require(_0x6a63('0xd'));var jsforce=require(_0x6a63('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6a63('0xa'));var querystring=require(_0x6a63('0xf'));var Papa=require(_0x6a63('0x10'));var Redis=require(_0x6a63('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6a63('0x12'));var as=require(_0x6a63('0x13'));var hardwareService=require(_0x6a63('0x14'));var logger=require(_0x6a63('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6a63('0x16'));var licenseUtil=require(_0x6a63('0x17'));var db=require(_0x6a63('0x18'))['db'];config[_0x6a63('0x19')]=_['defaults'](config[_0x6a63('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6a63('0x19')]));require(_0x6a63('0x1a'))[_0x6a63('0x1b')](socket);function respondWithStatusCode(_0x226dc7,_0x26694f){_0x26694f=_0x26694f||0xcc;return function(_0x51668){if(_0x51668){return _0x226dc7[_0x6a63('0x1c')](_0x26694f);}return _0x226dc7['status'](_0x26694f)[_0x6a63('0x1d')]();};}function respondWithResult(_0x494fb8,_0x500d06){_0x500d06=_0x500d06||0xc8;return function(_0x2cbcbc){if(_0x2cbcbc){return _0x494fb8['status'](_0x500d06)[_0x6a63('0x1e')](_0x2cbcbc);}};}function respondWithFilteredResult(_0x335173,_0x5e230d){return function(_0x328366){if(_0x328366){var _0x27a315=typeof _0x5e230d[_0x6a63('0x1f')]===_0x6a63('0x20')&&typeof _0x5e230d[_0x6a63('0x21')]==='undefined';var _0x2bfc53=_0x328366[_0x6a63('0x22')];var _0x40125e=_0x27a315?0x0:_0x5e230d[_0x6a63('0x1f')];var _0x4e4c6f=_0x27a315?_0x328366['count']:_0x5e230d[_0x6a63('0x1f')]+_0x5e230d[_0x6a63('0x21')];var _0x3278d2;if(_0x4e4c6f>=_0x2bfc53){_0x4e4c6f=_0x2bfc53;_0x3278d2=0xc8;}else{_0x3278d2=0xce;}_0x335173[_0x6a63('0x23')](_0x3278d2);return _0x335173[_0x6a63('0x24')](_0x6a63('0x25'),_0x40125e+'-'+_0x4e4c6f+'/'+_0x2bfc53)[_0x6a63('0x1e')](_0x328366);}return null;};}function patchUpdates(_0x4c5c8a){return function(_0x3e6e44){try{jsonpatch[_0x6a63('0x26')](_0x3e6e44,_0x4c5c8a,!![]);}catch(_0x16573d){return BPromise[_0x6a63('0x27')](_0x16573d);}return _0x3e6e44['save']();};}function saveUpdates(_0x28b865,_0x56f2e4){return function(_0x4bd524){if(_0x4bd524){return _0x4bd524[_0x6a63('0x28')](_0x28b865)[_0x6a63('0x29')](function(_0x522d3c){return _0x522d3c;});}return null;};}function removeEntity(_0x5ce65e,_0x420cee){return function(_0x4b6d60){if(_0x4b6d60){return _0x4b6d60[_0x6a63('0x2a')]()[_0x6a63('0x29')](function(){var _0x118154=_0x4b6d60['get']({'plain':!![]});var _0x21c1c0='FaxQueues';return db[_0x6a63('0x2b')]['destroy']({'where':{'type':_0x21c1c0,'resourceId':_0x118154['id']}})[_0x6a63('0x29')](function(){return _0x4b6d60;});})[_0x6a63('0x29')](function(){_0x5ce65e[_0x6a63('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e7853,_0x52e562){return function(_0x6a2515){if(!_0x6a2515){_0x1e7853[_0x6a63('0x1c')](0x194);}return _0x6a2515;};}function handleError(_0x2a30c4,_0x4bab5b){_0x4bab5b=_0x4bab5b||0x1f4;return function(_0x142d9b){logger[_0x6a63('0x2c')](_0x142d9b['stack']);if(_0x142d9b[_0x6a63('0x2d')]){delete _0x142d9b[_0x6a63('0x2d')];}_0x2a30c4[_0x6a63('0x23')](_0x4bab5b)[_0x6a63('0x2e')](_0x142d9b);};}exports[_0x6a63('0x2f')]=function(_0x52ada6,_0x5ca81f){var _0x45c6de={},_0x387da2={},_0x5c06a0={'count':0x0,'rows':[]};var _0x11cc7c=_[_0x6a63('0x30')](db['FaxQueue'][_0x6a63('0x31')],function(_0x289a02){return{'name':_0x289a02[_0x6a63('0x32')],'type':_0x289a02['type']['key']};});_0x387da2['model']=_['map'](_0x11cc7c,_0x6a63('0x2d'));_0x387da2['query']=_[_0x6a63('0x33')](_0x52ada6[_0x6a63('0x34')]);_0x387da2[_0x6a63('0x35')]=_[_0x6a63('0x36')](_0x387da2[_0x6a63('0x37')],_0x387da2['query']);_0x45c6de['attributes']=_[_0x6a63('0x36')](_0x387da2[_0x6a63('0x37')],qs[_0x6a63('0x38')](_0x52ada6[_0x6a63('0x34')][_0x6a63('0x38')]));_0x45c6de[_0x6a63('0x39')]=_0x45c6de[_0x6a63('0x39')][_0x6a63('0x3a')]?_0x45c6de[_0x6a63('0x39')]:_0x387da2[_0x6a63('0x37')];if(!_0x52ada6['query'][_0x6a63('0x3b')](_0x6a63('0x3c'))){_0x45c6de[_0x6a63('0x21')]=qs[_0x6a63('0x21')](_0x52ada6[_0x6a63('0x34')]['limit']);_0x45c6de[_0x6a63('0x1f')]=qs['offset'](_0x52ada6[_0x6a63('0x34')][_0x6a63('0x1f')]);}_0x45c6de[_0x6a63('0x3d')]=qs['sort'](_0x52ada6[_0x6a63('0x34')][_0x6a63('0x3e')]);_0x45c6de[_0x6a63('0x3f')]=qs[_0x6a63('0x35')](_[_0x6a63('0x40')](_0x52ada6['query'],_0x387da2[_0x6a63('0x35')]),_0x11cc7c);if(_0x52ada6[_0x6a63('0x34')]['filter']){_0x45c6de[_0x6a63('0x3f')]=_[_0x6a63('0x41')](_0x45c6de[_0x6a63('0x3f')],{'$or':_['map'](_0x11cc7c,function(_0x5a0d19){if(_0x5a0d19['type']!==_0x6a63('0x42')){var _0x51b5c9={};_0x51b5c9[_0x5a0d19[_0x6a63('0x2d')]]={'$like':'%'+_0x52ada6[_0x6a63('0x34')][_0x6a63('0x43')]+'%'};return _0x51b5c9;}})});}_0x45c6de=_[_0x6a63('0x41')]({},_0x45c6de,_0x52ada6[_0x6a63('0x44')]);var _0x473e49={'where':_0x45c6de[_0x6a63('0x3f')]};return db[_0x6a63('0x45')]['count'](_0x473e49)['then'](function(_0x4943b9){_0x5c06a0[_0x6a63('0x22')]=_0x4943b9;if(_0x52ada6[_0x6a63('0x34')][_0x6a63('0x46')]){_0x45c6de['include']=[{'all':!![]}];}return db[_0x6a63('0x45')]['findAll'](_0x45c6de);})[_0x6a63('0x29')](function(_0x10bff8){_0x5c06a0[_0x6a63('0x47')]=_0x10bff8;return _0x5c06a0;})['then'](respondWithFilteredResult(_0x5ca81f,_0x45c6de))['catch'](handleError(_0x5ca81f,null));};exports['show']=function(_0x2023c8,_0x3345e1){var _0x1a861b={'raw':!![],'where':{'id':_0x2023c8[_0x6a63('0x48')]['id']}},_0x180d6b={};_0x180d6b[_0x6a63('0x37')]=_['keys'](db[_0x6a63('0x45')][_0x6a63('0x31')]);_0x180d6b['query']=_[_0x6a63('0x33')](_0x2023c8['query']);_0x180d6b[_0x6a63('0x35')]=_['intersection'](_0x180d6b['model'],_0x180d6b['query']);_0x1a861b[_0x6a63('0x39')]=_[_0x6a63('0x36')](_0x180d6b[_0x6a63('0x37')],qs[_0x6a63('0x38')](_0x2023c8['query']['fields']));_0x1a861b[_0x6a63('0x39')]=_0x1a861b[_0x6a63('0x39')]['length']?_0x1a861b['attributes']:_0x180d6b['model'];if(_0x2023c8['query'][_0x6a63('0x46')]){_0x1a861b['include']=[{'all':!![]}];}_0x1a861b=_[_0x6a63('0x41')]({},_0x1a861b,_0x2023c8[_0x6a63('0x44')]);return db['FaxQueue'][_0x6a63('0x49')](_0x1a861b)[_0x6a63('0x29')](handleEntityNotFound(_0x3345e1,null))['then'](respondWithResult(_0x3345e1,null))[_0x6a63('0x4a')](handleError(_0x3345e1,null));};exports[_0x6a63('0x4b')]=function(_0x226120,_0x148939){return db[_0x6a63('0x45')][_0x6a63('0x4b')](_0x226120[_0x6a63('0x4c')],{})['then'](function(_0x44ea06){var _0x53b240=_0x226120[_0x6a63('0x4d')]['get']({'plain':!![]});if(!_0x53b240)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53b240[_0x6a63('0x4e')]==='user'){var _0x2735f1=_0x44ea06[_0x6a63('0x4f')]({'plain':!![]});var _0x189954=_0x6a63('0x50');return db[_0x6a63('0x51')][_0x6a63('0x49')]({'where':{'name':_0x189954,'userProfileId':_0x53b240['userProfileId']},'raw':!![]})[_0x6a63('0x29')](function(_0x33de3a){if(_0x33de3a&&_0x33de3a[_0x6a63('0x52')]===0x0){return db[_0x6a63('0x2b')][_0x6a63('0x4b')]({'name':_0x2735f1[_0x6a63('0x2d')],'resourceId':_0x2735f1['id'],'type':_0x33de3a[_0x6a63('0x2d')],'sectionId':_0x33de3a['id']},{})[_0x6a63('0x29')](function(){return _0x44ea06;});}else{return _0x44ea06;}})['catch'](function(_0x5f09f0){logger[_0x6a63('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f09f0);throw _0x5f09f0;});}return _0x44ea06;})[_0x6a63('0x29')](respondWithResult(_0x148939,0xc9))[_0x6a63('0x4a')](handleError(_0x148939,null));};exports[_0x6a63('0x28')]=function(_0x18203f,_0x3ead4c){if(_0x18203f['body']['id']){delete _0x18203f['body']['id'];}return db[_0x6a63('0x45')][_0x6a63('0x49')]({'where':{'id':_0x18203f[_0x6a63('0x48')]['id']}})[_0x6a63('0x29')](handleEntityNotFound(_0x3ead4c,null))['then'](saveUpdates(_0x18203f[_0x6a63('0x4c')],null))[_0x6a63('0x29')](respondWithResult(_0x3ead4c,null))['catch'](handleError(_0x3ead4c,null));};exports[_0x6a63('0x2a')]=function(_0x4df5c4,_0x36a169){return db[_0x6a63('0x45')][_0x6a63('0x49')]({'where':{'id':_0x4df5c4[_0x6a63('0x48')]['id']}})['then'](handleEntityNotFound(_0x36a169,null))[_0x6a63('0x29')](removeEntity(_0x36a169,null))[_0x6a63('0x4a')](handleError(_0x36a169,null));};exports[_0x6a63('0x53')]=function(_0x5f0599,_0x2e115a){return db['FaxQueue'][_0x6a63('0x53')]()[_0x6a63('0x29')](respondWithResult(_0x2e115a,null))['catch'](handleError(_0x2e115a,null));};exports[_0x6a63('0x54')]=function(_0x26a6c6,_0x26bcfa,_0x4db605){var _0x4d5177={'raw':!![],'where':{}},_0x1ad4c9={},_0x21742c;return db[_0x6a63('0x45')][_0x6a63('0x55')]({'where':{'id':_0x26a6c6[_0x6a63('0x48')]['id']}})[_0x6a63('0x29')](handleEntityNotFound(_0x26bcfa,null))[_0x6a63('0x29')](function(_0x5bf689){if(_0x5bf689){_0x21742c=_0x5bf689[_0x6a63('0x4f')]({'plain':!![]});_0x1ad4c9['model']=_[_0x6a63('0x33')](db[_0x6a63('0x56')][_0x6a63('0x31')]);_0x1ad4c9[_0x6a63('0x34')]=_['keys'](_0x26a6c6['query']);_0x1ad4c9['filters']=_['intersection'](_0x1ad4c9['model'],_0x1ad4c9[_0x6a63('0x34')]);_0x4d5177['attributes']=_[_0x6a63('0x36')](_0x1ad4c9['model'],qs[_0x6a63('0x38')](_0x26a6c6[_0x6a63('0x34')][_0x6a63('0x38')]));_0x4d5177[_0x6a63('0x39')]=_0x4d5177[_0x6a63('0x39')][_0x6a63('0x3a')]?_0x4d5177[_0x6a63('0x39')]:_0x1ad4c9[_0x6a63('0x37')];if(!_0x26a6c6[_0x6a63('0x34')][_0x6a63('0x3b')](_0x6a63('0x3c'))){_0x4d5177[_0x6a63('0x21')]=qs['limit'](_0x26a6c6[_0x6a63('0x34')][_0x6a63('0x21')]);_0x4d5177['offset']=qs[_0x6a63('0x1f')](_0x26a6c6[_0x6a63('0x34')][_0x6a63('0x1f')]);}_0x4d5177[_0x6a63('0x3d')]=qs[_0x6a63('0x3e')](_0x26a6c6[_0x6a63('0x34')][_0x6a63('0x3e')]);_0x4d5177['where']=qs[_0x6a63('0x35')](_[_0x6a63('0x40')](_0x26a6c6['query'],_0x1ad4c9[_0x6a63('0x35')]));_0x4d5177['where'][_0x6a63('0x57')]=_0x5bf689['id'];if(_0x26a6c6[_0x6a63('0x34')][_0x6a63('0x43')]){_0x4d5177['where']=_[_0x6a63('0x41')](_0x4d5177[_0x6a63('0x3f')],{'$or':_[_0x6a63('0x30')](_0x4d5177[_0x6a63('0x39')],function(_0x1384f4){var _0xd108e5={};_0xd108e5[_0x1384f4]={'$like':'%'+_0x26a6c6[_0x6a63('0x34')][_0x6a63('0x43')]+'%'};return _0xd108e5;})});}_0x4d5177=_[_0x6a63('0x41')]({},_0x4d5177,_0x26a6c6[_0x6a63('0x44')]);return db[_0x6a63('0x56')][_0x6a63('0x58')](_0x4d5177);}})[_0x6a63('0x29')](function(_0x1cc211){if(_0x1cc211){return db[_0x6a63('0x59')][_0x6a63('0x5a')]({'where':{'id':_['map'](_0x1cc211,'UserId'),'role':_0x6a63('0x5b')},'attributes':['id',_0x6a63('0x2d'),'faxPause',_0x6a63('0x5c'),_0x6a63('0x5d')]});}})['then'](function(_0x5380ea){if(_0x5380ea){return{'count':_0x5380ea[_0x6a63('0x22')],'rows':_[_0x6a63('0x30')](_0x5380ea[_0x6a63('0x47')],function(_0x32bd89){return{'membername':_0x32bd89['name'],'UserId':_0x32bd89['id'],'queue_name':_0x21742c[_0x6a63('0x2d')],'FaxQueueId':_0x21742c['id'],'interface':util[_0x6a63('0x5e')]('%s/%s','SIP',_0x32bd89[_0x6a63('0x2d')]),'penalty':0x0,'paused':_0x32bd89['faxPause'],'createdAt':_0x32bd89[_0x6a63('0x5d')],'updatedAt':_0x32bd89[_0x6a63('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6a63('0x29')](respondWithFilteredResult(_0x26bcfa,_0x4d5177))[_0x6a63('0x4a')](handleError(_0x26bcfa,null));};exports[_0x6a63('0x5f')]=function(_0x22a796,_0x156626,_0x44063a){var _0x306d20={};var _0x16da7d={};var _0x234b5e;var _0x35630e;return db[_0x6a63('0x45')][_0x6a63('0x55')]({'where':{'id':_0x22a796[_0x6a63('0x48')]['id']}})[_0x6a63('0x29')](handleEntityNotFound(_0x156626,null))[_0x6a63('0x29')](function(_0x1349b6){if(_0x1349b6){_0x234b5e=_0x1349b6;_0x16da7d[_0x6a63('0x37')]=_[_0x6a63('0x33')](db[_0x6a63('0x60')][_0x6a63('0x31')]);_0x16da7d['query']=_[_0x6a63('0x33')](_0x22a796[_0x6a63('0x34')]);_0x16da7d[_0x6a63('0x35')]=_[_0x6a63('0x36')](_0x16da7d[_0x6a63('0x37')],_0x16da7d['query']);_0x306d20['attributes']=_[_0x6a63('0x36')](_0x16da7d[_0x6a63('0x37')],qs['fields'](_0x22a796[_0x6a63('0x34')][_0x6a63('0x38')]));_0x306d20[_0x6a63('0x39')]=_0x306d20[_0x6a63('0x39')][_0x6a63('0x3a')]?_0x306d20[_0x6a63('0x39')]:_0x16da7d['model'];_0x306d20[_0x6a63('0x3d')]=qs['sort'](_0x22a796[_0x6a63('0x34')]['sort']);_0x306d20[_0x6a63('0x3f')]=qs[_0x6a63('0x35')](_[_0x6a63('0x40')](_0x22a796[_0x6a63('0x34')],_0x16da7d[_0x6a63('0x35')]));if(_0x22a796[_0x6a63('0x34')][_0x6a63('0x43')]){_0x306d20[_0x6a63('0x3f')]=_[_0x6a63('0x41')](_0x306d20[_0x6a63('0x3f')],{'$or':_['map'](_0x306d20[_0x6a63('0x39')],function(_0x3da55a){var _0x1b25bf={};_0x1b25bf[_0x3da55a]={'$like':'%'+_0x22a796[_0x6a63('0x34')][_0x6a63('0x43')]+'%'};return _0x1b25bf;})});}_0x306d20=_[_0x6a63('0x41')]({},_0x306d20,_0x22a796[_0x6a63('0x44')]);return _0x234b5e[_0x6a63('0x5f')](_0x306d20);}})[_0x6a63('0x29')](function(_0x3a27a2){if(_0x3a27a2){_0x35630e=_0x3a27a2[_0x6a63('0x3a')];if(!_0x22a796[_0x6a63('0x34')][_0x6a63('0x3b')](_0x6a63('0x3c'))){_0x306d20['limit']=qs['limit'](_0x22a796[_0x6a63('0x34')][_0x6a63('0x21')]);_0x306d20[_0x6a63('0x1f')]=qs[_0x6a63('0x1f')](_0x22a796['query']['offset']);}return _0x234b5e[_0x6a63('0x5f')](_0x306d20);}})[_0x6a63('0x29')](function(_0x47eb21){if(_0x47eb21){return _0x47eb21?{'count':_0x35630e,'rows':_0x47eb21}:null;}})['then'](respondWithResult(_0x156626,null))[_0x6a63('0x4a')](handleError(_0x156626,null));};exports['addTeams']=function(_0xa5ca35,_0x41328d,_0x3f4208){var _0x1bb6b4=_0xa5ca35[_0x6a63('0x4c')][_0x6a63('0x61')];return db['Team'][_0x6a63('0x58')]({'where':{'id':_0x1bb6b4},'attributes':['id'],'include':[{'model':db[_0x6a63('0x59')],'as':'Agents','attributes':['id',_0x6a63('0x2d'),'online',_0x6a63('0x62'),_0x6a63('0x63')],'raw':!![]}]})[_0x6a63('0x29')](function(_0x40c48f){if(_0x40c48f){var _0x521386=_[_0x6a63('0x64')](_0x40c48f,function(_0x47dcc3){var _0x186d58=_0x47dcc3['get']({'plain':!![]});return _0x186d58[_0x6a63('0x65')];});return db[_0x6a63('0x45')][_0x6a63('0x49')]({'where':{'id':_0xa5ca35[_0x6a63('0x48')]['id']}})[_0x6a63('0x29')](function(_0xff58de){return db[_0x6a63('0x66')][_0x6a63('0x67')](function(_0x50ea8f){return _0xff58de[_0x6a63('0x68')](_0x1bb6b4,{'transaction':_0x50ea8f})[_0x6a63('0x29')](function(){return BPromise[_0x6a63('0x69')](_0x521386,function(_0x3d36ae){return db[_0x6a63('0x56')][_0x6a63('0x6a')]({'where':{'UserId':_0x3d36ae['id'],'FaxQueueId':_0xa5ca35[_0x6a63('0x48')]['id']},'transaction':_0x50ea8f});});})[_0x6a63('0x29')](function(){_0x521386[_0x6a63('0x6b')](function(_0x40a654){socket[_0x6a63('0x6c')](_0x6a63('0x6d'),{'UserId':_0x40a654['id'],'FaxQueueId':_0xff58de['id']});});});});});}})[_0x6a63('0x29')](respondWithStatusCode(_0x41328d,null))[_0x6a63('0x4a')](handleError(_0x41328d,null));};exports[_0x6a63('0x6e')]=function(_0x1c97dc,_0x2b08e0,_0x5d2255){return db[_0x6a63('0x60')][_0x6a63('0x58')]({'where':{'id':_0x1c97dc[_0x6a63('0x34')][_0x6a63('0x61')]},'attributes':['id'],'include':[{'model':db[_0x6a63('0x59')],'as':_0x6a63('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2b08e0,null))[_0x6a63('0x29')](function(_0x3aa50c){var _0x455343=_[_0x6a63('0x30')](_0x3aa50c,'id');var _0x4c501d=[];var _0x23a3e7=[];var _0x3f7290=squel[_0x6a63('0x6f')]();_0x3f7290[_0x6a63('0x70')](_0x6a63('0x71'))[_0x6a63('0x72')](_0x6a63('0x73'),'tq')[_0x6a63('0x74')](_0x6a63('0x75'),'ut',_0x6a63('0x76'))[_0x6a63('0x3f')](_0x6a63('0x77'),_0x1c97dc[_0x6a63('0x48')]['id']);for(var _0x5a0145=0x0;_0x5a0145<_0x3aa50c['length'];_0x5a0145+=0x1){let _0x2ee974=_0x3aa50c[_0x5a0145];for(var _0x57c701=0x0;_0x57c701<_0x2ee974[_0x6a63('0x65')]['length'];_0x57c701+=0x1){let _0x3b7a76=_0x2ee974[_0x6a63('0x65')][_0x57c701];var _0x1c6e7e=_0x3f7290[_0x6a63('0x78')]();_0x1c6e7e['where'](_0x6a63('0x79'),_0x3b7a76['id']);_0x23a3e7[_0x6a63('0x7a')](db[_0x6a63('0x66')][_0x6a63('0x34')](_0x1c6e7e['toString'](),{'type':db[_0x6a63('0x66')][_0x6a63('0x7b')][_0x6a63('0x7c')]})[_0x6a63('0x29')](function(_0x29e3fd){if(_0x29e3fd[_0x6a63('0x3a')]===0x1){return _0x3b7a76['id'];}else{var _0x25f3cd=_[_0x6a63('0x7d')](_[_0x6a63('0x30')](_0x29e3fd,_0x6a63('0x7e')),function(_0x220274){return _[_0x6a63('0x7f')](_0x455343,_0x220274);});if(_0x25f3cd){return _0x3b7a76['id'];}}}));}}return BPromise[_0x6a63('0x80')](_0x23a3e7)[_0x6a63('0x29')](function(_0x438e89){_0x4c501d=_(_0x4c501d)['union'](_0x438e89)[_0x6a63('0x81')]()[_0x6a63('0x82')]();return db[_0x6a63('0x45')][_0x6a63('0x49')]({'where':{'id':_0x1c97dc[_0x6a63('0x48')]['id']}})[_0x6a63('0x29')](function(_0x1007f8){return db['sequelize'][_0x6a63('0x67')](function(_0x200093){return _0x1007f8[_0x6a63('0x6e')](_0x1c97dc['query'][_0x6a63('0x61')],{'transaction':_0x200093})['then'](function(){if(!_[_0x6a63('0x83')](_0x4c501d)){return _0x1007f8[_0x6a63('0x84')](_0x4c501d,{'transaction':_0x200093});}})[_0x6a63('0x29')](function(){_0x4c501d[_0x6a63('0x6b')](function(_0x12154c){socket[_0x6a63('0x6c')](_0x6a63('0x85'),{'UserId':_0x12154c,'FaxQueueId':_0x1007f8['id']});});});});});});})[_0x6a63('0x29')](respondWithStatusCode(_0x2b08e0,null))['catch'](handleError(_0x2b08e0,null));};exports[_0x6a63('0x86')]=function(_0xf07b16,_0x42094f,_0x2acbbc){return db[_0x6a63('0x45')][_0x6a63('0x49')]({'where':{'id':_0xf07b16[_0x6a63('0x48')]['id']}})['then'](handleEntityNotFound(_0x42094f,null))[_0x6a63('0x29')](function(_0x222f1a){if(_0x222f1a){return _0x222f1a[_0x6a63('0x86')](_0xf07b16[_0x6a63('0x4c')][_0x6a63('0x61')],_['omit'](_0xf07b16[_0x6a63('0x4c')],[_0x6a63('0x61'),'id'])||{})['spread'](function(_0x3dff1d){for(var _0x59b506=0x0;_0x59b506<_0xf07b16[_0x6a63('0x4c')][_0x6a63('0x61')][_0x6a63('0x3a')];_0x59b506+=0x1){socket['emit'](_0x6a63('0x6d'),{'UserId':Number(_0xf07b16[_0x6a63('0x4c')][_0x6a63('0x61')][_0x59b506]),'FaxQueueId':Number(_0xf07b16[_0x6a63('0x48')]['id'])});}return _0x3dff1d;});}})['then'](respondWithResult(_0x42094f,null))[_0x6a63('0x4a')](handleError(_0x42094f,null));};exports[_0x6a63('0x84')]=function(_0x503a3b,_0x3af72d,_0x8866b0){return db[_0x6a63('0x45')][_0x6a63('0x49')]({'where':{'id':_0x503a3b[_0x6a63('0x48')]['id']}})['then'](handleEntityNotFound(_0x3af72d,null))['then'](function(_0x4d04f9){if(_0x4d04f9){return _0x4d04f9[_0x6a63('0x84')](_0x503a3b[_0x6a63('0x34')][_0x6a63('0x61')])[_0x6a63('0x29')](function(){if(_['isArray'](_0x503a3b[_0x6a63('0x34')][_0x6a63('0x61')])){for(var _0x312e40=0x0;_0x312e40<_0x503a3b[_0x6a63('0x34')]['ids'][_0x6a63('0x3a')];_0x312e40+=0x1){socket['emit'](_0x6a63('0x85'),{'UserId':Number(_0x503a3b[_0x6a63('0x34')][_0x6a63('0x61')][_0x312e40]),'FaxQueueId':Number(_0x503a3b['params']['id'])});}}else{socket[_0x6a63('0x6c')](_0x6a63('0x85'),{'UserId':Number(_0x503a3b['query'][_0x6a63('0x61')]),'FaxQueueId':Number(_0x503a3b[_0x6a63('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x3af72d,null))['catch'](handleError(_0x3af72d,null));};exports[_0x6a63('0x87')]=function(_0x1cf352,_0x1ec40c,_0x2de6ad){var _0x5c70d1={};var _0x4c15d7={};var _0x453147;var _0x1c4b9e;return db[_0x6a63('0x45')][_0x6a63('0x55')]({'where':{'id':_0x1cf352[_0x6a63('0x48')]['id']}})[_0x6a63('0x29')](handleEntityNotFound(_0x1ec40c,null))[_0x6a63('0x29')](function(_0x219a39){if(_0x219a39){_0x453147=_0x219a39;_0x4c15d7['model']=_[_0x6a63('0x33')](db[_0x6a63('0x59')][_0x6a63('0x31')]);_0x4c15d7[_0x6a63('0x34')]=_[_0x6a63('0x33')](_0x1cf352['query']);_0x4c15d7[_0x6a63('0x35')]=_['intersection'](_0x4c15d7[_0x6a63('0x37')],_0x4c15d7[_0x6a63('0x34')]);_0x5c70d1[_0x6a63('0x39')]=_['intersection'](_0x4c15d7[_0x6a63('0x37')],qs[_0x6a63('0x38')](_0x1cf352[_0x6a63('0x34')][_0x6a63('0x38')]));_0x5c70d1['attributes']=_0x5c70d1[_0x6a63('0x39')][_0x6a63('0x3a')]?_0x5c70d1[_0x6a63('0x39')]:_0x4c15d7[_0x6a63('0x37')];_0x5c70d1['order']=qs[_0x6a63('0x3e')](_0x1cf352[_0x6a63('0x34')]['sort']);_0x5c70d1['where']=qs[_0x6a63('0x35')](_['pick'](_0x1cf352[_0x6a63('0x34')],_0x4c15d7['filters']));if(_0x1cf352[_0x6a63('0x34')][_0x6a63('0x43')]){_0x5c70d1[_0x6a63('0x3f')]=_[_0x6a63('0x41')](_0x5c70d1[_0x6a63('0x3f')],{'$or':_['map'](_0x5c70d1[_0x6a63('0x39')],function(_0x2677eb){var _0x3d5a0d={};_0x3d5a0d[_0x2677eb]={'$like':'%'+_0x1cf352[_0x6a63('0x34')][_0x6a63('0x43')]+'%'};return _0x3d5a0d;})});}_0x5c70d1=_[_0x6a63('0x41')]({},_0x5c70d1,_0x1cf352[_0x6a63('0x44')]);return _0x453147[_0x6a63('0x87')](_0x5c70d1);}})['then'](function(_0x234aff){if(_0x234aff){_0x1c4b9e=_0x234aff[_0x6a63('0x3a')];if(!_0x1cf352[_0x6a63('0x34')][_0x6a63('0x3b')]('nolimit')){_0x5c70d1['limit']=qs[_0x6a63('0x21')](_0x1cf352['query'][_0x6a63('0x21')]);_0x5c70d1['offset']=qs['offset'](_0x1cf352[_0x6a63('0x34')][_0x6a63('0x1f')]);}return _0x453147[_0x6a63('0x87')](_0x5c70d1);}})[_0x6a63('0x29')](function(_0x2218c7){if(_0x2218c7){return _0x2218c7?{'count':_0x1c4b9e,'rows':_0x2218c7}:null;}})[_0x6a63('0x29')](respondWithResult(_0x1ec40c,null))[_0x6a63('0x4a')](handleError(_0x1ec40c,null));}; \ No newline at end of file +var _0xcf15=['bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','FaxQueues','UserProfileResource','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','keys','options','create','body','user','get','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','order','User','UserId','agent','faxPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','Team','addTeams','ids','online','interface','flatMap','Agents','transaction','emit','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','toString','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeAgents','userFaxQueue:remove','addAgents','omit','userFaxQueue:save','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x38622b,_0x3cfdf7){var _0x2c1a7a=function(_0x5de9cc){while(--_0x5de9cc){_0x38622b['push'](_0x38622b['shift']());}};_0x2c1a7a(++_0x3cfdf7);}(_0xcf15,0x83));var _0x5cf1=function(_0x4054e9,_0x29b091){_0x4054e9=_0x4054e9-0x0;var _0xb06d6f=_0xcf15[_0x4054e9];return _0xb06d6f;};'use strict';var emlformat=require(_0x5cf1('0x0'));var rimraf=require(_0x5cf1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5cf1('0x2'));var rp=require(_0x5cf1('0x3'));var moment=require(_0x5cf1('0x4'));var BPromise=require(_0x5cf1('0x5'));var Mustache=require(_0x5cf1('0x6'));var util=require('util');var path=require(_0x5cf1('0x7'));var sox=require(_0x5cf1('0x8'));var csv=require(_0x5cf1('0x9'));var ejs=require(_0x5cf1('0xa'));var fs=require('fs');var fs_extra=require(_0x5cf1('0xb'));var _=require(_0x5cf1('0xc'));var squel=require(_0x5cf1('0xd'));var crypto=require(_0x5cf1('0xe'));var jsforce=require(_0x5cf1('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5cf1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5cf1('0x11'));var hardwareService=require(_0x5cf1('0x12'));var logger=require('../../config/logger')(_0x5cf1('0x13'));var utils=require('../../config/utils');var config=require(_0x5cf1('0x14'));var licenseUtil=require(_0x5cf1('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5cf1('0x16')](config[_0x5cf1('0x17')],{'host':_0x5cf1('0x18'),'port':0x18eb});var socket=require(_0x5cf1('0x19'))(new Redis(config[_0x5cf1('0x17')]));require(_0x5cf1('0x1a'))[_0x5cf1('0x1b')](socket);function respondWithStatusCode(_0x81ee10,_0x186a3f){_0x186a3f=_0x186a3f||0xcc;return function(_0xe83cdd){if(_0xe83cdd){return _0x81ee10[_0x5cf1('0x1c')](_0x186a3f);}return _0x81ee10[_0x5cf1('0x1d')](_0x186a3f)[_0x5cf1('0x1e')]();};}function respondWithResult(_0x41cd18,_0x511c4f){_0x511c4f=_0x511c4f||0xc8;return function(_0x17548d){if(_0x17548d){return _0x41cd18['status'](_0x511c4f)[_0x5cf1('0x1f')](_0x17548d);}};}function respondWithFilteredResult(_0x52e68d,_0x521666){return function(_0x295380){if(_0x295380){var _0x2dc0ab=typeof _0x521666[_0x5cf1('0x20')]==='undefined'&&typeof _0x521666[_0x5cf1('0x21')]==='undefined';var _0x151651=_0x295380[_0x5cf1('0x22')];var _0x4b4bc2=_0x2dc0ab?0x0:_0x521666['offset'];var _0x572327=_0x2dc0ab?_0x295380[_0x5cf1('0x22')]:_0x521666[_0x5cf1('0x20')]+_0x521666[_0x5cf1('0x21')];var _0x391914;if(_0x572327>=_0x151651){_0x572327=_0x151651;_0x391914=0xc8;}else{_0x391914=0xce;}_0x52e68d[_0x5cf1('0x1d')](_0x391914);return _0x52e68d['set'](_0x5cf1('0x23'),_0x4b4bc2+'-'+_0x572327+'/'+_0x151651)['json'](_0x295380);}return null;};}function patchUpdates(_0x3c5525){return function(_0x1d66d4){try{jsonpatch[_0x5cf1('0x24')](_0x1d66d4,_0x3c5525,!![]);}catch(_0x1da952){return BPromise[_0x5cf1('0x25')](_0x1da952);}return _0x1d66d4[_0x5cf1('0x26')]();};}function saveUpdates(_0x445f9c,_0x82252b){return function(_0xcdef78){if(_0xcdef78){return _0xcdef78[_0x5cf1('0x27')](_0x445f9c)[_0x5cf1('0x28')](function(_0x2d9422){return _0x2d9422;});}return null;};}function removeEntity(_0x1e516c,_0x38ddba){return function(_0x1eb69e){if(_0x1eb69e){return _0x1eb69e[_0x5cf1('0x29')]()[_0x5cf1('0x28')](function(){var _0x53030b=_0x1eb69e['get']({'plain':!![]});var _0x57886e=_0x5cf1('0x2a');return db[_0x5cf1('0x2b')]['destroy']({'where':{'type':_0x57886e,'resourceId':_0x53030b['id']}})[_0x5cf1('0x28')](function(){return _0x1eb69e;});})[_0x5cf1('0x28')](function(){_0x1e516c[_0x5cf1('0x1d')](0xcc)[_0x5cf1('0x1e')]();});}};}function handleEntityNotFound(_0x5e9874,_0x36c73e){return function(_0x3a4217){if(!_0x3a4217){_0x5e9874[_0x5cf1('0x1c')](0x194);}return _0x3a4217;};}function handleError(_0x414b91,_0x333c25){_0x333c25=_0x333c25||0x1f4;return function(_0xf4be29){logger[_0x5cf1('0x2c')](_0xf4be29[_0x5cf1('0x2d')]);if(_0xf4be29[_0x5cf1('0x2e')]){delete _0xf4be29[_0x5cf1('0x2e')];}_0x414b91[_0x5cf1('0x1d')](_0x333c25)[_0x5cf1('0x2f')](_0xf4be29);};}exports[_0x5cf1('0x30')]=function(_0x598ffd,_0x12926a){var _0x5d0078={},_0x5c579c={},_0x34f92d={'count':0x0,'rows':[]};var _0x2e3f97=_[_0x5cf1('0x31')](db[_0x5cf1('0x32')][_0x5cf1('0x33')],function(_0x43c43d){return{'name':_0x43c43d[_0x5cf1('0x34')],'type':_0x43c43d[_0x5cf1('0x35')]['key']};});_0x5c579c['model']=_[_0x5cf1('0x31')](_0x2e3f97,'name');_0x5c579c[_0x5cf1('0x36')]=_['keys'](_0x598ffd[_0x5cf1('0x36')]);_0x5c579c[_0x5cf1('0x37')]=_[_0x5cf1('0x38')](_0x5c579c[_0x5cf1('0x39')],_0x5c579c[_0x5cf1('0x36')]);_0x5d0078[_0x5cf1('0x3a')]=_[_0x5cf1('0x38')](_0x5c579c[_0x5cf1('0x39')],qs['fields'](_0x598ffd['query'][_0x5cf1('0x3b')]));_0x5d0078[_0x5cf1('0x3a')]=_0x5d0078[_0x5cf1('0x3a')][_0x5cf1('0x3c')]?_0x5d0078[_0x5cf1('0x3a')]:_0x5c579c[_0x5cf1('0x39')];if(!_0x598ffd['query']['hasOwnProperty'](_0x5cf1('0x3d'))){_0x5d0078[_0x5cf1('0x21')]=qs[_0x5cf1('0x21')](_0x598ffd['query'][_0x5cf1('0x21')]);_0x5d0078[_0x5cf1('0x20')]=qs[_0x5cf1('0x20')](_0x598ffd['query'][_0x5cf1('0x20')]);}_0x5d0078['order']=qs[_0x5cf1('0x3e')](_0x598ffd['query'][_0x5cf1('0x3e')]);_0x5d0078[_0x5cf1('0x3f')]=qs[_0x5cf1('0x37')](_[_0x5cf1('0x40')](_0x598ffd[_0x5cf1('0x36')],_0x5c579c[_0x5cf1('0x37')]),_0x2e3f97);if(_0x598ffd[_0x5cf1('0x36')]['filter']){_0x5d0078['where']=_[_0x5cf1('0x41')](_0x5d0078[_0x5cf1('0x3f')],{'$or':_['map'](_0x2e3f97,function(_0xdd0711){if(_0xdd0711['type']!==_0x5cf1('0x42')){var _0x2ed76e={};_0x2ed76e[_0xdd0711[_0x5cf1('0x2e')]]={'$like':'%'+_0x598ffd[_0x5cf1('0x36')][_0x5cf1('0x43')]+'%'};return _0x2ed76e;}})});}_0x5d0078=_[_0x5cf1('0x41')]({},_0x5d0078,_0x598ffd['options']);var _0x26e810={'where':_0x5d0078[_0x5cf1('0x3f')]};return db[_0x5cf1('0x32')]['count'](_0x26e810)['then'](function(_0x33a102){_0x34f92d[_0x5cf1('0x22')]=_0x33a102;if(_0x598ffd['query'][_0x5cf1('0x44')]){_0x5d0078[_0x5cf1('0x45')]=[{'all':!![]}];}return db[_0x5cf1('0x32')][_0x5cf1('0x46')](_0x5d0078);})[_0x5cf1('0x28')](function(_0x37b523){_0x34f92d['rows']=_0x37b523;return _0x34f92d;})['then'](respondWithFilteredResult(_0x12926a,_0x5d0078))[_0x5cf1('0x47')](handleError(_0x12926a,null));};exports[_0x5cf1('0x48')]=function(_0x4eb4e7,_0x434886){var _0x2d9102={'raw':!![],'where':{'id':_0x4eb4e7[_0x5cf1('0x49')]['id']}},_0x1153f6={};_0x1153f6[_0x5cf1('0x39')]=_[_0x5cf1('0x4a')](db[_0x5cf1('0x32')][_0x5cf1('0x33')]);_0x1153f6[_0x5cf1('0x36')]=_[_0x5cf1('0x4a')](_0x4eb4e7[_0x5cf1('0x36')]);_0x1153f6[_0x5cf1('0x37')]=_[_0x5cf1('0x38')](_0x1153f6['model'],_0x1153f6['query']);_0x2d9102[_0x5cf1('0x3a')]=_['intersection'](_0x1153f6['model'],qs[_0x5cf1('0x3b')](_0x4eb4e7['query'][_0x5cf1('0x3b')]));_0x2d9102[_0x5cf1('0x3a')]=_0x2d9102[_0x5cf1('0x3a')][_0x5cf1('0x3c')]?_0x2d9102[_0x5cf1('0x3a')]:_0x1153f6[_0x5cf1('0x39')];if(_0x4eb4e7[_0x5cf1('0x36')]['includeAll']){_0x2d9102[_0x5cf1('0x45')]=[{'all':!![]}];}_0x2d9102=_[_0x5cf1('0x41')]({},_0x2d9102,_0x4eb4e7[_0x5cf1('0x4b')]);return db[_0x5cf1('0x32')]['find'](_0x2d9102)[_0x5cf1('0x28')](handleEntityNotFound(_0x434886,null))[_0x5cf1('0x28')](respondWithResult(_0x434886,null))[_0x5cf1('0x47')](handleError(_0x434886,null));};exports['create']=function(_0x1e22fd,_0x3da673){return db[_0x5cf1('0x32')][_0x5cf1('0x4c')](_0x1e22fd[_0x5cf1('0x4d')],{})[_0x5cf1('0x28')](function(_0x2d666a){var _0x95bf20=_0x1e22fd[_0x5cf1('0x4e')][_0x5cf1('0x4f')]({'plain':!![]});if(!_0x95bf20)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x95bf20[_0x5cf1('0x50')]===_0x5cf1('0x4e')){var _0x9c10e7=_0x2d666a[_0x5cf1('0x4f')]({'plain':!![]});var _0x316759=_0x5cf1('0x2a');return db[_0x5cf1('0x51')][_0x5cf1('0x52')]({'where':{'name':_0x316759,'userProfileId':_0x95bf20['userProfileId']},'raw':!![]})[_0x5cf1('0x28')](function(_0x12f633){if(_0x12f633&&_0x12f633[_0x5cf1('0x53')]===0x0){return db[_0x5cf1('0x2b')][_0x5cf1('0x4c')]({'name':_0x9c10e7['name'],'resourceId':_0x9c10e7['id'],'type':_0x12f633[_0x5cf1('0x2e')],'sectionId':_0x12f633['id']},{})[_0x5cf1('0x28')](function(){return _0x2d666a;});}else{return _0x2d666a;}})[_0x5cf1('0x47')](function(_0x14c88d){logger[_0x5cf1('0x2c')](_0x5cf1('0x54'),_0x14c88d);throw _0x14c88d;});}return _0x2d666a;})['then'](respondWithResult(_0x3da673,0xc9))['catch'](handleError(_0x3da673,null));};exports['update']=function(_0x64c861,_0x505b6c){if(_0x64c861['body']['id']){delete _0x64c861[_0x5cf1('0x4d')]['id'];}return db['FaxQueue'][_0x5cf1('0x52')]({'where':{'id':_0x64c861['params']['id']}})[_0x5cf1('0x28')](handleEntityNotFound(_0x505b6c,null))[_0x5cf1('0x28')](saveUpdates(_0x64c861[_0x5cf1('0x4d')],null))[_0x5cf1('0x28')](respondWithResult(_0x505b6c,null))[_0x5cf1('0x47')](handleError(_0x505b6c,null));};exports[_0x5cf1('0x29')]=function(_0x365cd6,_0x3acb5b){return db[_0x5cf1('0x32')][_0x5cf1('0x52')]({'where':{'id':_0x365cd6[_0x5cf1('0x49')]['id']}})['then'](handleEntityNotFound(_0x3acb5b,null))[_0x5cf1('0x28')](removeEntity(_0x3acb5b,null))[_0x5cf1('0x47')](handleError(_0x3acb5b,null));};exports[_0x5cf1('0x55')]=function(_0x58b12d,_0x26beb0){return db[_0x5cf1('0x32')][_0x5cf1('0x55')]()['then'](respondWithResult(_0x26beb0,null))['catch'](handleError(_0x26beb0,null));};exports[_0x5cf1('0x56')]=function(_0x597b8b,_0x30cf1f,_0x4c770e){var _0x15db4b={'raw':!![],'where':{}},_0x2764ac={},_0x1d05ff;return db[_0x5cf1('0x32')][_0x5cf1('0x57')]({'where':{'id':_0x597b8b[_0x5cf1('0x49')]['id']}})['then'](handleEntityNotFound(_0x30cf1f,null))[_0x5cf1('0x28')](function(_0x32950d){if(_0x32950d){_0x1d05ff=_0x32950d['get']({'plain':!![]});_0x2764ac[_0x5cf1('0x39')]=_[_0x5cf1('0x4a')](db[_0x5cf1('0x58')][_0x5cf1('0x33')]);_0x2764ac['query']=_[_0x5cf1('0x4a')](_0x597b8b['query']);_0x2764ac[_0x5cf1('0x37')]=_[_0x5cf1('0x38')](_0x2764ac[_0x5cf1('0x39')],_0x2764ac[_0x5cf1('0x36')]);_0x15db4b[_0x5cf1('0x3a')]=_['intersection'](_0x2764ac[_0x5cf1('0x39')],qs[_0x5cf1('0x3b')](_0x597b8b[_0x5cf1('0x36')][_0x5cf1('0x3b')]));_0x15db4b[_0x5cf1('0x3a')]=_0x15db4b[_0x5cf1('0x3a')][_0x5cf1('0x3c')]?_0x15db4b[_0x5cf1('0x3a')]:_0x2764ac[_0x5cf1('0x39')];if(!_0x597b8b[_0x5cf1('0x36')][_0x5cf1('0x59')](_0x5cf1('0x3d'))){_0x15db4b[_0x5cf1('0x21')]=qs[_0x5cf1('0x21')](_0x597b8b['query'][_0x5cf1('0x21')]);_0x15db4b['offset']=qs[_0x5cf1('0x20')](_0x597b8b[_0x5cf1('0x36')][_0x5cf1('0x20')]);}_0x15db4b[_0x5cf1('0x5a')]=qs[_0x5cf1('0x3e')](_0x597b8b[_0x5cf1('0x36')]['sort']);_0x15db4b[_0x5cf1('0x3f')]=qs['filters'](_[_0x5cf1('0x40')](_0x597b8b[_0x5cf1('0x36')],_0x2764ac[_0x5cf1('0x37')]));_0x15db4b[_0x5cf1('0x3f')]['FaxQueueId']=_0x32950d['id'];if(_0x597b8b[_0x5cf1('0x36')][_0x5cf1('0x43')]){_0x15db4b['where']=_[_0x5cf1('0x41')](_0x15db4b['where'],{'$or':_[_0x5cf1('0x31')](_0x15db4b[_0x5cf1('0x3a')],function(_0x5a275f){var _0x294337={};_0x294337[_0x5a275f]={'$like':'%'+_0x597b8b['query'][_0x5cf1('0x43')]+'%'};return _0x294337;})});}_0x15db4b=_[_0x5cf1('0x41')]({},_0x15db4b,_0x597b8b['options']);return db[_0x5cf1('0x58')][_0x5cf1('0x46')](_0x15db4b);}})['then'](function(_0x5280b8){if(_0x5280b8){return db[_0x5cf1('0x5b')]['findAndCountAll']({'where':{'id':_[_0x5cf1('0x31')](_0x5280b8,_0x5cf1('0x5c')),'role':_0x5cf1('0x5d')},'attributes':['id',_0x5cf1('0x2e'),_0x5cf1('0x5e'),_0x5cf1('0x5f'),_0x5cf1('0x60')]});}})['then'](function(_0x34e6f2){if(_0x34e6f2){return{'count':_0x34e6f2[_0x5cf1('0x22')],'rows':_[_0x5cf1('0x31')](_0x34e6f2[_0x5cf1('0x61')],function(_0x152990){return{'membername':_0x152990['name'],'UserId':_0x152990['id'],'queue_name':_0x1d05ff['name'],'FaxQueueId':_0x1d05ff['id'],'interface':util['format'](_0x5cf1('0x62'),_0x5cf1('0x63'),_0x152990[_0x5cf1('0x2e')]),'penalty':0x0,'paused':_0x152990[_0x5cf1('0x5e')],'createdAt':_0x152990[_0x5cf1('0x60')],'updatedAt':_0x152990[_0x5cf1('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5cf1('0x28')](respondWithFilteredResult(_0x30cf1f,_0x15db4b))['catch'](handleError(_0x30cf1f,null));};exports[_0x5cf1('0x64')]=function(_0x747ab9,_0x11232c,_0x508517){var _0x3b3336={};var _0x39e403={};var _0x454884;var _0x2c1a66;return db[_0x5cf1('0x32')][_0x5cf1('0x57')]({'where':{'id':_0x747ab9[_0x5cf1('0x49')]['id']}})[_0x5cf1('0x28')](handleEntityNotFound(_0x11232c,null))[_0x5cf1('0x28')](function(_0x45f3df){if(_0x45f3df){_0x454884=_0x45f3df;_0x39e403[_0x5cf1('0x39')]=_[_0x5cf1('0x4a')](db[_0x5cf1('0x65')][_0x5cf1('0x33')]);_0x39e403['query']=_[_0x5cf1('0x4a')](_0x747ab9[_0x5cf1('0x36')]);_0x39e403[_0x5cf1('0x37')]=_['intersection'](_0x39e403[_0x5cf1('0x39')],_0x39e403[_0x5cf1('0x36')]);_0x3b3336['attributes']=_[_0x5cf1('0x38')](_0x39e403[_0x5cf1('0x39')],qs[_0x5cf1('0x3b')](_0x747ab9[_0x5cf1('0x36')][_0x5cf1('0x3b')]));_0x3b3336[_0x5cf1('0x3a')]=_0x3b3336['attributes'][_0x5cf1('0x3c')]?_0x3b3336['attributes']:_0x39e403[_0x5cf1('0x39')];_0x3b3336['order']=qs[_0x5cf1('0x3e')](_0x747ab9[_0x5cf1('0x36')][_0x5cf1('0x3e')]);_0x3b3336[_0x5cf1('0x3f')]=qs[_0x5cf1('0x37')](_[_0x5cf1('0x40')](_0x747ab9[_0x5cf1('0x36')],_0x39e403[_0x5cf1('0x37')]));if(_0x747ab9['query'][_0x5cf1('0x43')]){_0x3b3336[_0x5cf1('0x3f')]=_['merge'](_0x3b3336['where'],{'$or':_[_0x5cf1('0x31')](_0x3b3336[_0x5cf1('0x3a')],function(_0x325284){var _0x1187b4={};_0x1187b4[_0x325284]={'$like':'%'+_0x747ab9['query'][_0x5cf1('0x43')]+'%'};return _0x1187b4;})});}_0x3b3336=_[_0x5cf1('0x41')]({},_0x3b3336,_0x747ab9[_0x5cf1('0x4b')]);return _0x454884[_0x5cf1('0x64')](_0x3b3336);}})[_0x5cf1('0x28')](function(_0x3fa4c0){if(_0x3fa4c0){_0x2c1a66=_0x3fa4c0[_0x5cf1('0x3c')];if(!_0x747ab9[_0x5cf1('0x36')]['hasOwnProperty']('nolimit')){_0x3b3336[_0x5cf1('0x21')]=qs[_0x5cf1('0x21')](_0x747ab9['query'][_0x5cf1('0x21')]);_0x3b3336['offset']=qs['offset'](_0x747ab9[_0x5cf1('0x36')][_0x5cf1('0x20')]);}return _0x454884[_0x5cf1('0x64')](_0x3b3336);}})[_0x5cf1('0x28')](function(_0x325ddc){if(_0x325ddc){return _0x325ddc?{'count':_0x2c1a66,'rows':_0x325ddc}:null;}})[_0x5cf1('0x28')](respondWithResult(_0x11232c,null))['catch'](handleError(_0x11232c,null));};exports[_0x5cf1('0x66')]=function(_0xee50cf,_0x1d7ac8,_0x3d5968){var _0x32f604=_0xee50cf[_0x5cf1('0x4d')][_0x5cf1('0x67')];return db[_0x5cf1('0x65')][_0x5cf1('0x46')]({'where':{'id':_0x32f604},'attributes':['id'],'include':[{'model':db[_0x5cf1('0x5b')],'as':'Agents','attributes':['id','name',_0x5cf1('0x68'),'voicePause',_0x5cf1('0x69')],'raw':!![]}]})['then'](function(_0x105c89){if(_0x105c89){var _0x5ad00a=_[_0x5cf1('0x6a')](_0x105c89,function(_0x383ad0){var _0x1add8e=_0x383ad0[_0x5cf1('0x4f')]({'plain':!![]});return _0x1add8e[_0x5cf1('0x6b')];});return db[_0x5cf1('0x32')]['find']({'where':{'id':_0xee50cf['params']['id']}})['then'](function(_0x254bf2){return db['sequelize'][_0x5cf1('0x6c')](function(_0x1060ad){return _0x254bf2[_0x5cf1('0x66')](_0x32f604,{'transaction':_0x1060ad})[_0x5cf1('0x28')](function(){return BPromise['each'](_0x5ad00a,function(_0x5bf40a){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x5bf40a['id'],'FaxQueueId':_0xee50cf[_0x5cf1('0x49')]['id']},'transaction':_0x1060ad});});})['then'](function(){_0x5ad00a['forEach'](function(_0x1aa21f){socket[_0x5cf1('0x6d')]('userFaxQueue:save',{'UserId':_0x1aa21f['id'],'FaxQueueId':_0x254bf2['id']});});});});});}})['then'](respondWithStatusCode(_0x1d7ac8,null))['catch'](handleError(_0x1d7ac8,null));};exports[_0x5cf1('0x6e')]=function(_0x3fc6ce,_0x4e53b3,_0x13dddc){return db['Team'][_0x5cf1('0x46')]({'where':{'id':_0x3fc6ce[_0x5cf1('0x36')][_0x5cf1('0x67')]},'attributes':['id'],'include':[{'model':db[_0x5cf1('0x5b')],'as':_0x5cf1('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x5cf1('0x28')](handleEntityNotFound(_0x4e53b3,null))[_0x5cf1('0x28')](function(_0x39f191){var _0x143027=_[_0x5cf1('0x31')](_0x39f191,'id');var _0x15c4c0=[];var _0x554499=[];var _0x55a6c5=squel[_0x5cf1('0x6f')]();_0x55a6c5[_0x5cf1('0x70')](_0x5cf1('0x71'))[_0x5cf1('0x72')](_0x5cf1('0x73'),'tq')['join']('user_has_teams','ut',_0x5cf1('0x74'))[_0x5cf1('0x3f')](_0x5cf1('0x75'),_0x3fc6ce[_0x5cf1('0x49')]['id']);for(var _0x5e4ff8=0x0;_0x5e4ff8<_0x39f191['length'];_0x5e4ff8+=0x1){let _0x45b726=_0x39f191[_0x5e4ff8];for(var _0xa4b731=0x0;_0xa4b731<_0x45b726['Agents'][_0x5cf1('0x3c')];_0xa4b731+=0x1){let _0x416527=_0x45b726[_0x5cf1('0x6b')][_0xa4b731];var _0x3bff08=_0x55a6c5[_0x5cf1('0x76')]();_0x3bff08[_0x5cf1('0x3f')]('ut.UserId\x20=\x20?',_0x416527['id']);_0x554499['push'](db['sequelize']['query'](_0x3bff08[_0x5cf1('0x77')](),{'type':db[_0x5cf1('0x78')][_0x5cf1('0x79')][_0x5cf1('0x7a')]})[_0x5cf1('0x28')](function(_0x30347d){if(_0x30347d[_0x5cf1('0x3c')]===0x1){return _0x416527['id'];}else{var _0x3502a7=_['every'](_[_0x5cf1('0x31')](_0x30347d,_0x5cf1('0x7b')),function(_0x4da4d1){return _[_0x5cf1('0x7c')](_0x143027,_0x4da4d1);});if(_0x3502a7){return _0x416527['id'];}}}));}}return BPromise[_0x5cf1('0x7d')](_0x554499)[_0x5cf1('0x28')](function(_0xe5e046){_0x15c4c0=_(_0x15c4c0)[_0x5cf1('0x7e')](_0xe5e046)[_0x5cf1('0x7f')]()[_0x5cf1('0x80')]();return db[_0x5cf1('0x32')][_0x5cf1('0x52')]({'where':{'id':_0x3fc6ce[_0x5cf1('0x49')]['id']}})[_0x5cf1('0x28')](function(_0x5bffdf){return db[_0x5cf1('0x78')][_0x5cf1('0x6c')](function(_0x35fbbf){return _0x5bffdf[_0x5cf1('0x6e')](_0x3fc6ce['query'][_0x5cf1('0x67')],{'transaction':_0x35fbbf})[_0x5cf1('0x28')](function(){if(!_['isEmpty'](_0x15c4c0)){return _0x5bffdf[_0x5cf1('0x81')](_0x15c4c0,{'transaction':_0x35fbbf});}})[_0x5cf1('0x28')](function(){_0x15c4c0['forEach'](function(_0x3812d9){socket[_0x5cf1('0x6d')](_0x5cf1('0x82'),{'UserId':_0x3812d9,'FaxQueueId':_0x5bffdf['id']});});});});});});})[_0x5cf1('0x28')](respondWithStatusCode(_0x4e53b3,null))[_0x5cf1('0x47')](handleError(_0x4e53b3,null));};exports['addAgents']=function(_0x59be49,_0x219d3e,_0x491201){return db[_0x5cf1('0x32')][_0x5cf1('0x52')]({'where':{'id':_0x59be49[_0x5cf1('0x49')]['id']}})[_0x5cf1('0x28')](handleEntityNotFound(_0x219d3e,null))[_0x5cf1('0x28')](function(_0x4e21ba){if(_0x4e21ba){return _0x4e21ba[_0x5cf1('0x83')](_0x59be49[_0x5cf1('0x4d')]['ids'],_[_0x5cf1('0x84')](_0x59be49[_0x5cf1('0x4d')],[_0x5cf1('0x67'),'id'])||{})['spread'](function(_0x4a49ae){for(var _0xe89443=0x0;_0xe89443<_0x59be49[_0x5cf1('0x4d')]['ids'][_0x5cf1('0x3c')];_0xe89443+=0x1){socket[_0x5cf1('0x6d')](_0x5cf1('0x85'),{'UserId':Number(_0x59be49[_0x5cf1('0x4d')][_0x5cf1('0x67')][_0xe89443]),'FaxQueueId':Number(_0x59be49[_0x5cf1('0x49')]['id'])});}return _0x4a49ae;});}})['then'](respondWithResult(_0x219d3e,null))[_0x5cf1('0x47')](handleError(_0x219d3e,null));};exports[_0x5cf1('0x81')]=function(_0x2178b3,_0x4299e4,_0x391c8c){return db['FaxQueue']['find']({'where':{'id':_0x2178b3['params']['id']}})[_0x5cf1('0x28')](handleEntityNotFound(_0x4299e4,null))['then'](function(_0x2a1f04){if(_0x2a1f04){return _0x2a1f04[_0x5cf1('0x81')](_0x2178b3['query']['ids'])[_0x5cf1('0x28')](function(){if(_[_0x5cf1('0x86')](_0x2178b3[_0x5cf1('0x36')][_0x5cf1('0x67')])){for(var _0x5a54f6=0x0;_0x5a54f6<_0x2178b3[_0x5cf1('0x36')]['ids'][_0x5cf1('0x3c')];_0x5a54f6+=0x1){socket[_0x5cf1('0x6d')](_0x5cf1('0x82'),{'UserId':Number(_0x2178b3[_0x5cf1('0x36')][_0x5cf1('0x67')][_0x5a54f6]),'FaxQueueId':Number(_0x2178b3['params']['id'])});}}else{socket[_0x5cf1('0x6d')](_0x5cf1('0x82'),{'UserId':Number(_0x2178b3['query'][_0x5cf1('0x67')]),'FaxQueueId':Number(_0x2178b3[_0x5cf1('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x4299e4,null))[_0x5cf1('0x47')](handleError(_0x4299e4,null));};exports[_0x5cf1('0x87')]=function(_0x52e201,_0xc4acdc,_0x5ee4da){var _0x3d4e44={};var _0x2f8a02={};var _0x552a6f;var _0x2e1f8d;return db[_0x5cf1('0x32')][_0x5cf1('0x57')]({'where':{'id':_0x52e201[_0x5cf1('0x49')]['id']}})[_0x5cf1('0x28')](handleEntityNotFound(_0xc4acdc,null))[_0x5cf1('0x28')](function(_0x43a976){if(_0x43a976){_0x552a6f=_0x43a976;_0x2f8a02[_0x5cf1('0x39')]=_[_0x5cf1('0x4a')](db['User']['rawAttributes']);_0x2f8a02[_0x5cf1('0x36')]=_[_0x5cf1('0x4a')](_0x52e201[_0x5cf1('0x36')]);_0x2f8a02[_0x5cf1('0x37')]=_[_0x5cf1('0x38')](_0x2f8a02[_0x5cf1('0x39')],_0x2f8a02[_0x5cf1('0x36')]);_0x3d4e44[_0x5cf1('0x3a')]=_['intersection'](_0x2f8a02[_0x5cf1('0x39')],qs['fields'](_0x52e201[_0x5cf1('0x36')][_0x5cf1('0x3b')]));_0x3d4e44['attributes']=_0x3d4e44['attributes']['length']?_0x3d4e44[_0x5cf1('0x3a')]:_0x2f8a02[_0x5cf1('0x39')];_0x3d4e44[_0x5cf1('0x5a')]=qs[_0x5cf1('0x3e')](_0x52e201[_0x5cf1('0x36')][_0x5cf1('0x3e')]);_0x3d4e44[_0x5cf1('0x3f')]=qs[_0x5cf1('0x37')](_['pick'](_0x52e201[_0x5cf1('0x36')],_0x2f8a02['filters']));if(_0x52e201['query']['filter']){_0x3d4e44[_0x5cf1('0x3f')]=_[_0x5cf1('0x41')](_0x3d4e44[_0x5cf1('0x3f')],{'$or':_[_0x5cf1('0x31')](_0x3d4e44['attributes'],function(_0x399448){var _0x1eff8f={};_0x1eff8f[_0x399448]={'$like':'%'+_0x52e201[_0x5cf1('0x36')][_0x5cf1('0x43')]+'%'};return _0x1eff8f;})});}_0x3d4e44=_[_0x5cf1('0x41')]({},_0x3d4e44,_0x52e201[_0x5cf1('0x4b')]);return _0x552a6f['getAgents'](_0x3d4e44);}})[_0x5cf1('0x28')](function(_0x59771d){if(_0x59771d){_0x2e1f8d=_0x59771d[_0x5cf1('0x3c')];if(!_0x52e201[_0x5cf1('0x36')][_0x5cf1('0x59')](_0x5cf1('0x3d'))){_0x3d4e44[_0x5cf1('0x21')]=qs[_0x5cf1('0x21')](_0x52e201['query']['limit']);_0x3d4e44['offset']=qs['offset'](_0x52e201[_0x5cf1('0x36')][_0x5cf1('0x20')]);}return _0x552a6f['getAgents'](_0x3d4e44);}})[_0x5cf1('0x28')](function(_0x3bf0cd){if(_0x3bf0cd){return _0x3bf0cd?{'count':_0x2e1f8d,'rows':_0x3bf0cd}:null;}})[_0x5cf1('0x28')](respondWithResult(_0xc4acdc,null))['catch'](handleError(_0xc4acdc,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index b255bf5..f09004f 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 _0x92c6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events','FaxQueue'];(function(_0xd1cdeb,_0x47fa82){var _0x5ee834=function(_0x4ffad2){while(--_0x4ffad2){_0xd1cdeb['push'](_0xd1cdeb['shift']());}};_0x5ee834(++_0x47fa82);}(_0x92c6,0x136));var _0x692c=function(_0x5f248f,_0x4993bc){_0x5f248f=_0x5f248f-0x0;var _0x4eff3d=_0x92c6[_0x5f248f];return _0x4eff3d;};'use strict';var EventEmitter=require(_0x692c('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x692c('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x692c('0x2')](0x0);var events={'afterCreate':_0x692c('0x3'),'afterUpdate':_0x692c('0x4'),'afterDestroy':_0x692c('0x5')};function emitEvent(_0x399a01){return function(_0x416255,_0xd384b7,_0x388f4a){FaxQueueEvents[_0x692c('0x6')](_0x399a01+':'+_0x416255['id'],_0x416255);FaxQueueEvents[_0x692c('0x6')](_0x399a01,_0x416255);_0x388f4a(null);};}for(var e in events){if(events[_0x692c('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x9504=['emit','hasOwnProperty','exports','../../mysqldb','FaxQueue','setMaxListeners','update','remove'];(function(_0x7c10f3,_0x4447fe){var _0x51d432=function(_0x3e8c68){while(--_0x3e8c68){_0x7c10f3['push'](_0x7c10f3['shift']());}};_0x51d432(++_0x4447fe);}(_0x9504,0xf3));var _0x4950=function(_0x190db2,_0x352975){_0x190db2=_0x190db2-0x0;var _0x42b067=_0x9504[_0x190db2];return _0x42b067;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x4950('0x0'))['db'][_0x4950('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x4950('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4950('0x3'),'afterDestroy':_0x4950('0x4')};function emitEvent(_0x264ac7){return function(_0x1103ca,_0x4342d0,_0x37bc84){FaxQueueEvents['emit'](_0x264ac7+':'+_0x1103ca['id'],_0x1103ca);FaxQueueEvents[_0x4950('0x5')](_0x264ac7,_0x1103ca);_0x37bc84(null);};}for(var e in events){if(events[_0x4950('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x4950('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 1f3a759..d9b61c7 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 _0x24fa=['exports','define','FaxQueue','lodash','util','../../config/logger','moment','bluebird','rimraf','./faxQueue.attributes'];(function(_0x5cfb59,_0x298da0){var _0x332909=function(_0x5940b4){while(--_0x5940b4){_0x5cfb59['push'](_0x5cfb59['shift']());}};_0x332909(++_0x298da0);}(_0x24fa,0x19d));var _0xa24f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x24fa[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa24f('0x0'));var util=require(_0xa24f('0x1'));var logger=require(_0xa24f('0x2'))('api');var moment=require(_0xa24f('0x3'));var BPromise=require(_0xa24f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa24f('0x5'));var config=require('../../config/environment');var attributes=require(_0xa24f('0x6'));module[_0xa24f('0x7')]=function(_0x24a2f9,_0x2b79af){return _0x24a2f9[_0xa24f('0x8')](_0xa24f('0x9'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0765=['rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x44ace6,_0x448496){var _0x1b5359=function(_0x149c04){while(--_0x149c04){_0x44ace6['push'](_0x44ace6['shift']());}};_0x1b5359(++_0x448496);}(_0x0765,0x180));var _0x5076=function(_0x125d74,_0x5247c0){_0x125d74=_0x125d74-0x0;var _0x9389e9=_0x0765[_0x125d74];return _0x9389e9;};'use strict';var _=require(_0x5076('0x0'));var util=require(_0x5076('0x1'));var logger=require(_0x5076('0x2'))(_0x5076('0x3'));var moment=require(_0x5076('0x4'));var BPromise=require(_0x5076('0x5'));var rp=require(_0x5076('0x6'));var fs=require('fs');var path=require(_0x5076('0x7'));var rimraf=require(_0x5076('0x8'));var config=require(_0x5076('0x9'));var attributes=require(_0x5076('0xa'));module[_0x5076('0xb')]=function(_0x11b4ab,_0x2a84e4){return _0x11b4ab[_0x5076('0xc')](_0x5076('0xd'),attributes,{'tableName':'fax_queues','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 f7596b1..604eb04 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 _0xe087=['request\x20sent','error','code','FaxQueue,\x20%s,\x20%s','message','info','result','catch','GetFaxQueue','findAll','options','raw','where','limit','map','model','include','attributes','stringify','ShowFaxQueue','FaxQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','then','debug','FaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x24bc41,_0x2a2242){var _0x59ff5a=function(_0x49fc82){while(--_0x49fc82){_0x24bc41['push'](_0x24bc41['shift']());}};_0x59ff5a(++_0x2a2242);}(_0xe087,0x166));var _0x7e08=function(_0xfdb59f,_0x48e6c0){_0xfdb59f=_0xfdb59f-0x0;var _0x54780e=_0xe087[_0xfdb59f];return _0x54780e;};'use strict';var _=require(_0x7e08('0x0'));var util=require(_0x7e08('0x1'));var moment=require(_0x7e08('0x2'));var BPromise=require('bluebird');var rs=require(_0x7e08('0x3'));var fs=require('fs');var Redis=require(_0x7e08('0x4'));var db=require(_0x7e08('0x5'))['db'];var utils=require(_0x7e08('0x6'));var logger=require(_0x7e08('0x7'))(_0x7e08('0x8'));var config=require(_0x7e08('0x9'));var jayson=require(_0x7e08('0xa'));var client=jayson['client'][_0x7e08('0xb')]({'port':0x232a});config[_0x7e08('0xc')]=_[_0x7e08('0xd')](config[_0x7e08('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7e08('0xe'))(new Redis(config[_0x7e08('0xc')]));require(_0x7e08('0xf'))[_0x7e08('0x10')](socket);function respondWithRpcPromise(_0x3c3a86,_0x1ccc5d,_0x3a21f0){return new BPromise(function(_0x4a353f,_0x1bda3c){return client['request'](_0x3c3a86,_0x3a21f0)[_0x7e08('0x11')](function(_0x4d9b52){logger['info']('FaxQueue,\x20%s,\x20%s',_0x1ccc5d,'request\x20sent');logger[_0x7e08('0x12')](_0x7e08('0x13'),_0x1ccc5d,_0x7e08('0x14'),JSON['stringify'](_0x4d9b52));if(_0x4d9b52[_0x7e08('0x15')]){if(_0x4d9b52['error'][_0x7e08('0x16')]===0x1f4){logger[_0x7e08('0x15')](_0x7e08('0x17'),_0x1ccc5d,_0x4d9b52[_0x7e08('0x15')][_0x7e08('0x18')]);return _0x1bda3c(_0x4d9b52[_0x7e08('0x15')][_0x7e08('0x18')]);}logger[_0x7e08('0x15')]('FaxQueue,\x20%s,\x20%s',_0x1ccc5d,_0x4d9b52[_0x7e08('0x15')][_0x7e08('0x18')]);return _0x4a353f(_0x4d9b52[_0x7e08('0x15')][_0x7e08('0x18')]);}else{logger[_0x7e08('0x19')](_0x7e08('0x17'),_0x1ccc5d,_0x7e08('0x14'));_0x4a353f(_0x4d9b52[_0x7e08('0x1a')][_0x7e08('0x18')]);}})[_0x7e08('0x1b')](function(_0x4a0b94){logger['error'](_0x7e08('0x17'),_0x1ccc5d,_0x4a0b94);_0x1bda3c(_0x4a0b94);});});}exports[_0x7e08('0x1c')]=function(_0x11013a){var _0x5b9376=this;return new Promise(function(_0x319b4e,_0xca32bd){return db['FaxQueue'][_0x7e08('0x1d')]({'raw':_0x11013a[_0x7e08('0x1e')]?_0x11013a[_0x7e08('0x1e')][_0x7e08('0x1f')]===undefined?!![]:![]:!![],'where':_0x11013a[_0x7e08('0x1e')]?_0x11013a[_0x7e08('0x1e')][_0x7e08('0x20')]||null:null,'attributes':_0x11013a['options']?_0x11013a[_0x7e08('0x1e')]['attributes']||null:null,'limit':_0x11013a[_0x7e08('0x1e')]?_0x11013a[_0x7e08('0x1e')][_0x7e08('0x21')]||null:null,'include':_0x11013a[_0x7e08('0x1e')]?_0x11013a[_0x7e08('0x1e')]['include']?_[_0x7e08('0x22')](_0x11013a[_0x7e08('0x1e')]['include'],function(_0x1cf66f){return{'model':db[_0x1cf66f[_0x7e08('0x23')]],'as':_0x1cf66f['as'],'attributes':_0x1cf66f['attributes'],'include':_0x1cf66f[_0x7e08('0x24')]?_[_0x7e08('0x22')](_0x1cf66f[_0x7e08('0x24')],function(_0x4ed32d){return{'model':db[_0x4ed32d['model']],'as':_0x4ed32d['as'],'attributes':_0x4ed32d[_0x7e08('0x25')],'include':_0x4ed32d['include']?_[_0x7e08('0x22')](_0x4ed32d[_0x7e08('0x24')],function(_0x2089a7){return{'model':db[_0x2089a7[_0x7e08('0x23')]],'as':_0x2089a7['as'],'attributes':_0x2089a7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x176d70){logger['info'](_0x7e08('0x1c'),_0x11013a);logger[_0x7e08('0x12')]('GetFaxQueue',_0x11013a,JSON[_0x7e08('0x26')](_0x176d70));_0x319b4e(_0x176d70);})[_0x7e08('0x1b')](function(_0x30503e){logger['error'](_0x7e08('0x1c'),_0x30503e['message'],_0x11013a);_0xca32bd(_0x5b9376['error'](0x1f4,_0x30503e[_0x7e08('0x18')]));});});};exports[_0x7e08('0x27')]=function(_0x1d5995){var _0x338c80=this;return new Promise(function(_0x2ab5f4,_0x2d637b){return db[_0x7e08('0x28')][_0x7e08('0x29')]({'raw':_0x1d5995[_0x7e08('0x1e')]?_0x1d5995[_0x7e08('0x1e')][_0x7e08('0x1f')]===undefined?!![]:![]:!![],'where':_0x1d5995['options']?_0x1d5995[_0x7e08('0x1e')][_0x7e08('0x20')]||null:null,'attributes':_0x1d5995['options']?_0x1d5995[_0x7e08('0x1e')][_0x7e08('0x25')]||null:null,'include':_0x1d5995[_0x7e08('0x1e')]?_0x1d5995[_0x7e08('0x1e')]['include']?_[_0x7e08('0x22')](_0x1d5995[_0x7e08('0x1e')][_0x7e08('0x24')],function(_0x6ca1e){return{'model':db[_0x6ca1e[_0x7e08('0x23')]],'as':_0x6ca1e['as'],'attributes':_0x6ca1e[_0x7e08('0x25')],'include':_0x6ca1e[_0x7e08('0x24')]?_[_0x7e08('0x22')](_0x6ca1e[_0x7e08('0x24')],function(_0x2dbae0){return{'model':db[_0x2dbae0[_0x7e08('0x23')]],'as':_0x2dbae0['as'],'attributes':_0x2dbae0['attributes'],'include':_0x2dbae0[_0x7e08('0x24')]?_[_0x7e08('0x22')](_0x2dbae0['include'],function(_0x1910c0){return{'model':db[_0x1910c0[_0x7e08('0x23')]],'as':_0x1910c0['as'],'attributes':_0x1910c0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x151e00){logger[_0x7e08('0x19')](_0x7e08('0x27'),_0x1d5995);logger[_0x7e08('0x12')]('ShowFaxQueue',_0x1d5995,JSON[_0x7e08('0x26')](_0x151e00));_0x2ab5f4(_0x151e00);})[_0x7e08('0x1b')](function(_0x5f09d5){logger[_0x7e08('0x15')](_0x7e08('0x27'),_0x5f09d5['message'],_0x1d5995);_0x2d637b(_0x338c80[_0x7e08('0x15')](0x1f4,_0x5f09d5['message']));});});}; \ No newline at end of file +var _0xe1ca=['localhost','socket.io-emitter','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FaxQueue,\x20%s,\x20%s','result','catch','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxQueue','ShowFaxQueue','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe1ca,0x164));var _0xae1c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe1ca[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xae1c('0x0'));var util=require('util');var moment=require(_0xae1c('0x1'));var BPromise=require(_0xae1c('0x2'));var rs=require(_0xae1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae1c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xae1c('0x5'))(_0xae1c('0x6'));var config=require(_0xae1c('0x7'));var jayson=require(_0xae1c('0x8'));var client=jayson[_0xae1c('0x9')][_0xae1c('0xa')]({'port':0x232a});config[_0xae1c('0xb')]=_[_0xae1c('0xc')](config[_0xae1c('0xb')],{'host':_0xae1c('0xd'),'port':0x18eb});var socket=require(_0xae1c('0xe'))(new Redis(config[_0xae1c('0xb')]));require(_0xae1c('0xf'))['register'](socket);function respondWithRpcPromise(_0x4892d6,_0x13f826,_0x155321){return new BPromise(function(_0x34b16b,_0x537469){return client[_0xae1c('0x10')](_0x4892d6,_0x155321)[_0xae1c('0x11')](function(_0x3f0d52){logger[_0xae1c('0x12')]('FaxQueue,\x20%s,\x20%s',_0x13f826,'request\x20sent');logger['debug'](_0xae1c('0x13'),_0x13f826,_0xae1c('0x14'),JSON[_0xae1c('0x15')](_0x3f0d52));if(_0x3f0d52['error']){if(_0x3f0d52[_0xae1c('0x16')][_0xae1c('0x17')]===0x1f4){logger[_0xae1c('0x16')]('FaxQueue,\x20%s,\x20%s',_0x13f826,_0x3f0d52['error'][_0xae1c('0x18')]);return _0x537469(_0x3f0d52[_0xae1c('0x16')][_0xae1c('0x18')]);}logger['error'](_0xae1c('0x19'),_0x13f826,_0x3f0d52[_0xae1c('0x16')][_0xae1c('0x18')]);return _0x34b16b(_0x3f0d52[_0xae1c('0x16')][_0xae1c('0x18')]);}else{logger[_0xae1c('0x12')](_0xae1c('0x19'),_0x13f826,'request\x20sent');_0x34b16b(_0x3f0d52[_0xae1c('0x1a')][_0xae1c('0x18')]);}})[_0xae1c('0x1b')](function(_0x43472a){logger['error'](_0xae1c('0x19'),_0x13f826,_0x43472a);_0x537469(_0x43472a);});});}exports['GetFaxQueue']=function(_0x42798f){var _0x2ddfa9=this;return new Promise(function(_0x12052c,_0x354381){return db[_0xae1c('0x1c')][_0xae1c('0x1d')]({'raw':_0x42798f['options']?_0x42798f[_0xae1c('0x1e')][_0xae1c('0x1f')]===undefined?!![]:![]:!![],'where':_0x42798f[_0xae1c('0x1e')]?_0x42798f[_0xae1c('0x1e')][_0xae1c('0x20')]||null:null,'attributes':_0x42798f[_0xae1c('0x1e')]?_0x42798f[_0xae1c('0x1e')][_0xae1c('0x21')]||null:null,'limit':_0x42798f[_0xae1c('0x1e')]?_0x42798f[_0xae1c('0x1e')][_0xae1c('0x22')]||null:null,'include':_0x42798f[_0xae1c('0x1e')]?_0x42798f[_0xae1c('0x1e')][_0xae1c('0x23')]?_[_0xae1c('0x24')](_0x42798f[_0xae1c('0x1e')]['include'],function(_0x4209c7){return{'model':db[_0x4209c7[_0xae1c('0x25')]],'as':_0x4209c7['as'],'attributes':_0x4209c7['attributes'],'include':_0x4209c7['include']?_['map'](_0x4209c7[_0xae1c('0x23')],function(_0x57d73f){return{'model':db[_0x57d73f[_0xae1c('0x25')]],'as':_0x57d73f['as'],'attributes':_0x57d73f[_0xae1c('0x21')],'include':_0x57d73f['include']?_[_0xae1c('0x24')](_0x57d73f['include'],function(_0x1430a0){return{'model':db[_0x1430a0['model']],'as':_0x1430a0['as'],'attributes':_0x1430a0[_0xae1c('0x21')]};}):[]};}):[]};}):[]:[]})[_0xae1c('0x11')](function(_0x20b613){logger[_0xae1c('0x12')]('GetFaxQueue',_0x42798f);logger['debug']('GetFaxQueue',_0x42798f,JSON[_0xae1c('0x15')](_0x20b613));_0x12052c(_0x20b613);})[_0xae1c('0x1b')](function(_0x3ab74e){logger[_0xae1c('0x16')](_0xae1c('0x26'),_0x3ab74e[_0xae1c('0x18')],_0x42798f);_0x354381(_0x2ddfa9[_0xae1c('0x16')](0x1f4,_0x3ab74e[_0xae1c('0x18')]));});});};exports[_0xae1c('0x27')]=function(_0x28a30b){var _0x1b24b7=this;return new Promise(function(_0x3b72c5,_0x44e42b){return db['FaxQueue'][_0xae1c('0x28')]({'raw':_0x28a30b[_0xae1c('0x1e')]?_0x28a30b[_0xae1c('0x1e')][_0xae1c('0x1f')]===undefined?!![]:![]:!![],'where':_0x28a30b[_0xae1c('0x1e')]?_0x28a30b[_0xae1c('0x1e')]['where']||null:null,'attributes':_0x28a30b[_0xae1c('0x1e')]?_0x28a30b[_0xae1c('0x1e')]['attributes']||null:null,'include':_0x28a30b['options']?_0x28a30b[_0xae1c('0x1e')][_0xae1c('0x23')]?_['map'](_0x28a30b[_0xae1c('0x1e')][_0xae1c('0x23')],function(_0x36d531){return{'model':db[_0x36d531[_0xae1c('0x25')]],'as':_0x36d531['as'],'attributes':_0x36d531[_0xae1c('0x21')],'include':_0x36d531[_0xae1c('0x23')]?_[_0xae1c('0x24')](_0x36d531[_0xae1c('0x23')],function(_0x4e4ae9){return{'model':db[_0x4e4ae9[_0xae1c('0x25')]],'as':_0x4e4ae9['as'],'attributes':_0x4e4ae9[_0xae1c('0x21')],'include':_0x4e4ae9[_0xae1c('0x23')]?_['map'](_0x4e4ae9['include'],function(_0x16cec5){return{'model':db[_0x16cec5[_0xae1c('0x25')]],'as':_0x16cec5['as'],'attributes':_0x16cec5[_0xae1c('0x21')]};}):[]};}):[]};}):[]:[]})[_0xae1c('0x11')](function(_0x34dfed){logger['info']('ShowFaxQueue',_0x28a30b);logger['debug'](_0xae1c('0x27'),_0x28a30b,JSON['stringify'](_0x34dfed));_0x3b72c5(_0x34dfed);})[_0xae1c('0x1b')](function(_0x1a9601){logger['error'](_0xae1c('0x27'),_0x1a9601['message'],_0x28a30b);_0x44e42b(_0x1b24b7[_0xae1c('0x16')](0x1f4,_0x1a9601[_0xae1c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 1ec3fa3..4abfb56 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 _0x06f2=['update','emit','removeListener','register','length','faxQueue:','save','remove'];(function(_0x45a979,_0x49e73d){var _0xd7b9db=function(_0x17ccc9){while(--_0x17ccc9){_0x45a979['push'](_0x45a979['shift']());}};_0xd7b9db(++_0x49e73d);}(_0x06f2,0x96));var _0x206f=function(_0x3e3211,_0x112935){_0x3e3211=_0x3e3211-0x0;var _0x1adf26=_0x06f2[_0x3e3211];return _0x1adf26;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x206f('0x0'),_0x206f('0x1'),_0x206f('0x2')];function createListener(_0xa38464,_0x1cc760){return function(_0x52597b){_0x1cc760[_0x206f('0x3')](_0xa38464,_0x52597b);};}function removeListener(_0xe513f7,_0x1aef8f){return function(){FaxQueueEvents[_0x206f('0x4')](_0xe513f7,_0x1aef8f);};}exports[_0x206f('0x5')]=function(_0x4f7f62){for(var _0x2e144d=0x0,_0x518619=events[_0x206f('0x6')];_0x2e144d<_0x518619;_0x2e144d++){var _0x16bbfd=events[_0x2e144d];var _0x3c23c0=createListener(_0x206f('0x7')+_0x16bbfd,_0x4f7f62);FaxQueueEvents['on'](_0x16bbfd,_0x3c23c0);}}; \ No newline at end of file +var _0x0f9a=['length','./faxQueue.events','save','remove','update','removeListener','register'];(function(_0x5265bd,_0x581623){var _0x4f115a=function(_0x4b039d){while(--_0x4b039d){_0x5265bd['push'](_0x5265bd['shift']());}};_0x4f115a(++_0x581623);}(_0x0f9a,0x174));var _0xa0f9=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0f9a[_0xbca1b1];return _0x4e1686;};'use strict';var FaxQueueEvents=require(_0xa0f9('0x0'));var events=[_0xa0f9('0x1'),_0xa0f9('0x2'),_0xa0f9('0x3')];function createListener(_0x4a374e,_0x134e02){return function(_0x55a455){_0x134e02['emit'](_0x4a374e,_0x55a455);};}function removeListener(_0x15a27a,_0x522b65){return function(){FaxQueueEvents[_0xa0f9('0x4')](_0x15a27a,_0x522b65);};}exports[_0xa0f9('0x5')]=function(_0x16ab96){for(var _0x34d852=0x0,_0x34a8f3=events[_0xa0f9('0x6')];_0x34d852<_0x34a8f3;_0x34d852++){var _0xbea873=events[_0x34d852];var _0x4d7b7d=createListener('faxQueue:'+_0xbea873,_0x16ab96);FaxQueueEvents['on'](_0xbea873,_0x4d7b7d);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index ae58aae..0e552af 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 _0xd046=['util','path','connect-timeout','Router','../../components/interaction/service','./faxQueue.controller','index','get','describe','show','/:id/members','/:id/teams','isAuthenticated','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','/:id','update','delete','destroy','removeAgents','exports'];(function(_0xebe7f3,_0x1ee7e6){var _0x592902=function(_0x9570bb){while(--_0x9570bb){_0xebe7f3['push'](_0xebe7f3['shift']());}};_0x592902(++_0x1ee7e6);}(_0xd046,0x129));var _0x6d04=function(_0x198c32,_0x1f34e7){_0x198c32=_0x198c32-0x0;var _0x1b55a4=_0xd046[_0x198c32];return _0x1b55a4;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d04('0x4'));var config=require('../../config/environment');var controller=require(_0x6d04('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d04('0x6')]);router[_0x6d04('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x6d04('0x8')]);router[_0x6d04('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router['get'](_0x6d04('0xa'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x6d04('0xb'),auth[_0x6d04('0xc')](),controller[_0x6d04('0xd')]);router[_0x6d04('0x7')]('/:id/users',auth[_0x6d04('0xc')](),controller[_0x6d04('0xe')]);router[_0x6d04('0xf')]('/',auth[_0x6d04('0xc')](),controller[_0x6d04('0x10')]);router[_0x6d04('0xf')](_0x6d04('0xb'),auth[_0x6d04('0xc')](),controller[_0x6d04('0x11')]);router[_0x6d04('0xf')](_0x6d04('0x12'),auth[_0x6d04('0xc')](),controller[_0x6d04('0x13')]);router[_0x6d04('0x14')](_0x6d04('0x15'),auth[_0x6d04('0xc')](),controller[_0x6d04('0x16')]);router[_0x6d04('0x17')](_0x6d04('0x15'),auth[_0x6d04('0xc')](),controller[_0x6d04('0x18')]);router[_0x6d04('0x17')](_0x6d04('0xb'),auth[_0x6d04('0xc')](),controller['removeTeams']);router[_0x6d04('0x17')](_0x6d04('0x12'),auth[_0x6d04('0xc')](),controller[_0x6d04('0x19')]);module[_0x6d04('0x1a')]=router; \ No newline at end of file +var _0x3f8a=['delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addAgents','update'];(function(_0x2eade5,_0x29bcdf){var _0x2de2c2=function(_0x3cb6cb){while(--_0x3cb6cb){_0x2eade5['push'](_0x2eade5['shift']());}};_0x2de2c2(++_0x29bcdf);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x5c428e,_0x12ceb9){_0x5c428e=_0x5c428e-0x0;var _0x315c12=_0x3f8a[_0x5c428e];return _0x315c12;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var fs_extra=require(_0xa3f8('0x5'));var auth=require(_0xa3f8('0x6'));var interaction=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var controller=require(_0xa3f8('0x9'));router[_0xa3f8('0xa')]('/',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xc')]);router[_0xa3f8('0xa')](_0xa3f8('0xd'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xe')]);router[_0xa3f8('0xa')](_0xa3f8('0xf'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x10')]);router['get'](_0xa3f8('0x11'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x12')]);router[_0xa3f8('0xa')]('/:id/teams',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x13')]);router[_0xa3f8('0xa')](_0xa3f8('0x14'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x15')]);router[_0xa3f8('0x16')]('/',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x17')]);router[_0xa3f8('0x16')](_0xa3f8('0x18'),auth[_0xa3f8('0xb')](),controller['addTeams']);router[_0xa3f8('0x16')](_0xa3f8('0x14'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x19')]);router['put'](_0xa3f8('0xf'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x1a')]);router[_0xa3f8('0x1b')](_0xa3f8('0xf'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x1c')]);router[_0xa3f8('0x1b')](_0xa3f8('0x18'),auth[_0xa3f8('0xb')](),controller['removeTeams']);router[_0xa3f8('0x1b')]('/:id/users',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x1d')]);module[_0xa3f8('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 f85d48f..c3277a1 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 _0xce60=['sequelize','exports','STRING','DATE','moment'];(function(_0x3ed62b,_0x5cda1b){var _0x43bd6a=function(_0x463e33){while(--_0x463e33){_0x3ed62b['push'](_0x3ed62b['shift']());}};_0x43bd6a(++_0x5cda1b);}(_0xce60,0x153));var _0x0ce6=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0xce60[_0x264b9b];return _0x4c7a0e;};'use strict';var moment=require(_0x0ce6('0x0'));var Sequelize=require(_0x0ce6('0x1'));module[_0x0ce6('0x2')]={'uniqueid':{'type':Sequelize[_0x0ce6('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0ce6('0x3')]},'joinAt':{'type':Sequelize[_0x0ce6('0x4')]},'leaveAt':{'type':Sequelize[_0x0ce6('0x4')]},'acceptAt':{'type':Sequelize[_0x0ce6('0x4')]},'exitAt':{'type':Sequelize[_0x0ce6('0x4')]},'reason':{'type':Sequelize[_0x0ce6('0x3')]}}; \ No newline at end of file +var _0x6157=['STRING','DATE','sequelize','exports'];(function(_0x564037,_0x3511a8){var _0xa3614c=function(_0x387d50){while(--_0x387d50){_0x564037['push'](_0x564037['shift']());}};_0xa3614c(++_0x3511a8);}(_0x6157,0xea));var _0x7615=function(_0x2f1b4b,_0x534e19){_0x2f1b4b=_0x2f1b4b-0x0;var _0x20de2b=_0x6157[_0x2f1b4b];return _0x20de2b;};'use strict';var moment=require('moment');var Sequelize=require(_0x7615('0x0'));module[_0x7615('0x1')]={'uniqueid':{'type':Sequelize[_0x7615('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7615('0x2')]},'joinAt':{'type':Sequelize[_0x7615('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7615('0x3')]},'reason':{'type':Sequelize[_0x7615('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 7c2d122..d651272 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 _0x5088=['intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','name','send','map','FaxQueueReport','key','keys','query','filters'];(function(_0x21a064,_0x6ec93){var _0x14a150=function(_0x22d20c){while(--_0x22d20c){_0x21a064['push'](_0x21a064['shift']());}};_0x14a150(++_0x6ec93);}(_0x5088,0xa9));var _0x8508=function(_0x2b29ab,_0x201845){_0x2b29ab=_0x2b29ab-0x0;var _0x16e64b=_0x5088[_0x2b29ab];return _0x16e64b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8508('0x0'));var zipdir=require(_0x8508('0x1'));var jsonpatch=require(_0x8508('0x2'));var rp=require(_0x8508('0x3'));var moment=require('moment');var BPromise=require(_0x8508('0x4'));var Mustache=require(_0x8508('0x5'));var util=require(_0x8508('0x6'));var path=require(_0x8508('0x7'));var sox=require('sox');var csv=require(_0x8508('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8508('0x9'));var _=require(_0x8508('0xa'));var squel=require('squel');var crypto=require(_0x8508('0xb'));var jsforce=require(_0x8508('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8508('0x8'));var querystring=require(_0x8508('0xd'));var Papa=require(_0x8508('0xe'));var Redis=require(_0x8508('0xf'));var authService=require(_0x8508('0x10'));var qs=require(_0x8508('0x11'));var as=require(_0x8508('0x12'));var hardwareService=require(_0x8508('0x13'));var logger=require(_0x8508('0x14'))('api');var utils=require(_0x8508('0x15'));var config=require(_0x8508('0x16'));var licenseUtil=require(_0x8508('0x17'));var db=require(_0x8508('0x18'))['db'];function respondWithStatusCode(_0x184f08,_0x129d4c){_0x129d4c=_0x129d4c||0xcc;return function(_0x2a6969){if(_0x2a6969){return _0x184f08['sendStatus'](_0x129d4c);}return _0x184f08[_0x8508('0x19')](_0x129d4c)[_0x8508('0x1a')]();};}function respondWithResult(_0x1d64a7,_0x431b14){_0x431b14=_0x431b14||0xc8;return function(_0x4c4bf9){if(_0x4c4bf9){return _0x1d64a7[_0x8508('0x19')](_0x431b14)[_0x8508('0x1b')](_0x4c4bf9);}};}function respondWithFilteredResult(_0x5b1b8d,_0x34da29){return function(_0x4f81c7){if(_0x4f81c7){var _0xe8daa7=typeof _0x34da29[_0x8508('0x1c')]===_0x8508('0x1d')&&typeof _0x34da29[_0x8508('0x1e')]===_0x8508('0x1d');var _0x5668d3=_0x4f81c7[_0x8508('0x1f')];var _0x12a592=_0xe8daa7?0x0:_0x34da29['offset'];var _0x53621f=_0xe8daa7?_0x4f81c7[_0x8508('0x1f')]:_0x34da29['offset']+_0x34da29[_0x8508('0x1e')];var _0x3a8832;if(_0x53621f>=_0x5668d3){_0x53621f=_0x5668d3;_0x3a8832=0xc8;}else{_0x3a8832=0xce;}_0x5b1b8d[_0x8508('0x19')](_0x3a8832);return _0x5b1b8d['set'](_0x8508('0x20'),_0x12a592+'-'+_0x53621f+'/'+_0x5668d3)[_0x8508('0x1b')](_0x4f81c7);}return null;};}function patchUpdates(_0x245f8c){return function(_0x1da402){try{jsonpatch[_0x8508('0x21')](_0x1da402,_0x245f8c,!![]);}catch(_0x2d041e){return BPromise[_0x8508('0x22')](_0x2d041e);}return _0x1da402[_0x8508('0x23')]();};}function saveUpdates(_0x266b93,_0x34ee74){return function(_0x455594){if(_0x455594){return _0x455594['update'](_0x266b93)[_0x8508('0x24')](function(_0x1fb31e){return _0x1fb31e;});}return null;};}function removeEntity(_0x43fa1b,_0x5874b2){return function(_0x1efffd){if(_0x1efffd){return _0x1efffd[_0x8508('0x25')]()[_0x8508('0x24')](function(){_0x43fa1b['status'](0xcc)[_0x8508('0x1a')]();});}};}function handleEntityNotFound(_0x133d37,_0x373c86){return function(_0x2ccf2d){if(!_0x2ccf2d){_0x133d37['sendStatus'](0x194);}return _0x2ccf2d;};}function handleError(_0x500849,_0x3dcdff){_0x3dcdff=_0x3dcdff||0x1f4;return function(_0x4d872c){logger[_0x8508('0x26')](_0x4d872c['stack']);if(_0x4d872c[_0x8508('0x27')]){delete _0x4d872c[_0x8508('0x27')];}_0x500849[_0x8508('0x19')](_0x3dcdff)[_0x8508('0x28')](_0x4d872c);};}exports['index']=function(_0x2a99e0,_0x3d0d71){var _0x473363={},_0x4e51db={},_0x68f48c={'count':0x0,'rows':[]};var _0x4f9cbf=_[_0x8508('0x29')](db[_0x8508('0x2a')]['rawAttributes'],function(_0x307a8a){return{'name':_0x307a8a['fieldName'],'type':_0x307a8a['type'][_0x8508('0x2b')]};});_0x4e51db['model']=_[_0x8508('0x29')](_0x4f9cbf,_0x8508('0x27'));_0x4e51db['query']=_[_0x8508('0x2c')](_0x2a99e0[_0x8508('0x2d')]);_0x4e51db[_0x8508('0x2e')]=_[_0x8508('0x2f')](_0x4e51db[_0x8508('0x30')],_0x4e51db['query']);_0x473363[_0x8508('0x31')]=_[_0x8508('0x2f')](_0x4e51db[_0x8508('0x30')],qs['fields'](_0x2a99e0[_0x8508('0x2d')][_0x8508('0x32')]));_0x473363[_0x8508('0x31')]=_0x473363[_0x8508('0x31')]['length']?_0x473363['attributes']:_0x4e51db[_0x8508('0x30')];if(!_0x2a99e0[_0x8508('0x2d')][_0x8508('0x33')]('nolimit')){_0x473363[_0x8508('0x1e')]=qs[_0x8508('0x1e')](_0x2a99e0[_0x8508('0x2d')]['limit']);_0x473363['offset']=qs[_0x8508('0x1c')](_0x2a99e0['query']['offset']);}_0x473363[_0x8508('0x34')]=qs[_0x8508('0x35')](_0x2a99e0[_0x8508('0x2d')][_0x8508('0x35')]);_0x473363[_0x8508('0x36')]=qs['filters'](_[_0x8508('0x37')](_0x2a99e0['query'],_0x4e51db['filters']),_0x4f9cbf);if(_0x2a99e0[_0x8508('0x2d')][_0x8508('0x38')]){_0x473363[_0x8508('0x36')]=_[_0x8508('0x39')](_0x473363[_0x8508('0x36')],{'$or':_[_0x8508('0x29')](_0x4f9cbf,function(_0x58de84){if(_0x58de84['type']!==_0x8508('0x3a')){var _0x4a16dd={};_0x4a16dd[_0x58de84[_0x8508('0x27')]]={'$like':'%'+_0x2a99e0[_0x8508('0x2d')][_0x8508('0x38')]+'%'};return _0x4a16dd;}})});}_0x473363=_[_0x8508('0x39')]({},_0x473363,_0x2a99e0[_0x8508('0x3b')]);var _0x12a899={'where':_0x473363[_0x8508('0x36')]};return db[_0x8508('0x2a')][_0x8508('0x1f')](_0x12a899)[_0x8508('0x24')](function(_0x366750){_0x68f48c[_0x8508('0x1f')]=_0x366750;if(_0x2a99e0[_0x8508('0x2d')][_0x8508('0x3c')]){_0x473363[_0x8508('0x3d')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x8508('0x3e')](_0x473363);})[_0x8508('0x24')](function(_0x2e7b12){_0x68f48c[_0x8508('0x3f')]=_0x2e7b12;return _0x68f48c;})['then'](respondWithFilteredResult(_0x3d0d71,_0x473363))['catch'](handleError(_0x3d0d71,null));};exports[_0x8508('0x40')]=function(_0x2352fc,_0x1b8fe7){var _0x491559={'raw':!![],'where':{'id':_0x2352fc[_0x8508('0x41')]['id']}},_0x48adef={};_0x48adef[_0x8508('0x30')]=_[_0x8508('0x2c')](db['FaxQueueReport']['rawAttributes']);_0x48adef[_0x8508('0x2d')]=_[_0x8508('0x2c')](_0x2352fc[_0x8508('0x2d')]);_0x48adef['filters']=_[_0x8508('0x2f')](_0x48adef[_0x8508('0x30')],_0x48adef[_0x8508('0x2d')]);_0x491559[_0x8508('0x31')]=_[_0x8508('0x2f')](_0x48adef[_0x8508('0x30')],qs[_0x8508('0x32')](_0x2352fc['query'][_0x8508('0x32')]));_0x491559[_0x8508('0x31')]=_0x491559['attributes'][_0x8508('0x42')]?_0x491559['attributes']:_0x48adef[_0x8508('0x30')];if(_0x2352fc[_0x8508('0x2d')][_0x8508('0x3c')]){_0x491559[_0x8508('0x3d')]=[{'all':!![]}];}_0x491559=_[_0x8508('0x39')]({},_0x491559,_0x2352fc[_0x8508('0x3b')]);return db[_0x8508('0x2a')][_0x8508('0x43')](_0x491559)['then'](handleEntityNotFound(_0x1b8fe7,null))[_0x8508('0x24')](respondWithResult(_0x1b8fe7,null))[_0x8508('0x44')](handleError(_0x1b8fe7,null));};exports[_0x8508('0x45')]=function(_0x4787f6,_0x3a1907){return db['FaxQueueReport'][_0x8508('0x45')](_0x4787f6[_0x8508('0x46')],{})[_0x8508('0x24')](respondWithResult(_0x3a1907,0xc9))[_0x8508('0x44')](handleError(_0x3a1907,null));};exports['update']=function(_0x4e4d38,_0x2a8094){if(_0x4e4d38[_0x8508('0x46')]['id']){delete _0x4e4d38[_0x8508('0x46')]['id'];}return db['FaxQueueReport'][_0x8508('0x43')]({'where':{'id':_0x4e4d38[_0x8508('0x41')]['id']}})['then'](handleEntityNotFound(_0x2a8094,null))[_0x8508('0x24')](saveUpdates(_0x4e4d38['body'],null))[_0x8508('0x24')](respondWithResult(_0x2a8094,null))[_0x8508('0x44')](handleError(_0x2a8094,null));};exports[_0x8508('0x25')]=function(_0x1dd21f,_0x2bbbd8){return db['FaxQueueReport'][_0x8508('0x43')]({'where':{'id':_0x1dd21f[_0x8508('0x41')]['id']}})[_0x8508('0x24')](handleEntityNotFound(_0x2bbbd8,null))[_0x8508('0x24')](removeEntity(_0x2bbbd8,null))[_0x8508('0x44')](handleError(_0x2bbbd8,null));};exports[_0x8508('0x47')]=function(_0x5dc061,_0x3597b6){return db[_0x8508('0x2a')][_0x8508('0x47')]()[_0x8508('0x24')](respondWithResult(_0x3597b6,null))['catch'](handleError(_0x3597b6,null));}; \ No newline at end of file +var _0x4157=['findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','error','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','VIRTUAL','merge','options','FaxQueueReport','includeAll','include'];(function(_0x210603,_0x4adbac){var _0x1bcb7d=function(_0x2cdf89){while(--_0x2cdf89){_0x210603['push'](_0x210603['shift']());}};_0x1bcb7d(++_0x4adbac);}(_0x4157,0xf3));var _0x7415=function(_0x647d3,_0x4e64ae){_0x647d3=_0x647d3-0x0;var _0x35f005=_0x4157[_0x647d3];return _0x35f005;};'use strict';var emlformat=require(_0x7415('0x0'));var rimraf=require(_0x7415('0x1'));var zipdir=require(_0x7415('0x2'));var jsonpatch=require(_0x7415('0x3'));var rp=require(_0x7415('0x4'));var moment=require('moment');var BPromise=require(_0x7415('0x5'));var Mustache=require(_0x7415('0x6'));var util=require(_0x7415('0x7'));var path=require(_0x7415('0x8'));var sox=require(_0x7415('0x9'));var csv=require(_0x7415('0xa'));var ejs=require(_0x7415('0xb'));var fs=require('fs');var fs_extra=require(_0x7415('0xc'));var _=require(_0x7415('0xd'));var squel=require('squel');var crypto=require(_0x7415('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7415('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7415('0x10'));var Papa=require(_0x7415('0x11'));var Redis=require(_0x7415('0x12'));var authService=require(_0x7415('0x13'));var qs=require(_0x7415('0x14'));var as=require(_0x7415('0x15'));var hardwareService=require(_0x7415('0x16'));var logger=require('../../config/logger')(_0x7415('0x17'));var utils=require(_0x7415('0x18'));var config=require(_0x7415('0x19'));var licenseUtil=require(_0x7415('0x1a'));var db=require(_0x7415('0x1b'))['db'];function respondWithStatusCode(_0x4e2173,_0x3cfa3b){_0x3cfa3b=_0x3cfa3b||0xcc;return function(_0x186640){if(_0x186640){return _0x4e2173[_0x7415('0x1c')](_0x3cfa3b);}return _0x4e2173[_0x7415('0x1d')](_0x3cfa3b)[_0x7415('0x1e')]();};}function respondWithResult(_0x11a840,_0x37eb93){_0x37eb93=_0x37eb93||0xc8;return function(_0x31759a){if(_0x31759a){return _0x11a840[_0x7415('0x1d')](_0x37eb93)[_0x7415('0x1f')](_0x31759a);}};}function respondWithFilteredResult(_0x3f3e06,_0x1c193d){return function(_0x42efeb){if(_0x42efeb){var _0x4b8111=typeof _0x1c193d[_0x7415('0x20')]===_0x7415('0x21')&&typeof _0x1c193d[_0x7415('0x22')]===_0x7415('0x21');var _0x55b1bf=_0x42efeb[_0x7415('0x23')];var _0x2543f1=_0x4b8111?0x0:_0x1c193d['offset'];var _0x302a2b=_0x4b8111?_0x42efeb['count']:_0x1c193d[_0x7415('0x20')]+_0x1c193d[_0x7415('0x22')];var _0x47648d;if(_0x302a2b>=_0x55b1bf){_0x302a2b=_0x55b1bf;_0x47648d=0xc8;}else{_0x47648d=0xce;}_0x3f3e06[_0x7415('0x1d')](_0x47648d);return _0x3f3e06[_0x7415('0x24')](_0x7415('0x25'),_0x2543f1+'-'+_0x302a2b+'/'+_0x55b1bf)[_0x7415('0x1f')](_0x42efeb);}return null;};}function patchUpdates(_0x36a934){return function(_0x2fe93d){try{jsonpatch[_0x7415('0x26')](_0x2fe93d,_0x36a934,!![]);}catch(_0x1075cd){return BPromise['reject'](_0x1075cd);}return _0x2fe93d['save']();};}function saveUpdates(_0x28260b,_0x43df4a){return function(_0x129b3f){if(_0x129b3f){return _0x129b3f[_0x7415('0x27')](_0x28260b)['then'](function(_0x3a0df2){return _0x3a0df2;});}return null;};}function removeEntity(_0x530eea,_0x478abe){return function(_0xca366e){if(_0xca366e){return _0xca366e[_0x7415('0x28')]()[_0x7415('0x29')](function(){_0x530eea[_0x7415('0x1d')](0xcc)[_0x7415('0x1e')]();});}};}function handleEntityNotFound(_0x24a554,_0x26234c){return function(_0x3817d4){if(!_0x3817d4){_0x24a554[_0x7415('0x1c')](0x194);}return _0x3817d4;};}function handleError(_0x23a7be,_0x57b08a){_0x57b08a=_0x57b08a||0x1f4;return function(_0x464f49){logger[_0x7415('0x2a')](_0x464f49[_0x7415('0x2b')]);if(_0x464f49[_0x7415('0x2c')]){delete _0x464f49[_0x7415('0x2c')];}_0x23a7be['status'](_0x57b08a)[_0x7415('0x2d')](_0x464f49);};}exports['index']=function(_0xea1932,_0xbe0c21){var _0x115e0c={},_0x31588b={},_0x5dfe7b={'count':0x0,'rows':[]};var _0x45e783=_['map'](db['FaxQueueReport'][_0x7415('0x2e')],function(_0x24d2b3){return{'name':_0x24d2b3[_0x7415('0x2f')],'type':_0x24d2b3[_0x7415('0x30')]['key']};});_0x31588b[_0x7415('0x31')]=_[_0x7415('0x32')](_0x45e783,_0x7415('0x2c'));_0x31588b[_0x7415('0x33')]=_[_0x7415('0x34')](_0xea1932[_0x7415('0x33')]);_0x31588b[_0x7415('0x35')]=_[_0x7415('0x36')](_0x31588b[_0x7415('0x31')],_0x31588b[_0x7415('0x33')]);_0x115e0c[_0x7415('0x37')]=_['intersection'](_0x31588b[_0x7415('0x31')],qs[_0x7415('0x38')](_0xea1932['query'][_0x7415('0x38')]));_0x115e0c[_0x7415('0x37')]=_0x115e0c[_0x7415('0x37')][_0x7415('0x39')]?_0x115e0c[_0x7415('0x37')]:_0x31588b[_0x7415('0x31')];if(!_0xea1932[_0x7415('0x33')]['hasOwnProperty'](_0x7415('0x3a'))){_0x115e0c[_0x7415('0x22')]=qs[_0x7415('0x22')](_0xea1932[_0x7415('0x33')][_0x7415('0x22')]);_0x115e0c[_0x7415('0x20')]=qs[_0x7415('0x20')](_0xea1932['query']['offset']);}_0x115e0c[_0x7415('0x3b')]=qs['sort'](_0xea1932[_0x7415('0x33')][_0x7415('0x3c')]);_0x115e0c['where']=qs['filters'](_['pick'](_0xea1932[_0x7415('0x33')],_0x31588b['filters']),_0x45e783);if(_0xea1932[_0x7415('0x33')][_0x7415('0x3d')]){_0x115e0c[_0x7415('0x3e')]=_['merge'](_0x115e0c[_0x7415('0x3e')],{'$or':_[_0x7415('0x32')](_0x45e783,function(_0x2fdb6b){if(_0x2fdb6b[_0x7415('0x30')]!==_0x7415('0x3f')){var _0x4767c7={};_0x4767c7[_0x2fdb6b[_0x7415('0x2c')]]={'$like':'%'+_0xea1932[_0x7415('0x33')][_0x7415('0x3d')]+'%'};return _0x4767c7;}})});}_0x115e0c=_[_0x7415('0x40')]({},_0x115e0c,_0xea1932[_0x7415('0x41')]);var _0x245d16={'where':_0x115e0c[_0x7415('0x3e')]};return db[_0x7415('0x42')]['count'](_0x245d16)['then'](function(_0x2e437d){_0x5dfe7b['count']=_0x2e437d;if(_0xea1932['query'][_0x7415('0x43')]){_0x115e0c[_0x7415('0x44')]=[{'all':!![]}];}return db[_0x7415('0x42')][_0x7415('0x45')](_0x115e0c);})['then'](function(_0x4f655e){_0x5dfe7b[_0x7415('0x46')]=_0x4f655e;return _0x5dfe7b;})['then'](respondWithFilteredResult(_0xbe0c21,_0x115e0c))[_0x7415('0x47')](handleError(_0xbe0c21,null));};exports[_0x7415('0x48')]=function(_0x2d617a,_0x5c55f7){var _0x197273={'raw':!![],'where':{'id':_0x2d617a[_0x7415('0x49')]['id']}},_0x20ed3f={};_0x20ed3f[_0x7415('0x31')]=_['keys'](db[_0x7415('0x42')][_0x7415('0x2e')]);_0x20ed3f[_0x7415('0x33')]=_[_0x7415('0x34')](_0x2d617a['query']);_0x20ed3f[_0x7415('0x35')]=_[_0x7415('0x36')](_0x20ed3f[_0x7415('0x31')],_0x20ed3f['query']);_0x197273[_0x7415('0x37')]=_[_0x7415('0x36')](_0x20ed3f[_0x7415('0x31')],qs[_0x7415('0x38')](_0x2d617a['query'][_0x7415('0x38')]));_0x197273[_0x7415('0x37')]=_0x197273[_0x7415('0x37')][_0x7415('0x39')]?_0x197273[_0x7415('0x37')]:_0x20ed3f[_0x7415('0x31')];if(_0x2d617a[_0x7415('0x33')][_0x7415('0x43')]){_0x197273[_0x7415('0x44')]=[{'all':!![]}];}_0x197273=_[_0x7415('0x40')]({},_0x197273,_0x2d617a[_0x7415('0x41')]);return db[_0x7415('0x42')][_0x7415('0x4a')](_0x197273)[_0x7415('0x29')](handleEntityNotFound(_0x5c55f7,null))['then'](respondWithResult(_0x5c55f7,null))[_0x7415('0x47')](handleError(_0x5c55f7,null));};exports[_0x7415('0x4b')]=function(_0x5c743c,_0x241ea4){return db['FaxQueueReport'][_0x7415('0x4b')](_0x5c743c[_0x7415('0x4c')],{})[_0x7415('0x29')](respondWithResult(_0x241ea4,0xc9))[_0x7415('0x47')](handleError(_0x241ea4,null));};exports[_0x7415('0x27')]=function(_0x4ef6bf,_0x3f8672){if(_0x4ef6bf[_0x7415('0x4c')]['id']){delete _0x4ef6bf[_0x7415('0x4c')]['id'];}return db[_0x7415('0x42')][_0x7415('0x4a')]({'where':{'id':_0x4ef6bf[_0x7415('0x49')]['id']}})[_0x7415('0x29')](handleEntityNotFound(_0x3f8672,null))['then'](saveUpdates(_0x4ef6bf['body'],null))[_0x7415('0x29')](respondWithResult(_0x3f8672,null))[_0x7415('0x47')](handleError(_0x3f8672,null));};exports[_0x7415('0x28')]=function(_0x4ec19c,_0x4b989d){return db[_0x7415('0x42')]['find']({'where':{'id':_0x4ec19c['params']['id']}})[_0x7415('0x29')](handleEntityNotFound(_0x4b989d,null))['then'](removeEntity(_0x4b989d,null))[_0x7415('0x47')](handleError(_0x4b989d,null));};exports[_0x7415('0x4d')]=function(_0x612805,_0x22d52e){return db[_0x7415('0x42')][_0x7415('0x4d')]()['then'](respondWithResult(_0x22d52e,null))[_0x7415('0x47')](handleError(_0x22d52e,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index c5aff7a..5480af1 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x5d8972,_0x308bcf){var _0x3d56d4=function(_0x4eb0e9){while(--_0x4eb0e9){_0x5d8972['push'](_0x5d8972['shift']());}};_0x3d56d4(++_0x308bcf);}(_0x7a54,0x106));var _0x47a5=function(_0x4478f1,_0x1b2b81){_0x4478f1=_0x4478f1-0x0;var _0x5c0858=_0x7a54[_0x4478f1];return _0x5c0858;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0x1cb9,0x14e));var _0x91cb=function(_0x28032a,_0x59c6f4){_0x28032a=_0x28032a-0x0;var _0x37cd60=_0x1cb9[_0x28032a];return _0x37cd60;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index b7de1c8..8627ad7 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 _0xa017=['rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','error','code','message','FaxQueueReport,\x20%s,\x20%s','result','catch','CreateFaxQueueReport','create','body','options','raw','debug','stringify','update','where','attributes','limit','UpdateFaxQueueReport','util','moment','bluebird','ioredis','../../config/logger'];(function(_0x139826,_0x1662c8){var _0x554ccf=function(_0x1d10ec){while(--_0x1d10ec){_0x139826['push'](_0x139826['shift']());}};_0x554ccf(++_0x1662c8);}(_0xa017,0x1cc));var _0x7a01=function(_0x5bd359,_0x1cee79){_0x5bd359=_0x5bd359-0x0;var _0x52eaee=_0xa017[_0x5bd359];return _0x52eaee;};'use strict';var _=require('lodash');var util=require(_0x7a01('0x0'));var moment=require(_0x7a01('0x1'));var BPromise=require(_0x7a01('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a01('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7a01('0x4'))(_0x7a01('0x5'));var config=require(_0x7a01('0x6'));var jayson=require(_0x7a01('0x7'));var client=jayson[_0x7a01('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2834f9,_0x36af87,_0x790b40){return new BPromise(function(_0x5394f9,_0x1294bf){return client[_0x7a01('0x9')](_0x2834f9,_0x790b40)[_0x7a01('0xa')](function(_0x27b41b){logger[_0x7a01('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x36af87,_0x7a01('0xc'));logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x36af87,_0x7a01('0xc'),JSON['stringify'](_0x27b41b));if(_0x27b41b['error']){if(_0x27b41b[_0x7a01('0xd')][_0x7a01('0xe')]===0x1f4){logger[_0x7a01('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x36af87,_0x27b41b[_0x7a01('0xd')][_0x7a01('0xf')]);return _0x1294bf(_0x27b41b[_0x7a01('0xd')]['message']);}logger[_0x7a01('0xd')](_0x7a01('0x10'),_0x36af87,_0x27b41b[_0x7a01('0xd')][_0x7a01('0xf')]);return _0x5394f9(_0x27b41b['error'][_0x7a01('0xf')]);}else{logger[_0x7a01('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x36af87,_0x7a01('0xc'));_0x5394f9(_0x27b41b[_0x7a01('0x11')][_0x7a01('0xf')]);}})[_0x7a01('0x12')](function(_0x4b3f22){logger[_0x7a01('0xd')](_0x7a01('0x10'),_0x36af87,_0x4b3f22);_0x1294bf(_0x4b3f22);});});}exports[_0x7a01('0x13')]=function(_0x7378fd){var _0x53f628=this;return new Promise(function(_0x4e7ed9,_0x1456e4){return db['FaxQueueReport'][_0x7a01('0x14')](_0x7378fd[_0x7a01('0x15')],{'raw':_0x7378fd[_0x7a01('0x16')]?_0x7378fd['options'][_0x7a01('0x17')]===undefined?!![]:![]:!![]})[_0x7a01('0xa')](function(_0x642aec){logger[_0x7a01('0xb')](_0x7a01('0x13'),_0x7378fd);logger[_0x7a01('0x18')](_0x7a01('0x13'),_0x7378fd,JSON[_0x7a01('0x19')](_0x642aec));_0x4e7ed9(_0x642aec);})[_0x7a01('0x12')](function(_0x409a03){logger[_0x7a01('0xd')]('CreateFaxQueueReport',_0x409a03[_0x7a01('0xf')],_0x7378fd);_0x1456e4(_0x53f628['error'](0x1f4,_0x409a03['message']));});});};exports['UpdateFaxQueueReport']=function(_0x11bfab){var _0x528d26=this;return new Promise(function(_0x2a4e85,_0x4d535c){return db['FaxQueueReport'][_0x7a01('0x1a')](_0x11bfab[_0x7a01('0x15')],{'raw':_0x11bfab[_0x7a01('0x16')]?_0x11bfab[_0x7a01('0x16')][_0x7a01('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11bfab[_0x7a01('0x16')]?_0x11bfab[_0x7a01('0x16')][_0x7a01('0x1b')]||null:null,'attributes':_0x11bfab[_0x7a01('0x16')]?_0x11bfab[_0x7a01('0x16')][_0x7a01('0x1c')]||null:null,'limit':_0x11bfab[_0x7a01('0x16')]?_0x11bfab[_0x7a01('0x16')][_0x7a01('0x1d')]||null:null})[_0x7a01('0xa')](function(_0x5583de){logger['info'](_0x7a01('0x1e'),_0x11bfab);logger[_0x7a01('0x18')](_0x7a01('0x1e'),_0x11bfab,JSON[_0x7a01('0x19')](_0x5583de));_0x2a4e85(_0x5583de);})[_0x7a01('0x12')](function(_0x5630b0){logger[_0x7a01('0xd')](_0x7a01('0x1e'),_0x5630b0[_0x7a01('0xf')],_0x11bfab);_0x4d535c(_0x528d26[_0x7a01('0xd')](0x1f4,_0x5630b0[_0x7a01('0xf')]));});});}; \ No newline at end of file +var _0xde5e=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','where','limit','lodash','util','moment','bluebird'];(function(_0x5b61d3,_0x3ce09a){var _0x4e2d83=function(_0x47bf40){while(--_0x47bf40){_0x5b61d3['push'](_0x5b61d3['shift']());}};_0x4e2d83(++_0x3ce09a);}(_0xde5e,0x17d));var _0xede5=function(_0x39498e,_0x26a2c4){_0x39498e=_0x39498e-0x0;var _0x52d169=_0xde5e[_0x39498e];return _0x52d169;};'use strict';var _=require(_0xede5('0x0'));var util=require(_0xede5('0x1'));var moment=require(_0xede5('0x2'));var BPromise=require(_0xede5('0x3'));var rs=require(_0xede5('0x4'));var fs=require('fs');var Redis=require(_0xede5('0x5'));var db=require(_0xede5('0x6'))['db'];var utils=require(_0xede5('0x7'));var logger=require('../../config/logger')(_0xede5('0x8'));var config=require(_0xede5('0x9'));var jayson=require(_0xede5('0xa'));var client=jayson[_0xede5('0xb')][_0xede5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e5252,_0x1f8a59,_0x573688){return new BPromise(function(_0x2dc80a,_0x776fd6){return client[_0xede5('0xd')](_0x3e5252,_0x573688)[_0xede5('0xe')](function(_0x532c63){logger[_0xede5('0xf')](_0xede5('0x10'),_0x1f8a59,_0xede5('0x11'));logger[_0xede5('0x12')](_0xede5('0x13'),_0x1f8a59,_0xede5('0x11'),JSON[_0xede5('0x14')](_0x532c63));if(_0x532c63[_0xede5('0x15')]){if(_0x532c63[_0xede5('0x15')]['code']===0x1f4){logger[_0xede5('0x15')](_0xede5('0x10'),_0x1f8a59,_0x532c63[_0xede5('0x15')][_0xede5('0x16')]);return _0x776fd6(_0x532c63['error'][_0xede5('0x16')]);}logger['error'](_0xede5('0x10'),_0x1f8a59,_0x532c63[_0xede5('0x15')][_0xede5('0x16')]);return _0x2dc80a(_0x532c63[_0xede5('0x15')][_0xede5('0x16')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x1f8a59,_0xede5('0x11'));_0x2dc80a(_0x532c63[_0xede5('0x17')]['message']);}})[_0xede5('0x18')](function(_0x432792){logger[_0xede5('0x15')](_0xede5('0x10'),_0x1f8a59,_0x432792);_0x776fd6(_0x432792);});});}exports[_0xede5('0x19')]=function(_0x937dcb){var _0x2556bd=this;return new Promise(function(_0x3f3eb0,_0x4ad074){return db[_0xede5('0x1a')][_0xede5('0x1b')](_0x937dcb[_0xede5('0x1c')],{'raw':_0x937dcb['options']?_0x937dcb[_0xede5('0x1d')][_0xede5('0x1e')]===undefined?!![]:![]:!![]})[_0xede5('0xe')](function(_0x573450){logger[_0xede5('0xf')](_0xede5('0x19'),_0x937dcb);logger[_0xede5('0x12')](_0xede5('0x19'),_0x937dcb,JSON[_0xede5('0x14')](_0x573450));_0x3f3eb0(_0x573450);})[_0xede5('0x18')](function(_0x5ed7cf){logger[_0xede5('0x15')](_0xede5('0x19'),_0x5ed7cf[_0xede5('0x16')],_0x937dcb);_0x4ad074(_0x2556bd[_0xede5('0x15')](0x1f4,_0x5ed7cf[_0xede5('0x16')]));});});};exports[_0xede5('0x1f')]=function(_0x33680c){var _0x46f480=this;return new Promise(function(_0xe3d8f4,_0x40e34c){return db[_0xede5('0x1a')][_0xede5('0x20')](_0x33680c[_0xede5('0x1c')],{'raw':_0x33680c[_0xede5('0x1d')]?_0x33680c[_0xede5('0x1d')][_0xede5('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33680c[_0xede5('0x1d')]?_0x33680c[_0xede5('0x1d')][_0xede5('0x21')]||null:null,'attributes':_0x33680c[_0xede5('0x1d')]?_0x33680c[_0xede5('0x1d')]['attributes']||null:null,'limit':_0x33680c['options']?_0x33680c[_0xede5('0x1d')][_0xede5('0x22')]||null:null})[_0xede5('0xe')](function(_0x5e4ee4){logger[_0xede5('0xf')]('UpdateFaxQueueReport',_0x33680c);logger[_0xede5('0x12')](_0xede5('0x1f'),_0x33680c,JSON[_0xede5('0x14')](_0x5e4ee4));_0xe3d8f4(_0x5e4ee4);})[_0xede5('0x18')](function(_0x549c20){logger['error'](_0xede5('0x1f'),_0x549c20[_0xede5('0x16')],_0x33680c);_0x40e34c(_0x46f480[_0xede5('0x15')](0x1f4,_0x549c20[_0xede5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 0e2adfc..b3a3480 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 _0xb321=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb321,0x92));var _0x1b32=function(_0x2ce933,_0x26eb9a){_0x2ce933=_0x2ce933-0x0;var _0x451d89=_0xb321[_0x2ce933];return _0x451d89;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1b32('0x0'));var express=require(_0x1b32('0x1'));var router=express[_0x1b32('0x2')]();var fs_extra=require(_0x1b32('0x3'));var auth=require(_0x1b32('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0x1b32('0x5')]('/',auth[_0x1b32('0x6')](),controller[_0x1b32('0x7')]);router['get'](_0x1b32('0x8'),auth[_0x1b32('0x6')](),controller[_0x1b32('0x9')]);router[_0x1b32('0x5')](_0x1b32('0xa'),auth[_0x1b32('0x6')](),controller[_0x1b32('0xb')]);router[_0x1b32('0xc')]('/',auth[_0x1b32('0x6')](),controller[_0x1b32('0xd')]);router[_0x1b32('0xe')](_0x1b32('0xa'),auth[_0x1b32('0x6')](),controller[_0x1b32('0xf')]);router[_0x1b32('0x10')](_0x1b32('0xa'),auth[_0x1b32('0x6')](),controller[_0x1b32('0x11')]);module[_0x1b32('0x12')]=router; \ No newline at end of file +var _0xe612=['/describe','describe','/:id','post','create','put','update','destroy','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xe612,0x1ca));var _0x2e61=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe612[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2e61('0x0'));var timeout=require('connect-timeout');var express=require(_0x2e61('0x1'));var router=express[_0x2e61('0x2')]();var fs_extra=require(_0x2e61('0x3'));var auth=require(_0x2e61('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2e61('0x5'));var controller=require(_0x2e61('0x6'));router[_0x2e61('0x7')]('/',auth[_0x2e61('0x8')](),controller[_0x2e61('0x9')]);router['get'](_0x2e61('0xa'),auth['isAuthenticated'](),controller[_0x2e61('0xb')]);router['get'](_0x2e61('0xc'),auth[_0x2e61('0x8')](),controller['show']);router[_0x2e61('0xd')]('/',auth[_0x2e61('0x8')](),controller[_0x2e61('0xe')]);router[_0x2e61('0xf')]('/:id',auth[_0x2e61('0x8')](),controller[_0x2e61('0x10')]);router['delete'](_0x2e61('0xc'),auth[_0x2e61('0x8')](),controller[_0x2e61('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index c1d511f..1e6e2ff 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4ccd0a,_0x19ec34){var _0x1d83ab=function(_0x1899af){while(--_0x1899af){_0x4ccd0a['push'](_0x4ccd0a['shift']());}};_0x1d83ab(++_0x19ec34);}(_0xaa88,0x137));var _0x8aa8=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0xaa88[_0xabfec4];return _0x7bafa2;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x412b4a,_0x3f71ed){var _0x2466ab=function(_0x4436d3){while(--_0x4436d3){_0x412b4a['push'](_0x412b4a['shift']());}};_0x2466ab(++_0x3f71ed);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1faaa1,_0x1568dd){_0x1faaa1=_0x1faaa1-0x0;var _0x994ec=_0xcb91[_0x1faaa1];return _0x994ec;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 25b7fd0..5f9afa5 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 _0xad8b=['status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','name','index','map','FaxTransferReport','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','create','body','catch','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xad8b,0x80));var _0xbad8=function(_0x23266e,_0x3647e2){_0x23266e=_0x23266e-0x0;var _0x55c2b6=_0xad8b[_0x23266e];return _0x55c2b6;};'use strict';var emlformat=require(_0xbad8('0x0'));var rimraf=require(_0xbad8('0x1'));var zipdir=require(_0xbad8('0x2'));var jsonpatch=require(_0xbad8('0x3'));var rp=require('request-promise');var moment=require(_0xbad8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbad8('0x5'));var util=require(_0xbad8('0x6'));var path=require(_0xbad8('0x7'));var sox=require(_0xbad8('0x8'));var csv=require(_0xbad8('0x9'));var ejs=require(_0xbad8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbad8('0xb'));var squel=require('squel');var crypto=require(_0xbad8('0xc'));var jsforce=require(_0xbad8('0xd'));var deskjs=require(_0xbad8('0xe'));var toCsv=require(_0xbad8('0x9'));var querystring=require(_0xbad8('0xf'));var Papa=require(_0xbad8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbad8('0x11'));var as=require(_0xbad8('0x12'));var hardwareService=require(_0xbad8('0x13'));var logger=require(_0xbad8('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xbad8('0x15'));var licenseUtil=require(_0xbad8('0x16'));var db=require(_0xbad8('0x17'))['db'];function respondWithStatusCode(_0x2589f8,_0x1d69bc){_0x1d69bc=_0x1d69bc||0xcc;return function(_0x5f293b){if(_0x5f293b){return _0x2589f8['sendStatus'](_0x1d69bc);}return _0x2589f8[_0xbad8('0x18')](_0x1d69bc)[_0xbad8('0x19')]();};}function respondWithResult(_0x372e1e,_0x181c2c){_0x181c2c=_0x181c2c||0xc8;return function(_0x4aff08){if(_0x4aff08){return _0x372e1e[_0xbad8('0x18')](_0x181c2c)['json'](_0x4aff08);}};}function respondWithFilteredResult(_0x42f284,_0xa95894){return function(_0x46534c){if(_0x46534c){var _0x4e848b=typeof _0xa95894[_0xbad8('0x1a')]===_0xbad8('0x1b')&&typeof _0xa95894[_0xbad8('0x1c')]==='undefined';var _0x4a091f=_0x46534c[_0xbad8('0x1d')];var _0x29a7ab=_0x4e848b?0x0:_0xa95894['offset'];var _0x3e7f27=_0x4e848b?_0x46534c['count']:_0xa95894[_0xbad8('0x1a')]+_0xa95894['limit'];var _0x3dcbf7;if(_0x3e7f27>=_0x4a091f){_0x3e7f27=_0x4a091f;_0x3dcbf7=0xc8;}else{_0x3dcbf7=0xce;}_0x42f284[_0xbad8('0x18')](_0x3dcbf7);return _0x42f284[_0xbad8('0x1e')](_0xbad8('0x1f'),_0x29a7ab+'-'+_0x3e7f27+'/'+_0x4a091f)[_0xbad8('0x20')](_0x46534c);}return null;};}function patchUpdates(_0x16d0a7){return function(_0x411278){try{jsonpatch[_0xbad8('0x21')](_0x411278,_0x16d0a7,!![]);}catch(_0x14c439){return BPromise['reject'](_0x14c439);}return _0x411278[_0xbad8('0x22')]();};}function saveUpdates(_0x5b74ce,_0x49a787){return function(_0x3b9a4a){if(_0x3b9a4a){return _0x3b9a4a[_0xbad8('0x23')](_0x5b74ce)[_0xbad8('0x24')](function(_0x4a2e03){return _0x4a2e03;});}return null;};}function removeEntity(_0x5ae311,_0x27c162){return function(_0x2b4e66){if(_0x2b4e66){return _0x2b4e66[_0xbad8('0x25')]()['then'](function(){_0x5ae311[_0xbad8('0x18')](0xcc)[_0xbad8('0x19')]();});}};}function handleEntityNotFound(_0x2002c2,_0x592723){return function(_0x458216){if(!_0x458216){_0x2002c2[_0xbad8('0x26')](0x194);}return _0x458216;};}function handleError(_0x3f1340,_0x10773c){_0x10773c=_0x10773c||0x1f4;return function(_0x4c8781){logger[_0xbad8('0x27')](_0x4c8781['stack']);if(_0x4c8781[_0xbad8('0x28')]){delete _0x4c8781[_0xbad8('0x28')];}_0x3f1340[_0xbad8('0x18')](_0x10773c)['send'](_0x4c8781);};}exports[_0xbad8('0x29')]=function(_0x10009a,_0x2748ff){var _0x355675={},_0x1bad27={},_0x2a86bd={'count':0x0,'rows':[]};var _0x3c0b42=_[_0xbad8('0x2a')](db[_0xbad8('0x2b')][_0xbad8('0x2c')],function(_0x46e23b){return{'name':_0x46e23b[_0xbad8('0x2d')],'type':_0x46e23b['type']['key']};});_0x1bad27[_0xbad8('0x2e')]=_[_0xbad8('0x2a')](_0x3c0b42,'name');_0x1bad27[_0xbad8('0x2f')]=_[_0xbad8('0x30')](_0x10009a[_0xbad8('0x2f')]);_0x1bad27['filters']=_[_0xbad8('0x31')](_0x1bad27[_0xbad8('0x2e')],_0x1bad27[_0xbad8('0x2f')]);_0x355675['attributes']=_[_0xbad8('0x31')](_0x1bad27[_0xbad8('0x2e')],qs[_0xbad8('0x32')](_0x10009a[_0xbad8('0x2f')]['fields']));_0x355675[_0xbad8('0x33')]=_0x355675[_0xbad8('0x33')][_0xbad8('0x34')]?_0x355675[_0xbad8('0x33')]:_0x1bad27[_0xbad8('0x2e')];if(!_0x10009a[_0xbad8('0x2f')][_0xbad8('0x35')](_0xbad8('0x36'))){_0x355675[_0xbad8('0x1c')]=qs[_0xbad8('0x1c')](_0x10009a['query'][_0xbad8('0x1c')]);_0x355675[_0xbad8('0x1a')]=qs[_0xbad8('0x1a')](_0x10009a[_0xbad8('0x2f')][_0xbad8('0x1a')]);}_0x355675[_0xbad8('0x37')]=qs[_0xbad8('0x38')](_0x10009a[_0xbad8('0x2f')][_0xbad8('0x38')]);_0x355675[_0xbad8('0x39')]=qs[_0xbad8('0x3a')](_[_0xbad8('0x3b')](_0x10009a[_0xbad8('0x2f')],_0x1bad27[_0xbad8('0x3a')]),_0x3c0b42);if(_0x10009a['query'][_0xbad8('0x3c')]){_0x355675['where']=_[_0xbad8('0x3d')](_0x355675['where'],{'$or':_[_0xbad8('0x2a')](_0x3c0b42,function(_0x16b574){if(_0x16b574[_0xbad8('0x3e')]!==_0xbad8('0x3f')){var _0x2b3ac4={};_0x2b3ac4[_0x16b574[_0xbad8('0x28')]]={'$like':'%'+_0x10009a[_0xbad8('0x2f')][_0xbad8('0x3c')]+'%'};return _0x2b3ac4;}})});}_0x355675=_[_0xbad8('0x3d')]({},_0x355675,_0x10009a['options']);var _0x4e2229={'where':_0x355675[_0xbad8('0x39')]};return db['FaxTransferReport'][_0xbad8('0x1d')](_0x4e2229)['then'](function(_0x5e71a6){_0x2a86bd['count']=_0x5e71a6;if(_0x10009a[_0xbad8('0x2f')][_0xbad8('0x40')]){_0x355675[_0xbad8('0x41')]=[{'all':!![]}];}return db[_0xbad8('0x2b')][_0xbad8('0x42')](_0x355675);})[_0xbad8('0x24')](function(_0x472a03){_0x2a86bd[_0xbad8('0x43')]=_0x472a03;return _0x2a86bd;})[_0xbad8('0x24')](respondWithFilteredResult(_0x2748ff,_0x355675))['catch'](handleError(_0x2748ff,null));};exports[_0xbad8('0x44')]=function(_0x44bb37,_0x10b346){var _0x4e5503={'raw':!![],'where':{'id':_0x44bb37[_0xbad8('0x45')]['id']}},_0x45f4b8={};_0x45f4b8[_0xbad8('0x2e')]=_[_0xbad8('0x30')](db['FaxTransferReport'][_0xbad8('0x2c')]);_0x45f4b8['query']=_[_0xbad8('0x30')](_0x44bb37['query']);_0x45f4b8[_0xbad8('0x3a')]=_[_0xbad8('0x31')](_0x45f4b8[_0xbad8('0x2e')],_0x45f4b8[_0xbad8('0x2f')]);_0x4e5503[_0xbad8('0x33')]=_[_0xbad8('0x31')](_0x45f4b8[_0xbad8('0x2e')],qs['fields'](_0x44bb37[_0xbad8('0x2f')][_0xbad8('0x32')]));_0x4e5503[_0xbad8('0x33')]=_0x4e5503['attributes'][_0xbad8('0x34')]?_0x4e5503[_0xbad8('0x33')]:_0x45f4b8[_0xbad8('0x2e')];if(_0x44bb37['query'][_0xbad8('0x40')]){_0x4e5503['include']=[{'all':!![]}];}_0x4e5503=_[_0xbad8('0x3d')]({},_0x4e5503,_0x44bb37[_0xbad8('0x46')]);return db[_0xbad8('0x2b')]['find'](_0x4e5503)[_0xbad8('0x24')](handleEntityNotFound(_0x10b346,null))[_0xbad8('0x24')](respondWithResult(_0x10b346,null))['catch'](handleError(_0x10b346,null));};exports[_0xbad8('0x47')]=function(_0x176981,_0x26024e){return db['FaxTransferReport']['create'](_0x176981[_0xbad8('0x48')],{})[_0xbad8('0x24')](respondWithResult(_0x26024e,0xc9))[_0xbad8('0x49')](handleError(_0x26024e,null));};exports['update']=function(_0x585931,_0x3519a8){if(_0x585931[_0xbad8('0x48')]['id']){delete _0x585931[_0xbad8('0x48')]['id'];}return db['FaxTransferReport'][_0xbad8('0x4a')]({'where':{'id':_0x585931['params']['id']}})['then'](handleEntityNotFound(_0x3519a8,null))[_0xbad8('0x24')](saveUpdates(_0x585931[_0xbad8('0x48')],null))[_0xbad8('0x24')](respondWithResult(_0x3519a8,null))[_0xbad8('0x49')](handleError(_0x3519a8,null));};exports['destroy']=function(_0x5a9ad5,_0x7d82fc){return db[_0xbad8('0x2b')][_0xbad8('0x4a')]({'where':{'id':_0x5a9ad5[_0xbad8('0x45')]['id']}})[_0xbad8('0x24')](handleEntityNotFound(_0x7d82fc,null))[_0xbad8('0x24')](removeEntity(_0x7d82fc,null))[_0xbad8('0x49')](handleError(_0x7d82fc,null));};exports[_0xbad8('0x4b')]=function(_0x2cf018,_0x3e8803){return db[_0xbad8('0x2b')][_0xbad8('0x4b')]()['then'](respondWithResult(_0x3e8803,null))['catch'](handleError(_0x3e8803,null));}; \ No newline at end of file +var _0xaeb8=['catch','show','params','include','options','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','then','destroy','error','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows'];(function(_0x37e845,_0x219f9f){var _0x59e55b=function(_0x5dc6c8){while(--_0x5dc6c8){_0x37e845['push'](_0x37e845['shift']());}};_0x59e55b(++_0x219f9f);}(_0xaeb8,0x1e4));var _0x8aeb=function(_0x33bcdb,_0x11846b){_0x33bcdb=_0x33bcdb-0x0;var _0x18a9bf=_0xaeb8[_0x33bcdb];return _0x18a9bf;};'use strict';var emlformat=require(_0x8aeb('0x0'));var rimraf=require(_0x8aeb('0x1'));var zipdir=require(_0x8aeb('0x2'));var jsonpatch=require(_0x8aeb('0x3'));var rp=require(_0x8aeb('0x4'));var moment=require(_0x8aeb('0x5'));var BPromise=require(_0x8aeb('0x6'));var Mustache=require('mustache');var util=require(_0x8aeb('0x7'));var path=require(_0x8aeb('0x8'));var sox=require(_0x8aeb('0x9'));var csv=require(_0x8aeb('0xa'));var ejs=require(_0x8aeb('0xb'));var fs=require('fs');var fs_extra=require(_0x8aeb('0xc'));var _=require(_0x8aeb('0xd'));var squel=require(_0x8aeb('0xe'));var crypto=require(_0x8aeb('0xf'));var jsforce=require(_0x8aeb('0x10'));var deskjs=require(_0x8aeb('0x11'));var toCsv=require(_0x8aeb('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8aeb('0x12'));var authService=require(_0x8aeb('0x13'));var qs=require(_0x8aeb('0x14'));var as=require(_0x8aeb('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8aeb('0x16'))(_0x8aeb('0x17'));var utils=require(_0x8aeb('0x18'));var config=require(_0x8aeb('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aeb('0x1a'))['db'];function respondWithStatusCode(_0x105975,_0x30e8e4){_0x30e8e4=_0x30e8e4||0xcc;return function(_0x50bdf9){if(_0x50bdf9){return _0x105975[_0x8aeb('0x1b')](_0x30e8e4);}return _0x105975[_0x8aeb('0x1c')](_0x30e8e4)[_0x8aeb('0x1d')]();};}function respondWithResult(_0x4100cd,_0x3994ad){_0x3994ad=_0x3994ad||0xc8;return function(_0x474fac){if(_0x474fac){return _0x4100cd[_0x8aeb('0x1c')](_0x3994ad)['json'](_0x474fac);}};}function respondWithFilteredResult(_0x6ec063,_0x414de2){return function(_0x26cc0a){if(_0x26cc0a){var _0x1bb34f=typeof _0x414de2['offset']===_0x8aeb('0x1e')&&typeof _0x414de2[_0x8aeb('0x1f')]===_0x8aeb('0x1e');var _0x11017a=_0x26cc0a[_0x8aeb('0x20')];var _0x17ece4=_0x1bb34f?0x0:_0x414de2[_0x8aeb('0x21')];var _0x189f55=_0x1bb34f?_0x26cc0a[_0x8aeb('0x20')]:_0x414de2[_0x8aeb('0x21')]+_0x414de2['limit'];var _0x50641f;if(_0x189f55>=_0x11017a){_0x189f55=_0x11017a;_0x50641f=0xc8;}else{_0x50641f=0xce;}_0x6ec063[_0x8aeb('0x1c')](_0x50641f);return _0x6ec063[_0x8aeb('0x22')](_0x8aeb('0x23'),_0x17ece4+'-'+_0x189f55+'/'+_0x11017a)[_0x8aeb('0x24')](_0x26cc0a);}return null;};}function patchUpdates(_0x270e1e){return function(_0x25d270){try{jsonpatch[_0x8aeb('0x25')](_0x25d270,_0x270e1e,!![]);}catch(_0x2f9457){return BPromise['reject'](_0x2f9457);}return _0x25d270[_0x8aeb('0x26')]();};}function saveUpdates(_0x11c2e0,_0x2be151){return function(_0xcfae47){if(_0xcfae47){return _0xcfae47['update'](_0x11c2e0)[_0x8aeb('0x27')](function(_0xf08b2){return _0xf08b2;});}return null;};}function removeEntity(_0xa9f715,_0xd35158){return function(_0x4d6467){if(_0x4d6467){return _0x4d6467[_0x8aeb('0x28')]()[_0x8aeb('0x27')](function(){_0xa9f715['status'](0xcc)[_0x8aeb('0x1d')]();});}};}function handleEntityNotFound(_0x441825,_0x370e67){return function(_0x33ea09){if(!_0x33ea09){_0x441825[_0x8aeb('0x1b')](0x194);}return _0x33ea09;};}function handleError(_0x20ecf8,_0x251f14){_0x251f14=_0x251f14||0x1f4;return function(_0x8cafd5){logger[_0x8aeb('0x29')](_0x8cafd5[_0x8aeb('0x2a')]);if(_0x8cafd5[_0x8aeb('0x2b')]){delete _0x8cafd5[_0x8aeb('0x2b')];}_0x20ecf8[_0x8aeb('0x1c')](_0x251f14)['send'](_0x8cafd5);};}exports[_0x8aeb('0x2c')]=function(_0x35dfa9,_0x12fe1b){var _0x5c9eae={},_0x39341e={},_0x148d8b={'count':0x0,'rows':[]};var _0x4bcd57=_[_0x8aeb('0x2d')](db[_0x8aeb('0x2e')][_0x8aeb('0x2f')],function(_0x13d0e3){return{'name':_0x13d0e3[_0x8aeb('0x30')],'type':_0x13d0e3[_0x8aeb('0x31')]['key']};});_0x39341e[_0x8aeb('0x32')]=_['map'](_0x4bcd57,_0x8aeb('0x2b'));_0x39341e['query']=_[_0x8aeb('0x33')](_0x35dfa9[_0x8aeb('0x34')]);_0x39341e[_0x8aeb('0x35')]=_[_0x8aeb('0x36')](_0x39341e[_0x8aeb('0x32')],_0x39341e[_0x8aeb('0x34')]);_0x5c9eae[_0x8aeb('0x37')]=_['intersection'](_0x39341e[_0x8aeb('0x32')],qs[_0x8aeb('0x38')](_0x35dfa9[_0x8aeb('0x34')][_0x8aeb('0x38')]));_0x5c9eae[_0x8aeb('0x37')]=_0x5c9eae['attributes'][_0x8aeb('0x39')]?_0x5c9eae[_0x8aeb('0x37')]:_0x39341e[_0x8aeb('0x32')];if(!_0x35dfa9[_0x8aeb('0x34')][_0x8aeb('0x3a')]('nolimit')){_0x5c9eae[_0x8aeb('0x1f')]=qs['limit'](_0x35dfa9[_0x8aeb('0x34')][_0x8aeb('0x1f')]);_0x5c9eae[_0x8aeb('0x21')]=qs['offset'](_0x35dfa9[_0x8aeb('0x34')]['offset']);}_0x5c9eae[_0x8aeb('0x3b')]=qs[_0x8aeb('0x3c')](_0x35dfa9[_0x8aeb('0x34')][_0x8aeb('0x3c')]);_0x5c9eae[_0x8aeb('0x3d')]=qs[_0x8aeb('0x35')](_[_0x8aeb('0x3e')](_0x35dfa9['query'],_0x39341e[_0x8aeb('0x35')]),_0x4bcd57);if(_0x35dfa9[_0x8aeb('0x34')][_0x8aeb('0x3f')]){_0x5c9eae[_0x8aeb('0x3d')]=_[_0x8aeb('0x40')](_0x5c9eae[_0x8aeb('0x3d')],{'$or':_['map'](_0x4bcd57,function(_0x35cf87){if(_0x35cf87[_0x8aeb('0x31')]!==_0x8aeb('0x41')){var _0x9f1561={};_0x9f1561[_0x35cf87['name']]={'$like':'%'+_0x35dfa9['query'][_0x8aeb('0x3f')]+'%'};return _0x9f1561;}})});}_0x5c9eae=_[_0x8aeb('0x40')]({},_0x5c9eae,_0x35dfa9['options']);var _0x2f165f={'where':_0x5c9eae[_0x8aeb('0x3d')]};return db[_0x8aeb('0x2e')][_0x8aeb('0x20')](_0x2f165f)[_0x8aeb('0x27')](function(_0x4e8e8c){_0x148d8b[_0x8aeb('0x20')]=_0x4e8e8c;if(_0x35dfa9[_0x8aeb('0x34')][_0x8aeb('0x42')]){_0x5c9eae['include']=[{'all':!![]}];}return db[_0x8aeb('0x2e')][_0x8aeb('0x43')](_0x5c9eae);})['then'](function(_0x39ff67){_0x148d8b[_0x8aeb('0x44')]=_0x39ff67;return _0x148d8b;})[_0x8aeb('0x27')](respondWithFilteredResult(_0x12fe1b,_0x5c9eae))[_0x8aeb('0x45')](handleError(_0x12fe1b,null));};exports[_0x8aeb('0x46')]=function(_0x3ecfca,_0x170ba7){var _0x4cd3a8={'raw':!![],'where':{'id':_0x3ecfca[_0x8aeb('0x47')]['id']}},_0x29ddb3={};_0x29ddb3[_0x8aeb('0x32')]=_[_0x8aeb('0x33')](db[_0x8aeb('0x2e')]['rawAttributes']);_0x29ddb3['query']=_[_0x8aeb('0x33')](_0x3ecfca[_0x8aeb('0x34')]);_0x29ddb3[_0x8aeb('0x35')]=_[_0x8aeb('0x36')](_0x29ddb3[_0x8aeb('0x32')],_0x29ddb3['query']);_0x4cd3a8[_0x8aeb('0x37')]=_[_0x8aeb('0x36')](_0x29ddb3['model'],qs[_0x8aeb('0x38')](_0x3ecfca[_0x8aeb('0x34')][_0x8aeb('0x38')]));_0x4cd3a8[_0x8aeb('0x37')]=_0x4cd3a8[_0x8aeb('0x37')][_0x8aeb('0x39')]?_0x4cd3a8[_0x8aeb('0x37')]:_0x29ddb3[_0x8aeb('0x32')];if(_0x3ecfca['query'][_0x8aeb('0x42')]){_0x4cd3a8[_0x8aeb('0x48')]=[{'all':!![]}];}_0x4cd3a8=_['merge']({},_0x4cd3a8,_0x3ecfca[_0x8aeb('0x49')]);return db['FaxTransferReport'][_0x8aeb('0x4a')](_0x4cd3a8)[_0x8aeb('0x27')](handleEntityNotFound(_0x170ba7,null))[_0x8aeb('0x27')](respondWithResult(_0x170ba7,null))['catch'](handleError(_0x170ba7,null));};exports[_0x8aeb('0x4b')]=function(_0x4fc2ca,_0x4cf45a){return db[_0x8aeb('0x2e')][_0x8aeb('0x4b')](_0x4fc2ca['body'],{})['then'](respondWithResult(_0x4cf45a,0xc9))[_0x8aeb('0x45')](handleError(_0x4cf45a,null));};exports[_0x8aeb('0x4c')]=function(_0x410b2c,_0x242ca6){if(_0x410b2c['body']['id']){delete _0x410b2c[_0x8aeb('0x4d')]['id'];}return db[_0x8aeb('0x2e')][_0x8aeb('0x4a')]({'where':{'id':_0x410b2c[_0x8aeb('0x47')]['id']}})['then'](handleEntityNotFound(_0x242ca6,null))[_0x8aeb('0x27')](saveUpdates(_0x410b2c['body'],null))[_0x8aeb('0x27')](respondWithResult(_0x242ca6,null))[_0x8aeb('0x45')](handleError(_0x242ca6,null));};exports[_0x8aeb('0x28')]=function(_0x4b11b5,_0x5bc89c){return db['FaxTransferReport'][_0x8aeb('0x4a')]({'where':{'id':_0x4b11b5[_0x8aeb('0x47')]['id']}})[_0x8aeb('0x27')](handleEntityNotFound(_0x5bc89c,null))['then'](removeEntity(_0x5bc89c,null))[_0x8aeb('0x45')](handleError(_0x5bc89c,null));};exports['describe']=function(_0x14d53e,_0x4d0fd6){return db[_0x8aeb('0x2e')][_0x8aeb('0x4e')]()[_0x8aeb('0x27')](respondWithResult(_0x4d0fd6,null))[_0x8aeb('0x45')](handleError(_0x4d0fd6,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index f154987..40fe2b9 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 _0x4074=['report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport'];(function(_0x3fb743,_0x2b6886){var _0x135901=function(_0x5adc16){while(--_0x5adc16){_0x3fb743['push'](_0x3fb743['shift']());}};_0x135901(++_0x2b6886);}(_0x4074,0x1b4));var _0x4407=function(_0x381ca5,_0x435973){_0x381ca5=_0x381ca5-0x0;var _0x4a77cf=_0x4074[_0x381ca5];return _0x4a77cf;};'use strict';var _=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var logger=require(_0x4407('0x2'))(_0x4407('0x3'));var moment=require(_0x4407('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4407('0x5'));var rimraf=require(_0x4407('0x6'));var config=require(_0x4407('0x7'));var attributes=require(_0x4407('0x8'));module[_0x4407('0x9')]=function(_0x5db310,_0x5b7438){return _0x5db310[_0x4407('0xa')](_0x4407('0xb'),attributes,{'tableName':_0x4407('0xc'),'paranoid':![],'indexes':[{'name':_0x4407('0xd'),'fields':[_0x4407('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc42f=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','uniqueid'];(function(_0x215c50,_0x6a57d7){var _0x3f4e10=function(_0x5c0c3d){while(--_0x5c0c3d){_0x215c50['push'](_0x215c50['shift']());}};_0x3f4e10(++_0x6a57d7);}(_0xc42f,0x1e0));var _0xfc42=function(_0x285b53,_0x477323){_0x285b53=_0x285b53-0x0;var _0x3b9676=_0xc42f[_0x285b53];return _0x3b9676;};'use strict';var _=require(_0xfc42('0x0'));var util=require(_0xfc42('0x1'));var logger=require('../../config/logger')(_0xfc42('0x2'));var moment=require(_0xfc42('0x3'));var BPromise=require(_0xfc42('0x4'));var rp=require(_0xfc42('0x5'));var fs=require('fs');var path=require(_0xfc42('0x6'));var rimraf=require(_0xfc42('0x7'));var config=require(_0xfc42('0x8'));var attributes=require(_0xfc42('0x9'));module[_0xfc42('0xa')]=function(_0x183054,_0x540f7d){return _0x183054['define']('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0xfc42('0xb'),'fields':[_0xfc42('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 6102f7a..42cd3ad 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 _0xedd7=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxTransferReport,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xedd7,0x182));var _0x7edd=function(_0x337229,_0x390e5e){_0x337229=_0x337229-0x0;var _0x5c639a=_0xedd7[_0x337229];return _0x5c639a;};'use strict';var _=require('lodash');var util=require(_0x7edd('0x0'));var moment=require('moment');var BPromise=require(_0x7edd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7edd('0x2'));var db=require(_0x7edd('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7edd('0x4'))(_0x7edd('0x5'));var config=require(_0x7edd('0x6'));var jayson=require(_0x7edd('0x7'));var client=jayson[_0x7edd('0x8')][_0x7edd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2012ea,_0x8f96f8,_0x58300f){return new BPromise(function(_0x638229,_0x4bda70){return client[_0x7edd('0xa')](_0x2012ea,_0x58300f)[_0x7edd('0xb')](function(_0x2d1260){logger[_0x7edd('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x8f96f8,_0x7edd('0xd'));logger[_0x7edd('0xe')](_0x7edd('0xf'),_0x8f96f8,_0x7edd('0xd'),JSON[_0x7edd('0x10')](_0x2d1260));if(_0x2d1260['error']){if(_0x2d1260[_0x7edd('0x11')][_0x7edd('0x12')]===0x1f4){logger[_0x7edd('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x8f96f8,_0x2d1260['error'][_0x7edd('0x13')]);return _0x4bda70(_0x2d1260[_0x7edd('0x11')][_0x7edd('0x13')]);}logger[_0x7edd('0x11')](_0x7edd('0x14'),_0x8f96f8,_0x2d1260[_0x7edd('0x11')]['message']);return _0x638229(_0x2d1260[_0x7edd('0x11')][_0x7edd('0x13')]);}else{logger['info'](_0x7edd('0x14'),_0x8f96f8,_0x7edd('0xd'));_0x638229(_0x2d1260[_0x7edd('0x15')][_0x7edd('0x13')]);}})[_0x7edd('0x16')](function(_0x4c9983){logger['error'](_0x7edd('0x14'),_0x8f96f8,_0x4c9983);_0x4bda70(_0x4c9983);});});} \ No newline at end of file +var _0xdfb2=['FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info'];(function(_0x41a173,_0x1c1774){var _0x431b89=function(_0x4d5426){while(--_0x4d5426){_0x41a173['push'](_0x41a173['shift']());}};_0x431b89(++_0x1c1774);}(_0xdfb2,0xc5));var _0x2dfb=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xdfb2[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x2dfb('0x0'));var util=require(_0x2dfb('0x1'));var moment=require(_0x2dfb('0x2'));var BPromise=require(_0x2dfb('0x3'));var rs=require(_0x2dfb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2dfb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2dfb('0x6'));var config=require('../../config/environment');var jayson=require(_0x2dfb('0x7'));var client=jayson[_0x2dfb('0x8')][_0x2dfb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f3ae2,_0x1cc385,_0x4c2f99){return new BPromise(function(_0x52b7d0,_0x419206){return client[_0x2dfb('0xa')](_0x1f3ae2,_0x4c2f99)[_0x2dfb('0xb')](function(_0xe426cb){logger[_0x2dfb('0xc')](_0x2dfb('0xd'),_0x1cc385,_0x2dfb('0xe'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x1cc385,_0x2dfb('0xe'),JSON[_0x2dfb('0xf')](_0xe426cb));if(_0xe426cb[_0x2dfb('0x10')]){if(_0xe426cb[_0x2dfb('0x10')][_0x2dfb('0x11')]===0x1f4){logger['error'](_0x2dfb('0xd'),_0x1cc385,_0xe426cb[_0x2dfb('0x10')][_0x2dfb('0x12')]);return _0x419206(_0xe426cb['error'][_0x2dfb('0x12')]);}logger['error'](_0x2dfb('0xd'),_0x1cc385,_0xe426cb[_0x2dfb('0x10')][_0x2dfb('0x12')]);return _0x52b7d0(_0xe426cb[_0x2dfb('0x10')][_0x2dfb('0x12')]);}else{logger[_0x2dfb('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x1cc385,_0x2dfb('0xe'));_0x52b7d0(_0xe426cb[_0x2dfb('0x13')][_0x2dfb('0x12')]);}})[_0x2dfb('0x14')](function(_0x28ba3c){logger[_0x2dfb('0x10')](_0x2dfb('0xd'),_0x1cc385,_0x28ba3c);_0x419206(_0x28ba3c);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 4ce7e8c..5635080 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 _0x6d06=['/describe','describe','/:id','show','post','create','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index'];(function(_0x875175,_0x3d7f71){var _0x17c102=function(_0x52beeb){while(--_0x52beeb){_0x875175['push'](_0x875175['shift']());}};_0x17c102(++_0x3d7f71);}(_0x6d06,0xb1));var _0x66d0=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0x6d06[_0x4d7f3f];return _0x5d67cc;};'use strict';var multer=require(_0x66d0('0x0'));var util=require('util');var path=require(_0x66d0('0x1'));var timeout=require(_0x66d0('0x2'));var express=require(_0x66d0('0x3'));var router=express[_0x66d0('0x4')]();var fs_extra=require(_0x66d0('0x5'));var auth=require(_0x66d0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x66d0('0x7'));var controller=require(_0x66d0('0x8'));router[_0x66d0('0x9')]('/',auth[_0x66d0('0xa')](),controller[_0x66d0('0xb')]);router[_0x66d0('0x9')](_0x66d0('0xc'),auth['isAuthenticated'](),controller[_0x66d0('0xd')]);router[_0x66d0('0x9')](_0x66d0('0xe'),auth['isAuthenticated'](),controller[_0x66d0('0xf')]);router[_0x66d0('0x10')]('/',auth[_0x66d0('0xa')](),controller[_0x66d0('0x11')]);router[_0x66d0('0x12')](_0x66d0('0xe'),auth[_0x66d0('0xa')](),controller[_0x66d0('0x13')]);router['delete'](_0x66d0('0xe'),auth[_0x66d0('0xa')](),controller['destroy']);module[_0x66d0('0x14')]=router; \ No newline at end of file +var _0x16d4=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','post','create','update'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0x16d4,0xfe));var _0x416d=function(_0x3d56b6,_0x1accf5){_0x3d56b6=_0x3d56b6-0x0;var _0x577052=_0x16d4[_0x3d56b6];return _0x577052;};'use strict';var multer=require(_0x416d('0x0'));var util=require(_0x416d('0x1'));var path=require(_0x416d('0x2'));var timeout=require(_0x416d('0x3'));var express=require(_0x416d('0x4'));var router=express[_0x416d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x416d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x416d('0x7'));var controller=require(_0x416d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x416d('0x9')]);router[_0x416d('0xa')](_0x416d('0xb'),auth['isAuthenticated'](),controller[_0x416d('0xc')]);router[_0x416d('0xa')](_0x416d('0xd'),auth[_0x416d('0xe')](),controller[_0x416d('0xf')]);router[_0x416d('0x10')]('/',auth[_0x416d('0xe')](),controller[_0x416d('0x11')]);router['put'](_0x416d('0xd'),auth[_0x416d('0xe')](),controller[_0x416d('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x416d('0x13')]);module[_0x416d('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 98fff2f..4a1ec5a 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 _0xff40=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','update','delete'];(function(_0x14413c,_0x5efea1){var _0x442bcb=function(_0x4a5386){while(--_0x4a5386){_0x14413c['push'](_0x14413c['shift']());}};_0x442bcb(++_0x5efea1);}(_0xff40,0x1e5));var _0x0ff4=function(_0x308213,_0x224541){_0x308213=_0x308213-0x0;var _0x2e1619=_0xff40[_0x308213];return _0x2e1619;};'use strict';var multer=require('multer');var util=require(_0x0ff4('0x0'));var path=require(_0x0ff4('0x1'));var timeout=require(_0x0ff4('0x2'));var express=require(_0x0ff4('0x3'));var router=express[_0x0ff4('0x4')]();var fs_extra=require(_0x0ff4('0x5'));var auth=require(_0x0ff4('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0ff4('0x7'));router['get']('/',auth[_0x0ff4('0x8')](),controller[_0x0ff4('0x9')]);router[_0x0ff4('0xa')](_0x0ff4('0xb'),auth[_0x0ff4('0x8')](),controller[_0x0ff4('0xc')]);router[_0x0ff4('0xa')](_0x0ff4('0xd'),auth[_0x0ff4('0x8')](),controller['getConfigurations']);router[_0x0ff4('0xa')](_0x0ff4('0xe'),auth['isAuthenticated'](),controller[_0x0ff4('0xf')]);router['post']('/',auth[_0x0ff4('0x8')](),controller[_0x0ff4('0x10')]);router[_0x0ff4('0x11')](_0x0ff4('0xd'),auth[_0x0ff4('0x8')](),controller[_0x0ff4('0x12')]);router['put'](_0x0ff4('0xb'),auth[_0x0ff4('0x8')](),controller[_0x0ff4('0x13')]);router[_0x0ff4('0x14')](_0x0ff4('0xb'),auth['isAuthenticated'](),controller[_0x0ff4('0x15')]);module[_0x0ff4('0x16')]=router; \ No newline at end of file +var _0xce56=['getFields','post','create','addConfiguration','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x697b6e,_0xd5ab09){var _0x4ea11c=function(_0x1ab3cf){while(--_0x1ab3cf){_0x697b6e['push'](_0x697b6e['shift']());}};_0x4ea11c(++_0xd5ab09);}(_0xce56,0x7a));var _0x6ce5=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xce56[_0x18a79d];return _0x4f8848;};'use strict';var multer=require(_0x6ce5('0x0'));var util=require(_0x6ce5('0x1'));var path=require(_0x6ce5('0x2'));var timeout=require(_0x6ce5('0x3'));var express=require('express');var router=express[_0x6ce5('0x4')]();var fs_extra=require(_0x6ce5('0x5'));var auth=require(_0x6ce5('0x6'));var interaction=require(_0x6ce5('0x7'));var config=require('../../config/environment');var controller=require(_0x6ce5('0x8'));router[_0x6ce5('0x9')]('/',auth[_0x6ce5('0xa')](),controller[_0x6ce5('0xb')]);router['get'](_0x6ce5('0xc'),auth[_0x6ce5('0xa')](),controller[_0x6ce5('0xd')]);router['get'](_0x6ce5('0xe'),auth[_0x6ce5('0xa')](),controller[_0x6ce5('0xf')]);router[_0x6ce5('0x9')]('/:id/fields',auth[_0x6ce5('0xa')](),controller[_0x6ce5('0x10')]);router[_0x6ce5('0x11')]('/',auth[_0x6ce5('0xa')](),controller[_0x6ce5('0x12')]);router['post'](_0x6ce5('0xe'),auth[_0x6ce5('0xa')](),controller[_0x6ce5('0x13')]);router[_0x6ce5('0x14')](_0x6ce5('0xc'),auth[_0x6ce5('0xa')](),controller[_0x6ce5('0x15')]);router['delete'](_0x6ce5('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x6ce5('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index d6b5b8d..52754b6 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 _0x7d62=['exports','STRING','basic','ENUM','integrationTab','newTab','sequelize'];(function(_0x479286,_0x221a9b){var _0x4aeb02=function(_0x355f68){while(--_0x355f68){_0x479286['push'](_0x479286['shift']());}};_0x4aeb02(++_0x221a9b);}(_0x7d62,0x76));var _0x27d6=function(_0x35ca06,_0x2ea559){_0x35ca06=_0x35ca06-0x0;var _0x17911f=_0x7d62[_0x35ca06];return _0x17911f;};'use strict';var Sequelize=require(_0x27d6('0x0'));module[_0x27d6('0x1')]={'name':{'type':Sequelize[_0x27d6('0x2')]},'description':{'type':Sequelize[_0x27d6('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x27d6('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x27d6('0x3')),'defaultValue':_0x27d6('0x3')},'password':{'type':Sequelize[_0x27d6('0x2')]},'consumerKey':{'type':Sequelize[_0x27d6('0x2')]},'consumerSecret':{'type':Sequelize[_0x27d6('0x2')]},'token':{'type':Sequelize[_0x27d6('0x2')]},'tokenSecret':{'type':Sequelize[_0x27d6('0x2')]},'serverUrl':{'type':Sequelize[_0x27d6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x27d6('0x4')](_0x27d6('0x5'),_0x27d6('0x6')),'defaultValue':_0x27d6('0x5')}}; \ No newline at end of file +var _0xf6c5=['integrationTab','newTab','exports','STRING','ENUM','basic'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xf6c5,0x1ac));var _0x5f6c=function(_0x55f2c3,_0x38aab3){_0x55f2c3=_0x55f2c3-0x0;var _0x5ae790=_0xf6c5[_0x55f2c3];return _0x5ae790;};'use strict';var Sequelize=require('sequelize');module[_0x5f6c('0x0')]={'name':{'type':Sequelize[_0x5f6c('0x1')]},'description':{'type':Sequelize[_0x5f6c('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5f6c('0x1')]},'authType':{'type':Sequelize[_0x5f6c('0x2')](_0x5f6c('0x3')),'defaultValue':_0x5f6c('0x3')},'password':{'type':Sequelize[_0x5f6c('0x1')]},'consumerKey':{'type':Sequelize[_0x5f6c('0x1')]},'consumerSecret':{'type':Sequelize[_0x5f6c('0x1')]},'token':{'type':Sequelize[_0x5f6c('0x1')]},'tokenSecret':{'type':Sequelize[_0x5f6c('0x1')]},'serverUrl':{'type':Sequelize[_0x5f6c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5f6c('0x2')](_0x5f6c('0x4'),_0x5f6c('0x5')),'defaultValue':_0x5f6c('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index ee1682c..c053ffe 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 _0x42fc=['consumerKey','consumerSecret','token','slice','substring','lastIndexOf','GET','format','application/json','authType','basic','headers','%s:%s','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','sendStatus','error','stack','name','send','map','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','DeskAccount','includeAll','findAll','catch','show','rawAttributes','include','find','create','body','getConfigurations','findOne','params','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','remoteUri','username','password'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x42fc,0x1db));var _0xc42f=function(_0x552107,_0x28b1ef){_0x552107=_0x552107-0x0;var _0x5b1f95=_0x42fc[_0x552107];return _0x5b1f95;};'use strict';var emlformat=require(_0xc42f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc42f('0x1'));var jsonpatch=require(_0xc42f('0x2'));var rp=require(_0xc42f('0x3'));var moment=require('moment');var BPromise=require(_0xc42f('0x4'));var Mustache=require(_0xc42f('0x5'));var util=require(_0xc42f('0x6'));var path=require(_0xc42f('0x7'));var sox=require(_0xc42f('0x8'));var csv=require(_0xc42f('0x9'));var ejs=require(_0xc42f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc42f('0xb'));var squel=require('squel');var crypto=require(_0xc42f('0xc'));var jsforce=require(_0xc42f('0xd'));var deskjs=require(_0xc42f('0xe'));var toCsv=require(_0xc42f('0x9'));var querystring=require(_0xc42f('0xf'));var Papa=require(_0xc42f('0x10'));var Redis=require('ioredis');var authService=require(_0xc42f('0x11'));var qs=require(_0xc42f('0x12'));var as=require(_0xc42f('0x13'));var hardwareService=require(_0xc42f('0x14'));var logger=require(_0xc42f('0x15'))(_0xc42f('0x16'));var utils=require(_0xc42f('0x17'));var config=require(_0xc42f('0x18'));var licenseUtil=require(_0xc42f('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1cbbf6,_0x325c93){_0x325c93=_0x325c93||0xcc;return function(_0x39ef42){if(_0x39ef42){return _0x1cbbf6['sendStatus'](_0x325c93);}return _0x1cbbf6[_0xc42f('0x1a')](_0x325c93)[_0xc42f('0x1b')]();};}function respondWithResult(_0x50c4bc,_0x4db7bf){_0x4db7bf=_0x4db7bf||0xc8;return function(_0xfa56aa){if(_0xfa56aa){return _0x50c4bc[_0xc42f('0x1a')](_0x4db7bf)['json'](_0xfa56aa);}};}function respondWithFilteredResult(_0x357fc5,_0x21b162){return function(_0x298194){if(_0x298194){var _0x3e3ab2=typeof _0x21b162[_0xc42f('0x1c')]===_0xc42f('0x1d')&&typeof _0x21b162[_0xc42f('0x1e')]===_0xc42f('0x1d');var _0x2d7b42=_0x298194[_0xc42f('0x1f')];var _0x44e23f=_0x3e3ab2?0x0:_0x21b162['offset'];var _0x54da21=_0x3e3ab2?_0x298194[_0xc42f('0x1f')]:_0x21b162[_0xc42f('0x1c')]+_0x21b162[_0xc42f('0x1e')];var _0x8c7c4;if(_0x54da21>=_0x2d7b42){_0x54da21=_0x2d7b42;_0x8c7c4=0xc8;}else{_0x8c7c4=0xce;}_0x357fc5[_0xc42f('0x1a')](_0x8c7c4);return _0x357fc5[_0xc42f('0x20')](_0xc42f('0x21'),_0x44e23f+'-'+_0x54da21+'/'+_0x2d7b42)[_0xc42f('0x22')](_0x298194);}return null;};}function patchUpdates(_0x2754d9){return function(_0x2b7526){try{jsonpatch[_0xc42f('0x23')](_0x2b7526,_0x2754d9,!![]);}catch(_0xf12056){return BPromise[_0xc42f('0x24')](_0xf12056);}return _0x2b7526['save']();};}function saveUpdates(_0xb5ce07,_0x3d10f2){return function(_0x11971d){if(_0x11971d){return _0x11971d[_0xc42f('0x25')](_0xb5ce07)[_0xc42f('0x26')](function(_0x178b0e){return _0x178b0e;});}return null;};}function removeEntity(_0x251c81,_0x3dc0bc){return function(_0x4f0534){if(_0x4f0534){return _0x4f0534['destroy']()['then'](function(){_0x251c81[_0xc42f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ac028,_0x30507e){return function(_0x214744){if(!_0x214744){_0x3ac028[_0xc42f('0x27')](0x194);}return _0x214744;};}function handleError(_0x40159f,_0x42d49f){_0x42d49f=_0x42d49f||0x1f4;return function(_0x4237fc){logger[_0xc42f('0x28')](_0x4237fc[_0xc42f('0x29')]);if(_0x4237fc[_0xc42f('0x2a')]){delete _0x4237fc[_0xc42f('0x2a')];}_0x40159f[_0xc42f('0x1a')](_0x42d49f)[_0xc42f('0x2b')](_0x4237fc);};}exports['index']=function(_0x4b7504,_0x5149db){var _0x28418e={},_0x5641ba={},_0x2d8a02={'count':0x0,'rows':[]};var _0x8f91f2=_[_0xc42f('0x2c')](db['DeskAccount']['rawAttributes'],function(_0x5006a2){return{'name':_0x5006a2['fieldName'],'type':_0x5006a2['type'][_0xc42f('0x2d')]};});_0x5641ba[_0xc42f('0x2e')]=_['map'](_0x8f91f2,'name');_0x5641ba[_0xc42f('0x2f')]=_[_0xc42f('0x30')](_0x4b7504[_0xc42f('0x2f')]);_0x5641ba[_0xc42f('0x31')]=_[_0xc42f('0x32')](_0x5641ba[_0xc42f('0x2e')],_0x5641ba[_0xc42f('0x2f')]);_0x28418e['attributes']=_[_0xc42f('0x32')](_0x5641ba['model'],qs[_0xc42f('0x33')](_0x4b7504[_0xc42f('0x2f')][_0xc42f('0x33')]));_0x28418e[_0xc42f('0x34')]=_0x28418e[_0xc42f('0x34')][_0xc42f('0x35')]?_0x28418e[_0xc42f('0x34')]:_0x5641ba[_0xc42f('0x2e')];if(!_0x4b7504[_0xc42f('0x2f')][_0xc42f('0x36')](_0xc42f('0x37'))){_0x28418e[_0xc42f('0x1e')]=qs['limit'](_0x4b7504[_0xc42f('0x2f')]['limit']);_0x28418e[_0xc42f('0x1c')]=qs[_0xc42f('0x1c')](_0x4b7504[_0xc42f('0x2f')][_0xc42f('0x1c')]);}_0x28418e[_0xc42f('0x38')]=qs[_0xc42f('0x39')](_0x4b7504[_0xc42f('0x2f')][_0xc42f('0x39')]);_0x28418e[_0xc42f('0x3a')]=qs[_0xc42f('0x31')](_[_0xc42f('0x3b')](_0x4b7504[_0xc42f('0x2f')],_0x5641ba[_0xc42f('0x31')]),_0x8f91f2);if(_0x4b7504[_0xc42f('0x2f')]['filter']){_0x28418e['where']=_[_0xc42f('0x3c')](_0x28418e[_0xc42f('0x3a')],{'$or':_[_0xc42f('0x2c')](_0x8f91f2,function(_0x564e64){if(_0x564e64[_0xc42f('0x3d')]!=='VIRTUAL'){var _0x517738={};_0x517738[_0x564e64[_0xc42f('0x2a')]]={'$like':'%'+_0x4b7504['query'][_0xc42f('0x3e')]+'%'};return _0x517738;}})});}_0x28418e=_[_0xc42f('0x3c')]({},_0x28418e,_0x4b7504[_0xc42f('0x3f')]);var _0x35c5ab={'where':_0x28418e[_0xc42f('0x3a')]};return db[_0xc42f('0x40')][_0xc42f('0x1f')](_0x35c5ab)[_0xc42f('0x26')](function(_0x2def03){_0x2d8a02[_0xc42f('0x1f')]=_0x2def03;if(_0x4b7504[_0xc42f('0x2f')][_0xc42f('0x41')]){_0x28418e['include']=[{'all':!![]}];}return db[_0xc42f('0x40')][_0xc42f('0x42')](_0x28418e);})[_0xc42f('0x26')](function(_0x4032cc){_0x2d8a02['rows']=_0x4032cc;return _0x2d8a02;})['then'](respondWithFilteredResult(_0x5149db,_0x28418e))[_0xc42f('0x43')](handleError(_0x5149db,null));};exports[_0xc42f('0x44')]=function(_0x3b2be6,_0x165ac6){var _0x2f13d2={'raw':![],'where':{'id':_0x3b2be6['params']['id']}},_0x2e19d6={};_0x2e19d6[_0xc42f('0x2e')]=_[_0xc42f('0x30')](db[_0xc42f('0x40')][_0xc42f('0x45')]);_0x2e19d6[_0xc42f('0x2f')]=_[_0xc42f('0x30')](_0x3b2be6[_0xc42f('0x2f')]);_0x2e19d6['filters']=_['intersection'](_0x2e19d6['model'],_0x2e19d6[_0xc42f('0x2f')]);_0x2f13d2[_0xc42f('0x34')]=_[_0xc42f('0x32')](_0x2e19d6['model'],qs[_0xc42f('0x33')](_0x3b2be6[_0xc42f('0x2f')]['fields']));_0x2f13d2[_0xc42f('0x34')]=_0x2f13d2[_0xc42f('0x34')]['length']?_0x2f13d2['attributes']:_0x2e19d6[_0xc42f('0x2e')];if(_0x3b2be6[_0xc42f('0x2f')]['includeAll']){_0x2f13d2[_0xc42f('0x46')]=[{'all':!![]}];}_0x2f13d2=_[_0xc42f('0x3c')]({},_0x2f13d2,_0x3b2be6[_0xc42f('0x3f')]);return db[_0xc42f('0x40')][_0xc42f('0x47')](_0x2f13d2)['then'](handleEntityNotFound(_0x165ac6,null))[_0xc42f('0x26')](respondWithResult(_0x165ac6,null))[_0xc42f('0x43')](handleError(_0x165ac6,null));};exports[_0xc42f('0x48')]=function(_0x30845b,_0x17768b){return db[_0xc42f('0x40')][_0xc42f('0x48')](_0x30845b[_0xc42f('0x49')],{})[_0xc42f('0x26')](respondWithResult(_0x17768b,0xc9))[_0xc42f('0x43')](handleError(_0x17768b,null));};exports[_0xc42f('0x25')]=function(_0x413de3,_0x1b10d8){if(_0x413de3[_0xc42f('0x49')]['id']){delete _0x413de3[_0xc42f('0x49')]['id'];}return db[_0xc42f('0x40')][_0xc42f('0x47')]({'where':{'id':_0x413de3['params']['id']}})['then'](handleEntityNotFound(_0x1b10d8,null))[_0xc42f('0x26')](saveUpdates(_0x413de3[_0xc42f('0x49')],null))[_0xc42f('0x26')](respondWithResult(_0x1b10d8,null))[_0xc42f('0x43')](handleError(_0x1b10d8,null));};exports['destroy']=function(_0x3da853,_0x43eafe){return db[_0xc42f('0x40')]['find']({'where':{'id':_0x3da853['params']['id']}})['then'](handleEntityNotFound(_0x43eafe,null))[_0xc42f('0x26')](removeEntity(_0x43eafe,null))[_0xc42f('0x43')](handleError(_0x43eafe,null));};exports[_0xc42f('0x4a')]=function(_0x581648,_0x327e76,_0x2e41fb){var _0xdb5c03={};var _0x135265={};var _0x38335e;var _0x3d4a10;return db[_0xc42f('0x40')][_0xc42f('0x4b')]({'where':{'id':_0x581648[_0xc42f('0x4c')]['id']}})[_0xc42f('0x26')](handleEntityNotFound(_0x327e76,null))[_0xc42f('0x26')](function(_0x38b21b){if(_0x38b21b){_0x38335e=_0x38b21b;_0x135265[_0xc42f('0x2e')]=_['keys'](db[_0xc42f('0x4d')][_0xc42f('0x45')]);_0x135265[_0xc42f('0x2f')]=_[_0xc42f('0x30')](_0x581648[_0xc42f('0x2f')]);_0x135265[_0xc42f('0x31')]=_[_0xc42f('0x32')](_0x135265[_0xc42f('0x2e')],_0x135265[_0xc42f('0x2f')]);_0xdb5c03['attributes']=_[_0xc42f('0x32')](_0x135265['model'],qs[_0xc42f('0x33')](_0x581648['query'][_0xc42f('0x33')]));_0xdb5c03[_0xc42f('0x34')]=_0xdb5c03[_0xc42f('0x34')][_0xc42f('0x35')]?_0xdb5c03[_0xc42f('0x34')]:_0x135265[_0xc42f('0x2e')];_0xdb5c03['order']=qs['sort'](_0x581648[_0xc42f('0x2f')][_0xc42f('0x39')]);_0xdb5c03[_0xc42f('0x3a')]=qs['filters'](_[_0xc42f('0x3b')](_0x581648[_0xc42f('0x2f')],_0x135265[_0xc42f('0x31')]));if(_0x581648[_0xc42f('0x2f')]['filter']){_0xdb5c03[_0xc42f('0x3a')]=_[_0xc42f('0x3c')](_0xdb5c03[_0xc42f('0x3a')],{'$or':_[_0xc42f('0x2c')](_0xdb5c03['attributes'],function(_0x337769){var _0x309690={};_0x309690[_0x337769]={'$like':'%'+_0x581648['query'][_0xc42f('0x3e')]+'%'};return _0x309690;})});}_0xdb5c03=_[_0xc42f('0x3c')]({},_0xdb5c03,_0x581648[_0xc42f('0x3f')]);return _0x38335e[_0xc42f('0x4a')](_0xdb5c03);}})['then'](function(_0x48d72d){if(_0x48d72d){_0x3d4a10=_0x48d72d[_0xc42f('0x35')];if(!_0x581648['query'][_0xc42f('0x36')](_0xc42f('0x37'))){_0xdb5c03['limit']=qs[_0xc42f('0x1e')](_0x581648['query'][_0xc42f('0x1e')]);_0xdb5c03['offset']=qs[_0xc42f('0x1c')](_0x581648['query'][_0xc42f('0x1c')]);}return _0x38335e['getConfigurations'](_0xdb5c03);}})['then'](function(_0x95122){if(_0x95122){return _0x95122?{'count':_0x3d4a10,'rows':_0x95122}:null;}})[_0xc42f('0x26')](respondWithResult(_0x327e76,null))[_0xc42f('0x43')](handleError(_0x327e76,null));};exports[_0xc42f('0x4e')]=function(_0x10d4dd,_0xd27346,_0x18c1f1){if(_0x10d4dd[_0xc42f('0x49')]['id']){delete _0x10d4dd['body']['id'];}return db[_0xc42f('0x40')][_0xc42f('0x4b')]({'where':{'id':_0x10d4dd[_0xc42f('0x4c')]['id']}})[_0xc42f('0x26')](handleEntityNotFound(_0xd27346,null))['then'](function(_0x525dff){if(_0x525dff){_0x10d4dd[_0xc42f('0x49')][_0xc42f('0x4f')]=_0x525dff['id'];_0x10d4dd[_0xc42f('0x49')][_0xc42f('0x50')]=integrations[_0xc42f('0x51')](_0x10d4dd['body'][_0xc42f('0x52')],_0x10d4dd[_0xc42f('0x49')]['type']);_0x10d4dd[_0xc42f('0x49')][_0xc42f('0x53')]=integrations[_0xc42f('0x54')](_0x10d4dd['body'][_0xc42f('0x52')],_0x10d4dd[_0xc42f('0x49')]['type']);return db[_0xc42f('0x4d')][_0xc42f('0x48')](_0x10d4dd['body'],{'include':[{'model':db['DeskField'],'as':_0xc42f('0x50')},{'model':db[_0xc42f('0x55')],'as':_0xc42f('0x53')}]});}return null;})['then'](respondWithResult(_0xd27346,null))[_0xc42f('0x43')](handleError(_0xd27346,null));};exports[_0xc42f('0x56')]=function(_0x5edf4e,_0x3b18ea,_0x35d1a0){var _0x5a0739=[{'name':'priority','label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x16aa55='';return db[_0xc42f('0x40')][_0xc42f('0x4b')]({'where':{'id':_0x5edf4e['params']['id']},'attributes':['id',_0xc42f('0x57'),'authType',_0xc42f('0x58'),_0xc42f('0x59'),_0xc42f('0x5a'),_0xc42f('0x5b'),_0xc42f('0x5c'),'tokenSecret']})[_0xc42f('0x26')](handleEntityNotFound(_0x3b18ea,null))['then'](function(_0x6ebb2d){if(_0x6ebb2d){_0x16aa55=_0x6ebb2d[_0xc42f('0x57')];var _0x1e53fe=_0x16aa55[_0xc42f('0x5d')](-0x1);if(_0x1e53fe==='/'){_0x16aa55=_0x16aa55[_0xc42f('0x5e')](0x0,_0x16aa55[_0xc42f('0x5f')](_0x1e53fe));}var _0x13f6c9={'method':_0xc42f('0x60'),'uri':util[_0xc42f('0x61')]('%s/custom_fields',_0x16aa55),'headers':{'Content-Type':_0xc42f('0x62'),'Accept':_0xc42f('0x62')},'json':!![]};if(_0x6ebb2d[_0xc42f('0x63')]===_0xc42f('0x64')){_0x13f6c9[_0xc42f('0x65')]['Authorization']=util[_0xc42f('0x61')]('Basic\x20%s',new Buffer(util[_0xc42f('0x61')](_0xc42f('0x66'),_0x6ebb2d[_0xc42f('0x58')],_0x6ebb2d[_0xc42f('0x59')]))['toString'](_0xc42f('0x67')));}return rp(_0x13f6c9)['then'](function(_0x133664){return _0x5a0739[_0xc42f('0x68')](_[_0xc42f('0x2c')](_0x133664[_0xc42f('0x69')][_0xc42f('0x6a')],function(_0x30568b){return{'id':_0x30568b[_0xc42f('0x2a')],'name':_0x30568b[_0xc42f('0x2a')],'type':_0x30568b[_0xc42f('0x3d')],'active':_0x30568b[_0xc42f('0x6b')],'label':_0x30568b[_0xc42f('0x6c')],'custom':!![]};}));});}})[_0xc42f('0x26')](function(_0x49b219){return{'count':_0x49b219[_0xc42f('0x35')],'rows':_0x49b219};})[_0xc42f('0x26')](respondWithResult(_0x3b18ea,null))[_0xc42f('0x43')](function(_0x946b60){var _0x19cd22=_0x5edf4e[_0xc42f('0x2f')][_0xc42f('0x6d')]?0x1f4:_0x946b60[_0xc42f('0x6e')]||0x1f4;logger[_0xc42f('0x28')](_0xc42f('0x6f'),_0xc42f('0x56'),_0x19cd22,JSON[_0xc42f('0x70')](_0x946b60));delete _0x946b60[_0xc42f('0x2a')];if(_0x19cd22===0x191){_0x19cd22=0x190;}_0x3b18ea['status'](_0x19cd22)[_0xc42f('0x2b')](_0x5edf4e['query'][_0xc42f('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x946b60[_0xc42f('0x6e')]}:_0x946b60);});}; \ No newline at end of file +var _0xef1d=['getFields','priority','authType','password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','lastIndexOf','GET','format','%s/custom_fields','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','concat','_embedded','entries','active','label','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','name','send','index','map','DeskAccount','rawAttributes','type','query','keys','filters','intersection','attributes','model','fields','length','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','options','catch','create','body','find','params','findOne','getConfigurations','nolimit','Subjects','getSubjects','channel','Descriptions','DeskConfiguration','DeskField'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0xef1d,0x1d2));var _0xdef1=function(_0x2d3f56,_0x1f122a){_0x2d3f56=_0x2d3f56-0x0;var _0xe9f4b9=_0xef1d[_0x2d3f56];return _0xe9f4b9;};'use strict';var emlformat=require(_0xdef1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdef1('0x1'));var jsonpatch=require(_0xdef1('0x2'));var rp=require(_0xdef1('0x3'));var moment=require(_0xdef1('0x4'));var BPromise=require(_0xdef1('0x5'));var Mustache=require(_0xdef1('0x6'));var util=require(_0xdef1('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xdef1('0x8'));var ejs=require(_0xdef1('0x9'));var fs=require('fs');var fs_extra=require(_0xdef1('0xa'));var _=require(_0xdef1('0xb'));var squel=require(_0xdef1('0xc'));var crypto=require(_0xdef1('0xd'));var jsforce=require(_0xdef1('0xe'));var deskjs=require(_0xdef1('0xf'));var toCsv=require(_0xdef1('0x8'));var querystring=require(_0xdef1('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdef1('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xdef1('0x12'));var config=require(_0xdef1('0x13'));var licenseUtil=require(_0xdef1('0x14'));var db=require(_0xdef1('0x15'))['db'];var integrations=require(_0xdef1('0x16'));function respondWithStatusCode(_0x5658d3,_0xb3139a){_0xb3139a=_0xb3139a||0xcc;return function(_0x554a40){if(_0x554a40){return _0x5658d3[_0xdef1('0x17')](_0xb3139a);}return _0x5658d3['status'](_0xb3139a)[_0xdef1('0x18')]();};}function respondWithResult(_0x191ab7,_0x600900){_0x600900=_0x600900||0xc8;return function(_0x590354){if(_0x590354){return _0x191ab7[_0xdef1('0x19')](_0x600900)[_0xdef1('0x1a')](_0x590354);}};}function respondWithFilteredResult(_0x271b95,_0x57cbd4){return function(_0x370952){if(_0x370952){var _0x450b51=typeof _0x57cbd4[_0xdef1('0x1b')]===_0xdef1('0x1c')&&typeof _0x57cbd4[_0xdef1('0x1d')]===_0xdef1('0x1c');var _0x5203a9=_0x370952[_0xdef1('0x1e')];var _0x5760e3=_0x450b51?0x0:_0x57cbd4['offset'];var _0x234308=_0x450b51?_0x370952[_0xdef1('0x1e')]:_0x57cbd4['offset']+_0x57cbd4[_0xdef1('0x1d')];var _0x441db2;if(_0x234308>=_0x5203a9){_0x234308=_0x5203a9;_0x441db2=0xc8;}else{_0x441db2=0xce;}_0x271b95[_0xdef1('0x19')](_0x441db2);return _0x271b95[_0xdef1('0x1f')](_0xdef1('0x20'),_0x5760e3+'-'+_0x234308+'/'+_0x5203a9)[_0xdef1('0x1a')](_0x370952);}return null;};}function patchUpdates(_0x27d50e){return function(_0x204c1c){try{jsonpatch[_0xdef1('0x21')](_0x204c1c,_0x27d50e,!![]);}catch(_0x13f652){return BPromise['reject'](_0x13f652);}return _0x204c1c[_0xdef1('0x22')]();};}function saveUpdates(_0x4a4634,_0x188179){return function(_0x3d877c){if(_0x3d877c){return _0x3d877c[_0xdef1('0x23')](_0x4a4634)['then'](function(_0x200d67){return _0x200d67;});}return null;};}function removeEntity(_0x78a5f,_0x498f6a){return function(_0x1d4075){if(_0x1d4075){return _0x1d4075[_0xdef1('0x24')]()[_0xdef1('0x25')](function(){_0x78a5f[_0xdef1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x413ac7,_0x9b06b2){return function(_0x1f61dd){if(!_0x1f61dd){_0x413ac7[_0xdef1('0x17')](0x194);}return _0x1f61dd;};}function handleError(_0x1f608b,_0x4656b1){_0x4656b1=_0x4656b1||0x1f4;return function(_0x1f4eee){logger['error'](_0x1f4eee['stack']);if(_0x1f4eee[_0xdef1('0x26')]){delete _0x1f4eee[_0xdef1('0x26')];}_0x1f608b['status'](_0x4656b1)[_0xdef1('0x27')](_0x1f4eee);};}exports[_0xdef1('0x28')]=function(_0x55dde5,_0x7db7a8){var _0x20df34={},_0x2067d1={},_0x3fea9e={'count':0x0,'rows':[]};var _0x5ef16a=_[_0xdef1('0x29')](db[_0xdef1('0x2a')][_0xdef1('0x2b')],function(_0x21842d){return{'name':_0x21842d['fieldName'],'type':_0x21842d[_0xdef1('0x2c')]['key']};});_0x2067d1['model']=_[_0xdef1('0x29')](_0x5ef16a,_0xdef1('0x26'));_0x2067d1[_0xdef1('0x2d')]=_[_0xdef1('0x2e')](_0x55dde5[_0xdef1('0x2d')]);_0x2067d1[_0xdef1('0x2f')]=_[_0xdef1('0x30')](_0x2067d1['model'],_0x2067d1['query']);_0x20df34[_0xdef1('0x31')]=_['intersection'](_0x2067d1[_0xdef1('0x32')],qs['fields'](_0x55dde5[_0xdef1('0x2d')][_0xdef1('0x33')]));_0x20df34[_0xdef1('0x31')]=_0x20df34[_0xdef1('0x31')][_0xdef1('0x34')]?_0x20df34['attributes']:_0x2067d1[_0xdef1('0x32')];if(!_0x55dde5[_0xdef1('0x2d')]['hasOwnProperty']('nolimit')){_0x20df34[_0xdef1('0x1d')]=qs[_0xdef1('0x1d')](_0x55dde5['query'][_0xdef1('0x1d')]);_0x20df34[_0xdef1('0x1b')]=qs[_0xdef1('0x1b')](_0x55dde5[_0xdef1('0x2d')][_0xdef1('0x1b')]);}_0x20df34[_0xdef1('0x35')]=qs['sort'](_0x55dde5[_0xdef1('0x2d')][_0xdef1('0x36')]);_0x20df34[_0xdef1('0x37')]=qs[_0xdef1('0x2f')](_[_0xdef1('0x38')](_0x55dde5[_0xdef1('0x2d')],_0x2067d1['filters']),_0x5ef16a);if(_0x55dde5[_0xdef1('0x2d')][_0xdef1('0x39')]){_0x20df34[_0xdef1('0x37')]=_['merge'](_0x20df34[_0xdef1('0x37')],{'$or':_['map'](_0x5ef16a,function(_0x1ee82){if(_0x1ee82[_0xdef1('0x2c')]!=='VIRTUAL'){var _0x1d88dd={};_0x1d88dd[_0x1ee82['name']]={'$like':'%'+_0x55dde5[_0xdef1('0x2d')]['filter']+'%'};return _0x1d88dd;}})});}_0x20df34=_[_0xdef1('0x3a')]({},_0x20df34,_0x55dde5['options']);var _0x33ac51={'where':_0x20df34[_0xdef1('0x37')]};return db[_0xdef1('0x2a')][_0xdef1('0x1e')](_0x33ac51)[_0xdef1('0x25')](function(_0x18cf02){_0x3fea9e[_0xdef1('0x1e')]=_0x18cf02;if(_0x55dde5['query'][_0xdef1('0x3b')]){_0x20df34[_0xdef1('0x3c')]=[{'all':!![]}];}return db['DeskAccount'][_0xdef1('0x3d')](_0x20df34);})[_0xdef1('0x25')](function(_0x4bbe15){_0x3fea9e[_0xdef1('0x3e')]=_0x4bbe15;return _0x3fea9e;})[_0xdef1('0x25')](respondWithFilteredResult(_0x7db7a8,_0x20df34))['catch'](handleError(_0x7db7a8,null));};exports[_0xdef1('0x3f')]=function(_0x1d17c6,_0x19d64c){var _0x1ed99f={'raw':![],'where':{'id':_0x1d17c6['params']['id']}},_0x398a53={};_0x398a53[_0xdef1('0x32')]=_[_0xdef1('0x2e')](db[_0xdef1('0x2a')][_0xdef1('0x2b')]);_0x398a53[_0xdef1('0x2d')]=_[_0xdef1('0x2e')](_0x1d17c6[_0xdef1('0x2d')]);_0x398a53[_0xdef1('0x2f')]=_['intersection'](_0x398a53[_0xdef1('0x32')],_0x398a53[_0xdef1('0x2d')]);_0x1ed99f[_0xdef1('0x31')]=_['intersection'](_0x398a53[_0xdef1('0x32')],qs['fields'](_0x1d17c6[_0xdef1('0x2d')][_0xdef1('0x33')]));_0x1ed99f[_0xdef1('0x31')]=_0x1ed99f[_0xdef1('0x31')][_0xdef1('0x34')]?_0x1ed99f[_0xdef1('0x31')]:_0x398a53[_0xdef1('0x32')];if(_0x1d17c6[_0xdef1('0x2d')][_0xdef1('0x3b')]){_0x1ed99f['include']=[{'all':!![]}];}_0x1ed99f=_[_0xdef1('0x3a')]({},_0x1ed99f,_0x1d17c6[_0xdef1('0x40')]);return db[_0xdef1('0x2a')]['find'](_0x1ed99f)[_0xdef1('0x25')](handleEntityNotFound(_0x19d64c,null))['then'](respondWithResult(_0x19d64c,null))[_0xdef1('0x41')](handleError(_0x19d64c,null));};exports['create']=function(_0x5e00a8,_0x387066){return db[_0xdef1('0x2a')][_0xdef1('0x42')](_0x5e00a8[_0xdef1('0x43')],{})[_0xdef1('0x25')](respondWithResult(_0x387066,0xc9))['catch'](handleError(_0x387066,null));};exports[_0xdef1('0x23')]=function(_0x19e49f,_0x32bf58){if(_0x19e49f[_0xdef1('0x43')]['id']){delete _0x19e49f[_0xdef1('0x43')]['id'];}return db['DeskAccount'][_0xdef1('0x44')]({'where':{'id':_0x19e49f[_0xdef1('0x45')]['id']}})[_0xdef1('0x25')](handleEntityNotFound(_0x32bf58,null))['then'](saveUpdates(_0x19e49f[_0xdef1('0x43')],null))[_0xdef1('0x25')](respondWithResult(_0x32bf58,null))[_0xdef1('0x41')](handleError(_0x32bf58,null));};exports['destroy']=function(_0x1263ef,_0x514751){return db[_0xdef1('0x2a')]['find']({'where':{'id':_0x1263ef[_0xdef1('0x45')]['id']}})[_0xdef1('0x25')](handleEntityNotFound(_0x514751,null))[_0xdef1('0x25')](removeEntity(_0x514751,null))[_0xdef1('0x41')](handleError(_0x514751,null));};exports['getConfigurations']=function(_0x3b5566,_0x675ee4,_0x52362f){var _0x1f821d={};var _0x5dec20={};var _0xdb817d;var _0x92774a;return db['DeskAccount'][_0xdef1('0x46')]({'where':{'id':_0x3b5566[_0xdef1('0x45')]['id']}})[_0xdef1('0x25')](handleEntityNotFound(_0x675ee4,null))[_0xdef1('0x25')](function(_0x5c1a0d){if(_0x5c1a0d){_0xdb817d=_0x5c1a0d;_0x5dec20[_0xdef1('0x32')]=_[_0xdef1('0x2e')](db['DeskConfiguration']['rawAttributes']);_0x5dec20[_0xdef1('0x2d')]=_[_0xdef1('0x2e')](_0x3b5566[_0xdef1('0x2d')]);_0x5dec20[_0xdef1('0x2f')]=_['intersection'](_0x5dec20[_0xdef1('0x32')],_0x5dec20[_0xdef1('0x2d')]);_0x1f821d[_0xdef1('0x31')]=_[_0xdef1('0x30')](_0x5dec20[_0xdef1('0x32')],qs['fields'](_0x3b5566[_0xdef1('0x2d')][_0xdef1('0x33')]));_0x1f821d['attributes']=_0x1f821d['attributes'][_0xdef1('0x34')]?_0x1f821d[_0xdef1('0x31')]:_0x5dec20['model'];_0x1f821d[_0xdef1('0x35')]=qs[_0xdef1('0x36')](_0x3b5566[_0xdef1('0x2d')][_0xdef1('0x36')]);_0x1f821d[_0xdef1('0x37')]=qs[_0xdef1('0x2f')](_['pick'](_0x3b5566[_0xdef1('0x2d')],_0x5dec20[_0xdef1('0x2f')]));if(_0x3b5566[_0xdef1('0x2d')][_0xdef1('0x39')]){_0x1f821d[_0xdef1('0x37')]=_['merge'](_0x1f821d[_0xdef1('0x37')],{'$or':_[_0xdef1('0x29')](_0x1f821d['attributes'],function(_0x5ddc11){var _0x36e582={};_0x36e582[_0x5ddc11]={'$like':'%'+_0x3b5566[_0xdef1('0x2d')][_0xdef1('0x39')]+'%'};return _0x36e582;})});}_0x1f821d=_[_0xdef1('0x3a')]({},_0x1f821d,_0x3b5566['options']);return _0xdb817d[_0xdef1('0x47')](_0x1f821d);}})[_0xdef1('0x25')](function(_0x16d2ea){if(_0x16d2ea){_0x92774a=_0x16d2ea['length'];if(!_0x3b5566[_0xdef1('0x2d')]['hasOwnProperty'](_0xdef1('0x48'))){_0x1f821d['limit']=qs[_0xdef1('0x1d')](_0x3b5566[_0xdef1('0x2d')][_0xdef1('0x1d')]);_0x1f821d[_0xdef1('0x1b')]=qs[_0xdef1('0x1b')](_0x3b5566[_0xdef1('0x2d')]['offset']);}return _0xdb817d['getConfigurations'](_0x1f821d);}})[_0xdef1('0x25')](function(_0xfae426){if(_0xfae426){return _0xfae426?{'count':_0x92774a,'rows':_0xfae426}:null;}})['then'](respondWithResult(_0x675ee4,null))[_0xdef1('0x41')](handleError(_0x675ee4,null));};exports['addConfiguration']=function(_0x1a3480,_0x521806,_0x4a4b6a){if(_0x1a3480[_0xdef1('0x43')]['id']){delete _0x1a3480['body']['id'];}return db['DeskAccount'][_0xdef1('0x46')]({'where':{'id':_0x1a3480[_0xdef1('0x45')]['id']}})[_0xdef1('0x25')](handleEntityNotFound(_0x521806,null))[_0xdef1('0x25')](function(_0x11f719){if(_0x11f719){_0x1a3480['body']['AccountId']=_0x11f719['id'];_0x1a3480[_0xdef1('0x43')][_0xdef1('0x49')]=integrations[_0xdef1('0x4a')](_0x1a3480[_0xdef1('0x43')][_0xdef1('0x4b')],_0x1a3480[_0xdef1('0x43')]['type']);_0x1a3480[_0xdef1('0x43')][_0xdef1('0x4c')]=integrations['getDescriptions'](_0x1a3480['body'][_0xdef1('0x4b')],_0x1a3480[_0xdef1('0x43')][_0xdef1('0x2c')]);return db[_0xdef1('0x4d')][_0xdef1('0x42')](_0x1a3480[_0xdef1('0x43')],{'include':[{'model':db['DeskField'],'as':_0xdef1('0x49')},{'model':db[_0xdef1('0x4e')],'as':_0xdef1('0x4c')}]});}return null;})[_0xdef1('0x25')](respondWithResult(_0x521806,null))[_0xdef1('0x41')](handleError(_0x521806,null));};exports[_0xdef1('0x4f')]=function(_0x261feb,_0x129026,_0x3e514a){var _0x13fd71=[{'name':_0xdef1('0x50'),'label':_0xdef1('0x50'),'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 _0x73870b='';return db[_0xdef1('0x2a')][_0xdef1('0x46')]({'where':{'id':_0x261feb['params']['id']},'attributes':['id','remoteUri',_0xdef1('0x51'),'username',_0xdef1('0x52'),_0xdef1('0x53'),_0xdef1('0x54'),_0xdef1('0x55'),_0xdef1('0x56')]})['then'](handleEntityNotFound(_0x129026,null))['then'](function(_0x3e782f){if(_0x3e782f){_0x73870b=_0x3e782f[_0xdef1('0x57')];var _0x2f4b38=_0x73870b['slice'](-0x1);if(_0x2f4b38==='/'){_0x73870b=_0x73870b['substring'](0x0,_0x73870b[_0xdef1('0x58')](_0x2f4b38));}var _0x57acd5={'method':_0xdef1('0x59'),'uri':util[_0xdef1('0x5a')](_0xdef1('0x5b'),_0x73870b),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x3e782f[_0xdef1('0x51')]===_0xdef1('0x5c')){_0x57acd5[_0xdef1('0x5d')][_0xdef1('0x5e')]=util[_0xdef1('0x5a')](_0xdef1('0x5f'),new Buffer(util[_0xdef1('0x5a')](_0xdef1('0x60'),_0x3e782f['username'],_0x3e782f[_0xdef1('0x52')]))[_0xdef1('0x61')]('base64'));}return rp(_0x57acd5)[_0xdef1('0x25')](function(_0x116cc4){return _0x13fd71[_0xdef1('0x62')](_['map'](_0x116cc4[_0xdef1('0x63')][_0xdef1('0x64')],function(_0x42cd48){return{'id':_0x42cd48[_0xdef1('0x26')],'name':_0x42cd48[_0xdef1('0x26')],'type':_0x42cd48[_0xdef1('0x2c')],'active':_0x42cd48[_0xdef1('0x65')],'label':_0x42cd48[_0xdef1('0x66')],'custom':!![]};}));});}})[_0xdef1('0x25')](function(_0xd218e5){return{'count':_0xd218e5['length'],'rows':_0xd218e5};})[_0xdef1('0x25')](respondWithResult(_0x129026,null))[_0xdef1('0x41')](function(_0x1dc3a1){var _0x3e4d2f=_0x261feb[_0xdef1('0x2d')]['test']?0x1f4:_0x1dc3a1[_0xdef1('0x67')]||0x1f4;logger[_0xdef1('0x68')](_0xdef1('0x69'),'getFields',_0x3e4d2f,JSON[_0xdef1('0x6a')](_0x1dc3a1));delete _0x1dc3a1['name'];if(_0x3e4d2f===0x191){_0x3e4d2f=0x190;}_0x129026[_0xdef1('0x19')](_0x3e4d2f)[_0xdef1('0x27')](_0x261feb[_0xdef1('0x2d')][_0xdef1('0x6b')]?{'message':_0xdef1('0x6c'),'statusCode':_0x1dc3a1[_0xdef1('0x67')]}:_0x1dc3a1);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index d70c117..1ee71e5 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 _0x3537=['util','../../config/logger','bluebird','request-promise','path','./intDeskAccount.attributes','exports','define','int_desk_accounts','lodash'];(function(_0x24e8b0,_0x49f825){var _0x4c7b06=function(_0x2322cb){while(--_0x2322cb){_0x24e8b0['push'](_0x24e8b0['shift']());}};_0x4c7b06(++_0x49f825);}(_0x3537,0x1ad));var _0x7353=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0x3537[_0xd0a847];return _0x2536ec;};'use strict';var _=require(_0x7353('0x0'));var util=require(_0x7353('0x1'));var logger=require(_0x7353('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7353('0x3'));var rp=require(_0x7353('0x4'));var fs=require('fs');var path=require(_0x7353('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7353('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x7353('0x7')]=function(_0x2fcd90,_0x2332fc){return _0x2fcd90[_0x7353('0x8')]('DeskAccount',attributes,{'tableName':_0x7353('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0c4=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','int_desk_accounts','lodash','util'];(function(_0x1cd650,_0x4ac134){var _0x193ce7=function(_0x488a3e){while(--_0x488a3e){_0x1cd650['push'](_0x1cd650['shift']());}};_0x193ce7(++_0x4ac134);}(_0xa0c4,0x17e));var _0x4a0c=function(_0x3bdc21,_0x310fb3){_0x3bdc21=_0x3bdc21-0x0;var _0x5143b6=_0xa0c4[_0x3bdc21];return _0x5143b6;};'use strict';var _=require(_0x4a0c('0x0'));var util=require(_0x4a0c('0x1'));var logger=require(_0x4a0c('0x2'))(_0x4a0c('0x3'));var moment=require(_0x4a0c('0x4'));var BPromise=require(_0x4a0c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a0c('0x6'));var rimraf=require(_0x4a0c('0x7'));var config=require(_0x4a0c('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x4a0c('0x9'));module[_0x4a0c('0xa')]=function(_0x2fbf03,_0xe91f34){return _0x2fbf03['define']('DeskAccount',attributes,{'tableName':_0x4a0c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 54eb8eb..4051e93 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 _0x3506=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','map','include','model','ShowDeskAccount','moment'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0x3506,0x1ac));var _0x6350=function(_0x46746b,_0x49f4d3){_0x46746b=_0x46746b-0x0;var _0x2392b5=_0x3506[_0x46746b];return _0x2392b5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6350('0x0'));var BPromise=require(_0x6350('0x1'));var rs=require(_0x6350('0x2'));var fs=require('fs');var Redis=require(_0x6350('0x3'));var db=require(_0x6350('0x4'))['db'];var utils=require(_0x6350('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6350('0x6'));var client=jayson[_0x6350('0x7')][_0x6350('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa4d3a2,_0x576885,_0x4a8046){return new BPromise(function(_0x46731b,_0x42a34d){return client[_0x6350('0x9')](_0xa4d3a2,_0x4a8046)[_0x6350('0xa')](function(_0x184507){logger['info']('DeskAccount,\x20%s,\x20%s',_0x576885,_0x6350('0xb'));logger[_0x6350('0xc')](_0x6350('0xd'),_0x576885,_0x6350('0xb'),JSON[_0x6350('0xe')](_0x184507));if(_0x184507[_0x6350('0xf')]){if(_0x184507[_0x6350('0xf')][_0x6350('0x10')]===0x1f4){logger['error'](_0x6350('0x11'),_0x576885,_0x184507['error'][_0x6350('0x12')]);return _0x42a34d(_0x184507['error'][_0x6350('0x12')]);}logger[_0x6350('0xf')](_0x6350('0x11'),_0x576885,_0x184507[_0x6350('0xf')][_0x6350('0x12')]);return _0x46731b(_0x184507[_0x6350('0xf')]['message']);}else{logger[_0x6350('0x13')](_0x6350('0x11'),_0x576885,_0x6350('0xb'));_0x46731b(_0x184507[_0x6350('0x14')]['message']);}})[_0x6350('0x15')](function(_0x4f137a){logger['error'](_0x6350('0x11'),_0x576885,_0x4f137a);_0x42a34d(_0x4f137a);});});}exports[_0x6350('0x16')]=function(_0x1749f1){var _0x2eac2a=this;return new Promise(function(_0x2e152d,_0x34d5a6){return db[_0x6350('0x17')][_0x6350('0x18')]({'raw':_0x1749f1[_0x6350('0x19')]?_0x1749f1[_0x6350('0x19')][_0x6350('0x1a')]===undefined?!![]:![]:!![],'where':_0x1749f1[_0x6350('0x19')]?_0x1749f1['options'][_0x6350('0x1b')]||null:null,'attributes':_0x1749f1[_0x6350('0x19')]?_0x1749f1['options'][_0x6350('0x1c')]||null:null,'limit':_0x1749f1[_0x6350('0x19')]?_0x1749f1[_0x6350('0x19')]['limit']||null:null,'include':_0x1749f1[_0x6350('0x19')]?_0x1749f1[_0x6350('0x19')]['include']?_[_0x6350('0x1d')](_0x1749f1[_0x6350('0x19')][_0x6350('0x1e')],function(_0x37466e){return{'model':db[_0x37466e['model']],'as':_0x37466e['as'],'attributes':_0x37466e['attributes'],'include':_0x37466e[_0x6350('0x1e')]?_[_0x6350('0x1d')](_0x37466e['include'],function(_0x47f232){return{'model':db[_0x47f232[_0x6350('0x1f')]],'as':_0x47f232['as'],'attributes':_0x47f232[_0x6350('0x1c')],'include':_0x47f232[_0x6350('0x1e')]?_['map'](_0x47f232[_0x6350('0x1e')],function(_0x20ee42){return{'model':db[_0x20ee42[_0x6350('0x1f')]],'as':_0x20ee42['as'],'attributes':_0x20ee42[_0x6350('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6350('0xa')](function(_0x434462){logger[_0x6350('0x13')](_0x6350('0x16'),_0x1749f1);logger['debug'](_0x6350('0x16'),_0x1749f1,JSON[_0x6350('0xe')](_0x434462));_0x2e152d(_0x434462);})[_0x6350('0x15')](function(_0x10c4bc){logger[_0x6350('0xf')](_0x6350('0x16'),_0x10c4bc[_0x6350('0x12')],_0x1749f1);_0x34d5a6(_0x2eac2a[_0x6350('0xf')](0x1f4,_0x10c4bc[_0x6350('0x12')]));});});};exports['ShowDeskAccount']=function(_0x3cc36f){var _0x584b28=this;return new Promise(function(_0x334173,_0x2fce7a){return db['DeskAccount']['find']({'raw':_0x3cc36f[_0x6350('0x19')]?_0x3cc36f[_0x6350('0x19')][_0x6350('0x1a')]===undefined?!![]:![]:!![],'where':_0x3cc36f[_0x6350('0x19')]?_0x3cc36f['options'][_0x6350('0x1b')]||null:null,'attributes':_0x3cc36f[_0x6350('0x19')]?_0x3cc36f[_0x6350('0x19')]['attributes']||null:null,'include':_0x3cc36f[_0x6350('0x19')]?_0x3cc36f[_0x6350('0x19')]['include']?_['map'](_0x3cc36f['options'][_0x6350('0x1e')],function(_0x11383){return{'model':db[_0x11383[_0x6350('0x1f')]],'as':_0x11383['as'],'attributes':_0x11383[_0x6350('0x1c')],'include':_0x11383['include']?_[_0x6350('0x1d')](_0x11383[_0x6350('0x1e')],function(_0x409ad9){return{'model':db[_0x409ad9[_0x6350('0x1f')]],'as':_0x409ad9['as'],'attributes':_0x409ad9[_0x6350('0x1c')],'include':_0x409ad9[_0x6350('0x1e')]?_[_0x6350('0x1d')](_0x409ad9[_0x6350('0x1e')],function(_0x4f0efd){return{'model':db[_0x4f0efd['model']],'as':_0x4f0efd['as'],'attributes':_0x4f0efd[_0x6350('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6350('0xa')](function(_0x39c908){logger[_0x6350('0x13')](_0x6350('0x20'),_0x3cc36f);logger[_0x6350('0xc')](_0x6350('0x20'),_0x3cc36f,JSON['stringify'](_0x39c908));_0x334173(_0x39c908);})[_0x6350('0x15')](function(_0x28516b){logger[_0x6350('0xf')](_0x6350('0x20'),_0x28516b[_0x6350('0x12')],_0x3cc36f);_0x2fce7a(_0x584b28[_0x6350('0xf')](0x1f4,_0x28516b[_0x6350('0x12')]));});});}; \ No newline at end of file +var _0xbdcc=['debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','DeskAccount,\x20%s,\x20%s','message','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','where','attributes','limit','include','map','model','ShowDeskAccount','find','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','request\x20sent'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0xbdcc,0x7c));var _0xcbdc=function(_0x39dbff,_0xfa190b){_0x39dbff=_0x39dbff-0x0;var _0x293498=_0xbdcc[_0x39dbff];return _0x293498;};'use strict';var _=require(_0xcbdc('0x0'));var util=require(_0xcbdc('0x1'));var moment=require(_0xcbdc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbdc('0x3'));var db=require(_0xcbdc('0x4'))['db'];var utils=require(_0xcbdc('0x5'));var logger=require(_0xcbdc('0x6'))(_0xcbdc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xcbdc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ad46d,_0x45d686,_0x17c4f5){return new BPromise(function(_0x4cfc93,_0x4ab0b7){return client[_0xcbdc('0x9')](_0x3ad46d,_0x17c4f5)[_0xcbdc('0xa')](function(_0x15a402){logger['info']('DeskAccount,\x20%s,\x20%s',_0x45d686,_0xcbdc('0xb'));logger[_0xcbdc('0xc')](_0xcbdc('0xd'),_0x45d686,_0xcbdc('0xb'),JSON[_0xcbdc('0xe')](_0x15a402));if(_0x15a402['error']){if(_0x15a402[_0xcbdc('0xf')]['code']===0x1f4){logger['error'](_0xcbdc('0x10'),_0x45d686,_0x15a402[_0xcbdc('0xf')][_0xcbdc('0x11')]);return _0x4ab0b7(_0x15a402[_0xcbdc('0xf')]['message']);}logger['error'](_0xcbdc('0x10'),_0x45d686,_0x15a402['error'][_0xcbdc('0x11')]);return _0x4cfc93(_0x15a402['error']['message']);}else{logger[_0xcbdc('0x12')]('DeskAccount,\x20%s,\x20%s',_0x45d686,_0xcbdc('0xb'));_0x4cfc93(_0x15a402[_0xcbdc('0x13')][_0xcbdc('0x11')]);}})[_0xcbdc('0x14')](function(_0x1babbc){logger[_0xcbdc('0xf')]('DeskAccount,\x20%s,\x20%s',_0x45d686,_0x1babbc);_0x4ab0b7(_0x1babbc);});});}exports[_0xcbdc('0x15')]=function(_0x5ba312){var _0x35b5ee=this;return new Promise(function(_0x44be0b,_0x5e81ab){return db[_0xcbdc('0x16')][_0xcbdc('0x17')]({'raw':_0x5ba312[_0xcbdc('0x18')]?_0x5ba312[_0xcbdc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5ba312[_0xcbdc('0x18')]?_0x5ba312[_0xcbdc('0x18')][_0xcbdc('0x19')]||null:null,'attributes':_0x5ba312[_0xcbdc('0x18')]?_0x5ba312[_0xcbdc('0x18')][_0xcbdc('0x1a')]||null:null,'limit':_0x5ba312[_0xcbdc('0x18')]?_0x5ba312[_0xcbdc('0x18')][_0xcbdc('0x1b')]||null:null,'include':_0x5ba312[_0xcbdc('0x18')]?_0x5ba312[_0xcbdc('0x18')][_0xcbdc('0x1c')]?_[_0xcbdc('0x1d')](_0x5ba312[_0xcbdc('0x18')][_0xcbdc('0x1c')],function(_0x1e66c7){return{'model':db[_0x1e66c7[_0xcbdc('0x1e')]],'as':_0x1e66c7['as'],'attributes':_0x1e66c7[_0xcbdc('0x1a')],'include':_0x1e66c7['include']?_[_0xcbdc('0x1d')](_0x1e66c7[_0xcbdc('0x1c')],function(_0xfdf992){return{'model':db[_0xfdf992[_0xcbdc('0x1e')]],'as':_0xfdf992['as'],'attributes':_0xfdf992['attributes'],'include':_0xfdf992['include']?_[_0xcbdc('0x1d')](_0xfdf992[_0xcbdc('0x1c')],function(_0x5c65c3){return{'model':db[_0x5c65c3[_0xcbdc('0x1e')]],'as':_0x5c65c3['as'],'attributes':_0x5c65c3[_0xcbdc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xcbdc('0xa')](function(_0x53174c){logger[_0xcbdc('0x12')]('GetDeskAccount',_0x5ba312);logger[_0xcbdc('0xc')](_0xcbdc('0x15'),_0x5ba312,JSON[_0xcbdc('0xe')](_0x53174c));_0x44be0b(_0x53174c);})['catch'](function(_0x127494){logger[_0xcbdc('0xf')]('GetDeskAccount',_0x127494[_0xcbdc('0x11')],_0x5ba312);_0x5e81ab(_0x35b5ee[_0xcbdc('0xf')](0x1f4,_0x127494[_0xcbdc('0x11')]));});});};exports[_0xcbdc('0x1f')]=function(_0x4be07c){var _0x39aa67=this;return new Promise(function(_0x86b928,_0x3a6bec){return db[_0xcbdc('0x16')][_0xcbdc('0x20')]({'raw':_0x4be07c['options']?_0x4be07c[_0xcbdc('0x18')][_0xcbdc('0x21')]===undefined?!![]:![]:!![],'where':_0x4be07c['options']?_0x4be07c['options'][_0xcbdc('0x19')]||null:null,'attributes':_0x4be07c[_0xcbdc('0x18')]?_0x4be07c[_0xcbdc('0x18')][_0xcbdc('0x1a')]||null:null,'include':_0x4be07c[_0xcbdc('0x18')]?_0x4be07c[_0xcbdc('0x18')]['include']?_[_0xcbdc('0x1d')](_0x4be07c['options'][_0xcbdc('0x1c')],function(_0x4a0089){return{'model':db[_0x4a0089[_0xcbdc('0x1e')]],'as':_0x4a0089['as'],'attributes':_0x4a0089['attributes'],'include':_0x4a0089[_0xcbdc('0x1c')]?_['map'](_0x4a0089[_0xcbdc('0x1c')],function(_0x38469f){return{'model':db[_0x38469f[_0xcbdc('0x1e')]],'as':_0x38469f['as'],'attributes':_0x38469f['attributes'],'include':_0x38469f[_0xcbdc('0x1c')]?_[_0xcbdc('0x1d')](_0x38469f[_0xcbdc('0x1c')],function(_0x3eb890){return{'model':db[_0x3eb890[_0xcbdc('0x1e')]],'as':_0x3eb890['as'],'attributes':_0x3eb890['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f8e2e){logger['info'](_0xcbdc('0x1f'),_0x4be07c);logger[_0xcbdc('0xc')](_0xcbdc('0x1f'),_0x4be07c,JSON['stringify'](_0x1f8e2e));_0x86b928(_0x1f8e2e);})[_0xcbdc('0x14')](function(_0x1911fc){logger[_0xcbdc('0xf')](_0xcbdc('0x1f'),_0x1911fc[_0xcbdc('0x11')],_0x4be07c);_0x3a6bec(_0x39aa67[_0xcbdc('0xf')](0x1f4,_0x1911fc[_0xcbdc('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 033f550..7b90d3d 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x266b90,_0x463ddc){var _0x5b1aa6=function(_0x1f05db){while(--_0x1f05db){_0x266b90['push'](_0x266b90['shift']());}};_0x5b1aa6(++_0x463ddc);}(_0xedd9,0xfc));var _0x9edd=function(_0x3a1a85,_0x1aecbc){_0x3a1a85=_0x3a1a85-0x0;var _0xb1e7ab=_0xedd9[_0x3a1a85];return _0xb1e7ab;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x156cdc,_0x2834e7){var _0x3344ee=function(_0xae519a){while(--_0xae519a){_0x156cdc['push'](_0x156cdc['shift']());}};_0x3344ee(++_0x2834e7);}(_0x008c,0x188));var _0xc008=function(_0x549443,_0x2e04c8){_0x549443=_0x549443-0x0;var _0x372ed3=_0x008c[_0x549443];return _0x372ed3;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index ada67ba..30d6bdc 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 _0x1e31=['sequelize','exports','STRING'];(function(_0x486e6f,_0x395450){var _0x104212=function(_0x368754){while(--_0x368754){_0x486e6f['push'](_0x486e6f['shift']());}};_0x104212(++_0x395450);}(_0x1e31,0x19e));var _0x11e3=function(_0x1e2178,_0x221ab4){_0x1e2178=_0x1e2178-0x0;var _0x46af62=_0x1e31[_0x1e2178];return _0x46af62;};'use strict';var Sequelize=require(_0x11e3('0x0'));module[_0x11e3('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x11e3('0x2')]}}; \ No newline at end of file +var _0xefe7=['STRING','exports'];(function(_0x44985d,_0xafc7e8){var _0x38e607=function(_0x8afd57){while(--_0x8afd57){_0x44985d['push'](_0x44985d['shift']());}};_0x38e607(++_0xafc7e8);}(_0xefe7,0xeb));var _0x7efe=function(_0x5b0579,_0x2c40ca){_0x5b0579=_0x5b0579-0x0;var _0x3b1a9b=_0xefe7[_0x5b0579];return _0x3b1a9b;};'use strict';var Sequelize=require('sequelize');module[_0x7efe('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7efe('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 2623670..69b45f7 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 _0x1cf1=['order','nolimit','getFields','getSubjects','findOne','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','findAll','rows','catch','show','intersection','includeAll','include','options','find','create','body','params','DeskField'];(function(_0x278ea3,_0x17aa05){var _0x458721=function(_0x5f235c){while(--_0x5f235c){_0x278ea3['push'](_0x278ea3['shift']());}};_0x458721(++_0x17aa05);}(_0x1cf1,0xb7));var _0x11cf=function(_0x254c78,_0x3c20ff){_0x254c78=_0x254c78-0x0;var _0x32a661=_0x1cf1[_0x254c78];return _0x32a661;};'use strict';var emlformat=require(_0x11cf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x11cf('0x1'));var jsonpatch=require(_0x11cf('0x2'));var rp=require('request-promise');var moment=require(_0x11cf('0x3'));var BPromise=require(_0x11cf('0x4'));var Mustache=require(_0x11cf('0x5'));var util=require(_0x11cf('0x6'));var path=require('path');var sox=require(_0x11cf('0x7'));var csv=require(_0x11cf('0x8'));var ejs=require(_0x11cf('0x9'));var fs=require('fs');var fs_extra=require(_0x11cf('0xa'));var _=require(_0x11cf('0xb'));var squel=require(_0x11cf('0xc'));var crypto=require(_0x11cf('0xd'));var jsforce=require(_0x11cf('0xe'));var deskjs=require(_0x11cf('0xf'));var toCsv=require(_0x11cf('0x8'));var querystring=require(_0x11cf('0x10'));var Papa=require(_0x11cf('0x11'));var Redis=require(_0x11cf('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x11cf('0x13'));var as=require(_0x11cf('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x11cf('0x15'))(_0x11cf('0x16'));var utils=require(_0x11cf('0x17'));var config=require(_0x11cf('0x18'));var licenseUtil=require(_0x11cf('0x19'));var db=require(_0x11cf('0x1a'))['db'];function respondWithStatusCode(_0x521e64,_0x29edf3){_0x29edf3=_0x29edf3||0xcc;return function(_0x1f54d9){if(_0x1f54d9){return _0x521e64[_0x11cf('0x1b')](_0x29edf3);}return _0x521e64['status'](_0x29edf3)['end']();};}function respondWithResult(_0x4b68cb,_0x2bdad0){_0x2bdad0=_0x2bdad0||0xc8;return function(_0x3f3c06){if(_0x3f3c06){return _0x4b68cb[_0x11cf('0x1c')](_0x2bdad0)[_0x11cf('0x1d')](_0x3f3c06);}};}function respondWithFilteredResult(_0x4f632a,_0x2528eb){return function(_0xcaad26){if(_0xcaad26){var _0x30439b=typeof _0x2528eb['offset']==='undefined'&&typeof _0x2528eb[_0x11cf('0x1e')]===_0x11cf('0x1f');var _0x417c1e=_0xcaad26[_0x11cf('0x20')];var _0x130042=_0x30439b?0x0:_0x2528eb[_0x11cf('0x21')];var _0x22759b=_0x30439b?_0xcaad26[_0x11cf('0x20')]:_0x2528eb[_0x11cf('0x21')]+_0x2528eb[_0x11cf('0x1e')];var _0x29e144;if(_0x22759b>=_0x417c1e){_0x22759b=_0x417c1e;_0x29e144=0xc8;}else{_0x29e144=0xce;}_0x4f632a['status'](_0x29e144);return _0x4f632a['set'](_0x11cf('0x22'),_0x130042+'-'+_0x22759b+'/'+_0x417c1e)[_0x11cf('0x1d')](_0xcaad26);}return null;};}function patchUpdates(_0x4e81dd){return function(_0x925134){try{jsonpatch[_0x11cf('0x23')](_0x925134,_0x4e81dd,!![]);}catch(_0x21bd59){return BPromise[_0x11cf('0x24')](_0x21bd59);}return _0x925134[_0x11cf('0x25')]();};}function saveUpdates(_0x54f0b9,_0x52dd0c){return function(_0x26edb5){if(_0x26edb5){return _0x26edb5[_0x11cf('0x26')](_0x54f0b9)[_0x11cf('0x27')](function(_0x4131ec){return _0x4131ec;});}return null;};}function removeEntity(_0x3c2812,_0x9cd6e4){return function(_0x44d4af){if(_0x44d4af){return _0x44d4af[_0x11cf('0x28')]()[_0x11cf('0x27')](function(){_0x3c2812[_0x11cf('0x1c')](0xcc)[_0x11cf('0x29')]();});}};}function handleEntityNotFound(_0x100793,_0x4f8dfc){return function(_0x4c5d96){if(!_0x4c5d96){_0x100793[_0x11cf('0x1b')](0x194);}return _0x4c5d96;};}function handleError(_0x3b6e17,_0x4b230f){_0x4b230f=_0x4b230f||0x1f4;return function(_0x59b3fb){logger[_0x11cf('0x2a')](_0x59b3fb['stack']);if(_0x59b3fb[_0x11cf('0x2b')]){delete _0x59b3fb[_0x11cf('0x2b')];}_0x3b6e17[_0x11cf('0x1c')](_0x4b230f)[_0x11cf('0x2c')](_0x59b3fb);};}exports[_0x11cf('0x2d')]=function(_0x31c245,_0x15ffc0){var _0x3d40c9={},_0x28834f={},_0x5d0c03={'count':0x0,'rows':[]};var _0x22b755=_[_0x11cf('0x2e')](db[_0x11cf('0x2f')][_0x11cf('0x30')],function(_0x10b20f){return{'name':_0x10b20f[_0x11cf('0x31')],'type':_0x10b20f[_0x11cf('0x32')][_0x11cf('0x33')]};});_0x28834f[_0x11cf('0x34')]=_[_0x11cf('0x2e')](_0x22b755,'name');_0x28834f[_0x11cf('0x35')]=_[_0x11cf('0x36')](_0x31c245[_0x11cf('0x35')]);_0x28834f['filters']=_['intersection'](_0x28834f['model'],_0x28834f['query']);_0x3d40c9[_0x11cf('0x37')]=_['intersection'](_0x28834f[_0x11cf('0x34')],qs[_0x11cf('0x38')](_0x31c245['query'][_0x11cf('0x38')]));_0x3d40c9['attributes']=_0x3d40c9[_0x11cf('0x37')][_0x11cf('0x39')]?_0x3d40c9['attributes']:_0x28834f[_0x11cf('0x34')];if(!_0x31c245[_0x11cf('0x35')][_0x11cf('0x3a')]('nolimit')){_0x3d40c9['limit']=qs['limit'](_0x31c245[_0x11cf('0x35')]['limit']);_0x3d40c9[_0x11cf('0x21')]=qs['offset'](_0x31c245[_0x11cf('0x35')][_0x11cf('0x21')]);}_0x3d40c9['order']=qs[_0x11cf('0x3b')](_0x31c245[_0x11cf('0x35')][_0x11cf('0x3b')]);_0x3d40c9[_0x11cf('0x3c')]=qs[_0x11cf('0x3d')](_[_0x11cf('0x3e')](_0x31c245[_0x11cf('0x35')],_0x28834f[_0x11cf('0x3d')]),_0x22b755);if(_0x31c245[_0x11cf('0x35')][_0x11cf('0x3f')]){_0x3d40c9[_0x11cf('0x3c')]=_[_0x11cf('0x40')](_0x3d40c9[_0x11cf('0x3c')],{'$or':_['map'](_0x22b755,function(_0x1e51ee){if(_0x1e51ee[_0x11cf('0x32')]!=='VIRTUAL'){var _0x3a31e3={};_0x3a31e3[_0x1e51ee['name']]={'$like':'%'+_0x31c245[_0x11cf('0x35')]['filter']+'%'};return _0x3a31e3;}})});}_0x3d40c9=_[_0x11cf('0x40')]({},_0x3d40c9,_0x31c245['options']);var _0x54fc04={'where':_0x3d40c9['where']};return db[_0x11cf('0x2f')][_0x11cf('0x20')](_0x54fc04)[_0x11cf('0x27')](function(_0x78246){_0x5d0c03[_0x11cf('0x20')]=_0x78246;if(_0x31c245[_0x11cf('0x35')]['includeAll']){_0x3d40c9['include']=[{'all':!![]}];}return db[_0x11cf('0x2f')][_0x11cf('0x41')](_0x3d40c9);})['then'](function(_0x1db5bb){_0x5d0c03[_0x11cf('0x42')]=_0x1db5bb;return _0x5d0c03;})[_0x11cf('0x27')](respondWithFilteredResult(_0x15ffc0,_0x3d40c9))[_0x11cf('0x43')](handleError(_0x15ffc0,null));};exports[_0x11cf('0x44')]=function(_0x5c6fe7,_0x461bdd){var _0x14d40d={'raw':![],'where':{'id':_0x5c6fe7['params']['id']}},_0x25ff0e={};_0x25ff0e[_0x11cf('0x34')]=_[_0x11cf('0x36')](db[_0x11cf('0x2f')][_0x11cf('0x30')]);_0x25ff0e[_0x11cf('0x35')]=_[_0x11cf('0x36')](_0x5c6fe7['query']);_0x25ff0e[_0x11cf('0x3d')]=_[_0x11cf('0x45')](_0x25ff0e[_0x11cf('0x34')],_0x25ff0e[_0x11cf('0x35')]);_0x14d40d[_0x11cf('0x37')]=_['intersection'](_0x25ff0e[_0x11cf('0x34')],qs[_0x11cf('0x38')](_0x5c6fe7[_0x11cf('0x35')][_0x11cf('0x38')]));_0x14d40d[_0x11cf('0x37')]=_0x14d40d[_0x11cf('0x37')]['length']?_0x14d40d[_0x11cf('0x37')]:_0x25ff0e[_0x11cf('0x34')];if(_0x5c6fe7[_0x11cf('0x35')][_0x11cf('0x46')]){_0x14d40d[_0x11cf('0x47')]=[{'all':!![]}];}_0x14d40d=_[_0x11cf('0x40')]({},_0x14d40d,_0x5c6fe7[_0x11cf('0x48')]);return db[_0x11cf('0x2f')][_0x11cf('0x49')](_0x14d40d)[_0x11cf('0x27')](handleEntityNotFound(_0x461bdd,null))[_0x11cf('0x27')](respondWithResult(_0x461bdd,null))['catch'](handleError(_0x461bdd,null));};exports[_0x11cf('0x4a')]=function(_0x68a5fb,_0x480e2a){return db['DeskConfiguration'][_0x11cf('0x4a')](_0x68a5fb[_0x11cf('0x4b')],{})[_0x11cf('0x27')](respondWithResult(_0x480e2a,0xc9))['catch'](handleError(_0x480e2a,null));};exports[_0x11cf('0x26')]=function(_0x4a452a,_0xdfd515){if(_0x4a452a[_0x11cf('0x4b')]['id']){delete _0x4a452a['body']['id'];}return db[_0x11cf('0x2f')][_0x11cf('0x49')]({'where':{'id':_0x4a452a['params']['id']}})['then'](handleEntityNotFound(_0xdfd515,null))[_0x11cf('0x27')](saveUpdates(_0x4a452a[_0x11cf('0x4b')],null))[_0x11cf('0x27')](respondWithResult(_0xdfd515,null))[_0x11cf('0x43')](handleError(_0xdfd515,null));};exports[_0x11cf('0x28')]=function(_0x58e4b6,_0x327cc8){return db[_0x11cf('0x2f')]['find']({'where':{'id':_0x58e4b6[_0x11cf('0x4c')]['id']}})[_0x11cf('0x27')](handleEntityNotFound(_0x327cc8,null))['then'](removeEntity(_0x327cc8,null))[_0x11cf('0x43')](handleError(_0x327cc8,null));};exports['getFields']=function(_0xe57aa5,_0x5ae6f,_0x223b6b){var _0x34caed={};var _0x313101={};var _0x1912f2;var _0x10f806;return db[_0x11cf('0x2f')]['findOne']({'where':{'id':_0xe57aa5[_0x11cf('0x4c')]['id']}})[_0x11cf('0x27')](handleEntityNotFound(_0x5ae6f,null))[_0x11cf('0x27')](function(_0x50da46){if(_0x50da46){_0x1912f2=_0x50da46;_0x313101[_0x11cf('0x34')]=_[_0x11cf('0x36')](db[_0x11cf('0x4d')][_0x11cf('0x30')]);_0x313101[_0x11cf('0x35')]=_[_0x11cf('0x36')](_0xe57aa5[_0x11cf('0x35')]);_0x313101['filters']=_[_0x11cf('0x45')](_0x313101[_0x11cf('0x34')],_0x313101[_0x11cf('0x35')]);_0x34caed[_0x11cf('0x37')]=_[_0x11cf('0x45')](_0x313101[_0x11cf('0x34')],qs['fields'](_0xe57aa5[_0x11cf('0x35')]['fields']));_0x34caed['attributes']=_0x34caed[_0x11cf('0x37')][_0x11cf('0x39')]?_0x34caed[_0x11cf('0x37')]:_0x313101[_0x11cf('0x34')];_0x34caed[_0x11cf('0x4e')]=qs[_0x11cf('0x3b')](_0xe57aa5[_0x11cf('0x35')][_0x11cf('0x3b')]);_0x34caed[_0x11cf('0x3c')]=qs[_0x11cf('0x3d')](_[_0x11cf('0x3e')](_0xe57aa5['query'],_0x313101['filters']));if(_0xe57aa5['query'][_0x11cf('0x3f')]){_0x34caed['where']=_[_0x11cf('0x40')](_0x34caed[_0x11cf('0x3c')],{'$or':_[_0x11cf('0x2e')](_0x34caed[_0x11cf('0x37')],function(_0x2b5d89){var _0x368bf0={};_0x368bf0[_0x2b5d89]={'$like':'%'+_0xe57aa5[_0x11cf('0x35')][_0x11cf('0x3f')]+'%'};return _0x368bf0;})});}_0x34caed=_[_0x11cf('0x40')]({},_0x34caed,_0xe57aa5[_0x11cf('0x48')]);return _0x1912f2['getFields'](_0x34caed);}})[_0x11cf('0x27')](function(_0x170339){if(_0x170339){_0x10f806=_0x170339[_0x11cf('0x39')];if(!_0xe57aa5['query'][_0x11cf('0x3a')](_0x11cf('0x4f'))){_0x34caed[_0x11cf('0x1e')]=qs[_0x11cf('0x1e')](_0xe57aa5[_0x11cf('0x35')][_0x11cf('0x1e')]);_0x34caed[_0x11cf('0x21')]=qs[_0x11cf('0x21')](_0xe57aa5[_0x11cf('0x35')]['offset']);}return _0x1912f2[_0x11cf('0x50')](_0x34caed);}})[_0x11cf('0x27')](function(_0x28ff6c){if(_0x28ff6c){return _0x28ff6c?{'count':_0x10f806,'rows':_0x28ff6c}:null;}})[_0x11cf('0x27')](respondWithResult(_0x5ae6f,null))[_0x11cf('0x43')](handleError(_0x5ae6f,null));};exports[_0x11cf('0x51')]=function(_0x20cede,_0x415577,_0x44c1cd){var _0x136d31={};var _0x57a2e3={};var _0xe5abaf;var _0x42efe9;return db[_0x11cf('0x2f')][_0x11cf('0x52')]({'where':{'id':_0x20cede[_0x11cf('0x4c')]['id']}})[_0x11cf('0x27')](handleEntityNotFound(_0x415577,null))[_0x11cf('0x27')](function(_0x23f125){if(_0x23f125){_0xe5abaf=_0x23f125;_0x57a2e3[_0x11cf('0x34')]=_[_0x11cf('0x36')](db[_0x11cf('0x4d')][_0x11cf('0x30')]);_0x57a2e3[_0x11cf('0x35')]=_[_0x11cf('0x36')](_0x20cede[_0x11cf('0x35')]);_0x57a2e3[_0x11cf('0x3d')]=_['intersection'](_0x57a2e3[_0x11cf('0x34')],_0x57a2e3[_0x11cf('0x35')]);_0x136d31[_0x11cf('0x37')]=_['intersection'](_0x57a2e3[_0x11cf('0x34')],qs[_0x11cf('0x38')](_0x20cede['query']['fields']));_0x136d31[_0x11cf('0x37')]=_0x136d31[_0x11cf('0x37')]['length']?_0x136d31[_0x11cf('0x37')]:_0x57a2e3[_0x11cf('0x34')];_0x136d31[_0x11cf('0x4e')]=qs[_0x11cf('0x3b')](_0x20cede['query'][_0x11cf('0x3b')]);_0x136d31[_0x11cf('0x3c')]=qs[_0x11cf('0x3d')](_[_0x11cf('0x3e')](_0x20cede[_0x11cf('0x35')],_0x57a2e3[_0x11cf('0x3d')]));if(_0x20cede[_0x11cf('0x35')][_0x11cf('0x3f')]){_0x136d31[_0x11cf('0x3c')]=_[_0x11cf('0x40')](_0x136d31[_0x11cf('0x3c')],{'$or':_['map'](_0x136d31[_0x11cf('0x37')],function(_0x4c60a7){var _0x372297={};_0x372297[_0x4c60a7]={'$like':'%'+_0x20cede[_0x11cf('0x35')]['filter']+'%'};return _0x372297;})});}_0x136d31=_[_0x11cf('0x40')]({},_0x136d31,_0x20cede[_0x11cf('0x48')]);return _0xe5abaf[_0x11cf('0x51')](_0x136d31);}})[_0x11cf('0x27')](function(_0x646ea1){if(_0x646ea1){_0x42efe9=_0x646ea1[_0x11cf('0x39')];if(!_0x20cede[_0x11cf('0x35')][_0x11cf('0x3a')]('nolimit')){_0x136d31[_0x11cf('0x1e')]=qs[_0x11cf('0x1e')](_0x20cede['query'][_0x11cf('0x1e')]);_0x136d31[_0x11cf('0x21')]=qs['offset'](_0x20cede['query'][_0x11cf('0x21')]);}return _0xe5abaf[_0x11cf('0x51')](_0x136d31);}})[_0x11cf('0x27')](function(_0x818536){if(_0x818536){return _0x818536?{'count':_0x42efe9,'rows':_0x818536}:null;}})[_0x11cf('0x27')](respondWithResult(_0x415577,null))[_0x11cf('0x43')](handleError(_0x415577,null));};exports[_0x11cf('0x53')]=function(_0x5cef05,_0x173b41,_0x4e5e55){var _0x11a138={};var _0x4a6f8f={};var _0x2bc130;var _0x15bd3c;return db[_0x11cf('0x2f')][_0x11cf('0x52')]({'where':{'id':_0x5cef05[_0x11cf('0x4c')]['id']}})[_0x11cf('0x27')](handleEntityNotFound(_0x173b41,null))['then'](function(_0x2fa529){if(_0x2fa529){_0x2bc130=_0x2fa529;_0x4a6f8f['model']=_[_0x11cf('0x36')](db['DeskField'][_0x11cf('0x30')]);_0x4a6f8f[_0x11cf('0x35')]=_[_0x11cf('0x36')](_0x5cef05['query']);_0x4a6f8f[_0x11cf('0x3d')]=_[_0x11cf('0x45')](_0x4a6f8f[_0x11cf('0x34')],_0x4a6f8f['query']);_0x11a138['attributes']=_[_0x11cf('0x45')](_0x4a6f8f['model'],qs[_0x11cf('0x38')](_0x5cef05['query']['fields']));_0x11a138[_0x11cf('0x37')]=_0x11a138[_0x11cf('0x37')][_0x11cf('0x39')]?_0x11a138['attributes']:_0x4a6f8f[_0x11cf('0x34')];_0x11a138[_0x11cf('0x4e')]=qs['sort'](_0x5cef05[_0x11cf('0x35')]['sort']);_0x11a138[_0x11cf('0x3c')]=qs[_0x11cf('0x3d')](_[_0x11cf('0x3e')](_0x5cef05[_0x11cf('0x35')],_0x4a6f8f[_0x11cf('0x3d')]));if(_0x5cef05[_0x11cf('0x35')][_0x11cf('0x3f')]){_0x11a138[_0x11cf('0x3c')]=_[_0x11cf('0x40')](_0x11a138[_0x11cf('0x3c')],{'$or':_['map'](_0x11a138[_0x11cf('0x37')],function(_0x187ff0){var _0x2de360={};_0x2de360[_0x187ff0]={'$like':'%'+_0x5cef05[_0x11cf('0x35')][_0x11cf('0x3f')]+'%'};return _0x2de360;})});}_0x11a138=_[_0x11cf('0x40')]({},_0x11a138,_0x5cef05[_0x11cf('0x48')]);return _0x2bc130[_0x11cf('0x53')](_0x11a138);}})['then'](function(_0xab3207){if(_0xab3207){_0x15bd3c=_0xab3207[_0x11cf('0x39')];if(!_0x5cef05[_0x11cf('0x35')][_0x11cf('0x3a')]('nolimit')){_0x11a138['limit']=qs['limit'](_0x5cef05[_0x11cf('0x35')]['limit']);_0x11a138[_0x11cf('0x21')]=qs['offset'](_0x5cef05[_0x11cf('0x35')]['offset']);}return _0x2bc130[_0x11cf('0x53')](_0x11a138);}})[_0x11cf('0x27')](function(_0x2bcf48){if(_0x2bcf48){return _0x2bcf48?{'count':_0x15bd3c,'rows':_0x2bcf48}:null;}})['then'](respondWithResult(_0x173b41,null))[_0x11cf('0x43')](handleError(_0x173b41,null));};exports[_0x11cf('0x54')]=function(_0x227208,_0x34d940,_0x5a8974){var _0xf274d2={};var _0x5b167b={};var _0x3cbfc3;var _0x4b5d93;return db[_0x11cf('0x2f')][_0x11cf('0x52')]({'where':{'id':_0x227208[_0x11cf('0x4c')]['id']}})['then'](handleEntityNotFound(_0x34d940,null))[_0x11cf('0x27')](function(_0x3c634e){if(_0x3c634e){_0x3cbfc3=_0x3c634e;_0x5b167b['model']=_[_0x11cf('0x36')](db['Tag'][_0x11cf('0x30')]);_0x5b167b[_0x11cf('0x35')]=_[_0x11cf('0x36')](_0x227208[_0x11cf('0x35')]);_0x5b167b[_0x11cf('0x3d')]=_['intersection'](_0x5b167b[_0x11cf('0x34')],_0x5b167b[_0x11cf('0x35')]);_0xf274d2[_0x11cf('0x37')]=_['intersection'](_0x5b167b['model'],qs[_0x11cf('0x38')](_0x227208[_0x11cf('0x35')]['fields']));_0xf274d2[_0x11cf('0x37')]=_0xf274d2['attributes'][_0x11cf('0x39')]?_0xf274d2[_0x11cf('0x37')]:_0x5b167b['model'];_0xf274d2[_0x11cf('0x4e')]=qs[_0x11cf('0x3b')](_0x227208[_0x11cf('0x35')]['sort']);_0xf274d2[_0x11cf('0x3c')]=qs['filters'](_[_0x11cf('0x3e')](_0x227208[_0x11cf('0x35')],_0x5b167b[_0x11cf('0x3d')]));if(_0x227208['query'][_0x11cf('0x3f')]){_0xf274d2[_0x11cf('0x3c')]=_['merge'](_0xf274d2[_0x11cf('0x3c')],{'$or':_[_0x11cf('0x2e')](_0xf274d2[_0x11cf('0x37')],function(_0x2c177a){var _0x3fa949={};_0x3fa949[_0x2c177a]={'$like':'%'+_0x227208[_0x11cf('0x35')]['filter']+'%'};return _0x3fa949;})});}_0xf274d2=_[_0x11cf('0x40')]({},_0xf274d2,_0x227208['options']);return _0x3cbfc3[_0x11cf('0x54')](_0xf274d2);}})['then'](function(_0x535b4a){if(_0x535b4a){_0x4b5d93=_0x535b4a[_0x11cf('0x39')];if(!_0x227208[_0x11cf('0x35')][_0x11cf('0x3a')]('nolimit')){_0xf274d2[_0x11cf('0x1e')]=qs['limit'](_0x227208['query'][_0x11cf('0x1e')]);_0xf274d2[_0x11cf('0x21')]=qs[_0x11cf('0x21')](_0x227208[_0x11cf('0x35')][_0x11cf('0x21')]);}return _0x3cbfc3[_0x11cf('0x54')](_0xf274d2);}})[_0x11cf('0x27')](function(_0x193521){if(_0x193521){return _0x193521?{'count':_0x4b5d93,'rows':_0x193521}:null;}})['then'](respondWithResult(_0x34d940,null))[_0x11cf('0x43')](handleError(_0x34d940,null));};exports[_0x11cf('0x55')]=function(_0x593400,_0x38d9ae,_0x2e9107){if(_0x593400[_0x11cf('0x4b')]['id']){delete _0x593400[_0x11cf('0x4b')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x593400[_0x11cf('0x4c')]['id']}})[_0x11cf('0x27')](handleEntityNotFound(_0x38d9ae,null))[_0x11cf('0x27')](function(_0x2c1dfb){if(_0x2c1dfb){return _0x2c1dfb[_0x11cf('0x55')](_0x593400[_0x11cf('0x4b')][_0x11cf('0x56')]||[]);}return null;})['then'](respondWithResult(_0x38d9ae,null))[_0x11cf('0x43')](handleError(_0x38d9ae,null));}; \ No newline at end of file +var _0xbdad=['order','sort','where','pick','filters','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','merge','find','create','body','destroy','getFields','findOne','getSubjects','DeskField','getDescriptions','getTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','then','name','send','index','map','DeskConfiguration','rawAttributes','type','key','query','keys','intersection','attributes','model','length','hasOwnProperty','nolimit'];(function(_0x46fc28,_0x4746fb){var _0x5888fe=function(_0x3cec18){while(--_0x3cec18){_0x46fc28['push'](_0x46fc28['shift']());}};_0x5888fe(++_0x4746fb);}(_0xbdad,0xc0));var _0xdbda=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xbdad[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xdbda('0x0'));var rimraf=require(_0xdbda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdbda('0x2'));var rp=require(_0xdbda('0x3'));var moment=require(_0xdbda('0x4'));var BPromise=require(_0xdbda('0x5'));var Mustache=require(_0xdbda('0x6'));var util=require(_0xdbda('0x7'));var path=require('path');var sox=require(_0xdbda('0x8'));var csv=require(_0xdbda('0x9'));var ejs=require(_0xdbda('0xa'));var fs=require('fs');var fs_extra=require(_0xdbda('0xb'));var _=require(_0xdbda('0xc'));var squel=require(_0xdbda('0xd'));var crypto=require(_0xdbda('0xe'));var jsforce=require(_0xdbda('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdbda('0x9'));var querystring=require('querystring');var Papa=require(_0xdbda('0x10'));var Redis=require(_0xdbda('0x11'));var authService=require(_0xdbda('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdbda('0x13'));var logger=require(_0xdbda('0x14'))(_0xdbda('0x15'));var utils=require(_0xdbda('0x16'));var config=require(_0xdbda('0x17'));var licenseUtil=require(_0xdbda('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16303f,_0x37894f){_0x37894f=_0x37894f||0xcc;return function(_0x434c43){if(_0x434c43){return _0x16303f[_0xdbda('0x19')](_0x37894f);}return _0x16303f[_0xdbda('0x1a')](_0x37894f)[_0xdbda('0x1b')]();};}function respondWithResult(_0x5bd0f4,_0x44c9e1){_0x44c9e1=_0x44c9e1||0xc8;return function(_0x4c021e){if(_0x4c021e){return _0x5bd0f4[_0xdbda('0x1a')](_0x44c9e1)[_0xdbda('0x1c')](_0x4c021e);}};}function respondWithFilteredResult(_0x521906,_0x423e43){return function(_0x32a764){if(_0x32a764){var _0x399eac=typeof _0x423e43[_0xdbda('0x1d')]==='undefined'&&typeof _0x423e43[_0xdbda('0x1e')]==='undefined';var _0x30152c=_0x32a764[_0xdbda('0x1f')];var _0x268432=_0x399eac?0x0:_0x423e43[_0xdbda('0x1d')];var _0x513237=_0x399eac?_0x32a764[_0xdbda('0x1f')]:_0x423e43['offset']+_0x423e43[_0xdbda('0x1e')];var _0x4c66b0;if(_0x513237>=_0x30152c){_0x513237=_0x30152c;_0x4c66b0=0xc8;}else{_0x4c66b0=0xce;}_0x521906[_0xdbda('0x1a')](_0x4c66b0);return _0x521906[_0xdbda('0x20')]('Content-Range',_0x268432+'-'+_0x513237+'/'+_0x30152c)[_0xdbda('0x1c')](_0x32a764);}return null;};}function patchUpdates(_0xc60228){return function(_0x30abab){try{jsonpatch[_0xdbda('0x21')](_0x30abab,_0xc60228,!![]);}catch(_0x58c3d1){return BPromise[_0xdbda('0x22')](_0x58c3d1);}return _0x30abab[_0xdbda('0x23')]();};}function saveUpdates(_0x3c587f,_0x3accc9){return function(_0x295e25){if(_0x295e25){return _0x295e25[_0xdbda('0x24')](_0x3c587f)[_0xdbda('0x25')](function(_0x2c83c4){return _0x2c83c4;});}return null;};}function removeEntity(_0x5e405c,_0x5ddc2a){return function(_0x4a8961){if(_0x4a8961){return _0x4a8961['destroy']()['then'](function(){_0x5e405c[_0xdbda('0x1a')](0xcc)[_0xdbda('0x1b')]();});}};}function handleEntityNotFound(_0x100d04,_0x236425){return function(_0x46e81a){if(!_0x46e81a){_0x100d04[_0xdbda('0x19')](0x194);}return _0x46e81a;};}function handleError(_0x50da01,_0x2b9440){_0x2b9440=_0x2b9440||0x1f4;return function(_0x5c298d){logger['error'](_0x5c298d['stack']);if(_0x5c298d[_0xdbda('0x26')]){delete _0x5c298d[_0xdbda('0x26')];}_0x50da01[_0xdbda('0x1a')](_0x2b9440)[_0xdbda('0x27')](_0x5c298d);};}exports[_0xdbda('0x28')]=function(_0x21580a,_0x4e1c64){var _0x39ca25={},_0x226138={},_0x3e1d1e={'count':0x0,'rows':[]};var _0x474f90=_[_0xdbda('0x29')](db[_0xdbda('0x2a')][_0xdbda('0x2b')],function(_0x449d89){return{'name':_0x449d89['fieldName'],'type':_0x449d89[_0xdbda('0x2c')][_0xdbda('0x2d')]};});_0x226138['model']=_[_0xdbda('0x29')](_0x474f90,_0xdbda('0x26'));_0x226138[_0xdbda('0x2e')]=_[_0xdbda('0x2f')](_0x21580a[_0xdbda('0x2e')]);_0x226138['filters']=_[_0xdbda('0x30')](_0x226138['model'],_0x226138[_0xdbda('0x2e')]);_0x39ca25[_0xdbda('0x31')]=_[_0xdbda('0x30')](_0x226138[_0xdbda('0x32')],qs['fields'](_0x21580a[_0xdbda('0x2e')]['fields']));_0x39ca25['attributes']=_0x39ca25['attributes'][_0xdbda('0x33')]?_0x39ca25[_0xdbda('0x31')]:_0x226138[_0xdbda('0x32')];if(!_0x21580a[_0xdbda('0x2e')][_0xdbda('0x34')](_0xdbda('0x35'))){_0x39ca25['limit']=qs[_0xdbda('0x1e')](_0x21580a[_0xdbda('0x2e')]['limit']);_0x39ca25['offset']=qs[_0xdbda('0x1d')](_0x21580a['query'][_0xdbda('0x1d')]);}_0x39ca25[_0xdbda('0x36')]=qs[_0xdbda('0x37')](_0x21580a[_0xdbda('0x2e')][_0xdbda('0x37')]);_0x39ca25[_0xdbda('0x38')]=qs['filters'](_[_0xdbda('0x39')](_0x21580a[_0xdbda('0x2e')],_0x226138[_0xdbda('0x3a')]),_0x474f90);if(_0x21580a[_0xdbda('0x2e')][_0xdbda('0x3b')]){_0x39ca25[_0xdbda('0x38')]=_['merge'](_0x39ca25[_0xdbda('0x38')],{'$or':_['map'](_0x474f90,function(_0x1161f0){if(_0x1161f0[_0xdbda('0x2c')]!==_0xdbda('0x3c')){var _0x14ca64={};_0x14ca64[_0x1161f0[_0xdbda('0x26')]]={'$like':'%'+_0x21580a[_0xdbda('0x2e')][_0xdbda('0x3b')]+'%'};return _0x14ca64;}})});}_0x39ca25=_['merge']({},_0x39ca25,_0x21580a[_0xdbda('0x3d')]);var _0x4b7a48={'where':_0x39ca25[_0xdbda('0x38')]};return db[_0xdbda('0x2a')][_0xdbda('0x1f')](_0x4b7a48)[_0xdbda('0x25')](function(_0x8d286e){_0x3e1d1e['count']=_0x8d286e;if(_0x21580a[_0xdbda('0x2e')][_0xdbda('0x3e')]){_0x39ca25[_0xdbda('0x3f')]=[{'all':!![]}];}return db[_0xdbda('0x2a')][_0xdbda('0x40')](_0x39ca25);})[_0xdbda('0x25')](function(_0x160b01){_0x3e1d1e[_0xdbda('0x41')]=_0x160b01;return _0x3e1d1e;})['then'](respondWithFilteredResult(_0x4e1c64,_0x39ca25))[_0xdbda('0x42')](handleError(_0x4e1c64,null));};exports[_0xdbda('0x43')]=function(_0x138001,_0x3adb9e){var _0xe377b6={'raw':![],'where':{'id':_0x138001[_0xdbda('0x44')]['id']}},_0x5691e3={};_0x5691e3[_0xdbda('0x32')]=_['keys'](db['DeskConfiguration']['rawAttributes']);_0x5691e3['query']=_[_0xdbda('0x2f')](_0x138001['query']);_0x5691e3['filters']=_['intersection'](_0x5691e3[_0xdbda('0x32')],_0x5691e3[_0xdbda('0x2e')]);_0xe377b6[_0xdbda('0x31')]=_['intersection'](_0x5691e3[_0xdbda('0x32')],qs[_0xdbda('0x45')](_0x138001[_0xdbda('0x2e')][_0xdbda('0x45')]));_0xe377b6[_0xdbda('0x31')]=_0xe377b6['attributes'][_0xdbda('0x33')]?_0xe377b6[_0xdbda('0x31')]:_0x5691e3[_0xdbda('0x32')];if(_0x138001['query'][_0xdbda('0x3e')]){_0xe377b6['include']=[{'all':!![]}];}_0xe377b6=_[_0xdbda('0x46')]({},_0xe377b6,_0x138001[_0xdbda('0x3d')]);return db[_0xdbda('0x2a')][_0xdbda('0x47')](_0xe377b6)[_0xdbda('0x25')](handleEntityNotFound(_0x3adb9e,null))[_0xdbda('0x25')](respondWithResult(_0x3adb9e,null))[_0xdbda('0x42')](handleError(_0x3adb9e,null));};exports[_0xdbda('0x48')]=function(_0x5915ca,_0xc2eac3){return db['DeskConfiguration'][_0xdbda('0x48')](_0x5915ca['body'],{})[_0xdbda('0x25')](respondWithResult(_0xc2eac3,0xc9))[_0xdbda('0x42')](handleError(_0xc2eac3,null));};exports['update']=function(_0x3a6ca8,_0x4ac41b){if(_0x3a6ca8[_0xdbda('0x49')]['id']){delete _0x3a6ca8['body']['id'];}return db[_0xdbda('0x2a')][_0xdbda('0x47')]({'where':{'id':_0x3a6ca8[_0xdbda('0x44')]['id']}})[_0xdbda('0x25')](handleEntityNotFound(_0x4ac41b,null))[_0xdbda('0x25')](saveUpdates(_0x3a6ca8[_0xdbda('0x49')],null))[_0xdbda('0x25')](respondWithResult(_0x4ac41b,null))['catch'](handleError(_0x4ac41b,null));};exports[_0xdbda('0x4a')]=function(_0x13521e,_0x20fb4e){return db['DeskConfiguration'][_0xdbda('0x47')]({'where':{'id':_0x13521e[_0xdbda('0x44')]['id']}})['then'](handleEntityNotFound(_0x20fb4e,null))[_0xdbda('0x25')](removeEntity(_0x20fb4e,null))[_0xdbda('0x42')](handleError(_0x20fb4e,null));};exports[_0xdbda('0x4b')]=function(_0x243934,_0x371075,_0x371da8){var _0x7a47ee={};var _0x8abd96={};var _0x3bf4b0;var _0x37feb4;return db[_0xdbda('0x2a')][_0xdbda('0x4c')]({'where':{'id':_0x243934[_0xdbda('0x44')]['id']}})[_0xdbda('0x25')](handleEntityNotFound(_0x371075,null))['then'](function(_0x4a5ae1){if(_0x4a5ae1){_0x3bf4b0=_0x4a5ae1;_0x8abd96[_0xdbda('0x32')]=_[_0xdbda('0x2f')](db['DeskField']['rawAttributes']);_0x8abd96[_0xdbda('0x2e')]=_[_0xdbda('0x2f')](_0x243934[_0xdbda('0x2e')]);_0x8abd96[_0xdbda('0x3a')]=_['intersection'](_0x8abd96['model'],_0x8abd96[_0xdbda('0x2e')]);_0x7a47ee[_0xdbda('0x31')]=_[_0xdbda('0x30')](_0x8abd96['model'],qs['fields'](_0x243934[_0xdbda('0x2e')][_0xdbda('0x45')]));_0x7a47ee[_0xdbda('0x31')]=_0x7a47ee[_0xdbda('0x31')][_0xdbda('0x33')]?_0x7a47ee[_0xdbda('0x31')]:_0x8abd96[_0xdbda('0x32')];_0x7a47ee[_0xdbda('0x36')]=qs[_0xdbda('0x37')](_0x243934[_0xdbda('0x2e')]['sort']);_0x7a47ee[_0xdbda('0x38')]=qs[_0xdbda('0x3a')](_['pick'](_0x243934[_0xdbda('0x2e')],_0x8abd96['filters']));if(_0x243934['query'][_0xdbda('0x3b')]){_0x7a47ee[_0xdbda('0x38')]=_['merge'](_0x7a47ee[_0xdbda('0x38')],{'$or':_[_0xdbda('0x29')](_0x7a47ee[_0xdbda('0x31')],function(_0x36572e){var _0x2d4f73={};_0x2d4f73[_0x36572e]={'$like':'%'+_0x243934['query'][_0xdbda('0x3b')]+'%'};return _0x2d4f73;})});}_0x7a47ee=_['merge']({},_0x7a47ee,_0x243934[_0xdbda('0x3d')]);return _0x3bf4b0['getFields'](_0x7a47ee);}})[_0xdbda('0x25')](function(_0x3618fc){if(_0x3618fc){_0x37feb4=_0x3618fc[_0xdbda('0x33')];if(!_0x243934['query']['hasOwnProperty'](_0xdbda('0x35'))){_0x7a47ee['limit']=qs[_0xdbda('0x1e')](_0x243934[_0xdbda('0x2e')][_0xdbda('0x1e')]);_0x7a47ee[_0xdbda('0x1d')]=qs[_0xdbda('0x1d')](_0x243934[_0xdbda('0x2e')][_0xdbda('0x1d')]);}return _0x3bf4b0[_0xdbda('0x4b')](_0x7a47ee);}})[_0xdbda('0x25')](function(_0x294761){if(_0x294761){return _0x294761?{'count':_0x37feb4,'rows':_0x294761}:null;}})[_0xdbda('0x25')](respondWithResult(_0x371075,null))[_0xdbda('0x42')](handleError(_0x371075,null));};exports[_0xdbda('0x4d')]=function(_0x8655a,_0x2c6776,_0x2d0c2a){var _0x574fc0={};var _0x37fd39={};var _0x5d9557;var _0x52336a;return db[_0xdbda('0x2a')]['findOne']({'where':{'id':_0x8655a[_0xdbda('0x44')]['id']}})[_0xdbda('0x25')](handleEntityNotFound(_0x2c6776,null))[_0xdbda('0x25')](function(_0x2e7c01){if(_0x2e7c01){_0x5d9557=_0x2e7c01;_0x37fd39[_0xdbda('0x32')]=_[_0xdbda('0x2f')](db[_0xdbda('0x4e')][_0xdbda('0x2b')]);_0x37fd39['query']=_[_0xdbda('0x2f')](_0x8655a[_0xdbda('0x2e')]);_0x37fd39[_0xdbda('0x3a')]=_[_0xdbda('0x30')](_0x37fd39[_0xdbda('0x32')],_0x37fd39['query']);_0x574fc0['attributes']=_[_0xdbda('0x30')](_0x37fd39[_0xdbda('0x32')],qs[_0xdbda('0x45')](_0x8655a['query'][_0xdbda('0x45')]));_0x574fc0['attributes']=_0x574fc0['attributes'][_0xdbda('0x33')]?_0x574fc0[_0xdbda('0x31')]:_0x37fd39[_0xdbda('0x32')];_0x574fc0['order']=qs[_0xdbda('0x37')](_0x8655a[_0xdbda('0x2e')][_0xdbda('0x37')]);_0x574fc0[_0xdbda('0x38')]=qs[_0xdbda('0x3a')](_[_0xdbda('0x39')](_0x8655a[_0xdbda('0x2e')],_0x37fd39['filters']));if(_0x8655a[_0xdbda('0x2e')][_0xdbda('0x3b')]){_0x574fc0[_0xdbda('0x38')]=_[_0xdbda('0x46')](_0x574fc0[_0xdbda('0x38')],{'$or':_[_0xdbda('0x29')](_0x574fc0['attributes'],function(_0x3c1737){var _0xa6178c={};_0xa6178c[_0x3c1737]={'$like':'%'+_0x8655a['query'][_0xdbda('0x3b')]+'%'};return _0xa6178c;})});}_0x574fc0=_[_0xdbda('0x46')]({},_0x574fc0,_0x8655a[_0xdbda('0x3d')]);return _0x5d9557[_0xdbda('0x4d')](_0x574fc0);}})[_0xdbda('0x25')](function(_0x439ece){if(_0x439ece){_0x52336a=_0x439ece[_0xdbda('0x33')];if(!_0x8655a[_0xdbda('0x2e')][_0xdbda('0x34')](_0xdbda('0x35'))){_0x574fc0[_0xdbda('0x1e')]=qs[_0xdbda('0x1e')](_0x8655a[_0xdbda('0x2e')][_0xdbda('0x1e')]);_0x574fc0['offset']=qs['offset'](_0x8655a[_0xdbda('0x2e')]['offset']);}return _0x5d9557[_0xdbda('0x4d')](_0x574fc0);}})[_0xdbda('0x25')](function(_0x406ee4){if(_0x406ee4){return _0x406ee4?{'count':_0x52336a,'rows':_0x406ee4}:null;}})['then'](respondWithResult(_0x2c6776,null))[_0xdbda('0x42')](handleError(_0x2c6776,null));};exports[_0xdbda('0x4f')]=function(_0x42b8a8,_0x429b07,_0xcf4f0c){var _0x2ae854={};var _0x276528={};var _0x1b60c4;var _0x70229;return db[_0xdbda('0x2a')][_0xdbda('0x4c')]({'where':{'id':_0x42b8a8[_0xdbda('0x44')]['id']}})[_0xdbda('0x25')](handleEntityNotFound(_0x429b07,null))[_0xdbda('0x25')](function(_0x54753d){if(_0x54753d){_0x1b60c4=_0x54753d;_0x276528[_0xdbda('0x32')]=_['keys'](db[_0xdbda('0x4e')][_0xdbda('0x2b')]);_0x276528['query']=_['keys'](_0x42b8a8[_0xdbda('0x2e')]);_0x276528[_0xdbda('0x3a')]=_[_0xdbda('0x30')](_0x276528[_0xdbda('0x32')],_0x276528['query']);_0x2ae854[_0xdbda('0x31')]=_['intersection'](_0x276528['model'],qs[_0xdbda('0x45')](_0x42b8a8['query'][_0xdbda('0x45')]));_0x2ae854[_0xdbda('0x31')]=_0x2ae854[_0xdbda('0x31')]['length']?_0x2ae854[_0xdbda('0x31')]:_0x276528[_0xdbda('0x32')];_0x2ae854[_0xdbda('0x36')]=qs['sort'](_0x42b8a8['query'][_0xdbda('0x37')]);_0x2ae854['where']=qs[_0xdbda('0x3a')](_[_0xdbda('0x39')](_0x42b8a8['query'],_0x276528[_0xdbda('0x3a')]));if(_0x42b8a8[_0xdbda('0x2e')]['filter']){_0x2ae854[_0xdbda('0x38')]=_[_0xdbda('0x46')](_0x2ae854['where'],{'$or':_[_0xdbda('0x29')](_0x2ae854[_0xdbda('0x31')],function(_0x5e8bda){var _0xf2e865={};_0xf2e865[_0x5e8bda]={'$like':'%'+_0x42b8a8[_0xdbda('0x2e')][_0xdbda('0x3b')]+'%'};return _0xf2e865;})});}_0x2ae854=_[_0xdbda('0x46')]({},_0x2ae854,_0x42b8a8[_0xdbda('0x3d')]);return _0x1b60c4[_0xdbda('0x4f')](_0x2ae854);}})[_0xdbda('0x25')](function(_0x48b960){if(_0x48b960){_0x70229=_0x48b960[_0xdbda('0x33')];if(!_0x42b8a8[_0xdbda('0x2e')][_0xdbda('0x34')](_0xdbda('0x35'))){_0x2ae854[_0xdbda('0x1e')]=qs[_0xdbda('0x1e')](_0x42b8a8[_0xdbda('0x2e')][_0xdbda('0x1e')]);_0x2ae854[_0xdbda('0x1d')]=qs[_0xdbda('0x1d')](_0x42b8a8['query'][_0xdbda('0x1d')]);}return _0x1b60c4[_0xdbda('0x4f')](_0x2ae854);}})['then'](function(_0x2b261c){if(_0x2b261c){return _0x2b261c?{'count':_0x70229,'rows':_0x2b261c}:null;}})[_0xdbda('0x25')](respondWithResult(_0x429b07,null))[_0xdbda('0x42')](handleError(_0x429b07,null));};exports[_0xdbda('0x50')]=function(_0x5daa45,_0x4a0a69,_0x348ca8){var _0x88c542={};var _0x1cb9fe={};var _0x3ee084;var _0x5986f0;return db[_0xdbda('0x2a')][_0xdbda('0x4c')]({'where':{'id':_0x5daa45[_0xdbda('0x44')]['id']}})['then'](handleEntityNotFound(_0x4a0a69,null))[_0xdbda('0x25')](function(_0x31ebc5){if(_0x31ebc5){_0x3ee084=_0x31ebc5;_0x1cb9fe[_0xdbda('0x32')]=_[_0xdbda('0x2f')](db['Tag']['rawAttributes']);_0x1cb9fe[_0xdbda('0x2e')]=_[_0xdbda('0x2f')](_0x5daa45[_0xdbda('0x2e')]);_0x1cb9fe[_0xdbda('0x3a')]=_[_0xdbda('0x30')](_0x1cb9fe[_0xdbda('0x32')],_0x1cb9fe[_0xdbda('0x2e')]);_0x88c542[_0xdbda('0x31')]=_[_0xdbda('0x30')](_0x1cb9fe[_0xdbda('0x32')],qs[_0xdbda('0x45')](_0x5daa45[_0xdbda('0x2e')]['fields']));_0x88c542[_0xdbda('0x31')]=_0x88c542['attributes'][_0xdbda('0x33')]?_0x88c542[_0xdbda('0x31')]:_0x1cb9fe[_0xdbda('0x32')];_0x88c542[_0xdbda('0x36')]=qs[_0xdbda('0x37')](_0x5daa45[_0xdbda('0x2e')][_0xdbda('0x37')]);_0x88c542['where']=qs[_0xdbda('0x3a')](_[_0xdbda('0x39')](_0x5daa45[_0xdbda('0x2e')],_0x1cb9fe[_0xdbda('0x3a')]));if(_0x5daa45[_0xdbda('0x2e')][_0xdbda('0x3b')]){_0x88c542[_0xdbda('0x38')]=_['merge'](_0x88c542['where'],{'$or':_[_0xdbda('0x29')](_0x88c542['attributes'],function(_0x42594d){var _0x518da6={};_0x518da6[_0x42594d]={'$like':'%'+_0x5daa45[_0xdbda('0x2e')][_0xdbda('0x3b')]+'%'};return _0x518da6;})});}_0x88c542=_[_0xdbda('0x46')]({},_0x88c542,_0x5daa45[_0xdbda('0x3d')]);return _0x3ee084['getTags'](_0x88c542);}})['then'](function(_0x5ba418){if(_0x5ba418){_0x5986f0=_0x5ba418[_0xdbda('0x33')];if(!_0x5daa45['query']['hasOwnProperty'](_0xdbda('0x35'))){_0x88c542[_0xdbda('0x1e')]=qs[_0xdbda('0x1e')](_0x5daa45['query'][_0xdbda('0x1e')]);_0x88c542['offset']=qs['offset'](_0x5daa45['query'][_0xdbda('0x1d')]);}return _0x3ee084[_0xdbda('0x50')](_0x88c542);}})[_0xdbda('0x25')](function(_0x5f3cdb){if(_0x5f3cdb){return _0x5f3cdb?{'count':_0x5986f0,'rows':_0x5f3cdb}:null;}})['then'](respondWithResult(_0x4a0a69,null))[_0xdbda('0x42')](handleError(_0x4a0a69,null));};exports['setTags']=function(_0x576745,_0x436ae0,_0x460041){if(_0x576745[_0xdbda('0x49')]['id']){delete _0x576745['body']['id'];}return db[_0xdbda('0x2a')][_0xdbda('0x4c')]({'where':{'id':_0x576745['params']['id']}})['then'](handleEntityNotFound(_0x436ae0,null))[_0xdbda('0x25')](function(_0x358e92){if(_0x358e92){return _0x358e92['setTags'](_0x576745[_0xdbda('0x49')][_0xdbda('0x51')]||[]);}return null;})[_0xdbda('0x25')](respondWithResult(_0x436ae0,null))['catch'](handleError(_0x436ae0,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 714ef98..671b142 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 _0x84c7=['request-promise','path','rimraf','../../config/environment','exports','define','DeskConfiguration','int_desk_configurations','moment'];(function(_0xc589d8,_0x39d565){var _0x563e6a=function(_0x27bdca){while(--_0x27bdca){_0xc589d8['push'](_0xc589d8['shift']());}};_0x563e6a(++_0x39d565);}(_0x84c7,0x6b));var _0x784c=function(_0x42dfcc,_0x1b1ccb){_0x42dfcc=_0x42dfcc-0x0;var _0x292cdb=_0x84c7[_0x42dfcc];return _0x292cdb;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x784c('0x0'));var BPromise=require('bluebird');var rp=require(_0x784c('0x1'));var fs=require('fs');var path=require(_0x784c('0x2'));var rimraf=require(_0x784c('0x3'));var config=require(_0x784c('0x4'));var attributes=require('./intDeskConfiguration.attributes');module[_0x784c('0x5')]=function(_0x9224b9,_0x113e8c){return _0x9224b9[_0x784c('0x6')](_0x784c('0x7'),attributes,{'tableName':_0x784c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x063c=['exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api','moment','request-promise','path','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x289891,_0x49a0fa){var _0x31cf2e=function(_0x8cebce){while(--_0x8cebce){_0x289891['push'](_0x289891['shift']());}};_0x31cf2e(++_0x49a0fa);}(_0x063c,0x70));var _0xc063=function(_0x150b55,_0x5cc75a){_0x150b55=_0x150b55-0x0;var _0x1e3167=_0x063c[_0x150b55];return _0x1e3167;};'use strict';var _=require(_0xc063('0x0'));var util=require(_0xc063('0x1'));var logger=require('../../config/logger')(_0xc063('0x2'));var moment=require(_0xc063('0x3'));var BPromise=require('bluebird');var rp=require(_0xc063('0x4'));var fs=require('fs');var path=require(_0xc063('0x5'));var rimraf=require('rimraf');var config=require(_0xc063('0x6'));var attributes=require(_0xc063('0x7'));module[_0xc063('0x8')]=function(_0x55bc86,_0x405609){return _0x55bc86[_0xc063('0x9')](_0xc063('0xa'),attributes,{'tableName':_0xc063('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 0e7a3ab..600104f 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 _0x5a13=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x20b3a2,_0x1f414){var _0x2e0176=function(_0xb0da00){while(--_0xb0da00){_0x20b3a2['push'](_0x20b3a2['shift']());}};_0x2e0176(++_0x1f414);}(_0x5a13,0x92));var _0x35a1=function(_0x3a59ca,_0x1d48e7){_0x3a59ca=_0x3a59ca-0x0;var _0x3afaa8=_0x5a13[_0x3a59ca];return _0x3afaa8;};'use strict';var _=require('lodash');var util=require(_0x35a1('0x0'));var moment=require(_0x35a1('0x1'));var BPromise=require(_0x35a1('0x2'));var rs=require(_0x35a1('0x3'));var fs=require('fs');var Redis=require(_0x35a1('0x4'));var db=require(_0x35a1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x35a1('0x6'))('rpc');var config=require(_0x35a1('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4222a1,_0x3bd7c9,_0xb00a35){return new BPromise(function(_0x3ed235,_0x78d296){return client['request'](_0x4222a1,_0xb00a35)[_0x35a1('0x8')](function(_0x469d94){logger[_0x35a1('0x9')](_0x35a1('0xa'),_0x3bd7c9,_0x35a1('0xb'));logger[_0x35a1('0xc')](_0x35a1('0xd'),_0x3bd7c9,_0x35a1('0xb'),JSON[_0x35a1('0xe')](_0x469d94));if(_0x469d94['error']){if(_0x469d94[_0x35a1('0xf')][_0x35a1('0x10')]===0x1f4){logger[_0x35a1('0xf')](_0x35a1('0xa'),_0x3bd7c9,_0x469d94[_0x35a1('0xf')]['message']);return _0x78d296(_0x469d94[_0x35a1('0xf')]['message']);}logger[_0x35a1('0xf')](_0x35a1('0xa'),_0x3bd7c9,_0x469d94['error'][_0x35a1('0x11')]);return _0x3ed235(_0x469d94[_0x35a1('0xf')][_0x35a1('0x11')]);}else{logger[_0x35a1('0x9')]('DeskConfiguration,\x20%s,\x20%s',_0x3bd7c9,_0x35a1('0xb'));_0x3ed235(_0x469d94[_0x35a1('0x12')][_0x35a1('0x11')]);}})[_0x35a1('0x13')](function(_0x5d5166){logger[_0x35a1('0xf')](_0x35a1('0xa'),_0x3bd7c9,_0x5d5166);_0x78d296(_0x5d5166);});});} \ No newline at end of file +var _0x5fdc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s','info','lodash','util','moment','bluebird','randomstring'];(function(_0xfdc515,_0x4585bc){var _0x1e9e02=function(_0x103e5e){while(--_0x103e5e){_0xfdc515['push'](_0xfdc515['shift']());}};_0x1e9e02(++_0x4585bc);}(_0x5fdc,0x127));var _0xc5fd=function(_0x46965a,_0x233274){_0x46965a=_0x46965a-0x0;var _0x1f39a4=_0x5fdc[_0x46965a];return _0x1f39a4;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));var BPromise=require(_0xc5fd('0x3'));var rs=require(_0xc5fd('0x4'));var fs=require('fs');var Redis=require(_0xc5fd('0x5'));var db=require(_0xc5fd('0x6'))['db'];var utils=require(_0xc5fd('0x7'));var logger=require(_0xc5fd('0x8'))(_0xc5fd('0x9'));var config=require(_0xc5fd('0xa'));var jayson=require(_0xc5fd('0xb'));var client=jayson[_0xc5fd('0xc')][_0xc5fd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x15ffe7,_0x5a2eb4,_0x5d86e5){return new BPromise(function(_0x493389,_0x224801){return client[_0xc5fd('0xe')](_0x15ffe7,_0x5d86e5)[_0xc5fd('0xf')](function(_0x45c91f){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x5a2eb4,_0xc5fd('0x10'));logger[_0xc5fd('0x11')](_0xc5fd('0x12'),_0x5a2eb4,_0xc5fd('0x10'),JSON[_0xc5fd('0x13')](_0x45c91f));if(_0x45c91f[_0xc5fd('0x14')]){if(_0x45c91f['error'][_0xc5fd('0x15')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x224801(_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);}logger[_0xc5fd('0x14')](_0xc5fd('0x17'),_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x493389(_0x45c91f['error'][_0xc5fd('0x16')]);}else{logger[_0xc5fd('0x18')](_0xc5fd('0x17'),_0x5a2eb4,_0xc5fd('0x10'));_0x493389(_0x45c91f['result']['message']);}})['catch'](function(_0x5529b3){logger['error'](_0xc5fd('0x17'),_0x5a2eb4,_0x5529b3);_0x224801(_0x5529b3);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 4f9ffe7..45d3907 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 _0xee24=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','index','get','/:id','isAuthenticated','post','create','update','exports','multer','util','path','connect-timeout','express'];(function(_0x36828e,_0x1e401c){var _0x129fe3=function(_0x43c656){while(--_0x43c656){_0x36828e['push'](_0x36828e['shift']());}};_0x129fe3(++_0x1e401c);}(_0xee24,0x80));var _0x4ee2=function(_0x4af9e4,_0x2fee87){_0x4af9e4=_0x4af9e4-0x0;var _0x185212=_0xee24[_0x4af9e4];return _0x185212;};'use strict';var multer=require(_0x4ee2('0x0'));var util=require(_0x4ee2('0x1'));var path=require(_0x4ee2('0x2'));var timeout=require(_0x4ee2('0x3'));var express=require(_0x4ee2('0x4'));var router=express[_0x4ee2('0x5')]();var fs_extra=require(_0x4ee2('0x6'));var auth=require(_0x4ee2('0x7'));var interaction=require(_0x4ee2('0x8'));var config=require(_0x4ee2('0x9'));var controller=require(_0x4ee2('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x4ee2('0xb')]);router[_0x4ee2('0xc')](_0x4ee2('0xd'),auth[_0x4ee2('0xe')](),controller['show']);router[_0x4ee2('0xf')]('/',auth[_0x4ee2('0xe')](),controller[_0x4ee2('0x10')]);router['put'](_0x4ee2('0xd'),auth['isAuthenticated'](),controller[_0x4ee2('0x11')]);router['delete'](_0x4ee2('0xd'),auth[_0x4ee2('0xe')](),controller['destroy']);module[_0x4ee2('0x12')]=router; \ No newline at end of file +var _0x781b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','/:id','show','post','update','isAuthenticated','exports','multer','util'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x781b,0x1c9));var _0xb781=function(_0x253bd2,_0x4e88ff){_0x253bd2=_0x253bd2-0x0;var _0x457ff9=_0x781b[_0x253bd2];return _0x457ff9;};'use strict';var multer=require(_0xb781('0x0'));var util=require(_0xb781('0x1'));var path=require(_0xb781('0x2'));var timeout=require(_0xb781('0x3'));var express=require(_0xb781('0x4'));var router=express[_0xb781('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb781('0x6'));var interaction=require(_0xb781('0x7'));var config=require(_0xb781('0x8'));var controller=require(_0xb781('0x9'));router[_0xb781('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb781('0xa')](_0xb781('0xb'),auth['isAuthenticated'](),controller[_0xb781('0xc')]);router[_0xb781('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xb781('0xb'),auth['isAuthenticated'](),controller[_0xb781('0xe')]);router['delete'](_0xb781('0xb'),auth[_0xb781('0xf')](),controller['destroy']);module[_0xb781('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 6fb1f4a..c6df498 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 _0x6a27=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x22245f,_0x5ca161){var _0x42c053=function(_0x260859){while(--_0x260859){_0x22245f['push'](_0x22245f['shift']());}};_0x42c053(++_0x5ca161);}(_0x6a27,0x76));var _0x76a2=function(_0x5817a8,_0x51ca64){_0x5817a8=_0x5817a8-0x0;var _0x22d40e=_0x6a27[_0x5817a8];return _0x22d40e;};'use strict';var Sequelize=require(_0x76a2('0x0'));module[_0x76a2('0x1')]={'type':{'type':Sequelize[_0x76a2('0x2')](_0x76a2('0x3'),'variable',_0x76a2('0x4'),_0x76a2('0x5'),'picklist'),'defaultValue':_0x76a2('0x3')},'content':{'type':Sequelize[_0x76a2('0x6')]},'key':{'type':Sequelize[_0x76a2('0x6')]},'keyType':{'type':Sequelize[_0x76a2('0x2')](_0x76a2('0x3'),_0x76a2('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x76a2('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x76a2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe938=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x5ba418,_0x1faeb5){var _0x3e82c2=function(_0x1a7534){while(--_0x1a7534){_0x5ba418['push'](_0x5ba418['shift']());}};_0x3e82c2(++_0x1faeb5);}(_0xe938,0x1ae));var _0x8e93=function(_0x3c0788,_0x3e6506){_0x3c0788=_0x3c0788-0x0;var _0x4a9442=_0xe938[_0x3c0788];return _0x4a9442;};'use strict';var Sequelize=require(_0x8e93('0x0'));module['exports']={'type':{'type':Sequelize[_0x8e93('0x1')](_0x8e93('0x2'),_0x8e93('0x3'),_0x8e93('0x4'),_0x8e93('0x5'),_0x8e93('0x6')),'defaultValue':_0x8e93('0x2')},'content':{'type':Sequelize[_0x8e93('0x7')]},'key':{'type':Sequelize[_0x8e93('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x8e93('0x2'),_0x8e93('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x8e93('0x7')]},'idField':{'type':Sequelize[_0x8e93('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8e93('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8e93('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 69ed01d..50e5c22 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 _0x9a96=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','DeskField','rows','catch','show','params','includeAll','merge','create','body','destroy','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x5118fe,_0x12356b){var _0x1ef4f4=function(_0x26a1bd){while(--_0x26a1bd){_0x5118fe['push'](_0x5118fe['shift']());}};_0x1ef4f4(++_0x12356b);}(_0x9a96,0xd0));var _0x69a9=function(_0x24e437,_0x1302a4){_0x24e437=_0x24e437-0x0;var _0x147055=_0x9a96[_0x24e437];return _0x147055;};'use strict';var emlformat=require(_0x69a9('0x0'));var rimraf=require(_0x69a9('0x1'));var zipdir=require(_0x69a9('0x2'));var jsonpatch=require(_0x69a9('0x3'));var rp=require(_0x69a9('0x4'));var moment=require(_0x69a9('0x5'));var BPromise=require(_0x69a9('0x6'));var Mustache=require(_0x69a9('0x7'));var util=require(_0x69a9('0x8'));var path=require(_0x69a9('0x9'));var sox=require(_0x69a9('0xa'));var csv=require(_0x69a9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x69a9('0xc'));var _=require(_0x69a9('0xd'));var squel=require(_0x69a9('0xe'));var crypto=require(_0x69a9('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x69a9('0x10'));var toCsv=require(_0x69a9('0xb'));var querystring=require(_0x69a9('0x11'));var Papa=require(_0x69a9('0x12'));var Redis=require(_0x69a9('0x13'));var authService=require(_0x69a9('0x14'));var qs=require(_0x69a9('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x69a9('0x16'));var logger=require('../../config/logger')(_0x69a9('0x17'));var utils=require(_0x69a9('0x18'));var config=require(_0x69a9('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x69a9('0x1a'))['db'];function respondWithStatusCode(_0xcb8543,_0x579b06){_0x579b06=_0x579b06||0xcc;return function(_0x30c9b0){if(_0x30c9b0){return _0xcb8543[_0x69a9('0x1b')](_0x579b06);}return _0xcb8543[_0x69a9('0x1c')](_0x579b06)[_0x69a9('0x1d')]();};}function respondWithResult(_0x4176c9,_0x57f682){_0x57f682=_0x57f682||0xc8;return function(_0x447e04){if(_0x447e04){return _0x4176c9[_0x69a9('0x1c')](_0x57f682)[_0x69a9('0x1e')](_0x447e04);}};}function respondWithFilteredResult(_0x436eae,_0x16f9d8){return function(_0x8f62f7){if(_0x8f62f7){var _0x5e5a3a=typeof _0x16f9d8['offset']===_0x69a9('0x1f')&&typeof _0x16f9d8[_0x69a9('0x20')]===_0x69a9('0x1f');var _0x554c42=_0x8f62f7[_0x69a9('0x21')];var _0x2f225f=_0x5e5a3a?0x0:_0x16f9d8[_0x69a9('0x22')];var _0x2fc505=_0x5e5a3a?_0x8f62f7[_0x69a9('0x21')]:_0x16f9d8[_0x69a9('0x22')]+_0x16f9d8[_0x69a9('0x20')];var _0x2b9e23;if(_0x2fc505>=_0x554c42){_0x2fc505=_0x554c42;_0x2b9e23=0xc8;}else{_0x2b9e23=0xce;}_0x436eae[_0x69a9('0x1c')](_0x2b9e23);return _0x436eae[_0x69a9('0x23')]('Content-Range',_0x2f225f+'-'+_0x2fc505+'/'+_0x554c42)['json'](_0x8f62f7);}return null;};}function patchUpdates(_0xcc835){return function(_0x986f8){try{jsonpatch[_0x69a9('0x24')](_0x986f8,_0xcc835,!![]);}catch(_0x4b8455){return BPromise['reject'](_0x4b8455);}return _0x986f8['save']();};}function saveUpdates(_0x5c37ed,_0x29e798){return function(_0x90366b){if(_0x90366b){return _0x90366b[_0x69a9('0x25')](_0x5c37ed)[_0x69a9('0x26')](function(_0x8f38d8){return _0x8f38d8;});}return null;};}function removeEntity(_0x5bed8c,_0x4cf3b3){return function(_0x592eaf){if(_0x592eaf){return _0x592eaf['destroy']()[_0x69a9('0x26')](function(){_0x5bed8c[_0x69a9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56314f,_0x55659c){return function(_0x4685e3){if(!_0x4685e3){_0x56314f[_0x69a9('0x1b')](0x194);}return _0x4685e3;};}function handleError(_0x51f203,_0xd5af15){_0xd5af15=_0xd5af15||0x1f4;return function(_0x23d2a1){logger['error'](_0x23d2a1[_0x69a9('0x27')]);if(_0x23d2a1['name']){delete _0x23d2a1[_0x69a9('0x28')];}_0x51f203[_0x69a9('0x1c')](_0xd5af15)[_0x69a9('0x29')](_0x23d2a1);};}exports[_0x69a9('0x2a')]=function(_0x2299b2,_0x3b60e0){var _0x870dbb={},_0xad3854={},_0xc68890={'count':0x0,'rows':[]};var _0x2672e9=_[_0x69a9('0x2b')](db['DeskField'][_0x69a9('0x2c')],function(_0x37dd4f){return{'name':_0x37dd4f[_0x69a9('0x2d')],'type':_0x37dd4f[_0x69a9('0x2e')][_0x69a9('0x2f')]};});_0xad3854[_0x69a9('0x30')]=_[_0x69a9('0x2b')](_0x2672e9,_0x69a9('0x28'));_0xad3854[_0x69a9('0x31')]=_[_0x69a9('0x32')](_0x2299b2['query']);_0xad3854[_0x69a9('0x33')]=_[_0x69a9('0x34')](_0xad3854[_0x69a9('0x30')],_0xad3854[_0x69a9('0x31')]);_0x870dbb[_0x69a9('0x35')]=_[_0x69a9('0x34')](_0xad3854[_0x69a9('0x30')],qs[_0x69a9('0x36')](_0x2299b2['query'][_0x69a9('0x36')]));_0x870dbb[_0x69a9('0x35')]=_0x870dbb['attributes'][_0x69a9('0x37')]?_0x870dbb[_0x69a9('0x35')]:_0xad3854[_0x69a9('0x30')];if(!_0x2299b2[_0x69a9('0x31')]['hasOwnProperty'](_0x69a9('0x38'))){_0x870dbb[_0x69a9('0x20')]=qs[_0x69a9('0x20')](_0x2299b2['query']['limit']);_0x870dbb[_0x69a9('0x22')]=qs[_0x69a9('0x22')](_0x2299b2[_0x69a9('0x31')]['offset']);}_0x870dbb[_0x69a9('0x39')]=qs[_0x69a9('0x3a')](_0x2299b2[_0x69a9('0x31')][_0x69a9('0x3a')]);_0x870dbb[_0x69a9('0x3b')]=qs['filters'](_[_0x69a9('0x3c')](_0x2299b2[_0x69a9('0x31')],_0xad3854[_0x69a9('0x33')]),_0x2672e9);if(_0x2299b2[_0x69a9('0x31')][_0x69a9('0x3d')]){_0x870dbb[_0x69a9('0x3b')]=_['merge'](_0x870dbb[_0x69a9('0x3b')],{'$or':_[_0x69a9('0x2b')](_0x2672e9,function(_0x13402a){if(_0x13402a[_0x69a9('0x2e')]!==_0x69a9('0x3e')){var _0x484ede={};_0x484ede[_0x13402a['name']]={'$like':'%'+_0x2299b2[_0x69a9('0x31')][_0x69a9('0x3d')]+'%'};return _0x484ede;}})});}_0x870dbb=_['merge']({},_0x870dbb,_0x2299b2[_0x69a9('0x3f')]);var _0xbd8583={'where':_0x870dbb[_0x69a9('0x3b')]};return db['DeskField']['count'](_0xbd8583)[_0x69a9('0x26')](function(_0x40ccf6){_0xc68890[_0x69a9('0x21')]=_0x40ccf6;if(_0x2299b2[_0x69a9('0x31')]['includeAll']){_0x870dbb[_0x69a9('0x40')]=[{'all':!![]}];}return db[_0x69a9('0x41')]['findAll'](_0x870dbb);})[_0x69a9('0x26')](function(_0x32ffe8){_0xc68890[_0x69a9('0x42')]=_0x32ffe8;return _0xc68890;})[_0x69a9('0x26')](respondWithFilteredResult(_0x3b60e0,_0x870dbb))[_0x69a9('0x43')](handleError(_0x3b60e0,null));};exports[_0x69a9('0x44')]=function(_0x16371a,_0x5b38b7){var _0x25b715={'raw':!![],'where':{'id':_0x16371a[_0x69a9('0x45')]['id']}},_0x1d673f={};_0x1d673f[_0x69a9('0x30')]=_[_0x69a9('0x32')](db['DeskField']['rawAttributes']);_0x1d673f[_0x69a9('0x31')]=_[_0x69a9('0x32')](_0x16371a[_0x69a9('0x31')]);_0x1d673f[_0x69a9('0x33')]=_[_0x69a9('0x34')](_0x1d673f[_0x69a9('0x30')],_0x1d673f[_0x69a9('0x31')]);_0x25b715[_0x69a9('0x35')]=_[_0x69a9('0x34')](_0x1d673f[_0x69a9('0x30')],qs[_0x69a9('0x36')](_0x16371a[_0x69a9('0x31')]['fields']));_0x25b715[_0x69a9('0x35')]=_0x25b715[_0x69a9('0x35')][_0x69a9('0x37')]?_0x25b715[_0x69a9('0x35')]:_0x1d673f['model'];if(_0x16371a[_0x69a9('0x31')][_0x69a9('0x46')]){_0x25b715[_0x69a9('0x40')]=[{'all':!![]}];}_0x25b715=_[_0x69a9('0x47')]({},_0x25b715,_0x16371a[_0x69a9('0x3f')]);return db[_0x69a9('0x41')]['find'](_0x25b715)[_0x69a9('0x26')](handleEntityNotFound(_0x5b38b7,null))[_0x69a9('0x26')](respondWithResult(_0x5b38b7,null))['catch'](handleError(_0x5b38b7,null));};exports[_0x69a9('0x48')]=function(_0x4d2aec,_0x4ea20d){return db[_0x69a9('0x41')][_0x69a9('0x48')](_0x4d2aec[_0x69a9('0x49')],{})[_0x69a9('0x26')](respondWithResult(_0x4ea20d,0xc9))['catch'](handleError(_0x4ea20d,null));};exports[_0x69a9('0x25')]=function(_0x140b42,_0x2e6681){if(_0x140b42[_0x69a9('0x49')]['id']){delete _0x140b42['body']['id'];}return db[_0x69a9('0x41')]['find']({'where':{'id':_0x140b42[_0x69a9('0x45')]['id']}})[_0x69a9('0x26')](handleEntityNotFound(_0x2e6681,null))[_0x69a9('0x26')](saveUpdates(_0x140b42[_0x69a9('0x49')],null))[_0x69a9('0x26')](respondWithResult(_0x2e6681,null))['catch'](handleError(_0x2e6681,null));};exports[_0x69a9('0x4a')]=function(_0x3895a9,_0x2ab4c9){return db[_0x69a9('0x41')][_0x69a9('0x4b')]({'where':{'id':_0x3895a9[_0x69a9('0x45')]['id']}})[_0x69a9('0x26')](handleEntityNotFound(_0x2ab4c9,null))[_0x69a9('0x26')](removeEntity(_0x2ab4c9,null))['catch'](handleError(_0x2ab4c9,null));}; \ No newline at end of file +var _0x0adf=['include','findAll','rows','catch','show','params','fields','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','DeskField','count','includeAll'];(function(_0x46c97d,_0x1d2099){var _0x42cf4f=function(_0x20048b){while(--_0x20048b){_0x46c97d['push'](_0x46c97d['shift']());}};_0x42cf4f(++_0x1d2099);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x50427f,_0x259e30){_0x50427f=_0x50427f-0x0;var _0x45603f=_0x0adf[_0x50427f];return _0x45603f;};'use strict';var emlformat=require(_0xf0ad('0x0'));var rimraf=require(_0xf0ad('0x1'));var zipdir=require(_0xf0ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf0ad('0x3'));var moment=require(_0xf0ad('0x4'));var BPromise=require(_0xf0ad('0x5'));var Mustache=require(_0xf0ad('0x6'));var util=require(_0xf0ad('0x7'));var path=require(_0xf0ad('0x8'));var sox=require(_0xf0ad('0x9'));var csv=require('to-csv');var ejs=require(_0xf0ad('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf0ad('0xb'));var squel=require(_0xf0ad('0xc'));var crypto=require(_0xf0ad('0xd'));var jsforce=require(_0xf0ad('0xe'));var deskjs=require(_0xf0ad('0xf'));var toCsv=require(_0xf0ad('0x10'));var querystring=require(_0xf0ad('0x11'));var Papa=require('papaparse');var Redis=require(_0xf0ad('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf0ad('0x13'));var as=require(_0xf0ad('0x14'));var hardwareService=require(_0xf0ad('0x15'));var logger=require(_0xf0ad('0x16'))(_0xf0ad('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf0ad('0x18'));var db=require(_0xf0ad('0x19'))['db'];function respondWithStatusCode(_0x3646a2,_0x238c3b){_0x238c3b=_0x238c3b||0xcc;return function(_0x597c40){if(_0x597c40){return _0x3646a2[_0xf0ad('0x1a')](_0x238c3b);}return _0x3646a2[_0xf0ad('0x1b')](_0x238c3b)['end']();};}function respondWithResult(_0x49df92,_0x5332e9){_0x5332e9=_0x5332e9||0xc8;return function(_0x221d7b){if(_0x221d7b){return _0x49df92['status'](_0x5332e9)[_0xf0ad('0x1c')](_0x221d7b);}};}function respondWithFilteredResult(_0x313ad6,_0xfa544c){return function(_0xfa829e){if(_0xfa829e){var _0x237dd9=typeof _0xfa544c['offset']===_0xf0ad('0x1d')&&typeof _0xfa544c[_0xf0ad('0x1e')]===_0xf0ad('0x1d');var _0x1c9fac=_0xfa829e['count'];var _0x4e9970=_0x237dd9?0x0:_0xfa544c[_0xf0ad('0x1f')];var _0x46fb20=_0x237dd9?_0xfa829e['count']:_0xfa544c[_0xf0ad('0x1f')]+_0xfa544c[_0xf0ad('0x1e')];var _0x9a95bf;if(_0x46fb20>=_0x1c9fac){_0x46fb20=_0x1c9fac;_0x9a95bf=0xc8;}else{_0x9a95bf=0xce;}_0x313ad6[_0xf0ad('0x1b')](_0x9a95bf);return _0x313ad6['set']('Content-Range',_0x4e9970+'-'+_0x46fb20+'/'+_0x1c9fac)[_0xf0ad('0x1c')](_0xfa829e);}return null;};}function patchUpdates(_0x2da425){return function(_0x37b968){try{jsonpatch[_0xf0ad('0x20')](_0x37b968,_0x2da425,!![]);}catch(_0x2ac8ba){return BPromise[_0xf0ad('0x21')](_0x2ac8ba);}return _0x37b968['save']();};}function saveUpdates(_0x33c95d,_0x16e62a){return function(_0x31635b){if(_0x31635b){return _0x31635b[_0xf0ad('0x22')](_0x33c95d)[_0xf0ad('0x23')](function(_0x88b47b){return _0x88b47b;});}return null;};}function removeEntity(_0xb91769,_0x276322){return function(_0x3fc97e){if(_0x3fc97e){return _0x3fc97e[_0xf0ad('0x24')]()[_0xf0ad('0x23')](function(){_0xb91769[_0xf0ad('0x1b')](0xcc)[_0xf0ad('0x25')]();});}};}function handleEntityNotFound(_0x456f81,_0x879f89){return function(_0x557f90){if(!_0x557f90){_0x456f81[_0xf0ad('0x1a')](0x194);}return _0x557f90;};}function handleError(_0x1507a3,_0x248794){_0x248794=_0x248794||0x1f4;return function(_0x7377d7){logger[_0xf0ad('0x26')](_0x7377d7[_0xf0ad('0x27')]);if(_0x7377d7['name']){delete _0x7377d7[_0xf0ad('0x28')];}_0x1507a3[_0xf0ad('0x1b')](_0x248794)[_0xf0ad('0x29')](_0x7377d7);};}exports[_0xf0ad('0x2a')]=function(_0x1b6880,_0x1ac25c){var _0x267b7a={},_0x1bee71={},_0x2386e8={'count':0x0,'rows':[]};var _0x39c46c=_[_0xf0ad('0x2b')](db['DeskField'][_0xf0ad('0x2c')],function(_0x5f5115){return{'name':_0x5f5115[_0xf0ad('0x2d')],'type':_0x5f5115['type'][_0xf0ad('0x2e')]};});_0x1bee71[_0xf0ad('0x2f')]=_[_0xf0ad('0x2b')](_0x39c46c,_0xf0ad('0x28'));_0x1bee71[_0xf0ad('0x30')]=_[_0xf0ad('0x31')](_0x1b6880[_0xf0ad('0x30')]);_0x1bee71[_0xf0ad('0x32')]=_['intersection'](_0x1bee71['model'],_0x1bee71[_0xf0ad('0x30')]);_0x267b7a[_0xf0ad('0x33')]=_[_0xf0ad('0x34')](_0x1bee71[_0xf0ad('0x2f')],qs['fields'](_0x1b6880[_0xf0ad('0x30')]['fields']));_0x267b7a[_0xf0ad('0x33')]=_0x267b7a['attributes'][_0xf0ad('0x35')]?_0x267b7a['attributes']:_0x1bee71[_0xf0ad('0x2f')];if(!_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x36')](_0xf0ad('0x37'))){_0x267b7a[_0xf0ad('0x1e')]=qs[_0xf0ad('0x1e')](_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x1e')]);_0x267b7a['offset']=qs[_0xf0ad('0x1f')](_0x1b6880['query'][_0xf0ad('0x1f')]);}_0x267b7a['order']=qs[_0xf0ad('0x38')](_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x38')]);_0x267b7a[_0xf0ad('0x39')]=qs[_0xf0ad('0x32')](_['pick'](_0x1b6880[_0xf0ad('0x30')],_0x1bee71[_0xf0ad('0x32')]),_0x39c46c);if(_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x3a')]){_0x267b7a[_0xf0ad('0x39')]=_[_0xf0ad('0x3b')](_0x267b7a[_0xf0ad('0x39')],{'$or':_['map'](_0x39c46c,function(_0x2e0c7a){if(_0x2e0c7a[_0xf0ad('0x3c')]!==_0xf0ad('0x3d')){var _0x189f67={};_0x189f67[_0x2e0c7a[_0xf0ad('0x28')]]={'$like':'%'+_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x3a')]+'%'};return _0x189f67;}})});}_0x267b7a=_[_0xf0ad('0x3b')]({},_0x267b7a,_0x1b6880[_0xf0ad('0x3e')]);var _0x5dd631={'where':_0x267b7a[_0xf0ad('0x39')]};return db[_0xf0ad('0x3f')][_0xf0ad('0x40')](_0x5dd631)['then'](function(_0x510f54){_0x2386e8['count']=_0x510f54;if(_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x41')]){_0x267b7a[_0xf0ad('0x42')]=[{'all':!![]}];}return db[_0xf0ad('0x3f')][_0xf0ad('0x43')](_0x267b7a);})[_0xf0ad('0x23')](function(_0x39083d){_0x2386e8[_0xf0ad('0x44')]=_0x39083d;return _0x2386e8;})[_0xf0ad('0x23')](respondWithFilteredResult(_0x1ac25c,_0x267b7a))[_0xf0ad('0x45')](handleError(_0x1ac25c,null));};exports[_0xf0ad('0x46')]=function(_0x516a72,_0x4ea947){var _0x5cd1dc={'raw':!![],'where':{'id':_0x516a72[_0xf0ad('0x47')]['id']}},_0x1c0609={};_0x1c0609['model']=_[_0xf0ad('0x31')](db[_0xf0ad('0x3f')]['rawAttributes']);_0x1c0609[_0xf0ad('0x30')]=_[_0xf0ad('0x31')](_0x516a72[_0xf0ad('0x30')]);_0x1c0609[_0xf0ad('0x32')]=_['intersection'](_0x1c0609[_0xf0ad('0x2f')],_0x1c0609[_0xf0ad('0x30')]);_0x5cd1dc[_0xf0ad('0x33')]=_[_0xf0ad('0x34')](_0x1c0609[_0xf0ad('0x2f')],qs[_0xf0ad('0x48')](_0x516a72[_0xf0ad('0x30')][_0xf0ad('0x48')]));_0x5cd1dc[_0xf0ad('0x33')]=_0x5cd1dc[_0xf0ad('0x33')][_0xf0ad('0x35')]?_0x5cd1dc['attributes']:_0x1c0609[_0xf0ad('0x2f')];if(_0x516a72[_0xf0ad('0x30')][_0xf0ad('0x41')]){_0x5cd1dc['include']=[{'all':!![]}];}_0x5cd1dc=_['merge']({},_0x5cd1dc,_0x516a72[_0xf0ad('0x3e')]);return db[_0xf0ad('0x3f')][_0xf0ad('0x49')](_0x5cd1dc)[_0xf0ad('0x23')](handleEntityNotFound(_0x4ea947,null))[_0xf0ad('0x23')](respondWithResult(_0x4ea947,null))[_0xf0ad('0x45')](handleError(_0x4ea947,null));};exports[_0xf0ad('0x4a')]=function(_0x561f2a,_0x1e35ce){return db['DeskField'][_0xf0ad('0x4a')](_0x561f2a[_0xf0ad('0x4b')],{})[_0xf0ad('0x23')](respondWithResult(_0x1e35ce,0xc9))[_0xf0ad('0x45')](handleError(_0x1e35ce,null));};exports[_0xf0ad('0x22')]=function(_0x5b18a7,_0x4e8ef5){if(_0x5b18a7[_0xf0ad('0x4b')]['id']){delete _0x5b18a7[_0xf0ad('0x4b')]['id'];}return db[_0xf0ad('0x3f')][_0xf0ad('0x49')]({'where':{'id':_0x5b18a7[_0xf0ad('0x47')]['id']}})[_0xf0ad('0x23')](handleEntityNotFound(_0x4e8ef5,null))[_0xf0ad('0x23')](saveUpdates(_0x5b18a7['body'],null))[_0xf0ad('0x23')](respondWithResult(_0x4e8ef5,null))[_0xf0ad('0x45')](handleError(_0x4e8ef5,null));};exports[_0xf0ad('0x24')]=function(_0xda0e52,_0x2cb082){return db['DeskField'][_0xf0ad('0x49')]({'where':{'id':_0xda0e52[_0xf0ad('0x47')]['id']}})[_0xf0ad('0x23')](handleEntityNotFound(_0x2cb082,null))[_0xf0ad('0x23')](removeEntity(_0x2cb082,null))[_0xf0ad('0x45')](handleError(_0x2cb082,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index dc0ed33..ed07b2d 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 _0xdf57=['bluebird','request-promise','path','rimraf','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','lodash','util','../../config/logger','api','moment'];(function(_0x67db1b,_0x2819c1){var _0x14d5a7=function(_0x163118){while(--_0x163118){_0x67db1b['push'](_0x67db1b['shift']());}};_0x14d5a7(++_0x2819c1);}(_0xdf57,0x109));var _0x7df5=function(_0x33fc57,_0xdd2591){_0x33fc57=_0x33fc57-0x0;var _0xf701ca=_0xdf57[_0x33fc57];return _0xf701ca;};'use strict';var _=require(_0x7df5('0x0'));var util=require(_0x7df5('0x1'));var logger=require(_0x7df5('0x2'))(_0x7df5('0x3'));var moment=require(_0x7df5('0x4'));var BPromise=require(_0x7df5('0x5'));var rp=require(_0x7df5('0x6'));var fs=require('fs');var path=require(_0x7df5('0x7'));var rimraf=require(_0x7df5('0x8'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x7df5('0x9')]=function(_0x42d0a4,_0x5d7a1a){return _0x42d0a4[_0x7df5('0xa')](_0x7df5('0xb'),attributes,{'tableName':_0x7df5('0xc'),'paranoid':![],'indexes':[{'name':_0x7df5('0xd'),'fields':[_0x7df5('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7277=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId'];(function(_0x1e3247,_0x503b69){var _0xe4c89d=function(_0x1307d8){while(--_0x1307d8){_0x1e3247['push'](_0x1e3247['shift']());}};_0xe4c89d(++_0x503b69);}(_0x7277,0x1e0));var _0x7727=function(_0x5534fe,_0x43c22e){_0x5534fe=_0x5534fe-0x0;var _0x3d1dc2=_0x7277[_0x5534fe];return _0x3d1dc2;};'use strict';var _=require(_0x7727('0x0'));var util=require(_0x7727('0x1'));var logger=require(_0x7727('0x2'))(_0x7727('0x3'));var moment=require('moment');var BPromise=require(_0x7727('0x4'));var rp=require(_0x7727('0x5'));var fs=require('fs');var path=require(_0x7727('0x6'));var rimraf=require('rimraf');var config=require(_0x7727('0x7'));var attributes=require('./intDeskField.attributes');module[_0x7727('0x8')]=function(_0x5905d7,_0x105962){return _0x5905d7[_0x7727('0x9')](_0x7727('0xa'),attributes,{'tableName':_0x7727('0xb'),'paranoid':![],'indexes':[{'name':_0x7727('0xc'),'fields':[_0x7727('0xd'),_0x7727('0xe')],'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 7fd7f4b..a475433 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 _0x6577=['request','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','DeskField,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x2ac854,_0x1cb5d){var _0x3f4cd8=function(_0x5700b8){while(--_0x5700b8){_0x2ac854['push'](_0x2ac854['shift']());}};_0x3f4cd8(++_0x1cb5d);}(_0x6577,0x15f));var _0x7657=function(_0x5ec0ab,_0x58f6a0){_0x5ec0ab=_0x5ec0ab-0x0;var _0x347869=_0x6577[_0x5ec0ab];return _0x347869;};'use strict';var _=require(_0x7657('0x0'));var util=require(_0x7657('0x1'));var moment=require(_0x7657('0x2'));var BPromise=require(_0x7657('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7657('0x4'));var logger=require(_0x7657('0x5'))(_0x7657('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7657('0x7')][_0x7657('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d98af,_0x2cfbf5,_0x345ea6){return new BPromise(function(_0x1e9bd7,_0x36196b){return client[_0x7657('0x9')](_0x5d98af,_0x345ea6)['then'](function(_0x68cc48){logger['info']('DeskField,\x20%s,\x20%s',_0x2cfbf5,_0x7657('0xa'));logger['debug'](_0x7657('0xb'),_0x2cfbf5,_0x7657('0xa'),JSON[_0x7657('0xc')](_0x68cc48));if(_0x68cc48['error']){if(_0x68cc48['error'][_0x7657('0xd')]===0x1f4){logger[_0x7657('0xe')](_0x7657('0xf'),_0x2cfbf5,_0x68cc48[_0x7657('0xe')][_0x7657('0x10')]);return _0x36196b(_0x68cc48[_0x7657('0xe')]['message']);}logger['error'](_0x7657('0xf'),_0x2cfbf5,_0x68cc48[_0x7657('0xe')][_0x7657('0x10')]);return _0x1e9bd7(_0x68cc48['error'][_0x7657('0x10')]);}else{logger[_0x7657('0x11')]('DeskField,\x20%s,\x20%s',_0x2cfbf5,_0x7657('0xa'));_0x1e9bd7(_0x68cc48[_0x7657('0x12')][_0x7657('0x10')]);}})[_0x7657('0x13')](function(_0x54ae8d){logger[_0x7657('0xe')]('DeskField,\x20%s,\x20%s',_0x2cfbf5,_0x54ae8d);_0x36196b(_0x54ae8d);});});} \ No newline at end of file +var _0x946a=['result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','DeskField,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x211b9c,_0x3e4a38){var _0x5be03d=function(_0x512424){while(--_0x512424){_0x211b9c['push'](_0x211b9c['shift']());}};_0x5be03d(++_0x3e4a38);}(_0x946a,0x80));var _0xa946=function(_0x57111e,_0x459241){_0x57111e=_0x57111e-0x0;var _0x29bb4f=_0x946a[_0x57111e];return _0x29bb4f;};'use strict';var _=require(_0xa946('0x0'));var util=require(_0xa946('0x1'));var moment=require(_0xa946('0x2'));var BPromise=require(_0xa946('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa946('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa946('0x5'));var logger=require(_0xa946('0x6'))(_0xa946('0x7'));var config=require(_0xa946('0x8'));var jayson=require(_0xa946('0x9'));var client=jayson['client'][_0xa946('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2667ad,_0xff069f,_0x1931c7){return new BPromise(function(_0xa5428e,_0x4cb55a){return client['request'](_0x2667ad,_0x1931c7)['then'](function(_0x5efbea){logger['info'](_0xa946('0xb'),_0xff069f,'request\x20sent');logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0xff069f,_0xa946('0xc'),JSON[_0xa946('0xd')](_0x5efbea));if(_0x5efbea['error']){if(_0x5efbea['error']['code']===0x1f4){logger[_0xa946('0xe')](_0xa946('0xb'),_0xff069f,_0x5efbea[_0xa946('0xe')]['message']);return _0x4cb55a(_0x5efbea[_0xa946('0xe')][_0xa946('0xf')]);}logger[_0xa946('0xe')](_0xa946('0xb'),_0xff069f,_0x5efbea[_0xa946('0xe')]['message']);return _0xa5428e(_0x5efbea[_0xa946('0xe')][_0xa946('0xf')]);}else{logger['info'](_0xa946('0xb'),_0xff069f,_0xa946('0xc'));_0xa5428e(_0x5efbea[_0xa946('0x10')][_0xa946('0xf')]);}})[_0xa946('0x11')](function(_0x29aada){logger['error'](_0xa946('0xb'),_0xff069f,_0x29aada);_0x4cb55a(_0x29aada);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 709be48..20e85c4 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 _0x305f=['../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','post','create','addConfiguration','put','delete','destroy','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x189e7c,_0x1de1c0){var _0xf85261=function(_0x482cbd){while(--_0x482cbd){_0x189e7c['push'](_0x189e7c['shift']());}};_0xf85261(++_0x1de1c0);}(_0x305f,0xd7));var _0xf305=function(_0x21214e,_0x57c489){_0x21214e=_0x21214e-0x0;var _0x43987e=_0x305f[_0x21214e];return _0x43987e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf305('0x0'));var timeout=require('connect-timeout');var express=require(_0xf305('0x1'));var router=express['Router']();var fs_extra=require(_0xf305('0x2'));var auth=require(_0xf305('0x3'));var interaction=require(_0xf305('0x4'));var config=require(_0xf305('0x5'));var controller=require(_0xf305('0x6'));router[_0xf305('0x7')]('/',auth[_0xf305('0x8')](),controller['index']);router[_0xf305('0x7')](_0xf305('0x9'),auth[_0xf305('0x8')](),controller[_0xf305('0xa')]);router['get'](_0xf305('0xb'),auth[_0xf305('0x8')](),controller[_0xf305('0xc')]);router[_0xf305('0x7')]('/:id/fields',auth[_0xf305('0x8')](),controller['getFields']);router[_0xf305('0xd')]('/',auth[_0xf305('0x8')](),controller[_0xf305('0xe')]);router[_0xf305('0xd')](_0xf305('0xb'),auth[_0xf305('0x8')](),controller[_0xf305('0xf')]);router[_0xf305('0x10')]('/:id',auth[_0xf305('0x8')](),controller['update']);router[_0xf305('0x11')](_0xf305('0x9'),auth['isAuthenticated'](),controller[_0xf305('0x12')]);module[_0xf305('0x13')]=router; \ No newline at end of file +var _0xc7c3=['../../components/auth/service','./intDynamics365Account.controller','isAuthenticated','index','get','show','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','put','update','/:id','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xc7c3,0xe3));var _0x3c7c=function(_0x17d68c,_0x24c04d){_0x17d68c=_0x17d68c-0x0;var _0x12784c=_0xc7c3[_0x17d68c];return _0x12784c;};'use strict';var multer=require(_0x3c7c('0x0'));var util=require(_0x3c7c('0x1'));var path=require('path');var timeout=require(_0x3c7c('0x2'));var express=require('express');var router=express[_0x3c7c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3c7c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3c7c('0x5'));router['get']('/',auth[_0x3c7c('0x6')](),controller[_0x3c7c('0x7')]);router[_0x3c7c('0x8')]('/:id',auth[_0x3c7c('0x6')](),controller[_0x3c7c('0x9')]);router[_0x3c7c('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x3c7c('0xa')]);router[_0x3c7c('0x8')]('/:id/fields',auth[_0x3c7c('0x6')](),controller[_0x3c7c('0xb')]);router[_0x3c7c('0xc')]('/',auth[_0x3c7c('0x6')](),controller[_0x3c7c('0xd')]);router[_0x3c7c('0xc')](_0x3c7c('0xe'),auth[_0x3c7c('0x6')](),controller[_0x3c7c('0xf')]);router[_0x3c7c('0x10')]('/:id',auth[_0x3c7c('0x6')](),controller[_0x3c7c('0x11')]);router['delete'](_0x3c7c('0x12'),auth[_0x3c7c('0x6')](),controller[_0x3c7c('0x13')]);module[_0x3c7c('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 03aa0d6..c9f0c95 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 _0x052c=['exports','STRING','sequelize'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x052c,0xe6));var _0xc052=function(_0x32dfe3,_0x1d14c1){_0x32dfe3=_0x32dfe3-0x0;var _0x2ff74c=_0x052c[_0x32dfe3];return _0x2ff74c;};'use strict';var Sequelize=require(_0xc052('0x0'));module[_0xc052('0x1')]={'name':{'type':Sequelize[_0xc052('0x2')]},'username':{'type':Sequelize[_0xc052('0x2')]},'password':{'type':Sequelize[_0xc052('0x2')]},'remoteUri':{'type':Sequelize[_0xc052('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xc052('0x2')]},'serverUrl':{'type':Sequelize[_0xc052('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb12a=['STRING','sequelize','exports'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0xb12a,0x145));var _0xab12=function(_0x4fca62,_0xfe4f5a){_0x4fca62=_0x4fca62-0x0;var _0x28915d=_0xb12a[_0x4fca62];return _0x28915d;};'use strict';var Sequelize=require(_0xab12('0x0'));module[_0xab12('0x1')]={'name':{'type':Sequelize[_0xab12('0x2')]},'username':{'type':Sequelize[_0xab12('0x2')]},'password':{'type':Sequelize[_0xab12('0x2')]},'remoteUri':{'type':Sequelize[_0xab12('0x2')]},'tenantId':{'type':Sequelize[_0xab12('0x2')]},'clientId':{'type':Sequelize[_0xab12('0x2')]},'clientSecret':{'type':Sequelize[_0xab12('0x2')]},'serverUrl':{'type':Sequelize[_0xab12('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index f3a7842..6df3d54 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 _0xf185=['4.0','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','push','isNil','BooleanAttributeMetadata','all','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','LogicalName','DisplayName','UserLocalizedLabel','OptionSet','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','apply','reject','save','update','then','error','stack','name','send','index','map','Dynamics365Account','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','options','find','create','body','destroy','getConfigurations','findOne','Dynamics365Configuration','pick','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidyominame','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','tenantId','clientSecret','remoteUri','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','GET','Bearer\x20','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)'];(function(_0x504428,_0x37c1ab){var _0x3b13cd=function(_0x26848d){while(--_0x26848d){_0x504428['push'](_0x504428['shift']());}};_0x3b13cd(++_0x37c1ab);}(_0xf185,0x1be));var _0x5f18=function(_0x3069ec,_0x2fc991){_0x3069ec=_0x3069ec-0x0;var _0x18d300=_0xf185[_0x3069ec];return _0x18d300;};'use strict';var emlformat=require(_0x5f18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f18('0x1'));var jsonpatch=require(_0x5f18('0x2'));var rp=require(_0x5f18('0x3'));var moment=require(_0x5f18('0x4'));var BPromise=require(_0x5f18('0x5'));var Mustache=require(_0x5f18('0x6'));var util=require('util');var path=require(_0x5f18('0x7'));var sox=require(_0x5f18('0x8'));var csv=require(_0x5f18('0x9'));var ejs=require(_0x5f18('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f18('0xb'));var squel=require(_0x5f18('0xc'));var crypto=require('crypto');var jsforce=require(_0x5f18('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5f18('0x9'));var querystring=require(_0x5f18('0xe'));var Papa=require('papaparse');var Redis=require(_0x5f18('0xf'));var authService=require(_0x5f18('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5f18('0x11'));var hardwareService=require(_0x5f18('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x5f18('0x13'));var config=require(_0x5f18('0x14'));var licenseUtil=require(_0x5f18('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5f18('0x16'));function respondWithStatusCode(_0x2cc94e,_0x332959){_0x332959=_0x332959||0xcc;return function(_0x14debf){if(_0x14debf){return _0x2cc94e[_0x5f18('0x17')](_0x332959);}return _0x2cc94e[_0x5f18('0x18')](_0x332959)[_0x5f18('0x19')]();};}function respondWithResult(_0x31c731,_0x2533ab){_0x2533ab=_0x2533ab||0xc8;return function(_0x4a8150){if(_0x4a8150){return _0x31c731[_0x5f18('0x18')](_0x2533ab)['json'](_0x4a8150);}};}function respondWithFilteredResult(_0x4b2d3e,_0x203f1c){return function(_0x262531){if(_0x262531){var _0x12b0c1=typeof _0x203f1c[_0x5f18('0x1a')]===_0x5f18('0x1b')&&typeof _0x203f1c['limit']===_0x5f18('0x1b');var _0x45cc93=_0x262531[_0x5f18('0x1c')];var _0x2a0bb2=_0x12b0c1?0x0:_0x203f1c[_0x5f18('0x1a')];var _0x50a7ad=_0x12b0c1?_0x262531[_0x5f18('0x1c')]:_0x203f1c[_0x5f18('0x1a')]+_0x203f1c[_0x5f18('0x1d')];var _0x53d6a4;if(_0x50a7ad>=_0x45cc93){_0x50a7ad=_0x45cc93;_0x53d6a4=0xc8;}else{_0x53d6a4=0xce;}_0x4b2d3e[_0x5f18('0x18')](_0x53d6a4);return _0x4b2d3e[_0x5f18('0x1e')]('Content-Range',_0x2a0bb2+'-'+_0x50a7ad+'/'+_0x45cc93)['json'](_0x262531);}return null;};}function patchUpdates(_0x3f493c){return function(_0x185bf6){try{jsonpatch[_0x5f18('0x1f')](_0x185bf6,_0x3f493c,!![]);}catch(_0x265093){return BPromise[_0x5f18('0x20')](_0x265093);}return _0x185bf6[_0x5f18('0x21')]();};}function saveUpdates(_0x569a5b,_0x4c2396){return function(_0x36509a){if(_0x36509a){return _0x36509a[_0x5f18('0x22')](_0x569a5b)['then'](function(_0x29552c){return _0x29552c;});}return null;};}function removeEntity(_0x5c37c2,_0x239af2){return function(_0x50519a){if(_0x50519a){return _0x50519a['destroy']()[_0x5f18('0x23')](function(){_0x5c37c2['status'](0xcc)[_0x5f18('0x19')]();});}};}function handleEntityNotFound(_0x4a2357,_0x394161){return function(_0x463710){if(!_0x463710){_0x4a2357[_0x5f18('0x17')](0x194);}return _0x463710;};}function handleError(_0x298352,_0x541e70){_0x541e70=_0x541e70||0x1f4;return function(_0x444065){logger[_0x5f18('0x24')](_0x444065[_0x5f18('0x25')]);if(_0x444065[_0x5f18('0x26')]){delete _0x444065[_0x5f18('0x26')];}_0x298352[_0x5f18('0x18')](_0x541e70)[_0x5f18('0x27')](_0x444065);};}exports[_0x5f18('0x28')]=function(_0x37e766,_0x554fac){var _0x14a6cc={},_0x5834ef={},_0x59875f={'count':0x0,'rows':[]};var _0x120128=_[_0x5f18('0x29')](db[_0x5f18('0x2a')]['rawAttributes'],function(_0x56617c){return{'name':_0x56617c[_0x5f18('0x2b')],'type':_0x56617c[_0x5f18('0x2c')][_0x5f18('0x2d')]};});_0x5834ef['model']=_[_0x5f18('0x29')](_0x120128,_0x5f18('0x26'));_0x5834ef[_0x5f18('0x2e')]=_['keys'](_0x37e766[_0x5f18('0x2e')]);_0x5834ef[_0x5f18('0x2f')]=_[_0x5f18('0x30')](_0x5834ef[_0x5f18('0x31')],_0x5834ef['query']);_0x14a6cc[_0x5f18('0x32')]=_['intersection'](_0x5834ef[_0x5f18('0x31')],qs[_0x5f18('0x33')](_0x37e766[_0x5f18('0x2e')][_0x5f18('0x33')]));_0x14a6cc[_0x5f18('0x32')]=_0x14a6cc[_0x5f18('0x32')][_0x5f18('0x34')]?_0x14a6cc[_0x5f18('0x32')]:_0x5834ef['model'];if(!_0x37e766[_0x5f18('0x2e')]['hasOwnProperty'](_0x5f18('0x35'))){_0x14a6cc[_0x5f18('0x1d')]=qs[_0x5f18('0x1d')](_0x37e766['query']['limit']);_0x14a6cc[_0x5f18('0x1a')]=qs[_0x5f18('0x1a')](_0x37e766[_0x5f18('0x2e')][_0x5f18('0x1a')]);}_0x14a6cc[_0x5f18('0x36')]=qs[_0x5f18('0x37')](_0x37e766['query'][_0x5f18('0x37')]);_0x14a6cc[_0x5f18('0x38')]=qs[_0x5f18('0x2f')](_['pick'](_0x37e766[_0x5f18('0x2e')],_0x5834ef['filters']),_0x120128);if(_0x37e766['query'][_0x5f18('0x39')]){_0x14a6cc[_0x5f18('0x38')]=_['merge'](_0x14a6cc[_0x5f18('0x38')],{'$or':_['map'](_0x120128,function(_0x3f9da9){if(_0x3f9da9[_0x5f18('0x2c')]!==_0x5f18('0x3a')){var _0x313133={};_0x313133[_0x3f9da9['name']]={'$like':'%'+_0x37e766[_0x5f18('0x2e')][_0x5f18('0x39')]+'%'};return _0x313133;}})});}_0x14a6cc=_[_0x5f18('0x3b')]({},_0x14a6cc,_0x37e766['options']);var _0x44efae={'where':_0x14a6cc[_0x5f18('0x38')]};return db[_0x5f18('0x2a')][_0x5f18('0x1c')](_0x44efae)['then'](function(_0x143c24){_0x59875f[_0x5f18('0x1c')]=_0x143c24;if(_0x37e766[_0x5f18('0x2e')]['includeAll']){_0x14a6cc['include']=[{'all':!![]}];}return db[_0x5f18('0x2a')][_0x5f18('0x3c')](_0x14a6cc);})[_0x5f18('0x23')](function(_0x2d59f9){_0x59875f[_0x5f18('0x3d')]=_0x2d59f9;return _0x59875f;})['then'](respondWithFilteredResult(_0x554fac,_0x14a6cc))[_0x5f18('0x3e')](handleError(_0x554fac,null));};exports[_0x5f18('0x3f')]=function(_0x1f831c,_0x47002b){var _0x59664f={'raw':![],'where':{'id':_0x1f831c[_0x5f18('0x40')]['id']}},_0x1da136={};_0x1da136[_0x5f18('0x31')]=_[_0x5f18('0x41')](db[_0x5f18('0x2a')][_0x5f18('0x42')]);_0x1da136['query']=_[_0x5f18('0x41')](_0x1f831c[_0x5f18('0x2e')]);_0x1da136[_0x5f18('0x2f')]=_[_0x5f18('0x30')](_0x1da136[_0x5f18('0x31')],_0x1da136[_0x5f18('0x2e')]);_0x59664f[_0x5f18('0x32')]=_[_0x5f18('0x30')](_0x1da136[_0x5f18('0x31')],qs[_0x5f18('0x33')](_0x1f831c[_0x5f18('0x2e')]['fields']));_0x59664f['attributes']=_0x59664f[_0x5f18('0x32')][_0x5f18('0x34')]?_0x59664f[_0x5f18('0x32')]:_0x1da136[_0x5f18('0x31')];if(_0x1f831c['query'][_0x5f18('0x43')]){_0x59664f['include']=[{'all':!![]}];}_0x59664f=_[_0x5f18('0x3b')]({},_0x59664f,_0x1f831c[_0x5f18('0x44')]);return db['Dynamics365Account'][_0x5f18('0x45')](_0x59664f)[_0x5f18('0x23')](handleEntityNotFound(_0x47002b,null))[_0x5f18('0x23')](respondWithResult(_0x47002b,null))[_0x5f18('0x3e')](handleError(_0x47002b,null));};exports[_0x5f18('0x46')]=function(_0x2be750,_0x19cbbc){return db['Dynamics365Account'][_0x5f18('0x46')](_0x2be750[_0x5f18('0x47')],{})[_0x5f18('0x23')](respondWithResult(_0x19cbbc,0xc9))[_0x5f18('0x3e')](handleError(_0x19cbbc,null));};exports[_0x5f18('0x22')]=function(_0x4a17ac,_0x4f1db9){if(_0x4a17ac['body']['id']){delete _0x4a17ac[_0x5f18('0x47')]['id'];}return db[_0x5f18('0x2a')][_0x5f18('0x45')]({'where':{'id':_0x4a17ac[_0x5f18('0x40')]['id']}})['then'](handleEntityNotFound(_0x4f1db9,null))[_0x5f18('0x23')](saveUpdates(_0x4a17ac[_0x5f18('0x47')],null))[_0x5f18('0x23')](respondWithResult(_0x4f1db9,null))[_0x5f18('0x3e')](handleError(_0x4f1db9,null));};exports[_0x5f18('0x48')]=function(_0x3ff73d,_0x232c60){return db[_0x5f18('0x2a')][_0x5f18('0x45')]({'where':{'id':_0x3ff73d[_0x5f18('0x40')]['id']}})['then'](handleEntityNotFound(_0x232c60,null))[_0x5f18('0x23')](removeEntity(_0x232c60,null))[_0x5f18('0x3e')](handleError(_0x232c60,null));};exports[_0x5f18('0x49')]=function(_0x5e7c74,_0x154bd0,_0x5381b9){var _0x790a5c={};var _0x154cbd={};var _0x4b12a0;var _0x2bdd45;return db[_0x5f18('0x2a')][_0x5f18('0x4a')]({'where':{'id':_0x5e7c74[_0x5f18('0x40')]['id']}})[_0x5f18('0x23')](handleEntityNotFound(_0x154bd0,null))[_0x5f18('0x23')](function(_0x1b48e5){if(_0x1b48e5){_0x4b12a0=_0x1b48e5;_0x154cbd['model']=_['keys'](db[_0x5f18('0x4b')][_0x5f18('0x42')]);_0x154cbd[_0x5f18('0x2e')]=_[_0x5f18('0x41')](_0x5e7c74['query']);_0x154cbd[_0x5f18('0x2f')]=_[_0x5f18('0x30')](_0x154cbd[_0x5f18('0x31')],_0x154cbd[_0x5f18('0x2e')]);_0x790a5c[_0x5f18('0x32')]=_['intersection'](_0x154cbd[_0x5f18('0x31')],qs[_0x5f18('0x33')](_0x5e7c74['query'][_0x5f18('0x33')]));_0x790a5c[_0x5f18('0x32')]=_0x790a5c[_0x5f18('0x32')][_0x5f18('0x34')]?_0x790a5c[_0x5f18('0x32')]:_0x154cbd[_0x5f18('0x31')];_0x790a5c['order']=qs['sort'](_0x5e7c74['query']['sort']);_0x790a5c['where']=qs[_0x5f18('0x2f')](_[_0x5f18('0x4c')](_0x5e7c74[_0x5f18('0x2e')],_0x154cbd[_0x5f18('0x2f')]));if(_0x5e7c74[_0x5f18('0x2e')][_0x5f18('0x39')]){_0x790a5c[_0x5f18('0x38')]=_[_0x5f18('0x3b')](_0x790a5c[_0x5f18('0x38')],{'$or':_[_0x5f18('0x29')](_0x790a5c[_0x5f18('0x32')],function(_0x38c3af){var _0x17d77c={};_0x17d77c[_0x38c3af]={'$like':'%'+_0x5e7c74['query'][_0x5f18('0x39')]+'%'};return _0x17d77c;})});}_0x790a5c=_[_0x5f18('0x3b')]({},_0x790a5c,_0x5e7c74[_0x5f18('0x44')]);return _0x4b12a0[_0x5f18('0x49')](_0x790a5c);}})[_0x5f18('0x23')](function(_0x329f4e){if(_0x329f4e){_0x2bdd45=_0x329f4e[_0x5f18('0x34')];if(!_0x5e7c74[_0x5f18('0x2e')][_0x5f18('0x4d')]('nolimit')){_0x790a5c[_0x5f18('0x1d')]=qs[_0x5f18('0x1d')](_0x5e7c74[_0x5f18('0x2e')]['limit']);_0x790a5c[_0x5f18('0x1a')]=qs[_0x5f18('0x1a')](_0x5e7c74['query'][_0x5f18('0x1a')]);}return _0x4b12a0[_0x5f18('0x49')](_0x790a5c);}})[_0x5f18('0x23')](function(_0x2bcee3){if(_0x2bcee3){return _0x2bcee3?{'count':_0x2bdd45,'rows':_0x2bcee3}:null;}})[_0x5f18('0x23')](respondWithResult(_0x154bd0,null))[_0x5f18('0x3e')](handleError(_0x154bd0,null));};exports[_0x5f18('0x4e')]=function(_0x38d2fc,_0x339cbb,_0x462fe7){if(_0x38d2fc[_0x5f18('0x47')]['id']){delete _0x38d2fc[_0x5f18('0x47')]['id'];}return db[_0x5f18('0x2a')][_0x5f18('0x4a')]({'where':{'id':_0x38d2fc[_0x5f18('0x40')]['id']}})[_0x5f18('0x23')](handleEntityNotFound(_0x339cbb,null))['then'](function(_0x48536b){if(_0x48536b){_0x38d2fc[_0x5f18('0x47')][_0x5f18('0x4f')]=_0x48536b['id'];_0x38d2fc['body'][_0x5f18('0x50')]=integrations['getSubjects'](_0x38d2fc['body'][_0x5f18('0x51')],_0x38d2fc['body']['type']);_0x38d2fc[_0x5f18('0x47')][_0x5f18('0x52')]=integrations[_0x5f18('0x53')](_0x38d2fc[_0x5f18('0x47')][_0x5f18('0x51')],_0x38d2fc[_0x5f18('0x47')]['type']);return db[_0x5f18('0x4b')][_0x5f18('0x46')](_0x38d2fc[_0x5f18('0x47')],{'include':[{'model':db[_0x5f18('0x54')],'as':_0x5f18('0x50')},{'model':db[_0x5f18('0x54')],'as':_0x5f18('0x52')}]});}return null;})[_0x5f18('0x23')](respondWithResult(_0x339cbb,null))['catch'](handleError(_0x339cbb,null));};exports[_0x5f18('0x55')]=function(_0x3e49df,_0x3ca723,_0x30e0ae){var _0x2438e5=_0x3e49df[_0x5f18('0x2e')][_0x5f18('0x56')];var _0x21e42b=_0x2438e5===_0x5f18('0x57')?'Incident':_0x5f18('0x58');var _0xa13a95='';var _0x150b8d='';var _0x4c3747='';var _0x36b11e='';var _0x4090ee='';var _0x3d886e='';var _0x5c69a5='';var _0x3f8938='';var _0x4d8dd9=[_0x5f18('0x59'),_0x5f18('0x5a'),_0x5f18('0x5b'),_0x5f18('0x5c'),_0x5f18('0x5d'),_0x5f18('0x5e'),'phonenumber',_0x5f18('0x5f'),_0x5f18('0x60'),_0x5f18('0x61')];var _0x58d1d5=[_0x5f18('0x62'),_0x5f18('0x63'),'actualserviceunits',_0x5f18('0x64'),_0x5f18('0x65'),'contactidyominame',_0x5f18('0x66'),_0x5f18('0x67'),_0x5f18('0x68'),_0x5f18('0x69'),'createdbyname','createdbyyominame',_0x5f18('0x6a'),_0x5f18('0x6b'),_0x5f18('0x6c'),_0x5f18('0x6d'),_0x5f18('0x6e'),_0x5f18('0x6f'),_0x5f18('0x70'),_0x5f18('0x71'),_0x5f18('0x72'),_0x5f18('0x73'),_0x5f18('0x74'),_0x5f18('0x75'),_0x5f18('0x76'),_0x5f18('0x77'),_0x5f18('0x78'),_0x5f18('0x79'),_0x5f18('0x7a'),_0x5f18('0x7b'),'masteridname',_0x5f18('0x7c'),_0x5f18('0x7d'),_0x5f18('0x7e'),_0x5f18('0x7f'),'modifiedon','modifiedonbehalfbyname',_0x5f18('0x80'),_0x5f18('0x81'),'msdyn_iotalertname',_0x5f18('0x82'),_0x5f18('0x83'),_0x5f18('0x84'),_0x5f18('0x85'),_0x5f18('0x86'),_0x5f18('0x87'),'parentcaseidname','primarycontactidname',_0x5f18('0x88'),'prioritycodename',_0x5f18('0x89'),'productserialnumber',_0x5f18('0x8a'),_0x5f18('0x8b'),_0x5f18('0x8c'),_0x5f18('0x8d'),_0x5f18('0x8e'),'sentimentvalue',_0x5f18('0x8f'),_0x5f18('0x90'),_0x5f18('0x91'),_0x5f18('0x92'),_0x5f18('0x93'),_0x5f18('0x94'),_0x5f18('0x95'),_0x5f18('0x96'),_0x5f18('0x97'),_0x5f18('0x98'),_0x5f18('0x99'),'versionnumber'];var _0x1cbee0=_0x4d8dd9[_0x5f18('0x9a')](_0x58d1d5);return db['Dynamics365Account']['findOne']({'where':{'id':_0x3e49df[_0x5f18('0x40')]['id']},'attributes':['id',_0x5f18('0x9b'),_0x5f18('0x9c'),'remoteUri',_0x5f18('0x9d'),'clientId',_0x5f18('0x9e')]})[_0x5f18('0x23')](handleEntityNotFound(_0x3ca723,null))[_0x5f18('0x23')](function(_0x55ca2f){if(_0x55ca2f){_0x3f8938=_0x55ca2f[_0x5f18('0x9f')];var _0x18376e=_0x3f8938[_0x5f18('0xa0')](-0x1);if(_0x18376e==='/'){_0x3f8938=_0x3f8938[_0x5f18('0xa1')](0x0,_0x3f8938[_0x5f18('0xa2')](_0x18376e));}_0x5c69a5=util[_0x5f18('0xa3')](_0x5f18('0xa4'),_0x3f8938);var _0xb64432={'method':_0x5f18('0xa5'),'uri':_0x5f18('0xa6')+_0x55ca2f['tenantId']+_0x5f18('0xa7'),'form':{'client_id':_0x55ca2f['clientId'],'resource':_0x3f8938,'username':_0x55ca2f[_0x5f18('0x9b')],'password':_0x55ca2f[_0x5f18('0x9c')],'grant_type':_0x5f18('0x9c'),'client_secret':_0x55ca2f[_0x5f18('0x9e')]},'json':!![]};return rp(_0xb64432);}})[_0x5f18('0x23')](function(_0x53bd2a){_0x3d886e=_0x53bd2a['access_token'];var _0x3abf1d={'method':_0x5f18('0xa8'),'uri':encodeURI(_0x5c69a5+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x21e42b+'\x27'),'headers':{'Authorization':_0x5f18('0xa9')+_0x3d886e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3abf1d);})[_0x5f18('0x23')](function(_0x236af4){var _0x42b6de=_0x236af4['value'][0x0];var _0x8156d5=_0x42b6de[_0x5f18('0xaa')];var _0x238e00={'method':_0x5f18('0xa8'),'uri':_0x5c69a5+'EntityDefinitions('+_0x8156d5+_0x5f18('0xab'),'headers':{'Authorization':_0x5f18('0xa9')+_0x3d886e,'If-None-Match':null,'OData-Version':_0x5f18('0xac')},'json':!![]};return rp(_0x238e00);})[_0x5f18('0x23')](function(_0x32bda6){_0xa13a95=_0x32bda6;_0x150b8d=_0xa13a95['Attributes'];_0x150b8d=_[_0x5f18('0xad')](_0x150b8d,function(_0x139af8){return!_0x1cbee0[_0x5f18('0xae')](_0x139af8['LogicalName']);});var _0x86e3df=[];var _0x1f78f7=[];_0x150b8d[_0x5f18('0xaf')](function(_0x3cd2b6){if(_0x3cd2b6[_0x5f18('0xb0')]){var _0x29e80d=_0x3cd2b6[_0x5f18('0xb0')][_0x5f18('0xa1')](_0x3cd2b6[_0x5f18('0xb0')][_0x5f18('0xa2')]('.')+0x1);if(_0x29e80d===_0x5f18('0xb1')){_0x86e3df[_0x5f18('0xb2')](getSelectList(_0x5c69a5,_0x2438e5,_0x1f78f7,_0xa13a95[_0x5f18('0xaa')],_0x3cd2b6[_0x5f18('0xaa')],_0x3d886e));}}});return Promise['all'](_0x86e3df);})[_0x5f18('0x23')](function(_0x40720d){_0x4c3747=_0x40720d[0x0];var _0x3f461d=[];var _0x1d25c5=[];_0x150b8d['forEach'](function(_0x2a958c){if(!_[_0x5f18('0xb3')](_0x2a958c[_0x5f18('0xb0')])){var _0x3471ac=_0x2a958c[_0x5f18('0xb0')][_0x5f18('0xa1')](_0x2a958c['@odata.type'][_0x5f18('0xa2')]('.')+0x1);if(_0x3471ac===_0x5f18('0xb4')){_0x3f461d['push'](getBooleanList(_0x5c69a5,_0x2438e5,_0x1d25c5,_0xa13a95[_0x5f18('0xaa')],_0x2a958c[_0x5f18('0xaa')],_0x3d886e));}}});return Promise[_0x5f18('0xb5')](_0x3f461d);})[_0x5f18('0x23')](function(_0x4c8186){_0x36b11e=_0x4c8186[0x0];var _0x18487f=[];var _0xc212e7=[];_0x150b8d['forEach'](function(_0x29d029){if(_0x29d029[_0x5f18('0xb0')]){var _0x3c8b47=_0x29d029[_0x5f18('0xb0')]['substring'](_0x29d029[_0x5f18('0xb0')][_0x5f18('0xa2')]('.')+0x1);if(_0x3c8b47==='StringAttributeMetadata'||_0x3c8b47==='DoubleAttributeMetadata'||_0x3c8b47==='BigIntAttributeMetadata'||_0x3c8b47===_0x5f18('0xb6')||_0x3c8b47==='MemoAttributeMetadata'||_0x3c8b47===_0x5f18('0xb7')||_0x3c8b47===_0x5f18('0xb8')||_0x3c8b47===_0x5f18('0xb9')||_0x3c8b47===_0x5f18('0xba')||_0x3c8b47===_0x5f18('0xbb')){_0x18487f['push'](getInputList(_0x5c69a5,_0x2438e5,_0x3c8b47,_0xc212e7,_0xa13a95[_0x5f18('0xaa')],_0x29d029[_0x5f18('0xaa')],_0x3d886e));}}});return Promise[_0x5f18('0xb5')](_0x18487f);})[_0x5f18('0x23')](function(_0x569eab){_0x4090ee=_0x569eab[0x0];var _0x4d605f=_0x4c3747[_0x5f18('0x9a')](_0x36b11e)['concat'](_0x4090ee);var _0x2b2a6b={'count':_0x4d605f[_0x5f18('0x34')],'rows':_0x4d605f};return _0x2b2a6b;})[_0x5f18('0x23')](respondWithResult(_0x3ca723,null))[_0x5f18('0x3e')](function(_0x593915){var _0x2f0846=_0x3e49df[_0x5f18('0x2e')][_0x5f18('0xbc')]?0x1f4:_0x593915[_0x5f18('0xbd')]||0x1f4;logger['error'](_0x593915[_0x5f18('0x25')]);delete _0x593915['name'];if(_0x2f0846===0x191){_0x2f0846=0x190;}_0x3ca723[_0x5f18('0x18')](_0x2f0846)['send'](_0x3e49df['query'][_0x5f18('0xbc')]?{'message':_0x5f18('0xbe'),'statusCode':_0x593915['statusCode']}:_0x593915);});};function getSelectList(_0x624ce0,_0x2f634a,_0x36be16,_0x22080c,_0x10d6b3,_0x2261cb){var _0x2c1e2d={'method':_0x5f18('0xa8'),'uri':_0x624ce0+_0x5f18('0xbf')+_0x22080c+_0x5f18('0xc0')+_0x10d6b3+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x5f18('0xc1'),'headers':{'Authorization':_0x5f18('0xa9')+_0x2261cb,'If-None-Match':null,'OData-Version':_0x5f18('0xac')},'json':!![]};return rp(_0x2c1e2d)[_0x5f18('0x23')](function(_0x67b03f){var _0x1d88ca=[];var _0x2ed420=_0x67b03f['OptionSet'][_0x5f18('0xc2')];_0x2ed420[_0x5f18('0xaf')](function(_0x5e9765){_0x1d88ca[_0x5f18('0xb2')]({'name':_0x5e9765[_0x5f18('0xc3')]['UserLocalizedLabel'][_0x5f18('0xc3')],'value':String(_0x5e9765['Value'])});});var _0x319c4e={'id':_0x2f634a+'_'+_0x67b03f[_0x5f18('0xc4')],'name':_0x67b03f[_0x5f18('0xc5')][_0x5f18('0xc6')][_0x5f18('0xc3')],'custom':![],'options':_0x1d88ca};_0x36be16['push'](_0x319c4e);return _0x36be16;});}function getBooleanList(_0x300f6d,_0x3e177b,_0x467e18,_0x2e4b35,_0x5767a2,_0x239e66){var _0x5412e5={'method':_0x5f18('0xa8'),'uri':_0x300f6d+'EntityDefinitions('+_0x2e4b35+_0x5f18('0xc0')+_0x5767a2+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x5f18('0xa9')+_0x239e66,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5412e5)['then'](function(_0x6d129a){var _0x119000=[];_0x119000[_0x5f18('0xb2')]({'name':_0x6d129a[_0x5f18('0xc7')][_0x5f18('0xc8')][_0x5f18('0xc3')][_0x5f18('0xc6')]['Label'],'value':_0x5f18('0xc9')},{'name':_0x6d129a[_0x5f18('0xc7')][_0x5f18('0xca')][_0x5f18('0xc3')][_0x5f18('0xc6')][_0x5f18('0xc3')],'value':_0x5f18('0xcb')});var _0x1cb62e={'id':_0x3e177b+'_'+_0x6d129a[_0x5f18('0xc4')],'name':_0x6d129a['DisplayName']['UserLocalizedLabel'][_0x5f18('0xc3')],'custom':![],'options':_0x119000};_0x467e18[_0x5f18('0xb2')](_0x1cb62e);return _0x467e18;});}function getInputList(_0x2e4f9c,_0x42b212,_0x2bb45f,_0x57c0de,_0x4ae531,_0x2641eb,_0x10002f){var _0x443d86={'method':_0x5f18('0xa8'),'uri':_0x2e4f9c+'EntityDefinitions('+_0x4ae531+')/Attributes('+_0x2641eb+_0x5f18('0xcc')+_0x2bb45f+_0x5f18('0xcd'),'headers':{'Authorization':_0x5f18('0xa9')+_0x10002f,'If-None-Match':null,'OData-Version':_0x5f18('0xac')},'json':!![]};return rp(_0x443d86)['then'](function(_0x371a7e){var _0xb24bca={'id':_0x42b212+'_'+_0x371a7e[_0x5f18('0xc4')],'name':_0x371a7e['DisplayName']['UserLocalizedLabel']?_0x371a7e[_0x5f18('0xc5')][_0x5f18('0xc6')]['Label']:_0x371a7e[_0x5f18('0xc4')],'custom':![],'options':[]};_0x57c0de[_0x5f18('0xb2')](_0xb24bca);return _0x57c0de;});} \ No newline at end of file +var _0xe06f=['customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientSecret','slice','lastIndexOf','%s/api/data/v9.0/','POST','/oauth2/token','clientId','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','all','isNil','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','Value','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption',')/Microsoft.Dynamics.CRM.','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','stack','name','send','index','map','Dynamics365Account','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','body','find','destroy','Dynamics365Configuration','getConfigurations','addConfiguration','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','Subjects','getFields','ticketType','incident','Incident','title','description','subject','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname'];(function(_0x5e866d,_0x38e26a){var _0x4ab63f=function(_0x473d12){while(--_0x473d12){_0x5e866d['push'](_0x5e866d['shift']());}};_0x4ab63f(++_0x38e26a);}(_0xe06f,0x65));var _0xfe06=function(_0x52611c,_0x1cc52a){_0x52611c=_0x52611c-0x0;var _0x2cf550=_0xe06f[_0x52611c];return _0x2cf550;};'use strict';var emlformat=require(_0xfe06('0x0'));var rimraf=require(_0xfe06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe06('0x2'));var rp=require('request-promise');var moment=require(_0xfe06('0x3'));var BPromise=require(_0xfe06('0x4'));var Mustache=require(_0xfe06('0x5'));var util=require(_0xfe06('0x6'));var path=require(_0xfe06('0x7'));var sox=require(_0xfe06('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe06('0x9'));var squel=require(_0xfe06('0xa'));var crypto=require(_0xfe06('0xb'));var jsforce=require(_0xfe06('0xc'));var deskjs=require(_0xfe06('0xd'));var toCsv=require(_0xfe06('0xe'));var querystring=require('querystring');var Papa=require(_0xfe06('0xf'));var Redis=require(_0xfe06('0x10'));var authService=require(_0xfe06('0x11'));var qs=require(_0xfe06('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe06('0x13'));var logger=require(_0xfe06('0x14'))(_0xfe06('0x15'));var utils=require(_0xfe06('0x16'));var config=require(_0xfe06('0x17'));var licenseUtil=require(_0xfe06('0x18'));var db=require(_0xfe06('0x19'))['db'];var integrations=require(_0xfe06('0x1a'));function respondWithStatusCode(_0x576efe,_0xbb32db){_0xbb32db=_0xbb32db||0xcc;return function(_0x106662){if(_0x106662){return _0x576efe[_0xfe06('0x1b')](_0xbb32db);}return _0x576efe[_0xfe06('0x1c')](_0xbb32db)['end']();};}function respondWithResult(_0x5a91b5,_0x3e44dd){_0x3e44dd=_0x3e44dd||0xc8;return function(_0x5290be){if(_0x5290be){return _0x5a91b5[_0xfe06('0x1c')](_0x3e44dd)[_0xfe06('0x1d')](_0x5290be);}};}function respondWithFilteredResult(_0x4dd976,_0x54dd69){return function(_0x7b243f){if(_0x7b243f){var _0x2c3276=typeof _0x54dd69[_0xfe06('0x1e')]===_0xfe06('0x1f')&&typeof _0x54dd69[_0xfe06('0x20')]===_0xfe06('0x1f');var _0x388a7f=_0x7b243f['count'];var _0x377f5d=_0x2c3276?0x0:_0x54dd69[_0xfe06('0x1e')];var _0xaf4e43=_0x2c3276?_0x7b243f[_0xfe06('0x21')]:_0x54dd69[_0xfe06('0x1e')]+_0x54dd69['limit'];var _0x54c6b3;if(_0xaf4e43>=_0x388a7f){_0xaf4e43=_0x388a7f;_0x54c6b3=0xc8;}else{_0x54c6b3=0xce;}_0x4dd976['status'](_0x54c6b3);return _0x4dd976[_0xfe06('0x22')](_0xfe06('0x23'),_0x377f5d+'-'+_0xaf4e43+'/'+_0x388a7f)[_0xfe06('0x1d')](_0x7b243f);}return null;};}function patchUpdates(_0x4775b5){return function(_0x176e2a){try{jsonpatch['apply'](_0x176e2a,_0x4775b5,!![]);}catch(_0x5b68f9){return BPromise[_0xfe06('0x24')](_0x5b68f9);}return _0x176e2a[_0xfe06('0x25')]();};}function saveUpdates(_0x4dd52d,_0x37974d){return function(_0xc53dfa){if(_0xc53dfa){return _0xc53dfa[_0xfe06('0x26')](_0x4dd52d)[_0xfe06('0x27')](function(_0x288487){return _0x288487;});}return null;};}function removeEntity(_0x5b58e5,_0x39468e){return function(_0x51f5bd){if(_0x51f5bd){return _0x51f5bd['destroy']()[_0xfe06('0x27')](function(){_0x5b58e5['status'](0xcc)[_0xfe06('0x28')]();});}};}function handleEntityNotFound(_0x27a507,_0x470530){return function(_0x327f09){if(!_0x327f09){_0x27a507['sendStatus'](0x194);}return _0x327f09;};}function handleError(_0x10c227,_0x2c2146){_0x2c2146=_0x2c2146||0x1f4;return function(_0x2386b6){logger['error'](_0x2386b6[_0xfe06('0x29')]);if(_0x2386b6['name']){delete _0x2386b6[_0xfe06('0x2a')];}_0x10c227['status'](_0x2c2146)[_0xfe06('0x2b')](_0x2386b6);};}exports[_0xfe06('0x2c')]=function(_0x3f8536,_0x353b3c){var _0x12d6a5={},_0x2e8407={},_0x53bcd3={'count':0x0,'rows':[]};var _0x2d8994=_[_0xfe06('0x2d')](db[_0xfe06('0x2e')][_0xfe06('0x2f')],function(_0x22f33e){return{'name':_0x22f33e['fieldName'],'type':_0x22f33e['type'][_0xfe06('0x30')]};});_0x2e8407[_0xfe06('0x31')]=_['map'](_0x2d8994,_0xfe06('0x2a'));_0x2e8407[_0xfe06('0x32')]=_[_0xfe06('0x33')](_0x3f8536['query']);_0x2e8407[_0xfe06('0x34')]=_[_0xfe06('0x35')](_0x2e8407[_0xfe06('0x31')],_0x2e8407['query']);_0x12d6a5[_0xfe06('0x36')]=_[_0xfe06('0x35')](_0x2e8407[_0xfe06('0x31')],qs[_0xfe06('0x37')](_0x3f8536[_0xfe06('0x32')][_0xfe06('0x37')]));_0x12d6a5['attributes']=_0x12d6a5[_0xfe06('0x36')][_0xfe06('0x38')]?_0x12d6a5['attributes']:_0x2e8407[_0xfe06('0x31')];if(!_0x3f8536[_0xfe06('0x32')][_0xfe06('0x39')](_0xfe06('0x3a'))){_0x12d6a5[_0xfe06('0x20')]=qs[_0xfe06('0x20')](_0x3f8536[_0xfe06('0x32')][_0xfe06('0x20')]);_0x12d6a5['offset']=qs['offset'](_0x3f8536[_0xfe06('0x32')][_0xfe06('0x1e')]);}_0x12d6a5[_0xfe06('0x3b')]=qs['sort'](_0x3f8536[_0xfe06('0x32')][_0xfe06('0x3c')]);_0x12d6a5[_0xfe06('0x3d')]=qs['filters'](_[_0xfe06('0x3e')](_0x3f8536[_0xfe06('0x32')],_0x2e8407['filters']),_0x2d8994);if(_0x3f8536[_0xfe06('0x32')][_0xfe06('0x3f')]){_0x12d6a5[_0xfe06('0x3d')]=_['merge'](_0x12d6a5[_0xfe06('0x3d')],{'$or':_[_0xfe06('0x2d')](_0x2d8994,function(_0x20d0f9){if(_0x20d0f9[_0xfe06('0x40')]!==_0xfe06('0x41')){var _0x2643cb={};_0x2643cb[_0x20d0f9[_0xfe06('0x2a')]]={'$like':'%'+_0x3f8536['query'][_0xfe06('0x3f')]+'%'};return _0x2643cb;}})});}_0x12d6a5=_[_0xfe06('0x42')]({},_0x12d6a5,_0x3f8536[_0xfe06('0x43')]);var _0x5201d0={'where':_0x12d6a5[_0xfe06('0x3d')]};return db[_0xfe06('0x2e')][_0xfe06('0x21')](_0x5201d0)[_0xfe06('0x27')](function(_0x1a9ab8){_0x53bcd3['count']=_0x1a9ab8;if(_0x3f8536[_0xfe06('0x32')][_0xfe06('0x44')]){_0x12d6a5[_0xfe06('0x45')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xfe06('0x46')](_0x12d6a5);})[_0xfe06('0x27')](function(_0x31bd3e){_0x53bcd3['rows']=_0x31bd3e;return _0x53bcd3;})['then'](respondWithFilteredResult(_0x353b3c,_0x12d6a5))[_0xfe06('0x47')](handleError(_0x353b3c,null));};exports['show']=function(_0x3adecb,_0x3e9595){var _0x34de98={'raw':![],'where':{'id':_0x3adecb[_0xfe06('0x48')]['id']}},_0x22d830={};_0x22d830[_0xfe06('0x31')]=_[_0xfe06('0x33')](db[_0xfe06('0x2e')][_0xfe06('0x2f')]);_0x22d830[_0xfe06('0x32')]=_[_0xfe06('0x33')](_0x3adecb[_0xfe06('0x32')]);_0x22d830[_0xfe06('0x34')]=_['intersection'](_0x22d830[_0xfe06('0x31')],_0x22d830[_0xfe06('0x32')]);_0x34de98[_0xfe06('0x36')]=_['intersection'](_0x22d830[_0xfe06('0x31')],qs[_0xfe06('0x37')](_0x3adecb['query'][_0xfe06('0x37')]));_0x34de98[_0xfe06('0x36')]=_0x34de98[_0xfe06('0x36')][_0xfe06('0x38')]?_0x34de98[_0xfe06('0x36')]:_0x22d830[_0xfe06('0x31')];if(_0x3adecb[_0xfe06('0x32')]['includeAll']){_0x34de98[_0xfe06('0x45')]=[{'all':!![]}];}_0x34de98=_[_0xfe06('0x42')]({},_0x34de98,_0x3adecb[_0xfe06('0x43')]);return db[_0xfe06('0x2e')]['find'](_0x34de98)[_0xfe06('0x27')](handleEntityNotFound(_0x3e9595,null))[_0xfe06('0x27')](respondWithResult(_0x3e9595,null))['catch'](handleError(_0x3e9595,null));};exports['create']=function(_0x1ad78a,_0x5c431e){return db[_0xfe06('0x2e')]['create'](_0x1ad78a[_0xfe06('0x49')],{})[_0xfe06('0x27')](respondWithResult(_0x5c431e,0xc9))[_0xfe06('0x47')](handleError(_0x5c431e,null));};exports[_0xfe06('0x26')]=function(_0x518245,_0x58f4c0){if(_0x518245['body']['id']){delete _0x518245[_0xfe06('0x49')]['id'];}return db['Dynamics365Account'][_0xfe06('0x4a')]({'where':{'id':_0x518245[_0xfe06('0x48')]['id']}})['then'](handleEntityNotFound(_0x58f4c0,null))[_0xfe06('0x27')](saveUpdates(_0x518245[_0xfe06('0x49')],null))['then'](respondWithResult(_0x58f4c0,null))[_0xfe06('0x47')](handleError(_0x58f4c0,null));};exports[_0xfe06('0x4b')]=function(_0x5a9777,_0x47b181){return db[_0xfe06('0x2e')][_0xfe06('0x4a')]({'where':{'id':_0x5a9777['params']['id']}})['then'](handleEntityNotFound(_0x47b181,null))['then'](removeEntity(_0x47b181,null))[_0xfe06('0x47')](handleError(_0x47b181,null));};exports['getConfigurations']=function(_0x4d2eae,_0x54f7b8,_0x40dfef){var _0x32474c={};var _0x22f457={};var _0x4ebe8c;var _0x1d56a8;return db[_0xfe06('0x2e')]['findOne']({'where':{'id':_0x4d2eae['params']['id']}})['then'](handleEntityNotFound(_0x54f7b8,null))[_0xfe06('0x27')](function(_0x521c2b){if(_0x521c2b){_0x4ebe8c=_0x521c2b;_0x22f457['model']=_[_0xfe06('0x33')](db[_0xfe06('0x4c')][_0xfe06('0x2f')]);_0x22f457['query']=_['keys'](_0x4d2eae[_0xfe06('0x32')]);_0x22f457[_0xfe06('0x34')]=_[_0xfe06('0x35')](_0x22f457[_0xfe06('0x31')],_0x22f457['query']);_0x32474c[_0xfe06('0x36')]=_[_0xfe06('0x35')](_0x22f457[_0xfe06('0x31')],qs[_0xfe06('0x37')](_0x4d2eae[_0xfe06('0x32')][_0xfe06('0x37')]));_0x32474c[_0xfe06('0x36')]=_0x32474c['attributes']['length']?_0x32474c[_0xfe06('0x36')]:_0x22f457['model'];_0x32474c[_0xfe06('0x3b')]=qs['sort'](_0x4d2eae['query'][_0xfe06('0x3c')]);_0x32474c[_0xfe06('0x3d')]=qs['filters'](_[_0xfe06('0x3e')](_0x4d2eae['query'],_0x22f457[_0xfe06('0x34')]));if(_0x4d2eae[_0xfe06('0x32')][_0xfe06('0x3f')]){_0x32474c['where']=_['merge'](_0x32474c[_0xfe06('0x3d')],{'$or':_[_0xfe06('0x2d')](_0x32474c[_0xfe06('0x36')],function(_0x50d306){var _0x54d4a0={};_0x54d4a0[_0x50d306]={'$like':'%'+_0x4d2eae['query'][_0xfe06('0x3f')]+'%'};return _0x54d4a0;})});}_0x32474c=_['merge']({},_0x32474c,_0x4d2eae[_0xfe06('0x43')]);return _0x4ebe8c[_0xfe06('0x4d')](_0x32474c);}})[_0xfe06('0x27')](function(_0x359a6a){if(_0x359a6a){_0x1d56a8=_0x359a6a[_0xfe06('0x38')];if(!_0x4d2eae[_0xfe06('0x32')]['hasOwnProperty'](_0xfe06('0x3a'))){_0x32474c[_0xfe06('0x20')]=qs[_0xfe06('0x20')](_0x4d2eae[_0xfe06('0x32')][_0xfe06('0x20')]);_0x32474c['offset']=qs[_0xfe06('0x1e')](_0x4d2eae['query'][_0xfe06('0x1e')]);}return _0x4ebe8c[_0xfe06('0x4d')](_0x32474c);}})[_0xfe06('0x27')](function(_0x5637a4){if(_0x5637a4){return _0x5637a4?{'count':_0x1d56a8,'rows':_0x5637a4}:null;}})[_0xfe06('0x27')](respondWithResult(_0x54f7b8,null))[_0xfe06('0x47')](handleError(_0x54f7b8,null));};exports[_0xfe06('0x4e')]=function(_0x5e3cde,_0x26fe86,_0xc0278d){if(_0x5e3cde[_0xfe06('0x49')]['id']){delete _0x5e3cde[_0xfe06('0x49')]['id'];}return db[_0xfe06('0x2e')]['findOne']({'where':{'id':_0x5e3cde[_0xfe06('0x48')]['id']}})[_0xfe06('0x27')](handleEntityNotFound(_0x26fe86,null))[_0xfe06('0x27')](function(_0x3f57ad){if(_0x3f57ad){_0x5e3cde[_0xfe06('0x49')]['AccountId']=_0x3f57ad['id'];_0x5e3cde[_0xfe06('0x49')]['Subjects']=integrations[_0xfe06('0x4f')](_0x5e3cde[_0xfe06('0x49')]['channel'],_0x5e3cde[_0xfe06('0x49')][_0xfe06('0x40')]);_0x5e3cde[_0xfe06('0x49')][_0xfe06('0x50')]=integrations[_0xfe06('0x51')](_0x5e3cde[_0xfe06('0x49')][_0xfe06('0x52')],_0x5e3cde[_0xfe06('0x49')]['type']);return db['Dynamics365Configuration']['create'](_0x5e3cde[_0xfe06('0x49')],{'include':[{'model':db[_0xfe06('0x53')],'as':_0xfe06('0x54')},{'model':db[_0xfe06('0x53')],'as':_0xfe06('0x50')}]});}return null;})[_0xfe06('0x27')](respondWithResult(_0x26fe86,null))[_0xfe06('0x47')](handleError(_0x26fe86,null));};exports[_0xfe06('0x55')]=function(_0x566f92,_0x4929c0,_0x3d03a4){var _0x43bc62=_0x566f92[_0xfe06('0x32')][_0xfe06('0x56')];var _0x521d49=_0x43bc62===_0xfe06('0x57')?_0xfe06('0x58'):'PhoneCall';var _0x3193e8='';var _0x18c7dc='';var _0x173d47='';var _0x156278='';var _0xf54c35='';var _0x2d1bc6='';var _0x38d633='';var _0x3b4001='';var _0x8aa35c=[_0xfe06('0x59'),_0xfe06('0x5a'),'customerid','ownerid','caseorigincode',_0xfe06('0x5b'),_0xfe06('0x5c'),'regardingobjectid',_0xfe06('0x5d'),_0xfe06('0x5e')];var _0x11f2be=[_0xfe06('0x5f'),_0xfe06('0x60'),_0xfe06('0x61'),_0xfe06('0x62'),_0xfe06('0x63'),_0xfe06('0x64'),_0xfe06('0x65'),_0xfe06('0x66'),_0xfe06('0x67'),_0xfe06('0x68'),_0xfe06('0x69'),_0xfe06('0x6a'),'createdon',_0xfe06('0x6b'),'createdonbehalfbyyominame',_0xfe06('0x6c'),_0xfe06('0x6d'),_0xfe06('0x6e'),_0xfe06('0x6f'),_0xfe06('0x70'),_0xfe06('0x71'),_0xfe06('0x72'),_0xfe06('0x73'),_0xfe06('0x74'),_0xfe06('0x75'),'followupby','importsequencenumber',_0xfe06('0x76'),'kbarticleidname',_0xfe06('0x77'),_0xfe06('0x78'),_0xfe06('0x79'),_0xfe06('0x7a'),'modifiedbyname','modifiedbyyominame',_0xfe06('0x7b'),_0xfe06('0x7c'),_0xfe06('0x7d'),_0xfe06('0x7e'),_0xfe06('0x7f'),'numberofchildincidents',_0xfe06('0x80'),_0xfe06('0x81'),_0xfe06('0x82'),'owneridtype',_0xfe06('0x83'),_0xfe06('0x84'),_0xfe06('0x85'),_0xfe06('0x86'),'prioritycodename',_0xfe06('0x87'),_0xfe06('0x88'),_0xfe06('0x89'),_0xfe06('0x8a'),_0xfe06('0x8b'),_0xfe06('0x8c'),_0xfe06('0x8d'),_0xfe06('0x8e'),_0xfe06('0x8f'),'slaname',_0xfe06('0x90'),_0xfe06('0x91'),_0xfe06('0x92'),_0xfe06('0x93'),_0xfe06('0x94'),'timezoneruleversionnumber',_0xfe06('0x95'),_0xfe06('0x96'),_0xfe06('0x97'),_0xfe06('0x98')];var _0x5e57c4=_0x8aa35c[_0xfe06('0x99')](_0x11f2be);return db[_0xfe06('0x2e')]['findOne']({'where':{'id':_0x566f92['params']['id']},'attributes':['id',_0xfe06('0x9a'),_0xfe06('0x9b'),_0xfe06('0x9c'),_0xfe06('0x9d'),'clientId',_0xfe06('0x9e')]})[_0xfe06('0x27')](handleEntityNotFound(_0x4929c0,null))[_0xfe06('0x27')](function(_0xc95cb6){if(_0xc95cb6){_0x3b4001=_0xc95cb6['remoteUri'];var _0x5eae0c=_0x3b4001[_0xfe06('0x9f')](-0x1);if(_0x5eae0c==='/'){_0x3b4001=_0x3b4001['substring'](0x0,_0x3b4001[_0xfe06('0xa0')](_0x5eae0c));}_0x38d633=util['format'](_0xfe06('0xa1'),_0x3b4001);var _0x5a7274={'method':_0xfe06('0xa2'),'uri':'https://login.microsoftonline.com/'+_0xc95cb6['tenantId']+_0xfe06('0xa3'),'form':{'client_id':_0xc95cb6[_0xfe06('0xa4')],'resource':_0x3b4001,'username':_0xc95cb6[_0xfe06('0x9a')],'password':_0xc95cb6[_0xfe06('0x9b')],'grant_type':_0xfe06('0x9b'),'client_secret':_0xc95cb6[_0xfe06('0x9e')]},'json':!![]};return rp(_0x5a7274);}})[_0xfe06('0x27')](function(_0x384a4b){_0x2d1bc6=_0x384a4b[_0xfe06('0xa5')];var _0x4bb24d={'method':_0xfe06('0xa6'),'uri':encodeURI(_0x38d633+_0xfe06('0xa7')+_0x521d49+'\x27'),'headers':{'Authorization':_0xfe06('0xa8')+_0x2d1bc6,'If-None-Match':null,'OData-Version':_0xfe06('0xa9')},'json':!![]};return rp(_0x4bb24d);})[_0xfe06('0x27')](function(_0x2d2fc3){var _0x4c29ac=_0x2d2fc3[_0xfe06('0xaa')][0x0];var _0x56cf7e=_0x4c29ac[_0xfe06('0xab')];var _0x2e9cca={'method':_0xfe06('0xa6'),'uri':_0x38d633+_0xfe06('0xac')+_0x56cf7e+_0xfe06('0xad'),'headers':{'Authorization':_0xfe06('0xa8')+_0x2d1bc6,'If-None-Match':null,'OData-Version':_0xfe06('0xa9')},'json':!![]};return rp(_0x2e9cca);})[_0xfe06('0x27')](function(_0x13d4ad){_0x3193e8=_0x13d4ad;_0x18c7dc=_0x3193e8[_0xfe06('0xae')];_0x18c7dc=_[_0xfe06('0xaf')](_0x18c7dc,function(_0x145346){return!_0x5e57c4[_0xfe06('0xb0')](_0x145346[_0xfe06('0xb1')]);});var _0x65e098=[];var _0xb6071f=[];_0x18c7dc[_0xfe06('0xb2')](function(_0x1fee0d){if(_0x1fee0d[_0xfe06('0xb3')]){var _0x357085=_0x1fee0d['@odata.type'][_0xfe06('0xb4')](_0x1fee0d[_0xfe06('0xb3')][_0xfe06('0xa0')]('.')+0x1);if(_0x357085===_0xfe06('0xb5')){_0x65e098[_0xfe06('0xb6')](getSelectList(_0x38d633,_0x43bc62,_0xb6071f,_0x3193e8[_0xfe06('0xab')],_0x1fee0d[_0xfe06('0xab')],_0x2d1bc6));}}});return Promise[_0xfe06('0xb7')](_0x65e098);})['then'](function(_0x10374a){_0x173d47=_0x10374a[0x0];var _0x161045=[];var _0x2a6f32=[];_0x18c7dc[_0xfe06('0xb2')](function(_0x45bd00){if(!_[_0xfe06('0xb8')](_0x45bd00['@odata.type'])){var _0x3a7fff=_0x45bd00[_0xfe06('0xb3')][_0xfe06('0xb4')](_0x45bd00[_0xfe06('0xb3')][_0xfe06('0xa0')]('.')+0x1);if(_0x3a7fff==='BooleanAttributeMetadata'){_0x161045['push'](getBooleanList(_0x38d633,_0x43bc62,_0x2a6f32,_0x3193e8[_0xfe06('0xab')],_0x45bd00['MetadataId'],_0x2d1bc6));}}});return Promise[_0xfe06('0xb7')](_0x161045);})[_0xfe06('0x27')](function(_0x3db5a3){_0x156278=_0x3db5a3[0x0];var _0x3ac4c5=[];var _0x172627=[];_0x18c7dc[_0xfe06('0xb2')](function(_0x31b9d9){if(_0x31b9d9[_0xfe06('0xb3')]){var _0x2e3a41=_0x31b9d9['@odata.type'][_0xfe06('0xb4')](_0x31b9d9[_0xfe06('0xb3')][_0xfe06('0xa0')]('.')+0x1);if(_0x2e3a41==='StringAttributeMetadata'||_0x2e3a41==='DoubleAttributeMetadata'||_0x2e3a41===_0xfe06('0xb9')||_0x2e3a41===_0xfe06('0xba')||_0x2e3a41===_0xfe06('0xbb')||_0x2e3a41===_0xfe06('0xbc')||_0x2e3a41===_0xfe06('0xbd')||_0x2e3a41==='EntityNameAttributeMetadata'||_0x2e3a41===_0xfe06('0xbe')||_0x2e3a41===_0xfe06('0xbf')){_0x3ac4c5['push'](getInputList(_0x38d633,_0x43bc62,_0x2e3a41,_0x172627,_0x3193e8[_0xfe06('0xab')],_0x31b9d9[_0xfe06('0xab')],_0x2d1bc6));}}});return Promise[_0xfe06('0xb7')](_0x3ac4c5);})[_0xfe06('0x27')](function(_0x6cdbd3){_0xf54c35=_0x6cdbd3[0x0];var _0x45bde7=_0x173d47['concat'](_0x156278)['concat'](_0xf54c35);var _0x41fd47={'count':_0x45bde7[_0xfe06('0x38')],'rows':_0x45bde7};return _0x41fd47;})[_0xfe06('0x27')](respondWithResult(_0x4929c0,null))['catch'](function(_0x278c4a){var _0x167c83=_0x566f92[_0xfe06('0x32')][_0xfe06('0xc0')]?0x1f4:_0x278c4a[_0xfe06('0xc1')]||0x1f4;logger['error'](_0x278c4a[_0xfe06('0x29')]);delete _0x278c4a[_0xfe06('0x2a')];if(_0x167c83===0x191){_0x167c83=0x190;}_0x4929c0[_0xfe06('0x1c')](_0x167c83)[_0xfe06('0x2b')](_0x566f92[_0xfe06('0x32')][_0xfe06('0xc0')]?{'message':_0xfe06('0xc2'),'statusCode':_0x278c4a[_0xfe06('0xc1')]}:_0x278c4a);});};function getSelectList(_0x5f0ea5,_0x435906,_0x496def,_0x183fc7,_0x4f67ec,_0x4b094b){var _0x59f855={'method':_0xfe06('0xa6'),'uri':_0x5f0ea5+'EntityDefinitions('+_0x183fc7+_0xfe06('0xc3')+_0x4f67ec+_0xfe06('0xc4')+_0xfe06('0xc5'),'headers':{'Authorization':_0xfe06('0xa8')+_0x4b094b,'If-None-Match':null,'OData-Version':_0xfe06('0xa9')},'json':!![]};return rp(_0x59f855)[_0xfe06('0x27')](function(_0x47c07f){var _0x2ac2c8=[];var _0x476fa3=_0x47c07f['OptionSet'][_0xfe06('0xc6')];_0x476fa3[_0xfe06('0xb2')](function(_0x4f85fa){_0x2ac2c8[_0xfe06('0xb6')]({'name':_0x4f85fa[_0xfe06('0xc7')]['UserLocalizedLabel']['Label'],'value':String(_0x4f85fa[_0xfe06('0xc8')])});});var _0x147a64={'id':_0x435906+'_'+_0x47c07f[_0xfe06('0xb1')],'name':_0x47c07f[_0xfe06('0xc9')][_0xfe06('0xca')][_0xfe06('0xc7')],'custom':![],'options':_0x2ac2c8};_0x496def[_0xfe06('0xb6')](_0x147a64);return _0x496def;});}function getBooleanList(_0x58d078,_0x14a07f,_0x40f009,_0x226a23,_0x7e6267,_0xfaf1ce){var _0x55e9b0={'method':_0xfe06('0xa6'),'uri':_0x58d078+_0xfe06('0xac')+_0x226a23+_0xfe06('0xc3')+_0x7e6267+_0xfe06('0xcb'),'headers':{'Authorization':'Bearer\x20'+_0xfaf1ce,'If-None-Match':null,'OData-Version':_0xfe06('0xa9')},'json':!![]};return rp(_0x55e9b0)[_0xfe06('0x27')](function(_0x47fb4c){var _0x525f82=[];_0x525f82[_0xfe06('0xb6')]({'name':_0x47fb4c[_0xfe06('0xcc')][_0xfe06('0xcd')][_0xfe06('0xc7')][_0xfe06('0xca')][_0xfe06('0xc7')],'value':_0xfe06('0xce')},{'name':_0x47fb4c['OptionSet'][_0xfe06('0xcf')][_0xfe06('0xc7')][_0xfe06('0xca')][_0xfe06('0xc7')],'value':'false'});var _0x763374={'id':_0x14a07f+'_'+_0x47fb4c[_0xfe06('0xb1')],'name':_0x47fb4c['DisplayName'][_0xfe06('0xca')][_0xfe06('0xc7')],'custom':![],'options':_0x525f82};_0x40f009[_0xfe06('0xb6')](_0x763374);return _0x40f009;});}function getInputList(_0x6817e0,_0x331acb,_0x2aa478,_0x2451fd,_0x44dff5,_0x3b04a8,_0x56eec3){var _0x21f4dd={'method':_0xfe06('0xa6'),'uri':_0x6817e0+_0xfe06('0xac')+_0x44dff5+_0xfe06('0xc3')+_0x3b04a8+_0xfe06('0xd0')+_0x2aa478+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xfe06('0xa8')+_0x56eec3,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x21f4dd)['then'](function(_0x10b3b8){var _0x17acb2={'id':_0x331acb+'_'+_0x10b3b8[_0xfe06('0xb1')],'name':_0x10b3b8[_0xfe06('0xc9')][_0xfe06('0xca')]?_0x10b3b8['DisplayName'][_0xfe06('0xca')][_0xfe06('0xc7')]:_0x10b3b8['LogicalName'],'custom':![],'options':[]};_0x2451fd[_0xfe06('0xb6')](_0x17acb2);return _0x2451fd;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index f449466..7efc972 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x3ecbfd,_0x377dcf){var _0xc55d1b=function(_0x159869){while(--_0x159869){_0x3ecbfd['push'](_0x3ecbfd['shift']());}};_0xc55d1b(++_0x377dcf);}(_0xb7e7,0x121));var _0x7b7e=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb7e7[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x45e2ff,_0x3bbae1){var _0x531370=function(_0x2a2afe){while(--_0x2a2afe){_0x45e2ff['push'](_0x45e2ff['shift']());}};_0x531370(++_0x3bbae1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 3439915..bedffed 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 _0x59c3=['raw','where','attributes','limit','include','map','model','stringify','then','ShowDynamics365Account','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Account,\x20%s,\x20%s','message','info','request\x20sent','result','catch','GetDynamics365Account','options'];(function(_0x62c646,_0xa08641){var _0x2385f3=function(_0x45b92b){while(--_0x45b92b){_0x62c646['push'](_0x62c646['shift']());}};_0x2385f3(++_0xa08641);}(_0x59c3,0x175));var _0x359c=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x59c3[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x359c('0x0'));var util=require(_0x359c('0x1'));var moment=require(_0x359c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x359c('0x3'));var db=require(_0x359c('0x4'))['db'];var utils=require(_0x359c('0x5'));var logger=require(_0x359c('0x6'))(_0x359c('0x7'));var config=require(_0x359c('0x8'));var jayson=require(_0x359c('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x634c76,_0x102498,_0x44ab43){return new BPromise(function(_0x174dc9,_0x31d9d2){return client[_0x359c('0xa')](_0x634c76,_0x44ab43)['then'](function(_0x4827c3){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x102498,'request\x20sent');logger[_0x359c('0xb')](_0x359c('0xc'),_0x102498,'request\x20sent',JSON['stringify'](_0x4827c3));if(_0x4827c3[_0x359c('0xd')]){if(_0x4827c3[_0x359c('0xd')][_0x359c('0xe')]===0x1f4){logger[_0x359c('0xd')](_0x359c('0xf'),_0x102498,_0x4827c3[_0x359c('0xd')][_0x359c('0x10')]);return _0x31d9d2(_0x4827c3['error'][_0x359c('0x10')]);}logger['error'](_0x359c('0xf'),_0x102498,_0x4827c3[_0x359c('0xd')][_0x359c('0x10')]);return _0x174dc9(_0x4827c3[_0x359c('0xd')][_0x359c('0x10')]);}else{logger[_0x359c('0x11')](_0x359c('0xf'),_0x102498,_0x359c('0x12'));_0x174dc9(_0x4827c3[_0x359c('0x13')][_0x359c('0x10')]);}})[_0x359c('0x14')](function(_0x346318){logger[_0x359c('0xd')](_0x359c('0xf'),_0x102498,_0x346318);_0x31d9d2(_0x346318);});});}exports[_0x359c('0x15')]=function(_0x12f664){var _0x5ab96c=this;return new Promise(function(_0x56f590,_0x37e925){return db['Dynamics365Account']['findAll']({'raw':_0x12f664[_0x359c('0x16')]?_0x12f664['options'][_0x359c('0x17')]===undefined?!![]:![]:!![],'where':_0x12f664[_0x359c('0x16')]?_0x12f664[_0x359c('0x16')][_0x359c('0x18')]||null:null,'attributes':_0x12f664[_0x359c('0x16')]?_0x12f664['options'][_0x359c('0x19')]||null:null,'limit':_0x12f664[_0x359c('0x16')]?_0x12f664['options'][_0x359c('0x1a')]||null:null,'include':_0x12f664[_0x359c('0x16')]?_0x12f664[_0x359c('0x16')][_0x359c('0x1b')]?_[_0x359c('0x1c')](_0x12f664['options']['include'],function(_0x232cf3){return{'model':db[_0x232cf3['model']],'as':_0x232cf3['as'],'attributes':_0x232cf3['attributes'],'include':_0x232cf3[_0x359c('0x1b')]?_[_0x359c('0x1c')](_0x232cf3[_0x359c('0x1b')],function(_0x1e6b85){return{'model':db[_0x1e6b85[_0x359c('0x1d')]],'as':_0x1e6b85['as'],'attributes':_0x1e6b85[_0x359c('0x19')],'include':_0x1e6b85[_0x359c('0x1b')]?_[_0x359c('0x1c')](_0x1e6b85[_0x359c('0x1b')],function(_0x2c9da9){return{'model':db[_0x2c9da9[_0x359c('0x1d')]],'as':_0x2c9da9['as'],'attributes':_0x2c9da9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x476926){logger[_0x359c('0x11')](_0x359c('0x15'),_0x12f664);logger['debug'](_0x359c('0x15'),_0x12f664,JSON[_0x359c('0x1e')](_0x476926));_0x56f590(_0x476926);})[_0x359c('0x14')](function(_0x424fbc){logger[_0x359c('0xd')](_0x359c('0x15'),_0x424fbc['message'],_0x12f664);_0x37e925(_0x5ab96c[_0x359c('0xd')](0x1f4,_0x424fbc[_0x359c('0x10')]));});});};exports['ShowDynamics365Account']=function(_0x950c8e){var _0x297a74=this;return new Promise(function(_0x3a539e,_0x89fe0d){return db['Dynamics365Account']['find']({'raw':_0x950c8e['options']?_0x950c8e['options'][_0x359c('0x17')]===undefined?!![]:![]:!![],'where':_0x950c8e[_0x359c('0x16')]?_0x950c8e[_0x359c('0x16')]['where']||null:null,'attributes':_0x950c8e[_0x359c('0x16')]?_0x950c8e['options'][_0x359c('0x19')]||null:null,'include':_0x950c8e[_0x359c('0x16')]?_0x950c8e[_0x359c('0x16')]['include']?_[_0x359c('0x1c')](_0x950c8e[_0x359c('0x16')][_0x359c('0x1b')],function(_0x5ca99e){return{'model':db[_0x5ca99e[_0x359c('0x1d')]],'as':_0x5ca99e['as'],'attributes':_0x5ca99e[_0x359c('0x19')],'include':_0x5ca99e[_0x359c('0x1b')]?_['map'](_0x5ca99e[_0x359c('0x1b')],function(_0x147e63){return{'model':db[_0x147e63[_0x359c('0x1d')]],'as':_0x147e63['as'],'attributes':_0x147e63['attributes'],'include':_0x147e63[_0x359c('0x1b')]?_[_0x359c('0x1c')](_0x147e63[_0x359c('0x1b')],function(_0x3ad0c7){return{'model':db[_0x3ad0c7[_0x359c('0x1d')]],'as':_0x3ad0c7['as'],'attributes':_0x3ad0c7[_0x359c('0x19')]};}):[]};}):[]};}):[]:[]})[_0x359c('0x1f')](function(_0x192412){logger['info'](_0x359c('0x20'),_0x950c8e);logger['debug'](_0x359c('0x20'),_0x950c8e,JSON[_0x359c('0x1e')](_0x192412));_0x3a539e(_0x192412);})[_0x359c('0x14')](function(_0x5ee46b){logger[_0x359c('0xd')]('ShowDynamics365Account',_0x5ee46b[_0x359c('0x10')],_0x950c8e);_0x89fe0d(_0x297a74['error'](0x1f4,_0x5ee46b['message']));});});}; \ No newline at end of file +var _0x1363=['error','message','result','GetDynamics365Account','options','where','attributes','limit','include','map','model','ShowDynamics365Account','Dynamics365Account','find','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x715c4d,_0x5dd5df){var _0x4cc30b=function(_0x14403f){while(--_0x14403f){_0x715c4d['push'](_0x715c4d['shift']());}};_0x4cc30b(++_0x5dd5df);}(_0x1363,0x16d));var _0x3136=function(_0x5c49b6,_0x45cc2a){_0x5c49b6=_0x5c49b6-0x0;var _0x1740ff=_0x1363[_0x5c49b6];return _0x1740ff;};'use strict';var _=require(_0x3136('0x0'));var util=require(_0x3136('0x1'));var moment=require(_0x3136('0x2'));var BPromise=require(_0x3136('0x3'));var rs=require(_0x3136('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3136('0x5'))['db'];var utils=require(_0x3136('0x6'));var logger=require('../../config/logger')(_0x3136('0x7'));var config=require(_0x3136('0x8'));var jayson=require(_0x3136('0x9'));var client=jayson[_0x3136('0xa')][_0x3136('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x434228,_0x22e58f,_0x55d453){return new BPromise(function(_0x34c3cc,_0x4fe719){return client[_0x3136('0xc')](_0x434228,_0x55d453)[_0x3136('0xd')](function(_0x294ecc){logger[_0x3136('0xe')](_0x3136('0xf'),_0x22e58f,'request\x20sent');logger[_0x3136('0x10')](_0x3136('0x11'),_0x22e58f,_0x3136('0x12'),JSON[_0x3136('0x13')](_0x294ecc));if(_0x294ecc[_0x3136('0x14')]){if(_0x294ecc[_0x3136('0x14')]['code']===0x1f4){logger[_0x3136('0x14')](_0x3136('0xf'),_0x22e58f,_0x294ecc[_0x3136('0x14')][_0x3136('0x15')]);return _0x4fe719(_0x294ecc[_0x3136('0x14')][_0x3136('0x15')]);}logger[_0x3136('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x22e58f,_0x294ecc[_0x3136('0x14')][_0x3136('0x15')]);return _0x34c3cc(_0x294ecc['error']['message']);}else{logger[_0x3136('0xe')](_0x3136('0xf'),_0x22e58f,_0x3136('0x12'));_0x34c3cc(_0x294ecc[_0x3136('0x16')][_0x3136('0x15')]);}})['catch'](function(_0x5e2f5e){logger[_0x3136('0x14')](_0x3136('0xf'),_0x22e58f,_0x5e2f5e);_0x4fe719(_0x5e2f5e);});});}exports[_0x3136('0x17')]=function(_0x2105d4){var _0x1da77b=this;return new Promise(function(_0x2f7ad3,_0x405005){return db['Dynamics365Account']['findAll']({'raw':_0x2105d4[_0x3136('0x18')]?_0x2105d4[_0x3136('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2105d4[_0x3136('0x18')]?_0x2105d4['options'][_0x3136('0x19')]||null:null,'attributes':_0x2105d4[_0x3136('0x18')]?_0x2105d4[_0x3136('0x18')][_0x3136('0x1a')]||null:null,'limit':_0x2105d4[_0x3136('0x18')]?_0x2105d4['options'][_0x3136('0x1b')]||null:null,'include':_0x2105d4[_0x3136('0x18')]?_0x2105d4[_0x3136('0x18')][_0x3136('0x1c')]?_[_0x3136('0x1d')](_0x2105d4[_0x3136('0x18')][_0x3136('0x1c')],function(_0x4f73fc){return{'model':db[_0x4f73fc[_0x3136('0x1e')]],'as':_0x4f73fc['as'],'attributes':_0x4f73fc[_0x3136('0x1a')],'include':_0x4f73fc[_0x3136('0x1c')]?_['map'](_0x4f73fc[_0x3136('0x1c')],function(_0x57abd4){return{'model':db[_0x57abd4['model']],'as':_0x57abd4['as'],'attributes':_0x57abd4[_0x3136('0x1a')],'include':_0x57abd4[_0x3136('0x1c')]?_[_0x3136('0x1d')](_0x57abd4[_0x3136('0x1c')],function(_0x551f7b){return{'model':db[_0x551f7b[_0x3136('0x1e')]],'as':_0x551f7b['as'],'attributes':_0x551f7b[_0x3136('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3136('0xd')](function(_0x54e093){logger[_0x3136('0xe')](_0x3136('0x17'),_0x2105d4);logger[_0x3136('0x10')](_0x3136('0x17'),_0x2105d4,JSON[_0x3136('0x13')](_0x54e093));_0x2f7ad3(_0x54e093);})['catch'](function(_0x3f9a54){logger['error'](_0x3136('0x17'),_0x3f9a54[_0x3136('0x15')],_0x2105d4);_0x405005(_0x1da77b['error'](0x1f4,_0x3f9a54[_0x3136('0x15')]));});});};exports[_0x3136('0x1f')]=function(_0x1bd3f6){var _0x332b44=this;return new Promise(function(_0x28e061,_0x92bbc6){return db[_0x3136('0x20')][_0x3136('0x21')]({'raw':_0x1bd3f6[_0x3136('0x18')]?_0x1bd3f6[_0x3136('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1bd3f6[_0x3136('0x18')]?_0x1bd3f6[_0x3136('0x18')]['where']||null:null,'attributes':_0x1bd3f6[_0x3136('0x18')]?_0x1bd3f6['options'][_0x3136('0x1a')]||null:null,'include':_0x1bd3f6[_0x3136('0x18')]?_0x1bd3f6[_0x3136('0x18')]['include']?_[_0x3136('0x1d')](_0x1bd3f6[_0x3136('0x18')][_0x3136('0x1c')],function(_0xfd69bc){return{'model':db[_0xfd69bc[_0x3136('0x1e')]],'as':_0xfd69bc['as'],'attributes':_0xfd69bc[_0x3136('0x1a')],'include':_0xfd69bc['include']?_[_0x3136('0x1d')](_0xfd69bc[_0x3136('0x1c')],function(_0x2dab8c){return{'model':db[_0x2dab8c['model']],'as':_0x2dab8c['as'],'attributes':_0x2dab8c[_0x3136('0x1a')],'include':_0x2dab8c[_0x3136('0x1c')]?_['map'](_0x2dab8c[_0x3136('0x1c')],function(_0x2b2e0d){return{'model':db[_0x2b2e0d[_0x3136('0x1e')]],'as':_0x2b2e0d['as'],'attributes':_0x2b2e0d[_0x3136('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3136('0xd')](function(_0x36befc){logger[_0x3136('0xe')](_0x3136('0x1f'),_0x1bd3f6);logger[_0x3136('0x10')]('ShowDynamics365Account',_0x1bd3f6,JSON['stringify'](_0x36befc));_0x28e061(_0x36befc);})[_0x3136('0x22')](function(_0x2cdb67){logger[_0x3136('0x14')](_0x3136('0x1f'),_0x2cdb67[_0x3136('0x15')],_0x1bd3f6);_0x92bbc6(_0x332b44['error'](0x1f4,_0x2cdb67[_0x3136('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index cd59f1a..bfba506 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 _0x930e=['/:id','show','getFields','/:id/descriptions','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x24a2cc,_0x455e1f){var _0x1cf0ad=function(_0x3ad71b){while(--_0x3ad71b){_0x24a2cc['push'](_0x24a2cc['shift']());}};_0x1cf0ad(++_0x455e1f);}(_0x930e,0x66));var _0xe930=function(_0x5e3905,_0x14f174){_0x5e3905=_0x5e3905-0x0;var _0x490d56=_0x930e[_0x5e3905];return _0x490d56;};'use strict';var multer=require(_0xe930('0x0'));var util=require(_0xe930('0x1'));var path=require(_0xe930('0x2'));var timeout=require('connect-timeout');var express=require(_0xe930('0x3'));var router=express[_0xe930('0x4')]();var fs_extra=require(_0xe930('0x5'));var auth=require(_0xe930('0x6'));var interaction=require(_0xe930('0x7'));var config=require(_0xe930('0x8'));var controller=require('./intDynamics365Configuration.controller');router[_0xe930('0x9')]('/',auth[_0xe930('0xa')](),controller[_0xe930('0xb')]);router[_0xe930('0x9')](_0xe930('0xc'),auth['isAuthenticated'](),controller[_0xe930('0xd')]);router[_0xe930('0x9')]('/:id/fields',auth[_0xe930('0xa')](),controller[_0xe930('0xe')]);router[_0xe930('0x9')]('/:id/subjects',auth[_0xe930('0xa')](),controller['getSubjects']);router['get'](_0xe930('0xf'),auth[_0xe930('0xa')](),controller['getDescriptions']);router['post']('/',auth[_0xe930('0xa')](),controller['create']);router['put']('/:id',auth[_0xe930('0xa')](),controller[_0xe930('0x10')]);router[_0xe930('0x11')]('/:id',auth[_0xe930('0xa')](),controller[_0xe930('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3222=['create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getDescriptions','post'];(function(_0x51c745,_0x21ebf9){var _0x39a495=function(_0x39c530){while(--_0x39c530){_0x51c745['push'](_0x51c745['shift']());}};_0x39a495(++_0x21ebf9);}(_0x3222,0xe1));var _0x2322=function(_0x52e9f9,_0x176267){_0x52e9f9=_0x52e9f9-0x0;var _0x3ca0b1=_0x3222[_0x52e9f9];return _0x3ca0b1;};'use strict';var multer=require(_0x2322('0x0'));var util=require(_0x2322('0x1'));var path=require(_0x2322('0x2'));var timeout=require(_0x2322('0x3'));var express=require(_0x2322('0x4'));var router=express[_0x2322('0x5')]();var fs_extra=require(_0x2322('0x6'));var auth=require(_0x2322('0x7'));var interaction=require(_0x2322('0x8'));var config=require(_0x2322('0x9'));var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth[_0x2322('0xa')](),controller[_0x2322('0xb')]);router[_0x2322('0xc')]('/:id',auth[_0x2322('0xa')](),controller[_0x2322('0xd')]);router[_0x2322('0xc')](_0x2322('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x2322('0xc')]('/:id/subjects',auth[_0x2322('0xa')](),controller['getSubjects']);router[_0x2322('0xc')]('/:id/descriptions',auth[_0x2322('0xa')](),controller[_0x2322('0xf')]);router[_0x2322('0x10')]('/',auth[_0x2322('0xa')](),controller[_0x2322('0x11')]);router[_0x2322('0x12')](_0x2322('0x13'),auth[_0x2322('0xa')](),controller['update']);router[_0x2322('0x14')](_0x2322('0x13'),auth[_0x2322('0xa')](),controller['destroy']);module[_0x2322('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 009c1f6..bb0315c 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 _0xd6de=['incident','sequelize','exports','STRING','phonecall'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xd6de,0xfb));var _0xed6d=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xd6de[_0x68c979];return _0x4f0001;};'use strict';var Sequelize=require(_0xed6d('0x0'));module[_0xed6d('0x1')]={'name':{'type':Sequelize[_0xed6d('0x2')]},'description':{'type':Sequelize[_0xed6d('0x2')]},'ticketType':{'type':Sequelize['ENUM']('incident',_0xed6d('0x3')),'defaultValue':_0xed6d('0x4')}}; \ No newline at end of file +var _0xca76=['STRING','incident','sequelize','exports'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xca76,0xce));var _0x6ca7=function(_0x17aa5e,_0x274571){_0x17aa5e=_0x17aa5e-0x0;var _0x5e5429=_0xca76[_0x17aa5e];return _0x5e5429;};'use strict';var Sequelize=require(_0x6ca7('0x0'));module[_0x6ca7('0x1')]={'name':{'type':Sequelize[_0x6ca7('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x6ca7('0x3'),'phonecall'),'defaultValue':_0x6ca7('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index bc9afee..3b45877 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 _0xac80=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','length','includeAll','find','create','body','destroy','findOne','order','getFields','getSubjects','Dynamics365Field','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir'];(function(_0x4515e0,_0x9e00d8){var _0x2b4aa9=function(_0x5ecc87){while(--_0x5ecc87){_0x4515e0['push'](_0x4515e0['shift']());}};_0x2b4aa9(++_0x9e00d8);}(_0xac80,0x139));var _0x0ac8=function(_0xb5eaff,_0x525291){_0xb5eaff=_0xb5eaff-0x0;var _0x4e94cc=_0xac80[_0xb5eaff];return _0x4e94cc;};'use strict';var emlformat=require(_0x0ac8('0x0'));var rimraf=require(_0x0ac8('0x1'));var zipdir=require(_0x0ac8('0x2'));var jsonpatch=require(_0x0ac8('0x3'));var rp=require(_0x0ac8('0x4'));var moment=require(_0x0ac8('0x5'));var BPromise=require(_0x0ac8('0x6'));var Mustache=require(_0x0ac8('0x7'));var util=require(_0x0ac8('0x8'));var path=require(_0x0ac8('0x9'));var sox=require('sox');var csv=require(_0x0ac8('0xa'));var ejs=require(_0x0ac8('0xb'));var fs=require('fs');var fs_extra=require(_0x0ac8('0xc'));var _=require(_0x0ac8('0xd'));var squel=require(_0x0ac8('0xe'));var crypto=require(_0x0ac8('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0ac8('0x10'));var Papa=require('papaparse');var Redis=require(_0x0ac8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0ac8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ac8('0x13'));var logger=require(_0x0ac8('0x14'))(_0x0ac8('0x15'));var utils=require(_0x0ac8('0x16'));var config=require(_0x0ac8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ac8('0x18'))['db'];function respondWithStatusCode(_0x1262ae,_0x53bbbf){_0x53bbbf=_0x53bbbf||0xcc;return function(_0x2653e7){if(_0x2653e7){return _0x1262ae['sendStatus'](_0x53bbbf);}return _0x1262ae[_0x0ac8('0x19')](_0x53bbbf)[_0x0ac8('0x1a')]();};}function respondWithResult(_0x791161,_0x58d1b2){_0x58d1b2=_0x58d1b2||0xc8;return function(_0x3eb351){if(_0x3eb351){return _0x791161[_0x0ac8('0x19')](_0x58d1b2)[_0x0ac8('0x1b')](_0x3eb351);}};}function respondWithFilteredResult(_0x4cd35c,_0x2e658b){return function(_0x2d12a6){if(_0x2d12a6){var _0x304c64=typeof _0x2e658b['offset']==='undefined'&&typeof _0x2e658b['limit']==='undefined';var _0xb3fdaf=_0x2d12a6['count'];var _0x3352da=_0x304c64?0x0:_0x2e658b['offset'];var _0x530040=_0x304c64?_0x2d12a6[_0x0ac8('0x1c')]:_0x2e658b[_0x0ac8('0x1d')]+_0x2e658b[_0x0ac8('0x1e')];var _0x1a766d;if(_0x530040>=_0xb3fdaf){_0x530040=_0xb3fdaf;_0x1a766d=0xc8;}else{_0x1a766d=0xce;}_0x4cd35c['status'](_0x1a766d);return _0x4cd35c['set'](_0x0ac8('0x1f'),_0x3352da+'-'+_0x530040+'/'+_0xb3fdaf)[_0x0ac8('0x1b')](_0x2d12a6);}return null;};}function patchUpdates(_0x4c8281){return function(_0x5f1ccc){try{jsonpatch[_0x0ac8('0x20')](_0x5f1ccc,_0x4c8281,!![]);}catch(_0x17c1c5){return BPromise['reject'](_0x17c1c5);}return _0x5f1ccc[_0x0ac8('0x21')]();};}function saveUpdates(_0x1a7501,_0x5edf03){return function(_0x57671c){if(_0x57671c){return _0x57671c[_0x0ac8('0x22')](_0x1a7501)[_0x0ac8('0x23')](function(_0xa1160b){return _0xa1160b;});}return null;};}function removeEntity(_0xa9c439,_0x1abea5){return function(_0x2e1ef9){if(_0x2e1ef9){return _0x2e1ef9['destroy']()[_0x0ac8('0x23')](function(){_0xa9c439[_0x0ac8('0x19')](0xcc)[_0x0ac8('0x1a')]();});}};}function handleEntityNotFound(_0x9c212d,_0x38d104){return function(_0x516d3f){if(!_0x516d3f){_0x9c212d[_0x0ac8('0x24')](0x194);}return _0x516d3f;};}function handleError(_0xdf9c2f,_0x31c00b){_0x31c00b=_0x31c00b||0x1f4;return function(_0x449c6f){logger[_0x0ac8('0x25')](_0x449c6f[_0x0ac8('0x26')]);if(_0x449c6f['name']){delete _0x449c6f[_0x0ac8('0x27')];}_0xdf9c2f['status'](_0x31c00b)[_0x0ac8('0x28')](_0x449c6f);};}exports[_0x0ac8('0x29')]=function(_0x189cf3,_0x3d360f){var _0x1abba2={},_0x94036f={},_0x317148={'count':0x0,'rows':[]};var _0x56a169=_[_0x0ac8('0x2a')](db[_0x0ac8('0x2b')][_0x0ac8('0x2c')],function(_0x86a5ef){return{'name':_0x86a5ef[_0x0ac8('0x2d')],'type':_0x86a5ef[_0x0ac8('0x2e')]['key']};});_0x94036f[_0x0ac8('0x2f')]=_['map'](_0x56a169,_0x0ac8('0x27'));_0x94036f[_0x0ac8('0x30')]=_[_0x0ac8('0x31')](_0x189cf3[_0x0ac8('0x30')]);_0x94036f[_0x0ac8('0x32')]=_['intersection'](_0x94036f['model'],_0x94036f[_0x0ac8('0x30')]);_0x1abba2[_0x0ac8('0x33')]=_[_0x0ac8('0x34')](_0x94036f['model'],qs[_0x0ac8('0x35')](_0x189cf3[_0x0ac8('0x30')]['fields']));_0x1abba2['attributes']=_0x1abba2[_0x0ac8('0x33')]['length']?_0x1abba2[_0x0ac8('0x33')]:_0x94036f[_0x0ac8('0x2f')];if(!_0x189cf3[_0x0ac8('0x30')]['hasOwnProperty'](_0x0ac8('0x36'))){_0x1abba2[_0x0ac8('0x1e')]=qs[_0x0ac8('0x1e')](_0x189cf3[_0x0ac8('0x30')][_0x0ac8('0x1e')]);_0x1abba2[_0x0ac8('0x1d')]=qs['offset'](_0x189cf3[_0x0ac8('0x30')]['offset']);}_0x1abba2['order']=qs[_0x0ac8('0x37')](_0x189cf3[_0x0ac8('0x30')][_0x0ac8('0x37')]);_0x1abba2[_0x0ac8('0x38')]=qs['filters'](_[_0x0ac8('0x39')](_0x189cf3[_0x0ac8('0x30')],_0x94036f[_0x0ac8('0x32')]),_0x56a169);if(_0x189cf3[_0x0ac8('0x30')][_0x0ac8('0x3a')]){_0x1abba2[_0x0ac8('0x38')]=_[_0x0ac8('0x3b')](_0x1abba2[_0x0ac8('0x38')],{'$or':_[_0x0ac8('0x2a')](_0x56a169,function(_0x8a0863){if(_0x8a0863['type']!==_0x0ac8('0x3c')){var _0x4e5972={};_0x4e5972[_0x8a0863[_0x0ac8('0x27')]]={'$like':'%'+_0x189cf3['query'][_0x0ac8('0x3a')]+'%'};return _0x4e5972;}})});}_0x1abba2=_[_0x0ac8('0x3b')]({},_0x1abba2,_0x189cf3[_0x0ac8('0x3d')]);var _0x2888b3={'where':_0x1abba2[_0x0ac8('0x38')]};return db['Dynamics365Configuration'][_0x0ac8('0x1c')](_0x2888b3)[_0x0ac8('0x23')](function(_0x5ba9d0){_0x317148[_0x0ac8('0x1c')]=_0x5ba9d0;if(_0x189cf3['query']['includeAll']){_0x1abba2[_0x0ac8('0x3e')]=[{'all':!![]}];}return db[_0x0ac8('0x2b')][_0x0ac8('0x3f')](_0x1abba2);})[_0x0ac8('0x23')](function(_0x1b0a1d){_0x317148['rows']=_0x1b0a1d;return _0x317148;})[_0x0ac8('0x23')](respondWithFilteredResult(_0x3d360f,_0x1abba2))[_0x0ac8('0x40')](handleError(_0x3d360f,null));};exports['show']=function(_0x1efa51,_0x5a2bde){var _0x198621={'raw':![],'where':{'id':_0x1efa51[_0x0ac8('0x41')]['id']}},_0x420143={};_0x420143[_0x0ac8('0x2f')]=_['keys'](db[_0x0ac8('0x2b')][_0x0ac8('0x2c')]);_0x420143[_0x0ac8('0x30')]=_[_0x0ac8('0x31')](_0x1efa51[_0x0ac8('0x30')]);_0x420143[_0x0ac8('0x32')]=_['intersection'](_0x420143[_0x0ac8('0x2f')],_0x420143[_0x0ac8('0x30')]);_0x198621[_0x0ac8('0x33')]=_[_0x0ac8('0x34')](_0x420143[_0x0ac8('0x2f')],qs[_0x0ac8('0x35')](_0x1efa51['query']['fields']));_0x198621['attributes']=_0x198621[_0x0ac8('0x33')][_0x0ac8('0x42')]?_0x198621['attributes']:_0x420143['model'];if(_0x1efa51[_0x0ac8('0x30')][_0x0ac8('0x43')]){_0x198621[_0x0ac8('0x3e')]=[{'all':!![]}];}_0x198621=_[_0x0ac8('0x3b')]({},_0x198621,_0x1efa51[_0x0ac8('0x3d')]);return db[_0x0ac8('0x2b')][_0x0ac8('0x44')](_0x198621)[_0x0ac8('0x23')](handleEntityNotFound(_0x5a2bde,null))[_0x0ac8('0x23')](respondWithResult(_0x5a2bde,null))['catch'](handleError(_0x5a2bde,null));};exports[_0x0ac8('0x45')]=function(_0x4ce456,_0x49be0c){return db[_0x0ac8('0x2b')]['create'](_0x4ce456['body'],{})['then'](respondWithResult(_0x49be0c,0xc9))['catch'](handleError(_0x49be0c,null));};exports[_0x0ac8('0x22')]=function(_0x29cb25,_0x13ba01){if(_0x29cb25[_0x0ac8('0x46')]['id']){delete _0x29cb25['body']['id'];}return db[_0x0ac8('0x2b')][_0x0ac8('0x44')]({'where':{'id':_0x29cb25['params']['id']}})[_0x0ac8('0x23')](handleEntityNotFound(_0x13ba01,null))[_0x0ac8('0x23')](saveUpdates(_0x29cb25[_0x0ac8('0x46')],null))[_0x0ac8('0x23')](respondWithResult(_0x13ba01,null))[_0x0ac8('0x40')](handleError(_0x13ba01,null));};exports[_0x0ac8('0x47')]=function(_0x4ead19,_0x60a5f5){return db[_0x0ac8('0x2b')][_0x0ac8('0x44')]({'where':{'id':_0x4ead19[_0x0ac8('0x41')]['id']}})[_0x0ac8('0x23')](handleEntityNotFound(_0x60a5f5,null))[_0x0ac8('0x23')](removeEntity(_0x60a5f5,null))['catch'](handleError(_0x60a5f5,null));};exports['getFields']=function(_0x545551,_0x197a24,_0x4e5756){var _0x5f4316={};var _0x71b284={};var _0x29f334;var _0x4239c9;return db['Dynamics365Configuration'][_0x0ac8('0x48')]({'where':{'id':_0x545551[_0x0ac8('0x41')]['id']}})[_0x0ac8('0x23')](handleEntityNotFound(_0x197a24,null))['then'](function(_0x46dd8c){if(_0x46dd8c){_0x29f334=_0x46dd8c;_0x71b284[_0x0ac8('0x2f')]=_[_0x0ac8('0x31')](db['Dynamics365Field'][_0x0ac8('0x2c')]);_0x71b284[_0x0ac8('0x30')]=_[_0x0ac8('0x31')](_0x545551[_0x0ac8('0x30')]);_0x71b284[_0x0ac8('0x32')]=_[_0x0ac8('0x34')](_0x71b284[_0x0ac8('0x2f')],_0x71b284[_0x0ac8('0x30')]);_0x5f4316['attributes']=_[_0x0ac8('0x34')](_0x71b284[_0x0ac8('0x2f')],qs[_0x0ac8('0x35')](_0x545551[_0x0ac8('0x30')][_0x0ac8('0x35')]));_0x5f4316[_0x0ac8('0x33')]=_0x5f4316['attributes']['length']?_0x5f4316[_0x0ac8('0x33')]:_0x71b284[_0x0ac8('0x2f')];_0x5f4316[_0x0ac8('0x49')]=qs[_0x0ac8('0x37')](_0x545551[_0x0ac8('0x30')][_0x0ac8('0x37')]);_0x5f4316[_0x0ac8('0x38')]=qs[_0x0ac8('0x32')](_[_0x0ac8('0x39')](_0x545551[_0x0ac8('0x30')],_0x71b284[_0x0ac8('0x32')]));if(_0x545551[_0x0ac8('0x30')][_0x0ac8('0x3a')]){_0x5f4316['where']=_[_0x0ac8('0x3b')](_0x5f4316[_0x0ac8('0x38')],{'$or':_['map'](_0x5f4316['attributes'],function(_0x1f772a){var _0x352bc8={};_0x352bc8[_0x1f772a]={'$like':'%'+_0x545551[_0x0ac8('0x30')][_0x0ac8('0x3a')]+'%'};return _0x352bc8;})});}_0x5f4316=_[_0x0ac8('0x3b')]({},_0x5f4316,_0x545551[_0x0ac8('0x3d')]);return _0x29f334[_0x0ac8('0x4a')](_0x5f4316);}})[_0x0ac8('0x23')](function(_0x16d4f8){if(_0x16d4f8){_0x4239c9=_0x16d4f8[_0x0ac8('0x42')];if(!_0x545551[_0x0ac8('0x30')]['hasOwnProperty'](_0x0ac8('0x36'))){_0x5f4316['limit']=qs[_0x0ac8('0x1e')](_0x545551[_0x0ac8('0x30')][_0x0ac8('0x1e')]);_0x5f4316[_0x0ac8('0x1d')]=qs['offset'](_0x545551[_0x0ac8('0x30')][_0x0ac8('0x1d')]);}return _0x29f334[_0x0ac8('0x4a')](_0x5f4316);}})[_0x0ac8('0x23')](function(_0x5efe43){if(_0x5efe43){return _0x5efe43?{'count':_0x4239c9,'rows':_0x5efe43}:null;}})['then'](respondWithResult(_0x197a24,null))[_0x0ac8('0x40')](handleError(_0x197a24,null));};exports[_0x0ac8('0x4b')]=function(_0xdbf8fc,_0x188158,_0x13149f){var _0x207ce7={};var _0x4caac4={};var _0x3ad567;var _0x2c04f7;return db[_0x0ac8('0x2b')]['findOne']({'where':{'id':_0xdbf8fc[_0x0ac8('0x41')]['id']}})[_0x0ac8('0x23')](handleEntityNotFound(_0x188158,null))['then'](function(_0x14886d){if(_0x14886d){_0x3ad567=_0x14886d;_0x4caac4[_0x0ac8('0x2f')]=_[_0x0ac8('0x31')](db[_0x0ac8('0x4c')][_0x0ac8('0x2c')]);_0x4caac4[_0x0ac8('0x30')]=_[_0x0ac8('0x31')](_0xdbf8fc['query']);_0x4caac4[_0x0ac8('0x32')]=_[_0x0ac8('0x34')](_0x4caac4[_0x0ac8('0x2f')],_0x4caac4[_0x0ac8('0x30')]);_0x207ce7[_0x0ac8('0x33')]=_['intersection'](_0x4caac4[_0x0ac8('0x2f')],qs[_0x0ac8('0x35')](_0xdbf8fc[_0x0ac8('0x30')][_0x0ac8('0x35')]));_0x207ce7['attributes']=_0x207ce7[_0x0ac8('0x33')][_0x0ac8('0x42')]?_0x207ce7['attributes']:_0x4caac4[_0x0ac8('0x2f')];_0x207ce7[_0x0ac8('0x49')]=qs[_0x0ac8('0x37')](_0xdbf8fc[_0x0ac8('0x30')][_0x0ac8('0x37')]);_0x207ce7[_0x0ac8('0x38')]=qs[_0x0ac8('0x32')](_['pick'](_0xdbf8fc[_0x0ac8('0x30')],_0x4caac4[_0x0ac8('0x32')]));if(_0xdbf8fc[_0x0ac8('0x30')][_0x0ac8('0x3a')]){_0x207ce7[_0x0ac8('0x38')]=_['merge'](_0x207ce7[_0x0ac8('0x38')],{'$or':_[_0x0ac8('0x2a')](_0x207ce7[_0x0ac8('0x33')],function(_0x2e8aaa){var _0x3b6827={};_0x3b6827[_0x2e8aaa]={'$like':'%'+_0xdbf8fc[_0x0ac8('0x30')][_0x0ac8('0x3a')]+'%'};return _0x3b6827;})});}_0x207ce7=_['merge']({},_0x207ce7,_0xdbf8fc[_0x0ac8('0x3d')]);return _0x3ad567['getSubjects'](_0x207ce7);}})[_0x0ac8('0x23')](function(_0x434dc2){if(_0x434dc2){_0x2c04f7=_0x434dc2[_0x0ac8('0x42')];if(!_0xdbf8fc['query'][_0x0ac8('0x4d')]('nolimit')){_0x207ce7['limit']=qs[_0x0ac8('0x1e')](_0xdbf8fc[_0x0ac8('0x30')][_0x0ac8('0x1e')]);_0x207ce7[_0x0ac8('0x1d')]=qs[_0x0ac8('0x1d')](_0xdbf8fc[_0x0ac8('0x30')][_0x0ac8('0x1d')]);}return _0x3ad567['getSubjects'](_0x207ce7);}})['then'](function(_0x2ef84d){if(_0x2ef84d){return _0x2ef84d?{'count':_0x2c04f7,'rows':_0x2ef84d}:null;}})[_0x0ac8('0x23')](respondWithResult(_0x188158,null))[_0x0ac8('0x40')](handleError(_0x188158,null));};exports[_0x0ac8('0x4e')]=function(_0x3dbb84,_0x2697b8,_0x3dc297){var _0xcca993={};var _0x34fe57={};var _0x491d41;var _0x52dc62;return db[_0x0ac8('0x2b')][_0x0ac8('0x48')]({'where':{'id':_0x3dbb84[_0x0ac8('0x41')]['id']}})['then'](handleEntityNotFound(_0x2697b8,null))[_0x0ac8('0x23')](function(_0x4d6714){if(_0x4d6714){_0x491d41=_0x4d6714;_0x34fe57[_0x0ac8('0x2f')]=_[_0x0ac8('0x31')](db[_0x0ac8('0x4c')][_0x0ac8('0x2c')]);_0x34fe57[_0x0ac8('0x30')]=_[_0x0ac8('0x31')](_0x3dbb84[_0x0ac8('0x30')]);_0x34fe57[_0x0ac8('0x32')]=_['intersection'](_0x34fe57[_0x0ac8('0x2f')],_0x34fe57[_0x0ac8('0x30')]);_0xcca993[_0x0ac8('0x33')]=_[_0x0ac8('0x34')](_0x34fe57[_0x0ac8('0x2f')],qs[_0x0ac8('0x35')](_0x3dbb84[_0x0ac8('0x30')][_0x0ac8('0x35')]));_0xcca993[_0x0ac8('0x33')]=_0xcca993[_0x0ac8('0x33')]['length']?_0xcca993['attributes']:_0x34fe57['model'];_0xcca993[_0x0ac8('0x49')]=qs[_0x0ac8('0x37')](_0x3dbb84['query']['sort']);_0xcca993[_0x0ac8('0x38')]=qs['filters'](_['pick'](_0x3dbb84[_0x0ac8('0x30')],_0x34fe57['filters']));if(_0x3dbb84[_0x0ac8('0x30')][_0x0ac8('0x3a')]){_0xcca993[_0x0ac8('0x38')]=_[_0x0ac8('0x3b')](_0xcca993[_0x0ac8('0x38')],{'$or':_['map'](_0xcca993['attributes'],function(_0x5666f0){var _0x2d1fb8={};_0x2d1fb8[_0x5666f0]={'$like':'%'+_0x3dbb84[_0x0ac8('0x30')][_0x0ac8('0x3a')]+'%'};return _0x2d1fb8;})});}_0xcca993=_[_0x0ac8('0x3b')]({},_0xcca993,_0x3dbb84[_0x0ac8('0x3d')]);return _0x491d41[_0x0ac8('0x4e')](_0xcca993);}})[_0x0ac8('0x23')](function(_0x5bae2a){if(_0x5bae2a){_0x52dc62=_0x5bae2a['length'];if(!_0x3dbb84[_0x0ac8('0x30')]['hasOwnProperty'](_0x0ac8('0x36'))){_0xcca993[_0x0ac8('0x1e')]=qs[_0x0ac8('0x1e')](_0x3dbb84[_0x0ac8('0x30')][_0x0ac8('0x1e')]);_0xcca993[_0x0ac8('0x1d')]=qs[_0x0ac8('0x1d')](_0x3dbb84[_0x0ac8('0x30')][_0x0ac8('0x1d')]);}return _0x491d41[_0x0ac8('0x4e')](_0xcca993);}})[_0x0ac8('0x23')](function(_0x164b3b){if(_0x164b3b){return _0x164b3b?{'count':_0x52dc62,'rows':_0x164b3b}:null;}})[_0x0ac8('0x23')](respondWithResult(_0x2697b8,null))[_0x0ac8('0x40')](handleError(_0x2697b8,null));}; \ No newline at end of file +var _0xe3e2=['name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','where','filter','VIRTUAL','options','includeAll','findAll','rows','then','show','params','Dynamics365Configuration','include','merge','find','catch','create','body','findOne','Dynamics365Field','sort','pick','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','undefined','count','offset','Content-Range','json','apply','save','destroy','error','stack'];(function(_0x4e962a,_0x5a76bb){var _0x1b5e1c=function(_0x3a532a){while(--_0x3a532a){_0x4e962a['push'](_0x4e962a['shift']());}};_0x1b5e1c(++_0x5a76bb);}(_0xe3e2,0x11c));var _0x2e3e=function(_0x538c7e,_0x284174){_0x538c7e=_0x538c7e-0x0;var _0xbf4a37=_0xe3e2[_0x538c7e];return _0xbf4a37;};'use strict';var emlformat=require(_0x2e3e('0x0'));var rimraf=require(_0x2e3e('0x1'));var zipdir=require(_0x2e3e('0x2'));var jsonpatch=require(_0x2e3e('0x3'));var rp=require(_0x2e3e('0x4'));var moment=require(_0x2e3e('0x5'));var BPromise=require(_0x2e3e('0x6'));var Mustache=require('mustache');var util=require(_0x2e3e('0x7'));var path=require(_0x2e3e('0x8'));var sox=require('sox');var csv=require(_0x2e3e('0x9'));var ejs=require(_0x2e3e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2e3e('0xb'));var jsforce=require(_0x2e3e('0xc'));var deskjs=require(_0x2e3e('0xd'));var toCsv=require(_0x2e3e('0x9'));var querystring=require(_0x2e3e('0xe'));var Papa=require(_0x2e3e('0xf'));var Redis=require(_0x2e3e('0x10'));var authService=require(_0x2e3e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2e3e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e3e('0x13'))(_0x2e3e('0x14'));var utils=require(_0x2e3e('0x15'));var config=require(_0x2e3e('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5904f9,_0x3f32c7){_0x3f32c7=_0x3f32c7||0xcc;return function(_0x5b39f5){if(_0x5b39f5){return _0x5904f9[_0x2e3e('0x17')](_0x3f32c7);}return _0x5904f9['status'](_0x3f32c7)[_0x2e3e('0x18')]();};}function respondWithResult(_0x53ae49,_0x43cc9e){_0x43cc9e=_0x43cc9e||0xc8;return function(_0xd6be3a){if(_0xd6be3a){return _0x53ae49[_0x2e3e('0x19')](_0x43cc9e)['json'](_0xd6be3a);}};}function respondWithFilteredResult(_0x17ec17,_0x4f7e6f){return function(_0x497f30){if(_0x497f30){var _0x3559ac=typeof _0x4f7e6f['offset']===_0x2e3e('0x1a')&&typeof _0x4f7e6f['limit']===_0x2e3e('0x1a');var _0x977d2b=_0x497f30[_0x2e3e('0x1b')];var _0x37881b=_0x3559ac?0x0:_0x4f7e6f[_0x2e3e('0x1c')];var _0x5c25a2=_0x3559ac?_0x497f30[_0x2e3e('0x1b')]:_0x4f7e6f['offset']+_0x4f7e6f['limit'];var _0xa52321;if(_0x5c25a2>=_0x977d2b){_0x5c25a2=_0x977d2b;_0xa52321=0xc8;}else{_0xa52321=0xce;}_0x17ec17[_0x2e3e('0x19')](_0xa52321);return _0x17ec17['set'](_0x2e3e('0x1d'),_0x37881b+'-'+_0x5c25a2+'/'+_0x977d2b)[_0x2e3e('0x1e')](_0x497f30);}return null;};}function patchUpdates(_0x3998e9){return function(_0x5b91bb){try{jsonpatch[_0x2e3e('0x1f')](_0x5b91bb,_0x3998e9,!![]);}catch(_0x8ec576){return BPromise['reject'](_0x8ec576);}return _0x5b91bb[_0x2e3e('0x20')]();};}function saveUpdates(_0x26a768,_0x1bcb0a){return function(_0x424d14){if(_0x424d14){return _0x424d14['update'](_0x26a768)['then'](function(_0x485755){return _0x485755;});}return null;};}function removeEntity(_0xc5813e,_0x3d8214){return function(_0x3f7e4a){if(_0x3f7e4a){return _0x3f7e4a[_0x2e3e('0x21')]()['then'](function(){_0xc5813e['status'](0xcc)[_0x2e3e('0x18')]();});}};}function handleEntityNotFound(_0x1e7479,_0x65bd0b){return function(_0xb267fa){if(!_0xb267fa){_0x1e7479[_0x2e3e('0x17')](0x194);}return _0xb267fa;};}function handleError(_0x1af281,_0x1973f5){_0x1973f5=_0x1973f5||0x1f4;return function(_0x5e98a4){logger[_0x2e3e('0x22')](_0x5e98a4[_0x2e3e('0x23')]);if(_0x5e98a4[_0x2e3e('0x24')]){delete _0x5e98a4[_0x2e3e('0x24')];}_0x1af281[_0x2e3e('0x19')](_0x1973f5)[_0x2e3e('0x25')](_0x5e98a4);};}exports[_0x2e3e('0x26')]=function(_0x85dabe,_0x385bed){var _0x1e6bb0={},_0x30a606={},_0x17353d={'count':0x0,'rows':[]};var _0x4b9b70=_[_0x2e3e('0x27')](db['Dynamics365Configuration'][_0x2e3e('0x28')],function(_0x24e943){return{'name':_0x24e943[_0x2e3e('0x29')],'type':_0x24e943[_0x2e3e('0x2a')][_0x2e3e('0x2b')]};});_0x30a606[_0x2e3e('0x2c')]=_[_0x2e3e('0x27')](_0x4b9b70,'name');_0x30a606['query']=_[_0x2e3e('0x2d')](_0x85dabe[_0x2e3e('0x2e')]);_0x30a606[_0x2e3e('0x2f')]=_[_0x2e3e('0x30')](_0x30a606['model'],_0x30a606[_0x2e3e('0x2e')]);_0x1e6bb0['attributes']=_['intersection'](_0x30a606[_0x2e3e('0x2c')],qs[_0x2e3e('0x31')](_0x85dabe[_0x2e3e('0x2e')][_0x2e3e('0x31')]));_0x1e6bb0[_0x2e3e('0x32')]=_0x1e6bb0[_0x2e3e('0x32')][_0x2e3e('0x33')]?_0x1e6bb0[_0x2e3e('0x32')]:_0x30a606[_0x2e3e('0x2c')];if(!_0x85dabe[_0x2e3e('0x2e')]['hasOwnProperty'](_0x2e3e('0x34'))){_0x1e6bb0[_0x2e3e('0x35')]=qs['limit'](_0x85dabe[_0x2e3e('0x2e')][_0x2e3e('0x35')]);_0x1e6bb0['offset']=qs[_0x2e3e('0x1c')](_0x85dabe['query'][_0x2e3e('0x1c')]);}_0x1e6bb0[_0x2e3e('0x36')]=qs['sort'](_0x85dabe['query']['sort']);_0x1e6bb0[_0x2e3e('0x37')]=qs[_0x2e3e('0x2f')](_['pick'](_0x85dabe['query'],_0x30a606[_0x2e3e('0x2f')]),_0x4b9b70);if(_0x85dabe[_0x2e3e('0x2e')][_0x2e3e('0x38')]){_0x1e6bb0[_0x2e3e('0x37')]=_['merge'](_0x1e6bb0[_0x2e3e('0x37')],{'$or':_[_0x2e3e('0x27')](_0x4b9b70,function(_0x399b5c){if(_0x399b5c[_0x2e3e('0x2a')]!==_0x2e3e('0x39')){var _0x50292a={};_0x50292a[_0x399b5c[_0x2e3e('0x24')]]={'$like':'%'+_0x85dabe[_0x2e3e('0x2e')][_0x2e3e('0x38')]+'%'};return _0x50292a;}})});}_0x1e6bb0=_['merge']({},_0x1e6bb0,_0x85dabe[_0x2e3e('0x3a')]);var _0x309a29={'where':_0x1e6bb0[_0x2e3e('0x37')]};return db['Dynamics365Configuration'][_0x2e3e('0x1b')](_0x309a29)['then'](function(_0x564a7f){_0x17353d[_0x2e3e('0x1b')]=_0x564a7f;if(_0x85dabe[_0x2e3e('0x2e')][_0x2e3e('0x3b')]){_0x1e6bb0['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x2e3e('0x3c')](_0x1e6bb0);})['then'](function(_0x53e0ff){_0x17353d[_0x2e3e('0x3d')]=_0x53e0ff;return _0x17353d;})[_0x2e3e('0x3e')](respondWithFilteredResult(_0x385bed,_0x1e6bb0))['catch'](handleError(_0x385bed,null));};exports[_0x2e3e('0x3f')]=function(_0x11358c,_0x4b97df){var _0x5cf045={'raw':![],'where':{'id':_0x11358c[_0x2e3e('0x40')]['id']}},_0x48ee96={};_0x48ee96['model']=_[_0x2e3e('0x2d')](db[_0x2e3e('0x41')][_0x2e3e('0x28')]);_0x48ee96[_0x2e3e('0x2e')]=_[_0x2e3e('0x2d')](_0x11358c[_0x2e3e('0x2e')]);_0x48ee96[_0x2e3e('0x2f')]=_[_0x2e3e('0x30')](_0x48ee96['model'],_0x48ee96[_0x2e3e('0x2e')]);_0x5cf045['attributes']=_['intersection'](_0x48ee96[_0x2e3e('0x2c')],qs['fields'](_0x11358c['query'][_0x2e3e('0x31')]));_0x5cf045[_0x2e3e('0x32')]=_0x5cf045[_0x2e3e('0x32')][_0x2e3e('0x33')]?_0x5cf045[_0x2e3e('0x32')]:_0x48ee96[_0x2e3e('0x2c')];if(_0x11358c['query'][_0x2e3e('0x3b')]){_0x5cf045[_0x2e3e('0x42')]=[{'all':!![]}];}_0x5cf045=_[_0x2e3e('0x43')]({},_0x5cf045,_0x11358c[_0x2e3e('0x3a')]);return db[_0x2e3e('0x41')][_0x2e3e('0x44')](_0x5cf045)[_0x2e3e('0x3e')](handleEntityNotFound(_0x4b97df,null))[_0x2e3e('0x3e')](respondWithResult(_0x4b97df,null))[_0x2e3e('0x45')](handleError(_0x4b97df,null));};exports[_0x2e3e('0x46')]=function(_0x4b0298,_0x4755d5){return db[_0x2e3e('0x41')][_0x2e3e('0x46')](_0x4b0298[_0x2e3e('0x47')],{})[_0x2e3e('0x3e')](respondWithResult(_0x4755d5,0xc9))[_0x2e3e('0x45')](handleError(_0x4755d5,null));};exports['update']=function(_0x151212,_0x15d4d3){if(_0x151212['body']['id']){delete _0x151212[_0x2e3e('0x47')]['id'];}return db['Dynamics365Configuration'][_0x2e3e('0x44')]({'where':{'id':_0x151212[_0x2e3e('0x40')]['id']}})['then'](handleEntityNotFound(_0x15d4d3,null))[_0x2e3e('0x3e')](saveUpdates(_0x151212[_0x2e3e('0x47')],null))['then'](respondWithResult(_0x15d4d3,null))[_0x2e3e('0x45')](handleError(_0x15d4d3,null));};exports['destroy']=function(_0x50ecc5,_0xd00517){return db['Dynamics365Configuration']['find']({'where':{'id':_0x50ecc5[_0x2e3e('0x40')]['id']}})['then'](handleEntityNotFound(_0xd00517,null))[_0x2e3e('0x3e')](removeEntity(_0xd00517,null))['catch'](handleError(_0xd00517,null));};exports['getFields']=function(_0x5ddff4,_0x9a58af,_0x10472e){var _0x1128dd={};var _0x342d5b={};var _0xee056c;var _0x293490;return db[_0x2e3e('0x41')][_0x2e3e('0x48')]({'where':{'id':_0x5ddff4[_0x2e3e('0x40')]['id']}})['then'](handleEntityNotFound(_0x9a58af,null))[_0x2e3e('0x3e')](function(_0xd024ff){if(_0xd024ff){_0xee056c=_0xd024ff;_0x342d5b[_0x2e3e('0x2c')]=_['keys'](db[_0x2e3e('0x49')][_0x2e3e('0x28')]);_0x342d5b['query']=_['keys'](_0x5ddff4[_0x2e3e('0x2e')]);_0x342d5b[_0x2e3e('0x2f')]=_[_0x2e3e('0x30')](_0x342d5b[_0x2e3e('0x2c')],_0x342d5b[_0x2e3e('0x2e')]);_0x1128dd[_0x2e3e('0x32')]=_[_0x2e3e('0x30')](_0x342d5b[_0x2e3e('0x2c')],qs[_0x2e3e('0x31')](_0x5ddff4[_0x2e3e('0x2e')][_0x2e3e('0x31')]));_0x1128dd['attributes']=_0x1128dd['attributes']['length']?_0x1128dd[_0x2e3e('0x32')]:_0x342d5b[_0x2e3e('0x2c')];_0x1128dd['order']=qs[_0x2e3e('0x4a')](_0x5ddff4['query'][_0x2e3e('0x4a')]);_0x1128dd[_0x2e3e('0x37')]=qs['filters'](_[_0x2e3e('0x4b')](_0x5ddff4['query'],_0x342d5b[_0x2e3e('0x2f')]));if(_0x5ddff4[_0x2e3e('0x2e')][_0x2e3e('0x38')]){_0x1128dd['where']=_[_0x2e3e('0x43')](_0x1128dd[_0x2e3e('0x37')],{'$or':_[_0x2e3e('0x27')](_0x1128dd[_0x2e3e('0x32')],function(_0x1109de){var _0x4285f5={};_0x4285f5[_0x1109de]={'$like':'%'+_0x5ddff4[_0x2e3e('0x2e')]['filter']+'%'};return _0x4285f5;})});}_0x1128dd=_[_0x2e3e('0x43')]({},_0x1128dd,_0x5ddff4[_0x2e3e('0x3a')]);return _0xee056c[_0x2e3e('0x4c')](_0x1128dd);}})['then'](function(_0x1f773e){if(_0x1f773e){_0x293490=_0x1f773e[_0x2e3e('0x33')];if(!_0x5ddff4[_0x2e3e('0x2e')][_0x2e3e('0x4d')](_0x2e3e('0x34'))){_0x1128dd[_0x2e3e('0x35')]=qs[_0x2e3e('0x35')](_0x5ddff4[_0x2e3e('0x2e')]['limit']);_0x1128dd[_0x2e3e('0x1c')]=qs[_0x2e3e('0x1c')](_0x5ddff4[_0x2e3e('0x2e')][_0x2e3e('0x1c')]);}return _0xee056c[_0x2e3e('0x4c')](_0x1128dd);}})[_0x2e3e('0x3e')](function(_0x8bc0c7){if(_0x8bc0c7){return _0x8bc0c7?{'count':_0x293490,'rows':_0x8bc0c7}:null;}})['then'](respondWithResult(_0x9a58af,null))[_0x2e3e('0x45')](handleError(_0x9a58af,null));};exports[_0x2e3e('0x4e')]=function(_0x261034,_0x53e926,_0x5ca00f){var _0x48723d={};var _0x4a5b95={};var _0x2da870;var _0x283931;return db['Dynamics365Configuration'][_0x2e3e('0x48')]({'where':{'id':_0x261034[_0x2e3e('0x40')]['id']}})[_0x2e3e('0x3e')](handleEntityNotFound(_0x53e926,null))['then'](function(_0x1a0d24){if(_0x1a0d24){_0x2da870=_0x1a0d24;_0x4a5b95[_0x2e3e('0x2c')]=_[_0x2e3e('0x2d')](db[_0x2e3e('0x49')]['rawAttributes']);_0x4a5b95[_0x2e3e('0x2e')]=_[_0x2e3e('0x2d')](_0x261034['query']);_0x4a5b95[_0x2e3e('0x2f')]=_[_0x2e3e('0x30')](_0x4a5b95['model'],_0x4a5b95[_0x2e3e('0x2e')]);_0x48723d[_0x2e3e('0x32')]=_['intersection'](_0x4a5b95[_0x2e3e('0x2c')],qs['fields'](_0x261034[_0x2e3e('0x2e')][_0x2e3e('0x31')]));_0x48723d[_0x2e3e('0x32')]=_0x48723d[_0x2e3e('0x32')][_0x2e3e('0x33')]?_0x48723d[_0x2e3e('0x32')]:_0x4a5b95['model'];_0x48723d[_0x2e3e('0x36')]=qs[_0x2e3e('0x4a')](_0x261034['query']['sort']);_0x48723d['where']=qs['filters'](_[_0x2e3e('0x4b')](_0x261034[_0x2e3e('0x2e')],_0x4a5b95['filters']));if(_0x261034[_0x2e3e('0x2e')][_0x2e3e('0x38')]){_0x48723d[_0x2e3e('0x37')]=_[_0x2e3e('0x43')](_0x48723d[_0x2e3e('0x37')],{'$or':_[_0x2e3e('0x27')](_0x48723d['attributes'],function(_0x35fe23){var _0x3f4946={};_0x3f4946[_0x35fe23]={'$like':'%'+_0x261034[_0x2e3e('0x2e')][_0x2e3e('0x38')]+'%'};return _0x3f4946;})});}_0x48723d=_[_0x2e3e('0x43')]({},_0x48723d,_0x261034['options']);return _0x2da870[_0x2e3e('0x4e')](_0x48723d);}})[_0x2e3e('0x3e')](function(_0x671e13){if(_0x671e13){_0x283931=_0x671e13[_0x2e3e('0x33')];if(!_0x261034[_0x2e3e('0x2e')][_0x2e3e('0x4d')]('nolimit')){_0x48723d[_0x2e3e('0x35')]=qs[_0x2e3e('0x35')](_0x261034[_0x2e3e('0x2e')][_0x2e3e('0x35')]);_0x48723d[_0x2e3e('0x1c')]=qs[_0x2e3e('0x1c')](_0x261034[_0x2e3e('0x2e')][_0x2e3e('0x1c')]);}return _0x2da870[_0x2e3e('0x4e')](_0x48723d);}})['then'](function(_0x5ba68f){if(_0x5ba68f){return _0x5ba68f?{'count':_0x283931,'rows':_0x5ba68f}:null;}})[_0x2e3e('0x3e')](respondWithResult(_0x53e926,null))[_0x2e3e('0x45')](handleError(_0x53e926,null));};exports['getDescriptions']=function(_0x417849,_0x2962fa,_0x50657d){var _0x11f0fe={};var _0x5d26d2={};var _0x2a32ad;var _0x2216cf;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x417849[_0x2e3e('0x40')]['id']}})['then'](handleEntityNotFound(_0x2962fa,null))[_0x2e3e('0x3e')](function(_0x1cc6fe){if(_0x1cc6fe){_0x2a32ad=_0x1cc6fe;_0x5d26d2[_0x2e3e('0x2c')]=_[_0x2e3e('0x2d')](db[_0x2e3e('0x49')][_0x2e3e('0x28')]);_0x5d26d2[_0x2e3e('0x2e')]=_[_0x2e3e('0x2d')](_0x417849[_0x2e3e('0x2e')]);_0x5d26d2[_0x2e3e('0x2f')]=_[_0x2e3e('0x30')](_0x5d26d2[_0x2e3e('0x2c')],_0x5d26d2['query']);_0x11f0fe[_0x2e3e('0x32')]=_[_0x2e3e('0x30')](_0x5d26d2[_0x2e3e('0x2c')],qs[_0x2e3e('0x31')](_0x417849[_0x2e3e('0x2e')]['fields']));_0x11f0fe[_0x2e3e('0x32')]=_0x11f0fe['attributes'][_0x2e3e('0x33')]?_0x11f0fe[_0x2e3e('0x32')]:_0x5d26d2[_0x2e3e('0x2c')];_0x11f0fe[_0x2e3e('0x36')]=qs[_0x2e3e('0x4a')](_0x417849[_0x2e3e('0x2e')][_0x2e3e('0x4a')]);_0x11f0fe[_0x2e3e('0x37')]=qs[_0x2e3e('0x2f')](_['pick'](_0x417849[_0x2e3e('0x2e')],_0x5d26d2[_0x2e3e('0x2f')]));if(_0x417849[_0x2e3e('0x2e')][_0x2e3e('0x38')]){_0x11f0fe[_0x2e3e('0x37')]=_[_0x2e3e('0x43')](_0x11f0fe['where'],{'$or':_[_0x2e3e('0x27')](_0x11f0fe[_0x2e3e('0x32')],function(_0x4693cb){var _0x2bba16={};_0x2bba16[_0x4693cb]={'$like':'%'+_0x417849[_0x2e3e('0x2e')][_0x2e3e('0x38')]+'%'};return _0x2bba16;})});}_0x11f0fe=_[_0x2e3e('0x43')]({},_0x11f0fe,_0x417849[_0x2e3e('0x3a')]);return _0x2a32ad[_0x2e3e('0x4f')](_0x11f0fe);}})[_0x2e3e('0x3e')](function(_0x5014fa){if(_0x5014fa){_0x2216cf=_0x5014fa[_0x2e3e('0x33')];if(!_0x417849[_0x2e3e('0x2e')]['hasOwnProperty'](_0x2e3e('0x34'))){_0x11f0fe['limit']=qs['limit'](_0x417849[_0x2e3e('0x2e')][_0x2e3e('0x35')]);_0x11f0fe[_0x2e3e('0x1c')]=qs[_0x2e3e('0x1c')](_0x417849[_0x2e3e('0x2e')][_0x2e3e('0x1c')]);}return _0x2a32ad[_0x2e3e('0x4f')](_0x11f0fe);}})[_0x2e3e('0x3e')](function(_0x5d7cb3){if(_0x5d7cb3){return _0x5d7cb3?{'count':_0x2216cf,'rows':_0x5d7cb3}:null;}})[_0x2e3e('0x3e')](respondWithResult(_0x2962fa,null))['catch'](handleError(_0x2962fa,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 1631f13..2bc2eb7 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 _0x54ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','lodash','util'];(function(_0x81e1da,_0x408a97){var _0x799101=function(_0x227798){while(--_0x227798){_0x81e1da['push'](_0x81e1da['shift']());}};_0x799101(++_0x408a97);}(_0x54ef,0x112));var _0xf54e=function(_0x395f16,_0x49abf3){_0x395f16=_0x395f16-0x0;var _0x432073=_0x54ef[_0x395f16];return _0x432073;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d0e=['define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x4c7c91,_0x48278c){var _0x325c70=function(_0x4f357a){while(--_0x4f357a){_0x4c7c91['push'](_0x4c7c91['shift']());}};_0x325c70(++_0x48278c);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x3a950a,_0x96629e){_0x3a950a=_0x3a950a-0x0;var _0x3b8639=_0x8d0e[_0x3a950a];return _0x3b8639;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var logger=require(_0xe8d0('0x2'))(_0xe8d0('0x3'));var moment=require(_0xe8d0('0x4'));var BPromise=require(_0xe8d0('0x5'));var rp=require(_0xe8d0('0x6'));var fs=require('fs');var path=require(_0xe8d0('0x7'));var rimraf=require(_0xe8d0('0x8'));var config=require('../../config/environment');var attributes=require(_0xe8d0('0x9'));module['exports']=function(_0x560dab,_0x2e2985){return _0x560dab[_0xe8d0('0xa')](_0xe8d0('0xb'),attributes,{'tableName':_0xe8d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index e243dcf..600a241 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 _0xfaeb=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0xfaeb,0x171));var _0xbfae=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xfaeb[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require(_0xbfae('0x0'));var util=require(_0xbfae('0x1'));var moment=require(_0xbfae('0x2'));var BPromise=require(_0xbfae('0x3'));var rs=require(_0xbfae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbfae('0x5'));var logger=require('../../config/logger')(_0xbfae('0x6'));var config=require(_0xbfae('0x7'));var jayson=require(_0xbfae('0x8'));var client=jayson[_0xbfae('0x9')][_0xbfae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6b6997,_0x5850cf,_0x11675b){return new BPromise(function(_0x3220bd,_0x36077f){return client[_0xbfae('0xb')](_0x6b6997,_0x11675b)[_0xbfae('0xc')](function(_0x25ca2f){logger[_0xbfae('0xd')](_0xbfae('0xe'),_0x5850cf,_0xbfae('0xf'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x5850cf,_0xbfae('0xf'),JSON[_0xbfae('0x10')](_0x25ca2f));if(_0x25ca2f[_0xbfae('0x11')]){if(_0x25ca2f[_0xbfae('0x11')][_0xbfae('0x12')]===0x1f4){logger[_0xbfae('0x11')](_0xbfae('0xe'),_0x5850cf,_0x25ca2f['error']['message']);return _0x36077f(_0x25ca2f['error'][_0xbfae('0x13')]);}logger[_0xbfae('0x11')](_0xbfae('0xe'),_0x5850cf,_0x25ca2f[_0xbfae('0x11')][_0xbfae('0x13')]);return _0x3220bd(_0x25ca2f['error'][_0xbfae('0x13')]);}else{logger[_0xbfae('0xd')](_0xbfae('0xe'),_0x5850cf,'request\x20sent');_0x3220bd(_0x25ca2f[_0xbfae('0x14')][_0xbfae('0x13')]);}})[_0xbfae('0x15')](function(_0x43f02d){logger['error'](_0xbfae('0xe'),_0x5850cf,_0x43f02d);_0x36077f(_0x43f02d);});});} \ No newline at end of file +var _0x9665=['../../config/environment','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4414d5,_0x36494a){var _0x1bbc2b=function(_0x3fd2a6){while(--_0x3fd2a6){_0x4414d5['push'](_0x4414d5['shift']());}};_0x1bbc2b(++_0x36494a);}(_0x9665,0x168));var _0x5966=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9665[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x5966('0x0'));var util=require(_0x5966('0x1'));var moment=require(_0x5966('0x2'));var BPromise=require(_0x5966('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5966('0x4'));var db=require(_0x5966('0x5'))['db'];var utils=require(_0x5966('0x6'));var logger=require('../../config/logger')(_0x5966('0x7'));var config=require(_0x5966('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5966('0x9')][_0x5966('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b8419,_0x52799e,_0x587316){return new BPromise(function(_0x5d4cac,_0x534af4){return client[_0x5966('0xb')](_0x5b8419,_0x587316)[_0x5966('0xc')](function(_0x37a1cb){logger[_0x5966('0xd')](_0x5966('0xe'),_0x52799e,_0x5966('0xf'));logger[_0x5966('0x10')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x52799e,_0x5966('0xf'),JSON[_0x5966('0x11')](_0x37a1cb));if(_0x37a1cb['error']){if(_0x37a1cb[_0x5966('0x12')][_0x5966('0x13')]===0x1f4){logger['error'](_0x5966('0xe'),_0x52799e,_0x37a1cb[_0x5966('0x12')]['message']);return _0x534af4(_0x37a1cb[_0x5966('0x12')][_0x5966('0x14')]);}logger[_0x5966('0x12')](_0x5966('0xe'),_0x52799e,_0x37a1cb[_0x5966('0x12')][_0x5966('0x14')]);return _0x5d4cac(_0x37a1cb[_0x5966('0x12')][_0x5966('0x14')]);}else{logger['info'](_0x5966('0xe'),_0x52799e,_0x5966('0xf'));_0x5d4cac(_0x37a1cb[_0x5966('0x15')]['message']);}})[_0x5966('0x16')](function(_0x1567b3){logger[_0x5966('0x12')](_0x5966('0xe'),_0x52799e,_0x1567b3);_0x534af4(_0x1567b3);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 6e17abb..26104aa 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 _0xf1cb=['get','show','post','create','put','/:id','isAuthenticated','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Field.controller','index'];(function(_0x24f9aa,_0x337128){var _0x34cba4=function(_0x2dbeb3){while(--_0x2dbeb3){_0x24f9aa['push'](_0x24f9aa['shift']());}};_0x34cba4(++_0x337128);}(_0xf1cb,0x68));var _0xbf1c=function(_0x4f9bd7,_0x317ae7){_0x4f9bd7=_0x4f9bd7-0x0;var _0x36f414=_0xf1cb[_0x4f9bd7];return _0x36f414;};'use strict';var multer=require(_0xbf1c('0x0'));var util=require(_0xbf1c('0x1'));var path=require(_0xbf1c('0x2'));var timeout=require(_0xbf1c('0x3'));var express=require(_0xbf1c('0x4'));var router=express[_0xbf1c('0x5')]();var fs_extra=require(_0xbf1c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbf1c('0x7'));var config=require('../../config/environment');var controller=require(_0xbf1c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbf1c('0x9')]);router[_0xbf1c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xbf1c('0xb')]);router[_0xbf1c('0xc')]('/',auth['isAuthenticated'](),controller[_0xbf1c('0xd')]);router[_0xbf1c('0xe')](_0xbf1c('0xf'),auth[_0xbf1c('0x10')](),controller['update']);router[_0xbf1c('0x11')]('/:id',auth[_0xbf1c('0x10')](),controller[_0xbf1c('0x12')]);module['exports']=router; \ No newline at end of file +var _0x03c6=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show'];(function(_0x848300,_0xd6f38a){var _0x50ace4=function(_0x99adc6){while(--_0x99adc6){_0x848300['push'](_0x848300['shift']());}};_0x50ace4(++_0xd6f38a);}(_0x03c6,0x70));var _0x603c=function(_0x3aee9a,_0x221030){_0x3aee9a=_0x3aee9a-0x0;var _0xb2af5d=_0x03c6[_0x3aee9a];return _0xb2af5d;};'use strict';var multer=require(_0x603c('0x0'));var util=require(_0x603c('0x1'));var path=require(_0x603c('0x2'));var timeout=require(_0x603c('0x3'));var express=require('express');var router=express[_0x603c('0x4')]();var fs_extra=require(_0x603c('0x5'));var auth=require(_0x603c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x603c('0x7'));var controller=require(_0x603c('0x8'));router[_0x603c('0x9')]('/',auth[_0x603c('0xa')](),controller[_0x603c('0xb')]);router[_0x603c('0x9')](_0x603c('0xc'),auth[_0x603c('0xa')](),controller[_0x603c('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x603c('0xe')](_0x603c('0xc'),auth[_0x603c('0xa')](),controller[_0x603c('0xf')]);router['delete'](_0x603c('0xc'),auth[_0x603c('0xa')](),controller[_0x603c('0x10')]);module[_0x603c('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 420bcc2..8a42069 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 _0x0d64=['string','STRING','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','picklist'];(function(_0x59e766,_0x362ddd){var _0x38b472=function(_0x568f46){while(--_0x568f46){_0x59e766['push'](_0x59e766['shift']());}};_0x38b472(++_0x362ddd);}(_0x0d64,0x1f2));var _0x40d6=function(_0x21b14f,_0x3ed9b9){_0x21b14f=_0x21b14f-0x0;var _0x4c0fd0=_0x0d64[_0x21b14f];return _0x4c0fd0;};'use strict';var Sequelize=require(_0x40d6('0x0'));module[_0x40d6('0x1')]={'type':{'type':Sequelize[_0x40d6('0x2')]('string','variable',_0x40d6('0x3'),_0x40d6('0x4'),_0x40d6('0x5')),'defaultValue':_0x40d6('0x6')},'content':{'type':Sequelize[_0x40d6('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x40d6('0x3'))},'keyContent':{'type':Sequelize[_0x40d6('0x7')]},'idField':{'type':Sequelize[_0x40d6('0x7')]},'nameField':{'type':Sequelize[_0x40d6('0x7')]},'customField':{'type':Sequelize[_0x40d6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x40d6('0x7')]}}; \ No newline at end of file +var _0xfd10=['keyValue','picklist','string','STRING','ENUM','BOOLEAN','sequelize','exports','variable'];(function(_0x37f58b,_0x5c0876){var _0x4f3a64=function(_0x3bdc3e){while(--_0x3bdc3e){_0x37f58b['push'](_0x37f58b['shift']());}};_0x4f3a64(++_0x5c0876);}(_0xfd10,0x9f));var _0x0fd1=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xfd10[_0x432fca];return _0x3adba4;};'use strict';var Sequelize=require(_0x0fd1('0x0'));module[_0x0fd1('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x0fd1('0x2'),'customVariable',_0x0fd1('0x3'),_0x0fd1('0x4')),'defaultValue':_0x0fd1('0x5')},'content':{'type':Sequelize[_0x0fd1('0x6')]},'key':{'type':Sequelize[_0x0fd1('0x6')]},'keyType':{'type':Sequelize[_0x0fd1('0x7')](_0x0fd1('0x5'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x0fd1('0x6')]},'idField':{'type':Sequelize[_0x0fd1('0x6')]},'nameField':{'type':Sequelize[_0x0fd1('0x6')]},'customField':{'type':Sequelize[_0x0fd1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0fd1('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index cf05527..080d1f5 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 _0xcc65=['ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Field','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','show','rawAttributes','includeAll','options','catch','body','find','params','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv'];(function(_0x3a93dd,_0x12148b){var _0x201514=function(_0x43beea){while(--_0x43beea){_0x3a93dd['push'](_0x3a93dd['shift']());}};_0x201514(++_0x12148b);}(_0xcc65,0x8c));var _0x5cc6=function(_0x478e2f,_0xcc2041){_0x478e2f=_0x478e2f-0x0;var _0x4b088d=_0xcc65[_0x478e2f];return _0x4b088d;};'use strict';var emlformat=require(_0x5cc6('0x0'));var rimraf=require(_0x5cc6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5cc6('0x2'));var BPromise=require(_0x5cc6('0x3'));var Mustache=require(_0x5cc6('0x4'));var util=require(_0x5cc6('0x5'));var path=require(_0x5cc6('0x6'));var sox=require('sox');var csv=require(_0x5cc6('0x7'));var ejs=require(_0x5cc6('0x8'));var fs=require('fs');var fs_extra=require(_0x5cc6('0x9'));var _=require(_0x5cc6('0xa'));var squel=require('squel');var crypto=require(_0x5cc6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5cc6('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5cc6('0xd'));var Papa=require(_0x5cc6('0xe'));var Redis=require('ioredis');var authService=require(_0x5cc6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5cc6('0x10'));var hardwareService=require(_0x5cc6('0x11'));var logger=require(_0x5cc6('0x12'))(_0x5cc6('0x13'));var utils=require(_0x5cc6('0x14'));var config=require(_0x5cc6('0x15'));var licenseUtil=require(_0x5cc6('0x16'));var db=require(_0x5cc6('0x17'))['db'];function respondWithStatusCode(_0x556be8,_0x5b4078){_0x5b4078=_0x5b4078||0xcc;return function(_0x592b42){if(_0x592b42){return _0x556be8['sendStatus'](_0x5b4078);}return _0x556be8[_0x5cc6('0x18')](_0x5b4078)['end']();};}function respondWithResult(_0x3b159a,_0x1f33f6){_0x1f33f6=_0x1f33f6||0xc8;return function(_0x3b08a7){if(_0x3b08a7){return _0x3b159a[_0x5cc6('0x18')](_0x1f33f6)[_0x5cc6('0x19')](_0x3b08a7);}};}function respondWithFilteredResult(_0xf240e2,_0x4601a8){return function(_0x38159b){if(_0x38159b){var _0x21da9b=typeof _0x4601a8['offset']===_0x5cc6('0x1a')&&typeof _0x4601a8[_0x5cc6('0x1b')]===_0x5cc6('0x1a');var _0x58e457=_0x38159b[_0x5cc6('0x1c')];var _0x541c5c=_0x21da9b?0x0:_0x4601a8[_0x5cc6('0x1d')];var _0x2409fc=_0x21da9b?_0x38159b[_0x5cc6('0x1c')]:_0x4601a8['offset']+_0x4601a8[_0x5cc6('0x1b')];var _0x39275c;if(_0x2409fc>=_0x58e457){_0x2409fc=_0x58e457;_0x39275c=0xc8;}else{_0x39275c=0xce;}_0xf240e2[_0x5cc6('0x18')](_0x39275c);return _0xf240e2[_0x5cc6('0x1e')](_0x5cc6('0x1f'),_0x541c5c+'-'+_0x2409fc+'/'+_0x58e457)['json'](_0x38159b);}return null;};}function patchUpdates(_0x6de106){return function(_0x1d8aba){try{jsonpatch['apply'](_0x1d8aba,_0x6de106,!![]);}catch(_0x2d72b1){return BPromise[_0x5cc6('0x20')](_0x2d72b1);}return _0x1d8aba[_0x5cc6('0x21')]();};}function saveUpdates(_0x313067,_0x1c1f94){return function(_0x38b265){if(_0x38b265){return _0x38b265[_0x5cc6('0x22')](_0x313067)[_0x5cc6('0x23')](function(_0x57ae6a){return _0x57ae6a;});}return null;};}function removeEntity(_0x3f1020,_0x82dbb){return function(_0xf4ebe8){if(_0xf4ebe8){return _0xf4ebe8[_0x5cc6('0x24')]()[_0x5cc6('0x23')](function(){_0x3f1020[_0x5cc6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c2299,_0x58433b){return function(_0x2f2cc5){if(!_0x2f2cc5){_0x4c2299['sendStatus'](0x194);}return _0x2f2cc5;};}function handleError(_0x1187da,_0x406dbb){_0x406dbb=_0x406dbb||0x1f4;return function(_0x5b9366){logger[_0x5cc6('0x25')](_0x5b9366[_0x5cc6('0x26')]);if(_0x5b9366['name']){delete _0x5b9366[_0x5cc6('0x27')];}_0x1187da[_0x5cc6('0x18')](_0x406dbb)[_0x5cc6('0x28')](_0x5b9366);};}exports[_0x5cc6('0x29')]=function(_0x128c35,_0x29b0c5){var _0x49082d={},_0x572ddf={},_0x2642d5={'count':0x0,'rows':[]};var _0x2bcc62=_[_0x5cc6('0x2a')](db[_0x5cc6('0x2b')]['rawAttributes'],function(_0xd98eef){return{'name':_0xd98eef['fieldName'],'type':_0xd98eef[_0x5cc6('0x2c')][_0x5cc6('0x2d')]};});_0x572ddf[_0x5cc6('0x2e')]=_[_0x5cc6('0x2a')](_0x2bcc62,_0x5cc6('0x27'));_0x572ddf[_0x5cc6('0x2f')]=_[_0x5cc6('0x30')](_0x128c35[_0x5cc6('0x2f')]);_0x572ddf[_0x5cc6('0x31')]=_['intersection'](_0x572ddf[_0x5cc6('0x2e')],_0x572ddf[_0x5cc6('0x2f')]);_0x49082d['attributes']=_[_0x5cc6('0x32')](_0x572ddf[_0x5cc6('0x2e')],qs[_0x5cc6('0x33')](_0x128c35[_0x5cc6('0x2f')][_0x5cc6('0x33')]));_0x49082d['attributes']=_0x49082d['attributes'][_0x5cc6('0x34')]?_0x49082d[_0x5cc6('0x35')]:_0x572ddf[_0x5cc6('0x2e')];if(!_0x128c35[_0x5cc6('0x2f')][_0x5cc6('0x36')](_0x5cc6('0x37'))){_0x49082d[_0x5cc6('0x1b')]=qs[_0x5cc6('0x1b')](_0x128c35[_0x5cc6('0x2f')][_0x5cc6('0x1b')]);_0x49082d[_0x5cc6('0x1d')]=qs[_0x5cc6('0x1d')](_0x128c35[_0x5cc6('0x2f')][_0x5cc6('0x1d')]);}_0x49082d[_0x5cc6('0x38')]=qs[_0x5cc6('0x39')](_0x128c35['query'][_0x5cc6('0x39')]);_0x49082d[_0x5cc6('0x3a')]=qs[_0x5cc6('0x31')](_[_0x5cc6('0x3b')](_0x128c35['query'],_0x572ddf[_0x5cc6('0x31')]),_0x2bcc62);if(_0x128c35[_0x5cc6('0x2f')][_0x5cc6('0x3c')]){_0x49082d['where']=_[_0x5cc6('0x3d')](_0x49082d['where'],{'$or':_[_0x5cc6('0x2a')](_0x2bcc62,function(_0x1e4f41){if(_0x1e4f41[_0x5cc6('0x2c')]!==_0x5cc6('0x3e')){var _0x3cfc0e={};_0x3cfc0e[_0x1e4f41['name']]={'$like':'%'+_0x128c35[_0x5cc6('0x2f')][_0x5cc6('0x3c')]+'%'};return _0x3cfc0e;}})});}_0x49082d=_[_0x5cc6('0x3d')]({},_0x49082d,_0x128c35['options']);var _0x1c7ed1={'where':_0x49082d[_0x5cc6('0x3a')]};return db[_0x5cc6('0x2b')][_0x5cc6('0x1c')](_0x1c7ed1)['then'](function(_0x145d7a){_0x2642d5[_0x5cc6('0x1c')]=_0x145d7a;if(_0x128c35[_0x5cc6('0x2f')]['includeAll']){_0x49082d[_0x5cc6('0x3f')]=[{'all':!![]}];}return db[_0x5cc6('0x2b')][_0x5cc6('0x40')](_0x49082d);})[_0x5cc6('0x23')](function(_0x4ddd89){_0x2642d5[_0x5cc6('0x41')]=_0x4ddd89;return _0x2642d5;})[_0x5cc6('0x23')](respondWithFilteredResult(_0x29b0c5,_0x49082d))['catch'](handleError(_0x29b0c5,null));};exports[_0x5cc6('0x42')]=function(_0x3b70a8,_0xe3b3d9){var _0x33a182={'raw':!![],'where':{'id':_0x3b70a8['params']['id']}},_0x13c2c6={};_0x13c2c6[_0x5cc6('0x2e')]=_[_0x5cc6('0x30')](db['Dynamics365Field'][_0x5cc6('0x43')]);_0x13c2c6['query']=_[_0x5cc6('0x30')](_0x3b70a8['query']);_0x13c2c6[_0x5cc6('0x31')]=_[_0x5cc6('0x32')](_0x13c2c6[_0x5cc6('0x2e')],_0x13c2c6['query']);_0x33a182[_0x5cc6('0x35')]=_[_0x5cc6('0x32')](_0x13c2c6['model'],qs[_0x5cc6('0x33')](_0x3b70a8[_0x5cc6('0x2f')][_0x5cc6('0x33')]));_0x33a182['attributes']=_0x33a182[_0x5cc6('0x35')][_0x5cc6('0x34')]?_0x33a182[_0x5cc6('0x35')]:_0x13c2c6[_0x5cc6('0x2e')];if(_0x3b70a8[_0x5cc6('0x2f')][_0x5cc6('0x44')]){_0x33a182[_0x5cc6('0x3f')]=[{'all':!![]}];}_0x33a182=_['merge']({},_0x33a182,_0x3b70a8[_0x5cc6('0x45')]);return db[_0x5cc6('0x2b')]['find'](_0x33a182)[_0x5cc6('0x23')](handleEntityNotFound(_0xe3b3d9,null))[_0x5cc6('0x23')](respondWithResult(_0xe3b3d9,null))[_0x5cc6('0x46')](handleError(_0xe3b3d9,null));};exports['create']=function(_0x140536,_0x573129){return db['Dynamics365Field']['create'](_0x140536['body'],{})[_0x5cc6('0x23')](respondWithResult(_0x573129,0xc9))[_0x5cc6('0x46')](handleError(_0x573129,null));};exports[_0x5cc6('0x22')]=function(_0x529139,_0x1131ae){if(_0x529139[_0x5cc6('0x47')]['id']){delete _0x529139[_0x5cc6('0x47')]['id'];}return db['Dynamics365Field'][_0x5cc6('0x48')]({'where':{'id':_0x529139[_0x5cc6('0x49')]['id']}})['then'](handleEntityNotFound(_0x1131ae,null))[_0x5cc6('0x23')](saveUpdates(_0x529139[_0x5cc6('0x47')],null))[_0x5cc6('0x23')](respondWithResult(_0x1131ae,null))[_0x5cc6('0x46')](handleError(_0x1131ae,null));};exports[_0x5cc6('0x24')]=function(_0x3b9e4c,_0x53c0bc){return db[_0x5cc6('0x2b')]['find']({'where':{'id':_0x3b9e4c['params']['id']}})[_0x5cc6('0x23')](handleEntityNotFound(_0x53c0bc,null))[_0x5cc6('0x23')](removeEntity(_0x53c0bc,null))[_0x5cc6('0x46')](handleError(_0x53c0bc,null));}; \ No newline at end of file +var _0x7050=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','params','includeAll','options','find','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x24c9f8,_0x274ba5){var _0x12316d=function(_0x5d571f){while(--_0x5d571f){_0x24c9f8['push'](_0x24c9f8['shift']());}};_0x12316d(++_0x274ba5);}(_0x7050,0x126));var _0x0705=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x7050[_0x30c649];return _0x3edfb9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0705('0x0'));var zipdir=require(_0x0705('0x1'));var jsonpatch=require(_0x0705('0x2'));var rp=require('request-promise');var moment=require(_0x0705('0x3'));var BPromise=require(_0x0705('0x4'));var Mustache=require(_0x0705('0x5'));var util=require(_0x0705('0x6'));var path=require(_0x0705('0x7'));var sox=require(_0x0705('0x8'));var csv=require(_0x0705('0x9'));var ejs=require(_0x0705('0xa'));var fs=require('fs');var fs_extra=require(_0x0705('0xb'));var _=require(_0x0705('0xc'));var squel=require(_0x0705('0xd'));var crypto=require('crypto');var jsforce=require(_0x0705('0xe'));var deskjs=require(_0x0705('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0705('0x10'));var Papa=require(_0x0705('0x11'));var Redis=require(_0x0705('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0705('0x13'));var as=require(_0x0705('0x14'));var hardwareService=require(_0x0705('0x15'));var logger=require('../../config/logger')(_0x0705('0x16'));var utils=require(_0x0705('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0705('0x18'));var db=require(_0x0705('0x19'))['db'];function respondWithStatusCode(_0x46ce8b,_0x42f63b){_0x42f63b=_0x42f63b||0xcc;return function(_0x489059){if(_0x489059){return _0x46ce8b[_0x0705('0x1a')](_0x42f63b);}return _0x46ce8b[_0x0705('0x1b')](_0x42f63b)[_0x0705('0x1c')]();};}function respondWithResult(_0xff16f6,_0x549adb){_0x549adb=_0x549adb||0xc8;return function(_0x36dbb4){if(_0x36dbb4){return _0xff16f6['status'](_0x549adb)[_0x0705('0x1d')](_0x36dbb4);}};}function respondWithFilteredResult(_0x3b00a2,_0x1e0cc6){return function(_0x199957){if(_0x199957){var _0x195887=typeof _0x1e0cc6['offset']===_0x0705('0x1e')&&typeof _0x1e0cc6[_0x0705('0x1f')]===_0x0705('0x1e');var _0x36f05b=_0x199957[_0x0705('0x20')];var _0x176e75=_0x195887?0x0:_0x1e0cc6[_0x0705('0x21')];var _0x3ef25a=_0x195887?_0x199957[_0x0705('0x20')]:_0x1e0cc6[_0x0705('0x21')]+_0x1e0cc6[_0x0705('0x1f')];var _0x42c28e;if(_0x3ef25a>=_0x36f05b){_0x3ef25a=_0x36f05b;_0x42c28e=0xc8;}else{_0x42c28e=0xce;}_0x3b00a2[_0x0705('0x1b')](_0x42c28e);return _0x3b00a2['set'](_0x0705('0x22'),_0x176e75+'-'+_0x3ef25a+'/'+_0x36f05b)[_0x0705('0x1d')](_0x199957);}return null;};}function patchUpdates(_0xd157c){return function(_0x459146){try{jsonpatch[_0x0705('0x23')](_0x459146,_0xd157c,!![]);}catch(_0x42e650){return BPromise[_0x0705('0x24')](_0x42e650);}return _0x459146['save']();};}function saveUpdates(_0x2e370f,_0x4bb42c){return function(_0x548980){if(_0x548980){return _0x548980[_0x0705('0x25')](_0x2e370f)['then'](function(_0x14d52e){return _0x14d52e;});}return null;};}function removeEntity(_0x30f8a1,_0xa9cee5){return function(_0x4902c7){if(_0x4902c7){return _0x4902c7[_0x0705('0x26')]()[_0x0705('0x27')](function(){_0x30f8a1['status'](0xcc)[_0x0705('0x1c')]();});}};}function handleEntityNotFound(_0x19ca29,_0x418a6b){return function(_0x59d735){if(!_0x59d735){_0x19ca29[_0x0705('0x1a')](0x194);}return _0x59d735;};}function handleError(_0x349b02,_0x4b3517){_0x4b3517=_0x4b3517||0x1f4;return function(_0x47bb67){logger[_0x0705('0x28')](_0x47bb67[_0x0705('0x29')]);if(_0x47bb67[_0x0705('0x2a')]){delete _0x47bb67['name'];}_0x349b02[_0x0705('0x1b')](_0x4b3517)[_0x0705('0x2b')](_0x47bb67);};}exports[_0x0705('0x2c')]=function(_0x202086,_0x2bc836){var _0x696298={},_0x1650ec={},_0x2256a6={'count':0x0,'rows':[]};var _0x2fe18b=_[_0x0705('0x2d')](db[_0x0705('0x2e')][_0x0705('0x2f')],function(_0x340047){return{'name':_0x340047[_0x0705('0x30')],'type':_0x340047[_0x0705('0x31')][_0x0705('0x32')]};});_0x1650ec['model']=_[_0x0705('0x2d')](_0x2fe18b,_0x0705('0x2a'));_0x1650ec[_0x0705('0x33')]=_[_0x0705('0x34')](_0x202086[_0x0705('0x33')]);_0x1650ec[_0x0705('0x35')]=_[_0x0705('0x36')](_0x1650ec[_0x0705('0x37')],_0x1650ec[_0x0705('0x33')]);_0x696298['attributes']=_['intersection'](_0x1650ec[_0x0705('0x37')],qs[_0x0705('0x38')](_0x202086[_0x0705('0x33')][_0x0705('0x38')]));_0x696298[_0x0705('0x39')]=_0x696298[_0x0705('0x39')][_0x0705('0x3a')]?_0x696298[_0x0705('0x39')]:_0x1650ec[_0x0705('0x37')];if(!_0x202086['query'][_0x0705('0x3b')]('nolimit')){_0x696298[_0x0705('0x1f')]=qs[_0x0705('0x1f')](_0x202086[_0x0705('0x33')][_0x0705('0x1f')]);_0x696298[_0x0705('0x21')]=qs[_0x0705('0x21')](_0x202086[_0x0705('0x33')][_0x0705('0x21')]);}_0x696298[_0x0705('0x3c')]=qs[_0x0705('0x3d')](_0x202086[_0x0705('0x33')][_0x0705('0x3d')]);_0x696298[_0x0705('0x3e')]=qs[_0x0705('0x35')](_[_0x0705('0x3f')](_0x202086[_0x0705('0x33')],_0x1650ec[_0x0705('0x35')]),_0x2fe18b);if(_0x202086[_0x0705('0x33')][_0x0705('0x40')]){_0x696298[_0x0705('0x3e')]=_[_0x0705('0x41')](_0x696298[_0x0705('0x3e')],{'$or':_[_0x0705('0x2d')](_0x2fe18b,function(_0x4a24ea){if(_0x4a24ea['type']!==_0x0705('0x42')){var _0x47bfa2={};_0x47bfa2[_0x4a24ea[_0x0705('0x2a')]]={'$like':'%'+_0x202086['query'][_0x0705('0x40')]+'%'};return _0x47bfa2;}})});}_0x696298=_[_0x0705('0x41')]({},_0x696298,_0x202086['options']);var _0x3b5c61={'where':_0x696298['where']};return db[_0x0705('0x2e')]['count'](_0x3b5c61)[_0x0705('0x27')](function(_0x3a3864){_0x2256a6[_0x0705('0x20')]=_0x3a3864;if(_0x202086['query']['includeAll']){_0x696298[_0x0705('0x43')]=[{'all':!![]}];}return db[_0x0705('0x2e')][_0x0705('0x44')](_0x696298);})[_0x0705('0x27')](function(_0xcbf9fa){_0x2256a6['rows']=_0xcbf9fa;return _0x2256a6;})[_0x0705('0x27')](respondWithFilteredResult(_0x2bc836,_0x696298))[_0x0705('0x45')](handleError(_0x2bc836,null));};exports['show']=function(_0x356807,_0x5cfbb9){var _0xa8447b={'raw':!![],'where':{'id':_0x356807[_0x0705('0x46')]['id']}},_0x2cd372={};_0x2cd372[_0x0705('0x37')]=_[_0x0705('0x34')](db[_0x0705('0x2e')][_0x0705('0x2f')]);_0x2cd372[_0x0705('0x33')]=_[_0x0705('0x34')](_0x356807[_0x0705('0x33')]);_0x2cd372['filters']=_[_0x0705('0x36')](_0x2cd372[_0x0705('0x37')],_0x2cd372[_0x0705('0x33')]);_0xa8447b[_0x0705('0x39')]=_['intersection'](_0x2cd372[_0x0705('0x37')],qs[_0x0705('0x38')](_0x356807[_0x0705('0x33')][_0x0705('0x38')]));_0xa8447b['attributes']=_0xa8447b[_0x0705('0x39')][_0x0705('0x3a')]?_0xa8447b[_0x0705('0x39')]:_0x2cd372[_0x0705('0x37')];if(_0x356807['query'][_0x0705('0x47')]){_0xa8447b[_0x0705('0x43')]=[{'all':!![]}];}_0xa8447b=_[_0x0705('0x41')]({},_0xa8447b,_0x356807[_0x0705('0x48')]);return db[_0x0705('0x2e')][_0x0705('0x49')](_0xa8447b)[_0x0705('0x27')](handleEntityNotFound(_0x5cfbb9,null))[_0x0705('0x27')](respondWithResult(_0x5cfbb9,null))['catch'](handleError(_0x5cfbb9,null));};exports['create']=function(_0x792faa,_0x4ece2c){return db['Dynamics365Field']['create'](_0x792faa[_0x0705('0x4a')],{})['then'](respondWithResult(_0x4ece2c,0xc9))[_0x0705('0x45')](handleError(_0x4ece2c,null));};exports[_0x0705('0x25')]=function(_0x2e9d8f,_0x1a8ea1){if(_0x2e9d8f[_0x0705('0x4a')]['id']){delete _0x2e9d8f['body']['id'];}return db[_0x0705('0x2e')][_0x0705('0x49')]({'where':{'id':_0x2e9d8f[_0x0705('0x46')]['id']}})[_0x0705('0x27')](handleEntityNotFound(_0x1a8ea1,null))['then'](saveUpdates(_0x2e9d8f[_0x0705('0x4a')],null))[_0x0705('0x27')](respondWithResult(_0x1a8ea1,null))[_0x0705('0x45')](handleError(_0x1a8ea1,null));};exports[_0x0705('0x26')]=function(_0x689fa4,_0x369617){return db[_0x0705('0x2e')][_0x0705('0x49')]({'where':{'id':_0x689fa4['params']['id']}})[_0x0705('0x27')](handleEntityNotFound(_0x369617,null))[_0x0705('0x27')](removeEntity(_0x369617,null))['catch'](handleError(_0x369617,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 1a794b5..1a4a2a9 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 _0xc98d=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId'];(function(_0x527c39,_0x3ea2a6){var _0x3f4dd6=function(_0x1ec265){while(--_0x1ec265){_0x527c39['push'](_0x527c39['shift']());}};_0x3f4dd6(++_0x3ea2a6);}(_0xc98d,0x1ef));var _0xdc98=function(_0x4d8666,_0x2ff19d){_0x4d8666=_0x4d8666-0x0;var _0x37175b=_0xc98d[_0x4d8666];return _0x37175b;};'use strict';var _=require(_0xdc98('0x0'));var util=require('util');var logger=require(_0xdc98('0x1'))(_0xdc98('0x2'));var moment=require(_0xdc98('0x3'));var BPromise=require(_0xdc98('0x4'));var rp=require(_0xdc98('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc98('0x6'));var config=require(_0xdc98('0x7'));var attributes=require(_0xdc98('0x8'));module['exports']=function(_0x574dc3,_0x36a175){return _0x574dc3[_0xdc98('0x9')](_0xdc98('0xa'),attributes,{'tableName':_0xdc98('0xb'),'paranoid':![],'indexes':[{'name':_0xdc98('0xc'),'fields':[_0xdc98('0xd'),_0xdc98('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcd1e=['rimraf','../../config/environment','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3b3362,_0x202631){var _0x223f5b=function(_0x21a21d){while(--_0x21a21d){_0x3b3362['push'](_0x3b3362['shift']());}};_0x223f5b(++_0x202631);}(_0xcd1e,0x1a9));var _0xecd1=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xcd1e[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xecd1('0x0'));var util=require(_0xecd1('0x1'));var logger=require(_0xecd1('0x2'))(_0xecd1('0x3'));var moment=require('moment');var BPromise=require(_0xecd1('0x4'));var rp=require(_0xecd1('0x5'));var fs=require('fs');var path=require(_0xecd1('0x6'));var rimraf=require(_0xecd1('0x7'));var config=require(_0xecd1('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0xecd1('0x9')]=function(_0x19013b,_0x4613b2){return _0x19013b[_0xecd1('0xa')](_0xecd1('0xb'),attributes,{'tableName':_0xecd1('0xc'),'paranoid':![],'indexes':[{'name':_0xecd1('0xd'),'fields':[_0xecd1('0xe'),_0xecd1('0xf')],'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 211999a..24c039a 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 _0x1714=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5ce083,_0x252083){var _0xd06fe1=function(_0x554b61){while(--_0x554b61){_0x5ce083['push'](_0x5ce083['shift']());}};_0xd06fe1(++_0x252083);}(_0x1714,0x1ca));var _0x4171=function(_0x153bbe,_0x1480fd){_0x153bbe=_0x153bbe-0x0;var _0xab471=_0x1714[_0x153bbe];return _0xab471;};'use strict';var _=require(_0x4171('0x0'));var util=require('util');var moment=require(_0x4171('0x1'));var BPromise=require('bluebird');var rs=require(_0x4171('0x2'));var fs=require('fs');var Redis=require(_0x4171('0x3'));var db=require(_0x4171('0x4'))['db'];var utils=require(_0x4171('0x5'));var logger=require(_0x4171('0x6'))(_0x4171('0x7'));var config=require(_0x4171('0x8'));var jayson=require(_0x4171('0x9'));var client=jayson[_0x4171('0xa')][_0x4171('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x466eae,_0x8b92e7,_0x5ed4dd){return new BPromise(function(_0x3b9a92,_0x3674d2){return client[_0x4171('0xc')](_0x466eae,_0x5ed4dd)[_0x4171('0xd')](function(_0x510fc7){logger[_0x4171('0xe')](_0x4171('0xf'),_0x8b92e7,_0x4171('0x10'));logger[_0x4171('0x11')](_0x4171('0x12'),_0x8b92e7,'request\x20sent',JSON['stringify'](_0x510fc7));if(_0x510fc7[_0x4171('0x13')]){if(_0x510fc7[_0x4171('0x13')][_0x4171('0x14')]===0x1f4){logger[_0x4171('0x13')](_0x4171('0xf'),_0x8b92e7,_0x510fc7[_0x4171('0x13')][_0x4171('0x15')]);return _0x3674d2(_0x510fc7[_0x4171('0x13')]['message']);}logger['error'](_0x4171('0xf'),_0x8b92e7,_0x510fc7[_0x4171('0x13')][_0x4171('0x15')]);return _0x3b9a92(_0x510fc7[_0x4171('0x13')]['message']);}else{logger['info'](_0x4171('0xf'),_0x8b92e7,_0x4171('0x10'));_0x3b9a92(_0x510fc7[_0x4171('0x16')][_0x4171('0x15')]);}})[_0x4171('0x17')](function(_0x50e9a2){logger[_0x4171('0x13')](_0x4171('0xf'),_0x8b92e7,_0x50e9a2);_0x3674d2(_0x50e9a2);});});} \ No newline at end of file +var _0x218b=['Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug'];(function(_0x1ea050,_0x47f27c){var _0x77abe0=function(_0x44bcda){while(--_0x44bcda){_0x1ea050['push'](_0x1ea050['shift']());}};_0x77abe0(++_0x47f27c);}(_0x218b,0x7e));var _0xb218=function(_0x2366fd,_0x54cc93){_0x2366fd=_0x2366fd-0x0;var _0x1e5fd0=_0x218b[_0x2366fd];return _0x1e5fd0;};'use strict';var _=require(_0xb218('0x0'));var util=require(_0xb218('0x1'));var moment=require(_0xb218('0x2'));var BPromise=require('bluebird');var rs=require(_0xb218('0x3'));var fs=require('fs');var Redis=require(_0xb218('0x4'));var db=require(_0xb218('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb218('0x6'))('rpc');var config=require(_0xb218('0x7'));var jayson=require(_0xb218('0x8'));var client=jayson[_0xb218('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x198d69,_0x5e6327,_0x3573e3){return new BPromise(function(_0x4f03c1,_0x402b08){return client['request'](_0x198d69,_0x3573e3)[_0xb218('0xa')](function(_0x233446){logger[_0xb218('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x5e6327,_0xb218('0xc'));logger[_0xb218('0xd')](_0xb218('0xe'),_0x5e6327,_0xb218('0xc'),JSON[_0xb218('0xf')](_0x233446));if(_0x233446['error']){if(_0x233446[_0xb218('0x10')][_0xb218('0x11')]===0x1f4){logger[_0xb218('0x10')](_0xb218('0x12'),_0x5e6327,_0x233446[_0xb218('0x10')][_0xb218('0x13')]);return _0x402b08(_0x233446['error']['message']);}logger[_0xb218('0x10')](_0xb218('0x12'),_0x5e6327,_0x233446[_0xb218('0x10')]['message']);return _0x4f03c1(_0x233446[_0xb218('0x10')][_0xb218('0x13')]);}else{logger['info'](_0xb218('0x12'),_0x5e6327,_0xb218('0xc'));_0x4f03c1(_0x233446['result'][_0xb218('0x13')]);}})['catch'](function(_0x10f564){logger[_0xb218('0x10')](_0xb218('0x12'),_0x5e6327,_0x10f564);_0x402b08(_0x10f564);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index e397a87..de610fc 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 _0xc2ae=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated'];(function(_0x1bda1e,_0x571142){var _0x33ffd1=function(_0x34c2c6){while(--_0x34c2c6){_0x1bda1e['push'](_0x1bda1e['shift']());}};_0x33ffd1(++_0x571142);}(_0xc2ae,0x96));var _0xec2a=function(_0x46b705,_0x221681){_0x46b705=_0x46b705-0x0;var _0x38e390=_0xc2ae[_0x46b705];return _0x38e390;};'use strict';var multer=require(_0xec2a('0x0'));var util=require(_0xec2a('0x1'));var path=require(_0xec2a('0x2'));var timeout=require(_0xec2a('0x3'));var express=require(_0xec2a('0x4'));var router=express['Router']();var fs_extra=require(_0xec2a('0x5'));var auth=require(_0xec2a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xec2a('0x7'));var controller=require(_0xec2a('0x8'));router[_0xec2a('0x9')]('/',auth[_0xec2a('0xa')](),controller[_0xec2a('0xb')]);router['get'](_0xec2a('0xc'),auth[_0xec2a('0xa')](),controller[_0xec2a('0xd')]);router[_0xec2a('0x9')](_0xec2a('0xe'),auth[_0xec2a('0xa')](),controller[_0xec2a('0xf')]);router['get'](_0xec2a('0x10'),auth[_0xec2a('0xa')](),controller['getFields']);router['post']('/',auth[_0xec2a('0xa')](),controller['create']);router[_0xec2a('0x11')](_0xec2a('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xec2a('0x12')](_0xec2a('0xc'),auth[_0xec2a('0xa')](),controller[_0xec2a('0x13')]);router[_0xec2a('0x14')](_0xec2a('0xc'),auth[_0xec2a('0xa')](),controller[_0xec2a('0x15')]);module[_0xec2a('0x16')]=router; \ No newline at end of file +var _0xab07=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','exports','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xab07,0xf1));var _0x7ab0=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xab07[_0x4914e2];return _0x2dcd07;};'use strict';var multer=require('multer');var util=require(_0x7ab0('0x0'));var path=require(_0x7ab0('0x1'));var timeout=require(_0x7ab0('0x2'));var express=require(_0x7ab0('0x3'));var router=express[_0x7ab0('0x4')]();var fs_extra=require(_0x7ab0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7ab0('0x6'));var config=require(_0x7ab0('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0x7ab0('0x8')]('/',auth[_0x7ab0('0x9')](),controller['index']);router[_0x7ab0('0x8')](_0x7ab0('0xa'),auth[_0x7ab0('0x9')](),controller[_0x7ab0('0xb')]);router[_0x7ab0('0x8')]('/:id/configurations',auth[_0x7ab0('0x9')](),controller[_0x7ab0('0xc')]);router['get'](_0x7ab0('0xd'),auth[_0x7ab0('0x9')](),controller[_0x7ab0('0xe')]);router[_0x7ab0('0xf')]('/',auth[_0x7ab0('0x9')](),controller[_0x7ab0('0x10')]);router[_0x7ab0('0xf')](_0x7ab0('0x11'),auth[_0x7ab0('0x9')](),controller['addConfiguration']);router[_0x7ab0('0x12')](_0x7ab0('0xa'),auth[_0x7ab0('0x9')](),controller[_0x7ab0('0x13')]);router[_0x7ab0('0x14')](_0x7ab0('0xa'),auth[_0x7ab0('0x9')](),controller['destroy']);module[_0x7ab0('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 d6c25af..2d2e409 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 _0xb44a=['STRING'];(function(_0x495e9f,_0x1b1d80){var _0xb249d2=function(_0x3db4e4){while(--_0x3db4e4){_0x495e9f['push'](_0x495e9f['shift']());}};_0xb249d2(++_0x1b1d80);}(_0xb44a,0x1c2));var _0xab44=function(_0x7ad6cb,_0xffee6c){_0x7ad6cb=_0x7ad6cb-0x0;var _0x22a0ba=_0xb44a[_0x7ad6cb];return _0x22a0ba;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xab44('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xab44('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xab44('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xab44('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x524e=['username','remoteUri','STRING'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0x524e,0x15e));var _0xe524=function(_0x3a70f1,_0x64cae2){_0x3a70f1=_0x3a70f1-0x0;var _0x2a356f=_0x524e[_0x3a70f1];return _0x2a356f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe524('0x0')]},'description':{'type':Sequelize[_0xe524('0x0')]},'username':{'type':Sequelize[_0xe524('0x0')],'unique':_0xe524('0x1')},'apiKey':{'type':Sequelize[_0xe524('0x0')]},'remoteUri':{'type':Sequelize[_0xe524('0x0')],'unique':_0xe524('0x2')},'serverUrl':{'type':Sequelize[_0xe524('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index b2bc2dc..ee84b50 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 _0x43c8=['hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','getConfigurations','FreshdeskConfiguration','length','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','substring','GET','%s/%s','api/v2/ticket_fields','%s:X','toString','requester','subject','description','priority','group','ticket_type','remove','includes','custom_text','custom_dropdown','label','default','choices','capitalize','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','destroy','then','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0xb8542c,_0x5eb70c){var _0xc645b3=function(_0x573d95){while(--_0x573d95){_0xb8542c['push'](_0xb8542c['shift']());}};_0xc645b3(++_0x5eb70c);}(_0x43c8,0xaf));var _0x843c=function(_0x1d5c06,_0x3694ca){_0x1d5c06=_0x1d5c06-0x0;var _0x286253=_0x43c8[_0x1d5c06];return _0x286253;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x843c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x843c('0x1'));var rp=require(_0x843c('0x2'));var moment=require(_0x843c('0x3'));var BPromise=require(_0x843c('0x4'));var Mustache=require(_0x843c('0x5'));var util=require(_0x843c('0x6'));var path=require(_0x843c('0x7'));var sox=require('sox');var csv=require(_0x843c('0x8'));var ejs=require(_0x843c('0x9'));var fs=require('fs');var fs_extra=require(_0x843c('0xa'));var _=require(_0x843c('0xb'));var squel=require(_0x843c('0xc'));var crypto=require('crypto');var jsforce=require(_0x843c('0xd'));var deskjs=require(_0x843c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x843c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x843c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x843c('0x11'));var hardwareService=require(_0x843c('0x12'));var logger=require(_0x843c('0x13'))(_0x843c('0x14'));var utils=require('../../config/utils');var config=require(_0x843c('0x15'));var licenseUtil=require(_0x843c('0x16'));var db=require(_0x843c('0x17'))['db'];var integrations=require(_0x843c('0x18'));function respondWithStatusCode(_0x231ce1,_0x34e297){_0x34e297=_0x34e297||0xcc;return function(_0x33ff2c){if(_0x33ff2c){return _0x231ce1[_0x843c('0x19')](_0x34e297);}return _0x231ce1[_0x843c('0x1a')](_0x34e297)[_0x843c('0x1b')]();};}function respondWithResult(_0x313947,_0x36e07f){_0x36e07f=_0x36e07f||0xc8;return function(_0x2ad766){if(_0x2ad766){return _0x313947[_0x843c('0x1a')](_0x36e07f)[_0x843c('0x1c')](_0x2ad766);}};}function respondWithFilteredResult(_0x5577ff,_0x3dc50d){return function(_0x2c013c){if(_0x2c013c){var _0x1d92cf=typeof _0x3dc50d[_0x843c('0x1d')]===_0x843c('0x1e')&&typeof _0x3dc50d['limit']===_0x843c('0x1e');var _0x807f83=_0x2c013c[_0x843c('0x1f')];var _0x2acf94=_0x1d92cf?0x0:_0x3dc50d['offset'];var _0xf53b50=_0x1d92cf?_0x2c013c[_0x843c('0x1f')]:_0x3dc50d[_0x843c('0x1d')]+_0x3dc50d[_0x843c('0x20')];var _0x1db871;if(_0xf53b50>=_0x807f83){_0xf53b50=_0x807f83;_0x1db871=0xc8;}else{_0x1db871=0xce;}_0x5577ff['status'](_0x1db871);return _0x5577ff[_0x843c('0x21')]('Content-Range',_0x2acf94+'-'+_0xf53b50+'/'+_0x807f83)[_0x843c('0x1c')](_0x2c013c);}return null;};}function patchUpdates(_0x5eb8ca){return function(_0x3422a3){try{jsonpatch[_0x843c('0x22')](_0x3422a3,_0x5eb8ca,!![]);}catch(_0x526946){return BPromise[_0x843c('0x23')](_0x526946);}return _0x3422a3[_0x843c('0x24')]();};}function saveUpdates(_0x2d1d43,_0x15513d){return function(_0x495927){if(_0x495927){return _0x495927['update'](_0x2d1d43)['then'](function(_0x3f914b){return _0x3f914b;});}return null;};}function removeEntity(_0x17e6ab,_0x2d90f9){return function(_0x408bf1){if(_0x408bf1){return _0x408bf1[_0x843c('0x25')]()[_0x843c('0x26')](function(){_0x17e6ab[_0x843c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4584be,_0x2a8c56){return function(_0x1a6a52){if(!_0x1a6a52){_0x4584be['sendStatus'](0x194);}return _0x1a6a52;};}function handleError(_0x2a34d2,_0x5caa13){_0x5caa13=_0x5caa13||0x1f4;return function(_0x15863a){logger[_0x843c('0x27')](_0x15863a[_0x843c('0x28')]);if(_0x15863a['name']){delete _0x15863a[_0x843c('0x29')];}_0x2a34d2[_0x843c('0x1a')](_0x5caa13)[_0x843c('0x2a')](_0x15863a);};}exports[_0x843c('0x2b')]=function(_0x8473bb,_0xb8b544){var _0x4e2a13={},_0xff406d={},_0x4d23bd={'count':0x0,'rows':[]};var _0x3855fb=_[_0x843c('0x2c')](db[_0x843c('0x2d')][_0x843c('0x2e')],function(_0x51aebb){return{'name':_0x51aebb[_0x843c('0x2f')],'type':_0x51aebb[_0x843c('0x30')][_0x843c('0x31')]};});_0xff406d[_0x843c('0x32')]=_[_0x843c('0x2c')](_0x3855fb,_0x843c('0x29'));_0xff406d[_0x843c('0x33')]=_[_0x843c('0x34')](_0x8473bb[_0x843c('0x33')]);_0xff406d[_0x843c('0x35')]=_[_0x843c('0x36')](_0xff406d[_0x843c('0x32')],_0xff406d['query']);_0x4e2a13[_0x843c('0x37')]=_['intersection'](_0xff406d[_0x843c('0x32')],qs[_0x843c('0x38')](_0x8473bb['query'][_0x843c('0x38')]));_0x4e2a13[_0x843c('0x37')]=_0x4e2a13[_0x843c('0x37')]['length']?_0x4e2a13[_0x843c('0x37')]:_0xff406d[_0x843c('0x32')];if(!_0x8473bb['query'][_0x843c('0x39')]('nolimit')){_0x4e2a13[_0x843c('0x20')]=qs[_0x843c('0x20')](_0x8473bb[_0x843c('0x33')]['limit']);_0x4e2a13[_0x843c('0x1d')]=qs[_0x843c('0x1d')](_0x8473bb[_0x843c('0x33')][_0x843c('0x1d')]);}_0x4e2a13[_0x843c('0x3a')]=qs['sort'](_0x8473bb[_0x843c('0x33')][_0x843c('0x3b')]);_0x4e2a13[_0x843c('0x3c')]=qs[_0x843c('0x35')](_[_0x843c('0x3d')](_0x8473bb[_0x843c('0x33')],_0xff406d['filters']),_0x3855fb);if(_0x8473bb[_0x843c('0x33')][_0x843c('0x3e')]){_0x4e2a13[_0x843c('0x3c')]=_[_0x843c('0x3f')](_0x4e2a13[_0x843c('0x3c')],{'$or':_[_0x843c('0x2c')](_0x3855fb,function(_0x2f36f7){if(_0x2f36f7['type']!=='VIRTUAL'){var _0xab253={};_0xab253[_0x2f36f7[_0x843c('0x29')]]={'$like':'%'+_0x8473bb[_0x843c('0x33')]['filter']+'%'};return _0xab253;}})});}_0x4e2a13=_[_0x843c('0x3f')]({},_0x4e2a13,_0x8473bb[_0x843c('0x40')]);var _0x1b29f7={'where':_0x4e2a13[_0x843c('0x3c')]};return db[_0x843c('0x2d')]['count'](_0x1b29f7)[_0x843c('0x26')](function(_0x1204ac){_0x4d23bd[_0x843c('0x1f')]=_0x1204ac;if(_0x8473bb[_0x843c('0x33')][_0x843c('0x41')]){_0x4e2a13[_0x843c('0x42')]=[{'all':!![]}];}return db[_0x843c('0x2d')][_0x843c('0x43')](_0x4e2a13);})[_0x843c('0x26')](function(_0x1c3600){_0x4d23bd[_0x843c('0x44')]=_0x1c3600;return _0x4d23bd;})[_0x843c('0x26')](respondWithFilteredResult(_0xb8b544,_0x4e2a13))[_0x843c('0x45')](handleError(_0xb8b544,null));};exports[_0x843c('0x46')]=function(_0x33243a,_0x4c8115){var _0x49de5c={'raw':![],'where':{'id':_0x33243a[_0x843c('0x47')]['id']}},_0x4c25a6={};_0x4c25a6['model']=_[_0x843c('0x34')](db[_0x843c('0x2d')]['rawAttributes']);_0x4c25a6[_0x843c('0x33')]=_['keys'](_0x33243a['query']);_0x4c25a6['filters']=_[_0x843c('0x36')](_0x4c25a6['model'],_0x4c25a6[_0x843c('0x33')]);_0x49de5c[_0x843c('0x37')]=_['intersection'](_0x4c25a6['model'],qs[_0x843c('0x38')](_0x33243a[_0x843c('0x33')][_0x843c('0x38')]));_0x49de5c[_0x843c('0x37')]=_0x49de5c[_0x843c('0x37')]['length']?_0x49de5c[_0x843c('0x37')]:_0x4c25a6['model'];if(_0x33243a[_0x843c('0x33')][_0x843c('0x41')]){_0x49de5c[_0x843c('0x42')]=[{'all':!![]}];}_0x49de5c=_[_0x843c('0x3f')]({},_0x49de5c,_0x33243a[_0x843c('0x40')]);return db[_0x843c('0x2d')][_0x843c('0x48')](_0x49de5c)[_0x843c('0x26')](handleEntityNotFound(_0x4c8115,null))[_0x843c('0x26')](respondWithResult(_0x4c8115,null))[_0x843c('0x45')](handleError(_0x4c8115,null));};exports[_0x843c('0x49')]=function(_0x41f9fa,_0x306394){return db[_0x843c('0x2d')][_0x843c('0x49')](_0x41f9fa[_0x843c('0x4a')],{})[_0x843c('0x26')](respondWithResult(_0x306394,0xc9))['catch'](handleError(_0x306394,null));};exports[_0x843c('0x4b')]=function(_0x189a9e,_0x11bb2d){if(_0x189a9e[_0x843c('0x4a')]['id']){delete _0x189a9e[_0x843c('0x4a')]['id'];}return db['FreshdeskAccount'][_0x843c('0x48')]({'where':{'id':_0x189a9e['params']['id']}})[_0x843c('0x26')](handleEntityNotFound(_0x11bb2d,null))['then'](saveUpdates(_0x189a9e[_0x843c('0x4a')],null))[_0x843c('0x26')](respondWithResult(_0x11bb2d,null))[_0x843c('0x45')](handleError(_0x11bb2d,null));};exports[_0x843c('0x25')]=function(_0x1603ea,_0x2236d1){return db[_0x843c('0x2d')][_0x843c('0x48')]({'where':{'id':_0x1603ea[_0x843c('0x47')]['id']}})[_0x843c('0x26')](handleEntityNotFound(_0x2236d1,null))['then'](removeEntity(_0x2236d1,null))[_0x843c('0x45')](handleError(_0x2236d1,null));};exports[_0x843c('0x4c')]=function(_0x1e6802,_0x28bbb7,_0x1628ae){var _0x1f7f5d={};var _0x3da0f7={};var _0x428884;var _0x29fe16;return db[_0x843c('0x2d')]['findOne']({'where':{'id':_0x1e6802[_0x843c('0x47')]['id']}})[_0x843c('0x26')](handleEntityNotFound(_0x28bbb7,null))[_0x843c('0x26')](function(_0x5b0e18){if(_0x5b0e18){_0x428884=_0x5b0e18;_0x3da0f7[_0x843c('0x32')]=_[_0x843c('0x34')](db[_0x843c('0x4d')][_0x843c('0x2e')]);_0x3da0f7[_0x843c('0x33')]=_[_0x843c('0x34')](_0x1e6802[_0x843c('0x33')]);_0x3da0f7[_0x843c('0x35')]=_['intersection'](_0x3da0f7['model'],_0x3da0f7[_0x843c('0x33')]);_0x1f7f5d[_0x843c('0x37')]=_[_0x843c('0x36')](_0x3da0f7['model'],qs[_0x843c('0x38')](_0x1e6802[_0x843c('0x33')][_0x843c('0x38')]));_0x1f7f5d[_0x843c('0x37')]=_0x1f7f5d[_0x843c('0x37')]['length']?_0x1f7f5d[_0x843c('0x37')]:_0x3da0f7['model'];_0x1f7f5d[_0x843c('0x3a')]=qs[_0x843c('0x3b')](_0x1e6802[_0x843c('0x33')][_0x843c('0x3b')]);_0x1f7f5d[_0x843c('0x3c')]=qs['filters'](_[_0x843c('0x3d')](_0x1e6802['query'],_0x3da0f7[_0x843c('0x35')]));if(_0x1e6802[_0x843c('0x33')]['filter']){_0x1f7f5d[_0x843c('0x3c')]=_[_0x843c('0x3f')](_0x1f7f5d[_0x843c('0x3c')],{'$or':_[_0x843c('0x2c')](_0x1f7f5d[_0x843c('0x37')],function(_0xcb8c8){var _0x1e4073={};_0x1e4073[_0xcb8c8]={'$like':'%'+_0x1e6802[_0x843c('0x33')][_0x843c('0x3e')]+'%'};return _0x1e4073;})});}_0x1f7f5d=_['merge']({},_0x1f7f5d,_0x1e6802[_0x843c('0x40')]);return _0x428884[_0x843c('0x4c')](_0x1f7f5d);}})['then'](function(_0x327032){if(_0x327032){_0x29fe16=_0x327032[_0x843c('0x4e')];if(!_0x1e6802['query'][_0x843c('0x39')](_0x843c('0x4f'))){_0x1f7f5d[_0x843c('0x20')]=qs['limit'](_0x1e6802['query'][_0x843c('0x20')]);_0x1f7f5d['offset']=qs[_0x843c('0x1d')](_0x1e6802[_0x843c('0x33')][_0x843c('0x1d')]);}return _0x428884[_0x843c('0x4c')](_0x1f7f5d);}})[_0x843c('0x26')](function(_0x31a4c5){if(_0x31a4c5){return _0x31a4c5?{'count':_0x29fe16,'rows':_0x31a4c5}:null;}})[_0x843c('0x26')](respondWithResult(_0x28bbb7,null))[_0x843c('0x45')](handleError(_0x28bbb7,null));};exports[_0x843c('0x50')]=function(_0x5e43bf,_0x1bd68f,_0x5e4880){if(_0x5e43bf[_0x843c('0x4a')]['id']){delete _0x5e43bf['body']['id'];}return db[_0x843c('0x2d')][_0x843c('0x51')]({'where':{'id':_0x5e43bf[_0x843c('0x47')]['id']}})[_0x843c('0x26')](handleEntityNotFound(_0x1bd68f,null))['then'](function(_0xbf1c81){if(_0xbf1c81){_0x5e43bf[_0x843c('0x4a')][_0x843c('0x52')]=_0xbf1c81['id'];_0x5e43bf['body'][_0x843c('0x53')]=integrations[_0x843c('0x54')](_0x5e43bf[_0x843c('0x4a')][_0x843c('0x55')],_0x5e43bf['body'][_0x843c('0x30')]);_0x5e43bf[_0x843c('0x4a')]['Descriptions']=integrations[_0x843c('0x56')](_0x5e43bf['body'][_0x843c('0x55')],_0x5e43bf[_0x843c('0x4a')][_0x843c('0x30')]);return db['FreshdeskConfiguration'][_0x843c('0x49')](_0x5e43bf['body'],{'include':[{'model':db[_0x843c('0x57')],'as':_0x843c('0x53')},{'model':db[_0x843c('0x57')],'as':_0x843c('0x58')}]});}return null;})[_0x843c('0x26')](respondWithResult(_0x1bd68f,null))[_0x843c('0x45')](handleError(_0x1bd68f,null));};exports[_0x843c('0x59')]=function(_0x3a8572,_0x42c84f,_0x6779d1){var _0xfc619a='';return db[_0x843c('0x2d')][_0x843c('0x51')]({'where':{'id':_0x3a8572[_0x843c('0x47')]['id']},'attributes':['id',_0x843c('0x5a'),_0x843c('0x5b')]})[_0x843c('0x26')](handleEntityNotFound(_0x42c84f,null))[_0x843c('0x26')](function(_0x10b90e){if(_0x10b90e){_0xfc619a=_0x10b90e[_0x843c('0x5a')];var _0x3add11=_0xfc619a[_0x843c('0x5c')](-0x1);if(_0x3add11==='/'){_0xfc619a=_0xfc619a[_0x843c('0x5d')](0x0,_0xfc619a['lastIndexOf'](_0x3add11));}return rp({'method':_0x843c('0x5e'),'uri':util['format'](_0x843c('0x5f'),_0xfc619a,_0x843c('0x60')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util['format'](_0x843c('0x61'),_0x10b90e[_0x843c('0x5b')]))[_0x843c('0x62')]('base64'))},'json':!![]});}})[_0x843c('0x26')](function(_0x1e27b8){if(_0x1e27b8){var _0x55922=[_0x843c('0x63'),_0x843c('0x64'),'agent',_0x843c('0x65'),_0x843c('0x1a'),_0x843c('0x66'),_0x843c('0x67'),'source',_0x843c('0x68'),'group','company'];_[_0x843c('0x69')](_0x1e27b8,function(_0x124db5){return _0x55922[_0x843c('0x6a')](_0x124db5[_0x843c('0x29')])||!_0x124db5['default']&&_0x124db5['type']!==_0x843c('0x6b')&&_0x124db5[_0x843c('0x30')]!==_0x843c('0x6c');});return{'count':_0x1e27b8[_0x843c('0x4e')],'rows':_[_0x843c('0x2c')](_0x1e27b8,function(_0x17295a){return{'id':_0x17295a[_0x843c('0x29')],'name':_0x17295a[_0x843c('0x6d')],'custom':!_0x17295a[_0x843c('0x6e')],'options':_0x17295a[_0x843c('0x6f')]?_[_0x843c('0x2c')](_0x17295a[_0x843c('0x6f')],function(_0x3722a6){return{'name':_[_0x843c('0x70')](_0x3722a6),'value':_0x3722a6};}):[]};})};}})[_0x843c('0x26')](respondWithResult(_0x42c84f,null))[_0x843c('0x45')](function(_0x159b57){var _0x1c5177=_0x3a8572[_0x843c('0x33')]['test']?0x1f4:_0x159b57['statusCode']||0x1f4;logger[_0x843c('0x27')](_0x843c('0x71'),_0x843c('0x59'),_0x1c5177,JSON['stringify'](_0x159b57));delete _0x159b57['name'];if(_0x1c5177===0x191){_0x1c5177=0x190;}_0x42c84f['status'](_0x1c5177)[_0x843c('0x2a')](_0x3a8572[_0x843c('0x33')][_0x843c('0x72')]?{'message':_0x843c('0x73'),'statusCode':_0x159b57['statusCode']}:_0x159b57);});}; \ No newline at end of file +var _0x063c=['error','stack','name','send','index','FreshdeskAccount','rawAttributes','key','map','query','keys','filters','intersection','model','attributes','fields','length','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','findOne','FreshdeskConfiguration','hasOwnProperty','nolimit','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','apiKey','remoteUri','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','toString','base64','requester','agent','description','priority','group','remove','includes','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','stringify','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x063c,0xba));var _0xc063=function(_0x12774f,_0x179b48){_0x12774f=_0x12774f-0x0;var _0x15f66e=_0x063c[_0x12774f];return _0x15f66e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc063('0x0'));var zipdir=require(_0xc063('0x1'));var jsonpatch=require(_0xc063('0x2'));var rp=require(_0xc063('0x3'));var moment=require(_0xc063('0x4'));var BPromise=require(_0xc063('0x5'));var Mustache=require('mustache');var util=require(_0xc063('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc063('0x7'));var fs=require('fs');var fs_extra=require(_0xc063('0x8'));var _=require('lodash');var squel=require(_0xc063('0x9'));var crypto=require(_0xc063('0xa'));var jsforce=require(_0xc063('0xb'));var deskjs=require(_0xc063('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc063('0xd'));var Papa=require(_0xc063('0xe'));var Redis=require('ioredis');var authService=require(_0xc063('0xf'));var qs=require(_0xc063('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc063('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc063('0x12'));var licenseUtil=require(_0xc063('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc063('0x14'));function respondWithStatusCode(_0x5d0d2a,_0x14f55e){_0x14f55e=_0x14f55e||0xcc;return function(_0x198b7f){if(_0x198b7f){return _0x5d0d2a[_0xc063('0x15')](_0x14f55e);}return _0x5d0d2a['status'](_0x14f55e)[_0xc063('0x16')]();};}function respondWithResult(_0x1249b2,_0x21b8da){_0x21b8da=_0x21b8da||0xc8;return function(_0x1fb110){if(_0x1fb110){return _0x1249b2[_0xc063('0x17')](_0x21b8da)[_0xc063('0x18')](_0x1fb110);}};}function respondWithFilteredResult(_0xf7fe54,_0xac1724){return function(_0x3baaeb){if(_0x3baaeb){var _0x5a1279=typeof _0xac1724[_0xc063('0x19')]===_0xc063('0x1a')&&typeof _0xac1724['limit']===_0xc063('0x1a');var _0x167fb9=_0x3baaeb['count'];var _0x238ecb=_0x5a1279?0x0:_0xac1724[_0xc063('0x19')];var _0xf87f41=_0x5a1279?_0x3baaeb[_0xc063('0x1b')]:_0xac1724['offset']+_0xac1724[_0xc063('0x1c')];var _0x28d3ce;if(_0xf87f41>=_0x167fb9){_0xf87f41=_0x167fb9;_0x28d3ce=0xc8;}else{_0x28d3ce=0xce;}_0xf7fe54[_0xc063('0x17')](_0x28d3ce);return _0xf7fe54['set'](_0xc063('0x1d'),_0x238ecb+'-'+_0xf87f41+'/'+_0x167fb9)[_0xc063('0x18')](_0x3baaeb);}return null;};}function patchUpdates(_0x5741e0){return function(_0x63da37){try{jsonpatch[_0xc063('0x1e')](_0x63da37,_0x5741e0,!![]);}catch(_0x1af70d){return BPromise[_0xc063('0x1f')](_0x1af70d);}return _0x63da37[_0xc063('0x20')]();};}function saveUpdates(_0x4a82eb,_0x59c960){return function(_0x481cb1){if(_0x481cb1){return _0x481cb1[_0xc063('0x21')](_0x4a82eb)['then'](function(_0x4fb406){return _0x4fb406;});}return null;};}function removeEntity(_0x481a6b,_0x382f79){return function(_0x3e1040){if(_0x3e1040){return _0x3e1040[_0xc063('0x22')]()[_0xc063('0x23')](function(){_0x481a6b[_0xc063('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a0d10,_0x7317e7){return function(_0x52dde0){if(!_0x52dde0){_0x5a0d10[_0xc063('0x15')](0x194);}return _0x52dde0;};}function handleError(_0x43e592,_0x7db21a){_0x7db21a=_0x7db21a||0x1f4;return function(_0x93a4b1){logger[_0xc063('0x24')](_0x93a4b1[_0xc063('0x25')]);if(_0x93a4b1[_0xc063('0x26')]){delete _0x93a4b1[_0xc063('0x26')];}_0x43e592['status'](_0x7db21a)[_0xc063('0x27')](_0x93a4b1);};}exports[_0xc063('0x28')]=function(_0x5a623d,_0x3a18bd){var _0x3359cd={},_0xfd5976={},_0x3d02bd={'count':0x0,'rows':[]};var _0x343ba6=_['map'](db[_0xc063('0x29')][_0xc063('0x2a')],function(_0x55f71f){return{'name':_0x55f71f['fieldName'],'type':_0x55f71f['type'][_0xc063('0x2b')]};});_0xfd5976['model']=_[_0xc063('0x2c')](_0x343ba6,_0xc063('0x26'));_0xfd5976[_0xc063('0x2d')]=_[_0xc063('0x2e')](_0x5a623d['query']);_0xfd5976[_0xc063('0x2f')]=_[_0xc063('0x30')](_0xfd5976[_0xc063('0x31')],_0xfd5976['query']);_0x3359cd[_0xc063('0x32')]=_['intersection'](_0xfd5976[_0xc063('0x31')],qs[_0xc063('0x33')](_0x5a623d['query']['fields']));_0x3359cd[_0xc063('0x32')]=_0x3359cd['attributes'][_0xc063('0x34')]?_0x3359cd[_0xc063('0x32')]:_0xfd5976[_0xc063('0x31')];if(!_0x5a623d['query']['hasOwnProperty']('nolimit')){_0x3359cd[_0xc063('0x1c')]=qs['limit'](_0x5a623d[_0xc063('0x2d')]['limit']);_0x3359cd[_0xc063('0x19')]=qs[_0xc063('0x19')](_0x5a623d[_0xc063('0x2d')][_0xc063('0x19')]);}_0x3359cd['order']=qs[_0xc063('0x35')](_0x5a623d[_0xc063('0x2d')][_0xc063('0x35')]);_0x3359cd['where']=qs[_0xc063('0x2f')](_[_0xc063('0x36')](_0x5a623d[_0xc063('0x2d')],_0xfd5976[_0xc063('0x2f')]),_0x343ba6);if(_0x5a623d[_0xc063('0x2d')][_0xc063('0x37')]){_0x3359cd[_0xc063('0x38')]=_[_0xc063('0x39')](_0x3359cd[_0xc063('0x38')],{'$or':_[_0xc063('0x2c')](_0x343ba6,function(_0x5ccf8a){if(_0x5ccf8a[_0xc063('0x3a')]!==_0xc063('0x3b')){var _0x37ad4e={};_0x37ad4e[_0x5ccf8a[_0xc063('0x26')]]={'$like':'%'+_0x5a623d[_0xc063('0x2d')][_0xc063('0x37')]+'%'};return _0x37ad4e;}})});}_0x3359cd=_[_0xc063('0x39')]({},_0x3359cd,_0x5a623d[_0xc063('0x3c')]);var _0x57ab22={'where':_0x3359cd['where']};return db['FreshdeskAccount']['count'](_0x57ab22)[_0xc063('0x23')](function(_0x2d4c16){_0x3d02bd[_0xc063('0x1b')]=_0x2d4c16;if(_0x5a623d[_0xc063('0x2d')][_0xc063('0x3d')]){_0x3359cd[_0xc063('0x3e')]=[{'all':!![]}];}return db[_0xc063('0x29')][_0xc063('0x3f')](_0x3359cd);})['then'](function(_0x472663){_0x3d02bd[_0xc063('0x40')]=_0x472663;return _0x3d02bd;})[_0xc063('0x23')](respondWithFilteredResult(_0x3a18bd,_0x3359cd))[_0xc063('0x41')](handleError(_0x3a18bd,null));};exports[_0xc063('0x42')]=function(_0x53c694,_0x4ec474){var _0x510593={'raw':![],'where':{'id':_0x53c694[_0xc063('0x43')]['id']}},_0x2077df={};_0x2077df[_0xc063('0x31')]=_[_0xc063('0x2e')](db[_0xc063('0x29')][_0xc063('0x2a')]);_0x2077df[_0xc063('0x2d')]=_[_0xc063('0x2e')](_0x53c694['query']);_0x2077df[_0xc063('0x2f')]=_[_0xc063('0x30')](_0x2077df['model'],_0x2077df[_0xc063('0x2d')]);_0x510593[_0xc063('0x32')]=_['intersection'](_0x2077df[_0xc063('0x31')],qs[_0xc063('0x33')](_0x53c694[_0xc063('0x2d')][_0xc063('0x33')]));_0x510593['attributes']=_0x510593[_0xc063('0x32')][_0xc063('0x34')]?_0x510593[_0xc063('0x32')]:_0x2077df['model'];if(_0x53c694['query'][_0xc063('0x3d')]){_0x510593[_0xc063('0x3e')]=[{'all':!![]}];}_0x510593=_[_0xc063('0x39')]({},_0x510593,_0x53c694[_0xc063('0x3c')]);return db[_0xc063('0x29')]['find'](_0x510593)[_0xc063('0x23')](handleEntityNotFound(_0x4ec474,null))[_0xc063('0x23')](respondWithResult(_0x4ec474,null))[_0xc063('0x41')](handleError(_0x4ec474,null));};exports[_0xc063('0x44')]=function(_0x492850,_0x2d6548){return db[_0xc063('0x29')]['create'](_0x492850[_0xc063('0x45')],{})['then'](respondWithResult(_0x2d6548,0xc9))[_0xc063('0x41')](handleError(_0x2d6548,null));};exports[_0xc063('0x21')]=function(_0x253e6f,_0x1603c4){if(_0x253e6f['body']['id']){delete _0x253e6f[_0xc063('0x45')]['id'];}return db[_0xc063('0x29')][_0xc063('0x46')]({'where':{'id':_0x253e6f[_0xc063('0x43')]['id']}})[_0xc063('0x23')](handleEntityNotFound(_0x1603c4,null))['then'](saveUpdates(_0x253e6f[_0xc063('0x45')],null))['then'](respondWithResult(_0x1603c4,null))[_0xc063('0x41')](handleError(_0x1603c4,null));};exports[_0xc063('0x22')]=function(_0x151536,_0x3bd533){return db[_0xc063('0x29')][_0xc063('0x46')]({'where':{'id':_0x151536[_0xc063('0x43')]['id']}})[_0xc063('0x23')](handleEntityNotFound(_0x3bd533,null))[_0xc063('0x23')](removeEntity(_0x3bd533,null))[_0xc063('0x41')](handleError(_0x3bd533,null));};exports['getConfigurations']=function(_0x51a2a0,_0x16888f,_0x2e90c5){var _0x227f43={};var _0x337705={};var _0x4cd4a5;var _0x24bec2;return db[_0xc063('0x29')][_0xc063('0x47')]({'where':{'id':_0x51a2a0[_0xc063('0x43')]['id']}})[_0xc063('0x23')](handleEntityNotFound(_0x16888f,null))[_0xc063('0x23')](function(_0x571c86){if(_0x571c86){_0x4cd4a5=_0x571c86;_0x337705['model']=_[_0xc063('0x2e')](db[_0xc063('0x48')][_0xc063('0x2a')]);_0x337705[_0xc063('0x2d')]=_[_0xc063('0x2e')](_0x51a2a0[_0xc063('0x2d')]);_0x337705[_0xc063('0x2f')]=_[_0xc063('0x30')](_0x337705[_0xc063('0x31')],_0x337705[_0xc063('0x2d')]);_0x227f43[_0xc063('0x32')]=_[_0xc063('0x30')](_0x337705['model'],qs[_0xc063('0x33')](_0x51a2a0[_0xc063('0x2d')]['fields']));_0x227f43[_0xc063('0x32')]=_0x227f43['attributes'][_0xc063('0x34')]?_0x227f43[_0xc063('0x32')]:_0x337705[_0xc063('0x31')];_0x227f43['order']=qs[_0xc063('0x35')](_0x51a2a0['query'][_0xc063('0x35')]);_0x227f43[_0xc063('0x38')]=qs[_0xc063('0x2f')](_[_0xc063('0x36')](_0x51a2a0[_0xc063('0x2d')],_0x337705[_0xc063('0x2f')]));if(_0x51a2a0[_0xc063('0x2d')][_0xc063('0x37')]){_0x227f43['where']=_[_0xc063('0x39')](_0x227f43[_0xc063('0x38')],{'$or':_['map'](_0x227f43['attributes'],function(_0x46cf16){var _0x2a1bbb={};_0x2a1bbb[_0x46cf16]={'$like':'%'+_0x51a2a0[_0xc063('0x2d')][_0xc063('0x37')]+'%'};return _0x2a1bbb;})});}_0x227f43=_[_0xc063('0x39')]({},_0x227f43,_0x51a2a0[_0xc063('0x3c')]);return _0x4cd4a5['getConfigurations'](_0x227f43);}})[_0xc063('0x23')](function(_0x2b051e){if(_0x2b051e){_0x24bec2=_0x2b051e[_0xc063('0x34')];if(!_0x51a2a0[_0xc063('0x2d')][_0xc063('0x49')](_0xc063('0x4a'))){_0x227f43[_0xc063('0x1c')]=qs[_0xc063('0x1c')](_0x51a2a0[_0xc063('0x2d')][_0xc063('0x1c')]);_0x227f43[_0xc063('0x19')]=qs[_0xc063('0x19')](_0x51a2a0['query'][_0xc063('0x19')]);}return _0x4cd4a5[_0xc063('0x4b')](_0x227f43);}})['then'](function(_0x4eb00e){if(_0x4eb00e){return _0x4eb00e?{'count':_0x24bec2,'rows':_0x4eb00e}:null;}})[_0xc063('0x23')](respondWithResult(_0x16888f,null))[_0xc063('0x41')](handleError(_0x16888f,null));};exports[_0xc063('0x4c')]=function(_0x308260,_0x58d6a7,_0x4df805){if(_0x308260[_0xc063('0x45')]['id']){delete _0x308260[_0xc063('0x45')]['id'];}return db[_0xc063('0x29')][_0xc063('0x47')]({'where':{'id':_0x308260[_0xc063('0x43')]['id']}})[_0xc063('0x23')](handleEntityNotFound(_0x58d6a7,null))['then'](function(_0x1b9926){if(_0x1b9926){_0x308260[_0xc063('0x45')][_0xc063('0x4d')]=_0x1b9926['id'];_0x308260[_0xc063('0x45')][_0xc063('0x4e')]=integrations[_0xc063('0x4f')](_0x308260[_0xc063('0x45')][_0xc063('0x50')],_0x308260['body'][_0xc063('0x3a')]);_0x308260[_0xc063('0x45')]['Descriptions']=integrations[_0xc063('0x51')](_0x308260['body'][_0xc063('0x50')],_0x308260[_0xc063('0x45')][_0xc063('0x3a')]);return db['FreshdeskConfiguration'][_0xc063('0x44')](_0x308260['body'],{'include':[{'model':db['FreshdeskField'],'as':_0xc063('0x4e')},{'model':db[_0xc063('0x52')],'as':_0xc063('0x53')}]});}return null;})[_0xc063('0x23')](respondWithResult(_0x58d6a7,null))[_0xc063('0x41')](handleError(_0x58d6a7,null));};exports[_0xc063('0x54')]=function(_0x279d91,_0x5d1cfa,_0x142aa8){var _0x135a79='';return db[_0xc063('0x29')][_0xc063('0x47')]({'where':{'id':_0x279d91[_0xc063('0x43')]['id']},'attributes':['id','remoteUri',_0xc063('0x55')]})[_0xc063('0x23')](handleEntityNotFound(_0x5d1cfa,null))[_0xc063('0x23')](function(_0x578edd){if(_0x578edd){_0x135a79=_0x578edd[_0xc063('0x56')];var _0x26fa1a=_0x135a79[_0xc063('0x57')](-0x1);if(_0x26fa1a==='/'){_0x135a79=_0x135a79['substring'](0x0,_0x135a79[_0xc063('0x58')](_0x26fa1a));}return rp({'method':_0xc063('0x59'),'uri':util[_0xc063('0x5a')](_0xc063('0x5b'),_0x135a79,_0xc063('0x5c')),'headers':{'Authorization':util[_0xc063('0x5a')](_0xc063('0x5d'),new Buffer(util[_0xc063('0x5a')]('%s:X',_0x578edd[_0xc063('0x55')]))[_0xc063('0x5e')](_0xc063('0x5f')))},'json':!![]});}})[_0xc063('0x23')](function(_0x4bb9cc){if(_0x4bb9cc){var _0x341bdb=[_0xc063('0x60'),'subject',_0xc063('0x61'),_0xc063('0x62'),_0xc063('0x17'),_0xc063('0x63'),_0xc063('0x64'),'source','ticket_type',_0xc063('0x64'),'company'];_[_0xc063('0x65')](_0x4bb9cc,function(_0x5a6ebe){return _0x341bdb[_0xc063('0x66')](_0x5a6ebe[_0xc063('0x26')])||!_0x5a6ebe['default']&&_0x5a6ebe[_0xc063('0x3a')]!==_0xc063('0x67')&&_0x5a6ebe[_0xc063('0x3a')]!==_0xc063('0x68');});return{'count':_0x4bb9cc[_0xc063('0x34')],'rows':_[_0xc063('0x2c')](_0x4bb9cc,function(_0xa17283){return{'id':_0xa17283['name'],'name':_0xa17283[_0xc063('0x69')],'custom':!_0xa17283['default'],'options':_0xa17283['choices']?_['map'](_0xa17283[_0xc063('0x6a')],function(_0x1c7550){return{'name':_[_0xc063('0x6b')](_0x1c7550),'value':_0x1c7550};}):[]};})};}})['then'](respondWithResult(_0x5d1cfa,null))[_0xc063('0x41')](function(_0x37bd85){var _0x458044=_0x279d91[_0xc063('0x2d')][_0xc063('0x6c')]?0x1f4:_0x37bd85[_0xc063('0x6d')]||0x1f4;logger[_0xc063('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xc063('0x54'),_0x458044,JSON[_0xc063('0x6e')](_0x37bd85));delete _0x37bd85[_0xc063('0x26')];if(_0x458044===0x191){_0x458044=0x190;}_0x5d1cfa[_0xc063('0x17')](_0x458044)[_0xc063('0x27')](_0x279d91[_0xc063('0x2d')][_0xc063('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x37bd85[_0xc063('0x6d')]}:_0x37bd85);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index e5686dd..8447f45 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 _0xa417=['../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','moment','request-promise','path','rimraf','./intFreshdeskAccount.attributes'];(function(_0x57e00e,_0x36e79a){var _0x415e60=function(_0x5cd7fa){while(--_0x5cd7fa){_0x57e00e['push'](_0x57e00e['shift']());}};_0x415e60(++_0x36e79a);}(_0xa417,0x1f3));var _0x7a41=function(_0x5a3af1,_0x397a79){_0x5a3af1=_0x5a3af1-0x0;var _0xbaa54c=_0xa417[_0x5a3af1];return _0xbaa54c;};'use strict';var _=require(_0x7a41('0x0'));var util=require(_0x7a41('0x1'));var logger=require('../../config/logger')(_0x7a41('0x2'));var moment=require(_0x7a41('0x3'));var BPromise=require('bluebird');var rp=require(_0x7a41('0x4'));var fs=require('fs');var path=require(_0x7a41('0x5'));var rimraf=require(_0x7a41('0x6'));var config=require('../../config/environment');var attributes=require(_0x7a41('0x7'));var integrations=require(_0x7a41('0x8'));module[_0x7a41('0x9')]=function(_0x46c815,_0x317ab8){return _0x46c815[_0x7a41('0xa')](_0x7a41('0xb'),attributes,{'tableName':_0x7a41('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02c3=['../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x3e73f6,_0x4f7f01){var _0x5af991=function(_0x186e5a){while(--_0x186e5a){_0x3e73f6['push'](_0x3e73f6['shift']());}};_0x5af991(++_0x4f7f01);}(_0x02c3,0x14c));var _0x302c=function(_0x205823,_0x264609){_0x205823=_0x205823-0x0;var _0x400500=_0x02c3[_0x205823];return _0x400500;};'use strict';var _=require(_0x302c('0x0'));var util=require('util');var logger=require(_0x302c('0x1'))(_0x302c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x302c('0x3'));var fs=require('fs');var path=require(_0x302c('0x4'));var rimraf=require(_0x302c('0x5'));var config=require(_0x302c('0x6'));var attributes=require(_0x302c('0x7'));var integrations=require(_0x302c('0x8'));module[_0x302c('0x9')]=function(_0x317e51,_0x49083a){return _0x317e51[_0x302c('0xa')](_0x302c('0xb'),attributes,{'tableName':_0x302c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 93bd373..b4c1e21 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 _0x0fca=['model','GetFreshdeskAccount','debug','ShowFreshdeskAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','FreshdeskAccount','options','raw','attributes','limit','include','map'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0x0fca,0x185));var _0xa0fc=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x0fca[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xa0fc('0x0'));var util=require(_0xa0fc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa0fc('0x2'));var fs=require('fs');var Redis=require(_0xa0fc('0x3'));var db=require(_0xa0fc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0fc('0x5'))(_0xa0fc('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0fc('0x7'));var client=jayson[_0xa0fc('0x8')][_0xa0fc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4301b6,_0x245c9c,_0x241900){return new BPromise(function(_0x3bab25,_0x50800a){return client['request'](_0x4301b6,_0x241900)[_0xa0fc('0xa')](function(_0x149d5f){logger['info'](_0xa0fc('0xb'),_0x245c9c,_0xa0fc('0xc'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x245c9c,_0xa0fc('0xc'),JSON[_0xa0fc('0xd')](_0x149d5f));if(_0x149d5f[_0xa0fc('0xe')]){if(_0x149d5f[_0xa0fc('0xe')][_0xa0fc('0xf')]===0x1f4){logger[_0xa0fc('0xe')](_0xa0fc('0xb'),_0x245c9c,_0x149d5f[_0xa0fc('0xe')][_0xa0fc('0x10')]);return _0x50800a(_0x149d5f[_0xa0fc('0xe')][_0xa0fc('0x10')]);}logger[_0xa0fc('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x245c9c,_0x149d5f[_0xa0fc('0xe')][_0xa0fc('0x10')]);return _0x3bab25(_0x149d5f[_0xa0fc('0xe')][_0xa0fc('0x10')]);}else{logger[_0xa0fc('0x11')](_0xa0fc('0xb'),_0x245c9c,_0xa0fc('0xc'));_0x3bab25(_0x149d5f[_0xa0fc('0x12')][_0xa0fc('0x10')]);}})[_0xa0fc('0x13')](function(_0x28d57c){logger[_0xa0fc('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x245c9c,_0x28d57c);_0x50800a(_0x28d57c);});});}exports['GetFreshdeskAccount']=function(_0x28e29f){var _0x3cbbbb=this;return new Promise(function(_0xaac1,_0x2f24c8){return db[_0xa0fc('0x14')]['findAll']({'raw':_0x28e29f[_0xa0fc('0x15')]?_0x28e29f['options'][_0xa0fc('0x16')]===undefined?!![]:![]:!![],'where':_0x28e29f['options']?_0x28e29f[_0xa0fc('0x15')]['where']||null:null,'attributes':_0x28e29f[_0xa0fc('0x15')]?_0x28e29f[_0xa0fc('0x15')][_0xa0fc('0x17')]||null:null,'limit':_0x28e29f[_0xa0fc('0x15')]?_0x28e29f[_0xa0fc('0x15')][_0xa0fc('0x18')]||null:null,'include':_0x28e29f[_0xa0fc('0x15')]?_0x28e29f[_0xa0fc('0x15')][_0xa0fc('0x19')]?_[_0xa0fc('0x1a')](_0x28e29f[_0xa0fc('0x15')]['include'],function(_0x59def0){return{'model':db[_0x59def0[_0xa0fc('0x1b')]],'as':_0x59def0['as'],'attributes':_0x59def0[_0xa0fc('0x17')],'include':_0x59def0[_0xa0fc('0x19')]?_[_0xa0fc('0x1a')](_0x59def0['include'],function(_0x59cd83){return{'model':db[_0x59cd83[_0xa0fc('0x1b')]],'as':_0x59cd83['as'],'attributes':_0x59cd83[_0xa0fc('0x17')],'include':_0x59cd83[_0xa0fc('0x19')]?_[_0xa0fc('0x1a')](_0x59cd83[_0xa0fc('0x19')],function(_0xd3c5f2){return{'model':db[_0xd3c5f2[_0xa0fc('0x1b')]],'as':_0xd3c5f2['as'],'attributes':_0xd3c5f2[_0xa0fc('0x17')]};}):[]};}):[]};}):[]:[]})[_0xa0fc('0xa')](function(_0x21c7c6){logger[_0xa0fc('0x11')](_0xa0fc('0x1c'),_0x28e29f);logger[_0xa0fc('0x1d')]('GetFreshdeskAccount',_0x28e29f,JSON['stringify'](_0x21c7c6));_0xaac1(_0x21c7c6);})[_0xa0fc('0x13')](function(_0x4f8fa7){logger['error'](_0xa0fc('0x1c'),_0x4f8fa7['message'],_0x28e29f);_0x2f24c8(_0x3cbbbb[_0xa0fc('0xe')](0x1f4,_0x4f8fa7[_0xa0fc('0x10')]));});});};exports[_0xa0fc('0x1e')]=function(_0x286ee4){var _0x4fd912=this;return new Promise(function(_0x46b1e7,_0x5d36f0){return db[_0xa0fc('0x14')][_0xa0fc('0x1f')]({'raw':_0x286ee4[_0xa0fc('0x15')]?_0x286ee4[_0xa0fc('0x15')][_0xa0fc('0x16')]===undefined?!![]:![]:!![],'where':_0x286ee4[_0xa0fc('0x15')]?_0x286ee4[_0xa0fc('0x15')]['where']||null:null,'attributes':_0x286ee4['options']?_0x286ee4[_0xa0fc('0x15')][_0xa0fc('0x17')]||null:null,'include':_0x286ee4['options']?_0x286ee4[_0xa0fc('0x15')][_0xa0fc('0x19')]?_[_0xa0fc('0x1a')](_0x286ee4['options']['include'],function(_0x3918bc){return{'model':db[_0x3918bc[_0xa0fc('0x1b')]],'as':_0x3918bc['as'],'attributes':_0x3918bc[_0xa0fc('0x17')],'include':_0x3918bc[_0xa0fc('0x19')]?_[_0xa0fc('0x1a')](_0x3918bc[_0xa0fc('0x19')],function(_0x3fa606){return{'model':db[_0x3fa606[_0xa0fc('0x1b')]],'as':_0x3fa606['as'],'attributes':_0x3fa606[_0xa0fc('0x17')],'include':_0x3fa606[_0xa0fc('0x19')]?_['map'](_0x3fa606[_0xa0fc('0x19')],function(_0x3047a5){return{'model':db[_0x3047a5['model']],'as':_0x3047a5['as'],'attributes':_0x3047a5['attributes']};}):[]};}):[]};}):[]:[]})[_0xa0fc('0xa')](function(_0x1f6cb9){logger[_0xa0fc('0x11')]('ShowFreshdeskAccount',_0x286ee4);logger[_0xa0fc('0x1d')](_0xa0fc('0x1e'),_0x286ee4,JSON[_0xa0fc('0xd')](_0x1f6cb9));_0x46b1e7(_0x1f6cb9);})[_0xa0fc('0x13')](function(_0x4927d6){logger[_0xa0fc('0xe')](_0xa0fc('0x1e'),_0x4927d6[_0xa0fc('0x10')],_0x286ee4);_0x5d36f0(_0x4fd912['error'](0x1f4,_0x4927d6[_0xa0fc('0x10')]));});});}; \ No newline at end of file +var _0xae56=['where','attributes','limit','map','include','model','debug','ShowFreshdeskAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw'];(function(_0x54c5bf,_0x2d5158){var _0x7ec0aa=function(_0x543d91){while(--_0x543d91){_0x54c5bf['push'](_0x54c5bf['shift']());}};_0x7ec0aa(++_0x2d5158);}(_0xae56,0xae));var _0x6ae5=function(_0x5760c2,_0x3c5d47){_0x5760c2=_0x5760c2-0x0;var _0x230832=_0xae56[_0x5760c2];return _0x230832;};'use strict';var _=require(_0x6ae5('0x0'));var util=require('util');var moment=require(_0x6ae5('0x1'));var BPromise=require(_0x6ae5('0x2'));var rs=require(_0x6ae5('0x3'));var fs=require('fs');var Redis=require(_0x6ae5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6ae5('0x5'))('rpc');var config=require(_0x6ae5('0x6'));var jayson=require(_0x6ae5('0x7'));var client=jayson[_0x6ae5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48ce95,_0x3896a1,_0x259eb2){return new BPromise(function(_0x40d01f,_0x44fd99){return client[_0x6ae5('0x9')](_0x48ce95,_0x259eb2)[_0x6ae5('0xa')](function(_0x43c27c){logger[_0x6ae5('0xb')](_0x6ae5('0xc'),_0x3896a1,_0x6ae5('0xd'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x3896a1,'request\x20sent',JSON[_0x6ae5('0xe')](_0x43c27c));if(_0x43c27c[_0x6ae5('0xf')]){if(_0x43c27c[_0x6ae5('0xf')][_0x6ae5('0x10')]===0x1f4){logger[_0x6ae5('0xf')](_0x6ae5('0xc'),_0x3896a1,_0x43c27c[_0x6ae5('0xf')][_0x6ae5('0x11')]);return _0x44fd99(_0x43c27c[_0x6ae5('0xf')]['message']);}logger[_0x6ae5('0xf')](_0x6ae5('0xc'),_0x3896a1,_0x43c27c[_0x6ae5('0xf')][_0x6ae5('0x11')]);return _0x40d01f(_0x43c27c[_0x6ae5('0xf')][_0x6ae5('0x11')]);}else{logger['info'](_0x6ae5('0xc'),_0x3896a1,'request\x20sent');_0x40d01f(_0x43c27c['result']['message']);}})[_0x6ae5('0x12')](function(_0xc479c9){logger[_0x6ae5('0xf')](_0x6ae5('0xc'),_0x3896a1,_0xc479c9);_0x44fd99(_0xc479c9);});});}exports[_0x6ae5('0x13')]=function(_0x91c850){var _0x267891=this;return new Promise(function(_0x459a8e,_0xc44ee1){return db[_0x6ae5('0x14')][_0x6ae5('0x15')]({'raw':_0x91c850[_0x6ae5('0x16')]?_0x91c850[_0x6ae5('0x16')][_0x6ae5('0x17')]===undefined?!![]:![]:!![],'where':_0x91c850[_0x6ae5('0x16')]?_0x91c850[_0x6ae5('0x16')][_0x6ae5('0x18')]||null:null,'attributes':_0x91c850[_0x6ae5('0x16')]?_0x91c850[_0x6ae5('0x16')][_0x6ae5('0x19')]||null:null,'limit':_0x91c850[_0x6ae5('0x16')]?_0x91c850[_0x6ae5('0x16')][_0x6ae5('0x1a')]||null:null,'include':_0x91c850[_0x6ae5('0x16')]?_0x91c850[_0x6ae5('0x16')]['include']?_[_0x6ae5('0x1b')](_0x91c850[_0x6ae5('0x16')][_0x6ae5('0x1c')],function(_0x1f54c6){return{'model':db[_0x1f54c6[_0x6ae5('0x1d')]],'as':_0x1f54c6['as'],'attributes':_0x1f54c6[_0x6ae5('0x19')],'include':_0x1f54c6['include']?_[_0x6ae5('0x1b')](_0x1f54c6[_0x6ae5('0x1c')],function(_0xd6011){return{'model':db[_0xd6011[_0x6ae5('0x1d')]],'as':_0xd6011['as'],'attributes':_0xd6011['attributes'],'include':_0xd6011['include']?_[_0x6ae5('0x1b')](_0xd6011['include'],function(_0x7a79bd){return{'model':db[_0x7a79bd[_0x6ae5('0x1d')]],'as':_0x7a79bd['as'],'attributes':_0x7a79bd[_0x6ae5('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x559b2c){logger['info'](_0x6ae5('0x13'),_0x91c850);logger[_0x6ae5('0x1e')](_0x6ae5('0x13'),_0x91c850,JSON[_0x6ae5('0xe')](_0x559b2c));_0x459a8e(_0x559b2c);})[_0x6ae5('0x12')](function(_0x70e319){logger[_0x6ae5('0xf')](_0x6ae5('0x13'),_0x70e319[_0x6ae5('0x11')],_0x91c850);_0xc44ee1(_0x267891[_0x6ae5('0xf')](0x1f4,_0x70e319['message']));});});};exports[_0x6ae5('0x1f')]=function(_0x3e0d9b){var _0x336439=this;return new Promise(function(_0x5add4f,_0x27f83e){return db[_0x6ae5('0x14')][_0x6ae5('0x20')]({'raw':_0x3e0d9b['options']?_0x3e0d9b[_0x6ae5('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3e0d9b['options']?_0x3e0d9b[_0x6ae5('0x16')][_0x6ae5('0x18')]||null:null,'attributes':_0x3e0d9b[_0x6ae5('0x16')]?_0x3e0d9b[_0x6ae5('0x16')][_0x6ae5('0x19')]||null:null,'include':_0x3e0d9b[_0x6ae5('0x16')]?_0x3e0d9b['options'][_0x6ae5('0x1c')]?_[_0x6ae5('0x1b')](_0x3e0d9b['options'][_0x6ae5('0x1c')],function(_0x8b29b5){return{'model':db[_0x8b29b5[_0x6ae5('0x1d')]],'as':_0x8b29b5['as'],'attributes':_0x8b29b5[_0x6ae5('0x19')],'include':_0x8b29b5[_0x6ae5('0x1c')]?_['map'](_0x8b29b5[_0x6ae5('0x1c')],function(_0x1266a1){return{'model':db[_0x1266a1[_0x6ae5('0x1d')]],'as':_0x1266a1['as'],'attributes':_0x1266a1['attributes'],'include':_0x1266a1[_0x6ae5('0x1c')]?_[_0x6ae5('0x1b')](_0x1266a1[_0x6ae5('0x1c')],function(_0x3afe6b){return{'model':db[_0x3afe6b[_0x6ae5('0x1d')]],'as':_0x3afe6b['as'],'attributes':_0x3afe6b[_0x6ae5('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6ae5('0xa')](function(_0x1ad460){logger['info'](_0x6ae5('0x1f'),_0x3e0d9b);logger[_0x6ae5('0x1e')](_0x6ae5('0x1f'),_0x3e0d9b,JSON['stringify'](_0x1ad460));_0x5add4f(_0x1ad460);})[_0x6ae5('0x12')](function(_0x2ba05e){logger[_0x6ae5('0xf')]('ShowFreshdeskAccount',_0x2ba05e[_0x6ae5('0x11')],_0x3e0d9b);_0x27f83e(_0x336439[_0x6ae5('0xf')](0x1f4,_0x2ba05e[_0x6ae5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index c5e17ba..284db2c 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 _0x0a2f=['express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getTags','post','setTags','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1e9403,_0x5f2b2c){var _0x2848b0=function(_0x573990){while(--_0x573990){_0x1e9403['push'](_0x1e9403['shift']());}};_0x2848b0(++_0x5f2b2c);}(_0x0a2f,0xab));var _0xf0a2=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x0a2f[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0xf0a2('0x0'));var util=require(_0xf0a2('0x1'));var path=require(_0xf0a2('0x2'));var timeout=require(_0xf0a2('0x3'));var express=require(_0xf0a2('0x4'));var router=express[_0xf0a2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf0a2('0x6'));var interaction=require(_0xf0a2('0x7'));var config=require('../../config/environment');var controller=require(_0xf0a2('0x8'));router[_0xf0a2('0x9')]('/',auth[_0xf0a2('0xa')](),controller[_0xf0a2('0xb')]);router['get'](_0xf0a2('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xf0a2('0xd'),auth[_0xf0a2('0xa')](),controller[_0xf0a2('0xe')]);router[_0xf0a2('0x9')](_0xf0a2('0xf'),auth[_0xf0a2('0xa')](),controller[_0xf0a2('0x10')]);router[_0xf0a2('0x9')](_0xf0a2('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xf0a2('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0xf0a2('0x12')]);router[_0xf0a2('0x13')]('/',auth[_0xf0a2('0xa')](),controller['create']);router[_0xf0a2('0x13')]('/:id/tags',auth[_0xf0a2('0xa')](),controller[_0xf0a2('0x14')]);router[_0xf0a2('0x15')](_0xf0a2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf0a2('0x16')](_0xf0a2('0xc'),auth[_0xf0a2('0xa')](),controller[_0xf0a2('0x17')]);module[_0xf0a2('0x18')]=router; \ No newline at end of file +var _0x0088=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','setTags','put','/:id','delete','destroy','exports','multer'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x0088,0x1e5));var _0x8008=function(_0x582198,_0x285c31){_0x582198=_0x582198-0x0;var _0x32a86a=_0x0088[_0x582198];return _0x32a86a;};'use strict';var multer=require(_0x8008('0x0'));var util=require(_0x8008('0x1'));var path=require(_0x8008('0x2'));var timeout=require(_0x8008('0x3'));var express=require(_0x8008('0x4'));var router=express[_0x8008('0x5')]();var fs_extra=require(_0x8008('0x6'));var auth=require(_0x8008('0x7'));var interaction=require(_0x8008('0x8'));var config=require(_0x8008('0x9'));var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x8008('0xa')](),controller[_0x8008('0xb')]);router[_0x8008('0xc')]('/:id',auth[_0x8008('0xa')](),controller[_0x8008('0xd')]);router[_0x8008('0xc')](_0x8008('0xe'),auth['isAuthenticated'](),controller[_0x8008('0xf')]);router[_0x8008('0xc')](_0x8008('0x10'),auth['isAuthenticated'](),controller[_0x8008('0x11')]);router[_0x8008('0xc')]('/:id/descriptions',auth[_0x8008('0xa')](),controller[_0x8008('0x12')]);router['get'](_0x8008('0x13'),auth[_0x8008('0xa')](),controller['getTags']);router[_0x8008('0x14')]('/',auth[_0x8008('0xa')](),controller['create']);router[_0x8008('0x14')](_0x8008('0x13'),auth[_0x8008('0xa')](),controller[_0x8008('0x15')]);router[_0x8008('0x16')](_0x8008('0x17'),auth[_0x8008('0xa')](),controller['update']);router[_0x8008('0x18')](_0x8008('0x17'),auth['isAuthenticated'](),controller[_0x8008('0x19')]);module[_0x8008('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 43e109d..5e14d6b 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 _0x3fd9=['sequelize','exports','STRING'];(function(_0x593bd7,_0x495127){var _0x76657b=function(_0x17fd0d){while(--_0x17fd0d){_0x593bd7['push'](_0x593bd7['shift']());}};_0x76657b(++_0x495127);}(_0x3fd9,0x12f));var _0x93fd=function(_0x1c3364,_0x33d672){_0x1c3364=_0x1c3364-0x0;var _0x37ba34=_0x3fd9[_0x1c3364];return _0x37ba34;};'use strict';var Sequelize=require(_0x93fd('0x0'));module[_0x93fd('0x1')]={'name':{'type':Sequelize[_0x93fd('0x2')]},'description':{'type':Sequelize[_0x93fd('0x2')]}}; \ No newline at end of file +var _0x7fb8=['sequelize','exports','STRING'];(function(_0x26bec8,_0x2cca48){var _0x4a5d80=function(_0x3f819d){while(--_0x3f819d){_0x26bec8['push'](_0x26bec8['shift']());}};_0x4a5d80(++_0x2cca48);}(_0x7fb8,0x153));var _0x87fb=function(_0x1fe24d,_0x521d07){_0x1fe24d=_0x1fe24d-0x0;var _0x1f8641=_0x7fb8[_0x1fe24d];return _0x1f8641;};'use strict';var Sequelize=require(_0x87fb('0x0'));module[_0x87fb('0x1')]={'name':{'type':Sequelize[_0x87fb('0x2')]},'description':{'type':Sequelize[_0x87fb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 8d27e0a..9153e7a 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 _0x474d=['fieldName','key','map','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','create','body','update','find','findOne','FreshdeskField','getFields','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','ids','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','index','FreshdeskConfiguration','rawAttributes'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x474d,0x166));var _0xd474=function(_0x1811da,_0x3c3442){_0x1811da=_0x1811da-0x0;var _0x5bdf68=_0x474d[_0x1811da];return _0x5bdf68;};'use strict';var emlformat=require(_0xd474('0x0'));var rimraf=require(_0xd474('0x1'));var zipdir=require(_0xd474('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd474('0x3'));var Mustache=require(_0xd474('0x4'));var util=require(_0xd474('0x5'));var path=require('path');var sox=require(_0xd474('0x6'));var csv=require(_0xd474('0x7'));var ejs=require(_0xd474('0x8'));var fs=require('fs');var fs_extra=require(_0xd474('0x9'));var _=require(_0xd474('0xa'));var squel=require(_0xd474('0xb'));var crypto=require('crypto');var jsforce=require(_0xd474('0xc'));var deskjs=require(_0xd474('0xd'));var toCsv=require(_0xd474('0x7'));var querystring=require(_0xd474('0xe'));var Papa=require(_0xd474('0xf'));var Redis=require(_0xd474('0x10'));var authService=require(_0xd474('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd474('0x12'));var logger=require(_0xd474('0x13'))('api');var utils=require(_0xd474('0x14'));var config=require(_0xd474('0x15'));var licenseUtil=require(_0xd474('0x16'));var db=require(_0xd474('0x17'))['db'];function respondWithStatusCode(_0x2fb536,_0x6b9a28){_0x6b9a28=_0x6b9a28||0xcc;return function(_0x50feca){if(_0x50feca){return _0x2fb536['sendStatus'](_0x6b9a28);}return _0x2fb536[_0xd474('0x18')](_0x6b9a28)[_0xd474('0x19')]();};}function respondWithResult(_0x433ef5,_0x432b66){_0x432b66=_0x432b66||0xc8;return function(_0x71fecc){if(_0x71fecc){return _0x433ef5[_0xd474('0x18')](_0x432b66)['json'](_0x71fecc);}};}function respondWithFilteredResult(_0x1d85c6,_0x41bf24){return function(_0x4304a8){if(_0x4304a8){var _0x240861=typeof _0x41bf24[_0xd474('0x1a')]==='undefined'&&typeof _0x41bf24[_0xd474('0x1b')]==='undefined';var _0x1ee310=_0x4304a8[_0xd474('0x1c')];var _0x87a314=_0x240861?0x0:_0x41bf24[_0xd474('0x1a')];var _0x9a6504=_0x240861?_0x4304a8[_0xd474('0x1c')]:_0x41bf24[_0xd474('0x1a')]+_0x41bf24[_0xd474('0x1b')];var _0x48f5bf;if(_0x9a6504>=_0x1ee310){_0x9a6504=_0x1ee310;_0x48f5bf=0xc8;}else{_0x48f5bf=0xce;}_0x1d85c6[_0xd474('0x18')](_0x48f5bf);return _0x1d85c6[_0xd474('0x1d')](_0xd474('0x1e'),_0x87a314+'-'+_0x9a6504+'/'+_0x1ee310)['json'](_0x4304a8);}return null;};}function patchUpdates(_0x3097fa){return function(_0x273dc0){try{jsonpatch[_0xd474('0x1f')](_0x273dc0,_0x3097fa,!![]);}catch(_0x47015b){return BPromise[_0xd474('0x20')](_0x47015b);}return _0x273dc0[_0xd474('0x21')]();};}function saveUpdates(_0x4a9955,_0x168d78){return function(_0x46eebd){if(_0x46eebd){return _0x46eebd['update'](_0x4a9955)[_0xd474('0x22')](function(_0x9ebe4c){return _0x9ebe4c;});}return null;};}function removeEntity(_0x16cff2,_0x56f225){return function(_0x5be80c){if(_0x5be80c){return _0x5be80c[_0xd474('0x23')]()[_0xd474('0x22')](function(){_0x16cff2[_0xd474('0x18')](0xcc)[_0xd474('0x19')]();});}};}function handleEntityNotFound(_0x44c2c0,_0x44b3b9){return function(_0x399700){if(!_0x399700){_0x44c2c0[_0xd474('0x24')](0x194);}return _0x399700;};}function handleError(_0x3e493a,_0x3392e1){_0x3392e1=_0x3392e1||0x1f4;return function(_0x14b6a1){logger['error'](_0x14b6a1[_0xd474('0x25')]);if(_0x14b6a1[_0xd474('0x26')]){delete _0x14b6a1[_0xd474('0x26')];}_0x3e493a[_0xd474('0x18')](_0x3392e1)['send'](_0x14b6a1);};}exports[_0xd474('0x27')]=function(_0x409b2a,_0x2e0e60){var _0x1fcda9={},_0x2ed294={},_0x447e6d={'count':0x0,'rows':[]};var _0x4f21c5=_['map'](db[_0xd474('0x28')][_0xd474('0x29')],function(_0x38d0b6){return{'name':_0x38d0b6[_0xd474('0x2a')],'type':_0x38d0b6['type'][_0xd474('0x2b')]};});_0x2ed294['model']=_[_0xd474('0x2c')](_0x4f21c5,_0xd474('0x26'));_0x2ed294[_0xd474('0x2d')]=_[_0xd474('0x2e')](_0x409b2a['query']);_0x2ed294[_0xd474('0x2f')]=_['intersection'](_0x2ed294[_0xd474('0x30')],_0x2ed294[_0xd474('0x2d')]);_0x1fcda9['attributes']=_[_0xd474('0x31')](_0x2ed294[_0xd474('0x30')],qs[_0xd474('0x32')](_0x409b2a['query']['fields']));_0x1fcda9['attributes']=_0x1fcda9[_0xd474('0x33')][_0xd474('0x34')]?_0x1fcda9['attributes']:_0x2ed294[_0xd474('0x30')];if(!_0x409b2a[_0xd474('0x2d')]['hasOwnProperty'](_0xd474('0x35'))){_0x1fcda9['limit']=qs['limit'](_0x409b2a[_0xd474('0x2d')]['limit']);_0x1fcda9[_0xd474('0x1a')]=qs['offset'](_0x409b2a[_0xd474('0x2d')][_0xd474('0x1a')]);}_0x1fcda9[_0xd474('0x36')]=qs[_0xd474('0x37')](_0x409b2a['query'][_0xd474('0x37')]);_0x1fcda9[_0xd474('0x38')]=qs['filters'](_[_0xd474('0x39')](_0x409b2a[_0xd474('0x2d')],_0x2ed294[_0xd474('0x2f')]),_0x4f21c5);if(_0x409b2a[_0xd474('0x2d')][_0xd474('0x3a')]){_0x1fcda9[_0xd474('0x38')]=_[_0xd474('0x3b')](_0x1fcda9['where'],{'$or':_[_0xd474('0x2c')](_0x4f21c5,function(_0x166a71){if(_0x166a71['type']!==_0xd474('0x3c')){var _0x5b7002={};_0x5b7002[_0x166a71[_0xd474('0x26')]]={'$like':'%'+_0x409b2a[_0xd474('0x2d')][_0xd474('0x3a')]+'%'};return _0x5b7002;}})});}_0x1fcda9=_[_0xd474('0x3b')]({},_0x1fcda9,_0x409b2a[_0xd474('0x3d')]);var _0x43bc3a={'where':_0x1fcda9[_0xd474('0x38')]};return db[_0xd474('0x28')]['count'](_0x43bc3a)[_0xd474('0x22')](function(_0x25e59d){_0x447e6d[_0xd474('0x1c')]=_0x25e59d;if(_0x409b2a[_0xd474('0x2d')]['includeAll']){_0x1fcda9[_0xd474('0x3e')]=[{'all':!![]}];}return db[_0xd474('0x28')][_0xd474('0x3f')](_0x1fcda9);})[_0xd474('0x22')](function(_0x59959b){_0x447e6d['rows']=_0x59959b;return _0x447e6d;})['then'](respondWithFilteredResult(_0x2e0e60,_0x1fcda9))[_0xd474('0x40')](handleError(_0x2e0e60,null));};exports[_0xd474('0x41')]=function(_0x3d3435,_0xcf36e4){var _0x57e1ec={'raw':![],'where':{'id':_0x3d3435[_0xd474('0x42')]['id']}},_0x124d5e={};_0x124d5e['model']=_[_0xd474('0x2e')](db[_0xd474('0x28')][_0xd474('0x29')]);_0x124d5e[_0xd474('0x2d')]=_[_0xd474('0x2e')](_0x3d3435[_0xd474('0x2d')]);_0x124d5e[_0xd474('0x2f')]=_[_0xd474('0x31')](_0x124d5e['model'],_0x124d5e[_0xd474('0x2d')]);_0x57e1ec[_0xd474('0x33')]=_[_0xd474('0x31')](_0x124d5e['model'],qs[_0xd474('0x32')](_0x3d3435['query'][_0xd474('0x32')]));_0x57e1ec[_0xd474('0x33')]=_0x57e1ec['attributes']['length']?_0x57e1ec[_0xd474('0x33')]:_0x124d5e[_0xd474('0x30')];if(_0x3d3435[_0xd474('0x2d')]['includeAll']){_0x57e1ec[_0xd474('0x3e')]=[{'all':!![]}];}_0x57e1ec=_[_0xd474('0x3b')]({},_0x57e1ec,_0x3d3435[_0xd474('0x3d')]);return db['FreshdeskConfiguration']['find'](_0x57e1ec)[_0xd474('0x22')](handleEntityNotFound(_0xcf36e4,null))['then'](respondWithResult(_0xcf36e4,null))['catch'](handleError(_0xcf36e4,null));};exports[_0xd474('0x43')]=function(_0x20a1be,_0x5acfd6){return db[_0xd474('0x28')][_0xd474('0x43')](_0x20a1be[_0xd474('0x44')],{})[_0xd474('0x22')](respondWithResult(_0x5acfd6,0xc9))['catch'](handleError(_0x5acfd6,null));};exports[_0xd474('0x45')]=function(_0x44db7b,_0x58f663){if(_0x44db7b[_0xd474('0x44')]['id']){delete _0x44db7b[_0xd474('0x44')]['id'];}return db[_0xd474('0x28')][_0xd474('0x46')]({'where':{'id':_0x44db7b['params']['id']}})['then'](handleEntityNotFound(_0x58f663,null))['then'](saveUpdates(_0x44db7b['body'],null))[_0xd474('0x22')](respondWithResult(_0x58f663,null))[_0xd474('0x40')](handleError(_0x58f663,null));};exports[_0xd474('0x23')]=function(_0x1a712b,_0x575122){return db[_0xd474('0x28')]['find']({'where':{'id':_0x1a712b[_0xd474('0x42')]['id']}})[_0xd474('0x22')](handleEntityNotFound(_0x575122,null))['then'](removeEntity(_0x575122,null))[_0xd474('0x40')](handleError(_0x575122,null));};exports['getFields']=function(_0x1cfb4d,_0x2c8797,_0x365cb0){var _0x17b2a9={};var _0x11c122={};var _0x43c818;var _0x47d27e;return db['FreshdeskConfiguration'][_0xd474('0x47')]({'where':{'id':_0x1cfb4d['params']['id']}})['then'](handleEntityNotFound(_0x2c8797,null))[_0xd474('0x22')](function(_0x54e320){if(_0x54e320){_0x43c818=_0x54e320;_0x11c122[_0xd474('0x30')]=_[_0xd474('0x2e')](db[_0xd474('0x48')][_0xd474('0x29')]);_0x11c122[_0xd474('0x2d')]=_['keys'](_0x1cfb4d[_0xd474('0x2d')]);_0x11c122[_0xd474('0x2f')]=_[_0xd474('0x31')](_0x11c122[_0xd474('0x30')],_0x11c122['query']);_0x17b2a9[_0xd474('0x33')]=_[_0xd474('0x31')](_0x11c122[_0xd474('0x30')],qs[_0xd474('0x32')](_0x1cfb4d['query']['fields']));_0x17b2a9[_0xd474('0x33')]=_0x17b2a9[_0xd474('0x33')][_0xd474('0x34')]?_0x17b2a9[_0xd474('0x33')]:_0x11c122[_0xd474('0x30')];_0x17b2a9['order']=qs[_0xd474('0x37')](_0x1cfb4d[_0xd474('0x2d')][_0xd474('0x37')]);_0x17b2a9[_0xd474('0x38')]=qs['filters'](_[_0xd474('0x39')](_0x1cfb4d[_0xd474('0x2d')],_0x11c122[_0xd474('0x2f')]));if(_0x1cfb4d[_0xd474('0x2d')]['filter']){_0x17b2a9[_0xd474('0x38')]=_[_0xd474('0x3b')](_0x17b2a9[_0xd474('0x38')],{'$or':_[_0xd474('0x2c')](_0x17b2a9[_0xd474('0x33')],function(_0x424366){var _0x4a8953={};_0x4a8953[_0x424366]={'$like':'%'+_0x1cfb4d[_0xd474('0x2d')][_0xd474('0x3a')]+'%'};return _0x4a8953;})});}_0x17b2a9=_['merge']({},_0x17b2a9,_0x1cfb4d[_0xd474('0x3d')]);return _0x43c818[_0xd474('0x49')](_0x17b2a9);}})[_0xd474('0x22')](function(_0x3c0821){if(_0x3c0821){_0x47d27e=_0x3c0821[_0xd474('0x34')];if(!_0x1cfb4d[_0xd474('0x2d')][_0xd474('0x4a')](_0xd474('0x35'))){_0x17b2a9[_0xd474('0x1b')]=qs['limit'](_0x1cfb4d[_0xd474('0x2d')][_0xd474('0x1b')]);_0x17b2a9['offset']=qs[_0xd474('0x1a')](_0x1cfb4d[_0xd474('0x2d')][_0xd474('0x1a')]);}return _0x43c818[_0xd474('0x49')](_0x17b2a9);}})[_0xd474('0x22')](function(_0x26b04e){if(_0x26b04e){return _0x26b04e?{'count':_0x47d27e,'rows':_0x26b04e}:null;}})[_0xd474('0x22')](respondWithResult(_0x2c8797,null))[_0xd474('0x40')](handleError(_0x2c8797,null));};exports[_0xd474('0x4b')]=function(_0x151565,_0x11e656,_0x3b8947){var _0x40c038={};var _0x5e441d={};var _0x44a23e;var _0x4fbf35;return db[_0xd474('0x28')][_0xd474('0x47')]({'where':{'id':_0x151565['params']['id']}})[_0xd474('0x22')](handleEntityNotFound(_0x11e656,null))['then'](function(_0x2109e8){if(_0x2109e8){_0x44a23e=_0x2109e8;_0x5e441d['model']=_['keys'](db[_0xd474('0x48')]['rawAttributes']);_0x5e441d[_0xd474('0x2d')]=_[_0xd474('0x2e')](_0x151565[_0xd474('0x2d')]);_0x5e441d[_0xd474('0x2f')]=_[_0xd474('0x31')](_0x5e441d[_0xd474('0x30')],_0x5e441d[_0xd474('0x2d')]);_0x40c038[_0xd474('0x33')]=_[_0xd474('0x31')](_0x5e441d[_0xd474('0x30')],qs[_0xd474('0x32')](_0x151565['query'][_0xd474('0x32')]));_0x40c038['attributes']=_0x40c038['attributes'][_0xd474('0x34')]?_0x40c038[_0xd474('0x33')]:_0x5e441d[_0xd474('0x30')];_0x40c038[_0xd474('0x36')]=qs[_0xd474('0x37')](_0x151565['query'][_0xd474('0x37')]);_0x40c038['where']=qs[_0xd474('0x2f')](_[_0xd474('0x39')](_0x151565[_0xd474('0x2d')],_0x5e441d[_0xd474('0x2f')]));if(_0x151565[_0xd474('0x2d')][_0xd474('0x3a')]){_0x40c038[_0xd474('0x38')]=_[_0xd474('0x3b')](_0x40c038[_0xd474('0x38')],{'$or':_[_0xd474('0x2c')](_0x40c038[_0xd474('0x33')],function(_0x191253){var _0x83c409={};_0x83c409[_0x191253]={'$like':'%'+_0x151565[_0xd474('0x2d')][_0xd474('0x3a')]+'%'};return _0x83c409;})});}_0x40c038=_['merge']({},_0x40c038,_0x151565[_0xd474('0x3d')]);return _0x44a23e['getSubjects'](_0x40c038);}})[_0xd474('0x22')](function(_0x2d70d3){if(_0x2d70d3){_0x4fbf35=_0x2d70d3[_0xd474('0x34')];if(!_0x151565[_0xd474('0x2d')][_0xd474('0x4a')](_0xd474('0x35'))){_0x40c038[_0xd474('0x1b')]=qs['limit'](_0x151565[_0xd474('0x2d')][_0xd474('0x1b')]);_0x40c038[_0xd474('0x1a')]=qs[_0xd474('0x1a')](_0x151565['query'][_0xd474('0x1a')]);}return _0x44a23e[_0xd474('0x4b')](_0x40c038);}})[_0xd474('0x22')](function(_0x2122d7){if(_0x2122d7){return _0x2122d7?{'count':_0x4fbf35,'rows':_0x2122d7}:null;}})[_0xd474('0x22')](respondWithResult(_0x11e656,null))['catch'](handleError(_0x11e656,null));};exports[_0xd474('0x4c')]=function(_0x470466,_0x156d4b,_0xb3bffe){var _0x1a433e={};var _0x5029b5={};var _0x499e9f;var _0x49911b;return db[_0xd474('0x28')][_0xd474('0x47')]({'where':{'id':_0x470466[_0xd474('0x42')]['id']}})[_0xd474('0x22')](handleEntityNotFound(_0x156d4b,null))[_0xd474('0x22')](function(_0x4410d4){if(_0x4410d4){_0x499e9f=_0x4410d4;_0x5029b5[_0xd474('0x30')]=_[_0xd474('0x2e')](db[_0xd474('0x48')][_0xd474('0x29')]);_0x5029b5['query']=_[_0xd474('0x2e')](_0x470466[_0xd474('0x2d')]);_0x5029b5[_0xd474('0x2f')]=_[_0xd474('0x31')](_0x5029b5[_0xd474('0x30')],_0x5029b5[_0xd474('0x2d')]);_0x1a433e['attributes']=_[_0xd474('0x31')](_0x5029b5['model'],qs[_0xd474('0x32')](_0x470466[_0xd474('0x2d')]['fields']));_0x1a433e['attributes']=_0x1a433e[_0xd474('0x33')][_0xd474('0x34')]?_0x1a433e['attributes']:_0x5029b5['model'];_0x1a433e[_0xd474('0x36')]=qs['sort'](_0x470466[_0xd474('0x2d')][_0xd474('0x37')]);_0x1a433e[_0xd474('0x38')]=qs[_0xd474('0x2f')](_[_0xd474('0x39')](_0x470466[_0xd474('0x2d')],_0x5029b5[_0xd474('0x2f')]));if(_0x470466['query'][_0xd474('0x3a')]){_0x1a433e[_0xd474('0x38')]=_[_0xd474('0x3b')](_0x1a433e['where'],{'$or':_[_0xd474('0x2c')](_0x1a433e[_0xd474('0x33')],function(_0x5b7939){var _0x38327c={};_0x38327c[_0x5b7939]={'$like':'%'+_0x470466[_0xd474('0x2d')][_0xd474('0x3a')]+'%'};return _0x38327c;})});}_0x1a433e=_['merge']({},_0x1a433e,_0x470466['options']);return _0x499e9f[_0xd474('0x4c')](_0x1a433e);}})[_0xd474('0x22')](function(_0x5d0266){if(_0x5d0266){_0x49911b=_0x5d0266[_0xd474('0x34')];if(!_0x470466[_0xd474('0x2d')][_0xd474('0x4a')](_0xd474('0x35'))){_0x1a433e[_0xd474('0x1b')]=qs['limit'](_0x470466[_0xd474('0x2d')][_0xd474('0x1b')]);_0x1a433e[_0xd474('0x1a')]=qs['offset'](_0x470466[_0xd474('0x2d')]['offset']);}return _0x499e9f['getDescriptions'](_0x1a433e);}})['then'](function(_0x52350f){if(_0x52350f){return _0x52350f?{'count':_0x49911b,'rows':_0x52350f}:null;}})[_0xd474('0x22')](respondWithResult(_0x156d4b,null))['catch'](handleError(_0x156d4b,null));};exports[_0xd474('0x4d')]=function(_0x1c15d5,_0x51d70a,_0x398d3c){var _0x3a4f94={};var _0x528432={};var _0x5655b5;var _0x46a646;return db[_0xd474('0x28')][_0xd474('0x47')]({'where':{'id':_0x1c15d5[_0xd474('0x42')]['id']}})['then'](handleEntityNotFound(_0x51d70a,null))['then'](function(_0x466b42){if(_0x466b42){_0x5655b5=_0x466b42;_0x528432['model']=_['keys'](db[_0xd474('0x4e')]['rawAttributes']);_0x528432[_0xd474('0x2d')]=_[_0xd474('0x2e')](_0x1c15d5['query']);_0x528432['filters']=_[_0xd474('0x31')](_0x528432[_0xd474('0x30')],_0x528432[_0xd474('0x2d')]);_0x3a4f94[_0xd474('0x33')]=_[_0xd474('0x31')](_0x528432[_0xd474('0x30')],qs['fields'](_0x1c15d5[_0xd474('0x2d')][_0xd474('0x32')]));_0x3a4f94[_0xd474('0x33')]=_0x3a4f94['attributes'][_0xd474('0x34')]?_0x3a4f94[_0xd474('0x33')]:_0x528432[_0xd474('0x30')];_0x3a4f94[_0xd474('0x36')]=qs[_0xd474('0x37')](_0x1c15d5[_0xd474('0x2d')]['sort']);_0x3a4f94[_0xd474('0x38')]=qs[_0xd474('0x2f')](_[_0xd474('0x39')](_0x1c15d5[_0xd474('0x2d')],_0x528432[_0xd474('0x2f')]));if(_0x1c15d5['query'][_0xd474('0x3a')]){_0x3a4f94[_0xd474('0x38')]=_[_0xd474('0x3b')](_0x3a4f94[_0xd474('0x38')],{'$or':_[_0xd474('0x2c')](_0x3a4f94[_0xd474('0x33')],function(_0x699ee7){var _0xe7c47d={};_0xe7c47d[_0x699ee7]={'$like':'%'+_0x1c15d5[_0xd474('0x2d')][_0xd474('0x3a')]+'%'};return _0xe7c47d;})});}_0x3a4f94=_[_0xd474('0x3b')]({},_0x3a4f94,_0x1c15d5[_0xd474('0x3d')]);return _0x5655b5[_0xd474('0x4d')](_0x3a4f94);}})[_0xd474('0x22')](function(_0x1339bc){if(_0x1339bc){_0x46a646=_0x1339bc['length'];if(!_0x1c15d5[_0xd474('0x2d')][_0xd474('0x4a')]('nolimit')){_0x3a4f94[_0xd474('0x1b')]=qs['limit'](_0x1c15d5[_0xd474('0x2d')]['limit']);_0x3a4f94[_0xd474('0x1a')]=qs[_0xd474('0x1a')](_0x1c15d5['query']['offset']);}return _0x5655b5[_0xd474('0x4d')](_0x3a4f94);}})[_0xd474('0x22')](function(_0x1b03f3){if(_0x1b03f3){return _0x1b03f3?{'count':_0x46a646,'rows':_0x1b03f3}:null;}})[_0xd474('0x22')](respondWithResult(_0x51d70a,null))['catch'](handleError(_0x51d70a,null));};exports['setTags']=function(_0x5a8590,_0x7a6c40,_0xcbfad3){if(_0x5a8590['body']['id']){delete _0x5a8590[_0xd474('0x44')]['id'];}return db[_0xd474('0x28')][_0xd474('0x47')]({'where':{'id':_0x5a8590[_0xd474('0x42')]['id']}})['then'](handleEntityNotFound(_0x7a6c40,null))['then'](function(_0x5051c7){if(_0x5051c7){return _0x5051c7['setTags'](_0x5a8590[_0xd474('0x44')][_0xd474('0x4f')]||[]);}return null;})[_0xd474('0x22')](respondWithResult(_0x7a6c40,null))[_0xd474('0x40')](handleError(_0x7a6c40,null));}; \ No newline at end of file +var _0xd75b=['offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','FreshdeskConfiguration','includeAll','include','findAll','catch','show','params','filters','find','create','body','FreshdeskField','filter','getFields','nolimit','getSubjects','findOne','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x128708,_0x5ad77d){var _0x513c00=function(_0x25ea76){while(--_0x25ea76){_0x128708['push'](_0x128708['shift']());}};_0x513c00(++_0x5ad77d);}(_0xd75b,0x1e5));var _0xbd75=function(_0x4aa0b2,_0x242da7){_0x4aa0b2=_0x4aa0b2-0x0;var _0x2cfff5=_0xd75b[_0x4aa0b2];return _0x2cfff5;};'use strict';var emlformat=require(_0xbd75('0x0'));var rimraf=require(_0xbd75('0x1'));var zipdir=require(_0xbd75('0x2'));var jsonpatch=require(_0xbd75('0x3'));var rp=require(_0xbd75('0x4'));var moment=require(_0xbd75('0x5'));var BPromise=require(_0xbd75('0x6'));var Mustache=require(_0xbd75('0x7'));var util=require(_0xbd75('0x8'));var path=require(_0xbd75('0x9'));var sox=require(_0xbd75('0xa'));var csv=require('to-csv');var ejs=require(_0xbd75('0xb'));var fs=require('fs');var fs_extra=require(_0xbd75('0xc'));var _=require(_0xbd75('0xd'));var squel=require(_0xbd75('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbd75('0xf'));var toCsv=require(_0xbd75('0x10'));var querystring=require('querystring');var Papa=require(_0xbd75('0x11'));var Redis=require(_0xbd75('0x12'));var authService=require(_0xbd75('0x13'));var qs=require(_0xbd75('0x14'));var as=require(_0xbd75('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd75('0x16'))(_0xbd75('0x17'));var utils=require(_0xbd75('0x18'));var config=require(_0xbd75('0x19'));var licenseUtil=require(_0xbd75('0x1a'));var db=require(_0xbd75('0x1b'))['db'];function respondWithStatusCode(_0x56fb03,_0x2d5d37){_0x2d5d37=_0x2d5d37||0xcc;return function(_0x1ba700){if(_0x1ba700){return _0x56fb03['sendStatus'](_0x2d5d37);}return _0x56fb03[_0xbd75('0x1c')](_0x2d5d37)[_0xbd75('0x1d')]();};}function respondWithResult(_0x290896,_0x2358a5){_0x2358a5=_0x2358a5||0xc8;return function(_0x37c477){if(_0x37c477){return _0x290896['status'](_0x2358a5)[_0xbd75('0x1e')](_0x37c477);}};}function respondWithFilteredResult(_0x1533f7,_0x275c19){return function(_0x399726){if(_0x399726){var _0x4cc619=typeof _0x275c19[_0xbd75('0x1f')]===_0xbd75('0x20')&&typeof _0x275c19[_0xbd75('0x21')]==='undefined';var _0x3b86ea=_0x399726['count'];var _0x175f60=_0x4cc619?0x0:_0x275c19[_0xbd75('0x1f')];var _0x59cc06=_0x4cc619?_0x399726[_0xbd75('0x22')]:_0x275c19[_0xbd75('0x1f')]+_0x275c19[_0xbd75('0x21')];var _0x5d25b3;if(_0x59cc06>=_0x3b86ea){_0x59cc06=_0x3b86ea;_0x5d25b3=0xc8;}else{_0x5d25b3=0xce;}_0x1533f7[_0xbd75('0x1c')](_0x5d25b3);return _0x1533f7[_0xbd75('0x23')](_0xbd75('0x24'),_0x175f60+'-'+_0x59cc06+'/'+_0x3b86ea)[_0xbd75('0x1e')](_0x399726);}return null;};}function patchUpdates(_0x321bbf){return function(_0x4f4f86){try{jsonpatch['apply'](_0x4f4f86,_0x321bbf,!![]);}catch(_0x2520b7){return BPromise['reject'](_0x2520b7);}return _0x4f4f86['save']();};}function saveUpdates(_0xdad892,_0x91b5c9){return function(_0xff46cb){if(_0xff46cb){return _0xff46cb[_0xbd75('0x25')](_0xdad892)[_0xbd75('0x26')](function(_0x31fb11){return _0x31fb11;});}return null;};}function removeEntity(_0x5ee485,_0x53ecb8){return function(_0xf98384){if(_0xf98384){return _0xf98384[_0xbd75('0x27')]()['then'](function(){_0x5ee485[_0xbd75('0x1c')](0xcc)[_0xbd75('0x1d')]();});}};}function handleEntityNotFound(_0x217a2,_0xb87b22){return function(_0x334e96){if(!_0x334e96){_0x217a2[_0xbd75('0x28')](0x194);}return _0x334e96;};}function handleError(_0x55f2dd,_0x2dbeda){_0x2dbeda=_0x2dbeda||0x1f4;return function(_0x12d398){logger['error'](_0x12d398['stack']);if(_0x12d398[_0xbd75('0x29')]){delete _0x12d398[_0xbd75('0x29')];}_0x55f2dd[_0xbd75('0x1c')](_0x2dbeda)[_0xbd75('0x2a')](_0x12d398);};}exports[_0xbd75('0x2b')]=function(_0x3518a9,_0x19b244){var _0x4b8071={},_0x4549a5={},_0x1abccd={'count':0x0,'rows':[]};var _0x2b056c=_[_0xbd75('0x2c')](db['FreshdeskConfiguration'][_0xbd75('0x2d')],function(_0x36111f){return{'name':_0x36111f[_0xbd75('0x2e')],'type':_0x36111f[_0xbd75('0x2f')][_0xbd75('0x30')]};});_0x4549a5[_0xbd75('0x31')]=_[_0xbd75('0x2c')](_0x2b056c,_0xbd75('0x29'));_0x4549a5[_0xbd75('0x32')]=_[_0xbd75('0x33')](_0x3518a9['query']);_0x4549a5['filters']=_[_0xbd75('0x34')](_0x4549a5[_0xbd75('0x31')],_0x4549a5['query']);_0x4b8071['attributes']=_[_0xbd75('0x34')](_0x4549a5[_0xbd75('0x31')],qs['fields'](_0x3518a9['query'][_0xbd75('0x35')]));_0x4b8071['attributes']=_0x4b8071['attributes'][_0xbd75('0x36')]?_0x4b8071[_0xbd75('0x37')]:_0x4549a5[_0xbd75('0x31')];if(!_0x3518a9[_0xbd75('0x32')][_0xbd75('0x38')]('nolimit')){_0x4b8071[_0xbd75('0x21')]=qs[_0xbd75('0x21')](_0x3518a9[_0xbd75('0x32')][_0xbd75('0x21')]);_0x4b8071['offset']=qs[_0xbd75('0x1f')](_0x3518a9['query']['offset']);}_0x4b8071[_0xbd75('0x39')]=qs[_0xbd75('0x3a')](_0x3518a9['query'][_0xbd75('0x3a')]);_0x4b8071[_0xbd75('0x3b')]=qs['filters'](_[_0xbd75('0x3c')](_0x3518a9[_0xbd75('0x32')],_0x4549a5['filters']),_0x2b056c);if(_0x3518a9[_0xbd75('0x32')]['filter']){_0x4b8071['where']=_[_0xbd75('0x3d')](_0x4b8071['where'],{'$or':_['map'](_0x2b056c,function(_0x2daa38){if(_0x2daa38['type']!==_0xbd75('0x3e')){var _0x248de2={};_0x248de2[_0x2daa38[_0xbd75('0x29')]]={'$like':'%'+_0x3518a9[_0xbd75('0x32')]['filter']+'%'};return _0x248de2;}})});}_0x4b8071=_[_0xbd75('0x3d')]({},_0x4b8071,_0x3518a9[_0xbd75('0x3f')]);var _0x584885={'where':_0x4b8071[_0xbd75('0x3b')]};return db[_0xbd75('0x40')][_0xbd75('0x22')](_0x584885)[_0xbd75('0x26')](function(_0x49265e){_0x1abccd[_0xbd75('0x22')]=_0x49265e;if(_0x3518a9[_0xbd75('0x32')][_0xbd75('0x41')]){_0x4b8071[_0xbd75('0x42')]=[{'all':!![]}];}return db[_0xbd75('0x40')][_0xbd75('0x43')](_0x4b8071);})[_0xbd75('0x26')](function(_0x1e68ed){_0x1abccd['rows']=_0x1e68ed;return _0x1abccd;})[_0xbd75('0x26')](respondWithFilteredResult(_0x19b244,_0x4b8071))[_0xbd75('0x44')](handleError(_0x19b244,null));};exports[_0xbd75('0x45')]=function(_0x138e9d,_0x25ffa4){var _0x272957={'raw':![],'where':{'id':_0x138e9d[_0xbd75('0x46')]['id']}},_0x33b291={};_0x33b291[_0xbd75('0x31')]=_[_0xbd75('0x33')](db[_0xbd75('0x40')][_0xbd75('0x2d')]);_0x33b291[_0xbd75('0x32')]=_[_0xbd75('0x33')](_0x138e9d['query']);_0x33b291[_0xbd75('0x47')]=_[_0xbd75('0x34')](_0x33b291['model'],_0x33b291[_0xbd75('0x32')]);_0x272957['attributes']=_['intersection'](_0x33b291[_0xbd75('0x31')],qs[_0xbd75('0x35')](_0x138e9d[_0xbd75('0x32')][_0xbd75('0x35')]));_0x272957[_0xbd75('0x37')]=_0x272957[_0xbd75('0x37')]['length']?_0x272957['attributes']:_0x33b291['model'];if(_0x138e9d['query'][_0xbd75('0x41')]){_0x272957['include']=[{'all':!![]}];}_0x272957=_[_0xbd75('0x3d')]({},_0x272957,_0x138e9d['options']);return db['FreshdeskConfiguration'][_0xbd75('0x48')](_0x272957)['then'](handleEntityNotFound(_0x25ffa4,null))[_0xbd75('0x26')](respondWithResult(_0x25ffa4,null))[_0xbd75('0x44')](handleError(_0x25ffa4,null));};exports['create']=function(_0x500e6a,_0x3e2b60){return db['FreshdeskConfiguration'][_0xbd75('0x49')](_0x500e6a[_0xbd75('0x4a')],{})[_0xbd75('0x26')](respondWithResult(_0x3e2b60,0xc9))[_0xbd75('0x44')](handleError(_0x3e2b60,null));};exports['update']=function(_0x3d4a35,_0x20f878){if(_0x3d4a35[_0xbd75('0x4a')]['id']){delete _0x3d4a35[_0xbd75('0x4a')]['id'];}return db[_0xbd75('0x40')]['find']({'where':{'id':_0x3d4a35[_0xbd75('0x46')]['id']}})[_0xbd75('0x26')](handleEntityNotFound(_0x20f878,null))['then'](saveUpdates(_0x3d4a35[_0xbd75('0x4a')],null))[_0xbd75('0x26')](respondWithResult(_0x20f878,null))[_0xbd75('0x44')](handleError(_0x20f878,null));};exports['destroy']=function(_0x54cffb,_0x2e2085){return db[_0xbd75('0x40')][_0xbd75('0x48')]({'where':{'id':_0x54cffb['params']['id']}})[_0xbd75('0x26')](handleEntityNotFound(_0x2e2085,null))[_0xbd75('0x26')](removeEntity(_0x2e2085,null))['catch'](handleError(_0x2e2085,null));};exports['getFields']=function(_0x7be74a,_0x5dc743,_0x4e12d4){var _0x1ef1e3={};var _0x57ed8f={};var _0x2cda4c;var _0x1b71f6;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x7be74a[_0xbd75('0x46')]['id']}})[_0xbd75('0x26')](handleEntityNotFound(_0x5dc743,null))[_0xbd75('0x26')](function(_0x13265c){if(_0x13265c){_0x2cda4c=_0x13265c;_0x57ed8f[_0xbd75('0x31')]=_[_0xbd75('0x33')](db[_0xbd75('0x4b')]['rawAttributes']);_0x57ed8f['query']=_[_0xbd75('0x33')](_0x7be74a[_0xbd75('0x32')]);_0x57ed8f['filters']=_[_0xbd75('0x34')](_0x57ed8f[_0xbd75('0x31')],_0x57ed8f[_0xbd75('0x32')]);_0x1ef1e3['attributes']=_[_0xbd75('0x34')](_0x57ed8f[_0xbd75('0x31')],qs[_0xbd75('0x35')](_0x7be74a[_0xbd75('0x32')]['fields']));_0x1ef1e3[_0xbd75('0x37')]=_0x1ef1e3[_0xbd75('0x37')][_0xbd75('0x36')]?_0x1ef1e3[_0xbd75('0x37')]:_0x57ed8f['model'];_0x1ef1e3[_0xbd75('0x39')]=qs['sort'](_0x7be74a[_0xbd75('0x32')]['sort']);_0x1ef1e3[_0xbd75('0x3b')]=qs[_0xbd75('0x47')](_['pick'](_0x7be74a[_0xbd75('0x32')],_0x57ed8f['filters']));if(_0x7be74a[_0xbd75('0x32')][_0xbd75('0x4c')]){_0x1ef1e3[_0xbd75('0x3b')]=_[_0xbd75('0x3d')](_0x1ef1e3['where'],{'$or':_['map'](_0x1ef1e3[_0xbd75('0x37')],function(_0x17edab){var _0x4cd1fd={};_0x4cd1fd[_0x17edab]={'$like':'%'+_0x7be74a[_0xbd75('0x32')][_0xbd75('0x4c')]+'%'};return _0x4cd1fd;})});}_0x1ef1e3=_['merge']({},_0x1ef1e3,_0x7be74a[_0xbd75('0x3f')]);return _0x2cda4c[_0xbd75('0x4d')](_0x1ef1e3);}})[_0xbd75('0x26')](function(_0x2141f3){if(_0x2141f3){_0x1b71f6=_0x2141f3[_0xbd75('0x36')];if(!_0x7be74a[_0xbd75('0x32')][_0xbd75('0x38')](_0xbd75('0x4e'))){_0x1ef1e3['limit']=qs['limit'](_0x7be74a[_0xbd75('0x32')][_0xbd75('0x21')]);_0x1ef1e3['offset']=qs[_0xbd75('0x1f')](_0x7be74a[_0xbd75('0x32')][_0xbd75('0x1f')]);}return _0x2cda4c[_0xbd75('0x4d')](_0x1ef1e3);}})['then'](function(_0x35397c){if(_0x35397c){return _0x35397c?{'count':_0x1b71f6,'rows':_0x35397c}:null;}})[_0xbd75('0x26')](respondWithResult(_0x5dc743,null))[_0xbd75('0x44')](handleError(_0x5dc743,null));};exports[_0xbd75('0x4f')]=function(_0x5b58ef,_0xc96718,_0x3b29b7){var _0x30fdb1={};var _0x2b51c5={};var _0x53d4bb;var _0x5cc3a0;return db[_0xbd75('0x40')][_0xbd75('0x50')]({'where':{'id':_0x5b58ef['params']['id']}})[_0xbd75('0x26')](handleEntityNotFound(_0xc96718,null))[_0xbd75('0x26')](function(_0x24db17){if(_0x24db17){_0x53d4bb=_0x24db17;_0x2b51c5[_0xbd75('0x31')]=_[_0xbd75('0x33')](db['FreshdeskField'][_0xbd75('0x2d')]);_0x2b51c5[_0xbd75('0x32')]=_['keys'](_0x5b58ef['query']);_0x2b51c5['filters']=_[_0xbd75('0x34')](_0x2b51c5['model'],_0x2b51c5[_0xbd75('0x32')]);_0x30fdb1[_0xbd75('0x37')]=_[_0xbd75('0x34')](_0x2b51c5[_0xbd75('0x31')],qs[_0xbd75('0x35')](_0x5b58ef['query'][_0xbd75('0x35')]));_0x30fdb1[_0xbd75('0x37')]=_0x30fdb1[_0xbd75('0x37')][_0xbd75('0x36')]?_0x30fdb1[_0xbd75('0x37')]:_0x2b51c5[_0xbd75('0x31')];_0x30fdb1[_0xbd75('0x39')]=qs[_0xbd75('0x3a')](_0x5b58ef[_0xbd75('0x32')][_0xbd75('0x3a')]);_0x30fdb1[_0xbd75('0x3b')]=qs['filters'](_[_0xbd75('0x3c')](_0x5b58ef[_0xbd75('0x32')],_0x2b51c5[_0xbd75('0x47')]));if(_0x5b58ef[_0xbd75('0x32')][_0xbd75('0x4c')]){_0x30fdb1[_0xbd75('0x3b')]=_['merge'](_0x30fdb1[_0xbd75('0x3b')],{'$or':_['map'](_0x30fdb1[_0xbd75('0x37')],function(_0x59fa1a){var _0x553d20={};_0x553d20[_0x59fa1a]={'$like':'%'+_0x5b58ef[_0xbd75('0x32')][_0xbd75('0x4c')]+'%'};return _0x553d20;})});}_0x30fdb1=_[_0xbd75('0x3d')]({},_0x30fdb1,_0x5b58ef[_0xbd75('0x3f')]);return _0x53d4bb[_0xbd75('0x4f')](_0x30fdb1);}})['then'](function(_0x4673cd){if(_0x4673cd){_0x5cc3a0=_0x4673cd[_0xbd75('0x36')];if(!_0x5b58ef[_0xbd75('0x32')][_0xbd75('0x38')](_0xbd75('0x4e'))){_0x30fdb1['limit']=qs[_0xbd75('0x21')](_0x5b58ef[_0xbd75('0x32')][_0xbd75('0x21')]);_0x30fdb1[_0xbd75('0x1f')]=qs[_0xbd75('0x1f')](_0x5b58ef['query'][_0xbd75('0x1f')]);}return _0x53d4bb[_0xbd75('0x4f')](_0x30fdb1);}})[_0xbd75('0x26')](function(_0x3dab23){if(_0x3dab23){return _0x3dab23?{'count':_0x5cc3a0,'rows':_0x3dab23}:null;}})[_0xbd75('0x26')](respondWithResult(_0xc96718,null))[_0xbd75('0x44')](handleError(_0xc96718,null));};exports['getDescriptions']=function(_0x556822,_0x345d6c,_0x3fe961){var _0x572288={};var _0x562823={};var _0x6b7de4;var _0x3f92c3;return db[_0xbd75('0x40')]['findOne']({'where':{'id':_0x556822[_0xbd75('0x46')]['id']}})[_0xbd75('0x26')](handleEntityNotFound(_0x345d6c,null))['then'](function(_0x5683a0){if(_0x5683a0){_0x6b7de4=_0x5683a0;_0x562823[_0xbd75('0x31')]=_['keys'](db[_0xbd75('0x4b')][_0xbd75('0x2d')]);_0x562823[_0xbd75('0x32')]=_[_0xbd75('0x33')](_0x556822[_0xbd75('0x32')]);_0x562823[_0xbd75('0x47')]=_['intersection'](_0x562823[_0xbd75('0x31')],_0x562823[_0xbd75('0x32')]);_0x572288[_0xbd75('0x37')]=_[_0xbd75('0x34')](_0x562823['model'],qs[_0xbd75('0x35')](_0x556822['query'][_0xbd75('0x35')]));_0x572288[_0xbd75('0x37')]=_0x572288['attributes'][_0xbd75('0x36')]?_0x572288[_0xbd75('0x37')]:_0x562823[_0xbd75('0x31')];_0x572288[_0xbd75('0x39')]=qs[_0xbd75('0x3a')](_0x556822[_0xbd75('0x32')][_0xbd75('0x3a')]);_0x572288['where']=qs['filters'](_[_0xbd75('0x3c')](_0x556822['query'],_0x562823[_0xbd75('0x47')]));if(_0x556822[_0xbd75('0x32')][_0xbd75('0x4c')]){_0x572288[_0xbd75('0x3b')]=_[_0xbd75('0x3d')](_0x572288[_0xbd75('0x3b')],{'$or':_[_0xbd75('0x2c')](_0x572288[_0xbd75('0x37')],function(_0x34dcf5){var _0x3ccfa6={};_0x3ccfa6[_0x34dcf5]={'$like':'%'+_0x556822[_0xbd75('0x32')][_0xbd75('0x4c')]+'%'};return _0x3ccfa6;})});}_0x572288=_[_0xbd75('0x3d')]({},_0x572288,_0x556822[_0xbd75('0x3f')]);return _0x6b7de4[_0xbd75('0x51')](_0x572288);}})[_0xbd75('0x26')](function(_0x51fe4a){if(_0x51fe4a){_0x3f92c3=_0x51fe4a['length'];if(!_0x556822[_0xbd75('0x32')][_0xbd75('0x38')](_0xbd75('0x4e'))){_0x572288[_0xbd75('0x21')]=qs[_0xbd75('0x21')](_0x556822[_0xbd75('0x32')][_0xbd75('0x21')]);_0x572288[_0xbd75('0x1f')]=qs['offset'](_0x556822[_0xbd75('0x32')]['offset']);}return _0x6b7de4['getDescriptions'](_0x572288);}})[_0xbd75('0x26')](function(_0x5dafe3){if(_0x5dafe3){return _0x5dafe3?{'count':_0x3f92c3,'rows':_0x5dafe3}:null;}})[_0xbd75('0x26')](respondWithResult(_0x345d6c,null))[_0xbd75('0x44')](handleError(_0x345d6c,null));};exports['getTags']=function(_0x5bebea,_0x5523,_0x2787a7){var _0x4aab24={};var _0x2765b0={};var _0x14a01a;var _0x35b719;return db['FreshdeskConfiguration'][_0xbd75('0x50')]({'where':{'id':_0x5bebea['params']['id']}})[_0xbd75('0x26')](handleEntityNotFound(_0x5523,null))[_0xbd75('0x26')](function(_0x427527){if(_0x427527){_0x14a01a=_0x427527;_0x2765b0[_0xbd75('0x31')]=_[_0xbd75('0x33')](db[_0xbd75('0x52')][_0xbd75('0x2d')]);_0x2765b0[_0xbd75('0x32')]=_[_0xbd75('0x33')](_0x5bebea[_0xbd75('0x32')]);_0x2765b0['filters']=_[_0xbd75('0x34')](_0x2765b0[_0xbd75('0x31')],_0x2765b0['query']);_0x4aab24[_0xbd75('0x37')]=_[_0xbd75('0x34')](_0x2765b0[_0xbd75('0x31')],qs[_0xbd75('0x35')](_0x5bebea[_0xbd75('0x32')][_0xbd75('0x35')]));_0x4aab24[_0xbd75('0x37')]=_0x4aab24[_0xbd75('0x37')]['length']?_0x4aab24['attributes']:_0x2765b0[_0xbd75('0x31')];_0x4aab24[_0xbd75('0x39')]=qs['sort'](_0x5bebea['query'][_0xbd75('0x3a')]);_0x4aab24[_0xbd75('0x3b')]=qs[_0xbd75('0x47')](_[_0xbd75('0x3c')](_0x5bebea[_0xbd75('0x32')],_0x2765b0[_0xbd75('0x47')]));if(_0x5bebea[_0xbd75('0x32')]['filter']){_0x4aab24[_0xbd75('0x3b')]=_['merge'](_0x4aab24[_0xbd75('0x3b')],{'$or':_['map'](_0x4aab24[_0xbd75('0x37')],function(_0xa38ad){var _0x3cb774={};_0x3cb774[_0xa38ad]={'$like':'%'+_0x5bebea['query'][_0xbd75('0x4c')]+'%'};return _0x3cb774;})});}_0x4aab24=_[_0xbd75('0x3d')]({},_0x4aab24,_0x5bebea[_0xbd75('0x3f')]);return _0x14a01a['getTags'](_0x4aab24);}})[_0xbd75('0x26')](function(_0x3c8b16){if(_0x3c8b16){_0x35b719=_0x3c8b16[_0xbd75('0x36')];if(!_0x5bebea['query'][_0xbd75('0x38')](_0xbd75('0x4e'))){_0x4aab24['limit']=qs[_0xbd75('0x21')](_0x5bebea[_0xbd75('0x32')][_0xbd75('0x21')]);_0x4aab24[_0xbd75('0x1f')]=qs[_0xbd75('0x1f')](_0x5bebea[_0xbd75('0x32')][_0xbd75('0x1f')]);}return _0x14a01a[_0xbd75('0x53')](_0x4aab24);}})[_0xbd75('0x26')](function(_0x1f34d2){if(_0x1f34d2){return _0x1f34d2?{'count':_0x35b719,'rows':_0x1f34d2}:null;}})[_0xbd75('0x26')](respondWithResult(_0x5523,null))[_0xbd75('0x44')](handleError(_0x5523,null));};exports['setTags']=function(_0x2626c3,_0x3115f8,_0x2bcfc1){if(_0x2626c3[_0xbd75('0x4a')]['id']){delete _0x2626c3['body']['id'];}return db[_0xbd75('0x40')][_0xbd75('0x50')]({'where':{'id':_0x2626c3['params']['id']}})[_0xbd75('0x26')](handleEntityNotFound(_0x3115f8,null))[_0xbd75('0x26')](function(_0x38e956){if(_0x38e956){return _0x38e956[_0xbd75('0x54')](_0x2626c3[_0xbd75('0x4a')][_0xbd75('0x55')]||[]);}return null;})[_0xbd75('0x26')](respondWithResult(_0x3115f8,null))[_0xbd75('0x44')](handleError(_0x3115f8,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index adbb77f..132246b 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 _0xc43a=['bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','lodash','util','api','moment'];(function(_0xa9e9ed,_0x3bfa0f){var _0xdc6989=function(_0x13ff46){while(--_0x13ff46){_0xa9e9ed['push'](_0xa9e9ed['shift']());}};_0xdc6989(++_0x3bfa0f);}(_0xc43a,0x167));var _0xac43=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc43a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac43('0x0'));var util=require(_0xac43('0x1'));var logger=require('../../config/logger')(_0xac43('0x2'));var moment=require(_0xac43('0x3'));var BPromise=require(_0xac43('0x4'));var rp=require(_0xac43('0x5'));var fs=require('fs');var path=require(_0xac43('0x6'));var rimraf=require('rimraf');var config=require(_0xac43('0x7'));var attributes=require(_0xac43('0x8'));module[_0xac43('0x9')]=function(_0x4d626c,_0x17d1fd){return _0x4d626c['define'](_0xac43('0xa'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f5b=['../../config/logger','moment','rimraf','../../config/environment','define','int_freshdesk_configurations','lodash','util'];(function(_0x2e004e,_0x497ad3){var _0x3e5dff=function(_0xf756fc){while(--_0xf756fc){_0x2e004e['push'](_0x2e004e['shift']());}};_0x3e5dff(++_0x497ad3);}(_0x2f5b,0xe6));var _0xb2f5=function(_0x2fbce8,_0xd456fc){_0x2fbce8=_0x2fbce8-0x0;var _0x3b30ac=_0x2f5b[_0x2fbce8];return _0x3b30ac;};'use strict';var _=require(_0xb2f5('0x0'));var util=require(_0xb2f5('0x1'));var logger=require(_0xb2f5('0x2'))('api');var moment=require(_0xb2f5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb2f5('0x4'));var config=require(_0xb2f5('0x5'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x5be582,_0x441a91){return _0x5be582[_0xb2f5('0x6')]('FreshdeskConfiguration',attributes,{'tableName':_0xb2f5('0x7'),'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 93c7149..3b071d7 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 _0x6207=['request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x6207,0xa5));var _0x7620=function(_0xef3e4d,_0x457415){_0xef3e4d=_0xef3e4d-0x0;var _0x53f45d=_0x6207[_0xef3e4d];return _0x53f45d;};'use strict';var _=require('lodash');var util=require(_0x7620('0x0'));var moment=require(_0x7620('0x1'));var BPromise=require('bluebird');var rs=require(_0x7620('0x2'));var fs=require('fs');var Redis=require(_0x7620('0x3'));var db=require(_0x7620('0x4'))['db'];var utils=require(_0x7620('0x5'));var logger=require(_0x7620('0x6'))('rpc');var config=require(_0x7620('0x7'));var jayson=require(_0x7620('0x8'));var client=jayson[_0x7620('0x9')][_0x7620('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cff89,_0x452a0d,_0x895de4){return new BPromise(function(_0x2629e0,_0x2cc26d){return client[_0x7620('0xb')](_0x4cff89,_0x895de4)[_0x7620('0xc')](function(_0x225401){logger[_0x7620('0xd')](_0x7620('0xe'),_0x452a0d,_0x7620('0xf'));logger[_0x7620('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x452a0d,_0x7620('0xf'),JSON[_0x7620('0x11')](_0x225401));if(_0x225401[_0x7620('0x12')]){if(_0x225401[_0x7620('0x12')][_0x7620('0x13')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x452a0d,_0x225401['error'][_0x7620('0x14')]);return _0x2cc26d(_0x225401['error'][_0x7620('0x14')]);}logger[_0x7620('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x452a0d,_0x225401[_0x7620('0x12')][_0x7620('0x14')]);return _0x2629e0(_0x225401[_0x7620('0x12')][_0x7620('0x14')]);}else{logger[_0x7620('0xd')](_0x7620('0xe'),_0x452a0d,_0x7620('0xf'));_0x2629e0(_0x225401[_0x7620('0x15')][_0x7620('0x14')]);}})['catch'](function(_0x389e6d){logger['error'](_0x7620('0xe'),_0x452a0d,_0x389e6d);_0x2cc26d(_0x389e6d);});});} \ No newline at end of file +var _0x3233=['message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','debug','request\x20sent','stringify','error','FreshdeskConfiguration,\x20%s,\x20%s'];(function(_0x117f98,_0x116788){var _0x441ca3=function(_0x501b42){while(--_0x501b42){_0x117f98['push'](_0x117f98['shift']());}};_0x441ca3(++_0x116788);}(_0x3233,0xe7));var _0x3323=function(_0x1d382e,_0x2522a6){_0x1d382e=_0x1d382e-0x0;var _0x2b7968=_0x3233[_0x1d382e];return _0x2b7968;};'use strict';var _=require('lodash');var util=require(_0x3323('0x0'));var moment=require('moment');var BPromise=require(_0x3323('0x1'));var rs=require(_0x3323('0x2'));var fs=require('fs');var Redis=require(_0x3323('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3323('0x4'));var logger=require(_0x3323('0x5'))('rpc');var config=require(_0x3323('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3323('0x7')][_0x3323('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x543a5d,_0x46fd89,_0x296104){return new BPromise(function(_0x4b335a,_0xe3a3bf){return client[_0x3323('0x9')](_0x543a5d,_0x296104)['then'](function(_0x542f8a){logger[_0x3323('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x46fd89,'request\x20sent');logger[_0x3323('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x46fd89,_0x3323('0xc'),JSON[_0x3323('0xd')](_0x542f8a));if(_0x542f8a['error']){if(_0x542f8a[_0x3323('0xe')]['code']===0x1f4){logger[_0x3323('0xe')](_0x3323('0xf'),_0x46fd89,_0x542f8a[_0x3323('0xe')][_0x3323('0x10')]);return _0xe3a3bf(_0x542f8a['error'][_0x3323('0x10')]);}logger['error'](_0x3323('0xf'),_0x46fd89,_0x542f8a[_0x3323('0xe')]['message']);return _0x4b335a(_0x542f8a['error'][_0x3323('0x10')]);}else{logger['info'](_0x3323('0xf'),_0x46fd89,_0x3323('0xc'));_0x4b335a(_0x542f8a[_0x3323('0x11')][_0x3323('0x10')]);}})[_0x3323('0x12')](function(_0x3e31e7){logger[_0x3323('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x46fd89,_0x3e31e7);_0xe3a3bf(_0x3e31e7);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 76117b6..a17dbec 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 _0xbb89=['isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb89,0x15e));var _0x9bb8=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xbb89[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x9bb8('0x0'));var util=require(_0x9bb8('0x1'));var path=require(_0x9bb8('0x2'));var timeout=require(_0x9bb8('0x3'));var express=require(_0x9bb8('0x4'));var router=express[_0x9bb8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9bb8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9bb8('0x7'));var controller=require(_0x9bb8('0x8'));router[_0x9bb8('0x9')]('/',auth[_0x9bb8('0xa')](),controller[_0x9bb8('0xb')]);router['get']('/:id',auth[_0x9bb8('0xa')](),controller[_0x9bb8('0xc')]);router[_0x9bb8('0xd')]('/',auth[_0x9bb8('0xa')](),controller[_0x9bb8('0xe')]);router[_0x9bb8('0xf')](_0x9bb8('0x10'),auth[_0x9bb8('0xa')](),controller['update']);router[_0x9bb8('0x11')](_0x9bb8('0x10'),auth['isAuthenticated'](),controller[_0x9bb8('0x12')]);module[_0x9bb8('0x13')]=router; \ No newline at end of file +var _0x623e=['./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x27ed28,_0xb643a6){var _0x3c7559=function(_0x28725e){while(--_0x28725e){_0x27ed28['push'](_0x27ed28['shift']());}};_0x3c7559(++_0xb643a6);}(_0x623e,0x8c));var _0xe623=function(_0x4530df,_0x31f387){_0x4530df=_0x4530df-0x0;var _0x3e4f08=_0x623e[_0x4530df];return _0x3e4f08;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe623('0x0')]();var fs_extra=require('fs-extra');var auth=require(_0xe623('0x1'));var interaction=require(_0xe623('0x2'));var config=require(_0xe623('0x3'));var controller=require(_0xe623('0x4'));router[_0xe623('0x5')]('/',auth[_0xe623('0x6')](),controller[_0xe623('0x7')]);router[_0xe623('0x5')](_0xe623('0x8'),auth['isAuthenticated'](),controller[_0xe623('0x9')]);router[_0xe623('0xa')]('/',auth[_0xe623('0x6')](),controller[_0xe623('0xb')]);router[_0xe623('0xc')](_0xe623('0x8'),auth[_0xe623('0x6')](),controller[_0xe623('0xd')]);router['delete']('/:id',auth[_0xe623('0x6')](),controller[_0xe623('0xe')]);module[_0xe623('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 219ef96..a88b0b5 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 _0xb89c=['string','variable','customVariable','picklist','STRING','sequelize','exports','ENUM'];(function(_0x50a96e,_0x387f2b){var _0x2d22e3=function(_0x38c0f2){while(--_0x38c0f2){_0x50a96e['push'](_0x50a96e['shift']());}};_0x2d22e3(++_0x387f2b);}(_0xb89c,0x15d));var _0xcb89=function(_0x1e5b61,_0x552606){_0x1e5b61=_0x1e5b61-0x0;var _0x2f93ff=_0xb89c[_0x1e5b61];return _0x2f93ff;};'use strict';var Sequelize=require(_0xcb89('0x0'));module[_0xcb89('0x1')]={'type':{'type':Sequelize[_0xcb89('0x2')](_0xcb89('0x3'),_0xcb89('0x4'),_0xcb89('0x5'),'keyValue',_0xcb89('0x6')),'defaultValue':_0xcb89('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xcb89('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xcb89('0x3'),_0xcb89('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xcb89('0x7')]},'idField':{'type':Sequelize[_0xcb89('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcb89('0x7')]}}; \ No newline at end of file +var _0xd411=['string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','ENUM'];(function(_0x49dc76,_0x4fdb01){var _0x1344a9=function(_0x4f599a){while(--_0x4f599a){_0x49dc76['push'](_0x49dc76['shift']());}};_0x1344a9(++_0x4fdb01);}(_0xd411,0x1d7));var _0x1d41=function(_0xe93582,_0x222871){_0xe93582=_0xe93582-0x0;var _0x25ebb1=_0xd411[_0xe93582];return _0x25ebb1;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x1d41('0x0')](_0x1d41('0x1'),'variable',_0x1d41('0x2'),_0x1d41('0x3'),_0x1d41('0x4')),'defaultValue':_0x1d41('0x1')},'content':{'type':Sequelize[_0x1d41('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1d41('0x0')](_0x1d41('0x1'),_0x1d41('0x6'),_0x1d41('0x2'))},'keyContent':{'type':Sequelize[_0x1d41('0x5')]},'idField':{'type':Sequelize[_0x1d41('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1d41('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1d41('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 82692af..ec6985b 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 _0xb58b=['offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','find','create','body','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json'];(function(_0x4d0529,_0x348cc7){var _0x485202=function(_0x3f0da2){while(--_0x3f0da2){_0x4d0529['push'](_0x4d0529['shift']());}};_0x485202(++_0x348cc7);}(_0xb58b,0x1f1));var _0xbb58=function(_0x1be6e6,_0x2c01bd){_0x1be6e6=_0x1be6e6-0x0;var _0x4d94b0=_0xb58b[_0x1be6e6];return _0x4d94b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe88799,_0x18810f){_0x18810f=_0x18810f||0xcc;return function(_0x4cda21){if(_0x4cda21){return _0xe88799[_0xbb58('0x18')](_0x18810f);}return _0xe88799[_0xbb58('0x19')](_0x18810f)[_0xbb58('0x1a')]();};}function respondWithResult(_0x3b9406,_0x19ceda){_0x19ceda=_0x19ceda||0xc8;return function(_0x58245f){if(_0x58245f){return _0x3b9406[_0xbb58('0x19')](_0x19ceda)[_0xbb58('0x1b')](_0x58245f);}};}function respondWithFilteredResult(_0x5f4751,_0x4ba30e){return function(_0x33c20f){if(_0x33c20f){var _0x445b1f=typeof _0x4ba30e[_0xbb58('0x1c')]==='undefined'&&typeof _0x4ba30e['limit']==='undefined';var _0x55156e=_0x33c20f[_0xbb58('0x1d')];var _0x3134ea=_0x445b1f?0x0:_0x4ba30e['offset'];var _0xbee66=_0x445b1f?_0x33c20f['count']:_0x4ba30e[_0xbb58('0x1c')]+_0x4ba30e[_0xbb58('0x1e')];var _0x3c33d9;if(_0xbee66>=_0x55156e){_0xbee66=_0x55156e;_0x3c33d9=0xc8;}else{_0x3c33d9=0xce;}_0x5f4751[_0xbb58('0x19')](_0x3c33d9);return _0x5f4751[_0xbb58('0x1f')](_0xbb58('0x20'),_0x3134ea+'-'+_0xbee66+'/'+_0x55156e)[_0xbb58('0x1b')](_0x33c20f);}return null;};}function patchUpdates(_0x497fd0){return function(_0x84f34){try{jsonpatch[_0xbb58('0x21')](_0x84f34,_0x497fd0,!![]);}catch(_0x3e64fe){return BPromise[_0xbb58('0x22')](_0x3e64fe);}return _0x84f34[_0xbb58('0x23')]();};}function saveUpdates(_0x5d4a91,_0x49453a){return function(_0x350be7){if(_0x350be7){return _0x350be7[_0xbb58('0x24')](_0x5d4a91)['then'](function(_0x27806d){return _0x27806d;});}return null;};}function removeEntity(_0x53b693,_0x21964d){return function(_0x287822){if(_0x287822){return _0x287822[_0xbb58('0x25')]()[_0xbb58('0x26')](function(){_0x53b693[_0xbb58('0x19')](0xcc)[_0xbb58('0x1a')]();});}};}function handleEntityNotFound(_0x2d556a,_0x15e4c5){return function(_0x4e0303){if(!_0x4e0303){_0x2d556a[_0xbb58('0x18')](0x194);}return _0x4e0303;};}function handleError(_0x3bd550,_0x1be0ae){_0x1be0ae=_0x1be0ae||0x1f4;return function(_0x129094){logger[_0xbb58('0x27')](_0x129094[_0xbb58('0x28')]);if(_0x129094[_0xbb58('0x29')]){delete _0x129094[_0xbb58('0x29')];}_0x3bd550[_0xbb58('0x19')](_0x1be0ae)[_0xbb58('0x2a')](_0x129094);};}exports[_0xbb58('0x2b')]=function(_0x28b3a3,_0x2a0481){var _0x4157c4={},_0x3559b6={},_0x573cca={'count':0x0,'rows':[]};var _0x2b0f73=_[_0xbb58('0x2c')](db[_0xbb58('0x2d')][_0xbb58('0x2e')],function(_0x3304b9){return{'name':_0x3304b9[_0xbb58('0x2f')],'type':_0x3304b9[_0xbb58('0x30')][_0xbb58('0x31')]};});_0x3559b6[_0xbb58('0x32')]=_['map'](_0x2b0f73,_0xbb58('0x29'));_0x3559b6[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x28b3a3[_0xbb58('0x33')]);_0x3559b6[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x3559b6[_0xbb58('0x32')],_0x3559b6[_0xbb58('0x33')]);_0x4157c4[_0xbb58('0x37')]=_[_0xbb58('0x36')](_0x3559b6[_0xbb58('0x32')],qs[_0xbb58('0x38')](_0x28b3a3[_0xbb58('0x33')]['fields']));_0x4157c4['attributes']=_0x4157c4['attributes'][_0xbb58('0x39')]?_0x4157c4[_0xbb58('0x37')]:_0x3559b6[_0xbb58('0x32')];if(!_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3a')](_0xbb58('0x3b'))){_0x4157c4[_0xbb58('0x1e')]=qs[_0xbb58('0x1e')](_0x28b3a3['query'][_0xbb58('0x1e')]);_0x4157c4[_0xbb58('0x1c')]=qs['offset'](_0x28b3a3[_0xbb58('0x33')]['offset']);}_0x4157c4[_0xbb58('0x3c')]=qs['sort'](_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3d')]);_0x4157c4['where']=qs[_0xbb58('0x35')](_[_0xbb58('0x3e')](_0x28b3a3[_0xbb58('0x33')],_0x3559b6[_0xbb58('0x35')]),_0x2b0f73);if(_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3f')]){_0x4157c4[_0xbb58('0x40')]=_[_0xbb58('0x41')](_0x4157c4['where'],{'$or':_[_0xbb58('0x2c')](_0x2b0f73,function(_0x31aa4b){if(_0x31aa4b[_0xbb58('0x30')]!=='VIRTUAL'){var _0x4dbd5e={};_0x4dbd5e[_0x31aa4b[_0xbb58('0x29')]]={'$like':'%'+_0x28b3a3['query'][_0xbb58('0x3f')]+'%'};return _0x4dbd5e;}})});}_0x4157c4=_[_0xbb58('0x41')]({},_0x4157c4,_0x28b3a3[_0xbb58('0x42')]);var _0x560911={'where':_0x4157c4['where']};return db[_0xbb58('0x2d')][_0xbb58('0x1d')](_0x560911)[_0xbb58('0x26')](function(_0x24d82d){_0x573cca[_0xbb58('0x1d')]=_0x24d82d;if(_0x28b3a3[_0xbb58('0x33')]['includeAll']){_0x4157c4[_0xbb58('0x43')]=[{'all':!![]}];}return db[_0xbb58('0x2d')][_0xbb58('0x44')](_0x4157c4);})[_0xbb58('0x26')](function(_0x1185b3){_0x573cca[_0xbb58('0x45')]=_0x1185b3;return _0x573cca;})['then'](respondWithFilteredResult(_0x2a0481,_0x4157c4))[_0xbb58('0x46')](handleError(_0x2a0481,null));};exports['show']=function(_0x22f1c3,_0x285ad4){var _0x29fb1c={'raw':!![],'where':{'id':_0x22f1c3['params']['id']}},_0x45817f={};_0x45817f[_0xbb58('0x32')]=_[_0xbb58('0x34')](db[_0xbb58('0x2d')][_0xbb58('0x2e')]);_0x45817f['query']=_[_0xbb58('0x34')](_0x22f1c3['query']);_0x45817f[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x45817f[_0xbb58('0x32')],_0x45817f[_0xbb58('0x33')]);_0x29fb1c[_0xbb58('0x37')]=_[_0xbb58('0x36')](_0x45817f[_0xbb58('0x32')],qs[_0xbb58('0x38')](_0x22f1c3[_0xbb58('0x33')][_0xbb58('0x38')]));_0x29fb1c[_0xbb58('0x37')]=_0x29fb1c[_0xbb58('0x37')][_0xbb58('0x39')]?_0x29fb1c['attributes']:_0x45817f[_0xbb58('0x32')];if(_0x22f1c3['query']['includeAll']){_0x29fb1c[_0xbb58('0x43')]=[{'all':!![]}];}_0x29fb1c=_[_0xbb58('0x41')]({},_0x29fb1c,_0x22f1c3[_0xbb58('0x42')]);return db[_0xbb58('0x2d')][_0xbb58('0x47')](_0x29fb1c)[_0xbb58('0x26')](handleEntityNotFound(_0x285ad4,null))[_0xbb58('0x26')](respondWithResult(_0x285ad4,null))[_0xbb58('0x46')](handleError(_0x285ad4,null));};exports[_0xbb58('0x48')]=function(_0x39995e,_0x440fb3){return db['FreshdeskField'][_0xbb58('0x48')](_0x39995e[_0xbb58('0x49')],{})['then'](respondWithResult(_0x440fb3,0xc9))[_0xbb58('0x46')](handleError(_0x440fb3,null));};exports[_0xbb58('0x24')]=function(_0xf94897,_0xdb0ff7){if(_0xf94897['body']['id']){delete _0xf94897[_0xbb58('0x49')]['id'];}return db['FreshdeskField'][_0xbb58('0x47')]({'where':{'id':_0xf94897[_0xbb58('0x4a')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0xdb0ff7,null))['then'](saveUpdates(_0xf94897[_0xbb58('0x49')],null))[_0xbb58('0x26')](respondWithResult(_0xdb0ff7,null))['catch'](handleError(_0xdb0ff7,null));};exports[_0xbb58('0x25')]=function(_0x4ca201,_0x28301d){return db[_0xbb58('0x2d')][_0xbb58('0x47')]({'where':{'id':_0x4ca201[_0xbb58('0x4a')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0x28301d,null))[_0xbb58('0x26')](removeEntity(_0x28301d,null))[_0xbb58('0x46')](handleError(_0x28301d,null));}; \ No newline at end of file +var _0x5712=['fieldName','type','query','keys','filters','intersection','attributes','model','fields','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','apply','save','then','destroy','name','send','index','map','FreshdeskField','rawAttributes'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0x5712,0x140));var _0x2571=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5712[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2571('0x0'));var rimraf=require(_0x2571('0x1'));var zipdir=require(_0x2571('0x2'));var jsonpatch=require(_0x2571('0x3'));var rp=require(_0x2571('0x4'));var moment=require(_0x2571('0x5'));var BPromise=require(_0x2571('0x6'));var Mustache=require(_0x2571('0x7'));var util=require(_0x2571('0x8'));var path=require(_0x2571('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2571('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2571('0xb'));var squel=require(_0x2571('0xc'));var crypto=require(_0x2571('0xd'));var jsforce=require(_0x2571('0xe'));var deskjs=require(_0x2571('0xf'));var toCsv=require(_0x2571('0x10'));var querystring=require('querystring');var Papa=require(_0x2571('0x11'));var Redis=require('ioredis');var authService=require(_0x2571('0x12'));var qs=require(_0x2571('0x13'));var as=require(_0x2571('0x14'));var hardwareService=require(_0x2571('0x15'));var logger=require(_0x2571('0x16'))(_0x2571('0x17'));var utils=require(_0x2571('0x18'));var config=require(_0x2571('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33d3ed,_0x1ab846){_0x1ab846=_0x1ab846||0xcc;return function(_0x10823d){if(_0x10823d){return _0x33d3ed[_0x2571('0x1a')](_0x1ab846);}return _0x33d3ed[_0x2571('0x1b')](_0x1ab846)[_0x2571('0x1c')]();};}function respondWithResult(_0x241129,_0x130ab1){_0x130ab1=_0x130ab1||0xc8;return function(_0xdf8c3a){if(_0xdf8c3a){return _0x241129[_0x2571('0x1b')](_0x130ab1)[_0x2571('0x1d')](_0xdf8c3a);}};}function respondWithFilteredResult(_0x3c1a08,_0x5b0392){return function(_0x30b0f2){if(_0x30b0f2){var _0x47b5e9=typeof _0x5b0392['offset']==='undefined'&&typeof _0x5b0392['limit']===_0x2571('0x1e');var _0x371ae2=_0x30b0f2[_0x2571('0x1f')];var _0x75af2a=_0x47b5e9?0x0:_0x5b0392['offset'];var _0x7707=_0x47b5e9?_0x30b0f2[_0x2571('0x1f')]:_0x5b0392['offset']+_0x5b0392[_0x2571('0x20')];var _0x7303ad;if(_0x7707>=_0x371ae2){_0x7707=_0x371ae2;_0x7303ad=0xc8;}else{_0x7303ad=0xce;}_0x3c1a08[_0x2571('0x1b')](_0x7303ad);return _0x3c1a08[_0x2571('0x21')](_0x2571('0x22'),_0x75af2a+'-'+_0x7707+'/'+_0x371ae2)['json'](_0x30b0f2);}return null;};}function patchUpdates(_0x52da27){return function(_0x5fe030){try{jsonpatch[_0x2571('0x23')](_0x5fe030,_0x52da27,!![]);}catch(_0x58f6aa){return BPromise['reject'](_0x58f6aa);}return _0x5fe030[_0x2571('0x24')]();};}function saveUpdates(_0x2e7d89,_0x2218fb){return function(_0xb6dfa6){if(_0xb6dfa6){return _0xb6dfa6['update'](_0x2e7d89)[_0x2571('0x25')](function(_0x55ec06){return _0x55ec06;});}return null;};}function removeEntity(_0x1ec23c,_0x4316b1){return function(_0x5d6778){if(_0x5d6778){return _0x5d6778[_0x2571('0x26')]()[_0x2571('0x25')](function(){_0x1ec23c[_0x2571('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d455d,_0x77e02){return function(_0x1cbbdc){if(!_0x1cbbdc){_0x5d455d[_0x2571('0x1a')](0x194);}return _0x1cbbdc;};}function handleError(_0x1547d2,_0x2f5cae){_0x2f5cae=_0x2f5cae||0x1f4;return function(_0x246bbd){logger['error'](_0x246bbd['stack']);if(_0x246bbd[_0x2571('0x27')]){delete _0x246bbd[_0x2571('0x27')];}_0x1547d2[_0x2571('0x1b')](_0x2f5cae)[_0x2571('0x28')](_0x246bbd);};}exports[_0x2571('0x29')]=function(_0x165aa8,_0x3d5660){var _0x315dc1={},_0x1f7562={},_0xac59bc={'count':0x0,'rows':[]};var _0x5b3373=_[_0x2571('0x2a')](db[_0x2571('0x2b')][_0x2571('0x2c')],function(_0x441e7d){return{'name':_0x441e7d[_0x2571('0x2d')],'type':_0x441e7d[_0x2571('0x2e')]['key']};});_0x1f7562['model']=_[_0x2571('0x2a')](_0x5b3373,_0x2571('0x27'));_0x1f7562[_0x2571('0x2f')]=_[_0x2571('0x30')](_0x165aa8['query']);_0x1f7562[_0x2571('0x31')]=_[_0x2571('0x32')](_0x1f7562['model'],_0x1f7562['query']);_0x315dc1[_0x2571('0x33')]=_[_0x2571('0x32')](_0x1f7562[_0x2571('0x34')],qs['fields'](_0x165aa8[_0x2571('0x2f')][_0x2571('0x35')]));_0x315dc1['attributes']=_0x315dc1[_0x2571('0x33')]['length']?_0x315dc1[_0x2571('0x33')]:_0x1f7562[_0x2571('0x34')];if(!_0x165aa8[_0x2571('0x2f')]['hasOwnProperty']('nolimit')){_0x315dc1[_0x2571('0x20')]=qs['limit'](_0x165aa8[_0x2571('0x2f')][_0x2571('0x20')]);_0x315dc1[_0x2571('0x36')]=qs[_0x2571('0x36')](_0x165aa8['query'][_0x2571('0x36')]);}_0x315dc1[_0x2571('0x37')]=qs['sort'](_0x165aa8[_0x2571('0x2f')][_0x2571('0x38')]);_0x315dc1['where']=qs[_0x2571('0x31')](_[_0x2571('0x39')](_0x165aa8[_0x2571('0x2f')],_0x1f7562[_0x2571('0x31')]),_0x5b3373);if(_0x165aa8[_0x2571('0x2f')][_0x2571('0x3a')]){_0x315dc1[_0x2571('0x3b')]=_[_0x2571('0x3c')](_0x315dc1[_0x2571('0x3b')],{'$or':_[_0x2571('0x2a')](_0x5b3373,function(_0x379a45){if(_0x379a45[_0x2571('0x2e')]!==_0x2571('0x3d')){var _0x198f44={};_0x198f44[_0x379a45['name']]={'$like':'%'+_0x165aa8[_0x2571('0x2f')][_0x2571('0x3a')]+'%'};return _0x198f44;}})});}_0x315dc1=_[_0x2571('0x3c')]({},_0x315dc1,_0x165aa8[_0x2571('0x3e')]);var _0x158432={'where':_0x315dc1[_0x2571('0x3b')]};return db[_0x2571('0x2b')]['count'](_0x158432)[_0x2571('0x25')](function(_0x15c610){_0xac59bc[_0x2571('0x1f')]=_0x15c610;if(_0x165aa8['query'][_0x2571('0x3f')]){_0x315dc1[_0x2571('0x40')]=[{'all':!![]}];}return db[_0x2571('0x2b')]['findAll'](_0x315dc1);})[_0x2571('0x25')](function(_0x1c6ccd){_0xac59bc[_0x2571('0x41')]=_0x1c6ccd;return _0xac59bc;})[_0x2571('0x25')](respondWithFilteredResult(_0x3d5660,_0x315dc1))[_0x2571('0x42')](handleError(_0x3d5660,null));};exports[_0x2571('0x43')]=function(_0x3a817a,_0x45fdd9){var _0x3d4004={'raw':!![],'where':{'id':_0x3a817a[_0x2571('0x44')]['id']}},_0x5d2734={};_0x5d2734[_0x2571('0x34')]=_[_0x2571('0x30')](db[_0x2571('0x2b')][_0x2571('0x2c')]);_0x5d2734[_0x2571('0x2f')]=_[_0x2571('0x30')](_0x3a817a[_0x2571('0x2f')]);_0x5d2734['filters']=_['intersection'](_0x5d2734['model'],_0x5d2734['query']);_0x3d4004['attributes']=_['intersection'](_0x5d2734[_0x2571('0x34')],qs[_0x2571('0x35')](_0x3a817a['query'][_0x2571('0x35')]));_0x3d4004[_0x2571('0x33')]=_0x3d4004[_0x2571('0x33')][_0x2571('0x45')]?_0x3d4004[_0x2571('0x33')]:_0x5d2734['model'];if(_0x3a817a['query']['includeAll']){_0x3d4004[_0x2571('0x40')]=[{'all':!![]}];}_0x3d4004=_[_0x2571('0x3c')]({},_0x3d4004,_0x3a817a[_0x2571('0x3e')]);return db[_0x2571('0x2b')][_0x2571('0x46')](_0x3d4004)[_0x2571('0x25')](handleEntityNotFound(_0x45fdd9,null))[_0x2571('0x25')](respondWithResult(_0x45fdd9,null))['catch'](handleError(_0x45fdd9,null));};exports[_0x2571('0x47')]=function(_0x20189c,_0x1642a8){return db['FreshdeskField'][_0x2571('0x47')](_0x20189c[_0x2571('0x48')],{})[_0x2571('0x25')](respondWithResult(_0x1642a8,0xc9))[_0x2571('0x42')](handleError(_0x1642a8,null));};exports['update']=function(_0x18291c,_0x245edb){if(_0x18291c[_0x2571('0x48')]['id']){delete _0x18291c[_0x2571('0x48')]['id'];}return db['FreshdeskField'][_0x2571('0x46')]({'where':{'id':_0x18291c[_0x2571('0x44')]['id']}})[_0x2571('0x25')](handleEntityNotFound(_0x245edb,null))[_0x2571('0x25')](saveUpdates(_0x18291c[_0x2571('0x48')],null))['then'](respondWithResult(_0x245edb,null))[_0x2571('0x42')](handleError(_0x245edb,null));};exports[_0x2571('0x26')]=function(_0x20302b,_0x1d2e36){return db[_0x2571('0x2b')][_0x2571('0x46')]({'where':{'id':_0x20302b['params']['id']}})['then'](handleEntityNotFound(_0x1d2e36,null))[_0x2571('0x25')](removeEntity(_0x1d2e36,null))['catch'](handleError(_0x1d2e36,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index a7d02ce..214b967 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 _0xb43e=['path','rimraf','../../config/environment','exports','define','FreshdeskField','idField','lodash','../../config/logger','moment'];(function(_0x56dd59,_0x54708a){var _0x4718b2=function(_0x55185c){while(--_0x55185c){_0x56dd59['push'](_0x56dd59['shift']());}};_0x4718b2(++_0x54708a);}(_0xb43e,0x183));var _0xeb43=function(_0x466197,_0x120914){_0x466197=_0x466197-0x0;var _0x56c738=_0xb43e[_0x466197];return _0x56c738;};'use strict';var _=require(_0xeb43('0x0'));var util=require('util');var logger=require(_0xeb43('0x1'))('api');var moment=require(_0xeb43('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb43('0x3'));var rimraf=require(_0xeb43('0x4'));var config=require(_0xeb43('0x5'));var attributes=require('./intFreshdeskField.attributes');module[_0xeb43('0x6')]=function(_0x450cc4,_0x224311){return _0x450cc4[_0xeb43('0x7')](_0xeb43('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xeb43('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2141=['rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x2141,0x1ba));var _0x1214=function(_0x41dce6,_0x30dd01){_0x41dce6=_0x41dce6-0x0;var _0x13d49e=_0x2141[_0x41dce6];return _0x13d49e;};'use strict';var _=require(_0x1214('0x0'));var util=require(_0x1214('0x1'));var logger=require(_0x1214('0x2'))(_0x1214('0x3'));var moment=require(_0x1214('0x4'));var BPromise=require(_0x1214('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1214('0x6'));var config=require(_0x1214('0x7'));var attributes=require(_0x1214('0x8'));module[_0x1214('0x9')]=function(_0xf2eb34,_0x2c8a69){return _0xf2eb34[_0x1214('0xa')](_0x1214('0xb'),attributes,{'tableName':_0x1214('0xc'),'paranoid':![],'indexes':[{'name':_0x1214('0xd'),'fields':[_0x1214('0xe'),_0x1214('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 4bce710..b79b958 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 _0x5d35=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash'];(function(_0x30012c,_0x4141ac){var _0x37b862=function(_0x46b443){while(--_0x46b443){_0x30012c['push'](_0x30012c['shift']());}};_0x37b862(++_0x4141ac);}(_0x5d35,0x153));var _0x55d3=function(_0x20c03c,_0x4a8447){_0x20c03c=_0x20c03c-0x0;var _0x1d3537=_0x5d35[_0x20c03c];return _0x1d3537;};'use strict';var _=require(_0x55d3('0x0'));var util=require('util');var moment=require(_0x55d3('0x1'));var BPromise=require(_0x55d3('0x2'));var rs=require(_0x55d3('0x3'));var fs=require('fs');var Redis=require(_0x55d3('0x4'));var db=require(_0x55d3('0x5'))['db'];var utils=require(_0x55d3('0x6'));var logger=require(_0x55d3('0x7'))(_0x55d3('0x8'));var config=require(_0x55d3('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x31852c,_0x5d6ce1,_0xd00ce5){return new BPromise(function(_0x333bea,_0x453f3b){return client[_0x55d3('0xa')](_0x31852c,_0xd00ce5)['then'](function(_0x33fef1){logger[_0x55d3('0xb')](_0x55d3('0xc'),_0x5d6ce1,'request\x20sent');logger[_0x55d3('0xd')](_0x55d3('0xe'),_0x5d6ce1,_0x55d3('0xf'),JSON[_0x55d3('0x10')](_0x33fef1));if(_0x33fef1['error']){if(_0x33fef1[_0x55d3('0x11')]['code']===0x1f4){logger[_0x55d3('0x11')](_0x55d3('0xc'),_0x5d6ce1,_0x33fef1[_0x55d3('0x11')][_0x55d3('0x12')]);return _0x453f3b(_0x33fef1[_0x55d3('0x11')][_0x55d3('0x12')]);}logger[_0x55d3('0x11')](_0x55d3('0xc'),_0x5d6ce1,_0x33fef1[_0x55d3('0x11')][_0x55d3('0x12')]);return _0x333bea(_0x33fef1['error'][_0x55d3('0x12')]);}else{logger[_0x55d3('0xb')](_0x55d3('0xc'),_0x5d6ce1,_0x55d3('0xf'));_0x333bea(_0x33fef1[_0x55d3('0x13')][_0x55d3('0x12')]);}})['catch'](function(_0x1d7647){logger[_0x55d3('0x11')](_0x55d3('0xc'),_0x5d6ce1,_0x1d7647);_0x453f3b(_0x1d7647);});});} \ No newline at end of file +var _0x453e=['rpc','client','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x13d2a5,_0x5016a4){var _0x437a87=function(_0x54854d){while(--_0x54854d){_0x13d2a5['push'](_0x13d2a5['shift']());}};_0x437a87(++_0x5016a4);}(_0x453e,0xbe));var _0xe453=function(_0x23d957,_0x5d2176){_0x23d957=_0x23d957-0x0;var _0x568ff2=_0x453e[_0x23d957];return _0x568ff2;};'use strict';var _=require(_0xe453('0x0'));var util=require(_0xe453('0x1'));var moment=require(_0xe453('0x2'));var BPromise=require('bluebird');var rs=require(_0xe453('0x3'));var fs=require('fs');var Redis=require(_0xe453('0x4'));var db=require(_0xe453('0x5'))['db'];var utils=require(_0xe453('0x6'));var logger=require(_0xe453('0x7'))(_0xe453('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe453('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a3219,_0x24b77c,_0x586b04){return new BPromise(function(_0x1143dc,_0x2863ba){return client[_0xe453('0xa')](_0x4a3219,_0x586b04)[_0xe453('0xb')](function(_0x42bcb4){logger[_0xe453('0xc')](_0xe453('0xd'),_0x24b77c,_0xe453('0xe'));logger[_0xe453('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x24b77c,_0xe453('0xe'),JSON[_0xe453('0x10')](_0x42bcb4));if(_0x42bcb4[_0xe453('0x11')]){if(_0x42bcb4[_0xe453('0x11')][_0xe453('0x12')]===0x1f4){logger[_0xe453('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x24b77c,_0x42bcb4['error'][_0xe453('0x13')]);return _0x2863ba(_0x42bcb4[_0xe453('0x11')][_0xe453('0x13')]);}logger[_0xe453('0x11')](_0xe453('0xd'),_0x24b77c,_0x42bcb4[_0xe453('0x11')]['message']);return _0x1143dc(_0x42bcb4[_0xe453('0x11')][_0xe453('0x13')]);}else{logger[_0xe453('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x24b77c,_0xe453('0xe'));_0x1143dc(_0x42bcb4[_0xe453('0x14')][_0xe453('0x13')]);}})[_0xe453('0x15')](function(_0x1eff14){logger[_0xe453('0x11')](_0xe453('0xd'),_0x24b77c,_0x1eff14);_0x2863ba(_0x1eff14);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 3e6e6d2..2387f23 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 _0x4fc2=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','exports','multer','util','path'];(function(_0x3ce12e,_0xd3f379){var _0x3ac505=function(_0x344358){while(--_0x344358){_0x3ce12e['push'](_0x3ce12e['shift']());}};_0x3ac505(++_0xd3f379);}(_0x4fc2,0x111));var _0x24fc=function(_0x4fca8e,_0x4c2162){_0x4fca8e=_0x4fca8e-0x0;var _0x23f51d=_0x4fc2[_0x4fca8e];return _0x23f51d;};'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')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['getConfigurations']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0x11')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router[_0x24fc('0x11')]('/:id/configurations',auth[_0x24fc('0x9')](),controller[_0x24fc('0x13')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x14')]);router[_0x24fc('0x15')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller['destroy']);module[_0x24fc('0x16')]=router; \ No newline at end of file +var _0xae60=['put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration'];(function(_0x37bdf6,_0x38854f){var _0x52c3f4=function(_0x715671){while(--_0x715671){_0x37bdf6['push'](_0x37bdf6['shift']());}};_0x52c3f4(++_0x38854f);}(_0xae60,0x1c7));var _0x0ae6=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xae60[_0x344a3f];return _0x264712;};'use strict';var multer=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var path=require(_0x0ae6('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ae6('0x3'));var router=express[_0x0ae6('0x4')]();var fs_extra=require(_0x0ae6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0ae6('0x6'));var config=require(_0x0ae6('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x0ae6('0x8')]('/',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xa')]);router[_0x0ae6('0x8')](_0x0ae6('0xb'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xc')]);router[_0x0ae6('0x8')]('/:id/configurations',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xd')]);router[_0x0ae6('0x8')](_0x0ae6('0xe'),auth['isAuthenticated'](),controller[_0x0ae6('0xf')]);router[_0x0ae6('0x10')]('/',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x11')]);router[_0x0ae6('0x10')](_0x0ae6('0x12'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x13')]);router[_0x0ae6('0x14')](_0x0ae6('0xb'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x15')]);router[_0x0ae6('0x16')](_0x0ae6('0xb'),auth['isAuthenticated'](),controller[_0x0ae6('0x17')]);module[_0x0ae6('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 783abbe..045e3e6 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 _0x5b12=['STRING','sequelize','exports'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5b12,0xa3));var _0x25b1=function(_0x508d5e,_0x595008){_0x508d5e=_0x508d5e-0x0;var _0xd8dc3=_0x5b12[_0x508d5e];return _0xd8dc3;};'use strict';var Sequelize=require(_0x25b1('0x0'));module[_0x25b1('0x1')]={'name':{'type':Sequelize[_0x25b1('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x25b1('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x25b1('0x2')]},'remoteUri':{'type':Sequelize[_0x25b1('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x25b1('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb03e=['STRING','username','remoteUri','exports'];(function(_0x3c3c17,_0x779bc9){var _0x43940c=function(_0x300c4b){while(--_0x300c4b){_0x3c3c17['push'](_0x3c3c17['shift']());}};_0x43940c(++_0x779bc9);}(_0xb03e,0x1eb));var _0xeb03=function(_0x3b82ec,_0x243b8d){_0x3b82ec=_0x3b82ec-0x0;var _0x55113b=_0xb03e[_0x3b82ec];return _0x55113b;};'use strict';var Sequelize=require('sequelize');module[_0xeb03('0x0')]={'name':{'type':Sequelize[_0xeb03('0x1')]},'description':{'type':Sequelize[_0xeb03('0x1')]},'username':{'type':Sequelize[_0xeb03('0x1')],'unique':_0xeb03('0x2')},'apiKey':{'type':Sequelize[_0xeb03('0x1')]},'remoteUri':{'type':Sequelize[_0xeb03('0x1')],'unique':_0xeb03('0x3')},'serverUrl':{'type':Sequelize[_0xeb03('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index f6a5981..88e692b 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 _0x5c8f=['test','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','update','error','stack','name','send','FreshsalesAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','pick','where','map','VIRTUAL','filter','merge','options','then','includeAll','findAll','catch','params','length','include','create','body','find','destroy','getConfigurations','findOne','FreshsalesConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','username','remoteUri','apiKey','substring','GET','format','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields'];(function(_0x282a70,_0x31e631){var _0x4a6f23=function(_0xb50180){while(--_0xb50180){_0x282a70['push'](_0x282a70['shift']());}};_0x4a6f23(++_0x31e631);}(_0x5c8f,0x6b));var _0xf5c8=function(_0x58e702,_0x2b5fe3){_0x58e702=_0x58e702-0x0;var _0x20e451=_0x5c8f[_0x58e702];return _0x20e451;};'use strict';var emlformat=require(_0xf5c8('0x0'));var rimraf=require(_0xf5c8('0x1'));var zipdir=require(_0xf5c8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf5c8('0x3'));var BPromise=require(_0xf5c8('0x4'));var Mustache=require(_0xf5c8('0x5'));var util=require(_0xf5c8('0x6'));var path=require(_0xf5c8('0x7'));var sox=require(_0xf5c8('0x8'));var csv=require(_0xf5c8('0x9'));var ejs=require(_0xf5c8('0xa'));var fs=require('fs');var fs_extra=require(_0xf5c8('0xb'));var _=require(_0xf5c8('0xc'));var squel=require('squel');var crypto=require(_0xf5c8('0xd'));var jsforce=require(_0xf5c8('0xe'));var deskjs=require(_0xf5c8('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf5c8('0x10'));var Papa=require(_0xf5c8('0x11'));var Redis=require(_0xf5c8('0x12'));var authService=require(_0xf5c8('0x13'));var qs=require(_0xf5c8('0x14'));var as=require(_0xf5c8('0x15'));var hardwareService=require(_0xf5c8('0x16'));var logger=require(_0xf5c8('0x17'))(_0xf5c8('0x18'));var utils=require(_0xf5c8('0x19'));var config=require(_0xf5c8('0x1a'));var licenseUtil=require(_0xf5c8('0x1b'));var db=require(_0xf5c8('0x1c'))['db'];var integrations=require(_0xf5c8('0x1d'));function respondWithStatusCode(_0x1f33e5,_0x304e7f){_0x304e7f=_0x304e7f||0xcc;return function(_0x5db444){if(_0x5db444){return _0x1f33e5[_0xf5c8('0x1e')](_0x304e7f);}return _0x1f33e5[_0xf5c8('0x1f')](_0x304e7f)[_0xf5c8('0x20')]();};}function respondWithResult(_0x3729b1,_0x189198){_0x189198=_0x189198||0xc8;return function(_0x4e4f4d){if(_0x4e4f4d){return _0x3729b1['status'](_0x189198)[_0xf5c8('0x21')](_0x4e4f4d);}};}function respondWithFilteredResult(_0x280e0b,_0xea08f1){return function(_0x37e340){if(_0x37e340){var _0x54a6a0=typeof _0xea08f1['offset']===_0xf5c8('0x22')&&typeof _0xea08f1[_0xf5c8('0x23')]===_0xf5c8('0x22');var _0x13b48a=_0x37e340['count'];var _0x103f60=_0x54a6a0?0x0:_0xea08f1[_0xf5c8('0x24')];var _0x1b9670=_0x54a6a0?_0x37e340[_0xf5c8('0x25')]:_0xea08f1['offset']+_0xea08f1['limit'];var _0x187775;if(_0x1b9670>=_0x13b48a){_0x1b9670=_0x13b48a;_0x187775=0xc8;}else{_0x187775=0xce;}_0x280e0b[_0xf5c8('0x1f')](_0x187775);return _0x280e0b[_0xf5c8('0x26')](_0xf5c8('0x27'),_0x103f60+'-'+_0x1b9670+'/'+_0x13b48a)[_0xf5c8('0x21')](_0x37e340);}return null;};}function patchUpdates(_0x4dc295){return function(_0x59f7ab){try{jsonpatch[_0xf5c8('0x28')](_0x59f7ab,_0x4dc295,!![]);}catch(_0x112600){return BPromise['reject'](_0x112600);}return _0x59f7ab['save']();};}function saveUpdates(_0x34b1e9,_0x569348){return function(_0x43d440){if(_0x43d440){return _0x43d440[_0xf5c8('0x29')](_0x34b1e9)['then'](function(_0x2ff1c8){return _0x2ff1c8;});}return null;};}function removeEntity(_0x3dfe56,_0x2c841a){return function(_0x5a523e){if(_0x5a523e){return _0x5a523e['destroy']()['then'](function(){_0x3dfe56['status'](0xcc)[_0xf5c8('0x20')]();});}};}function handleEntityNotFound(_0x5bf2b3,_0x63e5f4){return function(_0x5e830d){if(!_0x5e830d){_0x5bf2b3[_0xf5c8('0x1e')](0x194);}return _0x5e830d;};}function handleError(_0x29a0fd,_0x2091dd){_0x2091dd=_0x2091dd||0x1f4;return function(_0x4656fa){logger[_0xf5c8('0x2a')](_0x4656fa[_0xf5c8('0x2b')]);if(_0x4656fa[_0xf5c8('0x2c')]){delete _0x4656fa[_0xf5c8('0x2c')];}_0x29a0fd[_0xf5c8('0x1f')](_0x2091dd)[_0xf5c8('0x2d')](_0x4656fa);};}exports['index']=function(_0x279a3e,_0x280046){var _0x3cf90e={},_0x18397={},_0x463785={'count':0x0,'rows':[]};var _0x41e8e0=_['map'](db[_0xf5c8('0x2e')][_0xf5c8('0x2f')],function(_0x1a0af9){return{'name':_0x1a0af9[_0xf5c8('0x30')],'type':_0x1a0af9[_0xf5c8('0x31')][_0xf5c8('0x32')]};});_0x18397['model']=_['map'](_0x41e8e0,_0xf5c8('0x2c'));_0x18397[_0xf5c8('0x33')]=_[_0xf5c8('0x34')](_0x279a3e[_0xf5c8('0x33')]);_0x18397[_0xf5c8('0x35')]=_[_0xf5c8('0x36')](_0x18397[_0xf5c8('0x37')],_0x18397[_0xf5c8('0x33')]);_0x3cf90e[_0xf5c8('0x38')]=_[_0xf5c8('0x36')](_0x18397[_0xf5c8('0x37')],qs[_0xf5c8('0x39')](_0x279a3e['query']['fields']));_0x3cf90e[_0xf5c8('0x38')]=_0x3cf90e[_0xf5c8('0x38')]['length']?_0x3cf90e[_0xf5c8('0x38')]:_0x18397[_0xf5c8('0x37')];if(!_0x279a3e[_0xf5c8('0x33')]['hasOwnProperty'](_0xf5c8('0x3a'))){_0x3cf90e['limit']=qs['limit'](_0x279a3e[_0xf5c8('0x33')]['limit']);_0x3cf90e['offset']=qs['offset'](_0x279a3e['query'][_0xf5c8('0x24')]);}_0x3cf90e[_0xf5c8('0x3b')]=qs[_0xf5c8('0x3c')](_0x279a3e[_0xf5c8('0x33')]['sort']);_0x3cf90e['where']=qs[_0xf5c8('0x35')](_[_0xf5c8('0x3d')](_0x279a3e[_0xf5c8('0x33')],_0x18397[_0xf5c8('0x35')]),_0x41e8e0);if(_0x279a3e[_0xf5c8('0x33')]['filter']){_0x3cf90e[_0xf5c8('0x3e')]=_['merge'](_0x3cf90e[_0xf5c8('0x3e')],{'$or':_[_0xf5c8('0x3f')](_0x41e8e0,function(_0x418554){if(_0x418554[_0xf5c8('0x31')]!==_0xf5c8('0x40')){var _0xe4107d={};_0xe4107d[_0x418554[_0xf5c8('0x2c')]]={'$like':'%'+_0x279a3e[_0xf5c8('0x33')][_0xf5c8('0x41')]+'%'};return _0xe4107d;}})});}_0x3cf90e=_[_0xf5c8('0x42')]({},_0x3cf90e,_0x279a3e[_0xf5c8('0x43')]);var _0x26152f={'where':_0x3cf90e[_0xf5c8('0x3e')]};return db[_0xf5c8('0x2e')][_0xf5c8('0x25')](_0x26152f)[_0xf5c8('0x44')](function(_0x4562d2){_0x463785['count']=_0x4562d2;if(_0x279a3e['query'][_0xf5c8('0x45')]){_0x3cf90e['include']=[{'all':!![]}];}return db[_0xf5c8('0x2e')][_0xf5c8('0x46')](_0x3cf90e);})[_0xf5c8('0x44')](function(_0x3877ba){_0x463785['rows']=_0x3877ba;return _0x463785;})['then'](respondWithFilteredResult(_0x280046,_0x3cf90e))[_0xf5c8('0x47')](handleError(_0x280046,null));};exports['show']=function(_0x3a200a,_0x43f032){var _0x501630={'raw':![],'where':{'id':_0x3a200a[_0xf5c8('0x48')]['id']}},_0x278ff8={};_0x278ff8[_0xf5c8('0x37')]=_[_0xf5c8('0x34')](db['FreshsalesAccount'][_0xf5c8('0x2f')]);_0x278ff8['query']=_[_0xf5c8('0x34')](_0x3a200a[_0xf5c8('0x33')]);_0x278ff8[_0xf5c8('0x35')]=_[_0xf5c8('0x36')](_0x278ff8[_0xf5c8('0x37')],_0x278ff8[_0xf5c8('0x33')]);_0x501630[_0xf5c8('0x38')]=_[_0xf5c8('0x36')](_0x278ff8[_0xf5c8('0x37')],qs[_0xf5c8('0x39')](_0x3a200a[_0xf5c8('0x33')][_0xf5c8('0x39')]));_0x501630[_0xf5c8('0x38')]=_0x501630[_0xf5c8('0x38')][_0xf5c8('0x49')]?_0x501630['attributes']:_0x278ff8[_0xf5c8('0x37')];if(_0x3a200a[_0xf5c8('0x33')][_0xf5c8('0x45')]){_0x501630[_0xf5c8('0x4a')]=[{'all':!![]}];}_0x501630=_[_0xf5c8('0x42')]({},_0x501630,_0x3a200a['options']);return db[_0xf5c8('0x2e')]['find'](_0x501630)[_0xf5c8('0x44')](handleEntityNotFound(_0x43f032,null))[_0xf5c8('0x44')](respondWithResult(_0x43f032,null))['catch'](handleError(_0x43f032,null));};exports['create']=function(_0x110d78,_0x33b0c8){return db[_0xf5c8('0x2e')][_0xf5c8('0x4b')](_0x110d78[_0xf5c8('0x4c')],{})[_0xf5c8('0x44')](respondWithResult(_0x33b0c8,0xc9))[_0xf5c8('0x47')](handleError(_0x33b0c8,null));};exports[_0xf5c8('0x29')]=function(_0x46cef3,_0x4efb19){if(_0x46cef3[_0xf5c8('0x4c')]['id']){delete _0x46cef3['body']['id'];}return db[_0xf5c8('0x2e')][_0xf5c8('0x4d')]({'where':{'id':_0x46cef3[_0xf5c8('0x48')]['id']}})['then'](handleEntityNotFound(_0x4efb19,null))[_0xf5c8('0x44')](saveUpdates(_0x46cef3[_0xf5c8('0x4c')],null))[_0xf5c8('0x44')](respondWithResult(_0x4efb19,null))[_0xf5c8('0x47')](handleError(_0x4efb19,null));};exports[_0xf5c8('0x4e')]=function(_0x35a3e7,_0x3bf98f){return db['FreshsalesAccount'][_0xf5c8('0x4d')]({'where':{'id':_0x35a3e7[_0xf5c8('0x48')]['id']}})['then'](handleEntityNotFound(_0x3bf98f,null))[_0xf5c8('0x44')](removeEntity(_0x3bf98f,null))[_0xf5c8('0x47')](handleError(_0x3bf98f,null));};exports[_0xf5c8('0x4f')]=function(_0x419fcd,_0x4f967f,_0x19dac4){var _0x4b9bed={};var _0x1eb5f5={};var _0x468927;var _0x29ef9f;return db['FreshsalesAccount'][_0xf5c8('0x50')]({'where':{'id':_0x419fcd['params']['id']}})[_0xf5c8('0x44')](handleEntityNotFound(_0x4f967f,null))['then'](function(_0x3a1d3c){if(_0x3a1d3c){_0x468927=_0x3a1d3c;_0x1eb5f5[_0xf5c8('0x37')]=_[_0xf5c8('0x34')](db[_0xf5c8('0x51')][_0xf5c8('0x2f')]);_0x1eb5f5[_0xf5c8('0x33')]=_['keys'](_0x419fcd[_0xf5c8('0x33')]);_0x1eb5f5[_0xf5c8('0x35')]=_[_0xf5c8('0x36')](_0x1eb5f5[_0xf5c8('0x37')],_0x1eb5f5['query']);_0x4b9bed[_0xf5c8('0x38')]=_['intersection'](_0x1eb5f5['model'],qs[_0xf5c8('0x39')](_0x419fcd['query'][_0xf5c8('0x39')]));_0x4b9bed[_0xf5c8('0x38')]=_0x4b9bed['attributes'][_0xf5c8('0x49')]?_0x4b9bed[_0xf5c8('0x38')]:_0x1eb5f5['model'];_0x4b9bed[_0xf5c8('0x3b')]=qs['sort'](_0x419fcd[_0xf5c8('0x33')]['sort']);_0x4b9bed[_0xf5c8('0x3e')]=qs[_0xf5c8('0x35')](_['pick'](_0x419fcd[_0xf5c8('0x33')],_0x1eb5f5[_0xf5c8('0x35')]));if(_0x419fcd['query'][_0xf5c8('0x41')]){_0x4b9bed[_0xf5c8('0x3e')]=_['merge'](_0x4b9bed[_0xf5c8('0x3e')],{'$or':_[_0xf5c8('0x3f')](_0x4b9bed['attributes'],function(_0x2e8e11){var _0x56c723={};_0x56c723[_0x2e8e11]={'$like':'%'+_0x419fcd['query']['filter']+'%'};return _0x56c723;})});}_0x4b9bed=_[_0xf5c8('0x42')]({},_0x4b9bed,_0x419fcd['options']);return _0x468927[_0xf5c8('0x4f')](_0x4b9bed);}})[_0xf5c8('0x44')](function(_0x404acb){if(_0x404acb){_0x29ef9f=_0x404acb[_0xf5c8('0x49')];if(!_0x419fcd['query'][_0xf5c8('0x52')](_0xf5c8('0x3a'))){_0x4b9bed[_0xf5c8('0x23')]=qs[_0xf5c8('0x23')](_0x419fcd[_0xf5c8('0x33')]['limit']);_0x4b9bed[_0xf5c8('0x24')]=qs[_0xf5c8('0x24')](_0x419fcd[_0xf5c8('0x33')][_0xf5c8('0x24')]);}return _0x468927[_0xf5c8('0x4f')](_0x4b9bed);}})[_0xf5c8('0x44')](function(_0x282cde){if(_0x282cde){return _0x282cde?{'count':_0x29ef9f,'rows':_0x282cde}:null;}})['then'](respondWithResult(_0x4f967f,null))['catch'](handleError(_0x4f967f,null));};exports['addConfiguration']=function(_0x23d3ea,_0x1c42e3,_0x2202bd){if(_0x23d3ea[_0xf5c8('0x4c')]['id']){delete _0x23d3ea[_0xf5c8('0x4c')]['id'];}return db[_0xf5c8('0x2e')]['findOne']({'where':{'id':_0x23d3ea['params']['id']}})[_0xf5c8('0x44')](handleEntityNotFound(_0x1c42e3,null))['then'](function(_0x3a8760){if(_0x3a8760){_0x23d3ea[_0xf5c8('0x4c')][_0xf5c8('0x53')]=_0x3a8760['id'];_0x23d3ea['body'][_0xf5c8('0x54')]=integrations[_0xf5c8('0x55')](_0x23d3ea['body'][_0xf5c8('0x56')],_0x23d3ea['body'][_0xf5c8('0x31')]);_0x23d3ea[_0xf5c8('0x4c')][_0xf5c8('0x57')]=integrations[_0xf5c8('0x58')](_0x23d3ea[_0xf5c8('0x4c')]['channel'],_0x23d3ea[_0xf5c8('0x4c')]['type']);return db['FreshsalesConfiguration'][_0xf5c8('0x4b')](_0x23d3ea['body'],{'include':[{'model':db['FreshsalesField'],'as':_0xf5c8('0x54')},{'model':db[_0xf5c8('0x59')],'as':_0xf5c8('0x57')}]});}return null;})[_0xf5c8('0x44')](respondWithResult(_0x1c42e3,null))[_0xf5c8('0x47')](handleError(_0x1c42e3,null));};exports['getFields']=function(_0x198fef,_0x4c0146,_0x419e39){var _0x4cf3f3='';var _0x2c870a='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x198fef['params']['id']},'attributes':['id',_0xf5c8('0x5a'),_0xf5c8('0x5b'),_0xf5c8('0x5c')]})[_0xf5c8('0x44')](handleEntityNotFound(_0x4c0146,null))[_0xf5c8('0x44')](function(_0x1b8bac){if(_0x1b8bac){_0x2c870a=_0x1b8bac['username'];_0x4cf3f3=_0x1b8bac[_0xf5c8('0x5b')];var _0x18bf78=_0x1b8bac[_0xf5c8('0x5b')]['slice'](-0x1);if(_0x18bf78==='/'){_0x4cf3f3=_0x4cf3f3[_0xf5c8('0x5d')](0x0,_0x4cf3f3['lastIndexOf'](_0x18bf78));}return rp({'method':_0xf5c8('0x5e'),'uri':util[_0xf5c8('0x5f')]('%s%s',_0x4cf3f3,_0xf5c8('0x60')),'headers':{'Authorization':'Token\x20token='+_0x1b8bac[_0xf5c8('0x5c')]},'json':!![]});}})[_0xf5c8('0x44')](function(_0x113794){if(_0x113794){var _0x3715c4=_0x113794[_0xf5c8('0x61')];var _0x3690b0=![];var _0x11a8b5=null;for(_0x11a8b5=0x0;_0x11a8b5<_0x3715c4[_0xf5c8('0x49')];_0x11a8b5++){if(_0x3715c4[_0x11a8b5][_0xf5c8('0x62')]===_0x2c870a){_0x3690b0=!![];}}if(_0x3690b0){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xf5c8('0x63')});}}})[_0xf5c8('0x44')](respondWithResult(_0x4c0146,null))[_0xf5c8('0x47')](function(_0x292efc){var _0x23d8a7=_0x198fef[_0xf5c8('0x33')]['test']?0x1f4:_0x292efc[_0xf5c8('0x64')]||0x1f4;logger[_0xf5c8('0x2a')](_0xf5c8('0x65'),_0xf5c8('0x66'),_0x23d8a7,JSON['stringify'](_0x292efc));delete _0x292efc[_0xf5c8('0x2c')];if(_0x23d8a7===0x191){_0x23d8a7=0x190;}_0x4c0146[_0xf5c8('0x1f')](_0x23d8a7)[_0xf5c8('0x2d')](_0x198fef[_0xf5c8('0x33')][_0xf5c8('0x67')]?{'message':_0xf5c8('0x68'),'statusCode':_0x292efc[_0xf5c8('0x64')]}:_0x292efc);});}; \ No newline at end of file +var _0xe0f2=['offset','undefined','limit','set','Content-Range','apply','reject','destroy','then','error','name','send','index','map','FreshsalesAccount','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','find','getConfigurations','findOne','FreshsalesConfiguration','pick','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','format','%s%s','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','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','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json'];(function(_0x18bdf4,_0x2734aa){var _0x3accb0=function(_0x367e54){while(--_0x367e54){_0x18bdf4['push'](_0x18bdf4['shift']());}};_0x3accb0(++_0x2734aa);}(_0xe0f2,0x174));var _0x2e0f=function(_0x232fe1,_0x338be5){_0x232fe1=_0x232fe1-0x0;var _0x4f07a4=_0xe0f2[_0x232fe1];return _0x4f07a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e0f('0x0'));var zipdir=require(_0x2e0f('0x1'));var jsonpatch=require(_0x2e0f('0x2'));var rp=require(_0x2e0f('0x3'));var moment=require(_0x2e0f('0x4'));var BPromise=require(_0x2e0f('0x5'));var Mustache=require('mustache');var util=require(_0x2e0f('0x6'));var path=require(_0x2e0f('0x7'));var sox=require(_0x2e0f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e0f('0x9'));var squel=require(_0x2e0f('0xa'));var crypto=require(_0x2e0f('0xb'));var jsforce=require(_0x2e0f('0xc'));var deskjs=require(_0x2e0f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2e0f('0xe'));var Papa=require(_0x2e0f('0xf'));var Redis=require('ioredis');var authService=require(_0x2e0f('0x10'));var qs=require(_0x2e0f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e0f('0x12'));var logger=require(_0x2e0f('0x13'))(_0x2e0f('0x14'));var utils=require(_0x2e0f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2e0f('0x16'));var db=require(_0x2e0f('0x17'))['db'];var integrations=require(_0x2e0f('0x18'));function respondWithStatusCode(_0x38288f,_0x508204){_0x508204=_0x508204||0xcc;return function(_0x3189fd){if(_0x3189fd){return _0x38288f[_0x2e0f('0x19')](_0x508204);}return _0x38288f[_0x2e0f('0x1a')](_0x508204)['end']();};}function respondWithResult(_0x3095b8,_0x39819c){_0x39819c=_0x39819c||0xc8;return function(_0xb6657c){if(_0xb6657c){return _0x3095b8[_0x2e0f('0x1a')](_0x39819c)[_0x2e0f('0x1b')](_0xb6657c);}};}function respondWithFilteredResult(_0x2bae5f,_0x59d2f7){return function(_0x29d661){if(_0x29d661){var _0x1aa594=typeof _0x59d2f7[_0x2e0f('0x1c')]===_0x2e0f('0x1d')&&typeof _0x59d2f7[_0x2e0f('0x1e')]===_0x2e0f('0x1d');var _0x1d814c=_0x29d661['count'];var _0x5be32c=_0x1aa594?0x0:_0x59d2f7[_0x2e0f('0x1c')];var _0x3a4704=_0x1aa594?_0x29d661['count']:_0x59d2f7[_0x2e0f('0x1c')]+_0x59d2f7['limit'];var _0x4131ab;if(_0x3a4704>=_0x1d814c){_0x3a4704=_0x1d814c;_0x4131ab=0xc8;}else{_0x4131ab=0xce;}_0x2bae5f[_0x2e0f('0x1a')](_0x4131ab);return _0x2bae5f[_0x2e0f('0x1f')](_0x2e0f('0x20'),_0x5be32c+'-'+_0x3a4704+'/'+_0x1d814c)[_0x2e0f('0x1b')](_0x29d661);}return null;};}function patchUpdates(_0x15e9a5){return function(_0x307916){try{jsonpatch[_0x2e0f('0x21')](_0x307916,_0x15e9a5,!![]);}catch(_0x4d7430){return BPromise[_0x2e0f('0x22')](_0x4d7430);}return _0x307916['save']();};}function saveUpdates(_0x3eee06,_0x3b2f96){return function(_0x24b1dd){if(_0x24b1dd){return _0x24b1dd['update'](_0x3eee06)['then'](function(_0x14d2ec){return _0x14d2ec;});}return null;};}function removeEntity(_0x3abddd,_0x51c54d){return function(_0x234ade){if(_0x234ade){return _0x234ade[_0x2e0f('0x23')]()[_0x2e0f('0x24')](function(){_0x3abddd[_0x2e0f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25424f,_0x175b51){return function(_0x3de4b7){if(!_0x3de4b7){_0x25424f[_0x2e0f('0x19')](0x194);}return _0x3de4b7;};}function handleError(_0xa70428,_0x152c60){_0x152c60=_0x152c60||0x1f4;return function(_0x2a08e0){logger[_0x2e0f('0x25')](_0x2a08e0['stack']);if(_0x2a08e0[_0x2e0f('0x26')]){delete _0x2a08e0[_0x2e0f('0x26')];}_0xa70428[_0x2e0f('0x1a')](_0x152c60)[_0x2e0f('0x27')](_0x2a08e0);};}exports[_0x2e0f('0x28')]=function(_0x3e4b59,_0x1e48e6){var _0x2e324e={},_0xfb3ed5={},_0x174cb6={'count':0x0,'rows':[]};var _0x42aea6=_[_0x2e0f('0x29')](db[_0x2e0f('0x2a')]['rawAttributes'],function(_0x19c752){return{'name':_0x19c752[_0x2e0f('0x2b')],'type':_0x19c752[_0x2e0f('0x2c')][_0x2e0f('0x2d')]};});_0xfb3ed5['model']=_[_0x2e0f('0x29')](_0x42aea6,_0x2e0f('0x26'));_0xfb3ed5[_0x2e0f('0x2e')]=_[_0x2e0f('0x2f')](_0x3e4b59[_0x2e0f('0x2e')]);_0xfb3ed5[_0x2e0f('0x30')]=_['intersection'](_0xfb3ed5[_0x2e0f('0x31')],_0xfb3ed5[_0x2e0f('0x2e')]);_0x2e324e[_0x2e0f('0x32')]=_[_0x2e0f('0x33')](_0xfb3ed5['model'],qs[_0x2e0f('0x34')](_0x3e4b59[_0x2e0f('0x2e')][_0x2e0f('0x34')]));_0x2e324e[_0x2e0f('0x32')]=_0x2e324e[_0x2e0f('0x32')][_0x2e0f('0x35')]?_0x2e324e['attributes']:_0xfb3ed5[_0x2e0f('0x31')];if(!_0x3e4b59[_0x2e0f('0x2e')][_0x2e0f('0x36')]('nolimit')){_0x2e324e[_0x2e0f('0x1e')]=qs[_0x2e0f('0x1e')](_0x3e4b59[_0x2e0f('0x2e')][_0x2e0f('0x1e')]);_0x2e324e['offset']=qs[_0x2e0f('0x1c')](_0x3e4b59[_0x2e0f('0x2e')][_0x2e0f('0x1c')]);}_0x2e324e[_0x2e0f('0x37')]=qs[_0x2e0f('0x38')](_0x3e4b59[_0x2e0f('0x2e')][_0x2e0f('0x38')]);_0x2e324e['where']=qs[_0x2e0f('0x30')](_['pick'](_0x3e4b59[_0x2e0f('0x2e')],_0xfb3ed5[_0x2e0f('0x30')]),_0x42aea6);if(_0x3e4b59[_0x2e0f('0x2e')][_0x2e0f('0x39')]){_0x2e324e[_0x2e0f('0x3a')]=_[_0x2e0f('0x3b')](_0x2e324e['where'],{'$or':_[_0x2e0f('0x29')](_0x42aea6,function(_0x3727d6){if(_0x3727d6[_0x2e0f('0x2c')]!==_0x2e0f('0x3c')){var _0x1f35a3={};_0x1f35a3[_0x3727d6[_0x2e0f('0x26')]]={'$like':'%'+_0x3e4b59[_0x2e0f('0x2e')]['filter']+'%'};return _0x1f35a3;}})});}_0x2e324e=_[_0x2e0f('0x3b')]({},_0x2e324e,_0x3e4b59[_0x2e0f('0x3d')]);var _0x13af92={'where':_0x2e324e[_0x2e0f('0x3a')]};return db[_0x2e0f('0x2a')][_0x2e0f('0x3e')](_0x13af92)[_0x2e0f('0x24')](function(_0x5ab01a){_0x174cb6['count']=_0x5ab01a;if(_0x3e4b59[_0x2e0f('0x2e')][_0x2e0f('0x3f')]){_0x2e324e[_0x2e0f('0x40')]=[{'all':!![]}];}return db[_0x2e0f('0x2a')][_0x2e0f('0x41')](_0x2e324e);})['then'](function(_0x38a7c1){_0x174cb6[_0x2e0f('0x42')]=_0x38a7c1;return _0x174cb6;})[_0x2e0f('0x24')](respondWithFilteredResult(_0x1e48e6,_0x2e324e))[_0x2e0f('0x43')](handleError(_0x1e48e6,null));};exports['show']=function(_0x330c3b,_0x268cf7){var _0x189890={'raw':![],'where':{'id':_0x330c3b[_0x2e0f('0x44')]['id']}},_0x1d94eb={};_0x1d94eb[_0x2e0f('0x31')]=_[_0x2e0f('0x2f')](db[_0x2e0f('0x2a')][_0x2e0f('0x45')]);_0x1d94eb[_0x2e0f('0x2e')]=_['keys'](_0x330c3b[_0x2e0f('0x2e')]);_0x1d94eb[_0x2e0f('0x30')]=_[_0x2e0f('0x33')](_0x1d94eb['model'],_0x1d94eb['query']);_0x189890['attributes']=_[_0x2e0f('0x33')](_0x1d94eb[_0x2e0f('0x31')],qs[_0x2e0f('0x34')](_0x330c3b[_0x2e0f('0x2e')][_0x2e0f('0x34')]));_0x189890[_0x2e0f('0x32')]=_0x189890[_0x2e0f('0x32')][_0x2e0f('0x35')]?_0x189890[_0x2e0f('0x32')]:_0x1d94eb[_0x2e0f('0x31')];if(_0x330c3b[_0x2e0f('0x2e')][_0x2e0f('0x3f')]){_0x189890['include']=[{'all':!![]}];}_0x189890=_[_0x2e0f('0x3b')]({},_0x189890,_0x330c3b['options']);return db[_0x2e0f('0x2a')]['find'](_0x189890)['then'](handleEntityNotFound(_0x268cf7,null))[_0x2e0f('0x24')](respondWithResult(_0x268cf7,null))[_0x2e0f('0x43')](handleError(_0x268cf7,null));};exports[_0x2e0f('0x46')]=function(_0x655716,_0x4cbabc){return db[_0x2e0f('0x2a')][_0x2e0f('0x46')](_0x655716['body'],{})[_0x2e0f('0x24')](respondWithResult(_0x4cbabc,0xc9))[_0x2e0f('0x43')](handleError(_0x4cbabc,null));};exports['update']=function(_0x1c5d3a,_0x4b28dc){if(_0x1c5d3a[_0x2e0f('0x47')]['id']){delete _0x1c5d3a[_0x2e0f('0x47')]['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x1c5d3a[_0x2e0f('0x44')]['id']}})[_0x2e0f('0x24')](handleEntityNotFound(_0x4b28dc,null))[_0x2e0f('0x24')](saveUpdates(_0x1c5d3a[_0x2e0f('0x47')],null))[_0x2e0f('0x24')](respondWithResult(_0x4b28dc,null))[_0x2e0f('0x43')](handleError(_0x4b28dc,null));};exports['destroy']=function(_0x4e362c,_0xe0d6bc){return db['FreshsalesAccount'][_0x2e0f('0x48')]({'where':{'id':_0x4e362c[_0x2e0f('0x44')]['id']}})['then'](handleEntityNotFound(_0xe0d6bc,null))[_0x2e0f('0x24')](removeEntity(_0xe0d6bc,null))[_0x2e0f('0x43')](handleError(_0xe0d6bc,null));};exports[_0x2e0f('0x49')]=function(_0x3c2b48,_0x35baf2,_0x16f8d7){var _0x2e3b40={};var _0x256b6f={};var _0x433f72;var _0x1cbc50;return db[_0x2e0f('0x2a')][_0x2e0f('0x4a')]({'where':{'id':_0x3c2b48['params']['id']}})[_0x2e0f('0x24')](handleEntityNotFound(_0x35baf2,null))['then'](function(_0x201b3f){if(_0x201b3f){_0x433f72=_0x201b3f;_0x256b6f['model']=_[_0x2e0f('0x2f')](db[_0x2e0f('0x4b')][_0x2e0f('0x45')]);_0x256b6f[_0x2e0f('0x2e')]=_[_0x2e0f('0x2f')](_0x3c2b48[_0x2e0f('0x2e')]);_0x256b6f['filters']=_[_0x2e0f('0x33')](_0x256b6f['model'],_0x256b6f[_0x2e0f('0x2e')]);_0x2e3b40[_0x2e0f('0x32')]=_['intersection'](_0x256b6f[_0x2e0f('0x31')],qs[_0x2e0f('0x34')](_0x3c2b48[_0x2e0f('0x2e')][_0x2e0f('0x34')]));_0x2e3b40[_0x2e0f('0x32')]=_0x2e3b40['attributes'][_0x2e0f('0x35')]?_0x2e3b40[_0x2e0f('0x32')]:_0x256b6f[_0x2e0f('0x31')];_0x2e3b40[_0x2e0f('0x37')]=qs[_0x2e0f('0x38')](_0x3c2b48[_0x2e0f('0x2e')][_0x2e0f('0x38')]);_0x2e3b40[_0x2e0f('0x3a')]=qs['filters'](_[_0x2e0f('0x4c')](_0x3c2b48['query'],_0x256b6f[_0x2e0f('0x30')]));if(_0x3c2b48[_0x2e0f('0x2e')][_0x2e0f('0x39')]){_0x2e3b40[_0x2e0f('0x3a')]=_[_0x2e0f('0x3b')](_0x2e3b40['where'],{'$or':_[_0x2e0f('0x29')](_0x2e3b40[_0x2e0f('0x32')],function(_0x186654){var _0x5a0d81={};_0x5a0d81[_0x186654]={'$like':'%'+_0x3c2b48[_0x2e0f('0x2e')][_0x2e0f('0x39')]+'%'};return _0x5a0d81;})});}_0x2e3b40=_[_0x2e0f('0x3b')]({},_0x2e3b40,_0x3c2b48[_0x2e0f('0x3d')]);return _0x433f72['getConfigurations'](_0x2e3b40);}})[_0x2e0f('0x24')](function(_0x253dbc){if(_0x253dbc){_0x1cbc50=_0x253dbc[_0x2e0f('0x35')];if(!_0x3c2b48['query']['hasOwnProperty']('nolimit')){_0x2e3b40[_0x2e0f('0x1e')]=qs[_0x2e0f('0x1e')](_0x3c2b48[_0x2e0f('0x2e')][_0x2e0f('0x1e')]);_0x2e3b40[_0x2e0f('0x1c')]=qs[_0x2e0f('0x1c')](_0x3c2b48[_0x2e0f('0x2e')][_0x2e0f('0x1c')]);}return _0x433f72[_0x2e0f('0x49')](_0x2e3b40);}})['then'](function(_0xb8dc26){if(_0xb8dc26){return _0xb8dc26?{'count':_0x1cbc50,'rows':_0xb8dc26}:null;}})[_0x2e0f('0x24')](respondWithResult(_0x35baf2,null))[_0x2e0f('0x43')](handleError(_0x35baf2,null));};exports[_0x2e0f('0x4d')]=function(_0x4443f0,_0x499d7f,_0x8ccffb){if(_0x4443f0[_0x2e0f('0x47')]['id']){delete _0x4443f0[_0x2e0f('0x47')]['id'];}return db[_0x2e0f('0x2a')]['findOne']({'where':{'id':_0x4443f0['params']['id']}})[_0x2e0f('0x24')](handleEntityNotFound(_0x499d7f,null))[_0x2e0f('0x24')](function(_0x4f44a3){if(_0x4f44a3){_0x4443f0[_0x2e0f('0x47')]['AccountId']=_0x4f44a3['id'];_0x4443f0[_0x2e0f('0x47')][_0x2e0f('0x4e')]=integrations[_0x2e0f('0x4f')](_0x4443f0[_0x2e0f('0x47')][_0x2e0f('0x50')],_0x4443f0[_0x2e0f('0x47')][_0x2e0f('0x2c')]);_0x4443f0[_0x2e0f('0x47')][_0x2e0f('0x51')]=integrations[_0x2e0f('0x52')](_0x4443f0['body'][_0x2e0f('0x50')],_0x4443f0[_0x2e0f('0x47')]['type']);return db[_0x2e0f('0x4b')][_0x2e0f('0x46')](_0x4443f0[_0x2e0f('0x47')],{'include':[{'model':db[_0x2e0f('0x53')],'as':_0x2e0f('0x4e')},{'model':db[_0x2e0f('0x53')],'as':'Descriptions'}]});}return null;})[_0x2e0f('0x24')](respondWithResult(_0x499d7f,null))[_0x2e0f('0x43')](handleError(_0x499d7f,null));};exports[_0x2e0f('0x54')]=function(_0x2ba671,_0x1a9af4,_0x1951ce){var _0x445f64='';var _0x45d962='';return db[_0x2e0f('0x2a')][_0x2e0f('0x4a')]({'where':{'id':_0x2ba671['params']['id']},'attributes':['id',_0x2e0f('0x55'),_0x2e0f('0x56'),_0x2e0f('0x57')]})[_0x2e0f('0x24')](handleEntityNotFound(_0x1a9af4,null))[_0x2e0f('0x24')](function(_0x242670){if(_0x242670){_0x45d962=_0x242670[_0x2e0f('0x55')];_0x445f64=_0x242670['remoteUri'];var _0x26bb20=_0x242670['remoteUri'][_0x2e0f('0x58')](-0x1);if(_0x26bb20==='/'){_0x445f64=_0x445f64[_0x2e0f('0x59')](0x0,_0x445f64['lastIndexOf'](_0x26bb20));}return rp({'method':'GET','uri':util[_0x2e0f('0x5a')](_0x2e0f('0x5b'),_0x445f64,'/api/selector/owners'),'headers':{'Authorization':_0x2e0f('0x5c')+_0x242670[_0x2e0f('0x57')]},'json':!![]});}})[_0x2e0f('0x24')](function(_0x43007e){if(_0x43007e){var _0x26c7c5=_0x43007e[_0x2e0f('0x5d')];var _0x49675d=![];var _0x235726=null;for(_0x235726=0x0;_0x235726<_0x26c7c5[_0x2e0f('0x35')];_0x235726++){if(_0x26c7c5[_0x235726][_0x2e0f('0x5e')]===_0x45d962){_0x49675d=!![];}}if(_0x49675d){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x2e0f('0x5f')});}}})[_0x2e0f('0x24')](respondWithResult(_0x1a9af4,null))[_0x2e0f('0x43')](function(_0x1406da){var _0x19d450=_0x2ba671[_0x2e0f('0x2e')]['test']?0x1f4:_0x1406da[_0x2e0f('0x60')]||0x1f4;logger[_0x2e0f('0x25')](_0x2e0f('0x61'),_0x2e0f('0x54'),_0x19d450,JSON['stringify'](_0x1406da));delete _0x1406da[_0x2e0f('0x26')];if(_0x19d450===0x191){_0x19d450=0x190;}_0x1a9af4['status'](_0x19d450)[_0x2e0f('0x27')](_0x2ba671[_0x2e0f('0x2e')][_0x2e0f('0x62')]?{'message':_0x2e0f('0x63'),'statusCode':_0x1406da[_0x2e0f('0x60')]}:_0x1406da);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 240d07a..a0ac2aa 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcaf2=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x2e63e8,_0xed68f5){var _0x3fe904=function(_0x10e876){while(--_0x10e876){_0x2e63e8['push'](_0x2e63e8['shift']());}};_0x3fe904(++_0xed68f5);}(_0xcaf2,0x8a));var _0x2caf=function(_0x54ab1f,_0x1585d6){_0x54ab1f=_0x54ab1f-0x0;var _0x24c869=_0xcaf2[_0x54ab1f];return _0x24c869;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var logger=require(_0x2caf('0x1'))(_0x2caf('0x2'));var moment=require('moment');var BPromise=require(_0x2caf('0x3'));var rp=require(_0x2caf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2caf('0x5'));var config=require('../../config/environment');var attributes=require(_0x2caf('0x6'));var integrations=require(_0x2caf('0x7'));module[_0x2caf('0x8')]=function(_0x599ce7,_0xc44e4e){return _0x599ce7[_0x2caf('0x9')](_0x2caf('0xa'),attributes,{'tableName':_0x2caf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f9d=['exports','define','FreshsalesAccount','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x8f9d,0x93));var _0xd8f9=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8f9d[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xd8f9('0x0'));var util=require('util');var logger=require(_0xd8f9('0x1'))('api');var moment=require(_0xd8f9('0x2'));var BPromise=require(_0xd8f9('0x3'));var rp=require(_0xd8f9('0x4'));var fs=require('fs');var path=require(_0xd8f9('0x5'));var rimraf=require(_0xd8f9('0x6'));var config=require(_0xd8f9('0x7'));var attributes=require(_0xd8f9('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xd8f9('0x9')]=function(_0x24dd1e,_0x25d417){return _0x24dd1e[_0xd8f9('0xa')](_0xd8f9('0xb'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 4faf0d0..4d1a0bd 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 _0xdf55=['FreshsalesAccount,\x20%s,\x20%s','message','info','result','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xdf55,0x83));var _0x5df5=function(_0x15af6c,_0x47fe2d){_0x15af6c=_0x15af6c-0x0;var _0x13c017=_0xdf55[_0x15af6c];return _0x13c017;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var moment=require('moment');var BPromise=require(_0x5df5('0x2'));var rs=require(_0x5df5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5df5('0x4'))['db'];var utils=require(_0x5df5('0x5'));var logger=require(_0x5df5('0x6'))('rpc');var config=require(_0x5df5('0x7'));var jayson=require(_0x5df5('0x8'));var client=jayson[_0x5df5('0x9')][_0x5df5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9b8756,_0x2b7ed9,_0x4722a2){return new BPromise(function(_0x3743f3,_0x4d43a3){return client[_0x5df5('0xb')](_0x9b8756,_0x4722a2)[_0x5df5('0xc')](function(_0x41941e){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x2b7ed9,_0x5df5('0xd'));logger['debug'](_0x5df5('0xe'),_0x2b7ed9,_0x5df5('0xd'),JSON['stringify'](_0x41941e));if(_0x41941e['error']){if(_0x41941e[_0x5df5('0xf')][_0x5df5('0x10')]===0x1f4){logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);return _0x4d43a3(_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);}logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e['error'][_0x5df5('0x12')]);return _0x3743f3(_0x41941e['error'][_0x5df5('0x12')]);}else{logger[_0x5df5('0x13')](_0x5df5('0x11'),_0x2b7ed9,_0x5df5('0xd'));_0x3743f3(_0x41941e[_0x5df5('0x14')]['message']);}})[_0x5df5('0x15')](function(_0x457205){logger['error'](_0x5df5('0x11'),_0x2b7ed9,_0x457205);_0x4d43a3(_0x457205);});});}exports[_0x5df5('0x16')]=function(_0xb7e1c2){var _0x44f700=this;return new Promise(function(_0x215d59,_0x4b499d){return db['FreshsalesAccount'][_0x5df5('0x17')]({'raw':_0xb7e1c2['options']?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x19')]===undefined?!![]:![]:!![],'where':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x1a')]||null:null,'attributes':_0xb7e1c2['options']?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x1b')]||null:null,'limit':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x1c')]||null:null,'include':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2['options'][_0x5df5('0x1d')]?_[_0x5df5('0x1e')](_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x1d')],function(_0x5ca542){return{'model':db[_0x5ca542[_0x5df5('0x1f')]],'as':_0x5ca542['as'],'attributes':_0x5ca542[_0x5df5('0x1b')],'include':_0x5ca542[_0x5df5('0x1d')]?_['map'](_0x5ca542['include'],function(_0x532923){return{'model':db[_0x532923[_0x5df5('0x1f')]],'as':_0x532923['as'],'attributes':_0x532923[_0x5df5('0x1b')],'include':_0x532923[_0x5df5('0x1d')]?_[_0x5df5('0x1e')](_0x532923[_0x5df5('0x1d')],function(_0x1fd83c){return{'model':db[_0x1fd83c[_0x5df5('0x1f')]],'as':_0x1fd83c['as'],'attributes':_0x1fd83c[_0x5df5('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18bb61){logger['info'](_0x5df5('0x16'),_0xb7e1c2);logger[_0x5df5('0x20')]('GetFreshsalesAccount',_0xb7e1c2,JSON[_0x5df5('0x21')](_0x18bb61));_0x215d59(_0x18bb61);})['catch'](function(_0xd2b213){logger['error'](_0x5df5('0x16'),_0xd2b213['message'],_0xb7e1c2);_0x4b499d(_0x44f700[_0x5df5('0xf')](0x1f4,_0xd2b213['message']));});});};exports[_0x5df5('0x22')]=function(_0x47bebb){var _0x4784ca=this;return new Promise(function(_0x485484,_0xf445de){return db[_0x5df5('0x23')][_0x5df5('0x24')]({'raw':_0x47bebb[_0x5df5('0x18')]?_0x47bebb[_0x5df5('0x18')][_0x5df5('0x19')]===undefined?!![]:![]:!![],'where':_0x47bebb[_0x5df5('0x18')]?_0x47bebb['options']['where']||null:null,'attributes':_0x47bebb[_0x5df5('0x18')]?_0x47bebb[_0x5df5('0x18')][_0x5df5('0x1b')]||null:null,'include':_0x47bebb[_0x5df5('0x18')]?_0x47bebb[_0x5df5('0x18')][_0x5df5('0x1d')]?_['map'](_0x47bebb[_0x5df5('0x18')][_0x5df5('0x1d')],function(_0x2f1001){return{'model':db[_0x2f1001[_0x5df5('0x1f')]],'as':_0x2f1001['as'],'attributes':_0x2f1001['attributes'],'include':_0x2f1001[_0x5df5('0x1d')]?_['map'](_0x2f1001[_0x5df5('0x1d')],function(_0x394676){return{'model':db[_0x394676['model']],'as':_0x394676['as'],'attributes':_0x394676[_0x5df5('0x1b')],'include':_0x394676['include']?_[_0x5df5('0x1e')](_0x394676[_0x5df5('0x1d')],function(_0x4697c2){return{'model':db[_0x4697c2[_0x5df5('0x1f')]],'as':_0x4697c2['as'],'attributes':_0x4697c2['attributes']};}):[]};}):[]};}):[]:[]})[_0x5df5('0xc')](function(_0x2e7e64){logger[_0x5df5('0x13')](_0x5df5('0x22'),_0x47bebb);logger['debug'](_0x5df5('0x22'),_0x47bebb,JSON[_0x5df5('0x21')](_0x2e7e64));_0x485484(_0x2e7e64);})[_0x5df5('0x15')](function(_0x18b597){logger[_0x5df5('0xf')](_0x5df5('0x22'),_0x18b597[_0x5df5('0x12')],_0x47bebb);_0xf445de(_0x4784ca['error'](0x1f4,_0x18b597[_0x5df5('0x12')]));});});}; \ No newline at end of file +var _0x25e7=['find','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','map','include','model','stringify'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0x25e7,0x1d6));var _0x725e=function(_0x2336ea,_0x46e872){_0x2336ea=_0x2336ea-0x0;var _0x216bf9=_0x25e7[_0x2336ea];return _0x216bf9;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var moment=require(_0x725e('0x2'));var BPromise=require(_0x725e('0x3'));var rs=require(_0x725e('0x4'));var fs=require('fs');var Redis=require(_0x725e('0x5'));var db=require(_0x725e('0x6'))['db'];var utils=require(_0x725e('0x7'));var logger=require(_0x725e('0x8'))(_0x725e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x725e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481316,_0x111a50,_0x192c27){return new BPromise(function(_0x216b33,_0x67de0c){return client[_0x725e('0xb')](_0x481316,_0x192c27)[_0x725e('0xc')](function(_0x39858a){logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,_0x725e('0xf'));logger[_0x725e('0x10')](_0x725e('0x11'),_0x111a50,'request\x20sent',JSON['stringify'](_0x39858a));if(_0x39858a[_0x725e('0x12')]){if(_0x39858a[_0x725e('0x12')]['code']===0x1f4){logger['error'](_0x725e('0xe'),_0x111a50,_0x39858a[_0x725e('0x12')]['message']);return _0x67de0c(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}logger[_0x725e('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x111a50,_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);return _0x216b33(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}else{logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,'request\x20sent');_0x216b33(_0x39858a[_0x725e('0x14')][_0x725e('0x13')]);}})[_0x725e('0x15')](function(_0x54ac0f){logger[_0x725e('0x12')](_0x725e('0xe'),_0x111a50,_0x54ac0f);_0x67de0c(_0x54ac0f);});});}exports[_0x725e('0x16')]=function(_0x397e33){var _0x268438=this;return new Promise(function(_0x2811e7,_0x528e7d){return db[_0x725e('0x17')][_0x725e('0x18')]({'raw':_0x397e33[_0x725e('0x19')]?_0x397e33[_0x725e('0x19')][_0x725e('0x1a')]===undefined?!![]:![]:!![],'where':_0x397e33[_0x725e('0x19')]?_0x397e33['options'][_0x725e('0x1b')]||null:null,'attributes':_0x397e33[_0x725e('0x19')]?_0x397e33[_0x725e('0x19')][_0x725e('0x1c')]||null:null,'limit':_0x397e33[_0x725e('0x19')]?_0x397e33[_0x725e('0x19')][_0x725e('0x1d')]||null:null,'include':_0x397e33[_0x725e('0x19')]?_0x397e33[_0x725e('0x19')]['include']?_[_0x725e('0x1e')](_0x397e33[_0x725e('0x19')][_0x725e('0x1f')],function(_0x3facae){return{'model':db[_0x3facae['model']],'as':_0x3facae['as'],'attributes':_0x3facae[_0x725e('0x1c')],'include':_0x3facae['include']?_['map'](_0x3facae['include'],function(_0x2aad7b){return{'model':db[_0x2aad7b[_0x725e('0x20')]],'as':_0x2aad7b['as'],'attributes':_0x2aad7b[_0x725e('0x1c')],'include':_0x2aad7b['include']?_[_0x725e('0x1e')](_0x2aad7b[_0x725e('0x1f')],function(_0x5a5bef){return{'model':db[_0x5a5bef[_0x725e('0x20')]],'as':_0x5a5bef['as'],'attributes':_0x5a5bef[_0x725e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x378ace){logger['info']('GetFreshsalesAccount',_0x397e33);logger[_0x725e('0x10')]('GetFreshsalesAccount',_0x397e33,JSON[_0x725e('0x21')](_0x378ace));_0x2811e7(_0x378ace);})['catch'](function(_0x4de2e0){logger[_0x725e('0x12')](_0x725e('0x16'),_0x4de2e0[_0x725e('0x13')],_0x397e33);_0x528e7d(_0x268438['error'](0x1f4,_0x4de2e0[_0x725e('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0x85d29c){var _0x1ce9c8=this;return new Promise(function(_0x39932f,_0x28951f){return db[_0x725e('0x17')][_0x725e('0x22')]({'raw':_0x85d29c[_0x725e('0x19')]?_0x85d29c[_0x725e('0x19')][_0x725e('0x1a')]===undefined?!![]:![]:!![],'where':_0x85d29c[_0x725e('0x19')]?_0x85d29c[_0x725e('0x19')]['where']||null:null,'attributes':_0x85d29c[_0x725e('0x19')]?_0x85d29c[_0x725e('0x19')]['attributes']||null:null,'include':_0x85d29c[_0x725e('0x19')]?_0x85d29c['options'][_0x725e('0x1f')]?_['map'](_0x85d29c[_0x725e('0x19')][_0x725e('0x1f')],function(_0x1f2898){return{'model':db[_0x1f2898[_0x725e('0x20')]],'as':_0x1f2898['as'],'attributes':_0x1f2898[_0x725e('0x1c')],'include':_0x1f2898[_0x725e('0x1f')]?_['map'](_0x1f2898['include'],function(_0x35e5e7){return{'model':db[_0x35e5e7[_0x725e('0x20')]],'as':_0x35e5e7['as'],'attributes':_0x35e5e7[_0x725e('0x1c')],'include':_0x35e5e7['include']?_[_0x725e('0x1e')](_0x35e5e7['include'],function(_0x3ce327){return{'model':db[_0x3ce327[_0x725e('0x20')]],'as':_0x3ce327['as'],'attributes':_0x3ce327[_0x725e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x725e('0xc')](function(_0x4f15f3){logger['info'](_0x725e('0x23'),_0x85d29c);logger[_0x725e('0x10')](_0x725e('0x23'),_0x85d29c,JSON['stringify'](_0x4f15f3));_0x39932f(_0x4f15f3);})[_0x725e('0x15')](function(_0xec3b9d){logger[_0x725e('0x12')]('ShowFreshsalesAccount',_0xec3b9d[_0x725e('0x13')],_0x85d29c);_0x28951f(_0x1ce9c8['error'](0x1f4,_0xec3b9d[_0x725e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 84657ce..9a65bf6 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 _0xa0aa=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/fields','getFields','put','update'];(function(_0x216e58,_0x497adc){var _0x5adcad=function(_0x22197f){while(--_0x22197f){_0x216e58['push'](_0x216e58['shift']());}};_0x5adcad(++_0x497adc);}(_0xa0aa,0xab));var _0xaa0a=function(_0x1fb2a3,_0x7ed502){_0x1fb2a3=_0x1fb2a3-0x0;var _0x416978=_0xa0aa[_0x1fb2a3];return _0x416978;};'use strict';var multer=require(_0xaa0a('0x0'));var util=require(_0xaa0a('0x1'));var path=require(_0xaa0a('0x2'));var timeout=require(_0xaa0a('0x3'));var express=require('express');var router=express[_0xaa0a('0x4')]();var fs_extra=require(_0xaa0a('0x5'));var auth=require(_0xaa0a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaa0a('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xaa0a('0x8')]('/',auth[_0xaa0a('0x9')](),controller[_0xaa0a('0xa')]);router[_0xaa0a('0x8')](_0xaa0a('0xb'),auth[_0xaa0a('0x9')](),controller['show']);router[_0xaa0a('0x8')](_0xaa0a('0xc'),auth[_0xaa0a('0x9')](),controller[_0xaa0a('0xd')]);router[_0xaa0a('0x8')]('/:id/descriptions',auth[_0xaa0a('0x9')](),controller['getDescriptions']);router['get'](_0xaa0a('0xe'),auth[_0xaa0a('0x9')](),controller[_0xaa0a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xaa0a('0x10')](_0xaa0a('0xb'),auth['isAuthenticated'](),controller[_0xaa0a('0x11')]);router[_0xaa0a('0x12')](_0xaa0a('0xb'),auth[_0xaa0a('0x9')](),controller[_0xaa0a('0x13')]);module[_0xaa0a('0x14')]=router; \ No newline at end of file +var _0xbf5c=['../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5091a1,_0x29f0c9){var _0x3cf081=function(_0x44ad2d){while(--_0x44ad2d){_0x5091a1['push'](_0x5091a1['shift']());}};_0x3cf081(++_0x29f0c9);}(_0xbf5c,0xd0));var _0xcbf5=function(_0x50961c,_0x47d795){_0x50961c=_0x50961c-0x0;var _0x34f303=_0xbf5c[_0x50961c];return _0x34f303;};'use strict';var multer=require(_0xcbf5('0x0'));var util=require(_0xcbf5('0x1'));var path=require(_0xcbf5('0x2'));var timeout=require(_0xcbf5('0x3'));var express=require(_0xcbf5('0x4'));var router=express[_0xcbf5('0x5')]();var fs_extra=require(_0xcbf5('0x6'));var auth=require(_0xcbf5('0x7'));var interaction=require(_0xcbf5('0x8'));var config=require('../../config/environment');var controller=require(_0xcbf5('0x9'));router[_0xcbf5('0xa')]('/',auth[_0xcbf5('0xb')](),controller[_0xcbf5('0xc')]);router[_0xcbf5('0xa')]('/:id',auth[_0xcbf5('0xb')](),controller[_0xcbf5('0xd')]);router[_0xcbf5('0xa')](_0xcbf5('0xe'),auth[_0xcbf5('0xb')](),controller[_0xcbf5('0xf')]);router[_0xcbf5('0xa')](_0xcbf5('0x10'),auth[_0xcbf5('0xb')](),controller[_0xcbf5('0x11')]);router[_0xcbf5('0xa')](_0xcbf5('0x12'),auth['isAuthenticated'](),controller['getFields']);router[_0xcbf5('0x13')]('/',auth[_0xcbf5('0xb')](),controller[_0xcbf5('0x14')]);router[_0xcbf5('0x15')]('/:id',auth[_0xcbf5('0xb')](),controller[_0xcbf5('0x16')]);router[_0xcbf5('0x17')](_0xcbf5('0x18'),auth[_0xcbf5('0xb')](),controller[_0xcbf5('0x19')]);module[_0xcbf5('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index bfcf961..14adfa6 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 _0x0c66=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c66,0x156));var _0x60c6=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x0c66[_0x40220a];return _0x3903cc;};'use strict';var Sequelize=require(_0x60c6('0x0'));module[_0x60c6('0x1')]={'name':{'type':Sequelize[_0x60c6('0x2')]},'description':{'type':Sequelize[_0x60c6('0x2')]}}; \ No newline at end of file +var _0x58e4=['exports','STRING'];(function(_0x14d939,_0x47e1cb){var _0x506982=function(_0x55eb54){while(--_0x55eb54){_0x14d939['push'](_0x14d939['shift']());}};_0x506982(++_0x47e1cb);}(_0x58e4,0x186));var _0x458e=function(_0x19f61e,_0x3ade86){_0x19f61e=_0x19f61e-0x0;var _0x1eb7c7=_0x58e4[_0x19f61e];return _0x1eb7c7;};'use strict';var Sequelize=require('sequelize');module[_0x458e('0x0')]={'name':{'type':Sequelize[_0x458e('0x1')]},'description':{'type':Sequelize[_0x458e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 0b0cb9e..b1f7de9 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 _0xa66a=['set','apply','save','update','then','destroy','error','stack','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','name','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','options','include','catch','show','length','includeAll','merge','find','create','body','params','findOne','getSubjects','getDescriptions','FreshsalesField','order','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count'];(function(_0x4d2893,_0x831a85){var _0x5a5a2d=function(_0x24db33){while(--_0x24db33){_0x4d2893['push'](_0x4d2893['shift']());}};_0x5a5a2d(++_0x831a85);}(_0xa66a,0x7e));var _0xaa66=function(_0x477a34,_0x587f71){_0x477a34=_0x477a34-0x0;var _0x2483ec=_0xa66a[_0x477a34];return _0x2483ec;};'use strict';var emlformat=require(_0xaa66('0x0'));var rimraf=require(_0xaa66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa66('0x2'));var rp=require(_0xaa66('0x3'));var moment=require(_0xaa66('0x4'));var BPromise=require(_0xaa66('0x5'));var Mustache=require(_0xaa66('0x6'));var util=require('util');var path=require(_0xaa66('0x7'));var sox=require('sox');var csv=require(_0xaa66('0x8'));var ejs=require(_0xaa66('0x9'));var fs=require('fs');var fs_extra=require(_0xaa66('0xa'));var _=require(_0xaa66('0xb'));var squel=require(_0xaa66('0xc'));var crypto=require(_0xaa66('0xd'));var jsforce=require(_0xaa66('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaa66('0x8'));var querystring=require('querystring');var Papa=require(_0xaa66('0xf'));var Redis=require('ioredis');var authService=require(_0xaa66('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaa66('0x11'));var hardwareService=require(_0xaa66('0x12'));var logger=require('../../config/logger')(_0xaa66('0x13'));var utils=require(_0xaa66('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaa66('0x15'))['db'];function respondWithStatusCode(_0x3f55de,_0x49fc66){_0x49fc66=_0x49fc66||0xcc;return function(_0x51ba42){if(_0x51ba42){return _0x3f55de[_0xaa66('0x16')](_0x49fc66);}return _0x3f55de['status'](_0x49fc66)[_0xaa66('0x17')]();};}function respondWithResult(_0x27be64,_0xbec81c){_0xbec81c=_0xbec81c||0xc8;return function(_0x470a2c){if(_0x470a2c){return _0x27be64[_0xaa66('0x18')](_0xbec81c)[_0xaa66('0x19')](_0x470a2c);}};}function respondWithFilteredResult(_0x43d14e,_0x5b6ca5){return function(_0x48986b){if(_0x48986b){var _0x447af7=typeof _0x5b6ca5[_0xaa66('0x1a')]===_0xaa66('0x1b')&&typeof _0x5b6ca5[_0xaa66('0x1c')]===_0xaa66('0x1b');var _0x218666=_0x48986b[_0xaa66('0x1d')];var _0x264f1f=_0x447af7?0x0:_0x5b6ca5['offset'];var _0x58ffeb=_0x447af7?_0x48986b[_0xaa66('0x1d')]:_0x5b6ca5[_0xaa66('0x1a')]+_0x5b6ca5['limit'];var _0x135793;if(_0x58ffeb>=_0x218666){_0x58ffeb=_0x218666;_0x135793=0xc8;}else{_0x135793=0xce;}_0x43d14e[_0xaa66('0x18')](_0x135793);return _0x43d14e[_0xaa66('0x1e')]('Content-Range',_0x264f1f+'-'+_0x58ffeb+'/'+_0x218666)[_0xaa66('0x19')](_0x48986b);}return null;};}function patchUpdates(_0x182972){return function(_0x13e83c){try{jsonpatch[_0xaa66('0x1f')](_0x13e83c,_0x182972,!![]);}catch(_0x32012d){return BPromise['reject'](_0x32012d);}return _0x13e83c[_0xaa66('0x20')]();};}function saveUpdates(_0x23c2dc,_0x43325f){return function(_0x4c6478){if(_0x4c6478){return _0x4c6478[_0xaa66('0x21')](_0x23c2dc)[_0xaa66('0x22')](function(_0x590846){return _0x590846;});}return null;};}function removeEntity(_0x2fb441,_0x24cc85){return function(_0x51491c){if(_0x51491c){return _0x51491c[_0xaa66('0x23')]()[_0xaa66('0x22')](function(){_0x2fb441['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2486cb,_0x4f08e6){return function(_0x192fab){if(!_0x192fab){_0x2486cb[_0xaa66('0x16')](0x194);}return _0x192fab;};}function handleError(_0x85b80e,_0xa32825){_0xa32825=_0xa32825||0x1f4;return function(_0x132728){logger[_0xaa66('0x24')](_0x132728[_0xaa66('0x25')]);if(_0x132728['name']){delete _0x132728['name'];}_0x85b80e[_0xaa66('0x18')](_0xa32825)[_0xaa66('0x26')](_0x132728);};}exports[_0xaa66('0x27')]=function(_0x1ebddf,_0x231971){var _0x54bce4={},_0x2cf2c2={},_0x47a667={'count':0x0,'rows':[]};var _0x553a9b=_[_0xaa66('0x28')](db[_0xaa66('0x29')][_0xaa66('0x2a')],function(_0x32b766){return{'name':_0x32b766[_0xaa66('0x2b')],'type':_0x32b766[_0xaa66('0x2c')][_0xaa66('0x2d')]};});_0x2cf2c2[_0xaa66('0x2e')]=_[_0xaa66('0x28')](_0x553a9b,_0xaa66('0x2f'));_0x2cf2c2['query']=_[_0xaa66('0x30')](_0x1ebddf[_0xaa66('0x31')]);_0x2cf2c2['filters']=_['intersection'](_0x2cf2c2[_0xaa66('0x2e')],_0x2cf2c2['query']);_0x54bce4[_0xaa66('0x32')]=_[_0xaa66('0x33')](_0x2cf2c2['model'],qs[_0xaa66('0x34')](_0x1ebddf[_0xaa66('0x31')][_0xaa66('0x34')]));_0x54bce4[_0xaa66('0x32')]=_0x54bce4['attributes']['length']?_0x54bce4[_0xaa66('0x32')]:_0x2cf2c2['model'];if(!_0x1ebddf['query'][_0xaa66('0x35')](_0xaa66('0x36'))){_0x54bce4[_0xaa66('0x1c')]=qs[_0xaa66('0x1c')](_0x1ebddf[_0xaa66('0x31')][_0xaa66('0x1c')]);_0x54bce4[_0xaa66('0x1a')]=qs[_0xaa66('0x1a')](_0x1ebddf['query'][_0xaa66('0x1a')]);}_0x54bce4['order']=qs[_0xaa66('0x37')](_0x1ebddf['query'][_0xaa66('0x37')]);_0x54bce4[_0xaa66('0x38')]=qs[_0xaa66('0x39')](_[_0xaa66('0x3a')](_0x1ebddf[_0xaa66('0x31')],_0x2cf2c2[_0xaa66('0x39')]),_0x553a9b);if(_0x1ebddf[_0xaa66('0x31')][_0xaa66('0x3b')]){_0x54bce4[_0xaa66('0x38')]=_['merge'](_0x54bce4[_0xaa66('0x38')],{'$or':_[_0xaa66('0x28')](_0x553a9b,function(_0xb5de6b){if(_0xb5de6b[_0xaa66('0x2c')]!==_0xaa66('0x3c')){var _0xbac678={};_0xbac678[_0xb5de6b['name']]={'$like':'%'+_0x1ebddf[_0xaa66('0x31')][_0xaa66('0x3b')]+'%'};return _0xbac678;}})});}_0x54bce4=_['merge']({},_0x54bce4,_0x1ebddf[_0xaa66('0x3d')]);var _0x16145e={'where':_0x54bce4[_0xaa66('0x38')]};return db[_0xaa66('0x29')][_0xaa66('0x1d')](_0x16145e)[_0xaa66('0x22')](function(_0x19801f){_0x47a667[_0xaa66('0x1d')]=_0x19801f;if(_0x1ebddf[_0xaa66('0x31')]['includeAll']){_0x54bce4[_0xaa66('0x3e')]=[{'all':!![]}];}return db[_0xaa66('0x29')]['findAll'](_0x54bce4);})[_0xaa66('0x22')](function(_0x3a0b7e){_0x47a667['rows']=_0x3a0b7e;return _0x47a667;})[_0xaa66('0x22')](respondWithFilteredResult(_0x231971,_0x54bce4))[_0xaa66('0x3f')](handleError(_0x231971,null));};exports[_0xaa66('0x40')]=function(_0x50047d,_0x4c8a0c){var _0x2fca1a={'raw':![],'where':{'id':_0x50047d['params']['id']}},_0x140394={};_0x140394[_0xaa66('0x2e')]=_['keys'](db[_0xaa66('0x29')]['rawAttributes']);_0x140394[_0xaa66('0x31')]=_['keys'](_0x50047d[_0xaa66('0x31')]);_0x140394[_0xaa66('0x39')]=_[_0xaa66('0x33')](_0x140394[_0xaa66('0x2e')],_0x140394['query']);_0x2fca1a[_0xaa66('0x32')]=_[_0xaa66('0x33')](_0x140394[_0xaa66('0x2e')],qs[_0xaa66('0x34')](_0x50047d[_0xaa66('0x31')][_0xaa66('0x34')]));_0x2fca1a[_0xaa66('0x32')]=_0x2fca1a['attributes'][_0xaa66('0x41')]?_0x2fca1a[_0xaa66('0x32')]:_0x140394['model'];if(_0x50047d[_0xaa66('0x31')][_0xaa66('0x42')]){_0x2fca1a[_0xaa66('0x3e')]=[{'all':!![]}];}_0x2fca1a=_[_0xaa66('0x43')]({},_0x2fca1a,_0x50047d[_0xaa66('0x3d')]);return db[_0xaa66('0x29')][_0xaa66('0x44')](_0x2fca1a)[_0xaa66('0x22')](handleEntityNotFound(_0x4c8a0c,null))[_0xaa66('0x22')](respondWithResult(_0x4c8a0c,null))[_0xaa66('0x3f')](handleError(_0x4c8a0c,null));};exports[_0xaa66('0x45')]=function(_0x3c39ca,_0x3db554){return db[_0xaa66('0x29')]['create'](_0x3c39ca[_0xaa66('0x46')],{})['then'](respondWithResult(_0x3db554,0xc9))[_0xaa66('0x3f')](handleError(_0x3db554,null));};exports['update']=function(_0x18adb1,_0x185664){if(_0x18adb1[_0xaa66('0x46')]['id']){delete _0x18adb1['body']['id'];}return db['FreshsalesConfiguration'][_0xaa66('0x44')]({'where':{'id':_0x18adb1[_0xaa66('0x47')]['id']}})['then'](handleEntityNotFound(_0x185664,null))[_0xaa66('0x22')](saveUpdates(_0x18adb1[_0xaa66('0x46')],null))[_0xaa66('0x22')](respondWithResult(_0x185664,null))[_0xaa66('0x3f')](handleError(_0x185664,null));};exports[_0xaa66('0x23')]=function(_0x38d287,_0x9fca07){return db[_0xaa66('0x29')][_0xaa66('0x44')]({'where':{'id':_0x38d287[_0xaa66('0x47')]['id']}})[_0xaa66('0x22')](handleEntityNotFound(_0x9fca07,null))[_0xaa66('0x22')](removeEntity(_0x9fca07,null))[_0xaa66('0x3f')](handleError(_0x9fca07,null));};exports['getSubjects']=function(_0x328474,_0x1b0e0a,_0x2d9c23){var _0x11e64e={};var _0x40c889={};var _0x1a6ff8;var _0x36a377;return db[_0xaa66('0x29')][_0xaa66('0x48')]({'where':{'id':_0x328474[_0xaa66('0x47')]['id']}})['then'](handleEntityNotFound(_0x1b0e0a,null))[_0xaa66('0x22')](function(_0x5e8f6e){if(_0x5e8f6e){_0x1a6ff8=_0x5e8f6e;_0x40c889['model']=_[_0xaa66('0x30')](db['FreshsalesField'][_0xaa66('0x2a')]);_0x40c889[_0xaa66('0x31')]=_['keys'](_0x328474[_0xaa66('0x31')]);_0x40c889['filters']=_['intersection'](_0x40c889[_0xaa66('0x2e')],_0x40c889['query']);_0x11e64e[_0xaa66('0x32')]=_[_0xaa66('0x33')](_0x40c889['model'],qs[_0xaa66('0x34')](_0x328474[_0xaa66('0x31')][_0xaa66('0x34')]));_0x11e64e[_0xaa66('0x32')]=_0x11e64e[_0xaa66('0x32')]['length']?_0x11e64e[_0xaa66('0x32')]:_0x40c889['model'];_0x11e64e['order']=qs[_0xaa66('0x37')](_0x328474[_0xaa66('0x31')][_0xaa66('0x37')]);_0x11e64e['where']=qs[_0xaa66('0x39')](_[_0xaa66('0x3a')](_0x328474[_0xaa66('0x31')],_0x40c889['filters']));if(_0x328474[_0xaa66('0x31')][_0xaa66('0x3b')]){_0x11e64e['where']=_['merge'](_0x11e64e[_0xaa66('0x38')],{'$or':_['map'](_0x11e64e[_0xaa66('0x32')],function(_0x318b69){var _0x5234a1={};_0x5234a1[_0x318b69]={'$like':'%'+_0x328474[_0xaa66('0x31')][_0xaa66('0x3b')]+'%'};return _0x5234a1;})});}_0x11e64e=_['merge']({},_0x11e64e,_0x328474['options']);return _0x1a6ff8[_0xaa66('0x49')](_0x11e64e);}})[_0xaa66('0x22')](function(_0x148bd4){if(_0x148bd4){_0x36a377=_0x148bd4[_0xaa66('0x41')];if(!_0x328474[_0xaa66('0x31')][_0xaa66('0x35')](_0xaa66('0x36'))){_0x11e64e['limit']=qs['limit'](_0x328474[_0xaa66('0x31')][_0xaa66('0x1c')]);_0x11e64e[_0xaa66('0x1a')]=qs['offset'](_0x328474[_0xaa66('0x31')][_0xaa66('0x1a')]);}return _0x1a6ff8['getSubjects'](_0x11e64e);}})['then'](function(_0xb8ce14){if(_0xb8ce14){return _0xb8ce14?{'count':_0x36a377,'rows':_0xb8ce14}:null;}})[_0xaa66('0x22')](respondWithResult(_0x1b0e0a,null))[_0xaa66('0x3f')](handleError(_0x1b0e0a,null));};exports[_0xaa66('0x4a')]=function(_0x37dcab,_0x3de584,_0x43bb2e){var _0x53cd09={};var _0xfc01d5={};var _0x1a7ba2;var _0x881d20;return db[_0xaa66('0x29')][_0xaa66('0x48')]({'where':{'id':_0x37dcab[_0xaa66('0x47')]['id']}})[_0xaa66('0x22')](handleEntityNotFound(_0x3de584,null))[_0xaa66('0x22')](function(_0x12899b){if(_0x12899b){_0x1a7ba2=_0x12899b;_0xfc01d5[_0xaa66('0x2e')]=_[_0xaa66('0x30')](db[_0xaa66('0x4b')][_0xaa66('0x2a')]);_0xfc01d5[_0xaa66('0x31')]=_['keys'](_0x37dcab['query']);_0xfc01d5[_0xaa66('0x39')]=_['intersection'](_0xfc01d5['model'],_0xfc01d5[_0xaa66('0x31')]);_0x53cd09[_0xaa66('0x32')]=_[_0xaa66('0x33')](_0xfc01d5[_0xaa66('0x2e')],qs['fields'](_0x37dcab['query']['fields']));_0x53cd09[_0xaa66('0x32')]=_0x53cd09[_0xaa66('0x32')][_0xaa66('0x41')]?_0x53cd09[_0xaa66('0x32')]:_0xfc01d5[_0xaa66('0x2e')];_0x53cd09[_0xaa66('0x4c')]=qs['sort'](_0x37dcab['query'][_0xaa66('0x37')]);_0x53cd09[_0xaa66('0x38')]=qs[_0xaa66('0x39')](_['pick'](_0x37dcab[_0xaa66('0x31')],_0xfc01d5[_0xaa66('0x39')]));if(_0x37dcab[_0xaa66('0x31')][_0xaa66('0x3b')]){_0x53cd09[_0xaa66('0x38')]=_['merge'](_0x53cd09[_0xaa66('0x38')],{'$or':_['map'](_0x53cd09[_0xaa66('0x32')],function(_0x512523){var _0x31b647={};_0x31b647[_0x512523]={'$like':'%'+_0x37dcab[_0xaa66('0x31')]['filter']+'%'};return _0x31b647;})});}_0x53cd09=_['merge']({},_0x53cd09,_0x37dcab[_0xaa66('0x3d')]);return _0x1a7ba2[_0xaa66('0x4a')](_0x53cd09);}})[_0xaa66('0x22')](function(_0x4cc499){if(_0x4cc499){_0x881d20=_0x4cc499[_0xaa66('0x41')];if(!_0x37dcab['query']['hasOwnProperty'](_0xaa66('0x36'))){_0x53cd09['limit']=qs[_0xaa66('0x1c')](_0x37dcab['query'][_0xaa66('0x1c')]);_0x53cd09[_0xaa66('0x1a')]=qs[_0xaa66('0x1a')](_0x37dcab[_0xaa66('0x31')][_0xaa66('0x1a')]);}return _0x1a7ba2[_0xaa66('0x4a')](_0x53cd09);}})[_0xaa66('0x22')](function(_0x1a3ea5){if(_0x1a3ea5){return _0x1a3ea5?{'count':_0x881d20,'rows':_0x1a3ea5}:null;}})[_0xaa66('0x22')](respondWithResult(_0x3de584,null))[_0xaa66('0x3f')](handleError(_0x3de584,null));};exports['getFields']=function(_0x4add06,_0x13c8ad,_0x2a3894){var _0x259b36={};var _0x112577={};var _0x4f0d1e;var _0x4a42ee;return db[_0xaa66('0x29')][_0xaa66('0x48')]({'where':{'id':_0x4add06[_0xaa66('0x47')]['id']}})['then'](handleEntityNotFound(_0x13c8ad,null))[_0xaa66('0x22')](function(_0x41ec7a){if(_0x41ec7a){_0x4f0d1e=_0x41ec7a;_0x112577[_0xaa66('0x2e')]=_['keys'](db[_0xaa66('0x4b')][_0xaa66('0x2a')]);_0x112577[_0xaa66('0x31')]=_['keys'](_0x4add06[_0xaa66('0x31')]);_0x112577[_0xaa66('0x39')]=_['intersection'](_0x112577[_0xaa66('0x2e')],_0x112577[_0xaa66('0x31')]);_0x259b36[_0xaa66('0x32')]=_[_0xaa66('0x33')](_0x112577['model'],qs[_0xaa66('0x34')](_0x4add06[_0xaa66('0x31')][_0xaa66('0x34')]));_0x259b36[_0xaa66('0x32')]=_0x259b36['attributes'][_0xaa66('0x41')]?_0x259b36[_0xaa66('0x32')]:_0x112577[_0xaa66('0x2e')];_0x259b36[_0xaa66('0x4c')]=qs[_0xaa66('0x37')](_0x4add06[_0xaa66('0x31')][_0xaa66('0x37')]);_0x259b36[_0xaa66('0x38')]=qs['filters'](_[_0xaa66('0x3a')](_0x4add06[_0xaa66('0x31')],_0x112577[_0xaa66('0x39')]));if(_0x4add06[_0xaa66('0x31')]['filter']){_0x259b36[_0xaa66('0x38')]=_[_0xaa66('0x43')](_0x259b36[_0xaa66('0x38')],{'$or':_['map'](_0x259b36[_0xaa66('0x32')],function(_0x3bb469){var _0x3c426e={};_0x3c426e[_0x3bb469]={'$like':'%'+_0x4add06[_0xaa66('0x31')][_0xaa66('0x3b')]+'%'};return _0x3c426e;})});}_0x259b36=_[_0xaa66('0x43')]({},_0x259b36,_0x4add06[_0xaa66('0x3d')]);return _0x4f0d1e[_0xaa66('0x4d')](_0x259b36);}})[_0xaa66('0x22')](function(_0x46e897){if(_0x46e897){_0x4a42ee=_0x46e897[_0xaa66('0x41')];if(!_0x4add06[_0xaa66('0x31')][_0xaa66('0x35')]('nolimit')){_0x259b36[_0xaa66('0x1c')]=qs[_0xaa66('0x1c')](_0x4add06[_0xaa66('0x31')][_0xaa66('0x1c')]);_0x259b36[_0xaa66('0x1a')]=qs[_0xaa66('0x1a')](_0x4add06['query'][_0xaa66('0x1a')]);}return _0x4f0d1e['getFields'](_0x259b36);}})[_0xaa66('0x22')](function(_0x4b4b8e){if(_0x4b4b8e){return _0x4b4b8e?{'count':_0x4a42ee,'rows':_0x4b4b8e}:null;}})[_0xaa66('0x22')](respondWithResult(_0x13c8ad,null))[_0xaa66('0x3f')](handleError(_0x13c8ad,null));}; \ No newline at end of file +var _0x15a4=['sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','params','length','includeAll','include','find','create','body','update','getSubjects','FreshsalesField','order','getDescriptions','findOne','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15a4,0x6d));var _0x415a=function(_0x11c06e,_0x1cb9c7){_0x11c06e=_0x11c06e-0x0;var _0x20a7dc=_0x15a4[_0x11c06e];return _0x20a7dc;};'use strict';var emlformat=require(_0x415a('0x0'));var rimraf=require(_0x415a('0x1'));var zipdir=require(_0x415a('0x2'));var jsonpatch=require(_0x415a('0x3'));var rp=require(_0x415a('0x4'));var moment=require(_0x415a('0x5'));var BPromise=require(_0x415a('0x6'));var Mustache=require(_0x415a('0x7'));var util=require(_0x415a('0x8'));var path=require(_0x415a('0x9'));var sox=require(_0x415a('0xa'));var csv=require(_0x415a('0xb'));var ejs=require(_0x415a('0xc'));var fs=require('fs');var fs_extra=require(_0x415a('0xd'));var _=require(_0x415a('0xe'));var squel=require('squel');var crypto=require(_0x415a('0xf'));var jsforce=require(_0x415a('0x10'));var deskjs=require(_0x415a('0x11'));var toCsv=require('to-csv');var querystring=require(_0x415a('0x12'));var Papa=require(_0x415a('0x13'));var Redis=require(_0x415a('0x14'));var authService=require(_0x415a('0x15'));var qs=require(_0x415a('0x16'));var as=require(_0x415a('0x17'));var hardwareService=require(_0x415a('0x18'));var logger=require(_0x415a('0x19'))(_0x415a('0x1a'));var utils=require(_0x415a('0x1b'));var config=require(_0x415a('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x415a('0x1d'))['db'];function respondWithStatusCode(_0x318dba,_0x5969df){_0x5969df=_0x5969df||0xcc;return function(_0x13ae1a){if(_0x13ae1a){return _0x318dba[_0x415a('0x1e')](_0x5969df);}return _0x318dba[_0x415a('0x1f')](_0x5969df)[_0x415a('0x20')]();};}function respondWithResult(_0x300579,_0x161e06){_0x161e06=_0x161e06||0xc8;return function(_0x249738){if(_0x249738){return _0x300579[_0x415a('0x1f')](_0x161e06)[_0x415a('0x21')](_0x249738);}};}function respondWithFilteredResult(_0x304ec6,_0xaf6b7e){return function(_0x1eaa60){if(_0x1eaa60){var _0x38be07=typeof _0xaf6b7e[_0x415a('0x22')]==='undefined'&&typeof _0xaf6b7e['limit']==='undefined';var _0x597ec8=_0x1eaa60[_0x415a('0x23')];var _0x42685d=_0x38be07?0x0:_0xaf6b7e[_0x415a('0x22')];var _0xf7f0db=_0x38be07?_0x1eaa60[_0x415a('0x23')]:_0xaf6b7e['offset']+_0xaf6b7e[_0x415a('0x24')];var _0x5f170e;if(_0xf7f0db>=_0x597ec8){_0xf7f0db=_0x597ec8;_0x5f170e=0xc8;}else{_0x5f170e=0xce;}_0x304ec6[_0x415a('0x1f')](_0x5f170e);return _0x304ec6[_0x415a('0x25')](_0x415a('0x26'),_0x42685d+'-'+_0xf7f0db+'/'+_0x597ec8)[_0x415a('0x21')](_0x1eaa60);}return null;};}function patchUpdates(_0x513c52){return function(_0x188926){try{jsonpatch[_0x415a('0x27')](_0x188926,_0x513c52,!![]);}catch(_0x4bcc66){return BPromise[_0x415a('0x28')](_0x4bcc66);}return _0x188926['save']();};}function saveUpdates(_0x151ee5,_0x2a1dc4){return function(_0x54d88f){if(_0x54d88f){return _0x54d88f['update'](_0x151ee5)[_0x415a('0x29')](function(_0x14b38c){return _0x14b38c;});}return null;};}function removeEntity(_0x5b8650,_0x8db3b9){return function(_0x306660){if(_0x306660){return _0x306660[_0x415a('0x2a')]()['then'](function(){_0x5b8650['status'](0xcc)[_0x415a('0x20')]();});}};}function handleEntityNotFound(_0x54cc80,_0x5082e8){return function(_0x492944){if(!_0x492944){_0x54cc80['sendStatus'](0x194);}return _0x492944;};}function handleError(_0xc0c56f,_0x275a7b){_0x275a7b=_0x275a7b||0x1f4;return function(_0x1b027b){logger[_0x415a('0x2b')](_0x1b027b[_0x415a('0x2c')]);if(_0x1b027b[_0x415a('0x2d')]){delete _0x1b027b[_0x415a('0x2d')];}_0xc0c56f['status'](_0x275a7b)[_0x415a('0x2e')](_0x1b027b);};}exports[_0x415a('0x2f')]=function(_0x354f2b,_0x575f1a){var _0x5b4858={},_0x8fb2fe={},_0x3a6c2b={'count':0x0,'rows':[]};var _0x1514d4=_[_0x415a('0x30')](db[_0x415a('0x31')][_0x415a('0x32')],function(_0x28c39e){return{'name':_0x28c39e[_0x415a('0x33')],'type':_0x28c39e[_0x415a('0x34')][_0x415a('0x35')]};});_0x8fb2fe[_0x415a('0x36')]=_[_0x415a('0x30')](_0x1514d4,_0x415a('0x2d'));_0x8fb2fe[_0x415a('0x37')]=_[_0x415a('0x38')](_0x354f2b['query']);_0x8fb2fe[_0x415a('0x39')]=_[_0x415a('0x3a')](_0x8fb2fe[_0x415a('0x36')],_0x8fb2fe[_0x415a('0x37')]);_0x5b4858[_0x415a('0x3b')]=_['intersection'](_0x8fb2fe[_0x415a('0x36')],qs[_0x415a('0x3c')](_0x354f2b[_0x415a('0x37')][_0x415a('0x3c')]));_0x5b4858[_0x415a('0x3b')]=_0x5b4858[_0x415a('0x3b')]['length']?_0x5b4858['attributes']:_0x8fb2fe[_0x415a('0x36')];if(!_0x354f2b[_0x415a('0x37')][_0x415a('0x3d')](_0x415a('0x3e'))){_0x5b4858['limit']=qs[_0x415a('0x24')](_0x354f2b['query']['limit']);_0x5b4858[_0x415a('0x22')]=qs[_0x415a('0x22')](_0x354f2b[_0x415a('0x37')]['offset']);}_0x5b4858['order']=qs[_0x415a('0x3f')](_0x354f2b[_0x415a('0x37')][_0x415a('0x3f')]);_0x5b4858[_0x415a('0x40')]=qs[_0x415a('0x39')](_[_0x415a('0x41')](_0x354f2b[_0x415a('0x37')],_0x8fb2fe[_0x415a('0x39')]),_0x1514d4);if(_0x354f2b['query'][_0x415a('0x42')]){_0x5b4858[_0x415a('0x40')]=_[_0x415a('0x43')](_0x5b4858[_0x415a('0x40')],{'$or':_[_0x415a('0x30')](_0x1514d4,function(_0x2e5a4d){if(_0x2e5a4d['type']!==_0x415a('0x44')){var _0x583ec5={};_0x583ec5[_0x2e5a4d[_0x415a('0x2d')]]={'$like':'%'+_0x354f2b[_0x415a('0x37')][_0x415a('0x42')]+'%'};return _0x583ec5;}})});}_0x5b4858=_[_0x415a('0x43')]({},_0x5b4858,_0x354f2b[_0x415a('0x45')]);var _0x2ba31c={'where':_0x5b4858[_0x415a('0x40')]};return db[_0x415a('0x31')][_0x415a('0x23')](_0x2ba31c)[_0x415a('0x29')](function(_0x32e067){_0x3a6c2b[_0x415a('0x23')]=_0x32e067;if(_0x354f2b[_0x415a('0x37')]['includeAll']){_0x5b4858['include']=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x5b4858);})['then'](function(_0x24b433){_0x3a6c2b[_0x415a('0x46')]=_0x24b433;return _0x3a6c2b;})['then'](respondWithFilteredResult(_0x575f1a,_0x5b4858))[_0x415a('0x47')](handleError(_0x575f1a,null));};exports['show']=function(_0x9ef461,_0x33c99c){var _0x13d8d5={'raw':![],'where':{'id':_0x9ef461[_0x415a('0x48')]['id']}},_0x58a3e3={};_0x58a3e3[_0x415a('0x36')]=_['keys'](db[_0x415a('0x31')]['rawAttributes']);_0x58a3e3[_0x415a('0x37')]=_[_0x415a('0x38')](_0x9ef461[_0x415a('0x37')]);_0x58a3e3['filters']=_[_0x415a('0x3a')](_0x58a3e3[_0x415a('0x36')],_0x58a3e3['query']);_0x13d8d5['attributes']=_['intersection'](_0x58a3e3[_0x415a('0x36')],qs[_0x415a('0x3c')](_0x9ef461[_0x415a('0x37')][_0x415a('0x3c')]));_0x13d8d5[_0x415a('0x3b')]=_0x13d8d5['attributes'][_0x415a('0x49')]?_0x13d8d5[_0x415a('0x3b')]:_0x58a3e3[_0x415a('0x36')];if(_0x9ef461['query'][_0x415a('0x4a')]){_0x13d8d5[_0x415a('0x4b')]=[{'all':!![]}];}_0x13d8d5=_[_0x415a('0x43')]({},_0x13d8d5,_0x9ef461[_0x415a('0x45')]);return db[_0x415a('0x31')][_0x415a('0x4c')](_0x13d8d5)[_0x415a('0x29')](handleEntityNotFound(_0x33c99c,null))['then'](respondWithResult(_0x33c99c,null))[_0x415a('0x47')](handleError(_0x33c99c,null));};exports[_0x415a('0x4d')]=function(_0x2b51b6,_0x4cd7e4){return db[_0x415a('0x31')]['create'](_0x2b51b6[_0x415a('0x4e')],{})[_0x415a('0x29')](respondWithResult(_0x4cd7e4,0xc9))[_0x415a('0x47')](handleError(_0x4cd7e4,null));};exports[_0x415a('0x4f')]=function(_0x12249f,_0x223ab2){if(_0x12249f[_0x415a('0x4e')]['id']){delete _0x12249f[_0x415a('0x4e')]['id'];}return db[_0x415a('0x31')][_0x415a('0x4c')]({'where':{'id':_0x12249f[_0x415a('0x48')]['id']}})[_0x415a('0x29')](handleEntityNotFound(_0x223ab2,null))[_0x415a('0x29')](saveUpdates(_0x12249f[_0x415a('0x4e')],null))['then'](respondWithResult(_0x223ab2,null))['catch'](handleError(_0x223ab2,null));};exports[_0x415a('0x2a')]=function(_0x2fb8d3,_0x23a558){return db['FreshsalesConfiguration'][_0x415a('0x4c')]({'where':{'id':_0x2fb8d3[_0x415a('0x48')]['id']}})[_0x415a('0x29')](handleEntityNotFound(_0x23a558,null))[_0x415a('0x29')](removeEntity(_0x23a558,null))['catch'](handleError(_0x23a558,null));};exports[_0x415a('0x50')]=function(_0x64b23d,_0x417995,_0x5a3ed5){var _0x4e707b={};var _0x4e63ad={};var _0x1631a9;var _0x347370;return db[_0x415a('0x31')]['findOne']({'where':{'id':_0x64b23d[_0x415a('0x48')]['id']}})[_0x415a('0x29')](handleEntityNotFound(_0x417995,null))[_0x415a('0x29')](function(_0x563387){if(_0x563387){_0x1631a9=_0x563387;_0x4e63ad[_0x415a('0x36')]=_[_0x415a('0x38')](db[_0x415a('0x51')][_0x415a('0x32')]);_0x4e63ad[_0x415a('0x37')]=_[_0x415a('0x38')](_0x64b23d['query']);_0x4e63ad[_0x415a('0x39')]=_[_0x415a('0x3a')](_0x4e63ad[_0x415a('0x36')],_0x4e63ad[_0x415a('0x37')]);_0x4e707b[_0x415a('0x3b')]=_[_0x415a('0x3a')](_0x4e63ad[_0x415a('0x36')],qs[_0x415a('0x3c')](_0x64b23d['query'][_0x415a('0x3c')]));_0x4e707b[_0x415a('0x3b')]=_0x4e707b[_0x415a('0x3b')]['length']?_0x4e707b['attributes']:_0x4e63ad[_0x415a('0x36')];_0x4e707b[_0x415a('0x52')]=qs['sort'](_0x64b23d[_0x415a('0x37')]['sort']);_0x4e707b[_0x415a('0x40')]=qs[_0x415a('0x39')](_['pick'](_0x64b23d[_0x415a('0x37')],_0x4e63ad[_0x415a('0x39')]));if(_0x64b23d[_0x415a('0x37')]['filter']){_0x4e707b[_0x415a('0x40')]=_['merge'](_0x4e707b[_0x415a('0x40')],{'$or':_['map'](_0x4e707b[_0x415a('0x3b')],function(_0x504a97){var _0x45c440={};_0x45c440[_0x504a97]={'$like':'%'+_0x64b23d[_0x415a('0x37')]['filter']+'%'};return _0x45c440;})});}_0x4e707b=_[_0x415a('0x43')]({},_0x4e707b,_0x64b23d[_0x415a('0x45')]);return _0x1631a9['getSubjects'](_0x4e707b);}})['then'](function(_0x9b900d){if(_0x9b900d){_0x347370=_0x9b900d['length'];if(!_0x64b23d['query'][_0x415a('0x3d')](_0x415a('0x3e'))){_0x4e707b[_0x415a('0x24')]=qs[_0x415a('0x24')](_0x64b23d[_0x415a('0x37')][_0x415a('0x24')]);_0x4e707b['offset']=qs[_0x415a('0x22')](_0x64b23d[_0x415a('0x37')]['offset']);}return _0x1631a9[_0x415a('0x50')](_0x4e707b);}})[_0x415a('0x29')](function(_0x44fbb7){if(_0x44fbb7){return _0x44fbb7?{'count':_0x347370,'rows':_0x44fbb7}:null;}})[_0x415a('0x29')](respondWithResult(_0x417995,null))['catch'](handleError(_0x417995,null));};exports[_0x415a('0x53')]=function(_0x395f94,_0x1b2588,_0x148423){var _0x78e437={};var _0x5efe32={};var _0x443657;var _0x4dcc1e;return db[_0x415a('0x31')][_0x415a('0x54')]({'where':{'id':_0x395f94[_0x415a('0x48')]['id']}})[_0x415a('0x29')](handleEntityNotFound(_0x1b2588,null))['then'](function(_0x3f6223){if(_0x3f6223){_0x443657=_0x3f6223;_0x5efe32[_0x415a('0x36')]=_[_0x415a('0x38')](db[_0x415a('0x51')][_0x415a('0x32')]);_0x5efe32['query']=_[_0x415a('0x38')](_0x395f94['query']);_0x5efe32['filters']=_[_0x415a('0x3a')](_0x5efe32['model'],_0x5efe32[_0x415a('0x37')]);_0x78e437[_0x415a('0x3b')]=_[_0x415a('0x3a')](_0x5efe32['model'],qs[_0x415a('0x3c')](_0x395f94[_0x415a('0x37')]['fields']));_0x78e437[_0x415a('0x3b')]=_0x78e437['attributes'][_0x415a('0x49')]?_0x78e437[_0x415a('0x3b')]:_0x5efe32[_0x415a('0x36')];_0x78e437[_0x415a('0x52')]=qs[_0x415a('0x3f')](_0x395f94[_0x415a('0x37')]['sort']);_0x78e437['where']=qs[_0x415a('0x39')](_[_0x415a('0x41')](_0x395f94['query'],_0x5efe32[_0x415a('0x39')]));if(_0x395f94['query']['filter']){_0x78e437[_0x415a('0x40')]=_[_0x415a('0x43')](_0x78e437[_0x415a('0x40')],{'$or':_[_0x415a('0x30')](_0x78e437['attributes'],function(_0x1f72ff){var _0x39dc61={};_0x39dc61[_0x1f72ff]={'$like':'%'+_0x395f94[_0x415a('0x37')][_0x415a('0x42')]+'%'};return _0x39dc61;})});}_0x78e437=_[_0x415a('0x43')]({},_0x78e437,_0x395f94['options']);return _0x443657[_0x415a('0x53')](_0x78e437);}})[_0x415a('0x29')](function(_0x220834){if(_0x220834){_0x4dcc1e=_0x220834['length'];if(!_0x395f94[_0x415a('0x37')][_0x415a('0x3d')]('nolimit')){_0x78e437[_0x415a('0x24')]=qs[_0x415a('0x24')](_0x395f94[_0x415a('0x37')][_0x415a('0x24')]);_0x78e437[_0x415a('0x22')]=qs[_0x415a('0x22')](_0x395f94['query']['offset']);}return _0x443657['getDescriptions'](_0x78e437);}})[_0x415a('0x29')](function(_0x20eff2){if(_0x20eff2){return _0x20eff2?{'count':_0x4dcc1e,'rows':_0x20eff2}:null;}})[_0x415a('0x29')](respondWithResult(_0x1b2588,null))[_0x415a('0x47')](handleError(_0x1b2588,null));};exports['getFields']=function(_0x5690d0,_0x344227,_0x19dc7f){var _0x2635ed={};var _0x47f8e5={};var _0xb6c155;var _0x1375e3;return db[_0x415a('0x31')][_0x415a('0x54')]({'where':{'id':_0x5690d0[_0x415a('0x48')]['id']}})[_0x415a('0x29')](handleEntityNotFound(_0x344227,null))['then'](function(_0x34748f){if(_0x34748f){_0xb6c155=_0x34748f;_0x47f8e5[_0x415a('0x36')]=_[_0x415a('0x38')](db['FreshsalesField'][_0x415a('0x32')]);_0x47f8e5[_0x415a('0x37')]=_[_0x415a('0x38')](_0x5690d0['query']);_0x47f8e5[_0x415a('0x39')]=_[_0x415a('0x3a')](_0x47f8e5[_0x415a('0x36')],_0x47f8e5[_0x415a('0x37')]);_0x2635ed[_0x415a('0x3b')]=_['intersection'](_0x47f8e5[_0x415a('0x36')],qs[_0x415a('0x3c')](_0x5690d0[_0x415a('0x37')][_0x415a('0x3c')]));_0x2635ed[_0x415a('0x3b')]=_0x2635ed[_0x415a('0x3b')][_0x415a('0x49')]?_0x2635ed['attributes']:_0x47f8e5[_0x415a('0x36')];_0x2635ed['order']=qs['sort'](_0x5690d0[_0x415a('0x37')]['sort']);_0x2635ed['where']=qs[_0x415a('0x39')](_[_0x415a('0x41')](_0x5690d0[_0x415a('0x37')],_0x47f8e5[_0x415a('0x39')]));if(_0x5690d0[_0x415a('0x37')][_0x415a('0x42')]){_0x2635ed[_0x415a('0x40')]=_[_0x415a('0x43')](_0x2635ed['where'],{'$or':_[_0x415a('0x30')](_0x2635ed[_0x415a('0x3b')],function(_0xc9b1d7){var _0x15e219={};_0x15e219[_0xc9b1d7]={'$like':'%'+_0x5690d0[_0x415a('0x37')][_0x415a('0x42')]+'%'};return _0x15e219;})});}_0x2635ed=_[_0x415a('0x43')]({},_0x2635ed,_0x5690d0[_0x415a('0x45')]);return _0xb6c155[_0x415a('0x55')](_0x2635ed);}})['then'](function(_0x94bee3){if(_0x94bee3){_0x1375e3=_0x94bee3['length'];if(!_0x5690d0[_0x415a('0x37')][_0x415a('0x3d')](_0x415a('0x3e'))){_0x2635ed[_0x415a('0x24')]=qs['limit'](_0x5690d0['query'][_0x415a('0x24')]);_0x2635ed[_0x415a('0x22')]=qs[_0x415a('0x22')](_0x5690d0[_0x415a('0x37')][_0x415a('0x22')]);}return _0xb6c155[_0x415a('0x55')](_0x2635ed);}})[_0x415a('0x29')](function(_0x52247d){if(_0x52247d){return _0x52247d?{'count':_0x1375e3,'rows':_0x52247d}:null;}})[_0x415a('0x29')](respondWithResult(_0x344227,null))[_0x415a('0x47')](handleError(_0x344227,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index d4fbc1d..e384f2d 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 _0x692f=['FreshsalesConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','define'];(function(_0x2cad92,_0x2deede){var _0xe22447=function(_0x32efb9){while(--_0x32efb9){_0x2cad92['push'](_0x2cad92['shift']());}};_0xe22447(++_0x2deede);}(_0x692f,0x1b1));var _0xf692=function(_0x13992d,_0x3029ea){_0x13992d=_0x13992d-0x0;var _0x3d15bf=_0x692f[_0x13992d];return _0x3d15bf;};'use strict';var _=require(_0xf692('0x0'));var util=require(_0xf692('0x1'));var logger=require(_0xf692('0x2'))(_0xf692('0x3'));var moment=require(_0xf692('0x4'));var BPromise=require(_0xf692('0x5'));var rp=require(_0xf692('0x6'));var fs=require('fs');var path=require(_0xf692('0x7'));var rimraf=require('rimraf');var config=require(_0xf692('0x8'));var attributes=require(_0xf692('0x9'));module['exports']=function(_0x5e2517,_0x9aff4f){return _0x5e2517[_0xf692('0xa')](_0xf692('0xb'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa021=['FreshsalesConfiguration','int_freshsales_configurations','util','api','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports'];(function(_0x479160,_0x3ab560){var _0x47ac6d=function(_0x3f7314){while(--_0x3f7314){_0x479160['push'](_0x479160['shift']());}};_0x47ac6d(++_0x3ab560);}(_0xa021,0x1ce));var _0x1a02=function(_0x1a127a,_0x42f6e6){_0x1a127a=_0x1a127a-0x0;var _0x2a724b=_0xa021[_0x1a127a];return _0x2a724b;};'use strict';var _=require('lodash');var util=require(_0x1a02('0x0'));var logger=require('../../config/logger')(_0x1a02('0x1'));var moment=require('moment');var BPromise=require(_0x1a02('0x2'));var rp=require(_0x1a02('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1a02('0x4'));var config=require(_0x1a02('0x5'));var attributes=require(_0x1a02('0x6'));module[_0x1a02('0x7')]=function(_0x2edcf7,_0x745704){return _0x2edcf7['define'](_0x1a02('0x8'),attributes,{'tableName':_0x1a02('0x9'),'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 383d714..a456c44 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 _0xe2d6=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x787a3c,_0x10bda0){var _0x5c149e=function(_0x2a1284){while(--_0x2a1284){_0x787a3c['push'](_0x787a3c['shift']());}};_0x5c149e(++_0x10bda0);}(_0xe2d6,0x17b));var _0x6e2d=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0xe2d6[_0x65c50e];return _0x4573e7;};'use strict';var _=require(_0x6e2d('0x0'));var util=require(_0x6e2d('0x1'));var moment=require(_0x6e2d('0x2'));var BPromise=require(_0x6e2d('0x3'));var rs=require(_0x6e2d('0x4'));var fs=require('fs');var Redis=require(_0x6e2d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e2d('0x6'));var logger=require(_0x6e2d('0x7'))(_0x6e2d('0x8'));var config=require(_0x6e2d('0x9'));var jayson=require(_0x6e2d('0xa'));var client=jayson[_0x6e2d('0xb')][_0x6e2d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41ea00,_0x2fd964,_0x57c31e){return new BPromise(function(_0x20c1b3,_0x40bdf7){return client['request'](_0x41ea00,_0x57c31e)[_0x6e2d('0xd')](function(_0x14b5f1){logger[_0x6e2d('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2fd964,_0x6e2d('0xf'));logger[_0x6e2d('0x10')](_0x6e2d('0x11'),_0x2fd964,_0x6e2d('0xf'),JSON[_0x6e2d('0x12')](_0x14b5f1));if(_0x14b5f1['error']){if(_0x14b5f1['error'][_0x6e2d('0x13')]===0x1f4){logger['error'](_0x6e2d('0x14'),_0x2fd964,_0x14b5f1[_0x6e2d('0x15')]['message']);return _0x40bdf7(_0x14b5f1['error'][_0x6e2d('0x16')]);}logger[_0x6e2d('0x15')](_0x6e2d('0x14'),_0x2fd964,_0x14b5f1[_0x6e2d('0x15')][_0x6e2d('0x16')]);return _0x20c1b3(_0x14b5f1[_0x6e2d('0x15')][_0x6e2d('0x16')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x2fd964,_0x6e2d('0xf'));_0x20c1b3(_0x14b5f1[_0x6e2d('0x17')][_0x6e2d('0x16')]);}})[_0x6e2d('0x18')](function(_0x109d5a){logger[_0x6e2d('0x15')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2fd964,_0x109d5a);_0x40bdf7(_0x109d5a);});});} \ No newline at end of file +var _0xfeea=['jayson/promise','client','http','request','then','info','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','FreshsalesConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x2ddf2d,_0x272b8a){var _0x53dd02=function(_0x5a889c){while(--_0x5a889c){_0x2ddf2d['push'](_0x2ddf2d['shift']());}};_0x53dd02(++_0x272b8a);}(_0xfeea,0xe8));var _0xafee=function(_0x3cf053,_0x7a9947){_0x3cf053=_0x3cf053-0x0;var _0x3b55a0=_0xfeea[_0x3cf053];return _0x3b55a0;};'use strict';var _=require(_0xafee('0x0'));var util=require(_0xafee('0x1'));var moment=require(_0xafee('0x2'));var BPromise=require(_0xafee('0x3'));var rs=require(_0xafee('0x4'));var fs=require('fs');var Redis=require(_0xafee('0x5'));var db=require(_0xafee('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xafee('0x7'))(_0xafee('0x8'));var config=require(_0xafee('0x9'));var jayson=require(_0xafee('0xa'));var client=jayson[_0xafee('0xb')][_0xafee('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc8fa13,_0xfeff3d,_0x4dfb02){return new BPromise(function(_0x7ec848,_0x311fb9){return client[_0xafee('0xd')](_0xc8fa13,_0x4dfb02)[_0xafee('0xe')](function(_0x2f68fe){logger[_0xafee('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xfeff3d,_0xafee('0x10'));logger['debug'](_0xafee('0x11'),_0xfeff3d,'request\x20sent',JSON['stringify'](_0x2f68fe));if(_0x2f68fe[_0xafee('0x12')]){if(_0x2f68fe['error']['code']===0x1f4){logger[_0xafee('0x12')](_0xafee('0x13'),_0xfeff3d,_0x2f68fe[_0xafee('0x12')]['message']);return _0x311fb9(_0x2f68fe[_0xafee('0x12')][_0xafee('0x14')]);}logger[_0xafee('0x12')](_0xafee('0x13'),_0xfeff3d,_0x2f68fe['error'][_0xafee('0x14')]);return _0x7ec848(_0x2f68fe[_0xafee('0x12')][_0xafee('0x14')]);}else{logger['info'](_0xafee('0x13'),_0xfeff3d,'request\x20sent');_0x7ec848(_0x2f68fe['result'][_0xafee('0x14')]);}})[_0xafee('0x15')](function(_0x3df2f0){logger[_0xafee('0x12')](_0xafee('0x13'),_0xfeff3d,_0x3df2f0);_0x311fb9(_0x3df2f0);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index cb474d7..d502290 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 _0x5c12=['./intFreshsalesField.controller','isAuthenticated','index','get','show','post','create','put','update','delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1e922a,_0x2980dc){var _0x190f3e=function(_0x473d4f){while(--_0x473d4f){_0x1e922a['push'](_0x1e922a['shift']());}};_0x190f3e(++_0x2980dc);}(_0x5c12,0x188));var _0x25c1=function(_0x216799,_0x44b817){_0x216799=_0x216799-0x0;var _0x3661c3=_0x5c12[_0x216799];return _0x3661c3;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var fs_extra=require(_0x25c1('0x4'));var auth=require(_0x25c1('0x5'));var interaction=require(_0x25c1('0x6'));var config=require(_0x25c1('0x7'));var controller=require(_0x25c1('0x8'));router['get']('/',auth[_0x25c1('0x9')](),controller[_0x25c1('0xa')]);router[_0x25c1('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x25c1('0xc')]);router[_0x25c1('0xd')]('/',auth[_0x25c1('0x9')](),controller[_0x25c1('0xe')]);router[_0x25c1('0xf')]('/:id',auth[_0x25c1('0x9')](),controller[_0x25c1('0x10')]);router[_0x25c1('0x11')](_0x25c1('0x12'),auth[_0x25c1('0x9')](),controller['destroy']);module[_0x25c1('0x13')]=router; \ No newline at end of file +var _0x765e=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x49a37c,_0x1452d2){var _0x57508b=function(_0x278ca2){while(--_0x278ca2){_0x49a37c['push'](_0x49a37c['shift']());}};_0x57508b(++_0x1452d2);}(_0x765e,0x131));var _0xe765=function(_0x340f2a,_0x3f9368){_0x340f2a=_0x340f2a-0x0;var _0x42b746=_0x765e[_0x340f2a];return _0x42b746;};'use strict';var multer=require(_0xe765('0x0'));var util=require(_0xe765('0x1'));var path=require(_0xe765('0x2'));var timeout=require(_0xe765('0x3'));var express=require(_0xe765('0x4'));var router=express[_0xe765('0x5')]();var fs_extra=require(_0xe765('0x6'));var auth=require(_0xe765('0x7'));var interaction=require(_0xe765('0x8'));var config=require(_0xe765('0x9'));var controller=require(_0xe765('0xa'));router[_0xe765('0xb')]('/',auth[_0xe765('0xc')](),controller[_0xe765('0xd')]);router[_0xe765('0xb')]('/:id',auth[_0xe765('0xc')](),controller[_0xe765('0xe')]);router[_0xe765('0xf')]('/',auth[_0xe765('0xc')](),controller[_0xe765('0x10')]);router[_0xe765('0x11')](_0xe765('0x12'),auth['isAuthenticated'](),controller[_0xe765('0x13')]);router[_0xe765('0x14')](_0xe765('0x12'),auth['isAuthenticated'](),controller[_0xe765('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 4610e12..e51ca2d 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 _0xf4f1=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','string','STRING'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0xf4f1,0x171));var _0x1f4f=function(_0x18d6ff,_0x174b26){_0x18d6ff=_0x18d6ff-0x0;var _0x2999d4=_0xf4f1[_0x18d6ff];return _0x2999d4;};'use strict';var Sequelize=require(_0x1f4f('0x0'));module[_0x1f4f('0x1')]={'type':{'type':Sequelize[_0x1f4f('0x2')]('string',_0x1f4f('0x3'),_0x1f4f('0x4'),'keyValue','picklist'),'defaultValue':_0x1f4f('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1f4f('0x2')](_0x1f4f('0x5'),_0x1f4f('0x3'),_0x1f4f('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1f4f('0x6')]},'nameField':{'type':Sequelize[_0x1f4f('0x6')]},'customField':{'type':Sequelize[_0x1f4f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1f4f('0x6')]}}; \ No newline at end of file +var _0x5b08=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x5e2603,_0x3a55af){var _0x2664d9=function(_0x42938f){while(--_0x42938f){_0x5e2603['push'](_0x5e2603['shift']());}};_0x2664d9(++_0x3a55af);}(_0x5b08,0x110));var _0x85b0=function(_0x2fbb45,_0x1b2c7f){_0x2fbb45=_0x2fbb45-0x0;var _0x526325=_0x5b08[_0x2fbb45];return _0x526325;};'use strict';var Sequelize=require(_0x85b0('0x0'));module[_0x85b0('0x1')]={'type':{'type':Sequelize[_0x85b0('0x2')](_0x85b0('0x3'),_0x85b0('0x4'),_0x85b0('0x5'),_0x85b0('0x6'),_0x85b0('0x7')),'defaultValue':_0x85b0('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x85b0('0x2')](_0x85b0('0x3'),_0x85b0('0x4'),_0x85b0('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x85b0('0x8')]},'customField':{'type':Sequelize[_0x85b0('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x85b0('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index c06c77f..d5af126 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 _0xecf6=['fs-extra','lodash','desk.js','to-csv','papaparse','../../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','then','error','stack','index','FreshsalesField','type','key','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','map','VIRTUAL','merge','options','includeAll','include','rows','show','params','catch','create','body','find','rimraf','fast-json-patch','bluebird','path','sox','ejs'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xecf6,0x144));var _0x6ecf=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xecf6[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6ecf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6ecf('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6ecf('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6ecf('0x3'));var sox=require(_0x6ecf('0x4'));var csv=require('to-csv');var ejs=require(_0x6ecf('0x5'));var fs=require('fs');var fs_extra=require(_0x6ecf('0x6'));var _=require(_0x6ecf('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6ecf('0x8'));var toCsv=require(_0x6ecf('0x9'));var querystring=require('querystring');var Papa=require(_0x6ecf('0xa'));var Redis=require('ioredis');var authService=require(_0x6ecf('0xb'));var qs=require(_0x6ecf('0xc'));var as=require(_0x6ecf('0xd'));var hardwareService=require(_0x6ecf('0xe'));var logger=require(_0x6ecf('0xf'))(_0x6ecf('0x10'));var utils=require(_0x6ecf('0x11'));var config=require(_0x6ecf('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ecf('0x13'))['db'];function respondWithStatusCode(_0x34f53b,_0x603558){_0x603558=_0x603558||0xcc;return function(_0x43c388){if(_0x43c388){return _0x34f53b[_0x6ecf('0x14')](_0x603558);}return _0x34f53b[_0x6ecf('0x15')](_0x603558)[_0x6ecf('0x16')]();};}function respondWithResult(_0x4c28e7,_0x4f8410){_0x4f8410=_0x4f8410||0xc8;return function(_0xeaabe4){if(_0xeaabe4){return _0x4c28e7[_0x6ecf('0x15')](_0x4f8410)[_0x6ecf('0x17')](_0xeaabe4);}};}function respondWithFilteredResult(_0x4771cc,_0x2954a6){return function(_0x2a6784){if(_0x2a6784){var _0x1cb897=typeof _0x2954a6[_0x6ecf('0x18')]==='undefined'&&typeof _0x2954a6[_0x6ecf('0x19')]==='undefined';var _0x306128=_0x2a6784[_0x6ecf('0x1a')];var _0x207922=_0x1cb897?0x0:_0x2954a6['offset'];var _0x332c93=_0x1cb897?_0x2a6784[_0x6ecf('0x1a')]:_0x2954a6['offset']+_0x2954a6[_0x6ecf('0x19')];var _0x1b29e1;if(_0x332c93>=_0x306128){_0x332c93=_0x306128;_0x1b29e1=0xc8;}else{_0x1b29e1=0xce;}_0x4771cc[_0x6ecf('0x15')](_0x1b29e1);return _0x4771cc['set'](_0x6ecf('0x1b'),_0x207922+'-'+_0x332c93+'/'+_0x306128)['json'](_0x2a6784);}return null;};}function patchUpdates(_0x901bc){return function(_0x494c2f){try{jsonpatch[_0x6ecf('0x1c')](_0x494c2f,_0x901bc,!![]);}catch(_0x459a43){return BPromise['reject'](_0x459a43);}return _0x494c2f[_0x6ecf('0x1d')]();};}function saveUpdates(_0xccc0d8,_0x5841ff){return function(_0x3c9f3e){if(_0x3c9f3e){return _0x3c9f3e['update'](_0xccc0d8)[_0x6ecf('0x1e')](function(_0x54a31c){return _0x54a31c;});}return null;};}function removeEntity(_0x1e3cff,_0x424028){return function(_0x4f119e){if(_0x4f119e){return _0x4f119e['destroy']()[_0x6ecf('0x1e')](function(){_0x1e3cff[_0x6ecf('0x15')](0xcc)[_0x6ecf('0x16')]();});}};}function handleEntityNotFound(_0x160de0,_0x1d5f15){return function(_0x576a09){if(!_0x576a09){_0x160de0[_0x6ecf('0x14')](0x194);}return _0x576a09;};}function handleError(_0x3727c4,_0x5c8e57){_0x5c8e57=_0x5c8e57||0x1f4;return function(_0x2ee6ce){logger[_0x6ecf('0x1f')](_0x2ee6ce[_0x6ecf('0x20')]);if(_0x2ee6ce['name']){delete _0x2ee6ce['name'];}_0x3727c4[_0x6ecf('0x15')](_0x5c8e57)['send'](_0x2ee6ce);};}exports[_0x6ecf('0x21')]=function(_0x21c0ca,_0x57191c){var _0x555f35={},_0x15c9af={},_0x464c2c={'count':0x0,'rows':[]};var _0x28ef2a=_['map'](db[_0x6ecf('0x22')]['rawAttributes'],function(_0x508731){return{'name':_0x508731['fieldName'],'type':_0x508731[_0x6ecf('0x23')][_0x6ecf('0x24')]};});_0x15c9af[_0x6ecf('0x25')]=_['map'](_0x28ef2a,_0x6ecf('0x26'));_0x15c9af[_0x6ecf('0x27')]=_[_0x6ecf('0x28')](_0x21c0ca['query']);_0x15c9af['filters']=_['intersection'](_0x15c9af[_0x6ecf('0x25')],_0x15c9af[_0x6ecf('0x27')]);_0x555f35[_0x6ecf('0x29')]=_[_0x6ecf('0x2a')](_0x15c9af[_0x6ecf('0x25')],qs[_0x6ecf('0x2b')](_0x21c0ca[_0x6ecf('0x27')][_0x6ecf('0x2b')]));_0x555f35[_0x6ecf('0x29')]=_0x555f35['attributes'][_0x6ecf('0x2c')]?_0x555f35[_0x6ecf('0x29')]:_0x15c9af[_0x6ecf('0x25')];if(!_0x21c0ca[_0x6ecf('0x27')][_0x6ecf('0x2d')](_0x6ecf('0x2e'))){_0x555f35[_0x6ecf('0x19')]=qs[_0x6ecf('0x19')](_0x21c0ca[_0x6ecf('0x27')][_0x6ecf('0x19')]);_0x555f35[_0x6ecf('0x18')]=qs[_0x6ecf('0x18')](_0x21c0ca[_0x6ecf('0x27')][_0x6ecf('0x18')]);}_0x555f35[_0x6ecf('0x2f')]=qs[_0x6ecf('0x30')](_0x21c0ca['query'][_0x6ecf('0x30')]);_0x555f35[_0x6ecf('0x31')]=qs['filters'](_[_0x6ecf('0x32')](_0x21c0ca[_0x6ecf('0x27')],_0x15c9af[_0x6ecf('0x33')]),_0x28ef2a);if(_0x21c0ca[_0x6ecf('0x27')][_0x6ecf('0x34')]){_0x555f35[_0x6ecf('0x31')]=_['merge'](_0x555f35['where'],{'$or':_[_0x6ecf('0x35')](_0x28ef2a,function(_0x38dba8){if(_0x38dba8[_0x6ecf('0x23')]!==_0x6ecf('0x36')){var _0x343240={};_0x343240[_0x38dba8[_0x6ecf('0x26')]]={'$like':'%'+_0x21c0ca[_0x6ecf('0x27')][_0x6ecf('0x34')]+'%'};return _0x343240;}})});}_0x555f35=_[_0x6ecf('0x37')]({},_0x555f35,_0x21c0ca[_0x6ecf('0x38')]);var _0x220ba4={'where':_0x555f35[_0x6ecf('0x31')]};return db[_0x6ecf('0x22')]['count'](_0x220ba4)[_0x6ecf('0x1e')](function(_0xb1cb6){_0x464c2c[_0x6ecf('0x1a')]=_0xb1cb6;if(_0x21c0ca[_0x6ecf('0x27')][_0x6ecf('0x39')]){_0x555f35[_0x6ecf('0x3a')]=[{'all':!![]}];}return db[_0x6ecf('0x22')]['findAll'](_0x555f35);})['then'](function(_0x1aa94a){_0x464c2c[_0x6ecf('0x3b')]=_0x1aa94a;return _0x464c2c;})[_0x6ecf('0x1e')](respondWithFilteredResult(_0x57191c,_0x555f35))['catch'](handleError(_0x57191c,null));};exports[_0x6ecf('0x3c')]=function(_0x2d5a3e,_0x129019){var _0x3b5ae5={'raw':!![],'where':{'id':_0x2d5a3e[_0x6ecf('0x3d')]['id']}},_0x17d108={};_0x17d108[_0x6ecf('0x25')]=_[_0x6ecf('0x28')](db[_0x6ecf('0x22')]['rawAttributes']);_0x17d108[_0x6ecf('0x27')]=_[_0x6ecf('0x28')](_0x2d5a3e[_0x6ecf('0x27')]);_0x17d108[_0x6ecf('0x33')]=_[_0x6ecf('0x2a')](_0x17d108['model'],_0x17d108['query']);_0x3b5ae5[_0x6ecf('0x29')]=_[_0x6ecf('0x2a')](_0x17d108[_0x6ecf('0x25')],qs['fields'](_0x2d5a3e[_0x6ecf('0x27')][_0x6ecf('0x2b')]));_0x3b5ae5[_0x6ecf('0x29')]=_0x3b5ae5[_0x6ecf('0x29')][_0x6ecf('0x2c')]?_0x3b5ae5['attributes']:_0x17d108[_0x6ecf('0x25')];if(_0x2d5a3e[_0x6ecf('0x27')][_0x6ecf('0x39')]){_0x3b5ae5[_0x6ecf('0x3a')]=[{'all':!![]}];}_0x3b5ae5=_[_0x6ecf('0x37')]({},_0x3b5ae5,_0x2d5a3e[_0x6ecf('0x38')]);return db[_0x6ecf('0x22')]['find'](_0x3b5ae5)['then'](handleEntityNotFound(_0x129019,null))['then'](respondWithResult(_0x129019,null))[_0x6ecf('0x3e')](handleError(_0x129019,null));};exports[_0x6ecf('0x3f')]=function(_0x36e134,_0x23fdc8){return db[_0x6ecf('0x22')][_0x6ecf('0x3f')](_0x36e134[_0x6ecf('0x40')],{})[_0x6ecf('0x1e')](respondWithResult(_0x23fdc8,0xc9))[_0x6ecf('0x3e')](handleError(_0x23fdc8,null));};exports['update']=function(_0x111ba3,_0x136634){if(_0x111ba3[_0x6ecf('0x40')]['id']){delete _0x111ba3['body']['id'];}return db[_0x6ecf('0x22')]['find']({'where':{'id':_0x111ba3[_0x6ecf('0x3d')]['id']}})['then'](handleEntityNotFound(_0x136634,null))[_0x6ecf('0x1e')](saveUpdates(_0x111ba3[_0x6ecf('0x40')],null))['then'](respondWithResult(_0x136634,null))[_0x6ecf('0x3e')](handleError(_0x136634,null));};exports['destroy']=function(_0x28679d,_0x4c7719){return db[_0x6ecf('0x22')][_0x6ecf('0x41')]({'where':{'id':_0x28679d[_0x6ecf('0x3d')]['id']}})[_0x6ecf('0x1e')](handleEntityNotFound(_0x4c7719,null))['then'](removeEntity(_0x4c7719,null))[_0x6ecf('0x3e')](handleError(_0x4c7719,null));}; \ No newline at end of file +var _0x6737=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','FreshsalesField','fieldName','type','key','keys','filters','model','attributes','intersection','fields','query','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','options','create','body','find','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4463ba,_0x3436c1){var _0x47406c=function(_0x5b5ab8){while(--_0x5b5ab8){_0x4463ba['push'](_0x4463ba['shift']());}};_0x47406c(++_0x3436c1);}(_0x6737,0x1a8));var _0x7673=function(_0x7a9984,_0x94e9f5){_0x7a9984=_0x7a9984-0x0;var _0xb74756=_0x6737[_0x7a9984];return _0xb74756;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7673('0x0'));var jsonpatch=require(_0x7673('0x1'));var rp=require(_0x7673('0x2'));var moment=require(_0x7673('0x3'));var BPromise=require(_0x7673('0x4'));var Mustache=require(_0x7673('0x5'));var util=require('util');var path=require(_0x7673('0x6'));var sox=require(_0x7673('0x7'));var csv=require(_0x7673('0x8'));var ejs=require(_0x7673('0x9'));var fs=require('fs');var fs_extra=require(_0x7673('0xa'));var _=require('lodash');var squel=require(_0x7673('0xb'));var crypto=require(_0x7673('0xc'));var jsforce=require(_0x7673('0xd'));var deskjs=require(_0x7673('0xe'));var toCsv=require(_0x7673('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7673('0xf'));var authService=require(_0x7673('0x10'));var qs=require(_0x7673('0x11'));var as=require(_0x7673('0x12'));var hardwareService=require(_0x7673('0x13'));var logger=require(_0x7673('0x14'))('api');var utils=require(_0x7673('0x15'));var config=require(_0x7673('0x16'));var licenseUtil=require(_0x7673('0x17'));var db=require(_0x7673('0x18'))['db'];function respondWithStatusCode(_0x5df313,_0x36136c){_0x36136c=_0x36136c||0xcc;return function(_0x4d7471){if(_0x4d7471){return _0x5df313[_0x7673('0x19')](_0x36136c);}return _0x5df313['status'](_0x36136c)['end']();};}function respondWithResult(_0xbec264,_0x5d4dbe){_0x5d4dbe=_0x5d4dbe||0xc8;return function(_0xe67668){if(_0xe67668){return _0xbec264['status'](_0x5d4dbe)[_0x7673('0x1a')](_0xe67668);}};}function respondWithFilteredResult(_0x42299b,_0x4fd9c9){return function(_0x763bef){if(_0x763bef){var _0x3da83e=typeof _0x4fd9c9[_0x7673('0x1b')]==='undefined'&&typeof _0x4fd9c9[_0x7673('0x1c')]===_0x7673('0x1d');var _0x441cd4=_0x763bef[_0x7673('0x1e')];var _0x4d657d=_0x3da83e?0x0:_0x4fd9c9[_0x7673('0x1b')];var _0x39c8f4=_0x3da83e?_0x763bef[_0x7673('0x1e')]:_0x4fd9c9[_0x7673('0x1b')]+_0x4fd9c9['limit'];var _0x5d2d2c;if(_0x39c8f4>=_0x441cd4){_0x39c8f4=_0x441cd4;_0x5d2d2c=0xc8;}else{_0x5d2d2c=0xce;}_0x42299b[_0x7673('0x1f')](_0x5d2d2c);return _0x42299b[_0x7673('0x20')](_0x7673('0x21'),_0x4d657d+'-'+_0x39c8f4+'/'+_0x441cd4)[_0x7673('0x1a')](_0x763bef);}return null;};}function patchUpdates(_0x2d7e86){return function(_0x450c54){try{jsonpatch[_0x7673('0x22')](_0x450c54,_0x2d7e86,!![]);}catch(_0x455d80){return BPromise[_0x7673('0x23')](_0x455d80);}return _0x450c54[_0x7673('0x24')]();};}function saveUpdates(_0x18e8aa,_0x3aedfa){return function(_0x13ef14){if(_0x13ef14){return _0x13ef14[_0x7673('0x25')](_0x18e8aa)[_0x7673('0x26')](function(_0x494050){return _0x494050;});}return null;};}function removeEntity(_0x212844,_0xb8add){return function(_0x2be90a){if(_0x2be90a){return _0x2be90a[_0x7673('0x27')]()[_0x7673('0x26')](function(){_0x212844['status'](0xcc)[_0x7673('0x28')]();});}};}function handleEntityNotFound(_0x1279f0,_0x48073c){return function(_0x5d3933){if(!_0x5d3933){_0x1279f0['sendStatus'](0x194);}return _0x5d3933;};}function handleError(_0x66cab9,_0x530a8c){_0x530a8c=_0x530a8c||0x1f4;return function(_0x1bcdeb){logger[_0x7673('0x29')](_0x1bcdeb['stack']);if(_0x1bcdeb[_0x7673('0x2a')]){delete _0x1bcdeb[_0x7673('0x2a')];}_0x66cab9[_0x7673('0x1f')](_0x530a8c)['send'](_0x1bcdeb);};}exports[_0x7673('0x2b')]=function(_0x3f074c,_0x19053b){var _0x212d0c={},_0x5332d0={},_0x4a21ae={'count':0x0,'rows':[]};var _0x10afbd=_['map'](db[_0x7673('0x2c')]['rawAttributes'],function(_0x3d8142){return{'name':_0x3d8142[_0x7673('0x2d')],'type':_0x3d8142[_0x7673('0x2e')][_0x7673('0x2f')]};});_0x5332d0['model']=_['map'](_0x10afbd,'name');_0x5332d0['query']=_[_0x7673('0x30')](_0x3f074c['query']);_0x5332d0[_0x7673('0x31')]=_['intersection'](_0x5332d0[_0x7673('0x32')],_0x5332d0['query']);_0x212d0c[_0x7673('0x33')]=_[_0x7673('0x34')](_0x5332d0[_0x7673('0x32')],qs[_0x7673('0x35')](_0x3f074c[_0x7673('0x36')][_0x7673('0x35')]));_0x212d0c[_0x7673('0x33')]=_0x212d0c[_0x7673('0x33')][_0x7673('0x37')]?_0x212d0c[_0x7673('0x33')]:_0x5332d0[_0x7673('0x32')];if(!_0x3f074c['query'][_0x7673('0x38')]('nolimit')){_0x212d0c[_0x7673('0x1c')]=qs[_0x7673('0x1c')](_0x3f074c['query'][_0x7673('0x1c')]);_0x212d0c[_0x7673('0x1b')]=qs[_0x7673('0x1b')](_0x3f074c['query'][_0x7673('0x1b')]);}_0x212d0c[_0x7673('0x39')]=qs[_0x7673('0x3a')](_0x3f074c[_0x7673('0x36')]['sort']);_0x212d0c[_0x7673('0x3b')]=qs[_0x7673('0x31')](_[_0x7673('0x3c')](_0x3f074c['query'],_0x5332d0[_0x7673('0x31')]),_0x10afbd);if(_0x3f074c[_0x7673('0x36')][_0x7673('0x3d')]){_0x212d0c[_0x7673('0x3b')]=_[_0x7673('0x3e')](_0x212d0c[_0x7673('0x3b')],{'$or':_['map'](_0x10afbd,function(_0x4fcd7f){if(_0x4fcd7f[_0x7673('0x2e')]!==_0x7673('0x3f')){var _0x5255eb={};_0x5255eb[_0x4fcd7f[_0x7673('0x2a')]]={'$like':'%'+_0x3f074c['query'][_0x7673('0x3d')]+'%'};return _0x5255eb;}})});}_0x212d0c=_[_0x7673('0x3e')]({},_0x212d0c,_0x3f074c['options']);var _0x1e95b9={'where':_0x212d0c[_0x7673('0x3b')]};return db[_0x7673('0x2c')][_0x7673('0x1e')](_0x1e95b9)[_0x7673('0x26')](function(_0x34ff34){_0x4a21ae['count']=_0x34ff34;if(_0x3f074c[_0x7673('0x36')]['includeAll']){_0x212d0c[_0x7673('0x40')]=[{'all':!![]}];}return db[_0x7673('0x2c')][_0x7673('0x41')](_0x212d0c);})[_0x7673('0x26')](function(_0x275e40){_0x4a21ae[_0x7673('0x42')]=_0x275e40;return _0x4a21ae;})[_0x7673('0x26')](respondWithFilteredResult(_0x19053b,_0x212d0c))[_0x7673('0x43')](handleError(_0x19053b,null));};exports[_0x7673('0x44')]=function(_0x6055fa,_0x3997b4){var _0x318a06={'raw':!![],'where':{'id':_0x6055fa['params']['id']}},_0x59f93c={};_0x59f93c[_0x7673('0x32')]=_[_0x7673('0x30')](db[_0x7673('0x2c')]['rawAttributes']);_0x59f93c['query']=_['keys'](_0x6055fa['query']);_0x59f93c['filters']=_[_0x7673('0x34')](_0x59f93c['model'],_0x59f93c[_0x7673('0x36')]);_0x318a06[_0x7673('0x33')]=_['intersection'](_0x59f93c[_0x7673('0x32')],qs['fields'](_0x6055fa[_0x7673('0x36')][_0x7673('0x35')]));_0x318a06[_0x7673('0x33')]=_0x318a06[_0x7673('0x33')][_0x7673('0x37')]?_0x318a06['attributes']:_0x59f93c[_0x7673('0x32')];if(_0x6055fa['query']['includeAll']){_0x318a06['include']=[{'all':!![]}];}_0x318a06=_[_0x7673('0x3e')]({},_0x318a06,_0x6055fa[_0x7673('0x45')]);return db[_0x7673('0x2c')]['find'](_0x318a06)[_0x7673('0x26')](handleEntityNotFound(_0x3997b4,null))[_0x7673('0x26')](respondWithResult(_0x3997b4,null))['catch'](handleError(_0x3997b4,null));};exports['create']=function(_0x296056,_0x49c0b8){return db[_0x7673('0x2c')][_0x7673('0x46')](_0x296056['body'],{})[_0x7673('0x26')](respondWithResult(_0x49c0b8,0xc9))['catch'](handleError(_0x49c0b8,null));};exports['update']=function(_0x14fe4b,_0x388e9a){if(_0x14fe4b[_0x7673('0x47')]['id']){delete _0x14fe4b[_0x7673('0x47')]['id'];}return db[_0x7673('0x2c')][_0x7673('0x48')]({'where':{'id':_0x14fe4b[_0x7673('0x49')]['id']}})[_0x7673('0x26')](handleEntityNotFound(_0x388e9a,null))['then'](saveUpdates(_0x14fe4b[_0x7673('0x47')],null))[_0x7673('0x26')](respondWithResult(_0x388e9a,null))[_0x7673('0x43')](handleError(_0x388e9a,null));};exports['destroy']=function(_0x2fb224,_0x15b68c){return db[_0x7673('0x2c')][_0x7673('0x48')]({'where':{'id':_0x2fb224['params']['id']}})[_0x7673('0x26')](handleEntityNotFound(_0x15b68c,null))[_0x7673('0x26')](removeEntity(_0x15b68c,null))[_0x7673('0x43')](handleError(_0x15b68c,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 23597eb..66d94d4 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 _0xdc9b=['rimraf','../../config/environment','exports','define','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3e74d0,_0x1852a4){var _0x3385eb=function(_0x3aba74){while(--_0x3aba74){_0x3e74d0['push'](_0x3e74d0['shift']());}};_0x3385eb(++_0x1852a4);}(_0xdc9b,0x70));var _0xbdc9=function(_0x412054,_0x4e9252){_0x412054=_0x412054-0x0;var _0x1b77d7=_0xdc9b[_0x412054];return _0x1b77d7;};'use strict';var _=require(_0xbdc9('0x0'));var util=require(_0xbdc9('0x1'));var logger=require(_0xbdc9('0x2'))('api');var moment=require(_0xbdc9('0x3'));var BPromise=require(_0xbdc9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbdc9('0x5'));var config=require(_0xbdc9('0x6'));var attributes=require('./intFreshsalesField.attributes');module[_0xbdc9('0x7')]=function(_0x3065a8,_0x5bf8bc){return _0x3065a8[_0xbdc9('0x8')]('FreshsalesField',attributes,{'tableName':_0xbdc9('0x9'),'paranoid':![],'indexes':[{'name':_0xbdc9('0xa'),'fields':[_0xbdc9('0xb'),_0xbdc9('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x60a5=['FieldId','lodash','api','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','freshsales_unique_index','idField'];(function(_0xc40618,_0x1d3ceb){var _0x4d1cc4=function(_0x11b18e){while(--_0x11b18e){_0xc40618['push'](_0xc40618['shift']());}};_0x4d1cc4(++_0x1d3ceb);}(_0x60a5,0x83));var _0x560a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x60a5[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x560a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x560a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x560a('0x2'));var fs=require('fs');var path=require(_0x560a('0x3'));var rimraf=require(_0x560a('0x4'));var config=require('../../config/environment');var attributes=require(_0x560a('0x5'));module[_0x560a('0x6')]=function(_0x3856ae,_0x5aaec6){return _0x3856ae['define']('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x560a('0x7'),'fields':[_0x560a('0x8'),_0x560a('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 645f911..af5d198 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 _0x71ab=['http','request','then','info','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshsalesField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1b0940,_0x140685){var _0x1dfe0f=function(_0x1b24a0){while(--_0x1b24a0){_0x1b0940['push'](_0x1b0940['shift']());}};_0x1dfe0f(++_0x140685);}(_0x71ab,0x64));var _0xb71a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x71ab[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var moment=require('moment');var BPromise=require(_0xb71a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb71a('0x2'));var db=require(_0xb71a('0x3'))['db'];var utils=require(_0xb71a('0x4'));var logger=require(_0xb71a('0x5'))(_0xb71a('0x6'));var config=require(_0xb71a('0x7'));var jayson=require(_0xb71a('0x8'));var client=jayson[_0xb71a('0x9')][_0xb71a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a84e,_0x4358ce,_0x2a4c86){return new BPromise(function(_0x43ca14,_0x471ab6){return client[_0xb71a('0xb')](_0x35a84e,_0x2a4c86)[_0xb71a('0xc')](function(_0x378c96){logger[_0xb71a('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0xb71a('0xe'));logger['debug'](_0xb71a('0xf'),_0x4358ce,_0xb71a('0xe'),JSON[_0xb71a('0x10')](_0x378c96));if(_0x378c96['error']){if(_0x378c96[_0xb71a('0x11')]['code']===0x1f4){logger[_0xb71a('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0x378c96['error'][_0xb71a('0x12')]);return _0x471ab6(_0x378c96[_0xb71a('0x11')][_0xb71a('0x12')]);}logger[_0xb71a('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0x378c96['error']['message']);return _0x43ca14(_0x378c96[_0xb71a('0x11')][_0xb71a('0x12')]);}else{logger[_0xb71a('0xd')](_0xb71a('0x13'),_0x4358ce,_0xb71a('0xe'));_0x43ca14(_0x378c96[_0xb71a('0x14')][_0xb71a('0x12')]);}})[_0xb71a('0x15')](function(_0x7710a8){logger['error'](_0xb71a('0x13'),_0x4358ce,_0x7710a8);_0x471ab6(_0x7710a8);});});} \ No newline at end of file +var _0x1623=['../../config/utils','../../config/environment','client','http','request','then','info','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2efdc2,_0x47fdf6){var _0x42b469=function(_0x299c9b){while(--_0x299c9b){_0x2efdc2['push'](_0x2efdc2['shift']());}};_0x42b469(++_0x47fdf6);}(_0x1623,0xab));var _0x3162=function(_0x258071,_0x351c10){_0x258071=_0x258071-0x0;var _0x192931=_0x1623[_0x258071];return _0x192931;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index ded96ce..233d9ec 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x2e6cd6,_0x1ba951){var _0x564a1c=function(_0x564ce0){while(--_0x564ce0){_0x2e6cd6['push'](_0x2e6cd6['shift']());}};_0x564a1c(++_0x1ba951);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x175f0d,_0x1dbcbd){var _0x3a80bb=function(_0x3a1b63){while(--_0x3a1b63){_0x175f0d['push'](_0x175f0d['shift']());}};_0x3a80bb(++_0x1dbcbd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index ebde190..ccd1fe4 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 _0x75ff=['sequelize','exports','STRING','ENUM','integrationTab'];(function(_0x585ac4,_0x6362ca){var _0xdf42ab=function(_0x597820){while(--_0x597820){_0x585ac4['push'](_0x585ac4['shift']());}};_0xdf42ab(++_0x6362ca);}(_0x75ff,0x131));var _0xf75f=function(_0x2d9e90,_0x5dcc72){_0x2d9e90=_0x2d9e90-0x0;var _0x54695f=_0x75ff[_0x2d9e90];return _0x54695f;};'use strict';var Sequelize=require(_0xf75f('0x0'));module[_0xf75f('0x1')]={'name':{'type':Sequelize[_0xf75f('0x2')]},'description':{'type':Sequelize[_0xf75f('0x2')]},'username':{'type':Sequelize[_0xf75f('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xf75f('0x2')]},'password':{'type':Sequelize[_0xf75f('0x2')]},'clientId':{'type':Sequelize[_0xf75f('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xf75f('0x2')]},'serverUrl':{'type':Sequelize[_0xf75f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf75f('0x3')]('integrationTab','newTab'),'defaultValue':_0xf75f('0x4')}}; \ No newline at end of file +var _0x229c=['exports','STRING','integrationTab'];(function(_0x3091fc,_0x26e483){var _0x39f3e2=function(_0x44834c){while(--_0x44834c){_0x3091fc['push'](_0x3091fc['shift']());}};_0x39f3e2(++_0x26e483);}(_0x229c,0xcf));var _0xc229=function(_0xdd365b,_0x517f24){_0xdd365b=_0xdd365b-0x0;var _0x232f42=_0x229c[_0xdd365b];return _0x232f42;};'use strict';var Sequelize=require('sequelize');module[_0xc229('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc229('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc229('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xc229('0x1')]},'securityToken':{'type':Sequelize[_0xc229('0x1')]},'serverUrl':{'type':Sequelize[_0xc229('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc229('0x2'),'newTab'),'defaultValue':_0xc229('0x2')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 092f228..be9a139 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 _0x063f=['false','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','undefined','count','offset','limit','json','apply','update','then','destroy','error','name','index','map','SalesforceAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','rows','catch','params','rawAttributes','include','find','create','body','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','getFields','Task','remoteUri','clientId','username','securityToken','slice','substring','lastIndexOf','clientSecret','login','concat','isNil','ticketType','sobject','describe','IsRecurrence','Subject','Description','string','boolean','email','textarea','phone','includes','label','custom','picklistValues','value','true','False'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x063f,0x76));var _0xf063=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0x063f[_0x2dd390];return _0x3afe47;};'use strict';var emlformat=require(_0xf063('0x0'));var rimraf=require(_0xf063('0x1'));var zipdir=require(_0xf063('0x2'));var jsonpatch=require(_0xf063('0x3'));var rp=require('request-promise');var moment=require(_0xf063('0x4'));var BPromise=require(_0xf063('0x5'));var Mustache=require(_0xf063('0x6'));var util=require('util');var path=require(_0xf063('0x7'));var sox=require(_0xf063('0x8'));var csv=require(_0xf063('0x9'));var ejs=require(_0xf063('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf063('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf063('0xc'));var toCsv=require(_0xf063('0x9'));var querystring=require(_0xf063('0xd'));var Papa=require(_0xf063('0xe'));var Redis=require(_0xf063('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf063('0x10'));var as=require(_0xf063('0x11'));var hardwareService=require(_0xf063('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xf063('0x13'));var config=require(_0xf063('0x14'));var licenseUtil=require(_0xf063('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf063('0x16'));function respondWithStatusCode(_0x499ca1,_0x4b371e){_0x4b371e=_0x4b371e||0xcc;return function(_0x30953b){if(_0x30953b){return _0x499ca1[_0xf063('0x17')](_0x4b371e);}return _0x499ca1['status'](_0x4b371e)[_0xf063('0x18')]();};}function respondWithResult(_0x296092,_0x2c220f){_0x2c220f=_0x2c220f||0xc8;return function(_0x4dd7cd){if(_0x4dd7cd){return _0x296092[_0xf063('0x19')](_0x2c220f)['json'](_0x4dd7cd);}};}function respondWithFilteredResult(_0x43a62f,_0x415dff){return function(_0x108f9e){if(_0x108f9e){var _0x433156=typeof _0x415dff['offset']===_0xf063('0x1a')&&typeof _0x415dff['limit']===_0xf063('0x1a');var _0x1655ce=_0x108f9e[_0xf063('0x1b')];var _0x454e72=_0x433156?0x0:_0x415dff['offset'];var _0x1a3289=_0x433156?_0x108f9e['count']:_0x415dff[_0xf063('0x1c')]+_0x415dff[_0xf063('0x1d')];var _0x481e59;if(_0x1a3289>=_0x1655ce){_0x1a3289=_0x1655ce;_0x481e59=0xc8;}else{_0x481e59=0xce;}_0x43a62f[_0xf063('0x19')](_0x481e59);return _0x43a62f['set']('Content-Range',_0x454e72+'-'+_0x1a3289+'/'+_0x1655ce)[_0xf063('0x1e')](_0x108f9e);}return null;};}function patchUpdates(_0x359562){return function(_0x5048f0){try{jsonpatch[_0xf063('0x1f')](_0x5048f0,_0x359562,!![]);}catch(_0x281e3e){return BPromise['reject'](_0x281e3e);}return _0x5048f0['save']();};}function saveUpdates(_0x475228,_0x5115bc){return function(_0x3892aa){if(_0x3892aa){return _0x3892aa[_0xf063('0x20')](_0x475228)[_0xf063('0x21')](function(_0x94235d){return _0x94235d;});}return null;};}function removeEntity(_0x467b92,_0x3b57f9){return function(_0x2931de){if(_0x2931de){return _0x2931de[_0xf063('0x22')]()['then'](function(){_0x467b92['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d5899,_0xb07f30){return function(_0x3c3732){if(!_0x3c3732){_0x4d5899[_0xf063('0x17')](0x194);}return _0x3c3732;};}function handleError(_0xfd55f4,_0x5b87d1){_0x5b87d1=_0x5b87d1||0x1f4;return function(_0x283f6c){logger[_0xf063('0x23')](_0x283f6c['stack']);if(_0x283f6c[_0xf063('0x24')]){delete _0x283f6c[_0xf063('0x24')];}_0xfd55f4[_0xf063('0x19')](_0x5b87d1)['send'](_0x283f6c);};}exports[_0xf063('0x25')]=function(_0x261f26,_0x1f5f6c){var _0x3fe890={},_0x1910e8={},_0x27281a={'count':0x0,'rows':[]};var _0x5e8852=_[_0xf063('0x26')](db[_0xf063('0x27')]['rawAttributes'],function(_0x3ce373){return{'name':_0x3ce373[_0xf063('0x28')],'type':_0x3ce373[_0xf063('0x29')][_0xf063('0x2a')]};});_0x1910e8[_0xf063('0x2b')]=_[_0xf063('0x26')](_0x5e8852,_0xf063('0x24'));_0x1910e8[_0xf063('0x2c')]=_[_0xf063('0x2d')](_0x261f26['query']);_0x1910e8[_0xf063('0x2e')]=_[_0xf063('0x2f')](_0x1910e8['model'],_0x1910e8[_0xf063('0x2c')]);_0x3fe890[_0xf063('0x30')]=_['intersection'](_0x1910e8['model'],qs[_0xf063('0x31')](_0x261f26[_0xf063('0x2c')][_0xf063('0x31')]));_0x3fe890['attributes']=_0x3fe890[_0xf063('0x30')][_0xf063('0x32')]?_0x3fe890[_0xf063('0x30')]:_0x1910e8[_0xf063('0x2b')];if(!_0x261f26[_0xf063('0x2c')][_0xf063('0x33')](_0xf063('0x34'))){_0x3fe890['limit']=qs[_0xf063('0x1d')](_0x261f26[_0xf063('0x2c')]['limit']);_0x3fe890['offset']=qs[_0xf063('0x1c')](_0x261f26[_0xf063('0x2c')][_0xf063('0x1c')]);}_0x3fe890[_0xf063('0x35')]=qs[_0xf063('0x36')](_0x261f26[_0xf063('0x2c')][_0xf063('0x36')]);_0x3fe890[_0xf063('0x37')]=qs[_0xf063('0x2e')](_[_0xf063('0x38')](_0x261f26[_0xf063('0x2c')],_0x1910e8['filters']),_0x5e8852);if(_0x261f26[_0xf063('0x2c')]['filter']){_0x3fe890['where']=_[_0xf063('0x39')](_0x3fe890[_0xf063('0x37')],{'$or':_['map'](_0x5e8852,function(_0x49cad2){if(_0x49cad2[_0xf063('0x29')]!=='VIRTUAL'){var _0x451866={};_0x451866[_0x49cad2['name']]={'$like':'%'+_0x261f26[_0xf063('0x2c')][_0xf063('0x3a')]+'%'};return _0x451866;}})});}_0x3fe890=_[_0xf063('0x39')]({},_0x3fe890,_0x261f26[_0xf063('0x3b')]);var _0x143737={'where':_0x3fe890[_0xf063('0x37')]};return db['SalesforceAccount'][_0xf063('0x1b')](_0x143737)[_0xf063('0x21')](function(_0x164e56){_0x27281a[_0xf063('0x1b')]=_0x164e56;if(_0x261f26[_0xf063('0x2c')][_0xf063('0x3c')]){_0x3fe890['include']=[{'all':!![]}];}return db[_0xf063('0x27')]['findAll'](_0x3fe890);})[_0xf063('0x21')](function(_0x2db47b){_0x27281a[_0xf063('0x3d')]=_0x2db47b;return _0x27281a;})[_0xf063('0x21')](respondWithFilteredResult(_0x1f5f6c,_0x3fe890))[_0xf063('0x3e')](handleError(_0x1f5f6c,null));};exports['show']=function(_0xceb0fc,_0x22a044){var _0x3ff563={'raw':![],'where':{'id':_0xceb0fc[_0xf063('0x3f')]['id']}},_0x2963fd={};_0x2963fd[_0xf063('0x2b')]=_['keys'](db[_0xf063('0x27')][_0xf063('0x40')]);_0x2963fd[_0xf063('0x2c')]=_[_0xf063('0x2d')](_0xceb0fc[_0xf063('0x2c')]);_0x2963fd[_0xf063('0x2e')]=_[_0xf063('0x2f')](_0x2963fd['model'],_0x2963fd[_0xf063('0x2c')]);_0x3ff563[_0xf063('0x30')]=_['intersection'](_0x2963fd[_0xf063('0x2b')],qs[_0xf063('0x31')](_0xceb0fc[_0xf063('0x2c')][_0xf063('0x31')]));_0x3ff563[_0xf063('0x30')]=_0x3ff563['attributes'][_0xf063('0x32')]?_0x3ff563[_0xf063('0x30')]:_0x2963fd['model'];if(_0xceb0fc[_0xf063('0x2c')][_0xf063('0x3c')]){_0x3ff563[_0xf063('0x41')]=[{'all':!![]}];}_0x3ff563=_['merge']({},_0x3ff563,_0xceb0fc['options']);return db['SalesforceAccount'][_0xf063('0x42')](_0x3ff563)[_0xf063('0x21')](handleEntityNotFound(_0x22a044,null))['then'](respondWithResult(_0x22a044,null))[_0xf063('0x3e')](handleError(_0x22a044,null));};exports[_0xf063('0x43')]=function(_0x15db16,_0x263d9f){return db[_0xf063('0x27')][_0xf063('0x43')](_0x15db16['body'],{})[_0xf063('0x21')](respondWithResult(_0x263d9f,0xc9))[_0xf063('0x3e')](handleError(_0x263d9f,null));};exports[_0xf063('0x20')]=function(_0x5565ae,_0x59ebfa){if(_0x5565ae[_0xf063('0x44')]['id']){delete _0x5565ae[_0xf063('0x44')]['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x5565ae[_0xf063('0x3f')]['id']}})[_0xf063('0x21')](handleEntityNotFound(_0x59ebfa,null))[_0xf063('0x21')](saveUpdates(_0x5565ae[_0xf063('0x44')],null))[_0xf063('0x21')](respondWithResult(_0x59ebfa,null))[_0xf063('0x3e')](handleError(_0x59ebfa,null));};exports[_0xf063('0x22')]=function(_0x20704d,_0x241f78){return db[_0xf063('0x27')][_0xf063('0x42')]({'where':{'id':_0x20704d[_0xf063('0x3f')]['id']}})[_0xf063('0x21')](handleEntityNotFound(_0x241f78,null))[_0xf063('0x21')](removeEntity(_0x241f78,null))[_0xf063('0x3e')](handleError(_0x241f78,null));};exports[_0xf063('0x45')]=function(_0x3669ab,_0x684909,_0x2c9a39){var _0x34d81b={};var _0x3595e2={};var _0x5d7b2b;var _0x1f3520;return db['SalesforceAccount'][_0xf063('0x46')]({'where':{'id':_0x3669ab['params']['id']}})[_0xf063('0x21')](handleEntityNotFound(_0x684909,null))[_0xf063('0x21')](function(_0x2d4c2a){if(_0x2d4c2a){_0x5d7b2b=_0x2d4c2a;_0x3595e2[_0xf063('0x2b')]=_['keys'](db[_0xf063('0x47')][_0xf063('0x40')]);_0x3595e2['query']=_[_0xf063('0x2d')](_0x3669ab['query']);_0x3595e2[_0xf063('0x2e')]=_['intersection'](_0x3595e2['model'],_0x3595e2[_0xf063('0x2c')]);_0x34d81b[_0xf063('0x30')]=_[_0xf063('0x2f')](_0x3595e2[_0xf063('0x2b')],qs['fields'](_0x3669ab[_0xf063('0x2c')][_0xf063('0x31')]));_0x34d81b[_0xf063('0x30')]=_0x34d81b[_0xf063('0x30')][_0xf063('0x32')]?_0x34d81b[_0xf063('0x30')]:_0x3595e2[_0xf063('0x2b')];_0x34d81b[_0xf063('0x35')]=qs[_0xf063('0x36')](_0x3669ab[_0xf063('0x2c')]['sort']);_0x34d81b[_0xf063('0x37')]=qs[_0xf063('0x2e')](_['pick'](_0x3669ab['query'],_0x3595e2[_0xf063('0x2e')]));if(_0x3669ab[_0xf063('0x2c')][_0xf063('0x3a')]){_0x34d81b[_0xf063('0x37')]=_[_0xf063('0x39')](_0x34d81b['where'],{'$or':_[_0xf063('0x26')](_0x34d81b[_0xf063('0x30')],function(_0x434b8a){var _0x2a99f7={};_0x2a99f7[_0x434b8a]={'$like':'%'+_0x3669ab[_0xf063('0x2c')]['filter']+'%'};return _0x2a99f7;})});}_0x34d81b=_[_0xf063('0x39')]({},_0x34d81b,_0x3669ab[_0xf063('0x3b')]);return _0x5d7b2b[_0xf063('0x45')](_0x34d81b);}})[_0xf063('0x21')](function(_0x298f72){if(_0x298f72){_0x1f3520=_0x298f72[_0xf063('0x32')];if(!_0x3669ab[_0xf063('0x2c')]['hasOwnProperty']('nolimit')){_0x34d81b[_0xf063('0x1d')]=qs[_0xf063('0x1d')](_0x3669ab[_0xf063('0x2c')][_0xf063('0x1d')]);_0x34d81b[_0xf063('0x1c')]=qs['offset'](_0x3669ab['query'][_0xf063('0x1c')]);}return _0x5d7b2b[_0xf063('0x45')](_0x34d81b);}})[_0xf063('0x21')](function(_0x1cd385){if(_0x1cd385){return _0x1cd385?{'count':_0x1f3520,'rows':_0x1cd385}:null;}})[_0xf063('0x21')](respondWithResult(_0x684909,null))[_0xf063('0x3e')](handleError(_0x684909,null));};exports[_0xf063('0x48')]=function(_0x25e8bb,_0xbea3af,_0x2ccb02){if(_0x25e8bb[_0xf063('0x44')]['id']){delete _0x25e8bb[_0xf063('0x44')]['id'];}return db['SalesforceAccount'][_0xf063('0x46')]({'where':{'id':_0x25e8bb[_0xf063('0x3f')]['id']}})[_0xf063('0x21')](handleEntityNotFound(_0xbea3af,null))['then'](function(_0x3c1cf4){if(_0x3c1cf4){_0x25e8bb[_0xf063('0x44')]['AccountId']=_0x3c1cf4['id'];_0x25e8bb[_0xf063('0x44')][_0xf063('0x49')]=integrations[_0xf063('0x4a')](_0x25e8bb[_0xf063('0x44')]['channel'],_0x25e8bb[_0xf063('0x44')]['type']);_0x25e8bb[_0xf063('0x44')][_0xf063('0x4b')]=integrations[_0xf063('0x4c')](_0x25e8bb['body'][_0xf063('0x4d')],_0x25e8bb[_0xf063('0x44')]['type']);return db[_0xf063('0x47')][_0xf063('0x43')](_0x25e8bb['body'],{'include':[{'model':db[_0xf063('0x4e')],'as':_0xf063('0x49')},{'model':db[_0xf063('0x4e')],'as':_0xf063('0x4b')}]});}return null;})['then'](respondWithResult(_0xbea3af,null))[_0xf063('0x3e')](handleError(_0xbea3af,null));};exports[_0xf063('0x4f')]=function(_0x2bbd59,_0xdce3cc,_0x335666){var _0x298935;var _0x44b7ff='';var _0xa428e9=_0xf063('0x50');return db['SalesforceAccount'][_0xf063('0x46')]({'where':{'id':_0x2bbd59[_0xf063('0x3f')]['id']},'attributes':['id',_0xf063('0x51'),_0xf063('0x52'),'clientSecret',_0xf063('0x53'),'password',_0xf063('0x54')]})[_0xf063('0x21')](handleEntityNotFound(_0xdce3cc,null))[_0xf063('0x21')](function(_0x583156){if(_0x583156){_0x44b7ff=_0x583156['remoteUri'];var _0x1cfdb9=_0x44b7ff[_0xf063('0x55')](-0x1);if(_0x1cfdb9==='/'){_0x44b7ff=_0x44b7ff[_0xf063('0x56')](0x0,_0x44b7ff[_0xf063('0x57')](_0x1cfdb9));}_0x298935=new jsforce['Connection']({'oauth2':{'loginUrl':_0x44b7ff,'clientId':_0x583156[_0xf063('0x52')],'clientSecret':_0x583156[_0xf063('0x58')]}});return _0x298935[_0xf063('0x59')](_0x583156[_0xf063('0x53')],_0x583156['password'][_0xf063('0x5a')](_0x583156[_0xf063('0x54')]));}})[_0xf063('0x21')](function(_0x31fcf0){if(_0x31fcf0){if(!_[_0xf063('0x5b')](_0x2bbd59[_0xf063('0x2c')]['ticketType'])){_0xa428e9=_0x2bbd59[_0xf063('0x2c')][_0xf063('0x5c')];}return _0x298935[_0xf063('0x5d')](_0xa428e9)[_0xf063('0x5e')]();}})[_0xf063('0x21')](function(_0x41857f){var _0x3e4a7d=['OwnerId','ActivityDate','IsReminderSet',_0xf063('0x5f'),_0xf063('0x60'),_0xf063('0x61')];var _0x4a9fe2=[_0xf063('0x62'),'int','picklist',_0xf063('0x63'),_0xf063('0x64'),_0xf063('0x65'),_0xf063('0x66')];if(_0x41857f){_['remove'](_0x41857f[_0xf063('0x31')],function(_0x4ff774){return _0x3e4a7d['includes'](_0x4ff774[_0xf063('0x24')])||!_0x4a9fe2[_0xf063('0x67')](_0x4ff774[_0xf063('0x29')]);});return{'count':_0x41857f[_0xf063('0x31')][_0xf063('0x32')],'rows':_['map'](_0x41857f[_0xf063('0x31')],function(_0x44a87c){return{'id':_0x44a87c[_0xf063('0x24')],'name':_0x44a87c[_0xf063('0x68')],'custom':_0x44a87c[_0xf063('0x69')],'options':_0x44a87c['picklistValues']['length']>0x0?_[_0xf063('0x26')](_0x44a87c[_0xf063('0x6a')],function(_0x461157){return{'name':_0x461157['label'],'value':_0x461157[_0xf063('0x6b')]};}):_0x44a87c[_0xf063('0x29')]==_0xf063('0x63')?[{'name':'True','value':_0xf063('0x6c')},{'name':_0xf063('0x6d'),'value':_0xf063('0x6e')}]:[]};})};}})[_0xf063('0x21')](respondWithResult(_0xdce3cc,null))['catch'](function(_0x5dd0f4){var _0x42a4be=_0x2bbd59[_0xf063('0x2c')][_0xf063('0x6f')]?0x1f4:_0x5dd0f4['statusCode']||0x1f4;logger[_0xf063('0x23')](_0xf063('0x70'),'getFields',_0x42a4be,JSON['stringify'](_0x5dd0f4));delete _0x5dd0f4[_0xf063('0x24')];if(_0x42a4be===0x191){_0x42a4be=0x190;}_0xdce3cc[_0xf063('0x19')](_0x42a4be)['send'](_0x2bbd59[_0xf063('0x2c')]['test']?{'message':_0xf063('0x71'),'statusCode':_0x5dd0f4['statusCode']}:_0x5dd0f4);});}; \ No newline at end of file +var _0x3f48=['clientId','clientSecret','password','securityToken','slice','substring','login','username','isNil','ticketType','sobject','OwnerId','IsReminderSet','IsRecurrence','Subject','string','int','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','false','test','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','send','map','SalesforceAccount','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','params','body','find','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','type','getDescriptions','channel','create','SalesforceField','Descriptions','getFields','Task','remoteUri'];(function(_0x18cf8a,_0xcc5571){var _0x1f13c9=function(_0x1c2ea1){while(--_0x1c2ea1){_0x18cf8a['push'](_0x18cf8a['shift']());}};_0x1f13c9(++_0xcc5571);}(_0x3f48,0x18f));var _0x83f4=function(_0x44033a,_0x259f60){_0x44033a=_0x44033a-0x0;var _0xcb4f9=_0x3f48[_0x44033a];return _0xcb4f9;};'use strict';var emlformat=require(_0x83f4('0x0'));var rimraf=require(_0x83f4('0x1'));var zipdir=require(_0x83f4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x83f4('0x3'));var moment=require(_0x83f4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x83f4('0x5'));var util=require('util');var path=require(_0x83f4('0x6'));var sox=require('sox');var csv=require(_0x83f4('0x7'));var ejs=require(_0x83f4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x83f4('0x9'));var squel=require(_0x83f4('0xa'));var crypto=require('crypto');var jsforce=require(_0x83f4('0xb'));var deskjs=require(_0x83f4('0xc'));var toCsv=require('to-csv');var querystring=require(_0x83f4('0xd'));var Papa=require('papaparse');var Redis=require(_0x83f4('0xe'));var authService=require(_0x83f4('0xf'));var qs=require(_0x83f4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x83f4('0x11'));var logger=require(_0x83f4('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x83f4('0x13'));var licenseUtil=require(_0x83f4('0x14'));var db=require(_0x83f4('0x15'))['db'];var integrations=require(_0x83f4('0x16'));function respondWithStatusCode(_0x42dc5,_0x15b854){_0x15b854=_0x15b854||0xcc;return function(_0x51ef48){if(_0x51ef48){return _0x42dc5['sendStatus'](_0x15b854);}return _0x42dc5[_0x83f4('0x17')](_0x15b854)[_0x83f4('0x18')]();};}function respondWithResult(_0x1a9c8c,_0x4753af){_0x4753af=_0x4753af||0xc8;return function(_0x17f233){if(_0x17f233){return _0x1a9c8c[_0x83f4('0x17')](_0x4753af)[_0x83f4('0x19')](_0x17f233);}};}function respondWithFilteredResult(_0x9aae00,_0x5039e3){return function(_0x4ed255){if(_0x4ed255){var _0x379e1c=typeof _0x5039e3['offset']===_0x83f4('0x1a')&&typeof _0x5039e3[_0x83f4('0x1b')]==='undefined';var _0x5e8df3=_0x4ed255[_0x83f4('0x1c')];var _0x4cdc71=_0x379e1c?0x0:_0x5039e3['offset'];var _0x21b517=_0x379e1c?_0x4ed255[_0x83f4('0x1c')]:_0x5039e3[_0x83f4('0x1d')]+_0x5039e3[_0x83f4('0x1b')];var _0x526bc8;if(_0x21b517>=_0x5e8df3){_0x21b517=_0x5e8df3;_0x526bc8=0xc8;}else{_0x526bc8=0xce;}_0x9aae00[_0x83f4('0x17')](_0x526bc8);return _0x9aae00['set'](_0x83f4('0x1e'),_0x4cdc71+'-'+_0x21b517+'/'+_0x5e8df3)['json'](_0x4ed255);}return null;};}function patchUpdates(_0x1a2233){return function(_0x472e3c){try{jsonpatch[_0x83f4('0x1f')](_0x472e3c,_0x1a2233,!![]);}catch(_0x4facd0){return BPromise[_0x83f4('0x20')](_0x4facd0);}return _0x472e3c[_0x83f4('0x21')]();};}function saveUpdates(_0x4770e6,_0x553f98){return function(_0x43dbb1){if(_0x43dbb1){return _0x43dbb1[_0x83f4('0x22')](_0x4770e6)['then'](function(_0x2e0bc3){return _0x2e0bc3;});}return null;};}function removeEntity(_0x4e4ccd,_0x277ff1){return function(_0x433fe4){if(_0x433fe4){return _0x433fe4[_0x83f4('0x23')]()['then'](function(){_0x4e4ccd[_0x83f4('0x17')](0xcc)[_0x83f4('0x18')]();});}};}function handleEntityNotFound(_0x1f69ae,_0x151e2c){return function(_0x5df836){if(!_0x5df836){_0x1f69ae[_0x83f4('0x24')](0x194);}return _0x5df836;};}function handleError(_0x14a9ba,_0x3147b7){_0x3147b7=_0x3147b7||0x1f4;return function(_0x445445){logger[_0x83f4('0x25')](_0x445445[_0x83f4('0x26')]);if(_0x445445['name']){delete _0x445445[_0x83f4('0x27')];}_0x14a9ba[_0x83f4('0x17')](_0x3147b7)[_0x83f4('0x28')](_0x445445);};}exports['index']=function(_0x2a1e8c,_0x1980f8){var _0x142a1b={},_0x3c4f69={},_0x4c9623={'count':0x0,'rows':[]};var _0x14178a=_[_0x83f4('0x29')](db[_0x83f4('0x2a')][_0x83f4('0x2b')],function(_0x3bc810){return{'name':_0x3bc810[_0x83f4('0x2c')],'type':_0x3bc810['type'][_0x83f4('0x2d')]};});_0x3c4f69[_0x83f4('0x2e')]=_[_0x83f4('0x29')](_0x14178a,_0x83f4('0x27'));_0x3c4f69['query']=_[_0x83f4('0x2f')](_0x2a1e8c[_0x83f4('0x30')]);_0x3c4f69[_0x83f4('0x31')]=_['intersection'](_0x3c4f69[_0x83f4('0x2e')],_0x3c4f69[_0x83f4('0x30')]);_0x142a1b[_0x83f4('0x32')]=_[_0x83f4('0x33')](_0x3c4f69['model'],qs[_0x83f4('0x34')](_0x2a1e8c['query'][_0x83f4('0x34')]));_0x142a1b[_0x83f4('0x32')]=_0x142a1b[_0x83f4('0x32')][_0x83f4('0x35')]?_0x142a1b['attributes']:_0x3c4f69['model'];if(!_0x2a1e8c[_0x83f4('0x30')][_0x83f4('0x36')](_0x83f4('0x37'))){_0x142a1b[_0x83f4('0x1b')]=qs[_0x83f4('0x1b')](_0x2a1e8c[_0x83f4('0x30')][_0x83f4('0x1b')]);_0x142a1b[_0x83f4('0x1d')]=qs['offset'](_0x2a1e8c[_0x83f4('0x30')][_0x83f4('0x1d')]);}_0x142a1b[_0x83f4('0x38')]=qs[_0x83f4('0x39')](_0x2a1e8c[_0x83f4('0x30')][_0x83f4('0x39')]);_0x142a1b[_0x83f4('0x3a')]=qs[_0x83f4('0x31')](_[_0x83f4('0x3b')](_0x2a1e8c['query'],_0x3c4f69[_0x83f4('0x31')]),_0x14178a);if(_0x2a1e8c[_0x83f4('0x30')][_0x83f4('0x3c')]){_0x142a1b['where']=_['merge'](_0x142a1b[_0x83f4('0x3a')],{'$or':_[_0x83f4('0x29')](_0x14178a,function(_0x3596b7){if(_0x3596b7['type']!==_0x83f4('0x3d')){var _0x30daed={};_0x30daed[_0x3596b7[_0x83f4('0x27')]]={'$like':'%'+_0x2a1e8c['query'][_0x83f4('0x3c')]+'%'};return _0x30daed;}})});}_0x142a1b=_[_0x83f4('0x3e')]({},_0x142a1b,_0x2a1e8c[_0x83f4('0x3f')]);var _0x36f6f1={'where':_0x142a1b[_0x83f4('0x3a')]};return db[_0x83f4('0x2a')][_0x83f4('0x1c')](_0x36f6f1)[_0x83f4('0x40')](function(_0x3f225c){_0x4c9623[_0x83f4('0x1c')]=_0x3f225c;if(_0x2a1e8c['query'][_0x83f4('0x41')]){_0x142a1b[_0x83f4('0x42')]=[{'all':!![]}];}return db[_0x83f4('0x2a')][_0x83f4('0x43')](_0x142a1b);})[_0x83f4('0x40')](function(_0x46431c){_0x4c9623[_0x83f4('0x44')]=_0x46431c;return _0x4c9623;})[_0x83f4('0x40')](respondWithFilteredResult(_0x1980f8,_0x142a1b))[_0x83f4('0x45')](handleError(_0x1980f8,null));};exports[_0x83f4('0x46')]=function(_0x2d0987,_0x21206d){var _0x59738d={'raw':![],'where':{'id':_0x2d0987[_0x83f4('0x47')]['id']}},_0x247b79={};_0x247b79[_0x83f4('0x2e')]=_[_0x83f4('0x2f')](db[_0x83f4('0x2a')][_0x83f4('0x2b')]);_0x247b79[_0x83f4('0x30')]=_['keys'](_0x2d0987['query']);_0x247b79[_0x83f4('0x31')]=_['intersection'](_0x247b79[_0x83f4('0x2e')],_0x247b79[_0x83f4('0x30')]);_0x59738d['attributes']=_[_0x83f4('0x33')](_0x247b79['model'],qs['fields'](_0x2d0987[_0x83f4('0x30')][_0x83f4('0x34')]));_0x59738d[_0x83f4('0x32')]=_0x59738d[_0x83f4('0x32')][_0x83f4('0x35')]?_0x59738d[_0x83f4('0x32')]:_0x247b79[_0x83f4('0x2e')];if(_0x2d0987[_0x83f4('0x30')]['includeAll']){_0x59738d[_0x83f4('0x42')]=[{'all':!![]}];}_0x59738d=_[_0x83f4('0x3e')]({},_0x59738d,_0x2d0987[_0x83f4('0x3f')]);return db[_0x83f4('0x2a')]['find'](_0x59738d)[_0x83f4('0x40')](handleEntityNotFound(_0x21206d,null))[_0x83f4('0x40')](respondWithResult(_0x21206d,null))[_0x83f4('0x45')](handleError(_0x21206d,null));};exports['create']=function(_0x1a1f89,_0x588f85){return db['SalesforceAccount']['create'](_0x1a1f89['body'],{})['then'](respondWithResult(_0x588f85,0xc9))[_0x83f4('0x45')](handleError(_0x588f85,null));};exports[_0x83f4('0x22')]=function(_0x2e2d50,_0x3c37bd){if(_0x2e2d50[_0x83f4('0x48')]['id']){delete _0x2e2d50['body']['id'];}return db[_0x83f4('0x2a')][_0x83f4('0x49')]({'where':{'id':_0x2e2d50[_0x83f4('0x47')]['id']}})[_0x83f4('0x40')](handleEntityNotFound(_0x3c37bd,null))[_0x83f4('0x40')](saveUpdates(_0x2e2d50['body'],null))[_0x83f4('0x40')](respondWithResult(_0x3c37bd,null))[_0x83f4('0x45')](handleError(_0x3c37bd,null));};exports['destroy']=function(_0x585adc,_0x4e3b1a){return db['SalesforceAccount'][_0x83f4('0x49')]({'where':{'id':_0x585adc[_0x83f4('0x47')]['id']}})[_0x83f4('0x40')](handleEntityNotFound(_0x4e3b1a,null))[_0x83f4('0x40')](removeEntity(_0x4e3b1a,null))['catch'](handleError(_0x4e3b1a,null));};exports[_0x83f4('0x4a')]=function(_0x7eb927,_0x3e6321,_0x2c0780){var _0x3078f4={};var _0x257054={};var _0x26957b;var _0x4824fd;return db[_0x83f4('0x2a')][_0x83f4('0x4b')]({'where':{'id':_0x7eb927['params']['id']}})['then'](handleEntityNotFound(_0x3e6321,null))[_0x83f4('0x40')](function(_0x55d45f){if(_0x55d45f){_0x26957b=_0x55d45f;_0x257054[_0x83f4('0x2e')]=_[_0x83f4('0x2f')](db[_0x83f4('0x4c')]['rawAttributes']);_0x257054[_0x83f4('0x30')]=_[_0x83f4('0x2f')](_0x7eb927[_0x83f4('0x30')]);_0x257054[_0x83f4('0x31')]=_[_0x83f4('0x33')](_0x257054['model'],_0x257054['query']);_0x3078f4[_0x83f4('0x32')]=_[_0x83f4('0x33')](_0x257054['model'],qs[_0x83f4('0x34')](_0x7eb927[_0x83f4('0x30')][_0x83f4('0x34')]));_0x3078f4[_0x83f4('0x32')]=_0x3078f4[_0x83f4('0x32')][_0x83f4('0x35')]?_0x3078f4[_0x83f4('0x32')]:_0x257054[_0x83f4('0x2e')];_0x3078f4['order']=qs[_0x83f4('0x39')](_0x7eb927[_0x83f4('0x30')]['sort']);_0x3078f4['where']=qs['filters'](_[_0x83f4('0x3b')](_0x7eb927[_0x83f4('0x30')],_0x257054[_0x83f4('0x31')]));if(_0x7eb927[_0x83f4('0x30')][_0x83f4('0x3c')]){_0x3078f4[_0x83f4('0x3a')]=_[_0x83f4('0x3e')](_0x3078f4[_0x83f4('0x3a')],{'$or':_[_0x83f4('0x29')](_0x3078f4[_0x83f4('0x32')],function(_0x67163a){var _0x2570a0={};_0x2570a0[_0x67163a]={'$like':'%'+_0x7eb927[_0x83f4('0x30')][_0x83f4('0x3c')]+'%'};return _0x2570a0;})});}_0x3078f4=_[_0x83f4('0x3e')]({},_0x3078f4,_0x7eb927[_0x83f4('0x3f')]);return _0x26957b[_0x83f4('0x4a')](_0x3078f4);}})[_0x83f4('0x40')](function(_0xccc40d){if(_0xccc40d){_0x4824fd=_0xccc40d[_0x83f4('0x35')];if(!_0x7eb927[_0x83f4('0x30')]['hasOwnProperty'](_0x83f4('0x37'))){_0x3078f4[_0x83f4('0x1b')]=qs[_0x83f4('0x1b')](_0x7eb927[_0x83f4('0x30')][_0x83f4('0x1b')]);_0x3078f4[_0x83f4('0x1d')]=qs[_0x83f4('0x1d')](_0x7eb927[_0x83f4('0x30')][_0x83f4('0x1d')]);}return _0x26957b[_0x83f4('0x4a')](_0x3078f4);}})[_0x83f4('0x40')](function(_0x4fe366){if(_0x4fe366){return _0x4fe366?{'count':_0x4824fd,'rows':_0x4fe366}:null;}})['then'](respondWithResult(_0x3e6321,null))[_0x83f4('0x45')](handleError(_0x3e6321,null));};exports[_0x83f4('0x4d')]=function(_0x40eae0,_0x3f6b40,_0x43a6e1){if(_0x40eae0['body']['id']){delete _0x40eae0[_0x83f4('0x48')]['id'];}return db[_0x83f4('0x2a')][_0x83f4('0x4b')]({'where':{'id':_0x40eae0[_0x83f4('0x47')]['id']}})[_0x83f4('0x40')](handleEntityNotFound(_0x3f6b40,null))[_0x83f4('0x40')](function(_0x309a9f){if(_0x309a9f){_0x40eae0[_0x83f4('0x48')][_0x83f4('0x4e')]=_0x309a9f['id'];_0x40eae0['body'][_0x83f4('0x4f')]=integrations['getSubjects'](_0x40eae0[_0x83f4('0x48')]['channel'],_0x40eae0[_0x83f4('0x48')][_0x83f4('0x50')]);_0x40eae0['body']['Descriptions']=integrations[_0x83f4('0x51')](_0x40eae0[_0x83f4('0x48')][_0x83f4('0x52')],_0x40eae0[_0x83f4('0x48')][_0x83f4('0x50')]);return db[_0x83f4('0x4c')][_0x83f4('0x53')](_0x40eae0['body'],{'include':[{'model':db[_0x83f4('0x54')],'as':_0x83f4('0x4f')},{'model':db[_0x83f4('0x54')],'as':_0x83f4('0x55')}]});}return null;})[_0x83f4('0x40')](respondWithResult(_0x3f6b40,null))[_0x83f4('0x45')](handleError(_0x3f6b40,null));};exports[_0x83f4('0x56')]=function(_0x2d2e31,_0x5370c4,_0x1932f3){var _0xbac755;var _0x47dbb6='';var _0x1b6dfa=_0x83f4('0x57');return db[_0x83f4('0x2a')]['findOne']({'where':{'id':_0x2d2e31['params']['id']},'attributes':['id',_0x83f4('0x58'),_0x83f4('0x59'),_0x83f4('0x5a'),'username',_0x83f4('0x5b'),_0x83f4('0x5c')]})[_0x83f4('0x40')](handleEntityNotFound(_0x5370c4,null))['then'](function(_0x3d85f1){if(_0x3d85f1){_0x47dbb6=_0x3d85f1[_0x83f4('0x58')];var _0x181c38=_0x47dbb6[_0x83f4('0x5d')](-0x1);if(_0x181c38==='/'){_0x47dbb6=_0x47dbb6[_0x83f4('0x5e')](0x0,_0x47dbb6['lastIndexOf'](_0x181c38));}_0xbac755=new jsforce['Connection']({'oauth2':{'loginUrl':_0x47dbb6,'clientId':_0x3d85f1[_0x83f4('0x59')],'clientSecret':_0x3d85f1[_0x83f4('0x5a')]}});return _0xbac755[_0x83f4('0x5f')](_0x3d85f1[_0x83f4('0x60')],_0x3d85f1['password']['concat'](_0x3d85f1[_0x83f4('0x5c')]));}})['then'](function(_0x5e3086){if(_0x5e3086){if(!_[_0x83f4('0x61')](_0x2d2e31[_0x83f4('0x30')][_0x83f4('0x62')])){_0x1b6dfa=_0x2d2e31['query'][_0x83f4('0x62')];}return _0xbac755[_0x83f4('0x63')](_0x1b6dfa)['describe']();}})[_0x83f4('0x40')](function(_0x5626fd){var _0x382606=[_0x83f4('0x64'),'ActivityDate',_0x83f4('0x65'),_0x83f4('0x66'),_0x83f4('0x67'),'Description'];var _0xb08dac=[_0x83f4('0x68'),_0x83f4('0x69'),_0x83f4('0x6a'),_0x83f4('0x6b'),_0x83f4('0x6c'),_0x83f4('0x6d'),_0x83f4('0x6e')];if(_0x5626fd){_[_0x83f4('0x6f')](_0x5626fd[_0x83f4('0x34')],function(_0x3a7efa){return _0x382606[_0x83f4('0x70')](_0x3a7efa['name'])||!_0xb08dac['includes'](_0x3a7efa[_0x83f4('0x50')]);});return{'count':_0x5626fd[_0x83f4('0x34')][_0x83f4('0x35')],'rows':_[_0x83f4('0x29')](_0x5626fd[_0x83f4('0x34')],function(_0x3a9168){return{'id':_0x3a9168[_0x83f4('0x27')],'name':_0x3a9168[_0x83f4('0x71')],'custom':_0x3a9168[_0x83f4('0x72')],'options':_0x3a9168[_0x83f4('0x73')][_0x83f4('0x35')]>0x0?_[_0x83f4('0x29')](_0x3a9168[_0x83f4('0x73')],function(_0x418275){return{'name':_0x418275[_0x83f4('0x71')],'value':_0x418275[_0x83f4('0x74')]};}):_0x3a9168[_0x83f4('0x50')]==_0x83f4('0x6b')?[{'name':'True','value':'true'},{'name':'False','value':_0x83f4('0x75')}]:[]};})};}})[_0x83f4('0x40')](respondWithResult(_0x5370c4,null))[_0x83f4('0x45')](function(_0xeb3761){var _0x25f821=_0x2d2e31[_0x83f4('0x30')][_0x83f4('0x76')]?0x1f4:_0xeb3761['statusCode']||0x1f4;logger[_0x83f4('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x83f4('0x56'),_0x25f821,JSON[_0x83f4('0x77')](_0xeb3761));delete _0xeb3761[_0x83f4('0x27')];if(_0x25f821===0x191){_0x25f821=0x190;}_0x5370c4['status'](_0x25f821)[_0x83f4('0x28')](_0x2d2e31['query']['test']?{'message':_0x83f4('0x78'),'statusCode':_0xeb3761[_0x83f4('0x79')]}:_0xeb3761);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index aad438e..e80e766 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 _0xd4a9=['path','rimraf','../../components/integrations/configuration','define','SalesforceAccount','util','api','moment','bluebird','request-promise'];(function(_0x27e7ed,_0x2d5a70){var _0x49c99d=function(_0x69c4ef){while(--_0x69c4ef){_0x27e7ed['push'](_0x27e7ed['shift']());}};_0x49c99d(++_0x2d5a70);}(_0xd4a9,0x131));var _0x9d4a=function(_0x274210,_0x83ef79){_0x274210=_0x274210-0x0;var _0x8400fe=_0xd4a9[_0x274210];return _0x8400fe;};'use strict';var _=require('lodash');var util=require(_0x9d4a('0x0'));var logger=require('../../config/logger')(_0x9d4a('0x1'));var moment=require(_0x9d4a('0x2'));var BPromise=require(_0x9d4a('0x3'));var rp=require(_0x9d4a('0x4'));var fs=require('fs');var path=require(_0x9d4a('0x5'));var rimraf=require(_0x9d4a('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x9d4a('0x7'));module['exports']=function(_0x45c0db,_0x13a685){return _0x45c0db[_0x9d4a('0x8')](_0x9d4a('0x9'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb79c=['request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x599041,_0x40fbea){var _0x1c4969=function(_0x138048){while(--_0x138048){_0x599041['push'](_0x599041['shift']());}};_0x1c4969(++_0x40fbea);}(_0xb79c,0x1e7));var _0xcb79=function(_0x17c995,_0x419b99){_0x17c995=_0x17c995-0x0;var _0xad0ce3=_0xb79c[_0x17c995];return _0xad0ce3;};'use strict';var _=require(_0xcb79('0x0'));var util=require(_0xcb79('0x1'));var logger=require(_0xcb79('0x2'))(_0xcb79('0x3'));var moment=require(_0xcb79('0x4'));var BPromise=require('bluebird');var rp=require(_0xcb79('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb79('0x6'));var config=require(_0xcb79('0x7'));var attributes=require(_0xcb79('0x8'));var integrations=require(_0xcb79('0x9'));module['exports']=function(_0x32e50d,_0x3275c6){return _0x32e50d['define'](_0xcb79('0xa'),attributes,{'tableName':_0xcb79('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 47d6cc6..67011bd 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 _0x21ea=['info','request\x20sent','debug','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','catch','SalesforceAccount','findAll','options','where','attributes','limit','include','model','map','GetSalesforceAccount','ShowSalesforceAccount','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x486ab6,_0x257c0a){var _0x1ce5ea=function(_0x1443a5){while(--_0x1443a5){_0x486ab6['push'](_0x486ab6['shift']());}};_0x1ce5ea(++_0x257c0a);}(_0x21ea,0xbf));var _0xa21e=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x21ea[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0xa21e('0x0'));var util=require(_0xa21e('0x1'));var moment=require(_0xa21e('0x2'));var BPromise=require(_0xa21e('0x3'));var rs=require(_0xa21e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa21e('0x5'))['db'];var utils=require(_0xa21e('0x6'));var logger=require('../../config/logger')(_0xa21e('0x7'));var config=require(_0xa21e('0x8'));var jayson=require(_0xa21e('0x9'));var client=jayson['client'][_0xa21e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44520d,_0x44bad8,_0x322fda){return new BPromise(function(_0x207526,_0xdfea13){return client[_0xa21e('0xb')](_0x44520d,_0x322fda)[_0xa21e('0xc')](function(_0x220727){logger[_0xa21e('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x44bad8,_0xa21e('0xe'));logger[_0xa21e('0xf')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x44bad8,_0xa21e('0xe'),JSON[_0xa21e('0x10')](_0x220727));if(_0x220727[_0xa21e('0x11')]){if(_0x220727[_0xa21e('0x11')][_0xa21e('0x12')]===0x1f4){logger[_0xa21e('0x11')](_0xa21e('0x13'),_0x44bad8,_0x220727[_0xa21e('0x11')][_0xa21e('0x14')]);return _0xdfea13(_0x220727[_0xa21e('0x11')][_0xa21e('0x14')]);}logger[_0xa21e('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x44bad8,_0x220727[_0xa21e('0x11')][_0xa21e('0x14')]);return _0x207526(_0x220727[_0xa21e('0x11')]['message']);}else{logger[_0xa21e('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x44bad8,_0xa21e('0xe'));_0x207526(_0x220727['result'][_0xa21e('0x14')]);}})[_0xa21e('0x15')](function(_0x385275){logger[_0xa21e('0x11')](_0xa21e('0x13'),_0x44bad8,_0x385275);_0xdfea13(_0x385275);});});}exports['GetSalesforceAccount']=function(_0x36bab4){var _0x255ce4=this;return new Promise(function(_0x2656a0,_0x20cbe7){return db[_0xa21e('0x16')][_0xa21e('0x17')]({'raw':_0x36bab4[_0xa21e('0x18')]?_0x36bab4[_0xa21e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x36bab4[_0xa21e('0x18')]?_0x36bab4[_0xa21e('0x18')][_0xa21e('0x19')]||null:null,'attributes':_0x36bab4[_0xa21e('0x18')]?_0x36bab4[_0xa21e('0x18')][_0xa21e('0x1a')]||null:null,'limit':_0x36bab4[_0xa21e('0x18')]?_0x36bab4[_0xa21e('0x18')][_0xa21e('0x1b')]||null:null,'include':_0x36bab4[_0xa21e('0x18')]?_0x36bab4[_0xa21e('0x18')][_0xa21e('0x1c')]?_['map'](_0x36bab4['options'][_0xa21e('0x1c')],function(_0x5506d9){return{'model':db[_0x5506d9[_0xa21e('0x1d')]],'as':_0x5506d9['as'],'attributes':_0x5506d9[_0xa21e('0x1a')],'include':_0x5506d9[_0xa21e('0x1c')]?_[_0xa21e('0x1e')](_0x5506d9['include'],function(_0x1adb28){return{'model':db[_0x1adb28[_0xa21e('0x1d')]],'as':_0x1adb28['as'],'attributes':_0x1adb28[_0xa21e('0x1a')],'include':_0x1adb28[_0xa21e('0x1c')]?_['map'](_0x1adb28['include'],function(_0x2b984b){return{'model':db[_0x2b984b[_0xa21e('0x1d')]],'as':_0x2b984b['as'],'attributes':_0x2b984b[_0xa21e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa21e('0xc')](function(_0x554323){logger[_0xa21e('0xd')](_0xa21e('0x1f'),_0x36bab4);logger[_0xa21e('0xf')]('GetSalesforceAccount',_0x36bab4,JSON['stringify'](_0x554323));_0x2656a0(_0x554323);})[_0xa21e('0x15')](function(_0x541722){logger['error']('GetSalesforceAccount',_0x541722[_0xa21e('0x14')],_0x36bab4);_0x20cbe7(_0x255ce4['error'](0x1f4,_0x541722['message']));});});};exports[_0xa21e('0x20')]=function(_0x2bb225){var _0x44b174=this;return new Promise(function(_0x558912,_0x1b451f){return db[_0xa21e('0x16')]['find']({'raw':_0x2bb225['options']?_0x2bb225['options'][_0xa21e('0x21')]===undefined?!![]:![]:!![],'where':_0x2bb225[_0xa21e('0x18')]?_0x2bb225['options']['where']||null:null,'attributes':_0x2bb225[_0xa21e('0x18')]?_0x2bb225[_0xa21e('0x18')][_0xa21e('0x1a')]||null:null,'include':_0x2bb225[_0xa21e('0x18')]?_0x2bb225['options'][_0xa21e('0x1c')]?_['map'](_0x2bb225[_0xa21e('0x18')][_0xa21e('0x1c')],function(_0x455ddd){return{'model':db[_0x455ddd[_0xa21e('0x1d')]],'as':_0x455ddd['as'],'attributes':_0x455ddd['attributes'],'include':_0x455ddd['include']?_[_0xa21e('0x1e')](_0x455ddd[_0xa21e('0x1c')],function(_0x2b10f7){return{'model':db[_0x2b10f7[_0xa21e('0x1d')]],'as':_0x2b10f7['as'],'attributes':_0x2b10f7[_0xa21e('0x1a')],'include':_0x2b10f7[_0xa21e('0x1c')]?_[_0xa21e('0x1e')](_0x2b10f7[_0xa21e('0x1c')],function(_0x309314){return{'model':db[_0x309314[_0xa21e('0x1d')]],'as':_0x309314['as'],'attributes':_0x309314[_0xa21e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa21e('0xc')](function(_0x15d5f4){logger['info'](_0xa21e('0x20'),_0x2bb225);logger[_0xa21e('0xf')](_0xa21e('0x20'),_0x2bb225,JSON[_0xa21e('0x10')](_0x15d5f4));_0x558912(_0x15d5f4);})[_0xa21e('0x15')](function(_0x370804){logger[_0xa21e('0x11')](_0xa21e('0x20'),_0x370804[_0xa21e('0x14')],_0x2bb225);_0x1b451f(_0x44b174['error'](0x1f4,_0x370804['message']));});});}; \ No newline at end of file +var _0xd1aa=['request\x20sent','debug','stringify','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit','map','include','model','ShowSalesforceAccount','find','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','then','info','SalesforceAccount,\x20%s,\x20%s'];(function(_0x3cae69,_0x233c38){var _0x3128eb=function(_0x21d64e){while(--_0x21d64e){_0x3cae69['push'](_0x3cae69['shift']());}};_0x3128eb(++_0x233c38);}(_0xd1aa,0x13f));var _0xad1a=function(_0x5e32f3,_0x3386c1){_0x5e32f3=_0x5e32f3-0x0;var _0x4d4e03=_0xd1aa[_0x5e32f3];return _0x4d4e03;};'use strict';var _=require(_0xad1a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xad1a('0x1'));var rs=require(_0xad1a('0x2'));var fs=require('fs');var Redis=require(_0xad1a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xad1a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xad1a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xad1a('0x6')][_0xad1a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d17d9,_0x4694ca,_0x38a975){return new BPromise(function(_0x23f58d,_0x2352ee){return client['request'](_0x2d17d9,_0x38a975)[_0xad1a('0x8')](function(_0x4a6152){logger[_0xad1a('0x9')](_0xad1a('0xa'),_0x4694ca,_0xad1a('0xb'));logger[_0xad1a('0xc')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4694ca,_0xad1a('0xb'),JSON[_0xad1a('0xd')](_0x4a6152));if(_0x4a6152['error']){if(_0x4a6152[_0xad1a('0xe')]['code']===0x1f4){logger[_0xad1a('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x4694ca,_0x4a6152[_0xad1a('0xe')][_0xad1a('0xf')]);return _0x2352ee(_0x4a6152[_0xad1a('0xe')][_0xad1a('0xf')]);}logger[_0xad1a('0xe')](_0xad1a('0xa'),_0x4694ca,_0x4a6152[_0xad1a('0xe')][_0xad1a('0xf')]);return _0x23f58d(_0x4a6152[_0xad1a('0xe')][_0xad1a('0xf')]);}else{logger[_0xad1a('0x9')](_0xad1a('0xa'),_0x4694ca,_0xad1a('0xb'));_0x23f58d(_0x4a6152[_0xad1a('0x10')][_0xad1a('0xf')]);}})[_0xad1a('0x11')](function(_0x1217c6){logger[_0xad1a('0xe')](_0xad1a('0xa'),_0x4694ca,_0x1217c6);_0x2352ee(_0x1217c6);});});}exports[_0xad1a('0x12')]=function(_0x2365f6){var _0x361595=this;return new Promise(function(_0x1bc17f,_0x8e8387){return db[_0xad1a('0x13')]['findAll']({'raw':_0x2365f6[_0xad1a('0x14')]?_0x2365f6[_0xad1a('0x14')][_0xad1a('0x15')]===undefined?!![]:![]:!![],'where':_0x2365f6[_0xad1a('0x14')]?_0x2365f6[_0xad1a('0x14')][_0xad1a('0x16')]||null:null,'attributes':_0x2365f6[_0xad1a('0x14')]?_0x2365f6[_0xad1a('0x14')][_0xad1a('0x17')]||null:null,'limit':_0x2365f6[_0xad1a('0x14')]?_0x2365f6[_0xad1a('0x14')][_0xad1a('0x18')]||null:null,'include':_0x2365f6[_0xad1a('0x14')]?_0x2365f6[_0xad1a('0x14')]['include']?_[_0xad1a('0x19')](_0x2365f6[_0xad1a('0x14')][_0xad1a('0x1a')],function(_0x9ac8a){return{'model':db[_0x9ac8a[_0xad1a('0x1b')]],'as':_0x9ac8a['as'],'attributes':_0x9ac8a[_0xad1a('0x17')],'include':_0x9ac8a['include']?_[_0xad1a('0x19')](_0x9ac8a[_0xad1a('0x1a')],function(_0xabd28b){return{'model':db[_0xabd28b['model']],'as':_0xabd28b['as'],'attributes':_0xabd28b[_0xad1a('0x17')],'include':_0xabd28b[_0xad1a('0x1a')]?_[_0xad1a('0x19')](_0xabd28b[_0xad1a('0x1a')],function(_0x2b7abe){return{'model':db[_0x2b7abe[_0xad1a('0x1b')]],'as':_0x2b7abe['as'],'attributes':_0x2b7abe[_0xad1a('0x17')]};}):[]};}):[]};}):[]:[]})[_0xad1a('0x8')](function(_0x3c6098){logger[_0xad1a('0x9')](_0xad1a('0x12'),_0x2365f6);logger[_0xad1a('0xc')](_0xad1a('0x12'),_0x2365f6,JSON[_0xad1a('0xd')](_0x3c6098));_0x1bc17f(_0x3c6098);})[_0xad1a('0x11')](function(_0xc8fa6f){logger[_0xad1a('0xe')]('GetSalesforceAccount',_0xc8fa6f[_0xad1a('0xf')],_0x2365f6);_0x8e8387(_0x361595[_0xad1a('0xe')](0x1f4,_0xc8fa6f[_0xad1a('0xf')]));});});};exports[_0xad1a('0x1c')]=function(_0x2f507d){var _0xf8aabb=this;return new Promise(function(_0x4db406,_0x4ed2b5){return db['SalesforceAccount'][_0xad1a('0x1d')]({'raw':_0x2f507d['options']?_0x2f507d[_0xad1a('0x14')][_0xad1a('0x15')]===undefined?!![]:![]:!![],'where':_0x2f507d[_0xad1a('0x14')]?_0x2f507d['options']['where']||null:null,'attributes':_0x2f507d[_0xad1a('0x14')]?_0x2f507d[_0xad1a('0x14')][_0xad1a('0x17')]||null:null,'include':_0x2f507d[_0xad1a('0x14')]?_0x2f507d['options'][_0xad1a('0x1a')]?_['map'](_0x2f507d[_0xad1a('0x14')]['include'],function(_0x327b49){return{'model':db[_0x327b49['model']],'as':_0x327b49['as'],'attributes':_0x327b49['attributes'],'include':_0x327b49[_0xad1a('0x1a')]?_[_0xad1a('0x19')](_0x327b49[_0xad1a('0x1a')],function(_0x559142){return{'model':db[_0x559142['model']],'as':_0x559142['as'],'attributes':_0x559142[_0xad1a('0x17')],'include':_0x559142[_0xad1a('0x1a')]?_[_0xad1a('0x19')](_0x559142['include'],function(_0x1258e4){return{'model':db[_0x1258e4[_0xad1a('0x1b')]],'as':_0x1258e4['as'],'attributes':_0x1258e4[_0xad1a('0x17')]};}):[]};}):[]};}):[]:[]})[_0xad1a('0x8')](function(_0x1127f8){logger[_0xad1a('0x9')](_0xad1a('0x1c'),_0x2f507d);logger[_0xad1a('0xc')](_0xad1a('0x1c'),_0x2f507d,JSON[_0xad1a('0xd')](_0x1127f8));_0x4db406(_0x1127f8);})['catch'](function(_0x13d68e){logger[_0xad1a('0xe')](_0xad1a('0x1c'),_0x13d68e[_0xad1a('0xf')],_0x2f507d);_0x4ed2b5(_0xf8aabb[_0xad1a('0xe')](0x1f4,_0x13d68e[_0xad1a('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 16e9b1d..d757a3a 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x2268c0,_0x204830){var _0x49be14=function(_0x58744f){while(--_0x58744f){_0x2268c0['push'](_0x2268c0['shift']());}};_0x49be14(++_0x204830);}(_0x7a54,0x106));var _0x47a5=function(_0x3bdd04,_0x36943b){_0x3bdd04=_0x3bdd04-0x0;var _0x4e3e8e=_0x7a54[_0x3bdd04];return _0x4e3e8e;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file +var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x146325,_0x483762){var _0x3af4a7=function(_0x1d7d59){while(--_0x1d7d59){_0x146325['push'](_0x146325['shift']());}};_0x3af4a7(++_0x483762);}(_0xadb5,0xad));var _0x5adb=function(_0xced642,_0x1023d8){_0xced642=_0xced642-0x0;var _0x210591=_0xadb5[_0xced642];return _0x210591;};'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('./intSalesforceConfiguration.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['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 14fa45c..4fd615f 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 _0x22be=['exports','STRING','Task','ENUM','lead','account_contact_lead','account','contact_lead','contact','sequelize'];(function(_0x12723c,_0x148a5a){var _0x3fc804=function(_0x810da6){while(--_0x810da6){_0x12723c['push'](_0x12723c['shift']());}};_0x3fc804(++_0x148a5a);}(_0x22be,0x185));var _0xe22b=function(_0x81f000,_0x15df85){_0x81f000=_0x81f000-0x0;var _0x337aa2=_0x22be[_0x81f000];return _0x337aa2;};'use strict';var Sequelize=require(_0xe22b('0x0'));module[_0xe22b('0x1')]={'name':{'type':Sequelize[_0xe22b('0x2')]},'description':{'type':Sequelize[_0xe22b('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xe22b('0x3'),'Case'),'defaultValue':_0xe22b('0x3')},'moduleSearch':{'type':Sequelize[_0xe22b('0x4')]('contact_lead','contact',_0xe22b('0x5'),_0xe22b('0x6'),_0xe22b('0x7')),'defaultValue':_0xe22b('0x8')},'moduleCreate':{'type':Sequelize[_0xe22b('0x4')]('nothing',_0xe22b('0x9'),_0xe22b('0x5'),_0xe22b('0x7')),'defaultValue':_0xe22b('0x5')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xe22b('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xe22b('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xe22b('0x2')]}}; \ No newline at end of file +var _0xca88=['sequelize','STRING','ENUM','Task','Case','contact','contact_lead','lead','account'];(function(_0x1a9610,_0x501fc4){var _0x4d799f=function(_0x49fb9b){while(--_0x49fb9b){_0x1a9610['push'](_0x1a9610['shift']());}};_0x4d799f(++_0x501fc4);}(_0xca88,0x18c));var _0x8ca8=function(_0x570356,_0x190e47){_0x570356=_0x570356-0x0;var _0x4ff430=_0xca88[_0x570356];return _0x4ff430;};'use strict';var Sequelize=require(_0x8ca8('0x0'));module['exports']={'name':{'type':Sequelize[_0x8ca8('0x1')]},'description':{'type':Sequelize[_0x8ca8('0x1')]},'ticketType':{'type':Sequelize[_0x8ca8('0x2')](_0x8ca8('0x3'),_0x8ca8('0x4')),'defaultValue':_0x8ca8('0x3')},'moduleSearch':{'type':Sequelize[_0x8ca8('0x2')]('contact_lead',_0x8ca8('0x5'),'lead','account_contact_lead','account'),'defaultValue':_0x8ca8('0x6')},'moduleCreate':{'type':Sequelize[_0x8ca8('0x2')]('nothing','contact',_0x8ca8('0x7'),_0x8ca8('0x8')),'defaultValue':'lead'},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x8ca8('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x8ca8('0x1')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 81c9536..81732ff 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 _0x24ca=['fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','SalesforceConfiguration','includeAll','findAll','catch','show','params','keys','include','options','find','create','body','getFields','pick','hasOwnProperty','getSubjects','SalesforceField','getDescriptions','findOne','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','query','filters','intersection','model'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x24ca,0x1bc));var _0xa24c=function(_0x1f6f84,_0x2bab55){_0x1f6f84=_0x1f6f84-0x0;var _0x177f40=_0x24ca[_0x1f6f84];return _0x177f40;};'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['SalesforceConfiguration'][_0xa24c('0x2f')],function(_0x3dcb1b){return{'name':_0x3dcb1b[_0xa24c('0x30')],'type':_0x3dcb1b['type'][_0xa24c('0x31')]};});_0x5e491e['model']=_[_0xa24c('0x2e')](_0xc96ce7,_0xa24c('0x2c'));_0x5e491e[_0xa24c('0x32')]=_['keys'](_0x28675f[_0xa24c('0x32')]);_0x5e491e[_0xa24c('0x33')]=_[_0xa24c('0x34')](_0x5e491e['model'],_0x5e491e[_0xa24c('0x32')]);_0x12dbdc['attributes']=_[_0xa24c('0x34')](_0x5e491e[_0xa24c('0x35')],qs['fields'](_0x28675f['query'][_0xa24c('0x36')]));_0x12dbdc[_0xa24c('0x37')]=_0x12dbdc[_0xa24c('0x37')][_0xa24c('0x38')]?_0x12dbdc[_0xa24c('0x37')]:_0x5e491e[_0xa24c('0x35')];if(!_0x28675f[_0xa24c('0x32')]['hasOwnProperty'](_0xa24c('0x39'))){_0x12dbdc[_0xa24c('0x1e')]=qs[_0xa24c('0x1e')](_0x28675f[_0xa24c('0x32')][_0xa24c('0x1e')]);_0x12dbdc[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x28675f[_0xa24c('0x32')][_0xa24c('0x21')]);}_0x12dbdc[_0xa24c('0x3a')]=qs['sort'](_0x28675f[_0xa24c('0x32')][_0xa24c('0x3b')]);_0x12dbdc[_0xa24c('0x3c')]=qs[_0xa24c('0x33')](_['pick'](_0x28675f['query'],_0x5e491e[_0xa24c('0x33')]),_0xc96ce7);if(_0x28675f['query'][_0xa24c('0x3d')]){_0x12dbdc[_0xa24c('0x3c')]=_[_0xa24c('0x3e')](_0x12dbdc[_0xa24c('0x3c')],{'$or':_[_0xa24c('0x2e')](_0xc96ce7,function(_0x4c0fb9){if(_0x4c0fb9['type']!==_0xa24c('0x3f')){var _0xc661c7={};_0xc661c7[_0x4c0fb9[_0xa24c('0x2c')]]={'$like':'%'+_0x28675f[_0xa24c('0x32')][_0xa24c('0x3d')]+'%'};return _0xc661c7;}})});}_0x12dbdc=_[_0xa24c('0x3e')]({},_0x12dbdc,_0x28675f['options']);var _0x56f392={'where':_0x12dbdc[_0xa24c('0x3c')]};return db[_0xa24c('0x40')][_0xa24c('0x20')](_0x56f392)[_0xa24c('0x27')](function(_0x43beff){_0x21d2a8['count']=_0x43beff;if(_0x28675f[_0xa24c('0x32')][_0xa24c('0x41')]){_0x12dbdc['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xa24c('0x42')](_0x12dbdc);})[_0xa24c('0x27')](function(_0x231eea){_0x21d2a8['rows']=_0x231eea;return _0x21d2a8;})['then'](respondWithFilteredResult(_0x152120,_0x12dbdc))[_0xa24c('0x43')](handleError(_0x152120,null));};exports[_0xa24c('0x44')]=function(_0x31048c,_0x3ccc37){var _0x3f640e={'raw':![],'where':{'id':_0x31048c[_0xa24c('0x45')]['id']}},_0x1b7faf={};_0x1b7faf[_0xa24c('0x35')]=_['keys'](db['SalesforceConfiguration'][_0xa24c('0x2f')]);_0x1b7faf[_0xa24c('0x32')]=_[_0xa24c('0x46')](_0x31048c['query']);_0x1b7faf[_0xa24c('0x33')]=_[_0xa24c('0x34')](_0x1b7faf[_0xa24c('0x35')],_0x1b7faf[_0xa24c('0x32')]);_0x3f640e[_0xa24c('0x37')]=_[_0xa24c('0x34')](_0x1b7faf[_0xa24c('0x35')],qs[_0xa24c('0x36')](_0x31048c[_0xa24c('0x32')][_0xa24c('0x36')]));_0x3f640e['attributes']=_0x3f640e[_0xa24c('0x37')][_0xa24c('0x38')]?_0x3f640e[_0xa24c('0x37')]:_0x1b7faf['model'];if(_0x31048c[_0xa24c('0x32')][_0xa24c('0x41')]){_0x3f640e[_0xa24c('0x47')]=[{'all':!![]}];}_0x3f640e=_[_0xa24c('0x3e')]({},_0x3f640e,_0x31048c[_0xa24c('0x48')]);return db[_0xa24c('0x40')][_0xa24c('0x49')](_0x3f640e)[_0xa24c('0x27')](handleEntityNotFound(_0x3ccc37,null))[_0xa24c('0x27')](respondWithResult(_0x3ccc37,null))[_0xa24c('0x43')](handleError(_0x3ccc37,null));};exports[_0xa24c('0x4a')]=function(_0x54dc72,_0x29a84d){return db[_0xa24c('0x40')][_0xa24c('0x4a')](_0x54dc72[_0xa24c('0x4b')],{})[_0xa24c('0x27')](respondWithResult(_0x29a84d,0xc9))[_0xa24c('0x43')](handleError(_0x29a84d,null));};exports[_0xa24c('0x26')]=function(_0x2250b9,_0x184179){if(_0x2250b9['body']['id']){delete _0x2250b9['body']['id'];}return db[_0xa24c('0x40')]['find']({'where':{'id':_0x2250b9[_0xa24c('0x45')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x184179,null))['then'](saveUpdates(_0x2250b9[_0xa24c('0x4b')],null))[_0xa24c('0x27')](respondWithResult(_0x184179,null))[_0xa24c('0x43')](handleError(_0x184179,null));};exports['destroy']=function(_0x55978e,_0x87347c){return db['SalesforceConfiguration'][_0xa24c('0x49')]({'where':{'id':_0x55978e[_0xa24c('0x45')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x87347c,null))[_0xa24c('0x27')](removeEntity(_0x87347c,null))[_0xa24c('0x43')](handleError(_0x87347c,null));};exports[_0xa24c('0x4c')]=function(_0x3f3ce6,_0x286d57,_0x22a0db){var _0xf3498c={};var _0x4ea43d={};var _0xfe488c;var _0x2759c1;return db[_0xa24c('0x40')]['findOne']({'where':{'id':_0x3f3ce6['params']['id']}})['then'](handleEntityNotFound(_0x286d57,null))[_0xa24c('0x27')](function(_0x5c2367){if(_0x5c2367){_0xfe488c=_0x5c2367;_0x4ea43d[_0xa24c('0x35')]=_[_0xa24c('0x46')](db['SalesforceField'][_0xa24c('0x2f')]);_0x4ea43d[_0xa24c('0x32')]=_[_0xa24c('0x46')](_0x3f3ce6[_0xa24c('0x32')]);_0x4ea43d[_0xa24c('0x33')]=_[_0xa24c('0x34')](_0x4ea43d[_0xa24c('0x35')],_0x4ea43d[_0xa24c('0x32')]);_0xf3498c['attributes']=_[_0xa24c('0x34')](_0x4ea43d['model'],qs['fields'](_0x3f3ce6['query']['fields']));_0xf3498c['attributes']=_0xf3498c[_0xa24c('0x37')]['length']?_0xf3498c[_0xa24c('0x37')]:_0x4ea43d[_0xa24c('0x35')];_0xf3498c[_0xa24c('0x3a')]=qs[_0xa24c('0x3b')](_0x3f3ce6[_0xa24c('0x32')][_0xa24c('0x3b')]);_0xf3498c[_0xa24c('0x3c')]=qs[_0xa24c('0x33')](_[_0xa24c('0x4d')](_0x3f3ce6[_0xa24c('0x32')],_0x4ea43d[_0xa24c('0x33')]));if(_0x3f3ce6[_0xa24c('0x32')][_0xa24c('0x3d')]){_0xf3498c[_0xa24c('0x3c')]=_[_0xa24c('0x3e')](_0xf3498c['where'],{'$or':_[_0xa24c('0x2e')](_0xf3498c[_0xa24c('0x37')],function(_0x5264a7){var _0x1e08bb={};_0x1e08bb[_0x5264a7]={'$like':'%'+_0x3f3ce6[_0xa24c('0x32')][_0xa24c('0x3d')]+'%'};return _0x1e08bb;})});}_0xf3498c=_[_0xa24c('0x3e')]({},_0xf3498c,_0x3f3ce6['options']);return _0xfe488c['getFields'](_0xf3498c);}})[_0xa24c('0x27')](function(_0x5e9631){if(_0x5e9631){_0x2759c1=_0x5e9631['length'];if(!_0x3f3ce6[_0xa24c('0x32')][_0xa24c('0x4e')](_0xa24c('0x39'))){_0xf3498c[_0xa24c('0x1e')]=qs['limit'](_0x3f3ce6['query'][_0xa24c('0x1e')]);_0xf3498c['offset']=qs['offset'](_0x3f3ce6[_0xa24c('0x32')][_0xa24c('0x21')]);}return _0xfe488c[_0xa24c('0x4c')](_0xf3498c);}})['then'](function(_0x2fbc8b){if(_0x2fbc8b){return _0x2fbc8b?{'count':_0x2759c1,'rows':_0x2fbc8b}:null;}})[_0xa24c('0x27')](respondWithResult(_0x286d57,null))['catch'](handleError(_0x286d57,null));};exports[_0xa24c('0x4f')]=function(_0x3f306d,_0x3096bf,_0x4bee5c){var _0x1e6be9={};var _0x34e261={};var _0x21439a;var _0x7aab6e;return db[_0xa24c('0x40')]['findOne']({'where':{'id':_0x3f306d[_0xa24c('0x45')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x3096bf,null))[_0xa24c('0x27')](function(_0x3aa9da){if(_0x3aa9da){_0x21439a=_0x3aa9da;_0x34e261[_0xa24c('0x35')]=_[_0xa24c('0x46')](db[_0xa24c('0x50')]['rawAttributes']);_0x34e261[_0xa24c('0x32')]=_[_0xa24c('0x46')](_0x3f306d['query']);_0x34e261[_0xa24c('0x33')]=_[_0xa24c('0x34')](_0x34e261[_0xa24c('0x35')],_0x34e261[_0xa24c('0x32')]);_0x1e6be9[_0xa24c('0x37')]=_[_0xa24c('0x34')](_0x34e261[_0xa24c('0x35')],qs[_0xa24c('0x36')](_0x3f306d[_0xa24c('0x32')][_0xa24c('0x36')]));_0x1e6be9['attributes']=_0x1e6be9[_0xa24c('0x37')][_0xa24c('0x38')]?_0x1e6be9[_0xa24c('0x37')]:_0x34e261['model'];_0x1e6be9[_0xa24c('0x3a')]=qs[_0xa24c('0x3b')](_0x3f306d[_0xa24c('0x32')]['sort']);_0x1e6be9[_0xa24c('0x3c')]=qs[_0xa24c('0x33')](_[_0xa24c('0x4d')](_0x3f306d[_0xa24c('0x32')],_0x34e261[_0xa24c('0x33')]));if(_0x3f306d[_0xa24c('0x32')]['filter']){_0x1e6be9['where']=_[_0xa24c('0x3e')](_0x1e6be9['where'],{'$or':_[_0xa24c('0x2e')](_0x1e6be9[_0xa24c('0x37')],function(_0x26427c){var _0x4073c5={};_0x4073c5[_0x26427c]={'$like':'%'+_0x3f306d[_0xa24c('0x32')]['filter']+'%'};return _0x4073c5;})});}_0x1e6be9=_[_0xa24c('0x3e')]({},_0x1e6be9,_0x3f306d[_0xa24c('0x48')]);return _0x21439a[_0xa24c('0x4f')](_0x1e6be9);}})[_0xa24c('0x27')](function(_0x987aca){if(_0x987aca){_0x7aab6e=_0x987aca[_0xa24c('0x38')];if(!_0x3f306d['query'][_0xa24c('0x4e')](_0xa24c('0x39'))){_0x1e6be9[_0xa24c('0x1e')]=qs[_0xa24c('0x1e')](_0x3f306d['query'][_0xa24c('0x1e')]);_0x1e6be9['offset']=qs[_0xa24c('0x21')](_0x3f306d[_0xa24c('0x32')][_0xa24c('0x21')]);}return _0x21439a[_0xa24c('0x4f')](_0x1e6be9);}})['then'](function(_0x2e612d){if(_0x2e612d){return _0x2e612d?{'count':_0x7aab6e,'rows':_0x2e612d}:null;}})[_0xa24c('0x27')](respondWithResult(_0x3096bf,null))['catch'](handleError(_0x3096bf,null));};exports[_0xa24c('0x51')]=function(_0x168a8b,_0x135cef,_0x3e0c08){var _0x8bd3fb={};var _0x288cb7={};var _0x271647;var _0x37089c;return db['SalesforceConfiguration'][_0xa24c('0x52')]({'where':{'id':_0x168a8b[_0xa24c('0x45')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x135cef,null))[_0xa24c('0x27')](function(_0x120544){if(_0x120544){_0x271647=_0x120544;_0x288cb7[_0xa24c('0x35')]=_[_0xa24c('0x46')](db[_0xa24c('0x50')][_0xa24c('0x2f')]);_0x288cb7[_0xa24c('0x32')]=_[_0xa24c('0x46')](_0x168a8b['query']);_0x288cb7[_0xa24c('0x33')]=_[_0xa24c('0x34')](_0x288cb7['model'],_0x288cb7[_0xa24c('0x32')]);_0x8bd3fb[_0xa24c('0x37')]=_[_0xa24c('0x34')](_0x288cb7['model'],qs['fields'](_0x168a8b[_0xa24c('0x32')][_0xa24c('0x36')]));_0x8bd3fb['attributes']=_0x8bd3fb[_0xa24c('0x37')][_0xa24c('0x38')]?_0x8bd3fb[_0xa24c('0x37')]:_0x288cb7[_0xa24c('0x35')];_0x8bd3fb[_0xa24c('0x3a')]=qs[_0xa24c('0x3b')](_0x168a8b['query']['sort']);_0x8bd3fb['where']=qs[_0xa24c('0x33')](_['pick'](_0x168a8b['query'],_0x288cb7[_0xa24c('0x33')]));if(_0x168a8b[_0xa24c('0x32')][_0xa24c('0x3d')]){_0x8bd3fb[_0xa24c('0x3c')]=_[_0xa24c('0x3e')](_0x8bd3fb[_0xa24c('0x3c')],{'$or':_[_0xa24c('0x2e')](_0x8bd3fb[_0xa24c('0x37')],function(_0x2544fc){var _0x4ee10d={};_0x4ee10d[_0x2544fc]={'$like':'%'+_0x168a8b[_0xa24c('0x32')][_0xa24c('0x3d')]+'%'};return _0x4ee10d;})});}_0x8bd3fb=_[_0xa24c('0x3e')]({},_0x8bd3fb,_0x168a8b[_0xa24c('0x48')]);return _0x271647[_0xa24c('0x51')](_0x8bd3fb);}})[_0xa24c('0x27')](function(_0x8aabc1){if(_0x8aabc1){_0x37089c=_0x8aabc1[_0xa24c('0x38')];if(!_0x168a8b[_0xa24c('0x32')][_0xa24c('0x4e')](_0xa24c('0x39'))){_0x8bd3fb[_0xa24c('0x1e')]=qs['limit'](_0x168a8b[_0xa24c('0x32')][_0xa24c('0x1e')]);_0x8bd3fb['offset']=qs[_0xa24c('0x21')](_0x168a8b[_0xa24c('0x32')][_0xa24c('0x21')]);}return _0x271647['getDescriptions'](_0x8bd3fb);}})[_0xa24c('0x27')](function(_0x4420c3){if(_0x4420c3){return _0x4420c3?{'count':_0x37089c,'rows':_0x4420c3}:null;}})['then'](respondWithResult(_0x135cef,null))[_0xa24c('0x43')](handleError(_0x135cef,null));}; \ No newline at end of file +var _0x6dec=['attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','SalesforceConfiguration','rows','catch','show','params','fields','find','create','body','getFields','findOne','SalesforceField','order','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x6dec,0x10e));var _0xc6de=function(_0x319300,_0xb5ba0){_0x319300=_0x319300-0x0;var _0x1eb168=_0x6dec[_0x319300];return _0x1eb168;};'use strict';var emlformat=require(_0xc6de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc6de('0x1'));var jsonpatch=require(_0xc6de('0x2'));var rp=require(_0xc6de('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc6de('0x4'));var util=require(_0xc6de('0x5'));var path=require(_0xc6de('0x6'));var sox=require(_0xc6de('0x7'));var csv=require(_0xc6de('0x8'));var ejs=require(_0xc6de('0x9'));var fs=require('fs');var fs_extra=require(_0xc6de('0xa'));var _=require(_0xc6de('0xb'));var squel=require(_0xc6de('0xc'));var crypto=require(_0xc6de('0xd'));var jsforce=require(_0xc6de('0xe'));var deskjs=require(_0xc6de('0xf'));var toCsv=require(_0xc6de('0x8'));var querystring=require(_0xc6de('0x10'));var Papa=require(_0xc6de('0x11'));var Redis=require(_0xc6de('0x12'));var authService=require(_0xc6de('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc6de('0x14'));var hardwareService=require(_0xc6de('0x15'));var logger=require(_0xc6de('0x16'))(_0xc6de('0x17'));var utils=require(_0xc6de('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc6de('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ef333,_0x33a17a){_0x33a17a=_0x33a17a||0xcc;return function(_0x62c56d){if(_0x62c56d){return _0x5ef333[_0xc6de('0x1a')](_0x33a17a);}return _0x5ef333[_0xc6de('0x1b')](_0x33a17a)[_0xc6de('0x1c')]();};}function respondWithResult(_0x389d41,_0x236d06){_0x236d06=_0x236d06||0xc8;return function(_0x526079){if(_0x526079){return _0x389d41[_0xc6de('0x1b')](_0x236d06)[_0xc6de('0x1d')](_0x526079);}};}function respondWithFilteredResult(_0xf6398c,_0x2d3109){return function(_0x53fba0){if(_0x53fba0){var _0x290cee=typeof _0x2d3109[_0xc6de('0x1e')]===_0xc6de('0x1f')&&typeof _0x2d3109[_0xc6de('0x20')]==='undefined';var _0x51adca=_0x53fba0['count'];var _0x5a3a05=_0x290cee?0x0:_0x2d3109[_0xc6de('0x1e')];var _0x66e8e6=_0x290cee?_0x53fba0[_0xc6de('0x21')]:_0x2d3109[_0xc6de('0x1e')]+_0x2d3109[_0xc6de('0x20')];var _0x350b49;if(_0x66e8e6>=_0x51adca){_0x66e8e6=_0x51adca;_0x350b49=0xc8;}else{_0x350b49=0xce;}_0xf6398c['status'](_0x350b49);return _0xf6398c[_0xc6de('0x22')](_0xc6de('0x23'),_0x5a3a05+'-'+_0x66e8e6+'/'+_0x51adca)[_0xc6de('0x1d')](_0x53fba0);}return null;};}function patchUpdates(_0x554a95){return function(_0x4189d3){try{jsonpatch[_0xc6de('0x24')](_0x4189d3,_0x554a95,!![]);}catch(_0x5d311e){return BPromise[_0xc6de('0x25')](_0x5d311e);}return _0x4189d3[_0xc6de('0x26')]();};}function saveUpdates(_0x1ec0b3,_0x5a3b08){return function(_0x275006){if(_0x275006){return _0x275006[_0xc6de('0x27')](_0x1ec0b3)['then'](function(_0x57343e){return _0x57343e;});}return null;};}function removeEntity(_0x46354b,_0x1d0725){return function(_0x4f5222){if(_0x4f5222){return _0x4f5222[_0xc6de('0x28')]()[_0xc6de('0x29')](function(){_0x46354b[_0xc6de('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe3b2a5,_0x5deff3){return function(_0x318947){if(!_0x318947){_0xe3b2a5[_0xc6de('0x1a')](0x194);}return _0x318947;};}function handleError(_0x2c1d86,_0x225eb2){_0x225eb2=_0x225eb2||0x1f4;return function(_0x231d6a){logger['error'](_0x231d6a[_0xc6de('0x2a')]);if(_0x231d6a[_0xc6de('0x2b')]){delete _0x231d6a[_0xc6de('0x2b')];}_0x2c1d86[_0xc6de('0x1b')](_0x225eb2)[_0xc6de('0x2c')](_0x231d6a);};}exports['index']=function(_0x44399b,_0x251465){var _0x3fb811={},_0x33d132={},_0x422c2d={'count':0x0,'rows':[]};var _0x1e8617=_[_0xc6de('0x2d')](db['SalesforceConfiguration'][_0xc6de('0x2e')],function(_0x30d94c){return{'name':_0x30d94c[_0xc6de('0x2f')],'type':_0x30d94c[_0xc6de('0x30')]['key']};});_0x33d132[_0xc6de('0x31')]=_[_0xc6de('0x2d')](_0x1e8617,_0xc6de('0x2b'));_0x33d132[_0xc6de('0x32')]=_[_0xc6de('0x33')](_0x44399b[_0xc6de('0x32')]);_0x33d132[_0xc6de('0x34')]=_[_0xc6de('0x35')](_0x33d132[_0xc6de('0x31')],_0x33d132[_0xc6de('0x32')]);_0x3fb811[_0xc6de('0x36')]=_[_0xc6de('0x35')](_0x33d132['model'],qs['fields'](_0x44399b[_0xc6de('0x32')]['fields']));_0x3fb811[_0xc6de('0x36')]=_0x3fb811[_0xc6de('0x36')][_0xc6de('0x37')]?_0x3fb811[_0xc6de('0x36')]:_0x33d132['model'];if(!_0x44399b[_0xc6de('0x32')][_0xc6de('0x38')](_0xc6de('0x39'))){_0x3fb811['limit']=qs[_0xc6de('0x20')](_0x44399b[_0xc6de('0x32')][_0xc6de('0x20')]);_0x3fb811[_0xc6de('0x1e')]=qs[_0xc6de('0x1e')](_0x44399b['query'][_0xc6de('0x1e')]);}_0x3fb811['order']=qs[_0xc6de('0x3a')](_0x44399b[_0xc6de('0x32')][_0xc6de('0x3a')]);_0x3fb811[_0xc6de('0x3b')]=qs['filters'](_[_0xc6de('0x3c')](_0x44399b[_0xc6de('0x32')],_0x33d132[_0xc6de('0x34')]),_0x1e8617);if(_0x44399b[_0xc6de('0x32')][_0xc6de('0x3d')]){_0x3fb811[_0xc6de('0x3b')]=_[_0xc6de('0x3e')](_0x3fb811[_0xc6de('0x3b')],{'$or':_[_0xc6de('0x2d')](_0x1e8617,function(_0x463876){if(_0x463876['type']!=='VIRTUAL'){var _0x57f5b9={};_0x57f5b9[_0x463876[_0xc6de('0x2b')]]={'$like':'%'+_0x44399b[_0xc6de('0x32')][_0xc6de('0x3d')]+'%'};return _0x57f5b9;}})});}_0x3fb811=_[_0xc6de('0x3e')]({},_0x3fb811,_0x44399b[_0xc6de('0x3f')]);var _0x12413e={'where':_0x3fb811['where']};return db['SalesforceConfiguration'][_0xc6de('0x21')](_0x12413e)[_0xc6de('0x29')](function(_0x382e75){_0x422c2d[_0xc6de('0x21')]=_0x382e75;if(_0x44399b[_0xc6de('0x32')][_0xc6de('0x40')]){_0x3fb811[_0xc6de('0x41')]=[{'all':!![]}];}return db[_0xc6de('0x42')]['findAll'](_0x3fb811);})[_0xc6de('0x29')](function(_0x5068eb){_0x422c2d[_0xc6de('0x43')]=_0x5068eb;return _0x422c2d;})[_0xc6de('0x29')](respondWithFilteredResult(_0x251465,_0x3fb811))[_0xc6de('0x44')](handleError(_0x251465,null));};exports[_0xc6de('0x45')]=function(_0x516e1e,_0x167451){var _0x1484bd={'raw':![],'where':{'id':_0x516e1e[_0xc6de('0x46')]['id']}},_0x4ec271={};_0x4ec271[_0xc6de('0x31')]=_[_0xc6de('0x33')](db['SalesforceConfiguration']['rawAttributes']);_0x4ec271['query']=_['keys'](_0x516e1e[_0xc6de('0x32')]);_0x4ec271[_0xc6de('0x34')]=_[_0xc6de('0x35')](_0x4ec271[_0xc6de('0x31')],_0x4ec271['query']);_0x1484bd['attributes']=_['intersection'](_0x4ec271[_0xc6de('0x31')],qs[_0xc6de('0x47')](_0x516e1e[_0xc6de('0x32')][_0xc6de('0x47')]));_0x1484bd[_0xc6de('0x36')]=_0x1484bd[_0xc6de('0x36')][_0xc6de('0x37')]?_0x1484bd[_0xc6de('0x36')]:_0x4ec271[_0xc6de('0x31')];if(_0x516e1e[_0xc6de('0x32')]['includeAll']){_0x1484bd['include']=[{'all':!![]}];}_0x1484bd=_['merge']({},_0x1484bd,_0x516e1e[_0xc6de('0x3f')]);return db['SalesforceConfiguration'][_0xc6de('0x48')](_0x1484bd)[_0xc6de('0x29')](handleEntityNotFound(_0x167451,null))[_0xc6de('0x29')](respondWithResult(_0x167451,null))[_0xc6de('0x44')](handleError(_0x167451,null));};exports[_0xc6de('0x49')]=function(_0x33102c,_0x5a6e34){return db['SalesforceConfiguration'][_0xc6de('0x49')](_0x33102c['body'],{})[_0xc6de('0x29')](respondWithResult(_0x5a6e34,0xc9))['catch'](handleError(_0x5a6e34,null));};exports['update']=function(_0x3fa301,_0x4636e6){if(_0x3fa301[_0xc6de('0x4a')]['id']){delete _0x3fa301['body']['id'];}return db[_0xc6de('0x42')][_0xc6de('0x48')]({'where':{'id':_0x3fa301[_0xc6de('0x46')]['id']}})['then'](handleEntityNotFound(_0x4636e6,null))[_0xc6de('0x29')](saveUpdates(_0x3fa301[_0xc6de('0x4a')],null))[_0xc6de('0x29')](respondWithResult(_0x4636e6,null))[_0xc6de('0x44')](handleError(_0x4636e6,null));};exports[_0xc6de('0x28')]=function(_0x53587f,_0x58891f){return db[_0xc6de('0x42')]['find']({'where':{'id':_0x53587f['params']['id']}})[_0xc6de('0x29')](handleEntityNotFound(_0x58891f,null))[_0xc6de('0x29')](removeEntity(_0x58891f,null))[_0xc6de('0x44')](handleError(_0x58891f,null));};exports[_0xc6de('0x4b')]=function(_0x2b82fe,_0x36f95b,_0x72593a){var _0x17ca57={};var _0x47519c={};var _0x136df8;var _0x39a327;return db['SalesforceConfiguration'][_0xc6de('0x4c')]({'where':{'id':_0x2b82fe[_0xc6de('0x46')]['id']}})['then'](handleEntityNotFound(_0x36f95b,null))[_0xc6de('0x29')](function(_0xebc35e){if(_0xebc35e){_0x136df8=_0xebc35e;_0x47519c[_0xc6de('0x31')]=_['keys'](db[_0xc6de('0x4d')][_0xc6de('0x2e')]);_0x47519c['query']=_[_0xc6de('0x33')](_0x2b82fe[_0xc6de('0x32')]);_0x47519c[_0xc6de('0x34')]=_[_0xc6de('0x35')](_0x47519c[_0xc6de('0x31')],_0x47519c['query']);_0x17ca57[_0xc6de('0x36')]=_[_0xc6de('0x35')](_0x47519c['model'],qs[_0xc6de('0x47')](_0x2b82fe[_0xc6de('0x32')][_0xc6de('0x47')]));_0x17ca57[_0xc6de('0x36')]=_0x17ca57[_0xc6de('0x36')]['length']?_0x17ca57[_0xc6de('0x36')]:_0x47519c[_0xc6de('0x31')];_0x17ca57[_0xc6de('0x4e')]=qs[_0xc6de('0x3a')](_0x2b82fe[_0xc6de('0x32')]['sort']);_0x17ca57[_0xc6de('0x3b')]=qs['filters'](_[_0xc6de('0x3c')](_0x2b82fe[_0xc6de('0x32')],_0x47519c[_0xc6de('0x34')]));if(_0x2b82fe['query']['filter']){_0x17ca57[_0xc6de('0x3b')]=_['merge'](_0x17ca57[_0xc6de('0x3b')],{'$or':_['map'](_0x17ca57['attributes'],function(_0x4659b9){var _0x2988e3={};_0x2988e3[_0x4659b9]={'$like':'%'+_0x2b82fe[_0xc6de('0x32')]['filter']+'%'};return _0x2988e3;})});}_0x17ca57=_[_0xc6de('0x3e')]({},_0x17ca57,_0x2b82fe['options']);return _0x136df8[_0xc6de('0x4b')](_0x17ca57);}})['then'](function(_0x53bad0){if(_0x53bad0){_0x39a327=_0x53bad0[_0xc6de('0x37')];if(!_0x2b82fe[_0xc6de('0x32')][_0xc6de('0x38')](_0xc6de('0x39'))){_0x17ca57[_0xc6de('0x20')]=qs['limit'](_0x2b82fe[_0xc6de('0x32')][_0xc6de('0x20')]);_0x17ca57[_0xc6de('0x1e')]=qs[_0xc6de('0x1e')](_0x2b82fe[_0xc6de('0x32')]['offset']);}return _0x136df8[_0xc6de('0x4b')](_0x17ca57);}})[_0xc6de('0x29')](function(_0x496e04){if(_0x496e04){return _0x496e04?{'count':_0x39a327,'rows':_0x496e04}:null;}})[_0xc6de('0x29')](respondWithResult(_0x36f95b,null))[_0xc6de('0x44')](handleError(_0x36f95b,null));};exports['getSubjects']=function(_0x4fc735,_0x560592,_0x4b5e1d){var _0x3c74aa={};var _0x5d2ef5={};var _0x23b167;var _0x37b363;return db[_0xc6de('0x42')][_0xc6de('0x4c')]({'where':{'id':_0x4fc735['params']['id']}})[_0xc6de('0x29')](handleEntityNotFound(_0x560592,null))['then'](function(_0x19eb34){if(_0x19eb34){_0x23b167=_0x19eb34;_0x5d2ef5[_0xc6de('0x31')]=_[_0xc6de('0x33')](db[_0xc6de('0x4d')][_0xc6de('0x2e')]);_0x5d2ef5[_0xc6de('0x32')]=_[_0xc6de('0x33')](_0x4fc735[_0xc6de('0x32')]);_0x5d2ef5[_0xc6de('0x34')]=_['intersection'](_0x5d2ef5[_0xc6de('0x31')],_0x5d2ef5[_0xc6de('0x32')]);_0x3c74aa[_0xc6de('0x36')]=_[_0xc6de('0x35')](_0x5d2ef5[_0xc6de('0x31')],qs['fields'](_0x4fc735['query'][_0xc6de('0x47')]));_0x3c74aa[_0xc6de('0x36')]=_0x3c74aa[_0xc6de('0x36')][_0xc6de('0x37')]?_0x3c74aa['attributes']:_0x5d2ef5[_0xc6de('0x31')];_0x3c74aa[_0xc6de('0x4e')]=qs[_0xc6de('0x3a')](_0x4fc735[_0xc6de('0x32')]['sort']);_0x3c74aa[_0xc6de('0x3b')]=qs['filters'](_[_0xc6de('0x3c')](_0x4fc735[_0xc6de('0x32')],_0x5d2ef5[_0xc6de('0x34')]));if(_0x4fc735['query'][_0xc6de('0x3d')]){_0x3c74aa[_0xc6de('0x3b')]=_['merge'](_0x3c74aa[_0xc6de('0x3b')],{'$or':_[_0xc6de('0x2d')](_0x3c74aa['attributes'],function(_0x2adff8){var _0x3587bd={};_0x3587bd[_0x2adff8]={'$like':'%'+_0x4fc735[_0xc6de('0x32')][_0xc6de('0x3d')]+'%'};return _0x3587bd;})});}_0x3c74aa=_[_0xc6de('0x3e')]({},_0x3c74aa,_0x4fc735[_0xc6de('0x3f')]);return _0x23b167[_0xc6de('0x4f')](_0x3c74aa);}})[_0xc6de('0x29')](function(_0x359a80){if(_0x359a80){_0x37b363=_0x359a80[_0xc6de('0x37')];if(!_0x4fc735[_0xc6de('0x32')]['hasOwnProperty'](_0xc6de('0x39'))){_0x3c74aa[_0xc6de('0x20')]=qs[_0xc6de('0x20')](_0x4fc735[_0xc6de('0x32')][_0xc6de('0x20')]);_0x3c74aa[_0xc6de('0x1e')]=qs[_0xc6de('0x1e')](_0x4fc735[_0xc6de('0x32')]['offset']);}return _0x23b167[_0xc6de('0x4f')](_0x3c74aa);}})[_0xc6de('0x29')](function(_0x34e94f){if(_0x34e94f){return _0x34e94f?{'count':_0x37b363,'rows':_0x34e94f}:null;}})[_0xc6de('0x29')](respondWithResult(_0x560592,null))[_0xc6de('0x44')](handleError(_0x560592,null));};exports['getDescriptions']=function(_0x51d483,_0x42a134,_0x5f23a0){var _0x3e1632={};var _0x401d0b={};var _0x4b48aa;var _0x4bc060;return db[_0xc6de('0x42')][_0xc6de('0x4c')]({'where':{'id':_0x51d483[_0xc6de('0x46')]['id']}})[_0xc6de('0x29')](handleEntityNotFound(_0x42a134,null))[_0xc6de('0x29')](function(_0x3d99a0){if(_0x3d99a0){_0x4b48aa=_0x3d99a0;_0x401d0b[_0xc6de('0x31')]=_[_0xc6de('0x33')](db[_0xc6de('0x4d')][_0xc6de('0x2e')]);_0x401d0b[_0xc6de('0x32')]=_[_0xc6de('0x33')](_0x51d483[_0xc6de('0x32')]);_0x401d0b[_0xc6de('0x34')]=_[_0xc6de('0x35')](_0x401d0b[_0xc6de('0x31')],_0x401d0b['query']);_0x3e1632['attributes']=_[_0xc6de('0x35')](_0x401d0b[_0xc6de('0x31')],qs[_0xc6de('0x47')](_0x51d483[_0xc6de('0x32')]['fields']));_0x3e1632[_0xc6de('0x36')]=_0x3e1632['attributes'][_0xc6de('0x37')]?_0x3e1632[_0xc6de('0x36')]:_0x401d0b[_0xc6de('0x31')];_0x3e1632[_0xc6de('0x4e')]=qs['sort'](_0x51d483[_0xc6de('0x32')][_0xc6de('0x3a')]);_0x3e1632[_0xc6de('0x3b')]=qs['filters'](_[_0xc6de('0x3c')](_0x51d483[_0xc6de('0x32')],_0x401d0b[_0xc6de('0x34')]));if(_0x51d483[_0xc6de('0x32')][_0xc6de('0x3d')]){_0x3e1632[_0xc6de('0x3b')]=_[_0xc6de('0x3e')](_0x3e1632['where'],{'$or':_['map'](_0x3e1632[_0xc6de('0x36')],function(_0x400cd8){var _0x3147a4={};_0x3147a4[_0x400cd8]={'$like':'%'+_0x51d483[_0xc6de('0x32')]['filter']+'%'};return _0x3147a4;})});}_0x3e1632=_[_0xc6de('0x3e')]({},_0x3e1632,_0x51d483['options']);return _0x4b48aa[_0xc6de('0x50')](_0x3e1632);}})['then'](function(_0x4c3fe9){if(_0x4c3fe9){_0x4bc060=_0x4c3fe9['length'];if(!_0x51d483[_0xc6de('0x32')][_0xc6de('0x38')](_0xc6de('0x39'))){_0x3e1632[_0xc6de('0x20')]=qs['limit'](_0x51d483[_0xc6de('0x32')]['limit']);_0x3e1632[_0xc6de('0x1e')]=qs['offset'](_0x51d483['query'][_0xc6de('0x1e')]);}return _0x4b48aa['getDescriptions'](_0x3e1632);}})[_0xc6de('0x29')](function(_0x43a5df){if(_0x43a5df){return _0x43a5df?{'count':_0x4bc060,'rows':_0x43a5df}:null;}})['then'](respondWithResult(_0x42a134,null))[_0xc6de('0x44')](handleError(_0x42a134,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index a6f8f55..0483779 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 _0x572e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger'];(function(_0x42f637,_0x3fa8fc){var _0x4978e3=function(_0x3fade2){while(--_0x3fade2){_0x42f637['push'](_0x42f637['shift']());}};_0x4978e3(++_0x3fa8fc);}(_0x572e,0x7f));var _0xe572=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x572e[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0xe572('0x0'));var util=require(_0xe572('0x1'));var logger=require(_0xe572('0x2'))(_0xe572('0x3'));var moment=require(_0xe572('0x4'));var BPromise=require(_0xe572('0x5'));var rp=require(_0xe572('0x6'));var fs=require('fs');var path=require(_0xe572('0x7'));var rimraf=require(_0xe572('0x8'));var config=require(_0xe572('0x9'));var attributes=require(_0xe572('0xa'));module['exports']=function(_0x2fe5ec,_0x10857c){return _0x2fe5ec['define'](_0xe572('0xb'),attributes,{'tableName':_0xe572('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb33=['rimraf','exports','int_salesforce_configurations','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x491b2b,_0xfa079d){var _0x4806d7=function(_0x3ecab1){while(--_0x3ecab1){_0x491b2b['push'](_0x491b2b['shift']());}};_0x4806d7(++_0xfa079d);}(_0xbb33,0xad));var _0x3bb3=function(_0x1a71ef,_0x31ed01){_0x1a71ef=_0x1a71ef-0x0;var _0x1899f7=_0xbb33[_0x1a71ef];return _0x1899f7;};'use strict';var _=require(_0x3bb3('0x0'));var util=require(_0x3bb3('0x1'));var logger=require('../../config/logger')(_0x3bb3('0x2'));var moment=require(_0x3bb3('0x3'));var BPromise=require(_0x3bb3('0x4'));var rp=require(_0x3bb3('0x5'));var fs=require('fs');var path=require(_0x3bb3('0x6'));var rimraf=require(_0x3bb3('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x3bb3('0x8')]=function(_0x26cd59,_0x108d1b){return _0x26cd59['define']('SalesforceConfiguration',attributes,{'tableName':_0x3bb3('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 8c5570c..78bf6f2 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 _0x83eb=['client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x83eb,0x121));var _0xb83e=function(_0x5ee458,_0x226923){_0x5ee458=_0x5ee458-0x0;var _0x58aa2b=_0x83eb[_0x5ee458];return _0x58aa2b;};'use strict';var _=require(_0xb83e('0x0'));var util=require(_0xb83e('0x1'));var moment=require(_0xb83e('0x2'));var BPromise=require(_0xb83e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb83e('0x4'));var db=require(_0xb83e('0x5'))['db'];var utils=require(_0xb83e('0x6'));var logger=require(_0xb83e('0x7'))(_0xb83e('0x8'));var config=require('../../config/environment');var jayson=require(_0xb83e('0x9'));var client=jayson[_0xb83e('0xa')][_0xb83e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f6649,_0x5b9cbb,_0x5150b0){return new BPromise(function(_0x418d54,_0x5d0602){return client[_0xb83e('0xc')](_0x2f6649,_0x5150b0)[_0xb83e('0xd')](function(_0x5da38f){logger[_0xb83e('0xe')](_0xb83e('0xf'),_0x5b9cbb,_0xb83e('0x10'));logger['debug'](_0xb83e('0x11'),_0x5b9cbb,'request\x20sent',JSON[_0xb83e('0x12')](_0x5da38f));if(_0x5da38f[_0xb83e('0x13')]){if(_0x5da38f['error'][_0xb83e('0x14')]===0x1f4){logger['error'](_0xb83e('0xf'),_0x5b9cbb,_0x5da38f[_0xb83e('0x13')][_0xb83e('0x15')]);return _0x5d0602(_0x5da38f['error'][_0xb83e('0x15')]);}logger[_0xb83e('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5b9cbb,_0x5da38f[_0xb83e('0x13')]['message']);return _0x418d54(_0x5da38f[_0xb83e('0x13')][_0xb83e('0x15')]);}else{logger[_0xb83e('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5b9cbb,_0xb83e('0x10'));_0x418d54(_0x5da38f[_0xb83e('0x16')][_0xb83e('0x15')]);}})['catch'](function(_0x3a4abf){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x5b9cbb,_0x3a4abf);_0x5d0602(_0x3a4abf);});});} \ No newline at end of file +var _0xab5e=['error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xab5e,0x78));var _0xeab5=function(_0xeb74e4,_0x40bea0){_0xeb74e4=_0xeb74e4-0x0;var _0x401e92=_0xab5e[_0xeb74e4];return _0x401e92;};'use strict';var _=require(_0xeab5('0x0'));var util=require(_0xeab5('0x1'));var moment=require(_0xeab5('0x2'));var BPromise=require('bluebird');var rs=require(_0xeab5('0x3'));var fs=require('fs');var Redis=require(_0xeab5('0x4'));var db=require(_0xeab5('0x5'))['db'];var utils=require(_0xeab5('0x6'));var logger=require(_0xeab5('0x7'))(_0xeab5('0x8'));var config=require('../../config/environment');var jayson=require(_0xeab5('0x9'));var client=jayson[_0xeab5('0xa')][_0xeab5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1836c0,_0x4d6c0c,_0xa00f4){return new BPromise(function(_0x2dad55,_0x15f35a){return client[_0xeab5('0xc')](_0x1836c0,_0xa00f4)[_0xeab5('0xd')](function(_0x530d5b){logger['info'](_0xeab5('0xe'),_0x4d6c0c,_0xeab5('0xf'));logger[_0xeab5('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x4d6c0c,_0xeab5('0xf'),JSON[_0xeab5('0x11')](_0x530d5b));if(_0x530d5b[_0xeab5('0x12')]){if(_0x530d5b[_0xeab5('0x12')]['code']===0x1f4){logger[_0xeab5('0x12')](_0xeab5('0xe'),_0x4d6c0c,_0x530d5b[_0xeab5('0x12')][_0xeab5('0x13')]);return _0x15f35a(_0x530d5b[_0xeab5('0x12')]['message']);}logger[_0xeab5('0x12')](_0xeab5('0xe'),_0x4d6c0c,_0x530d5b[_0xeab5('0x12')][_0xeab5('0x13')]);return _0x2dad55(_0x530d5b[_0xeab5('0x12')]['message']);}else{logger[_0xeab5('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4d6c0c,_0xeab5('0xf'));_0x2dad55(_0x530d5b[_0xeab5('0x15')][_0xeab5('0x13')]);}})[_0xeab5('0x16')](function(_0xe36701){logger['error'](_0xeab5('0xe'),_0x4d6c0c,_0xe36701);_0x15f35a(_0xe36701);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index da8fab6..b39c949 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 _0xc2f8=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','post','create','delete','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc2f8,0x1ea));var _0x8c2f=function(_0x4bc124,_0x4ab9f2){_0x4bc124=_0x4bc124-0x0;var _0x5ea12d=_0xc2f8[_0x4bc124];return _0x5ea12d;};'use strict';var multer=require(_0x8c2f('0x0'));var util=require(_0x8c2f('0x1'));var path=require('path');var timeout=require(_0x8c2f('0x2'));var express=require(_0x8c2f('0x3'));var router=express[_0x8c2f('0x4')]();var fs_extra=require(_0x8c2f('0x5'));var auth=require(_0x8c2f('0x6'));var interaction=require(_0x8c2f('0x7'));var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0x8c2f('0x8')]('/',auth[_0x8c2f('0x9')](),controller['index']);router['get'](_0x8c2f('0xa'),auth[_0x8c2f('0x9')](),controller[_0x8c2f('0xb')]);router[_0x8c2f('0xc')]('/',auth[_0x8c2f('0x9')](),controller[_0x8c2f('0xd')]);router['put'](_0x8c2f('0xa'),auth[_0x8c2f('0x9')](),controller['update']);router[_0x8c2f('0xe')](_0x8c2f('0xa'),auth[_0x8c2f('0x9')](),controller['destroy']);module[_0x8c2f('0xf')]=router; \ No newline at end of file +var _0xe9db=['update','delete','destroy','exports','multer','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','put'];(function(_0x8bd517,_0x513d7d){var _0x5c843e=function(_0x1247e8){while(--_0x1247e8){_0x8bd517['push'](_0x8bd517['shift']());}};_0x5c843e(++_0x513d7d);}(_0xe9db,0xe4));var _0xbe9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9db[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbe9d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xbe9d('0x1'));var auth=require(_0xbe9d('0x2'));var interaction=require(_0xbe9d('0x3'));var config=require(_0xbe9d('0x4'));var controller=require('./intSalesforceField.controller');router[_0xbe9d('0x5')]('/',auth[_0xbe9d('0x6')](),controller['index']);router[_0xbe9d('0x5')](_0xbe9d('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xbe9d('0x8')]('/',auth[_0xbe9d('0x6')](),controller['create']);router[_0xbe9d('0x9')](_0xbe9d('0x7'),auth[_0xbe9d('0x6')](),controller[_0xbe9d('0xa')]);router[_0xbe9d('0xb')](_0xbe9d('0x7'),auth['isAuthenticated'](),controller[_0xbe9d('0xc')]);module[_0xbe9d('0xd')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index edd1099..ec272c7 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 _0x35d0=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','sequelize','exports'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x35d0,0x14b));var _0x035d=function(_0x4bc428,_0xf56dd9){_0x4bc428=_0x4bc428-0x0;var _0x3ca37f=_0x35d0[_0x4bc428];return _0x3ca37f;};'use strict';var Sequelize=require(_0x035d('0x0'));module[_0x035d('0x1')]={'type':{'type':Sequelize[_0x035d('0x2')](_0x035d('0x3'),_0x035d('0x4'),'customVariable',_0x035d('0x5'),_0x035d('0x6')),'defaultValue':_0x035d('0x3')},'content':{'type':Sequelize[_0x035d('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x035d('0x2')](_0x035d('0x3'),'variable',_0x035d('0x8'))},'keyContent':{'type':Sequelize[_0x035d('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x035d('0x7')]}}; \ No newline at end of file +var _0xf69f=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x5d406f,_0x9658d9){var _0x5d2a60=function(_0x41dd9a){while(--_0x41dd9a){_0x5d406f['push'](_0x5d406f['shift']());}};_0x5d2a60(++_0x9658d9);}(_0xf69f,0x1ee));var _0xff69=function(_0x5b25ae,_0x4c16cc){_0x5b25ae=_0x5b25ae-0x0;var _0x2831b7=_0xf69f[_0x5b25ae];return _0x2831b7;};'use strict';var Sequelize=require(_0xff69('0x0'));module[_0xff69('0x1')]={'type':{'type':Sequelize[_0xff69('0x2')](_0xff69('0x3'),_0xff69('0x4'),_0xff69('0x5'),_0xff69('0x6'),_0xff69('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xff69('0x8')]},'key':{'type':Sequelize[_0xff69('0x8')]},'keyType':{'type':Sequelize[_0xff69('0x2')](_0xff69('0x3'),'variable',_0xff69('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xff69('0x8')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 9d661f1..859bfee 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 _0x2908=['update','destroy','then','end','error','stack','name','send','index','SalesforceField','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filters','filter','where','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x1d8946,_0x1a7359){var _0x3618a6=function(_0x381a7c){while(--_0x381a7c){_0x1d8946['push'](_0x1d8946['shift']());}};_0x3618a6(++_0x1a7359);}(_0x2908,0x1be));var _0x8290=function(_0x32db1b,_0x521a51){_0x32db1b=_0x32db1b-0x0;var _0x460f19=_0x2908[_0x32db1b];return _0x460f19;};'use strict';var emlformat=require(_0x8290('0x0'));var rimraf=require(_0x8290('0x1'));var zipdir=require(_0x8290('0x2'));var jsonpatch=require(_0x8290('0x3'));var rp=require(_0x8290('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8290('0x5'));var util=require(_0x8290('0x6'));var path=require(_0x8290('0x7'));var sox=require(_0x8290('0x8'));var csv=require(_0x8290('0x9'));var ejs=require(_0x8290('0xa'));var fs=require('fs');var fs_extra=require(_0x8290('0xb'));var _=require(_0x8290('0xc'));var squel=require(_0x8290('0xd'));var crypto=require(_0x8290('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8290('0xf'));var toCsv=require(_0x8290('0x9'));var querystring=require(_0x8290('0x10'));var Papa=require(_0x8290('0x11'));var Redis=require(_0x8290('0x12'));var authService=require(_0x8290('0x13'));var qs=require(_0x8290('0x14'));var as=require(_0x8290('0x15'));var hardwareService=require(_0x8290('0x16'));var logger=require(_0x8290('0x17'))(_0x8290('0x18'));var utils=require(_0x8290('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8290('0x1a'));var db=require(_0x8290('0x1b'))['db'];function respondWithStatusCode(_0x176cae,_0x49a63c){_0x49a63c=_0x49a63c||0xcc;return function(_0x35e835){if(_0x35e835){return _0x176cae[_0x8290('0x1c')](_0x49a63c);}return _0x176cae[_0x8290('0x1d')](_0x49a63c)['end']();};}function respondWithResult(_0x494367,_0x4f9107){_0x4f9107=_0x4f9107||0xc8;return function(_0x5155f4){if(_0x5155f4){return _0x494367['status'](_0x4f9107)[_0x8290('0x1e')](_0x5155f4);}};}function respondWithFilteredResult(_0x5da7b7,_0x1411de){return function(_0x53e3db){if(_0x53e3db){var _0x2d9f82=typeof _0x1411de[_0x8290('0x1f')]===_0x8290('0x20')&&typeof _0x1411de[_0x8290('0x21')]===_0x8290('0x20');var _0x48a27a=_0x53e3db[_0x8290('0x22')];var _0xb0a28b=_0x2d9f82?0x0:_0x1411de[_0x8290('0x1f')];var _0x35c1ee=_0x2d9f82?_0x53e3db[_0x8290('0x22')]:_0x1411de['offset']+_0x1411de['limit'];var _0x130e0a;if(_0x35c1ee>=_0x48a27a){_0x35c1ee=_0x48a27a;_0x130e0a=0xc8;}else{_0x130e0a=0xce;}_0x5da7b7[_0x8290('0x1d')](_0x130e0a);return _0x5da7b7[_0x8290('0x23')](_0x8290('0x24'),_0xb0a28b+'-'+_0x35c1ee+'/'+_0x48a27a)[_0x8290('0x1e')](_0x53e3db);}return null;};}function patchUpdates(_0x3fd0dd){return function(_0x2167c6){try{jsonpatch[_0x8290('0x25')](_0x2167c6,_0x3fd0dd,!![]);}catch(_0x158743){return BPromise[_0x8290('0x26')](_0x158743);}return _0x2167c6[_0x8290('0x27')]();};}function saveUpdates(_0x2183ae,_0x28d852){return function(_0x3e0b89){if(_0x3e0b89){return _0x3e0b89[_0x8290('0x28')](_0x2183ae)['then'](function(_0x218f48){return _0x218f48;});}return null;};}function removeEntity(_0xf0fd0b,_0x275cac){return function(_0x41c0bf){if(_0x41c0bf){return _0x41c0bf[_0x8290('0x29')]()[_0x8290('0x2a')](function(){_0xf0fd0b[_0x8290('0x1d')](0xcc)[_0x8290('0x2b')]();});}};}function handleEntityNotFound(_0x43e75e,_0x470a7c){return function(_0x10450f){if(!_0x10450f){_0x43e75e['sendStatus'](0x194);}return _0x10450f;};}function handleError(_0x1a21b1,_0x31bf71){_0x31bf71=_0x31bf71||0x1f4;return function(_0x1d1203){logger[_0x8290('0x2c')](_0x1d1203[_0x8290('0x2d')]);if(_0x1d1203[_0x8290('0x2e')]){delete _0x1d1203[_0x8290('0x2e')];}_0x1a21b1[_0x8290('0x1d')](_0x31bf71)[_0x8290('0x2f')](_0x1d1203);};}exports[_0x8290('0x30')]=function(_0xbd9eaf,_0x10dfa4){var _0x388d4={},_0x45c438={},_0x5e7887={'count':0x0,'rows':[]};var _0x3e90c0=_['map'](db[_0x8290('0x31')]['rawAttributes'],function(_0x1ba529){return{'name':_0x1ba529[_0x8290('0x32')],'type':_0x1ba529[_0x8290('0x33')][_0x8290('0x34')]};});_0x45c438[_0x8290('0x35')]=_['map'](_0x3e90c0,_0x8290('0x2e'));_0x45c438[_0x8290('0x36')]=_['keys'](_0xbd9eaf[_0x8290('0x36')]);_0x45c438['filters']=_[_0x8290('0x37')](_0x45c438[_0x8290('0x35')],_0x45c438[_0x8290('0x36')]);_0x388d4[_0x8290('0x38')]=_[_0x8290('0x37')](_0x45c438[_0x8290('0x35')],qs[_0x8290('0x39')](_0xbd9eaf['query'][_0x8290('0x39')]));_0x388d4['attributes']=_0x388d4[_0x8290('0x38')][_0x8290('0x3a')]?_0x388d4['attributes']:_0x45c438[_0x8290('0x35')];if(!_0xbd9eaf['query'][_0x8290('0x3b')](_0x8290('0x3c'))){_0x388d4['limit']=qs[_0x8290('0x21')](_0xbd9eaf[_0x8290('0x36')][_0x8290('0x21')]);_0x388d4[_0x8290('0x1f')]=qs[_0x8290('0x1f')](_0xbd9eaf[_0x8290('0x36')]['offset']);}_0x388d4[_0x8290('0x3d')]=qs['sort'](_0xbd9eaf[_0x8290('0x36')]['sort']);_0x388d4['where']=qs['filters'](_[_0x8290('0x3e')](_0xbd9eaf[_0x8290('0x36')],_0x45c438[_0x8290('0x3f')]),_0x3e90c0);if(_0xbd9eaf[_0x8290('0x36')][_0x8290('0x40')]){_0x388d4['where']=_['merge'](_0x388d4[_0x8290('0x41')],{'$or':_[_0x8290('0x42')](_0x3e90c0,function(_0x305ea2){if(_0x305ea2[_0x8290('0x33')]!==_0x8290('0x43')){var _0x2411c6={};_0x2411c6[_0x305ea2['name']]={'$like':'%'+_0xbd9eaf[_0x8290('0x36')][_0x8290('0x40')]+'%'};return _0x2411c6;}})});}_0x388d4=_[_0x8290('0x44')]({},_0x388d4,_0xbd9eaf[_0x8290('0x45')]);var _0x236e63={'where':_0x388d4['where']};return db[_0x8290('0x31')]['count'](_0x236e63)[_0x8290('0x2a')](function(_0x1b9fff){_0x5e7887['count']=_0x1b9fff;if(_0xbd9eaf['query'][_0x8290('0x46')]){_0x388d4[_0x8290('0x47')]=[{'all':!![]}];}return db[_0x8290('0x31')][_0x8290('0x48')](_0x388d4);})[_0x8290('0x2a')](function(_0x1b6f56){_0x5e7887[_0x8290('0x49')]=_0x1b6f56;return _0x5e7887;})[_0x8290('0x2a')](respondWithFilteredResult(_0x10dfa4,_0x388d4))[_0x8290('0x4a')](handleError(_0x10dfa4,null));};exports[_0x8290('0x4b')]=function(_0x10c0a6,_0x3e440a){var _0x9dffa6={'raw':!![],'where':{'id':_0x10c0a6[_0x8290('0x4c')]['id']}},_0x226d16={};_0x226d16[_0x8290('0x35')]=_[_0x8290('0x4d')](db['SalesforceField']['rawAttributes']);_0x226d16[_0x8290('0x36')]=_[_0x8290('0x4d')](_0x10c0a6[_0x8290('0x36')]);_0x226d16[_0x8290('0x3f')]=_[_0x8290('0x37')](_0x226d16[_0x8290('0x35')],_0x226d16[_0x8290('0x36')]);_0x9dffa6[_0x8290('0x38')]=_[_0x8290('0x37')](_0x226d16[_0x8290('0x35')],qs['fields'](_0x10c0a6[_0x8290('0x36')][_0x8290('0x39')]));_0x9dffa6['attributes']=_0x9dffa6[_0x8290('0x38')][_0x8290('0x3a')]?_0x9dffa6['attributes']:_0x226d16[_0x8290('0x35')];if(_0x10c0a6[_0x8290('0x36')][_0x8290('0x46')]){_0x9dffa6['include']=[{'all':!![]}];}_0x9dffa6=_['merge']({},_0x9dffa6,_0x10c0a6[_0x8290('0x45')]);return db['SalesforceField'][_0x8290('0x4e')](_0x9dffa6)[_0x8290('0x2a')](handleEntityNotFound(_0x3e440a,null))[_0x8290('0x2a')](respondWithResult(_0x3e440a,null))[_0x8290('0x4a')](handleError(_0x3e440a,null));};exports['create']=function(_0x4044cf,_0x50f870){return db[_0x8290('0x31')][_0x8290('0x4f')](_0x4044cf[_0x8290('0x50')],{})[_0x8290('0x2a')](respondWithResult(_0x50f870,0xc9))[_0x8290('0x4a')](handleError(_0x50f870,null));};exports[_0x8290('0x28')]=function(_0x70ecf9,_0x172100){if(_0x70ecf9[_0x8290('0x50')]['id']){delete _0x70ecf9[_0x8290('0x50')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x70ecf9[_0x8290('0x4c')]['id']}})[_0x8290('0x2a')](handleEntityNotFound(_0x172100,null))[_0x8290('0x2a')](saveUpdates(_0x70ecf9[_0x8290('0x50')],null))['then'](respondWithResult(_0x172100,null))['catch'](handleError(_0x172100,null));};exports[_0x8290('0x29')]=function(_0x38290c,_0x1e820f){return db[_0x8290('0x31')][_0x8290('0x4e')]({'where':{'id':_0x38290c[_0x8290('0x4c')]['id']}})[_0x8290('0x2a')](handleEntityNotFound(_0x1e820f,null))[_0x8290('0x2a')](removeEntity(_0x1e820f,null))['catch'](handleError(_0x1e820f,null));}; \ No newline at end of file +var _0x3bdd=['bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','SalesforceField','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x5d33b2,_0x10c3b7){var _0x50a16d=function(_0x35a4){while(--_0x35a4){_0x5d33b2['push'](_0x5d33b2['shift']());}};_0x50a16d(++_0x10c3b7);}(_0x3bdd,0x94));var _0xd3bd=function(_0x5cb512,_0x5be502){_0x5cb512=_0x5cb512-0x0;var _0x232914=_0x3bdd[_0x5cb512];return _0x232914;};'use strict';var emlformat=require(_0xd3bd('0x0'));var rimraf=require(_0xd3bd('0x1'));var zipdir=require(_0xd3bd('0x2'));var jsonpatch=require(_0xd3bd('0x3'));var rp=require(_0xd3bd('0x4'));var moment=require(_0xd3bd('0x5'));var BPromise=require(_0xd3bd('0x6'));var Mustache=require(_0xd3bd('0x7'));var util=require(_0xd3bd('0x8'));var path=require(_0xd3bd('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd3bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd3bd('0xb'));var squel=require(_0xd3bd('0xc'));var crypto=require(_0xd3bd('0xd'));var jsforce=require(_0xd3bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd3bd('0xf'));var querystring=require(_0xd3bd('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd3bd('0x11'));var qs=require(_0xd3bd('0x12'));var as=require(_0xd3bd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3bd('0x14'))(_0xd3bd('0x15'));var utils=require(_0xd3bd('0x16'));var config=require(_0xd3bd('0x17'));var licenseUtil=require(_0xd3bd('0x18'));var db=require(_0xd3bd('0x19'))['db'];function respondWithStatusCode(_0x189b90,_0x485e78){_0x485e78=_0x485e78||0xcc;return function(_0x12ad10){if(_0x12ad10){return _0x189b90[_0xd3bd('0x1a')](_0x485e78);}return _0x189b90[_0xd3bd('0x1b')](_0x485e78)[_0xd3bd('0x1c')]();};}function respondWithResult(_0x49b852,_0x3bef98){_0x3bef98=_0x3bef98||0xc8;return function(_0x5d37d6){if(_0x5d37d6){return _0x49b852['status'](_0x3bef98)[_0xd3bd('0x1d')](_0x5d37d6);}};}function respondWithFilteredResult(_0x32a48c,_0x2cf5c2){return function(_0x372b0a){if(_0x372b0a){var _0x46e5a5=typeof _0x2cf5c2[_0xd3bd('0x1e')]===_0xd3bd('0x1f')&&typeof _0x2cf5c2[_0xd3bd('0x20')]==='undefined';var _0x2aa176=_0x372b0a['count'];var _0x2a42e6=_0x46e5a5?0x0:_0x2cf5c2[_0xd3bd('0x1e')];var _0x90e31a=_0x46e5a5?_0x372b0a[_0xd3bd('0x21')]:_0x2cf5c2['offset']+_0x2cf5c2[_0xd3bd('0x20')];var _0x2ac6d8;if(_0x90e31a>=_0x2aa176){_0x90e31a=_0x2aa176;_0x2ac6d8=0xc8;}else{_0x2ac6d8=0xce;}_0x32a48c['status'](_0x2ac6d8);return _0x32a48c[_0xd3bd('0x22')](_0xd3bd('0x23'),_0x2a42e6+'-'+_0x90e31a+'/'+_0x2aa176)['json'](_0x372b0a);}return null;};}function patchUpdates(_0x38b7a3){return function(_0x2d8921){try{jsonpatch['apply'](_0x2d8921,_0x38b7a3,!![]);}catch(_0x325c41){return BPromise[_0xd3bd('0x24')](_0x325c41);}return _0x2d8921[_0xd3bd('0x25')]();};}function saveUpdates(_0x36b011,_0x55ff91){return function(_0x472caf){if(_0x472caf){return _0x472caf[_0xd3bd('0x26')](_0x36b011)['then'](function(_0x22d4ef){return _0x22d4ef;});}return null;};}function removeEntity(_0x1ab669,_0x51f230){return function(_0x5b2dd1){if(_0x5b2dd1){return _0x5b2dd1[_0xd3bd('0x27')]()[_0xd3bd('0x28')](function(){_0x1ab669[_0xd3bd('0x1b')](0xcc)[_0xd3bd('0x1c')]();});}};}function handleEntityNotFound(_0x4163f5,_0x2beea0){return function(_0x3e6dd7){if(!_0x3e6dd7){_0x4163f5[_0xd3bd('0x1a')](0x194);}return _0x3e6dd7;};}function handleError(_0x23d30f,_0x3f6e37){_0x3f6e37=_0x3f6e37||0x1f4;return function(_0x2888e6){logger[_0xd3bd('0x29')](_0x2888e6[_0xd3bd('0x2a')]);if(_0x2888e6[_0xd3bd('0x2b')]){delete _0x2888e6[_0xd3bd('0x2b')];}_0x23d30f[_0xd3bd('0x1b')](_0x3f6e37)[_0xd3bd('0x2c')](_0x2888e6);};}exports[_0xd3bd('0x2d')]=function(_0x1165cf,_0x343759){var _0x41fbf9={},_0x483f15={},_0x50787c={'count':0x0,'rows':[]};var _0x4471fc=_['map'](db[_0xd3bd('0x2e')][_0xd3bd('0x2f')],function(_0x574b17){return{'name':_0x574b17[_0xd3bd('0x30')],'type':_0x574b17[_0xd3bd('0x31')][_0xd3bd('0x32')]};});_0x483f15[_0xd3bd('0x33')]=_[_0xd3bd('0x34')](_0x4471fc,_0xd3bd('0x2b'));_0x483f15[_0xd3bd('0x35')]=_[_0xd3bd('0x36')](_0x1165cf[_0xd3bd('0x35')]);_0x483f15['filters']=_[_0xd3bd('0x37')](_0x483f15['model'],_0x483f15['query']);_0x41fbf9[_0xd3bd('0x38')]=_[_0xd3bd('0x37')](_0x483f15[_0xd3bd('0x33')],qs[_0xd3bd('0x39')](_0x1165cf[_0xd3bd('0x35')][_0xd3bd('0x39')]));_0x41fbf9[_0xd3bd('0x38')]=_0x41fbf9[_0xd3bd('0x38')][_0xd3bd('0x3a')]?_0x41fbf9[_0xd3bd('0x38')]:_0x483f15[_0xd3bd('0x33')];if(!_0x1165cf['query'][_0xd3bd('0x3b')](_0xd3bd('0x3c'))){_0x41fbf9['limit']=qs['limit'](_0x1165cf[_0xd3bd('0x35')][_0xd3bd('0x20')]);_0x41fbf9[_0xd3bd('0x1e')]=qs[_0xd3bd('0x1e')](_0x1165cf[_0xd3bd('0x35')][_0xd3bd('0x1e')]);}_0x41fbf9[_0xd3bd('0x3d')]=qs['sort'](_0x1165cf[_0xd3bd('0x35')][_0xd3bd('0x3e')]);_0x41fbf9[_0xd3bd('0x3f')]=qs[_0xd3bd('0x40')](_[_0xd3bd('0x41')](_0x1165cf[_0xd3bd('0x35')],_0x483f15[_0xd3bd('0x40')]),_0x4471fc);if(_0x1165cf[_0xd3bd('0x35')][_0xd3bd('0x42')]){_0x41fbf9['where']=_[_0xd3bd('0x43')](_0x41fbf9[_0xd3bd('0x3f')],{'$or':_[_0xd3bd('0x34')](_0x4471fc,function(_0x42fec6){if(_0x42fec6[_0xd3bd('0x31')]!==_0xd3bd('0x44')){var _0x1809d0={};_0x1809d0[_0x42fec6[_0xd3bd('0x2b')]]={'$like':'%'+_0x1165cf[_0xd3bd('0x35')][_0xd3bd('0x42')]+'%'};return _0x1809d0;}})});}_0x41fbf9=_[_0xd3bd('0x43')]({},_0x41fbf9,_0x1165cf['options']);var _0x8dae89={'where':_0x41fbf9[_0xd3bd('0x3f')]};return db[_0xd3bd('0x2e')][_0xd3bd('0x21')](_0x8dae89)[_0xd3bd('0x28')](function(_0x2678c8){_0x50787c[_0xd3bd('0x21')]=_0x2678c8;if(_0x1165cf[_0xd3bd('0x35')]['includeAll']){_0x41fbf9[_0xd3bd('0x45')]=[{'all':!![]}];}return db['SalesforceField'][_0xd3bd('0x46')](_0x41fbf9);})[_0xd3bd('0x28')](function(_0x19e15f){_0x50787c['rows']=_0x19e15f;return _0x50787c;})[_0xd3bd('0x28')](respondWithFilteredResult(_0x343759,_0x41fbf9))['catch'](handleError(_0x343759,null));};exports['show']=function(_0x278bb5,_0x2e473f){var _0x595ad5={'raw':!![],'where':{'id':_0x278bb5[_0xd3bd('0x47')]['id']}},_0x1f4609={};_0x1f4609['model']=_[_0xd3bd('0x36')](db[_0xd3bd('0x2e')]['rawAttributes']);_0x1f4609['query']=_[_0xd3bd('0x36')](_0x278bb5[_0xd3bd('0x35')]);_0x1f4609[_0xd3bd('0x40')]=_[_0xd3bd('0x37')](_0x1f4609[_0xd3bd('0x33')],_0x1f4609['query']);_0x595ad5['attributes']=_['intersection'](_0x1f4609[_0xd3bd('0x33')],qs['fields'](_0x278bb5[_0xd3bd('0x35')][_0xd3bd('0x39')]));_0x595ad5[_0xd3bd('0x38')]=_0x595ad5[_0xd3bd('0x38')][_0xd3bd('0x3a')]?_0x595ad5[_0xd3bd('0x38')]:_0x1f4609[_0xd3bd('0x33')];if(_0x278bb5[_0xd3bd('0x35')][_0xd3bd('0x48')]){_0x595ad5[_0xd3bd('0x45')]=[{'all':!![]}];}_0x595ad5=_['merge']({},_0x595ad5,_0x278bb5['options']);return db[_0xd3bd('0x2e')][_0xd3bd('0x49')](_0x595ad5)[_0xd3bd('0x28')](handleEntityNotFound(_0x2e473f,null))[_0xd3bd('0x28')](respondWithResult(_0x2e473f,null))[_0xd3bd('0x4a')](handleError(_0x2e473f,null));};exports[_0xd3bd('0x4b')]=function(_0xbaa22f,_0x26633c){return db[_0xd3bd('0x2e')]['create'](_0xbaa22f[_0xd3bd('0x4c')],{})[_0xd3bd('0x28')](respondWithResult(_0x26633c,0xc9))[_0xd3bd('0x4a')](handleError(_0x26633c,null));};exports[_0xd3bd('0x26')]=function(_0x4ff04f,_0x4434d9){if(_0x4ff04f[_0xd3bd('0x4c')]['id']){delete _0x4ff04f['body']['id'];}return db['SalesforceField'][_0xd3bd('0x49')]({'where':{'id':_0x4ff04f[_0xd3bd('0x47')]['id']}})[_0xd3bd('0x28')](handleEntityNotFound(_0x4434d9,null))[_0xd3bd('0x28')](saveUpdates(_0x4ff04f[_0xd3bd('0x4c')],null))[_0xd3bd('0x28')](respondWithResult(_0x4434d9,null))['catch'](handleError(_0x4434d9,null));};exports[_0xd3bd('0x27')]=function(_0x5bfa60,_0x987d0c){return db['SalesforceField']['find']({'where':{'id':_0x5bfa60['params']['id']}})['then'](handleEntityNotFound(_0x987d0c,null))[_0xd3bd('0x28')](removeEntity(_0x987d0c,null))[_0xd3bd('0x4a')](handleError(_0x987d0c,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index acd46e0..20583bb 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 _0x6b99=['int_salesforce_fields','idField','FieldId','lodash','util','../../config/logger','api','request-promise','./intSalesforceField.attributes','exports','define'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x6b99,0x19a));var _0x96b9=function(_0x4a4a43,_0x115ccf){_0x4a4a43=_0x4a4a43-0x0;var _0x5893a6=_0x6b99[_0x4a4a43];return _0x5893a6;};'use strict';var _=require(_0x96b9('0x0'));var util=require(_0x96b9('0x1'));var logger=require(_0x96b9('0x2'))(_0x96b9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x96b9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x96b9('0x5'));module[_0x96b9('0x6')]=function(_0x2c84fa,_0x164089){return _0x2c84fa[_0x96b9('0x7')]('SalesforceField',attributes,{'tableName':_0x96b9('0x8'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x96b9('0x9'),_0x96b9('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x57ea=['idField','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57ea,0x64));var _0xa57e=function(_0x2b3100,_0x345565){_0x2b3100=_0x2b3100-0x0;var _0x59bb19=_0x57ea[_0x2b3100];return _0x59bb19;};'use strict';var _=require(_0xa57e('0x0'));var util=require('util');var logger=require(_0xa57e('0x1'))(_0xa57e('0x2'));var moment=require(_0xa57e('0x3'));var BPromise=require(_0xa57e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa57e('0x5'));var rimraf=require(_0xa57e('0x6'));var config=require('../../config/environment');var attributes=require(_0xa57e('0x7'));module[_0xa57e('0x8')]=function(_0x144d64,_0x2dd0b1){return _0x144d64[_0xa57e('0x9')](_0xa57e('0xa'),attributes,{'tableName':_0xa57e('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xa57e('0xc'),_0xa57e('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 494e4b2..3e1bc9c 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 _0x5414=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','code','error','SalesforceField,\x20%s,\x20%s','message','result','moment','bluebird','randomstring'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0x5414,0xb5));var _0x4541=function(_0x432acc,_0x45fd6b){_0x432acc=_0x432acc-0x0;var _0x2c2178=_0x5414[_0x432acc];return _0x2c2178;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4541('0x0'));var BPromise=require(_0x4541('0x1'));var rs=require(_0x4541('0x2'));var fs=require('fs');var Redis=require(_0x4541('0x3'));var db=require(_0x4541('0x4'))['db'];var utils=require(_0x4541('0x5'));var logger=require(_0x4541('0x6'))(_0x4541('0x7'));var config=require(_0x4541('0x8'));var jayson=require(_0x4541('0x9'));var client=jayson[_0x4541('0xa')][_0x4541('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x499007,_0x71f7b6,_0x10dc34){return new BPromise(function(_0x5862ae,_0x922482){return client[_0x4541('0xc')](_0x499007,_0x10dc34)[_0x4541('0xd')](function(_0x36c859){logger[_0x4541('0xe')]('SalesforceField,\x20%s,\x20%s',_0x71f7b6,'request\x20sent');logger[_0x4541('0xf')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x71f7b6,_0x4541('0x10'),JSON[_0x4541('0x11')](_0x36c859));if(_0x36c859['error']){if(_0x36c859['error'][_0x4541('0x12')]===0x1f4){logger[_0x4541('0x13')](_0x4541('0x14'),_0x71f7b6,_0x36c859[_0x4541('0x13')][_0x4541('0x15')]);return _0x922482(_0x36c859[_0x4541('0x13')][_0x4541('0x15')]);}logger[_0x4541('0x13')](_0x4541('0x14'),_0x71f7b6,_0x36c859[_0x4541('0x13')][_0x4541('0x15')]);return _0x5862ae(_0x36c859[_0x4541('0x13')]['message']);}else{logger[_0x4541('0xe')](_0x4541('0x14'),_0x71f7b6,_0x4541('0x10'));_0x5862ae(_0x36c859[_0x4541('0x16')][_0x4541('0x15')]);}})['catch'](function(_0x39adb3){logger[_0x4541('0x13')](_0x4541('0x14'),_0x71f7b6,_0x39adb3);_0x922482(_0x39adb3);});});} \ No newline at end of file +var _0x9468=['error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s'];(function(_0x1c2628,_0x2a7556){var _0xf5b7b3=function(_0x47e6a){while(--_0x47e6a){_0x1c2628['push'](_0x1c2628['shift']());}};_0xf5b7b3(++_0x2a7556);}(_0x9468,0x97));var _0x8946=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x9468[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0x8946('0x0'));var util=require(_0x8946('0x1'));var moment=require(_0x8946('0x2'));var BPromise=require('bluebird');var rs=require(_0x8946('0x3'));var fs=require('fs');var Redis=require(_0x8946('0x4'));var db=require(_0x8946('0x5'))['db'];var utils=require(_0x8946('0x6'));var logger=require(_0x8946('0x7'))('rpc');var config=require(_0x8946('0x8'));var jayson=require(_0x8946('0x9'));var client=jayson['client'][_0x8946('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xffb0e8,_0x39caaf,_0x4edd2a){return new BPromise(function(_0x405581,_0x3132d9){return client[_0x8946('0xb')](_0xffb0e8,_0x4edd2a)[_0x8946('0xc')](function(_0xb89090){logger['info'](_0x8946('0xd'),_0x39caaf,_0x8946('0xe'));logger[_0x8946('0xf')](_0x8946('0x10'),_0x39caaf,_0x8946('0xe'),JSON['stringify'](_0xb89090));if(_0xb89090[_0x8946('0x11')]){if(_0xb89090[_0x8946('0x11')][_0x8946('0x12')]===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x39caaf,_0xb89090[_0x8946('0x11')][_0x8946('0x13')]);return _0x3132d9(_0xb89090[_0x8946('0x11')][_0x8946('0x13')]);}logger['error'](_0x8946('0xd'),_0x39caaf,_0xb89090['error'][_0x8946('0x13')]);return _0x405581(_0xb89090[_0x8946('0x11')][_0x8946('0x13')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x39caaf,'request\x20sent');_0x405581(_0xb89090[_0x8946('0x14')]['message']);}})['catch'](function(_0x2270a6){logger[_0x8946('0x11')](_0x8946('0xd'),_0x39caaf,_0x2270a6);_0x3132d9(_0x2270a6);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index f925cd8..d41f7b0 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 _0x5a68=['get','show','/:id/configurations','getConfigurations','/:id/fields','post','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index'];(function(_0x45b673,_0xff2ed5){var _0x1448e6=function(_0x5f36da){while(--_0x5f36da){_0x45b673['push'](_0x45b673['shift']());}};_0x1448e6(++_0xff2ed5);}(_0x5a68,0x1ae));var _0x85a6=function(_0x129939,_0xf48c08){_0x129939=_0x129939-0x0;var _0x5e7b61=_0x5a68[_0x129939];return _0x5e7b61;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85a6('0x0'));var timeout=require(_0x85a6('0x1'));var express=require(_0x85a6('0x2'));var router=express[_0x85a6('0x3')]();var fs_extra=require(_0x85a6('0x4'));var auth=require(_0x85a6('0x5'));var interaction=require(_0x85a6('0x6'));var config=require(_0x85a6('0x7'));var controller=require(_0x85a6('0x8'));router['get']('/',auth[_0x85a6('0x9')](),controller[_0x85a6('0xa')]);router[_0x85a6('0xb')]('/:id',auth[_0x85a6('0x9')](),controller[_0x85a6('0xc')]);router[_0x85a6('0xb')](_0x85a6('0xd'),auth[_0x85a6('0x9')](),controller[_0x85a6('0xe')]);router[_0x85a6('0xb')](_0x85a6('0xf'),auth[_0x85a6('0x9')](),controller['getFields']);router[_0x85a6('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x85a6('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0x85a6('0x9')](),controller[_0x85a6('0x11')]);router[_0x85a6('0x12')]('/:id',auth[_0x85a6('0x9')](),controller[_0x85a6('0x13')]);module[_0x85a6('0x14')]=router; \ No newline at end of file +var _0x6d44=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','delete','multer','util','path'];(function(_0x3fc3a9,_0x404db8){var _0x4e17d1=function(_0x5c8be9){while(--_0x5c8be9){_0x3fc3a9['push'](_0x3fc3a9['shift']());}};_0x4e17d1(++_0x404db8);}(_0x6d44,0x70));var _0x46d4=function(_0x385f70,_0x3475a0){_0x385f70=_0x385f70-0x0;var _0x59057f=_0x6d44[_0x385f70];return _0x59057f;};'use strict';var multer=require(_0x46d4('0x0'));var util=require(_0x46d4('0x1'));var path=require(_0x46d4('0x2'));var timeout=require(_0x46d4('0x3'));var express=require(_0x46d4('0x4'));var router=express[_0x46d4('0x5')]();var fs_extra=require(_0x46d4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x46d4('0x7'));var config=require(_0x46d4('0x8'));var controller=require(_0x46d4('0x9'));router[_0x46d4('0xa')]('/',auth[_0x46d4('0xb')](),controller['index']);router[_0x46d4('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x46d4('0xc')]);router[_0x46d4('0xa')](_0x46d4('0xd'),auth[_0x46d4('0xb')](),controller[_0x46d4('0xe')]);router[_0x46d4('0xa')](_0x46d4('0xf'),auth[_0x46d4('0xb')](),controller[_0x46d4('0x10')]);router[_0x46d4('0x11')]('/',auth[_0x46d4('0xb')](),controller[_0x46d4('0x12')]);router[_0x46d4('0x11')](_0x46d4('0xd'),auth[_0x46d4('0xb')](),controller['addConfiguration']);router[_0x46d4('0x13')](_0x46d4('0x14'),auth['isAuthenticated'](),controller[_0x46d4('0x15')]);router[_0x46d4('0x16')](_0x46d4('0x14'),auth[_0x46d4('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 7a5f1d3..5e3f461 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 _0x7e25=['remoteUri','sequelize','exports','STRING'];(function(_0x32fd15,_0x19aa13){var _0xf2f822=function(_0x218d88){while(--_0x218d88){_0x32fd15['push'](_0x32fd15['shift']());}};_0xf2f822(++_0x19aa13);}(_0x7e25,0x89));var _0x57e2=function(_0x951de0,_0x410d50){_0x951de0=_0x951de0-0x0;var _0xd338ee=_0x7e25[_0x951de0];return _0xd338ee;};'use strict';var Sequelize=require(_0x57e2('0x0'));module[_0x57e2('0x1')]={'name':{'type':Sequelize[_0x57e2('0x2')]},'description':{'type':Sequelize[_0x57e2('0x2')]},'username':{'type':Sequelize[_0x57e2('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x57e2('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x57e2('0x2')],'unique':_0x57e2('0x3')},'serverUrl':{'type':Sequelize[_0x57e2('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x0d91=['exports','STRING','sequelize'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x0d91,0x146));var _0x10d9=function(_0x5a86a9,_0x49f269){_0x5a86a9=_0x5a86a9-0x0;var _0x3ab2cc=_0x0d91[_0x5a86a9];return _0x3ab2cc;};'use strict';var Sequelize=require(_0x10d9('0x0'));module[_0x10d9('0x1')]={'name':{'type':Sequelize[_0x10d9('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x10d9('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x10d9('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x10d9('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x10d9('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 3aa80a6..679dd7f 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 _0xb031=['includes','forEach','internalType','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','statusCode','send','test','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','label','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','ServicenowAccount','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','order','pick','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','hold_reason','subcategory','close_code','notify','incident_state','severity','parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','opened_by','sys_created_on','state','sys_created_by','knowledge','calendar_stc','delivery_plan','impact','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','problem_id','reassignment_count','assigned_to','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','serverUrl','remoteUri','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove'];(function(_0xcda377,_0x1e2678){var _0x1c024f=function(_0x1aeb61){while(--_0x1aeb61){_0xcda377['push'](_0xcda377['shift']());}};_0x1c024f(++_0x1e2678);}(_0xb031,0x189));var _0x1b03=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xb031[_0x47a349];return _0x18ab75;};'use strict';var emlformat=require(_0x1b03('0x0'));var rimraf=require(_0x1b03('0x1'));var zipdir=require(_0x1b03('0x2'));var jsonpatch=require(_0x1b03('0x3'));var rp=require('request-promise');var moment=require(_0x1b03('0x4'));var BPromise=require(_0x1b03('0x5'));var Mustache=require(_0x1b03('0x6'));var util=require(_0x1b03('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1b03('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1b03('0x9'));var crypto=require(_0x1b03('0xa'));var jsforce=require(_0x1b03('0xb'));var deskjs=require(_0x1b03('0xc'));var toCsv=require(_0x1b03('0xd'));var querystring=require(_0x1b03('0xe'));var Papa=require('papaparse');var Redis=require(_0x1b03('0xf'));var authService=require(_0x1b03('0x10'));var qs=require(_0x1b03('0x11'));var as=require(_0x1b03('0x12'));var hardwareService=require(_0x1b03('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1b03('0x14'));var config=require(_0x1b03('0x15'));var licenseUtil=require(_0x1b03('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1b03('0x17'));function respondWithStatusCode(_0x2cd921,_0x3c51d6){_0x3c51d6=_0x3c51d6||0xcc;return function(_0x6dcaeb){if(_0x6dcaeb){return _0x2cd921[_0x1b03('0x18')](_0x3c51d6);}return _0x2cd921['status'](_0x3c51d6)['end']();};}function respondWithResult(_0x2dee80,_0xc5de40){_0xc5de40=_0xc5de40||0xc8;return function(_0x39bc92){if(_0x39bc92){return _0x2dee80[_0x1b03('0x19')](_0xc5de40)['json'](_0x39bc92);}};}function respondWithFilteredResult(_0x388b6e,_0x5bb25e){return function(_0x750912){if(_0x750912){var _0xba0b0d=typeof _0x5bb25e[_0x1b03('0x1a')]===_0x1b03('0x1b')&&typeof _0x5bb25e['limit']===_0x1b03('0x1b');var _0x2f1adb=_0x750912['count'];var _0x4534e3=_0xba0b0d?0x0:_0x5bb25e[_0x1b03('0x1a')];var _0x36b040=_0xba0b0d?_0x750912[_0x1b03('0x1c')]:_0x5bb25e['offset']+_0x5bb25e[_0x1b03('0x1d')];var _0x1bd518;if(_0x36b040>=_0x2f1adb){_0x36b040=_0x2f1adb;_0x1bd518=0xc8;}else{_0x1bd518=0xce;}_0x388b6e[_0x1b03('0x19')](_0x1bd518);return _0x388b6e[_0x1b03('0x1e')](_0x1b03('0x1f'),_0x4534e3+'-'+_0x36b040+'/'+_0x2f1adb)['json'](_0x750912);}return null;};}function patchUpdates(_0x25cb53){return function(_0x4a21f0){try{jsonpatch[_0x1b03('0x20')](_0x4a21f0,_0x25cb53,!![]);}catch(_0x579c8b){return BPromise[_0x1b03('0x21')](_0x579c8b);}return _0x4a21f0[_0x1b03('0x22')]();};}function saveUpdates(_0x2bd090,_0x27fade){return function(_0x31d743){if(_0x31d743){return _0x31d743[_0x1b03('0x23')](_0x2bd090)[_0x1b03('0x24')](function(_0x5a796a){return _0x5a796a;});}return null;};}function removeEntity(_0x6512da,_0x16f9a1){return function(_0x1c6a1d){if(_0x1c6a1d){return _0x1c6a1d['destroy']()[_0x1b03('0x24')](function(){_0x6512da[_0x1b03('0x19')](0xcc)[_0x1b03('0x25')]();});}};}function handleEntityNotFound(_0x29a2bd,_0x205076){return function(_0x18294f){if(!_0x18294f){_0x29a2bd[_0x1b03('0x18')](0x194);}return _0x18294f;};}function handleError(_0x2149e9,_0xed63e1){_0xed63e1=_0xed63e1||0x1f4;return function(_0x278ce8){logger[_0x1b03('0x26')](_0x278ce8[_0x1b03('0x27')]);if(_0x278ce8['name']){delete _0x278ce8[_0x1b03('0x28')];}_0x2149e9[_0x1b03('0x19')](_0xed63e1)['send'](_0x278ce8);};}exports['index']=function(_0x50d225,_0x3113f1){var _0xce7b0f={},_0x550385={},_0x36d65b={'count':0x0,'rows':[]};var _0x5f046a=_['map'](db[_0x1b03('0x29')]['rawAttributes'],function(_0xb0b326){return{'name':_0xb0b326[_0x1b03('0x2a')],'type':_0xb0b326[_0x1b03('0x2b')][_0x1b03('0x2c')]};});_0x550385[_0x1b03('0x2d')]=_[_0x1b03('0x2e')](_0x5f046a,_0x1b03('0x28'));_0x550385[_0x1b03('0x2f')]=_['keys'](_0x50d225['query']);_0x550385['filters']=_[_0x1b03('0x30')](_0x550385['model'],_0x550385[_0x1b03('0x2f')]);_0xce7b0f[_0x1b03('0x31')]=_[_0x1b03('0x30')](_0x550385[_0x1b03('0x2d')],qs['fields'](_0x50d225[_0x1b03('0x2f')][_0x1b03('0x32')]));_0xce7b0f[_0x1b03('0x31')]=_0xce7b0f[_0x1b03('0x31')][_0x1b03('0x33')]?_0xce7b0f[_0x1b03('0x31')]:_0x550385[_0x1b03('0x2d')];if(!_0x50d225['query'][_0x1b03('0x34')](_0x1b03('0x35'))){_0xce7b0f[_0x1b03('0x1d')]=qs[_0x1b03('0x1d')](_0x50d225[_0x1b03('0x2f')]['limit']);_0xce7b0f[_0x1b03('0x1a')]=qs[_0x1b03('0x1a')](_0x50d225[_0x1b03('0x2f')][_0x1b03('0x1a')]);}_0xce7b0f['order']=qs['sort'](_0x50d225[_0x1b03('0x2f')][_0x1b03('0x36')]);_0xce7b0f[_0x1b03('0x37')]=qs[_0x1b03('0x38')](_['pick'](_0x50d225[_0x1b03('0x2f')],_0x550385[_0x1b03('0x38')]),_0x5f046a);if(_0x50d225[_0x1b03('0x2f')][_0x1b03('0x39')]){_0xce7b0f['where']=_[_0x1b03('0x3a')](_0xce7b0f['where'],{'$or':_[_0x1b03('0x2e')](_0x5f046a,function(_0x3cb818){if(_0x3cb818[_0x1b03('0x2b')]!==_0x1b03('0x3b')){var _0x35e3c5={};_0x35e3c5[_0x3cb818[_0x1b03('0x28')]]={'$like':'%'+_0x50d225[_0x1b03('0x2f')][_0x1b03('0x39')]+'%'};return _0x35e3c5;}})});}_0xce7b0f=_[_0x1b03('0x3a')]({},_0xce7b0f,_0x50d225[_0x1b03('0x3c')]);var _0x4c8025={'where':_0xce7b0f['where']};return db[_0x1b03('0x29')][_0x1b03('0x1c')](_0x4c8025)['then'](function(_0x271ee){_0x36d65b[_0x1b03('0x1c')]=_0x271ee;if(_0x50d225[_0x1b03('0x2f')][_0x1b03('0x3d')]){_0xce7b0f['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0x1b03('0x3e')](_0xce7b0f);})[_0x1b03('0x24')](function(_0x3ffac9){_0x36d65b[_0x1b03('0x3f')]=_0x3ffac9;return _0x36d65b;})[_0x1b03('0x24')](respondWithFilteredResult(_0x3113f1,_0xce7b0f))[_0x1b03('0x40')](handleError(_0x3113f1,null));};exports[_0x1b03('0x41')]=function(_0x487176,_0x2a4f85){var _0x5a007e={'raw':![],'where':{'id':_0x487176[_0x1b03('0x42')]['id']}},_0x34b50d={};_0x34b50d['model']=_[_0x1b03('0x43')](db[_0x1b03('0x29')][_0x1b03('0x44')]);_0x34b50d[_0x1b03('0x2f')]=_['keys'](_0x487176[_0x1b03('0x2f')]);_0x34b50d[_0x1b03('0x38')]=_[_0x1b03('0x30')](_0x34b50d['model'],_0x34b50d[_0x1b03('0x2f')]);_0x5a007e[_0x1b03('0x31')]=_[_0x1b03('0x30')](_0x34b50d['model'],qs[_0x1b03('0x32')](_0x487176[_0x1b03('0x2f')]['fields']));_0x5a007e[_0x1b03('0x31')]=_0x5a007e[_0x1b03('0x31')][_0x1b03('0x33')]?_0x5a007e[_0x1b03('0x31')]:_0x34b50d['model'];if(_0x487176['query']['includeAll']){_0x5a007e['include']=[{'all':!![]}];}_0x5a007e=_[_0x1b03('0x3a')]({},_0x5a007e,_0x487176[_0x1b03('0x3c')]);return db[_0x1b03('0x29')][_0x1b03('0x45')](_0x5a007e)[_0x1b03('0x24')](handleEntityNotFound(_0x2a4f85,null))[_0x1b03('0x24')](respondWithResult(_0x2a4f85,null))[_0x1b03('0x40')](handleError(_0x2a4f85,null));};exports[_0x1b03('0x46')]=function(_0xe43e9a,_0x5aef73){return db[_0x1b03('0x29')]['create'](_0xe43e9a[_0x1b03('0x47')],{})[_0x1b03('0x24')](respondWithResult(_0x5aef73,0xc9))[_0x1b03('0x40')](handleError(_0x5aef73,null));};exports[_0x1b03('0x23')]=function(_0x2fe940,_0x292b2e){if(_0x2fe940[_0x1b03('0x47')]['id']){delete _0x2fe940[_0x1b03('0x47')]['id'];}return db[_0x1b03('0x29')]['find']({'where':{'id':_0x2fe940[_0x1b03('0x42')]['id']}})[_0x1b03('0x24')](handleEntityNotFound(_0x292b2e,null))['then'](saveUpdates(_0x2fe940[_0x1b03('0x47')],null))['then'](respondWithResult(_0x292b2e,null))[_0x1b03('0x40')](handleError(_0x292b2e,null));};exports[_0x1b03('0x48')]=function(_0x30c6b3,_0x31f3a7){return db[_0x1b03('0x29')][_0x1b03('0x45')]({'where':{'id':_0x30c6b3[_0x1b03('0x42')]['id']}})[_0x1b03('0x24')](handleEntityNotFound(_0x31f3a7,null))['then'](removeEntity(_0x31f3a7,null))[_0x1b03('0x40')](handleError(_0x31f3a7,null));};exports[_0x1b03('0x49')]=function(_0x5b47ac,_0x975583,_0x4840c2){var _0x3ffd45={};var _0x3e555e={};var _0x41b80e;var _0x163352;return db[_0x1b03('0x29')][_0x1b03('0x4a')]({'where':{'id':_0x5b47ac[_0x1b03('0x42')]['id']}})[_0x1b03('0x24')](handleEntityNotFound(_0x975583,null))['then'](function(_0x5ba816){if(_0x5ba816){_0x41b80e=_0x5ba816;_0x3e555e[_0x1b03('0x2d')]=_[_0x1b03('0x43')](db[_0x1b03('0x4b')][_0x1b03('0x44')]);_0x3e555e[_0x1b03('0x2f')]=_[_0x1b03('0x43')](_0x5b47ac[_0x1b03('0x2f')]);_0x3e555e[_0x1b03('0x38')]=_['intersection'](_0x3e555e[_0x1b03('0x2d')],_0x3e555e[_0x1b03('0x2f')]);_0x3ffd45['attributes']=_[_0x1b03('0x30')](_0x3e555e[_0x1b03('0x2d')],qs['fields'](_0x5b47ac[_0x1b03('0x2f')][_0x1b03('0x32')]));_0x3ffd45[_0x1b03('0x31')]=_0x3ffd45[_0x1b03('0x31')][_0x1b03('0x33')]?_0x3ffd45[_0x1b03('0x31')]:_0x3e555e[_0x1b03('0x2d')];_0x3ffd45[_0x1b03('0x4c')]=qs[_0x1b03('0x36')](_0x5b47ac[_0x1b03('0x2f')][_0x1b03('0x36')]);_0x3ffd45[_0x1b03('0x37')]=qs[_0x1b03('0x38')](_[_0x1b03('0x4d')](_0x5b47ac['query'],_0x3e555e[_0x1b03('0x38')]));if(_0x5b47ac[_0x1b03('0x2f')][_0x1b03('0x39')]){_0x3ffd45[_0x1b03('0x37')]=_[_0x1b03('0x3a')](_0x3ffd45['where'],{'$or':_['map'](_0x3ffd45['attributes'],function(_0x5a4c95){var _0x381e73={};_0x381e73[_0x5a4c95]={'$like':'%'+_0x5b47ac['query'][_0x1b03('0x39')]+'%'};return _0x381e73;})});}_0x3ffd45=_['merge']({},_0x3ffd45,_0x5b47ac['options']);return _0x41b80e[_0x1b03('0x49')](_0x3ffd45);}})['then'](function(_0x5ba8db){if(_0x5ba8db){_0x163352=_0x5ba8db[_0x1b03('0x33')];if(!_0x5b47ac['query']['hasOwnProperty'](_0x1b03('0x35'))){_0x3ffd45[_0x1b03('0x1d')]=qs[_0x1b03('0x1d')](_0x5b47ac[_0x1b03('0x2f')]['limit']);_0x3ffd45[_0x1b03('0x1a')]=qs[_0x1b03('0x1a')](_0x5b47ac[_0x1b03('0x2f')][_0x1b03('0x1a')]);}return _0x41b80e[_0x1b03('0x49')](_0x3ffd45);}})[_0x1b03('0x24')](function(_0x5c882d){if(_0x5c882d){return _0x5c882d?{'count':_0x163352,'rows':_0x5c882d}:null;}})[_0x1b03('0x24')](respondWithResult(_0x975583,null))['catch'](handleError(_0x975583,null));};exports[_0x1b03('0x4e')]=function(_0x32a611,_0x38af20,_0x5b7452){if(_0x32a611[_0x1b03('0x47')]['id']){delete _0x32a611['body']['id'];}return db['ServicenowAccount'][_0x1b03('0x4a')]({'where':{'id':_0x32a611[_0x1b03('0x42')]['id']}})[_0x1b03('0x24')](handleEntityNotFound(_0x38af20,null))['then'](function(_0x138346){if(_0x138346){_0x32a611[_0x1b03('0x47')]['AccountId']=_0x138346['id'];_0x32a611[_0x1b03('0x47')][_0x1b03('0x4f')]=integrations[_0x1b03('0x50')](_0x32a611[_0x1b03('0x47')][_0x1b03('0x51')],_0x32a611[_0x1b03('0x47')][_0x1b03('0x2b')]);_0x32a611['body'][_0x1b03('0x52')]=integrations[_0x1b03('0x53')](_0x32a611['body'][_0x1b03('0x51')],_0x32a611['body'][_0x1b03('0x2b')]);return db[_0x1b03('0x4b')]['create'](_0x32a611['body'],{'include':[{'model':db[_0x1b03('0x54')],'as':_0x1b03('0x4f')},{'model':db[_0x1b03('0x54')],'as':'Descriptions'}]});}return null;})[_0x1b03('0x24')](respondWithResult(_0x38af20,null))[_0x1b03('0x40')](handleError(_0x38af20,null));};exports[_0x1b03('0x55')]=function(_0xc33f57,_0x53b7e0,_0x4634eb){var _0x1be68a=['made_sla',_0x1b03('0x56'),'knowledge',_0x1b03('0x57'),_0x1b03('0x58'),_0x1b03('0x59'),_0x1b03('0x5a'),_0x1b03('0x5b'),'category'];var _0x348ce0=[_0x1b03('0x5c'),'made_sla',_0x1b03('0x5d'),'watch_list',_0x1b03('0x5e'),_0x1b03('0x5f'),_0x1b03('0x60'),_0x1b03('0x56'),_0x1b03('0x61'),_0x1b03('0x62'),'resolved_by','sys_updated_by',_0x1b03('0x63'),'user_input',_0x1b03('0x64'),'sys_domain',_0x1b03('0x65'),_0x1b03('0x66'),_0x1b03('0x67'),_0x1b03('0x4c'),_0x1b03('0x68'),'closed_at','cmdb_ci',_0x1b03('0x69'),_0x1b03('0x6a'),'active',_0x1b03('0x6b'),'business_service',_0x1b03('0x6c'),_0x1b03('0x6d'),_0x1b03('0x6e'),_0x1b03('0x6f'),_0x1b03('0x70'),_0x1b03('0x71'),_0x1b03('0x72'),_0x1b03('0x73'),_0x1b03('0x74'),_0x1b03('0x75'),_0x1b03('0x76'),_0x1b03('0x77'),_0x1b03('0x78'),_0x1b03('0x57'),'work_notes',_0x1b03('0x79'),_0x1b03('0x58'),_0x1b03('0x7a'),_0x1b03('0x7b'),'work_start',_0x1b03('0x7c'),_0x1b03('0x7d'),'additional_assignee_list',_0x1b03('0x7e'),_0x1b03('0x7f'),'notify',_0x1b03('0x80'),_0x1b03('0x81'),_0x1b03('0x82'),_0x1b03('0x83'),_0x1b03('0x84'),_0x1b03('0x85'),'contact_type',_0x1b03('0x86'),_0x1b03('0x5a'),'urgency',_0x1b03('0x87'),'company',_0x1b03('0x88'),'activity_due',_0x1b03('0x89'),'severity',_0x1b03('0x8a'),_0x1b03('0x8b'),_0x1b03('0x8c'),_0x1b03('0x8d'),'due_date',_0x1b03('0x8e'),_0x1b03('0x8f'),_0x1b03('0x90'),_0x1b03('0x91'),_0x1b03('0x92'),_0x1b03('0x93'),_0x1b03('0x94'),'category'];var _0x4b9ad0='';var _0x338c90='';var _0x3b4fc8=[];var _0x41e92f='';var _0x459e80='';var _0x51f7ec=[];var _0x38c7ba='';var _0x26f1c7='';var _0xaae396={};var _0x72f56f='';return db[_0x1b03('0x29')][_0x1b03('0x4a')]({'where':{'id':_0xc33f57[_0x1b03('0x42')]['id']},'attributes':['id',_0x1b03('0x95'),_0x1b03('0x96'),_0x1b03('0x97'),'remoteUri',_0x1b03('0x98')]})[_0x1b03('0x24')](handleEntityNotFound(_0x53b7e0,null))[_0x1b03('0x24')](function(_0x1272a6){if(_0x1272a6){_0x72f56f=_0x1272a6[_0x1b03('0x99')];var _0x5d7914=_0x72f56f[_0x1b03('0x9a')](-0x1);if(_0x5d7914==='/'){_0x72f56f=_0x72f56f[_0x1b03('0x9b')](0x0,_0x72f56f[_0x1b03('0x9c')](_0x5d7914));}_0x26f1c7=util['format'](_0x1b03('0x9d'),_0x72f56f);_0x38c7ba=util['format']('%s/api/now/table/',_0x72f56f);_0xaae396={'user':_0x1272a6[_0x1b03('0x95')],'pass':_0x1272a6[_0x1b03('0x96')]};var _0x588436={'method':_0x1b03('0x9e'),'uri':_0x26f1c7+_0x1b03('0x9f'),'auth':_0xaae396,'json':!![]};return rp(_0x588436);}})[_0x1b03('0x24')](function(_0x40956f){if(_0x40956f[_0x1b03('0xa0')]['length']>0x0){_0x4b9ad0=_0x40956f[_0x1b03('0xa0')];}console[_0x1b03('0xa1')](_0x1b03('0xa2'),_0x4b9ad0);_0x51f7ec=[];_0x338c90=Object[_0x1b03('0xa3')]([],_0x4b9ad0);_[_0x1b03('0xa4')](_0x338c90,function(_0x455c6e){return!_0x1be68a[_0x1b03('0xa5')](_0x455c6e[_0x1b03('0x28')]);});_0x338c90[_0x1b03('0xa6')](function(_0x83049e){var _0x2f696b=createFieldObject(_0x38c7ba,_0xaae396,_0x83049e[_0x1b03('0xa7')],_0x83049e[_0x1b03('0x28')],_0x83049e['label'],![]);_0x51f7ec[_0x1b03('0xa8')](_0x2f696b);});return Promise[_0x1b03('0xa9')](_0x51f7ec);})[_0x1b03('0x24')](function(_0x13bf74){_0x3b4fc8=_0x13bf74;_0x41e92f=Object[_0x1b03('0xa3')]([],_0x4b9ad0);console[_0x1b03('0xa1')](_0x1b03('0xaa'),_0x4b9ad0);_['remove'](_0x41e92f,function(_0x306fcc){return _0x348ce0[_0x1b03('0xa5')](_0x306fcc[_0x1b03('0x28')]);});console[_0x1b03('0xa1')](_0x1b03('0xab'),_0x41e92f);_0x51f7ec=[];_0x41e92f[_0x1b03('0xa6')](function(_0x309147){var _0x3cab07=createFieldObject(_0x38c7ba,_0xaae396,_0x309147['internalType'],_0x309147[_0x1b03('0x28')],_0x309147['label'],!![]);_0x51f7ec['push'](_0x3cab07);});return Promise['all'](_0x51f7ec);})[_0x1b03('0x24')](function(_0x1c5378){_0x459e80=_0x1c5378;var _0x551cdb=_0x3b4fc8[_0x1b03('0xac')](_0x459e80);return{'count':_0x551cdb[_0x1b03('0x33')],'rows':_0x551cdb};})[_0x1b03('0x24')](respondWithResult(_0x53b7e0,null))[_0x1b03('0x40')](function(_0x293461){console['log'](_0x1b03('0xad')+_0x293461);var _0x19da8c=_0xc33f57[_0x1b03('0x2f')]['test']?0x1f4:_0x293461[_0x1b03('0xae')]||0x1f4;logger['error'](_0x293461['stack']);delete _0x293461[_0x1b03('0x28')];if(_0x19da8c===0x191){_0x19da8c=0x190;}_0x53b7e0[_0x1b03('0x19')](_0x19da8c)[_0x1b03('0xaf')](_0xc33f57['query'][_0x1b03('0xb0')]?{'message':_0x1b03('0xb1'),'statusCode':_0x293461[_0x1b03('0xae')]}:_0x293461);});};function createFieldObject(_0x539c40,_0x2dd97b,_0x691b97,_0x4ce68e,_0x4957ee,_0x44cbbe){return new Promise(function(_0x3274fe,_0x2f2d10){var _0x178863={'id':_0x4ce68e,'name':_0x4957ee,'custom':_0x44cbbe};if(_0x691b97===_0x1b03('0xb2')){_0x178863[_0x1b03('0x3c')]=[{'name':_0x1b03('0xb3'),'value':_0x1b03('0xb4')},{'name':_0x1b03('0xb5'),'value':_0x1b03('0xb6')}];_0x3274fe(_0x178863);}else{var _0x457804={'method':_0x1b03('0x9e'),'uri':_0x539c40+_0x1b03('0xb7')+_0x4ce68e,'auth':_0x2dd97b,'json':!![]};return rp(_0x457804)[_0x1b03('0x24')](function(_0x3ffe84){var _0x4d70d5=[];if(_0x3ffe84[_0x1b03('0xa0')][_0x1b03('0x33')]>0x0){_0x3ffe84[_0x1b03('0xa0')][_0x1b03('0xa6')](function(_0x582f4a){if(_0x582f4a['inactive']===_0x1b03('0xb6')){var _0x181464={'name':_0x582f4a[_0x1b03('0xb8')],'value':_0x582f4a[_0x1b03('0xb9')]};_0x4d70d5[_0x1b03('0xa8')](_0x181464);}});}_0x178863[_0x1b03('0x3c')]=_0x4d70d5;if(_0x178863[_0x1b03('0x3c')][_0x1b03('0x33')]>0x0){_0x3274fe(_0x178863);}else{if(_0x44cbbe==![]){_0x3274fe();}else{_0x3274fe(_0x178863);}}});}});} \ No newline at end of file +var _0xa8cc=['value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','length','includeAll','create','body','find','params','getConfigurations','ServicenowConfiguration','addConfiguration','findOne','AccountId','Subjects','getDescriptions','channel','ServicenowField','Descriptions','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','closed_at','cmdb_ci','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','resolved_at','work_notes','delivery_task','work_start','assignment_group','business_stc','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','password','remoteUri','substring','format','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','forEach','internalType','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','test','statusCode','Wrong\x20credentials','boolean','True','true','false','sys_choice?sysparm_query=name=incident^element=','inactive','label'];(function(_0x10714e,_0x25c2c5){var _0x2c7c19=function(_0x2845c0){while(--_0x2845c0){_0x10714e['push'](_0x10714e['shift']());}};_0x2c7c19(++_0x25c2c5);}(_0xa8cc,0xb4));var _0xca8c=function(_0x4d7378,_0x485249){_0x4d7378=_0x4d7378-0x0;var _0x499998=_0xa8cc[_0x4d7378];return _0x499998;};'use strict';var emlformat=require(_0xca8c('0x0'));var rimraf=require(_0xca8c('0x1'));var zipdir=require(_0xca8c('0x2'));var jsonpatch=require(_0xca8c('0x3'));var rp=require(_0xca8c('0x4'));var moment=require(_0xca8c('0x5'));var BPromise=require(_0xca8c('0x6'));var Mustache=require('mustache');var util=require(_0xca8c('0x7'));var path=require(_0xca8c('0x8'));var sox=require('sox');var csv=require(_0xca8c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca8c('0xa'));var _=require(_0xca8c('0xb'));var squel=require('squel');var crypto=require(_0xca8c('0xc'));var jsforce=require(_0xca8c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xca8c('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xca8c('0xf'));var as=require(_0xca8c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xca8c('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xca8c('0x12'));var licenseUtil=require(_0xca8c('0x13'));var db=require(_0xca8c('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x100e03,_0x19dbb2){_0x19dbb2=_0x19dbb2||0xcc;return function(_0xff7ade){if(_0xff7ade){return _0x100e03[_0xca8c('0x15')](_0x19dbb2);}return _0x100e03['status'](_0x19dbb2)[_0xca8c('0x16')]();};}function respondWithResult(_0x3781a6,_0x205a5f){_0x205a5f=_0x205a5f||0xc8;return function(_0xce1a7c){if(_0xce1a7c){return _0x3781a6[_0xca8c('0x17')](_0x205a5f)[_0xca8c('0x18')](_0xce1a7c);}};}function respondWithFilteredResult(_0x31d21d,_0x9e37a0){return function(_0x49f045){if(_0x49f045){var _0xb43e18=typeof _0x9e37a0[_0xca8c('0x19')]===_0xca8c('0x1a')&&typeof _0x9e37a0[_0xca8c('0x1b')]==='undefined';var _0x338c96=_0x49f045[_0xca8c('0x1c')];var _0x5ce367=_0xb43e18?0x0:_0x9e37a0[_0xca8c('0x19')];var _0x1d549e=_0xb43e18?_0x49f045[_0xca8c('0x1c')]:_0x9e37a0['offset']+_0x9e37a0[_0xca8c('0x1b')];var _0x458e3f;if(_0x1d549e>=_0x338c96){_0x1d549e=_0x338c96;_0x458e3f=0xc8;}else{_0x458e3f=0xce;}_0x31d21d[_0xca8c('0x17')](_0x458e3f);return _0x31d21d[_0xca8c('0x1d')]('Content-Range',_0x5ce367+'-'+_0x1d549e+'/'+_0x338c96)[_0xca8c('0x18')](_0x49f045);}return null;};}function patchUpdates(_0x2ba78e){return function(_0x5a04e5){try{jsonpatch[_0xca8c('0x1e')](_0x5a04e5,_0x2ba78e,!![]);}catch(_0x53d7f0){return BPromise['reject'](_0x53d7f0);}return _0x5a04e5[_0xca8c('0x1f')]();};}function saveUpdates(_0x543270,_0x3cb001){return function(_0x25696e){if(_0x25696e){return _0x25696e[_0xca8c('0x20')](_0x543270)['then'](function(_0x11d4db){return _0x11d4db;});}return null;};}function removeEntity(_0x227c7d,_0x3ad150){return function(_0x58b9fb){if(_0x58b9fb){return _0x58b9fb['destroy']()[_0xca8c('0x21')](function(){_0x227c7d['status'](0xcc)[_0xca8c('0x16')]();});}};}function handleEntityNotFound(_0x53f782,_0x1b118a){return function(_0x1dbe2b){if(!_0x1dbe2b){_0x53f782[_0xca8c('0x15')](0x194);}return _0x1dbe2b;};}function handleError(_0x4e424,_0x3ae638){_0x3ae638=_0x3ae638||0x1f4;return function(_0x4ce15a){logger[_0xca8c('0x22')](_0x4ce15a[_0xca8c('0x23')]);if(_0x4ce15a[_0xca8c('0x24')]){delete _0x4ce15a[_0xca8c('0x24')];}_0x4e424[_0xca8c('0x17')](_0x3ae638)[_0xca8c('0x25')](_0x4ce15a);};}exports[_0xca8c('0x26')]=function(_0xa490b0,_0x256b86){var _0x3d8a3f={},_0x232d41={},_0x17ddda={'count':0x0,'rows':[]};var _0x492636=_[_0xca8c('0x27')](db[_0xca8c('0x28')][_0xca8c('0x29')],function(_0x70720e){return{'name':_0x70720e['fieldName'],'type':_0x70720e[_0xca8c('0x2a')]['key']};});_0x232d41['model']=_[_0xca8c('0x27')](_0x492636,_0xca8c('0x24'));_0x232d41[_0xca8c('0x2b')]=_[_0xca8c('0x2c')](_0xa490b0[_0xca8c('0x2b')]);_0x232d41[_0xca8c('0x2d')]=_[_0xca8c('0x2e')](_0x232d41[_0xca8c('0x2f')],_0x232d41[_0xca8c('0x2b')]);_0x3d8a3f[_0xca8c('0x30')]=_[_0xca8c('0x2e')](_0x232d41[_0xca8c('0x2f')],qs['fields'](_0xa490b0['query'][_0xca8c('0x31')]));_0x3d8a3f[_0xca8c('0x30')]=_0x3d8a3f[_0xca8c('0x30')]['length']?_0x3d8a3f['attributes']:_0x232d41['model'];if(!_0xa490b0['query'][_0xca8c('0x32')](_0xca8c('0x33'))){_0x3d8a3f[_0xca8c('0x1b')]=qs[_0xca8c('0x1b')](_0xa490b0['query']['limit']);_0x3d8a3f[_0xca8c('0x19')]=qs[_0xca8c('0x19')](_0xa490b0[_0xca8c('0x2b')]['offset']);}_0x3d8a3f[_0xca8c('0x34')]=qs['sort'](_0xa490b0['query'][_0xca8c('0x35')]);_0x3d8a3f[_0xca8c('0x36')]=qs[_0xca8c('0x2d')](_[_0xca8c('0x37')](_0xa490b0[_0xca8c('0x2b')],_0x232d41['filters']),_0x492636);if(_0xa490b0[_0xca8c('0x2b')][_0xca8c('0x38')]){_0x3d8a3f[_0xca8c('0x36')]=_[_0xca8c('0x39')](_0x3d8a3f['where'],{'$or':_[_0xca8c('0x27')](_0x492636,function(_0x27db8a){if(_0x27db8a[_0xca8c('0x2a')]!==_0xca8c('0x3a')){var _0x278783={};_0x278783[_0x27db8a['name']]={'$like':'%'+_0xa490b0[_0xca8c('0x2b')]['filter']+'%'};return _0x278783;}})});}_0x3d8a3f=_[_0xca8c('0x39')]({},_0x3d8a3f,_0xa490b0[_0xca8c('0x3b')]);var _0x442765={'where':_0x3d8a3f['where']};return db['ServicenowAccount'][_0xca8c('0x1c')](_0x442765)[_0xca8c('0x21')](function(_0x215030){_0x17ddda[_0xca8c('0x1c')]=_0x215030;if(_0xa490b0[_0xca8c('0x2b')]['includeAll']){_0x3d8a3f[_0xca8c('0x3c')]=[{'all':!![]}];}return db[_0xca8c('0x28')][_0xca8c('0x3d')](_0x3d8a3f);})[_0xca8c('0x21')](function(_0x590822){_0x17ddda[_0xca8c('0x3e')]=_0x590822;return _0x17ddda;})['then'](respondWithFilteredResult(_0x256b86,_0x3d8a3f))[_0xca8c('0x3f')](handleError(_0x256b86,null));};exports[_0xca8c('0x40')]=function(_0x2bf706,_0x5265bf){var _0x1f202d={'raw':![],'where':{'id':_0x2bf706['params']['id']}},_0xe4a041={};_0xe4a041[_0xca8c('0x2f')]=_[_0xca8c('0x2c')](db[_0xca8c('0x28')][_0xca8c('0x29')]);_0xe4a041['query']=_[_0xca8c('0x2c')](_0x2bf706[_0xca8c('0x2b')]);_0xe4a041[_0xca8c('0x2d')]=_['intersection'](_0xe4a041['model'],_0xe4a041[_0xca8c('0x2b')]);_0x1f202d['attributes']=_[_0xca8c('0x2e')](_0xe4a041[_0xca8c('0x2f')],qs[_0xca8c('0x31')](_0x2bf706[_0xca8c('0x2b')][_0xca8c('0x31')]));_0x1f202d[_0xca8c('0x30')]=_0x1f202d[_0xca8c('0x30')][_0xca8c('0x41')]?_0x1f202d[_0xca8c('0x30')]:_0xe4a041[_0xca8c('0x2f')];if(_0x2bf706['query'][_0xca8c('0x42')]){_0x1f202d[_0xca8c('0x3c')]=[{'all':!![]}];}_0x1f202d=_['merge']({},_0x1f202d,_0x2bf706[_0xca8c('0x3b')]);return db[_0xca8c('0x28')]['find'](_0x1f202d)['then'](handleEntityNotFound(_0x5265bf,null))['then'](respondWithResult(_0x5265bf,null))['catch'](handleError(_0x5265bf,null));};exports[_0xca8c('0x43')]=function(_0x2dc04b,_0xd804d){return db['ServicenowAccount'][_0xca8c('0x43')](_0x2dc04b[_0xca8c('0x44')],{})[_0xca8c('0x21')](respondWithResult(_0xd804d,0xc9))[_0xca8c('0x3f')](handleError(_0xd804d,null));};exports['update']=function(_0x2377b4,_0x160f21){if(_0x2377b4[_0xca8c('0x44')]['id']){delete _0x2377b4[_0xca8c('0x44')]['id'];}return db[_0xca8c('0x28')][_0xca8c('0x45')]({'where':{'id':_0x2377b4[_0xca8c('0x46')]['id']}})[_0xca8c('0x21')](handleEntityNotFound(_0x160f21,null))[_0xca8c('0x21')](saveUpdates(_0x2377b4[_0xca8c('0x44')],null))[_0xca8c('0x21')](respondWithResult(_0x160f21,null))[_0xca8c('0x3f')](handleError(_0x160f21,null));};exports['destroy']=function(_0x4fa7c8,_0x48db41){return db[_0xca8c('0x28')][_0xca8c('0x45')]({'where':{'id':_0x4fa7c8[_0xca8c('0x46')]['id']}})['then'](handleEntityNotFound(_0x48db41,null))['then'](removeEntity(_0x48db41,null))[_0xca8c('0x3f')](handleError(_0x48db41,null));};exports[_0xca8c('0x47')]=function(_0x12cff7,_0x50950e,_0x183f0b){var _0x1bbe1b={};var _0x7fb958={};var _0x976681;var _0x30d328;return db[_0xca8c('0x28')]['findOne']({'where':{'id':_0x12cff7[_0xca8c('0x46')]['id']}})[_0xca8c('0x21')](handleEntityNotFound(_0x50950e,null))[_0xca8c('0x21')](function(_0x391160){if(_0x391160){_0x976681=_0x391160;_0x7fb958[_0xca8c('0x2f')]=_[_0xca8c('0x2c')](db[_0xca8c('0x48')][_0xca8c('0x29')]);_0x7fb958['query']=_[_0xca8c('0x2c')](_0x12cff7[_0xca8c('0x2b')]);_0x7fb958[_0xca8c('0x2d')]=_['intersection'](_0x7fb958[_0xca8c('0x2f')],_0x7fb958[_0xca8c('0x2b')]);_0x1bbe1b['attributes']=_[_0xca8c('0x2e')](_0x7fb958[_0xca8c('0x2f')],qs[_0xca8c('0x31')](_0x12cff7[_0xca8c('0x2b')][_0xca8c('0x31')]));_0x1bbe1b[_0xca8c('0x30')]=_0x1bbe1b[_0xca8c('0x30')][_0xca8c('0x41')]?_0x1bbe1b['attributes']:_0x7fb958[_0xca8c('0x2f')];_0x1bbe1b[_0xca8c('0x34')]=qs[_0xca8c('0x35')](_0x12cff7[_0xca8c('0x2b')][_0xca8c('0x35')]);_0x1bbe1b[_0xca8c('0x36')]=qs['filters'](_[_0xca8c('0x37')](_0x12cff7[_0xca8c('0x2b')],_0x7fb958['filters']));if(_0x12cff7[_0xca8c('0x2b')][_0xca8c('0x38')]){_0x1bbe1b[_0xca8c('0x36')]=_[_0xca8c('0x39')](_0x1bbe1b['where'],{'$or':_[_0xca8c('0x27')](_0x1bbe1b[_0xca8c('0x30')],function(_0x18c266){var _0x8a1af7={};_0x8a1af7[_0x18c266]={'$like':'%'+_0x12cff7[_0xca8c('0x2b')][_0xca8c('0x38')]+'%'};return _0x8a1af7;})});}_0x1bbe1b=_[_0xca8c('0x39')]({},_0x1bbe1b,_0x12cff7['options']);return _0x976681['getConfigurations'](_0x1bbe1b);}})[_0xca8c('0x21')](function(_0x3a3fc6){if(_0x3a3fc6){_0x30d328=_0x3a3fc6[_0xca8c('0x41')];if(!_0x12cff7['query']['hasOwnProperty']('nolimit')){_0x1bbe1b['limit']=qs[_0xca8c('0x1b')](_0x12cff7[_0xca8c('0x2b')][_0xca8c('0x1b')]);_0x1bbe1b[_0xca8c('0x19')]=qs[_0xca8c('0x19')](_0x12cff7[_0xca8c('0x2b')][_0xca8c('0x19')]);}return _0x976681['getConfigurations'](_0x1bbe1b);}})[_0xca8c('0x21')](function(_0x9d8628){if(_0x9d8628){return _0x9d8628?{'count':_0x30d328,'rows':_0x9d8628}:null;}})[_0xca8c('0x21')](respondWithResult(_0x50950e,null))[_0xca8c('0x3f')](handleError(_0x50950e,null));};exports[_0xca8c('0x49')]=function(_0x84932a,_0x3b494e,_0x14c8a1){if(_0x84932a[_0xca8c('0x44')]['id']){delete _0x84932a['body']['id'];}return db['ServicenowAccount'][_0xca8c('0x4a')]({'where':{'id':_0x84932a[_0xca8c('0x46')]['id']}})[_0xca8c('0x21')](handleEntityNotFound(_0x3b494e,null))[_0xca8c('0x21')](function(_0x24ffc2){if(_0x24ffc2){_0x84932a['body'][_0xca8c('0x4b')]=_0x24ffc2['id'];_0x84932a[_0xca8c('0x44')][_0xca8c('0x4c')]=integrations['getSubjects'](_0x84932a[_0xca8c('0x44')]['channel'],_0x84932a[_0xca8c('0x44')][_0xca8c('0x2a')]);_0x84932a['body']['Descriptions']=integrations[_0xca8c('0x4d')](_0x84932a[_0xca8c('0x44')][_0xca8c('0x4e')],_0x84932a[_0xca8c('0x44')]['type']);return db[_0xca8c('0x48')]['create'](_0x84932a[_0xca8c('0x44')],{'include':[{'model':db[_0xca8c('0x4f')],'as':_0xca8c('0x4c')},{'model':db[_0xca8c('0x4f')],'as':_0xca8c('0x50')}]});}return null;})[_0xca8c('0x21')](respondWithResult(_0x3b494e,null))[_0xca8c('0x3f')](handleError(_0x3b494e,null));};exports[_0xca8c('0x51')]=function(_0x252a72,_0x133d0a,_0x5dd718){var _0x388a95=[_0xca8c('0x52'),_0xca8c('0x53'),_0xca8c('0x54'),_0xca8c('0x55'),_0xca8c('0x56'),_0xca8c('0x57'),_0xca8c('0x58'),_0xca8c('0x59'),_0xca8c('0x5a')];var _0x548119=[_0xca8c('0x5b'),_0xca8c('0x52'),'caused_by',_0xca8c('0x5c'),_0xca8c('0x5d'),_0xca8c('0x5e'),'child_incidents',_0xca8c('0x53'),_0xca8c('0x5f'),_0xca8c('0x60'),_0xca8c('0x61'),_0xca8c('0x62'),_0xca8c('0x63'),_0xca8c('0x64'),_0xca8c('0x65'),_0xca8c('0x66'),_0xca8c('0x67'),_0xca8c('0x68'),_0xca8c('0x54'),_0xca8c('0x34'),'calendar_stc',_0xca8c('0x69'),_0xca8c('0x6a'),'delivery_plan',_0xca8c('0x6b'),_0xca8c('0x6c'),'work_notes_list',_0xca8c('0x6d'),_0xca8c('0x6e'),_0xca8c('0x6f'),_0xca8c('0x70'),_0xca8c('0x71'),_0xca8c('0x72'),_0xca8c('0x73'),_0xca8c('0x74'),'group_list',_0xca8c('0x75'),'reopened_time',_0xca8c('0x76'),'caller_id','approval_set',_0xca8c('0x55'),_0xca8c('0x77'),'short_description',_0xca8c('0x56'),'correlation_display',_0xca8c('0x78'),_0xca8c('0x79'),_0xca8c('0x7a'),_0xca8c('0x7b'),'additional_assignee_list',_0xca8c('0x7c'),'calendar_duration','notify',_0xca8c('0x7d'),_0xca8c('0x7e'),_0xca8c('0x7f'),_0xca8c('0x80'),_0xca8c('0x81'),_0xca8c('0x82'),_0xca8c('0x83'),'reopened_by',_0xca8c('0x58'),_0xca8c('0x84'),_0xca8c('0x85'),_0xca8c('0x86'),'reassignment_count',_0xca8c('0x87'),'assigned_to',_0xca8c('0x59'),_0xca8c('0x88'),_0xca8c('0x89'),_0xca8c('0x8a'),_0xca8c('0x8b'),_0xca8c('0x8c'),_0xca8c('0x8d'),'reopen_count',_0xca8c('0x8e'),_0xca8c('0x8f'),_0xca8c('0x90'),_0xca8c('0x91'),_0xca8c('0x92'),'category'];var _0x33131c='';var _0x261dfc='';var _0x5d2933=[];var _0x17e160='';var _0x338a2b='';var _0xab18cd=[];var _0x317c89='';var _0x56cd4f='';var _0x1bf477={};var _0x4aabbd='';return db[_0xca8c('0x28')][_0xca8c('0x4a')]({'where':{'id':_0x252a72['params']['id']},'attributes':['id','username',_0xca8c('0x93'),'email',_0xca8c('0x94'),'serverUrl']})[_0xca8c('0x21')](handleEntityNotFound(_0x133d0a,null))[_0xca8c('0x21')](function(_0x136645){if(_0x136645){_0x4aabbd=_0x136645[_0xca8c('0x94')];var _0x112907=_0x4aabbd['slice'](-0x1);if(_0x112907==='/'){_0x4aabbd=_0x4aabbd[_0xca8c('0x95')](0x0,_0x4aabbd['lastIndexOf'](_0x112907));}_0x56cd4f=util[_0xca8c('0x96')]('%s/api/now/doc/table/schema/',_0x4aabbd);_0x317c89=util[_0xca8c('0x96')](_0xca8c('0x97'),_0x4aabbd);_0x1bf477={'user':_0x136645[_0xca8c('0x98')],'pass':_0x136645['password']};var _0x334859={'method':_0xca8c('0x99'),'uri':_0x56cd4f+_0xca8c('0x9a'),'auth':_0x1bf477,'json':!![]};return rp(_0x334859);}})['then'](function(_0x197508){if(_0x197508[_0xca8c('0x9b')][_0xca8c('0x41')]>0x0){_0x33131c=_0x197508[_0xca8c('0x9b')];}console[_0xca8c('0x9c')](_0xca8c('0x9d'),_0x33131c);_0xab18cd=[];_0x261dfc=Object[_0xca8c('0x9e')]([],_0x33131c);_[_0xca8c('0x9f')](_0x261dfc,function(_0x2bf349){return!_0x388a95['includes'](_0x2bf349[_0xca8c('0x24')]);});_0x261dfc[_0xca8c('0xa0')](function(_0x247600){var _0x45a131=createFieldObject(_0x317c89,_0x1bf477,_0x247600[_0xca8c('0xa1')],_0x247600[_0xca8c('0x24')],_0x247600['label'],![]);_0xab18cd['push'](_0x45a131);});return Promise[_0xca8c('0xa2')](_0xab18cd);})[_0xca8c('0x21')](function(_0x1ff06c){_0x5d2933=_0x1ff06c;_0x17e160=Object['assign']([],_0x33131c);console[_0xca8c('0x9c')](_0xca8c('0xa3'),_0x33131c);_[_0xca8c('0x9f')](_0x17e160,function(_0xf2f36){return _0x548119[_0xca8c('0xa4')](_0xf2f36['name']);});console[_0xca8c('0x9c')](_0xca8c('0xa5'),_0x17e160);_0xab18cd=[];_0x17e160['forEach'](function(_0x25dea8){var _0x12c564=createFieldObject(_0x317c89,_0x1bf477,_0x25dea8[_0xca8c('0xa1')],_0x25dea8[_0xca8c('0x24')],_0x25dea8['label'],!![]);_0xab18cd[_0xca8c('0xa6')](_0x12c564);});return Promise[_0xca8c('0xa2')](_0xab18cd);})['then'](function(_0x45a37c){_0x338a2b=_0x45a37c;var _0x42ccc4=_0x5d2933[_0xca8c('0xa7')](_0x338a2b);return{'count':_0x42ccc4[_0xca8c('0x41')],'rows':_0x42ccc4};})[_0xca8c('0x21')](respondWithResult(_0x133d0a,null))['catch'](function(_0x1a3d50){console[_0xca8c('0x9c')]('ServiceNow\x20error:\x20'+_0x1a3d50);var _0x4d8077=_0x252a72[_0xca8c('0x2b')][_0xca8c('0xa8')]?0x1f4:_0x1a3d50[_0xca8c('0xa9')]||0x1f4;logger[_0xca8c('0x22')](_0x1a3d50[_0xca8c('0x23')]);delete _0x1a3d50[_0xca8c('0x24')];if(_0x4d8077===0x191){_0x4d8077=0x190;}_0x133d0a[_0xca8c('0x17')](_0x4d8077)[_0xca8c('0x25')](_0x252a72[_0xca8c('0x2b')]['test']?{'message':_0xca8c('0xaa'),'statusCode':_0x1a3d50[_0xca8c('0xa9')]}:_0x1a3d50);});};function createFieldObject(_0x31ff76,_0x414040,_0x11d5c8,_0x1ba73f,_0x41378d,_0x3e2e1d){return new Promise(function(_0x1ad08c,_0x2a999e){var _0x8cbce7={'id':_0x1ba73f,'name':_0x41378d,'custom':_0x3e2e1d};if(_0x11d5c8===_0xca8c('0xab')){_0x8cbce7['options']=[{'name':_0xca8c('0xac'),'value':_0xca8c('0xad')},{'name':'False','value':_0xca8c('0xae')}];_0x1ad08c(_0x8cbce7);}else{var _0x5b7e04={'method':_0xca8c('0x99'),'uri':_0x31ff76+_0xca8c('0xaf')+_0x1ba73f,'auth':_0x414040,'json':!![]};return rp(_0x5b7e04)[_0xca8c('0x21')](function(_0x1fc6ec){var _0x41fd73=[];if(_0x1fc6ec['result'][_0xca8c('0x41')]>0x0){_0x1fc6ec[_0xca8c('0x9b')]['forEach'](function(_0x384023){if(_0x384023[_0xca8c('0xb0')]==='false'){var _0x550368={'name':_0x384023[_0xca8c('0xb1')],'value':_0x384023[_0xca8c('0xb2')]};_0x41fd73[_0xca8c('0xa6')](_0x550368);}});}_0x8cbce7[_0xca8c('0x3b')]=_0x41fd73;if(_0x8cbce7['options']['length']>0x0){_0x1ad08c(_0x8cbce7);}else{if(_0x3e2e1d==![]){_0x1ad08c();}else{_0x1ad08c(_0x8cbce7);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 927e6e2..2583214 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 _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0x5496,0x175));var _0x6549=function(_0x47a198,_0x223cb2){_0x47a198=_0x47a198-0x0;var _0x4785a2=_0x5496[_0x47a198];return _0x4785a2;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x43cb17,_0x1d8cea){return _0x43cb17['define'](_0x6549('0x9'),attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x29df20,_0x2ac0b7){var _0x182a73=function(_0x1d589a){while(--_0x1d589a){_0x29df20['push'](_0x29df20['shift']());}};_0x182a73(++_0x2ac0b7);}(_0x4975,0x86));var _0x5497=function(_0x182170,_0x422544){_0x182170=_0x182170-0x0;var _0x33a7e1=_0x4975[_0x182170];return _0x33a7e1;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));var integrations=require(_0x5497('0xa'));module['exports']=function(_0x37e48d,_0x4f563d){return _0x37e48d[_0x5497('0xb')](_0x5497('0xc'),attributes,{'tableName':_0x5497('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 67f4c2d..80864fd 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 _0xfe7b=['then','info','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','ServicenowAccount','findAll','options','raw','where','attributes','include','map','model','GetServicenowAccount','debug','ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2e0ffa,_0x451f12){var _0x24d627=function(_0x4d0f09){while(--_0x4d0f09){_0x2e0ffa['push'](_0x2e0ffa['shift']());}};_0x24d627(++_0x451f12);}(_0xfe7b,0x82));var _0xbfe7=function(_0x96b6a,_0x12471d){_0x96b6a=_0x96b6a-0x0;var _0x3e16f3=_0xfe7b[_0x96b6a];return _0x3e16f3;};'use strict';var _=require(_0xbfe7('0x0'));var util=require(_0xbfe7('0x1'));var moment=require(_0xbfe7('0x2'));var BPromise=require(_0xbfe7('0x3'));var rs=require(_0xbfe7('0x4'));var fs=require('fs');var Redis=require(_0xbfe7('0x5'));var db=require(_0xbfe7('0x6'))['db'];var utils=require(_0xbfe7('0x7'));var logger=require(_0xbfe7('0x8'))(_0xbfe7('0x9'));var config=require(_0xbfe7('0xa'));var jayson=require(_0xbfe7('0xb'));var client=jayson['client'][_0xbfe7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57a439,_0x26fa9f,_0x27b66f){return new BPromise(function(_0x7649b5,_0x531a92){return client[_0xbfe7('0xd')](_0x57a439,_0x27b66f)[_0xbfe7('0xe')](function(_0x2b2366){logger[_0xbfe7('0xf')](_0xbfe7('0x10'),_0x26fa9f,'request\x20sent');logger['debug'](_0xbfe7('0x11'),_0x26fa9f,_0xbfe7('0x12'),JSON[_0xbfe7('0x13')](_0x2b2366));if(_0x2b2366[_0xbfe7('0x14')]){if(_0x2b2366['error']['code']===0x1f4){logger['error'](_0xbfe7('0x10'),_0x26fa9f,_0x2b2366[_0xbfe7('0x14')][_0xbfe7('0x15')]);return _0x531a92(_0x2b2366['error'][_0xbfe7('0x15')]);}logger['error'](_0xbfe7('0x10'),_0x26fa9f,_0x2b2366[_0xbfe7('0x14')][_0xbfe7('0x15')]);return _0x7649b5(_0x2b2366[_0xbfe7('0x14')][_0xbfe7('0x15')]);}else{logger[_0xbfe7('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x26fa9f,_0xbfe7('0x12'));_0x7649b5(_0x2b2366['result']['message']);}})[_0xbfe7('0x16')](function(_0xb4fb61){logger[_0xbfe7('0x14')](_0xbfe7('0x10'),_0x26fa9f,_0xb4fb61);_0x531a92(_0xb4fb61);});});}exports['GetServicenowAccount']=function(_0x1dc6c4){var _0x4d8f04=this;return new Promise(function(_0x20668b,_0x30ce71){return db[_0xbfe7('0x17')][_0xbfe7('0x18')]({'raw':_0x1dc6c4[_0xbfe7('0x19')]?_0x1dc6c4[_0xbfe7('0x19')][_0xbfe7('0x1a')]===undefined?!![]:![]:!![],'where':_0x1dc6c4[_0xbfe7('0x19')]?_0x1dc6c4['options'][_0xbfe7('0x1b')]||null:null,'attributes':_0x1dc6c4[_0xbfe7('0x19')]?_0x1dc6c4[_0xbfe7('0x19')][_0xbfe7('0x1c')]||null:null,'limit':_0x1dc6c4[_0xbfe7('0x19')]?_0x1dc6c4[_0xbfe7('0x19')]['limit']||null:null,'include':_0x1dc6c4[_0xbfe7('0x19')]?_0x1dc6c4[_0xbfe7('0x19')][_0xbfe7('0x1d')]?_[_0xbfe7('0x1e')](_0x1dc6c4[_0xbfe7('0x19')][_0xbfe7('0x1d')],function(_0x290660){return{'model':db[_0x290660[_0xbfe7('0x1f')]],'as':_0x290660['as'],'attributes':_0x290660[_0xbfe7('0x1c')],'include':_0x290660[_0xbfe7('0x1d')]?_[_0xbfe7('0x1e')](_0x290660[_0xbfe7('0x1d')],function(_0x3a2dfd){return{'model':db[_0x3a2dfd[_0xbfe7('0x1f')]],'as':_0x3a2dfd['as'],'attributes':_0x3a2dfd[_0xbfe7('0x1c')],'include':_0x3a2dfd[_0xbfe7('0x1d')]?_[_0xbfe7('0x1e')](_0x3a2dfd['include'],function(_0x1e3c4c){return{'model':db[_0x1e3c4c['model']],'as':_0x1e3c4c['as'],'attributes':_0x1e3c4c[_0xbfe7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbfe7('0xe')](function(_0x200ecd){logger[_0xbfe7('0xf')](_0xbfe7('0x20'),_0x1dc6c4);logger[_0xbfe7('0x21')]('GetServicenowAccount',_0x1dc6c4,JSON[_0xbfe7('0x13')](_0x200ecd));_0x20668b(_0x200ecd);})[_0xbfe7('0x16')](function(_0x576346){logger[_0xbfe7('0x14')](_0xbfe7('0x20'),_0x576346[_0xbfe7('0x15')],_0x1dc6c4);_0x30ce71(_0x4d8f04[_0xbfe7('0x14')](0x1f4,_0x576346['message']));});});};exports[_0xbfe7('0x22')]=function(_0x31096b){var _0x4b4ebf=this;return new Promise(function(_0x2222bd,_0x2660bc){return db['ServicenowAccount'][_0xbfe7('0x23')]({'raw':_0x31096b['options']?_0x31096b[_0xbfe7('0x19')][_0xbfe7('0x1a')]===undefined?!![]:![]:!![],'where':_0x31096b[_0xbfe7('0x19')]?_0x31096b[_0xbfe7('0x19')][_0xbfe7('0x1b')]||null:null,'attributes':_0x31096b[_0xbfe7('0x19')]?_0x31096b['options'][_0xbfe7('0x1c')]||null:null,'include':_0x31096b[_0xbfe7('0x19')]?_0x31096b[_0xbfe7('0x19')][_0xbfe7('0x1d')]?_['map'](_0x31096b['options'][_0xbfe7('0x1d')],function(_0x36ac82){return{'model':db[_0x36ac82[_0xbfe7('0x1f')]],'as':_0x36ac82['as'],'attributes':_0x36ac82[_0xbfe7('0x1c')],'include':_0x36ac82['include']?_['map'](_0x36ac82['include'],function(_0x6892da){return{'model':db[_0x6892da[_0xbfe7('0x1f')]],'as':_0x6892da['as'],'attributes':_0x6892da[_0xbfe7('0x1c')],'include':_0x6892da[_0xbfe7('0x1d')]?_[_0xbfe7('0x1e')](_0x6892da[_0xbfe7('0x1d')],function(_0x442b7a){return{'model':db[_0x442b7a[_0xbfe7('0x1f')]],'as':_0x442b7a['as'],'attributes':_0x442b7a['attributes']};}):[]};}):[]};}):[]:[]})[_0xbfe7('0xe')](function(_0x52ce88){logger[_0xbfe7('0xf')](_0xbfe7('0x22'),_0x31096b);logger[_0xbfe7('0x21')](_0xbfe7('0x22'),_0x31096b,JSON[_0xbfe7('0x13')](_0x52ce88));_0x2222bd(_0x52ce88);})[_0xbfe7('0x16')](function(_0x3fa2bb){logger[_0xbfe7('0x14')](_0xbfe7('0x22'),_0x3fa2bb['message'],_0x31096b);_0x2660bc(_0x4b4ebf[_0xbfe7('0x14')](0x1f4,_0x3fa2bb[_0xbfe7('0x15')]));});});}; \ No newline at end of file +var _0xcae6=['options','where','attributes','limit','include','model','map','GetServicenowAccount','find','raw','ShowServicenowAccount','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ServicenowAccount','findAll'];(function(_0x4bd950,_0x184ed5){var _0x5dc59a=function(_0x6ff30f){while(--_0x6ff30f){_0x4bd950['push'](_0x4bd950['shift']());}};_0x5dc59a(++_0x184ed5);}(_0xcae6,0x1ae));var _0x6cae=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0xcae6[_0x25701b];return _0x3a8a2c;};'use strict';var _=require(_0x6cae('0x0'));var util=require(_0x6cae('0x1'));var moment=require(_0x6cae('0x2'));var BPromise=require(_0x6cae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6cae('0x4'));var db=require(_0x6cae('0x5'))['db'];var utils=require(_0x6cae('0x6'));var logger=require('../../config/logger')(_0x6cae('0x7'));var config=require(_0x6cae('0x8'));var jayson=require(_0x6cae('0x9'));var client=jayson[_0x6cae('0xa')][_0x6cae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14a922,_0x5b7120,_0xd9fb85){return new BPromise(function(_0x33bffb,_0x469fe9){return client[_0x6cae('0xc')](_0x14a922,_0xd9fb85)[_0x6cae('0xd')](function(_0x208f8f){logger[_0x6cae('0xe')](_0x6cae('0xf'),_0x5b7120,_0x6cae('0x10'));logger[_0x6cae('0x11')](_0x6cae('0x12'),_0x5b7120,_0x6cae('0x10'),JSON['stringify'](_0x208f8f));if(_0x208f8f[_0x6cae('0x13')]){if(_0x208f8f[_0x6cae('0x13')][_0x6cae('0x14')]===0x1f4){logger[_0x6cae('0x13')](_0x6cae('0xf'),_0x5b7120,_0x208f8f[_0x6cae('0x13')][_0x6cae('0x15')]);return _0x469fe9(_0x208f8f[_0x6cae('0x13')][_0x6cae('0x15')]);}logger[_0x6cae('0x13')](_0x6cae('0xf'),_0x5b7120,_0x208f8f[_0x6cae('0x13')][_0x6cae('0x15')]);return _0x33bffb(_0x208f8f['error']['message']);}else{logger['info'](_0x6cae('0xf'),_0x5b7120,_0x6cae('0x10'));_0x33bffb(_0x208f8f[_0x6cae('0x16')][_0x6cae('0x15')]);}})[_0x6cae('0x17')](function(_0x52f36c){logger[_0x6cae('0x13')](_0x6cae('0xf'),_0x5b7120,_0x52f36c);_0x469fe9(_0x52f36c);});});}exports['GetServicenowAccount']=function(_0x3da136){var _0x3cb872=this;return new Promise(function(_0x475832,_0x1faca1){return db[_0x6cae('0x18')][_0x6cae('0x19')]({'raw':_0x3da136[_0x6cae('0x1a')]?_0x3da136[_0x6cae('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3da136[_0x6cae('0x1a')]?_0x3da136[_0x6cae('0x1a')][_0x6cae('0x1b')]||null:null,'attributes':_0x3da136[_0x6cae('0x1a')]?_0x3da136[_0x6cae('0x1a')][_0x6cae('0x1c')]||null:null,'limit':_0x3da136[_0x6cae('0x1a')]?_0x3da136['options'][_0x6cae('0x1d')]||null:null,'include':_0x3da136['options']?_0x3da136[_0x6cae('0x1a')][_0x6cae('0x1e')]?_['map'](_0x3da136[_0x6cae('0x1a')][_0x6cae('0x1e')],function(_0x2f8b47){return{'model':db[_0x2f8b47[_0x6cae('0x1f')]],'as':_0x2f8b47['as'],'attributes':_0x2f8b47[_0x6cae('0x1c')],'include':_0x2f8b47[_0x6cae('0x1e')]?_[_0x6cae('0x20')](_0x2f8b47[_0x6cae('0x1e')],function(_0x55f644){return{'model':db[_0x55f644['model']],'as':_0x55f644['as'],'attributes':_0x55f644[_0x6cae('0x1c')],'include':_0x55f644['include']?_[_0x6cae('0x20')](_0x55f644['include'],function(_0xa0ffb4){return{'model':db[_0xa0ffb4[_0x6cae('0x1f')]],'as':_0xa0ffb4['as'],'attributes':_0xa0ffb4[_0x6cae('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6cae('0xd')](function(_0x46de5e){logger[_0x6cae('0xe')](_0x6cae('0x21'),_0x3da136);logger[_0x6cae('0x11')](_0x6cae('0x21'),_0x3da136,JSON['stringify'](_0x46de5e));_0x475832(_0x46de5e);})[_0x6cae('0x17')](function(_0x4dc3cb){logger['error'](_0x6cae('0x21'),_0x4dc3cb[_0x6cae('0x15')],_0x3da136);_0x1faca1(_0x3cb872[_0x6cae('0x13')](0x1f4,_0x4dc3cb[_0x6cae('0x15')]));});});};exports['ShowServicenowAccount']=function(_0x5c83e1){var _0xa80a9c=this;return new Promise(function(_0x21ec87,_0x24a756){return db[_0x6cae('0x18')][_0x6cae('0x22')]({'raw':_0x5c83e1[_0x6cae('0x1a')]?_0x5c83e1[_0x6cae('0x1a')][_0x6cae('0x23')]===undefined?!![]:![]:!![],'where':_0x5c83e1['options']?_0x5c83e1['options'][_0x6cae('0x1b')]||null:null,'attributes':_0x5c83e1[_0x6cae('0x1a')]?_0x5c83e1[_0x6cae('0x1a')][_0x6cae('0x1c')]||null:null,'include':_0x5c83e1[_0x6cae('0x1a')]?_0x5c83e1[_0x6cae('0x1a')]['include']?_[_0x6cae('0x20')](_0x5c83e1[_0x6cae('0x1a')][_0x6cae('0x1e')],function(_0x4bd33e){return{'model':db[_0x4bd33e[_0x6cae('0x1f')]],'as':_0x4bd33e['as'],'attributes':_0x4bd33e[_0x6cae('0x1c')],'include':_0x4bd33e[_0x6cae('0x1e')]?_[_0x6cae('0x20')](_0x4bd33e['include'],function(_0x45773d){return{'model':db[_0x45773d[_0x6cae('0x1f')]],'as':_0x45773d['as'],'attributes':_0x45773d[_0x6cae('0x1c')],'include':_0x45773d[_0x6cae('0x1e')]?_[_0x6cae('0x20')](_0x45773d['include'],function(_0x2c6171){return{'model':db[_0x2c6171[_0x6cae('0x1f')]],'as':_0x2c6171['as'],'attributes':_0x2c6171[_0x6cae('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6cae('0xd')](function(_0xaee04){logger[_0x6cae('0xe')](_0x6cae('0x24'),_0x5c83e1);logger[_0x6cae('0x11')](_0x6cae('0x24'),_0x5c83e1,JSON[_0x6cae('0x25')](_0xaee04));_0x21ec87(_0xaee04);})[_0x6cae('0x17')](function(_0x47cf89){logger[_0x6cae('0x13')]('ShowServicenowAccount',_0x47cf89[_0x6cae('0x15')],_0x5c83e1);_0x24a756(_0xa80a9c['error'](0x1f4,_0x47cf89[_0x6cae('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index d394b5b..48bfd14 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 _0xfc7f=['getDescriptions','post','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x182cdd,_0x20c7d1){var _0x5c4424=function(_0x15ce57){while(--_0x15ce57){_0x182cdd['push'](_0x182cdd['shift']());}};_0x5c4424(++_0x20c7d1);}(_0xfc7f,0x1ce));var _0xffc7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfc7f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xffc7('0x0'));var path=require(_0xffc7('0x1'));var timeout=require(_0xffc7('0x2'));var express=require(_0xffc7('0x3'));var router=express[_0xffc7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xffc7('0x5'));var interaction=require(_0xffc7('0x6'));var config=require(_0xffc7('0x7'));var controller=require(_0xffc7('0x8'));router[_0xffc7('0x9')]('/',auth['isAuthenticated'](),controller[_0xffc7('0xa')]);router[_0xffc7('0x9')](_0xffc7('0xb'),auth[_0xffc7('0xc')](),controller['show']);router[_0xffc7('0x9')](_0xffc7('0xd'),auth[_0xffc7('0xc')](),controller[_0xffc7('0xe')]);router[_0xffc7('0x9')](_0xffc7('0xf'),auth[_0xffc7('0xc')](),controller[_0xffc7('0x10')]);router['get'](_0xffc7('0x11'),auth[_0xffc7('0xc')](),controller[_0xffc7('0x12')]);router[_0xffc7('0x13')]('/',auth[_0xffc7('0xc')](),controller['create']);router[_0xffc7('0x14')](_0xffc7('0xb'),auth[_0xffc7('0xc')](),controller['update']);router[_0xffc7('0x15')](_0xffc7('0xb'),auth[_0xffc7('0xc')](),controller[_0xffc7('0x16')]);module[_0xffc7('0x17')]=router; \ No newline at end of file +var _0xa78a=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0xa78a,0x18a));var _0xaa78=function(_0x2c4d09,_0x319082){_0x2c4d09=_0x2c4d09-0x0;var _0x587d64=_0xa78a[_0x2c4d09];return _0x587d64;};'use strict';var multer=require(_0xaa78('0x0'));var util=require(_0xaa78('0x1'));var path=require(_0xaa78('0x2'));var timeout=require(_0xaa78('0x3'));var express=require(_0xaa78('0x4'));var router=express['Router']();var fs_extra=require(_0xaa78('0x5'));var auth=require(_0xaa78('0x6'));var interaction=require(_0xaa78('0x7'));var config=require(_0xaa78('0x8'));var controller=require(_0xaa78('0x9'));router[_0xaa78('0xa')]('/',auth[_0xaa78('0xb')](),controller[_0xaa78('0xc')]);router[_0xaa78('0xa')](_0xaa78('0xd'),auth['isAuthenticated'](),controller[_0xaa78('0xe')]);router[_0xaa78('0xa')](_0xaa78('0xf'),auth[_0xaa78('0xb')](),controller[_0xaa78('0x10')]);router[_0xaa78('0xa')](_0xaa78('0x11'),auth[_0xaa78('0xb')](),controller[_0xaa78('0x12')]);router['get'](_0xaa78('0x13'),auth[_0xaa78('0xb')](),controller[_0xaa78('0x14')]);router['post']('/',auth[_0xaa78('0xb')](),controller['create']);router[_0xaa78('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xaa78('0x16')]);router[_0xaa78('0x17')](_0xaa78('0xd'),auth['isAuthenticated'](),controller[_0xaa78('0x18')]);module[_0xaa78('0x19')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 7b51021..63ff88b 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 _0xe39c=['STRING','sequelize','exports'];(function(_0x5f044d,_0xd31e46){var _0x4e5f84=function(_0x284fa5){while(--_0x284fa5){_0x5f044d['push'](_0x5f044d['shift']());}};_0x4e5f84(++_0xd31e46);}(_0xe39c,0x166));var _0xce39=function(_0x5a63c4,_0x475187){_0x5a63c4=_0x5a63c4-0x0;var _0x433339=_0xe39c[_0x5a63c4];return _0x433339;};'use strict';var Sequelize=require(_0xce39('0x0'));module[_0xce39('0x1')]={'name':{'type':Sequelize[_0xce39('0x2')]},'description':{'type':Sequelize[_0xce39('0x2')]}}; \ No newline at end of file +var _0xc8a8=['STRING','sequelize'];(function(_0x26a3fe,_0x1a5471){var _0x33f708=function(_0x468152){while(--_0x468152){_0x26a3fe['push'](_0x26a3fe['shift']());}};_0x33f708(++_0x1a5471);}(_0xc8a8,0x73));var _0x8c8a=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0xc8a8[_0x1627ae];return _0x34b38f;};'use strict';var Sequelize=require(_0x8c8a('0x0'));module['exports']={'name':{'type':Sequelize[_0x8c8a('0x1')]},'description':{'type':Sequelize[_0x8c8a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 5bac837..91506eb 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 _0x761d=['jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','offset','undefined','limit','count','status','set','json','apply','reject','save','update','destroy','stack','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','then','includeAll','include','rows','catch','show','params','keys','find','create','body','getFields','ServicenowField','order','findOne','options','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x761d,0x17d));var _0xd761=function(_0x1046e3,_0x3cb191){_0x1046e3=_0x1046e3-0x0;var _0x453ef3=_0x761d[_0x1046e3];return _0x453ef3;};'use strict';var emlformat=require(_0xd761('0x0'));var rimraf=require(_0xd761('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd761('0x2'));var BPromise=require(_0xd761('0x3'));var Mustache=require(_0xd761('0x4'));var util=require(_0xd761('0x5'));var path=require(_0xd761('0x6'));var sox=require(_0xd761('0x7'));var csv=require(_0xd761('0x8'));var ejs=require(_0xd761('0x9'));var fs=require('fs');var fs_extra=require(_0xd761('0xa'));var _=require(_0xd761('0xb'));var squel=require(_0xd761('0xc'));var crypto=require(_0xd761('0xd'));var jsforce=require(_0xd761('0xe'));var deskjs=require(_0xd761('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd761('0x10'));var Papa=require('papaparse');var Redis=require(_0xd761('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd761('0x12'));var logger=require(_0xd761('0x13'))(_0xd761('0x14'));var utils=require(_0xd761('0x15'));var config=require(_0xd761('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18842d,_0x37b634){_0x37b634=_0x37b634||0xcc;return function(_0x12277f){if(_0x12277f){return _0x18842d[_0xd761('0x17')](_0x37b634);}return _0x18842d['status'](_0x37b634)[_0xd761('0x18')]();};}function respondWithResult(_0x85cc52,_0xb3e370){_0xb3e370=_0xb3e370||0xc8;return function(_0xa44328){if(_0xa44328){return _0x85cc52['status'](_0xb3e370)['json'](_0xa44328);}};}function respondWithFilteredResult(_0x521f8a,_0x1a7393){return function(_0x1e5be5){if(_0x1e5be5){var _0x33336c=typeof _0x1a7393[_0xd761('0x19')]===_0xd761('0x1a')&&typeof _0x1a7393[_0xd761('0x1b')]===_0xd761('0x1a');var _0x482eb7=_0x1e5be5[_0xd761('0x1c')];var _0x23c250=_0x33336c?0x0:_0x1a7393[_0xd761('0x19')];var _0x224bdd=_0x33336c?_0x1e5be5[_0xd761('0x1c')]:_0x1a7393[_0xd761('0x19')]+_0x1a7393[_0xd761('0x1b')];var _0x62728a;if(_0x224bdd>=_0x482eb7){_0x224bdd=_0x482eb7;_0x62728a=0xc8;}else{_0x62728a=0xce;}_0x521f8a[_0xd761('0x1d')](_0x62728a);return _0x521f8a[_0xd761('0x1e')]('Content-Range',_0x23c250+'-'+_0x224bdd+'/'+_0x482eb7)[_0xd761('0x1f')](_0x1e5be5);}return null;};}function patchUpdates(_0x2d8fe8){return function(_0x341844){try{jsonpatch[_0xd761('0x20')](_0x341844,_0x2d8fe8,!![]);}catch(_0x564235){return BPromise[_0xd761('0x21')](_0x564235);}return _0x341844[_0xd761('0x22')]();};}function saveUpdates(_0x5ebe98,_0x34c712){return function(_0x56abca){if(_0x56abca){return _0x56abca[_0xd761('0x23')](_0x5ebe98)['then'](function(_0x8b1b01){return _0x8b1b01;});}return null;};}function removeEntity(_0x584bd0,_0xcfd3b0){return function(_0x44bd5f){if(_0x44bd5f){return _0x44bd5f[_0xd761('0x24')]()['then'](function(){_0x584bd0[_0xd761('0x1d')](0xcc)[_0xd761('0x18')]();});}};}function handleEntityNotFound(_0x14cf52,_0x1beb37){return function(_0x447d44){if(!_0x447d44){_0x14cf52[_0xd761('0x17')](0x194);}return _0x447d44;};}function handleError(_0x3138b4,_0x1c3ce6){_0x1c3ce6=_0x1c3ce6||0x1f4;return function(_0x1b379e){logger['error'](_0x1b379e[_0xd761('0x25')]);if(_0x1b379e[_0xd761('0x26')]){delete _0x1b379e[_0xd761('0x26')];}_0x3138b4[_0xd761('0x1d')](_0x1c3ce6)['send'](_0x1b379e);};}exports[_0xd761('0x27')]=function(_0x57c6ad,_0x239345){var _0x48e9f4={},_0x16d489={},_0x355220={'count':0x0,'rows':[]};var _0xa3cdb7=_[_0xd761('0x28')](db[_0xd761('0x29')][_0xd761('0x2a')],function(_0x5483d6){return{'name':_0x5483d6[_0xd761('0x2b')],'type':_0x5483d6[_0xd761('0x2c')][_0xd761('0x2d')]};});_0x16d489[_0xd761('0x2e')]=_[_0xd761('0x28')](_0xa3cdb7,_0xd761('0x26'));_0x16d489[_0xd761('0x2f')]=_['keys'](_0x57c6ad[_0xd761('0x2f')]);_0x16d489[_0xd761('0x30')]=_[_0xd761('0x31')](_0x16d489['model'],_0x16d489[_0xd761('0x2f')]);_0x48e9f4['attributes']=_['intersection'](_0x16d489[_0xd761('0x2e')],qs[_0xd761('0x32')](_0x57c6ad[_0xd761('0x2f')][_0xd761('0x32')]));_0x48e9f4[_0xd761('0x33')]=_0x48e9f4[_0xd761('0x33')][_0xd761('0x34')]?_0x48e9f4[_0xd761('0x33')]:_0x16d489[_0xd761('0x2e')];if(!_0x57c6ad['query']['hasOwnProperty'](_0xd761('0x35'))){_0x48e9f4[_0xd761('0x1b')]=qs[_0xd761('0x1b')](_0x57c6ad[_0xd761('0x2f')][_0xd761('0x1b')]);_0x48e9f4[_0xd761('0x19')]=qs[_0xd761('0x19')](_0x57c6ad[_0xd761('0x2f')]['offset']);}_0x48e9f4['order']=qs[_0xd761('0x36')](_0x57c6ad['query']['sort']);_0x48e9f4[_0xd761('0x37')]=qs['filters'](_[_0xd761('0x38')](_0x57c6ad[_0xd761('0x2f')],_0x16d489[_0xd761('0x30')]),_0xa3cdb7);if(_0x57c6ad[_0xd761('0x2f')]['filter']){_0x48e9f4[_0xd761('0x37')]=_[_0xd761('0x39')](_0x48e9f4[_0xd761('0x37')],{'$or':_[_0xd761('0x28')](_0xa3cdb7,function(_0x58b85c){if(_0x58b85c[_0xd761('0x2c')]!==_0xd761('0x3a')){var _0x4e459f={};_0x4e459f[_0x58b85c['name']]={'$like':'%'+_0x57c6ad[_0xd761('0x2f')][_0xd761('0x3b')]+'%'};return _0x4e459f;}})});}_0x48e9f4=_[_0xd761('0x39')]({},_0x48e9f4,_0x57c6ad['options']);var _0x5828db={'where':_0x48e9f4['where']};return db[_0xd761('0x29')][_0xd761('0x1c')](_0x5828db)[_0xd761('0x3c')](function(_0x5d516e){_0x355220['count']=_0x5d516e;if(_0x57c6ad[_0xd761('0x2f')][_0xd761('0x3d')]){_0x48e9f4[_0xd761('0x3e')]=[{'all':!![]}];}return db[_0xd761('0x29')]['findAll'](_0x48e9f4);})[_0xd761('0x3c')](function(_0x141ab1){_0x355220[_0xd761('0x3f')]=_0x141ab1;return _0x355220;})[_0xd761('0x3c')](respondWithFilteredResult(_0x239345,_0x48e9f4))[_0xd761('0x40')](handleError(_0x239345,null));};exports[_0xd761('0x41')]=function(_0x13adc7,_0x22ab49){var _0x502795={'raw':![],'where':{'id':_0x13adc7[_0xd761('0x42')]['id']}},_0x2cad61={};_0x2cad61[_0xd761('0x2e')]=_[_0xd761('0x43')](db[_0xd761('0x29')][_0xd761('0x2a')]);_0x2cad61[_0xd761('0x2f')]=_[_0xd761('0x43')](_0x13adc7['query']);_0x2cad61[_0xd761('0x30')]=_[_0xd761('0x31')](_0x2cad61[_0xd761('0x2e')],_0x2cad61[_0xd761('0x2f')]);_0x502795[_0xd761('0x33')]=_['intersection'](_0x2cad61[_0xd761('0x2e')],qs[_0xd761('0x32')](_0x13adc7['query']['fields']));_0x502795[_0xd761('0x33')]=_0x502795[_0xd761('0x33')]['length']?_0x502795[_0xd761('0x33')]:_0x2cad61['model'];if(_0x13adc7[_0xd761('0x2f')][_0xd761('0x3d')]){_0x502795[_0xd761('0x3e')]=[{'all':!![]}];}_0x502795=_[_0xd761('0x39')]({},_0x502795,_0x13adc7['options']);return db[_0xd761('0x29')][_0xd761('0x44')](_0x502795)[_0xd761('0x3c')](handleEntityNotFound(_0x22ab49,null))[_0xd761('0x3c')](respondWithResult(_0x22ab49,null))[_0xd761('0x40')](handleError(_0x22ab49,null));};exports[_0xd761('0x45')]=function(_0x421c1f,_0x409a3a){return db['ServicenowConfiguration'][_0xd761('0x45')](_0x421c1f[_0xd761('0x46')],{})[_0xd761('0x3c')](respondWithResult(_0x409a3a,0xc9))[_0xd761('0x40')](handleError(_0x409a3a,null));};exports[_0xd761('0x23')]=function(_0x106c45,_0x540d3f){if(_0x106c45[_0xd761('0x46')]['id']){delete _0x106c45[_0xd761('0x46')]['id'];}return db[_0xd761('0x29')][_0xd761('0x44')]({'where':{'id':_0x106c45['params']['id']}})['then'](handleEntityNotFound(_0x540d3f,null))['then'](saveUpdates(_0x106c45[_0xd761('0x46')],null))[_0xd761('0x3c')](respondWithResult(_0x540d3f,null))[_0xd761('0x40')](handleError(_0x540d3f,null));};exports[_0xd761('0x24')]=function(_0x3cd74e,_0x18647a){return db['ServicenowConfiguration']['find']({'where':{'id':_0x3cd74e[_0xd761('0x42')]['id']}})[_0xd761('0x3c')](handleEntityNotFound(_0x18647a,null))[_0xd761('0x3c')](removeEntity(_0x18647a,null))[_0xd761('0x40')](handleError(_0x18647a,null));};exports[_0xd761('0x47')]=function(_0x29b1b2,_0x45f35c,_0x1e50c2){var _0x331474={};var _0x39077c={};var _0x1bc041;var _0x2b4acd;return db[_0xd761('0x29')]['findOne']({'where':{'id':_0x29b1b2['params']['id']}})[_0xd761('0x3c')](handleEntityNotFound(_0x45f35c,null))[_0xd761('0x3c')](function(_0x38f71e){if(_0x38f71e){_0x1bc041=_0x38f71e;_0x39077c[_0xd761('0x2e')]=_[_0xd761('0x43')](db[_0xd761('0x48')][_0xd761('0x2a')]);_0x39077c[_0xd761('0x2f')]=_[_0xd761('0x43')](_0x29b1b2[_0xd761('0x2f')]);_0x39077c[_0xd761('0x30')]=_[_0xd761('0x31')](_0x39077c['model'],_0x39077c[_0xd761('0x2f')]);_0x331474['attributes']=_[_0xd761('0x31')](_0x39077c[_0xd761('0x2e')],qs[_0xd761('0x32')](_0x29b1b2[_0xd761('0x2f')][_0xd761('0x32')]));_0x331474[_0xd761('0x33')]=_0x331474[_0xd761('0x33')][_0xd761('0x34')]?_0x331474['attributes']:_0x39077c[_0xd761('0x2e')];_0x331474[_0xd761('0x49')]=qs[_0xd761('0x36')](_0x29b1b2[_0xd761('0x2f')]['sort']);_0x331474[_0xd761('0x37')]=qs[_0xd761('0x30')](_[_0xd761('0x38')](_0x29b1b2['query'],_0x39077c['filters']));if(_0x29b1b2['query']['filter']){_0x331474[_0xd761('0x37')]=_[_0xd761('0x39')](_0x331474[_0xd761('0x37')],{'$or':_[_0xd761('0x28')](_0x331474[_0xd761('0x33')],function(_0x4f9cf0){var _0x5e8c9b={};_0x5e8c9b[_0x4f9cf0]={'$like':'%'+_0x29b1b2[_0xd761('0x2f')]['filter']+'%'};return _0x5e8c9b;})});}_0x331474=_[_0xd761('0x39')]({},_0x331474,_0x29b1b2['options']);return _0x1bc041[_0xd761('0x47')](_0x331474);}})[_0xd761('0x3c')](function(_0x138b06){if(_0x138b06){_0x2b4acd=_0x138b06[_0xd761('0x34')];if(!_0x29b1b2[_0xd761('0x2f')]['hasOwnProperty'](_0xd761('0x35'))){_0x331474[_0xd761('0x1b')]=qs[_0xd761('0x1b')](_0x29b1b2[_0xd761('0x2f')]['limit']);_0x331474[_0xd761('0x19')]=qs['offset'](_0x29b1b2[_0xd761('0x2f')]['offset']);}return _0x1bc041['getFields'](_0x331474);}})[_0xd761('0x3c')](function(_0xfca648){if(_0xfca648){return _0xfca648?{'count':_0x2b4acd,'rows':_0xfca648}:null;}})[_0xd761('0x3c')](respondWithResult(_0x45f35c,null))[_0xd761('0x40')](handleError(_0x45f35c,null));};exports['getSubjects']=function(_0x46ae48,_0x73aab5,_0x3c2321){var _0x3e8e3f={};var _0x2e404a={};var _0x193378;var _0x339d2e;return db[_0xd761('0x29')][_0xd761('0x4a')]({'where':{'id':_0x46ae48[_0xd761('0x42')]['id']}})[_0xd761('0x3c')](handleEntityNotFound(_0x73aab5,null))[_0xd761('0x3c')](function(_0x902490){if(_0x902490){_0x193378=_0x902490;_0x2e404a[_0xd761('0x2e')]=_[_0xd761('0x43')](db[_0xd761('0x48')][_0xd761('0x2a')]);_0x2e404a[_0xd761('0x2f')]=_[_0xd761('0x43')](_0x46ae48[_0xd761('0x2f')]);_0x2e404a[_0xd761('0x30')]=_[_0xd761('0x31')](_0x2e404a['model'],_0x2e404a['query']);_0x3e8e3f['attributes']=_[_0xd761('0x31')](_0x2e404a[_0xd761('0x2e')],qs['fields'](_0x46ae48['query'][_0xd761('0x32')]));_0x3e8e3f[_0xd761('0x33')]=_0x3e8e3f[_0xd761('0x33')][_0xd761('0x34')]?_0x3e8e3f[_0xd761('0x33')]:_0x2e404a[_0xd761('0x2e')];_0x3e8e3f[_0xd761('0x49')]=qs[_0xd761('0x36')](_0x46ae48['query'][_0xd761('0x36')]);_0x3e8e3f[_0xd761('0x37')]=qs[_0xd761('0x30')](_[_0xd761('0x38')](_0x46ae48[_0xd761('0x2f')],_0x2e404a[_0xd761('0x30')]));if(_0x46ae48[_0xd761('0x2f')][_0xd761('0x3b')]){_0x3e8e3f[_0xd761('0x37')]=_[_0xd761('0x39')](_0x3e8e3f[_0xd761('0x37')],{'$or':_['map'](_0x3e8e3f[_0xd761('0x33')],function(_0x4752de){var _0x84c13f={};_0x84c13f[_0x4752de]={'$like':'%'+_0x46ae48['query'][_0xd761('0x3b')]+'%'};return _0x84c13f;})});}_0x3e8e3f=_['merge']({},_0x3e8e3f,_0x46ae48[_0xd761('0x4b')]);return _0x193378[_0xd761('0x4c')](_0x3e8e3f);}})[_0xd761('0x3c')](function(_0x582310){if(_0x582310){_0x339d2e=_0x582310[_0xd761('0x34')];if(!_0x46ae48['query'][_0xd761('0x4d')](_0xd761('0x35'))){_0x3e8e3f['limit']=qs[_0xd761('0x1b')](_0x46ae48[_0xd761('0x2f')][_0xd761('0x1b')]);_0x3e8e3f['offset']=qs[_0xd761('0x19')](_0x46ae48[_0xd761('0x2f')][_0xd761('0x19')]);}return _0x193378[_0xd761('0x4c')](_0x3e8e3f);}})[_0xd761('0x3c')](function(_0x120dd1){if(_0x120dd1){return _0x120dd1?{'count':_0x339d2e,'rows':_0x120dd1}:null;}})[_0xd761('0x3c')](respondWithResult(_0x73aab5,null))[_0xd761('0x40')](handleError(_0x73aab5,null));};exports[_0xd761('0x4e')]=function(_0x3c59b3,_0x59d55f,_0x74dd34){var _0x373369={};var _0x382444={};var _0x3ccf20;var _0x524690;return db[_0xd761('0x29')][_0xd761('0x4a')]({'where':{'id':_0x3c59b3[_0xd761('0x42')]['id']}})['then'](handleEntityNotFound(_0x59d55f,null))[_0xd761('0x3c')](function(_0x49b176){if(_0x49b176){_0x3ccf20=_0x49b176;_0x382444[_0xd761('0x2e')]=_['keys'](db[_0xd761('0x48')][_0xd761('0x2a')]);_0x382444[_0xd761('0x2f')]=_[_0xd761('0x43')](_0x3c59b3['query']);_0x382444[_0xd761('0x30')]=_['intersection'](_0x382444[_0xd761('0x2e')],_0x382444[_0xd761('0x2f')]);_0x373369[_0xd761('0x33')]=_[_0xd761('0x31')](_0x382444['model'],qs[_0xd761('0x32')](_0x3c59b3[_0xd761('0x2f')][_0xd761('0x32')]));_0x373369[_0xd761('0x33')]=_0x373369['attributes'][_0xd761('0x34')]?_0x373369['attributes']:_0x382444['model'];_0x373369[_0xd761('0x49')]=qs['sort'](_0x3c59b3[_0xd761('0x2f')][_0xd761('0x36')]);_0x373369[_0xd761('0x37')]=qs['filters'](_[_0xd761('0x38')](_0x3c59b3['query'],_0x382444[_0xd761('0x30')]));if(_0x3c59b3[_0xd761('0x2f')][_0xd761('0x3b')]){_0x373369['where']=_[_0xd761('0x39')](_0x373369[_0xd761('0x37')],{'$or':_[_0xd761('0x28')](_0x373369[_0xd761('0x33')],function(_0x55725f){var _0x24e5eb={};_0x24e5eb[_0x55725f]={'$like':'%'+_0x3c59b3[_0xd761('0x2f')]['filter']+'%'};return _0x24e5eb;})});}_0x373369=_[_0xd761('0x39')]({},_0x373369,_0x3c59b3['options']);return _0x3ccf20[_0xd761('0x4e')](_0x373369);}})[_0xd761('0x3c')](function(_0x3c521b){if(_0x3c521b){_0x524690=_0x3c521b[_0xd761('0x34')];if(!_0x3c59b3[_0xd761('0x2f')][_0xd761('0x4d')]('nolimit')){_0x373369[_0xd761('0x1b')]=qs[_0xd761('0x1b')](_0x3c59b3[_0xd761('0x2f')][_0xd761('0x1b')]);_0x373369[_0xd761('0x19')]=qs['offset'](_0x3c59b3[_0xd761('0x2f')][_0xd761('0x19')]);}return _0x3ccf20[_0xd761('0x4e')](_0x373369);}})['then'](function(_0xd9d23){if(_0xd9d23){return _0xd9d23?{'count':_0x524690,'rows':_0xd9d23}:null;}})['then'](respondWithResult(_0x59d55f,null))[_0xd761('0x40')](handleError(_0x59d55f,null));}; \ No newline at end of file +var _0x7414=['map','ServicenowConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','include','create','update','body','find','getFields','findOne','ServicenowField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','then','destroy','end','error','stack','name','send','index'];(function(_0x31b5b2,_0x5ab927){var _0x364f13=function(_0x163bd0){while(--_0x163bd0){_0x31b5b2['push'](_0x31b5b2['shift']());}};_0x364f13(++_0x5ab927);}(_0x7414,0x1b6));var _0x4741=function(_0xdbdc82,_0x5cb6ae){_0xdbdc82=_0xdbdc82-0x0;var _0x631bc4=_0x7414[_0xdbdc82];return _0x631bc4;};'use strict';var emlformat=require(_0x4741('0x0'));var rimraf=require(_0x4741('0x1'));var zipdir=require(_0x4741('0x2'));var jsonpatch=require(_0x4741('0x3'));var rp=require('request-promise');var moment=require(_0x4741('0x4'));var BPromise=require(_0x4741('0x5'));var Mustache=require('mustache');var util=require(_0x4741('0x6'));var path=require(_0x4741('0x7'));var sox=require(_0x4741('0x8'));var csv=require(_0x4741('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4741('0xa'));var squel=require(_0x4741('0xb'));var crypto=require(_0x4741('0xc'));var jsforce=require(_0x4741('0xd'));var deskjs=require(_0x4741('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4741('0xf'));var Redis=require('ioredis');var authService=require(_0x4741('0x10'));var qs=require(_0x4741('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4741('0x12'));var logger=require(_0x4741('0x13'))('api');var utils=require(_0x4741('0x14'));var config=require(_0x4741('0x15'));var licenseUtil=require(_0x4741('0x16'));var db=require(_0x4741('0x17'))['db'];function respondWithStatusCode(_0x37d0ed,_0x7c3cf7){_0x7c3cf7=_0x7c3cf7||0xcc;return function(_0x131e55){if(_0x131e55){return _0x37d0ed[_0x4741('0x18')](_0x7c3cf7);}return _0x37d0ed['status'](_0x7c3cf7)['end']();};}function respondWithResult(_0x212dd6,_0x130ae5){_0x130ae5=_0x130ae5||0xc8;return function(_0x17a739){if(_0x17a739){return _0x212dd6[_0x4741('0x19')](_0x130ae5)['json'](_0x17a739);}};}function respondWithFilteredResult(_0x289cec,_0x2d99d5){return function(_0x189ddf){if(_0x189ddf){var _0x34e12a=typeof _0x2d99d5['offset']===_0x4741('0x1a')&&typeof _0x2d99d5[_0x4741('0x1b')]==='undefined';var _0x21ab7=_0x189ddf[_0x4741('0x1c')];var _0x56c56b=_0x34e12a?0x0:_0x2d99d5[_0x4741('0x1d')];var _0x520a1f=_0x34e12a?_0x189ddf[_0x4741('0x1c')]:_0x2d99d5['offset']+_0x2d99d5[_0x4741('0x1b')];var _0x31823a;if(_0x520a1f>=_0x21ab7){_0x520a1f=_0x21ab7;_0x31823a=0xc8;}else{_0x31823a=0xce;}_0x289cec[_0x4741('0x19')](_0x31823a);return _0x289cec[_0x4741('0x1e')](_0x4741('0x1f'),_0x56c56b+'-'+_0x520a1f+'/'+_0x21ab7)[_0x4741('0x20')](_0x189ddf);}return null;};}function patchUpdates(_0x52cb77){return function(_0x831182){try{jsonpatch['apply'](_0x831182,_0x52cb77,!![]);}catch(_0x3594e2){return BPromise[_0x4741('0x21')](_0x3594e2);}return _0x831182['save']();};}function saveUpdates(_0x1a147f,_0x2358a4){return function(_0x3c7a5d){if(_0x3c7a5d){return _0x3c7a5d['update'](_0x1a147f)[_0x4741('0x22')](function(_0x11e185){return _0x11e185;});}return null;};}function removeEntity(_0x83e3a,_0x29168d){return function(_0x2b1282){if(_0x2b1282){return _0x2b1282[_0x4741('0x23')]()[_0x4741('0x22')](function(){_0x83e3a['status'](0xcc)[_0x4741('0x24')]();});}};}function handleEntityNotFound(_0x20a6f1,_0x2b31d3){return function(_0x3cc4ed){if(!_0x3cc4ed){_0x20a6f1[_0x4741('0x18')](0x194);}return _0x3cc4ed;};}function handleError(_0x257dac,_0x254c93){_0x254c93=_0x254c93||0x1f4;return function(_0x58787f){logger[_0x4741('0x25')](_0x58787f[_0x4741('0x26')]);if(_0x58787f[_0x4741('0x27')]){delete _0x58787f[_0x4741('0x27')];}_0x257dac[_0x4741('0x19')](_0x254c93)[_0x4741('0x28')](_0x58787f);};}exports[_0x4741('0x29')]=function(_0x301500,_0x47e5eb){var _0x511eac={},_0x53e7f7={},_0x6858b9={'count':0x0,'rows':[]};var _0x529428=_[_0x4741('0x2a')](db[_0x4741('0x2b')][_0x4741('0x2c')],function(_0x5ea067){return{'name':_0x5ea067['fieldName'],'type':_0x5ea067[_0x4741('0x2d')][_0x4741('0x2e')]};});_0x53e7f7[_0x4741('0x2f')]=_[_0x4741('0x2a')](_0x529428,_0x4741('0x27'));_0x53e7f7[_0x4741('0x30')]=_[_0x4741('0x31')](_0x301500['query']);_0x53e7f7[_0x4741('0x32')]=_[_0x4741('0x33')](_0x53e7f7[_0x4741('0x2f')],_0x53e7f7[_0x4741('0x30')]);_0x511eac[_0x4741('0x34')]=_[_0x4741('0x33')](_0x53e7f7[_0x4741('0x2f')],qs[_0x4741('0x35')](_0x301500['query']['fields']));_0x511eac[_0x4741('0x34')]=_0x511eac[_0x4741('0x34')][_0x4741('0x36')]?_0x511eac[_0x4741('0x34')]:_0x53e7f7[_0x4741('0x2f')];if(!_0x301500['query'][_0x4741('0x37')](_0x4741('0x38'))){_0x511eac[_0x4741('0x1b')]=qs['limit'](_0x301500[_0x4741('0x30')]['limit']);_0x511eac[_0x4741('0x1d')]=qs[_0x4741('0x1d')](_0x301500['query'][_0x4741('0x1d')]);}_0x511eac[_0x4741('0x39')]=qs[_0x4741('0x3a')](_0x301500[_0x4741('0x30')][_0x4741('0x3a')]);_0x511eac[_0x4741('0x3b')]=qs[_0x4741('0x32')](_['pick'](_0x301500[_0x4741('0x30')],_0x53e7f7[_0x4741('0x32')]),_0x529428);if(_0x301500[_0x4741('0x30')][_0x4741('0x3c')]){_0x511eac['where']=_['merge'](_0x511eac['where'],{'$or':_[_0x4741('0x2a')](_0x529428,function(_0x3bd3c8){if(_0x3bd3c8[_0x4741('0x2d')]!==_0x4741('0x3d')){var _0x204f5a={};_0x204f5a[_0x3bd3c8[_0x4741('0x27')]]={'$like':'%'+_0x301500[_0x4741('0x30')][_0x4741('0x3c')]+'%'};return _0x204f5a;}})});}_0x511eac=_[_0x4741('0x3e')]({},_0x511eac,_0x301500[_0x4741('0x3f')]);var _0x4a05bb={'where':_0x511eac['where']};return db['ServicenowConfiguration']['count'](_0x4a05bb)[_0x4741('0x22')](function(_0x16ed5e){_0x6858b9[_0x4741('0x1c')]=_0x16ed5e;if(_0x301500[_0x4741('0x30')][_0x4741('0x40')]){_0x511eac['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x4741('0x41')](_0x511eac);})['then'](function(_0xe34862){_0x6858b9['rows']=_0xe34862;return _0x6858b9;})['then'](respondWithFilteredResult(_0x47e5eb,_0x511eac))[_0x4741('0x42')](handleError(_0x47e5eb,null));};exports[_0x4741('0x43')]=function(_0x45c0e0,_0x22faca){var _0x4a1ebc={'raw':![],'where':{'id':_0x45c0e0[_0x4741('0x44')]['id']}},_0x5b10ff={};_0x5b10ff['model']=_[_0x4741('0x31')](db[_0x4741('0x2b')][_0x4741('0x2c')]);_0x5b10ff[_0x4741('0x30')]=_['keys'](_0x45c0e0[_0x4741('0x30')]);_0x5b10ff[_0x4741('0x32')]=_[_0x4741('0x33')](_0x5b10ff[_0x4741('0x2f')],_0x5b10ff['query']);_0x4a1ebc[_0x4741('0x34')]=_[_0x4741('0x33')](_0x5b10ff[_0x4741('0x2f')],qs[_0x4741('0x35')](_0x45c0e0[_0x4741('0x30')]['fields']));_0x4a1ebc[_0x4741('0x34')]=_0x4a1ebc['attributes']['length']?_0x4a1ebc['attributes']:_0x5b10ff[_0x4741('0x2f')];if(_0x45c0e0['query'][_0x4741('0x40')]){_0x4a1ebc[_0x4741('0x45')]=[{'all':!![]}];}_0x4a1ebc=_[_0x4741('0x3e')]({},_0x4a1ebc,_0x45c0e0[_0x4741('0x3f')]);return db[_0x4741('0x2b')]['find'](_0x4a1ebc)[_0x4741('0x22')](handleEntityNotFound(_0x22faca,null))['then'](respondWithResult(_0x22faca,null))[_0x4741('0x42')](handleError(_0x22faca,null));};exports['create']=function(_0x8cb202,_0x227226){return db[_0x4741('0x2b')][_0x4741('0x46')](_0x8cb202['body'],{})['then'](respondWithResult(_0x227226,0xc9))[_0x4741('0x42')](handleError(_0x227226,null));};exports[_0x4741('0x47')]=function(_0x531a34,_0x182086){if(_0x531a34[_0x4741('0x48')]['id']){delete _0x531a34[_0x4741('0x48')]['id'];}return db[_0x4741('0x2b')][_0x4741('0x49')]({'where':{'id':_0x531a34['params']['id']}})['then'](handleEntityNotFound(_0x182086,null))['then'](saveUpdates(_0x531a34[_0x4741('0x48')],null))[_0x4741('0x22')](respondWithResult(_0x182086,null))[_0x4741('0x42')](handleError(_0x182086,null));};exports[_0x4741('0x23')]=function(_0x28085f,_0x32f251){return db[_0x4741('0x2b')]['find']({'where':{'id':_0x28085f[_0x4741('0x44')]['id']}})['then'](handleEntityNotFound(_0x32f251,null))[_0x4741('0x22')](removeEntity(_0x32f251,null))[_0x4741('0x42')](handleError(_0x32f251,null));};exports[_0x4741('0x4a')]=function(_0x50a770,_0x34090d,_0x13a6ce){var _0x5b05b6={};var _0x5b9f88={};var _0x3ca868;var _0x1b553a;return db[_0x4741('0x2b')][_0x4741('0x4b')]({'where':{'id':_0x50a770[_0x4741('0x44')]['id']}})[_0x4741('0x22')](handleEntityNotFound(_0x34090d,null))[_0x4741('0x22')](function(_0x59cec5){if(_0x59cec5){_0x3ca868=_0x59cec5;_0x5b9f88['model']=_[_0x4741('0x31')](db[_0x4741('0x4c')][_0x4741('0x2c')]);_0x5b9f88['query']=_[_0x4741('0x31')](_0x50a770['query']);_0x5b9f88[_0x4741('0x32')]=_['intersection'](_0x5b9f88['model'],_0x5b9f88[_0x4741('0x30')]);_0x5b05b6[_0x4741('0x34')]=_[_0x4741('0x33')](_0x5b9f88[_0x4741('0x2f')],qs['fields'](_0x50a770['query'][_0x4741('0x35')]));_0x5b05b6[_0x4741('0x34')]=_0x5b05b6['attributes'][_0x4741('0x36')]?_0x5b05b6[_0x4741('0x34')]:_0x5b9f88[_0x4741('0x2f')];_0x5b05b6['order']=qs[_0x4741('0x3a')](_0x50a770[_0x4741('0x30')]['sort']);_0x5b05b6[_0x4741('0x3b')]=qs['filters'](_[_0x4741('0x4d')](_0x50a770[_0x4741('0x30')],_0x5b9f88[_0x4741('0x32')]));if(_0x50a770[_0x4741('0x30')][_0x4741('0x3c')]){_0x5b05b6['where']=_[_0x4741('0x3e')](_0x5b05b6[_0x4741('0x3b')],{'$or':_[_0x4741('0x2a')](_0x5b05b6[_0x4741('0x34')],function(_0x104750){var _0x1bb547={};_0x1bb547[_0x104750]={'$like':'%'+_0x50a770[_0x4741('0x30')]['filter']+'%'};return _0x1bb547;})});}_0x5b05b6=_[_0x4741('0x3e')]({},_0x5b05b6,_0x50a770[_0x4741('0x3f')]);return _0x3ca868['getFields'](_0x5b05b6);}})[_0x4741('0x22')](function(_0x50136c){if(_0x50136c){_0x1b553a=_0x50136c[_0x4741('0x36')];if(!_0x50a770[_0x4741('0x30')]['hasOwnProperty'](_0x4741('0x38'))){_0x5b05b6[_0x4741('0x1b')]=qs['limit'](_0x50a770[_0x4741('0x30')][_0x4741('0x1b')]);_0x5b05b6[_0x4741('0x1d')]=qs[_0x4741('0x1d')](_0x50a770[_0x4741('0x30')][_0x4741('0x1d')]);}return _0x3ca868[_0x4741('0x4a')](_0x5b05b6);}})['then'](function(_0x15a3d2){if(_0x15a3d2){return _0x15a3d2?{'count':_0x1b553a,'rows':_0x15a3d2}:null;}})['then'](respondWithResult(_0x34090d,null))[_0x4741('0x42')](handleError(_0x34090d,null));};exports['getSubjects']=function(_0x5c0298,_0x2791f6,_0x53a0b3){var _0x36b894={};var _0x386ede={};var _0x38c52c;var _0x6d2b52;return db[_0x4741('0x2b')][_0x4741('0x4b')]({'where':{'id':_0x5c0298[_0x4741('0x44')]['id']}})[_0x4741('0x22')](handleEntityNotFound(_0x2791f6,null))[_0x4741('0x22')](function(_0x1adeda){if(_0x1adeda){_0x38c52c=_0x1adeda;_0x386ede[_0x4741('0x2f')]=_[_0x4741('0x31')](db['ServicenowField'][_0x4741('0x2c')]);_0x386ede[_0x4741('0x30')]=_[_0x4741('0x31')](_0x5c0298[_0x4741('0x30')]);_0x386ede[_0x4741('0x32')]=_[_0x4741('0x33')](_0x386ede[_0x4741('0x2f')],_0x386ede[_0x4741('0x30')]);_0x36b894[_0x4741('0x34')]=_[_0x4741('0x33')](_0x386ede[_0x4741('0x2f')],qs[_0x4741('0x35')](_0x5c0298[_0x4741('0x30')][_0x4741('0x35')]));_0x36b894[_0x4741('0x34')]=_0x36b894[_0x4741('0x34')][_0x4741('0x36')]?_0x36b894[_0x4741('0x34')]:_0x386ede['model'];_0x36b894[_0x4741('0x39')]=qs[_0x4741('0x3a')](_0x5c0298['query'][_0x4741('0x3a')]);_0x36b894[_0x4741('0x3b')]=qs['filters'](_[_0x4741('0x4d')](_0x5c0298[_0x4741('0x30')],_0x386ede[_0x4741('0x32')]));if(_0x5c0298[_0x4741('0x30')][_0x4741('0x3c')]){_0x36b894[_0x4741('0x3b')]=_[_0x4741('0x3e')](_0x36b894[_0x4741('0x3b')],{'$or':_[_0x4741('0x2a')](_0x36b894[_0x4741('0x34')],function(_0x29c167){var _0x874547={};_0x874547[_0x29c167]={'$like':'%'+_0x5c0298['query'][_0x4741('0x3c')]+'%'};return _0x874547;})});}_0x36b894=_[_0x4741('0x3e')]({},_0x36b894,_0x5c0298[_0x4741('0x3f')]);return _0x38c52c[_0x4741('0x4e')](_0x36b894);}})[_0x4741('0x22')](function(_0x4d46a5){if(_0x4d46a5){_0x6d2b52=_0x4d46a5[_0x4741('0x36')];if(!_0x5c0298[_0x4741('0x30')][_0x4741('0x37')](_0x4741('0x38'))){_0x36b894['limit']=qs[_0x4741('0x1b')](_0x5c0298[_0x4741('0x30')][_0x4741('0x1b')]);_0x36b894[_0x4741('0x1d')]=qs[_0x4741('0x1d')](_0x5c0298[_0x4741('0x30')]['offset']);}return _0x38c52c[_0x4741('0x4e')](_0x36b894);}})[_0x4741('0x22')](function(_0x2b30b3){if(_0x2b30b3){return _0x2b30b3?{'count':_0x6d2b52,'rows':_0x2b30b3}:null;}})[_0x4741('0x22')](respondWithResult(_0x2791f6,null))[_0x4741('0x42')](handleError(_0x2791f6,null));};exports[_0x4741('0x4f')]=function(_0x4966d8,_0x2161a7,_0x18bc41){var _0x3dcb95={};var _0x3f8f0f={};var _0x22e0f1;var _0x131ea8;return db[_0x4741('0x2b')][_0x4741('0x4b')]({'where':{'id':_0x4966d8[_0x4741('0x44')]['id']}})['then'](handleEntityNotFound(_0x2161a7,null))[_0x4741('0x22')](function(_0x434c29){if(_0x434c29){_0x22e0f1=_0x434c29;_0x3f8f0f[_0x4741('0x2f')]=_['keys'](db[_0x4741('0x4c')][_0x4741('0x2c')]);_0x3f8f0f[_0x4741('0x30')]=_[_0x4741('0x31')](_0x4966d8[_0x4741('0x30')]);_0x3f8f0f[_0x4741('0x32')]=_['intersection'](_0x3f8f0f[_0x4741('0x2f')],_0x3f8f0f['query']);_0x3dcb95['attributes']=_[_0x4741('0x33')](_0x3f8f0f[_0x4741('0x2f')],qs[_0x4741('0x35')](_0x4966d8[_0x4741('0x30')][_0x4741('0x35')]));_0x3dcb95['attributes']=_0x3dcb95['attributes'][_0x4741('0x36')]?_0x3dcb95[_0x4741('0x34')]:_0x3f8f0f[_0x4741('0x2f')];_0x3dcb95[_0x4741('0x39')]=qs[_0x4741('0x3a')](_0x4966d8['query'][_0x4741('0x3a')]);_0x3dcb95[_0x4741('0x3b')]=qs['filters'](_['pick'](_0x4966d8[_0x4741('0x30')],_0x3f8f0f['filters']));if(_0x4966d8[_0x4741('0x30')]['filter']){_0x3dcb95['where']=_[_0x4741('0x3e')](_0x3dcb95[_0x4741('0x3b')],{'$or':_[_0x4741('0x2a')](_0x3dcb95[_0x4741('0x34')],function(_0x34d18c){var _0x5b0f7e={};_0x5b0f7e[_0x34d18c]={'$like':'%'+_0x4966d8[_0x4741('0x30')]['filter']+'%'};return _0x5b0f7e;})});}_0x3dcb95=_[_0x4741('0x3e')]({},_0x3dcb95,_0x4966d8[_0x4741('0x3f')]);return _0x22e0f1[_0x4741('0x4f')](_0x3dcb95);}})[_0x4741('0x22')](function(_0x36de92){if(_0x36de92){_0x131ea8=_0x36de92[_0x4741('0x36')];if(!_0x4966d8['query'][_0x4741('0x37')](_0x4741('0x38'))){_0x3dcb95[_0x4741('0x1b')]=qs[_0x4741('0x1b')](_0x4966d8[_0x4741('0x30')][_0x4741('0x1b')]);_0x3dcb95['offset']=qs[_0x4741('0x1d')](_0x4966d8['query']['offset']);}return _0x22e0f1[_0x4741('0x4f')](_0x3dcb95);}})[_0x4741('0x22')](function(_0x3e40f1){if(_0x3e40f1){return _0x3e40f1?{'count':_0x131ea8,'rows':_0x3e40f1}:null;}})['then'](respondWithResult(_0x2161a7,null))[_0x4741('0x42')](handleError(_0x2161a7,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 7727509..de585c6 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 _0x7df3=['define','lodash','util','api','bluebird','path','../../config/environment','./intServicenowConfiguration.attributes','exports'];(function(_0x5b8497,_0x3fe74f){var _0x1d62f4=function(_0x5c5e54){while(--_0x5c5e54){_0x5b8497['push'](_0x5b8497['shift']());}};_0x1d62f4(++_0x3fe74f);}(_0x7df3,0x1cc));var _0x37df=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7df3[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x37df('0x0'));var util=require(_0x37df('0x1'));var logger=require('../../config/logger')(_0x37df('0x2'));var moment=require('moment');var BPromise=require(_0x37df('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37df('0x4'));var rimraf=require('rimraf');var config=require(_0x37df('0x5'));var attributes=require(_0x37df('0x6'));module[_0x37df('0x7')]=function(_0x368888,_0x194c89){return _0x368888[_0x37df('0x8')]('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe1e8=['lodash','../../config/logger','bluebird','request-promise','path','rimraf','exports','define','int_servicenow_configurations'];(function(_0x519cf0,_0xb4d587){var _0xaa8512=function(_0x114126){while(--_0x114126){_0x519cf0['push'](_0x519cf0['shift']());}};_0xaa8512(++_0xb4d587);}(_0xe1e8,0x1cb));var _0x8e1e=function(_0x2ba867,_0x125479){_0x2ba867=_0x2ba867-0x0;var _0x482e5d=_0xe1e8[_0x2ba867];return _0x482e5d;};'use strict';var _=require(_0x8e1e('0x0'));var util=require('util');var logger=require(_0x8e1e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8e1e('0x2'));var rp=require(_0x8e1e('0x3'));var fs=require('fs');var path=require(_0x8e1e('0x4'));var rimraf=require(_0x8e1e('0x5'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module[_0x8e1e('0x6')]=function(_0xf371b5,_0x13c945){return _0xf371b5[_0x8e1e('0x7')]('ServicenowConfiguration',attributes,{'tableName':_0x8e1e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 1268690..8fffa91 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 _0x6916=['catch','util','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x4c9380,_0x2fefc0){var _0x49a523=function(_0x165e85){while(--_0x165e85){_0x4c9380['push'](_0x4c9380['shift']());}};_0x49a523(++_0x2fefc0);}(_0x6916,0x1bb));var _0x6691=function(_0x4fc2cc,_0x28c72c){_0x4fc2cc=_0x4fc2cc-0x0;var _0x3db15f=_0x6916[_0x4fc2cc];return _0x3db15f;};'use strict';var _=require('lodash');var util=require(_0x6691('0x0'));var moment=require(_0x6691('0x1'));var BPromise=require(_0x6691('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6691('0x3'));var logger=require(_0x6691('0x4'))(_0x6691('0x5'));var config=require('../../config/environment');var jayson=require(_0x6691('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2abd74,_0xdeb5d2,_0x28efd5){return new BPromise(function(_0x51a883,_0x38f964){return client[_0x6691('0x7')](_0x2abd74,_0x28efd5)[_0x6691('0x8')](function(_0x9369e9){logger[_0x6691('0x9')](_0x6691('0xa'),_0xdeb5d2,_0x6691('0xb'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0xdeb5d2,'request\x20sent',JSON[_0x6691('0xc')](_0x9369e9));if(_0x9369e9['error']){if(_0x9369e9[_0x6691('0xd')][_0x6691('0xe')]===0x1f4){logger[_0x6691('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0xdeb5d2,_0x9369e9['error']['message']);return _0x38f964(_0x9369e9[_0x6691('0xd')][_0x6691('0xf')]);}logger[_0x6691('0xd')](_0x6691('0xa'),_0xdeb5d2,_0x9369e9['error']['message']);return _0x51a883(_0x9369e9[_0x6691('0xd')]['message']);}else{logger[_0x6691('0x9')](_0x6691('0xa'),_0xdeb5d2,_0x6691('0xb'));_0x51a883(_0x9369e9['result']['message']);}})[_0x6691('0x10')](function(_0x5cf4f4){logger[_0x6691('0xd')](_0x6691('0xa'),_0xdeb5d2,_0x5cf4f4);_0x38f964(_0x5cf4f4);});});} \ No newline at end of file +var _0x4a42=['info','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4a42,0x158));var _0x24a4=function(_0x3b38d1,_0x57fcdf){_0x3b38d1=_0x3b38d1-0x0;var _0x93a789=_0x4a42[_0x3b38d1];return _0x93a789;};'use strict';var _=require(_0x24a4('0x0'));var util=require(_0x24a4('0x1'));var moment=require(_0x24a4('0x2'));var BPromise=require(_0x24a4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24a4('0x4'))['db'];var utils=require(_0x24a4('0x5'));var logger=require(_0x24a4('0x6'))(_0x24a4('0x7'));var config=require(_0x24a4('0x8'));var jayson=require(_0x24a4('0x9'));var client=jayson[_0x24a4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e2876,_0x27228f,_0x1b04a1){return new BPromise(function(_0x4e53e5,_0x48eab4){return client['request'](_0x1e2876,_0x1b04a1)[_0x24a4('0xb')](function(_0x32d144){logger['info'](_0x24a4('0xc'),_0x27228f,'request\x20sent');logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x27228f,_0x24a4('0xd'),JSON['stringify'](_0x32d144));if(_0x32d144[_0x24a4('0xe')]){if(_0x32d144['error']['code']===0x1f4){logger[_0x24a4('0xe')](_0x24a4('0xc'),_0x27228f,_0x32d144[_0x24a4('0xe')][_0x24a4('0xf')]);return _0x48eab4(_0x32d144[_0x24a4('0xe')][_0x24a4('0xf')]);}logger[_0x24a4('0xe')](_0x24a4('0xc'),_0x27228f,_0x32d144[_0x24a4('0xe')][_0x24a4('0xf')]);return _0x4e53e5(_0x32d144[_0x24a4('0xe')]['message']);}else{logger[_0x24a4('0x10')](_0x24a4('0xc'),_0x27228f,'request\x20sent');_0x4e53e5(_0x32d144[_0x24a4('0x11')][_0x24a4('0xf')]);}})['catch'](function(_0x3ab6d9){logger[_0x24a4('0xe')](_0x24a4('0xc'),_0x27228f,_0x3ab6d9);_0x48eab4(_0x3ab6d9);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index b696c0f..ae365a5 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 _0x15f0=['post','create','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x107844,_0x41926f){var _0x40c2b5=function(_0x2d0c58){while(--_0x2d0c58){_0x107844['push'](_0x107844['shift']());}};_0x40c2b5(++_0x41926f);}(_0x15f0,0x148));var _0x015f=function(_0x153ee5,_0x3bfe6d){_0x153ee5=_0x153ee5-0x0;var _0x48564c=_0x15f0[_0x153ee5];return _0x48564c;};'use strict';var multer=require(_0x015f('0x0'));var util=require(_0x015f('0x1'));var path=require('path');var timeout=require(_0x015f('0x2'));var express=require(_0x015f('0x3'));var router=express[_0x015f('0x4')]();var fs_extra=require(_0x015f('0x5'));var auth=require(_0x015f('0x6'));var interaction=require(_0x015f('0x7'));var config=require('../../config/environment');var controller=require(_0x015f('0x8'));router[_0x015f('0x9')]('/',auth[_0x015f('0xa')](),controller[_0x015f('0xb')]);router['get'](_0x015f('0xc'),auth[_0x015f('0xa')](),controller[_0x015f('0xd')]);router[_0x015f('0xe')]('/',auth['isAuthenticated'](),controller[_0x015f('0xf')]);router['put'](_0x015f('0xc'),auth[_0x015f('0xa')](),controller['update']);router[_0x015f('0x10')]('/:id',auth[_0x015f('0xa')](),controller[_0x015f('0x11')]);module['exports']=router; \ No newline at end of file +var _0x1fdf=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x487d56,_0x1d4a80){var _0x3f409f=function(_0x212b88){while(--_0x212b88){_0x487d56['push'](_0x487d56['shift']());}};_0x3f409f(++_0x1d4a80);}(_0x1fdf,0x12b));var _0xf1fd=function(_0x84c858,_0x32c06a){_0x84c858=_0x84c858-0x0;var _0x566333=_0x1fdf[_0x84c858];return _0x566333;};'use strict';var multer=require('multer');var util=require(_0xf1fd('0x0'));var path=require(_0xf1fd('0x1'));var timeout=require(_0xf1fd('0x2'));var express=require(_0xf1fd('0x3'));var router=express['Router']();var fs_extra=require(_0xf1fd('0x4'));var auth=require(_0xf1fd('0x5'));var interaction=require(_0xf1fd('0x6'));var config=require(_0xf1fd('0x7'));var controller=require('./intServicenowField.controller');router[_0xf1fd('0x8')]('/',auth[_0xf1fd('0x9')](),controller['index']);router[_0xf1fd('0x8')](_0xf1fd('0xa'),auth[_0xf1fd('0x9')](),controller[_0xf1fd('0xb')]);router[_0xf1fd('0xc')]('/',auth[_0xf1fd('0x9')](),controller[_0xf1fd('0xd')]);router[_0xf1fd('0xe')]('/:id',auth[_0xf1fd('0x9')](),controller[_0xf1fd('0xf')]);router[_0xf1fd('0x10')](_0xf1fd('0xa'),auth[_0xf1fd('0x9')](),controller['destroy']);module[_0xf1fd('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 7771296..72c2e75 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 _0xf96e=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x2baf85,_0x274fc7){var _0x2fc99f=function(_0x59baab){while(--_0x59baab){_0x2baf85['push'](_0x2baf85['shift']());}};_0x2fc99f(++_0x274fc7);}(_0xf96e,0x151));var _0xef96=function(_0x4ed5fd,_0x2146fe){_0x4ed5fd=_0x4ed5fd-0x0;var _0x5970d6=_0xf96e[_0x4ed5fd];return _0x5970d6;};'use strict';var Sequelize=require(_0xef96('0x0'));module[_0xef96('0x1')]={'type':{'type':Sequelize[_0xef96('0x2')](_0xef96('0x3'),_0xef96('0x4'),_0xef96('0x5'),_0xef96('0x6'),_0xef96('0x7')),'defaultValue':_0xef96('0x3')},'content':{'type':Sequelize[_0xef96('0x8')]},'key':{'type':Sequelize[_0xef96('0x8')]},'keyType':{'type':Sequelize[_0xef96('0x2')](_0xef96('0x3'),'variable',_0xef96('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xef96('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xef96('0x8')]}}; \ No newline at end of file +var _0xbc30=['exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbc30,0xef));var _0x0bc3=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xbc30[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0x0bc3('0x0'));module[_0x0bc3('0x1')]={'type':{'type':Sequelize['ENUM'](_0x0bc3('0x2'),_0x0bc3('0x3'),_0x0bc3('0x4'),_0x0bc3('0x5'),_0x0bc3('0x6')),'defaultValue':_0x0bc3('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0bc3('0x7')]},'keyType':{'type':Sequelize[_0x0bc3('0x8')](_0x0bc3('0x2'),'variable',_0x0bc3('0x4'))},'keyContent':{'type':Sequelize[_0x0bc3('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0bc3('0x7')]},'customField':{'type':Sequelize[_0x0bc3('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 9a7006b..da4bbc6 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 _0x15a1=['rows','catch','params','find','create','body','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowField','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll'];(function(_0x266593,_0x37e737){var _0x21956f=function(_0x1f7cc7){while(--_0x1f7cc7){_0x266593['push'](_0x266593['shift']());}};_0x21956f(++_0x37e737);}(_0x15a1,0x136));var _0x115a=function(_0x3f151e,_0x2191d9){_0x3f151e=_0x3f151e-0x0;var _0x3c712c=_0x15a1[_0x3f151e];return _0x3c712c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x115a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x115a('0x1'));var moment=require(_0x115a('0x2'));var BPromise=require(_0x115a('0x3'));var Mustache=require(_0x115a('0x4'));var util=require(_0x115a('0x5'));var path=require(_0x115a('0x6'));var sox=require(_0x115a('0x7'));var csv=require(_0x115a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x115a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x115a('0xa'));var jsforce=require(_0x115a('0xb'));var deskjs=require(_0x115a('0xc'));var toCsv=require(_0x115a('0x8'));var querystring=require(_0x115a('0xd'));var Papa=require(_0x115a('0xe'));var Redis=require(_0x115a('0xf'));var authService=require(_0x115a('0x10'));var qs=require(_0x115a('0x11'));var as=require(_0x115a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x115a('0x13'))(_0x115a('0x14'));var utils=require(_0x115a('0x15'));var config=require(_0x115a('0x16'));var licenseUtil=require(_0x115a('0x17'));var db=require(_0x115a('0x18'))['db'];function respondWithStatusCode(_0x929422,_0x1486fd){_0x1486fd=_0x1486fd||0xcc;return function(_0x511ff1){if(_0x511ff1){return _0x929422[_0x115a('0x19')](_0x1486fd);}return _0x929422[_0x115a('0x1a')](_0x1486fd)[_0x115a('0x1b')]();};}function respondWithResult(_0x55e787,_0x508b0c){_0x508b0c=_0x508b0c||0xc8;return function(_0x5bfcab){if(_0x5bfcab){return _0x55e787[_0x115a('0x1a')](_0x508b0c)[_0x115a('0x1c')](_0x5bfcab);}};}function respondWithFilteredResult(_0x182e86,_0x84070){return function(_0x290d47){if(_0x290d47){var _0x343335=typeof _0x84070[_0x115a('0x1d')]==='undefined'&&typeof _0x84070[_0x115a('0x1e')]===_0x115a('0x1f');var _0x580cd1=_0x290d47['count'];var _0x562eb7=_0x343335?0x0:_0x84070['offset'];var _0x430137=_0x343335?_0x290d47[_0x115a('0x20')]:_0x84070[_0x115a('0x1d')]+_0x84070['limit'];var _0x2e7fbe;if(_0x430137>=_0x580cd1){_0x430137=_0x580cd1;_0x2e7fbe=0xc8;}else{_0x2e7fbe=0xce;}_0x182e86[_0x115a('0x1a')](_0x2e7fbe);return _0x182e86[_0x115a('0x21')](_0x115a('0x22'),_0x562eb7+'-'+_0x430137+'/'+_0x580cd1)[_0x115a('0x1c')](_0x290d47);}return null;};}function patchUpdates(_0x2be76c){return function(_0x2edfa4){try{jsonpatch[_0x115a('0x23')](_0x2edfa4,_0x2be76c,!![]);}catch(_0xae747){return BPromise[_0x115a('0x24')](_0xae747);}return _0x2edfa4[_0x115a('0x25')]();};}function saveUpdates(_0xfc00f0,_0x5bff4d){return function(_0x1aa613){if(_0x1aa613){return _0x1aa613[_0x115a('0x26')](_0xfc00f0)[_0x115a('0x27')](function(_0xf271e1){return _0xf271e1;});}return null;};}function removeEntity(_0xee9571,_0x130dbc){return function(_0x58e38b){if(_0x58e38b){return _0x58e38b[_0x115a('0x28')]()[_0x115a('0x27')](function(){_0xee9571[_0x115a('0x1a')](0xcc)[_0x115a('0x1b')]();});}};}function handleEntityNotFound(_0x68a818,_0x1d9d6b){return function(_0x56d5f5){if(!_0x56d5f5){_0x68a818[_0x115a('0x19')](0x194);}return _0x56d5f5;};}function handleError(_0x3925fa,_0x37266e){_0x37266e=_0x37266e||0x1f4;return function(_0x7c913f){logger[_0x115a('0x29')](_0x7c913f[_0x115a('0x2a')]);if(_0x7c913f[_0x115a('0x2b')]){delete _0x7c913f[_0x115a('0x2b')];}_0x3925fa['status'](_0x37266e)[_0x115a('0x2c')](_0x7c913f);};}exports[_0x115a('0x2d')]=function(_0x535a75,_0x58be27){var _0x18815d={},_0x8337f7={},_0x1a3cc4={'count':0x0,'rows':[]};var _0x403af2=_[_0x115a('0x2e')](db[_0x115a('0x2f')]['rawAttributes'],function(_0xa83165){return{'name':_0xa83165[_0x115a('0x30')],'type':_0xa83165[_0x115a('0x31')][_0x115a('0x32')]};});_0x8337f7[_0x115a('0x33')]=_[_0x115a('0x2e')](_0x403af2,_0x115a('0x2b'));_0x8337f7[_0x115a('0x34')]=_[_0x115a('0x35')](_0x535a75[_0x115a('0x34')]);_0x8337f7[_0x115a('0x36')]=_[_0x115a('0x37')](_0x8337f7[_0x115a('0x33')],_0x8337f7['query']);_0x18815d['attributes']=_[_0x115a('0x37')](_0x8337f7[_0x115a('0x33')],qs[_0x115a('0x38')](_0x535a75[_0x115a('0x34')][_0x115a('0x38')]));_0x18815d['attributes']=_0x18815d[_0x115a('0x39')][_0x115a('0x3a')]?_0x18815d[_0x115a('0x39')]:_0x8337f7[_0x115a('0x33')];if(!_0x535a75[_0x115a('0x34')][_0x115a('0x3b')]('nolimit')){_0x18815d[_0x115a('0x1e')]=qs[_0x115a('0x1e')](_0x535a75[_0x115a('0x34')][_0x115a('0x1e')]);_0x18815d[_0x115a('0x1d')]=qs['offset'](_0x535a75[_0x115a('0x34')]['offset']);}_0x18815d[_0x115a('0x3c')]=qs[_0x115a('0x3d')](_0x535a75['query'][_0x115a('0x3d')]);_0x18815d['where']=qs[_0x115a('0x36')](_[_0x115a('0x3e')](_0x535a75[_0x115a('0x34')],_0x8337f7[_0x115a('0x36')]),_0x403af2);if(_0x535a75['query'][_0x115a('0x3f')]){_0x18815d['where']=_['merge'](_0x18815d[_0x115a('0x40')],{'$or':_[_0x115a('0x2e')](_0x403af2,function(_0x31002e){if(_0x31002e['type']!=='VIRTUAL'){var _0x929160={};_0x929160[_0x31002e['name']]={'$like':'%'+_0x535a75[_0x115a('0x34')]['filter']+'%'};return _0x929160;}})});}_0x18815d=_[_0x115a('0x41')]({},_0x18815d,_0x535a75[_0x115a('0x42')]);var _0x5b8769={'where':_0x18815d[_0x115a('0x40')]};return db[_0x115a('0x2f')][_0x115a('0x20')](_0x5b8769)['then'](function(_0x3e7eb4){_0x1a3cc4[_0x115a('0x20')]=_0x3e7eb4;if(_0x535a75[_0x115a('0x34')][_0x115a('0x43')]){_0x18815d[_0x115a('0x44')]=[{'all':!![]}];}return db[_0x115a('0x2f')][_0x115a('0x45')](_0x18815d);})[_0x115a('0x27')](function(_0x4f33d7){_0x1a3cc4[_0x115a('0x46')]=_0x4f33d7;return _0x1a3cc4;})[_0x115a('0x27')](respondWithFilteredResult(_0x58be27,_0x18815d))[_0x115a('0x47')](handleError(_0x58be27,null));};exports['show']=function(_0x3dfbad,_0x2a0faf){var _0xb41310={'raw':!![],'where':{'id':_0x3dfbad[_0x115a('0x48')]['id']}},_0x5ea747={};_0x5ea747[_0x115a('0x33')]=_[_0x115a('0x35')](db[_0x115a('0x2f')]['rawAttributes']);_0x5ea747[_0x115a('0x34')]=_['keys'](_0x3dfbad[_0x115a('0x34')]);_0x5ea747[_0x115a('0x36')]=_[_0x115a('0x37')](_0x5ea747[_0x115a('0x33')],_0x5ea747['query']);_0xb41310[_0x115a('0x39')]=_[_0x115a('0x37')](_0x5ea747[_0x115a('0x33')],qs['fields'](_0x3dfbad[_0x115a('0x34')][_0x115a('0x38')]));_0xb41310[_0x115a('0x39')]=_0xb41310[_0x115a('0x39')][_0x115a('0x3a')]?_0xb41310[_0x115a('0x39')]:_0x5ea747['model'];if(_0x3dfbad[_0x115a('0x34')][_0x115a('0x43')]){_0xb41310[_0x115a('0x44')]=[{'all':!![]}];}_0xb41310=_[_0x115a('0x41')]({},_0xb41310,_0x3dfbad['options']);return db[_0x115a('0x2f')][_0x115a('0x49')](_0xb41310)[_0x115a('0x27')](handleEntityNotFound(_0x2a0faf,null))[_0x115a('0x27')](respondWithResult(_0x2a0faf,null))[_0x115a('0x47')](handleError(_0x2a0faf,null));};exports[_0x115a('0x4a')]=function(_0x8fbf03,_0x267110){return db[_0x115a('0x2f')]['create'](_0x8fbf03[_0x115a('0x4b')],{})[_0x115a('0x27')](respondWithResult(_0x267110,0xc9))[_0x115a('0x47')](handleError(_0x267110,null));};exports[_0x115a('0x26')]=function(_0x1f0182,_0x24f14a){if(_0x1f0182[_0x115a('0x4b')]['id']){delete _0x1f0182['body']['id'];}return db[_0x115a('0x2f')][_0x115a('0x49')]({'where':{'id':_0x1f0182[_0x115a('0x48')]['id']}})[_0x115a('0x27')](handleEntityNotFound(_0x24f14a,null))[_0x115a('0x27')](saveUpdates(_0x1f0182[_0x115a('0x4b')],null))[_0x115a('0x27')](respondWithResult(_0x24f14a,null))[_0x115a('0x47')](handleError(_0x24f14a,null));};exports['destroy']=function(_0x5e8915,_0x6638d2){return db[_0x115a('0x2f')][_0x115a('0x49')]({'where':{'id':_0x5e8915[_0x115a('0x48')]['id']}})[_0x115a('0x27')](handleEntityNotFound(_0x6638d2,null))[_0x115a('0x27')](removeEntity(_0x6638d2,null))[_0x115a('0x47')](handleError(_0x6638d2,null));}; \ No newline at end of file +var _0xd340=['sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','rawAttributes','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ServicenowField','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order'];(function(_0x17925d,_0x46543f){var _0x5492b7=function(_0x413f0b){while(--_0x413f0b){_0x17925d['push'](_0x17925d['shift']());}};_0x5492b7(++_0x46543f);}(_0xd340,0x14b));var _0x0d34=function(_0x38f712,_0x51d3e4){_0x38f712=_0x38f712-0x0;var _0x54fdaf=_0xd340[_0x38f712];return _0x54fdaf;};'use strict';var emlformat=require(_0x0d34('0x0'));var rimraf=require(_0x0d34('0x1'));var zipdir=require(_0x0d34('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0d34('0x3'));var moment=require(_0x0d34('0x4'));var BPromise=require(_0x0d34('0x5'));var Mustache=require(_0x0d34('0x6'));var util=require(_0x0d34('0x7'));var path=require(_0x0d34('0x8'));var sox=require(_0x0d34('0x9'));var csv=require(_0x0d34('0xa'));var ejs=require(_0x0d34('0xb'));var fs=require('fs');var fs_extra=require(_0x0d34('0xc'));var _=require(_0x0d34('0xd'));var squel=require(_0x0d34('0xe'));var crypto=require(_0x0d34('0xf'));var jsforce=require(_0x0d34('0x10'));var deskjs=require(_0x0d34('0x11'));var toCsv=require(_0x0d34('0xa'));var querystring=require('querystring');var Papa=require(_0x0d34('0x12'));var Redis=require('ioredis');var authService=require(_0x0d34('0x13'));var qs=require(_0x0d34('0x14'));var as=require(_0x0d34('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d34('0x16'))(_0x0d34('0x17'));var utils=require(_0x0d34('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0d34('0x19'))['db'];function respondWithStatusCode(_0x675de6,_0x48ff57){_0x48ff57=_0x48ff57||0xcc;return function(_0x1d8ae2){if(_0x1d8ae2){return _0x675de6[_0x0d34('0x1a')](_0x48ff57);}return _0x675de6[_0x0d34('0x1b')](_0x48ff57)[_0x0d34('0x1c')]();};}function respondWithResult(_0x30c666,_0x26d628){_0x26d628=_0x26d628||0xc8;return function(_0x1948d7){if(_0x1948d7){return _0x30c666[_0x0d34('0x1b')](_0x26d628)[_0x0d34('0x1d')](_0x1948d7);}};}function respondWithFilteredResult(_0xedca15,_0x3466b3){return function(_0x1435dc){if(_0x1435dc){var _0x567110=typeof _0x3466b3['offset']===_0x0d34('0x1e')&&typeof _0x3466b3['limit']==='undefined';var _0x3442e8=_0x1435dc[_0x0d34('0x1f')];var _0x293037=_0x567110?0x0:_0x3466b3[_0x0d34('0x20')];var _0x2bb45d=_0x567110?_0x1435dc[_0x0d34('0x1f')]:_0x3466b3[_0x0d34('0x20')]+_0x3466b3[_0x0d34('0x21')];var _0x568766;if(_0x2bb45d>=_0x3442e8){_0x2bb45d=_0x3442e8;_0x568766=0xc8;}else{_0x568766=0xce;}_0xedca15['status'](_0x568766);return _0xedca15[_0x0d34('0x22')](_0x0d34('0x23'),_0x293037+'-'+_0x2bb45d+'/'+_0x3442e8)['json'](_0x1435dc);}return null;};}function patchUpdates(_0x3e640c){return function(_0x203b63){try{jsonpatch[_0x0d34('0x24')](_0x203b63,_0x3e640c,!![]);}catch(_0x25f335){return BPromise[_0x0d34('0x25')](_0x25f335);}return _0x203b63[_0x0d34('0x26')]();};}function saveUpdates(_0xfca73e,_0x290922){return function(_0x1aa972){if(_0x1aa972){return _0x1aa972[_0x0d34('0x27')](_0xfca73e)[_0x0d34('0x28')](function(_0x17f0b8){return _0x17f0b8;});}return null;};}function removeEntity(_0x3c6e19,_0x1a85bc){return function(_0x45497a){if(_0x45497a){return _0x45497a['destroy']()[_0x0d34('0x28')](function(){_0x3c6e19[_0x0d34('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4616fb,_0x3e10dc){return function(_0x100d4a){if(!_0x100d4a){_0x4616fb[_0x0d34('0x1a')](0x194);}return _0x100d4a;};}function handleError(_0x490e04,_0xd7e052){_0xd7e052=_0xd7e052||0x1f4;return function(_0x54d568){logger[_0x0d34('0x29')](_0x54d568[_0x0d34('0x2a')]);if(_0x54d568[_0x0d34('0x2b')]){delete _0x54d568[_0x0d34('0x2b')];}_0x490e04[_0x0d34('0x1b')](_0xd7e052)[_0x0d34('0x2c')](_0x54d568);};}exports[_0x0d34('0x2d')]=function(_0x1664bd,_0x3301a3){var _0x373dda={},_0x525513={},_0x24bca6={'count':0x0,'rows':[]};var _0x3e6105=_[_0x0d34('0x2e')](db[_0x0d34('0x2f')]['rawAttributes'],function(_0x5d5eeb){return{'name':_0x5d5eeb[_0x0d34('0x30')],'type':_0x5d5eeb['type'][_0x0d34('0x31')]};});_0x525513[_0x0d34('0x32')]=_[_0x0d34('0x2e')](_0x3e6105,_0x0d34('0x2b'));_0x525513['query']=_[_0x0d34('0x33')](_0x1664bd[_0x0d34('0x34')]);_0x525513['filters']=_[_0x0d34('0x35')](_0x525513['model'],_0x525513['query']);_0x373dda['attributes']=_[_0x0d34('0x35')](_0x525513[_0x0d34('0x32')],qs[_0x0d34('0x36')](_0x1664bd[_0x0d34('0x34')][_0x0d34('0x36')]));_0x373dda[_0x0d34('0x37')]=_0x373dda[_0x0d34('0x37')][_0x0d34('0x38')]?_0x373dda[_0x0d34('0x37')]:_0x525513[_0x0d34('0x32')];if(!_0x1664bd[_0x0d34('0x34')][_0x0d34('0x39')]('nolimit')){_0x373dda[_0x0d34('0x21')]=qs[_0x0d34('0x21')](_0x1664bd[_0x0d34('0x34')][_0x0d34('0x21')]);_0x373dda[_0x0d34('0x20')]=qs[_0x0d34('0x20')](_0x1664bd['query'][_0x0d34('0x20')]);}_0x373dda[_0x0d34('0x3a')]=qs[_0x0d34('0x3b')](_0x1664bd[_0x0d34('0x34')][_0x0d34('0x3b')]);_0x373dda[_0x0d34('0x3c')]=qs[_0x0d34('0x3d')](_[_0x0d34('0x3e')](_0x1664bd['query'],_0x525513[_0x0d34('0x3d')]),_0x3e6105);if(_0x1664bd[_0x0d34('0x34')]['filter']){_0x373dda['where']=_['merge'](_0x373dda[_0x0d34('0x3c')],{'$or':_['map'](_0x3e6105,function(_0x43346a){if(_0x43346a['type']!==_0x0d34('0x3f')){var _0x58251d={};_0x58251d[_0x43346a[_0x0d34('0x2b')]]={'$like':'%'+_0x1664bd[_0x0d34('0x34')][_0x0d34('0x40')]+'%'};return _0x58251d;}})});}_0x373dda=_[_0x0d34('0x41')]({},_0x373dda,_0x1664bd[_0x0d34('0x42')]);var _0x55011d={'where':_0x373dda[_0x0d34('0x3c')]};return db[_0x0d34('0x2f')][_0x0d34('0x1f')](_0x55011d)['then'](function(_0x467020){_0x24bca6[_0x0d34('0x1f')]=_0x467020;if(_0x1664bd[_0x0d34('0x34')][_0x0d34('0x43')]){_0x373dda[_0x0d34('0x44')]=[{'all':!![]}];}return db['ServicenowField'][_0x0d34('0x45')](_0x373dda);})[_0x0d34('0x28')](function(_0x33d998){_0x24bca6[_0x0d34('0x46')]=_0x33d998;return _0x24bca6;})[_0x0d34('0x28')](respondWithFilteredResult(_0x3301a3,_0x373dda))['catch'](handleError(_0x3301a3,null));};exports['show']=function(_0x47c1aa,_0x5eb3b4){var _0x5db42a={'raw':!![],'where':{'id':_0x47c1aa['params']['id']}},_0x53658a={};_0x53658a[_0x0d34('0x32')]=_[_0x0d34('0x33')](db[_0x0d34('0x2f')][_0x0d34('0x47')]);_0x53658a[_0x0d34('0x34')]=_['keys'](_0x47c1aa['query']);_0x53658a['filters']=_[_0x0d34('0x35')](_0x53658a[_0x0d34('0x32')],_0x53658a[_0x0d34('0x34')]);_0x5db42a['attributes']=_[_0x0d34('0x35')](_0x53658a[_0x0d34('0x32')],qs[_0x0d34('0x36')](_0x47c1aa[_0x0d34('0x34')]['fields']));_0x5db42a[_0x0d34('0x37')]=_0x5db42a[_0x0d34('0x37')][_0x0d34('0x38')]?_0x5db42a[_0x0d34('0x37')]:_0x53658a[_0x0d34('0x32')];if(_0x47c1aa[_0x0d34('0x34')][_0x0d34('0x43')]){_0x5db42a[_0x0d34('0x44')]=[{'all':!![]}];}_0x5db42a=_[_0x0d34('0x41')]({},_0x5db42a,_0x47c1aa[_0x0d34('0x42')]);return db[_0x0d34('0x2f')][_0x0d34('0x48')](_0x5db42a)[_0x0d34('0x28')](handleEntityNotFound(_0x5eb3b4,null))['then'](respondWithResult(_0x5eb3b4,null))[_0x0d34('0x49')](handleError(_0x5eb3b4,null));};exports[_0x0d34('0x4a')]=function(_0x566f49,_0x23305f){return db['ServicenowField'][_0x0d34('0x4a')](_0x566f49[_0x0d34('0x4b')],{})['then'](respondWithResult(_0x23305f,0xc9))[_0x0d34('0x49')](handleError(_0x23305f,null));};exports[_0x0d34('0x27')]=function(_0x406df6,_0x55758f){if(_0x406df6[_0x0d34('0x4b')]['id']){delete _0x406df6[_0x0d34('0x4b')]['id'];}return db[_0x0d34('0x2f')]['find']({'where':{'id':_0x406df6[_0x0d34('0x4c')]['id']}})['then'](handleEntityNotFound(_0x55758f,null))[_0x0d34('0x28')](saveUpdates(_0x406df6['body'],null))[_0x0d34('0x28')](respondWithResult(_0x55758f,null))[_0x0d34('0x49')](handleError(_0x55758f,null));};exports[_0x0d34('0x4d')]=function(_0x2c5772,_0x15b47c){return db[_0x0d34('0x2f')][_0x0d34('0x48')]({'where':{'id':_0x2c5772[_0x0d34('0x4c')]['id']}})[_0x0d34('0x28')](handleEntityNotFound(_0x15b47c,null))['then'](removeEntity(_0x15b47c,null))[_0x0d34('0x49')](handleError(_0x15b47c,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 25fff66..122257b 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 _0x800f=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x43d5c9,_0x504342){var _0xd5e178=function(_0x18da8d){while(--_0x18da8d){_0x43d5c9['push'](_0x43d5c9['shift']());}};_0xd5e178(++_0x504342);}(_0x800f,0xdd));var _0xf800=function(_0x3687ec,_0x9c9977){_0x3687ec=_0x3687ec-0x0;var _0x14945d=_0x800f[_0x3687ec];return _0x14945d;};'use strict';var _=require(_0xf800('0x0'));var util=require(_0xf800('0x1'));var logger=require(_0xf800('0x2'))(_0xf800('0x3'));var moment=require(_0xf800('0x4'));var BPromise=require(_0xf800('0x5'));var rp=require(_0xf800('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf800('0x7'));var config=require(_0xf800('0x8'));var attributes=require(_0xf800('0x9'));module[_0xf800('0xa')]=function(_0x4ffbf4,_0x25f2fc){return _0x4ffbf4['define'](_0xf800('0xb'),attributes,{'tableName':_0xf800('0xc'),'paranoid':![],'indexes':[{'name':_0xf800('0xd'),'fields':[_0xf800('0xe'),_0xf800('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe9b5=['int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define'];(function(_0x48779a,_0x2afba6){var _0x4af39b=function(_0x3b5d26){while(--_0x3b5d26){_0x48779a['push'](_0x48779a['shift']());}};_0x4af39b(++_0x2afba6);}(_0xe9b5,0x104));var _0x5e9b=function(_0x4e7713,_0x52e623){_0x4e7713=_0x4e7713-0x0;var _0x404ee2=_0xe9b5[_0x4e7713];return _0x404ee2;};'use strict';var _=require(_0x5e9b('0x0'));var util=require(_0x5e9b('0x1'));var logger=require(_0x5e9b('0x2'))('api');var moment=require(_0x5e9b('0x3'));var BPromise=require(_0x5e9b('0x4'));var rp=require(_0x5e9b('0x5'));var fs=require('fs');var path=require(_0x5e9b('0x6'));var rimraf=require(_0x5e9b('0x7'));var config=require(_0x5e9b('0x8'));var attributes=require(_0x5e9b('0x9'));module[_0x5e9b('0xa')]=function(_0x41e18e,_0x5bd455){return _0x41e18e[_0x5e9b('0xb')]('ServicenowField',attributes,{'tableName':_0x5e9b('0xc'),'paranoid':![],'indexes':[{'name':_0x5e9b('0xd'),'fields':[_0x5e9b('0xe'),_0x5e9b('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index b39552b..a250748 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 _0x9bde=['code','message','ServicenowField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x20e87e,_0x320dc1){var _0x1689fa=function(_0x56c001){while(--_0x56c001){_0x20e87e['push'](_0x20e87e['shift']());}};_0x1689fa(++_0x320dc1);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3a9fdb,_0x5dbb98){_0x3a9fdb=_0x3a9fdb-0x0;var _0x324d57=_0x9bde[_0x3a9fdb];return _0x324d57;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('ServicenowField,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x2f2d31,_0x30b3b8){var _0x36ca42=function(_0x4f0960){while(--_0x4f0960){_0x2f2d31['push'](_0x2f2d31['shift']());}};_0x36ca42(++_0x30b3b8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0xcb91[_0x35485a];return _0x5148e6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ServicenowField,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 233a604..369f554 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(_0x1b329d,_0x374046){var _0x164a18=function(_0x1c68c1){while(--_0x1c68c1){_0x1b329d['push'](_0x1b329d['shift']());}};_0x164a18(++_0x374046);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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(_0x21df11,_0x1884c5){var _0x548414=function(_0x1a747e){while(--_0x1a747e){_0x21df11['push'](_0x21df11['shift']());}};_0x548414(++_0x1884c5);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index ae4a11b..0af71b0 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(_0x511b8c,_0x1e47b6){var _0x84aa88=function(_0x129cdf){while(--_0x129cdf){_0x511b8c['push'](_0x511b8c['shift']());}};_0x84aa88(++_0x1e47b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x2d660c,_0x47e3a5){var _0x29d5fc=function(_0x4915e6){while(--_0x4915e6){_0x2d660c['push'](_0x2d660c['shift']());}};_0x29d5fc(++_0x47e3a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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 e814406..9574efb 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 _0xdff8=['crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','sort','merge','VIRTUAL','filter','options','where','SugarcrmAccount','include','findAll','rows','params','includeAll','find','catch','body','findOne','SugarcrmConfiguration','order','getConfigurations','addConfiguration','Subjects','channel','Descriptions','getDescriptions','create','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','remoteUri','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','password','PLAIN','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','values','module_fields','remove','includes','label','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x2c1ab3,_0x5b7690){var _0xf94d02=function(_0x4ccca7){while(--_0x4ccca7){_0x2c1ab3['push'](_0x2c1ab3['shift']());}};_0xf94d02(++_0x5b7690);}(_0xdff8,0x159));var _0x8dff=function(_0x2c6256,_0x404ccf){_0x2c6256=_0x2c6256-0x0;var _0x4db857=_0xdff8[_0x2c6256];return _0x4db857;};'use strict';var emlformat=require(_0x8dff('0x0'));var rimraf=require(_0x8dff('0x1'));var zipdir=require(_0x8dff('0x2'));var jsonpatch=require(_0x8dff('0x3'));var rp=require(_0x8dff('0x4'));var moment=require('moment');var BPromise=require(_0x8dff('0x5'));var Mustache=require(_0x8dff('0x6'));var util=require(_0x8dff('0x7'));var path=require(_0x8dff('0x8'));var sox=require(_0x8dff('0x9'));var csv=require(_0x8dff('0xa'));var ejs=require(_0x8dff('0xb'));var fs=require('fs');var fs_extra=require(_0x8dff('0xc'));var _=require(_0x8dff('0xd'));var squel=require(_0x8dff('0xe'));var crypto=require(_0x8dff('0xf'));var jsforce=require(_0x8dff('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8dff('0x11'));var Redis=require(_0x8dff('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8dff('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8dff('0x14'));var logger=require(_0x8dff('0x15'))(_0x8dff('0x16'));var utils=require(_0x8dff('0x17'));var config=require(_0x8dff('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x8dff('0x19'));function respondWithStatusCode(_0x530e1e,_0x2bd0bc){_0x2bd0bc=_0x2bd0bc||0xcc;return function(_0x52750a){if(_0x52750a){return _0x530e1e[_0x8dff('0x1a')](_0x2bd0bc);}return _0x530e1e[_0x8dff('0x1b')](_0x2bd0bc)[_0x8dff('0x1c')]();};}function respondWithResult(_0x24d002,_0x5e0007){_0x5e0007=_0x5e0007||0xc8;return function(_0x1ae131){if(_0x1ae131){return _0x24d002[_0x8dff('0x1b')](_0x5e0007)[_0x8dff('0x1d')](_0x1ae131);}};}function respondWithFilteredResult(_0x4cfb00,_0x4df69d){return function(_0x1ee261){if(_0x1ee261){var _0x18d7c8=typeof _0x4df69d[_0x8dff('0x1e')]===_0x8dff('0x1f')&&typeof _0x4df69d[_0x8dff('0x20')]==='undefined';var _0x4e571e=_0x1ee261[_0x8dff('0x21')];var _0x3eeacf=_0x18d7c8?0x0:_0x4df69d[_0x8dff('0x1e')];var _0x316222=_0x18d7c8?_0x1ee261[_0x8dff('0x21')]:_0x4df69d[_0x8dff('0x1e')]+_0x4df69d['limit'];var _0x4008b3;if(_0x316222>=_0x4e571e){_0x316222=_0x4e571e;_0x4008b3=0xc8;}else{_0x4008b3=0xce;}_0x4cfb00[_0x8dff('0x1b')](_0x4008b3);return _0x4cfb00['set'](_0x8dff('0x22'),_0x3eeacf+'-'+_0x316222+'/'+_0x4e571e)[_0x8dff('0x1d')](_0x1ee261);}return null;};}function patchUpdates(_0x5c7d92){return function(_0x33831c){try{jsonpatch[_0x8dff('0x23')](_0x33831c,_0x5c7d92,!![]);}catch(_0x5ebb83){return BPromise['reject'](_0x5ebb83);}return _0x33831c[_0x8dff('0x24')]();};}function saveUpdates(_0x35b994,_0x3eb5b7){return function(_0x23b44b){if(_0x23b44b){return _0x23b44b[_0x8dff('0x25')](_0x35b994)[_0x8dff('0x26')](function(_0x127d11){return _0x127d11;});}return null;};}function removeEntity(_0x2c2c6d,_0x105798){return function(_0x5b6fe5){if(_0x5b6fe5){return _0x5b6fe5[_0x8dff('0x27')]()[_0x8dff('0x26')](function(){_0x2c2c6d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25ea0a,_0x17e999){return function(_0x4d29e6){if(!_0x4d29e6){_0x25ea0a['sendStatus'](0x194);}return _0x4d29e6;};}function handleError(_0x419067,_0xe9713c){_0xe9713c=_0xe9713c||0x1f4;return function(_0x184ce7){logger[_0x8dff('0x28')](_0x184ce7['stack']);if(_0x184ce7[_0x8dff('0x29')]){delete _0x184ce7[_0x8dff('0x29')];}_0x419067[_0x8dff('0x1b')](_0xe9713c)['send'](_0x184ce7);};}exports[_0x8dff('0x2a')]=function(_0x32033e,_0x3f738f){var _0x13e14a={},_0x5a4f49={},_0x471510={'count':0x0,'rows':[]};var _0x5e5041=_[_0x8dff('0x2b')](db['SugarcrmAccount'][_0x8dff('0x2c')],function(_0x501394){return{'name':_0x501394[_0x8dff('0x2d')],'type':_0x501394[_0x8dff('0x2e')][_0x8dff('0x2f')]};});_0x5a4f49['model']=_[_0x8dff('0x2b')](_0x5e5041,_0x8dff('0x29'));_0x5a4f49['query']=_[_0x8dff('0x30')](_0x32033e['query']);_0x5a4f49[_0x8dff('0x31')]=_[_0x8dff('0x32')](_0x5a4f49[_0x8dff('0x33')],_0x5a4f49[_0x8dff('0x34')]);_0x13e14a['attributes']=_[_0x8dff('0x32')](_0x5a4f49[_0x8dff('0x33')],qs[_0x8dff('0x35')](_0x32033e[_0x8dff('0x34')][_0x8dff('0x35')]));_0x13e14a[_0x8dff('0x36')]=_0x13e14a[_0x8dff('0x36')][_0x8dff('0x37')]?_0x13e14a[_0x8dff('0x36')]:_0x5a4f49[_0x8dff('0x33')];if(!_0x32033e['query'][_0x8dff('0x38')](_0x8dff('0x39'))){_0x13e14a['limit']=qs['limit'](_0x32033e[_0x8dff('0x34')][_0x8dff('0x20')]);_0x13e14a[_0x8dff('0x1e')]=qs['offset'](_0x32033e[_0x8dff('0x34')]['offset']);}_0x13e14a['order']=qs['sort'](_0x32033e['query'][_0x8dff('0x3a')]);_0x13e14a['where']=qs[_0x8dff('0x31')](_['pick'](_0x32033e[_0x8dff('0x34')],_0x5a4f49[_0x8dff('0x31')]),_0x5e5041);if(_0x32033e[_0x8dff('0x34')]['filter']){_0x13e14a['where']=_[_0x8dff('0x3b')](_0x13e14a['where'],{'$or':_[_0x8dff('0x2b')](_0x5e5041,function(_0x59edcf){if(_0x59edcf[_0x8dff('0x2e')]!==_0x8dff('0x3c')){var _0x26fbe9={};_0x26fbe9[_0x59edcf[_0x8dff('0x29')]]={'$like':'%'+_0x32033e['query'][_0x8dff('0x3d')]+'%'};return _0x26fbe9;}})});}_0x13e14a=_[_0x8dff('0x3b')]({},_0x13e14a,_0x32033e[_0x8dff('0x3e')]);var _0x7cc8cb={'where':_0x13e14a[_0x8dff('0x3f')]};return db[_0x8dff('0x40')][_0x8dff('0x21')](_0x7cc8cb)[_0x8dff('0x26')](function(_0x535539){_0x471510['count']=_0x535539;if(_0x32033e['query']['includeAll']){_0x13e14a[_0x8dff('0x41')]=[{'all':!![]}];}return db[_0x8dff('0x40')][_0x8dff('0x42')](_0x13e14a);})[_0x8dff('0x26')](function(_0x444691){_0x471510[_0x8dff('0x43')]=_0x444691;return _0x471510;})[_0x8dff('0x26')](respondWithFilteredResult(_0x3f738f,_0x13e14a))['catch'](handleError(_0x3f738f,null));};exports['show']=function(_0x2a0034,_0x266053){var _0x4ed3c5={'raw':![],'where':{'id':_0x2a0034[_0x8dff('0x44')]['id']}},_0x2261e3={};_0x2261e3['model']=_[_0x8dff('0x30')](db[_0x8dff('0x40')]['rawAttributes']);_0x2261e3[_0x8dff('0x34')]=_['keys'](_0x2a0034[_0x8dff('0x34')]);_0x2261e3[_0x8dff('0x31')]=_[_0x8dff('0x32')](_0x2261e3[_0x8dff('0x33')],_0x2261e3[_0x8dff('0x34')]);_0x4ed3c5[_0x8dff('0x36')]=_[_0x8dff('0x32')](_0x2261e3['model'],qs[_0x8dff('0x35')](_0x2a0034['query'][_0x8dff('0x35')]));_0x4ed3c5[_0x8dff('0x36')]=_0x4ed3c5[_0x8dff('0x36')]['length']?_0x4ed3c5[_0x8dff('0x36')]:_0x2261e3[_0x8dff('0x33')];if(_0x2a0034[_0x8dff('0x34')][_0x8dff('0x45')]){_0x4ed3c5[_0x8dff('0x41')]=[{'all':!![]}];}_0x4ed3c5=_[_0x8dff('0x3b')]({},_0x4ed3c5,_0x2a0034[_0x8dff('0x3e')]);return db['SugarcrmAccount'][_0x8dff('0x46')](_0x4ed3c5)[_0x8dff('0x26')](handleEntityNotFound(_0x266053,null))[_0x8dff('0x26')](respondWithResult(_0x266053,null))[_0x8dff('0x47')](handleError(_0x266053,null));};exports['create']=function(_0x1b3127,_0xd2d8ca){return db[_0x8dff('0x40')]['create'](_0x1b3127[_0x8dff('0x48')],{})[_0x8dff('0x26')](respondWithResult(_0xd2d8ca,0xc9))['catch'](handleError(_0xd2d8ca,null));};exports['update']=function(_0x4d3e25,_0x3a9b69){if(_0x4d3e25[_0x8dff('0x48')]['id']){delete _0x4d3e25[_0x8dff('0x48')]['id'];}return db[_0x8dff('0x40')][_0x8dff('0x46')]({'where':{'id':_0x4d3e25[_0x8dff('0x44')]['id']}})[_0x8dff('0x26')](handleEntityNotFound(_0x3a9b69,null))[_0x8dff('0x26')](saveUpdates(_0x4d3e25[_0x8dff('0x48')],null))[_0x8dff('0x26')](respondWithResult(_0x3a9b69,null))[_0x8dff('0x47')](handleError(_0x3a9b69,null));};exports[_0x8dff('0x27')]=function(_0x37802b,_0x2236cf){return db[_0x8dff('0x40')][_0x8dff('0x46')]({'where':{'id':_0x37802b[_0x8dff('0x44')]['id']}})[_0x8dff('0x26')](handleEntityNotFound(_0x2236cf,null))[_0x8dff('0x26')](removeEntity(_0x2236cf,null))[_0x8dff('0x47')](handleError(_0x2236cf,null));};exports['getConfigurations']=function(_0x486586,_0x2ba93f,_0x2d5466){var _0x532b65={};var _0xda33d7={};var _0x35e821;var _0xb267d1;return db['SugarcrmAccount'][_0x8dff('0x49')]({'where':{'id':_0x486586[_0x8dff('0x44')]['id']}})[_0x8dff('0x26')](handleEntityNotFound(_0x2ba93f,null))[_0x8dff('0x26')](function(_0x110389){if(_0x110389){_0x35e821=_0x110389;_0xda33d7[_0x8dff('0x33')]=_[_0x8dff('0x30')](db[_0x8dff('0x4a')]['rawAttributes']);_0xda33d7[_0x8dff('0x34')]=_[_0x8dff('0x30')](_0x486586[_0x8dff('0x34')]);_0xda33d7[_0x8dff('0x31')]=_[_0x8dff('0x32')](_0xda33d7['model'],_0xda33d7[_0x8dff('0x34')]);_0x532b65[_0x8dff('0x36')]=_[_0x8dff('0x32')](_0xda33d7['model'],qs[_0x8dff('0x35')](_0x486586[_0x8dff('0x34')][_0x8dff('0x35')]));_0x532b65[_0x8dff('0x36')]=_0x532b65[_0x8dff('0x36')][_0x8dff('0x37')]?_0x532b65[_0x8dff('0x36')]:_0xda33d7[_0x8dff('0x33')];_0x532b65[_0x8dff('0x4b')]=qs[_0x8dff('0x3a')](_0x486586['query']['sort']);_0x532b65[_0x8dff('0x3f')]=qs[_0x8dff('0x31')](_['pick'](_0x486586[_0x8dff('0x34')],_0xda33d7['filters']));if(_0x486586[_0x8dff('0x34')][_0x8dff('0x3d')]){_0x532b65['where']=_[_0x8dff('0x3b')](_0x532b65[_0x8dff('0x3f')],{'$or':_[_0x8dff('0x2b')](_0x532b65[_0x8dff('0x36')],function(_0x5c4e47){var _0x7c1222={};_0x7c1222[_0x5c4e47]={'$like':'%'+_0x486586[_0x8dff('0x34')][_0x8dff('0x3d')]+'%'};return _0x7c1222;})});}_0x532b65=_[_0x8dff('0x3b')]({},_0x532b65,_0x486586['options']);return _0x35e821['getConfigurations'](_0x532b65);}})[_0x8dff('0x26')](function(_0x5af91d){if(_0x5af91d){_0xb267d1=_0x5af91d[_0x8dff('0x37')];if(!_0x486586['query'][_0x8dff('0x38')](_0x8dff('0x39'))){_0x532b65[_0x8dff('0x20')]=qs[_0x8dff('0x20')](_0x486586[_0x8dff('0x34')][_0x8dff('0x20')]);_0x532b65[_0x8dff('0x1e')]=qs[_0x8dff('0x1e')](_0x486586[_0x8dff('0x34')][_0x8dff('0x1e')]);}return _0x35e821[_0x8dff('0x4c')](_0x532b65);}})[_0x8dff('0x26')](function(_0xa263e9){if(_0xa263e9){return _0xa263e9?{'count':_0xb267d1,'rows':_0xa263e9}:null;}})[_0x8dff('0x26')](respondWithResult(_0x2ba93f,null))['catch'](handleError(_0x2ba93f,null));};exports[_0x8dff('0x4d')]=function(_0x5c7b3d,_0x183b02,_0x573865){if(_0x5c7b3d[_0x8dff('0x48')]['id']){delete _0x5c7b3d['body']['id'];}return db['SugarcrmAccount'][_0x8dff('0x49')]({'where':{'id':_0x5c7b3d[_0x8dff('0x44')]['id']}})[_0x8dff('0x26')](handleEntityNotFound(_0x183b02,null))[_0x8dff('0x26')](function(_0x5b74d6){if(_0x5b74d6){_0x5c7b3d['body']['AccountId']=_0x5b74d6['id'];_0x5c7b3d[_0x8dff('0x48')][_0x8dff('0x4e')]=integrations['getSubjects'](_0x5c7b3d['body'][_0x8dff('0x4f')],_0x5c7b3d[_0x8dff('0x48')]['type']);_0x5c7b3d[_0x8dff('0x48')][_0x8dff('0x50')]=integrations[_0x8dff('0x51')](_0x5c7b3d[_0x8dff('0x48')]['channel'],_0x5c7b3d[_0x8dff('0x48')]['type']);return db[_0x8dff('0x4a')][_0x8dff('0x52')](_0x5c7b3d['body'],{'include':[{'model':db[_0x8dff('0x53')],'as':_0x8dff('0x4e')},{'model':db[_0x8dff('0x53')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x183b02,null))['catch'](handleError(_0x183b02,null));};exports[_0x8dff('0x54')]=function(_0x2b9bdb,_0x211ecb,_0x52d800){var _0x3b5d85='';var _0x3b1160=['id',_0x8dff('0x29'),_0x8dff('0x55'),_0x8dff('0x56'),'description',_0x8dff('0x57'),_0x8dff('0x58'),_0x8dff('0x59'),_0x8dff('0x5a'),_0x8dff('0x5b'),_0x8dff('0x5c'),_0x8dff('0x5d')];return db[_0x8dff('0x40')][_0x8dff('0x49')]({'where':{'id':_0x2b9bdb['params']['id']},'attributes':['id',_0x8dff('0x5e'),'password',_0x8dff('0x5f')]})['then'](handleEntityNotFound(_0x211ecb,null))[_0x8dff('0x26')](function(_0x3e54d3){if(_0x3e54d3){_0x3b5d85=_0x3e54d3['remoteUri'];var _0x4e38fd=_0x3b5d85['slice'](-0x1);if(_0x4e38fd==='/'){_0x3b5d85=_0x3b5d85[_0x8dff('0x60')](0x0,_0x3b5d85[_0x8dff('0x61')](_0x4e38fd));}return rp({'method':'POST','uri':util[_0x8dff('0x62')](_0x8dff('0x63'),_0x3b5d85,_0x8dff('0x64')),'json':!![],'form':{'method':_0x8dff('0x65'),'input_type':_0x8dff('0x66'),'response_type':_0x8dff('0x66'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3e54d3[_0x8dff('0x5e')],'password':_0x3e54d3[_0x8dff('0x67')],'encryption':_0x8dff('0x68')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x8dff('0x26')](function(_0x45211f){if(_0x45211f&&_0x45211f[_0x8dff('0x29')]!==_0x8dff('0x69')&&_0x45211f[_0x8dff('0x29')]!==_0x8dff('0x6a')){return rp({'method':'POST','uri':util['format'](_0x8dff('0x63'),_0x3b5d85,_0x8dff('0x64')),'json':!![],'form':{'method':_0x8dff('0x6b'),'input_type':_0x8dff('0x66'),'response_type':'JSON','rest_data':JSON[_0x8dff('0x6c')]({'session':_0x45211f['id'],'module_name':_0x8dff('0x6d')})}})['then'](function(_0x134bcc){if(_0x134bcc){var _0x40ed9f=_[_0x8dff('0x6e')](_0x134bcc[_0x8dff('0x6f')]);_[_0x8dff('0x70')](_0x40ed9f,function(_0x1078ba){return _0x3b1160[_0x8dff('0x71')](_0x1078ba[_0x8dff('0x29')]);});return{'count':_0x40ed9f[_0x8dff('0x37')],'rows':_[_0x8dff('0x2b')](_0x40ed9f,function(_0x112869){return{'id':_0x112869[_0x8dff('0x29')],'name':_0x112869[_0x8dff('0x72')],'custom':_['endsWith'](_0x112869[_0x8dff('0x29')],'_c')?!![]:![],'options':_0x112869['options']?_[_0x8dff('0x2b')](_['values'](_0x112869['options']),function(_0xe2a70f){return{'name':_0xe2a70f[_0x8dff('0x73')],'value':_0xe2a70f[_0x8dff('0x29')]};}):[]};})};}})[_0x8dff('0x26')](respondWithResult(_0x211ecb,null))[_0x8dff('0x47')](function(_0x5dbb80){var _0x38066b=_0x2b9bdb['query']['test']?0x1f4:_0x5dbb80[_0x8dff('0x74')]||0x1f4;logger[_0x8dff('0x28')](_0x8dff('0x75'),_0x8dff('0x54'),_0x38066b,JSON[_0x8dff('0x6c')](_0x5dbb80));delete _0x5dbb80[_0x8dff('0x29')];if(_0x38066b===0x191){_0x38066b=0x190;}_0x211ecb['status'](_0x38066b)[_0x8dff('0x76')](_0x2b9bdb[_0x8dff('0x34')]['test']?{'message':_0x8dff('0x77'),'statusCode':_0x5dbb80[_0x8dff('0x74')]}:_0x5dbb80);});}else{var _0x477654=0x1f4;_0x211ecb['status'](_0x477654)[_0x8dff('0x76')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x966c=['SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','module_fields','remove','includes','label','endsWith','value','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','then','end','sendStatus','name','send','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','getConfigurations','findOne','options','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions'];(function(_0x4f0e62,_0x28e44f){var _0x117ab8=function(_0x1a74bb){while(--_0x1a74bb){_0x4f0e62['push'](_0x4f0e62['shift']());}};_0x117ab8(++_0x28e44f);}(_0x966c,0xa0));var _0xc966=function(_0x1483bd,_0x32adde){_0x1483bd=_0x1483bd-0x0;var _0x166c75=_0x966c[_0x1483bd];return _0x166c75;};'use strict';var emlformat=require(_0xc966('0x0'));var rimraf=require(_0xc966('0x1'));var zipdir=require(_0xc966('0x2'));var jsonpatch=require(_0xc966('0x3'));var rp=require(_0xc966('0x4'));var moment=require(_0xc966('0x5'));var BPromise=require(_0xc966('0x6'));var Mustache=require(_0xc966('0x7'));var util=require(_0xc966('0x8'));var path=require(_0xc966('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc966('0xa'));var fs=require('fs');var fs_extra=require(_0xc966('0xb'));var _=require(_0xc966('0xc'));var squel=require(_0xc966('0xd'));var crypto=require('crypto');var jsforce=require(_0xc966('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc966('0xf'));var querystring=require(_0xc966('0x10'));var Papa=require('papaparse');var Redis=require(_0xc966('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc966('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc966('0x13'));var utils=require(_0xc966('0x14'));var config=require(_0xc966('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xc966('0x16'));function respondWithStatusCode(_0x23cc72,_0x572214){_0x572214=_0x572214||0xcc;return function(_0x4ce3bd){if(_0x4ce3bd){return _0x23cc72['sendStatus'](_0x572214);}return _0x23cc72[_0xc966('0x17')](_0x572214)['end']();};}function respondWithResult(_0xfbafe5,_0x409f74){_0x409f74=_0x409f74||0xc8;return function(_0x394f6f){if(_0x394f6f){return _0xfbafe5['status'](_0x409f74)[_0xc966('0x18')](_0x394f6f);}};}function respondWithFilteredResult(_0x2adcf7,_0x214794){return function(_0x4c5c3d){if(_0x4c5c3d){var _0x149784=typeof _0x214794['offset']===_0xc966('0x19')&&typeof _0x214794[_0xc966('0x1a')]===_0xc966('0x19');var _0x1a9b59=_0x4c5c3d[_0xc966('0x1b')];var _0x37b8fb=_0x149784?0x0:_0x214794[_0xc966('0x1c')];var _0x5edba9=_0x149784?_0x4c5c3d['count']:_0x214794['offset']+_0x214794[_0xc966('0x1a')];var _0x5ecc30;if(_0x5edba9>=_0x1a9b59){_0x5edba9=_0x1a9b59;_0x5ecc30=0xc8;}else{_0x5ecc30=0xce;}_0x2adcf7['status'](_0x5ecc30);return _0x2adcf7[_0xc966('0x1d')](_0xc966('0x1e'),_0x37b8fb+'-'+_0x5edba9+'/'+_0x1a9b59)['json'](_0x4c5c3d);}return null;};}function patchUpdates(_0x152bf7){return function(_0x310fe0){try{jsonpatch['apply'](_0x310fe0,_0x152bf7,!![]);}catch(_0x5a3032){return BPromise['reject'](_0x5a3032);}return _0x310fe0['save']();};}function saveUpdates(_0x32b32b,_0x262dbe){return function(_0x2afe5d){if(_0x2afe5d){return _0x2afe5d['update'](_0x32b32b)['then'](function(_0x3da6f7){return _0x3da6f7;});}return null;};}function removeEntity(_0x4ccb49,_0xa2ee36){return function(_0x434e5e){if(_0x434e5e){return _0x434e5e['destroy']()[_0xc966('0x1f')](function(){_0x4ccb49[_0xc966('0x17')](0xcc)[_0xc966('0x20')]();});}};}function handleEntityNotFound(_0xb07c,_0x29696e){return function(_0x19e719){if(!_0x19e719){_0xb07c[_0xc966('0x21')](0x194);}return _0x19e719;};}function handleError(_0x49460c,_0x2cc329){_0x2cc329=_0x2cc329||0x1f4;return function(_0x38a4ec){logger['error'](_0x38a4ec['stack']);if(_0x38a4ec[_0xc966('0x22')]){delete _0x38a4ec[_0xc966('0x22')];}_0x49460c[_0xc966('0x17')](_0x2cc329)[_0xc966('0x23')](_0x38a4ec);};}exports['index']=function(_0x635ffd,_0x3d5c93){var _0x13a882={},_0x2f4312={},_0x3b5a6c={'count':0x0,'rows':[]};var _0x37637d=_[_0xc966('0x24')](db[_0xc966('0x25')][_0xc966('0x26')],function(_0x266af1){return{'name':_0x266af1[_0xc966('0x27')],'type':_0x266af1[_0xc966('0x28')][_0xc966('0x29')]};});_0x2f4312[_0xc966('0x2a')]=_['map'](_0x37637d,_0xc966('0x22'));_0x2f4312['query']=_['keys'](_0x635ffd[_0xc966('0x2b')]);_0x2f4312[_0xc966('0x2c')]=_[_0xc966('0x2d')](_0x2f4312[_0xc966('0x2a')],_0x2f4312[_0xc966('0x2b')]);_0x13a882['attributes']=_[_0xc966('0x2d')](_0x2f4312[_0xc966('0x2a')],qs[_0xc966('0x2e')](_0x635ffd[_0xc966('0x2b')][_0xc966('0x2e')]));_0x13a882[_0xc966('0x2f')]=_0x13a882['attributes'][_0xc966('0x30')]?_0x13a882[_0xc966('0x2f')]:_0x2f4312[_0xc966('0x2a')];if(!_0x635ffd[_0xc966('0x2b')][_0xc966('0x31')](_0xc966('0x32'))){_0x13a882[_0xc966('0x1a')]=qs['limit'](_0x635ffd[_0xc966('0x2b')][_0xc966('0x1a')]);_0x13a882[_0xc966('0x1c')]=qs[_0xc966('0x1c')](_0x635ffd[_0xc966('0x2b')][_0xc966('0x1c')]);}_0x13a882[_0xc966('0x33')]=qs[_0xc966('0x34')](_0x635ffd[_0xc966('0x2b')]['sort']);_0x13a882[_0xc966('0x35')]=qs['filters'](_[_0xc966('0x36')](_0x635ffd[_0xc966('0x2b')],_0x2f4312[_0xc966('0x2c')]),_0x37637d);if(_0x635ffd[_0xc966('0x2b')][_0xc966('0x37')]){_0x13a882[_0xc966('0x35')]=_[_0xc966('0x38')](_0x13a882[_0xc966('0x35')],{'$or':_[_0xc966('0x24')](_0x37637d,function(_0x78ee1c){if(_0x78ee1c[_0xc966('0x28')]!==_0xc966('0x39')){var _0x46f2e5={};_0x46f2e5[_0x78ee1c['name']]={'$like':'%'+_0x635ffd[_0xc966('0x2b')][_0xc966('0x37')]+'%'};return _0x46f2e5;}})});}_0x13a882=_[_0xc966('0x38')]({},_0x13a882,_0x635ffd['options']);var _0x2959e6={'where':_0x13a882[_0xc966('0x35')]};return db[_0xc966('0x25')][_0xc966('0x1b')](_0x2959e6)[_0xc966('0x1f')](function(_0x4632a1){_0x3b5a6c[_0xc966('0x1b')]=_0x4632a1;if(_0x635ffd['query']['includeAll']){_0x13a882[_0xc966('0x3a')]=[{'all':!![]}];}return db[_0xc966('0x25')][_0xc966('0x3b')](_0x13a882);})[_0xc966('0x1f')](function(_0x17543c){_0x3b5a6c[_0xc966('0x3c')]=_0x17543c;return _0x3b5a6c;})[_0xc966('0x1f')](respondWithFilteredResult(_0x3d5c93,_0x13a882))[_0xc966('0x3d')](handleError(_0x3d5c93,null));};exports[_0xc966('0x3e')]=function(_0x31b959,_0x46576a){var _0x353a4c={'raw':![],'where':{'id':_0x31b959[_0xc966('0x3f')]['id']}},_0x45c96f={};_0x45c96f['model']=_[_0xc966('0x40')](db[_0xc966('0x25')][_0xc966('0x26')]);_0x45c96f[_0xc966('0x2b')]=_[_0xc966('0x40')](_0x31b959['query']);_0x45c96f['filters']=_[_0xc966('0x2d')](_0x45c96f[_0xc966('0x2a')],_0x45c96f[_0xc966('0x2b')]);_0x353a4c[_0xc966('0x2f')]=_['intersection'](_0x45c96f[_0xc966('0x2a')],qs[_0xc966('0x2e')](_0x31b959[_0xc966('0x2b')][_0xc966('0x2e')]));_0x353a4c[_0xc966('0x2f')]=_0x353a4c[_0xc966('0x2f')][_0xc966('0x30')]?_0x353a4c['attributes']:_0x45c96f[_0xc966('0x2a')];if(_0x31b959['query'][_0xc966('0x41')]){_0x353a4c[_0xc966('0x3a')]=[{'all':!![]}];}_0x353a4c=_[_0xc966('0x38')]({},_0x353a4c,_0x31b959['options']);return db['SugarcrmAccount'][_0xc966('0x42')](_0x353a4c)[_0xc966('0x1f')](handleEntityNotFound(_0x46576a,null))['then'](respondWithResult(_0x46576a,null))[_0xc966('0x3d')](handleError(_0x46576a,null));};exports[_0xc966('0x43')]=function(_0x4ecf84,_0x38a338){return db[_0xc966('0x25')][_0xc966('0x43')](_0x4ecf84[_0xc966('0x44')],{})[_0xc966('0x1f')](respondWithResult(_0x38a338,0xc9))[_0xc966('0x3d')](handleError(_0x38a338,null));};exports['update']=function(_0x1b839f,_0x27384c){if(_0x1b839f['body']['id']){delete _0x1b839f[_0xc966('0x44')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x1b839f[_0xc966('0x3f')]['id']}})['then'](handleEntityNotFound(_0x27384c,null))[_0xc966('0x1f')](saveUpdates(_0x1b839f[_0xc966('0x44')],null))[_0xc966('0x1f')](respondWithResult(_0x27384c,null))[_0xc966('0x3d')](handleError(_0x27384c,null));};exports['destroy']=function(_0x5a5caf,_0x21c1e3){return db[_0xc966('0x25')]['find']({'where':{'id':_0x5a5caf[_0xc966('0x3f')]['id']}})[_0xc966('0x1f')](handleEntityNotFound(_0x21c1e3,null))[_0xc966('0x1f')](removeEntity(_0x21c1e3,null))['catch'](handleError(_0x21c1e3,null));};exports[_0xc966('0x45')]=function(_0x4b1abb,_0x20f358,_0x2fff17){var _0x33d2e4={};var _0x61051a={};var _0x5a5008;var _0x446329;return db['SugarcrmAccount'][_0xc966('0x46')]({'where':{'id':_0x4b1abb[_0xc966('0x3f')]['id']}})[_0xc966('0x1f')](handleEntityNotFound(_0x20f358,null))[_0xc966('0x1f')](function(_0x224f58){if(_0x224f58){_0x5a5008=_0x224f58;_0x61051a['model']=_[_0xc966('0x40')](db['SugarcrmConfiguration'][_0xc966('0x26')]);_0x61051a[_0xc966('0x2b')]=_['keys'](_0x4b1abb[_0xc966('0x2b')]);_0x61051a[_0xc966('0x2c')]=_[_0xc966('0x2d')](_0x61051a[_0xc966('0x2a')],_0x61051a[_0xc966('0x2b')]);_0x33d2e4[_0xc966('0x2f')]=_[_0xc966('0x2d')](_0x61051a['model'],qs[_0xc966('0x2e')](_0x4b1abb['query']['fields']));_0x33d2e4['attributes']=_0x33d2e4[_0xc966('0x2f')]['length']?_0x33d2e4[_0xc966('0x2f')]:_0x61051a[_0xc966('0x2a')];_0x33d2e4[_0xc966('0x33')]=qs[_0xc966('0x34')](_0x4b1abb[_0xc966('0x2b')][_0xc966('0x34')]);_0x33d2e4['where']=qs['filters'](_[_0xc966('0x36')](_0x4b1abb[_0xc966('0x2b')],_0x61051a[_0xc966('0x2c')]));if(_0x4b1abb[_0xc966('0x2b')][_0xc966('0x37')]){_0x33d2e4['where']=_[_0xc966('0x38')](_0x33d2e4[_0xc966('0x35')],{'$or':_[_0xc966('0x24')](_0x33d2e4[_0xc966('0x2f')],function(_0x54c393){var _0x5b0356={};_0x5b0356[_0x54c393]={'$like':'%'+_0x4b1abb[_0xc966('0x2b')][_0xc966('0x37')]+'%'};return _0x5b0356;})});}_0x33d2e4=_[_0xc966('0x38')]({},_0x33d2e4,_0x4b1abb[_0xc966('0x47')]);return _0x5a5008['getConfigurations'](_0x33d2e4);}})[_0xc966('0x1f')](function(_0x4dabfd){if(_0x4dabfd){_0x446329=_0x4dabfd[_0xc966('0x30')];if(!_0x4b1abb[_0xc966('0x2b')][_0xc966('0x31')]('nolimit')){_0x33d2e4[_0xc966('0x1a')]=qs[_0xc966('0x1a')](_0x4b1abb[_0xc966('0x2b')][_0xc966('0x1a')]);_0x33d2e4['offset']=qs[_0xc966('0x1c')](_0x4b1abb[_0xc966('0x2b')][_0xc966('0x1c')]);}return _0x5a5008[_0xc966('0x45')](_0x33d2e4);}})[_0xc966('0x1f')](function(_0x2095b3){if(_0x2095b3){return _0x2095b3?{'count':_0x446329,'rows':_0x2095b3}:null;}})['then'](respondWithResult(_0x20f358,null))['catch'](handleError(_0x20f358,null));};exports[_0xc966('0x48')]=function(_0x31232c,_0x3b510c,_0x3f64d9){if(_0x31232c[_0xc966('0x44')]['id']){delete _0x31232c[_0xc966('0x44')]['id'];}return db['SugarcrmAccount'][_0xc966('0x46')]({'where':{'id':_0x31232c[_0xc966('0x3f')]['id']}})[_0xc966('0x1f')](handleEntityNotFound(_0x3b510c,null))[_0xc966('0x1f')](function(_0x438690){if(_0x438690){_0x31232c[_0xc966('0x44')][_0xc966('0x49')]=_0x438690['id'];_0x31232c[_0xc966('0x44')][_0xc966('0x4a')]=integrations['getSubjects'](_0x31232c[_0xc966('0x44')][_0xc966('0x4b')],_0x31232c[_0xc966('0x44')][_0xc966('0x28')]);_0x31232c[_0xc966('0x44')][_0xc966('0x4c')]=integrations[_0xc966('0x4d')](_0x31232c['body'][_0xc966('0x4b')],_0x31232c[_0xc966('0x44')]['type']);return db[_0xc966('0x4e')][_0xc966('0x43')](_0x31232c[_0xc966('0x44')],{'include':[{'model':db[_0xc966('0x4f')],'as':'Subjects'},{'model':db[_0xc966('0x4f')],'as':_0xc966('0x4c')}]});}return null;})[_0xc966('0x1f')](respondWithResult(_0x3b510c,null))['catch'](handleError(_0x3b510c,null));};exports[_0xc966('0x50')]=function(_0x435e11,_0x336393,_0x577409){var _0x253db4='';var _0x4f67b5=['id',_0xc966('0x22'),_0xc966('0x51'),_0xc966('0x52'),_0xc966('0x53'),_0xc966('0x54'),'duration_hours','duration_minutes',_0xc966('0x55'),_0xc966('0x56'),_0xc966('0x57'),_0xc966('0x58')];return db[_0xc966('0x25')][_0xc966('0x46')]({'where':{'id':_0x435e11[_0xc966('0x3f')]['id']},'attributes':['id',_0xc966('0x59'),_0xc966('0x5a'),_0xc966('0x5b')]})[_0xc966('0x1f')](handleEntityNotFound(_0x336393,null))[_0xc966('0x1f')](function(_0x48271f){if(_0x48271f){_0x253db4=_0x48271f['remoteUri'];var _0x2d7c3c=_0x253db4[_0xc966('0x5c')](-0x1);if(_0x2d7c3c==='/'){_0x253db4=_0x253db4[_0xc966('0x5d')](0x0,_0x253db4[_0xc966('0x5e')](_0x2d7c3c));}return rp({'method':_0xc966('0x5f'),'uri':util[_0xc966('0x60')](_0xc966('0x61'),_0x253db4,_0xc966('0x62')),'json':!![],'form':{'method':_0xc966('0x63'),'input_type':_0xc966('0x64'),'response_type':_0xc966('0x64'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x48271f['username'],'password':_0x48271f[_0xc966('0x5a')],'encryption':_0xc966('0x65')},'application':_0xc966('0x66')})}});}})[_0xc966('0x1f')](function(_0x2b8338){if(_0x2b8338&&_0x2b8338[_0xc966('0x22')]!==_0xc966('0x67')&&_0x2b8338[_0xc966('0x22')]!==_0xc966('0x68')){return rp({'method':'POST','uri':util['format'](_0xc966('0x61'),_0x253db4,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xc966('0x69'),'input_type':_0xc966('0x64'),'response_type':'JSON','rest_data':JSON[_0xc966('0x6a')]({'session':_0x2b8338['id'],'module_name':_0xc966('0x6b')})}})[_0xc966('0x1f')](function(_0x297935){if(_0x297935){var _0xf0150=_['values'](_0x297935[_0xc966('0x6c')]);_[_0xc966('0x6d')](_0xf0150,function(_0x318640){return _0x4f67b5[_0xc966('0x6e')](_0x318640[_0xc966('0x22')]);});return{'count':_0xf0150['length'],'rows':_[_0xc966('0x24')](_0xf0150,function(_0xa1ca6a){return{'id':_0xa1ca6a['name'],'name':_0xa1ca6a[_0xc966('0x6f')],'custom':_[_0xc966('0x70')](_0xa1ca6a[_0xc966('0x22')],'_c')?!![]:![],'options':_0xa1ca6a['options']?_[_0xc966('0x24')](_['values'](_0xa1ca6a[_0xc966('0x47')]),function(_0x218e33){return{'name':_0x218e33[_0xc966('0x71')],'value':_0x218e33[_0xc966('0x22')]};}):[]};})};}})[_0xc966('0x1f')](respondWithResult(_0x336393,null))[_0xc966('0x3d')](function(_0x510037){var _0x2c52ef=_0x435e11[_0xc966('0x2b')]['test']?0x1f4:_0x510037[_0xc966('0x72')]||0x1f4;logger[_0xc966('0x73')](_0xc966('0x74'),_0xc966('0x50'),_0x2c52ef,JSON[_0xc966('0x6a')](_0x510037));delete _0x510037['name'];if(_0x2c52ef===0x191){_0x2c52ef=0x190;}_0x336393[_0xc966('0x17')](_0x2c52ef)[_0xc966('0x23')](_0x435e11['query'][_0xc966('0x75')]?{'message':_0xc966('0x76'),'statusCode':_0x510037[_0xc966('0x72')]}:_0x510037);});}else{var _0x4e75f2=0x1f4;_0x336393['status'](_0x4e75f2)['send']({'message':_0xc966('0x76'),'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 2b6354c..bd4af02 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 _0x2935=['moment','bluebird','request-promise','rimraf','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','api'];(function(_0xe09377,_0x285d6c){var _0x3a4c8b=function(_0xfce733){while(--_0xfce733){_0xe09377['push'](_0xe09377['shift']());}};_0x3a4c8b(++_0x285d6c);}(_0x2935,0xda));var _0x5293=function(_0x1ab783,_0x3bef22){_0x1ab783=_0x1ab783-0x0;var _0x2f5fa4=_0x2935[_0x1ab783];return _0x2f5fa4;};'use strict';var _=require(_0x5293('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5293('0x1'));var moment=require(_0x5293('0x2'));var BPromise=require(_0x5293('0x3'));var rp=require(_0x5293('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5293('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x5293('0x6')]=function(_0x5ef467,_0x96471f){return _0x5ef467[_0x5293('0x7')](_0x5293('0x8'),attributes,{'tableName':_0x5293('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd276=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','int_sugarcrm_accounts','lodash'];(function(_0x5710ed,_0x3198aa){var _0x3f656f=function(_0x3ee9cd){while(--_0x3ee9cd){_0x5710ed['push'](_0x5710ed['shift']());}};_0x3f656f(++_0x3198aa);}(_0xd276,0xfc));var _0x6d27=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xd276[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x6d27('0x0'));var util=require(_0x6d27('0x1'));var logger=require(_0x6d27('0x2'))(_0x6d27('0x3'));var moment=require('moment');var BPromise=require(_0x6d27('0x4'));var rp=require(_0x6d27('0x5'));var fs=require('fs');var path=require(_0x6d27('0x6'));var rimraf=require(_0x6d27('0x7'));var config=require('../../config/environment');var attributes=require(_0x6d27('0x8'));var integrations=require(_0x6d27('0x9'));module['exports']=function(_0x3060f5,_0x422029){return _0x3060f5['define']('SugarcrmAccount',attributes,{'tableName':_0x6d27('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 488b5e1..f4fd4b0 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 _0x6804=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','ShowSugarcrmAccount','moment','bluebird'];(function(_0x242b73,_0x179771){var _0x2863a4=function(_0x8d5c00){while(--_0x8d5c00){_0x242b73['push'](_0x242b73['shift']());}};_0x2863a4(++_0x179771);}(_0x6804,0x15e));var _0x4680=function(_0x1db4bf,_0x1bb47f){_0x1db4bf=_0x1db4bf-0x0;var _0x287e30=_0x6804[_0x1db4bf];return _0x287e30;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4680('0x0'));var BPromise=require(_0x4680('0x1'));var rs=require(_0x4680('0x2'));var fs=require('fs');var Redis=require(_0x4680('0x3'));var db=require(_0x4680('0x4'))['db'];var utils=require(_0x4680('0x5'));var logger=require(_0x4680('0x6'))('rpc');var config=require(_0x4680('0x7'));var jayson=require(_0x4680('0x8'));var client=jayson[_0x4680('0x9')][_0x4680('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x84a005,_0xe68249,_0x39d456){return new BPromise(function(_0x5d3e29,_0x1d3760){return client['request'](_0x84a005,_0x39d456)[_0x4680('0xb')](function(_0x4988f6){logger['info'](_0x4680('0xc'),_0xe68249,_0x4680('0xd'));logger[_0x4680('0xe')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0xe68249,_0x4680('0xd'),JSON[_0x4680('0xf')](_0x4988f6));if(_0x4988f6[_0x4680('0x10')]){if(_0x4988f6[_0x4680('0x10')]['code']===0x1f4){logger[_0x4680('0x10')](_0x4680('0xc'),_0xe68249,_0x4988f6[_0x4680('0x10')][_0x4680('0x11')]);return _0x1d3760(_0x4988f6['error']['message']);}logger[_0x4680('0x10')](_0x4680('0xc'),_0xe68249,_0x4988f6[_0x4680('0x10')][_0x4680('0x11')]);return _0x5d3e29(_0x4988f6[_0x4680('0x10')][_0x4680('0x11')]);}else{logger[_0x4680('0x12')](_0x4680('0xc'),_0xe68249,_0x4680('0xd'));_0x5d3e29(_0x4988f6[_0x4680('0x13')][_0x4680('0x11')]);}})[_0x4680('0x14')](function(_0x2ebcb6){logger['error'](_0x4680('0xc'),_0xe68249,_0x2ebcb6);_0x1d3760(_0x2ebcb6);});});}exports[_0x4680('0x15')]=function(_0x371fb2){var _0x373690=this;return new Promise(function(_0x116161,_0x43b5ff){return db[_0x4680('0x16')][_0x4680('0x17')]({'raw':_0x371fb2[_0x4680('0x18')]?_0x371fb2[_0x4680('0x18')][_0x4680('0x19')]===undefined?!![]:![]:!![],'where':_0x371fb2[_0x4680('0x18')]?_0x371fb2['options'][_0x4680('0x1a')]||null:null,'attributes':_0x371fb2[_0x4680('0x18')]?_0x371fb2[_0x4680('0x18')][_0x4680('0x1b')]||null:null,'limit':_0x371fb2[_0x4680('0x18')]?_0x371fb2[_0x4680('0x18')]['limit']||null:null,'include':_0x371fb2[_0x4680('0x18')]?_0x371fb2[_0x4680('0x18')][_0x4680('0x1c')]?_[_0x4680('0x1d')](_0x371fb2[_0x4680('0x18')][_0x4680('0x1c')],function(_0x15474d){return{'model':db[_0x15474d[_0x4680('0x1e')]],'as':_0x15474d['as'],'attributes':_0x15474d[_0x4680('0x1b')],'include':_0x15474d[_0x4680('0x1c')]?_[_0x4680('0x1d')](_0x15474d['include'],function(_0x16571c){return{'model':db[_0x16571c['model']],'as':_0x16571c['as'],'attributes':_0x16571c['attributes'],'include':_0x16571c[_0x4680('0x1c')]?_[_0x4680('0x1d')](_0x16571c['include'],function(_0x51fd1f){return{'model':db[_0x51fd1f[_0x4680('0x1e')]],'as':_0x51fd1f['as'],'attributes':_0x51fd1f[_0x4680('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4680('0xb')](function(_0x5ac9fa){logger['info'](_0x4680('0x15'),_0x371fb2);logger[_0x4680('0xe')](_0x4680('0x15'),_0x371fb2,JSON[_0x4680('0xf')](_0x5ac9fa));_0x116161(_0x5ac9fa);})['catch'](function(_0x280999){logger[_0x4680('0x10')](_0x4680('0x15'),_0x280999['message'],_0x371fb2);_0x43b5ff(_0x373690[_0x4680('0x10')](0x1f4,_0x280999['message']));});});};exports[_0x4680('0x1f')]=function(_0x5bd04f){var _0x5c7792=this;return new Promise(function(_0x593bc2,_0xfb856a){return db[_0x4680('0x16')]['find']({'raw':_0x5bd04f[_0x4680('0x18')]?_0x5bd04f[_0x4680('0x18')][_0x4680('0x19')]===undefined?!![]:![]:!![],'where':_0x5bd04f['options']?_0x5bd04f['options'][_0x4680('0x1a')]||null:null,'attributes':_0x5bd04f['options']?_0x5bd04f[_0x4680('0x18')]['attributes']||null:null,'include':_0x5bd04f['options']?_0x5bd04f[_0x4680('0x18')]['include']?_['map'](_0x5bd04f[_0x4680('0x18')][_0x4680('0x1c')],function(_0xd60443){return{'model':db[_0xd60443['model']],'as':_0xd60443['as'],'attributes':_0xd60443[_0x4680('0x1b')],'include':_0xd60443[_0x4680('0x1c')]?_[_0x4680('0x1d')](_0xd60443[_0x4680('0x1c')],function(_0x365be6){return{'model':db[_0x365be6[_0x4680('0x1e')]],'as':_0x365be6['as'],'attributes':_0x365be6[_0x4680('0x1b')],'include':_0x365be6[_0x4680('0x1c')]?_[_0x4680('0x1d')](_0x365be6[_0x4680('0x1c')],function(_0x38c169){return{'model':db[_0x38c169[_0x4680('0x1e')]],'as':_0x38c169['as'],'attributes':_0x38c169[_0x4680('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b84ae){logger[_0x4680('0x12')](_0x4680('0x1f'),_0x5bd04f);logger[_0x4680('0xe')](_0x4680('0x1f'),_0x5bd04f,JSON['stringify'](_0x1b84ae));_0x593bc2(_0x1b84ae);})[_0x4680('0x14')](function(_0x42154f){logger[_0x4680('0x10')](_0x4680('0x1f'),_0x42154f[_0x4680('0x11')],_0x5bd04f);_0xfb856a(_0x5c7792[_0x4680('0x10')](0x1f4,_0x42154f[_0x4680('0x11')]));});});}; \ No newline at end of file +var _0xef48=['map','attributes','ShowSugarcrmAccount','SugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','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','limit','include','model'];(function(_0x308de4,_0x55b6e2){var _0x5e569f=function(_0x4eb8c1){while(--_0x4eb8c1){_0x308de4['push'](_0x308de4['shift']());}};_0x5e569f(++_0x55b6e2);}(_0xef48,0x1bf));var _0x8ef4=function(_0x206ef0,_0x551c1d){_0x206ef0=_0x206ef0-0x0;var _0x596667=_0xef48[_0x206ef0];return _0x596667;};'use strict';var _=require(_0x8ef4('0x0'));var util=require(_0x8ef4('0x1'));var moment=require(_0x8ef4('0x2'));var BPromise=require(_0x8ef4('0x3'));var rs=require(_0x8ef4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ef4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ef4('0x6'))(_0x8ef4('0x7'));var config=require(_0x8ef4('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6204f6,_0x37ff78,_0x178d16){return new BPromise(function(_0x3e552b,_0x4b94bf){return client[_0x8ef4('0x9')](_0x6204f6,_0x178d16)[_0x8ef4('0xa')](function(_0x592281){logger[_0x8ef4('0xb')](_0x8ef4('0xc'),_0x37ff78,_0x8ef4('0xd'));logger[_0x8ef4('0xe')](_0x8ef4('0xf'),_0x37ff78,_0x8ef4('0xd'),JSON[_0x8ef4('0x10')](_0x592281));if(_0x592281[_0x8ef4('0x11')]){if(_0x592281[_0x8ef4('0x11')][_0x8ef4('0x12')]===0x1f4){logger[_0x8ef4('0x11')](_0x8ef4('0xc'),_0x37ff78,_0x592281[_0x8ef4('0x11')][_0x8ef4('0x13')]);return _0x4b94bf(_0x592281[_0x8ef4('0x11')][_0x8ef4('0x13')]);}logger[_0x8ef4('0x11')](_0x8ef4('0xc'),_0x37ff78,_0x592281[_0x8ef4('0x11')]['message']);return _0x3e552b(_0x592281[_0x8ef4('0x11')][_0x8ef4('0x13')]);}else{logger[_0x8ef4('0xb')](_0x8ef4('0xc'),_0x37ff78,_0x8ef4('0xd'));_0x3e552b(_0x592281['result'][_0x8ef4('0x13')]);}})[_0x8ef4('0x14')](function(_0x4c1861){logger[_0x8ef4('0x11')](_0x8ef4('0xc'),_0x37ff78,_0x4c1861);_0x4b94bf(_0x4c1861);});});}exports[_0x8ef4('0x15')]=function(_0x4d8e9e){var _0x4f5638=this;return new Promise(function(_0x6aa16f,_0x2ec96e){return db['SugarcrmAccount'][_0x8ef4('0x16')]({'raw':_0x4d8e9e[_0x8ef4('0x17')]?_0x4d8e9e['options'][_0x8ef4('0x18')]===undefined?!![]:![]:!![],'where':_0x4d8e9e[_0x8ef4('0x17')]?_0x4d8e9e['options'][_0x8ef4('0x19')]||null:null,'attributes':_0x4d8e9e[_0x8ef4('0x17')]?_0x4d8e9e[_0x8ef4('0x17')]['attributes']||null:null,'limit':_0x4d8e9e[_0x8ef4('0x17')]?_0x4d8e9e[_0x8ef4('0x17')][_0x8ef4('0x1a')]||null:null,'include':_0x4d8e9e[_0x8ef4('0x17')]?_0x4d8e9e[_0x8ef4('0x17')][_0x8ef4('0x1b')]?_['map'](_0x4d8e9e[_0x8ef4('0x17')]['include'],function(_0x255229){return{'model':db[_0x255229[_0x8ef4('0x1c')]],'as':_0x255229['as'],'attributes':_0x255229['attributes'],'include':_0x255229[_0x8ef4('0x1b')]?_[_0x8ef4('0x1d')](_0x255229[_0x8ef4('0x1b')],function(_0x421adf){return{'model':db[_0x421adf[_0x8ef4('0x1c')]],'as':_0x421adf['as'],'attributes':_0x421adf['attributes'],'include':_0x421adf[_0x8ef4('0x1b')]?_[_0x8ef4('0x1d')](_0x421adf[_0x8ef4('0x1b')],function(_0x1f4f00){return{'model':db[_0x1f4f00[_0x8ef4('0x1c')]],'as':_0x1f4f00['as'],'attributes':_0x1f4f00[_0x8ef4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8ef4('0xa')](function(_0x289495){logger[_0x8ef4('0xb')](_0x8ef4('0x15'),_0x4d8e9e);logger[_0x8ef4('0xe')](_0x8ef4('0x15'),_0x4d8e9e,JSON[_0x8ef4('0x10')](_0x289495));_0x6aa16f(_0x289495);})[_0x8ef4('0x14')](function(_0x56c7ef){logger[_0x8ef4('0x11')](_0x8ef4('0x15'),_0x56c7ef[_0x8ef4('0x13')],_0x4d8e9e);_0x2ec96e(_0x4f5638[_0x8ef4('0x11')](0x1f4,_0x56c7ef[_0x8ef4('0x13')]));});});};exports[_0x8ef4('0x1f')]=function(_0x47a1e4){var _0x519eed=this;return new Promise(function(_0x33a35d,_0x357fce){return db[_0x8ef4('0x20')][_0x8ef4('0x21')]({'raw':_0x47a1e4['options']?_0x47a1e4['options'][_0x8ef4('0x18')]===undefined?!![]:![]:!![],'where':_0x47a1e4['options']?_0x47a1e4[_0x8ef4('0x17')]['where']||null:null,'attributes':_0x47a1e4[_0x8ef4('0x17')]?_0x47a1e4[_0x8ef4('0x17')][_0x8ef4('0x1e')]||null:null,'include':_0x47a1e4[_0x8ef4('0x17')]?_0x47a1e4[_0x8ef4('0x17')][_0x8ef4('0x1b')]?_[_0x8ef4('0x1d')](_0x47a1e4[_0x8ef4('0x17')][_0x8ef4('0x1b')],function(_0x26f485){return{'model':db[_0x26f485['model']],'as':_0x26f485['as'],'attributes':_0x26f485[_0x8ef4('0x1e')],'include':_0x26f485['include']?_[_0x8ef4('0x1d')](_0x26f485[_0x8ef4('0x1b')],function(_0x4c8d2e){return{'model':db[_0x4c8d2e[_0x8ef4('0x1c')]],'as':_0x4c8d2e['as'],'attributes':_0x4c8d2e[_0x8ef4('0x1e')],'include':_0x4c8d2e[_0x8ef4('0x1b')]?_[_0x8ef4('0x1d')](_0x4c8d2e['include'],function(_0xe00157){return{'model':db[_0xe00157[_0x8ef4('0x1c')]],'as':_0xe00157['as'],'attributes':_0xe00157[_0x8ef4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8ef4('0xa')](function(_0x865559){logger[_0x8ef4('0xb')]('ShowSugarcrmAccount',_0x47a1e4);logger[_0x8ef4('0xe')](_0x8ef4('0x1f'),_0x47a1e4,JSON[_0x8ef4('0x10')](_0x865559));_0x33a35d(_0x865559);})[_0x8ef4('0x14')](function(_0x2930a6){logger[_0x8ef4('0x11')](_0x8ef4('0x1f'),_0x2930a6['message'],_0x47a1e4);_0x357fce(_0x519eed[_0x8ef4('0x11')](0x1f4,_0x2930a6[_0x8ef4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 248341d..5b72735 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 _0xd44d=['../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x418549,_0x11b13d){var _0x288826=function(_0x3c0411){while(--_0x3c0411){_0x418549['push'](_0x418549['shift']());}};_0x288826(++_0x11b13d);}(_0xd44d,0x144));var _0xdd44=function(_0x91efc9,_0x30ade0){_0x91efc9=_0x91efc9-0x0;var _0x5282f2=_0xd44d[_0x91efc9];return _0x5282f2;};'use strict';var multer=require('multer');var util=require(_0xdd44('0x0'));var path=require(_0xdd44('0x1'));var timeout=require('connect-timeout');var express=require(_0xdd44('0x2'));var router=express[_0xdd44('0x3')]();var fs_extra=require(_0xdd44('0x4'));var auth=require(_0xdd44('0x5'));var interaction=require(_0xdd44('0x6'));var config=require('../../config/environment');var controller=require(_0xdd44('0x7'));router[_0xdd44('0x8')]('/',auth[_0xdd44('0x9')](),controller['index']);router['get'](_0xdd44('0xa'),auth[_0xdd44('0x9')](),controller['show']);router['get'](_0xdd44('0xb'),auth['isAuthenticated'](),controller[_0xdd44('0xc')]);router[_0xdd44('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xdd44('0xd')]);router[_0xdd44('0x8')](_0xdd44('0xe'),auth[_0xdd44('0x9')](),controller[_0xdd44('0xf')]);router['post']('/',auth[_0xdd44('0x9')](),controller[_0xdd44('0x10')]);router[_0xdd44('0x11')]('/:id',auth[_0xdd44('0x9')](),controller[_0xdd44('0x12')]);router[_0xdd44('0x13')](_0xdd44('0xa'),auth[_0xdd44('0x9')](),controller[_0xdd44('0x14')]);module[_0xdd44('0x15')]=router; \ No newline at end of file +var _0x6ae0=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields'];(function(_0x528989,_0x349be5){var _0x51c812=function(_0x38661b){while(--_0x38661b){_0x528989['push'](_0x528989['shift']());}};_0x51c812(++_0x349be5);}(_0x6ae0,0x105));var _0x06ae=function(_0x414322,_0x1b4fb0){_0x414322=_0x414322-0x0;var _0x3a0c40=_0x6ae0[_0x414322];return _0x3a0c40;};'use strict';var multer=require(_0x06ae('0x0'));var util=require(_0x06ae('0x1'));var path=require(_0x06ae('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x06ae('0x3'));var auth=require(_0x06ae('0x4'));var interaction=require(_0x06ae('0x5'));var config=require(_0x06ae('0x6'));var controller=require(_0x06ae('0x7'));router['get']('/',auth[_0x06ae('0x8')](),controller[_0x06ae('0x9')]);router[_0x06ae('0xa')](_0x06ae('0xb'),auth['isAuthenticated'](),controller[_0x06ae('0xc')]);router[_0x06ae('0xa')](_0x06ae('0xd'),auth[_0x06ae('0x8')](),controller[_0x06ae('0xe')]);router[_0x06ae('0xa')](_0x06ae('0xf'),auth[_0x06ae('0x8')](),controller[_0x06ae('0x10')]);router[_0x06ae('0xa')](_0x06ae('0x11'),auth['isAuthenticated'](),controller[_0x06ae('0x12')]);router[_0x06ae('0x13')]('/',auth[_0x06ae('0x8')](),controller['create']);router[_0x06ae('0x14')]('/:id',auth[_0x06ae('0x8')](),controller[_0x06ae('0x15')]);router[_0x06ae('0x16')](_0x06ae('0xb'),auth['isAuthenticated'](),controller[_0x06ae('0x17')]);module[_0x06ae('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 3e6e115..30c188f 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 _0xd346=['STRING'];(function(_0x175e12,_0xae3fe7){var _0x69513c=function(_0x499413){while(--_0x499413){_0x175e12['push'](_0x175e12['shift']());}};_0x69513c(++_0xae3fe7);}(_0xd346,0xdf));var _0x6d34=function(_0x12f880,_0x3df0ea){_0x12f880=_0x12f880-0x0;var _0x5cfb10=_0xd346[_0x12f880];return _0x5cfb10;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6d34('0x0')]},'description':{'type':Sequelize[_0x6d34('0x0')]}}; \ No newline at end of file +var _0x9600=['exports','STRING','sequelize'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9600,0x6e));var _0x0960=function(_0x4f2f3b,_0x97a06){_0x4f2f3b=_0x4f2f3b-0x0;var _0x26b2e0=_0x9600[_0x4f2f3b];return _0x26b2e0;};'use strict';var Sequelize=require(_0x0960('0x0'));module[_0x0960('0x1')]={'name':{'type':Sequelize[_0x0960('0x2')]},'description':{'type':Sequelize[_0x0960('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 4d4a799..22e5255 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 _0x5446=['getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','offset','count','limit','set','Content-Range','json','apply','save','then','destroy','sendStatus','error','stack','name','index','key','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','SugarcrmConfiguration','includeAll','include','findAll','rows','catch','show','length','create','body','update','find','params','getFields','findOne','SugarcrmField','hasOwnProperty','getSubjects','rawAttributes'];(function(_0x9bf86e,_0x1fd8f5){var _0x4d9079=function(_0x547792){while(--_0x547792){_0x9bf86e['push'](_0x9bf86e['shift']());}};_0x4d9079(++_0x1fd8f5);}(_0x5446,0xf4));var _0x6544=function(_0x1a8c6d,_0x39f669){_0x1a8c6d=_0x1a8c6d-0x0;var _0x3a86f1=_0x5446[_0x1a8c6d];return _0x3a86f1;};'use strict';var emlformat=require(_0x6544('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6544('0x1'));var jsonpatch=require(_0x6544('0x2'));var rp=require(_0x6544('0x3'));var moment=require(_0x6544('0x4'));var BPromise=require(_0x6544('0x5'));var Mustache=require(_0x6544('0x6'));var util=require('util');var path=require(_0x6544('0x7'));var sox=require(_0x6544('0x8'));var csv=require('to-csv');var ejs=require(_0x6544('0x9'));var fs=require('fs');var fs_extra=require(_0x6544('0xa'));var _=require('lodash');var squel=require(_0x6544('0xb'));var crypto=require('crypto');var jsforce=require(_0x6544('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6544('0xd'));var querystring=require(_0x6544('0xe'));var Papa=require(_0x6544('0xf'));var Redis=require(_0x6544('0x10'));var authService=require(_0x6544('0x11'));var qs=require(_0x6544('0x12'));var as=require(_0x6544('0x13'));var hardwareService=require(_0x6544('0x14'));var logger=require('../../config/logger')(_0x6544('0x15'));var utils=require(_0x6544('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6544('0x17'));var db=require(_0x6544('0x18'))['db'];function respondWithStatusCode(_0x1af98e,_0x5b6322){_0x5b6322=_0x5b6322||0xcc;return function(_0x3d272b){if(_0x3d272b){return _0x1af98e['sendStatus'](_0x5b6322);}return _0x1af98e[_0x6544('0x19')](_0x5b6322)[_0x6544('0x1a')]();};}function respondWithResult(_0xb4570f,_0x59cc16){_0x59cc16=_0x59cc16||0xc8;return function(_0x26b12d){if(_0x26b12d){return _0xb4570f['status'](_0x59cc16)['json'](_0x26b12d);}};}function respondWithFilteredResult(_0x1aea01,_0x13332b){return function(_0xcb2f81){if(_0xcb2f81){var _0x2949da=typeof _0x13332b['offset']===_0x6544('0x1b')&&typeof _0x13332b['limit']===_0x6544('0x1b');var _0x132d8c=_0xcb2f81['count'];var _0x357478=_0x2949da?0x0:_0x13332b[_0x6544('0x1c')];var _0x4cfd1e=_0x2949da?_0xcb2f81[_0x6544('0x1d')]:_0x13332b[_0x6544('0x1c')]+_0x13332b[_0x6544('0x1e')];var _0x36ec92;if(_0x4cfd1e>=_0x132d8c){_0x4cfd1e=_0x132d8c;_0x36ec92=0xc8;}else{_0x36ec92=0xce;}_0x1aea01[_0x6544('0x19')](_0x36ec92);return _0x1aea01[_0x6544('0x1f')](_0x6544('0x20'),_0x357478+'-'+_0x4cfd1e+'/'+_0x132d8c)[_0x6544('0x21')](_0xcb2f81);}return null;};}function patchUpdates(_0x52c03a){return function(_0x278ab8){try{jsonpatch[_0x6544('0x22')](_0x278ab8,_0x52c03a,!![]);}catch(_0x219a87){return BPromise['reject'](_0x219a87);}return _0x278ab8[_0x6544('0x23')]();};}function saveUpdates(_0x432ac0,_0x2579bd){return function(_0x226a33){if(_0x226a33){return _0x226a33['update'](_0x432ac0)[_0x6544('0x24')](function(_0xad427a){return _0xad427a;});}return null;};}function removeEntity(_0x4b3208,_0x2a3fd6){return function(_0x3a71e8){if(_0x3a71e8){return _0x3a71e8[_0x6544('0x25')]()[_0x6544('0x24')](function(){_0x4b3208[_0x6544('0x19')](0xcc)[_0x6544('0x1a')]();});}};}function handleEntityNotFound(_0x30e099,_0x557573){return function(_0x23baf8){if(!_0x23baf8){_0x30e099[_0x6544('0x26')](0x194);}return _0x23baf8;};}function handleError(_0x280f8e,_0x51e1b4){_0x51e1b4=_0x51e1b4||0x1f4;return function(_0x12230c){logger[_0x6544('0x27')](_0x12230c[_0x6544('0x28')]);if(_0x12230c[_0x6544('0x29')]){delete _0x12230c[_0x6544('0x29')];}_0x280f8e[_0x6544('0x19')](_0x51e1b4)['send'](_0x12230c);};}exports[_0x6544('0x2a')]=function(_0x579d0f,_0x2e2076){var _0x370259={},_0x3b5027={},_0x414d97={'count':0x0,'rows':[]};var _0x56bb5a=_['map'](db['SugarcrmConfiguration']['rawAttributes'],function(_0x3a7879){return{'name':_0x3a7879['fieldName'],'type':_0x3a7879['type'][_0x6544('0x2b')]};});_0x3b5027['model']=_['map'](_0x56bb5a,_0x6544('0x29'));_0x3b5027[_0x6544('0x2c')]=_[_0x6544('0x2d')](_0x579d0f[_0x6544('0x2c')]);_0x3b5027[_0x6544('0x2e')]=_[_0x6544('0x2f')](_0x3b5027[_0x6544('0x30')],_0x3b5027[_0x6544('0x2c')]);_0x370259['attributes']=_[_0x6544('0x2f')](_0x3b5027[_0x6544('0x30')],qs[_0x6544('0x31')](_0x579d0f[_0x6544('0x2c')][_0x6544('0x31')]));_0x370259[_0x6544('0x32')]=_0x370259[_0x6544('0x32')]['length']?_0x370259[_0x6544('0x32')]:_0x3b5027['model'];if(!_0x579d0f[_0x6544('0x2c')]['hasOwnProperty'](_0x6544('0x33'))){_0x370259[_0x6544('0x1e')]=qs['limit'](_0x579d0f[_0x6544('0x2c')][_0x6544('0x1e')]);_0x370259[_0x6544('0x1c')]=qs[_0x6544('0x1c')](_0x579d0f[_0x6544('0x2c')][_0x6544('0x1c')]);}_0x370259[_0x6544('0x34')]=qs[_0x6544('0x35')](_0x579d0f['query'][_0x6544('0x35')]);_0x370259['where']=qs['filters'](_[_0x6544('0x36')](_0x579d0f[_0x6544('0x2c')],_0x3b5027[_0x6544('0x2e')]),_0x56bb5a);if(_0x579d0f['query'][_0x6544('0x37')]){_0x370259[_0x6544('0x38')]=_[_0x6544('0x39')](_0x370259['where'],{'$or':_[_0x6544('0x3a')](_0x56bb5a,function(_0xf80fd9){if(_0xf80fd9['type']!==_0x6544('0x3b')){var _0x163e75={};_0x163e75[_0xf80fd9['name']]={'$like':'%'+_0x579d0f[_0x6544('0x2c')][_0x6544('0x37')]+'%'};return _0x163e75;}})});}_0x370259=_[_0x6544('0x39')]({},_0x370259,_0x579d0f[_0x6544('0x3c')]);var _0x48b22b={'where':_0x370259[_0x6544('0x38')]};return db[_0x6544('0x3d')][_0x6544('0x1d')](_0x48b22b)['then'](function(_0x3733cd){_0x414d97[_0x6544('0x1d')]=_0x3733cd;if(_0x579d0f['query'][_0x6544('0x3e')]){_0x370259[_0x6544('0x3f')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x6544('0x40')](_0x370259);})['then'](function(_0x48ee91){_0x414d97[_0x6544('0x41')]=_0x48ee91;return _0x414d97;})[_0x6544('0x24')](respondWithFilteredResult(_0x2e2076,_0x370259))[_0x6544('0x42')](handleError(_0x2e2076,null));};exports[_0x6544('0x43')]=function(_0x29b7ff,_0x404081){var _0x57c8c8={'raw':![],'where':{'id':_0x29b7ff['params']['id']}},_0x2ba5a8={};_0x2ba5a8[_0x6544('0x30')]=_[_0x6544('0x2d')](db[_0x6544('0x3d')]['rawAttributes']);_0x2ba5a8[_0x6544('0x2c')]=_['keys'](_0x29b7ff[_0x6544('0x2c')]);_0x2ba5a8[_0x6544('0x2e')]=_['intersection'](_0x2ba5a8['model'],_0x2ba5a8[_0x6544('0x2c')]);_0x57c8c8[_0x6544('0x32')]=_['intersection'](_0x2ba5a8[_0x6544('0x30')],qs[_0x6544('0x31')](_0x29b7ff[_0x6544('0x2c')]['fields']));_0x57c8c8[_0x6544('0x32')]=_0x57c8c8[_0x6544('0x32')][_0x6544('0x44')]?_0x57c8c8[_0x6544('0x32')]:_0x2ba5a8[_0x6544('0x30')];if(_0x29b7ff[_0x6544('0x2c')]['includeAll']){_0x57c8c8['include']=[{'all':!![]}];}_0x57c8c8=_['merge']({},_0x57c8c8,_0x29b7ff[_0x6544('0x3c')]);return db['SugarcrmConfiguration']['find'](_0x57c8c8)[_0x6544('0x24')](handleEntityNotFound(_0x404081,null))['then'](respondWithResult(_0x404081,null))[_0x6544('0x42')](handleError(_0x404081,null));};exports['create']=function(_0x31f857,_0x19f3db){return db[_0x6544('0x3d')][_0x6544('0x45')](_0x31f857[_0x6544('0x46')],{})[_0x6544('0x24')](respondWithResult(_0x19f3db,0xc9))[_0x6544('0x42')](handleError(_0x19f3db,null));};exports[_0x6544('0x47')]=function(_0x1628de,_0x15657b){if(_0x1628de[_0x6544('0x46')]['id']){delete _0x1628de[_0x6544('0x46')]['id'];}return db[_0x6544('0x3d')][_0x6544('0x48')]({'where':{'id':_0x1628de[_0x6544('0x49')]['id']}})[_0x6544('0x24')](handleEntityNotFound(_0x15657b,null))[_0x6544('0x24')](saveUpdates(_0x1628de[_0x6544('0x46')],null))[_0x6544('0x24')](respondWithResult(_0x15657b,null))[_0x6544('0x42')](handleError(_0x15657b,null));};exports[_0x6544('0x25')]=function(_0x4fa3be,_0x19be38){return db[_0x6544('0x3d')]['find']({'where':{'id':_0x4fa3be[_0x6544('0x49')]['id']}})[_0x6544('0x24')](handleEntityNotFound(_0x19be38,null))[_0x6544('0x24')](removeEntity(_0x19be38,null))[_0x6544('0x42')](handleError(_0x19be38,null));};exports[_0x6544('0x4a')]=function(_0x239e4e,_0x5c5bdf,_0x26d9ca){var _0x3b1433={};var _0x20fe09={};var _0x3a9581;var _0x5ca3cb;return db[_0x6544('0x3d')][_0x6544('0x4b')]({'where':{'id':_0x239e4e[_0x6544('0x49')]['id']}})['then'](handleEntityNotFound(_0x5c5bdf,null))['then'](function(_0x176020){if(_0x176020){_0x3a9581=_0x176020;_0x20fe09[_0x6544('0x30')]=_[_0x6544('0x2d')](db[_0x6544('0x4c')]['rawAttributes']);_0x20fe09[_0x6544('0x2c')]=_[_0x6544('0x2d')](_0x239e4e[_0x6544('0x2c')]);_0x20fe09['filters']=_[_0x6544('0x2f')](_0x20fe09['model'],_0x20fe09[_0x6544('0x2c')]);_0x3b1433[_0x6544('0x32')]=_[_0x6544('0x2f')](_0x20fe09['model'],qs[_0x6544('0x31')](_0x239e4e[_0x6544('0x2c')]['fields']));_0x3b1433[_0x6544('0x32')]=_0x3b1433[_0x6544('0x32')][_0x6544('0x44')]?_0x3b1433[_0x6544('0x32')]:_0x20fe09[_0x6544('0x30')];_0x3b1433[_0x6544('0x34')]=qs['sort'](_0x239e4e[_0x6544('0x2c')][_0x6544('0x35')]);_0x3b1433['where']=qs['filters'](_['pick'](_0x239e4e[_0x6544('0x2c')],_0x20fe09[_0x6544('0x2e')]));if(_0x239e4e[_0x6544('0x2c')][_0x6544('0x37')]){_0x3b1433[_0x6544('0x38')]=_[_0x6544('0x39')](_0x3b1433[_0x6544('0x38')],{'$or':_['map'](_0x3b1433['attributes'],function(_0x11ec8e){var _0x906b8c={};_0x906b8c[_0x11ec8e]={'$like':'%'+_0x239e4e[_0x6544('0x2c')]['filter']+'%'};return _0x906b8c;})});}_0x3b1433=_[_0x6544('0x39')]({},_0x3b1433,_0x239e4e['options']);return _0x3a9581[_0x6544('0x4a')](_0x3b1433);}})['then'](function(_0x552e06){if(_0x552e06){_0x5ca3cb=_0x552e06[_0x6544('0x44')];if(!_0x239e4e[_0x6544('0x2c')][_0x6544('0x4d')](_0x6544('0x33'))){_0x3b1433[_0x6544('0x1e')]=qs[_0x6544('0x1e')](_0x239e4e[_0x6544('0x2c')]['limit']);_0x3b1433[_0x6544('0x1c')]=qs[_0x6544('0x1c')](_0x239e4e[_0x6544('0x2c')][_0x6544('0x1c')]);}return _0x3a9581[_0x6544('0x4a')](_0x3b1433);}})[_0x6544('0x24')](function(_0x18321d){if(_0x18321d){return _0x18321d?{'count':_0x5ca3cb,'rows':_0x18321d}:null;}})[_0x6544('0x24')](respondWithResult(_0x5c5bdf,null))[_0x6544('0x42')](handleError(_0x5c5bdf,null));};exports[_0x6544('0x4e')]=function(_0x62328e,_0xa452f9,_0x58b5e7){var _0x4dc6f9={};var _0x4f03cd={};var _0x1ae210;var _0x4fd450;return db[_0x6544('0x3d')][_0x6544('0x4b')]({'where':{'id':_0x62328e[_0x6544('0x49')]['id']}})[_0x6544('0x24')](handleEntityNotFound(_0xa452f9,null))[_0x6544('0x24')](function(_0xbed1be){if(_0xbed1be){_0x1ae210=_0xbed1be;_0x4f03cd[_0x6544('0x30')]=_[_0x6544('0x2d')](db['SugarcrmField'][_0x6544('0x4f')]);_0x4f03cd[_0x6544('0x2c')]=_[_0x6544('0x2d')](_0x62328e[_0x6544('0x2c')]);_0x4f03cd[_0x6544('0x2e')]=_['intersection'](_0x4f03cd[_0x6544('0x30')],_0x4f03cd['query']);_0x4dc6f9[_0x6544('0x32')]=_[_0x6544('0x2f')](_0x4f03cd[_0x6544('0x30')],qs['fields'](_0x62328e['query'][_0x6544('0x31')]));_0x4dc6f9[_0x6544('0x32')]=_0x4dc6f9[_0x6544('0x32')]['length']?_0x4dc6f9[_0x6544('0x32')]:_0x4f03cd['model'];_0x4dc6f9[_0x6544('0x34')]=qs[_0x6544('0x35')](_0x62328e[_0x6544('0x2c')][_0x6544('0x35')]);_0x4dc6f9[_0x6544('0x38')]=qs[_0x6544('0x2e')](_[_0x6544('0x36')](_0x62328e[_0x6544('0x2c')],_0x4f03cd[_0x6544('0x2e')]));if(_0x62328e['query'][_0x6544('0x37')]){_0x4dc6f9['where']=_['merge'](_0x4dc6f9[_0x6544('0x38')],{'$or':_[_0x6544('0x3a')](_0x4dc6f9[_0x6544('0x32')],function(_0x101432){var _0x4f0104={};_0x4f0104[_0x101432]={'$like':'%'+_0x62328e['query'][_0x6544('0x37')]+'%'};return _0x4f0104;})});}_0x4dc6f9=_[_0x6544('0x39')]({},_0x4dc6f9,_0x62328e[_0x6544('0x3c')]);return _0x1ae210[_0x6544('0x4e')](_0x4dc6f9);}})[_0x6544('0x24')](function(_0xeba453){if(_0xeba453){_0x4fd450=_0xeba453['length'];if(!_0x62328e['query']['hasOwnProperty'](_0x6544('0x33'))){_0x4dc6f9[_0x6544('0x1e')]=qs[_0x6544('0x1e')](_0x62328e[_0x6544('0x2c')]['limit']);_0x4dc6f9['offset']=qs['offset'](_0x62328e[_0x6544('0x2c')]['offset']);}return _0x1ae210['getSubjects'](_0x4dc6f9);}})[_0x6544('0x24')](function(_0x27eb55){if(_0x27eb55){return _0x27eb55?{'count':_0x4fd450,'rows':_0x27eb55}:null;}})[_0x6544('0x24')](respondWithResult(_0xa452f9,null))['catch'](handleError(_0xa452f9,null));};exports[_0x6544('0x50')]=function(_0x2d3e53,_0x5dfdce,_0x184872){var _0xdd3fd3={};var _0x350718={};var _0x55fb1d;var _0x76f9ca;return db[_0x6544('0x3d')][_0x6544('0x4b')]({'where':{'id':_0x2d3e53[_0x6544('0x49')]['id']}})[_0x6544('0x24')](handleEntityNotFound(_0x5dfdce,null))['then'](function(_0x4d14c8){if(_0x4d14c8){_0x55fb1d=_0x4d14c8;_0x350718['model']=_[_0x6544('0x2d')](db[_0x6544('0x4c')][_0x6544('0x4f')]);_0x350718[_0x6544('0x2c')]=_['keys'](_0x2d3e53[_0x6544('0x2c')]);_0x350718[_0x6544('0x2e')]=_[_0x6544('0x2f')](_0x350718['model'],_0x350718[_0x6544('0x2c')]);_0xdd3fd3[_0x6544('0x32')]=_['intersection'](_0x350718['model'],qs[_0x6544('0x31')](_0x2d3e53[_0x6544('0x2c')][_0x6544('0x31')]));_0xdd3fd3[_0x6544('0x32')]=_0xdd3fd3[_0x6544('0x32')][_0x6544('0x44')]?_0xdd3fd3[_0x6544('0x32')]:_0x350718[_0x6544('0x30')];_0xdd3fd3[_0x6544('0x34')]=qs['sort'](_0x2d3e53['query'][_0x6544('0x35')]);_0xdd3fd3[_0x6544('0x38')]=qs[_0x6544('0x2e')](_['pick'](_0x2d3e53[_0x6544('0x2c')],_0x350718[_0x6544('0x2e')]));if(_0x2d3e53[_0x6544('0x2c')][_0x6544('0x37')]){_0xdd3fd3[_0x6544('0x38')]=_['merge'](_0xdd3fd3['where'],{'$or':_[_0x6544('0x3a')](_0xdd3fd3[_0x6544('0x32')],function(_0x9ff2f9){var _0x26f0d7={};_0x26f0d7[_0x9ff2f9]={'$like':'%'+_0x2d3e53[_0x6544('0x2c')][_0x6544('0x37')]+'%'};return _0x26f0d7;})});}_0xdd3fd3=_[_0x6544('0x39')]({},_0xdd3fd3,_0x2d3e53[_0x6544('0x3c')]);return _0x55fb1d[_0x6544('0x50')](_0xdd3fd3);}})[_0x6544('0x24')](function(_0x4ca6ee){if(_0x4ca6ee){_0x76f9ca=_0x4ca6ee['length'];if(!_0x2d3e53[_0x6544('0x2c')][_0x6544('0x4d')]('nolimit')){_0xdd3fd3[_0x6544('0x1e')]=qs[_0x6544('0x1e')](_0x2d3e53[_0x6544('0x2c')]['limit']);_0xdd3fd3[_0x6544('0x1c')]=qs[_0x6544('0x1c')](_0x2d3e53['query']['offset']);}return _0x55fb1d['getDescriptions'](_0xdd3fd3);}})[_0x6544('0x24')](function(_0x121eee){if(_0x121eee){return _0x121eee?{'count':_0x76f9ca,'rows':_0x121eee}:null;}})['then'](respondWithResult(_0x5dfdce,null))[_0x6544('0x42')](handleError(_0x5dfdce,null));}; \ No newline at end of file +var _0xc432=['destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','SugarcrmConfiguration','includeAll','include','findAll','rows','params','fields','options','find','create','body','update','catch','getFields','findOne','nolimit','getSubjects','getDescriptions','SugarcrmField','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then'];(function(_0x50b847,_0x34e03a){var _0xea0877=function(_0x10b5d0){while(--_0x10b5d0){_0x50b847['push'](_0x50b847['shift']());}};_0xea0877(++_0x34e03a);}(_0xc432,0x1c6));var _0x2c43=function(_0x2f94c5,_0x4714e7){_0x2f94c5=_0x2f94c5-0x0;var _0x492573=_0xc432[_0x2f94c5];return _0x492573;};'use strict';var emlformat=require(_0x2c43('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c43('0x1'));var jsonpatch=require(_0x2c43('0x2'));var rp=require(_0x2c43('0x3'));var moment=require(_0x2c43('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2c43('0x5'));var path=require(_0x2c43('0x6'));var sox=require(_0x2c43('0x7'));var csv=require(_0x2c43('0x8'));var ejs=require(_0x2c43('0x9'));var fs=require('fs');var fs_extra=require(_0x2c43('0xa'));var _=require(_0x2c43('0xb'));var squel=require(_0x2c43('0xc'));var crypto=require(_0x2c43('0xd'));var jsforce=require(_0x2c43('0xe'));var deskjs=require(_0x2c43('0xf'));var toCsv=require(_0x2c43('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2c43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2c43('0x11'));var as=require(_0x2c43('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c43('0x13'))(_0x2c43('0x14'));var utils=require(_0x2c43('0x15'));var config=require(_0x2c43('0x16'));var licenseUtil=require(_0x2c43('0x17'));var db=require(_0x2c43('0x18'))['db'];function respondWithStatusCode(_0xf20cfd,_0x5c6bf7){_0x5c6bf7=_0x5c6bf7||0xcc;return function(_0x1ca299){if(_0x1ca299){return _0xf20cfd[_0x2c43('0x19')](_0x5c6bf7);}return _0xf20cfd[_0x2c43('0x1a')](_0x5c6bf7)[_0x2c43('0x1b')]();};}function respondWithResult(_0x5d8941,_0x267689){_0x267689=_0x267689||0xc8;return function(_0x2dc367){if(_0x2dc367){return _0x5d8941[_0x2c43('0x1a')](_0x267689)[_0x2c43('0x1c')](_0x2dc367);}};}function respondWithFilteredResult(_0x359a71,_0x4e0737){return function(_0x320093){if(_0x320093){var _0x479a41=typeof _0x4e0737[_0x2c43('0x1d')]==='undefined'&&typeof _0x4e0737[_0x2c43('0x1e')]===_0x2c43('0x1f');var _0x83d477=_0x320093['count'];var _0x17f511=_0x479a41?0x0:_0x4e0737[_0x2c43('0x1d')];var _0x3d71f0=_0x479a41?_0x320093[_0x2c43('0x20')]:_0x4e0737[_0x2c43('0x1d')]+_0x4e0737[_0x2c43('0x1e')];var _0x47a5bb;if(_0x3d71f0>=_0x83d477){_0x3d71f0=_0x83d477;_0x47a5bb=0xc8;}else{_0x47a5bb=0xce;}_0x359a71['status'](_0x47a5bb);return _0x359a71[_0x2c43('0x21')](_0x2c43('0x22'),_0x17f511+'-'+_0x3d71f0+'/'+_0x83d477)[_0x2c43('0x1c')](_0x320093);}return null;};}function patchUpdates(_0x336373){return function(_0x4494bf){try{jsonpatch['apply'](_0x4494bf,_0x336373,!![]);}catch(_0x5eb249){return BPromise[_0x2c43('0x23')](_0x5eb249);}return _0x4494bf[_0x2c43('0x24')]();};}function saveUpdates(_0x422286,_0x383abd){return function(_0x57226b){if(_0x57226b){return _0x57226b['update'](_0x422286)[_0x2c43('0x25')](function(_0x1532e8){return _0x1532e8;});}return null;};}function removeEntity(_0x3a2ccf,_0x3c29f2){return function(_0x177da7){if(_0x177da7){return _0x177da7[_0x2c43('0x26')]()[_0x2c43('0x25')](function(){_0x3a2ccf['status'](0xcc)[_0x2c43('0x1b')]();});}};}function handleEntityNotFound(_0x3b5cdc,_0x211cb6){return function(_0x3a0e27){if(!_0x3a0e27){_0x3b5cdc['sendStatus'](0x194);}return _0x3a0e27;};}function handleError(_0x10d0b5,_0x230e33){_0x230e33=_0x230e33||0x1f4;return function(_0x107a0e){logger[_0x2c43('0x27')](_0x107a0e[_0x2c43('0x28')]);if(_0x107a0e[_0x2c43('0x29')]){delete _0x107a0e['name'];}_0x10d0b5[_0x2c43('0x1a')](_0x230e33)[_0x2c43('0x2a')](_0x107a0e);};}exports[_0x2c43('0x2b')]=function(_0x595ff5,_0x296ccf){var _0x583bd0={},_0x26440b={},_0xa92266={'count':0x0,'rows':[]};var _0x50ec24=_[_0x2c43('0x2c')](db['SugarcrmConfiguration'][_0x2c43('0x2d')],function(_0x30baeb){return{'name':_0x30baeb[_0x2c43('0x2e')],'type':_0x30baeb['type'][_0x2c43('0x2f')]};});_0x26440b[_0x2c43('0x30')]=_[_0x2c43('0x2c')](_0x50ec24,_0x2c43('0x29'));_0x26440b[_0x2c43('0x31')]=_[_0x2c43('0x32')](_0x595ff5[_0x2c43('0x31')]);_0x26440b[_0x2c43('0x33')]=_[_0x2c43('0x34')](_0x26440b[_0x2c43('0x30')],_0x26440b[_0x2c43('0x31')]);_0x583bd0[_0x2c43('0x35')]=_[_0x2c43('0x34')](_0x26440b[_0x2c43('0x30')],qs['fields'](_0x595ff5['query']['fields']));_0x583bd0[_0x2c43('0x35')]=_0x583bd0[_0x2c43('0x35')][_0x2c43('0x36')]?_0x583bd0[_0x2c43('0x35')]:_0x26440b['model'];if(!_0x595ff5[_0x2c43('0x31')][_0x2c43('0x37')]('nolimit')){_0x583bd0[_0x2c43('0x1e')]=qs[_0x2c43('0x1e')](_0x595ff5['query'][_0x2c43('0x1e')]);_0x583bd0[_0x2c43('0x1d')]=qs[_0x2c43('0x1d')](_0x595ff5[_0x2c43('0x31')][_0x2c43('0x1d')]);}_0x583bd0[_0x2c43('0x38')]=qs[_0x2c43('0x39')](_0x595ff5[_0x2c43('0x31')]['sort']);_0x583bd0[_0x2c43('0x3a')]=qs[_0x2c43('0x33')](_[_0x2c43('0x3b')](_0x595ff5[_0x2c43('0x31')],_0x26440b[_0x2c43('0x33')]),_0x50ec24);if(_0x595ff5[_0x2c43('0x31')]['filter']){_0x583bd0[_0x2c43('0x3a')]=_[_0x2c43('0x3c')](_0x583bd0[_0x2c43('0x3a')],{'$or':_['map'](_0x50ec24,function(_0x1188ae){if(_0x1188ae['type']!==_0x2c43('0x3d')){var _0x5712c8={};_0x5712c8[_0x1188ae['name']]={'$like':'%'+_0x595ff5[_0x2c43('0x31')][_0x2c43('0x3e')]+'%'};return _0x5712c8;}})});}_0x583bd0=_[_0x2c43('0x3c')]({},_0x583bd0,_0x595ff5['options']);var _0x4c1ae6={'where':_0x583bd0[_0x2c43('0x3a')]};return db[_0x2c43('0x3f')][_0x2c43('0x20')](_0x4c1ae6)[_0x2c43('0x25')](function(_0x5eb212){_0xa92266['count']=_0x5eb212;if(_0x595ff5[_0x2c43('0x31')][_0x2c43('0x40')]){_0x583bd0[_0x2c43('0x41')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x2c43('0x42')](_0x583bd0);})[_0x2c43('0x25')](function(_0x149957){_0xa92266[_0x2c43('0x43')]=_0x149957;return _0xa92266;})[_0x2c43('0x25')](respondWithFilteredResult(_0x296ccf,_0x583bd0))['catch'](handleError(_0x296ccf,null));};exports['show']=function(_0x1ff6aa,_0x244127){var _0x50bb2e={'raw':![],'where':{'id':_0x1ff6aa[_0x2c43('0x44')]['id']}},_0x3734b7={};_0x3734b7[_0x2c43('0x30')]=_['keys'](db[_0x2c43('0x3f')]['rawAttributes']);_0x3734b7['query']=_[_0x2c43('0x32')](_0x1ff6aa['query']);_0x3734b7[_0x2c43('0x33')]=_[_0x2c43('0x34')](_0x3734b7[_0x2c43('0x30')],_0x3734b7['query']);_0x50bb2e[_0x2c43('0x35')]=_[_0x2c43('0x34')](_0x3734b7['model'],qs[_0x2c43('0x45')](_0x1ff6aa[_0x2c43('0x31')][_0x2c43('0x45')]));_0x50bb2e[_0x2c43('0x35')]=_0x50bb2e[_0x2c43('0x35')][_0x2c43('0x36')]?_0x50bb2e[_0x2c43('0x35')]:_0x3734b7['model'];if(_0x1ff6aa['query']['includeAll']){_0x50bb2e[_0x2c43('0x41')]=[{'all':!![]}];}_0x50bb2e=_[_0x2c43('0x3c')]({},_0x50bb2e,_0x1ff6aa[_0x2c43('0x46')]);return db[_0x2c43('0x3f')][_0x2c43('0x47')](_0x50bb2e)[_0x2c43('0x25')](handleEntityNotFound(_0x244127,null))[_0x2c43('0x25')](respondWithResult(_0x244127,null))['catch'](handleError(_0x244127,null));};exports[_0x2c43('0x48')]=function(_0x41fef0,_0x46d4ca){return db[_0x2c43('0x3f')][_0x2c43('0x48')](_0x41fef0[_0x2c43('0x49')],{})[_0x2c43('0x25')](respondWithResult(_0x46d4ca,0xc9))['catch'](handleError(_0x46d4ca,null));};exports[_0x2c43('0x4a')]=function(_0x1dd56f,_0x2c7635){if(_0x1dd56f[_0x2c43('0x49')]['id']){delete _0x1dd56f['body']['id'];}return db['SugarcrmConfiguration'][_0x2c43('0x47')]({'where':{'id':_0x1dd56f['params']['id']}})[_0x2c43('0x25')](handleEntityNotFound(_0x2c7635,null))['then'](saveUpdates(_0x1dd56f[_0x2c43('0x49')],null))[_0x2c43('0x25')](respondWithResult(_0x2c7635,null))['catch'](handleError(_0x2c7635,null));};exports[_0x2c43('0x26')]=function(_0x2d35d5,_0x237781){return db[_0x2c43('0x3f')][_0x2c43('0x47')]({'where':{'id':_0x2d35d5[_0x2c43('0x44')]['id']}})['then'](handleEntityNotFound(_0x237781,null))[_0x2c43('0x25')](removeEntity(_0x237781,null))[_0x2c43('0x4b')](handleError(_0x237781,null));};exports[_0x2c43('0x4c')]=function(_0x5b5a80,_0x3a1c9e,_0x3cc961){var _0x1aad15={};var _0x5a4f6a={};var _0x56c9e1;var _0x4f93f6;return db['SugarcrmConfiguration'][_0x2c43('0x4d')]({'where':{'id':_0x5b5a80['params']['id']}})['then'](handleEntityNotFound(_0x3a1c9e,null))[_0x2c43('0x25')](function(_0x497441){if(_0x497441){_0x56c9e1=_0x497441;_0x5a4f6a[_0x2c43('0x30')]=_[_0x2c43('0x32')](db['SugarcrmField'][_0x2c43('0x2d')]);_0x5a4f6a[_0x2c43('0x31')]=_[_0x2c43('0x32')](_0x5b5a80[_0x2c43('0x31')]);_0x5a4f6a[_0x2c43('0x33')]=_[_0x2c43('0x34')](_0x5a4f6a['model'],_0x5a4f6a['query']);_0x1aad15[_0x2c43('0x35')]=_[_0x2c43('0x34')](_0x5a4f6a['model'],qs[_0x2c43('0x45')](_0x5b5a80['query']['fields']));_0x1aad15['attributes']=_0x1aad15[_0x2c43('0x35')]['length']?_0x1aad15[_0x2c43('0x35')]:_0x5a4f6a[_0x2c43('0x30')];_0x1aad15[_0x2c43('0x38')]=qs['sort'](_0x5b5a80[_0x2c43('0x31')][_0x2c43('0x39')]);_0x1aad15[_0x2c43('0x3a')]=qs[_0x2c43('0x33')](_[_0x2c43('0x3b')](_0x5b5a80[_0x2c43('0x31')],_0x5a4f6a[_0x2c43('0x33')]));if(_0x5b5a80['query'][_0x2c43('0x3e')]){_0x1aad15[_0x2c43('0x3a')]=_['merge'](_0x1aad15[_0x2c43('0x3a')],{'$or':_[_0x2c43('0x2c')](_0x1aad15['attributes'],function(_0x278b97){var _0x1a5781={};_0x1a5781[_0x278b97]={'$like':'%'+_0x5b5a80[_0x2c43('0x31')][_0x2c43('0x3e')]+'%'};return _0x1a5781;})});}_0x1aad15=_[_0x2c43('0x3c')]({},_0x1aad15,_0x5b5a80['options']);return _0x56c9e1[_0x2c43('0x4c')](_0x1aad15);}})[_0x2c43('0x25')](function(_0x500de7){if(_0x500de7){_0x4f93f6=_0x500de7['length'];if(!_0x5b5a80[_0x2c43('0x31')][_0x2c43('0x37')](_0x2c43('0x4e'))){_0x1aad15['limit']=qs[_0x2c43('0x1e')](_0x5b5a80[_0x2c43('0x31')][_0x2c43('0x1e')]);_0x1aad15[_0x2c43('0x1d')]=qs[_0x2c43('0x1d')](_0x5b5a80[_0x2c43('0x31')][_0x2c43('0x1d')]);}return _0x56c9e1[_0x2c43('0x4c')](_0x1aad15);}})['then'](function(_0x34ade1){if(_0x34ade1){return _0x34ade1?{'count':_0x4f93f6,'rows':_0x34ade1}:null;}})[_0x2c43('0x25')](respondWithResult(_0x3a1c9e,null))[_0x2c43('0x4b')](handleError(_0x3a1c9e,null));};exports[_0x2c43('0x4f')]=function(_0x13084f,_0x2fe91f,_0x454223){var _0x313c1c={};var _0x149f34={};var _0x42a88e;var _0x32c87f;return db[_0x2c43('0x3f')][_0x2c43('0x4d')]({'where':{'id':_0x13084f['params']['id']}})[_0x2c43('0x25')](handleEntityNotFound(_0x2fe91f,null))[_0x2c43('0x25')](function(_0x29740a){if(_0x29740a){_0x42a88e=_0x29740a;_0x149f34['model']=_['keys'](db['SugarcrmField'][_0x2c43('0x2d')]);_0x149f34['query']=_[_0x2c43('0x32')](_0x13084f[_0x2c43('0x31')]);_0x149f34[_0x2c43('0x33')]=_[_0x2c43('0x34')](_0x149f34['model'],_0x149f34[_0x2c43('0x31')]);_0x313c1c[_0x2c43('0x35')]=_['intersection'](_0x149f34['model'],qs[_0x2c43('0x45')](_0x13084f[_0x2c43('0x31')][_0x2c43('0x45')]));_0x313c1c[_0x2c43('0x35')]=_0x313c1c['attributes'][_0x2c43('0x36')]?_0x313c1c[_0x2c43('0x35')]:_0x149f34[_0x2c43('0x30')];_0x313c1c['order']=qs['sort'](_0x13084f[_0x2c43('0x31')]['sort']);_0x313c1c[_0x2c43('0x3a')]=qs[_0x2c43('0x33')](_[_0x2c43('0x3b')](_0x13084f['query'],_0x149f34[_0x2c43('0x33')]));if(_0x13084f[_0x2c43('0x31')][_0x2c43('0x3e')]){_0x313c1c[_0x2c43('0x3a')]=_[_0x2c43('0x3c')](_0x313c1c[_0x2c43('0x3a')],{'$or':_[_0x2c43('0x2c')](_0x313c1c['attributes'],function(_0x5cf5a0){var _0x15bedd={};_0x15bedd[_0x5cf5a0]={'$like':'%'+_0x13084f[_0x2c43('0x31')][_0x2c43('0x3e')]+'%'};return _0x15bedd;})});}_0x313c1c=_[_0x2c43('0x3c')]({},_0x313c1c,_0x13084f[_0x2c43('0x46')]);return _0x42a88e[_0x2c43('0x4f')](_0x313c1c);}})[_0x2c43('0x25')](function(_0x1527b0){if(_0x1527b0){_0x32c87f=_0x1527b0[_0x2c43('0x36')];if(!_0x13084f[_0x2c43('0x31')][_0x2c43('0x37')](_0x2c43('0x4e'))){_0x313c1c[_0x2c43('0x1e')]=qs[_0x2c43('0x1e')](_0x13084f['query'][_0x2c43('0x1e')]);_0x313c1c['offset']=qs[_0x2c43('0x1d')](_0x13084f[_0x2c43('0x31')][_0x2c43('0x1d')]);}return _0x42a88e['getSubjects'](_0x313c1c);}})[_0x2c43('0x25')](function(_0x57109e){if(_0x57109e){return _0x57109e?{'count':_0x32c87f,'rows':_0x57109e}:null;}})[_0x2c43('0x25')](respondWithResult(_0x2fe91f,null))[_0x2c43('0x4b')](handleError(_0x2fe91f,null));};exports[_0x2c43('0x50')]=function(_0x1e7e64,_0x38c24d,_0x5530fc){var _0x57d09c={};var _0x3a65d7={};var _0x1f052c;var _0x55e126;return db[_0x2c43('0x3f')][_0x2c43('0x4d')]({'where':{'id':_0x1e7e64[_0x2c43('0x44')]['id']}})['then'](handleEntityNotFound(_0x38c24d,null))[_0x2c43('0x25')](function(_0x29ea06){if(_0x29ea06){_0x1f052c=_0x29ea06;_0x3a65d7['model']=_[_0x2c43('0x32')](db[_0x2c43('0x51')][_0x2c43('0x2d')]);_0x3a65d7[_0x2c43('0x31')]=_[_0x2c43('0x32')](_0x1e7e64[_0x2c43('0x31')]);_0x3a65d7[_0x2c43('0x33')]=_[_0x2c43('0x34')](_0x3a65d7['model'],_0x3a65d7['query']);_0x57d09c['attributes']=_[_0x2c43('0x34')](_0x3a65d7['model'],qs[_0x2c43('0x45')](_0x1e7e64[_0x2c43('0x31')][_0x2c43('0x45')]));_0x57d09c[_0x2c43('0x35')]=_0x57d09c['attributes']['length']?_0x57d09c[_0x2c43('0x35')]:_0x3a65d7[_0x2c43('0x30')];_0x57d09c['order']=qs[_0x2c43('0x39')](_0x1e7e64[_0x2c43('0x31')]['sort']);_0x57d09c[_0x2c43('0x3a')]=qs[_0x2c43('0x33')](_[_0x2c43('0x3b')](_0x1e7e64[_0x2c43('0x31')],_0x3a65d7[_0x2c43('0x33')]));if(_0x1e7e64[_0x2c43('0x31')][_0x2c43('0x3e')]){_0x57d09c[_0x2c43('0x3a')]=_[_0x2c43('0x3c')](_0x57d09c[_0x2c43('0x3a')],{'$or':_[_0x2c43('0x2c')](_0x57d09c['attributes'],function(_0x4cb63c){var _0x33da25={};_0x33da25[_0x4cb63c]={'$like':'%'+_0x1e7e64['query'][_0x2c43('0x3e')]+'%'};return _0x33da25;})});}_0x57d09c=_['merge']({},_0x57d09c,_0x1e7e64[_0x2c43('0x46')]);return _0x1f052c[_0x2c43('0x50')](_0x57d09c);}})[_0x2c43('0x25')](function(_0xd35b6c){if(_0xd35b6c){_0x55e126=_0xd35b6c[_0x2c43('0x36')];if(!_0x1e7e64[_0x2c43('0x31')]['hasOwnProperty']('nolimit')){_0x57d09c[_0x2c43('0x1e')]=qs[_0x2c43('0x1e')](_0x1e7e64[_0x2c43('0x31')][_0x2c43('0x1e')]);_0x57d09c[_0x2c43('0x1d')]=qs[_0x2c43('0x1d')](_0x1e7e64[_0x2c43('0x31')][_0x2c43('0x1d')]);}return _0x1f052c[_0x2c43('0x50')](_0x57d09c);}})[_0x2c43('0x25')](function(_0x598dbf){if(_0x598dbf){return _0x598dbf?{'count':_0x55e126,'rows':_0x598dbf}:null;}})[_0x2c43('0x25')](respondWithResult(_0x38c24d,null))[_0x2c43('0x4b')](handleError(_0x38c24d,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 48c7aa7..1ac8b72 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 _0x8da5=['SugarcrmConfiguration','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define'];(function(_0x5a7433,_0xfff736){var _0x3b0ba2=function(_0xfa7c81){while(--_0xfa7c81){_0x5a7433['push'](_0x5a7433['shift']());}};_0x3b0ba2(++_0xfff736);}(_0x8da5,0xb5));var _0x58da=function(_0x3f25fa,_0x327afb){_0x3f25fa=_0x3f25fa-0x0;var _0x3ab1a7=_0x8da5[_0x3f25fa];return _0x3ab1a7;};'use strict';var _=require(_0x58da('0x0'));var util=require(_0x58da('0x1'));var logger=require(_0x58da('0x2'))('api');var moment=require(_0x58da('0x3'));var BPromise=require(_0x58da('0x4'));var rp=require(_0x58da('0x5'));var fs=require('fs');var path=require(_0x58da('0x6'));var rimraf=require(_0x58da('0x7'));var config=require(_0x58da('0x8'));var attributes=require(_0x58da('0x9'));module['exports']=function(_0x25f4ad,_0x553c61){return _0x25f4ad[_0x58da('0xa')](_0x58da('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d8b=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x2b669c,_0x20cd62){var _0x4947b6=function(_0x1ede3f){while(--_0x1ede3f){_0x2b669c['push'](_0x2b669c['shift']());}};_0x4947b6(++_0x20cd62);}(_0x8d8b,0x75));var _0xb8d8=function(_0x115822,_0x4f4332){_0x115822=_0x115822-0x0;var _0x25e66e=_0x8d8b[_0x115822];return _0x25e66e;};'use strict';var _=require(_0xb8d8('0x0'));var util=require(_0xb8d8('0x1'));var logger=require(_0xb8d8('0x2'))(_0xb8d8('0x3'));var moment=require(_0xb8d8('0x4'));var BPromise=require(_0xb8d8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8d8('0x6'));var rimraf=require(_0xb8d8('0x7'));var config=require(_0xb8d8('0x8'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xb8d8('0x9')]=function(_0x4524d8,_0xd89cd){return _0x4524d8[_0xb8d8('0xa')](_0xb8d8('0xb'),attributes,{'tableName':_0xb8d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 3578b93..154d97d 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 _0xfba1=['info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request'];(function(_0x2acccc,_0x7aefb){var _0x24ccb4=function(_0x1f08b8){while(--_0x1f08b8){_0x2acccc['push'](_0x2acccc['shift']());}};_0x24ccb4(++_0x7aefb);}(_0xfba1,0x1c2));var _0x1fba=function(_0x2916f0,_0x599d19){_0x2916f0=_0x2916f0-0x0;var _0x124562=_0xfba1[_0x2916f0];return _0x124562;};'use strict';var _=require(_0x1fba('0x0'));var util=require(_0x1fba('0x1'));var moment=require(_0x1fba('0x2'));var BPromise=require(_0x1fba('0x3'));var rs=require(_0x1fba('0x4'));var fs=require('fs');var Redis=require(_0x1fba('0x5'));var db=require(_0x1fba('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1fba('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1fba('0x8'));var client=jayson[_0x1fba('0x9')][_0x1fba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d316b,_0x1cb02b,_0x5703f2){return new BPromise(function(_0x469375,_0x263e65){return client[_0x1fba('0xb')](_0x5d316b,_0x5703f2)['then'](function(_0x45af57){logger[_0x1fba('0xc')](_0x1fba('0xd'),_0x1cb02b,'request\x20sent');logger[_0x1fba('0xe')](_0x1fba('0xf'),_0x1cb02b,_0x1fba('0x10'),JSON[_0x1fba('0x11')](_0x45af57));if(_0x45af57[_0x1fba('0x12')]){if(_0x45af57[_0x1fba('0x12')]['code']===0x1f4){logger[_0x1fba('0x12')](_0x1fba('0xd'),_0x1cb02b,_0x45af57[_0x1fba('0x12')]['message']);return _0x263e65(_0x45af57[_0x1fba('0x12')][_0x1fba('0x13')]);}logger[_0x1fba('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1cb02b,_0x45af57[_0x1fba('0x12')][_0x1fba('0x13')]);return _0x469375(_0x45af57[_0x1fba('0x12')][_0x1fba('0x13')]);}else{logger[_0x1fba('0xc')](_0x1fba('0xd'),_0x1cb02b,_0x1fba('0x10'));_0x469375(_0x45af57['result'][_0x1fba('0x13')]);}})[_0x1fba('0x14')](function(_0x597b94){logger[_0x1fba('0x12')](_0x1fba('0xd'),_0x1cb02b,_0x597b94);_0x263e65(_0x597b94);});});} \ No newline at end of file +var _0xa711=['stringify','error','code','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0xa711,0xb9));var _0x1a71=function(_0x204af1,_0x57f5a0){_0x204af1=_0x204af1-0x0;var _0x314f4e=_0xa711[_0x204af1];return _0x314f4e;};'use strict';var _=require(_0x1a71('0x0'));var util=require('util');var moment=require(_0x1a71('0x1'));var BPromise=require(_0x1a71('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a71('0x3'))['db'];var utils=require(_0x1a71('0x4'));var logger=require('../../config/logger')(_0x1a71('0x5'));var config=require(_0x1a71('0x6'));var jayson=require(_0x1a71('0x7'));var client=jayson[_0x1a71('0x8')][_0x1a71('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f0a40,_0x1000f5,_0x331081){return new BPromise(function(_0x307bd3,_0x2e5a2f){return client['request'](_0x2f0a40,_0x331081)[_0x1a71('0xa')](function(_0x5a7b5e){logger['info'](_0x1a71('0xb'),_0x1000f5,'request\x20sent');logger[_0x1a71('0xc')](_0x1a71('0xd'),_0x1000f5,_0x1a71('0xe'),JSON[_0x1a71('0xf')](_0x5a7b5e));if(_0x5a7b5e['error']){if(_0x5a7b5e[_0x1a71('0x10')][_0x1a71('0x11')]===0x1f4){logger[_0x1a71('0x10')](_0x1a71('0xb'),_0x1000f5,_0x5a7b5e[_0x1a71('0x10')]['message']);return _0x2e5a2f(_0x5a7b5e['error'][_0x1a71('0x12')]);}logger['error'](_0x1a71('0xb'),_0x1000f5,_0x5a7b5e[_0x1a71('0x10')]['message']);return _0x307bd3(_0x5a7b5e[_0x1a71('0x10')][_0x1a71('0x12')]);}else{logger['info'](_0x1a71('0xb'),_0x1000f5,_0x1a71('0xe'));_0x307bd3(_0x5a7b5e[_0x1a71('0x13')]['message']);}})['catch'](function(_0x37287d){logger[_0x1a71('0x10')](_0x1a71('0xb'),_0x1000f5,_0x37287d);_0x2e5a2f(_0x37287d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index cc973b6..1284a27 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 _0x8c70=['put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','post','create'];(function(_0x49a7bf,_0x11240a){var _0x1e85d7=function(_0x515f10){while(--_0x515f10){_0x49a7bf['push'](_0x49a7bf['shift']());}};_0x1e85d7(++_0x11240a);}(_0x8c70,0xcb));var _0x08c7=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x8c70[_0xea8947];return _0x2455e9;};'use strict';var multer=require('multer');var util=require(_0x08c7('0x0'));var path=require('path');var timeout=require(_0x08c7('0x1'));var express=require(_0x08c7('0x2'));var router=express[_0x08c7('0x3')]();var fs_extra=require(_0x08c7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x08c7('0x5'));var config=require(_0x08c7('0x6'));var controller=require(_0x08c7('0x7'));router[_0x08c7('0x8')]('/',auth[_0x08c7('0x9')](),controller['index']);router['get'](_0x08c7('0xa'),auth[_0x08c7('0x9')](),controller['show']);router[_0x08c7('0xb')]('/',auth[_0x08c7('0x9')](),controller[_0x08c7('0xc')]);router[_0x08c7('0xd')](_0x08c7('0xa'),auth[_0x08c7('0x9')](),controller[_0x08c7('0xe')]);router[_0x08c7('0xf')](_0x08c7('0xa'),auth[_0x08c7('0x9')](),controller[_0x08c7('0x10')]);module[_0x08c7('0x11')]=router; \ No newline at end of file +var _0xcb9a=['delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','show','put','update'];(function(_0x38a995,_0x129e64){var _0x3e402b=function(_0x36514a){while(--_0x36514a){_0x38a995['push'](_0x38a995['shift']());}};_0x3e402b(++_0x129e64);}(_0xcb9a,0xac));var _0xacb9=function(_0x2c4e32,_0x3a5590){_0x2c4e32=_0x2c4e32-0x0;var _0x1eac30=_0xcb9a[_0x2c4e32];return _0x1eac30;};'use strict';var multer=require(_0xacb9('0x0'));var util=require(_0xacb9('0x1'));var path=require(_0xacb9('0x2'));var timeout=require('connect-timeout');var express=require(_0xacb9('0x3'));var router=express[_0xacb9('0x4')]();var fs_extra=require(_0xacb9('0x5'));var auth=require(_0xacb9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xacb9('0x7'));router['get']('/',auth[_0xacb9('0x8')](),controller[_0xacb9('0x9')]);router[_0xacb9('0xa')](_0xacb9('0xb'),auth['isAuthenticated'](),controller[_0xacb9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xacb9('0xd')]('/:id',auth[_0xacb9('0x8')](),controller[_0xacb9('0xe')]);router[_0xacb9('0xf')](_0xacb9('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xacb9('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 6981f01..deb2bdc 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 _0x5489=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5489,0x1cc));var _0x9548=function(_0x1c8242,_0x4ec600){_0x1c8242=_0x1c8242-0x0;var _0x3d4e94=_0x5489[_0x1c8242];return _0x3d4e94;};'use strict';var Sequelize=require(_0x9548('0x0'));module[_0x9548('0x1')]={'type':{'type':Sequelize[_0x9548('0x2')](_0x9548('0x3'),_0x9548('0x4'),_0x9548('0x5'),_0x9548('0x6'),_0x9548('0x7')),'defaultValue':_0x9548('0x3')},'content':{'type':Sequelize[_0x9548('0x8')]},'key':{'type':Sequelize[_0x9548('0x8')]},'keyType':{'type':Sequelize[_0x9548('0x2')](_0x9548('0x3'),_0x9548('0x4'),_0x9548('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9548('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9548('0x8')]}}; \ No newline at end of file +var _0xf586=['STRING','ENUM','customVariable','exports','string','variable','keyValue','picklist'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xf586,0x183));var _0x6f58=function(_0x155af3,_0x4b7f9a){_0x155af3=_0x155af3-0x0;var _0x15a675=_0xf586[_0x155af3];return _0x15a675;};'use strict';var Sequelize=require('sequelize');module[_0x6f58('0x0')]={'type':{'type':Sequelize['ENUM'](_0x6f58('0x1'),_0x6f58('0x2'),'customVariable',_0x6f58('0x3'),_0x6f58('0x4')),'defaultValue':_0x6f58('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6f58('0x5')]},'keyType':{'type':Sequelize[_0x6f58('0x6')]('string','variable',_0x6f58('0x7'))},'keyContent':{'type':Sequelize[_0x6f58('0x5')]},'idField':{'type':Sequelize[_0x6f58('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6f58('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index e7afe0e..c43c25d 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 _0x2be1=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','SugarcrmField','includeAll','findAll','catch','show','params','include','find','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','fieldName','key','query','keys','filters','intersection'];(function(_0x2507ad,_0x2e0da7){var _0x13369c=function(_0x5f36a2){while(--_0x5f36a2){_0x2507ad['push'](_0x2507ad['shift']());}};_0x13369c(++_0x2e0da7);}(_0x2be1,0x144));var _0x12be=function(_0x44a0e9,_0x959f63){_0x44a0e9=_0x44a0e9-0x0;var _0x3b8e8c=_0x2be1[_0x44a0e9];return _0x3b8e8c;};'use strict';var emlformat=require(_0x12be('0x0'));var rimraf=require(_0x12be('0x1'));var zipdir=require(_0x12be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x12be('0x3'));var BPromise=require(_0x12be('0x4'));var Mustache=require(_0x12be('0x5'));var util=require('util');var path=require(_0x12be('0x6'));var sox=require(_0x12be('0x7'));var csv=require('to-csv');var ejs=require(_0x12be('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12be('0x9'));var squel=require(_0x12be('0xa'));var crypto=require(_0x12be('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x12be('0xc'));var toCsv=require('to-csv');var querystring=require(_0x12be('0xd'));var Papa=require(_0x12be('0xe'));var Redis=require(_0x12be('0xf'));var authService=require(_0x12be('0x10'));var qs=require(_0x12be('0x11'));var as=require(_0x12be('0x12'));var hardwareService=require(_0x12be('0x13'));var logger=require(_0x12be('0x14'))(_0x12be('0x15'));var utils=require(_0x12be('0x16'));var config=require(_0x12be('0x17'));var licenseUtil=require(_0x12be('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d7be4,_0x1608d2){_0x1608d2=_0x1608d2||0xcc;return function(_0x423010){if(_0x423010){return _0x3d7be4['sendStatus'](_0x1608d2);}return _0x3d7be4[_0x12be('0x19')](_0x1608d2)['end']();};}function respondWithResult(_0x3784f1,_0x1d9920){_0x1d9920=_0x1d9920||0xc8;return function(_0x3e01b3){if(_0x3e01b3){return _0x3784f1['status'](_0x1d9920)[_0x12be('0x1a')](_0x3e01b3);}};}function respondWithFilteredResult(_0x128845,_0x4c5df7){return function(_0x8fc2b3){if(_0x8fc2b3){var _0x57495d=typeof _0x4c5df7[_0x12be('0x1b')]==='undefined'&&typeof _0x4c5df7['limit']==='undefined';var _0x536d0f=_0x8fc2b3[_0x12be('0x1c')];var _0x1b56b8=_0x57495d?0x0:_0x4c5df7[_0x12be('0x1b')];var _0x7bd56a=_0x57495d?_0x8fc2b3[_0x12be('0x1c')]:_0x4c5df7[_0x12be('0x1b')]+_0x4c5df7[_0x12be('0x1d')];var _0xe00682;if(_0x7bd56a>=_0x536d0f){_0x7bd56a=_0x536d0f;_0xe00682=0xc8;}else{_0xe00682=0xce;}_0x128845[_0x12be('0x19')](_0xe00682);return _0x128845[_0x12be('0x1e')](_0x12be('0x1f'),_0x1b56b8+'-'+_0x7bd56a+'/'+_0x536d0f)['json'](_0x8fc2b3);}return null;};}function patchUpdates(_0x4daabe){return function(_0x4e3ab6){try{jsonpatch[_0x12be('0x20')](_0x4e3ab6,_0x4daabe,!![]);}catch(_0x4b34ee){return BPromise[_0x12be('0x21')](_0x4b34ee);}return _0x4e3ab6[_0x12be('0x22')]();};}function saveUpdates(_0x1b63ff,_0x5b2b97){return function(_0x370a3a){if(_0x370a3a){return _0x370a3a[_0x12be('0x23')](_0x1b63ff)[_0x12be('0x24')](function(_0x412707){return _0x412707;});}return null;};}function removeEntity(_0x4dab21,_0x404c5c){return function(_0x50dff8){if(_0x50dff8){return _0x50dff8[_0x12be('0x25')]()[_0x12be('0x24')](function(){_0x4dab21[_0x12be('0x19')](0xcc)[_0x12be('0x26')]();});}};}function handleEntityNotFound(_0x111ade,_0x2c43be){return function(_0x349dd4){if(!_0x349dd4){_0x111ade[_0x12be('0x27')](0x194);}return _0x349dd4;};}function handleError(_0x430856,_0x4c1b0c){_0x4c1b0c=_0x4c1b0c||0x1f4;return function(_0x160925){logger[_0x12be('0x28')](_0x160925[_0x12be('0x29')]);if(_0x160925[_0x12be('0x2a')]){delete _0x160925[_0x12be('0x2a')];}_0x430856['status'](_0x4c1b0c)[_0x12be('0x2b')](_0x160925);};}exports['index']=function(_0x16496a,_0x56e98f){var _0x1bc287={},_0x58c650={},_0x51e353={'count':0x0,'rows':[]};var _0x1ba26f=_[_0x12be('0x2c')](db['SugarcrmField']['rawAttributes'],function(_0x547e25){return{'name':_0x547e25[_0x12be('0x2d')],'type':_0x547e25['type'][_0x12be('0x2e')]};});_0x58c650['model']=_[_0x12be('0x2c')](_0x1ba26f,_0x12be('0x2a'));_0x58c650[_0x12be('0x2f')]=_[_0x12be('0x30')](_0x16496a[_0x12be('0x2f')]);_0x58c650[_0x12be('0x31')]=_[_0x12be('0x32')](_0x58c650[_0x12be('0x33')],_0x58c650['query']);_0x1bc287[_0x12be('0x34')]=_[_0x12be('0x32')](_0x58c650['model'],qs[_0x12be('0x35')](_0x16496a['query'][_0x12be('0x35')]));_0x1bc287[_0x12be('0x34')]=_0x1bc287[_0x12be('0x34')][_0x12be('0x36')]?_0x1bc287[_0x12be('0x34')]:_0x58c650[_0x12be('0x33')];if(!_0x16496a[_0x12be('0x2f')][_0x12be('0x37')](_0x12be('0x38'))){_0x1bc287[_0x12be('0x1d')]=qs[_0x12be('0x1d')](_0x16496a['query'][_0x12be('0x1d')]);_0x1bc287[_0x12be('0x1b')]=qs[_0x12be('0x1b')](_0x16496a[_0x12be('0x2f')][_0x12be('0x1b')]);}_0x1bc287[_0x12be('0x39')]=qs[_0x12be('0x3a')](_0x16496a[_0x12be('0x2f')]['sort']);_0x1bc287['where']=qs[_0x12be('0x31')](_['pick'](_0x16496a[_0x12be('0x2f')],_0x58c650[_0x12be('0x31')]),_0x1ba26f);if(_0x16496a[_0x12be('0x2f')][_0x12be('0x3b')]){_0x1bc287[_0x12be('0x3c')]=_[_0x12be('0x3d')](_0x1bc287[_0x12be('0x3c')],{'$or':_['map'](_0x1ba26f,function(_0x3dd021){if(_0x3dd021[_0x12be('0x3e')]!==_0x12be('0x3f')){var _0x2bd9bc={};_0x2bd9bc[_0x3dd021[_0x12be('0x2a')]]={'$like':'%'+_0x16496a[_0x12be('0x2f')][_0x12be('0x3b')]+'%'};return _0x2bd9bc;}})});}_0x1bc287=_['merge']({},_0x1bc287,_0x16496a[_0x12be('0x40')]);var _0x581428={'where':_0x1bc287['where']};return db[_0x12be('0x41')][_0x12be('0x1c')](_0x581428)['then'](function(_0x5209ef){_0x51e353[_0x12be('0x1c')]=_0x5209ef;if(_0x16496a['query'][_0x12be('0x42')]){_0x1bc287['include']=[{'all':!![]}];}return db[_0x12be('0x41')][_0x12be('0x43')](_0x1bc287);})[_0x12be('0x24')](function(_0x194c9b){_0x51e353['rows']=_0x194c9b;return _0x51e353;})[_0x12be('0x24')](respondWithFilteredResult(_0x56e98f,_0x1bc287))[_0x12be('0x44')](handleError(_0x56e98f,null));};exports[_0x12be('0x45')]=function(_0x4f0e88,_0x5ba0b1){var _0xb13e3c={'raw':!![],'where':{'id':_0x4f0e88[_0x12be('0x46')]['id']}},_0xbacf0={};_0xbacf0[_0x12be('0x33')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0xbacf0[_0x12be('0x2f')]=_['keys'](_0x4f0e88['query']);_0xbacf0['filters']=_['intersection'](_0xbacf0['model'],_0xbacf0[_0x12be('0x2f')]);_0xb13e3c[_0x12be('0x34')]=_[_0x12be('0x32')](_0xbacf0[_0x12be('0x33')],qs['fields'](_0x4f0e88[_0x12be('0x2f')][_0x12be('0x35')]));_0xb13e3c['attributes']=_0xb13e3c[_0x12be('0x34')][_0x12be('0x36')]?_0xb13e3c[_0x12be('0x34')]:_0xbacf0[_0x12be('0x33')];if(_0x4f0e88[_0x12be('0x2f')]['includeAll']){_0xb13e3c[_0x12be('0x47')]=[{'all':!![]}];}_0xb13e3c=_[_0x12be('0x3d')]({},_0xb13e3c,_0x4f0e88[_0x12be('0x40')]);return db['SugarcrmField'][_0x12be('0x48')](_0xb13e3c)[_0x12be('0x24')](handleEntityNotFound(_0x5ba0b1,null))[_0x12be('0x24')](respondWithResult(_0x5ba0b1,null))[_0x12be('0x44')](handleError(_0x5ba0b1,null));};exports[_0x12be('0x49')]=function(_0x2cde92,_0x347a90){return db[_0x12be('0x41')][_0x12be('0x49')](_0x2cde92[_0x12be('0x4a')],{})[_0x12be('0x24')](respondWithResult(_0x347a90,0xc9))['catch'](handleError(_0x347a90,null));};exports['update']=function(_0x30ef48,_0x581f7b){if(_0x30ef48[_0x12be('0x4a')]['id']){delete _0x30ef48['body']['id'];}return db[_0x12be('0x41')]['find']({'where':{'id':_0x30ef48[_0x12be('0x46')]['id']}})[_0x12be('0x24')](handleEntityNotFound(_0x581f7b,null))[_0x12be('0x24')](saveUpdates(_0x30ef48['body'],null))['then'](respondWithResult(_0x581f7b,null))[_0x12be('0x44')](handleError(_0x581f7b,null));};exports['destroy']=function(_0x2e7ad2,_0x292e1f){return db[_0x12be('0x41')][_0x12be('0x48')]({'where':{'id':_0x2e7ad2[_0x12be('0x46')]['id']}})[_0x12be('0x24')](handleEntityNotFound(_0x292e1f,null))[_0x12be('0x24')](removeEntity(_0x292e1f,null))[_0x12be('0x44')](handleError(_0x292e1f,null));}; \ No newline at end of file +var _0xd4ce=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','SugarcrmField','includeAll','include','catch','params','fields','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xd4ce,0xc3));var _0xed4c=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xd4ce[_0x4bfac3];return _0x15f0f2;};'use strict';var emlformat=require(_0xed4c('0x0'));var rimraf=require(_0xed4c('0x1'));var zipdir=require(_0xed4c('0x2'));var jsonpatch=require(_0xed4c('0x3'));var rp=require(_0xed4c('0x4'));var moment=require(_0xed4c('0x5'));var BPromise=require(_0xed4c('0x6'));var Mustache=require(_0xed4c('0x7'));var util=require(_0xed4c('0x8'));var path=require(_0xed4c('0x9'));var sox=require(_0xed4c('0xa'));var csv=require(_0xed4c('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed4c('0xc'));var _=require('lodash');var squel=require(_0xed4c('0xd'));var crypto=require('crypto');var jsforce=require(_0xed4c('0xe'));var deskjs=require(_0xed4c('0xf'));var toCsv=require(_0xed4c('0xb'));var querystring=require(_0xed4c('0x10'));var Papa=require(_0xed4c('0x11'));var Redis=require('ioredis');var authService=require(_0xed4c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xed4c('0x13'));var hardwareService=require(_0xed4c('0x14'));var logger=require(_0xed4c('0x15'))('api');var utils=require(_0xed4c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xed4c('0x17'));var db=require(_0xed4c('0x18'))['db'];function respondWithStatusCode(_0x1e50b0,_0x59cec5){_0x59cec5=_0x59cec5||0xcc;return function(_0x332142){if(_0x332142){return _0x1e50b0[_0xed4c('0x19')](_0x59cec5);}return _0x1e50b0['status'](_0x59cec5)[_0xed4c('0x1a')]();};}function respondWithResult(_0x2ab6a5,_0x142502){_0x142502=_0x142502||0xc8;return function(_0x1e3d6c){if(_0x1e3d6c){return _0x2ab6a5[_0xed4c('0x1b')](_0x142502)[_0xed4c('0x1c')](_0x1e3d6c);}};}function respondWithFilteredResult(_0x5c067c,_0x4ac496){return function(_0x25f35d){if(_0x25f35d){var _0x534d76=typeof _0x4ac496[_0xed4c('0x1d')]===_0xed4c('0x1e')&&typeof _0x4ac496['limit']===_0xed4c('0x1e');var _0x168e33=_0x25f35d[_0xed4c('0x1f')];var _0x48d9f4=_0x534d76?0x0:_0x4ac496[_0xed4c('0x1d')];var _0x2e7d2a=_0x534d76?_0x25f35d[_0xed4c('0x1f')]:_0x4ac496[_0xed4c('0x1d')]+_0x4ac496[_0xed4c('0x20')];var _0x3bd2fe;if(_0x2e7d2a>=_0x168e33){_0x2e7d2a=_0x168e33;_0x3bd2fe=0xc8;}else{_0x3bd2fe=0xce;}_0x5c067c[_0xed4c('0x1b')](_0x3bd2fe);return _0x5c067c[_0xed4c('0x21')](_0xed4c('0x22'),_0x48d9f4+'-'+_0x2e7d2a+'/'+_0x168e33)[_0xed4c('0x1c')](_0x25f35d);}return null;};}function patchUpdates(_0xcec10){return function(_0x591e84){try{jsonpatch[_0xed4c('0x23')](_0x591e84,_0xcec10,!![]);}catch(_0x1dff57){return BPromise['reject'](_0x1dff57);}return _0x591e84['save']();};}function saveUpdates(_0x1e05fc,_0x282c12){return function(_0x4ca76c){if(_0x4ca76c){return _0x4ca76c[_0xed4c('0x24')](_0x1e05fc)[_0xed4c('0x25')](function(_0x120e94){return _0x120e94;});}return null;};}function removeEntity(_0x47f095,_0x472813){return function(_0x5c750f){if(_0x5c750f){return _0x5c750f['destroy']()[_0xed4c('0x25')](function(){_0x47f095[_0xed4c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44df5e,_0x4f23a3){return function(_0x3d6172){if(!_0x3d6172){_0x44df5e[_0xed4c('0x19')](0x194);}return _0x3d6172;};}function handleError(_0xf92230,_0x1c05a4){_0x1c05a4=_0x1c05a4||0x1f4;return function(_0x7e2efc){logger['error'](_0x7e2efc[_0xed4c('0x26')]);if(_0x7e2efc[_0xed4c('0x27')]){delete _0x7e2efc[_0xed4c('0x27')];}_0xf92230[_0xed4c('0x1b')](_0x1c05a4)[_0xed4c('0x28')](_0x7e2efc);};}exports[_0xed4c('0x29')]=function(_0x243001,_0x1b94ce){var _0x435f3b={},_0x596984={},_0x1c38b3={'count':0x0,'rows':[]};var _0x127438=_[_0xed4c('0x2a')](db['SugarcrmField']['rawAttributes'],function(_0xb3c5d1){return{'name':_0xb3c5d1[_0xed4c('0x2b')],'type':_0xb3c5d1['type'][_0xed4c('0x2c')]};});_0x596984[_0xed4c('0x2d')]=_[_0xed4c('0x2a')](_0x127438,_0xed4c('0x27'));_0x596984[_0xed4c('0x2e')]=_[_0xed4c('0x2f')](_0x243001[_0xed4c('0x2e')]);_0x596984[_0xed4c('0x30')]=_[_0xed4c('0x31')](_0x596984[_0xed4c('0x2d')],_0x596984[_0xed4c('0x2e')]);_0x435f3b[_0xed4c('0x32')]=_[_0xed4c('0x31')](_0x596984[_0xed4c('0x2d')],qs['fields'](_0x243001[_0xed4c('0x2e')]['fields']));_0x435f3b['attributes']=_0x435f3b[_0xed4c('0x32')][_0xed4c('0x33')]?_0x435f3b[_0xed4c('0x32')]:_0x596984['model'];if(!_0x243001[_0xed4c('0x2e')]['hasOwnProperty'](_0xed4c('0x34'))){_0x435f3b[_0xed4c('0x20')]=qs[_0xed4c('0x20')](_0x243001['query'][_0xed4c('0x20')]);_0x435f3b[_0xed4c('0x1d')]=qs[_0xed4c('0x1d')](_0x243001['query'][_0xed4c('0x1d')]);}_0x435f3b[_0xed4c('0x35')]=qs[_0xed4c('0x36')](_0x243001['query'][_0xed4c('0x36')]);_0x435f3b['where']=qs[_0xed4c('0x30')](_['pick'](_0x243001[_0xed4c('0x2e')],_0x596984[_0xed4c('0x30')]),_0x127438);if(_0x243001['query'][_0xed4c('0x37')]){_0x435f3b[_0xed4c('0x38')]=_[_0xed4c('0x39')](_0x435f3b['where'],{'$or':_[_0xed4c('0x2a')](_0x127438,function(_0x418f94){if(_0x418f94[_0xed4c('0x3a')]!==_0xed4c('0x3b')){var _0x4c4a25={};_0x4c4a25[_0x418f94[_0xed4c('0x27')]]={'$like':'%'+_0x243001['query']['filter']+'%'};return _0x4c4a25;}})});}_0x435f3b=_[_0xed4c('0x39')]({},_0x435f3b,_0x243001[_0xed4c('0x3c')]);var _0x28d0db={'where':_0x435f3b[_0xed4c('0x38')]};return db[_0xed4c('0x3d')]['count'](_0x28d0db)['then'](function(_0x923364){_0x1c38b3['count']=_0x923364;if(_0x243001[_0xed4c('0x2e')][_0xed4c('0x3e')]){_0x435f3b[_0xed4c('0x3f')]=[{'all':!![]}];}return db[_0xed4c('0x3d')]['findAll'](_0x435f3b);})['then'](function(_0x365d85){_0x1c38b3['rows']=_0x365d85;return _0x1c38b3;})[_0xed4c('0x25')](respondWithFilteredResult(_0x1b94ce,_0x435f3b))[_0xed4c('0x40')](handleError(_0x1b94ce,null));};exports['show']=function(_0x543e3b,_0x39d3a4){var _0x378a4e={'raw':!![],'where':{'id':_0x543e3b[_0xed4c('0x41')]['id']}},_0x38be85={};_0x38be85[_0xed4c('0x2d')]=_[_0xed4c('0x2f')](db[_0xed4c('0x3d')]['rawAttributes']);_0x38be85[_0xed4c('0x2e')]=_[_0xed4c('0x2f')](_0x543e3b['query']);_0x38be85[_0xed4c('0x30')]=_[_0xed4c('0x31')](_0x38be85[_0xed4c('0x2d')],_0x38be85[_0xed4c('0x2e')]);_0x378a4e[_0xed4c('0x32')]=_['intersection'](_0x38be85['model'],qs[_0xed4c('0x42')](_0x543e3b['query'][_0xed4c('0x42')]));_0x378a4e[_0xed4c('0x32')]=_0x378a4e[_0xed4c('0x32')][_0xed4c('0x33')]?_0x378a4e[_0xed4c('0x32')]:_0x38be85['model'];if(_0x543e3b[_0xed4c('0x2e')][_0xed4c('0x3e')]){_0x378a4e[_0xed4c('0x3f')]=[{'all':!![]}];}_0x378a4e=_['merge']({},_0x378a4e,_0x543e3b[_0xed4c('0x3c')]);return db[_0xed4c('0x3d')][_0xed4c('0x43')](_0x378a4e)['then'](handleEntityNotFound(_0x39d3a4,null))[_0xed4c('0x25')](respondWithResult(_0x39d3a4,null))[_0xed4c('0x40')](handleError(_0x39d3a4,null));};exports[_0xed4c('0x44')]=function(_0x37fe83,_0x5c81d8){return db['SugarcrmField'][_0xed4c('0x44')](_0x37fe83[_0xed4c('0x45')],{})[_0xed4c('0x25')](respondWithResult(_0x5c81d8,0xc9))[_0xed4c('0x40')](handleError(_0x5c81d8,null));};exports[_0xed4c('0x24')]=function(_0x4fcd02,_0x4b965d){if(_0x4fcd02[_0xed4c('0x45')]['id']){delete _0x4fcd02[_0xed4c('0x45')]['id'];}return db['SugarcrmField'][_0xed4c('0x43')]({'where':{'id':_0x4fcd02['params']['id']}})[_0xed4c('0x25')](handleEntityNotFound(_0x4b965d,null))[_0xed4c('0x25')](saveUpdates(_0x4fcd02[_0xed4c('0x45')],null))[_0xed4c('0x25')](respondWithResult(_0x4b965d,null))[_0xed4c('0x40')](handleError(_0x4b965d,null));};exports[_0xed4c('0x46')]=function(_0x5438b9,_0x40dde1){return db[_0xed4c('0x3d')][_0xed4c('0x43')]({'where':{'id':_0x5438b9[_0xed4c('0x41')]['id']}})['then'](handleEntityNotFound(_0x40dde1,null))[_0xed4c('0x25')](removeEntity(_0x40dde1,null))[_0xed4c('0x40')](handleError(_0x40dde1,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 5e39620..3500c82 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 _0x50e5=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SugarcrmField','int_sugarcrm_fields','FieldId','lodash','util','../../config/logger','api'];(function(_0x5a542a,_0x52c217){var _0x47a2ef=function(_0x3166e8){while(--_0x3166e8){_0x5a542a['push'](_0x5a542a['shift']());}};_0x47a2ef(++_0x52c217);}(_0x50e5,0x191));var _0x550e=function(_0x2eba17,_0x2eb96f){_0x2eba17=_0x2eba17-0x0;var _0x78dc80=_0x50e5[_0x2eba17];return _0x78dc80;};'use strict';var _=require(_0x550e('0x0'));var util=require(_0x550e('0x1'));var logger=require(_0x550e('0x2'))(_0x550e('0x3'));var moment=require(_0x550e('0x4'));var BPromise=require(_0x550e('0x5'));var rp=require(_0x550e('0x6'));var fs=require('fs');var path=require(_0x550e('0x7'));var rimraf=require(_0x550e('0x8'));var config=require(_0x550e('0x9'));var attributes=require('./intSugarcrmField.attributes');module[_0x550e('0xa')]=function(_0x212257,_0x2e5dc3){return _0x212257[_0x550e('0xb')](_0x550e('0xc'),attributes,{'tableName':_0x550e('0xd'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0x550e('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6482=['request-promise','rimraf','../../config/environment','exports','define','SugarcrmField','int_sugarcrm_fields','FieldId','lodash','../../config/logger','api','bluebird'];(function(_0x5ee409,_0x21fcdb){var _0x44060d=function(_0x10e186){while(--_0x10e186){_0x5ee409['push'](_0x5ee409['shift']());}};_0x44060d(++_0x21fcdb);}(_0x6482,0x14c));var _0x2648=function(_0x440b22,_0x168e36){_0x440b22=_0x440b22-0x0;var _0x20efa4=_0x6482[_0x440b22];return _0x20efa4;};'use strict';var _=require(_0x2648('0x0'));var util=require('util');var logger=require(_0x2648('0x1'))(_0x2648('0x2'));var moment=require('moment');var BPromise=require(_0x2648('0x3'));var rp=require(_0x2648('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2648('0x5'));var config=require(_0x2648('0x6'));var attributes=require('./intSugarcrmField.attributes');module[_0x2648('0x7')]=function(_0x512d86,_0x24e287){return _0x512d86[_0x2648('0x8')](_0x2648('0x9'),attributes,{'tableName':_0x2648('0xa'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0x2648('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 1a7a7dc..fa91305 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 _0xcbf3=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x56b083,_0x29476f){var _0x1b01e6=function(_0x560697){while(--_0x560697){_0x56b083['push'](_0x56b083['shift']());}};_0x1b01e6(++_0x29476f);}(_0xcbf3,0x173));var _0x3cbf=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xcbf3[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x3cbf('0x0'));var util=require(_0x3cbf('0x1'));var moment=require(_0x3cbf('0x2'));var BPromise=require(_0x3cbf('0x3'));var rs=require(_0x3cbf('0x4'));var fs=require('fs');var Redis=require(_0x3cbf('0x5'));var db=require(_0x3cbf('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3cbf('0x7'))(_0x3cbf('0x8'));var config=require(_0x3cbf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3cbf('0xa')][_0x3cbf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x484d48,_0x575896,_0x383872){return new BPromise(function(_0x123e97,_0x503671){return client['request'](_0x484d48,_0x383872)[_0x3cbf('0xc')](function(_0xd16c92){logger['info'](_0x3cbf('0xd'),_0x575896,'request\x20sent');logger[_0x3cbf('0xe')](_0x3cbf('0xf'),_0x575896,_0x3cbf('0x10'),JSON[_0x3cbf('0x11')](_0xd16c92));if(_0xd16c92['error']){if(_0xd16c92[_0x3cbf('0x12')]['code']===0x1f4){logger[_0x3cbf('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x575896,_0xd16c92[_0x3cbf('0x12')][_0x3cbf('0x13')]);return _0x503671(_0xd16c92['error'][_0x3cbf('0x13')]);}logger[_0x3cbf('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x575896,_0xd16c92[_0x3cbf('0x12')][_0x3cbf('0x13')]);return _0x123e97(_0xd16c92[_0x3cbf('0x12')][_0x3cbf('0x13')]);}else{logger[_0x3cbf('0x14')](_0x3cbf('0xd'),_0x575896,'request\x20sent');_0x123e97(_0xd16c92[_0x3cbf('0x15')]['message']);}})[_0x3cbf('0x16')](function(_0x28ef68){logger[_0x3cbf('0x12')](_0x3cbf('0xd'),_0x575896,_0x28ef68);_0x503671(_0x28ef68);});});} \ No newline at end of file +var _0x91cf=['stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s'];(function(_0x450d4e,_0x52f637){var _0x2f36e5=function(_0x253b8b){while(--_0x253b8b){_0x450d4e['push'](_0x450d4e['shift']());}};_0x2f36e5(++_0x52f637);}(_0x91cf,0x1a4));var _0xf91c=function(_0x277415,_0x38968b){_0x277415=_0x277415-0x0;var _0x376342=_0x91cf[_0x277415];return _0x376342;};'use strict';var _=require(_0xf91c('0x0'));var util=require(_0xf91c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf91c('0x2'));var fs=require('fs');var Redis=require(_0xf91c('0x3'));var db=require(_0xf91c('0x4'))['db'];var utils=require(_0xf91c('0x5'));var logger=require('../../config/logger')(_0xf91c('0x6'));var config=require(_0xf91c('0x7'));var jayson=require(_0xf91c('0x8'));var client=jayson[_0xf91c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f6c13,_0x3f9d34,_0x2b0b5b){return new BPromise(function(_0x3f2328,_0x39019b){return client[_0xf91c('0xa')](_0x2f6c13,_0x2b0b5b)[_0xf91c('0xb')](function(_0x446451){logger[_0xf91c('0xc')](_0xf91c('0xd'),_0x3f9d34,_0xf91c('0xe'));logger[_0xf91c('0xf')](_0xf91c('0x10'),_0x3f9d34,_0xf91c('0xe'),JSON[_0xf91c('0x11')](_0x446451));if(_0x446451[_0xf91c('0x12')]){if(_0x446451[_0xf91c('0x12')][_0xf91c('0x13')]===0x1f4){logger[_0xf91c('0x12')](_0xf91c('0xd'),_0x3f9d34,_0x446451[_0xf91c('0x12')][_0xf91c('0x14')]);return _0x39019b(_0x446451[_0xf91c('0x12')]['message']);}logger['error'](_0xf91c('0xd'),_0x3f9d34,_0x446451['error'][_0xf91c('0x14')]);return _0x3f2328(_0x446451['error'][_0xf91c('0x14')]);}else{logger[_0xf91c('0xc')](_0xf91c('0xd'),_0x3f9d34,_0xf91c('0xe'));_0x3f2328(_0x446451[_0xf91c('0x15')][_0xf91c('0x14')]);}})[_0xf91c('0x16')](function(_0x11cd93){logger[_0xf91c('0x12')](_0xf91c('0xd'),_0x3f9d34,_0x11cd93);_0x39019b(_0x11cd93);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index a148699..5002333 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 _0x34f8=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x21f01d,_0x482036){var _0x4931e0=function(_0x2969c9){while(--_0x2969c9){_0x21f01d['push'](_0x21f01d['shift']());}};_0x4931e0(++_0x482036);}(_0x34f8,0xbc));var _0x834f=function(_0x5d8444,_0x3547b0){_0x5d8444=_0x5d8444-0x0;var _0x3801bf=_0x34f8[_0x5d8444];return _0x3801bf;};'use strict';var multer=require(_0x834f('0x0'));var util=require(_0x834f('0x1'));var path=require('path');var timeout=require(_0x834f('0x2'));var express=require(_0x834f('0x3'));var router=express[_0x834f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x834f('0x5'));var interaction=require(_0x834f('0x6'));var config=require(_0x834f('0x7'));var controller=require(_0x834f('0x8'));router['get']('/',auth[_0x834f('0x9')](),controller[_0x834f('0xa')]);router[_0x834f('0xb')](_0x834f('0xc'),auth['isAuthenticated'](),controller[_0x834f('0xd')]);router['get'](_0x834f('0xe'),auth[_0x834f('0x9')](),controller['getConfigurations']);router['get'](_0x834f('0xf'),auth[_0x834f('0x9')](),controller[_0x834f('0x10')]);router[_0x834f('0x11')]('/',auth[_0x834f('0x9')](),controller[_0x834f('0x12')]);router[_0x834f('0x11')]('/:id/configurations',auth[_0x834f('0x9')](),controller[_0x834f('0x13')]);router[_0x834f('0x14')]('/:id',auth[_0x834f('0x9')](),controller[_0x834f('0x15')]);router[_0x834f('0x16')](_0x834f('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x834f('0x17')]=router; \ No newline at end of file +var _0x4f82=['getConfigurations','/:id/fields','post','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x4f82,0xbc));var _0x24f8=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x4f82[_0x474bc0];return _0x4b24cf;};'use strict';var multer=require(_0x24f8('0x0'));var util=require(_0x24f8('0x1'));var path=require('path');var timeout=require(_0x24f8('0x2'));var express=require('express');var router=express[_0x24f8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x24f8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x24f8('0x5'));var controller=require(_0x24f8('0x6'));router[_0x24f8('0x7')]('/',auth[_0x24f8('0x8')](),controller['index']);router[_0x24f8('0x7')](_0x24f8('0x9'),auth[_0x24f8('0x8')](),controller[_0x24f8('0xa')]);router[_0x24f8('0x7')](_0x24f8('0xb'),auth['isAuthenticated'](),controller[_0x24f8('0xc')]);router[_0x24f8('0x7')](_0x24f8('0xd'),auth[_0x24f8('0x8')](),controller['getFields']);router[_0x24f8('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x24f8('0xb'),auth['isAuthenticated'](),controller[_0x24f8('0xf')]);router['put']('/:id',auth[_0x24f8('0x8')](),controller[_0x24f8('0x10')]);router[_0x24f8('0x11')](_0x24f8('0x9'),auth[_0x24f8('0x8')](),controller[_0x24f8('0x12')]);module[_0x24f8('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 62b945a..3efbd2e 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 _0x5b38=['exports','STRING','HelpDesk','sequelize'];(function(_0x48d493,_0x3e7fbd){var _0x19b0f8=function(_0x583afc){while(--_0x583afc){_0x48d493['push'](_0x48d493['shift']());}};_0x19b0f8(++_0x3e7fbd);}(_0x5b38,0x127));var _0x85b3=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x5b38[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0x85b3('0x0'));module[_0x85b3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x85b3('0x2')]},'username':{'type':Sequelize[_0x85b3('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x85b3('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x85b3('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x85b3('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1b2c=['STRING','HelpDesk','exports'];(function(_0x59a13e,_0xfdf9d0){var _0x3f6979=function(_0xd40796){while(--_0xd40796){_0x59a13e['push'](_0x59a13e['shift']());}};_0x3f6979(++_0xfdf9d0);}(_0x1b2c,0x15b));var _0xc1b2=function(_0x41f1ac,_0x48eb21){_0x41f1ac=_0x41f1ac-0x0;var _0x1b2cdf=_0x1b2c[_0x41f1ac];return _0x1b2cdf;};'use strict';var Sequelize=require('sequelize');module[_0xc1b2('0x0')]={'name':{'type':Sequelize[_0xc1b2('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc1b2('0x1')]},'username':{'type':Sequelize[_0xc1b2('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xc1b2('0x1')],'allowNull':![],'defaultValue':_0xc1b2('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xc1b2('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 9cf8326..95cc3d8 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 _0x93e3=['merge','options','include','rows','show','params','includeAll','catch','create','body','find','findOne','VtigerConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','slice','substring','lastIndexOf','format','getchallenge','POST','login','token','success','GET','describe','result','sessionName','reference','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x93e3,0xb7));var _0x393e=function(_0x57c662,_0x2c9ffe){_0x57c662=_0x57c662-0x0;var _0x216916=_0x93e3[_0x57c662];return _0x216916;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x393e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x393e('0x1'));var rp=require(_0x393e('0x2'));var moment=require(_0x393e('0x3'));var BPromise=require(_0x393e('0x4'));var Mustache=require('mustache');var util=require(_0x393e('0x5'));var path=require(_0x393e('0x6'));var sox=require('sox');var csv=require(_0x393e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x393e('0x8'));var _=require(_0x393e('0x9'));var squel=require(_0x393e('0xa'));var crypto=require(_0x393e('0xb'));var jsforce=require(_0x393e('0xc'));var deskjs=require(_0x393e('0xd'));var toCsv=require(_0x393e('0x7'));var querystring=require('querystring');var Papa=require(_0x393e('0xe'));var Redis=require(_0x393e('0xf'));var authService=require(_0x393e('0x10'));var qs=require(_0x393e('0x11'));var as=require(_0x393e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x393e('0x13'))(_0x393e('0x14'));var utils=require(_0x393e('0x15'));var config=require(_0x393e('0x16'));var licenseUtil=require(_0x393e('0x17'));var db=require(_0x393e('0x18'))['db'];var integrations=require(_0x393e('0x19'));function respondWithStatusCode(_0x40de37,_0x544747){_0x544747=_0x544747||0xcc;return function(_0x3ecdeb){if(_0x3ecdeb){return _0x40de37[_0x393e('0x1a')](_0x544747);}return _0x40de37[_0x393e('0x1b')](_0x544747)[_0x393e('0x1c')]();};}function respondWithResult(_0x56828a,_0x41188d){_0x41188d=_0x41188d||0xc8;return function(_0x57b12d){if(_0x57b12d){return _0x56828a['status'](_0x41188d)[_0x393e('0x1d')](_0x57b12d);}};}function respondWithFilteredResult(_0x6f38e6,_0x5edb04){return function(_0x2bbc91){if(_0x2bbc91){var _0x11fec6=typeof _0x5edb04[_0x393e('0x1e')]==='undefined'&&typeof _0x5edb04[_0x393e('0x1f')]===_0x393e('0x20');var _0x3df879=_0x2bbc91[_0x393e('0x21')];var _0x24b2a1=_0x11fec6?0x0:_0x5edb04[_0x393e('0x1e')];var _0x302e86=_0x11fec6?_0x2bbc91[_0x393e('0x21')]:_0x5edb04[_0x393e('0x1e')]+_0x5edb04[_0x393e('0x1f')];var _0x32f3f7;if(_0x302e86>=_0x3df879){_0x302e86=_0x3df879;_0x32f3f7=0xc8;}else{_0x32f3f7=0xce;}_0x6f38e6[_0x393e('0x1b')](_0x32f3f7);return _0x6f38e6[_0x393e('0x22')](_0x393e('0x23'),_0x24b2a1+'-'+_0x302e86+'/'+_0x3df879)[_0x393e('0x1d')](_0x2bbc91);}return null;};}function patchUpdates(_0x4ce87c){return function(_0x32dbed){try{jsonpatch[_0x393e('0x24')](_0x32dbed,_0x4ce87c,!![]);}catch(_0x3fd499){return BPromise['reject'](_0x3fd499);}return _0x32dbed[_0x393e('0x25')]();};}function saveUpdates(_0x2ccade,_0x4c9314){return function(_0x7de59d){if(_0x7de59d){return _0x7de59d[_0x393e('0x26')](_0x2ccade)['then'](function(_0x2a2a6f){return _0x2a2a6f;});}return null;};}function removeEntity(_0x42167b,_0x52e31c){return function(_0x21830c){if(_0x21830c){return _0x21830c[_0x393e('0x27')]()[_0x393e('0x28')](function(){_0x42167b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x971be1,_0x2768aa){return function(_0x47c855){if(!_0x47c855){_0x971be1['sendStatus'](0x194);}return _0x47c855;};}function handleError(_0x225c98,_0x2d8943){_0x2d8943=_0x2d8943||0x1f4;return function(_0x15ba71){logger[_0x393e('0x29')](_0x15ba71[_0x393e('0x2a')]);if(_0x15ba71[_0x393e('0x2b')]){delete _0x15ba71[_0x393e('0x2b')];}_0x225c98[_0x393e('0x1b')](_0x2d8943)[_0x393e('0x2c')](_0x15ba71);};}exports[_0x393e('0x2d')]=function(_0x454e68,_0x234c28){var _0x4b4253={},_0x342992={},_0x1c88de={'count':0x0,'rows':[]};var _0x541691=_['map'](db[_0x393e('0x2e')][_0x393e('0x2f')],function(_0x1abfc4){return{'name':_0x1abfc4[_0x393e('0x30')],'type':_0x1abfc4[_0x393e('0x31')]['key']};});_0x342992[_0x393e('0x32')]=_[_0x393e('0x33')](_0x541691,_0x393e('0x2b'));_0x342992['query']=_[_0x393e('0x34')](_0x454e68[_0x393e('0x35')]);_0x342992[_0x393e('0x36')]=_[_0x393e('0x37')](_0x342992[_0x393e('0x32')],_0x342992[_0x393e('0x35')]);_0x4b4253['attributes']=_[_0x393e('0x37')](_0x342992[_0x393e('0x32')],qs[_0x393e('0x38')](_0x454e68[_0x393e('0x35')][_0x393e('0x38')]));_0x4b4253[_0x393e('0x39')]=_0x4b4253[_0x393e('0x39')][_0x393e('0x3a')]?_0x4b4253[_0x393e('0x39')]:_0x342992[_0x393e('0x32')];if(!_0x454e68[_0x393e('0x35')][_0x393e('0x3b')]('nolimit')){_0x4b4253['limit']=qs[_0x393e('0x1f')](_0x454e68['query'][_0x393e('0x1f')]);_0x4b4253[_0x393e('0x1e')]=qs['offset'](_0x454e68[_0x393e('0x35')][_0x393e('0x1e')]);}_0x4b4253[_0x393e('0x3c')]=qs[_0x393e('0x3d')](_0x454e68[_0x393e('0x35')][_0x393e('0x3d')]);_0x4b4253['where']=qs['filters'](_[_0x393e('0x3e')](_0x454e68[_0x393e('0x35')],_0x342992[_0x393e('0x36')]),_0x541691);if(_0x454e68[_0x393e('0x35')][_0x393e('0x3f')]){_0x4b4253[_0x393e('0x40')]=_[_0x393e('0x41')](_0x4b4253[_0x393e('0x40')],{'$or':_[_0x393e('0x33')](_0x541691,function(_0x12783a){if(_0x12783a[_0x393e('0x31')]!=='VIRTUAL'){var _0x4057de={};_0x4057de[_0x12783a[_0x393e('0x2b')]]={'$like':'%'+_0x454e68[_0x393e('0x35')]['filter']+'%'};return _0x4057de;}})});}_0x4b4253=_[_0x393e('0x41')]({},_0x4b4253,_0x454e68[_0x393e('0x42')]);var _0x47e70b={'where':_0x4b4253[_0x393e('0x40')]};return db[_0x393e('0x2e')][_0x393e('0x21')](_0x47e70b)[_0x393e('0x28')](function(_0x4eef29){_0x1c88de['count']=_0x4eef29;if(_0x454e68[_0x393e('0x35')]['includeAll']){_0x4b4253[_0x393e('0x43')]=[{'all':!![]}];}return db[_0x393e('0x2e')]['findAll'](_0x4b4253);})[_0x393e('0x28')](function(_0x52de74){_0x1c88de[_0x393e('0x44')]=_0x52de74;return _0x1c88de;})[_0x393e('0x28')](respondWithFilteredResult(_0x234c28,_0x4b4253))['catch'](handleError(_0x234c28,null));};exports[_0x393e('0x45')]=function(_0x2c63d0,_0x599bc8){var _0x41e84c={'raw':![],'where':{'id':_0x2c63d0[_0x393e('0x46')]['id']}},_0x580059={};_0x580059[_0x393e('0x32')]=_['keys'](db[_0x393e('0x2e')][_0x393e('0x2f')]);_0x580059[_0x393e('0x35')]=_[_0x393e('0x34')](_0x2c63d0[_0x393e('0x35')]);_0x580059['filters']=_[_0x393e('0x37')](_0x580059[_0x393e('0x32')],_0x580059['query']);_0x41e84c[_0x393e('0x39')]=_[_0x393e('0x37')](_0x580059[_0x393e('0x32')],qs['fields'](_0x2c63d0['query'][_0x393e('0x38')]));_0x41e84c[_0x393e('0x39')]=_0x41e84c[_0x393e('0x39')]['length']?_0x41e84c[_0x393e('0x39')]:_0x580059[_0x393e('0x32')];if(_0x2c63d0[_0x393e('0x35')][_0x393e('0x47')]){_0x41e84c['include']=[{'all':!![]}];}_0x41e84c=_[_0x393e('0x41')]({},_0x41e84c,_0x2c63d0[_0x393e('0x42')]);return db[_0x393e('0x2e')]['find'](_0x41e84c)['then'](handleEntityNotFound(_0x599bc8,null))[_0x393e('0x28')](respondWithResult(_0x599bc8,null))[_0x393e('0x48')](handleError(_0x599bc8,null));};exports[_0x393e('0x49')]=function(_0x20fdb8,_0x52af0c){return db['VtigerAccount']['create'](_0x20fdb8['body'],{})['then'](respondWithResult(_0x52af0c,0xc9))[_0x393e('0x48')](handleError(_0x52af0c,null));};exports[_0x393e('0x26')]=function(_0x59a6d8,_0x45a579){if(_0x59a6d8[_0x393e('0x4a')]['id']){delete _0x59a6d8[_0x393e('0x4a')]['id'];}return db[_0x393e('0x2e')][_0x393e('0x4b')]({'where':{'id':_0x59a6d8[_0x393e('0x46')]['id']}})['then'](handleEntityNotFound(_0x45a579,null))['then'](saveUpdates(_0x59a6d8['body'],null))[_0x393e('0x28')](respondWithResult(_0x45a579,null))[_0x393e('0x48')](handleError(_0x45a579,null));};exports[_0x393e('0x27')]=function(_0x25c7ca,_0xb8c8ec){return db['VtigerAccount']['find']({'where':{'id':_0x25c7ca['params']['id']}})['then'](handleEntityNotFound(_0xb8c8ec,null))[_0x393e('0x28')](removeEntity(_0xb8c8ec,null))[_0x393e('0x48')](handleError(_0xb8c8ec,null));};exports['getConfigurations']=function(_0x263583,_0x251a7f,_0x83128d){var _0x1741f0={};var _0x4eda12={};var _0x28434a;var _0x3ed49f;return db['VtigerAccount'][_0x393e('0x4c')]({'where':{'id':_0x263583[_0x393e('0x46')]['id']}})[_0x393e('0x28')](handleEntityNotFound(_0x251a7f,null))[_0x393e('0x28')](function(_0x867c1f){if(_0x867c1f){_0x28434a=_0x867c1f;_0x4eda12[_0x393e('0x32')]=_[_0x393e('0x34')](db[_0x393e('0x4d')]['rawAttributes']);_0x4eda12[_0x393e('0x35')]=_[_0x393e('0x34')](_0x263583['query']);_0x4eda12[_0x393e('0x36')]=_['intersection'](_0x4eda12[_0x393e('0x32')],_0x4eda12[_0x393e('0x35')]);_0x1741f0[_0x393e('0x39')]=_[_0x393e('0x37')](_0x4eda12[_0x393e('0x32')],qs['fields'](_0x263583['query'][_0x393e('0x38')]));_0x1741f0[_0x393e('0x39')]=_0x1741f0[_0x393e('0x39')]['length']?_0x1741f0[_0x393e('0x39')]:_0x4eda12[_0x393e('0x32')];_0x1741f0[_0x393e('0x3c')]=qs[_0x393e('0x3d')](_0x263583[_0x393e('0x35')][_0x393e('0x3d')]);_0x1741f0[_0x393e('0x40')]=qs[_0x393e('0x36')](_[_0x393e('0x3e')](_0x263583[_0x393e('0x35')],_0x4eda12['filters']));if(_0x263583['query'][_0x393e('0x3f')]){_0x1741f0[_0x393e('0x40')]=_[_0x393e('0x41')](_0x1741f0[_0x393e('0x40')],{'$or':_[_0x393e('0x33')](_0x1741f0[_0x393e('0x39')],function(_0x46d623){var _0x24118b={};_0x24118b[_0x46d623]={'$like':'%'+_0x263583['query'][_0x393e('0x3f')]+'%'};return _0x24118b;})});}_0x1741f0=_['merge']({},_0x1741f0,_0x263583[_0x393e('0x42')]);return _0x28434a[_0x393e('0x4e')](_0x1741f0);}})['then'](function(_0x457369){if(_0x457369){_0x3ed49f=_0x457369[_0x393e('0x3a')];if(!_0x263583[_0x393e('0x35')][_0x393e('0x3b')](_0x393e('0x4f'))){_0x1741f0[_0x393e('0x1f')]=qs[_0x393e('0x1f')](_0x263583[_0x393e('0x35')]['limit']);_0x1741f0[_0x393e('0x1e')]=qs[_0x393e('0x1e')](_0x263583[_0x393e('0x35')]['offset']);}return _0x28434a[_0x393e('0x4e')](_0x1741f0);}})['then'](function(_0x240d0b){if(_0x240d0b){return _0x240d0b?{'count':_0x3ed49f,'rows':_0x240d0b}:null;}})[_0x393e('0x28')](respondWithResult(_0x251a7f,null))[_0x393e('0x48')](handleError(_0x251a7f,null));};exports[_0x393e('0x50')]=function(_0x1cf8a9,_0x454ae6,_0x35ddd7){if(_0x1cf8a9[_0x393e('0x4a')]['id']){delete _0x1cf8a9['body']['id'];}return db[_0x393e('0x2e')][_0x393e('0x4c')]({'where':{'id':_0x1cf8a9[_0x393e('0x46')]['id']}})[_0x393e('0x28')](handleEntityNotFound(_0x454ae6,null))[_0x393e('0x28')](function(_0x331ce0){if(_0x331ce0){_0x1cf8a9[_0x393e('0x4a')][_0x393e('0x51')]=_0x331ce0['id'];_0x1cf8a9[_0x393e('0x4a')][_0x393e('0x52')]=integrations[_0x393e('0x53')](_0x1cf8a9[_0x393e('0x4a')][_0x393e('0x54')],_0x1cf8a9['body'][_0x393e('0x31')]);_0x1cf8a9[_0x393e('0x4a')][_0x393e('0x55')]=integrations[_0x393e('0x56')](_0x1cf8a9[_0x393e('0x4a')][_0x393e('0x54')],_0x1cf8a9[_0x393e('0x4a')][_0x393e('0x31')]);return db[_0x393e('0x4d')][_0x393e('0x49')](_0x1cf8a9[_0x393e('0x4a')],{'include':[{'model':db[_0x393e('0x57')],'as':'Subjects'},{'model':db['VtigerField'],'as':_0x393e('0x55')}]});}return null;})[_0x393e('0x28')](respondWithResult(_0x454ae6,null))[_0x393e('0x48')](handleError(_0x454ae6,null));};var md5=require(_0x393e('0x58'));exports[_0x393e('0x59')]=function(_0x1f6e35,_0x17ae74,_0x5c6f22){var _0x3d872b=null;var _0x88b2ff=null;var _0x4f8ed8=null;var _0x5a53e0=null;var _0x371302='';return db[_0x393e('0x2e')][_0x393e('0x4c')]({'where':{'id':_0x1f6e35[_0x393e('0x46')]['id']},'attributes':['id',_0x393e('0x2b'),_0x393e('0x5a'),_0x393e('0x5b'),_0x393e('0x5c'),_0x393e('0x5d'),_0x393e('0x5e'),'accessKey']})[_0x393e('0x28')](handleEntityNotFound(_0x17ae74,null))[_0x393e('0x28')](function(_0x10f212){if(_0x10f212){_0x3d872b=_0x10f212['username'];_0x88b2ff=_0x10f212['accessKey'];_0x4f8ed8=_0x10f212['moduleName'];_0x371302=_0x10f212[_0x393e('0x5d')];var _0x1d24dd=_0x371302[_0x393e('0x5f')](-0x1);if(_0x1d24dd==='/'){_0x371302=_0x371302[_0x393e('0x60')](0x0,_0x371302[_0x393e('0x61')](_0x1d24dd));}_0x5a53e0=util[_0x393e('0x62')]('%s/webservice.php',_0x371302);var _0x47ee72={'method':'GET','uri':_0x5a53e0,'qs':{'operation':_0x393e('0x63'),'username':_0x10f212['username']},'json':!![]};return rp(_0x47ee72);}})['then'](function(_0x4b8eb8){if(_0x4b8eb8['success']){var _0x56e8bd={'method':_0x393e('0x64'),'uri':_0x5a53e0,'form':{'operation':_0x393e('0x65'),'username':_0x3d872b,'accessKey':md5(_0x4b8eb8['result'][_0x393e('0x66')]+_0x88b2ff)},'json':!![]};return rp(_0x56e8bd);}})[_0x393e('0x28')](function(_0x536956){if(_0x536956[_0x393e('0x67')]){var _0x295408={'method':_0x393e('0x68'),'uri':_0x5a53e0,'qs':{'operation':_0x393e('0x69'),'username':_0x3d872b,'sessionName':_0x536956[_0x393e('0x6a')][_0x393e('0x6b')],'elementType':_0x4f8ed8},'json':!![]};return rp(_0x295408);}})[_0x393e('0x28')](function(_0x6f835c){if(_0x6f835c[_0x393e('0x67')]){var _0x56ffc7=['autogenerated',_0x393e('0x6c'),'owner'];_[_0x393e('0x6d')](_0x6f835c[_0x393e('0x6a')][_0x393e('0x38')],function(_0x3b765f){return _0x56ffc7[_0x393e('0x6e')](_0x3b765f[_0x393e('0x31')][_0x393e('0x2b')]);});_[_0x393e('0x6d')](_0x6f835c['result'][_0x393e('0x38')],function(_0xd14f4a){return _0xd14f4a[_0x393e('0x6f')]===_0x393e('0x70');});return{'count':_0x6f835c[_0x393e('0x6a')][_0x393e('0x38')][_0x393e('0x3a')],'rows':_['map'](_0x6f835c['result']['fields'],function(_0x3bdcf0){return{'id':_0x3bdcf0[_0x393e('0x2b')],'name':_0x3bdcf0[_0x393e('0x71')],'custom':_[_0x393e('0x72')](_0x3bdcf0[_0x393e('0x2b')],_0x393e('0x73'))?!![]:![],'options':_0x3bdcf0[_0x393e('0x31')]['name']===_0x393e('0x74')&&_0x3bdcf0[_0x393e('0x31')][_0x393e('0x75')][_0x393e('0x3a')]>0x0?_[_0x393e('0x33')](_0x3bdcf0[_0x393e('0x31')]['picklistValues'],function(_0x44f471){return{'name':_0x44f471['label'],'value':_0x44f471[_0x393e('0x76')]};}):[]};})};}})[_0x393e('0x28')](respondWithResult(_0x17ae74,null))[_0x393e('0x48')](function(_0x453742){console[_0x393e('0x77')]('vTiger\x20error:\x20'+_0x453742);var _0x4b8a30=_0x1f6e35[_0x393e('0x35')][_0x393e('0x78')]?0x1f4:_0x453742[_0x393e('0x79')]||0x1f4;logger[_0x393e('0x29')](_0x393e('0x7a'),_0x393e('0x59'),_0x4b8a30,JSON[_0x393e('0x7b')](_0x453742));delete _0x453742['name'];if(_0x4b8a30===0x191){_0x4b8a30=0x190;}_0x17ae74[_0x393e('0x1b')](_0x4b8a30)[_0x393e('0x2c')](_0x1f6e35[_0x393e('0x35')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x453742['statusCode']}:_0x453742);});}; \ No newline at end of file +var _0xa729=['then','destroy','name','send','index','fieldName','model','map','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','VtigerAccount','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','getConfigurations','findOne','VtigerConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','reference','owner','remove','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','test','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x37c8ef,_0x334449){var _0x5eaee9=function(_0x4b1b98){while(--_0x4b1b98){_0x37c8ef['push'](_0x37c8ef['shift']());}};_0x5eaee9(++_0x334449);}(_0xa729,0xd1));var _0x9a72=function(_0x379816,_0xc6ee82){_0x379816=_0x379816-0x0;var _0xadec45=_0xa729[_0x379816];return _0xadec45;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9a72('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a72('0x1'));var moment=require(_0x9a72('0x2'));var BPromise=require(_0x9a72('0x3'));var Mustache=require('mustache');var util=require(_0x9a72('0x4'));var path=require(_0x9a72('0x5'));var sox=require(_0x9a72('0x6'));var csv=require(_0x9a72('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a72('0x8'));var _=require('lodash');var squel=require(_0x9a72('0x9'));var crypto=require(_0x9a72('0xa'));var jsforce=require(_0x9a72('0xb'));var deskjs=require(_0x9a72('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9a72('0xd'));var Papa=require(_0x9a72('0xe'));var Redis=require(_0x9a72('0xf'));var authService=require(_0x9a72('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9a72('0x11'));var hardwareService=require(_0x9a72('0x12'));var logger=require('../../config/logger')(_0x9a72('0x13'));var utils=require(_0x9a72('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9a72('0x15'));var db=require(_0x9a72('0x16'))['db'];var integrations=require(_0x9a72('0x17'));function respondWithStatusCode(_0x4f132d,_0x968ec){_0x968ec=_0x968ec||0xcc;return function(_0x48982f){if(_0x48982f){return _0x4f132d['sendStatus'](_0x968ec);}return _0x4f132d[_0x9a72('0x18')](_0x968ec)[_0x9a72('0x19')]();};}function respondWithResult(_0x5aba07,_0x1e9ae6){_0x1e9ae6=_0x1e9ae6||0xc8;return function(_0xb78954){if(_0xb78954){return _0x5aba07[_0x9a72('0x18')](_0x1e9ae6)[_0x9a72('0x1a')](_0xb78954);}};}function respondWithFilteredResult(_0x54f7d4,_0x941c2){return function(_0x56169b){if(_0x56169b){var _0x174b12=typeof _0x941c2[_0x9a72('0x1b')]===_0x9a72('0x1c')&&typeof _0x941c2['limit']===_0x9a72('0x1c');var _0x1d07bb=_0x56169b['count'];var _0x9544d7=_0x174b12?0x0:_0x941c2[_0x9a72('0x1b')];var _0x2d1a59=_0x174b12?_0x56169b[_0x9a72('0x1d')]:_0x941c2[_0x9a72('0x1b')]+_0x941c2[_0x9a72('0x1e')];var _0x29829b;if(_0x2d1a59>=_0x1d07bb){_0x2d1a59=_0x1d07bb;_0x29829b=0xc8;}else{_0x29829b=0xce;}_0x54f7d4[_0x9a72('0x18')](_0x29829b);return _0x54f7d4[_0x9a72('0x1f')](_0x9a72('0x20'),_0x9544d7+'-'+_0x2d1a59+'/'+_0x1d07bb)['json'](_0x56169b);}return null;};}function patchUpdates(_0x289a7f){return function(_0x5c58c8){try{jsonpatch[_0x9a72('0x21')](_0x5c58c8,_0x289a7f,!![]);}catch(_0x249863){return BPromise[_0x9a72('0x22')](_0x249863);}return _0x5c58c8[_0x9a72('0x23')]();};}function saveUpdates(_0x1c4cd0,_0x10b10e){return function(_0x2ac03e){if(_0x2ac03e){return _0x2ac03e[_0x9a72('0x24')](_0x1c4cd0)[_0x9a72('0x25')](function(_0x5c55ef){return _0x5c55ef;});}return null;};}function removeEntity(_0x4ae947,_0xdead17){return function(_0x214638){if(_0x214638){return _0x214638[_0x9a72('0x26')]()['then'](function(){_0x4ae947[_0x9a72('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdeae2f,_0x455af2){return function(_0x3bb130){if(!_0x3bb130){_0xdeae2f['sendStatus'](0x194);}return _0x3bb130;};}function handleError(_0x12428e,_0x1914c3){_0x1914c3=_0x1914c3||0x1f4;return function(_0x24792e){logger['error'](_0x24792e['stack']);if(_0x24792e[_0x9a72('0x27')]){delete _0x24792e[_0x9a72('0x27')];}_0x12428e[_0x9a72('0x18')](_0x1914c3)[_0x9a72('0x28')](_0x24792e);};}exports[_0x9a72('0x29')]=function(_0x13ec55,_0x254b14){var _0xe3e0dd={},_0x102dc6={},_0x4fa80c={'count':0x0,'rows':[]};var _0x5078a7=_['map'](db['VtigerAccount']['rawAttributes'],function(_0x4c799a){return{'name':_0x4c799a[_0x9a72('0x2a')],'type':_0x4c799a['type']['key']};});_0x102dc6[_0x9a72('0x2b')]=_[_0x9a72('0x2c')](_0x5078a7,_0x9a72('0x27'));_0x102dc6['query']=_[_0x9a72('0x2d')](_0x13ec55['query']);_0x102dc6[_0x9a72('0x2e')]=_[_0x9a72('0x2f')](_0x102dc6[_0x9a72('0x2b')],_0x102dc6['query']);_0xe3e0dd[_0x9a72('0x30')]=_[_0x9a72('0x2f')](_0x102dc6[_0x9a72('0x2b')],qs['fields'](_0x13ec55[_0x9a72('0x31')][_0x9a72('0x32')]));_0xe3e0dd[_0x9a72('0x30')]=_0xe3e0dd[_0x9a72('0x30')][_0x9a72('0x33')]?_0xe3e0dd[_0x9a72('0x30')]:_0x102dc6[_0x9a72('0x2b')];if(!_0x13ec55[_0x9a72('0x31')][_0x9a72('0x34')](_0x9a72('0x35'))){_0xe3e0dd[_0x9a72('0x1e')]=qs[_0x9a72('0x1e')](_0x13ec55['query']['limit']);_0xe3e0dd[_0x9a72('0x1b')]=qs['offset'](_0x13ec55[_0x9a72('0x31')][_0x9a72('0x1b')]);}_0xe3e0dd[_0x9a72('0x36')]=qs[_0x9a72('0x37')](_0x13ec55[_0x9a72('0x31')]['sort']);_0xe3e0dd[_0x9a72('0x38')]=qs['filters'](_['pick'](_0x13ec55[_0x9a72('0x31')],_0x102dc6[_0x9a72('0x2e')]),_0x5078a7);if(_0x13ec55['query']['filter']){_0xe3e0dd[_0x9a72('0x38')]=_[_0x9a72('0x39')](_0xe3e0dd[_0x9a72('0x38')],{'$or':_[_0x9a72('0x2c')](_0x5078a7,function(_0x409fe7){if(_0x409fe7[_0x9a72('0x3a')]!==_0x9a72('0x3b')){var _0x476937={};_0x476937[_0x409fe7[_0x9a72('0x27')]]={'$like':'%'+_0x13ec55[_0x9a72('0x31')][_0x9a72('0x3c')]+'%'};return _0x476937;}})});}_0xe3e0dd=_[_0x9a72('0x39')]({},_0xe3e0dd,_0x13ec55['options']);var _0x195177={'where':_0xe3e0dd['where']};return db[_0x9a72('0x3d')][_0x9a72('0x1d')](_0x195177)[_0x9a72('0x25')](function(_0x5753c4){_0x4fa80c[_0x9a72('0x1d')]=_0x5753c4;if(_0x13ec55['query'][_0x9a72('0x3e')]){_0xe3e0dd[_0x9a72('0x3f')]=[{'all':!![]}];}return db[_0x9a72('0x3d')][_0x9a72('0x40')](_0xe3e0dd);})['then'](function(_0x5d7381){_0x4fa80c[_0x9a72('0x41')]=_0x5d7381;return _0x4fa80c;})[_0x9a72('0x25')](respondWithFilteredResult(_0x254b14,_0xe3e0dd))[_0x9a72('0x42')](handleError(_0x254b14,null));};exports[_0x9a72('0x43')]=function(_0x14eb91,_0x46e0a6){var _0xd94a28={'raw':![],'where':{'id':_0x14eb91[_0x9a72('0x44')]['id']}},_0x3f7e58={};_0x3f7e58[_0x9a72('0x2b')]=_['keys'](db[_0x9a72('0x3d')][_0x9a72('0x45')]);_0x3f7e58[_0x9a72('0x31')]=_['keys'](_0x14eb91[_0x9a72('0x31')]);_0x3f7e58[_0x9a72('0x2e')]=_['intersection'](_0x3f7e58[_0x9a72('0x2b')],_0x3f7e58[_0x9a72('0x31')]);_0xd94a28['attributes']=_[_0x9a72('0x2f')](_0x3f7e58['model'],qs[_0x9a72('0x32')](_0x14eb91[_0x9a72('0x31')]['fields']));_0xd94a28['attributes']=_0xd94a28[_0x9a72('0x30')]['length']?_0xd94a28[_0x9a72('0x30')]:_0x3f7e58[_0x9a72('0x2b')];if(_0x14eb91[_0x9a72('0x31')][_0x9a72('0x3e')]){_0xd94a28[_0x9a72('0x3f')]=[{'all':!![]}];}_0xd94a28=_[_0x9a72('0x39')]({},_0xd94a28,_0x14eb91[_0x9a72('0x46')]);return db[_0x9a72('0x3d')][_0x9a72('0x47')](_0xd94a28)[_0x9a72('0x25')](handleEntityNotFound(_0x46e0a6,null))['then'](respondWithResult(_0x46e0a6,null))[_0x9a72('0x42')](handleError(_0x46e0a6,null));};exports[_0x9a72('0x48')]=function(_0x1117a6,_0x4023bb){return db[_0x9a72('0x3d')][_0x9a72('0x48')](_0x1117a6[_0x9a72('0x49')],{})['then'](respondWithResult(_0x4023bb,0xc9))[_0x9a72('0x42')](handleError(_0x4023bb,null));};exports['update']=function(_0xce81b5,_0xbf7cce){if(_0xce81b5[_0x9a72('0x49')]['id']){delete _0xce81b5[_0x9a72('0x49')]['id'];}return db[_0x9a72('0x3d')][_0x9a72('0x47')]({'where':{'id':_0xce81b5['params']['id']}})[_0x9a72('0x25')](handleEntityNotFound(_0xbf7cce,null))[_0x9a72('0x25')](saveUpdates(_0xce81b5[_0x9a72('0x49')],null))['then'](respondWithResult(_0xbf7cce,null))[_0x9a72('0x42')](handleError(_0xbf7cce,null));};exports[_0x9a72('0x26')]=function(_0x3070ff,_0x50c352){return db['VtigerAccount'][_0x9a72('0x47')]({'where':{'id':_0x3070ff[_0x9a72('0x44')]['id']}})[_0x9a72('0x25')](handleEntityNotFound(_0x50c352,null))[_0x9a72('0x25')](removeEntity(_0x50c352,null))[_0x9a72('0x42')](handleError(_0x50c352,null));};exports[_0x9a72('0x4a')]=function(_0x364f1e,_0x1bc9f3,_0x45a98c){var _0x6f768f={};var _0x14add3={};var _0x2e6f90;var _0x122efc;return db[_0x9a72('0x3d')][_0x9a72('0x4b')]({'where':{'id':_0x364f1e[_0x9a72('0x44')]['id']}})[_0x9a72('0x25')](handleEntityNotFound(_0x1bc9f3,null))[_0x9a72('0x25')](function(_0x9291b9){if(_0x9291b9){_0x2e6f90=_0x9291b9;_0x14add3[_0x9a72('0x2b')]=_[_0x9a72('0x2d')](db[_0x9a72('0x4c')][_0x9a72('0x45')]);_0x14add3[_0x9a72('0x31')]=_[_0x9a72('0x2d')](_0x364f1e[_0x9a72('0x31')]);_0x14add3['filters']=_['intersection'](_0x14add3[_0x9a72('0x2b')],_0x14add3['query']);_0x6f768f[_0x9a72('0x30')]=_[_0x9a72('0x2f')](_0x14add3[_0x9a72('0x2b')],qs[_0x9a72('0x32')](_0x364f1e[_0x9a72('0x31')]['fields']));_0x6f768f[_0x9a72('0x30')]=_0x6f768f[_0x9a72('0x30')][_0x9a72('0x33')]?_0x6f768f[_0x9a72('0x30')]:_0x14add3[_0x9a72('0x2b')];_0x6f768f['order']=qs['sort'](_0x364f1e[_0x9a72('0x31')]['sort']);_0x6f768f[_0x9a72('0x38')]=qs[_0x9a72('0x2e')](_['pick'](_0x364f1e['query'],_0x14add3[_0x9a72('0x2e')]));if(_0x364f1e['query'][_0x9a72('0x3c')]){_0x6f768f[_0x9a72('0x38')]=_[_0x9a72('0x39')](_0x6f768f[_0x9a72('0x38')],{'$or':_[_0x9a72('0x2c')](_0x6f768f[_0x9a72('0x30')],function(_0x3a7436){var _0x2e5031={};_0x2e5031[_0x3a7436]={'$like':'%'+_0x364f1e['query'][_0x9a72('0x3c')]+'%'};return _0x2e5031;})});}_0x6f768f=_[_0x9a72('0x39')]({},_0x6f768f,_0x364f1e[_0x9a72('0x46')]);return _0x2e6f90[_0x9a72('0x4a')](_0x6f768f);}})['then'](function(_0x5a2a86){if(_0x5a2a86){_0x122efc=_0x5a2a86['length'];if(!_0x364f1e[_0x9a72('0x31')][_0x9a72('0x34')](_0x9a72('0x35'))){_0x6f768f[_0x9a72('0x1e')]=qs[_0x9a72('0x1e')](_0x364f1e['query'][_0x9a72('0x1e')]);_0x6f768f[_0x9a72('0x1b')]=qs['offset'](_0x364f1e[_0x9a72('0x31')][_0x9a72('0x1b')]);}return _0x2e6f90['getConfigurations'](_0x6f768f);}})['then'](function(_0x4a54b2){if(_0x4a54b2){return _0x4a54b2?{'count':_0x122efc,'rows':_0x4a54b2}:null;}})[_0x9a72('0x25')](respondWithResult(_0x1bc9f3,null))['catch'](handleError(_0x1bc9f3,null));};exports[_0x9a72('0x4d')]=function(_0x5e8a97,_0x40e630,_0x3a8fac){if(_0x5e8a97[_0x9a72('0x49')]['id']){delete _0x5e8a97['body']['id'];}return db[_0x9a72('0x3d')]['findOne']({'where':{'id':_0x5e8a97[_0x9a72('0x44')]['id']}})[_0x9a72('0x25')](handleEntityNotFound(_0x40e630,null))[_0x9a72('0x25')](function(_0x218b1f){if(_0x218b1f){_0x5e8a97[_0x9a72('0x49')]['AccountId']=_0x218b1f['id'];_0x5e8a97['body'][_0x9a72('0x4e')]=integrations[_0x9a72('0x4f')](_0x5e8a97[_0x9a72('0x49')][_0x9a72('0x50')],_0x5e8a97[_0x9a72('0x49')][_0x9a72('0x3a')]);_0x5e8a97[_0x9a72('0x49')][_0x9a72('0x51')]=integrations['getDescriptions'](_0x5e8a97[_0x9a72('0x49')][_0x9a72('0x50')],_0x5e8a97[_0x9a72('0x49')][_0x9a72('0x3a')]);return db[_0x9a72('0x4c')][_0x9a72('0x48')](_0x5e8a97['body'],{'include':[{'model':db[_0x9a72('0x52')],'as':_0x9a72('0x4e')},{'model':db[_0x9a72('0x52')],'as':_0x9a72('0x51')}]});}return null;})['then'](respondWithResult(_0x40e630,null))['catch'](handleError(_0x40e630,null));};var md5=require(_0x9a72('0x53'));exports['getFields']=function(_0x1d6e60,_0x4273e8,_0x52e8aa){var _0x2e9ccf=null;var _0x3122e0=null;var _0x256a88=null;var _0x21b486=null;var _0x14e00d='';return db[_0x9a72('0x3d')][_0x9a72('0x4b')]({'where':{'id':_0x1d6e60[_0x9a72('0x44')]['id']},'attributes':['id',_0x9a72('0x27'),_0x9a72('0x54'),'description',_0x9a72('0x55'),_0x9a72('0x56'),_0x9a72('0x57'),_0x9a72('0x58')]})[_0x9a72('0x25')](handleEntityNotFound(_0x4273e8,null))[_0x9a72('0x25')](function(_0x4b439b){if(_0x4b439b){_0x2e9ccf=_0x4b439b['username'];_0x3122e0=_0x4b439b['accessKey'];_0x256a88=_0x4b439b['moduleName'];_0x14e00d=_0x4b439b[_0x9a72('0x56')];var _0x359d84=_0x14e00d[_0x9a72('0x59')](-0x1);if(_0x359d84==='/'){_0x14e00d=_0x14e00d[_0x9a72('0x5a')](0x0,_0x14e00d[_0x9a72('0x5b')](_0x359d84));}_0x21b486=util[_0x9a72('0x5c')](_0x9a72('0x5d'),_0x14e00d);var _0x571e18={'method':_0x9a72('0x5e'),'uri':_0x21b486,'qs':{'operation':_0x9a72('0x5f'),'username':_0x4b439b['username']},'json':!![]};return rp(_0x571e18);}})['then'](function(_0x443676){if(_0x443676[_0x9a72('0x60')]){var _0x165058={'method':_0x9a72('0x61'),'uri':_0x21b486,'form':{'operation':_0x9a72('0x62'),'username':_0x2e9ccf,'accessKey':md5(_0x443676[_0x9a72('0x63')][_0x9a72('0x64')]+_0x3122e0)},'json':!![]};return rp(_0x165058);}})[_0x9a72('0x25')](function(_0x33e8f2){if(_0x33e8f2[_0x9a72('0x60')]){var _0x3788b8={'method':'GET','uri':_0x21b486,'qs':{'operation':_0x9a72('0x65'),'username':_0x2e9ccf,'sessionName':_0x33e8f2[_0x9a72('0x63')][_0x9a72('0x66')],'elementType':_0x256a88},'json':!![]};return rp(_0x3788b8);}})[_0x9a72('0x25')](function(_0xdf6d1b){if(_0xdf6d1b[_0x9a72('0x60')]){var _0x31538b=[_0x9a72('0x67'),_0x9a72('0x68'),_0x9a72('0x69')];_[_0x9a72('0x6a')](_0xdf6d1b[_0x9a72('0x63')]['fields'],function(_0x2baa5b){return _0x31538b['includes'](_0x2baa5b[_0x9a72('0x3a')][_0x9a72('0x27')]);});_['remove'](_0xdf6d1b[_0x9a72('0x63')][_0x9a72('0x32')],function(_0xbaac03){return _0xbaac03[_0x9a72('0x6b')]===_0x9a72('0x6c');});return{'count':_0xdf6d1b[_0x9a72('0x63')][_0x9a72('0x32')][_0x9a72('0x33')],'rows':_['map'](_0xdf6d1b[_0x9a72('0x63')][_0x9a72('0x32')],function(_0x48274e){return{'id':_0x48274e[_0x9a72('0x27')],'name':_0x48274e[_0x9a72('0x6d')],'custom':_[_0x9a72('0x6e')](_0x48274e['name'],_0x9a72('0x6f'))?!![]:![],'options':_0x48274e[_0x9a72('0x3a')]['name']===_0x9a72('0x70')&&_0x48274e['type'][_0x9a72('0x71')][_0x9a72('0x33')]>0x0?_[_0x9a72('0x2c')](_0x48274e[_0x9a72('0x3a')][_0x9a72('0x71')],function(_0x4ef210){return{'name':_0x4ef210[_0x9a72('0x6d')],'value':_0x4ef210[_0x9a72('0x72')]};}):[]};})};}})['then'](respondWithResult(_0x4273e8,null))[_0x9a72('0x42')](function(_0x3eb37c){console[_0x9a72('0x73')]('vTiger\x20error:\x20'+_0x3eb37c);var _0x79f2b5=_0x1d6e60[_0x9a72('0x31')][_0x9a72('0x74')]?0x1f4:_0x3eb37c['statusCode']||0x1f4;logger[_0x9a72('0x75')](_0x9a72('0x76'),_0x9a72('0x77'),_0x79f2b5,JSON[_0x9a72('0x78')](_0x3eb37c));delete _0x3eb37c['name'];if(_0x79f2b5===0x191){_0x79f2b5=0x190;}_0x4273e8[_0x9a72('0x18')](_0x79f2b5)[_0x9a72('0x28')](_0x1d6e60[_0x9a72('0x31')][_0x9a72('0x74')]?{'message':_0x9a72('0x79'),'statusCode':_0x3eb37c[_0x9a72('0x7a')]}:_0x3eb37c);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index f173e1b..7e5a53e 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 _0xdc2b=['rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x10db45,_0x5b92fe){var _0x60a7e7=function(_0x2a21c0){while(--_0x2a21c0){_0x10db45['push'](_0x10db45['shift']());}};_0x60a7e7(++_0x5b92fe);}(_0xdc2b,0x77));var _0xbdc2=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xdc2b[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xbdc2('0x0'));var util=require('util');var logger=require(_0xbdc2('0x1'))(_0xbdc2('0x2'));var moment=require(_0xbdc2('0x3'));var BPromise=require(_0xbdc2('0x4'));var rp=require(_0xbdc2('0x5'));var fs=require('fs');var path=require(_0xbdc2('0x6'));var rimraf=require(_0xbdc2('0x7'));var config=require(_0xbdc2('0x8'));var attributes=require(_0xbdc2('0x9'));var integrations=require(_0xbdc2('0xa'));module[_0xbdc2('0xb')]=function(_0x3b2e51,_0x1d4be4){return _0x3b2e51[_0xbdc2('0xc')]('VtigerAccount',attributes,{'tableName':_0xbdc2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80c6=['./intVtigerAccount.attributes','../../components/integrations/configuration','exports','int_vtiger_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3973ef,_0x3f2ac7){var _0x58053b=function(_0x20af81){while(--_0x20af81){_0x3973ef['push'](_0x3973ef['shift']());}};_0x58053b(++_0x3f2ac7);}(_0x80c6,0x93));var _0x680c=function(_0x3e8a15,_0x1d05b4){_0x3e8a15=_0x3e8a15-0x0;var _0x5d5b36=_0x80c6[_0x3e8a15];return _0x5d5b36;};'use strict';var _=require(_0x680c('0x0'));var util=require(_0x680c('0x1'));var logger=require('../../config/logger')(_0x680c('0x2'));var moment=require(_0x680c('0x3'));var BPromise=require(_0x680c('0x4'));var rp=require(_0x680c('0x5'));var fs=require('fs');var path=require(_0x680c('0x6'));var rimraf=require(_0x680c('0x7'));var config=require(_0x680c('0x8'));var attributes=require(_0x680c('0x9'));var integrations=require(_0x680c('0xa'));module[_0x680c('0xb')]=function(_0x3300b4,_0x3a51fb){return _0x3300b4['define']('VtigerAccount',attributes,{'tableName':_0x680c('0xc'),'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 d069162..04e929e 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 _0xb62e=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','options','raw','where','limit','include','model','map','attributes','then','find','ShowVtigerAccount','lodash','util','moment'];(function(_0x6899c7,_0x363413){var _0x5186ee=function(_0x2f83a9){while(--_0x2f83a9){_0x6899c7['push'](_0x6899c7['shift']());}};_0x5186ee(++_0x363413);}(_0xb62e,0x1de));var _0xeb62=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb62e[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var moment=require(_0xeb62('0x2'));var BPromise=require(_0xeb62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb62('0x4'));var db=require(_0xeb62('0x5'))['db'];var utils=require(_0xeb62('0x6'));var logger=require(_0xeb62('0x7'))(_0xeb62('0x8'));var config=require(_0xeb62('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb62('0xa')][_0xeb62('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31f5ea,_0x5e0dc4,_0x2065a0){return new BPromise(function(_0xab7049,_0x1e10ae){return client[_0xeb62('0xc')](_0x31f5ea,_0x2065a0)['then'](function(_0x5cdef3){logger[_0xeb62('0xd')](_0xeb62('0xe'),_0x5e0dc4,_0xeb62('0xf'));logger[_0xeb62('0x10')](_0xeb62('0x11'),_0x5e0dc4,_0xeb62('0xf'),JSON[_0xeb62('0x12')](_0x5cdef3));if(_0x5cdef3[_0xeb62('0x13')]){if(_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x14')]===0x1f4){logger['error'](_0xeb62('0xe'),_0x5e0dc4,_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x15')]);return _0x1e10ae(_0x5cdef3[_0xeb62('0x13')]['message']);}logger[_0xeb62('0x13')](_0xeb62('0xe'),_0x5e0dc4,_0x5cdef3[_0xeb62('0x13')]['message']);return _0xab7049(_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x15')]);}else{logger[_0xeb62('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x5e0dc4,_0xeb62('0xf'));_0xab7049(_0x5cdef3[_0xeb62('0x16')][_0xeb62('0x15')]);}})[_0xeb62('0x17')](function(_0x3fb280){logger[_0xeb62('0x13')](_0xeb62('0xe'),_0x5e0dc4,_0x3fb280);_0x1e10ae(_0x3fb280);});});}exports[_0xeb62('0x18')]=function(_0x39b138){var _0x27fd84=this;return new Promise(function(_0x27efc8,_0x11d516){return db[_0xeb62('0x19')]['findAll']({'raw':_0x39b138[_0xeb62('0x1a')]?_0x39b138[_0xeb62('0x1a')][_0xeb62('0x1b')]===undefined?!![]:![]:!![],'where':_0x39b138[_0xeb62('0x1a')]?_0x39b138[_0xeb62('0x1a')][_0xeb62('0x1c')]||null:null,'attributes':_0x39b138[_0xeb62('0x1a')]?_0x39b138['options']['attributes']||null:null,'limit':_0x39b138[_0xeb62('0x1a')]?_0x39b138[_0xeb62('0x1a')][_0xeb62('0x1d')]||null:null,'include':_0x39b138[_0xeb62('0x1a')]?_0x39b138[_0xeb62('0x1a')]['include']?_['map'](_0x39b138[_0xeb62('0x1a')][_0xeb62('0x1e')],function(_0x182781){return{'model':db[_0x182781[_0xeb62('0x1f')]],'as':_0x182781['as'],'attributes':_0x182781['attributes'],'include':_0x182781['include']?_[_0xeb62('0x20')](_0x182781['include'],function(_0x448327){return{'model':db[_0x448327['model']],'as':_0x448327['as'],'attributes':_0x448327[_0xeb62('0x21')],'include':_0x448327['include']?_[_0xeb62('0x20')](_0x448327[_0xeb62('0x1e')],function(_0x46d1bb){return{'model':db[_0x46d1bb['model']],'as':_0x46d1bb['as'],'attributes':_0x46d1bb[_0xeb62('0x21')]};}):[]};}):[]};}):[]:[]})[_0xeb62('0x22')](function(_0x5222f4){logger[_0xeb62('0xd')](_0xeb62('0x18'),_0x39b138);logger[_0xeb62('0x10')]('GetVtigerAccount',_0x39b138,JSON[_0xeb62('0x12')](_0x5222f4));_0x27efc8(_0x5222f4);})[_0xeb62('0x17')](function(_0x57169a){logger[_0xeb62('0x13')](_0xeb62('0x18'),_0x57169a[_0xeb62('0x15')],_0x39b138);_0x11d516(_0x27fd84[_0xeb62('0x13')](0x1f4,_0x57169a[_0xeb62('0x15')]));});});};exports['ShowVtigerAccount']=function(_0x4b58af){var _0x1248bb=this;return new Promise(function(_0x357cf4,_0x1607ef){return db[_0xeb62('0x19')][_0xeb62('0x23')]({'raw':_0x4b58af[_0xeb62('0x1a')]?_0x4b58af[_0xeb62('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4b58af[_0xeb62('0x1a')]?_0x4b58af['options']['where']||null:null,'attributes':_0x4b58af[_0xeb62('0x1a')]?_0x4b58af[_0xeb62('0x1a')]['attributes']||null:null,'include':_0x4b58af[_0xeb62('0x1a')]?_0x4b58af['options'][_0xeb62('0x1e')]?_[_0xeb62('0x20')](_0x4b58af['options'][_0xeb62('0x1e')],function(_0xe2589){return{'model':db[_0xe2589['model']],'as':_0xe2589['as'],'attributes':_0xe2589[_0xeb62('0x21')],'include':_0xe2589[_0xeb62('0x1e')]?_[_0xeb62('0x20')](_0xe2589[_0xeb62('0x1e')],function(_0x513dd8){return{'model':db[_0x513dd8[_0xeb62('0x1f')]],'as':_0x513dd8['as'],'attributes':_0x513dd8[_0xeb62('0x21')],'include':_0x513dd8['include']?_['map'](_0x513dd8[_0xeb62('0x1e')],function(_0x117d8c){return{'model':db[_0x117d8c['model']],'as':_0x117d8c['as'],'attributes':_0x117d8c[_0xeb62('0x21')]};}):[]};}):[]};}):[]:[]})[_0xeb62('0x22')](function(_0x11eadb){logger[_0xeb62('0xd')](_0xeb62('0x24'),_0x4b58af);logger[_0xeb62('0x10')](_0xeb62('0x24'),_0x4b58af,JSON['stringify'](_0x11eadb));_0x357cf4(_0x11eadb);})['catch'](function(_0x3306e3){logger[_0xeb62('0x13')](_0xeb62('0x24'),_0x3306e3[_0xeb62('0x15')],_0x4b58af);_0x1607ef(_0x1248bb['error'](0x1f4,_0x3306e3[_0xeb62('0x15')]));});});}; \ No newline at end of file +var _0xde2c=['findAll','options','raw','where','limit','include','model','attributes','GetVtigerAccount','stringify','find','map','ShowVtigerAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','VtigerAccount'];(function(_0x579b39,_0x42c13d){var _0x6f5088=function(_0x3394c6){while(--_0x3394c6){_0x579b39['push'](_0x579b39['shift']());}};_0x6f5088(++_0x42c13d);}(_0xde2c,0x7f));var _0xcde2=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0xde2c[_0x3c4dad];return _0x1a4f49;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var moment=require(_0xcde2('0x2'));var BPromise=require(_0xcde2('0x3'));var rs=require(_0xcde2('0x4'));var fs=require('fs');var Redis=require(_0xcde2('0x5'));var db=require(_0xcde2('0x6'))['db'];var utils=require(_0xcde2('0x7'));var logger=require('../../config/logger')(_0xcde2('0x8'));var config=require(_0xcde2('0x9'));var jayson=require(_0xcde2('0xa'));var client=jayson[_0xcde2('0xb')][_0xcde2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53c558,_0x2b27ef,_0x385e83){return new BPromise(function(_0x9c7036,_0x544235){return client['request'](_0x53c558,_0x385e83)[_0xcde2('0xd')](function(_0x1c8b3c){logger['info'](_0xcde2('0xe'),_0x2b27ef,_0xcde2('0xf'));logger[_0xcde2('0x10')](_0xcde2('0x11'),_0x2b27ef,'request\x20sent',JSON['stringify'](_0x1c8b3c));if(_0x1c8b3c[_0xcde2('0x12')]){if(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x13')]===0x1f4){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x1c8b3c[_0xcde2('0x12')]['message']);return _0x544235(_0x1c8b3c[_0xcde2('0x12')]['message']);}logger[_0xcde2('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x2b27ef,_0x1c8b3c['error'][_0xcde2('0x14')]);return _0x9c7036(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x14')]);}else{logger[_0xcde2('0x15')](_0xcde2('0xe'),_0x2b27ef,'request\x20sent');_0x9c7036(_0x1c8b3c[_0xcde2('0x16')]['message']);}})[_0xcde2('0x17')](function(_0x198840){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x198840);_0x544235(_0x198840);});});}exports['GetVtigerAccount']=function(_0x4fd5aa){var _0x4fe586=this;return new Promise(function(_0x2b4468,_0x582e84){return db[_0xcde2('0x18')][_0xcde2('0x19')]({'raw':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa['options'][_0xcde2('0x1b')]===undefined?!![]:![]:!![],'where':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa[_0xcde2('0x1a')][_0xcde2('0x1c')]||null:null,'attributes':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa['options']['attributes']||null:null,'limit':_0x4fd5aa['options']?_0x4fd5aa[_0xcde2('0x1a')][_0xcde2('0x1d')]||null:null,'include':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa[_0xcde2('0x1a')][_0xcde2('0x1e')]?_['map'](_0x4fd5aa[_0xcde2('0x1a')]['include'],function(_0x280d8c){return{'model':db[_0x280d8c[_0xcde2('0x1f')]],'as':_0x280d8c['as'],'attributes':_0x280d8c[_0xcde2('0x20')],'include':_0x280d8c['include']?_['map'](_0x280d8c[_0xcde2('0x1e')],function(_0x207a12){return{'model':db[_0x207a12[_0xcde2('0x1f')]],'as':_0x207a12['as'],'attributes':_0x207a12[_0xcde2('0x20')],'include':_0x207a12[_0xcde2('0x1e')]?_['map'](_0x207a12[_0xcde2('0x1e')],function(_0x45275a){return{'model':db[_0x45275a[_0xcde2('0x1f')]],'as':_0x45275a['as'],'attributes':_0x45275a['attributes']};}):[]};}):[]};}):[]:[]})[_0xcde2('0xd')](function(_0x348ca1){logger[_0xcde2('0x15')](_0xcde2('0x21'),_0x4fd5aa);logger[_0xcde2('0x10')](_0xcde2('0x21'),_0x4fd5aa,JSON[_0xcde2('0x22')](_0x348ca1));_0x2b4468(_0x348ca1);})[_0xcde2('0x17')](function(_0x5bf1e6){logger[_0xcde2('0x12')]('GetVtigerAccount',_0x5bf1e6[_0xcde2('0x14')],_0x4fd5aa);_0x582e84(_0x4fe586[_0xcde2('0x12')](0x1f4,_0x5bf1e6[_0xcde2('0x14')]));});});};exports['ShowVtigerAccount']=function(_0xae46dc){var _0x28fedd=this;return new Promise(function(_0x58afb1,_0x26ec42){return db[_0xcde2('0x18')][_0xcde2('0x23')]({'raw':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc[_0xcde2('0x1a')][_0xcde2('0x1b')]===undefined?!![]:![]:!![],'where':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc[_0xcde2('0x1a')]['where']||null:null,'attributes':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc[_0xcde2('0x1a')][_0xcde2('0x20')]||null:null,'include':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc['options'][_0xcde2('0x1e')]?_[_0xcde2('0x24')](_0xae46dc[_0xcde2('0x1a')][_0xcde2('0x1e')],function(_0x498339){return{'model':db[_0x498339[_0xcde2('0x1f')]],'as':_0x498339['as'],'attributes':_0x498339[_0xcde2('0x20')],'include':_0x498339[_0xcde2('0x1e')]?_[_0xcde2('0x24')](_0x498339['include'],function(_0xb9c8d2){return{'model':db[_0xb9c8d2[_0xcde2('0x1f')]],'as':_0xb9c8d2['as'],'attributes':_0xb9c8d2[_0xcde2('0x20')],'include':_0xb9c8d2[_0xcde2('0x1e')]?_[_0xcde2('0x24')](_0xb9c8d2['include'],function(_0x2cd313){return{'model':db[_0x2cd313[_0xcde2('0x1f')]],'as':_0x2cd313['as'],'attributes':_0x2cd313[_0xcde2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcde2('0xd')](function(_0x4a64c1){logger['info'](_0xcde2('0x25'),_0xae46dc);logger[_0xcde2('0x10')](_0xcde2('0x25'),_0xae46dc,JSON[_0xcde2('0x22')](_0x4a64c1));_0x58afb1(_0x4a64c1);})[_0xcde2('0x17')](function(_0x45af6e){logger[_0xcde2('0x12')](_0xcde2('0x25'),_0x45af6e[_0xcde2('0x14')],_0xae46dc);_0x26ec42(_0x28fedd['error'](0x1f4,_0x45af6e[_0xcde2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 440df88..cd69bf5 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 _0xbee4=['put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','./intVtigerConfiguration.controller','index','get','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x51dd2c,_0x2a2345){var _0x41c678=function(_0xa14c31){while(--_0xa14c31){_0x51dd2c['push'](_0x51dd2c['shift']());}};_0x41c678(++_0x2a2345);}(_0xbee4,0x76));var _0x4bee=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xbee4[_0x1d9aa0];return _0x226868;};'use strict';var multer=require(_0x4bee('0x0'));var util=require(_0x4bee('0x1'));var path=require(_0x4bee('0x2'));var timeout=require(_0x4bee('0x3'));var express=require(_0x4bee('0x4'));var router=express[_0x4bee('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4bee('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x4bee('0x7')]);router[_0x4bee('0x8')]('/:id',auth[_0x4bee('0x9')](),controller[_0x4bee('0xa')]);router[_0x4bee('0x8')](_0x4bee('0xb'),auth[_0x4bee('0x9')](),controller['getFields']);router[_0x4bee('0x8')](_0x4bee('0xc'),auth[_0x4bee('0x9')](),controller[_0x4bee('0xd')]);router[_0x4bee('0x8')]('/:id/descriptions',auth[_0x4bee('0x9')](),controller[_0x4bee('0xe')]);router['post']('/',auth[_0x4bee('0x9')](),controller['create']);router[_0x4bee('0xf')](_0x4bee('0x10'),auth[_0x4bee('0x9')](),controller[_0x4bee('0x11')]);router['delete'](_0x4bee('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x4bee('0x12')]=router; \ No newline at end of file +var _0x707b=['express','Router','fs-extra','../../components/auth/service','./intVtigerConfiguration.controller','get','isAuthenticated','show','/:id/fields','getSubjects','post','create','/:id','update','delete','exports','multer','path','connect-timeout'];(function(_0x492a9e,_0x3ca8e5){var _0x4ff03f=function(_0x1ce448){while(--_0x1ce448){_0x492a9e['push'](_0x492a9e['shift']());}};_0x4ff03f(++_0x3ca8e5);}(_0x707b,0x1b2));var _0xb707=function(_0x416586,_0xbdf0b1){_0x416586=_0x416586-0x0;var _0x5cbb10=_0x707b[_0x416586];return _0x5cbb10;};'use strict';var multer=require(_0xb707('0x0'));var util=require('util');var path=require(_0xb707('0x1'));var timeout=require(_0xb707('0x2'));var express=require(_0xb707('0x3'));var router=express[_0xb707('0x4')]();var fs_extra=require(_0xb707('0x5'));var auth=require(_0xb707('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb707('0x7'));router[_0xb707('0x8')]('/',auth[_0xb707('0x9')](),controller['index']);router[_0xb707('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb707('0xa')]);router['get'](_0xb707('0xb'),auth[_0xb707('0x9')](),controller['getFields']);router[_0xb707('0x8')]('/:id/subjects',auth[_0xb707('0x9')](),controller[_0xb707('0xc')]);router[_0xb707('0x8')]('/:id/descriptions',auth[_0xb707('0x9')](),controller['getDescriptions']);router[_0xb707('0xd')]('/',auth['isAuthenticated'](),controller[_0xb707('0xe')]);router['put'](_0xb707('0xf'),auth['isAuthenticated'](),controller[_0xb707('0x10')]);router[_0xb707('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb707('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 6a387b7..861efc5 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 _0x0dff=['STRING','sequelize','exports'];(function(_0x1829e6,_0xbd0337){var _0x3526f9=function(_0x17c54b){while(--_0x17c54b){_0x1829e6['push'](_0x1829e6['shift']());}};_0x3526f9(++_0xbd0337);}(_0x0dff,0x1a5));var _0xf0df=function(_0x58e9c5,_0x1466d8){_0x58e9c5=_0x58e9c5-0x0;var _0x4cef4e=_0x0dff[_0x58e9c5];return _0x4cef4e;};'use strict';var Sequelize=require(_0xf0df('0x0'));module[_0xf0df('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf0df('0x2')]}}; \ No newline at end of file +var _0x3aa2=['STRING','sequelize'];(function(_0x363cd1,_0x204a3e){var _0x5e6fdc=function(_0x9d037f){while(--_0x9d037f){_0x363cd1['push'](_0x363cd1['shift']());}};_0x5e6fdc(++_0x204a3e);}(_0x3aa2,0xe7));var _0x23aa=function(_0x555890,_0xd516c8){_0x555890=_0x555890-0x0;var _0x3e574b=_0x3aa2[_0x555890];return _0x3e574b;};'use strict';var Sequelize=require(_0x23aa('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x23aa('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index d783cd6..acdd45a 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 _0x1d57=['status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','VtigerConfiguration','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','length','create','body','catch','find','findOne','VtigerField','getFields','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x19fb31,_0x12710e){var _0x512e8d=function(_0x89d569){while(--_0x89d569){_0x19fb31['push'](_0x19fb31['shift']());}};_0x512e8d(++_0x12710e);}(_0x1d57,0x123));var _0x71d5=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0x1d57[_0x2b45b5];return _0x1d9c06;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x71d5('0x0'));var zipdir=require(_0x71d5('0x1'));var jsonpatch=require(_0x71d5('0x2'));var rp=require('request-promise');var moment=require(_0x71d5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x71d5('0x4'));var util=require(_0x71d5('0x5'));var path=require(_0x71d5('0x6'));var sox=require(_0x71d5('0x7'));var csv=require(_0x71d5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71d5('0x9'));var _=require(_0x71d5('0xa'));var squel=require('squel');var crypto=require(_0x71d5('0xb'));var jsforce=require(_0x71d5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x71d5('0x8'));var querystring=require(_0x71d5('0xd'));var Papa=require(_0x71d5('0xe'));var Redis=require(_0x71d5('0xf'));var authService=require(_0x71d5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x71d5('0x11'));var hardwareService=require(_0x71d5('0x12'));var logger=require(_0x71d5('0x13'))(_0x71d5('0x14'));var utils=require(_0x71d5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x71d5('0x16'));var db=require(_0x71d5('0x17'))['db'];function respondWithStatusCode(_0x213393,_0x33d62e){_0x33d62e=_0x33d62e||0xcc;return function(_0x30a13a){if(_0x30a13a){return _0x213393[_0x71d5('0x18')](_0x33d62e);}return _0x213393['status'](_0x33d62e)['end']();};}function respondWithResult(_0x7cdff3,_0x1b2fc6){_0x1b2fc6=_0x1b2fc6||0xc8;return function(_0x178b3b){if(_0x178b3b){return _0x7cdff3[_0x71d5('0x19')](_0x1b2fc6)[_0x71d5('0x1a')](_0x178b3b);}};}function respondWithFilteredResult(_0x229454,_0x247aad){return function(_0x1c66d9){if(_0x1c66d9){var _0x384ff3=typeof _0x247aad[_0x71d5('0x1b')]===_0x71d5('0x1c')&&typeof _0x247aad[_0x71d5('0x1d')]==='undefined';var _0xc9a36b=_0x1c66d9[_0x71d5('0x1e')];var _0x4333c1=_0x384ff3?0x0:_0x247aad['offset'];var _0x4a3e60=_0x384ff3?_0x1c66d9[_0x71d5('0x1e')]:_0x247aad[_0x71d5('0x1b')]+_0x247aad['limit'];var _0x37bc54;if(_0x4a3e60>=_0xc9a36b){_0x4a3e60=_0xc9a36b;_0x37bc54=0xc8;}else{_0x37bc54=0xce;}_0x229454['status'](_0x37bc54);return _0x229454['set'](_0x71d5('0x1f'),_0x4333c1+'-'+_0x4a3e60+'/'+_0xc9a36b)[_0x71d5('0x1a')](_0x1c66d9);}return null;};}function patchUpdates(_0x25b72b){return function(_0x193096){try{jsonpatch[_0x71d5('0x20')](_0x193096,_0x25b72b,!![]);}catch(_0x423277){return BPromise[_0x71d5('0x21')](_0x423277);}return _0x193096[_0x71d5('0x22')]();};}function saveUpdates(_0x29ae43,_0xf4036c){return function(_0x41f1c3){if(_0x41f1c3){return _0x41f1c3[_0x71d5('0x23')](_0x29ae43)[_0x71d5('0x24')](function(_0x31d2be){return _0x31d2be;});}return null;};}function removeEntity(_0x1ca0d9,_0x14e8b3){return function(_0x26aacf){if(_0x26aacf){return _0x26aacf[_0x71d5('0x25')]()[_0x71d5('0x24')](function(){_0x1ca0d9[_0x71d5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x199997,_0x49d636){return function(_0x399502){if(!_0x399502){_0x199997[_0x71d5('0x18')](0x194);}return _0x399502;};}function handleError(_0x48661f,_0x3319d0){_0x3319d0=_0x3319d0||0x1f4;return function(_0x3200e8){logger[_0x71d5('0x26')](_0x3200e8['stack']);if(_0x3200e8[_0x71d5('0x27')]){delete _0x3200e8['name'];}_0x48661f[_0x71d5('0x19')](_0x3319d0)[_0x71d5('0x28')](_0x3200e8);};}exports['index']=function(_0x2c7ffc,_0x4f89c3){var _0x388fd7={},_0x49399f={},_0x31e51f={'count':0x0,'rows':[]};var _0x31e006=_[_0x71d5('0x29')](db[_0x71d5('0x2a')]['rawAttributes'],function(_0xe6f4fd){return{'name':_0xe6f4fd[_0x71d5('0x2b')],'type':_0xe6f4fd[_0x71d5('0x2c')][_0x71d5('0x2d')]};});_0x49399f[_0x71d5('0x2e')]=_['map'](_0x31e006,_0x71d5('0x27'));_0x49399f[_0x71d5('0x2f')]=_[_0x71d5('0x30')](_0x2c7ffc[_0x71d5('0x2f')]);_0x49399f[_0x71d5('0x31')]=_['intersection'](_0x49399f['model'],_0x49399f[_0x71d5('0x2f')]);_0x388fd7[_0x71d5('0x32')]=_[_0x71d5('0x33')](_0x49399f['model'],qs[_0x71d5('0x34')](_0x2c7ffc[_0x71d5('0x2f')][_0x71d5('0x34')]));_0x388fd7[_0x71d5('0x32')]=_0x388fd7[_0x71d5('0x32')]['length']?_0x388fd7[_0x71d5('0x32')]:_0x49399f[_0x71d5('0x2e')];if(!_0x2c7ffc[_0x71d5('0x2f')][_0x71d5('0x35')](_0x71d5('0x36'))){_0x388fd7['limit']=qs[_0x71d5('0x1d')](_0x2c7ffc[_0x71d5('0x2f')][_0x71d5('0x1d')]);_0x388fd7[_0x71d5('0x1b')]=qs['offset'](_0x2c7ffc[_0x71d5('0x2f')]['offset']);}_0x388fd7[_0x71d5('0x37')]=qs[_0x71d5('0x38')](_0x2c7ffc[_0x71d5('0x2f')][_0x71d5('0x38')]);_0x388fd7['where']=qs[_0x71d5('0x31')](_[_0x71d5('0x39')](_0x2c7ffc[_0x71d5('0x2f')],_0x49399f[_0x71d5('0x31')]),_0x31e006);if(_0x2c7ffc[_0x71d5('0x2f')][_0x71d5('0x3a')]){_0x388fd7['where']=_[_0x71d5('0x3b')](_0x388fd7[_0x71d5('0x3c')],{'$or':_[_0x71d5('0x29')](_0x31e006,function(_0x1a269d){if(_0x1a269d[_0x71d5('0x2c')]!==_0x71d5('0x3d')){var _0x55ed00={};_0x55ed00[_0x1a269d[_0x71d5('0x27')]]={'$like':'%'+_0x2c7ffc['query'][_0x71d5('0x3a')]+'%'};return _0x55ed00;}})});}_0x388fd7=_[_0x71d5('0x3b')]({},_0x388fd7,_0x2c7ffc[_0x71d5('0x3e')]);var _0x4dada8={'where':_0x388fd7[_0x71d5('0x3c')]};return db[_0x71d5('0x2a')][_0x71d5('0x1e')](_0x4dada8)[_0x71d5('0x24')](function(_0x468173){_0x31e51f[_0x71d5('0x1e')]=_0x468173;if(_0x2c7ffc[_0x71d5('0x2f')][_0x71d5('0x3f')]){_0x388fd7['include']=[{'all':!![]}];}return db[_0x71d5('0x2a')][_0x71d5('0x40')](_0x388fd7);})['then'](function(_0x46d302){_0x31e51f[_0x71d5('0x41')]=_0x46d302;return _0x31e51f;})[_0x71d5('0x24')](respondWithFilteredResult(_0x4f89c3,_0x388fd7))['catch'](handleError(_0x4f89c3,null));};exports[_0x71d5('0x42')]=function(_0x1ff3de,_0x4ddc1a){var _0x1288da={'raw':![],'where':{'id':_0x1ff3de[_0x71d5('0x43')]['id']}},_0x12facc={};_0x12facc['model']=_[_0x71d5('0x30')](db[_0x71d5('0x2a')][_0x71d5('0x44')]);_0x12facc[_0x71d5('0x2f')]=_[_0x71d5('0x30')](_0x1ff3de['query']);_0x12facc[_0x71d5('0x31')]=_[_0x71d5('0x33')](_0x12facc[_0x71d5('0x2e')],_0x12facc[_0x71d5('0x2f')]);_0x1288da['attributes']=_[_0x71d5('0x33')](_0x12facc[_0x71d5('0x2e')],qs[_0x71d5('0x34')](_0x1ff3de['query'][_0x71d5('0x34')]));_0x1288da[_0x71d5('0x32')]=_0x1288da[_0x71d5('0x32')][_0x71d5('0x45')]?_0x1288da[_0x71d5('0x32')]:_0x12facc[_0x71d5('0x2e')];if(_0x1ff3de[_0x71d5('0x2f')][_0x71d5('0x3f')]){_0x1288da['include']=[{'all':!![]}];}_0x1288da=_[_0x71d5('0x3b')]({},_0x1288da,_0x1ff3de['options']);return db[_0x71d5('0x2a')]['find'](_0x1288da)[_0x71d5('0x24')](handleEntityNotFound(_0x4ddc1a,null))['then'](respondWithResult(_0x4ddc1a,null))['catch'](handleError(_0x4ddc1a,null));};exports[_0x71d5('0x46')]=function(_0x1f9437,_0x26b966){return db[_0x71d5('0x2a')][_0x71d5('0x46')](_0x1f9437[_0x71d5('0x47')],{})[_0x71d5('0x24')](respondWithResult(_0x26b966,0xc9))[_0x71d5('0x48')](handleError(_0x26b966,null));};exports[_0x71d5('0x23')]=function(_0x4a5e7d,_0x13cfd5){if(_0x4a5e7d[_0x71d5('0x47')]['id']){delete _0x4a5e7d[_0x71d5('0x47')]['id'];}return db[_0x71d5('0x2a')][_0x71d5('0x49')]({'where':{'id':_0x4a5e7d['params']['id']}})[_0x71d5('0x24')](handleEntityNotFound(_0x13cfd5,null))[_0x71d5('0x24')](saveUpdates(_0x4a5e7d['body'],null))[_0x71d5('0x24')](respondWithResult(_0x13cfd5,null))[_0x71d5('0x48')](handleError(_0x13cfd5,null));};exports['destroy']=function(_0x45c172,_0x59fd22){return db[_0x71d5('0x2a')][_0x71d5('0x49')]({'where':{'id':_0x45c172[_0x71d5('0x43')]['id']}})[_0x71d5('0x24')](handleEntityNotFound(_0x59fd22,null))['then'](removeEntity(_0x59fd22,null))[_0x71d5('0x48')](handleError(_0x59fd22,null));};exports['getFields']=function(_0x4610f8,_0x484a57,_0x556dc6){var _0x597ae1={};var _0x2ffea9={};var _0x417436;var _0x2ce1c7;return db[_0x71d5('0x2a')][_0x71d5('0x4a')]({'where':{'id':_0x4610f8[_0x71d5('0x43')]['id']}})[_0x71d5('0x24')](handleEntityNotFound(_0x484a57,null))['then'](function(_0x2a80cc){if(_0x2a80cc){_0x417436=_0x2a80cc;_0x2ffea9['model']=_[_0x71d5('0x30')](db[_0x71d5('0x4b')][_0x71d5('0x44')]);_0x2ffea9[_0x71d5('0x2f')]=_[_0x71d5('0x30')](_0x4610f8['query']);_0x2ffea9[_0x71d5('0x31')]=_[_0x71d5('0x33')](_0x2ffea9[_0x71d5('0x2e')],_0x2ffea9[_0x71d5('0x2f')]);_0x597ae1[_0x71d5('0x32')]=_[_0x71d5('0x33')](_0x2ffea9[_0x71d5('0x2e')],qs[_0x71d5('0x34')](_0x4610f8[_0x71d5('0x2f')][_0x71d5('0x34')]));_0x597ae1[_0x71d5('0x32')]=_0x597ae1['attributes'][_0x71d5('0x45')]?_0x597ae1[_0x71d5('0x32')]:_0x2ffea9[_0x71d5('0x2e')];_0x597ae1[_0x71d5('0x37')]=qs[_0x71d5('0x38')](_0x4610f8[_0x71d5('0x2f')][_0x71d5('0x38')]);_0x597ae1[_0x71d5('0x3c')]=qs[_0x71d5('0x31')](_['pick'](_0x4610f8[_0x71d5('0x2f')],_0x2ffea9[_0x71d5('0x31')]));if(_0x4610f8[_0x71d5('0x2f')][_0x71d5('0x3a')]){_0x597ae1[_0x71d5('0x3c')]=_['merge'](_0x597ae1['where'],{'$or':_['map'](_0x597ae1['attributes'],function(_0x597aaf){var _0x5af848={};_0x5af848[_0x597aaf]={'$like':'%'+_0x4610f8[_0x71d5('0x2f')]['filter']+'%'};return _0x5af848;})});}_0x597ae1=_[_0x71d5('0x3b')]({},_0x597ae1,_0x4610f8[_0x71d5('0x3e')]);return _0x417436[_0x71d5('0x4c')](_0x597ae1);}})['then'](function(_0x56bd19){if(_0x56bd19){_0x2ce1c7=_0x56bd19[_0x71d5('0x45')];if(!_0x4610f8[_0x71d5('0x2f')][_0x71d5('0x35')](_0x71d5('0x36'))){_0x597ae1[_0x71d5('0x1d')]=qs[_0x71d5('0x1d')](_0x4610f8['query'][_0x71d5('0x1d')]);_0x597ae1[_0x71d5('0x1b')]=qs['offset'](_0x4610f8[_0x71d5('0x2f')]['offset']);}return _0x417436[_0x71d5('0x4c')](_0x597ae1);}})[_0x71d5('0x24')](function(_0x104762){if(_0x104762){return _0x104762?{'count':_0x2ce1c7,'rows':_0x104762}:null;}})[_0x71d5('0x24')](respondWithResult(_0x484a57,null))[_0x71d5('0x48')](handleError(_0x484a57,null));};exports[_0x71d5('0x4d')]=function(_0x2327c8,_0xc68363,_0x2b667c){var _0x3a4ae6={};var _0x138f42={};var _0x56b0b7;var _0x53e59e;return db[_0x71d5('0x2a')][_0x71d5('0x4a')]({'where':{'id':_0x2327c8[_0x71d5('0x43')]['id']}})[_0x71d5('0x24')](handleEntityNotFound(_0xc68363,null))[_0x71d5('0x24')](function(_0x175e71){if(_0x175e71){_0x56b0b7=_0x175e71;_0x138f42[_0x71d5('0x2e')]=_[_0x71d5('0x30')](db[_0x71d5('0x4b')][_0x71d5('0x44')]);_0x138f42[_0x71d5('0x2f')]=_[_0x71d5('0x30')](_0x2327c8[_0x71d5('0x2f')]);_0x138f42[_0x71d5('0x31')]=_['intersection'](_0x138f42[_0x71d5('0x2e')],_0x138f42['query']);_0x3a4ae6[_0x71d5('0x32')]=_[_0x71d5('0x33')](_0x138f42[_0x71d5('0x2e')],qs['fields'](_0x2327c8[_0x71d5('0x2f')]['fields']));_0x3a4ae6[_0x71d5('0x32')]=_0x3a4ae6[_0x71d5('0x32')][_0x71d5('0x45')]?_0x3a4ae6['attributes']:_0x138f42['model'];_0x3a4ae6[_0x71d5('0x37')]=qs[_0x71d5('0x38')](_0x2327c8['query'][_0x71d5('0x38')]);_0x3a4ae6['where']=qs[_0x71d5('0x31')](_[_0x71d5('0x39')](_0x2327c8[_0x71d5('0x2f')],_0x138f42['filters']));if(_0x2327c8[_0x71d5('0x2f')][_0x71d5('0x3a')]){_0x3a4ae6[_0x71d5('0x3c')]=_[_0x71d5('0x3b')](_0x3a4ae6[_0x71d5('0x3c')],{'$or':_[_0x71d5('0x29')](_0x3a4ae6['attributes'],function(_0x36543e){var _0x15636c={};_0x15636c[_0x36543e]={'$like':'%'+_0x2327c8['query'][_0x71d5('0x3a')]+'%'};return _0x15636c;})});}_0x3a4ae6=_[_0x71d5('0x3b')]({},_0x3a4ae6,_0x2327c8[_0x71d5('0x3e')]);return _0x56b0b7['getSubjects'](_0x3a4ae6);}})[_0x71d5('0x24')](function(_0x36fe0e){if(_0x36fe0e){_0x53e59e=_0x36fe0e[_0x71d5('0x45')];if(!_0x2327c8[_0x71d5('0x2f')][_0x71d5('0x35')]('nolimit')){_0x3a4ae6['limit']=qs[_0x71d5('0x1d')](_0x2327c8[_0x71d5('0x2f')][_0x71d5('0x1d')]);_0x3a4ae6[_0x71d5('0x1b')]=qs[_0x71d5('0x1b')](_0x2327c8[_0x71d5('0x2f')][_0x71d5('0x1b')]);}return _0x56b0b7['getSubjects'](_0x3a4ae6);}})[_0x71d5('0x24')](function(_0x5c9205){if(_0x5c9205){return _0x5c9205?{'count':_0x53e59e,'rows':_0x5c9205}:null;}})[_0x71d5('0x24')](respondWithResult(_0xc68363,null))[_0x71d5('0x48')](handleError(_0xc68363,null));};exports[_0x71d5('0x4e')]=function(_0x1329c2,_0x59dcb8,_0x389aff){var _0x3f5974={};var _0x25e09b={};var _0x5b9ab4;var _0x3cec6e;return db[_0x71d5('0x2a')][_0x71d5('0x4a')]({'where':{'id':_0x1329c2[_0x71d5('0x43')]['id']}})[_0x71d5('0x24')](handleEntityNotFound(_0x59dcb8,null))[_0x71d5('0x24')](function(_0x1496cb){if(_0x1496cb){_0x5b9ab4=_0x1496cb;_0x25e09b[_0x71d5('0x2e')]=_[_0x71d5('0x30')](db['VtigerField'][_0x71d5('0x44')]);_0x25e09b[_0x71d5('0x2f')]=_[_0x71d5('0x30')](_0x1329c2[_0x71d5('0x2f')]);_0x25e09b[_0x71d5('0x31')]=_['intersection'](_0x25e09b[_0x71d5('0x2e')],_0x25e09b['query']);_0x3f5974['attributes']=_[_0x71d5('0x33')](_0x25e09b[_0x71d5('0x2e')],qs[_0x71d5('0x34')](_0x1329c2[_0x71d5('0x2f')][_0x71d5('0x34')]));_0x3f5974[_0x71d5('0x32')]=_0x3f5974[_0x71d5('0x32')]['length']?_0x3f5974[_0x71d5('0x32')]:_0x25e09b[_0x71d5('0x2e')];_0x3f5974[_0x71d5('0x37')]=qs[_0x71d5('0x38')](_0x1329c2[_0x71d5('0x2f')]['sort']);_0x3f5974[_0x71d5('0x3c')]=qs[_0x71d5('0x31')](_[_0x71d5('0x39')](_0x1329c2[_0x71d5('0x2f')],_0x25e09b[_0x71d5('0x31')]));if(_0x1329c2['query'][_0x71d5('0x3a')]){_0x3f5974[_0x71d5('0x3c')]=_[_0x71d5('0x3b')](_0x3f5974[_0x71d5('0x3c')],{'$or':_[_0x71d5('0x29')](_0x3f5974['attributes'],function(_0x2f2983){var _0x362d8c={};_0x362d8c[_0x2f2983]={'$like':'%'+_0x1329c2[_0x71d5('0x2f')][_0x71d5('0x3a')]+'%'};return _0x362d8c;})});}_0x3f5974=_[_0x71d5('0x3b')]({},_0x3f5974,_0x1329c2['options']);return _0x5b9ab4[_0x71d5('0x4e')](_0x3f5974);}})[_0x71d5('0x24')](function(_0x5e4420){if(_0x5e4420){_0x3cec6e=_0x5e4420[_0x71d5('0x45')];if(!_0x1329c2[_0x71d5('0x2f')][_0x71d5('0x35')](_0x71d5('0x36'))){_0x3f5974[_0x71d5('0x1d')]=qs[_0x71d5('0x1d')](_0x1329c2[_0x71d5('0x2f')]['limit']);_0x3f5974['offset']=qs[_0x71d5('0x1b')](_0x1329c2[_0x71d5('0x2f')][_0x71d5('0x1b')]);}return _0x5b9ab4['getDescriptions'](_0x3f5974);}})[_0x71d5('0x24')](function(_0x288518){if(_0x288518){return _0x288518?{'count':_0x3cec6e,'rows':_0x288518}:null;}})[_0x71d5('0x24')](respondWithResult(_0x59dcb8,null))[_0x71d5('0x48')](handleError(_0x59dcb8,null));}; \ No newline at end of file +var _0x6b7b=['../../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','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerConfiguration','include','rows','catch','show','params','create','body','update','find','getFields','VtigerField','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x1bb812,_0x23eacc){var _0x372adb=function(_0x5ad456){while(--_0x5ad456){_0x1bb812['push'](_0x1bb812['shift']());}};_0x372adb(++_0x23eacc);}(_0x6b7b,0x93));var _0xb6b7=function(_0xac744d,_0x2f7b0f){_0xac744d=_0xac744d-0x0;var _0x28bd7a=_0x6b7b[_0xac744d];return _0x28bd7a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb6b7('0x0'));var zipdir=require(_0xb6b7('0x1'));var jsonpatch=require(_0xb6b7('0x2'));var rp=require(_0xb6b7('0x3'));var moment=require(_0xb6b7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb6b7('0x5'));var util=require(_0xb6b7('0x6'));var path=require(_0xb6b7('0x7'));var sox=require(_0xb6b7('0x8'));var csv=require(_0xb6b7('0x9'));var ejs=require(_0xb6b7('0xa'));var fs=require('fs');var fs_extra=require(_0xb6b7('0xb'));var _=require(_0xb6b7('0xc'));var squel=require(_0xb6b7('0xd'));var crypto=require(_0xb6b7('0xe'));var jsforce=require(_0xb6b7('0xf'));var deskjs=require(_0xb6b7('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb6b7('0x11'));var Papa=require(_0xb6b7('0x12'));var Redis=require('ioredis');var authService=require(_0xb6b7('0x13'));var qs=require(_0xb6b7('0x14'));var as=require(_0xb6b7('0x15'));var hardwareService=require(_0xb6b7('0x16'));var logger=require(_0xb6b7('0x17'))(_0xb6b7('0x18'));var utils=require(_0xb6b7('0x19'));var config=require(_0xb6b7('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xb6b7('0x1b'))['db'];function respondWithStatusCode(_0x570c6d,_0x179664){_0x179664=_0x179664||0xcc;return function(_0x3d3b80){if(_0x3d3b80){return _0x570c6d[_0xb6b7('0x1c')](_0x179664);}return _0x570c6d[_0xb6b7('0x1d')](_0x179664)[_0xb6b7('0x1e')]();};}function respondWithResult(_0x175f0,_0x1f8723){_0x1f8723=_0x1f8723||0xc8;return function(_0x42c082){if(_0x42c082){return _0x175f0[_0xb6b7('0x1d')](_0x1f8723)[_0xb6b7('0x1f')](_0x42c082);}};}function respondWithFilteredResult(_0x315586,_0x8b8707){return function(_0x393295){if(_0x393295){var _0xc74c9c=typeof _0x8b8707[_0xb6b7('0x20')]===_0xb6b7('0x21')&&typeof _0x8b8707[_0xb6b7('0x22')]===_0xb6b7('0x21');var _0x7df967=_0x393295[_0xb6b7('0x23')];var _0x440b91=_0xc74c9c?0x0:_0x8b8707[_0xb6b7('0x20')];var _0x35ee94=_0xc74c9c?_0x393295[_0xb6b7('0x23')]:_0x8b8707[_0xb6b7('0x20')]+_0x8b8707[_0xb6b7('0x22')];var _0x4461e7;if(_0x35ee94>=_0x7df967){_0x35ee94=_0x7df967;_0x4461e7=0xc8;}else{_0x4461e7=0xce;}_0x315586['status'](_0x4461e7);return _0x315586[_0xb6b7('0x24')](_0xb6b7('0x25'),_0x440b91+'-'+_0x35ee94+'/'+_0x7df967)['json'](_0x393295);}return null;};}function patchUpdates(_0x255d70){return function(_0x994895){try{jsonpatch[_0xb6b7('0x26')](_0x994895,_0x255d70,!![]);}catch(_0x52c13d){return BPromise[_0xb6b7('0x27')](_0x52c13d);}return _0x994895[_0xb6b7('0x28')]();};}function saveUpdates(_0x24a90f,_0x5dfdb6){return function(_0xbc8b29){if(_0xbc8b29){return _0xbc8b29['update'](_0x24a90f)[_0xb6b7('0x29')](function(_0x13e8f7){return _0x13e8f7;});}return null;};}function removeEntity(_0x4c1391,_0x2770ac){return function(_0x58b52a){if(_0x58b52a){return _0x58b52a[_0xb6b7('0x2a')]()['then'](function(){_0x4c1391[_0xb6b7('0x1d')](0xcc)[_0xb6b7('0x1e')]();});}};}function handleEntityNotFound(_0x388513,_0x30e117){return function(_0x48a7fd){if(!_0x48a7fd){_0x388513[_0xb6b7('0x1c')](0x194);}return _0x48a7fd;};}function handleError(_0x56f120,_0x456b4b){_0x456b4b=_0x456b4b||0x1f4;return function(_0x5464b6){logger[_0xb6b7('0x2b')](_0x5464b6['stack']);if(_0x5464b6['name']){delete _0x5464b6[_0xb6b7('0x2c')];}_0x56f120[_0xb6b7('0x1d')](_0x456b4b)['send'](_0x5464b6);};}exports[_0xb6b7('0x2d')]=function(_0x26a67c,_0x283c3f){var _0x3b9e69={},_0x14ce13={},_0x25ac89={'count':0x0,'rows':[]};var _0x5ad007=_[_0xb6b7('0x2e')](db['VtigerConfiguration'][_0xb6b7('0x2f')],function(_0x5bdde8){return{'name':_0x5bdde8[_0xb6b7('0x30')],'type':_0x5bdde8[_0xb6b7('0x31')][_0xb6b7('0x32')]};});_0x14ce13[_0xb6b7('0x33')]=_[_0xb6b7('0x2e')](_0x5ad007,_0xb6b7('0x2c'));_0x14ce13['query']=_[_0xb6b7('0x34')](_0x26a67c[_0xb6b7('0x35')]);_0x14ce13[_0xb6b7('0x36')]=_[_0xb6b7('0x37')](_0x14ce13[_0xb6b7('0x33')],_0x14ce13['query']);_0x3b9e69[_0xb6b7('0x38')]=_[_0xb6b7('0x37')](_0x14ce13[_0xb6b7('0x33')],qs[_0xb6b7('0x39')](_0x26a67c[_0xb6b7('0x35')][_0xb6b7('0x39')]));_0x3b9e69[_0xb6b7('0x38')]=_0x3b9e69[_0xb6b7('0x38')][_0xb6b7('0x3a')]?_0x3b9e69['attributes']:_0x14ce13[_0xb6b7('0x33')];if(!_0x26a67c[_0xb6b7('0x35')][_0xb6b7('0x3b')](_0xb6b7('0x3c'))){_0x3b9e69[_0xb6b7('0x22')]=qs['limit'](_0x26a67c[_0xb6b7('0x35')][_0xb6b7('0x22')]);_0x3b9e69['offset']=qs['offset'](_0x26a67c[_0xb6b7('0x35')][_0xb6b7('0x20')]);}_0x3b9e69[_0xb6b7('0x3d')]=qs[_0xb6b7('0x3e')](_0x26a67c['query'][_0xb6b7('0x3e')]);_0x3b9e69[_0xb6b7('0x3f')]=qs[_0xb6b7('0x36')](_[_0xb6b7('0x40')](_0x26a67c['query'],_0x14ce13[_0xb6b7('0x36')]),_0x5ad007);if(_0x26a67c[_0xb6b7('0x35')][_0xb6b7('0x41')]){_0x3b9e69[_0xb6b7('0x3f')]=_[_0xb6b7('0x42')](_0x3b9e69['where'],{'$or':_['map'](_0x5ad007,function(_0x5b107e){if(_0x5b107e[_0xb6b7('0x31')]!==_0xb6b7('0x43')){var _0x3b8854={};_0x3b8854[_0x5b107e[_0xb6b7('0x2c')]]={'$like':'%'+_0x26a67c[_0xb6b7('0x35')][_0xb6b7('0x41')]+'%'};return _0x3b8854;}})});}_0x3b9e69=_[_0xb6b7('0x42')]({},_0x3b9e69,_0x26a67c[_0xb6b7('0x44')]);var _0x59d583={'where':_0x3b9e69['where']};return db[_0xb6b7('0x45')][_0xb6b7('0x23')](_0x59d583)[_0xb6b7('0x29')](function(_0x3ede75){_0x25ac89[_0xb6b7('0x23')]=_0x3ede75;if(_0x26a67c['query']['includeAll']){_0x3b9e69[_0xb6b7('0x46')]=[{'all':!![]}];}return db[_0xb6b7('0x45')]['findAll'](_0x3b9e69);})[_0xb6b7('0x29')](function(_0xffde7a){_0x25ac89[_0xb6b7('0x47')]=_0xffde7a;return _0x25ac89;})[_0xb6b7('0x29')](respondWithFilteredResult(_0x283c3f,_0x3b9e69))[_0xb6b7('0x48')](handleError(_0x283c3f,null));};exports[_0xb6b7('0x49')]=function(_0x1896d0,_0x3c19a5){var _0x33be45={'raw':![],'where':{'id':_0x1896d0[_0xb6b7('0x4a')]['id']}},_0x5a52e8={};_0x5a52e8['model']=_['keys'](db[_0xb6b7('0x45')]['rawAttributes']);_0x5a52e8[_0xb6b7('0x35')]=_[_0xb6b7('0x34')](_0x1896d0[_0xb6b7('0x35')]);_0x5a52e8[_0xb6b7('0x36')]=_[_0xb6b7('0x37')](_0x5a52e8[_0xb6b7('0x33')],_0x5a52e8[_0xb6b7('0x35')]);_0x33be45[_0xb6b7('0x38')]=_[_0xb6b7('0x37')](_0x5a52e8[_0xb6b7('0x33')],qs[_0xb6b7('0x39')](_0x1896d0[_0xb6b7('0x35')][_0xb6b7('0x39')]));_0x33be45[_0xb6b7('0x38')]=_0x33be45['attributes'][_0xb6b7('0x3a')]?_0x33be45[_0xb6b7('0x38')]:_0x5a52e8[_0xb6b7('0x33')];if(_0x1896d0['query']['includeAll']){_0x33be45[_0xb6b7('0x46')]=[{'all':!![]}];}_0x33be45=_[_0xb6b7('0x42')]({},_0x33be45,_0x1896d0[_0xb6b7('0x44')]);return db['VtigerConfiguration']['find'](_0x33be45)['then'](handleEntityNotFound(_0x3c19a5,null))[_0xb6b7('0x29')](respondWithResult(_0x3c19a5,null))[_0xb6b7('0x48')](handleError(_0x3c19a5,null));};exports[_0xb6b7('0x4b')]=function(_0x4046b1,_0x3a5b9d){return db[_0xb6b7('0x45')][_0xb6b7('0x4b')](_0x4046b1[_0xb6b7('0x4c')],{})[_0xb6b7('0x29')](respondWithResult(_0x3a5b9d,0xc9))[_0xb6b7('0x48')](handleError(_0x3a5b9d,null));};exports[_0xb6b7('0x4d')]=function(_0x3ba8f8,_0x429591){if(_0x3ba8f8[_0xb6b7('0x4c')]['id']){delete _0x3ba8f8[_0xb6b7('0x4c')]['id'];}return db[_0xb6b7('0x45')][_0xb6b7('0x4e')]({'where':{'id':_0x3ba8f8['params']['id']}})[_0xb6b7('0x29')](handleEntityNotFound(_0x429591,null))[_0xb6b7('0x29')](saveUpdates(_0x3ba8f8['body'],null))['then'](respondWithResult(_0x429591,null))['catch'](handleError(_0x429591,null));};exports['destroy']=function(_0x19b926,_0x199c4f){return db['VtigerConfiguration'][_0xb6b7('0x4e')]({'where':{'id':_0x19b926[_0xb6b7('0x4a')]['id']}})[_0xb6b7('0x29')](handleEntityNotFound(_0x199c4f,null))['then'](removeEntity(_0x199c4f,null))['catch'](handleError(_0x199c4f,null));};exports[_0xb6b7('0x4f')]=function(_0xe768e3,_0x544b12,_0x56493d){var _0x5e28a3={};var _0x1adf78={};var _0x5b51f9;var _0x3d1cb8;return db[_0xb6b7('0x45')]['findOne']({'where':{'id':_0xe768e3[_0xb6b7('0x4a')]['id']}})[_0xb6b7('0x29')](handleEntityNotFound(_0x544b12,null))[_0xb6b7('0x29')](function(_0xc07c9d){if(_0xc07c9d){_0x5b51f9=_0xc07c9d;_0x1adf78[_0xb6b7('0x33')]=_[_0xb6b7('0x34')](db[_0xb6b7('0x50')][_0xb6b7('0x2f')]);_0x1adf78[_0xb6b7('0x35')]=_[_0xb6b7('0x34')](_0xe768e3['query']);_0x1adf78[_0xb6b7('0x36')]=_[_0xb6b7('0x37')](_0x1adf78[_0xb6b7('0x33')],_0x1adf78['query']);_0x5e28a3[_0xb6b7('0x38')]=_[_0xb6b7('0x37')](_0x1adf78[_0xb6b7('0x33')],qs[_0xb6b7('0x39')](_0xe768e3[_0xb6b7('0x35')]['fields']));_0x5e28a3[_0xb6b7('0x38')]=_0x5e28a3[_0xb6b7('0x38')][_0xb6b7('0x3a')]?_0x5e28a3[_0xb6b7('0x38')]:_0x1adf78[_0xb6b7('0x33')];_0x5e28a3[_0xb6b7('0x3d')]=qs['sort'](_0xe768e3[_0xb6b7('0x35')][_0xb6b7('0x3e')]);_0x5e28a3['where']=qs[_0xb6b7('0x36')](_['pick'](_0xe768e3['query'],_0x1adf78[_0xb6b7('0x36')]));if(_0xe768e3[_0xb6b7('0x35')][_0xb6b7('0x41')]){_0x5e28a3[_0xb6b7('0x3f')]=_[_0xb6b7('0x42')](_0x5e28a3[_0xb6b7('0x3f')],{'$or':_[_0xb6b7('0x2e')](_0x5e28a3[_0xb6b7('0x38')],function(_0x3f2791){var _0x25daba={};_0x25daba[_0x3f2791]={'$like':'%'+_0xe768e3[_0xb6b7('0x35')][_0xb6b7('0x41')]+'%'};return _0x25daba;})});}_0x5e28a3=_['merge']({},_0x5e28a3,_0xe768e3[_0xb6b7('0x44')]);return _0x5b51f9[_0xb6b7('0x4f')](_0x5e28a3);}})[_0xb6b7('0x29')](function(_0x3a8bfa){if(_0x3a8bfa){_0x3d1cb8=_0x3a8bfa[_0xb6b7('0x3a')];if(!_0xe768e3[_0xb6b7('0x35')][_0xb6b7('0x3b')](_0xb6b7('0x3c'))){_0x5e28a3[_0xb6b7('0x22')]=qs['limit'](_0xe768e3[_0xb6b7('0x35')][_0xb6b7('0x22')]);_0x5e28a3[_0xb6b7('0x20')]=qs[_0xb6b7('0x20')](_0xe768e3[_0xb6b7('0x35')]['offset']);}return _0x5b51f9[_0xb6b7('0x4f')](_0x5e28a3);}})['then'](function(_0xec18c9){if(_0xec18c9){return _0xec18c9?{'count':_0x3d1cb8,'rows':_0xec18c9}:null;}})[_0xb6b7('0x29')](respondWithResult(_0x544b12,null))[_0xb6b7('0x48')](handleError(_0x544b12,null));};exports[_0xb6b7('0x51')]=function(_0x59ac00,_0x392415,_0x5487fc){var _0x57bd49={};var _0x5687be={};var _0x340c8a;var _0x51753f;return db[_0xb6b7('0x45')][_0xb6b7('0x52')]({'where':{'id':_0x59ac00[_0xb6b7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x392415,null))[_0xb6b7('0x29')](function(_0x1d5b72){if(_0x1d5b72){_0x340c8a=_0x1d5b72;_0x5687be['model']=_['keys'](db['VtigerField']['rawAttributes']);_0x5687be[_0xb6b7('0x35')]=_[_0xb6b7('0x34')](_0x59ac00[_0xb6b7('0x35')]);_0x5687be[_0xb6b7('0x36')]=_[_0xb6b7('0x37')](_0x5687be[_0xb6b7('0x33')],_0x5687be['query']);_0x57bd49[_0xb6b7('0x38')]=_[_0xb6b7('0x37')](_0x5687be[_0xb6b7('0x33')],qs['fields'](_0x59ac00[_0xb6b7('0x35')]['fields']));_0x57bd49['attributes']=_0x57bd49[_0xb6b7('0x38')]['length']?_0x57bd49[_0xb6b7('0x38')]:_0x5687be[_0xb6b7('0x33')];_0x57bd49['order']=qs['sort'](_0x59ac00[_0xb6b7('0x35')][_0xb6b7('0x3e')]);_0x57bd49[_0xb6b7('0x3f')]=qs[_0xb6b7('0x36')](_['pick'](_0x59ac00['query'],_0x5687be[_0xb6b7('0x36')]));if(_0x59ac00['query'][_0xb6b7('0x41')]){_0x57bd49[_0xb6b7('0x3f')]=_[_0xb6b7('0x42')](_0x57bd49[_0xb6b7('0x3f')],{'$or':_[_0xb6b7('0x2e')](_0x57bd49[_0xb6b7('0x38')],function(_0x41597f){var _0x5d2775={};_0x5d2775[_0x41597f]={'$like':'%'+_0x59ac00[_0xb6b7('0x35')][_0xb6b7('0x41')]+'%'};return _0x5d2775;})});}_0x57bd49=_[_0xb6b7('0x42')]({},_0x57bd49,_0x59ac00['options']);return _0x340c8a['getSubjects'](_0x57bd49);}})[_0xb6b7('0x29')](function(_0xd29556){if(_0xd29556){_0x51753f=_0xd29556['length'];if(!_0x59ac00['query']['hasOwnProperty'](_0xb6b7('0x3c'))){_0x57bd49[_0xb6b7('0x22')]=qs[_0xb6b7('0x22')](_0x59ac00[_0xb6b7('0x35')][_0xb6b7('0x22')]);_0x57bd49[_0xb6b7('0x20')]=qs[_0xb6b7('0x20')](_0x59ac00[_0xb6b7('0x35')][_0xb6b7('0x20')]);}return _0x340c8a[_0xb6b7('0x51')](_0x57bd49);}})[_0xb6b7('0x29')](function(_0x5a29e7){if(_0x5a29e7){return _0x5a29e7?{'count':_0x51753f,'rows':_0x5a29e7}:null;}})['then'](respondWithResult(_0x392415,null))[_0xb6b7('0x48')](handleError(_0x392415,null));};exports[_0xb6b7('0x53')]=function(_0x387ed1,_0x5b9709,_0x11b589){var _0x35597b={};var _0x4bb0bd={};var _0x38fa09;var _0x1b28a2;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x387ed1[_0xb6b7('0x4a')]['id']}})[_0xb6b7('0x29')](handleEntityNotFound(_0x5b9709,null))[_0xb6b7('0x29')](function(_0x1f5380){if(_0x1f5380){_0x38fa09=_0x1f5380;_0x4bb0bd[_0xb6b7('0x33')]=_['keys'](db[_0xb6b7('0x50')][_0xb6b7('0x2f')]);_0x4bb0bd['query']=_[_0xb6b7('0x34')](_0x387ed1[_0xb6b7('0x35')]);_0x4bb0bd[_0xb6b7('0x36')]=_[_0xb6b7('0x37')](_0x4bb0bd[_0xb6b7('0x33')],_0x4bb0bd[_0xb6b7('0x35')]);_0x35597b[_0xb6b7('0x38')]=_[_0xb6b7('0x37')](_0x4bb0bd[_0xb6b7('0x33')],qs[_0xb6b7('0x39')](_0x387ed1[_0xb6b7('0x35')][_0xb6b7('0x39')]));_0x35597b[_0xb6b7('0x38')]=_0x35597b[_0xb6b7('0x38')]['length']?_0x35597b[_0xb6b7('0x38')]:_0x4bb0bd[_0xb6b7('0x33')];_0x35597b['order']=qs[_0xb6b7('0x3e')](_0x387ed1[_0xb6b7('0x35')][_0xb6b7('0x3e')]);_0x35597b[_0xb6b7('0x3f')]=qs[_0xb6b7('0x36')](_[_0xb6b7('0x40')](_0x387ed1[_0xb6b7('0x35')],_0x4bb0bd[_0xb6b7('0x36')]));if(_0x387ed1['query'][_0xb6b7('0x41')]){_0x35597b['where']=_[_0xb6b7('0x42')](_0x35597b[_0xb6b7('0x3f')],{'$or':_[_0xb6b7('0x2e')](_0x35597b[_0xb6b7('0x38')],function(_0x38fb5d){var _0xfbc5d7={};_0xfbc5d7[_0x38fb5d]={'$like':'%'+_0x387ed1[_0xb6b7('0x35')][_0xb6b7('0x41')]+'%'};return _0xfbc5d7;})});}_0x35597b=_['merge']({},_0x35597b,_0x387ed1['options']);return _0x38fa09[_0xb6b7('0x53')](_0x35597b);}})['then'](function(_0x4d3bcb){if(_0x4d3bcb){_0x1b28a2=_0x4d3bcb[_0xb6b7('0x3a')];if(!_0x387ed1[_0xb6b7('0x35')][_0xb6b7('0x3b')](_0xb6b7('0x3c'))){_0x35597b[_0xb6b7('0x22')]=qs['limit'](_0x387ed1['query'][_0xb6b7('0x22')]);_0x35597b[_0xb6b7('0x20')]=qs[_0xb6b7('0x20')](_0x387ed1['query'][_0xb6b7('0x20')]);}return _0x38fa09[_0xb6b7('0x53')](_0x35597b);}})[_0xb6b7('0x29')](function(_0x40e61a){if(_0x40e61a){return _0x40e61a?{'count':_0x1b28a2,'rows':_0x40e61a}:null;}})[_0xb6b7('0x29')](respondWithResult(_0x5b9709,null))[_0xb6b7('0x48')](handleError(_0x5b9709,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 3bddf14..bd74e83 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 _0x4127=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0x5515ef,_0x50ab84){var _0x112f85=function(_0x4a8f33){while(--_0x4a8f33){_0x5515ef['push'](_0x5515ef['shift']());}};_0x112f85(++_0x50ab84);}(_0x4127,0x155));var _0x7412=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x4127[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x7412('0x0'));var util=require('util');var logger=require(_0x7412('0x1'))(_0x7412('0x2'));var moment=require(_0x7412('0x3'));var BPromise=require(_0x7412('0x4'));var rp=require(_0x7412('0x5'));var fs=require('fs');var path=require(_0x7412('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7412('0x7'));module['exports']=function(_0x466a4e,_0x535594){return _0x466a4e[_0x7412('0x8')](_0x7412('0x9'),attributes,{'tableName':_0x7412('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf8=['bluebird','path','rimraf','int_vtiger_configurations','lodash','util','../../config/logger','api'];(function(_0x5ae28c,_0x562cd7){var _0x1bf066=function(_0x1e070b){while(--_0x1e070b){_0x5ae28c['push'](_0x5ae28c['shift']());}};_0x1bf066(++_0x562cd7);}(_0xbaf8,0x6c));var _0x8baf=function(_0x2adae0,_0x4fa150){_0x2adae0=_0x2adae0-0x0;var _0x4bbb68=_0xbaf8[_0x2adae0];return _0x4bbb68;};'use strict';var _=require(_0x8baf('0x0'));var util=require(_0x8baf('0x1'));var logger=require(_0x8baf('0x2'))(_0x8baf('0x3'));var moment=require('moment');var BPromise=require(_0x8baf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8baf('0x5'));var rimraf=require(_0x8baf('0x6'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x150b75,_0x871cd5){return _0x150b75['define']('VtigerConfiguration',attributes,{'tableName':_0x8baf('0x7'),'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 02c8870..260d66b 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 _0x9b0d=['info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request'];(function(_0x2a44dc,_0x3674a2){var _0x3d9e9f=function(_0x3a4b5f){while(--_0x3a4b5f){_0x2a44dc['push'](_0x2a44dc['shift']());}};_0x3d9e9f(++_0x3674a2);}(_0x9b0d,0x1ab));var _0xd9b0=function(_0x5e5cff,_0x36685d){_0x5e5cff=_0x5e5cff-0x0;var _0x27777d=_0x9b0d[_0x5e5cff];return _0x27777d;};'use strict';var _=require(_0xd9b0('0x0'));var util=require('util');var moment=require(_0xd9b0('0x1'));var BPromise=require(_0xd9b0('0x2'));var rs=require(_0xd9b0('0x3'));var fs=require('fs');var Redis=require(_0xd9b0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd9b0('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xd9b0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd9b0('0x7')][_0xd9b0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c00d3,_0x512594,_0x8576e3){return new BPromise(function(_0xd71f52,_0x1aad8f){return client[_0xd9b0('0x9')](_0x4c00d3,_0x8576e3)['then'](function(_0x4e94d9){logger[_0xd9b0('0xa')](_0xd9b0('0xb'),_0x512594,_0xd9b0('0xc'));logger[_0xd9b0('0xd')](_0xd9b0('0xe'),_0x512594,_0xd9b0('0xc'),JSON[_0xd9b0('0xf')](_0x4e94d9));if(_0x4e94d9[_0xd9b0('0x10')]){if(_0x4e94d9[_0xd9b0('0x10')]['code']===0x1f4){logger[_0xd9b0('0x10')](_0xd9b0('0xb'),_0x512594,_0x4e94d9[_0xd9b0('0x10')][_0xd9b0('0x11')]);return _0x1aad8f(_0x4e94d9[_0xd9b0('0x10')][_0xd9b0('0x11')]);}logger[_0xd9b0('0x10')](_0xd9b0('0xb'),_0x512594,_0x4e94d9[_0xd9b0('0x10')][_0xd9b0('0x11')]);return _0xd71f52(_0x4e94d9['error'][_0xd9b0('0x11')]);}else{logger[_0xd9b0('0xa')](_0xd9b0('0xb'),_0x512594,_0xd9b0('0xc'));_0xd71f52(_0x4e94d9['result']['message']);}})[_0xd9b0('0x12')](function(_0x2c23e8){logger[_0xd9b0('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x512594,_0x2c23e8);_0x1aad8f(_0x2c23e8);});});} \ No newline at end of file +var _0x800c=['http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x3d47e4,_0x1d1751){var _0x4c82a6=function(_0x105e56){while(--_0x105e56){_0x3d47e4['push'](_0x3d47e4['shift']());}};_0x4c82a6(++_0x1d1751);}(_0x800c,0x1ee));var _0xc800=function(_0x17f52c,_0x50d040){_0x17f52c=_0x17f52c-0x0;var _0x48b0dd=_0x800c[_0x17f52c];return _0x48b0dd;};'use strict';var _=require(_0xc800('0x0'));var util=require(_0xc800('0x1'));var moment=require(_0xc800('0x2'));var BPromise=require(_0xc800('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc800('0x4'));var db=require(_0xc800('0x5'))['db'];var utils=require(_0xc800('0x6'));var logger=require('../../config/logger')(_0xc800('0x7'));var config=require('../../config/environment');var jayson=require(_0xc800('0x8'));var client=jayson[_0xc800('0x9')][_0xc800('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xafacfb,_0x1f77ba,_0x4bc1c5){return new BPromise(function(_0x152aeb,_0x1013a2){return client[_0xc800('0xb')](_0xafacfb,_0x4bc1c5)['then'](function(_0x1f901c){logger[_0xc800('0xc')](_0xc800('0xd'),_0x1f77ba,_0xc800('0xe'));logger[_0xc800('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x1f77ba,'request\x20sent',JSON['stringify'](_0x1f901c));if(_0x1f901c[_0xc800('0x10')]){if(_0x1f901c[_0xc800('0x10')][_0xc800('0x11')]===0x1f4){logger[_0xc800('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x1f77ba,_0x1f901c[_0xc800('0x10')][_0xc800('0x12')]);return _0x1013a2(_0x1f901c[_0xc800('0x10')][_0xc800('0x12')]);}logger[_0xc800('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x1f77ba,_0x1f901c['error'][_0xc800('0x12')]);return _0x152aeb(_0x1f901c['error'][_0xc800('0x12')]);}else{logger[_0xc800('0xc')](_0xc800('0xd'),_0x1f77ba,_0xc800('0xe'));_0x152aeb(_0x1f901c[_0xc800('0x13')][_0xc800('0x12')]);}})[_0xc800('0x14')](function(_0x441fb0){logger[_0xc800('0x10')](_0xc800('0xd'),_0x1f77ba,_0x441fb0);_0x1013a2(_0x441fb0);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index ab1b99f..55da814 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 _0xa8e8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','show','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x2e325a,_0x4133f7){var _0x14e8c6=function(_0x1cc015){while(--_0x1cc015){_0x2e325a['push'](_0x2e325a['shift']());}};_0x14e8c6(++_0x4133f7);}(_0xa8e8,0xf2));var _0x8a8e=function(_0x47a385,_0x5d8781){_0x47a385=_0x47a385-0x0;var _0x31abb9=_0xa8e8[_0x47a385];return _0x31abb9;};'use strict';var multer=require(_0x8a8e('0x0'));var util=require(_0x8a8e('0x1'));var path=require(_0x8a8e('0x2'));var timeout=require(_0x8a8e('0x3'));var express=require('express');var router=express[_0x8a8e('0x4')]();var fs_extra=require(_0x8a8e('0x5'));var auth=require(_0x8a8e('0x6'));var interaction=require(_0x8a8e('0x7'));var config=require(_0x8a8e('0x8'));var controller=require(_0x8a8e('0x9'));router[_0x8a8e('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8a8e('0xa')]('/:id',auth[_0x8a8e('0xb')](),controller[_0x8a8e('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8a8e('0xd')]);router[_0x8a8e('0xe')](_0x8a8e('0xf'),auth[_0x8a8e('0xb')](),controller['update']);router[_0x8a8e('0x10')](_0x8a8e('0xf'),auth[_0x8a8e('0xb')](),controller[_0x8a8e('0x11')]);module[_0x8a8e('0x12')]=router; \ No newline at end of file +var _0x9289=['/:id','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','show','post','put','update'];(function(_0x17aad1,_0x53161b){var _0x260253=function(_0x1f6b98){while(--_0x1f6b98){_0x17aad1['push'](_0x17aad1['shift']());}};_0x260253(++_0x53161b);}(_0x9289,0x1e9));var _0x9928=function(_0x5e522a,_0x117612){_0x5e522a=_0x5e522a-0x0;var _0xd20438=_0x9289[_0x5e522a];return _0xd20438;};'use strict';var multer=require(_0x9928('0x0'));var util=require(_0x9928('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9928('0x2'));var router=express[_0x9928('0x3')]();var fs_extra=require(_0x9928('0x4'));var auth=require(_0x9928('0x5'));var interaction=require(_0x9928('0x6'));var config=require('../../config/environment');var controller=require(_0x9928('0x7'));router[_0x9928('0x8')]('/',auth[_0x9928('0x9')](),controller[_0x9928('0xa')]);router['get']('/:id',auth[_0x9928('0x9')](),controller[_0x9928('0xb')]);router[_0x9928('0xc')]('/',auth[_0x9928('0x9')](),controller['create']);router[_0x9928('0xd')]('/:id',auth[_0x9928('0x9')](),controller[_0x9928('0xe')]);router['delete'](_0x9928('0xf'),auth['isAuthenticated'](),controller[_0x9928('0x10')]);module[_0x9928('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index ca91d5c..bd40059 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 _0x4c83=['sequelize','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN'];(function(_0x3534cd,_0x2f5a2b){var _0x4194ad=function(_0x22c4af){while(--_0x22c4af){_0x3534cd['push'](_0x3534cd['shift']());}};_0x4194ad(++_0x2f5a2b);}(_0x4c83,0x10e));var _0x34c8=function(_0x1d38dd,_0x38c611){_0x1d38dd=_0x1d38dd-0x0;var _0x551cbe=_0x4c83[_0x1d38dd];return _0x551cbe;};'use strict';var Sequelize=require(_0x34c8('0x0'));module['exports']={'type':{'type':Sequelize[_0x34c8('0x1')]('string',_0x34c8('0x2'),_0x34c8('0x3'),_0x34c8('0x4'),_0x34c8('0x5')),'defaultValue':_0x34c8('0x6')},'content':{'type':Sequelize[_0x34c8('0x7')]},'key':{'type':Sequelize[_0x34c8('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x34c8('0x6'),_0x34c8('0x2'),_0x34c8('0x3'))},'keyContent':{'type':Sequelize[_0x34c8('0x7')]},'idField':{'type':Sequelize[_0x34c8('0x7')]},'nameField':{'type':Sequelize[_0x34c8('0x7')]},'customField':{'type':Sequelize[_0x34c8('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x34c8('0x7')]}}; \ No newline at end of file +var _0xd8df=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','sequelize'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0xd8df,0x1cf));var _0xfd8d=function(_0x45d3e5,_0x1645e3){_0x45d3e5=_0x45d3e5-0x0;var _0x31dcac=_0xd8df[_0x45d3e5];return _0x31dcac;};'use strict';var Sequelize=require(_0xfd8d('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xfd8d('0x1'),_0xfd8d('0x2'),_0xfd8d('0x3'),_0xfd8d('0x4'),_0xfd8d('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xfd8d('0x6')]},'key':{'type':Sequelize[_0xfd8d('0x6')]},'keyType':{'type':Sequelize[_0xfd8d('0x7')](_0xfd8d('0x1'),_0xfd8d('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xfd8d('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfd8d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 910a31a..1d3f7ff 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 _0xb533=['index','map','VtigerField','key','query','intersection','model','attributes','fields','length','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','options','find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','error','name','send'];(function(_0x19bc4e,_0x106558){var _0x358aed=function(_0x2958c8){while(--_0x2958c8){_0x19bc4e['push'](_0x19bc4e['shift']());}};_0x358aed(++_0x106558);}(_0xb533,0x136));var _0x3b53=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb533[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b53('0x0'));var zipdir=require(_0x3b53('0x1'));var jsonpatch=require(_0x3b53('0x2'));var rp=require(_0x3b53('0x3'));var moment=require(_0x3b53('0x4'));var BPromise=require(_0x3b53('0x5'));var Mustache=require(_0x3b53('0x6'));var util=require(_0x3b53('0x7'));var path=require('path');var sox=require(_0x3b53('0x8'));var csv=require(_0x3b53('0x9'));var ejs=require(_0x3b53('0xa'));var fs=require('fs');var fs_extra=require(_0x3b53('0xb'));var _=require('lodash');var squel=require(_0x3b53('0xc'));var crypto=require(_0x3b53('0xd'));var jsforce=require(_0x3b53('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3b53('0x9'));var querystring=require('querystring');var Papa=require(_0x3b53('0xf'));var Redis=require('ioredis');var authService=require(_0x3b53('0x10'));var qs=require(_0x3b53('0x11'));var as=require(_0x3b53('0x12'));var hardwareService=require(_0x3b53('0x13'));var logger=require(_0x3b53('0x14'))(_0x3b53('0x15'));var utils=require(_0x3b53('0x16'));var config=require(_0x3b53('0x17'));var licenseUtil=require(_0x3b53('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3127a6,_0x334f2f){_0x334f2f=_0x334f2f||0xcc;return function(_0x29d272){if(_0x29d272){return _0x3127a6[_0x3b53('0x19')](_0x334f2f);}return _0x3127a6[_0x3b53('0x1a')](_0x334f2f)[_0x3b53('0x1b')]();};}function respondWithResult(_0x530ed2,_0x57eb78){_0x57eb78=_0x57eb78||0xc8;return function(_0x16a962){if(_0x16a962){return _0x530ed2[_0x3b53('0x1a')](_0x57eb78)['json'](_0x16a962);}};}function respondWithFilteredResult(_0x1de7d8,_0xa9c000){return function(_0x10723e){if(_0x10723e){var _0x369565=typeof _0xa9c000[_0x3b53('0x1c')]===_0x3b53('0x1d')&&typeof _0xa9c000[_0x3b53('0x1e')]===_0x3b53('0x1d');var _0x415764=_0x10723e['count'];var _0x12eb60=_0x369565?0x0:_0xa9c000[_0x3b53('0x1c')];var _0x2373d0=_0x369565?_0x10723e[_0x3b53('0x1f')]:_0xa9c000[_0x3b53('0x1c')]+_0xa9c000[_0x3b53('0x1e')];var _0x1ea97c;if(_0x2373d0>=_0x415764){_0x2373d0=_0x415764;_0x1ea97c=0xc8;}else{_0x1ea97c=0xce;}_0x1de7d8['status'](_0x1ea97c);return _0x1de7d8[_0x3b53('0x20')](_0x3b53('0x21'),_0x12eb60+'-'+_0x2373d0+'/'+_0x415764)[_0x3b53('0x22')](_0x10723e);}return null;};}function patchUpdates(_0x260a17){return function(_0x33ebba){try{jsonpatch['apply'](_0x33ebba,_0x260a17,!![]);}catch(_0x9d56d2){return BPromise['reject'](_0x9d56d2);}return _0x33ebba['save']();};}function saveUpdates(_0x539175,_0xbc8d98){return function(_0x51e8cb){if(_0x51e8cb){return _0x51e8cb[_0x3b53('0x23')](_0x539175)[_0x3b53('0x24')](function(_0x2c3a0e){return _0x2c3a0e;});}return null;};}function removeEntity(_0x4b0376,_0x5c94f4){return function(_0x42b57e){if(_0x42b57e){return _0x42b57e['destroy']()[_0x3b53('0x24')](function(){_0x4b0376[_0x3b53('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45c29c,_0x168ca7){return function(_0x1a2428){if(!_0x1a2428){_0x45c29c['sendStatus'](0x194);}return _0x1a2428;};}function handleError(_0x86e96e,_0x4f4a29){_0x4f4a29=_0x4f4a29||0x1f4;return function(_0xd20280){logger[_0x3b53('0x25')](_0xd20280['stack']);if(_0xd20280[_0x3b53('0x26')]){delete _0xd20280[_0x3b53('0x26')];}_0x86e96e[_0x3b53('0x1a')](_0x4f4a29)[_0x3b53('0x27')](_0xd20280);};}exports[_0x3b53('0x28')]=function(_0x1cae37,_0x5cf2d0){var _0x34a8ba={},_0x2da5fd={},_0x3a28a9={'count':0x0,'rows':[]};var _0x13b702=_[_0x3b53('0x29')](db[_0x3b53('0x2a')]['rawAttributes'],function(_0x51b30f){return{'name':_0x51b30f['fieldName'],'type':_0x51b30f['type'][_0x3b53('0x2b')]};});_0x2da5fd['model']=_[_0x3b53('0x29')](_0x13b702,'name');_0x2da5fd[_0x3b53('0x2c')]=_['keys'](_0x1cae37['query']);_0x2da5fd['filters']=_[_0x3b53('0x2d')](_0x2da5fd[_0x3b53('0x2e')],_0x2da5fd[_0x3b53('0x2c')]);_0x34a8ba[_0x3b53('0x2f')]=_[_0x3b53('0x2d')](_0x2da5fd[_0x3b53('0x2e')],qs[_0x3b53('0x30')](_0x1cae37['query']['fields']));_0x34a8ba[_0x3b53('0x2f')]=_0x34a8ba[_0x3b53('0x2f')][_0x3b53('0x31')]?_0x34a8ba[_0x3b53('0x2f')]:_0x2da5fd[_0x3b53('0x2e')];if(!_0x1cae37[_0x3b53('0x2c')]['hasOwnProperty'](_0x3b53('0x32'))){_0x34a8ba[_0x3b53('0x1e')]=qs[_0x3b53('0x1e')](_0x1cae37['query']['limit']);_0x34a8ba[_0x3b53('0x1c')]=qs['offset'](_0x1cae37[_0x3b53('0x2c')][_0x3b53('0x1c')]);}_0x34a8ba[_0x3b53('0x33')]=qs['sort'](_0x1cae37['query']['sort']);_0x34a8ba['where']=qs[_0x3b53('0x34')](_[_0x3b53('0x35')](_0x1cae37['query'],_0x2da5fd['filters']),_0x13b702);if(_0x1cae37[_0x3b53('0x2c')][_0x3b53('0x36')]){_0x34a8ba[_0x3b53('0x37')]=_[_0x3b53('0x38')](_0x34a8ba['where'],{'$or':_['map'](_0x13b702,function(_0x1c32c6){if(_0x1c32c6['type']!==_0x3b53('0x39')){var _0x3f1754={};_0x3f1754[_0x1c32c6[_0x3b53('0x26')]]={'$like':'%'+_0x1cae37[_0x3b53('0x2c')]['filter']+'%'};return _0x3f1754;}})});}_0x34a8ba=_[_0x3b53('0x38')]({},_0x34a8ba,_0x1cae37['options']);var _0x3f7c6c={'where':_0x34a8ba[_0x3b53('0x37')]};return db[_0x3b53('0x2a')][_0x3b53('0x1f')](_0x3f7c6c)[_0x3b53('0x24')](function(_0x21f22e){_0x3a28a9[_0x3b53('0x1f')]=_0x21f22e;if(_0x1cae37['query'][_0x3b53('0x3a')]){_0x34a8ba[_0x3b53('0x3b')]=[{'all':!![]}];}return db[_0x3b53('0x2a')][_0x3b53('0x3c')](_0x34a8ba);})[_0x3b53('0x24')](function(_0x12f072){_0x3a28a9[_0x3b53('0x3d')]=_0x12f072;return _0x3a28a9;})[_0x3b53('0x24')](respondWithFilteredResult(_0x5cf2d0,_0x34a8ba))['catch'](handleError(_0x5cf2d0,null));};exports['show']=function(_0x18cc84,_0x23296b){var _0x5aa3a3={'raw':!![],'where':{'id':_0x18cc84[_0x3b53('0x3e')]['id']}},_0x307096={};_0x307096[_0x3b53('0x2e')]=_[_0x3b53('0x3f')](db[_0x3b53('0x2a')]['rawAttributes']);_0x307096[_0x3b53('0x2c')]=_[_0x3b53('0x3f')](_0x18cc84['query']);_0x307096['filters']=_['intersection'](_0x307096[_0x3b53('0x2e')],_0x307096[_0x3b53('0x2c')]);_0x5aa3a3[_0x3b53('0x2f')]=_[_0x3b53('0x2d')](_0x307096[_0x3b53('0x2e')],qs[_0x3b53('0x30')](_0x18cc84[_0x3b53('0x2c')][_0x3b53('0x30')]));_0x5aa3a3[_0x3b53('0x2f')]=_0x5aa3a3['attributes']['length']?_0x5aa3a3[_0x3b53('0x2f')]:_0x307096[_0x3b53('0x2e')];if(_0x18cc84[_0x3b53('0x2c')][_0x3b53('0x3a')]){_0x5aa3a3[_0x3b53('0x3b')]=[{'all':!![]}];}_0x5aa3a3=_[_0x3b53('0x38')]({},_0x5aa3a3,_0x18cc84[_0x3b53('0x40')]);return db[_0x3b53('0x2a')][_0x3b53('0x41')](_0x5aa3a3)['then'](handleEntityNotFound(_0x23296b,null))[_0x3b53('0x24')](respondWithResult(_0x23296b,null))[_0x3b53('0x42')](handleError(_0x23296b,null));};exports[_0x3b53('0x43')]=function(_0x4d2f6f,_0x4ef25e){return db[_0x3b53('0x2a')][_0x3b53('0x43')](_0x4d2f6f[_0x3b53('0x44')],{})[_0x3b53('0x24')](respondWithResult(_0x4ef25e,0xc9))['catch'](handleError(_0x4ef25e,null));};exports['update']=function(_0x58ce90,_0x1bce6f){if(_0x58ce90[_0x3b53('0x44')]['id']){delete _0x58ce90[_0x3b53('0x44')]['id'];}return db[_0x3b53('0x2a')][_0x3b53('0x41')]({'where':{'id':_0x58ce90[_0x3b53('0x3e')]['id']}})[_0x3b53('0x24')](handleEntityNotFound(_0x1bce6f,null))[_0x3b53('0x24')](saveUpdates(_0x58ce90[_0x3b53('0x44')],null))[_0x3b53('0x24')](respondWithResult(_0x1bce6f,null))[_0x3b53('0x42')](handleError(_0x1bce6f,null));};exports[_0x3b53('0x45')]=function(_0xe85750,_0x278bb6){return db[_0x3b53('0x2a')][_0x3b53('0x41')]({'where':{'id':_0xe85750['params']['id']}})['then'](handleEntityNotFound(_0x278bb6,null))[_0x3b53('0x24')](removeEntity(_0x278bb6,null))[_0x3b53('0x42')](handleError(_0x278bb6,null));}; \ No newline at end of file +var _0x4d12=['order','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','update','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4d12,0xb2));var _0x24d1=function(_0x5ccca1,_0x2edd54){_0x5ccca1=_0x5ccca1-0x0;var _0x411308=_0x4d12[_0x5ccca1];return _0x411308;};'use strict';var emlformat=require(_0x24d1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x24d1('0x1'));var jsonpatch=require(_0x24d1('0x2'));var rp=require(_0x24d1('0x3'));var moment=require(_0x24d1('0x4'));var BPromise=require(_0x24d1('0x5'));var Mustache=require(_0x24d1('0x6'));var util=require('util');var path=require(_0x24d1('0x7'));var sox=require(_0x24d1('0x8'));var csv=require(_0x24d1('0x9'));var ejs=require(_0x24d1('0xa'));var fs=require('fs');var fs_extra=require(_0x24d1('0xb'));var _=require(_0x24d1('0xc'));var squel=require('squel');var crypto=require(_0x24d1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x24d1('0xe'));var toCsv=require(_0x24d1('0x9'));var querystring=require(_0x24d1('0xf'));var Papa=require(_0x24d1('0x10'));var Redis=require(_0x24d1('0x11'));var authService=require(_0x24d1('0x12'));var qs=require(_0x24d1('0x13'));var as=require(_0x24d1('0x14'));var hardwareService=require(_0x24d1('0x15'));var logger=require(_0x24d1('0x16'))(_0x24d1('0x17'));var utils=require(_0x24d1('0x18'));var config=require(_0x24d1('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x24d1('0x1a'))['db'];function respondWithStatusCode(_0x3a2f41,_0x3c2f61){_0x3c2f61=_0x3c2f61||0xcc;return function(_0x54de3d){if(_0x54de3d){return _0x3a2f41['sendStatus'](_0x3c2f61);}return _0x3a2f41[_0x24d1('0x1b')](_0x3c2f61)[_0x24d1('0x1c')]();};}function respondWithResult(_0x3634b1,_0x3df1c9){_0x3df1c9=_0x3df1c9||0xc8;return function(_0x43c48f){if(_0x43c48f){return _0x3634b1[_0x24d1('0x1b')](_0x3df1c9)[_0x24d1('0x1d')](_0x43c48f);}};}function respondWithFilteredResult(_0x3e7d21,_0x200882){return function(_0x2853c2){if(_0x2853c2){var _0x154701=typeof _0x200882[_0x24d1('0x1e')]===_0x24d1('0x1f')&&typeof _0x200882[_0x24d1('0x20')]===_0x24d1('0x1f');var _0x514b2e=_0x2853c2[_0x24d1('0x21')];var _0x6d83ba=_0x154701?0x0:_0x200882[_0x24d1('0x1e')];var _0x2972db=_0x154701?_0x2853c2[_0x24d1('0x21')]:_0x200882[_0x24d1('0x1e')]+_0x200882[_0x24d1('0x20')];var _0x282753;if(_0x2972db>=_0x514b2e){_0x2972db=_0x514b2e;_0x282753=0xc8;}else{_0x282753=0xce;}_0x3e7d21['status'](_0x282753);return _0x3e7d21[_0x24d1('0x22')](_0x24d1('0x23'),_0x6d83ba+'-'+_0x2972db+'/'+_0x514b2e)[_0x24d1('0x1d')](_0x2853c2);}return null;};}function patchUpdates(_0x3a57cb){return function(_0x3360c0){try{jsonpatch['apply'](_0x3360c0,_0x3a57cb,!![]);}catch(_0x48f2b0){return BPromise[_0x24d1('0x24')](_0x48f2b0);}return _0x3360c0[_0x24d1('0x25')]();};}function saveUpdates(_0x5d771e,_0x202ae4){return function(_0x3b1638){if(_0x3b1638){return _0x3b1638['update'](_0x5d771e)[_0x24d1('0x26')](function(_0x5e1c66){return _0x5e1c66;});}return null;};}function removeEntity(_0x211068,_0x56999b){return function(_0x46521e){if(_0x46521e){return _0x46521e[_0x24d1('0x27')]()[_0x24d1('0x26')](function(){_0x211068[_0x24d1('0x1b')](0xcc)[_0x24d1('0x1c')]();});}};}function handleEntityNotFound(_0x26ae62,_0xb3a10c){return function(_0x307b15){if(!_0x307b15){_0x26ae62[_0x24d1('0x28')](0x194);}return _0x307b15;};}function handleError(_0x2c0425,_0x569592){_0x569592=_0x569592||0x1f4;return function(_0x1cb322){logger[_0x24d1('0x29')](_0x1cb322[_0x24d1('0x2a')]);if(_0x1cb322[_0x24d1('0x2b')]){delete _0x1cb322[_0x24d1('0x2b')];}_0x2c0425[_0x24d1('0x1b')](_0x569592)[_0x24d1('0x2c')](_0x1cb322);};}exports[_0x24d1('0x2d')]=function(_0x40db86,_0x2e6e1c){var _0x34b58e={},_0x369c7c={},_0x2105d6={'count':0x0,'rows':[]};var _0x3dfa85=_[_0x24d1('0x2e')](db[_0x24d1('0x2f')][_0x24d1('0x30')],function(_0x1d61a8){return{'name':_0x1d61a8[_0x24d1('0x31')],'type':_0x1d61a8['type'][_0x24d1('0x32')]};});_0x369c7c[_0x24d1('0x33')]=_['map'](_0x3dfa85,_0x24d1('0x2b'));_0x369c7c[_0x24d1('0x34')]=_['keys'](_0x40db86[_0x24d1('0x34')]);_0x369c7c[_0x24d1('0x35')]=_['intersection'](_0x369c7c[_0x24d1('0x33')],_0x369c7c['query']);_0x34b58e['attributes']=_[_0x24d1('0x36')](_0x369c7c[_0x24d1('0x33')],qs[_0x24d1('0x37')](_0x40db86[_0x24d1('0x34')][_0x24d1('0x37')]));_0x34b58e[_0x24d1('0x38')]=_0x34b58e[_0x24d1('0x38')]['length']?_0x34b58e['attributes']:_0x369c7c[_0x24d1('0x33')];if(!_0x40db86['query'][_0x24d1('0x39')](_0x24d1('0x3a'))){_0x34b58e[_0x24d1('0x20')]=qs['limit'](_0x40db86['query'][_0x24d1('0x20')]);_0x34b58e[_0x24d1('0x1e')]=qs['offset'](_0x40db86[_0x24d1('0x34')]['offset']);}_0x34b58e[_0x24d1('0x3b')]=qs[_0x24d1('0x3c')](_0x40db86[_0x24d1('0x34')][_0x24d1('0x3c')]);_0x34b58e[_0x24d1('0x3d')]=qs[_0x24d1('0x35')](_[_0x24d1('0x3e')](_0x40db86['query'],_0x369c7c[_0x24d1('0x35')]),_0x3dfa85);if(_0x40db86[_0x24d1('0x34')][_0x24d1('0x3f')]){_0x34b58e['where']=_[_0x24d1('0x40')](_0x34b58e['where'],{'$or':_[_0x24d1('0x2e')](_0x3dfa85,function(_0x51a269){if(_0x51a269[_0x24d1('0x41')]!=='VIRTUAL'){var _0x1b58c0={};_0x1b58c0[_0x51a269[_0x24d1('0x2b')]]={'$like':'%'+_0x40db86[_0x24d1('0x34')][_0x24d1('0x3f')]+'%'};return _0x1b58c0;}})});}_0x34b58e=_['merge']({},_0x34b58e,_0x40db86[_0x24d1('0x42')]);var _0x5c8833={'where':_0x34b58e[_0x24d1('0x3d')]};return db['VtigerField'][_0x24d1('0x21')](_0x5c8833)[_0x24d1('0x26')](function(_0x3264bb){_0x2105d6[_0x24d1('0x21')]=_0x3264bb;if(_0x40db86[_0x24d1('0x34')]['includeAll']){_0x34b58e[_0x24d1('0x43')]=[{'all':!![]}];}return db[_0x24d1('0x2f')][_0x24d1('0x44')](_0x34b58e);})[_0x24d1('0x26')](function(_0x36998a){_0x2105d6[_0x24d1('0x45')]=_0x36998a;return _0x2105d6;})[_0x24d1('0x26')](respondWithFilteredResult(_0x2e6e1c,_0x34b58e))[_0x24d1('0x46')](handleError(_0x2e6e1c,null));};exports[_0x24d1('0x47')]=function(_0x1ac0d8,_0xf301db){var _0x5b5cff={'raw':!![],'where':{'id':_0x1ac0d8['params']['id']}},_0x41b59e={};_0x41b59e['model']=_['keys'](db['VtigerField'][_0x24d1('0x30')]);_0x41b59e[_0x24d1('0x34')]=_[_0x24d1('0x48')](_0x1ac0d8[_0x24d1('0x34')]);_0x41b59e[_0x24d1('0x35')]=_[_0x24d1('0x36')](_0x41b59e[_0x24d1('0x33')],_0x41b59e[_0x24d1('0x34')]);_0x5b5cff['attributes']=_[_0x24d1('0x36')](_0x41b59e[_0x24d1('0x33')],qs[_0x24d1('0x37')](_0x1ac0d8['query'][_0x24d1('0x37')]));_0x5b5cff['attributes']=_0x5b5cff[_0x24d1('0x38')]['length']?_0x5b5cff[_0x24d1('0x38')]:_0x41b59e['model'];if(_0x1ac0d8[_0x24d1('0x34')][_0x24d1('0x49')]){_0x5b5cff['include']=[{'all':!![]}];}_0x5b5cff=_[_0x24d1('0x40')]({},_0x5b5cff,_0x1ac0d8[_0x24d1('0x42')]);return db[_0x24d1('0x2f')][_0x24d1('0x4a')](_0x5b5cff)[_0x24d1('0x26')](handleEntityNotFound(_0xf301db,null))['then'](respondWithResult(_0xf301db,null))[_0x24d1('0x46')](handleError(_0xf301db,null));};exports[_0x24d1('0x4b')]=function(_0x4b4eab,_0x4c2816){return db[_0x24d1('0x2f')][_0x24d1('0x4b')](_0x4b4eab[_0x24d1('0x4c')],{})[_0x24d1('0x26')](respondWithResult(_0x4c2816,0xc9))['catch'](handleError(_0x4c2816,null));};exports[_0x24d1('0x4d')]=function(_0x22d4d3,_0x164d17){if(_0x22d4d3[_0x24d1('0x4c')]['id']){delete _0x22d4d3['body']['id'];}return db[_0x24d1('0x2f')][_0x24d1('0x4a')]({'where':{'id':_0x22d4d3[_0x24d1('0x4e')]['id']}})[_0x24d1('0x26')](handleEntityNotFound(_0x164d17,null))[_0x24d1('0x26')](saveUpdates(_0x22d4d3[_0x24d1('0x4c')],null))[_0x24d1('0x26')](respondWithResult(_0x164d17,null))[_0x24d1('0x46')](handleError(_0x164d17,null));};exports[_0x24d1('0x27')]=function(_0x1c49a3,_0x291cfe){return db['VtigerField'][_0x24d1('0x4a')]({'where':{'id':_0x1c49a3[_0x24d1('0x4e')]['id']}})[_0x24d1('0x26')](handleEntityNotFound(_0x291cfe,null))[_0x24d1('0x26')](removeEntity(_0x291cfe,null))[_0x24d1('0x46')](handleError(_0x291cfe,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 2cf8505..39f40a4 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 _0x19ab=['VtigerField','int_vtiger_fields','idField','FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports'];(function(_0x132a9a,_0x4da489){var _0x9dd201=function(_0x20435d){while(--_0x20435d){_0x132a9a['push'](_0x132a9a['shift']());}};_0x9dd201(++_0x4da489);}(_0x19ab,0x1ee));var _0xb19a=function(_0x375322,_0x48ee35){_0x375322=_0x375322-0x0;var _0x2fb07e=_0x19ab[_0x375322];return _0x2fb07e;};'use strict';var _=require(_0xb19a('0x0'));var util=require(_0xb19a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb19a('0x2'));var BPromise=require(_0xb19a('0x3'));var rp=require(_0xb19a('0x4'));var fs=require('fs');var path=require(_0xb19a('0x5'));var rimraf=require(_0xb19a('0x6'));var config=require(_0xb19a('0x7'));var attributes=require(_0xb19a('0x8'));module[_0xb19a('0x9')]=function(_0x1b6bd9,_0x3c27a1){return _0x1b6bd9['define'](_0xb19a('0xa'),attributes,{'tableName':_0xb19a('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xb19a('0xc'),_0xb19a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb691=['moment','bluebird','request-promise','path','rimraf','./intVtigerField.attributes','int_vtiger_fields','vtiger_unique_index','idField','api'];(function(_0xee5d2a,_0x534134){var _0x346948=function(_0x458fdf){while(--_0x458fdf){_0xee5d2a['push'](_0xee5d2a['shift']());}};_0x346948(++_0x534134);}(_0xb691,0x1ad));var _0x1b69=function(_0x2a3c0a,_0x163f5c){_0x2a3c0a=_0x2a3c0a-0x0;var _0x1703a2=_0xb691[_0x2a3c0a];return _0x1703a2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1b69('0x0'));var moment=require(_0x1b69('0x1'));var BPromise=require(_0x1b69('0x2'));var rp=require(_0x1b69('0x3'));var fs=require('fs');var path=require(_0x1b69('0x4'));var rimraf=require(_0x1b69('0x5'));var config=require('../../config/environment');var attributes=require(_0x1b69('0x6'));module['exports']=function(_0xd821c,_0x1f7516){return _0xd821c['define']('VtigerField',attributes,{'tableName':_0x1b69('0x7'),'paranoid':![],'indexes':[{'name':_0x1b69('0x8'),'fields':[_0x1b69('0x9'),'FieldId'],'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 97ff563..9d72c54 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 _0x8ddb=['http','request','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x198b63,_0x2fa09d){var _0x43544b=function(_0x314506){while(--_0x314506){_0x198b63['push'](_0x198b63['shift']());}};_0x43544b(++_0x2fa09d);}(_0x8ddb,0xe8));var _0xb8dd=function(_0xf8baeb,_0x4c83e8){_0xf8baeb=_0xf8baeb-0x0;var _0x5997a4=_0x8ddb[_0xf8baeb];return _0x5997a4;};'use strict';var _=require(_0xb8dd('0x0'));var util=require(_0xb8dd('0x1'));var moment=require(_0xb8dd('0x2'));var BPromise=require(_0xb8dd('0x3'));var rs=require(_0xb8dd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8dd('0x5'))['db'];var utils=require(_0xb8dd('0x6'));var logger=require('../../config/logger')(_0xb8dd('0x7'));var config=require(_0xb8dd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb8dd('0x9')][_0xb8dd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fd807,_0x117efa,_0x2a3668){return new BPromise(function(_0x17e49e,_0x19ce24){return client[_0xb8dd('0xb')](_0x4fd807,_0x2a3668)['then'](function(_0x473a8d){logger[_0xb8dd('0xc')]('VtigerField,\x20%s,\x20%s',_0x117efa,_0xb8dd('0xd'));logger[_0xb8dd('0xe')](_0xb8dd('0xf'),_0x117efa,_0xb8dd('0xd'),JSON[_0xb8dd('0x10')](_0x473a8d));if(_0x473a8d['error']){if(_0x473a8d[_0xb8dd('0x11')]['code']===0x1f4){logger[_0xb8dd('0x11')](_0xb8dd('0x12'),_0x117efa,_0x473a8d[_0xb8dd('0x11')][_0xb8dd('0x13')]);return _0x19ce24(_0x473a8d[_0xb8dd('0x11')][_0xb8dd('0x13')]);}logger[_0xb8dd('0x11')](_0xb8dd('0x12'),_0x117efa,_0x473a8d[_0xb8dd('0x11')][_0xb8dd('0x13')]);return _0x17e49e(_0x473a8d['error'][_0xb8dd('0x13')]);}else{logger[_0xb8dd('0xc')](_0xb8dd('0x12'),_0x117efa,_0xb8dd('0xd'));_0x17e49e(_0x473a8d[_0xb8dd('0x14')]['message']);}})[_0xb8dd('0x15')](function(_0x1333fd){logger['error'](_0xb8dd('0x12'),_0x117efa,_0x1333fd);_0x19ce24(_0x1333fd);});});} \ No newline at end of file +var _0x5efc=['request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','VtigerField,\x20%s,\x20%s','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info'];(function(_0x1634f3,_0x39354b){var _0x6f4ded=function(_0x3e3e40){while(--_0x3e3e40){_0x1634f3['push'](_0x1634f3['shift']());}};_0x6f4ded(++_0x39354b);}(_0x5efc,0x184));var _0xc5ef=function(_0x3f1d7f,_0x57bb05){_0x3f1d7f=_0x3f1d7f-0x0;var _0x5ba6da=_0x5efc[_0x3f1d7f];return _0x5ba6da;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc5ef('0x0'));var rs=require(_0xc5ef('0x1'));var fs=require('fs');var Redis=require(_0xc5ef('0x2'));var db=require(_0xc5ef('0x3'))['db'];var utils=require(_0xc5ef('0x4'));var logger=require(_0xc5ef('0x5'))('rpc');var config=require(_0xc5ef('0x6'));var jayson=require(_0xc5ef('0x7'));var client=jayson['client'][_0xc5ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58221a,_0xdaaff8,_0x2ff47e){return new BPromise(function(_0x3b8541,_0x1522c1){return client['request'](_0x58221a,_0x2ff47e)[_0xc5ef('0x9')](function(_0x58dd3c){logger[_0xc5ef('0xa')]('VtigerField,\x20%s,\x20%s',_0xdaaff8,_0xc5ef('0xb'));logger[_0xc5ef('0xc')](_0xc5ef('0xd'),_0xdaaff8,_0xc5ef('0xb'),JSON[_0xc5ef('0xe')](_0x58dd3c));if(_0x58dd3c[_0xc5ef('0xf')]){if(_0x58dd3c[_0xc5ef('0xf')]['code']===0x1f4){logger['error'](_0xc5ef('0x10'),_0xdaaff8,_0x58dd3c[_0xc5ef('0xf')][_0xc5ef('0x11')]);return _0x1522c1(_0x58dd3c[_0xc5ef('0xf')][_0xc5ef('0x11')]);}logger['error'](_0xc5ef('0x10'),_0xdaaff8,_0x58dd3c[_0xc5ef('0xf')][_0xc5ef('0x11')]);return _0x3b8541(_0x58dd3c[_0xc5ef('0xf')][_0xc5ef('0x11')]);}else{logger['info'](_0xc5ef('0x10'),_0xdaaff8,_0xc5ef('0xb'));_0x3b8541(_0x58dd3c['result'][_0xc5ef('0x11')]);}})[_0xc5ef('0x12')](function(_0x3ce502){logger[_0xc5ef('0xf')]('VtigerField,\x20%s,\x20%s',_0xdaaff8,_0x3ce502);_0x1522c1(_0x3ce502);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 4ace7e9..dcf952e 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 _0xdbd3=['/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put'];(function(_0x4acf20,_0x3f4636){var _0x50eabc=function(_0x20c518){while(--_0x20c518){_0x4acf20['push'](_0x4acf20['shift']());}};_0x50eabc(++_0x3f4636);}(_0xdbd3,0xe6));var _0x3dbd=function(_0x4d7c86,_0x9b62a6){_0x4d7c86=_0x4d7c86-0x0;var _0x59443d=_0xdbd3[_0x4d7c86];return _0x59443d;};'use strict';var multer=require(_0x3dbd('0x0'));var util=require(_0x3dbd('0x1'));var path=require(_0x3dbd('0x2'));var timeout=require('connect-timeout');var express=require(_0x3dbd('0x3'));var router=express[_0x3dbd('0x4')]();var fs_extra=require(_0x3dbd('0x5'));var auth=require(_0x3dbd('0x6'));var interaction=require(_0x3dbd('0x7'));var config=require('../../config/environment');var controller=require(_0x3dbd('0x8'));router[_0x3dbd('0x9')]('/',auth[_0x3dbd('0xa')](),controller[_0x3dbd('0xb')]);router['get']('/:id',auth[_0x3dbd('0xa')](),controller[_0x3dbd('0xc')]);router[_0x3dbd('0x9')](_0x3dbd('0xd'),auth['isAuthenticated'](),controller[_0x3dbd('0xe')]);router['get']('/:id/fields',auth[_0x3dbd('0xa')](),controller[_0x3dbd('0xf')]);router[_0x3dbd('0x10')]('/',auth[_0x3dbd('0xa')](),controller[_0x3dbd('0x11')]);router['post'](_0x3dbd('0xd'),auth[_0x3dbd('0xa')](),controller[_0x3dbd('0x12')]);router[_0x3dbd('0x13')](_0x3dbd('0x14'),auth[_0x3dbd('0xa')](),controller[_0x3dbd('0x15')]);router[_0x3dbd('0x16')](_0x3dbd('0x14'),auth[_0x3dbd('0xa')](),controller[_0x3dbd('0x17')]);module[_0x3dbd('0x18')]=router; \ No newline at end of file +var _0xee51=['express','Router','fs-extra','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x8393f9,_0x51cc11){var _0x9b7d7b=function(_0x3569c8){while(--_0x3569c8){_0x8393f9['push'](_0x8393f9['shift']());}};_0x9b7d7b(++_0x51cc11);}(_0xee51,0x7a));var _0x1ee5=function(_0x2158e5,_0x111ced){_0x2158e5=_0x2158e5-0x0;var _0x37b296=_0xee51[_0x2158e5];return _0x37b296;};'use strict';var multer=require(_0x1ee5('0x0'));var util=require(_0x1ee5('0x1'));var path=require(_0x1ee5('0x2'));var timeout=require(_0x1ee5('0x3'));var express=require(_0x1ee5('0x4'));var router=express[_0x1ee5('0x5')]();var fs_extra=require(_0x1ee5('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1ee5('0x7'));var controller=require(_0x1ee5('0x8'));router[_0x1ee5('0x9')]('/',auth[_0x1ee5('0xa')](),controller['index']);router[_0x1ee5('0x9')](_0x1ee5('0xb'),auth[_0x1ee5('0xa')](),controller[_0x1ee5('0xc')]);router[_0x1ee5('0x9')](_0x1ee5('0xd'),auth[_0x1ee5('0xa')](),controller[_0x1ee5('0xe')]);router[_0x1ee5('0x9')](_0x1ee5('0xf'),auth[_0x1ee5('0xa')](),controller['getFields']);router[_0x1ee5('0x10')]('/',auth[_0x1ee5('0xa')](),controller['create']);router['post'](_0x1ee5('0xd'),auth[_0x1ee5('0xa')](),controller['addConfiguration']);router['put'](_0x1ee5('0xb'),auth[_0x1ee5('0xa')](),controller[_0x1ee5('0x11')]);router[_0x1ee5('0x12')](_0x1ee5('0xb'),auth[_0x1ee5('0xa')](),controller[_0x1ee5('0x13')]);module[_0x1ee5('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index fcbd6c6..97c730d 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 _0xc359=['remoteUri','password','integrationTab','newTab','exports','STRING','username'];(function(_0x7e4692,_0x51e0fe){var _0x340da1=function(_0x13846a){while(--_0x13846a){_0x7e4692['push'](_0x7e4692['shift']());}};_0x340da1(++_0x51e0fe);}(_0xc359,0x1d9));var _0x9c35=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0xc359[_0x4d82ea];return _0x257f4a;};'use strict';var Sequelize=require('sequelize');module[_0x9c35('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9c35('0x1')]},'username':{'type':Sequelize[_0x9c35('0x1')],'unique':_0x9c35('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x9c35('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x9c35('0x3')},'authType':{'type':Sequelize['ENUM'](_0x9c35('0x4'),'token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x9c35('0x5'),_0x9c35('0x6')),'defaultValue':_0x9c35('0x5')}}; \ No newline at end of file +var _0x5496=['remoteUri','ENUM','password','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x3b0419,_0x3d9b2f){var _0x471c73=function(_0x424612){while(--_0x424612){_0x3b0419['push'](_0x3b0419['shift']());}};_0x471c73(++_0x3d9b2f);}(_0x5496,0x175));var _0x6549=function(_0x2dd715,_0x424294){_0x2dd715=_0x2dd715-0x0;var _0x2b408a=_0x5496[_0x2dd715];return _0x2b408a;};'use strict';var Sequelize=require(_0x6549('0x0'));module[_0x6549('0x1')]={'name':{'type':Sequelize[_0x6549('0x2')]},'description':{'type':Sequelize[_0x6549('0x2')]},'username':{'type':Sequelize[_0x6549('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x6549('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6549('0x2')],'unique':_0x6549('0x3')},'authType':{'type':Sequelize[_0x6549('0x4')]('password','token'),'defaultValue':_0x6549('0x5')},'serverUrl':{'type':Sequelize[_0x6549('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6549('0x6'),_0x6549('0x7')),'defaultValue':_0x6549('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 47f8626..66a4a0a 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 _0x69d3=['../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskAccount','includeAll','include','findAll','rows','show','keys','find','catch','create','update','body','params','getConfigurations','findOne','ZendeskConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','token','remoteUri','slice','lastIndexOf','format','ticket_fields','authType','password','Basic\x20%s','%s:%s','base64','headers','%s/token:%s','toString','Unknown\x20authentication\x20type','subject','description','assignee','remove','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service'];(function(_0x4ce3a4,_0x3d5950){var _0x199899=function(_0x2b2468){while(--_0x2b2468){_0x4ce3a4['push'](_0x4ce3a4['shift']());}};_0x199899(++_0x3d5950);}(_0x69d3,0xda));var _0x369d=function(_0x3ec9a6,_0x525a4a){_0x3ec9a6=_0x3ec9a6-0x0;var _0x2e0a08=_0x69d3[_0x3ec9a6];return _0x2e0a08;};'use strict';var emlformat=require(_0x369d('0x0'));var rimraf=require(_0x369d('0x1'));var zipdir=require(_0x369d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x369d('0x3'));var moment=require(_0x369d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x369d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x369d('0x6'));var ejs=require(_0x369d('0x7'));var fs=require('fs');var fs_extra=require(_0x369d('0x8'));var _=require(_0x369d('0x9'));var squel=require(_0x369d('0xa'));var crypto=require(_0x369d('0xb'));var jsforce=require(_0x369d('0xc'));var deskjs=require(_0x369d('0xd'));var toCsv=require(_0x369d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x369d('0xe'));var authService=require(_0x369d('0xf'));var qs=require(_0x369d('0x10'));var as=require(_0x369d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x369d('0x12'));var utils=require(_0x369d('0x13'));var config=require(_0x369d('0x14'));var licenseUtil=require(_0x369d('0x15'));var db=require(_0x369d('0x16'))['db'];var integrations=require(_0x369d('0x17'));function respondWithStatusCode(_0x52c126,_0x15b417){_0x15b417=_0x15b417||0xcc;return function(_0x9d016){if(_0x9d016){return _0x52c126[_0x369d('0x18')](_0x15b417);}return _0x52c126[_0x369d('0x19')](_0x15b417)[_0x369d('0x1a')]();};}function respondWithResult(_0x539536,_0x5cd4c3){_0x5cd4c3=_0x5cd4c3||0xc8;return function(_0x5485a1){if(_0x5485a1){return _0x539536[_0x369d('0x19')](_0x5cd4c3)[_0x369d('0x1b')](_0x5485a1);}};}function respondWithFilteredResult(_0x389c43,_0x5b4f55){return function(_0x2c1a4a){if(_0x2c1a4a){var _0x29c1fe=typeof _0x5b4f55[_0x369d('0x1c')]==='undefined'&&typeof _0x5b4f55[_0x369d('0x1d')]===_0x369d('0x1e');var _0x4ea6c2=_0x2c1a4a['count'];var _0x597b67=_0x29c1fe?0x0:_0x5b4f55[_0x369d('0x1c')];var _0x4494b3=_0x29c1fe?_0x2c1a4a[_0x369d('0x1f')]:_0x5b4f55['offset']+_0x5b4f55[_0x369d('0x1d')];var _0x24dfff;if(_0x4494b3>=_0x4ea6c2){_0x4494b3=_0x4ea6c2;_0x24dfff=0xc8;}else{_0x24dfff=0xce;}_0x389c43[_0x369d('0x19')](_0x24dfff);return _0x389c43[_0x369d('0x20')](_0x369d('0x21'),_0x597b67+'-'+_0x4494b3+'/'+_0x4ea6c2)['json'](_0x2c1a4a);}return null;};}function patchUpdates(_0x5c9fdd){return function(_0x448e6e){try{jsonpatch[_0x369d('0x22')](_0x448e6e,_0x5c9fdd,!![]);}catch(_0x11ac1d){return BPromise[_0x369d('0x23')](_0x11ac1d);}return _0x448e6e[_0x369d('0x24')]();};}function saveUpdates(_0x15fbef,_0x1b262a){return function(_0x54a42e){if(_0x54a42e){return _0x54a42e['update'](_0x15fbef)[_0x369d('0x25')](function(_0xed16e){return _0xed16e;});}return null;};}function removeEntity(_0xf7bc3a,_0xcae58){return function(_0x30e7c5){if(_0x30e7c5){return _0x30e7c5[_0x369d('0x26')]()[_0x369d('0x25')](function(){_0xf7bc3a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16145e,_0x46de2b){return function(_0x15cd81){if(!_0x15cd81){_0x16145e[_0x369d('0x18')](0x194);}return _0x15cd81;};}function handleError(_0x8aa521,_0x41e0cf){_0x41e0cf=_0x41e0cf||0x1f4;return function(_0x8090b0){logger['error'](_0x8090b0[_0x369d('0x27')]);if(_0x8090b0[_0x369d('0x28')]){delete _0x8090b0[_0x369d('0x28')];}_0x8aa521[_0x369d('0x19')](_0x41e0cf)[_0x369d('0x29')](_0x8090b0);};}exports[_0x369d('0x2a')]=function(_0x3d1ce0,_0x4d42ea){var _0x157291={},_0x56efb1={},_0x57b94c={'count':0x0,'rows':[]};var _0x38feda=_[_0x369d('0x2b')](db['ZendeskAccount'][_0x369d('0x2c')],function(_0x5a14ce){return{'name':_0x5a14ce[_0x369d('0x2d')],'type':_0x5a14ce[_0x369d('0x2e')][_0x369d('0x2f')]};});_0x56efb1[_0x369d('0x30')]=_[_0x369d('0x2b')](_0x38feda,_0x369d('0x28'));_0x56efb1[_0x369d('0x31')]=_['keys'](_0x3d1ce0[_0x369d('0x31')]);_0x56efb1[_0x369d('0x32')]=_[_0x369d('0x33')](_0x56efb1[_0x369d('0x30')],_0x56efb1[_0x369d('0x31')]);_0x157291[_0x369d('0x34')]=_[_0x369d('0x33')](_0x56efb1[_0x369d('0x30')],qs['fields'](_0x3d1ce0[_0x369d('0x31')][_0x369d('0x35')]));_0x157291[_0x369d('0x34')]=_0x157291[_0x369d('0x34')][_0x369d('0x36')]?_0x157291['attributes']:_0x56efb1[_0x369d('0x30')];if(!_0x3d1ce0[_0x369d('0x31')][_0x369d('0x37')](_0x369d('0x38'))){_0x157291[_0x369d('0x1d')]=qs[_0x369d('0x1d')](_0x3d1ce0['query'][_0x369d('0x1d')]);_0x157291[_0x369d('0x1c')]=qs[_0x369d('0x1c')](_0x3d1ce0[_0x369d('0x31')][_0x369d('0x1c')]);}_0x157291[_0x369d('0x39')]=qs[_0x369d('0x3a')](_0x3d1ce0[_0x369d('0x31')][_0x369d('0x3a')]);_0x157291[_0x369d('0x3b')]=qs[_0x369d('0x32')](_[_0x369d('0x3c')](_0x3d1ce0[_0x369d('0x31')],_0x56efb1[_0x369d('0x32')]),_0x38feda);if(_0x3d1ce0[_0x369d('0x31')][_0x369d('0x3d')]){_0x157291[_0x369d('0x3b')]=_[_0x369d('0x3e')](_0x157291[_0x369d('0x3b')],{'$or':_[_0x369d('0x2b')](_0x38feda,function(_0x10c5b6){if(_0x10c5b6[_0x369d('0x2e')]!==_0x369d('0x3f')){var _0xd58366={};_0xd58366[_0x10c5b6['name']]={'$like':'%'+_0x3d1ce0['query'][_0x369d('0x3d')]+'%'};return _0xd58366;}})});}_0x157291=_[_0x369d('0x3e')]({},_0x157291,_0x3d1ce0[_0x369d('0x40')]);var _0x401bc7={'where':_0x157291[_0x369d('0x3b')]};return db[_0x369d('0x41')][_0x369d('0x1f')](_0x401bc7)[_0x369d('0x25')](function(_0x46c940){_0x57b94c['count']=_0x46c940;if(_0x3d1ce0[_0x369d('0x31')][_0x369d('0x42')]){_0x157291[_0x369d('0x43')]=[{'all':!![]}];}return db[_0x369d('0x41')][_0x369d('0x44')](_0x157291);})[_0x369d('0x25')](function(_0x28803c){_0x57b94c[_0x369d('0x45')]=_0x28803c;return _0x57b94c;})['then'](respondWithFilteredResult(_0x4d42ea,_0x157291))['catch'](handleError(_0x4d42ea,null));};exports[_0x369d('0x46')]=function(_0x3222ce,_0x30909a){var _0x4dad71={'raw':![],'where':{'id':_0x3222ce['params']['id']}},_0x4d07ac={};_0x4d07ac[_0x369d('0x30')]=_[_0x369d('0x47')](db['ZendeskAccount'][_0x369d('0x2c')]);_0x4d07ac[_0x369d('0x31')]=_[_0x369d('0x47')](_0x3222ce[_0x369d('0x31')]);_0x4d07ac['filters']=_[_0x369d('0x33')](_0x4d07ac['model'],_0x4d07ac[_0x369d('0x31')]);_0x4dad71['attributes']=_[_0x369d('0x33')](_0x4d07ac[_0x369d('0x30')],qs[_0x369d('0x35')](_0x3222ce['query']['fields']));_0x4dad71[_0x369d('0x34')]=_0x4dad71[_0x369d('0x34')][_0x369d('0x36')]?_0x4dad71['attributes']:_0x4d07ac[_0x369d('0x30')];if(_0x3222ce[_0x369d('0x31')][_0x369d('0x42')]){_0x4dad71[_0x369d('0x43')]=[{'all':!![]}];}_0x4dad71=_[_0x369d('0x3e')]({},_0x4dad71,_0x3222ce[_0x369d('0x40')]);return db[_0x369d('0x41')][_0x369d('0x48')](_0x4dad71)[_0x369d('0x25')](handleEntityNotFound(_0x30909a,null))['then'](respondWithResult(_0x30909a,null))[_0x369d('0x49')](handleError(_0x30909a,null));};exports[_0x369d('0x4a')]=function(_0xcc1465,_0x257c3d){return db[_0x369d('0x41')][_0x369d('0x4a')](_0xcc1465['body'],{})[_0x369d('0x25')](respondWithResult(_0x257c3d,0xc9))[_0x369d('0x49')](handleError(_0x257c3d,null));};exports[_0x369d('0x4b')]=function(_0x44a357,_0x1b04d9){if(_0x44a357[_0x369d('0x4c')]['id']){delete _0x44a357[_0x369d('0x4c')]['id'];}return db[_0x369d('0x41')][_0x369d('0x48')]({'where':{'id':_0x44a357[_0x369d('0x4d')]['id']}})[_0x369d('0x25')](handleEntityNotFound(_0x1b04d9,null))[_0x369d('0x25')](saveUpdates(_0x44a357['body'],null))[_0x369d('0x25')](respondWithResult(_0x1b04d9,null))[_0x369d('0x49')](handleError(_0x1b04d9,null));};exports[_0x369d('0x26')]=function(_0x85edd6,_0x648a0d){return db['ZendeskAccount'][_0x369d('0x48')]({'where':{'id':_0x85edd6['params']['id']}})[_0x369d('0x25')](handleEntityNotFound(_0x648a0d,null))[_0x369d('0x25')](removeEntity(_0x648a0d,null))[_0x369d('0x49')](handleError(_0x648a0d,null));};exports[_0x369d('0x4e')]=function(_0x46c62c,_0x1bd31c,_0x22e2d4){var _0x418cab={};var _0x1cdeca={};var _0x9f1544;var _0x4d582a;return db['ZendeskAccount'][_0x369d('0x4f')]({'where':{'id':_0x46c62c[_0x369d('0x4d')]['id']}})[_0x369d('0x25')](handleEntityNotFound(_0x1bd31c,null))[_0x369d('0x25')](function(_0x347df4){if(_0x347df4){_0x9f1544=_0x347df4;_0x1cdeca['model']=_['keys'](db[_0x369d('0x50')][_0x369d('0x2c')]);_0x1cdeca['query']=_[_0x369d('0x47')](_0x46c62c['query']);_0x1cdeca[_0x369d('0x32')]=_[_0x369d('0x33')](_0x1cdeca[_0x369d('0x30')],_0x1cdeca['query']);_0x418cab[_0x369d('0x34')]=_[_0x369d('0x33')](_0x1cdeca[_0x369d('0x30')],qs[_0x369d('0x35')](_0x46c62c['query']['fields']));_0x418cab[_0x369d('0x34')]=_0x418cab[_0x369d('0x34')][_0x369d('0x36')]?_0x418cab['attributes']:_0x1cdeca[_0x369d('0x30')];_0x418cab[_0x369d('0x39')]=qs[_0x369d('0x3a')](_0x46c62c['query']['sort']);_0x418cab[_0x369d('0x3b')]=qs[_0x369d('0x32')](_[_0x369d('0x3c')](_0x46c62c[_0x369d('0x31')],_0x1cdeca['filters']));if(_0x46c62c[_0x369d('0x31')][_0x369d('0x3d')]){_0x418cab[_0x369d('0x3b')]=_[_0x369d('0x3e')](_0x418cab[_0x369d('0x3b')],{'$or':_['map'](_0x418cab[_0x369d('0x34')],function(_0x304a9e){var _0x28b752={};_0x28b752[_0x304a9e]={'$like':'%'+_0x46c62c['query'][_0x369d('0x3d')]+'%'};return _0x28b752;})});}_0x418cab=_['merge']({},_0x418cab,_0x46c62c[_0x369d('0x40')]);return _0x9f1544['getConfigurations'](_0x418cab);}})['then'](function(_0x5f440e){if(_0x5f440e){_0x4d582a=_0x5f440e['length'];if(!_0x46c62c[_0x369d('0x31')]['hasOwnProperty'](_0x369d('0x38'))){_0x418cab['limit']=qs[_0x369d('0x1d')](_0x46c62c[_0x369d('0x31')][_0x369d('0x1d')]);_0x418cab['offset']=qs[_0x369d('0x1c')](_0x46c62c[_0x369d('0x31')][_0x369d('0x1c')]);}return _0x9f1544[_0x369d('0x4e')](_0x418cab);}})[_0x369d('0x25')](function(_0xe63e0f){if(_0xe63e0f){return _0xe63e0f?{'count':_0x4d582a,'rows':_0xe63e0f}:null;}})['then'](respondWithResult(_0x1bd31c,null))[_0x369d('0x49')](handleError(_0x1bd31c,null));};exports['addConfiguration']=function(_0x5706be,_0x56c98e,_0x36e990){if(_0x5706be[_0x369d('0x4c')]['id']){delete _0x5706be[_0x369d('0x4c')]['id'];}return db[_0x369d('0x41')][_0x369d('0x4f')]({'where':{'id':_0x5706be[_0x369d('0x4d')]['id']}})[_0x369d('0x25')](handleEntityNotFound(_0x56c98e,null))[_0x369d('0x25')](function(_0x1c9683){if(_0x1c9683){_0x5706be[_0x369d('0x4c')][_0x369d('0x51')]=_0x1c9683['id'];_0x5706be[_0x369d('0x4c')][_0x369d('0x52')]=integrations[_0x369d('0x53')](_0x5706be[_0x369d('0x4c')][_0x369d('0x54')],_0x5706be['body'][_0x369d('0x2e')]);_0x5706be['body'][_0x369d('0x55')]=integrations[_0x369d('0x56')](_0x5706be[_0x369d('0x4c')][_0x369d('0x54')],_0x5706be[_0x369d('0x4c')]['type']);return db[_0x369d('0x50')]['create'](_0x5706be['body'],{'include':[{'model':db[_0x369d('0x57')],'as':_0x369d('0x52')},{'model':db[_0x369d('0x57')],'as':_0x369d('0x55')}]});}return null;})[_0x369d('0x25')](respondWithResult(_0x56c98e,null))[_0x369d('0x49')](handleError(_0x56c98e,null));};exports[_0x369d('0x58')]=function(_0x11ac7d,_0x55a811,_0x461782){var _0x24e70d='';return db['ZendeskAccount'][_0x369d('0x4f')]({'where':{'id':_0x11ac7d[_0x369d('0x4d')]['id']},'attributes':['id',_0x369d('0x59'),'password',_0x369d('0x5a'),'authType',_0x369d('0x5b')]})[_0x369d('0x25')](handleEntityNotFound(_0x55a811,null))[_0x369d('0x25')](function(_0x369199){if(_0x369199){_0x24e70d=_0x369199[_0x369d('0x5b')];var _0x1a9a01=_0x24e70d[_0x369d('0x5c')](-0x1);if(_0x1a9a01==='/'){_0x24e70d=_0x24e70d['substring'](0x0,_0x24e70d[_0x369d('0x5d')](_0x1a9a01));}var _0x7e8d08={'method':'GET','uri':util[_0x369d('0x5e')]('%s/%s',_0x24e70d,_0x369d('0x5f')),'json':!![]};switch(_0x369199[_0x369d('0x60')]){case _0x369d('0x61'):_0x7e8d08['headers']={'Authorization':util[_0x369d('0x5e')](_0x369d('0x62'),new Buffer(util['format'](_0x369d('0x63'),_0x369199[_0x369d('0x59')],_0x369199[_0x369d('0x61')]))['toString'](_0x369d('0x64')))};break;case _0x369d('0x5a'):_0x7e8d08[_0x369d('0x65')]={'Authorization':util[_0x369d('0x5e')](_0x369d('0x62'),new Buffer(util['format'](_0x369d('0x66'),_0x369199[_0x369d('0x59')],_0x369199[_0x369d('0x5a')]))[_0x369d('0x67')](_0x369d('0x64')))};break;default:throw new db['Sequelize']['ValidationError'](_0x369d('0x68'));}return rp(_0x7e8d08);}})[_0x369d('0x25')](function(_0x2307fc){if(_0x2307fc){var _0x11b348=[_0x369d('0x69'),_0x369d('0x6a'),'group',_0x369d('0x6b')];_[_0x369d('0x6c')](_0x2307fc['ticket_fields'],function(_0x6c8235){return _0x11b348['includes'](_0x6c8235[_0x369d('0x2e')]);});return{'count':_0x2307fc['ticket_fields'][_0x369d('0x36')],'rows':_[_0x369d('0x2b')](_0x2307fc['ticket_fields'],function(_0x4148a9){return{'id':_0x4148a9['id'],'name':_0x4148a9['position']>0x7?_0x4148a9[_0x369d('0x6d')]:_0x4148a9['type'],'custom':_0x4148a9['position']>0x7?!![]:![],'options':_0x4148a9[_0x369d('0x6e')]?_0x4148a9[_0x369d('0x6e')]:_0x4148a9[_0x369d('0x6f')]?_0x4148a9[_0x369d('0x6f')]:[]};})};}})[_0x369d('0x25')](respondWithResult(_0x55a811,null))['catch'](function(_0x28ec32){var _0xaff7cc=_0x11ac7d[_0x369d('0x31')][_0x369d('0x70')]?0x1f4:_0x28ec32[_0x369d('0x71')]||0x1f4;logger[_0x369d('0x72')](_0x369d('0x73'),_0x369d('0x58'),_0xaff7cc,JSON[_0x369d('0x74')](_0x28ec32));delete _0x28ec32['name'];if(_0xaff7cc===0x191){_0xaff7cc=0x190;}_0x55a811[_0x369d('0x19')](_0xaff7cc)[_0x369d('0x29')](_0x11ac7d[_0x369d('0x31')][_0x369d('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x28ec32[_0x369d('0x71')]}:_0x28ec32);});}; \ No newline at end of file +var _0x13f6=['where','pick','filters','filter','merge','VIRTUAL','options','ZendeskAccount','include','findAll','rows','show','params','find','catch','create','body','order','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','remove','includes','title','position','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','send','test','statusCode','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort'];(function(_0x3c71a4,_0x50b4e9){var _0x28de20=function(_0x4f19a8){while(--_0x4f19a8){_0x3c71a4['push'](_0x3c71a4['shift']());}};_0x28de20(++_0x50b4e9);}(_0x13f6,0x124));var _0x613f=function(_0x29cc17,_0x14aab3){_0x29cc17=_0x29cc17-0x0;var _0x37501a=_0x13f6[_0x29cc17];return _0x37501a;};'use strict';var emlformat=require(_0x613f('0x0'));var rimraf=require(_0x613f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x613f('0x2'));var moment=require(_0x613f('0x3'));var BPromise=require(_0x613f('0x4'));var Mustache=require('mustache');var util=require(_0x613f('0x5'));var path=require(_0x613f('0x6'));var sox=require(_0x613f('0x7'));var csv=require('to-csv');var ejs=require(_0x613f('0x8'));var fs=require('fs');var fs_extra=require(_0x613f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613f('0xa'));var toCsv=require(_0x613f('0xb'));var querystring=require(_0x613f('0xc'));var Papa=require(_0x613f('0xd'));var Redis=require('ioredis');var authService=require(_0x613f('0xe'));var qs=require(_0x613f('0xf'));var as=require(_0x613f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x613f('0x11'))(_0x613f('0x12'));var utils=require(_0x613f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x613f('0x14'));var db=require(_0x613f('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4c2a85,_0x517f57){_0x517f57=_0x517f57||0xcc;return function(_0x38d90a){if(_0x38d90a){return _0x4c2a85[_0x613f('0x16')](_0x517f57);}return _0x4c2a85[_0x613f('0x17')](_0x517f57)[_0x613f('0x18')]();};}function respondWithResult(_0x329fcf,_0x4a6fc){_0x4a6fc=_0x4a6fc||0xc8;return function(_0x305894){if(_0x305894){return _0x329fcf[_0x613f('0x17')](_0x4a6fc)[_0x613f('0x19')](_0x305894);}};}function respondWithFilteredResult(_0x1d68fd,_0x548218){return function(_0x3c9edf){if(_0x3c9edf){var _0x5d7c69=typeof _0x548218['offset']===_0x613f('0x1a')&&typeof _0x548218[_0x613f('0x1b')]==='undefined';var _0x39e417=_0x3c9edf['count'];var _0x62ebfe=_0x5d7c69?0x0:_0x548218[_0x613f('0x1c')];var _0x431266=_0x5d7c69?_0x3c9edf[_0x613f('0x1d')]:_0x548218[_0x613f('0x1c')]+_0x548218[_0x613f('0x1b')];var _0x4e412c;if(_0x431266>=_0x39e417){_0x431266=_0x39e417;_0x4e412c=0xc8;}else{_0x4e412c=0xce;}_0x1d68fd['status'](_0x4e412c);return _0x1d68fd[_0x613f('0x1e')]('Content-Range',_0x62ebfe+'-'+_0x431266+'/'+_0x39e417)['json'](_0x3c9edf);}return null;};}function patchUpdates(_0x3c9b58){return function(_0x446562){try{jsonpatch['apply'](_0x446562,_0x3c9b58,!![]);}catch(_0x19123f){return BPromise[_0x613f('0x1f')](_0x19123f);}return _0x446562[_0x613f('0x20')]();};}function saveUpdates(_0x48b28a,_0x5401c2){return function(_0x11f5f3){if(_0x11f5f3){return _0x11f5f3[_0x613f('0x21')](_0x48b28a)[_0x613f('0x22')](function(_0x51f376){return _0x51f376;});}return null;};}function removeEntity(_0x41104e,_0x33e0c6){return function(_0x30de90){if(_0x30de90){return _0x30de90[_0x613f('0x23')]()[_0x613f('0x22')](function(){_0x41104e['status'](0xcc)[_0x613f('0x18')]();});}};}function handleEntityNotFound(_0x204185,_0x51bba1){return function(_0x22035f){if(!_0x22035f){_0x204185[_0x613f('0x16')](0x194);}return _0x22035f;};}function handleError(_0x32e747,_0x4a878d){_0x4a878d=_0x4a878d||0x1f4;return function(_0x53e32b){logger['error'](_0x53e32b[_0x613f('0x24')]);if(_0x53e32b['name']){delete _0x53e32b[_0x613f('0x25')];}_0x32e747[_0x613f('0x17')](_0x4a878d)['send'](_0x53e32b);};}exports[_0x613f('0x26')]=function(_0x2551c1,_0x4c8aa1){var _0x4cff5d={},_0x4f892d={},_0x24be7c={'count':0x0,'rows':[]};var _0x7c1a94=_[_0x613f('0x27')](db['ZendeskAccount'][_0x613f('0x28')],function(_0x439478){return{'name':_0x439478[_0x613f('0x29')],'type':_0x439478[_0x613f('0x2a')]['key']};});_0x4f892d[_0x613f('0x2b')]=_[_0x613f('0x27')](_0x7c1a94,_0x613f('0x25'));_0x4f892d[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x2551c1[_0x613f('0x2c')]);_0x4f892d['filters']=_[_0x613f('0x2e')](_0x4f892d[_0x613f('0x2b')],_0x4f892d[_0x613f('0x2c')]);_0x4cff5d['attributes']=_[_0x613f('0x2e')](_0x4f892d['model'],qs[_0x613f('0x2f')](_0x2551c1[_0x613f('0x2c')][_0x613f('0x2f')]));_0x4cff5d[_0x613f('0x30')]=_0x4cff5d[_0x613f('0x30')][_0x613f('0x31')]?_0x4cff5d['attributes']:_0x4f892d[_0x613f('0x2b')];if(!_0x2551c1[_0x613f('0x2c')][_0x613f('0x32')](_0x613f('0x33'))){_0x4cff5d[_0x613f('0x1b')]=qs['limit'](_0x2551c1['query']['limit']);_0x4cff5d[_0x613f('0x1c')]=qs[_0x613f('0x1c')](_0x2551c1[_0x613f('0x2c')][_0x613f('0x1c')]);}_0x4cff5d['order']=qs[_0x613f('0x34')](_0x2551c1[_0x613f('0x2c')]['sort']);_0x4cff5d[_0x613f('0x35')]=qs['filters'](_[_0x613f('0x36')](_0x2551c1['query'],_0x4f892d[_0x613f('0x37')]),_0x7c1a94);if(_0x2551c1['query'][_0x613f('0x38')]){_0x4cff5d[_0x613f('0x35')]=_[_0x613f('0x39')](_0x4cff5d['where'],{'$or':_[_0x613f('0x27')](_0x7c1a94,function(_0x2c6a0c){if(_0x2c6a0c[_0x613f('0x2a')]!==_0x613f('0x3a')){var _0x474432={};_0x474432[_0x2c6a0c[_0x613f('0x25')]]={'$like':'%'+_0x2551c1[_0x613f('0x2c')][_0x613f('0x38')]+'%'};return _0x474432;}})});}_0x4cff5d=_[_0x613f('0x39')]({},_0x4cff5d,_0x2551c1[_0x613f('0x3b')]);var _0x4da8d3={'where':_0x4cff5d[_0x613f('0x35')]};return db[_0x613f('0x3c')][_0x613f('0x1d')](_0x4da8d3)[_0x613f('0x22')](function(_0x301d33){_0x24be7c[_0x613f('0x1d')]=_0x301d33;if(_0x2551c1[_0x613f('0x2c')]['includeAll']){_0x4cff5d[_0x613f('0x3d')]=[{'all':!![]}];}return db[_0x613f('0x3c')][_0x613f('0x3e')](_0x4cff5d);})[_0x613f('0x22')](function(_0x59d34f){_0x24be7c[_0x613f('0x3f')]=_0x59d34f;return _0x24be7c;})[_0x613f('0x22')](respondWithFilteredResult(_0x4c8aa1,_0x4cff5d))['catch'](handleError(_0x4c8aa1,null));};exports[_0x613f('0x40')]=function(_0x18f427,_0x3bb605){var _0x2f584e={'raw':![],'where':{'id':_0x18f427[_0x613f('0x41')]['id']}},_0x3952c9={};_0x3952c9[_0x613f('0x2b')]=_[_0x613f('0x2d')](db[_0x613f('0x3c')][_0x613f('0x28')]);_0x3952c9[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x18f427[_0x613f('0x2c')]);_0x3952c9['filters']=_[_0x613f('0x2e')](_0x3952c9[_0x613f('0x2b')],_0x3952c9[_0x613f('0x2c')]);_0x2f584e[_0x613f('0x30')]=_['intersection'](_0x3952c9[_0x613f('0x2b')],qs[_0x613f('0x2f')](_0x18f427[_0x613f('0x2c')][_0x613f('0x2f')]));_0x2f584e[_0x613f('0x30')]=_0x2f584e[_0x613f('0x30')][_0x613f('0x31')]?_0x2f584e[_0x613f('0x30')]:_0x3952c9[_0x613f('0x2b')];if(_0x18f427[_0x613f('0x2c')]['includeAll']){_0x2f584e['include']=[{'all':!![]}];}_0x2f584e=_[_0x613f('0x39')]({},_0x2f584e,_0x18f427[_0x613f('0x3b')]);return db['ZendeskAccount'][_0x613f('0x42')](_0x2f584e)[_0x613f('0x22')](handleEntityNotFound(_0x3bb605,null))[_0x613f('0x22')](respondWithResult(_0x3bb605,null))[_0x613f('0x43')](handleError(_0x3bb605,null));};exports[_0x613f('0x44')]=function(_0x1c0b07,_0x412dd4){return db[_0x613f('0x3c')][_0x613f('0x44')](_0x1c0b07[_0x613f('0x45')],{})[_0x613f('0x22')](respondWithResult(_0x412dd4,0xc9))[_0x613f('0x43')](handleError(_0x412dd4,null));};exports[_0x613f('0x21')]=function(_0x17f8e5,_0x1fd46c){if(_0x17f8e5[_0x613f('0x45')]['id']){delete _0x17f8e5[_0x613f('0x45')]['id'];}return db[_0x613f('0x3c')]['find']({'where':{'id':_0x17f8e5['params']['id']}})[_0x613f('0x22')](handleEntityNotFound(_0x1fd46c,null))[_0x613f('0x22')](saveUpdates(_0x17f8e5['body'],null))['then'](respondWithResult(_0x1fd46c,null))[_0x613f('0x43')](handleError(_0x1fd46c,null));};exports['destroy']=function(_0x513bf1,_0x6e006b){return db[_0x613f('0x3c')][_0x613f('0x42')]({'where':{'id':_0x513bf1['params']['id']}})[_0x613f('0x22')](handleEntityNotFound(_0x6e006b,null))[_0x613f('0x22')](removeEntity(_0x6e006b,null))['catch'](handleError(_0x6e006b,null));};exports['getConfigurations']=function(_0x1c0c8e,_0x30d7b1,_0x13b585){var _0x145009={};var _0x3f7ead={};var _0x395357;var _0x24d162;return db['ZendeskAccount']['findOne']({'where':{'id':_0x1c0c8e[_0x613f('0x41')]['id']}})['then'](handleEntityNotFound(_0x30d7b1,null))['then'](function(_0x387913){if(_0x387913){_0x395357=_0x387913;_0x3f7ead[_0x613f('0x2b')]=_[_0x613f('0x2d')](db['ZendeskConfiguration'][_0x613f('0x28')]);_0x3f7ead[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x1c0c8e[_0x613f('0x2c')]);_0x3f7ead[_0x613f('0x37')]=_[_0x613f('0x2e')](_0x3f7ead[_0x613f('0x2b')],_0x3f7ead['query']);_0x145009[_0x613f('0x30')]=_['intersection'](_0x3f7ead[_0x613f('0x2b')],qs[_0x613f('0x2f')](_0x1c0c8e[_0x613f('0x2c')][_0x613f('0x2f')]));_0x145009[_0x613f('0x30')]=_0x145009[_0x613f('0x30')][_0x613f('0x31')]?_0x145009[_0x613f('0x30')]:_0x3f7ead[_0x613f('0x2b')];_0x145009[_0x613f('0x46')]=qs[_0x613f('0x34')](_0x1c0c8e[_0x613f('0x2c')][_0x613f('0x34')]);_0x145009['where']=qs['filters'](_[_0x613f('0x36')](_0x1c0c8e['query'],_0x3f7ead[_0x613f('0x37')]));if(_0x1c0c8e[_0x613f('0x2c')][_0x613f('0x38')]){_0x145009[_0x613f('0x35')]=_[_0x613f('0x39')](_0x145009[_0x613f('0x35')],{'$or':_[_0x613f('0x27')](_0x145009[_0x613f('0x30')],function(_0x3ababc){var _0x29bb88={};_0x29bb88[_0x3ababc]={'$like':'%'+_0x1c0c8e[_0x613f('0x2c')]['filter']+'%'};return _0x29bb88;})});}_0x145009=_[_0x613f('0x39')]({},_0x145009,_0x1c0c8e[_0x613f('0x3b')]);return _0x395357[_0x613f('0x47')](_0x145009);}})[_0x613f('0x22')](function(_0x5a3ea1){if(_0x5a3ea1){_0x24d162=_0x5a3ea1[_0x613f('0x31')];if(!_0x1c0c8e[_0x613f('0x2c')]['hasOwnProperty']('nolimit')){_0x145009[_0x613f('0x1b')]=qs['limit'](_0x1c0c8e['query']['limit']);_0x145009[_0x613f('0x1c')]=qs['offset'](_0x1c0c8e['query']['offset']);}return _0x395357[_0x613f('0x47')](_0x145009);}})[_0x613f('0x22')](function(_0x5bf4ce){if(_0x5bf4ce){return _0x5bf4ce?{'count':_0x24d162,'rows':_0x5bf4ce}:null;}})[_0x613f('0x22')](respondWithResult(_0x30d7b1,null))[_0x613f('0x43')](handleError(_0x30d7b1,null));};exports[_0x613f('0x48')]=function(_0x2a7ca7,_0x5b8712,_0x24f25c){if(_0x2a7ca7[_0x613f('0x45')]['id']){delete _0x2a7ca7['body']['id'];}return db[_0x613f('0x3c')][_0x613f('0x49')]({'where':{'id':_0x2a7ca7[_0x613f('0x41')]['id']}})[_0x613f('0x22')](handleEntityNotFound(_0x5b8712,null))[_0x613f('0x22')](function(_0xdf8993){if(_0xdf8993){_0x2a7ca7[_0x613f('0x45')][_0x613f('0x4a')]=_0xdf8993['id'];_0x2a7ca7[_0x613f('0x45')][_0x613f('0x4b')]=integrations[_0x613f('0x4c')](_0x2a7ca7[_0x613f('0x45')]['channel'],_0x2a7ca7[_0x613f('0x45')][_0x613f('0x2a')]);_0x2a7ca7[_0x613f('0x45')][_0x613f('0x4d')]=integrations[_0x613f('0x4e')](_0x2a7ca7[_0x613f('0x45')]['channel'],_0x2a7ca7[_0x613f('0x45')][_0x613f('0x2a')]);return db[_0x613f('0x4f')][_0x613f('0x44')](_0x2a7ca7[_0x613f('0x45')],{'include':[{'model':db[_0x613f('0x50')],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0x613f('0x4d')}]});}return null;})[_0x613f('0x22')](respondWithResult(_0x5b8712,null))[_0x613f('0x43')](handleError(_0x5b8712,null));};exports[_0x613f('0x51')]=function(_0x4f28c7,_0x11d2f4,_0x29e5c8){var _0x3d8777='';return db[_0x613f('0x3c')]['findOne']({'where':{'id':_0x4f28c7[_0x613f('0x41')]['id']},'attributes':['id',_0x613f('0x52'),_0x613f('0x53'),_0x613f('0x54'),_0x613f('0x55'),_0x613f('0x56')]})[_0x613f('0x22')](handleEntityNotFound(_0x11d2f4,null))[_0x613f('0x22')](function(_0x5dc81a){if(_0x5dc81a){_0x3d8777=_0x5dc81a[_0x613f('0x56')];var _0x792bf3=_0x3d8777[_0x613f('0x57')](-0x1);if(_0x792bf3==='/'){_0x3d8777=_0x3d8777[_0x613f('0x58')](0x0,_0x3d8777[_0x613f('0x59')](_0x792bf3));}var _0x15ef2d={'method':_0x613f('0x5a'),'uri':util[_0x613f('0x5b')](_0x613f('0x5c'),_0x3d8777,_0x613f('0x5d')),'json':!![]};switch(_0x5dc81a['authType']){case _0x613f('0x53'):_0x15ef2d[_0x613f('0x5e')]={'Authorization':util[_0x613f('0x5b')](_0x613f('0x5f'),new Buffer(util[_0x613f('0x5b')](_0x613f('0x60'),_0x5dc81a[_0x613f('0x52')],_0x5dc81a[_0x613f('0x53')]))[_0x613f('0x61')](_0x613f('0x62')))};break;case _0x613f('0x54'):_0x15ef2d['headers']={'Authorization':util[_0x613f('0x5b')](_0x613f('0x5f'),new Buffer(util[_0x613f('0x5b')](_0x613f('0x63'),_0x5dc81a[_0x613f('0x52')],_0x5dc81a[_0x613f('0x54')]))[_0x613f('0x61')](_0x613f('0x62')))};break;default:throw new db[(_0x613f('0x64'))][(_0x613f('0x65'))](_0x613f('0x66'));}return rp(_0x15ef2d);}})[_0x613f('0x22')](function(_0x5b8563){if(_0x5b8563){var _0x30c62f=[_0x613f('0x67'),'description',_0x613f('0x68'),'assignee'];_[_0x613f('0x69')](_0x5b8563['ticket_fields'],function(_0x49cb13){return _0x30c62f[_0x613f('0x6a')](_0x49cb13[_0x613f('0x2a')]);});return{'count':_0x5b8563[_0x613f('0x5d')][_0x613f('0x31')],'rows':_[_0x613f('0x27')](_0x5b8563[_0x613f('0x5d')],function(_0x622812){return{'id':_0x622812['id'],'name':_0x622812['position']>0x7?_0x622812[_0x613f('0x6b')]:_0x622812[_0x613f('0x2a')],'custom':_0x622812[_0x613f('0x6c')]>0x7?!![]:![],'options':_0x622812[_0x613f('0x6d')]?_0x622812[_0x613f('0x6d')]:_0x622812['custom_field_options']?_0x622812[_0x613f('0x6e')]:[]};})};}})[_0x613f('0x22')](respondWithResult(_0x11d2f4,null))['catch'](function(_0x188be6){var _0x8073b2=_0x4f28c7[_0x613f('0x2c')]['test']?0x1f4:_0x188be6['statusCode']||0x1f4;logger['error'](_0x613f('0x6f'),_0x613f('0x51'),_0x8073b2,JSON['stringify'](_0x188be6));delete _0x188be6[_0x613f('0x25')];if(_0x8073b2===0x191){_0x8073b2=0x190;}_0x11d2f4[_0x613f('0x17')](_0x8073b2)[_0x613f('0x70')](_0x4f28c7['query'][_0x613f('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x188be6[_0x613f('0x72')]}:_0x188be6);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index b4ae6a5..8f73fbd 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 _0x8a2d=['request-promise','rimraf','../../config/environment','exports','define','ZendeskAccount','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2de7f8,_0x4af1ff){var _0x59022b=function(_0x54194b){while(--_0x54194b){_0x2de7f8['push'](_0x2de7f8['shift']());}};_0x59022b(++_0x4af1ff);}(_0x8a2d,0x192));var _0xd8a2=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x8a2d[_0x29b609];return _0x54c952;};'use strict';var _=require(_0xd8a2('0x0'));var util=require(_0xd8a2('0x1'));var logger=require(_0xd8a2('0x2'))(_0xd8a2('0x3'));var moment=require(_0xd8a2('0x4'));var BPromise=require(_0xd8a2('0x5'));var rp=require(_0xd8a2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd8a2('0x7'));var config=require(_0xd8a2('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xd8a2('0x9')]=function(_0xc8d5f5,_0x3f24d0){return _0xc8d5f5[_0xd8a2('0xa')](_0xd8a2('0xb'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x041a=['request-promise','path','../../config/environment','../../components/integrations/configuration','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5b76af,_0x389828){var _0x29ad20=function(_0x5cd4c1){while(--_0x5cd4c1){_0x5b76af['push'](_0x5b76af['shift']());}};_0x29ad20(++_0x389828);}(_0x041a,0x1ce));var _0xa041=function(_0x294823,_0xd41314){_0x294823=_0x294823-0x0;var _0x4283ad=_0x041a[_0x294823];return _0x4283ad;};'use strict';var _=require(_0xa041('0x0'));var util=require(_0xa041('0x1'));var logger=require(_0xa041('0x2'))(_0xa041('0x3'));var moment=require(_0xa041('0x4'));var BPromise=require(_0xa041('0x5'));var rp=require(_0xa041('0x6'));var fs=require('fs');var path=require(_0xa041('0x7'));var rimraf=require('rimraf');var config=require(_0xa041('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xa041('0x9'));module['exports']=function(_0x491f6e,_0x3a6df7){return _0x491f6e['define'](_0xa041('0xa'),attributes,{'tableName':_0xa041('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index a5752b6..148a723 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 _0x57a9=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','request\x20sent','result','GetZendeskAccount','options','raw','where','attributes','limit','map','include','model','ZendeskAccount','ShowZendeskAccount','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x30473e,_0x42e55b){var _0x133ace=function(_0x1be63c){while(--_0x1be63c){_0x30473e['push'](_0x30473e['shift']());}};_0x133ace(++_0x42e55b);}(_0x57a9,0xcc));var _0x957a=function(_0x447cda,_0x2e4063){_0x447cda=_0x447cda-0x0;var _0x1ed893=_0x57a9[_0x447cda];return _0x1ed893;};'use strict';var _=require(_0x957a('0x0'));var util=require(_0x957a('0x1'));var moment=require('moment');var BPromise=require(_0x957a('0x2'));var rs=require(_0x957a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x957a('0x4'))['db'];var utils=require(_0x957a('0x5'));var logger=require(_0x957a('0x6'))(_0x957a('0x7'));var config=require(_0x957a('0x8'));var jayson=require(_0x957a('0x9'));var client=jayson[_0x957a('0xa')][_0x957a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1448dc,_0x1f09e7,_0x5d2a77){return new BPromise(function(_0x1105f7,_0x380d67){return client[_0x957a('0xc')](_0x1448dc,_0x5d2a77)[_0x957a('0xd')](function(_0x1ef457){logger[_0x957a('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x1f09e7,'request\x20sent');logger[_0x957a('0xf')](_0x957a('0x10'),_0x1f09e7,'request\x20sent',JSON[_0x957a('0x11')](_0x1ef457));if(_0x1ef457['error']){if(_0x1ef457[_0x957a('0x12')][_0x957a('0x13')]===0x1f4){logger[_0x957a('0x12')](_0x957a('0x14'),_0x1f09e7,_0x1ef457['error'][_0x957a('0x15')]);return _0x380d67(_0x1ef457[_0x957a('0x12')]['message']);}logger['error'](_0x957a('0x14'),_0x1f09e7,_0x1ef457[_0x957a('0x12')][_0x957a('0x15')]);return _0x1105f7(_0x1ef457[_0x957a('0x12')][_0x957a('0x15')]);}else{logger[_0x957a('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x1f09e7,_0x957a('0x16'));_0x1105f7(_0x1ef457[_0x957a('0x17')]['message']);}})['catch'](function(_0x3657ba){logger[_0x957a('0x12')](_0x957a('0x14'),_0x1f09e7,_0x3657ba);_0x380d67(_0x3657ba);});});}exports[_0x957a('0x18')]=function(_0x36d8a5){var _0x27561d=this;return new Promise(function(_0x42e947,_0x5c6d55){return db['ZendeskAccount']['findAll']({'raw':_0x36d8a5['options']?_0x36d8a5[_0x957a('0x19')][_0x957a('0x1a')]===undefined?!![]:![]:!![],'where':_0x36d8a5[_0x957a('0x19')]?_0x36d8a5[_0x957a('0x19')][_0x957a('0x1b')]||null:null,'attributes':_0x36d8a5[_0x957a('0x19')]?_0x36d8a5['options'][_0x957a('0x1c')]||null:null,'limit':_0x36d8a5[_0x957a('0x19')]?_0x36d8a5[_0x957a('0x19')][_0x957a('0x1d')]||null:null,'include':_0x36d8a5[_0x957a('0x19')]?_0x36d8a5['options']['include']?_[_0x957a('0x1e')](_0x36d8a5['options'][_0x957a('0x1f')],function(_0x505ab4){return{'model':db[_0x505ab4['model']],'as':_0x505ab4['as'],'attributes':_0x505ab4['attributes'],'include':_0x505ab4['include']?_['map'](_0x505ab4[_0x957a('0x1f')],function(_0x3ad04c){return{'model':db[_0x3ad04c[_0x957a('0x20')]],'as':_0x3ad04c['as'],'attributes':_0x3ad04c[_0x957a('0x1c')],'include':_0x3ad04c[_0x957a('0x1f')]?_[_0x957a('0x1e')](_0x3ad04c['include'],function(_0x256f85){return{'model':db[_0x256f85[_0x957a('0x20')]],'as':_0x256f85['as'],'attributes':_0x256f85[_0x957a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x957a('0xd')](function(_0x1e9a1f){logger[_0x957a('0xe')](_0x957a('0x18'),_0x36d8a5);logger[_0x957a('0xf')](_0x957a('0x18'),_0x36d8a5,JSON['stringify'](_0x1e9a1f));_0x42e947(_0x1e9a1f);})['catch'](function(_0x41389b){logger[_0x957a('0x12')](_0x957a('0x18'),_0x41389b['message'],_0x36d8a5);_0x5c6d55(_0x27561d[_0x957a('0x12')](0x1f4,_0x41389b[_0x957a('0x15')]));});});};exports['ShowZendeskAccount']=function(_0x24278f){var _0x4679f5=this;return new Promise(function(_0x57b844,_0x1ca1e1){return db[_0x957a('0x21')]['find']({'raw':_0x24278f[_0x957a('0x19')]?_0x24278f[_0x957a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x24278f[_0x957a('0x19')]?_0x24278f[_0x957a('0x19')][_0x957a('0x1b')]||null:null,'attributes':_0x24278f[_0x957a('0x19')]?_0x24278f[_0x957a('0x19')][_0x957a('0x1c')]||null:null,'include':_0x24278f[_0x957a('0x19')]?_0x24278f['options'][_0x957a('0x1f')]?_[_0x957a('0x1e')](_0x24278f[_0x957a('0x19')][_0x957a('0x1f')],function(_0x2d47c5){return{'model':db[_0x2d47c5['model']],'as':_0x2d47c5['as'],'attributes':_0x2d47c5[_0x957a('0x1c')],'include':_0x2d47c5[_0x957a('0x1f')]?_[_0x957a('0x1e')](_0x2d47c5[_0x957a('0x1f')],function(_0x4560b3){return{'model':db[_0x4560b3[_0x957a('0x20')]],'as':_0x4560b3['as'],'attributes':_0x4560b3['attributes'],'include':_0x4560b3[_0x957a('0x1f')]?_['map'](_0x4560b3['include'],function(_0x56a293){return{'model':db[_0x56a293[_0x957a('0x20')]],'as':_0x56a293['as'],'attributes':_0x56a293[_0x957a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x957a('0xd')](function(_0x312ee4){logger['info'](_0x957a('0x22'),_0x24278f);logger[_0x957a('0xf')](_0x957a('0x22'),_0x24278f,JSON[_0x957a('0x11')](_0x312ee4));_0x57b844(_0x312ee4);})['catch'](function(_0x24e197){logger[_0x957a('0x12')](_0x957a('0x22'),_0x24e197['message'],_0x24278f);_0x1ca1e1(_0x4679f5[_0x957a('0x12')](0x1f4,_0x24e197['message']));});});}; \ No newline at end of file +var _0x1d7b=['result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model','then','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x1e87b4,_0x38178f){var _0x3c8d53=function(_0x205cbe){while(--_0x205cbe){_0x1e87b4['push'](_0x1e87b4['shift']());}};_0x3c8d53(++_0x38178f);}(_0x1d7b,0xb9));var _0xb1d7=function(_0x1e8740,_0x4e0c8e){_0x1e8740=_0x1e8740-0x0;var _0x57d2a9=_0x1d7b[_0x1e8740];return _0x57d2a9;};'use strict';var _=require(_0xb1d7('0x0'));var util=require(_0xb1d7('0x1'));var moment=require(_0xb1d7('0x2'));var BPromise=require(_0xb1d7('0x3'));var rs=require(_0xb1d7('0x4'));var fs=require('fs');var Redis=require(_0xb1d7('0x5'));var db=require(_0xb1d7('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb1d7('0x7'));var config=require(_0xb1d7('0x8'));var jayson=require(_0xb1d7('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c8bf5,_0x4e9d58,_0x4d421d){return new BPromise(function(_0x5eed59,_0x147bc0){return client['request'](_0x1c8bf5,_0x4d421d)['then'](function(_0x4e308c){logger['info'](_0xb1d7('0xa'),_0x4e9d58,_0xb1d7('0xb'));logger[_0xb1d7('0xc')](_0xb1d7('0xd'),_0x4e9d58,_0xb1d7('0xb'),JSON[_0xb1d7('0xe')](_0x4e308c));if(_0x4e308c['error']){if(_0x4e308c[_0xb1d7('0xf')][_0xb1d7('0x10')]===0x1f4){logger[_0xb1d7('0xf')](_0xb1d7('0xa'),_0x4e9d58,_0x4e308c[_0xb1d7('0xf')][_0xb1d7('0x11')]);return _0x147bc0(_0x4e308c[_0xb1d7('0xf')][_0xb1d7('0x11')]);}logger['error'](_0xb1d7('0xa'),_0x4e9d58,_0x4e308c[_0xb1d7('0xf')][_0xb1d7('0x11')]);return _0x5eed59(_0x4e308c[_0xb1d7('0xf')][_0xb1d7('0x11')]);}else{logger[_0xb1d7('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x4e9d58,_0xb1d7('0xb'));_0x5eed59(_0x4e308c[_0xb1d7('0x13')][_0xb1d7('0x11')]);}})[_0xb1d7('0x14')](function(_0x3cd53c){logger[_0xb1d7('0xf')](_0xb1d7('0xa'),_0x4e9d58,_0x3cd53c);_0x147bc0(_0x3cd53c);});});}exports[_0xb1d7('0x15')]=function(_0x560b9d){var _0x17cce2=this;return new Promise(function(_0x59318d,_0x1cdca8){return db[_0xb1d7('0x16')][_0xb1d7('0x17')]({'raw':_0x560b9d[_0xb1d7('0x18')]?_0x560b9d['options'][_0xb1d7('0x19')]===undefined?!![]:![]:!![],'where':_0x560b9d[_0xb1d7('0x18')]?_0x560b9d[_0xb1d7('0x18')][_0xb1d7('0x1a')]||null:null,'attributes':_0x560b9d[_0xb1d7('0x18')]?_0x560b9d[_0xb1d7('0x18')][_0xb1d7('0x1b')]||null:null,'limit':_0x560b9d[_0xb1d7('0x18')]?_0x560b9d[_0xb1d7('0x18')]['limit']||null:null,'include':_0x560b9d[_0xb1d7('0x18')]?_0x560b9d[_0xb1d7('0x18')][_0xb1d7('0x1c')]?_[_0xb1d7('0x1d')](_0x560b9d[_0xb1d7('0x18')][_0xb1d7('0x1c')],function(_0x1c61cc){return{'model':db[_0x1c61cc['model']],'as':_0x1c61cc['as'],'attributes':_0x1c61cc['attributes'],'include':_0x1c61cc['include']?_[_0xb1d7('0x1d')](_0x1c61cc['include'],function(_0x2689f4){return{'model':db[_0x2689f4[_0xb1d7('0x1e')]],'as':_0x2689f4['as'],'attributes':_0x2689f4['attributes'],'include':_0x2689f4[_0xb1d7('0x1c')]?_['map'](_0x2689f4[_0xb1d7('0x1c')],function(_0x4c2499){return{'model':db[_0x4c2499['model']],'as':_0x4c2499['as'],'attributes':_0x4c2499[_0xb1d7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb1d7('0x1f')](function(_0x145dd7){logger['info'](_0xb1d7('0x15'),_0x560b9d);logger[_0xb1d7('0xc')](_0xb1d7('0x15'),_0x560b9d,JSON['stringify'](_0x145dd7));_0x59318d(_0x145dd7);})[_0xb1d7('0x14')](function(_0x1941be){logger[_0xb1d7('0xf')](_0xb1d7('0x15'),_0x1941be[_0xb1d7('0x11')],_0x560b9d);_0x1cdca8(_0x17cce2[_0xb1d7('0xf')](0x1f4,_0x1941be[_0xb1d7('0x11')]));});});};exports[_0xb1d7('0x20')]=function(_0xd9d951){var _0x2c651e=this;return new Promise(function(_0x5077dd,_0x137834){return db['ZendeskAccount'][_0xb1d7('0x21')]({'raw':_0xd9d951[_0xb1d7('0x18')]?_0xd9d951[_0xb1d7('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xd9d951[_0xb1d7('0x18')]?_0xd9d951[_0xb1d7('0x18')][_0xb1d7('0x1a')]||null:null,'attributes':_0xd9d951['options']?_0xd9d951[_0xb1d7('0x18')][_0xb1d7('0x1b')]||null:null,'include':_0xd9d951[_0xb1d7('0x18')]?_0xd9d951['options']['include']?_['map'](_0xd9d951[_0xb1d7('0x18')][_0xb1d7('0x1c')],function(_0x480d69){return{'model':db[_0x480d69[_0xb1d7('0x1e')]],'as':_0x480d69['as'],'attributes':_0x480d69[_0xb1d7('0x1b')],'include':_0x480d69['include']?_[_0xb1d7('0x1d')](_0x480d69[_0xb1d7('0x1c')],function(_0x42ee4c){return{'model':db[_0x42ee4c[_0xb1d7('0x1e')]],'as':_0x42ee4c['as'],'attributes':_0x42ee4c[_0xb1d7('0x1b')],'include':_0x42ee4c['include']?_[_0xb1d7('0x1d')](_0x42ee4c[_0xb1d7('0x1c')],function(_0x566acd){return{'model':db[_0x566acd[_0xb1d7('0x1e')]],'as':_0x566acd['as'],'attributes':_0x566acd['attributes']};}):[]};}):[]};}):[]:[]})[_0xb1d7('0x1f')](function(_0x4d1e0b){logger[_0xb1d7('0x12')]('ShowZendeskAccount',_0xd9d951);logger['debug'](_0xb1d7('0x20'),_0xd9d951,JSON[_0xb1d7('0xe')](_0x4d1e0b));_0x5077dd(_0x4d1e0b);})[_0xb1d7('0x14')](function(_0xd4b3c4){logger['error'](_0xb1d7('0x20'),_0xd4b3c4[_0xb1d7('0x11')],_0xd9d951);_0x137834(_0x2c651e[_0xb1d7('0xf')](0x1f4,_0xd4b3c4[_0xb1d7('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index a765f12..9efc921 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 _0x4024=['util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id/fields','getDescriptions','/:id/tags','getTags','create','post','setTags','put','/:id','update','delete','destroy','exports','multer'];(function(_0xc87d08,_0x59c9be){var _0x30a714=function(_0x437c0d){while(--_0x437c0d){_0xc87d08['push'](_0xc87d08['shift']());}};_0x30a714(++_0x59c9be);}(_0x4024,0x89));var _0x4402=function(_0x33d4a7,_0x1d4d6d){_0x33d4a7=_0x33d4a7-0x0;var _0x3eb6d9=_0x4024[_0x33d4a7];return _0x3eb6d9;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var fs_extra=require(_0x4402('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var controller=require('./intZendeskConfiguration.controller');router['get']('/',auth[_0x4402('0x7')](),controller[_0x4402('0x8')]);router[_0x4402('0x9')]('/:id',auth[_0x4402('0x7')](),controller['show']);router['get'](_0x4402('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0x4402('0x9')]('/:id/subjects',auth[_0x4402('0x7')](),controller['getSubjects']);router[_0x4402('0x9')]('/:id/descriptions',auth[_0x4402('0x7')](),controller[_0x4402('0xb')]);router['get'](_0x4402('0xc'),auth[_0x4402('0x7')](),controller[_0x4402('0xd')]);router['post']('/',auth[_0x4402('0x7')](),controller[_0x4402('0xe')]);router[_0x4402('0xf')](_0x4402('0xc'),auth[_0x4402('0x7')](),controller[_0x4402('0x10')]);router[_0x4402('0x11')](_0x4402('0x12'),auth[_0x4402('0x7')](),controller[_0x4402('0x13')]);router[_0x4402('0x14')](_0x4402('0x12'),auth[_0x4402('0x7')](),controller[_0x4402('0x15')]);module[_0x4402('0x16')]=router; \ No newline at end of file +var _0x878f=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','/:id/fields','/:id/subjects','isAuthenticated','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3df223,_0x1740fc){var _0x562d11=function(_0x343009){while(--_0x343009){_0x3df223['push'](_0x3df223['shift']());}};_0x562d11(++_0x1740fc);}(_0x878f,0x173));var _0xf878=function(_0x36614e,_0x260295){_0x36614e=_0x36614e-0x0;var _0x20c610=_0x878f[_0x36614e];return _0x20c610;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xf878('0xa')](_0xf878('0xd'),auth[_0xf878('0xe')](),controller['getSubjects']);router[_0xf878('0xa')](_0xf878('0xf'),auth['isAuthenticated'](),controller[_0xf878('0x10')]);router['get'](_0xf878('0x11'),auth[_0xf878('0xe')](),controller[_0xf878('0x12')]);router['post']('/',auth[_0xf878('0xe')](),controller[_0xf878('0x13')]);router[_0xf878('0x14')]('/:id/tags',auth[_0xf878('0xe')](),controller[_0xf878('0x15')]);router[_0xf878('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xf878('0x17')]);router[_0xf878('0x18')](_0xf878('0xb'),auth[_0xf878('0xe')](),controller[_0xf878('0x19')]);module[_0xf878('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 6fd60fb..8d6c617 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 _0x1012=['exports','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1012,0x1be));var _0x2101=function(_0x3b9d5f,_0x2e9039){_0x3b9d5f=_0x3b9d5f-0x0;var _0x39924e=_0x1012[_0x3b9d5f];return _0x39924e;};'use strict';var Sequelize=require(_0x2101('0x0'));module[_0x2101('0x1')]={'name':{'type':Sequelize[_0x2101('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x99d9=['exports','STRING','sequelize'];(function(_0x5bd626,_0xdbf46d){var _0x2661ca=function(_0x421ff4){while(--_0x421ff4){_0x5bd626['push'](_0x5bd626['shift']());}};_0x2661ca(++_0xdbf46d);}(_0x99d9,0x13d));var _0x999d=function(_0x5eb2fb,_0x2e203e){_0x5eb2fb=_0x5eb2fb-0x0;var _0x2e5503=_0x99d9[_0x5eb2fb];return _0x2e5503;};'use strict';var Sequelize=require(_0x999d('0x0'));module[_0x999d('0x1')]={'name':{'type':Sequelize[_0x999d('0x2')]},'description':{'type':Sequelize[_0x999d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 848f21c..ac70e88 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 _0x1fdb=['name','send','index','map','ZendeskConfiguration','key','model','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','findAll','rows','catch','params','keys','rawAttributes','includeAll','options','find','create','body','findOne','ZendeskField','nolimit','getFields','getSubjects','hasOwnProperty','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error'];(function(_0x176d37,_0x22a179){var _0x536ac5=function(_0x428fd9){while(--_0x428fd9){_0x176d37['push'](_0x176d37['shift']());}};_0x536ac5(++_0x22a179);}(_0x1fdb,0x1cf));var _0xb1fd=function(_0x5d1390,_0x3797be){_0x5d1390=_0x5d1390-0x0;var _0x5b0da6=_0x1fdb[_0x5d1390];return _0x5b0da6;};'use strict';var emlformat=require(_0xb1fd('0x0'));var rimraf=require(_0xb1fd('0x1'));var zipdir=require(_0xb1fd('0x2'));var jsonpatch=require(_0xb1fd('0x3'));var rp=require(_0xb1fd('0x4'));var moment=require(_0xb1fd('0x5'));var BPromise=require(_0xb1fd('0x6'));var Mustache=require('mustache');var util=require(_0xb1fd('0x7'));var path=require('path');var sox=require(_0xb1fd('0x8'));var csv=require(_0xb1fd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1fd('0xa'));var _=require(_0xb1fd('0xb'));var squel=require(_0xb1fd('0xc'));var crypto=require('crypto');var jsforce=require(_0xb1fd('0xd'));var deskjs=require(_0xb1fd('0xe'));var toCsv=require(_0xb1fd('0x9'));var querystring=require(_0xb1fd('0xf'));var Papa=require(_0xb1fd('0x10'));var Redis=require('ioredis');var authService=require(_0xb1fd('0x11'));var qs=require(_0xb1fd('0x12'));var as=require(_0xb1fd('0x13'));var hardwareService=require(_0xb1fd('0x14'));var logger=require('../../config/logger')(_0xb1fd('0x15'));var utils=require(_0xb1fd('0x16'));var config=require(_0xb1fd('0x17'));var licenseUtil=require(_0xb1fd('0x18'));var db=require(_0xb1fd('0x19'))['db'];function respondWithStatusCode(_0x5ce1f4,_0x5093fd){_0x5093fd=_0x5093fd||0xcc;return function(_0xc19e28){if(_0xc19e28){return _0x5ce1f4['sendStatus'](_0x5093fd);}return _0x5ce1f4['status'](_0x5093fd)[_0xb1fd('0x1a')]();};}function respondWithResult(_0x2a15e4,_0x10a210){_0x10a210=_0x10a210||0xc8;return function(_0x29c9b2){if(_0x29c9b2){return _0x2a15e4[_0xb1fd('0x1b')](_0x10a210)[_0xb1fd('0x1c')](_0x29c9b2);}};}function respondWithFilteredResult(_0x477b19,_0x4e087a){return function(_0x3a6a15){if(_0x3a6a15){var _0x2baba1=typeof _0x4e087a[_0xb1fd('0x1d')]===_0xb1fd('0x1e')&&typeof _0x4e087a[_0xb1fd('0x1f')]===_0xb1fd('0x1e');var _0x595bee=_0x3a6a15[_0xb1fd('0x20')];var _0x27bc48=_0x2baba1?0x0:_0x4e087a['offset'];var _0x3e3946=_0x2baba1?_0x3a6a15['count']:_0x4e087a[_0xb1fd('0x1d')]+_0x4e087a[_0xb1fd('0x1f')];var _0x47c635;if(_0x3e3946>=_0x595bee){_0x3e3946=_0x595bee;_0x47c635=0xc8;}else{_0x47c635=0xce;}_0x477b19['status'](_0x47c635);return _0x477b19['set'](_0xb1fd('0x21'),_0x27bc48+'-'+_0x3e3946+'/'+_0x595bee)[_0xb1fd('0x1c')](_0x3a6a15);}return null;};}function patchUpdates(_0x13f4eb){return function(_0x4e9ee1){try{jsonpatch[_0xb1fd('0x22')](_0x4e9ee1,_0x13f4eb,!![]);}catch(_0x269476){return BPromise[_0xb1fd('0x23')](_0x269476);}return _0x4e9ee1['save']();};}function saveUpdates(_0x254f7a,_0x569538){return function(_0x545de6){if(_0x545de6){return _0x545de6[_0xb1fd('0x24')](_0x254f7a)[_0xb1fd('0x25')](function(_0x2e9d93){return _0x2e9d93;});}return null;};}function removeEntity(_0x2c0ee2,_0x2d916c){return function(_0x589b32){if(_0x589b32){return _0x589b32[_0xb1fd('0x26')]()['then'](function(){_0x2c0ee2[_0xb1fd('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14036f,_0x29bb3e){return function(_0x12b167){if(!_0x12b167){_0x14036f[_0xb1fd('0x27')](0x194);}return _0x12b167;};}function handleError(_0x349715,_0x15dd79){_0x15dd79=_0x15dd79||0x1f4;return function(_0x2923f7){logger[_0xb1fd('0x28')](_0x2923f7['stack']);if(_0x2923f7[_0xb1fd('0x29')]){delete _0x2923f7[_0xb1fd('0x29')];}_0x349715[_0xb1fd('0x1b')](_0x15dd79)[_0xb1fd('0x2a')](_0x2923f7);};}exports[_0xb1fd('0x2b')]=function(_0x48a23a,_0x4301f3){var _0x231f48={},_0x3159f8={},_0x2a3e51={'count':0x0,'rows':[]};var _0x269946=_[_0xb1fd('0x2c')](db[_0xb1fd('0x2d')]['rawAttributes'],function(_0x225a51){return{'name':_0x225a51['fieldName'],'type':_0x225a51['type'][_0xb1fd('0x2e')]};});_0x3159f8[_0xb1fd('0x2f')]=_[_0xb1fd('0x2c')](_0x269946,_0xb1fd('0x29'));_0x3159f8[_0xb1fd('0x30')]=_['keys'](_0x48a23a[_0xb1fd('0x30')]);_0x3159f8['filters']=_[_0xb1fd('0x31')](_0x3159f8[_0xb1fd('0x2f')],_0x3159f8['query']);_0x231f48[_0xb1fd('0x32')]=_[_0xb1fd('0x31')](_0x3159f8[_0xb1fd('0x2f')],qs['fields'](_0x48a23a['query'][_0xb1fd('0x33')]));_0x231f48[_0xb1fd('0x32')]=_0x231f48['attributes'][_0xb1fd('0x34')]?_0x231f48[_0xb1fd('0x32')]:_0x3159f8[_0xb1fd('0x2f')];if(!_0x48a23a[_0xb1fd('0x30')]['hasOwnProperty']('nolimit')){_0x231f48[_0xb1fd('0x1f')]=qs['limit'](_0x48a23a[_0xb1fd('0x30')][_0xb1fd('0x1f')]);_0x231f48['offset']=qs['offset'](_0x48a23a[_0xb1fd('0x30')][_0xb1fd('0x1d')]);}_0x231f48[_0xb1fd('0x35')]=qs['sort'](_0x48a23a[_0xb1fd('0x30')][_0xb1fd('0x36')]);_0x231f48[_0xb1fd('0x37')]=qs[_0xb1fd('0x38')](_[_0xb1fd('0x39')](_0x48a23a[_0xb1fd('0x30')],_0x3159f8[_0xb1fd('0x38')]),_0x269946);if(_0x48a23a[_0xb1fd('0x30')][_0xb1fd('0x3a')]){_0x231f48[_0xb1fd('0x37')]=_[_0xb1fd('0x3b')](_0x231f48['where'],{'$or':_[_0xb1fd('0x2c')](_0x269946,function(_0x37ce31){if(_0x37ce31[_0xb1fd('0x3c')]!==_0xb1fd('0x3d')){var _0x3977b1={};_0x3977b1[_0x37ce31[_0xb1fd('0x29')]]={'$like':'%'+_0x48a23a[_0xb1fd('0x30')][_0xb1fd('0x3a')]+'%'};return _0x3977b1;}})});}_0x231f48=_['merge']({},_0x231f48,_0x48a23a['options']);var _0x13fbf5={'where':_0x231f48[_0xb1fd('0x37')]};return db[_0xb1fd('0x2d')][_0xb1fd('0x20')](_0x13fbf5)[_0xb1fd('0x25')](function(_0x5ad146){_0x2a3e51[_0xb1fd('0x20')]=_0x5ad146;if(_0x48a23a[_0xb1fd('0x30')]['includeAll']){_0x231f48['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xb1fd('0x3e')](_0x231f48);})[_0xb1fd('0x25')](function(_0x1a935f){_0x2a3e51[_0xb1fd('0x3f')]=_0x1a935f;return _0x2a3e51;})['then'](respondWithFilteredResult(_0x4301f3,_0x231f48))[_0xb1fd('0x40')](handleError(_0x4301f3,null));};exports['show']=function(_0x40ac04,_0x2fb80c){var _0x2c8e1c={'raw':![],'where':{'id':_0x40ac04[_0xb1fd('0x41')]['id']}},_0x486e6b={};_0x486e6b[_0xb1fd('0x2f')]=_[_0xb1fd('0x42')](db[_0xb1fd('0x2d')][_0xb1fd('0x43')]);_0x486e6b['query']=_[_0xb1fd('0x42')](_0x40ac04['query']);_0x486e6b[_0xb1fd('0x38')]=_[_0xb1fd('0x31')](_0x486e6b['model'],_0x486e6b['query']);_0x2c8e1c[_0xb1fd('0x32')]=_[_0xb1fd('0x31')](_0x486e6b[_0xb1fd('0x2f')],qs['fields'](_0x40ac04[_0xb1fd('0x30')][_0xb1fd('0x33')]));_0x2c8e1c['attributes']=_0x2c8e1c[_0xb1fd('0x32')][_0xb1fd('0x34')]?_0x2c8e1c[_0xb1fd('0x32')]:_0x486e6b[_0xb1fd('0x2f')];if(_0x40ac04[_0xb1fd('0x30')][_0xb1fd('0x44')]){_0x2c8e1c['include']=[{'all':!![]}];}_0x2c8e1c=_[_0xb1fd('0x3b')]({},_0x2c8e1c,_0x40ac04[_0xb1fd('0x45')]);return db[_0xb1fd('0x2d')][_0xb1fd('0x46')](_0x2c8e1c)[_0xb1fd('0x25')](handleEntityNotFound(_0x2fb80c,null))[_0xb1fd('0x25')](respondWithResult(_0x2fb80c,null))['catch'](handleError(_0x2fb80c,null));};exports[_0xb1fd('0x47')]=function(_0x5bd053,_0x4dfb5e){return db['ZendeskConfiguration'][_0xb1fd('0x47')](_0x5bd053[_0xb1fd('0x48')],{})[_0xb1fd('0x25')](respondWithResult(_0x4dfb5e,0xc9))['catch'](handleError(_0x4dfb5e,null));};exports['update']=function(_0x4d3dbe,_0x996e51){if(_0x4d3dbe[_0xb1fd('0x48')]['id']){delete _0x4d3dbe['body']['id'];}return db[_0xb1fd('0x2d')][_0xb1fd('0x46')]({'where':{'id':_0x4d3dbe[_0xb1fd('0x41')]['id']}})['then'](handleEntityNotFound(_0x996e51,null))[_0xb1fd('0x25')](saveUpdates(_0x4d3dbe[_0xb1fd('0x48')],null))[_0xb1fd('0x25')](respondWithResult(_0x996e51,null))[_0xb1fd('0x40')](handleError(_0x996e51,null));};exports[_0xb1fd('0x26')]=function(_0x48ac04,_0x3afd08){return db['ZendeskConfiguration'][_0xb1fd('0x46')]({'where':{'id':_0x48ac04[_0xb1fd('0x41')]['id']}})[_0xb1fd('0x25')](handleEntityNotFound(_0x3afd08,null))[_0xb1fd('0x25')](removeEntity(_0x3afd08,null))[_0xb1fd('0x40')](handleError(_0x3afd08,null));};exports['getFields']=function(_0x1f52b3,_0x4b666d,_0x25fa63){var _0x3af7f7={};var _0x1ced55={};var _0xf32fc5;var _0x50fe29;return db[_0xb1fd('0x2d')][_0xb1fd('0x49')]({'where':{'id':_0x1f52b3[_0xb1fd('0x41')]['id']}})[_0xb1fd('0x25')](handleEntityNotFound(_0x4b666d,null))[_0xb1fd('0x25')](function(_0x2e80dd){if(_0x2e80dd){_0xf32fc5=_0x2e80dd;_0x1ced55[_0xb1fd('0x2f')]=_['keys'](db[_0xb1fd('0x4a')]['rawAttributes']);_0x1ced55['query']=_['keys'](_0x1f52b3[_0xb1fd('0x30')]);_0x1ced55[_0xb1fd('0x38')]=_[_0xb1fd('0x31')](_0x1ced55[_0xb1fd('0x2f')],_0x1ced55[_0xb1fd('0x30')]);_0x3af7f7[_0xb1fd('0x32')]=_['intersection'](_0x1ced55['model'],qs[_0xb1fd('0x33')](_0x1f52b3['query'][_0xb1fd('0x33')]));_0x3af7f7[_0xb1fd('0x32')]=_0x3af7f7['attributes'][_0xb1fd('0x34')]?_0x3af7f7['attributes']:_0x1ced55['model'];_0x3af7f7[_0xb1fd('0x35')]=qs[_0xb1fd('0x36')](_0x1f52b3[_0xb1fd('0x30')]['sort']);_0x3af7f7['where']=qs[_0xb1fd('0x38')](_['pick'](_0x1f52b3[_0xb1fd('0x30')],_0x1ced55['filters']));if(_0x1f52b3[_0xb1fd('0x30')][_0xb1fd('0x3a')]){_0x3af7f7[_0xb1fd('0x37')]=_[_0xb1fd('0x3b')](_0x3af7f7['where'],{'$or':_['map'](_0x3af7f7[_0xb1fd('0x32')],function(_0x42d25e){var _0x41d5c2={};_0x41d5c2[_0x42d25e]={'$like':'%'+_0x1f52b3[_0xb1fd('0x30')][_0xb1fd('0x3a')]+'%'};return _0x41d5c2;})});}_0x3af7f7=_[_0xb1fd('0x3b')]({},_0x3af7f7,_0x1f52b3[_0xb1fd('0x45')]);return _0xf32fc5['getFields'](_0x3af7f7);}})[_0xb1fd('0x25')](function(_0xd21ee6){if(_0xd21ee6){_0x50fe29=_0xd21ee6[_0xb1fd('0x34')];if(!_0x1f52b3[_0xb1fd('0x30')]['hasOwnProperty'](_0xb1fd('0x4b'))){_0x3af7f7['limit']=qs[_0xb1fd('0x1f')](_0x1f52b3[_0xb1fd('0x30')][_0xb1fd('0x1f')]);_0x3af7f7[_0xb1fd('0x1d')]=qs[_0xb1fd('0x1d')](_0x1f52b3['query'][_0xb1fd('0x1d')]);}return _0xf32fc5[_0xb1fd('0x4c')](_0x3af7f7);}})[_0xb1fd('0x25')](function(_0x10f20b){if(_0x10f20b){return _0x10f20b?{'count':_0x50fe29,'rows':_0x10f20b}:null;}})['then'](respondWithResult(_0x4b666d,null))['catch'](handleError(_0x4b666d,null));};exports[_0xb1fd('0x4d')]=function(_0x1357fe,_0x8e014a,_0x1d9b04){var _0x2ffc2f={};var _0x520113={};var _0x534d9c;var _0x383192;return db[_0xb1fd('0x2d')]['findOne']({'where':{'id':_0x1357fe[_0xb1fd('0x41')]['id']}})[_0xb1fd('0x25')](handleEntityNotFound(_0x8e014a,null))[_0xb1fd('0x25')](function(_0x18e444){if(_0x18e444){_0x534d9c=_0x18e444;_0x520113[_0xb1fd('0x2f')]=_[_0xb1fd('0x42')](db[_0xb1fd('0x4a')][_0xb1fd('0x43')]);_0x520113[_0xb1fd('0x30')]=_[_0xb1fd('0x42')](_0x1357fe[_0xb1fd('0x30')]);_0x520113[_0xb1fd('0x38')]=_[_0xb1fd('0x31')](_0x520113[_0xb1fd('0x2f')],_0x520113[_0xb1fd('0x30')]);_0x2ffc2f[_0xb1fd('0x32')]=_[_0xb1fd('0x31')](_0x520113['model'],qs[_0xb1fd('0x33')](_0x1357fe[_0xb1fd('0x30')][_0xb1fd('0x33')]));_0x2ffc2f[_0xb1fd('0x32')]=_0x2ffc2f['attributes'][_0xb1fd('0x34')]?_0x2ffc2f[_0xb1fd('0x32')]:_0x520113['model'];_0x2ffc2f[_0xb1fd('0x35')]=qs[_0xb1fd('0x36')](_0x1357fe['query'][_0xb1fd('0x36')]);_0x2ffc2f[_0xb1fd('0x37')]=qs[_0xb1fd('0x38')](_[_0xb1fd('0x39')](_0x1357fe[_0xb1fd('0x30')],_0x520113[_0xb1fd('0x38')]));if(_0x1357fe[_0xb1fd('0x30')]['filter']){_0x2ffc2f[_0xb1fd('0x37')]=_['merge'](_0x2ffc2f[_0xb1fd('0x37')],{'$or':_[_0xb1fd('0x2c')](_0x2ffc2f['attributes'],function(_0x42e453){var _0x38fcd5={};_0x38fcd5[_0x42e453]={'$like':'%'+_0x1357fe[_0xb1fd('0x30')][_0xb1fd('0x3a')]+'%'};return _0x38fcd5;})});}_0x2ffc2f=_[_0xb1fd('0x3b')]({},_0x2ffc2f,_0x1357fe['options']);return _0x534d9c[_0xb1fd('0x4d')](_0x2ffc2f);}})[_0xb1fd('0x25')](function(_0x33c55f){if(_0x33c55f){_0x383192=_0x33c55f[_0xb1fd('0x34')];if(!_0x1357fe[_0xb1fd('0x30')][_0xb1fd('0x4e')](_0xb1fd('0x4b'))){_0x2ffc2f[_0xb1fd('0x1f')]=qs['limit'](_0x1357fe['query'][_0xb1fd('0x1f')]);_0x2ffc2f[_0xb1fd('0x1d')]=qs[_0xb1fd('0x1d')](_0x1357fe[_0xb1fd('0x30')][_0xb1fd('0x1d')]);}return _0x534d9c[_0xb1fd('0x4d')](_0x2ffc2f);}})[_0xb1fd('0x25')](function(_0x45a764){if(_0x45a764){return _0x45a764?{'count':_0x383192,'rows':_0x45a764}:null;}})['then'](respondWithResult(_0x8e014a,null))[_0xb1fd('0x40')](handleError(_0x8e014a,null));};exports[_0xb1fd('0x4f')]=function(_0xc7671e,_0x550932,_0x57b3dd){var _0x414fbe={};var _0x3b3309={};var _0x1f8343;var _0x5475e1;return db['ZendeskConfiguration'][_0xb1fd('0x49')]({'where':{'id':_0xc7671e[_0xb1fd('0x41')]['id']}})['then'](handleEntityNotFound(_0x550932,null))[_0xb1fd('0x25')](function(_0x15971e){if(_0x15971e){_0x1f8343=_0x15971e;_0x3b3309[_0xb1fd('0x2f')]=_[_0xb1fd('0x42')](db[_0xb1fd('0x4a')][_0xb1fd('0x43')]);_0x3b3309[_0xb1fd('0x30')]=_['keys'](_0xc7671e[_0xb1fd('0x30')]);_0x3b3309[_0xb1fd('0x38')]=_[_0xb1fd('0x31')](_0x3b3309[_0xb1fd('0x2f')],_0x3b3309[_0xb1fd('0x30')]);_0x414fbe[_0xb1fd('0x32')]=_[_0xb1fd('0x31')](_0x3b3309[_0xb1fd('0x2f')],qs[_0xb1fd('0x33')](_0xc7671e[_0xb1fd('0x30')]['fields']));_0x414fbe[_0xb1fd('0x32')]=_0x414fbe[_0xb1fd('0x32')][_0xb1fd('0x34')]?_0x414fbe['attributes']:_0x3b3309[_0xb1fd('0x2f')];_0x414fbe[_0xb1fd('0x35')]=qs[_0xb1fd('0x36')](_0xc7671e[_0xb1fd('0x30')][_0xb1fd('0x36')]);_0x414fbe['where']=qs[_0xb1fd('0x38')](_[_0xb1fd('0x39')](_0xc7671e[_0xb1fd('0x30')],_0x3b3309[_0xb1fd('0x38')]));if(_0xc7671e[_0xb1fd('0x30')][_0xb1fd('0x3a')]){_0x414fbe[_0xb1fd('0x37')]=_[_0xb1fd('0x3b')](_0x414fbe['where'],{'$or':_[_0xb1fd('0x2c')](_0x414fbe[_0xb1fd('0x32')],function(_0x35d14a){var _0x3bdd78={};_0x3bdd78[_0x35d14a]={'$like':'%'+_0xc7671e[_0xb1fd('0x30')][_0xb1fd('0x3a')]+'%'};return _0x3bdd78;})});}_0x414fbe=_[_0xb1fd('0x3b')]({},_0x414fbe,_0xc7671e[_0xb1fd('0x45')]);return _0x1f8343[_0xb1fd('0x4f')](_0x414fbe);}})['then'](function(_0xd7ad28){if(_0xd7ad28){_0x5475e1=_0xd7ad28[_0xb1fd('0x34')];if(!_0xc7671e[_0xb1fd('0x30')][_0xb1fd('0x4e')](_0xb1fd('0x4b'))){_0x414fbe[_0xb1fd('0x1f')]=qs[_0xb1fd('0x1f')](_0xc7671e['query'][_0xb1fd('0x1f')]);_0x414fbe[_0xb1fd('0x1d')]=qs['offset'](_0xc7671e[_0xb1fd('0x30')][_0xb1fd('0x1d')]);}return _0x1f8343['getDescriptions'](_0x414fbe);}})['then'](function(_0x4d1ceb){if(_0x4d1ceb){return _0x4d1ceb?{'count':_0x5475e1,'rows':_0x4d1ceb}:null;}})[_0xb1fd('0x25')](respondWithResult(_0x550932,null))[_0xb1fd('0x40')](handleError(_0x550932,null));};exports[_0xb1fd('0x50')]=function(_0x160879,_0x3d1aec,_0x17090b){var _0x581d3e={};var _0x1f9520={};var _0x148b03;var _0x15af4e;return db[_0xb1fd('0x2d')][_0xb1fd('0x49')]({'where':{'id':_0x160879[_0xb1fd('0x41')]['id']}})[_0xb1fd('0x25')](handleEntityNotFound(_0x3d1aec,null))[_0xb1fd('0x25')](function(_0x20bd2f){if(_0x20bd2f){_0x148b03=_0x20bd2f;_0x1f9520[_0xb1fd('0x2f')]=_[_0xb1fd('0x42')](db[_0xb1fd('0x51')][_0xb1fd('0x43')]);_0x1f9520[_0xb1fd('0x30')]=_['keys'](_0x160879[_0xb1fd('0x30')]);_0x1f9520[_0xb1fd('0x38')]=_[_0xb1fd('0x31')](_0x1f9520['model'],_0x1f9520[_0xb1fd('0x30')]);_0x581d3e[_0xb1fd('0x32')]=_[_0xb1fd('0x31')](_0x1f9520['model'],qs[_0xb1fd('0x33')](_0x160879[_0xb1fd('0x30')][_0xb1fd('0x33')]));_0x581d3e[_0xb1fd('0x32')]=_0x581d3e[_0xb1fd('0x32')][_0xb1fd('0x34')]?_0x581d3e[_0xb1fd('0x32')]:_0x1f9520[_0xb1fd('0x2f')];_0x581d3e[_0xb1fd('0x35')]=qs[_0xb1fd('0x36')](_0x160879[_0xb1fd('0x30')][_0xb1fd('0x36')]);_0x581d3e[_0xb1fd('0x37')]=qs[_0xb1fd('0x38')](_[_0xb1fd('0x39')](_0x160879[_0xb1fd('0x30')],_0x1f9520[_0xb1fd('0x38')]));if(_0x160879[_0xb1fd('0x30')][_0xb1fd('0x3a')]){_0x581d3e[_0xb1fd('0x37')]=_[_0xb1fd('0x3b')](_0x581d3e[_0xb1fd('0x37')],{'$or':_[_0xb1fd('0x2c')](_0x581d3e[_0xb1fd('0x32')],function(_0x57ba33){var _0x477b5d={};_0x477b5d[_0x57ba33]={'$like':'%'+_0x160879[_0xb1fd('0x30')][_0xb1fd('0x3a')]+'%'};return _0x477b5d;})});}_0x581d3e=_['merge']({},_0x581d3e,_0x160879[_0xb1fd('0x45')]);return _0x148b03[_0xb1fd('0x50')](_0x581d3e);}})[_0xb1fd('0x25')](function(_0x2cc933){if(_0x2cc933){_0x15af4e=_0x2cc933['length'];if(!_0x160879['query'][_0xb1fd('0x4e')]('nolimit')){_0x581d3e[_0xb1fd('0x1f')]=qs[_0xb1fd('0x1f')](_0x160879[_0xb1fd('0x30')]['limit']);_0x581d3e[_0xb1fd('0x1d')]=qs['offset'](_0x160879[_0xb1fd('0x30')]['offset']);}return _0x148b03['getTags'](_0x581d3e);}})[_0xb1fd('0x25')](function(_0xd1389b){if(_0xd1389b){return _0xd1389b?{'count':_0x15af4e,'rows':_0xd1389b}:null;}})[_0xb1fd('0x25')](respondWithResult(_0x3d1aec,null))[_0xb1fd('0x40')](handleError(_0x3d1aec,null));};exports[_0xb1fd('0x52')]=function(_0x454f75,_0x86a42a,_0x5b4f22){if(_0x454f75['body']['id']){delete _0x454f75['body']['id'];}return db[_0xb1fd('0x2d')]['findOne']({'where':{'id':_0x454f75[_0xb1fd('0x41')]['id']}})[_0xb1fd('0x25')](handleEntityNotFound(_0x86a42a,null))[_0xb1fd('0x25')](function(_0x15273d){if(_0x15273d){return _0x15273d['setTags'](_0x454f75[_0xb1fd('0x48')][_0xb1fd('0x53')]||[]);}return null;})[_0xb1fd('0x25')](respondWithResult(_0x86a42a,null))['catch'](handleError(_0x86a42a,null));}; \ No newline at end of file +var _0x6da2=['ejs','fs-extra','lodash','crypto','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','length','find','create','body','update','findOne','ZendeskField','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv'];(function(_0x590ed9,_0x5fc7da){var _0x7c90ef=function(_0x2c01e3){while(--_0x2c01e3){_0x590ed9['push'](_0x590ed9['shift']());}};_0x7c90ef(++_0x5fc7da);}(_0x6da2,0x99));var _0x26da=function(_0x354803,_0x3b56d8){_0x354803=_0x354803-0x0;var _0x2e30ba=_0x6da2[_0x354803];return _0x2e30ba;};'use strict';var emlformat=require(_0x26da('0x0'));var rimraf=require(_0x26da('0x1'));var zipdir=require(_0x26da('0x2'));var jsonpatch=require(_0x26da('0x3'));var rp=require('request-promise');var moment=require(_0x26da('0x4'));var BPromise=require(_0x26da('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x26da('0x6'));var sox=require(_0x26da('0x7'));var csv=require(_0x26da('0x8'));var ejs=require(_0x26da('0x9'));var fs=require('fs');var fs_extra=require(_0x26da('0xa'));var _=require(_0x26da('0xb'));var squel=require('squel');var crypto=require(_0x26da('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x26da('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x26da('0xd'));var authService=require(_0x26da('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x26da('0xf'));var hardwareService=require(_0x26da('0x10'));var logger=require(_0x26da('0x11'))(_0x26da('0x12'));var utils=require(_0x26da('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x26da('0x14'));var db=require(_0x26da('0x15'))['db'];function respondWithStatusCode(_0x46fba1,_0x45b2db){_0x45b2db=_0x45b2db||0xcc;return function(_0x4629f8){if(_0x4629f8){return _0x46fba1[_0x26da('0x16')](_0x45b2db);}return _0x46fba1[_0x26da('0x17')](_0x45b2db)[_0x26da('0x18')]();};}function respondWithResult(_0x361bd2,_0x3e341d){_0x3e341d=_0x3e341d||0xc8;return function(_0x5037e0){if(_0x5037e0){return _0x361bd2[_0x26da('0x17')](_0x3e341d)[_0x26da('0x19')](_0x5037e0);}};}function respondWithFilteredResult(_0x4258cc,_0x5e3598){return function(_0x9e0e3d){if(_0x9e0e3d){var _0x2113ee=typeof _0x5e3598[_0x26da('0x1a')]===_0x26da('0x1b')&&typeof _0x5e3598[_0x26da('0x1c')]==='undefined';var _0x4c1469=_0x9e0e3d[_0x26da('0x1d')];var _0x58b704=_0x2113ee?0x0:_0x5e3598[_0x26da('0x1a')];var _0x52da8b=_0x2113ee?_0x9e0e3d[_0x26da('0x1d')]:_0x5e3598[_0x26da('0x1a')]+_0x5e3598[_0x26da('0x1c')];var _0x2d42d0;if(_0x52da8b>=_0x4c1469){_0x52da8b=_0x4c1469;_0x2d42d0=0xc8;}else{_0x2d42d0=0xce;}_0x4258cc[_0x26da('0x17')](_0x2d42d0);return _0x4258cc[_0x26da('0x1e')](_0x26da('0x1f'),_0x58b704+'-'+_0x52da8b+'/'+_0x4c1469)[_0x26da('0x19')](_0x9e0e3d);}return null;};}function patchUpdates(_0x45202a){return function(_0x3a7a28){try{jsonpatch[_0x26da('0x20')](_0x3a7a28,_0x45202a,!![]);}catch(_0x811736){return BPromise[_0x26da('0x21')](_0x811736);}return _0x3a7a28[_0x26da('0x22')]();};}function saveUpdates(_0x481cef,_0x2a410c){return function(_0x29a079){if(_0x29a079){return _0x29a079['update'](_0x481cef)[_0x26da('0x23')](function(_0x341a32){return _0x341a32;});}return null;};}function removeEntity(_0x3b46ab,_0x114248){return function(_0x1594c1){if(_0x1594c1){return _0x1594c1[_0x26da('0x24')]()[_0x26da('0x23')](function(){_0x3b46ab[_0x26da('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x370060,_0x1e319c){return function(_0x29052d){if(!_0x29052d){_0x370060[_0x26da('0x16')](0x194);}return _0x29052d;};}function handleError(_0x55e940,_0x552026){_0x552026=_0x552026||0x1f4;return function(_0x135901){logger['error'](_0x135901[_0x26da('0x25')]);if(_0x135901['name']){delete _0x135901[_0x26da('0x26')];}_0x55e940[_0x26da('0x17')](_0x552026)[_0x26da('0x27')](_0x135901);};}exports[_0x26da('0x28')]=function(_0x23d6b9,_0x205ff6){var _0x2ff43a={},_0x211006={},_0x4c7492={'count':0x0,'rows':[]};var _0x32ca5a=_[_0x26da('0x29')](db[_0x26da('0x2a')][_0x26da('0x2b')],function(_0x40531a){return{'name':_0x40531a[_0x26da('0x2c')],'type':_0x40531a[_0x26da('0x2d')][_0x26da('0x2e')]};});_0x211006['model']=_[_0x26da('0x29')](_0x32ca5a,'name');_0x211006[_0x26da('0x2f')]=_[_0x26da('0x30')](_0x23d6b9[_0x26da('0x2f')]);_0x211006['filters']=_[_0x26da('0x31')](_0x211006[_0x26da('0x32')],_0x211006[_0x26da('0x2f')]);_0x2ff43a[_0x26da('0x33')]=_['intersection'](_0x211006[_0x26da('0x32')],qs[_0x26da('0x34')](_0x23d6b9['query']['fields']));_0x2ff43a[_0x26da('0x33')]=_0x2ff43a[_0x26da('0x33')]['length']?_0x2ff43a[_0x26da('0x33')]:_0x211006['model'];if(!_0x23d6b9[_0x26da('0x2f')]['hasOwnProperty']('nolimit')){_0x2ff43a[_0x26da('0x1c')]=qs['limit'](_0x23d6b9[_0x26da('0x2f')][_0x26da('0x1c')]);_0x2ff43a[_0x26da('0x1a')]=qs[_0x26da('0x1a')](_0x23d6b9['query']['offset']);}_0x2ff43a[_0x26da('0x35')]=qs['sort'](_0x23d6b9[_0x26da('0x2f')][_0x26da('0x36')]);_0x2ff43a[_0x26da('0x37')]=qs[_0x26da('0x38')](_[_0x26da('0x39')](_0x23d6b9[_0x26da('0x2f')],_0x211006[_0x26da('0x38')]),_0x32ca5a);if(_0x23d6b9[_0x26da('0x2f')][_0x26da('0x3a')]){_0x2ff43a[_0x26da('0x37')]=_[_0x26da('0x3b')](_0x2ff43a[_0x26da('0x37')],{'$or':_[_0x26da('0x29')](_0x32ca5a,function(_0x11edd5){if(_0x11edd5[_0x26da('0x2d')]!=='VIRTUAL'){var _0x300c38={};_0x300c38[_0x11edd5[_0x26da('0x26')]]={'$like':'%'+_0x23d6b9[_0x26da('0x2f')][_0x26da('0x3a')]+'%'};return _0x300c38;}})});}_0x2ff43a=_[_0x26da('0x3b')]({},_0x2ff43a,_0x23d6b9[_0x26da('0x3c')]);var _0x42257a={'where':_0x2ff43a[_0x26da('0x37')]};return db[_0x26da('0x2a')][_0x26da('0x1d')](_0x42257a)[_0x26da('0x23')](function(_0xb9a2ce){_0x4c7492[_0x26da('0x1d')]=_0xb9a2ce;if(_0x23d6b9[_0x26da('0x2f')][_0x26da('0x3d')]){_0x2ff43a[_0x26da('0x3e')]=[{'all':!![]}];}return db[_0x26da('0x2a')][_0x26da('0x3f')](_0x2ff43a);})[_0x26da('0x23')](function(_0xee765f){_0x4c7492['rows']=_0xee765f;return _0x4c7492;})[_0x26da('0x23')](respondWithFilteredResult(_0x205ff6,_0x2ff43a))[_0x26da('0x40')](handleError(_0x205ff6,null));};exports['show']=function(_0x26a16c,_0x4f926c){var _0x117b7f={'raw':![],'where':{'id':_0x26a16c[_0x26da('0x41')]['id']}},_0xff8e09={};_0xff8e09['model']=_['keys'](db[_0x26da('0x2a')][_0x26da('0x2b')]);_0xff8e09['query']=_[_0x26da('0x30')](_0x26a16c[_0x26da('0x2f')]);_0xff8e09[_0x26da('0x38')]=_['intersection'](_0xff8e09[_0x26da('0x32')],_0xff8e09[_0x26da('0x2f')]);_0x117b7f[_0x26da('0x33')]=_['intersection'](_0xff8e09[_0x26da('0x32')],qs[_0x26da('0x34')](_0x26a16c[_0x26da('0x2f')]['fields']));_0x117b7f[_0x26da('0x33')]=_0x117b7f[_0x26da('0x33')][_0x26da('0x42')]?_0x117b7f[_0x26da('0x33')]:_0xff8e09[_0x26da('0x32')];if(_0x26a16c['query'][_0x26da('0x3d')]){_0x117b7f[_0x26da('0x3e')]=[{'all':!![]}];}_0x117b7f=_[_0x26da('0x3b')]({},_0x117b7f,_0x26a16c['options']);return db[_0x26da('0x2a')][_0x26da('0x43')](_0x117b7f)['then'](handleEntityNotFound(_0x4f926c,null))[_0x26da('0x23')](respondWithResult(_0x4f926c,null))[_0x26da('0x40')](handleError(_0x4f926c,null));};exports[_0x26da('0x44')]=function(_0x3830ea,_0x3f0e9d){return db[_0x26da('0x2a')][_0x26da('0x44')](_0x3830ea[_0x26da('0x45')],{})[_0x26da('0x23')](respondWithResult(_0x3f0e9d,0xc9))[_0x26da('0x40')](handleError(_0x3f0e9d,null));};exports[_0x26da('0x46')]=function(_0x5ae133,_0x1282b8){if(_0x5ae133[_0x26da('0x45')]['id']){delete _0x5ae133[_0x26da('0x45')]['id'];}return db[_0x26da('0x2a')]['find']({'where':{'id':_0x5ae133[_0x26da('0x41')]['id']}})['then'](handleEntityNotFound(_0x1282b8,null))[_0x26da('0x23')](saveUpdates(_0x5ae133[_0x26da('0x45')],null))['then'](respondWithResult(_0x1282b8,null))['catch'](handleError(_0x1282b8,null));};exports[_0x26da('0x24')]=function(_0x4b8fac,_0x23af13){return db[_0x26da('0x2a')][_0x26da('0x43')]({'where':{'id':_0x4b8fac[_0x26da('0x41')]['id']}})['then'](handleEntityNotFound(_0x23af13,null))[_0x26da('0x23')](removeEntity(_0x23af13,null))[_0x26da('0x40')](handleError(_0x23af13,null));};exports['getFields']=function(_0xd9b9d,_0x56b31c,_0xb56e6b){var _0x1fbf3d={};var _0x2960da={};var _0x283a23;var _0x5dc6bf;return db[_0x26da('0x2a')][_0x26da('0x47')]({'where':{'id':_0xd9b9d[_0x26da('0x41')]['id']}})[_0x26da('0x23')](handleEntityNotFound(_0x56b31c,null))[_0x26da('0x23')](function(_0x3e6de6){if(_0x3e6de6){_0x283a23=_0x3e6de6;_0x2960da['model']=_[_0x26da('0x30')](db[_0x26da('0x48')][_0x26da('0x2b')]);_0x2960da[_0x26da('0x2f')]=_[_0x26da('0x30')](_0xd9b9d[_0x26da('0x2f')]);_0x2960da[_0x26da('0x38')]=_[_0x26da('0x31')](_0x2960da[_0x26da('0x32')],_0x2960da[_0x26da('0x2f')]);_0x1fbf3d[_0x26da('0x33')]=_[_0x26da('0x31')](_0x2960da['model'],qs[_0x26da('0x34')](_0xd9b9d[_0x26da('0x2f')][_0x26da('0x34')]));_0x1fbf3d[_0x26da('0x33')]=_0x1fbf3d['attributes']['length']?_0x1fbf3d[_0x26da('0x33')]:_0x2960da['model'];_0x1fbf3d['order']=qs[_0x26da('0x36')](_0xd9b9d[_0x26da('0x2f')][_0x26da('0x36')]);_0x1fbf3d['where']=qs[_0x26da('0x38')](_[_0x26da('0x39')](_0xd9b9d[_0x26da('0x2f')],_0x2960da[_0x26da('0x38')]));if(_0xd9b9d[_0x26da('0x2f')]['filter']){_0x1fbf3d[_0x26da('0x37')]=_[_0x26da('0x3b')](_0x1fbf3d[_0x26da('0x37')],{'$or':_['map'](_0x1fbf3d[_0x26da('0x33')],function(_0x36b9e6){var _0x472da5={};_0x472da5[_0x36b9e6]={'$like':'%'+_0xd9b9d['query']['filter']+'%'};return _0x472da5;})});}_0x1fbf3d=_['merge']({},_0x1fbf3d,_0xd9b9d['options']);return _0x283a23[_0x26da('0x49')](_0x1fbf3d);}})[_0x26da('0x23')](function(_0x124e09){if(_0x124e09){_0x5dc6bf=_0x124e09['length'];if(!_0xd9b9d[_0x26da('0x2f')][_0x26da('0x4a')](_0x26da('0x4b'))){_0x1fbf3d[_0x26da('0x1c')]=qs[_0x26da('0x1c')](_0xd9b9d['query'][_0x26da('0x1c')]);_0x1fbf3d['offset']=qs[_0x26da('0x1a')](_0xd9b9d['query'][_0x26da('0x1a')]);}return _0x283a23['getFields'](_0x1fbf3d);}})[_0x26da('0x23')](function(_0x2d65cd){if(_0x2d65cd){return _0x2d65cd?{'count':_0x5dc6bf,'rows':_0x2d65cd}:null;}})['then'](respondWithResult(_0x56b31c,null))[_0x26da('0x40')](handleError(_0x56b31c,null));};exports[_0x26da('0x4c')]=function(_0x5e72b3,_0x185e8b,_0x240eea){var _0x82deb5={};var _0x234e5e={};var _0x2ad415;var _0x404cb4;return db[_0x26da('0x2a')][_0x26da('0x47')]({'where':{'id':_0x5e72b3[_0x26da('0x41')]['id']}})[_0x26da('0x23')](handleEntityNotFound(_0x185e8b,null))[_0x26da('0x23')](function(_0x4de6f7){if(_0x4de6f7){_0x2ad415=_0x4de6f7;_0x234e5e[_0x26da('0x32')]=_[_0x26da('0x30')](db[_0x26da('0x48')][_0x26da('0x2b')]);_0x234e5e[_0x26da('0x2f')]=_['keys'](_0x5e72b3['query']);_0x234e5e[_0x26da('0x38')]=_[_0x26da('0x31')](_0x234e5e[_0x26da('0x32')],_0x234e5e[_0x26da('0x2f')]);_0x82deb5[_0x26da('0x33')]=_[_0x26da('0x31')](_0x234e5e[_0x26da('0x32')],qs[_0x26da('0x34')](_0x5e72b3[_0x26da('0x2f')]['fields']));_0x82deb5['attributes']=_0x82deb5[_0x26da('0x33')][_0x26da('0x42')]?_0x82deb5[_0x26da('0x33')]:_0x234e5e[_0x26da('0x32')];_0x82deb5[_0x26da('0x35')]=qs[_0x26da('0x36')](_0x5e72b3[_0x26da('0x2f')][_0x26da('0x36')]);_0x82deb5[_0x26da('0x37')]=qs[_0x26da('0x38')](_[_0x26da('0x39')](_0x5e72b3['query'],_0x234e5e[_0x26da('0x38')]));if(_0x5e72b3[_0x26da('0x2f')][_0x26da('0x3a')]){_0x82deb5[_0x26da('0x37')]=_[_0x26da('0x3b')](_0x82deb5[_0x26da('0x37')],{'$or':_['map'](_0x82deb5[_0x26da('0x33')],function(_0x4bb3cf){var _0x558b71={};_0x558b71[_0x4bb3cf]={'$like':'%'+_0x5e72b3[_0x26da('0x2f')][_0x26da('0x3a')]+'%'};return _0x558b71;})});}_0x82deb5=_[_0x26da('0x3b')]({},_0x82deb5,_0x5e72b3[_0x26da('0x3c')]);return _0x2ad415[_0x26da('0x4c')](_0x82deb5);}})['then'](function(_0x76446){if(_0x76446){_0x404cb4=_0x76446['length'];if(!_0x5e72b3['query'][_0x26da('0x4a')](_0x26da('0x4b'))){_0x82deb5[_0x26da('0x1c')]=qs['limit'](_0x5e72b3[_0x26da('0x2f')][_0x26da('0x1c')]);_0x82deb5['offset']=qs[_0x26da('0x1a')](_0x5e72b3['query'][_0x26da('0x1a')]);}return _0x2ad415['getSubjects'](_0x82deb5);}})['then'](function(_0x1f6e24){if(_0x1f6e24){return _0x1f6e24?{'count':_0x404cb4,'rows':_0x1f6e24}:null;}})[_0x26da('0x23')](respondWithResult(_0x185e8b,null))[_0x26da('0x40')](handleError(_0x185e8b,null));};exports[_0x26da('0x4d')]=function(_0xe43a35,_0x51f8e2,_0x22c2e0){var _0x7a5084={};var _0x121076={};var _0x32532b;var _0x567934;return db[_0x26da('0x2a')][_0x26da('0x47')]({'where':{'id':_0xe43a35[_0x26da('0x41')]['id']}})[_0x26da('0x23')](handleEntityNotFound(_0x51f8e2,null))[_0x26da('0x23')](function(_0x5c439b){if(_0x5c439b){_0x32532b=_0x5c439b;_0x121076[_0x26da('0x32')]=_[_0x26da('0x30')](db['ZendeskField']['rawAttributes']);_0x121076[_0x26da('0x2f')]=_[_0x26da('0x30')](_0xe43a35[_0x26da('0x2f')]);_0x121076[_0x26da('0x38')]=_[_0x26da('0x31')](_0x121076[_0x26da('0x32')],_0x121076[_0x26da('0x2f')]);_0x7a5084[_0x26da('0x33')]=_['intersection'](_0x121076[_0x26da('0x32')],qs[_0x26da('0x34')](_0xe43a35[_0x26da('0x2f')][_0x26da('0x34')]));_0x7a5084['attributes']=_0x7a5084[_0x26da('0x33')]['length']?_0x7a5084['attributes']:_0x121076[_0x26da('0x32')];_0x7a5084[_0x26da('0x35')]=qs[_0x26da('0x36')](_0xe43a35[_0x26da('0x2f')][_0x26da('0x36')]);_0x7a5084['where']=qs['filters'](_[_0x26da('0x39')](_0xe43a35[_0x26da('0x2f')],_0x121076[_0x26da('0x38')]));if(_0xe43a35[_0x26da('0x2f')][_0x26da('0x3a')]){_0x7a5084[_0x26da('0x37')]=_[_0x26da('0x3b')](_0x7a5084[_0x26da('0x37')],{'$or':_[_0x26da('0x29')](_0x7a5084[_0x26da('0x33')],function(_0x34a499){var _0x3fb383={};_0x3fb383[_0x34a499]={'$like':'%'+_0xe43a35[_0x26da('0x2f')][_0x26da('0x3a')]+'%'};return _0x3fb383;})});}_0x7a5084=_[_0x26da('0x3b')]({},_0x7a5084,_0xe43a35[_0x26da('0x3c')]);return _0x32532b['getDescriptions'](_0x7a5084);}})[_0x26da('0x23')](function(_0x5ebf92){if(_0x5ebf92){_0x567934=_0x5ebf92['length'];if(!_0xe43a35['query']['hasOwnProperty'](_0x26da('0x4b'))){_0x7a5084[_0x26da('0x1c')]=qs[_0x26da('0x1c')](_0xe43a35['query']['limit']);_0x7a5084[_0x26da('0x1a')]=qs['offset'](_0xe43a35[_0x26da('0x2f')][_0x26da('0x1a')]);}return _0x32532b[_0x26da('0x4d')](_0x7a5084);}})['then'](function(_0x530870){if(_0x530870){return _0x530870?{'count':_0x567934,'rows':_0x530870}:null;}})['then'](respondWithResult(_0x51f8e2,null))[_0x26da('0x40')](handleError(_0x51f8e2,null));};exports[_0x26da('0x4e')]=function(_0x3a5da9,_0x58e13b,_0x272802){var _0x4b28a5={};var _0x1b3c95={};var _0x56cd4f;var _0x4c4ad4;return db[_0x26da('0x2a')][_0x26da('0x47')]({'where':{'id':_0x3a5da9[_0x26da('0x41')]['id']}})[_0x26da('0x23')](handleEntityNotFound(_0x58e13b,null))[_0x26da('0x23')](function(_0x4f764e){if(_0x4f764e){_0x56cd4f=_0x4f764e;_0x1b3c95[_0x26da('0x32')]=_['keys'](db[_0x26da('0x4f')][_0x26da('0x2b')]);_0x1b3c95[_0x26da('0x2f')]=_[_0x26da('0x30')](_0x3a5da9[_0x26da('0x2f')]);_0x1b3c95['filters']=_['intersection'](_0x1b3c95[_0x26da('0x32')],_0x1b3c95['query']);_0x4b28a5[_0x26da('0x33')]=_['intersection'](_0x1b3c95['model'],qs[_0x26da('0x34')](_0x3a5da9[_0x26da('0x2f')][_0x26da('0x34')]));_0x4b28a5['attributes']=_0x4b28a5['attributes']['length']?_0x4b28a5[_0x26da('0x33')]:_0x1b3c95['model'];_0x4b28a5[_0x26da('0x35')]=qs[_0x26da('0x36')](_0x3a5da9['query'][_0x26da('0x36')]);_0x4b28a5['where']=qs[_0x26da('0x38')](_[_0x26da('0x39')](_0x3a5da9[_0x26da('0x2f')],_0x1b3c95[_0x26da('0x38')]));if(_0x3a5da9[_0x26da('0x2f')][_0x26da('0x3a')]){_0x4b28a5['where']=_[_0x26da('0x3b')](_0x4b28a5[_0x26da('0x37')],{'$or':_[_0x26da('0x29')](_0x4b28a5[_0x26da('0x33')],function(_0x55a81d){var _0x273ac1={};_0x273ac1[_0x55a81d]={'$like':'%'+_0x3a5da9[_0x26da('0x2f')][_0x26da('0x3a')]+'%'};return _0x273ac1;})});}_0x4b28a5=_[_0x26da('0x3b')]({},_0x4b28a5,_0x3a5da9[_0x26da('0x3c')]);return _0x56cd4f[_0x26da('0x4e')](_0x4b28a5);}})[_0x26da('0x23')](function(_0x51e03b){if(_0x51e03b){_0x4c4ad4=_0x51e03b[_0x26da('0x42')];if(!_0x3a5da9[_0x26da('0x2f')]['hasOwnProperty'](_0x26da('0x4b'))){_0x4b28a5[_0x26da('0x1c')]=qs[_0x26da('0x1c')](_0x3a5da9[_0x26da('0x2f')][_0x26da('0x1c')]);_0x4b28a5[_0x26da('0x1a')]=qs[_0x26da('0x1a')](_0x3a5da9[_0x26da('0x2f')][_0x26da('0x1a')]);}return _0x56cd4f['getTags'](_0x4b28a5);}})['then'](function(_0x347a37){if(_0x347a37){return _0x347a37?{'count':_0x4c4ad4,'rows':_0x347a37}:null;}})[_0x26da('0x23')](respondWithResult(_0x58e13b,null))[_0x26da('0x40')](handleError(_0x58e13b,null));};exports[_0x26da('0x50')]=function(_0x218435,_0xb1ad08,_0x4a9f5c){if(_0x218435[_0x26da('0x45')]['id']){delete _0x218435[_0x26da('0x45')]['id'];}return db[_0x26da('0x2a')][_0x26da('0x47')]({'where':{'id':_0x218435['params']['id']}})[_0x26da('0x23')](handleEntityNotFound(_0xb1ad08,null))['then'](function(_0xd80f9a){if(_0xd80f9a){return _0xd80f9a[_0x26da('0x50')](_0x218435[_0x26da('0x45')]['ids']||[]);}return null;})[_0x26da('0x23')](respondWithResult(_0xb1ad08,null))[_0x26da('0x40')](handleError(_0xb1ad08,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index a1c295b..99b5f03 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 _0x77e6=['path','../../config/environment','./intZendeskConfiguration.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x52191a,_0x11155a){var _0x273a05=function(_0x1d8816){while(--_0x1d8816){_0x52191a['push'](_0x52191a['shift']());}};_0x273a05(++_0x11155a);}(_0x77e6,0x1a6));var _0x677e=function(_0x3c0c1e,_0x31dd30){_0x3c0c1e=_0x3c0c1e-0x0;var _0x21d142=_0x77e6[_0x3c0c1e];return _0x21d142;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var logger=require(_0x677e('0x2'))(_0x677e('0x3'));var moment=require(_0x677e('0x4'));var BPromise=require(_0x677e('0x5'));var rp=require(_0x677e('0x6'));var fs=require('fs');var path=require(_0x677e('0x7'));var rimraf=require('rimraf');var config=require(_0x677e('0x8'));var attributes=require(_0x677e('0x9'));module['exports']=function(_0x18c5e1,_0x591b21){return _0x18c5e1[_0x677e('0xa')]('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77e6=['path','../../config/environment','./intZendeskConfiguration.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1bc79b,_0x46d6f6){var _0x5eb89f=function(_0x392943){while(--_0x392943){_0x1bc79b['push'](_0x1bc79b['shift']());}};_0x5eb89f(++_0x46d6f6);}(_0x77e6,0x1a6));var _0x677e=function(_0x46f1ea,_0x234e59){_0x46f1ea=_0x46f1ea-0x0;var _0x10a3d5=_0x77e6[_0x46f1ea];return _0x10a3d5;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var logger=require(_0x677e('0x2'))(_0x677e('0x3'));var moment=require(_0x677e('0x4'));var BPromise=require(_0x677e('0x5'));var rp=require(_0x677e('0x6'));var fs=require('fs');var path=require(_0x677e('0x7'));var rimraf=require('rimraf');var config=require(_0x677e('0x8'));var attributes=require(_0x677e('0x9'));module['exports']=function(_0x18c5e1,_0x591b21){return _0x18c5e1[_0x677e('0xa')]('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 e7f0b28..ed9b46a 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 _0x18c4=['info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x27650e,_0x278f7a){var _0x28fe08=function(_0x476eee){while(--_0x476eee){_0x27650e['push'](_0x27650e['shift']());}};_0x28fe08(++_0x278f7a);}(_0x18c4,0x1be));var _0x418c=function(_0x46cfda,_0x9d3f8b){_0x46cfda=_0x46cfda-0x0;var _0x3a4943=_0x18c4[_0x46cfda];return _0x3a4943;};'use strict';var _=require(_0x418c('0x0'));var util=require(_0x418c('0x1'));var moment=require(_0x418c('0x2'));var BPromise=require('bluebird');var rs=require(_0x418c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x418c('0x4'))['db'];var utils=require(_0x418c('0x5'));var logger=require(_0x418c('0x6'))(_0x418c('0x7'));var config=require(_0x418c('0x8'));var jayson=require(_0x418c('0x9'));var client=jayson[_0x418c('0xa')][_0x418c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x367042,_0x10677a,_0x14aec1){return new BPromise(function(_0x1f5203,_0x50ac07){return client[_0x418c('0xc')](_0x367042,_0x14aec1)[_0x418c('0xd')](function(_0x26b0f4){logger[_0x418c('0xe')](_0x418c('0xf'),_0x10677a,_0x418c('0x10'));logger['debug'](_0x418c('0x11'),_0x10677a,_0x418c('0x10'),JSON[_0x418c('0x12')](_0x26b0f4));if(_0x26b0f4[_0x418c('0x13')]){if(_0x26b0f4[_0x418c('0x13')][_0x418c('0x14')]===0x1f4){logger['error'](_0x418c('0xf'),_0x10677a,_0x26b0f4[_0x418c('0x13')]['message']);return _0x50ac07(_0x26b0f4['error'][_0x418c('0x15')]);}logger[_0x418c('0x13')](_0x418c('0xf'),_0x10677a,_0x26b0f4[_0x418c('0x13')]['message']);return _0x1f5203(_0x26b0f4['error'][_0x418c('0x15')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x10677a,'request\x20sent');_0x1f5203(_0x26b0f4[_0x418c('0x16')]['message']);}})['catch'](function(_0x2cf964){logger[_0x418c('0x13')](_0x418c('0xf'),_0x10677a,_0x2cf964);_0x50ac07(_0x2cf964);});});} \ No newline at end of file +var _0xb7db=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x5f04d2,_0x24bb7f){var _0x436a6f=function(_0x4e27e4){while(--_0x4e27e4){_0x5f04d2['push'](_0x5f04d2['shift']());}};_0x436a6f(++_0x24bb7f);}(_0xb7db,0x1e9));var _0xbb7d=function(_0x3f9e4f,_0x248f80){_0x3f9e4f=_0x3f9e4f-0x0;var _0x44ff2f=_0xb7db[_0x3f9e4f];return _0x44ff2f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbb7d('0x0'));var BPromise=require(_0xbb7d('0x1'));var rs=require(_0xbb7d('0x2'));var fs=require('fs');var Redis=require(_0xbb7d('0x3'));var db=require(_0xbb7d('0x4'))['db'];var utils=require(_0xbb7d('0x5'));var logger=require(_0xbb7d('0x6'))('rpc');var config=require(_0xbb7d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbb7d('0x8')][_0xbb7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38a2bd,_0x2c87a5,_0x24e55e){return new BPromise(function(_0x958d8b,_0x45ba5c){return client[_0xbb7d('0xa')](_0x38a2bd,_0x24e55e)[_0xbb7d('0xb')](function(_0x47530f){logger[_0xbb7d('0xc')](_0xbb7d('0xd'),_0x2c87a5,_0xbb7d('0xe'));logger[_0xbb7d('0xf')](_0xbb7d('0x10'),_0x2c87a5,_0xbb7d('0xe'),JSON[_0xbb7d('0x11')](_0x47530f));if(_0x47530f[_0xbb7d('0x12')]){if(_0x47530f[_0xbb7d('0x12')]['code']===0x1f4){logger[_0xbb7d('0x12')](_0xbb7d('0xd'),_0x2c87a5,_0x47530f[_0xbb7d('0x12')][_0xbb7d('0x13')]);return _0x45ba5c(_0x47530f['error'][_0xbb7d('0x13')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x2c87a5,_0x47530f['error'][_0xbb7d('0x13')]);return _0x958d8b(_0x47530f['error'][_0xbb7d('0x13')]);}else{logger[_0xbb7d('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2c87a5,_0xbb7d('0xe'));_0x958d8b(_0x47530f['result'][_0xbb7d('0x13')]);}})[_0xbb7d('0x14')](function(_0x5a03cf){logger[_0xbb7d('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2c87a5,_0x5a03cf);_0x45ba5c(_0x5a03cf);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 21eb111..06e3771 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 _0x311b=['get','index','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x505e30,_0x4814e5){var _0x373c17=function(_0xef3e86){while(--_0xef3e86){_0x505e30['push'](_0x505e30['shift']());}};_0x373c17(++_0x4814e5);}(_0x311b,0x14b));var _0xb311=function(_0x401a89,_0x4e8025){_0x401a89=_0x401a89-0x0;var _0x2e889c=_0x311b[_0x401a89];return _0x2e889c;};'use strict';var multer=require(_0xb311('0x0'));var util=require(_0xb311('0x1'));var path=require(_0xb311('0x2'));var timeout=require(_0xb311('0x3'));var express=require(_0xb311('0x4'));var router=express[_0xb311('0x5')]();var fs_extra=require(_0xb311('0x6'));var auth=require(_0xb311('0x7'));var interaction=require(_0xb311('0x8'));var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router[_0xb311('0x9')]('/',auth['isAuthenticated'](),controller[_0xb311('0xa')]);router[_0xb311('0x9')](_0xb311('0xb'),auth['isAuthenticated'](),controller[_0xb311('0xc')]);router[_0xb311('0xd')]('/',auth[_0xb311('0xe')](),controller['create']);router[_0xb311('0xf')](_0xb311('0xb'),auth['isAuthenticated'](),controller[_0xb311('0x10')]);router[_0xb311('0x11')](_0xb311('0xb'),auth[_0xb311('0xe')](),controller[_0xb311('0x12')]);module[_0xb311('0x13')]=router; \ No newline at end of file +var _0x4cbd=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x362e90,_0x3907a2){var _0x5d595f=function(_0x2cb8c9){while(--_0x2cb8c9){_0x362e90['push'](_0x362e90['shift']());}};_0x5d595f(++_0x3907a2);}(_0x4cbd,0x1ed));var _0xd4cb=function(_0x2e93d0,_0x5d6526){_0x2e93d0=_0x2e93d0-0x0;var _0x2a88a6=_0x4cbd[_0x2e93d0];return _0x2a88a6;};'use strict';var multer=require('multer');var util=require(_0xd4cb('0x0'));var path=require(_0xd4cb('0x1'));var timeout=require(_0xd4cb('0x2'));var express=require('express');var router=express[_0xd4cb('0x3')]();var fs_extra=require(_0xd4cb('0x4'));var auth=require(_0xd4cb('0x5'));var interaction=require(_0xd4cb('0x6'));var config=require(_0xd4cb('0x7'));var controller=require(_0xd4cb('0x8'));router['get']('/',auth[_0xd4cb('0x9')](),controller[_0xd4cb('0xa')]);router[_0xd4cb('0xb')](_0xd4cb('0xc'),auth['isAuthenticated'](),controller[_0xd4cb('0xd')]);router[_0xd4cb('0xe')]('/',auth[_0xd4cb('0x9')](),controller[_0xd4cb('0xf')]);router[_0xd4cb('0x10')](_0xd4cb('0xc'),auth[_0xd4cb('0x9')](),controller['update']);router['delete'](_0xd4cb('0xc'),auth[_0xd4cb('0x9')](),controller['destroy']);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 399cf49..6afa29d 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 _0x495f=['sequelize','string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0x495f,0x129));var _0xf495=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x495f[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xf495('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xf495('0x1'),_0xf495('0x2'),_0xf495('0x3'),_0xf495('0x4'),_0xf495('0x5')),'defaultValue':_0xf495('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf495('0x6')]},'keyType':{'type':Sequelize[_0xf495('0x7')](_0xf495('0x1'),_0xf495('0x2'),_0xf495('0x3'))},'keyContent':{'type':Sequelize[_0xf495('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf495('0x6')]},'customField':{'type':Sequelize[_0xf495('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf495('0x6')]}}; \ No newline at end of file +var _0x805f=['customVariable','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x95ff77,_0x364106){var _0x4c2e64=function(_0x19f7aa){while(--_0x19f7aa){_0x95ff77['push'](_0x95ff77['shift']());}};_0x4c2e64(++_0x364106);}(_0x805f,0x1c5));var _0xf805=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x805f[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0xf805('0x0'));module[_0xf805('0x1')]={'type':{'type':Sequelize[_0xf805('0x2')]('string','variable',_0xf805('0x3'),'keyValue',_0xf805('0x4')),'defaultValue':_0xf805('0x5')},'content':{'type':Sequelize[_0xf805('0x6')]},'key':{'type':Sequelize[_0xf805('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xf805('0x5'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xf805('0x6')]},'idField':{'type':Sequelize[_0xf805('0x6')]},'nameField':{'type':Sequelize[_0xf805('0x6')]},'customField':{'type':Sequelize[_0xf805('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf805('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 63b544c..0d56e59 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 _0x7b40=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','save','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','VIRTUAL','merge','options','where','ZendeskField','includeAll','include','catch','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x271d10,_0x5348db){var _0x479491=function(_0x4eca2f){while(--_0x4eca2f){_0x271d10['push'](_0x271d10['shift']());}};_0x479491(++_0x5348db);}(_0x7b40,0x7c));var _0x07b4=function(_0x305e2e,_0x782657){_0x305e2e=_0x305e2e-0x0;var _0x38db9d=_0x7b40[_0x305e2e];return _0x38db9d;};'use strict';var emlformat=require(_0x07b4('0x0'));var rimraf=require(_0x07b4('0x1'));var zipdir=require(_0x07b4('0x2'));var jsonpatch=require(_0x07b4('0x3'));var rp=require(_0x07b4('0x4'));var moment=require(_0x07b4('0x5'));var BPromise=require(_0x07b4('0x6'));var Mustache=require(_0x07b4('0x7'));var util=require(_0x07b4('0x8'));var path=require('path');var sox=require(_0x07b4('0x9'));var csv=require('to-csv');var ejs=require(_0x07b4('0xa'));var fs=require('fs');var fs_extra=require(_0x07b4('0xb'));var _=require(_0x07b4('0xc'));var squel=require('squel');var crypto=require(_0x07b4('0xd'));var jsforce=require(_0x07b4('0xe'));var deskjs=require(_0x07b4('0xf'));var toCsv=require(_0x07b4('0x10'));var querystring=require(_0x07b4('0x11'));var Papa=require(_0x07b4('0x12'));var Redis=require(_0x07b4('0x13'));var authService=require(_0x07b4('0x14'));var qs=require(_0x07b4('0x15'));var as=require(_0x07b4('0x16'));var hardwareService=require(_0x07b4('0x17'));var logger=require(_0x07b4('0x18'))(_0x07b4('0x19'));var utils=require(_0x07b4('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x07b4('0x1b'));var db=require(_0x07b4('0x1c'))['db'];function respondWithStatusCode(_0x550755,_0x33e8d9){_0x33e8d9=_0x33e8d9||0xcc;return function(_0x39ddaa){if(_0x39ddaa){return _0x550755[_0x07b4('0x1d')](_0x33e8d9);}return _0x550755['status'](_0x33e8d9)[_0x07b4('0x1e')]();};}function respondWithResult(_0xedb37b,_0x48110d){_0x48110d=_0x48110d||0xc8;return function(_0x5d7024){if(_0x5d7024){return _0xedb37b[_0x07b4('0x1f')](_0x48110d)[_0x07b4('0x20')](_0x5d7024);}};}function respondWithFilteredResult(_0x2a74e4,_0x118ca8){return function(_0x5b3d2d){if(_0x5b3d2d){var _0x34020b=typeof _0x118ca8[_0x07b4('0x21')]==='undefined'&&typeof _0x118ca8[_0x07b4('0x22')]===_0x07b4('0x23');var _0x26b007=_0x5b3d2d[_0x07b4('0x24')];var _0x31b57b=_0x34020b?0x0:_0x118ca8[_0x07b4('0x21')];var _0x2f9bfe=_0x34020b?_0x5b3d2d[_0x07b4('0x24')]:_0x118ca8['offset']+_0x118ca8[_0x07b4('0x22')];var _0x646fdf;if(_0x2f9bfe>=_0x26b007){_0x2f9bfe=_0x26b007;_0x646fdf=0xc8;}else{_0x646fdf=0xce;}_0x2a74e4['status'](_0x646fdf);return _0x2a74e4['set'](_0x07b4('0x25'),_0x31b57b+'-'+_0x2f9bfe+'/'+_0x26b007)['json'](_0x5b3d2d);}return null;};}function patchUpdates(_0x35483f){return function(_0x284021){try{jsonpatch[_0x07b4('0x26')](_0x284021,_0x35483f,!![]);}catch(_0x35f224){return BPromise['reject'](_0x35f224);}return _0x284021[_0x07b4('0x27')]();};}function saveUpdates(_0x53fe81,_0x3370c8){return function(_0x54da65){if(_0x54da65){return _0x54da65['update'](_0x53fe81)[_0x07b4('0x28')](function(_0x13f104){return _0x13f104;});}return null;};}function removeEntity(_0x391944,_0x554770){return function(_0x2b0f46){if(_0x2b0f46){return _0x2b0f46[_0x07b4('0x29')]()[_0x07b4('0x28')](function(){_0x391944[_0x07b4('0x1f')](0xcc)[_0x07b4('0x1e')]();});}};}function handleEntityNotFound(_0x4e2c4d,_0x47d709){return function(_0x4b3276){if(!_0x4b3276){_0x4e2c4d[_0x07b4('0x1d')](0x194);}return _0x4b3276;};}function handleError(_0x5c924a,_0x232429){_0x232429=_0x232429||0x1f4;return function(_0x32a61e){logger[_0x07b4('0x2a')](_0x32a61e[_0x07b4('0x2b')]);if(_0x32a61e[_0x07b4('0x2c')]){delete _0x32a61e[_0x07b4('0x2c')];}_0x5c924a['status'](_0x232429)['send'](_0x32a61e);};}exports['index']=function(_0x1b39b3,_0xe20b0f){var _0x4cdaed={},_0x346ca8={},_0x1f2023={'count':0x0,'rows':[]};var _0x1ec4a2=_[_0x07b4('0x2d')](db['ZendeskField'][_0x07b4('0x2e')],function(_0x1bb71a){return{'name':_0x1bb71a[_0x07b4('0x2f')],'type':_0x1bb71a[_0x07b4('0x30')][_0x07b4('0x31')]};});_0x346ca8[_0x07b4('0x32')]=_[_0x07b4('0x2d')](_0x1ec4a2,_0x07b4('0x2c'));_0x346ca8[_0x07b4('0x33')]=_[_0x07b4('0x34')](_0x1b39b3[_0x07b4('0x33')]);_0x346ca8[_0x07b4('0x35')]=_[_0x07b4('0x36')](_0x346ca8['model'],_0x346ca8[_0x07b4('0x33')]);_0x4cdaed[_0x07b4('0x37')]=_['intersection'](_0x346ca8[_0x07b4('0x32')],qs['fields'](_0x1b39b3[_0x07b4('0x33')][_0x07b4('0x38')]));_0x4cdaed[_0x07b4('0x37')]=_0x4cdaed['attributes'][_0x07b4('0x39')]?_0x4cdaed[_0x07b4('0x37')]:_0x346ca8[_0x07b4('0x32')];if(!_0x1b39b3['query']['hasOwnProperty']('nolimit')){_0x4cdaed[_0x07b4('0x22')]=qs[_0x07b4('0x22')](_0x1b39b3['query']['limit']);_0x4cdaed['offset']=qs[_0x07b4('0x21')](_0x1b39b3[_0x07b4('0x33')][_0x07b4('0x21')]);}_0x4cdaed[_0x07b4('0x3a')]=qs[_0x07b4('0x3b')](_0x1b39b3['query'][_0x07b4('0x3b')]);_0x4cdaed['where']=qs[_0x07b4('0x35')](_[_0x07b4('0x3c')](_0x1b39b3[_0x07b4('0x33')],_0x346ca8[_0x07b4('0x35')]),_0x1ec4a2);if(_0x1b39b3['query'][_0x07b4('0x3d')]){_0x4cdaed['where']=_['merge'](_0x4cdaed['where'],{'$or':_[_0x07b4('0x2d')](_0x1ec4a2,function(_0x2187d9){if(_0x2187d9['type']!==_0x07b4('0x3e')){var _0x2b2c18={};_0x2b2c18[_0x2187d9[_0x07b4('0x2c')]]={'$like':'%'+_0x1b39b3[_0x07b4('0x33')]['filter']+'%'};return _0x2b2c18;}})});}_0x4cdaed=_[_0x07b4('0x3f')]({},_0x4cdaed,_0x1b39b3[_0x07b4('0x40')]);var _0x5d0e92={'where':_0x4cdaed[_0x07b4('0x41')]};return db[_0x07b4('0x42')][_0x07b4('0x24')](_0x5d0e92)[_0x07b4('0x28')](function(_0x287c7f){_0x1f2023['count']=_0x287c7f;if(_0x1b39b3[_0x07b4('0x33')][_0x07b4('0x43')]){_0x4cdaed[_0x07b4('0x44')]=[{'all':!![]}];}return db[_0x07b4('0x42')]['findAll'](_0x4cdaed);})[_0x07b4('0x28')](function(_0x3e13a){_0x1f2023['rows']=_0x3e13a;return _0x1f2023;})[_0x07b4('0x28')](respondWithFilteredResult(_0xe20b0f,_0x4cdaed))[_0x07b4('0x45')](handleError(_0xe20b0f,null));};exports['show']=function(_0x34a336,_0x58b274){var _0x5bfb26={'raw':!![],'where':{'id':_0x34a336[_0x07b4('0x46')]['id']}},_0x482e3b={};_0x482e3b[_0x07b4('0x32')]=_[_0x07b4('0x34')](db[_0x07b4('0x42')][_0x07b4('0x2e')]);_0x482e3b[_0x07b4('0x33')]=_[_0x07b4('0x34')](_0x34a336[_0x07b4('0x33')]);_0x482e3b[_0x07b4('0x35')]=_[_0x07b4('0x36')](_0x482e3b[_0x07b4('0x32')],_0x482e3b[_0x07b4('0x33')]);_0x5bfb26[_0x07b4('0x37')]=_[_0x07b4('0x36')](_0x482e3b[_0x07b4('0x32')],qs[_0x07b4('0x38')](_0x34a336['query']['fields']));_0x5bfb26['attributes']=_0x5bfb26['attributes'][_0x07b4('0x39')]?_0x5bfb26[_0x07b4('0x37')]:_0x482e3b[_0x07b4('0x32')];if(_0x34a336[_0x07b4('0x33')][_0x07b4('0x43')]){_0x5bfb26['include']=[{'all':!![]}];}_0x5bfb26=_[_0x07b4('0x3f')]({},_0x5bfb26,_0x34a336[_0x07b4('0x40')]);return db[_0x07b4('0x42')][_0x07b4('0x47')](_0x5bfb26)['then'](handleEntityNotFound(_0x58b274,null))[_0x07b4('0x28')](respondWithResult(_0x58b274,null))[_0x07b4('0x45')](handleError(_0x58b274,null));};exports[_0x07b4('0x48')]=function(_0xb3183d,_0x2dbe1b){return db[_0x07b4('0x42')][_0x07b4('0x48')](_0xb3183d[_0x07b4('0x49')],{})['then'](respondWithResult(_0x2dbe1b,0xc9))[_0x07b4('0x45')](handleError(_0x2dbe1b,null));};exports[_0x07b4('0x4a')]=function(_0x2dfc5c,_0x30035d){if(_0x2dfc5c[_0x07b4('0x49')]['id']){delete _0x2dfc5c[_0x07b4('0x49')]['id'];}return db[_0x07b4('0x42')][_0x07b4('0x47')]({'where':{'id':_0x2dfc5c[_0x07b4('0x46')]['id']}})[_0x07b4('0x28')](handleEntityNotFound(_0x30035d,null))[_0x07b4('0x28')](saveUpdates(_0x2dfc5c[_0x07b4('0x49')],null))[_0x07b4('0x28')](respondWithResult(_0x30035d,null))['catch'](handleError(_0x30035d,null));};exports[_0x07b4('0x29')]=function(_0x31c316,_0x1c05e2){return db[_0x07b4('0x42')][_0x07b4('0x47')]({'where':{'id':_0x31c316[_0x07b4('0x46')]['id']}})[_0x07b4('0x28')](handleEntityNotFound(_0x1c05e2,null))[_0x07b4('0x28')](removeEntity(_0x1c05e2,null))[_0x07b4('0x45')](handleError(_0x1c05e2,null));}; \ No newline at end of file +var _0xa0e4=['rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ZendeskField'];(function(_0x572618,_0x287468){var _0x113a44=function(_0x2d4e17){while(--_0x2d4e17){_0x572618['push'](_0x572618['shift']());}};_0x113a44(++_0x287468);}(_0xa0e4,0x1a3));var _0x4a0e=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0xa0e4[_0x1780f8];return _0x33a410;};'use strict';var emlformat=require(_0x4a0e('0x0'));var rimraf=require(_0x4a0e('0x1'));var zipdir=require(_0x4a0e('0x2'));var jsonpatch=require(_0x4a0e('0x3'));var rp=require(_0x4a0e('0x4'));var moment=require(_0x4a0e('0x5'));var BPromise=require(_0x4a0e('0x6'));var Mustache=require(_0x4a0e('0x7'));var util=require(_0x4a0e('0x8'));var path=require(_0x4a0e('0x9'));var sox=require(_0x4a0e('0xa'));var csv=require(_0x4a0e('0xb'));var ejs=require(_0x4a0e('0xc'));var fs=require('fs');var fs_extra=require(_0x4a0e('0xd'));var _=require(_0x4a0e('0xe'));var squel=require('squel');var crypto=require(_0x4a0e('0xf'));var jsforce=require(_0x4a0e('0x10'));var deskjs=require(_0x4a0e('0x11'));var toCsv=require(_0x4a0e('0xb'));var querystring=require(_0x4a0e('0x12'));var Papa=require(_0x4a0e('0x13'));var Redis=require('ioredis');var authService=require(_0x4a0e('0x14'));var qs=require(_0x4a0e('0x15'));var as=require(_0x4a0e('0x16'));var hardwareService=require(_0x4a0e('0x17'));var logger=require(_0x4a0e('0x18'))(_0x4a0e('0x19'));var utils=require('../../config/utils');var config=require(_0x4a0e('0x1a'));var licenseUtil=require(_0x4a0e('0x1b'));var db=require(_0x4a0e('0x1c'))['db'];function respondWithStatusCode(_0x12205e,_0x59f8fd){_0x59f8fd=_0x59f8fd||0xcc;return function(_0x4fa34e){if(_0x4fa34e){return _0x12205e[_0x4a0e('0x1d')](_0x59f8fd);}return _0x12205e['status'](_0x59f8fd)[_0x4a0e('0x1e')]();};}function respondWithResult(_0x1145d1,_0x1dfdc3){_0x1dfdc3=_0x1dfdc3||0xc8;return function(_0x372fc4){if(_0x372fc4){return _0x1145d1[_0x4a0e('0x1f')](_0x1dfdc3)[_0x4a0e('0x20')](_0x372fc4);}};}function respondWithFilteredResult(_0x458ae4,_0x286c99){return function(_0x4ba600){if(_0x4ba600){var _0x2ebf63=typeof _0x286c99[_0x4a0e('0x21')]==='undefined'&&typeof _0x286c99[_0x4a0e('0x22')]==='undefined';var _0xaac16f=_0x4ba600[_0x4a0e('0x23')];var _0x12306a=_0x2ebf63?0x0:_0x286c99[_0x4a0e('0x21')];var _0x77fe50=_0x2ebf63?_0x4ba600[_0x4a0e('0x23')]:_0x286c99[_0x4a0e('0x21')]+_0x286c99[_0x4a0e('0x22')];var _0x2b957f;if(_0x77fe50>=_0xaac16f){_0x77fe50=_0xaac16f;_0x2b957f=0xc8;}else{_0x2b957f=0xce;}_0x458ae4[_0x4a0e('0x1f')](_0x2b957f);return _0x458ae4['set']('Content-Range',_0x12306a+'-'+_0x77fe50+'/'+_0xaac16f)['json'](_0x4ba600);}return null;};}function patchUpdates(_0x198c67){return function(_0x49511b){try{jsonpatch[_0x4a0e('0x24')](_0x49511b,_0x198c67,!![]);}catch(_0x3d2005){return BPromise[_0x4a0e('0x25')](_0x3d2005);}return _0x49511b[_0x4a0e('0x26')]();};}function saveUpdates(_0x365551,_0xfa3778){return function(_0x3b86b6){if(_0x3b86b6){return _0x3b86b6[_0x4a0e('0x27')](_0x365551)['then'](function(_0x389d54){return _0x389d54;});}return null;};}function removeEntity(_0x4bce12,_0x36d658){return function(_0x24a958){if(_0x24a958){return _0x24a958[_0x4a0e('0x28')]()[_0x4a0e('0x29')](function(){_0x4bce12[_0x4a0e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32e5bc,_0x33ac9d){return function(_0x330c0e){if(!_0x330c0e){_0x32e5bc[_0x4a0e('0x1d')](0x194);}return _0x330c0e;};}function handleError(_0x1cbc92,_0x2b31d2){_0x2b31d2=_0x2b31d2||0x1f4;return function(_0x33d710){logger[_0x4a0e('0x2a')](_0x33d710[_0x4a0e('0x2b')]);if(_0x33d710[_0x4a0e('0x2c')]){delete _0x33d710[_0x4a0e('0x2c')];}_0x1cbc92[_0x4a0e('0x1f')](_0x2b31d2)[_0x4a0e('0x2d')](_0x33d710);};}exports[_0x4a0e('0x2e')]=function(_0xabd3e9,_0x318b1f){var _0x4fdf6d={},_0x38914b={},_0x1fe641={'count':0x0,'rows':[]};var _0x257c6a=_[_0x4a0e('0x2f')](db[_0x4a0e('0x30')][_0x4a0e('0x31')],function(_0x5e1505){return{'name':_0x5e1505[_0x4a0e('0x32')],'type':_0x5e1505[_0x4a0e('0x33')][_0x4a0e('0x34')]};});_0x38914b['model']=_[_0x4a0e('0x2f')](_0x257c6a,'name');_0x38914b[_0x4a0e('0x35')]=_[_0x4a0e('0x36')](_0xabd3e9['query']);_0x38914b[_0x4a0e('0x37')]=_[_0x4a0e('0x38')](_0x38914b[_0x4a0e('0x39')],_0x38914b[_0x4a0e('0x35')]);_0x4fdf6d[_0x4a0e('0x3a')]=_['intersection'](_0x38914b[_0x4a0e('0x39')],qs[_0x4a0e('0x3b')](_0xabd3e9[_0x4a0e('0x35')][_0x4a0e('0x3b')]));_0x4fdf6d[_0x4a0e('0x3a')]=_0x4fdf6d[_0x4a0e('0x3a')][_0x4a0e('0x3c')]?_0x4fdf6d['attributes']:_0x38914b[_0x4a0e('0x39')];if(!_0xabd3e9[_0x4a0e('0x35')][_0x4a0e('0x3d')](_0x4a0e('0x3e'))){_0x4fdf6d['limit']=qs[_0x4a0e('0x22')](_0xabd3e9['query'][_0x4a0e('0x22')]);_0x4fdf6d[_0x4a0e('0x21')]=qs[_0x4a0e('0x21')](_0xabd3e9[_0x4a0e('0x35')][_0x4a0e('0x21')]);}_0x4fdf6d[_0x4a0e('0x3f')]=qs[_0x4a0e('0x40')](_0xabd3e9['query'][_0x4a0e('0x40')]);_0x4fdf6d[_0x4a0e('0x41')]=qs[_0x4a0e('0x37')](_[_0x4a0e('0x42')](_0xabd3e9[_0x4a0e('0x35')],_0x38914b['filters']),_0x257c6a);if(_0xabd3e9['query'][_0x4a0e('0x43')]){_0x4fdf6d['where']=_[_0x4a0e('0x44')](_0x4fdf6d[_0x4a0e('0x41')],{'$or':_[_0x4a0e('0x2f')](_0x257c6a,function(_0x520a56){if(_0x520a56[_0x4a0e('0x33')]!=='VIRTUAL'){var _0x54adbc={};_0x54adbc[_0x520a56[_0x4a0e('0x2c')]]={'$like':'%'+_0xabd3e9[_0x4a0e('0x35')]['filter']+'%'};return _0x54adbc;}})});}_0x4fdf6d=_[_0x4a0e('0x44')]({},_0x4fdf6d,_0xabd3e9[_0x4a0e('0x45')]);var _0x2ec13b={'where':_0x4fdf6d[_0x4a0e('0x41')]};return db[_0x4a0e('0x30')][_0x4a0e('0x23')](_0x2ec13b)[_0x4a0e('0x29')](function(_0x254e6e){_0x1fe641['count']=_0x254e6e;if(_0xabd3e9[_0x4a0e('0x35')]['includeAll']){_0x4fdf6d['include']=[{'all':!![]}];}return db[_0x4a0e('0x30')][_0x4a0e('0x46')](_0x4fdf6d);})[_0x4a0e('0x29')](function(_0x1fc4c6){_0x1fe641[_0x4a0e('0x47')]=_0x1fc4c6;return _0x1fe641;})[_0x4a0e('0x29')](respondWithFilteredResult(_0x318b1f,_0x4fdf6d))[_0x4a0e('0x48')](handleError(_0x318b1f,null));};exports[_0x4a0e('0x49')]=function(_0x450666,_0x3d236c){var _0x521051={'raw':!![],'where':{'id':_0x450666[_0x4a0e('0x4a')]['id']}},_0x11d26b={};_0x11d26b[_0x4a0e('0x39')]=_['keys'](db[_0x4a0e('0x30')][_0x4a0e('0x31')]);_0x11d26b[_0x4a0e('0x35')]=_[_0x4a0e('0x36')](_0x450666[_0x4a0e('0x35')]);_0x11d26b[_0x4a0e('0x37')]=_['intersection'](_0x11d26b[_0x4a0e('0x39')],_0x11d26b[_0x4a0e('0x35')]);_0x521051[_0x4a0e('0x3a')]=_['intersection'](_0x11d26b['model'],qs[_0x4a0e('0x3b')](_0x450666[_0x4a0e('0x35')][_0x4a0e('0x3b')]));_0x521051[_0x4a0e('0x3a')]=_0x521051[_0x4a0e('0x3a')][_0x4a0e('0x3c')]?_0x521051['attributes']:_0x11d26b[_0x4a0e('0x39')];if(_0x450666[_0x4a0e('0x35')]['includeAll']){_0x521051['include']=[{'all':!![]}];}_0x521051=_[_0x4a0e('0x44')]({},_0x521051,_0x450666[_0x4a0e('0x45')]);return db[_0x4a0e('0x30')][_0x4a0e('0x4b')](_0x521051)['then'](handleEntityNotFound(_0x3d236c,null))[_0x4a0e('0x29')](respondWithResult(_0x3d236c,null))['catch'](handleError(_0x3d236c,null));};exports[_0x4a0e('0x4c')]=function(_0x7d3425,_0x480ae9){return db['ZendeskField'][_0x4a0e('0x4c')](_0x7d3425['body'],{})[_0x4a0e('0x29')](respondWithResult(_0x480ae9,0xc9))[_0x4a0e('0x48')](handleError(_0x480ae9,null));};exports[_0x4a0e('0x27')]=function(_0x5fc3d9,_0x86ebcc){if(_0x5fc3d9[_0x4a0e('0x4d')]['id']){delete _0x5fc3d9[_0x4a0e('0x4d')]['id'];}return db[_0x4a0e('0x30')][_0x4a0e('0x4b')]({'where':{'id':_0x5fc3d9[_0x4a0e('0x4a')]['id']}})[_0x4a0e('0x29')](handleEntityNotFound(_0x86ebcc,null))[_0x4a0e('0x29')](saveUpdates(_0x5fc3d9[_0x4a0e('0x4d')],null))[_0x4a0e('0x29')](respondWithResult(_0x86ebcc,null))[_0x4a0e('0x48')](handleError(_0x86ebcc,null));};exports[_0x4a0e('0x28')]=function(_0xda72,_0x9d0f6e){return db[_0x4a0e('0x30')][_0x4a0e('0x4b')]({'where':{'id':_0xda72[_0x4a0e('0x4a')]['id']}})[_0x4a0e('0x29')](handleEntityNotFound(_0x9d0f6e,null))[_0x4a0e('0x29')](removeEntity(_0x9d0f6e,null))[_0x4a0e('0x48')](handleError(_0x9d0f6e,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 000d512..7c236c7 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 _0x86fa=['./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x86fa,0x142));var _0xa86f=function(_0x52c081,_0x3cb7cf){_0x52c081=_0x52c081-0x0;var _0x198b15=_0x86fa[_0x52c081];return _0x198b15;};'use strict';var _=require(_0xa86f('0x0'));var util=require(_0xa86f('0x1'));var logger=require('../../config/logger')(_0xa86f('0x2'));var moment=require('moment');var BPromise=require(_0xa86f('0x3'));var rp=require(_0xa86f('0x4'));var fs=require('fs');var path=require(_0xa86f('0x5'));var rimraf=require(_0xa86f('0x6'));var config=require(_0xa86f('0x7'));var attributes=require(_0xa86f('0x8'));module['exports']=function(_0x38d170,_0x52ce27){return _0x38d170[_0xa86f('0x9')](_0xa86f('0xa'),attributes,{'tableName':_0xa86f('0xb'),'paranoid':![],'indexes':[{'name':_0xa86f('0xc'),'fields':[_0xa86f('0xd'),_0xa86f('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c5e=['./intZendeskField.attributes','exports','define','ZendeskField','idField','FieldId','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x159231,_0x39a543){var _0x429279=function(_0x24b94f){while(--_0x24b94f){_0x159231['push'](_0x159231['shift']());}};_0x429279(++_0x39a543);}(_0x6c5e,0xab));var _0xe6c5=function(_0x21aea9,_0x4cc2c3){_0x21aea9=_0x21aea9-0x0;var _0x233ea8=_0x6c5e[_0x21aea9];return _0x233ea8;};'use strict';var _=require('lodash');var util=require(_0xe6c5('0x0'));var logger=require(_0xe6c5('0x1'))('api');var moment=require(_0xe6c5('0x2'));var BPromise=require('bluebird');var rp=require(_0xe6c5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe6c5('0x4'));var config=require('../../config/environment');var attributes=require(_0xe6c5('0x5'));module[_0xe6c5('0x6')]=function(_0x289783,_0x3645e4){return _0x289783[_0xe6c5('0x7')](_0xe6c5('0x8'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xe6c5('0x9'),_0xe6c5('0xa')],'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 217003c..574fdba 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 _0x099b=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x44cefc,_0x3a3f58){var _0xcfd9f8=function(_0x28ec12){while(--_0x28ec12){_0x44cefc['push'](_0x44cefc['shift']());}};_0xcfd9f8(++_0x3a3f58);}(_0x099b,0xc7));var _0xb099=function(_0x1a1919,_0xb13c71){_0x1a1919=_0x1a1919-0x0;var _0x2a2cc2=_0x099b[_0x1a1919];return _0x2a2cc2;};'use strict';var _=require(_0xb099('0x0'));var util=require(_0xb099('0x1'));var moment=require('moment');var BPromise=require(_0xb099('0x2'));var rs=require(_0xb099('0x3'));var fs=require('fs');var Redis=require(_0xb099('0x4'));var db=require(_0xb099('0x5'))['db'];var utils=require(_0xb099('0x6'));var logger=require('../../config/logger')(_0xb099('0x7'));var config=require(_0xb099('0x8'));var jayson=require(_0xb099('0x9'));var client=jayson[_0xb099('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12b261,_0x48f32d,_0x132c00){return new BPromise(function(_0x477357,_0x8088a9){return client['request'](_0x12b261,_0x132c00)[_0xb099('0xb')](function(_0x521b61){logger['info'](_0xb099('0xc'),_0x48f32d,_0xb099('0xd'));logger['debug'](_0xb099('0xe'),_0x48f32d,_0xb099('0xd'),JSON[_0xb099('0xf')](_0x521b61));if(_0x521b61[_0xb099('0x10')]){if(_0x521b61['error'][_0xb099('0x11')]===0x1f4){logger[_0xb099('0x10')](_0xb099('0xc'),_0x48f32d,_0x521b61['error'][_0xb099('0x12')]);return _0x8088a9(_0x521b61['error']['message']);}logger[_0xb099('0x10')](_0xb099('0xc'),_0x48f32d,_0x521b61['error'][_0xb099('0x12')]);return _0x477357(_0x521b61[_0xb099('0x10')]['message']);}else{logger[_0xb099('0x13')](_0xb099('0xc'),_0x48f32d,'request\x20sent');_0x477357(_0x521b61[_0xb099('0x14')][_0xb099('0x12')]);}})[_0xb099('0x15')](function(_0x12f6dd){logger['error']('ZendeskField,\x20%s,\x20%s',_0x48f32d,_0x12f6dd);_0x8088a9(_0x12f6dd);});});} \ No newline at end of file +var _0xe840=['info','request\x20sent','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then'];(function(_0x22183f,_0x1dfa1e){var _0x37571b=function(_0x1fc21a){while(--_0x1fc21a){_0x22183f['push'](_0x22183f['shift']());}};_0x37571b(++_0x1dfa1e);}(_0xe840,0xc7));var _0x0e84=function(_0x301db9,_0x4455a7){_0x301db9=_0x301db9-0x0;var _0x261873=_0xe840[_0x301db9];return _0x261873;};'use strict';var _=require(_0x0e84('0x0'));var util=require(_0x0e84('0x1'));var moment=require(_0x0e84('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e84('0x3'));var db=require(_0x0e84('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0e84('0x5'));var config=require('../../config/environment');var jayson=require(_0x0e84('0x6'));var client=jayson[_0x0e84('0x7')][_0x0e84('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e96da,_0x237dc4,_0x23e4fe){return new BPromise(function(_0x245d11,_0x565b51){return client['request'](_0x5e96da,_0x23e4fe)[_0x0e84('0x9')](function(_0x3b2ebd){logger[_0x0e84('0xa')]('ZendeskField,\x20%s,\x20%s',_0x237dc4,_0x0e84('0xb'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x237dc4,'request\x20sent',JSON[_0x0e84('0xc')](_0x3b2ebd));if(_0x3b2ebd[_0x0e84('0xd')]){if(_0x3b2ebd[_0x0e84('0xd')][_0x0e84('0xe')]===0x1f4){logger[_0x0e84('0xd')](_0x0e84('0xf'),_0x237dc4,_0x3b2ebd[_0x0e84('0xd')][_0x0e84('0x10')]);return _0x565b51(_0x3b2ebd[_0x0e84('0xd')]['message']);}logger[_0x0e84('0xd')]('ZendeskField,\x20%s,\x20%s',_0x237dc4,_0x3b2ebd[_0x0e84('0xd')]['message']);return _0x245d11(_0x3b2ebd['error']['message']);}else{logger['info'](_0x0e84('0xf'),_0x237dc4,_0x0e84('0xb'));_0x245d11(_0x3b2ebd[_0x0e84('0x11')]['message']);}})[_0x0e84('0x12')](function(_0x3842e2){logger[_0x0e84('0xd')](_0x0e84('0xf'),_0x237dc4,_0x3842e2);_0x565b51(_0x3842e2);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index d5714e5..1be3878 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 _0x815b=['express','fs-extra','../../config/environment','./intZohoAccount.controller','get','index','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x32da04,_0x255b7b){var _0x468bac=function(_0x4e2e53){while(--_0x4e2e53){_0x32da04['push'](_0x32da04['shift']());}};_0x468bac(++_0x255b7b);}(_0x815b,0xb4));var _0xb815=function(_0x131d0d,_0x2d21df){_0x131d0d=_0x131d0d-0x0;var _0x1387bb=_0x815b[_0x131d0d];return _0x1387bb;};'use strict';var multer=require(_0xb815('0x0'));var util=require(_0xb815('0x1'));var path=require(_0xb815('0x2'));var timeout=require(_0xb815('0x3'));var express=require(_0xb815('0x4'));var router=express['Router']();var fs_extra=require(_0xb815('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb815('0x6'));var controller=require(_0xb815('0x7'));router[_0xb815('0x8')]('/',auth['isAuthenticated'](),controller[_0xb815('0x9')]);router[_0xb815('0x8')]('/:id',auth[_0xb815('0xa')](),controller['show']);router['get'](_0xb815('0xb'),auth[_0xb815('0xa')](),controller[_0xb815('0xc')]);router[_0xb815('0x8')](_0xb815('0xd'),auth[_0xb815('0xa')](),controller[_0xb815('0xe')]);router[_0xb815('0xf')]('/',auth['isAuthenticated'](),controller[_0xb815('0x10')]);router[_0xb815('0xf')](_0xb815('0xb'),auth[_0xb815('0xa')](),controller[_0xb815('0x11')]);router[_0xb815('0x12')](_0xb815('0x13'),auth['isAuthenticated'](),controller['update']);router[_0xb815('0x14')](_0xb815('0x13'),auth[_0xb815('0xa')](),controller[_0xb815('0x15')]);module[_0xb815('0x16')]=router; \ No newline at end of file +var _0xa143=['index','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x417e65,_0x254006){var _0x4d73f0=function(_0x1de17b){while(--_0x1de17b){_0x417e65['push'](_0x417e65['shift']());}};_0x4d73f0(++_0x254006);}(_0xa143,0x108));var _0x3a14=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa143[_0x19950b];return _0x3c6b41;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3a14('0x0'));var timeout=require(_0x3a14('0x1'));var express=require(_0x3a14('0x2'));var router=express[_0x3a14('0x3')]();var fs_extra=require(_0x3a14('0x4'));var auth=require(_0x3a14('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3a14('0x6'));var controller=require('./intZohoAccount.controller');router[_0x3a14('0x7')]('/',auth[_0x3a14('0x8')](),controller[_0x3a14('0x9')]);router[_0x3a14('0x7')]('/:id',auth[_0x3a14('0x8')](),controller['show']);router[_0x3a14('0x7')](_0x3a14('0xa'),auth[_0x3a14('0x8')](),controller['getConfigurations']);router[_0x3a14('0x7')](_0x3a14('0xb'),auth['isAuthenticated'](),controller[_0x3a14('0xc')]);router['post']('/',auth[_0x3a14('0x8')](),controller[_0x3a14('0xd')]);router[_0x3a14('0xe')](_0x3a14('0xa'),auth['isAuthenticated'](),controller[_0x3a14('0xf')]);router[_0x3a14('0x10')](_0x3a14('0x11'),auth[_0x3a14('0x8')](),controller['update']);router[_0x3a14('0x12')](_0x3a14('0x11'),auth['isAuthenticated'](),controller[_0x3a14('0x13')]);module[_0x3a14('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 027747a..169f5c2 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(_0x1e06f1,_0x59d7e1){var _0x34f77e=function(_0x4f9f26){while(--_0x4f9f26){_0x1e06f1['push'](_0x1e06f1['shift']());}};_0x34f77e(++_0x59d7e1);}(_0x2750,0x13b));var _0x0275=function(_0xe69d21,_0x1ec1ff){_0xe69d21=_0xe69d21-0x0;var _0x4d3bdd=_0x2750[_0xe69d21];return _0x4d3bdd;};'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 _0xf4eb=['sequelize','STRING'];(function(_0x29f759,_0x2c24e6){var _0x24e642=function(_0x2982d3){while(--_0x2982d3){_0x29f759['push'](_0x29f759['shift']());}};_0x24e642(++_0x2c24e6);}(_0xf4eb,0xec));var _0xbf4e=function(_0x53465a,_0x1e8e75){_0x53465a=_0x53465a-0x0;var _0x17a5ef=_0xf4eb[_0x53465a];return _0x17a5ef;};'use strict';var Sequelize=require(_0xbf4e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xbf4e('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xbf4e('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xbf4e('0x1')]},'refreshToken':{'type':Sequelize[_0xbf4e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 0b38e4e..77a1910 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 _0x0bb2=['format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','reject','save','update','destroy','then','error','name','send','ZohoAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','findOne','getConfigurations','addConfiguration','AccountId','Subjects','channel','getDescriptions','ZohoField','Descriptions','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','refresh_token','access_token','getFields','zone','host','zoho.eu','com','serverUrl','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET'];(function(_0x12877b,_0x8650cf){var _0x3549ff=function(_0x4f96b7){while(--_0x4f96b7){_0x12877b['push'](_0x12877b['shift']());}};_0x3549ff(++_0x8650cf);}(_0x0bb2,0x119));var _0x20bb=function(_0x44094f,_0x506126){_0x44094f=_0x44094f-0x0;var _0x26a5d2=_0x0bb2[_0x44094f];return _0x26a5d2;};'use strict';var emlformat=require(_0x20bb('0x0'));var rimraf=require(_0x20bb('0x1'));var zipdir=require(_0x20bb('0x2'));var jsonpatch=require(_0x20bb('0x3'));var rp=require(_0x20bb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x20bb('0x5'));var util=require(_0x20bb('0x6'));var path=require(_0x20bb('0x7'));var sox=require(_0x20bb('0x8'));var csv=require(_0x20bb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x20bb('0xa'));var _=require(_0x20bb('0xb'));var squel=require(_0x20bb('0xc'));var crypto=require(_0x20bb('0xd'));var jsforce=require(_0x20bb('0xe'));var deskjs=require(_0x20bb('0xf'));var toCsv=require(_0x20bb('0x9'));var querystring=require('querystring');var Papa=require(_0x20bb('0x10'));var Redis=require(_0x20bb('0x11'));var authService=require(_0x20bb('0x12'));var qs=require(_0x20bb('0x13'));var as=require(_0x20bb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x20bb('0x15'));var utils=require(_0x20bb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x20bb('0x17'));var db=require(_0x20bb('0x18'))['db'];var integrations=require(_0x20bb('0x19'));function respondWithStatusCode(_0x1e8182,_0x3a1dd6){_0x3a1dd6=_0x3a1dd6||0xcc;return function(_0xadf176){if(_0xadf176){return _0x1e8182[_0x20bb('0x1a')](_0x3a1dd6);}return _0x1e8182[_0x20bb('0x1b')](_0x3a1dd6)[_0x20bb('0x1c')]();};}function respondWithResult(_0x1ac33f,_0x15518e){_0x15518e=_0x15518e||0xc8;return function(_0x11afdd){if(_0x11afdd){return _0x1ac33f[_0x20bb('0x1b')](_0x15518e)['json'](_0x11afdd);}};}function respondWithFilteredResult(_0x28bac0,_0x2269f0){return function(_0x2e3763){if(_0x2e3763){var _0x3d18ba=typeof _0x2269f0[_0x20bb('0x1d')]==='undefined'&&typeof _0x2269f0['limit']===_0x20bb('0x1e');var _0x159b40=_0x2e3763[_0x20bb('0x1f')];var _0x1c8974=_0x3d18ba?0x0:_0x2269f0['offset'];var _0x40caf3=_0x3d18ba?_0x2e3763[_0x20bb('0x1f')]:_0x2269f0[_0x20bb('0x1d')]+_0x2269f0[_0x20bb('0x20')];var _0x3f9aea;if(_0x40caf3>=_0x159b40){_0x40caf3=_0x159b40;_0x3f9aea=0xc8;}else{_0x3f9aea=0xce;}_0x28bac0[_0x20bb('0x1b')](_0x3f9aea);return _0x28bac0['set'](_0x20bb('0x21'),_0x1c8974+'-'+_0x40caf3+'/'+_0x159b40)[_0x20bb('0x22')](_0x2e3763);}return null;};}function patchUpdates(_0x5e9aac){return function(_0xff680){try{jsonpatch['apply'](_0xff680,_0x5e9aac,!![]);}catch(_0x4fe264){return BPromise[_0x20bb('0x23')](_0x4fe264);}return _0xff680[_0x20bb('0x24')]();};}function saveUpdates(_0x2ee987,_0x4ae351){return function(_0x706f43){if(_0x706f43){return _0x706f43[_0x20bb('0x25')](_0x2ee987)['then'](function(_0xa5fcf9){return _0xa5fcf9;});}return null;};}function removeEntity(_0x25e0af,_0x297b5d){return function(_0x152e9c){if(_0x152e9c){return _0x152e9c[_0x20bb('0x26')]()[_0x20bb('0x27')](function(){_0x25e0af['status'](0xcc)[_0x20bb('0x1c')]();});}};}function handleEntityNotFound(_0x1c5e3c,_0x1e26ca){return function(_0x436fd5){if(!_0x436fd5){_0x1c5e3c['sendStatus'](0x194);}return _0x436fd5;};}function handleError(_0x5542d3,_0x4d2fa0){_0x4d2fa0=_0x4d2fa0||0x1f4;return function(_0x17010e){logger[_0x20bb('0x28')](_0x17010e['stack']);if(_0x17010e[_0x20bb('0x29')]){delete _0x17010e['name'];}_0x5542d3[_0x20bb('0x1b')](_0x4d2fa0)[_0x20bb('0x2a')](_0x17010e);};}exports['index']=function(_0x499210,_0x1f4904){var _0x2b8986={},_0x53bb43={},_0x44f132={'count':0x0,'rows':[]};var _0x4661d6=_['map'](db[_0x20bb('0x2b')][_0x20bb('0x2c')],function(_0x3dba9c){return{'name':_0x3dba9c[_0x20bb('0x2d')],'type':_0x3dba9c[_0x20bb('0x2e')]['key']};});_0x53bb43[_0x20bb('0x2f')]=_['map'](_0x4661d6,_0x20bb('0x29'));_0x53bb43['query']=_[_0x20bb('0x30')](_0x499210[_0x20bb('0x31')]);_0x53bb43[_0x20bb('0x32')]=_[_0x20bb('0x33')](_0x53bb43[_0x20bb('0x2f')],_0x53bb43['query']);_0x2b8986[_0x20bb('0x34')]=_[_0x20bb('0x33')](_0x53bb43[_0x20bb('0x2f')],qs[_0x20bb('0x35')](_0x499210[_0x20bb('0x31')][_0x20bb('0x35')]));_0x2b8986['attributes']=_0x2b8986[_0x20bb('0x34')][_0x20bb('0x36')]?_0x2b8986['attributes']:_0x53bb43[_0x20bb('0x2f')];if(!_0x499210[_0x20bb('0x31')][_0x20bb('0x37')](_0x20bb('0x38'))){_0x2b8986[_0x20bb('0x20')]=qs[_0x20bb('0x20')](_0x499210['query'][_0x20bb('0x20')]);_0x2b8986[_0x20bb('0x1d')]=qs[_0x20bb('0x1d')](_0x499210[_0x20bb('0x31')][_0x20bb('0x1d')]);}_0x2b8986[_0x20bb('0x39')]=qs[_0x20bb('0x3a')](_0x499210['query']['sort']);_0x2b8986['where']=qs[_0x20bb('0x32')](_[_0x20bb('0x3b')](_0x499210[_0x20bb('0x31')],_0x53bb43[_0x20bb('0x32')]),_0x4661d6);if(_0x499210['query']['filter']){_0x2b8986[_0x20bb('0x3c')]=_[_0x20bb('0x3d')](_0x2b8986[_0x20bb('0x3c')],{'$or':_[_0x20bb('0x3e')](_0x4661d6,function(_0x12faad){if(_0x12faad[_0x20bb('0x2e')]!==_0x20bb('0x3f')){var _0x509374={};_0x509374[_0x12faad[_0x20bb('0x29')]]={'$like':'%'+_0x499210['query'][_0x20bb('0x40')]+'%'};return _0x509374;}})});}_0x2b8986=_[_0x20bb('0x3d')]({},_0x2b8986,_0x499210[_0x20bb('0x41')]);var _0x4230d9={'where':_0x2b8986[_0x20bb('0x3c')]};return db[_0x20bb('0x2b')][_0x20bb('0x1f')](_0x4230d9)['then'](function(_0x5042f4){_0x44f132[_0x20bb('0x1f')]=_0x5042f4;if(_0x499210[_0x20bb('0x31')][_0x20bb('0x42')]){_0x2b8986[_0x20bb('0x43')]=[{'all':!![]}];}return db[_0x20bb('0x2b')][_0x20bb('0x44')](_0x2b8986);})[_0x20bb('0x27')](function(_0x4b3b75){_0x44f132['rows']=_0x4b3b75;return _0x44f132;})[_0x20bb('0x27')](respondWithFilteredResult(_0x1f4904,_0x2b8986))[_0x20bb('0x45')](handleError(_0x1f4904,null));};exports[_0x20bb('0x46')]=function(_0x1229a8,_0x49ba57){var _0x3862ae={'raw':![],'where':{'id':_0x1229a8[_0x20bb('0x47')]['id']}},_0x52880e={};_0x52880e[_0x20bb('0x2f')]=_[_0x20bb('0x30')](db[_0x20bb('0x2b')]['rawAttributes']);_0x52880e[_0x20bb('0x31')]=_[_0x20bb('0x30')](_0x1229a8[_0x20bb('0x31')]);_0x52880e['filters']=_['intersection'](_0x52880e[_0x20bb('0x2f')],_0x52880e[_0x20bb('0x31')]);_0x3862ae[_0x20bb('0x34')]=_[_0x20bb('0x33')](_0x52880e[_0x20bb('0x2f')],qs[_0x20bb('0x35')](_0x1229a8[_0x20bb('0x31')]['fields']));_0x3862ae[_0x20bb('0x34')]=_0x3862ae[_0x20bb('0x34')][_0x20bb('0x36')]?_0x3862ae[_0x20bb('0x34')]:_0x52880e[_0x20bb('0x2f')];if(_0x1229a8[_0x20bb('0x31')][_0x20bb('0x42')]){_0x3862ae[_0x20bb('0x43')]=[{'all':!![]}];}_0x3862ae=_[_0x20bb('0x3d')]({},_0x3862ae,_0x1229a8[_0x20bb('0x41')]);return db[_0x20bb('0x2b')][_0x20bb('0x48')](_0x3862ae)['then'](handleEntityNotFound(_0x49ba57,null))[_0x20bb('0x27')](respondWithResult(_0x49ba57,null))[_0x20bb('0x45')](handleError(_0x49ba57,null));};exports[_0x20bb('0x49')]=function(_0x33cbf1,_0x453d74){return db[_0x20bb('0x2b')][_0x20bb('0x49')](_0x33cbf1[_0x20bb('0x4a')],{})[_0x20bb('0x27')](respondWithResult(_0x453d74,0xc9))[_0x20bb('0x45')](handleError(_0x453d74,null));};exports['update']=function(_0x50ce32,_0x4504bf){if(_0x50ce32[_0x20bb('0x4a')]['id']){delete _0x50ce32[_0x20bb('0x4a')]['id'];}return db[_0x20bb('0x2b')]['find']({'where':{'id':_0x50ce32[_0x20bb('0x47')]['id']}})[_0x20bb('0x27')](handleEntityNotFound(_0x4504bf,null))[_0x20bb('0x27')](saveUpdates(_0x50ce32['body'],null))[_0x20bb('0x27')](respondWithResult(_0x4504bf,null))[_0x20bb('0x45')](handleError(_0x4504bf,null));};exports['destroy']=function(_0x161b84,_0x34414e){return db[_0x20bb('0x2b')][_0x20bb('0x48')]({'where':{'id':_0x161b84[_0x20bb('0x47')]['id']}})[_0x20bb('0x27')](handleEntityNotFound(_0x34414e,null))[_0x20bb('0x27')](removeEntity(_0x34414e,null))['catch'](handleError(_0x34414e,null));};exports['getConfigurations']=function(_0x55fee5,_0x329b31,_0x5945ed){var _0x3bf078={};var _0x193e3f={};var _0x377e3c;var _0x3e2a25;return db[_0x20bb('0x2b')][_0x20bb('0x4b')]({'where':{'id':_0x55fee5[_0x20bb('0x47')]['id']}})[_0x20bb('0x27')](handleEntityNotFound(_0x329b31,null))[_0x20bb('0x27')](function(_0x7002bd){if(_0x7002bd){_0x377e3c=_0x7002bd;_0x193e3f['model']=_['keys'](db['ZohoConfiguration'][_0x20bb('0x2c')]);_0x193e3f[_0x20bb('0x31')]=_[_0x20bb('0x30')](_0x55fee5[_0x20bb('0x31')]);_0x193e3f['filters']=_[_0x20bb('0x33')](_0x193e3f[_0x20bb('0x2f')],_0x193e3f['query']);_0x3bf078[_0x20bb('0x34')]=_[_0x20bb('0x33')](_0x193e3f[_0x20bb('0x2f')],qs[_0x20bb('0x35')](_0x55fee5[_0x20bb('0x31')]['fields']));_0x3bf078[_0x20bb('0x34')]=_0x3bf078[_0x20bb('0x34')]['length']?_0x3bf078[_0x20bb('0x34')]:_0x193e3f['model'];_0x3bf078[_0x20bb('0x39')]=qs[_0x20bb('0x3a')](_0x55fee5[_0x20bb('0x31')][_0x20bb('0x3a')]);_0x3bf078[_0x20bb('0x3c')]=qs[_0x20bb('0x32')](_[_0x20bb('0x3b')](_0x55fee5['query'],_0x193e3f['filters']));if(_0x55fee5['query'][_0x20bb('0x40')]){_0x3bf078['where']=_['merge'](_0x3bf078[_0x20bb('0x3c')],{'$or':_['map'](_0x3bf078['attributes'],function(_0x33f784){var _0xf35bca={};_0xf35bca[_0x33f784]={'$like':'%'+_0x55fee5['query']['filter']+'%'};return _0xf35bca;})});}_0x3bf078=_[_0x20bb('0x3d')]({},_0x3bf078,_0x55fee5[_0x20bb('0x41')]);return _0x377e3c['getConfigurations'](_0x3bf078);}})[_0x20bb('0x27')](function(_0x522e10){if(_0x522e10){_0x3e2a25=_0x522e10[_0x20bb('0x36')];if(!_0x55fee5['query'][_0x20bb('0x37')](_0x20bb('0x38'))){_0x3bf078[_0x20bb('0x20')]=qs['limit'](_0x55fee5[_0x20bb('0x31')][_0x20bb('0x20')]);_0x3bf078[_0x20bb('0x1d')]=qs[_0x20bb('0x1d')](_0x55fee5[_0x20bb('0x31')][_0x20bb('0x1d')]);}return _0x377e3c[_0x20bb('0x4c')](_0x3bf078);}})[_0x20bb('0x27')](function(_0xa7a0eb){if(_0xa7a0eb){return _0xa7a0eb?{'count':_0x3e2a25,'rows':_0xa7a0eb}:null;}})[_0x20bb('0x27')](respondWithResult(_0x329b31,null))[_0x20bb('0x45')](handleError(_0x329b31,null));};exports[_0x20bb('0x4d')]=function(_0x2cf3a1,_0x2534b3,_0x3f51d1){if(_0x2cf3a1[_0x20bb('0x4a')]['id']){delete _0x2cf3a1[_0x20bb('0x4a')]['id'];}return db['ZohoAccount'][_0x20bb('0x4b')]({'where':{'id':_0x2cf3a1[_0x20bb('0x47')]['id']}})[_0x20bb('0x27')](handleEntityNotFound(_0x2534b3,null))[_0x20bb('0x27')](function(_0x252ea9){if(_0x252ea9){_0x2cf3a1['body'][_0x20bb('0x4e')]=_0x252ea9['id'];_0x2cf3a1[_0x20bb('0x4a')][_0x20bb('0x4f')]=integrations['getSubjects'](_0x2cf3a1[_0x20bb('0x4a')][_0x20bb('0x50')],_0x2cf3a1[_0x20bb('0x4a')]['type']);_0x2cf3a1[_0x20bb('0x4a')]['Descriptions']=integrations[_0x20bb('0x51')](_0x2cf3a1['body'][_0x20bb('0x50')],_0x2cf3a1[_0x20bb('0x4a')][_0x20bb('0x2e')]);return db['ZohoConfiguration'][_0x20bb('0x49')](_0x2cf3a1[_0x20bb('0x4a')],{'include':[{'model':db[_0x20bb('0x52')],'as':'Subjects'},{'model':db[_0x20bb('0x52')],'as':_0x20bb('0x53')}]});}return null;})[_0x20bb('0x27')](respondWithResult(_0x2534b3,null))['catch'](handleError(_0x2534b3,null));};function getAccessToken(_0x12e647){return new Promise(function(_0x27d7d4,_0x301511){var _0x5a5592;switch(_0x12e647['zone']){case'US':_0x5a5592=_0x20bb('0x54');break;case'AU':_0x5a5592=_0x20bb('0x55');break;case'EU':_0x5a5592=_0x20bb('0x56');break;case'IN':_0x5a5592='https://accounts.zoho.in';break;case'CN':_0x5a5592=_0x20bb('0x57');break;default:_0x5a5592=_0x20bb('0x56');break;}var _0x4b8d6d={'method':_0x20bb('0x58'),'uri':_0x5a5592+_0x20bb('0x59'),'qs':{'refresh_token':_0x12e647[_0x20bb('0x5a')],'client_id':_0x12e647['clientId'],'client_secret':_0x12e647['clientSecret'],'grant_type':_0x20bb('0x5b')},'json':!![]};return rp(_0x4b8d6d)[_0x20bb('0x27')](function(_0x458d75){if(_0x458d75[_0x20bb('0x5c')]){_0x27d7d4(_0x458d75['access_token']);}else{_0x301511('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x287371){_0x301511(_0x287371);});});}exports[_0x20bb('0x5d')]=function(_0x548454,_0x4f824f,_0x1a6530){var _0x37734b,_0x2dcfa2,_0xe4a01e,_0x326acc,_0x246734;return db['ZohoAccount'][_0x20bb('0x4b')]({'where':{'id':_0x548454['params']['id']},'attributes':['id','host',_0x20bb('0x5e'),'clientId','clientSecret','serverUrl','code',_0x20bb('0x5a')]})['then'](handleEntityNotFound(_0x4f824f,null))[_0x20bb('0x27')](function(_0xd3a6e9){_0x246734=_0xd3a6e9;_0x37734b=_0x246734[_0x20bb('0x5f')];_0x2dcfa2=_0x37734b===_0x20bb('0x60')?'eu':_0x20bb('0x61');_0xe4a01e=_0x246734[_0x20bb('0x62')];var _0x22d309=_0xe4a01e['slice'](-0x1);if(_0x22d309==='/'||_0x22d309==='\x5c'||_0x22d309===':'){_0xe4a01e=_0xe4a01e[_0x20bb('0x63')](0x0,_0xe4a01e[_0x20bb('0x64')](_0x22d309));}if(!_0x246734[_0x20bb('0x5a')]){throw new Error(_0x20bb('0x65'));}return getAccessToken(_0x246734);})[_0x20bb('0x27')](function(_0x1fc370){if(_0x1fc370){return rp({'method':_0x20bb('0x66'),'uri':util[_0x20bb('0x67')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x2dcfa2),'qs':{'module':_0x20bb('0x68')},'headers':{'Authorization':_0x20bb('0x69')+_0x1fc370},'json':!![]});}})[_0x20bb('0x27')](function(_0x390587){if(_0x390587){if(_0x390587[_0x20bb('0x6a')]&&_0x390587['response']['error']){throw new Error(_0x390587['response'][_0x20bb('0x28')][_0x20bb('0x6b')]);}var _0x54541f=[];var _0x531dab=[];var _0x49d4e6=[_0x20bb('0x6c'),'Subject',_0x20bb('0x6d'),_0x20bb('0x6e'),_0x20bb('0x6f'),_0x20bb('0x70'),_0x20bb('0x71'),_0x20bb('0x72')];_0x531dab=_[_0x20bb('0x73')](_0x390587[_0x20bb('0x35')],function(_0x19ed28){return _0x49d4e6[_0x20bb('0x74')](_0x19ed28[_0x20bb('0x75')]);});for(var _0x299d01=0x0;_0x299d01<_0x531dab[_0x20bb('0x36')];_0x299d01++){if(_0x531dab[_0x299d01][_0x20bb('0x76')]===![]){_0x54541f[_0x20bb('0x77')]({'id':_0x531dab[_0x299d01]['id'],'name':_0x531dab[_0x299d01][_0x20bb('0x78')],'custom':_0x531dab[_0x299d01][_0x20bb('0x79')],'options':_0x531dab[_0x299d01][_0x20bb('0x7a')]==='picklist'&&_0x531dab[_0x299d01][_0x20bb('0x7b')][_0x20bb('0x36')]>-0x1?_[_0x20bb('0x3e')](_0x531dab[_0x299d01][_0x20bb('0x7b')],function(_0x39a094){return{'name':_0x39a094,'value':_0x39a094};}):[]});}}return{'count':_0x54541f[_0x20bb('0x36')],'rows':_0x54541f};}else{return{'count':0x0,'rows':[]};}})[_0x20bb('0x27')](respondWithResult(_0x4f824f,null))[_0x20bb('0x45')](function(_0x2a565a){var _0x38455e=_0x548454[_0x20bb('0x31')][_0x20bb('0x7c')]?0x1f4:_0x2a565a[_0x20bb('0x7d')]||0x1f4;logger[_0x20bb('0x28')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x38455e,JSON[_0x20bb('0x7e')](_0x2a565a));delete _0x2a565a[_0x20bb('0x29')];if(_0x38455e===0x191){_0x38455e=0x190;}_0x4f824f['status'](_0x38455e)[_0x20bb('0x2a')](_0x548454[_0x20bb('0x31')]['test']?{'message':_0x20bb('0x7f'),'statusCode':_0x2a565a[_0x20bb('0x7d')]}:_0x2a565a);});}; \ No newline at end of file +var _0x953d=['stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','limit','count','Content-Range','apply','then','destroy','error','stack','name','send','index','ZohoAccount','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','includeAll','create','body','update','find','params','findOne','ZohoConfiguration','length','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','getFields','host','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','Description','WhoId','Call_Start_Time','remove','includes','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x44c9fa,_0x3beddd){var _0x61b98e=function(_0x5c3cb5){while(--_0x5c3cb5){_0x44c9fa['push'](_0x44c9fa['shift']());}};_0x61b98e(++_0x3beddd);}(_0x953d,0x105));var _0xd953=function(_0x6364f,_0x24393e){_0x6364f=_0x6364f-0x0;var _0x4bf4c6=_0x953d[_0x6364f];return _0x4bf4c6;};'use strict';var emlformat=require(_0xd953('0x0'));var rimraf=require(_0xd953('0x1'));var zipdir=require(_0xd953('0x2'));var jsonpatch=require(_0xd953('0x3'));var rp=require(_0xd953('0x4'));var moment=require('moment');var BPromise=require(_0xd953('0x5'));var Mustache=require(_0xd953('0x6'));var util=require(_0xd953('0x7'));var path=require(_0xd953('0x8'));var sox=require('sox');var csv=require(_0xd953('0x9'));var ejs=require(_0xd953('0xa'));var fs=require('fs');var fs_extra=require(_0xd953('0xb'));var _=require(_0xd953('0xc'));var squel=require(_0xd953('0xd'));var crypto=require(_0xd953('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd953('0xf'));var toCsv=require(_0xd953('0x9'));var querystring=require(_0xd953('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd953('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd953('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd953('0x13'))(_0xd953('0x14'));var utils=require(_0xd953('0x15'));var config=require(_0xd953('0x16'));var licenseUtil=require(_0xd953('0x17'));var db=require(_0xd953('0x18'))['db'];var integrations=require(_0xd953('0x19'));function respondWithStatusCode(_0x10d1fe,_0x4363ab){_0x4363ab=_0x4363ab||0xcc;return function(_0x47a807){if(_0x47a807){return _0x10d1fe[_0xd953('0x1a')](_0x4363ab);}return _0x10d1fe['status'](_0x4363ab)[_0xd953('0x1b')]();};}function respondWithResult(_0x5900f8,_0x3840ab){_0x3840ab=_0x3840ab||0xc8;return function(_0x37db37){if(_0x37db37){return _0x5900f8[_0xd953('0x1c')](_0x3840ab)[_0xd953('0x1d')](_0x37db37);}};}function respondWithFilteredResult(_0x2f9662,_0x54882a){return function(_0x3af557){if(_0x3af557){var _0x544cf1=typeof _0x54882a['offset']==='undefined'&&typeof _0x54882a[_0xd953('0x1e')]==='undefined';var _0x36cba0=_0x3af557[_0xd953('0x1f')];var _0x1bb1dd=_0x544cf1?0x0:_0x54882a['offset'];var _0x4adabe=_0x544cf1?_0x3af557['count']:_0x54882a['offset']+_0x54882a[_0xd953('0x1e')];var _0x159171;if(_0x4adabe>=_0x36cba0){_0x4adabe=_0x36cba0;_0x159171=0xc8;}else{_0x159171=0xce;}_0x2f9662[_0xd953('0x1c')](_0x159171);return _0x2f9662['set'](_0xd953('0x20'),_0x1bb1dd+'-'+_0x4adabe+'/'+_0x36cba0)[_0xd953('0x1d')](_0x3af557);}return null;};}function patchUpdates(_0x1c8894){return function(_0x31b1a0){try{jsonpatch[_0xd953('0x21')](_0x31b1a0,_0x1c8894,!![]);}catch(_0x513efe){return BPromise['reject'](_0x513efe);}return _0x31b1a0['save']();};}function saveUpdates(_0x554a2a,_0x247e8a){return function(_0x32dccf){if(_0x32dccf){return _0x32dccf['update'](_0x554a2a)[_0xd953('0x22')](function(_0x510a93){return _0x510a93;});}return null;};}function removeEntity(_0x58cbe4,_0x2026d6){return function(_0x3b2042){if(_0x3b2042){return _0x3b2042[_0xd953('0x23')]()[_0xd953('0x22')](function(){_0x58cbe4[_0xd953('0x1c')](0xcc)[_0xd953('0x1b')]();});}};}function handleEntityNotFound(_0x576f6f,_0x53f4ce){return function(_0x502e85){if(!_0x502e85){_0x576f6f[_0xd953('0x1a')](0x194);}return _0x502e85;};}function handleError(_0x581099,_0x13d55a){_0x13d55a=_0x13d55a||0x1f4;return function(_0x124ddc){logger[_0xd953('0x24')](_0x124ddc[_0xd953('0x25')]);if(_0x124ddc[_0xd953('0x26')]){delete _0x124ddc[_0xd953('0x26')];}_0x581099[_0xd953('0x1c')](_0x13d55a)[_0xd953('0x27')](_0x124ddc);};}exports[_0xd953('0x28')]=function(_0x2a7d66,_0x282b25){var _0x4e05e4={},_0x23a7c9={},_0x461170={'count':0x0,'rows':[]};var _0x4b8d25=_['map'](db[_0xd953('0x29')]['rawAttributes'],function(_0x32bd1d){return{'name':_0x32bd1d[_0xd953('0x2a')],'type':_0x32bd1d[_0xd953('0x2b')][_0xd953('0x2c')]};});_0x23a7c9[_0xd953('0x2d')]=_[_0xd953('0x2e')](_0x4b8d25,_0xd953('0x26'));_0x23a7c9['query']=_[_0xd953('0x2f')](_0x2a7d66['query']);_0x23a7c9[_0xd953('0x30')]=_[_0xd953('0x31')](_0x23a7c9[_0xd953('0x2d')],_0x23a7c9[_0xd953('0x32')]);_0x4e05e4[_0xd953('0x33')]=_[_0xd953('0x31')](_0x23a7c9['model'],qs[_0xd953('0x34')](_0x2a7d66['query']['fields']));_0x4e05e4[_0xd953('0x33')]=_0x4e05e4[_0xd953('0x33')]['length']?_0x4e05e4['attributes']:_0x23a7c9[_0xd953('0x2d')];if(!_0x2a7d66[_0xd953('0x32')][_0xd953('0x35')](_0xd953('0x36'))){_0x4e05e4[_0xd953('0x1e')]=qs[_0xd953('0x1e')](_0x2a7d66['query'][_0xd953('0x1e')]);_0x4e05e4[_0xd953('0x37')]=qs['offset'](_0x2a7d66['query'][_0xd953('0x37')]);}_0x4e05e4['order']=qs[_0xd953('0x38')](_0x2a7d66[_0xd953('0x32')][_0xd953('0x38')]);_0x4e05e4[_0xd953('0x39')]=qs['filters'](_[_0xd953('0x3a')](_0x2a7d66[_0xd953('0x32')],_0x23a7c9[_0xd953('0x30')]),_0x4b8d25);if(_0x2a7d66[_0xd953('0x32')][_0xd953('0x3b')]){_0x4e05e4[_0xd953('0x39')]=_[_0xd953('0x3c')](_0x4e05e4[_0xd953('0x39')],{'$or':_[_0xd953('0x2e')](_0x4b8d25,function(_0x236838){if(_0x236838[_0xd953('0x2b')]!==_0xd953('0x3d')){var _0x54c119={};_0x54c119[_0x236838[_0xd953('0x26')]]={'$like':'%'+_0x2a7d66[_0xd953('0x32')][_0xd953('0x3b')]+'%'};return _0x54c119;}})});}_0x4e05e4=_['merge']({},_0x4e05e4,_0x2a7d66[_0xd953('0x3e')]);var _0x3f7fb4={'where':_0x4e05e4['where']};return db[_0xd953('0x29')]['count'](_0x3f7fb4)[_0xd953('0x22')](function(_0x2ee94e){_0x461170[_0xd953('0x1f')]=_0x2ee94e;if(_0x2a7d66[_0xd953('0x32')]['includeAll']){_0x4e05e4[_0xd953('0x3f')]=[{'all':!![]}];}return db[_0xd953('0x29')][_0xd953('0x40')](_0x4e05e4);})[_0xd953('0x22')](function(_0x9a9828){_0x461170[_0xd953('0x41')]=_0x9a9828;return _0x461170;})[_0xd953('0x22')](respondWithFilteredResult(_0x282b25,_0x4e05e4))[_0xd953('0x42')](handleError(_0x282b25,null));};exports[_0xd953('0x43')]=function(_0x274ca4,_0x46c5ea){var _0x5cfd06={'raw':![],'where':{'id':_0x274ca4['params']['id']}},_0x44365a={};_0x44365a['model']=_['keys'](db[_0xd953('0x29')][_0xd953('0x44')]);_0x44365a[_0xd953('0x32')]=_['keys'](_0x274ca4[_0xd953('0x32')]);_0x44365a[_0xd953('0x30')]=_[_0xd953('0x31')](_0x44365a[_0xd953('0x2d')],_0x44365a[_0xd953('0x32')]);_0x5cfd06[_0xd953('0x33')]=_[_0xd953('0x31')](_0x44365a['model'],qs['fields'](_0x274ca4[_0xd953('0x32')][_0xd953('0x34')]));_0x5cfd06[_0xd953('0x33')]=_0x5cfd06[_0xd953('0x33')]['length']?_0x5cfd06['attributes']:_0x44365a[_0xd953('0x2d')];if(_0x274ca4[_0xd953('0x32')][_0xd953('0x45')]){_0x5cfd06[_0xd953('0x3f')]=[{'all':!![]}];}_0x5cfd06=_['merge']({},_0x5cfd06,_0x274ca4[_0xd953('0x3e')]);return db[_0xd953('0x29')]['find'](_0x5cfd06)[_0xd953('0x22')](handleEntityNotFound(_0x46c5ea,null))['then'](respondWithResult(_0x46c5ea,null))[_0xd953('0x42')](handleError(_0x46c5ea,null));};exports[_0xd953('0x46')]=function(_0x9f7bdb,_0x3a954e){return db[_0xd953('0x29')]['create'](_0x9f7bdb[_0xd953('0x47')],{})[_0xd953('0x22')](respondWithResult(_0x3a954e,0xc9))['catch'](handleError(_0x3a954e,null));};exports[_0xd953('0x48')]=function(_0x297cda,_0xae6773){if(_0x297cda[_0xd953('0x47')]['id']){delete _0x297cda[_0xd953('0x47')]['id'];}return db[_0xd953('0x29')][_0xd953('0x49')]({'where':{'id':_0x297cda[_0xd953('0x4a')]['id']}})['then'](handleEntityNotFound(_0xae6773,null))[_0xd953('0x22')](saveUpdates(_0x297cda[_0xd953('0x47')],null))[_0xd953('0x22')](respondWithResult(_0xae6773,null))[_0xd953('0x42')](handleError(_0xae6773,null));};exports[_0xd953('0x23')]=function(_0xa2a04b,_0x16fc5f){return db[_0xd953('0x29')]['find']({'where':{'id':_0xa2a04b['params']['id']}})[_0xd953('0x22')](handleEntityNotFound(_0x16fc5f,null))[_0xd953('0x22')](removeEntity(_0x16fc5f,null))[_0xd953('0x42')](handleError(_0x16fc5f,null));};exports['getConfigurations']=function(_0xc1a0db,_0x35f591,_0x500f2e){var _0x4dc459={};var _0x374dd3={};var _0x1e9150;var _0x3dae68;return db['ZohoAccount'][_0xd953('0x4b')]({'where':{'id':_0xc1a0db[_0xd953('0x4a')]['id']}})['then'](handleEntityNotFound(_0x35f591,null))[_0xd953('0x22')](function(_0x1dd8de){if(_0x1dd8de){_0x1e9150=_0x1dd8de;_0x374dd3[_0xd953('0x2d')]=_[_0xd953('0x2f')](db[_0xd953('0x4c')][_0xd953('0x44')]);_0x374dd3[_0xd953('0x32')]=_[_0xd953('0x2f')](_0xc1a0db[_0xd953('0x32')]);_0x374dd3[_0xd953('0x30')]=_['intersection'](_0x374dd3[_0xd953('0x2d')],_0x374dd3[_0xd953('0x32')]);_0x4dc459[_0xd953('0x33')]=_[_0xd953('0x31')](_0x374dd3['model'],qs[_0xd953('0x34')](_0xc1a0db[_0xd953('0x32')][_0xd953('0x34')]));_0x4dc459['attributes']=_0x4dc459[_0xd953('0x33')][_0xd953('0x4d')]?_0x4dc459[_0xd953('0x33')]:_0x374dd3[_0xd953('0x2d')];_0x4dc459['order']=qs['sort'](_0xc1a0db['query'][_0xd953('0x38')]);_0x4dc459['where']=qs[_0xd953('0x30')](_[_0xd953('0x3a')](_0xc1a0db[_0xd953('0x32')],_0x374dd3[_0xd953('0x30')]));if(_0xc1a0db['query']['filter']){_0x4dc459['where']=_[_0xd953('0x3c')](_0x4dc459['where'],{'$or':_[_0xd953('0x2e')](_0x4dc459[_0xd953('0x33')],function(_0x54388b){var _0x2205dd={};_0x2205dd[_0x54388b]={'$like':'%'+_0xc1a0db[_0xd953('0x32')]['filter']+'%'};return _0x2205dd;})});}_0x4dc459=_['merge']({},_0x4dc459,_0xc1a0db[_0xd953('0x3e')]);return _0x1e9150['getConfigurations'](_0x4dc459);}})[_0xd953('0x22')](function(_0x3dcf51){if(_0x3dcf51){_0x3dae68=_0x3dcf51['length'];if(!_0xc1a0db[_0xd953('0x32')][_0xd953('0x35')](_0xd953('0x36'))){_0x4dc459[_0xd953('0x1e')]=qs['limit'](_0xc1a0db[_0xd953('0x32')][_0xd953('0x1e')]);_0x4dc459['offset']=qs[_0xd953('0x37')](_0xc1a0db[_0xd953('0x32')][_0xd953('0x37')]);}return _0x1e9150['getConfigurations'](_0x4dc459);}})[_0xd953('0x22')](function(_0x14dbf2){if(_0x14dbf2){return _0x14dbf2?{'count':_0x3dae68,'rows':_0x14dbf2}:null;}})[_0xd953('0x22')](respondWithResult(_0x35f591,null))['catch'](handleError(_0x35f591,null));};exports[_0xd953('0x4e')]=function(_0x2aecda,_0x1a8f13,_0x3235d8){if(_0x2aecda[_0xd953('0x47')]['id']){delete _0x2aecda[_0xd953('0x47')]['id'];}return db[_0xd953('0x29')][_0xd953('0x4b')]({'where':{'id':_0x2aecda[_0xd953('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1a8f13,null))['then'](function(_0x36baa1){if(_0x36baa1){_0x2aecda[_0xd953('0x47')][_0xd953('0x4f')]=_0x36baa1['id'];_0x2aecda['body'][_0xd953('0x50')]=integrations[_0xd953('0x51')](_0x2aecda[_0xd953('0x47')][_0xd953('0x52')],_0x2aecda['body'][_0xd953('0x2b')]);_0x2aecda[_0xd953('0x47')][_0xd953('0x53')]=integrations['getDescriptions'](_0x2aecda[_0xd953('0x47')][_0xd953('0x52')],_0x2aecda[_0xd953('0x47')][_0xd953('0x2b')]);return db[_0xd953('0x4c')][_0xd953('0x46')](_0x2aecda[_0xd953('0x47')],{'include':[{'model':db[_0xd953('0x54')],'as':_0xd953('0x50')},{'model':db[_0xd953('0x54')],'as':'Descriptions'}]});}return null;})[_0xd953('0x22')](respondWithResult(_0x1a8f13,null))[_0xd953('0x42')](handleError(_0x1a8f13,null));};function getAccessToken(_0x4d1ea8){return new Promise(function(_0xdd6dd9,_0x38748a){var _0x198d7a;switch(_0x4d1ea8[_0xd953('0x55')]){case'US':_0x198d7a=_0xd953('0x56');break;case'AU':_0x198d7a=_0xd953('0x57');break;case'EU':_0x198d7a=_0xd953('0x58');break;case'IN':_0x198d7a=_0xd953('0x59');break;case'CN':_0x198d7a=_0xd953('0x5a');break;default:_0x198d7a=_0xd953('0x58');break;}var _0x5945dc={'method':_0xd953('0x5b'),'uri':_0x198d7a+_0xd953('0x5c'),'qs':{'refresh_token':_0x4d1ea8[_0xd953('0x5d')],'client_id':_0x4d1ea8[_0xd953('0x5e')],'client_secret':_0x4d1ea8[_0xd953('0x5f')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5945dc)[_0xd953('0x22')](function(_0xa32ec9){if(_0xa32ec9[_0xd953('0x60')]){_0xdd6dd9(_0xa32ec9[_0xd953('0x60')]);}else{_0x38748a('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x41ae66){_0x38748a(_0x41ae66);});});}exports[_0xd953('0x61')]=function(_0x2e57c0,_0x45640e,_0x2e34ba){var _0x269eb8,_0x24e452,_0x2f9767,_0x5a5e07,_0x3d79d2;return db['ZohoAccount'][_0xd953('0x4b')]({'where':{'id':_0x2e57c0[_0xd953('0x4a')]['id']},'attributes':['id',_0xd953('0x62'),'zone','clientId',_0xd953('0x5f'),_0xd953('0x63'),'code','refreshToken']})[_0xd953('0x22')](handleEntityNotFound(_0x45640e,null))[_0xd953('0x22')](function(_0x59a079){_0x3d79d2=_0x59a079;_0x269eb8=_0x3d79d2[_0xd953('0x62')];_0x24e452=_0x269eb8===_0xd953('0x64')?'eu':_0xd953('0x65');_0x2f9767=_0x3d79d2['serverUrl'];var _0x1931ac=_0x2f9767[_0xd953('0x66')](-0x1);if(_0x1931ac==='/'||_0x1931ac==='\x5c'||_0x1931ac===':'){_0x2f9767=_0x2f9767[_0xd953('0x67')](0x0,_0x2f9767[_0xd953('0x68')](_0x1931ac));}if(!_0x3d79d2[_0xd953('0x5d')]){throw new Error(_0xd953('0x69'));}return getAccessToken(_0x3d79d2);})[_0xd953('0x22')](function(_0x4439ee){if(_0x4439ee){return rp({'method':_0xd953('0x6a'),'uri':util[_0xd953('0x6b')](_0xd953('0x6c'),_0x24e452),'qs':{'module':_0xd953('0x6d')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4439ee},'json':!![]});}})[_0xd953('0x22')](function(_0x726799){if(_0x726799){if(_0x726799[_0xd953('0x6e')]&&_0x726799[_0xd953('0x6e')]['error']){throw new Error(_0x726799[_0xd953('0x6e')]['error'][_0xd953('0x6f')]);}var _0x2cdb60=[];var _0x40695c=[];var _0x1d32b6=[_0xd953('0x70'),'Subject',_0xd953('0x71'),_0xd953('0x72'),'Call_Duration','Call_Result',_0xd953('0x73'),'Call_Type'];_0x40695c=_[_0xd953('0x74')](_0x726799[_0xd953('0x34')],function(_0x6a5c9b){return _0x1d32b6[_0xd953('0x75')](_0x6a5c9b['api_name']);});for(var _0x18235b=0x0;_0x18235b<_0x40695c[_0xd953('0x4d')];_0x18235b++){if(_0x40695c[_0x18235b][_0xd953('0x76')]===![]){_0x2cdb60[_0xd953('0x77')]({'id':_0x40695c[_0x18235b]['id'],'name':_0x40695c[_0x18235b]['display_label'],'custom':_0x40695c[_0x18235b][_0xd953('0x78')],'options':_0x40695c[_0x18235b][_0xd953('0x79')]===_0xd953('0x7a')&&_0x40695c[_0x18235b][_0xd953('0x7b')]['length']>-0x1?_['map'](_0x40695c[_0x18235b]['pick_list_values'],function(_0x2cb0e4){return{'name':_0x2cb0e4,'value':_0x2cb0e4};}):[]});}}return{'count':_0x2cdb60[_0xd953('0x4d')],'rows':_0x2cdb60};}else{return{'count':0x0,'rows':[]};}})[_0xd953('0x22')](respondWithResult(_0x45640e,null))[_0xd953('0x42')](function(_0x43291a){var _0x3772d6=_0x2e57c0[_0xd953('0x32')]['test']?0x1f4:_0x43291a[_0xd953('0x7c')]||0x1f4;logger['error'](_0xd953('0x7d'),_0xd953('0x61'),_0x3772d6,JSON[_0xd953('0x7e')](_0x43291a));delete _0x43291a['name'];if(_0x3772d6===0x191){_0x3772d6=0x190;}_0x45640e[_0xd953('0x1c')](_0x3772d6)[_0xd953('0x27')](_0x2e57c0[_0xd953('0x32')][_0xd953('0x7f')]?{'message':_0xd953('0x80'),'statusCode':_0x43291a[_0xd953('0x7c')]}:_0x43291a);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 621e8ef..9bbae0c 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 _0xea56=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','changed','serverUrl','clientId','code','slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','host','https://accounts.zoho.in','https://accounts.zoho.eu','POST','clientSecret','refresh_token','refreshToken','lodash','util'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0xea56,0x85));var _0x6ea5=function(_0x3ff0f0,_0x5523bf){_0x3ff0f0=_0x3ff0f0-0x0;var _0x5dc82a=_0xea56[_0x3ff0f0];return _0x5dc82a;};'use strict';var _=require(_0x6ea5('0x0'));var util=require(_0x6ea5('0x1'));var logger=require(_0x6ea5('0x2'))(_0x6ea5('0x3'));var moment=require(_0x6ea5('0x4'));var BPromise=require(_0x6ea5('0x5'));var rp=require(_0x6ea5('0x6'));var fs=require('fs');var path=require(_0x6ea5('0x7'));var rimraf=require(_0x6ea5('0x8'));var config=require(_0x6ea5('0x9'));var attributes=require(_0x6ea5('0xa'));var integrations=require(_0x6ea5('0xb'));module[_0x6ea5('0xc')]=function(_0x251a1a,_0x38ecac){return _0x251a1a[_0x6ea5('0xd')](_0x6ea5('0xe'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x46cabc,_0x1f4bea,_0x23fa03){if(_0x46cabc['changed']('zone')||_0x46cabc[_0x6ea5('0xf')](_0x6ea5('0x10'))||_0x46cabc[_0x6ea5('0xf')](_0x6ea5('0x11'))||_0x46cabc['changed']('clientSecret')||_0x46cabc[_0x6ea5('0xf')](_0x6ea5('0x12'))||_0x46cabc[_0x6ea5('0xf')]('host')){var _0x3996cf,_0x202fb4;_0x3996cf=_0x46cabc['serverUrl'];var _0x55f5e0=_0x3996cf[_0x6ea5('0x13')](-0x1);if(_0x55f5e0==='/'||_0x55f5e0==='\x5c'||_0x55f5e0===':'){_0x3996cf=_0x3996cf[_0x6ea5('0x14')](0x0,_0x3996cf[_0x6ea5('0x15')](_0x55f5e0));}switch(_0x46cabc[_0x6ea5('0x16')]){case'US':_0x202fb4=_0x6ea5('0x17');break;case'AU':_0x202fb4=_0x6ea5('0x18');break;case'IN':_0x202fb4='https://accounts.zoho.in';break;case'CN':_0x202fb4=_0x6ea5('0x19');break;default:_0x202fb4='https://accounts.zoho.eu';break;}var _0x51c165={'method':'POST','uri':_0x202fb4+_0x6ea5('0x1a'),'form':{'grant_type':_0x6ea5('0x1b'),'client_id':_0x46cabc[_0x6ea5('0x11')],'client_secret':_0x46cabc['clientSecret'],'redirect_uri':_0x46cabc[_0x6ea5('0x10')],'code':_0x46cabc[_0x6ea5('0x12')]},'headers':{'Content-Type':_0x6ea5('0x1c')}};return rp(_0x51c165)[_0x6ea5('0x1d')](function(_0x5e0c0a){var _0xeb16c3=JSON['parse'](_0x5e0c0a);if(_0xeb16c3['refresh_token']){_0x46cabc['refreshToken']=_0xeb16c3['refresh_token'];logger[_0x6ea5('0x1e')](util[_0x6ea5('0x1f')](_0x6ea5('0x20'),_0x46cabc[_0x6ea5('0x21')],_0x46cabc['id']));}else{logger[_0x6ea5('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x46cabc[_0x6ea5('0x21')],_0x46cabc['id']),util[_0x6ea5('0x23')](_0xeb16c3,{'showHidden':![],'depth':null}));}return _0x23fa03(null,_0x1f4bea);})[_0x6ea5('0x24')](function(_0x23b0c3){logger[_0x6ea5('0x22')](util[_0x6ea5('0x1f')](_0x6ea5('0x25'),_0x46cabc[_0x6ea5('0x21')],_0x46cabc['id']),util[_0x6ea5('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x23fa03(_0x23b0c3);});}else{return _0x23fa03(null,_0x1f4bea);}},'beforeUpdate':function(_0x2b1314,_0xe582fb,_0x42f767){if(_0x2b1314[_0x6ea5('0xf')](_0x6ea5('0x16'))||_0x2b1314[_0x6ea5('0xf')](_0x6ea5('0x10'))||_0x2b1314[_0x6ea5('0xf')]('clientId')||_0x2b1314[_0x6ea5('0xf')]('clientSecret')||_0x2b1314[_0x6ea5('0xf')](_0x6ea5('0x12'))||_0x2b1314['changed'](_0x6ea5('0x26'))){var _0x5d9f14,_0x417afb;_0x5d9f14=_0x2b1314['serverUrl'];var _0x43481c=_0x5d9f14[_0x6ea5('0x13')](-0x1);if(_0x43481c==='/'||_0x43481c==='\x5c'||_0x43481c===':'){_0x5d9f14=_0x5d9f14[_0x6ea5('0x14')](0x0,_0x5d9f14['lastIndexOf'](_0x43481c));}switch(_0x2b1314[_0x6ea5('0x16')]){case'US':_0x417afb=_0x6ea5('0x17');break;case'AU':_0x417afb=_0x6ea5('0x18');break;case'IN':_0x417afb=_0x6ea5('0x27');break;case'CN':_0x417afb='https://accounts.zoho.com.cn';break;default:_0x417afb=_0x6ea5('0x28');break;}var _0x478f00={'method':_0x6ea5('0x29'),'uri':_0x417afb+_0x6ea5('0x1a'),'form':{'grant_type':_0x6ea5('0x1b'),'client_id':_0x2b1314[_0x6ea5('0x11')],'client_secret':_0x2b1314[_0x6ea5('0x2a')],'redirect_uri':_0x2b1314[_0x6ea5('0x10')],'code':_0x2b1314[_0x6ea5('0x12')]},'headers':{'Content-Type':_0x6ea5('0x1c')}};return rp(_0x478f00)[_0x6ea5('0x1d')](function(_0xad3d7f){var _0x2c491b=JSON['parse'](_0xad3d7f);if(_0x2c491b[_0x6ea5('0x2b')]){_0x2b1314[_0x6ea5('0x2c')]=_0x2c491b[_0x6ea5('0x2b')];logger[_0x6ea5('0x1e')](util[_0x6ea5('0x1f')](_0x6ea5('0x20'),_0x2b1314[_0x6ea5('0x21')],_0x2b1314['id']));}else{logger[_0x6ea5('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2b1314['name'],_0x2b1314['id']),util[_0x6ea5('0x23')](_0x2c491b,{'showHidden':![],'depth':null}));}return _0x42f767(null,_0xe582fb);})['catch'](function(_0x39f7a5){logger[_0x6ea5('0x22')](util[_0x6ea5('0x1f')](_0x6ea5('0x25'),_0x2b1314[_0x6ea5('0x21')],_0x2b1314['id']),util[_0x6ea5('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x42f767(_0x39f7a5);});}else{return _0x42f767(null,_0xe582fb);}}}});}; \ No newline at end of file +var _0xceff=['authorization_code','code','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','application/x-www-form-urlencoded','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xceff,0x123));var _0xfcef=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xceff[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0xfcef('0x0'));var util=require(_0xfcef('0x1'));var logger=require(_0xfcef('0x2'))(_0xfcef('0x3'));var moment=require(_0xfcef('0x4'));var BPromise=require(_0xfcef('0x5'));var rp=require(_0xfcef('0x6'));var fs=require('fs');var path=require(_0xfcef('0x7'));var rimraf=require('rimraf');var config=require(_0xfcef('0x8'));var attributes=require(_0xfcef('0x9'));var integrations=require(_0xfcef('0xa'));module[_0xfcef('0xb')]=function(_0x345718,_0x90554c){return _0x345718[_0xfcef('0xc')](_0xfcef('0xd'),attributes,{'tableName':_0xfcef('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x330f30,_0x434547,_0x5a1205){if(_0x330f30[_0xfcef('0xf')](_0xfcef('0x10'))||_0x330f30[_0xfcef('0xf')](_0xfcef('0x11'))||_0x330f30[_0xfcef('0xf')](_0xfcef('0x12'))||_0x330f30['changed'](_0xfcef('0x13'))||_0x330f30[_0xfcef('0xf')]('code')||_0x330f30[_0xfcef('0xf')](_0xfcef('0x14'))){var _0x1dcb71,_0x3e6dd2;_0x1dcb71=_0x330f30[_0xfcef('0x11')];var _0x13db03=_0x1dcb71[_0xfcef('0x15')](-0x1);if(_0x13db03==='/'||_0x13db03==='\x5c'||_0x13db03===':'){_0x1dcb71=_0x1dcb71[_0xfcef('0x16')](0x0,_0x1dcb71[_0xfcef('0x17')](_0x13db03));}switch(_0x330f30[_0xfcef('0x10')]){case'US':_0x3e6dd2=_0xfcef('0x18');break;case'AU':_0x3e6dd2=_0xfcef('0x19');break;case'IN':_0x3e6dd2=_0xfcef('0x1a');break;case'CN':_0x3e6dd2=_0xfcef('0x1b');break;default:_0x3e6dd2=_0xfcef('0x1c');break;}var _0x115f66={'method':_0xfcef('0x1d'),'uri':_0x3e6dd2+_0xfcef('0x1e'),'form':{'grant_type':_0xfcef('0x1f'),'client_id':_0x330f30[_0xfcef('0x12')],'client_secret':_0x330f30['clientSecret'],'redirect_uri':_0x330f30['serverUrl'],'code':_0x330f30[_0xfcef('0x20')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x115f66)[_0xfcef('0x21')](function(_0x526635){var _0x5cf9b2=JSON[_0xfcef('0x22')](_0x526635);if(_0x5cf9b2[_0xfcef('0x23')]){_0x330f30[_0xfcef('0x24')]=_0x5cf9b2[_0xfcef('0x23')];logger[_0xfcef('0x25')](util[_0xfcef('0x26')](_0xfcef('0x27'),_0x330f30[_0xfcef('0x28')],_0x330f30['id']));}else{logger['error'](util['format'](_0xfcef('0x29'),_0x330f30[_0xfcef('0x28')],_0x330f30['id']),util[_0xfcef('0x2a')](_0x5cf9b2,{'showHidden':![],'depth':null}));}return _0x5a1205(null,_0x434547);})[_0xfcef('0x2b')](function(_0x219ca2){logger[_0xfcef('0x2c')](util[_0xfcef('0x26')](_0xfcef('0x29'),_0x330f30[_0xfcef('0x28')],_0x330f30['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x5a1205(_0x219ca2);});}else{return _0x5a1205(null,_0x434547);}},'beforeUpdate':function(_0x468b39,_0x69a513,_0x465103){if(_0x468b39[_0xfcef('0xf')](_0xfcef('0x10'))||_0x468b39['changed'](_0xfcef('0x11'))||_0x468b39[_0xfcef('0xf')]('clientId')||_0x468b39['changed']('clientSecret')||_0x468b39[_0xfcef('0xf')](_0xfcef('0x20'))||_0x468b39[_0xfcef('0xf')](_0xfcef('0x14'))){var _0x5cb57b,_0xbae95a;_0x5cb57b=_0x468b39[_0xfcef('0x11')];var _0x3d36f0=_0x5cb57b[_0xfcef('0x15')](-0x1);if(_0x3d36f0==='/'||_0x3d36f0==='\x5c'||_0x3d36f0===':'){_0x5cb57b=_0x5cb57b[_0xfcef('0x16')](0x0,_0x5cb57b[_0xfcef('0x17')](_0x3d36f0));}switch(_0x468b39[_0xfcef('0x10')]){case'US':_0xbae95a=_0xfcef('0x18');break;case'AU':_0xbae95a='https://accounts.zoho.com.au';break;case'IN':_0xbae95a=_0xfcef('0x1a');break;case'CN':_0xbae95a=_0xfcef('0x1b');break;default:_0xbae95a='https://accounts.zoho.eu';break;}var _0x5a28be={'method':_0xfcef('0x1d'),'uri':_0xbae95a+_0xfcef('0x1e'),'form':{'grant_type':_0xfcef('0x1f'),'client_id':_0x468b39[_0xfcef('0x12')],'client_secret':_0x468b39[_0xfcef('0x13')],'redirect_uri':_0x468b39[_0xfcef('0x11')],'code':_0x468b39['code']},'headers':{'Content-Type':_0xfcef('0x2d')}};return rp(_0x5a28be)[_0xfcef('0x21')](function(_0x28116d){var _0x37175c=JSON[_0xfcef('0x22')](_0x28116d);if(_0x37175c['refresh_token']){_0x468b39[_0xfcef('0x24')]=_0x37175c[_0xfcef('0x23')];logger[_0xfcef('0x25')](util[_0xfcef('0x26')](_0xfcef('0x27'),_0x468b39[_0xfcef('0x28')],_0x468b39['id']));}else{logger[_0xfcef('0x2c')](util[_0xfcef('0x26')](_0xfcef('0x29'),_0x468b39['name'],_0x468b39['id']),util[_0xfcef('0x2a')](_0x37175c,{'showHidden':![],'depth':null}));}return _0x465103(null,_0x69a513);})[_0xfcef('0x2b')](function(_0x5c5dde){logger[_0xfcef('0x2c')](util['format'](_0xfcef('0x29'),_0x468b39[_0xfcef('0x28')],_0x468b39['id']),util[_0xfcef('0x2a')](parsedResult,{'showHidden':![],'depth':null}));return _0x465103(_0x5c5dde);});}else{return _0x465103(null,_0x69a513);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index ec996bc..6881e39 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 _0x5ea2=['client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetZohoAccount','ZohoAccount','findAll','options','limit','include','attributes','model','map','find','raw','ShowZohoAccount','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3ee369,_0x311aff){var _0xd65c5e=function(_0x39dfde){while(--_0x39dfde){_0x3ee369['push'](_0x3ee369['shift']());}};_0xd65c5e(++_0x311aff);}(_0x5ea2,0x99));var _0x25ea=function(_0x3a933b,_0x1c50d){_0x3a933b=_0x3a933b-0x0;var _0x6f9627=_0x5ea2[_0x3a933b];return _0x6f9627;};'use strict';var _=require(_0x25ea('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x25ea('0x1'));var rs=require(_0x25ea('0x2'));var fs=require('fs');var Redis=require(_0x25ea('0x3'));var db=require(_0x25ea('0x4'))['db'];var utils=require(_0x25ea('0x5'));var logger=require('../../config/logger')(_0x25ea('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25ea('0x7')][_0x25ea('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ca48f,_0x214ed8,_0x274f48){return new BPromise(function(_0x254d54,_0x1c5b5d){return client[_0x25ea('0x9')](_0x3ca48f,_0x274f48)[_0x25ea('0xa')](function(_0x52b281){logger[_0x25ea('0xb')](_0x25ea('0xc'),_0x214ed8,_0x25ea('0xd'));logger[_0x25ea('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x214ed8,_0x25ea('0xd'),JSON[_0x25ea('0xf')](_0x52b281));if(_0x52b281[_0x25ea('0x10')]){if(_0x52b281[_0x25ea('0x10')][_0x25ea('0x11')]===0x1f4){logger[_0x25ea('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x214ed8,_0x52b281['error'][_0x25ea('0x12')]);return _0x1c5b5d(_0x52b281[_0x25ea('0x10')]['message']);}logger[_0x25ea('0x10')](_0x25ea('0xc'),_0x214ed8,_0x52b281[_0x25ea('0x10')][_0x25ea('0x12')]);return _0x254d54(_0x52b281[_0x25ea('0x10')][_0x25ea('0x12')]);}else{logger['info'](_0x25ea('0xc'),_0x214ed8,_0x25ea('0xd'));_0x254d54(_0x52b281['result'][_0x25ea('0x12')]);}})[_0x25ea('0x13')](function(_0x111c5b){logger[_0x25ea('0x10')](_0x25ea('0xc'),_0x214ed8,_0x111c5b);_0x1c5b5d(_0x111c5b);});});}exports[_0x25ea('0x14')]=function(_0x586d4d){var _0x29878b=this;return new Promise(function(_0x454b8e,_0x3b327e){return db[_0x25ea('0x15')][_0x25ea('0x16')]({'raw':_0x586d4d[_0x25ea('0x17')]?_0x586d4d[_0x25ea('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x586d4d[_0x25ea('0x17')]?_0x586d4d[_0x25ea('0x17')]['where']||null:null,'attributes':_0x586d4d[_0x25ea('0x17')]?_0x586d4d['options']['attributes']||null:null,'limit':_0x586d4d[_0x25ea('0x17')]?_0x586d4d['options'][_0x25ea('0x18')]||null:null,'include':_0x586d4d[_0x25ea('0x17')]?_0x586d4d[_0x25ea('0x17')][_0x25ea('0x19')]?_['map'](_0x586d4d[_0x25ea('0x17')][_0x25ea('0x19')],function(_0xf34d84){return{'model':db[_0xf34d84['model']],'as':_0xf34d84['as'],'attributes':_0xf34d84[_0x25ea('0x1a')],'include':_0xf34d84[_0x25ea('0x19')]?_['map'](_0xf34d84[_0x25ea('0x19')],function(_0x2b5351){return{'model':db[_0x2b5351[_0x25ea('0x1b')]],'as':_0x2b5351['as'],'attributes':_0x2b5351[_0x25ea('0x1a')],'include':_0x2b5351[_0x25ea('0x19')]?_[_0x25ea('0x1c')](_0x2b5351[_0x25ea('0x19')],function(_0x20c65b){return{'model':db[_0x20c65b[_0x25ea('0x1b')]],'as':_0x20c65b['as'],'attributes':_0x20c65b[_0x25ea('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x25ea('0xa')](function(_0x12e061){logger[_0x25ea('0xb')](_0x25ea('0x14'),_0x586d4d);logger[_0x25ea('0xe')](_0x25ea('0x14'),_0x586d4d,JSON['stringify'](_0x12e061));_0x454b8e(_0x12e061);})['catch'](function(_0x3599c3){logger[_0x25ea('0x10')]('GetZohoAccount',_0x3599c3[_0x25ea('0x12')],_0x586d4d);_0x3b327e(_0x29878b[_0x25ea('0x10')](0x1f4,_0x3599c3[_0x25ea('0x12')]));});});};exports['ShowZohoAccount']=function(_0x54459c){var _0x9b5919=this;return new Promise(function(_0x2a71aa,_0x51e3ee){return db[_0x25ea('0x15')][_0x25ea('0x1d')]({'raw':_0x54459c['options']?_0x54459c[_0x25ea('0x17')][_0x25ea('0x1e')]===undefined?!![]:![]:!![],'where':_0x54459c[_0x25ea('0x17')]?_0x54459c[_0x25ea('0x17')]['where']||null:null,'attributes':_0x54459c[_0x25ea('0x17')]?_0x54459c['options'][_0x25ea('0x1a')]||null:null,'include':_0x54459c[_0x25ea('0x17')]?_0x54459c[_0x25ea('0x17')][_0x25ea('0x19')]?_['map'](_0x54459c['options'][_0x25ea('0x19')],function(_0x4bed9e){return{'model':db[_0x4bed9e[_0x25ea('0x1b')]],'as':_0x4bed9e['as'],'attributes':_0x4bed9e[_0x25ea('0x1a')],'include':_0x4bed9e['include']?_[_0x25ea('0x1c')](_0x4bed9e['include'],function(_0x54e37c){return{'model':db[_0x54e37c[_0x25ea('0x1b')]],'as':_0x54e37c['as'],'attributes':_0x54e37c[_0x25ea('0x1a')],'include':_0x54e37c[_0x25ea('0x19')]?_[_0x25ea('0x1c')](_0x54e37c[_0x25ea('0x19')],function(_0x22ea49){return{'model':db[_0x22ea49['model']],'as':_0x22ea49['as'],'attributes':_0x22ea49['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1da04e){logger[_0x25ea('0xb')](_0x25ea('0x1f'),_0x54459c);logger[_0x25ea('0xe')](_0x25ea('0x1f'),_0x54459c,JSON['stringify'](_0x1da04e));_0x2a71aa(_0x1da04e);})[_0x25ea('0x13')](function(_0x2ecbf8){logger[_0x25ea('0x10')](_0x25ea('0x1f'),_0x2ecbf8[_0x25ea('0x12')],_0x54459c);_0x51e3ee(_0x9b5919['error'](0x1f4,_0x2ecbf8[_0x25ea('0x12')]));});});}; \ No newline at end of file +var _0x69d4=['client','http','request','then','request\x20sent','debug','stringify','error','ZohoAccount,\x20%s,\x20%s','message','info','result','ZohoAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetZohoAccount','ShowZohoAccount','find','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0xd7352,_0x3b1351){var _0x127c1f=function(_0x517049){while(--_0x517049){_0xd7352['push'](_0xd7352['shift']());}};_0x127c1f(++_0x3b1351);}(_0x69d4,0x83));var _0x469d=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0x69d4[_0x5a636f];return _0x6a8cfb;};'use strict';var _=require(_0x469d('0x0'));var util=require(_0x469d('0x1'));var moment=require('moment');var BPromise=require(_0x469d('0x2'));var rs=require(_0x469d('0x3'));var fs=require('fs');var Redis=require(_0x469d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x469d('0x5'));var logger=require('../../config/logger')(_0x469d('0x6'));var config=require(_0x469d('0x7'));var jayson=require(_0x469d('0x8'));var client=jayson[_0x469d('0x9')][_0x469d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb15ca9,_0x5129a8,_0x1e9300){return new BPromise(function(_0x486595,_0x37ee05){return client[_0x469d('0xb')](_0xb15ca9,_0x1e9300)[_0x469d('0xc')](function(_0x5f05c9){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x5129a8,_0x469d('0xd'));logger[_0x469d('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x5129a8,_0x469d('0xd'),JSON[_0x469d('0xf')](_0x5f05c9));if(_0x5f05c9[_0x469d('0x10')]){if(_0x5f05c9['error']['code']===0x1f4){logger['error'](_0x469d('0x11'),_0x5129a8,_0x5f05c9[_0x469d('0x10')][_0x469d('0x12')]);return _0x37ee05(_0x5f05c9[_0x469d('0x10')][_0x469d('0x12')]);}logger[_0x469d('0x10')](_0x469d('0x11'),_0x5129a8,_0x5f05c9['error'][_0x469d('0x12')]);return _0x486595(_0x5f05c9[_0x469d('0x10')][_0x469d('0x12')]);}else{logger[_0x469d('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x5129a8,_0x469d('0xd'));_0x486595(_0x5f05c9[_0x469d('0x14')][_0x469d('0x12')]);}})['catch'](function(_0x16d3b5){logger[_0x469d('0x10')](_0x469d('0x11'),_0x5129a8,_0x16d3b5);_0x37ee05(_0x16d3b5);});});}exports['GetZohoAccount']=function(_0x1393e3){var _0x47f944=this;return new Promise(function(_0x5a2a44,_0x59376f){return db[_0x469d('0x15')][_0x469d('0x16')]({'raw':_0x1393e3[_0x469d('0x17')]?_0x1393e3['options'][_0x469d('0x18')]===undefined?!![]:![]:!![],'where':_0x1393e3[_0x469d('0x17')]?_0x1393e3[_0x469d('0x17')][_0x469d('0x19')]||null:null,'attributes':_0x1393e3['options']?_0x1393e3[_0x469d('0x17')][_0x469d('0x1a')]||null:null,'limit':_0x1393e3[_0x469d('0x17')]?_0x1393e3['options'][_0x469d('0x1b')]||null:null,'include':_0x1393e3[_0x469d('0x17')]?_0x1393e3[_0x469d('0x17')]['include']?_[_0x469d('0x1c')](_0x1393e3['options'][_0x469d('0x1d')],function(_0x2206c4){return{'model':db[_0x2206c4['model']],'as':_0x2206c4['as'],'attributes':_0x2206c4[_0x469d('0x1a')],'include':_0x2206c4[_0x469d('0x1d')]?_[_0x469d('0x1c')](_0x2206c4[_0x469d('0x1d')],function(_0xaf343c){return{'model':db[_0xaf343c[_0x469d('0x1e')]],'as':_0xaf343c['as'],'attributes':_0xaf343c[_0x469d('0x1a')],'include':_0xaf343c[_0x469d('0x1d')]?_[_0x469d('0x1c')](_0xaf343c[_0x469d('0x1d')],function(_0x4b79f7){return{'model':db[_0x4b79f7[_0x469d('0x1e')]],'as':_0x4b79f7['as'],'attributes':_0x4b79f7[_0x469d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x469d('0xc')](function(_0x5c28fb){logger[_0x469d('0x13')](_0x469d('0x1f'),_0x1393e3);logger[_0x469d('0xe')](_0x469d('0x1f'),_0x1393e3,JSON['stringify'](_0x5c28fb));_0x5a2a44(_0x5c28fb);})['catch'](function(_0x3565f2){logger[_0x469d('0x10')](_0x469d('0x1f'),_0x3565f2[_0x469d('0x12')],_0x1393e3);_0x59376f(_0x47f944[_0x469d('0x10')](0x1f4,_0x3565f2['message']));});});};exports[_0x469d('0x20')]=function(_0x3978f0){var _0x24af19=this;return new Promise(function(_0x5d33f5,_0x1eceef){return db[_0x469d('0x15')][_0x469d('0x21')]({'raw':_0x3978f0[_0x469d('0x17')]?_0x3978f0[_0x469d('0x17')][_0x469d('0x18')]===undefined?!![]:![]:!![],'where':_0x3978f0[_0x469d('0x17')]?_0x3978f0['options']['where']||null:null,'attributes':_0x3978f0['options']?_0x3978f0['options'][_0x469d('0x1a')]||null:null,'include':_0x3978f0[_0x469d('0x17')]?_0x3978f0[_0x469d('0x17')][_0x469d('0x1d')]?_['map'](_0x3978f0[_0x469d('0x17')]['include'],function(_0x4dbea6){return{'model':db[_0x4dbea6[_0x469d('0x1e')]],'as':_0x4dbea6['as'],'attributes':_0x4dbea6[_0x469d('0x1a')],'include':_0x4dbea6[_0x469d('0x1d')]?_[_0x469d('0x1c')](_0x4dbea6[_0x469d('0x1d')],function(_0x3f9c12){return{'model':db[_0x3f9c12[_0x469d('0x1e')]],'as':_0x3f9c12['as'],'attributes':_0x3f9c12['attributes'],'include':_0x3f9c12['include']?_[_0x469d('0x1c')](_0x3f9c12['include'],function(_0x9d4a73){return{'model':db[_0x9d4a73[_0x469d('0x1e')]],'as':_0x9d4a73['as'],'attributes':_0x9d4a73[_0x469d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x57e60d){logger[_0x469d('0x13')]('ShowZohoAccount',_0x3978f0);logger[_0x469d('0xe')](_0x469d('0x20'),_0x3978f0,JSON[_0x469d('0xf')](_0x57e60d));_0x5d33f5(_0x57e60d);})[_0x469d('0x22')](function(_0x1ae6a0){logger[_0x469d('0x10')](_0x469d('0x20'),_0x1ae6a0[_0x469d('0x12')],_0x3978f0);_0x1eceef(_0x24af19[_0x469d('0x10')](0x1f4,_0x1ae6a0['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 03483fc..b1c2009 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 _0x3c5b=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/fields','getFields'];(function(_0x25f886,_0x341bb9){var _0x3cae77=function(_0xfd3f04){while(--_0xfd3f04){_0x25f886['push'](_0x25f886['shift']());}};_0x3cae77(++_0x341bb9);}(_0x3c5b,0x137));var _0xb3c5=function(_0x1fe5b3,_0x176d68){_0x1fe5b3=_0x1fe5b3-0x0;var _0x561a7b=_0x3c5b[_0x1fe5b3];return _0x561a7b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb3c5('0x0'));var timeout=require(_0xb3c5('0x1'));var express=require(_0xb3c5('0x2'));var router=express[_0xb3c5('0x3')]();var fs_extra=require(_0xb3c5('0x4'));var auth=require(_0xb3c5('0x5'));var interaction=require(_0xb3c5('0x6'));var config=require(_0xb3c5('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0xb3c5('0x8')]('/',auth['isAuthenticated'](),controller[_0xb3c5('0x9')]);router[_0xb3c5('0x8')](_0xb3c5('0xa'),auth[_0xb3c5('0xb')](),controller['show']);router[_0xb3c5('0x8')](_0xb3c5('0xc'),auth['isAuthenticated'](),controller[_0xb3c5('0xd')]);router[_0xb3c5('0x8')](_0xb3c5('0xe'),auth[_0xb3c5('0xb')](),controller[_0xb3c5('0xf')]);router[_0xb3c5('0x8')](_0xb3c5('0x10'),auth['isAuthenticated'](),controller[_0xb3c5('0x11')]);router[_0xb3c5('0x12')]('/',auth[_0xb3c5('0xb')](),controller[_0xb3c5('0x13')]);router[_0xb3c5('0x14')](_0xb3c5('0xa'),auth['isAuthenticated'](),controller[_0xb3c5('0x15')]);router[_0xb3c5('0x16')](_0xb3c5('0xa'),auth[_0xb3c5('0xb')](),controller[_0xb3c5('0x17')]);module[_0xb3c5('0x18')]=router; \ No newline at end of file +var _0xcad2=['index','/:id','show','getFields','getSubjects','getDescriptions','create','put','update','delete','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3c2e6d,_0x31bd1f){var _0xb1351c=function(_0x9d1337){while(--_0x9d1337){_0x3c2e6d['push'](_0x3c2e6d['shift']());}};_0xb1351c(++_0x31bd1f);}(_0xcad2,0x12a));var _0x2cad=function(_0x3c4383,_0x2d956d){_0x3c4383=_0x3c4383-0x0;var _0x7cdd4b=_0xcad2[_0x3c4383];return _0x7cdd4b;};'use strict';var multer=require('multer');var util=require(_0x2cad('0x0'));var path=require('path');var timeout=require(_0x2cad('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2cad('0x2'));var auth=require(_0x2cad('0x3'));var interaction=require(_0x2cad('0x4'));var config=require(_0x2cad('0x5'));var controller=require('./intZohoConfiguration.controller');router[_0x2cad('0x6')]('/',auth[_0x2cad('0x7')](),controller[_0x2cad('0x8')]);router[_0x2cad('0x6')](_0x2cad('0x9'),auth[_0x2cad('0x7')](),controller[_0x2cad('0xa')]);router[_0x2cad('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2cad('0xb')]);router[_0x2cad('0x6')]('/:id/subjects',auth[_0x2cad('0x7')](),controller[_0x2cad('0xc')]);router[_0x2cad('0x6')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x2cad('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2cad('0xe')]);router[_0x2cad('0xf')](_0x2cad('0x9'),auth[_0x2cad('0x7')](),controller[_0x2cad('0x10')]);router[_0x2cad('0x11')](_0x2cad('0x9'),auth[_0x2cad('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index a2dbfcf..5619e4b 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 _0x5732=['exports','lead','contact','ENUM','contact_lead','STRING','sequelize'];(function(_0x42b350,_0x4254b0){var _0x102d95=function(_0x4ba515){while(--_0x4ba515){_0x42b350['push'](_0x42b350['shift']());}};_0x102d95(++_0x4254b0);}(_0x5732,0xfb));var _0x2573=function(_0x5b5995,_0xd3ccc){_0x5b5995=_0x5b5995-0x0;var _0x562d20=_0x5732[_0x5b5995];return _0x562d20;};'use strict';var Sequelize=require(_0x2573('0x0'));module[_0x2573('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM'](_0x2573('0x2'),_0x2573('0x3'),'nothing'),'defaultValue':_0x2573('0x2')},'moduleSearch':{'type':Sequelize[_0x2573('0x4')](_0x2573('0x5'),_0x2573('0x3'),_0x2573('0x2')),'defaultValue':_0x2573('0x5')},'description':{'type':Sequelize[_0x2573('0x6')]}}; \ No newline at end of file +var _0xb58d=['nothing','contact_lead','STRING','ENUM','lead','contact'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0xb58d,0x1ef));var _0xdb58=function(_0x398645,_0x349364){_0x398645=_0x398645-0x0;var _0x2e7d11=_0xb58d[_0x398645];return _0x2e7d11;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xdb58('0x0')](_0xdb58('0x1'),_0xdb58('0x2'),_0xdb58('0x3')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xdb58('0x0')](_0xdb58('0x4'),_0xdb58('0x2'),_0xdb58('0x1')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xdb58('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 1e0a118..16855de 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 _0xf770=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','ZohoConfiguration','rawAttributes','type','key','model','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','findOne','pick','getFields','getSubjects','getDescriptions','ZohoField','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x92e403,_0x1171f5){var _0x41d3ab=function(_0x1ccbec){while(--_0x1ccbec){_0x92e403['push'](_0x92e403['shift']());}};_0x41d3ab(++_0x1171f5);}(_0xf770,0x8b));var _0x0f77=function(_0x2c68f2,_0x29797f){_0x2c68f2=_0x2c68f2-0x0;var _0x1d0488=_0xf770[_0x2c68f2];return _0x1d0488;};'use strict';var emlformat=require(_0x0f77('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0f77('0x1'));var jsonpatch=require(_0x0f77('0x2'));var rp=require(_0x0f77('0x3'));var moment=require('moment');var BPromise=require(_0x0f77('0x4'));var Mustache=require('mustache');var util=require(_0x0f77('0x5'));var path=require(_0x0f77('0x6'));var sox=require(_0x0f77('0x7'));var csv=require(_0x0f77('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0f77('0x9'));var crypto=require('crypto');var jsforce=require(_0x0f77('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0f77('0x8'));var querystring=require(_0x0f77('0xb'));var Papa=require(_0x0f77('0xc'));var Redis=require(_0x0f77('0xd'));var authService=require(_0x0f77('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f77('0xf'));var logger=require(_0x0f77('0x10'))(_0x0f77('0x11'));var utils=require(_0x0f77('0x12'));var config=require(_0x0f77('0x13'));var licenseUtil=require(_0x0f77('0x14'));var db=require(_0x0f77('0x15'))['db'];function respondWithStatusCode(_0xe0a500,_0x1cc25e){_0x1cc25e=_0x1cc25e||0xcc;return function(_0x3d9f2c){if(_0x3d9f2c){return _0xe0a500['sendStatus'](_0x1cc25e);}return _0xe0a500[_0x0f77('0x16')](_0x1cc25e)[_0x0f77('0x17')]();};}function respondWithResult(_0x5194a1,_0x4afc35){_0x4afc35=_0x4afc35||0xc8;return function(_0xc570ba){if(_0xc570ba){return _0x5194a1[_0x0f77('0x16')](_0x4afc35)[_0x0f77('0x18')](_0xc570ba);}};}function respondWithFilteredResult(_0x2905a3,_0x5cbf6b){return function(_0x9cddc7){if(_0x9cddc7){var _0x2f0d59=typeof _0x5cbf6b['offset']===_0x0f77('0x19')&&typeof _0x5cbf6b['limit']===_0x0f77('0x19');var _0x582667=_0x9cddc7[_0x0f77('0x1a')];var _0x4c698e=_0x2f0d59?0x0:_0x5cbf6b[_0x0f77('0x1b')];var _0x42e541=_0x2f0d59?_0x9cddc7[_0x0f77('0x1a')]:_0x5cbf6b['offset']+_0x5cbf6b['limit'];var _0x2d623c;if(_0x42e541>=_0x582667){_0x42e541=_0x582667;_0x2d623c=0xc8;}else{_0x2d623c=0xce;}_0x2905a3[_0x0f77('0x16')](_0x2d623c);return _0x2905a3['set'](_0x0f77('0x1c'),_0x4c698e+'-'+_0x42e541+'/'+_0x582667)['json'](_0x9cddc7);}return null;};}function patchUpdates(_0x5cb166){return function(_0x4c4bc4){try{jsonpatch[_0x0f77('0x1d')](_0x4c4bc4,_0x5cb166,!![]);}catch(_0x4d6266){return BPromise['reject'](_0x4d6266);}return _0x4c4bc4[_0x0f77('0x1e')]();};}function saveUpdates(_0x441ef0,_0x17a586){return function(_0x5e3150){if(_0x5e3150){return _0x5e3150[_0x0f77('0x1f')](_0x441ef0)[_0x0f77('0x20')](function(_0x20f3c3){return _0x20f3c3;});}return null;};}function removeEntity(_0x212db9,_0x4e953d){return function(_0x5f59c1){if(_0x5f59c1){return _0x5f59c1[_0x0f77('0x21')]()['then'](function(){_0x212db9[_0x0f77('0x16')](0xcc)[_0x0f77('0x17')]();});}};}function handleEntityNotFound(_0x2085c8,_0x53aad9){return function(_0x2ac799){if(!_0x2ac799){_0x2085c8[_0x0f77('0x22')](0x194);}return _0x2ac799;};}function handleError(_0x19f955,_0x3671ab){_0x3671ab=_0x3671ab||0x1f4;return function(_0x4163d6){logger[_0x0f77('0x23')](_0x4163d6[_0x0f77('0x24')]);if(_0x4163d6['name']){delete _0x4163d6[_0x0f77('0x25')];}_0x19f955[_0x0f77('0x16')](_0x3671ab)[_0x0f77('0x26')](_0x4163d6);};}exports['index']=function(_0x46901f,_0x18eff9){var _0x2710bf={},_0x460cb1={},_0x54b014={'count':0x0,'rows':[]};var _0x3d6cb8=_[_0x0f77('0x27')](db[_0x0f77('0x28')][_0x0f77('0x29')],function(_0x3e209f){return{'name':_0x3e209f['fieldName'],'type':_0x3e209f[_0x0f77('0x2a')][_0x0f77('0x2b')]};});_0x460cb1[_0x0f77('0x2c')]=_['map'](_0x3d6cb8,_0x0f77('0x25'));_0x460cb1['query']=_[_0x0f77('0x2d')](_0x46901f['query']);_0x460cb1[_0x0f77('0x2e')]=_[_0x0f77('0x2f')](_0x460cb1['model'],_0x460cb1['query']);_0x2710bf[_0x0f77('0x30')]=_['intersection'](_0x460cb1[_0x0f77('0x2c')],qs['fields'](_0x46901f[_0x0f77('0x31')][_0x0f77('0x32')]));_0x2710bf[_0x0f77('0x30')]=_0x2710bf[_0x0f77('0x30')][_0x0f77('0x33')]?_0x2710bf[_0x0f77('0x30')]:_0x460cb1[_0x0f77('0x2c')];if(!_0x46901f['query'][_0x0f77('0x34')](_0x0f77('0x35'))){_0x2710bf[_0x0f77('0x36')]=qs[_0x0f77('0x36')](_0x46901f[_0x0f77('0x31')][_0x0f77('0x36')]);_0x2710bf['offset']=qs[_0x0f77('0x1b')](_0x46901f[_0x0f77('0x31')][_0x0f77('0x1b')]);}_0x2710bf[_0x0f77('0x37')]=qs[_0x0f77('0x38')](_0x46901f[_0x0f77('0x31')][_0x0f77('0x38')]);_0x2710bf['where']=qs[_0x0f77('0x2e')](_['pick'](_0x46901f[_0x0f77('0x31')],_0x460cb1[_0x0f77('0x2e')]),_0x3d6cb8);if(_0x46901f[_0x0f77('0x31')][_0x0f77('0x39')]){_0x2710bf['where']=_[_0x0f77('0x3a')](_0x2710bf[_0x0f77('0x3b')],{'$or':_[_0x0f77('0x27')](_0x3d6cb8,function(_0x1dda32){if(_0x1dda32[_0x0f77('0x2a')]!==_0x0f77('0x3c')){var _0x1ea6b2={};_0x1ea6b2[_0x1dda32[_0x0f77('0x25')]]={'$like':'%'+_0x46901f['query']['filter']+'%'};return _0x1ea6b2;}})});}_0x2710bf=_[_0x0f77('0x3a')]({},_0x2710bf,_0x46901f['options']);var _0x137ccd={'where':_0x2710bf[_0x0f77('0x3b')]};return db[_0x0f77('0x28')][_0x0f77('0x1a')](_0x137ccd)[_0x0f77('0x20')](function(_0x207365){_0x54b014[_0x0f77('0x1a')]=_0x207365;if(_0x46901f['query'][_0x0f77('0x3d')]){_0x2710bf[_0x0f77('0x3e')]=[{'all':!![]}];}return db[_0x0f77('0x28')][_0x0f77('0x3f')](_0x2710bf);})[_0x0f77('0x20')](function(_0x515fba){_0x54b014[_0x0f77('0x40')]=_0x515fba;return _0x54b014;})['then'](respondWithFilteredResult(_0x18eff9,_0x2710bf))[_0x0f77('0x41')](handleError(_0x18eff9,null));};exports[_0x0f77('0x42')]=function(_0x174ab1,_0x251898){var _0x318fb1={'raw':![],'where':{'id':_0x174ab1[_0x0f77('0x43')]['id']}},_0xd04435={};_0xd04435[_0x0f77('0x2c')]=_[_0x0f77('0x2d')](db[_0x0f77('0x28')][_0x0f77('0x29')]);_0xd04435[_0x0f77('0x31')]=_['keys'](_0x174ab1[_0x0f77('0x31')]);_0xd04435[_0x0f77('0x2e')]=_['intersection'](_0xd04435['model'],_0xd04435['query']);_0x318fb1[_0x0f77('0x30')]=_[_0x0f77('0x2f')](_0xd04435[_0x0f77('0x2c')],qs[_0x0f77('0x32')](_0x174ab1[_0x0f77('0x31')][_0x0f77('0x32')]));_0x318fb1['attributes']=_0x318fb1[_0x0f77('0x30')][_0x0f77('0x33')]?_0x318fb1[_0x0f77('0x30')]:_0xd04435[_0x0f77('0x2c')];if(_0x174ab1['query'][_0x0f77('0x3d')]){_0x318fb1['include']=[{'all':!![]}];}_0x318fb1=_[_0x0f77('0x3a')]({},_0x318fb1,_0x174ab1[_0x0f77('0x44')]);return db[_0x0f77('0x28')][_0x0f77('0x45')](_0x318fb1)['then'](handleEntityNotFound(_0x251898,null))[_0x0f77('0x20')](respondWithResult(_0x251898,null))['catch'](handleError(_0x251898,null));};exports['create']=function(_0x52a1a0,_0x34cb97){return db[_0x0f77('0x28')][_0x0f77('0x46')](_0x52a1a0[_0x0f77('0x47')],{})[_0x0f77('0x20')](respondWithResult(_0x34cb97,0xc9))[_0x0f77('0x41')](handleError(_0x34cb97,null));};exports[_0x0f77('0x1f')]=function(_0x28a760,_0x585b74){if(_0x28a760[_0x0f77('0x47')]['id']){delete _0x28a760[_0x0f77('0x47')]['id'];}return db[_0x0f77('0x28')][_0x0f77('0x45')]({'where':{'id':_0x28a760['params']['id']}})[_0x0f77('0x20')](handleEntityNotFound(_0x585b74,null))[_0x0f77('0x20')](saveUpdates(_0x28a760[_0x0f77('0x47')],null))[_0x0f77('0x20')](respondWithResult(_0x585b74,null))[_0x0f77('0x41')](handleError(_0x585b74,null));};exports[_0x0f77('0x21')]=function(_0x1d05c8,_0x34cede){return db[_0x0f77('0x28')][_0x0f77('0x45')]({'where':{'id':_0x1d05c8['params']['id']}})['then'](handleEntityNotFound(_0x34cede,null))[_0x0f77('0x20')](removeEntity(_0x34cede,null))[_0x0f77('0x41')](handleError(_0x34cede,null));};exports['getFields']=function(_0x57879c,_0x1ef87e,_0x59feaf){var _0x17df52={};var _0x164875={};var _0x5e50fc;var _0x5ad071;return db['ZohoConfiguration'][_0x0f77('0x48')]({'where':{'id':_0x57879c['params']['id']}})['then'](handleEntityNotFound(_0x1ef87e,null))[_0x0f77('0x20')](function(_0x317d3c){if(_0x317d3c){_0x5e50fc=_0x317d3c;_0x164875['model']=_['keys'](db['ZohoField'][_0x0f77('0x29')]);_0x164875['query']=_[_0x0f77('0x2d')](_0x57879c[_0x0f77('0x31')]);_0x164875['filters']=_[_0x0f77('0x2f')](_0x164875[_0x0f77('0x2c')],_0x164875[_0x0f77('0x31')]);_0x17df52[_0x0f77('0x30')]=_['intersection'](_0x164875[_0x0f77('0x2c')],qs[_0x0f77('0x32')](_0x57879c[_0x0f77('0x31')][_0x0f77('0x32')]));_0x17df52[_0x0f77('0x30')]=_0x17df52['attributes'][_0x0f77('0x33')]?_0x17df52[_0x0f77('0x30')]:_0x164875[_0x0f77('0x2c')];_0x17df52[_0x0f77('0x37')]=qs[_0x0f77('0x38')](_0x57879c[_0x0f77('0x31')][_0x0f77('0x38')]);_0x17df52[_0x0f77('0x3b')]=qs[_0x0f77('0x2e')](_[_0x0f77('0x49')](_0x57879c[_0x0f77('0x31')],_0x164875[_0x0f77('0x2e')]));if(_0x57879c[_0x0f77('0x31')]['filter']){_0x17df52[_0x0f77('0x3b')]=_['merge'](_0x17df52[_0x0f77('0x3b')],{'$or':_[_0x0f77('0x27')](_0x17df52[_0x0f77('0x30')],function(_0xb1f11c){var _0x13a5f2={};_0x13a5f2[_0xb1f11c]={'$like':'%'+_0x57879c[_0x0f77('0x31')]['filter']+'%'};return _0x13a5f2;})});}_0x17df52=_[_0x0f77('0x3a')]({},_0x17df52,_0x57879c[_0x0f77('0x44')]);return _0x5e50fc['getFields'](_0x17df52);}})[_0x0f77('0x20')](function(_0x3eaffa){if(_0x3eaffa){_0x5ad071=_0x3eaffa['length'];if(!_0x57879c['query'][_0x0f77('0x34')](_0x0f77('0x35'))){_0x17df52[_0x0f77('0x36')]=qs['limit'](_0x57879c[_0x0f77('0x31')][_0x0f77('0x36')]);_0x17df52['offset']=qs[_0x0f77('0x1b')](_0x57879c[_0x0f77('0x31')]['offset']);}return _0x5e50fc[_0x0f77('0x4a')](_0x17df52);}})[_0x0f77('0x20')](function(_0x3f1a5e){if(_0x3f1a5e){return _0x3f1a5e?{'count':_0x5ad071,'rows':_0x3f1a5e}:null;}})[_0x0f77('0x20')](respondWithResult(_0x1ef87e,null))['catch'](handleError(_0x1ef87e,null));};exports[_0x0f77('0x4b')]=function(_0x22c747,_0x1ea5f8,_0x1213db){var _0x588363={};var _0x3dc859={};var _0x403c2e;var _0x36e799;return db['ZohoConfiguration'][_0x0f77('0x48')]({'where':{'id':_0x22c747[_0x0f77('0x43')]['id']}})[_0x0f77('0x20')](handleEntityNotFound(_0x1ea5f8,null))[_0x0f77('0x20')](function(_0x8be58e){if(_0x8be58e){_0x403c2e=_0x8be58e;_0x3dc859['model']=_[_0x0f77('0x2d')](db['ZohoField'][_0x0f77('0x29')]);_0x3dc859[_0x0f77('0x31')]=_['keys'](_0x22c747[_0x0f77('0x31')]);_0x3dc859[_0x0f77('0x2e')]=_['intersection'](_0x3dc859[_0x0f77('0x2c')],_0x3dc859['query']);_0x588363[_0x0f77('0x30')]=_['intersection'](_0x3dc859['model'],qs[_0x0f77('0x32')](_0x22c747[_0x0f77('0x31')][_0x0f77('0x32')]));_0x588363['attributes']=_0x588363['attributes']['length']?_0x588363[_0x0f77('0x30')]:_0x3dc859['model'];_0x588363[_0x0f77('0x37')]=qs[_0x0f77('0x38')](_0x22c747['query'][_0x0f77('0x38')]);_0x588363[_0x0f77('0x3b')]=qs[_0x0f77('0x2e')](_[_0x0f77('0x49')](_0x22c747[_0x0f77('0x31')],_0x3dc859[_0x0f77('0x2e')]));if(_0x22c747[_0x0f77('0x31')]['filter']){_0x588363['where']=_[_0x0f77('0x3a')](_0x588363[_0x0f77('0x3b')],{'$or':_[_0x0f77('0x27')](_0x588363[_0x0f77('0x30')],function(_0x217064){var _0xa30bf6={};_0xa30bf6[_0x217064]={'$like':'%'+_0x22c747[_0x0f77('0x31')][_0x0f77('0x39')]+'%'};return _0xa30bf6;})});}_0x588363=_[_0x0f77('0x3a')]({},_0x588363,_0x22c747['options']);return _0x403c2e[_0x0f77('0x4b')](_0x588363);}})[_0x0f77('0x20')](function(_0x4ebbac){if(_0x4ebbac){_0x36e799=_0x4ebbac[_0x0f77('0x33')];if(!_0x22c747[_0x0f77('0x31')][_0x0f77('0x34')]('nolimit')){_0x588363['limit']=qs[_0x0f77('0x36')](_0x22c747[_0x0f77('0x31')][_0x0f77('0x36')]);_0x588363[_0x0f77('0x1b')]=qs['offset'](_0x22c747[_0x0f77('0x31')][_0x0f77('0x1b')]);}return _0x403c2e['getSubjects'](_0x588363);}})[_0x0f77('0x20')](function(_0x54c93e){if(_0x54c93e){return _0x54c93e?{'count':_0x36e799,'rows':_0x54c93e}:null;}})['then'](respondWithResult(_0x1ea5f8,null))['catch'](handleError(_0x1ea5f8,null));};exports[_0x0f77('0x4c')]=function(_0x4dd461,_0x446a9d,_0x2a022f){var _0xdc15bb={};var _0x181def={};var _0x4fc110;var _0x227443;return db[_0x0f77('0x28')]['findOne']({'where':{'id':_0x4dd461['params']['id']}})['then'](handleEntityNotFound(_0x446a9d,null))[_0x0f77('0x20')](function(_0x1a24f0){if(_0x1a24f0){_0x4fc110=_0x1a24f0;_0x181def[_0x0f77('0x2c')]=_['keys'](db[_0x0f77('0x4d')][_0x0f77('0x29')]);_0x181def[_0x0f77('0x31')]=_[_0x0f77('0x2d')](_0x4dd461[_0x0f77('0x31')]);_0x181def[_0x0f77('0x2e')]=_[_0x0f77('0x2f')](_0x181def[_0x0f77('0x2c')],_0x181def[_0x0f77('0x31')]);_0xdc15bb[_0x0f77('0x30')]=_[_0x0f77('0x2f')](_0x181def['model'],qs[_0x0f77('0x32')](_0x4dd461[_0x0f77('0x31')]['fields']));_0xdc15bb[_0x0f77('0x30')]=_0xdc15bb[_0x0f77('0x30')][_0x0f77('0x33')]?_0xdc15bb[_0x0f77('0x30')]:_0x181def['model'];_0xdc15bb[_0x0f77('0x37')]=qs['sort'](_0x4dd461[_0x0f77('0x31')]['sort']);_0xdc15bb[_0x0f77('0x3b')]=qs[_0x0f77('0x2e')](_[_0x0f77('0x49')](_0x4dd461[_0x0f77('0x31')],_0x181def['filters']));if(_0x4dd461[_0x0f77('0x31')]['filter']){_0xdc15bb[_0x0f77('0x3b')]=_['merge'](_0xdc15bb['where'],{'$or':_[_0x0f77('0x27')](_0xdc15bb[_0x0f77('0x30')],function(_0x4f8e26){var _0x468311={};_0x468311[_0x4f8e26]={'$like':'%'+_0x4dd461[_0x0f77('0x31')][_0x0f77('0x39')]+'%'};return _0x468311;})});}_0xdc15bb=_[_0x0f77('0x3a')]({},_0xdc15bb,_0x4dd461[_0x0f77('0x44')]);return _0x4fc110[_0x0f77('0x4c')](_0xdc15bb);}})[_0x0f77('0x20')](function(_0x4f8d6e){if(_0x4f8d6e){_0x227443=_0x4f8d6e['length'];if(!_0x4dd461['query'][_0x0f77('0x34')](_0x0f77('0x35'))){_0xdc15bb[_0x0f77('0x36')]=qs[_0x0f77('0x36')](_0x4dd461[_0x0f77('0x31')][_0x0f77('0x36')]);_0xdc15bb['offset']=qs[_0x0f77('0x1b')](_0x4dd461[_0x0f77('0x31')][_0x0f77('0x1b')]);}return _0x4fc110[_0x0f77('0x4c')](_0xdc15bb);}})[_0x0f77('0x20')](function(_0x3f5b94){if(_0x3f5b94){return _0x3f5b94?{'count':_0x227443,'rows':_0x3f5b94}:null;}})[_0x0f77('0x20')](respondWithResult(_0x446a9d,null))['catch'](handleError(_0x446a9d,null));}; \ No newline at end of file +var _0x008d=['rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','catch','include','find','create','body','params','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','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','../../config/license/util','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','sendStatus','error','name','map','ZohoConfiguration'];(function(_0x56227a,_0x32742a){var _0x5e1619=function(_0x40d925){while(--_0x40d925){_0x56227a['push'](_0x56227a['shift']());}};_0x5e1619(++_0x32742a);}(_0x008d,0x153));var _0xd008=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x008d[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xd008('0x0'));var rimraf=require(_0xd008('0x1'));var zipdir=require(_0xd008('0x2'));var jsonpatch=require(_0xd008('0x3'));var rp=require(_0xd008('0x4'));var moment=require(_0xd008('0x5'));var BPromise=require(_0xd008('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd008('0x7'));var sox=require(_0xd008('0x8'));var csv=require(_0xd008('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd008('0xa'));var _=require('lodash');var squel=require(_0xd008('0xb'));var crypto=require('crypto');var jsforce=require(_0xd008('0xc'));var deskjs=require(_0xd008('0xd'));var toCsv=require(_0xd008('0x9'));var querystring=require('querystring');var Papa=require(_0xd008('0xe'));var Redis=require(_0xd008('0xf'));var authService=require(_0xd008('0x10'));var qs=require(_0xd008('0x11'));var as=require(_0xd008('0x12'));var hardwareService=require(_0xd008('0x13'));var logger=require(_0xd008('0x14'))('api');var utils=require(_0xd008('0x15'));var config=require(_0xd008('0x16'));var licenseUtil=require(_0xd008('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a470a,_0x2afe57){_0x2afe57=_0x2afe57||0xcc;return function(_0x2d1ccb){if(_0x2d1ccb){return _0x1a470a['sendStatus'](_0x2afe57);}return _0x1a470a[_0xd008('0x18')](_0x2afe57)[_0xd008('0x19')]();};}function respondWithResult(_0x185890,_0x4ce070){_0x4ce070=_0x4ce070||0xc8;return function(_0x461d0d){if(_0x461d0d){return _0x185890[_0xd008('0x18')](_0x4ce070)[_0xd008('0x1a')](_0x461d0d);}};}function respondWithFilteredResult(_0x5aa034,_0x1735bd){return function(_0x521d28){if(_0x521d28){var _0x2669b0=typeof _0x1735bd['offset']===_0xd008('0x1b')&&typeof _0x1735bd[_0xd008('0x1c')]==='undefined';var _0x5ae1e9=_0x521d28[_0xd008('0x1d')];var _0x565738=_0x2669b0?0x0:_0x1735bd[_0xd008('0x1e')];var _0x229141=_0x2669b0?_0x521d28['count']:_0x1735bd[_0xd008('0x1e')]+_0x1735bd[_0xd008('0x1c')];var _0xfb55b4;if(_0x229141>=_0x5ae1e9){_0x229141=_0x5ae1e9;_0xfb55b4=0xc8;}else{_0xfb55b4=0xce;}_0x5aa034[_0xd008('0x18')](_0xfb55b4);return _0x5aa034['set']('Content-Range',_0x565738+'-'+_0x229141+'/'+_0x5ae1e9)[_0xd008('0x1a')](_0x521d28);}return null;};}function patchUpdates(_0xff7a26){return function(_0x3422f2){try{jsonpatch[_0xd008('0x1f')](_0x3422f2,_0xff7a26,!![]);}catch(_0x426e6b){return BPromise[_0xd008('0x20')](_0x426e6b);}return _0x3422f2[_0xd008('0x21')]();};}function saveUpdates(_0x54ed53,_0x140cf4){return function(_0x267e43){if(_0x267e43){return _0x267e43[_0xd008('0x22')](_0x54ed53)[_0xd008('0x23')](function(_0x5709f1){return _0x5709f1;});}return null;};}function removeEntity(_0x440543,_0x50c809){return function(_0x30c496){if(_0x30c496){return _0x30c496['destroy']()[_0xd008('0x23')](function(){_0x440543[_0xd008('0x18')](0xcc)[_0xd008('0x19')]();});}};}function handleEntityNotFound(_0x418af3,_0x5c864a){return function(_0xbfe89){if(!_0xbfe89){_0x418af3[_0xd008('0x24')](0x194);}return _0xbfe89;};}function handleError(_0x8f355,_0x157829){_0x157829=_0x157829||0x1f4;return function(_0x4cde04){logger[_0xd008('0x25')](_0x4cde04['stack']);if(_0x4cde04[_0xd008('0x26')]){delete _0x4cde04[_0xd008('0x26')];}_0x8f355[_0xd008('0x18')](_0x157829)['send'](_0x4cde04);};}exports['index']=function(_0x155807,_0x4ecd89){var _0xfaf4a9={},_0x32eac7={},_0x42f1eb={'count':0x0,'rows':[]};var _0x1acae2=_[_0xd008('0x27')](db[_0xd008('0x28')][_0xd008('0x29')],function(_0x463716){return{'name':_0x463716[_0xd008('0x2a')],'type':_0x463716[_0xd008('0x2b')][_0xd008('0x2c')]};});_0x32eac7[_0xd008('0x2d')]=_[_0xd008('0x27')](_0x1acae2,_0xd008('0x26'));_0x32eac7[_0xd008('0x2e')]=_[_0xd008('0x2f')](_0x155807[_0xd008('0x2e')]);_0x32eac7[_0xd008('0x30')]=_['intersection'](_0x32eac7[_0xd008('0x2d')],_0x32eac7[_0xd008('0x2e')]);_0xfaf4a9[_0xd008('0x31')]=_[_0xd008('0x32')](_0x32eac7[_0xd008('0x2d')],qs['fields'](_0x155807[_0xd008('0x2e')][_0xd008('0x33')]));_0xfaf4a9[_0xd008('0x31')]=_0xfaf4a9['attributes'][_0xd008('0x34')]?_0xfaf4a9['attributes']:_0x32eac7[_0xd008('0x2d')];if(!_0x155807[_0xd008('0x2e')][_0xd008('0x35')](_0xd008('0x36'))){_0xfaf4a9[_0xd008('0x1c')]=qs[_0xd008('0x1c')](_0x155807[_0xd008('0x2e')][_0xd008('0x1c')]);_0xfaf4a9['offset']=qs['offset'](_0x155807[_0xd008('0x2e')][_0xd008('0x1e')]);}_0xfaf4a9[_0xd008('0x37')]=qs[_0xd008('0x38')](_0x155807[_0xd008('0x2e')][_0xd008('0x38')]);_0xfaf4a9['where']=qs[_0xd008('0x30')](_[_0xd008('0x39')](_0x155807[_0xd008('0x2e')],_0x32eac7[_0xd008('0x30')]),_0x1acae2);if(_0x155807['query'][_0xd008('0x3a')]){_0xfaf4a9['where']=_[_0xd008('0x3b')](_0xfaf4a9[_0xd008('0x3c')],{'$or':_[_0xd008('0x27')](_0x1acae2,function(_0x1e6420){if(_0x1e6420[_0xd008('0x2b')]!==_0xd008('0x3d')){var _0x2e796d={};_0x2e796d[_0x1e6420[_0xd008('0x26')]]={'$like':'%'+_0x155807[_0xd008('0x2e')]['filter']+'%'};return _0x2e796d;}})});}_0xfaf4a9=_[_0xd008('0x3b')]({},_0xfaf4a9,_0x155807[_0xd008('0x3e')]);var _0x14d8cd={'where':_0xfaf4a9[_0xd008('0x3c')]};return db['ZohoConfiguration'][_0xd008('0x1d')](_0x14d8cd)[_0xd008('0x23')](function(_0x4ad8b1){_0x42f1eb[_0xd008('0x1d')]=_0x4ad8b1;if(_0x155807[_0xd008('0x2e')][_0xd008('0x3f')]){_0xfaf4a9['include']=[{'all':!![]}];}return db[_0xd008('0x28')][_0xd008('0x40')](_0xfaf4a9);})[_0xd008('0x23')](function(_0x112d60){_0x42f1eb['rows']=_0x112d60;return _0x42f1eb;})[_0xd008('0x23')](respondWithFilteredResult(_0x4ecd89,_0xfaf4a9))[_0xd008('0x41')](handleError(_0x4ecd89,null));};exports['show']=function(_0x3b2c71,_0x2788dd){var _0x2f6f33={'raw':![],'where':{'id':_0x3b2c71['params']['id']}},_0x279433={};_0x279433[_0xd008('0x2d')]=_[_0xd008('0x2f')](db['ZohoConfiguration'][_0xd008('0x29')]);_0x279433['query']=_[_0xd008('0x2f')](_0x3b2c71['query']);_0x279433[_0xd008('0x30')]=_[_0xd008('0x32')](_0x279433[_0xd008('0x2d')],_0x279433['query']);_0x2f6f33[_0xd008('0x31')]=_[_0xd008('0x32')](_0x279433[_0xd008('0x2d')],qs[_0xd008('0x33')](_0x3b2c71[_0xd008('0x2e')][_0xd008('0x33')]));_0x2f6f33['attributes']=_0x2f6f33['attributes'][_0xd008('0x34')]?_0x2f6f33[_0xd008('0x31')]:_0x279433[_0xd008('0x2d')];if(_0x3b2c71[_0xd008('0x2e')]['includeAll']){_0x2f6f33[_0xd008('0x42')]=[{'all':!![]}];}_0x2f6f33=_[_0xd008('0x3b')]({},_0x2f6f33,_0x3b2c71[_0xd008('0x3e')]);return db[_0xd008('0x28')][_0xd008('0x43')](_0x2f6f33)[_0xd008('0x23')](handleEntityNotFound(_0x2788dd,null))[_0xd008('0x23')](respondWithResult(_0x2788dd,null))['catch'](handleError(_0x2788dd,null));};exports['create']=function(_0xf8c92a,_0x259849){return db[_0xd008('0x28')][_0xd008('0x44')](_0xf8c92a[_0xd008('0x45')],{})[_0xd008('0x23')](respondWithResult(_0x259849,0xc9))[_0xd008('0x41')](handleError(_0x259849,null));};exports[_0xd008('0x22')]=function(_0x27fe19,_0x2b1406){if(_0x27fe19[_0xd008('0x45')]['id']){delete _0x27fe19['body']['id'];}return db[_0xd008('0x28')][_0xd008('0x43')]({'where':{'id':_0x27fe19[_0xd008('0x46')]['id']}})[_0xd008('0x23')](handleEntityNotFound(_0x2b1406,null))['then'](saveUpdates(_0x27fe19[_0xd008('0x45')],null))[_0xd008('0x23')](respondWithResult(_0x2b1406,null))[_0xd008('0x41')](handleError(_0x2b1406,null));};exports['destroy']=function(_0x58f57e,_0x479170){return db[_0xd008('0x28')]['find']({'where':{'id':_0x58f57e[_0xd008('0x46')]['id']}})[_0xd008('0x23')](handleEntityNotFound(_0x479170,null))[_0xd008('0x23')](removeEntity(_0x479170,null))['catch'](handleError(_0x479170,null));};exports[_0xd008('0x47')]=function(_0x328ff1,_0x13768b,_0x1d5079){var _0x4f83fa={};var _0x25182c={};var _0x295f82;var _0x307fc9;return db[_0xd008('0x28')][_0xd008('0x48')]({'where':{'id':_0x328ff1[_0xd008('0x46')]['id']}})[_0xd008('0x23')](handleEntityNotFound(_0x13768b,null))['then'](function(_0x466a41){if(_0x466a41){_0x295f82=_0x466a41;_0x25182c['model']=_[_0xd008('0x2f')](db[_0xd008('0x49')][_0xd008('0x29')]);_0x25182c[_0xd008('0x2e')]=_[_0xd008('0x2f')](_0x328ff1[_0xd008('0x2e')]);_0x25182c['filters']=_[_0xd008('0x32')](_0x25182c['model'],_0x25182c[_0xd008('0x2e')]);_0x4f83fa['attributes']=_[_0xd008('0x32')](_0x25182c[_0xd008('0x2d')],qs[_0xd008('0x33')](_0x328ff1[_0xd008('0x2e')]['fields']));_0x4f83fa[_0xd008('0x31')]=_0x4f83fa[_0xd008('0x31')]['length']?_0x4f83fa[_0xd008('0x31')]:_0x25182c[_0xd008('0x2d')];_0x4f83fa['order']=qs[_0xd008('0x38')](_0x328ff1[_0xd008('0x2e')][_0xd008('0x38')]);_0x4f83fa[_0xd008('0x3c')]=qs['filters'](_['pick'](_0x328ff1[_0xd008('0x2e')],_0x25182c[_0xd008('0x30')]));if(_0x328ff1[_0xd008('0x2e')][_0xd008('0x3a')]){_0x4f83fa['where']=_[_0xd008('0x3b')](_0x4f83fa[_0xd008('0x3c')],{'$or':_[_0xd008('0x27')](_0x4f83fa[_0xd008('0x31')],function(_0xc1bf97){var _0x1917f0={};_0x1917f0[_0xc1bf97]={'$like':'%'+_0x328ff1[_0xd008('0x2e')]['filter']+'%'};return _0x1917f0;})});}_0x4f83fa=_[_0xd008('0x3b')]({},_0x4f83fa,_0x328ff1[_0xd008('0x3e')]);return _0x295f82['getFields'](_0x4f83fa);}})[_0xd008('0x23')](function(_0x4d192d){if(_0x4d192d){_0x307fc9=_0x4d192d[_0xd008('0x34')];if(!_0x328ff1[_0xd008('0x2e')]['hasOwnProperty'](_0xd008('0x36'))){_0x4f83fa['limit']=qs['limit'](_0x328ff1['query'][_0xd008('0x1c')]);_0x4f83fa[_0xd008('0x1e')]=qs[_0xd008('0x1e')](_0x328ff1['query'][_0xd008('0x1e')]);}return _0x295f82[_0xd008('0x47')](_0x4f83fa);}})['then'](function(_0x4b592e){if(_0x4b592e){return _0x4b592e?{'count':_0x307fc9,'rows':_0x4b592e}:null;}})[_0xd008('0x23')](respondWithResult(_0x13768b,null))['catch'](handleError(_0x13768b,null));};exports[_0xd008('0x4a')]=function(_0x1feffe,_0x3617c4,_0x1269a0){var _0x137757={};var _0x341372={};var _0x3b0953;var _0x39ad6f;return db[_0xd008('0x28')][_0xd008('0x48')]({'where':{'id':_0x1feffe[_0xd008('0x46')]['id']}})[_0xd008('0x23')](handleEntityNotFound(_0x3617c4,null))[_0xd008('0x23')](function(_0x26590b){if(_0x26590b){_0x3b0953=_0x26590b;_0x341372[_0xd008('0x2d')]=_['keys'](db[_0xd008('0x49')][_0xd008('0x29')]);_0x341372[_0xd008('0x2e')]=_['keys'](_0x1feffe['query']);_0x341372['filters']=_[_0xd008('0x32')](_0x341372['model'],_0x341372['query']);_0x137757['attributes']=_[_0xd008('0x32')](_0x341372[_0xd008('0x2d')],qs['fields'](_0x1feffe[_0xd008('0x2e')][_0xd008('0x33')]));_0x137757[_0xd008('0x31')]=_0x137757[_0xd008('0x31')][_0xd008('0x34')]?_0x137757[_0xd008('0x31')]:_0x341372[_0xd008('0x2d')];_0x137757['order']=qs[_0xd008('0x38')](_0x1feffe[_0xd008('0x2e')][_0xd008('0x38')]);_0x137757[_0xd008('0x3c')]=qs[_0xd008('0x30')](_[_0xd008('0x39')](_0x1feffe[_0xd008('0x2e')],_0x341372[_0xd008('0x30')]));if(_0x1feffe[_0xd008('0x2e')][_0xd008('0x3a')]){_0x137757[_0xd008('0x3c')]=_[_0xd008('0x3b')](_0x137757[_0xd008('0x3c')],{'$or':_['map'](_0x137757[_0xd008('0x31')],function(_0x307a71){var _0x1800b3={};_0x1800b3[_0x307a71]={'$like':'%'+_0x1feffe[_0xd008('0x2e')]['filter']+'%'};return _0x1800b3;})});}_0x137757=_[_0xd008('0x3b')]({},_0x137757,_0x1feffe[_0xd008('0x3e')]);return _0x3b0953['getSubjects'](_0x137757);}})[_0xd008('0x23')](function(_0x188e47){if(_0x188e47){_0x39ad6f=_0x188e47['length'];if(!_0x1feffe[_0xd008('0x2e')][_0xd008('0x35')](_0xd008('0x36'))){_0x137757[_0xd008('0x1c')]=qs[_0xd008('0x1c')](_0x1feffe[_0xd008('0x2e')][_0xd008('0x1c')]);_0x137757[_0xd008('0x1e')]=qs[_0xd008('0x1e')](_0x1feffe[_0xd008('0x2e')][_0xd008('0x1e')]);}return _0x3b0953[_0xd008('0x4a')](_0x137757);}})[_0xd008('0x23')](function(_0xc7a619){if(_0xc7a619){return _0xc7a619?{'count':_0x39ad6f,'rows':_0xc7a619}:null;}})[_0xd008('0x23')](respondWithResult(_0x3617c4,null))[_0xd008('0x41')](handleError(_0x3617c4,null));};exports['getDescriptions']=function(_0x36f3ff,_0x444421,_0x25b92d){var _0x19168a={};var _0x9acee5={};var _0x17b8a8;var _0x41b5f7;return db['ZohoConfiguration'][_0xd008('0x48')]({'where':{'id':_0x36f3ff[_0xd008('0x46')]['id']}})[_0xd008('0x23')](handleEntityNotFound(_0x444421,null))[_0xd008('0x23')](function(_0x2ce397){if(_0x2ce397){_0x17b8a8=_0x2ce397;_0x9acee5[_0xd008('0x2d')]=_[_0xd008('0x2f')](db[_0xd008('0x49')][_0xd008('0x29')]);_0x9acee5[_0xd008('0x2e')]=_[_0xd008('0x2f')](_0x36f3ff['query']);_0x9acee5[_0xd008('0x30')]=_[_0xd008('0x32')](_0x9acee5[_0xd008('0x2d')],_0x9acee5[_0xd008('0x2e')]);_0x19168a['attributes']=_['intersection'](_0x9acee5['model'],qs[_0xd008('0x33')](_0x36f3ff[_0xd008('0x2e')][_0xd008('0x33')]));_0x19168a[_0xd008('0x31')]=_0x19168a['attributes'][_0xd008('0x34')]?_0x19168a[_0xd008('0x31')]:_0x9acee5[_0xd008('0x2d')];_0x19168a[_0xd008('0x37')]=qs[_0xd008('0x38')](_0x36f3ff[_0xd008('0x2e')][_0xd008('0x38')]);_0x19168a[_0xd008('0x3c')]=qs[_0xd008('0x30')](_[_0xd008('0x39')](_0x36f3ff['query'],_0x9acee5[_0xd008('0x30')]));if(_0x36f3ff[_0xd008('0x2e')][_0xd008('0x3a')]){_0x19168a[_0xd008('0x3c')]=_[_0xd008('0x3b')](_0x19168a[_0xd008('0x3c')],{'$or':_['map'](_0x19168a[_0xd008('0x31')],function(_0x48faea){var _0x5b339a={};_0x5b339a[_0x48faea]={'$like':'%'+_0x36f3ff['query']['filter']+'%'};return _0x5b339a;})});}_0x19168a=_['merge']({},_0x19168a,_0x36f3ff['options']);return _0x17b8a8[_0xd008('0x4b')](_0x19168a);}})[_0xd008('0x23')](function(_0x1e85dd){if(_0x1e85dd){_0x41b5f7=_0x1e85dd[_0xd008('0x34')];if(!_0x36f3ff[_0xd008('0x2e')]['hasOwnProperty'](_0xd008('0x36'))){_0x19168a[_0xd008('0x1c')]=qs['limit'](_0x36f3ff[_0xd008('0x2e')][_0xd008('0x1c')]);_0x19168a['offset']=qs['offset'](_0x36f3ff['query'][_0xd008('0x1e')]);}return _0x17b8a8[_0xd008('0x4b')](_0x19168a);}})['then'](function(_0x2765c1){if(_0x2765c1){return _0x2765c1?{'count':_0x41b5f7,'rows':_0x2765c1}:null;}})[_0xd008('0x23')](respondWithResult(_0x444421,null))[_0xd008('0x41')](handleError(_0x444421,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index d8d4af5..bc760fa 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 _0xb5de=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api'];(function(_0x1edb23,_0x537a2e){var _0x1df779=function(_0x400ae5){while(--_0x400ae5){_0x1edb23['push'](_0x1edb23['shift']());}};_0x1df779(++_0x537a2e);}(_0xb5de,0x19d));var _0xeb5d=function(_0x162a6f,_0x332b92){_0x162a6f=_0x162a6f-0x0;var _0x4886c5=_0xb5de[_0x162a6f];return _0x4886c5;};'use strict';var _=require('lodash');var util=require(_0xeb5d('0x0'));var logger=require(_0xeb5d('0x1'))(_0xeb5d('0x2'));var moment=require(_0xeb5d('0x3'));var BPromise=require(_0xeb5d('0x4'));var rp=require(_0xeb5d('0x5'));var fs=require('fs');var path=require(_0xeb5d('0x6'));var rimraf=require(_0xeb5d('0x7'));var config=require(_0xeb5d('0x8'));var attributes=require('./intZohoConfiguration.attributes');module[_0xeb5d('0x9')]=function(_0x591202,_0x396221){return _0x591202[_0xeb5d('0xa')](_0xeb5d('0xb'),attributes,{'tableName':_0xeb5d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb9c=['util','../../config/logger','api','moment','bluebird','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdb9c,0x1eb));var _0xcdb9=function(_0x550a5e,_0xa61dd7){_0x550a5e=_0x550a5e-0x0;var _0x376ed6=_0xdb9c[_0x550a5e];return _0x376ed6;};'use strict';var _=require(_0xcdb9('0x0'));var util=require(_0xcdb9('0x1'));var logger=require(_0xcdb9('0x2'))(_0xcdb9('0x3'));var moment=require(_0xcdb9('0x4'));var BPromise=require(_0xcdb9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcdb9('0x6'));var attributes=require(_0xcdb9('0x7'));module[_0xcdb9('0x8')]=function(_0x158a42,_0x40cc76){return _0x158a42[_0xcdb9('0x9')](_0xcdb9('0xa'),attributes,{'tableName':_0xcdb9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index aaae636..a3581be 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 _0xbff7=['debug','stringify','error','message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xbff7,0x1bb));var _0x7bff=function(_0x4ee193,_0x9751ac){_0x4ee193=_0x4ee193-0x0;var _0x40fce1=_0xbff7[_0x4ee193];return _0x40fce1;};'use strict';var _=require(_0x7bff('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7bff('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7bff('0x2'))['db'];var utils=require(_0x7bff('0x3'));var logger=require(_0x7bff('0x4'))('rpc');var config=require(_0x7bff('0x5'));var jayson=require(_0x7bff('0x6'));var client=jayson[_0x7bff('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x545d51,_0x5092e7,_0x57968a){return new BPromise(function(_0x338a5c,_0x3ce463){return client[_0x7bff('0x8')](_0x545d51,_0x57968a)[_0x7bff('0x9')](function(_0x42cec1){logger[_0x7bff('0xa')](_0x7bff('0xb'),_0x5092e7,_0x7bff('0xc'));logger[_0x7bff('0xd')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x5092e7,_0x7bff('0xc'),JSON[_0x7bff('0xe')](_0x42cec1));if(_0x42cec1[_0x7bff('0xf')]){if(_0x42cec1[_0x7bff('0xf')]['code']===0x1f4){logger[_0x7bff('0xf')](_0x7bff('0xb'),_0x5092e7,_0x42cec1[_0x7bff('0xf')][_0x7bff('0x10')]);return _0x3ce463(_0x42cec1['error']['message']);}logger[_0x7bff('0xf')](_0x7bff('0xb'),_0x5092e7,_0x42cec1[_0x7bff('0xf')][_0x7bff('0x10')]);return _0x338a5c(_0x42cec1[_0x7bff('0xf')][_0x7bff('0x10')]);}else{logger[_0x7bff('0xa')](_0x7bff('0xb'),_0x5092e7,_0x7bff('0xc'));_0x338a5c(_0x42cec1[_0x7bff('0x11')]['message']);}})[_0x7bff('0x12')](function(_0x4201a7){logger[_0x7bff('0xf')](_0x7bff('0xb'),_0x5092e7,_0x4201a7);_0x3ce463(_0x4201a7);});});} \ No newline at end of file +var _0xd24a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0xaaa4fd,_0x9c5f4b){var _0xd428ce=function(_0x1b930c){while(--_0x1b930c){_0xaaa4fd['push'](_0xaaa4fd['shift']());}};_0xd428ce(++_0x9c5f4b);}(_0xd24a,0x1de));var _0xad24=function(_0x28a6c6,_0x53b40a){_0x28a6c6=_0x28a6c6-0x0;var _0x4c1d37=_0xd24a[_0x28a6c6];return _0x4c1d37;};'use strict';var _=require(_0xad24('0x0'));var util=require(_0xad24('0x1'));var moment=require('moment');var BPromise=require(_0xad24('0x2'));var rs=require(_0xad24('0x3'));var fs=require('fs');var Redis=require(_0xad24('0x4'));var db=require(_0xad24('0x5'))['db'];var utils=require(_0xad24('0x6'));var logger=require(_0xad24('0x7'))(_0xad24('0x8'));var config=require('../../config/environment');var jayson=require(_0xad24('0x9'));var client=jayson[_0xad24('0xa')][_0xad24('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44f285,_0x3b9920,_0x183024){return new BPromise(function(_0x5f52ab,_0x4b44ee){return client[_0xad24('0xc')](_0x44f285,_0x183024)[_0xad24('0xd')](function(_0x48908e){logger[_0xad24('0xe')](_0xad24('0xf'),_0x3b9920,_0xad24('0x10'));logger['debug'](_0xad24('0x11'),_0x3b9920,_0xad24('0x10'),JSON[_0xad24('0x12')](_0x48908e));if(_0x48908e['error']){if(_0x48908e[_0xad24('0x13')][_0xad24('0x14')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x3b9920,_0x48908e[_0xad24('0x13')]['message']);return _0x4b44ee(_0x48908e[_0xad24('0x13')][_0xad24('0x15')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x3b9920,_0x48908e[_0xad24('0x13')][_0xad24('0x15')]);return _0x5f52ab(_0x48908e[_0xad24('0x13')][_0xad24('0x15')]);}else{logger['info'](_0xad24('0xf'),_0x3b9920,_0xad24('0x10'));_0x5f52ab(_0x48908e[_0xad24('0x16')]['message']);}})[_0xad24('0x17')](function(_0x4481c5){logger[_0xad24('0x13')](_0xad24('0xf'),_0x3b9920,_0x4481c5);_0x4b44ee(_0x4481c5);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index f722fb6..63cb6e5 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 _0xd594=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','post','create','put','/:id','update','delete','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd594,0x176));var _0x4d59=function(_0x411c23,_0x5503ae){_0x411c23=_0x411c23-0x0;var _0x27fab6=_0xd594[_0x411c23];return _0x27fab6;};'use strict';var multer=require('multer');var util=require(_0x4d59('0x0'));var path=require(_0x4d59('0x1'));var timeout=require(_0x4d59('0x2'));var express=require('express');var router=express[_0x4d59('0x3')]();var fs_extra=require(_0x4d59('0x4'));var auth=require(_0x4d59('0x5'));var interaction=require(_0x4d59('0x6'));var config=require('../../config/environment');var controller=require('./intZohoField.controller');router['get']('/',auth[_0x4d59('0x7')](),controller[_0x4d59('0x8')]);router[_0x4d59('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4d59('0xa')]('/',auth[_0x4d59('0x7')](),controller[_0x4d59('0xb')]);router[_0x4d59('0xc')](_0x4d59('0xd'),auth[_0x4d59('0x7')](),controller[_0x4d59('0xe')]);router[_0x4d59('0xf')](_0x4d59('0xd'),auth[_0x4d59('0x7')](),controller['destroy']);module[_0x4d59('0x10')]=router; \ No newline at end of file +var _0xc0ae=['../../config/environment','get','isAuthenticated','index','/:id','show','post','update','destroy','exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xc0ae,0xb2));var _0xec0a=function(_0x16c94f,_0x3733e2){_0x16c94f=_0x16c94f-0x0;var _0x5ddf05=_0xc0ae[_0x16c94f];return _0x5ddf05;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xec0a('0x0'));var timeout=require(_0xec0a('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xec0a('0x2'));var interaction=require(_0xec0a('0x3'));var config=require(_0xec0a('0x4'));var controller=require('./intZohoField.controller');router[_0xec0a('0x5')]('/',auth[_0xec0a('0x6')](),controller[_0xec0a('0x7')]);router[_0xec0a('0x5')](_0xec0a('0x8'),auth['isAuthenticated'](),controller[_0xec0a('0x9')]);router[_0xec0a('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xec0a('0x8'),auth[_0xec0a('0x6')](),controller[_0xec0a('0xb')]);router['delete'](_0xec0a('0x8'),auth[_0xec0a('0x6')](),controller[_0xec0a('0xc')]);module[_0xec0a('0xd')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 56e7584..7a155e0 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 _0x097d=['string','customVariable','picklist','STRING','ENUM','BOOLEAN','exports'];(function(_0x178f3f,_0x5ba527){var _0x3cde37=function(_0x119ca8){while(--_0x119ca8){_0x178f3f['push'](_0x178f3f['shift']());}};_0x3cde37(++_0x5ba527);}(_0x097d,0x164));var _0xd097=function(_0x95e21d,_0x36861e){_0x95e21d=_0x95e21d-0x0;var _0x3fd266=_0x097d[_0x95e21d];return _0x3fd266;};'use strict';var Sequelize=require('sequelize');module[_0xd097('0x0')]={'type':{'type':Sequelize['ENUM'](_0xd097('0x1'),'variable',_0xd097('0x2'),'keyValue',_0xd097('0x3')),'defaultValue':_0xd097('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd097('0x4')]},'keyType':{'type':Sequelize[_0xd097('0x5')](_0xd097('0x1'),'variable',_0xd097('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd097('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd097('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd097('0x4')]}}; \ No newline at end of file +var _0xfe0d=['ENUM','customVariable','BOOLEAN','sequelize','exports','string','variable','keyValue','STRING'];(function(_0x272667,_0x51c8de){var _0x5d1a5c=function(_0x363eda){while(--_0x363eda){_0x272667['push'](_0x272667['shift']());}};_0x5d1a5c(++_0x51c8de);}(_0xfe0d,0xd2));var _0xdfe0=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfe0d[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xdfe0('0x0'));module[_0xdfe0('0x1')]={'type':{'type':Sequelize['ENUM'](_0xdfe0('0x2'),_0xdfe0('0x3'),'customVariable',_0xdfe0('0x4'),'picklist'),'defaultValue':_0xdfe0('0x2')},'content':{'type':Sequelize[_0xdfe0('0x5')]},'key':{'type':Sequelize[_0xdfe0('0x5')]},'keyType':{'type':Sequelize[_0xdfe0('0x6')](_0xdfe0('0x2'),_0xdfe0('0x3'),_0xdfe0('0x7'))},'keyContent':{'type':Sequelize[_0xdfe0('0x5')]},'idField':{'type':Sequelize[_0xdfe0('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xdfe0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 55b056e..6c4c3ad 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 _0xf79e=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','save','update','destroy','then','stack','name','send','index','ZohoField','rawAttributes','fieldName','type','key','model','map'];(function(_0x4c6494,_0x3f802c){var _0x24f2e3=function(_0x5b3cbd){while(--_0x5b3cbd){_0x4c6494['push'](_0x4c6494['shift']());}};_0x24f2e3(++_0x3f802c);}(_0xf79e,0x185));var _0xef79=function(_0x434e27,_0xe295f5){_0x434e27=_0x434e27-0x0;var _0x567325=_0xf79e[_0x434e27];return _0x567325;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef79('0x0'));var zipdir=require(_0xef79('0x1'));var jsonpatch=require(_0xef79('0x2'));var rp=require('request-promise');var moment=require(_0xef79('0x3'));var BPromise=require(_0xef79('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xef79('0x5'));var sox=require(_0xef79('0x6'));var csv=require(_0xef79('0x7'));var ejs=require(_0xef79('0x8'));var fs=require('fs');var fs_extra=require(_0xef79('0x9'));var _=require(_0xef79('0xa'));var squel=require('squel');var crypto=require(_0xef79('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xef79('0xc'));var toCsv=require(_0xef79('0x7'));var querystring=require('querystring');var Papa=require(_0xef79('0xd'));var Redis=require(_0xef79('0xe'));var authService=require(_0xef79('0xf'));var qs=require(_0xef79('0x10'));var as=require(_0xef79('0x11'));var hardwareService=require(_0xef79('0x12'));var logger=require(_0xef79('0x13'))(_0xef79('0x14'));var utils=require('../../config/utils');var config=require(_0xef79('0x15'));var licenseUtil=require(_0xef79('0x16'));var db=require(_0xef79('0x17'))['db'];function respondWithStatusCode(_0x29ef3d,_0x10f122){_0x10f122=_0x10f122||0xcc;return function(_0x2ad8ea){if(_0x2ad8ea){return _0x29ef3d[_0xef79('0x18')](_0x10f122);}return _0x29ef3d[_0xef79('0x19')](_0x10f122)[_0xef79('0x1a')]();};}function respondWithResult(_0x353e76,_0x4bc3ac){_0x4bc3ac=_0x4bc3ac||0xc8;return function(_0x561b3b){if(_0x561b3b){return _0x353e76['status'](_0x4bc3ac)['json'](_0x561b3b);}};}function respondWithFilteredResult(_0xe3dbe7,_0x2b42bc){return function(_0xfbbcfe){if(_0xfbbcfe){var _0x7a40d5=typeof _0x2b42bc['offset']===_0xef79('0x1b')&&typeof _0x2b42bc[_0xef79('0x1c')]==='undefined';var _0x185864=_0xfbbcfe[_0xef79('0x1d')];var _0x249a8c=_0x7a40d5?0x0:_0x2b42bc[_0xef79('0x1e')];var _0x55492c=_0x7a40d5?_0xfbbcfe[_0xef79('0x1d')]:_0x2b42bc['offset']+_0x2b42bc[_0xef79('0x1c')];var _0x1de53c;if(_0x55492c>=_0x185864){_0x55492c=_0x185864;_0x1de53c=0xc8;}else{_0x1de53c=0xce;}_0xe3dbe7[_0xef79('0x19')](_0x1de53c);return _0xe3dbe7['set'](_0xef79('0x1f'),_0x249a8c+'-'+_0x55492c+'/'+_0x185864)[_0xef79('0x20')](_0xfbbcfe);}return null;};}function patchUpdates(_0x48e6e6){return function(_0x4a37e9){try{jsonpatch[_0xef79('0x21')](_0x4a37e9,_0x48e6e6,!![]);}catch(_0x1362c){return BPromise['reject'](_0x1362c);}return _0x4a37e9[_0xef79('0x22')]();};}function saveUpdates(_0x154bff,_0x3ce762){return function(_0x4bc294){if(_0x4bc294){return _0x4bc294[_0xef79('0x23')](_0x154bff)['then'](function(_0x52a20e){return _0x52a20e;});}return null;};}function removeEntity(_0x1a125f,_0x196672){return function(_0x48b3f3){if(_0x48b3f3){return _0x48b3f3[_0xef79('0x24')]()[_0xef79('0x25')](function(){_0x1a125f[_0xef79('0x19')](0xcc)[_0xef79('0x1a')]();});}};}function handleEntityNotFound(_0x5b4017,_0xa0efa7){return function(_0x1d9220){if(!_0x1d9220){_0x5b4017[_0xef79('0x18')](0x194);}return _0x1d9220;};}function handleError(_0x237e30,_0x5c9d06){_0x5c9d06=_0x5c9d06||0x1f4;return function(_0x38ec60){logger['error'](_0x38ec60[_0xef79('0x26')]);if(_0x38ec60['name']){delete _0x38ec60[_0xef79('0x27')];}_0x237e30[_0xef79('0x19')](_0x5c9d06)[_0xef79('0x28')](_0x38ec60);};}exports[_0xef79('0x29')]=function(_0x5c29ea,_0x42040c){var _0x446be1={},_0x2e3bbf={},_0x56fb08={'count':0x0,'rows':[]};var _0x185566=_['map'](db[_0xef79('0x2a')][_0xef79('0x2b')],function(_0x22904e){return{'name':_0x22904e[_0xef79('0x2c')],'type':_0x22904e[_0xef79('0x2d')][_0xef79('0x2e')]};});_0x2e3bbf[_0xef79('0x2f')]=_[_0xef79('0x30')](_0x185566,'name');_0x2e3bbf[_0xef79('0x31')]=_[_0xef79('0x32')](_0x5c29ea[_0xef79('0x31')]);_0x2e3bbf[_0xef79('0x33')]=_[_0xef79('0x34')](_0x2e3bbf[_0xef79('0x2f')],_0x2e3bbf[_0xef79('0x31')]);_0x446be1['attributes']=_[_0xef79('0x34')](_0x2e3bbf[_0xef79('0x2f')],qs[_0xef79('0x35')](_0x5c29ea[_0xef79('0x31')][_0xef79('0x35')]));_0x446be1[_0xef79('0x36')]=_0x446be1[_0xef79('0x36')][_0xef79('0x37')]?_0x446be1[_0xef79('0x36')]:_0x2e3bbf[_0xef79('0x2f')];if(!_0x5c29ea[_0xef79('0x31')][_0xef79('0x38')](_0xef79('0x39'))){_0x446be1[_0xef79('0x1c')]=qs[_0xef79('0x1c')](_0x5c29ea[_0xef79('0x31')][_0xef79('0x1c')]);_0x446be1[_0xef79('0x1e')]=qs[_0xef79('0x1e')](_0x5c29ea['query']['offset']);}_0x446be1[_0xef79('0x3a')]=qs['sort'](_0x5c29ea[_0xef79('0x31')]['sort']);_0x446be1[_0xef79('0x3b')]=qs[_0xef79('0x33')](_['pick'](_0x5c29ea[_0xef79('0x31')],_0x2e3bbf['filters']),_0x185566);if(_0x5c29ea['query']['filter']){_0x446be1[_0xef79('0x3b')]=_[_0xef79('0x3c')](_0x446be1[_0xef79('0x3b')],{'$or':_[_0xef79('0x30')](_0x185566,function(_0x31028a){if(_0x31028a[_0xef79('0x2d')]!==_0xef79('0x3d')){var _0x24b3fb={};_0x24b3fb[_0x31028a[_0xef79('0x27')]]={'$like':'%'+_0x5c29ea[_0xef79('0x31')][_0xef79('0x3e')]+'%'};return _0x24b3fb;}})});}_0x446be1=_['merge']({},_0x446be1,_0x5c29ea['options']);var _0x44db71={'where':_0x446be1[_0xef79('0x3b')]};return db[_0xef79('0x2a')]['count'](_0x44db71)[_0xef79('0x25')](function(_0x224a99){_0x56fb08['count']=_0x224a99;if(_0x5c29ea[_0xef79('0x31')][_0xef79('0x3f')]){_0x446be1[_0xef79('0x40')]=[{'all':!![]}];}return db[_0xef79('0x2a')][_0xef79('0x41')](_0x446be1);})[_0xef79('0x25')](function(_0x5ba1a6){_0x56fb08[_0xef79('0x42')]=_0x5ba1a6;return _0x56fb08;})[_0xef79('0x25')](respondWithFilteredResult(_0x42040c,_0x446be1))['catch'](handleError(_0x42040c,null));};exports[_0xef79('0x43')]=function(_0x3caa69,_0x537a57){var _0x3251a6={'raw':!![],'where':{'id':_0x3caa69[_0xef79('0x44')]['id']}},_0x411798={};_0x411798[_0xef79('0x2f')]=_[_0xef79('0x32')](db[_0xef79('0x2a')]['rawAttributes']);_0x411798['query']=_[_0xef79('0x32')](_0x3caa69[_0xef79('0x31')]);_0x411798[_0xef79('0x33')]=_['intersection'](_0x411798[_0xef79('0x2f')],_0x411798['query']);_0x3251a6['attributes']=_['intersection'](_0x411798[_0xef79('0x2f')],qs[_0xef79('0x35')](_0x3caa69[_0xef79('0x31')]['fields']));_0x3251a6[_0xef79('0x36')]=_0x3251a6[_0xef79('0x36')][_0xef79('0x37')]?_0x3251a6[_0xef79('0x36')]:_0x411798[_0xef79('0x2f')];if(_0x3caa69[_0xef79('0x31')][_0xef79('0x3f')]){_0x3251a6[_0xef79('0x40')]=[{'all':!![]}];}_0x3251a6=_['merge']({},_0x3251a6,_0x3caa69['options']);return db[_0xef79('0x2a')][_0xef79('0x45')](_0x3251a6)[_0xef79('0x25')](handleEntityNotFound(_0x537a57,null))[_0xef79('0x25')](respondWithResult(_0x537a57,null))[_0xef79('0x46')](handleError(_0x537a57,null));};exports[_0xef79('0x47')]=function(_0x3fddec,_0x400f9a){return db['ZohoField']['create'](_0x3fddec['body'],{})[_0xef79('0x25')](respondWithResult(_0x400f9a,0xc9))[_0xef79('0x46')](handleError(_0x400f9a,null));};exports['update']=function(_0xfb500f,_0x457043){if(_0xfb500f[_0xef79('0x48')]['id']){delete _0xfb500f['body']['id'];}return db[_0xef79('0x2a')]['find']({'where':{'id':_0xfb500f[_0xef79('0x44')]['id']}})[_0xef79('0x25')](handleEntityNotFound(_0x457043,null))[_0xef79('0x25')](saveUpdates(_0xfb500f['body'],null))[_0xef79('0x25')](respondWithResult(_0x457043,null))['catch'](handleError(_0x457043,null));};exports[_0xef79('0x24')]=function(_0x160ebb,_0x18c7d4){return db['ZohoField'][_0xef79('0x45')]({'where':{'id':_0x160ebb[_0xef79('0x44')]['id']}})[_0xef79('0x25')](handleEntityNotFound(_0x18c7d4,null))['then'](removeEntity(_0x18c7d4,null))[_0xef79('0x46')](handleError(_0x18c7d4,null));}; \ No newline at end of file +var _0x5b7c=['findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b7c,0x9e));var _0xc5b7=function(_0x55312b,_0x50e42b){_0x55312b=_0x55312b-0x0;var _0x87b244=_0x5b7c[_0x55312b];return _0x87b244;};'use strict';var emlformat=require(_0xc5b7('0x0'));var rimraf=require(_0xc5b7('0x1'));var zipdir=require(_0xc5b7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc5b7('0x3'));var moment=require(_0xc5b7('0x4'));var BPromise=require(_0xc5b7('0x5'));var Mustache=require(_0xc5b7('0x6'));var util=require(_0xc5b7('0x7'));var path=require('path');var sox=require(_0xc5b7('0x8'));var csv=require(_0xc5b7('0x9'));var ejs=require(_0xc5b7('0xa'));var fs=require('fs');var fs_extra=require(_0xc5b7('0xb'));var _=require(_0xc5b7('0xc'));var squel=require(_0xc5b7('0xd'));var crypto=require(_0xc5b7('0xe'));var jsforce=require(_0xc5b7('0xf'));var deskjs=require(_0xc5b7('0x10'));var toCsv=require(_0xc5b7('0x9'));var querystring=require(_0xc5b7('0x11'));var Papa=require(_0xc5b7('0x12'));var Redis=require(_0xc5b7('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc5b7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc5b7('0x15'));var utils=require(_0xc5b7('0x16'));var config=require(_0xc5b7('0x17'));var licenseUtil=require(_0xc5b7('0x18'));var db=require(_0xc5b7('0x19'))['db'];function respondWithStatusCode(_0x2ce32e,_0x405155){_0x405155=_0x405155||0xcc;return function(_0x5b882b){if(_0x5b882b){return _0x2ce32e[_0xc5b7('0x1a')](_0x405155);}return _0x2ce32e[_0xc5b7('0x1b')](_0x405155)['end']();};}function respondWithResult(_0xd1ad86,_0x15cc43){_0x15cc43=_0x15cc43||0xc8;return function(_0x5375cf){if(_0x5375cf){return _0xd1ad86[_0xc5b7('0x1b')](_0x15cc43)[_0xc5b7('0x1c')](_0x5375cf);}};}function respondWithFilteredResult(_0x49c745,_0x5902fb){return function(_0xf37add){if(_0xf37add){var _0x1c00ac=typeof _0x5902fb[_0xc5b7('0x1d')]===_0xc5b7('0x1e')&&typeof _0x5902fb[_0xc5b7('0x1f')]===_0xc5b7('0x1e');var _0x89bc57=_0xf37add[_0xc5b7('0x20')];var _0x318463=_0x1c00ac?0x0:_0x5902fb[_0xc5b7('0x1d')];var _0x2c1f2f=_0x1c00ac?_0xf37add[_0xc5b7('0x20')]:_0x5902fb[_0xc5b7('0x1d')]+_0x5902fb['limit'];var _0xcdcd45;if(_0x2c1f2f>=_0x89bc57){_0x2c1f2f=_0x89bc57;_0xcdcd45=0xc8;}else{_0xcdcd45=0xce;}_0x49c745[_0xc5b7('0x1b')](_0xcdcd45);return _0x49c745[_0xc5b7('0x21')](_0xc5b7('0x22'),_0x318463+'-'+_0x2c1f2f+'/'+_0x89bc57)['json'](_0xf37add);}return null;};}function patchUpdates(_0x1e84d7){return function(_0x57a9df){try{jsonpatch['apply'](_0x57a9df,_0x1e84d7,!![]);}catch(_0x1bc541){return BPromise['reject'](_0x1bc541);}return _0x57a9df[_0xc5b7('0x23')]();};}function saveUpdates(_0x18fa4a,_0x8b8320){return function(_0x6610c5){if(_0x6610c5){return _0x6610c5[_0xc5b7('0x24')](_0x18fa4a)[_0xc5b7('0x25')](function(_0x9f8b96){return _0x9f8b96;});}return null;};}function removeEntity(_0x4c0692,_0x4441b0){return function(_0x21642b){if(_0x21642b){return _0x21642b[_0xc5b7('0x26')]()[_0xc5b7('0x25')](function(){_0x4c0692[_0xc5b7('0x1b')](0xcc)[_0xc5b7('0x27')]();});}};}function handleEntityNotFound(_0x2ad37e,_0x555e05){return function(_0xa87ef){if(!_0xa87ef){_0x2ad37e[_0xc5b7('0x1a')](0x194);}return _0xa87ef;};}function handleError(_0x10c7cb,_0x1670ea){_0x1670ea=_0x1670ea||0x1f4;return function(_0x460978){logger['error'](_0x460978['stack']);if(_0x460978[_0xc5b7('0x28')]){delete _0x460978['name'];}_0x10c7cb['status'](_0x1670ea)[_0xc5b7('0x29')](_0x460978);};}exports[_0xc5b7('0x2a')]=function(_0x2ec749,_0x336af0){var _0x12c96c={},_0x2011d9={},_0x1a8765={'count':0x0,'rows':[]};var _0x5d78f5=_[_0xc5b7('0x2b')](db[_0xc5b7('0x2c')][_0xc5b7('0x2d')],function(_0x7a4769){return{'name':_0x7a4769[_0xc5b7('0x2e')],'type':_0x7a4769[_0xc5b7('0x2f')][_0xc5b7('0x30')]};});_0x2011d9[_0xc5b7('0x31')]=_[_0xc5b7('0x2b')](_0x5d78f5,_0xc5b7('0x28'));_0x2011d9['query']=_[_0xc5b7('0x32')](_0x2ec749[_0xc5b7('0x33')]);_0x2011d9[_0xc5b7('0x34')]=_[_0xc5b7('0x35')](_0x2011d9[_0xc5b7('0x31')],_0x2011d9[_0xc5b7('0x33')]);_0x12c96c[_0xc5b7('0x36')]=_[_0xc5b7('0x35')](_0x2011d9[_0xc5b7('0x31')],qs['fields'](_0x2ec749['query'][_0xc5b7('0x37')]));_0x12c96c['attributes']=_0x12c96c[_0xc5b7('0x36')][_0xc5b7('0x38')]?_0x12c96c[_0xc5b7('0x36')]:_0x2011d9['model'];if(!_0x2ec749['query'][_0xc5b7('0x39')]('nolimit')){_0x12c96c['limit']=qs[_0xc5b7('0x1f')](_0x2ec749['query'][_0xc5b7('0x1f')]);_0x12c96c[_0xc5b7('0x1d')]=qs[_0xc5b7('0x1d')](_0x2ec749[_0xc5b7('0x33')]['offset']);}_0x12c96c[_0xc5b7('0x3a')]=qs[_0xc5b7('0x3b')](_0x2ec749[_0xc5b7('0x33')][_0xc5b7('0x3b')]);_0x12c96c[_0xc5b7('0x3c')]=qs['filters'](_['pick'](_0x2ec749['query'],_0x2011d9['filters']),_0x5d78f5);if(_0x2ec749[_0xc5b7('0x33')][_0xc5b7('0x3d')]){_0x12c96c[_0xc5b7('0x3c')]=_[_0xc5b7('0x3e')](_0x12c96c[_0xc5b7('0x3c')],{'$or':_[_0xc5b7('0x2b')](_0x5d78f5,function(_0x57971a){if(_0x57971a[_0xc5b7('0x2f')]!==_0xc5b7('0x3f')){var _0x550701={};_0x550701[_0x57971a[_0xc5b7('0x28')]]={'$like':'%'+_0x2ec749[_0xc5b7('0x33')]['filter']+'%'};return _0x550701;}})});}_0x12c96c=_[_0xc5b7('0x3e')]({},_0x12c96c,_0x2ec749[_0xc5b7('0x40')]);var _0x506dff={'where':_0x12c96c[_0xc5b7('0x3c')]};return db['ZohoField']['count'](_0x506dff)['then'](function(_0x1067cd){_0x1a8765[_0xc5b7('0x20')]=_0x1067cd;if(_0x2ec749['query'][_0xc5b7('0x41')]){_0x12c96c[_0xc5b7('0x42')]=[{'all':!![]}];}return db['ZohoField'][_0xc5b7('0x43')](_0x12c96c);})['then'](function(_0x27cd9e){_0x1a8765[_0xc5b7('0x44')]=_0x27cd9e;return _0x1a8765;})[_0xc5b7('0x25')](respondWithFilteredResult(_0x336af0,_0x12c96c))['catch'](handleError(_0x336af0,null));};exports[_0xc5b7('0x45')]=function(_0x1747a4,_0x2073b3){var _0x26fc87={'raw':!![],'where':{'id':_0x1747a4[_0xc5b7('0x46')]['id']}},_0x2c9d7e={};_0x2c9d7e[_0xc5b7('0x31')]=_[_0xc5b7('0x32')](db[_0xc5b7('0x2c')][_0xc5b7('0x2d')]);_0x2c9d7e[_0xc5b7('0x33')]=_['keys'](_0x1747a4[_0xc5b7('0x33')]);_0x2c9d7e[_0xc5b7('0x34')]=_['intersection'](_0x2c9d7e[_0xc5b7('0x31')],_0x2c9d7e['query']);_0x26fc87[_0xc5b7('0x36')]=_[_0xc5b7('0x35')](_0x2c9d7e[_0xc5b7('0x31')],qs[_0xc5b7('0x37')](_0x1747a4[_0xc5b7('0x33')]['fields']));_0x26fc87['attributes']=_0x26fc87[_0xc5b7('0x36')][_0xc5b7('0x38')]?_0x26fc87[_0xc5b7('0x36')]:_0x2c9d7e[_0xc5b7('0x31')];if(_0x1747a4['query'][_0xc5b7('0x41')]){_0x26fc87['include']=[{'all':!![]}];}_0x26fc87=_[_0xc5b7('0x3e')]({},_0x26fc87,_0x1747a4['options']);return db[_0xc5b7('0x2c')][_0xc5b7('0x47')](_0x26fc87)[_0xc5b7('0x25')](handleEntityNotFound(_0x2073b3,null))[_0xc5b7('0x25')](respondWithResult(_0x2073b3,null))[_0xc5b7('0x48')](handleError(_0x2073b3,null));};exports[_0xc5b7('0x49')]=function(_0x123da5,_0x146038){return db[_0xc5b7('0x2c')][_0xc5b7('0x49')](_0x123da5[_0xc5b7('0x4a')],{})['then'](respondWithResult(_0x146038,0xc9))[_0xc5b7('0x48')](handleError(_0x146038,null));};exports[_0xc5b7('0x24')]=function(_0x5f3feb,_0x49b575){if(_0x5f3feb[_0xc5b7('0x4a')]['id']){delete _0x5f3feb['body']['id'];}return db[_0xc5b7('0x2c')][_0xc5b7('0x47')]({'where':{'id':_0x5f3feb[_0xc5b7('0x46')]['id']}})[_0xc5b7('0x25')](handleEntityNotFound(_0x49b575,null))[_0xc5b7('0x25')](saveUpdates(_0x5f3feb[_0xc5b7('0x4a')],null))[_0xc5b7('0x25')](respondWithResult(_0x49b575,null))[_0xc5b7('0x48')](handleError(_0x49b575,null));};exports[_0xc5b7('0x26')]=function(_0x2e0c01,_0x599909){return db[_0xc5b7('0x2c')][_0xc5b7('0x47')]({'where':{'id':_0x2e0c01['params']['id']}})[_0xc5b7('0x25')](handleEntityNotFound(_0x599909,null))[_0xc5b7('0x25')](removeEntity(_0x599909,null))['catch'](handleError(_0x599909,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 2581c92..dbd6146 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 _0x323f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','api'];(function(_0x29f476,_0x2db883){var _0x18ded1=function(_0x221cc6){while(--_0x221cc6){_0x29f476['push'](_0x29f476['shift']());}};_0x18ded1(++_0x2db883);}(_0x323f,0x1ee));var _0xf323=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x323f[_0x311c35];return _0x5cc50c;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var logger=require('../../config/logger')(_0xf323('0x1'));var moment=require(_0xf323('0x2'));var BPromise=require(_0xf323('0x3'));var rp=require(_0xf323('0x4'));var fs=require('fs');var path=require(_0xf323('0x5'));var rimraf=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var attributes=require(_0xf323('0x8'));module[_0xf323('0x9')]=function(_0x371707,_0x5d7d60){return _0x371707[_0xf323('0xa')](_0xf323('0xb'),attributes,{'tableName':_0xf323('0xc'),'paranoid':![],'indexes':[{'name':_0xf323('0xd'),'fields':[_0xf323('0xe'),_0xf323('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x27a0=['../../config/logger','api','moment','bluebird','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','FieldId','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x27a0,0xbf));var _0x027a=function(_0x28ccf6,_0xb22057){_0x28ccf6=_0x28ccf6-0x0;var _0x4d28dc=_0x27a0[_0x28ccf6];return _0x4d28dc;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var logger=require(_0x027a('0x1'))(_0x027a('0x2'));var moment=require(_0x027a('0x3'));var BPromise=require(_0x027a('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(_0x027a('0x5'));module[_0x027a('0x6')]=function(_0x137b09,_0x639bec){return _0x137b09[_0x027a('0x7')](_0x027a('0x8'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x027a('0x9'),'fields':[_0x027a('0xa'),_0x027a('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 3482c36..db05340 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 _0xa4ff=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoField,\x20%s,\x20%s','message','info','util','moment'];(function(_0x43e19a,_0x2b6a3f){var _0x5c00d5=function(_0x445adc){while(--_0x445adc){_0x43e19a['push'](_0x43e19a['shift']());}};_0x5c00d5(++_0x2b6a3f);}(_0xa4ff,0x116));var _0xfa4f=function(_0x33c52c,_0x4c57c4){_0x33c52c=_0x33c52c-0x0;var _0x3ce30c=_0xa4ff[_0x33c52c];return _0x3ce30c;};'use strict';var _=require('lodash');var util=require(_0xfa4f('0x0'));var moment=require(_0xfa4f('0x1'));var BPromise=require(_0xfa4f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa4f('0x3'));var db=require(_0xfa4f('0x4'))['db'];var utils=require(_0xfa4f('0x5'));var logger=require(_0xfa4f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfa4f('0x7')][_0xfa4f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c3b32,_0x335ce0,_0x799724){return new BPromise(function(_0x47949c,_0x44e1b5){return client[_0xfa4f('0x9')](_0x5c3b32,_0x799724)[_0xfa4f('0xa')](function(_0x57ef38){logger['info']('ZohoField,\x20%s,\x20%s',_0x335ce0,'request\x20sent');logger[_0xfa4f('0xb')](_0xfa4f('0xc'),_0x335ce0,_0xfa4f('0xd'),JSON[_0xfa4f('0xe')](_0x57ef38));if(_0x57ef38[_0xfa4f('0xf')]){if(_0x57ef38[_0xfa4f('0xf')][_0xfa4f('0x10')]===0x1f4){logger[_0xfa4f('0xf')](_0xfa4f('0x11'),_0x335ce0,_0x57ef38[_0xfa4f('0xf')][_0xfa4f('0x12')]);return _0x44e1b5(_0x57ef38[_0xfa4f('0xf')][_0xfa4f('0x12')]);}logger[_0xfa4f('0xf')](_0xfa4f('0x11'),_0x335ce0,_0x57ef38[_0xfa4f('0xf')][_0xfa4f('0x12')]);return _0x47949c(_0x57ef38[_0xfa4f('0xf')][_0xfa4f('0x12')]);}else{logger[_0xfa4f('0x13')](_0xfa4f('0x11'),_0x335ce0,_0xfa4f('0xd'));_0x47949c(_0x57ef38['result'][_0xfa4f('0x12')]);}})['catch'](function(_0x2d21f5){logger[_0xfa4f('0xf')](_0xfa4f('0x11'),_0x335ce0,_0x2d21f5);_0x44e1b5(_0x2d21f5);});});} \ No newline at end of file +var _0xe1f2=['ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info'];(function(_0x18b203,_0x3845b5){var _0x56aa6=function(_0x3ede1f){while(--_0x3ede1f){_0x18b203['push'](_0x18b203['shift']());}};_0x56aa6(++_0x3845b5);}(_0xe1f2,0x14b));var _0x2e1f=function(_0x501d0d,_0x38b758){_0x501d0d=_0x501d0d-0x0;var _0x37a8b8=_0xe1f2[_0x501d0d];return _0x37a8b8;};'use strict';var _=require(_0x2e1f('0x0'));var util=require(_0x2e1f('0x1'));var moment=require(_0x2e1f('0x2'));var BPromise=require(_0x2e1f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e1f('0x4'));var db=require(_0x2e1f('0x5'))['db'];var utils=require(_0x2e1f('0x6'));var logger=require(_0x2e1f('0x7'))(_0x2e1f('0x8'));var config=require('../../config/environment');var jayson=require(_0x2e1f('0x9'));var client=jayson[_0x2e1f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c1cfc,_0x5b9ccd,_0x1d5d1a){return new BPromise(function(_0xdade82,_0x14aa69){return client[_0x2e1f('0xb')](_0x2c1cfc,_0x1d5d1a)[_0x2e1f('0xc')](function(_0x3538e7){logger[_0x2e1f('0xd')](_0x2e1f('0xe'),_0x5b9ccd,_0x2e1f('0xf'));logger[_0x2e1f('0x10')](_0x2e1f('0x11'),_0x5b9ccd,_0x2e1f('0xf'),JSON[_0x2e1f('0x12')](_0x3538e7));if(_0x3538e7[_0x2e1f('0x13')]){if(_0x3538e7[_0x2e1f('0x13')][_0x2e1f('0x14')]===0x1f4){logger[_0x2e1f('0x13')](_0x2e1f('0xe'),_0x5b9ccd,_0x3538e7['error'][_0x2e1f('0x15')]);return _0x14aa69(_0x3538e7['error'][_0x2e1f('0x15')]);}logger['error']('ZohoField,\x20%s,\x20%s',_0x5b9ccd,_0x3538e7['error'][_0x2e1f('0x15')]);return _0xdade82(_0x3538e7[_0x2e1f('0x13')][_0x2e1f('0x15')]);}else{logger[_0x2e1f('0xd')]('ZohoField,\x20%s,\x20%s',_0x5b9ccd,_0x2e1f('0xf'));_0xdade82(_0x3538e7['result']['message']);}})[_0x2e1f('0x16')](function(_0x36005e){logger[_0x2e1f('0x13')]('ZohoField,\x20%s,\x20%s',_0x5b9ccd,_0x36005e);_0x14aa69(_0x36005e);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 9d04c7d..5a0386f 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3e6c19,_0x4935db){var _0x54d81=function(_0x3a9f87){while(--_0x3a9f87){_0x3e6c19['push'](_0x3e6c19['shift']());}};_0x54d81(++_0x4935db);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0xcb91[_0xe39824];return _0x4bc31e;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xde8b60,_0x50a2de){var _0x5474ff=function(_0x206004){while(--_0x206004){_0xde8b60['push'](_0xde8b60['shift']());}};_0x5474ff(++_0x50a2de);}(_0xe706,0xa3));var _0x6e70=function(_0x466aeb,_0x3a35bf){_0x466aeb=_0x466aeb-0x0;var _0x57818e=_0xe706[_0x466aeb];return _0x57818e;};'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 d53ca79..ae92735 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 _0xd239=['BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x4f2c4e,_0x2471e3){var _0x4b8579=function(_0xaa27c6){while(--_0xaa27c6){_0x4f2c4e['push'](_0x4f2c4e['shift']());}};_0x4b8579(++_0x2471e3);}(_0xd239,0x92));var _0x9d23=function(_0x35de2d,_0x34422e){_0x35de2d=_0x35de2d-0x0;var _0xa6843d=_0xd239[_0x35de2d];return _0xa6843d;};'use strict';var Sequelize=require(_0x9d23('0x0'));module[_0x9d23('0x1')]={'name':{'type':Sequelize[_0x9d23('0x2')],'allowNull':![],'unique':_0x9d23('0x3')},'version':{'type':Sequelize[_0x9d23('0x2')],'allowNull':![],'unique':_0x9d23('0x3')},'main':{'type':Sequelize[_0x9d23('0x2')],'defaultValue':_0x9d23('0x4')},'filename':{'type':Sequelize[_0x9d23('0x2')]},'path':{'type':Sequelize[_0x9d23('0x2')]},'type':{'type':Sequelize[_0x9d23('0x2')]},'size':{'type':Sequelize[_0x9d23('0x5')]},'active':{'type':Sequelize[_0x9d23('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x9d23('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0x9d23('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x9d23('0x2')]},'remoteUri':{'type':Sequelize[_0x9d23('0x2')]},'link':{'type':Sequelize[_0x9d23('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x88c8=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','app.js'];(function(_0x45ec0b,_0x260c5d){var _0x99a3d8=function(_0x524391){while(--_0x524391){_0x45ec0b['push'](_0x45ec0b['shift']());}};_0x99a3d8(++_0x260c5d);}(_0x88c8,0x7a));var _0x888c=function(_0x1edab8,_0x3e9cc9){_0x1edab8=_0x1edab8-0x0;var _0x370d90=_0x88c8[_0x1edab8];return _0x370d90;};'use strict';var Sequelize=require(_0x888c('0x0'));module[_0x888c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x888c('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':_0x888c('0x3')},'filename':{'type':Sequelize[_0x888c('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x888c('0x2')]},'size':{'type':Sequelize[_0x888c('0x4')]},'active':{'type':Sequelize[_0x888c('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x888c('0x2')]},'logo':{'type':Sequelize[_0x888c('0x2')]},'state':{'type':Sequelize[_0x888c('0x2')],'unique':_0x888c('0x6')},'description':{'type':Sequelize[_0x888c('0x2')]},'title':{'type':Sequelize[_0x888c('0x2')]},'remoteUri':{'type':Sequelize[_0x888c('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 96ceeae..f0cea1c 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 _0x7096=['offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','Integration','find','catch','create','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x296309,_0x4ccf83){var _0x40640d=function(_0x3508fd){while(--_0x3508fd){_0x296309['push'](_0x296309['shift']());}};_0x40640d(++_0x4ccf83);}(_0x7096,0x10c));var _0x6709=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x7096[_0x433a86];return _0x23000c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6709('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6709('0x1'));var rp=require('request-promise');var moment=require(_0x6709('0x2'));var BPromise=require(_0x6709('0x3'));var Mustache=require(_0x6709('0x4'));var util=require(_0x6709('0x5'));var path=require(_0x6709('0x6'));var sox=require(_0x6709('0x7'));var csv=require(_0x6709('0x8'));var ejs=require(_0x6709('0x9'));var fs=require('fs');var fs_extra=require(_0x6709('0xa'));var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var licenseUtil=require(_0x6709('0x18'));var db=require(_0x6709('0x19'))['db'];function respondWithStatusCode(_0x288f51,_0x1d56a5){_0x1d56a5=_0x1d56a5||0xcc;return function(_0x1ac547){if(_0x1ac547){return _0x288f51['sendStatus'](_0x1d56a5);}return _0x288f51[_0x6709('0x1a')](_0x1d56a5)[_0x6709('0x1b')]();};}function respondWithResult(_0x4d5255,_0x3706e1){_0x3706e1=_0x3706e1||0xc8;return function(_0x4e4587){if(_0x4e4587){return _0x4d5255[_0x6709('0x1a')](_0x3706e1)['json'](_0x4e4587);}};}function respondWithFilteredResult(_0x41af1f,_0x4bc059){return function(_0x149233){if(_0x149233){var _0x28866a=typeof _0x4bc059[_0x6709('0x1c')]===_0x6709('0x1d')&&typeof _0x4bc059['limit']==='undefined';var _0x5c4f94=_0x149233[_0x6709('0x1e')];var _0x235a54=_0x28866a?0x0:_0x4bc059['offset'];var _0x9c1fd8=_0x28866a?_0x149233[_0x6709('0x1e')]:_0x4bc059[_0x6709('0x1c')]+_0x4bc059['limit'];var _0x13cf04;if(_0x9c1fd8>=_0x5c4f94){_0x9c1fd8=_0x5c4f94;_0x13cf04=0xc8;}else{_0x13cf04=0xce;}_0x41af1f[_0x6709('0x1a')](_0x13cf04);return _0x41af1f[_0x6709('0x1f')](_0x6709('0x20'),_0x235a54+'-'+_0x9c1fd8+'/'+_0x5c4f94)['json'](_0x149233);}return null;};}function patchUpdates(_0x3c4971){return function(_0x1edac3){try{jsonpatch[_0x6709('0x21')](_0x1edac3,_0x3c4971,!![]);}catch(_0x3cf882){return BPromise[_0x6709('0x22')](_0x3cf882);}return _0x1edac3[_0x6709('0x23')]();};}function saveUpdates(_0x45921e,_0x17763d){return function(_0x386224){if(_0x386224){return _0x386224[_0x6709('0x24')](_0x45921e)[_0x6709('0x25')](function(_0xa36371){return _0xa36371;});}return null;};}function removeEntity(_0x5cf48b,_0x29f25f){return function(_0x81138e){if(_0x81138e){return _0x81138e[_0x6709('0x26')]()['then'](function(){_0x5cf48b[_0x6709('0x1a')](0xcc)[_0x6709('0x1b')]();});}};}function handleEntityNotFound(_0x20a347,_0x44b465){return function(_0x588e00){if(!_0x588e00){_0x20a347[_0x6709('0x27')](0x194);}return _0x588e00;};}function handleError(_0x3076fe,_0x50f7d6){_0x50f7d6=_0x50f7d6||0x1f4;return function(_0x585073){logger[_0x6709('0x28')](_0x585073['stack']);if(_0x585073[_0x6709('0x29')]){delete _0x585073[_0x6709('0x29')];}_0x3076fe['status'](_0x50f7d6)[_0x6709('0x2a')](_0x585073);};}exports['index']=function(_0x46a325,_0x3cd555){var _0x5b6906={},_0x137137={},_0x4e6989={'count':0x0,'rows':[]};var _0xe066d8=_[_0x6709('0x2b')](db['Integration'][_0x6709('0x2c')],function(_0x5deff5){return{'name':_0x5deff5[_0x6709('0x2d')],'type':_0x5deff5[_0x6709('0x2e')]['key']};});_0x137137['model']=_[_0x6709('0x2b')](_0xe066d8,_0x6709('0x29'));_0x137137[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x46a325[_0x6709('0x2f')]);_0x137137[_0x6709('0x31')]=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],_0x137137[_0x6709('0x2f')]);_0x5b6906['attributes']=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],qs[_0x6709('0x34')](_0x46a325[_0x6709('0x2f')]['fields']));_0x5b6906[_0x6709('0x35')]=_0x5b6906[_0x6709('0x35')][_0x6709('0x36')]?_0x5b6906[_0x6709('0x35')]:_0x137137['model'];if(!_0x46a325[_0x6709('0x2f')][_0x6709('0x37')]('nolimit')){_0x5b6906[_0x6709('0x38')]=qs[_0x6709('0x38')](_0x46a325['query'][_0x6709('0x38')]);_0x5b6906[_0x6709('0x1c')]=qs[_0x6709('0x1c')](_0x46a325[_0x6709('0x2f')][_0x6709('0x1c')]);}_0x5b6906[_0x6709('0x39')]=qs[_0x6709('0x3a')](_0x46a325['query'][_0x6709('0x3a')]);_0x5b6906[_0x6709('0x3b')]=qs['filters'](_[_0x6709('0x3c')](_0x46a325[_0x6709('0x2f')],_0x137137[_0x6709('0x31')]),_0xe066d8);if(_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]){_0x5b6906[_0x6709('0x3b')]=_['merge'](_0x5b6906[_0x6709('0x3b')],{'$or':_['map'](_0xe066d8,function(_0x31e05a){if(_0x31e05a[_0x6709('0x2e')]!==_0x6709('0x3e')){var _0x48492f={};_0x48492f[_0x31e05a[_0x6709('0x29')]]={'$like':'%'+_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]+'%'};return _0x48492f;}})});}_0x5b6906=_[_0x6709('0x3f')]({},_0x5b6906,_0x46a325[_0x6709('0x40')]);var _0x1030ee={'where':_0x5b6906[_0x6709('0x3b')]};return db['Integration'][_0x6709('0x1e')](_0x1030ee)[_0x6709('0x25')](function(_0x50fbcd){_0x4e6989[_0x6709('0x1e')]=_0x50fbcd;if(_0x46a325[_0x6709('0x2f')][_0x6709('0x41')]){_0x5b6906[_0x6709('0x42')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x5b6906);})[_0x6709('0x25')](function(_0x3f0da1){_0x4e6989[_0x6709('0x43')]=_0x3f0da1;return _0x4e6989;})[_0x6709('0x25')](respondWithFilteredResult(_0x3cd555,_0x5b6906))['catch'](handleError(_0x3cd555,null));};exports['show']=function(_0x5af1fb,_0x3d4237){var _0x293577={'raw':![],'where':{'id':_0x5af1fb[_0x6709('0x44')]['id']}},_0x54f74e={};_0x54f74e[_0x6709('0x33')]=_['keys'](db['Integration'][_0x6709('0x2c')]);_0x54f74e[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x5af1fb[_0x6709('0x2f')]);_0x54f74e[_0x6709('0x31')]=_['intersection'](_0x54f74e[_0x6709('0x33')],_0x54f74e['query']);_0x293577[_0x6709('0x35')]=_[_0x6709('0x32')](_0x54f74e[_0x6709('0x33')],qs['fields'](_0x5af1fb[_0x6709('0x2f')]['fields']));_0x293577['attributes']=_0x293577[_0x6709('0x35')][_0x6709('0x36')]?_0x293577[_0x6709('0x35')]:_0x54f74e[_0x6709('0x33')];if(_0x5af1fb[_0x6709('0x2f')][_0x6709('0x41')]){_0x293577[_0x6709('0x42')]=[{'all':!![]}];}_0x293577=_[_0x6709('0x3f')]({},_0x293577,_0x5af1fb[_0x6709('0x40')]);return db[_0x6709('0x45')][_0x6709('0x46')](_0x293577)[_0x6709('0x25')](handleEntityNotFound(_0x3d4237,null))[_0x6709('0x25')](respondWithResult(_0x3d4237,null))[_0x6709('0x47')](handleError(_0x3d4237,null));};exports[_0x6709('0x48')]=function(_0x4f82a0,_0xfbb810){return db['Integration']['create'](_0x4f82a0[_0x6709('0x49')],{})[_0x6709('0x25')](respondWithResult(_0xfbb810,0xc9))[_0x6709('0x47')](handleError(_0xfbb810,null));};exports[_0x6709('0x24')]=function(_0x22363b,_0x2b05dc){if(_0x22363b[_0x6709('0x49')]['id']){delete _0x22363b[_0x6709('0x49')]['id'];}return db['Integration'][_0x6709('0x46')]({'where':{'id':_0x22363b[_0x6709('0x44')]['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2b05dc,null))[_0x6709('0x25')](saveUpdates(_0x22363b['body'],null))[_0x6709('0x25')](respondWithResult(_0x2b05dc,null))['catch'](handleError(_0x2b05dc,null));};exports[_0x6709('0x26')]=function(_0x34a950,_0x2a563b){return db[_0x6709('0x45')][_0x6709('0x46')]({'where':{'id':_0x34a950['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2a563b,null))[_0x6709('0x25')](removeEntity(_0x2a563b,null))[_0x6709('0x47')](handleError(_0x2a563b,null));}; \ No newline at end of file +var _0xc4aa=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Integration','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')](_0x5a7f6e['body'],{})['then'](respondWithResult(_0x244950,0xc9))[_0xac4a('0x44')](handleError(_0x244950,null));};exports['update']=function(_0x18ae96,_0x566258){if(_0x18ae96[_0xac4a('0x4a')]['id']){delete _0x18ae96['body']['id'];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'id':_0x18ae96[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x566258,null))['then'](saveUpdates(_0x18ae96[_0xac4a('0x4a')],null))[_0xac4a('0x24')](respondWithResult(_0x566258,null))[_0xac4a('0x44')](handleError(_0x566258,null));};exports[_0xac4a('0x25')]=function(_0x2f30e2,_0x138876){return db[_0xac4a('0x2c')]['find']({'where':{'id':_0x2f30e2[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x138876,null))['then'](removeEntity(_0x138876,null))[_0xac4a('0x44')](handleError(_0x138876,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 75a0989..d44fb7c 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 _0x35ac=['../../config/logger','request-promise','path','rimraf','./integration.attributes','exports','integrations','lodash','util'];(function(_0x5480cb,_0x5c7f48){var _0x2b9476=function(_0x53e82b){while(--_0x53e82b){_0x5480cb['push'](_0x5480cb['shift']());}};_0x2b9476(++_0x5c7f48);}(_0x35ac,0xc4));var _0xc35a=function(_0x1c42fa,_0x2c4722){_0x1c42fa=_0x1c42fa-0x0;var _0x3a4376=_0x35ac[_0x1c42fa];return _0x3a4376;};'use strict';var _=require(_0xc35a('0x0'));var util=require(_0xc35a('0x1'));var logger=require(_0xc35a('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc35a('0x3'));var fs=require('fs');var path=require(_0xc35a('0x4'));var rimraf=require(_0xc35a('0x5'));var config=require('../../config/environment');var attributes=require(_0xc35a('0x6'));module[_0xc35a('0x7')]=function(_0x377500,_0x5d29df){return _0x377500['define']('Integration',attributes,{'tableName':_0xc35a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f3f=['api','moment','path','rimraf','exports','define','integrations','lodash','util','../../config/logger'];(function(_0x1db251,_0xf0443d){var _0x56685a=function(_0x6ec6b7){while(--_0x6ec6b7){_0x1db251['push'](_0x1db251['shift']());}};_0x56685a(++_0xf0443d);}(_0x2f3f,0x18d));var _0xf2f3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2f3f[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xf2f3('0x0'));var util=require(_0xf2f3('0x1'));var logger=require(_0xf2f3('0x2'))(_0xf2f3('0x3'));var moment=require(_0xf2f3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2f3('0x5'));var rimraf=require(_0xf2f3('0x6'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0xf2f3('0x7')]=function(_0x4d7271,_0x119fb6){return _0x4d7271[_0xf2f3('0x8')]('Integration',attributes,{'tableName':_0xf2f3('0x9'),'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 823ac85..fa8ee67 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 _0x9f0e=['../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x16e747,_0xf73eaf){var _0x49c89f=function(_0x5482cb){while(--_0x5482cb){_0x16e747['push'](_0x16e747['shift']());}};_0x49c89f(++_0xf73eaf);}(_0x9f0e,0x116));var _0xe9f0=function(_0x41bf07,_0x281e51){_0x41bf07=_0x41bf07-0x0;var _0x1472bb=_0x9f0e[_0x41bf07];return _0x1472bb;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('Integration,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});} \ No newline at end of file +var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0x524e,0x15e));var _0xe524=function(_0x3b581f,_0x5deed9){_0x3b581f=_0x3b581f-0x0;var _0x17b7fb=_0x524e[_0x3b581f];return _0x17b7fb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('Integration,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('Integration,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('Integration,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index f99a19f..b3198ce 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 _0xda2d=['show','create','put','/:id','update','delete','util','path','connect-timeout','express','Router','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xda2d,0x102));var _0xdda2=function(_0x1c94bf,_0x307de2){_0x1c94bf=_0x1c94bf-0x0;var _0x12466b=_0xda2d[_0x1c94bf];return _0x12466b;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['post']('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x11')](_0xdda2('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x5f2f,0x73));var _0xf5f2=function(_0x755816,_0x1bbc98){_0x755816=_0x755816-0x0;var _0x499a95=_0x5f2f[_0x755816];return _0x499a95;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')]('/',auth[_0xf5f2('0xa')](),controller['create']);router[_0xf5f2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index b4a00a2..1ef381c 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 _0x4f52=['TEXT','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x4a7e82,_0x1391d0){var _0x5e6fb7=function(_0x5e3824){while(--_0x5e3824){_0x4a7e82['push'](_0x4a7e82['shift']());}};_0x5e6fb7(++_0x1391d0);}(_0x4f52,0x17b));var _0x24f5=function(_0x52ac8f,_0x38ebb2){_0x52ac8f=_0x52ac8f-0x0;var _0x9db1b6=_0x4f52[_0x52ac8f];return _0x9db1b6;};'use strict';var Sequelize=require(_0x24f5('0x0'));module[_0x24f5('0x1')]={'integration':{'type':Sequelize[_0x24f5('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x24f5('0x2')]},'ticketId':{'type':Sequelize[_0x24f5('0x2')]},'integrationId':{'type':Sequelize[_0x24f5('0x3')]},'contacts':{'type':Sequelize[_0x24f5('0x2')]},'uniqueid':{'type':Sequelize[_0x24f5('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x24f5('0x2')]},'queue':{'type':Sequelize[_0x24f5('0x2')]},'interface':{'type':Sequelize[_0x24f5('0x2')]},'membername':{'type':Sequelize[_0x24f5('0x2')]},'agentcalledAt':{'type':Sequelize[_0x24f5('0x4')]},'agentconnectAt':{'type':Sequelize[_0x24f5('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x24f5('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x24f5('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x24f5('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x24f5('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x24f5('0x4')]},'agentdump':{'type':Sequelize[_0x24f5('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x24f5('0x2')]},'channel':{'type':Sequelize[_0x24f5('0x2')]},'channelstate':{'type':Sequelize[_0x24f5('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x24f5('0x2')]},'connectedlinename':{'type':Sequelize[_0x24f5('0x2')]},'language':{'type':Sequelize[_0x24f5('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x24f5('0x2')]},'exten':{'type':Sequelize[_0x24f5('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x24f5('0x2')]},'destchannelstate':{'type':Sequelize[_0x24f5('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x24f5('0x2')]},'destcalleridnum':{'type':Sequelize[_0x24f5('0x2')]},'destcalleridname':{'type':Sequelize[_0x24f5('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x24f5('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x24f5('0x2')]},'destlanguage':{'type':Sequelize[_0x24f5('0x2')]},'destaccountcode':{'type':Sequelize[_0x24f5('0x2')]},'destcontext':{'type':Sequelize[_0x24f5('0x2')]},'destexten':{'type':Sequelize[_0x24f5('0x2')]},'destpriority':{'type':Sequelize[_0x24f5('0x2')]},'destuniqueid':{'type':Sequelize[_0x24f5('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x24f5('0x2')]},'from':{'type':Sequelize[_0x24f5('0x2')]},'to':{'type':Sequelize[_0x24f5('0x2')]},'cc':{'type':Sequelize[_0x24f5('0x2')]},'attachment':{'type':Sequelize[_0x24f5('0x6')]},'html':{'type':Sequelize[_0x24f5('0x6')]},'text':{'type':Sequelize[_0x24f5('0x6')]},'status':{'type':Sequelize['ENUM'](_0x24f5('0x7'),_0x24f5('0x8'),_0x24f5('0x9'),_0x24f5('0xa'))},'url':{'type':Sequelize[_0x24f5('0x2')]},'app':{'type':Sequelize[_0x24f5('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x24f5('0x3')]}}; \ No newline at end of file +var _0x1512=['STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','RECEIVED','FAILED','sequelize','exports'];(function(_0x5c4d0b,_0x1293a7){var _0xb61057=function(_0x50f06b){while(--_0x50f06b){_0x5c4d0b['push'](_0x5c4d0b['shift']());}};_0xb61057(++_0x1293a7);}(_0x1512,0x184));var _0x2151=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1512[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x2151('0x0'));module[_0x2151('0x1')]={'integration':{'type':Sequelize[_0x2151('0x2')]},'eventChannel':{'type':Sequelize[_0x2151('0x2')]},'exitStatus':{'type':Sequelize[_0x2151('0x2')]},'ticketId':{'type':Sequelize[_0x2151('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x2151('0x2')]},'uniqueid':{'type':Sequelize[_0x2151('0x2')]},'calleridnum':{'type':Sequelize[_0x2151('0x2')]},'calleridname':{'type':Sequelize[_0x2151('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x2151('0x2')]},'membername':{'type':Sequelize[_0x2151('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x2151('0x3')]},'holdtime':{'type':Sequelize[_0x2151('0x4')]},'agentcomplete':{'type':Sequelize[_0x2151('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x2151('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x2151('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x2151('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x2151('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x2151('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x2151('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x2151('0x4')]},'channelstatedesc':{'type':Sequelize[_0x2151('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2151('0x2')]},'accountcode':{'type':Sequelize[_0x2151('0x2')]},'context':{'type':Sequelize[_0x2151('0x2')]},'exten':{'type':Sequelize[_0x2151('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x2151('0x2')]},'destcalleridnum':{'type':Sequelize[_0x2151('0x2')]},'destcalleridname':{'type':Sequelize[_0x2151('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x2151('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x2151('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x2151('0x2')]},'destpriority':{'type':Sequelize[_0x2151('0x2')]},'destuniqueid':{'type':Sequelize[_0x2151('0x2')]},'messageId':{'type':Sequelize[_0x2151('0x2')]},'inReplyTo':{'type':Sequelize[_0x2151('0x2')]},'subject':{'type':Sequelize[_0x2151('0x2')]},'from':{'type':Sequelize[_0x2151('0x2')]},'to':{'type':Sequelize[_0x2151('0x2')]},'cc':{'type':Sequelize[_0x2151('0x2')]},'attachment':{'type':Sequelize[_0x2151('0x6')]},'html':{'type':Sequelize[_0x2151('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x2151('0x7')]('SENT','SENDING',_0x2151('0x8'),_0x2151('0x9'))},'url':{'type':Sequelize[_0x2151('0x2')]},'app':{'type':Sequelize[_0x2151('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x2151('0x4')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 65413ba..09c80c9 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 _0x7b51=['IntegrationReport','fieldName','type','key','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','offset','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index'];(function(_0x1f2dd3,_0x50f19e){var _0x2b755b=function(_0x1085a2){while(--_0x1085a2){_0x1f2dd3['push'](_0x1f2dd3['shift']());}};_0x2b755b(++_0x50f19e);}(_0x7b51,0x153));var _0x17b5=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x7b51[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x17b5('0x0'));var rimraf=require(_0x17b5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x17b5('0x2'));var rp=require(_0x17b5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x17b5('0x4'));var path=require(_0x17b5('0x5'));var sox=require(_0x17b5('0x6'));var csv=require(_0x17b5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x17b5('0x8'));var _=require(_0x17b5('0x9'));var squel=require(_0x17b5('0xa'));var crypto=require(_0x17b5('0xb'));var jsforce=require(_0x17b5('0xc'));var deskjs=require(_0x17b5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x17b5('0xe'));var Redis=require(_0x17b5('0xf'));var authService=require(_0x17b5('0x10'));var qs=require(_0x17b5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x17b5('0x12'));var utils=require(_0x17b5('0x13'));var config=require(_0x17b5('0x14'));var licenseUtil=require(_0x17b5('0x15'));var db=require(_0x17b5('0x16'))['db'];function respondWithStatusCode(_0x11dc94,_0x34dc3d){_0x34dc3d=_0x34dc3d||0xcc;return function(_0x32a4c2){if(_0x32a4c2){return _0x11dc94['sendStatus'](_0x34dc3d);}return _0x11dc94[_0x17b5('0x17')](_0x34dc3d)[_0x17b5('0x18')]();};}function respondWithResult(_0x1e4775,_0x320193){_0x320193=_0x320193||0xc8;return function(_0x1f398b){if(_0x1f398b){return _0x1e4775[_0x17b5('0x17')](_0x320193)[_0x17b5('0x19')](_0x1f398b);}};}function respondWithFilteredResult(_0x15328e,_0x311efd){return function(_0x1ee682){if(_0x1ee682){var _0x328553=typeof _0x311efd['offset']==='undefined'&&typeof _0x311efd[_0x17b5('0x1a')]===_0x17b5('0x1b');var _0x25d0ec=_0x1ee682['count'];var _0x10a29a=_0x328553?0x0:_0x311efd[_0x17b5('0x1c')];var _0xa52311=_0x328553?_0x1ee682['count']:_0x311efd[_0x17b5('0x1c')]+_0x311efd[_0x17b5('0x1a')];var _0x294915;if(_0xa52311>=_0x25d0ec){_0xa52311=_0x25d0ec;_0x294915=0xc8;}else{_0x294915=0xce;}_0x15328e[_0x17b5('0x17')](_0x294915);return _0x15328e[_0x17b5('0x1d')](_0x17b5('0x1e'),_0x10a29a+'-'+_0xa52311+'/'+_0x25d0ec)[_0x17b5('0x19')](_0x1ee682);}return null;};}function patchUpdates(_0xe3c2a1){return function(_0x404334){try{jsonpatch[_0x17b5('0x1f')](_0x404334,_0xe3c2a1,!![]);}catch(_0x334c60){return BPromise[_0x17b5('0x20')](_0x334c60);}return _0x404334['save']();};}function saveUpdates(_0xaba8a2,_0xd7d9d7){return function(_0x3e64d7){if(_0x3e64d7){return _0x3e64d7[_0x17b5('0x21')](_0xaba8a2)[_0x17b5('0x22')](function(_0x46364e){return _0x46364e;});}return null;};}function removeEntity(_0x326f40,_0x3aa3ff){return function(_0x476a19){if(_0x476a19){return _0x476a19['destroy']()[_0x17b5('0x22')](function(){_0x326f40['status'](0xcc)[_0x17b5('0x18')]();});}};}function handleEntityNotFound(_0x5ea004,_0x3e2825){return function(_0xfa2325){if(!_0xfa2325){_0x5ea004[_0x17b5('0x23')](0x194);}return _0xfa2325;};}function handleError(_0x530f02,_0x19e270){_0x19e270=_0x19e270||0x1f4;return function(_0x29177b){logger[_0x17b5('0x24')](_0x29177b[_0x17b5('0x25')]);if(_0x29177b[_0x17b5('0x26')]){delete _0x29177b['name'];}_0x530f02[_0x17b5('0x17')](_0x19e270)[_0x17b5('0x27')](_0x29177b);};}exports[_0x17b5('0x28')]=function(_0x7fbe93,_0x4ed4b5){var _0x540acd={},_0x356c76={},_0x84e37a={'count':0x0,'rows':[]};var _0x5bc3d5=_['map'](db[_0x17b5('0x29')]['rawAttributes'],function(_0x530df5){return{'name':_0x530df5[_0x17b5('0x2a')],'type':_0x530df5[_0x17b5('0x2b')][_0x17b5('0x2c')]};});_0x356c76[_0x17b5('0x2d')]=_[_0x17b5('0x2e')](_0x5bc3d5,_0x17b5('0x26'));_0x356c76['query']=_[_0x17b5('0x2f')](_0x7fbe93['query']);_0x356c76['filters']=_[_0x17b5('0x30')](_0x356c76[_0x17b5('0x2d')],_0x356c76[_0x17b5('0x31')]);_0x540acd[_0x17b5('0x32')]=_[_0x17b5('0x30')](_0x356c76[_0x17b5('0x2d')],qs[_0x17b5('0x33')](_0x7fbe93['query'][_0x17b5('0x33')]));_0x540acd[_0x17b5('0x32')]=_0x540acd[_0x17b5('0x32')][_0x17b5('0x34')]?_0x540acd[_0x17b5('0x32')]:_0x356c76[_0x17b5('0x2d')];if(!_0x7fbe93[_0x17b5('0x31')][_0x17b5('0x35')](_0x17b5('0x36'))){_0x540acd[_0x17b5('0x1a')]=qs[_0x17b5('0x1a')](_0x7fbe93[_0x17b5('0x31')][_0x17b5('0x1a')]);_0x540acd[_0x17b5('0x1c')]=qs['offset'](_0x7fbe93['query'][_0x17b5('0x1c')]);}_0x540acd['order']=qs[_0x17b5('0x37')](_0x7fbe93[_0x17b5('0x31')][_0x17b5('0x37')]);_0x540acd[_0x17b5('0x38')]=qs['filters'](_[_0x17b5('0x39')](_0x7fbe93[_0x17b5('0x31')],_0x356c76[_0x17b5('0x3a')]),_0x5bc3d5);if(_0x7fbe93[_0x17b5('0x31')][_0x17b5('0x3b')]){_0x540acd[_0x17b5('0x38')]=_['merge'](_0x540acd[_0x17b5('0x38')],{'$or':_['map'](_0x5bc3d5,function(_0x4b9458){if(_0x4b9458[_0x17b5('0x2b')]!==_0x17b5('0x3c')){var _0xbf7e6e={};_0xbf7e6e[_0x4b9458['name']]={'$like':'%'+_0x7fbe93['query'][_0x17b5('0x3b')]+'%'};return _0xbf7e6e;}})});}_0x540acd=_['merge']({},_0x540acd,_0x7fbe93[_0x17b5('0x3d')]);var _0x57b9ea={'where':_0x540acd[_0x17b5('0x38')]};return db[_0x17b5('0x29')]['count'](_0x57b9ea)['then'](function(_0x54e8f1){_0x84e37a[_0x17b5('0x3e')]=_0x54e8f1;if(_0x7fbe93[_0x17b5('0x31')][_0x17b5('0x3f')]){_0x540acd[_0x17b5('0x40')]=[{'all':!![]}];}return db[_0x17b5('0x29')][_0x17b5('0x41')](_0x540acd);})[_0x17b5('0x22')](function(_0x52be0a){_0x84e37a[_0x17b5('0x42')]=_0x52be0a;return _0x84e37a;})[_0x17b5('0x22')](respondWithFilteredResult(_0x4ed4b5,_0x540acd))[_0x17b5('0x43')](handleError(_0x4ed4b5,null));};exports[_0x17b5('0x44')]=function(_0x197cc0,_0x34160a){var _0x2006c2={'raw':![],'where':{'id':_0x197cc0[_0x17b5('0x45')]['id']}},_0x40aa1b={};_0x40aa1b[_0x17b5('0x2d')]=_[_0x17b5('0x2f')](db[_0x17b5('0x29')][_0x17b5('0x46')]);_0x40aa1b[_0x17b5('0x31')]=_[_0x17b5('0x2f')](_0x197cc0[_0x17b5('0x31')]);_0x40aa1b['filters']=_[_0x17b5('0x30')](_0x40aa1b[_0x17b5('0x2d')],_0x40aa1b[_0x17b5('0x31')]);_0x2006c2['attributes']=_[_0x17b5('0x30')](_0x40aa1b[_0x17b5('0x2d')],qs[_0x17b5('0x33')](_0x197cc0[_0x17b5('0x31')]['fields']));_0x2006c2['attributes']=_0x2006c2[_0x17b5('0x32')][_0x17b5('0x34')]?_0x2006c2['attributes']:_0x40aa1b['model'];if(_0x197cc0[_0x17b5('0x31')][_0x17b5('0x3f')]){_0x2006c2[_0x17b5('0x40')]=[{'all':!![]}];}_0x2006c2=_['merge']({},_0x2006c2,_0x197cc0[_0x17b5('0x3d')]);return db[_0x17b5('0x29')][_0x17b5('0x47')](_0x2006c2)[_0x17b5('0x22')](handleEntityNotFound(_0x34160a,null))[_0x17b5('0x22')](respondWithResult(_0x34160a,null))[_0x17b5('0x43')](handleError(_0x34160a,null));};exports[_0x17b5('0x48')]=function(_0x41311a,_0x5ed5e0){return db[_0x17b5('0x29')]['create'](_0x41311a[_0x17b5('0x49')],{})[_0x17b5('0x22')](respondWithResult(_0x5ed5e0,0xc9))[_0x17b5('0x43')](handleError(_0x5ed5e0,null));};exports[_0x17b5('0x21')]=function(_0x5ba5a6,_0x3c425e){if(_0x5ba5a6[_0x17b5('0x49')]['id']){delete _0x5ba5a6[_0x17b5('0x49')]['id'];}return db[_0x17b5('0x29')][_0x17b5('0x47')]({'where':{'id':_0x5ba5a6[_0x17b5('0x45')]['id']}})[_0x17b5('0x22')](handleEntityNotFound(_0x3c425e,null))[_0x17b5('0x22')](saveUpdates(_0x5ba5a6[_0x17b5('0x49')],null))['then'](respondWithResult(_0x3c425e,null))['catch'](handleError(_0x3c425e,null));};exports[_0x17b5('0x4a')]=function(_0xd8c79,_0x5afc2f){return db[_0x17b5('0x29')][_0x17b5('0x47')]({'where':{'id':_0xd8c79['params']['id']}})[_0x17b5('0x22')](handleEntityNotFound(_0x5afc2f,null))['then'](removeEntity(_0x5afc2f,null))[_0x17b5('0x43')](handleError(_0x5afc2f,null));};exports[_0x17b5('0x4b')]=function(_0x27ad71,_0x292ebe){return db[_0x17b5('0x29')][_0x17b5('0x4b')]()[_0x17b5('0x22')](respondWithResult(_0x292ebe,null))[_0x17b5('0x43')](handleError(_0x292ebe,null));}; \ No newline at end of file +var _0x98e5=['sort','where','pick','filter','merge','VIRTUAL','IntegrationReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','update','then','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','offset','order'];(function(_0x35d9f4,_0x34aee0){var _0x23f280=function(_0x58c586){while(--_0x58c586){_0x35d9f4['push'](_0x35d9f4['shift']());}};_0x23f280(++_0x34aee0);}(_0x98e5,0x1d1));var _0x598e=function(_0x1f9861,_0x4e2d51){_0x1f9861=_0x1f9861-0x0;var _0x624354=_0x98e5[_0x1f9861];return _0x624354;};'use strict';var emlformat=require(_0x598e('0x0'));var rimraf=require(_0x598e('0x1'));var zipdir=require(_0x598e('0x2'));var jsonpatch=require(_0x598e('0x3'));var rp=require('request-promise');var moment=require(_0x598e('0x4'));var BPromise=require(_0x598e('0x5'));var Mustache=require('mustache');var util=require(_0x598e('0x6'));var path=require(_0x598e('0x7'));var sox=require('sox');var csv=require(_0x598e('0x8'));var ejs=require(_0x598e('0x9'));var fs=require('fs');var fs_extra=require(_0x598e('0xa'));var _=require(_0x598e('0xb'));var squel=require(_0x598e('0xc'));var crypto=require(_0x598e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x598e('0xe'));var toCsv=require(_0x598e('0x8'));var querystring=require('querystring');var Papa=require(_0x598e('0xf'));var Redis=require(_0x598e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x598e('0x11'));var as=require(_0x598e('0x12'));var hardwareService=require(_0x598e('0x13'));var logger=require('../../config/logger')(_0x598e('0x14'));var utils=require(_0x598e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x598e('0x16'));var db=require(_0x598e('0x17'))['db'];function respondWithStatusCode(_0x3d62b7,_0x3617be){_0x3617be=_0x3617be||0xcc;return function(_0x59dc10){if(_0x59dc10){return _0x3d62b7[_0x598e('0x18')](_0x3617be);}return _0x3d62b7[_0x598e('0x19')](_0x3617be)[_0x598e('0x1a')]();};}function respondWithResult(_0x14e9d7,_0x4e19a6){_0x4e19a6=_0x4e19a6||0xc8;return function(_0x257ce2){if(_0x257ce2){return _0x14e9d7[_0x598e('0x19')](_0x4e19a6)[_0x598e('0x1b')](_0x257ce2);}};}function respondWithFilteredResult(_0xec9612,_0xbfdbf3){return function(_0x2ab16a){if(_0x2ab16a){var _0x3b195c=typeof _0xbfdbf3['offset']===_0x598e('0x1c')&&typeof _0xbfdbf3[_0x598e('0x1d')]===_0x598e('0x1c');var _0x313637=_0x2ab16a[_0x598e('0x1e')];var _0x3d0a32=_0x3b195c?0x0:_0xbfdbf3['offset'];var _0x47bf84=_0x3b195c?_0x2ab16a[_0x598e('0x1e')]:_0xbfdbf3['offset']+_0xbfdbf3['limit'];var _0x37b377;if(_0x47bf84>=_0x313637){_0x47bf84=_0x313637;_0x37b377=0xc8;}else{_0x37b377=0xce;}_0xec9612[_0x598e('0x19')](_0x37b377);return _0xec9612[_0x598e('0x1f')](_0x598e('0x20'),_0x3d0a32+'-'+_0x47bf84+'/'+_0x313637)[_0x598e('0x1b')](_0x2ab16a);}return null;};}function patchUpdates(_0x15e174){return function(_0x1dc0c8){try{jsonpatch['apply'](_0x1dc0c8,_0x15e174,!![]);}catch(_0x2e1604){return BPromise['reject'](_0x2e1604);}return _0x1dc0c8['save']();};}function saveUpdates(_0x4e6f59,_0x244652){return function(_0x2f8528){if(_0x2f8528){return _0x2f8528[_0x598e('0x21')](_0x4e6f59)[_0x598e('0x22')](function(_0x555a86){return _0x555a86;});}return null;};}function removeEntity(_0x2d4093,_0x33a0ca){return function(_0x5e4b79){if(_0x5e4b79){return _0x5e4b79['destroy']()[_0x598e('0x22')](function(){_0x2d4093[_0x598e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x363ee3,_0x5797dd){return function(_0x196d8f){if(!_0x196d8f){_0x363ee3['sendStatus'](0x194);}return _0x196d8f;};}function handleError(_0xa20574,_0x1bee20){_0x1bee20=_0x1bee20||0x1f4;return function(_0x49b7d6){logger[_0x598e('0x23')](_0x49b7d6[_0x598e('0x24')]);if(_0x49b7d6[_0x598e('0x25')]){delete _0x49b7d6[_0x598e('0x25')];}_0xa20574[_0x598e('0x19')](_0x1bee20)['send'](_0x49b7d6);};}exports[_0x598e('0x26')]=function(_0x55b805,_0x352f79){var _0x3e0a02={},_0x3ab0c4={},_0xe3abf7={'count':0x0,'rows':[]};var _0x1e5d53=_[_0x598e('0x27')](db['IntegrationReport']['rawAttributes'],function(_0x32df87){return{'name':_0x32df87[_0x598e('0x28')],'type':_0x32df87[_0x598e('0x29')][_0x598e('0x2a')]};});_0x3ab0c4[_0x598e('0x2b')]=_[_0x598e('0x27')](_0x1e5d53,'name');_0x3ab0c4[_0x598e('0x2c')]=_[_0x598e('0x2d')](_0x55b805[_0x598e('0x2c')]);_0x3ab0c4[_0x598e('0x2e')]=_['intersection'](_0x3ab0c4['model'],_0x3ab0c4[_0x598e('0x2c')]);_0x3e0a02[_0x598e('0x2f')]=_['intersection'](_0x3ab0c4[_0x598e('0x2b')],qs[_0x598e('0x30')](_0x55b805[_0x598e('0x2c')][_0x598e('0x30')]));_0x3e0a02['attributes']=_0x3e0a02[_0x598e('0x2f')][_0x598e('0x31')]?_0x3e0a02[_0x598e('0x2f')]:_0x3ab0c4[_0x598e('0x2b')];if(!_0x55b805[_0x598e('0x2c')][_0x598e('0x32')]('nolimit')){_0x3e0a02[_0x598e('0x1d')]=qs[_0x598e('0x1d')](_0x55b805[_0x598e('0x2c')][_0x598e('0x1d')]);_0x3e0a02['offset']=qs[_0x598e('0x33')](_0x55b805[_0x598e('0x2c')][_0x598e('0x33')]);}_0x3e0a02[_0x598e('0x34')]=qs[_0x598e('0x35')](_0x55b805[_0x598e('0x2c')][_0x598e('0x35')]);_0x3e0a02[_0x598e('0x36')]=qs[_0x598e('0x2e')](_[_0x598e('0x37')](_0x55b805[_0x598e('0x2c')],_0x3ab0c4['filters']),_0x1e5d53);if(_0x55b805[_0x598e('0x2c')][_0x598e('0x38')]){_0x3e0a02['where']=_[_0x598e('0x39')](_0x3e0a02[_0x598e('0x36')],{'$or':_[_0x598e('0x27')](_0x1e5d53,function(_0x1afac2){if(_0x1afac2[_0x598e('0x29')]!==_0x598e('0x3a')){var _0xa3c96c={};_0xa3c96c[_0x1afac2[_0x598e('0x25')]]={'$like':'%'+_0x55b805[_0x598e('0x2c')]['filter']+'%'};return _0xa3c96c;}})});}_0x3e0a02=_[_0x598e('0x39')]({},_0x3e0a02,_0x55b805['options']);var _0x15b5c4={'where':_0x3e0a02[_0x598e('0x36')]};return db[_0x598e('0x3b')][_0x598e('0x1e')](_0x15b5c4)[_0x598e('0x22')](function(_0x387650){_0xe3abf7[_0x598e('0x1e')]=_0x387650;if(_0x55b805[_0x598e('0x2c')][_0x598e('0x3c')]){_0x3e0a02[_0x598e('0x3d')]=[{'all':!![]}];}return db[_0x598e('0x3b')][_0x598e('0x3e')](_0x3e0a02);})[_0x598e('0x22')](function(_0x51ecdc){_0xe3abf7[_0x598e('0x3f')]=_0x51ecdc;return _0xe3abf7;})['then'](respondWithFilteredResult(_0x352f79,_0x3e0a02))[_0x598e('0x40')](handleError(_0x352f79,null));};exports[_0x598e('0x41')]=function(_0x2b080b,_0x247a61){var _0x1db06f={'raw':![],'where':{'id':_0x2b080b[_0x598e('0x42')]['id']}},_0x3e543c={};_0x3e543c[_0x598e('0x2b')]=_[_0x598e('0x2d')](db[_0x598e('0x3b')][_0x598e('0x43')]);_0x3e543c[_0x598e('0x2c')]=_[_0x598e('0x2d')](_0x2b080b[_0x598e('0x2c')]);_0x3e543c[_0x598e('0x2e')]=_[_0x598e('0x44')](_0x3e543c[_0x598e('0x2b')],_0x3e543c[_0x598e('0x2c')]);_0x1db06f[_0x598e('0x2f')]=_[_0x598e('0x44')](_0x3e543c[_0x598e('0x2b')],qs[_0x598e('0x30')](_0x2b080b['query'][_0x598e('0x30')]));_0x1db06f[_0x598e('0x2f')]=_0x1db06f['attributes']['length']?_0x1db06f[_0x598e('0x2f')]:_0x3e543c['model'];if(_0x2b080b['query'][_0x598e('0x3c')]){_0x1db06f[_0x598e('0x3d')]=[{'all':!![]}];}_0x1db06f=_['merge']({},_0x1db06f,_0x2b080b[_0x598e('0x45')]);return db[_0x598e('0x3b')][_0x598e('0x46')](_0x1db06f)[_0x598e('0x22')](handleEntityNotFound(_0x247a61,null))[_0x598e('0x22')](respondWithResult(_0x247a61,null))[_0x598e('0x40')](handleError(_0x247a61,null));};exports[_0x598e('0x47')]=function(_0x47bb70,_0x58d7fc){return db[_0x598e('0x3b')][_0x598e('0x47')](_0x47bb70[_0x598e('0x48')],{})[_0x598e('0x22')](respondWithResult(_0x58d7fc,0xc9))[_0x598e('0x40')](handleError(_0x58d7fc,null));};exports[_0x598e('0x21')]=function(_0x31fa3b,_0x3d2a34){if(_0x31fa3b['body']['id']){delete _0x31fa3b[_0x598e('0x48')]['id'];}return db['IntegrationReport'][_0x598e('0x46')]({'where':{'id':_0x31fa3b['params']['id']}})[_0x598e('0x22')](handleEntityNotFound(_0x3d2a34,null))[_0x598e('0x22')](saveUpdates(_0x31fa3b[_0x598e('0x48')],null))[_0x598e('0x22')](respondWithResult(_0x3d2a34,null))[_0x598e('0x40')](handleError(_0x3d2a34,null));};exports['destroy']=function(_0x3de2b7,_0x2fdcb0){return db[_0x598e('0x3b')][_0x598e('0x46')]({'where':{'id':_0x3de2b7[_0x598e('0x42')]['id']}})[_0x598e('0x22')](handleEntityNotFound(_0x2fdcb0,null))[_0x598e('0x22')](removeEntity(_0x2fdcb0,null))[_0x598e('0x40')](handleError(_0x2fdcb0,null));};exports[_0x598e('0x49')]=function(_0x594a2f,_0x52ff52){return db[_0x598e('0x3b')][_0x598e('0x49')]()[_0x598e('0x22')](respondWithResult(_0x52ff52,null))[_0x598e('0x40')](handleError(_0x52ff52,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 9e425a9..3c848aa 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 _0x3c4a=['rimraf','../../config/environment','./integrationReport.attributes','IntegrationReport','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x5b568b,_0xc044e6){var _0x178944=function(_0x20d8d7){while(--_0x20d8d7){_0x5b568b['push'](_0x5b568b['shift']());}};_0x178944(++_0xc044e6);}(_0x3c4a,0x112));var _0xa3c4=function(_0x3104bb,_0x87275){_0x3104bb=_0x3104bb-0x0;var _0x40e6d5=_0x3c4a[_0x3104bb];return _0x40e6d5;};'use strict';var _=require(_0xa3c4('0x0'));var util=require(_0xa3c4('0x1'));var logger=require(_0xa3c4('0x2'))('api');var moment=require(_0xa3c4('0x3'));var BPromise=require('bluebird');var rp=require(_0xa3c4('0x4'));var fs=require('fs');var path=require(_0xa3c4('0x5'));var rimraf=require(_0xa3c4('0x6'));var config=require(_0xa3c4('0x7'));var attributes=require(_0xa3c4('0x8'));module['exports']=function(_0x3bd47c,_0x16d558){return _0x3bd47c['define'](_0xa3c4('0x9'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58d3=['path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','report_integration','util','../../config/logger','api','moment','request-promise'];(function(_0x3f68fe,_0x33c86e){var _0x243c1f=function(_0x530d32){while(--_0x530d32){_0x3f68fe['push'](_0x3f68fe['shift']());}};_0x243c1f(++_0x33c86e);}(_0x58d3,0xd3));var _0x358d=function(_0x236f97,_0x218bfd){_0x236f97=_0x236f97-0x0;var _0x3dbdf1=_0x58d3[_0x236f97];return _0x3dbdf1;};'use strict';var _=require('lodash');var util=require(_0x358d('0x0'));var logger=require(_0x358d('0x1'))(_0x358d('0x2'));var moment=require(_0x358d('0x3'));var BPromise=require('bluebird');var rp=require(_0x358d('0x4'));var fs=require('fs');var path=require(_0x358d('0x5'));var rimraf=require(_0x358d('0x6'));var config=require(_0x358d('0x7'));var attributes=require(_0x358d('0x8'));module[_0x358d('0x9')]=function(_0x36c092,_0x3a1a86){return _0x36c092[_0x358d('0xa')]('IntegrationReport',attributes,{'tableName':_0x358d('0xb'),'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 a47c6ed..0d9c4d6 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1967=['then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1967,0x173));var _0x7196=function(_0x2e4beb,_0x5ba673){_0x2e4beb=_0x2e4beb-0x0;var _0x5dd4d6=_0x1967[_0x2e4beb];return _0x5dd4d6;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','IntegrationReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x47b1a9,_0x14e74f){var _0x1be6e2=function(_0x8c39be){while(--_0x8c39be){_0x47b1a9['push'](_0x47b1a9['shift']());}};_0x1be6e2(++_0x14e74f);}(_0x5fab,0x177));var _0xb5fa=function(_0x3831ef,_0x58fea6){_0x3831ef=_0x3831ef-0x0;var _0x32c7c6=_0x5fab[_0x3831ef];return _0x32c7c6;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 0b3bfe9..065d5d5 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 _0xb30f=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','post','create','addInterval','put','/:id','update','delete'];(function(_0x1ad36e,_0x67abb){var _0x2cc4e9=function(_0x23e205){while(--_0x23e205){_0x1ad36e['push'](_0x1ad36e['shift']());}};_0x2cc4e9(++_0x67abb);}(_0xb30f,0x109));var _0xfb30=function(_0x1e1ec4,_0x481bc3){_0x1e1ec4=_0x1e1ec4-0x0;var _0x411b0a=_0xb30f[_0x1e1ec4];return _0x411b0a;};'use strict';var multer=require(_0xfb30('0x0'));var util=require(_0xfb30('0x1'));var path=require(_0xfb30('0x2'));var timeout=require(_0xfb30('0x3'));var express=require(_0xfb30('0x4'));var router=express['Router']();var fs_extra=require(_0xfb30('0x5'));var auth=require(_0xfb30('0x6'));var interaction=require(_0xfb30('0x7'));var config=require('../../config/environment');var controller=require(_0xfb30('0x8'));router[_0xfb30('0x9')]('/',auth[_0xfb30('0xa')](),controller[_0xfb30('0xb')]);router[_0xfb30('0x9')]('/:id',auth[_0xfb30('0xa')](),controller[_0xfb30('0xc')]);router[_0xfb30('0x9')](_0xfb30('0xd'),auth[_0xfb30('0xa')](),controller['getIntervals']);router[_0xfb30('0xe')]('/',auth[_0xfb30('0xa')](),controller[_0xfb30('0xf')]);router[_0xfb30('0xe')](_0xfb30('0xd'),auth[_0xfb30('0xa')](),controller[_0xfb30('0x10')]);router[_0xfb30('0xe')]('/:id/sub_intervals/create_many',auth[_0xfb30('0xa')](),controller['addIntervals']);router[_0xfb30('0x11')](_0xfb30('0x12'),auth[_0xfb30('0xa')](),controller[_0xfb30('0x13')]);router[_0xfb30('0x14')](_0xfb30('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0xfb30('0x15')]=router; \ No newline at end of file +var _0xbd18=['addInterval','put','update','delete','destroy','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/sub_intervals','getIntervals','post','create'];(function(_0xe99d07,_0x3b0755){var _0x30bb02=function(_0x5bd633){while(--_0x5bd633){_0xe99d07['push'](_0xe99d07['shift']());}};_0x30bb02(++_0x3b0755);}(_0xbd18,0x195));var _0x8bd1=function(_0x19896b,_0x4f2d5b){_0x19896b=_0x19896b-0x0;var _0x11287f=_0xbd18[_0x19896b];return _0x11287f;};'use strict';var multer=require(_0x8bd1('0x0'));var util=require(_0x8bd1('0x1'));var path=require(_0x8bd1('0x2'));var timeout=require('connect-timeout');var express=require(_0x8bd1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8bd1('0x4'));var config=require(_0x8bd1('0x5'));var controller=require('./interval.controller');router['get']('/',auth[_0x8bd1('0x6')](),controller[_0x8bd1('0x7')]);router[_0x8bd1('0x8')](_0x8bd1('0x9'),auth['isAuthenticated'](),controller[_0x8bd1('0xa')]);router[_0x8bd1('0x8')](_0x8bd1('0xb'),auth['isAuthenticated'](),controller[_0x8bd1('0xc')]);router[_0x8bd1('0xd')]('/',auth[_0x8bd1('0x6')](),controller[_0x8bd1('0xe')]);router['post'](_0x8bd1('0xb'),auth['isAuthenticated'](),controller[_0x8bd1('0xf')]);router[_0x8bd1('0xd')]('/:id/sub_intervals/create_many',auth[_0x8bd1('0x6')](),controller['addIntervals']);router[_0x8bd1('0x10')](_0x8bd1('0x9'),auth[_0x8bd1('0x6')](),controller[_0x8bd1('0x11')]);router[_0x8bd1('0x12')](_0x8bd1('0x9'),auth[_0x8bd1('0x6')](),controller[_0x8bd1('0x13')]);module[_0x8bd1('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 01b5ef0..842f50a 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 _0xc9b1=['STRING','sequelize','exports'];(function(_0x123239,_0x23d35a){var _0x5a6042=function(_0x13a52e){while(--_0x13a52e){_0x123239['push'](_0x123239['shift']());}};_0x5a6042(++_0x23d35a);}(_0xc9b1,0x1ab));var _0x1c9b=function(_0x52dd2c,_0x4e3434){_0x52dd2c=_0x52dd2c-0x0;var _0x4ada74=_0xc9b1[_0x52dd2c];return _0x4ada74;};'use strict';var Sequelize=require(_0x1c9b('0x0'));module[_0x1c9b('0x1')]={'name':{'type':Sequelize[_0x1c9b('0x2')]},'description':{'type':Sequelize[_0x1c9b('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x6f0f=['STRING','sequelize'];(function(_0x39fdc3,_0xb45dd0){var _0x1a944b=function(_0x1d7549){while(--_0x1d7549){_0x39fdc3['push'](_0x39fdc3['shift']());}};_0x1a944b(++_0xb45dd0);}(_0x6f0f,0x11f));var _0xf6f0=function(_0x5f3f60,_0x5623b3){_0x5f3f60=_0x5f3f60-0x0;var _0x3f0e96=_0x6f0f[_0x5f3f60];return _0x3f0e96;};'use strict';var Sequelize=require(_0xf6f0('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf6f0('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 612b97c..74bc8ed 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 _0xd9f3=['IntervalId','getIntervals','findOne','order','options','addIntervals','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','count','set','reject','save','then','destroy','get','Intervals','UserProfileResource','end','error','stack','name','send','index','map','Interval','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','merge','VIRTUAL','where','includeAll','findAll','rows','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addInterval'];(function(_0x1549a3,_0x5c3777){var _0x5a820f=function(_0xa29210){while(--_0xa29210){_0x1549a3['push'](_0x1549a3['shift']());}};_0x5a820f(++_0x5c3777);}(_0xd9f3,0x64));var _0x3d9f=function(_0x559d92,_0x53dd86){_0x559d92=_0x559d92-0x0;var _0x54cf41=_0xd9f3[_0x559d92];return _0x54cf41;};'use strict';var emlformat=require(_0x3d9f('0x0'));var rimraf=require(_0x3d9f('0x1'));var zipdir=require(_0x3d9f('0x2'));var jsonpatch=require(_0x3d9f('0x3'));var rp=require('request-promise');var moment=require(_0x3d9f('0x4'));var BPromise=require(_0x3d9f('0x5'));var Mustache=require('mustache');var util=require(_0x3d9f('0x6'));var path=require(_0x3d9f('0x7'));var sox=require('sox');var csv=require(_0x3d9f('0x8'));var ejs=require(_0x3d9f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d9f('0xa'));var squel=require(_0x3d9f('0xb'));var crypto=require(_0x3d9f('0xc'));var jsforce=require(_0x3d9f('0xd'));var deskjs=require(_0x3d9f('0xe'));var toCsv=require(_0x3d9f('0x8'));var querystring=require('querystring');var Papa=require(_0x3d9f('0xf'));var Redis=require(_0x3d9f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3d9f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3d9f('0x12'));var utils=require(_0x3d9f('0x13'));var config=require(_0x3d9f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d9f('0x15'))['db'];var extensions=require(_0x3d9f('0x16'));function respondWithStatusCode(_0xb66f2c,_0x249af7){_0x249af7=_0x249af7||0xcc;return function(_0xff6b7f){if(_0xff6b7f){return _0xb66f2c[_0x3d9f('0x17')](_0x249af7);}return _0xb66f2c[_0x3d9f('0x18')](_0x249af7)['end']();};}function respondWithResult(_0x26c8f9,_0x81d696){_0x81d696=_0x81d696||0xc8;return function(_0x2ce2d3){if(_0x2ce2d3){return _0x26c8f9[_0x3d9f('0x18')](_0x81d696)[_0x3d9f('0x19')](_0x2ce2d3);}};}function respondWithFilteredResult(_0x33258b,_0x2b9f68){return function(_0x1e46f7){if(_0x1e46f7){var _0x1a5c3f=typeof _0x2b9f68[_0x3d9f('0x1a')]===_0x3d9f('0x1b')&&typeof _0x2b9f68['limit']===_0x3d9f('0x1b');var _0x2ccbc9=_0x1e46f7[_0x3d9f('0x1c')];var _0xe6640=_0x1a5c3f?0x0:_0x2b9f68[_0x3d9f('0x1a')];var _0x333163=_0x1a5c3f?_0x1e46f7[_0x3d9f('0x1c')]:_0x2b9f68[_0x3d9f('0x1a')]+_0x2b9f68['limit'];var _0x51bbb4;if(_0x333163>=_0x2ccbc9){_0x333163=_0x2ccbc9;_0x51bbb4=0xc8;}else{_0x51bbb4=0xce;}_0x33258b[_0x3d9f('0x18')](_0x51bbb4);return _0x33258b[_0x3d9f('0x1d')]('Content-Range',_0xe6640+'-'+_0x333163+'/'+_0x2ccbc9)[_0x3d9f('0x19')](_0x1e46f7);}return null;};}function patchUpdates(_0x1d8030){return function(_0x3c6620){try{jsonpatch['apply'](_0x3c6620,_0x1d8030,!![]);}catch(_0x4846ff){return BPromise[_0x3d9f('0x1e')](_0x4846ff);}return _0x3c6620[_0x3d9f('0x1f')]();};}function saveUpdates(_0x3c5325,_0x217cf1){return function(_0xc8fb8){if(_0xc8fb8){return _0xc8fb8['update'](_0x3c5325)[_0x3d9f('0x20')](function(_0x4b3d4b){return _0x4b3d4b;});}return null;};}function removeEntity(_0x2b8ed7,_0x3d80af){return function(_0x21bf89){if(_0x21bf89){return _0x21bf89[_0x3d9f('0x21')]()['then'](function(){var _0xf114b9=_0x21bf89[_0x3d9f('0x22')]({'plain':!![]});var _0x46fc38=_0x3d9f('0x23');return db[_0x3d9f('0x24')][_0x3d9f('0x21')]({'where':{'type':_0x46fc38,'resourceId':_0xf114b9['id']}})[_0x3d9f('0x20')](function(){return _0x21bf89;});})['then'](function(){_0x2b8ed7[_0x3d9f('0x18')](0xcc)[_0x3d9f('0x25')]();});}};}function handleEntityNotFound(_0x189fb7,_0x3be197){return function(_0x270265){if(!_0x270265){_0x189fb7[_0x3d9f('0x17')](0x194);}return _0x270265;};}function handleError(_0x16750a,_0x47105c){_0x47105c=_0x47105c||0x1f4;return function(_0x3ddb12){logger[_0x3d9f('0x26')](_0x3ddb12[_0x3d9f('0x27')]);if(_0x3ddb12['name']){delete _0x3ddb12[_0x3d9f('0x28')];}_0x16750a[_0x3d9f('0x18')](_0x47105c)[_0x3d9f('0x29')](_0x3ddb12);};}exports[_0x3d9f('0x2a')]=function(_0x5ef931,_0x413e88){var _0x396415={},_0x4bf0d1={},_0x1be805={'count':0x0,'rows':[]};var _0x58088e=_[_0x3d9f('0x2b')](db[_0x3d9f('0x2c')][_0x3d9f('0x2d')],function(_0x38bc75){return{'name':_0x38bc75['fieldName'],'type':_0x38bc75[_0x3d9f('0x2e')][_0x3d9f('0x2f')]};});_0x4bf0d1[_0x3d9f('0x30')]=_['map'](_0x58088e,_0x3d9f('0x28'));_0x4bf0d1['query']=_[_0x3d9f('0x31')](_0x5ef931[_0x3d9f('0x32')]);_0x4bf0d1['filters']=_[_0x3d9f('0x33')](_0x4bf0d1[_0x3d9f('0x30')],_0x4bf0d1[_0x3d9f('0x32')]);_0x396415[_0x3d9f('0x34')]=_[_0x3d9f('0x33')](_0x4bf0d1['model'],qs[_0x3d9f('0x35')](_0x5ef931['query']['fields']));_0x396415[_0x3d9f('0x34')]=_0x396415[_0x3d9f('0x34')][_0x3d9f('0x36')]?_0x396415['attributes']:_0x4bf0d1[_0x3d9f('0x30')];if(!_0x5ef931[_0x3d9f('0x32')][_0x3d9f('0x37')](_0x3d9f('0x38'))){_0x396415[_0x3d9f('0x39')]=qs[_0x3d9f('0x39')](_0x5ef931[_0x3d9f('0x32')]['limit']);_0x396415[_0x3d9f('0x1a')]=qs['offset'](_0x5ef931[_0x3d9f('0x32')][_0x3d9f('0x1a')]);}_0x396415['order']=qs[_0x3d9f('0x3a')](_0x5ef931[_0x3d9f('0x32')][_0x3d9f('0x3a')]);_0x396415['where']=qs[_0x3d9f('0x3b')](_[_0x3d9f('0x3c')](_0x5ef931['query'],_0x4bf0d1[_0x3d9f('0x3b')]),_0x58088e);if(_0x5ef931[_0x3d9f('0x32')][_0x3d9f('0x3d')]){_0x396415['where']=_[_0x3d9f('0x3e')](_0x396415['where'],{'$or':_[_0x3d9f('0x2b')](_0x58088e,function(_0x34e829){if(_0x34e829[_0x3d9f('0x2e')]!==_0x3d9f('0x3f')){var _0x37c5b2={};_0x37c5b2[_0x34e829[_0x3d9f('0x28')]]={'$like':'%'+_0x5ef931[_0x3d9f('0x32')]['filter']+'%'};return _0x37c5b2;}})});}_0x396415=_['merge']({},_0x396415,_0x5ef931['options']);var _0x17950d={'where':_0x396415[_0x3d9f('0x40')]};return db['Interval'][_0x3d9f('0x1c')](_0x17950d)[_0x3d9f('0x20')](function(_0x3aa7f8){_0x1be805['count']=_0x3aa7f8;if(_0x5ef931['query'][_0x3d9f('0x41')]){_0x396415['include']=[{'all':!![]}];}return db['Interval'][_0x3d9f('0x42')](_0x396415);})['then'](function(_0x502c42){_0x1be805[_0x3d9f('0x43')]=_0x502c42;return _0x1be805;})[_0x3d9f('0x20')](respondWithFilteredResult(_0x413e88,_0x396415))[_0x3d9f('0x44')](handleError(_0x413e88,null));};exports[_0x3d9f('0x45')]=function(_0x5438a8,_0x4641c8){var _0x21570c={'raw':!![],'where':{'id':_0x5438a8[_0x3d9f('0x46')]['id']}},_0xa6783d={};_0xa6783d[_0x3d9f('0x30')]=_[_0x3d9f('0x31')](db[_0x3d9f('0x2c')][_0x3d9f('0x2d')]);_0xa6783d['query']=_['keys'](_0x5438a8[_0x3d9f('0x32')]);_0xa6783d[_0x3d9f('0x3b')]=_[_0x3d9f('0x33')](_0xa6783d[_0x3d9f('0x30')],_0xa6783d[_0x3d9f('0x32')]);_0x21570c[_0x3d9f('0x34')]=_[_0x3d9f('0x33')](_0xa6783d[_0x3d9f('0x30')],qs[_0x3d9f('0x35')](_0x5438a8[_0x3d9f('0x32')][_0x3d9f('0x35')]));_0x21570c[_0x3d9f('0x34')]=_0x21570c['attributes']['length']?_0x21570c[_0x3d9f('0x34')]:_0xa6783d[_0x3d9f('0x30')];if(_0x5438a8[_0x3d9f('0x32')]['includeAll']){_0x21570c[_0x3d9f('0x47')]=[{'all':!![]}];}_0x21570c=_[_0x3d9f('0x3e')]({},_0x21570c,_0x5438a8['options']);return db[_0x3d9f('0x2c')][_0x3d9f('0x48')](_0x21570c)['then'](handleEntityNotFound(_0x4641c8,null))[_0x3d9f('0x20')](respondWithResult(_0x4641c8,null))[_0x3d9f('0x44')](handleError(_0x4641c8,null));};exports['create']=function(_0x2fc31b,_0x2d1105){return db[_0x3d9f('0x2c')][_0x3d9f('0x49')](_0x2fc31b['body'],{})['then'](function(_0x588d97){var _0x38da1a=_0x2fc31b[_0x3d9f('0x4a')][_0x3d9f('0x22')]({'plain':!![]});if(!_0x38da1a)throw new Error(_0x3d9f('0x4b'));if(_0x38da1a[_0x3d9f('0x4c')]===_0x3d9f('0x4a')){var _0x40247b=_0x588d97['get']({'plain':!![]});var _0x2d032d='Intervals';return db[_0x3d9f('0x4d')][_0x3d9f('0x48')]({'where':{'name':_0x2d032d,'userProfileId':_0x38da1a[_0x3d9f('0x4e')]},'raw':!![]})[_0x3d9f('0x20')](function(_0x4001dc){if(_0x4001dc&&_0x4001dc[_0x3d9f('0x4f')]===0x0){return db[_0x3d9f('0x24')]['create']({'name':_0x40247b[_0x3d9f('0x28')],'resourceId':_0x40247b['id'],'type':_0x4001dc['name'],'sectionId':_0x4001dc['id']},{})['then'](function(){return _0x588d97;});}else{return _0x588d97;}})[_0x3d9f('0x44')](function(_0x577e75){logger['error'](_0x3d9f('0x50'),_0x577e75);throw _0x577e75;});}return _0x588d97;})['then'](respondWithResult(_0x2d1105,0xc9))['catch'](handleError(_0x2d1105,null));};exports[_0x3d9f('0x51')]=function(_0x4d2521,_0x126dc1){if(_0x4d2521[_0x3d9f('0x52')]['id']){delete _0x4d2521['body']['id'];}return db['Interval'][_0x3d9f('0x48')]({'where':{'id':_0x4d2521[_0x3d9f('0x46')]['id']}})[_0x3d9f('0x20')](handleEntityNotFound(_0x126dc1,null))[_0x3d9f('0x20')](saveUpdates(_0x4d2521[_0x3d9f('0x52')],null))[_0x3d9f('0x20')](respondWithResult(_0x126dc1,null))[_0x3d9f('0x44')](handleError(_0x126dc1,null));};exports[_0x3d9f('0x21')]=function(_0x476435,_0x1fe67f){return db['Interval']['find']({'where':{'id':_0x476435[_0x3d9f('0x46')]['id']}})[_0x3d9f('0x20')](handleEntityNotFound(_0x1fe67f,null))[_0x3d9f('0x20')](removeEntity(_0x1fe67f,null))[_0x3d9f('0x44')](handleError(_0x1fe67f,null));};exports[_0x3d9f('0x53')]=function(_0x2e1309,_0x2232d8,_0x28b465){if(_0x2e1309['body']['id']){delete _0x2e1309['body']['id'];}return db[_0x3d9f('0x2c')][_0x3d9f('0x48')]({'where':{'id':_0x2e1309[_0x3d9f('0x46')]['id']}})['then'](handleEntityNotFound(_0x2232d8,null))[_0x3d9f('0x20')](function(_0x2bc5a0){if(_0x2bc5a0){_0x2e1309[_0x3d9f('0x52')][_0x3d9f('0x54')]=_0x2bc5a0['id'];return db['Interval'][_0x3d9f('0x49')](_0x2e1309[_0x3d9f('0x52')]);}})['then'](respondWithResult(_0x2232d8,null))['catch'](handleError(_0x2232d8,null));};exports[_0x3d9f('0x55')]=function(_0x3a3b48,_0x1f765d,_0x4da107){var _0x34c856={};var _0x133f9d={};var _0x254d9b;var _0x550bb0;return db[_0x3d9f('0x2c')][_0x3d9f('0x56')]({'where':{'id':_0x3a3b48[_0x3d9f('0x46')]['id']}})[_0x3d9f('0x20')](handleEntityNotFound(_0x1f765d,null))[_0x3d9f('0x20')](function(_0x5a1985){if(_0x5a1985){_0x254d9b=_0x5a1985;_0x133f9d[_0x3d9f('0x30')]=_['keys'](db[_0x3d9f('0x2c')][_0x3d9f('0x2d')]);_0x133f9d[_0x3d9f('0x32')]=_[_0x3d9f('0x31')](_0x3a3b48[_0x3d9f('0x32')]);_0x133f9d[_0x3d9f('0x3b')]=_[_0x3d9f('0x33')](_0x133f9d[_0x3d9f('0x30')],_0x133f9d['query']);_0x34c856[_0x3d9f('0x34')]=_[_0x3d9f('0x33')](_0x133f9d[_0x3d9f('0x30')],qs[_0x3d9f('0x35')](_0x3a3b48['query'][_0x3d9f('0x35')]));_0x34c856[_0x3d9f('0x34')]=_0x34c856[_0x3d9f('0x34')][_0x3d9f('0x36')]?_0x34c856['attributes']:_0x133f9d[_0x3d9f('0x30')];_0x34c856[_0x3d9f('0x57')]=qs[_0x3d9f('0x3a')](_0x3a3b48[_0x3d9f('0x32')][_0x3d9f('0x3a')]);_0x34c856['where']=qs['filters'](_[_0x3d9f('0x3c')](_0x3a3b48[_0x3d9f('0x32')],_0x133f9d['filters']));if(_0x3a3b48[_0x3d9f('0x32')][_0x3d9f('0x3d')]){_0x34c856[_0x3d9f('0x40')]=_[_0x3d9f('0x3e')](_0x34c856['where'],{'$or':_['map'](_0x34c856[_0x3d9f('0x34')],function(_0x31cf86){var _0xbfe7b5={};_0xbfe7b5[_0x31cf86]={'$like':'%'+_0x3a3b48[_0x3d9f('0x32')][_0x3d9f('0x3d')]+'%'};return _0xbfe7b5;})});}_0x34c856=_[_0x3d9f('0x3e')]({},_0x34c856,_0x3a3b48[_0x3d9f('0x58')]);return _0x254d9b[_0x3d9f('0x55')](_0x34c856);}})[_0x3d9f('0x20')](function(_0x11ea84){if(_0x11ea84){_0x550bb0=_0x11ea84[_0x3d9f('0x36')];if(!_0x3a3b48[_0x3d9f('0x32')]['hasOwnProperty'](_0x3d9f('0x38'))){_0x34c856['limit']=qs[_0x3d9f('0x39')](_0x3a3b48['query'][_0x3d9f('0x39')]);_0x34c856[_0x3d9f('0x1a')]=qs[_0x3d9f('0x1a')](_0x3a3b48['query']['offset']);}return _0x254d9b[_0x3d9f('0x55')](_0x34c856);}})[_0x3d9f('0x20')](function(_0x2b9558){if(_0x2b9558){return _0x2b9558?{'count':_0x550bb0,'rows':_0x2b9558}:null;}})[_0x3d9f('0x20')](respondWithResult(_0x1f765d,null))[_0x3d9f('0x44')](handleError(_0x1f765d,null));};exports[_0x3d9f('0x59')]=function(_0x5d02e5,_0x525544,_0x458ce2){return db[_0x3d9f('0x2c')][_0x3d9f('0x56')]({'where':{'id':_0x5d02e5[_0x3d9f('0x46')]['id']}})[_0x3d9f('0x20')](handleEntityNotFound(_0x525544,null))[_0x3d9f('0x20')](function(_0x106d8d){if(_0x106d8d){return db['sequelize'][_0x3d9f('0x5a')](function(_0x28bb0e){return db[_0x3d9f('0x2c')]['destroy']({'where':{'IntervalId':_0x5d02e5[_0x3d9f('0x46')]['id']},'transaction':_0x28bb0e})[_0x3d9f('0x20')](function(_0x465449){var _0x22eea0=_[_0x3d9f('0x2b')](_0x5d02e5[_0x3d9f('0x52')],function(_0x1d5e0a){delete _0x1d5e0a['id'];_0x1d5e0a[_0x3d9f('0x54')]=_0x5d02e5[_0x3d9f('0x46')]['id'];return _0x1d5e0a;});return db['Interval'][_0x3d9f('0x5b')](_0x22eea0,{'transaction':_0x28bb0e});});})[_0x3d9f('0x20')](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x5d02e5[_0x3d9f('0x46')]['id']}});});}})[_0x3d9f('0x20')](respondWithResult(_0x525544,null))['catch'](handleError(_0x525544,null));}; \ No newline at end of file +var _0x6918=['util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','Intervals','UserProfileResource','error','stack','name','index','Interval','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','IntervalId','getIntervals','addIntervals','findOne','transaction','findAll','eml-format','rimraf','zip-dir','moment','bluebird'];(function(_0x26968f,_0x5a2826){var _0x1e4c81=function(_0x1dfde0){while(--_0x1dfde0){_0x26968f['push'](_0x26968f['shift']());}};_0x1e4c81(++_0x5a2826);}(_0x6918,0xad));var _0x8691=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6918[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x8691('0x0'));var rimraf=require(_0x8691('0x1'));var zipdir=require(_0x8691('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8691('0x3'));var BPromise=require(_0x8691('0x4'));var Mustache=require('mustache');var util=require(_0x8691('0x5'));var path=require('path');var sox=require(_0x8691('0x6'));var csv=require(_0x8691('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8691('0x8'));var _=require(_0x8691('0x9'));var squel=require(_0x8691('0xa'));var crypto=require(_0x8691('0xb'));var jsforce=require(_0x8691('0xc'));var deskjs=require(_0x8691('0xd'));var toCsv=require(_0x8691('0x7'));var querystring=require(_0x8691('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8691('0xf'));var as=require(_0x8691('0x10'));var hardwareService=require(_0x8691('0x11'));var logger=require(_0x8691('0x12'))(_0x8691('0x13'));var utils=require(_0x8691('0x14'));var config=require(_0x8691('0x15'));var licenseUtil=require(_0x8691('0x16'));var db=require(_0x8691('0x17'))['db'];var extensions=require(_0x8691('0x18'));function respondWithStatusCode(_0xe6a2d,_0x3d1a87){_0x3d1a87=_0x3d1a87||0xcc;return function(_0x4e7e53){if(_0x4e7e53){return _0xe6a2d[_0x8691('0x19')](_0x3d1a87);}return _0xe6a2d[_0x8691('0x1a')](_0x3d1a87)[_0x8691('0x1b')]();};}function respondWithResult(_0x4fe87c,_0x4d6dfd){_0x4d6dfd=_0x4d6dfd||0xc8;return function(_0x38fd5b){if(_0x38fd5b){return _0x4fe87c['status'](_0x4d6dfd)[_0x8691('0x1c')](_0x38fd5b);}};}function respondWithFilteredResult(_0x14e740,_0x162d14){return function(_0x4faf3e){if(_0x4faf3e){var _0x1ac183=typeof _0x162d14[_0x8691('0x1d')]===_0x8691('0x1e')&&typeof _0x162d14['limit']===_0x8691('0x1e');var _0x490dea=_0x4faf3e[_0x8691('0x1f')];var _0x28c421=_0x1ac183?0x0:_0x162d14[_0x8691('0x1d')];var _0x5ef625=_0x1ac183?_0x4faf3e[_0x8691('0x1f')]:_0x162d14[_0x8691('0x1d')]+_0x162d14['limit'];var _0x39e4db;if(_0x5ef625>=_0x490dea){_0x5ef625=_0x490dea;_0x39e4db=0xc8;}else{_0x39e4db=0xce;}_0x14e740[_0x8691('0x1a')](_0x39e4db);return _0x14e740[_0x8691('0x20')](_0x8691('0x21'),_0x28c421+'-'+_0x5ef625+'/'+_0x490dea)['json'](_0x4faf3e);}return null;};}function patchUpdates(_0x5c1f31){return function(_0x50d11b){try{jsonpatch['apply'](_0x50d11b,_0x5c1f31,!![]);}catch(_0x1496a4){return BPromise['reject'](_0x1496a4);}return _0x50d11b[_0x8691('0x22')]();};}function saveUpdates(_0x757add,_0x476e75){return function(_0xbc7831){if(_0xbc7831){return _0xbc7831[_0x8691('0x23')](_0x757add)[_0x8691('0x24')](function(_0x5505a5){return _0x5505a5;});}return null;};}function removeEntity(_0x48f260,_0x5900d1){return function(_0x38b3f1){if(_0x38b3f1){return _0x38b3f1[_0x8691('0x25')]()[_0x8691('0x24')](function(){var _0x441899=_0x38b3f1['get']({'plain':!![]});var _0x30bcfd=_0x8691('0x26');return db[_0x8691('0x27')]['destroy']({'where':{'type':_0x30bcfd,'resourceId':_0x441899['id']}})['then'](function(){return _0x38b3f1;});})[_0x8691('0x24')](function(){_0x48f260['status'](0xcc)[_0x8691('0x1b')]();});}};}function handleEntityNotFound(_0x57dd8d,_0x497f85){return function(_0x324855){if(!_0x324855){_0x57dd8d[_0x8691('0x19')](0x194);}return _0x324855;};}function handleError(_0x1da5a8,_0x23e400){_0x23e400=_0x23e400||0x1f4;return function(_0x5af7ba){logger[_0x8691('0x28')](_0x5af7ba[_0x8691('0x29')]);if(_0x5af7ba[_0x8691('0x2a')]){delete _0x5af7ba[_0x8691('0x2a')];}_0x1da5a8[_0x8691('0x1a')](_0x23e400)['send'](_0x5af7ba);};}exports[_0x8691('0x2b')]=function(_0x130b56,_0xcfbad7){var _0x5369b8={},_0x27297a={},_0x57aa71={'count':0x0,'rows':[]};var _0x19e96d=_['map'](db[_0x8691('0x2c')]['rawAttributes'],function(_0x31828c){return{'name':_0x31828c[_0x8691('0x2d')],'type':_0x31828c[_0x8691('0x2e')]['key']};});_0x27297a[_0x8691('0x2f')]=_[_0x8691('0x30')](_0x19e96d,_0x8691('0x2a'));_0x27297a[_0x8691('0x31')]=_['keys'](_0x130b56[_0x8691('0x31')]);_0x27297a[_0x8691('0x32')]=_[_0x8691('0x33')](_0x27297a['model'],_0x27297a[_0x8691('0x31')]);_0x5369b8[_0x8691('0x34')]=_[_0x8691('0x33')](_0x27297a[_0x8691('0x2f')],qs[_0x8691('0x35')](_0x130b56[_0x8691('0x31')][_0x8691('0x35')]));_0x5369b8['attributes']=_0x5369b8[_0x8691('0x34')][_0x8691('0x36')]?_0x5369b8[_0x8691('0x34')]:_0x27297a[_0x8691('0x2f')];if(!_0x130b56[_0x8691('0x31')][_0x8691('0x37')](_0x8691('0x38'))){_0x5369b8['limit']=qs[_0x8691('0x39')](_0x130b56[_0x8691('0x31')]['limit']);_0x5369b8[_0x8691('0x1d')]=qs['offset'](_0x130b56[_0x8691('0x31')][_0x8691('0x1d')]);}_0x5369b8[_0x8691('0x3a')]=qs[_0x8691('0x3b')](_0x130b56[_0x8691('0x31')][_0x8691('0x3b')]);_0x5369b8[_0x8691('0x3c')]=qs[_0x8691('0x32')](_[_0x8691('0x3d')](_0x130b56[_0x8691('0x31')],_0x27297a[_0x8691('0x32')]),_0x19e96d);if(_0x130b56[_0x8691('0x31')][_0x8691('0x3e')]){_0x5369b8[_0x8691('0x3c')]=_[_0x8691('0x3f')](_0x5369b8[_0x8691('0x3c')],{'$or':_[_0x8691('0x30')](_0x19e96d,function(_0x193dfa){if(_0x193dfa[_0x8691('0x2e')]!=='VIRTUAL'){var _0x31bc93={};_0x31bc93[_0x193dfa[_0x8691('0x2a')]]={'$like':'%'+_0x130b56[_0x8691('0x31')][_0x8691('0x3e')]+'%'};return _0x31bc93;}})});}_0x5369b8=_['merge']({},_0x5369b8,_0x130b56[_0x8691('0x40')]);var _0x1530c5={'where':_0x5369b8[_0x8691('0x3c')]};return db[_0x8691('0x2c')][_0x8691('0x1f')](_0x1530c5)[_0x8691('0x24')](function(_0x251a9c){_0x57aa71[_0x8691('0x1f')]=_0x251a9c;if(_0x130b56['query'][_0x8691('0x41')]){_0x5369b8[_0x8691('0x42')]=[{'all':!![]}];}return db[_0x8691('0x2c')]['findAll'](_0x5369b8);})[_0x8691('0x24')](function(_0x5aa76a){_0x57aa71[_0x8691('0x43')]=_0x5aa76a;return _0x57aa71;})['then'](respondWithFilteredResult(_0xcfbad7,_0x5369b8))['catch'](handleError(_0xcfbad7,null));};exports[_0x8691('0x44')]=function(_0x282ddf,_0x3e4ecb){var _0x3477d0={'raw':!![],'where':{'id':_0x282ddf[_0x8691('0x45')]['id']}},_0x5086fd={};_0x5086fd[_0x8691('0x2f')]=_[_0x8691('0x46')](db[_0x8691('0x2c')]['rawAttributes']);_0x5086fd['query']=_[_0x8691('0x46')](_0x282ddf[_0x8691('0x31')]);_0x5086fd[_0x8691('0x32')]=_[_0x8691('0x33')](_0x5086fd['model'],_0x5086fd[_0x8691('0x31')]);_0x3477d0['attributes']=_['intersection'](_0x5086fd[_0x8691('0x2f')],qs[_0x8691('0x35')](_0x282ddf[_0x8691('0x31')][_0x8691('0x35')]));_0x3477d0[_0x8691('0x34')]=_0x3477d0[_0x8691('0x34')][_0x8691('0x36')]?_0x3477d0['attributes']:_0x5086fd['model'];if(_0x282ddf['query']['includeAll']){_0x3477d0[_0x8691('0x42')]=[{'all':!![]}];}_0x3477d0=_['merge']({},_0x3477d0,_0x282ddf[_0x8691('0x40')]);return db[_0x8691('0x2c')][_0x8691('0x47')](_0x3477d0)[_0x8691('0x24')](handleEntityNotFound(_0x3e4ecb,null))['then'](respondWithResult(_0x3e4ecb,null))['catch'](handleError(_0x3e4ecb,null));};exports['create']=function(_0x5251f1,_0xcdcbd9){return db['Interval'][_0x8691('0x48')](_0x5251f1[_0x8691('0x49')],{})[_0x8691('0x24')](function(_0x346f58){var _0x33dd52=_0x5251f1[_0x8691('0x4a')][_0x8691('0x4b')]({'plain':!![]});if(!_0x33dd52)throw new Error(_0x8691('0x4c'));if(_0x33dd52[_0x8691('0x4d')]==='user'){var _0x878b86=_0x346f58[_0x8691('0x4b')]({'plain':!![]});var _0x3d2dd6=_0x8691('0x26');return db[_0x8691('0x4e')][_0x8691('0x47')]({'where':{'name':_0x3d2dd6,'userProfileId':_0x33dd52[_0x8691('0x4f')]},'raw':!![]})[_0x8691('0x24')](function(_0xcb50e2){if(_0xcb50e2&&_0xcb50e2[_0x8691('0x50')]===0x0){return db[_0x8691('0x27')][_0x8691('0x48')]({'name':_0x878b86[_0x8691('0x2a')],'resourceId':_0x878b86['id'],'type':_0xcb50e2[_0x8691('0x2a')],'sectionId':_0xcb50e2['id']},{})[_0x8691('0x24')](function(){return _0x346f58;});}else{return _0x346f58;}})['catch'](function(_0x3a585f){logger[_0x8691('0x28')](_0x8691('0x51'),_0x3a585f);throw _0x3a585f;});}return _0x346f58;})[_0x8691('0x24')](respondWithResult(_0xcdcbd9,0xc9))[_0x8691('0x52')](handleError(_0xcdcbd9,null));};exports[_0x8691('0x23')]=function(_0x2758df,_0x5dcc8a){if(_0x2758df[_0x8691('0x49')]['id']){delete _0x2758df[_0x8691('0x49')]['id'];}return db[_0x8691('0x2c')][_0x8691('0x47')]({'where':{'id':_0x2758df[_0x8691('0x45')]['id']}})['then'](handleEntityNotFound(_0x5dcc8a,null))[_0x8691('0x24')](saveUpdates(_0x2758df[_0x8691('0x49')],null))[_0x8691('0x24')](respondWithResult(_0x5dcc8a,null))[_0x8691('0x52')](handleError(_0x5dcc8a,null));};exports[_0x8691('0x25')]=function(_0x4bff05,_0x8c8b7c){return db[_0x8691('0x2c')]['find']({'where':{'id':_0x4bff05[_0x8691('0x45')]['id']}})[_0x8691('0x24')](handleEntityNotFound(_0x8c8b7c,null))[_0x8691('0x24')](removeEntity(_0x8c8b7c,null))[_0x8691('0x52')](handleError(_0x8c8b7c,null));};exports['addInterval']=function(_0x103e6e,_0x1fa6df,_0x11ffea){if(_0x103e6e['body']['id']){delete _0x103e6e['body']['id'];}return db['Interval']['find']({'where':{'id':_0x103e6e[_0x8691('0x45')]['id']}})[_0x8691('0x24')](handleEntityNotFound(_0x1fa6df,null))['then'](function(_0xe1b25e){if(_0xe1b25e){_0x103e6e[_0x8691('0x49')][_0x8691('0x53')]=_0xe1b25e['id'];return db[_0x8691('0x2c')][_0x8691('0x48')](_0x103e6e[_0x8691('0x49')]);}})['then'](respondWithResult(_0x1fa6df,null))['catch'](handleError(_0x1fa6df,null));};exports[_0x8691('0x54')]=function(_0x27db25,_0x587712,_0x22c4bd){var _0x9e7cb2={};var _0x224b82={};var _0x10f4b7;var _0x29d826;return db[_0x8691('0x2c')]['findOne']({'where':{'id':_0x27db25[_0x8691('0x45')]['id']}})[_0x8691('0x24')](handleEntityNotFound(_0x587712,null))[_0x8691('0x24')](function(_0x9c0b17){if(_0x9c0b17){_0x10f4b7=_0x9c0b17;_0x224b82['model']=_[_0x8691('0x46')](db['Interval']['rawAttributes']);_0x224b82[_0x8691('0x31')]=_[_0x8691('0x46')](_0x27db25['query']);_0x224b82['filters']=_['intersection'](_0x224b82[_0x8691('0x2f')],_0x224b82[_0x8691('0x31')]);_0x9e7cb2['attributes']=_['intersection'](_0x224b82[_0x8691('0x2f')],qs[_0x8691('0x35')](_0x27db25[_0x8691('0x31')]['fields']));_0x9e7cb2[_0x8691('0x34')]=_0x9e7cb2[_0x8691('0x34')]['length']?_0x9e7cb2[_0x8691('0x34')]:_0x224b82[_0x8691('0x2f')];_0x9e7cb2[_0x8691('0x3a')]=qs['sort'](_0x27db25[_0x8691('0x31')][_0x8691('0x3b')]);_0x9e7cb2[_0x8691('0x3c')]=qs[_0x8691('0x32')](_[_0x8691('0x3d')](_0x27db25[_0x8691('0x31')],_0x224b82['filters']));if(_0x27db25['query']['filter']){_0x9e7cb2[_0x8691('0x3c')]=_[_0x8691('0x3f')](_0x9e7cb2['where'],{'$or':_[_0x8691('0x30')](_0x9e7cb2[_0x8691('0x34')],function(_0x35fcec){var _0x579b61={};_0x579b61[_0x35fcec]={'$like':'%'+_0x27db25['query'][_0x8691('0x3e')]+'%'};return _0x579b61;})});}_0x9e7cb2=_[_0x8691('0x3f')]({},_0x9e7cb2,_0x27db25[_0x8691('0x40')]);return _0x10f4b7['getIntervals'](_0x9e7cb2);}})['then'](function(_0x2037a4){if(_0x2037a4){_0x29d826=_0x2037a4[_0x8691('0x36')];if(!_0x27db25[_0x8691('0x31')][_0x8691('0x37')](_0x8691('0x38'))){_0x9e7cb2[_0x8691('0x39')]=qs[_0x8691('0x39')](_0x27db25[_0x8691('0x31')]['limit']);_0x9e7cb2[_0x8691('0x1d')]=qs['offset'](_0x27db25[_0x8691('0x31')][_0x8691('0x1d')]);}return _0x10f4b7[_0x8691('0x54')](_0x9e7cb2);}})['then'](function(_0x5d8a50){if(_0x5d8a50){return _0x5d8a50?{'count':_0x29d826,'rows':_0x5d8a50}:null;}})[_0x8691('0x24')](respondWithResult(_0x587712,null))[_0x8691('0x52')](handleError(_0x587712,null));};exports[_0x8691('0x55')]=function(_0x33e53a,_0x116fb6,_0x2e77b0){return db[_0x8691('0x2c')][_0x8691('0x56')]({'where':{'id':_0x33e53a['params']['id']}})['then'](handleEntityNotFound(_0x116fb6,null))['then'](function(_0x3250d0){if(_0x3250d0){return db['sequelize'][_0x8691('0x57')](function(_0x4f5425){return db[_0x8691('0x2c')]['destroy']({'where':{'IntervalId':_0x33e53a[_0x8691('0x45')]['id']},'transaction':_0x4f5425})[_0x8691('0x24')](function(_0x266ae2){var _0x5c6d3e=_['map'](_0x33e53a['body'],function(_0x43b3f7){delete _0x43b3f7['id'];_0x43b3f7[_0x8691('0x53')]=_0x33e53a['params']['id'];return _0x43b3f7;});return db[_0x8691('0x2c')]['bulkCreate'](_0x5c6d3e,{'transaction':_0x4f5425});});})[_0x8691('0x24')](function(){return db[_0x8691('0x2c')][_0x8691('0x58')]({'where':{'IntervalId':_0x33e53a[_0x8691('0x45')]['id']}});});}})[_0x8691('0x24')](respondWithResult(_0x116fb6,null))[_0x8691('0x52')](handleError(_0x116fb6,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 43a90e1..92841db 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 _0x1561=['moment','request-promise','path','rimraf','../../config/environment','./interval.attributes','exports','define','tools_intervals','rewrite','lodash','util'];(function(_0x36da6a,_0x7dbf9b){var _0x3b2ab8=function(_0x485536){while(--_0x485536){_0x36da6a['push'](_0x36da6a['shift']());}};_0x3b2ab8(++_0x7dbf9b);}(_0x1561,0x8e));var _0x1156=function(_0x58b8aa,_0x1dae14){_0x58b8aa=_0x58b8aa-0x0;var _0x2ca4b5=_0x1561[_0x58b8aa];return _0x2ca4b5;};'use strict';var _=require(_0x1156('0x0'));var util=require(_0x1156('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1156('0x2'));var BPromise=require('bluebird');var rp=require(_0x1156('0x3'));var fs=require('fs');var path=require(_0x1156('0x4'));var rimraf=require(_0x1156('0x5'));var config=require(_0x1156('0x6'));var attributes=require(_0x1156('0x7'));var extensions=require('../../components/extensions/rewrite');module[_0x1156('0x8')]=function(_0x428c69,_0xf26c4a){return _0x428c69[_0x1156('0x9')]('Interval',attributes,{'tableName':_0x1156('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c6053,_0x3b5fdc){extensions['rewrite'](_0x428c69,_0x5c6053);},'afterBulkCreate':function(_0x37c330,_0xe1e8cd,_0x220496){_0x220496();extensions[_0x1156('0xb')](_0x428c69,_0x37c330[0x0]);},'afterUpdate':function(_0x416c63,_0x52bc58){extensions[_0x1156('0xb')](_0x428c69,_0x416c63);},'afterDestroy':function(_0x28bab8,_0x273d55){extensions[_0x1156('0xb')](_0x428c69,_0x28bab8);}}});}; \ No newline at end of file +var _0x2825=['request-promise','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','define','Interval','tools_intervals','rewrite','moment','bluebird'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0x2825,0x195));var _0x5282=function(_0x126461,_0xe10273){_0x126461=_0x126461-0x0;var _0x293958=_0x2825[_0x126461];return _0x293958;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5282('0x0'));var BPromise=require(_0x5282('0x1'));var rp=require(_0x5282('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5282('0x3'));var config=require(_0x5282('0x4'));var attributes=require(_0x5282('0x5'));var extensions=require(_0x5282('0x6'));module['exports']=function(_0x19b8aa,_0x59ec4a){return _0x19b8aa[_0x5282('0x7')](_0x5282('0x8'),attributes,{'tableName':_0x5282('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x53ca23,_0x272f12){extensions[_0x5282('0xa')](_0x19b8aa,_0x53ca23);},'afterBulkCreate':function(_0x240b72,_0x50d99b,_0x593cd5){_0x593cd5();extensions[_0x5282('0xa')](_0x19b8aa,_0x240b72[0x0]);},'afterUpdate':function(_0x1e3100,_0xa6ddb4){extensions[_0x5282('0xa')](_0x19b8aa,_0x1e3100);},'afterDestroy':function(_0x549840,_0x4fa3e2){extensions[_0x5282('0xa')](_0x19b8aa,_0x549840);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 0093710..a93657c 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(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_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 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(_0x4409e7,_0x307f17){var _0x24c751=function(_0x3a7d33){while(--_0x3a7d33){_0x4409e7['push'](_0x4409e7['shift']());}};_0x24c751(++_0x307f17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 42272bc..b3eaf71 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0xd9ab41,_0x581b4d){var _0x1ddc11=function(_0x5507ee){while(--_0x5507ee){_0xd9ab41['push'](_0xd9ab41['shift']());}};_0x1ddc11(++_0x581b4d);}(_0x2ef3,0xba));var _0x32ef=function(_0x2d7e02,_0x25d3cb){_0x2d7e02=_0x2d7e02-0x0;var _0x8cc61f=_0x2ef3[_0x2d7e02];return _0x8cc61f;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x2d4f02,_0x58fffa){var _0x294472=function(_0x4f034a){while(--_0x4f034a){_0x2d4f02['push'](_0x2d4f02['shift']());}};_0x294472(++_0x58fffa);}(_0x2032,0xd9));var _0x2203=function(_0xc049f6,_0x1544e8){_0xc049f6=_0xc049f6-0x0;var _0x1f40b0=_0x2032[_0xc049f6];return _0x1f40b0;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 5702e6d..a99a792 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 _0x8d19=['customfield_11501','oldToken','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','base64','setEncoding','utf8','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','send','body','headers','x-forwarded-for','remoteAddress','connection','bluebird','https','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','Bug','fields','customfield_11500'];(function(_0x3f607e,_0x29e9af){var _0x45e0ed=function(_0x122467){while(--_0x122467){_0x3f607e['push'](_0x3f607e['shift']());}};_0x45e0ed(++_0x29e9af);}(_0x8d19,0x78));var _0x98d1=function(_0x8560d3,_0x26a504){_0x8560d3=_0x8560d3-0x0;var _0x33b1b5=_0x8d19[_0x8560d3];return _0x33b1b5;};'use strict';var BPromise=require(_0x98d1('0x0'));var https=require(_0x98d1('0x1'));var logger=require(_0x98d1('0x2'))(_0x98d1('0x3'));var USERNAME='support';var PASSWORD=_0x98d1('0x4');function openIssue(_0x1693cb,_0x13ca71){var _0x1da093={'fields':{'project':{'key':_0x1693cb[_0x98d1('0x5')]||_0x98d1('0x6')},'summary':(_0x1693cb[_0x98d1('0x7')]||_0x98d1('0x8'))+_0x98d1('0x9')+_0x1693cb['ip'],'description':_0x1693cb[_0x98d1('0xa')]||JSON[_0x98d1('0xb')](_0x1693cb),'issuetype':{'name':_0x1693cb['issuetype']||_0x98d1('0xc')}}};_0x1da093[_0x98d1('0xd')][_0x98d1('0xe')]=_0x1693cb['email'];_0x1da093[_0x98d1('0xd')][_0x98d1('0xf')]=_0x1693cb[_0x98d1('0x10')];_0x1da093['fields'][_0x98d1('0x11')]=_0x1693cb[_0x98d1('0x12')];_0x1da093[_0x98d1('0xd')]['customfield_11503']=_0x1693cb[_0x98d1('0x13')];_0x1da093[_0x98d1('0xd')][_0x98d1('0x14')]=_0x1693cb[_0x98d1('0x15')];_0x1da093['fields'][_0x98d1('0x16')]=_0x1693cb['ip'];var _0x452c27={'host':_0x98d1('0x17'),'port':0x1bb,'path':_0x98d1('0x18'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x98d1('0x19'),'Authorization':_0x98d1('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0x98d1('0x1b')](_0x98d1('0x1c'))}};var _0x56dcde=JSON[_0x98d1('0xb')](_0x1da093);var _0xd64efb=https['request'](_0x452c27,function(_0x5d7b4a){_0x5d7b4a[_0x98d1('0x1d')](_0x98d1('0x1e'));var _0x1fbf90='';_0x5d7b4a['on']('data',function(_0x1c576c){_0x1fbf90+=_0x1c576c;});_0x5d7b4a['on'](_0x98d1('0x1f'),function(){if(_0x13ca71){return _0x13ca71[_0x98d1('0x20')](_0x5d7b4a[_0x98d1('0x21')])[_0x98d1('0x22')](JSON[_0x98d1('0x23')](_0x1fbf90));}});});_0xd64efb['on'](_0x98d1('0x24'),function(_0x17d7a7){if(_0x13ca71){return _0x13ca71[_0x98d1('0x20')](0x1f4)[_0x98d1('0x22')]({'errors':[{'message':_0x98d1('0x25'),'type':_0x98d1('0x26')}]});}});_0xd64efb['write'](_0x56dcde);_0xd64efb[_0x98d1('0x1f')]();}exports['openIssue']=openIssue;exports[_0x98d1('0x27')]=function(_0x57ac79,_0x1906e1){_0x57ac79[_0x98d1('0x28')]['ip']=_0x57ac79[_0x98d1('0x29')][_0x98d1('0x2a')]||_0x57ac79['connection'][_0x98d1('0x2b')]||_0x57ac79['socket'][_0x98d1('0x2b')]||_0x57ac79[_0x98d1('0x2c')]['socket']['remoteAddress'];return openIssue(_0x57ac79[_0x98d1('0x28')],_0x1906e1);}; \ No newline at end of file +var _0x4220=['email','oldToken','newToken','customfield_11503','name','customfield_11504','customfield_10102','/rest/api/2/issue','POST','Basic\x20','toString','base64','request','setEncoding','utf8','statusCode','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','send','x-forwarded-for','connection','socket','remoteAddress','body','bluebird','https','../../config/logger','api','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x4220,0x71));var _0x0422=function(_0x2555be,_0x10045d){_0x2555be=_0x2555be-0x0;var _0x19334b=_0x4220[_0x2555be];return _0x19334b;};'use strict';var BPromise=require(_0x0422('0x0'));var https=require(_0x0422('0x1'));var logger=require(_0x0422('0x2'))(_0x0422('0x3'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x18af8a,_0x351d1b){var _0x39ddcd={'fields':{'project':{'key':_0x18af8a['key']||_0x0422('0x4')},'summary':(_0x18af8a[_0x0422('0x5')]||_0x0422('0x6'))+_0x0422('0x7')+_0x18af8a['ip'],'description':_0x18af8a[_0x0422('0x8')]||JSON[_0x0422('0x9')](_0x18af8a),'issuetype':{'name':_0x18af8a[_0x0422('0xa')]||_0x0422('0xb')}}};_0x39ddcd[_0x0422('0xc')]['customfield_11500']=_0x18af8a[_0x0422('0xd')];_0x39ddcd[_0x0422('0xc')]['customfield_11501']=_0x18af8a[_0x0422('0xe')];_0x39ddcd[_0x0422('0xc')]['customfield_11502']=_0x18af8a[_0x0422('0xf')];_0x39ddcd[_0x0422('0xc')][_0x0422('0x10')]=_0x18af8a[_0x0422('0x11')];_0x39ddcd[_0x0422('0xc')][_0x0422('0x12')]=_0x18af8a['reason'];_0x39ddcd['fields'][_0x0422('0x13')]=_0x18af8a['ip'];var _0x2fe5fe={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x0422('0x14'),'method':_0x0422('0x15'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x0422('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x0422('0x17')](_0x0422('0x18'))}};var _0x36ae94=JSON['stringify'](_0x39ddcd);var _0x1d6d32=https[_0x0422('0x19')](_0x2fe5fe,function(_0x423bd3){_0x423bd3[_0x0422('0x1a')](_0x0422('0x1b'));var _0x4027fc='';_0x423bd3['on']('data',function(_0x5b3eb8){_0x4027fc+=_0x5b3eb8;});_0x423bd3['on']('end',function(){if(_0x351d1b){return _0x351d1b['status'](_0x423bd3[_0x0422('0x1c')])[_0x0422('0x1d')](JSON[_0x0422('0x1e')](_0x4027fc));}});});_0x1d6d32['on'](_0x0422('0x1f'),function(_0x3c8456){if(_0x351d1b){return _0x351d1b[_0x0422('0x20')](0x1f4)[_0x0422('0x1d')]({'errors':[{'message':_0x0422('0x21'),'type':_0x0422('0x22')}]});}});_0x1d6d32[_0x0422('0x23')](_0x36ae94);_0x1d6d32['end']();}exports['openIssue']=openIssue;exports[_0x0422('0x24')]=function(_0x506089,_0x40a858){_0x506089['body']['ip']=_0x506089['headers'][_0x0422('0x25')]||_0x506089[_0x0422('0x26')]['remoteAddress']||_0x506089[_0x0422('0x27')][_0x0422('0x28')]||_0x506089['connection'][_0x0422('0x27')][_0x0422('0x28')];return openIssue(_0x506089[_0x0422('0x29')],_0x40a858);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index baa46d4..62617d5 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 _0x0a9a=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','update','destroy','util','connect-timeout','express'];(function(_0x40e8e7,_0x5892a0){var _0x3adfe4=function(_0x1c31be){while(--_0x1c31be){_0x40e8e7['push'](_0x40e8e7['shift']());}};_0x3adfe4(++_0x5892a0);}(_0x0a9a,0x183));var _0xa0a9=function(_0x213ce0,_0xb99ef){_0x213ce0=_0x213ce0-0x0;var _0x350d96=_0x0a9a[_0x213ce0];return _0x350d96;};'use strict';var multer=require('multer');var util=require(_0xa0a9('0x0'));var path=require('path');var timeout=require(_0xa0a9('0x1'));var express=require(_0xa0a9('0x2'));var router=express[_0xa0a9('0x3')]();var fs_extra=require(_0xa0a9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa0a9('0x5'));var config=require(_0xa0a9('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0xa0a9('0x7')]('/',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0x9')]);router[_0xa0a9('0x7')]('/describe',auth[_0xa0a9('0x8')](),controller['describe']);router[_0xa0a9('0x7')](_0xa0a9('0xa'),auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xb')]);router['post']('/',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xc')]);router['put']('/:id',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xd')]);router['delete'](_0xa0a9('0xa'),auth['isAuthenticated'](),controller[_0xa0a9('0xe')]);module['exports']=router; \ No newline at end of file +var _0x5ff3=['/:id','post','create','put','update','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x58d89e,_0x4349ca){var _0x56cdea=function(_0x23ce22){while(--_0x23ce22){_0x58d89e['push'](_0x58d89e['shift']());}};_0x56cdea(++_0x4349ca);}(_0x5ff3,0x17d));var _0x35ff=function(_0x19ad7c,_0x1b4805){_0x19ad7c=_0x19ad7c-0x0;var _0x11579c=_0x5ff3[_0x19ad7c];return _0x11579c;};'use strict';var multer=require('multer');var util=require(_0x35ff('0x0'));var path=require('path');var timeout=require(_0x35ff('0x1'));var express=require('express');var router=express[_0x35ff('0x2')]();var fs_extra=require(_0x35ff('0x3'));var auth=require(_0x35ff('0x4'));var interaction=require(_0x35ff('0x5'));var config=require('../../config/environment');var controller=require(_0x35ff('0x6'));router[_0x35ff('0x7')]('/',auth[_0x35ff('0x8')](),controller[_0x35ff('0x9')]);router[_0x35ff('0x7')]('/describe',auth[_0x35ff('0x8')](),controller['describe']);router[_0x35ff('0x7')](_0x35ff('0xa'),auth[_0x35ff('0x8')](),controller['show']);router[_0x35ff('0xb')]('/',auth['isAuthenticated'](),controller[_0x35ff('0xc')]);router[_0x35ff('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x35ff('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x35ff('0xf')]);module[_0x35ff('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 15e75eb..7fc7de9 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(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x3df0e6,_0x3ecf79){_0x3df0e6=_0x3df0e6-0x0;var _0x241d36=_0x7a54[_0x3df0e6];return _0x241d36;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7a54,0x106));var _0x47a5=function(_0x4b7b4a,_0x21fc85){_0x4b7b4a=_0x4b7b4a-0x0;var _0x35186f=_0x7a54[_0x4b7b4a];return _0x35186f;};'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 0221feb..c872989 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 _0x2c8f=['then','destroy','error','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','show','params','length','find','catch','create','body','describe','rimraf','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update'];(function(_0x108e3f,_0x305a7c){var _0x3e808b=function(_0x4d710d){while(--_0x4d710d){_0x108e3f['push'](_0x108e3f['shift']());}};_0x3e808b(++_0x305a7c);}(_0x2c8f,0x192));var _0xf2c8=function(_0x301fd3,_0x5b713e){_0x301fd3=_0x301fd3-0x0;var _0x2e5685=_0x2c8f[_0x301fd3];return _0x2e5685;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf2c8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf2c8('0x1'));var BPromise=require(_0xf2c8('0x2'));var Mustache=require(_0xf2c8('0x3'));var util=require('util');var path=require('path');var sox=require(_0xf2c8('0x4'));var csv=require(_0xf2c8('0x5'));var ejs=require(_0xf2c8('0x6'));var fs=require('fs');var fs_extra=require(_0xf2c8('0x7'));var _=require(_0xf2c8('0x8'));var squel=require('squel');var crypto=require(_0xf2c8('0x9'));var jsforce=require(_0xf2c8('0xa'));var deskjs=require(_0xf2c8('0xb'));var toCsv=require(_0xf2c8('0x5'));var querystring=require(_0xf2c8('0xc'));var Papa=require(_0xf2c8('0xd'));var Redis=require('ioredis');var authService=require(_0xf2c8('0xe'));var qs=require(_0xf2c8('0xf'));var as=require(_0xf2c8('0x10'));var hardwareService=require(_0xf2c8('0x11'));var logger=require(_0xf2c8('0x12'))(_0xf2c8('0x13'));var utils=require(_0xf2c8('0x14'));var config=require(_0xf2c8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf2c8('0x16'))['db'];function respondWithStatusCode(_0x5ce572,_0x10bc2c){_0x10bc2c=_0x10bc2c||0xcc;return function(_0x16b7a4){if(_0x16b7a4){return _0x5ce572[_0xf2c8('0x17')](_0x10bc2c);}return _0x5ce572[_0xf2c8('0x18')](_0x10bc2c)[_0xf2c8('0x19')]();};}function respondWithResult(_0x40849c,_0x54dd36){_0x54dd36=_0x54dd36||0xc8;return function(_0x3b86f0){if(_0x3b86f0){return _0x40849c[_0xf2c8('0x18')](_0x54dd36)[_0xf2c8('0x1a')](_0x3b86f0);}};}function respondWithFilteredResult(_0x34f9b1,_0x3ed09e){return function(_0x383af2){if(_0x383af2){var _0x1b8c5b=typeof _0x3ed09e['offset']===_0xf2c8('0x1b')&&typeof _0x3ed09e[_0xf2c8('0x1c')]===_0xf2c8('0x1b');var _0x31b8e0=_0x383af2[_0xf2c8('0x1d')];var _0x52e9d0=_0x1b8c5b?0x0:_0x3ed09e['offset'];var _0x104d9d=_0x1b8c5b?_0x383af2[_0xf2c8('0x1d')]:_0x3ed09e[_0xf2c8('0x1e')]+_0x3ed09e[_0xf2c8('0x1c')];var _0x516d99;if(_0x104d9d>=_0x31b8e0){_0x104d9d=_0x31b8e0;_0x516d99=0xc8;}else{_0x516d99=0xce;}_0x34f9b1[_0xf2c8('0x18')](_0x516d99);return _0x34f9b1[_0xf2c8('0x1f')](_0xf2c8('0x20'),_0x52e9d0+'-'+_0x104d9d+'/'+_0x31b8e0)['json'](_0x383af2);}return null;};}function patchUpdates(_0x4442f9){return function(_0x31008e){try{jsonpatch['apply'](_0x31008e,_0x4442f9,!![]);}catch(_0x5b1e44){return BPromise[_0xf2c8('0x21')](_0x5b1e44);}return _0x31008e[_0xf2c8('0x22')]();};}function saveUpdates(_0x98f9cb,_0x57affa){return function(_0xd2e728){if(_0xd2e728){return _0xd2e728[_0xf2c8('0x23')](_0x98f9cb)[_0xf2c8('0x24')](function(_0x239350){return _0x239350;});}return null;};}function removeEntity(_0x4ba1e0,_0x17956f){return function(_0xe5ff6c){if(_0xe5ff6c){return _0xe5ff6c[_0xf2c8('0x25')]()[_0xf2c8('0x24')](function(){_0x4ba1e0[_0xf2c8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x93707c,_0x54bbcb){return function(_0x3cd344){if(!_0x3cd344){_0x93707c[_0xf2c8('0x17')](0x194);}return _0x3cd344;};}function handleError(_0x27dc4f,_0x3bb777){_0x3bb777=_0x3bb777||0x1f4;return function(_0x1d2e74){logger[_0xf2c8('0x26')](_0x1d2e74[_0xf2c8('0x27')]);if(_0x1d2e74[_0xf2c8('0x28')]){delete _0x1d2e74[_0xf2c8('0x28')];}_0x27dc4f[_0xf2c8('0x18')](_0x3bb777)[_0xf2c8('0x29')](_0x1d2e74);};}exports[_0xf2c8('0x2a')]=function(_0x311349,_0x4e12a2){var _0x1cb979={},_0x5146e4={},_0x584587={'count':0x0,'rows':[]};var _0x3df45d=_['map'](db[_0xf2c8('0x2b')][_0xf2c8('0x2c')],function(_0x23de17){return{'name':_0x23de17[_0xf2c8('0x2d')],'type':_0x23de17[_0xf2c8('0x2e')][_0xf2c8('0x2f')]};});_0x5146e4[_0xf2c8('0x30')]=_['map'](_0x3df45d,_0xf2c8('0x28'));_0x5146e4[_0xf2c8('0x31')]=_[_0xf2c8('0x32')](_0x311349[_0xf2c8('0x31')]);_0x5146e4[_0xf2c8('0x33')]=_[_0xf2c8('0x34')](_0x5146e4['model'],_0x5146e4[_0xf2c8('0x31')]);_0x1cb979['attributes']=_[_0xf2c8('0x34')](_0x5146e4['model'],qs[_0xf2c8('0x35')](_0x311349[_0xf2c8('0x31')][_0xf2c8('0x35')]));_0x1cb979[_0xf2c8('0x36')]=_0x1cb979[_0xf2c8('0x36')]['length']?_0x1cb979[_0xf2c8('0x36')]:_0x5146e4[_0xf2c8('0x30')];if(!_0x311349['query'][_0xf2c8('0x37')](_0xf2c8('0x38'))){_0x1cb979['limit']=qs[_0xf2c8('0x1c')](_0x311349[_0xf2c8('0x31')][_0xf2c8('0x1c')]);_0x1cb979[_0xf2c8('0x1e')]=qs[_0xf2c8('0x1e')](_0x311349['query']['offset']);}_0x1cb979[_0xf2c8('0x39')]=qs[_0xf2c8('0x3a')](_0x311349[_0xf2c8('0x31')][_0xf2c8('0x3a')]);_0x1cb979[_0xf2c8('0x3b')]=qs[_0xf2c8('0x33')](_[_0xf2c8('0x3c')](_0x311349[_0xf2c8('0x31')],_0x5146e4['filters']),_0x3df45d);if(_0x311349[_0xf2c8('0x31')][_0xf2c8('0x3d')]){_0x1cb979[_0xf2c8('0x3b')]=_['merge'](_0x1cb979['where'],{'$or':_['map'](_0x3df45d,function(_0x5e646e){if(_0x5e646e[_0xf2c8('0x2e')]!=='VIRTUAL'){var _0x219318={};_0x219318[_0x5e646e['name']]={'$like':'%'+_0x311349[_0xf2c8('0x31')]['filter']+'%'};return _0x219318;}})});}_0x1cb979=_['merge']({},_0x1cb979,_0x311349[_0xf2c8('0x3e')]);var _0x523f92={'where':_0x1cb979['where']};return db[_0xf2c8('0x2b')][_0xf2c8('0x1d')](_0x523f92)['then'](function(_0x1f4115){_0x584587[_0xf2c8('0x1d')]=_0x1f4115;if(_0x311349[_0xf2c8('0x31')][_0xf2c8('0x3f')]){_0x1cb979[_0xf2c8('0x40')]=[{'all':!![]}];}return db[_0xf2c8('0x2b')]['findAll'](_0x1cb979);})['then'](function(_0x200920){_0x584587['rows']=_0x200920;return _0x584587;})[_0xf2c8('0x24')](respondWithFilteredResult(_0x4e12a2,_0x1cb979))['catch'](handleError(_0x4e12a2,null));};exports[_0xf2c8('0x41')]=function(_0x580def,_0x3e70eb){var _0x295910={'raw':!![],'where':{'id':_0x580def[_0xf2c8('0x42')]['id']}},_0x251e4c={};_0x251e4c['model']=_[_0xf2c8('0x32')](db[_0xf2c8('0x2b')]['rawAttributes']);_0x251e4c[_0xf2c8('0x31')]=_[_0xf2c8('0x32')](_0x580def[_0xf2c8('0x31')]);_0x251e4c[_0xf2c8('0x33')]=_[_0xf2c8('0x34')](_0x251e4c[_0xf2c8('0x30')],_0x251e4c[_0xf2c8('0x31')]);_0x295910['attributes']=_[_0xf2c8('0x34')](_0x251e4c[_0xf2c8('0x30')],qs[_0xf2c8('0x35')](_0x580def[_0xf2c8('0x31')]['fields']));_0x295910['attributes']=_0x295910[_0xf2c8('0x36')][_0xf2c8('0x43')]?_0x295910[_0xf2c8('0x36')]:_0x251e4c['model'];if(_0x580def[_0xf2c8('0x31')][_0xf2c8('0x3f')]){_0x295910['include']=[{'all':!![]}];}_0x295910=_['merge']({},_0x295910,_0x580def[_0xf2c8('0x3e')]);return db[_0xf2c8('0x2b')][_0xf2c8('0x44')](_0x295910)[_0xf2c8('0x24')](handleEntityNotFound(_0x3e70eb,null))['then'](respondWithResult(_0x3e70eb,null))[_0xf2c8('0x45')](handleError(_0x3e70eb,null));};exports[_0xf2c8('0x46')]=function(_0x18bbd9,_0x598997){return db[_0xf2c8('0x2b')][_0xf2c8('0x46')](_0x18bbd9[_0xf2c8('0x47')],{})['then'](respondWithResult(_0x598997,0xc9))[_0xf2c8('0x45')](handleError(_0x598997,null));};exports[_0xf2c8('0x23')]=function(_0x24d4a2,_0x3d90f5){if(_0x24d4a2[_0xf2c8('0x47')]['id']){delete _0x24d4a2['body']['id'];}return db[_0xf2c8('0x2b')]['find']({'where':{'id':_0x24d4a2['params']['id']}})[_0xf2c8('0x24')](handleEntityNotFound(_0x3d90f5,null))[_0xf2c8('0x24')](saveUpdates(_0x24d4a2[_0xf2c8('0x47')],null))[_0xf2c8('0x24')](respondWithResult(_0x3d90f5,null))[_0xf2c8('0x45')](handleError(_0x3d90f5,null));};exports['destroy']=function(_0x1c7fa5,_0x134077){return db[_0xf2c8('0x2b')][_0xf2c8('0x44')]({'where':{'id':_0x1c7fa5[_0xf2c8('0x42')]['id']}})[_0xf2c8('0x24')](handleEntityNotFound(_0x134077,null))['then'](removeEntity(_0x134077,null))['catch'](handleError(_0x134077,null));};exports[_0xf2c8('0x48')]=function(_0x334285,_0x372296){return db[_0xf2c8('0x2b')][_0xf2c8('0x48')]()[_0xf2c8('0x24')](respondWithResult(_0x372296,null))[_0xf2c8('0x45')](handleError(_0x372296,null));}; \ No newline at end of file +var _0x0960=['offset','set','Content-Range','apply','reject','save','then','destroy','name','send','index','map','JscriptyAnswerReport','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','VIRTUAL','filter','includeAll','include','rows','params','keys','rawAttributes','options','create','body','update','find','catch','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count'];(function(_0x418bf5,_0x568d7b){var _0x36d37b=function(_0x4b5537){while(--_0x4b5537){_0x418bf5['push'](_0x418bf5['shift']());}};_0x36d37b(++_0x568d7b);}(_0x0960,0xc2));var _0x0096=function(_0x43cf6c,_0x2120ed){_0x43cf6c=_0x43cf6c-0x0;var _0x4c24a4=_0x0960[_0x43cf6c];return _0x4c24a4;};'use strict';var emlformat=require(_0x0096('0x0'));var rimraf=require(_0x0096('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0096('0x2'));var rp=require(_0x0096('0x3'));var moment=require(_0x0096('0x4'));var BPromise=require(_0x0096('0x5'));var Mustache=require(_0x0096('0x6'));var util=require(_0x0096('0x7'));var path=require(_0x0096('0x8'));var sox=require(_0x0096('0x9'));var csv=require(_0x0096('0xa'));var ejs=require(_0x0096('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0096('0xc'));var squel=require('squel');var crypto=require(_0x0096('0xd'));var jsforce=require(_0x0096('0xe'));var deskjs=require(_0x0096('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0096('0x10'));var Papa=require(_0x0096('0x11'));var Redis=require(_0x0096('0x12'));var authService=require(_0x0096('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0096('0x14'));var hardwareService=require(_0x0096('0x15'));var logger=require('../../config/logger')(_0x0096('0x16'));var utils=require('../../config/utils');var config=require(_0x0096('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0096('0x18'))['db'];function respondWithStatusCode(_0x25011c,_0x55678a){_0x55678a=_0x55678a||0xcc;return function(_0x2be406){if(_0x2be406){return _0x25011c[_0x0096('0x19')](_0x55678a);}return _0x25011c['status'](_0x55678a)['end']();};}function respondWithResult(_0x753d99,_0x39b6f6){_0x39b6f6=_0x39b6f6||0xc8;return function(_0x407361){if(_0x407361){return _0x753d99[_0x0096('0x1a')](_0x39b6f6)[_0x0096('0x1b')](_0x407361);}};}function respondWithFilteredResult(_0x5c901f,_0x590c96){return function(_0x19db10){if(_0x19db10){var _0x50c804=typeof _0x590c96['offset']===_0x0096('0x1c')&&typeof _0x590c96[_0x0096('0x1d')]==='undefined';var _0x7afa5f=_0x19db10[_0x0096('0x1e')];var _0x5468e2=_0x50c804?0x0:_0x590c96[_0x0096('0x1f')];var _0x27462a=_0x50c804?_0x19db10[_0x0096('0x1e')]:_0x590c96[_0x0096('0x1f')]+_0x590c96[_0x0096('0x1d')];var _0x507463;if(_0x27462a>=_0x7afa5f){_0x27462a=_0x7afa5f;_0x507463=0xc8;}else{_0x507463=0xce;}_0x5c901f[_0x0096('0x1a')](_0x507463);return _0x5c901f[_0x0096('0x20')](_0x0096('0x21'),_0x5468e2+'-'+_0x27462a+'/'+_0x7afa5f)['json'](_0x19db10);}return null;};}function patchUpdates(_0x1f5aad){return function(_0xef7a81){try{jsonpatch[_0x0096('0x22')](_0xef7a81,_0x1f5aad,!![]);}catch(_0x4e6338){return BPromise[_0x0096('0x23')](_0x4e6338);}return _0xef7a81[_0x0096('0x24')]();};}function saveUpdates(_0x4ac6f0,_0x263951){return function(_0x29b2c2){if(_0x29b2c2){return _0x29b2c2['update'](_0x4ac6f0)[_0x0096('0x25')](function(_0xfb20d0){return _0xfb20d0;});}return null;};}function removeEntity(_0x1a8e0e,_0x5ee101){return function(_0x224748){if(_0x224748){return _0x224748[_0x0096('0x26')]()[_0x0096('0x25')](function(){_0x1a8e0e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x569a7e,_0x2ea1df){return function(_0x1a6df7){if(!_0x1a6df7){_0x569a7e['sendStatus'](0x194);}return _0x1a6df7;};}function handleError(_0x47abff,_0x230d46){_0x230d46=_0x230d46||0x1f4;return function(_0x3eac07){logger['error'](_0x3eac07['stack']);if(_0x3eac07[_0x0096('0x27')]){delete _0x3eac07[_0x0096('0x27')];}_0x47abff['status'](_0x230d46)[_0x0096('0x28')](_0x3eac07);};}exports[_0x0096('0x29')]=function(_0x204002,_0x205b79){var _0x102346={},_0x48e20f={},_0x511806={'count':0x0,'rows':[]};var _0x3b842b=_[_0x0096('0x2a')](db[_0x0096('0x2b')]['rawAttributes'],function(_0x593074){return{'name':_0x593074[_0x0096('0x2c')],'type':_0x593074['type'][_0x0096('0x2d')]};});_0x48e20f[_0x0096('0x2e')]=_[_0x0096('0x2a')](_0x3b842b,_0x0096('0x27'));_0x48e20f['query']=_['keys'](_0x204002[_0x0096('0x2f')]);_0x48e20f['filters']=_[_0x0096('0x30')](_0x48e20f[_0x0096('0x2e')],_0x48e20f[_0x0096('0x2f')]);_0x102346[_0x0096('0x31')]=_[_0x0096('0x30')](_0x48e20f[_0x0096('0x2e')],qs[_0x0096('0x32')](_0x204002[_0x0096('0x2f')][_0x0096('0x32')]));_0x102346[_0x0096('0x31')]=_0x102346[_0x0096('0x31')][_0x0096('0x33')]?_0x102346['attributes']:_0x48e20f[_0x0096('0x2e')];if(!_0x204002[_0x0096('0x2f')][_0x0096('0x34')](_0x0096('0x35'))){_0x102346[_0x0096('0x1d')]=qs[_0x0096('0x1d')](_0x204002[_0x0096('0x2f')]['limit']);_0x102346[_0x0096('0x1f')]=qs[_0x0096('0x1f')](_0x204002[_0x0096('0x2f')][_0x0096('0x1f')]);}_0x102346[_0x0096('0x36')]=qs[_0x0096('0x37')](_0x204002[_0x0096('0x2f')][_0x0096('0x37')]);_0x102346[_0x0096('0x38')]=qs[_0x0096('0x39')](_[_0x0096('0x3a')](_0x204002[_0x0096('0x2f')],_0x48e20f['filters']),_0x3b842b);if(_0x204002[_0x0096('0x2f')]['filter']){_0x102346[_0x0096('0x38')]=_['merge'](_0x102346['where'],{'$or':_[_0x0096('0x2a')](_0x3b842b,function(_0x179496){if(_0x179496[_0x0096('0x3b')]!==_0x0096('0x3c')){var _0x157a61={};_0x157a61[_0x179496['name']]={'$like':'%'+_0x204002[_0x0096('0x2f')][_0x0096('0x3d')]+'%'};return _0x157a61;}})});}_0x102346=_['merge']({},_0x102346,_0x204002['options']);var _0x505ede={'where':_0x102346[_0x0096('0x38')]};return db[_0x0096('0x2b')][_0x0096('0x1e')](_0x505ede)[_0x0096('0x25')](function(_0x5722b6){_0x511806[_0x0096('0x1e')]=_0x5722b6;if(_0x204002[_0x0096('0x2f')][_0x0096('0x3e')]){_0x102346[_0x0096('0x3f')]=[{'all':!![]}];}return db[_0x0096('0x2b')]['findAll'](_0x102346);})[_0x0096('0x25')](function(_0x2dccba){_0x511806[_0x0096('0x40')]=_0x2dccba;return _0x511806;})[_0x0096('0x25')](respondWithFilteredResult(_0x205b79,_0x102346))['catch'](handleError(_0x205b79,null));};exports['show']=function(_0x4b4ab7,_0x12d010){var _0x543e14={'raw':!![],'where':{'id':_0x4b4ab7[_0x0096('0x41')]['id']}},_0x31f7c0={};_0x31f7c0[_0x0096('0x2e')]=_[_0x0096('0x42')](db['JscriptyAnswerReport'][_0x0096('0x43')]);_0x31f7c0[_0x0096('0x2f')]=_[_0x0096('0x42')](_0x4b4ab7[_0x0096('0x2f')]);_0x31f7c0[_0x0096('0x39')]=_[_0x0096('0x30')](_0x31f7c0['model'],_0x31f7c0[_0x0096('0x2f')]);_0x543e14['attributes']=_[_0x0096('0x30')](_0x31f7c0[_0x0096('0x2e')],qs[_0x0096('0x32')](_0x4b4ab7['query'][_0x0096('0x32')]));_0x543e14[_0x0096('0x31')]=_0x543e14[_0x0096('0x31')]['length']?_0x543e14[_0x0096('0x31')]:_0x31f7c0[_0x0096('0x2e')];if(_0x4b4ab7['query'][_0x0096('0x3e')]){_0x543e14[_0x0096('0x3f')]=[{'all':!![]}];}_0x543e14=_['merge']({},_0x543e14,_0x4b4ab7[_0x0096('0x44')]);return db[_0x0096('0x2b')]['find'](_0x543e14)[_0x0096('0x25')](handleEntityNotFound(_0x12d010,null))[_0x0096('0x25')](respondWithResult(_0x12d010,null))['catch'](handleError(_0x12d010,null));};exports['create']=function(_0x34cc4d,_0x18baac){return db['JscriptyAnswerReport'][_0x0096('0x45')](_0x34cc4d[_0x0096('0x46')],{})['then'](respondWithResult(_0x18baac,0xc9))['catch'](handleError(_0x18baac,null));};exports[_0x0096('0x47')]=function(_0x392ca0,_0x29993c){if(_0x392ca0[_0x0096('0x46')]['id']){delete _0x392ca0[_0x0096('0x46')]['id'];}return db[_0x0096('0x2b')][_0x0096('0x48')]({'where':{'id':_0x392ca0[_0x0096('0x41')]['id']}})[_0x0096('0x25')](handleEntityNotFound(_0x29993c,null))[_0x0096('0x25')](saveUpdates(_0x392ca0['body'],null))['then'](respondWithResult(_0x29993c,null))[_0x0096('0x49')](handleError(_0x29993c,null));};exports[_0x0096('0x26')]=function(_0x2f5f2f,_0x7fc578){return db[_0x0096('0x2b')]['find']({'where':{'id':_0x2f5f2f[_0x0096('0x41')]['id']}})[_0x0096('0x25')](handleEntityNotFound(_0x7fc578,null))[_0x0096('0x25')](removeEntity(_0x7fc578,null))[_0x0096('0x49')](handleError(_0x7fc578,null));};exports['describe']=function(_0x56a7c8,_0x425f60){return db[_0x0096('0x2b')][_0x0096('0x4a')]()[_0x0096('0x25')](respondWithResult(_0x425f60,null))[_0x0096('0x49')](handleError(_0x425f60,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 189059d..8046a7d 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 _0x6385=['bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','moment'];(function(_0x153d7f,_0x2b78ff){var _0x170145=function(_0x46e7a1){while(--_0x46e7a1){_0x153d7f['push'](_0x153d7f['shift']());}};_0x170145(++_0x2b78ff);}(_0x6385,0xf9));var _0x5638=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6385[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x5638('0x0'));var util=require(_0x5638('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5638('0x2'));var BPromise=require(_0x5638('0x3'));var rp=require(_0x5638('0x4'));var fs=require('fs');var path=require(_0x5638('0x5'));var rimraf=require(_0x5638('0x6'));var config=require(_0x5638('0x7'));var attributes=require(_0x5638('0x8'));module[_0x5638('0x9')]=function(_0x552c17,_0x5eebc2){return _0x552c17['define'](_0x5638('0xa'),attributes,{'tableName':_0x5638('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07aa=['JscriptyAnswerReport','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x07aa,0x17d));var _0xa07a=function(_0x2f8bbf,_0x2dd4a2){_0x2f8bbf=_0x2f8bbf-0x0;var _0xab2ac2=_0x07aa[_0x2f8bbf];return _0xab2ac2;};'use strict';var _=require(_0xa07a('0x0'));var util=require('util');var logger=require(_0xa07a('0x1'))(_0xa07a('0x2'));var moment=require(_0xa07a('0x3'));var BPromise=require('bluebird');var rp=require(_0xa07a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa07a('0x5'));var config=require(_0xa07a('0x6'));var attributes=require(_0xa07a('0x7'));module[_0xa07a('0x8')]=function(_0x1514d1,_0x10bc8b){return _0x1514d1['define'](_0xa07a('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index b04d430..c249cb0 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 _0xb2b7=['then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x477491,_0x5ca700){var _0xac6aec=function(_0x180568){while(--_0x180568){_0x477491['push'](_0x477491['shift']());}};_0xac6aec(++_0x5ca700);}(_0xb2b7,0x1c2));var _0x7b2b=function(_0xf4fa33,_0x27a1fd){_0xf4fa33=_0xf4fa33-0x0;var _0x6057c5=_0xb2b7[_0xf4fa33];return _0x6057c5;};'use strict';var _=require(_0x7b2b('0x0'));var util=require(_0x7b2b('0x1'));var moment=require(_0x7b2b('0x2'));var BPromise=require(_0x7b2b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b2b('0x4'));var db=require(_0x7b2b('0x5'))['db'];var utils=require(_0x7b2b('0x6'));var logger=require(_0x7b2b('0x7'))(_0x7b2b('0x8'));var config=require(_0x7b2b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b2b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8dbee4,_0x27c7f1,_0x281d3b){return new BPromise(function(_0x7fe6d7,_0x49c98b){return client[_0x7b2b('0xb')](_0x8dbee4,_0x281d3b)[_0x7b2b('0xc')](function(_0x540b80){logger[_0x7b2b('0xd')](_0x7b2b('0xe'),_0x27c7f1,_0x7b2b('0xf'));logger[_0x7b2b('0x10')](_0x7b2b('0x11'),_0x27c7f1,_0x7b2b('0xf'),JSON[_0x7b2b('0x12')](_0x540b80));if(_0x540b80['error']){if(_0x540b80['error']['code']===0x1f4){logger[_0x7b2b('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x27c7f1,_0x540b80[_0x7b2b('0x13')][_0x7b2b('0x14')]);return _0x49c98b(_0x540b80['error'][_0x7b2b('0x14')]);}logger['error'](_0x7b2b('0xe'),_0x27c7f1,_0x540b80[_0x7b2b('0x13')][_0x7b2b('0x14')]);return _0x7fe6d7(_0x540b80[_0x7b2b('0x13')][_0x7b2b('0x14')]);}else{logger[_0x7b2b('0xd')](_0x7b2b('0xe'),_0x27c7f1,'request\x20sent');_0x7fe6d7(_0x540b80['result'][_0x7b2b('0x14')]);}})[_0x7b2b('0x15')](function(_0x430c20){logger[_0x7b2b('0x13')](_0x7b2b('0xe'),_0x27c7f1,_0x430c20);_0x49c98b(_0x430c20);});});} \ No newline at end of file +var _0x8ae0=['stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x370a0b,_0x4b6863){var _0x50c603=function(_0x12285b){while(--_0x12285b){_0x370a0b['push'](_0x370a0b['shift']());}};_0x50c603(++_0x4b6863);}(_0x8ae0,0x83));var _0x08ae=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x8ae0[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require(_0x08ae('0x0'));var moment=require(_0x08ae('0x1'));var BPromise=require(_0x08ae('0x2'));var rs=require(_0x08ae('0x3'));var fs=require('fs');var Redis=require(_0x08ae('0x4'));var db=require(_0x08ae('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x08ae('0x6'));var config=require(_0x08ae('0x7'));var jayson=require(_0x08ae('0x8'));var client=jayson['client'][_0x08ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b3e62,_0x3eb311,_0x19f4fa){return new BPromise(function(_0x5f1360,_0x3a8f64){return client[_0x08ae('0xa')](_0x3b3e62,_0x19f4fa)['then'](function(_0x22d99f){logger[_0x08ae('0xb')](_0x08ae('0xc'),_0x3eb311,_0x08ae('0xd'));logger[_0x08ae('0xe')](_0x08ae('0xf'),_0x3eb311,_0x08ae('0xd'),JSON[_0x08ae('0x10')](_0x22d99f));if(_0x22d99f[_0x08ae('0x11')]){if(_0x22d99f['error'][_0x08ae('0x12')]===0x1f4){logger[_0x08ae('0x11')](_0x08ae('0xc'),_0x3eb311,_0x22d99f['error'][_0x08ae('0x13')]);return _0x3a8f64(_0x22d99f[_0x08ae('0x11')]['message']);}logger[_0x08ae('0x11')](_0x08ae('0xc'),_0x3eb311,_0x22d99f[_0x08ae('0x11')][_0x08ae('0x13')]);return _0x5f1360(_0x22d99f[_0x08ae('0x11')][_0x08ae('0x13')]);}else{logger[_0x08ae('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3eb311,'request\x20sent');_0x5f1360(_0x22d99f['result']['message']);}})[_0x08ae('0x14')](function(_0x1df61a){logger[_0x08ae('0x11')](_0x08ae('0xc'),_0x3eb311,_0x1df61a);_0x3a8f64(_0x1df61a);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 609ca2d..5c5dd59 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 _0xa692=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','clone','update','delete','exports'];(function(_0x29075c,_0x11c6f1){var _0x5c2635=function(_0x4b7083){while(--_0x4b7083){_0x29075c['push'](_0x29075c['shift']());}};_0x5c2635(++_0x11c6f1);}(_0xa692,0x1cb));var _0x2a69=function(_0x3b29ce,_0x13de5f){_0x3b29ce=_0x3b29ce-0x0;var _0x57b233=_0xa692[_0x3b29ce];return _0x57b233;};'use strict';var multer=require(_0x2a69('0x0'));var util=require(_0x2a69('0x1'));var path=require(_0x2a69('0x2'));var timeout=require(_0x2a69('0x3'));var express=require(_0x2a69('0x4'));var router=express[_0x2a69('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2a69('0x6'));var interaction=require(_0x2a69('0x7'));var config=require('../../config/environment');var controller=require(_0x2a69('0x8'));router[_0x2a69('0x9')]('/',auth[_0x2a69('0xa')](),controller[_0x2a69('0xb')]);router[_0x2a69('0x9')](_0x2a69('0xc'),auth[_0x2a69('0xa')](),controller[_0x2a69('0xd')]);router['get'](_0x2a69('0xe'),auth[_0x2a69('0xa')](),controller[_0x2a69('0xf')]);router[_0x2a69('0x9')](_0x2a69('0x10'),auth['isAuthenticated'](),controller[_0x2a69('0x11')]);router[_0x2a69('0x9')](_0x2a69('0x12'),auth[_0x2a69('0xa')](),timeout(_0x2a69('0x13')),controller[_0x2a69('0x14')]);router[_0x2a69('0x15')]('/',auth[_0x2a69('0xa')](),controller['create']);router[_0x2a69('0x15')](_0x2a69('0x16'),auth[_0x2a69('0xa')](),controller[_0x2a69('0x17')]);router['put'](_0x2a69('0xc'),auth[_0x2a69('0xa')](),controller[_0x2a69('0x18')]);router[_0x2a69('0x19')]('/:id',auth[_0x2a69('0xa')](),controller['destroy']);module[_0x2a69('0x1a')]=router; \ No newline at end of file +var _0xb80e=['/:id/summary','getSummary','create','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','index','get','/:id','show','/:id/sessions','getSessions','/:id/answers','isAuthenticated','getAnswers'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xb80e,0xe1));var _0xeb80=function(_0x475dd5,_0x3db81c){_0x475dd5=_0x475dd5-0x0;var _0x249fae=_0xb80e[_0x475dd5];return _0x249fae;};'use strict';var multer=require(_0xeb80('0x0'));var util=require(_0xeb80('0x1'));var path=require(_0xeb80('0x2'));var timeout=require(_0xeb80('0x3'));var express=require('express');var router=express[_0xeb80('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xeb80('0x5'));var interaction=require(_0xeb80('0x6'));var config=require(_0xeb80('0x7'));var controller=require(_0xeb80('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xeb80('0x9')]);router[_0xeb80('0xa')](_0xeb80('0xb'),auth['isAuthenticated'](),controller[_0xeb80('0xc')]);router[_0xeb80('0xa')](_0xeb80('0xd'),auth['isAuthenticated'](),controller[_0xeb80('0xe')]);router[_0xeb80('0xa')](_0xeb80('0xf'),auth[_0xeb80('0x10')](),controller[_0xeb80('0x11')]);router[_0xeb80('0xa')](_0xeb80('0x12'),auth[_0xeb80('0x10')](),timeout('30s'),controller[_0xeb80('0x13')]);router['post']('/',auth[_0xeb80('0x10')](),controller[_0xeb80('0x14')]);router['post']('/:id/clone',auth[_0xeb80('0x10')](),controller[_0xeb80('0x15')]);router[_0xeb80('0x16')](_0xeb80('0xb'),auth[_0xeb80('0x10')](),controller[_0xeb80('0x17')]);router[_0xeb80('0x18')]('/:id',auth[_0xeb80('0x10')](),controller[_0xeb80('0x19')]);module[_0xeb80('0x1a')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 2817391..91e6151 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 _0xe838=['STRING','name','TEXT','long','isObjectLike','formData','stringify','isString','setDataValue','format','description','sequelize','lodash'];(function(_0xe3dd91,_0x424ac9){var _0x1940ab=function(_0xe1c421){while(--_0xe1c421){_0xe3dd91['push'](_0xe3dd91['shift']());}};_0x1940ab(++_0x424ac9);}(_0xe838,0xb4));var _0x8e83=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe838[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x8e83('0x0'));var _=require(_0x8e83('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0x8e83('0x2')],'unique':_0x8e83('0x3')},'description':{'type':Sequelize[_0x8e83('0x2')]},'formData':{'type':Sequelize[_0x8e83('0x4')](_0x8e83('0x5')),'set':function(_0x5b53d4){if(_[_0x8e83('0x6')](_0x5b53d4)){this['setDataValue'](_0x8e83('0x7'),JSON[_0x8e83('0x8')](_0x5b53d4));}else if(_[_0x8e83('0x9')](_0x5b53d4)){this['setDataValue'](_0x8e83('0x7'),_0x5b53d4);}else{this[_0x8e83('0xa')](_0x8e83('0x7'),util[_0x8e83('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue']('name')||'',this['getDataValue'](_0x8e83('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7f23=['STRING','TEXT','setDataValue','stringify','formData','format','getDataValue','description','BOOLEAN','sequelize','util'];(function(_0x1ebc27,_0x15b961){var _0x1d0aeb=function(_0x1de287){while(--_0x1de287){_0x1ebc27['push'](_0x1ebc27['shift']());}};_0x1d0aeb(++_0x15b961);}(_0x7f23,0x169));var _0x37f2=function(_0x3cb859,_0x2cc431){_0x3cb859=_0x3cb859-0x0;var _0x14c001=_0x7f23[_0x3cb859];return _0x14c001;};'use strict';var Sequelize=require(_0x37f2('0x0'));var _=require('lodash');var util=require(_0x37f2('0x1'));module['exports']={'name':{'type':Sequelize[_0x37f2('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x37f2('0x2')]},'formData':{'type':Sequelize[_0x37f2('0x3')]('long'),'set':function(_0x485fd0){if(_['isObjectLike'](_0x485fd0)){this[_0x37f2('0x4')]('formData',JSON[_0x37f2('0x5')](_0x485fd0));}else if(_['isString'](_0x485fd0)){this['setDataValue']('formData',_0x485fd0);}else{this[_0x37f2('0x4')](_0x37f2('0x6'),util[_0x37f2('0x7')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x37f2('0x8')]('name')||'',this['getDataValue'](_0x37f2('0x9'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x37f2('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index a5197fd..79e2390 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 _0xfce5=['to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','destroy','then','Projects','UserProfileResource','sendStatus','error','stack','send','index','map','rawAttributes','key','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','JscriptyProject','include','findAll','rows','catch','show','params','intersection','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','role','autoAssociation','getSessions','JscriptySessionReport','order','ProjectId','getAnswers','findOne','JscriptyAnswerReport','indexOf','toString','replace','getSummary','startTime','parse','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xfce5,0x70));var _0x5fce=function(_0x3a7650,_0x458946){_0x3a7650=_0x3a7650-0x0;var _0x136de7=_0xfce5[_0x3a7650];return _0x136de7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5fce('0x0'));var zipdir=require(_0x5fce('0x1'));var jsonpatch=require(_0x5fce('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5fce('0x3'));var Mustache=require(_0x5fce('0x4'));var util=require(_0x5fce('0x5'));var path=require(_0x5fce('0x6'));var sox=require(_0x5fce('0x7'));var csv=require(_0x5fce('0x8'));var ejs=require(_0x5fce('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5fce('0xa'));var squel=require('squel');var crypto=require(_0x5fce('0xb'));var jsforce=require(_0x5fce('0xc'));var deskjs=require(_0x5fce('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5fce('0xe'));var Papa=require('papaparse');var Redis=require(_0x5fce('0xf'));var authService=require(_0x5fce('0x10'));var qs=require(_0x5fce('0x11'));var as=require(_0x5fce('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5fce('0x13'));var utils=require('../../config/utils');var config=require(_0x5fce('0x14'));var licenseUtil=require(_0x5fce('0x15'));var db=require(_0x5fce('0x16'))['db'];function respondWithStatusCode(_0x1564bd,_0x31a805){_0x31a805=_0x31a805||0xcc;return function(_0xdc276a){if(_0xdc276a){return _0x1564bd['sendStatus'](_0x31a805);}return _0x1564bd['status'](_0x31a805)[_0x5fce('0x17')]();};}function respondWithResult(_0x3ece89,_0x572d3a){_0x572d3a=_0x572d3a||0xc8;return function(_0x56ce72){if(_0x56ce72){return _0x3ece89[_0x5fce('0x18')](_0x572d3a)['json'](_0x56ce72);}};}function respondWithFilteredResult(_0x261744,_0x48d88c){return function(_0x4b581a){if(_0x4b581a){var _0x39d155=typeof _0x48d88c[_0x5fce('0x19')]===_0x5fce('0x1a')&&typeof _0x48d88c['limit']===_0x5fce('0x1a');var _0x244061=_0x4b581a[_0x5fce('0x1b')];var _0x4eeb0a=_0x39d155?0x0:_0x48d88c[_0x5fce('0x19')];var _0x4e58c1=_0x39d155?_0x4b581a[_0x5fce('0x1b')]:_0x48d88c[_0x5fce('0x19')]+_0x48d88c[_0x5fce('0x1c')];var _0x391624;if(_0x4e58c1>=_0x244061){_0x4e58c1=_0x244061;_0x391624=0xc8;}else{_0x391624=0xce;}_0x261744['status'](_0x391624);return _0x261744[_0x5fce('0x1d')](_0x5fce('0x1e'),_0x4eeb0a+'-'+_0x4e58c1+'/'+_0x244061)[_0x5fce('0x1f')](_0x4b581a);}return null;};}function patchUpdates(_0xf60840){return function(_0x2bf621){try{jsonpatch[_0x5fce('0x20')](_0x2bf621,_0xf60840,!![]);}catch(_0x51274f){return BPromise['reject'](_0x51274f);}return _0x2bf621[_0x5fce('0x21')]();};}function saveUpdates(_0x200f8c,_0x957441){return function(_0x315389){if(_0x315389){return _0x315389[_0x5fce('0x22')](_0x200f8c)['then'](function(_0x482d72){return _0x482d72;});}return null;};}function removeEntity(_0x4fbd81,_0x543434){return function(_0x7d56d2){if(_0x7d56d2){return _0x7d56d2[_0x5fce('0x23')]()[_0x5fce('0x24')](function(){var _0x166c50=_0x7d56d2['get']({'plain':!![]});var _0x3c6706=_0x5fce('0x25');return db[_0x5fce('0x26')][_0x5fce('0x23')]({'where':{'type':_0x3c6706,'resourceId':_0x166c50['id']}})[_0x5fce('0x24')](function(){return _0x7d56d2;});})[_0x5fce('0x24')](function(){_0x4fbd81[_0x5fce('0x18')](0xcc)[_0x5fce('0x17')]();});}};}function handleEntityNotFound(_0x4a3ae7,_0x258522){return function(_0x46dfde){if(!_0x46dfde){_0x4a3ae7[_0x5fce('0x27')](0x194);}return _0x46dfde;};}function handleError(_0x4554df,_0x1ba49f){_0x1ba49f=_0x1ba49f||0x1f4;return function(_0x199d6e){logger[_0x5fce('0x28')](_0x199d6e[_0x5fce('0x29')]);if(_0x199d6e['name']){delete _0x199d6e['name'];}_0x4554df[_0x5fce('0x18')](_0x1ba49f)[_0x5fce('0x2a')](_0x199d6e);};}exports[_0x5fce('0x2b')]=function(_0x31f910,_0x1681f3){var _0x5f35c5={},_0x3cd00f={},_0x53608d={'count':0x0,'rows':[]};var _0x395030=_[_0x5fce('0x2c')](db['JscriptyProject'][_0x5fce('0x2d')],function(_0x5cffd7){return{'name':_0x5cffd7['fieldName'],'type':_0x5cffd7['type'][_0x5fce('0x2e')]};});_0x3cd00f[_0x5fce('0x2f')]=_['map'](_0x395030,_0x5fce('0x30'));_0x3cd00f[_0x5fce('0x31')]=_[_0x5fce('0x32')](_0x31f910[_0x5fce('0x31')]);_0x3cd00f[_0x5fce('0x33')]=_['intersection'](_0x3cd00f[_0x5fce('0x2f')],_0x3cd00f[_0x5fce('0x31')]);_0x5f35c5[_0x5fce('0x34')]=_['intersection'](_0x3cd00f[_0x5fce('0x2f')],qs[_0x5fce('0x35')](_0x31f910[_0x5fce('0x31')][_0x5fce('0x35')]));_0x5f35c5[_0x5fce('0x34')]=_0x5f35c5['attributes'][_0x5fce('0x36')]?_0x5f35c5['attributes']:_0x3cd00f[_0x5fce('0x2f')];if(!_0x31f910[_0x5fce('0x31')][_0x5fce('0x37')](_0x5fce('0x38'))){_0x5f35c5[_0x5fce('0x1c')]=qs['limit'](_0x31f910[_0x5fce('0x31')][_0x5fce('0x1c')]);_0x5f35c5[_0x5fce('0x19')]=qs['offset'](_0x31f910['query']['offset']);}_0x5f35c5['order']=qs[_0x5fce('0x39')](_0x31f910[_0x5fce('0x31')][_0x5fce('0x39')]);_0x5f35c5[_0x5fce('0x3a')]=qs[_0x5fce('0x33')](_[_0x5fce('0x3b')](_0x31f910[_0x5fce('0x31')],_0x3cd00f[_0x5fce('0x33')]),_0x395030);if(_0x31f910[_0x5fce('0x31')][_0x5fce('0x3c')]){_0x5f35c5[_0x5fce('0x3a')]=_[_0x5fce('0x3d')](_0x5f35c5[_0x5fce('0x3a')],{'$or':_[_0x5fce('0x2c')](_0x395030,function(_0x22530a){if(_0x22530a['type']!==_0x5fce('0x3e')){var _0x4dda2f={};_0x4dda2f[_0x22530a[_0x5fce('0x30')]]={'$like':'%'+_0x31f910[_0x5fce('0x31')][_0x5fce('0x3c')]+'%'};return _0x4dda2f;}})});}_0x5f35c5=_['merge']({},_0x5f35c5,_0x31f910[_0x5fce('0x3f')]);var _0x2256a2={'where':_0x5f35c5['where']};return db[_0x5fce('0x40')]['count'](_0x2256a2)[_0x5fce('0x24')](function(_0x3cd113){_0x53608d[_0x5fce('0x1b')]=_0x3cd113;if(_0x31f910['query']['includeAll']){_0x5f35c5[_0x5fce('0x41')]=[{'all':!![]}];}return db['JscriptyProject'][_0x5fce('0x42')](_0x5f35c5);})[_0x5fce('0x24')](function(_0x10d1e5){_0x53608d[_0x5fce('0x43')]=_0x10d1e5;return _0x53608d;})[_0x5fce('0x24')](respondWithFilteredResult(_0x1681f3,_0x5f35c5))[_0x5fce('0x44')](handleError(_0x1681f3,null));};exports[_0x5fce('0x45')]=function(_0x91d1a2,_0x180fd2){var _0x189358={'raw':![],'where':{'id':_0x91d1a2[_0x5fce('0x46')]['id']}},_0x4358d8={};_0x4358d8[_0x5fce('0x2f')]=_[_0x5fce('0x32')](db[_0x5fce('0x40')][_0x5fce('0x2d')]);_0x4358d8[_0x5fce('0x31')]=_[_0x5fce('0x32')](_0x91d1a2[_0x5fce('0x31')]);_0x4358d8['filters']=_[_0x5fce('0x47')](_0x4358d8[_0x5fce('0x2f')],_0x4358d8['query']);_0x189358[_0x5fce('0x34')]=_[_0x5fce('0x47')](_0x4358d8[_0x5fce('0x2f')],qs[_0x5fce('0x35')](_0x91d1a2[_0x5fce('0x31')][_0x5fce('0x35')]));_0x189358[_0x5fce('0x34')]=_0x189358[_0x5fce('0x34')][_0x5fce('0x36')]?_0x189358[_0x5fce('0x34')]:_0x4358d8[_0x5fce('0x2f')];if(_0x91d1a2['query'][_0x5fce('0x48')]){_0x189358[_0x5fce('0x41')]=[{'all':!![]}];}_0x189358=_[_0x5fce('0x3d')]({},_0x189358,_0x91d1a2[_0x5fce('0x3f')]);return db[_0x5fce('0x40')][_0x5fce('0x49')](_0x189358)['then'](handleEntityNotFound(_0x180fd2,null))[_0x5fce('0x24')](respondWithResult(_0x180fd2,null))[_0x5fce('0x44')](handleError(_0x180fd2,null));};exports[_0x5fce('0x4a')]=function(_0x462f77,_0x315ae3){return db['JscriptyProject'][_0x5fce('0x4a')](_0x462f77['body'],{})[_0x5fce('0x24')](function(_0x35a193){var _0x2c2089=_0x462f77['user']['get']({'plain':!![]});if(!_0x2c2089)throw new Error(_0x5fce('0x4b'));if(_0x2c2089['role']===_0x5fce('0x4c')){var _0x566e9c=_0x35a193[_0x5fce('0x4d')]({'plain':!![]});var _0x674612=_0x5fce('0x25');return db[_0x5fce('0x4e')][_0x5fce('0x49')]({'where':{'name':_0x674612,'userProfileId':_0x2c2089[_0x5fce('0x4f')]},'raw':!![]})['then'](function(_0x104693){if(_0x104693&&_0x104693['autoAssociation']===0x0){return db[_0x5fce('0x26')][_0x5fce('0x4a')]({'name':_0x566e9c[_0x5fce('0x30')],'resourceId':_0x566e9c['id'],'type':_0x104693[_0x5fce('0x30')],'sectionId':_0x104693['id']},{})[_0x5fce('0x24')](function(){return _0x35a193;});}else{return _0x35a193;}})[_0x5fce('0x44')](function(_0x5744f5){logger['error'](_0x5fce('0x50'),_0x5744f5);throw _0x5744f5;});}return _0x35a193;})['then'](respondWithResult(_0x315ae3,0xc9))[_0x5fce('0x44')](handleError(_0x315ae3,null));};exports[_0x5fce('0x51')]=function(_0x515fac,_0x286771){var _0xf520b8={'where':{'id':_0x515fac[_0x5fce('0x46')]['id']}},_0x2d3cb6={};_0x2d3cb6[_0x5fce('0x2f')]=_[_0x5fce('0x32')](db[_0x5fce('0x40')][_0x5fce('0x2d')]);_0xf520b8['attributes']=_[_0x5fce('0x47')](_0x2d3cb6[_0x5fce('0x2f')],qs['fields'](_0x515fac['query'][_0x5fce('0x35')]));_0xf520b8[_0x5fce('0x34')]=_0xf520b8[_0x5fce('0x34')]['length']?_0xf520b8[_0x5fce('0x34')]:_0x2d3cb6['model'];if(_0x515fac[_0x5fce('0x31')][_0x5fce('0x48')]){_0xf520b8[_0x5fce('0x41')]=[{'all':!![]}];}_0xf520b8=_[_0x5fce('0x3d')]({},_0xf520b8,_0x515fac[_0x5fce('0x3f')]);return db[_0x5fce('0x40')][_0x5fce('0x49')](_0xf520b8)['then'](handleEntityNotFound(_0x286771,null))[_0x5fce('0x24')](function(_0xdd07d7){if(_0xdd07d7){var _0x44554e=_0xdd07d7['get']({'plain':!![]});_0x44554e=qs[_0x5fce('0x52')](_0x44554e,['id',_0x5fce('0x53'),_0x5fce('0x54')]);_0x515fac['body']=_[_0x5fce('0x52')](_0x515fac[_0x5fce('0x55')],['id','createdAt',_0x5fce('0x54')]);return db[_0x5fce('0x40')]['create'](_['merge'](_0x44554e,_0x515fac[_0x5fce('0x55')]),{'include':_0x515fac[_0x5fce('0x31')][_0x5fce('0x48')]?[{'all':!![]}]:undefined})[_0x5fce('0x24')](function(_0x8e8808){var _0x5b601e=_0x515fac[_0x5fce('0x4c')][_0x5fce('0x4d')]({'plain':!![]});if(!_0x5b601e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b601e[_0x5fce('0x56')]===_0x5fce('0x4c')){var _0xbdf9da=_0x8e8808['get']({'plain':!![]});var _0x43fbea=_0x5fce('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x43fbea,'userProfileId':_0x5b601e[_0x5fce('0x4f')]},'raw':!![]})[_0x5fce('0x24')](function(_0x587b11){if(_0x587b11&&_0x587b11[_0x5fce('0x57')]===0x0){return db['UserProfileResource'][_0x5fce('0x4a')]({'name':_0xbdf9da[_0x5fce('0x30')],'resourceId':_0xbdf9da['id'],'type':_0x587b11[_0x5fce('0x30')],'sectionId':_0x587b11['id']},{})['then'](function(){return _0x8e8808;});}else{return _0x8e8808;}})['catch'](function(_0x3e05f7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e05f7);throw _0x3e05f7;});}return _0x8e8808;});}})['then'](respondWithResult(_0x286771,0xc9))[_0x5fce('0x44')](handleError(_0x286771,null));};exports[_0x5fce('0x22')]=function(_0x598e78,_0x4b5471){if(_0x598e78[_0x5fce('0x55')]['id']){delete _0x598e78[_0x5fce('0x55')]['id'];}return db[_0x5fce('0x40')]['find']({'where':{'id':_0x598e78[_0x5fce('0x46')]['id']}})[_0x5fce('0x24')](handleEntityNotFound(_0x4b5471,null))[_0x5fce('0x24')](saveUpdates(_0x598e78[_0x5fce('0x55')],null))[_0x5fce('0x24')](respondWithResult(_0x4b5471,null))[_0x5fce('0x44')](handleError(_0x4b5471,null));};exports['destroy']=function(_0x2cfd0b,_0x1193b3){return db[_0x5fce('0x40')][_0x5fce('0x49')]({'where':{'id':_0x2cfd0b['params']['id']}})[_0x5fce('0x24')](handleEntityNotFound(_0x1193b3,null))[_0x5fce('0x24')](removeEntity(_0x1193b3,null))[_0x5fce('0x44')](handleError(_0x1193b3,null));};exports[_0x5fce('0x58')]=function(_0xe47fb0,_0x5a13d3,_0x3b21f9){var _0xc775ee={'raw':!![],'where':{}};var _0x5c8b10={};var _0x3f7d8e={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0xe47fb0[_0x5fce('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a13d3,null))[_0x5fce('0x24')](function(_0x8fe2dc){if(_0x8fe2dc){_0x5c8b10[_0x5fce('0x2f')]=_[_0x5fce('0x32')](db[_0x5fce('0x59')][_0x5fce('0x2d')]);_0x5c8b10[_0x5fce('0x31')]=_[_0x5fce('0x32')](_0xe47fb0[_0x5fce('0x31')]);_0x5c8b10[_0x5fce('0x33')]=_[_0x5fce('0x47')](_0x5c8b10[_0x5fce('0x2f')],_0x5c8b10['query']);_0xc775ee[_0x5fce('0x34')]=_[_0x5fce('0x47')](_0x5c8b10[_0x5fce('0x2f')],qs[_0x5fce('0x35')](_0xe47fb0['query'][_0x5fce('0x35')]));_0xc775ee[_0x5fce('0x34')]=_0xc775ee[_0x5fce('0x34')]['length']?_0xc775ee[_0x5fce('0x34')]:_0x5c8b10[_0x5fce('0x2f')];if(!_0xe47fb0[_0x5fce('0x31')][_0x5fce('0x37')]('nolimit')){_0xc775ee[_0x5fce('0x1c')]=qs[_0x5fce('0x1c')](_0xe47fb0[_0x5fce('0x31')][_0x5fce('0x1c')]);_0xc775ee[_0x5fce('0x19')]=qs[_0x5fce('0x19')](_0xe47fb0[_0x5fce('0x31')][_0x5fce('0x19')]);}_0xc775ee[_0x5fce('0x5a')]=qs[_0x5fce('0x39')](_0xe47fb0[_0x5fce('0x31')][_0x5fce('0x39')]);_0xc775ee['where']=qs[_0x5fce('0x33')](_[_0x5fce('0x3b')](_0xe47fb0['query'],_0x5c8b10[_0x5fce('0x33')]));_0xc775ee[_0x5fce('0x3a')][_0x5fce('0x5b')]=_0x8fe2dc['id'];if(_0xe47fb0[_0x5fce('0x31')][_0x5fce('0x3c')]){_0xc775ee[_0x5fce('0x3a')]=_['merge'](_0xc775ee['where'],{'$or':_[_0x5fce('0x2c')](_0xc775ee[_0x5fce('0x34')],function(_0x11b02d){var _0x18c3d0={};_0x18c3d0[_0x11b02d]={'$like':'%'+_0xe47fb0[_0x5fce('0x31')][_0x5fce('0x3c')]+'%'};return _0x18c3d0;})});}_0xc775ee=_[_0x5fce('0x3d')]({},_0xc775ee,_0xe47fb0[_0x5fce('0x3f')]);return db[_0x5fce('0x59')][_0x5fce('0x1b')]({'where':_0xc775ee['where']})[_0x5fce('0x24')](function(_0x4138ab){_0x3f7d8e[_0x5fce('0x1b')]=_0x4138ab;if(_0xe47fb0['query'][_0x5fce('0x48')]){_0xc775ee['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x5fce('0x42')](_0xc775ee);})[_0x5fce('0x24')](function(_0x4b5063){_0x3f7d8e[_0x5fce('0x43')]=_0x4b5063;return _0x3f7d8e;});}})[_0x5fce('0x24')](respondWithFilteredResult(_0x5a13d3,_0xc775ee))[_0x5fce('0x44')](handleError(_0x5a13d3,null));};exports[_0x5fce('0x5c')]=function(_0x6c41fd,_0x298ea3,_0x13f310){var _0x322dd6={'raw':!![],'where':{}};var _0x5a2c2f={};var _0x480afe={'count':0x0,'rows':[]};return db[_0x5fce('0x40')][_0x5fce('0x5d')]({'where':{'id':_0x6c41fd[_0x5fce('0x46')]['id']}})[_0x5fce('0x24')](handleEntityNotFound(_0x298ea3,null))[_0x5fce('0x24')](function(_0x42afdc){if(_0x42afdc){_0x5a2c2f[_0x5fce('0x2f')]=_[_0x5fce('0x32')](db[_0x5fce('0x5e')][_0x5fce('0x2d')]);_0x5a2c2f[_0x5fce('0x31')]=_[_0x5fce('0x32')](_0x6c41fd['query']);_0x5a2c2f[_0x5fce('0x33')]=_['intersection'](_0x5a2c2f[_0x5fce('0x2f')],_0x5a2c2f['query']);_0x322dd6[_0x5fce('0x34')]=_[_0x5fce('0x47')](_0x5a2c2f[_0x5fce('0x2f')],qs[_0x5fce('0x35')](_0x6c41fd[_0x5fce('0x31')][_0x5fce('0x35')]));_0x322dd6[_0x5fce('0x34')]=_0x322dd6[_0x5fce('0x34')][_0x5fce('0x36')]?_0x322dd6[_0x5fce('0x34')]:_0x5a2c2f['model'];if(!_0x6c41fd['query'][_0x5fce('0x37')](_0x5fce('0x38'))){_0x322dd6[_0x5fce('0x1c')]=qs[_0x5fce('0x1c')](_0x6c41fd[_0x5fce('0x31')][_0x5fce('0x1c')]);_0x322dd6['offset']=qs[_0x5fce('0x19')](_0x6c41fd['query'][_0x5fce('0x19')]);}_0x322dd6[_0x5fce('0x5a')]=qs[_0x5fce('0x39')](_0x6c41fd[_0x5fce('0x31')][_0x5fce('0x39')]);_0x322dd6[_0x5fce('0x3a')]=qs['filters'](_[_0x5fce('0x3b')](_0x6c41fd[_0x5fce('0x31')],_0x5a2c2f[_0x5fce('0x33')]));_0x322dd6[_0x5fce('0x3a')][_0x5fce('0x5b')]=_0x42afdc['id'];if(_0x6c41fd['query'][_0x5fce('0x3c')]){_0x322dd6[_0x5fce('0x3a')]=_[_0x5fce('0x3d')](_0x322dd6[_0x5fce('0x3a')],{'$or':_[_0x5fce('0x2c')](_0x322dd6['attributes'],function(_0x372a2c){var _0x555fdb={};_0x555fdb[_0x372a2c]={'$like':'%'+_0x6c41fd[_0x5fce('0x31')][_0x5fce('0x3c')]+'%'};return _0x555fdb;})});}_0x322dd6=_[_0x5fce('0x3d')]({},_0x322dd6,_0x6c41fd['options']);return db[_0x5fce('0x5e')][_0x5fce('0x1b')]({'where':_0x322dd6['where']})[_0x5fce('0x24')](function(_0x1b32fe){_0x480afe[_0x5fce('0x1b')]=_0x1b32fe;if(_0x6c41fd[_0x5fce('0x31')][_0x5fce('0x48')]){_0x322dd6[_0x5fce('0x41')]=[{'all':!![]}];}return db[_0x5fce('0x5e')]['findAll'](_0x322dd6);})[_0x5fce('0x24')](function(_0x27ca35){_0x480afe[_0x5fce('0x43')]=_0x27ca35;return _0x480afe;});}})['then'](respondWithFilteredResult(_0x298ea3,_0x322dd6))[_0x5fce('0x44')](handleError(_0x298ea3,null));};function char(_0x2aa810){return'number'===typeof _0x2aa810?String['fromCharCode'][_0x5fce('0x20')](null,arguments):_0x2aa810;}function needsEncapsulation(_0x106d30){return!!_0x106d30&&(_0x106d30['toString']()[_0x5fce('0x5f')](char(0xd))>=0x0||_0x106d30[_0x5fce('0x60')]()[_0x5fce('0x5f')](char(0xa))>=0x0||_0x106d30[_0x5fce('0x60')]()[_0x5fce('0x5f')](char(0x2c))>=0x0||_0x106d30[_0x5fce('0x60')]()[_0x5fce('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x26458c){var _0x4fd17a=char(0x22),_0xef2ea2='\x5c'+char(0x22),_0x2b173e=_0x26458c[_0x5fce('0x60')]()[_0x5fce('0x61')](new RegExp(_0x4fd17a,'g'),_0xef2ea2);return _0x4fd17a+_0x2b173e+_0x4fd17a;}exports[_0x5fce('0x62')]=function(_0xeab08a,_0x1eebfd,_0x21ff6e){var _0xfafb53,_0x34fde7;var _0x16f8f3={'where':{'ProjectId':_0xeab08a[_0x5fce('0x46')]['id']}};if(_0xeab08a[_0x5fce('0x31')][_0x5fce('0x63')]){_0x16f8f3[_0x5fce('0x3a')]['starttime']=JSON[_0x5fce('0x64')](_0xeab08a['query']['startTime']);}return db['JscriptySessionReport'][_0x5fce('0x42')](_0x16f8f3)['then'](handleEntityNotFound(_0x1eebfd,null))[_0x5fce('0x24')](function(_0x57d199){if(_0x57d199){_0xfafb53=_0x57d199;return db['JscriptyQuestionReport'][_0x5fce('0x42')]({'where':{'SessionId':{'$in':_[_0x5fce('0x2c')](_0xfafb53,'id')},'ProjectId':_0xeab08a[_0x5fce('0x46')]['id']},'order':_0x5fce('0x65')});}})[_0x5fce('0x24')](handleEntityNotFound(_0x1eebfd,null))['then'](function(_0x421755){if(_0x421755){_0x34fde7=_0x421755;var _0x4690c1={};for(var _0x38a712=0x0,_0x6fef6e=_0x34fde7[_0x5fce('0x36')];_0x38a712<_0x6fef6e;_0x38a712++){if(!_0x4690c1[_0x5fce('0x37')](_0x34fde7[_0x38a712]['questionId'])){_0x4690c1[_0x34fde7[_0x38a712][_0x5fce('0x66')]]=needsEncapsulation(_0x34fde7[_0x38a712]['question'])?encapsulate(_0x34fde7[_0x38a712][_0x5fce('0x67')]):_0x34fde7[_0x38a712]['question'];}}var _0x2d0338=[],_0x326f47={};for(var _0x3e3967=0x0,_0x1e6eaf=_0xfafb53['length'];_0x3e3967<_0x1e6eaf;_0x3e3967++){_0x326f47={'ProjectId':_0xeab08a[_0x5fce('0x46')]['id'],'SessionId':_0xfafb53[_0x3e3967]['id'],'StartTime':moment(_0xfafb53[_0x3e3967][_0x5fce('0x68')])[_0x5fce('0x69')](_0x5fce('0x6a'))};for(var _0x5ef5fb=0x0,_0x5e75db=_0x34fde7[_0x5fce('0x36')];_0x5ef5fb<_0x5e75db;_0x5ef5fb++){if(_0x34fde7[_0x5ef5fb][_0x5fce('0x6b')]==_0xfafb53[_0x3e3967]['id']&&_0x4690c1[_0x5fce('0x37')](_0x34fde7[_0x5ef5fb]['questionId'])){_0x326f47[_0x4690c1[_0x34fde7[_0x5ef5fb]['questionId']]]=_0x34fde7[_0x5ef5fb][_0x5fce('0x6c')];}}for(var _0xf89264 in _0x4690c1){if(!_0x326f47['hasOwnProperty'](_0x4690c1[_0xf89264])){_0x326f47[_0x4690c1[_0xf89264]]=null;}}_0x2d0338[_0x5fce('0x6d')](_0x326f47);}return _0x2d0338;}})[_0x5fce('0x24')](function(_0x473293){if(!_[_0x5fce('0x6e')](_0x473293)){var _0x5d9fcb=toCsv(_0x473293);var _0x7306fb=Date[_0x5fce('0x6f')]();fs[_0x5fce('0x70')](util[_0x5fce('0x69')](_0x5fce('0x71'),_0xeab08a['params']['id'],_0x7306fb),_0x5d9fcb);_0x1eebfd[_0x5fce('0x72')](_0x5fce('0x73'),_0x5fce('0x74')+util['format'](_0x5fce('0x75'),_0xeab08a['params']['id'],_0x7306fb));_0x1eebfd['setHeader']('Content-type',_0x5fce('0x76'));return _0x1eebfd[_0x5fce('0x77')](util[_0x5fce('0x69')](_0x5fce('0x71'),_0xeab08a[_0x5fce('0x46')]['id'],_0x7306fb));}else{return _0x1eebfd[_0x5fce('0x27')](0xcc);}})['catch'](handleError(_0x1eebfd,null));}; \ No newline at end of file +var _0x9037=['JscriptyProject','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','clone','rawAttributes','omit','createdAt','updatedAt','body','autoAssociation','update','getSessions','JscriptySessionReport','nolimit','ProjectId','getAnswers','findOne','JscriptyAnswerReport','number','apply','toString','indexOf','replace','getSummary','startTime','findAll','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','Projects','UserProfileResource','sendStatus','error','name','index','map'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9037,0xbf));var _0x7903=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9037[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7903('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7903('0x1'));var rp=require(_0x7903('0x2'));var moment=require(_0x7903('0x3'));var BPromise=require(_0x7903('0x4'));var Mustache=require(_0x7903('0x5'));var util=require(_0x7903('0x6'));var path=require(_0x7903('0x7'));var sox=require(_0x7903('0x8'));var csv=require(_0x7903('0x9'));var ejs=require(_0x7903('0xa'));var fs=require('fs');var fs_extra=require(_0x7903('0xb'));var _=require(_0x7903('0xc'));var squel=require('squel');var crypto=require(_0x7903('0xd'));var jsforce=require(_0x7903('0xe'));var deskjs=require(_0x7903('0xf'));var toCsv=require(_0x7903('0x9'));var querystring=require(_0x7903('0x10'));var Papa=require(_0x7903('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7903('0x12'));var as=require(_0x7903('0x13'));var hardwareService=require(_0x7903('0x14'));var logger=require(_0x7903('0x15'))(_0x7903('0x16'));var utils=require(_0x7903('0x17'));var config=require(_0x7903('0x18'));var licenseUtil=require(_0x7903('0x19'));var db=require(_0x7903('0x1a'))['db'];function respondWithStatusCode(_0x59b5e5,_0x1630ea){_0x1630ea=_0x1630ea||0xcc;return function(_0x367571){if(_0x367571){return _0x59b5e5['sendStatus'](_0x1630ea);}return _0x59b5e5[_0x7903('0x1b')](_0x1630ea)[_0x7903('0x1c')]();};}function respondWithResult(_0x27e32c,_0x4bf254){_0x4bf254=_0x4bf254||0xc8;return function(_0x2b137c){if(_0x2b137c){return _0x27e32c['status'](_0x4bf254)[_0x7903('0x1d')](_0x2b137c);}};}function respondWithFilteredResult(_0x5b995d,_0x32facd){return function(_0x2d4228){if(_0x2d4228){var _0xee9dfb=typeof _0x32facd[_0x7903('0x1e')]===_0x7903('0x1f')&&typeof _0x32facd[_0x7903('0x20')]===_0x7903('0x1f');var _0x33f748=_0x2d4228[_0x7903('0x21')];var _0xf47c47=_0xee9dfb?0x0:_0x32facd[_0x7903('0x1e')];var _0x45fd67=_0xee9dfb?_0x2d4228[_0x7903('0x21')]:_0x32facd[_0x7903('0x1e')]+_0x32facd[_0x7903('0x20')];var _0x57a5f0;if(_0x45fd67>=_0x33f748){_0x45fd67=_0x33f748;_0x57a5f0=0xc8;}else{_0x57a5f0=0xce;}_0x5b995d[_0x7903('0x1b')](_0x57a5f0);return _0x5b995d[_0x7903('0x22')](_0x7903('0x23'),_0xf47c47+'-'+_0x45fd67+'/'+_0x33f748)[_0x7903('0x1d')](_0x2d4228);}return null;};}function patchUpdates(_0x1a51e7){return function(_0x203bd9){try{jsonpatch['apply'](_0x203bd9,_0x1a51e7,!![]);}catch(_0x4a1de5){return BPromise[_0x7903('0x24')](_0x4a1de5);}return _0x203bd9[_0x7903('0x25')]();};}function saveUpdates(_0x3d8e57,_0xd3b3b6){return function(_0x5f005e){if(_0x5f005e){return _0x5f005e['update'](_0x3d8e57)[_0x7903('0x26')](function(_0x5ab611){return _0x5ab611;});}return null;};}function removeEntity(_0x4d30bd,_0x240d63){return function(_0x3cb7ce){if(_0x3cb7ce){return _0x3cb7ce[_0x7903('0x27')]()[_0x7903('0x26')](function(){var _0x35f3b4=_0x3cb7ce['get']({'plain':!![]});var _0x3b732d=_0x7903('0x28');return db[_0x7903('0x29')][_0x7903('0x27')]({'where':{'type':_0x3b732d,'resourceId':_0x35f3b4['id']}})['then'](function(){return _0x3cb7ce;});})['then'](function(){_0x4d30bd[_0x7903('0x1b')](0xcc)[_0x7903('0x1c')]();});}};}function handleEntityNotFound(_0x183689,_0x2072f8){return function(_0xb64413){if(!_0xb64413){_0x183689[_0x7903('0x2a')](0x194);}return _0xb64413;};}function handleError(_0x3b58e3,_0x1337df){_0x1337df=_0x1337df||0x1f4;return function(_0x54a20a){logger[_0x7903('0x2b')](_0x54a20a['stack']);if(_0x54a20a[_0x7903('0x2c')]){delete _0x54a20a[_0x7903('0x2c')];}_0x3b58e3[_0x7903('0x1b')](_0x1337df)['send'](_0x54a20a);};}exports[_0x7903('0x2d')]=function(_0xefbe42,_0x12de68){var _0x44506e={},_0x496c42={},_0x5a84ae={'count':0x0,'rows':[]};var _0x3e0888=_[_0x7903('0x2e')](db[_0x7903('0x2f')]['rawAttributes'],function(_0x2bc43f){return{'name':_0x2bc43f['fieldName'],'type':_0x2bc43f[_0x7903('0x30')][_0x7903('0x31')]};});_0x496c42[_0x7903('0x32')]=_[_0x7903('0x2e')](_0x3e0888,_0x7903('0x2c'));_0x496c42[_0x7903('0x33')]=_[_0x7903('0x34')](_0xefbe42[_0x7903('0x33')]);_0x496c42['filters']=_[_0x7903('0x35')](_0x496c42[_0x7903('0x32')],_0x496c42[_0x7903('0x33')]);_0x44506e[_0x7903('0x36')]=_[_0x7903('0x35')](_0x496c42[_0x7903('0x32')],qs[_0x7903('0x37')](_0xefbe42[_0x7903('0x33')][_0x7903('0x37')]));_0x44506e[_0x7903('0x36')]=_0x44506e['attributes'][_0x7903('0x38')]?_0x44506e['attributes']:_0x496c42['model'];if(!_0xefbe42['query'][_0x7903('0x39')]('nolimit')){_0x44506e[_0x7903('0x20')]=qs[_0x7903('0x20')](_0xefbe42[_0x7903('0x33')][_0x7903('0x20')]);_0x44506e[_0x7903('0x1e')]=qs[_0x7903('0x1e')](_0xefbe42[_0x7903('0x33')][_0x7903('0x1e')]);}_0x44506e[_0x7903('0x3a')]=qs[_0x7903('0x3b')](_0xefbe42[_0x7903('0x33')][_0x7903('0x3b')]);_0x44506e[_0x7903('0x3c')]=qs[_0x7903('0x3d')](_[_0x7903('0x3e')](_0xefbe42[_0x7903('0x33')],_0x496c42[_0x7903('0x3d')]),_0x3e0888);if(_0xefbe42['query'][_0x7903('0x3f')]){_0x44506e['where']=_[_0x7903('0x40')](_0x44506e[_0x7903('0x3c')],{'$or':_[_0x7903('0x2e')](_0x3e0888,function(_0xfe3564){if(_0xfe3564[_0x7903('0x30')]!==_0x7903('0x41')){var _0x421d9d={};_0x421d9d[_0xfe3564[_0x7903('0x2c')]]={'$like':'%'+_0xefbe42['query'][_0x7903('0x3f')]+'%'};return _0x421d9d;}})});}_0x44506e=_['merge']({},_0x44506e,_0xefbe42[_0x7903('0x42')]);var _0x2c2084={'where':_0x44506e[_0x7903('0x3c')]};return db[_0x7903('0x2f')][_0x7903('0x21')](_0x2c2084)['then'](function(_0x3cfa5d){_0x5a84ae[_0x7903('0x21')]=_0x3cfa5d;if(_0xefbe42[_0x7903('0x33')][_0x7903('0x43')]){_0x44506e[_0x7903('0x44')]=[{'all':!![]}];}return db[_0x7903('0x2f')]['findAll'](_0x44506e);})[_0x7903('0x26')](function(_0x4dd5ce){_0x5a84ae[_0x7903('0x45')]=_0x4dd5ce;return _0x5a84ae;})['then'](respondWithFilteredResult(_0x12de68,_0x44506e))[_0x7903('0x46')](handleError(_0x12de68,null));};exports[_0x7903('0x47')]=function(_0x456eac,_0x14f0cd){var _0x4620bb={'raw':![],'where':{'id':_0x456eac[_0x7903('0x48')]['id']}},_0xac2d6d={};_0xac2d6d[_0x7903('0x32')]=_[_0x7903('0x34')](db['JscriptyProject']['rawAttributes']);_0xac2d6d[_0x7903('0x33')]=_[_0x7903('0x34')](_0x456eac[_0x7903('0x33')]);_0xac2d6d['filters']=_['intersection'](_0xac2d6d[_0x7903('0x32')],_0xac2d6d[_0x7903('0x33')]);_0x4620bb['attributes']=_[_0x7903('0x35')](_0xac2d6d['model'],qs[_0x7903('0x37')](_0x456eac[_0x7903('0x33')][_0x7903('0x37')]));_0x4620bb['attributes']=_0x4620bb['attributes'][_0x7903('0x38')]?_0x4620bb['attributes']:_0xac2d6d[_0x7903('0x32')];if(_0x456eac['query']['includeAll']){_0x4620bb['include']=[{'all':!![]}];}_0x4620bb=_[_0x7903('0x40')]({},_0x4620bb,_0x456eac[_0x7903('0x42')]);return db[_0x7903('0x2f')][_0x7903('0x49')](_0x4620bb)[_0x7903('0x26')](handleEntityNotFound(_0x14f0cd,null))[_0x7903('0x26')](respondWithResult(_0x14f0cd,null))[_0x7903('0x46')](handleError(_0x14f0cd,null));};exports[_0x7903('0x4a')]=function(_0x1f5213,_0x1b8bc0){return db[_0x7903('0x2f')][_0x7903('0x4a')](_0x1f5213['body'],{})['then'](function(_0x36568d){var _0x24eeae=_0x1f5213['user']['get']({'plain':!![]});if(!_0x24eeae)throw new Error(_0x7903('0x4b'));if(_0x24eeae[_0x7903('0x4c')]===_0x7903('0x4d')){var _0x1fa0c5=_0x36568d[_0x7903('0x4e')]({'plain':!![]});var _0x23cda0=_0x7903('0x28');return db[_0x7903('0x4f')][_0x7903('0x49')]({'where':{'name':_0x23cda0,'userProfileId':_0x24eeae[_0x7903('0x50')]},'raw':!![]})['then'](function(_0x5c71b0){if(_0x5c71b0&&_0x5c71b0['autoAssociation']===0x0){return db[_0x7903('0x29')][_0x7903('0x4a')]({'name':_0x1fa0c5['name'],'resourceId':_0x1fa0c5['id'],'type':_0x5c71b0['name'],'sectionId':_0x5c71b0['id']},{})['then'](function(){return _0x36568d;});}else{return _0x36568d;}})[_0x7903('0x46')](function(_0x455508){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x455508);throw _0x455508;});}return _0x36568d;})[_0x7903('0x26')](respondWithResult(_0x1b8bc0,0xc9))['catch'](handleError(_0x1b8bc0,null));};exports[_0x7903('0x51')]=function(_0x1d0040,_0x59b9dd){var _0x3106c4={'where':{'id':_0x1d0040[_0x7903('0x48')]['id']}},_0x158452={};_0x158452[_0x7903('0x32')]=_[_0x7903('0x34')](db[_0x7903('0x2f')][_0x7903('0x52')]);_0x3106c4[_0x7903('0x36')]=_[_0x7903('0x35')](_0x158452[_0x7903('0x32')],qs['fields'](_0x1d0040[_0x7903('0x33')][_0x7903('0x37')]));_0x3106c4[_0x7903('0x36')]=_0x3106c4[_0x7903('0x36')][_0x7903('0x38')]?_0x3106c4[_0x7903('0x36')]:_0x158452[_0x7903('0x32')];if(_0x1d0040[_0x7903('0x33')][_0x7903('0x43')]){_0x3106c4['include']=[{'all':!![]}];}_0x3106c4=_['merge']({},_0x3106c4,_0x1d0040[_0x7903('0x42')]);return db[_0x7903('0x2f')][_0x7903('0x49')](_0x3106c4)['then'](handleEntityNotFound(_0x59b9dd,null))[_0x7903('0x26')](function(_0x364c31){if(_0x364c31){var _0x2e2177=_0x364c31[_0x7903('0x4e')]({'plain':!![]});_0x2e2177=qs[_0x7903('0x53')](_0x2e2177,['id',_0x7903('0x54'),_0x7903('0x55')]);_0x1d0040[_0x7903('0x56')]=_[_0x7903('0x53')](_0x1d0040[_0x7903('0x56')],['id','createdAt','updatedAt']);return db[_0x7903('0x2f')][_0x7903('0x4a')](_[_0x7903('0x40')](_0x2e2177,_0x1d0040[_0x7903('0x56')]),{'include':_0x1d0040[_0x7903('0x33')]['includeAll']?[{'all':!![]}]:undefined})[_0x7903('0x26')](function(_0x4fae17){var _0x3fb539=_0x1d0040[_0x7903('0x4d')][_0x7903('0x4e')]({'plain':!![]});if(!_0x3fb539)throw new Error(_0x7903('0x4b'));if(_0x3fb539['role']==='user'){var _0x5080cc=_0x4fae17['get']({'plain':!![]});var _0x22746c=_0x7903('0x28');return db[_0x7903('0x4f')][_0x7903('0x49')]({'where':{'name':_0x22746c,'userProfileId':_0x3fb539[_0x7903('0x50')]},'raw':!![]})[_0x7903('0x26')](function(_0x5192ac){if(_0x5192ac&&_0x5192ac[_0x7903('0x57')]===0x0){return db[_0x7903('0x29')][_0x7903('0x4a')]({'name':_0x5080cc[_0x7903('0x2c')],'resourceId':_0x5080cc['id'],'type':_0x5192ac[_0x7903('0x2c')],'sectionId':_0x5192ac['id']},{})[_0x7903('0x26')](function(){return _0x4fae17;});}else{return _0x4fae17;}})[_0x7903('0x46')](function(_0x57725c){logger[_0x7903('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57725c);throw _0x57725c;});}return _0x4fae17;});}})['then'](respondWithResult(_0x59b9dd,0xc9))[_0x7903('0x46')](handleError(_0x59b9dd,null));};exports[_0x7903('0x58')]=function(_0x1a5dbd,_0x5d1531){if(_0x1a5dbd[_0x7903('0x56')]['id']){delete _0x1a5dbd['body']['id'];}return db[_0x7903('0x2f')][_0x7903('0x49')]({'where':{'id':_0x1a5dbd['params']['id']}})[_0x7903('0x26')](handleEntityNotFound(_0x5d1531,null))[_0x7903('0x26')](saveUpdates(_0x1a5dbd[_0x7903('0x56')],null))[_0x7903('0x26')](respondWithResult(_0x5d1531,null))[_0x7903('0x46')](handleError(_0x5d1531,null));};exports[_0x7903('0x27')]=function(_0x261ce2,_0x3d4354){return db[_0x7903('0x2f')][_0x7903('0x49')]({'where':{'id':_0x261ce2[_0x7903('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d4354,null))['then'](removeEntity(_0x3d4354,null))[_0x7903('0x46')](handleError(_0x3d4354,null));};exports[_0x7903('0x59')]=function(_0x38eaf5,_0x3445be,_0x219bf0){var _0x39550b={'raw':!![],'where':{}};var _0x433101={};var _0x538a56={'count':0x0,'rows':[]};return db[_0x7903('0x2f')]['findOne']({'where':{'id':_0x38eaf5[_0x7903('0x48')]['id']}})[_0x7903('0x26')](handleEntityNotFound(_0x3445be,null))[_0x7903('0x26')](function(_0x555b24){if(_0x555b24){_0x433101['model']=_['keys'](db[_0x7903('0x5a')][_0x7903('0x52')]);_0x433101[_0x7903('0x33')]=_[_0x7903('0x34')](_0x38eaf5[_0x7903('0x33')]);_0x433101[_0x7903('0x3d')]=_[_0x7903('0x35')](_0x433101[_0x7903('0x32')],_0x433101[_0x7903('0x33')]);_0x39550b['attributes']=_[_0x7903('0x35')](_0x433101['model'],qs[_0x7903('0x37')](_0x38eaf5[_0x7903('0x33')]['fields']));_0x39550b['attributes']=_0x39550b[_0x7903('0x36')][_0x7903('0x38')]?_0x39550b['attributes']:_0x433101['model'];if(!_0x38eaf5[_0x7903('0x33')]['hasOwnProperty'](_0x7903('0x5b'))){_0x39550b[_0x7903('0x20')]=qs['limit'](_0x38eaf5['query'][_0x7903('0x20')]);_0x39550b[_0x7903('0x1e')]=qs[_0x7903('0x1e')](_0x38eaf5[_0x7903('0x33')]['offset']);}_0x39550b['order']=qs[_0x7903('0x3b')](_0x38eaf5[_0x7903('0x33')][_0x7903('0x3b')]);_0x39550b[_0x7903('0x3c')]=qs[_0x7903('0x3d')](_[_0x7903('0x3e')](_0x38eaf5[_0x7903('0x33')],_0x433101[_0x7903('0x3d')]));_0x39550b[_0x7903('0x3c')][_0x7903('0x5c')]=_0x555b24['id'];if(_0x38eaf5['query'][_0x7903('0x3f')]){_0x39550b[_0x7903('0x3c')]=_[_0x7903('0x40')](_0x39550b['where'],{'$or':_[_0x7903('0x2e')](_0x39550b['attributes'],function(_0x5f0f93){var _0x26ebd2={};_0x26ebd2[_0x5f0f93]={'$like':'%'+_0x38eaf5['query'][_0x7903('0x3f')]+'%'};return _0x26ebd2;})});}_0x39550b=_[_0x7903('0x40')]({},_0x39550b,_0x38eaf5[_0x7903('0x42')]);return db[_0x7903('0x5a')][_0x7903('0x21')]({'where':_0x39550b['where']})[_0x7903('0x26')](function(_0x53ede6){_0x538a56['count']=_0x53ede6;if(_0x38eaf5[_0x7903('0x33')][_0x7903('0x43')]){_0x39550b[_0x7903('0x44')]=[{'all':!![]}];}return db[_0x7903('0x5a')]['findAll'](_0x39550b);})[_0x7903('0x26')](function(_0x36e4ff){_0x538a56[_0x7903('0x45')]=_0x36e4ff;return _0x538a56;});}})['then'](respondWithFilteredResult(_0x3445be,_0x39550b))['catch'](handleError(_0x3445be,null));};exports[_0x7903('0x5d')]=function(_0x353939,_0x42e888,_0x32d92d){var _0x3c820b={'raw':!![],'where':{}};var _0x1608e9={};var _0x40c8b2={'count':0x0,'rows':[]};return db[_0x7903('0x2f')][_0x7903('0x5e')]({'where':{'id':_0x353939[_0x7903('0x48')]['id']}})[_0x7903('0x26')](handleEntityNotFound(_0x42e888,null))[_0x7903('0x26')](function(_0x2f3772){if(_0x2f3772){_0x1608e9[_0x7903('0x32')]=_[_0x7903('0x34')](db['JscriptyAnswerReport']['rawAttributes']);_0x1608e9[_0x7903('0x33')]=_[_0x7903('0x34')](_0x353939[_0x7903('0x33')]);_0x1608e9[_0x7903('0x3d')]=_[_0x7903('0x35')](_0x1608e9[_0x7903('0x32')],_0x1608e9[_0x7903('0x33')]);_0x3c820b['attributes']=_['intersection'](_0x1608e9['model'],qs[_0x7903('0x37')](_0x353939['query'][_0x7903('0x37')]));_0x3c820b[_0x7903('0x36')]=_0x3c820b['attributes'][_0x7903('0x38')]?_0x3c820b[_0x7903('0x36')]:_0x1608e9[_0x7903('0x32')];if(!_0x353939[_0x7903('0x33')][_0x7903('0x39')](_0x7903('0x5b'))){_0x3c820b[_0x7903('0x20')]=qs['limit'](_0x353939[_0x7903('0x33')][_0x7903('0x20')]);_0x3c820b[_0x7903('0x1e')]=qs['offset'](_0x353939[_0x7903('0x33')][_0x7903('0x1e')]);}_0x3c820b['order']=qs[_0x7903('0x3b')](_0x353939[_0x7903('0x33')][_0x7903('0x3b')]);_0x3c820b[_0x7903('0x3c')]=qs[_0x7903('0x3d')](_['pick'](_0x353939['query'],_0x1608e9[_0x7903('0x3d')]));_0x3c820b[_0x7903('0x3c')]['ProjectId']=_0x2f3772['id'];if(_0x353939[_0x7903('0x33')][_0x7903('0x3f')]){_0x3c820b[_0x7903('0x3c')]=_[_0x7903('0x40')](_0x3c820b['where'],{'$or':_[_0x7903('0x2e')](_0x3c820b[_0x7903('0x36')],function(_0x6f9a12){var _0x248f91={};_0x248f91[_0x6f9a12]={'$like':'%'+_0x353939['query'][_0x7903('0x3f')]+'%'};return _0x248f91;})});}_0x3c820b=_[_0x7903('0x40')]({},_0x3c820b,_0x353939[_0x7903('0x42')]);return db[_0x7903('0x5f')]['count']({'where':_0x3c820b[_0x7903('0x3c')]})[_0x7903('0x26')](function(_0x2260c1){_0x40c8b2[_0x7903('0x21')]=_0x2260c1;if(_0x353939[_0x7903('0x33')][_0x7903('0x43')]){_0x3c820b['include']=[{'all':!![]}];}return db[_0x7903('0x5f')]['findAll'](_0x3c820b);})[_0x7903('0x26')](function(_0x5aa439){_0x40c8b2[_0x7903('0x45')]=_0x5aa439;return _0x40c8b2;});}})['then'](respondWithFilteredResult(_0x42e888,_0x3c820b))['catch'](handleError(_0x42e888,null));};function char(_0x1f5a24){return _0x7903('0x60')===typeof _0x1f5a24?String['fromCharCode'][_0x7903('0x61')](null,arguments):_0x1f5a24;}function needsEncapsulation(_0x48603f){return!!_0x48603f&&(_0x48603f[_0x7903('0x62')]()[_0x7903('0x63')](char(0xd))>=0x0||_0x48603f[_0x7903('0x62')]()[_0x7903('0x63')](char(0xa))>=0x0||_0x48603f[_0x7903('0x62')]()[_0x7903('0x63')](char(0x2c))>=0x0||_0x48603f[_0x7903('0x62')]()[_0x7903('0x63')](char(0x22))>=0x0);}function encapsulate(_0x1c516e){var _0x239835=char(0x22),_0x5dcbb1='\x5c'+char(0x22),_0x357580=_0x1c516e[_0x7903('0x62')]()[_0x7903('0x64')](new RegExp(_0x239835,'g'),_0x5dcbb1);return _0x239835+_0x357580+_0x239835;}exports[_0x7903('0x65')]=function(_0x5a7c05,_0x2e413a,_0x42ecb1){var _0x519029,_0x151413;var _0xf8c64b={'where':{'ProjectId':_0x5a7c05['params']['id']}};if(_0x5a7c05[_0x7903('0x33')][_0x7903('0x66')]){_0xf8c64b[_0x7903('0x3c')]['starttime']=JSON['parse'](_0x5a7c05[_0x7903('0x33')]['startTime']);}return db[_0x7903('0x5a')]['findAll'](_0xf8c64b)[_0x7903('0x26')](handleEntityNotFound(_0x2e413a,null))[_0x7903('0x26')](function(_0x4931f9){if(_0x4931f9){_0x519029=_0x4931f9;return db['JscriptyQuestionReport'][_0x7903('0x67')]({'where':{'SessionId':{'$in':_[_0x7903('0x2e')](_0x519029,'id')},'ProjectId':_0x5a7c05['params']['id']},'order':_0x7903('0x68')});}})[_0x7903('0x26')](handleEntityNotFound(_0x2e413a,null))[_0x7903('0x26')](function(_0x2b5d4b){if(_0x2b5d4b){_0x151413=_0x2b5d4b;var _0x20c617={};for(var _0x45c306=0x0,_0x118be1=_0x151413[_0x7903('0x38')];_0x45c306<_0x118be1;_0x45c306++){if(!_0x20c617[_0x7903('0x39')](_0x151413[_0x45c306][_0x7903('0x69')])){_0x20c617[_0x151413[_0x45c306][_0x7903('0x69')]]=needsEncapsulation(_0x151413[_0x45c306][_0x7903('0x6a')])?encapsulate(_0x151413[_0x45c306]['question']):_0x151413[_0x45c306][_0x7903('0x6a')];}}var _0x2957ae=[],_0x52997e={};for(var _0x89dc98=0x0,_0x43265c=_0x519029[_0x7903('0x38')];_0x89dc98<_0x43265c;_0x89dc98++){_0x52997e={'ProjectId':_0x5a7c05[_0x7903('0x48')]['id'],'SessionId':_0x519029[_0x89dc98]['id'],'StartTime':moment(_0x519029[_0x89dc98]['starttime'])[_0x7903('0x6b')](_0x7903('0x6c'))};for(var _0xaa8b30=0x0,_0x47294f=_0x151413['length'];_0xaa8b30<_0x47294f;_0xaa8b30++){if(_0x151413[_0xaa8b30][_0x7903('0x6d')]==_0x519029[_0x89dc98]['id']&&_0x20c617['hasOwnProperty'](_0x151413[_0xaa8b30][_0x7903('0x69')])){_0x52997e[_0x20c617[_0x151413[_0xaa8b30][_0x7903('0x69')]]]=_0x151413[_0xaa8b30][_0x7903('0x6e')];}}for(var _0x262499 in _0x20c617){if(!_0x52997e['hasOwnProperty'](_0x20c617[_0x262499])){_0x52997e[_0x20c617[_0x262499]]=null;}}_0x2957ae[_0x7903('0x6f')](_0x52997e);}return _0x2957ae;}})['then'](function(_0x57dc23){if(!_[_0x7903('0x70')](_0x57dc23)){var _0x359988=toCsv(_0x57dc23);var _0xe94339=Date['now']();fs['writeFileSync'](util['format'](_0x7903('0x71'),_0x5a7c05[_0x7903('0x48')]['id'],_0xe94339),_0x359988);_0x2e413a[_0x7903('0x72')]('Content-disposition','attachment;\x20filename='+util[_0x7903('0x6b')](_0x7903('0x73'),_0x5a7c05[_0x7903('0x48')]['id'],_0xe94339));_0x2e413a['setHeader'](_0x7903('0x74'),_0x7903('0x75'));return _0x2e413a[_0x7903('0x76')](util[_0x7903('0x6b')](_0x7903('0x71'),_0x5a7c05[_0x7903('0x48')]['id'],_0xe94339));}else{return _0x2e413a[_0x7903('0x2a')](0xcc);}})[_0x7903('0x46')](handleError(_0x2e413a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 83e8b9a..b6b4f89 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 _0x0048=['bluebird','path','rimraf','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','util','../../config/logger','moment'];(function(_0x1e3913,_0x1fc45e){var _0x4bf175=function(_0x1903a2){while(--_0x1903a2){_0x1e3913['push'](_0x1e3913['shift']());}};_0x4bf175(++_0x1fc45e);}(_0x0048,0x129));var _0x8004=function(_0xcd3806,_0x3182ad){_0xcd3806=_0xcd3806-0x0;var _0x5e3594=_0x0048[_0xcd3806];return _0x5e3594;};'use strict';var _=require('lodash');var util=require(_0x8004('0x0'));var logger=require(_0x8004('0x1'))('api');var moment=require(_0x8004('0x2'));var BPromise=require(_0x8004('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8004('0x4'));var rimraf=require(_0x8004('0x5'));var config=require(_0x8004('0x6'));var attributes=require(_0x8004('0x7'));module['exports']=function(_0x532337,_0x3aaed7){return _0x532337[_0x8004('0x8')](_0x8004('0x9'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf987=['bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','../../config/logger','api'];(function(_0x3f2043,_0x1703e2){var _0x56ddd2=function(_0x3ca785){while(--_0x3ca785){_0x3f2043['push'](_0x3f2043['shift']());}};_0x56ddd2(++_0x1703e2);}(_0xf987,0x18a));var _0x7f98=function(_0x30153f,_0x1fe571){_0x30153f=_0x30153f-0x0;var _0x331018=_0xf987[_0x30153f];return _0x331018;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7f98('0x0'))(_0x7f98('0x1'));var moment=require('moment');var BPromise=require(_0x7f98('0x2'));var rp=require(_0x7f98('0x3'));var fs=require('fs');var path=require(_0x7f98('0x4'));var rimraf=require(_0x7f98('0x5'));var config=require(_0x7f98('0x6'));var attributes=require(_0x7f98('0x7'));module[_0x7f98('0x8')]=function(_0x3b5abb,_0x3fb8e2){return _0x3b5abb[_0x7f98('0x9')](_0x7f98('0xa'),attributes,{'tableName':_0x7f98('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 3fd5dfc..1db041f 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2f0ed7,_0x2207f5){var _0x5bbea4=function(_0x224b71){while(--_0x224b71){_0x2f0ed7['push'](_0x2f0ed7['shift']());}};_0x5bbea4(++_0x2207f5);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2ecac0,_0x2ca20a){_0x2ecac0=_0x2ecac0-0x0;var _0x835e6d=_0xf4eb[_0x2ecac0];return _0x835e6d;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x4152aa,_0x3051eb){var _0xa78692=function(_0x567314){while(--_0x567314){_0x4152aa['push'](_0x4152aa['shift']());}};_0xa78692(++_0x3051eb);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index b01daab..85f2613 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 _0xb5b4=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','describe','/:id','post','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb5b4,0xe0));var _0x4b5b=function(_0x65d12e,_0x4b0a30){_0x65d12e=_0x65d12e-0x0;var _0x4274e0=_0xb5b4[_0x65d12e];return _0x4274e0;};'use strict';var multer=require(_0x4b5b('0x0'));var util=require(_0x4b5b('0x1'));var path=require('path');var timeout=require(_0x4b5b('0x2'));var express=require(_0x4b5b('0x3'));var router=express[_0x4b5b('0x4')]();var fs_extra=require(_0x4b5b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4b5b('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router[_0x4b5b('0x7')]('/',auth[_0x4b5b('0x8')](),controller['index']);router[_0x4b5b('0x7')]('/describe',auth[_0x4b5b('0x8')](),controller[_0x4b5b('0x9')]);router[_0x4b5b('0x7')](_0x4b5b('0xa'),auth[_0x4b5b('0x8')](),controller['show']);router[_0x4b5b('0xb')]('/',auth[_0x4b5b('0x8')](),controller['create']);router[_0x4b5b('0xc')](_0x4b5b('0xa'),auth[_0x4b5b('0x8')](),controller[_0x4b5b('0xd')]);router[_0x4b5b('0xe')](_0x4b5b('0xa'),auth[_0x4b5b('0x8')](),controller[_0x4b5b('0xf')]);module['exports']=router; \ No newline at end of file +var _0x82f3=['express','Router','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x82f3,0x90));var _0x382f=function(_0x48da37,_0xbfebcf){_0x48da37=_0x48da37-0x0;var _0xdafd00=_0x82f3[_0x48da37];return _0xdafd00;};'use strict';var multer=require('multer');var util=require(_0x382f('0x0'));var path=require(_0x382f('0x1'));var timeout=require(_0x382f('0x2'));var express=require(_0x382f('0x3'));var router=express[_0x382f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x382f('0x5'));var config=require(_0x382f('0x6'));var controller=require(_0x382f('0x7'));router[_0x382f('0x8')]('/',auth[_0x382f('0x9')](),controller[_0x382f('0xa')]);router[_0x382f('0x8')](_0x382f('0xb'),auth[_0x382f('0x9')](),controller[_0x382f('0xc')]);router[_0x382f('0x8')](_0x382f('0xd'),auth[_0x382f('0x9')](),controller[_0x382f('0xe')]);router['post']('/',auth[_0x382f('0x9')](),controller[_0x382f('0xf')]);router[_0x382f('0x10')](_0x382f('0xd'),auth[_0x382f('0x9')](),controller[_0x382f('0x11')]);router[_0x382f('0x12')](_0x382f('0xd'),auth[_0x382f('0x9')](),controller[_0x382f('0x13')]);module[_0x382f('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index facba86..2fbaa12 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x77b98b,_0x1058ea){_0x77b98b=_0x77b98b-0x0;var _0x394ef2=_0x7a54[_0x77b98b];return _0x394ef2;};'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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x7a54,0x106));var _0x47a5=function(_0x3aa1d7,_0x29ac8b){_0x3aa1d7=_0x3aa1d7-0x0;var _0x550a8f=_0x7a54[_0x3aa1d7];return _0x550a8f;};'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 2f102d2..6c32927 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 _0x110c=['params','JscriptyQuestionReport','filters','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','findAll','catch','show'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x110c,0x141));var _0xc110=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x110c[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xc110('0x0'));var rimraf=require(_0xc110('0x1'));var zipdir=require(_0xc110('0x2'));var jsonpatch=require(_0xc110('0x3'));var rp=require(_0xc110('0x4'));var moment=require(_0xc110('0x5'));var BPromise=require(_0xc110('0x6'));var Mustache=require(_0xc110('0x7'));var util=require(_0xc110('0x8'));var path=require('path');var sox=require(_0xc110('0x9'));var csv=require(_0xc110('0xa'));var ejs=require(_0xc110('0xb'));var fs=require('fs');var fs_extra=require(_0xc110('0xc'));var _=require(_0xc110('0xd'));var squel=require('squel');var crypto=require(_0xc110('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc110('0xa'));var querystring=require(_0xc110('0xf'));var Papa=require(_0xc110('0x10'));var Redis=require(_0xc110('0x11'));var authService=require(_0xc110('0x12'));var qs=require(_0xc110('0x13'));var as=require(_0xc110('0x14'));var hardwareService=require(_0xc110('0x15'));var logger=require(_0xc110('0x16'))(_0xc110('0x17'));var utils=require(_0xc110('0x18'));var config=require(_0xc110('0x19'));var licenseUtil=require(_0xc110('0x1a'));var db=require(_0xc110('0x1b'))['db'];function respondWithStatusCode(_0x2532c6,_0x25049d){_0x25049d=_0x25049d||0xcc;return function(_0x38f12d){if(_0x38f12d){return _0x2532c6[_0xc110('0x1c')](_0x25049d);}return _0x2532c6[_0xc110('0x1d')](_0x25049d)[_0xc110('0x1e')]();};}function respondWithResult(_0x2ecba0,_0x3dc1e5){_0x3dc1e5=_0x3dc1e5||0xc8;return function(_0xf27e93){if(_0xf27e93){return _0x2ecba0[_0xc110('0x1d')](_0x3dc1e5)[_0xc110('0x1f')](_0xf27e93);}};}function respondWithFilteredResult(_0x47ed77,_0x45c416){return function(_0x167b42){if(_0x167b42){var _0x4e2068=typeof _0x45c416[_0xc110('0x20')]==='undefined'&&typeof _0x45c416['limit']===_0xc110('0x21');var _0x5b1d2c=_0x167b42[_0xc110('0x22')];var _0x4f36b4=_0x4e2068?0x0:_0x45c416[_0xc110('0x20')];var _0x868f16=_0x4e2068?_0x167b42[_0xc110('0x22')]:_0x45c416[_0xc110('0x20')]+_0x45c416[_0xc110('0x23')];var _0x593cd3;if(_0x868f16>=_0x5b1d2c){_0x868f16=_0x5b1d2c;_0x593cd3=0xc8;}else{_0x593cd3=0xce;}_0x47ed77[_0xc110('0x1d')](_0x593cd3);return _0x47ed77[_0xc110('0x24')](_0xc110('0x25'),_0x4f36b4+'-'+_0x868f16+'/'+_0x5b1d2c)[_0xc110('0x1f')](_0x167b42);}return null;};}function patchUpdates(_0x5cc456){return function(_0xc94270){try{jsonpatch[_0xc110('0x26')](_0xc94270,_0x5cc456,!![]);}catch(_0x2a3444){return BPromise[_0xc110('0x27')](_0x2a3444);}return _0xc94270[_0xc110('0x28')]();};}function saveUpdates(_0x2330c7,_0x389442){return function(_0x26311e){if(_0x26311e){return _0x26311e[_0xc110('0x29')](_0x2330c7)[_0xc110('0x2a')](function(_0x36c1e0){return _0x36c1e0;});}return null;};}function removeEntity(_0x592aa9,_0x505545){return function(_0x2bb4b9){if(_0x2bb4b9){return _0x2bb4b9['destroy']()[_0xc110('0x2a')](function(){_0x592aa9['status'](0xcc)[_0xc110('0x1e')]();});}};}function handleEntityNotFound(_0x5174c8,_0x13ecb7){return function(_0x321d66){if(!_0x321d66){_0x5174c8[_0xc110('0x1c')](0x194);}return _0x321d66;};}function handleError(_0xbab8d,_0xdd2f62){_0xdd2f62=_0xdd2f62||0x1f4;return function(_0x1ad907){logger[_0xc110('0x2b')](_0x1ad907['stack']);if(_0x1ad907[_0xc110('0x2c')]){delete _0x1ad907[_0xc110('0x2c')];}_0xbab8d[_0xc110('0x1d')](_0xdd2f62)[_0xc110('0x2d')](_0x1ad907);};}exports[_0xc110('0x2e')]=function(_0x2e8257,_0x134384){var _0x467b81={},_0x15748a={},_0x3ed7c0={'count':0x0,'rows':[]};var _0xbf7c03=_[_0xc110('0x2f')](db['JscriptyQuestionReport'][_0xc110('0x30')],function(_0x484e56){return{'name':_0x484e56['fieldName'],'type':_0x484e56[_0xc110('0x31')][_0xc110('0x32')]};});_0x15748a[_0xc110('0x33')]=_['map'](_0xbf7c03,_0xc110('0x2c'));_0x15748a[_0xc110('0x34')]=_[_0xc110('0x35')](_0x2e8257[_0xc110('0x34')]);_0x15748a['filters']=_[_0xc110('0x36')](_0x15748a[_0xc110('0x33')],_0x15748a['query']);_0x467b81['attributes']=_[_0xc110('0x36')](_0x15748a[_0xc110('0x33')],qs[_0xc110('0x37')](_0x2e8257[_0xc110('0x34')]['fields']));_0x467b81[_0xc110('0x38')]=_0x467b81[_0xc110('0x38')][_0xc110('0x39')]?_0x467b81[_0xc110('0x38')]:_0x15748a['model'];if(!_0x2e8257[_0xc110('0x34')][_0xc110('0x3a')]('nolimit')){_0x467b81[_0xc110('0x23')]=qs['limit'](_0x2e8257[_0xc110('0x34')][_0xc110('0x23')]);_0x467b81[_0xc110('0x20')]=qs[_0xc110('0x20')](_0x2e8257[_0xc110('0x34')]['offset']);}_0x467b81[_0xc110('0x3b')]=qs[_0xc110('0x3c')](_0x2e8257[_0xc110('0x34')][_0xc110('0x3c')]);_0x467b81[_0xc110('0x3d')]=qs['filters'](_['pick'](_0x2e8257[_0xc110('0x34')],_0x15748a['filters']),_0xbf7c03);if(_0x2e8257[_0xc110('0x34')][_0xc110('0x3e')]){_0x467b81[_0xc110('0x3d')]=_[_0xc110('0x3f')](_0x467b81[_0xc110('0x3d')],{'$or':_[_0xc110('0x2f')](_0xbf7c03,function(_0x5ccea4){if(_0x5ccea4[_0xc110('0x31')]!==_0xc110('0x40')){var _0x424736={};_0x424736[_0x5ccea4['name']]={'$like':'%'+_0x2e8257[_0xc110('0x34')]['filter']+'%'};return _0x424736;}})});}_0x467b81=_[_0xc110('0x3f')]({},_0x467b81,_0x2e8257[_0xc110('0x41')]);var _0xc64916={'where':_0x467b81['where']};return db['JscriptyQuestionReport'][_0xc110('0x22')](_0xc64916)['then'](function(_0x43a84e){_0x3ed7c0['count']=_0x43a84e;if(_0x2e8257[_0xc110('0x34')]['includeAll']){_0x467b81['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xc110('0x42')](_0x467b81);})[_0xc110('0x2a')](function(_0x83e8a4){_0x3ed7c0['rows']=_0x83e8a4;return _0x3ed7c0;})[_0xc110('0x2a')](respondWithFilteredResult(_0x134384,_0x467b81))[_0xc110('0x43')](handleError(_0x134384,null));};exports[_0xc110('0x44')]=function(_0x11a586,_0x1f6275){var _0x5a2c04={'raw':!![],'where':{'id':_0x11a586[_0xc110('0x45')]['id']}},_0x6f88cb={};_0x6f88cb[_0xc110('0x33')]=_['keys'](db[_0xc110('0x46')][_0xc110('0x30')]);_0x6f88cb[_0xc110('0x34')]=_[_0xc110('0x35')](_0x11a586['query']);_0x6f88cb[_0xc110('0x47')]=_[_0xc110('0x36')](_0x6f88cb[_0xc110('0x33')],_0x6f88cb[_0xc110('0x34')]);_0x5a2c04[_0xc110('0x38')]=_['intersection'](_0x6f88cb[_0xc110('0x33')],qs[_0xc110('0x37')](_0x11a586['query'][_0xc110('0x37')]));_0x5a2c04[_0xc110('0x38')]=_0x5a2c04[_0xc110('0x38')][_0xc110('0x39')]?_0x5a2c04[_0xc110('0x38')]:_0x6f88cb['model'];if(_0x11a586[_0xc110('0x34')][_0xc110('0x48')]){_0x5a2c04[_0xc110('0x49')]=[{'all':!![]}];}_0x5a2c04=_[_0xc110('0x3f')]({},_0x5a2c04,_0x11a586[_0xc110('0x41')]);return db[_0xc110('0x46')][_0xc110('0x4a')](_0x5a2c04)[_0xc110('0x2a')](handleEntityNotFound(_0x1f6275,null))['then'](respondWithResult(_0x1f6275,null))[_0xc110('0x43')](handleError(_0x1f6275,null));};exports[_0xc110('0x4b')]=function(_0x2cb78e,_0xad6d9){return db[_0xc110('0x46')]['create'](_0x2cb78e[_0xc110('0x4c')],{})[_0xc110('0x2a')](respondWithResult(_0xad6d9,0xc9))['catch'](handleError(_0xad6d9,null));};exports['update']=function(_0x317b14,_0x24b195){if(_0x317b14[_0xc110('0x4c')]['id']){delete _0x317b14['body']['id'];}return db[_0xc110('0x46')]['find']({'where':{'id':_0x317b14[_0xc110('0x45')]['id']}})[_0xc110('0x2a')](handleEntityNotFound(_0x24b195,null))[_0xc110('0x2a')](saveUpdates(_0x317b14[_0xc110('0x4c')],null))[_0xc110('0x2a')](respondWithResult(_0x24b195,null))['catch'](handleError(_0x24b195,null));};exports['destroy']=function(_0x34cdeb,_0x32f311){return db[_0xc110('0x46')][_0xc110('0x4a')]({'where':{'id':_0x34cdeb[_0xc110('0x45')]['id']}})['then'](handleEntityNotFound(_0x32f311,null))[_0xc110('0x2a')](removeEntity(_0x32f311,null))[_0xc110('0x43')](handleError(_0x32f311,null));};exports['describe']=function(_0x67d511,_0x2da502){return db[_0xc110('0x46')][_0xc110('0x4d')]()[_0xc110('0x2a')](respondWithResult(_0x2da502,null))[_0xc110('0x43')](handleError(_0x2da502,null));}; \ No newline at end of file +var _0xb57d=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','then','error','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model'];(function(_0x42abed,_0x4bca02){var _0x2dcbf0=function(_0x5eb843){while(--_0x5eb843){_0x42abed['push'](_0x42abed['shift']());}};_0x2dcbf0(++_0x4bca02);}(_0xb57d,0xb8));var _0xdb57=function(_0x46ebdd,_0x1e07dc){_0x46ebdd=_0x46ebdd-0x0;var _0x41d84e=_0xb57d[_0x46ebdd];return _0x41d84e;};'use strict';var emlformat=require(_0xdb57('0x0'));var rimraf=require(_0xdb57('0x1'));var zipdir=require(_0xdb57('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdb57('0x3'));var BPromise=require(_0xdb57('0x4'));var Mustache=require(_0xdb57('0x5'));var util=require('util');var path=require(_0xdb57('0x6'));var sox=require(_0xdb57('0x7'));var csv=require(_0xdb57('0x8'));var ejs=require(_0xdb57('0x9'));var fs=require('fs');var fs_extra=require(_0xdb57('0xa'));var _=require('lodash');var squel=require(_0xdb57('0xb'));var crypto=require('crypto');var jsforce=require(_0xdb57('0xc'));var deskjs=require(_0xdb57('0xd'));var toCsv=require(_0xdb57('0x8'));var querystring=require(_0xdb57('0xe'));var Papa=require(_0xdb57('0xf'));var Redis=require(_0xdb57('0x10'));var authService=require(_0xdb57('0x11'));var qs=require(_0xdb57('0x12'));var as=require(_0xdb57('0x13'));var hardwareService=require(_0xdb57('0x14'));var logger=require(_0xdb57('0x15'))(_0xdb57('0x16'));var utils=require(_0xdb57('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdb57('0x18'));var db=require(_0xdb57('0x19'))['db'];function respondWithStatusCode(_0x3419e5,_0x3b1b33){_0x3b1b33=_0x3b1b33||0xcc;return function(_0x3d4cbf){if(_0x3d4cbf){return _0x3419e5[_0xdb57('0x1a')](_0x3b1b33);}return _0x3419e5['status'](_0x3b1b33)[_0xdb57('0x1b')]();};}function respondWithResult(_0x4c485a,_0x61c2be){_0x61c2be=_0x61c2be||0xc8;return function(_0x279e5f){if(_0x279e5f){return _0x4c485a[_0xdb57('0x1c')](_0x61c2be)['json'](_0x279e5f);}};}function respondWithFilteredResult(_0x491c32,_0x45d871){return function(_0x46411e){if(_0x46411e){var _0x4427a2=typeof _0x45d871[_0xdb57('0x1d')]==='undefined'&&typeof _0x45d871[_0xdb57('0x1e')]===_0xdb57('0x1f');var _0x45a27a=_0x46411e['count'];var _0x575cd=_0x4427a2?0x0:_0x45d871[_0xdb57('0x1d')];var _0x27f96c=_0x4427a2?_0x46411e[_0xdb57('0x20')]:_0x45d871['offset']+_0x45d871['limit'];var _0x2a22e8;if(_0x27f96c>=_0x45a27a){_0x27f96c=_0x45a27a;_0x2a22e8=0xc8;}else{_0x2a22e8=0xce;}_0x491c32[_0xdb57('0x1c')](_0x2a22e8);return _0x491c32['set'](_0xdb57('0x21'),_0x575cd+'-'+_0x27f96c+'/'+_0x45a27a)[_0xdb57('0x22')](_0x46411e);}return null;};}function patchUpdates(_0x19945b){return function(_0x5d4bc1){try{jsonpatch[_0xdb57('0x23')](_0x5d4bc1,_0x19945b,!![]);}catch(_0x20b191){return BPromise[_0xdb57('0x24')](_0x20b191);}return _0x5d4bc1[_0xdb57('0x25')]();};}function saveUpdates(_0x5c5aec,_0x1c370f){return function(_0x32ec93){if(_0x32ec93){return _0x32ec93['update'](_0x5c5aec)['then'](function(_0x4d3d49){return _0x4d3d49;});}return null;};}function removeEntity(_0xa6f68f,_0x5dd3ad){return function(_0x163421){if(_0x163421){return _0x163421['destroy']()[_0xdb57('0x26')](function(){_0xa6f68f[_0xdb57('0x1c')](0xcc)[_0xdb57('0x1b')]();});}};}function handleEntityNotFound(_0xf49f7e,_0x3e63dc){return function(_0x3b4ed3){if(!_0x3b4ed3){_0xf49f7e['sendStatus'](0x194);}return _0x3b4ed3;};}function handleError(_0x394e82,_0x5338aa){_0x5338aa=_0x5338aa||0x1f4;return function(_0x2086f0){logger[_0xdb57('0x27')](_0x2086f0['stack']);if(_0x2086f0[_0xdb57('0x28')]){delete _0x2086f0[_0xdb57('0x28')];}_0x394e82['status'](_0x5338aa)[_0xdb57('0x29')](_0x2086f0);};}exports[_0xdb57('0x2a')]=function(_0x1e08f3,_0x2da80b){var _0x1a02a8={},_0x166635={},_0x586af8={'count':0x0,'rows':[]};var _0x73eaec=_[_0xdb57('0x2b')](db[_0xdb57('0x2c')][_0xdb57('0x2d')],function(_0x538211){return{'name':_0x538211[_0xdb57('0x2e')],'type':_0x538211[_0xdb57('0x2f')][_0xdb57('0x30')]};});_0x166635[_0xdb57('0x31')]=_[_0xdb57('0x2b')](_0x73eaec,_0xdb57('0x28'));_0x166635[_0xdb57('0x32')]=_[_0xdb57('0x33')](_0x1e08f3[_0xdb57('0x32')]);_0x166635[_0xdb57('0x34')]=_[_0xdb57('0x35')](_0x166635[_0xdb57('0x31')],_0x166635[_0xdb57('0x32')]);_0x1a02a8[_0xdb57('0x36')]=_[_0xdb57('0x35')](_0x166635[_0xdb57('0x31')],qs[_0xdb57('0x37')](_0x1e08f3[_0xdb57('0x32')][_0xdb57('0x37')]));_0x1a02a8[_0xdb57('0x36')]=_0x1a02a8[_0xdb57('0x36')][_0xdb57('0x38')]?_0x1a02a8[_0xdb57('0x36')]:_0x166635[_0xdb57('0x31')];if(!_0x1e08f3[_0xdb57('0x32')][_0xdb57('0x39')](_0xdb57('0x3a'))){_0x1a02a8[_0xdb57('0x1e')]=qs[_0xdb57('0x1e')](_0x1e08f3[_0xdb57('0x32')][_0xdb57('0x1e')]);_0x1a02a8[_0xdb57('0x1d')]=qs[_0xdb57('0x1d')](_0x1e08f3[_0xdb57('0x32')]['offset']);}_0x1a02a8[_0xdb57('0x3b')]=qs['sort'](_0x1e08f3[_0xdb57('0x32')][_0xdb57('0x3c')]);_0x1a02a8[_0xdb57('0x3d')]=qs[_0xdb57('0x34')](_[_0xdb57('0x3e')](_0x1e08f3['query'],_0x166635[_0xdb57('0x34')]),_0x73eaec);if(_0x1e08f3[_0xdb57('0x32')][_0xdb57('0x3f')]){_0x1a02a8[_0xdb57('0x3d')]=_[_0xdb57('0x40')](_0x1a02a8[_0xdb57('0x3d')],{'$or':_['map'](_0x73eaec,function(_0x50fdd4){if(_0x50fdd4[_0xdb57('0x2f')]!=='VIRTUAL'){var _0x513380={};_0x513380[_0x50fdd4[_0xdb57('0x28')]]={'$like':'%'+_0x1e08f3[_0xdb57('0x32')][_0xdb57('0x3f')]+'%'};return _0x513380;}})});}_0x1a02a8=_[_0xdb57('0x40')]({},_0x1a02a8,_0x1e08f3[_0xdb57('0x41')]);var _0x3fc048={'where':_0x1a02a8[_0xdb57('0x3d')]};return db[_0xdb57('0x2c')][_0xdb57('0x20')](_0x3fc048)['then'](function(_0x39da2b){_0x586af8[_0xdb57('0x20')]=_0x39da2b;if(_0x1e08f3[_0xdb57('0x32')][_0xdb57('0x42')]){_0x1a02a8[_0xdb57('0x43')]=[{'all':!![]}];}return db[_0xdb57('0x2c')][_0xdb57('0x44')](_0x1a02a8);})[_0xdb57('0x26')](function(_0x184cf9){_0x586af8[_0xdb57('0x45')]=_0x184cf9;return _0x586af8;})[_0xdb57('0x26')](respondWithFilteredResult(_0x2da80b,_0x1a02a8))[_0xdb57('0x46')](handleError(_0x2da80b,null));};exports['show']=function(_0x24c033,_0x36b27d){var _0x5586b7={'raw':!![],'where':{'id':_0x24c033[_0xdb57('0x47')]['id']}},_0x21e52e={};_0x21e52e['model']=_['keys'](db[_0xdb57('0x2c')][_0xdb57('0x2d')]);_0x21e52e['query']=_[_0xdb57('0x33')](_0x24c033[_0xdb57('0x32')]);_0x21e52e['filters']=_[_0xdb57('0x35')](_0x21e52e['model'],_0x21e52e[_0xdb57('0x32')]);_0x5586b7[_0xdb57('0x36')]=_[_0xdb57('0x35')](_0x21e52e[_0xdb57('0x31')],qs[_0xdb57('0x37')](_0x24c033[_0xdb57('0x32')][_0xdb57('0x37')]));_0x5586b7[_0xdb57('0x36')]=_0x5586b7[_0xdb57('0x36')][_0xdb57('0x38')]?_0x5586b7['attributes']:_0x21e52e[_0xdb57('0x31')];if(_0x24c033[_0xdb57('0x32')][_0xdb57('0x42')]){_0x5586b7[_0xdb57('0x43')]=[{'all':!![]}];}_0x5586b7=_[_0xdb57('0x40')]({},_0x5586b7,_0x24c033[_0xdb57('0x41')]);return db[_0xdb57('0x2c')][_0xdb57('0x48')](_0x5586b7)[_0xdb57('0x26')](handleEntityNotFound(_0x36b27d,null))[_0xdb57('0x26')](respondWithResult(_0x36b27d,null))[_0xdb57('0x46')](handleError(_0x36b27d,null));};exports[_0xdb57('0x49')]=function(_0x3c486c,_0x23989f){return db[_0xdb57('0x2c')][_0xdb57('0x49')](_0x3c486c[_0xdb57('0x4a')],{})[_0xdb57('0x26')](respondWithResult(_0x23989f,0xc9))[_0xdb57('0x46')](handleError(_0x23989f,null));};exports[_0xdb57('0x4b')]=function(_0x5c1960,_0x28772a){if(_0x5c1960[_0xdb57('0x4a')]['id']){delete _0x5c1960[_0xdb57('0x4a')]['id'];}return db[_0xdb57('0x2c')][_0xdb57('0x48')]({'where':{'id':_0x5c1960[_0xdb57('0x47')]['id']}})[_0xdb57('0x26')](handleEntityNotFound(_0x28772a,null))[_0xdb57('0x26')](saveUpdates(_0x5c1960['body'],null))['then'](respondWithResult(_0x28772a,null))[_0xdb57('0x46')](handleError(_0x28772a,null));};exports[_0xdb57('0x4c')]=function(_0x2e012d,_0x29fa77){return db[_0xdb57('0x2c')][_0xdb57('0x48')]({'where':{'id':_0x2e012d[_0xdb57('0x47')]['id']}})[_0xdb57('0x26')](handleEntityNotFound(_0x29fa77,null))[_0xdb57('0x26')](removeEntity(_0x29fa77,null))[_0xdb57('0x46')](handleError(_0x29fa77,null));};exports['describe']=function(_0x4da70d,_0x7af3c3){return db[_0xdb57('0x2c')][_0xdb57('0x4d')]()['then'](respondWithResult(_0x7af3c3,null))[_0xdb57('0x46')](handleError(_0x7af3c3,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index a45657d..7061424 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 _0xfbd9=['lodash','util','../../config/logger','moment','bluebird','request-promise','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x48f244,_0x7e99b8){var _0xeea34=function(_0x286803){while(--_0x286803){_0x48f244['push'](_0x48f244['shift']());}};_0xeea34(++_0x7e99b8);}(_0xfbd9,0xa5));var _0x9fbd=function(_0x274274,_0x1b16aa){_0x274274=_0x274274-0x0;var _0x466ccb=_0xfbd9[_0x274274];return _0x466ccb;};'use strict';var _=require(_0x9fbd('0x0'));var util=require(_0x9fbd('0x1'));var logger=require(_0x9fbd('0x2'))('api');var moment=require(_0x9fbd('0x3'));var BPromise=require(_0x9fbd('0x4'));var rp=require(_0x9fbd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9fbd('0x6'));module[_0x9fbd('0x7')]=function(_0x301f50,_0x448689){return _0x301f50[_0x9fbd('0x8')](_0x9fbd('0x9'),attributes,{'tableName':_0x9fbd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb331=['report_jscripty_questions','lodash','moment','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport'];(function(_0x348155,_0x44fbc0){var _0x2de9c2=function(_0x19fddf){while(--_0x19fddf){_0x348155['push'](_0x348155['shift']());}};_0x2de9c2(++_0x44fbc0);}(_0xb331,0x7a));var _0x1b33=function(_0x1fc2dd,_0x21abf0){_0x1fc2dd=_0x1fc2dd-0x0;var _0x339076=_0xb331[_0x1fc2dd];return _0x339076;};'use strict';var _=require(_0x1b33('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1b33('0x1'));var BPromise=require('bluebird');var rp=require(_0x1b33('0x2'));var fs=require('fs');var path=require(_0x1b33('0x3'));var rimraf=require(_0x1b33('0x4'));var config=require(_0x1b33('0x5'));var attributes=require(_0x1b33('0x6'));module[_0x1b33('0x7')]=function(_0x58118b,_0x3c96e4){return _0x58118b[_0x1b33('0x8')](_0x1b33('0x9'),attributes,{'tableName':_0x1b33('0xa'),'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 b08c9f1..c455907 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 _0x60e3=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','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'];(function(_0x1eb2b9,_0x50e210){var _0x515f43=function(_0x1b4aea){while(--_0x1b4aea){_0x1eb2b9['push'](_0x1eb2b9['shift']());}};_0x515f43(++_0x50e210);}(_0x60e3,0x1c9));var _0x360e=function(_0x2d6617,_0xbdccc4){_0x2d6617=_0x2d6617-0x0;var _0x212ba1=_0x60e3[_0x2d6617];return _0x212ba1;};'use strict';var _=require(_0x360e('0x0'));var util=require('util');var moment=require(_0x360e('0x1'));var BPromise=require(_0x360e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x360e('0x3'));var db=require(_0x360e('0x4'))['db'];var utils=require(_0x360e('0x5'));var logger=require(_0x360e('0x6'))(_0x360e('0x7'));var config=require(_0x360e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x360e('0x9')][_0x360e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ed4f5,_0x4b2065,_0x5abe8a){return new BPromise(function(_0x89bfba,_0x1c79bf){return client[_0x360e('0xb')](_0x5ed4f5,_0x5abe8a)[_0x360e('0xc')](function(_0x3c3673){logger['info'](_0x360e('0xd'),_0x4b2065,_0x360e('0xe'));logger[_0x360e('0xf')](_0x360e('0x10'),_0x4b2065,_0x360e('0xe'),JSON[_0x360e('0x11')](_0x3c3673));if(_0x3c3673['error']){if(_0x3c3673[_0x360e('0x12')][_0x360e('0x13')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x4b2065,_0x3c3673[_0x360e('0x12')]['message']);return _0x1c79bf(_0x3c3673[_0x360e('0x12')][_0x360e('0x14')]);}logger['error'](_0x360e('0xd'),_0x4b2065,_0x3c3673[_0x360e('0x12')][_0x360e('0x14')]);return _0x89bfba(_0x3c3673[_0x360e('0x12')][_0x360e('0x14')]);}else{logger[_0x360e('0x15')](_0x360e('0xd'),_0x4b2065,_0x360e('0xe'));_0x89bfba(_0x3c3673[_0x360e('0x16')]['message']);}})[_0x360e('0x17')](function(_0x35ea8a){logger[_0x360e('0x12')](_0x360e('0xd'),_0x4b2065,_0x35ea8a);_0x1c79bf(_0x35ea8a);});});} \ No newline at end of file +var _0xcc64=['info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0xcaa4b9,_0x124ea2){var _0x4dc6d2=function(_0x5dce39){while(--_0x5dce39){_0xcaa4b9['push'](_0xcaa4b9['shift']());}};_0x4dc6d2(++_0x124ea2);}(_0xcc64,0x1c2));var _0x4cc6=function(_0x532885,_0x471824){_0x532885=_0x532885-0x0;var _0x32b183=_0xcc64[_0x532885];return _0x32b183;};'use strict';var _=require(_0x4cc6('0x0'));var util=require('util');var moment=require(_0x4cc6('0x1'));var BPromise=require(_0x4cc6('0x2'));var rs=require(_0x4cc6('0x3'));var fs=require('fs');var Redis=require(_0x4cc6('0x4'));var db=require(_0x4cc6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4cc6('0x6'))('rpc');var config=require(_0x4cc6('0x7'));var jayson=require(_0x4cc6('0x8'));var client=jayson['client'][_0x4cc6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e770a,_0x1bd81e,_0x2882a7){return new BPromise(function(_0x1aac14,_0x2797ef){return client['request'](_0x4e770a,_0x2882a7)['then'](function(_0x20dc46){logger[_0x4cc6('0xa')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1bd81e,_0x4cc6('0xb'));logger[_0x4cc6('0xc')](_0x4cc6('0xd'),_0x1bd81e,_0x4cc6('0xb'),JSON[_0x4cc6('0xe')](_0x20dc46));if(_0x20dc46['error']){if(_0x20dc46[_0x4cc6('0xf')][_0x4cc6('0x10')]===0x1f4){logger[_0x4cc6('0xf')](_0x4cc6('0x11'),_0x1bd81e,_0x20dc46[_0x4cc6('0xf')][_0x4cc6('0x12')]);return _0x2797ef(_0x20dc46['error'][_0x4cc6('0x12')]);}logger['error'](_0x4cc6('0x11'),_0x1bd81e,_0x20dc46['error']['message']);return _0x1aac14(_0x20dc46[_0x4cc6('0xf')][_0x4cc6('0x12')]);}else{logger[_0x4cc6('0xa')](_0x4cc6('0x11'),_0x1bd81e,_0x4cc6('0xb'));_0x1aac14(_0x20dc46['result'][_0x4cc6('0x12')]);}})[_0x4cc6('0x13')](function(_0x4dd1c6){logger[_0x4cc6('0xf')](_0x4cc6('0x11'),_0x1bd81e,_0x4dd1c6);_0x2797ef(_0x4dd1c6);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 45cfdd7..400e133 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 _0x3195=['../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x467ffe,_0x456bd7){var _0x49ca7c=function(_0x16284d){while(--_0x16284d){_0x467ffe['push'](_0x467ffe['shift']());}};_0x49ca7c(++_0x456bd7);}(_0x3195,0x102));var _0x5319=function(_0x15dfa9,_0x359682){_0x15dfa9=_0x15dfa9-0x0;var _0x2c969e=_0x3195[_0x15dfa9];return _0x2c969e;};'use strict';var multer=require('multer');var util=require(_0x5319('0x0'));var path=require(_0x5319('0x1'));var timeout=require(_0x5319('0x2'));var express=require('express');var router=express[_0x5319('0x3')]();var fs_extra=require(_0x5319('0x4'));var auth=require(_0x5319('0x5'));var interaction=require(_0x5319('0x6'));var config=require(_0x5319('0x7'));var controller=require(_0x5319('0x8'));router[_0x5319('0x9')]('/',auth[_0x5319('0xa')](),controller[_0x5319('0xb')]);router[_0x5319('0x9')](_0x5319('0xc'),auth[_0x5319('0xa')](),controller[_0x5319('0xd')]);router[_0x5319('0x9')](_0x5319('0xe'),auth['isAuthenticated'](),controller[_0x5319('0xf')]);router[_0x5319('0x9')](_0x5319('0x10'),auth[_0x5319('0xa')](),controller[_0x5319('0x11')]);router[_0x5319('0x12')]('/',auth[_0x5319('0xa')](),controller[_0x5319('0x13')]);router[_0x5319('0x14')](_0x5319('0xe'),auth[_0x5319('0xa')](),controller[_0x5319('0x15')]);router['delete'](_0x5319('0xe'),auth['isAuthenticated'](),controller[_0x5319('0x16')]);module[_0x5319('0x17')]=router; \ No newline at end of file +var _0x730f=['destroy','exports','util','path','express','Router','fs-extra','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','describe','/:id','show','getQuestions','post','create','put','update','delete'];(function(_0x4002d1,_0x25da0b){var _0x4088ab=function(_0x440bc8){while(--_0x440bc8){_0x4002d1['push'](_0x4002d1['shift']());}};_0x4088ab(++_0x25da0b);}(_0x730f,0x1e2));var _0xf730=function(_0x7e7d91,_0x368424){_0x7e7d91=_0x7e7d91-0x0;var _0x446a8f=_0x730f[_0x7e7d91];return _0x446a8f;};'use strict';var multer=require('multer');var util=require(_0xf730('0x0'));var path=require(_0xf730('0x1'));var timeout=require('connect-timeout');var express=require(_0xf730('0x2'));var router=express[_0xf730('0x3')]();var fs_extra=require(_0xf730('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf730('0x5'));var controller=require(_0xf730('0x6'));router[_0xf730('0x7')]('/',auth[_0xf730('0x8')](),controller['index']);router[_0xf730('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xf730('0x9')]);router['get'](_0xf730('0xa'),auth[_0xf730('0x8')](),controller[_0xf730('0xb')]);router[_0xf730('0x7')]('/:id/questions',auth[_0xf730('0x8')](),controller[_0xf730('0xc')]);router[_0xf730('0xd')]('/',auth[_0xf730('0x8')](),controller[_0xf730('0xe')]);router[_0xf730('0xf')](_0xf730('0xa'),auth[_0xf730('0x8')](),controller[_0xf730('0x10')]);router[_0xf730('0x11')]('/:id',auth[_0xf730('0x8')](),controller[_0xf730('0x12')]);module[_0xf730('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index fe87663..fd07c70 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 _0x82e2=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize','exports','DATE','setDataValue','endtime'];(function(_0x328c33,_0x872e1b){var _0xd3bbb=function(_0x16899a){while(--_0x16899a){_0x328c33['push'](_0x328c33['shift']());}};_0xd3bbb(++_0x872e1b);}(_0x82e2,0xd3));var _0x282e=function(_0xab58e1,_0x5d47ce){_0xab58e1=_0xab58e1-0x0;var _0x295351=_0x82e2[_0xab58e1];return _0x295351;};'use strict';var moment=require('moment');var Sequelize=require(_0x282e('0x0'));module[_0x282e('0x1')]={'starttime':{'type':Sequelize[_0x282e('0x2')],'set':function(_0x2c1944){this[_0x282e('0x3')]('starttime',_0x2c1944);this[_0x282e('0x3')](_0x282e('0x4'),moment()['format'](_0x282e('0x5')));}},'endtime':{'type':Sequelize[_0x282e('0x2')]},'membername':{'type':Sequelize[_0x282e('0x6')]},'projectname':{'type':Sequelize[_0x282e('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x282e('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x282e('0x6')]},'completed':{'type':Sequelize[_0x282e('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x40d5=['sequelize','exports','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment'];(function(_0x5da27f,_0x504b76){var _0x54a3fb=function(_0x3b65a8){while(--_0x3b65a8){_0x5da27f['push'](_0x5da27f['shift']());}};_0x54a3fb(++_0x504b76);}(_0x40d5,0x15d));var _0x540d=function(_0x180297,_0x56bb6d){_0x180297=_0x180297-0x0;var _0x1f7aae=_0x40d5[_0x180297];return _0x1f7aae;};'use strict';var moment=require(_0x540d('0x0'));var Sequelize=require(_0x540d('0x1'));module[_0x540d('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x4df556){this[_0x540d('0x3')](_0x540d('0x4'),_0x4df556);this[_0x540d('0x3')](_0x540d('0x5'),moment()[_0x540d('0x6')](_0x540d('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x540d('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x540d('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x540d('0x8')]},'completed':{'type':Sequelize[_0x540d('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 21de64d..8a3e6a1 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 _0xaec2=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','apply','reject','save','update','destroy','then','error','stack','name','send','map','JscriptySessionReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','include','findAll','catch','show','params','includeAll','options','find','create','body','describe','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','rows','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x4fd9b9,_0x4baad2){var _0x41907a=function(_0x9d862a){while(--_0x9d862a){_0x4fd9b9['push'](_0x4fd9b9['shift']());}};_0x41907a(++_0x4baad2);}(_0xaec2,0x89));var _0x2aec=function(_0x168114,_0x54c2d9){_0x168114=_0x168114-0x0;var _0x21d911=_0xaec2[_0x168114];return _0x21d911;};'use strict';var emlformat=require(_0x2aec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2aec('0x1'));var jsonpatch=require(_0x2aec('0x2'));var rp=require(_0x2aec('0x3'));var moment=require(_0x2aec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2aec('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2aec('0x6'));var csv=require(_0x2aec('0x7'));var ejs=require(_0x2aec('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2aec('0x9'));var squel=require(_0x2aec('0xa'));var crypto=require(_0x2aec('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2aec('0xc'));var toCsv=require(_0x2aec('0x7'));var querystring=require('querystring');var Papa=require(_0x2aec('0xd'));var Redis=require('ioredis');var authService=require(_0x2aec('0xe'));var qs=require(_0x2aec('0xf'));var as=require(_0x2aec('0x10'));var hardwareService=require(_0x2aec('0x11'));var logger=require('../../config/logger')(_0x2aec('0x12'));var utils=require(_0x2aec('0x13'));var config=require(_0x2aec('0x14'));var licenseUtil=require(_0x2aec('0x15'));var db=require(_0x2aec('0x16'))['db'];function respondWithStatusCode(_0x2cab7d,_0x213a6a){_0x213a6a=_0x213a6a||0xcc;return function(_0x475e3c){if(_0x475e3c){return _0x2cab7d[_0x2aec('0x17')](_0x213a6a);}return _0x2cab7d[_0x2aec('0x18')](_0x213a6a)[_0x2aec('0x19')]();};}function respondWithResult(_0xda03e4,_0x9091bc){_0x9091bc=_0x9091bc||0xc8;return function(_0x4954c0){if(_0x4954c0){return _0xda03e4['status'](_0x9091bc)[_0x2aec('0x1a')](_0x4954c0);}};}function respondWithFilteredResult(_0x2073fd,_0xc6b98e){return function(_0x4a67ce){if(_0x4a67ce){var _0x50c7f0=typeof _0xc6b98e['offset']===_0x2aec('0x1b')&&typeof _0xc6b98e['limit']===_0x2aec('0x1b');var _0x3ba1ad=_0x4a67ce['count'];var _0x5e24e9=_0x50c7f0?0x0:_0xc6b98e[_0x2aec('0x1c')];var _0x4b6842=_0x50c7f0?_0x4a67ce[_0x2aec('0x1d')]:_0xc6b98e[_0x2aec('0x1c')]+_0xc6b98e[_0x2aec('0x1e')];var _0x331924;if(_0x4b6842>=_0x3ba1ad){_0x4b6842=_0x3ba1ad;_0x331924=0xc8;}else{_0x331924=0xce;}_0x2073fd['status'](_0x331924);return _0x2073fd[_0x2aec('0x1f')]('Content-Range',_0x5e24e9+'-'+_0x4b6842+'/'+_0x3ba1ad)['json'](_0x4a67ce);}return null;};}function patchUpdates(_0x21929f){return function(_0x10d286){try{jsonpatch[_0x2aec('0x20')](_0x10d286,_0x21929f,!![]);}catch(_0x265343){return BPromise[_0x2aec('0x21')](_0x265343);}return _0x10d286[_0x2aec('0x22')]();};}function saveUpdates(_0x5087c9,_0x32078f){return function(_0x2bab2b){if(_0x2bab2b){return _0x2bab2b[_0x2aec('0x23')](_0x5087c9)['then'](function(_0x310eca){return _0x310eca;});}return null;};}function removeEntity(_0x5834d0,_0x50fd8b){return function(_0x224969){if(_0x224969){return _0x224969[_0x2aec('0x24')]()[_0x2aec('0x25')](function(){_0x5834d0['status'](0xcc)[_0x2aec('0x19')]();});}};}function handleEntityNotFound(_0x383539,_0x4e9e61){return function(_0x2054d6){if(!_0x2054d6){_0x383539[_0x2aec('0x17')](0x194);}return _0x2054d6;};}function handleError(_0x59aeab,_0x40142d){_0x40142d=_0x40142d||0x1f4;return function(_0x41481f){logger[_0x2aec('0x26')](_0x41481f[_0x2aec('0x27')]);if(_0x41481f[_0x2aec('0x28')]){delete _0x41481f[_0x2aec('0x28')];}_0x59aeab[_0x2aec('0x18')](_0x40142d)[_0x2aec('0x29')](_0x41481f);};}exports['index']=function(_0x233923,_0x54f367){var _0x26e3f5={},_0x2163aa={},_0x55c035={'count':0x0,'rows':[]};var _0x3207a6=_[_0x2aec('0x2a')](db[_0x2aec('0x2b')]['rawAttributes'],function(_0x37921a){return{'name':_0x37921a[_0x2aec('0x2c')],'type':_0x37921a[_0x2aec('0x2d')][_0x2aec('0x2e')]};});_0x2163aa[_0x2aec('0x2f')]=_[_0x2aec('0x2a')](_0x3207a6,_0x2aec('0x28'));_0x2163aa['query']=_[_0x2aec('0x30')](_0x233923[_0x2aec('0x31')]);_0x2163aa[_0x2aec('0x32')]=_[_0x2aec('0x33')](_0x2163aa['model'],_0x2163aa['query']);_0x26e3f5[_0x2aec('0x34')]=_[_0x2aec('0x33')](_0x2163aa['model'],qs[_0x2aec('0x35')](_0x233923[_0x2aec('0x31')][_0x2aec('0x35')]));_0x26e3f5[_0x2aec('0x34')]=_0x26e3f5[_0x2aec('0x34')][_0x2aec('0x36')]?_0x26e3f5[_0x2aec('0x34')]:_0x2163aa[_0x2aec('0x2f')];if(!_0x233923[_0x2aec('0x31')]['hasOwnProperty'](_0x2aec('0x37'))){_0x26e3f5[_0x2aec('0x1e')]=qs['limit'](_0x233923[_0x2aec('0x31')][_0x2aec('0x1e')]);_0x26e3f5[_0x2aec('0x1c')]=qs['offset'](_0x233923[_0x2aec('0x31')][_0x2aec('0x1c')]);}_0x26e3f5[_0x2aec('0x38')]=qs[_0x2aec('0x39')](_0x233923[_0x2aec('0x31')][_0x2aec('0x39')]);_0x26e3f5['where']=qs[_0x2aec('0x32')](_[_0x2aec('0x3a')](_0x233923[_0x2aec('0x31')],_0x2163aa['filters']),_0x3207a6);if(_0x233923[_0x2aec('0x31')][_0x2aec('0x3b')]){_0x26e3f5['where']=_[_0x2aec('0x3c')](_0x26e3f5[_0x2aec('0x3d')],{'$or':_[_0x2aec('0x2a')](_0x3207a6,function(_0x3e30dd){if(_0x3e30dd[_0x2aec('0x2d')]!=='VIRTUAL'){var _0x54f1a2={};_0x54f1a2[_0x3e30dd[_0x2aec('0x28')]]={'$like':'%'+_0x233923[_0x2aec('0x31')][_0x2aec('0x3b')]+'%'};return _0x54f1a2;}})});}_0x26e3f5=_[_0x2aec('0x3c')]({},_0x26e3f5,_0x233923['options']);var _0x307dd2={'where':_0x26e3f5[_0x2aec('0x3d')]};return db[_0x2aec('0x2b')]['count'](_0x307dd2)[_0x2aec('0x25')](function(_0x45eb7e){_0x55c035[_0x2aec('0x1d')]=_0x45eb7e;if(_0x233923['query']['includeAll']){_0x26e3f5[_0x2aec('0x3e')]=[{'all':!![]}];}return db[_0x2aec('0x2b')][_0x2aec('0x3f')](_0x26e3f5);})[_0x2aec('0x25')](function(_0x4e0e7d){_0x55c035['rows']=_0x4e0e7d;return _0x55c035;})[_0x2aec('0x25')](respondWithFilteredResult(_0x54f367,_0x26e3f5))[_0x2aec('0x40')](handleError(_0x54f367,null));};exports[_0x2aec('0x41')]=function(_0x5aef47,_0x499ef9){var _0x4e61fe={'raw':!![],'where':{'id':_0x5aef47[_0x2aec('0x42')]['id']}},_0x23bbe8={};_0x23bbe8[_0x2aec('0x2f')]=_[_0x2aec('0x30')](db[_0x2aec('0x2b')]['rawAttributes']);_0x23bbe8['query']=_[_0x2aec('0x30')](_0x5aef47[_0x2aec('0x31')]);_0x23bbe8[_0x2aec('0x32')]=_[_0x2aec('0x33')](_0x23bbe8[_0x2aec('0x2f')],_0x23bbe8[_0x2aec('0x31')]);_0x4e61fe[_0x2aec('0x34')]=_[_0x2aec('0x33')](_0x23bbe8['model'],qs[_0x2aec('0x35')](_0x5aef47['query']['fields']));_0x4e61fe[_0x2aec('0x34')]=_0x4e61fe[_0x2aec('0x34')][_0x2aec('0x36')]?_0x4e61fe[_0x2aec('0x34')]:_0x23bbe8[_0x2aec('0x2f')];if(_0x5aef47['query'][_0x2aec('0x43')]){_0x4e61fe['include']=[{'all':!![]}];}_0x4e61fe=_['merge']({},_0x4e61fe,_0x5aef47[_0x2aec('0x44')]);return db[_0x2aec('0x2b')][_0x2aec('0x45')](_0x4e61fe)[_0x2aec('0x25')](handleEntityNotFound(_0x499ef9,null))['then'](respondWithResult(_0x499ef9,null))[_0x2aec('0x40')](handleError(_0x499ef9,null));};exports['create']=function(_0x279151,_0x48842d){return db['JscriptySessionReport'][_0x2aec('0x46')](_0x279151[_0x2aec('0x47')],{})[_0x2aec('0x25')](respondWithResult(_0x48842d,0xc9))[_0x2aec('0x40')](handleError(_0x48842d,null));};exports[_0x2aec('0x23')]=function(_0x346314,_0x2788d2){if(_0x346314[_0x2aec('0x47')]['id']){delete _0x346314[_0x2aec('0x47')]['id'];}return db['JscriptySessionReport']['find']({'where':{'id':_0x346314[_0x2aec('0x42')]['id']}})[_0x2aec('0x25')](handleEntityNotFound(_0x2788d2,null))['then'](saveUpdates(_0x346314[_0x2aec('0x47')],null))[_0x2aec('0x25')](respondWithResult(_0x2788d2,null))[_0x2aec('0x40')](handleError(_0x2788d2,null));};exports[_0x2aec('0x24')]=function(_0x5172bf,_0x467afe){return db['JscriptySessionReport'][_0x2aec('0x45')]({'where':{'id':_0x5172bf[_0x2aec('0x42')]['id']}})[_0x2aec('0x25')](handleEntityNotFound(_0x467afe,null))['then'](removeEntity(_0x467afe,null))[_0x2aec('0x40')](handleError(_0x467afe,null));};exports[_0x2aec('0x48')]=function(_0x42d5ea,_0x19396d){return db[_0x2aec('0x2b')]['describe']()[_0x2aec('0x25')](respondWithResult(_0x19396d,null))[_0x2aec('0x40')](handleError(_0x19396d,null));};exports['getQuestions']=function(_0x206917,_0x5ef126,_0x315de0){var _0x1cbe5a={'raw':!![],'where':{}};var _0x5387fa={};var _0x569b21={'count':0x0,'rows':[]};return db[_0x2aec('0x2b')][_0x2aec('0x49')]({'where':{'id':_0x206917[_0x2aec('0x42')]['id']}})[_0x2aec('0x25')](handleEntityNotFound(_0x5ef126,null))['then'](function(_0x18de10){if(_0x18de10){_0x5387fa[_0x2aec('0x2f')]=_[_0x2aec('0x30')](db[_0x2aec('0x4a')]['rawAttributes']);_0x5387fa[_0x2aec('0x31')]=_[_0x2aec('0x30')](_0x206917[_0x2aec('0x31')]);_0x5387fa[_0x2aec('0x32')]=_[_0x2aec('0x33')](_0x5387fa[_0x2aec('0x2f')],_0x5387fa[_0x2aec('0x31')]);_0x1cbe5a['attributes']=_['intersection'](_0x5387fa[_0x2aec('0x2f')],qs[_0x2aec('0x35')](_0x206917[_0x2aec('0x31')][_0x2aec('0x35')]));_0x1cbe5a[_0x2aec('0x34')]=_0x1cbe5a['attributes'][_0x2aec('0x36')]?_0x1cbe5a['attributes']:_0x5387fa[_0x2aec('0x2f')];if(!_0x206917['query'][_0x2aec('0x4b')](_0x2aec('0x37'))){_0x1cbe5a[_0x2aec('0x1e')]=qs[_0x2aec('0x1e')](_0x206917['query']['limit']);_0x1cbe5a[_0x2aec('0x1c')]=qs[_0x2aec('0x1c')](_0x206917[_0x2aec('0x31')][_0x2aec('0x1c')]);}_0x1cbe5a[_0x2aec('0x38')]=qs[_0x2aec('0x39')](_0x206917['query']['sort']);_0x1cbe5a['where']=qs[_0x2aec('0x32')](_[_0x2aec('0x3a')](_0x206917[_0x2aec('0x31')],_0x5387fa[_0x2aec('0x32')]));_0x1cbe5a[_0x2aec('0x3d')][_0x2aec('0x4c')]=_0x18de10['id'];if(_0x206917[_0x2aec('0x31')][_0x2aec('0x3b')]){_0x1cbe5a[_0x2aec('0x3d')]=_['merge'](_0x1cbe5a['where'],{'$or':_[_0x2aec('0x2a')](_0x1cbe5a[_0x2aec('0x34')],function(_0x362200){var _0x2da8f0={};_0x2da8f0[_0x362200]={'$like':'%'+_0x206917[_0x2aec('0x31')][_0x2aec('0x3b')]+'%'};return _0x2da8f0;})});}_0x1cbe5a=_['merge']({},_0x1cbe5a,_0x206917[_0x2aec('0x44')]);return db[_0x2aec('0x4a')]['count']({'where':_0x1cbe5a['where']})[_0x2aec('0x25')](function(_0x17a138){_0x569b21['count']=_0x17a138;if(_0x206917['query']['includeAll']){_0x1cbe5a[_0x2aec('0x3e')]=[{'all':!![]}];}return db[_0x2aec('0x4a')][_0x2aec('0x3f')](_0x1cbe5a);})[_0x2aec('0x25')](function(_0x5bae20){_0x569b21[_0x2aec('0x4d')]=_0x5bae20;return _0x569b21;});}})[_0x2aec('0x25')](respondWithFilteredResult(_0x5ef126,_0x1cbe5a))['catch'](handleError(_0x5ef126,null));}; \ No newline at end of file +var _0x9a88=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','JscriptySessionReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','findOne','JscriptyQuestionReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x1e5fed,_0x512a20){var _0x4a9139=function(_0x22ace9){while(--_0x22ace9){_0x1e5fed['push'](_0x1e5fed['shift']());}};_0x4a9139(++_0x512a20);}(_0x9a88,0x171));var _0x89a8=function(_0x403230,_0x100c91){_0x403230=_0x403230-0x0;var _0x246eb3=_0x9a88[_0x403230];return _0x246eb3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x89a8('0x0'));var zipdir=require(_0x89a8('0x1'));var jsonpatch=require(_0x89a8('0x2'));var rp=require(_0x89a8('0x3'));var moment=require(_0x89a8('0x4'));var BPromise=require(_0x89a8('0x5'));var Mustache=require('mustache');var util=require(_0x89a8('0x6'));var path=require(_0x89a8('0x7'));var sox=require(_0x89a8('0x8'));var csv=require(_0x89a8('0x9'));var ejs=require(_0x89a8('0xa'));var fs=require('fs');var fs_extra=require(_0x89a8('0xb'));var _=require(_0x89a8('0xc'));var squel=require(_0x89a8('0xd'));var crypto=require('crypto');var jsforce=require(_0x89a8('0xe'));var deskjs=require(_0x89a8('0xf'));var toCsv=require(_0x89a8('0x9'));var querystring=require(_0x89a8('0x10'));var Papa=require(_0x89a8('0x11'));var Redis=require(_0x89a8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x89a8('0x13'));var as=require(_0x89a8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x89a8('0x15'))(_0x89a8('0x16'));var utils=require(_0x89a8('0x17'));var config=require(_0x89a8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x89a8('0x19'))['db'];function respondWithStatusCode(_0x2de9cc,_0x4bd88b){_0x4bd88b=_0x4bd88b||0xcc;return function(_0x555f07){if(_0x555f07){return _0x2de9cc[_0x89a8('0x1a')](_0x4bd88b);}return _0x2de9cc['status'](_0x4bd88b)['end']();};}function respondWithResult(_0x2b852e,_0x59fdac){_0x59fdac=_0x59fdac||0xc8;return function(_0x36aeea){if(_0x36aeea){return _0x2b852e['status'](_0x59fdac)[_0x89a8('0x1b')](_0x36aeea);}};}function respondWithFilteredResult(_0x168c09,_0x3cdba4){return function(_0x2a24b9){if(_0x2a24b9){var _0x3ce675=typeof _0x3cdba4[_0x89a8('0x1c')]==='undefined'&&typeof _0x3cdba4[_0x89a8('0x1d')]===_0x89a8('0x1e');var _0x541932=_0x2a24b9[_0x89a8('0x1f')];var _0x1e96e3=_0x3ce675?0x0:_0x3cdba4['offset'];var _0x44bab6=_0x3ce675?_0x2a24b9[_0x89a8('0x1f')]:_0x3cdba4[_0x89a8('0x1c')]+_0x3cdba4[_0x89a8('0x1d')];var _0x31b7e0;if(_0x44bab6>=_0x541932){_0x44bab6=_0x541932;_0x31b7e0=0xc8;}else{_0x31b7e0=0xce;}_0x168c09[_0x89a8('0x20')](_0x31b7e0);return _0x168c09['set'](_0x89a8('0x21'),_0x1e96e3+'-'+_0x44bab6+'/'+_0x541932)['json'](_0x2a24b9);}return null;};}function patchUpdates(_0x784bd4){return function(_0x40ddba){try{jsonpatch[_0x89a8('0x22')](_0x40ddba,_0x784bd4,!![]);}catch(_0x48635d){return BPromise[_0x89a8('0x23')](_0x48635d);}return _0x40ddba['save']();};}function saveUpdates(_0x2ed07c,_0x5f452f){return function(_0x54f2ac){if(_0x54f2ac){return _0x54f2ac[_0x89a8('0x24')](_0x2ed07c)[_0x89a8('0x25')](function(_0x3a2471){return _0x3a2471;});}return null;};}function removeEntity(_0x16c39f,_0xce79bb){return function(_0x5348a3){if(_0x5348a3){return _0x5348a3[_0x89a8('0x26')]()[_0x89a8('0x25')](function(){_0x16c39f[_0x89a8('0x20')](0xcc)[_0x89a8('0x27')]();});}};}function handleEntityNotFound(_0x22bdd8,_0x4f5488){return function(_0x1cf411){if(!_0x1cf411){_0x22bdd8['sendStatus'](0x194);}return _0x1cf411;};}function handleError(_0x4dfcc9,_0x3a6f97){_0x3a6f97=_0x3a6f97||0x1f4;return function(_0x4a6497){logger['error'](_0x4a6497[_0x89a8('0x28')]);if(_0x4a6497['name']){delete _0x4a6497[_0x89a8('0x29')];}_0x4dfcc9[_0x89a8('0x20')](_0x3a6f97)[_0x89a8('0x2a')](_0x4a6497);};}exports[_0x89a8('0x2b')]=function(_0xa042bf,_0x97b83a){var _0x1d1528={},_0xe98fa5={},_0x2b4cf1={'count':0x0,'rows':[]};var _0x29a743=_[_0x89a8('0x2c')](db[_0x89a8('0x2d')]['rawAttributes'],function(_0x2642ce){return{'name':_0x2642ce['fieldName'],'type':_0x2642ce[_0x89a8('0x2e')][_0x89a8('0x2f')]};});_0xe98fa5[_0x89a8('0x30')]=_[_0x89a8('0x2c')](_0x29a743,_0x89a8('0x29'));_0xe98fa5[_0x89a8('0x31')]=_[_0x89a8('0x32')](_0xa042bf[_0x89a8('0x31')]);_0xe98fa5[_0x89a8('0x33')]=_[_0x89a8('0x34')](_0xe98fa5['model'],_0xe98fa5[_0x89a8('0x31')]);_0x1d1528[_0x89a8('0x35')]=_[_0x89a8('0x34')](_0xe98fa5[_0x89a8('0x30')],qs[_0x89a8('0x36')](_0xa042bf[_0x89a8('0x31')][_0x89a8('0x36')]));_0x1d1528[_0x89a8('0x35')]=_0x1d1528[_0x89a8('0x35')][_0x89a8('0x37')]?_0x1d1528[_0x89a8('0x35')]:_0xe98fa5['model'];if(!_0xa042bf[_0x89a8('0x31')][_0x89a8('0x38')](_0x89a8('0x39'))){_0x1d1528[_0x89a8('0x1d')]=qs[_0x89a8('0x1d')](_0xa042bf['query'][_0x89a8('0x1d')]);_0x1d1528['offset']=qs['offset'](_0xa042bf[_0x89a8('0x31')][_0x89a8('0x1c')]);}_0x1d1528[_0x89a8('0x3a')]=qs[_0x89a8('0x3b')](_0xa042bf[_0x89a8('0x31')]['sort']);_0x1d1528['where']=qs[_0x89a8('0x33')](_[_0x89a8('0x3c')](_0xa042bf['query'],_0xe98fa5[_0x89a8('0x33')]),_0x29a743);if(_0xa042bf['query'][_0x89a8('0x3d')]){_0x1d1528[_0x89a8('0x3e')]=_['merge'](_0x1d1528['where'],{'$or':_[_0x89a8('0x2c')](_0x29a743,function(_0x35f829){if(_0x35f829[_0x89a8('0x2e')]!=='VIRTUAL'){var _0x3f7aef={};_0x3f7aef[_0x35f829[_0x89a8('0x29')]]={'$like':'%'+_0xa042bf[_0x89a8('0x31')]['filter']+'%'};return _0x3f7aef;}})});}_0x1d1528=_[_0x89a8('0x3f')]({},_0x1d1528,_0xa042bf[_0x89a8('0x40')]);var _0x25edb8={'where':_0x1d1528['where']};return db['JscriptySessionReport'][_0x89a8('0x1f')](_0x25edb8)['then'](function(_0x3b0a20){_0x2b4cf1[_0x89a8('0x1f')]=_0x3b0a20;if(_0xa042bf[_0x89a8('0x31')][_0x89a8('0x41')]){_0x1d1528[_0x89a8('0x42')]=[{'all':!![]}];}return db[_0x89a8('0x2d')][_0x89a8('0x43')](_0x1d1528);})[_0x89a8('0x25')](function(_0x5a1fcd){_0x2b4cf1[_0x89a8('0x44')]=_0x5a1fcd;return _0x2b4cf1;})[_0x89a8('0x25')](respondWithFilteredResult(_0x97b83a,_0x1d1528))[_0x89a8('0x45')](handleError(_0x97b83a,null));};exports[_0x89a8('0x46')]=function(_0x167792,_0x549ba1){var _0x2893ed={'raw':!![],'where':{'id':_0x167792[_0x89a8('0x47')]['id']}},_0x58f237={};_0x58f237[_0x89a8('0x30')]=_['keys'](db[_0x89a8('0x2d')]['rawAttributes']);_0x58f237[_0x89a8('0x31')]=_[_0x89a8('0x32')](_0x167792[_0x89a8('0x31')]);_0x58f237[_0x89a8('0x33')]=_[_0x89a8('0x34')](_0x58f237['model'],_0x58f237[_0x89a8('0x31')]);_0x2893ed['attributes']=_[_0x89a8('0x34')](_0x58f237['model'],qs['fields'](_0x167792[_0x89a8('0x31')][_0x89a8('0x36')]));_0x2893ed[_0x89a8('0x35')]=_0x2893ed[_0x89a8('0x35')][_0x89a8('0x37')]?_0x2893ed[_0x89a8('0x35')]:_0x58f237[_0x89a8('0x30')];if(_0x167792[_0x89a8('0x31')][_0x89a8('0x41')]){_0x2893ed['include']=[{'all':!![]}];}_0x2893ed=_[_0x89a8('0x3f')]({},_0x2893ed,_0x167792[_0x89a8('0x40')]);return db['JscriptySessionReport']['find'](_0x2893ed)[_0x89a8('0x25')](handleEntityNotFound(_0x549ba1,null))['then'](respondWithResult(_0x549ba1,null))[_0x89a8('0x45')](handleError(_0x549ba1,null));};exports[_0x89a8('0x48')]=function(_0x3b0d6d,_0x240e59){return db['JscriptySessionReport'][_0x89a8('0x48')](_0x3b0d6d[_0x89a8('0x49')],{})[_0x89a8('0x25')](respondWithResult(_0x240e59,0xc9))[_0x89a8('0x45')](handleError(_0x240e59,null));};exports[_0x89a8('0x24')]=function(_0xa48062,_0x1de170){if(_0xa48062[_0x89a8('0x49')]['id']){delete _0xa48062['body']['id'];}return db[_0x89a8('0x2d')]['find']({'where':{'id':_0xa48062[_0x89a8('0x47')]['id']}})[_0x89a8('0x25')](handleEntityNotFound(_0x1de170,null))[_0x89a8('0x25')](saveUpdates(_0xa48062['body'],null))[_0x89a8('0x25')](respondWithResult(_0x1de170,null))[_0x89a8('0x45')](handleError(_0x1de170,null));};exports[_0x89a8('0x26')]=function(_0x5ea8c8,_0x242a0b){return db[_0x89a8('0x2d')]['find']({'where':{'id':_0x5ea8c8[_0x89a8('0x47')]['id']}})[_0x89a8('0x25')](handleEntityNotFound(_0x242a0b,null))[_0x89a8('0x25')](removeEntity(_0x242a0b,null))[_0x89a8('0x45')](handleError(_0x242a0b,null));};exports['describe']=function(_0xeb036c,_0x3aa564){return db['JscriptySessionReport']['describe']()[_0x89a8('0x25')](respondWithResult(_0x3aa564,null))[_0x89a8('0x45')](handleError(_0x3aa564,null));};exports['getQuestions']=function(_0x30937b,_0x32f2f7,_0x4639f7){var _0x300a89={'raw':!![],'where':{}};var _0x38f65e={};var _0x168823={'count':0x0,'rows':[]};return db[_0x89a8('0x2d')][_0x89a8('0x4a')]({'where':{'id':_0x30937b['params']['id']}})[_0x89a8('0x25')](handleEntityNotFound(_0x32f2f7,null))[_0x89a8('0x25')](function(_0x1f1842){if(_0x1f1842){_0x38f65e['model']=_[_0x89a8('0x32')](db[_0x89a8('0x4b')]['rawAttributes']);_0x38f65e[_0x89a8('0x31')]=_[_0x89a8('0x32')](_0x30937b[_0x89a8('0x31')]);_0x38f65e[_0x89a8('0x33')]=_[_0x89a8('0x34')](_0x38f65e['model'],_0x38f65e[_0x89a8('0x31')]);_0x300a89[_0x89a8('0x35')]=_[_0x89a8('0x34')](_0x38f65e[_0x89a8('0x30')],qs[_0x89a8('0x36')](_0x30937b['query']['fields']));_0x300a89[_0x89a8('0x35')]=_0x300a89[_0x89a8('0x35')][_0x89a8('0x37')]?_0x300a89[_0x89a8('0x35')]:_0x38f65e[_0x89a8('0x30')];if(!_0x30937b[_0x89a8('0x31')][_0x89a8('0x38')](_0x89a8('0x39'))){_0x300a89[_0x89a8('0x1d')]=qs[_0x89a8('0x1d')](_0x30937b[_0x89a8('0x31')][_0x89a8('0x1d')]);_0x300a89['offset']=qs[_0x89a8('0x1c')](_0x30937b['query'][_0x89a8('0x1c')]);}_0x300a89[_0x89a8('0x3a')]=qs['sort'](_0x30937b['query']['sort']);_0x300a89[_0x89a8('0x3e')]=qs['filters'](_['pick'](_0x30937b['query'],_0x38f65e[_0x89a8('0x33')]));_0x300a89[_0x89a8('0x3e')]['SessionId']=_0x1f1842['id'];if(_0x30937b[_0x89a8('0x31')][_0x89a8('0x3d')]){_0x300a89[_0x89a8('0x3e')]=_[_0x89a8('0x3f')](_0x300a89['where'],{'$or':_['map'](_0x300a89[_0x89a8('0x35')],function(_0x413b78){var _0x3e091c={};_0x3e091c[_0x413b78]={'$like':'%'+_0x30937b[_0x89a8('0x31')][_0x89a8('0x3d')]+'%'};return _0x3e091c;})});}_0x300a89=_[_0x89a8('0x3f')]({},_0x300a89,_0x30937b[_0x89a8('0x40')]);return db[_0x89a8('0x4b')]['count']({'where':_0x300a89['where']})[_0x89a8('0x25')](function(_0x56eb9a){_0x168823[_0x89a8('0x1f')]=_0x56eb9a;if(_0x30937b[_0x89a8('0x31')][_0x89a8('0x41')]){_0x300a89[_0x89a8('0x42')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x89a8('0x43')](_0x300a89);})['then'](function(_0x9d3a48){_0x168823['rows']=_0x9d3a48;return _0x168823;});}})['then'](respondWithFilteredResult(_0x32f2f7,_0x300a89))[_0x89a8('0x45')](handleError(_0x32f2f7,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 287f391..37a3dd0 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 _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util'];(function(_0x575958,_0xc5b34f){var _0x2448e9=function(_0xa0281e){while(--_0xa0281e){_0x575958['push'](_0x575958['shift']());}};_0x2448e9(++_0xc5b34f);}(_0x5fab,0x177));var _0xb5fa=function(_0x51eb77,_0x436673){_0x51eb77=_0x51eb77-0x0;var _0x4b26fe=_0x5fab[_0x51eb77];return _0x4b26fe;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1883=['../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1ad279,_0x42d157){var _0x272861=function(_0x3cb41f){while(--_0x3cb41f){_0x1ad279['push'](_0x1ad279['shift']());}};_0x272861(++_0x42d157);}(_0x1883,0xab));var _0x3188=function(_0x40c375,_0x8a1a72){_0x40c375=_0x40c375-0x0;var _0x3b23e=_0x1883[_0x40c375];return _0x3b23e;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));module[_0x3188('0xb')]=function(_0x408ae0,_0x33b62d){return _0x408ae0[_0x3188('0xc')](_0x3188('0xd'),attributes,{'tableName':_0x3188('0xe'),'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 fd0fac1..a37f2e9 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 _0x896e=['JscriptySessionReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0xb36ccf,_0x24c93b){var _0x37b01e=function(_0x5d188a){while(--_0x5d188a){_0xb36ccf['push'](_0xb36ccf['shift']());}};_0x37b01e(++_0x24c93b);}(_0x896e,0x1e9));var _0xe896=function(_0xbebd41,_0xbd6c1a){_0xbebd41=_0xbebd41-0x0;var _0x2bd0ab=_0x896e[_0xbebd41];return _0x2bd0ab;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});} \ No newline at end of file +var _0xdf55=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptySessionReport,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x5199d1,_0x3069d9){var _0x5d93ea=function(_0x3c3228){while(--_0x3c3228){_0x5199d1['push'](_0x5199d1['shift']());}};_0x5d93ea(++_0x3069d9);}(_0xdf55,0x83));var _0x5df5=function(_0x413b13,_0x4a25de){_0x413b13=_0x413b13-0x0;var _0x1cad2e=_0xdf55[_0x413b13];return _0x1cad2e;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var moment=require('moment');var BPromise=require(_0x5df5('0x2'));var rs=require(_0x5df5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5df5('0x4'))['db'];var utils=require(_0x5df5('0x5'));var logger=require(_0x5df5('0x6'))('rpc');var config=require(_0x5df5('0x7'));var jayson=require(_0x5df5('0x8'));var client=jayson[_0x5df5('0x9')][_0x5df5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9b8756,_0x2b7ed9,_0x4722a2){return new BPromise(function(_0x3743f3,_0x4d43a3){return client[_0x5df5('0xb')](_0x9b8756,_0x4722a2)[_0x5df5('0xc')](function(_0x41941e){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x2b7ed9,_0x5df5('0xd'));logger['debug'](_0x5df5('0xe'),_0x2b7ed9,_0x5df5('0xd'),JSON['stringify'](_0x41941e));if(_0x41941e['error']){if(_0x41941e[_0x5df5('0xf')][_0x5df5('0x10')]===0x1f4){logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);return _0x4d43a3(_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);}logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e['error'][_0x5df5('0x12')]);return _0x3743f3(_0x41941e['error'][_0x5df5('0x12')]);}else{logger[_0x5df5('0x13')](_0x5df5('0x11'),_0x2b7ed9,_0x5df5('0xd'));_0x3743f3(_0x41941e[_0x5df5('0x14')]['message']);}})[_0x5df5('0x15')](function(_0x457205){logger['error'](_0x5df5('0x11'),_0x2b7ed9,_0x457205);_0x4d43a3(_0x457205);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 6f58683..cb60030 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 _0x79de=['/:id','isAuthenticated','update','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./license.controller','get','index','put'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x79de,0x1a8));var _0xe79d=function(_0x253bd8,_0x301eb2){_0x253bd8=_0x253bd8-0x0;var _0x30d190=_0x79de[_0x253bd8];return _0x30d190;};'use strict';var multer=require(_0xe79d('0x0'));var util=require('util');var path=require(_0xe79d('0x1'));var timeout=require(_0xe79d('0x2'));var express=require(_0xe79d('0x3'));var router=express[_0xe79d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe79d('0x5'));var config=require(_0xe79d('0x6'));var controller=require(_0xe79d('0x7'));router[_0xe79d('0x8')]('/',controller[_0xe79d('0x9')]);router[_0xe79d('0xa')](_0xe79d('0xb'),auth[_0xe79d('0xc')](),controller[_0xe79d('0xd')]);module[_0xe79d('0xe')]=router; \ No newline at end of file +var _0x14f5=['index','put','/:id','isAuthenticated','update','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./license.controller','get'];(function(_0x1af322,_0x16d095){var _0x28ac48=function(_0x32a921){while(--_0x32a921){_0x1af322['push'](_0x1af322['shift']());}};_0x28ac48(++_0x16d095);}(_0x14f5,0xae));var _0x514f=function(_0xa7fb1f,_0x1c49bc){_0xa7fb1f=_0xa7fb1f-0x0;var _0x32e057=_0x14f5[_0xa7fb1f];return _0x32e057;};'use strict';var multer=require('multer');var util=require(_0x514f('0x0'));var path=require('path');var timeout=require(_0x514f('0x1'));var express=require(_0x514f('0x2'));var router=express[_0x514f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x514f('0x4'));var interaction=require(_0x514f('0x5'));var config=require('../../config/environment');var controller=require(_0x514f('0x6'));router[_0x514f('0x7')]('/',controller[_0x514f('0x8')]);router[_0x514f('0x9')](_0x514f('0xa'),auth[_0x514f('0xb')](),controller[_0x514f('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index cab5454..0c35548 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 _0x23ad=['STRING'];(function(_0x584311,_0x1548f3){var _0x35897f=function(_0x3a96ca){while(--_0x3a96ca){_0x584311['push'](_0x584311['shift']());}};_0x35897f(++_0x1548f3);}(_0x23ad,0x182));var _0xd23a=function(_0x4fc3f9,_0x5bac71){_0x4fc3f9=_0x4fc3f9-0x0;var _0x1ee38f=_0x23ad[_0x4fc3f9];return _0x1ee38f;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xd23a('0x0')]},'data2':{'type':Sequelize[_0xd23a('0x0')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6db3=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x1d103b,_0x5d4d48){var _0x33f998=function(_0x2ee696){while(--_0x2ee696){_0x1d103b['push'](_0x1d103b['shift']());}};_0x33f998(++_0x5d4d48);}(_0x6db3,0x10d));var _0x36db=function(_0x27d020,_0x3e50af){_0x27d020=_0x27d020-0x0;var _0x14a24b=_0x6db3[_0x27d020];return _0x14a24b;};'use strict';var Sequelize=require(_0x36db('0x0'));module[_0x36db('0x1')]={'license':{'type':Sequelize[_0x36db('0x2')]},'data1':{'type':Sequelize[_0x36db('0x3')]},'data2':{'type':Sequelize[_0x36db('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x36db('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index a030875..8bf0f7c 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 _0x326f=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','options','getLicense','catch','body','License','find','checkLicense','key','demo','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x326f,0xd1));var _0xf326=function(_0x3ed3a9,_0x542419){_0x3ed3a9=_0x3ed3a9-0x0;var _0x7bb200=_0x326f[_0x3ed3a9];return _0x7bb200;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x6a8e89,_0x1ae23a){var _0x2fa28e={'raw':!![],'where':{'id':0x1}},_0x5dbe63={};_0x5dbe63[_0xf326('0x28')]=_[_0xf326('0x29')](db['License'][_0xf326('0x2a')]);_0x5dbe63[_0xf326('0x2b')]=_[_0xf326('0x29')](_0x6a8e89[_0xf326('0x2b')]);_0x5dbe63[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x5dbe63[_0xf326('0x28')],_0x5dbe63[_0xf326('0x2b')]);_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2d')](_0x5dbe63['model'],qs[_0xf326('0x2f')](_0x6a8e89[_0xf326('0x2b')][_0xf326('0x2f')]));_0x2fa28e['attributes']=_0x2fa28e[_0xf326('0x2e')][_0xf326('0x30')]?_0x2fa28e[_0xf326('0x2e')]:_0x5dbe63['model'];_0x2fa28e=_['merge']({},_0x2fa28e,_0x6a8e89[_0xf326('0x31')]);return utilLicense[_0xf326('0x32')](_0x2fa28e)[_0xf326('0x24')](respondWithResult(_0x1ae23a,null))[_0xf326('0x33')](handleError(_0x1ae23a,null));};exports[_0xf326('0x22')]=function(_0x2e8a64,_0x62585a){if(_0x2e8a64[_0xf326('0x34')]['id']){delete _0x2e8a64['body']['id'];}return db[_0xf326('0x35')][_0xf326('0x36')]({'where':{'id':_0x2e8a64['params']['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x62585a,null))['then'](function(_0xce1cbb){var _0x481b64=_0xce1cbb['get']({'plain':!![]});return utilLicense[_0xf326('0x37')](_0x481b64,_0x2e8a64['body'][_0xf326('0x38')]);})['then'](function(_0x310dbb){if(!_0x310dbb[_0xf326('0x39')]){return saveUpdates(_0x2e8a64[_0xf326('0x34')],null);}return _0x310dbb;})['then'](respondWithResult(_0x62585a,null))[_0xf326('0x33')](handleError(_0x62585a,null));}; \ No newline at end of file +var _0x0295=['demo','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','../../config/license/util','model','keys','rawAttributes','query','filters','intersection','attributes','fields','merge','options','catch','body','License','find','checkLicense','key'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x0295,0x1f0));var _0x5029=function(_0x18528a,_0x4de7d1){_0x18528a=_0x18528a-0x0;var _0x2c3214=_0x0295[_0x18528a];return _0x2c3214;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}var utilLicense=require(_0x5029('0x25'));exports['index']=function(_0x32da06,_0x251f99){var _0xe5313e={'raw':!![],'where':{'id':0x1}},_0x4b6f92={};_0x4b6f92[_0x5029('0x26')]=_[_0x5029('0x27')](db['License'][_0x5029('0x28')]);_0x4b6f92[_0x5029('0x29')]=_[_0x5029('0x27')](_0x32da06[_0x5029('0x29')]);_0x4b6f92[_0x5029('0x2a')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],_0x4b6f92[_0x5029('0x29')]);_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],qs[_0x5029('0x2d')](_0x32da06['query'][_0x5029('0x2d')]));_0xe5313e['attributes']=_0xe5313e[_0x5029('0x2c')]['length']?_0xe5313e['attributes']:_0x4b6f92[_0x5029('0x26')];_0xe5313e=_[_0x5029('0x2e')]({},_0xe5313e,_0x32da06[_0x5029('0x2f')]);return utilLicense['getLicense'](_0xe5313e)[_0x5029('0x20')](respondWithResult(_0x251f99,null))[_0x5029('0x30')](handleError(_0x251f99,null));};exports[_0x5029('0x1f')]=function(_0x29c59a,_0x1bb896){if(_0x29c59a[_0x5029('0x31')]['id']){delete _0x29c59a[_0x5029('0x31')]['id'];}return db[_0x5029('0x32')][_0x5029('0x33')]({'where':{'id':_0x29c59a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bb896,null))[_0x5029('0x20')](function(_0xc110e8){var _0x1b3817=_0xc110e8['get']({'plain':!![]});return utilLicense[_0x5029('0x34')](_0x1b3817,_0x29c59a[_0x5029('0x31')][_0x5029('0x35')]);})['then'](function(_0x4904cc){if(!_0x4904cc[_0x5029('0x36')]){return saveUpdates(_0x29c59a[_0x5029('0x31')],null);}return _0x4904cc;})['then'](respondWithResult(_0x1bb896,null))['catch'](handleError(_0x1bb896,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 38ab078..0451b5c 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 _0xad91=['../../config/environment','./license.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xad91,0xd0));var _0x1ad9=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0xad91[_0x429948];return _0x35d5d1;};'use strict';var _=require(_0x1ad9('0x0'));var util=require(_0x1ad9('0x1'));var logger=require(_0x1ad9('0x2'))(_0x1ad9('0x3'));var moment=require('moment');var BPromise=require(_0x1ad9('0x4'));var rp=require(_0x1ad9('0x5'));var fs=require('fs');var path=require(_0x1ad9('0x6'));var rimraf=require(_0x1ad9('0x7'));var config=require(_0x1ad9('0x8'));var attributes=require(_0x1ad9('0x9'));module[_0x1ad9('0xa')]=function(_0x3f764f,_0x458581){return _0x3f764f[_0x1ad9('0xb')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb77e=['exports','define','License','license','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./license.attributes'];(function(_0x4a0fb7,_0x154bf1){var _0x36ff09=function(_0x21ad9e){while(--_0x21ad9e){_0x4a0fb7['push'](_0x4a0fb7['shift']());}};_0x36ff09(++_0x154bf1);}(_0xb77e,0xb8));var _0xeb77=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xb77e[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require('lodash');var util=require(_0xeb77('0x0'));var logger=require('../../config/logger')(_0xeb77('0x1'));var moment=require(_0xeb77('0x2'));var BPromise=require(_0xeb77('0x3'));var rp=require(_0xeb77('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb77('0x5'));var config=require(_0xeb77('0x6'));var attributes=require(_0xeb77('0x7'));module[_0xeb77('0x8')]=function(_0x37d9fd,_0x49354b){return _0x37d9fd[_0xeb77('0x9')](_0xeb77('0xa'),attributes,{'tableName':_0xeb77('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 47ffb99..10c17e1 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 _0x0f98=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','License,\x20%s,\x20%s','info','request\x20sent','result','catch','lodash','util'];(function(_0x249b56,_0x3cd889){var _0x49ae37=function(_0x59245c){while(--_0x59245c){_0x249b56['push'](_0x249b56['shift']());}};_0x49ae37(++_0x3cd889);}(_0x0f98,0xa6));var _0x80f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f98[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x80f9('0x0'));var util=require(_0x80f9('0x1'));var moment=require(_0x80f9('0x2'));var BPromise=require(_0x80f9('0x3'));var rs=require(_0x80f9('0x4'));var fs=require('fs');var Redis=require(_0x80f9('0x5'));var db=require(_0x80f9('0x6'))['db'];var utils=require(_0x80f9('0x7'));var logger=require('../../config/logger')(_0x80f9('0x8'));var config=require('../../config/environment');var jayson=require(_0x80f9('0x9'));var client=jayson['client'][_0x80f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52446a,_0x538e1f,_0x362139){return new BPromise(function(_0x35b3df,_0x295556){return client[_0x80f9('0xb')](_0x52446a,_0x362139)[_0x80f9('0xc')](function(_0x4f9609){logger['info']('License,\x20%s,\x20%s',_0x538e1f,'request\x20sent');logger[_0x80f9('0xd')](_0x80f9('0xe'),_0x538e1f,'request\x20sent',JSON[_0x80f9('0xf')](_0x4f9609));if(_0x4f9609[_0x80f9('0x10')]){if(_0x4f9609['error'][_0x80f9('0x11')]===0x1f4){logger[_0x80f9('0x10')]('License,\x20%s,\x20%s',_0x538e1f,_0x4f9609[_0x80f9('0x10')]['message']);return _0x295556(_0x4f9609[_0x80f9('0x10')][_0x80f9('0x12')]);}logger[_0x80f9('0x10')](_0x80f9('0x13'),_0x538e1f,_0x4f9609['error']['message']);return _0x35b3df(_0x4f9609[_0x80f9('0x10')][_0x80f9('0x12')]);}else{logger[_0x80f9('0x14')](_0x80f9('0x13'),_0x538e1f,_0x80f9('0x15'));_0x35b3df(_0x4f9609[_0x80f9('0x16')][_0x80f9('0x12')]);}})[_0x80f9('0x17')](function(_0x2976d9){logger[_0x80f9('0x10')]('License,\x20%s,\x20%s',_0x538e1f,_0x2976d9);_0x295556(_0x2976d9);});});} \ No newline at end of file +var _0xfa01=['info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','debug','stringify','error','message','License,\x20%s,\x20%s'];(function(_0x312e52,_0x7b6a6e){var _0x245994=function(_0x597b68){while(--_0x597b68){_0x312e52['push'](_0x312e52['shift']());}};_0x245994(++_0x7b6a6e);}(_0xfa01,0x1a4));var _0x1fa0=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfa01[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x1fa0('0x0'));var util=require(_0x1fa0('0x1'));var moment=require(_0x1fa0('0x2'));var BPromise=require(_0x1fa0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fa0('0x4'));var db=require(_0x1fa0('0x5'))['db'];var utils=require(_0x1fa0('0x6'));var logger=require(_0x1fa0('0x7'))(_0x1fa0('0x8'));var config=require(_0x1fa0('0x9'));var jayson=require(_0x1fa0('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35c0b7,_0x30f74e,_0x31c054){return new BPromise(function(_0x17c675,_0x595947){return client['request'](_0x35c0b7,_0x31c054)[_0x1fa0('0xb')](function(_0x4d0dc3){logger['info']('License,\x20%s,\x20%s',_0x30f74e,'request\x20sent');logger[_0x1fa0('0xc')]('License,\x20%s,\x20%s,\x20%s',_0x30f74e,'request\x20sent',JSON[_0x1fa0('0xd')](_0x4d0dc3));if(_0x4d0dc3['error']){if(_0x4d0dc3[_0x1fa0('0xe')]['code']===0x1f4){logger[_0x1fa0('0xe')]('License,\x20%s,\x20%s',_0x30f74e,_0x4d0dc3[_0x1fa0('0xe')][_0x1fa0('0xf')]);return _0x595947(_0x4d0dc3['error'][_0x1fa0('0xf')]);}logger[_0x1fa0('0xe')](_0x1fa0('0x10'),_0x30f74e,_0x4d0dc3[_0x1fa0('0xe')][_0x1fa0('0xf')]);return _0x17c675(_0x4d0dc3['error'][_0x1fa0('0xf')]);}else{logger[_0x1fa0('0x11')](_0x1fa0('0x10'),_0x30f74e,'request\x20sent');_0x17c675(_0x4d0dc3['result']['message']);}})[_0x1fa0('0x12')](function(_0x11e7ab){logger[_0x1fa0('0xe')](_0x1fa0('0x10'),_0x30f74e,_0x11e7ab);_0x595947(_0x11e7ab);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index aa300c2..136d411 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 _0xcaf9=['fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','addDisposition','post','addAnswer','create','addImap','addSmtp','/:id/send','send','put','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','util','path','connect-timeout','express','Router'];(function(_0x176b9f,_0x3291ee){var _0x6882e6=function(_0x5acc23){while(--_0x5acc23){_0x176b9f['push'](_0x176b9f['shift']());}};_0x6882e6(++_0x3291ee);}(_0xcaf9,0xba));var _0x9caf=function(_0x23ba5c,_0x4d4947){_0x23ba5c=_0x23ba5c-0x0;var _0x3ead0a=_0xcaf9[_0x23ba5c];return _0x3ead0a;};'use strict';var multer=require(_0x9caf('0x0'));var util=require(_0x9caf('0x1'));var path=require(_0x9caf('0x2'));var timeout=require(_0x9caf('0x3'));var express=require(_0x9caf('0x4'));var router=express[_0x9caf('0x5')]();var fs_extra=require(_0x9caf('0x6'));var auth=require(_0x9caf('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9caf('0x8'));var controller=require(_0x9caf('0x9'));router[_0x9caf('0xa')]('/',auth[_0x9caf('0xb')](),controller[_0x9caf('0xc')]);router[_0x9caf('0xa')](_0x9caf('0xd'),auth['isAuthenticated'](),controller[_0x9caf('0xe')]);router[_0x9caf('0xa')](_0x9caf('0xf'),auth[_0x9caf('0xb')](),controller[_0x9caf('0x10')]);router[_0x9caf('0xa')](_0x9caf('0x11'),auth['isAuthenticated'](),controller[_0x9caf('0x12')]);router[_0x9caf('0xa')](_0x9caf('0x13'),auth['isAuthenticated'](),controller[_0x9caf('0x14')]);router[_0x9caf('0xa')](_0x9caf('0x15'),auth['isAuthenticated'](),controller[_0x9caf('0x16')]);router[_0x9caf('0xa')](_0x9caf('0x17'),auth['isAuthenticated'](),controller[_0x9caf('0x18')]);router['get'](_0x9caf('0x19'),auth[_0x9caf('0xb')](),controller[_0x9caf('0x1a')]);router[_0x9caf('0xa')](_0x9caf('0x1b'),auth[_0x9caf('0xb')](),controller[_0x9caf('0x1c')]);router[_0x9caf('0xa')](_0x9caf('0x1d'),auth['isAuthenticated'](),controller[_0x9caf('0x1e')]);router[_0x9caf('0xa')](_0x9caf('0x1f'),auth[_0x9caf('0xb')](),controller['verifySmtp']);router[_0x9caf('0xa')](_0x9caf('0x20'),auth[_0x9caf('0xb')](),controller['getAgents']);router['post']('/:id/dispositions',auth[_0x9caf('0xb')](),controller[_0x9caf('0x21')]);router[_0x9caf('0x22')](_0x9caf('0x13'),auth[_0x9caf('0xb')](),controller[_0x9caf('0x23')]);router[_0x9caf('0x22')]('/',auth[_0x9caf('0xb')](),controller[_0x9caf('0x24')]);router[_0x9caf('0x22')]('/:id/in_servers',auth[_0x9caf('0xb')](),controller[_0x9caf('0x25')]);router[_0x9caf('0x22')](_0x9caf('0x17'),auth[_0x9caf('0xb')](),controller[_0x9caf('0x26')]);router['post']('/:id/interactions',auth[_0x9caf('0xb')](),controller['addInteraction']);router[_0x9caf('0x22')](_0x9caf('0x1b'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x9caf('0x27'),auth['isAuthenticated'](),controller[_0x9caf('0x28')]);router[_0x9caf('0x22')](_0x9caf('0x20'),auth[_0x9caf('0xb')](),controller['addAgents']);router[_0x9caf('0x29')](_0x9caf('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x9caf('0x2a')](_0x9caf('0x11'),auth[_0x9caf('0xb')](),controller['removeDispositions']);router[_0x9caf('0x2a')](_0x9caf('0x13'),auth[_0x9caf('0xb')](),controller[_0x9caf('0x2b')]);router[_0x9caf('0x2a')]('/:id/in_servers',auth[_0x9caf('0xb')](),controller[_0x9caf('0x2c')]);router['delete']('/:id/out_servers',auth[_0x9caf('0xb')](),controller[_0x9caf('0x2d')]);router[_0x9caf('0x2a')](_0x9caf('0xf'),auth[_0x9caf('0xb')](),controller[_0x9caf('0x2e')]);router['delete'](_0x9caf('0x20'),auth[_0x9caf('0xb')](),controller[_0x9caf('0x2f')]);module['exports']=router; \ No newline at end of file +var _0xa2ef=['/:id/dispositions','addDisposition','addAnswer','addImap','addSmtp','addInteraction','/:id/send','send','put','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','./mailAccount.controller','get','isAuthenticated','index','/:id','show','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/verify','verifySmtp','/:id/users','post'];(function(_0x4345ed,_0x1a9ffa){var _0x3b99a0=function(_0xd49e4){while(--_0xd49e4){_0x4345ed['push'](_0x4345ed['shift']());}};_0x3b99a0(++_0x1a9ffa);}(_0xa2ef,0x158));var _0xfa2e=function(_0xe5bfdd,_0x5dba2e){_0xe5bfdd=_0xe5bfdd-0x0;var _0x3040aa=_0xa2ef[_0xe5bfdd];return _0x3040aa;};'use strict';var multer=require(_0xfa2e('0x0'));var util=require('util');var path=require(_0xfa2e('0x1'));var timeout=require('connect-timeout');var express=require(_0xfa2e('0x2'));var router=express[_0xfa2e('0x3')]();var fs_extra=require(_0xfa2e('0x4'));var auth=require(_0xfa2e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfa2e('0x6'));router[_0xfa2e('0x7')]('/',auth[_0xfa2e('0x8')](),controller[_0xfa2e('0x9')]);router['get']('/describe',auth[_0xfa2e('0x8')](),controller['describe']);router[_0xfa2e('0x7')](_0xfa2e('0xa'),auth[_0xfa2e('0x8')](),controller[_0xfa2e('0xb')]);router[_0xfa2e('0x7')]('/:id/dispositions',auth[_0xfa2e('0x8')](),controller['getDispositions']);router[_0xfa2e('0x7')](_0xfa2e('0xc'),auth[_0xfa2e('0x8')](),controller[_0xfa2e('0xd')]);router[_0xfa2e('0x7')](_0xfa2e('0xe'),auth[_0xfa2e('0x8')](),controller[_0xfa2e('0xf')]);router[_0xfa2e('0x7')](_0xfa2e('0x10'),auth[_0xfa2e('0x8')](),controller[_0xfa2e('0x11')]);router[_0xfa2e('0x7')](_0xfa2e('0x12'),auth[_0xfa2e('0x8')](),controller[_0xfa2e('0x13')]);router[_0xfa2e('0x7')](_0xfa2e('0x14'),auth[_0xfa2e('0x8')](),controller['getApplications']);router[_0xfa2e('0x7')]('/:id/messages',auth[_0xfa2e('0x8')](),controller['getMessages']);router[_0xfa2e('0x7')](_0xfa2e('0x15'),auth['isAuthenticated'](),controller[_0xfa2e('0x16')]);router[_0xfa2e('0x7')](_0xfa2e('0x17'),auth[_0xfa2e('0x8')](),controller['getAgents']);router[_0xfa2e('0x18')](_0xfa2e('0x19'),auth[_0xfa2e('0x8')](),controller[_0xfa2e('0x1a')]);router[_0xfa2e('0x18')](_0xfa2e('0xc'),auth['isAuthenticated'](),controller[_0xfa2e('0x1b')]);router[_0xfa2e('0x18')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfa2e('0x18')](_0xfa2e('0xe'),auth['isAuthenticated'](),controller[_0xfa2e('0x1c')]);router[_0xfa2e('0x18')]('/:id/out_servers',auth[_0xfa2e('0x8')](),controller[_0xfa2e('0x1d')]);router[_0xfa2e('0x18')](_0xfa2e('0x12'),auth[_0xfa2e('0x8')](),controller[_0xfa2e('0x1e')]);router['post'](_0xfa2e('0x14'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0xfa2e('0x1f'),auth[_0xfa2e('0x8')](),controller[_0xfa2e('0x20')]);router[_0xfa2e('0x18')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xfa2e('0x21')](_0xfa2e('0xa'),auth[_0xfa2e('0x8')](),controller['update']);router[_0xfa2e('0x22')](_0xfa2e('0x19'),auth[_0xfa2e('0x8')](),controller[_0xfa2e('0x23')]);router[_0xfa2e('0x22')](_0xfa2e('0xc'),auth[_0xfa2e('0x8')](),controller[_0xfa2e('0x24')]);router[_0xfa2e('0x22')](_0xfa2e('0xe'),auth[_0xfa2e('0x8')](),controller[_0xfa2e('0x25')]);router[_0xfa2e('0x22')]('/:id/out_servers',auth[_0xfa2e('0x8')](),controller[_0xfa2e('0x26')]);router[_0xfa2e('0x22')](_0xfa2e('0xa'),auth[_0xfa2e('0x8')](),controller['destroy']);router[_0xfa2e('0x22')](_0xfa2e('0x17'),auth[_0xfa2e('0x8')](),controller[_0xfa2e('0x27')]);module[_0xfa2e('0x28')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 9d17e04..ccb3bb5 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 _0xcca7=['INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x381bf9,_0x40dbd4){var _0x1e1e63=function(_0x16296d){while(--_0x16296d){_0x381bf9['push'](_0x381bf9['shift']());}};_0x1e1e63(++_0x40dbd4);}(_0xcca7,0x1aa));var _0x7cca=function(_0x2126df,_0x5b7c13){_0x2126df=_0x2126df-0x0;var _0x3f2cc2=_0xcca7[_0x2126df];return _0x3f2cc2;};'use strict';var Sequelize=require(_0x7cca('0x0'));module[_0x7cca('0x1')]={'description':{'type':Sequelize[_0x7cca('0x2')]},'name':{'type':Sequelize[_0x7cca('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x7cca('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x7cca('0x4')]},'markAsUnread':{'type':Sequelize[_0x7cca('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x7cca('0x2')],'allowNull':![],'defaultValue':_0x7cca('0x5')},'fontSize':{'type':Sequelize[_0x7cca('0x6')](0x2)[_0x7cca('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x7cca('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7cca('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7cca('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7cca('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7cca('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7cca('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7cca('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7cca('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x7cca('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x7cca('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x302367){if(!_0x302367)this[_0x7cca('0x9')](_0x7cca('0xa'),null);this[_0x7cca('0x9')](_0x7cca('0xb'),_0x302367);}}}; \ No newline at end of file +var _0x7a08=['sequelize','exports','BOOLEAN','STRING','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0xf7bf02,_0x13da13){var _0x4f263f=function(_0x3b5603){while(--_0x3b5603){_0xf7bf02['push'](_0xf7bf02['shift']());}};_0x4f263f(++_0x13da13);}(_0x7a08,0x11e));var _0x87a0=function(_0x29fcaf,_0x20c943){_0x29fcaf=_0x29fcaf-0x0;var _0x4adcb2=_0x7a08[_0x29fcaf];return _0x4adcb2;};'use strict';var Sequelize=require(_0x87a0('0x0'));module[_0x87a0('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x87a0('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x87a0('0x3')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x87a0('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x87a0('0x3')],'allowNull':![]},'template':{'type':Sequelize[_0x87a0('0x4')]},'markAsUnread':{'type':Sequelize[_0x87a0('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x87a0('0x3')],'allowNull':![],'defaultValue':_0x87a0('0x5')},'fontSize':{'type':Sequelize[_0x87a0('0x6')](0x2)[_0x87a0('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x87a0('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x87a0('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x87a0('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x87a0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x87a0('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x87a0('0x6')],'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[_0x87a0('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x87a0('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x87a0('0x2')],'defaultValue':![],'comment':_0x87a0('0x9'),'set':function(_0x34ba3a){if(!_0x34ba3a)this['setDataValue'](_0x87a0('0xa'),null);this[_0x87a0('0xb')](_0x87a0('0xc'),_0x34ba3a);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 3cf5b3b..9a2e138 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 _0xffa3=['ejs','lodash','squel','desk.js','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','client','http','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','undefined','count','offset','limit','Content-Range','apply','save','update','destroy','get','MailAccounts','UserProfileResource','sendStatus','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','rows','show','keys','include','find','body','describe','addDisposition','params','Disposition','create','getDispositions','findOne','length','MailAccountId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','cservice','user','cuser','password','pass','cpassword','authentication','port','host','service','autoAssociation','getImap','addImap','removeImap','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','User','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','MailApplication','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','CmContact','Contacts','updatedAt','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','sendMail','List\x20not\x20found','defaults','messageId','subject','attach','out','Interaction','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xffa3,0x16f));var _0x3ffa=function(_0x33c0cb,_0x5dbf68){_0x33c0cb=_0x33c0cb-0x0;var _0x2351a0=_0xffa3[_0x33c0cb];return _0x2351a0;};'use strict';var emlformat=require(_0x3ffa('0x0'));var rimraf=require(_0x3ffa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ffa('0x2'));var rp=require(_0x3ffa('0x3'));var moment=require(_0x3ffa('0x4'));var BPromise=require(_0x3ffa('0x5'));var Mustache=require(_0x3ffa('0x6'));var util=require(_0x3ffa('0x7'));var path=require(_0x3ffa('0x8'));var sox=require(_0x3ffa('0x9'));var csv=require(_0x3ffa('0xa'));var ejs=require(_0x3ffa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ffa('0xc'));var squel=require(_0x3ffa('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3ffa('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3ffa('0xf'));var htmlToText=require(_0x3ffa('0x10'));var juice=require(_0x3ffa('0x11'));var Redis=require(_0x3ffa('0x12'));var authService=require(_0x3ffa('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3ffa('0x14'));var logger=require(_0x3ffa('0x15'))(_0x3ffa('0x16'));var utils=require('../../config/utils');var config=require(_0x3ffa('0x17'));var licenseUtil=require(_0x3ffa('0x18'));var db=require(_0x3ffa('0x19'))['db'];config[_0x3ffa('0x1a')]=_['defaults'](config['redis'],{'host':_0x3ffa('0x1b'),'port':0x18eb});var socket=require(_0x3ffa('0x1c'))(new Redis(config[_0x3ffa('0x1a')]));require(_0x3ffa('0x1d'))[_0x3ffa('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3ffa('0x1f')][_0x3ffa('0x20')]({'port':0x232b});function respondWithRpcPromise(_0x3c4f02,_0x490bed,_0x5ce171,_0x579690){return new BPromise(function(_0x1608fa,_0x50566b){var _0x50316c=_0x579690||client;return _0x50316c['request'](_0x3c4f02,_0x5ce171)[_0x3ffa('0x21')](function(_0x3994e5){logger['info'](_0x3ffa('0x22'),_0x490bed,_0x3ffa('0x23'));logger[_0x3ffa('0x24')](_0x3ffa('0x25'),_0x490bed,_0x3ffa('0x23'),JSON['stringify'](_0x3994e5));if(_0x3994e5[_0x3ffa('0x26')]){if(_0x3994e5['error'][_0x3ffa('0x27')]===0x1f4){logger[_0x3ffa('0x26')](_0x3ffa('0x22'),_0x490bed,_0x3994e5[_0x3ffa('0x26')][_0x3ffa('0x28')]);return _0x50566b(_0x3994e5[_0x3ffa('0x26')][_0x3ffa('0x28')]);}logger[_0x3ffa('0x26')]('MailAccount,\x20%s,\x20%s',_0x490bed,_0x3994e5[_0x3ffa('0x26')][_0x3ffa('0x28')]);return _0x1608fa(_0x3994e5[_0x3ffa('0x26')][_0x3ffa('0x28')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x490bed,_0x3ffa('0x23'));_0x1608fa(_0x3994e5[_0x3ffa('0x29')][_0x3ffa('0x28')]);}})[_0x3ffa('0x2a')](function(_0x31ad0b){logger[_0x3ffa('0x26')](_0x3ffa('0x22'),_0x490bed,_0x31ad0b);_0x50566b(_0x31ad0b);});});}function respondWithStatusCode(_0x2c8a3f,_0x14671f){_0x14671f=_0x14671f||0xcc;return function(_0x425a13){if(_0x425a13){return _0x2c8a3f['sendStatus'](_0x14671f);}return _0x2c8a3f[_0x3ffa('0x2b')](_0x14671f)[_0x3ffa('0x2c')]();};}function respondWithResult(_0x326172,_0x4bada0){_0x4bada0=_0x4bada0||0xc8;return function(_0x131fad){if(_0x131fad){return _0x326172[_0x3ffa('0x2b')](_0x4bada0)[_0x3ffa('0x2d')](_0x131fad);}};}function respondWithFilteredResult(_0x1a3ffe,_0x41d833){return function(_0x58a104){if(_0x58a104){var _0x14c95b=typeof _0x41d833['offset']===_0x3ffa('0x2e')&&typeof _0x41d833['limit']===_0x3ffa('0x2e');var _0x5b6175=_0x58a104[_0x3ffa('0x2f')];var _0x1cabe3=_0x14c95b?0x0:_0x41d833['offset'];var _0x2621ef=_0x14c95b?_0x58a104[_0x3ffa('0x2f')]:_0x41d833[_0x3ffa('0x30')]+_0x41d833[_0x3ffa('0x31')];var _0x13334d;if(_0x2621ef>=_0x5b6175){_0x2621ef=_0x5b6175;_0x13334d=0xc8;}else{_0x13334d=0xce;}_0x1a3ffe['status'](_0x13334d);return _0x1a3ffe['set'](_0x3ffa('0x32'),_0x1cabe3+'-'+_0x2621ef+'/'+_0x5b6175)[_0x3ffa('0x2d')](_0x58a104);}return null;};}function patchUpdates(_0x44398a){return function(_0x48e253){try{jsonpatch[_0x3ffa('0x33')](_0x48e253,_0x44398a,!![]);}catch(_0xc0c7d1){return BPromise['reject'](_0xc0c7d1);}return _0x48e253[_0x3ffa('0x34')]();};}function saveUpdates(_0xccd591,_0x480bf0){return function(_0xffc2e8){if(_0xffc2e8){return _0xffc2e8[_0x3ffa('0x35')](_0xccd591)[_0x3ffa('0x21')](function(_0x5d1652){return _0x5d1652;});}return null;};}function removeEntity(_0xe63332,_0x3823c7){return function(_0x3a9a94){if(_0x3a9a94){return _0x3a9a94[_0x3ffa('0x36')]()[_0x3ffa('0x21')](function(){var _0x2d2892=_0x3a9a94[_0x3ffa('0x37')]({'plain':!![]});var _0x16ea9c=_0x3ffa('0x38');return db[_0x3ffa('0x39')][_0x3ffa('0x36')]({'where':{'type':_0x16ea9c,'resourceId':_0x2d2892['id']}})['then'](function(){return _0x3a9a94;});})[_0x3ffa('0x21')](function(){_0xe63332[_0x3ffa('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bc84b,_0x27693a){return function(_0x3fe014){if(!_0x3fe014){_0x2bc84b[_0x3ffa('0x3a')](0x194);}return _0x3fe014;};}function handleError(_0xb350eb,_0x24be8b){_0x24be8b=_0x24be8b||0x1f4;return function(_0x2a8526){logger[_0x3ffa('0x26')](_0x2a8526[_0x3ffa('0x3b')]);if(_0x2a8526[_0x3ffa('0x3c')]){delete _0x2a8526[_0x3ffa('0x3c')];}_0xb350eb[_0x3ffa('0x2b')](_0x24be8b)[_0x3ffa('0x3d')](_0x2a8526);};}exports[_0x3ffa('0x3e')]=function(_0x52c91f,_0x49f731){var _0x3fca92={'include':[{'model':db[_0x3ffa('0x3f')],'as':_0x3ffa('0x40')},{'model':db[_0x3ffa('0x41')],'as':_0x3ffa('0x42')},{'model':db[_0x3ffa('0x43')],'as':_0x3ffa('0x44')}]},_0x46d6be={},_0x5d6954={'count':0x0,'rows':[]};var _0x2c6595=_[_0x3ffa('0x45')](db[_0x3ffa('0x46')][_0x3ffa('0x47')],function(_0x3bdc0b){return{'name':_0x3bdc0b[_0x3ffa('0x48')],'type':_0x3bdc0b[_0x3ffa('0x49')][_0x3ffa('0x4a')]};});_0x46d6be[_0x3ffa('0x4b')]=_[_0x3ffa('0x45')](_0x2c6595,'name');_0x46d6be['query']=_['keys'](_0x52c91f['query']);_0x46d6be[_0x3ffa('0x4c')]=_['intersection'](_0x46d6be[_0x3ffa('0x4b')],_0x46d6be[_0x3ffa('0x4d')]);_0x3fca92[_0x3ffa('0x4e')]=_[_0x3ffa('0x4f')](_0x46d6be['model'],qs[_0x3ffa('0x50')](_0x52c91f[_0x3ffa('0x4d')][_0x3ffa('0x50')]));_0x3fca92['attributes']=_0x3fca92[_0x3ffa('0x4e')]['length']?_0x3fca92[_0x3ffa('0x4e')]:_0x46d6be[_0x3ffa('0x4b')];if(!_0x52c91f[_0x3ffa('0x4d')][_0x3ffa('0x51')](_0x3ffa('0x52'))){_0x3fca92[_0x3ffa('0x31')]=qs[_0x3ffa('0x31')](_0x52c91f[_0x3ffa('0x4d')][_0x3ffa('0x31')]);_0x3fca92[_0x3ffa('0x30')]=qs['offset'](_0x52c91f[_0x3ffa('0x4d')][_0x3ffa('0x30')]);}_0x3fca92[_0x3ffa('0x53')]=qs[_0x3ffa('0x54')](_0x52c91f[_0x3ffa('0x4d')][_0x3ffa('0x54')]);_0x3fca92[_0x3ffa('0x55')]=qs[_0x3ffa('0x4c')](_[_0x3ffa('0x56')](_0x52c91f[_0x3ffa('0x4d')],_0x46d6be[_0x3ffa('0x4c')]),_0x2c6595);if(_0x52c91f['query']['filter']){_0x3fca92['where']=_['merge'](_0x3fca92['where'],{'$or':_['map'](_0x2c6595,function(_0x49dd06){if(_0x49dd06['type']!==_0x3ffa('0x57')){var _0x475799={};_0x475799[_0x49dd06[_0x3ffa('0x3c')]]={'$like':'%'+_0x52c91f[_0x3ffa('0x4d')][_0x3ffa('0x58')]+'%'};return _0x475799;}})});}_0x3fca92=_[_0x3ffa('0x59')]({},_0x3fca92,_0x52c91f[_0x3ffa('0x5a')]);var _0x9d2b12={'where':_0x3fca92[_0x3ffa('0x55')]};return db['MailAccount'][_0x3ffa('0x2f')](_0x9d2b12)[_0x3ffa('0x21')](function(_0x9de8cc){_0x5d6954[_0x3ffa('0x2f')]=_0x9de8cc;if(_0x52c91f[_0x3ffa('0x4d')][_0x3ffa('0x5b')]){_0x3fca92['include']=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x3fca92);})[_0x3ffa('0x21')](function(_0x41afcc){_0x5d6954[_0x3ffa('0x5c')]=_0x41afcc;return _0x5d6954;})[_0x3ffa('0x21')](respondWithFilteredResult(_0x49f731,_0x3fca92))['catch'](handleError(_0x49f731,null));};exports[_0x3ffa('0x5d')]=function(_0x27b73d,_0x5cbd7d){var _0x25250c={'raw':![],'where':{'id':_0x27b73d['params']['id']},'include':[{'model':db[_0x3ffa('0x3f')],'as':_0x3ffa('0x40')},{'model':db[_0x3ffa('0x41')],'as':'Smtp'},{'model':db['Pause'],'as':_0x3ffa('0x44')}]},_0x149d3d={};_0x149d3d[_0x3ffa('0x4b')]=_[_0x3ffa('0x5e')](db['MailAccount'][_0x3ffa('0x47')]);_0x149d3d[_0x3ffa('0x4d')]=_['keys'](_0x27b73d['query']);_0x149d3d[_0x3ffa('0x4c')]=_[_0x3ffa('0x4f')](_0x149d3d[_0x3ffa('0x4b')],_0x149d3d['query']);_0x25250c[_0x3ffa('0x4e')]=_[_0x3ffa('0x4f')](_0x149d3d[_0x3ffa('0x4b')],qs[_0x3ffa('0x50')](_0x27b73d[_0x3ffa('0x4d')][_0x3ffa('0x50')]));_0x25250c[_0x3ffa('0x4e')]=_0x25250c['attributes']['length']?_0x25250c['attributes']:_0x149d3d[_0x3ffa('0x4b')];if(_0x27b73d[_0x3ffa('0x4d')][_0x3ffa('0x5b')]){_0x25250c[_0x3ffa('0x5f')]=[{'all':!![]}];}_0x25250c=_[_0x3ffa('0x59')]({},_0x25250c,_0x27b73d[_0x3ffa('0x5a')]);return db[_0x3ffa('0x46')][_0x3ffa('0x60')](_0x25250c)[_0x3ffa('0x21')](handleEntityNotFound(_0x5cbd7d,null))[_0x3ffa('0x21')](respondWithResult(_0x5cbd7d,null))[_0x3ffa('0x2a')](handleError(_0x5cbd7d,null));};exports['update']=function(_0x3610d8,_0x1d45bc){if(_0x3610d8[_0x3ffa('0x61')]['id']){delete _0x3610d8[_0x3ffa('0x61')]['id'];}return db['MailAccount'][_0x3ffa('0x60')]({'where':{'id':_0x3610d8['params']['id']},'include':[{'model':db[_0x3ffa('0x3f')],'as':_0x3ffa('0x40')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x3ffa('0x43')],'as':'mandatoryDispositionPause'}]})[_0x3ffa('0x21')](handleEntityNotFound(_0x1d45bc,null))[_0x3ffa('0x21')](saveUpdates(_0x3610d8[_0x3ffa('0x61')],null))[_0x3ffa('0x21')](function(_0x37fe61){if(_0x37fe61&&_0x3610d8[_0x3ffa('0x61')][_0x3ffa('0x40')]){return db[_0x3ffa('0x3f')][_0x3ffa('0x35')](_0x3610d8[_0x3ffa('0x61')][_0x3ffa('0x40')],{'where':{'MailAccountId':_0x37fe61['id']}})[_0x3ffa('0x21')](function(){return _0x37fe61;});}return _0x37fe61;})[_0x3ffa('0x21')](function(_0x195f07){if(_0x195f07&&_0x3610d8[_0x3ffa('0x61')][_0x3ffa('0x42')]){return db['MailServerOut'][_0x3ffa('0x35')](_0x3610d8[_0x3ffa('0x61')][_0x3ffa('0x42')],{'where':{'MailAccountId':_0x195f07['id']}})[_0x3ffa('0x21')](function(){return _0x195f07;});}return _0x195f07;})['then'](respondWithResult(_0x1d45bc,null))[_0x3ffa('0x2a')](handleError(_0x1d45bc,null));};exports['describe']=function(_0x202320,_0x488f09){return db[_0x3ffa('0x46')][_0x3ffa('0x62')]()[_0x3ffa('0x21')](respondWithResult(_0x488f09,null))[_0x3ffa('0x2a')](handleError(_0x488f09,null));};exports[_0x3ffa('0x63')]=function(_0x13e19c,_0x590f77,_0x45e68c){if(_0x13e19c[_0x3ffa('0x61')]['id']){delete _0x13e19c[_0x3ffa('0x61')]['id'];}return db[_0x3ffa('0x46')][_0x3ffa('0x60')]({'where':{'id':_0x13e19c[_0x3ffa('0x64')]['id']}})['then'](handleEntityNotFound(_0x590f77,null))[_0x3ffa('0x21')](function(_0xfa20b7){if(_0xfa20b7){_0x13e19c[_0x3ffa('0x61')]['MailAccountId']=_0xfa20b7['id'];return db[_0x3ffa('0x65')][_0x3ffa('0x66')](_0x13e19c[_0x3ffa('0x61')]);}})[_0x3ffa('0x21')](respondWithResult(_0x590f77,null))['catch'](handleError(_0x590f77,null));};exports[_0x3ffa('0x67')]=function(_0x591ca2,_0x555826,_0x504f4a){var _0x1a1f10={'raw':![],'where':{}};var _0x376130={};var _0x10bff8={'count':0x0,'rows':[]};return db['MailAccount'][_0x3ffa('0x68')]({'where':{'id':_0x591ca2[_0x3ffa('0x64')]['id']}})[_0x3ffa('0x21')](handleEntityNotFound(_0x555826,null))[_0x3ffa('0x21')](function(_0x44700d){if(_0x44700d){_0x376130[_0x3ffa('0x4b')]=_[_0x3ffa('0x5e')](db[_0x3ffa('0x65')]['rawAttributes']);_0x376130[_0x3ffa('0x4d')]=_[_0x3ffa('0x5e')](_0x591ca2[_0x3ffa('0x4d')]);_0x376130[_0x3ffa('0x4c')]=_['intersection'](_0x376130['model'],_0x376130[_0x3ffa('0x4d')]);_0x1a1f10[_0x3ffa('0x4e')]=_['intersection'](_0x376130['model'],qs[_0x3ffa('0x50')](_0x591ca2['query'][_0x3ffa('0x50')]));_0x1a1f10[_0x3ffa('0x4e')]=_0x1a1f10[_0x3ffa('0x4e')][_0x3ffa('0x69')]?_0x1a1f10[_0x3ffa('0x4e')]:_0x376130['model'];if(!_0x591ca2[_0x3ffa('0x4d')]['hasOwnProperty']('nolimit')){_0x1a1f10[_0x3ffa('0x31')]=qs[_0x3ffa('0x31')](_0x591ca2[_0x3ffa('0x4d')][_0x3ffa('0x31')]);_0x1a1f10['offset']=qs[_0x3ffa('0x30')](_0x591ca2[_0x3ffa('0x4d')][_0x3ffa('0x30')]);}_0x1a1f10['order']=qs[_0x3ffa('0x54')](_0x591ca2[_0x3ffa('0x4d')][_0x3ffa('0x54')]);_0x1a1f10[_0x3ffa('0x55')]=qs[_0x3ffa('0x4c')](_[_0x3ffa('0x56')](_0x591ca2[_0x3ffa('0x4d')],_0x376130[_0x3ffa('0x4c')]));_0x1a1f10['where'][_0x3ffa('0x6a')]=_0x44700d['id'];if(_0x591ca2[_0x3ffa('0x4d')][_0x3ffa('0x58')]){_0x1a1f10['where']=_[_0x3ffa('0x59')](_0x1a1f10[_0x3ffa('0x55')],{'$or':_[_0x3ffa('0x45')](_0x1a1f10[_0x3ffa('0x4e')],function(_0x56308c){var _0x476bde={};_0x476bde[_0x56308c]={'$like':'%'+_0x591ca2['query'][_0x3ffa('0x58')]+'%'};return _0x476bde;})});}_0x1a1f10=_[_0x3ffa('0x59')]({},_0x1a1f10,_0x591ca2['options']);return db[_0x3ffa('0x65')][_0x3ffa('0x2f')]({'where':_0x1a1f10[_0x3ffa('0x55')]})['then'](function(_0x4e21c4){_0x10bff8['count']=_0x4e21c4;if(_0x591ca2[_0x3ffa('0x4d')][_0x3ffa('0x5b')]){_0x1a1f10[_0x3ffa('0x5f')]=[{'all':!![]}];}return db[_0x3ffa('0x65')][_0x3ffa('0x6b')](_0x1a1f10);})[_0x3ffa('0x21')](function(_0xaaf2b4){_0x10bff8[_0x3ffa('0x5c')]=_0xaaf2b4;return _0x10bff8;});}})[_0x3ffa('0x21')](respondWithFilteredResult(_0x555826,_0x1a1f10))[_0x3ffa('0x2a')](handleError(_0x555826,null));};exports[_0x3ffa('0x6c')]=function(_0x4e7a53,_0x39b376,_0x195c73){return db['MailAccount']['find']({'where':{'id':_0x4e7a53['params']['id']}})[_0x3ffa('0x21')](handleEntityNotFound(_0x39b376,null))[_0x3ffa('0x21')](function(_0xae3cd8){if(_0xae3cd8){return _0xae3cd8[_0x3ffa('0x6c')](_0x4e7a53['query'][_0x3ffa('0x6d')]);}})[_0x3ffa('0x21')](respondWithStatusCode(_0x39b376,null))[_0x3ffa('0x2a')](handleError(_0x39b376,null));};exports[_0x3ffa('0x6e')]=function(_0x1c7364,_0x56aa51,_0x1904b6){if(_0x1c7364[_0x3ffa('0x61')]['id']){delete _0x1c7364[_0x3ffa('0x61')]['id'];}return db[_0x3ffa('0x46')]['find']({'where':{'id':_0x1c7364[_0x3ffa('0x64')]['id']}})['then'](handleEntityNotFound(_0x56aa51,null))[_0x3ffa('0x21')](function(_0x1cea42){if(_0x1cea42){_0x1c7364[_0x3ffa('0x61')][_0x3ffa('0x6a')]=_0x1cea42['id'];return db[_0x3ffa('0x6f')][_0x3ffa('0x66')](_0x1c7364[_0x3ffa('0x61')]);}})[_0x3ffa('0x21')](respondWithResult(_0x56aa51,null))['catch'](handleError(_0x56aa51,null));};exports[_0x3ffa('0x70')]=function(_0x4e1950,_0x58e4f2,_0x2e2804){var _0x2fa37c={'raw':![],'where':{}};var _0x513fa3={};var _0x17908a={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x4e1950[_0x3ffa('0x64')]['id']}})['then'](handleEntityNotFound(_0x58e4f2,null))[_0x3ffa('0x21')](function(_0x2ba9c1){if(_0x2ba9c1){_0x513fa3[_0x3ffa('0x4b')]=_[_0x3ffa('0x5e')](db[_0x3ffa('0x6f')][_0x3ffa('0x47')]);_0x513fa3[_0x3ffa('0x4d')]=_[_0x3ffa('0x5e')](_0x4e1950['query']);_0x513fa3['filters']=_[_0x3ffa('0x4f')](_0x513fa3[_0x3ffa('0x4b')],_0x513fa3[_0x3ffa('0x4d')]);_0x2fa37c[_0x3ffa('0x4e')]=_['intersection'](_0x513fa3[_0x3ffa('0x4b')],qs[_0x3ffa('0x50')](_0x4e1950['query'][_0x3ffa('0x50')]));_0x2fa37c[_0x3ffa('0x4e')]=_0x2fa37c[_0x3ffa('0x4e')][_0x3ffa('0x69')]?_0x2fa37c[_0x3ffa('0x4e')]:_0x513fa3[_0x3ffa('0x4b')];if(!_0x4e1950[_0x3ffa('0x4d')][_0x3ffa('0x51')](_0x3ffa('0x52'))){_0x2fa37c[_0x3ffa('0x31')]=qs[_0x3ffa('0x31')](_0x4e1950[_0x3ffa('0x4d')][_0x3ffa('0x31')]);_0x2fa37c[_0x3ffa('0x30')]=qs[_0x3ffa('0x30')](_0x4e1950['query'][_0x3ffa('0x30')]);}_0x2fa37c['order']=qs[_0x3ffa('0x54')](_0x4e1950['query'][_0x3ffa('0x54')]);_0x2fa37c[_0x3ffa('0x55')]=qs[_0x3ffa('0x4c')](_[_0x3ffa('0x56')](_0x4e1950[_0x3ffa('0x4d')],_0x513fa3[_0x3ffa('0x4c')]));_0x2fa37c['where'][_0x3ffa('0x6a')]=_0x2ba9c1['id'];if(_0x4e1950[_0x3ffa('0x4d')]['filter']){_0x2fa37c[_0x3ffa('0x55')]=_[_0x3ffa('0x59')](_0x2fa37c[_0x3ffa('0x55')],{'$or':_['map'](_0x2fa37c['attributes'],function(_0x2387f0){var _0x163aab={};_0x163aab[_0x2387f0]={'$like':'%'+_0x4e1950[_0x3ffa('0x4d')]['filter']+'%'};return _0x163aab;})});}_0x2fa37c=_[_0x3ffa('0x59')]({},_0x2fa37c,_0x4e1950['options']);return db['CannedAnswer'][_0x3ffa('0x2f')]({'where':_0x2fa37c['where']})[_0x3ffa('0x21')](function(_0x1dd9bb){_0x17908a[_0x3ffa('0x2f')]=_0x1dd9bb;if(_0x4e1950[_0x3ffa('0x4d')][_0x3ffa('0x5b')]){_0x2fa37c[_0x3ffa('0x5f')]=[{'all':!![]}];}return db[_0x3ffa('0x6f')]['findAll'](_0x2fa37c);})[_0x3ffa('0x21')](function(_0xb4961e){_0x17908a[_0x3ffa('0x5c')]=_0xb4961e;return _0x17908a;});}})[_0x3ffa('0x21')](respondWithFilteredResult(_0x58e4f2,_0x2fa37c))[_0x3ffa('0x2a')](handleError(_0x58e4f2,null));};exports[_0x3ffa('0x71')]=function(_0x85b75d,_0x409c31,_0x55cc02){return db[_0x3ffa('0x46')]['find']({'where':{'id':_0x85b75d[_0x3ffa('0x64')]['id']}})['then'](handleEntityNotFound(_0x409c31,null))[_0x3ffa('0x21')](function(_0x48f3dd){if(_0x48f3dd){return _0x48f3dd[_0x3ffa('0x71')](_0x85b75d[_0x3ffa('0x4d')][_0x3ffa('0x6d')]);}})[_0x3ffa('0x21')](respondWithStatusCode(_0x409c31,null))[_0x3ffa('0x2a')](handleError(_0x409c31,null));};exports[_0x3ffa('0x66')]=function(_0x22d7d1,_0x4885f4){var _0x5d862c={'name':_0x22d7d1['body'][_0x3ffa('0x3c')],'key':_0x22d7d1['body'][_0x3ffa('0x4a')],'email':_0x22d7d1['body'][_0x3ffa('0x72')],'ListId':_0x22d7d1[_0x3ffa('0x61')][_0x3ffa('0x73')],'active':!_['isNil'](_0x22d7d1['body']['active'])?_0x22d7d1['body']['active']:!![],'description':_0x22d7d1[_0x3ffa('0x61')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0x3ffa('0x74')](_0x22d7d1[_0x3ffa('0x61')][_0x3ffa('0x75')])){if(_0x22d7d1[_0x3ffa('0x61')]['cauthentication']){_0x5d862c[_0x3ffa('0x40')][_0x3ffa('0x76')]=_0x5d862c[_0x3ffa('0x42')]['user']=_0x22d7d1[_0x3ffa('0x61')][_0x3ffa('0x77')];_0x5d862c[_0x3ffa('0x40')][_0x3ffa('0x78')]=_0x5d862c['Smtp'][_0x3ffa('0x79')]=_0x22d7d1['body'][_0x3ffa('0x7a')];}else{_0x5d862c[_0x3ffa('0x40')][_0x3ffa('0x7b')]=_0x5d862c['Smtp'][_0x3ffa('0x7b')]=![];}_0x5d862c[_0x3ffa('0x40')]['host']=_0x22d7d1['body'][_0x3ffa('0x40')]['host'];_0x5d862c['Imap'][_0x3ffa('0x7c')]=_0x22d7d1['body']['Imap'][_0x3ffa('0x7c')];_0x5d862c[_0x3ffa('0x42')][_0x3ffa('0x7d')]=_0x22d7d1[_0x3ffa('0x61')]['Smtp']['host'];_0x5d862c[_0x3ffa('0x42')][_0x3ffa('0x7c')]=_0x22d7d1[_0x3ffa('0x61')][_0x3ffa('0x42')]['port'];}else{_0x5d862c['Imap'][_0x3ffa('0x7e')]=_0x5d862c[_0x3ffa('0x42')][_0x3ffa('0x7e')]=_0x22d7d1[_0x3ffa('0x61')][_0x3ffa('0x75')];_0x5d862c[_0x3ffa('0x40')]['user']=_0x5d862c[_0x3ffa('0x42')][_0x3ffa('0x76')]=_0x22d7d1[_0x3ffa('0x61')][_0x3ffa('0x77')];_0x5d862c[_0x3ffa('0x40')][_0x3ffa('0x78')]=_0x5d862c['Smtp'][_0x3ffa('0x79')]=_0x22d7d1[_0x3ffa('0x61')][_0x3ffa('0x7a')];}return db[_0x3ffa('0x46')]['create'](_0x5d862c,{'include':[{'model':db[_0x3ffa('0x41')],'as':_0x3ffa('0x42')},{'model':db[_0x3ffa('0x3f')],'as':_0x3ffa('0x40')}]})[_0x3ffa('0x21')](function(_0x539098){var _0xc3be39=_0x22d7d1[_0x3ffa('0x76')][_0x3ffa('0x37')]({'plain':!![]});if(!_0xc3be39)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc3be39['role']===_0x3ffa('0x76')){var _0x1ba675=_0x539098[_0x3ffa('0x37')]({'plain':!![]});return db['UserProfileSection'][_0x3ffa('0x60')]({'where':{'name':_0x3ffa('0x38'),'userProfileId':_0xc3be39['userProfileId']},'raw':!![]})[_0x3ffa('0x21')](function(_0x470322){if(_0x470322&&_0x470322[_0x3ffa('0x7f')]===0x0){return db[_0x3ffa('0x39')][_0x3ffa('0x66')]({'name':_0x1ba675[_0x3ffa('0x3c')],'resourceId':_0x1ba675['id'],'type':_0x470322[_0x3ffa('0x3c')],'sectionId':_0x470322['id']},{})[_0x3ffa('0x21')](function(){return _0x539098;});}else{return _0x539098;}})[_0x3ffa('0x2a')](function(_0x14128f){logger[_0x3ffa('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14128f);throw _0x14128f;});}return _0x539098;})['then'](respondWithResult(_0x4885f4,0xc9))[_0x3ffa('0x2a')](handleError(_0x4885f4,null));};exports[_0x3ffa('0x80')]=function(_0x64c24d,_0x69858b,_0x71efa7){return db[_0x3ffa('0x46')][_0x3ffa('0x68')]({'where':{'id':_0x64c24d[_0x3ffa('0x64')]['id']}})[_0x3ffa('0x21')](handleEntityNotFound(_0x69858b,null))[_0x3ffa('0x21')](function(_0x86e157){if(_0x86e157){return _0x86e157[_0x3ffa('0x80')]();}return null;})[_0x3ffa('0x21')](respondWithResult(_0x69858b,null))[_0x3ffa('0x2a')](handleError(_0x69858b,null));};exports[_0x3ffa('0x81')]=function(_0x61a796,_0x9e7993,_0x4dbbfa){if(_0x61a796[_0x3ffa('0x61')]['id']){delete _0x61a796[_0x3ffa('0x61')]['id'];}return db[_0x3ffa('0x46')][_0x3ffa('0x60')]({'where':{'id':_0x61a796['params']['id']}})[_0x3ffa('0x21')](handleEntityNotFound(_0x9e7993,null))['then'](function(_0x271b62){if(_0x271b62){_0x61a796[_0x3ffa('0x61')][_0x3ffa('0x6a')]=_0x271b62['id'];return db[_0x3ffa('0x3f')][_0x3ffa('0x66')](_0x61a796[_0x3ffa('0x61')]);}})['then'](respondWithResult(_0x9e7993,null))[_0x3ffa('0x2a')](handleError(_0x9e7993,null));};exports[_0x3ffa('0x82')]=function(_0x2139f5,_0x4538d3,_0x91f254){return db[_0x3ffa('0x46')][_0x3ffa('0x68')]({'where':{'id':_0x2139f5[_0x3ffa('0x64')]['id']}})['then'](handleEntityNotFound(_0x4538d3,null))['then'](function(_0xc2ad88){if(_0xc2ad88){return _0xc2ad88['setImap'](null);}return null;})[_0x3ffa('0x21')](respondWithStatusCode(_0x4538d3,null))['catch'](handleError(_0x4538d3,null));};exports['getSmtp']=function(_0x263e9b,_0x55a2bf,_0x405af2){return db[_0x3ffa('0x46')][_0x3ffa('0x68')]({'where':{'id':_0x263e9b[_0x3ffa('0x64')]['id']}})[_0x3ffa('0x21')](handleEntityNotFound(_0x55a2bf,null))['then'](function(_0x5002dc){if(_0x5002dc){return _0x5002dc['getSmtp']();}return null;})[_0x3ffa('0x21')](respondWithResult(_0x55a2bf,null))[_0x3ffa('0x2a')](handleError(_0x55a2bf,null));};exports[_0x3ffa('0x83')]=function(_0x49466f,_0x30ab0c,_0x14efc0){if(_0x49466f[_0x3ffa('0x61')]['id']){delete _0x49466f[_0x3ffa('0x61')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x49466f[_0x3ffa('0x64')]['id']}})[_0x3ffa('0x21')](handleEntityNotFound(_0x30ab0c,null))[_0x3ffa('0x21')](function(_0xb9cbd6){if(_0xb9cbd6){_0x49466f[_0x3ffa('0x61')][_0x3ffa('0x6a')]=_0xb9cbd6['id'];return db[_0x3ffa('0x41')][_0x3ffa('0x66')](_0x49466f['body']);}})[_0x3ffa('0x21')](respondWithResult(_0x30ab0c,null))[_0x3ffa('0x2a')](handleError(_0x30ab0c,null));};exports[_0x3ffa('0x84')]=function(_0x32b13b,_0x3ddd09,_0x102638){return db['MailAccount'][_0x3ffa('0x68')]({'where':{'id':_0x32b13b[_0x3ffa('0x64')]['id']}})[_0x3ffa('0x21')](handleEntityNotFound(_0x3ddd09,null))[_0x3ffa('0x21')](function(_0x1bd399){if(_0x1bd399){return _0x1bd399[_0x3ffa('0x85')](null);}return null;})[_0x3ffa('0x21')](respondWithStatusCode(_0x3ddd09,null))[_0x3ffa('0x2a')](handleError(_0x3ddd09,null));};exports['addInteraction']=function(_0x22139c,_0x48778e,_0x1cf22b){return db[_0x3ffa('0x86')][_0x3ffa('0x60')]({'where':{'id':_0x22139c[_0x3ffa('0x64')]['id']}})[_0x3ffa('0x21')](handleEntityNotFound(_0x48778e,null))['then'](function(_0x48fe70){if(_0x48fe70){return _0x48fe70[_0x3ffa('0x87')](_0x22139c['body']['ids'],_[_0x3ffa('0x88')](_0x22139c[_0x3ffa('0x61')],['ids','id'])||{});}})['then'](respondWithResult(_0x48778e,null))['catch'](handleError(_0x48778e,null));};exports['getInteractions']=function(_0x1a3ca8,_0x6d6847,_0x10579f){var _0x3f5b22={'raw':![],'where':{}};var _0x461437={};var _0x1513b8={'count':0x0,'rows':[]};return db['MailAccount'][_0x3ffa('0x68')]({'where':{'id':_0x1a3ca8[_0x3ffa('0x64')]['id']}})['then'](handleEntityNotFound(_0x6d6847,null))[_0x3ffa('0x21')](function(_0x17e95b){if(_0x17e95b){_0x461437[_0x3ffa('0x4b')]=_[_0x3ffa('0x5e')](db[_0x3ffa('0x86')][_0x3ffa('0x47')]);_0x461437['query']=_[_0x3ffa('0x5e')](_0x1a3ca8[_0x3ffa('0x4d')]);_0x461437[_0x3ffa('0x4c')]=_[_0x3ffa('0x4f')](_0x461437[_0x3ffa('0x4b')],_0x461437[_0x3ffa('0x4d')]);_0x3f5b22[_0x3ffa('0x4e')]=_[_0x3ffa('0x4f')](_0x461437[_0x3ffa('0x4b')],qs[_0x3ffa('0x50')](_0x1a3ca8[_0x3ffa('0x4d')][_0x3ffa('0x50')]));_0x3f5b22[_0x3ffa('0x4e')]=_0x3f5b22[_0x3ffa('0x4e')][_0x3ffa('0x69')]?_0x3f5b22['attributes']:_0x461437['model'];if(!_0x1a3ca8[_0x3ffa('0x4d')]['hasOwnProperty'](_0x3ffa('0x52'))){_0x3f5b22[_0x3ffa('0x31')]=qs[_0x3ffa('0x31')](_0x1a3ca8[_0x3ffa('0x4d')][_0x3ffa('0x31')]);_0x3f5b22[_0x3ffa('0x30')]=qs[_0x3ffa('0x30')](_0x1a3ca8[_0x3ffa('0x4d')][_0x3ffa('0x30')]);}_0x3f5b22[_0x3ffa('0x53')]=qs[_0x3ffa('0x54')](_0x1a3ca8[_0x3ffa('0x4d')][_0x3ffa('0x54')]);_0x3f5b22[_0x3ffa('0x55')]=qs[_0x3ffa('0x4c')](_[_0x3ffa('0x56')](_0x1a3ca8[_0x3ffa('0x4d')],_0x461437[_0x3ffa('0x4c')]));_0x3f5b22[_0x3ffa('0x55')][_0x3ffa('0x6a')]=_0x17e95b['id'];if(_0x1a3ca8['query'][_0x3ffa('0x58')]){_0x3f5b22[_0x3ffa('0x55')]=_[_0x3ffa('0x59')](_0x3f5b22[_0x3ffa('0x55')],{'$or':_[_0x3ffa('0x45')](_0x3f5b22['attributes'],function(_0x714e3){var _0x28c361={};_0x28c361[_0x714e3]={'$like':'%'+_0x1a3ca8[_0x3ffa('0x4d')][_0x3ffa('0x58')]+'%'};return _0x28c361;})});}_0x3f5b22=_[_0x3ffa('0x59')]({},_0x3f5b22,_0x1a3ca8[_0x3ffa('0x5a')]);return db[_0x3ffa('0x86')]['count']({'where':_0x3f5b22[_0x3ffa('0x55')]})[_0x3ffa('0x21')](function(_0xe44936){_0x1513b8[_0x3ffa('0x2f')]=_0xe44936;if(_0x1a3ca8[_0x3ffa('0x4d')][_0x3ffa('0x5b')]){_0x3f5b22['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x3ffa('0x89')],'as':'Owner','attributes':[_0x3ffa('0x3c'),_0x3ffa('0x8a'),_0x3ffa('0x8b')],'required':![]},{'model':db[_0x3ffa('0x8c')],'as':_0x3ffa('0x8d'),'attributes':['id',_0x3ffa('0x3c'),'color'],'where':_0x1a3ca8['query']['tag']?{'id':_0x1a3ca8[_0x3ffa('0x4d')][_0x3ffa('0x8e')]}:undefined,'required':_0x1a3ca8[_0x3ffa('0x4d')]['tag']?!![]:![]}];}return db[_0x3ffa('0x86')][_0x3ffa('0x6b')](_0x3f5b22);})[_0x3ffa('0x21')](function(_0x48c787){_0x1513b8[_0x3ffa('0x5c')]=_0x48c787;return _0x1513b8;});}})[_0x3ffa('0x21')](respondWithFilteredResult(_0x6d6847,_0x3f5b22))[_0x3ffa('0x2a')](handleError(_0x6d6847,null));};exports[_0x3ffa('0x8f')]=function(_0x56c55f,_0x779d94,_0x48c85e){return db['MailAccount'][_0x3ffa('0x68')]({'where':{'id':_0x56c55f[_0x3ffa('0x64')]['id']}})[_0x3ffa('0x21')](handleEntityNotFound(_0x779d94,null))[_0x3ffa('0x21')](function(_0x15a52f){if(_0x15a52f){return db[_0x3ffa('0x90')][_0x3ffa('0x91')](function(_0x11d8e1){return db[_0x3ffa('0x92')]['destroy']({'where':{'MailAccountId':_0x56c55f['params']['id']},'transaction':_0x11d8e1})['then'](function(_0x2b5979){var _0xe719d8=_[_0x3ffa('0x45')](_0x56c55f[_0x3ffa('0x61')],function(_0x23f63c){_0x23f63c[_0x3ffa('0x6a')]=_0x56c55f[_0x3ffa('0x64')]['id'];return _0x23f63c;});return db[_0x3ffa('0x92')]['bulkCreate'](_0xe719d8,{'transaction':_0x11d8e1});});})[_0x3ffa('0x21')](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x56c55f['params']['id']},'order':_0x3ffa('0x93')});});}})['then'](respondWithResult(_0x779d94,null))['catch'](handleError(_0x779d94,null));};exports[_0x3ffa('0x94')]=function(_0x34d170,_0x3f9533,_0x137d0f){var _0x3b277b={};var _0x477e1f={};var _0xd2f477;var _0x2c1af1;return db[_0x3ffa('0x46')][_0x3ffa('0x68')]({'where':{'id':_0x34d170[_0x3ffa('0x64')]['id']}})[_0x3ffa('0x21')](handleEntityNotFound(_0x3f9533,null))[_0x3ffa('0x21')](function(_0x4ad5ff){if(_0x4ad5ff){_0xd2f477=_0x4ad5ff;_0x477e1f[_0x3ffa('0x4b')]=_['keys'](db[_0x3ffa('0x92')]['rawAttributes']);_0x477e1f['query']=_[_0x3ffa('0x5e')](_0x34d170['query']);_0x477e1f[_0x3ffa('0x4c')]=_[_0x3ffa('0x4f')](_0x477e1f['model'],_0x477e1f[_0x3ffa('0x4d')]);_0x3b277b[_0x3ffa('0x4e')]=_[_0x3ffa('0x4f')](_0x477e1f[_0x3ffa('0x4b')],qs[_0x3ffa('0x50')](_0x34d170['query'][_0x3ffa('0x50')]));_0x3b277b[_0x3ffa('0x4e')]=_0x3b277b[_0x3ffa('0x4e')][_0x3ffa('0x69')]?_0x3b277b[_0x3ffa('0x4e')]:_0x477e1f[_0x3ffa('0x4b')];_0x3b277b['order']=qs[_0x3ffa('0x54')](_0x34d170['query'][_0x3ffa('0x54')]);_0x3b277b[_0x3ffa('0x55')]=qs[_0x3ffa('0x4c')](_[_0x3ffa('0x56')](_0x34d170['query'],_0x477e1f[_0x3ffa('0x4c')]));if(_0x34d170[_0x3ffa('0x4d')][_0x3ffa('0x58')]){_0x3b277b[_0x3ffa('0x55')]=_['merge'](_0x3b277b[_0x3ffa('0x55')],{'$or':_[_0x3ffa('0x45')](_0x3b277b['attributes'],function(_0x321acf){var _0x162d73={};_0x162d73[_0x321acf]={'$like':'%'+_0x34d170[_0x3ffa('0x4d')][_0x3ffa('0x58')]+'%'};return _0x162d73;})});}_0x3b277b=_[_0x3ffa('0x59')]({},_0x3b277b,_0x34d170[_0x3ffa('0x5a')]);return _0xd2f477[_0x3ffa('0x94')](_0x3b277b);}})[_0x3ffa('0x21')](function(_0x515eac){if(_0x515eac){_0x2c1af1=_0x515eac[_0x3ffa('0x69')];if(!_0x34d170[_0x3ffa('0x4d')][_0x3ffa('0x51')]('nolimit')){_0x3b277b[_0x3ffa('0x31')]=qs[_0x3ffa('0x31')](_0x34d170['query'][_0x3ffa('0x31')]);_0x3b277b[_0x3ffa('0x30')]=qs['offset'](_0x34d170[_0x3ffa('0x4d')][_0x3ffa('0x30')]);}return _0xd2f477['getApplications'](_0x3b277b);}})[_0x3ffa('0x21')](function(_0x436ed7){if(_0x436ed7){return _0x436ed7?{'count':_0x2c1af1,'rows':_0x436ed7}:null;}})['then'](respondWithResult(_0x3f9533,null))[_0x3ffa('0x2a')](handleError(_0x3f9533,null));};exports[_0x3ffa('0x95')]=function(_0x22e3ce,_0x3f51f2,_0x572707){var _0x401762={'raw':!![],'where':{}};var _0x42c784={};var _0x2fa4e4={'count':0x0,'rows':[]};return db[_0x3ffa('0x46')][_0x3ffa('0x68')]({'where':{'id':_0x22e3ce[_0x3ffa('0x64')]['id']}})[_0x3ffa('0x21')](handleEntityNotFound(_0x3f51f2,null))['then'](function(_0x3803e1){if(_0x3803e1){_0x42c784[_0x3ffa('0x4b')]=_['keys'](db[_0x3ffa('0x96')][_0x3ffa('0x47')]);_0x42c784[_0x3ffa('0x4d')]=_[_0x3ffa('0x5e')](_0x22e3ce[_0x3ffa('0x4d')]);_0x42c784[_0x3ffa('0x4c')]=_['intersection'](_0x42c784[_0x3ffa('0x4b')],_0x42c784['query']);_0x401762[_0x3ffa('0x4e')]=_[_0x3ffa('0x4f')](_0x42c784['model'],qs['fields'](_0x22e3ce['query']['fields']));_0x401762[_0x3ffa('0x4e')]=_0x401762[_0x3ffa('0x4e')][_0x3ffa('0x69')]?_0x401762[_0x3ffa('0x4e')]:_0x42c784[_0x3ffa('0x4b')];if(!_0x22e3ce['query']['hasOwnProperty']('nolimit')){_0x401762['limit']=qs[_0x3ffa('0x31')](_0x22e3ce[_0x3ffa('0x4d')]['limit']);_0x401762['offset']=qs[_0x3ffa('0x30')](_0x22e3ce[_0x3ffa('0x4d')][_0x3ffa('0x30')]);}_0x401762['order']=qs[_0x3ffa('0x54')](_0x22e3ce[_0x3ffa('0x4d')][_0x3ffa('0x54')]);_0x401762[_0x3ffa('0x55')]=qs[_0x3ffa('0x4c')](_[_0x3ffa('0x56')](_0x22e3ce[_0x3ffa('0x4d')],_0x42c784[_0x3ffa('0x4c')]));_0x401762['where']['MailAccountId']=_0x3803e1['id'];if(_0x22e3ce[_0x3ffa('0x4d')]['filter']){_0x401762[_0x3ffa('0x55')]=_[_0x3ffa('0x59')](_0x401762[_0x3ffa('0x55')],{'$or':_[_0x3ffa('0x45')](_0x401762[_0x3ffa('0x4e')],function(_0x139656){var _0x5a3887={};_0x5a3887[_0x139656]={'$like':'%'+_0x22e3ce[_0x3ffa('0x4d')]['filter']+'%'};return _0x5a3887;})});}if(_0x22e3ce[_0x3ffa('0x4d')][_0x3ffa('0x97')]){var _0x1d502a=_0x22e3ce[_0x3ffa('0x4d')]['$gte'][_0x3ffa('0x98')](',');var _0x2ffed9={};_0x2ffed9[_0x1d502a[0x0]]={'$gte':moment(_0x1d502a[0x1])[_0x3ffa('0x99')](_0x3ffa('0x9a'))};_0x401762[_0x3ffa('0x55')]=_[_0x3ffa('0x59')](_0x401762[_0x3ffa('0x55')],_0x2ffed9);}_0x401762=_[_0x3ffa('0x59')]({},_0x401762,_0x22e3ce['options']);return db['MailMessage']['count']({'where':_0x401762[_0x3ffa('0x55')]})[_0x3ffa('0x21')](function(_0x541f2c){_0x2fa4e4[_0x3ffa('0x2f')]=_0x541f2c;if(_0x22e3ce[_0x3ffa('0x4d')][_0x3ffa('0x5b')]){_0x401762[_0x3ffa('0x5f')]=[{'all':!![]}];}return db[_0x3ffa('0x96')][_0x3ffa('0x6b')](_0x401762);})[_0x3ffa('0x21')](function(_0x21d128){if(_0x22e3ce[_0x3ffa('0x4d')]['inlineCss']===_0x3ffa('0x9b')){for(var _0x3b91c3=0x0;_0x3b91c3<_0x21d128[_0x3ffa('0x69')];_0x3b91c3++){_0x21d128[_0x3b91c3]['body']=juice(_0x21d128[_0x3b91c3][_0x3ffa('0x61')]);}}_0x2fa4e4[_0x3ffa('0x5c')]=_0x21d128;return _0x2fa4e4;});}})[_0x3ffa('0x21')](respondWithFilteredResult(_0x3f51f2,_0x401762))[_0x3ffa('0x2a')](handleError(_0x3f51f2,null));};exports['send']=function(_0x547836,_0x59c9cd,_0x48fd67){var _0x457873,_0x267d95={},_0x4f496a;if(_0x547836[_0x3ffa('0x61')]['to']){_0x4f496a=_0x547836['body']['to']['split'](',')[0x0];}return db['MailAccount'][_0x3ffa('0x60')]({'where':{'id':_0x547836[_0x3ffa('0x64')]['id']},'include':[{'model':db[_0x3ffa('0x9c')],'as':_0x3ffa('0x9d'),'include':[{'model':db[_0x3ffa('0x9e')],'as':_0x3ffa('0x9f'),'where':{'email':_0x4f496a},'limit':0x1,'order':[[_0x3ffa('0xa0'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0x3ffa('0x42'),'raw':!![]}]})[_0x3ffa('0x21')](handleEntityNotFound(_0x59c9cd,null))[_0x3ffa('0x21')](function(_0x1fbe02){if(_0x1fbe02){_0x457873=_0x1fbe02;if(_0x1fbe02[_0x3ffa('0x42')]){if(_[_0x3ffa('0x74')](_0x547836['body'][_0x3ffa('0xa1')])){_0x547836['body'][_0x3ffa('0xa1')]=util[_0x3ffa('0x99')](_0x3ffa('0xa2'),_0x1fbe02['name'],_0x1fbe02[_0x3ffa('0x72')]||_0x1fbe02[_0x3ffa('0x42')][_0x3ffa('0x76')]);}if(_0x547836[_0x3ffa('0x61')]['attachments']&&_0x547836[_0x3ffa('0x61')][_0x3ffa('0xa3')][_0x3ffa('0x69')]){for(var _0x494ab5=0x0;_0x494ab5<_0x547836[_0x3ffa('0x61')][_0x3ffa('0xa3')][_0x3ffa('0x69')];_0x494ab5+=0x1){_0x547836['body'][_0x3ffa('0xa3')][_0x494ab5]={'filename':_0x547836['body']['attachments'][_0x494ab5][_0x3ffa('0x3c')],'path':path[_0x3ffa('0xa4')](config[_0x3ffa('0xa5')],_0x3ffa('0xa6'),_0x547836[_0x3ffa('0x61')]['attachments'][_0x494ab5][_0x3ffa('0xa7')])};}}var _0x428120={'tls':{'rejectUnauthorized':![]}};if(_[_0x3ffa('0x74')](_0x1fbe02[_0x3ffa('0x42')][_0x3ffa('0x7e')])){if(_0x1fbe02[_0x3ffa('0x42')]['authentication']){_0x428120[_0x3ffa('0xa8')]={'user':_0x1fbe02[_0x3ffa('0x42')][_0x3ffa('0x76')],'pass':_0x1fbe02['Smtp'][_0x3ffa('0x79')]};}_0x428120[_0x3ffa('0x7d')]=_0x1fbe02[_0x3ffa('0x42')][_0x3ffa('0x7d')];_0x428120[_0x3ffa('0x7c')]=_0x1fbe02[_0x3ffa('0x42')][_0x3ffa('0x7c')];_0x428120[_0x3ffa('0xa9')]=_0x1fbe02[_0x3ffa('0x42')]['secure'];}else{_0x428120[_0x3ffa('0x7e')]=_0x1fbe02[_0x3ffa('0x42')][_0x3ffa('0x7e')];_0x428120[_0x3ffa('0xa8')]={'user':_0x1fbe02[_0x3ffa('0x42')][_0x3ffa('0x76')],'pass':_0x1fbe02['Smtp'][_0x3ffa('0x79')]};}return respondWithRpcPromise('SendMail',_0x3ffa('0xaa'),{'account':_0x428120,'message':_0x547836[_0x3ffa('0x61')]});}else{throw new Error(_0x3ffa('0xab'));}}})['then'](function(_0x2afc56){if(_0x2afc56){_0x267d95=_0x2afc56;if(_0x457873[_0x3ffa('0x9d')]){if(_0x457873[_0x3ffa('0x9d')][_0x3ffa('0x9f')]['length']){return _0x457873[_0x3ffa('0x9d')][_0x3ffa('0x9f')][0x0];}else{return db['CmContact'][_0x3ffa('0x66')](_[_0x3ffa('0xac')](_0x547836[_0x3ffa('0x61')],{'firstName':_0x547836['body']['to'],'email':_0x547836[_0x3ffa('0x61')]['to'],'phone':_0x547836['body']['to'],'ListId':_0x457873[_0x3ffa('0x73')]}));}}else{throw new Error(_0x3ffa('0xab'));}}})[_0x3ffa('0x21')](function(_0x42196f){if(_0x42196f){var _0x2be2df={'UserId':_0x547836[_0x3ffa('0x76')]['id'],'ContactId':_0x42196f['id'],'MailAccountId':_0x457873['id'],'inReplyTo':_0x267d95[_0x3ffa('0xad')],'to':_0x547836[_0x3ffa('0x61')][_0x3ffa('0xa1')],'cc':_0x547836[_0x3ffa('0x61')]['cc'],'subject':_0x547836[_0x3ffa('0x61')][_0x3ffa('0xae')],'attach':_0x547836[_0x3ffa('0x61')][_0x3ffa('0xaf')],'firstMsgDirection':_0x3ffa('0xb0'),'lastMsgAt':moment()[_0x3ffa('0x99')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x3ffa('0xb0'),'Messages':[_[_0x3ffa('0x59')](_0x547836['body'],{'messageId':_0x267d95[_0x3ffa('0xad')],'sentAt':moment()[_0x3ffa('0x99')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x457873['id'],'UserId':_0x547836[_0x3ffa('0x76')]['id'],'ContactId':_0x42196f['id']})]};if(_0x547836['body']['Interaction']){_0x2be2df=_[_0x3ffa('0x59')](_0x2be2df,_0x547836[_0x3ffa('0x61')][_0x3ffa('0xb1')]);}return db['MailInteraction']['create'](_0x2be2df,{'include':[{'model':db[_0x3ffa('0x96')],'as':'Messages'}]});}})[_0x3ffa('0x21')](respondWithResult(_0x59c9cd,null))[_0x3ffa('0x2a')](handleError(_0x59c9cd,null));};exports[_0x3ffa('0xb2')]=function(_0x294fe8,_0x5731e6,_0x23171c){return db['MailAccount'][_0x3ffa('0x60')]({'where':{'id':_0x294fe8[_0x3ffa('0x64')]['id']},'include':[{'model':db[_0x3ffa('0x41')],'as':_0x3ffa('0x42'),'raw':!![]}]})['then'](handleEntityNotFound(_0x5731e6,null))[_0x3ffa('0x21')](function(_0x3e41d4){if(_0x3e41d4&&_0x3e41d4[_0x3ffa('0x42')]){var _0x534639={'id':_0x3e41d4['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3e41d4[_0x3ffa('0x42')][_0x3ffa('0x7e')]){_0x534639[_0x3ffa('0x7e')]=_0x3e41d4[_0x3ffa('0x42')][_0x3ffa('0x7e')];}else{_0x534639[_0x3ffa('0x7d')]=_0x3e41d4[_0x3ffa('0x42')][_0x3ffa('0x7d')];_0x534639['port']=_0x3e41d4[_0x3ffa('0x42')][_0x3ffa('0x7c')];_0x534639[_0x3ffa('0xa9')]=_0x3e41d4['Smtp']['secure'];}if(_0x3e41d4['Smtp'][_0x3ffa('0x7b')]){_0x534639['auth']={'user':_0x3e41d4[_0x3ffa('0x42')][_0x3ffa('0x76')],'pass':_0x3e41d4[_0x3ffa('0x42')][_0x3ffa('0x79')]};}return respondWithRpcPromise('VerifySmtp',_0x3ffa('0xb2'),{'account':_0x534639});}})[_0x3ffa('0x21')](respondWithResult(_0x5731e6,null))['catch'](handleError(_0x5731e6,null));};exports[_0x3ffa('0x36')]=function(_0xaf94ad,_0x3d0ef2){return db[_0x3ffa('0x46')][_0x3ffa('0x60')]({'where':{'id':_0xaf94ad[_0x3ffa('0x64')]['id']}})[_0x3ffa('0x21')](handleEntityNotFound(_0x3d0ef2,null))['then'](function(_0x29470f){if(_0x29470f&&_0x29470f[_0x3ffa('0x7e')]){throw new db[(_0x3ffa('0xb3'))][(_0x3ffa('0xb4'))](_0x3ffa('0xb5'));}return _0x29470f;})['then'](removeEntity(_0x3d0ef2,null))[_0x3ffa('0x2a')](handleError(_0x3d0ef2,null));};exports[_0x3ffa('0xb6')]=function(_0x11351c,_0x5d07c5,_0x11e42c){return db[_0x3ffa('0x46')][_0x3ffa('0x60')]({'where':{'id':_0x11351c[_0x3ffa('0x64')]['id']}})['then'](handleEntityNotFound(_0x5d07c5,null))[_0x3ffa('0x21')](function(_0x10f13b){if(_0x10f13b){return _0x10f13b[_0x3ffa('0xb6')](_0x11351c[_0x3ffa('0x61')][_0x3ffa('0x6d')],_[_0x3ffa('0x88')](_0x11351c[_0x3ffa('0x61')],[_0x3ffa('0x6d'),'id'])||{})[_0x3ffa('0xb7')](function(_0x876dda){for(var _0x4a51a0=0x0;_0x4a51a0<_0x11351c[_0x3ffa('0x61')]['ids']['length'];_0x4a51a0+=0x1){socket[_0x3ffa('0xb8')](_0x3ffa('0xb9'),{'UserId':Number(_0x11351c['body'][_0x3ffa('0x6d')][_0x4a51a0]),'MailAccountId':Number(_0x11351c[_0x3ffa('0x64')]['id'])});}return _0x876dda;});}})[_0x3ffa('0x21')](respondWithResult(_0x5d07c5,null))[_0x3ffa('0x2a')](handleError(_0x5d07c5,null));};exports[_0x3ffa('0xba')]=function(_0x4186af,_0x6a5173,_0x549f8b){return db[_0x3ffa('0x46')]['find']({'where':{'id':_0x4186af['params']['id']}})[_0x3ffa('0x21')](handleEntityNotFound(_0x6a5173,null))['then'](function(_0x18aef9){if(_0x18aef9){return _0x18aef9['removeAgents'](_0x4186af[_0x3ffa('0x4d')][_0x3ffa('0x6d')])['then'](function(){if(_['isArray'](_0x4186af['query']['ids'])){for(var _0x474589=0x0;_0x474589<_0x4186af['query'][_0x3ffa('0x6d')][_0x3ffa('0x69')];_0x474589+=0x1){socket['emit'](_0x3ffa('0xbb'),{'UserId':Number(_0x4186af[_0x3ffa('0x4d')]['ids'][_0x474589]),'MailAccountId':Number(_0x4186af['params']['id'])});}}else{socket['emit'](_0x3ffa('0xbb'),{'UserId':Number(_0x4186af[_0x3ffa('0x4d')][_0x3ffa('0x6d')]),'MailAccountId':Number(_0x4186af['params']['id'])});}});}})['then'](respondWithStatusCode(_0x6a5173,null))['catch'](handleError(_0x6a5173,null));};exports[_0x3ffa('0xbc')]=function(_0x1d4f0e,_0x4daa44,_0x2a5daa){var _0x366ae6={};var _0x3681c2={};var _0x95b7d4;var _0x5f403a;return db[_0x3ffa('0x46')][_0x3ffa('0x68')]({'where':{'id':_0x1d4f0e[_0x3ffa('0x64')]['id']}})[_0x3ffa('0x21')](handleEntityNotFound(_0x4daa44,null))[_0x3ffa('0x21')](function(_0xfe5cb7){if(_0xfe5cb7){_0x95b7d4=_0xfe5cb7;_0x3681c2[_0x3ffa('0x4b')]=_['keys'](db[_0x3ffa('0x89')][_0x3ffa('0x47')]);_0x3681c2[_0x3ffa('0x4d')]=_['keys'](_0x1d4f0e[_0x3ffa('0x4d')]);_0x3681c2['filters']=_[_0x3ffa('0x4f')](_0x3681c2['model'],_0x3681c2['query']);_0x366ae6[_0x3ffa('0x4e')]=_[_0x3ffa('0x4f')](_0x3681c2[_0x3ffa('0x4b')],qs[_0x3ffa('0x50')](_0x1d4f0e[_0x3ffa('0x4d')][_0x3ffa('0x50')]));_0x366ae6[_0x3ffa('0x4e')]=_0x366ae6[_0x3ffa('0x4e')][_0x3ffa('0x69')]?_0x366ae6[_0x3ffa('0x4e')]:_0x3681c2[_0x3ffa('0x4b')];_0x366ae6[_0x3ffa('0x53')]=qs[_0x3ffa('0x54')](_0x1d4f0e[_0x3ffa('0x4d')][_0x3ffa('0x54')]);_0x366ae6[_0x3ffa('0x55')]=qs['filters'](_['pick'](_0x1d4f0e['query'],_0x3681c2[_0x3ffa('0x4c')]));if(_0x1d4f0e[_0x3ffa('0x4d')][_0x3ffa('0x58')]){_0x366ae6[_0x3ffa('0x55')]=_[_0x3ffa('0x59')](_0x366ae6['where'],{'$or':_[_0x3ffa('0x45')](_0x366ae6[_0x3ffa('0x4e')],function(_0x3a2d9d){var _0x43dd1c={};_0x43dd1c[_0x3a2d9d]={'$like':'%'+_0x1d4f0e[_0x3ffa('0x4d')][_0x3ffa('0x58')]+'%'};return _0x43dd1c;})});}_0x366ae6=_['merge']({},_0x366ae6,_0x1d4f0e['options']);return _0x95b7d4[_0x3ffa('0xbc')](_0x366ae6);}})[_0x3ffa('0x21')](function(_0x522401){if(_0x522401){_0x5f403a=_0x522401['length'];if(!_0x1d4f0e[_0x3ffa('0x4d')]['hasOwnProperty'](_0x3ffa('0x52'))){_0x366ae6[_0x3ffa('0x31')]=qs['limit'](_0x1d4f0e['query'][_0x3ffa('0x31')]);_0x366ae6[_0x3ffa('0x30')]=qs[_0x3ffa('0x30')](_0x1d4f0e['query'][_0x3ffa('0x30')]);}return _0x95b7d4[_0x3ffa('0xbc')](_0x366ae6);}})[_0x3ffa('0x21')](function(_0x4ae052){if(_0x4ae052){return _0x4ae052?{'count':_0x5f403a,'rows':_0x4ae052}:null;}})[_0x3ffa('0x21')](respondWithResult(_0x4daa44,null))[_0x3ffa('0x2a')](handleError(_0x4daa44,null));}; \ No newline at end of file +var _0x70f7=['include','findAll','params','Imap','fields','find','body','Smtp','Pause','describe','MailAccountId','Disposition','create','getDispositions','findOne','rows','removeDispositions','ids','CannedAnswer','removeAnswers','email','ListId','active','description','isNil','cauthentication','user','password','pass','cpassword','host','port','service','cservice','cuser','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','getInteractions','CmContact','Contact','User','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','updatedAt','from','%s\x20<%s>','attachments','server/files/attachments','secure','auth','SendMail','sendMail','List\x20not\x20found','Contacts','defaults','messageId','subject','attach','out','Interaction','Messages','verifySmtp','authentication','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','removeAgents','userMailAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./mailAccount.socket','register','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','save','update','destroy','get','MailAccounts','stack','name','send','index','MailServerIn','MailServerOut','mandatoryDispositionPause','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailAccount','includeAll'];(function(_0x30d953,_0x1331a5){var _0x46b995=function(_0xd417c7){while(--_0xd417c7){_0x30d953['push'](_0x30d953['shift']());}};_0x46b995(++_0x1331a5);}(_0x70f7,0x12d));var _0x770f=function(_0x55af86,_0x5c8ff6){_0x55af86=_0x55af86-0x0;var _0x58df3b=_0x70f7[_0x55af86];return _0x58df3b;};'use strict';var emlformat=require(_0x770f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x770f('0x1'));var jsonpatch=require(_0x770f('0x2'));var rp=require(_0x770f('0x3'));var moment=require(_0x770f('0x4'));var BPromise=require(_0x770f('0x5'));var Mustache=require(_0x770f('0x6'));var util=require('util');var path=require('path');var sox=require(_0x770f('0x7'));var csv=require(_0x770f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x770f('0x9'));var crypto=require(_0x770f('0xa'));var jsforce=require(_0x770f('0xb'));var deskjs=require(_0x770f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x770f('0xd'));var Papa=require(_0x770f('0xe'));var htmlToText=require(_0x770f('0xf'));var juice=require(_0x770f('0x10'));var Redis=require(_0x770f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x770f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x770f('0x13'));var utils=require(_0x770f('0x14'));var config=require(_0x770f('0x15'));var licenseUtil=require(_0x770f('0x16'));var db=require(_0x770f('0x17'))['db'];config['redis']=_['defaults'](config[_0x770f('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x770f('0x19'))(new Redis(config[_0x770f('0x18')]));require(_0x770f('0x1a'))[_0x770f('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x770f('0x1c')][_0x770f('0x1d')]({'port':0x232b});function respondWithRpcPromise(_0x128fec,_0xd52bf9,_0x21b26e,_0x348c9f){return new BPromise(function(_0x194428,_0x4c9af0){var _0xd24ad0=_0x348c9f||client;return _0xd24ad0[_0x770f('0x1e')](_0x128fec,_0x21b26e)[_0x770f('0x1f')](function(_0x43075f){logger[_0x770f('0x20')](_0x770f('0x21'),_0xd52bf9,_0x770f('0x22'));logger[_0x770f('0x23')](_0x770f('0x24'),_0xd52bf9,_0x770f('0x22'),JSON[_0x770f('0x25')](_0x43075f));if(_0x43075f[_0x770f('0x26')]){if(_0x43075f[_0x770f('0x26')][_0x770f('0x27')]===0x1f4){logger[_0x770f('0x26')](_0x770f('0x21'),_0xd52bf9,_0x43075f['error'][_0x770f('0x28')]);return _0x4c9af0(_0x43075f[_0x770f('0x26')][_0x770f('0x28')]);}logger['error'](_0x770f('0x21'),_0xd52bf9,_0x43075f[_0x770f('0x26')]['message']);return _0x194428(_0x43075f[_0x770f('0x26')][_0x770f('0x28')]);}else{logger[_0x770f('0x20')](_0x770f('0x21'),_0xd52bf9,_0x770f('0x22'));_0x194428(_0x43075f['result'][_0x770f('0x28')]);}})[_0x770f('0x29')](function(_0x27064b){logger[_0x770f('0x26')](_0x770f('0x21'),_0xd52bf9,_0x27064b);_0x4c9af0(_0x27064b);});});}function respondWithStatusCode(_0x5e1ecf,_0x4e70d0){_0x4e70d0=_0x4e70d0||0xcc;return function(_0x525dd3){if(_0x525dd3){return _0x5e1ecf[_0x770f('0x2a')](_0x4e70d0);}return _0x5e1ecf[_0x770f('0x2b')](_0x4e70d0)[_0x770f('0x2c')]();};}function respondWithResult(_0x2e1c47,_0x107a6a){_0x107a6a=_0x107a6a||0xc8;return function(_0x36bc5c){if(_0x36bc5c){return _0x2e1c47['status'](_0x107a6a)[_0x770f('0x2d')](_0x36bc5c);}};}function respondWithFilteredResult(_0x4e1843,_0x16d393){return function(_0x58b95f){if(_0x58b95f){var _0x4707ff=typeof _0x16d393[_0x770f('0x2e')]===_0x770f('0x2f')&&typeof _0x16d393['limit']===_0x770f('0x2f');var _0x23ed5e=_0x58b95f[_0x770f('0x30')];var _0x49dc04=_0x4707ff?0x0:_0x16d393[_0x770f('0x2e')];var _0xfd9507=_0x4707ff?_0x58b95f[_0x770f('0x30')]:_0x16d393[_0x770f('0x2e')]+_0x16d393['limit'];var _0x1ed169;if(_0xfd9507>=_0x23ed5e){_0xfd9507=_0x23ed5e;_0x1ed169=0xc8;}else{_0x1ed169=0xce;}_0x4e1843[_0x770f('0x2b')](_0x1ed169);return _0x4e1843[_0x770f('0x31')](_0x770f('0x32'),_0x49dc04+'-'+_0xfd9507+'/'+_0x23ed5e)[_0x770f('0x2d')](_0x58b95f);}return null;};}function patchUpdates(_0x18996c){return function(_0x15dc4d){try{jsonpatch['apply'](_0x15dc4d,_0x18996c,!![]);}catch(_0x3209ca){return BPromise['reject'](_0x3209ca);}return _0x15dc4d[_0x770f('0x33')]();};}function saveUpdates(_0x409caf,_0xf03cef){return function(_0x41577b){if(_0x41577b){return _0x41577b[_0x770f('0x34')](_0x409caf)[_0x770f('0x1f')](function(_0x4e1736){return _0x4e1736;});}return null;};}function removeEntity(_0x358a3a,_0x4e4c65){return function(_0x609c0c){if(_0x609c0c){return _0x609c0c[_0x770f('0x35')]()['then'](function(){var _0x28cb4d=_0x609c0c[_0x770f('0x36')]({'plain':!![]});var _0x8096f2=_0x770f('0x37');return db['UserProfileResource'][_0x770f('0x35')]({'where':{'type':_0x8096f2,'resourceId':_0x28cb4d['id']}})['then'](function(){return _0x609c0c;});})['then'](function(){_0x358a3a['status'](0xcc)[_0x770f('0x2c')]();});}};}function handleEntityNotFound(_0x213812,_0x15d705){return function(_0xba734f){if(!_0xba734f){_0x213812[_0x770f('0x2a')](0x194);}return _0xba734f;};}function handleError(_0x248413,_0x3f0db2){_0x3f0db2=_0x3f0db2||0x1f4;return function(_0x2a2707){logger['error'](_0x2a2707[_0x770f('0x38')]);if(_0x2a2707[_0x770f('0x39')]){delete _0x2a2707[_0x770f('0x39')];}_0x248413[_0x770f('0x2b')](_0x3f0db2)[_0x770f('0x3a')](_0x2a2707);};}exports[_0x770f('0x3b')]=function(_0x688d53,_0x573a78){var _0x297ec7={'include':[{'model':db[_0x770f('0x3c')],'as':'Imap'},{'model':db[_0x770f('0x3d')],'as':'Smtp'},{'model':db['Pause'],'as':_0x770f('0x3e')}]},_0x4a80f0={},_0x4e12b3={'count':0x0,'rows':[]};var _0x495c23=_[_0x770f('0x3f')](db['MailAccount'][_0x770f('0x40')],function(_0x4bdcad){return{'name':_0x4bdcad['fieldName'],'type':_0x4bdcad[_0x770f('0x41')][_0x770f('0x42')]};});_0x4a80f0[_0x770f('0x43')]=_[_0x770f('0x3f')](_0x495c23,_0x770f('0x39'));_0x4a80f0[_0x770f('0x44')]=_[_0x770f('0x45')](_0x688d53[_0x770f('0x44')]);_0x4a80f0[_0x770f('0x46')]=_[_0x770f('0x47')](_0x4a80f0['model'],_0x4a80f0[_0x770f('0x44')]);_0x297ec7[_0x770f('0x48')]=_[_0x770f('0x47')](_0x4a80f0[_0x770f('0x43')],qs['fields'](_0x688d53[_0x770f('0x44')]['fields']));_0x297ec7['attributes']=_0x297ec7['attributes'][_0x770f('0x49')]?_0x297ec7['attributes']:_0x4a80f0[_0x770f('0x43')];if(!_0x688d53[_0x770f('0x44')][_0x770f('0x4a')](_0x770f('0x4b'))){_0x297ec7[_0x770f('0x4c')]=qs[_0x770f('0x4c')](_0x688d53[_0x770f('0x44')][_0x770f('0x4c')]);_0x297ec7[_0x770f('0x2e')]=qs[_0x770f('0x2e')](_0x688d53['query']['offset']);}_0x297ec7[_0x770f('0x4d')]=qs[_0x770f('0x4e')](_0x688d53[_0x770f('0x44')]['sort']);_0x297ec7[_0x770f('0x4f')]=qs[_0x770f('0x46')](_[_0x770f('0x50')](_0x688d53[_0x770f('0x44')],_0x4a80f0[_0x770f('0x46')]),_0x495c23);if(_0x688d53[_0x770f('0x44')][_0x770f('0x51')]){_0x297ec7['where']=_[_0x770f('0x52')](_0x297ec7[_0x770f('0x4f')],{'$or':_['map'](_0x495c23,function(_0x59d4b5){if(_0x59d4b5[_0x770f('0x41')]!==_0x770f('0x53')){var _0x4b4bc7={};_0x4b4bc7[_0x59d4b5[_0x770f('0x39')]]={'$like':'%'+_0x688d53['query'][_0x770f('0x51')]+'%'};return _0x4b4bc7;}})});}_0x297ec7=_[_0x770f('0x52')]({},_0x297ec7,_0x688d53[_0x770f('0x54')]);var _0x314fa7={'where':_0x297ec7['where']};return db[_0x770f('0x55')]['count'](_0x314fa7)['then'](function(_0x5c8735){_0x4e12b3[_0x770f('0x30')]=_0x5c8735;if(_0x688d53[_0x770f('0x44')][_0x770f('0x56')]){_0x297ec7[_0x770f('0x57')]=[{'all':!![]}];}return db[_0x770f('0x55')][_0x770f('0x58')](_0x297ec7);})[_0x770f('0x1f')](function(_0x2e8ac3){_0x4e12b3['rows']=_0x2e8ac3;return _0x4e12b3;})[_0x770f('0x1f')](respondWithFilteredResult(_0x573a78,_0x297ec7))[_0x770f('0x29')](handleError(_0x573a78,null));};exports['show']=function(_0x49e0bf,_0x1c1da8){var _0x52c968={'raw':![],'where':{'id':_0x49e0bf[_0x770f('0x59')]['id']},'include':[{'model':db[_0x770f('0x3c')],'as':_0x770f('0x5a')},{'model':db[_0x770f('0x3d')],'as':'Smtp'},{'model':db['Pause'],'as':_0x770f('0x3e')}]},_0x43af12={};_0x43af12[_0x770f('0x43')]=_[_0x770f('0x45')](db[_0x770f('0x55')][_0x770f('0x40')]);_0x43af12[_0x770f('0x44')]=_[_0x770f('0x45')](_0x49e0bf[_0x770f('0x44')]);_0x43af12[_0x770f('0x46')]=_['intersection'](_0x43af12[_0x770f('0x43')],_0x43af12['query']);_0x52c968[_0x770f('0x48')]=_['intersection'](_0x43af12[_0x770f('0x43')],qs['fields'](_0x49e0bf['query'][_0x770f('0x5b')]));_0x52c968[_0x770f('0x48')]=_0x52c968[_0x770f('0x48')]['length']?_0x52c968[_0x770f('0x48')]:_0x43af12[_0x770f('0x43')];if(_0x49e0bf[_0x770f('0x44')]['includeAll']){_0x52c968[_0x770f('0x57')]=[{'all':!![]}];}_0x52c968=_[_0x770f('0x52')]({},_0x52c968,_0x49e0bf[_0x770f('0x54')]);return db[_0x770f('0x55')][_0x770f('0x5c')](_0x52c968)[_0x770f('0x1f')](handleEntityNotFound(_0x1c1da8,null))['then'](respondWithResult(_0x1c1da8,null))['catch'](handleError(_0x1c1da8,null));};exports[_0x770f('0x34')]=function(_0x2ff172,_0x8cb5a5){if(_0x2ff172[_0x770f('0x5d')]['id']){delete _0x2ff172[_0x770f('0x5d')]['id'];}return db['MailAccount'][_0x770f('0x5c')]({'where':{'id':_0x2ff172['params']['id']},'include':[{'model':db[_0x770f('0x3c')],'as':_0x770f('0x5a')},{'model':db['MailServerOut'],'as':_0x770f('0x5e')},{'model':db[_0x770f('0x5f')],'as':_0x770f('0x3e')}]})[_0x770f('0x1f')](handleEntityNotFound(_0x8cb5a5,null))[_0x770f('0x1f')](saveUpdates(_0x2ff172[_0x770f('0x5d')],null))[_0x770f('0x1f')](function(_0xe10918){if(_0xe10918&&_0x2ff172[_0x770f('0x5d')][_0x770f('0x5a')]){return db[_0x770f('0x3c')][_0x770f('0x34')](_0x2ff172[_0x770f('0x5d')][_0x770f('0x5a')],{'where':{'MailAccountId':_0xe10918['id']}})['then'](function(){return _0xe10918;});}return _0xe10918;})[_0x770f('0x1f')](function(_0x481b60){if(_0x481b60&&_0x2ff172[_0x770f('0x5d')]['Smtp']){return db[_0x770f('0x3d')]['update'](_0x2ff172['body'][_0x770f('0x5e')],{'where':{'MailAccountId':_0x481b60['id']}})['then'](function(){return _0x481b60;});}return _0x481b60;})[_0x770f('0x1f')](respondWithResult(_0x8cb5a5,null))['catch'](handleError(_0x8cb5a5,null));};exports['describe']=function(_0x9d287e,_0x489c59){return db[_0x770f('0x55')][_0x770f('0x60')]()[_0x770f('0x1f')](respondWithResult(_0x489c59,null))[_0x770f('0x29')](handleError(_0x489c59,null));};exports['addDisposition']=function(_0x40bf5f,_0x513a69,_0x553628){if(_0x40bf5f[_0x770f('0x5d')]['id']){delete _0x40bf5f[_0x770f('0x5d')]['id'];}return db[_0x770f('0x55')][_0x770f('0x5c')]({'where':{'id':_0x40bf5f[_0x770f('0x59')]['id']}})[_0x770f('0x1f')](handleEntityNotFound(_0x513a69,null))[_0x770f('0x1f')](function(_0x3df7b0){if(_0x3df7b0){_0x40bf5f[_0x770f('0x5d')][_0x770f('0x61')]=_0x3df7b0['id'];return db[_0x770f('0x62')][_0x770f('0x63')](_0x40bf5f[_0x770f('0x5d')]);}})[_0x770f('0x1f')](respondWithResult(_0x513a69,null))[_0x770f('0x29')](handleError(_0x513a69,null));};exports[_0x770f('0x64')]=function(_0x2da039,_0x2a058b,_0x481ec5){var _0x175019={'raw':![],'where':{}};var _0x516273={};var _0x382448={'count':0x0,'rows':[]};return db[_0x770f('0x55')][_0x770f('0x65')]({'where':{'id':_0x2da039[_0x770f('0x59')]['id']}})[_0x770f('0x1f')](handleEntityNotFound(_0x2a058b,null))[_0x770f('0x1f')](function(_0x29be99){if(_0x29be99){_0x516273[_0x770f('0x43')]=_[_0x770f('0x45')](db[_0x770f('0x62')]['rawAttributes']);_0x516273[_0x770f('0x44')]=_[_0x770f('0x45')](_0x2da039[_0x770f('0x44')]);_0x516273[_0x770f('0x46')]=_['intersection'](_0x516273[_0x770f('0x43')],_0x516273[_0x770f('0x44')]);_0x175019['attributes']=_['intersection'](_0x516273[_0x770f('0x43')],qs[_0x770f('0x5b')](_0x2da039[_0x770f('0x44')][_0x770f('0x5b')]));_0x175019[_0x770f('0x48')]=_0x175019['attributes'][_0x770f('0x49')]?_0x175019[_0x770f('0x48')]:_0x516273[_0x770f('0x43')];if(!_0x2da039[_0x770f('0x44')][_0x770f('0x4a')](_0x770f('0x4b'))){_0x175019[_0x770f('0x4c')]=qs[_0x770f('0x4c')](_0x2da039[_0x770f('0x44')][_0x770f('0x4c')]);_0x175019[_0x770f('0x2e')]=qs[_0x770f('0x2e')](_0x2da039[_0x770f('0x44')][_0x770f('0x2e')]);}_0x175019[_0x770f('0x4d')]=qs['sort'](_0x2da039[_0x770f('0x44')][_0x770f('0x4e')]);_0x175019[_0x770f('0x4f')]=qs['filters'](_[_0x770f('0x50')](_0x2da039['query'],_0x516273[_0x770f('0x46')]));_0x175019[_0x770f('0x4f')]['MailAccountId']=_0x29be99['id'];if(_0x2da039[_0x770f('0x44')][_0x770f('0x51')]){_0x175019['where']=_[_0x770f('0x52')](_0x175019[_0x770f('0x4f')],{'$or':_[_0x770f('0x3f')](_0x175019[_0x770f('0x48')],function(_0x4eddd1){var _0x4b28bc={};_0x4b28bc[_0x4eddd1]={'$like':'%'+_0x2da039[_0x770f('0x44')][_0x770f('0x51')]+'%'};return _0x4b28bc;})});}_0x175019=_[_0x770f('0x52')]({},_0x175019,_0x2da039[_0x770f('0x54')]);return db[_0x770f('0x62')][_0x770f('0x30')]({'where':_0x175019[_0x770f('0x4f')]})[_0x770f('0x1f')](function(_0x2fc59c){_0x382448[_0x770f('0x30')]=_0x2fc59c;if(_0x2da039[_0x770f('0x44')]['includeAll']){_0x175019[_0x770f('0x57')]=[{'all':!![]}];}return db[_0x770f('0x62')][_0x770f('0x58')](_0x175019);})[_0x770f('0x1f')](function(_0x39504c){_0x382448[_0x770f('0x66')]=_0x39504c;return _0x382448;});}})[_0x770f('0x1f')](respondWithFilteredResult(_0x2a058b,_0x175019))[_0x770f('0x29')](handleError(_0x2a058b,null));};exports[_0x770f('0x67')]=function(_0x341bcd,_0x208ce3,_0x2aefb5){return db[_0x770f('0x55')][_0x770f('0x5c')]({'where':{'id':_0x341bcd[_0x770f('0x59')]['id']}})[_0x770f('0x1f')](handleEntityNotFound(_0x208ce3,null))[_0x770f('0x1f')](function(_0x1cec8d){if(_0x1cec8d){return _0x1cec8d[_0x770f('0x67')](_0x341bcd[_0x770f('0x44')][_0x770f('0x68')]);}})['then'](respondWithStatusCode(_0x208ce3,null))['catch'](handleError(_0x208ce3,null));};exports['addAnswer']=function(_0x56ba98,_0x5cad1c,_0x3052b1){if(_0x56ba98[_0x770f('0x5d')]['id']){delete _0x56ba98[_0x770f('0x5d')]['id'];}return db['MailAccount'][_0x770f('0x5c')]({'where':{'id':_0x56ba98['params']['id']}})[_0x770f('0x1f')](handleEntityNotFound(_0x5cad1c,null))[_0x770f('0x1f')](function(_0x458839){if(_0x458839){_0x56ba98[_0x770f('0x5d')]['MailAccountId']=_0x458839['id'];return db['CannedAnswer'][_0x770f('0x63')](_0x56ba98[_0x770f('0x5d')]);}})[_0x770f('0x1f')](respondWithResult(_0x5cad1c,null))[_0x770f('0x29')](handleError(_0x5cad1c,null));};exports['getAnswers']=function(_0x3b8d85,_0x33382a,_0x5bd0db){var _0x54045a={'raw':![],'where':{}};var _0x266ba0={};var _0x2c383d={'count':0x0,'rows':[]};return db[_0x770f('0x55')][_0x770f('0x65')]({'where':{'id':_0x3b8d85[_0x770f('0x59')]['id']}})[_0x770f('0x1f')](handleEntityNotFound(_0x33382a,null))['then'](function(_0xb228a2){if(_0xb228a2){_0x266ba0[_0x770f('0x43')]=_[_0x770f('0x45')](db[_0x770f('0x69')][_0x770f('0x40')]);_0x266ba0[_0x770f('0x44')]=_['keys'](_0x3b8d85[_0x770f('0x44')]);_0x266ba0['filters']=_[_0x770f('0x47')](_0x266ba0[_0x770f('0x43')],_0x266ba0[_0x770f('0x44')]);_0x54045a['attributes']=_[_0x770f('0x47')](_0x266ba0[_0x770f('0x43')],qs['fields'](_0x3b8d85['query'][_0x770f('0x5b')]));_0x54045a['attributes']=_0x54045a[_0x770f('0x48')][_0x770f('0x49')]?_0x54045a[_0x770f('0x48')]:_0x266ba0['model'];if(!_0x3b8d85['query']['hasOwnProperty']('nolimit')){_0x54045a['limit']=qs[_0x770f('0x4c')](_0x3b8d85[_0x770f('0x44')][_0x770f('0x4c')]);_0x54045a[_0x770f('0x2e')]=qs[_0x770f('0x2e')](_0x3b8d85[_0x770f('0x44')][_0x770f('0x2e')]);}_0x54045a[_0x770f('0x4d')]=qs[_0x770f('0x4e')](_0x3b8d85[_0x770f('0x44')][_0x770f('0x4e')]);_0x54045a[_0x770f('0x4f')]=qs[_0x770f('0x46')](_['pick'](_0x3b8d85[_0x770f('0x44')],_0x266ba0[_0x770f('0x46')]));_0x54045a[_0x770f('0x4f')][_0x770f('0x61')]=_0xb228a2['id'];if(_0x3b8d85[_0x770f('0x44')][_0x770f('0x51')]){_0x54045a[_0x770f('0x4f')]=_['merge'](_0x54045a[_0x770f('0x4f')],{'$or':_[_0x770f('0x3f')](_0x54045a[_0x770f('0x48')],function(_0x4618ce){var _0x1fe327={};_0x1fe327[_0x4618ce]={'$like':'%'+_0x3b8d85[_0x770f('0x44')][_0x770f('0x51')]+'%'};return _0x1fe327;})});}_0x54045a=_['merge']({},_0x54045a,_0x3b8d85[_0x770f('0x54')]);return db[_0x770f('0x69')][_0x770f('0x30')]({'where':_0x54045a[_0x770f('0x4f')]})[_0x770f('0x1f')](function(_0x229398){_0x2c383d[_0x770f('0x30')]=_0x229398;if(_0x3b8d85[_0x770f('0x44')][_0x770f('0x56')]){_0x54045a[_0x770f('0x57')]=[{'all':!![]}];}return db[_0x770f('0x69')][_0x770f('0x58')](_0x54045a);})[_0x770f('0x1f')](function(_0x4ee7ba){_0x2c383d['rows']=_0x4ee7ba;return _0x2c383d;});}})[_0x770f('0x1f')](respondWithFilteredResult(_0x33382a,_0x54045a))['catch'](handleError(_0x33382a,null));};exports[_0x770f('0x6a')]=function(_0x59abc5,_0x2c3322,_0x2022c0){return db[_0x770f('0x55')][_0x770f('0x5c')]({'where':{'id':_0x59abc5[_0x770f('0x59')]['id']}})[_0x770f('0x1f')](handleEntityNotFound(_0x2c3322,null))['then'](function(_0x2634bd){if(_0x2634bd){return _0x2634bd['removeAnswers'](_0x59abc5['query'][_0x770f('0x68')]);}})[_0x770f('0x1f')](respondWithStatusCode(_0x2c3322,null))['catch'](handleError(_0x2c3322,null));};exports[_0x770f('0x63')]=function(_0x40181e,_0x281597){var _0x4a6117={'name':_0x40181e[_0x770f('0x5d')][_0x770f('0x39')],'key':_0x40181e[_0x770f('0x5d')][_0x770f('0x42')],'email':_0x40181e['body'][_0x770f('0x6b')],'ListId':_0x40181e[_0x770f('0x5d')][_0x770f('0x6c')],'active':!_['isNil'](_0x40181e[_0x770f('0x5d')][_0x770f('0x6d')])?_0x40181e[_0x770f('0x5d')][_0x770f('0x6d')]:!![],'description':_0x40181e[_0x770f('0x5d')][_0x770f('0x6e')]||null,'Imap':{},'Smtp':{}};if(_[_0x770f('0x6f')](_0x40181e[_0x770f('0x5d')]['cservice'])){if(_0x40181e[_0x770f('0x5d')][_0x770f('0x70')]){_0x4a6117[_0x770f('0x5a')][_0x770f('0x71')]=_0x4a6117[_0x770f('0x5e')][_0x770f('0x71')]=_0x40181e['body']['cuser'];_0x4a6117[_0x770f('0x5a')][_0x770f('0x72')]=_0x4a6117[_0x770f('0x5e')][_0x770f('0x73')]=_0x40181e[_0x770f('0x5d')][_0x770f('0x74')];}else{_0x4a6117['Imap']['authentication']=_0x4a6117[_0x770f('0x5e')]['authentication']=![];}_0x4a6117[_0x770f('0x5a')][_0x770f('0x75')]=_0x40181e[_0x770f('0x5d')]['Imap'][_0x770f('0x75')];_0x4a6117['Imap'][_0x770f('0x76')]=_0x40181e[_0x770f('0x5d')][_0x770f('0x5a')][_0x770f('0x76')];_0x4a6117['Smtp'][_0x770f('0x75')]=_0x40181e[_0x770f('0x5d')][_0x770f('0x5e')][_0x770f('0x75')];_0x4a6117['Smtp'][_0x770f('0x76')]=_0x40181e['body'][_0x770f('0x5e')][_0x770f('0x76')];}else{_0x4a6117[_0x770f('0x5a')][_0x770f('0x77')]=_0x4a6117[_0x770f('0x5e')][_0x770f('0x77')]=_0x40181e[_0x770f('0x5d')][_0x770f('0x78')];_0x4a6117[_0x770f('0x5a')][_0x770f('0x71')]=_0x4a6117['Smtp'][_0x770f('0x71')]=_0x40181e[_0x770f('0x5d')][_0x770f('0x79')];_0x4a6117['Imap'][_0x770f('0x72')]=_0x4a6117['Smtp'][_0x770f('0x73')]=_0x40181e[_0x770f('0x5d')][_0x770f('0x74')];}return db[_0x770f('0x55')][_0x770f('0x63')](_0x4a6117,{'include':[{'model':db['MailServerOut'],'as':_0x770f('0x5e')},{'model':db[_0x770f('0x3c')],'as':_0x770f('0x5a')}]})[_0x770f('0x1f')](function(_0x3f3132){var _0x32d6f8=_0x40181e['user'][_0x770f('0x36')]({'plain':!![]});if(!_0x32d6f8)throw new Error(_0x770f('0x7a'));if(_0x32d6f8[_0x770f('0x7b')]===_0x770f('0x71')){var _0x12b303=_0x3f3132['get']({'plain':!![]});return db[_0x770f('0x7c')][_0x770f('0x5c')]({'where':{'name':_0x770f('0x37'),'userProfileId':_0x32d6f8[_0x770f('0x7d')]},'raw':!![]})[_0x770f('0x1f')](function(_0x304a51){if(_0x304a51&&_0x304a51[_0x770f('0x7e')]===0x0){return db[_0x770f('0x7f')][_0x770f('0x63')]({'name':_0x12b303[_0x770f('0x39')],'resourceId':_0x12b303['id'],'type':_0x304a51[_0x770f('0x39')],'sectionId':_0x304a51['id']},{})['then'](function(){return _0x3f3132;});}else{return _0x3f3132;}})['catch'](function(_0x49c7fd){logger[_0x770f('0x26')](_0x770f('0x80'),_0x49c7fd);throw _0x49c7fd;});}return _0x3f3132;})[_0x770f('0x1f')](respondWithResult(_0x281597,0xc9))[_0x770f('0x29')](handleError(_0x281597,null));};exports[_0x770f('0x81')]=function(_0x53ddf1,_0x4069a4,_0x210698){return db[_0x770f('0x55')]['findOne']({'where':{'id':_0x53ddf1['params']['id']}})[_0x770f('0x1f')](handleEntityNotFound(_0x4069a4,null))[_0x770f('0x1f')](function(_0x1cd9e3){if(_0x1cd9e3){return _0x1cd9e3[_0x770f('0x81')]();}return null;})[_0x770f('0x1f')](respondWithResult(_0x4069a4,null))[_0x770f('0x29')](handleError(_0x4069a4,null));};exports[_0x770f('0x82')]=function(_0x253dfb,_0x12b064,_0x5cf732){if(_0x253dfb[_0x770f('0x5d')]['id']){delete _0x253dfb['body']['id'];}return db[_0x770f('0x55')][_0x770f('0x5c')]({'where':{'id':_0x253dfb['params']['id']}})['then'](handleEntityNotFound(_0x12b064,null))[_0x770f('0x1f')](function(_0x982aef){if(_0x982aef){_0x253dfb[_0x770f('0x5d')]['MailAccountId']=_0x982aef['id'];return db[_0x770f('0x3c')]['create'](_0x253dfb[_0x770f('0x5d')]);}})[_0x770f('0x1f')](respondWithResult(_0x12b064,null))['catch'](handleError(_0x12b064,null));};exports['removeImap']=function(_0x1b27cc,_0x53ae04,_0x37e28b){return db[_0x770f('0x55')][_0x770f('0x65')]({'where':{'id':_0x1b27cc['params']['id']}})[_0x770f('0x1f')](handleEntityNotFound(_0x53ae04,null))['then'](function(_0x3402b4){if(_0x3402b4){return _0x3402b4['setImap'](null);}return null;})[_0x770f('0x1f')](respondWithStatusCode(_0x53ae04,null))['catch'](handleError(_0x53ae04,null));};exports[_0x770f('0x83')]=function(_0x207564,_0x4a8942,_0x4ab19d){return db[_0x770f('0x55')][_0x770f('0x65')]({'where':{'id':_0x207564[_0x770f('0x59')]['id']}})[_0x770f('0x1f')](handleEntityNotFound(_0x4a8942,null))[_0x770f('0x1f')](function(_0x512f64){if(_0x512f64){return _0x512f64[_0x770f('0x83')]();}return null;})['then'](respondWithResult(_0x4a8942,null))[_0x770f('0x29')](handleError(_0x4a8942,null));};exports[_0x770f('0x84')]=function(_0x4e6653,_0xd72a07,_0xa1a21e){if(_0x4e6653[_0x770f('0x5d')]['id']){delete _0x4e6653[_0x770f('0x5d')]['id'];}return db[_0x770f('0x55')]['find']({'where':{'id':_0x4e6653[_0x770f('0x59')]['id']}})['then'](handleEntityNotFound(_0xd72a07,null))[_0x770f('0x1f')](function(_0x5a237b){if(_0x5a237b){_0x4e6653[_0x770f('0x5d')]['MailAccountId']=_0x5a237b['id'];return db['MailServerOut'][_0x770f('0x63')](_0x4e6653['body']);}})[_0x770f('0x1f')](respondWithResult(_0xd72a07,null))[_0x770f('0x29')](handleError(_0xd72a07,null));};exports[_0x770f('0x85')]=function(_0x1d8bbe,_0x4805cf,_0x13b603){return db[_0x770f('0x55')][_0x770f('0x65')]({'where':{'id':_0x1d8bbe['params']['id']}})[_0x770f('0x1f')](handleEntityNotFound(_0x4805cf,null))[_0x770f('0x1f')](function(_0x193e09){if(_0x193e09){return _0x193e09[_0x770f('0x86')](null);}return null;})[_0x770f('0x1f')](respondWithStatusCode(_0x4805cf,null))[_0x770f('0x29')](handleError(_0x4805cf,null));};exports['addInteraction']=function(_0x517f1b,_0x3e59eb,_0x504e88){return db[_0x770f('0x87')]['find']({'where':{'id':_0x517f1b[_0x770f('0x59')]['id']}})[_0x770f('0x1f')](handleEntityNotFound(_0x3e59eb,null))[_0x770f('0x1f')](function(_0x3f4d90){if(_0x3f4d90){return _0x3f4d90[_0x770f('0x88')](_0x517f1b[_0x770f('0x5d')][_0x770f('0x68')],_['omit'](_0x517f1b[_0x770f('0x5d')],['ids','id'])||{});}})[_0x770f('0x1f')](respondWithResult(_0x3e59eb,null))[_0x770f('0x29')](handleError(_0x3e59eb,null));};exports[_0x770f('0x89')]=function(_0x304196,_0x370939,_0x3a900b){var _0x21fe62={'raw':![],'where':{}};var _0x9cb448={};var _0x5f8a31={'count':0x0,'rows':[]};return db[_0x770f('0x55')][_0x770f('0x65')]({'where':{'id':_0x304196[_0x770f('0x59')]['id']}})['then'](handleEntityNotFound(_0x370939,null))[_0x770f('0x1f')](function(_0x39d4cc){if(_0x39d4cc){_0x9cb448[_0x770f('0x43')]=_[_0x770f('0x45')](db[_0x770f('0x87')][_0x770f('0x40')]);_0x9cb448[_0x770f('0x44')]=_['keys'](_0x304196[_0x770f('0x44')]);_0x9cb448['filters']=_[_0x770f('0x47')](_0x9cb448['model'],_0x9cb448[_0x770f('0x44')]);_0x21fe62['attributes']=_['intersection'](_0x9cb448['model'],qs[_0x770f('0x5b')](_0x304196[_0x770f('0x44')][_0x770f('0x5b')]));_0x21fe62[_0x770f('0x48')]=_0x21fe62['attributes'][_0x770f('0x49')]?_0x21fe62[_0x770f('0x48')]:_0x9cb448[_0x770f('0x43')];if(!_0x304196[_0x770f('0x44')]['hasOwnProperty'](_0x770f('0x4b'))){_0x21fe62[_0x770f('0x4c')]=qs[_0x770f('0x4c')](_0x304196['query'][_0x770f('0x4c')]);_0x21fe62[_0x770f('0x2e')]=qs[_0x770f('0x2e')](_0x304196['query'][_0x770f('0x2e')]);}_0x21fe62['order']=qs[_0x770f('0x4e')](_0x304196[_0x770f('0x44')]['sort']);_0x21fe62[_0x770f('0x4f')]=qs[_0x770f('0x46')](_['pick'](_0x304196['query'],_0x9cb448['filters']));_0x21fe62[_0x770f('0x4f')]['MailAccountId']=_0x39d4cc['id'];if(_0x304196[_0x770f('0x44')]['filter']){_0x21fe62[_0x770f('0x4f')]=_[_0x770f('0x52')](_0x21fe62['where'],{'$or':_[_0x770f('0x3f')](_0x21fe62['attributes'],function(_0x20b98f){var _0x2b071f={};_0x2b071f[_0x20b98f]={'$like':'%'+_0x304196[_0x770f('0x44')][_0x770f('0x51')]+'%'};return _0x2b071f;})});}_0x21fe62=_[_0x770f('0x52')]({},_0x21fe62,_0x304196[_0x770f('0x54')]);return db[_0x770f('0x87')][_0x770f('0x30')]({'where':_0x21fe62[_0x770f('0x4f')]})['then'](function(_0x268897){_0x5f8a31[_0x770f('0x30')]=_0x268897;if(_0x304196[_0x770f('0x44')][_0x770f('0x56')]){_0x21fe62[_0x770f('0x57')]=[{'model':db[_0x770f('0x8a')],'as':_0x770f('0x8b'),'required':![]},{'model':db[_0x770f('0x8c')],'as':'Owner','attributes':[_0x770f('0x39'),_0x770f('0x8d'),_0x770f('0x8e')],'required':![]},{'model':db['Tag'],'as':_0x770f('0x8f'),'attributes':['id','name',_0x770f('0x90')],'where':_0x304196[_0x770f('0x44')]['tag']?{'id':_0x304196[_0x770f('0x44')][_0x770f('0x91')]}:undefined,'required':_0x304196[_0x770f('0x44')][_0x770f('0x91')]?!![]:![]}];}return db[_0x770f('0x87')][_0x770f('0x58')](_0x21fe62);})[_0x770f('0x1f')](function(_0x47bc96){_0x5f8a31['rows']=_0x47bc96;return _0x5f8a31;});}})[_0x770f('0x1f')](respondWithFilteredResult(_0x370939,_0x21fe62))[_0x770f('0x29')](handleError(_0x370939,null));};exports[_0x770f('0x92')]=function(_0x54d2a8,_0x5c1714,_0x6efef4){return db['MailAccount']['findOne']({'where':{'id':_0x54d2a8[_0x770f('0x59')]['id']}})[_0x770f('0x1f')](handleEntityNotFound(_0x5c1714,null))[_0x770f('0x1f')](function(_0x2074fc){if(_0x2074fc){return db[_0x770f('0x93')][_0x770f('0x94')](function(_0x59fc83){return db[_0x770f('0x95')][_0x770f('0x35')]({'where':{'MailAccountId':_0x54d2a8[_0x770f('0x59')]['id']},'transaction':_0x59fc83})['then'](function(_0xfb079f){var _0x3865af=_[_0x770f('0x3f')](_0x54d2a8['body'],function(_0x57508b){_0x57508b['MailAccountId']=_0x54d2a8[_0x770f('0x59')]['id'];return _0x57508b;});return db['MailApplication'][_0x770f('0x96')](_0x3865af,{'transaction':_0x59fc83});});})[_0x770f('0x1f')](function(){return db[_0x770f('0x95')][_0x770f('0x97')]({'where':{'MailAccountId':_0x54d2a8[_0x770f('0x59')]['id']},'order':'priority'});});}})[_0x770f('0x1f')](respondWithResult(_0x5c1714,null))[_0x770f('0x29')](handleError(_0x5c1714,null));};exports[_0x770f('0x98')]=function(_0x2e8ee1,_0x3cff3f,_0x2c9e5f){var _0x347cce={};var _0x328d6e={};var _0x158a35;var _0x2b5e7a;return db[_0x770f('0x55')][_0x770f('0x65')]({'where':{'id':_0x2e8ee1[_0x770f('0x59')]['id']}})['then'](handleEntityNotFound(_0x3cff3f,null))['then'](function(_0x71246e){if(_0x71246e){_0x158a35=_0x71246e;_0x328d6e['model']=_['keys'](db[_0x770f('0x95')][_0x770f('0x40')]);_0x328d6e[_0x770f('0x44')]=_[_0x770f('0x45')](_0x2e8ee1[_0x770f('0x44')]);_0x328d6e['filters']=_[_0x770f('0x47')](_0x328d6e[_0x770f('0x43')],_0x328d6e['query']);_0x347cce[_0x770f('0x48')]=_[_0x770f('0x47')](_0x328d6e['model'],qs['fields'](_0x2e8ee1[_0x770f('0x44')][_0x770f('0x5b')]));_0x347cce[_0x770f('0x48')]=_0x347cce[_0x770f('0x48')][_0x770f('0x49')]?_0x347cce[_0x770f('0x48')]:_0x328d6e[_0x770f('0x43')];_0x347cce['order']=qs[_0x770f('0x4e')](_0x2e8ee1[_0x770f('0x44')][_0x770f('0x4e')]);_0x347cce['where']=qs[_0x770f('0x46')](_['pick'](_0x2e8ee1[_0x770f('0x44')],_0x328d6e[_0x770f('0x46')]));if(_0x2e8ee1[_0x770f('0x44')][_0x770f('0x51')]){_0x347cce[_0x770f('0x4f')]=_[_0x770f('0x52')](_0x347cce['where'],{'$or':_[_0x770f('0x3f')](_0x347cce[_0x770f('0x48')],function(_0x334fb2){var _0x46ad7f={};_0x46ad7f[_0x334fb2]={'$like':'%'+_0x2e8ee1['query'][_0x770f('0x51')]+'%'};return _0x46ad7f;})});}_0x347cce=_['merge']({},_0x347cce,_0x2e8ee1[_0x770f('0x54')]);return _0x158a35[_0x770f('0x98')](_0x347cce);}})[_0x770f('0x1f')](function(_0x915eee){if(_0x915eee){_0x2b5e7a=_0x915eee[_0x770f('0x49')];if(!_0x2e8ee1[_0x770f('0x44')][_0x770f('0x4a')]('nolimit')){_0x347cce[_0x770f('0x4c')]=qs[_0x770f('0x4c')](_0x2e8ee1['query'][_0x770f('0x4c')]);_0x347cce[_0x770f('0x2e')]=qs[_0x770f('0x2e')](_0x2e8ee1[_0x770f('0x44')][_0x770f('0x2e')]);}return _0x158a35['getApplications'](_0x347cce);}})[_0x770f('0x1f')](function(_0x3f5e47){if(_0x3f5e47){return _0x3f5e47?{'count':_0x2b5e7a,'rows':_0x3f5e47}:null;}})[_0x770f('0x1f')](respondWithResult(_0x3cff3f,null))[_0x770f('0x29')](handleError(_0x3cff3f,null));};exports[_0x770f('0x99')]=function(_0x4db2d8,_0x10287a,_0x2c5baf){var _0x3553fa={'raw':!![],'where':{}};var _0x1d52a7={};var _0x820e20={'count':0x0,'rows':[]};return db[_0x770f('0x55')]['findOne']({'where':{'id':_0x4db2d8['params']['id']}})[_0x770f('0x1f')](handleEntityNotFound(_0x10287a,null))[_0x770f('0x1f')](function(_0x9dda15){if(_0x9dda15){_0x1d52a7[_0x770f('0x43')]=_[_0x770f('0x45')](db[_0x770f('0x9a')][_0x770f('0x40')]);_0x1d52a7[_0x770f('0x44')]=_[_0x770f('0x45')](_0x4db2d8['query']);_0x1d52a7[_0x770f('0x46')]=_[_0x770f('0x47')](_0x1d52a7[_0x770f('0x43')],_0x1d52a7[_0x770f('0x44')]);_0x3553fa[_0x770f('0x48')]=_['intersection'](_0x1d52a7[_0x770f('0x43')],qs[_0x770f('0x5b')](_0x4db2d8[_0x770f('0x44')]['fields']));_0x3553fa[_0x770f('0x48')]=_0x3553fa[_0x770f('0x48')][_0x770f('0x49')]?_0x3553fa[_0x770f('0x48')]:_0x1d52a7[_0x770f('0x43')];if(!_0x4db2d8[_0x770f('0x44')]['hasOwnProperty'](_0x770f('0x4b'))){_0x3553fa['limit']=qs[_0x770f('0x4c')](_0x4db2d8[_0x770f('0x44')]['limit']);_0x3553fa[_0x770f('0x2e')]=qs[_0x770f('0x2e')](_0x4db2d8[_0x770f('0x44')][_0x770f('0x2e')]);}_0x3553fa[_0x770f('0x4d')]=qs[_0x770f('0x4e')](_0x4db2d8['query'][_0x770f('0x4e')]);_0x3553fa[_0x770f('0x4f')]=qs[_0x770f('0x46')](_[_0x770f('0x50')](_0x4db2d8['query'],_0x1d52a7[_0x770f('0x46')]));_0x3553fa[_0x770f('0x4f')][_0x770f('0x61')]=_0x9dda15['id'];if(_0x4db2d8[_0x770f('0x44')][_0x770f('0x51')]){_0x3553fa[_0x770f('0x4f')]=_[_0x770f('0x52')](_0x3553fa[_0x770f('0x4f')],{'$or':_[_0x770f('0x3f')](_0x3553fa['attributes'],function(_0x5e9831){var _0x3cfb34={};_0x3cfb34[_0x5e9831]={'$like':'%'+_0x4db2d8[_0x770f('0x44')][_0x770f('0x51')]+'%'};return _0x3cfb34;})});}if(_0x4db2d8[_0x770f('0x44')]['$gte']){var _0x40ab5b=_0x4db2d8[_0x770f('0x44')][_0x770f('0x9b')][_0x770f('0x9c')](',');var _0xc397d2={};_0xc397d2[_0x40ab5b[0x0]]={'$gte':moment(_0x40ab5b[0x1])[_0x770f('0x9d')](_0x770f('0x9e'))};_0x3553fa[_0x770f('0x4f')]=_[_0x770f('0x52')](_0x3553fa[_0x770f('0x4f')],_0xc397d2);}_0x3553fa=_[_0x770f('0x52')]({},_0x3553fa,_0x4db2d8['options']);return db[_0x770f('0x9a')][_0x770f('0x30')]({'where':_0x3553fa[_0x770f('0x4f')]})[_0x770f('0x1f')](function(_0x224d00){_0x820e20['count']=_0x224d00;if(_0x4db2d8[_0x770f('0x44')]['includeAll']){_0x3553fa[_0x770f('0x57')]=[{'all':!![]}];}return db[_0x770f('0x9a')][_0x770f('0x58')](_0x3553fa);})[_0x770f('0x1f')](function(_0x1b5b4e){if(_0x4db2d8[_0x770f('0x44')][_0x770f('0x9f')]===_0x770f('0xa0')){for(var _0x3f1e52=0x0;_0x3f1e52<_0x1b5b4e[_0x770f('0x49')];_0x3f1e52++){_0x1b5b4e[_0x3f1e52][_0x770f('0x5d')]=juice(_0x1b5b4e[_0x3f1e52][_0x770f('0x5d')]);}}_0x820e20[_0x770f('0x66')]=_0x1b5b4e;return _0x820e20;});}})[_0x770f('0x1f')](respondWithFilteredResult(_0x10287a,_0x3553fa))['catch'](handleError(_0x10287a,null));};exports['send']=function(_0x2bab82,_0x549fb2,_0x1dfb8b){var _0x29c1fc,_0x861aed={},_0x250d92;if(_0x2bab82[_0x770f('0x5d')]['to']){_0x250d92=_0x2bab82['body']['to'][_0x770f('0x9c')](',')[0x0];}return db[_0x770f('0x55')][_0x770f('0x5c')]({'where':{'id':_0x2bab82[_0x770f('0x59')]['id']},'include':[{'model':db[_0x770f('0xa1')],'as':_0x770f('0xa2'),'include':[{'model':db[_0x770f('0x8a')],'as':'Contacts','where':{'email':_0x250d92},'limit':0x1,'order':[[_0x770f('0xa3'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0x770f('0x5e'),'raw':!![]}]})['then'](handleEntityNotFound(_0x549fb2,null))[_0x770f('0x1f')](function(_0x5dcc57){if(_0x5dcc57){_0x29c1fc=_0x5dcc57;if(_0x5dcc57[_0x770f('0x5e')]){if(_[_0x770f('0x6f')](_0x2bab82['body'][_0x770f('0xa4')])){_0x2bab82[_0x770f('0x5d')]['from']=util[_0x770f('0x9d')](_0x770f('0xa5'),_0x5dcc57['name'],_0x5dcc57[_0x770f('0x6b')]||_0x5dcc57[_0x770f('0x5e')][_0x770f('0x71')]);}if(_0x2bab82[_0x770f('0x5d')][_0x770f('0xa6')]&&_0x2bab82[_0x770f('0x5d')][_0x770f('0xa6')]['length']){for(var _0x4d00dc=0x0;_0x4d00dc<_0x2bab82[_0x770f('0x5d')]['attachments'][_0x770f('0x49')];_0x4d00dc+=0x1){_0x2bab82['body'][_0x770f('0xa6')][_0x4d00dc]={'filename':_0x2bab82['body'][_0x770f('0xa6')][_0x4d00dc][_0x770f('0x39')],'path':path['join'](config['root'],_0x770f('0xa7'),_0x2bab82[_0x770f('0x5d')][_0x770f('0xa6')][_0x4d00dc]['basename'])};}}var _0x2703be={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x5dcc57[_0x770f('0x5e')]['service'])){if(_0x5dcc57[_0x770f('0x5e')]['authentication']){_0x2703be['auth']={'user':_0x5dcc57[_0x770f('0x5e')][_0x770f('0x71')],'pass':_0x5dcc57[_0x770f('0x5e')][_0x770f('0x73')]};}_0x2703be[_0x770f('0x75')]=_0x5dcc57[_0x770f('0x5e')][_0x770f('0x75')];_0x2703be['port']=_0x5dcc57['Smtp'][_0x770f('0x76')];_0x2703be[_0x770f('0xa8')]=_0x5dcc57[_0x770f('0x5e')][_0x770f('0xa8')];}else{_0x2703be[_0x770f('0x77')]=_0x5dcc57[_0x770f('0x5e')][_0x770f('0x77')];_0x2703be[_0x770f('0xa9')]={'user':_0x5dcc57['Smtp'][_0x770f('0x71')],'pass':_0x5dcc57[_0x770f('0x5e')][_0x770f('0x73')]};}return respondWithRpcPromise(_0x770f('0xaa'),_0x770f('0xab'),{'account':_0x2703be,'message':_0x2bab82[_0x770f('0x5d')]});}else{throw new Error(_0x770f('0xac'));}}})[_0x770f('0x1f')](function(_0x55537e){if(_0x55537e){_0x861aed=_0x55537e;if(_0x29c1fc[_0x770f('0xa2')]){if(_0x29c1fc['List'][_0x770f('0xad')][_0x770f('0x49')]){return _0x29c1fc[_0x770f('0xa2')]['Contacts'][0x0];}else{return db[_0x770f('0x8a')][_0x770f('0x63')](_[_0x770f('0xae')](_0x2bab82['body'],{'firstName':_0x2bab82[_0x770f('0x5d')]['to'],'email':_0x2bab82['body']['to'],'phone':_0x2bab82['body']['to'],'ListId':_0x29c1fc['ListId']}));}}else{throw new Error(_0x770f('0xac'));}}})[_0x770f('0x1f')](function(_0x6921bb){if(_0x6921bb){var _0x3975ba={'UserId':_0x2bab82[_0x770f('0x71')]['id'],'ContactId':_0x6921bb['id'],'MailAccountId':_0x29c1fc['id'],'inReplyTo':_0x861aed[_0x770f('0xaf')],'to':_0x2bab82[_0x770f('0x5d')]['from'],'cc':_0x2bab82[_0x770f('0x5d')]['cc'],'subject':_0x2bab82[_0x770f('0x5d')][_0x770f('0xb0')],'attach':_0x2bab82[_0x770f('0x5d')][_0x770f('0xb1')],'firstMsgDirection':_0x770f('0xb2'),'lastMsgAt':moment()[_0x770f('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_[_0x770f('0x52')](_0x2bab82[_0x770f('0x5d')],{'messageId':_0x861aed['messageId'],'sentAt':moment()['format'](_0x770f('0x9e')),'read':!![],'MailAccountId':_0x29c1fc['id'],'UserId':_0x2bab82[_0x770f('0x71')]['id'],'ContactId':_0x6921bb['id']})]};if(_0x2bab82[_0x770f('0x5d')]['Interaction']){_0x3975ba=_['merge'](_0x3975ba,_0x2bab82[_0x770f('0x5d')][_0x770f('0xb3')]);}return db['MailInteraction'][_0x770f('0x63')](_0x3975ba,{'include':[{'model':db[_0x770f('0x9a')],'as':_0x770f('0xb4')}]});}})[_0x770f('0x1f')](respondWithResult(_0x549fb2,null))['catch'](handleError(_0x549fb2,null));};exports[_0x770f('0xb5')]=function(_0x517e7b,_0xc4d209,_0x556464){return db[_0x770f('0x55')][_0x770f('0x5c')]({'where':{'id':_0x517e7b[_0x770f('0x59')]['id']},'include':[{'model':db[_0x770f('0x3d')],'as':_0x770f('0x5e'),'raw':!![]}]})[_0x770f('0x1f')](handleEntityNotFound(_0xc4d209,null))[_0x770f('0x1f')](function(_0x286297){if(_0x286297&&_0x286297[_0x770f('0x5e')]){var _0x4786b6={'id':_0x286297['id'],'tls':{'rejectUnauthorized':![]}};if(_0x286297[_0x770f('0x5e')][_0x770f('0x77')]){_0x4786b6[_0x770f('0x77')]=_0x286297[_0x770f('0x5e')][_0x770f('0x77')];}else{_0x4786b6['host']=_0x286297[_0x770f('0x5e')][_0x770f('0x75')];_0x4786b6[_0x770f('0x76')]=_0x286297[_0x770f('0x5e')][_0x770f('0x76')];_0x4786b6['secure']=_0x286297[_0x770f('0x5e')][_0x770f('0xa8')];}if(_0x286297[_0x770f('0x5e')][_0x770f('0xb6')]){_0x4786b6['auth']={'user':_0x286297[_0x770f('0x5e')][_0x770f('0x71')],'pass':_0x286297[_0x770f('0x5e')][_0x770f('0x73')]};}return respondWithRpcPromise(_0x770f('0xb7'),_0x770f('0xb5'),{'account':_0x4786b6});}})[_0x770f('0x1f')](respondWithResult(_0xc4d209,null))['catch'](handleError(_0xc4d209,null));};exports[_0x770f('0x35')]=function(_0xccebae,_0x1c63be){return db[_0x770f('0x55')][_0x770f('0x5c')]({'where':{'id':_0xccebae['params']['id']}})[_0x770f('0x1f')](handleEntityNotFound(_0x1c63be,null))['then'](function(_0x1f1c85){if(_0x1f1c85&&_0x1f1c85[_0x770f('0x77')]){throw new db[(_0x770f('0xb8'))][(_0x770f('0xb9'))](_0x770f('0xba'));}return _0x1f1c85;})['then'](removeEntity(_0x1c63be,null))[_0x770f('0x29')](handleError(_0x1c63be,null));};exports[_0x770f('0xbb')]=function(_0x33c09d,_0x492713,_0x40a6d1){return db[_0x770f('0x55')][_0x770f('0x5c')]({'where':{'id':_0x33c09d[_0x770f('0x59')]['id']}})[_0x770f('0x1f')](handleEntityNotFound(_0x492713,null))[_0x770f('0x1f')](function(_0xe9881){if(_0xe9881){return _0xe9881['addAgents'](_0x33c09d[_0x770f('0x5d')][_0x770f('0x68')],_[_0x770f('0xbc')](_0x33c09d[_0x770f('0x5d')],[_0x770f('0x68'),'id'])||{})[_0x770f('0xbd')](function(_0x1fbf20){for(var _0x898e80=0x0;_0x898e80<_0x33c09d[_0x770f('0x5d')][_0x770f('0x68')][_0x770f('0x49')];_0x898e80+=0x1){socket[_0x770f('0xbe')]('userMailAccount:save',{'UserId':Number(_0x33c09d[_0x770f('0x5d')][_0x770f('0x68')][_0x898e80]),'MailAccountId':Number(_0x33c09d[_0x770f('0x59')]['id'])});}return _0x1fbf20;});}})[_0x770f('0x1f')](respondWithResult(_0x492713,null))[_0x770f('0x29')](handleError(_0x492713,null));};exports['removeAgents']=function(_0x1d3f04,_0x178614,_0x59e26b){return db[_0x770f('0x55')][_0x770f('0x5c')]({'where':{'id':_0x1d3f04[_0x770f('0x59')]['id']}})[_0x770f('0x1f')](handleEntityNotFound(_0x178614,null))[_0x770f('0x1f')](function(_0x10f703){if(_0x10f703){return _0x10f703[_0x770f('0xbf')](_0x1d3f04[_0x770f('0x44')][_0x770f('0x68')])[_0x770f('0x1f')](function(){if(_['isArray'](_0x1d3f04[_0x770f('0x44')][_0x770f('0x68')])){for(var _0x22c2e9=0x0;_0x22c2e9<_0x1d3f04[_0x770f('0x44')]['ids'][_0x770f('0x49')];_0x22c2e9+=0x1){socket[_0x770f('0xbe')](_0x770f('0xc0'),{'UserId':Number(_0x1d3f04[_0x770f('0x44')]['ids'][_0x22c2e9]),'MailAccountId':Number(_0x1d3f04[_0x770f('0x59')]['id'])});}}else{socket[_0x770f('0xbe')](_0x770f('0xc0'),{'UserId':Number(_0x1d3f04['query'][_0x770f('0x68')]),'MailAccountId':Number(_0x1d3f04['params']['id'])});}});}})[_0x770f('0x1f')](respondWithStatusCode(_0x178614,null))[_0x770f('0x29')](handleError(_0x178614,null));};exports[_0x770f('0xc1')]=function(_0x3e26ca,_0x5825b7,_0x1c49bf){var _0x4da1e5={};var _0x1b1ce9={};var _0x1649cf;var _0x3116d0;return db['MailAccount'][_0x770f('0x65')]({'where':{'id':_0x3e26ca[_0x770f('0x59')]['id']}})['then'](handleEntityNotFound(_0x5825b7,null))[_0x770f('0x1f')](function(_0x558a4d){if(_0x558a4d){_0x1649cf=_0x558a4d;_0x1b1ce9[_0x770f('0x43')]=_[_0x770f('0x45')](db[_0x770f('0x8c')]['rawAttributes']);_0x1b1ce9['query']=_['keys'](_0x3e26ca[_0x770f('0x44')]);_0x1b1ce9[_0x770f('0x46')]=_[_0x770f('0x47')](_0x1b1ce9['model'],_0x1b1ce9[_0x770f('0x44')]);_0x4da1e5[_0x770f('0x48')]=_['intersection'](_0x1b1ce9[_0x770f('0x43')],qs[_0x770f('0x5b')](_0x3e26ca[_0x770f('0x44')][_0x770f('0x5b')]));_0x4da1e5[_0x770f('0x48')]=_0x4da1e5[_0x770f('0x48')][_0x770f('0x49')]?_0x4da1e5[_0x770f('0x48')]:_0x1b1ce9[_0x770f('0x43')];_0x4da1e5[_0x770f('0x4d')]=qs[_0x770f('0x4e')](_0x3e26ca[_0x770f('0x44')]['sort']);_0x4da1e5['where']=qs['filters'](_[_0x770f('0x50')](_0x3e26ca[_0x770f('0x44')],_0x1b1ce9[_0x770f('0x46')]));if(_0x3e26ca[_0x770f('0x44')][_0x770f('0x51')]){_0x4da1e5['where']=_['merge'](_0x4da1e5[_0x770f('0x4f')],{'$or':_[_0x770f('0x3f')](_0x4da1e5[_0x770f('0x48')],function(_0x50eb32){var _0xb1d73d={};_0xb1d73d[_0x50eb32]={'$like':'%'+_0x3e26ca[_0x770f('0x44')][_0x770f('0x51')]+'%'};return _0xb1d73d;})});}_0x4da1e5=_[_0x770f('0x52')]({},_0x4da1e5,_0x3e26ca['options']);return _0x1649cf[_0x770f('0xc1')](_0x4da1e5);}})[_0x770f('0x1f')](function(_0xbc0e73){if(_0xbc0e73){_0x3116d0=_0xbc0e73[_0x770f('0x49')];if(!_0x3e26ca[_0x770f('0x44')][_0x770f('0x4a')](_0x770f('0x4b'))){_0x4da1e5[_0x770f('0x4c')]=qs[_0x770f('0x4c')](_0x3e26ca[_0x770f('0x44')][_0x770f('0x4c')]);_0x4da1e5[_0x770f('0x2e')]=qs['offset'](_0x3e26ca['query'][_0x770f('0x2e')]);}return _0x1649cf['getAgents'](_0x4da1e5);}})[_0x770f('0x1f')](function(_0x490283){if(_0x490283){return _0x490283?{'count':_0x3116d0,'rows':_0x490283}:null;}})[_0x770f('0x1f')](respondWithResult(_0x5825b7,null))['catch'](handleError(_0x5825b7,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index be3d0ce..aac16ae 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 _0xfdb5=['MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xea0b85,_0x4271ef){var _0x41263e=function(_0x52f516){while(--_0x52f516){_0xea0b85['push'](_0xea0b85['shift']());}};_0x41263e(++_0x4271ef);}(_0xfdb5,0x18f));var _0x5fdb=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xfdb5[_0x2080a3];return _0x8d7d17;};'use strict';var EventEmitter=require(_0x5fdb('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x5fdb('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x5fdb('0x2')](0x0);var events={'afterCreate':_0x5fdb('0x3'),'afterUpdate':_0x5fdb('0x4'),'afterDestroy':_0x5fdb('0x5')};function emitEvent(_0x379f9b){return function(_0x24cbe7,_0x334e53,_0x5f3fc6){MailAccountEvents[_0x5fdb('0x6')](_0x379f9b+':'+_0x24cbe7['id'],_0x24cbe7);MailAccountEvents['emit'](_0x379f9b,_0x24cbe7);_0x5f3fc6(null);};}for(var e in events){if(events[_0x5fdb('0x7')](e)){var event=events[e];MailAccount[_0x5fdb('0x8')](e,emitEvent(event));}}module[_0x5fdb('0x9')]=MailAccountEvents; \ No newline at end of file +var _0xa282=['hook','exports','events','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x5578b7,_0x284ae0){var _0x43eb4f=function(_0x5bdb15){while(--_0x5bdb15){_0x5578b7['push'](_0x5578b7['shift']());}};_0x43eb4f(++_0x284ae0);}(_0xa282,0x1f3));var _0x2a28=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xa282[_0x1caf6a];return _0x1bf493;};'use strict';var EventEmitter=require(_0x2a28('0x0'));var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x2a28('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2a28('0x2'),'afterDestroy':'remove'};function emitEvent(_0xe7cd2e){return function(_0x1aec55,_0x2e12ef,_0x194226){MailAccountEvents[_0x2a28('0x3')](_0xe7cd2e+':'+_0x1aec55['id'],_0x1aec55);MailAccountEvents[_0x2a28('0x3')](_0xe7cd2e,_0x1aec55);_0x194226(null);};}for(var e in events){if(events[_0x2a28('0x4')](e)){var event=events[e];MailAccount[_0x2a28('0x5')](e,emitEvent(event));}}module[_0x2a28('0x6')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index a4b83d6..aed23bf 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 _0xf48e=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailAccount.attributes','define','MailAccount'];(function(_0x460602,_0x36817f){var _0x171b0b=function(_0x9dcb2c){while(--_0x9dcb2c){_0x460602['push'](_0x460602['shift']());}};_0x171b0b(++_0x36817f);}(_0xf48e,0x172));var _0xef48=function(_0x4a6fac,_0x398714){_0x4a6fac=_0x4a6fac-0x0;var _0x109bfa=_0xf48e[_0x4a6fac];return _0x109bfa;};'use strict';var _=require('lodash');var util=require(_0xef48('0x0'));var logger=require(_0xef48('0x1'))(_0xef48('0x2'));var moment=require(_0xef48('0x3'));var BPromise=require('bluebird');var rp=require(_0xef48('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef48('0x5'));var config=require(_0xef48('0x6'));var attributes=require(_0xef48('0x7'));module['exports']=function(_0x548817,_0x3d43af){return _0x548817[_0xef48('0x8')](_0xef48('0x9'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fcc=['util','api','moment','bluebird','request-promise','path','rimraf','./mailAccount.attributes','exports','MailAccount','lodash'];(function(_0x25825b,_0xf6fd5f){var _0x5e9b99=function(_0x59bd03){while(--_0x59bd03){_0x25825b['push'](_0x25825b['shift']());}};_0x5e9b99(++_0xf6fd5f);}(_0x6fcc,0xf1));var _0xc6fc=function(_0x1bd3b2,_0x14d3b7){_0x1bd3b2=_0x1bd3b2-0x0;var _0x2b95bc=_0x6fcc[_0x1bd3b2];return _0x2b95bc;};'use strict';var _=require(_0xc6fc('0x0'));var util=require(_0xc6fc('0x1'));var logger=require('../../config/logger')(_0xc6fc('0x2'));var moment=require(_0xc6fc('0x3'));var BPromise=require(_0xc6fc('0x4'));var rp=require(_0xc6fc('0x5'));var fs=require('fs');var path=require(_0xc6fc('0x6'));var rimraf=require(_0xc6fc('0x7'));var config=require('../../config/environment');var attributes=require(_0xc6fc('0x8'));module[_0xc6fc('0x9')]=function(_0x3f6ea5,_0x150872){return _0x3f6ea5['define'](_0xc6fc('0xa'),attributes,{'tableName':'mail_accounts','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 3457d6d..b1d75a2 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 _0xdc1c=['ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','UserId','User','name','Start','startRouting','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetMailAccount','findAll','raw','options','where','attributes','limit','include','map','model','ShowMailAccount','find','NotifyMailAccount','body','mail','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','account','CmList','MailApplication','Applications','MailServerOut','Smtp','List','get','omit','applications','list','orderBy','priority','autoclose','push','length','close','*,*,*,*','Contacts','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','interaction','attachments','originTo','originCc','bcc'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xdc1c,0x6f));var _0xcdc1=function(_0x3ef230,_0x200b1c){_0x3ef230=_0x3ef230-0x0;var _0x4e2925=_0xdc1c[_0x3ef230];return _0x4e2925;};'use strict';var _=require('lodash');var util=require(_0xcdc1('0x0'));var moment=require('moment');var BPromise=require(_0xcdc1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdc1('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdc1('0x3'));var logger=require(_0xcdc1('0x4'))(_0xcdc1('0x5'));var config=require(_0xcdc1('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});config[_0xcdc1('0x7')]=_[_0xcdc1('0x8')](config[_0xcdc1('0x7')],{'host':_0xcdc1('0x9'),'port':0x18eb});var socket=require(_0xcdc1('0xa'))(new Redis(config['redis']));require('./mailAccount.socket')[_0xcdc1('0xb')](socket);function respondWithRpcPromise(_0x57b3a7,_0x521dd9,_0x50f0db){return new BPromise(function(_0x2e0665,_0x140ea8){return client[_0xcdc1('0xc')](_0x57b3a7,_0x50f0db)[_0xcdc1('0xd')](function(_0x4a3804){logger[_0xcdc1('0xe')](_0xcdc1('0xf'),_0x521dd9,_0xcdc1('0x10'));logger[_0xcdc1('0x11')](_0xcdc1('0x12'),_0x521dd9,_0xcdc1('0x10'),JSON[_0xcdc1('0x13')](_0x4a3804));if(_0x4a3804[_0xcdc1('0x14')]){if(_0x4a3804[_0xcdc1('0x14')]['code']===0x1f4){logger[_0xcdc1('0x14')](_0xcdc1('0xf'),_0x521dd9,_0x4a3804[_0xcdc1('0x14')][_0xcdc1('0x15')]);return _0x140ea8(_0x4a3804[_0xcdc1('0x14')][_0xcdc1('0x15')]);}logger[_0xcdc1('0x14')](_0xcdc1('0xf'),_0x521dd9,_0x4a3804[_0xcdc1('0x14')][_0xcdc1('0x15')]);return _0x2e0665(_0x4a3804[_0xcdc1('0x14')]['message']);}else{logger[_0xcdc1('0xe')](_0xcdc1('0xf'),_0x521dd9,'request\x20sent');_0x2e0665(_0x4a3804['result'][_0xcdc1('0x15')]);}})[_0xcdc1('0x16')](function(_0x2bb7a9){logger['error'](_0xcdc1('0xf'),_0x521dd9,_0x2bb7a9);_0x140ea8(_0x2bb7a9);});});}exports[_0xcdc1('0x17')]=function(_0x7ed248){var _0x1fe611=this;return new Promise(function(_0x22b65c,_0x1059cf){return db['MailAccount'][_0xcdc1('0x18')]({'raw':_0x7ed248['options']?_0x7ed248['options'][_0xcdc1('0x19')]===undefined?!![]:![]:!![],'where':_0x7ed248[_0xcdc1('0x1a')]?_0x7ed248[_0xcdc1('0x1a')][_0xcdc1('0x1b')]||null:null,'attributes':_0x7ed248[_0xcdc1('0x1a')]?_0x7ed248[_0xcdc1('0x1a')][_0xcdc1('0x1c')]||null:null,'limit':_0x7ed248[_0xcdc1('0x1a')]?_0x7ed248[_0xcdc1('0x1a')][_0xcdc1('0x1d')]||null:null,'include':_0x7ed248[_0xcdc1('0x1a')]?_0x7ed248['options'][_0xcdc1('0x1e')]?_[_0xcdc1('0x1f')](_0x7ed248[_0xcdc1('0x1a')][_0xcdc1('0x1e')],function(_0x1ba040){return{'model':db[_0x1ba040[_0xcdc1('0x20')]],'as':_0x1ba040['as'],'attributes':_0x1ba040[_0xcdc1('0x1c')],'include':_0x1ba040[_0xcdc1('0x1e')]?_[_0xcdc1('0x1f')](_0x1ba040[_0xcdc1('0x1e')],function(_0x2af671){return{'model':db[_0x2af671[_0xcdc1('0x20')]],'as':_0x2af671['as'],'attributes':_0x2af671[_0xcdc1('0x1c')],'include':_0x2af671['include']?_[_0xcdc1('0x1f')](_0x2af671['include'],function(_0x51e92c){return{'model':db[_0x51e92c['model']],'as':_0x51e92c['as'],'attributes':_0x51e92c[_0xcdc1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27f73c){logger[_0xcdc1('0xe')]('GetMailAccount',_0x7ed248);logger[_0xcdc1('0x11')](_0xcdc1('0x17'),_0x7ed248,JSON[_0xcdc1('0x13')](_0x27f73c));_0x22b65c(_0x27f73c);})[_0xcdc1('0x16')](function(_0xea9901){logger[_0xcdc1('0x14')]('GetMailAccount',_0xea9901['message'],_0x7ed248);_0x1059cf(_0x1fe611[_0xcdc1('0x14')](0x1f4,_0xea9901[_0xcdc1('0x15')]));});});};exports[_0xcdc1('0x21')]=function(_0x29f936){var _0x3c2e9f=this;return new Promise(function(_0x4a0a98,_0x259e41){return db['MailAccount'][_0xcdc1('0x22')]({'raw':_0x29f936[_0xcdc1('0x1a')]?_0x29f936[_0xcdc1('0x1a')][_0xcdc1('0x19')]===undefined?!![]:![]:!![],'where':_0x29f936[_0xcdc1('0x1a')]?_0x29f936[_0xcdc1('0x1a')]['where']||null:null,'attributes':_0x29f936[_0xcdc1('0x1a')]?_0x29f936['options']['attributes']||null:null,'include':_0x29f936['options']?_0x29f936[_0xcdc1('0x1a')][_0xcdc1('0x1e')]?_[_0xcdc1('0x1f')](_0x29f936[_0xcdc1('0x1a')][_0xcdc1('0x1e')],function(_0x9c8cb4){return{'model':db[_0x9c8cb4[_0xcdc1('0x20')]],'as':_0x9c8cb4['as'],'attributes':_0x9c8cb4[_0xcdc1('0x1c')],'include':_0x9c8cb4['include']?_['map'](_0x9c8cb4['include'],function(_0xd49c05){return{'model':db[_0xd49c05[_0xcdc1('0x20')]],'as':_0xd49c05['as'],'attributes':_0xd49c05['attributes'],'include':_0xd49c05[_0xcdc1('0x1e')]?_[_0xcdc1('0x1f')](_0xd49c05[_0xcdc1('0x1e')],function(_0x5b8819){return{'model':db[_0x5b8819['model']],'as':_0x5b8819['as'],'attributes':_0x5b8819['attributes']};}):[]};}):[]};}):[]:[]})[_0xcdc1('0xd')](function(_0x242401){logger[_0xcdc1('0xe')]('ShowMailAccount',_0x29f936);logger[_0xcdc1('0x11')](_0xcdc1('0x21'),_0x29f936,JSON[_0xcdc1('0x13')](_0x242401));_0x4a0a98(_0x242401);})[_0xcdc1('0x16')](function(_0x36e145){logger['error']('ShowMailAccount',_0x36e145[_0xcdc1('0x15')],_0x29f936);_0x259e41(_0x3c2e9f[_0xcdc1('0x14')](0x1f4,_0x36e145[_0xcdc1('0x15')]));});});};exports[_0xcdc1('0x23')]=function(_0x3d1457){var _0x5c166d=this;return new Promise(function(_0x2abe4d,_0xae13f1){var _0x5882db={'body':_0x3d1457[_0xcdc1('0x24')],'channel':_0xcdc1('0x25')};var _0x12a60a=_['difference'](_[_0xcdc1('0x26')](db[_0xcdc1('0x27')][_0xcdc1('0x28')]),['createdAt',_0xcdc1('0x29'),_0xcdc1('0x2a'),_0xcdc1('0x2b')]);var _0x2d65b4=![];if(_0x3d1457[_0xcdc1('0x24')]['id']){delete _0x3d1457['body']['id'];}if(_[_0xcdc1('0x2c')](_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x2d')])){return _0xae13f1(_0x5c166d[_0xcdc1('0x14')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xcdc1('0x2c')](_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x24')])||_0x3d1457[_0xcdc1('0x24')]['body']===''){return _0xae13f1(_0x5c166d[_0xcdc1('0x14')](0x1f4,_0xcdc1('0x2e')));}if(_['isNil'](_0x3d1457[_0xcdc1('0x24')]['mapKey'])){return _0xae13f1(_0x5c166d['error'](0x1f4,_0xcdc1('0x2f')+_0x12a60a));}if(!_[_0xcdc1('0x30')](_0x12a60a,_0x3d1457['body'][_0xcdc1('0x31')])){return _0xae13f1(_0x5c166d[_0xcdc1('0x14')](0x1f4,_0xcdc1('0x32')+_0x12a60a));}var _0x25b9f9={};_0x25b9f9[_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x31')]]=_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x2d')];return db[_0xcdc1('0x33')][_0xcdc1('0x22')]({'where':{'id':_0x3d1457[_0xcdc1('0x34')]['id']},'include':[{'model':db[_0xcdc1('0x35')],'as':'List','include':[{'model':db[_0xcdc1('0x27')],'as':'Contacts','where':_0x25b9f9,'limit':0x1,'order':[[_0xcdc1('0x29'),'DESC']]}]},{'model':db[_0xcdc1('0x36')],'as':_0xcdc1('0x37')},{'model':db[_0xcdc1('0x38')],'as':_0xcdc1('0x39')}]})[_0xcdc1('0xd')](function(_0x2905a9){if(_0x2905a9&&_0x2905a9[_0xcdc1('0x3a')]){var _0xdab41c=_0x2905a9[_0xcdc1('0x3b')]({'plain':!![]});_0x5882db[_0xcdc1('0x34')]=_[_0xcdc1('0x3c')](_0xdab41c,[_0xcdc1('0x37'),_0xcdc1('0x3a')]);_0x5882db[_0xcdc1('0x3d')]=_0xdab41c['Applications'];_0x5882db[_0xcdc1('0x3e')]=_0xdab41c[_0xcdc1('0x3a')];_0x5882db[_0xcdc1('0x3d')]=_[_0xcdc1('0x3f')](_0x5882db[_0xcdc1('0x3d')],[_0xcdc1('0x40')],['asc']);if(_0x5882db[_0xcdc1('0x34')]&&_0x5882db['account'][_0xcdc1('0x41')]){_0x5882db[_0xcdc1('0x3d')][_0xcdc1('0x42')]({'id':0x0,'priority':_0x5882db[_0xcdc1('0x3d')][_0xcdc1('0x43')]+0x1,'app':_0xcdc1('0x44'),'appdata':_0xcdc1('0x41'),'interval':_0xcdc1('0x45')});}if(_0x5882db['account'][_0xcdc1('0x37')]){delete _0x5882db[_0xcdc1('0x34')][_0xcdc1('0x37')];}if(_0x5882db[_0xcdc1('0x34')][_0xcdc1('0x3a')]){delete _0x5882db[_0xcdc1('0x34')][_0xcdc1('0x3a')];}if(_0xdab41c[_0xcdc1('0x3a')][_0xcdc1('0x46')][_0xcdc1('0x43')]){return _0xdab41c['List'][_0xcdc1('0x46')][0x0];}var _0x449b60=_[_0xcdc1('0x8')](_0x3d1457[_0xcdc1('0x24')],{'firstName':_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x2d')],'ListId':_0xdab41c['ListId']});_0x449b60[_0x3d1457['body'][_0xcdc1('0x31')]]=_0x3d1457[_0xcdc1('0x24')]['from'];return db['CmContact'][_0xcdc1('0x47')](_0x449b60);}else{throw new Error(_0xcdc1('0x48'));}})[_0xcdc1('0xd')](function(_0x4f3264){_0x5882db[_0xcdc1('0x49')]=_0x4f3264;if(_0x4f3264){if(!_0x3d1457['body']['message'][_0xcdc1('0x4a')]){_0x3d1457['body'][_0xcdc1('0x15')][_0xcdc1('0x4a')]=rs[_0xcdc1('0x4b')]()+'\x20'+_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')]['from'];}var _0x278ea0={'ContactId':_0x4f3264['id'],'MailAccountId':_0x3d1457[_0xcdc1('0x34')]['id'],'inReplyTo':_0x3d1457[_0xcdc1('0x24')]['message'][_0xcdc1('0x4a')],'to':_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')]['from'],'cc':_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')]['cc'],'subject':_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')][_0xcdc1('0x4c')],'attach':_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')][_0xcdc1('0x4d')],'lastMsgAt':moment()[_0xcdc1('0x4e')](_0xcdc1('0x4f')),'lastMsgDirection':'in'};return db[_0xcdc1('0x50')][_0xcdc1('0x22')]({'where':{'closed':![],'MailAccountId':_0x3d1457[_0xcdc1('0x34')]['id']},'include':[{'model':db[_0xcdc1('0x51')],'as':_0xcdc1('0x52'),'attributes':['messageId'],'where':{'messageId':_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')][_0xcdc1('0x53')]}}]})['then'](function(_0x4e5136){if(_0x4e5136){return[_0x4e5136,![]];}return db[_0xcdc1('0x50')][_0xcdc1('0x47')](_0x278ea0)[_0xcdc1('0xd')](function(_0x5026e7){return[_0x5026e7,!![]];});});}else{throw new Error(_0xcdc1('0x54'));}})['spread'](function(_0x46b4a3,_0x145333){if(_0x46b4a3){_0x2d65b4=_0x145333;if(!_0x145333){return _0x46b4a3[_0xcdc1('0x55')]({'inReplyTo':_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')][_0xcdc1('0x4a')],'to':_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')][_0xcdc1('0x2d')],'cc':_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')]['cc'],'subject':_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')]['subject'],'attach':_0x46b4a3[_0xcdc1('0x4d')]?_0x46b4a3[_0xcdc1('0x4d')]:_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')]['attach'],'substatus':null,'substatusAt':moment()['format'](_0xcdc1('0x4f')),'lastMsgAt':moment()[_0xcdc1('0x4e')](_0xcdc1('0x4f')),'lastMsgDirection':'in'});}else{return _0x46b4a3;}}})[_0xcdc1('0xd')](function(_0x2f5cca){_0x5882db[_0xcdc1('0x56')]=_0x2f5cca[_0xcdc1('0x3b')]({'plain':!![]});_0x5882db[_0xcdc1('0x56')]['created']=_0x2d65b4;return db[_0xcdc1('0x51')][_0xcdc1('0x47')]({'body':_0x3d1457[_0xcdc1('0x24')]['body'],'MailAccountId':_0x3d1457[_0xcdc1('0x34')]['id'],'MailInteractionId':_0x2f5cca['id'],'direction':'in','ContactId':_0x5882db[_0xcdc1('0x49')]['id'],'messageId':_0x3d1457[_0xcdc1('0x24')]['message'][_0xcdc1('0x4a')],'from':_0x3d1457[_0xcdc1('0x24')]['message']['from'],'to':_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')]['to'],'cc':_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')]['cc'],'subject':_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')][_0xcdc1('0x4c')],'attach':_0x3d1457['body'][_0xcdc1('0x15')][_0xcdc1('0x4d')],'Attachments':_0x3d1457['body'][_0xcdc1('0x15')][_0xcdc1('0x57')],'originTo':_0x3d1457['body'][_0xcdc1('0x15')][_0xcdc1('0x58')],'originCc':_0x3d1457['body'][_0xcdc1('0x15')][_0xcdc1('0x59')],'bcc':_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')][_0xcdc1('0x5a')],'ChatWebsiteId':_0x3d1457[_0xcdc1('0x24')]['message'][_0xcdc1('0x5b')]||null,'originChannel':_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')][_0xcdc1('0x5c')]||_0xcdc1('0x5d'),'ChatOfflineMessageId':_0x3d1457[_0xcdc1('0x24')][_0xcdc1('0x15')][_0xcdc1('0x5e')]||null},{'include':[{'model':db['Attachment'],'as':_0xcdc1('0x5f')}]});})['then'](function(_0x1ed438){_0x5882db[_0xcdc1('0x15')]=_0x1ed438;if(_0x5882db[_0xcdc1('0x56')][_0xcdc1('0x60')]){return db[_0xcdc1('0x61')][_0xcdc1('0x22')]({'attributes':['id','name'],'where':{'id':_0x5882db['interaction'][_0xcdc1('0x60')]}})[_0xcdc1('0xd')](function(_0x31c98e){if(_0x31c98e){_0x5882db[_0xcdc1('0x3d')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x31c98e[_0xcdc1('0x62')]+','+(_0x5882db[_0xcdc1('0x34')]['waitForTheAssignedAgent']||0xa),'interval':_0xcdc1('0x45')});}return respondWithRpcPromise(_0xcdc1('0x63'),_0xcdc1('0x64'),_0x5882db);});}return respondWithRpcPromise(_0xcdc1('0x63'),'startRouting',_0x5882db);})[_0xcdc1('0xd')](function(_0x48cd72){_0x2abe4d(_0x48cd72);})[_0xcdc1('0x16')](function(_0x450c7d){_0xae13f1(_0x5c166d[_0xcdc1('0x14')](0x1f4,_0x450c7d['message']));});});}; \ No newline at end of file +var _0xe9c3=['includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','account','omit','applications','list','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','create','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','attach','interaction','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','where','attributes','limit','include','map','model','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey'];(function(_0x397dd0,_0x58a7a8){var _0x4188b2=function(_0x173bb7){while(--_0x173bb7){_0x397dd0['push'](_0x397dd0['shift']());}};_0x4188b2(++_0x58a7a8);}(_0xe9c3,0x1d7));var _0x3e9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9c3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3e9c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e9c('0x1'))['db'];var utils=require(_0x3e9c('0x2'));var logger=require('../../config/logger')(_0x3e9c('0x3'));var config=require(_0x3e9c('0x4'));var jayson=require(_0x3e9c('0x5'));var client=jayson[_0x3e9c('0x6')][_0x3e9c('0x7')]({'port':0x232c});config[_0x3e9c('0x8')]=_[_0x3e9c('0x9')](config[_0x3e9c('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e9c('0xa'))(new Redis(config['redis']));require(_0x3e9c('0xb'))['register'](socket);function respondWithRpcPromise(_0x22062a,_0x8a47cf,_0x24fdf1){return new BPromise(function(_0x1ba24f,_0x5a1083){return client[_0x3e9c('0xc')](_0x22062a,_0x24fdf1)[_0x3e9c('0xd')](function(_0x15adb6){logger[_0x3e9c('0xe')](_0x3e9c('0xf'),_0x8a47cf,_0x3e9c('0x10'));logger[_0x3e9c('0x11')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x8a47cf,'request\x20sent',JSON[_0x3e9c('0x12')](_0x15adb6));if(_0x15adb6[_0x3e9c('0x13')]){if(_0x15adb6['error'][_0x3e9c('0x14')]===0x1f4){logger[_0x3e9c('0x13')]('MailAccount,\x20%s,\x20%s',_0x8a47cf,_0x15adb6[_0x3e9c('0x13')][_0x3e9c('0x15')]);return _0x5a1083(_0x15adb6[_0x3e9c('0x13')]['message']);}logger['error'](_0x3e9c('0xf'),_0x8a47cf,_0x15adb6['error'][_0x3e9c('0x15')]);return _0x1ba24f(_0x15adb6[_0x3e9c('0x13')]['message']);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x8a47cf,_0x3e9c('0x10'));_0x1ba24f(_0x15adb6['result'][_0x3e9c('0x15')]);}})[_0x3e9c('0x16')](function(_0x3bcc68){logger['error'](_0x3e9c('0xf'),_0x8a47cf,_0x3bcc68);_0x5a1083(_0x3bcc68);});});}exports[_0x3e9c('0x17')]=function(_0xd22d25){var _0xfaff63=this;return new Promise(function(_0x373305,_0x59abb2){return db[_0x3e9c('0x18')][_0x3e9c('0x19')]({'raw':_0xd22d25[_0x3e9c('0x1a')]?_0xd22d25[_0x3e9c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xd22d25[_0x3e9c('0x1a')]?_0xd22d25['options'][_0x3e9c('0x1b')]||null:null,'attributes':_0xd22d25['options']?_0xd22d25['options'][_0x3e9c('0x1c')]||null:null,'limit':_0xd22d25['options']?_0xd22d25[_0x3e9c('0x1a')][_0x3e9c('0x1d')]||null:null,'include':_0xd22d25[_0x3e9c('0x1a')]?_0xd22d25[_0x3e9c('0x1a')][_0x3e9c('0x1e')]?_[_0x3e9c('0x1f')](_0xd22d25['options']['include'],function(_0x30f11a){return{'model':db[_0x30f11a['model']],'as':_0x30f11a['as'],'attributes':_0x30f11a[_0x3e9c('0x1c')],'include':_0x30f11a[_0x3e9c('0x1e')]?_[_0x3e9c('0x1f')](_0x30f11a[_0x3e9c('0x1e')],function(_0xc9fcd3){return{'model':db[_0xc9fcd3[_0x3e9c('0x20')]],'as':_0xc9fcd3['as'],'attributes':_0xc9fcd3[_0x3e9c('0x1c')],'include':_0xc9fcd3['include']?_[_0x3e9c('0x1f')](_0xc9fcd3['include'],function(_0x292933){return{'model':db[_0x292933[_0x3e9c('0x20')]],'as':_0x292933['as'],'attributes':_0x292933[_0x3e9c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3e9c('0xd')](function(_0x103e6d){logger[_0x3e9c('0xe')](_0x3e9c('0x17'),_0xd22d25);logger[_0x3e9c('0x11')](_0x3e9c('0x17'),_0xd22d25,JSON['stringify'](_0x103e6d));_0x373305(_0x103e6d);})['catch'](function(_0xa6e601){logger[_0x3e9c('0x13')](_0x3e9c('0x17'),_0xa6e601[_0x3e9c('0x15')],_0xd22d25);_0x59abb2(_0xfaff63[_0x3e9c('0x13')](0x1f4,_0xa6e601[_0x3e9c('0x15')]));});});};exports[_0x3e9c('0x21')]=function(_0x4e4b3b){var _0x35fdfa=this;return new Promise(function(_0x1a9d63,_0x5cc66f){return db['MailAccount']['find']({'raw':_0x4e4b3b['options']?_0x4e4b3b['options']['raw']===undefined?!![]:![]:!![],'where':_0x4e4b3b['options']?_0x4e4b3b[_0x3e9c('0x1a')][_0x3e9c('0x1b')]||null:null,'attributes':_0x4e4b3b['options']?_0x4e4b3b['options'][_0x3e9c('0x1c')]||null:null,'include':_0x4e4b3b[_0x3e9c('0x1a')]?_0x4e4b3b['options'][_0x3e9c('0x1e')]?_['map'](_0x4e4b3b['options']['include'],function(_0x5b0e7d){return{'model':db[_0x5b0e7d[_0x3e9c('0x20')]],'as':_0x5b0e7d['as'],'attributes':_0x5b0e7d[_0x3e9c('0x1c')],'include':_0x5b0e7d[_0x3e9c('0x1e')]?_['map'](_0x5b0e7d[_0x3e9c('0x1e')],function(_0x10c604){return{'model':db[_0x10c604[_0x3e9c('0x20')]],'as':_0x10c604['as'],'attributes':_0x10c604['attributes'],'include':_0x10c604[_0x3e9c('0x1e')]?_[_0x3e9c('0x1f')](_0x10c604['include'],function(_0x5e8318){return{'model':db[_0x5e8318['model']],'as':_0x5e8318['as'],'attributes':_0x5e8318[_0x3e9c('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26c808){logger[_0x3e9c('0xe')](_0x3e9c('0x21'),_0x4e4b3b);logger[_0x3e9c('0x11')]('ShowMailAccount',_0x4e4b3b,JSON['stringify'](_0x26c808));_0x1a9d63(_0x26c808);})[_0x3e9c('0x16')](function(_0x12f8b7){logger[_0x3e9c('0x13')]('ShowMailAccount',_0x12f8b7['message'],_0x4e4b3b);_0x5cc66f(_0x35fdfa[_0x3e9c('0x13')](0x1f4,_0x12f8b7[_0x3e9c('0x15')]));});});};exports[_0x3e9c('0x22')]=function(_0x246f66){var _0x28ca08=this;return new Promise(function(_0x3329cc,_0x3a9826){var _0x391516={'body':_0x246f66[_0x3e9c('0x23')],'channel':_0x3e9c('0x24')};var _0x337cde=_[_0x3e9c('0x25')](_[_0x3e9c('0x26')](db[_0x3e9c('0x27')][_0x3e9c('0x28')]),[_0x3e9c('0x29'),_0x3e9c('0x2a'),_0x3e9c('0x2b'),_0x3e9c('0x2c')]);var _0x171dec=![];if(_0x246f66[_0x3e9c('0x23')]['id']){delete _0x246f66['body']['id'];}if(_['isNil'](_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x2d')])){return _0x3a9826(_0x28ca08[_0x3e9c('0x13')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x3e9c('0x2e')](_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x23')])||_0x246f66[_0x3e9c('0x23')]['body']===''){return _0x3a9826(_0x28ca08[_0x3e9c('0x13')](0x1f4,_0x3e9c('0x2f')));}if(_[_0x3e9c('0x2e')](_0x246f66['body'][_0x3e9c('0x30')])){return _0x3a9826(_0x28ca08['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x337cde));}if(!_[_0x3e9c('0x31')](_0x337cde,_0x246f66['body'][_0x3e9c('0x30')])){return _0x3a9826(_0x28ca08[_0x3e9c('0x13')](0x1f4,_0x3e9c('0x32')+_0x337cde));}var _0x56754b={};_0x56754b[_0x246f66['body']['mapKey']]=_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x2d')];return db[_0x3e9c('0x18')][_0x3e9c('0x33')]({'where':{'id':_0x246f66['account']['id']},'include':[{'model':db[_0x3e9c('0x34')],'as':_0x3e9c('0x35'),'include':[{'model':db['CmContact'],'as':_0x3e9c('0x36'),'where':_0x56754b,'limit':0x1,'order':[[_0x3e9c('0x2a'),_0x3e9c('0x37')]]}]},{'model':db[_0x3e9c('0x38')],'as':_0x3e9c('0x39')},{'model':db[_0x3e9c('0x3a')],'as':_0x3e9c('0x3b')}]})['then'](function(_0x4798d4){if(_0x4798d4&&_0x4798d4['List']){var _0x4f2533=_0x4798d4[_0x3e9c('0x3c')]({'plain':!![]});_0x391516[_0x3e9c('0x3d')]=_[_0x3e9c('0x3e')](_0x4f2533,['Applications',_0x3e9c('0x35')]);_0x391516[_0x3e9c('0x3f')]=_0x4f2533[_0x3e9c('0x39')];_0x391516[_0x3e9c('0x40')]=_0x4f2533[_0x3e9c('0x35')];_0x391516['applications']=_[_0x3e9c('0x41')](_0x391516[_0x3e9c('0x3f')],[_0x3e9c('0x42')],[_0x3e9c('0x43')]);if(_0x391516['account']&&_0x391516['account'][_0x3e9c('0x44')]){_0x391516['applications'][_0x3e9c('0x45')]({'id':0x0,'priority':_0x391516[_0x3e9c('0x3f')][_0x3e9c('0x46')]+0x1,'app':_0x3e9c('0x47'),'appdata':_0x3e9c('0x44'),'interval':_0x3e9c('0x48')});}if(_0x391516[_0x3e9c('0x3d')][_0x3e9c('0x39')]){delete _0x391516['account'][_0x3e9c('0x39')];}if(_0x391516[_0x3e9c('0x3d')][_0x3e9c('0x35')]){delete _0x391516[_0x3e9c('0x3d')][_0x3e9c('0x35')];}if(_0x4f2533[_0x3e9c('0x35')][_0x3e9c('0x36')][_0x3e9c('0x46')]){return _0x4f2533[_0x3e9c('0x35')][_0x3e9c('0x36')][0x0];}var _0x2741ba=_[_0x3e9c('0x9')](_0x246f66[_0x3e9c('0x23')],{'firstName':_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x2d')],'ListId':_0x4f2533[_0x3e9c('0x2c')]});_0x2741ba[_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x30')]]=_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x2d')];return db['CmContact'][_0x3e9c('0x49')](_0x2741ba);}else{throw new Error('List\x20not\x20found');}})[_0x3e9c('0xd')](function(_0x1c403a){_0x391516['contact']=_0x1c403a;if(_0x1c403a){if(!_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x15')][_0x3e9c('0x4a')]){_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x15')][_0x3e9c('0x4a')]=rs[_0x3e9c('0x4b')]()+'\x20'+_0x246f66['body'][_0x3e9c('0x15')][_0x3e9c('0x2d')];}var _0x3d137b={'ContactId':_0x1c403a['id'],'MailAccountId':_0x246f66[_0x3e9c('0x3d')]['id'],'inReplyTo':_0x246f66['body'][_0x3e9c('0x15')][_0x3e9c('0x4a')],'to':_0x246f66[_0x3e9c('0x23')]['message'][_0x3e9c('0x2d')],'cc':_0x246f66['body']['message']['cc'],'subject':_0x246f66['body'][_0x3e9c('0x15')][_0x3e9c('0x4c')],'attach':_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x15')]['attach'],'lastMsgAt':moment()[_0x3e9c('0x4d')](_0x3e9c('0x4e')),'lastMsgDirection':'in'};return db[_0x3e9c('0x4f')][_0x3e9c('0x33')]({'where':{'closed':![],'MailAccountId':_0x246f66[_0x3e9c('0x3d')]['id']},'include':[{'model':db[_0x3e9c('0x50')],'as':_0x3e9c('0x51'),'attributes':['messageId'],'where':{'messageId':_0x246f66[_0x3e9c('0x23')]['message'][_0x3e9c('0x52')]}}]})[_0x3e9c('0xd')](function(_0x2feb80){if(_0x2feb80){return[_0x2feb80,![]];}return db[_0x3e9c('0x4f')][_0x3e9c('0x49')](_0x3d137b)[_0x3e9c('0xd')](function(_0x4c7a1e){return[_0x4c7a1e,!![]];});});}else{throw new Error(_0x3e9c('0x53'));}})['spread'](function(_0x153efb,_0x405a24){if(_0x153efb){_0x171dec=_0x405a24;if(!_0x405a24){return _0x153efb['update']({'inReplyTo':_0x246f66['body'][_0x3e9c('0x15')][_0x3e9c('0x4a')],'to':_0x246f66['body'][_0x3e9c('0x15')]['from'],'cc':_0x246f66['body'][_0x3e9c('0x15')]['cc'],'subject':_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x15')][_0x3e9c('0x4c')],'attach':_0x153efb[_0x3e9c('0x54')]?_0x153efb['attach']:_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x15')]['attach'],'substatus':null,'substatusAt':moment()[_0x3e9c('0x4d')](_0x3e9c('0x4e')),'lastMsgAt':moment()[_0x3e9c('0x4d')](_0x3e9c('0x4e')),'lastMsgDirection':'in'});}else{return _0x153efb;}}})['then'](function(_0x365cba){_0x391516[_0x3e9c('0x55')]=_0x365cba['get']({'plain':!![]});_0x391516[_0x3e9c('0x55')][_0x3e9c('0x56')]=_0x171dec;return db['MailMessage']['create']({'body':_0x246f66['body'][_0x3e9c('0x23')],'MailAccountId':_0x246f66[_0x3e9c('0x3d')]['id'],'MailInteractionId':_0x365cba['id'],'direction':'in','ContactId':_0x391516[_0x3e9c('0x57')]['id'],'messageId':_0x246f66[_0x3e9c('0x23')]['message'][_0x3e9c('0x4a')],'from':_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x15')]['from'],'to':_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x15')]['to'],'cc':_0x246f66['body'][_0x3e9c('0x15')]['cc'],'subject':_0x246f66[_0x3e9c('0x23')]['message'][_0x3e9c('0x4c')],'attach':_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x15')][_0x3e9c('0x54')],'Attachments':_0x246f66['body']['message'][_0x3e9c('0x58')],'originTo':_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x15')][_0x3e9c('0x59')],'originCc':_0x246f66[_0x3e9c('0x23')]['message'][_0x3e9c('0x5a')],'bcc':_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x15')][_0x3e9c('0x5b')],'ChatWebsiteId':_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x15')][_0x3e9c('0x5c')]||null,'originChannel':_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x15')]['originChannel']||'Email','ChatOfflineMessageId':_0x246f66[_0x3e9c('0x23')][_0x3e9c('0x15')][_0x3e9c('0x5d')]||null},{'include':[{'model':db[_0x3e9c('0x5e')],'as':_0x3e9c('0x5f')}]});})[_0x3e9c('0xd')](function(_0x18d898){_0x391516['message']=_0x18d898;if(_0x391516[_0x3e9c('0x55')][_0x3e9c('0x60')]){return db[_0x3e9c('0x61')][_0x3e9c('0x33')]({'attributes':['id',_0x3e9c('0x62')],'where':{'id':_0x391516['interaction'][_0x3e9c('0x60')]}})['then'](function(_0x32b40){if(_0x32b40){_0x391516['applications'][_0x3e9c('0x63')]({'id':0x0,'priority':0x0,'app':_0x3e9c('0x64'),'appdata':_0x32b40[_0x3e9c('0x62')]+','+(_0x391516[_0x3e9c('0x3d')][_0x3e9c('0x65')]||0xa),'interval':_0x3e9c('0x48')});}return respondWithRpcPromise(_0x3e9c('0x66'),_0x3e9c('0x67'),_0x391516);});}return respondWithRpcPromise(_0x3e9c('0x66'),_0x3e9c('0x67'),_0x391516);})[_0x3e9c('0xd')](function(_0x3874cc){_0x3329cc(_0x3874cc);})[_0x3e9c('0x16')](function(_0x5bed48){_0x3a9826(_0x28ca08[_0x3e9c('0x13')](0x1f4,_0x5bed48[_0x3e9c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 8a29086..55e4850 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 _0x86af=['update','emit','removeListener','register','length','mailAccount:','save'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0x86af,0x156));var _0xf86a=function(_0x27d4d8,_0x14d60d){_0x27d4d8=_0x27d4d8-0x0;var _0x2b66ee=_0x86af[_0x27d4d8];return _0x2b66ee;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xf86a('0x0'),'remove',_0xf86a('0x1')];function createListener(_0x1144c9,_0x3623b6){return function(_0x22fb55){_0x3623b6[_0xf86a('0x2')](_0x1144c9,_0x22fb55);};}function removeListener(_0x4367de,_0x34739a){return function(){MailAccountEvents[_0xf86a('0x3')](_0x4367de,_0x34739a);};}exports[_0xf86a('0x4')]=function(_0x53451e){for(var _0x3522d8=0x0,_0x2ac749=events[_0xf86a('0x5')];_0x3522d8<_0x2ac749;_0x3522d8++){var _0x278db8=events[_0x3522d8];var _0x115c19=createListener(_0xf86a('0x6')+_0x278db8,_0x53451e);MailAccountEvents['on'](_0x278db8,_0x115c19);}}; \ No newline at end of file +var _0xf058=['save','remove','emit','removeListener','register','length','mailAccount:','./mailAccount.events'];(function(_0x1d0c0f,_0xaeaf3b){var _0x55a52a=function(_0x11bd39){while(--_0x11bd39){_0x1d0c0f['push'](_0x1d0c0f['shift']());}};_0x55a52a(++_0xaeaf3b);}(_0xf058,0x1ef));var _0x8f05=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf058[_0x3dd15e];return _0x231fd0;};'use strict';var MailAccountEvents=require(_0x8f05('0x0'));var events=[_0x8f05('0x1'),_0x8f05('0x2'),'update'];function createListener(_0xe20d66,_0x1ddea7){return function(_0x344610){_0x1ddea7[_0x8f05('0x3')](_0xe20d66,_0x344610);};}function removeListener(_0x2c3399,_0x353e7a){return function(){MailAccountEvents[_0x8f05('0x4')](_0x2c3399,_0x353e7a);};}exports[_0x8f05('0x5')]=function(_0x12fd26){for(var _0x447514=0x0,_0x5d0e84=events[_0x8f05('0x6')];_0x447514<_0x5d0e84;_0x447514++){var _0x17796a=events[_0x447514];var _0x58b3c1=createListener(_0x8f05('0x7')+_0x17796a,_0x12fd26);MailAccountEvents['on'](_0x17796a,_0x58b3c1);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index e8d44e5..1d79d65 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 _0xb99a=['../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb99a,0x1d5));var _0xab99=function(_0x21d475,_0x58d09e){_0x21d475=_0x21d475-0x0;var _0x443857=_0xb99a[_0x21d475];return _0x443857;};'use strict';var multer=require(_0xab99('0x0'));var util=require(_0xab99('0x1'));var path=require(_0xab99('0x2'));var timeout=require('connect-timeout');var express=require(_0xab99('0x3'));var router=express[_0xab99('0x4')]();var fs_extra=require(_0xab99('0x5'));var auth=require(_0xab99('0x6'));var interaction=require(_0xab99('0x7'));var config=require(_0xab99('0x8'));var controller=require(_0xab99('0x9'));router[_0xab99('0xa')](_0xab99('0xb'),auth[_0xab99('0xc')](),controller[_0xab99('0xd')]);router['put'](_0xab99('0xb'),auth[_0xab99('0xc')](),controller[_0xab99('0xe')]);router[_0xab99('0xf')](_0xab99('0xb'),auth[_0xab99('0xc')](),controller[_0xab99('0x10')]);module['exports']=router; \ No newline at end of file +var _0x88aa=['exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','destroy'];(function(_0x40eec9,_0x817a67){var _0xfee890=function(_0x186640){while(--_0x186640){_0x40eec9['push'](_0x40eec9['shift']());}};_0xfee890(++_0x817a67);}(_0x88aa,0x83));var _0xa88a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x88aa[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xa88a('0x0'));var path=require(_0xa88a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa88a('0x2')]();var fs_extra=require(_0xa88a('0x3'));var auth=require(_0xa88a('0x4'));var interaction=require(_0xa88a('0x5'));var config=require(_0xa88a('0x6'));var controller=require(_0xa88a('0x7'));router[_0xa88a('0x8')](_0xa88a('0x9'),auth[_0xa88a('0xa')](),controller['show']);router['put']('/:id',auth[_0xa88a('0xa')](),controller['update']);router['delete'](_0xa88a('0x9'),auth['isAuthenticated'](),controller[_0xa88a('0xb')]);module[_0xa88a('0xc')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index f3bebd4..843ab74 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 _0xb9db=['STRING','TEXT','sequelize','exports','INTEGER'];(function(_0x1c0656,_0x5ae8a1){var _0x50287f=function(_0x327905){while(--_0x327905){_0x1c0656['push'](_0x1c0656['shift']());}};_0x50287f(++_0x5ae8a1);}(_0xb9db,0x7a));var _0xbb9d=function(_0x2c5a10,_0xf0c1d2){_0x2c5a10=_0x2c5a10-0x0;var _0x443d0a=_0xb9db[_0x2c5a10];return _0x443d0a;};'use strict';var Sequelize=require(_0xbb9d('0x0'));module[_0xbb9d('0x1')]={'priority':{'type':Sequelize[_0xbb9d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbb9d('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbb9d('0x4')]()},'description':{'type':Sequelize[_0xbb9d('0x3')]},'interval':{'type':Sequelize[_0xbb9d('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xc83d=['TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x3c600d,_0x4b5c85){var _0xd195e3=function(_0x2a2f5f){while(--_0x2a2f5f){_0x3c600d['push'](_0x3c600d['shift']());}};_0xd195e3(++_0x4b5c85);}(_0xc83d,0x16f));var _0xdc83=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc83d[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xdc83('0x0'));module['exports']={'priority':{'type':Sequelize[_0xdc83('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xdc83('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xdc83('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xdc83('0x2')],'defaultValue':_0xdc83('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index c2d7546..2fccb23 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(_0x2f9d44,_0x56cc02){var _0x10edba=function(_0x4ad319){while(--_0x4ad319){_0x2f9d44['push'](_0x2f9d44['shift']());}};_0x10edba(++_0x56cc02);}(_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 _0xf4eb=['limit','count','Content-Range','json','apply','reject','save','then','destroy','error','name','send','params','keys','MailApplication','rawAttributes','query','filters','intersection','model','fields','attributes','includeAll','include','options','find','catch','body','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined'];(function(_0x272993,_0x4ea8d4){var _0x2270ed=function(_0x1bc05d){while(--_0x1bc05d){_0x272993['push'](_0x272993['shift']());}};_0x2270ed(++_0x4ea8d4);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1b2299,_0x1361a4){_0x1b2299=_0x1b2299-0x0;var _0x354118=_0xf4eb[_0x1b2299];return _0x354118;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){_0x51648c[_0xbf4e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90635e,_0x36688a){return function(_0x3d6863){if(!_0x3d6863){_0x90635e['sendStatus'](0x194);}return _0x3d6863;};}function handleError(_0x2fb490,_0x5e08b1){_0x5e08b1=_0x5e08b1||0x1f4;return function(_0x5bcf71){logger[_0xbf4e('0x21')](_0x5bcf71['stack']);if(_0x5bcf71[_0xbf4e('0x22')]){delete _0x5bcf71[_0xbf4e('0x22')];}_0x2fb490[_0xbf4e('0x14')](_0x5e08b1)[_0xbf4e('0x23')](_0x5bcf71);};}exports['show']=function(_0x2d4686,_0x8e0ab5){var _0x43879d={'raw':!![],'where':{'id':_0x2d4686[_0xbf4e('0x24')]['id']}},_0x4cd4a1={};_0x4cd4a1['model']=_[_0xbf4e('0x25')](db[_0xbf4e('0x26')][_0xbf4e('0x27')]);_0x4cd4a1['query']=_[_0xbf4e('0x25')](_0x2d4686[_0xbf4e('0x28')]);_0x4cd4a1[_0xbf4e('0x29')]=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],_0x4cd4a1[_0xbf4e('0x28')]);_0x43879d['attributes']=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],qs['fields'](_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2c')]));_0x43879d['attributes']=_0x43879d[_0xbf4e('0x2d')]['length']?_0x43879d[_0xbf4e('0x2d')]:_0x4cd4a1['model'];if(_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2e')]){_0x43879d[_0xbf4e('0x2f')]=[{'all':!![]}];}_0x43879d=_['merge']({},_0x43879d,_0x2d4686[_0xbf4e('0x30')]);return db[_0xbf4e('0x26')][_0xbf4e('0x31')](_0x43879d)[_0xbf4e('0x1f')](handleEntityNotFound(_0x8e0ab5,null))[_0xbf4e('0x1f')](respondWithResult(_0x8e0ab5,null))[_0xbf4e('0x32')](handleError(_0x8e0ab5,null));};exports['update']=function(_0x99b320,_0x3dbb2b){if(_0x99b320[_0xbf4e('0x33')]['id']){delete _0x99b320[_0xbf4e('0x33')]['id'];}return db[_0xbf4e('0x26')]['find']({'where':{'id':_0x99b320['params']['id']}})['then'](handleEntityNotFound(_0x3dbb2b,null))['then'](saveUpdates(_0x99b320[_0xbf4e('0x33')],null))[_0xbf4e('0x1f')](respondWithResult(_0x3dbb2b,null))[_0xbf4e('0x32')](handleError(_0x3dbb2b,null));};exports[_0xbf4e('0x20')]=function(_0x22ddde,_0x257b74){return db[_0xbf4e('0x26')][_0xbf4e('0x31')]({'where':{'id':_0x22ddde[_0xbf4e('0x24')]['id']}})['then'](handleEntityNotFound(_0x257b74,null))['then'](removeEntity(_0x257b74,null))[_0xbf4e('0x32')](handleError(_0x257b74,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 32486c0..f797e9b 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 _0xe171=['MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define'];(function(_0x44c995,_0x1c2add){var _0xa18619=function(_0x459939){while(--_0x459939){_0x44c995['push'](_0x44c995['shift']());}};_0xa18619(++_0x1c2add);}(_0xe171,0x1c4));var _0x1e17=function(_0x4edc3d,_0x3ded58){_0x4edc3d=_0x4edc3d-0x0;var _0x1b659b=_0xe171[_0x4edc3d];return _0x1b659b;};'use strict';var _=require('lodash');var util=require(_0x1e17('0x0'));var logger=require(_0x1e17('0x1'))('api');var moment=require(_0x1e17('0x2'));var BPromise=require('bluebird');var rp=require(_0x1e17('0x3'));var fs=require('fs');var path=require(_0x1e17('0x4'));var rimraf=require(_0x1e17('0x5'));var config=require(_0x1e17('0x6'));var attributes=require(_0x1e17('0x7'));module[_0x1e17('0x8')]=function(_0x42c29a,_0x54f1da){return _0x42c29a[_0x1e17('0x9')](_0x1e17('0xa'),attributes,{'tableName':_0x1e17('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1e17('0xc'),'collate':_0x1e17('0xd')});}; \ No newline at end of file +var _0x17d7=['lodash','util','../../config/logger','api','moment','request-promise','path','define','MailApplication','utf8mb4_unicode_ci'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x17d7,0x118));var _0x717d=function(_0x3da901,_0x498bec){_0x3da901=_0x3da901-0x0;var _0xda8ce8=_0x17d7[_0x3da901];return _0xda8ce8;};'use strict';var _=require(_0x717d('0x0'));var util=require(_0x717d('0x1'));var logger=require(_0x717d('0x2'))(_0x717d('0x3'));var moment=require(_0x717d('0x4'));var BPromise=require('bluebird');var rp=require(_0x717d('0x5'));var fs=require('fs');var path=require(_0x717d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module['exports']=function(_0x48d21b,_0x232d88){return _0x48d21b[_0x717d('0x7')](_0x717d('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x717d('0x9')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 808f3dc..483b436 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 _0x8fbd=['debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','update','options','raw','where','attributes','limit','UpdateMailApplication','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0x8fbd,0x1d0));var _0xd8fb=function(_0x4f7296,_0x10bf5f){_0x4f7296=_0x4f7296-0x0;var _0x2a8ab3=_0x8fbd[_0x4f7296];return _0x2a8ab3;};'use strict';var _=require(_0xd8fb('0x0'));var util=require(_0xd8fb('0x1'));var moment=require(_0xd8fb('0x2'));var BPromise=require(_0xd8fb('0x3'));var rs=require(_0xd8fb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd8fb('0x5'))['db'];var utils=require(_0xd8fb('0x6'));var logger=require(_0xd8fb('0x7'))('rpc');var config=require(_0xd8fb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd8fb('0x9')][_0xd8fb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25ed89,_0x95a301,_0xb1700){return new BPromise(function(_0x144d8e,_0x1e970c){return client[_0xd8fb('0xb')](_0x25ed89,_0xb1700)[_0xd8fb('0xc')](function(_0x259c45){logger[_0xd8fb('0xd')](_0xd8fb('0xe'),_0x95a301,_0xd8fb('0xf'));logger[_0xd8fb('0x10')](_0xd8fb('0x11'),_0x95a301,_0xd8fb('0xf'),JSON[_0xd8fb('0x12')](_0x259c45));if(_0x259c45[_0xd8fb('0x13')]){if(_0x259c45[_0xd8fb('0x13')]['code']===0x1f4){logger[_0xd8fb('0x13')](_0xd8fb('0xe'),_0x95a301,_0x259c45[_0xd8fb('0x13')]['message']);return _0x1e970c(_0x259c45[_0xd8fb('0x13')][_0xd8fb('0x14')]);}logger[_0xd8fb('0x13')](_0xd8fb('0xe'),_0x95a301,_0x259c45[_0xd8fb('0x13')][_0xd8fb('0x14')]);return _0x144d8e(_0x259c45['error'][_0xd8fb('0x14')]);}else{logger[_0xd8fb('0xd')](_0xd8fb('0xe'),_0x95a301,_0xd8fb('0xf'));_0x144d8e(_0x259c45[_0xd8fb('0x15')][_0xd8fb('0x14')]);}})[_0xd8fb('0x16')](function(_0x5f0d79){logger[_0xd8fb('0x13')](_0xd8fb('0xe'),_0x95a301,_0x5f0d79);_0x1e970c(_0x5f0d79);});});}exports['UpdateMailApplication']=function(_0x51db6d){var _0x318bf2=this;return new Promise(function(_0x992419,_0x5edccc){return db['MailApplication'][_0xd8fb('0x17')](_0x51db6d['body'],{'raw':_0x51db6d[_0xd8fb('0x18')]?_0x51db6d[_0xd8fb('0x18')][_0xd8fb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51db6d[_0xd8fb('0x18')]?_0x51db6d[_0xd8fb('0x18')][_0xd8fb('0x1a')]||null:null,'attributes':_0x51db6d[_0xd8fb('0x18')]?_0x51db6d['options'][_0xd8fb('0x1b')]||null:null,'limit':_0x51db6d[_0xd8fb('0x18')]?_0x51db6d[_0xd8fb('0x18')][_0xd8fb('0x1c')]||null:null})['then'](function(_0x197c12){logger[_0xd8fb('0xd')]('UpdateMailApplication',_0x51db6d);logger[_0xd8fb('0x10')](_0xd8fb('0x1d'),_0x51db6d,JSON[_0xd8fb('0x12')](_0x197c12));_0x992419(_0x197c12);})[_0xd8fb('0x16')](function(_0x3957ef){logger[_0xd8fb('0x13')](_0xd8fb('0x1d'),_0x3957ef[_0xd8fb('0x14')],_0x51db6d);_0x5edccc(_0x318bf2[_0xd8fb('0x13')](0x1f4,_0x3957ef[_0xd8fb('0x14')]));});});}; \ No newline at end of file +var _0xb9a0=['then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','MailApplication','update','body','options','raw','attributes','limit','UpdateMailApplication','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x503350,_0x3fbbb8){var _0x49e615=function(_0x58b6f0){while(--_0x58b6f0){_0x503350['push'](_0x503350['shift']());}};_0x49e615(++_0x3fbbb8);}(_0xb9a0,0x186));var _0x0b9a=function(_0x212476,_0x25fd97){_0x212476=_0x212476-0x0;var _0x21b5fb=_0xb9a0[_0x212476];return _0x21b5fb;};'use strict';var _=require(_0x0b9a('0x0'));var util=require(_0x0b9a('0x1'));var moment=require(_0x0b9a('0x2'));var BPromise=require('bluebird');var rs=require(_0x0b9a('0x3'));var fs=require('fs');var Redis=require(_0x0b9a('0x4'));var db=require(_0x0b9a('0x5'))['db'];var utils=require(_0x0b9a('0x6'));var logger=require(_0x0b9a('0x7'))(_0x0b9a('0x8'));var config=require(_0x0b9a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0b9a('0xa')][_0x0b9a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x131a2c,_0x457e80,_0xe430f6){return new BPromise(function(_0x33ce5a,_0x1cec71){return client[_0x0b9a('0xc')](_0x131a2c,_0xe430f6)[_0x0b9a('0xd')](function(_0x2f78b8){logger[_0x0b9a('0xe')](_0x0b9a('0xf'),_0x457e80,_0x0b9a('0x10'));logger['debug'](_0x0b9a('0x11'),_0x457e80,'request\x20sent',JSON[_0x0b9a('0x12')](_0x2f78b8));if(_0x2f78b8['error']){if(_0x2f78b8[_0x0b9a('0x13')]['code']===0x1f4){logger['error'](_0x0b9a('0xf'),_0x457e80,_0x2f78b8[_0x0b9a('0x13')][_0x0b9a('0x14')]);return _0x1cec71(_0x2f78b8[_0x0b9a('0x13')]['message']);}logger[_0x0b9a('0x13')](_0x0b9a('0xf'),_0x457e80,_0x2f78b8[_0x0b9a('0x13')][_0x0b9a('0x14')]);return _0x33ce5a(_0x2f78b8[_0x0b9a('0x13')][_0x0b9a('0x14')]);}else{logger[_0x0b9a('0xe')](_0x0b9a('0xf'),_0x457e80,_0x0b9a('0x10'));_0x33ce5a(_0x2f78b8[_0x0b9a('0x15')][_0x0b9a('0x14')]);}})['catch'](function(_0x102d2e){logger[_0x0b9a('0x13')](_0x0b9a('0xf'),_0x457e80,_0x102d2e);_0x1cec71(_0x102d2e);});});}exports['UpdateMailApplication']=function(_0x3fb823){var _0x5f0fd9=this;return new Promise(function(_0x47b9e1,_0x1df5d9){return db[_0x0b9a('0x16')][_0x0b9a('0x17')](_0x3fb823[_0x0b9a('0x18')],{'raw':_0x3fb823[_0x0b9a('0x19')]?_0x3fb823[_0x0b9a('0x19')][_0x0b9a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fb823[_0x0b9a('0x19')]?_0x3fb823['options']['where']||null:null,'attributes':_0x3fb823[_0x0b9a('0x19')]?_0x3fb823['options'][_0x0b9a('0x1b')]||null:null,'limit':_0x3fb823[_0x0b9a('0x19')]?_0x3fb823[_0x0b9a('0x19')][_0x0b9a('0x1c')]||null:null})[_0x0b9a('0xd')](function(_0xdb6a0b){logger[_0x0b9a('0xe')](_0x0b9a('0x1d'),_0x3fb823);logger['debug'](_0x0b9a('0x1d'),_0x3fb823,JSON[_0x0b9a('0x12')](_0xdb6a0b));_0x47b9e1(_0xdb6a0b);})[_0x0b9a('0x1e')](function(_0x1f29ac){logger[_0x0b9a('0x13')](_0x0b9a('0x1d'),_0x1f29ac[_0x0b9a('0x14')],_0x3fb823);_0x1df5d9(_0x5f0fd9[_0x0b9a('0x13')](0x1f4,_0x1f29ac['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 63b2a58..cdc2df9 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 _0x60f9=['post','/:id/messages','addMessage','mail','mailinteraction:addtags','/:id','mailinteraction:update','update','delete','tracked','mailinteraction:destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','/describe','describe','get','show','/:id/download','download'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x60f9,0x70));var _0x960f=function(_0x40fad7,_0x4690ce){_0x40fad7=_0x40fad7-0x0;var _0x38f9e6=_0x60f9[_0x40fad7];return _0x38f9e6;};'use strict';var express=require(_0x960f('0x0'));var router=express[_0x960f('0x1')]();var auth=require(_0x960f('0x2'));var interaction=require(_0x960f('0x3'));var controller=require(_0x960f('0x4'));router['get']('/',auth[_0x960f('0x5')](),controller[_0x960f('0x6')]);router['get'](_0x960f('0x7'),auth[_0x960f('0x5')](),controller[_0x960f('0x8')]);router[_0x960f('0x9')]('/:id',auth[_0x960f('0x5')](),controller[_0x960f('0xa')]);router[_0x960f('0x9')]('/:id/messages',auth[_0x960f('0x5')](),controller['getMessages']);router[_0x960f('0x9')](_0x960f('0xb'),auth['isAuthenticated'](),controller[_0x960f('0xc')]);router[_0x960f('0xd')]('/',auth[_0x960f('0x5')](),controller['create']);router[_0x960f('0xd')](_0x960f('0xe'),auth[_0x960f('0x5')](),controller[_0x960f('0xf')]);router[_0x960f('0xd')]('/:id/tags',auth[_0x960f('0x5')](),interaction['tracked'](_0x960f('0x10'),_0x960f('0x11')),controller['addTags']);router['put'](_0x960f('0x12'),auth[_0x960f('0x5')](),interaction['tracked']('mail',_0x960f('0x13')),controller[_0x960f('0x14')]);router[_0x960f('0x15')](_0x960f('0x12'),auth[_0x960f('0x5')](),interaction[_0x960f('0x16')](_0x960f('0x10'),_0x960f('0x17')),controller['destroy']);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x960f('0x18')]=router; \ No newline at end of file +var _0x9f2b=['./mailInteraction.controller','isAuthenticated','get','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','mail','mailinteraction:addtags','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','Router','../../components/auth/service'];(function(_0x570ae7,_0x365171){var _0x30b8f0=function(_0x2741a2){while(--_0x2741a2){_0x570ae7['push'](_0x570ae7['shift']());}};_0x30b8f0(++_0x365171);}(_0x9f2b,0x1c0));var _0xb9f2=function(_0x5b720c,_0x5b8cf0){_0x5b720c=_0x5b720c-0x0;var _0x3e1120=_0x9f2b[_0x5b720c];return _0x3e1120;};'use strict';var express=require('express');var router=express[_0xb9f2('0x0')]();var auth=require(_0xb9f2('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0xb9f2('0x2'));router['get']('/',auth[_0xb9f2('0x3')](),controller['index']);router[_0xb9f2('0x4')](_0xb9f2('0x5'),auth['isAuthenticated'](),controller[_0xb9f2('0x6')]);router[_0xb9f2('0x4')](_0xb9f2('0x7'),auth[_0xb9f2('0x3')](),controller['show']);router['get'](_0xb9f2('0x8'),auth['isAuthenticated'](),controller[_0xb9f2('0x9')]);router[_0xb9f2('0x4')](_0xb9f2('0xa'),auth[_0xb9f2('0x3')](),controller[_0xb9f2('0xb')]);router[_0xb9f2('0xc')]('/',auth[_0xb9f2('0x3')](),controller[_0xb9f2('0xd')]);router[_0xb9f2('0xc')](_0xb9f2('0x8'),auth[_0xb9f2('0x3')](),controller['addMessage']);router[_0xb9f2('0xc')](_0xb9f2('0xe'),auth[_0xb9f2('0x3')](),interaction[_0xb9f2('0xf')](_0xb9f2('0x10'),_0xb9f2('0x11')),controller['addTags']);router['put'](_0xb9f2('0x7'),auth['isAuthenticated'](),interaction[_0xb9f2('0xf')](_0xb9f2('0x10'),_0xb9f2('0x12')),controller[_0xb9f2('0x13')]);router[_0xb9f2('0x14')](_0xb9f2('0x7'),auth[_0xb9f2('0x3')](),interaction[_0xb9f2('0xf')](_0xb9f2('0x10'),_0xb9f2('0x15')),controller[_0xb9f2('0x16')]);router[_0xb9f2('0x14')](_0xb9f2('0xe'),auth[_0xb9f2('0x3')](),controller[_0xb9f2('0x17')]);module[_0xb9f2('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 5772dff..0f64c55 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 _0x20d7=['STRING','TEXT','ENUM','out','exports','BOOLEAN','DATE'];(function(_0x2ca395,_0x4383e5){var _0x8a49a=function(_0x566a48){while(--_0x566a48){_0x2ca395['push'](_0x2ca395['shift']());}};_0x8a49a(++_0x4383e5);}(_0x20d7,0x146));var _0x720d=function(_0x65deb5,_0x345ecc){_0x65deb5=_0x65deb5-0x0;var _0x1188d6=_0x20d7[_0x65deb5];return _0x1188d6;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module[_0x720d('0x0')]={'closed':{'type':Sequelize[_0x720d('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x720d('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x720d('0x3')]},'inReplyTo':{'type':Sequelize[_0x720d('0x3')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x720d('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x720d('0x2')]},'substatus':{'type':Sequelize[_0x720d('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x720d('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x720d('0x5')]('in',_0x720d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x720d('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x720d('0x5')]('in',_0x720d('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x720d('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x6729=['TEXT','long','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x451b32,_0x1eace6){var _0x4ac489=function(_0x458d72){while(--_0x458d72){_0x451b32['push'](_0x451b32['shift']());}};_0x4ac489(++_0x1eace6);}(_0x6729,0x130));var _0x9672=function(_0x3f77ad,_0x5d9bbf){_0x3f77ad=_0x3f77ad-0x0;var _0x561b66=_0x6729[_0x3f77ad];return _0x561b66;};'use strict';var Sequelize=require(_0x9672('0x0'));var iconv=require(_0x9672('0x1'));module[_0x9672('0x2')]={'closed':{'type':Sequelize[_0x9672('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9672('0x4')]},'disposition':{'type':Sequelize[_0x9672('0x5')]},'secondDisposition':{'type':Sequelize[_0x9672('0x5')]},'thirdDisposition':{'type':Sequelize[_0x9672('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x9672('0x6')](_0x9672('0x7'))},'subject':{'type':Sequelize[_0x9672('0x6')]()},'attach':{'type':Sequelize[_0x9672('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x9672('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x9672('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9672('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x9672('0x8')]('in',_0x9672('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9672('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 ab3cbc7..7a7051c 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 _0xa9e0=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$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','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0x1d531c,_0x429b6a){var _0x246898=function(_0x307198){while(--_0x307198){_0x1d531c['push'](_0x1d531c['shift']());}};_0x246898(++_0x429b6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('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','contactName');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));}; \ No newline at end of file +var _0xa9e0=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$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','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0x31edbe,_0x34d231){var _0x37fcee=function(_0x17ecba){while(--_0x17ecba){_0x31edbe['push'](_0x31edbe['shift']());}};_0x37fcee(++_0x34d231);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('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','contactName');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 05d23ca..3fcef3d 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 _0x2e10=['setDataValue','Users','findAll','length','catch','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','remove','getUsers','then'];(function(_0x5eb21c,_0x1fa97b){var _0x567a67=function(_0x344f1e){while(--_0x344f1e){_0x5eb21c['push'](_0x5eb21c['shift']());}};_0x567a67(++_0x1fa97b);}(_0x2e10,0xe7));var _0x02e1=function(_0xaea3e4,_0x1dd14f){_0xaea3e4=_0xaea3e4-0x0;var _0x5952f7=_0x2e10[_0xaea3e4];return _0x5952f7;};'use strict';var EventEmitter=require(_0x02e1('0x0'));var MailInteraction=require(_0x02e1('0x1'))['db'][_0x02e1('0x2')];var MailMessage=require('../../mysqldb')['db'][_0x02e1('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x02e1('0x4')};function emitEvent(_0x227992){return function(_0x54436f,_0x2e6aca,_0x1f1dc4){_0x54436f[_0x02e1('0x5')]({'attributes':['id'],'raw':!![]})[_0x02e1('0x6')](function(_0x5485ae){_0x54436f[_0x02e1('0x7')](_0x02e1('0x8'),_0x5485ae['map'](function(_0x4deb6d){return{'id':_0x4deb6d['id']};}));return MailMessage[_0x02e1('0x9')]({'where':{'MailInteractionId':_0x54436f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x02e1('0x6')](function(_0x43ffb3){_0x54436f[_0x02e1('0x7')]('unreadMessages',_0x43ffb3[_0x02e1('0xa')]);MailInteractionEvents['emit'](_0x227992+':'+_0x54436f['id'],_0x54436f);MailInteractionEvents['emit'](_0x227992,_0x54436f);_0x1f1dc4(null);})[_0x02e1('0xb')](_0x1f1dc4(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x02e1('0xc')](e,emitEvent(event));}}module[_0x02e1('0xd')]=MailInteractionEvents; \ No newline at end of file +var _0x4f6e=['setDataValue','emit','catch','hasOwnProperty','hook','events','MailInteraction','../../mysqldb','update','remove','getUsers','then','Users','map','findAll'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0x4f6e,0x1e5));var _0xe4f6=function(_0x18563b,_0x5ce02a){_0x18563b=_0x18563b-0x0;var _0x46534e=_0x4f6e[_0x18563b];return _0x46534e;};'use strict';var EventEmitter=require(_0xe4f6('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xe4f6('0x1')];var MailMessage=require(_0xe4f6('0x2'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe4f6('0x3'),'afterDestroy':_0xe4f6('0x4')};function emitEvent(_0xe132d6){return function(_0x1e6065,_0x5b3fb7,_0x2ae047){_0x1e6065[_0xe4f6('0x5')]({'attributes':['id'],'raw':!![]})[_0xe4f6('0x6')](function(_0x28486e){_0x1e6065['setDataValue'](_0xe4f6('0x7'),_0x28486e[_0xe4f6('0x8')](function(_0x21a6da){return{'id':_0x21a6da['id']};}));return MailMessage[_0xe4f6('0x9')]({'where':{'MailInteractionId':_0x1e6065['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe4f6('0x6')](function(_0xde81e2){_0x1e6065[_0xe4f6('0xa')]('unreadMessages',_0xde81e2['length']);MailInteractionEvents[_0xe4f6('0xb')](_0xe132d6+':'+_0x1e6065['id'],_0x1e6065);MailInteractionEvents[_0xe4f6('0xb')](_0xe132d6,_0x1e6065);_0x2ae047(null);})[_0xe4f6('0xc')](_0x2ae047(null));};}for(var e in events){if(events[_0xe4f6('0xd')](e)){var event=events[e];MailInteraction[_0xe4f6('0xe')](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 b4fe036..940258e 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 _0x5445=['moment','request-promise','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','then','catch','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x267c1e,_0x56f036){var _0x28aa91=function(_0xc28ea4){while(--_0xc28ea4){_0x267c1e['push'](_0x267c1e['shift']());}};_0x28aa91(++_0x56f036);}(_0x5445,0x182));var _0x5544=function(_0x3d6eb1,_0x1f99b1){_0x3d6eb1=_0x3d6eb1-0x0;var _0x4e5356=_0x5445[_0x3d6eb1];return _0x4e5356;};'use strict';var _=require(_0x5544('0x0'));var util=require(_0x5544('0x1'));var logger=require(_0x5544('0x2'))(_0x5544('0x3'));var moment=require(_0x5544('0x4'));var BPromise=require('bluebird');var rp=require(_0x5544('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5544('0x6'));var config=require('../../config/environment');var attributes=require(_0x5544('0x7'));module[_0x5544('0x8')]=function(_0x3ff562,_0x56eade){return _0x3ff562[_0x5544('0x9')](_0x5544('0xa'),attributes,{'tableName':_0x5544('0xb'),'paranoid':![],'indexes':[{'name':_0x5544('0xc'),'fields':[_0x5544('0xd'),'to'],'type':_0x5544('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x22a908,_0x42840c,_0x1b475f){if(_0x22a908[_0x5544('0xf')]){_0x22a908[_0x5544('0x10')]=moment()[_0x5544('0x11')](_0x5544('0x12'));}if(_0x22a908[_0x5544('0x13')]){_0x22a908[_0x5544('0x14')]=moment()[_0x5544('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1b475f(null,_0x42840c);},'beforeUpdate':function(_0x5eed2e,_0x4a56fa,_0x144074){if(_0x5eed2e[_0x5544('0x15')](_0x5544('0xf'))){_0x5eed2e[_0x5544('0x10')]=_0x5eed2e[_0x5544('0xf')]?moment()[_0x5544('0x11')](_0x5544('0x12')):null;}if(_0x5eed2e['changed']('closed')){_0x5eed2e[_0x5544('0x14')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5eed2e['substatus']=null;_0x5eed2e[_0x5544('0x10')]=null;}_0x144074(null,_0x5eed2e);},'afterUpdate':function(_0x11c120,_0x319af3,_0x455cf9){var _0x347ed1=_0x3ff562[_0x5544('0x16')];var _0x3d23fd=_0x11c120['get']({'plain':!![]});if(_0x3d23fd['closed']){return _0x347ed1['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x3d23fd['id']}})[_0x5544('0x17')](function(){_0x455cf9();})[_0x5544('0x18')](function(_0x371b4b){_0x455cf9(_0x371b4b);});}else{_0x455cf9();}}},'charset':_0x5544('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6dbd=['exports','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','MailMessage','update','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes'];(function(_0x5a5fc5,_0x458433){var _0x116945=function(_0x3e6441){while(--_0x3e6441){_0x5a5fc5['push'](_0x5a5fc5['shift']());}};_0x116945(++_0x458433);}(_0x6dbd,0x1ed));var _0xd6db=function(_0x3ec15b,_0x24a8f9){_0x3ec15b=_0x3ec15b-0x0;var _0x28c370=_0x6dbd[_0x3ec15b];return _0x28c370;};'use strict';var _=require(_0xd6db('0x0'));var util=require(_0xd6db('0x1'));var logger=require(_0xd6db('0x2'))(_0xd6db('0x3'));var moment=require(_0xd6db('0x4'));var BPromise=require(_0xd6db('0x5'));var rp=require(_0xd6db('0x6'));var fs=require('fs');var path=require(_0xd6db('0x7'));var rimraf=require(_0xd6db('0x8'));var config=require(_0xd6db('0x9'));var attributes=require(_0xd6db('0xa'));module[_0xd6db('0xb')]=function(_0x212ba5,_0x15ec2f){return _0x212ba5[_0xd6db('0xc')](_0xd6db('0xd'),attributes,{'tableName':_0xd6db('0xe'),'paranoid':![],'indexes':[{'name':_0xd6db('0xf'),'fields':['subject','to'],'type':_0xd6db('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x52d826,_0x2cef7c,_0x28e934){if(_0x52d826['substatus']){_0x52d826[_0xd6db('0x11')]=moment()[_0xd6db('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x52d826[_0xd6db('0x13')]){_0x52d826[_0xd6db('0x14')]=moment()[_0xd6db('0x12')](_0xd6db('0x15'));}_0x28e934(null,_0x2cef7c);},'beforeUpdate':function(_0x2eaf4b,_0x1cbee5,_0x542079){if(_0x2eaf4b[_0xd6db('0x16')]('substatus')){_0x2eaf4b[_0xd6db('0x11')]=_0x2eaf4b[_0xd6db('0x17')]?moment()[_0xd6db('0x12')](_0xd6db('0x15')):null;}if(_0x2eaf4b[_0xd6db('0x16')]('closed')){_0x2eaf4b[_0xd6db('0x14')]=moment()[_0xd6db('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x2eaf4b[_0xd6db('0x17')]=null;_0x2eaf4b[_0xd6db('0x11')]=null;}_0x542079(null,_0x2eaf4b);},'afterUpdate':function(_0x5a23fe,_0x235bae,_0x5f5c8b){var _0x3ee79d=_0x212ba5['models'];var _0x11132d=_0x5a23fe['get']({'plain':!![]});if(_0x11132d[_0xd6db('0x13')]){return _0x3ee79d[_0xd6db('0x18')][_0xd6db('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x11132d['id']}})['then'](function(){_0x5f5c8b();})[_0xd6db('0x1a')](function(_0x11d927){_0x5f5c8b(_0x11d927);});}else{_0x5f5c8b();}}},'charset':'utf8mb4','collate':_0xd6db('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 3834b43..051d56d 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 _0xc17f=['where','attributes','limit','then','UpdateMailInteraction','debug','MailInteraction','omit','body','ids','AddTags','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','info','request\x20sent','error','code','MailInteraction,\x20%s,\x20%s','message','result','update','options','raw'];(function(_0x1dde62,_0x5a9a18){var _0x405b33=function(_0x59703d){while(--_0x59703d){_0x1dde62['push'](_0x1dde62['shift']());}};_0x405b33(++_0x5a9a18);}(_0xc17f,0x155));var _0xfc17=function(_0x121056,_0x40011f){_0x121056=_0x121056-0x0;var _0xa79aaf=_0xc17f[_0x121056];return _0xa79aaf;};'use strict';var _=require(_0xfc17('0x0'));var util=require(_0xfc17('0x1'));var moment=require(_0xfc17('0x2'));var BPromise=require(_0xfc17('0x3'));var rs=require(_0xfc17('0x4'));var fs=require('fs');var Redis=require(_0xfc17('0x5'));var db=require(_0xfc17('0x6'))['db'];var utils=require(_0xfc17('0x7'));var logger=require(_0xfc17('0x8'))(_0xfc17('0x9'));var config=require(_0xfc17('0xa'));var jayson=require(_0xfc17('0xb'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xfc17('0xc')](config['redis'],{'host':_0xfc17('0xd'),'port':0x18eb});var socket=require(_0xfc17('0xe'))(new Redis(config['redis']));require(_0xfc17('0xf'))[_0xfc17('0x10')](socket);function respondWithRpcPromise(_0x562fca,_0x551dbd,_0x2bd017){return new BPromise(function(_0x47e7cc,_0x53928c){return client[_0xfc17('0x11')](_0x562fca,_0x2bd017)['then'](function(_0x1a34a9){logger[_0xfc17('0x12')]('MailInteraction,\x20%s,\x20%s',_0x551dbd,'request\x20sent');logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x551dbd,_0xfc17('0x13'),JSON['stringify'](_0x1a34a9));if(_0x1a34a9[_0xfc17('0x14')]){if(_0x1a34a9[_0xfc17('0x14')][_0xfc17('0x15')]===0x1f4){logger[_0xfc17('0x14')](_0xfc17('0x16'),_0x551dbd,_0x1a34a9[_0xfc17('0x14')][_0xfc17('0x17')]);return _0x53928c(_0x1a34a9[_0xfc17('0x14')][_0xfc17('0x17')]);}logger[_0xfc17('0x14')](_0xfc17('0x16'),_0x551dbd,_0x1a34a9[_0xfc17('0x14')][_0xfc17('0x17')]);return _0x47e7cc(_0x1a34a9[_0xfc17('0x14')][_0xfc17('0x17')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x551dbd,_0xfc17('0x13'));_0x47e7cc(_0x1a34a9[_0xfc17('0x18')][_0xfc17('0x17')]);}})['catch'](function(_0x4e8ff2){logger[_0xfc17('0x14')](_0xfc17('0x16'),_0x551dbd,_0x4e8ff2);_0x53928c(_0x4e8ff2);});});}exports['UpdateMailInteraction']=function(_0x1dea18){var _0xf899d5=this;return new Promise(function(_0x1f4441,_0x181346){return db['MailInteraction'][_0xfc17('0x19')](_0x1dea18['body'],{'raw':_0x1dea18[_0xfc17('0x1a')]?_0x1dea18[_0xfc17('0x1a')][_0xfc17('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1dea18[_0xfc17('0x1a')]?_0x1dea18['options'][_0xfc17('0x1c')]||null:null,'attributes':_0x1dea18[_0xfc17('0x1a')]?_0x1dea18[_0xfc17('0x1a')][_0xfc17('0x1d')]||null:null,'limit':_0x1dea18['options']?_0x1dea18[_0xfc17('0x1a')][_0xfc17('0x1e')]||null:null})[_0xfc17('0x1f')](function(_0x44f172){logger[_0xfc17('0x12')](_0xfc17('0x20'),_0x1dea18);logger[_0xfc17('0x21')](_0xfc17('0x20'),_0x1dea18,JSON['stringify'](_0x44f172));_0x1f4441(_0x44f172);})['catch'](function(_0x385f8d){logger[_0xfc17('0x14')](_0xfc17('0x20'),_0x385f8d[_0xfc17('0x17')],_0x1dea18);_0x181346(_0xf899d5['error'](0x1f4,_0x385f8d['message']));});});};exports['AddTagsToMailInteraction']=function(_0x347b12){return new Promise(function(_0x41187d,_0x562ed3){return db[_0xfc17('0x22')]['find']({'where':_0x347b12[_0xfc17('0x1a')]?_0x347b12[_0xfc17('0x1a')][_0xfc17('0x1c')]||null:null})['then'](function(_0x452fa4){if(_0x452fa4){return _0x452fa4['addTags'](_0x347b12['body']['ids'],_[_0xfc17('0x23')](_0x347b12[_0xfc17('0x24')],[_0xfc17('0x25'),'id'])||{});}})['spread'](function(_0x423d2f){logger['info']('AddTags',_0x347b12);logger[_0xfc17('0x21')](_0xfc17('0x26'),_0x347b12,JSON[_0xfc17('0x27')](_0x423d2f));_0x41187d(_0x423d2f);})[_0xfc17('0x28')](function(_0x41bb31){logger[_0xfc17('0x14')](_0xfc17('0x26'),_0x41bb31['message'],_0x347b12);_0x562ed3(_this[_0xfc17('0x14')](0x1f4,_0x41bb31[_0xfc17('0x17')]));});});}; \ No newline at end of file +var _0xcdd3=['redis','defaults','socket.io-emitter','register','request','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','attributes','then','AddTagsToMailInteraction','find','where','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcdd3,0x115));var _0x3cdd=function(_0x3cbe36,_0x188ba1){_0x3cbe36=_0x3cbe36-0x0;var _0x4a36f5=_0xcdd3[_0x3cbe36];return _0x4a36f5;};'use strict';var _=require(_0x3cdd('0x0'));var util=require('util');var moment=require(_0x3cdd('0x1'));var BPromise=require(_0x3cdd('0x2'));var rs=require(_0x3cdd('0x3'));var fs=require('fs');var Redis=require(_0x3cdd('0x4'));var db=require(_0x3cdd('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3cdd('0x6'));var config=require(_0x3cdd('0x7'));var jayson=require(_0x3cdd('0x8'));var client=jayson['client'][_0x3cdd('0x9')]({'port':0x232a});config[_0x3cdd('0xa')]=_[_0x3cdd('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3cdd('0xc'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0x3cdd('0xd')](socket);function respondWithRpcPromise(_0x34f8ed,_0xc500dd,_0x36d1d6){return new BPromise(function(_0x30347a,_0x4d968c){return client[_0x3cdd('0xe')](_0x34f8ed,_0x36d1d6)['then'](function(_0x3a8578){logger[_0x3cdd('0xf')]('MailInteraction,\x20%s,\x20%s',_0xc500dd,_0x3cdd('0x10'));logger[_0x3cdd('0x11')](_0x3cdd('0x12'),_0xc500dd,_0x3cdd('0x10'),JSON[_0x3cdd('0x13')](_0x3a8578));if(_0x3a8578[_0x3cdd('0x14')]){if(_0x3a8578['error'][_0x3cdd('0x15')]===0x1f4){logger['error'](_0x3cdd('0x16'),_0xc500dd,_0x3a8578['error'][_0x3cdd('0x17')]);return _0x4d968c(_0x3a8578[_0x3cdd('0x14')]['message']);}logger[_0x3cdd('0x14')]('MailInteraction,\x20%s,\x20%s',_0xc500dd,_0x3a8578[_0x3cdd('0x14')]['message']);return _0x30347a(_0x3a8578[_0x3cdd('0x14')][_0x3cdd('0x17')]);}else{logger[_0x3cdd('0xf')](_0x3cdd('0x16'),_0xc500dd,'request\x20sent');_0x30347a(_0x3a8578[_0x3cdd('0x18')][_0x3cdd('0x17')]);}})[_0x3cdd('0x19')](function(_0x13c015){logger[_0x3cdd('0x14')](_0x3cdd('0x16'),_0xc500dd,_0x13c015);_0x4d968c(_0x13c015);});});}exports[_0x3cdd('0x1a')]=function(_0x206aeb){var _0x3f4645=this;return new Promise(function(_0x5e1abe,_0x2c3244){return db[_0x3cdd('0x1b')][_0x3cdd('0x1c')](_0x206aeb[_0x3cdd('0x1d')],{'raw':_0x206aeb[_0x3cdd('0x1e')]?_0x206aeb['options'][_0x3cdd('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x206aeb[_0x3cdd('0x1e')]?_0x206aeb[_0x3cdd('0x1e')]['where']||null:null,'attributes':_0x206aeb[_0x3cdd('0x1e')]?_0x206aeb[_0x3cdd('0x1e')][_0x3cdd('0x20')]||null:null,'limit':_0x206aeb['options']?_0x206aeb[_0x3cdd('0x1e')]['limit']||null:null})[_0x3cdd('0x21')](function(_0x254a3b){logger[_0x3cdd('0xf')](_0x3cdd('0x1a'),_0x206aeb);logger[_0x3cdd('0x11')](_0x3cdd('0x1a'),_0x206aeb,JSON[_0x3cdd('0x13')](_0x254a3b));_0x5e1abe(_0x254a3b);})[_0x3cdd('0x19')](function(_0x57f0e2){logger['error']('UpdateMailInteraction',_0x57f0e2[_0x3cdd('0x17')],_0x206aeb);_0x2c3244(_0x3f4645[_0x3cdd('0x14')](0x1f4,_0x57f0e2[_0x3cdd('0x17')]));});});};exports[_0x3cdd('0x22')]=function(_0x32e66e){return new Promise(function(_0x8c52a2,_0x2e9daf){return db[_0x3cdd('0x1b')][_0x3cdd('0x23')]({'where':_0x32e66e[_0x3cdd('0x1e')]?_0x32e66e[_0x3cdd('0x1e')][_0x3cdd('0x24')]||null:null})['then'](function(_0xc09124){if(_0xc09124){return _0xc09124['addTags'](_0x32e66e['body'][_0x3cdd('0x25')],_[_0x3cdd('0x26')](_0x32e66e[_0x3cdd('0x1d')],[_0x3cdd('0x25'),'id'])||{});}})[_0x3cdd('0x27')](function(_0x422eff){logger[_0x3cdd('0xf')](_0x3cdd('0x28'),_0x32e66e);logger['debug']('AddTags',_0x32e66e,JSON[_0x3cdd('0x13')](_0x422eff));_0x8c52a2(_0x422eff);})[_0x3cdd('0x19')](function(_0x44c852){logger[_0x3cdd('0x14')]('AddTags',_0x44c852[_0x3cdd('0x17')],_0x32e66e);_0x2e9daf(_this[_0x3cdd('0x14')](0x1f4,_0x44c852[_0x3cdd('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 78e1e78..d05ff9e 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 _0x1ecc=['register','length','./mailInteraction.events','remove','update','emit','removeListener'];(function(_0x35f94f,_0x28c792){var _0x46fefb=function(_0x21e11f){while(--_0x21e11f){_0x35f94f['push'](_0x35f94f['shift']());}};_0x46fefb(++_0x28c792);}(_0x1ecc,0xf7));var _0xc1ec=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x1ecc[_0x1ebce2];return _0x4a330c;};'use strict';var MailInteractionEvents=require(_0xc1ec('0x0'));var events=['save',_0xc1ec('0x1'),_0xc1ec('0x2')];function createListener(_0x48eb12,_0x4fd47d){return function(_0x336434){_0x4fd47d[_0xc1ec('0x3')](_0x48eb12,_0x336434);};}function removeListener(_0xdad45c,_0x1c1af2){return function(){MailInteractionEvents[_0xc1ec('0x4')](_0xdad45c,_0x1c1af2);};}exports[_0xc1ec('0x5')]=function(_0x1d6986){for(var _0x148b36=0x0,_0x462955=events[_0xc1ec('0x6')];_0x148b36<_0x462955;_0x148b36++){var _0x153e90=events[_0x148b36];var _0x53cc8a=createListener('mailInteraction:'+_0x153e90,_0x1d6986);MailInteractionEvents['on'](_0x153e90,_0x53cc8a);}}; \ No newline at end of file +var _0x0dd7=['update','emit','removeListener','register','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0dd7,0xcd));var _0x70dd=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x0dd7[_0x409353];return _0x4f4b59;};'use strict';var MailInteractionEvents=require(_0x70dd('0x0'));var events=[_0x70dd('0x1'),_0x70dd('0x2'),_0x70dd('0x3')];function createListener(_0x518243,_0x2b8950){return function(_0x14f4fd){_0x2b8950[_0x70dd('0x4')](_0x518243,_0x14f4fd);};}function removeListener(_0x474045,_0x39004d){return function(){MailInteractionEvents[_0x70dd('0x5')](_0x474045,_0x39004d);};}exports[_0x70dd('0x6')]=function(_0x26daab){for(var _0x20d354=0x0,_0x31185f=events['length'];_0x20d354<_0x31185f;_0x20d354++){var _0x444c04=events[_0x20d354];var _0x3df014=createListener(_0x70dd('0x7')+_0x444c04,_0x26daab);MailInteractionEvents['on'](_0x444c04,_0x3df014);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 6989be1..c3d6a15 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 _0x8b30=['./mailMessage.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','mail','mailmessage:create','create','/:id','update','put','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x8b30,0x1c7));var _0x08b3=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x8b30[_0x36dfbd];return _0x4ecad9;};'use strict';var multer=require(_0x08b3('0x0'));var util=require(_0x08b3('0x1'));var path=require(_0x08b3('0x2'));var timeout=require(_0x08b3('0x3'));var express=require(_0x08b3('0x4'));var router=express[_0x08b3('0x5')]();var fs_extra=require(_0x08b3('0x6'));var auth=require(_0x08b3('0x7'));var interaction=require(_0x08b3('0x8'));var config=require(_0x08b3('0x9'));var controller=require(_0x08b3('0xa'));router[_0x08b3('0xb')]('/',auth[_0x08b3('0xc')](),controller[_0x08b3('0xd')]);router['get'](_0x08b3('0xe'),auth[_0x08b3('0xc')](),controller[_0x08b3('0xf')]);router[_0x08b3('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x08b3('0x10')]);router[_0x08b3('0xb')](_0x08b3('0x11'),auth[_0x08b3('0xc')](),controller[_0x08b3('0x12')]);router[_0x08b3('0x13')]('/',auth[_0x08b3('0xc')](),interaction['tracked'](_0x08b3('0x14'),_0x08b3('0x15')),controller[_0x08b3('0x16')]);router['put'](_0x08b3('0x17'),auth[_0x08b3('0xc')](),controller[_0x08b3('0x18')]);router[_0x08b3('0x19')](_0x08b3('0x1a'),auth[_0x08b3('0xc')](),controller['accept']);router[_0x08b3('0x19')](_0x08b3('0x1b'),auth[_0x08b3('0xc')](),controller[_0x08b3('0x1c')]);router['delete']('/:id',auth[_0x08b3('0xc')](),controller[_0x08b3('0x1d')]);module[_0x08b3('0x1e')]=router; \ No newline at end of file +var _0x057f=['get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','tracked','mailmessage:create','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller'];(function(_0x38e207,_0x4ed30c){var _0x21c980=function(_0x4e0c93){while(--_0x4e0c93){_0x38e207['push'](_0x38e207['shift']());}};_0x21c980(++_0x4ed30c);}(_0x057f,0x1d7));var _0xf057=function(_0x3720cc,_0xfe78ec){_0x3720cc=_0x3720cc-0x0;var _0x362291=_0x057f[_0x3720cc];return _0x362291;};'use strict';var multer=require(_0xf057('0x0'));var util=require('util');var path=require(_0xf057('0x1'));var timeout=require(_0xf057('0x2'));var express=require(_0xf057('0x3'));var router=express['Router']();var fs_extra=require(_0xf057('0x4'));var auth=require(_0xf057('0x5'));var interaction=require(_0xf057('0x6'));var config=require(_0xf057('0x7'));var controller=require(_0xf057('0x8'));router[_0xf057('0x9')]('/',auth[_0xf057('0xa')](),controller[_0xf057('0xb')]);router[_0xf057('0x9')](_0xf057('0xc'),auth[_0xf057('0xa')](),controller[_0xf057('0xd')]);router['get']('/:id',auth[_0xf057('0xa')](),controller[_0xf057('0xe')]);router['get'](_0xf057('0xf'),auth['isAuthenticated'](),controller[_0xf057('0x10')]);router[_0xf057('0x11')]('/',auth[_0xf057('0xa')](),interaction[_0xf057('0x12')]('mail',_0xf057('0x13')),controller[_0xf057('0x14')]);router[_0xf057('0x15')](_0xf057('0x16'),auth['isAuthenticated'](),controller[_0xf057('0x17')]);router['put'](_0xf057('0x18'),auth['isAuthenticated'](),controller[_0xf057('0x19')]);router[_0xf057('0x15')](_0xf057('0x1a'),auth[_0xf057('0xa')](),controller[_0xf057('0x1b')]);router[_0xf057('0x1c')](_0xf057('0x16'),auth[_0xf057('0xa')](),controller['destroy']);module[_0xf057('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 4dd24c7..b2af892 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 _0xb45d=['ENUM','out','long','DATE','Email','Chat','sequelize','lodash','TEXT','medium','BOOLEAN'];(function(_0x1eaeac,_0x53e7d9){var _0x5b8999=function(_0x435306){while(--_0x435306){_0x1eaeac['push'](_0x1eaeac['shift']());}};_0x5b8999(++_0x53e7d9);}(_0xb45d,0x13a));var _0xdb45=function(_0x539533,_0x59b89b){_0x539533=_0x539533-0x0;var _0x3942f3=_0xb45d[_0x539533];return _0x3942f3;};'use strict';var Sequelize=require(_0xdb45('0x0'));var _=require(_0xdb45('0x1'));module['exports']={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xdb45('0x2')](_0xdb45('0x3'))},'read':{'type':Sequelize[_0xdb45('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdb45('0x5')]('in','out'),'defaultValue':_0xdb45('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0xdb45('0x7'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0xdb45('0x2')](_0xdb45('0x7'))},'subject':{'type':Sequelize[_0xdb45('0x2')]},'sentAt':{'type':Sequelize[_0xdb45('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xdb45('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xdb45('0x8')]},'originTo':{'type':Sequelize[_0xdb45('0x2')](_0xdb45('0x7'))},'originCc':{'type':Sequelize[_0xdb45('0x2')](_0xdb45('0x7'))},'originChannel':{'type':Sequelize[_0xdb45('0x5')](_0xdb45('0x9'),_0xdb45('0xa')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0xdafc=['TEXT','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Chat','Email','sequelize','exports','long'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0xdafc,0x129));var _0xcdaf=function(_0x1a0d1d,_0x1fcd66){_0x1a0d1d=_0x1a0d1d-0x0;var _0x52fd8a=_0xdafc[_0x1a0d1d];return _0x52fd8a;};'use strict';var Sequelize=require(_0xcdaf('0x0'));var _=require('lodash');module[_0xcdaf('0x1')]={'body':{'type':Sequelize['TEXT'](_0xcdaf('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xcdaf('0x3')]('medium')},'read':{'type':Sequelize[_0xcdaf('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcdaf('0x5')]('in',_0xcdaf('0x6')),'defaultValue':_0xcdaf('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xcdaf('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xcdaf('0x3')](_0xcdaf('0x2'))},'cc':{'type':Sequelize['TEXT'](_0xcdaf('0x2'))},'bcc':{'type':Sequelize['TEXT'](_0xcdaf('0x2'))},'subject':{'type':Sequelize[_0xcdaf('0x3')]},'sentAt':{'type':Sequelize[_0xcdaf('0x8')]},'attach':{'type':Sequelize[_0xcdaf('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xcdaf('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xcdaf('0x3')](_0xcdaf('0x2'))},'originCc':{'type':Sequelize[_0xcdaf('0x3')]('long')},'originChannel':{'type':Sequelize[_0xcdaf('0x5')]('Email',_0xcdaf('0xa')),'defaultValue':_0xcdaf('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 751805a..9fa2439 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 _0x34e8=['message','info','catch','status','json','offset','undefined','limit','count','set','Content-Range','destroy','end','sendStatus','name','send','index','map','MailMessage','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','length','include','find','body','create','direction','out','secret','MailAccount','findOne','CmList','List','CmContact','Contacts','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','ListId','sendMail','update','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','readAt','UserId','agent','get','MailInteraction','MailInteractionId','format','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','SIP/%s','channel','fromString','EventManager','acceptmessage','reject','mail','RejectMessage','rejectMessage','email','interface','event','rejectmessage','download','unix','toString','files','tmp','server','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x687ddc,_0x2092fa){var _0x441991=function(_0x49c6a6){while(--_0x49c6a6){_0x687ddc['push'](_0x687ddc['shift']());}};_0x441991(++_0x2092fa);}(_0x34e8,0x12c));var _0x834e=function(_0x4c579a,_0xca4c7b){_0x4c579a=_0x4c579a-0x0;var _0x175b13=_0x34e8[_0x4c579a];return _0x175b13;};'use strict';var emlformat=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var util=require(_0x834e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x834e('0x4'));var Redis=require(_0x834e('0x5'));var htmlToText=require(_0x834e('0x6'));var qs=require(_0x834e('0x7'));var logger=require(_0x834e('0x8'))(_0x834e('0x9'));var interaction_log=require(_0x834e('0x8'))('mail-interactions');var config=require(_0x834e('0xa'));var db=require('../../mysqldb')['db'];config[_0x834e('0xb')]=_[_0x834e('0xc')](config[_0x834e('0xb')],{'host':_0x834e('0xd'),'port':0x18eb});var socket=require(_0x834e('0xe'))(new Redis(config[_0x834e('0xb')]));require(_0x834e('0xf'))[_0x834e('0x10')](socket);var jayson=require(_0x834e('0x11'));var client=jayson[_0x834e('0x12')][_0x834e('0x13')]({'port':0x232c});var client9003=jayson[_0x834e('0x12')][_0x834e('0x13')]({'port':0x232b});var client9002=jayson[_0x834e('0x12')][_0x834e('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x1e00de,_0x2fd95c,_0x538bb3,_0x5e5b6d){return new BPromise(function(_0x6cd9b9,_0x58a27e){var _0x23848e=_0x5e5b6d||client;return _0x23848e[_0x834e('0x14')](_0x1e00de,_0x538bb3)[_0x834e('0x15')](function(_0x21cc0a){logger['info'](_0x834e('0x16'),_0x2fd95c,_0x834e('0x17'));logger['debug'](_0x834e('0x18'),_0x2fd95c,'request\x20sent',JSON[_0x834e('0x19')](_0x21cc0a));if(_0x21cc0a[_0x834e('0x1a')]){if(_0x21cc0a['error'][_0x834e('0x1b')]===0x1f4){logger[_0x834e('0x1a')](_0x834e('0x16'),_0x2fd95c,_0x21cc0a['error'][_0x834e('0x1c')]);return _0x58a27e(_0x21cc0a[_0x834e('0x1a')][_0x834e('0x1c')]);}logger[_0x834e('0x1a')](_0x834e('0x16'),_0x2fd95c,_0x21cc0a[_0x834e('0x1a')][_0x834e('0x1c')]);return _0x6cd9b9(_0x21cc0a['error'][_0x834e('0x1c')]);}else{logger[_0x834e('0x1d')](_0x834e('0x16'),_0x2fd95c,_0x834e('0x17'));_0x6cd9b9(_0x21cc0a['result'][_0x834e('0x1c')]);}})[_0x834e('0x1e')](function(_0x5a05c0){logger[_0x834e('0x1a')](_0x834e('0x16'),_0x2fd95c,_0x5a05c0);_0x58a27e(_0x5a05c0);});});}function respondWithResult(_0x8d406e,_0x5c55ca){_0x5c55ca=_0x5c55ca||0xc8;return function(_0x4e3f48){if(_0x4e3f48){return _0x8d406e[_0x834e('0x1f')](_0x5c55ca)[_0x834e('0x20')](_0x4e3f48);}};}function respondWithFilteredResult(_0x589dde,_0x25ee1d){return function(_0x1dc1e0){if(_0x1dc1e0){var _0x58f4fd=typeof _0x25ee1d[_0x834e('0x21')]===_0x834e('0x22')&&typeof _0x25ee1d[_0x834e('0x23')]==='undefined';var _0x24fcf7=_0x1dc1e0[_0x834e('0x24')];var _0x5e1cc5=_0x58f4fd?0x0:_0x25ee1d['offset'];var _0x1e713a=_0x58f4fd?_0x1dc1e0['count']:_0x25ee1d[_0x834e('0x21')]+_0x25ee1d[_0x834e('0x23')];var _0x3db026;if(_0x1e713a>=_0x24fcf7){_0x1e713a=_0x24fcf7;_0x3db026=0xc8;}else{_0x3db026=0xce;}_0x589dde[_0x834e('0x1f')](_0x3db026);return _0x589dde[_0x834e('0x25')](_0x834e('0x26'),_0x5e1cc5+'-'+_0x1e713a+'/'+_0x24fcf7)['json'](_0x1dc1e0);}return null;};}function saveUpdates(_0x510780){return function(_0x4dc64a){if(_0x4dc64a){return _0x4dc64a['update'](_0x510780)[_0x834e('0x15')](function(_0x567cea){return _0x567cea;});}return null;};}function removeEntity(_0x106d6a){return function(_0x5dacc1){if(_0x5dacc1){return _0x5dacc1[_0x834e('0x27')]()[_0x834e('0x15')](function(){_0x106d6a[_0x834e('0x1f')](0xcc)[_0x834e('0x28')]();});}};}function handleEntityNotFound(_0x4551f5){return function(_0x390119){if(!_0x390119){_0x4551f5[_0x834e('0x29')](0x194);}return _0x390119;};}function handleError(_0xfaf716,_0x278db3){_0x278db3=_0x278db3||0x1f4;return function(_0x493289){logger[_0x834e('0x1a')](_0x493289['stack']);if(_0x493289[_0x834e('0x2a')]){delete _0x493289[_0x834e('0x2a')];}_0xfaf716[_0x834e('0x1f')](_0x278db3)[_0x834e('0x2b')](_0x493289);};}exports[_0x834e('0x2c')]=function(_0x4689c2,_0x4696a1){var _0x38cd29={},_0x358c31={},_0x12b2bc={'count':0x0,'rows':[]};var _0x5bd232=_[_0x834e('0x2d')](db[_0x834e('0x2e')][_0x834e('0x2f')],function(_0xaf01f4){return{'name':_0xaf01f4['fieldName'],'type':_0xaf01f4[_0x834e('0x30')][_0x834e('0x31')]};});_0x358c31['model']=_['map'](_0x5bd232,'name');_0x358c31[_0x834e('0x32')]=_[_0x834e('0x33')](_0x4689c2[_0x834e('0x32')]);_0x358c31[_0x834e('0x34')]=_[_0x834e('0x35')](_0x358c31[_0x834e('0x36')],_0x358c31['query']);_0x38cd29[_0x834e('0x37')]=_['intersection'](_0x358c31[_0x834e('0x36')],qs[_0x834e('0x38')](_0x4689c2['query'][_0x834e('0x38')]));_0x38cd29[_0x834e('0x37')]=_0x38cd29['attributes']['length']?_0x38cd29[_0x834e('0x37')]:_0x358c31[_0x834e('0x36')];if(!_0x4689c2[_0x834e('0x32')][_0x834e('0x39')](_0x834e('0x3a'))){_0x38cd29['limit']=qs[_0x834e('0x23')](_0x4689c2['query']['limit']);_0x38cd29[_0x834e('0x21')]=qs['offset'](_0x4689c2[_0x834e('0x32')][_0x834e('0x21')]);}_0x38cd29[_0x834e('0x3b')]=qs[_0x834e('0x3c')](_0x4689c2[_0x834e('0x32')]['sort']);_0x38cd29[_0x834e('0x3d')]=qs[_0x834e('0x34')](_[_0x834e('0x3e')](_0x4689c2['query'],_0x358c31[_0x834e('0x34')]),_0x5bd232);if(_0x4689c2[_0x834e('0x32')]['filter']){_0x38cd29[_0x834e('0x3d')]=_['merge'](_0x38cd29[_0x834e('0x3d')],{'$or':_[_0x834e('0x2d')](_0x5bd232,function(_0x4a18bb){if(_0x4a18bb['type']!==_0x834e('0x3f')){var _0x16969b={};_0x16969b[_0x4a18bb[_0x834e('0x2a')]]={'$like':'%'+_0x4689c2[_0x834e('0x32')][_0x834e('0x40')]+'%'};return _0x16969b;}})});}_0x38cd29=_[_0x834e('0x41')]({},_0x38cd29,_0x4689c2[_0x834e('0x42')]);var _0x4a3381={'where':_0x38cd29[_0x834e('0x3d')]};return db['MailMessage'][_0x834e('0x24')](_0x4a3381)['then'](function(_0x1df5b0){_0x12b2bc['count']=_0x1df5b0;if(_0x4689c2[_0x834e('0x32')][_0x834e('0x43')]){_0x38cd29['include']=[{'all':!![]}];}return db[_0x834e('0x2e')][_0x834e('0x44')](_0x38cd29);})[_0x834e('0x15')](function(_0xd55cc3){_0x12b2bc[_0x834e('0x45')]=_0xd55cc3;return _0x12b2bc;})[_0x834e('0x15')](respondWithFilteredResult(_0x4696a1,_0x38cd29))[_0x834e('0x1e')](handleError(_0x4696a1,null));};exports[_0x834e('0x46')]=function(_0x5dc63b,_0x279ea1){var _0x5f3943={'raw':!![],'where':{'id':_0x5dc63b[_0x834e('0x47')]['id']}},_0x3124be={};_0x3124be['model']=_[_0x834e('0x33')](db[_0x834e('0x2e')][_0x834e('0x2f')]);_0x3124be[_0x834e('0x32')]=_[_0x834e('0x33')](_0x5dc63b[_0x834e('0x32')]);_0x3124be['filters']=_['intersection'](_0x3124be[_0x834e('0x36')],_0x3124be[_0x834e('0x32')]);_0x5f3943[_0x834e('0x37')]=_[_0x834e('0x35')](_0x3124be[_0x834e('0x36')],qs[_0x834e('0x38')](_0x5dc63b[_0x834e('0x32')][_0x834e('0x38')]));_0x5f3943[_0x834e('0x37')]=_0x5f3943[_0x834e('0x37')][_0x834e('0x48')]?_0x5f3943[_0x834e('0x37')]:_0x3124be[_0x834e('0x36')];if(_0x5dc63b[_0x834e('0x32')][_0x834e('0x43')]){_0x5f3943[_0x834e('0x49')]=[{'all':!![]}];}_0x5f3943=_[_0x834e('0x41')]({},_0x5f3943,_0x5dc63b[_0x834e('0x42')]);return db[_0x834e('0x2e')][_0x834e('0x4a')](_0x5f3943)['then'](handleEntityNotFound(_0x279ea1,null))[_0x834e('0x15')](respondWithResult(_0x279ea1,null))[_0x834e('0x1e')](handleError(_0x279ea1,null));};exports['update']=function(_0x3c00a3,_0x3b0988){if(_0x3c00a3['body']['id']){delete _0x3c00a3[_0x834e('0x4b')]['id'];}return db[_0x834e('0x2e')][_0x834e('0x4a')]({'where':{'id':_0x3c00a3[_0x834e('0x47')]['id']}})[_0x834e('0x15')](handleEntityNotFound(_0x3b0988,null))[_0x834e('0x15')](saveUpdates(_0x3c00a3[_0x834e('0x4b')],null))['then'](respondWithResult(_0x3b0988,null))[_0x834e('0x1e')](handleError(_0x3b0988,null));};exports[_0x834e('0x27')]=function(_0x3e0550,_0x363675){return db[_0x834e('0x2e')][_0x834e('0x4a')]({'where':{'id':_0x3e0550[_0x834e('0x47')]['id']}})[_0x834e('0x15')](handleEntityNotFound(_0x363675,null))['then'](removeEntity(_0x363675,null))[_0x834e('0x1e')](handleError(_0x363675,null));};exports['describe']=function(_0x2f4bde,_0x53a9ee){return db[_0x834e('0x2e')]['describe']()['then'](respondWithResult(_0x53a9ee,null))[_0x834e('0x1e')](handleError(_0x53a9ee,null));};exports[_0x834e('0x4c')]=function(_0x5291ae,_0x5be43d){return db[_0x834e('0x2e')][_0x834e('0x4c')](_0x5291ae[_0x834e('0x4b')])[_0x834e('0x15')](function(_0x21c417){if(_0x21c417){if(_0x21c417[_0x834e('0x4d')]===_0x834e('0x4e')&&!_0x21c417[_0x834e('0x4f')]){var _0x528e66,_0x142334,_0x3c70bf;if(_0x5291ae['body']['to']){_0x142334=_0x5291ae[_0x834e('0x4b')]['to']['split'](',')[0x0];}return db[_0x834e('0x50')][_0x834e('0x51')]({'where':{'id':_0x21c417['MailAccountId']},'include':[{'model':db[_0x834e('0x52')],'as':_0x834e('0x53'),'include':[{'model':db[_0x834e('0x54')],'as':_0x834e('0x55'),'where':{'email':_0x142334},'limit':0x1,'order':[['updatedAt',_0x834e('0x56')]]}]},{'model':db[_0x834e('0x57')],'as':_0x834e('0x58'),'raw':!![]}]})['then'](function(_0x246b8e){_0x528e66=_0x246b8e;if(_0x528e66&&_0x528e66[_0x834e('0x58')]){var _0x3a7683={'tls':{'rejectUnauthorized':![]}};if(_[_0x834e('0x59')](_0x528e66[_0x834e('0x58')][_0x834e('0x5a')])){_0x3a7683[_0x834e('0x5b')]=_0x528e66[_0x834e('0x58')][_0x834e('0x5b')];_0x3a7683[_0x834e('0x5c')]=_0x528e66[_0x834e('0x58')][_0x834e('0x5c')];_0x3a7683[_0x834e('0x5d')]=_0x528e66[_0x834e('0x58')][_0x834e('0x5d')];if(_0x528e66[_0x834e('0x58')][_0x834e('0x5e')]){_0x3a7683[_0x834e('0x5f')]={'user':_0x528e66[_0x834e('0x58')][_0x834e('0x60')],'pass':_0x528e66[_0x834e('0x58')][_0x834e('0x61')]};}}else{_0x3a7683['service']=_0x528e66[_0x834e('0x58')][_0x834e('0x5a')];_0x3a7683[_0x834e('0x5f')]={'user':_0x528e66[_0x834e('0x58')]['user'],'pass':_0x528e66[_0x834e('0x58')]['pass']};_0x3a7683['secure']=_0x528e66[_0x834e('0x58')][_0x834e('0x5d')];}if(_0x5291ae[_0x834e('0x4b')][_0x834e('0x62')]&&_0x5291ae[_0x834e('0x4b')][_0x834e('0x62')][_0x834e('0x48')]){for(var _0xe5c8f6=0x0;_0xe5c8f6<_0x5291ae['body'][_0x834e('0x62')]['length'];_0xe5c8f6+=0x1){_0x5291ae[_0x834e('0x4b')][_0x834e('0x62')][_0xe5c8f6]={'filename':_0x5291ae['body']['attachments'][_0xe5c8f6][_0x834e('0x2a')],'path':path[_0x834e('0x63')](config[_0x834e('0x64')],_0x834e('0x65'),_0x5291ae[_0x834e('0x4b')]['attachments'][_0xe5c8f6][_0x834e('0x66')])};}}_0x3c70bf={'account':_0x3a7683,'message':_0x5291ae[_0x834e('0x4b')]};return;}})[_0x834e('0x15')](function(){if(_0x528e66[_0x834e('0x53')]){if(_0x528e66[_0x834e('0x53')][_0x834e('0x55')][_0x834e('0x48')]){return _0x528e66[_0x834e('0x53')][_0x834e('0x55')][0x0];}else{return db[_0x834e('0x54')]['create'](_[_0x834e('0xc')](_0x5291ae[_0x834e('0x4b')],{'firstName':_0x5291ae[_0x834e('0x4b')]['to'],'email':_0x5291ae[_0x834e('0x4b')]['to'],'phone':_0x5291ae['body']['to'],'ListId':_0x528e66[_0x834e('0x67')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x3c70bf){return respondWithRpcPromise('SendMail',_0x834e('0x68'),_0x3c70bf,client9003)[_0x834e('0x15')](function(_0x514aac){return _0x21c417[_0x834e('0x69')]({'read':!![],'messageId':_0x514aac[_0x834e('0x6a')],'sentAt':moment()['format'](_0x834e('0x6b'))});})[_0x834e('0x1e')](function(_0x4b88e7){logger['error']('%s',JSON[_0x834e('0x19')](_0x4b88e7));return _0x21c417;});}return _0x21c417;});}return _0x21c417;}})[_0x834e('0x15')](respondWithResult(_0x5be43d,0xc9))[_0x834e('0x1e')](handleError(_0x5be43d,null));};exports[_0x834e('0x6c')]=function(_0x1d8e7,_0x493239){var _0x264a6f={'agent':{},'channel':'mail'};if(_0x1d8e7[_0x834e('0x4b')]['id']){delete _0x1d8e7[_0x834e('0x4b')]['id'];}_0x1d8e7[_0x834e('0x4b')]['read']=!![];_0x1d8e7[_0x834e('0x4b')][_0x834e('0x6d')]=moment()['format'](_0x834e('0x6b'));_0x1d8e7[_0x834e('0x4b')][_0x834e('0x6e')]=_0x1d8e7['body'][_0x834e('0x6e')]||_0x1d8e7[_0x834e('0x60')]['id'];_0x264a6f[_0x834e('0x6f')]['id']=_0x1d8e7[_0x834e('0x4b')][_0x834e('0x6e')];return db[_0x834e('0x2e')][_0x834e('0x4a')]({'where':{'id':_0x1d8e7[_0x834e('0x47')]['id'],'UserId':null}})[_0x834e('0x15')](handleEntityNotFound(_0x493239,null))[_0x834e('0x15')](saveUpdates(_0x1d8e7['body'],null))['then'](function(_0x4e466e){if(_0x4e466e){_0x264a6f[_0x834e('0x1c')]=_0x4e466e[_0x834e('0x70')]({'plain':!![]});return db[_0x834e('0x71')][_0x834e('0x4a')]({'where':{'id':_0x4e466e[_0x834e('0x72')]}});}return null;})['then'](handleEntityNotFound(_0x493239,null))['then'](function(_0x4520fc){if(_0x4520fc){return _0x4520fc[_0x834e('0x69')]({'UserId':_0x1d8e7[_0x834e('0x4b')][_0x834e('0x6e')],'read1stAt':_[_0x834e('0x59')](_0x4520fc['read1stAt'])?moment()[_0x834e('0x73')](_0x834e('0x6b')):undefined});}return null;})[_0x834e('0x15')](function(_0x4e1735){if(_0x4e1735){_0x264a6f[_0x834e('0x74')]=_0x4e1735[_0x834e('0x70')]({'plain':!![]});interaction_log[_0x834e('0x1d')](_0x834e('0x75'),_0x1d8e7[_0x834e('0x60')]['id'],_0x1d8e7['user']['name'],_0x1d8e7[_0x834e('0x60')][_0x834e('0x76')],_0x264a6f['interaction']['id'],_0x1d8e7[_0x834e('0x4b')]?JSON['stringify'](_0x1d8e7[_0x834e('0x4b')]):_0x834e('0x77'));return respondWithRpcPromise(_0x834e('0x78'),'acceptMessage',_0x264a6f);}return null;})[_0x834e('0x15')](function(_0x49e721){var _0x5b2621='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x49e721[_0x834e('0x1c')][_0x834e('0x79')];return db[_0x834e('0x7a')][_0x834e('0x32')](_0x5b2621,{'type':db[_0x834e('0x7b')][_0x834e('0x7c')][_0x834e('0x7d')],'raw':!![]})[_0x834e('0x15')](function(_0x17e61a){return _0x17e61a;});})['then'](function(_0x2f775a){if(_0x2f775a){_0x264a6f['message'][_0x834e('0x7e')]=_0x2f775a[0x0];if(!_0x1d8e7[_0x834e('0x4b')][_0x834e('0x6e')])return;return db[_0x834e('0x7f')][_0x834e('0x4a')]({'where':{'id':_0x1d8e7[_0x834e('0x4b')]['UserId'],'role':'agent'},'attributes':['id',_0x834e('0x2a'),_0x834e('0x80'),'email',_0x834e('0x81')],'raw':!![]});}return null;})[_0x834e('0x15')](function(_0x1bc5d1){if(!_0x1bc5d1)return null;_0x264a6f[_0x834e('0x1c')][_0x834e('0x6f')]=_0x1bc5d1;return _0x264a6f;})['then'](function(_0x29839d){if(_0x29839d){if(_0x1d8e7[_0x834e('0x4b')]['manual']){_0x264a6f['message']['interface']=util[_0x834e('0x73')](_0x834e('0x82'),_0x1d8e7['user'][_0x834e('0x2a')]);_0x264a6f[_0x834e('0x1c')]['channel']=_0x264a6f[_0x834e('0x83')];_0x264a6f['message']['event']=_0x834e('0x6c');_0x264a6f[_0x834e('0x1c')][_0x834e('0x4b')]=htmlToText[_0x834e('0x84')](_0x264a6f['message'][_0x834e('0x4b')]);return respondWithRpcPromise(_0x834e('0x85'),_0x834e('0x85'),{'event':_0x834e('0x86'),'message':_0x264a6f[_0x834e('0x1c')]},client9002)[_0x834e('0x15')](function(){return _0x264a6f;});}return _0x264a6f;}return null;})[_0x834e('0x15')](respondWithResult(_0x493239,null))[_0x834e('0x1e')](handleError(_0x493239,null));};exports[_0x834e('0x87')]=function(_0x2821fe,_0x2fa64c){var _0x261e3d={'agent':{},'channel':_0x834e('0x88')};if(_0x2821fe[_0x834e('0x4b')]['id']){delete _0x2821fe[_0x834e('0x4b')]['id'];}_0x2821fe[_0x834e('0x4b')][_0x834e('0x6e')]=_0x2821fe[_0x834e('0x4b')][_0x834e('0x6e')]||_0x2821fe[_0x834e('0x60')]['id'];_0x261e3d[_0x834e('0x6f')]['id']=_0x2821fe[_0x834e('0x4b')]['UserId'];return db[_0x834e('0x2e')][_0x834e('0x4a')]({'where':{'id':_0x2821fe[_0x834e('0x47')]['id'],'UserId':null}})[_0x834e('0x15')](handleEntityNotFound(_0x2fa64c,null))[_0x834e('0x15')](function(_0x3bcdcd){if(_0x3bcdcd){_0x261e3d[_0x834e('0x1c')]=_0x3bcdcd[_0x834e('0x70')]({'plain':!![]});return db[_0x834e('0x71')]['find']({'where':{'id':_0x3bcdcd['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2fa64c,null))[_0x834e('0x15')](function(_0x493e1f){if(_0x493e1f){_0x261e3d[_0x834e('0x74')]=_0x493e1f[_0x834e('0x70')]({'plain':!![]});interaction_log[_0x834e('0x1d')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2821fe[_0x834e('0x60')]['id'],_0x2821fe[_0x834e('0x60')][_0x834e('0x2a')],_0x2821fe[_0x834e('0x60')][_0x834e('0x76')],_0x261e3d[_0x834e('0x74')]['id'],_0x2821fe['body']?JSON[_0x834e('0x19')](_0x2821fe[_0x834e('0x4b')]):_0x834e('0x77'));return respondWithRpcPromise(_0x834e('0x89'),_0x834e('0x8a'),_0x261e3d);}return null;})['then'](function(_0x4ebeba){var _0x508b3e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4ebeba[_0x834e('0x1c')][_0x834e('0x79')];return db['sequelize'][_0x834e('0x32')](_0x508b3e,{'type':db[_0x834e('0x7b')]['QueryTypes'][_0x834e('0x7d')],'raw':!![]})[_0x834e('0x15')](function(_0xbf7693){return _0xbf7693;});})[_0x834e('0x15')](function(_0x1d1075){if(_0x1d1075){_0x261e3d[_0x834e('0x1c')]['contact']=_0x1d1075[0x0];if(!_0x2821fe['body'][_0x834e('0x6e')])return;return db[_0x834e('0x7f')][_0x834e('0x4a')]({'where':{'id':_0x2821fe['body'][_0x834e('0x6e')],'role':_0x834e('0x6f')},'attributes':['id','name',_0x834e('0x80'),_0x834e('0x8b'),_0x834e('0x81')],'raw':!![]});}return null;})[_0x834e('0x15')](function(_0x4cb802){if(!_0x4cb802)return null;_0x261e3d[_0x834e('0x1c')]['agent']=_0x4cb802;return _0x261e3d;})['then'](function(_0xc64958){if(_0xc64958){_0xc64958[_0x834e('0x1c')][_0x834e('0x8c')]=util[_0x834e('0x73')](_0x834e('0x82'),_0x2821fe[_0x834e('0x60')]['name']);_0xc64958['message'][_0x834e('0x83')]=_0x261e3d[_0x834e('0x83')];_0xc64958[_0x834e('0x1c')][_0x834e('0x8d')]=_0x834e('0x87');_0xc64958[_0x834e('0x1c')][_0x834e('0x4b')]=htmlToText['fromString'](_0x261e3d[_0x834e('0x1c')][_0x834e('0x4b')]);respondWithRpcPromise('EventManager',_0x834e('0x85'),{'event':_0x834e('0x8e'),'message':_0xc64958[_0x834e('0x1c')]},client9002);return _0x261e3d;}return null;})[_0x834e('0x15')](respondWithResult(_0x2fa64c,null))[_0x834e('0x1e')](handleError(_0x2fa64c,null));};exports[_0x834e('0x8f')]=function(_0x231f0b,_0x3b44f3){var _0x14e794=moment()[_0x834e('0x90')]()[_0x834e('0x91')]();var _0x152372=path[_0x834e('0x63')](config[_0x834e('0x64')],'server',_0x834e('0x92'),_0x834e('0x93'));var _0x522eab=path[_0x834e('0x63')](config['root'],_0x834e('0x94'),'files',_0x834e('0x62'));var _0x560d10=util[_0x834e('0x73')](_0x834e('0x95'),_0x14e794);return db[_0x834e('0x2e')][_0x834e('0x4a')]({'where':{'id':_0x231f0b['params']['id']},'attributes':['id',_0x834e('0x4b'),_0x834e('0x96'),'to','cc',_0x834e('0x97'),_0x834e('0x98'),_0x834e('0x99')],'include':_0x231f0b[_0x834e('0x32')][_0x834e('0x62')]?[{'model':db[_0x834e('0x9a')],'as':_0x834e('0x9b')}]:undefined})[_0x834e('0x15')](handleEntityNotFound(_0x3b44f3,null))[_0x834e('0x15')](function(_0x1cb4d0){if(_0x1cb4d0){var _0x3a6546=_0x1cb4d0;var _0x246f01={'from':_0x3a6546[_0x834e('0x96')],'to':_0x3a6546['to'],'subject':_0x3a6546[_0x834e('0x98')],'html':_0x3a6546[_0x834e('0x4b')],'headers':{'Date':moment(_0x3a6546['createdAt'])['format'](_0x834e('0x9c'))},'attachments':[]};if(_0x1cb4d0['cc']){_0x246f01[_0x834e('0x9d')]['Cc']=_0x1cb4d0['cc'];}if(_0x1cb4d0[_0x834e('0x97')]){_0x246f01[_0x834e('0x9d')][_0x834e('0x9e')]=_0x1cb4d0[_0x834e('0x97')];}return new BPromise(function(_0x22f90d,_0x40fd40){if(_0x1cb4d0[_0x834e('0x9b')]){for(var _0x58cd3b=0x0;_0x58cd3b<_0x1cb4d0[_0x834e('0x9b')][_0x834e('0x48')];_0x58cd3b++){var _0x513d9e=_0x1cb4d0[_0x834e('0x9b')][_0x58cd3b];var _0x54c129=path[_0x834e('0x63')](_0x522eab,_0x513d9e[_0x834e('0x66')]);if(fs[_0x834e('0x9f')](_0x54c129)){_0x246f01['attachments'][_0x834e('0xa0')]({'name':_0x513d9e[_0x834e('0x2a')],'contentType':_0x513d9e['type'],'data':fs['readFileSync'](_0x54c129)});}}}emlformat[_0x834e('0xa1')](_0x246f01,function(_0x3b7b1a,_0x4e0f4d){if(_0x3b7b1a)return _0x40fd40(_0x3b7b1a);fs[_0x834e('0xa2')](path[_0x834e('0x63')](_0x152372,_0x560d10),_0x4e0f4d);return _0x22f90d(_0x4e0f4d);});});}})[_0x834e('0x15')](function(_0x135219){if(_0x135219){return _0x3b44f3[_0x834e('0x8f')](path['join'](_0x152372,_0x560d10),_0x560d10,function(_0x4e7545){if(!_0x4e7545)fs[_0x834e('0xa3')](path['join'](_0x152372,_0x560d10));});}})['catch'](handleError(_0x3b44f3,null));}; \ No newline at end of file +var _0x7217=['filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','findAll','rows','show','params','length','include','find','body','describe','create','direction','out','secret','MailAccount','CmContact','Contacts','updatedAt','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','List','ListId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','readAt','UserId','agent','get','MailInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','email','reject','rejectmessage','download','toString','server','tmp','files','message-%s.eml','from','bcc','subject','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','readFileSync','build','writeFileSync','eml-format','bluebird','util','path','lodash','ioredis','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','status','json','offset','limit','undefined','count','Content-Range','update','destroy','stack','name','send','MailMessage','fieldName','type','key','model','map','query','keys'];(function(_0x3ef41d,_0x40fec4){var _0x5a84db=function(_0x5e1cb8){while(--_0x5e1cb8){_0x3ef41d['push'](_0x3ef41d['shift']());}};_0x5a84db(++_0x40fec4);}(_0x7217,0x19e));var _0x7721=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x7217[_0xf0bcac];return _0x4e4c65;};'use strict';var emlformat=require(_0x7721('0x0'));var moment=require('moment');var BPromise=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var path=require(_0x7721('0x3'));var fs=require('fs');var _=require(_0x7721('0x4'));var Redis=require(_0x7721('0x5'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require(_0x7721('0x6'))(_0x7721('0x7'));var interaction_log=require(_0x7721('0x6'))(_0x7721('0x8'));var config=require(_0x7721('0x9'));var db=require(_0x7721('0xa'))['db'];config[_0x7721('0xb')]=_[_0x7721('0xc')](config[_0x7721('0xb')],{'host':_0x7721('0xd'),'port':0x18eb});var socket=require(_0x7721('0xe'))(new Redis(config[_0x7721('0xb')]));require(_0x7721('0xf'))[_0x7721('0x10')](socket);var jayson=require(_0x7721('0x11'));var client=jayson['client'][_0x7721('0x12')]({'port':0x232c});var client9003=jayson[_0x7721('0x13')][_0x7721('0x12')]({'port':0x232b});var client9002=jayson[_0x7721('0x13')][_0x7721('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x409b37,_0x1e7fd7,_0x27b36b,_0x55b4ca){return new BPromise(function(_0x2911ec,_0x199930){var _0x57ff6d=_0x55b4ca||client;return _0x57ff6d[_0x7721('0x14')](_0x409b37,_0x27b36b)[_0x7721('0x15')](function(_0x3f01c5){logger[_0x7721('0x16')]('MailMessage,\x20%s,\x20%s',_0x1e7fd7,_0x7721('0x17'));logger[_0x7721('0x18')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x1e7fd7,'request\x20sent',JSON['stringify'](_0x3f01c5));if(_0x3f01c5[_0x7721('0x19')]){if(_0x3f01c5[_0x7721('0x19')][_0x7721('0x1a')]===0x1f4){logger[_0x7721('0x19')]('MailMessage,\x20%s,\x20%s',_0x1e7fd7,_0x3f01c5[_0x7721('0x19')]['message']);return _0x199930(_0x3f01c5[_0x7721('0x19')]['message']);}logger[_0x7721('0x19')](_0x7721('0x1b'),_0x1e7fd7,_0x3f01c5[_0x7721('0x19')][_0x7721('0x1c')]);return _0x2911ec(_0x3f01c5[_0x7721('0x19')][_0x7721('0x1c')]);}else{logger[_0x7721('0x16')](_0x7721('0x1b'),_0x1e7fd7,_0x7721('0x17'));_0x2911ec(_0x3f01c5[_0x7721('0x1d')]['message']);}})[_0x7721('0x1e')](function(_0x2c1583){logger[_0x7721('0x19')](_0x7721('0x1b'),_0x1e7fd7,_0x2c1583);_0x199930(_0x2c1583);});});}function respondWithResult(_0x57140c,_0x28f5a6){_0x28f5a6=_0x28f5a6||0xc8;return function(_0x512f31){if(_0x512f31){return _0x57140c[_0x7721('0x1f')](_0x28f5a6)[_0x7721('0x20')](_0x512f31);}};}function respondWithFilteredResult(_0x3e8a4e,_0x1caad8){return function(_0x121cc4){if(_0x121cc4){var _0x395b15=typeof _0x1caad8[_0x7721('0x21')]==='undefined'&&typeof _0x1caad8[_0x7721('0x22')]===_0x7721('0x23');var _0x125564=_0x121cc4[_0x7721('0x24')];var _0x40d550=_0x395b15?0x0:_0x1caad8[_0x7721('0x21')];var _0x424e05=_0x395b15?_0x121cc4[_0x7721('0x24')]:_0x1caad8[_0x7721('0x21')]+_0x1caad8['limit'];var _0x258ddf;if(_0x424e05>=_0x125564){_0x424e05=_0x125564;_0x258ddf=0xc8;}else{_0x258ddf=0xce;}_0x3e8a4e['status'](_0x258ddf);return _0x3e8a4e['set'](_0x7721('0x25'),_0x40d550+'-'+_0x424e05+'/'+_0x125564)[_0x7721('0x20')](_0x121cc4);}return null;};}function saveUpdates(_0x53c904){return function(_0x158d98){if(_0x158d98){return _0x158d98[_0x7721('0x26')](_0x53c904)[_0x7721('0x15')](function(_0xd7d703){return _0xd7d703;});}return null;};}function removeEntity(_0x1da2d8){return function(_0x5c54f0){if(_0x5c54f0){return _0x5c54f0[_0x7721('0x27')]()[_0x7721('0x15')](function(){_0x1da2d8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xfde9ec){return function(_0x220bbf){if(!_0x220bbf){_0xfde9ec['sendStatus'](0x194);}return _0x220bbf;};}function handleError(_0x46f772,_0x4651b5){_0x4651b5=_0x4651b5||0x1f4;return function(_0x382821){logger['error'](_0x382821[_0x7721('0x28')]);if(_0x382821[_0x7721('0x29')]){delete _0x382821[_0x7721('0x29')];}_0x46f772[_0x7721('0x1f')](_0x4651b5)[_0x7721('0x2a')](_0x382821);};}exports['index']=function(_0x195ffb,_0x3e4e56){var _0xb2386d={},_0x5c5b33={},_0x35de7a={'count':0x0,'rows':[]};var _0x213a2e=_['map'](db[_0x7721('0x2b')]['rawAttributes'],function(_0x2d6ba0){return{'name':_0x2d6ba0[_0x7721('0x2c')],'type':_0x2d6ba0[_0x7721('0x2d')][_0x7721('0x2e')]};});_0x5c5b33[_0x7721('0x2f')]=_[_0x7721('0x30')](_0x213a2e,_0x7721('0x29'));_0x5c5b33[_0x7721('0x31')]=_[_0x7721('0x32')](_0x195ffb[_0x7721('0x31')]);_0x5c5b33[_0x7721('0x33')]=_['intersection'](_0x5c5b33[_0x7721('0x2f')],_0x5c5b33['query']);_0xb2386d[_0x7721('0x34')]=_[_0x7721('0x35')](_0x5c5b33[_0x7721('0x2f')],qs[_0x7721('0x36')](_0x195ffb[_0x7721('0x31')][_0x7721('0x36')]));_0xb2386d['attributes']=_0xb2386d['attributes']['length']?_0xb2386d['attributes']:_0x5c5b33[_0x7721('0x2f')];if(!_0x195ffb[_0x7721('0x31')][_0x7721('0x37')](_0x7721('0x38'))){_0xb2386d['limit']=qs[_0x7721('0x22')](_0x195ffb['query'][_0x7721('0x22')]);_0xb2386d[_0x7721('0x21')]=qs['offset'](_0x195ffb[_0x7721('0x31')][_0x7721('0x21')]);}_0xb2386d['order']=qs['sort'](_0x195ffb[_0x7721('0x31')][_0x7721('0x39')]);_0xb2386d[_0x7721('0x3a')]=qs[_0x7721('0x33')](_['pick'](_0x195ffb[_0x7721('0x31')],_0x5c5b33[_0x7721('0x33')]),_0x213a2e);if(_0x195ffb[_0x7721('0x31')][_0x7721('0x3b')]){_0xb2386d[_0x7721('0x3a')]=_['merge'](_0xb2386d[_0x7721('0x3a')],{'$or':_['map'](_0x213a2e,function(_0xaa3216){if(_0xaa3216['type']!==_0x7721('0x3c')){var _0x15fa2c={};_0x15fa2c[_0xaa3216[_0x7721('0x29')]]={'$like':'%'+_0x195ffb['query'][_0x7721('0x3b')]+'%'};return _0x15fa2c;}})});}_0xb2386d=_[_0x7721('0x3d')]({},_0xb2386d,_0x195ffb[_0x7721('0x3e')]);var _0x481fa8={'where':_0xb2386d[_0x7721('0x3a')]};return db[_0x7721('0x2b')][_0x7721('0x24')](_0x481fa8)[_0x7721('0x15')](function(_0x135dbc){_0x35de7a[_0x7721('0x24')]=_0x135dbc;if(_0x195ffb[_0x7721('0x31')]['includeAll']){_0xb2386d['include']=[{'all':!![]}];}return db[_0x7721('0x2b')][_0x7721('0x3f')](_0xb2386d);})[_0x7721('0x15')](function(_0x39a3ad){_0x35de7a[_0x7721('0x40')]=_0x39a3ad;return _0x35de7a;})[_0x7721('0x15')](respondWithFilteredResult(_0x3e4e56,_0xb2386d))[_0x7721('0x1e')](handleError(_0x3e4e56,null));};exports[_0x7721('0x41')]=function(_0xa601bc,_0x3af123){var _0x5460cd={'raw':!![],'where':{'id':_0xa601bc[_0x7721('0x42')]['id']}},_0x578867={};_0x578867[_0x7721('0x2f')]=_[_0x7721('0x32')](db[_0x7721('0x2b')]['rawAttributes']);_0x578867[_0x7721('0x31')]=_[_0x7721('0x32')](_0xa601bc['query']);_0x578867[_0x7721('0x33')]=_['intersection'](_0x578867[_0x7721('0x2f')],_0x578867['query']);_0x5460cd[_0x7721('0x34')]=_[_0x7721('0x35')](_0x578867[_0x7721('0x2f')],qs['fields'](_0xa601bc[_0x7721('0x31')][_0x7721('0x36')]));_0x5460cd['attributes']=_0x5460cd[_0x7721('0x34')][_0x7721('0x43')]?_0x5460cd[_0x7721('0x34')]:_0x578867['model'];if(_0xa601bc[_0x7721('0x31')]['includeAll']){_0x5460cd[_0x7721('0x44')]=[{'all':!![]}];}_0x5460cd=_[_0x7721('0x3d')]({},_0x5460cd,_0xa601bc[_0x7721('0x3e')]);return db[_0x7721('0x2b')][_0x7721('0x45')](_0x5460cd)[_0x7721('0x15')](handleEntityNotFound(_0x3af123,null))[_0x7721('0x15')](respondWithResult(_0x3af123,null))[_0x7721('0x1e')](handleError(_0x3af123,null));};exports[_0x7721('0x26')]=function(_0x3386aa,_0x31770e){if(_0x3386aa[_0x7721('0x46')]['id']){delete _0x3386aa[_0x7721('0x46')]['id'];}return db[_0x7721('0x2b')][_0x7721('0x45')]({'where':{'id':_0x3386aa['params']['id']}})[_0x7721('0x15')](handleEntityNotFound(_0x31770e,null))[_0x7721('0x15')](saveUpdates(_0x3386aa[_0x7721('0x46')],null))[_0x7721('0x15')](respondWithResult(_0x31770e,null))[_0x7721('0x1e')](handleError(_0x31770e,null));};exports[_0x7721('0x27')]=function(_0x267f5e,_0x57484c){return db[_0x7721('0x2b')][_0x7721('0x45')]({'where':{'id':_0x267f5e[_0x7721('0x42')]['id']}})[_0x7721('0x15')](handleEntityNotFound(_0x57484c,null))[_0x7721('0x15')](removeEntity(_0x57484c,null))[_0x7721('0x1e')](handleError(_0x57484c,null));};exports[_0x7721('0x47')]=function(_0x33287d,_0x11b300){return db[_0x7721('0x2b')][_0x7721('0x47')]()['then'](respondWithResult(_0x11b300,null))[_0x7721('0x1e')](handleError(_0x11b300,null));};exports[_0x7721('0x48')]=function(_0x1234bc,_0x2ee3c0){return db[_0x7721('0x2b')][_0x7721('0x48')](_0x1234bc[_0x7721('0x46')])[_0x7721('0x15')](function(_0x360882){if(_0x360882){if(_0x360882[_0x7721('0x49')]===_0x7721('0x4a')&&!_0x360882[_0x7721('0x4b')]){var _0x106664,_0x18f7f6,_0x300ea4;if(_0x1234bc['body']['to']){_0x18f7f6=_0x1234bc['body']['to']['split'](',')[0x0];}return db[_0x7721('0x4c')]['findOne']({'where':{'id':_0x360882['MailAccountId']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x7721('0x4d')],'as':_0x7721('0x4e'),'where':{'email':_0x18f7f6},'limit':0x1,'order':[[_0x7721('0x4f'),'DESC']]}]},{'model':db[_0x7721('0x50')],'as':'Smtp','raw':!![]}]})['then'](function(_0x484b8e){_0x106664=_0x484b8e;if(_0x106664&&_0x106664[_0x7721('0x51')]){var _0x4f0d38={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x106664['Smtp'][_0x7721('0x52')])){_0x4f0d38[_0x7721('0x53')]=_0x106664[_0x7721('0x51')]['host'];_0x4f0d38[_0x7721('0x54')]=_0x106664[_0x7721('0x51')][_0x7721('0x54')];_0x4f0d38[_0x7721('0x55')]=_0x106664[_0x7721('0x51')][_0x7721('0x55')];if(_0x106664[_0x7721('0x51')][_0x7721('0x56')]){_0x4f0d38[_0x7721('0x57')]={'user':_0x106664[_0x7721('0x51')][_0x7721('0x58')],'pass':_0x106664[_0x7721('0x51')][_0x7721('0x59')]};}}else{_0x4f0d38[_0x7721('0x52')]=_0x106664[_0x7721('0x51')]['service'];_0x4f0d38[_0x7721('0x57')]={'user':_0x106664[_0x7721('0x51')][_0x7721('0x58')],'pass':_0x106664[_0x7721('0x51')]['pass']};_0x4f0d38[_0x7721('0x55')]=_0x106664[_0x7721('0x51')]['secure'];}if(_0x1234bc[_0x7721('0x46')]['attachments']&&_0x1234bc[_0x7721('0x46')][_0x7721('0x5a')][_0x7721('0x43')]){for(var _0x3f9eaa=0x0;_0x3f9eaa<_0x1234bc[_0x7721('0x46')][_0x7721('0x5a')][_0x7721('0x43')];_0x3f9eaa+=0x1){_0x1234bc[_0x7721('0x46')][_0x7721('0x5a')][_0x3f9eaa]={'filename':_0x1234bc['body'][_0x7721('0x5a')][_0x3f9eaa][_0x7721('0x29')],'path':path[_0x7721('0x5b')](config[_0x7721('0x5c')],_0x7721('0x5d'),_0x1234bc[_0x7721('0x46')][_0x7721('0x5a')][_0x3f9eaa]['basename'])};}}_0x300ea4={'account':_0x4f0d38,'message':_0x1234bc[_0x7721('0x46')]};return;}})[_0x7721('0x15')](function(){if(_0x106664['List']){if(_0x106664[_0x7721('0x5e')]['Contacts'][_0x7721('0x43')]){return _0x106664[_0x7721('0x5e')][_0x7721('0x4e')][0x0];}else{return db[_0x7721('0x4d')][_0x7721('0x48')](_[_0x7721('0xc')](_0x1234bc[_0x7721('0x46')],{'firstName':_0x1234bc['body']['to'],'email':_0x1234bc[_0x7721('0x46')]['to'],'phone':_0x1234bc[_0x7721('0x46')]['to'],'ListId':_0x106664[_0x7721('0x5f')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x300ea4){return respondWithRpcPromise('SendMail','sendMail',_0x300ea4,client9003)['then'](function(_0x1fc5f7){return _0x360882[_0x7721('0x26')]({'read':!![],'messageId':_0x1fc5f7['messageId'],'sentAt':moment()[_0x7721('0x60')](_0x7721('0x61'))});})[_0x7721('0x1e')](function(_0x4593e1){logger['error']('%s',JSON[_0x7721('0x62')](_0x4593e1));return _0x360882;});}return _0x360882;});}return _0x360882;}})[_0x7721('0x15')](respondWithResult(_0x2ee3c0,0xc9))[_0x7721('0x1e')](handleError(_0x2ee3c0,null));};exports[_0x7721('0x63')]=function(_0x3cf3fd,_0x53adb1){var _0x29ac64={'agent':{},'channel':_0x7721('0x64')};if(_0x3cf3fd[_0x7721('0x46')]['id']){delete _0x3cf3fd['body']['id'];}_0x3cf3fd['body'][_0x7721('0x65')]=!![];_0x3cf3fd[_0x7721('0x46')][_0x7721('0x66')]=moment()[_0x7721('0x60')](_0x7721('0x61'));_0x3cf3fd['body']['UserId']=_0x3cf3fd[_0x7721('0x46')][_0x7721('0x67')]||_0x3cf3fd[_0x7721('0x58')]['id'];_0x29ac64[_0x7721('0x68')]['id']=_0x3cf3fd[_0x7721('0x46')][_0x7721('0x67')];return db[_0x7721('0x2b')]['find']({'where':{'id':_0x3cf3fd[_0x7721('0x42')]['id'],'UserId':null}})[_0x7721('0x15')](handleEntityNotFound(_0x53adb1,null))[_0x7721('0x15')](saveUpdates(_0x3cf3fd['body'],null))[_0x7721('0x15')](function(_0x1a53d6){if(_0x1a53d6){_0x29ac64[_0x7721('0x1c')]=_0x1a53d6[_0x7721('0x69')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x1a53d6[_0x7721('0x6a')]}});}return null;})[_0x7721('0x15')](handleEntityNotFound(_0x53adb1,null))[_0x7721('0x15')](function(_0x42c849){if(_0x42c849){return _0x42c849[_0x7721('0x26')]({'UserId':_0x3cf3fd[_0x7721('0x46')]['UserId'],'read1stAt':_[_0x7721('0x6b')](_0x42c849[_0x7721('0x6c')])?moment()[_0x7721('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7721('0x15')](function(_0x3b16f3){if(_0x3b16f3){_0x29ac64[_0x7721('0x6d')]=_0x3b16f3[_0x7721('0x69')]({'plain':!![]});interaction_log[_0x7721('0x16')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3cf3fd[_0x7721('0x58')]['id'],_0x3cf3fd['user'][_0x7721('0x29')],_0x3cf3fd[_0x7721('0x58')][_0x7721('0x6e')],_0x29ac64[_0x7721('0x6d')]['id'],_0x3cf3fd[_0x7721('0x46')]?JSON[_0x7721('0x62')](_0x3cf3fd[_0x7721('0x46')]):_0x7721('0x6f'));return respondWithRpcPromise(_0x7721('0x70'),_0x7721('0x71'),_0x29ac64);}return null;})[_0x7721('0x15')](function(_0x55d209){var _0x19fad6=_0x7721('0x72')+_0x55d209[_0x7721('0x1c')]['ContactId'];return db[_0x7721('0x73')][_0x7721('0x31')](_0x19fad6,{'type':db[_0x7721('0x74')][_0x7721('0x75')][_0x7721('0x76')],'raw':!![]})['then'](function(_0x1276ce){return _0x1276ce;});})[_0x7721('0x15')](function(_0x44326d){if(_0x44326d){_0x29ac64[_0x7721('0x1c')][_0x7721('0x77')]=_0x44326d[0x0];if(!_0x3cf3fd[_0x7721('0x46')]['UserId'])return;return db[_0x7721('0x78')][_0x7721('0x45')]({'where':{'id':_0x3cf3fd['body'][_0x7721('0x67')],'role':'agent'},'attributes':['id',_0x7721('0x29'),_0x7721('0x79'),'email',_0x7721('0x7a')],'raw':!![]});}return null;})['then'](function(_0x56069f){if(!_0x56069f)return null;_0x29ac64['message'][_0x7721('0x68')]=_0x56069f;return _0x29ac64;})[_0x7721('0x15')](function(_0x21a686){if(_0x21a686){if(_0x3cf3fd['body']['manual']){_0x29ac64['message'][_0x7721('0x7b')]=util[_0x7721('0x60')](_0x7721('0x7c'),_0x3cf3fd[_0x7721('0x58')][_0x7721('0x29')]);_0x29ac64[_0x7721('0x1c')]['channel']=_0x29ac64[_0x7721('0x7d')];_0x29ac64[_0x7721('0x1c')][_0x7721('0x7e')]=_0x7721('0x63');_0x29ac64[_0x7721('0x1c')][_0x7721('0x46')]=htmlToText[_0x7721('0x7f')](_0x29ac64[_0x7721('0x1c')][_0x7721('0x46')]);return respondWithRpcPromise(_0x7721('0x80'),_0x7721('0x80'),{'event':_0x7721('0x81'),'message':_0x29ac64['message']},client9002)['then'](function(){return _0x29ac64;});}return _0x29ac64;}return null;})[_0x7721('0x15')](respondWithResult(_0x53adb1,null))[_0x7721('0x1e')](handleError(_0x53adb1,null));};exports['reject']=function(_0x167e05,_0x570cf4){var _0x4e3c93={'agent':{},'channel':_0x7721('0x64')};if(_0x167e05['body']['id']){delete _0x167e05['body']['id'];}_0x167e05[_0x7721('0x46')][_0x7721('0x67')]=_0x167e05[_0x7721('0x46')][_0x7721('0x67')]||_0x167e05[_0x7721('0x58')]['id'];_0x4e3c93['agent']['id']=_0x167e05[_0x7721('0x46')][_0x7721('0x67')];return db[_0x7721('0x2b')][_0x7721('0x45')]({'where':{'id':_0x167e05['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x570cf4,null))[_0x7721('0x15')](function(_0x1790d3){if(_0x1790d3){_0x4e3c93['message']=_0x1790d3[_0x7721('0x69')]({'plain':!![]});return db[_0x7721('0x82')]['find']({'where':{'id':_0x1790d3['MailInteractionId']}});}return null;})[_0x7721('0x15')](handleEntityNotFound(_0x570cf4,null))[_0x7721('0x15')](function(_0x606b4b){if(_0x606b4b){_0x4e3c93[_0x7721('0x6d')]=_0x606b4b[_0x7721('0x69')]({'plain':!![]});interaction_log[_0x7721('0x16')](_0x7721('0x83'),_0x167e05[_0x7721('0x58')]['id'],_0x167e05['user'][_0x7721('0x29')],_0x167e05[_0x7721('0x58')][_0x7721('0x6e')],_0x4e3c93[_0x7721('0x6d')]['id'],_0x167e05[_0x7721('0x46')]?JSON[_0x7721('0x62')](_0x167e05[_0x7721('0x46')]):'null');return respondWithRpcPromise(_0x7721('0x84'),_0x7721('0x85'),_0x4e3c93);}return null;})['then'](function(_0x9b3e44){var _0x1cc8ee=_0x7721('0x72')+_0x9b3e44[_0x7721('0x1c')][_0x7721('0x86')];return db[_0x7721('0x73')][_0x7721('0x31')](_0x1cc8ee,{'type':db[_0x7721('0x74')][_0x7721('0x75')][_0x7721('0x76')],'raw':!![]})['then'](function(_0x418954){return _0x418954;});})[_0x7721('0x15')](function(_0xc894d4){if(_0xc894d4){_0x4e3c93[_0x7721('0x1c')][_0x7721('0x77')]=_0xc894d4[0x0];if(!_0x167e05[_0x7721('0x46')][_0x7721('0x67')])return;return db[_0x7721('0x78')][_0x7721('0x45')]({'where':{'id':_0x167e05[_0x7721('0x46')][_0x7721('0x67')],'role':_0x7721('0x68')},'attributes':['id',_0x7721('0x29'),_0x7721('0x79'),_0x7721('0x87'),_0x7721('0x7a')],'raw':!![]});}return null;})[_0x7721('0x15')](function(_0x1fb651){if(!_0x1fb651)return null;_0x4e3c93[_0x7721('0x1c')][_0x7721('0x68')]=_0x1fb651;return _0x4e3c93;})['then'](function(_0x3fc25c){if(_0x3fc25c){_0x3fc25c['message'][_0x7721('0x7b')]=util[_0x7721('0x60')](_0x7721('0x7c'),_0x167e05[_0x7721('0x58')][_0x7721('0x29')]);_0x3fc25c['message']['channel']=_0x4e3c93['channel'];_0x3fc25c['message'][_0x7721('0x7e')]=_0x7721('0x88');_0x3fc25c[_0x7721('0x1c')][_0x7721('0x46')]=htmlToText[_0x7721('0x7f')](_0x4e3c93['message'][_0x7721('0x46')]);respondWithRpcPromise('EventManager',_0x7721('0x80'),{'event':_0x7721('0x89'),'message':_0x3fc25c[_0x7721('0x1c')]},client9002);return _0x4e3c93;}return null;})[_0x7721('0x15')](respondWithResult(_0x570cf4,null))[_0x7721('0x1e')](handleError(_0x570cf4,null));};exports[_0x7721('0x8a')]=function(_0x56b916,_0x30ce7c){var _0x56f321=moment()['unix']()[_0x7721('0x8b')]();var _0xf718dd=path[_0x7721('0x5b')](config[_0x7721('0x5c')],_0x7721('0x8c'),'files',_0x7721('0x8d'));var _0x2561b5=path[_0x7721('0x5b')](config[_0x7721('0x5c')],_0x7721('0x8c'),_0x7721('0x8e'),_0x7721('0x5a'));var _0x50ee94=util[_0x7721('0x60')](_0x7721('0x8f'),_0x56f321);return db[_0x7721('0x2b')][_0x7721('0x45')]({'where':{'id':_0x56b916[_0x7721('0x42')]['id']},'attributes':['id','body',_0x7721('0x90'),'to','cc',_0x7721('0x91'),_0x7721('0x92'),'createdAt'],'include':_0x56b916[_0x7721('0x31')][_0x7721('0x5a')]?[{'model':db['Attachment'],'as':_0x7721('0x93')}]:undefined})[_0x7721('0x15')](handleEntityNotFound(_0x30ce7c,null))[_0x7721('0x15')](function(_0x30f548){if(_0x30f548){var _0x5b64de=_0x30f548;var _0x40beb8={'from':_0x5b64de['from'],'to':_0x5b64de['to'],'subject':_0x5b64de[_0x7721('0x92')],'html':_0x5b64de[_0x7721('0x46')],'headers':{'Date':moment(_0x5b64de['createdAt'])[_0x7721('0x60')](_0x7721('0x94'))},'attachments':[]};if(_0x30f548['cc']){_0x40beb8['headers']['Cc']=_0x30f548['cc'];}if(_0x30f548[_0x7721('0x91')]){_0x40beb8[_0x7721('0x95')]['Bcc']=_0x30f548[_0x7721('0x91')];}return new BPromise(function(_0x52e8b1,_0x240b0a){if(_0x30f548[_0x7721('0x93')]){for(var _0x271632=0x0;_0x271632<_0x30f548['Attachments'][_0x7721('0x43')];_0x271632++){var _0x506f9c=_0x30f548['Attachments'][_0x271632];var _0x287d61=path[_0x7721('0x5b')](_0x2561b5,_0x506f9c[_0x7721('0x96')]);if(fs[_0x7721('0x97')](_0x287d61)){_0x40beb8[_0x7721('0x5a')]['push']({'name':_0x506f9c[_0x7721('0x29')],'contentType':_0x506f9c[_0x7721('0x2d')],'data':fs[_0x7721('0x98')](_0x287d61)});}}}emlformat[_0x7721('0x99')](_0x40beb8,function(_0x42cd58,_0x58173d){if(_0x42cd58)return _0x240b0a(_0x42cd58);fs[_0x7721('0x9a')](path['join'](_0xf718dd,_0x50ee94),_0x58173d);return _0x52e8b1(_0x58173d);});});}})[_0x7721('0x15')](function(_0x4ade82){if(_0x4ade82){return _0x30ce7c['download'](path[_0x7721('0x5b')](_0xf718dd,_0x50ee94),_0x50ee94,function(_0x52f3c8){if(!_0x52f3c8)fs['unlinkSync'](path[_0x7721('0x5b')](_0xf718dd,_0x50ee94));});}})[_0x7721('0x1e')](handleError(_0x30ce7c,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index c78692c..5ab8250 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 _0xed58=['hook','events','../../mysqldb','MailMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x1bbf60,_0x8e8d43){var _0x304c90=function(_0x2dde4d){while(--_0x2dde4d){_0x1bbf60['push'](_0x1bbf60['shift']());}};_0x304c90(++_0x8e8d43);}(_0xed58,0x145));var _0x8ed5=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xed58[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x8ed5('0x0'));var MailMessage=require(_0x8ed5('0x1'))['db'][_0x8ed5('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x8ed5('0x3')](0x0);var events={'afterCreate':_0x8ed5('0x4'),'afterUpdate':_0x8ed5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5dd2ac){return function(_0xd9f65b,_0x5a7e16,_0x24bb16){MailMessageEvents[_0x8ed5('0x6')](_0x5dd2ac+':'+_0xd9f65b['id'],_0xd9f65b);MailMessageEvents['emit'](_0x5dd2ac,_0xd9f65b);_0x24bb16(null);};}for(var e in events){if(events[_0x8ed5('0x7')](e)){var event=events[e];MailMessage[_0x8ed5('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x3601=['hasOwnProperty','exports','setMaxListeners','update','remove','emit'];(function(_0x42f9be,_0x170990){var _0x10a803=function(_0x43deda){while(--_0x43deda){_0x42f9be['push'](_0x42f9be['shift']());}};_0x10a803(++_0x170990);}(_0x3601,0x1ee));var _0x1360=function(_0x24b964,_0x5d8ac3){_0x24b964=_0x24b964-0x0;var _0x349fb6=_0x3601[_0x24b964];return _0x349fb6;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x1360('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1360('0x1'),'afterDestroy':_0x1360('0x2')};function emitEvent(_0x3ba108){return function(_0x2f5736,_0x588ded,_0x2f02af){MailMessageEvents[_0x1360('0x3')](_0x3ba108+':'+_0x2f5736['id'],_0x2f5736);MailMessageEvents[_0x1360('0x3')](_0x3ba108,_0x2f5736);_0x2f02af(null);};}for(var e in events){if(events[_0x1360('0x4')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x1360('0x5')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index cae682e..963963b 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 _0xfe53=['createdAt','direction','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','toLowerCase','secret','isNil','UserId','MailInteraction','findOne','then'];(function(_0x4a6979,_0x5f3d1a){var _0x226f93=function(_0x471572){while(--_0x471572){_0x4a6979['push'](_0x4a6979['shift']());}};_0x226f93(++_0x5f3d1a);}(_0xfe53,0x10d));var _0x3fe5=function(_0x5ca9b4,_0x2bfd14){_0x5ca9b4=_0x5ca9b4-0x0;var _0x42731a=_0xfe53[_0x5ca9b4];return _0x42731a;};'use strict';var _=require('lodash');var util=require(_0x3fe5('0x0'));var logger=require(_0x3fe5('0x1'))('api');var moment=require(_0x3fe5('0x2'));var BPromise=require(_0x3fe5('0x3'));var rp=require(_0x3fe5('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0x3fe5('0x5'));var config=require(_0x3fe5('0x6'));var attributes=require(_0x3fe5('0x7'));module[_0x3fe5('0x8')]=function(_0x4d6649,_0x3f4c6f){return _0x4d6649[_0x3fe5('0x9')](_0x3fe5('0xa'),attributes,{'tableName':_0x3fe5('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x3fe5('0xc')]},{'name':_0x3fe5('0xd'),'fields':[_0x3fe5('0xe'),_0x3fe5('0xf')],'type':_0x3fe5('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x41cf92,_0x5789f4,_0x35131a){if(_0x41cf92[_0x3fe5('0x11')]){_0x41cf92[_0x3fe5('0xe')]=htmlToText[_0x3fe5('0x12')](_0x41cf92['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x35131a(null,_0x5789f4);},'afterCreate':function(_0x1d1626,_0x9be6c2,_0xe5288a){var _0x34e809=_0x4d6649[_0x3fe5('0x13')];var _0x4a5428=_0x1d1626[_0x3fe5('0x14')]({'plain':!![]});if(_0x4a5428['direction'][_0x3fe5('0x15')]()==='in'||_0x4a5428['direction'][_0x3fe5('0x15')]()==='out'&&!_0x4a5428[_0x3fe5('0x16')]&&!_[_0x3fe5('0x17')](_0x4a5428[_0x3fe5('0x18')])){_0x34e809[_0x3fe5('0x19')][_0x3fe5('0x1a')]({'where':{'id':_0x4a5428['MailInteractionId']}})[_0x3fe5('0x1b')](function(_0x2fdc35){if(_0x2fdc35){_0x2fdc35['update']({'lastMsgAt':_0x4a5428[_0x3fe5('0x1c')],'lastMsgDirection':_0x4a5428[_0x3fe5('0x1d')][_0x3fe5('0x15')]()});}})[_0x3fe5('0x1e')](function(_0x34d66c){console['error'](_0x34d66c);});}_0xe5288a();}},'charset':_0x3fe5('0x1f'),'collate':_0x3fe5('0x20')});}; \ No newline at end of file +var _0x15ed=['MailInteraction','findOne','MailInteractionId','then','createdAt','catch','error','utf8mb4','../../config/logger','moment','bluebird','request-promise','html-to-text','path','rimraf','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','FULLTEXT','body','plainBody','models','direction','toLowerCase','out','isNil','UserId'];(function(_0x41aa13,_0x1fb2d7){var _0x527eaf=function(_0x4d00b5){while(--_0x4d00b5){_0x41aa13['push'](_0x41aa13['shift']());}};_0x527eaf(++_0x1fb2d7);}(_0x15ed,0xda));var _0xd15e=function(_0x77d286,_0x1ddc6d){_0x77d286=_0x77d286-0x0;var _0x5446a5=_0x15ed[_0x77d286];return _0x5446a5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd15e('0x0'))('api');var moment=require(_0xd15e('0x1'));var BPromise=require(_0xd15e('0x2'));var rp=require(_0xd15e('0x3'));var htmlToText=require(_0xd15e('0x4'));var fs=require('fs');var path=require(_0xd15e('0x5'));var rimraf=require(_0xd15e('0x6'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0xd15e('0x7')]=function(_0xd9aadb,_0x38cfbe){return _0xd9aadb[_0xd15e('0x8')](_0xd15e('0x9'),attributes,{'tableName':_0xd15e('0xa'),'paranoid':![],'indexes':[{'name':_0xd15e('0xb'),'fields':[_0xd15e('0xb')]},{'name':_0xd15e('0xc'),'fields':['plainBody','subject'],'type':_0xd15e('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x195606,_0x4951f4,_0x3c6df8){if(_0x195606[_0xd15e('0xe')]){_0x195606[_0xd15e('0xf')]=htmlToText['fromString'](_0x195606[_0xd15e('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3c6df8(null,_0x4951f4);},'afterCreate':function(_0x4f660e,_0x582297,_0x318a28){var _0x29d85b=_0xd9aadb[_0xd15e('0x10')];var _0xf5b4ed=_0x4f660e['get']({'plain':!![]});if(_0xf5b4ed[_0xd15e('0x11')][_0xd15e('0x12')]()==='in'||_0xf5b4ed[_0xd15e('0x11')][_0xd15e('0x12')]()===_0xd15e('0x13')&&!_0xf5b4ed['secret']&&!_[_0xd15e('0x14')](_0xf5b4ed[_0xd15e('0x15')])){_0x29d85b[_0xd15e('0x16')][_0xd15e('0x17')]({'where':{'id':_0xf5b4ed[_0xd15e('0x18')]}})[_0xd15e('0x19')](function(_0x282d11){if(_0x282d11){_0x282d11['update']({'lastMsgAt':_0xf5b4ed[_0xd15e('0x1a')],'lastMsgDirection':_0xf5b4ed['direction']['toLowerCase']()});}})[_0xd15e('0x1b')](function(_0x46032d){console[_0xd15e('0x1c')](_0x46032d);});}_0x318a28();}},'charset':_0xd15e('0x1d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 3b5f158..0f04bbb 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 _0x77e6=['catch','CreateMailMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x42aa0a,_0x57286c){var _0x1150e4=function(_0x2c5ba7){while(--_0x2c5ba7){_0x42aa0a['push'](_0x42aa0a['shift']());}};_0x1150e4(++_0x57286c);}(_0x77e6,0x1a6));var _0x677e=function(_0x489c7e,_0x2363f6){_0x489c7e=_0x489c7e-0x0;var _0x498ef5=_0x77e6[_0x489c7e];return _0x498ef5;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));var BPromise=require(_0x677e('0x3'));var rs=require(_0x677e('0x4'));var fs=require('fs');var Redis=require(_0x677e('0x5'));var db=require(_0x677e('0x6'))['db'];var utils=require(_0x677e('0x7'));var logger=require('../../config/logger')(_0x677e('0x8'));var config=require(_0x677e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x677e('0xa')]['http']({'port':0x232a});config[_0x677e('0xb')]=_['defaults'](config['redis'],{'host':_0x677e('0xc'),'port':0x18eb});var socket=require(_0x677e('0xd'))(new Redis(config[_0x677e('0xb')]));require(_0x677e('0xe'))['register'](socket);function respondWithRpcPromise(_0x206305,_0x5bf52d,_0x3cdbe3){return new BPromise(function(_0x227084,_0x1e4fd9){return client[_0x677e('0xf')](_0x206305,_0x3cdbe3)[_0x677e('0x10')](function(_0x49ca35){logger[_0x677e('0x11')](_0x677e('0x12'),_0x5bf52d,_0x677e('0x13'));logger[_0x677e('0x14')](_0x677e('0x15'),_0x5bf52d,_0x677e('0x13'),JSON[_0x677e('0x16')](_0x49ca35));if(_0x49ca35[_0x677e('0x17')]){if(_0x49ca35['error']['code']===0x1f4){logger['error'](_0x677e('0x12'),_0x5bf52d,_0x49ca35[_0x677e('0x17')][_0x677e('0x18')]);return _0x1e4fd9(_0x49ca35[_0x677e('0x17')][_0x677e('0x18')]);}logger[_0x677e('0x17')](_0x677e('0x12'),_0x5bf52d,_0x49ca35[_0x677e('0x17')][_0x677e('0x18')]);return _0x227084(_0x49ca35[_0x677e('0x17')][_0x677e('0x18')]);}else{logger[_0x677e('0x11')]('MailMessage,\x20%s,\x20%s',_0x5bf52d,_0x677e('0x13'));_0x227084(_0x49ca35[_0x677e('0x19')][_0x677e('0x18')]);}})[_0x677e('0x1a')](function(_0xba1c26){logger[_0x677e('0x17')]('MailMessage,\x20%s,\x20%s',_0x5bf52d,_0xba1c26);_0x1e4fd9(_0xba1c26);});});}exports[_0x677e('0x1b')]=function(_0x4bfbb6){var _0x18424e=this;return new Promise(function(_0x267aac,_0x26e9c5){return db['MailMessage'][_0x677e('0x1c')](_0x4bfbb6[_0x677e('0x1d')],{'raw':_0x4bfbb6[_0x677e('0x1e')]?_0x4bfbb6[_0x677e('0x1e')][_0x677e('0x1f')]===undefined?!![]:![]:!![]})[_0x677e('0x10')](function(_0x3a7895){logger['info']('CreateMailMessage',_0x4bfbb6);logger['debug'](_0x677e('0x1b'),_0x4bfbb6,JSON[_0x677e('0x16')](_0x3a7895));_0x267aac(_0x3a7895);})[_0x677e('0x1a')](function(_0x540d0e){logger[_0x677e('0x17')](_0x677e('0x1b'),_0x540d0e[_0x677e('0x18')],_0x4bfbb6);_0x26e9c5(_0x18424e[_0x677e('0x17')](0x1f4,_0x540d0e[_0x677e('0x18')]));});});}; \ No newline at end of file +var _0x1eba=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','then','info','request\x20sent','debug','error','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0x1eba[_0x172133];return _0x2460e5;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var moment=require(_0xa1eb('0x2'));var BPromise=require(_0xa1eb('0x3'));var rs=require(_0xa1eb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa1eb('0x5'));var logger=require(_0xa1eb('0x6'))(_0xa1eb('0x7'));var config=require(_0xa1eb('0x8'));var jayson=require(_0xa1eb('0x9'));var client=jayson[_0xa1eb('0xa')][_0xa1eb('0xb')]({'port':0x232a});config[_0xa1eb('0xc')]=_[_0xa1eb('0xd')](config[_0xa1eb('0xc')],{'host':_0xa1eb('0xe'),'port':0x18eb});var socket=require(_0xa1eb('0xf'))(new Redis(config['redis']));require(_0xa1eb('0x10'))['register'](socket);function respondWithRpcPromise(_0x219802,_0x54cdad,_0x3f53ff){return new BPromise(function(_0x5d7101,_0x41a7bc){return client['request'](_0x219802,_0x3f53ff)[_0xa1eb('0x11')](function(_0x325d13){logger[_0xa1eb('0x12')]('MailMessage,\x20%s,\x20%s',_0x54cdad,_0xa1eb('0x13'));logger[_0xa1eb('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x54cdad,_0xa1eb('0x13'),JSON['stringify'](_0x325d13));if(_0x325d13['error']){if(_0x325d13[_0xa1eb('0x15')]['code']===0x1f4){logger[_0xa1eb('0x15')](_0xa1eb('0x16'),_0x54cdad,_0x325d13[_0xa1eb('0x15')][_0xa1eb('0x17')]);return _0x41a7bc(_0x325d13[_0xa1eb('0x15')][_0xa1eb('0x17')]);}logger[_0xa1eb('0x15')](_0xa1eb('0x16'),_0x54cdad,_0x325d13[_0xa1eb('0x15')]['message']);return _0x5d7101(_0x325d13[_0xa1eb('0x15')]['message']);}else{logger[_0xa1eb('0x12')](_0xa1eb('0x16'),_0x54cdad,_0xa1eb('0x13'));_0x5d7101(_0x325d13[_0xa1eb('0x18')]['message']);}})[_0xa1eb('0x19')](function(_0x22cd44){logger[_0xa1eb('0x15')](_0xa1eb('0x16'),_0x54cdad,_0x22cd44);_0x41a7bc(_0x22cd44);});});}exports[_0xa1eb('0x1a')]=function(_0x3b8607){var _0x2143e6=this;return new Promise(function(_0x166f7f,_0x4fc14a){return db[_0xa1eb('0x1b')]['create'](_0x3b8607[_0xa1eb('0x1c')],{'raw':_0x3b8607[_0xa1eb('0x1d')]?_0x3b8607[_0xa1eb('0x1d')][_0xa1eb('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x539634){logger[_0xa1eb('0x12')](_0xa1eb('0x1a'),_0x3b8607);logger['debug'](_0xa1eb('0x1a'),_0x3b8607,JSON[_0xa1eb('0x1f')](_0x539634));_0x166f7f(_0x539634);})[_0xa1eb('0x19')](function(_0xa6b20c){logger[_0xa1eb('0x15')](_0xa1eb('0x1a'),_0xa6b20c[_0xa1eb('0x17')],_0x3b8607);_0x4fc14a(_0x2143e6[_0xa1eb('0x15')](0x1f4,_0xa6b20c[_0xa1eb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 2cf06be..ba8cf0d 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 _0x534d=['removeListener','register','length','mailMessage:','./mailMessage.events','save','remove','update','emit'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x534d,0x79));var _0xd534=function(_0x282ee9,_0x223ce2){_0x282ee9=_0x282ee9-0x0;var _0x890f34=_0x534d[_0x282ee9];return _0x890f34;};'use strict';var MailMessageEvents=require(_0xd534('0x0'));var events=[_0xd534('0x1'),_0xd534('0x2'),_0xd534('0x3')];function createListener(_0x35088f,_0xedc863){return function(_0x110ae2){_0xedc863[_0xd534('0x4')](_0x35088f,_0x110ae2);};}function removeListener(_0x1479ec,_0x278f6b){return function(){MailMessageEvents[_0xd534('0x5')](_0x1479ec,_0x278f6b);};}exports[_0xd534('0x6')]=function(_0x2e9c44){for(var _0x2ebe36=0x0,_0x1db778=events[_0xd534('0x7')];_0x2ebe36<_0x1db778;_0x2ebe36++){var _0x4419ee=events[_0x2ebe36];var _0x1a00af=createListener(_0xd534('0x8')+_0x4419ee,_0x2e9c44);MailMessageEvents['on'](_0x4419ee,_0x1a00af);}}; \ No newline at end of file +var _0xa70f=['update','emit','register','length','mailMessage:'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0xa70f,0xb4));var _0xfa70=function(_0x377edb,_0x154849){_0x377edb=_0x377edb-0x0;var _0x632fa3=_0xa70f[_0x377edb];return _0x632fa3;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save','remove',_0xfa70('0x0')];function createListener(_0xdd3582,_0x423c06){return function(_0x22a1e4){_0x423c06[_0xfa70('0x1')](_0xdd3582,_0x22a1e4);};}function removeListener(_0x49c1ad,_0x5c02b5){return function(){MailMessageEvents['removeListener'](_0x49c1ad,_0x5c02b5);};}exports[_0xfa70('0x2')]=function(_0x276de4){for(var _0xb80191=0x0,_0x2fd406=events[_0xfa70('0x3')];_0xb80191<_0x2fd406;_0xb80191++){var _0x527aa1=events[_0xb80191];var _0x5c5bb4=createListener(_0xfa70('0x4')+_0x527aa1,_0x276de4);MailMessageEvents['on'](_0x527aa1,_0x5c5bb4);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 7b344cf..924f10a 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 _0xa9f4=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','isAuthenticated','index','get','/describe'];(function(_0x35efc0,_0x46c11e){var _0x5bbb73=function(_0x51281a){while(--_0x51281a){_0x35efc0['push'](_0x35efc0['shift']());}};_0x5bbb73(++_0x46c11e);}(_0xa9f4,0x19f));var _0x4a9f=function(_0x5214d3,_0x2cb027){_0x5214d3=_0x5214d3-0x0;var _0x44b5ef=_0xa9f4[_0x5214d3];return _0x44b5ef;};'use strict';var multer=require(_0x4a9f('0x0'));var util=require(_0x4a9f('0x1'));var path=require(_0x4a9f('0x2'));var timeout=require(_0x4a9f('0x3'));var express=require(_0x4a9f('0x4'));var router=express[_0x4a9f('0x5')]();var fs_extra=require(_0x4a9f('0x6'));var auth=require(_0x4a9f('0x7'));var interaction=require(_0x4a9f('0x8'));var config=require('../../config/environment');var controller=require(_0x4a9f('0x9'));router['get']('/',auth[_0x4a9f('0xa')](),controller[_0x4a9f('0xb')]);router[_0x4a9f('0xc')](_0x4a9f('0xd'),auth[_0x4a9f('0xa')](),controller['describe']);router[_0x4a9f('0xc')](_0x4a9f('0xe'),auth[_0x4a9f('0xa')](),controller[_0x4a9f('0xf')]);router[_0x4a9f('0xc')](_0x4a9f('0x10'),auth['isAuthenticated'](),controller[_0x4a9f('0x11')]);router['get'](_0x4a9f('0x12'),auth[_0x4a9f('0xa')](),controller[_0x4a9f('0x13')]);router[_0x4a9f('0xc')]('/:id/users',auth[_0x4a9f('0xa')](),controller[_0x4a9f('0x14')]);router[_0x4a9f('0x15')]('/',auth[_0x4a9f('0xa')](),controller[_0x4a9f('0x16')]);router['post'](_0x4a9f('0x12'),auth[_0x4a9f('0xa')](),controller[_0x4a9f('0x17')]);router[_0x4a9f('0x15')](_0x4a9f('0x18'),auth['isAuthenticated'](),controller[_0x4a9f('0x19')]);router[_0x4a9f('0x1a')](_0x4a9f('0xe'),auth[_0x4a9f('0xa')](),controller[_0x4a9f('0x1b')]);router[_0x4a9f('0x1c')](_0x4a9f('0xe'),auth[_0x4a9f('0xa')](),controller[_0x4a9f('0x1d')]);router[_0x4a9f('0x1c')](_0x4a9f('0x12'),auth[_0x4a9f('0xa')](),controller[_0x4a9f('0x1e')]);router[_0x4a9f('0x1c')](_0x4a9f('0x18'),auth[_0x4a9f('0xa')](),controller[_0x4a9f('0x1f')]);module[_0x4a9f('0x20')]=router; \ No newline at end of file +var _0xd6d3=['../../components/interaction/service','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','/:id/members','getMembers','getTeams','/:id/users','post','create','addTeams','addAgents','put','/:id','update','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xd8b3cb,_0x2c26db){var _0x273a8f=function(_0x124e48){while(--_0x124e48){_0xd8b3cb['push'](_0xd8b3cb['shift']());}};_0x273a8f(++_0x2c26db);}(_0xd6d3,0x1f0));var _0x3d6d=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xd6d3[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x3d6d('0x0'));var util=require(_0x3d6d('0x1'));var path=require(_0x3d6d('0x2'));var timeout=require(_0x3d6d('0x3'));var express=require(_0x3d6d('0x4'));var router=express[_0x3d6d('0x5')]();var fs_extra=require(_0x3d6d('0x6'));var auth=require(_0x3d6d('0x7'));var interaction=require(_0x3d6d('0x8'));var config=require('../../config/environment');var controller=require(_0x3d6d('0x9'));router[_0x3d6d('0xa')]('/',auth['isAuthenticated'](),controller[_0x3d6d('0xb')]);router['get'](_0x3d6d('0xc'),auth[_0x3d6d('0xd')](),controller[_0x3d6d('0xe')]);router[_0x3d6d('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3d6d('0xa')](_0x3d6d('0xf'),auth[_0x3d6d('0xd')](),controller[_0x3d6d('0x10')]);router['get']('/:id/teams',auth[_0x3d6d('0xd')](),controller[_0x3d6d('0x11')]);router[_0x3d6d('0xa')](_0x3d6d('0x12'),auth[_0x3d6d('0xd')](),controller['getAgents']);router[_0x3d6d('0x13')]('/',auth[_0x3d6d('0xd')](),controller[_0x3d6d('0x14')]);router[_0x3d6d('0x13')]('/:id/teams',auth[_0x3d6d('0xd')](),controller[_0x3d6d('0x15')]);router[_0x3d6d('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x3d6d('0x16')]);router[_0x3d6d('0x17')](_0x3d6d('0x18'),auth[_0x3d6d('0xd')](),controller[_0x3d6d('0x19')]);router['delete'](_0x3d6d('0x18'),auth['isAuthenticated'](),controller[_0x3d6d('0x1a')]);router['delete']('/:id/teams',auth[_0x3d6d('0xd')](),controller['removeTeams']);router['delete'](_0x3d6d('0x12'),auth['isAuthenticated'](),controller[_0x3d6d('0x1b')]);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 5d7b63c..15775ed 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 _0xf1ed=['exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x4b244c,_0x5e87c8){var _0x326d2f=function(_0x3a2d20){while(--_0x3a2d20){_0x4b244c['push'](_0x4b244c['shift']());}};_0x326d2f(++_0x5e87c8);}(_0xf1ed,0xf7));var _0xdf1e=function(_0x4c2db0,_0x236a7c){_0x4c2db0=_0x4c2db0-0x0;var _0x14e370=_0xf1ed[_0x4c2db0];return _0x14e370;};'use strict';var Sequelize=require(_0xdf1e('0x0'));module[_0xdf1e('0x1')]={'name':{'type':Sequelize[_0xdf1e('0x2')],'unique':_0xdf1e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xdf1e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdf1e('0x5')](_0xdf1e('0x6'),'beepall',_0xdf1e('0x7'))}}; \ No newline at end of file +var _0x4709=['exports','STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x476cda,_0x1f7aba){var _0x2e077b=function(_0x3016ec){while(--_0x3016ec){_0x476cda['push'](_0x476cda['shift']());}};_0x2e077b(++_0x1f7aba);}(_0x4709,0x164));var _0x9470=function(_0x2222cb,_0x37d729){_0x2222cb=_0x2222cb-0x0;var _0x2ec931=_0x4709[_0x2222cb];return _0x2ec931;};'use strict';var Sequelize=require(_0x9470('0x0'));module[_0x9470('0x1')]={'name':{'type':Sequelize[_0x9470('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9470('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9470('0x4'),_0x9470('0x5'),_0x9470('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 7119305..c5493c1 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 _0x73bd=['../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./mailQueue.socket','register','status','end','json','undefined','offset','count','apply','reject','save','update','destroy','then','get','MailQueues','UserProfileResource','error','stack','name','index','map','MailQueue','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','pick','where','merge','includeAll','include','findAll','rows','catch','show','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','MailQueueId','filter','options','UserMailQueue','findAndCountAll','UserId','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','User','Agents','voicePause','flatMap','transaction','addTeams','findOrCreate','forEach','userMailQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_mail_queues','user_has_teams','MailQueueId\x20=\x20?','sequelize','QueryTypes','SELECT','includes','union','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','emit','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x14f89e,_0x139fce){var _0x26092d=function(_0x2bdc20){while(--_0x2bdc20){_0x14f89e['push'](_0x14f89e['shift']());}};_0x26092d(++_0x139fce);}(_0x73bd,0x6b));var _0xd73b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x73bd[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xd73b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd73b('0x1'));var jsonpatch=require(_0xd73b('0x2'));var rp=require(_0xd73b('0x3'));var moment=require(_0xd73b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd73b('0x5'));var util=require(_0xd73b('0x6'));var path=require('path');var sox=require(_0xd73b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd73b('0x8'));var _=require(_0xd73b('0x9'));var squel=require(_0xd73b('0xa'));var crypto=require(_0xd73b('0xb'));var jsforce=require(_0xd73b('0xc'));var deskjs=require(_0xd73b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd73b('0xe'));var Papa=require(_0xd73b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd73b('0x10'));var as=require(_0xd73b('0x11'));var hardwareService=require(_0xd73b('0x12'));var logger=require(_0xd73b('0x13'))('api');var utils=require(_0xd73b('0x14'));var config=require(_0xd73b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd73b('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd73b('0x17'),'port':0x18eb});var socket=require(_0xd73b('0x18'))(new Redis(config[_0xd73b('0x19')]));require(_0xd73b('0x1a'))[_0xd73b('0x1b')](socket);function respondWithStatusCode(_0xfb6d23,_0x59ce2a){_0x59ce2a=_0x59ce2a||0xcc;return function(_0x1f9b70){if(_0x1f9b70){return _0xfb6d23['sendStatus'](_0x59ce2a);}return _0xfb6d23[_0xd73b('0x1c')](_0x59ce2a)[_0xd73b('0x1d')]();};}function respondWithResult(_0x3fefaa,_0x3ab9fa){_0x3ab9fa=_0x3ab9fa||0xc8;return function(_0x15d491){if(_0x15d491){return _0x3fefaa[_0xd73b('0x1c')](_0x3ab9fa)[_0xd73b('0x1e')](_0x15d491);}};}function respondWithFilteredResult(_0x45eb23,_0x21449c){return function(_0x413384){if(_0x413384){var _0x53a909=typeof _0x21449c['offset']==='undefined'&&typeof _0x21449c['limit']===_0xd73b('0x1f');var _0x496d0d=_0x413384['count'];var _0x42a79c=_0x53a909?0x0:_0x21449c[_0xd73b('0x20')];var _0x430a6c=_0x53a909?_0x413384[_0xd73b('0x21')]:_0x21449c[_0xd73b('0x20')]+_0x21449c['limit'];var _0x2c9667;if(_0x430a6c>=_0x496d0d){_0x430a6c=_0x496d0d;_0x2c9667=0xc8;}else{_0x2c9667=0xce;}_0x45eb23[_0xd73b('0x1c')](_0x2c9667);return _0x45eb23['set']('Content-Range',_0x42a79c+'-'+_0x430a6c+'/'+_0x496d0d)[_0xd73b('0x1e')](_0x413384);}return null;};}function patchUpdates(_0x4ee410){return function(_0xd48c9e){try{jsonpatch[_0xd73b('0x22')](_0xd48c9e,_0x4ee410,!![]);}catch(_0x38f776){return BPromise[_0xd73b('0x23')](_0x38f776);}return _0xd48c9e[_0xd73b('0x24')]();};}function saveUpdates(_0x4f6e5e,_0x5607f2){return function(_0x30ae74){if(_0x30ae74){return _0x30ae74[_0xd73b('0x25')](_0x4f6e5e)['then'](function(_0x27f071){return _0x27f071;});}return null;};}function removeEntity(_0x52ce98,_0x3561b0){return function(_0x5081c4){if(_0x5081c4){return _0x5081c4[_0xd73b('0x26')]()[_0xd73b('0x27')](function(){var _0x4e4ee7=_0x5081c4[_0xd73b('0x28')]({'plain':!![]});var _0x164c29=_0xd73b('0x29');return db[_0xd73b('0x2a')][_0xd73b('0x26')]({'where':{'type':_0x164c29,'resourceId':_0x4e4ee7['id']}})['then'](function(){return _0x5081c4;});})[_0xd73b('0x27')](function(){_0x52ce98[_0xd73b('0x1c')](0xcc)[_0xd73b('0x1d')]();});}};}function handleEntityNotFound(_0xb6a6a2,_0x2785e4){return function(_0x3fe9e4){if(!_0x3fe9e4){_0xb6a6a2['sendStatus'](0x194);}return _0x3fe9e4;};}function handleError(_0x222e08,_0xb0a73f){_0xb0a73f=_0xb0a73f||0x1f4;return function(_0x19e166){logger[_0xd73b('0x2b')](_0x19e166[_0xd73b('0x2c')]);if(_0x19e166[_0xd73b('0x2d')]){delete _0x19e166['name'];}_0x222e08['status'](_0xb0a73f)['send'](_0x19e166);};}exports[_0xd73b('0x2e')]=function(_0x3e0e8d,_0x2f9842){var _0x3de1ce={},_0x4bd1b2={},_0x534887={'count':0x0,'rows':[]};var _0x5d3f9e=_[_0xd73b('0x2f')](db[_0xd73b('0x30')][_0xd73b('0x31')],function(_0x591d09){return{'name':_0x591d09['fieldName'],'type':_0x591d09['type'][_0xd73b('0x32')]};});_0x4bd1b2[_0xd73b('0x33')]=_[_0xd73b('0x2f')](_0x5d3f9e,_0xd73b('0x2d'));_0x4bd1b2['query']=_[_0xd73b('0x34')](_0x3e0e8d[_0xd73b('0x35')]);_0x4bd1b2[_0xd73b('0x36')]=_[_0xd73b('0x37')](_0x4bd1b2[_0xd73b('0x33')],_0x4bd1b2['query']);_0x3de1ce[_0xd73b('0x38')]=_[_0xd73b('0x37')](_0x4bd1b2[_0xd73b('0x33')],qs[_0xd73b('0x39')](_0x3e0e8d[_0xd73b('0x35')][_0xd73b('0x39')]));_0x3de1ce[_0xd73b('0x38')]=_0x3de1ce[_0xd73b('0x38')]['length']?_0x3de1ce['attributes']:_0x4bd1b2['model'];if(!_0x3e0e8d[_0xd73b('0x35')]['hasOwnProperty'](_0xd73b('0x3a'))){_0x3de1ce[_0xd73b('0x3b')]=qs[_0xd73b('0x3b')](_0x3e0e8d['query'][_0xd73b('0x3b')]);_0x3de1ce['offset']=qs[_0xd73b('0x20')](_0x3e0e8d[_0xd73b('0x35')][_0xd73b('0x20')]);}_0x3de1ce[_0xd73b('0x3c')]=qs['sort'](_0x3e0e8d[_0xd73b('0x35')][_0xd73b('0x3d')]);_0x3de1ce['where']=qs['filters'](_[_0xd73b('0x3e')](_0x3e0e8d[_0xd73b('0x35')],_0x4bd1b2[_0xd73b('0x36')]),_0x5d3f9e);if(_0x3e0e8d[_0xd73b('0x35')]['filter']){_0x3de1ce[_0xd73b('0x3f')]=_[_0xd73b('0x40')](_0x3de1ce[_0xd73b('0x3f')],{'$or':_['map'](_0x5d3f9e,function(_0x529347){if(_0x529347['type']!=='VIRTUAL'){var _0x4120e2={};_0x4120e2[_0x529347[_0xd73b('0x2d')]]={'$like':'%'+_0x3e0e8d['query']['filter']+'%'};return _0x4120e2;}})});}_0x3de1ce=_[_0xd73b('0x40')]({},_0x3de1ce,_0x3e0e8d['options']);var _0x2c1194={'where':_0x3de1ce[_0xd73b('0x3f')]};return db[_0xd73b('0x30')][_0xd73b('0x21')](_0x2c1194)['then'](function(_0x4a6aa2){_0x534887[_0xd73b('0x21')]=_0x4a6aa2;if(_0x3e0e8d[_0xd73b('0x35')][_0xd73b('0x41')]){_0x3de1ce[_0xd73b('0x42')]=[{'all':!![]}];}return db[_0xd73b('0x30')][_0xd73b('0x43')](_0x3de1ce);})[_0xd73b('0x27')](function(_0x56a9ff){_0x534887[_0xd73b('0x44')]=_0x56a9ff;return _0x534887;})[_0xd73b('0x27')](respondWithFilteredResult(_0x2f9842,_0x3de1ce))[_0xd73b('0x45')](handleError(_0x2f9842,null));};exports[_0xd73b('0x46')]=function(_0x568b77,_0xeb5447){var _0x484dea={'raw':!![],'where':{'id':_0x568b77[_0xd73b('0x47')]['id']}},_0x30fb14={};_0x30fb14[_0xd73b('0x33')]=_[_0xd73b('0x34')](db[_0xd73b('0x30')][_0xd73b('0x31')]);_0x30fb14[_0xd73b('0x35')]=_[_0xd73b('0x34')](_0x568b77[_0xd73b('0x35')]);_0x30fb14[_0xd73b('0x36')]=_[_0xd73b('0x37')](_0x30fb14['model'],_0x30fb14[_0xd73b('0x35')]);_0x484dea[_0xd73b('0x38')]=_[_0xd73b('0x37')](_0x30fb14[_0xd73b('0x33')],qs['fields'](_0x568b77['query'][_0xd73b('0x39')]));_0x484dea[_0xd73b('0x38')]=_0x484dea[_0xd73b('0x38')][_0xd73b('0x48')]?_0x484dea[_0xd73b('0x38')]:_0x30fb14[_0xd73b('0x33')];if(_0x568b77['query'][_0xd73b('0x41')]){_0x484dea[_0xd73b('0x42')]=[{'all':!![]}];}_0x484dea=_[_0xd73b('0x40')]({},_0x484dea,_0x568b77['options']);return db['MailQueue'][_0xd73b('0x49')](_0x484dea)[_0xd73b('0x27')](handleEntityNotFound(_0xeb5447,null))['then'](respondWithResult(_0xeb5447,null))[_0xd73b('0x45')](handleError(_0xeb5447,null));};exports[_0xd73b('0x4a')]=function(_0x5c48c0,_0x4add6e){return db[_0xd73b('0x30')][_0xd73b('0x4a')](_0x5c48c0['body'],{})[_0xd73b('0x27')](function(_0x5350bc){var _0x5c9726=_0x5c48c0['user']['get']({'plain':!![]});if(!_0x5c9726)throw new Error(_0xd73b('0x4b'));if(_0x5c9726['role']==='user'){var _0x41091d=_0x5350bc['get']({'plain':!![]});var _0x2face='MailQueues';return db['UserProfileSection'][_0xd73b('0x49')]({'where':{'name':_0x2face,'userProfileId':_0x5c9726[_0xd73b('0x4c')]},'raw':!![]})[_0xd73b('0x27')](function(_0x2afef0){if(_0x2afef0&&_0x2afef0[_0xd73b('0x4d')]===0x0){return db[_0xd73b('0x2a')][_0xd73b('0x4a')]({'name':_0x41091d[_0xd73b('0x2d')],'resourceId':_0x41091d['id'],'type':_0x2afef0[_0xd73b('0x2d')],'sectionId':_0x2afef0['id']},{})[_0xd73b('0x27')](function(){return _0x5350bc;});}else{return _0x5350bc;}})['catch'](function(_0x5ee74f){logger[_0xd73b('0x2b')](_0xd73b('0x4e'),_0x5ee74f);throw _0x5ee74f;});}return _0x5350bc;})[_0xd73b('0x27')](respondWithResult(_0x4add6e,0xc9))[_0xd73b('0x45')](handleError(_0x4add6e,null));};exports['update']=function(_0x381f07,_0x18156b){if(_0x381f07[_0xd73b('0x4f')]['id']){delete _0x381f07[_0xd73b('0x4f')]['id'];}return db['MailQueue'][_0xd73b('0x49')]({'where':{'id':_0x381f07['params']['id']}})[_0xd73b('0x27')](handleEntityNotFound(_0x18156b,null))[_0xd73b('0x27')](saveUpdates(_0x381f07[_0xd73b('0x4f')],null))[_0xd73b('0x27')](respondWithResult(_0x18156b,null))['catch'](handleError(_0x18156b,null));};exports[_0xd73b('0x26')]=function(_0x2931c5,_0x3d2ce7){return db[_0xd73b('0x30')][_0xd73b('0x49')]({'where':{'id':_0x2931c5[_0xd73b('0x47')]['id']}})[_0xd73b('0x27')](handleEntityNotFound(_0x3d2ce7,null))['then'](removeEntity(_0x3d2ce7,null))[_0xd73b('0x45')](handleError(_0x3d2ce7,null));};exports[_0xd73b('0x50')]=function(_0x16692d,_0x5b5513){return db[_0xd73b('0x30')][_0xd73b('0x50')]()['then'](respondWithResult(_0x5b5513,null))[_0xd73b('0x45')](handleError(_0x5b5513,null));};exports['getMembers']=function(_0x26f5b7,_0x51b24c,_0x32eb29){var _0x39dd6f={'raw':!![],'where':{}},_0xb55c4a={},_0x2381c9;return db[_0xd73b('0x30')][_0xd73b('0x51')]({'where':{'id':_0x26f5b7['params']['id']}})[_0xd73b('0x27')](handleEntityNotFound(_0x51b24c,null))['then'](function(_0x275001){if(_0x275001){_0x2381c9=_0x275001['get']({'plain':!![]});_0xb55c4a[_0xd73b('0x33')]=_[_0xd73b('0x34')](db['UserMailQueue'][_0xd73b('0x31')]);_0xb55c4a['query']=_['keys'](_0x26f5b7[_0xd73b('0x35')]);_0xb55c4a[_0xd73b('0x36')]=_['intersection'](_0xb55c4a['model'],_0xb55c4a[_0xd73b('0x35')]);_0x39dd6f[_0xd73b('0x38')]=_[_0xd73b('0x37')](_0xb55c4a[_0xd73b('0x33')],qs['fields'](_0x26f5b7['query'][_0xd73b('0x39')]));_0x39dd6f[_0xd73b('0x38')]=_0x39dd6f[_0xd73b('0x38')][_0xd73b('0x48')]?_0x39dd6f['attributes']:_0xb55c4a[_0xd73b('0x33')];if(!_0x26f5b7['query']['hasOwnProperty'](_0xd73b('0x3a'))){_0x39dd6f[_0xd73b('0x3b')]=qs[_0xd73b('0x3b')](_0x26f5b7[_0xd73b('0x35')][_0xd73b('0x3b')]);_0x39dd6f[_0xd73b('0x20')]=qs[_0xd73b('0x20')](_0x26f5b7[_0xd73b('0x35')][_0xd73b('0x20')]);}_0x39dd6f[_0xd73b('0x3c')]=qs['sort'](_0x26f5b7[_0xd73b('0x35')]['sort']);_0x39dd6f[_0xd73b('0x3f')]=qs[_0xd73b('0x36')](_[_0xd73b('0x3e')](_0x26f5b7[_0xd73b('0x35')],_0xb55c4a[_0xd73b('0x36')]));_0x39dd6f['where'][_0xd73b('0x52')]=_0x275001['id'];if(_0x26f5b7[_0xd73b('0x35')][_0xd73b('0x53')]){_0x39dd6f['where']=_[_0xd73b('0x40')](_0x39dd6f[_0xd73b('0x3f')],{'$or':_[_0xd73b('0x2f')](_0x39dd6f['attributes'],function(_0x306254){var _0x2cdf0e={};_0x2cdf0e[_0x306254]={'$like':'%'+_0x26f5b7[_0xd73b('0x35')][_0xd73b('0x53')]+'%'};return _0x2cdf0e;})});}_0x39dd6f=_['merge']({},_0x39dd6f,_0x26f5b7[_0xd73b('0x54')]);return db[_0xd73b('0x55')][_0xd73b('0x43')](_0x39dd6f);}})[_0xd73b('0x27')](function(_0x3a9689){if(_0x3a9689){return db['User'][_0xd73b('0x56')]({'where':{'id':_[_0xd73b('0x2f')](_0x3a9689,_0xd73b('0x57')),'role':'agent'},'attributes':['id','name',_0xd73b('0x58'),_0xd73b('0x59'),_0xd73b('0x5a')]});}})['then'](function(_0xa1e98e){if(_0xa1e98e){return{'count':_0xa1e98e[_0xd73b('0x21')],'rows':_['map'](_0xa1e98e[_0xd73b('0x44')],function(_0x30b041){return{'membername':_0x30b041['name'],'UserId':_0x30b041['id'],'queue_name':_0x2381c9[_0xd73b('0x2d')],'MailQueueId':_0x2381c9['id'],'interface':util[_0xd73b('0x5b')](_0xd73b('0x5c'),_0xd73b('0x5d'),_0x30b041['name']),'penalty':0x0,'paused':_0x30b041[_0xd73b('0x58')],'createdAt':_0x30b041[_0xd73b('0x5a')],'updatedAt':_0x30b041['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x51b24c,_0x39dd6f))[_0xd73b('0x45')](handleError(_0x51b24c,null));};exports[_0xd73b('0x5e')]=function(_0x1a81cb,_0x35062e,_0x5230e7){var _0x3c6ae9={};var _0x45258b={};var _0x57c5bc;var _0x45cff2;return db[_0xd73b('0x30')]['findOne']({'where':{'id':_0x1a81cb[_0xd73b('0x47')]['id']}})['then'](handleEntityNotFound(_0x35062e,null))[_0xd73b('0x27')](function(_0xe06b11){if(_0xe06b11){_0x57c5bc=_0xe06b11;_0x45258b['model']=_[_0xd73b('0x34')](db[_0xd73b('0x5f')][_0xd73b('0x31')]);_0x45258b[_0xd73b('0x35')]=_['keys'](_0x1a81cb[_0xd73b('0x35')]);_0x45258b['filters']=_[_0xd73b('0x37')](_0x45258b['model'],_0x45258b[_0xd73b('0x35')]);_0x3c6ae9[_0xd73b('0x38')]=_[_0xd73b('0x37')](_0x45258b[_0xd73b('0x33')],qs['fields'](_0x1a81cb[_0xd73b('0x35')][_0xd73b('0x39')]));_0x3c6ae9[_0xd73b('0x38')]=_0x3c6ae9[_0xd73b('0x38')][_0xd73b('0x48')]?_0x3c6ae9[_0xd73b('0x38')]:_0x45258b['model'];_0x3c6ae9['order']=qs[_0xd73b('0x3d')](_0x1a81cb['query'][_0xd73b('0x3d')]);_0x3c6ae9[_0xd73b('0x3f')]=qs[_0xd73b('0x36')](_[_0xd73b('0x3e')](_0x1a81cb[_0xd73b('0x35')],_0x45258b[_0xd73b('0x36')]));if(_0x1a81cb[_0xd73b('0x35')][_0xd73b('0x53')]){_0x3c6ae9[_0xd73b('0x3f')]=_[_0xd73b('0x40')](_0x3c6ae9[_0xd73b('0x3f')],{'$or':_[_0xd73b('0x2f')](_0x3c6ae9[_0xd73b('0x38')],function(_0x23305a){var _0xe8f84={};_0xe8f84[_0x23305a]={'$like':'%'+_0x1a81cb[_0xd73b('0x35')][_0xd73b('0x53')]+'%'};return _0xe8f84;})});}_0x3c6ae9=_[_0xd73b('0x40')]({},_0x3c6ae9,_0x1a81cb[_0xd73b('0x54')]);return _0x57c5bc[_0xd73b('0x5e')](_0x3c6ae9);}})['then'](function(_0x5bcd4e){if(_0x5bcd4e){_0x45cff2=_0x5bcd4e[_0xd73b('0x48')];if(!_0x1a81cb[_0xd73b('0x35')]['hasOwnProperty'](_0xd73b('0x3a'))){_0x3c6ae9[_0xd73b('0x3b')]=qs[_0xd73b('0x3b')](_0x1a81cb[_0xd73b('0x35')][_0xd73b('0x3b')]);_0x3c6ae9[_0xd73b('0x20')]=qs['offset'](_0x1a81cb['query']['offset']);}return _0x57c5bc[_0xd73b('0x5e')](_0x3c6ae9);}})['then'](function(_0x614e6c){if(_0x614e6c){return _0x614e6c?{'count':_0x45cff2,'rows':_0x614e6c}:null;}})[_0xd73b('0x27')](respondWithResult(_0x35062e,null))[_0xd73b('0x45')](handleError(_0x35062e,null));};exports['addTeams']=function(_0x390332,_0x5c17eb,_0x488b2d){var _0x39c0e4=_0x390332[_0xd73b('0x4f')]['ids'];return db[_0xd73b('0x5f')][_0xd73b('0x43')]({'where':{'id':_0x39c0e4},'attributes':['id'],'include':[{'model':db[_0xd73b('0x60')],'as':_0xd73b('0x61'),'attributes':['id',_0xd73b('0x2d'),'online',_0xd73b('0x62'),'interface'],'raw':!![]}]})[_0xd73b('0x27')](function(_0x572064){if(_0x572064){var _0x330f61=_[_0xd73b('0x63')](_0x572064,function(_0x5a50d5){var _0x221dd5=_0x5a50d5[_0xd73b('0x28')]({'plain':!![]});return _0x221dd5[_0xd73b('0x61')];});return db[_0xd73b('0x30')][_0xd73b('0x49')]({'where':{'id':_0x390332['params']['id']}})[_0xd73b('0x27')](function(_0x189e2e){return db['sequelize'][_0xd73b('0x64')](function(_0x1c2337){return _0x189e2e[_0xd73b('0x65')](_0x39c0e4,{'transaction':_0x1c2337})[_0xd73b('0x27')](function(){return BPromise['each'](_0x330f61,function(_0xfae02b){return db['UserMailQueue'][_0xd73b('0x66')]({'where':{'UserId':_0xfae02b['id'],'MailQueueId':_0x390332[_0xd73b('0x47')]['id']},'transaction':_0x1c2337});});})['then'](function(){_0x330f61[_0xd73b('0x67')](function(_0x1f95b4){socket['emit'](_0xd73b('0x68'),{'UserId':_0x1f95b4['id'],'MailQueueId':_0x189e2e['id']});});});});});}})['then'](respondWithStatusCode(_0x5c17eb,null))[_0xd73b('0x45')](handleError(_0x5c17eb,null));};exports[_0xd73b('0x69')]=function(_0x5373e9,_0x441327,_0x2ec86b){return db['Team'][_0xd73b('0x43')]({'where':{'id':_0x5373e9[_0xd73b('0x35')][_0xd73b('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xd73b('0x60')],'as':_0xd73b('0x61'),'attributes':['id'],'raw':!![]}]})[_0xd73b('0x27')](handleEntityNotFound(_0x441327,null))[_0xd73b('0x27')](function(_0x25c791){var _0x160200=_[_0xd73b('0x2f')](_0x25c791,'id');var _0x28efd0=[];var _0x137ec8=[];var _0xd73ea4=squel[_0xd73b('0x6b')]();_0xd73ea4[_0xd73b('0x6c')](_0xd73b('0x6d'))['from'](_0xd73b('0x6e'),'tq')['join'](_0xd73b('0x6f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd73b('0x3f')](_0xd73b('0x70'),_0x5373e9[_0xd73b('0x47')]['id']);for(var _0x3cb11e=0x0;_0x3cb11e<_0x25c791[_0xd73b('0x48')];_0x3cb11e+=0x1){let _0x4fdca0=_0x25c791[_0x3cb11e];for(var _0x5b87ba=0x0;_0x5b87ba<_0x4fdca0['Agents']['length'];_0x5b87ba+=0x1){let _0x15de54=_0x4fdca0['Agents'][_0x5b87ba];var _0x4bace0=_0xd73ea4['clone']();_0x4bace0['where']('ut.UserId\x20=\x20?',_0x15de54['id']);_0x137ec8['push'](db[_0xd73b('0x71')]['query'](_0x4bace0['toString'](),{'type':db[_0xd73b('0x71')][_0xd73b('0x72')][_0xd73b('0x73')]})[_0xd73b('0x27')](function(_0x3acb34){if(_0x3acb34[_0xd73b('0x48')]===0x1){return _0x15de54['id'];}else{var _0x24272d=_['every'](_[_0xd73b('0x2f')](_0x3acb34,'TeamId'),function(_0x220643){return _[_0xd73b('0x74')](_0x160200,_0x220643);});if(_0x24272d){return _0x15de54['id'];}}}));}}return BPromise['all'](_0x137ec8)['then'](function(_0x4e62c8){_0x28efd0=_(_0x28efd0)[_0xd73b('0x75')](_0x4e62c8)['compact']()[_0xd73b('0x76')]();return db[_0xd73b('0x30')][_0xd73b('0x49')]({'where':{'id':_0x5373e9[_0xd73b('0x47')]['id']}})[_0xd73b('0x27')](function(_0x4c0d16){return db[_0xd73b('0x71')][_0xd73b('0x64')](function(_0x139da1){return _0x4c0d16[_0xd73b('0x69')](_0x5373e9[_0xd73b('0x35')][_0xd73b('0x6a')],{'transaction':_0x139da1})[_0xd73b('0x27')](function(){if(!_[_0xd73b('0x77')](_0x28efd0)){return _0x4c0d16[_0xd73b('0x78')](_0x28efd0,{'transaction':_0x139da1});}})['then'](function(){_0x28efd0[_0xd73b('0x67')](function(_0x43d544){socket['emit'](_0xd73b('0x79'),{'UserId':_0x43d544,'MailQueueId':_0x4c0d16['id']});});});});});});})[_0xd73b('0x27')](respondWithStatusCode(_0x441327,null))[_0xd73b('0x45')](handleError(_0x441327,null));};exports['addAgents']=function(_0x318dba,_0x10e289,_0x405b60){return db['MailQueue']['find']({'where':{'id':_0x318dba[_0xd73b('0x47')]['id']}})[_0xd73b('0x27')](handleEntityNotFound(_0x10e289,null))[_0xd73b('0x27')](function(_0x10eaff){if(_0x10eaff){return _0x10eaff[_0xd73b('0x7a')](_0x318dba['body'][_0xd73b('0x6a')],_[_0xd73b('0x7b')](_0x318dba[_0xd73b('0x4f')],[_0xd73b('0x6a'),'id'])||{})[_0xd73b('0x7c')](function(_0x18354f){for(var _0x349f43=0x0;_0x349f43<_0x318dba[_0xd73b('0x4f')][_0xd73b('0x6a')][_0xd73b('0x48')];_0x349f43+=0x1){socket['emit'](_0xd73b('0x68'),{'UserId':Number(_0x318dba[_0xd73b('0x4f')]['ids'][_0x349f43]),'MailQueueId':Number(_0x318dba[_0xd73b('0x47')]['id'])});}return _0x18354f;});}})['then'](respondWithResult(_0x10e289,null))[_0xd73b('0x45')](handleError(_0x10e289,null));};exports['removeAgents']=function(_0x2d3f1d,_0x4de56c,_0x2fcf0d){return db['MailQueue'][_0xd73b('0x49')]({'where':{'id':_0x2d3f1d[_0xd73b('0x47')]['id']}})[_0xd73b('0x27')](handleEntityNotFound(_0x4de56c,null))[_0xd73b('0x27')](function(_0x26b410){if(_0x26b410){return _0x26b410[_0xd73b('0x78')](_0x2d3f1d[_0xd73b('0x35')][_0xd73b('0x6a')])['then'](function(){if(_[_0xd73b('0x7d')](_0x2d3f1d['query'][_0xd73b('0x6a')])){for(var _0x5bec81=0x0;_0x5bec81<_0x2d3f1d[_0xd73b('0x35')][_0xd73b('0x6a')][_0xd73b('0x48')];_0x5bec81+=0x1){socket[_0xd73b('0x7e')](_0xd73b('0x79'),{'UserId':Number(_0x2d3f1d[_0xd73b('0x35')]['ids'][_0x5bec81]),'MailQueueId':Number(_0x2d3f1d[_0xd73b('0x47')]['id'])});}}else{socket['emit'](_0xd73b('0x79'),{'UserId':Number(_0x2d3f1d[_0xd73b('0x35')][_0xd73b('0x6a')]),'MailQueueId':Number(_0x2d3f1d[_0xd73b('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x4de56c,null))[_0xd73b('0x45')](handleError(_0x4de56c,null));};exports['getAgents']=function(_0x4f5979,_0x26ec10,_0x12fe93){var _0x5db7f6={};var _0x54f5d0={};var _0x4e9edb;var _0x25287b;return db[_0xd73b('0x30')][_0xd73b('0x51')]({'where':{'id':_0x4f5979['params']['id']}})[_0xd73b('0x27')](handleEntityNotFound(_0x26ec10,null))[_0xd73b('0x27')](function(_0x5e559b){if(_0x5e559b){_0x4e9edb=_0x5e559b;_0x54f5d0['model']=_['keys'](db[_0xd73b('0x60')][_0xd73b('0x31')]);_0x54f5d0['query']=_[_0xd73b('0x34')](_0x4f5979[_0xd73b('0x35')]);_0x54f5d0[_0xd73b('0x36')]=_['intersection'](_0x54f5d0['model'],_0x54f5d0[_0xd73b('0x35')]);_0x5db7f6['attributes']=_['intersection'](_0x54f5d0['model'],qs[_0xd73b('0x39')](_0x4f5979[_0xd73b('0x35')][_0xd73b('0x39')]));_0x5db7f6[_0xd73b('0x38')]=_0x5db7f6['attributes'][_0xd73b('0x48')]?_0x5db7f6[_0xd73b('0x38')]:_0x54f5d0[_0xd73b('0x33')];_0x5db7f6['order']=qs[_0xd73b('0x3d')](_0x4f5979['query'][_0xd73b('0x3d')]);_0x5db7f6[_0xd73b('0x3f')]=qs[_0xd73b('0x36')](_['pick'](_0x4f5979['query'],_0x54f5d0[_0xd73b('0x36')]));if(_0x4f5979[_0xd73b('0x35')][_0xd73b('0x53')]){_0x5db7f6[_0xd73b('0x3f')]=_[_0xd73b('0x40')](_0x5db7f6[_0xd73b('0x3f')],{'$or':_['map'](_0x5db7f6[_0xd73b('0x38')],function(_0x4796c7){var _0x25d6b9={};_0x25d6b9[_0x4796c7]={'$like':'%'+_0x4f5979['query'][_0xd73b('0x53')]+'%'};return _0x25d6b9;})});}_0x5db7f6=_[_0xd73b('0x40')]({},_0x5db7f6,_0x4f5979[_0xd73b('0x54')]);return _0x4e9edb[_0xd73b('0x7f')](_0x5db7f6);}})['then'](function(_0x2b6de7){if(_0x2b6de7){_0x25287b=_0x2b6de7[_0xd73b('0x48')];if(!_0x4f5979['query']['hasOwnProperty']('nolimit')){_0x5db7f6[_0xd73b('0x3b')]=qs[_0xd73b('0x3b')](_0x4f5979[_0xd73b('0x35')][_0xd73b('0x3b')]);_0x5db7f6['offset']=qs[_0xd73b('0x20')](_0x4f5979[_0xd73b('0x35')][_0xd73b('0x20')]);}return _0x4e9edb[_0xd73b('0x7f')](_0x5db7f6);}})[_0xd73b('0x27')](function(_0x5214d8){if(_0x5214d8){return _0x5214d8?{'count':_0x25287b,'rows':_0x5214d8}:null;}})[_0xd73b('0x27')](respondWithResult(_0x26ec10,null))[_0xd73b('0x45')](handleError(_0x26ec10,null));}; \ No newline at end of file +var _0xe920=['hasOwnProperty','MailQueueId','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','rows','format','Team','pick','getTeams','addTeams','ids','online','flatMap','get','Agents','sequelize','transaction','findOrCreate','forEach','emit','userMailQueue:save','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','removeTeams','userMailQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./mailQueue.socket','register','end','status','offset','undefined','limit','set','Content-Range','save','update','then','MailQueues','sendStatus','error','stack','name','send','index','MailQueue','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','count','includeAll','include','catch','show','params','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','findOne','UserMailQueue'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe920,0xbe));var _0x0e92=function(_0x38c632,_0x14e8e6){_0x38c632=_0x38c632-0x0;var _0x12737e=_0xe920[_0x38c632];return _0x12737e;};'use strict';var emlformat=require(_0x0e92('0x0'));var rimraf=require(_0x0e92('0x1'));var zipdir=require(_0x0e92('0x2'));var jsonpatch=require(_0x0e92('0x3'));var rp=require(_0x0e92('0x4'));var moment=require(_0x0e92('0x5'));var BPromise=require(_0x0e92('0x6'));var Mustache=require(_0x0e92('0x7'));var util=require(_0x0e92('0x8'));var path=require(_0x0e92('0x9'));var sox=require('sox');var csv=require(_0x0e92('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0e92('0xb'));var _=require(_0x0e92('0xc'));var squel=require(_0x0e92('0xd'));var crypto=require(_0x0e92('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0e92('0xf'));var toCsv=require(_0x0e92('0xa'));var querystring=require(_0x0e92('0x10'));var Papa=require(_0x0e92('0x11'));var Redis=require(_0x0e92('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e92('0x13'));var logger=require(_0x0e92('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0e92('0x15'));var db=require(_0x0e92('0x16'))['db'];config['redis']=_[_0x0e92('0x17')](config[_0x0e92('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e92('0x19'))(new Redis(config[_0x0e92('0x18')]));require(_0x0e92('0x1a'))[_0x0e92('0x1b')](socket);function respondWithStatusCode(_0x218f02,_0x77fab3){_0x77fab3=_0x77fab3||0xcc;return function(_0x44dcd0){if(_0x44dcd0){return _0x218f02['sendStatus'](_0x77fab3);}return _0x218f02['status'](_0x77fab3)[_0x0e92('0x1c')]();};}function respondWithResult(_0x211716,_0x4f1e28){_0x4f1e28=_0x4f1e28||0xc8;return function(_0x4f4c4a){if(_0x4f4c4a){return _0x211716[_0x0e92('0x1d')](_0x4f1e28)['json'](_0x4f4c4a);}};}function respondWithFilteredResult(_0x9ecd13,_0x1b1d08){return function(_0x3316a5){if(_0x3316a5){var _0x46aa84=typeof _0x1b1d08[_0x0e92('0x1e')]===_0x0e92('0x1f')&&typeof _0x1b1d08[_0x0e92('0x20')]==='undefined';var _0x1412ef=_0x3316a5['count'];var _0x475ed2=_0x46aa84?0x0:_0x1b1d08['offset'];var _0x59be04=_0x46aa84?_0x3316a5['count']:_0x1b1d08[_0x0e92('0x1e')]+_0x1b1d08['limit'];var _0x433c05;if(_0x59be04>=_0x1412ef){_0x59be04=_0x1412ef;_0x433c05=0xc8;}else{_0x433c05=0xce;}_0x9ecd13['status'](_0x433c05);return _0x9ecd13[_0x0e92('0x21')](_0x0e92('0x22'),_0x475ed2+'-'+_0x59be04+'/'+_0x1412ef)['json'](_0x3316a5);}return null;};}function patchUpdates(_0x3f2105){return function(_0x475cc2){try{jsonpatch['apply'](_0x475cc2,_0x3f2105,!![]);}catch(_0x3a18e1){return BPromise['reject'](_0x3a18e1);}return _0x475cc2[_0x0e92('0x23')]();};}function saveUpdates(_0x40375c,_0xedeb4e){return function(_0x22c53b){if(_0x22c53b){return _0x22c53b[_0x0e92('0x24')](_0x40375c)[_0x0e92('0x25')](function(_0xc34ae4){return _0xc34ae4;});}return null;};}function removeEntity(_0x42c5bc,_0x32d258){return function(_0x1ea0dc){if(_0x1ea0dc){return _0x1ea0dc['destroy']()[_0x0e92('0x25')](function(){var _0x47f156=_0x1ea0dc['get']({'plain':!![]});var _0x28463d=_0x0e92('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x28463d,'resourceId':_0x47f156['id']}})[_0x0e92('0x25')](function(){return _0x1ea0dc;});})[_0x0e92('0x25')](function(){_0x42c5bc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x140666,_0x329c5f){return function(_0xc3d81d){if(!_0xc3d81d){_0x140666[_0x0e92('0x27')](0x194);}return _0xc3d81d;};}function handleError(_0x36538b,_0x10000e){_0x10000e=_0x10000e||0x1f4;return function(_0x3139bf){logger[_0x0e92('0x28')](_0x3139bf[_0x0e92('0x29')]);if(_0x3139bf[_0x0e92('0x2a')]){delete _0x3139bf[_0x0e92('0x2a')];}_0x36538b[_0x0e92('0x1d')](_0x10000e)[_0x0e92('0x2b')](_0x3139bf);};}exports[_0x0e92('0x2c')]=function(_0x4201ab,_0x41d7e5){var _0x3542fa={},_0x1ca84b={},_0x3758f0={'count':0x0,'rows':[]};var _0xe043a5=_['map'](db[_0x0e92('0x2d')][_0x0e92('0x2e')],function(_0x5b5e46){return{'name':_0x5b5e46['fieldName'],'type':_0x5b5e46[_0x0e92('0x2f')][_0x0e92('0x30')]};});_0x1ca84b[_0x0e92('0x31')]=_[_0x0e92('0x32')](_0xe043a5,_0x0e92('0x2a'));_0x1ca84b[_0x0e92('0x33')]=_[_0x0e92('0x34')](_0x4201ab[_0x0e92('0x33')]);_0x1ca84b['filters']=_[_0x0e92('0x35')](_0x1ca84b[_0x0e92('0x31')],_0x1ca84b[_0x0e92('0x33')]);_0x3542fa[_0x0e92('0x36')]=_[_0x0e92('0x35')](_0x1ca84b[_0x0e92('0x31')],qs[_0x0e92('0x37')](_0x4201ab[_0x0e92('0x33')][_0x0e92('0x37')]));_0x3542fa['attributes']=_0x3542fa['attributes'][_0x0e92('0x38')]?_0x3542fa[_0x0e92('0x36')]:_0x1ca84b['model'];if(!_0x4201ab[_0x0e92('0x33')]['hasOwnProperty'](_0x0e92('0x39'))){_0x3542fa['limit']=qs[_0x0e92('0x20')](_0x4201ab['query'][_0x0e92('0x20')]);_0x3542fa[_0x0e92('0x1e')]=qs[_0x0e92('0x1e')](_0x4201ab['query']['offset']);}_0x3542fa[_0x0e92('0x3a')]=qs[_0x0e92('0x3b')](_0x4201ab[_0x0e92('0x33')]['sort']);_0x3542fa[_0x0e92('0x3c')]=qs['filters'](_['pick'](_0x4201ab[_0x0e92('0x33')],_0x1ca84b[_0x0e92('0x3d')]),_0xe043a5);if(_0x4201ab['query'][_0x0e92('0x3e')]){_0x3542fa['where']=_[_0x0e92('0x3f')](_0x3542fa[_0x0e92('0x3c')],{'$or':_['map'](_0xe043a5,function(_0x14b4ae){if(_0x14b4ae['type']!=='VIRTUAL'){var _0x499e6a={};_0x499e6a[_0x14b4ae[_0x0e92('0x2a')]]={'$like':'%'+_0x4201ab[_0x0e92('0x33')][_0x0e92('0x3e')]+'%'};return _0x499e6a;}})});}_0x3542fa=_[_0x0e92('0x3f')]({},_0x3542fa,_0x4201ab['options']);var _0x563a14={'where':_0x3542fa[_0x0e92('0x3c')]};return db[_0x0e92('0x2d')][_0x0e92('0x40')](_0x563a14)[_0x0e92('0x25')](function(_0x4f242d){_0x3758f0[_0x0e92('0x40')]=_0x4f242d;if(_0x4201ab[_0x0e92('0x33')][_0x0e92('0x41')]){_0x3542fa[_0x0e92('0x42')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x3542fa);})[_0x0e92('0x25')](function(_0x2d44f0){_0x3758f0['rows']=_0x2d44f0;return _0x3758f0;})[_0x0e92('0x25')](respondWithFilteredResult(_0x41d7e5,_0x3542fa))[_0x0e92('0x43')](handleError(_0x41d7e5,null));};exports[_0x0e92('0x44')]=function(_0xbc137f,_0x232eb9){var _0x8a5376={'raw':!![],'where':{'id':_0xbc137f[_0x0e92('0x45')]['id']}},_0x4ebd55={};_0x4ebd55[_0x0e92('0x31')]=_[_0x0e92('0x34')](db['MailQueue'][_0x0e92('0x2e')]);_0x4ebd55[_0x0e92('0x33')]=_[_0x0e92('0x34')](_0xbc137f[_0x0e92('0x33')]);_0x4ebd55[_0x0e92('0x3d')]=_[_0x0e92('0x35')](_0x4ebd55[_0x0e92('0x31')],_0x4ebd55[_0x0e92('0x33')]);_0x8a5376[_0x0e92('0x36')]=_['intersection'](_0x4ebd55['model'],qs[_0x0e92('0x37')](_0xbc137f[_0x0e92('0x33')][_0x0e92('0x37')]));_0x8a5376[_0x0e92('0x36')]=_0x8a5376[_0x0e92('0x36')]['length']?_0x8a5376[_0x0e92('0x36')]:_0x4ebd55[_0x0e92('0x31')];if(_0xbc137f['query']['includeAll']){_0x8a5376[_0x0e92('0x42')]=[{'all':!![]}];}_0x8a5376=_['merge']({},_0x8a5376,_0xbc137f[_0x0e92('0x46')]);return db[_0x0e92('0x2d')][_0x0e92('0x47')](_0x8a5376)[_0x0e92('0x25')](handleEntityNotFound(_0x232eb9,null))[_0x0e92('0x25')](respondWithResult(_0x232eb9,null))['catch'](handleError(_0x232eb9,null));};exports[_0x0e92('0x48')]=function(_0xa90e38,_0x1a8578){return db[_0x0e92('0x2d')][_0x0e92('0x48')](_0xa90e38[_0x0e92('0x49')],{})[_0x0e92('0x25')](function(_0x4a71d1){var _0xaa654a=_0xa90e38[_0x0e92('0x4a')]['get']({'plain':!![]});if(!_0xaa654a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xaa654a[_0x0e92('0x4b')]==='user'){var _0x3c27f0=_0x4a71d1['get']({'plain':!![]});var _0x30b31d=_0x0e92('0x26');return db[_0x0e92('0x4c')][_0x0e92('0x47')]({'where':{'name':_0x30b31d,'userProfileId':_0xaa654a[_0x0e92('0x4d')]},'raw':!![]})[_0x0e92('0x25')](function(_0x1f593d){if(_0x1f593d&&_0x1f593d[_0x0e92('0x4e')]===0x0){return db[_0x0e92('0x4f')]['create']({'name':_0x3c27f0[_0x0e92('0x2a')],'resourceId':_0x3c27f0['id'],'type':_0x1f593d[_0x0e92('0x2a')],'sectionId':_0x1f593d['id']},{})[_0x0e92('0x25')](function(){return _0x4a71d1;});}else{return _0x4a71d1;}})[_0x0e92('0x43')](function(_0x532e18){logger['error'](_0x0e92('0x50'),_0x532e18);throw _0x532e18;});}return _0x4a71d1;})[_0x0e92('0x25')](respondWithResult(_0x1a8578,0xc9))['catch'](handleError(_0x1a8578,null));};exports[_0x0e92('0x24')]=function(_0x4a696c,_0x3ef78a){if(_0x4a696c[_0x0e92('0x49')]['id']){delete _0x4a696c[_0x0e92('0x49')]['id'];}return db[_0x0e92('0x2d')][_0x0e92('0x47')]({'where':{'id':_0x4a696c[_0x0e92('0x45')]['id']}})[_0x0e92('0x25')](handleEntityNotFound(_0x3ef78a,null))[_0x0e92('0x25')](saveUpdates(_0x4a696c[_0x0e92('0x49')],null))[_0x0e92('0x25')](respondWithResult(_0x3ef78a,null))['catch'](handleError(_0x3ef78a,null));};exports[_0x0e92('0x51')]=function(_0x141057,_0x45fe7e){return db[_0x0e92('0x2d')]['find']({'where':{'id':_0x141057['params']['id']}})['then'](handleEntityNotFound(_0x45fe7e,null))[_0x0e92('0x25')](removeEntity(_0x45fe7e,null))[_0x0e92('0x43')](handleError(_0x45fe7e,null));};exports['describe']=function(_0x41f110,_0x1ec439){return db[_0x0e92('0x2d')][_0x0e92('0x52')]()['then'](respondWithResult(_0x1ec439,null))[_0x0e92('0x43')](handleError(_0x1ec439,null));};exports[_0x0e92('0x53')]=function(_0x10353a,_0x5f1719,_0x7e8f83){var _0x3f3c08={'raw':!![],'where':{}},_0x116b25={},_0x33f00c;return db['MailQueue'][_0x0e92('0x54')]({'where':{'id':_0x10353a[_0x0e92('0x45')]['id']}})[_0x0e92('0x25')](handleEntityNotFound(_0x5f1719,null))[_0x0e92('0x25')](function(_0x1cbabe){if(_0x1cbabe){_0x33f00c=_0x1cbabe['get']({'plain':!![]});_0x116b25['model']=_[_0x0e92('0x34')](db[_0x0e92('0x55')][_0x0e92('0x2e')]);_0x116b25[_0x0e92('0x33')]=_[_0x0e92('0x34')](_0x10353a[_0x0e92('0x33')]);_0x116b25['filters']=_['intersection'](_0x116b25[_0x0e92('0x31')],_0x116b25[_0x0e92('0x33')]);_0x3f3c08['attributes']=_['intersection'](_0x116b25[_0x0e92('0x31')],qs[_0x0e92('0x37')](_0x10353a[_0x0e92('0x33')]['fields']));_0x3f3c08['attributes']=_0x3f3c08[_0x0e92('0x36')][_0x0e92('0x38')]?_0x3f3c08[_0x0e92('0x36')]:_0x116b25[_0x0e92('0x31')];if(!_0x10353a[_0x0e92('0x33')][_0x0e92('0x56')](_0x0e92('0x39'))){_0x3f3c08['limit']=qs[_0x0e92('0x20')](_0x10353a['query'][_0x0e92('0x20')]);_0x3f3c08[_0x0e92('0x1e')]=qs[_0x0e92('0x1e')](_0x10353a['query'][_0x0e92('0x1e')]);}_0x3f3c08['order']=qs[_0x0e92('0x3b')](_0x10353a[_0x0e92('0x33')][_0x0e92('0x3b')]);_0x3f3c08[_0x0e92('0x3c')]=qs['filters'](_['pick'](_0x10353a[_0x0e92('0x33')],_0x116b25['filters']));_0x3f3c08[_0x0e92('0x3c')][_0x0e92('0x57')]=_0x1cbabe['id'];if(_0x10353a['query']['filter']){_0x3f3c08[_0x0e92('0x3c')]=_['merge'](_0x3f3c08[_0x0e92('0x3c')],{'$or':_['map'](_0x3f3c08['attributes'],function(_0x3f6da6){var _0x64f354={};_0x64f354[_0x3f6da6]={'$like':'%'+_0x10353a[_0x0e92('0x33')][_0x0e92('0x3e')]+'%'};return _0x64f354;})});}_0x3f3c08=_[_0x0e92('0x3f')]({},_0x3f3c08,_0x10353a['options']);return db[_0x0e92('0x55')][_0x0e92('0x58')](_0x3f3c08);}})[_0x0e92('0x25')](function(_0xfb3937){if(_0xfb3937){return db[_0x0e92('0x59')][_0x0e92('0x5a')]({'where':{'id':_['map'](_0xfb3937,_0x0e92('0x5b')),'role':_0x0e92('0x5c')},'attributes':['id',_0x0e92('0x2a'),_0x0e92('0x5d'),_0x0e92('0x5e'),_0x0e92('0x5f')]});}})[_0x0e92('0x25')](function(_0x32d965){if(_0x32d965){return{'count':_0x32d965[_0x0e92('0x40')],'rows':_[_0x0e92('0x32')](_0x32d965[_0x0e92('0x60')],function(_0x43c894){return{'membername':_0x43c894[_0x0e92('0x2a')],'UserId':_0x43c894['id'],'queue_name':_0x33f00c[_0x0e92('0x2a')],'MailQueueId':_0x33f00c['id'],'interface':util[_0x0e92('0x61')]('%s/%s','SIP',_0x43c894[_0x0e92('0x2a')]),'penalty':0x0,'paused':_0x43c894[_0x0e92('0x5d')],'createdAt':_0x43c894[_0x0e92('0x5f')],'updatedAt':_0x43c894[_0x0e92('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0e92('0x25')](respondWithFilteredResult(_0x5f1719,_0x3f3c08))[_0x0e92('0x43')](handleError(_0x5f1719,null));};exports['getTeams']=function(_0x1387b5,_0x2f6978,_0x4605f2){var _0xbed5ce={};var _0x3fa2a6={};var _0x30798f;var _0x4a6cbf;return db[_0x0e92('0x2d')][_0x0e92('0x54')]({'where':{'id':_0x1387b5[_0x0e92('0x45')]['id']}})[_0x0e92('0x25')](handleEntityNotFound(_0x2f6978,null))['then'](function(_0x14fb76){if(_0x14fb76){_0x30798f=_0x14fb76;_0x3fa2a6[_0x0e92('0x31')]=_[_0x0e92('0x34')](db[_0x0e92('0x62')][_0x0e92('0x2e')]);_0x3fa2a6['query']=_[_0x0e92('0x34')](_0x1387b5[_0x0e92('0x33')]);_0x3fa2a6[_0x0e92('0x3d')]=_['intersection'](_0x3fa2a6[_0x0e92('0x31')],_0x3fa2a6[_0x0e92('0x33')]);_0xbed5ce[_0x0e92('0x36')]=_[_0x0e92('0x35')](_0x3fa2a6['model'],qs[_0x0e92('0x37')](_0x1387b5[_0x0e92('0x33')][_0x0e92('0x37')]));_0xbed5ce[_0x0e92('0x36')]=_0xbed5ce[_0x0e92('0x36')][_0x0e92('0x38')]?_0xbed5ce[_0x0e92('0x36')]:_0x3fa2a6[_0x0e92('0x31')];_0xbed5ce[_0x0e92('0x3a')]=qs['sort'](_0x1387b5[_0x0e92('0x33')][_0x0e92('0x3b')]);_0xbed5ce[_0x0e92('0x3c')]=qs['filters'](_[_0x0e92('0x63')](_0x1387b5['query'],_0x3fa2a6[_0x0e92('0x3d')]));if(_0x1387b5[_0x0e92('0x33')]['filter']){_0xbed5ce[_0x0e92('0x3c')]=_[_0x0e92('0x3f')](_0xbed5ce['where'],{'$or':_['map'](_0xbed5ce[_0x0e92('0x36')],function(_0x5b0b44){var _0x18f4bc={};_0x18f4bc[_0x5b0b44]={'$like':'%'+_0x1387b5[_0x0e92('0x33')][_0x0e92('0x3e')]+'%'};return _0x18f4bc;})});}_0xbed5ce=_[_0x0e92('0x3f')]({},_0xbed5ce,_0x1387b5[_0x0e92('0x46')]);return _0x30798f[_0x0e92('0x64')](_0xbed5ce);}})[_0x0e92('0x25')](function(_0x59b6a9){if(_0x59b6a9){_0x4a6cbf=_0x59b6a9[_0x0e92('0x38')];if(!_0x1387b5[_0x0e92('0x33')][_0x0e92('0x56')](_0x0e92('0x39'))){_0xbed5ce[_0x0e92('0x20')]=qs[_0x0e92('0x20')](_0x1387b5['query'][_0x0e92('0x20')]);_0xbed5ce[_0x0e92('0x1e')]=qs['offset'](_0x1387b5[_0x0e92('0x33')]['offset']);}return _0x30798f[_0x0e92('0x64')](_0xbed5ce);}})[_0x0e92('0x25')](function(_0x4e2f3d){if(_0x4e2f3d){return _0x4e2f3d?{'count':_0x4a6cbf,'rows':_0x4e2f3d}:null;}})[_0x0e92('0x25')](respondWithResult(_0x2f6978,null))[_0x0e92('0x43')](handleError(_0x2f6978,null));};exports[_0x0e92('0x65')]=function(_0x3339b1,_0x4491ea,_0xf4be12){var _0x15b6d2=_0x3339b1[_0x0e92('0x49')][_0x0e92('0x66')];return db[_0x0e92('0x62')][_0x0e92('0x58')]({'where':{'id':_0x15b6d2},'attributes':['id'],'include':[{'model':db[_0x0e92('0x59')],'as':'Agents','attributes':['id',_0x0e92('0x2a'),_0x0e92('0x67'),'voicePause','interface'],'raw':!![]}]})[_0x0e92('0x25')](function(_0x50e00c){if(_0x50e00c){var _0x3554bc=_[_0x0e92('0x68')](_0x50e00c,function(_0x80106){var _0x777e66=_0x80106[_0x0e92('0x69')]({'plain':!![]});return _0x777e66[_0x0e92('0x6a')];});return db[_0x0e92('0x2d')][_0x0e92('0x47')]({'where':{'id':_0x3339b1[_0x0e92('0x45')]['id']}})[_0x0e92('0x25')](function(_0x148e53){return db[_0x0e92('0x6b')][_0x0e92('0x6c')](function(_0x293fdc){return _0x148e53[_0x0e92('0x65')](_0x15b6d2,{'transaction':_0x293fdc})['then'](function(){return BPromise['each'](_0x3554bc,function(_0x585e60){return db[_0x0e92('0x55')][_0x0e92('0x6d')]({'where':{'UserId':_0x585e60['id'],'MailQueueId':_0x3339b1[_0x0e92('0x45')]['id']},'transaction':_0x293fdc});});})[_0x0e92('0x25')](function(){_0x3554bc[_0x0e92('0x6e')](function(_0xa128e5){socket[_0x0e92('0x6f')](_0x0e92('0x70'),{'UserId':_0xa128e5['id'],'MailQueueId':_0x148e53['id']});});});});});}})[_0x0e92('0x25')](respondWithStatusCode(_0x4491ea,null))['catch'](handleError(_0x4491ea,null));};exports['removeTeams']=function(_0x2a7b75,_0x5a854b,_0x1affeb){return db[_0x0e92('0x62')][_0x0e92('0x58')]({'where':{'id':_0x2a7b75['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0e92('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x0e92('0x25')](handleEntityNotFound(_0x5a854b,null))['then'](function(_0x3f6f60){var _0x1d2fe1=_[_0x0e92('0x32')](_0x3f6f60,'id');var _0x2e25ec=[];var _0x38f4a9=[];var _0x32eb0c=squel[_0x0e92('0x71')]();_0x32eb0c[_0x0e92('0x72')](_0x0e92('0x73'))[_0x0e92('0x74')](_0x0e92('0x75'),'tq')[_0x0e92('0x76')](_0x0e92('0x77'),'ut',_0x0e92('0x78'))[_0x0e92('0x3c')](_0x0e92('0x79'),_0x2a7b75['params']['id']);for(var _0x1fada7=0x0;_0x1fada7<_0x3f6f60[_0x0e92('0x38')];_0x1fada7+=0x1){let _0x802848=_0x3f6f60[_0x1fada7];for(var _0x39b726=0x0;_0x39b726<_0x802848[_0x0e92('0x6a')]['length'];_0x39b726+=0x1){let _0x4305cd=_0x802848[_0x0e92('0x6a')][_0x39b726];var _0x4b22a8=_0x32eb0c[_0x0e92('0x7a')]();_0x4b22a8[_0x0e92('0x3c')](_0x0e92('0x7b'),_0x4305cd['id']);_0x38f4a9['push'](db['sequelize'][_0x0e92('0x33')](_0x4b22a8[_0x0e92('0x7c')](),{'type':db[_0x0e92('0x6b')][_0x0e92('0x7d')][_0x0e92('0x7e')]})[_0x0e92('0x25')](function(_0x29f74c){if(_0x29f74c[_0x0e92('0x38')]===0x1){return _0x4305cd['id'];}else{var _0xa8555d=_[_0x0e92('0x7f')](_['map'](_0x29f74c,_0x0e92('0x80')),function(_0x4e3826){return _[_0x0e92('0x81')](_0x1d2fe1,_0x4e3826);});if(_0xa8555d){return _0x4305cd['id'];}}}));}}return BPromise['all'](_0x38f4a9)['then'](function(_0x403d05){_0x2e25ec=_(_0x2e25ec)[_0x0e92('0x82')](_0x403d05)['compact']()['value']();return db['MailQueue'][_0x0e92('0x47')]({'where':{'id':_0x2a7b75['params']['id']}})[_0x0e92('0x25')](function(_0x178c63){return db[_0x0e92('0x6b')][_0x0e92('0x6c')](function(_0x52be59){return _0x178c63[_0x0e92('0x83')](_0x2a7b75[_0x0e92('0x33')][_0x0e92('0x66')],{'transaction':_0x52be59})[_0x0e92('0x25')](function(){if(!_['isEmpty'](_0x2e25ec)){return _0x178c63['removeAgents'](_0x2e25ec,{'transaction':_0x52be59});}})[_0x0e92('0x25')](function(){_0x2e25ec[_0x0e92('0x6e')](function(_0x4f4425){socket[_0x0e92('0x6f')](_0x0e92('0x84'),{'UserId':_0x4f4425,'MailQueueId':_0x178c63['id']});});});});});});})['then'](respondWithStatusCode(_0x5a854b,null))[_0x0e92('0x43')](handleError(_0x5a854b,null));};exports[_0x0e92('0x85')]=function(_0x25c519,_0x4a27eb,_0x49ff9e){return db[_0x0e92('0x2d')][_0x0e92('0x47')]({'where':{'id':_0x25c519['params']['id']}})['then'](handleEntityNotFound(_0x4a27eb,null))[_0x0e92('0x25')](function(_0x41631b){if(_0x41631b){return _0x41631b['addAgents'](_0x25c519[_0x0e92('0x49')]['ids'],_['omit'](_0x25c519[_0x0e92('0x49')],[_0x0e92('0x66'),'id'])||{})[_0x0e92('0x86')](function(_0x2ea3cc){for(var _0x4072a2=0x0;_0x4072a2<_0x25c519[_0x0e92('0x49')][_0x0e92('0x66')]['length'];_0x4072a2+=0x1){socket[_0x0e92('0x6f')](_0x0e92('0x70'),{'UserId':Number(_0x25c519[_0x0e92('0x49')][_0x0e92('0x66')][_0x4072a2]),'MailQueueId':Number(_0x25c519[_0x0e92('0x45')]['id'])});}return _0x2ea3cc;});}})[_0x0e92('0x25')](respondWithResult(_0x4a27eb,null))[_0x0e92('0x43')](handleError(_0x4a27eb,null));};exports[_0x0e92('0x87')]=function(_0xf35906,_0x57aa22,_0x4f8183){return db[_0x0e92('0x2d')][_0x0e92('0x47')]({'where':{'id':_0xf35906[_0x0e92('0x45')]['id']}})[_0x0e92('0x25')](handleEntityNotFound(_0x57aa22,null))[_0x0e92('0x25')](function(_0x41e6ff){if(_0x41e6ff){return _0x41e6ff['removeAgents'](_0xf35906[_0x0e92('0x33')]['ids'])[_0x0e92('0x25')](function(){if(_[_0x0e92('0x88')](_0xf35906[_0x0e92('0x33')][_0x0e92('0x66')])){for(var _0x32dffe=0x0;_0x32dffe<_0xf35906[_0x0e92('0x33')][_0x0e92('0x66')]['length'];_0x32dffe+=0x1){socket[_0x0e92('0x6f')]('userMailQueue:remove',{'UserId':Number(_0xf35906[_0x0e92('0x33')]['ids'][_0x32dffe]),'MailQueueId':Number(_0xf35906[_0x0e92('0x45')]['id'])});}}else{socket[_0x0e92('0x6f')](_0x0e92('0x84'),{'UserId':Number(_0xf35906[_0x0e92('0x33')]['ids']),'MailQueueId':Number(_0xf35906['params']['id'])});}});}})[_0x0e92('0x25')](respondWithStatusCode(_0x57aa22,null))[_0x0e92('0x43')](handleError(_0x57aa22,null));};exports[_0x0e92('0x89')]=function(_0x542cfb,_0x15cedd,_0x30532a){var _0x5bc336={};var _0x3e932f={};var _0x31995f;var _0x14a562;return db[_0x0e92('0x2d')][_0x0e92('0x54')]({'where':{'id':_0x542cfb[_0x0e92('0x45')]['id']}})[_0x0e92('0x25')](handleEntityNotFound(_0x15cedd,null))[_0x0e92('0x25')](function(_0x58bdc6){if(_0x58bdc6){_0x31995f=_0x58bdc6;_0x3e932f['model']=_['keys'](db[_0x0e92('0x59')][_0x0e92('0x2e')]);_0x3e932f[_0x0e92('0x33')]=_['keys'](_0x542cfb[_0x0e92('0x33')]);_0x3e932f['filters']=_[_0x0e92('0x35')](_0x3e932f[_0x0e92('0x31')],_0x3e932f[_0x0e92('0x33')]);_0x5bc336[_0x0e92('0x36')]=_['intersection'](_0x3e932f[_0x0e92('0x31')],qs[_0x0e92('0x37')](_0x542cfb[_0x0e92('0x33')]['fields']));_0x5bc336[_0x0e92('0x36')]=_0x5bc336['attributes'][_0x0e92('0x38')]?_0x5bc336[_0x0e92('0x36')]:_0x3e932f[_0x0e92('0x31')];_0x5bc336[_0x0e92('0x3a')]=qs[_0x0e92('0x3b')](_0x542cfb[_0x0e92('0x33')][_0x0e92('0x3b')]);_0x5bc336[_0x0e92('0x3c')]=qs[_0x0e92('0x3d')](_[_0x0e92('0x63')](_0x542cfb['query'],_0x3e932f[_0x0e92('0x3d')]));if(_0x542cfb[_0x0e92('0x33')]['filter']){_0x5bc336[_0x0e92('0x3c')]=_['merge'](_0x5bc336['where'],{'$or':_[_0x0e92('0x32')](_0x5bc336[_0x0e92('0x36')],function(_0x3c8e1c){var _0x936475={};_0x936475[_0x3c8e1c]={'$like':'%'+_0x542cfb['query'][_0x0e92('0x3e')]+'%'};return _0x936475;})});}_0x5bc336=_[_0x0e92('0x3f')]({},_0x5bc336,_0x542cfb[_0x0e92('0x46')]);return _0x31995f[_0x0e92('0x89')](_0x5bc336);}})[_0x0e92('0x25')](function(_0x5a8039){if(_0x5a8039){_0x14a562=_0x5a8039[_0x0e92('0x38')];if(!_0x542cfb[_0x0e92('0x33')][_0x0e92('0x56')](_0x0e92('0x39'))){_0x5bc336[_0x0e92('0x20')]=qs['limit'](_0x542cfb[_0x0e92('0x33')][_0x0e92('0x20')]);_0x5bc336[_0x0e92('0x1e')]=qs['offset'](_0x542cfb[_0x0e92('0x33')][_0x0e92('0x1e')]);}return _0x31995f[_0x0e92('0x89')](_0x5bc336);}})[_0x0e92('0x25')](function(_0x290bff){if(_0x290bff){return _0x290bff?{'count':_0x14a562,'rows':_0x290bff}:null;}})[_0x0e92('0x25')](respondWithResult(_0x15cedd,null))[_0x0e92('0x43')](handleError(_0x15cedd,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 1bc2b16..dcb7a04 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 _0x1baf=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','save','update','remove'];(function(_0x3d5d0b,_0x43038c){var _0x5075f3=function(_0x225507){while(--_0x225507){_0x3d5d0b['push'](_0x3d5d0b['shift']());}};_0x5075f3(++_0x43038c);}(_0x1baf,0xcc));var _0xf1ba=function(_0xd388e2,_0x4495ad){_0xd388e2=_0xd388e2-0x0;var _0x4dd85a=_0x1baf[_0xd388e2];return _0x4dd85a;};'use strict';var EventEmitter=require(_0xf1ba('0x0'));var MailQueue=require(_0xf1ba('0x1'))['db'][_0xf1ba('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf1ba('0x3'),'afterUpdate':_0xf1ba('0x4'),'afterDestroy':_0xf1ba('0x5')};function emitEvent(_0x53956f){return function(_0x45c6c6,_0x208d0e,_0x289664){MailQueueEvents[_0xf1ba('0x6')](_0x53956f+':'+_0x45c6c6['id'],_0x45c6c6);MailQueueEvents[_0xf1ba('0x6')](_0x53956f,_0x45c6c6);_0x289664(null);};}for(var e in events){if(events[_0xf1ba('0x7')](e)){var event=events[e];MailQueue[_0xf1ba('0x8')](e,emitEvent(event));}}module[_0xf1ba('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x64c3=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5c6c2e,_0x86e980){var _0xd262ac=function(_0x2469a1){while(--_0x2469a1){_0x5c6c2e['push'](_0x5c6c2e['shift']());}};_0xd262ac(++_0x86e980);}(_0x64c3,0x17b));var _0x364c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64c3[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x364c('0x0'));var MailQueue=require(_0x364c('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x364c('0x2')](0x0);var events={'afterCreate':_0x364c('0x3'),'afterUpdate':_0x364c('0x4'),'afterDestroy':_0x364c('0x5')};function emitEvent(_0x948167){return function(_0x279b3c,_0x1608eb,_0x45f7d0){MailQueueEvents[_0x364c('0x6')](_0x948167+':'+_0x279b3c['id'],_0x279b3c);MailQueueEvents['emit'](_0x948167,_0x279b3c);_0x45f7d0(null);};}for(var e in events){if(events[_0x364c('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x364c('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 08cd14c..955ec95 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 _0x440e=['MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define'];(function(_0x9d85c6,_0x481146){var _0x411461=function(_0x3de52c){while(--_0x3de52c){_0x9d85c6['push'](_0x9d85c6['shift']());}};_0x411461(++_0x481146);}(_0x440e,0x12e));var _0xe440=function(_0xd3d5c3,_0x42d2af){_0xd3d5c3=_0xd3d5c3-0x0;var _0x29a808=_0x440e[_0xd3d5c3];return _0x29a808;};'use strict';var _=require(_0xe440('0x0'));var util=require(_0xe440('0x1'));var logger=require(_0xe440('0x2'))(_0xe440('0x3'));var moment=require(_0xe440('0x4'));var BPromise=require('bluebird');var rp=require(_0xe440('0x5'));var fs=require('fs');var path=require(_0xe440('0x6'));var rimraf=require(_0xe440('0x7'));var config=require(_0xe440('0x8'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x7af568,_0x39f5d1){return _0x7af568[_0xe440('0x9')](_0xe440('0xa'),attributes,{'tableName':_0xe440('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6df=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','lodash','util'];(function(_0x41627a,_0x2947f3){var _0x2ee59c=function(_0x487ca9){while(--_0x487ca9){_0x41627a['push'](_0x41627a['shift']());}};_0x2ee59c(++_0x2947f3);}(_0xe6df,0x11c));var _0xfe6d=function(_0x291369,_0xac73ef){_0x291369=_0x291369-0x0;var _0x4ca387=_0xe6df[_0x291369];return _0x4ca387;};'use strict';var _=require(_0xfe6d('0x0'));var util=require(_0xfe6d('0x1'));var logger=require(_0xfe6d('0x2'))(_0xfe6d('0x3'));var moment=require(_0xfe6d('0x4'));var BPromise=require(_0xfe6d('0x5'));var rp=require(_0xfe6d('0x6'));var fs=require('fs');var path=require(_0xfe6d('0x7'));var rimraf=require(_0xfe6d('0x8'));var config=require(_0xfe6d('0x9'));var attributes=require(_0xfe6d('0xa'));module['exports']=function(_0x3cbfae,_0x1456b7){return _0x3cbfae[_0xfe6d('0xb')](_0xfe6d('0xc'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 6a08621..befcb0c 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 _0x4560=['request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','GetMailQueue','MailQueue','findAll','options','where','limit','include','map','model','attributes','info','catch','ShowMailQueue','find','raw','lodash','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','socket.io-emitter','./mailQueue.socket','request','then'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0x4560,0x1d4));var _0x0456=function(_0x4540df,_0x5d6ca8){_0x4540df=_0x4540df-0x0;var _0x293708=_0x4560[_0x4540df];return _0x293708;};'use strict';var _=require(_0x0456('0x0'));var util=require(_0x0456('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0456('0x2'));var logger=require(_0x0456('0x3'))(_0x0456('0x4'));var config=require(_0x0456('0x5'));var jayson=require(_0x0456('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x0456('0x7')](config[_0x0456('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x0456('0x9'))(new Redis(config[_0x0456('0x8')]));require(_0x0456('0xa'))['register'](socket);function respondWithRpcPromise(_0xc28aaf,_0x3a82a2,_0x5dcca1){return new BPromise(function(_0x23c82e,_0x4ce651){return client[_0x0456('0xb')](_0xc28aaf,_0x5dcca1)[_0x0456('0xc')](function(_0x5a85ac){logger['info']('MailQueue,\x20%s,\x20%s',_0x3a82a2,_0x0456('0xd'));logger[_0x0456('0xe')](_0x0456('0xf'),_0x3a82a2,_0x0456('0xd'),JSON[_0x0456('0x10')](_0x5a85ac));if(_0x5a85ac[_0x0456('0x11')]){if(_0x5a85ac[_0x0456('0x11')][_0x0456('0x12')]===0x1f4){logger[_0x0456('0x11')](_0x0456('0x13'),_0x3a82a2,_0x5a85ac[_0x0456('0x11')][_0x0456('0x14')]);return _0x4ce651(_0x5a85ac[_0x0456('0x11')][_0x0456('0x14')]);}logger[_0x0456('0x11')](_0x0456('0x13'),_0x3a82a2,_0x5a85ac[_0x0456('0x11')][_0x0456('0x14')]);return _0x23c82e(_0x5a85ac['error'][_0x0456('0x14')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x3a82a2,_0x0456('0xd'));_0x23c82e(_0x5a85ac[_0x0456('0x15')][_0x0456('0x14')]);}})['catch'](function(_0x5eae23){logger[_0x0456('0x11')](_0x0456('0x13'),_0x3a82a2,_0x5eae23);_0x4ce651(_0x5eae23);});});}exports[_0x0456('0x16')]=function(_0x24ee7b){var _0x526233=this;return new Promise(function(_0x9c6cca,_0x343743){return db[_0x0456('0x17')][_0x0456('0x18')]({'raw':_0x24ee7b[_0x0456('0x19')]?_0x24ee7b[_0x0456('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x24ee7b[_0x0456('0x19')]?_0x24ee7b[_0x0456('0x19')][_0x0456('0x1a')]||null:null,'attributes':_0x24ee7b['options']?_0x24ee7b[_0x0456('0x19')]['attributes']||null:null,'limit':_0x24ee7b[_0x0456('0x19')]?_0x24ee7b['options'][_0x0456('0x1b')]||null:null,'include':_0x24ee7b[_0x0456('0x19')]?_0x24ee7b['options'][_0x0456('0x1c')]?_[_0x0456('0x1d')](_0x24ee7b['options']['include'],function(_0x2fef35){return{'model':db[_0x2fef35[_0x0456('0x1e')]],'as':_0x2fef35['as'],'attributes':_0x2fef35[_0x0456('0x1f')],'include':_0x2fef35['include']?_[_0x0456('0x1d')](_0x2fef35[_0x0456('0x1c')],function(_0x1a83e5){return{'model':db[_0x1a83e5[_0x0456('0x1e')]],'as':_0x1a83e5['as'],'attributes':_0x1a83e5[_0x0456('0x1f')],'include':_0x1a83e5[_0x0456('0x1c')]?_[_0x0456('0x1d')](_0x1a83e5['include'],function(_0xdbe2eb){return{'model':db[_0xdbe2eb[_0x0456('0x1e')]],'as':_0xdbe2eb['as'],'attributes':_0xdbe2eb[_0x0456('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b2d8f){logger[_0x0456('0x20')](_0x0456('0x16'),_0x24ee7b);logger[_0x0456('0xe')](_0x0456('0x16'),_0x24ee7b,JSON[_0x0456('0x10')](_0x3b2d8f));_0x9c6cca(_0x3b2d8f);})[_0x0456('0x21')](function(_0x120c37){logger[_0x0456('0x11')](_0x0456('0x16'),_0x120c37[_0x0456('0x14')],_0x24ee7b);_0x343743(_0x526233['error'](0x1f4,_0x120c37[_0x0456('0x14')]));});});};exports[_0x0456('0x22')]=function(_0x54c2a0){var _0x2dcea4=this;return new Promise(function(_0x5a2bda,_0x5a0c8f){return db[_0x0456('0x17')][_0x0456('0x23')]({'raw':_0x54c2a0[_0x0456('0x19')]?_0x54c2a0[_0x0456('0x19')][_0x0456('0x24')]===undefined?!![]:![]:!![],'where':_0x54c2a0[_0x0456('0x19')]?_0x54c2a0[_0x0456('0x19')][_0x0456('0x1a')]||null:null,'attributes':_0x54c2a0[_0x0456('0x19')]?_0x54c2a0[_0x0456('0x19')][_0x0456('0x1f')]||null:null,'include':_0x54c2a0[_0x0456('0x19')]?_0x54c2a0['options'][_0x0456('0x1c')]?_[_0x0456('0x1d')](_0x54c2a0['options'][_0x0456('0x1c')],function(_0x1c9538){return{'model':db[_0x1c9538[_0x0456('0x1e')]],'as':_0x1c9538['as'],'attributes':_0x1c9538[_0x0456('0x1f')],'include':_0x1c9538[_0x0456('0x1c')]?_[_0x0456('0x1d')](_0x1c9538['include'],function(_0x4c65bc){return{'model':db[_0x4c65bc[_0x0456('0x1e')]],'as':_0x4c65bc['as'],'attributes':_0x4c65bc[_0x0456('0x1f')],'include':_0x4c65bc[_0x0456('0x1c')]?_['map'](_0x4c65bc[_0x0456('0x1c')],function(_0x11d381){return{'model':db[_0x11d381[_0x0456('0x1e')]],'as':_0x11d381['as'],'attributes':_0x11d381[_0x0456('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x576cc1){logger[_0x0456('0x20')](_0x0456('0x22'),_0x54c2a0);logger[_0x0456('0xe')]('ShowMailQueue',_0x54c2a0,JSON[_0x0456('0x10')](_0x576cc1));_0x5a2bda(_0x576cc1);})[_0x0456('0x21')](function(_0x5d0d6b){logger['error']('ShowMailQueue',_0x5d0d6b[_0x0456('0x14')],_0x54c2a0);_0x5a0c8f(_0x2dcea4['error'](0x1f4,_0x5d0d6b[_0x0456('0x14')]));});});}; \ No newline at end of file +var _0x634d=['http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','info','MailQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','where','attributes','map','include','model','then','debug','find','ShowMailQueue','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x15ec12,_0x23d8ee){var _0x1b6747=function(_0x4ac478){while(--_0x4ac478){_0x15ec12['push'](_0x15ec12['shift']());}};_0x1b6747(++_0x23d8ee);}(_0x634d,0x120));var _0xd634=function(_0x4edb52,_0x4b7f20){_0x4edb52=_0x4edb52-0x0;var _0xde3b4a=_0x634d[_0x4edb52];return _0xde3b4a;};'use strict';var _=require(_0xd634('0x0'));var util=require(_0xd634('0x1'));var moment=require(_0xd634('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd634('0x3'))['db'];var utils=require(_0xd634('0x4'));var logger=require(_0xd634('0x5'))('rpc');var config=require(_0xd634('0x6'));var jayson=require(_0xd634('0x7'));var client=jayson['client'][_0xd634('0x8')]({'port':0x232a});config[_0xd634('0x9')]=_[_0xd634('0xa')](config[_0xd634('0x9')],{'host':_0xd634('0xb'),'port':0x18eb});var socket=require(_0xd634('0xc'))(new Redis(config['redis']));require(_0xd634('0xd'))[_0xd634('0xe')](socket);function respondWithRpcPromise(_0x5b4ebc,_0x1985fa,_0x360fac){return new BPromise(function(_0x53a011,_0x2bd5ea){return client['request'](_0x5b4ebc,_0x360fac)['then'](function(_0x558334){logger[_0xd634('0xf')](_0xd634('0x10'),_0x1985fa,_0xd634('0x11'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x1985fa,_0xd634('0x11'),JSON[_0xd634('0x12')](_0x558334));if(_0x558334[_0xd634('0x13')]){if(_0x558334['error'][_0xd634('0x14')]===0x1f4){logger[_0xd634('0x13')](_0xd634('0x10'),_0x1985fa,_0x558334[_0xd634('0x13')][_0xd634('0x15')]);return _0x2bd5ea(_0x558334[_0xd634('0x13')][_0xd634('0x15')]);}logger[_0xd634('0x13')](_0xd634('0x10'),_0x1985fa,_0x558334['error'][_0xd634('0x15')]);return _0x53a011(_0x558334[_0xd634('0x13')][_0xd634('0x15')]);}else{logger[_0xd634('0xf')](_0xd634('0x10'),_0x1985fa,_0xd634('0x11'));_0x53a011(_0x558334[_0xd634('0x16')][_0xd634('0x15')]);}})[_0xd634('0x17')](function(_0x387300){logger['error'](_0xd634('0x10'),_0x1985fa,_0x387300);_0x2bd5ea(_0x387300);});});}exports[_0xd634('0x18')]=function(_0x1e61d7){var _0x413348=this;return new Promise(function(_0x7070f3,_0x1f904d){return db[_0xd634('0x19')][_0xd634('0x1a')]({'raw':_0x1e61d7[_0xd634('0x1b')]?_0x1e61d7[_0xd634('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1e61d7['options']?_0x1e61d7[_0xd634('0x1b')][_0xd634('0x1c')]||null:null,'attributes':_0x1e61d7[_0xd634('0x1b')]?_0x1e61d7['options'][_0xd634('0x1d')]||null:null,'limit':_0x1e61d7[_0xd634('0x1b')]?_0x1e61d7['options']['limit']||null:null,'include':_0x1e61d7[_0xd634('0x1b')]?_0x1e61d7['options']['include']?_[_0xd634('0x1e')](_0x1e61d7[_0xd634('0x1b')][_0xd634('0x1f')],function(_0x548f5b){return{'model':db[_0x548f5b['model']],'as':_0x548f5b['as'],'attributes':_0x548f5b[_0xd634('0x1d')],'include':_0x548f5b['include']?_[_0xd634('0x1e')](_0x548f5b[_0xd634('0x1f')],function(_0x262d2f){return{'model':db[_0x262d2f[_0xd634('0x20')]],'as':_0x262d2f['as'],'attributes':_0x262d2f[_0xd634('0x1d')],'include':_0x262d2f[_0xd634('0x1f')]?_[_0xd634('0x1e')](_0x262d2f[_0xd634('0x1f')],function(_0x427c03){return{'model':db[_0x427c03[_0xd634('0x20')]],'as':_0x427c03['as'],'attributes':_0x427c03[_0xd634('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd634('0x21')](function(_0x37783f){logger[_0xd634('0xf')](_0xd634('0x18'),_0x1e61d7);logger[_0xd634('0x22')](_0xd634('0x18'),_0x1e61d7,JSON[_0xd634('0x12')](_0x37783f));_0x7070f3(_0x37783f);})[_0xd634('0x17')](function(_0x45b049){logger[_0xd634('0x13')]('GetMailQueue',_0x45b049[_0xd634('0x15')],_0x1e61d7);_0x1f904d(_0x413348['error'](0x1f4,_0x45b049[_0xd634('0x15')]));});});};exports['ShowMailQueue']=function(_0x15ce96){var _0x40e4d5=this;return new Promise(function(_0x3dae52,_0x4af19e){return db[_0xd634('0x19')][_0xd634('0x23')]({'raw':_0x15ce96[_0xd634('0x1b')]?_0x15ce96[_0xd634('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x15ce96[_0xd634('0x1b')]?_0x15ce96[_0xd634('0x1b')][_0xd634('0x1c')]||null:null,'attributes':_0x15ce96[_0xd634('0x1b')]?_0x15ce96[_0xd634('0x1b')][_0xd634('0x1d')]||null:null,'include':_0x15ce96[_0xd634('0x1b')]?_0x15ce96[_0xd634('0x1b')]['include']?_[_0xd634('0x1e')](_0x15ce96[_0xd634('0x1b')]['include'],function(_0x488666){return{'model':db[_0x488666['model']],'as':_0x488666['as'],'attributes':_0x488666[_0xd634('0x1d')],'include':_0x488666[_0xd634('0x1f')]?_[_0xd634('0x1e')](_0x488666[_0xd634('0x1f')],function(_0x126f2f){return{'model':db[_0x126f2f[_0xd634('0x20')]],'as':_0x126f2f['as'],'attributes':_0x126f2f['attributes'],'include':_0x126f2f[_0xd634('0x1f')]?_[_0xd634('0x1e')](_0x126f2f[_0xd634('0x1f')],function(_0x1c7a21){return{'model':db[_0x1c7a21[_0xd634('0x20')]],'as':_0x1c7a21['as'],'attributes':_0x1c7a21[_0xd634('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd634('0x21')](function(_0x2c1228){logger['info'](_0xd634('0x24'),_0x15ce96);logger['debug'](_0xd634('0x24'),_0x15ce96,JSON[_0xd634('0x12')](_0x2c1228));_0x3dae52(_0x2c1228);})[_0xd634('0x17')](function(_0x14e55e){logger[_0xd634('0x13')](_0xd634('0x24'),_0x14e55e[_0xd634('0x15')],_0x15ce96);_0x4af19e(_0x40e4d5['error'](0x1f4,_0x14e55e[_0xd634('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 1b6a506..3b104b7 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 _0xe6f1=['removeListener','register','length','mailQueue:','save','remove','update','emit'];(function(_0x538406,_0x25c40b){var _0x18f8fd=function(_0x52ff7f){while(--_0x52ff7f){_0x538406['push'](_0x538406['shift']());}};_0x18f8fd(++_0x25c40b);}(_0xe6f1,0x1d4));var _0x1e6f=function(_0x158f01,_0x12af3e){_0x158f01=_0x158f01-0x0;var _0x5ef74e=_0xe6f1[_0x158f01];return _0x5ef74e;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x1e6f('0x0'),_0x1e6f('0x1'),_0x1e6f('0x2')];function createListener(_0x5d9dc0,_0x1ed8a2){return function(_0x214680){_0x1ed8a2[_0x1e6f('0x3')](_0x5d9dc0,_0x214680);};}function removeListener(_0x26ee46,_0x24d502){return function(){MailQueueEvents[_0x1e6f('0x4')](_0x26ee46,_0x24d502);};}exports[_0x1e6f('0x5')]=function(_0x14c56d){for(var _0x298efb=0x0,_0x4d7922=events[_0x1e6f('0x6')];_0x298efb<_0x4d7922;_0x298efb++){var _0x563c4b=events[_0x298efb];var _0x460ec3=createListener(_0x1e6f('0x7')+_0x563c4b,_0x14c56d);MailQueueEvents['on'](_0x563c4b,_0x460ec3);}}; \ No newline at end of file +var _0x827a=['length','mailQueue:','./mailQueue.events','update','emit','removeListener','register'];(function(_0x15cec1,_0x24fe2d){var _0x4c2274=function(_0x11712b){while(--_0x11712b){_0x15cec1['push'](_0x15cec1['shift']());}};_0x4c2274(++_0x24fe2d);}(_0x827a,0x167));var _0xa827=function(_0x512422,_0x1e294c){_0x512422=_0x512422-0x0;var _0x2b4d5b=_0x827a[_0x512422];return _0x2b4d5b;};'use strict';var MailQueueEvents=require(_0xa827('0x0'));var events=['save','remove',_0xa827('0x1')];function createListener(_0x228511,_0x1053d0){return function(_0xd5d420){_0x1053d0[_0xa827('0x2')](_0x228511,_0xd5d420);};}function removeListener(_0x57484c,_0x184e05){return function(){MailQueueEvents[_0xa827('0x3')](_0x57484c,_0x184e05);};}exports[_0xa827('0x4')]=function(_0x5d92ab){for(var _0x15d9fe=0x0,_0x5af65e=events[_0xa827('0x5')];_0x15d9fe<_0x5af65e;_0x15d9fe++){var _0x3de707=events[_0x15d9fe];var _0x512f81=createListener(_0xa827('0x6')+_0x3de707,_0x5d92ab);MailQueueEvents['on'](_0x3de707,_0x512f81);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index a9b3dfa..64a8a96 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 _0x3036=['fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show','create','update','delete','exports','multer','util','path','express','Router'];(function(_0x3d28cc,_0x4025fd){var _0x25c7e7=function(_0x143e6f){while(--_0x143e6f){_0x3d28cc['push'](_0x3d28cc['shift']());}};_0x25c7e7(++_0x4025fd);}(_0x3036,0x80));var _0x6303=function(_0x50cf6c,_0x4d6303){_0x50cf6c=_0x50cf6c-0x0;var _0x3986a1=_0x3036[_0x50cf6c];return _0x3986a1;};'use strict';var multer=require(_0x6303('0x0'));var util=require(_0x6303('0x1'));var path=require(_0x6303('0x2'));var timeout=require('connect-timeout');var express=require(_0x6303('0x3'));var router=express[_0x6303('0x4')]();var fs_extra=require(_0x6303('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6303('0x6'));var config=require(_0x6303('0x7'));var controller=require(_0x6303('0x8'));router[_0x6303('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6303('0x9')](_0x6303('0xa'),auth[_0x6303('0xb')](),controller[_0x6303('0xc')]);router['get'](_0x6303('0xd'),auth['isAuthenticated'](),controller[_0x6303('0xe')]);router['post']('/',auth[_0x6303('0xb')](),controller[_0x6303('0xf')]);router['put'](_0x6303('0xd'),auth['isAuthenticated'](),controller[_0x6303('0x10')]);router[_0x6303('0x11')](_0x6303('0xd'),auth[_0x6303('0xb')](),controller['destroy']);module[_0x6303('0x12')]=router; \ No newline at end of file +var _0xd05a=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','./mailQueueReport.controller','isAuthenticated','index','get','describe','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd05a,0xa8));var _0xad05=function(_0x406c63,_0x5f4369){_0x406c63=_0x406c63-0x0;var _0x10f132=_0xd05a[_0x406c63];return _0x10f132;};'use strict';var multer=require(_0xad05('0x0'));var util=require(_0xad05('0x1'));var path=require(_0xad05('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xad05('0x3')]();var fs_extra=require(_0xad05('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xad05('0x5'));var config=require('../../config/environment');var controller=require(_0xad05('0x6'));router['get']('/',auth[_0xad05('0x7')](),controller[_0xad05('0x8')]);router[_0xad05('0x9')]('/describe',auth[_0xad05('0x7')](),controller[_0xad05('0xa')]);router['get']('/:id',auth[_0xad05('0x7')](),controller[_0xad05('0xb')]);router[_0xad05('0xc')]('/',auth[_0xad05('0x7')](),controller[_0xad05('0xd')]);router[_0xad05('0xe')](_0xad05('0xf'),auth[_0xad05('0x7')](),controller[_0xad05('0x10')]);router[_0xad05('0x11')](_0xad05('0xf'),auth['isAuthenticated'](),controller[_0xad05('0x12')]);module[_0xad05('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 07c5e08..10e5b05 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 _0x8f23=['moment','sequelize','exports','STRING','DATE'];(function(_0x3962a5,_0x5708cb){var _0x16671a=function(_0x473f9d){while(--_0x473f9d){_0x3962a5['push'](_0x3962a5['shift']());}};_0x16671a(++_0x5708cb);}(_0x8f23,0x1e5));var _0x38f2=function(_0xfdfe35,_0x48e846){_0xfdfe35=_0xfdfe35-0x0;var _0x38ffd7=_0x8f23[_0xfdfe35];return _0x38ffd7;};'use strict';var moment=require(_0x38f2('0x0'));var Sequelize=require(_0x38f2('0x1'));module[_0x38f2('0x2')]={'uniqueid':{'type':Sequelize[_0x38f2('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x38f2('0x3')]},'joinAt':{'type':Sequelize[_0x38f2('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x38f2('0x4')]},'reason':{'type':Sequelize[_0x38f2('0x3')]}}; \ No newline at end of file +var _0x3e06=['sequelize','exports','STRING','DATE','moment'];(function(_0x1ce281,_0xa492ca){var _0x3cf4aa=function(_0x390bb5){while(--_0x390bb5){_0x1ce281['push'](_0x1ce281['shift']());}};_0x3cf4aa(++_0xa492ca);}(_0x3e06,0x153));var _0x63e0=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3e06[_0x42cae2];return _0x5f256f;};'use strict';var moment=require(_0x63e0('0x0'));var Sequelize=require(_0x63e0('0x1'));module[_0x63e0('0x2')]={'uniqueid':{'type':Sequelize[_0x63e0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x63e0('0x3')]},'joinAt':{'type':Sequelize[_0x63e0('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x63e0('0x4')]},'exitAt':{'type':Sequelize[_0x63e0('0x4')]},'reason':{'type':Sequelize[_0x63e0('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 44c25e8..f415adc 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 _0x8aad=['sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x4aaa10,_0x3ce055){var _0x424704=function(_0x3d4873){while(--_0x3d4873){_0x4aaa10['push'](_0x4aaa10['shift']());}};_0x424704(++_0x3ce055);}(_0x8aad,0x146));var _0xd8aa=function(_0x3d1b97,_0x248939){_0x3d1b97=_0x3d1b97-0x0;var _0x3b9905=_0x8aad[_0x3d1b97];return _0x3b9905;};'use strict';var emlformat=require(_0xd8aa('0x0'));var rimraf=require(_0xd8aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8aa('0x2'));var rp=require('request-promise');var moment=require(_0xd8aa('0x3'));var BPromise=require(_0xd8aa('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd8aa('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd8aa('0x6'));var fs=require('fs');var fs_extra=require(_0xd8aa('0x7'));var _=require(_0xd8aa('0x8'));var squel=require('squel');var crypto=require(_0xd8aa('0x9'));var jsforce=require(_0xd8aa('0xa'));var deskjs=require(_0xd8aa('0xb'));var toCsv=require(_0xd8aa('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd8aa('0xd'));var authService=require(_0xd8aa('0xe'));var qs=require(_0xd8aa('0xf'));var as=require(_0xd8aa('0x10'));var hardwareService=require(_0xd8aa('0x11'));var logger=require('../../config/logger')(_0xd8aa('0x12'));var utils=require(_0xd8aa('0x13'));var config=require(_0xd8aa('0x14'));var licenseUtil=require(_0xd8aa('0x15'));var db=require(_0xd8aa('0x16'))['db'];function respondWithStatusCode(_0x6ec0eb,_0x549fad){_0x549fad=_0x549fad||0xcc;return function(_0x1e7db8){if(_0x1e7db8){return _0x6ec0eb[_0xd8aa('0x17')](_0x549fad);}return _0x6ec0eb[_0xd8aa('0x18')](_0x549fad)['end']();};}function respondWithResult(_0x5a8c79,_0x275eff){_0x275eff=_0x275eff||0xc8;return function(_0x319ffe){if(_0x319ffe){return _0x5a8c79[_0xd8aa('0x18')](_0x275eff)['json'](_0x319ffe);}};}function respondWithFilteredResult(_0x2678ed,_0x180c56){return function(_0x39b5bc){if(_0x39b5bc){var _0x404ed6=typeof _0x180c56['offset']===_0xd8aa('0x19')&&typeof _0x180c56[_0xd8aa('0x1a')]==='undefined';var _0x16d5c6=_0x39b5bc[_0xd8aa('0x1b')];var _0x32e2cd=_0x404ed6?0x0:_0x180c56[_0xd8aa('0x1c')];var _0x2d34ac=_0x404ed6?_0x39b5bc['count']:_0x180c56[_0xd8aa('0x1c')]+_0x180c56[_0xd8aa('0x1a')];var _0xb156e6;if(_0x2d34ac>=_0x16d5c6){_0x2d34ac=_0x16d5c6;_0xb156e6=0xc8;}else{_0xb156e6=0xce;}_0x2678ed[_0xd8aa('0x18')](_0xb156e6);return _0x2678ed['set'](_0xd8aa('0x1d'),_0x32e2cd+'-'+_0x2d34ac+'/'+_0x16d5c6)[_0xd8aa('0x1e')](_0x39b5bc);}return null;};}function patchUpdates(_0x46d69b){return function(_0x3588ee){try{jsonpatch[_0xd8aa('0x1f')](_0x3588ee,_0x46d69b,!![]);}catch(_0x4fe5d8){return BPromise[_0xd8aa('0x20')](_0x4fe5d8);}return _0x3588ee[_0xd8aa('0x21')]();};}function saveUpdates(_0xc4f55c,_0x5910b3){return function(_0xa7cf85){if(_0xa7cf85){return _0xa7cf85[_0xd8aa('0x22')](_0xc4f55c)[_0xd8aa('0x23')](function(_0x290849){return _0x290849;});}return null;};}function removeEntity(_0x3ef3a9,_0x16758a){return function(_0x1f64f8){if(_0x1f64f8){return _0x1f64f8[_0xd8aa('0x24')]()[_0xd8aa('0x23')](function(){_0x3ef3a9[_0xd8aa('0x18')](0xcc)[_0xd8aa('0x25')]();});}};}function handleEntityNotFound(_0x370d6f,_0x26cc66){return function(_0x5f1027){if(!_0x5f1027){_0x370d6f[_0xd8aa('0x17')](0x194);}return _0x5f1027;};}function handleError(_0x59eb3f,_0xd4d204){_0xd4d204=_0xd4d204||0x1f4;return function(_0x1f6ab2){logger[_0xd8aa('0x26')](_0x1f6ab2[_0xd8aa('0x27')]);if(_0x1f6ab2[_0xd8aa('0x28')]){delete _0x1f6ab2[_0xd8aa('0x28')];}_0x59eb3f[_0xd8aa('0x18')](_0xd4d204)[_0xd8aa('0x29')](_0x1f6ab2);};}exports['index']=function(_0x1f2a28,_0x34b792){var _0x214393={},_0x49a7c8={},_0x19a59d={'count':0x0,'rows':[]};var _0x51c6f4=_[_0xd8aa('0x2a')](db[_0xd8aa('0x2b')][_0xd8aa('0x2c')],function(_0x168a2e){return{'name':_0x168a2e[_0xd8aa('0x2d')],'type':_0x168a2e[_0xd8aa('0x2e')][_0xd8aa('0x2f')]};});_0x49a7c8[_0xd8aa('0x30')]=_['map'](_0x51c6f4,_0xd8aa('0x28'));_0x49a7c8[_0xd8aa('0x31')]=_[_0xd8aa('0x32')](_0x1f2a28[_0xd8aa('0x31')]);_0x49a7c8[_0xd8aa('0x33')]=_[_0xd8aa('0x34')](_0x49a7c8[_0xd8aa('0x30')],_0x49a7c8[_0xd8aa('0x31')]);_0x214393['attributes']=_[_0xd8aa('0x34')](_0x49a7c8[_0xd8aa('0x30')],qs[_0xd8aa('0x35')](_0x1f2a28['query'][_0xd8aa('0x35')]));_0x214393[_0xd8aa('0x36')]=_0x214393[_0xd8aa('0x36')][_0xd8aa('0x37')]?_0x214393[_0xd8aa('0x36')]:_0x49a7c8[_0xd8aa('0x30')];if(!_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x38')](_0xd8aa('0x39'))){_0x214393['limit']=qs[_0xd8aa('0x1a')](_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x1a')]);_0x214393[_0xd8aa('0x1c')]=qs[_0xd8aa('0x1c')](_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x1c')]);}_0x214393[_0xd8aa('0x3a')]=qs[_0xd8aa('0x3b')](_0x1f2a28['query'][_0xd8aa('0x3b')]);_0x214393['where']=qs[_0xd8aa('0x33')](_[_0xd8aa('0x3c')](_0x1f2a28['query'],_0x49a7c8[_0xd8aa('0x33')]),_0x51c6f4);if(_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x3d')]){_0x214393[_0xd8aa('0x3e')]=_[_0xd8aa('0x3f')](_0x214393['where'],{'$or':_['map'](_0x51c6f4,function(_0x25145c){if(_0x25145c['type']!==_0xd8aa('0x40')){var _0x7a6df2={};_0x7a6df2[_0x25145c[_0xd8aa('0x28')]]={'$like':'%'+_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x3d')]+'%'};return _0x7a6df2;}})});}_0x214393=_[_0xd8aa('0x3f')]({},_0x214393,_0x1f2a28[_0xd8aa('0x41')]);var _0x3b0220={'where':_0x214393[_0xd8aa('0x3e')]};return db[_0xd8aa('0x2b')][_0xd8aa('0x1b')](_0x3b0220)['then'](function(_0x17ebb4){_0x19a59d[_0xd8aa('0x1b')]=_0x17ebb4;if(_0x1f2a28[_0xd8aa('0x31')]['includeAll']){_0x214393[_0xd8aa('0x42')]=[{'all':!![]}];}return db[_0xd8aa('0x2b')][_0xd8aa('0x43')](_0x214393);})[_0xd8aa('0x23')](function(_0x3a0284){_0x19a59d[_0xd8aa('0x44')]=_0x3a0284;return _0x19a59d;})[_0xd8aa('0x23')](respondWithFilteredResult(_0x34b792,_0x214393))[_0xd8aa('0x45')](handleError(_0x34b792,null));};exports[_0xd8aa('0x46')]=function(_0x3f5857,_0x20c7a0){var _0x3ec42f={'raw':!![],'where':{'id':_0x3f5857[_0xd8aa('0x47')]['id']}},_0x3b26c9={};_0x3b26c9[_0xd8aa('0x30')]=_[_0xd8aa('0x32')](db[_0xd8aa('0x2b')][_0xd8aa('0x2c')]);_0x3b26c9['query']=_[_0xd8aa('0x32')](_0x3f5857[_0xd8aa('0x31')]);_0x3b26c9[_0xd8aa('0x33')]=_[_0xd8aa('0x34')](_0x3b26c9[_0xd8aa('0x30')],_0x3b26c9[_0xd8aa('0x31')]);_0x3ec42f['attributes']=_[_0xd8aa('0x34')](_0x3b26c9['model'],qs[_0xd8aa('0x35')](_0x3f5857['query'][_0xd8aa('0x35')]));_0x3ec42f['attributes']=_0x3ec42f['attributes'][_0xd8aa('0x37')]?_0x3ec42f[_0xd8aa('0x36')]:_0x3b26c9[_0xd8aa('0x30')];if(_0x3f5857[_0xd8aa('0x31')][_0xd8aa('0x48')]){_0x3ec42f[_0xd8aa('0x42')]=[{'all':!![]}];}_0x3ec42f=_['merge']({},_0x3ec42f,_0x3f5857[_0xd8aa('0x41')]);return db[_0xd8aa('0x2b')][_0xd8aa('0x49')](_0x3ec42f)[_0xd8aa('0x23')](handleEntityNotFound(_0x20c7a0,null))[_0xd8aa('0x23')](respondWithResult(_0x20c7a0,null))['catch'](handleError(_0x20c7a0,null));};exports['create']=function(_0x58cf42,_0x1fd1dc){return db[_0xd8aa('0x2b')][_0xd8aa('0x4a')](_0x58cf42[_0xd8aa('0x4b')],{})[_0xd8aa('0x23')](respondWithResult(_0x1fd1dc,0xc9))[_0xd8aa('0x45')](handleError(_0x1fd1dc,null));};exports['update']=function(_0x221e2b,_0x241e23){if(_0x221e2b['body']['id']){delete _0x221e2b[_0xd8aa('0x4b')]['id'];}return db[_0xd8aa('0x2b')][_0xd8aa('0x49')]({'where':{'id':_0x221e2b['params']['id']}})[_0xd8aa('0x23')](handleEntityNotFound(_0x241e23,null))[_0xd8aa('0x23')](saveUpdates(_0x221e2b[_0xd8aa('0x4b')],null))[_0xd8aa('0x23')](respondWithResult(_0x241e23,null))[_0xd8aa('0x45')](handleError(_0x241e23,null));};exports[_0xd8aa('0x24')]=function(_0x4f494d,_0x566d52){return db[_0xd8aa('0x2b')][_0xd8aa('0x49')]({'where':{'id':_0x4f494d[_0xd8aa('0x47')]['id']}})[_0xd8aa('0x23')](handleEntityNotFound(_0x566d52,null))[_0xd8aa('0x23')](removeEntity(_0x566d52,null))[_0xd8aa('0x45')](handleError(_0x566d52,null));};exports[_0xd8aa('0x4c')]=function(_0x4f9d21,_0x9db7e3){return db[_0xd8aa('0x2b')]['describe']()[_0xd8aa('0x23')](respondWithResult(_0x9db7e3,null))['catch'](handleError(_0x9db7e3,null));}; \ No newline at end of file +var _0xeb3b=['destroy','error','stack','name','send','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','MailQueueReport','rawAttributes','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','then'];(function(_0x3a8c1e,_0x11b2fe){var _0x5c3f0f=function(_0x30c914){while(--_0x30c914){_0x3a8c1e['push'](_0x3a8c1e['shift']());}};_0x5c3f0f(++_0x11b2fe);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x48a836,_0xa1d010){_0x48a836=_0x48a836-0x0;var _0x249dc8=_0xeb3b[_0x48a836];return _0x249dc8;};'use strict';var emlformat=require(_0xbeb3('0x0'));var rimraf=require(_0xbeb3('0x1'));var zipdir=require(_0xbeb3('0x2'));var jsonpatch=require(_0xbeb3('0x3'));var rp=require(_0xbeb3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbeb3('0x5'));var util=require('util');var path=require(_0xbeb3('0x6'));var sox=require('sox');var csv=require(_0xbeb3('0x7'));var ejs=require(_0xbeb3('0x8'));var fs=require('fs');var fs_extra=require(_0xbeb3('0x9'));var _=require(_0xbeb3('0xa'));var squel=require(_0xbeb3('0xb'));var crypto=require(_0xbeb3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbeb3('0xd'));var toCsv=require(_0xbeb3('0x7'));var querystring=require(_0xbeb3('0xe'));var Papa=require(_0xbeb3('0xf'));var Redis=require(_0xbeb3('0x10'));var authService=require(_0xbeb3('0x11'));var qs=require(_0xbeb3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbeb3('0x13'));var logger=require(_0xbeb3('0x14'))('api');var utils=require(_0xbeb3('0x15'));var config=require(_0xbeb3('0x16'));var licenseUtil=require(_0xbeb3('0x17'));var db=require(_0xbeb3('0x18'))['db'];function respondWithStatusCode(_0x19868e,_0x313296){_0x313296=_0x313296||0xcc;return function(_0x5b9ace){if(_0x5b9ace){return _0x19868e['sendStatus'](_0x313296);}return _0x19868e[_0xbeb3('0x19')](_0x313296)[_0xbeb3('0x1a')]();};}function respondWithResult(_0x5f521b,_0x4dfb28){_0x4dfb28=_0x4dfb28||0xc8;return function(_0xed9879){if(_0xed9879){return _0x5f521b[_0xbeb3('0x19')](_0x4dfb28)[_0xbeb3('0x1b')](_0xed9879);}};}function respondWithFilteredResult(_0x43d58a,_0x26daf2){return function(_0x535836){if(_0x535836){var _0x1aeaee=typeof _0x26daf2['offset']===_0xbeb3('0x1c')&&typeof _0x26daf2['limit']==='undefined';var _0x4f8481=_0x535836[_0xbeb3('0x1d')];var _0x44a4bb=_0x1aeaee?0x0:_0x26daf2[_0xbeb3('0x1e')];var _0x10b15d=_0x1aeaee?_0x535836['count']:_0x26daf2[_0xbeb3('0x1e')]+_0x26daf2[_0xbeb3('0x1f')];var _0xe2cc47;if(_0x10b15d>=_0x4f8481){_0x10b15d=_0x4f8481;_0xe2cc47=0xc8;}else{_0xe2cc47=0xce;}_0x43d58a['status'](_0xe2cc47);return _0x43d58a['set'](_0xbeb3('0x20'),_0x44a4bb+'-'+_0x10b15d+'/'+_0x4f8481)['json'](_0x535836);}return null;};}function patchUpdates(_0x1d917b){return function(_0x50b005){try{jsonpatch['apply'](_0x50b005,_0x1d917b,!![]);}catch(_0xfa2736){return BPromise[_0xbeb3('0x21')](_0xfa2736);}return _0x50b005[_0xbeb3('0x22')]();};}function saveUpdates(_0x4bd89e,_0x301899){return function(_0x18ea0f){if(_0x18ea0f){return _0x18ea0f['update'](_0x4bd89e)[_0xbeb3('0x23')](function(_0x366bdb){return _0x366bdb;});}return null;};}function removeEntity(_0x55a59d,_0xfc384a){return function(_0x278fe4){if(_0x278fe4){return _0x278fe4[_0xbeb3('0x24')]()[_0xbeb3('0x23')](function(){_0x55a59d[_0xbeb3('0x19')](0xcc)[_0xbeb3('0x1a')]();});}};}function handleEntityNotFound(_0x84921a,_0x340581){return function(_0x46fe17){if(!_0x46fe17){_0x84921a['sendStatus'](0x194);}return _0x46fe17;};}function handleError(_0x4e695e,_0x1f36b9){_0x1f36b9=_0x1f36b9||0x1f4;return function(_0x520116){logger[_0xbeb3('0x25')](_0x520116[_0xbeb3('0x26')]);if(_0x520116[_0xbeb3('0x27')]){delete _0x520116[_0xbeb3('0x27')];}_0x4e695e['status'](_0x1f36b9)[_0xbeb3('0x28')](_0x520116);};}exports['index']=function(_0x26cd8f,_0xab301c){var _0x5bd93d={},_0x483198={},_0x9b8f13={'count':0x0,'rows':[]};var _0x585c6f=_['map'](db['MailQueueReport']['rawAttributes'],function(_0xf5dbaf){return{'name':_0xf5dbaf['fieldName'],'type':_0xf5dbaf[_0xbeb3('0x29')][_0xbeb3('0x2a')]};});_0x483198[_0xbeb3('0x2b')]=_[_0xbeb3('0x2c')](_0x585c6f,_0xbeb3('0x27'));_0x483198[_0xbeb3('0x2d')]=_[_0xbeb3('0x2e')](_0x26cd8f[_0xbeb3('0x2d')]);_0x483198[_0xbeb3('0x2f')]=_[_0xbeb3('0x30')](_0x483198['model'],_0x483198[_0xbeb3('0x2d')]);_0x5bd93d[_0xbeb3('0x31')]=_['intersection'](_0x483198[_0xbeb3('0x2b')],qs[_0xbeb3('0x32')](_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x32')]));_0x5bd93d['attributes']=_0x5bd93d[_0xbeb3('0x31')][_0xbeb3('0x33')]?_0x5bd93d[_0xbeb3('0x31')]:_0x483198[_0xbeb3('0x2b')];if(!_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x34')](_0xbeb3('0x35'))){_0x5bd93d[_0xbeb3('0x1f')]=qs[_0xbeb3('0x1f')](_0x26cd8f['query'][_0xbeb3('0x1f')]);_0x5bd93d['offset']=qs[_0xbeb3('0x1e')](_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x1e')]);}_0x5bd93d[_0xbeb3('0x36')]=qs[_0xbeb3('0x37')](_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x37')]);_0x5bd93d[_0xbeb3('0x38')]=qs['filters'](_[_0xbeb3('0x39')](_0x26cd8f['query'],_0x483198['filters']),_0x585c6f);if(_0x26cd8f['query'][_0xbeb3('0x3a')]){_0x5bd93d[_0xbeb3('0x38')]=_[_0xbeb3('0x3b')](_0x5bd93d[_0xbeb3('0x38')],{'$or':_[_0xbeb3('0x2c')](_0x585c6f,function(_0x40f166){if(_0x40f166['type']!==_0xbeb3('0x3c')){var _0x40de8d={};_0x40de8d[_0x40f166[_0xbeb3('0x27')]]={'$like':'%'+_0x26cd8f['query']['filter']+'%'};return _0x40de8d;}})});}_0x5bd93d=_['merge']({},_0x5bd93d,_0x26cd8f[_0xbeb3('0x3d')]);var _0x2a8860={'where':_0x5bd93d[_0xbeb3('0x38')]};return db['MailQueueReport'][_0xbeb3('0x1d')](_0x2a8860)['then'](function(_0x1b6700){_0x9b8f13[_0xbeb3('0x1d')]=_0x1b6700;if(_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x3e')]){_0x5bd93d['include']=[{'all':!![]}];}return db['MailQueueReport'][_0xbeb3('0x3f')](_0x5bd93d);})[_0xbeb3('0x23')](function(_0x3d4262){_0x9b8f13[_0xbeb3('0x40')]=_0x3d4262;return _0x9b8f13;})[_0xbeb3('0x23')](respondWithFilteredResult(_0xab301c,_0x5bd93d))[_0xbeb3('0x41')](handleError(_0xab301c,null));};exports[_0xbeb3('0x42')]=function(_0x4606a6,_0x5758c6){var _0xfcb57f={'raw':!![],'where':{'id':_0x4606a6[_0xbeb3('0x43')]['id']}},_0x39f2d2={};_0x39f2d2[_0xbeb3('0x2b')]=_[_0xbeb3('0x2e')](db[_0xbeb3('0x44')][_0xbeb3('0x45')]);_0x39f2d2['query']=_[_0xbeb3('0x2e')](_0x4606a6[_0xbeb3('0x2d')]);_0x39f2d2[_0xbeb3('0x2f')]=_[_0xbeb3('0x30')](_0x39f2d2[_0xbeb3('0x2b')],_0x39f2d2[_0xbeb3('0x2d')]);_0xfcb57f[_0xbeb3('0x31')]=_[_0xbeb3('0x30')](_0x39f2d2[_0xbeb3('0x2b')],qs[_0xbeb3('0x32')](_0x4606a6[_0xbeb3('0x2d')][_0xbeb3('0x32')]));_0xfcb57f[_0xbeb3('0x31')]=_0xfcb57f['attributes'][_0xbeb3('0x33')]?_0xfcb57f[_0xbeb3('0x31')]:_0x39f2d2[_0xbeb3('0x2b')];if(_0x4606a6['query']['includeAll']){_0xfcb57f[_0xbeb3('0x46')]=[{'all':!![]}];}_0xfcb57f=_[_0xbeb3('0x3b')]({},_0xfcb57f,_0x4606a6[_0xbeb3('0x3d')]);return db[_0xbeb3('0x44')]['find'](_0xfcb57f)[_0xbeb3('0x23')](handleEntityNotFound(_0x5758c6,null))['then'](respondWithResult(_0x5758c6,null))['catch'](handleError(_0x5758c6,null));};exports[_0xbeb3('0x47')]=function(_0x393e60,_0x1ff297){return db[_0xbeb3('0x44')]['create'](_0x393e60[_0xbeb3('0x48')],{})[_0xbeb3('0x23')](respondWithResult(_0x1ff297,0xc9))[_0xbeb3('0x41')](handleError(_0x1ff297,null));};exports['update']=function(_0x3f93ab,_0x58c49f){if(_0x3f93ab['body']['id']){delete _0x3f93ab[_0xbeb3('0x48')]['id'];}return db[_0xbeb3('0x44')][_0xbeb3('0x49')]({'where':{'id':_0x3f93ab['params']['id']}})[_0xbeb3('0x23')](handleEntityNotFound(_0x58c49f,null))[_0xbeb3('0x23')](saveUpdates(_0x3f93ab[_0xbeb3('0x48')],null))['then'](respondWithResult(_0x58c49f,null))[_0xbeb3('0x41')](handleError(_0x58c49f,null));};exports['destroy']=function(_0x39605b,_0x4d8e21){return db[_0xbeb3('0x44')][_0xbeb3('0x49')]({'where':{'id':_0x39605b[_0xbeb3('0x43')]['id']}})[_0xbeb3('0x23')](handleEntityNotFound(_0x4d8e21,null))[_0xbeb3('0x23')](removeEntity(_0x4d8e21,null))[_0xbeb3('0x41')](handleError(_0x4d8e21,null));};exports[_0xbeb3('0x4a')]=function(_0x168434,_0x49fded){return db[_0xbeb3('0x44')][_0xbeb3('0x4a')]()[_0xbeb3('0x23')](respondWithResult(_0x49fded,null))[_0xbeb3('0x41')](handleError(_0x49fded,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 639d2ac..02e337f 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 _0xc2a0=['api','moment','path','rimraf','exports','define','MailQueueReport','uniqueid','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2a0,0x1aa));var _0x0c2a=function(_0x3b0725,_0x40279c){_0x3b0725=_0x3b0725-0x0;var _0x59b5ed=_0xc2a0[_0x3b0725];return _0x59b5ed;};'use strict';var _=require(_0x0c2a('0x0'));var util=require(_0x0c2a('0x1'));var logger=require(_0x0c2a('0x2'))(_0x0c2a('0x3'));var moment=require(_0x0c2a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c2a('0x5'));var rimraf=require(_0x0c2a('0x6'));var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0x0c2a('0x7')]=function(_0x212f0e,_0x4b9876){return _0x212f0e[_0x0c2a('0x8')](_0x0c2a('0x9'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x0c2a('0xa'),'fields':[_0x0c2a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x870c=['MailQueueReport','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define'];(function(_0x48da45,_0x259bea){var _0x5d5687=function(_0x2d0a0f){while(--_0x2d0a0f){_0x48da45['push'](_0x48da45['shift']());}};_0x5d5687(++_0x259bea);}(_0x870c,0x1b9));var _0xc870=function(_0x323031,_0x4f7d3e){_0x323031=_0x323031-0x0;var _0x2f595d=_0x870c[_0x323031];return _0x2f595d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc870('0x0'))(_0xc870('0x1'));var moment=require(_0xc870('0x2'));var BPromise=require(_0xc870('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc870('0x4'));var rimraf=require(_0xc870('0x5'));var config=require(_0xc870('0x6'));var attributes=require(_0xc870('0x7'));module[_0xc870('0x8')]=function(_0x48e422,_0x127896){return _0x48e422[_0xc870('0x9')](_0xc870('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 797aea9..1776eab 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(_0x2295d6,_0x30419c){var _0x2636d3=function(_0x2090a2){while(--_0x2090a2){_0x2295d6['push'](_0x2295d6['shift']());}};_0x2636d3(++_0x30419c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xc4aa[_0x2e4aa2];return _0x5e6092;};'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 _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(_0x3e3406,_0x34fd84){var _0x37fece=function(_0xd44b3f){while(--_0xd44b3f){_0x3e3406['push'](_0x3e3406['shift']());}};_0x37fece(++_0x34fd84);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc4aa[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 2c766ef..da3e71d 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1f6015,_0x5cf81f){var _0x2d6507=function(_0x347b0d){while(--_0x347b0d){_0x1f6015['push'](_0x1f6015['shift']());}};_0x2d6507(++_0x5cf81f);}(_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(_0x1d107f,_0x2157cc){var _0x19270c=function(_0x5816be){while(--_0x5816be){_0x1d107f['push'](_0x1d107f['shift']());}};_0x19270c(++_0x2157cc);}(_0xe706,0xa3));var _0x6e70=function(_0x46d041,_0x4b80db){_0x46d041=_0x46d041-0x0;var _0x294f8a=_0xe706[_0x46d041];return _0x294f8a;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 47d9ceb..626bd48 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 _0x536f=['BOOLEAN','INBOX','sequelize','STRING','INTEGER'];(function(_0x4c8f6b,_0x582e37){var _0x1e44d0=function(_0x505d2d){while(--_0x505d2d){_0x4c8f6b['push'](_0x4c8f6b['shift']());}};_0x1e44d0(++_0x582e37);}(_0x536f,0x70));var _0xf536=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x536f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xf536('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xf536('0x1')]},'password':{'type':Sequelize[_0xf536('0x1')]},'port':{'type':Sequelize[_0xf536('0x2')]},'tls':{'type':Sequelize[_0xf536('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xf536('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf536('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf536('0x1')]}}; \ No newline at end of file +var _0xcb91=['INBOX','STRING','BOOLEAN','INTEGER'];(function(_0x1e518c,_0x38c5d6){var _0x1da661=function(_0x12b0d4){while(--_0x12b0d4){_0x1e518c['push'](_0x1e518c['shift']());}};_0x1da661(++_0x38c5d6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x16e57d,_0x2cb7ba){_0x16e57d=_0x16e57d-0x0;var _0x40239c=_0xcb91[_0x16e57d];return _0x40239c;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x1cb9('0x0')]},'host':{'type':Sequelize[_0x1cb9('0x0')]},'authentication':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x1cb9('0x0')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x1cb9('0x2')]},'tls':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x1cb9('0x3')},'connTimeout':{'type':Sequelize[_0x1cb9('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x1cb9('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index cd3b181..1ac1f25 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 _0xc1f3=['mail_servers_in','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define'];(function(_0x3f6bd4,_0x15bdef){var _0x3cd571=function(_0x3b236c){while(--_0x3b236c){_0x3f6bd4['push'](_0x3f6bd4['shift']());}};_0x3cd571(++_0x15bdef);}(_0xc1f3,0x6f));var _0x3c1f=function(_0x377c90,_0x335d6f){_0x377c90=_0x377c90-0x0;var _0x175a78=_0xc1f3[_0x377c90];return _0x175a78;};'use strict';var _=require(_0x3c1f('0x0'));var util=require('util');var logger=require(_0x3c1f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3c1f('0x2'));var rp=require(_0x3c1f('0x3'));var fs=require('fs');var path=require(_0x3c1f('0x4'));var rimraf=require(_0x3c1f('0x5'));var config=require(_0x3c1f('0x6'));var attributes=require(_0x3c1f('0x7'));module[_0x3c1f('0x8')]=function(_0x9a7dbb,_0x11ec3a){return _0x9a7dbb[_0x3c1f('0x9')]('MailServerIn',attributes,{'tableName':_0x3c1f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35bb=['define','MailServerIn','mail_servers_in','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./mailServerIn.attributes','exports'];(function(_0x59ce42,_0x1e5c95){var _0x30009a=function(_0x3b8664){while(--_0x3b8664){_0x59ce42['push'](_0x59ce42['shift']());}};_0x30009a(++_0x1e5c95);}(_0x35bb,0x92));var _0xb35b=function(_0x412324,_0x37e69d){_0x412324=_0x412324-0x0;var _0x542ba5=_0x35bb[_0x412324];return _0x542ba5;};'use strict';var _=require('lodash');var util=require(_0xb35b('0x0'));var logger=require(_0xb35b('0x1'))(_0xb35b('0x2'));var moment=require('moment');var BPromise=require(_0xb35b('0x3'));var rp=require(_0xb35b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb35b('0x5'));var attributes=require(_0xb35b('0x6'));module[_0xb35b('0x7')]=function(_0x5596bf,_0x543684){return _0x5596bf[_0xb35b('0x8')](_0xb35b('0x9'),attributes,{'tableName':_0xb35b('0xa'),'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 7a88a25..b5be1ac 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 _0x0cd2=['findAll','options','raw','where','limit','include','model','attributes','map','then','GetMailServerIn','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch'];(function(_0x43026b,_0x928d8c){var _0x4a96cd=function(_0x362cbd){while(--_0x362cbd){_0x43026b['push'](_0x43026b['shift']());}};_0x4a96cd(++_0x928d8c);}(_0x0cd2,0x1cb));var _0x20cd=function(_0x1444f2,_0x1161dd){_0x1444f2=_0x1444f2-0x0;var _0xa9fae8=_0x0cd2[_0x1444f2];return _0xa9fae8;};'use strict';var _=require(_0x20cd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x20cd('0x1'));var rs=require(_0x20cd('0x2'));var fs=require('fs');var Redis=require(_0x20cd('0x3'));var db=require(_0x20cd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x20cd('0x5'))(_0x20cd('0x6'));var config=require('../../config/environment');var jayson=require(_0x20cd('0x7'));var client=jayson[_0x20cd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x355b92,_0x18cf47,_0x38b23c){return new BPromise(function(_0x57410c,_0x30fcd1){return client[_0x20cd('0x9')](_0x355b92,_0x38b23c)['then'](function(_0x30f645){logger[_0x20cd('0xa')]('MailServerIn,\x20%s,\x20%s',_0x18cf47,_0x20cd('0xb'));logger[_0x20cd('0xc')](_0x20cd('0xd'),_0x18cf47,'request\x20sent',JSON[_0x20cd('0xe')](_0x30f645));if(_0x30f645[_0x20cd('0xf')]){if(_0x30f645['error'][_0x20cd('0x10')]===0x1f4){logger['error'](_0x20cd('0x11'),_0x18cf47,_0x30f645[_0x20cd('0xf')][_0x20cd('0x12')]);return _0x30fcd1(_0x30f645[_0x20cd('0xf')]['message']);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x18cf47,_0x30f645[_0x20cd('0xf')]['message']);return _0x57410c(_0x30f645[_0x20cd('0xf')][_0x20cd('0x12')]);}else{logger[_0x20cd('0xa')](_0x20cd('0x11'),_0x18cf47,'request\x20sent');_0x57410c(_0x30f645[_0x20cd('0x13')][_0x20cd('0x12')]);}})[_0x20cd('0x14')](function(_0x226ece){logger[_0x20cd('0xf')](_0x20cd('0x11'),_0x18cf47,_0x226ece);_0x30fcd1(_0x226ece);});});}exports['GetMailServerIn']=function(_0x26135b){var _0x5e0237=this;return new Promise(function(_0x3027c5,_0x3b57f9){return db['MailServerIn'][_0x20cd('0x15')]({'raw':_0x26135b[_0x20cd('0x16')]?_0x26135b[_0x20cd('0x16')][_0x20cd('0x17')]===undefined?!![]:![]:!![],'where':_0x26135b['options']?_0x26135b[_0x20cd('0x16')][_0x20cd('0x18')]||null:null,'attributes':_0x26135b[_0x20cd('0x16')]?_0x26135b['options']['attributes']||null:null,'limit':_0x26135b[_0x20cd('0x16')]?_0x26135b[_0x20cd('0x16')][_0x20cd('0x19')]||null:null,'include':_0x26135b[_0x20cd('0x16')]?_0x26135b['options']['include']?_['map'](_0x26135b['options'][_0x20cd('0x1a')],function(_0x5206ac){return{'model':db[_0x5206ac[_0x20cd('0x1b')]],'as':_0x5206ac['as'],'attributes':_0x5206ac[_0x20cd('0x1c')],'include':_0x5206ac['include']?_[_0x20cd('0x1d')](_0x5206ac[_0x20cd('0x1a')],function(_0x103931){return{'model':db[_0x103931[_0x20cd('0x1b')]],'as':_0x103931['as'],'attributes':_0x103931[_0x20cd('0x1c')],'include':_0x103931[_0x20cd('0x1a')]?_[_0x20cd('0x1d')](_0x103931['include'],function(_0x31c773){return{'model':db[_0x31c773[_0x20cd('0x1b')]],'as':_0x31c773['as'],'attributes':_0x31c773[_0x20cd('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x20cd('0x1e')](function(_0x564c17){logger[_0x20cd('0xa')]('GetMailServerIn',_0x26135b);logger[_0x20cd('0xc')]('GetMailServerIn',_0x26135b,JSON['stringify'](_0x564c17));_0x3027c5(_0x564c17);})[_0x20cd('0x14')](function(_0x2364b4){logger[_0x20cd('0xf')](_0x20cd('0x1f'),_0x2364b4[_0x20cd('0x12')],_0x26135b);_0x3b57f9(_0x5e0237['error'](0x1f4,_0x2364b4[_0x20cd('0x12')]));});});}; \ No newline at end of file +var _0x2567=['../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailServerIn','MailServerIn','options','raw','where','include','model','attributes','map','debug','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x2567,0x1c7));var _0x7256=function(_0x5cc655,_0x4b6145){_0x5cc655=_0x5cc655-0x0;var _0x244379=_0x2567[_0x5cc655];return _0x244379;};'use strict';var _=require(_0x7256('0x0'));var util=require(_0x7256('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7256('0x2'));var fs=require('fs');var Redis=require(_0x7256('0x3'));var db=require(_0x7256('0x4'))['db'];var utils=require(_0x7256('0x5'));var logger=require('../../config/logger')(_0x7256('0x6'));var config=require(_0x7256('0x7'));var jayson=require(_0x7256('0x8'));var client=jayson[_0x7256('0x9')][_0x7256('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ce5c9,_0x383bf7,_0x15e913){return new BPromise(function(_0x3c3104,_0x31c458){return client[_0x7256('0xb')](_0x5ce5c9,_0x15e913)[_0x7256('0xc')](function(_0x22d1f1){logger[_0x7256('0xd')](_0x7256('0xe'),_0x383bf7,_0x7256('0xf'));logger['debug'](_0x7256('0x10'),_0x383bf7,_0x7256('0xf'),JSON['stringify'](_0x22d1f1));if(_0x22d1f1['error']){if(_0x22d1f1[_0x7256('0x11')][_0x7256('0x12')]===0x1f4){logger['error'](_0x7256('0xe'),_0x383bf7,_0x22d1f1[_0x7256('0x11')]['message']);return _0x31c458(_0x22d1f1['error'][_0x7256('0x13')]);}logger[_0x7256('0x11')](_0x7256('0xe'),_0x383bf7,_0x22d1f1[_0x7256('0x11')]['message']);return _0x3c3104(_0x22d1f1[_0x7256('0x11')][_0x7256('0x13')]);}else{logger['info']('MailServerIn,\x20%s,\x20%s',_0x383bf7,_0x7256('0xf'));_0x3c3104(_0x22d1f1[_0x7256('0x14')][_0x7256('0x13')]);}})[_0x7256('0x15')](function(_0x4dd220){logger['error']('MailServerIn,\x20%s,\x20%s',_0x383bf7,_0x4dd220);_0x31c458(_0x4dd220);});});}exports[_0x7256('0x16')]=function(_0x4b9933){var _0x20422a=this;return new Promise(function(_0x3ba265,_0x559a2f){return db[_0x7256('0x17')]['findAll']({'raw':_0x4b9933[_0x7256('0x18')]?_0x4b9933[_0x7256('0x18')][_0x7256('0x19')]===undefined?!![]:![]:!![],'where':_0x4b9933['options']?_0x4b9933[_0x7256('0x18')][_0x7256('0x1a')]||null:null,'attributes':_0x4b9933[_0x7256('0x18')]?_0x4b9933[_0x7256('0x18')]['attributes']||null:null,'limit':_0x4b9933[_0x7256('0x18')]?_0x4b9933[_0x7256('0x18')]['limit']||null:null,'include':_0x4b9933[_0x7256('0x18')]?_0x4b9933[_0x7256('0x18')]['include']?_['map'](_0x4b9933[_0x7256('0x18')][_0x7256('0x1b')],function(_0x539c32){return{'model':db[_0x539c32[_0x7256('0x1c')]],'as':_0x539c32['as'],'attributes':_0x539c32[_0x7256('0x1d')],'include':_0x539c32[_0x7256('0x1b')]?_[_0x7256('0x1e')](_0x539c32[_0x7256('0x1b')],function(_0x9ae1c){return{'model':db[_0x9ae1c[_0x7256('0x1c')]],'as':_0x9ae1c['as'],'attributes':_0x9ae1c[_0x7256('0x1d')],'include':_0x9ae1c[_0x7256('0x1b')]?_[_0x7256('0x1e')](_0x9ae1c[_0x7256('0x1b')],function(_0x343e32){return{'model':db[_0x343e32[_0x7256('0x1c')]],'as':_0x343e32['as'],'attributes':_0x343e32[_0x7256('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7256('0xc')](function(_0x165b4f){logger['info']('GetMailServerIn',_0x4b9933);logger[_0x7256('0x1f')]('GetMailServerIn',_0x4b9933,JSON[_0x7256('0x20')](_0x165b4f));_0x3ba265(_0x165b4f);})[_0x7256('0x15')](function(_0xae099f){logger[_0x7256('0x11')](_0x7256('0x16'),_0xae099f[_0x7256('0x13')],_0x4b9933);_0x559a2f(_0x20422a['error'](0x1f4,_0xae099f[_0x7256('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 10a7f1e..12402c5 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7a54,0x106));var _0x47a5=function(_0x4a8853,_0x119255){_0x4a8853=_0x4a8853-0x0;var _0x524ac5=_0x7a54[_0x4a8853];return _0x524ac5;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x7a54,0x106));var _0x47a5=function(_0x32a3a1,_0x203c26){_0x32a3a1=_0x32a3a1-0x0;var _0x56e8f3=_0x7a54[_0x32a3a1];return _0x56e8f3;};'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 f8541fe..2dc0fd0 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 _0x36e8=['STRING','INTEGER','BOOLEAN','exports'];(function(_0x5ce6b0,_0x4e68e2){var _0x458294=function(_0x2da340){while(--_0x2da340){_0x5ce6b0['push'](_0x5ce6b0['shift']());}};_0x458294(++_0x4e68e2);}(_0x36e8,0x103));var _0x836e=function(_0x572faa,_0x47ef4d){_0x572faa=_0x572faa-0x0;var _0x21e63f=_0x36e8[_0x572faa];return _0x21e63f;};'use strict';var Sequelize=require('sequelize');module[_0x836e('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x836e('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x836e('0x1')]},'port':{'type':Sequelize[_0x836e('0x2')]},'secure':{'type':Sequelize[_0x836e('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x836e('0x1')]},'authentication':{'type':Sequelize[_0x836e('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4610=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x257a59,_0x3cda3d){var _0x54f22e=function(_0x5386a4){while(--_0x5386a4){_0x257a59['push'](_0x257a59['shift']());}};_0x54f22e(++_0x3cda3d);}(_0x4610,0xfb));var _0x0461=function(_0x377f50,_0x5589ba){_0x377f50=_0x377f50-0x0;var _0x14a9d2=_0x4610[_0x377f50];return _0x14a9d2;};'use strict';var Sequelize=require(_0x0461('0x0'));module[_0x0461('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0461('0x2')]},'user':{'type':Sequelize[_0x0461('0x2')]},'pass':{'type':Sequelize[_0x0461('0x2')]},'port':{'type':Sequelize[_0x0461('0x3')]},'secure':{'type':Sequelize[_0x0461('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x0461('0x2')]},'authentication':{'type':Sequelize[_0x0461('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 8fce122..0112367 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 _0xbd00=['update','error','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','offset','sort','where','filter','merge','options','MailServerOut','includeAll','include','catch','show','find','then','create','body','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','apply','reject','save'];(function(_0x4b4592,_0x1b70ad){var _0x568f68=function(_0x5a6f6b){while(--_0x5a6f6b){_0x4b4592['push'](_0x4b4592['shift']());}};_0x568f68(++_0x1b70ad);}(_0xbd00,0xb2));var _0x0bd0=function(_0x389abb,_0x241f9f){_0x389abb=_0x389abb-0x0;var _0x36d5b0=_0xbd00[_0x389abb];return _0x36d5b0;};'use strict';var emlformat=require(_0x0bd0('0x0'));var rimraf=require(_0x0bd0('0x1'));var zipdir=require(_0x0bd0('0x2'));var jsonpatch=require(_0x0bd0('0x3'));var rp=require(_0x0bd0('0x4'));var moment=require(_0x0bd0('0x5'));var BPromise=require(_0x0bd0('0x6'));var Mustache=require(_0x0bd0('0x7'));var util=require(_0x0bd0('0x8'));var path=require('path');var sox=require(_0x0bd0('0x9'));var csv=require('to-csv');var ejs=require(_0x0bd0('0xa'));var fs=require('fs');var fs_extra=require(_0x0bd0('0xb'));var _=require(_0x0bd0('0xc'));var squel=require(_0x0bd0('0xd'));var crypto=require(_0x0bd0('0xe'));var jsforce=require(_0x0bd0('0xf'));var deskjs=require(_0x0bd0('0x10'));var toCsv=require(_0x0bd0('0x11'));var querystring=require(_0x0bd0('0x12'));var Papa=require('papaparse');var Redis=require(_0x0bd0('0x13'));var authService=require(_0x0bd0('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bd0('0x15'));var logger=require(_0x0bd0('0x16'))(_0x0bd0('0x17'));var utils=require('../../config/utils');var config=require(_0x0bd0('0x18'));var licenseUtil=require(_0x0bd0('0x19'));var db=require(_0x0bd0('0x1a'))['db'];function respondWithStatusCode(_0x2fe5f5,_0x45d1f2){_0x45d1f2=_0x45d1f2||0xcc;return function(_0x19d16a){if(_0x19d16a){return _0x2fe5f5[_0x0bd0('0x1b')](_0x45d1f2);}return _0x2fe5f5[_0x0bd0('0x1c')](_0x45d1f2)[_0x0bd0('0x1d')]();};}function respondWithResult(_0x48a50e,_0xdd298b){_0xdd298b=_0xdd298b||0xc8;return function(_0x4b5421){if(_0x4b5421){return _0x48a50e[_0x0bd0('0x1c')](_0xdd298b)[_0x0bd0('0x1e')](_0x4b5421);}};}function respondWithFilteredResult(_0x49a9b0,_0x1ff0a9){return function(_0x338ca8){if(_0x338ca8){var _0x50e648=typeof _0x1ff0a9['offset']===_0x0bd0('0x1f')&&typeof _0x1ff0a9[_0x0bd0('0x20')]===_0x0bd0('0x1f');var _0x5eeb05=_0x338ca8[_0x0bd0('0x21')];var _0x67a724=_0x50e648?0x0:_0x1ff0a9['offset'];var _0x2b1833=_0x50e648?_0x338ca8[_0x0bd0('0x21')]:_0x1ff0a9['offset']+_0x1ff0a9['limit'];var _0x18b58d;if(_0x2b1833>=_0x5eeb05){_0x2b1833=_0x5eeb05;_0x18b58d=0xc8;}else{_0x18b58d=0xce;}_0x49a9b0[_0x0bd0('0x1c')](_0x18b58d);return _0x49a9b0[_0x0bd0('0x22')]('Content-Range',_0x67a724+'-'+_0x2b1833+'/'+_0x5eeb05)['json'](_0x338ca8);}return null;};}function patchUpdates(_0x4adfce){return function(_0x1d5e2e){try{jsonpatch[_0x0bd0('0x23')](_0x1d5e2e,_0x4adfce,!![]);}catch(_0x12da7){return BPromise[_0x0bd0('0x24')](_0x12da7);}return _0x1d5e2e[_0x0bd0('0x25')]();};}function saveUpdates(_0x38512e,_0x1d88f8){return function(_0x4a07dc){if(_0x4a07dc){return _0x4a07dc[_0x0bd0('0x26')](_0x38512e)['then'](function(_0x40402a){return _0x40402a;});}return null;};}function removeEntity(_0x2e4402,_0x4c9b74){return function(_0x4888b0){if(_0x4888b0){return _0x4888b0['destroy']()['then'](function(){_0x2e4402[_0x0bd0('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d3407,_0x4b0a2c){return function(_0x2f5822){if(!_0x2f5822){_0x3d3407['sendStatus'](0x194);}return _0x2f5822;};}function handleError(_0x33a6ea,_0x281338){_0x281338=_0x281338||0x1f4;return function(_0x3536f9){logger[_0x0bd0('0x27')](_0x3536f9['stack']);if(_0x3536f9[_0x0bd0('0x28')]){delete _0x3536f9[_0x0bd0('0x28')];}_0x33a6ea[_0x0bd0('0x1c')](_0x281338)[_0x0bd0('0x29')](_0x3536f9);};}exports[_0x0bd0('0x2a')]=function(_0x20e536,_0x34b348){var _0x3db4e0={},_0x331305={},_0x2bd6e2={'count':0x0,'rows':[]};var _0x3009a8=_[_0x0bd0('0x2b')](db['MailServerOut'][_0x0bd0('0x2c')],function(_0x23fc54){return{'name':_0x23fc54['fieldName'],'type':_0x23fc54[_0x0bd0('0x2d')]['key']};});_0x331305[_0x0bd0('0x2e')]=_[_0x0bd0('0x2b')](_0x3009a8,'name');_0x331305[_0x0bd0('0x2f')]=_[_0x0bd0('0x30')](_0x20e536[_0x0bd0('0x2f')]);_0x331305[_0x0bd0('0x31')]=_['intersection'](_0x331305['model'],_0x331305['query']);_0x3db4e0['attributes']=_[_0x0bd0('0x32')](_0x331305[_0x0bd0('0x2e')],qs[_0x0bd0('0x33')](_0x20e536['query'][_0x0bd0('0x33')]));_0x3db4e0['attributes']=_0x3db4e0['attributes'][_0x0bd0('0x34')]?_0x3db4e0[_0x0bd0('0x35')]:_0x331305['model'];if(!_0x20e536[_0x0bd0('0x2f')][_0x0bd0('0x36')]('nolimit')){_0x3db4e0[_0x0bd0('0x20')]=qs[_0x0bd0('0x20')](_0x20e536[_0x0bd0('0x2f')]['limit']);_0x3db4e0[_0x0bd0('0x37')]=qs['offset'](_0x20e536[_0x0bd0('0x2f')]['offset']);}_0x3db4e0['order']=qs['sort'](_0x20e536[_0x0bd0('0x2f')][_0x0bd0('0x38')]);_0x3db4e0[_0x0bd0('0x39')]=qs[_0x0bd0('0x31')](_['pick'](_0x20e536[_0x0bd0('0x2f')],_0x331305['filters']),_0x3009a8);if(_0x20e536[_0x0bd0('0x2f')][_0x0bd0('0x3a')]){_0x3db4e0[_0x0bd0('0x39')]=_[_0x0bd0('0x3b')](_0x3db4e0[_0x0bd0('0x39')],{'$or':_[_0x0bd0('0x2b')](_0x3009a8,function(_0x5eecba){if(_0x5eecba[_0x0bd0('0x2d')]!=='VIRTUAL'){var _0x8ba554={};_0x8ba554[_0x5eecba[_0x0bd0('0x28')]]={'$like':'%'+_0x20e536['query'][_0x0bd0('0x3a')]+'%'};return _0x8ba554;}})});}_0x3db4e0=_[_0x0bd0('0x3b')]({},_0x3db4e0,_0x20e536[_0x0bd0('0x3c')]);var _0x57bd0a={'where':_0x3db4e0[_0x0bd0('0x39')]};return db[_0x0bd0('0x3d')][_0x0bd0('0x21')](_0x57bd0a)['then'](function(_0x1b3dd9){_0x2bd6e2[_0x0bd0('0x21')]=_0x1b3dd9;if(_0x20e536[_0x0bd0('0x2f')][_0x0bd0('0x3e')]){_0x3db4e0[_0x0bd0('0x3f')]=[{'all':!![]}];}return db[_0x0bd0('0x3d')]['findAll'](_0x3db4e0);})['then'](function(_0x2d9d2b){_0x2bd6e2['rows']=_0x2d9d2b;return _0x2bd6e2;})['then'](respondWithFilteredResult(_0x34b348,_0x3db4e0))[_0x0bd0('0x40')](handleError(_0x34b348,null));};exports[_0x0bd0('0x41')]=function(_0x28f9d2,_0x58c31f){var _0x39e76b={'raw':!![],'where':{'id':_0x28f9d2['params']['id']}},_0x1078e4={};_0x1078e4['model']=_[_0x0bd0('0x30')](db[_0x0bd0('0x3d')][_0x0bd0('0x2c')]);_0x1078e4['query']=_[_0x0bd0('0x30')](_0x28f9d2[_0x0bd0('0x2f')]);_0x1078e4['filters']=_[_0x0bd0('0x32')](_0x1078e4[_0x0bd0('0x2e')],_0x1078e4[_0x0bd0('0x2f')]);_0x39e76b[_0x0bd0('0x35')]=_[_0x0bd0('0x32')](_0x1078e4['model'],qs[_0x0bd0('0x33')](_0x28f9d2[_0x0bd0('0x2f')]['fields']));_0x39e76b['attributes']=_0x39e76b[_0x0bd0('0x35')][_0x0bd0('0x34')]?_0x39e76b[_0x0bd0('0x35')]:_0x1078e4[_0x0bd0('0x2e')];if(_0x28f9d2[_0x0bd0('0x2f')]['includeAll']){_0x39e76b[_0x0bd0('0x3f')]=[{'all':!![]}];}_0x39e76b=_[_0x0bd0('0x3b')]({},_0x39e76b,_0x28f9d2[_0x0bd0('0x3c')]);return db[_0x0bd0('0x3d')][_0x0bd0('0x42')](_0x39e76b)[_0x0bd0('0x43')](handleEntityNotFound(_0x58c31f,null))[_0x0bd0('0x43')](respondWithResult(_0x58c31f,null))['catch'](handleError(_0x58c31f,null));};exports[_0x0bd0('0x44')]=function(_0x14e1a3,_0x38197b){return db[_0x0bd0('0x3d')]['create'](_0x14e1a3[_0x0bd0('0x45')],{})[_0x0bd0('0x43')](respondWithResult(_0x38197b,0xc9))[_0x0bd0('0x40')](handleError(_0x38197b,null));};exports[_0x0bd0('0x26')]=function(_0x5aa368,_0x41bc7c){if(_0x5aa368[_0x0bd0('0x45')]['id']){delete _0x5aa368[_0x0bd0('0x45')]['id'];}return db['MailServerOut'][_0x0bd0('0x42')]({'where':{'id':_0x5aa368['params']['id']}})[_0x0bd0('0x43')](handleEntityNotFound(_0x41bc7c,null))[_0x0bd0('0x43')](saveUpdates(_0x5aa368['body'],null))[_0x0bd0('0x43')](respondWithResult(_0x41bc7c,null))[_0x0bd0('0x40')](handleError(_0x41bc7c,null));};exports[_0x0bd0('0x46')]=function(_0xea5fd1,_0x47dd15){return db[_0x0bd0('0x3d')][_0x0bd0('0x42')]({'where':{'id':_0xea5fd1[_0x0bd0('0x47')]['id']}})[_0x0bd0('0x43')](handleEntityNotFound(_0x47dd15,null))[_0x0bd0('0x43')](removeEntity(_0x47dd15,null))[_0x0bd0('0x40')](handleError(_0x47dd15,null));}; \ No newline at end of file +var _0x2fa5=['limit','count','set','json','then','destroy','error','stack','name','send','index','MailServerOut','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined'];(function(_0x1f8bcc,_0x49f5a0){var _0x2509d1=function(_0x57ae50){while(--_0x57ae50){_0x1f8bcc['push'](_0x1f8bcc['shift']());}};_0x2509d1(++_0x49f5a0);}(_0x2fa5,0x14c));var _0x52fa=function(_0x348700,_0x4d85b4){_0x348700=_0x348700-0x0;var _0x22397b=_0x2fa5[_0x348700];return _0x22397b;};'use strict';var emlformat=require(_0x52fa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x52fa('0x1'));var rp=require(_0x52fa('0x2'));var moment=require('moment');var BPromise=require(_0x52fa('0x3'));var Mustache=require(_0x52fa('0x4'));var util=require(_0x52fa('0x5'));var path=require('path');var sox=require(_0x52fa('0x6'));var csv=require(_0x52fa('0x7'));var ejs=require(_0x52fa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x52fa('0x9'));var crypto=require(_0x52fa('0xa'));var jsforce=require(_0x52fa('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x52fa('0x7'));var querystring=require('querystring');var Papa=require(_0x52fa('0xc'));var Redis=require(_0x52fa('0xd'));var authService=require(_0x52fa('0xe'));var qs=require(_0x52fa('0xf'));var as=require(_0x52fa('0x10'));var hardwareService=require(_0x52fa('0x11'));var logger=require(_0x52fa('0x12'))(_0x52fa('0x13'));var utils=require(_0x52fa('0x14'));var config=require(_0x52fa('0x15'));var licenseUtil=require(_0x52fa('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x478a0c,_0x4ed76d){_0x4ed76d=_0x4ed76d||0xcc;return function(_0x3fef38){if(_0x3fef38){return _0x478a0c[_0x52fa('0x17')](_0x4ed76d);}return _0x478a0c['status'](_0x4ed76d)[_0x52fa('0x18')]();};}function respondWithResult(_0x5e7b72,_0x172bf1){_0x172bf1=_0x172bf1||0xc8;return function(_0x42c97f){if(_0x42c97f){return _0x5e7b72[_0x52fa('0x19')](_0x172bf1)['json'](_0x42c97f);}};}function respondWithFilteredResult(_0x439474,_0x300fea){return function(_0x4ec0d9){if(_0x4ec0d9){var _0x2d833d=typeof _0x300fea[_0x52fa('0x1a')]===_0x52fa('0x1b')&&typeof _0x300fea[_0x52fa('0x1c')]===_0x52fa('0x1b');var _0x179b58=_0x4ec0d9[_0x52fa('0x1d')];var _0x5af549=_0x2d833d?0x0:_0x300fea[_0x52fa('0x1a')];var _0x540146=_0x2d833d?_0x4ec0d9[_0x52fa('0x1d')]:_0x300fea['offset']+_0x300fea[_0x52fa('0x1c')];var _0x231fa5;if(_0x540146>=_0x179b58){_0x540146=_0x179b58;_0x231fa5=0xc8;}else{_0x231fa5=0xce;}_0x439474[_0x52fa('0x19')](_0x231fa5);return _0x439474[_0x52fa('0x1e')]('Content-Range',_0x5af549+'-'+_0x540146+'/'+_0x179b58)[_0x52fa('0x1f')](_0x4ec0d9);}return null;};}function patchUpdates(_0x513bff){return function(_0x728d6b){try{jsonpatch['apply'](_0x728d6b,_0x513bff,!![]);}catch(_0x48a406){return BPromise['reject'](_0x48a406);}return _0x728d6b['save']();};}function saveUpdates(_0x1d46ef,_0x2ccf6a){return function(_0x126669){if(_0x126669){return _0x126669['update'](_0x1d46ef)[_0x52fa('0x20')](function(_0x1e877d){return _0x1e877d;});}return null;};}function removeEntity(_0x20fa4a,_0xd28945){return function(_0xc05f23){if(_0xc05f23){return _0xc05f23[_0x52fa('0x21')]()[_0x52fa('0x20')](function(){_0x20fa4a[_0x52fa('0x19')](0xcc)[_0x52fa('0x18')]();});}};}function handleEntityNotFound(_0x3e8c04,_0x3194b4){return function(_0x25ac72){if(!_0x25ac72){_0x3e8c04[_0x52fa('0x17')](0x194);}return _0x25ac72;};}function handleError(_0x4db6e6,_0x4a286f){_0x4a286f=_0x4a286f||0x1f4;return function(_0x27ef67){logger[_0x52fa('0x22')](_0x27ef67[_0x52fa('0x23')]);if(_0x27ef67['name']){delete _0x27ef67[_0x52fa('0x24')];}_0x4db6e6['status'](_0x4a286f)[_0x52fa('0x25')](_0x27ef67);};}exports[_0x52fa('0x26')]=function(_0x125c1a,_0x410916){var _0x1b1e3c={},_0x280728={},_0xa7eaab={'count':0x0,'rows':[]};var _0x33b45c=_['map'](db[_0x52fa('0x27')][_0x52fa('0x28')],function(_0x4e9c9d){return{'name':_0x4e9c9d[_0x52fa('0x29')],'type':_0x4e9c9d[_0x52fa('0x2a')][_0x52fa('0x2b')]};});_0x280728[_0x52fa('0x2c')]=_[_0x52fa('0x2d')](_0x33b45c,_0x52fa('0x24'));_0x280728['query']=_['keys'](_0x125c1a[_0x52fa('0x2e')]);_0x280728[_0x52fa('0x2f')]=_[_0x52fa('0x30')](_0x280728[_0x52fa('0x2c')],_0x280728['query']);_0x1b1e3c[_0x52fa('0x31')]=_['intersection'](_0x280728[_0x52fa('0x2c')],qs['fields'](_0x125c1a['query'][_0x52fa('0x32')]));_0x1b1e3c[_0x52fa('0x31')]=_0x1b1e3c[_0x52fa('0x31')][_0x52fa('0x33')]?_0x1b1e3c['attributes']:_0x280728[_0x52fa('0x2c')];if(!_0x125c1a[_0x52fa('0x2e')][_0x52fa('0x34')](_0x52fa('0x35'))){_0x1b1e3c[_0x52fa('0x1c')]=qs['limit'](_0x125c1a[_0x52fa('0x2e')]['limit']);_0x1b1e3c['offset']=qs[_0x52fa('0x1a')](_0x125c1a[_0x52fa('0x2e')][_0x52fa('0x1a')]);}_0x1b1e3c[_0x52fa('0x36')]=qs[_0x52fa('0x37')](_0x125c1a[_0x52fa('0x2e')]['sort']);_0x1b1e3c[_0x52fa('0x38')]=qs[_0x52fa('0x2f')](_[_0x52fa('0x39')](_0x125c1a[_0x52fa('0x2e')],_0x280728[_0x52fa('0x2f')]),_0x33b45c);if(_0x125c1a['query'][_0x52fa('0x3a')]){_0x1b1e3c[_0x52fa('0x38')]=_[_0x52fa('0x3b')](_0x1b1e3c['where'],{'$or':_[_0x52fa('0x2d')](_0x33b45c,function(_0x1a3619){if(_0x1a3619[_0x52fa('0x2a')]!=='VIRTUAL'){var _0x706a5={};_0x706a5[_0x1a3619[_0x52fa('0x24')]]={'$like':'%'+_0x125c1a[_0x52fa('0x2e')][_0x52fa('0x3a')]+'%'};return _0x706a5;}})});}_0x1b1e3c=_[_0x52fa('0x3b')]({},_0x1b1e3c,_0x125c1a[_0x52fa('0x3c')]);var _0x272bf9={'where':_0x1b1e3c[_0x52fa('0x38')]};return db['MailServerOut'][_0x52fa('0x1d')](_0x272bf9)[_0x52fa('0x20')](function(_0x3be639){_0xa7eaab['count']=_0x3be639;if(_0x125c1a[_0x52fa('0x2e')][_0x52fa('0x3d')]){_0x1b1e3c[_0x52fa('0x3e')]=[{'all':!![]}];}return db['MailServerOut'][_0x52fa('0x3f')](_0x1b1e3c);})[_0x52fa('0x20')](function(_0x22c44a){_0xa7eaab[_0x52fa('0x40')]=_0x22c44a;return _0xa7eaab;})[_0x52fa('0x20')](respondWithFilteredResult(_0x410916,_0x1b1e3c))[_0x52fa('0x41')](handleError(_0x410916,null));};exports[_0x52fa('0x42')]=function(_0x4744e1,_0x44fe2f){var _0x385b96={'raw':!![],'where':{'id':_0x4744e1[_0x52fa('0x43')]['id']}},_0x40323f={};_0x40323f[_0x52fa('0x2c')]=_['keys'](db[_0x52fa('0x27')][_0x52fa('0x28')]);_0x40323f[_0x52fa('0x2e')]=_[_0x52fa('0x44')](_0x4744e1['query']);_0x40323f[_0x52fa('0x2f')]=_[_0x52fa('0x30')](_0x40323f[_0x52fa('0x2c')],_0x40323f[_0x52fa('0x2e')]);_0x385b96[_0x52fa('0x31')]=_[_0x52fa('0x30')](_0x40323f[_0x52fa('0x2c')],qs[_0x52fa('0x32')](_0x4744e1[_0x52fa('0x2e')]['fields']));_0x385b96[_0x52fa('0x31')]=_0x385b96[_0x52fa('0x31')][_0x52fa('0x33')]?_0x385b96[_0x52fa('0x31')]:_0x40323f[_0x52fa('0x2c')];if(_0x4744e1[_0x52fa('0x2e')][_0x52fa('0x3d')]){_0x385b96[_0x52fa('0x3e')]=[{'all':!![]}];}_0x385b96=_[_0x52fa('0x3b')]({},_0x385b96,_0x4744e1[_0x52fa('0x3c')]);return db[_0x52fa('0x27')][_0x52fa('0x45')](_0x385b96)[_0x52fa('0x20')](handleEntityNotFound(_0x44fe2f,null))[_0x52fa('0x20')](respondWithResult(_0x44fe2f,null))[_0x52fa('0x41')](handleError(_0x44fe2f,null));};exports[_0x52fa('0x46')]=function(_0x2395da,_0x28193a){return db[_0x52fa('0x27')][_0x52fa('0x46')](_0x2395da[_0x52fa('0x47')],{})['then'](respondWithResult(_0x28193a,0xc9))[_0x52fa('0x41')](handleError(_0x28193a,null));};exports['update']=function(_0x206e15,_0x748800){if(_0x206e15['body']['id']){delete _0x206e15['body']['id'];}return db['MailServerOut']['find']({'where':{'id':_0x206e15['params']['id']}})[_0x52fa('0x20')](handleEntityNotFound(_0x748800,null))['then'](saveUpdates(_0x206e15[_0x52fa('0x47')],null))[_0x52fa('0x20')](respondWithResult(_0x748800,null))[_0x52fa('0x41')](handleError(_0x748800,null));};exports['destroy']=function(_0x51adad,_0x421398){return db[_0x52fa('0x27')][_0x52fa('0x45')]({'where':{'id':_0x51adad['params']['id']}})[_0x52fa('0x20')](handleEntityNotFound(_0x421398,null))[_0x52fa('0x20')](removeEntity(_0x421398,null))[_0x52fa('0x41')](handleError(_0x421398,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 19ce765..fa145eb 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 _0xe66d=['MailServerOut','mail_servers_out','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0xe66d,0x1a6));var _0xde66=function(_0x3d66f0,_0x3f4e63){_0x3d66f0=_0x3d66f0-0x0;var _0x4164f3=_0xe66d[_0x3d66f0];return _0x4164f3;};'use strict';var _=require(_0xde66('0x0'));var util=require(_0xde66('0x1'));var logger=require(_0xde66('0x2'))('api');var moment=require(_0xde66('0x3'));var BPromise=require(_0xde66('0x4'));var rp=require(_0xde66('0x5'));var fs=require('fs');var path=require(_0xde66('0x6'));var rimraf=require(_0xde66('0x7'));var config=require(_0xde66('0x8'));var attributes=require(_0xde66('0x9'));module[_0xde66('0xa')]=function(_0x3210da,_0x31eba8){return _0x3210da[_0xde66('0xb')](_0xde66('0xc'),attributes,{'tableName':_0xde66('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x17c8=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerOut.attributes','MailServerOut','mail_servers_out','lodash'];(function(_0x4de3e4,_0x4b12da){var _0xd170d5=function(_0x2b8fde){while(--_0x2b8fde){_0x4de3e4['push'](_0x4de3e4['shift']());}};_0xd170d5(++_0x4b12da);}(_0x17c8,0x1af));var _0x817c=function(_0x2fb744,_0x46dbb1){_0x2fb744=_0x2fb744-0x0;var _0x169912=_0x17c8[_0x2fb744];return _0x169912;};'use strict';var _=require(_0x817c('0x0'));var util=require(_0x817c('0x1'));var logger=require(_0x817c('0x2'))(_0x817c('0x3'));var moment=require(_0x817c('0x4'));var BPromise=require(_0x817c('0x5'));var rp=require(_0x817c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x817c('0x7'));var config=require(_0x817c('0x8'));var attributes=require(_0x817c('0x9'));module['exports']=function(_0x5d40ab,_0x1f41e8){return _0x5d40ab['define'](_0x817c('0xa'),attributes,{'tableName':_0x817c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index c5b2e09..7e61e9d 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x3a8d20,_0x44a859){var _0x419bc3=function(_0x5b151f){while(--_0x5b151f){_0x3a8d20['push'](_0x3a8d20['shift']());}};_0x419bc3(++_0x44a859);}(_0x1261,0x144));var _0x1126=function(_0x272d97,_0x3cb745){_0x272d97=_0x272d97-0x0;var _0x40fc01=_0x1261[_0x272d97];return _0x40fc01;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x1a5673,_0x4edadc){var _0x1a8951=function(_0x3f91fc){while(--_0x3f91fc){_0x1a5673['push'](_0x1a5673['shift']());}};_0x1a8951(++_0x4edadc);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3434db,_0x55f7e3){_0x3434db=_0x3434db-0x0;var _0x1c0c49=_0x5f2f[_0x3434db];return _0x1c0c49;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index c0923d0..39cac38 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 _0x58b3=['delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update'];(function(_0x289694,_0x55ca7a){var _0x99a438=function(_0x347712){while(--_0x347712){_0x289694['push'](_0x289694['shift']());}};_0x99a438(++_0x55ca7a);}(_0x58b3,0x153));var _0x358b=function(_0x157e5e,_0x179639){_0x157e5e=_0x157e5e-0x0;var _0x2d692d=_0x58b3[_0x157e5e];return _0x2d692d;};'use strict';var multer=require(_0x358b('0x0'));var util=require('util');var path=require(_0x358b('0x1'));var timeout=require('connect-timeout');var express=require(_0x358b('0x2'));var router=express[_0x358b('0x3')]();var fs_extra=require(_0x358b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x358b('0x5'));var config=require(_0x358b('0x6'));var controller=require(_0x358b('0x7'));router[_0x358b('0x8')]('/',auth[_0x358b('0x9')](),controller['index']);router[_0x358b('0x8')](_0x358b('0xa'),auth[_0x358b('0x9')](),controller[_0x358b('0xb')]);router['get'](_0x358b('0xc'),auth[_0x358b('0x9')](),controller[_0x358b('0xd')]);router[_0x358b('0xe')]('/',auth[_0x358b('0x9')](),controller[_0x358b('0xf')]);router[_0x358b('0x10')](_0x358b('0xc'),auth['isAuthenticated'](),controller[_0x358b('0x11')]);router[_0x358b('0x12')](_0x358b('0xc'),auth['isAuthenticated'](),controller[_0x358b('0x13')]);module[_0x358b('0x14')]=router; \ No newline at end of file +var _0xd4eb=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','util','path'];(function(_0x53846d,_0x116d77){var _0x51b922=function(_0x2214a5){while(--_0x2214a5){_0x53846d['push'](_0x53846d['shift']());}};_0x51b922(++_0x116d77);}(_0xd4eb,0x83));var _0xbd4e=function(_0x97c2dc,_0x213a4b){_0x97c2dc=_0x97c2dc-0x0;var _0x7fd0d0=_0xd4eb[_0x97c2dc];return _0x7fd0d0;};'use strict';var multer=require('multer');var util=require(_0xbd4e('0x0'));var path=require(_0xbd4e('0x1'));var timeout=require(_0xbd4e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbd4e('0x3'));var auth=require(_0xbd4e('0x4'));var interaction=require(_0xbd4e('0x5'));var config=require(_0xbd4e('0x6'));var controller=require(_0xbd4e('0x7'));router[_0xbd4e('0x8')]('/',auth[_0xbd4e('0x9')](),controller[_0xbd4e('0xa')]);router[_0xbd4e('0x8')](_0xbd4e('0xb'),auth[_0xbd4e('0x9')](),controller[_0xbd4e('0xc')]);router[_0xbd4e('0x8')](_0xbd4e('0xd'),auth[_0xbd4e('0x9')](),controller[_0xbd4e('0xe')]);router['post']('/',auth[_0xbd4e('0x9')](),controller[_0xbd4e('0xf')]);router[_0xbd4e('0x10')]('/:id',auth[_0xbd4e('0x9')](),controller['update']);router[_0xbd4e('0x11')](_0xbd4e('0xd'),auth[_0xbd4e('0x9')](),controller[_0xbd4e('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index cb1b80e..521380c 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 _0xe714=['name','sequelize','STRING'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xe714,0xe2));var _0x4e71=function(_0x5f1fa,_0x4cde13){_0x5f1fa=_0x5f1fa-0x0;var _0x6331cf=_0xe714[_0x5f1fa];return _0x6331cf;};'use strict';var Sequelize=require(_0x4e71('0x0'));module['exports']={'name':{'type':Sequelize[_0x4e71('0x1')],'unique':_0x4e71('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4e71('0x1')]}}; \ No newline at end of file +var _0x31af=['sequelize','exports','STRING'];(function(_0x52cd66,_0x37dfc3){var _0x26fc62=function(_0x110933){while(--_0x110933){_0x52cd66['push'](_0x52cd66['shift']());}};_0x26fc62(++_0x37dfc3);}(_0x31af,0xde));var _0xf31a=function(_0x5e29cc,_0x4cc7ca){_0x5e29cc=_0x5e29cc-0x0;var _0x2f2bb6=_0x31af[_0x5e29cc];return _0x2f2bb6;};'use strict';var Sequelize=require(_0xf31a('0x0'));module[_0xf31a('0x1')]={'name':{'type':Sequelize[_0xf31a('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 2eee2bc..d49597d 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 _0x611b=['undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset'];(function(_0x5b5bed,_0x3ec262){var _0x38fead=function(_0x5b1eee){while(--_0x5b1eee){_0x5b5bed['push'](_0x5b5bed['shift']());}};_0x38fead(++_0x3ec262);}(_0x611b,0x1c6));var _0xb611=function(_0x37091d,_0x2fa386){_0x37091d=_0x37091d-0x0;var _0x460173=_0x611b[_0x37091d];return _0x460173;};'use strict';var emlformat=require(_0xb611('0x0'));var rimraf=require(_0xb611('0x1'));var zipdir=require(_0xb611('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb611('0x3'));var moment=require(_0xb611('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb611('0x5'));var util=require(_0xb611('0x6'));var path=require(_0xb611('0x7'));var sox=require(_0xb611('0x8'));var csv=require(_0xb611('0x9'));var ejs=require(_0xb611('0xa'));var fs=require('fs');var fs_extra=require(_0xb611('0xb'));var _=require(_0xb611('0xc'));var squel=require(_0xb611('0xd'));var crypto=require(_0xb611('0xe'));var jsforce=require(_0xb611('0xf'));var deskjs=require(_0xb611('0x10'));var toCsv=require(_0xb611('0x9'));var querystring=require(_0xb611('0x11'));var Papa=require(_0xb611('0x12'));var Redis=require(_0xb611('0x13'));var authService=require(_0xb611('0x14'));var qs=require(_0xb611('0x15'));var as=require(_0xb611('0x16'));var hardwareService=require(_0xb611('0x17'));var logger=require(_0xb611('0x18'))('api');var utils=require(_0xb611('0x19'));var config=require(_0xb611('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xb611('0x1b'))['db'];function respondWithStatusCode(_0x48f527,_0x4b7e66){_0x4b7e66=_0x4b7e66||0xcc;return function(_0x9f8bf2){if(_0x9f8bf2){return _0x48f527[_0xb611('0x1c')](_0x4b7e66);}return _0x48f527[_0xb611('0x1d')](_0x4b7e66)[_0xb611('0x1e')]();};}function respondWithResult(_0xbf8aca,_0x20ed62){_0x20ed62=_0x20ed62||0xc8;return function(_0x4224d3){if(_0x4224d3){return _0xbf8aca[_0xb611('0x1d')](_0x20ed62)['json'](_0x4224d3);}};}function respondWithFilteredResult(_0x218c9b,_0x58f189){return function(_0x2f1a01){if(_0x2f1a01){var _0x2b14e2=typeof _0x58f189[_0xb611('0x1f')]===_0xb611('0x20')&&typeof _0x58f189[_0xb611('0x21')]===_0xb611('0x20');var _0x15fe75=_0x2f1a01['count'];var _0x101444=_0x2b14e2?0x0:_0x58f189['offset'];var _0x28b644=_0x2b14e2?_0x2f1a01[_0xb611('0x22')]:_0x58f189[_0xb611('0x1f')]+_0x58f189[_0xb611('0x21')];var _0x3b415b;if(_0x28b644>=_0x15fe75){_0x28b644=_0x15fe75;_0x3b415b=0xc8;}else{_0x3b415b=0xce;}_0x218c9b['status'](_0x3b415b);return _0x218c9b['set'](_0xb611('0x23'),_0x101444+'-'+_0x28b644+'/'+_0x15fe75)[_0xb611('0x24')](_0x2f1a01);}return null;};}function patchUpdates(_0x2bc69b){return function(_0x27529a){try{jsonpatch[_0xb611('0x25')](_0x27529a,_0x2bc69b,!![]);}catch(_0x5ca0c4){return BPromise[_0xb611('0x26')](_0x5ca0c4);}return _0x27529a[_0xb611('0x27')]();};}function saveUpdates(_0x10ecad,_0xb2f8f9){return function(_0x4d1e7d){if(_0x4d1e7d){return _0x4d1e7d[_0xb611('0x28')](_0x10ecad)[_0xb611('0x29')](function(_0x3828bd){return _0x3828bd;});}return null;};}function removeEntity(_0x409916,_0x1c964e){return function(_0x508027){if(_0x508027){return _0x508027[_0xb611('0x2a')]()[_0xb611('0x29')](function(){_0x409916['status'](0xcc)[_0xb611('0x1e')]();});}};}function handleEntityNotFound(_0x42b8f4,_0x3506d6){return function(_0x2bc9cf){if(!_0x2bc9cf){_0x42b8f4[_0xb611('0x1c')](0x194);}return _0x2bc9cf;};}function handleError(_0x3baf44,_0x1d20b8){_0x1d20b8=_0x1d20b8||0x1f4;return function(_0x35a6a2){logger[_0xb611('0x2b')](_0x35a6a2[_0xb611('0x2c')]);if(_0x35a6a2[_0xb611('0x2d')]){delete _0x35a6a2['name'];}_0x3baf44[_0xb611('0x1d')](_0x1d20b8)[_0xb611('0x2e')](_0x35a6a2);};}exports[_0xb611('0x2f')]=function(_0x197be6,_0x598802){var _0x57d956={},_0x423d25={},_0x38df77={'count':0x0,'rows':[]};var _0x98f6bf=_[_0xb611('0x30')](db[_0xb611('0x31')]['rawAttributes'],function(_0xda4701){return{'name':_0xda4701[_0xb611('0x32')],'type':_0xda4701['type'][_0xb611('0x33')]};});_0x423d25[_0xb611('0x34')]=_[_0xb611('0x30')](_0x98f6bf,'name');_0x423d25[_0xb611('0x35')]=_[_0xb611('0x36')](_0x197be6[_0xb611('0x35')]);_0x423d25[_0xb611('0x37')]=_[_0xb611('0x38')](_0x423d25[_0xb611('0x34')],_0x423d25['query']);_0x57d956[_0xb611('0x39')]=_['intersection'](_0x423d25['model'],qs[_0xb611('0x3a')](_0x197be6[_0xb611('0x35')][_0xb611('0x3a')]));_0x57d956[_0xb611('0x39')]=_0x57d956['attributes']['length']?_0x57d956[_0xb611('0x39')]:_0x423d25[_0xb611('0x34')];if(!_0x197be6[_0xb611('0x35')][_0xb611('0x3b')]('nolimit')){_0x57d956[_0xb611('0x21')]=qs['limit'](_0x197be6[_0xb611('0x35')][_0xb611('0x21')]);_0x57d956['offset']=qs[_0xb611('0x1f')](_0x197be6[_0xb611('0x35')][_0xb611('0x1f')]);}_0x57d956[_0xb611('0x3c')]=qs['sort'](_0x197be6[_0xb611('0x35')][_0xb611('0x3d')]);_0x57d956[_0xb611('0x3e')]=qs[_0xb611('0x37')](_[_0xb611('0x3f')](_0x197be6[_0xb611('0x35')],_0x423d25['filters']),_0x98f6bf);if(_0x197be6['query'][_0xb611('0x40')]){_0x57d956[_0xb611('0x3e')]=_[_0xb611('0x41')](_0x57d956[_0xb611('0x3e')],{'$or':_[_0xb611('0x30')](_0x98f6bf,function(_0x270b8a){if(_0x270b8a[_0xb611('0x42')]!==_0xb611('0x43')){var _0x54f781={};_0x54f781[_0x270b8a[_0xb611('0x2d')]]={'$like':'%'+_0x197be6[_0xb611('0x35')][_0xb611('0x40')]+'%'};return _0x54f781;}})});}_0x57d956=_[_0xb611('0x41')]({},_0x57d956,_0x197be6[_0xb611('0x44')]);var _0x4e2555={'where':_0x57d956[_0xb611('0x3e')]};return db[_0xb611('0x31')]['count'](_0x4e2555)['then'](function(_0x5d8e11){_0x38df77['count']=_0x5d8e11;if(_0x197be6[_0xb611('0x35')][_0xb611('0x45')]){_0x57d956[_0xb611('0x46')]=[{'all':!![]}];}return db[_0xb611('0x31')][_0xb611('0x47')](_0x57d956);})['then'](function(_0x3844b2){_0x38df77[_0xb611('0x48')]=_0x3844b2;return _0x38df77;})['then'](respondWithFilteredResult(_0x598802,_0x57d956))[_0xb611('0x49')](handleError(_0x598802,null));};exports['show']=function(_0x52b57f,_0x10c12b){var _0x11bdda={'raw':!![],'where':{'id':_0x52b57f[_0xb611('0x4a')]['id']}},_0x537872={};_0x537872[_0xb611('0x34')]=_[_0xb611('0x36')](db[_0xb611('0x31')][_0xb611('0x4b')]);_0x537872[_0xb611('0x35')]=_[_0xb611('0x36')](_0x52b57f['query']);_0x537872[_0xb611('0x37')]=_['intersection'](_0x537872[_0xb611('0x34')],_0x537872[_0xb611('0x35')]);_0x11bdda['attributes']=_[_0xb611('0x38')](_0x537872[_0xb611('0x34')],qs[_0xb611('0x3a')](_0x52b57f['query']['fields']));_0x11bdda[_0xb611('0x39')]=_0x11bdda[_0xb611('0x39')][_0xb611('0x4c')]?_0x11bdda[_0xb611('0x39')]:_0x537872[_0xb611('0x34')];if(_0x52b57f['query'][_0xb611('0x45')]){_0x11bdda[_0xb611('0x46')]=[{'all':!![]}];}_0x11bdda=_[_0xb611('0x41')]({},_0x11bdda,_0x52b57f[_0xb611('0x44')]);return db[_0xb611('0x31')][_0xb611('0x4d')](_0x11bdda)[_0xb611('0x29')](handleEntityNotFound(_0x10c12b,null))[_0xb611('0x29')](respondWithResult(_0x10c12b,null))['catch'](handleError(_0x10c12b,null));};exports['create']=function(_0x1056e4,_0x1d5454){return db[_0xb611('0x31')][_0xb611('0x4e')](_0x1056e4[_0xb611('0x4f')],{})[_0xb611('0x29')](respondWithResult(_0x1d5454,0xc9))['catch'](handleError(_0x1d5454,null));};exports[_0xb611('0x28')]=function(_0x5e5d64,_0x565749){if(_0x5e5d64[_0xb611('0x4f')]['id']){delete _0x5e5d64['body']['id'];}return db[_0xb611('0x31')][_0xb611('0x4d')]({'where':{'id':_0x5e5d64[_0xb611('0x4a')]['id']}})['then'](handleEntityNotFound(_0x565749,null))[_0xb611('0x29')](saveUpdates(_0x5e5d64[_0xb611('0x4f')],null))['then'](respondWithResult(_0x565749,null))[_0xb611('0x49')](handleError(_0x565749,null));};exports['destroy']=function(_0x1c4655,_0x5b7e7d){return db[_0xb611('0x31')][_0xb611('0x4d')]({'where':{'id':_0x1c4655['params']['id']}})[_0xb611('0x29')](handleEntityNotFound(_0x5b7e7d,null))[_0xb611('0x29')](removeEntity(_0x5b7e7d,null))[_0xb611('0x49')](handleError(_0x5b7e7d,null));};exports['describe']=function(_0x5321f1,_0x4c8aad){return db['MailSubstatus'][_0xb611('0x50')]()[_0xb611('0x29')](respondWithResult(_0x4c8aad,null))[_0xb611('0x49')](handleError(_0x4c8aad,null));}; \ No newline at end of file +var _0xe708=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','reject','save','destroy','then','stack','name','send','index','MailSubstatus','fieldName','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger'];(function(_0x2b5ccf,_0x45b1c8){var _0x4b3b60=function(_0x569223){while(--_0x569223){_0x2b5ccf['push'](_0x2b5ccf['shift']());}};_0x4b3b60(++_0x45b1c8);}(_0xe708,0x1e5));var _0x8e70=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xe708[_0x1a9204];return _0x17ca68;};'use strict';var emlformat=require(_0x8e70('0x0'));var rimraf=require(_0x8e70('0x1'));var zipdir=require(_0x8e70('0x2'));var jsonpatch=require(_0x8e70('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8e70('0x4'));var Mustache=require(_0x8e70('0x5'));var util=require(_0x8e70('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8e70('0x7'));var ejs=require(_0x8e70('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8e70('0x9'));var squel=require(_0x8e70('0xa'));var crypto=require(_0x8e70('0xb'));var jsforce=require(_0x8e70('0xc'));var deskjs=require(_0x8e70('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8e70('0xe'));var Papa=require(_0x8e70('0xf'));var Redis=require(_0x8e70('0x10'));var authService=require(_0x8e70('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8e70('0x12'))(_0x8e70('0x13'));var utils=require(_0x8e70('0x14'));var config=require(_0x8e70('0x15'));var licenseUtil=require(_0x8e70('0x16'));var db=require(_0x8e70('0x17'))['db'];function respondWithStatusCode(_0x384cf1,_0x447172){_0x447172=_0x447172||0xcc;return function(_0x5b47c1){if(_0x5b47c1){return _0x384cf1[_0x8e70('0x18')](_0x447172);}return _0x384cf1[_0x8e70('0x19')](_0x447172)[_0x8e70('0x1a')]();};}function respondWithResult(_0x1564d1,_0x10498d){_0x10498d=_0x10498d||0xc8;return function(_0x2c4f1b){if(_0x2c4f1b){return _0x1564d1[_0x8e70('0x19')](_0x10498d)['json'](_0x2c4f1b);}};}function respondWithFilteredResult(_0x2c7455,_0x2794ca){return function(_0x2be314){if(_0x2be314){var _0x1dfc69=typeof _0x2794ca[_0x8e70('0x1b')]==='undefined'&&typeof _0x2794ca[_0x8e70('0x1c')]===_0x8e70('0x1d');var _0x495814=_0x2be314[_0x8e70('0x1e')];var _0x192603=_0x1dfc69?0x0:_0x2794ca[_0x8e70('0x1b')];var _0x196e84=_0x1dfc69?_0x2be314[_0x8e70('0x1e')]:_0x2794ca[_0x8e70('0x1b')]+_0x2794ca['limit'];var _0x3c3468;if(_0x196e84>=_0x495814){_0x196e84=_0x495814;_0x3c3468=0xc8;}else{_0x3c3468=0xce;}_0x2c7455[_0x8e70('0x19')](_0x3c3468);return _0x2c7455[_0x8e70('0x1f')]('Content-Range',_0x192603+'-'+_0x196e84+'/'+_0x495814)[_0x8e70('0x20')](_0x2be314);}return null;};}function patchUpdates(_0x15a91b){return function(_0x4e684a){try{jsonpatch['apply'](_0x4e684a,_0x15a91b,!![]);}catch(_0x36ab3d){return BPromise[_0x8e70('0x21')](_0x36ab3d);}return _0x4e684a[_0x8e70('0x22')]();};}function saveUpdates(_0x1502e6,_0x3292bf){return function(_0x43e49f){if(_0x43e49f){return _0x43e49f['update'](_0x1502e6)['then'](function(_0x38239d){return _0x38239d;});}return null;};}function removeEntity(_0x21519e,_0x1076ee){return function(_0x521f6f){if(_0x521f6f){return _0x521f6f[_0x8e70('0x23')]()[_0x8e70('0x24')](function(){_0x21519e[_0x8e70('0x19')](0xcc)[_0x8e70('0x1a')]();});}};}function handleEntityNotFound(_0xbefcbe,_0x39b538){return function(_0x6aafa8){if(!_0x6aafa8){_0xbefcbe[_0x8e70('0x18')](0x194);}return _0x6aafa8;};}function handleError(_0x92cdc6,_0x1b9bb0){_0x1b9bb0=_0x1b9bb0||0x1f4;return function(_0x943c43){logger['error'](_0x943c43[_0x8e70('0x25')]);if(_0x943c43[_0x8e70('0x26')]){delete _0x943c43[_0x8e70('0x26')];}_0x92cdc6[_0x8e70('0x19')](_0x1b9bb0)[_0x8e70('0x27')](_0x943c43);};}exports[_0x8e70('0x28')]=function(_0x12ad6d,_0x1f1780){var _0x20fe74={},_0x43a894={},_0x3513c8={'count':0x0,'rows':[]};var _0x3f3209=_['map'](db[_0x8e70('0x29')]['rawAttributes'],function(_0x42d4f2){return{'name':_0x42d4f2[_0x8e70('0x2a')],'type':_0x42d4f2['type']['key']};});_0x43a894[_0x8e70('0x2b')]=_[_0x8e70('0x2c')](_0x3f3209,_0x8e70('0x26'));_0x43a894['query']=_['keys'](_0x12ad6d[_0x8e70('0x2d')]);_0x43a894[_0x8e70('0x2e')]=_[_0x8e70('0x2f')](_0x43a894['model'],_0x43a894['query']);_0x20fe74[_0x8e70('0x30')]=_[_0x8e70('0x2f')](_0x43a894['model'],qs[_0x8e70('0x31')](_0x12ad6d['query'][_0x8e70('0x31')]));_0x20fe74[_0x8e70('0x30')]=_0x20fe74['attributes'][_0x8e70('0x32')]?_0x20fe74[_0x8e70('0x30')]:_0x43a894[_0x8e70('0x2b')];if(!_0x12ad6d['query']['hasOwnProperty']('nolimit')){_0x20fe74[_0x8e70('0x1c')]=qs[_0x8e70('0x1c')](_0x12ad6d['query'][_0x8e70('0x1c')]);_0x20fe74[_0x8e70('0x1b')]=qs[_0x8e70('0x1b')](_0x12ad6d['query'][_0x8e70('0x1b')]);}_0x20fe74[_0x8e70('0x33')]=qs['sort'](_0x12ad6d['query'][_0x8e70('0x34')]);_0x20fe74[_0x8e70('0x35')]=qs[_0x8e70('0x2e')](_['pick'](_0x12ad6d[_0x8e70('0x2d')],_0x43a894[_0x8e70('0x2e')]),_0x3f3209);if(_0x12ad6d['query'][_0x8e70('0x36')]){_0x20fe74[_0x8e70('0x35')]=_[_0x8e70('0x37')](_0x20fe74[_0x8e70('0x35')],{'$or':_[_0x8e70('0x2c')](_0x3f3209,function(_0x578439){if(_0x578439[_0x8e70('0x38')]!==_0x8e70('0x39')){var _0xe8b123={};_0xe8b123[_0x578439[_0x8e70('0x26')]]={'$like':'%'+_0x12ad6d[_0x8e70('0x2d')]['filter']+'%'};return _0xe8b123;}})});}_0x20fe74=_[_0x8e70('0x37')]({},_0x20fe74,_0x12ad6d[_0x8e70('0x3a')]);var _0x5dcd03={'where':_0x20fe74[_0x8e70('0x35')]};return db[_0x8e70('0x29')][_0x8e70('0x1e')](_0x5dcd03)['then'](function(_0x311fb2){_0x3513c8[_0x8e70('0x1e')]=_0x311fb2;if(_0x12ad6d['query'][_0x8e70('0x3b')]){_0x20fe74['include']=[{'all':!![]}];}return db[_0x8e70('0x29')]['findAll'](_0x20fe74);})[_0x8e70('0x24')](function(_0x2b818a){_0x3513c8[_0x8e70('0x3c')]=_0x2b818a;return _0x3513c8;})[_0x8e70('0x24')](respondWithFilteredResult(_0x1f1780,_0x20fe74))[_0x8e70('0x3d')](handleError(_0x1f1780,null));};exports[_0x8e70('0x3e')]=function(_0x4c5f7c,_0x1131ce){var _0x19612e={'raw':!![],'where':{'id':_0x4c5f7c[_0x8e70('0x3f')]['id']}},_0x41efb3={};_0x41efb3[_0x8e70('0x2b')]=_[_0x8e70('0x40')](db[_0x8e70('0x29')][_0x8e70('0x41')]);_0x41efb3[_0x8e70('0x2d')]=_[_0x8e70('0x40')](_0x4c5f7c[_0x8e70('0x2d')]);_0x41efb3[_0x8e70('0x2e')]=_[_0x8e70('0x2f')](_0x41efb3[_0x8e70('0x2b')],_0x41efb3[_0x8e70('0x2d')]);_0x19612e['attributes']=_[_0x8e70('0x2f')](_0x41efb3[_0x8e70('0x2b')],qs[_0x8e70('0x31')](_0x4c5f7c[_0x8e70('0x2d')][_0x8e70('0x31')]));_0x19612e['attributes']=_0x19612e['attributes'][_0x8e70('0x32')]?_0x19612e[_0x8e70('0x30')]:_0x41efb3['model'];if(_0x4c5f7c[_0x8e70('0x2d')]['includeAll']){_0x19612e[_0x8e70('0x42')]=[{'all':!![]}];}_0x19612e=_[_0x8e70('0x37')]({},_0x19612e,_0x4c5f7c[_0x8e70('0x3a')]);return db[_0x8e70('0x29')][_0x8e70('0x43')](_0x19612e)[_0x8e70('0x24')](handleEntityNotFound(_0x1131ce,null))['then'](respondWithResult(_0x1131ce,null))[_0x8e70('0x3d')](handleError(_0x1131ce,null));};exports[_0x8e70('0x44')]=function(_0x343763,_0x3ef83f){return db[_0x8e70('0x29')]['create'](_0x343763[_0x8e70('0x45')],{})[_0x8e70('0x24')](respondWithResult(_0x3ef83f,0xc9))[_0x8e70('0x3d')](handleError(_0x3ef83f,null));};exports[_0x8e70('0x46')]=function(_0x4dd953,_0x5d987b){if(_0x4dd953[_0x8e70('0x45')]['id']){delete _0x4dd953[_0x8e70('0x45')]['id'];}return db[_0x8e70('0x29')]['find']({'where':{'id':_0x4dd953['params']['id']}})[_0x8e70('0x24')](handleEntityNotFound(_0x5d987b,null))[_0x8e70('0x24')](saveUpdates(_0x4dd953[_0x8e70('0x45')],null))[_0x8e70('0x24')](respondWithResult(_0x5d987b,null))['catch'](handleError(_0x5d987b,null));};exports[_0x8e70('0x23')]=function(_0xc19a56,_0x326d06){return db[_0x8e70('0x29')][_0x8e70('0x43')]({'where':{'id':_0xc19a56['params']['id']}})['then'](handleEntityNotFound(_0x326d06,null))['then'](removeEntity(_0x326d06,null))[_0x8e70('0x3d')](handleError(_0x326d06,null));};exports[_0x8e70('0x47')]=function(_0x4b6916,_0x4cf432){return db[_0x8e70('0x29')][_0x8e70('0x47')]()[_0x8e70('0x24')](respondWithResult(_0x4cf432,null))[_0x8e70('0x3d')](handleError(_0x4cf432,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index b9763dd..21546c2 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 _0x7790=['rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','mail_substatuses','api','moment','bluebird','request-promise','path'];(function(_0x394672,_0x1788fb){var _0x55ef72=function(_0x15a6ce){while(--_0x15a6ce){_0x394672['push'](_0x394672['shift']());}};_0x55ef72(++_0x1788fb);}(_0x7790,0x12f));var _0x0779=function(_0x4f1e91,_0xf36de4){_0x4f1e91=_0x4f1e91-0x0;var _0x3d97be=_0x7790[_0x4f1e91];return _0x3d97be;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0779('0x0'));var moment=require(_0x0779('0x1'));var BPromise=require(_0x0779('0x2'));var rp=require(_0x0779('0x3'));var fs=require('fs');var path=require(_0x0779('0x4'));var rimraf=require(_0x0779('0x5'));var config=require(_0x0779('0x6'));var attributes=require(_0x0779('0x7'));module[_0x0779('0x8')]=function(_0x255939,_0xfe5547){return _0x255939[_0x0779('0x9')]('MailSubstatus',attributes,{'tableName':_0x0779('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf14f=['path','rimraf','../../config/environment','./mailSubstatus.attributes','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x26cb06,_0x5d0a2c){var _0x34a7e2=function(_0x5ecbcf){while(--_0x5ecbcf){_0x26cb06['push'](_0x26cb06['shift']());}};_0x34a7e2(++_0x5d0a2c);}(_0xf14f,0x8a));var _0xff14=function(_0x8bb4c1,_0x2d6e53){_0x8bb4c1=_0x8bb4c1-0x0;var _0x67a6e1=_0xf14f[_0x8bb4c1];return _0x67a6e1;};'use strict';var _=require(_0xff14('0x0'));var util=require(_0xff14('0x1'));var logger=require(_0xff14('0x2'))(_0xff14('0x3'));var moment=require('moment');var BPromise=require(_0xff14('0x4'));var rp=require(_0xff14('0x5'));var fs=require('fs');var path=require(_0xff14('0x6'));var rimraf=require(_0xff14('0x7'));var config=require(_0xff14('0x8'));var attributes=require(_0xff14('0x9'));module['exports']=function(_0x326e72,_0x1cadb8){return _0x326e72['define'](_0xff14('0xa'),attributes,{'tableName':_0xff14('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index ff2242a..545bbe6 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 _0xf4fb=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x46b442,_0x275476){var _0x4ce85e=function(_0x5431b2){while(--_0x5431b2){_0x46b442['push'](_0x46b442['shift']());}};_0x4ce85e(++_0x275476);}(_0xf4fb,0x83));var _0xbf4f=function(_0x417bc3,_0x3e652d){_0x417bc3=_0x417bc3-0x0;var _0x9d9491=_0xf4fb[_0x417bc3];return _0x9d9491;};'use strict';var _=require(_0xbf4f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbf4f('0x1'));var rs=require(_0xbf4f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf4f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf4f('0x4'))(_0xbf4f('0x5'));var config=require(_0xbf4f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xbf4f('0x7')][_0xbf4f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b7736,_0x24ef5e,_0x4cb458){return new BPromise(function(_0x124be0,_0x3d4165){return client[_0xbf4f('0x9')](_0x5b7736,_0x4cb458)[_0xbf4f('0xa')](function(_0x252fb5){logger[_0xbf4f('0xb')](_0xbf4f('0xc'),_0x24ef5e,_0xbf4f('0xd'));logger[_0xbf4f('0xe')](_0xbf4f('0xf'),_0x24ef5e,'request\x20sent',JSON[_0xbf4f('0x10')](_0x252fb5));if(_0x252fb5[_0xbf4f('0x11')]){if(_0x252fb5[_0xbf4f('0x11')][_0xbf4f('0x12')]===0x1f4){logger[_0xbf4f('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x24ef5e,_0x252fb5['error'][_0xbf4f('0x13')]);return _0x3d4165(_0x252fb5[_0xbf4f('0x11')][_0xbf4f('0x13')]);}logger[_0xbf4f('0x11')](_0xbf4f('0xc'),_0x24ef5e,_0x252fb5[_0xbf4f('0x11')][_0xbf4f('0x13')]);return _0x124be0(_0x252fb5['error'][_0xbf4f('0x13')]);}else{logger[_0xbf4f('0xb')](_0xbf4f('0xc'),_0x24ef5e,_0xbf4f('0xd'));_0x124be0(_0x252fb5[_0xbf4f('0x14')][_0xbf4f('0x13')]);}})[_0xbf4f('0x15')](function(_0x4930cb){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x24ef5e,_0x4930cb);_0x3d4165(_0x4930cb);});});} \ No newline at end of file +var _0x8888=['jayson/promise','http','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8888,0x99));var _0x8888=function(_0x43cf0e,_0x241496){_0x43cf0e=_0x43cf0e-0x0;var _0x46452b=_0x8888[_0x43cf0e];return _0x46452b;};'use strict';var _=require(_0x8888('0x0'));var util=require(_0x8888('0x1'));var moment=require(_0x8888('0x2'));var BPromise=require('bluebird');var rs=require(_0x8888('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8888('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8888('0x5'))(_0x8888('0x6'));var config=require('../../config/environment');var jayson=require(_0x8888('0x7'));var client=jayson['client'][_0x8888('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4dd006,_0x36611a,_0x3248a8){return new BPromise(function(_0x2bcffa,_0x4d8443){return client['request'](_0x4dd006,_0x3248a8)[_0x8888('0x9')](function(_0x53109b){logger[_0x8888('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x36611a,_0x8888('0xb'));logger[_0x8888('0xc')](_0x8888('0xd'),_0x36611a,_0x8888('0xb'),JSON[_0x8888('0xe')](_0x53109b));if(_0x53109b[_0x8888('0xf')]){if(_0x53109b[_0x8888('0xf')]['code']===0x1f4){logger['error'](_0x8888('0x10'),_0x36611a,_0x53109b['error'][_0x8888('0x11')]);return _0x4d8443(_0x53109b[_0x8888('0xf')][_0x8888('0x11')]);}logger[_0x8888('0xf')](_0x8888('0x10'),_0x36611a,_0x53109b['error']['message']);return _0x2bcffa(_0x53109b[_0x8888('0xf')][_0x8888('0x11')]);}else{logger[_0x8888('0xa')](_0x8888('0x10'),_0x36611a,_0x8888('0xb'));_0x2bcffa(_0x53109b[_0x8888('0x12')][_0x8888('0x11')]);}})[_0x8888('0x13')](function(_0x4ded08){logger[_0x8888('0xf')](_0x8888('0x10'),_0x36611a,_0x4ded08);_0x4d8443(_0x4ded08);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 6a23d0c..7f9c128 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 _0x2067=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x63c794,_0x14f52c){var _0x16f319=function(_0x149940){while(--_0x149940){_0x63c794['push'](_0x63c794['shift']());}};_0x16f319(++_0x14f52c);}(_0x2067,0x1e0));var _0x7206=function(_0x3ed70a,_0x18c849){_0x3ed70a=_0x3ed70a-0x0;var _0x2add57=_0x2067[_0x3ed70a];return _0x2add57;};'use strict';var multer=require(_0x7206('0x0'));var util=require('util');var path=require(_0x7206('0x1'));var timeout=require(_0x7206('0x2'));var express=require(_0x7206('0x3'));var router=express[_0x7206('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7206('0x5'));var interaction=require(_0x7206('0x6'));var config=require(_0x7206('0x7'));var controller=require(_0x7206('0x8'));router['get']('/',auth[_0x7206('0x9')](),controller[_0x7206('0xa')]);router[_0x7206('0xb')](_0x7206('0xc'),auth[_0x7206('0x9')](),controller[_0x7206('0xd')]);router[_0x7206('0xb')](_0x7206('0xe'),auth[_0x7206('0x9')](),controller['show']);router[_0x7206('0xf')]('/',auth[_0x7206('0x9')](),controller[_0x7206('0x10')]);router[_0x7206('0x11')](_0x7206('0xe'),auth['isAuthenticated'](),controller[_0x7206('0x12')]);router[_0x7206('0x13')](_0x7206('0xe'),auth[_0x7206('0x9')](),controller[_0x7206('0x14')]);module[_0x7206('0x15')]=router; \ No newline at end of file +var _0xfa06=['exports','multer','util','path','connect-timeout','express','Router','./mailTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','put','update','delete','destroy'];(function(_0x349b5c,_0x55e5fa){var _0x3efcac=function(_0x27832d){while(--_0x27832d){_0x349b5c['push'](_0x349b5c['shift']());}};_0x3efcac(++_0x55e5fa);}(_0xfa06,0xf8));var _0x6fa0=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xfa06[_0x34bf97];return _0x292719;};'use strict';var multer=require(_0x6fa0('0x0'));var util=require(_0x6fa0('0x1'));var path=require(_0x6fa0('0x2'));var timeout=require(_0x6fa0('0x3'));var express=require(_0x6fa0('0x4'));var router=express[_0x6fa0('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6fa0('0x6'));router['get']('/',auth[_0x6fa0('0x7')](),controller[_0x6fa0('0x8')]);router[_0x6fa0('0x9')](_0x6fa0('0xa'),auth[_0x6fa0('0x7')](),controller['describe']);router[_0x6fa0('0x9')](_0x6fa0('0xb'),auth[_0x6fa0('0x7')](),controller[_0x6fa0('0xc')]);router[_0x6fa0('0xd')]('/',auth[_0x6fa0('0x7')](),controller['create']);router[_0x6fa0('0xe')](_0x6fa0('0xb'),auth['isAuthenticated'](),controller[_0x6fa0('0xf')]);router[_0x6fa0('0x10')](_0x6fa0('0xb'),auth[_0x6fa0('0x7')](),controller[_0x6fa0('0x11')]);module[_0x6fa0('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 1c1312b..7af4359 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xe7bb3f,_0x5a7c5a){var _0x2c139=function(_0x33c1b5){while(--_0x33c1b5){_0xe7bb3f['push'](_0xe7bb3f['shift']());}};_0x2c139(++_0x5a7c5a);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4b2494,_0x494d41){_0x4b2494=_0x4b2494-0x0;var _0x2c1436=_0xf3cd[_0x4b2494];return _0x2c1436;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x50d099,_0x1ac8d9){var _0x7d701c=function(_0x27d227){while(--_0x27d227){_0x50d099['push'](_0x50d099['shift']());}};_0x7d701c(++_0x1ac8d9);}(_0xedd9,0xfc));var _0x9edd=function(_0xb55612,_0x576eb2){_0xb55612=_0xb55612-0x0;var _0x391939=_0xedd9[_0xb55612];return _0x391939;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 67844ae..15d4994 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 _0x03c5=['end','error','name','index','map','MailTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','then'];(function(_0x3e3064,_0x3dd6f5){var _0x4547e1=function(_0x785d07){while(--_0x785d07){_0x3e3064['push'](_0x3e3064['shift']());}};_0x4547e1(++_0x3dd6f5);}(_0x03c5,0x108));var _0x503c=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x03c5[_0x9cd4c3];return _0x4c9025;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x503c('0x0'));var zipdir=require(_0x503c('0x1'));var jsonpatch=require(_0x503c('0x2'));var rp=require(_0x503c('0x3'));var moment=require(_0x503c('0x4'));var BPromise=require(_0x503c('0x5'));var Mustache=require(_0x503c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x503c('0x7'));var csv=require(_0x503c('0x8'));var ejs=require(_0x503c('0x9'));var fs=require('fs');var fs_extra=require(_0x503c('0xa'));var _=require(_0x503c('0xb'));var squel=require('squel');var crypto=require(_0x503c('0xc'));var jsforce=require(_0x503c('0xd'));var deskjs=require(_0x503c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x503c('0xf'));var Papa=require('papaparse');var Redis=require(_0x503c('0x10'));var authService=require(_0x503c('0x11'));var qs=require(_0x503c('0x12'));var as=require(_0x503c('0x13'));var hardwareService=require(_0x503c('0x14'));var logger=require(_0x503c('0x15'))(_0x503c('0x16'));var utils=require(_0x503c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x503c('0x18'));var db=require(_0x503c('0x19'))['db'];function respondWithStatusCode(_0x7372aa,_0x29f479){_0x29f479=_0x29f479||0xcc;return function(_0x137118){if(_0x137118){return _0x7372aa[_0x503c('0x1a')](_0x29f479);}return _0x7372aa[_0x503c('0x1b')](_0x29f479)['end']();};}function respondWithResult(_0x477cfb,_0x3737a8){_0x3737a8=_0x3737a8||0xc8;return function(_0x4b5bd5){if(_0x4b5bd5){return _0x477cfb[_0x503c('0x1b')](_0x3737a8)['json'](_0x4b5bd5);}};}function respondWithFilteredResult(_0x118101,_0xca291b){return function(_0x21e698){if(_0x21e698){var _0x3a36f8=typeof _0xca291b[_0x503c('0x1c')]===_0x503c('0x1d')&&typeof _0xca291b[_0x503c('0x1e')]===_0x503c('0x1d');var _0x155566=_0x21e698['count'];var _0x545a88=_0x3a36f8?0x0:_0xca291b[_0x503c('0x1c')];var _0x356cf2=_0x3a36f8?_0x21e698[_0x503c('0x1f')]:_0xca291b['offset']+_0xca291b[_0x503c('0x1e')];var _0x219fdf;if(_0x356cf2>=_0x155566){_0x356cf2=_0x155566;_0x219fdf=0xc8;}else{_0x219fdf=0xce;}_0x118101['status'](_0x219fdf);return _0x118101[_0x503c('0x20')](_0x503c('0x21'),_0x545a88+'-'+_0x356cf2+'/'+_0x155566)[_0x503c('0x22')](_0x21e698);}return null;};}function patchUpdates(_0x24a6c8){return function(_0x53a3bc){try{jsonpatch[_0x503c('0x23')](_0x53a3bc,_0x24a6c8,!![]);}catch(_0x248927){return BPromise['reject'](_0x248927);}return _0x53a3bc[_0x503c('0x24')]();};}function saveUpdates(_0x4689d6,_0x40c969){return function(_0x4745b1){if(_0x4745b1){return _0x4745b1[_0x503c('0x25')](_0x4689d6)['then'](function(_0x42f117){return _0x42f117;});}return null;};}function removeEntity(_0x291d88,_0x5cfeee){return function(_0x233cef){if(_0x233cef){return _0x233cef[_0x503c('0x26')]()[_0x503c('0x27')](function(){_0x291d88[_0x503c('0x1b')](0xcc)[_0x503c('0x28')]();});}};}function handleEntityNotFound(_0x5bb510,_0x1972d0){return function(_0x35ca07){if(!_0x35ca07){_0x5bb510[_0x503c('0x1a')](0x194);}return _0x35ca07;};}function handleError(_0x24fe9e,_0x1de959){_0x1de959=_0x1de959||0x1f4;return function(_0x4f1370){logger[_0x503c('0x29')](_0x4f1370['stack']);if(_0x4f1370[_0x503c('0x2a')]){delete _0x4f1370[_0x503c('0x2a')];}_0x24fe9e[_0x503c('0x1b')](_0x1de959)['send'](_0x4f1370);};}exports[_0x503c('0x2b')]=function(_0x514531,_0x341eef){var _0x4e973f={},_0x5f3534={},_0x24104a={'count':0x0,'rows':[]};var _0x2506f1=_[_0x503c('0x2c')](db[_0x503c('0x2d')][_0x503c('0x2e')],function(_0x52282e){return{'name':_0x52282e[_0x503c('0x2f')],'type':_0x52282e[_0x503c('0x30')]['key']};});_0x5f3534[_0x503c('0x31')]=_[_0x503c('0x2c')](_0x2506f1,_0x503c('0x2a'));_0x5f3534[_0x503c('0x32')]=_[_0x503c('0x33')](_0x514531['query']);_0x5f3534[_0x503c('0x34')]=_[_0x503c('0x35')](_0x5f3534[_0x503c('0x31')],_0x5f3534[_0x503c('0x32')]);_0x4e973f[_0x503c('0x36')]=_['intersection'](_0x5f3534[_0x503c('0x31')],qs[_0x503c('0x37')](_0x514531[_0x503c('0x32')][_0x503c('0x37')]));_0x4e973f[_0x503c('0x36')]=_0x4e973f[_0x503c('0x36')][_0x503c('0x38')]?_0x4e973f['attributes']:_0x5f3534[_0x503c('0x31')];if(!_0x514531[_0x503c('0x32')][_0x503c('0x39')](_0x503c('0x3a'))){_0x4e973f[_0x503c('0x1e')]=qs['limit'](_0x514531[_0x503c('0x32')][_0x503c('0x1e')]);_0x4e973f[_0x503c('0x1c')]=qs['offset'](_0x514531[_0x503c('0x32')]['offset']);}_0x4e973f[_0x503c('0x3b')]=qs[_0x503c('0x3c')](_0x514531[_0x503c('0x32')][_0x503c('0x3c')]);_0x4e973f['where']=qs[_0x503c('0x34')](_['pick'](_0x514531[_0x503c('0x32')],_0x5f3534[_0x503c('0x34')]),_0x2506f1);if(_0x514531[_0x503c('0x32')][_0x503c('0x3d')]){_0x4e973f[_0x503c('0x3e')]=_[_0x503c('0x3f')](_0x4e973f[_0x503c('0x3e')],{'$or':_[_0x503c('0x2c')](_0x2506f1,function(_0x101437){if(_0x101437[_0x503c('0x30')]!==_0x503c('0x40')){var _0x3d3a95={};_0x3d3a95[_0x101437[_0x503c('0x2a')]]={'$like':'%'+_0x514531[_0x503c('0x32')]['filter']+'%'};return _0x3d3a95;}})});}_0x4e973f=_['merge']({},_0x4e973f,_0x514531[_0x503c('0x41')]);var _0x182f59={'where':_0x4e973f[_0x503c('0x3e')]};return db[_0x503c('0x2d')][_0x503c('0x1f')](_0x182f59)['then'](function(_0x1833fb){_0x24104a[_0x503c('0x1f')]=_0x1833fb;if(_0x514531[_0x503c('0x32')][_0x503c('0x42')]){_0x4e973f[_0x503c('0x43')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x4e973f);})[_0x503c('0x27')](function(_0xc87723){_0x24104a[_0x503c('0x44')]=_0xc87723;return _0x24104a;})[_0x503c('0x27')](respondWithFilteredResult(_0x341eef,_0x4e973f))[_0x503c('0x45')](handleError(_0x341eef,null));};exports[_0x503c('0x46')]=function(_0x244738,_0x1e5b83){var _0x1313a2={'raw':!![],'where':{'id':_0x244738[_0x503c('0x47')]['id']}},_0x120a34={};_0x120a34[_0x503c('0x31')]=_['keys'](db[_0x503c('0x2d')][_0x503c('0x2e')]);_0x120a34[_0x503c('0x32')]=_['keys'](_0x244738[_0x503c('0x32')]);_0x120a34[_0x503c('0x34')]=_[_0x503c('0x35')](_0x120a34['model'],_0x120a34[_0x503c('0x32')]);_0x1313a2['attributes']=_['intersection'](_0x120a34[_0x503c('0x31')],qs['fields'](_0x244738['query']['fields']));_0x1313a2[_0x503c('0x36')]=_0x1313a2[_0x503c('0x36')][_0x503c('0x38')]?_0x1313a2['attributes']:_0x120a34[_0x503c('0x31')];if(_0x244738['query']['includeAll']){_0x1313a2[_0x503c('0x43')]=[{'all':!![]}];}_0x1313a2=_[_0x503c('0x3f')]({},_0x1313a2,_0x244738[_0x503c('0x41')]);return db[_0x503c('0x2d')][_0x503c('0x48')](_0x1313a2)[_0x503c('0x27')](handleEntityNotFound(_0x1e5b83,null))['then'](respondWithResult(_0x1e5b83,null))[_0x503c('0x45')](handleError(_0x1e5b83,null));};exports['create']=function(_0x19d53d,_0x1095b5){return db[_0x503c('0x2d')][_0x503c('0x49')](_0x19d53d['body'],{})[_0x503c('0x27')](respondWithResult(_0x1095b5,0xc9))[_0x503c('0x45')](handleError(_0x1095b5,null));};exports[_0x503c('0x25')]=function(_0x2be1e8,_0x3afd0e){if(_0x2be1e8['body']['id']){delete _0x2be1e8[_0x503c('0x4a')]['id'];}return db['MailTransferReport'][_0x503c('0x48')]({'where':{'id':_0x2be1e8[_0x503c('0x47')]['id']}})[_0x503c('0x27')](handleEntityNotFound(_0x3afd0e,null))[_0x503c('0x27')](saveUpdates(_0x2be1e8[_0x503c('0x4a')],null))[_0x503c('0x27')](respondWithResult(_0x3afd0e,null))[_0x503c('0x45')](handleError(_0x3afd0e,null));};exports[_0x503c('0x26')]=function(_0x40bc08,_0x53780f){return db[_0x503c('0x2d')][_0x503c('0x48')]({'where':{'id':_0x40bc08[_0x503c('0x47')]['id']}})[_0x503c('0x27')](handleEntityNotFound(_0x53780f,null))[_0x503c('0x27')](removeEntity(_0x53780f,null))['catch'](handleError(_0x53780f,null));};exports['describe']=function(_0x264b01,_0x4831aa){return db[_0x503c('0x2d')][_0x503c('0x4b')]()[_0x503c('0x27')](respondWithResult(_0x4831aa,null))['catch'](handleError(_0x4831aa,null));}; \ No newline at end of file +var _0x9e4d=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','set','update','then','destroy','error','stack','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','length','create','body','catch','find','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4e26b8,_0x1a3c12){var _0x10a6f0=function(_0x119948){while(--_0x119948){_0x4e26b8['push'](_0x4e26b8['shift']());}};_0x10a6f0(++_0x1a3c12);}(_0x9e4d,0x7a));var _0xd9e4=function(_0x3d9e7c,_0x97ca34){_0x3d9e7c=_0x3d9e7c-0x0;var _0x2fe9c6=_0x9e4d[_0x3d9e7c];return _0x2fe9c6;};'use strict';var emlformat=require(_0xd9e4('0x0'));var rimraf=require(_0xd9e4('0x1'));var zipdir=require(_0xd9e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd9e4('0x3'));var BPromise=require(_0xd9e4('0x4'));var Mustache=require(_0xd9e4('0x5'));var util=require(_0xd9e4('0x6'));var path=require('path');var sox=require(_0xd9e4('0x7'));var csv=require(_0xd9e4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9e4('0x9'));var _=require('lodash');var squel=require(_0xd9e4('0xa'));var crypto=require(_0xd9e4('0xb'));var jsforce=require(_0xd9e4('0xc'));var deskjs=require(_0xd9e4('0xd'));var toCsv=require(_0xd9e4('0x8'));var querystring=require(_0xd9e4('0xe'));var Papa=require(_0xd9e4('0xf'));var Redis=require(_0xd9e4('0x10'));var authService=require(_0xd9e4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd9e4('0x12'));var hardwareService=require(_0xd9e4('0x13'));var logger=require('../../config/logger')(_0xd9e4('0x14'));var utils=require(_0xd9e4('0x15'));var config=require(_0xd9e4('0x16'));var licenseUtil=require(_0xd9e4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48f5c0,_0x4ed076){_0x4ed076=_0x4ed076||0xcc;return function(_0x4c817c){if(_0x4c817c){return _0x48f5c0[_0xd9e4('0x18')](_0x4ed076);}return _0x48f5c0[_0xd9e4('0x19')](_0x4ed076)['end']();};}function respondWithResult(_0x3bc5e8,_0x2d1063){_0x2d1063=_0x2d1063||0xc8;return function(_0x2fdb82){if(_0x2fdb82){return _0x3bc5e8[_0xd9e4('0x19')](_0x2d1063)[_0xd9e4('0x1a')](_0x2fdb82);}};}function respondWithFilteredResult(_0x4c8c11,_0x51bfdb){return function(_0x198fc3){if(_0x198fc3){var _0x53ada5=typeof _0x51bfdb[_0xd9e4('0x1b')]==='undefined'&&typeof _0x51bfdb[_0xd9e4('0x1c')]==='undefined';var _0x2a6746=_0x198fc3[_0xd9e4('0x1d')];var _0x1cb220=_0x53ada5?0x0:_0x51bfdb['offset'];var _0x10f47d=_0x53ada5?_0x198fc3['count']:_0x51bfdb[_0xd9e4('0x1b')]+_0x51bfdb[_0xd9e4('0x1c')];var _0x5ce3db;if(_0x10f47d>=_0x2a6746){_0x10f47d=_0x2a6746;_0x5ce3db=0xc8;}else{_0x5ce3db=0xce;}_0x4c8c11[_0xd9e4('0x19')](_0x5ce3db);return _0x4c8c11[_0xd9e4('0x1e')]('Content-Range',_0x1cb220+'-'+_0x10f47d+'/'+_0x2a6746)[_0xd9e4('0x1a')](_0x198fc3);}return null;};}function patchUpdates(_0x7ef51){return function(_0x4a0aa1){try{jsonpatch['apply'](_0x4a0aa1,_0x7ef51,!![]);}catch(_0x17c2e3){return BPromise['reject'](_0x17c2e3);}return _0x4a0aa1['save']();};}function saveUpdates(_0x251e95,_0x1cdfc8){return function(_0x17eb7a){if(_0x17eb7a){return _0x17eb7a[_0xd9e4('0x1f')](_0x251e95)[_0xd9e4('0x20')](function(_0x4b0b1d){return _0x4b0b1d;});}return null;};}function removeEntity(_0x18e14c,_0x9b8e22){return function(_0x382285){if(_0x382285){return _0x382285[_0xd9e4('0x21')]()['then'](function(){_0x18e14c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe3566,_0x171c3e){return function(_0x1d9e4b){if(!_0x1d9e4b){_0xe3566[_0xd9e4('0x18')](0x194);}return _0x1d9e4b;};}function handleError(_0x512e18,_0x37c466){_0x37c466=_0x37c466||0x1f4;return function(_0x1cc811){logger[_0xd9e4('0x22')](_0x1cc811[_0xd9e4('0x23')]);if(_0x1cc811[_0xd9e4('0x24')]){delete _0x1cc811[_0xd9e4('0x24')];}_0x512e18[_0xd9e4('0x19')](_0x37c466)[_0xd9e4('0x25')](_0x1cc811);};}exports['index']=function(_0x7627f7,_0x3d457d){var _0x17e118={},_0x372782={},_0x70e213={'count':0x0,'rows':[]};var _0xd24637=_[_0xd9e4('0x26')](db[_0xd9e4('0x27')][_0xd9e4('0x28')],function(_0x38373f){return{'name':_0x38373f[_0xd9e4('0x29')],'type':_0x38373f[_0xd9e4('0x2a')][_0xd9e4('0x2b')]};});_0x372782[_0xd9e4('0x2c')]=_[_0xd9e4('0x26')](_0xd24637,_0xd9e4('0x24'));_0x372782[_0xd9e4('0x2d')]=_[_0xd9e4('0x2e')](_0x7627f7[_0xd9e4('0x2d')]);_0x372782['filters']=_[_0xd9e4('0x2f')](_0x372782[_0xd9e4('0x2c')],_0x372782[_0xd9e4('0x2d')]);_0x17e118[_0xd9e4('0x30')]=_[_0xd9e4('0x2f')](_0x372782[_0xd9e4('0x2c')],qs[_0xd9e4('0x31')](_0x7627f7[_0xd9e4('0x2d')][_0xd9e4('0x31')]));_0x17e118[_0xd9e4('0x30')]=_0x17e118[_0xd9e4('0x30')]['length']?_0x17e118['attributes']:_0x372782['model'];if(!_0x7627f7[_0xd9e4('0x2d')][_0xd9e4('0x32')](_0xd9e4('0x33'))){_0x17e118[_0xd9e4('0x1c')]=qs[_0xd9e4('0x1c')](_0x7627f7[_0xd9e4('0x2d')]['limit']);_0x17e118['offset']=qs[_0xd9e4('0x1b')](_0x7627f7[_0xd9e4('0x2d')][_0xd9e4('0x1b')]);}_0x17e118['order']=qs[_0xd9e4('0x34')](_0x7627f7[_0xd9e4('0x2d')][_0xd9e4('0x34')]);_0x17e118[_0xd9e4('0x35')]=qs[_0xd9e4('0x36')](_['pick'](_0x7627f7['query'],_0x372782[_0xd9e4('0x36')]),_0xd24637);if(_0x7627f7['query'][_0xd9e4('0x37')]){_0x17e118['where']=_[_0xd9e4('0x38')](_0x17e118['where'],{'$or':_[_0xd9e4('0x26')](_0xd24637,function(_0x1f3e34){if(_0x1f3e34[_0xd9e4('0x2a')]!==_0xd9e4('0x39')){var _0x3a0972={};_0x3a0972[_0x1f3e34[_0xd9e4('0x24')]]={'$like':'%'+_0x7627f7['query']['filter']+'%'};return _0x3a0972;}})});}_0x17e118=_[_0xd9e4('0x38')]({},_0x17e118,_0x7627f7[_0xd9e4('0x3a')]);var _0x4385b5={'where':_0x17e118[_0xd9e4('0x35')]};return db[_0xd9e4('0x27')][_0xd9e4('0x1d')](_0x4385b5)[_0xd9e4('0x20')](function(_0x2745b1){_0x70e213['count']=_0x2745b1;if(_0x7627f7[_0xd9e4('0x2d')][_0xd9e4('0x3b')]){_0x17e118[_0xd9e4('0x3c')]=[{'all':!![]}];}return db[_0xd9e4('0x27')][_0xd9e4('0x3d')](_0x17e118);})[_0xd9e4('0x20')](function(_0x1474bb){_0x70e213['rows']=_0x1474bb;return _0x70e213;})[_0xd9e4('0x20')](respondWithFilteredResult(_0x3d457d,_0x17e118))['catch'](handleError(_0x3d457d,null));};exports[_0xd9e4('0x3e')]=function(_0x3961a9,_0x1d7613){var _0x1cc7ce={'raw':!![],'where':{'id':_0x3961a9[_0xd9e4('0x3f')]['id']}},_0x3865f1={};_0x3865f1['model']=_[_0xd9e4('0x2e')](db[_0xd9e4('0x27')][_0xd9e4('0x28')]);_0x3865f1[_0xd9e4('0x2d')]=_[_0xd9e4('0x2e')](_0x3961a9[_0xd9e4('0x2d')]);_0x3865f1[_0xd9e4('0x36')]=_[_0xd9e4('0x2f')](_0x3865f1[_0xd9e4('0x2c')],_0x3865f1[_0xd9e4('0x2d')]);_0x1cc7ce['attributes']=_[_0xd9e4('0x2f')](_0x3865f1[_0xd9e4('0x2c')],qs['fields'](_0x3961a9[_0xd9e4('0x2d')][_0xd9e4('0x31')]));_0x1cc7ce['attributes']=_0x1cc7ce[_0xd9e4('0x30')][_0xd9e4('0x40')]?_0x1cc7ce['attributes']:_0x3865f1['model'];if(_0x3961a9[_0xd9e4('0x2d')][_0xd9e4('0x3b')]){_0x1cc7ce[_0xd9e4('0x3c')]=[{'all':!![]}];}_0x1cc7ce=_[_0xd9e4('0x38')]({},_0x1cc7ce,_0x3961a9['options']);return db['MailTransferReport']['find'](_0x1cc7ce)['then'](handleEntityNotFound(_0x1d7613,null))['then'](respondWithResult(_0x1d7613,null))['catch'](handleError(_0x1d7613,null));};exports[_0xd9e4('0x41')]=function(_0x4a843c,_0x168ade){return db[_0xd9e4('0x27')][_0xd9e4('0x41')](_0x4a843c[_0xd9e4('0x42')],{})['then'](respondWithResult(_0x168ade,0xc9))[_0xd9e4('0x43')](handleError(_0x168ade,null));};exports[_0xd9e4('0x1f')]=function(_0x3becb7,_0x2b936e){if(_0x3becb7[_0xd9e4('0x42')]['id']){delete _0x3becb7[_0xd9e4('0x42')]['id'];}return db[_0xd9e4('0x27')][_0xd9e4('0x44')]({'where':{'id':_0x3becb7[_0xd9e4('0x3f')]['id']}})[_0xd9e4('0x20')](handleEntityNotFound(_0x2b936e,null))['then'](saveUpdates(_0x3becb7['body'],null))[_0xd9e4('0x20')](respondWithResult(_0x2b936e,null))['catch'](handleError(_0x2b936e,null));};exports[_0xd9e4('0x21')]=function(_0x6162fd,_0x3418d8){return db[_0xd9e4('0x27')][_0xd9e4('0x44')]({'where':{'id':_0x6162fd['params']['id']}})[_0xd9e4('0x20')](handleEntityNotFound(_0x3418d8,null))[_0xd9e4('0x20')](removeEntity(_0x3418d8,null))[_0xd9e4('0x43')](handleError(_0x3418d8,null));};exports['describe']=function(_0x177261,_0x9329a0){return db[_0xd9e4('0x27')][_0xd9e4('0x45')]()[_0xd9e4('0x20')](respondWithResult(_0x9329a0,null))[_0xd9e4('0x43')](handleError(_0x9329a0,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index cde5500..8045f58 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 _0xad36=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','util','../../config/logger'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xad36,0x11c));var _0x6ad3=function(_0xc1b3b5,_0x488076){_0xc1b3b5=_0xc1b3b5-0x0;var _0x23a991=_0xad36[_0xc1b3b5];return _0x23a991;};'use strict';var _=require('lodash');var util=require(_0x6ad3('0x0'));var logger=require(_0x6ad3('0x1'))(_0x6ad3('0x2'));var moment=require(_0x6ad3('0x3'));var BPromise=require(_0x6ad3('0x4'));var rp=require(_0x6ad3('0x5'));var fs=require('fs');var path=require(_0x6ad3('0x6'));var rimraf=require(_0x6ad3('0x7'));var config=require(_0x6ad3('0x8'));var attributes=require('./mailTransferReport.attributes');module[_0x6ad3('0x9')]=function(_0x3d669f,_0x3c3041){return _0x3d669f[_0x6ad3('0xa')]('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd9f1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailTransferReport','uniqueid','lodash','util'];(function(_0x5316d4,_0x3e273a){var _0x590f57=function(_0x37718c){while(--_0x37718c){_0x5316d4['push'](_0x5316d4['shift']());}};_0x590f57(++_0x3e273a);}(_0xd9f1,0x1df));var _0x1d9f=function(_0x59ac41,_0x4011fe){_0x59ac41=_0x59ac41-0x0;var _0x1a6264=_0xd9f1[_0x59ac41];return _0x1a6264;};'use strict';var _=require(_0x1d9f('0x0'));var util=require(_0x1d9f('0x1'));var logger=require('../../config/logger')(_0x1d9f('0x2'));var moment=require(_0x1d9f('0x3'));var BPromise=require(_0x1d9f('0x4'));var rp=require(_0x1d9f('0x5'));var fs=require('fs');var path=require(_0x1d9f('0x6'));var rimraf=require(_0x1d9f('0x7'));var config=require(_0x1d9f('0x8'));var attributes=require('./mailTransferReport.attributes');module[_0x1d9f('0x9')]=function(_0x3e88d4,_0x5f0bb7){return _0x3e88d4[_0x1d9f('0xa')](_0x1d9f('0xb'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x1d9f('0xc'),'fields':[_0x1d9f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 7a09019..beb778c 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 _0x5379=['lodash','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x89bd71,_0xeb6e9c){var _0x358d57=function(_0x321b21){while(--_0x321b21){_0x89bd71['push'](_0x89bd71['shift']());}};_0x358d57(++_0xeb6e9c);}(_0x5379,0x1a4));var _0x9537=function(_0x57f23f,_0x49734f){_0x57f23f=_0x57f23f-0x0;var _0x5e7b61=_0x5379[_0x57f23f];return _0x5e7b61;};'use strict';var _=require(_0x9537('0x0'));var util=require('util');var moment=require(_0x9537('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9537('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9537('0x3'))(_0x9537('0x4'));var config=require(_0x9537('0x5'));var jayson=require(_0x9537('0x6'));var client=jayson['client'][_0x9537('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x156e52,_0x334cdd,_0x1e370a){return new BPromise(function(_0x464bbe,_0x392afe){return client[_0x9537('0x8')](_0x156e52,_0x1e370a)[_0x9537('0x9')](function(_0x147b4f){logger[_0x9537('0xa')](_0x9537('0xb'),_0x334cdd,_0x9537('0xc'));logger[_0x9537('0xd')](_0x9537('0xe'),_0x334cdd,'request\x20sent',JSON['stringify'](_0x147b4f));if(_0x147b4f[_0x9537('0xf')]){if(_0x147b4f['error'][_0x9537('0x10')]===0x1f4){logger[_0x9537('0xf')](_0x9537('0xb'),_0x334cdd,_0x147b4f['error'][_0x9537('0x11')]);return _0x392afe(_0x147b4f['error'][_0x9537('0x11')]);}logger['error'](_0x9537('0xb'),_0x334cdd,_0x147b4f[_0x9537('0xf')][_0x9537('0x11')]);return _0x464bbe(_0x147b4f['error'][_0x9537('0x11')]);}else{logger[_0x9537('0xa')](_0x9537('0xb'),_0x334cdd,'request\x20sent');_0x464bbe(_0x147b4f[_0x9537('0x12')]['message']);}})[_0x9537('0x13')](function(_0x56981f){logger[_0x9537('0xf')](_0x9537('0xb'),_0x334cdd,_0x56981f);_0x392afe(_0x56981f);});});} \ No newline at end of file +var _0xfe03=['then','info','request\x20sent','debug','error','code','message','MailTransferReport,\x20%s,\x20%s','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x4f4d19,_0x574245){var _0x27a258=function(_0x38da3e){while(--_0x38da3e){_0x4f4d19['push'](_0x4f4d19['shift']());}};_0x27a258(++_0x574245);}(_0xfe03,0xb2));var _0x3fe0=function(_0x109b5b,_0x4a6a4f){_0x109b5b=_0x109b5b-0x0;var _0x18c24d=_0xfe03[_0x109b5b];return _0x18c24d;};'use strict';var _=require('lodash');var util=require(_0x3fe0('0x0'));var moment=require(_0x3fe0('0x1'));var BPromise=require('bluebird');var rs=require(_0x3fe0('0x2'));var fs=require('fs');var Redis=require(_0x3fe0('0x3'));var db=require(_0x3fe0('0x4'))['db'];var utils=require(_0x3fe0('0x5'));var logger=require(_0x3fe0('0x6'))('rpc');var config=require(_0x3fe0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3fe0('0x8')][_0x3fe0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f2efd,_0x452f97,_0xf5d311){return new BPromise(function(_0x393ae0,_0x24d39c){return client[_0x3fe0('0xa')](_0x2f2efd,_0xf5d311)[_0x3fe0('0xb')](function(_0x13b485){logger[_0x3fe0('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x452f97,_0x3fe0('0xd'));logger[_0x3fe0('0xe')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x452f97,_0x3fe0('0xd'),JSON['stringify'](_0x13b485));if(_0x13b485[_0x3fe0('0xf')]){if(_0x13b485['error'][_0x3fe0('0x10')]===0x1f4){logger[_0x3fe0('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x452f97,_0x13b485[_0x3fe0('0xf')][_0x3fe0('0x11')]);return _0x24d39c(_0x13b485[_0x3fe0('0xf')][_0x3fe0('0x11')]);}logger[_0x3fe0('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x452f97,_0x13b485['error']['message']);return _0x393ae0(_0x13b485['error'][_0x3fe0('0x11')]);}else{logger[_0x3fe0('0xc')](_0x3fe0('0x12'),_0x452f97,_0x3fe0('0xd'));_0x393ae0(_0x13b485[_0x3fe0('0x13')][_0x3fe0('0x11')]);}})[_0x3fe0('0x14')](function(_0x515c95){logger[_0x3fe0('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x452f97,_0x515c95);_0x24d39c(_0x515c95);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index cbc4ab7..b630fd2 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 _0x5d60=['show','post','create','put','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','index','isAuthenticated','/:id'];(function(_0x5d9151,_0x9c4607){var _0x62b59e=function(_0x5ab2a9){while(--_0x5ab2a9){_0x5d9151['push'](_0x5d9151['shift']());}};_0x62b59e(++_0x9c4607);}(_0x5d60,0xbc));var _0x05d6=function(_0x5aba58,_0x446d7d){_0x5aba58=_0x5aba58-0x0;var _0x4024eb=_0x5d60[_0x5aba58];return _0x4024eb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x05d6('0x0'));var timeout=require('connect-timeout');var express=require(_0x05d6('0x1'));var router=express[_0x05d6('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x05d6('0x3'));var interaction=require(_0x05d6('0x4'));var config=require('../../config/environment');var controller=require(_0x05d6('0x5'));router[_0x05d6('0x6')]('/',auth['isAuthenticated'](),controller[_0x05d6('0x7')]);router[_0x05d6('0x6')]('/describe',auth[_0x05d6('0x8')](),controller['describe']);router['get'](_0x05d6('0x9'),auth[_0x05d6('0x8')](),controller[_0x05d6('0xa')]);router[_0x05d6('0xb')]('/',auth[_0x05d6('0x8')](),controller[_0x05d6('0xc')]);router[_0x05d6('0xd')](_0x05d6('0x9'),auth[_0x05d6('0x8')](),controller[_0x05d6('0xe')]);router[_0x05d6('0xf')]('/:id',auth[_0x05d6('0x8')](),controller[_0x05d6('0x10')]);module[_0x05d6('0x11')]=router; \ No newline at end of file +var _0x8f92=['./memberReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2f51b1,_0x370ac2){var _0x83fa03=function(_0x2b29f0){while(--_0x2b29f0){_0x2f51b1['push'](_0x2f51b1['shift']());}};_0x83fa03(++_0x370ac2);}(_0x8f92,0x1b0));var _0x28f9=function(_0x17aa1c,_0xebf9ce){_0x17aa1c=_0x17aa1c-0x0;var _0x5c096b=_0x8f92[_0x17aa1c];return _0x5c096b;};'use strict';var multer=require(_0x28f9('0x0'));var util=require(_0x28f9('0x1'));var path=require(_0x28f9('0x2'));var timeout=require(_0x28f9('0x3'));var express=require(_0x28f9('0x4'));var router=express[_0x28f9('0x5')]();var fs_extra=require(_0x28f9('0x6'));var auth=require(_0x28f9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x28f9('0x8'));var controller=require(_0x28f9('0x9'));router[_0x28f9('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x28f9('0xb'),auth[_0x28f9('0xc')](),controller[_0x28f9('0xd')]);router[_0x28f9('0xa')](_0x28f9('0xe'),auth[_0x28f9('0xc')](),controller[_0x28f9('0xf')]);router[_0x28f9('0x10')]('/',auth['isAuthenticated'](),controller[_0x28f9('0x11')]);router[_0x28f9('0x12')](_0x28f9('0xe'),auth['isAuthenticated'](),controller[_0x28f9('0x13')]);router[_0x28f9('0x14')](_0x28f9('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 607ef83..cc12e61 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 _0x18e0=['talk:[queue]','INTEGER','moment','STRING','DEFAULT\x20PAUSE','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]'];(function(_0x2c9cd2,_0x1b9a3d){var _0x2524b5=function(_0x4677e1){while(--_0x4677e1){_0x2c9cd2['push'](_0x2c9cd2['shift']());}};_0x2524b5(++_0x1b9a3d);}(_0x18e0,0xa2));var _0x018e=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x18e0[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x018e('0x0'));module['exports']={'channel':{'type':Sequelize[_0x018e('0x1')]},'membername':{'type':Sequelize[_0x018e('0x1')]},'interface':{'type':Sequelize[_0x018e('0x1')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x018e('0x2'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x018e('0x3')]},'exitAt':{'type':Sequelize[_0x018e('0x3')],'set':function(_0x1b90dd){var _0x50450b=moment(_0x1b90dd);var _0x5b6638=moment(this[_0x018e('0x4')](_0x018e('0x5')));var _0x5b2267=_0x50450b[_0x018e('0x6')](_0x5b6638,_0x018e('0x7'));this[_0x018e('0x8')](_0x018e('0x9'),_0x1b90dd);this[_0x018e('0x8')](_0x018e('0xa'),_0x5b2267||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x018e('0xb')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0x018e('0xc')},'data4':{'type':Sequelize[_0x018e('0x1')],'comment':_0x018e('0xd')},'data5':{'type':Sequelize[_0x018e('0x1')],'comment':_0x018e('0xe')},'role':{'type':Sequelize[_0x018e('0x1')]},'internal':{'type':Sequelize[_0x018e('0xf')]},'uniqueid':{'type':Sequelize[_0x018e('0x1')]}}; \ No newline at end of file +var _0xfa12=['talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','exitAt','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]'];(function(_0x47e7e5,_0x1df164){var _0x3d9c35=function(_0x5d3096){while(--_0x5d3096){_0x47e7e5['push'](_0x47e7e5['shift']());}};_0x3d9c35(++_0x1df164);}(_0xfa12,0x1b2));var _0x2fa1=function(_0x16b156,_0x50304a){_0x16b156=_0x16b156-0x0;var _0x4e65ef=_0xfa12[_0x16b156];return _0x4e65ef;};'use strict';var Sequelize=require(_0x2fa1('0x0'));var moment=require(_0x2fa1('0x1'));module['exports']={'channel':{'type':Sequelize[_0x2fa1('0x2')]},'membername':{'type':Sequelize[_0x2fa1('0x2')]},'interface':{'type':Sequelize[_0x2fa1('0x2')]},'type':{'type':Sequelize[_0x2fa1('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x2fa1('0x3')},'duration':{'type':Sequelize[_0x2fa1('0x4')]},'enterAt':{'type':Sequelize[_0x2fa1('0x5')]},'exitAt':{'type':Sequelize[_0x2fa1('0x5')],'set':function(_0x4d61b0){var _0x166949=moment(_0x4d61b0);var _0x25b233=moment(this['getDataValue'](_0x2fa1('0x6')));var _0x30a897=_0x166949[_0x2fa1('0x7')](_0x25b233,_0x2fa1('0x8'));this['setDataValue'](_0x2fa1('0x9'),_0x4d61b0);this[_0x2fa1('0xa')]('duration',_0x30a897||null);}},'data1':{'type':Sequelize[_0x2fa1('0x2')],'comment':_0x2fa1('0xb')},'data2':{'type':Sequelize[_0x2fa1('0x2')],'comment':_0x2fa1('0xc')},'data3':{'type':Sequelize[_0x2fa1('0x2')],'comment':_0x2fa1('0xd')},'data4':{'type':Sequelize[_0x2fa1('0x2')],'comment':_0x2fa1('0xe')},'data5':{'type':Sequelize['STRING'],'comment':_0x2fa1('0xf')},'role':{'type':Sequelize[_0x2fa1('0x2')]},'internal':{'type':Sequelize[_0x2fa1('0x4')]},'uniqueid':{'type':Sequelize[_0x2fa1('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 669da25..5be479c 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 _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x34e8,0x12c));var _0x834e=function(_0x3f4d5e,_0x349e66){_0x3f4d5e=_0x3f4d5e-0x0;var _0x6f1ac5=_0x34e8[_0x3f4d5e];return _0x6f1ac5;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,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(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xedd9,0xfc));var _0x9edd=function(_0xb4b75e,_0x51dc22){_0xb4b75e=_0xb4b75e-0x0;var _0x5a17c7=_0xedd9[_0xb4b75e];return _0x5a17c7;};'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 6e16503..8a230b0 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 _0xcda9=['moment','bluebird','request-promise','./memberReport.attributes','exports','MemberReport','membername','interface','util','api'];(function(_0x56ea27,_0xab0c0b){var _0x156edf=function(_0x447834){while(--_0x447834){_0x56ea27['push'](_0x56ea27['shift']());}};_0x156edf(++_0xab0c0b);}(_0xcda9,0xb2));var _0x9cda=function(_0x4149dd,_0xc0f8be){_0x4149dd=_0x4149dd-0x0;var _0x44b890=_0xcda9[_0x4149dd];return _0x44b890;};'use strict';var _=require('lodash');var util=require(_0x9cda('0x0'));var logger=require('../../config/logger')(_0x9cda('0x1'));var moment=require(_0x9cda('0x2'));var BPromise=require(_0x9cda('0x3'));var rp=require(_0x9cda('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9cda('0x5'));module[_0x9cda('0x6')]=function(_0x54f897,_0x4f8332){return _0x54f897['define'](_0x9cda('0x7'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x9cda('0x8'),_0x9cda('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe2eb=['bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername','interface','lodash','util','api','moment'];(function(_0x1b6839,_0x46980d){var _0x434365=function(_0x5945e4){while(--_0x5945e4){_0x1b6839['push'](_0x1b6839['shift']());}};_0x434365(++_0x46980d);}(_0xe2eb,0xac));var _0xbe2e=function(_0x2c532,_0x6e2168){_0x2c532=_0x2c532-0x0;var _0x163c0f=_0xe2eb[_0x2c532];return _0x163c0f;};'use strict';var _=require(_0xbe2e('0x0'));var util=require(_0xbe2e('0x1'));var logger=require('../../config/logger')(_0xbe2e('0x2'));var moment=require(_0xbe2e('0x3'));var BPromise=require(_0xbe2e('0x4'));var rp=require(_0xbe2e('0x5'));var fs=require('fs');var path=require(_0xbe2e('0x6'));var rimraf=require(_0xbe2e('0x7'));var config=require(_0xbe2e('0x8'));var attributes=require(_0xbe2e('0x9'));module[_0xbe2e('0xa')]=function(_0x4f479c,_0x50a531){return _0x4f479c[_0xbe2e('0xb')](_0xbe2e('0xc'),attributes,{'tableName':_0xbe2e('0xd'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xbe2e('0xe'),_0xbe2e('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 89d1a17..a2b7f26 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 _0x1b94=['model','debug','stringify','CreateMemberReport','body','raw','UpdateMemberReport','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetMemberReport','MemberReport','options','where','attributes','include','map'];(function(_0x299a87,_0x19752f){var _0x5c8019=function(_0x4728e3){while(--_0x4728e3){_0x299a87['push'](_0x299a87['shift']());}};_0x5c8019(++_0x19752f);}(_0x1b94,0x1f2));var _0x41b9=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x1b94[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0x41b9('0x0'));var util=require(_0x41b9('0x1'));var moment=require(_0x41b9('0x2'));var BPromise=require(_0x41b9('0x3'));var rs=require(_0x41b9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x41b9('0x5'))['db'];var utils=require(_0x41b9('0x6'));var logger=require(_0x41b9('0x7'))('rpc');var config=require(_0x41b9('0x8'));var jayson=require(_0x41b9('0x9'));var client=jayson[_0x41b9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x310fd8,_0x3e9325,_0x2a0eed){return new BPromise(function(_0x37b187,_0x1cb1d6){return client['request'](_0x310fd8,_0x2a0eed)[_0x41b9('0xb')](function(_0x23d89b){logger['info'](_0x41b9('0xc'),_0x3e9325,_0x41b9('0xd'));logger['debug'](_0x41b9('0xe'),_0x3e9325,_0x41b9('0xd'),JSON['stringify'](_0x23d89b));if(_0x23d89b[_0x41b9('0xf')]){if(_0x23d89b['error'][_0x41b9('0x10')]===0x1f4){logger['error'](_0x41b9('0xc'),_0x3e9325,_0x23d89b[_0x41b9('0xf')][_0x41b9('0x11')]);return _0x1cb1d6(_0x23d89b[_0x41b9('0xf')][_0x41b9('0x11')]);}logger['error'](_0x41b9('0xc'),_0x3e9325,_0x23d89b[_0x41b9('0xf')]['message']);return _0x37b187(_0x23d89b[_0x41b9('0xf')][_0x41b9('0x11')]);}else{logger[_0x41b9('0x12')](_0x41b9('0xc'),_0x3e9325,'request\x20sent');_0x37b187(_0x23d89b['result']['message']);}})[_0x41b9('0x13')](function(_0x432cd7){logger['error']('MemberReport,\x20%s,\x20%s',_0x3e9325,_0x432cd7);_0x1cb1d6(_0x432cd7);});});}exports[_0x41b9('0x14')]=function(_0xfb3b46){var _0x17b811=this;return new Promise(function(_0x3ba9f3,_0x45b813){return db[_0x41b9('0x15')]['findAll']({'raw':_0xfb3b46[_0x41b9('0x16')]?_0xfb3b46[_0x41b9('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xfb3b46[_0x41b9('0x16')]?_0xfb3b46[_0x41b9('0x16')][_0x41b9('0x17')]||null:null,'attributes':_0xfb3b46[_0x41b9('0x16')]?_0xfb3b46[_0x41b9('0x16')][_0x41b9('0x18')]||null:null,'limit':_0xfb3b46['options']?_0xfb3b46[_0x41b9('0x16')]['limit']||null:null,'include':_0xfb3b46[_0x41b9('0x16')]?_0xfb3b46[_0x41b9('0x16')][_0x41b9('0x19')]?_[_0x41b9('0x1a')](_0xfb3b46[_0x41b9('0x16')]['include'],function(_0x231f64){return{'model':db[_0x231f64['model']],'as':_0x231f64['as'],'attributes':_0x231f64['attributes'],'include':_0x231f64['include']?_[_0x41b9('0x1a')](_0x231f64[_0x41b9('0x19')],function(_0xfc833b){return{'model':db[_0xfc833b[_0x41b9('0x1b')]],'as':_0xfc833b['as'],'attributes':_0xfc833b[_0x41b9('0x18')],'include':_0xfc833b[_0x41b9('0x19')]?_[_0x41b9('0x1a')](_0xfc833b[_0x41b9('0x19')],function(_0x18ea59){return{'model':db[_0x18ea59['model']],'as':_0x18ea59['as'],'attributes':_0x18ea59['attributes']};}):[]};}):[]};}):[]:[]})[_0x41b9('0xb')](function(_0xe70b4d){logger[_0x41b9('0x12')](_0x41b9('0x14'),_0xfb3b46);logger[_0x41b9('0x1c')](_0x41b9('0x14'),_0xfb3b46,JSON[_0x41b9('0x1d')](_0xe70b4d));_0x3ba9f3(_0xe70b4d);})[_0x41b9('0x13')](function(_0x53199d){logger['error'](_0x41b9('0x14'),_0x53199d['message'],_0xfb3b46);_0x45b813(_0x17b811[_0x41b9('0xf')](0x1f4,_0x53199d['message']));});});};exports[_0x41b9('0x1e')]=function(_0x24f46d){var _0x4be093=this;return new Promise(function(_0x4d01d7,_0x60b1ca){return db[_0x41b9('0x15')]['create'](_0x24f46d[_0x41b9('0x1f')],{'raw':_0x24f46d[_0x41b9('0x16')]?_0x24f46d['options'][_0x41b9('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x489c12){logger[_0x41b9('0x12')]('CreateMemberReport',_0x24f46d);logger[_0x41b9('0x1c')](_0x41b9('0x1e'),_0x24f46d,JSON[_0x41b9('0x1d')](_0x489c12));_0x4d01d7(_0x489c12);})['catch'](function(_0x3109f4){logger[_0x41b9('0xf')](_0x41b9('0x1e'),_0x3109f4[_0x41b9('0x11')],_0x24f46d);_0x60b1ca(_0x4be093[_0x41b9('0xf')](0x1f4,_0x3109f4[_0x41b9('0x11')]));});});};exports[_0x41b9('0x21')]=function(_0x395c1e){var _0x341ebf=this;return new Promise(function(_0x1434b8,_0x272dfe){return db[_0x41b9('0x15')]['update'](_0x395c1e[_0x41b9('0x1f')],{'raw':_0x395c1e[_0x41b9('0x16')]?_0x395c1e[_0x41b9('0x16')][_0x41b9('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x395c1e['options']?_0x395c1e[_0x41b9('0x16')]['where']||null:null,'attributes':_0x395c1e['options']?_0x395c1e[_0x41b9('0x16')]['attributes']||null:null,'limit':_0x395c1e[_0x41b9('0x16')]?_0x395c1e['options'][_0x41b9('0x22')]||null:null})[_0x41b9('0xb')](function(_0x386e2b){logger[_0x41b9('0x12')](_0x41b9('0x21'),_0x395c1e);logger[_0x41b9('0x1c')]('UpdateMemberReport',_0x395c1e,JSON['stringify'](_0x386e2b));_0x1434b8(_0x386e2b);})[_0x41b9('0x13')](function(_0x32196e){logger['error'](_0x41b9('0x21'),_0x32196e[_0x41b9('0x11')],_0x395c1e);_0x272dfe(_0x341ebf[_0x41b9('0xf')](0x1f4,_0x32196e[_0x41b9('0x11')]));});});}; \ No newline at end of file +var _0x448a=['options','raw','where','attributes','limit','include','map','model','catch','CreateMemberReport','create','body','UpdateMemberReport','update','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetMemberReport','MemberReport','findAll'];(function(_0xcf5536,_0x4518f0){var _0x3dc63e=function(_0x45e2ae){while(--_0x45e2ae){_0xcf5536['push'](_0xcf5536['shift']());}};_0x3dc63e(++_0x4518f0);}(_0x448a,0x1ef));var _0xa448=function(_0xe67ad3,_0x57cfd6){_0xe67ad3=_0xe67ad3-0x0;var _0x519baa=_0x448a[_0xe67ad3];return _0x519baa;};'use strict';var _=require('lodash');var util=require(_0xa448('0x0'));var moment=require(_0xa448('0x1'));var BPromise=require('bluebird');var rs=require(_0xa448('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa448('0x3'));var logger=require(_0xa448('0x4'))('rpc');var config=require(_0xa448('0x5'));var jayson=require(_0xa448('0x6'));var client=jayson[_0xa448('0x7')][_0xa448('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12b0e2,_0x1f4749,_0x1ec2d8){return new BPromise(function(_0x54bdb0,_0x5df2c1){return client[_0xa448('0x9')](_0x12b0e2,_0x1ec2d8)[_0xa448('0xa')](function(_0x40006c){logger[_0xa448('0xb')](_0xa448('0xc'),_0x1f4749,_0xa448('0xd'));logger[_0xa448('0xe')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x1f4749,'request\x20sent',JSON[_0xa448('0xf')](_0x40006c));if(_0x40006c[_0xa448('0x10')]){if(_0x40006c['error'][_0xa448('0x11')]===0x1f4){logger[_0xa448('0x10')](_0xa448('0xc'),_0x1f4749,_0x40006c[_0xa448('0x10')][_0xa448('0x12')]);return _0x5df2c1(_0x40006c[_0xa448('0x10')][_0xa448('0x12')]);}logger[_0xa448('0x10')](_0xa448('0xc'),_0x1f4749,_0x40006c['error']['message']);return _0x54bdb0(_0x40006c[_0xa448('0x10')][_0xa448('0x12')]);}else{logger[_0xa448('0xb')](_0xa448('0xc'),_0x1f4749,_0xa448('0xd'));_0x54bdb0(_0x40006c[_0xa448('0x13')]['message']);}})['catch'](function(_0x5b8899){logger['error'](_0xa448('0xc'),_0x1f4749,_0x5b8899);_0x5df2c1(_0x5b8899);});});}exports[_0xa448('0x14')]=function(_0x5d76c2){var _0x2546e2=this;return new Promise(function(_0x3a5f44,_0x2d8d97){return db[_0xa448('0x15')][_0xa448('0x16')]({'raw':_0x5d76c2['options']?_0x5d76c2[_0xa448('0x17')][_0xa448('0x18')]===undefined?!![]:![]:!![],'where':_0x5d76c2[_0xa448('0x17')]?_0x5d76c2[_0xa448('0x17')][_0xa448('0x19')]||null:null,'attributes':_0x5d76c2['options']?_0x5d76c2[_0xa448('0x17')][_0xa448('0x1a')]||null:null,'limit':_0x5d76c2[_0xa448('0x17')]?_0x5d76c2[_0xa448('0x17')][_0xa448('0x1b')]||null:null,'include':_0x5d76c2[_0xa448('0x17')]?_0x5d76c2[_0xa448('0x17')][_0xa448('0x1c')]?_[_0xa448('0x1d')](_0x5d76c2[_0xa448('0x17')][_0xa448('0x1c')],function(_0x4aee1e){return{'model':db[_0x4aee1e[_0xa448('0x1e')]],'as':_0x4aee1e['as'],'attributes':_0x4aee1e[_0xa448('0x1a')],'include':_0x4aee1e[_0xa448('0x1c')]?_[_0xa448('0x1d')](_0x4aee1e['include'],function(_0x2ccc29){return{'model':db[_0x2ccc29[_0xa448('0x1e')]],'as':_0x2ccc29['as'],'attributes':_0x2ccc29[_0xa448('0x1a')],'include':_0x2ccc29[_0xa448('0x1c')]?_['map'](_0x2ccc29[_0xa448('0x1c')],function(_0x4daa90){return{'model':db[_0x4daa90[_0xa448('0x1e')]],'as':_0x4daa90['as'],'attributes':_0x4daa90[_0xa448('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa448('0xa')](function(_0x1f045c){logger[_0xa448('0xb')]('GetMemberReport',_0x5d76c2);logger[_0xa448('0xe')](_0xa448('0x14'),_0x5d76c2,JSON[_0xa448('0xf')](_0x1f045c));_0x3a5f44(_0x1f045c);})[_0xa448('0x1f')](function(_0x3b4f23){logger[_0xa448('0x10')](_0xa448('0x14'),_0x3b4f23[_0xa448('0x12')],_0x5d76c2);_0x2d8d97(_0x2546e2[_0xa448('0x10')](0x1f4,_0x3b4f23[_0xa448('0x12')]));});});};exports[_0xa448('0x20')]=function(_0x2c84c4){var _0xe0461c=this;return new Promise(function(_0x7a2715,_0x597a99){return db[_0xa448('0x15')][_0xa448('0x21')](_0x2c84c4[_0xa448('0x22')],{'raw':_0x2c84c4[_0xa448('0x17')]?_0x2c84c4[_0xa448('0x17')][_0xa448('0x18')]===undefined?!![]:![]:!![]})[_0xa448('0xa')](function(_0x4e164b){logger[_0xa448('0xb')]('CreateMemberReport',_0x2c84c4);logger['debug'](_0xa448('0x20'),_0x2c84c4,JSON[_0xa448('0xf')](_0x4e164b));_0x7a2715(_0x4e164b);})[_0xa448('0x1f')](function(_0x39ba7a){logger[_0xa448('0x10')]('CreateMemberReport',_0x39ba7a['message'],_0x2c84c4);_0x597a99(_0xe0461c[_0xa448('0x10')](0x1f4,_0x39ba7a[_0xa448('0x12')]));});});};exports[_0xa448('0x23')]=function(_0x4bb81c){var _0x2c7ed2=this;return new Promise(function(_0x387faf,_0x5db478){return db[_0xa448('0x15')][_0xa448('0x24')](_0x4bb81c[_0xa448('0x22')],{'raw':_0x4bb81c[_0xa448('0x17')]?_0x4bb81c[_0xa448('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bb81c[_0xa448('0x17')]?_0x4bb81c[_0xa448('0x17')][_0xa448('0x19')]||null:null,'attributes':_0x4bb81c[_0xa448('0x17')]?_0x4bb81c['options'][_0xa448('0x1a')]||null:null,'limit':_0x4bb81c[_0xa448('0x17')]?_0x4bb81c[_0xa448('0x17')][_0xa448('0x1b')]||null:null})[_0xa448('0xa')](function(_0x4c45a5){logger[_0xa448('0xb')](_0xa448('0x23'),_0x4bb81c);logger[_0xa448('0xe')](_0xa448('0x23'),_0x4bb81c,JSON[_0xa448('0xf')](_0x4c45a5));_0x387faf(_0x4c45a5);})[_0xa448('0x1f')](function(_0x17616a){logger['error'](_0xa448('0x23'),_0x17616a['message'],_0x4bb81c);_0x5db478(_0x2c7ed2['error'](0x1f4,_0x17616a[_0xa448('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index f254fa4..cc92f42 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 _0x96b7=['./migration.controller','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3386bb,_0xe7f703){var _0x2d2dec=function(_0x3ade83){while(--_0x3ade83){_0x3386bb['push'](_0x3386bb['shift']());}};_0x2d2dec(++_0xe7f703);}(_0x96b7,0x149));var _0x796b=function(_0x29f574,_0x4e27dd){_0x29f574=_0x29f574-0x0;var _0xbc2316=_0x96b7[_0x29f574];return _0xbc2316;};'use strict';var multer=require(_0x796b('0x0'));var util=require(_0x796b('0x1'));var path=require(_0x796b('0x2'));var timeout=require(_0x796b('0x3'));var express=require('express');var router=express[_0x796b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x796b('0x5'));var interaction=require(_0x796b('0x6'));var config=require('../../config/environment');var controller=require(_0x796b('0x7'));router['get']('/',controller['index']);module['exports']=router; \ No newline at end of file +var _0xa990=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./migration.controller','get','index','exports','multer','util','path'];(function(_0x4446d2,_0x57ef39){var _0x43fc36=function(_0x1caf3c){while(--_0x1caf3c){_0x4446d2['push'](_0x4446d2['shift']());}};_0x43fc36(++_0x57ef39);}(_0xa990,0xc9));var _0x0a99=function(_0x3313f5,_0x2ab8ba){_0x3313f5=_0x3313f5-0x0;var _0x1e494a=_0xa990[_0x3313f5];return _0x1e494a;};'use strict';var multer=require(_0x0a99('0x0'));var util=require(_0x0a99('0x1'));var path=require(_0x0a99('0x2'));var timeout=require(_0x0a99('0x3'));var express=require(_0x0a99('0x4'));var router=express[_0x0a99('0x5')]();var fs_extra=require(_0x0a99('0x6'));var auth=require(_0x0a99('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0a99('0x8'));router[_0x0a99('0x9')]('/',controller[_0x0a99('0xa')]);module[_0x0a99('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index ee6b4cf..f761e03 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 _0x7a31=['exports','version','sequelize'];(function(_0x3dea7d,_0x2cd4ea){var _0x53919a=function(_0x1554e2){while(--_0x1554e2){_0x3dea7d['push'](_0x3dea7d['shift']());}};_0x53919a(++_0x2cd4ea);}(_0x7a31,0x188));var _0x17a3=function(_0x32aa21,_0x1d22b3){_0x32aa21=_0x32aa21-0x0;var _0x2b0e2b=_0x7a31[_0x32aa21];return _0x2b0e2b;};'use strict';var Sequelize=require(_0x17a3('0x0'));module[_0x17a3('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x17a3('0x2')}}; \ No newline at end of file +var _0xd7ad=['sequelize','exports','STRING','version'];(function(_0x490b20,_0x12f6f3){var _0x52ce75=function(_0x3d2445){while(--_0x3d2445){_0x490b20['push'](_0x490b20['shift']());}};_0x52ce75(++_0x12f6f3);}(_0xd7ad,0x110));var _0xdd7a=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xd7ad[_0x256b72];return _0x2183e3;};'use strict';var Sequelize=require(_0xdd7a('0x0'));module[_0xdd7a('0x1')]={'version':{'type':Sequelize[_0xdd7a('0x2')],'unique':_0xdd7a('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 4334bbe..ca0732b 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 _0x98b9=['type','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','options','includeAll','Migration','rows','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','name','index','rawAttributes','fieldName'];(function(_0x1d8770,_0xec94ac){var _0x3bc9d6=function(_0x16627e){while(--_0x16627e){_0x1d8770['push'](_0x1d8770['shift']());}};_0x3bc9d6(++_0xec94ac);}(_0x98b9,0xd1));var _0x998b=function(_0x3e2dee,_0x2fc712){_0x3e2dee=_0x3e2dee-0x0;var _0x4d333a=_0x98b9[_0x3e2dee];return _0x4d333a;};'use strict';var emlformat=require(_0x998b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x998b('0x1'));var jsonpatch=require(_0x998b('0x2'));var rp=require(_0x998b('0x3'));var moment=require(_0x998b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x998b('0x5'));var util=require('util');var path=require(_0x998b('0x6'));var sox=require(_0x998b('0x7'));var csv=require(_0x998b('0x8'));var ejs=require(_0x998b('0x9'));var fs=require('fs');var fs_extra=require(_0x998b('0xa'));var _=require(_0x998b('0xb'));var squel=require(_0x998b('0xc'));var crypto=require(_0x998b('0xd'));var jsforce=require(_0x998b('0xe'));var deskjs=require(_0x998b('0xf'));var toCsv=require(_0x998b('0x8'));var querystring=require('querystring');var Papa=require(_0x998b('0x10'));var Redis=require(_0x998b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x998b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x998b('0x13'))(_0x998b('0x14'));var utils=require('../../config/utils');var config=require(_0x998b('0x15'));var licenseUtil=require(_0x998b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c20f3,_0x2299da){_0x2299da=_0x2299da||0xcc;return function(_0x2d3ccd){if(_0x2d3ccd){return _0x3c20f3['sendStatus'](_0x2299da);}return _0x3c20f3[_0x998b('0x17')](_0x2299da)['end']();};}function respondWithResult(_0x47f1e9,_0x301acc){_0x301acc=_0x301acc||0xc8;return function(_0x2d9d95){if(_0x2d9d95){return _0x47f1e9[_0x998b('0x17')](_0x301acc)[_0x998b('0x18')](_0x2d9d95);}};}function respondWithFilteredResult(_0x16a3d6,_0x2d5962){return function(_0x177538){if(_0x177538){var _0x294736=typeof _0x2d5962[_0x998b('0x19')]===_0x998b('0x1a')&&typeof _0x2d5962[_0x998b('0x1b')]==='undefined';var _0x59aa79=_0x177538[_0x998b('0x1c')];var _0x3a7188=_0x294736?0x0:_0x2d5962[_0x998b('0x19')];var _0x3848c0=_0x294736?_0x177538[_0x998b('0x1c')]:_0x2d5962['offset']+_0x2d5962[_0x998b('0x1b')];var _0x3d4c17;if(_0x3848c0>=_0x59aa79){_0x3848c0=_0x59aa79;_0x3d4c17=0xc8;}else{_0x3d4c17=0xce;}_0x16a3d6[_0x998b('0x17')](_0x3d4c17);return _0x16a3d6[_0x998b('0x1d')](_0x998b('0x1e'),_0x3a7188+'-'+_0x3848c0+'/'+_0x59aa79)['json'](_0x177538);}return null;};}function patchUpdates(_0x3b61ef){return function(_0x2e0023){try{jsonpatch['apply'](_0x2e0023,_0x3b61ef,!![]);}catch(_0x7c38d0){return BPromise[_0x998b('0x1f')](_0x7c38d0);}return _0x2e0023[_0x998b('0x20')]();};}function saveUpdates(_0x9aedc0,_0x29ca2b){return function(_0x19af6b){if(_0x19af6b){return _0x19af6b[_0x998b('0x21')](_0x9aedc0)[_0x998b('0x22')](function(_0x49b23d){return _0x49b23d;});}return null;};}function removeEntity(_0x113a3f,_0x5d92f6){return function(_0x15734e){if(_0x15734e){return _0x15734e[_0x998b('0x23')]()['then'](function(){_0x113a3f['status'](0xcc)[_0x998b('0x24')]();});}};}function handleEntityNotFound(_0xb10be9,_0x42841d){return function(_0x194418){if(!_0x194418){_0xb10be9[_0x998b('0x25')](0x194);}return _0x194418;};}function handleError(_0x294fe8,_0x30036b){_0x30036b=_0x30036b||0x1f4;return function(_0x5175e6){logger[_0x998b('0x26')](_0x5175e6['stack']);if(_0x5175e6[_0x998b('0x27')]){delete _0x5175e6[_0x998b('0x27')];}_0x294fe8[_0x998b('0x17')](_0x30036b)['send'](_0x5175e6);};}exports[_0x998b('0x28')]=function(_0x2e9a46,_0x53fe8b){var _0x1def21={},_0x8447c9={},_0x427d55={'count':0x0,'rows':[]};var _0x232f7f=_['map'](db['Migration'][_0x998b('0x29')],function(_0xfb6f01){return{'name':_0xfb6f01[_0x998b('0x2a')],'type':_0xfb6f01[_0x998b('0x2b')]['key']};});_0x8447c9['model']=_['map'](_0x232f7f,_0x998b('0x27'));_0x8447c9[_0x998b('0x2c')]=_[_0x998b('0x2d')](_0x2e9a46[_0x998b('0x2c')]);_0x8447c9[_0x998b('0x2e')]=_['intersection'](_0x8447c9[_0x998b('0x2f')],_0x8447c9[_0x998b('0x2c')]);_0x1def21[_0x998b('0x30')]=_['intersection'](_0x8447c9[_0x998b('0x2f')],qs['fields'](_0x2e9a46['query'][_0x998b('0x31')]));_0x1def21[_0x998b('0x30')]=_0x1def21[_0x998b('0x30')]['length']?_0x1def21[_0x998b('0x30')]:_0x8447c9['model'];if(!_0x2e9a46['query'][_0x998b('0x32')](_0x998b('0x33'))){_0x1def21[_0x998b('0x1b')]=qs[_0x998b('0x1b')](_0x2e9a46[_0x998b('0x2c')]['limit']);_0x1def21[_0x998b('0x19')]=qs[_0x998b('0x19')](_0x2e9a46[_0x998b('0x2c')]['offset']);}_0x1def21[_0x998b('0x34')]=qs[_0x998b('0x35')](_0x2e9a46['query'][_0x998b('0x35')]);_0x1def21[_0x998b('0x36')]=qs['filters'](_[_0x998b('0x37')](_0x2e9a46['query'],_0x8447c9[_0x998b('0x2e')]),_0x232f7f);if(_0x2e9a46[_0x998b('0x2c')]['filter']){_0x1def21[_0x998b('0x36')]=_['merge'](_0x1def21['where'],{'$or':_[_0x998b('0x38')](_0x232f7f,function(_0x542d50){if(_0x542d50['type']!==_0x998b('0x39')){var _0x508916={};_0x508916[_0x542d50['name']]={'$like':'%'+_0x2e9a46[_0x998b('0x2c')]['filter']+'%'};return _0x508916;}})});}_0x1def21=_['merge']({},_0x1def21,_0x2e9a46[_0x998b('0x3a')]);var _0xa46de3={'where':_0x1def21['where']};return db['Migration'][_0x998b('0x1c')](_0xa46de3)[_0x998b('0x22')](function(_0x17e4e8){_0x427d55[_0x998b('0x1c')]=_0x17e4e8;if(_0x2e9a46[_0x998b('0x2c')][_0x998b('0x3b')]){_0x1def21['include']=[{'all':!![]}];}return db[_0x998b('0x3c')]['findAll'](_0x1def21);})[_0x998b('0x22')](function(_0x315da6){_0x427d55[_0x998b('0x3d')]=_0x315da6;return _0x427d55;})[_0x998b('0x22')](respondWithFilteredResult(_0x53fe8b,_0x1def21))[_0x998b('0x3e')](handleError(_0x53fe8b,null));}; \ No newline at end of file +var _0x6ed8=['sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','name','index','map','Migration','fieldName','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util'];(function(_0x51b563,_0x2eaf70){var _0x35840d=function(_0x340340){while(--_0x340340){_0x51b563['push'](_0x51b563['shift']());}};_0x35840d(++_0x2eaf70);}(_0x6ed8,0xa5));var _0x86ed=function(_0xb50908,_0x34bae3){_0xb50908=_0xb50908-0x0;var _0x5bee69=_0x6ed8[_0xb50908];return _0x5bee69;};'use strict';var emlformat=require(_0x86ed('0x0'));var rimraf=require(_0x86ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x86ed('0x2'));var rp=require(_0x86ed('0x3'));var moment=require('moment');var BPromise=require(_0x86ed('0x4'));var Mustache=require(_0x86ed('0x5'));var util=require('util');var path=require(_0x86ed('0x6'));var sox=require(_0x86ed('0x7'));var csv=require(_0x86ed('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x86ed('0x9'));var _=require(_0x86ed('0xa'));var squel=require(_0x86ed('0xb'));var crypto=require('crypto');var jsforce=require(_0x86ed('0xc'));var deskjs=require(_0x86ed('0xd'));var toCsv=require(_0x86ed('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86ed('0xe'));var qs=require(_0x86ed('0xf'));var as=require(_0x86ed('0x10'));var hardwareService=require(_0x86ed('0x11'));var logger=require('../../config/logger')(_0x86ed('0x12'));var utils=require('../../config/utils');var config=require(_0x86ed('0x13'));var licenseUtil=require(_0x86ed('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23f24c,_0x57cc21){_0x57cc21=_0x57cc21||0xcc;return function(_0xc03fd8){if(_0xc03fd8){return _0x23f24c[_0x86ed('0x15')](_0x57cc21);}return _0x23f24c[_0x86ed('0x16')](_0x57cc21)[_0x86ed('0x17')]();};}function respondWithResult(_0x2b0a38,_0x173b29){_0x173b29=_0x173b29||0xc8;return function(_0x1ebe2f){if(_0x1ebe2f){return _0x2b0a38[_0x86ed('0x16')](_0x173b29)['json'](_0x1ebe2f);}};}function respondWithFilteredResult(_0x5eeb96,_0x187b58){return function(_0x5078c0){if(_0x5078c0){var _0x5a2e3e=typeof _0x187b58[_0x86ed('0x18')]==='undefined'&&typeof _0x187b58[_0x86ed('0x19')]===_0x86ed('0x1a');var _0x3d0d3e=_0x5078c0[_0x86ed('0x1b')];var _0x4a88cf=_0x5a2e3e?0x0:_0x187b58[_0x86ed('0x18')];var _0x476ccb=_0x5a2e3e?_0x5078c0['count']:_0x187b58[_0x86ed('0x18')]+_0x187b58['limit'];var _0x4ff654;if(_0x476ccb>=_0x3d0d3e){_0x476ccb=_0x3d0d3e;_0x4ff654=0xc8;}else{_0x4ff654=0xce;}_0x5eeb96[_0x86ed('0x16')](_0x4ff654);return _0x5eeb96[_0x86ed('0x1c')](_0x86ed('0x1d'),_0x4a88cf+'-'+_0x476ccb+'/'+_0x3d0d3e)['json'](_0x5078c0);}return null;};}function patchUpdates(_0x4ba992){return function(_0x569eac){try{jsonpatch[_0x86ed('0x1e')](_0x569eac,_0x4ba992,!![]);}catch(_0x357b29){return BPromise[_0x86ed('0x1f')](_0x357b29);}return _0x569eac['save']();};}function saveUpdates(_0x2d37ba,_0x11eadb){return function(_0x123a83){if(_0x123a83){return _0x123a83[_0x86ed('0x20')](_0x2d37ba)[_0x86ed('0x21')](function(_0x5f0589){return _0x5f0589;});}return null;};}function removeEntity(_0x1daa60,_0x3fae52){return function(_0x2d5090){if(_0x2d5090){return _0x2d5090['destroy']()[_0x86ed('0x21')](function(){_0x1daa60[_0x86ed('0x16')](0xcc)[_0x86ed('0x17')]();});}};}function handleEntityNotFound(_0x80a1b0,_0x198c37){return function(_0x1f9edf){if(!_0x1f9edf){_0x80a1b0[_0x86ed('0x15')](0x194);}return _0x1f9edf;};}function handleError(_0x5d3d85,_0x7ebb1){_0x7ebb1=_0x7ebb1||0x1f4;return function(_0x1a4230){logger[_0x86ed('0x22')](_0x1a4230['stack']);if(_0x1a4230[_0x86ed('0x23')]){delete _0x1a4230[_0x86ed('0x23')];}_0x5d3d85[_0x86ed('0x16')](_0x7ebb1)['send'](_0x1a4230);};}exports[_0x86ed('0x24')]=function(_0x31e0c4,_0x44475e){var _0x2aa2f0={},_0x1198c9={},_0x244179={'count':0x0,'rows':[]};var _0x2b79b0=_[_0x86ed('0x25')](db[_0x86ed('0x26')]['rawAttributes'],function(_0x404bd0){return{'name':_0x404bd0[_0x86ed('0x27')],'type':_0x404bd0[_0x86ed('0x28')][_0x86ed('0x29')]};});_0x1198c9[_0x86ed('0x2a')]=_[_0x86ed('0x25')](_0x2b79b0,_0x86ed('0x23'));_0x1198c9['query']=_[_0x86ed('0x2b')](_0x31e0c4[_0x86ed('0x2c')]);_0x1198c9['filters']=_['intersection'](_0x1198c9[_0x86ed('0x2a')],_0x1198c9['query']);_0x2aa2f0[_0x86ed('0x2d')]=_['intersection'](_0x1198c9[_0x86ed('0x2a')],qs[_0x86ed('0x2e')](_0x31e0c4[_0x86ed('0x2c')][_0x86ed('0x2e')]));_0x2aa2f0[_0x86ed('0x2d')]=_0x2aa2f0[_0x86ed('0x2d')]['length']?_0x2aa2f0[_0x86ed('0x2d')]:_0x1198c9['model'];if(!_0x31e0c4[_0x86ed('0x2c')][_0x86ed('0x2f')](_0x86ed('0x30'))){_0x2aa2f0[_0x86ed('0x19')]=qs[_0x86ed('0x19')](_0x31e0c4[_0x86ed('0x2c')][_0x86ed('0x19')]);_0x2aa2f0['offset']=qs[_0x86ed('0x18')](_0x31e0c4[_0x86ed('0x2c')][_0x86ed('0x18')]);}_0x2aa2f0[_0x86ed('0x31')]=qs['sort'](_0x31e0c4[_0x86ed('0x2c')]['sort']);_0x2aa2f0[_0x86ed('0x32')]=qs[_0x86ed('0x33')](_[_0x86ed('0x34')](_0x31e0c4[_0x86ed('0x2c')],_0x1198c9[_0x86ed('0x33')]),_0x2b79b0);if(_0x31e0c4['query']['filter']){_0x2aa2f0[_0x86ed('0x32')]=_[_0x86ed('0x35')](_0x2aa2f0[_0x86ed('0x32')],{'$or':_['map'](_0x2b79b0,function(_0x5c0e46){if(_0x5c0e46[_0x86ed('0x28')]!==_0x86ed('0x36')){var _0x55dd3d={};_0x55dd3d[_0x5c0e46[_0x86ed('0x23')]]={'$like':'%'+_0x31e0c4['query'][_0x86ed('0x37')]+'%'};return _0x55dd3d;}})});}_0x2aa2f0=_[_0x86ed('0x35')]({},_0x2aa2f0,_0x31e0c4[_0x86ed('0x38')]);var _0x89fad7={'where':_0x2aa2f0[_0x86ed('0x32')]};return db[_0x86ed('0x26')][_0x86ed('0x1b')](_0x89fad7)[_0x86ed('0x21')](function(_0x5016ea){_0x244179[_0x86ed('0x1b')]=_0x5016ea;if(_0x31e0c4['query'][_0x86ed('0x39')]){_0x2aa2f0[_0x86ed('0x3a')]=[{'all':!![]}];}return db[_0x86ed('0x26')][_0x86ed('0x3b')](_0x2aa2f0);})['then'](function(_0x3936a2){_0x244179[_0x86ed('0x3c')]=_0x3936a2;return _0x244179;})[_0x86ed('0x21')](respondWithFilteredResult(_0x44475e,_0x2aa2f0))[_0x86ed('0x3d')](handleError(_0x44475e,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 180773d..e1856e2 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 _0x1775=['migrations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','define','Migration'];(function(_0xb940,_0x40a55c){var _0x5b99f5=function(_0x5f44ac){while(--_0x5f44ac){_0xb940['push'](_0xb940['shift']());}};_0x5b99f5(++_0x40a55c);}(_0x1775,0x1e2));var _0x5177=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1775[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x5177('0x0'));var util=require(_0x5177('0x1'));var logger=require('../../config/logger')(_0x5177('0x2'));var moment=require(_0x5177('0x3'));var BPromise=require(_0x5177('0x4'));var rp=require(_0x5177('0x5'));var fs=require('fs');var path=require(_0x5177('0x6'));var rimraf=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var attributes=require(_0x5177('0x9'));module['exports']=function(_0x3e6d32,_0x34e9c6){return _0x3e6d32[_0x5177('0xa')](_0x5177('0xb'),attributes,{'tableName':_0x5177('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x487a=['../../config/environment','exports','define','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0x487a,0xac));var _0xa487=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x487a[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xa487('0x0'));var util=require(_0xa487('0x1'));var logger=require(_0xa487('0x2'))(_0xa487('0x3'));var moment=require(_0xa487('0x4'));var BPromise=require(_0xa487('0x5'));var rp=require(_0xa487('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa487('0x7'));var config=require(_0xa487('0x8'));var attributes=require('./migration.attributes');module[_0xa487('0x9')]=function(_0x29e60d,_0x59eef9){return _0x29e60d[_0xa487('0xa')]('Migration',attributes,{'tableName':_0xa487('0xb'),'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 eae8995..7ac179b 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 _0x6d0b=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Migration,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0xe340d5,_0x54c27e){var _0x4cf7e6=function(_0x4322f8){while(--_0x4322f8){_0xe340d5['push'](_0xe340d5['shift']());}};_0x4cf7e6(++_0x54c27e);}(_0x6d0b,0x71));var _0xb6d0=function(_0x2ffbfd,_0x1cc5a3){_0x2ffbfd=_0x2ffbfd-0x0;var _0x17d79d=_0x6d0b[_0x2ffbfd];return _0x17d79d;};'use strict';var _=require(_0xb6d0('0x0'));var util=require('util');var moment=require(_0xb6d0('0x1'));var BPromise=require('bluebird');var rs=require(_0xb6d0('0x2'));var fs=require('fs');var Redis=require(_0xb6d0('0x3'));var db=require(_0xb6d0('0x4'))['db'];var utils=require(_0xb6d0('0x5'));var logger=require(_0xb6d0('0x6'))(_0xb6d0('0x7'));var config=require(_0xb6d0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb6d0('0x9')][_0xb6d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23217f,_0x341756,_0x440414){return new BPromise(function(_0x2e41cf,_0x42605b){return client[_0xb6d0('0xb')](_0x23217f,_0x440414)[_0xb6d0('0xc')](function(_0x738c43){logger[_0xb6d0('0xd')](_0xb6d0('0xe'),_0x341756,'request\x20sent');logger[_0xb6d0('0xf')]('Migration,\x20%s,\x20%s,\x20%s',_0x341756,_0xb6d0('0x10'),JSON[_0xb6d0('0x11')](_0x738c43));if(_0x738c43['error']){if(_0x738c43['error']['code']===0x1f4){logger[_0xb6d0('0x12')]('Migration,\x20%s,\x20%s',_0x341756,_0x738c43['error']['message']);return _0x42605b(_0x738c43['error'][_0xb6d0('0x13')]);}logger[_0xb6d0('0x12')](_0xb6d0('0xe'),_0x341756,_0x738c43[_0xb6d0('0x12')][_0xb6d0('0x13')]);return _0x2e41cf(_0x738c43['error']['message']);}else{logger[_0xb6d0('0xd')](_0xb6d0('0xe'),_0x341756,'request\x20sent');_0x2e41cf(_0x738c43[_0xb6d0('0x14')][_0xb6d0('0x13')]);}})[_0xb6d0('0x15')](function(_0x369ed4){logger[_0xb6d0('0x12')]('Migration,\x20%s,\x20%s',_0x341756,_0x369ed4);_0x42605b(_0x369ed4);});});} \ No newline at end of file +var _0x24cf=['info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x45fb30,_0x289cbd){var _0x55e0c3=function(_0x31ab48){while(--_0x31ab48){_0x45fb30['push'](_0x45fb30['shift']());}};_0x55e0c3(++_0x289cbd);}(_0x24cf,0x1d5));var _0xf24c=function(_0x26d6a3,_0x5eed3d){_0x26d6a3=_0x26d6a3-0x0;var _0x34a062=_0x24cf[_0x26d6a3];return _0x34a062;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf24c('0x0'));var BPromise=require(_0xf24c('0x1'));var rs=require(_0xf24c('0x2'));var fs=require('fs');var Redis=require(_0xf24c('0x3'));var db=require(_0xf24c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf24c('0x5'))(_0xf24c('0x6'));var config=require(_0xf24c('0x7'));var jayson=require(_0xf24c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5104bd,_0x272d25,_0x596e81){return new BPromise(function(_0x3b7cf1,_0x13163e){return client[_0xf24c('0x9')](_0x5104bd,_0x596e81)[_0xf24c('0xa')](function(_0x4b3ea3){logger[_0xf24c('0xb')](_0xf24c('0xc'),_0x272d25,_0xf24c('0xd'));logger[_0xf24c('0xe')](_0xf24c('0xf'),_0x272d25,_0xf24c('0xd'),JSON['stringify'](_0x4b3ea3));if(_0x4b3ea3[_0xf24c('0x10')]){if(_0x4b3ea3[_0xf24c('0x10')][_0xf24c('0x11')]===0x1f4){logger['error'](_0xf24c('0xc'),_0x272d25,_0x4b3ea3[_0xf24c('0x10')]['message']);return _0x13163e(_0x4b3ea3['error'][_0xf24c('0x12')]);}logger['error'](_0xf24c('0xc'),_0x272d25,_0x4b3ea3[_0xf24c('0x10')]['message']);return _0x3b7cf1(_0x4b3ea3[_0xf24c('0x10')][_0xf24c('0x12')]);}else{logger[_0xf24c('0xb')](_0xf24c('0xc'),_0x272d25,_0xf24c('0xd'));_0x3b7cf1(_0x4b3ea3['result']['message']);}})[_0xf24c('0x13')](function(_0x462801){logger['error'](_0xf24c('0xc'),_0x272d25,_0x462801);_0x13163e(_0x462801);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index cc5ba5c..e5425f3 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 _0xc029=['show','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id'];(function(_0x861ce9,_0x440bfd){var _0x3a5c3a=function(_0x165991){while(--_0x165991){_0x861ce9['push'](_0x861ce9['shift']());}};_0x3a5c3a(++_0x440bfd);}(_0xc029,0x1df));var _0x9c02=function(_0x3acb89,_0x2ca05e){_0x3acb89=_0x3acb89-0x0;var _0x4d38f2=_0xc029[_0x3acb89];return _0x4d38f2;};'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['post']('/',auth[_0x9c02('0xc')](),controller['create']);router[_0x9c02('0x10')](_0x9c02('0xe'),auth[_0x9c02('0xc')](),controller[_0x9c02('0x11')]);router['delete'](_0x9c02('0xe'),auth['isAuthenticated'](),controller[_0x9c02('0x12')]);module['exports']=router; \ No newline at end of file +var _0x598a=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./network.controller','isAuthenticated','index','/:id','show','post','create','update','destroy','multer','util'];(function(_0xe2ac7c,_0x3ddb7e){var _0x447193=function(_0x5c4d93){while(--_0x5c4d93){_0xe2ac7c['push'](_0xe2ac7c['shift']());}};_0x447193(++_0x3ddb7e);}(_0x598a,0x1c9));var _0xa598=function(_0x3d73eb,_0x180e5b){_0x3d73eb=_0x3d73eb-0x0;var _0x2239fd=_0x598a[_0x3d73eb];return _0x2239fd;};'use strict';var multer=require(_0xa598('0x0'));var util=require(_0xa598('0x1'));var path=require(_0xa598('0x2'));var timeout=require(_0xa598('0x3'));var express=require(_0xa598('0x4'));var router=express[_0xa598('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa598('0x6'));var interaction=require(_0xa598('0x7'));var config=require('../../config/environment');var controller=require(_0xa598('0x8'));router['get']('/',auth[_0xa598('0x9')](),controller[_0xa598('0xa')]);router['get'](_0xa598('0xb'),auth[_0xa598('0x9')](),controller[_0xa598('0xc')]);router[_0xa598('0xd')]('/',auth[_0xa598('0x9')](),controller[_0xa598('0xe')]);router['put'](_0xa598('0xb'),auth[_0xa598('0x9')](),controller[_0xa598('0xf')]);router['delete'](_0xa598('0xb'),auth[_0xa598('0x9')](),controller[_0xa598('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 2016d7e..22a3e25 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 _0xa3c3=['sequelize','exports','ENUM','localnet','externip','stun','turn','STRING'];(function(_0xcd9818,_0x4aa915){var _0x6a81df=function(_0x2d15ee){while(--_0x2d15ee){_0xcd9818['push'](_0xcd9818['shift']());}};_0x6a81df(++_0x4aa915);}(_0xa3c3,0x168));var _0x3a3c=function(_0x140e1d,_0x331dda){_0x140e1d=_0x140e1d-0x0;var _0x251279=_0xa3c3[_0x140e1d];return _0x251279;};'use strict';var Sequelize=require(_0x3a3c('0x0'));module[_0x3a3c('0x1')]={'type':{'type':Sequelize[_0x3a3c('0x2')](_0x3a3c('0x3'),_0x3a3c('0x4'),_0x3a3c('0x5'),_0x3a3c('0x6'))},'value':{'type':Sequelize[_0x3a3c('0x7')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6cff=['stun','turn','STRING','sequelize','exports','ENUM','externip'];(function(_0x57dc85,_0x3a6d51){var _0x563a2e=function(_0x5713b2){while(--_0x5713b2){_0x57dc85['push'](_0x57dc85['shift']());}};_0x563a2e(++_0x3a6d51);}(_0x6cff,0x129));var _0xf6cf=function(_0x23bc85,_0x19addc){_0x23bc85=_0x23bc85-0x0;var _0x177dfd=_0x6cff[_0x23bc85];return _0x177dfd;};'use strict';var Sequelize=require(_0xf6cf('0x0'));module[_0xf6cf('0x1')]={'type':{'type':Sequelize[_0xf6cf('0x2')]('localnet',_0xf6cf('0x3'),_0xf6cf('0x4'),_0xf6cf('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf6cf('0x6')]},'password':{'type':Sequelize[_0xf6cf('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index e4aecc0..7e325df 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 _0x67bb=['result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','name','send','index','map','Network','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','options','include','params','includeAll','merge','find','create','body','findAll','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','join','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','sequelize','transaction','TURN','format','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x1d7332,_0x40651b){var _0x22671a=function(_0x49f436){while(--_0x49f436){_0x1d7332['push'](_0x1d7332['shift']());}};_0x22671a(++_0x40651b);}(_0x67bb,0x11a));var _0xb67b=function(_0x332309,_0x5eff30){_0x332309=_0x332309-0x0;var _0x5048cf=_0x67bb[_0x332309];return _0x5048cf;};'use strict';var emlformat=require(_0xb67b('0x0'));var rimraf=require(_0xb67b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb67b('0x2'));var rp=require(_0xb67b('0x3'));var moment=require(_0xb67b('0x4'));var BPromise=require(_0xb67b('0x5'));var Mustache=require(_0xb67b('0x6'));var util=require(_0xb67b('0x7'));var path=require(_0xb67b('0x8'));var sox=require(_0xb67b('0x9'));var csv=require(_0xb67b('0xa'));var ejs=require(_0xb67b('0xb'));var fs=require('fs');var fs_extra=require(_0xb67b('0xc'));var _=require(_0xb67b('0xd'));var squel=require(_0xb67b('0xe'));var crypto=require('crypto');var jsforce=require(_0xb67b('0xf'));var deskjs=require(_0xb67b('0x10'));var toCsv=require(_0xb67b('0xa'));var querystring=require('querystring');var Papa=require(_0xb67b('0x11'));var Redis=require('ioredis');var authService=require(_0xb67b('0x12'));var qs=require(_0xb67b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb67b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xb67b('0x15'));var config=require(_0xb67b('0x16'));var licenseUtil=require(_0xb67b('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xb67b('0x18'));var client=jayson[_0xb67b('0x19')][_0xb67b('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x28d134,_0x3addd1,_0x24a3c0,_0x3d6c84){return new BPromise(function(_0x3bc040,_0xaa9d0f){var _0x1fa4d1=_0x3d6c84||client;return _0x1fa4d1[_0xb67b('0x1b')](_0x28d134,_0x24a3c0)['then'](function(_0x4da48f){logger[_0xb67b('0x1c')](_0xb67b('0x1d'),_0x3addd1,'request\x20sent');logger[_0xb67b('0x1e')](_0xb67b('0x1f'),_0x3addd1,_0xb67b('0x20'),JSON['stringify'](_0x4da48f));if(_0x4da48f[_0xb67b('0x21')]){if(_0x4da48f[_0xb67b('0x21')][_0xb67b('0x22')]===0x1f4){logger['error'](_0xb67b('0x1d'),_0x3addd1,_0x4da48f[_0xb67b('0x21')][_0xb67b('0x23')]);return _0xaa9d0f(_0x4da48f[_0xb67b('0x21')][_0xb67b('0x23')]);}logger[_0xb67b('0x21')]('Network,\x20%s,\x20%s',_0x3addd1,_0x4da48f[_0xb67b('0x21')][_0xb67b('0x23')]);return _0x3bc040(_0x4da48f[_0xb67b('0x21')][_0xb67b('0x23')]);}else{logger[_0xb67b('0x1c')](_0xb67b('0x1d'),_0x3addd1,_0xb67b('0x20'));_0x3bc040(_0x4da48f[_0xb67b('0x24')][_0xb67b('0x23')]);}})[_0xb67b('0x25')](function(_0x4247dd){logger[_0xb67b('0x21')](_0xb67b('0x1d'),_0x3addd1,_0x4247dd);_0xaa9d0f(_0x4247dd);});});}function respondWithStatusCode(_0x57a6b6,_0x21d61e){_0x21d61e=_0x21d61e||0xcc;return function(_0xbdd2df){if(_0xbdd2df){return _0x57a6b6[_0xb67b('0x26')](_0x21d61e);}return _0x57a6b6[_0xb67b('0x27')](_0x21d61e)[_0xb67b('0x28')]();};}function respondWithResult(_0x25fbac,_0x3dddd3){_0x3dddd3=_0x3dddd3||0xc8;return function(_0x2b27af){if(_0x2b27af){return _0x25fbac[_0xb67b('0x27')](_0x3dddd3)[_0xb67b('0x29')](_0x2b27af);}};}function respondWithFilteredResult(_0xef79dd,_0x1536aa){return function(_0x29e015){if(_0x29e015){var _0x204468=typeof _0x1536aa[_0xb67b('0x2a')]==='undefined'&&typeof _0x1536aa[_0xb67b('0x2b')]===_0xb67b('0x2c');var _0x545c30=_0x29e015[_0xb67b('0x2d')];var _0x1943be=_0x204468?0x0:_0x1536aa['offset'];var _0x19227d=_0x204468?_0x29e015[_0xb67b('0x2d')]:_0x1536aa[_0xb67b('0x2a')]+_0x1536aa[_0xb67b('0x2b')];var _0x1a1d2a;if(_0x19227d>=_0x545c30){_0x19227d=_0x545c30;_0x1a1d2a=0xc8;}else{_0x1a1d2a=0xce;}_0xef79dd['status'](_0x1a1d2a);return _0xef79dd[_0xb67b('0x2e')]('Content-Range',_0x1943be+'-'+_0x19227d+'/'+_0x545c30)[_0xb67b('0x29')](_0x29e015);}return null;};}function patchUpdates(_0x431020){return function(_0x10220b){try{jsonpatch['apply'](_0x10220b,_0x431020,!![]);}catch(_0xec9bb){return BPromise[_0xb67b('0x2f')](_0xec9bb);}return _0x10220b[_0xb67b('0x30')]();};}function saveUpdates(_0x2be5a3,_0x3c6561){return function(_0x2e481d){if(_0x2e481d){return _0x2e481d[_0xb67b('0x31')](_0x2be5a3)[_0xb67b('0x32')](function(_0x4dd487){return _0x4dd487;});}return null;};}function removeEntity(_0x1c6452,_0x2cdce5){return function(_0x153af0){if(_0x153af0){return _0x153af0[_0xb67b('0x33')]()[_0xb67b('0x32')](function(){_0x1c6452[_0xb67b('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x367299,_0x2c1f9e){return function(_0x2709b0){if(!_0x2709b0){_0x367299['sendStatus'](0x194);}return _0x2709b0;};}function handleError(_0x14915f,_0x406567){_0x406567=_0x406567||0x1f4;return function(_0x375bb8){logger[_0xb67b('0x21')](_0x375bb8['stack']);if(_0x375bb8['name']){delete _0x375bb8[_0xb67b('0x34')];}_0x14915f[_0xb67b('0x27')](_0x406567)[_0xb67b('0x35')](_0x375bb8);};}exports[_0xb67b('0x36')]=function(_0x2ff4b6,_0x1702e5){var _0x3c26f0={},_0x524e17={},_0x51959d={'count':0x0,'rows':[]};var _0x1287d8=_[_0xb67b('0x37')](db[_0xb67b('0x38')]['rawAttributes'],function(_0x4e7a38){return{'name':_0x4e7a38[_0xb67b('0x39')],'type':_0x4e7a38['type'][_0xb67b('0x3a')]};});_0x524e17[_0xb67b('0x3b')]=_[_0xb67b('0x37')](_0x1287d8,_0xb67b('0x34'));_0x524e17[_0xb67b('0x3c')]=_[_0xb67b('0x3d')](_0x2ff4b6['query']);_0x524e17['filters']=_[_0xb67b('0x3e')](_0x524e17[_0xb67b('0x3b')],_0x524e17['query']);_0x3c26f0['attributes']=_[_0xb67b('0x3e')](_0x524e17[_0xb67b('0x3b')],qs[_0xb67b('0x3f')](_0x2ff4b6[_0xb67b('0x3c')]['fields']));_0x3c26f0[_0xb67b('0x40')]=_0x3c26f0[_0xb67b('0x40')][_0xb67b('0x41')]?_0x3c26f0[_0xb67b('0x40')]:_0x524e17[_0xb67b('0x3b')];if(!_0x2ff4b6['query'][_0xb67b('0x42')]('nolimit')){_0x3c26f0[_0xb67b('0x2b')]=qs[_0xb67b('0x2b')](_0x2ff4b6[_0xb67b('0x3c')][_0xb67b('0x2b')]);_0x3c26f0[_0xb67b('0x2a')]=qs[_0xb67b('0x2a')](_0x2ff4b6[_0xb67b('0x3c')]['offset']);}_0x3c26f0[_0xb67b('0x43')]=qs[_0xb67b('0x44')](_0x2ff4b6['query'][_0xb67b('0x44')]);_0x3c26f0[_0xb67b('0x45')]=qs[_0xb67b('0x46')](_[_0xb67b('0x47')](_0x2ff4b6[_0xb67b('0x3c')],_0x524e17[_0xb67b('0x46')]),_0x1287d8);if(_0x2ff4b6['query'][_0xb67b('0x48')]){_0x3c26f0[_0xb67b('0x45')]=_['merge'](_0x3c26f0[_0xb67b('0x45')],{'$or':_[_0xb67b('0x37')](_0x1287d8,function(_0x5b76f7){if(_0x5b76f7[_0xb67b('0x49')]!==_0xb67b('0x4a')){var _0xb1895b={};_0xb1895b[_0x5b76f7[_0xb67b('0x34')]]={'$like':'%'+_0x2ff4b6['query'][_0xb67b('0x48')]+'%'};return _0xb1895b;}})});}_0x3c26f0=_['merge']({},_0x3c26f0,_0x2ff4b6[_0xb67b('0x4b')]);var _0x1d07bb={'where':_0x3c26f0[_0xb67b('0x45')]};return db[_0xb67b('0x38')][_0xb67b('0x2d')](_0x1d07bb)[_0xb67b('0x32')](function(_0x2511ea){_0x51959d[_0xb67b('0x2d')]=_0x2511ea;if(_0x2ff4b6[_0xb67b('0x3c')]['includeAll']){_0x3c26f0[_0xb67b('0x4c')]=[{'all':!![]}];}return db[_0xb67b('0x38')]['findAll'](_0x3c26f0);})[_0xb67b('0x32')](function(_0x315c05){_0x51959d['rows']=_0x315c05;return _0x51959d;})[_0xb67b('0x32')](respondWithFilteredResult(_0x1702e5,_0x3c26f0))['catch'](handleError(_0x1702e5,null));};exports['show']=function(_0x1d027f,_0x1ce50d){var _0x5e24b2={'raw':!![],'where':{'id':_0x1d027f[_0xb67b('0x4d')]['id']}},_0x2f7b9d={};_0x2f7b9d[_0xb67b('0x3b')]=_[_0xb67b('0x3d')](db[_0xb67b('0x38')]['rawAttributes']);_0x2f7b9d['query']=_['keys'](_0x1d027f[_0xb67b('0x3c')]);_0x2f7b9d['filters']=_[_0xb67b('0x3e')](_0x2f7b9d['model'],_0x2f7b9d[_0xb67b('0x3c')]);_0x5e24b2[_0xb67b('0x40')]=_[_0xb67b('0x3e')](_0x2f7b9d[_0xb67b('0x3b')],qs['fields'](_0x1d027f[_0xb67b('0x3c')][_0xb67b('0x3f')]));_0x5e24b2['attributes']=_0x5e24b2['attributes'][_0xb67b('0x41')]?_0x5e24b2[_0xb67b('0x40')]:_0x2f7b9d[_0xb67b('0x3b')];if(_0x1d027f[_0xb67b('0x3c')][_0xb67b('0x4e')]){_0x5e24b2['include']=[{'all':!![]}];}_0x5e24b2=_[_0xb67b('0x4f')]({},_0x5e24b2,_0x1d027f['options']);return db[_0xb67b('0x38')][_0xb67b('0x50')](_0x5e24b2)[_0xb67b('0x32')](handleEntityNotFound(_0x1ce50d,null))['then'](respondWithResult(_0x1ce50d,null))[_0xb67b('0x25')](handleError(_0x1ce50d,null));};exports[_0xb67b('0x51')]=function(_0x40c6b2,_0x5ea419,_0x455b49){var _0x5402a7;return db['sequelize']['transaction'](function(_0x4926d4){return db[_0xb67b('0x38')][_0xb67b('0x51')](_0x40c6b2[_0xb67b('0x52')],{'raw':!![]})[_0xb67b('0x32')](function(_0x27a351){_0x5402a7=_0x27a351;return db[_0xb67b('0x38')][_0xb67b('0x53')]({'where':{'type':_0x40c6b2[_0xb67b('0x52')]['type']},'raw':!![]});})[_0xb67b('0x32')](function(_0x254232){if(_0x5402a7['type'][_0xb67b('0x54')]()==_0xb67b('0x55')){var _0x3c6418=fs[_0xb67b('0x56')](path['join'](config[_0xb67b('0x57')],_0xb67b('0x58')),'utf8');var _0x219725=ejs[_0xb67b('0x59')](_0x3c6418,{'networks':_0x254232||[]});fs[_0xb67b('0x5a')](_0xb67b('0x5b'),_0x219725);return respondWithRpcPromise(_0xb67b('0x5c'),_0xb67b('0x51'),{'module':_0xb67b('0x5d')});}else if(_0x5402a7[_0xb67b('0x49')]['toUpperCase']()=='TURN'){var _0x4ddb36=fs[_0xb67b('0x56')](path[_0xb67b('0x5e')](config['root'],_0xb67b('0x5f')),_0xb67b('0x60'));var _0x4b0d72=ejs[_0xb67b('0x59')](_0x4ddb36,{'networks':_0x254232||[]});fs['writeFileSync'](_0xb67b('0x61'),_0x4b0d72);return respondWithRpcPromise('Reload','create',{'module':_0xb67b('0x5d')});}else{var _0x6cb450=fs[_0xb67b('0x56')](path[_0xb67b('0x5e')](config['root'],_0xb67b('0x62')),_0xb67b('0x60'));var _0x42a3b4=ejs[_0xb67b('0x59')](_0x6cb450,{'networks':_0x254232||[]});fs[_0xb67b('0x5a')](util['format'](_0xb67b('0x63'),_0x40c6b2['body']['type'][_0xb67b('0x64')]()),_0x42a3b4);return respondWithRpcPromise('Reload',_0xb67b('0x51'),{'module':'chan_sip.so'});}return null;})[_0xb67b('0x32')](function(){return _0x5402a7;});})['then'](respondWithResult(_0x5ea419,0xc9))['catch'](handleError(_0x5ea419,null));};exports[_0xb67b('0x31')]=function(_0x3ae462,_0x215e5c,_0x260acf){var _0x2e340c;return db[_0xb67b('0x65')][_0xb67b('0x66')](function(_0x58b9db){return db[_0xb67b('0x38')][_0xb67b('0x50')]({'where':{'id':_0x3ae462[_0xb67b('0x4d')]['id']}})[_0xb67b('0x32')](handleEntityNotFound(_0x215e5c,null))['then'](saveUpdates(_0x3ae462[_0xb67b('0x52')],null))[_0xb67b('0x32')](function(_0x386fd4){if(_0x386fd4){_0x2e340c=_0x386fd4;return db[_0xb67b('0x38')][_0xb67b('0x53')]({'where':{'type':_0x2e340c[_0xb67b('0x49')]},'raw':!![]});}return null;})[_0xb67b('0x32')](function(_0xede54d){if(_0x2e340c[_0xb67b('0x49')]['toUpperCase']()==_0xb67b('0x55')){var _0x5ac742=fs['readFileSync'](path[_0xb67b('0x5e')](config[_0xb67b('0x57')],_0xb67b('0x58')),_0xb67b('0x60'));var _0x2d842e=ejs['render'](_0x5ac742,{'networks':_0xede54d||[]});fs[_0xb67b('0x5a')](_0xb67b('0x5b'),_0x2d842e);return respondWithRpcPromise(_0xb67b('0x5c'),_0xb67b('0x31'),{'module':_0xb67b('0x5d')});}else if(_0x2e340c['type']['toUpperCase']()==_0xb67b('0x67')){var _0x5a7e1c=fs[_0xb67b('0x56')](path[_0xb67b('0x5e')](config['root'],'server/files/templates/turn_multiple.ejs'),_0xb67b('0x60'));var _0x1b7b93=ejs[_0xb67b('0x59')](_0x5a7e1c,{'networks':_0xede54d||[]});fs['writeFileSync'](_0xb67b('0x61'),_0x1b7b93);return respondWithRpcPromise(_0xb67b('0x5c'),'update',{'module':'res_stun_monitor.so'});}else{var _0x23768f=fs['readFileSync'](path[_0xb67b('0x5e')](config[_0xb67b('0x57')],_0xb67b('0x62')),_0xb67b('0x60'));var _0x5accb3=ejs[_0xb67b('0x59')](_0x23768f,{'networks':_0xede54d||[]});fs[_0xb67b('0x5a')](util[_0xb67b('0x68')](_0xb67b('0x63'),_0x3ae462[_0xb67b('0x52')][_0xb67b('0x49')][_0xb67b('0x64')]()),_0x5accb3);return respondWithRpcPromise(_0xb67b('0x5c'),_0xb67b('0x31'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x1f6399){if(_0x1f6399){return _0x2e340c;}return null;});})[_0xb67b('0x32')](respondWithResult(_0x215e5c,null))[_0xb67b('0x25')](handleError(_0x215e5c,null));};exports[_0xb67b('0x33')]=function(_0x5c32bc,_0x557047,_0x3f8529){var _0x58b0cd;return db[_0xb67b('0x38')][_0xb67b('0x50')]({'where':{'id':_0x5c32bc[_0xb67b('0x4d')]['id']}})[_0xb67b('0x32')](function(_0x11d7f2){_0x58b0cd=_0x11d7f2;return _0x11d7f2;})['then'](handleEntityNotFound(_0x557047,null))['then'](removeEntity(_0x557047,null))['then'](function(){if(_0x58b0cd){return db[_0xb67b('0x38')][_0xb67b('0x53')]({'where':{'type':_0x58b0cd[_0xb67b('0x49')]},'raw':!![]});}})['then'](function(_0x1c6381){if(_0x58b0cd[_0xb67b('0x49')]['toUpperCase']()==_0xb67b('0x55')){var _0xddd22c=fs[_0xb67b('0x56')](path[_0xb67b('0x5e')](config['root'],'server/files/templates/stun_multiple.ejs'),_0xb67b('0x60'));var _0x23e63c=ejs['render'](_0xddd22c,{'networks':_0x1c6381||[]});fs[_0xb67b('0x5a')]('/etc/asterisk/stun_xcally.conf',_0x23e63c);return respondWithRpcPromise(_0xb67b('0x5c'),'destroy',{'module':_0xb67b('0x5d')});}else if(_0x58b0cd['type'][_0xb67b('0x54')]()==_0xb67b('0x67')){var _0x5e2a53=fs['readFileSync'](path[_0xb67b('0x5e')](config[_0xb67b('0x57')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x480738=ejs[_0xb67b('0x59')](_0x5e2a53,{'networks':_0x1c6381||[]});fs[_0xb67b('0x5a')](_0xb67b('0x61'),_0x480738);return respondWithRpcPromise(_0xb67b('0x5c'),'destroy',{'module':_0xb67b('0x5d')});}else{var _0x4568a0=fs[_0xb67b('0x56')](path[_0xb67b('0x5e')](config[_0xb67b('0x57')],_0xb67b('0x62')),'utf8');var _0x4cefee=ejs[_0xb67b('0x59')](_0x4568a0,{'networks':_0x1c6381||[]});fs[_0xb67b('0x5a')](util['format'](_0xb67b('0x63'),_0x5c32bc[_0xb67b('0x52')]['type'][_0xb67b('0x64')]()),_0x4cefee);return respondWithRpcPromise('Reload',_0xb67b('0x33'),{'module':_0xb67b('0x69')});}return null;})['catch'](handleError(_0x557047,null));}; \ No newline at end of file +var _0x2dab=['message','catch','sendStatus','end','status','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','Network','rawAttributes','type','key','model','keys','filters','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','params','intersection','length','includeAll','include','find','create','transaction','body','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','writeFileSync','format','chan_sip.so','sequelize','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','info','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s'];(function(_0x3930c2,_0x55cae8){var _0x1d1d6d=function(_0x3bc6d5){while(--_0x3bc6d5){_0x3930c2['push'](_0x3930c2['shift']());}};_0x1d1d6d(++_0x55cae8);}(_0x2dab,0x120));var _0xb2da=function(_0x18ceee,_0x4c5e42){_0x18ceee=_0x18ceee-0x0;var _0x3ebe81=_0x2dab[_0x18ceee];return _0x3ebe81;};'use strict';var emlformat=require(_0xb2da('0x0'));var rimraf=require(_0xb2da('0x1'));var zipdir=require(_0xb2da('0x2'));var jsonpatch=require(_0xb2da('0x3'));var rp=require(_0xb2da('0x4'));var moment=require('moment');var BPromise=require(_0xb2da('0x5'));var Mustache=require('mustache');var util=require(_0xb2da('0x6'));var path=require(_0xb2da('0x7'));var sox=require(_0xb2da('0x8'));var csv=require(_0xb2da('0x9'));var ejs=require(_0xb2da('0xa'));var fs=require('fs');var fs_extra=require(_0xb2da('0xb'));var _=require(_0xb2da('0xc'));var squel=require('squel');var crypto=require(_0xb2da('0xd'));var jsforce=require(_0xb2da('0xe'));var deskjs=require(_0xb2da('0xf'));var toCsv=require(_0xb2da('0x9'));var querystring=require(_0xb2da('0x10'));var Papa=require(_0xb2da('0x11'));var Redis=require(_0xb2da('0x12'));var authService=require(_0xb2da('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb2da('0x14'));var logger=require(_0xb2da('0x15'))(_0xb2da('0x16'));var utils=require(_0xb2da('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb2da('0x18'))['db'];var jayson=require(_0xb2da('0x19'));var client=jayson[_0xb2da('0x1a')][_0xb2da('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x544d0a,_0x24f407,_0x3fb685,_0x17963c){return new BPromise(function(_0x441e56,_0x1f3ef3){var _0x3ac025=_0x17963c||client;return _0x3ac025[_0xb2da('0x1c')](_0x544d0a,_0x3fb685)['then'](function(_0x53dd3d){logger[_0xb2da('0x1d')]('Network,\x20%s,\x20%s',_0x24f407,_0xb2da('0x1e'));logger['debug'](_0xb2da('0x1f'),_0x24f407,_0xb2da('0x1e'),JSON[_0xb2da('0x20')](_0x53dd3d));if(_0x53dd3d[_0xb2da('0x21')]){if(_0x53dd3d[_0xb2da('0x21')][_0xb2da('0x22')]===0x1f4){logger[_0xb2da('0x21')](_0xb2da('0x23'),_0x24f407,_0x53dd3d[_0xb2da('0x21')]['message']);return _0x1f3ef3(_0x53dd3d[_0xb2da('0x21')][_0xb2da('0x24')]);}logger[_0xb2da('0x21')](_0xb2da('0x23'),_0x24f407,_0x53dd3d[_0xb2da('0x21')][_0xb2da('0x24')]);return _0x441e56(_0x53dd3d[_0xb2da('0x21')][_0xb2da('0x24')]);}else{logger[_0xb2da('0x1d')](_0xb2da('0x23'),_0x24f407,'request\x20sent');_0x441e56(_0x53dd3d['result'][_0xb2da('0x24')]);}})[_0xb2da('0x25')](function(_0x4b68f3){logger[_0xb2da('0x21')](_0xb2da('0x23'),_0x24f407,_0x4b68f3);_0x1f3ef3(_0x4b68f3);});});}function respondWithStatusCode(_0x5cfefd,_0x3fa83e){_0x3fa83e=_0x3fa83e||0xcc;return function(_0x2d31e3){if(_0x2d31e3){return _0x5cfefd[_0xb2da('0x26')](_0x3fa83e);}return _0x5cfefd['status'](_0x3fa83e)[_0xb2da('0x27')]();};}function respondWithResult(_0x4c324f,_0x3b1f88){_0x3b1f88=_0x3b1f88||0xc8;return function(_0x1241eb){if(_0x1241eb){return _0x4c324f[_0xb2da('0x28')](_0x3b1f88)['json'](_0x1241eb);}};}function respondWithFilteredResult(_0x3d5a7d,_0x308180){return function(_0x1c5598){if(_0x1c5598){var _0x23a6aa=typeof _0x308180['offset']===_0xb2da('0x29')&&typeof _0x308180['limit']==='undefined';var _0x54510d=_0x1c5598[_0xb2da('0x2a')];var _0xa99dbf=_0x23a6aa?0x0:_0x308180[_0xb2da('0x2b')];var _0x51887c=_0x23a6aa?_0x1c5598[_0xb2da('0x2a')]:_0x308180[_0xb2da('0x2b')]+_0x308180['limit'];var _0x31b75a;if(_0x51887c>=_0x54510d){_0x51887c=_0x54510d;_0x31b75a=0xc8;}else{_0x31b75a=0xce;}_0x3d5a7d[_0xb2da('0x28')](_0x31b75a);return _0x3d5a7d[_0xb2da('0x2c')](_0xb2da('0x2d'),_0xa99dbf+'-'+_0x51887c+'/'+_0x54510d)['json'](_0x1c5598);}return null;};}function patchUpdates(_0xb2456e){return function(_0x4b3a7b){try{jsonpatch[_0xb2da('0x2e')](_0x4b3a7b,_0xb2456e,!![]);}catch(_0x41dea2){return BPromise[_0xb2da('0x2f')](_0x41dea2);}return _0x4b3a7b['save']();};}function saveUpdates(_0x508c7c,_0x1c764d){return function(_0x322b1d){if(_0x322b1d){return _0x322b1d[_0xb2da('0x30')](_0x508c7c)[_0xb2da('0x31')](function(_0x28c5f1){return _0x28c5f1;});}return null;};}function removeEntity(_0x3922f4,_0x1842b9){return function(_0xf2b699){if(_0xf2b699){return _0xf2b699[_0xb2da('0x32')]()[_0xb2da('0x31')](function(){_0x3922f4[_0xb2da('0x28')](0xcc)[_0xb2da('0x27')]();});}};}function handleEntityNotFound(_0x1e9fac,_0x18b250){return function(_0xb3c2ab){if(!_0xb3c2ab){_0x1e9fac[_0xb2da('0x26')](0x194);}return _0xb3c2ab;};}function handleError(_0x5eedce,_0x1ce7ed){_0x1ce7ed=_0x1ce7ed||0x1f4;return function(_0x949e56){logger[_0xb2da('0x21')](_0x949e56[_0xb2da('0x33')]);if(_0x949e56[_0xb2da('0x34')]){delete _0x949e56[_0xb2da('0x34')];}_0x5eedce[_0xb2da('0x28')](_0x1ce7ed)[_0xb2da('0x35')](_0x949e56);};}exports['index']=function(_0x63b786,_0x1bd2c8){var _0x222f14={},_0x235ca9={},_0x41377c={'count':0x0,'rows':[]};var _0x55c09f=_[_0xb2da('0x36')](db[_0xb2da('0x37')][_0xb2da('0x38')],function(_0x4ec29e){return{'name':_0x4ec29e['fieldName'],'type':_0x4ec29e[_0xb2da('0x39')][_0xb2da('0x3a')]};});_0x235ca9[_0xb2da('0x3b')]=_[_0xb2da('0x36')](_0x55c09f,_0xb2da('0x34'));_0x235ca9['query']=_[_0xb2da('0x3c')](_0x63b786['query']);_0x235ca9[_0xb2da('0x3d')]=_['intersection'](_0x235ca9['model'],_0x235ca9[_0xb2da('0x3e')]);_0x222f14[_0xb2da('0x3f')]=_['intersection'](_0x235ca9[_0xb2da('0x3b')],qs[_0xb2da('0x40')](_0x63b786[_0xb2da('0x3e')][_0xb2da('0x40')]));_0x222f14[_0xb2da('0x3f')]=_0x222f14[_0xb2da('0x3f')]['length']?_0x222f14[_0xb2da('0x3f')]:_0x235ca9[_0xb2da('0x3b')];if(!_0x63b786['query'][_0xb2da('0x41')](_0xb2da('0x42'))){_0x222f14['limit']=qs[_0xb2da('0x43')](_0x63b786[_0xb2da('0x3e')]['limit']);_0x222f14[_0xb2da('0x2b')]=qs[_0xb2da('0x2b')](_0x63b786[_0xb2da('0x3e')][_0xb2da('0x2b')]);}_0x222f14[_0xb2da('0x44')]=qs['sort'](_0x63b786[_0xb2da('0x3e')][_0xb2da('0x45')]);_0x222f14[_0xb2da('0x46')]=qs[_0xb2da('0x3d')](_[_0xb2da('0x47')](_0x63b786[_0xb2da('0x3e')],_0x235ca9[_0xb2da('0x3d')]),_0x55c09f);if(_0x63b786[_0xb2da('0x3e')][_0xb2da('0x48')]){_0x222f14['where']=_[_0xb2da('0x49')](_0x222f14['where'],{'$or':_[_0xb2da('0x36')](_0x55c09f,function(_0xb30688){if(_0xb30688[_0xb2da('0x39')]!==_0xb2da('0x4a')){var _0xad239f={};_0xad239f[_0xb30688[_0xb2da('0x34')]]={'$like':'%'+_0x63b786['query'][_0xb2da('0x48')]+'%'};return _0xad239f;}})});}_0x222f14=_[_0xb2da('0x49')]({},_0x222f14,_0x63b786[_0xb2da('0x4b')]);var _0x2ba09d={'where':_0x222f14[_0xb2da('0x46')]};return db[_0xb2da('0x37')][_0xb2da('0x2a')](_0x2ba09d)[_0xb2da('0x31')](function(_0x345f26){_0x41377c[_0xb2da('0x2a')]=_0x345f26;if(_0x63b786[_0xb2da('0x3e')]['includeAll']){_0x222f14['include']=[{'all':!![]}];}return db[_0xb2da('0x37')][_0xb2da('0x4c')](_0x222f14);})[_0xb2da('0x31')](function(_0x5d52c1){_0x41377c[_0xb2da('0x4d')]=_0x5d52c1;return _0x41377c;})[_0xb2da('0x31')](respondWithFilteredResult(_0x1bd2c8,_0x222f14))[_0xb2da('0x25')](handleError(_0x1bd2c8,null));};exports['show']=function(_0xdd8b67,_0x1d50c2){var _0x279033={'raw':!![],'where':{'id':_0xdd8b67[_0xb2da('0x4e')]['id']}},_0x2c7e84={};_0x2c7e84[_0xb2da('0x3b')]=_['keys'](db[_0xb2da('0x37')]['rawAttributes']);_0x2c7e84['query']=_[_0xb2da('0x3c')](_0xdd8b67[_0xb2da('0x3e')]);_0x2c7e84[_0xb2da('0x3d')]=_[_0xb2da('0x4f')](_0x2c7e84[_0xb2da('0x3b')],_0x2c7e84[_0xb2da('0x3e')]);_0x279033[_0xb2da('0x3f')]=_[_0xb2da('0x4f')](_0x2c7e84[_0xb2da('0x3b')],qs[_0xb2da('0x40')](_0xdd8b67['query'][_0xb2da('0x40')]));_0x279033[_0xb2da('0x3f')]=_0x279033[_0xb2da('0x3f')][_0xb2da('0x50')]?_0x279033[_0xb2da('0x3f')]:_0x2c7e84[_0xb2da('0x3b')];if(_0xdd8b67['query'][_0xb2da('0x51')]){_0x279033[_0xb2da('0x52')]=[{'all':!![]}];}_0x279033=_[_0xb2da('0x49')]({},_0x279033,_0xdd8b67[_0xb2da('0x4b')]);return db[_0xb2da('0x37')][_0xb2da('0x53')](_0x279033)[_0xb2da('0x31')](handleEntityNotFound(_0x1d50c2,null))['then'](respondWithResult(_0x1d50c2,null))['catch'](handleError(_0x1d50c2,null));};exports[_0xb2da('0x54')]=function(_0x42a01c,_0x282fcf,_0x3e15a1){var _0x201d55;return db['sequelize'][_0xb2da('0x55')](function(_0x25ac26){return db[_0xb2da('0x37')][_0xb2da('0x54')](_0x42a01c[_0xb2da('0x56')],{'raw':!![]})[_0xb2da('0x31')](function(_0x576c64){_0x201d55=_0x576c64;return db[_0xb2da('0x37')][_0xb2da('0x4c')]({'where':{'type':_0x42a01c[_0xb2da('0x56')][_0xb2da('0x39')]},'raw':!![]});})['then'](function(_0x4a2349){if(_0x201d55[_0xb2da('0x39')][_0xb2da('0x57')]()==_0xb2da('0x58')){var _0x2445d0=fs['readFileSync'](path[_0xb2da('0x59')](config[_0xb2da('0x5a')],_0xb2da('0x5b')),_0xb2da('0x5c'));var _0x4ad9bb=ejs['render'](_0x2445d0,{'networks':_0x4a2349||[]});fs['writeFileSync'](_0xb2da('0x5d'),_0x4ad9bb);return respondWithRpcPromise(_0xb2da('0x5e'),_0xb2da('0x54'),{'module':_0xb2da('0x5f')});}else if(_0x201d55[_0xb2da('0x39')]['toUpperCase']()==_0xb2da('0x60')){var _0x4604df=fs[_0xb2da('0x61')](path['join'](config[_0xb2da('0x5a')],_0xb2da('0x62')),_0xb2da('0x5c'));var _0x55c73c=ejs[_0xb2da('0x63')](_0x4604df,{'networks':_0x4a2349||[]});fs['writeFileSync'](_0xb2da('0x64'),_0x55c73c);return respondWithRpcPromise(_0xb2da('0x5e'),_0xb2da('0x54'),{'module':'res_stun_monitor.so'});}else{var _0x32f570=fs[_0xb2da('0x61')](path[_0xb2da('0x59')](config[_0xb2da('0x5a')],_0xb2da('0x65')),_0xb2da('0x5c'));var _0x2e906d=ejs[_0xb2da('0x63')](_0x32f570,{'networks':_0x4a2349||[]});fs[_0xb2da('0x66')](util[_0xb2da('0x67')]('/etc/asterisk/sip_xcally_%s.conf',_0x42a01c['body'][_0xb2da('0x39')]['toLowerCase']()),_0x2e906d);return respondWithRpcPromise('Reload',_0xb2da('0x54'),{'module':_0xb2da('0x68')});}return null;})['then'](function(){return _0x201d55;});})[_0xb2da('0x31')](respondWithResult(_0x282fcf,0xc9))[_0xb2da('0x25')](handleError(_0x282fcf,null));};exports[_0xb2da('0x30')]=function(_0x56af11,_0x3bcca8,_0x709982){var _0x51dab2;return db[_0xb2da('0x69')][_0xb2da('0x55')](function(_0x382f09){return db[_0xb2da('0x37')]['find']({'where':{'id':_0x56af11[_0xb2da('0x4e')]['id']}})[_0xb2da('0x31')](handleEntityNotFound(_0x3bcca8,null))['then'](saveUpdates(_0x56af11['body'],null))[_0xb2da('0x31')](function(_0x151c90){if(_0x151c90){_0x51dab2=_0x151c90;return db[_0xb2da('0x37')][_0xb2da('0x4c')]({'where':{'type':_0x51dab2[_0xb2da('0x39')]},'raw':!![]});}return null;})[_0xb2da('0x31')](function(_0x36d8b8){if(_0x51dab2[_0xb2da('0x39')]['toUpperCase']()==_0xb2da('0x58')){var _0x236e30=fs[_0xb2da('0x61')](path[_0xb2da('0x59')](config[_0xb2da('0x5a')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x1222b6=ejs[_0xb2da('0x63')](_0x236e30,{'networks':_0x36d8b8||[]});fs['writeFileSync'](_0xb2da('0x5d'),_0x1222b6);return respondWithRpcPromise('Reload',_0xb2da('0x30'),{'module':_0xb2da('0x5f')});}else if(_0x51dab2['type'][_0xb2da('0x57')]()==_0xb2da('0x60')){var _0x1d768c=fs[_0xb2da('0x61')](path[_0xb2da('0x59')](config[_0xb2da('0x5a')],_0xb2da('0x62')),_0xb2da('0x5c'));var _0x4e44fb=ejs['render'](_0x1d768c,{'networks':_0x36d8b8||[]});fs[_0xb2da('0x66')](_0xb2da('0x64'),_0x4e44fb);return respondWithRpcPromise(_0xb2da('0x5e'),_0xb2da('0x30'),{'module':'res_stun_monitor.so'});}else{var _0x3da42b=fs[_0xb2da('0x61')](path[_0xb2da('0x59')](config['root'],'server/files/templates/network.ejs'),_0xb2da('0x5c'));var _0x308c2d=ejs[_0xb2da('0x63')](_0x3da42b,{'networks':_0x36d8b8||[]});fs['writeFileSync'](util[_0xb2da('0x67')]('/etc/asterisk/sip_xcally_%s.conf',_0x56af11[_0xb2da('0x56')]['type']['toLowerCase']()),_0x308c2d);return respondWithRpcPromise(_0xb2da('0x5e'),'update',{'module':_0xb2da('0x68')});}return null;})[_0xb2da('0x31')](function(_0x12757d){if(_0x12757d){return _0x51dab2;}return null;});})[_0xb2da('0x31')](respondWithResult(_0x3bcca8,null))['catch'](handleError(_0x3bcca8,null));};exports[_0xb2da('0x32')]=function(_0x986f60,_0x2e75a0,_0x4a05b8){var _0x4a4f16;return db[_0xb2da('0x37')][_0xb2da('0x53')]({'where':{'id':_0x986f60['params']['id']}})[_0xb2da('0x31')](function(_0x215782){_0x4a4f16=_0x215782;return _0x215782;})[_0xb2da('0x31')](handleEntityNotFound(_0x2e75a0,null))[_0xb2da('0x31')](removeEntity(_0x2e75a0,null))[_0xb2da('0x31')](function(){if(_0x4a4f16){return db[_0xb2da('0x37')]['findAll']({'where':{'type':_0x4a4f16[_0xb2da('0x39')]},'raw':!![]});}})[_0xb2da('0x31')](function(_0x27d965){if(_0x4a4f16['type'][_0xb2da('0x57')]()==_0xb2da('0x58')){var _0x25c232=fs[_0xb2da('0x61')](path[_0xb2da('0x59')](config[_0xb2da('0x5a')],_0xb2da('0x5b')),_0xb2da('0x5c'));var _0x35e49f=ejs[_0xb2da('0x63')](_0x25c232,{'networks':_0x27d965||[]});fs[_0xb2da('0x66')](_0xb2da('0x5d'),_0x35e49f);return respondWithRpcPromise(_0xb2da('0x5e'),_0xb2da('0x32'),{'module':_0xb2da('0x5f')});}else if(_0x4a4f16[_0xb2da('0x39')][_0xb2da('0x57')]()==_0xb2da('0x60')){var _0x918be3=fs['readFileSync'](path[_0xb2da('0x59')](config[_0xb2da('0x5a')],_0xb2da('0x62')),'utf8');var _0x155b47=ejs[_0xb2da('0x63')](_0x918be3,{'networks':_0x27d965||[]});fs[_0xb2da('0x66')]('/etc/asterisk/turn_xcally.conf',_0x155b47);return respondWithRpcPromise(_0xb2da('0x5e'),_0xb2da('0x32'),{'module':_0xb2da('0x5f')});}else{var _0xa1c760=fs[_0xb2da('0x61')](path[_0xb2da('0x59')](config['root'],_0xb2da('0x65')),'utf8');var _0x22c502=ejs['render'](_0xa1c760,{'networks':_0x27d965||[]});fs['writeFileSync'](util[_0xb2da('0x67')](_0xb2da('0x6a'),_0x986f60[_0xb2da('0x56')][_0xb2da('0x39')][_0xb2da('0x6b')]()),_0x22c502);return respondWithRpcPromise(_0xb2da('0x5e'),_0xb2da('0x32'),{'module':'chan_sip.so'});}return null;})[_0xb2da('0x25')](handleError(_0x2e75a0,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 1689d8a..3191661 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 _0x0565=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x119e26,_0x574b1b){var _0x2299ad=function(_0x3e023c){while(--_0x3e023c){_0x119e26['push'](_0x119e26['shift']());}};_0x2299ad(++_0x574b1b);}(_0x0565,0xf2));var _0x5056=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x0565[_0x342700];return _0x53406f;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var logger=require(_0x5056('0x2'))(_0x5056('0x3'));var moment=require(_0x5056('0x4'));var BPromise=require(_0x5056('0x5'));var rp=require(_0x5056('0x6'));var fs=require('fs');var path=require(_0x5056('0x7'));var rimraf=require(_0x5056('0x8'));var config=require(_0x5056('0x9'));var attributes=require('./network.attributes');module[_0x5056('0xa')]=function(_0x105ea8,_0x1143df){return _0x105ea8[_0x5056('0xb')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e81=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0x4e81,0x1bc));var _0x14e8=function(_0x476c7,_0x298ee0){_0x476c7=_0x476c7-0x0;var _0x47ae56=_0x4e81[_0x476c7];return _0x47ae56;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var logger=require(_0x14e8('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x14e8('0x3'));var fs=require('fs');var path=require(_0x14e8('0x4'));var rimraf=require(_0x14e8('0x5'));var config=require(_0x14e8('0x6'));var attributes=require(_0x14e8('0x7'));module[_0x14e8('0x8')]=function(_0x56a266,_0x57c79b){return _0x56a266[_0x14e8('0x9')](_0x14e8('0xa'),attributes,{'tableName':_0x14e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index fa27334..cf3aa19 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(_0x304831,_0x578683){var _0x2e3c46=function(_0x24a392){while(--_0x24a392){_0x304831['push'](_0x304831['shift']());}};_0x2e3c46(++_0x578683);}(_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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x43189c,_0x27c5ec){_0x43189c=_0x43189c-0x0;var _0x5c3b64=_0x7a54[_0x43189c];return _0x5c3b64;};'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 c72485d..9f97ec3 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 _0x4269=['describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','getAgents','post','create','addAnswer','notify','addApplications','/:id/users','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x4269,0x153));var _0x9426=function(_0x216edc,_0x57df05){_0x216edc=_0x216edc-0x0;var _0x745d3e=_0x4269[_0x216edc];return _0x745d3e;};'use strict';var multer=require(_0x9426('0x0'));var util=require('util');var path=require(_0x9426('0x1'));var timeout=require(_0x9426('0x2'));var express=require(_0x9426('0x3'));var router=express['Router']();var fs_extra=require(_0x9426('0x4'));var auth=require(_0x9426('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9426('0x6'));var controller=require(_0x9426('0x7'));router[_0x9426('0x8')]('/',auth[_0x9426('0x9')](),controller['index']);router[_0x9426('0x8')](_0x9426('0xa'),auth[_0x9426('0x9')](),controller[_0x9426('0xb')]);router[_0x9426('0x8')](_0x9426('0xc'),auth[_0x9426('0x9')](),controller['show']);router[_0x9426('0x8')](_0x9426('0xd'),auth[_0x9426('0x9')](),controller['getDispositions']);router[_0x9426('0x8')](_0x9426('0xe'),auth[_0x9426('0x9')](),controller[_0x9426('0xf')]);router[_0x9426('0x8')](_0x9426('0x10'),auth[_0x9426('0x9')](),controller['getApplications']);router['get'](_0x9426('0x11'),auth[_0x9426('0x9')](),controller[_0x9426('0x12')]);router['get']('/:id/users',auth[_0x9426('0x9')](),controller[_0x9426('0x13')]);router[_0x9426('0x14')]('/',auth[_0x9426('0x9')](),controller[_0x9426('0x15')]);router['post'](_0x9426('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x9426('0x14')](_0x9426('0xe'),auth['isAuthenticated'](),controller[_0x9426('0x16')]);router[_0x9426('0x14')]('/:id/notify',controller[_0x9426('0x17')]);router[_0x9426('0x14')](_0x9426('0x10'),auth[_0x9426('0x9')](),controller[_0x9426('0x18')]);router['post'](_0x9426('0x19'),auth[_0x9426('0x9')](),controller['addAgents']);router[_0x9426('0x14')](_0x9426('0x1a'),auth['isAuthenticated'](),controller[_0x9426('0x1b')]);router[_0x9426('0x1c')]('/:id',auth[_0x9426('0x9')](),controller[_0x9426('0x1d')]);router[_0x9426('0x1e')](_0x9426('0xc'),auth[_0x9426('0x9')](),controller[_0x9426('0x1f')]);router[_0x9426('0x1e')](_0x9426('0xd'),auth[_0x9426('0x9')](),controller[_0x9426('0x20')]);router[_0x9426('0x1e')](_0x9426('0xe'),auth[_0x9426('0x9')](),controller[_0x9426('0x21')]);router['delete'](_0x9426('0x19'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x9426('0x22')]=router; \ No newline at end of file +var _0xefad=['delete','destroy','removeAnswers','/:id/users','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','addAgents','/:id/send','send','put','update'];(function(_0x373b5b,_0x30c10e){var _0x11b33e=function(_0x485a92){while(--_0x485a92){_0x373b5b['push'](_0x373b5b['shift']());}};_0x11b33e(++_0x30c10e);}(_0xefad,0x1ce));var _0xdefa=function(_0x1cca56,_0x5e0aa0){_0x1cca56=_0x1cca56-0x0;var _0xe8ceed=_0xefad[_0x1cca56];return _0xe8ceed;};'use strict';var multer=require(_0xdefa('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdefa('0x1'));var express=require(_0xdefa('0x2'));var router=express[_0xdefa('0x3')]();var fs_extra=require(_0xdefa('0x4'));var auth=require(_0xdefa('0x5'));var interaction=require(_0xdefa('0x6'));var config=require('../../config/environment');var controller=require(_0xdefa('0x7'));router['get']('/',auth[_0xdefa('0x8')](),controller[_0xdefa('0x9')]);router[_0xdefa('0xa')](_0xdefa('0xb'),auth[_0xdefa('0x8')](),controller[_0xdefa('0xc')]);router[_0xdefa('0xa')](_0xdefa('0xd'),auth['isAuthenticated'](),controller[_0xdefa('0xe')]);router[_0xdefa('0xa')]('/:id/dispositions',auth[_0xdefa('0x8')](),controller[_0xdefa('0xf')]);router[_0xdefa('0xa')](_0xdefa('0x10'),auth['isAuthenticated'](),controller[_0xdefa('0x11')]);router[_0xdefa('0xa')](_0xdefa('0x12'),auth[_0xdefa('0x8')](),controller[_0xdefa('0x13')]);router[_0xdefa('0xa')]('/:id/interactions',auth[_0xdefa('0x8')](),controller[_0xdefa('0x14')]);router[_0xdefa('0xa')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xdefa('0x15')]('/',auth[_0xdefa('0x8')](),controller[_0xdefa('0x16')]);router[_0xdefa('0x15')](_0xdefa('0x17'),auth[_0xdefa('0x8')](),controller[_0xdefa('0x18')]);router[_0xdefa('0x15')](_0xdefa('0x10'),auth[_0xdefa('0x8')](),controller[_0xdefa('0x19')]);router['post'](_0xdefa('0x1a'),controller['notify']);router[_0xdefa('0x15')](_0xdefa('0x12'),auth['isAuthenticated'](),controller['addApplications']);router[_0xdefa('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0xdefa('0x1b')]);router[_0xdefa('0x15')](_0xdefa('0x1c'),auth[_0xdefa('0x8')](),controller[_0xdefa('0x1d')]);router[_0xdefa('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0xdefa('0x1f')]);router[_0xdefa('0x20')]('/:id',auth[_0xdefa('0x8')](),controller[_0xdefa('0x21')]);router[_0xdefa('0x20')]('/:id/dispositions',auth[_0xdefa('0x8')](),controller['removeDispositions']);router[_0xdefa('0x20')](_0xdefa('0x10'),auth[_0xdefa('0x8')](),controller[_0xdefa('0x22')]);router[_0xdefa('0x20')](_0xdefa('0x23'),auth[_0xdefa('0x8')](),controller[_0xdefa('0x24')]);module[_0xdefa('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 a4b041e..5e75269 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 _0x69c3=['BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','randomstring','exports','STRING','generate','TEXT'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0x69c3,0x1da));var _0x369c=function(_0x4281ab,_0x29af8d){_0x4281ab=_0x4281ab-0x0;var _0x4c3dbd=_0x69c3[_0x4281ab];return _0x4c3dbd;};'use strict';var Sequelize=require(_0x369c('0x0'));var rs=require(_0x369c('0x1'));module[_0x369c('0x2')]={'name':{'type':Sequelize[_0x369c('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x369c('0x3')]},'token':{'type':Sequelize[_0x369c('0x3')],'defaultValue':function(){return rs[_0x369c('0x4')]();}},'replyUri':{'type':Sequelize[_0x369c('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x369c('0x5')],'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[_0x369c('0x3')]},'queueTransfer':{'type':Sequelize[_0x369c('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x369c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x369c('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x369c('0x7')],'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[_0x369c('0x6')],'defaultValue':![],'comment':_0x369c('0x8'),'set':function(_0x42c9da){if(!_0x42c9da)this[_0x369c('0x9')]('mandatoryDispositionPauseId',null);this[_0x369c('0x9')]('mandatoryDisposition',_0x42c9da);}}}; \ No newline at end of file +var _0x5aaa=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','name','generate'];(function(_0x441a8b,_0x443d8b){var _0x23a72f=function(_0x472df4){while(--_0x472df4){_0x441a8b['push'](_0x441a8b['shift']());}};_0x23a72f(++_0x443d8b);}(_0x5aaa,0x18e));var _0xa5aa=function(_0x2b2b34,_0x202957){_0x2b2b34=_0x2b2b34-0x0;var _0x3fded2=_0x5aaa[_0x2b2b34];return _0x3fded2;};'use strict';var Sequelize=require(_0xa5aa('0x0'));var rs=require('randomstring');module[_0xa5aa('0x1')]={'name':{'type':Sequelize[_0xa5aa('0x2')],'unique':_0xa5aa('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xa5aa('0x2')]},'token':{'type':Sequelize[_0xa5aa('0x2')],'defaultValue':function(){return rs[_0xa5aa('0x4')]();}},'replyUri':{'type':Sequelize[_0xa5aa('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xa5aa('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa5aa('0x5')],'defaultValue':function(){return _0xa5aa('0x6');}},'notificationSound':{'type':Sequelize[_0xa5aa('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa5aa('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa5aa('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xa5aa('0x2')]},'queueTransfer':{'type':Sequelize[_0xa5aa('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa5aa('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa5aa('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa5aa('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa5aa('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa5aa('0x7')],'defaultValue':![],'comment':_0xa5aa('0x9'),'set':function(_0xc79f21){if(!_0xc79f21)this['setDataValue'](_0xa5aa('0xa'),null);this[_0xa5aa('0xb')](_0xa5aa('0xc'),_0xc79f21);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index db0780e..0cb87ab 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 _0xaaf1=['color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','CmContact','user','out','Messages','spread','dataValues','push','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','send','index','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','Pause','fields','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','OpenchannelAccountId','Disposition','getDispositions','order','pick','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','ids','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','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','from','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','orderBy','asc','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','update','interaction','created','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Owner','fullname','Tag'];(function(_0x423f72,_0x2827d1){var _0x491c1c=function(_0x48d516){while(--_0x48d516){_0x423f72['push'](_0x423f72['shift']());}};_0x491c1c(++_0x2827d1);}(_0xaaf1,0xc8));var _0x1aaf=function(_0x5a75e7,_0xd80fa1){_0x5a75e7=_0x5a75e7-0x0;var _0x18ba14=_0xaaf1[_0x5a75e7];return _0x18ba14;};'use strict';var emlformat=require(_0x1aaf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1aaf('0x1'));var rp=require(_0x1aaf('0x2'));var moment=require(_0x1aaf('0x3'));var BPromise=require(_0x1aaf('0x4'));var Mustache=require(_0x1aaf('0x5'));var util=require(_0x1aaf('0x6'));var path=require(_0x1aaf('0x7'));var sox=require(_0x1aaf('0x8'));var csv=require(_0x1aaf('0x9'));var ejs=require(_0x1aaf('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1aaf('0xb'));var jsforce=require(_0x1aaf('0xc'));var deskjs=require(_0x1aaf('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1aaf('0xe'));var Papa=require(_0x1aaf('0xf'));var Redis=require(_0x1aaf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1aaf('0x11'));var as=require(_0x1aaf('0x12'));var hardwareService=require(_0x1aaf('0x13'));var logger=require('../../config/logger')(_0x1aaf('0x14'));var utils=require('../../config/utils');var config=require(_0x1aaf('0x15'));var licenseUtil=require(_0x1aaf('0x16'));var db=require(_0x1aaf('0x17'))['db'];config['redis']=_[_0x1aaf('0x18')](config[_0x1aaf('0x19')],{'host':_0x1aaf('0x1a'),'port':0x18eb});var socket=require(_0x1aaf('0x1b'))(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x1aaf('0x1c')](socket);var jayson=require(_0x1aaf('0x1d'));var client=jayson[_0x1aaf('0x1e')][_0x1aaf('0x1f')]({'port':0x232c});var client9002=jayson[_0x1aaf('0x1e')][_0x1aaf('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x58cb48,_0x16db61,_0x24b324,_0xd98d42){return new BPromise(function(_0x5564a4,_0x5839a5){var _0x52a3a9=_0xd98d42||client;return _0x52a3a9['request'](_0x58cb48,_0x24b324)[_0x1aaf('0x20')](function(_0xafa8c9){logger[_0x1aaf('0x21')](_0x1aaf('0x22'),_0x16db61,_0x1aaf('0x23'));logger[_0x1aaf('0x24')](_0x1aaf('0x25'),_0x16db61,_0x1aaf('0x23'),JSON[_0x1aaf('0x26')](_0xafa8c9));if(_0xafa8c9['error']){if(_0xafa8c9[_0x1aaf('0x27')][_0x1aaf('0x28')]===0x1f4){logger[_0x1aaf('0x27')](_0x1aaf('0x22'),_0x16db61,_0xafa8c9[_0x1aaf('0x27')]['message']);return _0x5839a5(_0xafa8c9[_0x1aaf('0x27')]['message']);}logger[_0x1aaf('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x16db61,_0xafa8c9['error'][_0x1aaf('0x29')]);return _0x5564a4(_0xafa8c9[_0x1aaf('0x27')][_0x1aaf('0x29')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x16db61,_0x1aaf('0x23'));_0x5564a4(_0xafa8c9[_0x1aaf('0x2a')]['message']);}})[_0x1aaf('0x2b')](function(_0x2aeadd){logger[_0x1aaf('0x27')](_0x1aaf('0x22'),_0x16db61,_0x2aeadd);_0x5839a5(_0x2aeadd);});});}function respondWithStatusCode(_0x58cde3,_0x21e1ea){_0x21e1ea=_0x21e1ea||0xcc;return function(_0x30d513){if(_0x30d513){return _0x58cde3['sendStatus'](_0x21e1ea);}return _0x58cde3[_0x1aaf('0x2c')](_0x21e1ea)[_0x1aaf('0x2d')]();};}function respondWithResult(_0x501c41,_0x47afc2){_0x47afc2=_0x47afc2||0xc8;return function(_0x2d41f5){if(_0x2d41f5){return _0x501c41['status'](_0x47afc2)[_0x1aaf('0x2e')](_0x2d41f5);}};}function respondWithFilteredResult(_0x2c739c,_0x49a880){return function(_0x25bd30){if(_0x25bd30){var _0x2481f8=typeof _0x49a880[_0x1aaf('0x2f')]===_0x1aaf('0x30')&&typeof _0x49a880['limit']===_0x1aaf('0x30');var _0x4a4061=_0x25bd30[_0x1aaf('0x31')];var _0x2e1aa8=_0x2481f8?0x0:_0x49a880[_0x1aaf('0x2f')];var _0x755eff=_0x2481f8?_0x25bd30['count']:_0x49a880[_0x1aaf('0x2f')]+_0x49a880[_0x1aaf('0x32')];var _0x5233d7;if(_0x755eff>=_0x4a4061){_0x755eff=_0x4a4061;_0x5233d7=0xc8;}else{_0x5233d7=0xce;}_0x2c739c[_0x1aaf('0x2c')](_0x5233d7);return _0x2c739c['set'](_0x1aaf('0x33'),_0x2e1aa8+'-'+_0x755eff+'/'+_0x4a4061)['json'](_0x25bd30);}return null;};}function patchUpdates(_0x2c5ab7){return function(_0x4db556){try{jsonpatch[_0x1aaf('0x34')](_0x4db556,_0x2c5ab7,!![]);}catch(_0xaa4d3){return BPromise['reject'](_0xaa4d3);}return _0x4db556[_0x1aaf('0x35')]();};}function saveUpdates(_0x4f9b2b,_0x40a8fd){return function(_0x508043){if(_0x508043){return _0x508043['update'](_0x4f9b2b)[_0x1aaf('0x20')](function(_0x3f7a1d){return _0x3f7a1d;});}return null;};}function removeEntity(_0x17242e,_0x4b11c8){return function(_0x2bc17c){if(_0x2bc17c){return _0x2bc17c[_0x1aaf('0x36')]()[_0x1aaf('0x20')](function(){var _0x28bf08=_0x2bc17c[_0x1aaf('0x37')]({'plain':!![]});var _0x1f1b22=_0x1aaf('0x38');return db[_0x1aaf('0x39')]['destroy']({'where':{'type':_0x1f1b22,'resourceId':_0x28bf08['id']}})[_0x1aaf('0x20')](function(){return _0x2bc17c;});})[_0x1aaf('0x20')](function(){_0x17242e[_0x1aaf('0x2c')](0xcc)[_0x1aaf('0x2d')]();});}};}function handleEntityNotFound(_0x22d1e4,_0xc17f29){return function(_0x54209c){if(!_0x54209c){_0x22d1e4[_0x1aaf('0x3a')](0x194);}return _0x54209c;};}function handleError(_0xf87e6b,_0x29a356){_0x29a356=_0x29a356||0x1f4;return function(_0x39e1cd){logger[_0x1aaf('0x27')](_0x39e1cd[_0x1aaf('0x3b')]);if(_0x39e1cd[_0x1aaf('0x3c')]){delete _0x39e1cd[_0x1aaf('0x3c')];}_0xf87e6b[_0x1aaf('0x2c')](_0x29a356)[_0x1aaf('0x3d')](_0x39e1cd);};}exports[_0x1aaf('0x3e')]=function(_0x4f1b71,_0x294dcf){var _0xb09d4e={'include':[{'model':db['Pause'],'as':_0x1aaf('0x3f')}]},_0x3a6dc2={},_0x270e20={'count':0x0,'rows':[]};var _0x3f4af9=_['map'](db[_0x1aaf('0x40')][_0x1aaf('0x41')],function(_0x2702e0){return{'name':_0x2702e0['fieldName'],'type':_0x2702e0['type']['key']};});_0x3a6dc2[_0x1aaf('0x42')]=_[_0x1aaf('0x43')](_0x3f4af9,_0x1aaf('0x3c'));_0x3a6dc2[_0x1aaf('0x44')]=_[_0x1aaf('0x45')](_0x4f1b71['query']);_0x3a6dc2[_0x1aaf('0x46')]=_[_0x1aaf('0x47')](_0x3a6dc2[_0x1aaf('0x42')],_0x3a6dc2[_0x1aaf('0x44')]);_0xb09d4e[_0x1aaf('0x48')]=_['intersection'](_0x3a6dc2[_0x1aaf('0x42')],qs['fields'](_0x4f1b71[_0x1aaf('0x44')]['fields']));_0xb09d4e['attributes']=_0xb09d4e[_0x1aaf('0x48')][_0x1aaf('0x49')]?_0xb09d4e[_0x1aaf('0x48')]:_0x3a6dc2[_0x1aaf('0x42')];if(!_0x4f1b71[_0x1aaf('0x44')][_0x1aaf('0x4a')](_0x1aaf('0x4b'))){_0xb09d4e[_0x1aaf('0x32')]=qs['limit'](_0x4f1b71[_0x1aaf('0x44')][_0x1aaf('0x32')]);_0xb09d4e['offset']=qs[_0x1aaf('0x2f')](_0x4f1b71['query'][_0x1aaf('0x2f')]);}_0xb09d4e['order']=qs['sort'](_0x4f1b71[_0x1aaf('0x44')][_0x1aaf('0x4c')]);_0xb09d4e['where']=qs[_0x1aaf('0x46')](_['pick'](_0x4f1b71[_0x1aaf('0x44')],_0x3a6dc2[_0x1aaf('0x46')]),_0x3f4af9);if(_0x4f1b71[_0x1aaf('0x44')][_0x1aaf('0x4d')]){_0xb09d4e[_0x1aaf('0x4e')]=_[_0x1aaf('0x4f')](_0xb09d4e[_0x1aaf('0x4e')],{'$or':_['map'](_0x3f4af9,function(_0x1dbdfb){if(_0x1dbdfb['type']!==_0x1aaf('0x50')){var _0x5987fd={};_0x5987fd[_0x1dbdfb[_0x1aaf('0x3c')]]={'$like':'%'+_0x4f1b71[_0x1aaf('0x44')]['filter']+'%'};return _0x5987fd;}})});}_0xb09d4e=_[_0x1aaf('0x4f')]({},_0xb09d4e,_0x4f1b71['options']);var _0x38b5c0={'where':_0xb09d4e['where']};return db['OpenchannelAccount']['count'](_0x38b5c0)['then'](function(_0x3f4a1f){_0x270e20[_0x1aaf('0x31')]=_0x3f4a1f;if(_0x4f1b71[_0x1aaf('0x44')][_0x1aaf('0x51')]){_0xb09d4e[_0x1aaf('0x52')]=[{'all':!![]}];}return db[_0x1aaf('0x40')][_0x1aaf('0x53')](_0xb09d4e);})[_0x1aaf('0x20')](function(_0x12f527){_0x270e20[_0x1aaf('0x54')]=_0x12f527;return _0x270e20;})[_0x1aaf('0x20')](respondWithFilteredResult(_0x294dcf,_0xb09d4e))[_0x1aaf('0x2b')](handleError(_0x294dcf,null));};exports[_0x1aaf('0x55')]=function(_0xb96d10,_0x39fafc){var _0x2132f7={'raw':![],'where':{'id':_0xb96d10['params']['id']},'include':[{'model':db[_0x1aaf('0x56')],'as':_0x1aaf('0x3f')}]},_0x230e04={};_0x230e04[_0x1aaf('0x42')]=_['keys'](db[_0x1aaf('0x40')][_0x1aaf('0x41')]);_0x230e04[_0x1aaf('0x44')]=_['keys'](_0xb96d10[_0x1aaf('0x44')]);_0x230e04[_0x1aaf('0x46')]=_[_0x1aaf('0x47')](_0x230e04[_0x1aaf('0x42')],_0x230e04[_0x1aaf('0x44')]);_0x2132f7[_0x1aaf('0x48')]=_[_0x1aaf('0x47')](_0x230e04[_0x1aaf('0x42')],qs[_0x1aaf('0x57')](_0xb96d10[_0x1aaf('0x44')][_0x1aaf('0x57')]));_0x2132f7[_0x1aaf('0x48')]=_0x2132f7[_0x1aaf('0x48')][_0x1aaf('0x49')]?_0x2132f7['attributes']:_0x230e04['model'];if(_0xb96d10['query'][_0x1aaf('0x51')]){_0x2132f7[_0x1aaf('0x52')]=[{'all':!![]}];}_0x2132f7=_[_0x1aaf('0x4f')]({},_0x2132f7,_0xb96d10[_0x1aaf('0x58')]);return db[_0x1aaf('0x40')][_0x1aaf('0x59')](_0x2132f7)['then'](handleEntityNotFound(_0x39fafc,null))[_0x1aaf('0x20')](respondWithResult(_0x39fafc,null))[_0x1aaf('0x2b')](handleError(_0x39fafc,null));};exports[_0x1aaf('0x5a')]=function(_0x469a6d,_0x5f9990){return db['OpenchannelAccount'][_0x1aaf('0x5a')](_0x469a6d[_0x1aaf('0x5b')],{})[_0x1aaf('0x20')](function(_0x3db2ac){var _0x2e9b77=_0x469a6d['user']['get']({'plain':!![]});if(!_0x2e9b77)throw new Error(_0x1aaf('0x5c'));if(_0x2e9b77[_0x1aaf('0x5d')]==='user'){var _0x1a3056=_0x3db2ac['get']({'plain':!![]});var _0x18938d=_0x1aaf('0x38');return db[_0x1aaf('0x5e')]['find']({'where':{'name':_0x18938d,'userProfileId':_0x2e9b77['userProfileId']},'raw':!![]})[_0x1aaf('0x20')](function(_0x1c0a51){if(_0x1c0a51&&_0x1c0a51[_0x1aaf('0x5f')]===0x0){return db[_0x1aaf('0x39')]['create']({'name':_0x1a3056[_0x1aaf('0x3c')],'resourceId':_0x1a3056['id'],'type':_0x1c0a51[_0x1aaf('0x3c')],'sectionId':_0x1c0a51['id']},{})[_0x1aaf('0x20')](function(){return _0x3db2ac;});}else{return _0x3db2ac;}})[_0x1aaf('0x2b')](function(_0x23d731){logger[_0x1aaf('0x27')](_0x1aaf('0x60'),_0x23d731);throw _0x23d731;});}return _0x3db2ac;})[_0x1aaf('0x20')](respondWithResult(_0x5f9990,0xc9))[_0x1aaf('0x2b')](handleError(_0x5f9990,null));};exports['update']=function(_0x27422a,_0x26ad40){if(_0x27422a[_0x1aaf('0x5b')]['id']){delete _0x27422a[_0x1aaf('0x5b')]['id'];}return db[_0x1aaf('0x40')]['find']({'where':{'id':_0x27422a[_0x1aaf('0x61')]['id']},'include':[{'model':db[_0x1aaf('0x56')],'as':'mandatoryDispositionPause'}]})[_0x1aaf('0x20')](handleEntityNotFound(_0x26ad40,null))[_0x1aaf('0x20')](saveUpdates(_0x27422a[_0x1aaf('0x5b')],null))['then'](respondWithResult(_0x26ad40,null))[_0x1aaf('0x2b')](handleError(_0x26ad40,null));};exports[_0x1aaf('0x36')]=function(_0xaa2d97,_0x462a3f){return db[_0x1aaf('0x40')]['find']({'where':{'id':_0xaa2d97['params']['id']}})[_0x1aaf('0x20')](handleEntityNotFound(_0x462a3f,null))['then'](removeEntity(_0x462a3f,null))[_0x1aaf('0x2b')](handleError(_0x462a3f,null));};exports[_0x1aaf('0x62')]=function(_0x133560,_0x2edca7){return db[_0x1aaf('0x40')][_0x1aaf('0x62')]()[_0x1aaf('0x20')](respondWithResult(_0x2edca7,null))[_0x1aaf('0x2b')](handleError(_0x2edca7,null));};exports['addDisposition']=function(_0x500acb,_0x44cdfc,_0x30a02c){if(_0x500acb[_0x1aaf('0x5b')]['id']){delete _0x500acb[_0x1aaf('0x5b')]['id'];}return db['OpenchannelAccount'][_0x1aaf('0x59')]({'where':{'id':_0x500acb[_0x1aaf('0x61')]['id']}})[_0x1aaf('0x20')](handleEntityNotFound(_0x44cdfc,null))[_0x1aaf('0x20')](function(_0x3e799f){if(_0x3e799f){_0x500acb['body'][_0x1aaf('0x63')]=_0x3e799f['id'];return db[_0x1aaf('0x64')][_0x1aaf('0x5a')](_0x500acb['body']);}})[_0x1aaf('0x20')](respondWithResult(_0x44cdfc,null))['catch'](handleError(_0x44cdfc,null));};exports[_0x1aaf('0x65')]=function(_0x4d72d3,_0x2e4d3f,_0x5f57a5){var _0x48c908={'raw':![],'where':{}};var _0x3ba481={};var _0x1a5f58={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x4d72d3[_0x1aaf('0x61')]['id']}})[_0x1aaf('0x20')](handleEntityNotFound(_0x2e4d3f,null))[_0x1aaf('0x20')](function(_0x2e99f0){if(_0x2e99f0){_0x3ba481['model']=_[_0x1aaf('0x45')](db[_0x1aaf('0x64')][_0x1aaf('0x41')]);_0x3ba481[_0x1aaf('0x44')]=_['keys'](_0x4d72d3[_0x1aaf('0x44')]);_0x3ba481[_0x1aaf('0x46')]=_[_0x1aaf('0x47')](_0x3ba481[_0x1aaf('0x42')],_0x3ba481[_0x1aaf('0x44')]);_0x48c908[_0x1aaf('0x48')]=_[_0x1aaf('0x47')](_0x3ba481[_0x1aaf('0x42')],qs['fields'](_0x4d72d3[_0x1aaf('0x44')][_0x1aaf('0x57')]));_0x48c908[_0x1aaf('0x48')]=_0x48c908[_0x1aaf('0x48')][_0x1aaf('0x49')]?_0x48c908[_0x1aaf('0x48')]:_0x3ba481[_0x1aaf('0x42')];if(!_0x4d72d3[_0x1aaf('0x44')][_0x1aaf('0x4a')]('nolimit')){_0x48c908[_0x1aaf('0x32')]=qs[_0x1aaf('0x32')](_0x4d72d3[_0x1aaf('0x44')][_0x1aaf('0x32')]);_0x48c908[_0x1aaf('0x2f')]=qs[_0x1aaf('0x2f')](_0x4d72d3[_0x1aaf('0x44')]['offset']);}_0x48c908[_0x1aaf('0x66')]=qs[_0x1aaf('0x4c')](_0x4d72d3[_0x1aaf('0x44')]['sort']);_0x48c908[_0x1aaf('0x4e')]=qs['filters'](_[_0x1aaf('0x67')](_0x4d72d3[_0x1aaf('0x44')],_0x3ba481[_0x1aaf('0x46')]));_0x48c908[_0x1aaf('0x4e')][_0x1aaf('0x63')]=_0x2e99f0['id'];if(_0x4d72d3[_0x1aaf('0x44')][_0x1aaf('0x4d')]){_0x48c908['where']=_['merge'](_0x48c908['where'],{'$or':_[_0x1aaf('0x43')](_0x48c908['attributes'],function(_0x1cbe84){var _0x177c51={};_0x177c51[_0x1cbe84]={'$like':'%'+_0x4d72d3[_0x1aaf('0x44')][_0x1aaf('0x4d')]+'%'};return _0x177c51;})});}_0x48c908=_[_0x1aaf('0x4f')]({},_0x48c908,_0x4d72d3['options']);return db[_0x1aaf('0x64')][_0x1aaf('0x31')]({'where':_0x48c908['where']})['then'](function(_0x274426){_0x1a5f58[_0x1aaf('0x31')]=_0x274426;if(_0x4d72d3[_0x1aaf('0x44')]['includeAll']){_0x48c908[_0x1aaf('0x52')]=[{'all':!![]}];}return db[_0x1aaf('0x64')][_0x1aaf('0x53')](_0x48c908);})[_0x1aaf('0x20')](function(_0x3fd13f){_0x1a5f58[_0x1aaf('0x54')]=_0x3fd13f;return _0x1a5f58;});}})['then'](respondWithFilteredResult(_0x2e4d3f,_0x48c908))[_0x1aaf('0x2b')](handleError(_0x2e4d3f,null));};exports[_0x1aaf('0x68')]=function(_0x15102a,_0x1edc28,_0x2c5662){return db[_0x1aaf('0x40')][_0x1aaf('0x59')]({'where':{'id':_0x15102a[_0x1aaf('0x61')]['id']}})['then'](handleEntityNotFound(_0x1edc28,null))[_0x1aaf('0x20')](function(_0xd99eee){if(_0xd99eee){return _0xd99eee[_0x1aaf('0x68')](_0x15102a[_0x1aaf('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x1edc28,null))['catch'](handleError(_0x1edc28,null));};exports[_0x1aaf('0x69')]=function(_0xeb825,_0x1bfa93,_0x410566){if(_0xeb825['body']['id']){delete _0xeb825['body']['id'];}return db[_0x1aaf('0x40')]['find']({'where':{'id':_0xeb825[_0x1aaf('0x61')]['id']}})[_0x1aaf('0x20')](handleEntityNotFound(_0x1bfa93,null))[_0x1aaf('0x20')](function(_0x138715){if(_0x138715){_0xeb825['body'][_0x1aaf('0x63')]=_0x138715['id'];return db['CannedAnswer'][_0x1aaf('0x5a')](_0xeb825[_0x1aaf('0x5b')]);}})[_0x1aaf('0x20')](respondWithResult(_0x1bfa93,null))[_0x1aaf('0x2b')](handleError(_0x1bfa93,null));};exports[_0x1aaf('0x6a')]=function(_0x43e361,_0x5a2415,_0x437114){var _0x587586={'raw':![],'where':{}};var _0x295914={};var _0x1aca09={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x1aaf('0x6b')]({'where':{'id':_0x43e361[_0x1aaf('0x61')]['id']}})[_0x1aaf('0x20')](handleEntityNotFound(_0x5a2415,null))[_0x1aaf('0x20')](function(_0x1d6ae2){if(_0x1d6ae2){_0x295914[_0x1aaf('0x42')]=_[_0x1aaf('0x45')](db[_0x1aaf('0x6c')][_0x1aaf('0x41')]);_0x295914[_0x1aaf('0x44')]=_[_0x1aaf('0x45')](_0x43e361[_0x1aaf('0x44')]);_0x295914[_0x1aaf('0x46')]=_[_0x1aaf('0x47')](_0x295914['model'],_0x295914[_0x1aaf('0x44')]);_0x587586['attributes']=_[_0x1aaf('0x47')](_0x295914['model'],qs[_0x1aaf('0x57')](_0x43e361[_0x1aaf('0x44')][_0x1aaf('0x57')]));_0x587586[_0x1aaf('0x48')]=_0x587586['attributes'][_0x1aaf('0x49')]?_0x587586[_0x1aaf('0x48')]:_0x295914[_0x1aaf('0x42')];if(!_0x43e361[_0x1aaf('0x44')]['hasOwnProperty']('nolimit')){_0x587586[_0x1aaf('0x32')]=qs['limit'](_0x43e361[_0x1aaf('0x44')]['limit']);_0x587586[_0x1aaf('0x2f')]=qs[_0x1aaf('0x2f')](_0x43e361[_0x1aaf('0x44')][_0x1aaf('0x2f')]);}_0x587586['order']=qs[_0x1aaf('0x4c')](_0x43e361[_0x1aaf('0x44')][_0x1aaf('0x4c')]);_0x587586[_0x1aaf('0x4e')]=qs['filters'](_[_0x1aaf('0x67')](_0x43e361[_0x1aaf('0x44')],_0x295914[_0x1aaf('0x46')]));_0x587586['where']['OpenchannelAccountId']=_0x1d6ae2['id'];if(_0x43e361[_0x1aaf('0x44')]['filter']){_0x587586['where']=_[_0x1aaf('0x4f')](_0x587586['where'],{'$or':_[_0x1aaf('0x43')](_0x587586[_0x1aaf('0x48')],function(_0x2943e0){var _0x4771db={};_0x4771db[_0x2943e0]={'$like':'%'+_0x43e361[_0x1aaf('0x44')][_0x1aaf('0x4d')]+'%'};return _0x4771db;})});}_0x587586=_[_0x1aaf('0x4f')]({},_0x587586,_0x43e361['options']);return db[_0x1aaf('0x6c')][_0x1aaf('0x31')]({'where':_0x587586[_0x1aaf('0x4e')]})[_0x1aaf('0x20')](function(_0x58e0d3){_0x1aca09[_0x1aaf('0x31')]=_0x58e0d3;if(_0x43e361[_0x1aaf('0x44')]['includeAll']){_0x587586['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x1aaf('0x53')](_0x587586);})[_0x1aaf('0x20')](function(_0x42080e){_0x1aca09[_0x1aaf('0x54')]=_0x42080e;return _0x1aca09;});}})[_0x1aaf('0x20')](respondWithFilteredResult(_0x5a2415,_0x587586))[_0x1aaf('0x2b')](handleError(_0x5a2415,null));};exports[_0x1aaf('0x6d')]=function(_0x28025e,_0x1c0e58,_0x134bc5){return db[_0x1aaf('0x40')][_0x1aaf('0x59')]({'where':{'id':_0x28025e[_0x1aaf('0x61')]['id']}})[_0x1aaf('0x20')](handleEntityNotFound(_0x1c0e58,null))[_0x1aaf('0x20')](function(_0x517e59){if(_0x517e59){return _0x517e59[_0x1aaf('0x6d')](_0x28025e[_0x1aaf('0x44')][_0x1aaf('0x6e')]);}})[_0x1aaf('0x20')](respondWithStatusCode(_0x1c0e58,null))[_0x1aaf('0x2b')](handleError(_0x1c0e58,null));};exports[_0x1aaf('0x6f')]=function(_0x1ca733,_0x5ef7b9,_0x3c2009){var _0x41c11a={'body':_0x1ca733[_0x1aaf('0x5b')],'channel':_0x1aaf('0x70')};var _0x758e9e=[];var _0x8c677d=[];var _0x510cc7={};var _0x3e88df=![];return db['CmContact'][_0x1aaf('0x62')]()['then'](function(_0x2c59df){if(!_0x2c59df){throw new db[(_0x1aaf('0x71'))][(_0x1aaf('0x72'))](_0x1aaf('0x73'));}_0x758e9e=_[_0x1aaf('0x74')](_[_0x1aaf('0x45')](_0x2c59df),['createdAt','updatedAt']);_0x8c677d=_[_0x1aaf('0x74')](_[_0x1aaf('0x45')](_0x2c59df),[_0x1aaf('0x75'),_0x1aaf('0x76'),_0x1aaf('0x77'),_0x1aaf('0x78')]);if(_0x1ca733[_0x1aaf('0x5b')]['id']){delete _0x1ca733[_0x1aaf('0x5b')]['id'];}if(_['isNil'](_0x1ca733[_0x1aaf('0x5b')]['from'])){throw new db[(_0x1aaf('0x71'))][(_0x1aaf('0x72'))](_0x1aaf('0x79'));}if(_[_0x1aaf('0x7a')](_0x1ca733[_0x1aaf('0x5b')][_0x1aaf('0x5b')])||_0x1ca733[_0x1aaf('0x5b')]['body']===''){throw new db[(_0x1aaf('0x71'))][(_0x1aaf('0x72'))](_0x1aaf('0x7b'));}if(_[_0x1aaf('0x7a')](_0x1ca733['body'][_0x1aaf('0x7c')])){throw new db[(_0x1aaf('0x71'))][(_0x1aaf('0x72'))](_0x1aaf('0x7d')+_0x8c677d);}if(!_[_0x1aaf('0x7e')](_0x8c677d,_0x1ca733[_0x1aaf('0x5b')][_0x1aaf('0x7c')])){throw new db['Sequelize'][(_0x1aaf('0x72'))](_0x1aaf('0x7f')+_0x8c677d);}_0x510cc7[_0x1ca733[_0x1aaf('0x5b')]['mapKey']]=_0x1ca733[_0x1aaf('0x5b')][_0x1aaf('0x80')];})[_0x1aaf('0x20')](function(){return db[_0x1aaf('0x40')]['find']({'where':{'id':_0x1ca733['params']['id']},'include':[{'model':db['CmList'],'as':_0x1aaf('0x81'),'include':[{'model':db['CmContact'],'as':_0x1aaf('0x82'),'where':_0x510cc7,'limit':0x1,'order':[[_0x1aaf('0x76'),_0x1aaf('0x83')]]}]},{'model':db[_0x1aaf('0x84')],'as':_0x1aaf('0x85')}]});})[_0x1aaf('0x20')](handleEntityNotFound(_0x5ef7b9,null))[_0x1aaf('0x20')](function(_0x50515e){if(_0x50515e&&_0x50515e['List']){_0x41c11a[_0x1aaf('0x86')]=_0x50515e;_0x41c11a[_0x1aaf('0x87')]=_0x50515e[_0x1aaf('0x85')];_0x41c11a['list']=_0x50515e[_0x1aaf('0x81')];_0x41c11a[_0x1aaf('0x87')]=_[_0x1aaf('0x88')](_0x41c11a['applications'],['priority'],[_0x1aaf('0x89')]);if(_0x41c11a[_0x1aaf('0x86')][_0x1aaf('0x85')]){delete _0x41c11a['account'][_0x1aaf('0x85')];}if(_0x41c11a[_0x1aaf('0x86')][_0x1aaf('0x81')]&&_0x41c11a[_0x1aaf('0x86')][_0x1aaf('0x81')]['Contacts'][_0x1aaf('0x49')]){return _0x41c11a[_0x1aaf('0x86')][_0x1aaf('0x81')][_0x1aaf('0x82')][0x0];}var _0x5a4445=_[_0x1aaf('0x18')](_0x1ca733[_0x1aaf('0x5b')],{'firstName':_0x1ca733[_0x1aaf('0x5b')][_0x1aaf('0x80')],'ListId':_0x50515e[_0x1aaf('0x78')]});_0x5a4445[_0x1ca733['body'][_0x1aaf('0x7c')]]=_0x1ca733[_0x1aaf('0x5b')][_0x1aaf('0x80')];return db['CmContact'][_0x1aaf('0x5a')](_0x5a4445,{'fields':_0x758e9e,'raw':!![]});}})[_0x1aaf('0x20')](handleEntityNotFound(_0x5ef7b9,null))[_0x1aaf('0x20')](function(_0x326599){_0x41c11a[_0x1aaf('0x8a')]=_0x326599;if(_0x326599){var _0x43bed7={'ContactId':_0x326599['id'],'OpenchannelAccountId':_0x1ca733[_0x1aaf('0x61')]['id'],'from':(_0x326599['firstName']||'')+'\x20'+(_0x326599[_0x1aaf('0x8b')]||'')};var _0x55ef24={'OpenchannelAccountId':_0x1ca733[_0x1aaf('0x61')]['id'],'closed':![]};if(_0x1ca733[_0x1aaf('0x5b')]['threadId']){_0x55ef24[_0x1aaf('0x8c')]=_0x1ca733[_0x1aaf('0x5b')][_0x1aaf('0x8c')];return db[_0x1aaf('0x8d')][_0x1aaf('0x59')]({'where':_0x55ef24})[_0x1aaf('0x20')](function(_0x2c48c0){if(_0x2c48c0){return[_0x2c48c0,![]];}_0x43bed7['threadId']=_0x1ca733['body'][_0x1aaf('0x8c')];_0x43bed7[_0x1aaf('0x8e')]=_0x1ca733[_0x1aaf('0x5b')][_0x1aaf('0x8e')];return db[_0x1aaf('0x8d')]['create'](_0x43bed7)['then'](function(_0x281e4f){return[_0x281e4f,!![]];});});}else{_0x55ef24[_0x1aaf('0x8c')]=null;}_0x55ef24[_0x1aaf('0x8f')]=_0x326599['id'];return db['OpenchannelInteraction'][_0x1aaf('0x59')]({'where':_0x55ef24})[_0x1aaf('0x20')](function(_0x52b085){if(_0x52b085){return[_0x52b085,![]];}return db[_0x1aaf('0x8d')][_0x1aaf('0x5a')](_0x43bed7)['then'](function(_0x37e988){return[_0x37e988,!![]];});});}})['spread'](function(_0x615795,_0x16f81c){if(_0x615795){_0x3e88df=_0x16f81c;if(!_0x16f81c){var _0x456898={'from':(_0x41c11a['contact']['firstName']||'')+'\x20'+(_0x41c11a[_0x1aaf('0x8a')][_0x1aaf('0x8b')]||'')};if(_0x1ca733[_0x1aaf('0x5b')][_0x1aaf('0x8c')]&&_0x1ca733[_0x1aaf('0x5b')][_0x1aaf('0x90')]&&_0x1ca733[_0x1aaf('0x5b')][_0x1aaf('0x8c')]!=_0x1ca733[_0x1aaf('0x5b')]['messageId']){_0x456898['threadId']=_0x1ca733[_0x1aaf('0x5b')][_0x1aaf('0x90')];}return _0x615795[_0x1aaf('0x91')](_0x456898);}else{return _0x615795;}}})[_0x1aaf('0x20')](function(_0x11a6f9){_0x41c11a[_0x1aaf('0x92')]=_0x11a6f9['get']({'plain':!![]});_0x41c11a[_0x1aaf('0x92')][_0x1aaf('0x93')]=_0x3e88df;if(_0x41c11a[_0x1aaf('0x92')][_0x1aaf('0x93')]){if(_0x41c11a['account']['autoclose']){_0x41c11a[_0x1aaf('0x87')]['push']({'id':0x0,'priority':_0x41c11a['applications'][_0x1aaf('0x49')]+0x1,'app':_0x1aaf('0x94'),'appdata':_0x1aaf('0x95'),'interval':_0x1aaf('0x96')});}}return db[_0x1aaf('0x97')][_0x1aaf('0x5a')]({'body':_0x1ca733[_0x1aaf('0x5b')][_0x1aaf('0x5b')],'OpenchannelAccountId':_0x1ca733[_0x1aaf('0x61')]['id'],'OpenchannelInteractionId':_0x11a6f9['id'],'direction':'in','ContactId':_0x41c11a['contact']['id'],'AttachmentId':_0x1ca733[_0x1aaf('0x5b')]['AttachmentId']});})[_0x1aaf('0x20')](function(_0x12d26b){_0x41c11a[_0x1aaf('0x29')]=_0x12d26b;if(_0x41c11a[_0x1aaf('0x92')][_0x1aaf('0x98')]){return db[_0x1aaf('0x99')][_0x1aaf('0x59')]({'attributes':['id','name'],'where':{'id':_0x41c11a[_0x1aaf('0x92')]['UserId']}})[_0x1aaf('0x20')](function(_0x2f64ff){if(_0x2f64ff){_0x41c11a[_0x1aaf('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':_0x1aaf('0x9a'),'appdata':_0x2f64ff[_0x1aaf('0x3c')]+','+(_0x41c11a[_0x1aaf('0x86')][_0x1aaf('0x9b')]||0xa),'interval':_0x1aaf('0x96')});_0x41c11a[_0x1aaf('0x9c')]=![];}return respondWithRpcPromise(_0x1aaf('0x9d'),_0x1aaf('0x9e'),_0x41c11a);});}return respondWithRpcPromise(_0x1aaf('0x9d'),_0x1aaf('0x9e'),_0x41c11a);})[_0x1aaf('0x20')](function(_0x2f3a51){respondWithRpcPromise(_0x1aaf('0x9f'),_0x1aaf('0x9f'),{'event':_0x1aaf('0x6f'),'message':_0x2f3a51},client9002);return _0x2f3a51;})[_0x1aaf('0x20')](respondWithResult(_0x5ef7b9,null))[_0x1aaf('0x2b')](handleError(_0x5ef7b9,null));};exports[_0x1aaf('0xa0')]=function(_0x5220c9,_0x23e817,_0xfa15bf){return db[_0x1aaf('0x40')][_0x1aaf('0x6b')]({'where':{'id':_0x5220c9[_0x1aaf('0x61')]['id']}})[_0x1aaf('0x20')](handleEntityNotFound(_0x23e817,null))[_0x1aaf('0x20')](function(_0xe26901){if(_0xe26901){return db[_0x1aaf('0xa1')][_0x1aaf('0xa2')](function(_0x3f30fb){return db[_0x1aaf('0x84')][_0x1aaf('0x36')]({'where':{'OpenchannelAccountId':_0x5220c9[_0x1aaf('0x61')]['id']},'transaction':_0x3f30fb})[_0x1aaf('0x20')](function(_0x4407ea){var _0x3b1487=_['map'](_0x5220c9[_0x1aaf('0x5b')],function(_0x240cbf){_0x240cbf[_0x1aaf('0x63')]=_0x5220c9[_0x1aaf('0x61')]['id'];return _0x240cbf;});return db[_0x1aaf('0x84')][_0x1aaf('0xa3')](_0x3b1487,{'transaction':_0x3f30fb});});})[_0x1aaf('0x20')](function(){return db[_0x1aaf('0x84')][_0x1aaf('0xa4')]({'where':{'OpenchannelAccountId':_0x5220c9[_0x1aaf('0x61')]['id']},'order':'priority'});});}})[_0x1aaf('0x20')](respondWithResult(_0x23e817,null))[_0x1aaf('0x2b')](handleError(_0x23e817,null));};exports[_0x1aaf('0xa5')]=function(_0x24445a,_0x2b00ee,_0x5f1992){var _0x5e9a75={};var _0x45ab05={};var _0x31ff4b;var _0x30dbc2;return db[_0x1aaf('0x40')][_0x1aaf('0x6b')]({'where':{'id':_0x24445a[_0x1aaf('0x61')]['id']}})['then'](handleEntityNotFound(_0x2b00ee,null))[_0x1aaf('0x20')](function(_0x1a4e60){if(_0x1a4e60){_0x31ff4b=_0x1a4e60;_0x45ab05[_0x1aaf('0x42')]=_[_0x1aaf('0x45')](db['OpenchannelApplication'][_0x1aaf('0x41')]);_0x45ab05[_0x1aaf('0x44')]=_[_0x1aaf('0x45')](_0x24445a[_0x1aaf('0x44')]);_0x45ab05['filters']=_[_0x1aaf('0x47')](_0x45ab05[_0x1aaf('0x42')],_0x45ab05[_0x1aaf('0x44')]);_0x5e9a75[_0x1aaf('0x48')]=_[_0x1aaf('0x47')](_0x45ab05[_0x1aaf('0x42')],qs[_0x1aaf('0x57')](_0x24445a[_0x1aaf('0x44')][_0x1aaf('0x57')]));_0x5e9a75[_0x1aaf('0x48')]=_0x5e9a75[_0x1aaf('0x48')]['length']?_0x5e9a75['attributes']:_0x45ab05['model'];_0x5e9a75[_0x1aaf('0x66')]=qs['sort'](_0x24445a['query']['sort']);_0x5e9a75[_0x1aaf('0x4e')]=qs[_0x1aaf('0x46')](_[_0x1aaf('0x67')](_0x24445a[_0x1aaf('0x44')],_0x45ab05[_0x1aaf('0x46')]));if(_0x24445a['query'][_0x1aaf('0x4d')]){_0x5e9a75[_0x1aaf('0x4e')]=_[_0x1aaf('0x4f')](_0x5e9a75[_0x1aaf('0x4e')],{'$or':_['map'](_0x5e9a75['attributes'],function(_0xbbc398){var _0x385183={};_0x385183[_0xbbc398]={'$like':'%'+_0x24445a[_0x1aaf('0x44')]['filter']+'%'};return _0x385183;})});}_0x5e9a75=_['merge']({},_0x5e9a75,_0x24445a[_0x1aaf('0x58')]);return _0x31ff4b[_0x1aaf('0xa5')](_0x5e9a75);}})[_0x1aaf('0x20')](function(_0x53936b){if(_0x53936b){_0x30dbc2=_0x53936b[_0x1aaf('0x49')];if(!_0x24445a[_0x1aaf('0x44')][_0x1aaf('0x4a')](_0x1aaf('0x4b'))){_0x5e9a75[_0x1aaf('0x32')]=qs[_0x1aaf('0x32')](_0x24445a['query']['limit']);_0x5e9a75['offset']=qs['offset'](_0x24445a['query']['offset']);}return _0x31ff4b['getApplications'](_0x5e9a75);}})[_0x1aaf('0x20')](function(_0x2c1835){if(_0x2c1835){return _0x2c1835?{'count':_0x30dbc2,'rows':_0x2c1835}:null;}})[_0x1aaf('0x20')](respondWithResult(_0x2b00ee,null))[_0x1aaf('0x2b')](handleError(_0x2b00ee,null));};exports[_0x1aaf('0xa6')]=function(_0x108264,_0x4ba9e7,_0xe6ff7){var _0x190a65={'raw':![],'where':{}};var _0x2d7a83={};var _0x2ea6d7={'count':0x0,'rows':[]};return db[_0x1aaf('0x40')][_0x1aaf('0x6b')]({'where':{'id':_0x108264[_0x1aaf('0x61')]['id']}})[_0x1aaf('0x20')](handleEntityNotFound(_0x4ba9e7,null))[_0x1aaf('0x20')](function(_0x19eda0){if(_0x19eda0){_0x2d7a83['model']=_[_0x1aaf('0x45')](db[_0x1aaf('0x8d')]['rawAttributes']);_0x2d7a83[_0x1aaf('0x44')]=_[_0x1aaf('0x45')](_0x108264[_0x1aaf('0x44')]);_0x2d7a83[_0x1aaf('0x46')]=_[_0x1aaf('0x47')](_0x2d7a83[_0x1aaf('0x42')],_0x2d7a83['query']);_0x190a65[_0x1aaf('0x48')]=_[_0x1aaf('0x47')](_0x2d7a83[_0x1aaf('0x42')],qs[_0x1aaf('0x57')](_0x108264[_0x1aaf('0x44')][_0x1aaf('0x57')]));_0x190a65[_0x1aaf('0x48')]=_0x190a65[_0x1aaf('0x48')]['length']?_0x190a65[_0x1aaf('0x48')]:_0x2d7a83[_0x1aaf('0x42')];if(!_0x108264['query'][_0x1aaf('0x4a')](_0x1aaf('0x4b'))){_0x190a65[_0x1aaf('0x32')]=qs[_0x1aaf('0x32')](_0x108264[_0x1aaf('0x44')][_0x1aaf('0x32')]);_0x190a65[_0x1aaf('0x2f')]=qs[_0x1aaf('0x2f')](_0x108264[_0x1aaf('0x44')]['offset']);}_0x190a65[_0x1aaf('0x66')]=qs[_0x1aaf('0x4c')](_0x108264['query']['sort']);_0x190a65[_0x1aaf('0x4e')]=qs['filters'](_['pick'](_0x108264[_0x1aaf('0x44')],_0x2d7a83[_0x1aaf('0x46')]));_0x190a65[_0x1aaf('0x4e')][_0x1aaf('0x63')]=_0x19eda0['id'];if(_0x108264['query'][_0x1aaf('0x4d')]){_0x190a65[_0x1aaf('0x4e')]=_[_0x1aaf('0x4f')](_0x190a65[_0x1aaf('0x4e')],{'$or':_[_0x1aaf('0x43')](_0x190a65[_0x1aaf('0x48')],function(_0x3d7550){var _0x1a8238={};_0x1a8238[_0x3d7550]={'$like':'%'+_0x108264['query'][_0x1aaf('0x4d')]+'%'};return _0x1a8238;})});}_0x190a65=_[_0x1aaf('0x4f')]({},_0x190a65,_0x108264[_0x1aaf('0x58')]);return db[_0x1aaf('0x8d')][_0x1aaf('0x31')]({'where':_0x190a65[_0x1aaf('0x4e')]})[_0x1aaf('0x20')](function(_0x637dc8){_0x2ea6d7[_0x1aaf('0x31')]=_0x637dc8;if(_0x108264[_0x1aaf('0x44')][_0x1aaf('0x51')]){_0x190a65[_0x1aaf('0x52')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x1aaf('0x99')],'as':_0x1aaf('0xa7'),'attributes':[_0x1aaf('0x3c'),_0x1aaf('0xa8'),'internal'],'required':![]},{'model':db[_0x1aaf('0xa9')],'as':'Tags','attributes':['id',_0x1aaf('0x3c'),_0x1aaf('0xaa')],'where':_0x108264[_0x1aaf('0x44')]['tag']?{'id':_0x108264[_0x1aaf('0x44')][_0x1aaf('0xab')]}:undefined,'required':_0x108264[_0x1aaf('0x44')]['tag']?!![]:![]}];}return db['OpenchannelInteraction'][_0x1aaf('0x53')](_0x190a65);})[_0x1aaf('0x20')](function(_0x262f5c){_0x2ea6d7[_0x1aaf('0x54')]=_0x262f5c;return _0x2ea6d7;});}})[_0x1aaf('0x20')](respondWithFilteredResult(_0x4ba9e7,_0x190a65))['catch'](handleError(_0x4ba9e7,null));};exports[_0x1aaf('0xac')]=function(_0x522c2c,_0x5900f1,_0x3653a9){return db['OpenchannelAccount'][_0x1aaf('0x59')]({'where':{'id':_0x522c2c[_0x1aaf('0x61')]['id']}})['then'](handleEntityNotFound(_0x5900f1,null))[_0x1aaf('0x20')](function(_0x49d6b4){if(_0x49d6b4){return _0x49d6b4[_0x1aaf('0xac')](_0x522c2c[_0x1aaf('0x5b')][_0x1aaf('0x6e')],_['omit'](_0x522c2c[_0x1aaf('0x5b')],[_0x1aaf('0x6e'),'id'])||{})['spread'](function(_0x5522a9){for(var _0x56ede1=0x0;_0x56ede1<_0x522c2c['body']['ids'][_0x1aaf('0x49')];_0x56ede1+=0x1){socket[_0x1aaf('0xad')](_0x1aaf('0xae'),{'UserId':Number(_0x522c2c['body'][_0x1aaf('0x6e')][_0x56ede1]),'OpenchannelAccountId':Number(_0x522c2c[_0x1aaf('0x61')]['id'])});}return _0x5522a9;});}})['then'](respondWithResult(_0x5900f1,null))[_0x1aaf('0x2b')](handleError(_0x5900f1,null));};exports[_0x1aaf('0xaf')]=function(_0x255418,_0x4b4b83,_0xa65e90){return db['OpenchannelAccount'][_0x1aaf('0x59')]({'where':{'id':_0x255418[_0x1aaf('0x61')]['id']}})[_0x1aaf('0x20')](handleEntityNotFound(_0x4b4b83,null))[_0x1aaf('0x20')](function(_0x357731){if(_0x357731){return _0x357731[_0x1aaf('0xaf')](_0x255418['query'][_0x1aaf('0x6e')])[_0x1aaf('0x20')](function(){if(_['isArray'](_0x255418[_0x1aaf('0x44')][_0x1aaf('0x6e')])){for(var _0x1d8bd8=0x0;_0x1d8bd8<_0x255418[_0x1aaf('0x44')][_0x1aaf('0x6e')][_0x1aaf('0x49')];_0x1d8bd8+=0x1){socket[_0x1aaf('0xad')](_0x1aaf('0xb0'),{'UserId':Number(_0x255418['query'][_0x1aaf('0x6e')][_0x1d8bd8]),'OpenchannelAccountId':Number(_0x255418['params']['id'])});}}else{socket[_0x1aaf('0xad')](_0x1aaf('0xb0'),{'UserId':Number(_0x255418[_0x1aaf('0x44')][_0x1aaf('0x6e')]),'OpenchannelAccountId':Number(_0x255418[_0x1aaf('0x61')]['id'])});}});}})[_0x1aaf('0x20')](respondWithStatusCode(_0x4b4b83,null))['catch'](handleError(_0x4b4b83,null));};exports[_0x1aaf('0xb1')]=function(_0x3b1b96,_0x52efb8,_0x48ae21){var _0x3b0515={};var _0x5c80ed={};var _0x44ad12;var _0x5e109a;return db[_0x1aaf('0x40')][_0x1aaf('0x6b')]({'where':{'id':_0x3b1b96['params']['id']}})[_0x1aaf('0x20')](handleEntityNotFound(_0x52efb8,null))[_0x1aaf('0x20')](function(_0x42401c){if(_0x42401c){_0x44ad12=_0x42401c;_0x5c80ed[_0x1aaf('0x42')]=_['keys'](db[_0x1aaf('0x99')][_0x1aaf('0x41')]);_0x5c80ed[_0x1aaf('0x44')]=_['keys'](_0x3b1b96[_0x1aaf('0x44')]);_0x5c80ed[_0x1aaf('0x46')]=_[_0x1aaf('0x47')](_0x5c80ed[_0x1aaf('0x42')],_0x5c80ed[_0x1aaf('0x44')]);_0x3b0515[_0x1aaf('0x48')]=_[_0x1aaf('0x47')](_0x5c80ed[_0x1aaf('0x42')],qs[_0x1aaf('0x57')](_0x3b1b96[_0x1aaf('0x44')][_0x1aaf('0x57')]));_0x3b0515[_0x1aaf('0x48')]=_0x3b0515[_0x1aaf('0x48')][_0x1aaf('0x49')]?_0x3b0515[_0x1aaf('0x48')]:_0x5c80ed[_0x1aaf('0x42')];_0x3b0515[_0x1aaf('0x66')]=qs[_0x1aaf('0x4c')](_0x3b1b96[_0x1aaf('0x44')]['sort']);_0x3b0515[_0x1aaf('0x4e')]=qs[_0x1aaf('0x46')](_[_0x1aaf('0x67')](_0x3b1b96[_0x1aaf('0x44')],_0x5c80ed[_0x1aaf('0x46')]));if(_0x3b1b96[_0x1aaf('0x44')][_0x1aaf('0x4d')]){_0x3b0515['where']=_[_0x1aaf('0x4f')](_0x3b0515[_0x1aaf('0x4e')],{'$or':_[_0x1aaf('0x43')](_0x3b0515[_0x1aaf('0x48')],function(_0x1633e2){var _0x2ca4b4={};_0x2ca4b4[_0x1633e2]={'$like':'%'+_0x3b1b96[_0x1aaf('0x44')]['filter']+'%'};return _0x2ca4b4;})});}_0x3b0515=_['merge']({},_0x3b0515,_0x3b1b96[_0x1aaf('0x58')]);return _0x44ad12['getAgents'](_0x3b0515);}})['then'](function(_0x35f1f5){if(_0x35f1f5){_0x5e109a=_0x35f1f5['length'];if(!_0x3b1b96[_0x1aaf('0x44')][_0x1aaf('0x4a')](_0x1aaf('0x4b'))){_0x3b0515[_0x1aaf('0x32')]=qs[_0x1aaf('0x32')](_0x3b1b96[_0x1aaf('0x44')]['limit']);_0x3b0515[_0x1aaf('0x2f')]=qs['offset'](_0x3b1b96['query'][_0x1aaf('0x2f')]);}return _0x44ad12[_0x1aaf('0xb1')](_0x3b0515);}})[_0x1aaf('0x20')](function(_0x3e866d){if(_0x3e866d){return _0x3e866d?{'count':_0x5e109a,'rows':_0x3e866d}:null;}})[_0x1aaf('0x20')](respondWithResult(_0x52efb8,null))[_0x1aaf('0x2b')](handleError(_0x52efb8,null));};exports[_0x1aaf('0x3d')]=function(_0x5d6880,_0x5b010c,_0x1f1f8a){var _0x2370cb,_0x101813,_0x321687;if(_['isNil'](_0x5d6880[_0x1aaf('0x5b')][_0x1aaf('0x5b')])||_0x5d6880[_0x1aaf('0x5b')]['body']===''){throw new db['Sequelize'][(_0x1aaf('0x72'))](_0x1aaf('0x7b'));}if(_[_0x1aaf('0x7a')](_0x5d6880[_0x1aaf('0x5b')]['to'])){}_0x2370cb=_0x5d6880['body']['to'];return db[_0x1aaf('0x40')][_0x1aaf('0x6b')]({'where':{'id':_0x5d6880['params']['id']}})[_0x1aaf('0x20')](handleEntityNotFound(_0x5b010c,null))['then'](function(_0x534a9e){if(_0x534a9e){return db[_0x1aaf('0x40')][_0x1aaf('0x59')]({'where':{'id':_0x534a9e['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x1aaf('0xb2')],'as':'Contacts','where':{[_0x534a9e[_0x1aaf('0x7c')]]:_0x2370cb},'limit':0x1,'order':[['updatedAt',_0x1aaf('0x83')]]}]}]})['then'](handleEntityNotFound(_0x5b010c,null))[_0x1aaf('0x20')](function(_0x5f29e6){if(_0x5f29e6&&_0x5f29e6[_0x1aaf('0x81')]){_0x101813=_0x5f29e6['get']({'plain':!![]});if(_0x101813[_0x1aaf('0x81')]&&_0x101813[_0x1aaf('0x81')]['Contacts'][_0x1aaf('0x49')]){return _0x101813[_0x1aaf('0x81')][_0x1aaf('0x82')][0x0];}return db[_0x1aaf('0xb2')]['create'](_[_0x1aaf('0x18')](_0x5d6880['body'],{'firstName':_0x2370cb,[_0x5f29e6[_0x1aaf('0x7c')]]:_0x2370cb,'phone':_0x2370cb,'ListId':_0x101813['ListId']}));}})[_0x1aaf('0x20')](handleEntityNotFound(_0x5b010c,null))[_0x1aaf('0x20')](function(_0x5ba011){if(_0x5ba011){_0x321687=_0x5ba011;return db[_0x1aaf('0x8d')]['find']({'where':{'ContactId':_0x321687['id'],'closed':![],'OpenchannelAccountId':_0x101813['id']}})[_0x1aaf('0x20')](function(_0x363954){if(_0x363954){return[_0x363954,![]];}return db[_0x1aaf('0x8d')][_0x1aaf('0x5a')]({'UserId':_0x5d6880[_0x1aaf('0xb3')]['id'],'ContactId':_0x321687['id'],'OpenchannelAccountId':_0x101813['id'],'lastMsgDirection':_0x1aaf('0xb4'),'Messages':[_[_0x1aaf('0x4f')](_0x5d6880[_0x1aaf('0x5b')],{'read':![],'body':_0x5d6880[_0x1aaf('0x5b')]['body'],'OpenchannelAccountId':_0x101813['id'],'UserId':_0x5d6880[_0x1aaf('0xb3')]['id'],'ContactId':_0x321687['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x1aaf('0xb5')}]})[_0x1aaf('0x20')](function(_0x54803b){return[_0x54803b,!![]];});});}})[_0x1aaf('0xb6')](function(_0x48a33e,_0x2f9c6e){if(_0x2f9c6e){return _0x48a33e;}return db[_0x1aaf('0x97')][_0x1aaf('0x5a')](_[_0x1aaf('0x4f')](_0x5d6880[_0x1aaf('0x5b')],{'read':![],'body':_0x5d6880[_0x1aaf('0x5b')][_0x1aaf('0x5b')],'OpenchannelAccountId':_0x101813['id'],'OpenchannelInteractionId':_0x48a33e['id'],'UserId':_0x5d6880[_0x1aaf('0xb3')]['id'],'ContactId':_0x321687['id']}))['then'](function(_0x1cf944){_0x48a33e[_0x1aaf('0xb7')][_0x1aaf('0xb5')]=[];_0x48a33e[_0x1aaf('0xb7')][_0x1aaf('0xb5')][_0x1aaf('0xb8')](_0x1cf944[_0x1aaf('0xb7')]);return _0x48a33e;});});}})[_0x1aaf('0x20')](respondWithResult(_0x5b010c,null))[_0x1aaf('0x2b')](handleError(_0x5b010c,null));}; \ No newline at end of file +var _0xbd49=['notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','messageId','interaction','created','autoclose','push','close','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','findAndCountAll','getApplications','nolimit','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','then','request\x20sent','debug','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','save','update','destroy','get','OpenchannelAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','keys','includeAll','findAll','removeDispositions','ids','CannedAnswer','removeAnswers'];(function(_0x122afc,_0x2b77e8){var _0x2041d0=function(_0x21563c){while(--_0x21563c){_0x122afc['push'](_0x122afc['shift']());}};_0x2041d0(++_0x2b77e8);}(_0xbd49,0x1c5));var _0x9bd4=function(_0xd07c86,_0x28978b){_0xd07c86=_0xd07c86-0x0;var _0x401e06=_0xbd49[_0xd07c86];return _0x401e06;};'use strict';var emlformat=require(_0x9bd4('0x0'));var rimraf=require(_0x9bd4('0x1'));var zipdir=require(_0x9bd4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9bd4('0x3'));var moment=require('moment');var BPromise=require(_0x9bd4('0x4'));var Mustache=require(_0x9bd4('0x5'));var util=require(_0x9bd4('0x6'));var path=require(_0x9bd4('0x7'));var sox=require(_0x9bd4('0x8'));var csv=require(_0x9bd4('0x9'));var ejs=require(_0x9bd4('0xa'));var fs=require('fs');var fs_extra=require(_0x9bd4('0xb'));var _=require(_0x9bd4('0xc'));var squel=require('squel');var crypto=require(_0x9bd4('0xd'));var jsforce=require(_0x9bd4('0xe'));var deskjs=require(_0x9bd4('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9bd4('0x10'));var Papa=require(_0x9bd4('0x11'));var Redis=require(_0x9bd4('0x12'));var authService=require(_0x9bd4('0x13'));var qs=require(_0x9bd4('0x14'));var as=require(_0x9bd4('0x15'));var hardwareService=require(_0x9bd4('0x16'));var logger=require('../../config/logger')(_0x9bd4('0x17'));var utils=require(_0x9bd4('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9bd4('0x19'));var db=require('../../mysqldb')['db'];config[_0x9bd4('0x1a')]=_[_0x9bd4('0x1b')](config[_0x9bd4('0x1a')],{'host':_0x9bd4('0x1c'),'port':0x18eb});var socket=require(_0x9bd4('0x1d'))(new Redis(config[_0x9bd4('0x1a')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0x9bd4('0x1e'));var client=jayson[_0x9bd4('0x1f')][_0x9bd4('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x9bd4('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x45d361,_0x5d6403,_0x32bdf6,_0x1d59d6){return new BPromise(function(_0x22303d,_0x1f35ea){var _0x25697a=_0x1d59d6||client;return _0x25697a['request'](_0x45d361,_0x32bdf6)[_0x9bd4('0x21')](function(_0x11f01a){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x5d6403,_0x9bd4('0x22'));logger[_0x9bd4('0x23')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5d6403,_0x9bd4('0x22'),JSON[_0x9bd4('0x24')](_0x11f01a));if(_0x11f01a[_0x9bd4('0x25')]){if(_0x11f01a['error'][_0x9bd4('0x26')]===0x1f4){logger[_0x9bd4('0x25')](_0x9bd4('0x27'),_0x5d6403,_0x11f01a[_0x9bd4('0x25')][_0x9bd4('0x28')]);return _0x1f35ea(_0x11f01a['error']['message']);}logger[_0x9bd4('0x25')](_0x9bd4('0x27'),_0x5d6403,_0x11f01a[_0x9bd4('0x25')][_0x9bd4('0x28')]);return _0x22303d(_0x11f01a['error'][_0x9bd4('0x28')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x5d6403,_0x9bd4('0x22'));_0x22303d(_0x11f01a[_0x9bd4('0x29')][_0x9bd4('0x28')]);}})[_0x9bd4('0x2a')](function(_0x593de8){logger[_0x9bd4('0x25')](_0x9bd4('0x27'),_0x5d6403,_0x593de8);_0x1f35ea(_0x593de8);});});}function respondWithStatusCode(_0x19ba9e,_0x399d64){_0x399d64=_0x399d64||0xcc;return function(_0x5dd39c){if(_0x5dd39c){return _0x19ba9e[_0x9bd4('0x2b')](_0x399d64);}return _0x19ba9e[_0x9bd4('0x2c')](_0x399d64)[_0x9bd4('0x2d')]();};}function respondWithResult(_0x1b914b,_0x1d8522){_0x1d8522=_0x1d8522||0xc8;return function(_0x4e248e){if(_0x4e248e){return _0x1b914b[_0x9bd4('0x2c')](_0x1d8522)[_0x9bd4('0x2e')](_0x4e248e);}};}function respondWithFilteredResult(_0x1f2ba7,_0x454680){return function(_0x424d8d){if(_0x424d8d){var _0x2aa73c=typeof _0x454680['offset']===_0x9bd4('0x2f')&&typeof _0x454680['limit']===_0x9bd4('0x2f');var _0x2482cc=_0x424d8d[_0x9bd4('0x30')];var _0x7845db=_0x2aa73c?0x0:_0x454680[_0x9bd4('0x31')];var _0x46dceb=_0x2aa73c?_0x424d8d['count']:_0x454680['offset']+_0x454680['limit'];var _0x5db661;if(_0x46dceb>=_0x2482cc){_0x46dceb=_0x2482cc;_0x5db661=0xc8;}else{_0x5db661=0xce;}_0x1f2ba7['status'](_0x5db661);return _0x1f2ba7[_0x9bd4('0x32')](_0x9bd4('0x33'),_0x7845db+'-'+_0x46dceb+'/'+_0x2482cc)[_0x9bd4('0x2e')](_0x424d8d);}return null;};}function patchUpdates(_0x490eee){return function(_0x4d944c){try{jsonpatch['apply'](_0x4d944c,_0x490eee,!![]);}catch(_0x46e785){return BPromise['reject'](_0x46e785);}return _0x4d944c[_0x9bd4('0x34')]();};}function saveUpdates(_0x1c1d24,_0x388ed7){return function(_0x288b90){if(_0x288b90){return _0x288b90[_0x9bd4('0x35')](_0x1c1d24)[_0x9bd4('0x21')](function(_0x37e685){return _0x37e685;});}return null;};}function removeEntity(_0x53b4f0,_0x42436e){return function(_0x5f12a1){if(_0x5f12a1){return _0x5f12a1[_0x9bd4('0x36')]()[_0x9bd4('0x21')](function(){var _0x22ab9e=_0x5f12a1[_0x9bd4('0x37')]({'plain':!![]});var _0x20c344=_0x9bd4('0x38');return db['UserProfileResource'][_0x9bd4('0x36')]({'where':{'type':_0x20c344,'resourceId':_0x22ab9e['id']}})[_0x9bd4('0x21')](function(){return _0x5f12a1;});})[_0x9bd4('0x21')](function(){_0x53b4f0[_0x9bd4('0x2c')](0xcc)[_0x9bd4('0x2d')]();});}};}function handleEntityNotFound(_0x2bdb1e,_0x4bed04){return function(_0x3744bf){if(!_0x3744bf){_0x2bdb1e['sendStatus'](0x194);}return _0x3744bf;};}function handleError(_0x3de477,_0x42b100){_0x42b100=_0x42b100||0x1f4;return function(_0x1728f6){logger[_0x9bd4('0x25')](_0x1728f6[_0x9bd4('0x39')]);if(_0x1728f6[_0x9bd4('0x3a')]){delete _0x1728f6['name'];}_0x3de477[_0x9bd4('0x2c')](_0x42b100)[_0x9bd4('0x3b')](_0x1728f6);};}exports[_0x9bd4('0x3c')]=function(_0x3610f0,_0x16f736){var _0x2214d5={'include':[{'model':db[_0x9bd4('0x3d')],'as':_0x9bd4('0x3e')}]},_0x19ec02={},_0x312720={'count':0x0,'rows':[]};var _0x39e22c=_[_0x9bd4('0x3f')](db[_0x9bd4('0x40')][_0x9bd4('0x41')],function(_0x46c6c9){return{'name':_0x46c6c9[_0x9bd4('0x42')],'type':_0x46c6c9['type'][_0x9bd4('0x43')]};});_0x19ec02[_0x9bd4('0x44')]=_[_0x9bd4('0x3f')](_0x39e22c,'name');_0x19ec02[_0x9bd4('0x45')]=_['keys'](_0x3610f0[_0x9bd4('0x45')]);_0x19ec02[_0x9bd4('0x46')]=_[_0x9bd4('0x47')](_0x19ec02[_0x9bd4('0x44')],_0x19ec02[_0x9bd4('0x45')]);_0x2214d5[_0x9bd4('0x48')]=_[_0x9bd4('0x47')](_0x19ec02['model'],qs[_0x9bd4('0x49')](_0x3610f0['query']['fields']));_0x2214d5['attributes']=_0x2214d5[_0x9bd4('0x48')][_0x9bd4('0x4a')]?_0x2214d5['attributes']:_0x19ec02[_0x9bd4('0x44')];if(!_0x3610f0['query'][_0x9bd4('0x4b')]('nolimit')){_0x2214d5['limit']=qs[_0x9bd4('0x4c')](_0x3610f0['query'][_0x9bd4('0x4c')]);_0x2214d5[_0x9bd4('0x31')]=qs[_0x9bd4('0x31')](_0x3610f0[_0x9bd4('0x45')]['offset']);}_0x2214d5[_0x9bd4('0x4d')]=qs['sort'](_0x3610f0[_0x9bd4('0x45')][_0x9bd4('0x4e')]);_0x2214d5[_0x9bd4('0x4f')]=qs[_0x9bd4('0x46')](_[_0x9bd4('0x50')](_0x3610f0[_0x9bd4('0x45')],_0x19ec02[_0x9bd4('0x46')]),_0x39e22c);if(_0x3610f0[_0x9bd4('0x45')][_0x9bd4('0x51')]){_0x2214d5[_0x9bd4('0x4f')]=_['merge'](_0x2214d5[_0x9bd4('0x4f')],{'$or':_[_0x9bd4('0x3f')](_0x39e22c,function(_0xad7a0){if(_0xad7a0['type']!==_0x9bd4('0x52')){var _0x2dd431={};_0x2dd431[_0xad7a0['name']]={'$like':'%'+_0x3610f0[_0x9bd4('0x45')][_0x9bd4('0x51')]+'%'};return _0x2dd431;}})});}_0x2214d5=_[_0x9bd4('0x53')]({},_0x2214d5,_0x3610f0[_0x9bd4('0x54')]);var _0x7aca8d={'where':_0x2214d5[_0x9bd4('0x4f')]};return db[_0x9bd4('0x40')][_0x9bd4('0x30')](_0x7aca8d)[_0x9bd4('0x21')](function(_0xf36d7a){_0x312720[_0x9bd4('0x30')]=_0xf36d7a;if(_0x3610f0[_0x9bd4('0x45')]['includeAll']){_0x2214d5[_0x9bd4('0x55')]=[{'all':!![]}];}return db[_0x9bd4('0x40')]['findAll'](_0x2214d5);})['then'](function(_0x4a5e45){_0x312720[_0x9bd4('0x56')]=_0x4a5e45;return _0x312720;})[_0x9bd4('0x21')](respondWithFilteredResult(_0x16f736,_0x2214d5))[_0x9bd4('0x2a')](handleError(_0x16f736,null));};exports[_0x9bd4('0x57')]=function(_0x150ab1,_0x9861e3){var _0x2321b5={'raw':![],'where':{'id':_0x150ab1[_0x9bd4('0x58')]['id']},'include':[{'model':db[_0x9bd4('0x3d')],'as':_0x9bd4('0x3e')}]},_0x4f9afd={};_0x4f9afd[_0x9bd4('0x44')]=_['keys'](db[_0x9bd4('0x40')][_0x9bd4('0x41')]);_0x4f9afd[_0x9bd4('0x45')]=_['keys'](_0x150ab1[_0x9bd4('0x45')]);_0x4f9afd[_0x9bd4('0x46')]=_[_0x9bd4('0x47')](_0x4f9afd['model'],_0x4f9afd[_0x9bd4('0x45')]);_0x2321b5[_0x9bd4('0x48')]=_[_0x9bd4('0x47')](_0x4f9afd[_0x9bd4('0x44')],qs[_0x9bd4('0x49')](_0x150ab1[_0x9bd4('0x45')][_0x9bd4('0x49')]));_0x2321b5['attributes']=_0x2321b5['attributes']['length']?_0x2321b5['attributes']:_0x4f9afd[_0x9bd4('0x44')];if(_0x150ab1[_0x9bd4('0x45')]['includeAll']){_0x2321b5[_0x9bd4('0x55')]=[{'all':!![]}];}_0x2321b5=_[_0x9bd4('0x53')]({},_0x2321b5,_0x150ab1['options']);return db['OpenchannelAccount']['find'](_0x2321b5)[_0x9bd4('0x21')](handleEntityNotFound(_0x9861e3,null))[_0x9bd4('0x21')](respondWithResult(_0x9861e3,null))[_0x9bd4('0x2a')](handleError(_0x9861e3,null));};exports[_0x9bd4('0x59')]=function(_0x42e4ba,_0x1732b5){return db[_0x9bd4('0x40')][_0x9bd4('0x59')](_0x42e4ba[_0x9bd4('0x5a')],{})[_0x9bd4('0x21')](function(_0x1a7433){var _0x5675b1=_0x42e4ba['user']['get']({'plain':!![]});if(!_0x5675b1)throw new Error(_0x9bd4('0x5b'));if(_0x5675b1[_0x9bd4('0x5c')]===_0x9bd4('0x5d')){var _0x2f4092=_0x1a7433[_0x9bd4('0x37')]({'plain':!![]});var _0x558287=_0x9bd4('0x38');return db['UserProfileSection']['find']({'where':{'name':_0x558287,'userProfileId':_0x5675b1[_0x9bd4('0x5e')]},'raw':!![]})['then'](function(_0x194aac){if(_0x194aac&&_0x194aac['autoAssociation']===0x0){return db[_0x9bd4('0x5f')][_0x9bd4('0x59')]({'name':_0x2f4092[_0x9bd4('0x3a')],'resourceId':_0x2f4092['id'],'type':_0x194aac[_0x9bd4('0x3a')],'sectionId':_0x194aac['id']},{})[_0x9bd4('0x21')](function(){return _0x1a7433;});}else{return _0x1a7433;}})[_0x9bd4('0x2a')](function(_0x40a79f){logger[_0x9bd4('0x25')](_0x9bd4('0x60'),_0x40a79f);throw _0x40a79f;});}return _0x1a7433;})[_0x9bd4('0x21')](respondWithResult(_0x1732b5,0xc9))[_0x9bd4('0x2a')](handleError(_0x1732b5,null));};exports[_0x9bd4('0x35')]=function(_0x4f6132,_0x18e46b){if(_0x4f6132[_0x9bd4('0x5a')]['id']){delete _0x4f6132[_0x9bd4('0x5a')]['id'];}return db['OpenchannelAccount'][_0x9bd4('0x61')]({'where':{'id':_0x4f6132[_0x9bd4('0x58')]['id']},'include':[{'model':db[_0x9bd4('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x9bd4('0x21')](handleEntityNotFound(_0x18e46b,null))[_0x9bd4('0x21')](saveUpdates(_0x4f6132['body'],null))[_0x9bd4('0x21')](respondWithResult(_0x18e46b,null))['catch'](handleError(_0x18e46b,null));};exports['destroy']=function(_0x42245c,_0x54c32c){return db[_0x9bd4('0x40')][_0x9bd4('0x61')]({'where':{'id':_0x42245c[_0x9bd4('0x58')]['id']}})[_0x9bd4('0x21')](handleEntityNotFound(_0x54c32c,null))[_0x9bd4('0x21')](removeEntity(_0x54c32c,null))[_0x9bd4('0x2a')](handleError(_0x54c32c,null));};exports[_0x9bd4('0x62')]=function(_0x2421ff,_0x16e715){return db['OpenchannelAccount'][_0x9bd4('0x62')]()[_0x9bd4('0x21')](respondWithResult(_0x16e715,null))[_0x9bd4('0x2a')](handleError(_0x16e715,null));};exports[_0x9bd4('0x63')]=function(_0x272f0c,_0x598a1a,_0x580aed){if(_0x272f0c['body']['id']){delete _0x272f0c['body']['id'];}return db[_0x9bd4('0x40')][_0x9bd4('0x61')]({'where':{'id':_0x272f0c[_0x9bd4('0x58')]['id']}})[_0x9bd4('0x21')](handleEntityNotFound(_0x598a1a,null))['then'](function(_0x19df7e){if(_0x19df7e){_0x272f0c['body'][_0x9bd4('0x64')]=_0x19df7e['id'];return db[_0x9bd4('0x65')][_0x9bd4('0x59')](_0x272f0c['body']);}})[_0x9bd4('0x21')](respondWithResult(_0x598a1a,null))[_0x9bd4('0x2a')](handleError(_0x598a1a,null));};exports[_0x9bd4('0x66')]=function(_0x2e40b7,_0x63b9e3,_0x16a31b){var _0xffcacf={'raw':![],'where':{}};var _0x2bc317={};var _0x25684c={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9bd4('0x67')]({'where':{'id':_0x2e40b7[_0x9bd4('0x58')]['id']}})['then'](handleEntityNotFound(_0x63b9e3,null))[_0x9bd4('0x21')](function(_0x22eb21){if(_0x22eb21){_0x2bc317[_0x9bd4('0x44')]=_[_0x9bd4('0x68')](db[_0x9bd4('0x65')]['rawAttributes']);_0x2bc317['query']=_[_0x9bd4('0x68')](_0x2e40b7[_0x9bd4('0x45')]);_0x2bc317[_0x9bd4('0x46')]=_['intersection'](_0x2bc317['model'],_0x2bc317[_0x9bd4('0x45')]);_0xffcacf[_0x9bd4('0x48')]=_[_0x9bd4('0x47')](_0x2bc317['model'],qs[_0x9bd4('0x49')](_0x2e40b7[_0x9bd4('0x45')][_0x9bd4('0x49')]));_0xffcacf[_0x9bd4('0x48')]=_0xffcacf[_0x9bd4('0x48')][_0x9bd4('0x4a')]?_0xffcacf[_0x9bd4('0x48')]:_0x2bc317[_0x9bd4('0x44')];if(!_0x2e40b7['query'][_0x9bd4('0x4b')]('nolimit')){_0xffcacf[_0x9bd4('0x4c')]=qs[_0x9bd4('0x4c')](_0x2e40b7[_0x9bd4('0x45')][_0x9bd4('0x4c')]);_0xffcacf[_0x9bd4('0x31')]=qs[_0x9bd4('0x31')](_0x2e40b7[_0x9bd4('0x45')][_0x9bd4('0x31')]);}_0xffcacf['order']=qs[_0x9bd4('0x4e')](_0x2e40b7[_0x9bd4('0x45')][_0x9bd4('0x4e')]);_0xffcacf[_0x9bd4('0x4f')]=qs[_0x9bd4('0x46')](_['pick'](_0x2e40b7[_0x9bd4('0x45')],_0x2bc317[_0x9bd4('0x46')]));_0xffcacf['where'][_0x9bd4('0x64')]=_0x22eb21['id'];if(_0x2e40b7[_0x9bd4('0x45')][_0x9bd4('0x51')]){_0xffcacf[_0x9bd4('0x4f')]=_[_0x9bd4('0x53')](_0xffcacf[_0x9bd4('0x4f')],{'$or':_[_0x9bd4('0x3f')](_0xffcacf[_0x9bd4('0x48')],function(_0x27c212){var _0x47833e={};_0x47833e[_0x27c212]={'$like':'%'+_0x2e40b7[_0x9bd4('0x45')][_0x9bd4('0x51')]+'%'};return _0x47833e;})});}_0xffcacf=_[_0x9bd4('0x53')]({},_0xffcacf,_0x2e40b7[_0x9bd4('0x54')]);return db[_0x9bd4('0x65')]['count']({'where':_0xffcacf[_0x9bd4('0x4f')]})[_0x9bd4('0x21')](function(_0x24c113){_0x25684c[_0x9bd4('0x30')]=_0x24c113;if(_0x2e40b7[_0x9bd4('0x45')][_0x9bd4('0x69')]){_0xffcacf[_0x9bd4('0x55')]=[{'all':!![]}];}return db[_0x9bd4('0x65')][_0x9bd4('0x6a')](_0xffcacf);})[_0x9bd4('0x21')](function(_0x5e49db){_0x25684c[_0x9bd4('0x56')]=_0x5e49db;return _0x25684c;});}})[_0x9bd4('0x21')](respondWithFilteredResult(_0x63b9e3,_0xffcacf))[_0x9bd4('0x2a')](handleError(_0x63b9e3,null));};exports[_0x9bd4('0x6b')]=function(_0x3d237b,_0x537953,_0x4e4f99){return db[_0x9bd4('0x40')][_0x9bd4('0x61')]({'where':{'id':_0x3d237b['params']['id']}})[_0x9bd4('0x21')](handleEntityNotFound(_0x537953,null))[_0x9bd4('0x21')](function(_0x435ce4){if(_0x435ce4){return _0x435ce4['removeDispositions'](_0x3d237b['query'][_0x9bd4('0x6c')]);}})[_0x9bd4('0x21')](respondWithStatusCode(_0x537953,null))['catch'](handleError(_0x537953,null));};exports['addAnswer']=function(_0xbf44fa,_0x3eefd7,_0x3aac22){if(_0xbf44fa[_0x9bd4('0x5a')]['id']){delete _0xbf44fa[_0x9bd4('0x5a')]['id'];}return db[_0x9bd4('0x40')][_0x9bd4('0x61')]({'where':{'id':_0xbf44fa[_0x9bd4('0x58')]['id']}})[_0x9bd4('0x21')](handleEntityNotFound(_0x3eefd7,null))[_0x9bd4('0x21')](function(_0x22efd8){if(_0x22efd8){_0xbf44fa[_0x9bd4('0x5a')]['OpenchannelAccountId']=_0x22efd8['id'];return db[_0x9bd4('0x6d')]['create'](_0xbf44fa[_0x9bd4('0x5a')]);}})['then'](respondWithResult(_0x3eefd7,null))[_0x9bd4('0x2a')](handleError(_0x3eefd7,null));};exports['getAnswers']=function(_0xa75bf3,_0x3e501c,_0x282fe8){var _0x26cfc9={'raw':![],'where':{}};var _0x5b164b={};var _0x5230c7={'count':0x0,'rows':[]};return db[_0x9bd4('0x40')]['findOne']({'where':{'id':_0xa75bf3[_0x9bd4('0x58')]['id']}})[_0x9bd4('0x21')](handleEntityNotFound(_0x3e501c,null))['then'](function(_0x206f81){if(_0x206f81){_0x5b164b['model']=_[_0x9bd4('0x68')](db['CannedAnswer']['rawAttributes']);_0x5b164b['query']=_[_0x9bd4('0x68')](_0xa75bf3[_0x9bd4('0x45')]);_0x5b164b['filters']=_['intersection'](_0x5b164b['model'],_0x5b164b['query']);_0x26cfc9[_0x9bd4('0x48')]=_['intersection'](_0x5b164b['model'],qs['fields'](_0xa75bf3['query']['fields']));_0x26cfc9[_0x9bd4('0x48')]=_0x26cfc9[_0x9bd4('0x48')][_0x9bd4('0x4a')]?_0x26cfc9[_0x9bd4('0x48')]:_0x5b164b[_0x9bd4('0x44')];if(!_0xa75bf3[_0x9bd4('0x45')][_0x9bd4('0x4b')]('nolimit')){_0x26cfc9[_0x9bd4('0x4c')]=qs[_0x9bd4('0x4c')](_0xa75bf3[_0x9bd4('0x45')][_0x9bd4('0x4c')]);_0x26cfc9[_0x9bd4('0x31')]=qs[_0x9bd4('0x31')](_0xa75bf3[_0x9bd4('0x45')][_0x9bd4('0x31')]);}_0x26cfc9[_0x9bd4('0x4d')]=qs[_0x9bd4('0x4e')](_0xa75bf3[_0x9bd4('0x45')][_0x9bd4('0x4e')]);_0x26cfc9[_0x9bd4('0x4f')]=qs['filters'](_[_0x9bd4('0x50')](_0xa75bf3[_0x9bd4('0x45')],_0x5b164b[_0x9bd4('0x46')]));_0x26cfc9[_0x9bd4('0x4f')][_0x9bd4('0x64')]=_0x206f81['id'];if(_0xa75bf3[_0x9bd4('0x45')][_0x9bd4('0x51')]){_0x26cfc9[_0x9bd4('0x4f')]=_[_0x9bd4('0x53')](_0x26cfc9[_0x9bd4('0x4f')],{'$or':_['map'](_0x26cfc9['attributes'],function(_0x34e0e4){var _0x18f82c={};_0x18f82c[_0x34e0e4]={'$like':'%'+_0xa75bf3[_0x9bd4('0x45')][_0x9bd4('0x51')]+'%'};return _0x18f82c;})});}_0x26cfc9=_[_0x9bd4('0x53')]({},_0x26cfc9,_0xa75bf3[_0x9bd4('0x54')]);return db[_0x9bd4('0x6d')][_0x9bd4('0x30')]({'where':_0x26cfc9[_0x9bd4('0x4f')]})[_0x9bd4('0x21')](function(_0x4c74bb){_0x5230c7[_0x9bd4('0x30')]=_0x4c74bb;if(_0xa75bf3['query'][_0x9bd4('0x69')]){_0x26cfc9[_0x9bd4('0x55')]=[{'all':!![]}];}return db[_0x9bd4('0x6d')][_0x9bd4('0x6a')](_0x26cfc9);})[_0x9bd4('0x21')](function(_0x370a31){_0x5230c7['rows']=_0x370a31;return _0x5230c7;});}})[_0x9bd4('0x21')](respondWithFilteredResult(_0x3e501c,_0x26cfc9))[_0x9bd4('0x2a')](handleError(_0x3e501c,null));};exports[_0x9bd4('0x6e')]=function(_0x3119c5,_0x3c5e30,_0x42cdb2){return db[_0x9bd4('0x40')][_0x9bd4('0x61')]({'where':{'id':_0x3119c5[_0x9bd4('0x58')]['id']}})[_0x9bd4('0x21')](handleEntityNotFound(_0x3c5e30,null))[_0x9bd4('0x21')](function(_0x2ee4d6){if(_0x2ee4d6){return _0x2ee4d6[_0x9bd4('0x6e')](_0x3119c5[_0x9bd4('0x45')][_0x9bd4('0x6c')]);}})[_0x9bd4('0x21')](respondWithStatusCode(_0x3c5e30,null))[_0x9bd4('0x2a')](handleError(_0x3c5e30,null));};exports[_0x9bd4('0x6f')]=function(_0x24fcab,_0x2f83c0,_0x57f01a){var _0x59cf13={'body':_0x24fcab[_0x9bd4('0x5a')],'channel':_0x9bd4('0x70')};var _0x522fd2=[];var _0x514d4e=[];var _0x3484f5={};var _0x6ac05f=![];return db[_0x9bd4('0x71')]['describe']()[_0x9bd4('0x21')](function(_0x27caa8){if(!_0x27caa8){throw new db[(_0x9bd4('0x72'))][(_0x9bd4('0x73'))](_0x9bd4('0x74'));}_0x522fd2=_[_0x9bd4('0x75')](_['keys'](_0x27caa8),[_0x9bd4('0x76'),'updatedAt']);_0x514d4e=_[_0x9bd4('0x75')](_[_0x9bd4('0x68')](_0x27caa8),[_0x9bd4('0x76'),_0x9bd4('0x77'),_0x9bd4('0x78'),_0x9bd4('0x79')]);if(_0x24fcab['body']['id']){delete _0x24fcab[_0x9bd4('0x5a')]['id'];}if(_[_0x9bd4('0x7a')](_0x24fcab['body'][_0x9bd4('0x7b')])){throw new db[(_0x9bd4('0x72'))][(_0x9bd4('0x73'))](_0x9bd4('0x7c'));}if(_[_0x9bd4('0x7a')](_0x24fcab[_0x9bd4('0x5a')]['body'])||_0x24fcab[_0x9bd4('0x5a')]['body']===''){throw new db[(_0x9bd4('0x72'))][(_0x9bd4('0x73'))](_0x9bd4('0x7d'));}if(_['isNil'](_0x24fcab['body'][_0x9bd4('0x7e')])){throw new db[(_0x9bd4('0x72'))][(_0x9bd4('0x73'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x514d4e);}if(!_[_0x9bd4('0x7f')](_0x514d4e,_0x24fcab[_0x9bd4('0x5a')][_0x9bd4('0x7e')])){throw new db[(_0x9bd4('0x72'))][(_0x9bd4('0x73'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x514d4e);}_0x3484f5[_0x24fcab[_0x9bd4('0x5a')][_0x9bd4('0x7e')]]=_0x24fcab[_0x9bd4('0x5a')]['from'];})[_0x9bd4('0x21')](function(){return db[_0x9bd4('0x40')][_0x9bd4('0x61')]({'where':{'id':_0x24fcab[_0x9bd4('0x58')]['id']},'include':[{'model':db[_0x9bd4('0x80')],'as':_0x9bd4('0x81'),'include':[{'model':db[_0x9bd4('0x71')],'as':_0x9bd4('0x82'),'where':_0x3484f5,'limit':0x1,'order':[[_0x9bd4('0x77'),_0x9bd4('0x83')]]}]},{'model':db[_0x9bd4('0x84')],'as':_0x9bd4('0x85')}]});})[_0x9bd4('0x21')](handleEntityNotFound(_0x2f83c0,null))[_0x9bd4('0x21')](function(_0x2c6a18){if(_0x2c6a18&&_0x2c6a18[_0x9bd4('0x81')]){_0x59cf13[_0x9bd4('0x86')]=_0x2c6a18;_0x59cf13[_0x9bd4('0x87')]=_0x2c6a18[_0x9bd4('0x85')];_0x59cf13[_0x9bd4('0x88')]=_0x2c6a18[_0x9bd4('0x81')];_0x59cf13[_0x9bd4('0x87')]=_[_0x9bd4('0x89')](_0x59cf13['applications'],[_0x9bd4('0x8a')],[_0x9bd4('0x8b')]);if(_0x59cf13[_0x9bd4('0x86')]['Applications']){delete _0x59cf13[_0x9bd4('0x86')][_0x9bd4('0x85')];}if(_0x59cf13[_0x9bd4('0x86')][_0x9bd4('0x81')]&&_0x59cf13[_0x9bd4('0x86')][_0x9bd4('0x81')][_0x9bd4('0x82')][_0x9bd4('0x4a')]){return _0x59cf13[_0x9bd4('0x86')][_0x9bd4('0x81')]['Contacts'][0x0];}var _0x369dda=_[_0x9bd4('0x1b')](_0x24fcab['body'],{'firstName':_0x24fcab[_0x9bd4('0x5a')][_0x9bd4('0x7b')],'ListId':_0x2c6a18[_0x9bd4('0x79')]});_0x369dda[_0x24fcab['body'][_0x9bd4('0x7e')]]=_0x24fcab['body'][_0x9bd4('0x7b')];return db[_0x9bd4('0x71')][_0x9bd4('0x59')](_0x369dda,{'fields':_0x522fd2,'raw':!![]});}})[_0x9bd4('0x21')](handleEntityNotFound(_0x2f83c0,null))[_0x9bd4('0x21')](function(_0x5a6265){_0x59cf13[_0x9bd4('0x8c')]=_0x5a6265;if(_0x5a6265){var _0x3255f8={'ContactId':_0x5a6265['id'],'OpenchannelAccountId':_0x24fcab[_0x9bd4('0x58')]['id'],'from':(_0x5a6265[_0x9bd4('0x8d')]||'')+'\x20'+(_0x5a6265[_0x9bd4('0x8e')]||'')};var _0x37982c={'OpenchannelAccountId':_0x24fcab[_0x9bd4('0x58')]['id'],'closed':![]};if(_0x24fcab[_0x9bd4('0x5a')][_0x9bd4('0x8f')]){_0x37982c[_0x9bd4('0x8f')]=_0x24fcab[_0x9bd4('0x5a')][_0x9bd4('0x8f')];return db['OpenchannelInteraction'][_0x9bd4('0x61')]({'where':_0x37982c})[_0x9bd4('0x21')](function(_0x24d615){if(_0x24d615){return[_0x24d615,![]];}_0x3255f8[_0x9bd4('0x8f')]=_0x24fcab[_0x9bd4('0x5a')]['threadId'];_0x3255f8[_0x9bd4('0x90')]=_0x24fcab[_0x9bd4('0x5a')][_0x9bd4('0x90')];return db[_0x9bd4('0x91')][_0x9bd4('0x59')](_0x3255f8)[_0x9bd4('0x21')](function(_0x143901){return[_0x143901,!![]];});});}else{_0x37982c[_0x9bd4('0x8f')]=null;}_0x37982c[_0x9bd4('0x92')]=_0x5a6265['id'];return db['OpenchannelInteraction']['find']({'where':_0x37982c})[_0x9bd4('0x21')](function(_0x3721de){if(_0x3721de){return[_0x3721de,![]];}return db['OpenchannelInteraction'][_0x9bd4('0x59')](_0x3255f8)[_0x9bd4('0x21')](function(_0xe394bd){return[_0xe394bd,!![]];});});}})['spread'](function(_0xb88b3f,_0x1a0493){if(_0xb88b3f){_0x6ac05f=_0x1a0493;if(!_0x1a0493){var _0x8d668e={'from':(_0x59cf13['contact'][_0x9bd4('0x8d')]||'')+'\x20'+(_0x59cf13['contact'][_0x9bd4('0x8e')]||'')};if(_0x24fcab[_0x9bd4('0x5a')][_0x9bd4('0x8f')]&&_0x24fcab[_0x9bd4('0x5a')]['messageId']&&_0x24fcab[_0x9bd4('0x5a')]['threadId']!=_0x24fcab[_0x9bd4('0x5a')]['messageId']){_0x8d668e[_0x9bd4('0x8f')]=_0x24fcab[_0x9bd4('0x5a')][_0x9bd4('0x93')];}return _0xb88b3f[_0x9bd4('0x35')](_0x8d668e);}else{return _0xb88b3f;}}})[_0x9bd4('0x21')](function(_0x33a785){_0x59cf13[_0x9bd4('0x94')]=_0x33a785[_0x9bd4('0x37')]({'plain':!![]});_0x59cf13[_0x9bd4('0x94')][_0x9bd4('0x95')]=_0x6ac05f;if(_0x59cf13[_0x9bd4('0x94')][_0x9bd4('0x95')]){if(_0x59cf13[_0x9bd4('0x86')][_0x9bd4('0x96')]){_0x59cf13[_0x9bd4('0x87')][_0x9bd4('0x97')]({'id':0x0,'priority':_0x59cf13['applications']['length']+0x1,'app':_0x9bd4('0x98'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x9bd4('0x99')][_0x9bd4('0x59')]({'body':_0x24fcab['body'][_0x9bd4('0x5a')],'OpenchannelAccountId':_0x24fcab[_0x9bd4('0x58')]['id'],'OpenchannelInteractionId':_0x33a785['id'],'direction':'in','ContactId':_0x59cf13[_0x9bd4('0x8c')]['id'],'AttachmentId':_0x24fcab['body'][_0x9bd4('0x9a')]});})[_0x9bd4('0x21')](function(_0x4c0795){_0x59cf13['message']=_0x4c0795;if(_0x59cf13[_0x9bd4('0x94')][_0x9bd4('0x9b')]){return db[_0x9bd4('0x9c')][_0x9bd4('0x61')]({'attributes':['id',_0x9bd4('0x3a')],'where':{'id':_0x59cf13[_0x9bd4('0x94')][_0x9bd4('0x9b')]}})['then'](function(_0x171861){if(_0x171861){_0x59cf13['applications'][_0x9bd4('0x9d')]({'id':0x0,'priority':0x0,'app':_0x9bd4('0x9e'),'appdata':_0x171861['name']+','+(_0x59cf13['account'][_0x9bd4('0x9f')]||0xa),'interval':_0x9bd4('0xa0')});_0x59cf13[_0x9bd4('0xa1')]=![];}return respondWithRpcPromise(_0x9bd4('0xa2'),'startRouting',_0x59cf13);});}return respondWithRpcPromise(_0x9bd4('0xa2'),_0x9bd4('0xa3'),_0x59cf13);})[_0x9bd4('0x21')](function(_0x373825){respondWithRpcPromise('EventManager',_0x9bd4('0xa4'),{'event':_0x9bd4('0x6f'),'message':_0x373825},client9002);return _0x373825;})[_0x9bd4('0x21')](respondWithResult(_0x2f83c0,null))[_0x9bd4('0x2a')](handleError(_0x2f83c0,null));};exports[_0x9bd4('0xa5')]=function(_0x87779c,_0x6230ae,_0x3cd4d4){return db[_0x9bd4('0x40')][_0x9bd4('0x67')]({'where':{'id':_0x87779c[_0x9bd4('0x58')]['id']}})[_0x9bd4('0x21')](handleEntityNotFound(_0x6230ae,null))[_0x9bd4('0x21')](function(_0x20da7e){if(_0x20da7e){return db['sequelize']['transaction'](function(_0x13b93d){return db[_0x9bd4('0x84')][_0x9bd4('0x36')]({'where':{'OpenchannelAccountId':_0x87779c[_0x9bd4('0x58')]['id']},'transaction':_0x13b93d})['then'](function(_0x1489bc){var _0x5e1999=_[_0x9bd4('0x3f')](_0x87779c[_0x9bd4('0x5a')],function(_0x2ba17c){_0x2ba17c['OpenchannelAccountId']=_0x87779c[_0x9bd4('0x58')]['id'];return _0x2ba17c;});return db['OpenchannelApplication']['bulkCreate'](_0x5e1999,{'transaction':_0x13b93d});});})['then'](function(){return db[_0x9bd4('0x84')][_0x9bd4('0xa6')]({'where':{'OpenchannelAccountId':_0x87779c[_0x9bd4('0x58')]['id']},'order':_0x9bd4('0x8a')});});}})['then'](respondWithResult(_0x6230ae,null))[_0x9bd4('0x2a')](handleError(_0x6230ae,null));};exports[_0x9bd4('0xa7')]=function(_0xe0c18b,_0xf6a2f6,_0x4805a6){var _0x66c46d={};var _0x4d66c1={};var _0x2523e9;var _0x16e46f;return db[_0x9bd4('0x40')][_0x9bd4('0x67')]({'where':{'id':_0xe0c18b[_0x9bd4('0x58')]['id']}})[_0x9bd4('0x21')](handleEntityNotFound(_0xf6a2f6,null))[_0x9bd4('0x21')](function(_0x51b5ee){if(_0x51b5ee){_0x2523e9=_0x51b5ee;_0x4d66c1[_0x9bd4('0x44')]=_['keys'](db['OpenchannelApplication'][_0x9bd4('0x41')]);_0x4d66c1[_0x9bd4('0x45')]=_[_0x9bd4('0x68')](_0xe0c18b[_0x9bd4('0x45')]);_0x4d66c1[_0x9bd4('0x46')]=_[_0x9bd4('0x47')](_0x4d66c1['model'],_0x4d66c1['query']);_0x66c46d['attributes']=_['intersection'](_0x4d66c1[_0x9bd4('0x44')],qs[_0x9bd4('0x49')](_0xe0c18b[_0x9bd4('0x45')][_0x9bd4('0x49')]));_0x66c46d[_0x9bd4('0x48')]=_0x66c46d[_0x9bd4('0x48')][_0x9bd4('0x4a')]?_0x66c46d[_0x9bd4('0x48')]:_0x4d66c1[_0x9bd4('0x44')];_0x66c46d[_0x9bd4('0x4d')]=qs[_0x9bd4('0x4e')](_0xe0c18b[_0x9bd4('0x45')]['sort']);_0x66c46d['where']=qs[_0x9bd4('0x46')](_['pick'](_0xe0c18b[_0x9bd4('0x45')],_0x4d66c1['filters']));if(_0xe0c18b['query'][_0x9bd4('0x51')]){_0x66c46d[_0x9bd4('0x4f')]=_[_0x9bd4('0x53')](_0x66c46d['where'],{'$or':_[_0x9bd4('0x3f')](_0x66c46d[_0x9bd4('0x48')],function(_0xee416a){var _0x28f017={};_0x28f017[_0xee416a]={'$like':'%'+_0xe0c18b[_0x9bd4('0x45')][_0x9bd4('0x51')]+'%'};return _0x28f017;})});}_0x66c46d=_[_0x9bd4('0x53')]({},_0x66c46d,_0xe0c18b['options']);return _0x2523e9[_0x9bd4('0xa7')](_0x66c46d);}})[_0x9bd4('0x21')](function(_0x109fd6){if(_0x109fd6){_0x16e46f=_0x109fd6[_0x9bd4('0x4a')];if(!_0xe0c18b[_0x9bd4('0x45')]['hasOwnProperty'](_0x9bd4('0xa8'))){_0x66c46d[_0x9bd4('0x4c')]=qs[_0x9bd4('0x4c')](_0xe0c18b[_0x9bd4('0x45')][_0x9bd4('0x4c')]);_0x66c46d[_0x9bd4('0x31')]=qs[_0x9bd4('0x31')](_0xe0c18b[_0x9bd4('0x45')][_0x9bd4('0x31')]);}return _0x2523e9[_0x9bd4('0xa7')](_0x66c46d);}})['then'](function(_0x11f607){if(_0x11f607){return _0x11f607?{'count':_0x16e46f,'rows':_0x11f607}:null;}})[_0x9bd4('0x21')](respondWithResult(_0xf6a2f6,null))[_0x9bd4('0x2a')](handleError(_0xf6a2f6,null));};exports[_0x9bd4('0xa9')]=function(_0x162b3c,_0x4b29dd,_0x5e72c9){var _0x8094d2={'raw':![],'where':{}};var _0x43f2b8={};var _0x3371eb={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9bd4('0x67')]({'where':{'id':_0x162b3c[_0x9bd4('0x58')]['id']}})[_0x9bd4('0x21')](handleEntityNotFound(_0x4b29dd,null))['then'](function(_0x390dae){if(_0x390dae){_0x43f2b8['model']=_[_0x9bd4('0x68')](db[_0x9bd4('0x91')]['rawAttributes']);_0x43f2b8[_0x9bd4('0x45')]=_['keys'](_0x162b3c[_0x9bd4('0x45')]);_0x43f2b8['filters']=_[_0x9bd4('0x47')](_0x43f2b8[_0x9bd4('0x44')],_0x43f2b8[_0x9bd4('0x45')]);_0x8094d2[_0x9bd4('0x48')]=_[_0x9bd4('0x47')](_0x43f2b8['model'],qs[_0x9bd4('0x49')](_0x162b3c['query'][_0x9bd4('0x49')]));_0x8094d2[_0x9bd4('0x48')]=_0x8094d2[_0x9bd4('0x48')]['length']?_0x8094d2['attributes']:_0x43f2b8[_0x9bd4('0x44')];if(!_0x162b3c[_0x9bd4('0x45')][_0x9bd4('0x4b')](_0x9bd4('0xa8'))){_0x8094d2[_0x9bd4('0x4c')]=qs['limit'](_0x162b3c[_0x9bd4('0x45')]['limit']);_0x8094d2[_0x9bd4('0x31')]=qs[_0x9bd4('0x31')](_0x162b3c[_0x9bd4('0x45')][_0x9bd4('0x31')]);}_0x8094d2['order']=qs['sort'](_0x162b3c['query'][_0x9bd4('0x4e')]);_0x8094d2[_0x9bd4('0x4f')]=qs[_0x9bd4('0x46')](_['pick'](_0x162b3c[_0x9bd4('0x45')],_0x43f2b8[_0x9bd4('0x46')]));_0x8094d2['where'][_0x9bd4('0x64')]=_0x390dae['id'];if(_0x162b3c[_0x9bd4('0x45')][_0x9bd4('0x51')]){_0x8094d2[_0x9bd4('0x4f')]=_['merge'](_0x8094d2[_0x9bd4('0x4f')],{'$or':_['map'](_0x8094d2[_0x9bd4('0x48')],function(_0x6cd5b7){var _0x287e34={};_0x287e34[_0x6cd5b7]={'$like':'%'+_0x162b3c['query'][_0x9bd4('0x51')]+'%'};return _0x287e34;})});}_0x8094d2=_[_0x9bd4('0x53')]({},_0x8094d2,_0x162b3c[_0x9bd4('0x54')]);return db[_0x9bd4('0x91')][_0x9bd4('0x30')]({'where':_0x8094d2[_0x9bd4('0x4f')]})[_0x9bd4('0x21')](function(_0x23f3fe){_0x3371eb[_0x9bd4('0x30')]=_0x23f3fe;if(_0x162b3c['query'][_0x9bd4('0x69')]){_0x8094d2[_0x9bd4('0x55')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0x9bd4('0xaa'),'attributes':['name',_0x9bd4('0xab'),_0x9bd4('0xac')],'required':![]},{'model':db[_0x9bd4('0xad')],'as':_0x9bd4('0xae'),'attributes':['id','name',_0x9bd4('0xaf')],'where':_0x162b3c[_0x9bd4('0x45')][_0x9bd4('0xb0')]?{'id':_0x162b3c[_0x9bd4('0x45')][_0x9bd4('0xb0')]}:undefined,'required':_0x162b3c[_0x9bd4('0x45')]['tag']?!![]:![]}];}return db[_0x9bd4('0x91')][_0x9bd4('0x6a')](_0x8094d2);})['then'](function(_0x533634){_0x3371eb[_0x9bd4('0x56')]=_0x533634;return _0x3371eb;});}})[_0x9bd4('0x21')](respondWithFilteredResult(_0x4b29dd,_0x8094d2))[_0x9bd4('0x2a')](handleError(_0x4b29dd,null));};exports[_0x9bd4('0xb1')]=function(_0x16a048,_0x5a5b53,_0x512656){return db[_0x9bd4('0x40')][_0x9bd4('0x61')]({'where':{'id':_0x16a048['params']['id']}})['then'](handleEntityNotFound(_0x5a5b53,null))['then'](function(_0x2543e9){if(_0x2543e9){return _0x2543e9[_0x9bd4('0xb1')](_0x16a048[_0x9bd4('0x5a')][_0x9bd4('0x6c')],_[_0x9bd4('0xb2')](_0x16a048[_0x9bd4('0x5a')],[_0x9bd4('0x6c'),'id'])||{})[_0x9bd4('0xb3')](function(_0x298665){for(var _0x1d5f3a=0x0;_0x1d5f3a<_0x16a048[_0x9bd4('0x5a')][_0x9bd4('0x6c')][_0x9bd4('0x4a')];_0x1d5f3a+=0x1){socket[_0x9bd4('0xb4')](_0x9bd4('0xb5'),{'UserId':Number(_0x16a048[_0x9bd4('0x5a')][_0x9bd4('0x6c')][_0x1d5f3a]),'OpenchannelAccountId':Number(_0x16a048[_0x9bd4('0x58')]['id'])});}return _0x298665;});}})['then'](respondWithResult(_0x5a5b53,null))[_0x9bd4('0x2a')](handleError(_0x5a5b53,null));};exports[_0x9bd4('0xb6')]=function(_0x2afade,_0x56c3ac,_0x15aea6){return db[_0x9bd4('0x40')][_0x9bd4('0x61')]({'where':{'id':_0x2afade[_0x9bd4('0x58')]['id']}})['then'](handleEntityNotFound(_0x56c3ac,null))[_0x9bd4('0x21')](function(_0x320032){if(_0x320032){return _0x320032[_0x9bd4('0xb6')](_0x2afade[_0x9bd4('0x45')][_0x9bd4('0x6c')])[_0x9bd4('0x21')](function(){if(_[_0x9bd4('0xb7')](_0x2afade[_0x9bd4('0x45')][_0x9bd4('0x6c')])){for(var _0x5cbe80=0x0;_0x5cbe80<_0x2afade['query'][_0x9bd4('0x6c')][_0x9bd4('0x4a')];_0x5cbe80+=0x1){socket[_0x9bd4('0xb4')](_0x9bd4('0xb8'),{'UserId':Number(_0x2afade[_0x9bd4('0x45')][_0x9bd4('0x6c')][_0x5cbe80]),'OpenchannelAccountId':Number(_0x2afade['params']['id'])});}}else{socket[_0x9bd4('0xb4')](_0x9bd4('0xb8'),{'UserId':Number(_0x2afade[_0x9bd4('0x45')][_0x9bd4('0x6c')]),'OpenchannelAccountId':Number(_0x2afade['params']['id'])});}});}})['then'](respondWithStatusCode(_0x56c3ac,null))[_0x9bd4('0x2a')](handleError(_0x56c3ac,null));};exports[_0x9bd4('0xb9')]=function(_0x2e1868,_0x4e3c56,_0x44c046){var _0x225c38={};var _0x40cfed={};var _0x2cf8b6;var _0x5306b4;return db[_0x9bd4('0x40')][_0x9bd4('0x67')]({'where':{'id':_0x2e1868[_0x9bd4('0x58')]['id']}})[_0x9bd4('0x21')](handleEntityNotFound(_0x4e3c56,null))['then'](function(_0x2a8a7b){if(_0x2a8a7b){_0x2cf8b6=_0x2a8a7b;_0x40cfed[_0x9bd4('0x44')]=_['keys'](db[_0x9bd4('0x9c')][_0x9bd4('0x41')]);_0x40cfed[_0x9bd4('0x45')]=_[_0x9bd4('0x68')](_0x2e1868[_0x9bd4('0x45')]);_0x40cfed['filters']=_[_0x9bd4('0x47')](_0x40cfed[_0x9bd4('0x44')],_0x40cfed[_0x9bd4('0x45')]);_0x225c38['attributes']=_['intersection'](_0x40cfed[_0x9bd4('0x44')],qs['fields'](_0x2e1868[_0x9bd4('0x45')]['fields']));_0x225c38[_0x9bd4('0x48')]=_0x225c38[_0x9bd4('0x48')][_0x9bd4('0x4a')]?_0x225c38[_0x9bd4('0x48')]:_0x40cfed[_0x9bd4('0x44')];_0x225c38[_0x9bd4('0x4d')]=qs[_0x9bd4('0x4e')](_0x2e1868[_0x9bd4('0x45')][_0x9bd4('0x4e')]);_0x225c38[_0x9bd4('0x4f')]=qs[_0x9bd4('0x46')](_[_0x9bd4('0x50')](_0x2e1868[_0x9bd4('0x45')],_0x40cfed['filters']));if(_0x2e1868[_0x9bd4('0x45')][_0x9bd4('0x51')]){_0x225c38[_0x9bd4('0x4f')]=_[_0x9bd4('0x53')](_0x225c38[_0x9bd4('0x4f')],{'$or':_[_0x9bd4('0x3f')](_0x225c38[_0x9bd4('0x48')],function(_0x2c8b3b){var _0x6c75b4={};_0x6c75b4[_0x2c8b3b]={'$like':'%'+_0x2e1868['query'][_0x9bd4('0x51')]+'%'};return _0x6c75b4;})});}_0x225c38=_[_0x9bd4('0x53')]({},_0x225c38,_0x2e1868[_0x9bd4('0x54')]);return _0x2cf8b6[_0x9bd4('0xb9')](_0x225c38);}})[_0x9bd4('0x21')](function(_0x592550){if(_0x592550){_0x5306b4=_0x592550[_0x9bd4('0x4a')];if(!_0x2e1868[_0x9bd4('0x45')][_0x9bd4('0x4b')](_0x9bd4('0xa8'))){_0x225c38['limit']=qs[_0x9bd4('0x4c')](_0x2e1868[_0x9bd4('0x45')][_0x9bd4('0x4c')]);_0x225c38['offset']=qs[_0x9bd4('0x31')](_0x2e1868[_0x9bd4('0x45')][_0x9bd4('0x31')]);}return _0x2cf8b6[_0x9bd4('0xb9')](_0x225c38);}})[_0x9bd4('0x21')](function(_0x198d0b){if(_0x198d0b){return _0x198d0b?{'count':_0x5306b4,'rows':_0x198d0b}:null;}})[_0x9bd4('0x21')](respondWithResult(_0x4e3c56,null))[_0x9bd4('0x2a')](handleError(_0x4e3c56,null));};exports[_0x9bd4('0x3b')]=function(_0x463e84,_0x13de54,_0x1a5512){var _0x1dff6c,_0x1ef7e8,_0x5bf788;if(_[_0x9bd4('0x7a')](_0x463e84[_0x9bd4('0x5a')][_0x9bd4('0x5a')])||_0x463e84[_0x9bd4('0x5a')][_0x9bd4('0x5a')]===''){throw new db[(_0x9bd4('0x72'))][(_0x9bd4('0x73'))](_0x9bd4('0x7d'));}if(_[_0x9bd4('0x7a')](_0x463e84[_0x9bd4('0x5a')]['to'])){}_0x1dff6c=_0x463e84[_0x9bd4('0x5a')]['to'];return db[_0x9bd4('0x40')][_0x9bd4('0x67')]({'where':{'id':_0x463e84[_0x9bd4('0x58')]['id']}})[_0x9bd4('0x21')](handleEntityNotFound(_0x13de54,null))[_0x9bd4('0x21')](function(_0x5a685d){if(_0x5a685d){return db[_0x9bd4('0x40')][_0x9bd4('0x61')]({'where':{'id':_0x5a685d['id']},'include':[{'model':db['CmList'],'as':_0x9bd4('0x81'),'include':[{'model':db[_0x9bd4('0x71')],'as':_0x9bd4('0x82'),'where':{[_0x5a685d[_0x9bd4('0x7e')]]:_0x1dff6c},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x9bd4('0x21')](handleEntityNotFound(_0x13de54,null))[_0x9bd4('0x21')](function(_0x4893a5){if(_0x4893a5&&_0x4893a5[_0x9bd4('0x81')]){_0x1ef7e8=_0x4893a5[_0x9bd4('0x37')]({'plain':!![]});if(_0x1ef7e8['List']&&_0x1ef7e8[_0x9bd4('0x81')][_0x9bd4('0x82')][_0x9bd4('0x4a')]){return _0x1ef7e8[_0x9bd4('0x81')][_0x9bd4('0x82')][0x0];}return db[_0x9bd4('0x71')][_0x9bd4('0x59')](_[_0x9bd4('0x1b')](_0x463e84['body'],{'firstName':_0x1dff6c,[_0x4893a5['mapKey']]:_0x1dff6c,'phone':_0x1dff6c,'ListId':_0x1ef7e8['ListId']}));}})['then'](handleEntityNotFound(_0x13de54,null))[_0x9bd4('0x21')](function(_0xd0b9c7){if(_0xd0b9c7){_0x5bf788=_0xd0b9c7;return db[_0x9bd4('0x91')][_0x9bd4('0x61')]({'where':{'ContactId':_0x5bf788['id'],'closed':![],'OpenchannelAccountId':_0x1ef7e8['id']}})['then'](function(_0x43a98b){if(_0x43a98b){return[_0x43a98b,![]];}return db[_0x9bd4('0x91')][_0x9bd4('0x59')]({'UserId':_0x463e84[_0x9bd4('0x5d')]['id'],'ContactId':_0x5bf788['id'],'OpenchannelAccountId':_0x1ef7e8['id'],'lastMsgDirection':'out','Messages':[_['merge'](_0x463e84[_0x9bd4('0x5a')],{'read':![],'body':_0x463e84[_0x9bd4('0x5a')][_0x9bd4('0x5a')],'OpenchannelAccountId':_0x1ef7e8['id'],'UserId':_0x463e84[_0x9bd4('0x5d')]['id'],'ContactId':_0x5bf788['id']})]},{'include':[{'model':db[_0x9bd4('0x99')],'as':_0x9bd4('0xba')}]})[_0x9bd4('0x21')](function(_0x25c1cb){return[_0x25c1cb,!![]];});});}})[_0x9bd4('0xb3')](function(_0x135db9,_0x428156){if(_0x428156){return _0x135db9;}return db[_0x9bd4('0x99')]['create'](_[_0x9bd4('0x53')](_0x463e84['body'],{'read':![],'body':_0x463e84['body'][_0x9bd4('0x5a')],'OpenchannelAccountId':_0x1ef7e8['id'],'OpenchannelInteractionId':_0x135db9['id'],'UserId':_0x463e84['user']['id'],'ContactId':_0x5bf788['id']}))[_0x9bd4('0x21')](function(_0x1f32a3){_0x135db9['dataValues']['Messages']=[];_0x135db9[_0x9bd4('0xbb')][_0x9bd4('0xba')]['push'](_0x1f32a3['dataValues']);return _0x135db9;});});}})[_0x9bd4('0x21')](respondWithResult(_0x13de54,null))[_0x9bd4('0x2a')](handleError(_0x13de54,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index f7474f5..e978f0d 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 _0x91a7=['../../mysqldb','OpenchannelAccount','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x91a7,0xe7));var _0x791a=function(_0x5cd709,_0x16b513){_0x5cd709=_0x5cd709-0x0;var _0x11d933=_0x91a7[_0x5cd709];return _0x11d933;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x791a('0x0'))['db'][_0x791a('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x791a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x791a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2f6392){return function(_0x535640,_0x50ab29,_0x32fe2b){OpenchannelAccountEvents[_0x791a('0x4')](_0x2f6392+':'+_0x535640['id'],_0x535640);OpenchannelAccountEvents['emit'](_0x2f6392,_0x535640);_0x32fe2b(null);};}for(var e in events){if(events[_0x791a('0x5')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x791a('0x6')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x55e0=['remove','emit','hook','events','../../mysqldb','OpenchannelAccount','setMaxListeners'];(function(_0x19c0ea,_0x19f687){var _0x3db00e=function(_0x320ddb){while(--_0x320ddb){_0x19c0ea['push'](_0x19c0ea['shift']());}};_0x3db00e(++_0x19f687);}(_0x55e0,0xdc));var _0x055e=function(_0x5390b3,_0x207725){_0x5390b3=_0x5390b3-0x0;var _0x42d5be=_0x55e0[_0x5390b3];return _0x42d5be;};'use strict';var EventEmitter=require(_0x055e('0x0'));var OpenchannelAccount=require(_0x055e('0x1'))['db'][_0x055e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x055e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x055e('0x4')};function emitEvent(_0x2d9bd5){return function(_0x33cd7b,_0x2773e4,_0x157473){OpenchannelAccountEvents[_0x055e('0x5')](_0x2d9bd5+':'+_0x33cd7b['id'],_0x33cd7b);OpenchannelAccountEvents['emit'](_0x2d9bd5,_0x33cd7b);_0x157473(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x055e('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index a5cf86d..5b73488 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(_0x27466d,_0x5036b3){var _0x2dca9a=function(_0x5b8773){while(--_0x5b8773){_0x27466d['push'](_0x27466d['shift']());}};_0x2dca9a(++_0x5036b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x19464d,_0x3a3d0c){var _0x14614c=function(_0x3fdac6){while(--_0x3fdac6){_0x19464d['push'](_0x19464d['shift']());}};_0x14614c(++_0x3a3d0c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 2a9bf8b..666971f 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 _0x6ae2=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch'];(function(_0x4c30b9,_0x365a5d){var _0x54f7e1=function(_0x54bef7){while(--_0x54bef7){_0x4c30b9['push'](_0x4c30b9['shift']());}};_0x54f7e1(++_0x365a5d);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x4c10d6,_0x55f8a5){_0x4c10d6=_0x4c10d6-0x0;var _0x84f168=_0x6ae2[_0x4c10d6];return _0x84f168;};'use strict';var _=require(_0x26ae('0x0'));var util=require(_0x26ae('0x1'));var moment=require(_0x26ae('0x2'));var BPromise=require(_0x26ae('0x3'));var rs=require(_0x26ae('0x4'));var fs=require('fs');var Redis=require(_0x26ae('0x5'));var db=require(_0x26ae('0x6'))['db'];var utils=require(_0x26ae('0x7'));var logger=require(_0x26ae('0x8'))('rpc');var config=require(_0x26ae('0x9'));var jayson=require(_0x26ae('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x26ae('0xb')]=_[_0x26ae('0xc')](config[_0x26ae('0xb')],{'host':_0x26ae('0xd'),'port':0x18eb});var socket=require(_0x26ae('0xe'))(new Redis(config[_0x26ae('0xb')]));require(_0x26ae('0xf'))[_0x26ae('0x10')](socket);function respondWithRpcPromise(_0x3d165a,_0x18baac,_0x1f8dff){return new BPromise(function(_0x4061ad,_0x5b2c57){return client[_0x26ae('0x11')](_0x3d165a,_0x1f8dff)['then'](function(_0x3a3db9){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x18baac,_0x26ae('0x12'));logger[_0x26ae('0x13')](_0x26ae('0x14'),_0x18baac,_0x26ae('0x12'),JSON[_0x26ae('0x15')](_0x3a3db9));if(_0x3a3db9[_0x26ae('0x16')]){if(_0x3a3db9[_0x26ae('0x16')][_0x26ae('0x17')]===0x1f4){logger[_0x26ae('0x16')](_0x26ae('0x18'),_0x18baac,_0x3a3db9[_0x26ae('0x16')][_0x26ae('0x19')]);return _0x5b2c57(_0x3a3db9['error'][_0x26ae('0x19')]);}logger[_0x26ae('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x18baac,_0x3a3db9[_0x26ae('0x16')][_0x26ae('0x19')]);return _0x4061ad(_0x3a3db9[_0x26ae('0x16')][_0x26ae('0x19')]);}else{logger[_0x26ae('0x1a')](_0x26ae('0x18'),_0x18baac,_0x26ae('0x12'));_0x4061ad(_0x3a3db9[_0x26ae('0x1b')][_0x26ae('0x19')]);}})[_0x26ae('0x1c')](function(_0x1e5cf5){logger[_0x26ae('0x16')](_0x26ae('0x18'),_0x18baac,_0x1e5cf5);_0x5b2c57(_0x1e5cf5);});});} \ No newline at end of file +var _0x6582=['code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','./openchannelAccount.socket','register','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2a1814,_0x3531d6){var _0x36b7ba=function(_0xcbbbe9){while(--_0xcbbbe9){_0x2a1814['push'](_0x2a1814['shift']());}};_0x36b7ba(++_0x3531d6);}(_0x6582,0x108));var _0x2658=function(_0x3c0a36,_0x8e2f2b){_0x3c0a36=_0x3c0a36-0x0;var _0x5ac4cb=_0x6582[_0x3c0a36];return _0x5ac4cb;};'use strict';var _=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var moment=require(_0x2658('0x2'));var BPromise=require(_0x2658('0x3'));var rs=require(_0x2658('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2658('0x5'))['db'];var utils=require(_0x2658('0x6'));var logger=require(_0x2658('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2658('0x8')][_0x2658('0x9')]({'port':0x232a});config[_0x2658('0xa')]=_[_0x2658('0xb')](config[_0x2658('0xa')],{'host':_0x2658('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2658('0xa')]));require(_0x2658('0xd'))[_0x2658('0xe')](socket);function respondWithRpcPromise(_0x99b9db,_0x455ff9,_0x2b2561){return new BPromise(function(_0x3f22a5,_0x1aaaac){return client[_0x2658('0xf')](_0x99b9db,_0x2b2561)['then'](function(_0x20fe6d){logger['info'](_0x2658('0x10'),_0x455ff9,_0x2658('0x11'));logger[_0x2658('0x12')](_0x2658('0x13'),_0x455ff9,_0x2658('0x11'),JSON[_0x2658('0x14')](_0x20fe6d));if(_0x20fe6d[_0x2658('0x15')]){if(_0x20fe6d['error'][_0x2658('0x16')]===0x1f4){logger[_0x2658('0x15')](_0x2658('0x10'),_0x455ff9,_0x20fe6d[_0x2658('0x15')][_0x2658('0x17')]);return _0x1aaaac(_0x20fe6d['error'][_0x2658('0x17')]);}logger[_0x2658('0x15')](_0x2658('0x10'),_0x455ff9,_0x20fe6d['error'][_0x2658('0x17')]);return _0x3f22a5(_0x20fe6d[_0x2658('0x15')][_0x2658('0x17')]);}else{logger[_0x2658('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x455ff9,_0x2658('0x11'));_0x3f22a5(_0x20fe6d['result'][_0x2658('0x17')]);}})[_0x2658('0x19')](function(_0x307220){logger[_0x2658('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x455ff9,_0x307220);_0x1aaaac(_0x307220);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 2272c94..130b9d3 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 _0x593e=['emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x470b45,_0xa514dd){var _0xfb744d=function(_0x16b027){while(--_0x16b027){_0x470b45['push'](_0x470b45['shift']());}};_0xfb744d(++_0xa514dd);}(_0x593e,0xcb));var _0xe593=function(_0x598333,_0x1af9f7){_0x598333=_0x598333-0x0;var _0x59d520=_0x593e[_0x598333];return _0x59d520;};'use strict';var OpenchannelAccountEvents=require(_0xe593('0x0'));var events=[_0xe593('0x1'),_0xe593('0x2'),_0xe593('0x3')];function createListener(_0x43dabb,_0x184a6b){return function(_0x2c7c48){_0x184a6b[_0xe593('0x4')](_0x43dabb,_0x2c7c48);};}function removeListener(_0x550574,_0x8a87e8){return function(){OpenchannelAccountEvents[_0xe593('0x5')](_0x550574,_0x8a87e8);};}exports[_0xe593('0x6')]=function(_0x1e50d3){for(var _0x3b7082=0x0,_0x14cff3=events[_0xe593('0x7')];_0x3b7082<_0x14cff3;_0x3b7082++){var _0x307dad=events[_0x3b7082];var _0x169c08=createListener(_0xe593('0x8')+_0x307dad,_0x1e50d3);OpenchannelAccountEvents['on'](_0x307dad,_0x169c08);}}; \ No newline at end of file +var _0x8696=['openchannelAccount:','./openchannelAccount.events','save','update','emit','register','length'];(function(_0x2ffc5d,_0x564eba){var _0x57f0a=function(_0x44d8fb){while(--_0x44d8fb){_0x2ffc5d['push'](_0x2ffc5d['shift']());}};_0x57f0a(++_0x564eba);}(_0x8696,0x143));var _0x6869=function(_0xc1cd42,_0x59249a){_0xc1cd42=_0xc1cd42-0x0;var _0x56f172=_0x8696[_0xc1cd42];return _0x56f172;};'use strict';var OpenchannelAccountEvents=require(_0x6869('0x0'));var events=[_0x6869('0x1'),'remove',_0x6869('0x2')];function createListener(_0x596fbb,_0x3d6bc2){return function(_0x5befa3){_0x3d6bc2[_0x6869('0x3')](_0x596fbb,_0x5befa3);};}function removeListener(_0x4dadb5,_0x46c26d){return function(){OpenchannelAccountEvents['removeListener'](_0x4dadb5,_0x46c26d);};}exports[_0x6869('0x4')]=function(_0x45542c){for(var _0x54d39b=0x0,_0x4c8ad5=events[_0x6869('0x5')];_0x54d39b<_0x4c8ad5;_0x54d39b++){var _0x1e667d=events[_0x54d39b];var _0xa343ab=createListener(_0x6869('0x6')+_0x1e667d,_0x45542c);OpenchannelAccountEvents['on'](_0x1e667d,_0xa343ab);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 555ca68..7a0dd8b 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 _0xb811=['fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','isAuthenticated','index','get','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x591501,_0x53d121){var _0x54a26f=function(_0x272b58){while(--_0x272b58){_0x591501['push'](_0x591501['shift']());}};_0x54a26f(++_0x53d121);}(_0xb811,0x78));var _0x1b81=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xb811[_0x5c2e3e];return _0x53f64a;};'use strict';var multer=require(_0x1b81('0x0'));var util=require(_0x1b81('0x1'));var path=require(_0x1b81('0x2'));var timeout=require(_0x1b81('0x3'));var express=require(_0x1b81('0x4'));var router=express[_0x1b81('0x5')]();var fs_extra=require(_0x1b81('0x6'));var auth=require(_0x1b81('0x7'));var interaction=require(_0x1b81('0x8'));var config=require('../../config/environment');var controller=require(_0x1b81('0x9'));router['get']('/',auth[_0x1b81('0xa')](),controller[_0x1b81('0xb')]);router[_0x1b81('0xc')](_0x1b81('0xd'),auth[_0x1b81('0xa')](),controller[_0x1b81('0xe')]);router[_0x1b81('0xf')]('/',auth['isAuthenticated'](),controller[_0x1b81('0x10')]);router['put'](_0x1b81('0xd'),auth[_0x1b81('0xa')](),controller[_0x1b81('0x11')]);router[_0x1b81('0x12')](_0x1b81('0xd'),auth[_0x1b81('0xa')](),controller[_0x1b81('0x13')]);module[_0x1b81('0x14')]=router; \ No newline at end of file +var _0xc90d=['path','Router','fs-extra','get','isAuthenticated','/:id','show','post','create','put','destroy','multer','util'];(function(_0x445619,_0x4d1e8d){var _0x1d2d7f=function(_0x24dc96){while(--_0x24dc96){_0x445619['push'](_0x445619['shift']());}};_0x1d2d7f(++_0x4d1e8d);}(_0xc90d,0x73));var _0xdc90=function(_0x3abe58,_0x184dd9){_0x3abe58=_0x3abe58-0x0;var _0x457389=_0xc90d[_0x3abe58];return _0x457389;};'use strict';var multer=require(_0xdc90('0x0'));var util=require(_0xdc90('0x1'));var path=require(_0xdc90('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdc90('0x3')]();var fs_extra=require(_0xdc90('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0xdc90('0x5')]('/',auth[_0xdc90('0x6')](),controller['index']);router[_0xdc90('0x5')](_0xdc90('0x7'),auth[_0xdc90('0x6')](),controller[_0xdc90('0x8')]);router[_0xdc90('0x9')]('/',auth[_0xdc90('0x6')](),controller[_0xdc90('0xa')]);router[_0xdc90('0xb')](_0xdc90('0x7'),auth[_0xdc90('0x6')](),controller['update']);router['delete'](_0xdc90('0x7'),auth[_0xdc90('0x6')](),controller[_0xdc90('0xc')]);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 f40beb1..919b380 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 _0xcd3b=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xcd3b,0x8b));var _0xbcd3=function(_0x330d7d,_0x45a670){_0x330d7d=_0x330d7d-0x0;var _0x1bb80b=_0xcd3b[_0x330d7d];return _0x1bb80b;};'use strict';var Sequelize=require(_0xbcd3('0x0'));module[_0xbcd3('0x1')]={'priority':{'type':Sequelize[_0xbcd3('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbcd3('0x3')},'appdata':{'type':Sequelize[_0xbcd3('0x4')]()},'description':{'type':Sequelize[_0xbcd3('0x5')]},'interval':{'type':Sequelize[_0xbcd3('0x5')],'defaultValue':_0xbcd3('0x6')}}; \ No newline at end of file +var _0xee64=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xee64,0x1ca));var _0x4ee6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee64[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4ee6('0x0'));module[_0x4ee6('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4ee6('0x2')],'allowNull':![],'defaultValue':_0x4ee6('0x3')},'appdata':{'type':Sequelize[_0x4ee6('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4ee6('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 483f624..e56c670 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 _0xdb8b=['moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','filter','includeAll','include','findAll','rows','catch','show','params','OpenchannelApplication','find','create','body','destroy','rimraf','fast-json-patch','request-promise'];(function(_0x5c043d,_0x59814a){var _0x4de637=function(_0x44239e){while(--_0x44239e){_0x5c043d['push'](_0x5c043d['shift']());}};_0x4de637(++_0x59814a);}(_0xdb8b,0x174));var _0xbdb8=function(_0x5c79e1,_0x1a6c16){_0x5c79e1=_0x5c79e1-0x0;var _0x3967e6=_0xdb8b[_0x5c79e1];return _0x3967e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbdb8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbdb8('0x1'));var rp=require(_0xbdb8('0x2'));var moment=require(_0xbdb8('0x3'));var BPromise=require(_0xbdb8('0x4'));var Mustache=require(_0xbdb8('0x5'));var util=require(_0xbdb8('0x6'));var path=require(_0xbdb8('0x7'));var sox=require('sox');var csv=require(_0xbdb8('0x8'));var ejs=require(_0xbdb8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbdb8('0xa'));var squel=require(_0xbdb8('0xb'));var crypto=require(_0xbdb8('0xc'));var jsforce=require(_0xbdb8('0xd'));var deskjs=require(_0xbdb8('0xe'));var toCsv=require(_0xbdb8('0x8'));var querystring=require(_0xbdb8('0xf'));var Papa=require(_0xbdb8('0x10'));var Redis=require(_0xbdb8('0x11'));var authService=require(_0xbdb8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbdb8('0x13'));var logger=require(_0xbdb8('0x14'))(_0xbdb8('0x15'));var utils=require(_0xbdb8('0x16'));var config=require(_0xbdb8('0x17'));var licenseUtil=require(_0xbdb8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49ba7e,_0xc49104){_0xc49104=_0xc49104||0xcc;return function(_0x355e6e){if(_0x355e6e){return _0x49ba7e['sendStatus'](_0xc49104);}return _0x49ba7e[_0xbdb8('0x19')](_0xc49104)[_0xbdb8('0x1a')]();};}function respondWithResult(_0x52f8a1,_0x58bae0){_0x58bae0=_0x58bae0||0xc8;return function(_0x206ad9){if(_0x206ad9){return _0x52f8a1[_0xbdb8('0x19')](_0x58bae0)[_0xbdb8('0x1b')](_0x206ad9);}};}function respondWithFilteredResult(_0x5d6089,_0x1aeff2){return function(_0xb6f2d5){if(_0xb6f2d5){var _0x3f7683=typeof _0x1aeff2[_0xbdb8('0x1c')]===_0xbdb8('0x1d')&&typeof _0x1aeff2[_0xbdb8('0x1e')]===_0xbdb8('0x1d');var _0x3cb5be=_0xb6f2d5[_0xbdb8('0x1f')];var _0x1f452e=_0x3f7683?0x0:_0x1aeff2[_0xbdb8('0x1c')];var _0x3cfa29=_0x3f7683?_0xb6f2d5[_0xbdb8('0x1f')]:_0x1aeff2[_0xbdb8('0x1c')]+_0x1aeff2['limit'];var _0x4f4bf7;if(_0x3cfa29>=_0x3cb5be){_0x3cfa29=_0x3cb5be;_0x4f4bf7=0xc8;}else{_0x4f4bf7=0xce;}_0x5d6089[_0xbdb8('0x19')](_0x4f4bf7);return _0x5d6089[_0xbdb8('0x20')](_0xbdb8('0x21'),_0x1f452e+'-'+_0x3cfa29+'/'+_0x3cb5be)['json'](_0xb6f2d5);}return null;};}function patchUpdates(_0x5e89f8){return function(_0x44072d){try{jsonpatch[_0xbdb8('0x22')](_0x44072d,_0x5e89f8,!![]);}catch(_0x3198bc){return BPromise['reject'](_0x3198bc);}return _0x44072d[_0xbdb8('0x23')]();};}function saveUpdates(_0x4c7d38,_0x3b742e){return function(_0x2832d8){if(_0x2832d8){return _0x2832d8[_0xbdb8('0x24')](_0x4c7d38)[_0xbdb8('0x25')](function(_0x1cc11a){return _0x1cc11a;});}return null;};}function removeEntity(_0x96f24b,_0x63c3c3){return function(_0x24d8c9){if(_0x24d8c9){return _0x24d8c9['destroy']()['then'](function(){_0x96f24b[_0xbdb8('0x19')](0xcc)[_0xbdb8('0x1a')]();});}};}function handleEntityNotFound(_0x2cfede,_0x3a76ad){return function(_0x4bd506){if(!_0x4bd506){_0x2cfede[_0xbdb8('0x26')](0x194);}return _0x4bd506;};}function handleError(_0x2a6a2f,_0x3dc55e){_0x3dc55e=_0x3dc55e||0x1f4;return function(_0x2e383f){logger['error'](_0x2e383f['stack']);if(_0x2e383f[_0xbdb8('0x27')]){delete _0x2e383f[_0xbdb8('0x27')];}_0x2a6a2f[_0xbdb8('0x19')](_0x3dc55e)[_0xbdb8('0x28')](_0x2e383f);};}exports[_0xbdb8('0x29')]=function(_0x350895,_0x40eb0f){var _0x5b2ca9={},_0x464690={},_0x3f2d84={'count':0x0,'rows':[]};var _0x1995e5=_[_0xbdb8('0x2a')](db['OpenchannelApplication'][_0xbdb8('0x2b')],function(_0x33618a){return{'name':_0x33618a[_0xbdb8('0x2c')],'type':_0x33618a[_0xbdb8('0x2d')][_0xbdb8('0x2e')]};});_0x464690[_0xbdb8('0x2f')]=_['map'](_0x1995e5,_0xbdb8('0x27'));_0x464690['query']=_[_0xbdb8('0x30')](_0x350895['query']);_0x464690[_0xbdb8('0x31')]=_[_0xbdb8('0x32')](_0x464690[_0xbdb8('0x2f')],_0x464690[_0xbdb8('0x33')]);_0x5b2ca9['attributes']=_[_0xbdb8('0x32')](_0x464690[_0xbdb8('0x2f')],qs[_0xbdb8('0x34')](_0x350895['query']['fields']));_0x5b2ca9[_0xbdb8('0x35')]=_0x5b2ca9[_0xbdb8('0x35')][_0xbdb8('0x36')]?_0x5b2ca9['attributes']:_0x464690[_0xbdb8('0x2f')];if(!_0x350895[_0xbdb8('0x33')][_0xbdb8('0x37')](_0xbdb8('0x38'))){_0x5b2ca9[_0xbdb8('0x1e')]=qs[_0xbdb8('0x1e')](_0x350895[_0xbdb8('0x33')][_0xbdb8('0x1e')]);_0x5b2ca9[_0xbdb8('0x1c')]=qs['offset'](_0x350895[_0xbdb8('0x33')][_0xbdb8('0x1c')]);}_0x5b2ca9[_0xbdb8('0x39')]=qs[_0xbdb8('0x3a')](_0x350895[_0xbdb8('0x33')][_0xbdb8('0x3a')]);_0x5b2ca9['where']=qs['filters'](_[_0xbdb8('0x3b')](_0x350895['query'],_0x464690[_0xbdb8('0x31')]),_0x1995e5);if(_0x350895[_0xbdb8('0x33')]['filter']){_0x5b2ca9['where']=_[_0xbdb8('0x3c')](_0x5b2ca9[_0xbdb8('0x3d')],{'$or':_['map'](_0x1995e5,function(_0x1d2983){if(_0x1d2983[_0xbdb8('0x2d')]!=='VIRTUAL'){var _0x112bcc={};_0x112bcc[_0x1d2983[_0xbdb8('0x27')]]={'$like':'%'+_0x350895[_0xbdb8('0x33')][_0xbdb8('0x3e')]+'%'};return _0x112bcc;}})});}_0x5b2ca9=_[_0xbdb8('0x3c')]({},_0x5b2ca9,_0x350895['options']);var _0xfc82f3={'where':_0x5b2ca9[_0xbdb8('0x3d')]};return db['OpenchannelApplication'][_0xbdb8('0x1f')](_0xfc82f3)[_0xbdb8('0x25')](function(_0x3fec04){_0x3f2d84[_0xbdb8('0x1f')]=_0x3fec04;if(_0x350895[_0xbdb8('0x33')][_0xbdb8('0x3f')]){_0x5b2ca9[_0xbdb8('0x40')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xbdb8('0x41')](_0x5b2ca9);})[_0xbdb8('0x25')](function(_0x5c2e6c){_0x3f2d84[_0xbdb8('0x42')]=_0x5c2e6c;return _0x3f2d84;})[_0xbdb8('0x25')](respondWithFilteredResult(_0x40eb0f,_0x5b2ca9))[_0xbdb8('0x43')](handleError(_0x40eb0f,null));};exports[_0xbdb8('0x44')]=function(_0x5629df,_0x501d4b){var _0x272f33={'raw':!![],'where':{'id':_0x5629df[_0xbdb8('0x45')]['id']}},_0x5ad460={};_0x5ad460['model']=_[_0xbdb8('0x30')](db['OpenchannelApplication'][_0xbdb8('0x2b')]);_0x5ad460[_0xbdb8('0x33')]=_[_0xbdb8('0x30')](_0x5629df[_0xbdb8('0x33')]);_0x5ad460[_0xbdb8('0x31')]=_[_0xbdb8('0x32')](_0x5ad460[_0xbdb8('0x2f')],_0x5ad460[_0xbdb8('0x33')]);_0x272f33['attributes']=_['intersection'](_0x5ad460[_0xbdb8('0x2f')],qs['fields'](_0x5629df['query']['fields']));_0x272f33[_0xbdb8('0x35')]=_0x272f33['attributes']['length']?_0x272f33['attributes']:_0x5ad460[_0xbdb8('0x2f')];if(_0x5629df[_0xbdb8('0x33')][_0xbdb8('0x3f')]){_0x272f33[_0xbdb8('0x40')]=[{'all':!![]}];}_0x272f33=_[_0xbdb8('0x3c')]({},_0x272f33,_0x5629df['options']);return db[_0xbdb8('0x46')][_0xbdb8('0x47')](_0x272f33)[_0xbdb8('0x25')](handleEntityNotFound(_0x501d4b,null))[_0xbdb8('0x25')](respondWithResult(_0x501d4b,null))[_0xbdb8('0x43')](handleError(_0x501d4b,null));};exports[_0xbdb8('0x48')]=function(_0x205d1f,_0x3d0c14){return db['OpenchannelApplication'][_0xbdb8('0x48')](_0x205d1f['body'],{})[_0xbdb8('0x25')](respondWithResult(_0x3d0c14,0xc9))['catch'](handleError(_0x3d0c14,null));};exports[_0xbdb8('0x24')]=function(_0x4f0cba,_0x5eb053){if(_0x4f0cba[_0xbdb8('0x49')]['id']){delete _0x4f0cba[_0xbdb8('0x49')]['id'];}return db[_0xbdb8('0x46')][_0xbdb8('0x47')]({'where':{'id':_0x4f0cba[_0xbdb8('0x45')]['id']}})['then'](handleEntityNotFound(_0x5eb053,null))[_0xbdb8('0x25')](saveUpdates(_0x4f0cba[_0xbdb8('0x49')],null))['then'](respondWithResult(_0x5eb053,null))[_0xbdb8('0x43')](handleError(_0x5eb053,null));};exports[_0xbdb8('0x4a')]=function(_0x178496,_0x13bf76){return db['OpenchannelApplication']['find']({'where':{'id':_0x178496['params']['id']}})['then'](handleEntityNotFound(_0x13bf76,null))[_0xbdb8('0x25')](removeEntity(_0x13bf76,null))['catch'](handleError(_0x13bf76,null));}; \ No newline at end of file +var _0x03a5=['squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','set','apply','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x03a5,0x11a));var _0x503a=function(_0x2c1841,_0x505204){_0x2c1841=_0x2c1841-0x0;var _0x28d148=_0x03a5[_0x2c1841];return _0x28d148;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x503a('0x0'));var zipdir=require(_0x503a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x503a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x503a('0x3'));var util=require(_0x503a('0x4'));var path=require('path');var sox=require(_0x503a('0x5'));var csv=require(_0x503a('0x6'));var ejs=require(_0x503a('0x7'));var fs=require('fs');var fs_extra=require(_0x503a('0x8'));var _=require(_0x503a('0x9'));var squel=require(_0x503a('0xa'));var crypto=require(_0x503a('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x503a('0x6'));var querystring=require(_0x503a('0xc'));var Papa=require('papaparse');var Redis=require(_0x503a('0xd'));var authService=require(_0x503a('0xe'));var qs=require(_0x503a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x503a('0x10'));var logger=require(_0x503a('0x11'))(_0x503a('0x12'));var utils=require(_0x503a('0x13'));var config=require(_0x503a('0x14'));var licenseUtil=require(_0x503a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43947a,_0x4d9822){_0x4d9822=_0x4d9822||0xcc;return function(_0x5285a3){if(_0x5285a3){return _0x43947a[_0x503a('0x16')](_0x4d9822);}return _0x43947a[_0x503a('0x17')](_0x4d9822)[_0x503a('0x18')]();};}function respondWithResult(_0x5e9888,_0x2ded9f){_0x2ded9f=_0x2ded9f||0xc8;return function(_0x227e51){if(_0x227e51){return _0x5e9888['status'](_0x2ded9f)[_0x503a('0x19')](_0x227e51);}};}function respondWithFilteredResult(_0x473e6c,_0x4bac91){return function(_0x373df2){if(_0x373df2){var _0x28d80b=typeof _0x4bac91['offset']===_0x503a('0x1a')&&typeof _0x4bac91[_0x503a('0x1b')]===_0x503a('0x1a');var _0xb738ce=_0x373df2['count'];var _0x1cdf08=_0x28d80b?0x0:_0x4bac91['offset'];var _0x212894=_0x28d80b?_0x373df2['count']:_0x4bac91[_0x503a('0x1c')]+_0x4bac91['limit'];var _0x21daac;if(_0x212894>=_0xb738ce){_0x212894=_0xb738ce;_0x21daac=0xc8;}else{_0x21daac=0xce;}_0x473e6c[_0x503a('0x17')](_0x21daac);return _0x473e6c[_0x503a('0x1d')]('Content-Range',_0x1cdf08+'-'+_0x212894+'/'+_0xb738ce)[_0x503a('0x19')](_0x373df2);}return null;};}function patchUpdates(_0x595d6d){return function(_0x296aa5){try{jsonpatch[_0x503a('0x1e')](_0x296aa5,_0x595d6d,!![]);}catch(_0x13f584){return BPromise['reject'](_0x13f584);}return _0x296aa5[_0x503a('0x1f')]();};}function saveUpdates(_0x7d56df,_0x557ee2){return function(_0x3075de){if(_0x3075de){return _0x3075de[_0x503a('0x20')](_0x7d56df)[_0x503a('0x21')](function(_0x375d5c){return _0x375d5c;});}return null;};}function removeEntity(_0x2edfd3,_0x374c6a){return function(_0xfa6c97){if(_0xfa6c97){return _0xfa6c97[_0x503a('0x22')]()[_0x503a('0x21')](function(){_0x2edfd3[_0x503a('0x17')](0xcc)[_0x503a('0x18')]();});}};}function handleEntityNotFound(_0x1faab7,_0x1f6b1e){return function(_0x36b781){if(!_0x36b781){_0x1faab7[_0x503a('0x16')](0x194);}return _0x36b781;};}function handleError(_0x579047,_0x36187a){_0x36187a=_0x36187a||0x1f4;return function(_0x52045c){logger[_0x503a('0x23')](_0x52045c[_0x503a('0x24')]);if(_0x52045c[_0x503a('0x25')]){delete _0x52045c[_0x503a('0x25')];}_0x579047['status'](_0x36187a)[_0x503a('0x26')](_0x52045c);};}exports[_0x503a('0x27')]=function(_0x32f85f,_0xdec58a){var _0x5f4f74={},_0x11459b={},_0x1e0948={'count':0x0,'rows':[]};var _0x5c94d6=_[_0x503a('0x28')](db[_0x503a('0x29')]['rawAttributes'],function(_0x64f767){return{'name':_0x64f767[_0x503a('0x2a')],'type':_0x64f767[_0x503a('0x2b')][_0x503a('0x2c')]};});_0x11459b[_0x503a('0x2d')]=_[_0x503a('0x28')](_0x5c94d6,_0x503a('0x25'));_0x11459b[_0x503a('0x2e')]=_[_0x503a('0x2f')](_0x32f85f[_0x503a('0x2e')]);_0x11459b[_0x503a('0x30')]=_[_0x503a('0x31')](_0x11459b[_0x503a('0x2d')],_0x11459b[_0x503a('0x2e')]);_0x5f4f74[_0x503a('0x32')]=_[_0x503a('0x31')](_0x11459b[_0x503a('0x2d')],qs[_0x503a('0x33')](_0x32f85f[_0x503a('0x2e')]['fields']));_0x5f4f74[_0x503a('0x32')]=_0x5f4f74[_0x503a('0x32')][_0x503a('0x34')]?_0x5f4f74[_0x503a('0x32')]:_0x11459b[_0x503a('0x2d')];if(!_0x32f85f[_0x503a('0x2e')][_0x503a('0x35')](_0x503a('0x36'))){_0x5f4f74[_0x503a('0x1b')]=qs['limit'](_0x32f85f['query']['limit']);_0x5f4f74['offset']=qs[_0x503a('0x1c')](_0x32f85f[_0x503a('0x2e')][_0x503a('0x1c')]);}_0x5f4f74[_0x503a('0x37')]=qs['sort'](_0x32f85f[_0x503a('0x2e')]['sort']);_0x5f4f74['where']=qs[_0x503a('0x30')](_[_0x503a('0x38')](_0x32f85f[_0x503a('0x2e')],_0x11459b[_0x503a('0x30')]),_0x5c94d6);if(_0x32f85f[_0x503a('0x2e')][_0x503a('0x39')]){_0x5f4f74[_0x503a('0x3a')]=_[_0x503a('0x3b')](_0x5f4f74[_0x503a('0x3a')],{'$or':_[_0x503a('0x28')](_0x5c94d6,function(_0xbc5efe){if(_0xbc5efe['type']!=='VIRTUAL'){var _0x7df78a={};_0x7df78a[_0xbc5efe['name']]={'$like':'%'+_0x32f85f[_0x503a('0x2e')]['filter']+'%'};return _0x7df78a;}})});}_0x5f4f74=_['merge']({},_0x5f4f74,_0x32f85f[_0x503a('0x3c')]);var _0x2f440f={'where':_0x5f4f74[_0x503a('0x3a')]};return db[_0x503a('0x29')][_0x503a('0x3d')](_0x2f440f)[_0x503a('0x21')](function(_0x598903){_0x1e0948[_0x503a('0x3d')]=_0x598903;if(_0x32f85f['query'][_0x503a('0x3e')]){_0x5f4f74[_0x503a('0x3f')]=[{'all':!![]}];}return db[_0x503a('0x29')][_0x503a('0x40')](_0x5f4f74);})[_0x503a('0x21')](function(_0x522931){_0x1e0948[_0x503a('0x41')]=_0x522931;return _0x1e0948;})[_0x503a('0x21')](respondWithFilteredResult(_0xdec58a,_0x5f4f74))[_0x503a('0x42')](handleError(_0xdec58a,null));};exports[_0x503a('0x43')]=function(_0x18c157,_0x50f53a){var _0xea5717={'raw':!![],'where':{'id':_0x18c157[_0x503a('0x44')]['id']}},_0x2aa7c1={};_0x2aa7c1[_0x503a('0x2d')]=_[_0x503a('0x2f')](db[_0x503a('0x29')][_0x503a('0x45')]);_0x2aa7c1[_0x503a('0x2e')]=_['keys'](_0x18c157[_0x503a('0x2e')]);_0x2aa7c1['filters']=_['intersection'](_0x2aa7c1[_0x503a('0x2d')],_0x2aa7c1['query']);_0xea5717['attributes']=_[_0x503a('0x31')](_0x2aa7c1[_0x503a('0x2d')],qs[_0x503a('0x33')](_0x18c157[_0x503a('0x2e')][_0x503a('0x33')]));_0xea5717[_0x503a('0x32')]=_0xea5717[_0x503a('0x32')]['length']?_0xea5717['attributes']:_0x2aa7c1['model'];if(_0x18c157[_0x503a('0x2e')][_0x503a('0x3e')]){_0xea5717[_0x503a('0x3f')]=[{'all':!![]}];}_0xea5717=_[_0x503a('0x3b')]({},_0xea5717,_0x18c157[_0x503a('0x3c')]);return db[_0x503a('0x29')][_0x503a('0x46')](_0xea5717)[_0x503a('0x21')](handleEntityNotFound(_0x50f53a,null))[_0x503a('0x21')](respondWithResult(_0x50f53a,null))['catch'](handleError(_0x50f53a,null));};exports[_0x503a('0x47')]=function(_0x721963,_0x2110f3){return db['OpenchannelApplication'][_0x503a('0x47')](_0x721963[_0x503a('0x48')],{})[_0x503a('0x21')](respondWithResult(_0x2110f3,0xc9))[_0x503a('0x42')](handleError(_0x2110f3,null));};exports['update']=function(_0x1eef55,_0x22ba76){if(_0x1eef55[_0x503a('0x48')]['id']){delete _0x1eef55[_0x503a('0x48')]['id'];}return db[_0x503a('0x29')]['find']({'where':{'id':_0x1eef55[_0x503a('0x44')]['id']}})[_0x503a('0x21')](handleEntityNotFound(_0x22ba76,null))[_0x503a('0x21')](saveUpdates(_0x1eef55[_0x503a('0x48')],null))[_0x503a('0x21')](respondWithResult(_0x22ba76,null))[_0x503a('0x42')](handleError(_0x22ba76,null));};exports[_0x503a('0x22')]=function(_0x5837a9,_0x49db72){return db[_0x503a('0x29')]['find']({'where':{'id':_0x5837a9[_0x503a('0x44')]['id']}})[_0x503a('0x21')](handleEntityNotFound(_0x49db72,null))[_0x503a('0x21')](removeEntity(_0x49db72,null))[_0x503a('0x42')](handleError(_0x49db72,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index c0989de..db73401 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 _0x7eaa=['utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','define','OpenchannelApplication','openchannel_applications','utf8mb4'];(function(_0x43a1a6,_0x1c2380){var _0x35958f=function(_0x2cd7e1){while(--_0x2cd7e1){_0x43a1a6['push'](_0x43a1a6['shift']());}};_0x35958f(++_0x1c2380);}(_0x7eaa,0x146));var _0xa7ea=function(_0x5a561f,_0x496588){_0x5a561f=_0x5a561f-0x0;var _0x3eede4=_0x7eaa[_0x5a561f];return _0x3eede4;};'use strict';var _=require(_0xa7ea('0x0'));var util=require(_0xa7ea('0x1'));var logger=require('../../config/logger')(_0xa7ea('0x2'));var moment=require('moment');var BPromise=require(_0xa7ea('0x3'));var rp=require(_0xa7ea('0x4'));var fs=require('fs');var path=require(_0xa7ea('0x5'));var rimraf=require(_0xa7ea('0x6'));var config=require(_0xa7ea('0x7'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x3b55fb,_0x42993c){return _0x3b55fb[_0xa7ea('0x8')](_0xa7ea('0x9'),attributes,{'tableName':_0xa7ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa7ea('0xb'),'collate':_0xa7ea('0xc')});}; \ No newline at end of file +var _0xeee8=['rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x39387f,_0x532e5e){var _0x48861b=function(_0x138dd0){while(--_0x138dd0){_0x39387f['push'](_0x39387f['shift']());}};_0x48861b(++_0x532e5e);}(_0xeee8,0x1ba));var _0x8eee=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xeee8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8eee('0x0'));var util=require('util');var logger=require(_0x8eee('0x1'))(_0x8eee('0x2'));var moment=require(_0x8eee('0x3'));var BPromise=require('bluebird');var rp=require(_0x8eee('0x4'));var fs=require('fs');var path=require(_0x8eee('0x5'));var rimraf=require(_0x8eee('0x6'));var config=require(_0x8eee('0x7'));var attributes=require(_0x8eee('0x8'));module[_0x8eee('0x9')]=function(_0x1fd95c,_0x46a1f4){return _0x1fd95c[_0x8eee('0xa')](_0x8eee('0xb'),attributes,{'tableName':_0x8eee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8eee('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 58199df..a5699e0 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 _0xc1f8=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','then','request\x20sent','debug','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','catch','lodash','util','moment'];(function(_0x35881f,_0x2ffb79){var _0x1572e8=function(_0x46aa13){while(--_0x46aa13){_0x35881f['push'](_0x35881f['shift']());}};_0x1572e8(++_0x2ffb79);}(_0xc1f8,0x93));var _0x8c1f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc1f8[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8c1f('0x0'));var util=require(_0x8c1f('0x1'));var moment=require(_0x8c1f('0x2'));var BPromise=require(_0x8c1f('0x3'));var rs=require(_0x8c1f('0x4'));var fs=require('fs');var Redis=require(_0x8c1f('0x5'));var db=require(_0x8c1f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c1f('0x7'))(_0x8c1f('0x8'));var config=require(_0x8c1f('0x9'));var jayson=require(_0x8c1f('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2affe8,_0x30b0c6,_0x57e2f8){return new BPromise(function(_0x3e23b9,_0x578506){return client['request'](_0x2affe8,_0x57e2f8)[_0x8c1f('0xb')](function(_0x4179ee){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x30b0c6,_0x8c1f('0xc'));logger[_0x8c1f('0xd')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x30b0c6,_0x8c1f('0xc'),JSON[_0x8c1f('0xe')](_0x4179ee));if(_0x4179ee[_0x8c1f('0xf')]){if(_0x4179ee['error'][_0x8c1f('0x10')]===0x1f4){logger[_0x8c1f('0xf')](_0x8c1f('0x11'),_0x30b0c6,_0x4179ee[_0x8c1f('0xf')][_0x8c1f('0x12')]);return _0x578506(_0x4179ee[_0x8c1f('0xf')][_0x8c1f('0x12')]);}logger[_0x8c1f('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x30b0c6,_0x4179ee[_0x8c1f('0xf')]['message']);return _0x3e23b9(_0x4179ee[_0x8c1f('0xf')][_0x8c1f('0x12')]);}else{logger['info'](_0x8c1f('0x11'),_0x30b0c6,_0x8c1f('0xc'));_0x3e23b9(_0x4179ee[_0x8c1f('0x13')][_0x8c1f('0x12')]);}})['catch'](function(_0x57b980){logger[_0x8c1f('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x30b0c6,_0x57b980);_0x578506(_0x57b980);});});}exports[_0x8c1f('0x14')]=function(_0x32acd8){var _0x38be86=this;return new Promise(function(_0x4467f6,_0x3670c2){return db[_0x8c1f('0x15')][_0x8c1f('0x16')](_0x32acd8[_0x8c1f('0x17')],{'raw':_0x32acd8['options']?_0x32acd8[_0x8c1f('0x18')][_0x8c1f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32acd8[_0x8c1f('0x18')]?_0x32acd8[_0x8c1f('0x18')][_0x8c1f('0x1a')]||null:null,'attributes':_0x32acd8[_0x8c1f('0x18')]?_0x32acd8[_0x8c1f('0x18')][_0x8c1f('0x1b')]||null:null,'limit':_0x32acd8[_0x8c1f('0x18')]?_0x32acd8[_0x8c1f('0x18')][_0x8c1f('0x1c')]||null:null})[_0x8c1f('0xb')](function(_0x17e0ce){logger['info'](_0x8c1f('0x14'),_0x32acd8);logger[_0x8c1f('0xd')](_0x8c1f('0x14'),_0x32acd8,JSON[_0x8c1f('0xe')](_0x17e0ce));_0x4467f6(_0x17e0ce);})[_0x8c1f('0x1d')](function(_0x277c40){logger['error'](_0x8c1f('0x14'),_0x277c40[_0x8c1f('0x12')],_0x32acd8);_0x3670c2(_0x38be86[_0x8c1f('0xf')](0x1f4,_0x277c40[_0x8c1f('0x12')]));});});}; \ No newline at end of file +var _0x3857=['stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x32b0e4,_0x435081){var _0x2fd9cf=function(_0x4384c5){while(--_0x4384c5){_0x32b0e4['push'](_0x32b0e4['shift']());}};_0x2fd9cf(++_0x435081);}(_0x3857,0x1f0));var _0x7385=function(_0x1bca06,_0x3577c6){_0x1bca06=_0x1bca06-0x0;var _0x253131=_0x3857[_0x1bca06];return _0x253131;};'use strict';var _=require(_0x7385('0x0'));var util=require(_0x7385('0x1'));var moment=require(_0x7385('0x2'));var BPromise=require(_0x7385('0x3'));var rs=require(_0x7385('0x4'));var fs=require('fs');var Redis=require(_0x7385('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7385('0x6'));var logger=require(_0x7385('0x7'))(_0x7385('0x8'));var config=require('../../config/environment');var jayson=require(_0x7385('0x9'));var client=jayson[_0x7385('0xa')][_0x7385('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x389dab,_0xc5918f,_0x4bae2b){return new BPromise(function(_0xcc77f1,_0x1e4e47){return client[_0x7385('0xc')](_0x389dab,_0x4bae2b)['then'](function(_0x295661){logger[_0x7385('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0xc5918f,_0x7385('0xe'));logger[_0x7385('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0xc5918f,_0x7385('0xe'),JSON[_0x7385('0x10')](_0x295661));if(_0x295661[_0x7385('0x11')]){if(_0x295661[_0x7385('0x11')][_0x7385('0x12')]===0x1f4){logger[_0x7385('0x11')](_0x7385('0x13'),_0xc5918f,_0x295661[_0x7385('0x11')]['message']);return _0x1e4e47(_0x295661[_0x7385('0x11')][_0x7385('0x14')]);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0xc5918f,_0x295661[_0x7385('0x11')]['message']);return _0xcc77f1(_0x295661[_0x7385('0x11')][_0x7385('0x14')]);}else{logger[_0x7385('0xd')](_0x7385('0x13'),_0xc5918f,_0x7385('0xe'));_0xcc77f1(_0x295661[_0x7385('0x15')][_0x7385('0x14')]);}})[_0x7385('0x16')](function(_0x41e365){logger[_0x7385('0x11')](_0x7385('0x13'),_0xc5918f,_0x41e365);_0x1e4e47(_0x41e365);});});}exports[_0x7385('0x17')]=function(_0x507fea){var _0x5985e1=this;return new Promise(function(_0x5471ab,_0x3d3589){return db[_0x7385('0x18')][_0x7385('0x19')](_0x507fea[_0x7385('0x1a')],{'raw':_0x507fea[_0x7385('0x1b')]?_0x507fea['options'][_0x7385('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x507fea[_0x7385('0x1b')]?_0x507fea[_0x7385('0x1b')]['where']||null:null,'attributes':_0x507fea[_0x7385('0x1b')]?_0x507fea['options'][_0x7385('0x1d')]||null:null,'limit':_0x507fea[_0x7385('0x1b')]?_0x507fea[_0x7385('0x1b')][_0x7385('0x1e')]||null:null})[_0x7385('0x1f')](function(_0x1464d5){logger[_0x7385('0xd')](_0x7385('0x17'),_0x507fea);logger['debug']('UpdateOpenchannelApplication',_0x507fea,JSON[_0x7385('0x10')](_0x1464d5));_0x5471ab(_0x1464d5);})[_0x7385('0x16')](function(_0x2f1c5e){logger[_0x7385('0x11')]('UpdateOpenchannelApplication',_0x2f1c5e[_0x7385('0x14')],_0x507fea);_0x3d3589(_0x5985e1[_0x7385('0x11')](0x1f4,_0x2f1c5e[_0x7385('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index bfad8b7..835bb85 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 _0x5b46=['put','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','util','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','describe','/:id','show','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags'];(function(_0x1a0ef3,_0x535bbf){var _0x2b86da=function(_0x5d30f9){while(--_0x5d30f9){_0x1a0ef3['push'](_0x1a0ef3['shift']());}};_0x2b86da(++_0x535bbf);}(_0x5b46,0x11f));var _0x65b4=function(_0x19b736,_0x2e37f9){_0x19b736=_0x19b736-0x0;var _0x1233e0=_0x5b46[_0x19b736];return _0x1233e0;};'use strict';var multer=require('multer');var util=require(_0x65b4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x65b4('0x1'));var router=express['Router']();var fs_extra=require(_0x65b4('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x65b4('0x3'));var config=require(_0x65b4('0x4'));var controller=require(_0x65b4('0x5'));router['get']('/',auth[_0x65b4('0x6')](),controller[_0x65b4('0x7')]);router[_0x65b4('0x8')]('/describe',auth[_0x65b4('0x6')](),controller[_0x65b4('0x9')]);router['get'](_0x65b4('0xa'),auth[_0x65b4('0x6')](),controller[_0x65b4('0xb')]);router['get'](_0x65b4('0xc'),auth['isAuthenticated'](),controller['getMessages']);router[_0x65b4('0x8')](_0x65b4('0xd'),auth['isAuthenticated'](),controller[_0x65b4('0xe')]);router[_0x65b4('0xf')]('/',auth[_0x65b4('0x6')](),controller['create']);router[_0x65b4('0xf')](_0x65b4('0xc'),auth[_0x65b4('0x6')](),controller[_0x65b4('0x10')]);router[_0x65b4('0xf')](_0x65b4('0x11'),auth[_0x65b4('0x6')](),interaction[_0x65b4('0x12')](_0x65b4('0x13'),_0x65b4('0x14')),controller['addTags']);router[_0x65b4('0x15')](_0x65b4('0xa'),auth[_0x65b4('0x6')](),interaction[_0x65b4('0x12')](_0x65b4('0x13'),_0x65b4('0x16')),controller['update']);router[_0x65b4('0x17')]('/:id',auth[_0x65b4('0x6')](),interaction[_0x65b4('0x12')](_0x65b4('0x13'),_0x65b4('0x18')),controller[_0x65b4('0x19')]);router[_0x65b4('0x17')](_0x65b4('0x11'),auth[_0x65b4('0x6')](),controller[_0x65b4('0x1a')]);module[_0x65b4('0x1b')]=router; \ No newline at end of file +var _0xc97a=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','removeTags','exports','multer','util','path','connect-timeout','express'];(function(_0x5abf55,_0x4ac5ce){var _0x38157f=function(_0x3a97fd){while(--_0x3a97fd){_0x5abf55['push'](_0x5abf55['shift']());}};_0x38157f(++_0x4ac5ce);}(_0xc97a,0xd4));var _0xac97=function(_0x53c098,_0xdea94a){_0x53c098=_0x53c098-0x0;var _0x4cd7=_0xc97a[_0x53c098];return _0x4cd7;};'use strict';var multer=require(_0xac97('0x0'));var util=require(_0xac97('0x1'));var path=require(_0xac97('0x2'));var timeout=require(_0xac97('0x3'));var express=require(_0xac97('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xac97('0x5'));var interaction=require(_0xac97('0x6'));var config=require(_0xac97('0x7'));var controller=require('./openchannelInteraction.controller');router[_0xac97('0x8')]('/',auth[_0xac97('0x9')](),controller[_0xac97('0xa')]);router[_0xac97('0x8')](_0xac97('0xb'),auth['isAuthenticated'](),controller[_0xac97('0xc')]);router[_0xac97('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xac97('0xd')]);router[_0xac97('0x8')](_0xac97('0xe'),auth[_0xac97('0x9')](),controller[_0xac97('0xf')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xac97('0x10')]);router[_0xac97('0x11')]('/',auth[_0xac97('0x9')](),controller[_0xac97('0x12')]);router['post'](_0xac97('0xe'),auth[_0xac97('0x9')](),controller[_0xac97('0x13')]);router[_0xac97('0x11')](_0xac97('0x14'),auth['isAuthenticated'](),interaction[_0xac97('0x15')](_0xac97('0x16'),_0xac97('0x17')),controller[_0xac97('0x18')]);router[_0xac97('0x19')]('/:id',auth[_0xac97('0x9')](),interaction['tracked'](_0xac97('0x16'),_0xac97('0x1a')),controller[_0xac97('0x1b')]);router[_0xac97('0x1c')]('/:id',auth[_0xac97('0x9')](),interaction[_0xac97('0x15')](_0xac97('0x16'),'openchannelinteraction:destroy'),controller['destroy']);router['delete'](_0xac97('0x14'),auth[_0xac97('0x9')](),controller[_0xac97('0x1d')]);module[_0xac97('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 8725446..40a2cab 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 _0x1f38=['exports','BOOLEAN','DATE','STRING','out','sequelize'];(function(_0x397407,_0x14c48b){var _0x58a58a=function(_0x8230b8){while(--_0x8230b8){_0x397407['push'](_0x397407['shift']());}};_0x58a58a(++_0x14c48b);}(_0x1f38,0xd7));var _0x81f3=function(_0x3899cb,_0xb95555){_0x3899cb=_0x3899cb-0x0;var _0x3fe239=_0x1f38[_0x3899cb];return _0x3fe239;};'use strict';var Sequelize=require(_0x81f3('0x0'));module[_0x81f3('0x1')]={'closed':{'type':Sequelize[_0x81f3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x81f3('0x3')]},'disposition':{'type':Sequelize[_0x81f3('0x4')]},'secondDisposition':{'type':Sequelize[_0x81f3('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x81f3('0x4')]},'read1stAt':{'type':Sequelize[_0x81f3('0x3')]},'threadId':{'type':Sequelize[_0x81f3('0x4')]},'externalUrl':{'type':Sequelize[_0x81f3('0x4')]},'lastMsgAt':{'type':Sequelize[_0x81f3('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x81f3('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x81f3('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x81f3('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x9362=['out','sequelize','BOOLEAN','STRING','DATE','ENUM'];(function(_0x4ee654,_0x3f3fec){var _0x4e07b9=function(_0x544305){while(--_0x544305){_0x4ee654['push'](_0x4ee654['shift']());}};_0x4e07b9(++_0x3f3fec);}(_0x9362,0x169));var _0x2936=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9362[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x2936('0x0'));module['exports']={'closed':{'type':Sequelize[_0x2936('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2936('0x2')]},'secondDisposition':{'type':Sequelize[_0x2936('0x2')]},'thirdDisposition':{'type':Sequelize[_0x2936('0x2')]},'note':{'type':Sequelize[_0x2936('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x2936('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x2936('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2936('0x4')]('in',_0x2936('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x2936('0x2')]},'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 c566970..e67fd63 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 _0xc0e3=['key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','where','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','OpenchannelAccountId','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','rows','show','merge','options','create','update','params','describe','addMessage','OpenchannelMessage','ids','omit','nolimit','includeAll','include','addTags','spread','Tag','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','get','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','threadId','createReadStream','out','System','lastName','views','downloadInteraction.ejs','transcript-','.pdf','Openchannel','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','sendStatus','stack','name','send','fullname','Tags','TagIds','forEach','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type'];(function(_0x74b2ed,_0x259bca){var _0x96497d=function(_0x469250){while(--_0x469250){_0x74b2ed['push'](_0x74b2ed['shift']());}};_0x96497d(++_0x259bca);}(_0xc0e3,0x191));var _0x3c0e=function(_0x486061,_0x59ec2f){_0x486061=_0x486061-0x0;var _0x5ce3a7=_0xc0e3[_0x486061];return _0x5ce3a7;};'use strict';var emlformat=require(_0x3c0e('0x0'));var rimraf=require(_0x3c0e('0x1'));var zipdir=require(_0x3c0e('0x2'));var jsonpatch=require(_0x3c0e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3c0e('0x4'));var Mustache=require(_0x3c0e('0x5'));var util=require('util');var path=require(_0x3c0e('0x6'));var sox=require(_0x3c0e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c0e('0x8'));var _=require(_0x3c0e('0x9'));var squel=require(_0x3c0e('0xa'));var crypto=require(_0x3c0e('0xb'));var jsforce=require(_0x3c0e('0xc'));var deskjs=require(_0x3c0e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3c0e('0xe'));var Papa=require(_0x3c0e('0xf'));var Redis=require(_0x3c0e('0x10'));var authService=require(_0x3c0e('0x11'));var qs=require(_0x3c0e('0x12'));var as=require(_0x3c0e('0x13'));var pdf=require(_0x3c0e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c0e('0x15'))(_0x3c0e('0x16'));var utils=require(_0x3c0e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3c0e('0x18'));var db=require(_0x3c0e('0x19'))['db'];config[_0x3c0e('0x1a')]=_['defaults'](config[_0x3c0e('0x1a')],{'host':_0x3c0e('0x1b'),'port':0x18eb});var socket=require(_0x3c0e('0x1c'))(new Redis(config[_0x3c0e('0x1a')]));require('./openchannelInteraction.socket')[_0x3c0e('0x1d')](socket);function respondWithStatusCode(_0x877dd,_0xa50260){_0xa50260=_0xa50260||0xcc;return function(_0x2d483c){if(_0x2d483c){return _0x877dd['sendStatus'](_0xa50260);}return _0x877dd['status'](_0xa50260)[_0x3c0e('0x1e')]();};}function respondWithResult(_0x55117a,_0x527549){_0x527549=_0x527549||0xc8;return function(_0x11d2fc){if(_0x11d2fc){return _0x55117a[_0x3c0e('0x1f')](_0x527549)[_0x3c0e('0x20')](_0x11d2fc);}};}function respondWithFilteredResult(_0x570b7c,_0x22f298){return function(_0x203b6c){if(_0x203b6c){var _0x41cfae=typeof _0x22f298[_0x3c0e('0x21')]===_0x3c0e('0x22')&&typeof _0x22f298[_0x3c0e('0x23')]===_0x3c0e('0x22');var _0xe37d6f=_0x203b6c[_0x3c0e('0x24')];var _0x1c6d66=_0x41cfae?0x0:_0x22f298['offset'];var _0x53fb2a=_0x41cfae?_0x203b6c[_0x3c0e('0x24')]:_0x22f298[_0x3c0e('0x21')]+_0x22f298['limit'];var _0x495ddf;if(_0x53fb2a>=_0xe37d6f){_0x53fb2a=_0xe37d6f;_0x495ddf=0xc8;}else{_0x495ddf=0xce;}_0x570b7c[_0x3c0e('0x1f')](_0x495ddf);return _0x570b7c['set'](_0x3c0e('0x25'),_0x1c6d66+'-'+_0x53fb2a+'/'+_0xe37d6f)['json'](_0x203b6c);}return null;};}function patchUpdates(_0xa647b6){return function(_0x1c3962){try{jsonpatch[_0x3c0e('0x26')](_0x1c3962,_0xa647b6,!![]);}catch(_0x48fbaa){return BPromise[_0x3c0e('0x27')](_0x48fbaa);}return _0x1c3962['save']();};}function saveUpdates(_0x228770,_0x553f07){return function(_0x18cdb2){if(_0x18cdb2){return _0x18cdb2['update'](_0x228770)[_0x3c0e('0x28')](function(_0x3adbfa){return _0x3adbfa;});}return null;};}function removeEntity(_0x3c3b6d,_0x5706ac){return function(_0x17d26a){if(_0x17d26a){return _0x17d26a[_0x3c0e('0x29')]()[_0x3c0e('0x28')](function(){_0x3c3b6d[_0x3c0e('0x1f')](0xcc)[_0x3c0e('0x1e')]();});}};}function handleEntityNotFound(_0x40318d,_0x418459){return function(_0x19cf53){if(!_0x19cf53){_0x40318d[_0x3c0e('0x2a')](0x194);}return _0x19cf53;};}function handleError(_0x457dfb,_0x2470d5){_0x2470d5=_0x2470d5||0x1f4;return function(_0x3c51df){logger['error'](_0x3c51df[_0x3c0e('0x2b')]);if(_0x3c51df[_0x3c0e('0x2c')]){delete _0x3c51df[_0x3c0e('0x2c')];}_0x457dfb[_0x3c0e('0x1f')](_0x2470d5)[_0x3c0e('0x2d')](_0x3c51df);};}function getInteractionUsers(_0x25336b,_0x145e00){return new BPromise(function(_0x495b14,_0x53815b){try{if(_0x145e00[_0x25336b['id']]){_0x25336b['Users']=_['map'](_0x145e00[_0x25336b['id']],function(_0x443414){return{'id':_0x443414['id'],'fullname':_0x443414[_0x3c0e('0x2e')]};});}}catch(_0x5df156){_0x53815b(_0x5df156);}_0x495b14(_0x25336b);});}function getInteractionTags(_0x399850,_0x27d408){return new BPromise(function(_0x3f4c92,_0x4c77e5){try{if(_0x399850['TagIds']){_0x399850[_0x3c0e('0x2f')]=[];_0x399850[_0x3c0e('0x30')]['split'](',')[_0x3c0e('0x31')](function(_0x490aab){_0x399850[_0x3c0e('0x2f')][_0x3c0e('0x32')](_0x27d408[_0x490aab]);});}delete _0x399850[_0x3c0e('0x30')];}catch(_0x7c4c43){_0x4c77e5(_0x7c4c43);}_0x3f4c92(_0x399850);});}function updateOpenchannelInteraction(_0x5f0e43,_0x5d8205,_0x49755c){return new BPromise(function(_0x3030a9,_0x3e93bd){return getInteractionUsers(_0x5f0e43,_0x49755c)[_0x3c0e('0x28')](function(_0x2baa61){return getInteractionTags(_0x2baa61,_0x5d8205);})[_0x3c0e('0x28')](function(_0x449656){_0x3030a9(_0x449656);})[_0x3c0e('0x33')](function(_0x4d1b69){_0x3e93bd(_0x4d1b69);});});}exports[_0x3c0e('0x34')]=function(_0x208604,_0x56b1a4){var _0x5c3270={},_0x530875={},_0x3eb8ee={'count':0x0,'rows':[]};var _0x5f1f7e=_['map'](db[_0x3c0e('0x35')][_0x3c0e('0x36')],function(_0x1d5aea){return{'name':_0x1d5aea[_0x3c0e('0x37')],'type':_0x1d5aea[_0x3c0e('0x38')][_0x3c0e('0x39')]};});_0x530875[_0x3c0e('0x3a')]=_[_0x3c0e('0x3b')](_0x5f1f7e,_0x3c0e('0x2c'));_0x530875[_0x3c0e('0x3c')]=_[_0x3c0e('0x3d')](_0x208604[_0x3c0e('0x3c')]);_0x530875[_0x3c0e('0x3e')]=_[_0x3c0e('0x3f')](_0x530875[_0x3c0e('0x3a')],_0x530875[_0x3c0e('0x3c')]);_0x5c3270[_0x3c0e('0x40')]=_[_0x3c0e('0x3f')](_0x530875[_0x3c0e('0x3a')],qs[_0x3c0e('0x41')](_0x208604[_0x3c0e('0x3c')]['fields']));_0x5c3270['attributes']=_0x5c3270[_0x3c0e('0x40')][_0x3c0e('0x42')]?_0x5c3270['attributes']:_0x530875[_0x3c0e('0x3a')];if(!_0x208604[_0x3c0e('0x3c')][_0x3c0e('0x43')]('nolimit')){_0x5c3270['limit']=qs[_0x3c0e('0x23')](_0x208604[_0x3c0e('0x3c')][_0x3c0e('0x23')]);_0x5c3270[_0x3c0e('0x21')]=qs[_0x3c0e('0x21')](_0x208604[_0x3c0e('0x3c')][_0x3c0e('0x21')]);}_0x5c3270[_0x3c0e('0x44')]=qs[_0x3c0e('0x45')](_0x208604[_0x3c0e('0x3c')]['sort']);_0x5c3270['where']=qs['filters'](_['pick'](_0x208604['query'],_0x530875[_0x3c0e('0x3e')]),_0x5f1f7e);var _0xf9db34=[];var _0x62d731=squel[_0x3c0e('0x46')]()['field']('id')[_0x3c0e('0x47')]('name')[_0x3c0e('0x47')](_0x3c0e('0x48'))[_0x3c0e('0x49')](_0x3c0e('0x4a'));var _0x5c4006=squel[_0x3c0e('0x46')]()[_0x3c0e('0x47')](_0x3c0e('0x4b'))[_0x3c0e('0x47')](_0x3c0e('0x4c'))[_0x3c0e('0x47')](_0x3c0e('0x4d'))['from']('user_has_openchannel_interactions','ui')['left_join'](_0x3c0e('0x4e'),'u',_0x3c0e('0x4f'));var _0x24073a=squel[_0x3c0e('0x46')]()[_0x3c0e('0x49')](_0x3c0e('0x50'),'i')[_0x3c0e('0x51')](_0x3c0e('0x52'),'c',_0x3c0e('0x53'))[_0x3c0e('0x51')](_0x3c0e('0x4e'),'o',_0x3c0e('0x54'))[_0x3c0e('0x51')](_0x3c0e('0x55'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x3c0e('0x51')]('openchannel_messages','me',_0x3c0e('0x56'))[_0x3c0e('0x51')](_0x3c0e('0x57'),'it',_0x3c0e('0x58'))[_0x3c0e('0x51')](_0x3c0e('0x4a'),'t','t.id\x20=\x20it.TagId');var _0x3abfba=squel['expr']();var _0x52d983=[];var _0x49988f=squel[_0x3c0e('0x59')]();var _0x4a23c1;if(_0x208604[_0x3c0e('0x3c')][_0x3c0e('0x5a')]){_0x4a23c1=as['parseSearch'](_0x208604[_0x3c0e('0x3c')][_0x3c0e('0x5a')]);var _0xcfcb5c=_0x4a23c1[_0x3c0e('0x5b')];for(var _0x1020e4=0x0;_0x1020e4<_0x4a23c1[_0x3c0e('0x5c')][_0x3c0e('0x42')];_0x1020e4++){var _0x34739d=_0x4a23c1['conditions'][_0x1020e4];var _0x43e005='i';var _0x4ff705=_['find'](_0x5f1f7e,['name',_0x34739d[_0x3c0e('0x47')]]);if(!_0x4ff705){switch(_0x34739d['field']){case _0x3c0e('0x5d'):if(_0x34739d['value']==0x1){_0x24073a[_0x3c0e('0x5e')]('`'+_0x34739d['field']+_0x3c0e('0x5f'));}else{_0x24073a[_0x3c0e('0x5e')]('`'+_0x34739d[_0x3c0e('0x47')]+_0x3c0e('0x60'));}break;case _0x3c0e('0x61'):if(_0x34739d['operator']===_0x3c0e('0x62')){if(_0x34739d['value']['split']('\x20')[_0x3c0e('0x42')]>0x1){_0x3abfba[_0xcfcb5c](_0x3c0e('0x63'),qs[_0x3c0e('0x64')](_0x34739d[_0x3c0e('0x65')]),null);}else{var _0x112be6='%'+_0x34739d[_0x3c0e('0x65')]+'%';_0x3abfba[_0xcfcb5c](_0x3c0e('0x66'),_0x112be6,_0x112be6,_0x112be6);}}else{_0x4ff705=_[_0x3c0e('0x67')](_0x5f1f7e,[_0x3c0e('0x2c'),'ContactId']);_0x34739d[_0x3c0e('0x47')]=_0x3c0e('0x68');_0x3574ae=as[_0x3c0e('0x69')](_0x43e005,_0x4ff705[_0x3c0e('0x38')],_0x34739d);_0x3abfba[_0xcfcb5c](_0x3574ae[_0x3c0e('0x6a')],_0x3574ae[_0x3c0e('0x65')][_0x3c0e('0x6b')],_0x3574ae[_0x3c0e('0x65')][_0x3c0e('0x1e')]);}break;case'Tag':var _0x4bcd0a=_0x34739d['value'][_0x3c0e('0x6c')](',')[_0x3c0e('0x3b')](function(_0x3f2b0c){return Number(_0x3f2b0c);});_0x4bcd0a[_0x3c0e('0x31')](function(_0x346043){_0x49988f['or'](_0x3c0e('0x6d'),'%,'+_0x346043+',%');});_0x52d983=_[_0x3c0e('0x6e')](_0x52d983,_0x4bcd0a);break;case _0x3c0e('0x6f'):if(_0x34739d[_0x3c0e('0x70')]===_0x3c0e('0x62')){_0x3abfba[_0xcfcb5c](_0x3c0e('0x71'),'%'+_0x34739d['value']+'%',null);}else{_0x4ff705=_[_0x3c0e('0x67')](_0x5f1f7e,[_0x3c0e('0x2c'),_0x3c0e('0x72')]);_0x34739d[_0x3c0e('0x47')]=_0x3c0e('0x72');_0x3574ae=as['buildExpression'](_0x43e005,_0x4ff705[_0x3c0e('0x38')],_0x34739d);_0x3abfba[_0xcfcb5c](_0x3574ae[_0x3c0e('0x6a')],_0x3574ae[_0x3c0e('0x65')][_0x3c0e('0x6b')],_0x3574ae[_0x3c0e('0x65')][_0x3c0e('0x1e')]);}break;case _0x3c0e('0x73'):_0x3574ae=as[_0x3c0e('0x69')]('me',null,_0x34739d);_0x3abfba[_0xcfcb5c](_0x3574ae[_0x3c0e('0x6a')],_0x3574ae[_0x3c0e('0x65')][_0x3c0e('0x6b')],_0x3574ae[_0x3c0e('0x65')][_0x3c0e('0x1e')]);break;}}else{var _0x3574ae=as['buildExpression'](_0x43e005,_0x4ff705[_0x3c0e('0x38')],_0x34739d);_0x3abfba[_0xcfcb5c](_0x3574ae[_0x3c0e('0x6a')],_0x3574ae['value'][_0x3c0e('0x6b')],_0x3574ae['value'][_0x3c0e('0x1e')]);}}}else{var _0x509891=_(_0x208604[_0x3c0e('0x3c')])[_0x3c0e('0x3d')]()[_0x3c0e('0x3b')](function(_0x4c82fd){return _[_0x3c0e('0x74')](_0x5f1f7e,[_0x3c0e('0x2c'),_0x4c82fd])?_0x4c82fd:undefined;})[_0x3c0e('0x75')]()[_0x3c0e('0x65')]();if(!_[_0x3c0e('0x76')](_0x509891)){_0x509891['forEach'](function(_0xd1c909){if(_0xd1c909==='OpenchannelAccountId'){_0x24073a[_0x3c0e('0x77')](_0x3c0e('0x78'),[][_0x3c0e('0x79')](_0x208604[_0x3c0e('0x3c')][_0xd1c909]));}else if(_0xd1c909===_0x3c0e('0x7a')){var _0x20dbd6=JSON[_0x3c0e('0x7b')](_0x208604['query'][_0xd1c909])[_0x3c0e('0x7c')];var _0x37d0d1=JSON[_0x3c0e('0x7b')](_0x208604[_0x3c0e('0x3c')][_0xd1c909])[_0x3c0e('0x7d')];_0x24073a['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x20dbd6,_0x37d0d1);}else{if(_0x208604[_0x3c0e('0x3c')][_0xd1c909]==='null'){_0x24073a['where']('i.'+_0xd1c909+'\x20IS\x20NULL');}else{_0x24073a['where']('i.'+_0xd1c909+_0x3c0e('0x7e'),_0x208604['query'][_0xd1c909]);}}});}if(_0x208604[_0x3c0e('0x3c')][_0x3c0e('0x7f')]){if(_0x208604['query'][_0x3c0e('0x7f')]==0x1){_0x24073a['having']('`unreadMessages`\x20=\x200');}else{_0x24073a[_0x3c0e('0x5e')](_0x3c0e('0x80'));}}if(_0x208604[_0x3c0e('0x3c')][_0x3c0e('0x81')]){_0x52d983=_[_0x3c0e('0x82')](_0x208604[_0x3c0e('0x3c')][_0x3c0e('0x81')])?_0x208604['query']['tag']:new Array(_0x208604[_0x3c0e('0x3c')][_0x3c0e('0x81')]);_0x52d983[_0x3c0e('0x31')](function(_0x5add27){_0x49988f['or'](_0x3c0e('0x6d'),'%,'+_0x5add27+',%');});}if(_0x208604[_0x3c0e('0x3c')][_0x3c0e('0x83')]){var _0x25c5dd=_0x208604[_0x3c0e('0x3c')]['filter']['replace']('\x5c','\x5c\x5c')[_0x3c0e('0x84')](/'/g,'\x27\x27');if(qs[_0x3c0e('0x85')](_0x25c5dd)){_0x3abfba['or'](_0x3c0e('0x86'),_0x25c5dd+'%');}else{_0x3abfba['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3c0e('0x64')](_0x25c5dd))['or']('i.from\x20LIKE\x20?',_0x25c5dd+'%')['or'](_0x3c0e('0x87'),_0x25c5dd+'%');}}}_0x24073a['where'](_0x3abfba);_0x24073a[_0x3c0e('0x88')](_0x3c0e('0x89'));var _0xb96c78={'type':db[_0x3c0e('0x8a')][_0x3c0e('0x8b')][_0x3c0e('0x8c')],'raw':!![]};var _0x12b40f=_0x24073a[_0x3c0e('0x8d')]();_0x12b40f['field'](_0x3c0e('0x89'));_0x12b40f[_0x3c0e('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3c0e('0x5d'));if(_0x5c3270[_0x3c0e('0x44')]){_0x5c3270[_0x3c0e('0x44')][_0x3c0e('0x31')](function(_0x128e82){var _0x451463=_0x128e82[0x0]==='contactName'?_0x128e82[0x0]:'i.'+_0x128e82[0x0];_0x24073a[_0x3c0e('0x44')](_0x451463,_0x128e82[0x1]===_0x3c0e('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0x52d983)){_0x24073a['having'](_0x49988f);_0x12b40f[_0x3c0e('0x77')](_0x3c0e('0x8f'),_0x52d983);}BPromise['resolve']()[_0x3c0e('0x28')](function(){if(!_0x4a23c1){if(_0x208604['query']['OpenchannelAccountId'])return;_0x12b40f[_0x3c0e('0x77')](_0x3c0e('0x90'));_0x24073a[_0x3c0e('0x77')](_0x3c0e('0x90'));return;}if(_0x208604[_0x3c0e('0x91')][_0x3c0e('0x92')]!==_0x3c0e('0x93'))return;return _0x208604[_0x3c0e('0x91')][_0x3c0e('0x94')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1488f0){if(_['isEmpty'](_0x1488f0)){_0x12b40f[_0x3c0e('0x77')](_0x3c0e('0x95'));_0x24073a[_0x3c0e('0x77')](_0x3c0e('0x95'));}else{_0x12b40f[_0x3c0e('0x77')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x3c0e('0x3b')](_0x1488f0,'id'));_0x24073a[_0x3c0e('0x77')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x3c0e('0x3b')](_0x1488f0,'id'));}});})[_0x3c0e('0x28')](function(){if(_0x208604[_0x3c0e('0x91')][_0x3c0e('0x92')]===_0x3c0e('0x93')&&!_0x4a23c1&&!_0x208604[_0x3c0e('0x3c')][_0x3c0e('0x96')])return[];return db['sequelize'][_0x3c0e('0x3c')](_0x12b40f['toString'](),_0xb96c78);})[_0x3c0e('0x28')](function(_0x555804){_0x3eb8ee[_0x3c0e('0x24')]=_0x555804['length'];if(_0x3eb8ee[_0x3c0e('0x24')]===0x0)return[];return db['sequelize'][_0x3c0e('0x3c')](_0x62d731[_0x3c0e('0x97')](),_0xb96c78)[_0x3c0e('0x28')](function(_0x37f99f){_0xf9db34=_[_0x3c0e('0x98')](_0x37f99f,'id');_0xb96c78=_['merge'](_0xb96c78,{'model':db[_0x3c0e('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x208604[_0x3c0e('0x3c')][_0x3c0e('0x41')]){_0x5c3270[_0x3c0e('0x40')]['forEach'](function(_0x1043a9){_0x24073a['field']('i.'+_0x1043a9);});}else{_0x24073a[_0x3c0e('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3c0e('0x5d'));_0x24073a[_0x3c0e('0x47')](_0x3c0e('0x99'),_0x3c0e('0x9a'));_0x24073a[_0x3c0e('0x47')](_0x3c0e('0x9b'),'Account.mandatoryDisposition');_0x24073a['field']('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x24073a[_0x3c0e('0x47')](_0x3c0e('0x9c'));_0x24073a[_0x3c0e('0x47')]('c.firstName',_0x3c0e('0x9d'));_0x24073a[_0x3c0e('0x47')](_0x3c0e('0x9e'),_0x3c0e('0x9f'));_0x24073a['field']('c.email',_0x3c0e('0xa0'));_0x24073a[_0x3c0e('0x47')](_0x3c0e('0xa1'),_0x3c0e('0xa2'));_0x24073a[_0x3c0e('0x47')]('c.mobile',_0x3c0e('0xa3'));_0x24073a['field'](_0x3c0e('0xa4'),'Contact.fax');_0x24073a['field'](_0x3c0e('0xa5'),_0x3c0e('0xa6'));_0x24073a[_0x3c0e('0x47')](_0x3c0e('0xa7'),_0x3c0e('0xa8'));_0x24073a[_0x3c0e('0x47')](_0x3c0e('0xa9'),_0x3c0e('0x30'));}if(_0x5c3270[_0x3c0e('0x23')])_0x24073a[_0x3c0e('0x23')](_0x5c3270[_0x3c0e('0x23')]);if(_0x5c3270[_0x3c0e('0x21')])_0x24073a[_0x3c0e('0x21')](_0x5c3270['offset']);return db[_0x3c0e('0xaa')][_0x3c0e('0x3c')](_0x24073a['toString'](),_0xb96c78);})[_0x3c0e('0x28')](function(_0xd8168e){if(_0xd8168e[_0x3c0e('0x42')]>0x0)_0x5c4006[_0x3c0e('0x77')](_0x3c0e('0xab'),_[_0x3c0e('0x3b')](_0xd8168e,'id'));return db[_0x3c0e('0xaa')][_0x3c0e('0x3c')](_0x5c4006['toString'](),_0xb96c78)['then'](function(_0x4a67ef){var _0x247170=_['groupBy'](_0x4a67ef,_0x3c0e('0xac'));var _0x353089=[];_0xd8168e[_0x3c0e('0x31')](function(_0x26d610){_0x353089[_0x3c0e('0x32')](updateOpenchannelInteraction(_0x26d610,_0xf9db34,_0x247170));});return BPromise['all'](_0x353089);});});})[_0x3c0e('0x28')](function(_0x2410ee){_0x3eb8ee[_0x3c0e('0xad')]=_0x2410ee;return _0x3eb8ee;})[_0x3c0e('0x28')](respondWithFilteredResult(_0x56b1a4,_0x5c3270))[_0x3c0e('0x33')](handleError(_0x56b1a4,null));};exports[_0x3c0e('0xae')]=function(_0x16c128,_0xd8e348){var _0x44ece6={};if(_0x16c128[_0x3c0e('0x3c')]['type']&&_0x16c128[_0x3c0e('0x3c')][_0x3c0e('0x38')]===_0x3c0e('0x49')){_0x44ece6[_0x3c0e('0x49')]=_0x16c128['params']['id'];}else{_0x44ece6['id']=_0x16c128['params']['id'];}var _0xb96c3c={'raw':![],'where':_0x44ece6},_0x15e2d0={};_0x15e2d0[_0x3c0e('0x3a')]=_['keys'](db[_0x3c0e('0x35')][_0x3c0e('0x36')]);_0x15e2d0[_0x3c0e('0x3c')]=_['keys'](_0x16c128[_0x3c0e('0x3c')]);_0x15e2d0[_0x3c0e('0x3e')]=_['intersection'](_0x15e2d0[_0x3c0e('0x3a')],_0x15e2d0[_0x3c0e('0x3c')]);_0xb96c3c[_0x3c0e('0x40')]=_[_0x3c0e('0x3f')](_0x15e2d0[_0x3c0e('0x3a')],qs[_0x3c0e('0x41')](_0x16c128['query'][_0x3c0e('0x41')]));_0xb96c3c[_0x3c0e('0x40')]=_0xb96c3c[_0x3c0e('0x40')][_0x3c0e('0x42')]?_0xb96c3c[_0x3c0e('0x40')]:_0x15e2d0['model'];if(_0x16c128[_0x3c0e('0x3c')]['includeAll']){_0xb96c3c['include']=[{'all':!![]}];}_0xb96c3c=_[_0x3c0e('0xaf')]({},_0xb96c3c,_0x16c128[_0x3c0e('0xb0')]);return db[_0x3c0e('0x35')][_0x3c0e('0x67')](_0xb96c3c)['then'](handleEntityNotFound(_0xd8e348,null))[_0x3c0e('0x28')](respondWithResult(_0xd8e348,null))['catch'](handleError(_0xd8e348,null));};exports[_0x3c0e('0xb1')]=function(_0x51f76c,_0x7df659){return db[_0x3c0e('0x35')][_0x3c0e('0xb1')](_0x51f76c[_0x3c0e('0x73')],{})[_0x3c0e('0x28')](respondWithResult(_0x7df659,0xc9))[_0x3c0e('0x33')](handleError(_0x7df659,null));};exports[_0x3c0e('0xb2')]=function(_0x257cd9,_0x4a7102){if(_0x257cd9[_0x3c0e('0x73')]['id']){delete _0x257cd9['body']['id'];}return db[_0x3c0e('0x35')][_0x3c0e('0x67')]({'where':{'id':_0x257cd9[_0x3c0e('0xb3')]['id']}})[_0x3c0e('0x28')](handleEntityNotFound(_0x4a7102,null))['then'](saveUpdates(_0x257cd9[_0x3c0e('0x73')],null))[_0x3c0e('0x28')](respondWithResult(_0x4a7102,null))[_0x3c0e('0x33')](handleError(_0x4a7102,null));};exports[_0x3c0e('0x29')]=function(_0x58cbdb,_0x50893c){return db['OpenchannelInteraction']['find']({'where':{'id':_0x58cbdb[_0x3c0e('0xb3')]['id']}})[_0x3c0e('0x28')](handleEntityNotFound(_0x50893c,null))[_0x3c0e('0x28')](removeEntity(_0x50893c,null))[_0x3c0e('0x33')](handleError(_0x50893c,null));};exports[_0x3c0e('0xb4')]=function(_0x55e4b5,_0x568e60){return db[_0x3c0e('0x35')][_0x3c0e('0xb4')]()[_0x3c0e('0x28')](respondWithResult(_0x568e60,null))['catch'](handleError(_0x568e60,null));};exports[_0x3c0e('0xb5')]=function(_0x2fb737,_0x4566d7,_0x2f1776){return db[_0x3c0e('0xb6')][_0x3c0e('0x67')]({'where':{'id':_0x2fb737[_0x3c0e('0xb3')]['id']}})[_0x3c0e('0x28')](handleEntityNotFound(_0x4566d7,null))[_0x3c0e('0x28')](function(_0x31da6c){if(_0x31da6c){return _0x31da6c[_0x3c0e('0xb5')](_0x2fb737[_0x3c0e('0x73')][_0x3c0e('0xb7')],_[_0x3c0e('0xb8')](_0x2fb737[_0x3c0e('0x73')],['ids','id'])||{});}})[_0x3c0e('0x28')](respondWithResult(_0x4566d7,null))[_0x3c0e('0x33')](handleError(_0x4566d7,null));};exports['getMessages']=function(_0x4eaa6d,_0x1c5998,_0x3a3a8d){var _0x3ca89b={'raw':![],'where':{}};var _0x2c7b3e={};var _0x300740={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x4eaa6d['params']['id']}})[_0x3c0e('0x28')](handleEntityNotFound(_0x1c5998,null))[_0x3c0e('0x28')](function(_0x204795){if(_0x204795){_0x2c7b3e['model']=_[_0x3c0e('0x3d')](db[_0x3c0e('0xb6')][_0x3c0e('0x36')]);_0x2c7b3e[_0x3c0e('0x3c')]=_[_0x3c0e('0x3d')](_0x4eaa6d[_0x3c0e('0x3c')]);_0x2c7b3e[_0x3c0e('0x3e')]=_[_0x3c0e('0x3f')](_0x2c7b3e[_0x3c0e('0x3a')],_0x2c7b3e[_0x3c0e('0x3c')]);_0x3ca89b[_0x3c0e('0x40')]=_[_0x3c0e('0x3f')](_0x2c7b3e[_0x3c0e('0x3a')],qs[_0x3c0e('0x41')](_0x4eaa6d[_0x3c0e('0x3c')][_0x3c0e('0x41')]));_0x3ca89b[_0x3c0e('0x40')]=_0x3ca89b[_0x3c0e('0x40')]['length']?_0x3ca89b[_0x3c0e('0x40')]:_0x2c7b3e[_0x3c0e('0x3a')];if(!_0x4eaa6d[_0x3c0e('0x3c')][_0x3c0e('0x43')](_0x3c0e('0xb9'))){_0x3ca89b[_0x3c0e('0x23')]=qs[_0x3c0e('0x23')](_0x4eaa6d['query']['limit']);_0x3ca89b[_0x3c0e('0x21')]=qs[_0x3c0e('0x21')](_0x4eaa6d[_0x3c0e('0x3c')][_0x3c0e('0x21')]);}_0x3ca89b[_0x3c0e('0x44')]=qs[_0x3c0e('0x45')](_0x4eaa6d[_0x3c0e('0x3c')]['sort']);_0x3ca89b[_0x3c0e('0x77')]=qs[_0x3c0e('0x3e')](_['pick'](_0x4eaa6d[_0x3c0e('0x3c')],_0x2c7b3e['filters']));_0x3ca89b['where'][_0x3c0e('0xac')]=_0x204795['id'];if(_0x4eaa6d[_0x3c0e('0x3c')][_0x3c0e('0x83')]){_0x3ca89b['where']=_[_0x3c0e('0xaf')](_0x3ca89b['where'],{'$or':_[_0x3c0e('0x3b')](_0x3ca89b[_0x3c0e('0x40')],function(_0x59ddd6){var _0x4124e2={};_0x4124e2[_0x59ddd6]={'$like':'%'+_0x4eaa6d['query'][_0x3c0e('0x83')]+'%'};return _0x4124e2;})});}if(_0x4eaa6d[_0x3c0e('0x3c')][_0x3c0e('0x7c')]){var _0xe57b23=_0x4eaa6d[_0x3c0e('0x3c')][_0x3c0e('0x7c')][_0x3c0e('0x6c')](',');var _0x4ddf10={};_0x4ddf10[_0xe57b23[0x0]]={'$gte':moment(_0xe57b23[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3ca89b[_0x3c0e('0x77')]=_[_0x3c0e('0xaf')](_0x3ca89b['where'],_0x4ddf10);}_0x3ca89b=_[_0x3c0e('0xaf')]({},_0x3ca89b,_0x4eaa6d[_0x3c0e('0xb0')]);return db[_0x3c0e('0xb6')][_0x3c0e('0x24')]({'where':_0x3ca89b[_0x3c0e('0x77')]})[_0x3c0e('0x28')](function(_0x24a7b1){_0x300740[_0x3c0e('0x24')]=_0x24a7b1;if(_0x4eaa6d['query'][_0x3c0e('0xba')]){_0x3ca89b[_0x3c0e('0xbb')]=[{'all':!![]}];}return db[_0x3c0e('0xb6')]['findAll'](_0x3ca89b);})[_0x3c0e('0x28')](function(_0x537efa){_0x300740[_0x3c0e('0xad')]=_0x537efa;return _0x300740;});}})['then'](respondWithFilteredResult(_0x1c5998,_0x3ca89b))['catch'](handleError(_0x1c5998,null));};exports[_0x3c0e('0xbc')]=function(_0x55c32e,_0x2480cf,_0x2da5ef){return db[_0x3c0e('0x35')][_0x3c0e('0x67')]({'where':{'id':_0x55c32e[_0x3c0e('0xb3')]['id']}})['then'](handleEntityNotFound(_0x2480cf,null))[_0x3c0e('0x28')](function(_0x552ad3){if(_0x552ad3){return _0x552ad3['setTags'](_0x55c32e['body']['ids'],_[_0x3c0e('0xb8')](_0x55c32e[_0x3c0e('0x73')],[_0x3c0e('0xb7'),'id'])||{})[_0x3c0e('0xbd')](function(){return db[_0x3c0e('0xbe')]['findAll']({'attributes':['id',_0x3c0e('0x2c'),_0x3c0e('0x48')],'where':{'id':_0x55c32e[_0x3c0e('0x73')][_0x3c0e('0xb7')]}});})[_0x3c0e('0x28')](function(_0x3c5ea9){socket['emit'](_0x3c0e('0xbf'),{'id':Number(_0x55c32e[_0x3c0e('0xb3')]['id']),'tags':_0x3c5ea9||[]});return{'id':Number(_0x55c32e['params']['id']),'tags':_0x3c5ea9||[]};});}})[_0x3c0e('0x28')](respondWithResult(_0x2480cf,null))[_0x3c0e('0x33')](handleError(_0x2480cf,null));};exports[_0x3c0e('0xc0')]=function(_0x3b4a4e,_0x42c49b,_0x263410){return db[_0x3c0e('0x35')][_0x3c0e('0x67')]({'where':{'id':_0x3b4a4e[_0x3c0e('0xb3')]['id']}})[_0x3c0e('0x28')](handleEntityNotFound(_0x42c49b,null))[_0x3c0e('0x28')](function(_0x46d94e){if(_0x46d94e){return _0x46d94e[_0x3c0e('0xc0')](_0x3b4a4e['query'][_0x3c0e('0xb7')]);}})[_0x3c0e('0x28')](respondWithStatusCode(_0x42c49b,null))[_0x3c0e('0x33')](handleError(_0x42c49b,null));};exports[_0x3c0e('0xc1')]=function(_0x130fed,_0x546696){var _0x448b29=moment()[_0x3c0e('0xc2')]()[_0x3c0e('0x97')]();var _0x3492d6=path[_0x3c0e('0xc3')](config[_0x3c0e('0xc4')],_0x3c0e('0xc5'),_0x3c0e('0xc6'),_0x3c0e('0xc7'));var _0x5193aa=path[_0x3c0e('0xc3')](config[_0x3c0e('0xc4')],_0x3c0e('0xc5'),_0x3c0e('0xc6'),_0x3c0e('0xc8'));var _0x4b69e3=path[_0x3c0e('0xc3')](_0x3492d6,_0x448b29);var _0x1f922e=util[_0x3c0e('0xc9')](_0x3c0e('0xca'),_0x130fed[_0x3c0e('0xb3')]['id'],_0x448b29);var _0x3ecfc4=path[_0x3c0e('0xc3')](_0x3492d6,_0x1f922e);var _0x422d01=[];_0x422d01[_0x3c0e('0x32')]({'model':db[_0x3c0e('0x6f')],'as':_0x3c0e('0x6f'),'attributes':['id',_0x3c0e('0x2e')],'raw':!![]});_0x422d01[_0x3c0e('0x32')]({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x130fed[_0x3c0e('0x3c')][_0x3c0e('0xc8')]){_0x422d01[_0x3c0e('0x32')]({'model':db[_0x3c0e('0xcb')],'as':_0x3c0e('0xcb'),'raw':!![]});}var _0xfea585=[{'model':db['OpenchannelMessage'],'as':_0x3c0e('0xcc'),'attributes':['id',_0x3c0e('0x73'),_0x3c0e('0x7a'),_0x3c0e('0xcd'),_0x3c0e('0xce'),_0x3c0e('0x7f')],'include':_0x422d01}];_0xfea585['push']({'model':db[_0x3c0e('0xcf')],'as':_0x3c0e('0xd0'),'attributes':['id',_0x3c0e('0x2c')]});_0xfea585['push']({'model':db[_0x3c0e('0x6f')],'as':_0x3c0e('0xd1'),'attributes':['id','fullname']});return db['OpenchannelInteraction']['find']({'where':{'id':_0x130fed['params']['id']},'include':_0xfea585})[_0x3c0e('0x28')](handleEntityNotFound(_0x546696,null))[_0x3c0e('0x28')](function(_0x332af3){if(_0x332af3){var _0x2e1d11=_0x332af3[_0x3c0e('0xd2')]({'plain':!![]});fs['mkdirSync'](_0x4b69e3);var _0x2fe7a1={'channel':'Openchannel','account':_0x2e1d11[_0x3c0e('0xd0')][_0x3c0e('0x2c')],'agent':_0x2e1d11[_0x3c0e('0xd1')]?_0x2e1d11[_0x3c0e('0xd1')][_0x3c0e('0x2e')]:_0x3c0e('0xd3'),'createdAt':moment(_0x2e1d11['createdAt'])[_0x3c0e('0xc9')](_0x3c0e('0xd4'))[_0x3c0e('0x97')](),'closedAt':_0x2e1d11[_0x3c0e('0xd5')]?moment(_0x2e1d11[_0x3c0e('0xd6')])[_0x3c0e('0xc9')](_0x3c0e('0xd4'))[_0x3c0e('0x97')]():'','disposition':_0x2e1d11['disposition'],'visibility':_0x2e1d11[_0x3c0e('0xd7')]?'Public':'Private','messages':_(_0x2e1d11[_0x3c0e('0xcc')])[_0x3c0e('0x83')]({'secret':![]})[_0x3c0e('0x3b')](function(_0x54b8e7){if(_0x54b8e7['Attachment']){var _0x3d2a34=path[_0x3c0e('0xc3')](_0x5193aa,_0x54b8e7['Attachment']['basename']);if(fs['existsSync'](_0x3d2a34)){fs[_0x3c0e('0xd8')](_0x3d2a34)['pipe'](fs['createWriteStream'](path['join'](_0x4b69e3,_0x54b8e7[_0x3c0e('0xcb')]['basename'])));}}return{'date':moment(_0x54b8e7[_0x3c0e('0x7a')])[_0x3c0e('0xc9')](_0x3c0e('0xd4'))[_0x3c0e('0x97')](),'sender':_0x54b8e7[_0x3c0e('0xcd')]===_0x3c0e('0xd9')?_0x54b8e7[_0x3c0e('0x6f')]?_0x54b8e7['User'][_0x3c0e('0x2e')]:_0x3c0e('0xda'):_0x54b8e7[_0x3c0e('0x61')]['firstName']+(_0x54b8e7[_0x3c0e('0x61')][_0x3c0e('0xdb')]?'\x20'+_0x54b8e7[_0x3c0e('0x61')][_0x3c0e('0xdb')]:''),'body':_0x54b8e7[_0x3c0e('0xcb')]?_0x54b8e7[_0x3c0e('0xcb')]['basename']:_0x54b8e7[_0x3c0e('0x73')],'direction':_0x54b8e7['direction']==='out'?'A':'C','secret':_0x54b8e7[_0x3c0e('0xce')],'read':_0x54b8e7['read'],'attachment':_0x54b8e7[_0x3c0e('0xcb')]};})[_0x3c0e('0x65')]()};return ejs['renderFile'](path[_0x3c0e('0xc3')](config['root'],_0x3c0e('0xc5'),_0x3c0e('0xdc'),_0x3c0e('0xdd')),{'interaction':_0x2fe7a1})[_0x3c0e('0x28')](function(_0xd65683){var _0x3e4ca4=path[_0x3c0e('0xc3')](_0x4b69e3,_0x3c0e('0xde')+_0x2e1d11['id']+'-'+_0x448b29+_0x3c0e('0xdf'));var _0x18aca2={'path':_0x3e4ca4,'channel':_0x3c0e('0xe0'),'interactionId':_0x2e1d11['id']};return pdf[_0x3c0e('0xe1')](_0xd65683,_0x18aca2);})['then'](function(){return new BPromise(function(_0x2aafec,_0x4ba2d1){zipdir(_0x4b69e3,{'saveTo':_0x3ecfc4},function(_0x9eb9e3,_0x5d8385){if(_0x9eb9e3)return _0x4ba2d1(_0x9eb9e3);return _0x2aafec(_0x5d8385);});})[_0x3c0e('0x28')](function(){return new BPromise(function(_0x305c31,_0x51360c){rimraf(_0x4b69e3,function(_0x22d1ba){if(_0x22d1ba)_0x51360c(_0x22d1ba);return _0x305c31();});});})[_0x3c0e('0x28')](function(){return _0x546696[_0x3c0e('0xc1')](_0x3ecfc4,_0x1f922e,function(_0x4e44d3){if(_0x4e44d3){console[_0x3c0e('0xe2')](_0x3c0e('0xe3'),_0x4e44d3);}else{fs[_0x3c0e('0xe4')](_0x3ecfc4);}});});});}else{return _0x546696['sendStatus'](0xc8);}})[_0x3c0e('0x33')](handleError(_0x546696,null));}; \ No newline at end of file +var _0xc86d=['OpenchannelInteractionId','show','params','includeAll','include','options','create','describe','OpenchannelMessage','addMessage','omit','ids','getMessages','findOne','nolimit','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','setTags','emit','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','Attachment','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','closed','closedAt','format','threadId','Private','pipe','createWriteStream','basename','out','System','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','then','destroy','stack','name','Users','TagIds','split','forEach','Tags','push','catch','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','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?','find','ContactId','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?','UserId','buildExpression','body','some','compact','isEmpty','OpenchannelAccountId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','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)','i.from\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','count','keyBy','merge','a.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','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','toString','ui.OpenchannelInteractionId\x20IN\x20?','groupBy'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xc86d,0x129));var _0xdc86=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xc86d[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0xdc86('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdc86('0x1'));var rp=require(_0xdc86('0x2'));var moment=require(_0xdc86('0x3'));var BPromise=require(_0xdc86('0x4'));var Mustache=require(_0xdc86('0x5'));var util=require(_0xdc86('0x6'));var path=require('path');var sox=require(_0xdc86('0x7'));var csv=require(_0xdc86('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdc86('0x9'));var _=require('lodash');var squel=require(_0xdc86('0xa'));var crypto=require(_0xdc86('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdc86('0xc'));var toCsv=require(_0xdc86('0x8'));var querystring=require(_0xdc86('0xd'));var Papa=require(_0xdc86('0xe'));var Redis=require(_0xdc86('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdc86('0x10'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xdc86('0x11'));var logger=require(_0xdc86('0x12'))(_0xdc86('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdc86('0x14'));var db=require(_0xdc86('0x15'))['db'];config[_0xdc86('0x16')]=_[_0xdc86('0x17')](config[_0xdc86('0x16')],{'host':_0xdc86('0x18'),'port':0x18eb});var socket=require(_0xdc86('0x19'))(new Redis(config[_0xdc86('0x16')]));require(_0xdc86('0x1a'))[_0xdc86('0x1b')](socket);function respondWithStatusCode(_0x18022e,_0x49d0d0){_0x49d0d0=_0x49d0d0||0xcc;return function(_0x30c717){if(_0x30c717){return _0x18022e[_0xdc86('0x1c')](_0x49d0d0);}return _0x18022e[_0xdc86('0x1d')](_0x49d0d0)[_0xdc86('0x1e')]();};}function respondWithResult(_0x80cb9f,_0x58dccc){_0x58dccc=_0x58dccc||0xc8;return function(_0x1d9392){if(_0x1d9392){return _0x80cb9f[_0xdc86('0x1d')](_0x58dccc)[_0xdc86('0x1f')](_0x1d9392);}};}function respondWithFilteredResult(_0x2127d3,_0x56cfe){return function(_0x2ea84b){if(_0x2ea84b){var _0x5ef8fb=typeof _0x56cfe[_0xdc86('0x20')]==='undefined'&&typeof _0x56cfe[_0xdc86('0x21')]===_0xdc86('0x22');var _0x4d3e70=_0x2ea84b['count'];var _0x2b2a02=_0x5ef8fb?0x0:_0x56cfe['offset'];var _0x5a61e8=_0x5ef8fb?_0x2ea84b['count']:_0x56cfe[_0xdc86('0x20')]+_0x56cfe[_0xdc86('0x21')];var _0x198107;if(_0x5a61e8>=_0x4d3e70){_0x5a61e8=_0x4d3e70;_0x198107=0xc8;}else{_0x198107=0xce;}_0x2127d3[_0xdc86('0x1d')](_0x198107);return _0x2127d3[_0xdc86('0x23')]('Content-Range',_0x2b2a02+'-'+_0x5a61e8+'/'+_0x4d3e70)['json'](_0x2ea84b);}return null;};}function patchUpdates(_0x5093fb){return function(_0x32952e){try{jsonpatch[_0xdc86('0x24')](_0x32952e,_0x5093fb,!![]);}catch(_0x4e06d0){return BPromise[_0xdc86('0x25')](_0x4e06d0);}return _0x32952e[_0xdc86('0x26')]();};}function saveUpdates(_0x117390,_0x5f4f8e){return function(_0x5a0f99){if(_0x5a0f99){return _0x5a0f99['update'](_0x117390)[_0xdc86('0x27')](function(_0x251c46){return _0x251c46;});}return null;};}function removeEntity(_0x3f786e,_0x2415d9){return function(_0xfa2ee9){if(_0xfa2ee9){return _0xfa2ee9[_0xdc86('0x28')]()[_0xdc86('0x27')](function(){_0x3f786e[_0xdc86('0x1d')](0xcc)[_0xdc86('0x1e')]();});}};}function handleEntityNotFound(_0x172f6c,_0x85157b){return function(_0x228097){if(!_0x228097){_0x172f6c[_0xdc86('0x1c')](0x194);}return _0x228097;};}function handleError(_0x23d123,_0x260fc2){_0x260fc2=_0x260fc2||0x1f4;return function(_0x43ad4d){logger['error'](_0x43ad4d[_0xdc86('0x29')]);if(_0x43ad4d[_0xdc86('0x2a')]){delete _0x43ad4d[_0xdc86('0x2a')];}_0x23d123[_0xdc86('0x1d')](_0x260fc2)['send'](_0x43ad4d);};}function getInteractionUsers(_0x1fa08f,_0x1a2f5c){return new BPromise(function(_0x3c2601,_0x4b481e){try{if(_0x1a2f5c[_0x1fa08f['id']]){_0x1fa08f[_0xdc86('0x2b')]=_['map'](_0x1a2f5c[_0x1fa08f['id']],function(_0x73fd5e){return{'id':_0x73fd5e['id'],'fullname':_0x73fd5e['fullname']};});}}catch(_0x310726){_0x4b481e(_0x310726);}_0x3c2601(_0x1fa08f);});}function getInteractionTags(_0x577a6b,_0x5a0f5e){return new BPromise(function(_0x3b9095,_0x26fcd1){try{if(_0x577a6b[_0xdc86('0x2c')]){_0x577a6b['Tags']=[];_0x577a6b[_0xdc86('0x2c')][_0xdc86('0x2d')](',')[_0xdc86('0x2e')](function(_0x3c42ec){_0x577a6b[_0xdc86('0x2f')][_0xdc86('0x30')](_0x5a0f5e[_0x3c42ec]);});}delete _0x577a6b[_0xdc86('0x2c')];}catch(_0x4c2450){_0x26fcd1(_0x4c2450);}_0x3b9095(_0x577a6b);});}function updateOpenchannelInteraction(_0x424788,_0x5bd89b,_0x3578c6){return new BPromise(function(_0x2c3d8f,_0x15cc51){return getInteractionUsers(_0x424788,_0x3578c6)['then'](function(_0x410ab3){return getInteractionTags(_0x410ab3,_0x5bd89b);})[_0xdc86('0x27')](function(_0x1e38c6){_0x2c3d8f(_0x1e38c6);})[_0xdc86('0x31')](function(_0x5b7e9e){_0x15cc51(_0x5b7e9e);});});}exports['index']=function(_0xc4b0ae,_0x21bde3){var _0xe73d13={},_0x52de90={},_0x2e0368={'count':0x0,'rows':[]};var _0x323ed6=_[_0xdc86('0x32')](db[_0xdc86('0x33')][_0xdc86('0x34')],function(_0x176bd1){return{'name':_0x176bd1[_0xdc86('0x35')],'type':_0x176bd1[_0xdc86('0x36')][_0xdc86('0x37')]};});_0x52de90[_0xdc86('0x38')]=_[_0xdc86('0x32')](_0x323ed6,_0xdc86('0x2a'));_0x52de90['query']=_[_0xdc86('0x39')](_0xc4b0ae['query']);_0x52de90['filters']=_[_0xdc86('0x3a')](_0x52de90['model'],_0x52de90[_0xdc86('0x3b')]);_0xe73d13[_0xdc86('0x3c')]=_['intersection'](_0x52de90[_0xdc86('0x38')],qs[_0xdc86('0x3d')](_0xc4b0ae[_0xdc86('0x3b')][_0xdc86('0x3d')]));_0xe73d13['attributes']=_0xe73d13['attributes'][_0xdc86('0x3e')]?_0xe73d13['attributes']:_0x52de90[_0xdc86('0x38')];if(!_0xc4b0ae[_0xdc86('0x3b')][_0xdc86('0x3f')]('nolimit')){_0xe73d13[_0xdc86('0x21')]=qs[_0xdc86('0x21')](_0xc4b0ae[_0xdc86('0x3b')][_0xdc86('0x21')]);_0xe73d13[_0xdc86('0x20')]=qs[_0xdc86('0x20')](_0xc4b0ae[_0xdc86('0x3b')][_0xdc86('0x20')]);}_0xe73d13[_0xdc86('0x40')]=qs['sort'](_0xc4b0ae[_0xdc86('0x3b')][_0xdc86('0x41')]);_0xe73d13[_0xdc86('0x42')]=qs[_0xdc86('0x43')](_['pick'](_0xc4b0ae[_0xdc86('0x3b')],_0x52de90[_0xdc86('0x43')]),_0x323ed6);var _0x16f9e3=[];var _0x27ae0a=squel[_0xdc86('0x44')]()[_0xdc86('0x45')]('id')[_0xdc86('0x45')](_0xdc86('0x2a'))[_0xdc86('0x45')](_0xdc86('0x46'))[_0xdc86('0x47')](_0xdc86('0x48'));var _0x3fdc30=squel[_0xdc86('0x44')]()[_0xdc86('0x45')](_0xdc86('0x49'))[_0xdc86('0x45')](_0xdc86('0x4a'))[_0xdc86('0x45')](_0xdc86('0x4b'))[_0xdc86('0x47')]('user_has_openchannel_interactions','ui')[_0xdc86('0x4c')](_0xdc86('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x31e963=squel[_0xdc86('0x44')]()[_0xdc86('0x47')]('openchannel_interactions','i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xdc86('0x4c')](_0xdc86('0x4d'),'o',_0xdc86('0x4e'))[_0xdc86('0x4c')](_0xdc86('0x4f'),'a',_0xdc86('0x50'))[_0xdc86('0x4c')](_0xdc86('0x51'),'me','me.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0xdc86('0x52'),'it',_0xdc86('0x53'))[_0xdc86('0x4c')](_0xdc86('0x48'),'t','t.id\x20=\x20it.TagId');var _0x157d46=squel[_0xdc86('0x54')]();var _0x56d0d9=[];var _0x199ceb=squel[_0xdc86('0x54')]();var _0x205408;if(_0xc4b0ae[_0xdc86('0x3b')][_0xdc86('0x55')]){_0x205408=as[_0xdc86('0x56')](_0xc4b0ae['query']['search']);var _0x57ac70=_0x205408['sqlOperator'];for(var _0x1c6553=0x0;_0x1c6553<_0x205408['conditions']['length'];_0x1c6553++){var _0x96968e=_0x205408['conditions'][_0x1c6553];var _0x4b5b24='i';var _0x3bab31=_['find'](_0x323ed6,['name',_0x96968e[_0xdc86('0x45')]]);if(!_0x3bab31){switch(_0x96968e['field']){case'unreadMessages':if(_0x96968e[_0xdc86('0x57')]==0x1){_0x31e963[_0xdc86('0x58')]('`'+_0x96968e[_0xdc86('0x45')]+_0xdc86('0x59'));}else{_0x31e963[_0xdc86('0x58')]('`'+_0x96968e[_0xdc86('0x45')]+_0xdc86('0x5a'));}break;case _0xdc86('0x5b'):if(_0x96968e[_0xdc86('0x5c')]===_0xdc86('0x5d')){if(_0x96968e[_0xdc86('0x57')]['split']('\x20')[_0xdc86('0x3e')]>0x1){_0x157d46[_0x57ac70](_0xdc86('0x5e'),qs[_0xdc86('0x5f')](_0x96968e[_0xdc86('0x57')]),null);}else{var _0x5340ec='%'+_0x96968e['value']+'%';_0x157d46[_0x57ac70](_0xdc86('0x60'),_0x5340ec,_0x5340ec,_0x5340ec);}}else{_0x3bab31=_[_0xdc86('0x61')](_0x323ed6,[_0xdc86('0x2a'),'ContactId']);_0x96968e['field']=_0xdc86('0x62');_0x439543=as['buildExpression'](_0x4b5b24,_0x3bab31[_0xdc86('0x36')],_0x96968e);_0x157d46[_0x57ac70](_0x439543[_0xdc86('0x63')],_0x439543['value'][_0xdc86('0x64')],_0x439543[_0xdc86('0x57')][_0xdc86('0x1e')]);}break;case _0xdc86('0x65'):var _0xd790f8=_0x96968e[_0xdc86('0x57')][_0xdc86('0x2d')](',')[_0xdc86('0x32')](function(_0xaf3b54){return Number(_0xaf3b54);});_0xd790f8[_0xdc86('0x2e')](function(_0x5a8dc2){_0x199ceb['or'](_0xdc86('0x66'),'%,'+_0x5a8dc2+',%');});_0x56d0d9=_[_0xdc86('0x67')](_0x56d0d9,_0xd790f8);break;case _0xdc86('0x68'):if(_0x96968e[_0xdc86('0x5c')]===_0xdc86('0x5d')){_0x157d46[_0x57ac70](_0xdc86('0x69'),'%'+_0x96968e[_0xdc86('0x57')]+'%',null);}else{_0x3bab31=_[_0xdc86('0x61')](_0x323ed6,[_0xdc86('0x2a'),_0xdc86('0x6a')]);_0x96968e[_0xdc86('0x45')]=_0xdc86('0x6a');_0x439543=as[_0xdc86('0x6b')](_0x4b5b24,_0x3bab31[_0xdc86('0x36')],_0x96968e);_0x157d46[_0x57ac70](_0x439543[_0xdc86('0x63')],_0x439543[_0xdc86('0x57')]['start'],_0x439543[_0xdc86('0x57')]['end']);}break;case _0xdc86('0x6c'):_0x439543=as[_0xdc86('0x6b')]('me',null,_0x96968e);_0x157d46[_0x57ac70](_0x439543['text'],_0x439543[_0xdc86('0x57')]['start'],_0x439543['value']['end']);break;}}else{var _0x439543=as['buildExpression'](_0x4b5b24,_0x3bab31['type'],_0x96968e);_0x157d46[_0x57ac70](_0x439543[_0xdc86('0x63')],_0x439543['value'][_0xdc86('0x64')],_0x439543[_0xdc86('0x57')][_0xdc86('0x1e')]);}}}else{var _0x1f120d=_(_0xc4b0ae[_0xdc86('0x3b')])[_0xdc86('0x39')]()[_0xdc86('0x32')](function(_0x1d6fc2){return _[_0xdc86('0x6d')](_0x323ed6,[_0xdc86('0x2a'),_0x1d6fc2])?_0x1d6fc2:undefined;})[_0xdc86('0x6e')]()[_0xdc86('0x57')]();if(!_[_0xdc86('0x6f')](_0x1f120d)){_0x1f120d[_0xdc86('0x2e')](function(_0x1ef0a6){if(_0x1ef0a6===_0xdc86('0x70')){_0x31e963[_0xdc86('0x42')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xdc86('0x71')](_0xc4b0ae[_0xdc86('0x3b')][_0x1ef0a6]));}else if(_0x1ef0a6===_0xdc86('0x72')){var _0x57161a=JSON[_0xdc86('0x73')](_0xc4b0ae['query'][_0x1ef0a6])[_0xdc86('0x74')];var _0x32d4ad=JSON[_0xdc86('0x73')](_0xc4b0ae[_0xdc86('0x3b')][_0x1ef0a6])[_0xdc86('0x75')];_0x31e963['where'](_0xdc86('0x76'),_0x57161a,_0x32d4ad);}else{if(_0xc4b0ae[_0xdc86('0x3b')][_0x1ef0a6]===_0xdc86('0x77')){_0x31e963[_0xdc86('0x42')]('i.'+_0x1ef0a6+_0xdc86('0x78'));}else{_0x31e963[_0xdc86('0x42')]('i.'+_0x1ef0a6+'\x20=\x20?',_0xc4b0ae[_0xdc86('0x3b')][_0x1ef0a6]);}}});}if(_0xc4b0ae['query'][_0xdc86('0x79')]){if(_0xc4b0ae[_0xdc86('0x3b')]['read']==0x1){_0x31e963[_0xdc86('0x58')](_0xdc86('0x7a'));}else{_0x31e963['having'](_0xdc86('0x7b'));}}if(_0xc4b0ae[_0xdc86('0x3b')]['tag']){_0x56d0d9=_[_0xdc86('0x7c')](_0xc4b0ae[_0xdc86('0x3b')]['tag'])?_0xc4b0ae[_0xdc86('0x3b')][_0xdc86('0x7d')]:new Array(_0xc4b0ae[_0xdc86('0x3b')][_0xdc86('0x7d')]);_0x56d0d9[_0xdc86('0x2e')](function(_0x1fcc14){_0x199ceb['or'](_0xdc86('0x66'),'%,'+_0x1fcc14+',%');});}if(_0xc4b0ae[_0xdc86('0x3b')]['filter']){var _0x279180=_0xc4b0ae[_0xdc86('0x3b')][_0xdc86('0x7e')][_0xdc86('0x7f')]('\x5c','\x5c\x5c')[_0xdc86('0x7f')](/'/g,'\x27\x27');if(qs[_0xdc86('0x80')](_0x279180)){_0x157d46['or'](_0xdc86('0x81'),_0x279180+'%');}else{_0x157d46['or'](_0xdc86('0x82'),qs[_0xdc86('0x5f')](_0x279180))['or'](_0xdc86('0x83'),_0x279180+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x279180+'%');}}}_0x31e963[_0xdc86('0x42')](_0x157d46);_0x31e963[_0xdc86('0x84')]('i.id');var _0x37d2f0={'type':db[_0xdc86('0x85')][_0xdc86('0x86')][_0xdc86('0x87')],'raw':!![]};var _0x815b90=_0x31e963[_0xdc86('0x88')]();_0x815b90[_0xdc86('0x45')]('i.id');_0x815b90[_0xdc86('0x45')](_0xdc86('0x89'),_0xdc86('0x8a'));if(_0xe73d13[_0xdc86('0x40')]){_0xe73d13[_0xdc86('0x40')][_0xdc86('0x2e')](function(_0x33cf8c){var _0xa21ee0=_0x33cf8c[0x0]===_0xdc86('0x8b')?_0x33cf8c[0x0]:'i.'+_0x33cf8c[0x0];_0x31e963[_0xdc86('0x40')](_0xa21ee0,_0x33cf8c[0x1]===_0xdc86('0x8c')?![]:!![]);});}if(!_[_0xdc86('0x6f')](_0x56d0d9)){_0x31e963[_0xdc86('0x58')](_0x199ceb);_0x815b90[_0xdc86('0x42')]('t.id\x20IN\x20?',_0x56d0d9);}BPromise['resolve']()['then'](function(){if(!_0x205408){if(_0xc4b0ae[_0xdc86('0x3b')][_0xdc86('0x70')])return;_0x815b90[_0xdc86('0x42')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x31e963[_0xdc86('0x42')](_0xdc86('0x8d'));return;}if(_0xc4b0ae[_0xdc86('0x8e')][_0xdc86('0x8f')]!==_0xdc86('0x90'))return;return _0xc4b0ae[_0xdc86('0x8e')][_0xdc86('0x91')]({'attributes':['id'],'raw':!![]})[_0xdc86('0x27')](function(_0x403935){if(_[_0xdc86('0x6f')](_0x403935)){_0x815b90[_0xdc86('0x42')](_0xdc86('0x92'));_0x31e963[_0xdc86('0x42')](_0xdc86('0x92'));}else{_0x815b90[_0xdc86('0x42')](_0xdc86('0x93'),_[_0xdc86('0x32')](_0x403935,'id'));_0x31e963[_0xdc86('0x42')](_0xdc86('0x93'),_[_0xdc86('0x32')](_0x403935,'id'));}});})[_0xdc86('0x27')](function(){if(_0xc4b0ae['user'][_0xdc86('0x8f')]==='agent'&&!_0x205408&&!_0xc4b0ae[_0xdc86('0x3b')][_0xdc86('0x70')])return[];return db[_0xdc86('0x94')][_0xdc86('0x3b')](_0x815b90['toString'](),_0x37d2f0);})[_0xdc86('0x27')](function(_0x4b5636){_0x2e0368[_0xdc86('0x95')]=_0x4b5636[_0xdc86('0x3e')];if(_0x2e0368[_0xdc86('0x95')]===0x0)return[];return db[_0xdc86('0x94')][_0xdc86('0x3b')](_0x27ae0a['toString'](),_0x37d2f0)[_0xdc86('0x27')](function(_0x2148e0){_0x16f9e3=_[_0xdc86('0x96')](_0x2148e0,'id');_0x37d2f0=_[_0xdc86('0x97')](_0x37d2f0,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xc4b0ae['query'][_0xdc86('0x3d')]){_0xe73d13[_0xdc86('0x3c')]['forEach'](function(_0x1b3131){_0x31e963[_0xdc86('0x45')]('i.'+_0x1b3131);});}else{_0x31e963[_0xdc86('0x45')](_0xdc86('0x89'),'unreadMessages');_0x31e963[_0xdc86('0x45')](_0xdc86('0x98'),'Account.key');_0x31e963['field'](_0xdc86('0x99'),_0xdc86('0x9a'));_0x31e963[_0xdc86('0x45')](_0xdc86('0x9b'),'contactName');_0x31e963[_0xdc86('0x45')](_0xdc86('0x9c'));_0x31e963[_0xdc86('0x45')](_0xdc86('0x9d'),'Contact.firstName');_0x31e963[_0xdc86('0x45')](_0xdc86('0x9e'),_0xdc86('0x9f'));_0x31e963[_0xdc86('0x45')](_0xdc86('0xa0'),_0xdc86('0xa1'));_0x31e963[_0xdc86('0x45')](_0xdc86('0xa2'),_0xdc86('0xa3'));_0x31e963[_0xdc86('0x45')]('c.mobile',_0xdc86('0xa4'));_0x31e963['field']('c.fax',_0xdc86('0xa5'));_0x31e963['field'](_0xdc86('0xa6'),_0xdc86('0xa7'));_0x31e963[_0xdc86('0x45')](_0xdc86('0xa8'),_0xdc86('0xa9'));_0x31e963[_0xdc86('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xdc86('0x2c'));}if(_0xe73d13[_0xdc86('0x21')])_0x31e963['limit'](_0xe73d13['limit']);if(_0xe73d13[_0xdc86('0x20')])_0x31e963['offset'](_0xe73d13[_0xdc86('0x20')]);return db['sequelize'][_0xdc86('0x3b')](_0x31e963[_0xdc86('0xaa')](),_0x37d2f0);})[_0xdc86('0x27')](function(_0xd37ad4){if(_0xd37ad4[_0xdc86('0x3e')]>0x0)_0x3fdc30['where'](_0xdc86('0xab'),_[_0xdc86('0x32')](_0xd37ad4,'id'));return db[_0xdc86('0x94')][_0xdc86('0x3b')](_0x3fdc30['toString'](),_0x37d2f0)['then'](function(_0x692372){var _0x150afd=_[_0xdc86('0xac')](_0x692372,_0xdc86('0xad'));var _0x55031a=[];_0xd37ad4[_0xdc86('0x2e')](function(_0x51b75e){_0x55031a[_0xdc86('0x30')](updateOpenchannelInteraction(_0x51b75e,_0x16f9e3,_0x150afd));});return BPromise['all'](_0x55031a);});});})['then'](function(_0x4ec2b6){_0x2e0368['rows']=_0x4ec2b6;return _0x2e0368;})[_0xdc86('0x27')](respondWithFilteredResult(_0x21bde3,_0xe73d13))[_0xdc86('0x31')](handleError(_0x21bde3,null));};exports[_0xdc86('0xae')]=function(_0x5636ca,_0xf22265){var _0x17df31={};if(_0x5636ca[_0xdc86('0x3b')][_0xdc86('0x36')]&&_0x5636ca[_0xdc86('0x3b')][_0xdc86('0x36')]===_0xdc86('0x47')){_0x17df31[_0xdc86('0x47')]=_0x5636ca[_0xdc86('0xaf')]['id'];}else{_0x17df31['id']=_0x5636ca[_0xdc86('0xaf')]['id'];}var _0x28f05c={'raw':![],'where':_0x17df31},_0x257e6c={};_0x257e6c['model']=_[_0xdc86('0x39')](db[_0xdc86('0x33')]['rawAttributes']);_0x257e6c[_0xdc86('0x3b')]=_['keys'](_0x5636ca['query']);_0x257e6c[_0xdc86('0x43')]=_[_0xdc86('0x3a')](_0x257e6c[_0xdc86('0x38')],_0x257e6c['query']);_0x28f05c['attributes']=_[_0xdc86('0x3a')](_0x257e6c[_0xdc86('0x38')],qs[_0xdc86('0x3d')](_0x5636ca['query'][_0xdc86('0x3d')]));_0x28f05c[_0xdc86('0x3c')]=_0x28f05c[_0xdc86('0x3c')][_0xdc86('0x3e')]?_0x28f05c[_0xdc86('0x3c')]:_0x257e6c[_0xdc86('0x38')];if(_0x5636ca[_0xdc86('0x3b')][_0xdc86('0xb0')]){_0x28f05c[_0xdc86('0xb1')]=[{'all':!![]}];}_0x28f05c=_[_0xdc86('0x97')]({},_0x28f05c,_0x5636ca[_0xdc86('0xb2')]);return db[_0xdc86('0x33')]['find'](_0x28f05c)[_0xdc86('0x27')](handleEntityNotFound(_0xf22265,null))['then'](respondWithResult(_0xf22265,null))[_0xdc86('0x31')](handleError(_0xf22265,null));};exports[_0xdc86('0xb3')]=function(_0x9d50d2,_0x70f78d){return db[_0xdc86('0x33')][_0xdc86('0xb3')](_0x9d50d2['body'],{})[_0xdc86('0x27')](respondWithResult(_0x70f78d,0xc9))['catch'](handleError(_0x70f78d,null));};exports['update']=function(_0x37202f,_0x475e72){if(_0x37202f['body']['id']){delete _0x37202f[_0xdc86('0x6c')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x37202f['params']['id']}})[_0xdc86('0x27')](handleEntityNotFound(_0x475e72,null))[_0xdc86('0x27')](saveUpdates(_0x37202f['body'],null))[_0xdc86('0x27')](respondWithResult(_0x475e72,null))['catch'](handleError(_0x475e72,null));};exports[_0xdc86('0x28')]=function(_0x11cda8,_0x28174d){return db[_0xdc86('0x33')][_0xdc86('0x61')]({'where':{'id':_0x11cda8['params']['id']}})[_0xdc86('0x27')](handleEntityNotFound(_0x28174d,null))[_0xdc86('0x27')](removeEntity(_0x28174d,null))[_0xdc86('0x31')](handleError(_0x28174d,null));};exports[_0xdc86('0xb4')]=function(_0x468ca8,_0x287a45){return db['OpenchannelInteraction']['describe']()['then'](respondWithResult(_0x287a45,null))[_0xdc86('0x31')](handleError(_0x287a45,null));};exports['addMessage']=function(_0x311a78,_0x5ebb3c,_0x4479bd){return db[_0xdc86('0xb5')]['find']({'where':{'id':_0x311a78[_0xdc86('0xaf')]['id']}})[_0xdc86('0x27')](handleEntityNotFound(_0x5ebb3c,null))[_0xdc86('0x27')](function(_0x56ce86){if(_0x56ce86){return _0x56ce86[_0xdc86('0xb6')](_0x311a78[_0xdc86('0x6c')]['ids'],_[_0xdc86('0xb7')](_0x311a78[_0xdc86('0x6c')],[_0xdc86('0xb8'),'id'])||{});}})['then'](respondWithResult(_0x5ebb3c,null))[_0xdc86('0x31')](handleError(_0x5ebb3c,null));};exports[_0xdc86('0xb9')]=function(_0x2d4ee7,_0x3c46c0,_0x599406){var _0x4dd349={'raw':![],'where':{}};var _0x20e628={};var _0x51a199={'count':0x0,'rows':[]};return db[_0xdc86('0x33')][_0xdc86('0xba')]({'where':{'id':_0x2d4ee7[_0xdc86('0xaf')]['id']}})[_0xdc86('0x27')](handleEntityNotFound(_0x3c46c0,null))[_0xdc86('0x27')](function(_0x3157e5){if(_0x3157e5){_0x20e628[_0xdc86('0x38')]=_[_0xdc86('0x39')](db[_0xdc86('0xb5')][_0xdc86('0x34')]);_0x20e628[_0xdc86('0x3b')]=_[_0xdc86('0x39')](_0x2d4ee7[_0xdc86('0x3b')]);_0x20e628[_0xdc86('0x43')]=_['intersection'](_0x20e628['model'],_0x20e628[_0xdc86('0x3b')]);_0x4dd349['attributes']=_[_0xdc86('0x3a')](_0x20e628[_0xdc86('0x38')],qs[_0xdc86('0x3d')](_0x2d4ee7['query'][_0xdc86('0x3d')]));_0x4dd349[_0xdc86('0x3c')]=_0x4dd349[_0xdc86('0x3c')][_0xdc86('0x3e')]?_0x4dd349[_0xdc86('0x3c')]:_0x20e628[_0xdc86('0x38')];if(!_0x2d4ee7['query'][_0xdc86('0x3f')](_0xdc86('0xbb'))){_0x4dd349[_0xdc86('0x21')]=qs[_0xdc86('0x21')](_0x2d4ee7[_0xdc86('0x3b')][_0xdc86('0x21')]);_0x4dd349[_0xdc86('0x20')]=qs[_0xdc86('0x20')](_0x2d4ee7[_0xdc86('0x3b')][_0xdc86('0x20')]);}_0x4dd349['order']=qs['sort'](_0x2d4ee7['query']['sort']);_0x4dd349['where']=qs['filters'](_[_0xdc86('0xbc')](_0x2d4ee7[_0xdc86('0x3b')],_0x20e628['filters']));_0x4dd349[_0xdc86('0x42')]['OpenchannelInteractionId']=_0x3157e5['id'];if(_0x2d4ee7['query']['filter']){_0x4dd349[_0xdc86('0x42')]=_[_0xdc86('0x97')](_0x4dd349[_0xdc86('0x42')],{'$or':_['map'](_0x4dd349['attributes'],function(_0x5396a8){var _0x2d4bce={};_0x2d4bce[_0x5396a8]={'$like':'%'+_0x2d4ee7[_0xdc86('0x3b')][_0xdc86('0x7e')]+'%'};return _0x2d4bce;})});}if(_0x2d4ee7[_0xdc86('0x3b')][_0xdc86('0x74')]){var _0x347978=_0x2d4ee7[_0xdc86('0x3b')][_0xdc86('0x74')][_0xdc86('0x2d')](',');var _0x47ed2c={};_0x47ed2c[_0x347978[0x0]]={'$gte':moment(_0x347978[0x1])['format'](_0xdc86('0xbd'))};_0x4dd349[_0xdc86('0x42')]=_[_0xdc86('0x97')](_0x4dd349[_0xdc86('0x42')],_0x47ed2c);}_0x4dd349=_[_0xdc86('0x97')]({},_0x4dd349,_0x2d4ee7[_0xdc86('0xb2')]);return db[_0xdc86('0xb5')][_0xdc86('0x95')]({'where':_0x4dd349[_0xdc86('0x42')]})['then'](function(_0x28092b){_0x51a199[_0xdc86('0x95')]=_0x28092b;if(_0x2d4ee7['query'][_0xdc86('0xb0')]){_0x4dd349[_0xdc86('0xb1')]=[{'all':!![]}];}return db[_0xdc86('0xb5')][_0xdc86('0xbe')](_0x4dd349);})[_0xdc86('0x27')](function(_0x5f38d7){_0x51a199[_0xdc86('0xbf')]=_0x5f38d7;return _0x51a199;});}})[_0xdc86('0x27')](respondWithFilteredResult(_0x3c46c0,_0x4dd349))[_0xdc86('0x31')](handleError(_0x3c46c0,null));};exports['addTags']=function(_0xaf2bf7,_0x4aef67,_0x4436a0){return db[_0xdc86('0x33')]['find']({'where':{'id':_0xaf2bf7['params']['id']}})[_0xdc86('0x27')](handleEntityNotFound(_0x4aef67,null))[_0xdc86('0x27')](function(_0x14eb96){if(_0x14eb96){return _0x14eb96[_0xdc86('0xc0')](_0xaf2bf7['body']['ids'],_[_0xdc86('0xb7')](_0xaf2bf7['body'],[_0xdc86('0xb8'),'id'])||{})['spread'](function(){return db['Tag'][_0xdc86('0xbe')]({'attributes':['id',_0xdc86('0x2a'),_0xdc86('0x46')],'where':{'id':_0xaf2bf7[_0xdc86('0x6c')][_0xdc86('0xb8')]}});})[_0xdc86('0x27')](function(_0x3e84a3){socket[_0xdc86('0xc1')](_0xdc86('0xc2'),{'id':Number(_0xaf2bf7[_0xdc86('0xaf')]['id']),'tags':_0x3e84a3||[]});return{'id':Number(_0xaf2bf7[_0xdc86('0xaf')]['id']),'tags':_0x3e84a3||[]};});}})[_0xdc86('0x27')](respondWithResult(_0x4aef67,null))[_0xdc86('0x31')](handleError(_0x4aef67,null));};exports[_0xdc86('0xc3')]=function(_0x1e778f,_0x9f92d2,_0x2d854d){return db[_0xdc86('0x33')]['find']({'where':{'id':_0x1e778f[_0xdc86('0xaf')]['id']}})[_0xdc86('0x27')](handleEntityNotFound(_0x9f92d2,null))[_0xdc86('0x27')](function(_0x1a0feb){if(_0x1a0feb){return _0x1a0feb[_0xdc86('0xc3')](_0x1e778f[_0xdc86('0x3b')][_0xdc86('0xb8')]);}})[_0xdc86('0x27')](respondWithStatusCode(_0x9f92d2,null))[_0xdc86('0x31')](handleError(_0x9f92d2,null));};exports['download']=function(_0x3a4a55,_0x2d9b31){var _0x571e9d=moment()[_0xdc86('0xc4')]()['toString']();var _0x4cca06=path[_0xdc86('0xc5')](config[_0xdc86('0xc6')],_0xdc86('0xc7'),_0xdc86('0xc8'),_0xdc86('0xc9'));var _0x492bb0=path[_0xdc86('0xc5')](config['root'],_0xdc86('0xc7'),_0xdc86('0xc8'),_0xdc86('0xca'));var _0xcf0677=path[_0xdc86('0xc5')](_0x4cca06,_0x571e9d);var _0x5658fe=util['format'](_0xdc86('0xcb'),_0x3a4a55['params']['id'],_0x571e9d);var _0x38778c=path['join'](_0x4cca06,_0x5658fe);var _0x301d89=[];_0x301d89[_0xdc86('0x30')]({'model':db[_0xdc86('0x68')],'as':'User','attributes':['id',_0xdc86('0xcc')],'raw':!![]});_0x301d89[_0xdc86('0x30')]({'model':db[_0xdc86('0xcd')],'as':_0xdc86('0x5b'),'attributes':['id',_0xdc86('0xce'),_0xdc86('0xcf')],'raw':!![]});if(_0x3a4a55['query']['attachments']){_0x301d89['push']({'model':db[_0xdc86('0xd0')],'as':_0xdc86('0xd0'),'raw':!![]});}var _0x322da4=[{'model':db[_0xdc86('0xb5')],'as':'Messages','attributes':['id',_0xdc86('0x6c'),_0xdc86('0x72'),_0xdc86('0xd1'),_0xdc86('0xd2'),_0xdc86('0x79')],'include':_0x301d89}];_0x322da4[_0xdc86('0x30')]({'model':db[_0xdc86('0xd3')],'as':_0xdc86('0xd4'),'attributes':['id',_0xdc86('0x2a')]});_0x322da4[_0xdc86('0x30')]({'model':db[_0xdc86('0x68')],'as':_0xdc86('0xd5'),'attributes':['id',_0xdc86('0xcc')]});return db[_0xdc86('0x33')][_0xdc86('0x61')]({'where':{'id':_0x3a4a55[_0xdc86('0xaf')]['id']},'include':_0x322da4})[_0xdc86('0x27')](handleEntityNotFound(_0x2d9b31,null))[_0xdc86('0x27')](function(_0x143bef){if(_0x143bef){var _0x1298e9=_0x143bef[_0xdc86('0xd6')]({'plain':!![]});fs[_0xdc86('0xd7')](_0xcf0677);var _0x143eb6={'channel':_0xdc86('0xd8'),'account':_0x1298e9[_0xdc86('0xd4')][_0xdc86('0x2a')],'agent':_0x1298e9['Owner']?_0x1298e9['Owner']['fullname']:'N.A.','createdAt':moment(_0x1298e9[_0xdc86('0x72')])['format'](_0xdc86('0xbd'))[_0xdc86('0xaa')](),'closedAt':_0x1298e9[_0xdc86('0xd9')]?moment(_0x1298e9[_0xdc86('0xda')])[_0xdc86('0xdb')](_0xdc86('0xbd'))[_0xdc86('0xaa')]():'','disposition':_0x1298e9['disposition'],'visibility':_0x1298e9[_0xdc86('0xdc')]?'Public':_0xdc86('0xdd'),'messages':_(_0x1298e9['Messages'])[_0xdc86('0x7e')]({'secret':![]})[_0xdc86('0x32')](function(_0x220064){if(_0x220064[_0xdc86('0xd0')]){var _0x2e699e=path['join'](_0x492bb0,_0x220064[_0xdc86('0xd0')]['basename']);if(fs['existsSync'](_0x2e699e)){fs['createReadStream'](_0x2e699e)[_0xdc86('0xde')](fs[_0xdc86('0xdf')](path['join'](_0xcf0677,_0x220064[_0xdc86('0xd0')][_0xdc86('0xe0')])));}}return{'date':moment(_0x220064[_0xdc86('0x72')])[_0xdc86('0xdb')](_0xdc86('0xbd'))[_0xdc86('0xaa')](),'sender':_0x220064['direction']===_0xdc86('0xe1')?_0x220064[_0xdc86('0x68')]?_0x220064[_0xdc86('0x68')][_0xdc86('0xcc')]:_0xdc86('0xe2'):_0x220064[_0xdc86('0x5b')][_0xdc86('0xce')]+(_0x220064['Contact'][_0xdc86('0xcf')]?'\x20'+_0x220064['Contact']['lastName']:''),'body':_0x220064['Attachment']?_0x220064[_0xdc86('0xd0')]['basename']:_0x220064[_0xdc86('0x6c')],'direction':_0x220064['direction']===_0xdc86('0xe1')?'A':'C','secret':_0x220064['secret'],'read':_0x220064[_0xdc86('0x79')],'attachment':_0x220064[_0xdc86('0xd0')]};})[_0xdc86('0x57')]()};return ejs['renderFile'](path[_0xdc86('0xc5')](config[_0xdc86('0xc6')],_0xdc86('0xc7'),_0xdc86('0xe3'),_0xdc86('0xe4')),{'interaction':_0x143eb6})[_0xdc86('0x27')](function(_0x4961d6){var _0x48f7c9=path[_0xdc86('0xc5')](_0xcf0677,_0xdc86('0xe5')+_0x1298e9['id']+'-'+_0x571e9d+_0xdc86('0xe6'));var _0x385bc5={'path':_0x48f7c9,'channel':_0xdc86('0xd8'),'interactionId':_0x1298e9['id']};return pdf[_0xdc86('0xe7')](_0x4961d6,_0x385bc5);})[_0xdc86('0x27')](function(){return new BPromise(function(_0x4bb722,_0x2096ed){zipdir(_0xcf0677,{'saveTo':_0x38778c},function(_0x2f3adf,_0x2a455a){if(_0x2f3adf)return _0x2096ed(_0x2f3adf);return _0x4bb722(_0x2a455a);});})['then'](function(){return new BPromise(function(_0xbf2836,_0x5e0461){rimraf(_0xcf0677,function(_0x15f7b9){if(_0x15f7b9)_0x5e0461(_0x15f7b9);return _0xbf2836();});});})[_0xdc86('0x27')](function(){return _0x2d9b31[_0xdc86('0xe8')](_0x38778c,_0x5658fe,function(_0x3e9380){if(_0x3e9380){console[_0xdc86('0xe9')](_0xdc86('0xea'),_0x3e9380);}else{fs['unlinkSync'](_0x38778c);}});});});}else{return _0x2d9b31[_0xdc86('0x1c')](0xc8);}})[_0xdc86('0x31')](handleError(_0x2d9b31,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index f4cbcde..54b34fb 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 _0x1be9=['update','remove','getUsers','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1be9,0xe9));var _0x91be=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x1be9[_0x2e4e19];return _0x9ba20b;};'use strict';var EventEmitter=require(_0x91be('0x0'));var OpenchannelInteraction=require(_0x91be('0x1'))['db'][_0x91be('0x2')];var OpenchannelMessage=require(_0x91be('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x91be('0x3')](0x0);var events={'afterCreate':_0x91be('0x4'),'afterUpdate':_0x91be('0x5'),'afterDestroy':_0x91be('0x6')};function emitEvent(_0x3ecfef){return function(_0x3ade19,_0x4c70ba,_0x29b7e2){_0x3ade19[_0x91be('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4a4a77){_0x3ade19[_0x91be('0x8')](_0x91be('0x9'),_0x4a4a77[_0x91be('0xa')](function(_0x15537c){return{'id':_0x15537c['id']};}));return OpenchannelMessage[_0x91be('0xb')]({'where':{'OpenchannelInteractionId':_0x3ade19['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2c1b55){_0x3ade19[_0x91be('0x8')](_0x91be('0xc'),_0x2c1b55[_0x91be('0xd')]);OpenchannelInteractionEvents[_0x91be('0xe')](_0x3ecfef+':'+_0x3ade19['id'],_0x3ade19);OpenchannelInteractionEvents[_0x91be('0xe')](_0x3ecfef,_0x3ade19);_0x29b7e2(null);})['catch'](_0x29b7e2(null));};}for(var e in events){if(events[_0x91be('0xf')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x91be('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x4899=['map','findAll','unreadMessages','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','setDataValue','Users'];(function(_0x47c5bf,_0x45977e){var _0x11b779=function(_0x1bd585){while(--_0x1bd585){_0x47c5bf['push'](_0x47c5bf['shift']());}};_0x11b779(++_0x45977e);}(_0x4899,0x1b9));var _0x9489=function(_0x14283c,_0x5a095a){_0x14283c=_0x14283c-0x0;var _0x1e7fc5=_0x4899[_0x14283c];return _0x1e7fc5;};'use strict';var EventEmitter=require(_0x9489('0x0'));var OpenchannelInteraction=require(_0x9489('0x1'))['db'][_0x9489('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x9489('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x9489('0x4')](0x0);var events={'afterCreate':_0x9489('0x5'),'afterUpdate':_0x9489('0x6'),'afterDestroy':'remove'};function emitEvent(_0x4f2f44){return function(_0x1baea0,_0xf9753d,_0x372640){_0x1baea0['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x40f296){_0x1baea0[_0x9489('0x7')](_0x9489('0x8'),_0x40f296[_0x9489('0x9')](function(_0x39f901){return{'id':_0x39f901['id']};}));return OpenchannelMessage[_0x9489('0xa')]({'where':{'OpenchannelInteractionId':_0x1baea0['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x15456f){_0x1baea0[_0x9489('0x7')](_0x9489('0xb'),_0x15456f['length']);OpenchannelInteractionEvents[_0x9489('0xc')](_0x4f2f44+':'+_0x1baea0['id'],_0x1baea0);OpenchannelInteractionEvents['emit'](_0x4f2f44,_0x1baea0);_0x372640(null);})['catch'](_0x372640(null));};}for(var e in events){if(events[_0x9489('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x9489('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 7542a89..91a47bb 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 _0x92c1=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','lodash','util'];(function(_0x1649ec,_0x1181da){var _0x2409f3=function(_0x3b3e1a){while(--_0x3b3e1a){_0x1649ec['push'](_0x1649ec['shift']());}};_0x2409f3(++_0x1181da);}(_0x92c1,0xbb));var _0x192c=function(_0x5b77ae,_0x1a62fd){_0x5b77ae=_0x5b77ae-0x0;var _0x1b2c49=_0x92c1[_0x5b77ae];return _0x1b2c49;};'use strict';var _=require(_0x192c('0x0'));var util=require(_0x192c('0x1'));var logger=require(_0x192c('0x2'))(_0x192c('0x3'));var moment=require(_0x192c('0x4'));var BPromise=require(_0x192c('0x5'));var rp=require(_0x192c('0x6'));var fs=require('fs');var path=require(_0x192c('0x7'));var rimraf=require(_0x192c('0x8'));var config=require(_0x192c('0x9'));var attributes=require(_0x192c('0xa'));module[_0x192c('0xb')]=function(_0x571718,_0x2e7142){return _0x571718[_0x192c('0xc')](_0x192c('0xd'),attributes,{'tableName':_0x192c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x192c('0xf'),'collate':_0x192c('0x10'),'hooks':{'beforeUpdate':function(_0x4516f5,_0x5311a4,_0x9b73ab){if(_0x4516f5[_0x192c('0x11')](_0x192c('0x12'))){_0x4516f5[_0x192c('0x13')]=moment()[_0x192c('0x14')]('YYYY-MM-DD\x20HH:mm:ss');}_0x9b73ab(null,_0x4516f5);}}});}; \ No newline at end of file +var _0xdbd3=['openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./openchannelInteraction.attributes','exports'];(function(_0x74745d,_0x177606){var _0x174ab3=function(_0x1c94e9){while(--_0x1c94e9){_0x74745d['push'](_0x74745d['shift']());}};_0x174ab3(++_0x177606);}(_0xdbd3,0xe6));var _0x3dbd=function(_0x3bb859,_0x589816){_0x3bb859=_0x3bb859-0x0;var _0x3bf534=_0xdbd3[_0x3bb859];return _0x3bf534;};'use strict';var _=require(_0x3dbd('0x0'));var util=require(_0x3dbd('0x1'));var logger=require(_0x3dbd('0x2'))('api');var moment=require(_0x3dbd('0x3'));var BPromise=require(_0x3dbd('0x4'));var rp=require(_0x3dbd('0x5'));var fs=require('fs');var path=require(_0x3dbd('0x6'));var rimraf=require(_0x3dbd('0x7'));var config=require('../../config/environment');var attributes=require(_0x3dbd('0x8'));module[_0x3dbd('0x9')]=function(_0x34821e,_0x236a4e){return _0x34821e['define']('OpenchannelInteraction',attributes,{'tableName':_0x3dbd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3dbd('0xb'),'collate':_0x3dbd('0xc'),'hooks':{'beforeUpdate':function(_0xee244c,_0x4fe3a6,_0x3b9f04){if(_0xee244c['changed']('closed')){_0xee244c[_0x3dbd('0xd')]=moment()[_0x3dbd('0xe')](_0x3dbd('0xf'));}_0x3b9f04(null,_0xee244c);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index e8b8896..b9f304d 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 _0x30c9=['body','options','where','attributes','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','ids','omit','spread','AddTags','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelInteraction'];(function(_0x436328,_0x24df74){var _0x11e974=function(_0xa27975){while(--_0xa27975){_0x436328['push'](_0x436328['shift']());}};_0x11e974(++_0x24df74);}(_0x30c9,0x16a));var _0x930c=function(_0x3c5bd3,_0x12cb60){_0x3c5bd3=_0x3c5bd3-0x0;var _0x3a6bd5=_0x30c9[_0x3c5bd3];return _0x3a6bd5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x930c('0x0'));var BPromise=require('bluebird');var rs=require(_0x930c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x930c('0x2'))['db'];var utils=require(_0x930c('0x3'));var logger=require(_0x930c('0x4'))('rpc');var config=require(_0x930c('0x5'));var jayson=require(_0x930c('0x6'));var client=jayson['client'][_0x930c('0x7')]({'port':0x232a});config[_0x930c('0x8')]=_[_0x930c('0x9')](config[_0x930c('0x8')],{'host':_0x930c('0xa'),'port':0x18eb});var socket=require(_0x930c('0xb'))(new Redis(config['redis']));require(_0x930c('0xc'))[_0x930c('0xd')](socket);function respondWithRpcPromise(_0xfc3419,_0x5f1197,_0x2e542b){return new BPromise(function(_0x305394,_0x151684){return client[_0x930c('0xe')](_0xfc3419,_0x2e542b)[_0x930c('0xf')](function(_0x589284){logger[_0x930c('0x10')](_0x930c('0x11'),_0x5f1197,_0x930c('0x12'));logger[_0x930c('0x13')](_0x930c('0x14'),_0x5f1197,_0x930c('0x12'),JSON[_0x930c('0x15')](_0x589284));if(_0x589284[_0x930c('0x16')]){if(_0x589284[_0x930c('0x16')][_0x930c('0x17')]===0x1f4){logger[_0x930c('0x16')](_0x930c('0x11'),_0x5f1197,_0x589284[_0x930c('0x16')]['message']);return _0x151684(_0x589284[_0x930c('0x16')][_0x930c('0x18')]);}logger[_0x930c('0x16')](_0x930c('0x11'),_0x5f1197,_0x589284[_0x930c('0x16')][_0x930c('0x18')]);return _0x305394(_0x589284[_0x930c('0x16')]['message']);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x5f1197,_0x930c('0x12'));_0x305394(_0x589284[_0x930c('0x19')][_0x930c('0x18')]);}})[_0x930c('0x1a')](function(_0x3e7b05){logger[_0x930c('0x16')](_0x930c('0x11'),_0x5f1197,_0x3e7b05);_0x151684(_0x3e7b05);});});}exports['UpdateOpenchannelInteraction']=function(_0x1a0eec){var _0x3bbf02=this;return new Promise(function(_0x471dbe,_0x7d9cb7){return db[_0x930c('0x1b')]['update'](_0x1a0eec[_0x930c('0x1c')],{'raw':_0x1a0eec[_0x930c('0x1d')]?_0x1a0eec['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a0eec[_0x930c('0x1d')]?_0x1a0eec[_0x930c('0x1d')][_0x930c('0x1e')]||null:null,'attributes':_0x1a0eec[_0x930c('0x1d')]?_0x1a0eec[_0x930c('0x1d')][_0x930c('0x1f')]||null:null,'limit':_0x1a0eec[_0x930c('0x1d')]?_0x1a0eec[_0x930c('0x1d')]['limit']||null:null})[_0x930c('0xf')](function(_0x28b2a4){logger[_0x930c('0x10')](_0x930c('0x20'),_0x1a0eec);logger['debug']('UpdateOpenchannelInteraction',_0x1a0eec,JSON['stringify'](_0x28b2a4));_0x471dbe(_0x28b2a4);})[_0x930c('0x1a')](function(_0xf337c2){logger[_0x930c('0x16')](_0x930c('0x20'),_0xf337c2['message'],_0x1a0eec);_0x7d9cb7(_0x3bbf02[_0x930c('0x16')](0x1f4,_0xf337c2[_0x930c('0x18')]));});});};exports[_0x930c('0x21')]=function(_0x6f6462){return new Promise(function(_0x41cebd,_0x24add8){return db[_0x930c('0x1b')][_0x930c('0x22')]({'where':_0x6f6462['options']?_0x6f6462[_0x930c('0x1d')][_0x930c('0x1e')]||null:null})[_0x930c('0xf')](function(_0x4b96cc){if(_0x4b96cc){return _0x4b96cc['addTags'](_0x6f6462[_0x930c('0x1c')][_0x930c('0x23')],_[_0x930c('0x24')](_0x6f6462[_0x930c('0x1c')],[_0x930c('0x23'),'id'])||{});}})[_0x930c('0x25')](function(_0x5040b6){logger[_0x930c('0x10')](_0x930c('0x26'),_0x6f6462);logger[_0x930c('0x13')]('AddTags',_0x6f6462,JSON[_0x930c('0x15')](_0x5040b6));_0x41cebd(_0x5040b6);})['catch'](function(_0x455f1f){logger['error']('AddTags',_0x455f1f[_0x930c('0x18')],_0x6f6462);_0x24add8(_this[_0x930c('0x16')](0x1f4,_0x455f1f[_0x930c('0x18')]));});});}; \ No newline at end of file +var _0xeeb9=['defaults','redis','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','debug','stringify','AddTagsToOpenchannelInteraction','find','ids','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x12ee23,_0xacb61a){var _0x101a49=function(_0x248ba5){while(--_0x248ba5){_0x12ee23['push'](_0x12ee23['shift']());}};_0x101a49(++_0xacb61a);}(_0xeeb9,0xb3));var _0x9eeb=function(_0x1e7c82,_0x5c085e){_0x1e7c82=_0x1e7c82-0x0;var _0x1fc19a=_0xeeb9[_0x1e7c82];return _0x1fc19a;};'use strict';var _=require(_0x9eeb('0x0'));var util=require(_0x9eeb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9eeb('0x2'));var fs=require('fs');var Redis=require(_0x9eeb('0x3'));var db=require(_0x9eeb('0x4'))['db'];var utils=require(_0x9eeb('0x5'));var logger=require(_0x9eeb('0x6'))(_0x9eeb('0x7'));var config=require(_0x9eeb('0x8'));var jayson=require(_0x9eeb('0x9'));var client=jayson['client'][_0x9eeb('0xa')]({'port':0x232a});config['redis']=_[_0x9eeb('0xb')](config[_0x9eeb('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9eeb('0xc')]));require(_0x9eeb('0xd'))[_0x9eeb('0xe')](socket);function respondWithRpcPromise(_0x1e5d4c,_0x4dfb96,_0x1c4083){return new BPromise(function(_0x49bec8,_0x29008a){return client[_0x9eeb('0xf')](_0x1e5d4c,_0x1c4083)[_0x9eeb('0x10')](function(_0x43f492){logger[_0x9eeb('0x11')](_0x9eeb('0x12'),_0x4dfb96,_0x9eeb('0x13'));logger['debug'](_0x9eeb('0x14'),_0x4dfb96,'request\x20sent',JSON['stringify'](_0x43f492));if(_0x43f492['error']){if(_0x43f492[_0x9eeb('0x15')][_0x9eeb('0x16')]===0x1f4){logger[_0x9eeb('0x15')](_0x9eeb('0x12'),_0x4dfb96,_0x43f492[_0x9eeb('0x15')][_0x9eeb('0x17')]);return _0x29008a(_0x43f492[_0x9eeb('0x15')]['message']);}logger[_0x9eeb('0x15')](_0x9eeb('0x12'),_0x4dfb96,_0x43f492[_0x9eeb('0x15')]['message']);return _0x49bec8(_0x43f492['error'][_0x9eeb('0x17')]);}else{logger[_0x9eeb('0x11')](_0x9eeb('0x12'),_0x4dfb96,_0x9eeb('0x13'));_0x49bec8(_0x43f492['result'][_0x9eeb('0x17')]);}})[_0x9eeb('0x18')](function(_0xbe79c8){logger[_0x9eeb('0x15')](_0x9eeb('0x12'),_0x4dfb96,_0xbe79c8);_0x29008a(_0xbe79c8);});});}exports[_0x9eeb('0x19')]=function(_0x39fda4){var _0x13c984=this;return new Promise(function(_0x52536f,_0x4d95d1){return db[_0x9eeb('0x1a')]['update'](_0x39fda4[_0x9eeb('0x1b')],{'raw':_0x39fda4[_0x9eeb('0x1c')]?_0x39fda4[_0x9eeb('0x1c')][_0x9eeb('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39fda4[_0x9eeb('0x1c')]?_0x39fda4[_0x9eeb('0x1c')][_0x9eeb('0x1e')]||null:null,'attributes':_0x39fda4[_0x9eeb('0x1c')]?_0x39fda4[_0x9eeb('0x1c')]['attributes']||null:null,'limit':_0x39fda4[_0x9eeb('0x1c')]?_0x39fda4[_0x9eeb('0x1c')]['limit']||null:null})[_0x9eeb('0x10')](function(_0x3f2618){logger['info']('UpdateOpenchannelInteraction',_0x39fda4);logger[_0x9eeb('0x1f')](_0x9eeb('0x19'),_0x39fda4,JSON[_0x9eeb('0x20')](_0x3f2618));_0x52536f(_0x3f2618);})['catch'](function(_0x509a16){logger[_0x9eeb('0x15')](_0x9eeb('0x19'),_0x509a16[_0x9eeb('0x17')],_0x39fda4);_0x4d95d1(_0x13c984[_0x9eeb('0x15')](0x1f4,_0x509a16[_0x9eeb('0x17')]));});});};exports[_0x9eeb('0x21')]=function(_0x5e143b){return new Promise(function(_0x4d4577,_0x1c4f52){return db[_0x9eeb('0x1a')][_0x9eeb('0x22')]({'where':_0x5e143b[_0x9eeb('0x1c')]?_0x5e143b['options'][_0x9eeb('0x1e')]||null:null})['then'](function(_0x6bf652){if(_0x6bf652){return _0x6bf652['addTags'](_0x5e143b[_0x9eeb('0x1b')][_0x9eeb('0x23')],_['omit'](_0x5e143b[_0x9eeb('0x1b')],[_0x9eeb('0x23'),'id'])||{});}})[_0x9eeb('0x24')](function(_0x1cd210){logger[_0x9eeb('0x11')](_0x9eeb('0x25'),_0x5e143b);logger[_0x9eeb('0x1f')](_0x9eeb('0x25'),_0x5e143b,JSON[_0x9eeb('0x20')](_0x1cd210));_0x4d4577(_0x1cd210);})[_0x9eeb('0x18')](function(_0x19a0dc){logger[_0x9eeb('0x15')]('AddTags',_0x19a0dc[_0x9eeb('0x17')],_0x5e143b);_0x1c4f52(_this[_0x9eeb('0x15')](0x1f4,_0x19a0dc[_0x9eeb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 45f0d3d..f9b4d07 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 _0x2099=['remove','update','emit','register','length','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x4e231f,_0x315a9e){var _0x43a501=function(_0x58bdbb){while(--_0x58bdbb){_0x4e231f['push'](_0x4e231f['shift']());}};_0x43a501(++_0x315a9e);}(_0x2099,0xe6));var _0x9209=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2099[_0x59ee6f];return _0x4c0979;};'use strict';var OpenchannelInteractionEvents=require(_0x9209('0x0'));var events=['save',_0x9209('0x1'),_0x9209('0x2')];function createListener(_0x4735af,_0x216edc){return function(_0x3b9fa8){_0x216edc[_0x9209('0x3')](_0x4735af,_0x3b9fa8);};}function removeListener(_0x2a64ee,_0x5c0757){return function(){OpenchannelInteractionEvents['removeListener'](_0x2a64ee,_0x5c0757);};}exports[_0x9209('0x4')]=function(_0x60a846){for(var _0x139c05=0x0,_0x57c009=events[_0x9209('0x5')];_0x139c05<_0x57c009;_0x139c05++){var _0x221c1d=events[_0x139c05];var _0x336cba=createListener(_0x9209('0x6')+_0x221c1d,_0x60a846);OpenchannelInteractionEvents['on'](_0x221c1d,_0x336cba);}}; \ No newline at end of file +var _0xc804=['save','update','removeListener','register','openchannelInteraction:'];(function(_0x3a57e9,_0x590e02){var _0x93d12f=function(_0x49baf4){while(--_0x49baf4){_0x3a57e9['push'](_0x3a57e9['shift']());}};_0x93d12f(++_0x590e02);}(_0xc804,0x1d6));var _0x4c80=function(_0x1f0e4d,_0x2105f3){_0x1f0e4d=_0x1f0e4d-0x0;var _0x128996=_0xc804[_0x1f0e4d];return _0x128996;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x4c80('0x0'),'remove',_0x4c80('0x1')];function createListener(_0x682578,_0x3ec4a8){return function(_0x3b7d8c){_0x3ec4a8['emit'](_0x682578,_0x3b7d8c);};}function removeListener(_0x1aeae5,_0x56f781){return function(){OpenchannelInteractionEvents[_0x4c80('0x2')](_0x1aeae5,_0x56f781);};}exports[_0x4c80('0x3')]=function(_0x2c9e53){for(var _0x1e2f13=0x0,_0x5156f6=events['length'];_0x1e2f13<_0x5156f6;_0x1e2f13++){var _0x590b41=events[_0x1e2f13];var _0x310ce4=createListener(_0x4c80('0x4')+_0x590b41,_0x2c9e53);OpenchannelInteractionEvents['on'](_0x590b41,_0x310ce4);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 6a55ead..e37fb40 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0xf2c7ad,_0x1d929f){_0xf2c7ad=_0xf2c7ad-0x0;var _0x14b94e=_0x70e0[_0xf2c7ad];return _0x14b94e;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 7d5bd0f..2f8e8f5 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 _0x566f=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x319b33,_0xc5681c){var _0x2bce84=function(_0x1a8222){while(--_0x1a8222){_0x319b33['push'](_0x319b33['shift']());}};_0x2bce84(++_0xc5681c);}(_0x566f,0x124));var _0xf566=function(_0x1eefe5,_0x2c59e8){_0x1eefe5=_0x1eefe5-0x0;var _0xc7ad5c=_0x566f[_0x1eefe5];return _0xc7ad5c;};'use strict';var Sequelize=require(_0xf566('0x0'));module[_0xf566('0x1')]={'body':{'type':Sequelize[_0xf566('0x2')](_0xf566('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf566('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xf566('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf566('0x5')]('in',_0xf566('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xf566('0x7')]},'providerName':{'type':Sequelize[_0xf566('0x8')]},'providerResponse':{'type':Sequelize[_0xf566('0x2')]}}; \ No newline at end of file +var _0x7269=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x7269,0x76));var _0x9726=function(_0x4ded7f,_0x147611){_0x4ded7f=_0x4ded7f-0x0;var _0x160884=_0x7269[_0x4ded7f];return _0x160884;};'use strict';var Sequelize=require(_0x9726('0x0'));module[_0x9726('0x1')]={'body':{'type':Sequelize[_0x9726('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x9726('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9726('0x4')]('in','out'),'defaultValue':_0x9726('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9726('0x6')]},'providerName':{'type':Sequelize[_0x9726('0x7')]},'providerResponse':{'type':Sequelize[_0x9726('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 68c0424..449bab2 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 _0x6d0f=['create','body','find','describe','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','role','RejectMessage','SELECT','rejectmessage','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','result','catch','OpenchannelMessage,\x20%s,\x20%s','sendStatus','end','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','name','send','index','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','OpenchannelMessage','include','rows','params','rawAttributes','includeAll'];(function(_0x1ee62e,_0x159bb2){var _0x27c6c8=function(_0x31a5d4){while(--_0x31a5d4){_0x1ee62e['push'](_0x1ee62e['shift']());}};_0x27c6c8(++_0x159bb2);}(_0x6d0f,0x131));var _0xf6d0=function(_0x4ee463,_0x1814e0){_0x4ee463=_0x4ee463-0x0;var _0x5ae1fc=_0x6d0f[_0x4ee463];return _0x5ae1fc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf6d0('0x0'));var jsonpatch=require(_0xf6d0('0x1'));var rp=require(_0xf6d0('0x2'));var moment=require(_0xf6d0('0x3'));var BPromise=require(_0xf6d0('0x4'));var Mustache=require(_0xf6d0('0x5'));var util=require(_0xf6d0('0x6'));var path=require('path');var sox=require(_0xf6d0('0x7'));var csv=require(_0xf6d0('0x8'));var ejs=require(_0xf6d0('0x9'));var fs=require('fs');var fs_extra=require(_0xf6d0('0xa'));var _=require(_0xf6d0('0xb'));var squel=require(_0xf6d0('0xc'));var crypto=require(_0xf6d0('0xd'));var jsforce=require(_0xf6d0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf6d0('0x8'));var querystring=require(_0xf6d0('0xf'));var Papa=require('papaparse');var Redis=require(_0xf6d0('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf6d0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf6d0('0x12'))(_0xf6d0('0x13'));var utils=require(_0xf6d0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf6d0('0x15'));var db=require(_0xf6d0('0x16'))['db'];config[_0xf6d0('0x17')]=_[_0xf6d0('0x18')](config[_0xf6d0('0x17')],{'host':_0xf6d0('0x19'),'port':0x18eb});var socket=require(_0xf6d0('0x1a'))(new Redis(config[_0xf6d0('0x17')]));require(_0xf6d0('0x1b'))[_0xf6d0('0x1c')](socket);var jayson=require(_0xf6d0('0x1d'));var client=jayson[_0xf6d0('0x1e')][_0xf6d0('0x1f')]({'port':0x232c});var client9002=jayson[_0xf6d0('0x1e')][_0xf6d0('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x29715b,_0xbf45fb,_0x5c4521,_0x436b75){return new BPromise(function(_0x1742ad,_0x32a56f){var _0x3f7908=_0x436b75||client;return _0x3f7908[_0xf6d0('0x20')](_0x29715b,_0x5c4521)[_0xf6d0('0x21')](function(_0x4d9080){logger[_0xf6d0('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0xbf45fb,_0xf6d0('0x23'));logger[_0xf6d0('0x24')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0xbf45fb,_0xf6d0('0x23'),JSON[_0xf6d0('0x25')](_0x4d9080));if(_0x4d9080['error']){if(_0x4d9080[_0xf6d0('0x26')][_0xf6d0('0x27')]===0x1f4){logger[_0xf6d0('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0xbf45fb,_0x4d9080['error'][_0xf6d0('0x28')]);return _0x32a56f(_0x4d9080[_0xf6d0('0x26')][_0xf6d0('0x28')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0xbf45fb,_0x4d9080[_0xf6d0('0x26')][_0xf6d0('0x28')]);return _0x1742ad(_0x4d9080[_0xf6d0('0x26')][_0xf6d0('0x28')]);}else{logger[_0xf6d0('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0xbf45fb,_0xf6d0('0x23'));_0x1742ad(_0x4d9080[_0xf6d0('0x29')]['message']);}})[_0xf6d0('0x2a')](function(_0x242af0){logger['error'](_0xf6d0('0x2b'),_0xbf45fb,_0x242af0);_0x32a56f(_0x242af0);});});}function respondWithStatusCode(_0x29b1cb,_0x108f70){_0x108f70=_0x108f70||0xcc;return function(_0x52ee1d){if(_0x52ee1d){return _0x29b1cb[_0xf6d0('0x2c')](_0x108f70);}return _0x29b1cb['status'](_0x108f70)[_0xf6d0('0x2d')]();};}function respondWithResult(_0x520375,_0x5cd71d){_0x5cd71d=_0x5cd71d||0xc8;return function(_0x1790f8){if(_0x1790f8){return _0x520375[_0xf6d0('0x2e')](_0x5cd71d)['json'](_0x1790f8);}};}function respondWithFilteredResult(_0x47e4d7,_0x588c2d){return function(_0x436e4b){if(_0x436e4b){var _0x47a5ed=typeof _0x588c2d[_0xf6d0('0x2f')]==='undefined'&&typeof _0x588c2d[_0xf6d0('0x30')]==='undefined';var _0x360b36=_0x436e4b['count'];var _0x3b8fcc=_0x47a5ed?0x0:_0x588c2d[_0xf6d0('0x2f')];var _0x4bd8f6=_0x47a5ed?_0x436e4b[_0xf6d0('0x31')]:_0x588c2d[_0xf6d0('0x2f')]+_0x588c2d[_0xf6d0('0x30')];var _0xf5edca;if(_0x4bd8f6>=_0x360b36){_0x4bd8f6=_0x360b36;_0xf5edca=0xc8;}else{_0xf5edca=0xce;}_0x47e4d7[_0xf6d0('0x2e')](_0xf5edca);return _0x47e4d7[_0xf6d0('0x32')](_0xf6d0('0x33'),_0x3b8fcc+'-'+_0x4bd8f6+'/'+_0x360b36)[_0xf6d0('0x34')](_0x436e4b);}return null;};}function patchUpdates(_0x5b1be5){return function(_0x4ade69){try{jsonpatch[_0xf6d0('0x35')](_0x4ade69,_0x5b1be5,!![]);}catch(_0x484c1b){return BPromise[_0xf6d0('0x36')](_0x484c1b);}return _0x4ade69[_0xf6d0('0x37')]();};}function saveUpdates(_0x1adc46,_0x122c6c){return function(_0x4f600f){if(_0x4f600f){return _0x4f600f[_0xf6d0('0x38')](_0x1adc46)[_0xf6d0('0x21')](function(_0x15fe70){return _0x15fe70;});}return null;};}function removeEntity(_0x273355,_0x2709c9){return function(_0x515af4){if(_0x515af4){return _0x515af4[_0xf6d0('0x39')]()['then'](function(){_0x273355['status'](0xcc)[_0xf6d0('0x2d')]();});}};}function handleEntityNotFound(_0x595ea9,_0x577ba6){return function(_0x5058c4){if(!_0x5058c4){_0x595ea9[_0xf6d0('0x2c')](0x194);}return _0x5058c4;};}function handleError(_0x5c3afc,_0x3afe99){_0x3afe99=_0x3afe99||0x1f4;return function(_0x40ce3f){logger[_0xf6d0('0x26')](_0x40ce3f['stack']);if(_0x40ce3f[_0xf6d0('0x3a')]){delete _0x40ce3f[_0xf6d0('0x3a')];}_0x5c3afc[_0xf6d0('0x2e')](_0x3afe99)[_0xf6d0('0x3b')](_0x40ce3f);};}exports[_0xf6d0('0x3c')]=function(_0x35e4de,_0x263387){var _0x5535d5={},_0x230be6={},_0x4e1ec1={'count':0x0,'rows':[]};var _0x27ab79=_['map'](db['OpenchannelMessage']['rawAttributes'],function(_0xfdc2ac){return{'name':_0xfdc2ac[_0xf6d0('0x3d')],'type':_0xfdc2ac[_0xf6d0('0x3e')][_0xf6d0('0x3f')]};});_0x230be6[_0xf6d0('0x40')]=_[_0xf6d0('0x41')](_0x27ab79,_0xf6d0('0x3a'));_0x230be6[_0xf6d0('0x42')]=_[_0xf6d0('0x43')](_0x35e4de[_0xf6d0('0x42')]);_0x230be6['filters']=_['intersection'](_0x230be6[_0xf6d0('0x40')],_0x230be6[_0xf6d0('0x42')]);_0x5535d5['attributes']=_[_0xf6d0('0x44')](_0x230be6[_0xf6d0('0x40')],qs[_0xf6d0('0x45')](_0x35e4de[_0xf6d0('0x42')][_0xf6d0('0x45')]));_0x5535d5[_0xf6d0('0x46')]=_0x5535d5[_0xf6d0('0x46')][_0xf6d0('0x47')]?_0x5535d5[_0xf6d0('0x46')]:_0x230be6['model'];if(!_0x35e4de[_0xf6d0('0x42')][_0xf6d0('0x48')](_0xf6d0('0x49'))){_0x5535d5[_0xf6d0('0x30')]=qs[_0xf6d0('0x30')](_0x35e4de[_0xf6d0('0x42')][_0xf6d0('0x30')]);_0x5535d5[_0xf6d0('0x2f')]=qs['offset'](_0x35e4de['query'][_0xf6d0('0x2f')]);}_0x5535d5['order']=qs[_0xf6d0('0x4a')](_0x35e4de[_0xf6d0('0x42')][_0xf6d0('0x4a')]);_0x5535d5[_0xf6d0('0x4b')]=qs[_0xf6d0('0x4c')](_[_0xf6d0('0x4d')](_0x35e4de[_0xf6d0('0x42')],_0x230be6[_0xf6d0('0x4c')]),_0x27ab79);if(_0x35e4de[_0xf6d0('0x42')]['filter']){_0x5535d5[_0xf6d0('0x4b')]=_[_0xf6d0('0x4e')](_0x5535d5[_0xf6d0('0x4b')],{'$or':_[_0xf6d0('0x41')](_0x27ab79,function(_0x531ad2){if(_0x531ad2[_0xf6d0('0x3e')]!==_0xf6d0('0x4f')){var _0x6db9a8={};_0x6db9a8[_0x531ad2[_0xf6d0('0x3a')]]={'$like':'%'+_0x35e4de[_0xf6d0('0x42')][_0xf6d0('0x50')]+'%'};return _0x6db9a8;}})});}_0x5535d5=_[_0xf6d0('0x4e')]({},_0x5535d5,_0x35e4de[_0xf6d0('0x51')]);var _0x592c24={'where':_0x5535d5[_0xf6d0('0x4b')]};return db[_0xf6d0('0x52')][_0xf6d0('0x31')](_0x592c24)[_0xf6d0('0x21')](function(_0x1644eb){_0x4e1ec1[_0xf6d0('0x31')]=_0x1644eb;if(_0x35e4de[_0xf6d0('0x42')]['includeAll']){_0x5535d5[_0xf6d0('0x53')]=[{'all':!![]}];}return db[_0xf6d0('0x52')]['findAll'](_0x5535d5);})[_0xf6d0('0x21')](function(_0x787ab0){_0x4e1ec1[_0xf6d0('0x54')]=_0x787ab0;return _0x4e1ec1;})['then'](respondWithFilteredResult(_0x263387,_0x5535d5))[_0xf6d0('0x2a')](handleError(_0x263387,null));};exports['show']=function(_0x59f032,_0x2f7d22){var _0x235409={'raw':!![],'where':{'id':_0x59f032[_0xf6d0('0x55')]['id']}},_0x3537aa={};_0x3537aa[_0xf6d0('0x40')]=_[_0xf6d0('0x43')](db[_0xf6d0('0x52')][_0xf6d0('0x56')]);_0x3537aa[_0xf6d0('0x42')]=_['keys'](_0x59f032[_0xf6d0('0x42')]);_0x3537aa[_0xf6d0('0x4c')]=_[_0xf6d0('0x44')](_0x3537aa[_0xf6d0('0x40')],_0x3537aa['query']);_0x235409[_0xf6d0('0x46')]=_[_0xf6d0('0x44')](_0x3537aa[_0xf6d0('0x40')],qs[_0xf6d0('0x45')](_0x59f032[_0xf6d0('0x42')][_0xf6d0('0x45')]));_0x235409[_0xf6d0('0x46')]=_0x235409['attributes'][_0xf6d0('0x47')]?_0x235409['attributes']:_0x3537aa[_0xf6d0('0x40')];if(_0x59f032[_0xf6d0('0x42')][_0xf6d0('0x57')]){_0x235409[_0xf6d0('0x53')]=[{'all':!![]}];}_0x235409=_[_0xf6d0('0x4e')]({},_0x235409,_0x59f032[_0xf6d0('0x51')]);return db[_0xf6d0('0x52')]['find'](_0x235409)['then'](handleEntityNotFound(_0x2f7d22,null))[_0xf6d0('0x21')](respondWithResult(_0x2f7d22,null))['catch'](handleError(_0x2f7d22,null));};exports[_0xf6d0('0x58')]=function(_0xbb09c5,_0x48157c){return db[_0xf6d0('0x52')]['create'](_0xbb09c5['body'],{})[_0xf6d0('0x21')](respondWithResult(_0x48157c,0xc9))[_0xf6d0('0x2a')](handleError(_0x48157c,null));};exports[_0xf6d0('0x38')]=function(_0x121df1,_0x3f24c2){if(_0x121df1[_0xf6d0('0x59')]['id']){delete _0x121df1[_0xf6d0('0x59')]['id'];}return db[_0xf6d0('0x52')][_0xf6d0('0x5a')]({'where':{'id':_0x121df1[_0xf6d0('0x55')]['id']}})['then'](handleEntityNotFound(_0x3f24c2,null))[_0xf6d0('0x21')](saveUpdates(_0x121df1[_0xf6d0('0x59')],null))[_0xf6d0('0x21')](respondWithResult(_0x3f24c2,null))[_0xf6d0('0x2a')](handleError(_0x3f24c2,null));};exports['destroy']=function(_0x352f00,_0x45871e){return db[_0xf6d0('0x52')][_0xf6d0('0x5a')]({'where':{'id':_0x352f00[_0xf6d0('0x55')]['id']}})[_0xf6d0('0x21')](handleEntityNotFound(_0x45871e,null))[_0xf6d0('0x21')](removeEntity(_0x45871e,null))['catch'](handleError(_0x45871e,null));};exports[_0xf6d0('0x5b')]=function(_0x8660d6,_0x47304a){return db[_0xf6d0('0x52')][_0xf6d0('0x5b')]()[_0xf6d0('0x21')](respondWithResult(_0x47304a,null))[_0xf6d0('0x2a')](handleError(_0x47304a,null));};var interaction_log=require(_0xf6d0('0x12'))(_0xf6d0('0x5c'));exports[_0xf6d0('0x5d')]=function(_0x5c2ab3,_0x217019,_0x530b54){var _0x170dc6={'agent':{},'channel':_0xf6d0('0x5e')};if(_0x5c2ab3[_0xf6d0('0x59')]['id']){delete _0x5c2ab3[_0xf6d0('0x59')]['id'];}_0x5c2ab3['body'][_0xf6d0('0x5f')]=!![];_0x5c2ab3[_0xf6d0('0x59')]['readAt']=moment()[_0xf6d0('0x60')](_0xf6d0('0x61'));_0x5c2ab3['body'][_0xf6d0('0x62')]=_0x5c2ab3[_0xf6d0('0x59')][_0xf6d0('0x62')]||_0x5c2ab3[_0xf6d0('0x63')]['id'];_0x170dc6[_0xf6d0('0x64')]['id']=_0x5c2ab3[_0xf6d0('0x59')][_0xf6d0('0x62')];return db[_0xf6d0('0x52')][_0xf6d0('0x5a')]({'where':{'id':_0x5c2ab3[_0xf6d0('0x55')]['id'],'UserId':null}})[_0xf6d0('0x21')](handleEntityNotFound(_0x217019,null))[_0xf6d0('0x21')](saveUpdates(_0x5c2ab3['body'],null))[_0xf6d0('0x21')](function(_0x35e436){if(_0x35e436){_0x170dc6['message']=_0x35e436['get']({'plain':!![]});return db[_0xf6d0('0x65')][_0xf6d0('0x5a')]({'where':{'id':_0x35e436[_0xf6d0('0x66')]}});}return null;})[_0xf6d0('0x21')](handleEntityNotFound(_0x217019,null))['then'](function(_0x14d757){if(_0x14d757){return _0x14d757[_0xf6d0('0x38')]({'UserId':_0x5c2ab3[_0xf6d0('0x59')][_0xf6d0('0x62')],'read1stAt':_[_0xf6d0('0x67')](_0x14d757[_0xf6d0('0x68')])?moment()[_0xf6d0('0x60')](_0xf6d0('0x61')):undefined});}return null;})[_0xf6d0('0x21')](function(_0x2a901c){if(_0x2a901c){_0x170dc6[_0xf6d0('0x69')]=_0x2a901c[_0xf6d0('0x6a')]({'plain':!![]});interaction_log[_0xf6d0('0x22')](_0xf6d0('0x6b'),_0x5c2ab3[_0xf6d0('0x63')]['id'],_0x5c2ab3[_0xf6d0('0x63')][_0xf6d0('0x3a')],_0x5c2ab3['user']['role'],_0x170dc6[_0xf6d0('0x69')]['id'],_0x5c2ab3['body']?JSON[_0xf6d0('0x25')](_0x5c2ab3[_0xf6d0('0x59')]):_0xf6d0('0x6c'));return respondWithRpcPromise(_0xf6d0('0x6d'),_0xf6d0('0x6e'),_0x170dc6);}return null;})[_0xf6d0('0x21')](function(_0x50002d){var _0x4d4a81=_0xf6d0('0x6f')+_0x50002d[_0xf6d0('0x28')][_0xf6d0('0x70')];return db['sequelize'][_0xf6d0('0x42')](_0x4d4a81,{'type':db[_0xf6d0('0x71')][_0xf6d0('0x72')]['SELECT'],'raw':!![]})['then'](function(_0x54f9b4){return _0x54f9b4;});})[_0xf6d0('0x21')](function(_0x228805){if(_0x228805){_0x170dc6[_0xf6d0('0x28')][_0xf6d0('0x73')]=_0x228805[0x0];if(!_0x5c2ab3[_0xf6d0('0x59')][_0xf6d0('0x62')])return;return db[_0xf6d0('0x74')][_0xf6d0('0x5a')]({'where':{'id':_0x5c2ab3[_0xf6d0('0x59')][_0xf6d0('0x62')],'role':_0xf6d0('0x64')},'attributes':['id',_0xf6d0('0x3a'),_0xf6d0('0x75'),_0xf6d0('0x76'),_0xf6d0('0x77')],'raw':!![]});}return null;})['then'](function(_0x311726){if(!_0x311726)return null;_0x170dc6[_0xf6d0('0x28')][_0xf6d0('0x64')]=_0x311726;return _0x170dc6;})['then'](function(_0xeab1c9){if(_0xeab1c9){if(_0x5c2ab3[_0xf6d0('0x59')][_0xf6d0('0x78')]){_0x170dc6['message'][_0xf6d0('0x79')]=util[_0xf6d0('0x60')](_0xf6d0('0x7a'),_0x5c2ab3[_0xf6d0('0x63')][_0xf6d0('0x3a')]);_0x170dc6[_0xf6d0('0x28')]['channel']=_0x170dc6[_0xf6d0('0x7b')];_0x170dc6['message'][_0xf6d0('0x7c')]=_0xf6d0('0x5d');return respondWithRpcPromise('EventManager',_0xf6d0('0x7d'),{'event':_0xf6d0('0x7e'),'message':_0x170dc6['message']},client9002)['then'](function(){return _0x170dc6;});}return _0x170dc6;}return null;})['then'](respondWithResult(_0x217019,null))[_0xf6d0('0x2a')](handleError(_0x217019,null));};var interaction_log=require(_0xf6d0('0x12'))(_0xf6d0('0x5c'));exports[_0xf6d0('0x36')]=function(_0xf0b2cb,_0x1d08ce,_0x25e990){var _0x39c0a7={'agent':{},'channel':'openchannel'};if(_0xf0b2cb['body']['id']){delete _0xf0b2cb['body']['id'];}_0xf0b2cb[_0xf6d0('0x59')][_0xf6d0('0x62')]=_0xf0b2cb[_0xf6d0('0x59')][_0xf6d0('0x62')]||_0xf0b2cb[_0xf6d0('0x63')]['id'];_0x39c0a7['agent']['id']=_0xf0b2cb[_0xf6d0('0x59')][_0xf6d0('0x62')];return db[_0xf6d0('0x52')]['find']({'where':{'id':_0xf0b2cb[_0xf6d0('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1d08ce,null))[_0xf6d0('0x21')](function(_0x2337fa){if(_0x2337fa){_0x39c0a7['message']=_0x2337fa[_0xf6d0('0x6a')]({'plain':!![]});return db[_0xf6d0('0x65')][_0xf6d0('0x5a')]({'where':{'id':_0x2337fa[_0xf6d0('0x66')]}});}return null;})[_0xf6d0('0x21')](handleEntityNotFound(_0x1d08ce,null))[_0xf6d0('0x21')](function(_0x130c1e){if(_0x130c1e){_0x39c0a7[_0xf6d0('0x69')]=_0x130c1e[_0xf6d0('0x6a')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf0b2cb[_0xf6d0('0x63')]['id'],_0xf0b2cb['user'][_0xf6d0('0x3a')],_0xf0b2cb[_0xf6d0('0x63')][_0xf6d0('0x7f')],_0x39c0a7[_0xf6d0('0x69')]['id'],_0xf0b2cb['body']?JSON[_0xf6d0('0x25')](_0xf0b2cb[_0xf6d0('0x59')]):_0xf6d0('0x6c'));return respondWithRpcPromise(_0xf6d0('0x80'),'rejectMessage',_0x39c0a7);}return null;})[_0xf6d0('0x21')](function(_0x58fd14){var _0x297537=_0xf6d0('0x6f')+_0x58fd14[_0xf6d0('0x28')][_0xf6d0('0x70')];return db['sequelize'][_0xf6d0('0x42')](_0x297537,{'type':db[_0xf6d0('0x71')][_0xf6d0('0x72')][_0xf6d0('0x81')],'raw':!![]})[_0xf6d0('0x21')](function(_0x33a8ed){return _0x33a8ed;});})[_0xf6d0('0x21')](function(_0x2ba7b0){if(_0x2ba7b0){_0x39c0a7['message'][_0xf6d0('0x73')]=_0x2ba7b0[0x0];if(!_0xf0b2cb[_0xf6d0('0x59')]['UserId'])return;return db[_0xf6d0('0x74')][_0xf6d0('0x5a')]({'where':{'id':_0xf0b2cb['body'][_0xf6d0('0x62')],'role':_0xf6d0('0x64')},'attributes':['id',_0xf6d0('0x3a'),_0xf6d0('0x75'),_0xf6d0('0x76'),_0xf6d0('0x77')],'raw':!![]});}return null;})['then'](function(_0x586a0c){if(!_0x586a0c)return null;_0x39c0a7[_0xf6d0('0x28')]['agent']=_0x586a0c;return _0x39c0a7;})[_0xf6d0('0x21')](function(_0x7440c3){if(_0x7440c3){_0x7440c3['message']['interface']=util['format'](_0xf6d0('0x7a'),_0xf0b2cb['user'][_0xf6d0('0x3a')]);_0x7440c3[_0xf6d0('0x28')]['channel']=_0x39c0a7[_0xf6d0('0x7b')];_0x7440c3[_0xf6d0('0x28')]['event']=_0xf6d0('0x36');respondWithRpcPromise(_0xf6d0('0x7d'),_0xf6d0('0x7d'),{'event':_0xf6d0('0x82'),'message':_0x7440c3[_0xf6d0('0x28')]},client9002);return _0x39c0a7;}return null;})[_0xf6d0('0x21')](respondWithResult(_0x1d08ce,null))['catch'](handleError(_0x1d08ce,null));}; \ No newline at end of file +var _0x0a08=['key','model','query','keys','intersection','attributes','fields','nolimit','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','OpenchannelMessage','includeAll','findAll','rows','show','params','rawAttributes','length','include','find','create','body','update','describe','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','openchannel-interactions','null','rejectMessage','internal','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','fieldName','type'];(function(_0xcb8d50,_0x3d470f){var _0x5a292c=function(_0x3c6978){while(--_0x3c6978){_0xcb8d50['push'](_0xcb8d50['shift']());}};_0x5a292c(++_0x3d470f);}(_0x0a08,0x153));var _0x80a0=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x0a08[_0x47b58b];return _0x46bebe;};'use strict';var emlformat=require(_0x80a0('0x0'));var rimraf=require(_0x80a0('0x1'));var zipdir=require(_0x80a0('0x2'));var jsonpatch=require(_0x80a0('0x3'));var rp=require(_0x80a0('0x4'));var moment=require(_0x80a0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x80a0('0x6'));var util=require('util');var path=require(_0x80a0('0x7'));var sox=require(_0x80a0('0x8'));var csv=require(_0x80a0('0x9'));var ejs=require(_0x80a0('0xa'));var fs=require('fs');var fs_extra=require(_0x80a0('0xb'));var _=require(_0x80a0('0xc'));var squel=require('squel');var crypto=require(_0x80a0('0xd'));var jsforce=require(_0x80a0('0xe'));var deskjs=require(_0x80a0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x80a0('0x10'));var Papa=require(_0x80a0('0x11'));var Redis=require(_0x80a0('0x12'));var authService=require(_0x80a0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x80a0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x80a0('0x15'))(_0x80a0('0x16'));var utils=require(_0x80a0('0x17'));var config=require(_0x80a0('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x80a0('0x19'))['db'];config[_0x80a0('0x1a')]=_[_0x80a0('0x1b')](config[_0x80a0('0x1a')],{'host':_0x80a0('0x1c'),'port':0x18eb});var socket=require(_0x80a0('0x1d'))(new Redis(config['redis']));require(_0x80a0('0x1e'))[_0x80a0('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x80a0('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x80a0('0x20')][_0x80a0('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x15f71c,_0x3fe3c2,_0x453ea9,_0x27b06f){return new BPromise(function(_0x252762,_0xc95622){var _0x45addd=_0x27b06f||client;return _0x45addd[_0x80a0('0x22')](_0x15f71c,_0x453ea9)[_0x80a0('0x23')](function(_0x51cf83){logger[_0x80a0('0x24')](_0x80a0('0x25'),_0x3fe3c2,_0x80a0('0x26'));logger[_0x80a0('0x27')](_0x80a0('0x28'),_0x3fe3c2,_0x80a0('0x26'),JSON['stringify'](_0x51cf83));if(_0x51cf83[_0x80a0('0x29')]){if(_0x51cf83[_0x80a0('0x29')][_0x80a0('0x2a')]===0x1f4){logger[_0x80a0('0x29')](_0x80a0('0x25'),_0x3fe3c2,_0x51cf83[_0x80a0('0x29')]['message']);return _0xc95622(_0x51cf83[_0x80a0('0x29')][_0x80a0('0x2b')]);}logger[_0x80a0('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x3fe3c2,_0x51cf83[_0x80a0('0x29')]['message']);return _0x252762(_0x51cf83[_0x80a0('0x29')][_0x80a0('0x2b')]);}else{logger[_0x80a0('0x24')](_0x80a0('0x25'),_0x3fe3c2,'request\x20sent');_0x252762(_0x51cf83[_0x80a0('0x2c')][_0x80a0('0x2b')]);}})[_0x80a0('0x2d')](function(_0x163807){logger[_0x80a0('0x29')](_0x80a0('0x25'),_0x3fe3c2,_0x163807);_0xc95622(_0x163807);});});}function respondWithStatusCode(_0x53cc64,_0x1a8817){_0x1a8817=_0x1a8817||0xcc;return function(_0x3cb993){if(_0x3cb993){return _0x53cc64[_0x80a0('0x2e')](_0x1a8817);}return _0x53cc64[_0x80a0('0x2f')](_0x1a8817)[_0x80a0('0x30')]();};}function respondWithResult(_0x616e14,_0x448386){_0x448386=_0x448386||0xc8;return function(_0x3e9e1f){if(_0x3e9e1f){return _0x616e14['status'](_0x448386)[_0x80a0('0x31')](_0x3e9e1f);}};}function respondWithFilteredResult(_0x26323a,_0x4c2a08){return function(_0x49b749){if(_0x49b749){var _0x3331be=typeof _0x4c2a08[_0x80a0('0x32')]===_0x80a0('0x33')&&typeof _0x4c2a08[_0x80a0('0x34')]===_0x80a0('0x33');var _0x5536c1=_0x49b749[_0x80a0('0x35')];var _0x3abc5f=_0x3331be?0x0:_0x4c2a08[_0x80a0('0x32')];var _0x1bd0e4=_0x3331be?_0x49b749[_0x80a0('0x35')]:_0x4c2a08[_0x80a0('0x32')]+_0x4c2a08[_0x80a0('0x34')];var _0x932703;if(_0x1bd0e4>=_0x5536c1){_0x1bd0e4=_0x5536c1;_0x932703=0xc8;}else{_0x932703=0xce;}_0x26323a[_0x80a0('0x2f')](_0x932703);return _0x26323a[_0x80a0('0x36')](_0x80a0('0x37'),_0x3abc5f+'-'+_0x1bd0e4+'/'+_0x5536c1)[_0x80a0('0x31')](_0x49b749);}return null;};}function patchUpdates(_0x1dafbb){return function(_0x3204fa){try{jsonpatch[_0x80a0('0x38')](_0x3204fa,_0x1dafbb,!![]);}catch(_0x1a7678){return BPromise[_0x80a0('0x39')](_0x1a7678);}return _0x3204fa[_0x80a0('0x3a')]();};}function saveUpdates(_0x23aa90,_0x55f0be){return function(_0x189505){if(_0x189505){return _0x189505['update'](_0x23aa90)[_0x80a0('0x23')](function(_0x22f27f){return _0x22f27f;});}return null;};}function removeEntity(_0x3a7f60,_0x2aee42){return function(_0x3614bf){if(_0x3614bf){return _0x3614bf[_0x80a0('0x3b')]()['then'](function(){_0x3a7f60[_0x80a0('0x2f')](0xcc)[_0x80a0('0x30')]();});}};}function handleEntityNotFound(_0x520a02,_0x4a0d89){return function(_0x3dde0f){if(!_0x3dde0f){_0x520a02[_0x80a0('0x2e')](0x194);}return _0x3dde0f;};}function handleError(_0x27a361,_0xc8ddda){_0xc8ddda=_0xc8ddda||0x1f4;return function(_0x29f8b0){logger['error'](_0x29f8b0[_0x80a0('0x3c')]);if(_0x29f8b0[_0x80a0('0x3d')]){delete _0x29f8b0[_0x80a0('0x3d')];}_0x27a361[_0x80a0('0x2f')](_0xc8ddda)[_0x80a0('0x3e')](_0x29f8b0);};}exports[_0x80a0('0x3f')]=function(_0x25653c,_0x19f2bc){var _0x268270={},_0x1cc488={},_0x10e88e={'count':0x0,'rows':[]};var _0x2687e3=_['map'](db['OpenchannelMessage']['rawAttributes'],function(_0x4c250b){return{'name':_0x4c250b[_0x80a0('0x40')],'type':_0x4c250b[_0x80a0('0x41')][_0x80a0('0x42')]};});_0x1cc488[_0x80a0('0x43')]=_['map'](_0x2687e3,_0x80a0('0x3d'));_0x1cc488[_0x80a0('0x44')]=_[_0x80a0('0x45')](_0x25653c[_0x80a0('0x44')]);_0x1cc488['filters']=_[_0x80a0('0x46')](_0x1cc488[_0x80a0('0x43')],_0x1cc488['query']);_0x268270[_0x80a0('0x47')]=_['intersection'](_0x1cc488['model'],qs[_0x80a0('0x48')](_0x25653c[_0x80a0('0x44')][_0x80a0('0x48')]));_0x268270[_0x80a0('0x47')]=_0x268270[_0x80a0('0x47')]['length']?_0x268270[_0x80a0('0x47')]:_0x1cc488[_0x80a0('0x43')];if(!_0x25653c[_0x80a0('0x44')]['hasOwnProperty'](_0x80a0('0x49'))){_0x268270[_0x80a0('0x34')]=qs['limit'](_0x25653c['query'][_0x80a0('0x34')]);_0x268270[_0x80a0('0x32')]=qs['offset'](_0x25653c['query'][_0x80a0('0x32')]);}_0x268270['order']=qs[_0x80a0('0x4a')](_0x25653c[_0x80a0('0x44')][_0x80a0('0x4a')]);_0x268270['where']=qs[_0x80a0('0x4b')](_[_0x80a0('0x4c')](_0x25653c[_0x80a0('0x44')],_0x1cc488[_0x80a0('0x4b')]),_0x2687e3);if(_0x25653c['query'][_0x80a0('0x4d')]){_0x268270[_0x80a0('0x4e')]=_[_0x80a0('0x4f')](_0x268270['where'],{'$or':_[_0x80a0('0x50')](_0x2687e3,function(_0x4b827c){if(_0x4b827c[_0x80a0('0x41')]!==_0x80a0('0x51')){var _0x410eaf={};_0x410eaf[_0x4b827c[_0x80a0('0x3d')]]={'$like':'%'+_0x25653c[_0x80a0('0x44')][_0x80a0('0x4d')]+'%'};return _0x410eaf;}})});}_0x268270=_[_0x80a0('0x4f')]({},_0x268270,_0x25653c[_0x80a0('0x52')]);var _0x1e76d6={'where':_0x268270[_0x80a0('0x4e')]};return db[_0x80a0('0x53')]['count'](_0x1e76d6)[_0x80a0('0x23')](function(_0x2c3c77){_0x10e88e['count']=_0x2c3c77;if(_0x25653c[_0x80a0('0x44')][_0x80a0('0x54')]){_0x268270['include']=[{'all':!![]}];}return db[_0x80a0('0x53')][_0x80a0('0x55')](_0x268270);})[_0x80a0('0x23')](function(_0x2be628){_0x10e88e[_0x80a0('0x56')]=_0x2be628;return _0x10e88e;})[_0x80a0('0x23')](respondWithFilteredResult(_0x19f2bc,_0x268270))[_0x80a0('0x2d')](handleError(_0x19f2bc,null));};exports[_0x80a0('0x57')]=function(_0x9ec95d,_0x1d5aa8){var _0x560e85={'raw':!![],'where':{'id':_0x9ec95d[_0x80a0('0x58')]['id']}},_0x541d0e={};_0x541d0e['model']=_['keys'](db[_0x80a0('0x53')][_0x80a0('0x59')]);_0x541d0e['query']=_[_0x80a0('0x45')](_0x9ec95d[_0x80a0('0x44')]);_0x541d0e[_0x80a0('0x4b')]=_[_0x80a0('0x46')](_0x541d0e[_0x80a0('0x43')],_0x541d0e[_0x80a0('0x44')]);_0x560e85[_0x80a0('0x47')]=_['intersection'](_0x541d0e[_0x80a0('0x43')],qs[_0x80a0('0x48')](_0x9ec95d['query']['fields']));_0x560e85['attributes']=_0x560e85[_0x80a0('0x47')][_0x80a0('0x5a')]?_0x560e85[_0x80a0('0x47')]:_0x541d0e['model'];if(_0x9ec95d['query'][_0x80a0('0x54')]){_0x560e85[_0x80a0('0x5b')]=[{'all':!![]}];}_0x560e85=_[_0x80a0('0x4f')]({},_0x560e85,_0x9ec95d['options']);return db[_0x80a0('0x53')][_0x80a0('0x5c')](_0x560e85)[_0x80a0('0x23')](handleEntityNotFound(_0x1d5aa8,null))[_0x80a0('0x23')](respondWithResult(_0x1d5aa8,null))[_0x80a0('0x2d')](handleError(_0x1d5aa8,null));};exports[_0x80a0('0x5d')]=function(_0x310392,_0x51759e){return db[_0x80a0('0x53')][_0x80a0('0x5d')](_0x310392[_0x80a0('0x5e')],{})['then'](respondWithResult(_0x51759e,0xc9))[_0x80a0('0x2d')](handleError(_0x51759e,null));};exports[_0x80a0('0x5f')]=function(_0x52ff9c,_0x4ac6e2){if(_0x52ff9c[_0x80a0('0x5e')]['id']){delete _0x52ff9c[_0x80a0('0x5e')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x52ff9c[_0x80a0('0x58')]['id']}})[_0x80a0('0x23')](handleEntityNotFound(_0x4ac6e2,null))['then'](saveUpdates(_0x52ff9c[_0x80a0('0x5e')],null))[_0x80a0('0x23')](respondWithResult(_0x4ac6e2,null))[_0x80a0('0x2d')](handleError(_0x4ac6e2,null));};exports[_0x80a0('0x3b')]=function(_0x3b250e,_0x3acbf8){return db[_0x80a0('0x53')]['find']({'where':{'id':_0x3b250e[_0x80a0('0x58')]['id']}})['then'](handleEntityNotFound(_0x3acbf8,null))[_0x80a0('0x23')](removeEntity(_0x3acbf8,null))['catch'](handleError(_0x3acbf8,null));};exports[_0x80a0('0x60')]=function(_0x2ec983,_0x4c9077){return db['OpenchannelMessage'][_0x80a0('0x60')]()[_0x80a0('0x23')](respondWithResult(_0x4c9077,null))[_0x80a0('0x2d')](handleError(_0x4c9077,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x80a0('0x61')]=function(_0x42109d,_0x49873b,_0x2423f5){var _0x2c89f2={'agent':{},'channel':'openchannel'};if(_0x42109d[_0x80a0('0x5e')]['id']){delete _0x42109d[_0x80a0('0x5e')]['id'];}_0x42109d['body'][_0x80a0('0x62')]=!![];_0x42109d[_0x80a0('0x5e')]['readAt']=moment()[_0x80a0('0x63')](_0x80a0('0x64'));_0x42109d[_0x80a0('0x5e')]['UserId']=_0x42109d[_0x80a0('0x5e')]['UserId']||_0x42109d[_0x80a0('0x65')]['id'];_0x2c89f2[_0x80a0('0x66')]['id']=_0x42109d[_0x80a0('0x5e')][_0x80a0('0x67')];return db[_0x80a0('0x53')][_0x80a0('0x5c')]({'where':{'id':_0x42109d[_0x80a0('0x58')]['id'],'UserId':null}})[_0x80a0('0x23')](handleEntityNotFound(_0x49873b,null))[_0x80a0('0x23')](saveUpdates(_0x42109d[_0x80a0('0x5e')],null))[_0x80a0('0x23')](function(_0x546d58){if(_0x546d58){_0x2c89f2[_0x80a0('0x2b')]=_0x546d58['get']({'plain':!![]});return db[_0x80a0('0x68')][_0x80a0('0x5c')]({'where':{'id':_0x546d58[_0x80a0('0x69')]}});}return null;})[_0x80a0('0x23')](handleEntityNotFound(_0x49873b,null))[_0x80a0('0x23')](function(_0x3761b9){if(_0x3761b9){return _0x3761b9[_0x80a0('0x5f')]({'UserId':_0x42109d[_0x80a0('0x5e')][_0x80a0('0x67')],'read1stAt':_[_0x80a0('0x6a')](_0x3761b9['read1stAt'])?moment()[_0x80a0('0x63')](_0x80a0('0x64')):undefined});}return null;})[_0x80a0('0x23')](function(_0x12e766){if(_0x12e766){_0x2c89f2[_0x80a0('0x6b')]=_0x12e766[_0x80a0('0x6c')]({'plain':!![]});interaction_log[_0x80a0('0x24')](_0x80a0('0x6d'),_0x42109d[_0x80a0('0x65')]['id'],_0x42109d[_0x80a0('0x65')][_0x80a0('0x3d')],_0x42109d[_0x80a0('0x65')][_0x80a0('0x6e')],_0x2c89f2[_0x80a0('0x6b')]['id'],_0x42109d['body']?JSON[_0x80a0('0x6f')](_0x42109d[_0x80a0('0x5e')]):'null');return respondWithRpcPromise(_0x80a0('0x70'),_0x80a0('0x71'),_0x2c89f2);}return null;})[_0x80a0('0x23')](function(_0x146a44){var _0x58ffe2=_0x80a0('0x72')+_0x146a44['message'][_0x80a0('0x73')];return db[_0x80a0('0x74')][_0x80a0('0x44')](_0x58ffe2,{'type':db[_0x80a0('0x75')][_0x80a0('0x76')][_0x80a0('0x77')],'raw':!![]})['then'](function(_0x20f815){return _0x20f815;});})[_0x80a0('0x23')](function(_0x3ff67d){if(_0x3ff67d){_0x2c89f2[_0x80a0('0x2b')][_0x80a0('0x78')]=_0x3ff67d[0x0];if(!_0x42109d[_0x80a0('0x5e')][_0x80a0('0x67')])return;return db[_0x80a0('0x79')]['find']({'where':{'id':_0x42109d['body'][_0x80a0('0x67')],'role':_0x80a0('0x66')},'attributes':['id',_0x80a0('0x3d'),_0x80a0('0x7a'),_0x80a0('0x7b'),'internal'],'raw':!![]});}return null;})['then'](function(_0x124344){if(!_0x124344)return null;_0x2c89f2[_0x80a0('0x2b')]['agent']=_0x124344;return _0x2c89f2;})[_0x80a0('0x23')](function(_0x571c80){if(_0x571c80){if(_0x42109d[_0x80a0('0x5e')][_0x80a0('0x7c')]){_0x2c89f2[_0x80a0('0x2b')][_0x80a0('0x7d')]=util[_0x80a0('0x63')](_0x80a0('0x7e'),_0x42109d['user'][_0x80a0('0x3d')]);_0x2c89f2[_0x80a0('0x2b')][_0x80a0('0x7f')]=_0x2c89f2[_0x80a0('0x7f')];_0x2c89f2[_0x80a0('0x2b')][_0x80a0('0x80')]=_0x80a0('0x61');return respondWithRpcPromise(_0x80a0('0x81'),'EventManager',{'event':_0x80a0('0x82'),'message':_0x2c89f2[_0x80a0('0x2b')]},client9002)[_0x80a0('0x23')](function(){return _0x2c89f2;});}return _0x2c89f2;}return null;})[_0x80a0('0x23')](respondWithResult(_0x49873b,null))[_0x80a0('0x2d')](handleError(_0x49873b,null));};var interaction_log=require(_0x80a0('0x15'))(_0x80a0('0x83'));exports[_0x80a0('0x39')]=function(_0xbbdc2b,_0x113cf1,_0x13d57e){var _0x4759db={'agent':{},'channel':'openchannel'};if(_0xbbdc2b[_0x80a0('0x5e')]['id']){delete _0xbbdc2b['body']['id'];}_0xbbdc2b[_0x80a0('0x5e')][_0x80a0('0x67')]=_0xbbdc2b[_0x80a0('0x5e')][_0x80a0('0x67')]||_0xbbdc2b[_0x80a0('0x65')]['id'];_0x4759db[_0x80a0('0x66')]['id']=_0xbbdc2b[_0x80a0('0x5e')][_0x80a0('0x67')];return db['OpenchannelMessage']['find']({'where':{'id':_0xbbdc2b[_0x80a0('0x58')]['id'],'UserId':null}})[_0x80a0('0x23')](handleEntityNotFound(_0x113cf1,null))[_0x80a0('0x23')](function(_0x13ac12){if(_0x13ac12){_0x4759db[_0x80a0('0x2b')]=_0x13ac12[_0x80a0('0x6c')]({'plain':!![]});return db[_0x80a0('0x68')][_0x80a0('0x5c')]({'where':{'id':_0x13ac12[_0x80a0('0x69')]}});}return null;})[_0x80a0('0x23')](handleEntityNotFound(_0x113cf1,null))[_0x80a0('0x23')](function(_0x12b083){if(_0x12b083){_0x4759db[_0x80a0('0x6b')]=_0x12b083[_0x80a0('0x6c')]({'plain':!![]});interaction_log[_0x80a0('0x24')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xbbdc2b[_0x80a0('0x65')]['id'],_0xbbdc2b[_0x80a0('0x65')][_0x80a0('0x3d')],_0xbbdc2b[_0x80a0('0x65')][_0x80a0('0x6e')],_0x4759db[_0x80a0('0x6b')]['id'],_0xbbdc2b[_0x80a0('0x5e')]?JSON[_0x80a0('0x6f')](_0xbbdc2b[_0x80a0('0x5e')]):_0x80a0('0x84'));return respondWithRpcPromise('RejectMessage',_0x80a0('0x85'),_0x4759db);}return null;})[_0x80a0('0x23')](function(_0x4859ed){var _0x495418='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4859ed[_0x80a0('0x2b')][_0x80a0('0x73')];return db['sequelize']['query'](_0x495418,{'type':db[_0x80a0('0x75')][_0x80a0('0x76')]['SELECT'],'raw':!![]})['then'](function(_0x16e3d6){return _0x16e3d6;});})[_0x80a0('0x23')](function(_0x2f91ea){if(_0x2f91ea){_0x4759db['message'][_0x80a0('0x78')]=_0x2f91ea[0x0];if(!_0xbbdc2b[_0x80a0('0x5e')][_0x80a0('0x67')])return;return db['User'][_0x80a0('0x5c')]({'where':{'id':_0xbbdc2b[_0x80a0('0x5e')][_0x80a0('0x67')],'role':_0x80a0('0x66')},'attributes':['id',_0x80a0('0x3d'),_0x80a0('0x7a'),_0x80a0('0x7b'),_0x80a0('0x86')],'raw':!![]});}return null;})[_0x80a0('0x23')](function(_0x578d5e){if(!_0x578d5e)return null;_0x4759db[_0x80a0('0x2b')][_0x80a0('0x66')]=_0x578d5e;return _0x4759db;})[_0x80a0('0x23')](function(_0x12b848){if(_0x12b848){_0x12b848[_0x80a0('0x2b')][_0x80a0('0x7d')]=util[_0x80a0('0x63')]('SIP/%s',_0xbbdc2b['user']['name']);_0x12b848[_0x80a0('0x2b')][_0x80a0('0x7f')]=_0x4759db['channel'];_0x12b848['message'][_0x80a0('0x80')]=_0x80a0('0x39');respondWithRpcPromise('EventManager',_0x80a0('0x81'),{'event':'rejectmessage','message':_0x12b848[_0x80a0('0x2b')]},client9002);return _0x4759db;}return null;})['then'](respondWithResult(_0x113cf1,null))[_0x80a0('0x2d')](handleError(_0x113cf1,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 80b7dd0..b3b257e 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 _0xc499=['exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x187193,_0x24e49d){var _0x5002aa=function(_0x2ede6b){while(--_0x2ede6b){_0x187193['push'](_0x187193['shift']());}};_0x5002aa(++_0x24e49d);}(_0xc499,0x1cc));var _0x9c49=function(_0x4f1af9,_0xc95c63){_0x4f1af9=_0x4f1af9-0x0;var _0x11a60e=_0xc499[_0x4f1af9];return _0x11a60e;};'use strict';var EventEmitter=require(_0x9c49('0x0'));var OpenchannelMessage=require(_0x9c49('0x1'))['db'][_0x9c49('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x9c49('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9c49('0x4')};function emitEvent(_0x7e7ee8){return function(_0x5d5a1e,_0x579382,_0x180c70){OpenchannelMessageEvents[_0x9c49('0x5')](_0x7e7ee8+':'+_0x5d5a1e['id'],_0x5d5a1e);OpenchannelMessageEvents[_0x9c49('0x5')](_0x7e7ee8,_0x5d5a1e);_0x180c70(null);};}for(var e in events){if(events[_0x9c49('0x6')](e)){var event=events[e];OpenchannelMessage[_0x9c49('0x7')](e,emitEvent(event));}}module[_0x9c49('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x17c4=['hook','events','../../mysqldb','update','remove','emit','hasOwnProperty'];(function(_0x24491f,_0x53296a){var _0x44218b=function(_0x5eba0c){while(--_0x5eba0c){_0x24491f['push'](_0x24491f['shift']());}};_0x44218b(++_0x53296a);}(_0x17c4,0xe8));var _0x417c=function(_0x12f42c,_0x415b84){_0x12f42c=_0x12f42c-0x0;var _0xbcf616=_0x17c4[_0x12f42c];return _0xbcf616;};'use strict';var EventEmitter=require(_0x417c('0x0'));var OpenchannelMessage=require(_0x417c('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x417c('0x2'),'afterDestroy':_0x417c('0x3')};function emitEvent(_0x540285){return function(_0x15d754,_0x5ef6ce,_0x31da72){OpenchannelMessageEvents[_0x417c('0x4')](_0x540285+':'+_0x15d754['id'],_0x15d754);OpenchannelMessageEvents['emit'](_0x540285,_0x15d754);_0x31da72(null);};}for(var e in events){if(events[_0x417c('0x5')](e)){var event=events[e];OpenchannelMessage[_0x417c('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 1c8967f..671038d 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 _0x5eb8=['OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','omit','POST','method','GET','info','body','Interaction','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','then','update','createdAt','catch','error','out','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys'];(function(_0x2de2cc,_0x27082b){var _0xac4bd9=function(_0xe5407c){while(--_0xe5407c){_0x2de2cc['push'](_0x2de2cc['shift']());}};_0xac4bd9(++_0x27082b);}(_0x5eb8,0xb0));var _0x85eb=function(_0x27842c,_0x324fcb){_0x27842c=_0x27842c-0x0;var _0x493de8=_0x5eb8[_0x27842c];return _0x493de8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x85eb('0x0'))(_0x85eb('0x1'));var moment=require(_0x85eb('0x2'));var BPromise=require(_0x85eb('0x3'));var rp=require(_0x85eb('0x4'));var fs=require('fs');var path=require(_0x85eb('0x5'));var rimraf=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var attributes=require(_0x85eb('0x8'));module[_0x85eb('0x9')]=function(_0x2bf83c,_0x1ba1d8){return _0x2bf83c['define'](_0x85eb('0xa'),attributes,{'tableName':_0x85eb('0xb'),'paranoid':![],'indexes':[{'name':_0x85eb('0xc'),'fields':['body'],'type':_0x85eb('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x50ea77,_0x1f0036,_0x40d6b6){var _0x673228=_0x2bf83c[_0x85eb('0xe')];var _0x1dacf2=_0x50ea77[_0x85eb('0xf')]({'plain':!![]});if(_0x1dacf2[_0x85eb('0x10')]['toLowerCase']()==='in'||_0x1dacf2[_0x85eb('0x10')][_0x85eb('0x11')]()==='out'&&!_0x1dacf2[_0x85eb('0x12')]&&!_[_0x85eb('0x13')](_0x1dacf2[_0x85eb('0x14')])){_0x673228[_0x85eb('0x15')]['findOne']({'where':{'id':_0x1dacf2['OpenchannelInteractionId']}})[_0x85eb('0x16')](function(_0x5c760a){if(_0x5c760a){_0x5c760a[_0x85eb('0x17')]({'lastMsgAt':_0x1dacf2[_0x85eb('0x18')],'lastMsgDirection':_0x1dacf2[_0x85eb('0x10')][_0x85eb('0x11')]()});}})[_0x85eb('0x19')](function(_0x49efdf){console[_0x85eb('0x1a')](_0x49efdf);});}if(_0x1dacf2['direction']===_0x85eb('0x1b')&&!_0x1dacf2[_0x85eb('0x12')]){var _0x3e23e8;_0x673228[_0x85eb('0x1c')]['describe']()['then'](function(_0x50d2a8){return _0x673228[_0x85eb('0x1d')][_0x85eb('0x1e')]({'where':{'id':_0x1dacf2[_0x85eb('0x1f')]},'include':[{'model':_0x673228[_0x85eb('0x15')],'as':_0x85eb('0x20'),'where':{'id':_0x1dacf2[_0x85eb('0x21')]},'limit':0x1,'include':[{'model':_0x673228['CmContact'],'as':_0x85eb('0x22'),'attributes':_[_0x85eb('0x23')](_0x50d2a8)}]}]});})[_0x85eb('0x16')](function(_0x4e8041){_0x3e23e8=_0x4e8041['get']({'plain':!![]});if(_0x3e23e8&&_0x3e23e8['replyUri']){logger['info'](_0x85eb('0x24'),_0x85eb('0x25'),util[_0x85eb('0x26')](_0x85eb('0x27'),_0x1dacf2['id'],_0x3e23e8[_0x85eb('0x28')]));if(_0x3e23e8[_0x85eb('0x20')]&&_0x3e23e8['Interactions']['length']){_0x1dacf2['Interaction']=_[_0x85eb('0x29')](_0x3e23e8[_0x85eb('0x20')][0x0],_0x85eb('0x22'));_0x1dacf2[_0x85eb('0x22')]=_0x3e23e8[_0x85eb('0x20')][0x0][_0x85eb('0x22')];}var _0x1f0036={'method':_0x85eb('0x2a'),'uri':encodeURI(_0x3e23e8[_0x85eb('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1f0036[_0x85eb('0x2b')]){case _0x85eb('0x2c'):_0x1f0036['qs']=_0x1dacf2;break;case _0x85eb('0x2a'):_0x1f0036['body']=_0x1dacf2;break;}return rp(_0x1f0036)[_0x85eb('0x16')](function(_0x792d3a){logger[_0x85eb('0x2d')](_0x85eb('0x24'),_0x85eb('0x25'),util[_0x85eb('0x26')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x1dacf2['id'],_0x3e23e8['replyUri']));if(_0x792d3a[_0x85eb('0x2e')]['threadId']&&_0x792d3a[_0x85eb('0x2e')]['threadId']!=_0x1dacf2[_0x85eb('0x2f')][_0x85eb('0x30')]){return _0x673228[_0x85eb('0x15')][_0x85eb('0x17')]({'threadId':_0x792d3a[_0x85eb('0x2e')][_0x85eb('0x30')]},{'logging':!![],'where':{'id':_0x1dacf2[_0x85eb('0x2f')]['id']}});}else{return;}})['then'](function(){return _0x50ea77[_0x85eb('0x17')]({'read':!![]});})[_0x85eb('0x19')](function(_0x515ee9){logger[_0x85eb('0x1a')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x85eb('0x31')](_0x515ee9,{'showHidden':![],'depth':null}));_0x40d6b6();});}else{_0x40d6b6();}})[_0x85eb('0x32')](function(){_0x40d6b6();});}else{_0x40d6b6();}}},'charset':_0x85eb('0x33'),'collate':_0x85eb('0x34')});}; \ No newline at end of file +var _0x6e6c=['util','api','moment','path','../../config/environment','exports','define','OpenchannelMessage','fti_openchannel_messages','body','models','get','direction','toLowerCase','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','error','out','find','OpenchannelAccountId','Interactions','CmContact','Contact','keys','then','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0xf78ed4,_0x30427e){var _0x1ac0bd=function(_0x256f4d){while(--_0x256f4d){_0xf78ed4['push'](_0xf78ed4['shift']());}};_0x1ac0bd(++_0x30427e);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var logger=require('../../config/logger')(_0xc6e6('0x2'));var moment=require(_0xc6e6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6e6('0x4'));var rimraf=require('rimraf');var config=require(_0xc6e6('0x5'));var attributes=require('./openchannelMessage.attributes');module[_0xc6e6('0x6')]=function(_0x1182c7,_0x4bf906){return _0x1182c7[_0xc6e6('0x7')](_0xc6e6('0x8'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc6e6('0x9'),'fields':[_0xc6e6('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x324f05,_0x481799,_0x172aa9){var _0x3b2f50=_0x1182c7[_0xc6e6('0xb')];var _0x3ddf6f=_0x324f05[_0xc6e6('0xc')]({'plain':!![]});if(_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()==='in'||_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()==='out'&&!_0x3ddf6f[_0xc6e6('0xf')]&&!_['isNil'](_0x3ddf6f[_0xc6e6('0x10')])){_0x3b2f50[_0xc6e6('0x11')][_0xc6e6('0x12')]({'where':{'id':_0x3ddf6f[_0xc6e6('0x13')]}})['then'](function(_0x149ac6){if(_0x149ac6){_0x149ac6[_0xc6e6('0x14')]({'lastMsgAt':_0x3ddf6f[_0xc6e6('0x15')],'lastMsgDirection':_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()});}})['catch'](function(_0x413cf8){console[_0xc6e6('0x16')](_0x413cf8);});}if(_0x3ddf6f['direction']===_0xc6e6('0x17')&&!_0x3ddf6f[_0xc6e6('0xf')]){var _0xedf127;_0x3b2f50['CmContact']['describe']()['then'](function(_0x3a1ccc){return _0x3b2f50['OpenchannelAccount'][_0xc6e6('0x18')]({'where':{'id':_0x3ddf6f[_0xc6e6('0x19')]},'include':[{'model':_0x3b2f50[_0xc6e6('0x11')],'as':_0xc6e6('0x1a'),'where':{'id':_0x3ddf6f[_0xc6e6('0x13')]},'limit':0x1,'include':[{'model':_0x3b2f50[_0xc6e6('0x1b')],'as':_0xc6e6('0x1c'),'attributes':_[_0xc6e6('0x1d')](_0x3a1ccc)}]}]});})[_0xc6e6('0x1e')](function(_0x3d734d){_0xedf127=_0x3d734d['get']({'plain':!![]});if(_0xedf127&&_0xedf127[_0xc6e6('0x1f')]){logger['info'](_0xc6e6('0x20'),_0xc6e6('0x21'),util[_0xc6e6('0x22')](_0xc6e6('0x23'),_0x3ddf6f['id'],_0xedf127['replyUri']));if(_0xedf127[_0xc6e6('0x1a')]&&_0xedf127[_0xc6e6('0x1a')][_0xc6e6('0x24')]){_0x3ddf6f[_0xc6e6('0x25')]=_[_0xc6e6('0x26')](_0xedf127['Interactions'][0x0],_0xc6e6('0x1c'));_0x3ddf6f['Contact']=_0xedf127[_0xc6e6('0x1a')][0x0][_0xc6e6('0x1c')];}var _0x481799={'method':_0xc6e6('0x27'),'uri':encodeURI(_0xedf127['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x481799[_0xc6e6('0x28')]){case'GET':_0x481799['qs']=_0x3ddf6f;break;case _0xc6e6('0x27'):_0x481799['body']=_0x3ddf6f;break;}return rp(_0x481799)[_0xc6e6('0x1e')](function(_0x16dcd9){logger[_0xc6e6('0x29')](_0xc6e6('0x20'),_0xc6e6('0x21'),util['format'](_0xc6e6('0x2a'),_0x3ddf6f['id'],_0xedf127[_0xc6e6('0x1f')]));if(_0x16dcd9[_0xc6e6('0xa')][_0xc6e6('0x2b')]&&_0x16dcd9['body'][_0xc6e6('0x2b')]!=_0x3ddf6f['Interaction'][_0xc6e6('0x2b')]){return _0x3b2f50[_0xc6e6('0x11')][_0xc6e6('0x14')]({'threadId':_0x16dcd9[_0xc6e6('0xa')][_0xc6e6('0x2b')]},{'logging':!![],'where':{'id':_0x3ddf6f[_0xc6e6('0x25')]['id']}});}else{return;}})[_0xc6e6('0x1e')](function(){return _0x324f05[_0xc6e6('0x14')]({'read':!![]});})[_0xc6e6('0x2c')](function(_0x1eb477){logger[_0xc6e6('0x16')](_0xc6e6('0x20'),_0xc6e6('0x21'),util[_0xc6e6('0x2d')](_0x1eb477,{'showHidden':![],'depth':null}));_0x172aa9();});}else{_0x172aa9();}})[_0xc6e6('0x2e')](function(){_0x172aa9();});}else{_0x172aa9();}}},'charset':_0xc6e6('0x2f'),'collate':_0xc6e6('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 274c2ab..4f92caf 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 _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd35d81,_0x33da4a){var _0x2457e2=function(_0x2f0f97){while(--_0x2f0f97){_0xd35d81['push'](_0xd35d81['shift']());}};_0x2457e2(++_0x33da4a);}(_0x5f2f,0x73));var _0xf5f2=function(_0xc315d8,_0x34e000){_0xc315d8=_0xc315d8-0x0;var _0x5e6417=_0x5f2f[_0xc315d8];return _0x5e6417;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file +var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x184771,_0x212938){var _0x4642ff=function(_0x2b0a2c){while(--_0x2b0a2c){_0x184771['push'](_0x184771['shift']());}};_0x4642ff(++_0x212938);}(_0x5f2f,0x73));var _0xf5f2=function(_0x16b77e,_0x4a56a3){_0x16b77e=_0x16b77e-0x0;var _0x3ae284=_0x5f2f[_0x16b77e];return _0x3ae284;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 0c28c3b..179e510 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 _0xd053=['register','length','openchannelMessage:','./openchannelMessage.events','save','update'];(function(_0x2968a8,_0x1fa054){var _0x4180a6=function(_0x1787ca){while(--_0x1787ca){_0x2968a8['push'](_0x2968a8['shift']());}};_0x4180a6(++_0x1fa054);}(_0xd053,0xe7));var _0x3d05=function(_0x9c3c56,_0x169b56){_0x9c3c56=_0x9c3c56-0x0;var _0x2dd782=_0xd053[_0x9c3c56];return _0x2dd782;};'use strict';var OpenchannelMessageEvents=require(_0x3d05('0x0'));var events=[_0x3d05('0x1'),'remove',_0x3d05('0x2')];function createListener(_0x35cdb1,_0x18d2b2){return function(_0x55090d){_0x18d2b2['emit'](_0x35cdb1,_0x55090d);};}function removeListener(_0x45c6cc,_0x1fc866){return function(){OpenchannelMessageEvents['removeListener'](_0x45c6cc,_0x1fc866);};}exports[_0x3d05('0x3')]=function(_0x2ba33b){for(var _0x59161d=0x0,_0x2bb04f=events[_0x3d05('0x4')];_0x59161d<_0x2bb04f;_0x59161d++){var _0x1d928c=events[_0x59161d];var _0x13672d=createListener(_0x3d05('0x5')+_0x1d928c,_0x2ba33b);OpenchannelMessageEvents['on'](_0x1d928c,_0x13672d);}}; \ No newline at end of file +var _0x2171=['openchannelMessage:','save','remove','update','removeListener','register','length'];(function(_0x5f3742,_0x15ff91){var _0x5dee3e=function(_0x1a950a){while(--_0x1a950a){_0x5f3742['push'](_0x5f3742['shift']());}};_0x5dee3e(++_0x15ff91);}(_0x2171,0x143));var _0x1217=function(_0x3566d0,_0x34a49f){_0x3566d0=_0x3566d0-0x0;var _0x3fd4da=_0x2171[_0x3566d0];return _0x3fd4da;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x1217('0x0'),_0x1217('0x1'),_0x1217('0x2')];function createListener(_0x49e4e8,_0x553b57){return function(_0x2f6288){_0x553b57['emit'](_0x49e4e8,_0x2f6288);};}function removeListener(_0x38b8ff,_0x41f787){return function(){OpenchannelMessageEvents[_0x1217('0x3')](_0x38b8ff,_0x41f787);};}exports[_0x1217('0x4')]=function(_0x4eb644){for(var _0xafdf42=0x0,_0x8742bc=events[_0x1217('0x5')];_0xafdf42<_0x8742bc;_0xafdf42++){var _0x5bde7e=events[_0xafdf42];var _0x46474e=createListener(_0x1217('0x6')+_0x5bde7e,_0x4eb644);OpenchannelMessageEvents['on'](_0x5bde7e,_0x46474e);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index c29d35c..d1d3644 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 _0x1901=['post','create','addAgents','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1901,0x99));var _0x1190=function(_0xe934d0,_0x107c20){_0xe934d0=_0xe934d0-0x0;var _0x304707=_0x1901[_0xe934d0];return _0x304707;};'use strict';var multer=require(_0x1190('0x0'));var util=require(_0x1190('0x1'));var path=require(_0x1190('0x2'));var timeout=require(_0x1190('0x3'));var express=require('express');var router=express[_0x1190('0x4')]();var fs_extra=require(_0x1190('0x5'));var auth=require(_0x1190('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1190('0x7'));var controller=require(_0x1190('0x8'));router[_0x1190('0x9')]('/',auth[_0x1190('0xa')](),controller[_0x1190('0xb')]);router[_0x1190('0x9')](_0x1190('0xc'),auth['isAuthenticated'](),controller[_0x1190('0xd')]);router[_0x1190('0x9')](_0x1190('0xe'),auth['isAuthenticated'](),controller[_0x1190('0xf')]);router[_0x1190('0x9')](_0x1190('0x10'),auth['isAuthenticated'](),controller[_0x1190('0x11')]);router[_0x1190('0x9')](_0x1190('0x12'),auth['isAuthenticated'](),controller['getTeams']);router[_0x1190('0x9')](_0x1190('0x13'),auth[_0x1190('0xa')](),controller[_0x1190('0x14')]);router[_0x1190('0x15')]('/',auth['isAuthenticated'](),controller[_0x1190('0x16')]);router[_0x1190('0x15')](_0x1190('0x12'),auth['isAuthenticated'](),controller['addTeams']);router[_0x1190('0x15')](_0x1190('0x13'),auth[_0x1190('0xa')](),controller[_0x1190('0x17')]);router[_0x1190('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x1190('0x19')]);router[_0x1190('0x1a')]('/:id',auth[_0x1190('0xa')](),controller[_0x1190('0x1b')]);router[_0x1190('0x1a')](_0x1190('0x12'),auth[_0x1190('0xa')](),controller['removeTeams']);router[_0x1190('0x1a')](_0x1190('0x13'),auth[_0x1190('0xa')](),controller['removeAgents']);module[_0x1190('0x1c')]=router; \ No newline at end of file +var _0xd6df=['./openchannelQueue.controller','isAuthenticated','index','get','describe','/:id','/:id/members','/:id/users','create','/:id/teams','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1389e3,_0x2ed4bd){var _0x3f6873=function(_0x494b3a){while(--_0x494b3a){_0x1389e3['push'](_0x1389e3['shift']());}};_0x3f6873(++_0x2ed4bd);}(_0xd6df,0x1b2));var _0xfd6d=function(_0x52e584,_0x4fa67d){_0x52e584=_0x52e584-0x0;var _0x4133f6=_0xd6df[_0x52e584];return _0x4133f6;};'use strict';var multer=require(_0xfd6d('0x0'));var util=require(_0xfd6d('0x1'));var path=require('path');var timeout=require(_0xfd6d('0x2'));var express=require(_0xfd6d('0x3'));var router=express[_0xfd6d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfd6d('0x5'));var interaction=require(_0xfd6d('0x6'));var config=require(_0xfd6d('0x7'));var controller=require(_0xfd6d('0x8'));router['get']('/',auth[_0xfd6d('0x9')](),controller[_0xfd6d('0xa')]);router[_0xfd6d('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xfd6d('0xc')]);router[_0xfd6d('0xb')](_0xfd6d('0xd'),auth[_0xfd6d('0x9')](),controller['show']);router[_0xfd6d('0xb')](_0xfd6d('0xe'),auth[_0xfd6d('0x9')](),controller['getMembers']);router['get']('/:id/teams',auth[_0xfd6d('0x9')](),controller['getTeams']);router[_0xfd6d('0xb')](_0xfd6d('0xf'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xfd6d('0x9')](),controller[_0xfd6d('0x10')]);router['post'](_0xfd6d('0x11'),auth[_0xfd6d('0x9')](),controller[_0xfd6d('0x12')]);router['post'](_0xfd6d('0xf'),auth[_0xfd6d('0x9')](),controller[_0xfd6d('0x13')]);router['put'](_0xfd6d('0xd'),auth[_0xfd6d('0x9')](),controller[_0xfd6d('0x14')]);router[_0xfd6d('0x15')](_0xfd6d('0xd'),auth[_0xfd6d('0x9')](),controller[_0xfd6d('0x16')]);router[_0xfd6d('0x15')](_0xfd6d('0x11'),auth[_0xfd6d('0x9')](),controller[_0xfd6d('0x17')]);router['delete'](_0xfd6d('0xf'),auth[_0xfd6d('0x9')](),controller[_0xfd6d('0x18')]);module[_0xfd6d('0x19')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index b0dab96..a77fd85 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 _0x9a15=['exports','STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x5e20f6,_0x25d39f){var _0x1022d3=function(_0x5b027f){while(--_0x5b027f){_0x5e20f6['push'](_0x5e20f6['shift']());}};_0x1022d3(++_0x25d39f);}(_0x9a15,0xae));var _0x59a1=function(_0xed247,_0x4d6f11){_0xed247=_0xed247-0x0;var _0x1e0597=_0x9a15[_0xed247];return _0x1e0597;};'use strict';var Sequelize=require(_0x59a1('0x0'));module[_0x59a1('0x1')]={'name':{'type':Sequelize[_0x59a1('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x59a1('0x2')]},'timeout':{'type':Sequelize[_0x59a1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x59a1('0x4')](_0x59a1('0x5'),'beepall',_0x59a1('0x6'))}}; \ No newline at end of file +var _0x2ec2=['name','STRING','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0x456ca4,_0x776cf9){var _0x1a2bff=function(_0x584dce){while(--_0x584dce){_0x456ca4['push'](_0x456ca4['shift']());}};_0x1a2bff(++_0x776cf9);}(_0x2ec2,0x1a9));var _0x22ec=function(_0x4ec42,_0x36177b){_0x4ec42=_0x4ec42-0x0;var _0x385e11=_0x2ec2[_0x4ec42];return _0x385e11;};'use strict';var Sequelize=require(_0x22ec('0x0'));module[_0x22ec('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x22ec('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x22ec('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x22ec('0x4')]('rrmemory',_0x22ec('0x5'),_0x22ec('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 6d3c9f5..26f66f5 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 _0xf49f=['describe','getMembers','findOne','UserOpenchannelQueue','nolimit','User','agent','updatedAt','createdAt','format','SIP','openchannelPause','getTeams','Team','pick','addTeams','Agents','online','voicePause','flatMap','sequelize','each','forEach','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','value','ids','removeAgents','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation'];(function(_0x45ae7b,_0xa7577d){var _0x2298fc=function(_0x4c0922){while(--_0x4c0922){_0x45ae7b['push'](_0x45ae7b['shift']());}};_0x2298fc(++_0xa7577d);}(_0xf49f,0xc0));var _0xff49=function(_0x35be21,_0x4032e5){_0x35be21=_0x35be21-0x0;var _0x1047d8=_0xf49f[_0x35be21];return _0x1047d8;};'use strict';var emlformat=require(_0xff49('0x0'));var rimraf=require(_0xff49('0x1'));var zipdir=require(_0xff49('0x2'));var jsonpatch=require(_0xff49('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xff49('0x4'));var Mustache=require(_0xff49('0x5'));var util=require(_0xff49('0x6'));var path=require('path');var sox=require(_0xff49('0x7'));var csv=require(_0xff49('0x8'));var ejs=require(_0xff49('0x9'));var fs=require('fs');var fs_extra=require(_0xff49('0xa'));var _=require(_0xff49('0xb'));var squel=require(_0xff49('0xc'));var crypto=require(_0xff49('0xd'));var jsforce=require(_0xff49('0xe'));var deskjs=require(_0xff49('0xf'));var toCsv=require(_0xff49('0x8'));var querystring=require(_0xff49('0x10'));var Papa=require('papaparse');var Redis=require(_0xff49('0x11'));var authService=require(_0xff49('0x12'));var qs=require(_0xff49('0x13'));var as=require(_0xff49('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff49('0x15'))(_0xff49('0x16'));var utils=require(_0xff49('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xff49('0x18'));var db=require(_0xff49('0x19'))['db'];config[_0xff49('0x1a')]=_[_0xff49('0x1b')](config[_0xff49('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xff49('0x1c'))(new Redis(config[_0xff49('0x1a')]));require(_0xff49('0x1d'))[_0xff49('0x1e')](socket);function respondWithStatusCode(_0x596b5e,_0x1cfb0f){_0x1cfb0f=_0x1cfb0f||0xcc;return function(_0x1a1512){if(_0x1a1512){return _0x596b5e[_0xff49('0x1f')](_0x1cfb0f);}return _0x596b5e[_0xff49('0x20')](_0x1cfb0f)[_0xff49('0x21')]();};}function respondWithResult(_0x245305,_0x1f6d64){_0x1f6d64=_0x1f6d64||0xc8;return function(_0x37cc93){if(_0x37cc93){return _0x245305['status'](_0x1f6d64)[_0xff49('0x22')](_0x37cc93);}};}function respondWithFilteredResult(_0x33304c,_0x1eb130){return function(_0x2e7375){if(_0x2e7375){var _0x4553b6=typeof _0x1eb130[_0xff49('0x23')]===_0xff49('0x24')&&typeof _0x1eb130[_0xff49('0x25')]==='undefined';var _0x179e13=_0x2e7375['count'];var _0x3b40e4=_0x4553b6?0x0:_0x1eb130[_0xff49('0x23')];var _0xcce089=_0x4553b6?_0x2e7375[_0xff49('0x26')]:_0x1eb130[_0xff49('0x23')]+_0x1eb130[_0xff49('0x25')];var _0x510e0a;if(_0xcce089>=_0x179e13){_0xcce089=_0x179e13;_0x510e0a=0xc8;}else{_0x510e0a=0xce;}_0x33304c['status'](_0x510e0a);return _0x33304c[_0xff49('0x27')](_0xff49('0x28'),_0x3b40e4+'-'+_0xcce089+'/'+_0x179e13)[_0xff49('0x22')](_0x2e7375);}return null;};}function patchUpdates(_0x5032dc){return function(_0x13dbb7){try{jsonpatch[_0xff49('0x29')](_0x13dbb7,_0x5032dc,!![]);}catch(_0x33d6a7){return BPromise[_0xff49('0x2a')](_0x33d6a7);}return _0x13dbb7['save']();};}function saveUpdates(_0x2b76a7,_0x2ebbe7){return function(_0x5b132c){if(_0x5b132c){return _0x5b132c[_0xff49('0x2b')](_0x2b76a7)['then'](function(_0x4f43db){return _0x4f43db;});}return null;};}function removeEntity(_0x370e12,_0x1cd887){return function(_0x3d5e1d){if(_0x3d5e1d){return _0x3d5e1d[_0xff49('0x2c')]()[_0xff49('0x2d')](function(){var _0x44585e=_0x3d5e1d['get']({'plain':!![]});var _0x3cd820=_0xff49('0x2e');return db[_0xff49('0x2f')]['destroy']({'where':{'type':_0x3cd820,'resourceId':_0x44585e['id']}})['then'](function(){return _0x3d5e1d;});})[_0xff49('0x2d')](function(){_0x370e12[_0xff49('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a8fd8,_0x5aff1b){return function(_0x2549ee){if(!_0x2549ee){_0x2a8fd8[_0xff49('0x1f')](0x194);}return _0x2549ee;};}function handleError(_0x111979,_0x2d8ffa){_0x2d8ffa=_0x2d8ffa||0x1f4;return function(_0x222e1a){logger[_0xff49('0x30')](_0x222e1a[_0xff49('0x31')]);if(_0x222e1a[_0xff49('0x32')]){delete _0x222e1a[_0xff49('0x32')];}_0x111979[_0xff49('0x20')](_0x2d8ffa)[_0xff49('0x33')](_0x222e1a);};}exports[_0xff49('0x34')]=function(_0x549857,_0x588b4d){var _0x25759f={},_0x3ef214={},_0x406367={'count':0x0,'rows':[]};var _0x167190=_['map'](db[_0xff49('0x35')][_0xff49('0x36')],function(_0xfca779){return{'name':_0xfca779[_0xff49('0x37')],'type':_0xfca779[_0xff49('0x38')][_0xff49('0x39')]};});_0x3ef214[_0xff49('0x3a')]=_['map'](_0x167190,'name');_0x3ef214[_0xff49('0x3b')]=_['keys'](_0x549857[_0xff49('0x3b')]);_0x3ef214[_0xff49('0x3c')]=_[_0xff49('0x3d')](_0x3ef214[_0xff49('0x3a')],_0x3ef214[_0xff49('0x3b')]);_0x25759f[_0xff49('0x3e')]=_[_0xff49('0x3d')](_0x3ef214['model'],qs[_0xff49('0x3f')](_0x549857[_0xff49('0x3b')][_0xff49('0x3f')]));_0x25759f[_0xff49('0x3e')]=_0x25759f[_0xff49('0x3e')][_0xff49('0x40')]?_0x25759f[_0xff49('0x3e')]:_0x3ef214[_0xff49('0x3a')];if(!_0x549857[_0xff49('0x3b')][_0xff49('0x41')]('nolimit')){_0x25759f['limit']=qs['limit'](_0x549857[_0xff49('0x3b')][_0xff49('0x25')]);_0x25759f[_0xff49('0x23')]=qs['offset'](_0x549857[_0xff49('0x3b')][_0xff49('0x23')]);}_0x25759f[_0xff49('0x42')]=qs[_0xff49('0x43')](_0x549857[_0xff49('0x3b')][_0xff49('0x43')]);_0x25759f[_0xff49('0x44')]=qs['filters'](_['pick'](_0x549857['query'],_0x3ef214[_0xff49('0x3c')]),_0x167190);if(_0x549857[_0xff49('0x3b')][_0xff49('0x45')]){_0x25759f[_0xff49('0x44')]=_[_0xff49('0x46')](_0x25759f['where'],{'$or':_[_0xff49('0x47')](_0x167190,function(_0x24572b){if(_0x24572b[_0xff49('0x38')]!==_0xff49('0x48')){var _0x463da6={};_0x463da6[_0x24572b['name']]={'$like':'%'+_0x549857['query']['filter']+'%'};return _0x463da6;}})});}_0x25759f=_[_0xff49('0x46')]({},_0x25759f,_0x549857[_0xff49('0x49')]);var _0x2233e4={'where':_0x25759f['where']};return db['OpenchannelQueue'][_0xff49('0x26')](_0x2233e4)[_0xff49('0x2d')](function(_0x241109){_0x406367[_0xff49('0x26')]=_0x241109;if(_0x549857[_0xff49('0x3b')][_0xff49('0x4a')]){_0x25759f[_0xff49('0x4b')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xff49('0x4c')](_0x25759f);})[_0xff49('0x2d')](function(_0x38fff7){_0x406367[_0xff49('0x4d')]=_0x38fff7;return _0x406367;})['then'](respondWithFilteredResult(_0x588b4d,_0x25759f))['catch'](handleError(_0x588b4d,null));};exports[_0xff49('0x4e')]=function(_0x51cbff,_0x1dcac8){var _0x1d9510={'raw':!![],'where':{'id':_0x51cbff[_0xff49('0x4f')]['id']}},_0x26dbbd={};_0x26dbbd[_0xff49('0x3a')]=_[_0xff49('0x50')](db[_0xff49('0x35')][_0xff49('0x36')]);_0x26dbbd[_0xff49('0x3b')]=_['keys'](_0x51cbff[_0xff49('0x3b')]);_0x26dbbd[_0xff49('0x3c')]=_[_0xff49('0x3d')](_0x26dbbd['model'],_0x26dbbd[_0xff49('0x3b')]);_0x1d9510[_0xff49('0x3e')]=_['intersection'](_0x26dbbd[_0xff49('0x3a')],qs[_0xff49('0x3f')](_0x51cbff[_0xff49('0x3b')][_0xff49('0x3f')]));_0x1d9510[_0xff49('0x3e')]=_0x1d9510['attributes'][_0xff49('0x40')]?_0x1d9510[_0xff49('0x3e')]:_0x26dbbd[_0xff49('0x3a')];if(_0x51cbff[_0xff49('0x3b')][_0xff49('0x4a')]){_0x1d9510['include']=[{'all':!![]}];}_0x1d9510=_['merge']({},_0x1d9510,_0x51cbff[_0xff49('0x49')]);return db[_0xff49('0x35')][_0xff49('0x51')](_0x1d9510)['then'](handleEntityNotFound(_0x1dcac8,null))[_0xff49('0x2d')](respondWithResult(_0x1dcac8,null))[_0xff49('0x52')](handleError(_0x1dcac8,null));};exports['create']=function(_0x392660,_0x3eb5cc){return db[_0xff49('0x35')][_0xff49('0x53')](_0x392660[_0xff49('0x54')],{})[_0xff49('0x2d')](function(_0x348563){var _0x591642=_0x392660[_0xff49('0x55')]['get']({'plain':!![]});if(!_0x591642)throw new Error(_0xff49('0x56'));if(_0x591642['role']===_0xff49('0x55')){var _0x7ff707=_0x348563[_0xff49('0x57')]({'plain':!![]});var _0x429904=_0xff49('0x2e');return db[_0xff49('0x58')][_0xff49('0x51')]({'where':{'name':_0x429904,'userProfileId':_0x591642['userProfileId']},'raw':!![]})[_0xff49('0x2d')](function(_0x154cc9){if(_0x154cc9&&_0x154cc9[_0xff49('0x59')]===0x0){return db[_0xff49('0x2f')][_0xff49('0x53')]({'name':_0x7ff707[_0xff49('0x32')],'resourceId':_0x7ff707['id'],'type':_0x154cc9[_0xff49('0x32')],'sectionId':_0x154cc9['id']},{})['then'](function(){return _0x348563;});}else{return _0x348563;}})[_0xff49('0x52')](function(_0x408462){logger[_0xff49('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x408462);throw _0x408462;});}return _0x348563;})['then'](respondWithResult(_0x3eb5cc,0xc9))[_0xff49('0x52')](handleError(_0x3eb5cc,null));};exports[_0xff49('0x2b')]=function(_0xdc67b3,_0x4ddd2c){if(_0xdc67b3[_0xff49('0x54')]['id']){delete _0xdc67b3[_0xff49('0x54')]['id'];}return db['OpenchannelQueue'][_0xff49('0x51')]({'where':{'id':_0xdc67b3[_0xff49('0x4f')]['id']}})[_0xff49('0x2d')](handleEntityNotFound(_0x4ddd2c,null))[_0xff49('0x2d')](saveUpdates(_0xdc67b3[_0xff49('0x54')],null))['then'](respondWithResult(_0x4ddd2c,null))['catch'](handleError(_0x4ddd2c,null));};exports[_0xff49('0x2c')]=function(_0x3bf16e,_0x60e6df){return db[_0xff49('0x35')][_0xff49('0x51')]({'where':{'id':_0x3bf16e[_0xff49('0x4f')]['id']}})[_0xff49('0x2d')](handleEntityNotFound(_0x60e6df,null))[_0xff49('0x2d')](removeEntity(_0x60e6df,null))[_0xff49('0x52')](handleError(_0x60e6df,null));};exports[_0xff49('0x5a')]=function(_0x38ac17,_0x222c15){return db[_0xff49('0x35')][_0xff49('0x5a')]()['then'](respondWithResult(_0x222c15,null))['catch'](handleError(_0x222c15,null));};exports[_0xff49('0x5b')]=function(_0xf3dc2a,_0x1d5afc,_0x17b78c){var _0x2573de={'raw':!![],'where':{}},_0x599736={},_0x3aeacf;return db[_0xff49('0x35')][_0xff49('0x5c')]({'where':{'id':_0xf3dc2a[_0xff49('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1d5afc,null))[_0xff49('0x2d')](function(_0x421682){if(_0x421682){_0x3aeacf=_0x421682[_0xff49('0x57')]({'plain':!![]});_0x599736[_0xff49('0x3a')]=_[_0xff49('0x50')](db[_0xff49('0x5d')][_0xff49('0x36')]);_0x599736['query']=_[_0xff49('0x50')](_0xf3dc2a[_0xff49('0x3b')]);_0x599736[_0xff49('0x3c')]=_['intersection'](_0x599736[_0xff49('0x3a')],_0x599736[_0xff49('0x3b')]);_0x2573de[_0xff49('0x3e')]=_['intersection'](_0x599736[_0xff49('0x3a')],qs[_0xff49('0x3f')](_0xf3dc2a[_0xff49('0x3b')][_0xff49('0x3f')]));_0x2573de[_0xff49('0x3e')]=_0x2573de[_0xff49('0x3e')][_0xff49('0x40')]?_0x2573de[_0xff49('0x3e')]:_0x599736[_0xff49('0x3a')];if(!_0xf3dc2a[_0xff49('0x3b')][_0xff49('0x41')](_0xff49('0x5e'))){_0x2573de[_0xff49('0x25')]=qs[_0xff49('0x25')](_0xf3dc2a['query']['limit']);_0x2573de['offset']=qs[_0xff49('0x23')](_0xf3dc2a[_0xff49('0x3b')]['offset']);}_0x2573de['order']=qs[_0xff49('0x43')](_0xf3dc2a['query'][_0xff49('0x43')]);_0x2573de['where']=qs['filters'](_['pick'](_0xf3dc2a[_0xff49('0x3b')],_0x599736['filters']));_0x2573de[_0xff49('0x44')]['OpenchannelQueueId']=_0x421682['id'];if(_0xf3dc2a[_0xff49('0x3b')][_0xff49('0x45')]){_0x2573de[_0xff49('0x44')]=_[_0xff49('0x46')](_0x2573de[_0xff49('0x44')],{'$or':_[_0xff49('0x47')](_0x2573de[_0xff49('0x3e')],function(_0x487dc4){var _0x3c6911={};_0x3c6911[_0x487dc4]={'$like':'%'+_0xf3dc2a[_0xff49('0x3b')]['filter']+'%'};return _0x3c6911;})});}_0x2573de=_[_0xff49('0x46')]({},_0x2573de,_0xf3dc2a['options']);return db[_0xff49('0x5d')][_0xff49('0x4c')](_0x2573de);}})[_0xff49('0x2d')](function(_0x229f84){if(_0x229f84){return db[_0xff49('0x5f')]['findAndCountAll']({'where':{'id':_[_0xff49('0x47')](_0x229f84,'UserId'),'role':_0xff49('0x60')},'attributes':['id','name','openchannelPause',_0xff49('0x61'),_0xff49('0x62')]});}})[_0xff49('0x2d')](function(_0x560162){if(_0x560162){return{'count':_0x560162[_0xff49('0x26')],'rows':_[_0xff49('0x47')](_0x560162[_0xff49('0x4d')],function(_0x4c1db7){return{'membername':_0x4c1db7[_0xff49('0x32')],'UserId':_0x4c1db7['id'],'queue_name':_0x3aeacf[_0xff49('0x32')],'OpenchannelQueueId':_0x3aeacf['id'],'interface':util[_0xff49('0x63')]('%s/%s',_0xff49('0x64'),_0x4c1db7[_0xff49('0x32')]),'penalty':0x0,'paused':_0x4c1db7[_0xff49('0x65')],'createdAt':_0x4c1db7[_0xff49('0x62')],'updatedAt':_0x4c1db7[_0xff49('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xff49('0x2d')](respondWithFilteredResult(_0x1d5afc,_0x2573de))[_0xff49('0x52')](handleError(_0x1d5afc,null));};exports[_0xff49('0x66')]=function(_0x867934,_0x29acd9,_0x25b473){var _0x3fc427={};var _0x138afc={};var _0x5a6220;var _0x4f7810;return db[_0xff49('0x35')][_0xff49('0x5c')]({'where':{'id':_0x867934[_0xff49('0x4f')]['id']}})[_0xff49('0x2d')](handleEntityNotFound(_0x29acd9,null))['then'](function(_0x5634f0){if(_0x5634f0){_0x5a6220=_0x5634f0;_0x138afc[_0xff49('0x3a')]=_[_0xff49('0x50')](db[_0xff49('0x67')][_0xff49('0x36')]);_0x138afc[_0xff49('0x3b')]=_[_0xff49('0x50')](_0x867934['query']);_0x138afc[_0xff49('0x3c')]=_[_0xff49('0x3d')](_0x138afc[_0xff49('0x3a')],_0x138afc[_0xff49('0x3b')]);_0x3fc427['attributes']=_[_0xff49('0x3d')](_0x138afc[_0xff49('0x3a')],qs['fields'](_0x867934[_0xff49('0x3b')]['fields']));_0x3fc427[_0xff49('0x3e')]=_0x3fc427[_0xff49('0x3e')]['length']?_0x3fc427['attributes']:_0x138afc[_0xff49('0x3a')];_0x3fc427[_0xff49('0x42')]=qs[_0xff49('0x43')](_0x867934['query']['sort']);_0x3fc427[_0xff49('0x44')]=qs[_0xff49('0x3c')](_[_0xff49('0x68')](_0x867934[_0xff49('0x3b')],_0x138afc['filters']));if(_0x867934[_0xff49('0x3b')]['filter']){_0x3fc427[_0xff49('0x44')]=_[_0xff49('0x46')](_0x3fc427[_0xff49('0x44')],{'$or':_['map'](_0x3fc427[_0xff49('0x3e')],function(_0x1c9b7f){var _0x4c0514={};_0x4c0514[_0x1c9b7f]={'$like':'%'+_0x867934[_0xff49('0x3b')][_0xff49('0x45')]+'%'};return _0x4c0514;})});}_0x3fc427=_[_0xff49('0x46')]({},_0x3fc427,_0x867934[_0xff49('0x49')]);return _0x5a6220[_0xff49('0x66')](_0x3fc427);}})[_0xff49('0x2d')](function(_0x21fd26){if(_0x21fd26){_0x4f7810=_0x21fd26[_0xff49('0x40')];if(!_0x867934[_0xff49('0x3b')][_0xff49('0x41')]('nolimit')){_0x3fc427[_0xff49('0x25')]=qs[_0xff49('0x25')](_0x867934[_0xff49('0x3b')][_0xff49('0x25')]);_0x3fc427[_0xff49('0x23')]=qs[_0xff49('0x23')](_0x867934['query'][_0xff49('0x23')]);}return _0x5a6220[_0xff49('0x66')](_0x3fc427);}})['then'](function(_0x2e93c5){if(_0x2e93c5){return _0x2e93c5?{'count':_0x4f7810,'rows':_0x2e93c5}:null;}})[_0xff49('0x2d')](respondWithResult(_0x29acd9,null))[_0xff49('0x52')](handleError(_0x29acd9,null));};exports[_0xff49('0x69')]=function(_0x39a260,_0x1d3021,_0x2df916){var _0x18a2d2=_0x39a260[_0xff49('0x54')]['ids'];return db['Team'][_0xff49('0x4c')]({'where':{'id':_0x18a2d2},'attributes':['id'],'include':[{'model':db[_0xff49('0x5f')],'as':_0xff49('0x6a'),'attributes':['id',_0xff49('0x32'),_0xff49('0x6b'),_0xff49('0x6c'),'interface'],'raw':!![]}]})[_0xff49('0x2d')](function(_0x3c0e6e){if(_0x3c0e6e){var _0x49bbb4=_[_0xff49('0x6d')](_0x3c0e6e,function(_0x4256f8){var _0x2f9f66=_0x4256f8[_0xff49('0x57')]({'plain':!![]});return _0x2f9f66[_0xff49('0x6a')];});return db[_0xff49('0x35')][_0xff49('0x51')]({'where':{'id':_0x39a260[_0xff49('0x4f')]['id']}})[_0xff49('0x2d')](function(_0x5f019a){return db[_0xff49('0x6e')]['transaction'](function(_0x3fc358){return _0x5f019a['addTeams'](_0x18a2d2,{'transaction':_0x3fc358})['then'](function(){return BPromise[_0xff49('0x6f')](_0x49bbb4,function(_0x27aab7){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x27aab7['id'],'OpenchannelQueueId':_0x39a260[_0xff49('0x4f')]['id']},'transaction':_0x3fc358});});})[_0xff49('0x2d')](function(){_0x49bbb4[_0xff49('0x70')](function(_0x4bf248){socket[_0xff49('0x71')](_0xff49('0x72'),{'UserId':_0x4bf248['id'],'OpenchannelQueueId':_0x5f019a['id']});});});});});}})[_0xff49('0x2d')](respondWithStatusCode(_0x1d3021,null))[_0xff49('0x52')](handleError(_0x1d3021,null));};exports[_0xff49('0x73')]=function(_0x2b7b89,_0x25dff1,_0x4a9490){return db[_0xff49('0x67')][_0xff49('0x4c')]({'where':{'id':_0x2b7b89['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xff49('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x25dff1,null))['then'](function(_0x5b4c9c){var _0x2ba279=_[_0xff49('0x47')](_0x5b4c9c,'id');var _0x40c032=[];var _0x45cfd6=[];var _0x16a6b1=squel[_0xff49('0x74')]();_0x16a6b1['field'](_0xff49('0x75'))['from'](_0xff49('0x76'),'tq')['join'](_0xff49('0x77'),'ut',_0xff49('0x78'))[_0xff49('0x44')](_0xff49('0x79'),_0x2b7b89[_0xff49('0x4f')]['id']);for(var _0x484452=0x0;_0x484452<_0x5b4c9c[_0xff49('0x40')];_0x484452+=0x1){let _0x28f1b3=_0x5b4c9c[_0x484452];for(var _0x444991=0x0;_0x444991<_0x28f1b3[_0xff49('0x6a')]['length'];_0x444991+=0x1){let _0x53f520=_0x28f1b3[_0xff49('0x6a')][_0x444991];var _0x1e16ba=_0x16a6b1[_0xff49('0x7a')]();_0x1e16ba[_0xff49('0x44')](_0xff49('0x7b'),_0x53f520['id']);_0x45cfd6[_0xff49('0x7c')](db['sequelize']['query'](_0x1e16ba['toString'](),{'type':db[_0xff49('0x6e')][_0xff49('0x7d')][_0xff49('0x7e')]})[_0xff49('0x2d')](function(_0x468623){if(_0x468623[_0xff49('0x40')]===0x1){return _0x53f520['id'];}else{var _0x3e9418=_[_0xff49('0x7f')](_[_0xff49('0x47')](_0x468623,_0xff49('0x80')),function(_0x4a08ff){return _[_0xff49('0x81')](_0x2ba279,_0x4a08ff);});if(_0x3e9418){return _0x53f520['id'];}}}));}}return BPromise[_0xff49('0x82')](_0x45cfd6)[_0xff49('0x2d')](function(_0xa2ef92){_0x40c032=_(_0x40c032)[_0xff49('0x83')](_0xa2ef92)['compact']()[_0xff49('0x84')]();return db[_0xff49('0x35')][_0xff49('0x51')]({'where':{'id':_0x2b7b89[_0xff49('0x4f')]['id']}})[_0xff49('0x2d')](function(_0x2dfe17){return db['sequelize']['transaction'](function(_0x572990){return _0x2dfe17[_0xff49('0x73')](_0x2b7b89[_0xff49('0x3b')][_0xff49('0x85')],{'transaction':_0x572990})['then'](function(){if(!_['isEmpty'](_0x40c032)){return _0x2dfe17[_0xff49('0x86')](_0x40c032,{'transaction':_0x572990});}})[_0xff49('0x2d')](function(){_0x40c032[_0xff49('0x70')](function(_0x4ae0ac){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x4ae0ac,'OpenchannelQueueId':_0x2dfe17['id']});});});});});});})['then'](respondWithStatusCode(_0x25dff1,null))['catch'](handleError(_0x25dff1,null));};exports[_0xff49('0x87')]=function(_0x2c4ea2,_0x773d88,_0x36d89e){return db[_0xff49('0x35')][_0xff49('0x51')]({'where':{'id':_0x2c4ea2['params']['id']}})[_0xff49('0x2d')](handleEntityNotFound(_0x773d88,null))[_0xff49('0x2d')](function(_0x3b7ba0){if(_0x3b7ba0){return _0x3b7ba0[_0xff49('0x87')](_0x2c4ea2[_0xff49('0x54')][_0xff49('0x85')],_[_0xff49('0x88')](_0x2c4ea2[_0xff49('0x54')],[_0xff49('0x85'),'id'])||{})[_0xff49('0x89')](function(_0x58d12e){for(var _0x18d8ff=0x0;_0x18d8ff<_0x2c4ea2[_0xff49('0x54')]['ids'][_0xff49('0x40')];_0x18d8ff+=0x1){socket[_0xff49('0x71')](_0xff49('0x72'),{'UserId':Number(_0x2c4ea2['body'][_0xff49('0x85')][_0x18d8ff]),'OpenchannelQueueId':Number(_0x2c4ea2[_0xff49('0x4f')]['id'])});}return _0x58d12e;});}})['then'](respondWithResult(_0x773d88,null))['catch'](handleError(_0x773d88,null));};exports[_0xff49('0x86')]=function(_0x5770b5,_0x2c1ea1,_0x2c4295){return db[_0xff49('0x35')][_0xff49('0x51')]({'where':{'id':_0x5770b5['params']['id']}})[_0xff49('0x2d')](handleEntityNotFound(_0x2c1ea1,null))[_0xff49('0x2d')](function(_0x575f5d){if(_0x575f5d){return _0x575f5d[_0xff49('0x86')](_0x5770b5[_0xff49('0x3b')][_0xff49('0x85')])[_0xff49('0x2d')](function(){if(_[_0xff49('0x8a')](_0x5770b5[_0xff49('0x3b')][_0xff49('0x85')])){for(var _0x28fd26=0x0;_0x28fd26<_0x5770b5['query'][_0xff49('0x85')][_0xff49('0x40')];_0x28fd26+=0x1){socket[_0xff49('0x71')](_0xff49('0x8b'),{'UserId':Number(_0x5770b5['query'][_0xff49('0x85')][_0x28fd26]),'OpenchannelQueueId':Number(_0x5770b5[_0xff49('0x4f')]['id'])});}}else{socket[_0xff49('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x5770b5[_0xff49('0x3b')][_0xff49('0x85')]),'OpenchannelQueueId':Number(_0x5770b5[_0xff49('0x4f')]['id'])});}});}})[_0xff49('0x2d')](respondWithStatusCode(_0x2c1ea1,null))[_0xff49('0x52')](handleError(_0x2c1ea1,null));};exports[_0xff49('0x8c')]=function(_0x1bd133,_0xb746cc,_0x3afc11){var _0x182ff2={};var _0x3320d4={};var _0x2ef057;var _0x392f78;return db['OpenchannelQueue'][_0xff49('0x5c')]({'where':{'id':_0x1bd133['params']['id']}})[_0xff49('0x2d')](handleEntityNotFound(_0xb746cc,null))[_0xff49('0x2d')](function(_0x1ceacb){if(_0x1ceacb){_0x2ef057=_0x1ceacb;_0x3320d4[_0xff49('0x3a')]=_['keys'](db['User']['rawAttributes']);_0x3320d4['query']=_['keys'](_0x1bd133['query']);_0x3320d4['filters']=_[_0xff49('0x3d')](_0x3320d4[_0xff49('0x3a')],_0x3320d4[_0xff49('0x3b')]);_0x182ff2['attributes']=_[_0xff49('0x3d')](_0x3320d4[_0xff49('0x3a')],qs[_0xff49('0x3f')](_0x1bd133[_0xff49('0x3b')][_0xff49('0x3f')]));_0x182ff2[_0xff49('0x3e')]=_0x182ff2[_0xff49('0x3e')]['length']?_0x182ff2[_0xff49('0x3e')]:_0x3320d4[_0xff49('0x3a')];_0x182ff2[_0xff49('0x42')]=qs[_0xff49('0x43')](_0x1bd133[_0xff49('0x3b')][_0xff49('0x43')]);_0x182ff2[_0xff49('0x44')]=qs[_0xff49('0x3c')](_[_0xff49('0x68')](_0x1bd133[_0xff49('0x3b')],_0x3320d4[_0xff49('0x3c')]));if(_0x1bd133['query'][_0xff49('0x45')]){_0x182ff2[_0xff49('0x44')]=_[_0xff49('0x46')](_0x182ff2[_0xff49('0x44')],{'$or':_[_0xff49('0x47')](_0x182ff2[_0xff49('0x3e')],function(_0x391219){var _0x369f32={};_0x369f32[_0x391219]={'$like':'%'+_0x1bd133['query'][_0xff49('0x45')]+'%'};return _0x369f32;})});}_0x182ff2=_[_0xff49('0x46')]({},_0x182ff2,_0x1bd133[_0xff49('0x49')]);return _0x2ef057['getAgents'](_0x182ff2);}})[_0xff49('0x2d')](function(_0x430c58){if(_0x430c58){_0x392f78=_0x430c58['length'];if(!_0x1bd133[_0xff49('0x3b')][_0xff49('0x41')](_0xff49('0x5e'))){_0x182ff2[_0xff49('0x25')]=qs[_0xff49('0x25')](_0x1bd133['query'][_0xff49('0x25')]);_0x182ff2[_0xff49('0x23')]=qs[_0xff49('0x23')](_0x1bd133[_0xff49('0x3b')][_0xff49('0x23')]);}return _0x2ef057[_0xff49('0x8c')](_0x182ff2);}})[_0xff49('0x2d')](function(_0x12fa7c){if(_0x12fa7c){return _0x12fa7c?{'count':_0x392f78,'rows':_0x12fa7c}:null;}})[_0xff49('0x2d')](respondWithResult(_0xb746cc,null))[_0xff49('0x52')](handleError(_0xb746cc,null));}; \ No newline at end of file +var _0x16a5=['value','removeAgents','forEach','userOpenchannelQueue:remove','omit','spread','isArray','getAgents','hasOwnProperty','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','save','update','destroy','then','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','findAll','rows','catch','show','params','include','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserOpenchannelQueue','pick','OpenchannelQueueId','User','findAndCountAll','agent','openchannelPause','updatedAt','%s/%s','SIP','createdAt','findOne','Team','getTeams','Agents','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','ids','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','includes','all','compact'];(function(_0x3825f4,_0x2a939a){var _0x352fad=function(_0x3c544f){while(--_0x3c544f){_0x3825f4['push'](_0x3825f4['shift']());}};_0x352fad(++_0x2a939a);}(_0x16a5,0x19e));var _0x516a=function(_0x58418a,_0x3d9f06){_0x58418a=_0x58418a-0x0;var _0x2716bf=_0x16a5[_0x58418a];return _0x2716bf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x516a('0x0'));var jsonpatch=require(_0x516a('0x1'));var rp=require(_0x516a('0x2'));var moment=require(_0x516a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x516a('0x4'));var util=require(_0x516a('0x5'));var path=require(_0x516a('0x6'));var sox=require(_0x516a('0x7'));var csv=require('to-csv');var ejs=require(_0x516a('0x8'));var fs=require('fs');var fs_extra=require(_0x516a('0x9'));var _=require(_0x516a('0xa'));var squel=require(_0x516a('0xb'));var crypto=require(_0x516a('0xc'));var jsforce=require(_0x516a('0xd'));var deskjs=require(_0x516a('0xe'));var toCsv=require(_0x516a('0xf'));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(_0x516a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x516a('0x11'))('api');var utils=require(_0x516a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x516a('0x13'));var db=require(_0x516a('0x14'))['db'];config['redis']=_[_0x516a('0x15')](config[_0x516a('0x16')],{'host':_0x516a('0x17'),'port':0x18eb});var socket=require(_0x516a('0x18'))(new Redis(config['redis']));require(_0x516a('0x19'))[_0x516a('0x1a')](socket);function respondWithStatusCode(_0x299901,_0x471584){_0x471584=_0x471584||0xcc;return function(_0x18c70b){if(_0x18c70b){return _0x299901[_0x516a('0x1b')](_0x471584);}return _0x299901[_0x516a('0x1c')](_0x471584)[_0x516a('0x1d')]();};}function respondWithResult(_0x55a5a4,_0x418713){_0x418713=_0x418713||0xc8;return function(_0x56a993){if(_0x56a993){return _0x55a5a4['status'](_0x418713)['json'](_0x56a993);}};}function respondWithFilteredResult(_0x324732,_0x3402ee){return function(_0x594c53){if(_0x594c53){var _0xfe78df=typeof _0x3402ee['offset']===_0x516a('0x1e')&&typeof _0x3402ee['limit']===_0x516a('0x1e');var _0x33aa2e=_0x594c53[_0x516a('0x1f')];var _0x1e7d0d=_0xfe78df?0x0:_0x3402ee[_0x516a('0x20')];var _0x26d50e=_0xfe78df?_0x594c53[_0x516a('0x1f')]:_0x3402ee[_0x516a('0x20')]+_0x3402ee[_0x516a('0x21')];var _0x22772f;if(_0x26d50e>=_0x33aa2e){_0x26d50e=_0x33aa2e;_0x22772f=0xc8;}else{_0x22772f=0xce;}_0x324732[_0x516a('0x1c')](_0x22772f);return _0x324732['set'](_0x516a('0x22'),_0x1e7d0d+'-'+_0x26d50e+'/'+_0x33aa2e)[_0x516a('0x23')](_0x594c53);}return null;};}function patchUpdates(_0x1bb73e){return function(_0x4d51aa){try{jsonpatch['apply'](_0x4d51aa,_0x1bb73e,!![]);}catch(_0xbd4913){return BPromise['reject'](_0xbd4913);}return _0x4d51aa[_0x516a('0x24')]();};}function saveUpdates(_0x5f3b4b,_0x5cff0a){return function(_0x8bd7d7){if(_0x8bd7d7){return _0x8bd7d7[_0x516a('0x25')](_0x5f3b4b)['then'](function(_0x10b32f){return _0x10b32f;});}return null;};}function removeEntity(_0xff6f5d,_0xb9dc5){return function(_0x87d8fc){if(_0x87d8fc){return _0x87d8fc[_0x516a('0x26')]()[_0x516a('0x27')](function(){var _0x244150=_0x87d8fc[_0x516a('0x28')]({'plain':!![]});var _0x2d31a1=_0x516a('0x29');return db[_0x516a('0x2a')][_0x516a('0x26')]({'where':{'type':_0x2d31a1,'resourceId':_0x244150['id']}})[_0x516a('0x27')](function(){return _0x87d8fc;});})[_0x516a('0x27')](function(){_0xff6f5d[_0x516a('0x1c')](0xcc)[_0x516a('0x1d')]();});}};}function handleEntityNotFound(_0x3a694e,_0xc6f18){return function(_0x2b2cea){if(!_0x2b2cea){_0x3a694e['sendStatus'](0x194);}return _0x2b2cea;};}function handleError(_0x1c3450,_0x123bcb){_0x123bcb=_0x123bcb||0x1f4;return function(_0x2c48e3){logger[_0x516a('0x2b')](_0x2c48e3[_0x516a('0x2c')]);if(_0x2c48e3[_0x516a('0x2d')]){delete _0x2c48e3[_0x516a('0x2d')];}_0x1c3450[_0x516a('0x1c')](_0x123bcb)[_0x516a('0x2e')](_0x2c48e3);};}exports[_0x516a('0x2f')]=function(_0x4aaae0,_0x458fb4){var _0x4a3784={},_0x40d9d5={},_0x5f1a1e={'count':0x0,'rows':[]};var _0x5e1282=_['map'](db[_0x516a('0x30')][_0x516a('0x31')],function(_0x17af15){return{'name':_0x17af15[_0x516a('0x32')],'type':_0x17af15[_0x516a('0x33')][_0x516a('0x34')]};});_0x40d9d5[_0x516a('0x35')]=_[_0x516a('0x36')](_0x5e1282,_0x516a('0x2d'));_0x40d9d5[_0x516a('0x37')]=_[_0x516a('0x38')](_0x4aaae0[_0x516a('0x37')]);_0x40d9d5[_0x516a('0x39')]=_[_0x516a('0x3a')](_0x40d9d5['model'],_0x40d9d5['query']);_0x4a3784[_0x516a('0x3b')]=_[_0x516a('0x3a')](_0x40d9d5[_0x516a('0x35')],qs['fields'](_0x4aaae0[_0x516a('0x37')][_0x516a('0x3c')]));_0x4a3784[_0x516a('0x3b')]=_0x4a3784[_0x516a('0x3b')][_0x516a('0x3d')]?_0x4a3784[_0x516a('0x3b')]:_0x40d9d5['model'];if(!_0x4aaae0['query']['hasOwnProperty'](_0x516a('0x3e'))){_0x4a3784['limit']=qs[_0x516a('0x21')](_0x4aaae0['query'][_0x516a('0x21')]);_0x4a3784[_0x516a('0x20')]=qs[_0x516a('0x20')](_0x4aaae0[_0x516a('0x37')][_0x516a('0x20')]);}_0x4a3784[_0x516a('0x3f')]=qs[_0x516a('0x40')](_0x4aaae0['query'][_0x516a('0x40')]);_0x4a3784[_0x516a('0x41')]=qs[_0x516a('0x39')](_['pick'](_0x4aaae0[_0x516a('0x37')],_0x40d9d5[_0x516a('0x39')]),_0x5e1282);if(_0x4aaae0[_0x516a('0x37')][_0x516a('0x42')]){_0x4a3784[_0x516a('0x41')]=_['merge'](_0x4a3784[_0x516a('0x41')],{'$or':_['map'](_0x5e1282,function(_0x3e252d){if(_0x3e252d[_0x516a('0x33')]!==_0x516a('0x43')){var _0x47cc69={};_0x47cc69[_0x3e252d[_0x516a('0x2d')]]={'$like':'%'+_0x4aaae0[_0x516a('0x37')][_0x516a('0x42')]+'%'};return _0x47cc69;}})});}_0x4a3784=_[_0x516a('0x44')]({},_0x4a3784,_0x4aaae0['options']);var _0x3008c7={'where':_0x4a3784['where']};return db['OpenchannelQueue'][_0x516a('0x1f')](_0x3008c7)['then'](function(_0x485ae0){_0x5f1a1e[_0x516a('0x1f')]=_0x485ae0;if(_0x4aaae0['query']['includeAll']){_0x4a3784['include']=[{'all':!![]}];}return db[_0x516a('0x30')][_0x516a('0x45')](_0x4a3784);})[_0x516a('0x27')](function(_0x4e4b3c){_0x5f1a1e[_0x516a('0x46')]=_0x4e4b3c;return _0x5f1a1e;})[_0x516a('0x27')](respondWithFilteredResult(_0x458fb4,_0x4a3784))[_0x516a('0x47')](handleError(_0x458fb4,null));};exports[_0x516a('0x48')]=function(_0x35a6ae,_0x15a02f){var _0x391976={'raw':!![],'where':{'id':_0x35a6ae[_0x516a('0x49')]['id']}},_0x5beb8e={};_0x5beb8e['model']=_['keys'](db[_0x516a('0x30')]['rawAttributes']);_0x5beb8e['query']=_['keys'](_0x35a6ae['query']);_0x5beb8e[_0x516a('0x39')]=_[_0x516a('0x3a')](_0x5beb8e[_0x516a('0x35')],_0x5beb8e[_0x516a('0x37')]);_0x391976[_0x516a('0x3b')]=_['intersection'](_0x5beb8e['model'],qs[_0x516a('0x3c')](_0x35a6ae[_0x516a('0x37')][_0x516a('0x3c')]));_0x391976['attributes']=_0x391976[_0x516a('0x3b')][_0x516a('0x3d')]?_0x391976[_0x516a('0x3b')]:_0x5beb8e['model'];if(_0x35a6ae['query']['includeAll']){_0x391976[_0x516a('0x4a')]=[{'all':!![]}];}_0x391976=_['merge']({},_0x391976,_0x35a6ae[_0x516a('0x4b')]);return db['OpenchannelQueue'][_0x516a('0x4c')](_0x391976)[_0x516a('0x27')](handleEntityNotFound(_0x15a02f,null))[_0x516a('0x27')](respondWithResult(_0x15a02f,null))[_0x516a('0x47')](handleError(_0x15a02f,null));};exports['create']=function(_0x55a604,_0x368990){return db[_0x516a('0x30')]['create'](_0x55a604[_0x516a('0x4d')],{})['then'](function(_0x4bd67c){var _0x5bc863=_0x55a604[_0x516a('0x4e')][_0x516a('0x28')]({'plain':!![]});if(!_0x5bc863)throw new Error(_0x516a('0x4f'));if(_0x5bc863['role']===_0x516a('0x4e')){var _0x5e3f66=_0x4bd67c[_0x516a('0x28')]({'plain':!![]});var _0x305f29=_0x516a('0x29');return db[_0x516a('0x50')][_0x516a('0x4c')]({'where':{'name':_0x305f29,'userProfileId':_0x5bc863['userProfileId']},'raw':!![]})[_0x516a('0x27')](function(_0x41181b){if(_0x41181b&&_0x41181b[_0x516a('0x51')]===0x0){return db['UserProfileResource'][_0x516a('0x52')]({'name':_0x5e3f66[_0x516a('0x2d')],'resourceId':_0x5e3f66['id'],'type':_0x41181b['name'],'sectionId':_0x41181b['id']},{})[_0x516a('0x27')](function(){return _0x4bd67c;});}else{return _0x4bd67c;}})[_0x516a('0x47')](function(_0x573a3e){logger[_0x516a('0x2b')](_0x516a('0x53'),_0x573a3e);throw _0x573a3e;});}return _0x4bd67c;})[_0x516a('0x27')](respondWithResult(_0x368990,0xc9))[_0x516a('0x47')](handleError(_0x368990,null));};exports[_0x516a('0x25')]=function(_0x3f425e,_0x3fdde4){if(_0x3f425e[_0x516a('0x4d')]['id']){delete _0x3f425e[_0x516a('0x4d')]['id'];}return db[_0x516a('0x30')]['find']({'where':{'id':_0x3f425e['params']['id']}})[_0x516a('0x27')](handleEntityNotFound(_0x3fdde4,null))[_0x516a('0x27')](saveUpdates(_0x3f425e[_0x516a('0x4d')],null))[_0x516a('0x27')](respondWithResult(_0x3fdde4,null))[_0x516a('0x47')](handleError(_0x3fdde4,null));};exports[_0x516a('0x26')]=function(_0x1ad0c4,_0x5f37c6){return db[_0x516a('0x30')][_0x516a('0x4c')]({'where':{'id':_0x1ad0c4[_0x516a('0x49')]['id']}})['then'](handleEntityNotFound(_0x5f37c6,null))['then'](removeEntity(_0x5f37c6,null))[_0x516a('0x47')](handleError(_0x5f37c6,null));};exports[_0x516a('0x54')]=function(_0x99eff4,_0x13f84c){return db['OpenchannelQueue'][_0x516a('0x54')]()[_0x516a('0x27')](respondWithResult(_0x13f84c,null))[_0x516a('0x47')](handleError(_0x13f84c,null));};exports['getMembers']=function(_0x496903,_0x3223c7,_0x117838){var _0x2b6c9e={'raw':!![],'where':{}},_0x514f41={},_0x5eb357;return db[_0x516a('0x30')]['findOne']({'where':{'id':_0x496903[_0x516a('0x49')]['id']}})[_0x516a('0x27')](handleEntityNotFound(_0x3223c7,null))['then'](function(_0x23f9de){if(_0x23f9de){_0x5eb357=_0x23f9de[_0x516a('0x28')]({'plain':!![]});_0x514f41[_0x516a('0x35')]=_[_0x516a('0x38')](db[_0x516a('0x55')][_0x516a('0x31')]);_0x514f41[_0x516a('0x37')]=_['keys'](_0x496903[_0x516a('0x37')]);_0x514f41['filters']=_[_0x516a('0x3a')](_0x514f41[_0x516a('0x35')],_0x514f41[_0x516a('0x37')]);_0x2b6c9e['attributes']=_[_0x516a('0x3a')](_0x514f41[_0x516a('0x35')],qs[_0x516a('0x3c')](_0x496903['query'][_0x516a('0x3c')]));_0x2b6c9e[_0x516a('0x3b')]=_0x2b6c9e[_0x516a('0x3b')][_0x516a('0x3d')]?_0x2b6c9e[_0x516a('0x3b')]:_0x514f41[_0x516a('0x35')];if(!_0x496903[_0x516a('0x37')]['hasOwnProperty'](_0x516a('0x3e'))){_0x2b6c9e[_0x516a('0x21')]=qs[_0x516a('0x21')](_0x496903[_0x516a('0x37')][_0x516a('0x21')]);_0x2b6c9e['offset']=qs[_0x516a('0x20')](_0x496903[_0x516a('0x37')]['offset']);}_0x2b6c9e[_0x516a('0x3f')]=qs[_0x516a('0x40')](_0x496903[_0x516a('0x37')][_0x516a('0x40')]);_0x2b6c9e[_0x516a('0x41')]=qs['filters'](_[_0x516a('0x56')](_0x496903[_0x516a('0x37')],_0x514f41['filters']));_0x2b6c9e[_0x516a('0x41')][_0x516a('0x57')]=_0x23f9de['id'];if(_0x496903[_0x516a('0x37')][_0x516a('0x42')]){_0x2b6c9e[_0x516a('0x41')]=_[_0x516a('0x44')](_0x2b6c9e[_0x516a('0x41')],{'$or':_['map'](_0x2b6c9e[_0x516a('0x3b')],function(_0x581320){var _0x4a643d={};_0x4a643d[_0x581320]={'$like':'%'+_0x496903['query'][_0x516a('0x42')]+'%'};return _0x4a643d;})});}_0x2b6c9e=_[_0x516a('0x44')]({},_0x2b6c9e,_0x496903[_0x516a('0x4b')]);return db[_0x516a('0x55')][_0x516a('0x45')](_0x2b6c9e);}})['then'](function(_0x14f2f9){if(_0x14f2f9){return db[_0x516a('0x58')][_0x516a('0x59')]({'where':{'id':_[_0x516a('0x36')](_0x14f2f9,'UserId'),'role':_0x516a('0x5a')},'attributes':['id',_0x516a('0x2d'),_0x516a('0x5b'),_0x516a('0x5c'),'createdAt']});}})['then'](function(_0x216191){if(_0x216191){return{'count':_0x216191[_0x516a('0x1f')],'rows':_['map'](_0x216191[_0x516a('0x46')],function(_0x18fbf0){return{'membername':_0x18fbf0['name'],'UserId':_0x18fbf0['id'],'queue_name':_0x5eb357['name'],'OpenchannelQueueId':_0x5eb357['id'],'interface':util['format'](_0x516a('0x5d'),_0x516a('0x5e'),_0x18fbf0[_0x516a('0x2d')]),'penalty':0x0,'paused':_0x18fbf0[_0x516a('0x5b')],'createdAt':_0x18fbf0[_0x516a('0x5f')],'updatedAt':_0x18fbf0[_0x516a('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x516a('0x27')](respondWithFilteredResult(_0x3223c7,_0x2b6c9e))[_0x516a('0x47')](handleError(_0x3223c7,null));};exports['getTeams']=function(_0x19a93f,_0x2cc83c,_0x10015d){var _0x56bfe6={};var _0x330e85={};var _0x2dd35a;var _0x2c1f11;return db[_0x516a('0x30')][_0x516a('0x60')]({'where':{'id':_0x19a93f[_0x516a('0x49')]['id']}})[_0x516a('0x27')](handleEntityNotFound(_0x2cc83c,null))[_0x516a('0x27')](function(_0x1b96f6){if(_0x1b96f6){_0x2dd35a=_0x1b96f6;_0x330e85[_0x516a('0x35')]=_[_0x516a('0x38')](db[_0x516a('0x61')]['rawAttributes']);_0x330e85[_0x516a('0x37')]=_[_0x516a('0x38')](_0x19a93f[_0x516a('0x37')]);_0x330e85[_0x516a('0x39')]=_[_0x516a('0x3a')](_0x330e85[_0x516a('0x35')],_0x330e85[_0x516a('0x37')]);_0x56bfe6['attributes']=_[_0x516a('0x3a')](_0x330e85['model'],qs[_0x516a('0x3c')](_0x19a93f[_0x516a('0x37')][_0x516a('0x3c')]));_0x56bfe6[_0x516a('0x3b')]=_0x56bfe6[_0x516a('0x3b')][_0x516a('0x3d')]?_0x56bfe6[_0x516a('0x3b')]:_0x330e85[_0x516a('0x35')];_0x56bfe6[_0x516a('0x3f')]=qs['sort'](_0x19a93f['query'][_0x516a('0x40')]);_0x56bfe6['where']=qs[_0x516a('0x39')](_[_0x516a('0x56')](_0x19a93f[_0x516a('0x37')],_0x330e85[_0x516a('0x39')]));if(_0x19a93f[_0x516a('0x37')]['filter']){_0x56bfe6['where']=_['merge'](_0x56bfe6['where'],{'$or':_[_0x516a('0x36')](_0x56bfe6['attributes'],function(_0x31efc0){var _0xb32ab1={};_0xb32ab1[_0x31efc0]={'$like':'%'+_0x19a93f[_0x516a('0x37')][_0x516a('0x42')]+'%'};return _0xb32ab1;})});}_0x56bfe6=_[_0x516a('0x44')]({},_0x56bfe6,_0x19a93f[_0x516a('0x4b')]);return _0x2dd35a[_0x516a('0x62')](_0x56bfe6);}})['then'](function(_0x2da394){if(_0x2da394){_0x2c1f11=_0x2da394[_0x516a('0x3d')];if(!_0x19a93f[_0x516a('0x37')]['hasOwnProperty']('nolimit')){_0x56bfe6[_0x516a('0x21')]=qs[_0x516a('0x21')](_0x19a93f[_0x516a('0x37')][_0x516a('0x21')]);_0x56bfe6[_0x516a('0x20')]=qs[_0x516a('0x20')](_0x19a93f['query'][_0x516a('0x20')]);}return _0x2dd35a[_0x516a('0x62')](_0x56bfe6);}})[_0x516a('0x27')](function(_0x4a34a5){if(_0x4a34a5){return _0x4a34a5?{'count':_0x2c1f11,'rows':_0x4a34a5}:null;}})[_0x516a('0x27')](respondWithResult(_0x2cc83c,null))[_0x516a('0x47')](handleError(_0x2cc83c,null));};exports['addTeams']=function(_0x44031a,_0x480243,_0x66b52b){var _0x520686=_0x44031a[_0x516a('0x4d')]['ids'];return db[_0x516a('0x61')][_0x516a('0x45')]({'where':{'id':_0x520686},'attributes':['id'],'include':[{'model':db[_0x516a('0x58')],'as':_0x516a('0x63'),'attributes':['id','name','online','voicePause',_0x516a('0x64')],'raw':!![]}]})[_0x516a('0x27')](function(_0x4660a8){if(_0x4660a8){var _0x5a765c=_[_0x516a('0x65')](_0x4660a8,function(_0x987d74){var _0x421f5f=_0x987d74[_0x516a('0x28')]({'plain':!![]});return _0x421f5f['Agents'];});return db['OpenchannelQueue']['find']({'where':{'id':_0x44031a['params']['id']}})[_0x516a('0x27')](function(_0x45007c){return db[_0x516a('0x66')][_0x516a('0x67')](function(_0x3b7f68){return _0x45007c[_0x516a('0x68')](_0x520686,{'transaction':_0x3b7f68})['then'](function(){return BPromise[_0x516a('0x69')](_0x5a765c,function(_0x3f2c93){return db[_0x516a('0x55')][_0x516a('0x6a')]({'where':{'UserId':_0x3f2c93['id'],'OpenchannelQueueId':_0x44031a[_0x516a('0x49')]['id']},'transaction':_0x3b7f68});});})[_0x516a('0x27')](function(){_0x5a765c['forEach'](function(_0x46d895){socket[_0x516a('0x6b')](_0x516a('0x6c'),{'UserId':_0x46d895['id'],'OpenchannelQueueId':_0x45007c['id']});});});});});}})[_0x516a('0x27')](respondWithStatusCode(_0x480243,null))[_0x516a('0x47')](handleError(_0x480243,null));};exports[_0x516a('0x6d')]=function(_0x3ad6cd,_0x5efbf2,_0x1cb3ad){return db[_0x516a('0x61')][_0x516a('0x45')]({'where':{'id':_0x3ad6cd[_0x516a('0x37')][_0x516a('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x516a('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x516a('0x27')](handleEntityNotFound(_0x5efbf2,null))[_0x516a('0x27')](function(_0x416c7c){var _0x18fb05=_['map'](_0x416c7c,'id');var _0x348a72=[];var _0x43997a=[];var _0xb723ae=squel['select']();_0xb723ae[_0x516a('0x6f')](_0x516a('0x70'))['from'](_0x516a('0x71'),'tq')[_0x516a('0x72')](_0x516a('0x73'),'ut',_0x516a('0x74'))[_0x516a('0x41')](_0x516a('0x75'),_0x3ad6cd[_0x516a('0x49')]['id']);for(var _0x462e46=0x0;_0x462e46<_0x416c7c['length'];_0x462e46+=0x1){let _0x2397b2=_0x416c7c[_0x462e46];for(var _0x330fef=0x0;_0x330fef<_0x2397b2['Agents'][_0x516a('0x3d')];_0x330fef+=0x1){let _0x5b8bac=_0x2397b2[_0x516a('0x63')][_0x330fef];var _0x5e5a6d=_0xb723ae[_0x516a('0x76')]();_0x5e5a6d['where'](_0x516a('0x77'),_0x5b8bac['id']);_0x43997a['push'](db[_0x516a('0x66')][_0x516a('0x37')](_0x5e5a6d['toString'](),{'type':db['sequelize'][_0x516a('0x78')][_0x516a('0x79')]})[_0x516a('0x27')](function(_0x3864ae){if(_0x3864ae[_0x516a('0x3d')]===0x1){return _0x5b8bac['id'];}else{var _0x168749=_[_0x516a('0x7a')](_[_0x516a('0x36')](_0x3864ae,'TeamId'),function(_0x326e10){return _[_0x516a('0x7b')](_0x18fb05,_0x326e10);});if(_0x168749){return _0x5b8bac['id'];}}}));}}return BPromise[_0x516a('0x7c')](_0x43997a)[_0x516a('0x27')](function(_0x4e3bb6){_0x348a72=_(_0x348a72)['union'](_0x4e3bb6)[_0x516a('0x7d')]()[_0x516a('0x7e')]();return db[_0x516a('0x30')][_0x516a('0x4c')]({'where':{'id':_0x3ad6cd[_0x516a('0x49')]['id']}})[_0x516a('0x27')](function(_0xe2d92e){return db[_0x516a('0x66')][_0x516a('0x67')](function(_0x53fe17){return _0xe2d92e[_0x516a('0x6d')](_0x3ad6cd[_0x516a('0x37')]['ids'],{'transaction':_0x53fe17})[_0x516a('0x27')](function(){if(!_['isEmpty'](_0x348a72)){return _0xe2d92e[_0x516a('0x7f')](_0x348a72,{'transaction':_0x53fe17});}})[_0x516a('0x27')](function(){_0x348a72[_0x516a('0x80')](function(_0x3ecdbf){socket['emit'](_0x516a('0x81'),{'UserId':_0x3ecdbf,'OpenchannelQueueId':_0xe2d92e['id']});});});});});});})[_0x516a('0x27')](respondWithStatusCode(_0x5efbf2,null))[_0x516a('0x47')](handleError(_0x5efbf2,null));};exports['addAgents']=function(_0x4dda4c,_0x37cf91,_0x2a78e1){return db[_0x516a('0x30')]['find']({'where':{'id':_0x4dda4c[_0x516a('0x49')]['id']}})['then'](handleEntityNotFound(_0x37cf91,null))[_0x516a('0x27')](function(_0x3c0bef){if(_0x3c0bef){return _0x3c0bef['addAgents'](_0x4dda4c['body'][_0x516a('0x6e')],_[_0x516a('0x82')](_0x4dda4c[_0x516a('0x4d')],[_0x516a('0x6e'),'id'])||{})[_0x516a('0x83')](function(_0x26a1b4){for(var _0x4905f9=0x0;_0x4905f9<_0x4dda4c[_0x516a('0x4d')][_0x516a('0x6e')][_0x516a('0x3d')];_0x4905f9+=0x1){socket['emit'](_0x516a('0x6c'),{'UserId':Number(_0x4dda4c[_0x516a('0x4d')]['ids'][_0x4905f9]),'OpenchannelQueueId':Number(_0x4dda4c[_0x516a('0x49')]['id'])});}return _0x26a1b4;});}})['then'](respondWithResult(_0x37cf91,null))['catch'](handleError(_0x37cf91,null));};exports['removeAgents']=function(_0x25d3a2,_0x2a787f,_0x5de3e2){return db[_0x516a('0x30')][_0x516a('0x4c')]({'where':{'id':_0x25d3a2[_0x516a('0x49')]['id']}})['then'](handleEntityNotFound(_0x2a787f,null))[_0x516a('0x27')](function(_0x3d6815){if(_0x3d6815){return _0x3d6815['removeAgents'](_0x25d3a2['query'][_0x516a('0x6e')])[_0x516a('0x27')](function(){if(_[_0x516a('0x84')](_0x25d3a2['query']['ids'])){for(var _0x377a60=0x0;_0x377a60<_0x25d3a2[_0x516a('0x37')]['ids'][_0x516a('0x3d')];_0x377a60+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x25d3a2[_0x516a('0x37')][_0x516a('0x6e')][_0x377a60]),'OpenchannelQueueId':Number(_0x25d3a2[_0x516a('0x49')]['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x25d3a2['query'][_0x516a('0x6e')]),'OpenchannelQueueId':Number(_0x25d3a2[_0x516a('0x49')]['id'])});}});}})[_0x516a('0x27')](respondWithStatusCode(_0x2a787f,null))['catch'](handleError(_0x2a787f,null));};exports['getAgents']=function(_0x12789a,_0x3336ae,_0x15f04e){var _0x443a7c={};var _0x106d4a={};var _0x260eb1;var _0xef8dcf;return db[_0x516a('0x30')][_0x516a('0x60')]({'where':{'id':_0x12789a[_0x516a('0x49')]['id']}})[_0x516a('0x27')](handleEntityNotFound(_0x3336ae,null))['then'](function(_0x501be7){if(_0x501be7){_0x260eb1=_0x501be7;_0x106d4a[_0x516a('0x35')]=_[_0x516a('0x38')](db[_0x516a('0x58')]['rawAttributes']);_0x106d4a[_0x516a('0x37')]=_['keys'](_0x12789a[_0x516a('0x37')]);_0x106d4a[_0x516a('0x39')]=_['intersection'](_0x106d4a[_0x516a('0x35')],_0x106d4a[_0x516a('0x37')]);_0x443a7c[_0x516a('0x3b')]=_[_0x516a('0x3a')](_0x106d4a[_0x516a('0x35')],qs[_0x516a('0x3c')](_0x12789a['query'][_0x516a('0x3c')]));_0x443a7c[_0x516a('0x3b')]=_0x443a7c[_0x516a('0x3b')][_0x516a('0x3d')]?_0x443a7c[_0x516a('0x3b')]:_0x106d4a['model'];_0x443a7c[_0x516a('0x3f')]=qs[_0x516a('0x40')](_0x12789a['query'][_0x516a('0x40')]);_0x443a7c[_0x516a('0x41')]=qs[_0x516a('0x39')](_[_0x516a('0x56')](_0x12789a[_0x516a('0x37')],_0x106d4a[_0x516a('0x39')]));if(_0x12789a[_0x516a('0x37')][_0x516a('0x42')]){_0x443a7c[_0x516a('0x41')]=_['merge'](_0x443a7c[_0x516a('0x41')],{'$or':_[_0x516a('0x36')](_0x443a7c[_0x516a('0x3b')],function(_0x42b72c){var _0x4c9c3d={};_0x4c9c3d[_0x42b72c]={'$like':'%'+_0x12789a[_0x516a('0x37')][_0x516a('0x42')]+'%'};return _0x4c9c3d;})});}_0x443a7c=_['merge']({},_0x443a7c,_0x12789a['options']);return _0x260eb1[_0x516a('0x85')](_0x443a7c);}})[_0x516a('0x27')](function(_0x2cf376){if(_0x2cf376){_0xef8dcf=_0x2cf376[_0x516a('0x3d')];if(!_0x12789a['query'][_0x516a('0x86')](_0x516a('0x3e'))){_0x443a7c[_0x516a('0x21')]=qs[_0x516a('0x21')](_0x12789a[_0x516a('0x37')][_0x516a('0x21')]);_0x443a7c[_0x516a('0x20')]=qs[_0x516a('0x20')](_0x12789a[_0x516a('0x37')][_0x516a('0x20')]);}return _0x260eb1[_0x516a('0x85')](_0x443a7c);}})[_0x516a('0x27')](function(_0x482a98){if(_0x482a98){return _0x482a98?{'count':_0xef8dcf,'rows':_0x482a98}:null;}})[_0x516a('0x27')](respondWithResult(_0x3336ae,null))[_0x516a('0x47')](handleError(_0x3336ae,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 5005879..4f0ee33 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 _0x2684=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x37d8b2,_0x208f92){var _0x4faa84=function(_0x5da699){while(--_0x5da699){_0x37d8b2['push'](_0x37d8b2['shift']());}};_0x4faa84(++_0x208f92);}(_0x2684,0x1e4));var _0x4268=function(_0x1bd342,_0x1c8f7a){_0x1bd342=_0x1bd342-0x0;var _0x587a9f=_0x2684[_0x1bd342];return _0x587a9f;};'use strict';var EventEmitter=require(_0x4268('0x0'));var OpenchannelQueue=require(_0x4268('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x4268('0x2')](0x0);var events={'afterCreate':_0x4268('0x3'),'afterUpdate':_0x4268('0x4'),'afterDestroy':_0x4268('0x5')};function emitEvent(_0x3e598c){return function(_0x2e7db7,_0x5cc370,_0x498fae){OpenchannelQueueEvents[_0x4268('0x6')](_0x3e598c+':'+_0x2e7db7['id'],_0x2e7db7);OpenchannelQueueEvents[_0x4268('0x6')](_0x3e598c,_0x2e7db7);_0x498fae(null);};}for(var e in events){if(events[_0x4268('0x7')](e)){var event=events[e];OpenchannelQueue[_0x4268('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xdaf2=['events','../../mysqldb','OpenchannelQueue','remove','emit','hasOwnProperty','hook'];(function(_0x8c64d9,_0x45535c){var _0x22b21e=function(_0x3da323){while(--_0x3da323){_0x8c64d9['push'](_0x8c64d9['shift']());}};_0x22b21e(++_0x45535c);}(_0xdaf2,0x13b));var _0x2daf=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0xdaf2[_0x1dbaf7];return _0x593f05;};'use strict';var EventEmitter=require(_0x2daf('0x0'));var OpenchannelQueue=require(_0x2daf('0x1'))['db'][_0x2daf('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2daf('0x3')};function emitEvent(_0x56c60e){return function(_0x147328,_0x3352ee,_0x5e170a){OpenchannelQueueEvents[_0x2daf('0x4')](_0x56c60e+':'+_0x147328['id'],_0x147328);OpenchannelQueueEvents['emit'](_0x56c60e,_0x147328);_0x5e170a(null);};}for(var e in events){if(events[_0x2daf('0x5')](e)){var event=events[e];OpenchannelQueue[_0x2daf('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 1065115..eda3e29 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 _0x5ef8=['moment','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5ef8,0xbc));var _0x85ef=function(_0x19ee42,_0x19e0d3){_0x19ee42=_0x19ee42-0x0;var _0x2752c3=_0x5ef8[_0x19ee42];return _0x2752c3;};'use strict';var _=require(_0x85ef('0x0'));var util=require(_0x85ef('0x1'));var logger=require(_0x85ef('0x2'))(_0x85ef('0x3'));var moment=require(_0x85ef('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x85ef('0x5'));var config=require(_0x85ef('0x6'));var attributes=require(_0x85ef('0x7'));module[_0x85ef('0x8')]=function(_0x41e49a,_0x36ab52){return _0x41e49a[_0x85ef('0x9')](_0x85ef('0xa'),attributes,{'tableName':_0x85ef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x130b=['rimraf','../../config/environment','define','OpenchannelQueue','lodash','util','../../config/logger','bluebird','path'];(function(_0x30fa9d,_0x88c6ee){var _0x5ef4e8=function(_0x4bf428){while(--_0x4bf428){_0x30fa9d['push'](_0x30fa9d['shift']());}};_0x5ef4e8(++_0x88c6ee);}(_0x130b,0xa6));var _0xb130=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x130b[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xb130('0x0'));var util=require(_0xb130('0x1'));var logger=require(_0xb130('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb130('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb130('0x4'));var rimraf=require(_0xb130('0x5'));var config=require(_0xb130('0x6'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x2aa82e,_0x2a6f2d){return _0x2aa82e[_0xb130('0x7')](_0xb130('0x8'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 44ed9fc..aa1bca8 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 _0xb807=['raw','options','where','map','include','model','attributes','GetOpenchannelQueue','find','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueue','findAll'];(function(_0x23cc95,_0x394ac7){var _0x3b89e2=function(_0x53810f){while(--_0x53810f){_0x23cc95['push'](_0x23cc95['shift']());}};_0x3b89e2(++_0x394ac7);}(_0xb807,0xc8));var _0x7b80=function(_0x303310,_0x3d6211){_0x303310=_0x303310-0x0;var _0x1e4370=_0xb807[_0x303310];return _0x1e4370;};'use strict';var _=require(_0x7b80('0x0'));var util=require(_0x7b80('0x1'));var moment=require(_0x7b80('0x2'));var BPromise=require(_0x7b80('0x3'));var rs=require(_0x7b80('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b80('0x5'))['db'];var utils=require(_0x7b80('0x6'));var logger=require(_0x7b80('0x7'))(_0x7b80('0x8'));var config=require(_0x7b80('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x7b80('0xa')]=_['defaults'](config[_0x7b80('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7b80('0xb'))(new Redis(config['redis']));require(_0x7b80('0xc'))[_0x7b80('0xd')](socket);function respondWithRpcPromise(_0x1527ab,_0x22c37a,_0x33d0d0){return new BPromise(function(_0x1d766f,_0x5d801b){return client[_0x7b80('0xe')](_0x1527ab,_0x33d0d0)[_0x7b80('0xf')](function(_0x4a8fe9){logger[_0x7b80('0x10')](_0x7b80('0x11'),_0x22c37a,'request\x20sent');logger[_0x7b80('0x12')](_0x7b80('0x13'),_0x22c37a,'request\x20sent',JSON[_0x7b80('0x14')](_0x4a8fe9));if(_0x4a8fe9[_0x7b80('0x15')]){if(_0x4a8fe9['error'][_0x7b80('0x16')]===0x1f4){logger['error'](_0x7b80('0x11'),_0x22c37a,_0x4a8fe9[_0x7b80('0x15')][_0x7b80('0x17')]);return _0x5d801b(_0x4a8fe9[_0x7b80('0x15')][_0x7b80('0x17')]);}logger[_0x7b80('0x15')](_0x7b80('0x11'),_0x22c37a,_0x4a8fe9[_0x7b80('0x15')][_0x7b80('0x17')]);return _0x1d766f(_0x4a8fe9[_0x7b80('0x15')][_0x7b80('0x17')]);}else{logger[_0x7b80('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x22c37a,'request\x20sent');_0x1d766f(_0x4a8fe9[_0x7b80('0x18')][_0x7b80('0x17')]);}})[_0x7b80('0x19')](function(_0x504790){logger[_0x7b80('0x15')](_0x7b80('0x11'),_0x22c37a,_0x504790);_0x5d801b(_0x504790);});});}exports['GetOpenchannelQueue']=function(_0x3e3de2){var _0xf97927=this;return new Promise(function(_0x2abaaf,_0x2dd74f){return db[_0x7b80('0x1a')][_0x7b80('0x1b')]({'raw':_0x3e3de2['options']?_0x3e3de2['options'][_0x7b80('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e3de2[_0x7b80('0x1d')]?_0x3e3de2[_0x7b80('0x1d')][_0x7b80('0x1e')]||null:null,'attributes':_0x3e3de2[_0x7b80('0x1d')]?_0x3e3de2[_0x7b80('0x1d')]['attributes']||null:null,'limit':_0x3e3de2[_0x7b80('0x1d')]?_0x3e3de2[_0x7b80('0x1d')]['limit']||null:null,'include':_0x3e3de2[_0x7b80('0x1d')]?_0x3e3de2['options']['include']?_[_0x7b80('0x1f')](_0x3e3de2['options'][_0x7b80('0x20')],function(_0x2d6fad){return{'model':db[_0x2d6fad[_0x7b80('0x21')]],'as':_0x2d6fad['as'],'attributes':_0x2d6fad[_0x7b80('0x22')],'include':_0x2d6fad[_0x7b80('0x20')]?_[_0x7b80('0x1f')](_0x2d6fad['include'],function(_0x362768){return{'model':db[_0x362768[_0x7b80('0x21')]],'as':_0x362768['as'],'attributes':_0x362768[_0x7b80('0x22')],'include':_0x362768[_0x7b80('0x20')]?_[_0x7b80('0x1f')](_0x362768[_0x7b80('0x20')],function(_0x27728c){return{'model':db[_0x27728c[_0x7b80('0x21')]],'as':_0x27728c['as'],'attributes':_0x27728c[_0x7b80('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7b80('0xf')](function(_0x14fae3){logger['info'](_0x7b80('0x23'),_0x3e3de2);logger[_0x7b80('0x12')](_0x7b80('0x23'),_0x3e3de2,JSON[_0x7b80('0x14')](_0x14fae3));_0x2abaaf(_0x14fae3);})[_0x7b80('0x19')](function(_0x5cdd09){logger[_0x7b80('0x15')](_0x7b80('0x23'),_0x5cdd09[_0x7b80('0x17')],_0x3e3de2);_0x2dd74f(_0xf97927['error'](0x1f4,_0x5cdd09[_0x7b80('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0xbeb73a){var _0x50b7ab=this;return new Promise(function(_0x268035,_0x10408e){return db[_0x7b80('0x1a')][_0x7b80('0x24')]({'raw':_0xbeb73a[_0x7b80('0x1d')]?_0xbeb73a['options'][_0x7b80('0x1c')]===undefined?!![]:![]:!![],'where':_0xbeb73a[_0x7b80('0x1d')]?_0xbeb73a['options'][_0x7b80('0x1e')]||null:null,'attributes':_0xbeb73a[_0x7b80('0x1d')]?_0xbeb73a[_0x7b80('0x1d')]['attributes']||null:null,'include':_0xbeb73a[_0x7b80('0x1d')]?_0xbeb73a['options']['include']?_[_0x7b80('0x1f')](_0xbeb73a[_0x7b80('0x1d')]['include'],function(_0x2a7b5e){return{'model':db[_0x2a7b5e['model']],'as':_0x2a7b5e['as'],'attributes':_0x2a7b5e['attributes'],'include':_0x2a7b5e[_0x7b80('0x20')]?_[_0x7b80('0x1f')](_0x2a7b5e[_0x7b80('0x20')],function(_0x1b6572){return{'model':db[_0x1b6572[_0x7b80('0x21')]],'as':_0x1b6572['as'],'attributes':_0x1b6572['attributes'],'include':_0x1b6572[_0x7b80('0x20')]?_[_0x7b80('0x1f')](_0x1b6572[_0x7b80('0x20')],function(_0x33f78){return{'model':db[_0x33f78[_0x7b80('0x21')]],'as':_0x33f78['as'],'attributes':_0x33f78[_0x7b80('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7b80('0xf')](function(_0x2f8350){logger['info'](_0x7b80('0x25'),_0xbeb73a);logger[_0x7b80('0x12')](_0x7b80('0x25'),_0xbeb73a,JSON[_0x7b80('0x14')](_0x2f8350));_0x268035(_0x2f8350);})[_0x7b80('0x19')](function(_0x145f79){logger[_0x7b80('0x15')](_0x7b80('0x25'),_0x145f79['message'],_0xbeb73a);_0x10408e(_0x50b7ab['error'](0x1f4,_0x145f79[_0x7b80('0x17')]));});});}; \ No newline at end of file +var _0x7747=['request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','findAll','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','OpenchannelQueue','find','ShowOpenchannelQueue','stringify','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','info','OpenchannelQueue,\x20%s,\x20%s'];(function(_0x98cae9,_0x420089){var _0x56e97b=function(_0x296d7a){while(--_0x296d7a){_0x98cae9['push'](_0x98cae9['shift']());}};_0x56e97b(++_0x420089);}(_0x7747,0x1e4));var _0x7774=function(_0x5cd60f,_0x3a852e){_0x5cd60f=_0x5cd60f-0x0;var _0x51dc86=_0x7747[_0x5cd60f];return _0x51dc86;};'use strict';var _=require(_0x7774('0x0'));var util=require(_0x7774('0x1'));var moment=require(_0x7774('0x2'));var BPromise=require(_0x7774('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7774('0x4'))['db'];var utils=require(_0x7774('0x5'));var logger=require(_0x7774('0x6'))(_0x7774('0x7'));var config=require(_0x7774('0x8'));var jayson=require(_0x7774('0x9'));var client=jayson[_0x7774('0xa')][_0x7774('0xb')]({'port':0x232a});config['redis']=_[_0x7774('0xc')](config[_0x7774('0xd')],{'host':_0x7774('0xe'),'port':0x18eb});var socket=require(_0x7774('0xf'))(new Redis(config[_0x7774('0xd')]));require(_0x7774('0x10'))['register'](socket);function respondWithRpcPromise(_0x231d2a,_0x50166c,_0x5d1090){return new BPromise(function(_0x1c57ac,_0x15e4c5){return client[_0x7774('0x11')](_0x231d2a,_0x5d1090)['then'](function(_0x549ba7){logger[_0x7774('0x12')](_0x7774('0x13'),_0x50166c,_0x7774('0x14'));logger[_0x7774('0x15')](_0x7774('0x16'),_0x50166c,'request\x20sent',JSON['stringify'](_0x549ba7));if(_0x549ba7['error']){if(_0x549ba7['error'][_0x7774('0x17')]===0x1f4){logger[_0x7774('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x50166c,_0x549ba7['error'][_0x7774('0x19')]);return _0x15e4c5(_0x549ba7[_0x7774('0x18')][_0x7774('0x19')]);}logger['error'](_0x7774('0x13'),_0x50166c,_0x549ba7[_0x7774('0x18')][_0x7774('0x19')]);return _0x1c57ac(_0x549ba7['error'][_0x7774('0x19')]);}else{logger[_0x7774('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x50166c,_0x7774('0x14'));_0x1c57ac(_0x549ba7[_0x7774('0x1a')][_0x7774('0x19')]);}})['catch'](function(_0x3e7e65){logger[_0x7774('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x50166c,_0x3e7e65);_0x15e4c5(_0x3e7e65);});});}exports['GetOpenchannelQueue']=function(_0x1515f8){var _0x3cee2a=this;return new Promise(function(_0x5c200e,_0x41c6ea){return db['OpenchannelQueue'][_0x7774('0x1b')]({'raw':_0x1515f8['options']?_0x1515f8[_0x7774('0x1c')][_0x7774('0x1d')]===undefined?!![]:![]:!![],'where':_0x1515f8[_0x7774('0x1c')]?_0x1515f8[_0x7774('0x1c')][_0x7774('0x1e')]||null:null,'attributes':_0x1515f8[_0x7774('0x1c')]?_0x1515f8[_0x7774('0x1c')][_0x7774('0x1f')]||null:null,'limit':_0x1515f8['options']?_0x1515f8[_0x7774('0x1c')][_0x7774('0x20')]||null:null,'include':_0x1515f8[_0x7774('0x1c')]?_0x1515f8[_0x7774('0x1c')]['include']?_['map'](_0x1515f8[_0x7774('0x1c')][_0x7774('0x21')],function(_0x4dd7f5){return{'model':db[_0x4dd7f5['model']],'as':_0x4dd7f5['as'],'attributes':_0x4dd7f5[_0x7774('0x1f')],'include':_0x4dd7f5['include']?_[_0x7774('0x22')](_0x4dd7f5[_0x7774('0x21')],function(_0x21885e){return{'model':db[_0x21885e[_0x7774('0x23')]],'as':_0x21885e['as'],'attributes':_0x21885e[_0x7774('0x1f')],'include':_0x21885e['include']?_[_0x7774('0x22')](_0x21885e[_0x7774('0x21')],function(_0x2ab05f){return{'model':db[_0x2ab05f[_0x7774('0x23')]],'as':_0x2ab05f['as'],'attributes':_0x2ab05f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x445b5e){logger[_0x7774('0x12')](_0x7774('0x24'),_0x1515f8);logger[_0x7774('0x15')](_0x7774('0x24'),_0x1515f8,JSON['stringify'](_0x445b5e));_0x5c200e(_0x445b5e);})['catch'](function(_0x136424){logger[_0x7774('0x18')](_0x7774('0x24'),_0x136424[_0x7774('0x19')],_0x1515f8);_0x41c6ea(_0x3cee2a[_0x7774('0x18')](0x1f4,_0x136424[_0x7774('0x19')]));});});};exports['ShowOpenchannelQueue']=function(_0x624be1){var _0x2635a0=this;return new Promise(function(_0x55eb95,_0x193f06){return db[_0x7774('0x25')][_0x7774('0x26')]({'raw':_0x624be1[_0x7774('0x1c')]?_0x624be1[_0x7774('0x1c')][_0x7774('0x1d')]===undefined?!![]:![]:!![],'where':_0x624be1[_0x7774('0x1c')]?_0x624be1[_0x7774('0x1c')][_0x7774('0x1e')]||null:null,'attributes':_0x624be1[_0x7774('0x1c')]?_0x624be1[_0x7774('0x1c')]['attributes']||null:null,'include':_0x624be1[_0x7774('0x1c')]?_0x624be1[_0x7774('0x1c')][_0x7774('0x21')]?_[_0x7774('0x22')](_0x624be1['options'][_0x7774('0x21')],function(_0x5a0eab){return{'model':db[_0x5a0eab[_0x7774('0x23')]],'as':_0x5a0eab['as'],'attributes':_0x5a0eab[_0x7774('0x1f')],'include':_0x5a0eab[_0x7774('0x21')]?_[_0x7774('0x22')](_0x5a0eab[_0x7774('0x21')],function(_0xb8d596){return{'model':db[_0xb8d596['model']],'as':_0xb8d596['as'],'attributes':_0xb8d596[_0x7774('0x1f')],'include':_0xb8d596[_0x7774('0x21')]?_[_0x7774('0x22')](_0xb8d596[_0x7774('0x21')],function(_0x5058e0){return{'model':db[_0x5058e0[_0x7774('0x23')]],'as':_0x5058e0['as'],'attributes':_0x5058e0[_0x7774('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x189881){logger[_0x7774('0x12')]('ShowOpenchannelQueue',_0x624be1);logger[_0x7774('0x15')](_0x7774('0x27'),_0x624be1,JSON[_0x7774('0x28')](_0x189881));_0x55eb95(_0x189881);})[_0x7774('0x29')](function(_0x327d08){logger[_0x7774('0x18')](_0x7774('0x27'),_0x327d08['message'],_0x624be1);_0x193f06(_0x2635a0[_0x7774('0x18')](0x1f4,_0x327d08[_0x7774('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 4e22f70..452e823 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 _0xf969=['register','length','openchannelQueue:','./openchannelQueue.events','remove','update','emit'];(function(_0x3b612a,_0x583807){var _0x3b284c=function(_0x3ea97f){while(--_0x3ea97f){_0x3b612a['push'](_0x3b612a['shift']());}};_0x3b284c(++_0x583807);}(_0xf969,0x1c3));var _0x9f96=function(_0x1025ee,_0x1d1996){_0x1025ee=_0x1025ee-0x0;var _0x2a47fb=_0xf969[_0x1025ee];return _0x2a47fb;};'use strict';var OpenchannelQueueEvents=require(_0x9f96('0x0'));var events=['save',_0x9f96('0x1'),_0x9f96('0x2')];function createListener(_0x523f57,_0x321bb9){return function(_0x489084){_0x321bb9[_0x9f96('0x3')](_0x523f57,_0x489084);};}function removeListener(_0x1755f2,_0x36b484){return function(){OpenchannelQueueEvents['removeListener'](_0x1755f2,_0x36b484);};}exports[_0x9f96('0x4')]=function(_0x57b30d){for(var _0x44ac46=0x0,_0x1c62ff=events[_0x9f96('0x5')];_0x44ac46<_0x1c62ff;_0x44ac46++){var _0x1e459d=events[_0x44ac46];var _0x191b87=createListener(_0x9f96('0x6')+_0x1e459d,_0x57b30d);OpenchannelQueueEvents['on'](_0x1e459d,_0x191b87);}}; \ No newline at end of file +var _0x9e5e=['save','removeListener','register','openchannelQueue:','./openchannelQueue.events'];(function(_0x3c2261,_0xa752ce){var _0x45fd72=function(_0x2301c){while(--_0x2301c){_0x3c2261['push'](_0x3c2261['shift']());}};_0x45fd72(++_0xa752ce);}(_0x9e5e,0x9f));var _0xe9e5=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x9e5e[_0x29d94e];return _0x106237;};'use strict';var OpenchannelQueueEvents=require(_0xe9e5('0x0'));var events=[_0xe9e5('0x1'),'remove','update'];function createListener(_0x221a7f,_0x1525c6){return function(_0x43c299){_0x1525c6['emit'](_0x221a7f,_0x43c299);};}function removeListener(_0x4521b9,_0x3e246c){return function(){OpenchannelQueueEvents[_0xe9e5('0x2')](_0x4521b9,_0x3e246c);};}exports[_0xe9e5('0x3')]=function(_0x5d9983){for(var _0x30a127=0x0,_0x3b0164=events['length'];_0x30a127<_0x3b0164;_0x30a127++){var _0x2a3b21=events[_0x30a127];var _0x2a1b54=createListener(_0xe9e5('0x4')+_0x2a3b21,_0x5d9983);OpenchannelQueueEvents['on'](_0x2a3b21,_0x2a1b54);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 2040b22..cf30fef 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 _0x4bc4=['../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x4bc4,0xbf));var _0x44bc=function(_0x34de1a,_0x5c626f){_0x34de1a=_0x34de1a-0x0;var _0x30df2e=_0x4bc4[_0x34de1a];return _0x30df2e;};'use strict';var multer=require(_0x44bc('0x0'));var util=require(_0x44bc('0x1'));var path=require(_0x44bc('0x2'));var timeout=require(_0x44bc('0x3'));var express=require('express');var router=express[_0x44bc('0x4')]();var fs_extra=require(_0x44bc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x44bc('0x6'));var config=require(_0x44bc('0x7'));var controller=require(_0x44bc('0x8'));router['get']('/',auth[_0x44bc('0x9')](),controller[_0x44bc('0xa')]);router['get'](_0x44bc('0xb'),auth[_0x44bc('0x9')](),controller[_0x44bc('0xc')]);router[_0x44bc('0xd')](_0x44bc('0xe'),auth[_0x44bc('0x9')](),controller[_0x44bc('0xf')]);router[_0x44bc('0x10')]('/',auth[_0x44bc('0x9')](),controller[_0x44bc('0x11')]);router[_0x44bc('0x12')]('/:id',auth[_0x44bc('0x9')](),controller[_0x44bc('0x13')]);router['delete'](_0x44bc('0xe'),auth[_0x44bc('0x9')](),controller[_0x44bc('0x14')]);module[_0x44bc('0x15')]=router; \ No newline at end of file +var _0xf7fa=['/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','index'];(function(_0x11a4ef,_0x5790ce){var _0x311fcb=function(_0x4629d1){while(--_0x4629d1){_0x11a4ef['push'](_0x11a4ef['shift']());}};_0x311fcb(++_0x5790ce);}(_0xf7fa,0x1ee));var _0xaf7f=function(_0x4c86b2,_0x19c2c6){_0x4c86b2=_0x4c86b2-0x0;var _0xc71974=_0xf7fa[_0x4c86b2];return _0xc71974;};'use strict';var multer=require(_0xaf7f('0x0'));var util=require(_0xaf7f('0x1'));var path=require(_0xaf7f('0x2'));var timeout=require(_0xaf7f('0x3'));var express=require('express');var router=express[_0xaf7f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaf7f('0x5'));var interaction=require(_0xaf7f('0x6'));var config=require('../../config/environment');var controller=require(_0xaf7f('0x7'));router[_0xaf7f('0x8')]('/',auth['isAuthenticated'](),controller[_0xaf7f('0x9')]);router[_0xaf7f('0x8')](_0xaf7f('0xa'),auth[_0xaf7f('0xb')](),controller[_0xaf7f('0xc')]);router[_0xaf7f('0x8')](_0xaf7f('0xd'),auth[_0xaf7f('0xb')](),controller[_0xaf7f('0xe')]);router[_0xaf7f('0xf')]('/',auth['isAuthenticated'](),controller[_0xaf7f('0x10')]);router[_0xaf7f('0x11')](_0xaf7f('0xd'),auth[_0xaf7f('0xb')](),controller['update']);router[_0xaf7f('0x12')]('/:id',auth[_0xaf7f('0xb')](),controller[_0xaf7f('0x13')]);module[_0xaf7f('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 2e07327..3723870 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 _0x5ea9=['DATE','exports','STRING'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x5ea9,0xaf));var _0x95ea=function(_0x5bc95c,_0xfed759){_0x5bc95c=_0x5bc95c-0x0;var _0x3721fc=_0x5ea9[_0x5bc95c];return _0x3721fc;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x95ea('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x95ea('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x95ea('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x95ea('0x1')]}}; \ No newline at end of file +var _0x369e=['moment','sequelize','STRING','DATE'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x369e,0x174));var _0xe369=function(_0x8d6c19,_0x513845){_0x8d6c19=_0x8d6c19-0x0;var _0x10ad87=_0x369e[_0x8d6c19];return _0x10ad87;};'use strict';var moment=require(_0xe369('0x0'));var Sequelize=require(_0xe369('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe369('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe369('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xe369('0x3')]},'exitAt':{'type':Sequelize[_0xe369('0x3')]},'reason':{'type':Sequelize[_0xe369('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 791cde5..1f4b445 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 _0xba9f=['apply','reject','save','update','destroy','then','end','stack','name','send','map','OpenchannelQueueReport','rawAttributes','fieldName','query','keys','filters','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','intersection','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x49f30b,_0x2e9165){var _0x898fdf=function(_0x609495){while(--_0x609495){_0x49f30b['push'](_0x49f30b['shift']());}};_0x898fdf(++_0x2e9165);}(_0xba9f,0x74));var _0xfba9=function(_0xf845d7,_0x5b3246){_0xf845d7=_0xf845d7-0x0;var _0x4a71f8=_0xba9f[_0xf845d7];return _0x4a71f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfba9('0x0'));var zipdir=require(_0xfba9('0x1'));var jsonpatch=require(_0xfba9('0x2'));var rp=require(_0xfba9('0x3'));var moment=require('moment');var BPromise=require(_0xfba9('0x4'));var Mustache=require(_0xfba9('0x5'));var util=require(_0xfba9('0x6'));var path=require(_0xfba9('0x7'));var sox=require(_0xfba9('0x8'));var csv=require(_0xfba9('0x9'));var ejs=require(_0xfba9('0xa'));var fs=require('fs');var fs_extra=require(_0xfba9('0xb'));var _=require(_0xfba9('0xc'));var squel=require(_0xfba9('0xd'));var crypto=require(_0xfba9('0xe'));var jsforce=require(_0xfba9('0xf'));var deskjs=require(_0xfba9('0x10'));var toCsv=require(_0xfba9('0x9'));var querystring=require('querystring');var Papa=require(_0xfba9('0x11'));var Redis=require('ioredis');var authService=require(_0xfba9('0x12'));var qs=require(_0xfba9('0x13'));var as=require(_0xfba9('0x14'));var hardwareService=require(_0xfba9('0x15'));var logger=require(_0xfba9('0x16'))('api');var utils=require(_0xfba9('0x17'));var config=require(_0xfba9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xfba9('0x19'))['db'];function respondWithStatusCode(_0x47a84c,_0x3fb36f){_0x3fb36f=_0x3fb36f||0xcc;return function(_0x563daf){if(_0x563daf){return _0x47a84c[_0xfba9('0x1a')](_0x3fb36f);}return _0x47a84c[_0xfba9('0x1b')](_0x3fb36f)['end']();};}function respondWithResult(_0x33a7fb,_0x690ee7){_0x690ee7=_0x690ee7||0xc8;return function(_0x367cda){if(_0x367cda){return _0x33a7fb['status'](_0x690ee7)[_0xfba9('0x1c')](_0x367cda);}};}function respondWithFilteredResult(_0x4d63c8,_0x2b4143){return function(_0x372e15){if(_0x372e15){var _0xdd2b0f=typeof _0x2b4143[_0xfba9('0x1d')]===_0xfba9('0x1e')&&typeof _0x2b4143[_0xfba9('0x1f')]===_0xfba9('0x1e');var _0x41591f=_0x372e15[_0xfba9('0x20')];var _0x5b86b4=_0xdd2b0f?0x0:_0x2b4143['offset'];var _0x355efa=_0xdd2b0f?_0x372e15[_0xfba9('0x20')]:_0x2b4143['offset']+_0x2b4143['limit'];var _0x318da5;if(_0x355efa>=_0x41591f){_0x355efa=_0x41591f;_0x318da5=0xc8;}else{_0x318da5=0xce;}_0x4d63c8[_0xfba9('0x1b')](_0x318da5);return _0x4d63c8[_0xfba9('0x21')]('Content-Range',_0x5b86b4+'-'+_0x355efa+'/'+_0x41591f)[_0xfba9('0x1c')](_0x372e15);}return null;};}function patchUpdates(_0x227dd5){return function(_0x5b9093){try{jsonpatch[_0xfba9('0x22')](_0x5b9093,_0x227dd5,!![]);}catch(_0x210496){return BPromise[_0xfba9('0x23')](_0x210496);}return _0x5b9093[_0xfba9('0x24')]();};}function saveUpdates(_0x214bfb,_0x648e07){return function(_0x701ff5){if(_0x701ff5){return _0x701ff5[_0xfba9('0x25')](_0x214bfb)['then'](function(_0x10f5b7){return _0x10f5b7;});}return null;};}function removeEntity(_0x30d93a,_0x49fc20){return function(_0x2ebeb7){if(_0x2ebeb7){return _0x2ebeb7[_0xfba9('0x26')]()[_0xfba9('0x27')](function(){_0x30d93a[_0xfba9('0x1b')](0xcc)[_0xfba9('0x28')]();});}};}function handleEntityNotFound(_0x32c037,_0x3e24b4){return function(_0x319512){if(!_0x319512){_0x32c037[_0xfba9('0x1a')](0x194);}return _0x319512;};}function handleError(_0x3d8d12,_0x6a9051){_0x6a9051=_0x6a9051||0x1f4;return function(_0x50aeb7){logger['error'](_0x50aeb7[_0xfba9('0x29')]);if(_0x50aeb7['name']){delete _0x50aeb7[_0xfba9('0x2a')];}_0x3d8d12[_0xfba9('0x1b')](_0x6a9051)[_0xfba9('0x2b')](_0x50aeb7);};}exports['index']=function(_0x277e8a,_0x1bbabf){var _0x2c0f8d={},_0x15cc6f={},_0x5c649e={'count':0x0,'rows':[]};var _0x5d863d=_[_0xfba9('0x2c')](db[_0xfba9('0x2d')][_0xfba9('0x2e')],function(_0x2bb109){return{'name':_0x2bb109[_0xfba9('0x2f')],'type':_0x2bb109['type']['key']};});_0x15cc6f['model']=_[_0xfba9('0x2c')](_0x5d863d,'name');_0x15cc6f[_0xfba9('0x30')]=_[_0xfba9('0x31')](_0x277e8a['query']);_0x15cc6f[_0xfba9('0x32')]=_['intersection'](_0x15cc6f[_0xfba9('0x33')],_0x15cc6f['query']);_0x2c0f8d[_0xfba9('0x34')]=_['intersection'](_0x15cc6f[_0xfba9('0x33')],qs[_0xfba9('0x35')](_0x277e8a[_0xfba9('0x30')][_0xfba9('0x35')]));_0x2c0f8d['attributes']=_0x2c0f8d[_0xfba9('0x34')]['length']?_0x2c0f8d[_0xfba9('0x34')]:_0x15cc6f['model'];if(!_0x277e8a[_0xfba9('0x30')]['hasOwnProperty'](_0xfba9('0x36'))){_0x2c0f8d['limit']=qs[_0xfba9('0x1f')](_0x277e8a[_0xfba9('0x30')][_0xfba9('0x1f')]);_0x2c0f8d[_0xfba9('0x1d')]=qs[_0xfba9('0x1d')](_0x277e8a[_0xfba9('0x30')]['offset']);}_0x2c0f8d[_0xfba9('0x37')]=qs[_0xfba9('0x38')](_0x277e8a['query']['sort']);_0x2c0f8d[_0xfba9('0x39')]=qs['filters'](_[_0xfba9('0x3a')](_0x277e8a['query'],_0x15cc6f[_0xfba9('0x32')]),_0x5d863d);if(_0x277e8a[_0xfba9('0x30')][_0xfba9('0x3b')]){_0x2c0f8d[_0xfba9('0x39')]=_[_0xfba9('0x3c')](_0x2c0f8d[_0xfba9('0x39')],{'$or':_[_0xfba9('0x2c')](_0x5d863d,function(_0x4f8421){if(_0x4f8421[_0xfba9('0x3d')]!==_0xfba9('0x3e')){var _0x5e6bc5={};_0x5e6bc5[_0x4f8421[_0xfba9('0x2a')]]={'$like':'%'+_0x277e8a[_0xfba9('0x30')]['filter']+'%'};return _0x5e6bc5;}})});}_0x2c0f8d=_[_0xfba9('0x3c')]({},_0x2c0f8d,_0x277e8a[_0xfba9('0x3f')]);var _0x30812d={'where':_0x2c0f8d['where']};return db[_0xfba9('0x2d')]['count'](_0x30812d)['then'](function(_0x5167ef){_0x5c649e['count']=_0x5167ef;if(_0x277e8a[_0xfba9('0x30')][_0xfba9('0x40')]){_0x2c0f8d[_0xfba9('0x41')]=[{'all':!![]}];}return db[_0xfba9('0x2d')][_0xfba9('0x42')](_0x2c0f8d);})[_0xfba9('0x27')](function(_0x130891){_0x5c649e['rows']=_0x130891;return _0x5c649e;})[_0xfba9('0x27')](respondWithFilteredResult(_0x1bbabf,_0x2c0f8d))['catch'](handleError(_0x1bbabf,null));};exports[_0xfba9('0x43')]=function(_0x4cb310,_0x4b5175){var _0x23ae19={'raw':!![],'where':{'id':_0x4cb310[_0xfba9('0x44')]['id']}},_0x2e79dd={};_0x2e79dd[_0xfba9('0x33')]=_[_0xfba9('0x31')](db[_0xfba9('0x2d')][_0xfba9('0x2e')]);_0x2e79dd[_0xfba9('0x30')]=_[_0xfba9('0x31')](_0x4cb310[_0xfba9('0x30')]);_0x2e79dd[_0xfba9('0x32')]=_[_0xfba9('0x45')](_0x2e79dd[_0xfba9('0x33')],_0x2e79dd[_0xfba9('0x30')]);_0x23ae19['attributes']=_[_0xfba9('0x45')](_0x2e79dd[_0xfba9('0x33')],qs[_0xfba9('0x35')](_0x4cb310[_0xfba9('0x30')]['fields']));_0x23ae19[_0xfba9('0x34')]=_0x23ae19[_0xfba9('0x34')]['length']?_0x23ae19[_0xfba9('0x34')]:_0x2e79dd[_0xfba9('0x33')];if(_0x4cb310[_0xfba9('0x30')][_0xfba9('0x40')]){_0x23ae19[_0xfba9('0x41')]=[{'all':!![]}];}_0x23ae19=_['merge']({},_0x23ae19,_0x4cb310[_0xfba9('0x3f')]);return db[_0xfba9('0x2d')][_0xfba9('0x46')](_0x23ae19)[_0xfba9('0x27')](handleEntityNotFound(_0x4b5175,null))[_0xfba9('0x27')](respondWithResult(_0x4b5175,null))[_0xfba9('0x47')](handleError(_0x4b5175,null));};exports[_0xfba9('0x48')]=function(_0x5d106e,_0x497325){return db['OpenchannelQueueReport']['create'](_0x5d106e[_0xfba9('0x49')],{})['then'](respondWithResult(_0x497325,0xc9))[_0xfba9('0x47')](handleError(_0x497325,null));};exports[_0xfba9('0x25')]=function(_0x155e99,_0xdf1094){if(_0x155e99[_0xfba9('0x49')]['id']){delete _0x155e99[_0xfba9('0x49')]['id'];}return db[_0xfba9('0x2d')][_0xfba9('0x46')]({'where':{'id':_0x155e99[_0xfba9('0x44')]['id']}})[_0xfba9('0x27')](handleEntityNotFound(_0xdf1094,null))['then'](saveUpdates(_0x155e99[_0xfba9('0x49')],null))[_0xfba9('0x27')](respondWithResult(_0xdf1094,null))[_0xfba9('0x47')](handleError(_0xdf1094,null));};exports['destroy']=function(_0x5d0fdb,_0x460edb){return db[_0xfba9('0x2d')][_0xfba9('0x46')]({'where':{'id':_0x5d0fdb[_0xfba9('0x44')]['id']}})[_0xfba9('0x27')](handleEntityNotFound(_0x460edb,null))[_0xfba9('0x27')](removeEntity(_0x460edb,null))[_0xfba9('0x47')](handleError(_0x460edb,null));};exports[_0xfba9('0x4a')]=function(_0x4e8fc4,_0x15dd0e){return db['OpenchannelQueueReport'][_0xfba9('0x4a')]()['then'](respondWithResult(_0x15dd0e,null))[_0xfba9('0x47')](handleError(_0x15dd0e,null));}; \ No newline at end of file +var _0x35a2=['fast-json-patch','request-promise','bluebird','sox','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','status','end','sendStatus','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf'];(function(_0x42124d,_0x12ac9e){var _0x5a7b6d=function(_0x53cbbd){while(--_0x53cbbd){_0x42124d['push'](_0x42124d['shift']());}};_0x5a7b6d(++_0x12ac9e);}(_0x35a2,0x10a));var _0x235a=function(_0xf504e3,_0x51c8b4){_0xf504e3=_0xf504e3-0x0;var _0x49943d=_0x35a2[_0xf504e3];return _0x49943d;};'use strict';var emlformat=require(_0x235a('0x0'));var rimraf=require(_0x235a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x235a('0x2'));var rp=require(_0x235a('0x3'));var moment=require('moment');var BPromise=require(_0x235a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x235a('0x5'));var csv=require('to-csv');var ejs=require(_0x235a('0x6'));var fs=require('fs');var fs_extra=require(_0x235a('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x235a('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x235a('0x9'));var querystring=require(_0x235a('0xa'));var Papa=require(_0x235a('0xb'));var Redis=require(_0x235a('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x235a('0xd'));var logger=require(_0x235a('0xe'))('api');var utils=require('../../config/utils');var config=require(_0x235a('0xf'));var licenseUtil=require('../../config/license/util');var db=require(_0x235a('0x10'))['db'];function respondWithStatusCode(_0x1e860f,_0x238737){_0x238737=_0x238737||0xcc;return function(_0x5c4b74){if(_0x5c4b74){return _0x1e860f['sendStatus'](_0x238737);}return _0x1e860f['status'](_0x238737)['end']();};}function respondWithResult(_0x511650,_0x46a85c){_0x46a85c=_0x46a85c||0xc8;return function(_0x2c71c3){if(_0x2c71c3){return _0x511650['status'](_0x46a85c)[_0x235a('0x11')](_0x2c71c3);}};}function respondWithFilteredResult(_0x25ab15,_0x5f2c0f){return function(_0x3b7cf1){if(_0x3b7cf1){var _0x449e30=typeof _0x5f2c0f[_0x235a('0x12')]===_0x235a('0x13')&&typeof _0x5f2c0f[_0x235a('0x14')]===_0x235a('0x13');var _0x4caa4c=_0x3b7cf1[_0x235a('0x15')];var _0x47b2ad=_0x449e30?0x0:_0x5f2c0f[_0x235a('0x12')];var _0x2cd36b=_0x449e30?_0x3b7cf1[_0x235a('0x15')]:_0x5f2c0f[_0x235a('0x12')]+_0x5f2c0f[_0x235a('0x14')];var _0x23bc3d;if(_0x2cd36b>=_0x4caa4c){_0x2cd36b=_0x4caa4c;_0x23bc3d=0xc8;}else{_0x23bc3d=0xce;}_0x25ab15['status'](_0x23bc3d);return _0x25ab15['set'](_0x235a('0x16'),_0x47b2ad+'-'+_0x2cd36b+'/'+_0x4caa4c)[_0x235a('0x11')](_0x3b7cf1);}return null;};}function patchUpdates(_0x71cb80){return function(_0x3e02d3){try{jsonpatch[_0x235a('0x17')](_0x3e02d3,_0x71cb80,!![]);}catch(_0x3dced0){return BPromise[_0x235a('0x18')](_0x3dced0);}return _0x3e02d3['save']();};}function saveUpdates(_0x238feb,_0x474bbe){return function(_0x269bd5){if(_0x269bd5){return _0x269bd5[_0x235a('0x19')](_0x238feb)[_0x235a('0x1a')](function(_0x3e3a44){return _0x3e3a44;});}return null;};}function removeEntity(_0x2a94a9,_0x5c88e4){return function(_0x44214e){if(_0x44214e){return _0x44214e[_0x235a('0x1b')]()[_0x235a('0x1a')](function(){_0x2a94a9[_0x235a('0x1c')](0xcc)[_0x235a('0x1d')]();});}};}function handleEntityNotFound(_0x23e2b0,_0x540ce7){return function(_0x33c490){if(!_0x33c490){_0x23e2b0[_0x235a('0x1e')](0x194);}return _0x33c490;};}function handleError(_0x4f1a93,_0x1d8cd1){_0x1d8cd1=_0x1d8cd1||0x1f4;return function(_0x552cd3){logger['error'](_0x552cd3[_0x235a('0x1f')]);if(_0x552cd3['name']){delete _0x552cd3[_0x235a('0x20')];}_0x4f1a93['status'](_0x1d8cd1)[_0x235a('0x21')](_0x552cd3);};}exports[_0x235a('0x22')]=function(_0x120427,_0x5796b0){var _0x13c7b0={},_0x59e95c={},_0x394311={'count':0x0,'rows':[]};var _0x27b88a=_[_0x235a('0x23')](db[_0x235a('0x24')][_0x235a('0x25')],function(_0x2d644e){return{'name':_0x2d644e['fieldName'],'type':_0x2d644e[_0x235a('0x26')]['key']};});_0x59e95c[_0x235a('0x27')]=_['map'](_0x27b88a,_0x235a('0x20'));_0x59e95c[_0x235a('0x28')]=_[_0x235a('0x29')](_0x120427[_0x235a('0x28')]);_0x59e95c[_0x235a('0x2a')]=_['intersection'](_0x59e95c[_0x235a('0x27')],_0x59e95c[_0x235a('0x28')]);_0x13c7b0[_0x235a('0x2b')]=_[_0x235a('0x2c')](_0x59e95c['model'],qs[_0x235a('0x2d')](_0x120427['query'][_0x235a('0x2d')]));_0x13c7b0[_0x235a('0x2b')]=_0x13c7b0[_0x235a('0x2b')][_0x235a('0x2e')]?_0x13c7b0['attributes']:_0x59e95c['model'];if(!_0x120427['query'][_0x235a('0x2f')](_0x235a('0x30'))){_0x13c7b0[_0x235a('0x14')]=qs[_0x235a('0x14')](_0x120427[_0x235a('0x28')]['limit']);_0x13c7b0[_0x235a('0x12')]=qs[_0x235a('0x12')](_0x120427[_0x235a('0x28')]['offset']);}_0x13c7b0['order']=qs[_0x235a('0x31')](_0x120427[_0x235a('0x28')][_0x235a('0x31')]);_0x13c7b0[_0x235a('0x32')]=qs[_0x235a('0x2a')](_[_0x235a('0x33')](_0x120427['query'],_0x59e95c[_0x235a('0x2a')]),_0x27b88a);if(_0x120427['query'][_0x235a('0x34')]){_0x13c7b0[_0x235a('0x32')]=_[_0x235a('0x35')](_0x13c7b0[_0x235a('0x32')],{'$or':_[_0x235a('0x23')](_0x27b88a,function(_0x50bd64){if(_0x50bd64[_0x235a('0x26')]!==_0x235a('0x36')){var _0x5a3ed3={};_0x5a3ed3[_0x50bd64[_0x235a('0x20')]]={'$like':'%'+_0x120427[_0x235a('0x28')][_0x235a('0x34')]+'%'};return _0x5a3ed3;}})});}_0x13c7b0=_[_0x235a('0x35')]({},_0x13c7b0,_0x120427[_0x235a('0x37')]);var _0x37b2e7={'where':_0x13c7b0[_0x235a('0x32')]};return db[_0x235a('0x24')][_0x235a('0x15')](_0x37b2e7)[_0x235a('0x1a')](function(_0xf01d01){_0x394311['count']=_0xf01d01;if(_0x120427[_0x235a('0x28')][_0x235a('0x38')]){_0x13c7b0[_0x235a('0x39')]=[{'all':!![]}];}return db[_0x235a('0x24')][_0x235a('0x3a')](_0x13c7b0);})[_0x235a('0x1a')](function(_0x2c5da7){_0x394311[_0x235a('0x3b')]=_0x2c5da7;return _0x394311;})[_0x235a('0x1a')](respondWithFilteredResult(_0x5796b0,_0x13c7b0))[_0x235a('0x3c')](handleError(_0x5796b0,null));};exports[_0x235a('0x3d')]=function(_0x1715a3,_0x2b5e0d){var _0x1b4375={'raw':!![],'where':{'id':_0x1715a3[_0x235a('0x3e')]['id']}},_0x10811d={};_0x10811d[_0x235a('0x27')]=_[_0x235a('0x29')](db['OpenchannelQueueReport'][_0x235a('0x25')]);_0x10811d['query']=_[_0x235a('0x29')](_0x1715a3['query']);_0x10811d[_0x235a('0x2a')]=_['intersection'](_0x10811d[_0x235a('0x27')],_0x10811d[_0x235a('0x28')]);_0x1b4375[_0x235a('0x2b')]=_[_0x235a('0x2c')](_0x10811d[_0x235a('0x27')],qs[_0x235a('0x2d')](_0x1715a3[_0x235a('0x28')][_0x235a('0x2d')]));_0x1b4375['attributes']=_0x1b4375[_0x235a('0x2b')][_0x235a('0x2e')]?_0x1b4375[_0x235a('0x2b')]:_0x10811d[_0x235a('0x27')];if(_0x1715a3[_0x235a('0x28')][_0x235a('0x38')]){_0x1b4375[_0x235a('0x39')]=[{'all':!![]}];}_0x1b4375=_[_0x235a('0x35')]({},_0x1b4375,_0x1715a3[_0x235a('0x37')]);return db[_0x235a('0x24')][_0x235a('0x3f')](_0x1b4375)[_0x235a('0x1a')](handleEntityNotFound(_0x2b5e0d,null))[_0x235a('0x1a')](respondWithResult(_0x2b5e0d,null))[_0x235a('0x3c')](handleError(_0x2b5e0d,null));};exports['create']=function(_0x209c35,_0x12247c){return db[_0x235a('0x24')][_0x235a('0x40')](_0x209c35[_0x235a('0x41')],{})[_0x235a('0x1a')](respondWithResult(_0x12247c,0xc9))[_0x235a('0x3c')](handleError(_0x12247c,null));};exports['update']=function(_0x3a4c52,_0xb16446){if(_0x3a4c52[_0x235a('0x41')]['id']){delete _0x3a4c52[_0x235a('0x41')]['id'];}return db['OpenchannelQueueReport'][_0x235a('0x3f')]({'where':{'id':_0x3a4c52[_0x235a('0x3e')]['id']}})['then'](handleEntityNotFound(_0xb16446,null))[_0x235a('0x1a')](saveUpdates(_0x3a4c52[_0x235a('0x41')],null))[_0x235a('0x1a')](respondWithResult(_0xb16446,null))[_0x235a('0x3c')](handleError(_0xb16446,null));};exports['destroy']=function(_0x14cc67,_0x44f344){return db[_0x235a('0x24')]['find']({'where':{'id':_0x14cc67[_0x235a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x44f344,null))[_0x235a('0x1a')](removeEntity(_0x44f344,null))['catch'](handleError(_0x44f344,null));};exports[_0x235a('0x42')]=function(_0x5d7d4f,_0x20064c){return db[_0x235a('0x24')][_0x235a('0x42')]()[_0x235a('0x1a')](respondWithResult(_0x20064c,null))[_0x235a('0x3c')](handleError(_0x20064c,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index b77bfd3..e1fa6c7 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 _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x1e82d7,_0x2812bf){var _0x2340b6=function(_0x4e60f8){while(--_0x4e60f8){_0x1e82d7['push'](_0x1e82d7['shift']());}};_0x2340b6(++_0x2812bf);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc4aa[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x13c490,_0x4c898a){var _0x5ab484=function(_0x23c4bf){while(--_0x23c4bf){_0x13c490['push'](_0x13c490['shift']());}};_0x5ab484(++_0x4c898a);}(_0x7a54,0x106));var _0x47a5=function(_0x3b3c20,_0x2d52f9){_0x3b3c20=_0x3b3c20-0x0;var _0x58b7f3=_0x7a54[_0x3b3c20];return _0x58b7f3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index e5e589d..e912db2 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 _0x68a5=['UpdateOpenchannelQueueReport','update','where','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','request\x20sent','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','catch'];(function(_0x2a7a22,_0x574ddb){var _0x3900d8=function(_0x3ea129){while(--_0x3ea129){_0x2a7a22['push'](_0x2a7a22['shift']());}};_0x3900d8(++_0x574ddb);}(_0x68a5,0xfc));var _0x568a=function(_0x52fd5d,_0x4d5ab5){_0x52fd5d=_0x52fd5d-0x0;var _0x582eeb=_0x68a5[_0x52fd5d];return _0x582eeb;};'use strict';var _=require(_0x568a('0x0'));var util=require('util');var moment=require(_0x568a('0x1'));var BPromise=require(_0x568a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x568a('0x3'));var db=require(_0x568a('0x4'))['db'];var utils=require(_0x568a('0x5'));var logger=require(_0x568a('0x6'))('rpc');var config=require(_0x568a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x568a('0x8')][_0x568a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d36ec,_0x3a7a9c,_0x4cda9a){return new BPromise(function(_0x172efd,_0x56deb6){return client[_0x568a('0xa')](_0x2d36ec,_0x4cda9a)[_0x568a('0xb')](function(_0x335ecd){logger[_0x568a('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3a7a9c,'request\x20sent');logger[_0x568a('0xd')](_0x568a('0xe'),_0x3a7a9c,'request\x20sent',JSON[_0x568a('0xf')](_0x335ecd));if(_0x335ecd['error']){if(_0x335ecd[_0x568a('0x10')][_0x568a('0x11')]===0x1f4){logger[_0x568a('0x10')](_0x568a('0x12'),_0x3a7a9c,_0x335ecd[_0x568a('0x10')][_0x568a('0x13')]);return _0x56deb6(_0x335ecd[_0x568a('0x10')][_0x568a('0x13')]);}logger[_0x568a('0x10')](_0x568a('0x12'),_0x3a7a9c,_0x335ecd[_0x568a('0x10')][_0x568a('0x13')]);return _0x172efd(_0x335ecd[_0x568a('0x10')][_0x568a('0x13')]);}else{logger[_0x568a('0xc')](_0x568a('0x12'),_0x3a7a9c,_0x568a('0x14'));_0x172efd(_0x335ecd['result'][_0x568a('0x13')]);}})['catch'](function(_0xa77de8){logger[_0x568a('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3a7a9c,_0xa77de8);_0x56deb6(_0xa77de8);});});}exports[_0x568a('0x15')]=function(_0x561ae1){var _0x40d4a1=this;return new Promise(function(_0x1c8e3a,_0x9b4670){return db[_0x568a('0x16')]['create'](_0x561ae1[_0x568a('0x17')],{'raw':_0x561ae1['options']?_0x561ae1[_0x568a('0x18')][_0x568a('0x19')]===undefined?!![]:![]:!![]})[_0x568a('0xb')](function(_0x3b9968){logger[_0x568a('0xc')](_0x568a('0x15'),_0x561ae1);logger[_0x568a('0xd')](_0x568a('0x15'),_0x561ae1,JSON['stringify'](_0x3b9968));_0x1c8e3a(_0x3b9968);})[_0x568a('0x1a')](function(_0x1f12b5){logger['error'](_0x568a('0x15'),_0x1f12b5[_0x568a('0x13')],_0x561ae1);_0x9b4670(_0x40d4a1[_0x568a('0x10')](0x1f4,_0x1f12b5['message']));});});};exports[_0x568a('0x1b')]=function(_0x378f0e){var _0x1d5329=this;return new Promise(function(_0x1df7ab,_0xdb83a1){return db[_0x568a('0x16')][_0x568a('0x1c')](_0x378f0e[_0x568a('0x17')],{'raw':_0x378f0e[_0x568a('0x18')]?_0x378f0e['options'][_0x568a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378f0e[_0x568a('0x18')]?_0x378f0e[_0x568a('0x18')][_0x568a('0x1d')]||null:null,'attributes':_0x378f0e[_0x568a('0x18')]?_0x378f0e[_0x568a('0x18')]['attributes']||null:null,'limit':_0x378f0e[_0x568a('0x18')]?_0x378f0e[_0x568a('0x18')][_0x568a('0x1e')]||null:null})[_0x568a('0xb')](function(_0x20498b){logger['info'](_0x568a('0x1b'),_0x378f0e);logger[_0x568a('0xd')](_0x568a('0x1b'),_0x378f0e,JSON[_0x568a('0xf')](_0x20498b));_0x1df7ab(_0x20498b);})[_0x568a('0x1a')](function(_0x153e1a){logger[_0x568a('0x10')](_0x568a('0x1b'),_0x153e1a[_0x568a('0x13')],_0x378f0e);_0xdb83a1(_0x1d5329[_0x568a('0x10')](0x1f4,_0x153e1a['message']));});});}; \ No newline at end of file +var _0x531a=['catch','CreateOpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5c7a85,_0x41dd19){var _0x35290f=function(_0x26215b){while(--_0x26215b){_0x5c7a85['push'](_0x5c7a85['shift']());}};_0x35290f(++_0x41dd19);}(_0x531a,0x100));var _0xa531=function(_0x2a9202,_0x5e68cb){_0x2a9202=_0x2a9202-0x0;var _0x316625=_0x531a[_0x2a9202];return _0x316625;};'use strict';var _=require(_0xa531('0x0'));var util=require(_0xa531('0x1'));var moment=require(_0xa531('0x2'));var BPromise=require(_0xa531('0x3'));var rs=require(_0xa531('0x4'));var fs=require('fs');var Redis=require(_0xa531('0x5'));var db=require(_0xa531('0x6'))['db'];var utils=require(_0xa531('0x7'));var logger=require(_0xa531('0x8'))(_0xa531('0x9'));var config=require('../../config/environment');var jayson=require(_0xa531('0xa'));var client=jayson['client'][_0xa531('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4446b9,_0x3fd172,_0x286dc7){return new BPromise(function(_0x3b68a7,_0x5bd2f9){return client[_0xa531('0xc')](_0x4446b9,_0x286dc7)[_0xa531('0xd')](function(_0x4d07e4){logger[_0xa531('0xe')](_0xa531('0xf'),_0x3fd172,_0xa531('0x10'));logger[_0xa531('0x11')](_0xa531('0x12'),_0x3fd172,'request\x20sent',JSON[_0xa531('0x13')](_0x4d07e4));if(_0x4d07e4['error']){if(_0x4d07e4[_0xa531('0x14')][_0xa531('0x15')]===0x1f4){logger[_0xa531('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3fd172,_0x4d07e4[_0xa531('0x14')][_0xa531('0x16')]);return _0x5bd2f9(_0x4d07e4['error'][_0xa531('0x16')]);}logger[_0xa531('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3fd172,_0x4d07e4[_0xa531('0x14')][_0xa531('0x16')]);return _0x3b68a7(_0x4d07e4[_0xa531('0x14')]['message']);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x3fd172,_0xa531('0x10'));_0x3b68a7(_0x4d07e4[_0xa531('0x17')][_0xa531('0x16')]);}})[_0xa531('0x18')](function(_0x324076){logger[_0xa531('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3fd172,_0x324076);_0x5bd2f9(_0x324076);});});}exports[_0xa531('0x19')]=function(_0x5124a1){var _0x412b84=this;return new Promise(function(_0x146013,_0x4fb62e){return db['OpenchannelQueueReport'][_0xa531('0x1a')](_0x5124a1[_0xa531('0x1b')],{'raw':_0x5124a1[_0xa531('0x1c')]?_0x5124a1['options'][_0xa531('0x1d')]===undefined?!![]:![]:!![]})[_0xa531('0xd')](function(_0x4096f0){logger['info'](_0xa531('0x19'),_0x5124a1);logger[_0xa531('0x11')]('CreateOpenchannelQueueReport',_0x5124a1,JSON[_0xa531('0x13')](_0x4096f0));_0x146013(_0x4096f0);})[_0xa531('0x18')](function(_0x3a2016){logger[_0xa531('0x14')](_0xa531('0x19'),_0x3a2016[_0xa531('0x16')],_0x5124a1);_0x4fb62e(_0x412b84[_0xa531('0x14')](0x1f4,_0x3a2016[_0xa531('0x16')]));});});};exports[_0xa531('0x1e')]=function(_0x39f640){var _0x8e9ab3=this;return new Promise(function(_0x3ac4eb,_0x57f1b3){return db[_0xa531('0x1f')][_0xa531('0x20')](_0x39f640[_0xa531('0x1b')],{'raw':_0x39f640['options']?_0x39f640[_0xa531('0x1c')][_0xa531('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39f640['options']?_0x39f640['options'][_0xa531('0x21')]||null:null,'attributes':_0x39f640['options']?_0x39f640[_0xa531('0x1c')][_0xa531('0x22')]||null:null,'limit':_0x39f640['options']?_0x39f640[_0xa531('0x1c')]['limit']||null:null})[_0xa531('0xd')](function(_0x531b8c){logger['info']('UpdateOpenchannelQueueReport',_0x39f640);logger[_0xa531('0x11')](_0xa531('0x1e'),_0x39f640,JSON['stringify'](_0x531b8c));_0x3ac4eb(_0x531b8c);})['catch'](function(_0x380cec){logger['error'](_0xa531('0x1e'),_0x380cec[_0xa531('0x16')],_0x39f640);_0x57f1b3(_0x8e9ab3['error'](0x1f4,_0x380cec[_0xa531('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index b50fdf2..39c2209 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 _0xf57e=['delete','destroy','multer','connect-timeout','express','../../components/auth/service','./openchannelTransferReport.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf57e,0x1e2));var _0xef57=function(_0x320364,_0x97ff90){_0x320364=_0x320364-0x0;var _0x3d62ed=_0xf57e[_0x320364];return _0x3d62ed;};'use strict';var multer=require(_0xef57('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xef57('0x1'));var express=require(_0xef57('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xef57('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xef57('0x4'));router[_0xef57('0x5')]('/',auth[_0xef57('0x6')](),controller[_0xef57('0x7')]);router[_0xef57('0x5')]('/describe',auth[_0xef57('0x6')](),controller['describe']);router[_0xef57('0x5')](_0xef57('0x8'),auth[_0xef57('0x6')](),controller[_0xef57('0x9')]);router[_0xef57('0xa')]('/',auth[_0xef57('0x6')](),controller['create']);router[_0xef57('0xb')](_0xef57('0x8'),auth[_0xef57('0x6')](),controller[_0xef57('0xc')]);router[_0xef57('0xd')](_0xef57('0x8'),auth[_0xef57('0x6')](),controller[_0xef57('0xe')]);module['exports']=router; \ No newline at end of file +var _0x4673=['/:id','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index','get','/describe','show','post','put'];(function(_0x3cc81b,_0x4627c9){var _0x2d9ab9=function(_0x4331bf){while(--_0x4331bf){_0x3cc81b['push'](_0x3cc81b['shift']());}};_0x2d9ab9(++_0x4627c9);}(_0x4673,0x169));var _0x3467=function(_0x13f802,_0xe95bda){_0x13f802=_0x13f802-0x0;var _0x118dfa=_0x4673[_0x13f802];return _0x118dfa;};'use strict';var multer=require(_0x3467('0x0'));var util=require(_0x3467('0x1'));var path=require(_0x3467('0x2'));var timeout=require(_0x3467('0x3'));var express=require('express');var router=express[_0x3467('0x4')]();var fs_extra=require(_0x3467('0x5'));var auth=require(_0x3467('0x6'));var interaction=require(_0x3467('0x7'));var config=require(_0x3467('0x8'));var controller=require(_0x3467('0x9'));router['get']('/',auth[_0x3467('0xa')](),controller[_0x3467('0xb')]);router[_0x3467('0xc')](_0x3467('0xd'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x3467('0xa')](),controller[_0x3467('0xe')]);router[_0x3467('0xf')]('/',auth[_0x3467('0xa')](),controller['create']);router[_0x3467('0x10')](_0x3467('0x11'),auth['isAuthenticated'](),controller[_0x3467('0x12')]);router[_0x3467('0x13')](_0x3467('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x3467('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 7faf505..f7c1e85 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x458805,_0x39839c){var _0x513275=function(_0x38c589){while(--_0x38c589){_0x458805['push'](_0x458805['shift']());}};_0x513275(++_0x39839c);}(_0xedd9,0xfc));var _0x9edd=function(_0x1a3c69,_0x1ac16c){_0x1a3c69=_0x1a3c69-0x0;var _0x1eea9d=_0xedd9[_0x1a3c69];return _0x1eea9d;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x502de3,_0x1248be){var _0x5b73de=function(_0x590d00){while(--_0x590d00){_0x502de3['push'](_0x502de3['shift']());}};_0x5b73de(++_0x1248be);}(_0xf4eb,0xec));var _0xbf4e=function(_0x40f15e,_0x1750a6){_0x40f15e=_0x40f15e-0x0;var _0x3b2cc2=_0xf4eb[_0x40f15e];return _0x3b2cc2;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index ad79d32..fc967cf 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 _0xcfd1=['then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','OpenchannelTransferReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save'];(function(_0x246636,_0x11da75){var _0x5c05c2=function(_0x1b6cdf){while(--_0x1b6cdf){_0x246636['push'](_0x246636['shift']());}};_0x5c05c2(++_0x11da75);}(_0xcfd1,0x106));var _0x1cfd=function(_0x2a24c7,_0xbbe950){_0x2a24c7=_0x2a24c7-0x0;var _0x23ff91=_0xcfd1[_0x2a24c7];return _0x23ff91;};'use strict';var emlformat=require(_0x1cfd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1cfd('0x1'));var jsonpatch=require(_0x1cfd('0x2'));var rp=require(_0x1cfd('0x3'));var moment=require(_0x1cfd('0x4'));var BPromise=require(_0x1cfd('0x5'));var Mustache=require(_0x1cfd('0x6'));var util=require(_0x1cfd('0x7'));var path=require('path');var sox=require(_0x1cfd('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1cfd('0x9'));var squel=require(_0x1cfd('0xa'));var crypto=require(_0x1cfd('0xb'));var jsforce=require(_0x1cfd('0xc'));var deskjs=require(_0x1cfd('0xd'));var toCsv=require(_0x1cfd('0xe'));var querystring=require(_0x1cfd('0xf'));var Papa=require(_0x1cfd('0x10'));var Redis=require('ioredis');var authService=require(_0x1cfd('0x11'));var qs=require(_0x1cfd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1cfd('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1cfd('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1cfd('0x15'))['db'];function respondWithStatusCode(_0x19f5c3,_0x5661be){_0x5661be=_0x5661be||0xcc;return function(_0x3b5e2c){if(_0x3b5e2c){return _0x19f5c3['sendStatus'](_0x5661be);}return _0x19f5c3[_0x1cfd('0x16')](_0x5661be)[_0x1cfd('0x17')]();};}function respondWithResult(_0x5d1344,_0x34202a){_0x34202a=_0x34202a||0xc8;return function(_0x1d3c36){if(_0x1d3c36){return _0x5d1344['status'](_0x34202a)[_0x1cfd('0x18')](_0x1d3c36);}};}function respondWithFilteredResult(_0x26d418,_0x8613a){return function(_0x341d50){if(_0x341d50){var _0x3d4517=typeof _0x8613a[_0x1cfd('0x19')]==='undefined'&&typeof _0x8613a[_0x1cfd('0x1a')]===_0x1cfd('0x1b');var _0x3cc5e1=_0x341d50[_0x1cfd('0x1c')];var _0x534aed=_0x3d4517?0x0:_0x8613a[_0x1cfd('0x19')];var _0x1beeb8=_0x3d4517?_0x341d50['count']:_0x8613a[_0x1cfd('0x19')]+_0x8613a[_0x1cfd('0x1a')];var _0x1dc71d;if(_0x1beeb8>=_0x3cc5e1){_0x1beeb8=_0x3cc5e1;_0x1dc71d=0xc8;}else{_0x1dc71d=0xce;}_0x26d418[_0x1cfd('0x16')](_0x1dc71d);return _0x26d418[_0x1cfd('0x1d')](_0x1cfd('0x1e'),_0x534aed+'-'+_0x1beeb8+'/'+_0x3cc5e1)[_0x1cfd('0x18')](_0x341d50);}return null;};}function patchUpdates(_0x414e2b){return function(_0x186dfd){try{jsonpatch[_0x1cfd('0x1f')](_0x186dfd,_0x414e2b,!![]);}catch(_0x23e02e){return BPromise[_0x1cfd('0x20')](_0x23e02e);}return _0x186dfd[_0x1cfd('0x21')]();};}function saveUpdates(_0x5d542f,_0x54d3f5){return function(_0x3b3e6a){if(_0x3b3e6a){return _0x3b3e6a['update'](_0x5d542f)[_0x1cfd('0x22')](function(_0x2f3294){return _0x2f3294;});}return null;};}function removeEntity(_0x57fef6,_0x3491d1){return function(_0x3ea60b){if(_0x3ea60b){return _0x3ea60b[_0x1cfd('0x23')]()[_0x1cfd('0x22')](function(){_0x57fef6[_0x1cfd('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x341c22,_0xc83590){return function(_0x2f89b0){if(!_0x2f89b0){_0x341c22[_0x1cfd('0x24')](0x194);}return _0x2f89b0;};}function handleError(_0x2cb2fd,_0x2de97c){_0x2de97c=_0x2de97c||0x1f4;return function(_0x50b199){logger[_0x1cfd('0x25')](_0x50b199[_0x1cfd('0x26')]);if(_0x50b199[_0x1cfd('0x27')]){delete _0x50b199[_0x1cfd('0x27')];}_0x2cb2fd[_0x1cfd('0x16')](_0x2de97c)[_0x1cfd('0x28')](_0x50b199);};}exports[_0x1cfd('0x29')]=function(_0x10e84f,_0x51d917){var _0x44ee10={},_0x2edb7e={},_0x1d5b4a={'count':0x0,'rows':[]};var _0x299635=_[_0x1cfd('0x2a')](db['OpenchannelTransferReport'][_0x1cfd('0x2b')],function(_0xf1c7f2){return{'name':_0xf1c7f2['fieldName'],'type':_0xf1c7f2[_0x1cfd('0x2c')][_0x1cfd('0x2d')]};});_0x2edb7e[_0x1cfd('0x2e')]=_[_0x1cfd('0x2a')](_0x299635,_0x1cfd('0x27'));_0x2edb7e['query']=_[_0x1cfd('0x2f')](_0x10e84f[_0x1cfd('0x30')]);_0x2edb7e['filters']=_['intersection'](_0x2edb7e[_0x1cfd('0x2e')],_0x2edb7e[_0x1cfd('0x30')]);_0x44ee10[_0x1cfd('0x31')]=_[_0x1cfd('0x32')](_0x2edb7e[_0x1cfd('0x2e')],qs[_0x1cfd('0x33')](_0x10e84f[_0x1cfd('0x30')][_0x1cfd('0x33')]));_0x44ee10[_0x1cfd('0x31')]=_0x44ee10['attributes'][_0x1cfd('0x34')]?_0x44ee10[_0x1cfd('0x31')]:_0x2edb7e[_0x1cfd('0x2e')];if(!_0x10e84f[_0x1cfd('0x30')][_0x1cfd('0x35')]('nolimit')){_0x44ee10[_0x1cfd('0x1a')]=qs[_0x1cfd('0x1a')](_0x10e84f[_0x1cfd('0x30')][_0x1cfd('0x1a')]);_0x44ee10[_0x1cfd('0x19')]=qs['offset'](_0x10e84f[_0x1cfd('0x30')][_0x1cfd('0x19')]);}_0x44ee10[_0x1cfd('0x36')]=qs['sort'](_0x10e84f[_0x1cfd('0x30')][_0x1cfd('0x37')]);_0x44ee10[_0x1cfd('0x38')]=qs[_0x1cfd('0x39')](_[_0x1cfd('0x3a')](_0x10e84f[_0x1cfd('0x30')],_0x2edb7e['filters']),_0x299635);if(_0x10e84f[_0x1cfd('0x30')][_0x1cfd('0x3b')]){_0x44ee10[_0x1cfd('0x38')]=_[_0x1cfd('0x3c')](_0x44ee10[_0x1cfd('0x38')],{'$or':_[_0x1cfd('0x2a')](_0x299635,function(_0x408400){if(_0x408400[_0x1cfd('0x2c')]!=='VIRTUAL'){var _0x23e702={};_0x23e702[_0x408400[_0x1cfd('0x27')]]={'$like':'%'+_0x10e84f['query'][_0x1cfd('0x3b')]+'%'};return _0x23e702;}})});}_0x44ee10=_[_0x1cfd('0x3c')]({},_0x44ee10,_0x10e84f[_0x1cfd('0x3d')]);var _0x455fe9={'where':_0x44ee10['where']};return db[_0x1cfd('0x3e')][_0x1cfd('0x1c')](_0x455fe9)[_0x1cfd('0x22')](function(_0x58e3ac){_0x1d5b4a[_0x1cfd('0x1c')]=_0x58e3ac;if(_0x10e84f[_0x1cfd('0x30')][_0x1cfd('0x3f')]){_0x44ee10[_0x1cfd('0x40')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x1cfd('0x41')](_0x44ee10);})[_0x1cfd('0x22')](function(_0x1436b7){_0x1d5b4a[_0x1cfd('0x42')]=_0x1436b7;return _0x1d5b4a;})['then'](respondWithFilteredResult(_0x51d917,_0x44ee10))[_0x1cfd('0x43')](handleError(_0x51d917,null));};exports[_0x1cfd('0x44')]=function(_0x20289b,_0x3be7ff){var _0x3dab43={'raw':!![],'where':{'id':_0x20289b[_0x1cfd('0x45')]['id']}},_0x306fa8={};_0x306fa8[_0x1cfd('0x2e')]=_[_0x1cfd('0x2f')](db[_0x1cfd('0x3e')][_0x1cfd('0x2b')]);_0x306fa8[_0x1cfd('0x30')]=_[_0x1cfd('0x2f')](_0x20289b[_0x1cfd('0x30')]);_0x306fa8['filters']=_[_0x1cfd('0x32')](_0x306fa8[_0x1cfd('0x2e')],_0x306fa8[_0x1cfd('0x30')]);_0x3dab43['attributes']=_[_0x1cfd('0x32')](_0x306fa8[_0x1cfd('0x2e')],qs[_0x1cfd('0x33')](_0x20289b[_0x1cfd('0x30')]['fields']));_0x3dab43[_0x1cfd('0x31')]=_0x3dab43[_0x1cfd('0x31')][_0x1cfd('0x34')]?_0x3dab43[_0x1cfd('0x31')]:_0x306fa8[_0x1cfd('0x2e')];if(_0x20289b[_0x1cfd('0x30')]['includeAll']){_0x3dab43[_0x1cfd('0x40')]=[{'all':!![]}];}_0x3dab43=_[_0x1cfd('0x3c')]({},_0x3dab43,_0x20289b['options']);return db['OpenchannelTransferReport'][_0x1cfd('0x46')](_0x3dab43)[_0x1cfd('0x22')](handleEntityNotFound(_0x3be7ff,null))[_0x1cfd('0x22')](respondWithResult(_0x3be7ff,null))['catch'](handleError(_0x3be7ff,null));};exports[_0x1cfd('0x47')]=function(_0x3f727a,_0x25ce58){return db[_0x1cfd('0x3e')][_0x1cfd('0x47')](_0x3f727a[_0x1cfd('0x48')],{})[_0x1cfd('0x22')](respondWithResult(_0x25ce58,0xc9))['catch'](handleError(_0x25ce58,null));};exports['update']=function(_0x1b7cbb,_0x89ed88){if(_0x1b7cbb['body']['id']){delete _0x1b7cbb['body']['id'];}return db[_0x1cfd('0x3e')][_0x1cfd('0x46')]({'where':{'id':_0x1b7cbb['params']['id']}})[_0x1cfd('0x22')](handleEntityNotFound(_0x89ed88,null))[_0x1cfd('0x22')](saveUpdates(_0x1b7cbb[_0x1cfd('0x48')],null))['then'](respondWithResult(_0x89ed88,null))[_0x1cfd('0x43')](handleError(_0x89ed88,null));};exports[_0x1cfd('0x23')]=function(_0x4754d9,_0x59fac5){return db[_0x1cfd('0x3e')]['find']({'where':{'id':_0x4754d9[_0x1cfd('0x45')]['id']}})[_0x1cfd('0x22')](handleEntityNotFound(_0x59fac5,null))[_0x1cfd('0x22')](removeEntity(_0x59fac5,null))['catch'](handleError(_0x59fac5,null));};exports[_0x1cfd('0x49')]=function(_0xf8ba37,_0x440282){return db[_0x1cfd('0x3e')][_0x1cfd('0x49')]()[_0x1cfd('0x22')](respondWithResult(_0x440282,null))[_0x1cfd('0x43')](handleError(_0x440282,null));}; \ No newline at end of file +var _0xc234=['apply','reject','save','update','destroy','then','error','name','index','map','OpenchannelTransferReport','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range'];(function(_0x54b60b,_0x6884b6){var _0x5c60c8=function(_0xad7a69){while(--_0xad7a69){_0x54b60b['push'](_0x54b60b['shift']());}};_0x5c60c8(++_0x6884b6);}(_0xc234,0x1dd));var _0x4c23=function(_0x458d14,_0x2d9a36){_0x458d14=_0x458d14-0x0;var _0x2b3e14=_0xc234[_0x458d14];return _0x2b3e14;};'use strict';var emlformat=require(_0x4c23('0x0'));var rimraf=require(_0x4c23('0x1'));var zipdir=require(_0x4c23('0x2'));var jsonpatch=require(_0x4c23('0x3'));var rp=require(_0x4c23('0x4'));var moment=require(_0x4c23('0x5'));var BPromise=require(_0x4c23('0x6'));var Mustache=require(_0x4c23('0x7'));var util=require('util');var path=require(_0x4c23('0x8'));var sox=require(_0x4c23('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c23('0xa'));var _=require(_0x4c23('0xb'));var squel=require(_0x4c23('0xc'));var crypto=require('crypto');var jsforce=require(_0x4c23('0xd'));var deskjs=require(_0x4c23('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4c23('0xf'));var Papa=require('papaparse');var Redis=require(_0x4c23('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4c23('0x11'));var as=require(_0x4c23('0x12'));var hardwareService=require(_0x4c23('0x13'));var logger=require(_0x4c23('0x14'))(_0x4c23('0x15'));var utils=require(_0x4c23('0x16'));var config=require(_0x4c23('0x17'));var licenseUtil=require(_0x4c23('0x18'));var db=require(_0x4c23('0x19'))['db'];function respondWithStatusCode(_0x54680c,_0x37a4d4){_0x37a4d4=_0x37a4d4||0xcc;return function(_0xceaf7e){if(_0xceaf7e){return _0x54680c[_0x4c23('0x1a')](_0x37a4d4);}return _0x54680c[_0x4c23('0x1b')](_0x37a4d4)['end']();};}function respondWithResult(_0x438331,_0x1586fc){_0x1586fc=_0x1586fc||0xc8;return function(_0x47d9ed){if(_0x47d9ed){return _0x438331[_0x4c23('0x1b')](_0x1586fc)[_0x4c23('0x1c')](_0x47d9ed);}};}function respondWithFilteredResult(_0x22861c,_0x22433d){return function(_0x513f97){if(_0x513f97){var _0x1e1808=typeof _0x22433d[_0x4c23('0x1d')]==='undefined'&&typeof _0x22433d[_0x4c23('0x1e')]==='undefined';var _0x4b0a82=_0x513f97['count'];var _0x2b8744=_0x1e1808?0x0:_0x22433d['offset'];var _0x455efa=_0x1e1808?_0x513f97[_0x4c23('0x1f')]:_0x22433d['offset']+_0x22433d[_0x4c23('0x1e')];var _0x42d780;if(_0x455efa>=_0x4b0a82){_0x455efa=_0x4b0a82;_0x42d780=0xc8;}else{_0x42d780=0xce;}_0x22861c[_0x4c23('0x1b')](_0x42d780);return _0x22861c[_0x4c23('0x20')](_0x4c23('0x21'),_0x2b8744+'-'+_0x455efa+'/'+_0x4b0a82)[_0x4c23('0x1c')](_0x513f97);}return null;};}function patchUpdates(_0x4cd0f1){return function(_0x3effdd){try{jsonpatch[_0x4c23('0x22')](_0x3effdd,_0x4cd0f1,!![]);}catch(_0x2a5c23){return BPromise[_0x4c23('0x23')](_0x2a5c23);}return _0x3effdd[_0x4c23('0x24')]();};}function saveUpdates(_0x441260,_0x365c74){return function(_0x1e9955){if(_0x1e9955){return _0x1e9955[_0x4c23('0x25')](_0x441260)['then'](function(_0x3b59fa){return _0x3b59fa;});}return null;};}function removeEntity(_0x5ca84c,_0x440c64){return function(_0x48e68f){if(_0x48e68f){return _0x48e68f[_0x4c23('0x26')]()[_0x4c23('0x27')](function(){_0x5ca84c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe3559a,_0x48d76c){return function(_0x3cd368){if(!_0x3cd368){_0xe3559a[_0x4c23('0x1a')](0x194);}return _0x3cd368;};}function handleError(_0x1b2171,_0xa837f7){_0xa837f7=_0xa837f7||0x1f4;return function(_0x43cfc7){logger[_0x4c23('0x28')](_0x43cfc7['stack']);if(_0x43cfc7[_0x4c23('0x29')]){delete _0x43cfc7[_0x4c23('0x29')];}_0x1b2171[_0x4c23('0x1b')](_0xa837f7)['send'](_0x43cfc7);};}exports[_0x4c23('0x2a')]=function(_0x2df2a6,_0x3e6771){var _0xa1942f={},_0x4409fb={},_0x544113={'count':0x0,'rows':[]};var _0x160b8f=_[_0x4c23('0x2b')](db[_0x4c23('0x2c')][_0x4c23('0x2d')],function(_0x6b0bc7){return{'name':_0x6b0bc7['fieldName'],'type':_0x6b0bc7[_0x4c23('0x2e')][_0x4c23('0x2f')]};});_0x4409fb['model']=_[_0x4c23('0x2b')](_0x160b8f,_0x4c23('0x29'));_0x4409fb[_0x4c23('0x30')]=_[_0x4c23('0x31')](_0x2df2a6['query']);_0x4409fb[_0x4c23('0x32')]=_[_0x4c23('0x33')](_0x4409fb[_0x4c23('0x34')],_0x4409fb[_0x4c23('0x30')]);_0xa1942f['attributes']=_[_0x4c23('0x33')](_0x4409fb['model'],qs[_0x4c23('0x35')](_0x2df2a6['query'][_0x4c23('0x35')]));_0xa1942f[_0x4c23('0x36')]=_0xa1942f[_0x4c23('0x36')]['length']?_0xa1942f[_0x4c23('0x36')]:_0x4409fb[_0x4c23('0x34')];if(!_0x2df2a6[_0x4c23('0x30')][_0x4c23('0x37')](_0x4c23('0x38'))){_0xa1942f[_0x4c23('0x1e')]=qs[_0x4c23('0x1e')](_0x2df2a6[_0x4c23('0x30')][_0x4c23('0x1e')]);_0xa1942f[_0x4c23('0x1d')]=qs[_0x4c23('0x1d')](_0x2df2a6[_0x4c23('0x30')]['offset']);}_0xa1942f[_0x4c23('0x39')]=qs['sort'](_0x2df2a6[_0x4c23('0x30')][_0x4c23('0x3a')]);_0xa1942f[_0x4c23('0x3b')]=qs['filters'](_[_0x4c23('0x3c')](_0x2df2a6[_0x4c23('0x30')],_0x4409fb['filters']),_0x160b8f);if(_0x2df2a6[_0x4c23('0x30')][_0x4c23('0x3d')]){_0xa1942f['where']=_['merge'](_0xa1942f['where'],{'$or':_['map'](_0x160b8f,function(_0x59bb9a){if(_0x59bb9a[_0x4c23('0x2e')]!=='VIRTUAL'){var _0x338e64={};_0x338e64[_0x59bb9a[_0x4c23('0x29')]]={'$like':'%'+_0x2df2a6[_0x4c23('0x30')][_0x4c23('0x3d')]+'%'};return _0x338e64;}})});}_0xa1942f=_[_0x4c23('0x3e')]({},_0xa1942f,_0x2df2a6[_0x4c23('0x3f')]);var _0xe51ec6={'where':_0xa1942f[_0x4c23('0x3b')]};return db[_0x4c23('0x2c')][_0x4c23('0x1f')](_0xe51ec6)[_0x4c23('0x27')](function(_0x1426af){_0x544113[_0x4c23('0x1f')]=_0x1426af;if(_0x2df2a6['query'][_0x4c23('0x40')]){_0xa1942f['include']=[{'all':!![]}];}return db[_0x4c23('0x2c')][_0x4c23('0x41')](_0xa1942f);})[_0x4c23('0x27')](function(_0x11cae9){_0x544113['rows']=_0x11cae9;return _0x544113;})['then'](respondWithFilteredResult(_0x3e6771,_0xa1942f))[_0x4c23('0x42')](handleError(_0x3e6771,null));};exports['show']=function(_0x477776,_0x3fde4c){var _0x5b9542={'raw':!![],'where':{'id':_0x477776[_0x4c23('0x43')]['id']}},_0x4fc342={};_0x4fc342['model']=_[_0x4c23('0x31')](db[_0x4c23('0x2c')][_0x4c23('0x2d')]);_0x4fc342[_0x4c23('0x30')]=_['keys'](_0x477776[_0x4c23('0x30')]);_0x4fc342[_0x4c23('0x32')]=_[_0x4c23('0x33')](_0x4fc342[_0x4c23('0x34')],_0x4fc342[_0x4c23('0x30')]);_0x5b9542[_0x4c23('0x36')]=_['intersection'](_0x4fc342[_0x4c23('0x34')],qs[_0x4c23('0x35')](_0x477776[_0x4c23('0x30')][_0x4c23('0x35')]));_0x5b9542[_0x4c23('0x36')]=_0x5b9542[_0x4c23('0x36')][_0x4c23('0x44')]?_0x5b9542[_0x4c23('0x36')]:_0x4fc342[_0x4c23('0x34')];if(_0x477776[_0x4c23('0x30')][_0x4c23('0x40')]){_0x5b9542['include']=[{'all':!![]}];}_0x5b9542=_[_0x4c23('0x3e')]({},_0x5b9542,_0x477776[_0x4c23('0x3f')]);return db['OpenchannelTransferReport'][_0x4c23('0x45')](_0x5b9542)[_0x4c23('0x27')](handleEntityNotFound(_0x3fde4c,null))['then'](respondWithResult(_0x3fde4c,null))[_0x4c23('0x42')](handleError(_0x3fde4c,null));};exports['create']=function(_0x18ccab,_0x1c8fe2){return db['OpenchannelTransferReport'][_0x4c23('0x46')](_0x18ccab[_0x4c23('0x47')],{})[_0x4c23('0x27')](respondWithResult(_0x1c8fe2,0xc9))[_0x4c23('0x42')](handleError(_0x1c8fe2,null));};exports[_0x4c23('0x25')]=function(_0x210ea9,_0x581671){if(_0x210ea9[_0x4c23('0x47')]['id']){delete _0x210ea9[_0x4c23('0x47')]['id'];}return db[_0x4c23('0x2c')][_0x4c23('0x45')]({'where':{'id':_0x210ea9['params']['id']}})[_0x4c23('0x27')](handleEntityNotFound(_0x581671,null))[_0x4c23('0x27')](saveUpdates(_0x210ea9[_0x4c23('0x47')],null))[_0x4c23('0x27')](respondWithResult(_0x581671,null))[_0x4c23('0x42')](handleError(_0x581671,null));};exports['destroy']=function(_0x5c34fe,_0x44363e){return db[_0x4c23('0x2c')]['find']({'where':{'id':_0x5c34fe[_0x4c23('0x43')]['id']}})['then'](handleEntityNotFound(_0x44363e,null))[_0x4c23('0x27')](removeEntity(_0x44363e,null))[_0x4c23('0x42')](handleError(_0x44363e,null));};exports['describe']=function(_0x5bcf8f,_0x40cc8c){return db[_0x4c23('0x2c')][_0x4c23('0x48')]()[_0x4c23('0x27')](respondWithResult(_0x40cc8c,null))['catch'](handleError(_0x40cc8c,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index eaaeffc..5101dcf 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 _0x9f6e=['../../config/logger','api','request-promise','path','rimraf','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x9f6e,0x82));var _0xe9f6=function(_0x2e42c0,_0x57fff4){_0x2e42c0=_0x2e42c0-0x0;var _0x39f52b=_0x9f6e[_0x2e42c0];return _0x39f52b;};'use strict';var _=require(_0xe9f6('0x0'));var util=require(_0xe9f6('0x1'));var logger=require(_0xe9f6('0x2'))(_0xe9f6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe9f6('0x4'));var fs=require('fs');var path=require(_0xe9f6('0x5'));var rimraf=require(_0xe9f6('0x6'));var config=require('../../config/environment');var attributes=require(_0xe9f6('0x7'));module[_0xe9f6('0x8')]=function(_0x3dc5e9,_0x10ca53){return _0x3dc5e9[_0xe9f6('0x9')](_0xe9f6('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe9f6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbc19=['./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x361e67,_0x4ccc00){var _0x173f00=function(_0x415fea){while(--_0x415fea){_0x361e67['push'](_0x361e67['shift']());}};_0x173f00(++_0x4ccc00);}(_0xbc19,0x1b2));var _0x9bc1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbc19[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x9bc1('0x0'));var util=require(_0x9bc1('0x1'));var logger=require('../../config/logger')(_0x9bc1('0x2'));var moment=require(_0x9bc1('0x3'));var BPromise=require(_0x9bc1('0x4'));var rp=require(_0x9bc1('0x5'));var fs=require('fs');var path=require(_0x9bc1('0x6'));var rimraf=require(_0x9bc1('0x7'));var config=require('../../config/environment');var attributes=require(_0x9bc1('0x8'));module[_0x9bc1('0x9')]=function(_0x4aa3ec,_0x5c6a3c){return _0x4aa3ec[_0x9bc1('0xa')](_0x9bc1('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x9bc1('0xc'),'fields':[_0x9bc1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index f77599f..1645496 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 _0xa63f=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x54d6a8,_0x166c7f){var _0x33664b=function(_0x17f145){while(--_0x17f145){_0x54d6a8['push'](_0x54d6a8['shift']());}};_0x33664b(++_0x166c7f);}(_0xa63f,0x1b6));var _0xfa63=function(_0x174e6b,_0x124a26){_0x174e6b=_0x174e6b-0x0;var _0x10ab0e=_0xa63f[_0x174e6b];return _0x10ab0e;};'use strict';var _=require(_0xfa63('0x0'));var util=require(_0xfa63('0x1'));var moment=require(_0xfa63('0x2'));var BPromise=require(_0xfa63('0x3'));var rs=require(_0xfa63('0x4'));var fs=require('fs');var Redis=require(_0xfa63('0x5'));var db=require(_0xfa63('0x6'))['db'];var utils=require(_0xfa63('0x7'));var logger=require(_0xfa63('0x8'))(_0xfa63('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfa63('0xa')][_0xfa63('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb35bc5,_0x2dcf48,_0x486050){return new BPromise(function(_0x505e1a,_0x575b64){return client[_0xfa63('0xc')](_0xb35bc5,_0x486050)[_0xfa63('0xd')](function(_0x1bf230){logger['info'](_0xfa63('0xe'),_0x2dcf48,'request\x20sent');logger[_0xfa63('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2dcf48,_0xfa63('0x10'),JSON[_0xfa63('0x11')](_0x1bf230));if(_0x1bf230[_0xfa63('0x12')]){if(_0x1bf230[_0xfa63('0x12')][_0xfa63('0x13')]===0x1f4){logger[_0xfa63('0x12')](_0xfa63('0xe'),_0x2dcf48,_0x1bf230[_0xfa63('0x12')]['message']);return _0x575b64(_0x1bf230['error'][_0xfa63('0x14')]);}logger[_0xfa63('0x12')](_0xfa63('0xe'),_0x2dcf48,_0x1bf230['error'][_0xfa63('0x14')]);return _0x505e1a(_0x1bf230['error'][_0xfa63('0x14')]);}else{logger[_0xfa63('0x15')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2dcf48,_0xfa63('0x10'));_0x505e1a(_0x1bf230[_0xfa63('0x16')][_0xfa63('0x14')]);}})[_0xfa63('0x17')](function(_0x7d2ef5){logger[_0xfa63('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2dcf48,_0x7d2ef5);_0x575b64(_0x7d2ef5);});});} \ No newline at end of file +var _0xcee8=['../../config/logger','rpc','../../config/environment','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x11f5ff,_0xa0ef18){var _0x46eefb=function(_0x51872a){while(--_0x51872a){_0x11f5ff['push'](_0x11f5ff['shift']());}};_0x46eefb(++_0xa0ef18);}(_0xcee8,0xb1));var _0x8cee=function(_0x4e1095,_0x11fc03){_0x4e1095=_0x4e1095-0x0;var _0x2814f6=_0xcee8[_0x4e1095];return _0x2814f6;};'use strict';var _=require(_0x8cee('0x0'));var util=require(_0x8cee('0x1'));var moment=require(_0x8cee('0x2'));var BPromise=require(_0x8cee('0x3'));var rs=require(_0x8cee('0x4'));var fs=require('fs');var Redis=require(_0x8cee('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8cee('0x6'));var logger=require(_0x8cee('0x7'))(_0x8cee('0x8'));var config=require(_0x8cee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8cee('0xa')][_0x8cee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f57f1,_0x538c89,_0x341c63){return new BPromise(function(_0x49a070,_0x3d767a){return client[_0x8cee('0xc')](_0x4f57f1,_0x341c63)[_0x8cee('0xd')](function(_0x2fd414){logger['info'](_0x8cee('0xe'),_0x538c89,_0x8cee('0xf'));logger['debug'](_0x8cee('0x10'),_0x538c89,_0x8cee('0xf'),JSON['stringify'](_0x2fd414));if(_0x2fd414[_0x8cee('0x11')]){if(_0x2fd414['error'][_0x8cee('0x12')]===0x1f4){logger[_0x8cee('0x11')](_0x8cee('0xe'),_0x538c89,_0x2fd414[_0x8cee('0x11')]['message']);return _0x3d767a(_0x2fd414['error'][_0x8cee('0x13')]);}logger[_0x8cee('0x11')](_0x8cee('0xe'),_0x538c89,_0x2fd414[_0x8cee('0x11')][_0x8cee('0x13')]);return _0x49a070(_0x2fd414[_0x8cee('0x11')][_0x8cee('0x13')]);}else{logger[_0x8cee('0x14')](_0x8cee('0xe'),_0x538c89,_0x8cee('0xf'));_0x49a070(_0x2fd414[_0x8cee('0x15')][_0x8cee('0x13')]);}})[_0x8cee('0x16')](function(_0xc4cc22){logger[_0x8cee('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x538c89,_0xc4cc22);_0x3d767a(_0xc4cc22);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index d03c3ad..0b562c7 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 _0x2800=['/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x2800,0xd8));var _0x0280=function(_0x3277bf,_0x553d97){_0x3277bf=_0x3277bf-0x0;var _0x2669f2=_0x2800[_0x3277bf];return _0x2669f2;};'use strict';var multer=require(_0x0280('0x0'));var util=require(_0x0280('0x1'));var path=require(_0x0280('0x2'));var timeout=require(_0x0280('0x3'));var express=require(_0x0280('0x4'));var router=express[_0x0280('0x5')]();var fs_extra=require(_0x0280('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0280('0x7'));var config=require(_0x0280('0x8'));var controller=require(_0x0280('0x9'));router[_0x0280('0xa')]('/',auth[_0x0280('0xb')](),controller['index']);router['get'](_0x0280('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x0280('0xd')]('/',auth[_0x0280('0xb')](),controller[_0x0280('0xe')]);router[_0x0280('0xf')]('/:id',auth[_0x0280('0xb')](),controller['update']);router[_0x0280('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x0280('0x11')]);module[_0x0280('0x12')]=router; \ No newline at end of file +var _0x9f07=['get','isAuthenticated','/:id','show','post','create','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./pause.controller'];(function(_0x2aa4c8,_0x1f65b4){var _0x29edb8=function(_0x77caef){while(--_0x77caef){_0x2aa4c8['push'](_0x2aa4c8['shift']());}};_0x29edb8(++_0x1f65b4);}(_0x9f07,0x18e));var _0x79f0=function(_0x5b48c3,_0x351748){_0x5b48c3=_0x5b48c3-0x0;var _0x3adc44=_0x9f07[_0x5b48c3];return _0x3adc44;};'use strict';var multer=require(_0x79f0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x79f0('0x1'));var express=require(_0x79f0('0x2'));var router=express[_0x79f0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x79f0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x79f0('0x5'));var controller=require(_0x79f0('0x6'));router[_0x79f0('0x7')]('/',auth[_0x79f0('0x8')](),controller['index']);router['get'](_0x79f0('0x9'),auth[_0x79f0('0x8')](),controller[_0x79f0('0xa')]);router[_0x79f0('0xb')]('/',auth[_0x79f0('0x8')](),controller[_0x79f0('0xc')]);router['put'](_0x79f0('0x9'),auth[_0x79f0('0x8')](),controller['update']);router['delete'](_0x79f0('0x9'),auth[_0x79f0('0x8')](),controller[_0x79f0('0xd')]);module[_0x79f0('0xe')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 50b3301..2b22765 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 _0x625e=['exports','name','STRING','sequelize'];(function(_0x3398ad,_0x1aa21e){var _0x48c2c4=function(_0x4e3348){while(--_0x4e3348){_0x3398ad['push'](_0x3398ad['shift']());}};_0x48c2c4(++_0x1aa21e);}(_0x625e,0x107));var _0xe625=function(_0x503790,_0x525c78){_0x503790=_0x503790-0x0;var _0x388092=_0x625e[_0x503790];return _0x388092;};'use strict';var Sequelize=require(_0xe625('0x0'));module[_0xe625('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe625('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xe625('0x3')]}}; \ No newline at end of file +var _0x616a=['exports','STRING','name','sequelize'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x616a,0x137));var _0xa616=function(_0x4b5c45,_0x4eb16b){_0x4b5c45=_0x4b5c45-0x0;var _0x31a2c9=_0x616a[_0x4b5c45];return _0x31a2c9;};'use strict';var Sequelize=require(_0xa616('0x0'));module[_0xa616('0x1')]={'name':{'type':Sequelize[_0xa616('0x2')],'unique':_0xa616('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index ca93838..37fa0dd 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 _0x31cc=['undefined','count','offset','set','Content-Range','apply','reject','save','update','then','get','Pauses','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','Pause','include','findAll','rows','catch','show','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','params','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit'];(function(_0x5b0702,_0x38c2e8){var _0x245df7=function(_0x54cd83){while(--_0x54cd83){_0x5b0702['push'](_0x5b0702['shift']());}};_0x245df7(++_0x38c2e8);}(_0x31cc,0x12d));var _0xc31c=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x31cc[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc31c('0x0'));var zipdir=require(_0xc31c('0x1'));var jsonpatch=require(_0xc31c('0x2'));var rp=require('request-promise');var moment=require(_0xc31c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc31c('0x4'));var util=require('util');var path=require(_0xc31c('0x5'));var sox=require(_0xc31c('0x6'));var csv=require(_0xc31c('0x7'));var ejs=require(_0xc31c('0x8'));var fs=require('fs');var fs_extra=require(_0xc31c('0x9'));var _=require('lodash');var squel=require(_0xc31c('0xa'));var crypto=require(_0xc31c('0xb'));var jsforce=require(_0xc31c('0xc'));var deskjs=require(_0xc31c('0xd'));var toCsv=require(_0xc31c('0x7'));var querystring=require(_0xc31c('0xe'));var Papa=require(_0xc31c('0xf'));var Redis=require(_0xc31c('0x10'));var authService=require(_0xc31c('0x11'));var qs=require(_0xc31c('0x12'));var as=require(_0xc31c('0x13'));var hardwareService=require(_0xc31c('0x14'));var logger=require(_0xc31c('0x15'))('api');var utils=require(_0xc31c('0x16'));var config=require(_0xc31c('0x17'));var licenseUtil=require(_0xc31c('0x18'));var db=require(_0xc31c('0x19'))['db'];function respondWithStatusCode(_0x153101,_0x1a2091){_0x1a2091=_0x1a2091||0xcc;return function(_0x13836b){if(_0x13836b){return _0x153101[_0xc31c('0x1a')](_0x1a2091);}return _0x153101[_0xc31c('0x1b')](_0x1a2091)[_0xc31c('0x1c')]();};}function respondWithResult(_0x332b5b,_0x5e790a){_0x5e790a=_0x5e790a||0xc8;return function(_0x3ec0a6){if(_0x3ec0a6){return _0x332b5b[_0xc31c('0x1b')](_0x5e790a)[_0xc31c('0x1d')](_0x3ec0a6);}};}function respondWithFilteredResult(_0x216569,_0x71e8d0){return function(_0x13cf17){if(_0x13cf17){var _0x31e780=typeof _0x71e8d0['offset']==='undefined'&&typeof _0x71e8d0[_0xc31c('0x1e')]===_0xc31c('0x1f');var _0x143d0a=_0x13cf17[_0xc31c('0x20')];var _0x1475f2=_0x31e780?0x0:_0x71e8d0[_0xc31c('0x21')];var _0x2bb984=_0x31e780?_0x13cf17[_0xc31c('0x20')]:_0x71e8d0[_0xc31c('0x21')]+_0x71e8d0[_0xc31c('0x1e')];var _0x55767d;if(_0x2bb984>=_0x143d0a){_0x2bb984=_0x143d0a;_0x55767d=0xc8;}else{_0x55767d=0xce;}_0x216569[_0xc31c('0x1b')](_0x55767d);return _0x216569[_0xc31c('0x22')](_0xc31c('0x23'),_0x1475f2+'-'+_0x2bb984+'/'+_0x143d0a)[_0xc31c('0x1d')](_0x13cf17);}return null;};}function patchUpdates(_0x421ed7){return function(_0x1f81ea){try{jsonpatch[_0xc31c('0x24')](_0x1f81ea,_0x421ed7,!![]);}catch(_0xcd9a41){return BPromise[_0xc31c('0x25')](_0xcd9a41);}return _0x1f81ea[_0xc31c('0x26')]();};}function saveUpdates(_0x2b03d8,_0x29a9fa){return function(_0x2be45c){if(_0x2be45c){return _0x2be45c[_0xc31c('0x27')](_0x2b03d8)[_0xc31c('0x28')](function(_0x47ef8f){return _0x47ef8f;});}return null;};}function removeEntity(_0x4ba887,_0x72588d){return function(_0x23c261){if(_0x23c261){return _0x23c261['destroy']()[_0xc31c('0x28')](function(){var _0x37ca9f=_0x23c261[_0xc31c('0x29')]({'plain':!![]});var _0x4b71c3=_0xc31c('0x2a');return db[_0xc31c('0x2b')][_0xc31c('0x2c')]({'where':{'type':_0x4b71c3,'resourceId':_0x37ca9f['id']}})[_0xc31c('0x28')](function(){return _0x23c261;});})[_0xc31c('0x28')](function(){_0x4ba887[_0xc31c('0x1b')](0xcc)[_0xc31c('0x1c')]();});}};}function handleEntityNotFound(_0x3312b7,_0x8cc214){return function(_0x59b886){if(!_0x59b886){_0x3312b7[_0xc31c('0x1a')](0x194);}return _0x59b886;};}function handleError(_0x274eda,_0x3a626c){_0x3a626c=_0x3a626c||0x1f4;return function(_0x38083b){logger[_0xc31c('0x2d')](_0x38083b[_0xc31c('0x2e')]);if(_0x38083b[_0xc31c('0x2f')]){delete _0x38083b[_0xc31c('0x2f')];}_0x274eda[_0xc31c('0x1b')](_0x3a626c)[_0xc31c('0x30')](_0x38083b);};}exports['index']=function(_0xee9ec1,_0x1d3edb){var _0x1af57b={},_0x235f06={},_0x592441={'count':0x0,'rows':[]};var _0x5bcc80=_[_0xc31c('0x31')](db['Pause'][_0xc31c('0x32')],function(_0x3bae12){return{'name':_0x3bae12['fieldName'],'type':_0x3bae12[_0xc31c('0x33')][_0xc31c('0x34')]};});_0x235f06['model']=_['map'](_0x5bcc80,'name');_0x235f06[_0xc31c('0x35')]=_[_0xc31c('0x36')](_0xee9ec1[_0xc31c('0x35')]);_0x235f06[_0xc31c('0x37')]=_[_0xc31c('0x38')](_0x235f06['model'],_0x235f06[_0xc31c('0x35')]);_0x1af57b[_0xc31c('0x39')]=_[_0xc31c('0x38')](_0x235f06[_0xc31c('0x3a')],qs[_0xc31c('0x3b')](_0xee9ec1[_0xc31c('0x35')][_0xc31c('0x3b')]));_0x1af57b[_0xc31c('0x39')]=_0x1af57b['attributes'][_0xc31c('0x3c')]?_0x1af57b[_0xc31c('0x39')]:_0x235f06['model'];if(!_0xee9ec1[_0xc31c('0x35')][_0xc31c('0x3d')](_0xc31c('0x3e'))){_0x1af57b[_0xc31c('0x1e')]=qs[_0xc31c('0x1e')](_0xee9ec1[_0xc31c('0x35')][_0xc31c('0x1e')]);_0x1af57b[_0xc31c('0x21')]=qs[_0xc31c('0x21')](_0xee9ec1['query'][_0xc31c('0x21')]);}_0x1af57b[_0xc31c('0x3f')]=qs['sort'](_0xee9ec1[_0xc31c('0x35')][_0xc31c('0x40')]);_0x1af57b[_0xc31c('0x41')]=qs[_0xc31c('0x37')](_['pick'](_0xee9ec1[_0xc31c('0x35')],_0x235f06[_0xc31c('0x37')]),_0x5bcc80);if(_0xee9ec1[_0xc31c('0x35')][_0xc31c('0x42')]){_0x1af57b[_0xc31c('0x41')]=_['merge'](_0x1af57b[_0xc31c('0x41')],{'$or':_[_0xc31c('0x31')](_0x5bcc80,function(_0x48be79){if(_0x48be79['type']!=='VIRTUAL'){var _0x22f440={};_0x22f440[_0x48be79[_0xc31c('0x2f')]]={'$like':'%'+_0xee9ec1['query']['filter']+'%'};return _0x22f440;}})});}_0x1af57b=_[_0xc31c('0x43')]({},_0x1af57b,_0xee9ec1['options']);var _0x471f4f={'where':_0x1af57b[_0xc31c('0x41')]};return db[_0xc31c('0x44')][_0xc31c('0x20')](_0x471f4f)['then'](function(_0x4d0917){_0x592441['count']=_0x4d0917;if(_0xee9ec1[_0xc31c('0x35')]['includeAll']){_0x1af57b[_0xc31c('0x45')]=[{'all':!![]}];}return db[_0xc31c('0x44')][_0xc31c('0x46')](_0x1af57b);})[_0xc31c('0x28')](function(_0x3ab4da){_0x592441[_0xc31c('0x47')]=_0x3ab4da;return _0x592441;})[_0xc31c('0x28')](respondWithFilteredResult(_0x1d3edb,_0x1af57b))[_0xc31c('0x48')](handleError(_0x1d3edb,null));};exports[_0xc31c('0x49')]=function(_0x179195,_0x5d06d0){var _0x5b6013={'raw':!![],'where':{'id':_0x179195['params']['id']}},_0x3ff78c={};_0x3ff78c['model']=_[_0xc31c('0x36')](db[_0xc31c('0x44')][_0xc31c('0x32')]);_0x3ff78c[_0xc31c('0x35')]=_['keys'](_0x179195[_0xc31c('0x35')]);_0x3ff78c[_0xc31c('0x37')]=_[_0xc31c('0x38')](_0x3ff78c[_0xc31c('0x3a')],_0x3ff78c['query']);_0x5b6013[_0xc31c('0x39')]=_[_0xc31c('0x38')](_0x3ff78c[_0xc31c('0x3a')],qs['fields'](_0x179195[_0xc31c('0x35')][_0xc31c('0x3b')]));_0x5b6013[_0xc31c('0x39')]=_0x5b6013[_0xc31c('0x39')]['length']?_0x5b6013[_0xc31c('0x39')]:_0x3ff78c[_0xc31c('0x3a')];if(_0x179195['query'][_0xc31c('0x4a')]){_0x5b6013[_0xc31c('0x45')]=[{'all':!![]}];}_0x5b6013=_[_0xc31c('0x43')]({},_0x5b6013,_0x179195['options']);return db[_0xc31c('0x44')]['find'](_0x5b6013)['then'](handleEntityNotFound(_0x5d06d0,null))[_0xc31c('0x28')](respondWithResult(_0x5d06d0,null))['catch'](handleError(_0x5d06d0,null));};exports[_0xc31c('0x4b')]=function(_0x56485c,_0x54caae){return db[_0xc31c('0x44')]['create'](_0x56485c[_0xc31c('0x4c')],{})[_0xc31c('0x28')](function(_0x4ab11d){var _0x2828cb=_0x56485c['user'][_0xc31c('0x29')]({'plain':!![]});if(!_0x2828cb)throw new Error(_0xc31c('0x4d'));if(_0x2828cb[_0xc31c('0x4e')]==='user'){var _0x4a5d70=_0x4ab11d[_0xc31c('0x29')]({'plain':!![]});var _0x23d83a=_0xc31c('0x2a');return db['UserProfileSection'][_0xc31c('0x4f')]({'where':{'name':_0x23d83a,'userProfileId':_0x2828cb[_0xc31c('0x50')]},'raw':!![]})[_0xc31c('0x28')](function(_0x3273c2){if(_0x3273c2&&_0x3273c2[_0xc31c('0x51')]===0x0){return db['UserProfileResource'][_0xc31c('0x4b')]({'name':_0x4a5d70[_0xc31c('0x2f')],'resourceId':_0x4a5d70['id'],'type':_0x3273c2[_0xc31c('0x2f')],'sectionId':_0x3273c2['id']},{})[_0xc31c('0x28')](function(){return _0x4ab11d;});}else{return _0x4ab11d;}})['catch'](function(_0x5d355b){logger[_0xc31c('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d355b);throw _0x5d355b;});}return _0x4ab11d;})[_0xc31c('0x28')](respondWithResult(_0x54caae,0xc9))[_0xc31c('0x48')](handleError(_0x54caae,null));};exports[_0xc31c('0x27')]=function(_0x2472c3,_0x1d8f10){if(_0x2472c3['body']['id']){delete _0x2472c3['body']['id'];}return db[_0xc31c('0x44')][_0xc31c('0x4f')]({'where':{'id':_0x2472c3[_0xc31c('0x52')]['id']}})['then'](handleEntityNotFound(_0x1d8f10,null))['then'](saveUpdates(_0x2472c3[_0xc31c('0x4c')],null))[_0xc31c('0x28')](respondWithResult(_0x1d8f10,null))[_0xc31c('0x48')](handleError(_0x1d8f10,null));};exports[_0xc31c('0x2c')]=function(_0xbb7ae0,_0x4071f4){return db[_0xc31c('0x44')][_0xc31c('0x4f')]({'where':{'id':_0xbb7ae0['params']['id']}})[_0xc31c('0x28')](handleEntityNotFound(_0x4071f4,null))[_0xc31c('0x28')](removeEntity(_0x4071f4,null))[_0xc31c('0x48')](handleError(_0x4071f4,null));}; \ No newline at end of file +var _0xe1cf=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Pauses','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','map','Pause','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body'];(function(_0x110af0,_0xb36ae9){var _0x3fd18e=function(_0x22ceb8){while(--_0x22ceb8){_0x110af0['push'](_0x110af0['shift']());}};_0x3fd18e(++_0xb36ae9);}(_0xe1cf,0x156));var _0xfe1c=function(_0x264744,_0x42f486){_0x264744=_0x264744-0x0;var _0x5b6d2a=_0xe1cf[_0x264744];return _0x5b6d2a;};'use strict';var emlformat=require(_0xfe1c('0x0'));var rimraf=require(_0xfe1c('0x1'));var zipdir=require(_0xfe1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe1c('0x3'));var moment=require(_0xfe1c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfe1c('0x5'));var path=require(_0xfe1c('0x6'));var sox=require(_0xfe1c('0x7'));var csv=require('to-csv');var ejs=require(_0xfe1c('0x8'));var fs=require('fs');var fs_extra=require(_0xfe1c('0x9'));var _=require(_0xfe1c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfe1c('0xb'));var deskjs=require(_0xfe1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfe1c('0xd'));var Papa=require('papaparse');var Redis=require(_0xfe1c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfe1c('0xf'));var as=require(_0xfe1c('0x10'));var hardwareService=require(_0xfe1c('0x11'));var logger=require(_0xfe1c('0x12'))(_0xfe1c('0x13'));var utils=require(_0xfe1c('0x14'));var config=require(_0xfe1c('0x15'));var licenseUtil=require(_0xfe1c('0x16'));var db=require(_0xfe1c('0x17'))['db'];function respondWithStatusCode(_0x2a7cea,_0x4cd42f){_0x4cd42f=_0x4cd42f||0xcc;return function(_0x4e15ae){if(_0x4e15ae){return _0x2a7cea['sendStatus'](_0x4cd42f);}return _0x2a7cea[_0xfe1c('0x18')](_0x4cd42f)['end']();};}function respondWithResult(_0x14e02d,_0x46f75e){_0x46f75e=_0x46f75e||0xc8;return function(_0x87bef1){if(_0x87bef1){return _0x14e02d[_0xfe1c('0x18')](_0x46f75e)['json'](_0x87bef1);}};}function respondWithFilteredResult(_0x5a207a,_0x468879){return function(_0x42ed39){if(_0x42ed39){var _0x3d9f8b=typeof _0x468879[_0xfe1c('0x19')]===_0xfe1c('0x1a')&&typeof _0x468879[_0xfe1c('0x1b')]===_0xfe1c('0x1a');var _0x50dbad=_0x42ed39['count'];var _0x1befe9=_0x3d9f8b?0x0:_0x468879[_0xfe1c('0x19')];var _0x370051=_0x3d9f8b?_0x42ed39[_0xfe1c('0x1c')]:_0x468879[_0xfe1c('0x19')]+_0x468879[_0xfe1c('0x1b')];var _0x34e280;if(_0x370051>=_0x50dbad){_0x370051=_0x50dbad;_0x34e280=0xc8;}else{_0x34e280=0xce;}_0x5a207a[_0xfe1c('0x18')](_0x34e280);return _0x5a207a[_0xfe1c('0x1d')](_0xfe1c('0x1e'),_0x1befe9+'-'+_0x370051+'/'+_0x50dbad)[_0xfe1c('0x1f')](_0x42ed39);}return null;};}function patchUpdates(_0x885bd3){return function(_0x2e8e41){try{jsonpatch[_0xfe1c('0x20')](_0x2e8e41,_0x885bd3,!![]);}catch(_0x2daf76){return BPromise[_0xfe1c('0x21')](_0x2daf76);}return _0x2e8e41[_0xfe1c('0x22')]();};}function saveUpdates(_0x37130c,_0x588170){return function(_0x5cbcff){if(_0x5cbcff){return _0x5cbcff[_0xfe1c('0x23')](_0x37130c)['then'](function(_0x4a15b5){return _0x4a15b5;});}return null;};}function removeEntity(_0x2ea866,_0x3cb1d1){return function(_0x4c97fb){if(_0x4c97fb){return _0x4c97fb['destroy']()[_0xfe1c('0x24')](function(){var _0x47aca1=_0x4c97fb['get']({'plain':!![]});var _0x397ba2='Pauses';return db['UserProfileResource'][_0xfe1c('0x25')]({'where':{'type':_0x397ba2,'resourceId':_0x47aca1['id']}})[_0xfe1c('0x24')](function(){return _0x4c97fb;});})[_0xfe1c('0x24')](function(){_0x2ea866['status'](0xcc)[_0xfe1c('0x26')]();});}};}function handleEntityNotFound(_0x1c8d06,_0x573d55){return function(_0x619aca){if(!_0x619aca){_0x1c8d06[_0xfe1c('0x27')](0x194);}return _0x619aca;};}function handleError(_0x5b9058,_0x11d9bd){_0x11d9bd=_0x11d9bd||0x1f4;return function(_0x1b40e3){logger['error'](_0x1b40e3[_0xfe1c('0x28')]);if(_0x1b40e3[_0xfe1c('0x29')]){delete _0x1b40e3[_0xfe1c('0x29')];}_0x5b9058[_0xfe1c('0x18')](_0x11d9bd)[_0xfe1c('0x2a')](_0x1b40e3);};}exports['index']=function(_0x5ff5c0,_0x552c11){var _0x14afdc={},_0x1bdba2={},_0x4a3f47={'count':0x0,'rows':[]};var _0x443630=_[_0xfe1c('0x2b')](db[_0xfe1c('0x2c')][_0xfe1c('0x2d')],function(_0x41a939){return{'name':_0x41a939[_0xfe1c('0x2e')],'type':_0x41a939[_0xfe1c('0x2f')]['key']};});_0x1bdba2[_0xfe1c('0x30')]=_[_0xfe1c('0x2b')](_0x443630,_0xfe1c('0x29'));_0x1bdba2[_0xfe1c('0x31')]=_[_0xfe1c('0x32')](_0x5ff5c0[_0xfe1c('0x31')]);_0x1bdba2[_0xfe1c('0x33')]=_['intersection'](_0x1bdba2[_0xfe1c('0x30')],_0x1bdba2[_0xfe1c('0x31')]);_0x14afdc[_0xfe1c('0x34')]=_[_0xfe1c('0x35')](_0x1bdba2['model'],qs['fields'](_0x5ff5c0[_0xfe1c('0x31')]['fields']));_0x14afdc[_0xfe1c('0x34')]=_0x14afdc[_0xfe1c('0x34')]['length']?_0x14afdc[_0xfe1c('0x34')]:_0x1bdba2[_0xfe1c('0x30')];if(!_0x5ff5c0[_0xfe1c('0x31')][_0xfe1c('0x36')](_0xfe1c('0x37'))){_0x14afdc[_0xfe1c('0x1b')]=qs[_0xfe1c('0x1b')](_0x5ff5c0[_0xfe1c('0x31')][_0xfe1c('0x1b')]);_0x14afdc[_0xfe1c('0x19')]=qs[_0xfe1c('0x19')](_0x5ff5c0[_0xfe1c('0x31')][_0xfe1c('0x19')]);}_0x14afdc[_0xfe1c('0x38')]=qs[_0xfe1c('0x39')](_0x5ff5c0[_0xfe1c('0x31')][_0xfe1c('0x39')]);_0x14afdc['where']=qs[_0xfe1c('0x33')](_[_0xfe1c('0x3a')](_0x5ff5c0['query'],_0x1bdba2[_0xfe1c('0x33')]),_0x443630);if(_0x5ff5c0['query']['filter']){_0x14afdc[_0xfe1c('0x3b')]=_[_0xfe1c('0x3c')](_0x14afdc['where'],{'$or':_[_0xfe1c('0x2b')](_0x443630,function(_0x4141be){if(_0x4141be[_0xfe1c('0x2f')]!==_0xfe1c('0x3d')){var _0x4c6c1e={};_0x4c6c1e[_0x4141be['name']]={'$like':'%'+_0x5ff5c0['query'][_0xfe1c('0x3e')]+'%'};return _0x4c6c1e;}})});}_0x14afdc=_[_0xfe1c('0x3c')]({},_0x14afdc,_0x5ff5c0[_0xfe1c('0x3f')]);var _0x55fe9b={'where':_0x14afdc[_0xfe1c('0x3b')]};return db[_0xfe1c('0x2c')][_0xfe1c('0x1c')](_0x55fe9b)['then'](function(_0x84b88e){_0x4a3f47[_0xfe1c('0x1c')]=_0x84b88e;if(_0x5ff5c0[_0xfe1c('0x31')][_0xfe1c('0x40')]){_0x14afdc[_0xfe1c('0x41')]=[{'all':!![]}];}return db[_0xfe1c('0x2c')][_0xfe1c('0x42')](_0x14afdc);})[_0xfe1c('0x24')](function(_0x21c36f){_0x4a3f47[_0xfe1c('0x43')]=_0x21c36f;return _0x4a3f47;})[_0xfe1c('0x24')](respondWithFilteredResult(_0x552c11,_0x14afdc))[_0xfe1c('0x44')](handleError(_0x552c11,null));};exports[_0xfe1c('0x45')]=function(_0x476206,_0x30064a){var _0x1daa0b={'raw':!![],'where':{'id':_0x476206['params']['id']}},_0x5b9d26={};_0x5b9d26[_0xfe1c('0x30')]=_[_0xfe1c('0x32')](db[_0xfe1c('0x2c')]['rawAttributes']);_0x5b9d26[_0xfe1c('0x31')]=_[_0xfe1c('0x32')](_0x476206[_0xfe1c('0x31')]);_0x5b9d26['filters']=_[_0xfe1c('0x35')](_0x5b9d26['model'],_0x5b9d26['query']);_0x1daa0b[_0xfe1c('0x34')]=_[_0xfe1c('0x35')](_0x5b9d26[_0xfe1c('0x30')],qs['fields'](_0x476206[_0xfe1c('0x31')]['fields']));_0x1daa0b[_0xfe1c('0x34')]=_0x1daa0b[_0xfe1c('0x34')]['length']?_0x1daa0b['attributes']:_0x5b9d26[_0xfe1c('0x30')];if(_0x476206[_0xfe1c('0x31')][_0xfe1c('0x40')]){_0x1daa0b[_0xfe1c('0x41')]=[{'all':!![]}];}_0x1daa0b=_[_0xfe1c('0x3c')]({},_0x1daa0b,_0x476206[_0xfe1c('0x3f')]);return db[_0xfe1c('0x2c')][_0xfe1c('0x46')](_0x1daa0b)[_0xfe1c('0x24')](handleEntityNotFound(_0x30064a,null))['then'](respondWithResult(_0x30064a,null))[_0xfe1c('0x44')](handleError(_0x30064a,null));};exports['create']=function(_0x33a2c9,_0x4ab0ec){return db[_0xfe1c('0x2c')][_0xfe1c('0x47')](_0x33a2c9[_0xfe1c('0x48')],{})[_0xfe1c('0x24')](function(_0x46b172){var _0x6f3f20=_0x33a2c9['user'][_0xfe1c('0x49')]({'plain':!![]});if(!_0x6f3f20)throw new Error(_0xfe1c('0x4a'));if(_0x6f3f20['role']===_0xfe1c('0x4b')){var _0x315549=_0x46b172[_0xfe1c('0x49')]({'plain':!![]});var _0x460424=_0xfe1c('0x4c');return db[_0xfe1c('0x4d')][_0xfe1c('0x46')]({'where':{'name':_0x460424,'userProfileId':_0x6f3f20[_0xfe1c('0x4e')]},'raw':!![]})[_0xfe1c('0x24')](function(_0x4dc6bb){if(_0x4dc6bb&&_0x4dc6bb[_0xfe1c('0x4f')]===0x0){return db['UserProfileResource'][_0xfe1c('0x47')]({'name':_0x315549['name'],'resourceId':_0x315549['id'],'type':_0x4dc6bb[_0xfe1c('0x29')],'sectionId':_0x4dc6bb['id']},{})[_0xfe1c('0x24')](function(){return _0x46b172;});}else{return _0x46b172;}})['catch'](function(_0x1b4340){logger[_0xfe1c('0x50')](_0xfe1c('0x51'),_0x1b4340);throw _0x1b4340;});}return _0x46b172;})[_0xfe1c('0x24')](respondWithResult(_0x4ab0ec,0xc9))[_0xfe1c('0x44')](handleError(_0x4ab0ec,null));};exports['update']=function(_0x28e159,_0x54a206){if(_0x28e159['body']['id']){delete _0x28e159[_0xfe1c('0x48')]['id'];}return db[_0xfe1c('0x2c')][_0xfe1c('0x46')]({'where':{'id':_0x28e159[_0xfe1c('0x52')]['id']}})[_0xfe1c('0x24')](handleEntityNotFound(_0x54a206,null))[_0xfe1c('0x24')](saveUpdates(_0x28e159['body'],null))['then'](respondWithResult(_0x54a206,null))[_0xfe1c('0x44')](handleError(_0x54a206,null));};exports['destroy']=function(_0x221775,_0x494288){return db[_0xfe1c('0x2c')][_0xfe1c('0x46')]({'where':{'id':_0x221775[_0xfe1c('0x52')]['id']}})[_0xfe1c('0x24')](handleEntityNotFound(_0x494288,null))[_0xfe1c('0x24')](removeEntity(_0x494288,null))[_0xfe1c('0x44')](handleError(_0x494288,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index a8818b3..256a5f3 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 _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','util'];(function(_0x4fc1ca,_0x1df26c){var _0x3c3be0=function(_0x36dda6){while(--_0x36dda6){_0x4fc1ca['push'](_0x4fc1ca['shift']());}};_0x3c3be0(++_0x1df26c);}(_0x5fab,0x177));var _0xb5fa=function(_0x58eed6,_0x49a046){_0x58eed6=_0x58eed6-0x0;var _0x381fa7=_0x5fab[_0x58eed6];return _0x381fa7;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','util'];(function(_0x5cf771,_0x59fae5){var _0x241883=function(_0x5f4ea3){while(--_0x5f4ea3){_0x5cf771['push'](_0x5cf771['shift']());}};_0x241883(++_0x59fae5);}(_0x5fab,0x177));var _0xb5fa=function(_0x1ad12c,_0x5bd618){_0x1ad12c=_0x1ad12c-0x0;var _0xb60e0f=_0x5fab[_0x1ad12c];return _0xb60e0f;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index cdbc13a..1a766c3 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(_0x4b27c9,_0x28eba5){var _0x3ab18c=function(_0x585c4a){while(--_0x585c4a){_0x4b27c9['push'](_0x4b27c9['shift']());}};_0x3ab18c(++_0x28eba5);}(_0x7a54,0x106));var _0x47a5=function(_0x51994e,_0x1ddd97){_0x51994e=_0x51994e-0x0;var _0x464b2f=_0x7a54[_0x51994e];return _0x464b2f;};'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(_0xbcaaa2,_0x1d1b4e){var _0x53a6de=function(_0x4c5962){while(--_0x4c5962){_0xbcaaa2['push'](_0xbcaaa2['shift']());}};_0x53a6de(++_0x1d1b4e);}(_0xb10b,0x12a));var _0xbb10=function(_0x34951f,_0x277327){_0x34951f=_0x34951f-0x0;var _0x487db1=_0xb10b[_0x34951f];return _0x487db1;};'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 6c89d65..146b48b 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 _0xbb53=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/webhook','webhookGet','show','/:id/download','download','root','originalname','replace','%s-%s%s','basename','extname','post','single','upload','webhookPost','/:id','update','delete'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0xbb53,0x121));var _0x3bb5=function(_0x51d36b,_0x2a95d9){_0x51d36b=_0x51d36b-0x0;var _0x49c3d1=_0xbb53[_0x51d36b];return _0x49c3d1;};'use strict';var multer=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var path=require(_0x3bb5('0x2'));var timeout=require(_0x3bb5('0x3'));var express=require(_0x3bb5('0x4'));var router=express[_0x3bb5('0x5')]();var fs_extra=require(_0x3bb5('0x6'));var auth=require(_0x3bb5('0x7'));var interaction=require(_0x3bb5('0x8'));var config=require(_0x3bb5('0x9'));var controller=require('./plugin.controller');router['get']('/',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0xb')]);router[_0x3bb5('0xc')](_0x3bb5('0xd'),controller[_0x3bb5('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3bb5('0xf')]);router[_0x3bb5('0xc')](_0x3bb5('0x10'),auth['isAuthenticated'](),controller[_0x3bb5('0x11')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53af18,_0xd8d9bf,_0x2b915a){_0x2b915a(null,path['join'](config[_0x3bb5('0x12')],'server/files/plugins'));},'filename':function(_0x69f59a,_0x511bd8,_0x526bf0){_0x511bd8[_0x3bb5('0x13')]=_0x511bd8[_0x3bb5('0x13')][_0x3bb5('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x526bf0(null,util['format'](_0x3bb5('0x15'),path[_0x3bb5('0x16')](_0x511bd8['originalname'],path[_0x3bb5('0x17')](_0x511bd8[_0x3bb5('0x13')])),Date['now'](),path['extname'](_0x511bd8['originalname'])));}})});router[_0x3bb5('0x18')]('/',upload[_0x3bb5('0x19')]('file'),controller[_0x3bb5('0x1a')]);router[_0x3bb5('0x18')](_0x3bb5('0xd'),controller[_0x3bb5('0x1b')]);router['put'](_0x3bb5('0x1c'),auth[_0x3bb5('0xa')](),controller[_0x3bb5('0x1d')]);router['delete']('/:id',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0x1e')]);module[_0x3bb5('0x1f')]=router; \ No newline at end of file +var _0x984b=['Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/webhook','webhookGet','/:id','show','get','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s','extname','now','post','file','upload','put','update','delete','exports','connect-timeout','express'];(function(_0x54f152,_0x4e6fc2){var _0x8118fd=function(_0x2ded){while(--_0x2ded){_0x54f152['push'](_0x54f152['shift']());}};_0x8118fd(++_0x4e6fc2);}(_0x984b,0xee));var _0xb984=function(_0x21692c,_0x548274){_0x21692c=_0x21692c-0x0;var _0x370193=_0x984b[_0x21692c];return _0x370193;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb984('0x0'));var express=require(_0xb984('0x1'));var router=express[_0xb984('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb984('0x3'));var config=require(_0xb984('0x4'));var controller=require('./plugin.controller');router['get']('/',auth[_0xb984('0x5')](),controller[_0xb984('0x6')]);router['get'](_0xb984('0x7'),controller[_0xb984('0x8')]);router['get'](_0xb984('0x9'),auth['isAuthenticated'](),controller[_0xb984('0xa')]);router[_0xb984('0xb')](_0xb984('0xc'),auth[_0xb984('0x5')](),controller[_0xb984('0xd')]);var upload=multer({'storage':multer[_0xb984('0xe')]({'destination':function(_0x11525c,_0xfca315,_0x16d46f){_0x16d46f(null,path[_0xb984('0xf')](config[_0xb984('0x10')],_0xb984('0x11')));},'filename':function(_0x5b4add,_0x1b922b,_0x4b9c75){_0x1b922b[_0xb984('0x12')]=_0x1b922b[_0xb984('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4b9c75(null,util[_0xb984('0x13')](_0xb984('0x14'),path['basename'](_0x1b922b[_0xb984('0x12')],path[_0xb984('0x15')](_0x1b922b['originalname'])),Date[_0xb984('0x16')](),path[_0xb984('0x15')](_0x1b922b['originalname'])));}})});router[_0xb984('0x17')]('/',upload['single'](_0xb984('0x18')),controller[_0xb984('0x19')]);router[_0xb984('0x17')](_0xb984('0x7'),controller['webhookPost']);router[_0xb984('0x1a')](_0xb984('0x9'),auth[_0xb984('0x5')](),controller[_0xb984('0x1b')]);router[_0xb984('0x1c')](_0xb984('0x9'),auth['isAuthenticated'](),controller[_0xb984('0x1c')]);module[_0xb984('0x1d')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index fe5ccfe..9408596 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 _0xd01c=['ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING'];(function(_0x5ebea1,_0x52b36f){var _0x4a27e2=function(_0x408026){while(--_0x408026){_0x5ebea1['push'](_0x5ebea1['shift']());}};_0x4a27e2(++_0x52b36f);}(_0xd01c,0x141));var _0xcd01=function(_0x46081b,_0x440cfe){_0x46081b=_0x46081b-0x0;var _0x2ad63e=_0xd01c[_0x46081b];return _0x2ad63e;};'use strict';var Sequelize=require(_0xcd01('0x0'));module[_0xcd01('0x1')]={'name':{'type':Sequelize[_0xcd01('0x2')]},'type':{'type':Sequelize[_0xcd01('0x3')]('html',_0xcd01('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xcd01('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0xcd01('0x6')},'active':{'type':Sequelize[_0xcd01('0x7')],'defaultValue':0x0,'comment':_0xcd01('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0xcd01('0x9'),'agentOnly',_0xcd01('0xa'),'never'),'defaultValue':_0xcd01('0xa'),'comment':_0xcd01('0xb')},'icon':{'type':Sequelize[_0xcd01('0x2')]},'adminUrl':{'type':Sequelize[_0xcd01('0x2')]},'agentUrl':{'type':Sequelize[_0xcd01('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xcd01('0x2')]}}; \ No newline at end of file +var _0x60c5=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0x13dbe5,_0x5a4d1d){var _0x52d693=function(_0x2d0ac3){while(--_0x2d0ac3){_0x13dbe5['push'](_0x13dbe5['shift']());}};_0x52d693(++_0x5a4d1d);}(_0x60c5,0x181));var _0x560c=function(_0x14b669,_0x5abfdd){_0x14b669=_0x14b669-0x0;var _0x402904=_0x60c5[_0x14b669];return _0x402904;};'use strict';var Sequelize=require('sequelize');module[_0x560c('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x560c('0x1'),_0x560c('0x2'))},'description':{'type':Sequelize[_0x560c('0x3')]},'version':{'type':Sequelize[_0x560c('0x3')]},'path':{'type':Sequelize[_0x560c('0x4')],'comment':_0x560c('0x5')},'active':{'type':Sequelize[_0x560c('0x6')],'defaultValue':0x0,'comment':_0x560c('0x7')},'sidebar':{'type':Sequelize[_0x560c('0x8')](_0x560c('0x9'),_0x560c('0xa'),'always',_0x560c('0xb')),'defaultValue':_0x560c('0xc'),'comment':_0x560c('0xd')},'icon':{'type':Sequelize[_0x560c('0x4')]},'adminUrl':{'type':Sequelize[_0x560c('0x4')]},'agentUrl':{'type':Sequelize[_0x560c('0x4')]},'scriptName':{'type':Sequelize[_0x560c('0x4')]},'scriptPath':{'type':Sequelize[_0x560c('0x4')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 938e89f..8e76550 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 _0xe4ef=['Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','description','sidebar','always','icon','icon-apps','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','port','http://localhost:','encoding','method','headers','content-length','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','%s%s','content-type','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','extract-zip','archiver','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','./plugin.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Plugins','UserProfileResource','sendStatus','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','options','Plugin','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','download','join','root','server/files/plugins','format','%s.zip','basename','zip','warning','Error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','0777','length','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script'];(function(_0x56f5b7,_0x274a47){var _0x36a105=function(_0x379f7d){while(--_0x379f7d){_0x56f5b7['push'](_0x56f5b7['shift']());}};_0x36a105(++_0x274a47);}(_0xe4ef,0x183));var _0xfe4e=function(_0x109385,_0x5e1148){_0x109385=_0x109385-0x0;var _0x5bafba=_0xe4ef[_0x109385];return _0x5bafba;};'use strict';var emlformat=require(_0xfe4e('0x0'));var rimraf=require(_0xfe4e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe4e('0x2'));var rp=require('request-promise');var moment=require(_0xfe4e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfe4e('0x4'));var util=require(_0xfe4e('0x5'));var path=require(_0xfe4e('0x6'));var sox=require(_0xfe4e('0x7'));var csv=require(_0xfe4e('0x8'));var ejs=require(_0xfe4e('0x9'));var fs=require('fs');var fs_extra=require(_0xfe4e('0xa'));var _=require(_0xfe4e('0xb'));var squel=require(_0xfe4e('0xc'));var crypto=require(_0xfe4e('0xd'));var jsforce=require(_0xfe4e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfe4e('0x8'));var querystring=require(_0xfe4e('0xf'));var Papa=require(_0xfe4e('0x10'));var extract=require(_0xfe4e('0x11'));var rimraf=require('rimraf');var archiver=require(_0xfe4e('0x12'));var Redis=require(_0xfe4e('0x13'));var authService=require(_0xfe4e('0x14'));var qs=require(_0xfe4e('0x15'));var as=require(_0xfe4e('0x16'));var hardwareService=require(_0xfe4e('0x17'));var logger=require('../../config/logger')(_0xfe4e('0x18'));var utils=require(_0xfe4e('0x19'));var config=require(_0xfe4e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe4e('0x1b'))['db'];config[_0xfe4e('0x1c')]=_[_0xfe4e('0x1d')](config[_0xfe4e('0x1c')],{'host':_0xfe4e('0x1e'),'port':0x18eb});var socket=require(_0xfe4e('0x1f'))(new Redis(config[_0xfe4e('0x1c')]));require(_0xfe4e('0x20'))[_0xfe4e('0x21')](socket);function respondWithStatusCode(_0x5e7736,_0x138a22){_0x138a22=_0x138a22||0xcc;return function(_0x1d6cd3){if(_0x1d6cd3){return _0x5e7736['sendStatus'](_0x138a22);}return _0x5e7736[_0xfe4e('0x22')](_0x138a22)[_0xfe4e('0x23')]();};}function respondWithResult(_0x22d083,_0x50b4f9){_0x50b4f9=_0x50b4f9||0xc8;return function(_0x40436c){if(_0x40436c){return _0x22d083['status'](_0x50b4f9)[_0xfe4e('0x24')](_0x40436c);}};}function respondWithFilteredResult(_0x445877,_0x51da57){return function(_0x5373d9){if(_0x5373d9){var _0x162a6d=typeof _0x51da57[_0xfe4e('0x25')]==='undefined'&&typeof _0x51da57[_0xfe4e('0x26')]===_0xfe4e('0x27');var _0x1182c1=_0x5373d9[_0xfe4e('0x28')];var _0x2569e6=_0x162a6d?0x0:_0x51da57[_0xfe4e('0x25')];var _0x66600d=_0x162a6d?_0x5373d9[_0xfe4e('0x28')]:_0x51da57['offset']+_0x51da57[_0xfe4e('0x26')];var _0x2033c3;if(_0x66600d>=_0x1182c1){_0x66600d=_0x1182c1;_0x2033c3=0xc8;}else{_0x2033c3=0xce;}_0x445877[_0xfe4e('0x22')](_0x2033c3);return _0x445877[_0xfe4e('0x29')](_0xfe4e('0x2a'),_0x2569e6+'-'+_0x66600d+'/'+_0x1182c1)[_0xfe4e('0x24')](_0x5373d9);}return null;};}function patchUpdates(_0x4fcdba){return function(_0x41e1b1){try{jsonpatch[_0xfe4e('0x2b')](_0x41e1b1,_0x4fcdba,!![]);}catch(_0x149890){return BPromise[_0xfe4e('0x2c')](_0x149890);}return _0x41e1b1[_0xfe4e('0x2d')]();};}function saveUpdates(_0x3e492a,_0x4e158e){return function(_0x26efc4){if(_0x26efc4){return _0x26efc4[_0xfe4e('0x2e')](_0x3e492a)['then'](function(_0x2f5bf5){return _0x2f5bf5;});}return null;};}function removeEntity(_0x1d4a97,_0x1976a6){return function(_0x1cf53e){if(_0x1cf53e){return _0x1cf53e[_0xfe4e('0x2f')]()[_0xfe4e('0x30')](function(){var _0x45c172=_0x1cf53e[_0xfe4e('0x31')]({'plain':!![]});var _0x479bfd=_0xfe4e('0x32');return db[_0xfe4e('0x33')][_0xfe4e('0x2f')]({'where':{'type':_0x479bfd,'resourceId':_0x45c172['id']}})[_0xfe4e('0x30')](function(){return _0x1cf53e;});})[_0xfe4e('0x30')](function(){_0x1d4a97[_0xfe4e('0x22')](0xcc)[_0xfe4e('0x23')]();});}};}function handleEntityNotFound(_0x4f3196,_0x72b219){return function(_0x40252d){if(!_0x40252d){_0x4f3196[_0xfe4e('0x34')](0x194);}return _0x40252d;};}function handleError(_0xd987a5,_0x103787){_0x103787=_0x103787||0x1f4;return function(_0x38a788){logger[_0xfe4e('0x35')](_0x38a788[_0xfe4e('0x36')]);if(_0x38a788[_0xfe4e('0x37')]){delete _0x38a788[_0xfe4e('0x37')];}_0xd987a5[_0xfe4e('0x22')](_0x103787)[_0xfe4e('0x38')](_0x38a788);};}exports['index']=function(_0x3ca41a,_0x244378){var _0x513fcd={},_0xea32a0={},_0x2beb79={'count':0x0,'rows':[]};var _0x24c093=_[_0xfe4e('0x39')](db['Plugin']['rawAttributes'],function(_0x32f0ba){return{'name':_0x32f0ba[_0xfe4e('0x3a')],'type':_0x32f0ba[_0xfe4e('0x3b')][_0xfe4e('0x3c')]};});_0xea32a0[_0xfe4e('0x3d')]=_[_0xfe4e('0x39')](_0x24c093,_0xfe4e('0x37'));_0xea32a0[_0xfe4e('0x3e')]=_[_0xfe4e('0x3f')](_0x3ca41a[_0xfe4e('0x3e')]);_0xea32a0[_0xfe4e('0x40')]=_[_0xfe4e('0x41')](_0xea32a0[_0xfe4e('0x3d')],_0xea32a0[_0xfe4e('0x3e')]);_0x513fcd[_0xfe4e('0x42')]=_[_0xfe4e('0x41')](_0xea32a0[_0xfe4e('0x3d')],qs[_0xfe4e('0x43')](_0x3ca41a[_0xfe4e('0x3e')]['fields']));_0x513fcd[_0xfe4e('0x42')]=_0x513fcd[_0xfe4e('0x42')]['length']?_0x513fcd[_0xfe4e('0x42')]:_0xea32a0[_0xfe4e('0x3d')];if(!_0x3ca41a[_0xfe4e('0x3e')][_0xfe4e('0x44')]('nolimit')){_0x513fcd[_0xfe4e('0x26')]=qs[_0xfe4e('0x26')](_0x3ca41a[_0xfe4e('0x3e')][_0xfe4e('0x26')]);_0x513fcd['offset']=qs['offset'](_0x3ca41a[_0xfe4e('0x3e')][_0xfe4e('0x25')]);}_0x513fcd[_0xfe4e('0x45')]=qs[_0xfe4e('0x46')](_0x3ca41a['query']['sort']);_0x513fcd[_0xfe4e('0x47')]=qs['filters'](_[_0xfe4e('0x48')](_0x3ca41a[_0xfe4e('0x3e')],_0xea32a0[_0xfe4e('0x40')]),_0x24c093);if(_0x3ca41a[_0xfe4e('0x3e')]['filter']){_0x513fcd[_0xfe4e('0x47')]=_[_0xfe4e('0x49')](_0x513fcd[_0xfe4e('0x47')],{'$or':_[_0xfe4e('0x39')](_0x24c093,function(_0x342c9b){if(_0x342c9b[_0xfe4e('0x3b')]!=='VIRTUAL'){var _0x434c93={};_0x434c93[_0x342c9b[_0xfe4e('0x37')]]={'$like':'%'+_0x3ca41a[_0xfe4e('0x3e')]['filter']+'%'};return _0x434c93;}})});}_0x513fcd=_[_0xfe4e('0x49')]({},_0x513fcd,_0x3ca41a[_0xfe4e('0x4a')]);var _0x254711={'where':_0x513fcd[_0xfe4e('0x47')]};return db[_0xfe4e('0x4b')]['count'](_0x254711)['then'](function(_0x70c8fa){_0x2beb79[_0xfe4e('0x28')]=_0x70c8fa;if(_0x3ca41a[_0xfe4e('0x3e')][_0xfe4e('0x4c')]){_0x513fcd[_0xfe4e('0x4d')]=[{'all':!![]}];}return db[_0xfe4e('0x4b')][_0xfe4e('0x4e')](_0x513fcd);})[_0xfe4e('0x30')](function(_0x1b5c3c){_0x2beb79[_0xfe4e('0x4f')]=_0x1b5c3c;return _0x2beb79;})[_0xfe4e('0x30')](respondWithFilteredResult(_0x244378,_0x513fcd))[_0xfe4e('0x50')](handleError(_0x244378,null));};exports[_0xfe4e('0x51')]=function(_0x5c5d4d,_0xbbd4df){var _0xbe23f5={'raw':!![],'where':{'id':_0x5c5d4d[_0xfe4e('0x52')]['id']}},_0x540229={};_0x540229[_0xfe4e('0x3d')]=_[_0xfe4e('0x3f')](db[_0xfe4e('0x4b')][_0xfe4e('0x53')]);_0x540229[_0xfe4e('0x3e')]=_[_0xfe4e('0x3f')](_0x5c5d4d['query']);_0x540229[_0xfe4e('0x40')]=_[_0xfe4e('0x41')](_0x540229['model'],_0x540229[_0xfe4e('0x3e')]);_0xbe23f5[_0xfe4e('0x42')]=_[_0xfe4e('0x41')](_0x540229[_0xfe4e('0x3d')],qs[_0xfe4e('0x43')](_0x5c5d4d[_0xfe4e('0x3e')][_0xfe4e('0x43')]));_0xbe23f5['attributes']=_0xbe23f5[_0xfe4e('0x42')]['length']?_0xbe23f5['attributes']:_0x540229[_0xfe4e('0x3d')];if(_0x5c5d4d[_0xfe4e('0x3e')][_0xfe4e('0x4c')]){_0xbe23f5['include']=[{'all':!![]}];}_0xbe23f5=_[_0xfe4e('0x49')]({},_0xbe23f5,_0x5c5d4d[_0xfe4e('0x4a')]);return db[_0xfe4e('0x4b')][_0xfe4e('0x54')](_0xbe23f5)[_0xfe4e('0x30')](handleEntityNotFound(_0xbbd4df,null))[_0xfe4e('0x30')](respondWithResult(_0xbbd4df,null))[_0xfe4e('0x50')](handleError(_0xbbd4df,null));};exports[_0xfe4e('0x55')]=function(_0x29ec6a,_0x402fef,_0x5d0c81){return db[_0xfe4e('0x4b')]['find']({'where':{'id':_0x29ec6a['params']['id']},'attributes':[_0xfe4e('0x37'),_0xfe4e('0x6')],'raw':!![]})[_0xfe4e('0x30')](handleEntityNotFound(_0x402fef,null))['then'](function(_0x23168a){if(_0x23168a){var _0x13c04d=path[_0xfe4e('0x56')](config[_0xfe4e('0x57')],_0xfe4e('0x58'),util[_0xfe4e('0x59')](_0xfe4e('0x5a'),path[_0xfe4e('0x5b')](_0x23168a[_0xfe4e('0x6')])));var _0x248d99=fs['createWriteStream'](_0x13c04d);var _0x1a2e9f=archiver(_0xfe4e('0x5c'),{'zlib':{'level':0x9}});_0x1a2e9f['on'](_0xfe4e('0x5d'),function(_0x25799a){if(_0x25799a['code']==='ENOENT'){logger[_0xfe4e('0x35')](_0x25799a);}else{throw new db['Sequelize'][(_0xfe4e('0x5e'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x1a2e9f['on'](_0xfe4e('0x35'),function(_0x54403b){throw new db[(_0xfe4e('0x5f'))]['Error'](_0xfe4e('0x60'));});_0x1a2e9f[_0xfe4e('0x61')](_0x248d99);_0x1a2e9f[_0xfe4e('0x62')](_0xfe4e('0x63'),{'cwd':path[_0xfe4e('0x56')](config[_0xfe4e('0x57')],_0xfe4e('0x58'),path['dirname'](_0x23168a['path'])),'ignore':[path[_0xfe4e('0x56')](path[_0xfe4e('0x5b')](_0x23168a[_0xfe4e('0x6')]),_0xfe4e('0x64')),path[_0xfe4e('0x56')](path[_0xfe4e('0x5b')](_0x23168a[_0xfe4e('0x6')]),_0xfe4e('0x65'))],'nodir':!![]})[_0xfe4e('0x66')]();_0x248d99['on'](_0xfe4e('0x67'),function(){if(!fs[_0xfe4e('0x68')](_0x13c04d)){throw new db[(_0xfe4e('0x5f'))][(_0xfe4e('0x5e'))](_0xfe4e('0x69'));}return _0x402fef[_0xfe4e('0x55')](_0x13c04d,util[_0xfe4e('0x59')](_0xfe4e('0x5a'),path[_0xfe4e('0x5b')](_0x23168a[_0xfe4e('0x6')])),function(_0xdf7c9d){if(_0xdf7c9d){throw new db[(_0xfe4e('0x5f'))][(_0xfe4e('0x5e'))](_0xfe4e('0x6a'));}fs[_0xfe4e('0x6b')](_0x13c04d);logger[_0xfe4e('0x6c')](_0xfe4e('0x6d'));logger['info'](_0xfe4e('0x6e'));});});}return null;})[_0xfe4e('0x50')](handleError(_0x402fef,null));};exports['upload']=function(_0x3bc187,_0x5996ca,_0x4b972e){var _0x817e14=path['basename'](_0x3bc187[_0xfe4e('0x6f')][_0xfe4e('0x70')],path[_0xfe4e('0x71')](_0x3bc187[_0xfe4e('0x6f')][_0xfe4e('0x70')]));var _0x2593a0=path[_0xfe4e('0x56')](config['root'],_0xfe4e('0x58'),_0x3bc187[_0xfe4e('0x6f')][_0xfe4e('0x70')]);var _0x146124=path[_0xfe4e('0x56')](config['root'],_0xfe4e('0x58'),_0x817e14);logger[_0xfe4e('0x6c')]('Plugin\x20upload\x20filepath:\x20%s',_0x2593a0);logger[_0xfe4e('0x6c')](_0xfe4e('0x72'),_0x146124);try{fs['chmodSync'](_0x2593a0,parseInt(_0xfe4e('0x73'),0x8));extract(_0x2593a0,{'dir':_0x146124},function(_0x166fd5){if(_0x166fd5){logger[_0xfe4e('0x35')](_0x166fd5);handleError(_0x166fd5,!![]);};var _0x4cc341=fs['readdirSync'](_0x146124);if(_0x4cc341[_0xfe4e('0x74')]>0x1){removeReferences(_0x2593a0,_0x146124);logger['error'](_0xfe4e('0x75'));return _0x4b972e(new Error(_0xfe4e('0x75')));}var _0x148d02=fs[_0xfe4e('0x76')](path[_0xfe4e('0x56')](_0x146124,_0x4cc341[0x0]));if(_0x148d02[_0xfe4e('0x77')]()){removeReferences(_0x2593a0,_0x146124);logger['error'](_0xfe4e('0x75'));return _0x4b972e(new Error(_0xfe4e('0x75')));}if(_0x148d02[_0xfe4e('0x78')]()){var _0x43720e=fs[_0xfe4e('0x79')](path['join'](_0x146124,_0x4cc341[0x0]));if(_0x43720e['length']===0x0){removeReferences(_0x2593a0,_0x146124);logger[_0xfe4e('0x35')]('Invalid\x20plugin\x20structure');return _0x4b972e(new Error('Invalid\x20plugin\x20structure'));}var _0x315a2b=_0x43720e['some'](function(_0x198b69){return _0x198b69===_0xfe4e('0x7a');});if(!_0x315a2b){return _0x4b972e(new Error(_0xfe4e('0x7b')));}var _0x3ac911=fs[_0xfe4e('0x7c')](path[_0xfe4e('0x56')](_0x146124,_0x4cc341[0x0],_0xfe4e('0x7a')));var _0x3dbbc5=JSON[_0xfe4e('0x7d')](_0x3ac911);if(_0xfe4e('0x27')==typeof _0x3dbbc5[_0xfe4e('0x37')]){return _0x4b972e(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xfe4e('0x27')==typeof _0x3dbbc5[_0xfe4e('0x3b')]){return _0x4b972e(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xfe4e('0x27')==typeof _0x3dbbc5[_0xfe4e('0x7e')]){return _0x4b972e(new Error(_0xfe4e('0x7f')));}if('undefined'==typeof _0x3dbbc5[_0xfe4e('0x80')]){return _0x4b972e(new Error(_0xfe4e('0x81')));}if(_0x3dbbc5[_0xfe4e('0x3b')]==='html'){if('undefined'==typeof _0x3dbbc5[_0xfe4e('0x80')][_0xfe4e('0x82')]){return _0x4b972e(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xfe4e('0x27')==typeof _0x3dbbc5[_0xfe4e('0x80')][_0xfe4e('0x82')][_0xfe4e('0x83')]&&_0xfe4e('0x27')==typeof _0x3dbbc5['parameters']['views'][_0xfe4e('0x84')]){return _0x4b972e(new Error(_0xfe4e('0x85')));}}else if(_0x3dbbc5['type']===_0xfe4e('0x86')){if(_0xfe4e('0x27')==typeof _0x3dbbc5[_0xfe4e('0x80')]['scriptName']){return _0x4b972e(new Error(_0xfe4e('0x87')));}if(_0xfe4e('0x27')==typeof _0x3dbbc5['parameters'][_0xfe4e('0x88')]){return _0x4b972e(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x4b972e(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x266c72=_0x3dbbc5[_0xfe4e('0x37')];var _0x113e1d=_0x3dbbc5[_0xfe4e('0x89')];var _0x1ceb8d=_0x3dbbc5[_0xfe4e('0x3b')];var _0x219b9c=_0x3dbbc5[_0xfe4e('0x8a')]?_0x3dbbc5['sidebar']:_0xfe4e('0x8b');var _0x7a7f01=_0x3dbbc5['icon']?_0x3dbbc5[_0xfe4e('0x8c')]:_0xfe4e('0x8d');var _0xdc077e='';var _0x4f8fe0='';var _0x725f6='';var _0x3f933d='';var _0x31e094=_0x3dbbc5[_0xfe4e('0x7e')];if(_0x1ceb8d===_0xfe4e('0x8e')){if('undefined'!=typeof _0x3dbbc5[_0xfe4e('0x80')][_0xfe4e('0x82')][_0xfe4e('0x83')]){var _0x4a66e4=_0x3dbbc5['parameters'][_0xfe4e('0x82')][_0xfe4e('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xfe4e('0x8f')](_0x4a66e4)){_0xdc077e=path[_0xfe4e('0x56')](_0xfe4e('0x90'),_0x817e14,_0x4cc341[0x0],_0x4a66e4);}else{_0xdc077e=_0x4a66e4;}}else{logger[_0xfe4e('0x6c')](_0xfe4e('0x91'));}if(_0xfe4e('0x27')!=typeof _0x3dbbc5[_0xfe4e('0x80')][_0xfe4e('0x82')]['agent']){var _0x391941=_0x3dbbc5[_0xfe4e('0x80')][_0xfe4e('0x82')][_0xfe4e('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xfe4e('0x8f')](_0x391941)){_0x4f8fe0=path[_0xfe4e('0x56')](_0xfe4e('0x90'),_0x817e14,_0x4cc341[0x0],_0x391941);}else{_0x4f8fe0=_0x391941;}}else{logger[_0xfe4e('0x6c')](_0xfe4e('0x92'));}}else if(_0x1ceb8d==='script'){_0x725f6=_0x3dbbc5[_0xfe4e('0x80')][_0xfe4e('0x93')];_0x3f933d=_0x3dbbc5[_0xfe4e('0x80')][_0xfe4e('0x88')];if('undefined'!=typeof _0x3dbbc5[_0xfe4e('0x80')][_0xfe4e('0x82')]){if('undefined'!=typeof _0x3dbbc5[_0xfe4e('0x80')][_0xfe4e('0x82')][_0xfe4e('0x83')]){var _0x4a66e4=_0x3dbbc5[_0xfe4e('0x80')][_0xfe4e('0x82')][_0xfe4e('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4a66e4)){_0xdc077e=path['join'](_0xfe4e('0x90'),_0x817e14,_0x4cc341[0x0],_0x4a66e4);}else{_0xdc077e=_0x4a66e4;}}if('undefined'!=typeof _0x3dbbc5[_0xfe4e('0x80')]['views'][_0xfe4e('0x84')]){var _0x391941=_0x3dbbc5['parameters']['views'][_0xfe4e('0x84')];if(!/^(f|ht)tps?:\/\//i['test'](_0x391941)){_0x4f8fe0=path[_0xfe4e('0x56')](_0xfe4e('0x90'),_0x817e14,_0x4cc341[0x0],_0x391941);}else{_0x4f8fe0=_0x391941;}}}}var _0x52193a={'name':_0x266c72,'description':_0x113e1d,'path':path[_0xfe4e('0x56')](_0x817e14,_0x4cc341[0x0]),'type':_0x1ceb8d,'sidebar':_0x219b9c,'icon':_0x7a7f01,'adminUrl':_0xdc077e,'agentUrl':_0x4f8fe0,'scriptName':_0x725f6,'scriptPath':_0x3f933d,'version':_0x31e094};removeReferences(_0x2593a0,null);return db[_0xfe4e('0x4b')]['create'](_0x52193a)[_0xfe4e('0x30')](function(_0x9b97c9){var _0x1c1b35={'role':_0x3bc187[_0xfe4e('0x94')][_0xfe4e('0x95')],'userProfileId':_0x3bc187[_0xfe4e('0x94')][_0xfe4e('0x96')]};if(!_0x1c1b35)throw new Error(_0xfe4e('0x97'));if(_0x1c1b35[_0xfe4e('0x95')]===_0xfe4e('0x98')){var _0x2a5c3f=_0x9b97c9[_0xfe4e('0x31')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Plugins','userProfileId':_0x1c1b35['userProfileId']},'raw':!![]})['then'](function(_0x4c9551){if(_0x4c9551&&_0x4c9551[_0xfe4e('0x99')]===0x0){return db[_0xfe4e('0x33')]['create']({'name':_0x2a5c3f[_0xfe4e('0x37')],'resourceId':_0x2a5c3f['id'],'type':_0x4c9551['name'],'sectionId':_0x4c9551['id']},{})[_0xfe4e('0x30')](function(){return _0x9b97c9;});}else{return _0x9b97c9;}})[_0xfe4e('0x50')](function(_0x443a54){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x443a54);throw _0x443a54;});}return _0x9b97c9;})[_0xfe4e('0x30')](respondWithResult(_0x5996ca,null))[_0xfe4e('0x50')](handleError(_0x5996ca,null));}});}catch(_0x255a57){_0x5996ca[_0xfe4e('0x22')](0x1f4)[_0xfe4e('0x38')](_0x255a57);}};function removeReferences(_0x34f204,_0x327dd6){try{if(_0x34f204){fs[_0xfe4e('0x6b')](_0x34f204);logger[_0xfe4e('0x6c')](_0xfe4e('0x9a'));}if(_0x327dd6){rimraf(_0x327dd6,function(){});logger[_0xfe4e('0x6c')](_0xfe4e('0x9b'));}}catch(_0x24500e){logger[_0xfe4e('0x35')](_0x24500e);}}exports[_0xfe4e('0x2e')]=function(_0x4ee590,_0x40e376,_0x31d35f){return db[_0xfe4e('0x4b')][_0xfe4e('0x54')]({'where':{'id':_0x4ee590['params']['id']}})[_0xfe4e('0x30')](handleEntityNotFound(_0x40e376,null))[_0xfe4e('0x30')](saveUpdates(_0x4ee590['body'],null))[_0xfe4e('0x30')](respondWithResult(_0x40e376,null))[_0xfe4e('0x50')](handleError(_0x40e376,null));};exports[_0xfe4e('0x9c')]=function(_0x36e60f,_0x5eab29,_0x49c540){return db[_0xfe4e('0x4b')][_0xfe4e('0x54')]({'where':{'id':_0x36e60f[_0xfe4e('0x52')]['id']}})['then'](function(_0x235b31){if(_0x235b31){return _0x235b31[_0xfe4e('0x2f')]();}})[_0xfe4e('0x30')](function(_0x396954){rimraf(path[_0xfe4e('0x56')](config[_0xfe4e('0x57')],_0xfe4e('0x58'),path[_0xfe4e('0x9d')](_0x396954[_0xfe4e('0x6')])),function(){});return _0x396954;})[_0xfe4e('0x30')](handleEntityNotFound(_0x5eab29,null))[_0xfe4e('0x30')](respondWithStatusCode(_0x5eab29,null))[_0xfe4e('0x50')](handleError(_0x5eab29,null));};exports[_0xfe4e('0x9e')]=function(_0x2d95dd,_0x1b530c,_0x29f607){return BPromise[_0xfe4e('0x9f')]()[_0xfe4e('0x30')](function(){if(!_0x2d95dd['query'][_0xfe4e('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2d95dd[_0xfe4e('0x3e')][_0xfe4e('0xa0')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3a74f4=_0x2d95dd[_0xfe4e('0x3e')]['hostname']?_0x2d95dd[_0xfe4e('0x3e')]['hostname']+':'+_0x2d95dd[_0xfe4e('0x3e')][_0xfe4e('0xa0')]:_0xfe4e('0xa1')+_0x2d95dd[_0xfe4e('0x3e')]['port'];var _0x30ec0e=_0x2d95dd['query'][_0xfe4e('0x24')]?_0x2d95dd[_0xfe4e('0x3e')]['json']:!![];var _0x507254=_0x2d95dd[_0xfe4e('0x3e')][_0xfe4e('0xa2')]?_0x2d95dd['query']['encoding']:null;var _0x38d5a3={'method':_0x2d95dd[_0xfe4e('0xa3')],'uri':util[_0xfe4e('0x59')]('%s%s',_0x3a74f4,_0x2d95dd['query'][_0xfe4e('0x6')]),'json':_0x30ec0e,'resolveWithFullResponse':!![],'encoding':_0x507254,'qs':_0x2d95dd[_0xfe4e('0x3e')]};if(_0x2d95dd[_0xfe4e('0xa4')]){_0x38d5a3['headers']=_0x2d95dd[_0xfe4e('0xa4')];if(_0x38d5a3[_0xfe4e('0xa4')]['content-length']){delete _0x38d5a3[_0xfe4e('0xa4')][_0xfe4e('0xa5')];}}if(_0x38d5a3[_0xfe4e('0xa4')]['content-type']){delete _0x38d5a3[_0xfe4e('0xa4')]['content-type'];}return rp(_0x38d5a3);})[_0xfe4e('0x30')](function(_0x3d035d){if(_0x3d035d){_0x1b530c['set'](_0x3d035d[_0xfe4e('0xa4')]);logger[_0xfe4e('0x6c')](_0x3d035d['body']);if(_[_0xfe4e('0xa6')](_0x2d95dd[_0xfe4e('0x3e')][_0xfe4e('0x6')],_0xfe4e('0x55'))&&_0x3d035d[_0xfe4e('0xa7')]==0x1f4){return _0x1b530c[_0xfe4e('0x34')](_0x3d035d['statusCode']);}else{return _0x1b530c[_0xfe4e('0x22')](_0x3d035d[_0xfe4e('0xa7')])[_0xfe4e('0x38')](_0x3d035d[_0xfe4e('0x94')]);}}else{return _0x1b530c[_0xfe4e('0x34')](0xc8);}})['catch'](handleError(_0x1b530c,null));};exports[_0xfe4e('0xa8')]=function(_0xd9004b,_0x16c927,_0x863c41){return BPromise[_0xfe4e('0x9f')]()[_0xfe4e('0x30')](function(){if(!_0xd9004b[_0xfe4e('0x3e')]['path']){throw new Error(_0xfe4e('0xa9'));}if(!_0xd9004b[_0xfe4e('0x3e')][_0xfe4e('0xa0')]){throw new Error(_0xfe4e('0xaa'));}var _0x49afab=_0xd9004b[_0xfe4e('0x3e')][_0xfe4e('0xab')]?_0xd9004b[_0xfe4e('0x3e')][_0xfe4e('0xab')]+':'+_0xd9004b[_0xfe4e('0x3e')][_0xfe4e('0xa0')]:'http://localhost:'+_0xd9004b['query'][_0xfe4e('0xa0')];var _0x5f434f=_0xd9004b[_0xfe4e('0x3e')][_0xfe4e('0x24')]?_0xd9004b[_0xfe4e('0x3e')]['json']:!![];var _0x583ff4=_0xd9004b['query'][_0xfe4e('0xa2')]?_0xd9004b[_0xfe4e('0x3e')][_0xfe4e('0xa2')]:null;var _0x3ebbbf={'method':_0xd9004b[_0xfe4e('0xa3')],'uri':util[_0xfe4e('0x59')](_0xfe4e('0xac'),_0x49afab,_0xd9004b[_0xfe4e('0x3e')][_0xfe4e('0x6')]),'json':_0x5f434f,'resolveWithFullResponse':!![],'encoding':_0x583ff4,'body':_0xd9004b[_0xfe4e('0x94')]};if(_0xd9004b[_0xfe4e('0xa4')]){_0x3ebbbf['headers']=_0xd9004b[_0xfe4e('0xa4')];if(_0x3ebbbf['headers'][_0xfe4e('0xa5')]){delete _0x3ebbbf[_0xfe4e('0xa4')]['content-length'];}}if(_0x3ebbbf[_0xfe4e('0xa4')]['content-type']){delete _0x3ebbbf['headers'][_0xfe4e('0xad')];}return rp(_0x3ebbbf);})['then'](function(_0x106b7b){if(_0x106b7b){_0x16c927[_0xfe4e('0x29')](_0x106b7b[_0xfe4e('0xa4')]);logger[_0xfe4e('0x6c')](_0x106b7b[_0xfe4e('0x94')]);return _0x16c927[_0xfe4e('0x22')](_0x106b7b[_0xfe4e('0xa7')])[_0xfe4e('0x38')](_0x106b7b[_0xfe4e('0x94')]);}else{return _0x16c927[_0xfe4e('0x34')](0xc8);}})[_0xfe4e('0x50')](handleError(_0x16c927,null));}; \ No newline at end of file +var _0x76a4=['close','Plugin\x20not\x20found','unlinkSync','info','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','headers','endsWith','statusCode','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','content-length','content-type','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','extract-zip','archiver','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Plugins','UserProfileResource','sendStatus','stack','name','index','map','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Plugin','includeAll','include','findAll','rows','catch','params','rawAttributes','length','download','find','root','server/files/plugins','format','%s.zip','zip','warning','code','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','join','dirname','basename','attachments/**/*'];(function(_0x3ee02f,_0x13e829){var _0x28854c=function(_0xb39b47){while(--_0xb39b47){_0x3ee02f['push'](_0x3ee02f['shift']());}};_0x28854c(++_0x13e829);}(_0x76a4,0xeb));var _0x476a=function(_0x3fc017,_0x288faf){_0x3fc017=_0x3fc017-0x0;var _0x542e8c=_0x76a4[_0x3fc017];return _0x542e8c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x476a('0x0'));var zipdir=require(_0x476a('0x1'));var jsonpatch=require(_0x476a('0x2'));var rp=require(_0x476a('0x3'));var moment=require('moment');var BPromise=require(_0x476a('0x4'));var Mustache=require(_0x476a('0x5'));var util=require(_0x476a('0x6'));var path=require(_0x476a('0x7'));var sox=require(_0x476a('0x8'));var csv=require(_0x476a('0x9'));var ejs=require(_0x476a('0xa'));var fs=require('fs');var fs_extra=require(_0x476a('0xb'));var _=require(_0x476a('0xc'));var squel=require(_0x476a('0xd'));var crypto=require('crypto');var jsforce=require(_0x476a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x476a('0x9'));var querystring=require(_0x476a('0xf'));var Papa=require('papaparse');var extract=require(_0x476a('0x10'));var rimraf=require(_0x476a('0x0'));var archiver=require(_0x476a('0x11'));var Redis=require('ioredis');var authService=require(_0x476a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x476a('0x13'));var hardwareService=require(_0x476a('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x476a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x476a('0x16'));var db=require('../../mysqldb')['db'];config[_0x476a('0x17')]=_[_0x476a('0x18')](config[_0x476a('0x17')],{'host':_0x476a('0x19'),'port':0x18eb});var socket=require(_0x476a('0x1a'))(new Redis(config[_0x476a('0x17')]));require(_0x476a('0x1b'))[_0x476a('0x1c')](socket);function respondWithStatusCode(_0x46a57d,_0xd6560){_0xd6560=_0xd6560||0xcc;return function(_0x6c6999){if(_0x6c6999){return _0x46a57d['sendStatus'](_0xd6560);}return _0x46a57d[_0x476a('0x1d')](_0xd6560)[_0x476a('0x1e')]();};}function respondWithResult(_0x3b7fba,_0x511114){_0x511114=_0x511114||0xc8;return function(_0x4b5aee){if(_0x4b5aee){return _0x3b7fba[_0x476a('0x1d')](_0x511114)[_0x476a('0x1f')](_0x4b5aee);}};}function respondWithFilteredResult(_0x454475,_0xe50d82){return function(_0x5a6a91){if(_0x5a6a91){var _0x29d87d=typeof _0xe50d82[_0x476a('0x20')]===_0x476a('0x21')&&typeof _0xe50d82[_0x476a('0x22')]===_0x476a('0x21');var _0x30da58=_0x5a6a91['count'];var _0x5de7f3=_0x29d87d?0x0:_0xe50d82['offset'];var _0x277818=_0x29d87d?_0x5a6a91[_0x476a('0x23')]:_0xe50d82[_0x476a('0x20')]+_0xe50d82[_0x476a('0x22')];var _0x3f0ed3;if(_0x277818>=_0x30da58){_0x277818=_0x30da58;_0x3f0ed3=0xc8;}else{_0x3f0ed3=0xce;}_0x454475[_0x476a('0x1d')](_0x3f0ed3);return _0x454475[_0x476a('0x24')](_0x476a('0x25'),_0x5de7f3+'-'+_0x277818+'/'+_0x30da58)['json'](_0x5a6a91);}return null;};}function patchUpdates(_0x122b8e){return function(_0xae3296){try{jsonpatch[_0x476a('0x26')](_0xae3296,_0x122b8e,!![]);}catch(_0x48029e){return BPromise[_0x476a('0x27')](_0x48029e);}return _0xae3296[_0x476a('0x28')]();};}function saveUpdates(_0x2a288d,_0x2786ed){return function(_0x174b96){if(_0x174b96){return _0x174b96[_0x476a('0x29')](_0x2a288d)['then'](function(_0x38921c){return _0x38921c;});}return null;};}function removeEntity(_0x3aa63f,_0x15f461){return function(_0x435fee){if(_0x435fee){return _0x435fee['destroy']()[_0x476a('0x2a')](function(){var _0x8ec758=_0x435fee[_0x476a('0x2b')]({'plain':!![]});var _0x39a305=_0x476a('0x2c');return db[_0x476a('0x2d')]['destroy']({'where':{'type':_0x39a305,'resourceId':_0x8ec758['id']}})[_0x476a('0x2a')](function(){return _0x435fee;});})[_0x476a('0x2a')](function(){_0x3aa63f[_0x476a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29f394,_0x3a9446){return function(_0x9d9149){if(!_0x9d9149){_0x29f394[_0x476a('0x2e')](0x194);}return _0x9d9149;};}function handleError(_0x18a12a,_0x3654e1){_0x3654e1=_0x3654e1||0x1f4;return function(_0xbcf35){logger['error'](_0xbcf35[_0x476a('0x2f')]);if(_0xbcf35[_0x476a('0x30')]){delete _0xbcf35[_0x476a('0x30')];}_0x18a12a[_0x476a('0x1d')](_0x3654e1)['send'](_0xbcf35);};}exports[_0x476a('0x31')]=function(_0x4cd67c,_0x45744e){var _0x3f73e3={},_0x488193={},_0x4587ff={'count':0x0,'rows':[]};var _0x405872=_[_0x476a('0x32')](db['Plugin']['rawAttributes'],function(_0x511f65){return{'name':_0x511f65[_0x476a('0x33')],'type':_0x511f65[_0x476a('0x34')][_0x476a('0x35')]};});_0x488193[_0x476a('0x36')]=_[_0x476a('0x32')](_0x405872,'name');_0x488193['query']=_[_0x476a('0x37')](_0x4cd67c[_0x476a('0x38')]);_0x488193[_0x476a('0x39')]=_[_0x476a('0x3a')](_0x488193[_0x476a('0x36')],_0x488193[_0x476a('0x38')]);_0x3f73e3['attributes']=_[_0x476a('0x3a')](_0x488193[_0x476a('0x36')],qs['fields'](_0x4cd67c['query'][_0x476a('0x3b')]));_0x3f73e3['attributes']=_0x3f73e3[_0x476a('0x3c')]['length']?_0x3f73e3[_0x476a('0x3c')]:_0x488193['model'];if(!_0x4cd67c[_0x476a('0x38')]['hasOwnProperty'](_0x476a('0x3d'))){_0x3f73e3[_0x476a('0x22')]=qs[_0x476a('0x22')](_0x4cd67c[_0x476a('0x38')][_0x476a('0x22')]);_0x3f73e3[_0x476a('0x20')]=qs[_0x476a('0x20')](_0x4cd67c[_0x476a('0x38')][_0x476a('0x20')]);}_0x3f73e3[_0x476a('0x3e')]=qs[_0x476a('0x3f')](_0x4cd67c[_0x476a('0x38')][_0x476a('0x3f')]);_0x3f73e3[_0x476a('0x40')]=qs['filters'](_[_0x476a('0x41')](_0x4cd67c[_0x476a('0x38')],_0x488193['filters']),_0x405872);if(_0x4cd67c[_0x476a('0x38')]['filter']){_0x3f73e3[_0x476a('0x40')]=_[_0x476a('0x42')](_0x3f73e3[_0x476a('0x40')],{'$or':_[_0x476a('0x32')](_0x405872,function(_0x97ebeb){if(_0x97ebeb[_0x476a('0x34')]!==_0x476a('0x43')){var _0x39f2f4={};_0x39f2f4[_0x97ebeb['name']]={'$like':'%'+_0x4cd67c['query'][_0x476a('0x44')]+'%'};return _0x39f2f4;}})});}_0x3f73e3=_['merge']({},_0x3f73e3,_0x4cd67c[_0x476a('0x45')]);var _0x2725a2={'where':_0x3f73e3[_0x476a('0x40')]};return db[_0x476a('0x46')]['count'](_0x2725a2)[_0x476a('0x2a')](function(_0x5b3d62){_0x4587ff[_0x476a('0x23')]=_0x5b3d62;if(_0x4cd67c[_0x476a('0x38')][_0x476a('0x47')]){_0x3f73e3[_0x476a('0x48')]=[{'all':!![]}];}return db[_0x476a('0x46')][_0x476a('0x49')](_0x3f73e3);})[_0x476a('0x2a')](function(_0x1d2104){_0x4587ff[_0x476a('0x4a')]=_0x1d2104;return _0x4587ff;})['then'](respondWithFilteredResult(_0x45744e,_0x3f73e3))[_0x476a('0x4b')](handleError(_0x45744e,null));};exports['show']=function(_0x242276,_0x17c8dd){var _0x2ee9d2={'raw':!![],'where':{'id':_0x242276[_0x476a('0x4c')]['id']}},_0x4e01c8={};_0x4e01c8[_0x476a('0x36')]=_[_0x476a('0x37')](db[_0x476a('0x46')][_0x476a('0x4d')]);_0x4e01c8[_0x476a('0x38')]=_['keys'](_0x242276[_0x476a('0x38')]);_0x4e01c8[_0x476a('0x39')]=_[_0x476a('0x3a')](_0x4e01c8[_0x476a('0x36')],_0x4e01c8[_0x476a('0x38')]);_0x2ee9d2['attributes']=_[_0x476a('0x3a')](_0x4e01c8[_0x476a('0x36')],qs[_0x476a('0x3b')](_0x242276[_0x476a('0x38')]['fields']));_0x2ee9d2[_0x476a('0x3c')]=_0x2ee9d2[_0x476a('0x3c')][_0x476a('0x4e')]?_0x2ee9d2[_0x476a('0x3c')]:_0x4e01c8[_0x476a('0x36')];if(_0x242276[_0x476a('0x38')][_0x476a('0x47')]){_0x2ee9d2[_0x476a('0x48')]=[{'all':!![]}];}_0x2ee9d2=_[_0x476a('0x42')]({},_0x2ee9d2,_0x242276['options']);return db[_0x476a('0x46')]['find'](_0x2ee9d2)['then'](handleEntityNotFound(_0x17c8dd,null))['then'](respondWithResult(_0x17c8dd,null))[_0x476a('0x4b')](handleError(_0x17c8dd,null));};exports[_0x476a('0x4f')]=function(_0x1bf1d8,_0x2ad59a,_0x1df165){return db[_0x476a('0x46')][_0x476a('0x50')]({'where':{'id':_0x1bf1d8[_0x476a('0x4c')]['id']},'attributes':[_0x476a('0x30'),'path'],'raw':!![]})['then'](handleEntityNotFound(_0x2ad59a,null))[_0x476a('0x2a')](function(_0x14b1bd){if(_0x14b1bd){var _0x4d573a=path['join'](config[_0x476a('0x51')],_0x476a('0x52'),util[_0x476a('0x53')](_0x476a('0x54'),path['basename'](_0x14b1bd[_0x476a('0x7')])));var _0x12f9c1=fs['createWriteStream'](_0x4d573a);var _0x15dabf=archiver(_0x476a('0x55'),{'zlib':{'level':0x9}});_0x15dabf['on'](_0x476a('0x56'),function(_0x21a527){if(_0x21a527[_0x476a('0x57')]===_0x476a('0x58')){logger[_0x476a('0x59')](_0x21a527);}else{throw new db[(_0x476a('0x5a'))][(_0x476a('0x5b'))](_0x476a('0x5c'));}});_0x15dabf['on'](_0x476a('0x59'),function(_0x1fc988){throw new db['Sequelize']['Error'](_0x476a('0x5c'));});_0x15dabf['pipe'](_0x12f9c1);_0x15dabf[_0x476a('0x5d')](_0x476a('0x5e'),{'cwd':path[_0x476a('0x5f')](config[_0x476a('0x51')],_0x476a('0x52'),path[_0x476a('0x60')](_0x14b1bd[_0x476a('0x7')])),'ignore':[path['join'](path['basename'](_0x14b1bd['path']),'node_modules/**/*'),path[_0x476a('0x5f')](path[_0x476a('0x61')](_0x14b1bd[_0x476a('0x7')]),_0x476a('0x62'))],'nodir':!![]})['finalize']();_0x12f9c1['on'](_0x476a('0x63'),function(){if(!fs['existsSync'](_0x4d573a)){throw new db[(_0x476a('0x5a'))]['Error'](_0x476a('0x64'));}return _0x2ad59a[_0x476a('0x4f')](_0x4d573a,util[_0x476a('0x53')]('%s.zip',path[_0x476a('0x61')](_0x14b1bd[_0x476a('0x7')])),function(_0x2578f3){if(_0x2578f3){throw new db[(_0x476a('0x5a'))][(_0x476a('0x5b'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x476a('0x65')](_0x4d573a);logger[_0x476a('0x66')]('Download\x20completed');logger[_0x476a('0x66')]('Temporary\x20file\x20removed');});});}return null;})[_0x476a('0x4b')](handleError(_0x2ad59a,null));};exports['upload']=function(_0x13fc39,_0x354260,_0x5f0faa){var _0x247766=path[_0x476a('0x61')](_0x13fc39[_0x476a('0x67')][_0x476a('0x68')],path[_0x476a('0x69')](_0x13fc39[_0x476a('0x67')][_0x476a('0x68')]));var _0x198b03=path[_0x476a('0x5f')](config[_0x476a('0x51')],_0x476a('0x52'),_0x13fc39[_0x476a('0x67')]['filename']);var _0x723705=path[_0x476a('0x5f')](config[_0x476a('0x51')],_0x476a('0x52'),_0x247766);logger[_0x476a('0x66')](_0x476a('0x6a'),_0x198b03);logger[_0x476a('0x66')]('Plugin\x20upload\x20destination:\x20%s',_0x723705);try{fs[_0x476a('0x6b')](_0x198b03,parseInt(_0x476a('0x6c'),0x8));extract(_0x198b03,{'dir':_0x723705},function(_0x10937b){if(_0x10937b){logger[_0x476a('0x59')](_0x10937b);handleError(_0x10937b,!![]);};var _0x3175a9=fs[_0x476a('0x6d')](_0x723705);if(_0x3175a9[_0x476a('0x4e')]>0x1){removeReferences(_0x198b03,_0x723705);logger[_0x476a('0x59')](_0x476a('0x6e'));return _0x5f0faa(new Error(_0x476a('0x6e')));}var _0x1fde4b=fs['lstatSync'](path[_0x476a('0x5f')](_0x723705,_0x3175a9[0x0]));if(_0x1fde4b['isFile']()){removeReferences(_0x198b03,_0x723705);logger[_0x476a('0x59')](_0x476a('0x6e'));return _0x5f0faa(new Error(_0x476a('0x6e')));}if(_0x1fde4b[_0x476a('0x6f')]()){var _0x232c0b=fs[_0x476a('0x6d')](path['join'](_0x723705,_0x3175a9[0x0]));if(_0x232c0b['length']===0x0){removeReferences(_0x198b03,_0x723705);logger[_0x476a('0x59')]('Invalid\x20plugin\x20structure');return _0x5f0faa(new Error(_0x476a('0x6e')));}var _0x5a4e80=_0x232c0b['some'](function(_0x12680c){return _0x12680c===_0x476a('0x70');});if(!_0x5a4e80){return _0x5f0faa(new Error(_0x476a('0x71')));}var _0x5b336b=fs[_0x476a('0x72')](path[_0x476a('0x5f')](_0x723705,_0x3175a9[0x0],'manifest.json'));var _0x3321bf=JSON[_0x476a('0x73')](_0x5b336b);if(_0x476a('0x21')==typeof _0x3321bf[_0x476a('0x30')]){return _0x5f0faa(new Error(_0x476a('0x74')));}if(_0x476a('0x21')==typeof _0x3321bf[_0x476a('0x34')]){return _0x5f0faa(new Error(_0x476a('0x75')));}if('undefined'==typeof _0x3321bf[_0x476a('0x76')]){return _0x5f0faa(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x3321bf[_0x476a('0x77')]){return _0x5f0faa(new Error(_0x476a('0x78')));}if(_0x3321bf[_0x476a('0x34')]===_0x476a('0x79')){if('undefined'==typeof _0x3321bf[_0x476a('0x77')][_0x476a('0x7a')]){return _0x5f0faa(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x3321bf['parameters'][_0x476a('0x7a')][_0x476a('0x7b')]&&_0x476a('0x21')==typeof _0x3321bf['parameters'][_0x476a('0x7a')][_0x476a('0x7c')]){return _0x5f0faa(new Error(_0x476a('0x7d')));}}else if(_0x3321bf[_0x476a('0x34')]==='script'){if('undefined'==typeof _0x3321bf['parameters'][_0x476a('0x7e')]){return _0x5f0faa(new Error(_0x476a('0x7f')));}if(_0x476a('0x21')==typeof _0x3321bf[_0x476a('0x77')][_0x476a('0x80')]){return _0x5f0faa(new Error(_0x476a('0x81')));}}else{return _0x5f0faa(new Error(_0x476a('0x82')));}var _0xc9f2f1=_0x3321bf['name'];var _0x4865b9=_0x3321bf[_0x476a('0x83')];var _0x57a4e1=_0x3321bf[_0x476a('0x34')];var _0x4de128=_0x3321bf[_0x476a('0x84')]?_0x3321bf[_0x476a('0x84')]:_0x476a('0x85');var _0x20b476=_0x3321bf[_0x476a('0x86')]?_0x3321bf[_0x476a('0x86')]:_0x476a('0x87');var _0x26d45f='';var _0x21272c='';var _0x2b9329='';var _0x11cba6='';var _0x5042c0=_0x3321bf[_0x476a('0x76')];if(_0x57a4e1===_0x476a('0x79')){if(_0x476a('0x21')!=typeof _0x3321bf[_0x476a('0x77')][_0x476a('0x7a')][_0x476a('0x7b')]){var _0x454aa6=_0x3321bf['parameters'][_0x476a('0x7a')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x476a('0x88')](_0x454aa6)){_0x26d45f=path[_0x476a('0x5f')](_0x476a('0x89'),_0x247766,_0x3175a9[0x0],_0x454aa6);}else{_0x26d45f=_0x454aa6;}}else{logger[_0x476a('0x66')](_0x476a('0x8a'));}if(_0x476a('0x21')!=typeof _0x3321bf[_0x476a('0x77')][_0x476a('0x7a')][_0x476a('0x7c')]){var _0x32703c=_0x3321bf['parameters'][_0x476a('0x7a')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x476a('0x88')](_0x32703c)){_0x21272c=path[_0x476a('0x5f')](_0x476a('0x89'),_0x247766,_0x3175a9[0x0],_0x32703c);}else{_0x21272c=_0x32703c;}}else{logger[_0x476a('0x66')](_0x476a('0x8b'));}}else if(_0x57a4e1===_0x476a('0x8c')){_0x2b9329=_0x3321bf['parameters']['scriptName'];_0x11cba6=_0x3321bf['parameters'][_0x476a('0x80')];if('undefined'!=typeof _0x3321bf[_0x476a('0x77')][_0x476a('0x7a')]){if(_0x476a('0x21')!=typeof _0x3321bf['parameters'][_0x476a('0x7a')][_0x476a('0x7b')]){var _0x454aa6=_0x3321bf[_0x476a('0x77')][_0x476a('0x7a')][_0x476a('0x7b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x454aa6)){_0x26d45f=path[_0x476a('0x5f')]('plugins',_0x247766,_0x3175a9[0x0],_0x454aa6);}else{_0x26d45f=_0x454aa6;}}if('undefined'!=typeof _0x3321bf[_0x476a('0x77')][_0x476a('0x7a')][_0x476a('0x7c')]){var _0x32703c=_0x3321bf['parameters'][_0x476a('0x7a')][_0x476a('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x32703c)){_0x21272c=path['join'](_0x476a('0x89'),_0x247766,_0x3175a9[0x0],_0x32703c);}else{_0x21272c=_0x32703c;}}}}var _0x3e6380={'name':_0xc9f2f1,'description':_0x4865b9,'path':path['join'](_0x247766,_0x3175a9[0x0]),'type':_0x57a4e1,'sidebar':_0x4de128,'icon':_0x20b476,'adminUrl':_0x26d45f,'agentUrl':_0x21272c,'scriptName':_0x2b9329,'scriptPath':_0x11cba6,'version':_0x5042c0};removeReferences(_0x198b03,null);return db[_0x476a('0x46')][_0x476a('0x8d')](_0x3e6380)['then'](function(_0x54dce4){var _0x1d429e={'role':_0x13fc39[_0x476a('0x8e')][_0x476a('0x8f')],'userProfileId':_0x13fc39['body'][_0x476a('0x90')]};if(!_0x1d429e)throw new Error(_0x476a('0x91'));if(_0x1d429e['role']===_0x476a('0x92')){var _0x34d53f=_0x54dce4[_0x476a('0x2b')]({'plain':!![]});return db[_0x476a('0x93')]['find']({'where':{'name':_0x476a('0x2c'),'userProfileId':_0x1d429e[_0x476a('0x90')]},'raw':!![]})['then'](function(_0x3721ce){if(_0x3721ce&&_0x3721ce['autoAssociation']===0x0){return db[_0x476a('0x2d')][_0x476a('0x8d')]({'name':_0x34d53f[_0x476a('0x30')],'resourceId':_0x34d53f['id'],'type':_0x3721ce[_0x476a('0x30')],'sectionId':_0x3721ce['id']},{})[_0x476a('0x2a')](function(){return _0x54dce4;});}else{return _0x54dce4;}})[_0x476a('0x4b')](function(_0xfc94d6){logger[_0x476a('0x59')](_0x476a('0x94'),_0xfc94d6);throw _0xfc94d6;});}return _0x54dce4;})[_0x476a('0x2a')](respondWithResult(_0x354260,null))[_0x476a('0x4b')](handleError(_0x354260,null));}});}catch(_0x122722){_0x354260[_0x476a('0x1d')](0x1f4)[_0x476a('0x95')](_0x122722);}};function removeReferences(_0x4c15b3,_0x130deb){try{if(_0x4c15b3){fs[_0x476a('0x65')](_0x4c15b3);logger['info'](_0x476a('0x96'));}if(_0x130deb){rimraf(_0x130deb,function(){});logger['info'](_0x476a('0x97'));}}catch(_0x3d5f55){logger[_0x476a('0x59')](_0x3d5f55);}}exports['update']=function(_0x11bb2f,_0x33f05b,_0x481269){return db[_0x476a('0x46')][_0x476a('0x50')]({'where':{'id':_0x11bb2f[_0x476a('0x4c')]['id']}})[_0x476a('0x2a')](handleEntityNotFound(_0x33f05b,null))[_0x476a('0x2a')](saveUpdates(_0x11bb2f[_0x476a('0x8e')],null))[_0x476a('0x2a')](respondWithResult(_0x33f05b,null))[_0x476a('0x4b')](handleError(_0x33f05b,null));};exports[_0x476a('0x98')]=function(_0x33f0e6,_0x196283,_0x37ad06){return db[_0x476a('0x46')][_0x476a('0x50')]({'where':{'id':_0x33f0e6[_0x476a('0x4c')]['id']}})[_0x476a('0x2a')](function(_0x5853d3){if(_0x5853d3){return _0x5853d3['destroy']();}})[_0x476a('0x2a')](function(_0x43c0f6){rimraf(path[_0x476a('0x5f')](config[_0x476a('0x51')],_0x476a('0x52'),path['dirname'](_0x43c0f6[_0x476a('0x7')])),function(){});return _0x43c0f6;})[_0x476a('0x2a')](handleEntityNotFound(_0x196283,null))[_0x476a('0x2a')](respondWithStatusCode(_0x196283,null))[_0x476a('0x4b')](handleError(_0x196283,null));};exports[_0x476a('0x99')]=function(_0x167488,_0x3f5c90,_0x322dd7){return BPromise['resolve']()[_0x476a('0x2a')](function(){if(!_0x167488[_0x476a('0x38')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x167488[_0x476a('0x38')]['port']){throw new Error(_0x476a('0x9a'));}var _0x5bd59f=_0x167488['query'][_0x476a('0x9b')]?_0x167488[_0x476a('0x38')][_0x476a('0x9b')]+':'+_0x167488[_0x476a('0x38')][_0x476a('0x9c')]:_0x476a('0x9d')+_0x167488['query']['port'];var _0x32486f=_0x167488['query'][_0x476a('0x1f')]?_0x167488['query']['json']:!![];var _0x4110ae=_0x167488[_0x476a('0x38')][_0x476a('0x9e')]?_0x167488[_0x476a('0x38')]['encoding']:null;var _0xd91b26={'method':_0x167488[_0x476a('0x9f')],'uri':util[_0x476a('0x53')]('%s%s',_0x5bd59f,_0x167488[_0x476a('0x38')][_0x476a('0x7')]),'json':_0x32486f,'resolveWithFullResponse':!![],'encoding':_0x4110ae,'qs':_0x167488[_0x476a('0x38')]};if(_0x167488[_0x476a('0xa0')]){_0xd91b26[_0x476a('0xa0')]=_0x167488['headers'];if(_0xd91b26[_0x476a('0xa0')]['content-length']){delete _0xd91b26[_0x476a('0xa0')]['content-length'];}}if(_0xd91b26[_0x476a('0xa0')]['content-type']){delete _0xd91b26[_0x476a('0xa0')]['content-type'];}return rp(_0xd91b26);})['then'](function(_0x30e9a6){if(_0x30e9a6){_0x3f5c90[_0x476a('0x24')](_0x30e9a6[_0x476a('0xa0')]);logger[_0x476a('0x66')](_0x30e9a6['body']);if(_[_0x476a('0xa1')](_0x167488[_0x476a('0x38')]['path'],'download')&&_0x30e9a6['statusCode']==0x1f4){return _0x3f5c90[_0x476a('0x2e')](_0x30e9a6[_0x476a('0xa2')]);}else{return _0x3f5c90[_0x476a('0x1d')](_0x30e9a6[_0x476a('0xa2')])[_0x476a('0x95')](_0x30e9a6[_0x476a('0x8e')]);}}else{return _0x3f5c90[_0x476a('0x2e')](0xc8);}})['catch'](handleError(_0x3f5c90,null));};exports['webhookPost']=function(_0x37d616,_0x5c3621,_0x2b8239){return BPromise[_0x476a('0xa3')]()[_0x476a('0x2a')](function(){if(!_0x37d616[_0x476a('0x38')][_0x476a('0x7')]){throw new Error(_0x476a('0xa4'));}if(!_0x37d616[_0x476a('0x38')]['port']){throw new Error(_0x476a('0x9a'));}var _0x430201=_0x37d616[_0x476a('0x38')][_0x476a('0x9b')]?_0x37d616[_0x476a('0x38')][_0x476a('0x9b')]+':'+_0x37d616['query'][_0x476a('0x9c')]:_0x476a('0x9d')+_0x37d616['query']['port'];var _0x5b4af4=_0x37d616[_0x476a('0x38')][_0x476a('0x1f')]?_0x37d616['query']['json']:!![];var _0x175c9a=_0x37d616[_0x476a('0x38')][_0x476a('0x9e')]?_0x37d616[_0x476a('0x38')][_0x476a('0x9e')]:null;var _0x254e51={'method':_0x37d616[_0x476a('0x9f')],'uri':util[_0x476a('0x53')]('%s%s',_0x430201,_0x37d616[_0x476a('0x38')][_0x476a('0x7')]),'json':_0x5b4af4,'resolveWithFullResponse':!![],'encoding':_0x175c9a,'body':_0x37d616[_0x476a('0x8e')]};if(_0x37d616[_0x476a('0xa0')]){_0x254e51[_0x476a('0xa0')]=_0x37d616[_0x476a('0xa0')];if(_0x254e51['headers'][_0x476a('0xa5')]){delete _0x254e51[_0x476a('0xa0')]['content-length'];}}if(_0x254e51[_0x476a('0xa0')]['content-type']){delete _0x254e51[_0x476a('0xa0')][_0x476a('0xa6')];}return rp(_0x254e51);})['then'](function(_0x5d6c58){if(_0x5d6c58){_0x5c3621[_0x476a('0x24')](_0x5d6c58[_0x476a('0xa0')]);logger['info'](_0x5d6c58['body']);return _0x5c3621[_0x476a('0x1d')](_0x5d6c58[_0x476a('0xa2')])[_0x476a('0x95')](_0x5d6c58['body']);}else{return _0x5c3621['sendStatus'](0xc8);}})[_0x476a('0x4b')](handleError(_0x5c3621,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 78e7f05..8c183d5 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 _0x8ff3=['save','update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x4dd6f5,_0x52e39c){var _0x1d893a=function(_0x5aef09){while(--_0x5aef09){_0x4dd6f5['push'](_0x4dd6f5['shift']());}};_0x1d893a(++_0x52e39c);}(_0x8ff3,0x72));var _0x38ff=function(_0x33314d,_0x499628){_0x33314d=_0x33314d-0x0;var _0x4ffe8e=_0x8ff3[_0x33314d];return _0x4ffe8e;};'use strict';var EventEmitter=require(_0x38ff('0x0'));var Plugin=require(_0x38ff('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x38ff('0x2')](0x0);var events={'afterCreate':_0x38ff('0x3'),'afterUpdate':_0x38ff('0x4'),'afterDestroy':_0x38ff('0x5')};function emitEvent(_0x33ac8d){return function(_0x5bf243,_0x5f377c,_0x35d87f){PluginEvents['emit'](_0x33ac8d+':'+_0x5bf243['id'],_0x5bf243);PluginEvents[_0x38ff('0x6')](_0x33ac8d,_0x5bf243);_0x35d87f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x38ff('0x7')](e,emitEvent(event));}}module[_0x38ff('0x8')]=PluginEvents; \ No newline at end of file +var _0x432b=['hook','exports','events','Plugin','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xb432('0x0'));var Plugin=require('../../mysqldb')['db'][_0xb432('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xb432('0x2')](0x0);var events={'afterCreate':_0xb432('0x3'),'afterUpdate':_0xb432('0x4'),'afterDestroy':'remove'};function emitEvent(_0x525deb){return function(_0x93e722,_0x4cefc4,_0x4541d3){PluginEvents['emit'](_0x525deb+':'+_0x93e722['id'],_0x93e722);PluginEvents[_0xb432('0x5')](_0x525deb,_0x93e722);_0x4541d3(null);};}for(var e in events){if(events[_0xb432('0x6')](e)){var event=events[e];Plugin[_0xb432('0x7')](e,emitEvent(event));}}module[_0xb432('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index bad6fa6..74ef707 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 _0xc99b=['rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0xc99b,0x192));var _0xbc99=function(_0x784768,_0x3d0c75){_0x784768=_0x784768-0x0;var _0x3b76fc=_0xc99b[_0x784768];return _0x3b76fc;};'use strict';var _=require(_0xbc99('0x0'));var util=require('util');var logger=require(_0xbc99('0x1'))('api');var moment=require(_0xbc99('0x2'));var BPromise=require(_0xbc99('0x3'));var rp=require(_0xbc99('0x4'));var fs=require('fs');var path=require(_0xbc99('0x5'));var rimraf=require(_0xbc99('0x6'));var config=require(_0xbc99('0x7'));var attributes=require(_0xbc99('0x8'));module[_0xbc99('0x9')]=function(_0x4977b1,_0xbdce80){return _0x4977b1[_0xbc99('0xa')](_0xbc99('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf98=['path','rimraf','./plugin.attributes','exports','Plugin','plugins','api','moment','bluebird','request-promise'];(function(_0x281b5b,_0x3ddbfb){var _0x7d4d72=function(_0x25bcfa){while(--_0x25bcfa){_0x281b5b['push'](_0x281b5b['shift']());}};_0x7d4d72(++_0x3ddbfb);}(_0xbf98,0x132));var _0x8bf9=function(_0x545e86,_0x46a2ed){_0x545e86=_0x545e86-0x0;var _0xa98055=_0xbf98[_0x545e86];return _0xa98055;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8bf9('0x0'));var moment=require(_0x8bf9('0x1'));var BPromise=require(_0x8bf9('0x2'));var rp=require(_0x8bf9('0x3'));var fs=require('fs');var path=require(_0x8bf9('0x4'));var rimraf=require(_0x8bf9('0x5'));var config=require('../../config/environment');var attributes=require(_0x8bf9('0x6'));module[_0x8bf9('0x7')]=function(_0x385f73,_0x4a901e){return _0x385f73['define'](_0x8bf9('0x8'),attributes,{'tableName':_0x8bf9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index f6be291..e23bb64 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 _0x1d3d=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','stringify'];(function(_0x246b38,_0x245881){var _0x4d9fe4=function(_0xdcceb0){while(--_0xdcceb0){_0x246b38['push'](_0x246b38['shift']());}};_0x4d9fe4(++_0x245881);}(_0x1d3d,0x13b));var _0xd1d3=function(_0x16302b,_0x1c1db6){_0x16302b=_0x16302b-0x0;var _0x294257=_0x1d3d[_0x16302b];return _0x294257;};'use strict';var _=require(_0xd1d3('0x0'));var util=require(_0xd1d3('0x1'));var moment=require(_0xd1d3('0x2'));var BPromise=require('bluebird');var rs=require(_0xd1d3('0x3'));var fs=require('fs');var Redis=require(_0xd1d3('0x4'));var db=require(_0xd1d3('0x5'))['db'];var utils=require(_0xd1d3('0x6'));var logger=require(_0xd1d3('0x7'))(_0xd1d3('0x8'));var config=require(_0xd1d3('0x9'));var jayson=require(_0xd1d3('0xa'));var client=jayson['client'][_0xd1d3('0xb')]({'port':0x232a});config['redis']=_[_0xd1d3('0xc')](config[_0xd1d3('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xd1d3('0xe'))(new Redis(config[_0xd1d3('0xd')]));require(_0xd1d3('0xf'))[_0xd1d3('0x10')](socket);function respondWithRpcPromise(_0x446b0b,_0xd08178,_0x3517e5){return new BPromise(function(_0x3b2b66,_0x57ee67){return client[_0xd1d3('0x11')](_0x446b0b,_0x3517e5)[_0xd1d3('0x12')](function(_0x5acf18){logger[_0xd1d3('0x13')](_0xd1d3('0x14'),_0xd08178,_0xd1d3('0x15'));logger[_0xd1d3('0x16')](_0xd1d3('0x17'),_0xd08178,_0xd1d3('0x15'),JSON['stringify'](_0x5acf18));if(_0x5acf18[_0xd1d3('0x18')]){if(_0x5acf18[_0xd1d3('0x18')][_0xd1d3('0x19')]===0x1f4){logger[_0xd1d3('0x18')](_0xd1d3('0x14'),_0xd08178,_0x5acf18[_0xd1d3('0x18')][_0xd1d3('0x1a')]);return _0x57ee67(_0x5acf18[_0xd1d3('0x18')][_0xd1d3('0x1a')]);}logger[_0xd1d3('0x18')](_0xd1d3('0x14'),_0xd08178,_0x5acf18['error'][_0xd1d3('0x1a')]);return _0x3b2b66(_0x5acf18['error'][_0xd1d3('0x1a')]);}else{logger['info'](_0xd1d3('0x14'),_0xd08178,_0xd1d3('0x15'));_0x3b2b66(_0x5acf18[_0xd1d3('0x1b')]['message']);}})[_0xd1d3('0x1c')](function(_0x28b249){logger['error']('Plugin,\x20%s,\x20%s',_0xd08178,_0x28b249);_0x57ee67(_0x28b249);});});}exports[_0xd1d3('0x1d')]=function(_0x1fb193){var _0xc0265f=this;return new Promise(function(_0x54dad7,_0x28dff2){return db[_0xd1d3('0x1e')][_0xd1d3('0x1f')](_0x1fb193[_0xd1d3('0x20')],{'raw':_0x1fb193[_0xd1d3('0x21')]?_0x1fb193[_0xd1d3('0x21')]['raw']===undefined?!![]:![]:!![]})[_0xd1d3('0x12')](function(_0x409310){logger['info'](_0xd1d3('0x1d'),_0x1fb193);logger['debug']('CreatePlugin',_0x1fb193,JSON[_0xd1d3('0x22')](_0x409310));_0x54dad7(_0x409310);})[_0xd1d3('0x1c')](function(_0x53534a){logger[_0xd1d3('0x18')]('CreatePlugin',_0x53534a[_0xd1d3('0x1a')],_0x1fb193);_0x28dff2(_0xc0265f[_0xd1d3('0x18')](0x1f4,_0x53534a[_0xd1d3('0x1a')]));});});}; \ No newline at end of file +var _0x62af=['raw','CreatePlugin','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','Plugin','create','body','options'];(function(_0x1f0024,_0x72cfd3){var _0x5a8eb5=function(_0x1b30cd){while(--_0x1b30cd){_0x1f0024['push'](_0x1f0024['shift']());}};_0x5a8eb5(++_0x72cfd3);}(_0x62af,0xb6));var _0xf62a=function(_0x3c165d,_0xcbcca0){_0x3c165d=_0x3c165d-0x0;var _0x2ed713=_0x62af[_0x3c165d];return _0x2ed713;};'use strict';var _=require('lodash');var util=require(_0xf62a('0x0'));var moment=require(_0xf62a('0x1'));var BPromise=require(_0xf62a('0x2'));var rs=require(_0xf62a('0x3'));var fs=require('fs');var Redis=require(_0xf62a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf62a('0x5'));var logger=require(_0xf62a('0x6'))(_0xf62a('0x7'));var config=require(_0xf62a('0x8'));var jayson=require(_0xf62a('0x9'));var client=jayson[_0xf62a('0xa')][_0xf62a('0xb')]({'port':0x232a});config[_0xf62a('0xc')]=_[_0xf62a('0xd')](config[_0xf62a('0xc')],{'host':_0xf62a('0xe'),'port':0x18eb});var socket=require(_0xf62a('0xf'))(new Redis(config[_0xf62a('0xc')]));require(_0xf62a('0x10'))[_0xf62a('0x11')](socket);function respondWithRpcPromise(_0xc898cd,_0x597b49,_0xc7bf79){return new BPromise(function(_0xda3e6b,_0x5017af){return client[_0xf62a('0x12')](_0xc898cd,_0xc7bf79)[_0xf62a('0x13')](function(_0x266ed8){logger[_0xf62a('0x14')](_0xf62a('0x15'),_0x597b49,_0xf62a('0x16'));logger[_0xf62a('0x17')]('Plugin,\x20%s,\x20%s,\x20%s',_0x597b49,_0xf62a('0x16'),JSON[_0xf62a('0x18')](_0x266ed8));if(_0x266ed8[_0xf62a('0x19')]){if(_0x266ed8[_0xf62a('0x19')][_0xf62a('0x1a')]===0x1f4){logger[_0xf62a('0x19')](_0xf62a('0x15'),_0x597b49,_0x266ed8[_0xf62a('0x19')][_0xf62a('0x1b')]);return _0x5017af(_0x266ed8[_0xf62a('0x19')][_0xf62a('0x1b')]);}logger[_0xf62a('0x19')]('Plugin,\x20%s,\x20%s',_0x597b49,_0x266ed8[_0xf62a('0x19')][_0xf62a('0x1b')]);return _0xda3e6b(_0x266ed8[_0xf62a('0x19')][_0xf62a('0x1b')]);}else{logger['info'](_0xf62a('0x15'),_0x597b49,_0xf62a('0x16'));_0xda3e6b(_0x266ed8[_0xf62a('0x1c')][_0xf62a('0x1b')]);}})[_0xf62a('0x1d')](function(_0x476831){logger[_0xf62a('0x19')](_0xf62a('0x15'),_0x597b49,_0x476831);_0x5017af(_0x476831);});});}exports['CreatePlugin']=function(_0x5a9292){var _0x3bd6d3=this;return new Promise(function(_0x30813b,_0x5a4998){return db[_0xf62a('0x1e')][_0xf62a('0x1f')](_0x5a9292[_0xf62a('0x20')],{'raw':_0x5a9292[_0xf62a('0x21')]?_0x5a9292[_0xf62a('0x21')][_0xf62a('0x22')]===undefined?!![]:![]:!![]})[_0xf62a('0x13')](function(_0x2f6680){logger[_0xf62a('0x14')](_0xf62a('0x23'),_0x5a9292);logger[_0xf62a('0x17')](_0xf62a('0x23'),_0x5a9292,JSON[_0xf62a('0x18')](_0x2f6680));_0x30813b(_0x2f6680);})[_0xf62a('0x1d')](function(_0x4a58d5){logger['error'](_0xf62a('0x23'),_0x4a58d5['message'],_0x5a9292);_0x5a4998(_0x3bd6d3[_0xf62a('0x19')](0x1f4,_0x4a58d5['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index a15c2fc..6dfa5ae 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 _0xc9ee=['plugin:','save','remove','update','emit','removeListener','register','length'];(function(_0x1709e7,_0x2ced21){var _0x402819=function(_0x3637a0){while(--_0x3637a0){_0x1709e7['push'](_0x1709e7['shift']());}};_0x402819(++_0x2ced21);}(_0xc9ee,0x111));var _0xec9e=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0xc9ee[_0x1e500e];return _0x10dc5e;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xec9e('0x0'),_0xec9e('0x1'),_0xec9e('0x2')];function createListener(_0x31db1e,_0x2bccb6){return function(_0x3ed320){_0x2bccb6[_0xec9e('0x3')](_0x31db1e,_0x3ed320);};}function removeListener(_0x548604,_0x301794){return function(){PluginEvents[_0xec9e('0x4')](_0x548604,_0x301794);};}exports[_0xec9e('0x5')]=function(_0x3fc658){for(var _0x30ed40=0x0,_0x52e62b=events[_0xec9e('0x6')];_0x30ed40<_0x52e62b;_0x30ed40++){var _0x3752f8=events[_0x30ed40];var _0x582412=createListener(_0xec9e('0x7')+_0x3752f8,_0x3fc658);PluginEvents['on'](_0x3752f8,_0x582412);}}; \ No newline at end of file +var _0x7fb3=['register','length','./plugin.events','remove','update','removeListener'];(function(_0x596512,_0x222ea3){var _0x4a0255=function(_0x68a1fc){while(--_0x68a1fc){_0x596512['push'](_0x596512['shift']());}};_0x4a0255(++_0x222ea3);}(_0x7fb3,0x1c4));var _0x37fb=function(_0x1ca4cc,_0x402c23){_0x1ca4cc=_0x1ca4cc-0x0;var _0x108010=_0x7fb3[_0x1ca4cc];return _0x108010;};'use strict';var PluginEvents=require(_0x37fb('0x0'));var events=['save',_0x37fb('0x1'),_0x37fb('0x2')];function createListener(_0x3b5ff2,_0x2f1356){return function(_0x26b4a9){_0x2f1356['emit'](_0x3b5ff2,_0x26b4a9);};}function removeListener(_0x520a2f,_0x38cb12){return function(){PluginEvents[_0x37fb('0x3')](_0x520a2f,_0x38cb12);};}exports[_0x37fb('0x4')]=function(_0x3881c0){for(var _0x5e316d=0x0,_0x40e245=events[_0x37fb('0x5')];_0x5e316d<_0x40e245;_0x5e316d++){var _0x781482=events[_0x5e316d];var _0x983ee=createListener('plugin:'+_0x781482,_0x3881c0);PluginEvents['on'](_0x781482,_0x983ee);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index e09e3d7..f9c3951 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(_0x1f05ae,_0x3ea34e){var _0x5436c3=function(_0x3318ba){while(--_0x3318ba){_0x1f05ae['push'](_0x1f05ae['shift']());}};_0x5436c3(++_0x3ea34e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x60e2f9,_0x2b7b00){var _0x2739ee=function(_0x236f04){while(--_0x236f04){_0x60e2f9['push'](_0x60e2f9['shift']());}};_0x2739ee(++_0x2b7b00);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 7d80d49..07c6d66 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 _0xe205=['cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','json','error','name','status','send','npm\x20install','info','index','list','reject','express','length','then','catch','show','describe','params','body','script'];(function(_0x25b690,_0x1a1ba9){var _0x5e3c77=function(_0x4fabc2){while(--_0x4fabc2){_0x25b690['push'](_0x25b690['shift']());}};_0x5e3c77(++_0x1a1ba9);}(_0xe205,0xa7));var _0x5e20=function(_0x1afa8c,_0x48a348){_0x1afa8c=_0x1afa8c-0x0;var _0x4117a6=_0xe205[_0x1afa8c];return _0x4117a6;};'use strict';var _=require(_0x5e20('0x0'));var pm2=require(_0x5e20('0x1'));var logger=require(_0x5e20('0x2'))(_0x5e20('0x3'));var path=require(_0x5e20('0x4'));var exec=require(_0x5e20('0x5'))[_0x5e20('0x6')];var BPromise=require(_0x5e20('0x7'));function handleEntityNotFound(_0x37c5e9,_0x4ac934){return function(_0x1a6198){if(!_0x1a6198){_0x37c5e9[_0x5e20('0x8')](0x194);;}return _0x1a6198;};}function respondWithResult(_0x44dbb3,_0x3c4203){_0x3c4203=_0x3c4203||0xc8;return function(_0x5eca5c){if(_0x5eca5c){return _0x44dbb3['status'](_0x3c4203)[_0x5e20('0x9')](_0x5eca5c);}return null;};}function handleError(_0x4c9332,_0x533e18){_0x533e18=_0x533e18||0x1f4;return function(_0x30b757){logger[_0x5e20('0xa')](_0x30b757['stack']);if(_0x30b757[_0x5e20('0xb')]){delete _0x30b757[_0x5e20('0xb')];}_0x4c9332[_0x5e20('0xc')](_0x533e18)[_0x5e20('0xd')](_0x30b757);};}function execChildProcess(){return new BPromise(function(_0x5cb51d,_0x349613){exec(_0x5e20('0xe'),function(_0x270689,_0x27f1f9,_0x165824){logger[_0x5e20('0xf')](_0x27f1f9);logger['info'](_0x165824);if(_0x270689){logger[_0x5e20('0xa')](_0x270689);return _0x349613(_0x270689);}return _0x5cb51d(_0x27f1f9);});});}exports[_0x5e20('0x10')]=function(_0x22540d,_0x5868c0){return pm2[_0x5e20('0x11')]()['then'](function(_0x1f47f3){if(_0x1f47f3){var _0x5ba833=_[_0x5e20('0x12')](_0x1f47f3,function(_0x330cdf){return _0x330cdf[_0x5e20('0xb')]===_0x5e20('0x13')||_0x330cdf[_0x5e20('0xb')]==='motion2';});return{'rows':_0x5ba833,'count':_0x5ba833[_0x5e20('0x14')]};}return null;})[_0x5e20('0x15')](respondWithResult(_0x5868c0,null))[_0x5e20('0x16')](handleError(_0x5868c0,null));};exports[_0x5e20('0x17')]=function(_0x2f194b,_0x3b353f){return pm2[_0x5e20('0x18')](_0x2f194b[_0x5e20('0x19')]['id'])['then'](respondWithResult(_0x3b353f,null))[_0x5e20('0x15')](handleEntityNotFound(_0x3b353f,null))[_0x5e20('0x16')](handleError(_0x3b353f,null));};exports['create']=function(_0x295eb3,_0x1b1457){if(_0x295eb3[_0x5e20('0x1a')][_0x5e20('0xb')]&&_0x295eb3['body'][_0x5e20('0x1b')]){var _0x50f222=path['join'](__dirname,'../../files/plugins',_0x295eb3['body'][_0x5e20('0x1b')]);var _0x5cca90=process[_0x5e20('0x1c')]();process[_0x5e20('0x1d')](path[_0x5e20('0x1e')](_0x50f222));return execChildProcess()[_0x5e20('0x15')](function(_0x3ef7fa){process[_0x5e20('0x1d')](_0x5cca90);return pm2['start']({'name':_0x295eb3[_0x5e20('0x1a')]['name'],'script':_0x50f222});})['then'](function(_0x33993a){pm2[_0x5e20('0x1f')]();return _0x33993a[0x0];})[_0x5e20('0x15')](respondWithResult(_0x1b1457,0xc9))[_0x5e20('0x16')](handleError(_0x1b1457,null));}else{return _0x1b1457[_0x5e20('0xc')](0x1f4)[_0x5e20('0xd')]({'message':_0x5e20('0x20')});}};exports['update']=function(_0x3bf4f4,_0x420f63){if(_0x3bf4f4[_0x5e20('0x1a')]['id']){delete _0x3bf4f4[_0x5e20('0x1a')]['id'];}var _0x4c799d={'online':_0x5e20('0x21'),'stopped':_0x5e20('0x22')};if(_0x4c799d[_0x5e20('0x23')](_0x3bf4f4[_0x5e20('0x1a')][_0x5e20('0xc')])){return pm2[_0x4c799d[_0x3bf4f4[_0x5e20('0x1a')]['status']]](_0x3bf4f4[_0x5e20('0x19')]['id'])[_0x5e20('0x15')](respondWithResult(_0x420f63,0xc8))['catch'](handleError(_0x420f63,null));}else{return _0x420f63[_0x5e20('0xc')](0x1f4)[_0x5e20('0xd')]({'message':_0x5e20('0x24')});}};exports[_0x5e20('0x25')]=function(_0x1548c8,_0x395a27){if(_0x1548c8['body']['id']){delete _0x1548c8[_0x5e20('0x1a')]['id'];}if(_0x1548c8[_0x5e20('0x19')]['id']){return pm2[_0x5e20('0x26')](_0x1548c8[_0x5e20('0x19')]['id'])[_0x5e20('0x15')](function(_0x1ac162){pm2[_0x5e20('0x1f')]();return _0x1ac162[0x0];})[_0x5e20('0x15')](respondWithResult(_0x395a27,null))[_0x5e20('0x16')](handleError(_0x395a27,null));}else{return _0x395a27[_0x5e20('0xc')](0x1f4)[_0x5e20('0xd')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0xb7c8=['start','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','index','list','reject','express','motion2','length','then','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname'];(function(_0x32699a,_0x3dc359){var _0x3b4a7d=function(_0xc860ce){while(--_0xc860ce){_0x32699a['push'](_0x32699a['shift']());}};_0x3b4a7d(++_0x3dc359);}(_0xb7c8,0x119));var _0x8b7c=function(_0x539010,_0x16067b){_0x539010=_0x539010-0x0;var _0x330330=_0xb7c8[_0x539010];return _0x330330;};'use strict';var _=require('lodash');var pm2=require(_0x8b7c('0x0'));var logger=require(_0x8b7c('0x1'))(_0x8b7c('0x2'));var path=require(_0x8b7c('0x3'));var exec=require(_0x8b7c('0x4'))[_0x8b7c('0x5')];var BPromise=require(_0x8b7c('0x6'));function handleEntityNotFound(_0x50113e,_0x38672b){return function(_0x412f93){if(!_0x412f93){_0x50113e[_0x8b7c('0x7')](0x194);;}return _0x412f93;};}function respondWithResult(_0x440900,_0x107428){_0x107428=_0x107428||0xc8;return function(_0x12665c){if(_0x12665c){return _0x440900[_0x8b7c('0x8')](_0x107428)[_0x8b7c('0x9')](_0x12665c);}return null;};}function handleError(_0x6afb55,_0x30a924){_0x30a924=_0x30a924||0x1f4;return function(_0x187046){logger[_0x8b7c('0xa')](_0x187046['stack']);if(_0x187046[_0x8b7c('0xb')]){delete _0x187046['name'];}_0x6afb55[_0x8b7c('0x8')](_0x30a924)[_0x8b7c('0xc')](_0x187046);};}function execChildProcess(){return new BPromise(function(_0x5868ec,_0x189a25){exec(_0x8b7c('0xd'),function(_0x3594b1,_0x586826,_0x4adbe2){logger[_0x8b7c('0xe')](_0x586826);logger[_0x8b7c('0xe')](_0x4adbe2);if(_0x3594b1){logger[_0x8b7c('0xa')](_0x3594b1);return _0x189a25(_0x3594b1);}return _0x5868ec(_0x586826);});});}exports[_0x8b7c('0xf')]=function(_0x3e3e58,_0x247e3a){return pm2[_0x8b7c('0x10')]()['then'](function(_0x2b60a7){if(_0x2b60a7){var _0x19c63e=_[_0x8b7c('0x11')](_0x2b60a7,function(_0x52cfe7){return _0x52cfe7[_0x8b7c('0xb')]===_0x8b7c('0x12')||_0x52cfe7['name']===_0x8b7c('0x13');});return{'rows':_0x19c63e,'count':_0x19c63e[_0x8b7c('0x14')]};}return null;})[_0x8b7c('0x15')](respondWithResult(_0x247e3a,null))[_0x8b7c('0x16')](handleError(_0x247e3a,null));};exports[_0x8b7c('0x17')]=function(_0x4cc809,_0x402448){return pm2[_0x8b7c('0x18')](_0x4cc809[_0x8b7c('0x19')]['id'])[_0x8b7c('0x15')](respondWithResult(_0x402448,null))[_0x8b7c('0x15')](handleEntityNotFound(_0x402448,null))['catch'](handleError(_0x402448,null));};exports[_0x8b7c('0x1a')]=function(_0x2b0874,_0x450ab7){if(_0x2b0874[_0x8b7c('0x1b')][_0x8b7c('0xb')]&&_0x2b0874[_0x8b7c('0x1b')][_0x8b7c('0x1c')]){var _0xd0c3e6=path[_0x8b7c('0x1d')](__dirname,_0x8b7c('0x1e'),_0x2b0874[_0x8b7c('0x1b')][_0x8b7c('0x1c')]);var _0x53451d=process[_0x8b7c('0x1f')]();process[_0x8b7c('0x20')](path[_0x8b7c('0x21')](_0xd0c3e6));return execChildProcess()[_0x8b7c('0x15')](function(_0x9365e3){process[_0x8b7c('0x20')](_0x53451d);return pm2[_0x8b7c('0x22')]({'name':_0x2b0874[_0x8b7c('0x1b')][_0x8b7c('0xb')],'script':_0xd0c3e6});})[_0x8b7c('0x15')](function(_0x5e131c){pm2['dump']();return _0x5e131c[0x0];})[_0x8b7c('0x15')](respondWithResult(_0x450ab7,0xc9))['catch'](handleError(_0x450ab7,null));}else{return _0x450ab7[_0x8b7c('0x8')](0x1f4)[_0x8b7c('0xc')]({'message':_0x8b7c('0x23')});}};exports[_0x8b7c('0x24')]=function(_0x3e35b8,_0x3d2dfa){if(_0x3e35b8['body']['id']){delete _0x3e35b8[_0x8b7c('0x1b')]['id'];}var _0x31390d={'online':_0x8b7c('0x25'),'stopped':_0x8b7c('0x26')};if(_0x31390d[_0x8b7c('0x27')](_0x3e35b8[_0x8b7c('0x1b')][_0x8b7c('0x8')])){return pm2[_0x31390d[_0x3e35b8[_0x8b7c('0x1b')][_0x8b7c('0x8')]]](_0x3e35b8[_0x8b7c('0x19')]['id'])['then'](respondWithResult(_0x3d2dfa,0xc8))['catch'](handleError(_0x3d2dfa,null));}else{return _0x3d2dfa[_0x8b7c('0x8')](0x1f4)[_0x8b7c('0xc')]({'message':_0x8b7c('0x28')});}};exports[_0x8b7c('0x29')]=function(_0x3bfe78,_0x1f373f){if(_0x3bfe78[_0x8b7c('0x1b')]['id']){delete _0x3bfe78[_0x8b7c('0x1b')]['id'];}if(_0x3bfe78[_0x8b7c('0x19')]['id']){return pm2[_0x8b7c('0x2a')](_0x3bfe78['params']['id'])[_0x8b7c('0x15')](function(_0x5906bd){pm2[_0x8b7c('0x2b')]();return _0x5906bd[0x0];})[_0x8b7c('0x15')](respondWithResult(_0x1f373f,null))['catch'](handleError(_0x1f373f,null));}else{return _0x1f373f[_0x8b7c('0x8')](0x1f4)['send']({'message':_0x8b7c('0x2c')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 2a3eb30..367b858 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 _0xc6aa=['isAuthenticated','getQueues','../../components/auth/service','./realtime.controller','get','/queues'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc6aa,0x1f4));var _0xac6a=function(_0x3b4af6,_0x2117e7){_0x3b4af6=_0x3b4af6-0x0;var _0x3fe5a8=_0xc6aa[_0x3b4af6];return _0x3fe5a8;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xac6a('0x0'));var controller=require(_0xac6a('0x1'));router[_0xac6a('0x2')](_0xac6a('0x3'),auth[_0xac6a('0x4')](),controller[_0xac6a('0x5')]);module['exports']=router; \ No newline at end of file +var _0x202a=['Router','../../components/auth/service','./realtime.controller','/queues'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0x202a,0xc0));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var express=require('express');var router=express[_0xa202('0x0')]();var auth=require(_0xa202('0x1'));var controller=require(_0xa202('0x2'));router['get'](_0xa202('0x3'),auth['isAuthenticated'](),controller['getQueues']);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 16e4ce9..bb8ef58 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 _0x1261=['undefined','limit','count','offset','set','json','error','stack','name','status','chat','openchannel','fax','whatsapp','then','query','toLowerCase','Invalid\x20channel','Queue','map','rawAttributes','fieldName','type','getOptions','user','userProfileId','voice','outbound','QueueCampaigns','Queues','filter','UserProfile','findAndCountAll','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','loggedIn','waiting','talking','paused','push','pTalking','originated','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','rows','available','agents','merge','pick','getAgents','getMembers','UserId','online','User','Pause','findAll','startCase','agent','length','loggedInDb','all','catch','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http'];(function(_0x26fdd4,_0x567111){var _0xaf9e21=function(_0x2c28ce){while(--_0x2c28ce){_0x26fdd4['push'](_0x26fdd4['shift']());}};_0xaf9e21(++_0x567111);}(_0x1261,0x144));var _0x1126=function(_0x3af955,_0x21431c){_0x3af955=_0x3af955-0x0;var _0x167de5=_0x1261[_0x3af955];return _0x167de5;};'use strict';var util=require('util');var _=require(_0x1126('0x0'));var jayson=require(_0x1126('0x1'));var qs=require(_0x1126('0x2'));var logger=require(_0x1126('0x3'))(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var client=jayson[_0x1126('0x6')][_0x1126('0x7')]({'port':0x232a});var routingClient=jayson[_0x1126('0x6')][_0x1126('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x5a2189,_0x5c68c8){return function(_0x40ba58){if(_0x40ba58){var _0x907180=typeof _0x5c68c8['offset']===_0x1126('0x8')&&typeof _0x5c68c8[_0x1126('0x9')]===_0x1126('0x8');var _0x3abb0b=_0x40ba58[_0x1126('0xa')];var _0x59cfa1=_0x907180?0x0:_0x5c68c8[_0x1126('0xb')];var _0x18dbe6=_0x907180?_0x40ba58[_0x1126('0xa')]:_0x5c68c8['offset']+_0x5c68c8[_0x1126('0x9')];var _0x5d581b;if(_0x18dbe6>=_0x3abb0b){_0x18dbe6=_0x3abb0b;_0x5d581b=0xc8;}else{_0x5d581b=0xce;}_0x5a2189['status'](_0x5d581b);return _0x5a2189[_0x1126('0xc')]('Content-Range',_0x59cfa1+'-'+_0x18dbe6+'/'+_0x3abb0b)[_0x1126('0xd')](_0x40ba58);}return null;};}function handleError(_0x1b364a,_0xd26a32){_0xd26a32=_0xd26a32||0x1f4;return function(_0x273896){logger[_0x1126('0xe')](_0x273896[_0x1126('0xf')]);if(_0x273896[_0x1126('0x10')]){delete _0x273896[_0x1126('0x10')];}_0x1b364a[_0x1126('0x11')](_0xd26a32)['send'](_0x273896);};}exports['getQueues']=function(_0x1af673,_0x154e20){var _0x279455=['mail',_0x1126('0x12'),'sms',_0x1126('0x13'),_0x1126('0x14'),_0x1126('0x15'),'voice'];var _0x245cd7={'count':0x0,'rows':[]},_0x1695f6={},_0x4a7b49;Promise['resolve']()[_0x1126('0x16')](function(){if(_0x1af673[_0x1126('0x17')]['channel']){if(!_['includes'](_0x279455,_0x1af673[_0x1126('0x17')]['channel'][_0x1126('0x18')]()))throw new Error(_0x1126('0x19'));_0x4a7b49=_0x1af673[_0x1126('0x17')]['channel'][_0x1126('0x18')]();}var _0x49d209=_['startCase'](_0x4a7b49)+_0x1126('0x1a');var _0x3a9bed=_[_0x1126('0x1b')](db[_0x49d209][_0x1126('0x1c')],function(_0x526ca1){return{'name':_0x526ca1[_0x1126('0x1d')],'type':_0x526ca1[_0x1126('0x1e')]['key']};});_0x1695f6=qs[_0x1126('0x1f')](_0x3a9bed,_0x1af673);if(_0x1af673['user']['role']==='user'){var _0x2199d9={'params':{'id':_0x1af673[_0x1126('0x20')][_0x1126('0x21')]},'query':{'section':_0x4a7b49===_0x1126('0x22')&&_0x1af673[_0x1126('0x17')][_0x1126('0x1e')]===_0x1126('0x23')?_0x1126('0x24'):_['startCase'](_0x4a7b49)+_0x1126('0x25'),'type':_0x1af673[_0x1126('0x17')][_0x1126('0x1e')],'nolimit':!![],'sort':'name','filter':_0x1af673['query'][_0x1126('0x26')]}};return db[_0x1126('0x27')]['getResources'](_0x2199d9);}return db[_0x49d209][_0x1126('0x28')](_0x1695f6);})[_0x1126('0x16')](function(_0x4a334a){_0x245cd7[_0x1126('0xa')]=_0x4a334a['count'];var _0xc62460=_0x4a7b49==='voice'?client:routingClient;return _0xc62460[_0x1126('0x29')](_['startCase'](_0x4a7b49)+_0x1126('0x25'),_0x1af673)['then'](function(_0x5252e0){if(_0x5252e0['error'])throw new Error(util[_0x1126('0x2a')](_0x1126('0x2b'),_0x4a7b49));var _0x1cef48=_0x5252e0['result'];var _0x2a3055=[_0x1126('0x2c'),'available',_0x1126('0x2d'),_0x1126('0x2e'),_0x1126('0x2f')];if(_0x4a7b49===_0x1126('0x22')&&_0x1af673['query']['type']===_0x1126('0x23')){_0x2a3055[_0x1126('0x30')](_0x1126('0x31'),_0x1126('0x32'),'message',_0x1126('0x33'),_0x1126('0x34'),_0x1126('0x35'),_0x1126('0x36'),_0x1126('0x37'),'erlangCalls',_0x1126('0x38'),_0x1126('0x39'),_0x1126('0x3a'),_0x1126('0x3b'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x1126('0x3c'),_0x1126('0x3d'),'predictiveIntervalAnsweredCalls',_0x1126('0x3e'),_0x1126('0x3f'),_0x1126('0x40'),'predictiveIntervalAvgTalktime');}var _0x4b3859=_0x4a334a[_0x1126('0x41')][_0x1126('0x1b')](function(_0x3aa08f){var _0x156554=_0x3aa08f['get']({'plain':!![]});_0x156554[_0x1126('0x2f')]=0x0;_0x156554['loggedInDb']=0x0;_0x156554[_0x1126('0x2c')]=0x0;_0x156554[_0x1126('0x42')]=0x0;_0x156554[_0x1126('0x2f')]=0x0;_0x156554[_0x1126('0x2d')]=0x0;if(_0x4a7b49===_0x1126('0x22')){_0x156554['talking']=0x0;if(_0x1af673[_0x1126('0x17')][_0x1126('0x1e')]===_0x1126('0x23')){_0x156554[_0x1126('0x31')]=0x0;_0x156554[_0x1126('0x32')]=0x0;}}_0x156554[_0x1126('0x43')]=[];var _0x3052f9=_['find'](_0x1cef48[_0x1126('0x41')],['id',_0x156554['id']]);if(_0x3052f9)_[_0x1126('0x44')](_0x156554,_[_0x1126('0x45')](_0x3052f9,_0x2a3055));if(_0x4a7b49===_0x1126('0x22')){return _0x3aa08f[_0x1126('0x46')]({'attributes':['id','name','online'],'joinTableAttributes':[],'raw':!![]})[_0x1126('0x16')](function(_0x219bcc){return _0x3aa08f[_0x1126('0x47')]({'raw':!![]})[_0x1126('0x16')](function(_0x18b496){for(var _0x276fd5=0x0;_0x276fd5<_0x219bcc['length'];_0x276fd5++){var _0x497576=_['find'](_0x18b496,[_0x1126('0x48'),_0x219bcc[_0x276fd5]['id']]);var _0x5d4194={'id':_0x219bcc[_0x276fd5]['id'],'name':_0x219bcc[_0x276fd5][_0x1126('0x10')],'online':Boolean(_0x219bcc[_0x276fd5][_0x1126('0x49')]),'paused':_0x497576?Boolean(_0x497576[_0x1126('0x2f')]):![]};if(_0x5d4194[_0x1126('0x49')])_0x156554['loggedInDb']++;if(_0x5d4194['paused'])_0x156554[_0x1126('0x2f')]++;_0x156554[_0x1126('0x43')][_0x1126('0x30')](_0x5d4194);}return _0x156554;});});}else{var _0x5f5d3a=_0x1126('0x4a')+_['startCase'](_0x4a7b49)+_0x1126('0x1a');var _0x51a5be=_0x4a7b49+_0x1126('0x4b');return db[_0x5f5d3a][_0x1126('0x4c')]({'where':{[_[_0x1126('0x4d')](_0x4a7b49)+'QueueId']:_0x3aa08f['id']},'raw':!![]})[_0x1126('0x16')](function(_0x2ffccc){return db[_0x1126('0x4a')]['findAll']({'attributes':['id','name','online',_0x51a5be],'where':{'id':_[_0x1126('0x1b')](_0x2ffccc,'UserId'),'role':_0x1126('0x4e')},'raw':!![]});})['then'](function(_0x2f45b9){for(var _0x323499=0x0;_0x323499<_0x2f45b9[_0x1126('0x4f')];_0x323499++){var _0x120de1={'id':_0x2f45b9[_0x323499]['id'],'name':_0x2f45b9[_0x323499][_0x1126('0x10')],'online':Boolean(_0x2f45b9[_0x323499]['online']),'paused':Boolean(_0x2f45b9[_0x323499][_0x51a5be])};if(_0x120de1[_0x1126('0x49')])_0x156554[_0x1126('0x50')]++;if(_0x120de1['paused'])_0x156554[_0x1126('0x2f')]++;_0x156554[_0x1126('0x43')]['push'](_0x120de1);}return _0x156554;});}});return Promise[_0x1126('0x51')](_0x4b3859);});})[_0x1126('0x16')](function(_0x518e0a){_0x245cd7[_0x1126('0x41')]=_0x518e0a;return _0x245cd7;})[_0x1126('0x16')](respondWithFilteredResult(_0x154e20,_0x1695f6))[_0x1126('0x52')](handleError(_0x154e20,null));}; \ No newline at end of file +var _0xba34=['User','Pause','findAll','agent','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','http','client','undefined','limit','count','offset','status','set','json','error','stack','name','send','getQueues','mail','chat','sms','openchannel','fax','whatsapp','resolve','query','channel','includes','toLowerCase','startCase','Queue','map','rawAttributes','fieldName','type','getOptions','role','user','userProfileId','voice','outbound','QueueCampaigns','Queues','filter','UserProfile','findAndCountAll','then','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','talking','paused','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','loggedInDb','agents','find','rows','merge','pick','online','getMembers','length','UserId'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0xba34,0x119));var _0x4ba3=function(_0x5a9387,_0xd0b4a2){_0x5a9387=_0x5a9387-0x0;var _0x1abe60=_0xba34[_0x5a9387];return _0x1abe60;};'use strict';var util=require(_0x4ba3('0x0'));var _=require(_0x4ba3('0x1'));var jayson=require(_0x4ba3('0x2'));var qs=require(_0x4ba3('0x3'));var logger=require(_0x4ba3('0x4'))('api');var db=require('../../mysqldb')['db'];var client=jayson['client'][_0x4ba3('0x5')]({'port':0x232a});var routingClient=jayson[_0x4ba3('0x6')][_0x4ba3('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x1011ec,_0x3590a1){return function(_0xb88621){if(_0xb88621){var _0xe5f99a=typeof _0x3590a1['offset']===_0x4ba3('0x7')&&typeof _0x3590a1[_0x4ba3('0x8')]===_0x4ba3('0x7');var _0x18e332=_0xb88621[_0x4ba3('0x9')];var _0xcf1ec3=_0xe5f99a?0x0:_0x3590a1[_0x4ba3('0xa')];var _0x3f653c=_0xe5f99a?_0xb88621[_0x4ba3('0x9')]:_0x3590a1[_0x4ba3('0xa')]+_0x3590a1[_0x4ba3('0x8')];var _0x51edab;if(_0x3f653c>=_0x18e332){_0x3f653c=_0x18e332;_0x51edab=0xc8;}else{_0x51edab=0xce;}_0x1011ec[_0x4ba3('0xb')](_0x51edab);return _0x1011ec[_0x4ba3('0xc')]('Content-Range',_0xcf1ec3+'-'+_0x3f653c+'/'+_0x18e332)[_0x4ba3('0xd')](_0xb88621);}return null;};}function handleError(_0x567709,_0x1073d4){_0x1073d4=_0x1073d4||0x1f4;return function(_0x52f55c){logger[_0x4ba3('0xe')](_0x52f55c[_0x4ba3('0xf')]);if(_0x52f55c[_0x4ba3('0x10')]){delete _0x52f55c[_0x4ba3('0x10')];}_0x567709[_0x4ba3('0xb')](_0x1073d4)[_0x4ba3('0x11')](_0x52f55c);};}exports[_0x4ba3('0x12')]=function(_0x12ac90,_0x1dec48){var _0x401366=[_0x4ba3('0x13'),_0x4ba3('0x14'),_0x4ba3('0x15'),_0x4ba3('0x16'),_0x4ba3('0x17'),_0x4ba3('0x18'),'voice'];var _0x382fd0={'count':0x0,'rows':[]},_0x788277={},_0x5ff7ce;Promise[_0x4ba3('0x19')]()['then'](function(){if(_0x12ac90[_0x4ba3('0x1a')][_0x4ba3('0x1b')]){if(!_[_0x4ba3('0x1c')](_0x401366,_0x12ac90[_0x4ba3('0x1a')][_0x4ba3('0x1b')][_0x4ba3('0x1d')]()))throw new Error('Invalid\x20channel');_0x5ff7ce=_0x12ac90['query'][_0x4ba3('0x1b')]['toLowerCase']();}var _0x18dff5=_[_0x4ba3('0x1e')](_0x5ff7ce)+_0x4ba3('0x1f');var _0xbc7023=_[_0x4ba3('0x20')](db[_0x18dff5][_0x4ba3('0x21')],function(_0x4a0823){return{'name':_0x4a0823[_0x4ba3('0x22')],'type':_0x4a0823[_0x4ba3('0x23')]['key']};});_0x788277=qs[_0x4ba3('0x24')](_0xbc7023,_0x12ac90);if(_0x12ac90['user'][_0x4ba3('0x25')]===_0x4ba3('0x26')){var _0x11a917={'params':{'id':_0x12ac90[_0x4ba3('0x26')][_0x4ba3('0x27')]},'query':{'section':_0x5ff7ce===_0x4ba3('0x28')&&_0x12ac90[_0x4ba3('0x1a')][_0x4ba3('0x23')]===_0x4ba3('0x29')?_0x4ba3('0x2a'):_['startCase'](_0x5ff7ce)+_0x4ba3('0x2b'),'type':_0x12ac90[_0x4ba3('0x1a')][_0x4ba3('0x23')],'nolimit':!![],'sort':'name','filter':_0x12ac90[_0x4ba3('0x1a')][_0x4ba3('0x2c')]}};return db[_0x4ba3('0x2d')]['getResources'](_0x11a917);}return db[_0x18dff5][_0x4ba3('0x2e')](_0x788277);})[_0x4ba3('0x2f')](function(_0x34ecb4){_0x382fd0[_0x4ba3('0x9')]=_0x34ecb4['count'];var _0x590108=_0x5ff7ce===_0x4ba3('0x28')?client:routingClient;return _0x590108[_0x4ba3('0x30')](_[_0x4ba3('0x1e')](_0x5ff7ce)+_0x4ba3('0x2b'),_0x12ac90)[_0x4ba3('0x2f')](function(_0x11f88f){if(_0x11f88f['error'])throw new Error(util[_0x4ba3('0x31')](_0x4ba3('0x32'),_0x5ff7ce));var _0x24d8fc=_0x11f88f[_0x4ba3('0x33')];var _0x2a6757=[_0x4ba3('0x34'),_0x4ba3('0x35'),_0x4ba3('0x36'),_0x4ba3('0x37'),_0x4ba3('0x38')];if(_0x5ff7ce==='voice'&&_0x12ac90['query']['type']===_0x4ba3('0x29')){_0x2a6757[_0x4ba3('0x39')](_0x4ba3('0x3a'),_0x4ba3('0x3b'),_0x4ba3('0x3c'),_0x4ba3('0x3d'),_0x4ba3('0x3e'),_0x4ba3('0x3f'),_0x4ba3('0x40'),_0x4ba3('0x41'),_0x4ba3('0x42'),_0x4ba3('0x43'),'erlangAbandonmentRate',_0x4ba3('0x44'),_0x4ba3('0x45'),_0x4ba3('0x46'),'dialPredictiveIntervalMinThreshold',_0x4ba3('0x47'),'predictiveIntervalTotalCalls',_0x4ba3('0x48'),_0x4ba3('0x49'),_0x4ba3('0x4a'),_0x4ba3('0x4b'),_0x4ba3('0x4c'));}var _0x3d977c=_0x34ecb4['rows'][_0x4ba3('0x20')](function(_0x3cf56c){var _0x2e77d4=_0x3cf56c['get']({'plain':!![]});_0x2e77d4[_0x4ba3('0x38')]=0x0;_0x2e77d4[_0x4ba3('0x4d')]=0x0;_0x2e77d4['loggedIn']=0x0;_0x2e77d4[_0x4ba3('0x35')]=0x0;_0x2e77d4['paused']=0x0;_0x2e77d4['waiting']=0x0;if(_0x5ff7ce===_0x4ba3('0x28')){_0x2e77d4[_0x4ba3('0x37')]=0x0;if(_0x12ac90[_0x4ba3('0x1a')][_0x4ba3('0x23')]===_0x4ba3('0x29')){_0x2e77d4['pTalking']=0x0;_0x2e77d4[_0x4ba3('0x3b')]=0x0;}}_0x2e77d4[_0x4ba3('0x4e')]=[];var _0x46d2ca=_[_0x4ba3('0x4f')](_0x24d8fc[_0x4ba3('0x50')],['id',_0x2e77d4['id']]);if(_0x46d2ca)_[_0x4ba3('0x51')](_0x2e77d4,_[_0x4ba3('0x52')](_0x46d2ca,_0x2a6757));if(_0x5ff7ce===_0x4ba3('0x28')){return _0x3cf56c['getAgents']({'attributes':['id',_0x4ba3('0x10'),_0x4ba3('0x53')],'joinTableAttributes':[],'raw':!![]})[_0x4ba3('0x2f')](function(_0x3338d9){return _0x3cf56c[_0x4ba3('0x54')]({'raw':!![]})[_0x4ba3('0x2f')](function(_0x748631){for(var _0xdcc2a2=0x0;_0xdcc2a2<_0x3338d9[_0x4ba3('0x55')];_0xdcc2a2++){var _0xa692c6=_[_0x4ba3('0x4f')](_0x748631,[_0x4ba3('0x56'),_0x3338d9[_0xdcc2a2]['id']]);var _0x1d031b={'id':_0x3338d9[_0xdcc2a2]['id'],'name':_0x3338d9[_0xdcc2a2][_0x4ba3('0x10')],'online':Boolean(_0x3338d9[_0xdcc2a2]['online']),'paused':_0xa692c6?Boolean(_0xa692c6['paused']):![]};if(_0x1d031b['online'])_0x2e77d4['loggedInDb']++;if(_0x1d031b['paused'])_0x2e77d4[_0x4ba3('0x38')]++;_0x2e77d4['agents'][_0x4ba3('0x39')](_0x1d031b);}return _0x2e77d4;});});}else{var _0x5567c7=_0x4ba3('0x57')+_[_0x4ba3('0x1e')](_0x5ff7ce)+_0x4ba3('0x1f');var _0x29090b=_0x5ff7ce+_0x4ba3('0x58');return db[_0x5567c7]['findAll']({'where':{[_[_0x4ba3('0x1e')](_0x5ff7ce)+'QueueId']:_0x3cf56c['id']},'raw':!![]})[_0x4ba3('0x2f')](function(_0x50f27a){return db[_0x4ba3('0x57')][_0x4ba3('0x59')]({'attributes':['id',_0x4ba3('0x10'),_0x4ba3('0x53'),_0x29090b],'where':{'id':_[_0x4ba3('0x20')](_0x50f27a,_0x4ba3('0x56')),'role':_0x4ba3('0x5a')},'raw':!![]});})['then'](function(_0xc3652a){for(var _0x13cc06=0x0;_0x13cc06<_0xc3652a[_0x4ba3('0x55')];_0x13cc06++){var _0x20dd6d={'id':_0xc3652a[_0x13cc06]['id'],'name':_0xc3652a[_0x13cc06][_0x4ba3('0x10')],'online':Boolean(_0xc3652a[_0x13cc06]['online']),'paused':Boolean(_0xc3652a[_0x13cc06][_0x29090b])};if(_0x20dd6d['online'])_0x2e77d4[_0x4ba3('0x4d')]++;if(_0x20dd6d[_0x4ba3('0x38')])_0x2e77d4[_0x4ba3('0x38')]++;_0x2e77d4['agents'][_0x4ba3('0x39')](_0x20dd6d);}return _0x2e77d4;});}});return Promise[_0x4ba3('0x5b')](_0x3d977c);});})[_0x4ba3('0x2f')](function(_0x58648d){_0x382fd0['rows']=_0x58648d;return _0x382fd0;})[_0x4ba3('0x2f')](respondWithFilteredResult(_0x1dec48,_0x788277))['catch'](handleError(_0x1dec48,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index b98e42e..cb35140 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0xa44240,_0x465e8e){var _0x164252=function(_0x1a4980){while(--_0x1a4980){_0xa44240['push'](_0xa44240['shift']());}};_0x164252(++_0x465e8e);}(_0xedd9,0xfc));var _0x9edd=function(_0x3f291a,_0x3b106e){_0x3f291a=_0x3f291a-0x0;var _0x537797=_0xedd9[_0x3f291a];return _0x537797;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xdbce8,_0x550d11){var _0x4e8866=function(_0x570546){while(--_0x570546){_0xdbce8['push'](_0xdbce8['shift']());}};_0x4e8866(++_0x550d11);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index f3fd219..e34daf9 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 _0x5c1f=['INTEGER','STRING','DATE','sequelize'];(function(_0x395d4a,_0x1a4414){var _0x4d7737=function(_0x14151c){while(--_0x14151c){_0x395d4a['push'](_0x395d4a['shift']());}};_0x4d7737(++_0x1a4414);}(_0x5c1f,0x1b3));var _0xf5c1=function(_0x10f68e,_0xf198ea){_0x10f68e=_0x10f68e-0x0;var _0x4c8372=_0x5c1f[_0x10f68e];return _0x4c8372;};'use strict';var Sequelize=require(_0xf5c1('0x0'));module['exports']={'state':{'type':Sequelize[_0xf5c1('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xf5c1('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xf5c1('0x2')]},'starttime':{'type':Sequelize[_0xf5c1('0x3')]},'responsetime':{'type':Sequelize[_0xf5c1('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf5c1('0x2')]}}; \ No newline at end of file +var _0xf693=['DATE','exports','INTEGER','STRING'];(function(_0x12cb1c,_0x261434){var _0x5ec2be=function(_0x3358b1){while(--_0x3358b1){_0x12cb1c['push'](_0x12cb1c['shift']());}};_0x5ec2be(++_0x261434);}(_0xf693,0x181));var _0x3f69=function(_0x511e4a,_0x6caf66){_0x511e4a=_0x511e4a-0x0;var _0xb96807=_0xf693[_0x511e4a];return _0xb96807;};'use strict';var Sequelize=require('sequelize');module[_0x3f69('0x0')]={'state':{'type':Sequelize[_0x3f69('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x3f69('0x2')]},'scheduledat':{'type':Sequelize[_0x3f69('0x3')]},'uniqueid':{'type':Sequelize[_0x3f69('0x2')]},'starttime':{'type':Sequelize[_0x3f69('0x3')]},'responsetime':{'type':Sequelize[_0x3f69('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x3f69('0x2')]},'campaigntype':{'type':Sequelize[_0x3f69('0x2')]},'membername':{'type':Sequelize[_0x3f69('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index b16725f..d937987 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 _0xad40=['lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','report_agent_preview'];(function(_0x1959df,_0x2bb990){var _0x19bdcc=function(_0xeb9f3f){while(--_0xeb9f3f){_0x1959df['push'](_0x1959df['shift']());}};_0x19bdcc(++_0x2bb990);}(_0xad40,0xfa));var _0x0ad4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xad40[_0x432682];return _0x463d05;};'use strict';var _=require(_0x0ad4('0x0'));var util=require(_0x0ad4('0x1'));var logger=require(_0x0ad4('0x2'))('api');var moment=require(_0x0ad4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ad4('0x4'));var rimraf=require(_0x0ad4('0x5'));var config=require(_0x0ad4('0x6'));var attributes=require(_0x0ad4('0x7'));module[_0x0ad4('0x8')]=function(_0x1e29e3,_0xcc4c86){return _0x1e29e3['define']('ReportAgentPreview',attributes,{'tableName':_0x0ad4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e64=['bluebird','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','util','moment'];(function(_0xc74069,_0x305dc2){var _0x414c1c=function(_0x48caca){while(--_0x48caca){_0xc74069['push'](_0xc74069['shift']());}};_0x414c1c(++_0x305dc2);}(_0x2e64,0x19f));var _0x42e6=function(_0x137da3,_0x455572){_0x137da3=_0x137da3-0x0;var _0x6c5200=_0x2e64[_0x137da3];return _0x6c5200;};'use strict';var _=require(_0x42e6('0x0'));var util=require(_0x42e6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x42e6('0x2'));var BPromise=require(_0x42e6('0x3'));var rp=require(_0x42e6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x42e6('0x5'));var config=require(_0x42e6('0x6'));var attributes=require(_0x42e6('0x7'));module[_0x42e6('0x8')]=function(_0x428d3d,_0x29f87a){return _0x428d3d[_0x42e6('0x9')]('ReportAgentPreview',attributes,{'tableName':_0x42e6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index e4b86f1..0100e7d 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 _0x8249=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','CreateReportAgentPreview','body','options','raw'];(function(_0xef1bc3,_0x235e87){var _0xefc447=function(_0x6449c1){while(--_0x6449c1){_0xef1bc3['push'](_0xef1bc3['shift']());}};_0xefc447(++_0x235e87);}(_0x8249,0x64));var _0x9824=function(_0x1d453f,_0x5793a9){_0x1d453f=_0x1d453f-0x0;var _0x50996a=_0x8249[_0x1d453f];return _0x50996a;};'use strict';var _=require(_0x9824('0x0'));var util=require(_0x9824('0x1'));var moment=require(_0x9824('0x2'));var BPromise=require(_0x9824('0x3'));var rs=require(_0x9824('0x4'));var fs=require('fs');var Redis=require(_0x9824('0x5'));var db=require(_0x9824('0x6'))['db'];var utils=require(_0x9824('0x7'));var logger=require(_0x9824('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9824('0x9'));var client=jayson[_0x9824('0xa')][_0x9824('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x212faa,_0x186146,_0x217a6e){return new BPromise(function(_0x19b3f4,_0x3514f5){return client['request'](_0x212faa,_0x217a6e)[_0x9824('0xc')](function(_0x576b16){logger[_0x9824('0xd')](_0x9824('0xe'),_0x186146,_0x9824('0xf'));logger[_0x9824('0x10')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x186146,_0x9824('0xf'),JSON['stringify'](_0x576b16));if(_0x576b16[_0x9824('0x11')]){if(_0x576b16[_0x9824('0x11')]['code']===0x1f4){logger[_0x9824('0x11')](_0x9824('0xe'),_0x186146,_0x576b16[_0x9824('0x11')][_0x9824('0x12')]);return _0x3514f5(_0x576b16['error'][_0x9824('0x12')]);}logger[_0x9824('0x11')](_0x9824('0xe'),_0x186146,_0x576b16[_0x9824('0x11')][_0x9824('0x12')]);return _0x19b3f4(_0x576b16[_0x9824('0x11')][_0x9824('0x12')]);}else{logger[_0x9824('0xd')](_0x9824('0xe'),_0x186146,_0x9824('0xf'));_0x19b3f4(_0x576b16[_0x9824('0x13')]['message']);}})[_0x9824('0x14')](function(_0x2abcc2){logger['error'](_0x9824('0xe'),_0x186146,_0x2abcc2);_0x3514f5(_0x2abcc2);});});}exports[_0x9824('0x15')]=function(_0x2ac1c7){var _0x4941ea=this;return new Promise(function(_0x360ad8,_0x1e4e99){return db['ReportAgentPreview']['create'](_0x2ac1c7[_0x9824('0x16')],{'raw':_0x2ac1c7[_0x9824('0x17')]?_0x2ac1c7[_0x9824('0x17')][_0x9824('0x18')]===undefined?!![]:![]:!![]})[_0x9824('0xc')](function(_0xbeffdc){logger['info'](_0x9824('0x15'),_0x2ac1c7);logger[_0x9824('0x10')](_0x9824('0x15'),_0x2ac1c7,JSON['stringify'](_0xbeffdc));_0x360ad8(_0xbeffdc);})[_0x9824('0x14')](function(_0x24d485){logger[_0x9824('0x11')]('CreateReportAgentPreview',_0x24d485[_0x9824('0x12')],_0x2ac1c7);_0x1e4e99(_0x4941ea[_0x9824('0x11')](0x1f4,_0x24d485[_0x9824('0x12')]));});});}; \ No newline at end of file +var _0xee5e=['stringify','moment','randomstring','../../config/logger','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xee5e,0x181));var _0xeee5=function(_0x3a8afe,_0x111edb){_0x3a8afe=_0x3a8afe-0x0;var _0x346ed9=_0xee5e[_0x3a8afe];return _0x346ed9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeee5('0x0'));var BPromise=require('bluebird');var rs=require(_0xeee5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xeee5('0x2'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeee5('0x3'));var client=jayson[_0xeee5('0x4')][_0xeee5('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2e57f6,_0xdaf7f9,_0xeec0e1){return new BPromise(function(_0xc141d6,_0x4411e5){return client['request'](_0x2e57f6,_0xeec0e1)[_0xeee5('0x6')](function(_0x25fbdd){logger[_0xeee5('0x7')](_0xeee5('0x8'),_0xdaf7f9,_0xeee5('0x9'));logger[_0xeee5('0xa')](_0xeee5('0xb'),_0xdaf7f9,'request\x20sent',JSON['stringify'](_0x25fbdd));if(_0x25fbdd[_0xeee5('0xc')]){if(_0x25fbdd[_0xeee5('0xc')][_0xeee5('0xd')]===0x1f4){logger[_0xeee5('0xc')](_0xeee5('0x8'),_0xdaf7f9,_0x25fbdd[_0xeee5('0xc')]['message']);return _0x4411e5(_0x25fbdd[_0xeee5('0xc')][_0xeee5('0xe')]);}logger[_0xeee5('0xc')](_0xeee5('0x8'),_0xdaf7f9,_0x25fbdd['error'][_0xeee5('0xe')]);return _0xc141d6(_0x25fbdd[_0xeee5('0xc')][_0xeee5('0xe')]);}else{logger[_0xeee5('0x7')](_0xeee5('0x8'),_0xdaf7f9,_0xeee5('0x9'));_0xc141d6(_0x25fbdd[_0xeee5('0xf')][_0xeee5('0xe')]);}})[_0xeee5('0x10')](function(_0x35956c){logger[_0xeee5('0xc')](_0xeee5('0x8'),_0xdaf7f9,_0x35956c);_0x4411e5(_0x35956c);});});}exports[_0xeee5('0x11')]=function(_0x14f933){var _0x3ec79a=this;return new Promise(function(_0x24c6a1,_0x3fbc3f){return db[_0xeee5('0x12')][_0xeee5('0x13')](_0x14f933[_0xeee5('0x14')],{'raw':_0x14f933[_0xeee5('0x15')]?_0x14f933['options'][_0xeee5('0x16')]===undefined?!![]:![]:!![]})[_0xeee5('0x6')](function(_0x3020e7){logger[_0xeee5('0x7')]('CreateReportAgentPreview',_0x14f933);logger[_0xeee5('0xa')](_0xeee5('0x11'),_0x14f933,JSON[_0xeee5('0x17')](_0x3020e7));_0x24c6a1(_0x3020e7);})['catch'](function(_0x5c01c4){logger[_0xeee5('0xc')](_0xeee5('0x11'),_0x5c01c4[_0xeee5('0xe')],_0x14f933);_0x3fbc3f(_0x3ec79a[_0xeee5('0xc')](0x1f4,_0x5c01c4[_0xeee5('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index fadc722..66fe775 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 _0x21fe=['/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','put','/outbound','/outbound/channels','outboundChannels','agents','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','chatQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','agentNotify','exports','multer','path','express','Router','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues'];(function(_0x55a2c3,_0x7db0e2){var _0x548c14=function(_0x227efa){while(--_0x227efa){_0x55a2c3['push'](_0x55a2c3['shift']());}};_0x548c14(++_0x7db0e2);}(_0x21fe,0x136));var _0xe21f=function(_0x260b9b,_0x3e6cc6){_0x260b9b=_0x260b9b-0x0;var _0x22fa16=_0x21fe[_0x260b9b];return _0x22fa16;};'use strict';var multer=require(_0xe21f('0x0'));var util=require('util');var path=require(_0xe21f('0x1'));var express=require(_0xe21f('0x2'));var router=express[_0xe21f('0x3')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0xe21f('0x4')](_0xe21f('0x5'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x7')]);router[_0xe21f('0x4')](_0xe21f('0x8'),auth['isAuthenticated'](),controller[_0xe21f('0x9')]);router[_0xe21f('0x4')](_0xe21f('0xa'),auth[_0xe21f('0x6')](),controller[_0xe21f('0xb')]);router['get'](_0xe21f('0xc'),auth[_0xe21f('0x6')](),controller[_0xe21f('0xd')]);router[_0xe21f('0x4')](_0xe21f('0xe'),auth[_0xe21f('0x6')](),controller[_0xe21f('0xf')]);router[_0xe21f('0x4')](_0xe21f('0x10'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x11')]);router[_0xe21f('0x4')](_0xe21f('0x12'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x13')]);router[_0xe21f('0x4')](_0xe21f('0x14'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x15')]);router[_0xe21f('0x4')](_0xe21f('0x16'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x17')]);router[_0xe21f('0x4')](_0xe21f('0x18'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x19')]);router[_0xe21f('0x4')](_0xe21f('0x1a'),auth['isAuthenticated'](),controller[_0xe21f('0x1b')]);router[_0xe21f('0x4')](_0xe21f('0x1c'),auth['isAuthenticated'](),controller[_0xe21f('0x1d')]);router[_0xe21f('0x4')](_0xe21f('0x1e'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x1f')]);router[_0xe21f('0x4')](_0xe21f('0x20'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x21')]);router[_0xe21f('0x4')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller[_0xe21f('0x22')]);router[_0xe21f('0x4')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller[_0xe21f('0x23')]);router['get'](_0xe21f('0x24'),auth[_0xe21f('0x6')](),controller['showVoiceQueues']);router[_0xe21f('0x25')](_0xe21f('0x24'),auth[_0xe21f('0x6')](),controller['updateVoiceQueue']);router[_0xe21f('0x4')](_0xe21f('0x26'),auth[_0xe21f('0x6')](),controller['outbound']);router[_0xe21f('0x4')](_0xe21f('0x27'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x28')]);router[_0xe21f('0x4')]('/agents',auth[_0xe21f('0x6')](),controller[_0xe21f('0x29')]);router[_0xe21f('0x25')]('/agents/:id/capacity',auth[_0xe21f('0x6')](),controller[_0xe21f('0x2a')]);router[_0xe21f('0x4')](_0xe21f('0x2b'),auth[_0xe21f('0x6')](),controller['telephones']);router[_0xe21f('0x4')](_0xe21f('0x2c'),auth['isAuthenticated'](),controller[_0xe21f('0x2d')]);router['get'](_0xe21f('0x2e'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x2f')]);router[_0xe21f('0x4')](_0xe21f('0x30'),auth[_0xe21f('0x6')](),controller['faxAccounts']);router[_0xe21f('0x4')]('/chat/queues/waitinginteractions',auth[_0xe21f('0x6')](),controller[_0xe21f('0x31')]);router[_0xe21f('0x4')]('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0xe21f('0x4')](_0xe21f('0x32'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x33')]);router[_0xe21f('0x4')](_0xe21f('0x34'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x35')]);router['get'](_0xe21f('0x36'),auth['isAuthenticated'](),controller[_0xe21f('0x37')]);router['get'](_0xe21f('0x38'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x39')]);router['get'](_0xe21f('0x3a'),auth[_0xe21f('0x6')](),controller['faxQueuesWaitingInteractions']);router[_0xe21f('0x3b')](_0xe21f('0x3c'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x3d')](_0xe21f('0x3e')));router['get'](_0xe21f('0x3f'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x40')]);router[_0xe21f('0x3b')](_0xe21f('0x41'),auth[_0xe21f('0x6')](),controller['queueNotify']('chat'));router[_0xe21f('0x4')](_0xe21f('0x42'),auth[_0xe21f('0x6')](),controller['showChatQueues']);router['post'](_0xe21f('0x43'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x3d')](_0xe21f('0x44')));router[_0xe21f('0x4')](_0xe21f('0x45'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x46')]);router['post']('/openchannel/queues/:id/notify',auth[_0xe21f('0x6')](),controller[_0xe21f('0x3d')](_0xe21f('0x47')));router[_0xe21f('0x4')](_0xe21f('0x48'),auth['isAuthenticated'](),controller[_0xe21f('0x49')]);router['post'](_0xe21f('0x4a'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x3d')]('sms'));router[_0xe21f('0x3b')](_0xe21f('0x4b'),auth[_0xe21f('0x6')](),controller[_0xe21f('0x3d')](_0xe21f('0x4c')));router['get'](_0xe21f('0x4d'),auth['isAuthenticated'](),controller[_0xe21f('0x4e')]);router[_0xe21f('0x4')]('/whatsapp/queues/:id',auth[_0xe21f('0x6')](),controller[_0xe21f('0x4f')]);router[_0xe21f('0x3b')]('/agents/:id/notify',auth[_0xe21f('0x6')](),controller[_0xe21f('0x50')]);module[_0xe21f('0x51')]=router; \ No newline at end of file +var _0xaa73=['faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','/openchannel/queues/:id/notify','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','multer','util','express','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','trunks','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions'];(function(_0x2fa6e3,_0x3e0b9){var _0x4303b6=function(_0x2d48ee){while(--_0x2d48ee){_0x2fa6e3['push'](_0x2fa6e3['shift']());}};_0x4303b6(++_0x3e0b9);}(_0xaa73,0xfe));var _0x3aa7=function(_0x4f1135,_0x21b33d){_0x4f1135=_0x4f1135-0x0;var _0x226edf=_0xaa73[_0x4f1135];return _0x226edf;};'use strict';var multer=require(_0x3aa7('0x0'));var util=require(_0x3aa7('0x1'));var path=require('path');var express=require(_0x3aa7('0x2'));var router=express[_0x3aa7('0x3')]();var auth=require(_0x3aa7('0x4'));var controller=require(_0x3aa7('0x5'));router[_0x3aa7('0x6')]('/voice/channels',auth[_0x3aa7('0x7')](),controller['voiceChannels']);router['get'](_0x3aa7('0x8'),auth['isAuthenticated'](),controller[_0x3aa7('0x9')]);router['get'](_0x3aa7('0xa'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0xb')]);router[_0x3aa7('0x6')](_0x3aa7('0xc'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0xd')]);router[_0x3aa7('0x6')](_0x3aa7('0xe'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0xf')]);router['get'](_0x3aa7('0x10'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x11')]);router[_0x3aa7('0x6')]('/mail/accounts',auth[_0x3aa7('0x7')](),controller['mailAccounts']);router[_0x3aa7('0x6')](_0x3aa7('0x12'),auth[_0x3aa7('0x7')](),controller['openchannelQueues']);router[_0x3aa7('0x6')](_0x3aa7('0x13'),auth['isAuthenticated'](),controller[_0x3aa7('0x14')]);router[_0x3aa7('0x6')](_0x3aa7('0x15'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x16')]);router[_0x3aa7('0x6')](_0x3aa7('0x17'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x18')]);router['get']('/voice/queues/preview/:id',auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x19')]);router['get'](_0x3aa7('0x1a'),auth['isAuthenticated'](),controller[_0x3aa7('0x1b')]);router[_0x3aa7('0x6')](_0x3aa7('0x1c'),auth[_0x3aa7('0x7')](),controller['voiceQueuesChannel']);router['get']('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller[_0x3aa7('0x1d')]);router[_0x3aa7('0x6')](_0x3aa7('0x1e'),auth[_0x3aa7('0x7')](),controller['voiceQueuesChannelRedirect']);router[_0x3aa7('0x6')](_0x3aa7('0x1f'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x20')]);router['put'](_0x3aa7('0x1f'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x21')]);router[_0x3aa7('0x6')](_0x3aa7('0x22'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x23')]);router[_0x3aa7('0x6')](_0x3aa7('0x24'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x25')]);router[_0x3aa7('0x6')](_0x3aa7('0x26'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x27')]);router[_0x3aa7('0x28')](_0x3aa7('0x29'),auth['isAuthenticated'](),controller[_0x3aa7('0x2a')]);router['get'](_0x3aa7('0x2b'),auth['isAuthenticated'](),controller['telephones']);router[_0x3aa7('0x6')]('/trunks',auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x2c')]);router[_0x3aa7('0x6')]('/campaigns',auth['isAuthenticated'](),controller[_0x3aa7('0x2d')]);router['get'](_0x3aa7('0x2e'),auth['isAuthenticated'](),controller[_0x3aa7('0x2f')]);router['get']('/chat/queues/waitinginteractions',auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x30')]);router[_0x3aa7('0x6')]('/mail/queues/waitinginteractions',auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x31')]);router[_0x3aa7('0x6')](_0x3aa7('0x32'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x33')]);router['get'](_0x3aa7('0x34'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x35')]);router[_0x3aa7('0x6')](_0x3aa7('0x36'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x37')]);router[_0x3aa7('0x6')](_0x3aa7('0x38'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x39')]);router[_0x3aa7('0x6')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x3aa7('0x3a')]);router[_0x3aa7('0x3b')](_0x3aa7('0x3c'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x3d')]('mail'));router[_0x3aa7('0x6')](_0x3aa7('0x3e'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x3f')]);router[_0x3aa7('0x3b')](_0x3aa7('0x40'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x3d')](_0x3aa7('0x41')));router[_0x3aa7('0x6')](_0x3aa7('0x42'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x43')]);router[_0x3aa7('0x3b')](_0x3aa7('0x44'),auth['isAuthenticated'](),controller[_0x3aa7('0x3d')]('fax'));router[_0x3aa7('0x6')](_0x3aa7('0x45'),auth['isAuthenticated'](),controller['showFaxQueues']);router[_0x3aa7('0x3b')](_0x3aa7('0x46'),auth['isAuthenticated'](),controller[_0x3aa7('0x3d')]('openchannel'));router[_0x3aa7('0x6')]('/openchannel/queues/:id',auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0x3aa7('0x3b')](_0x3aa7('0x47'),auth[_0x3aa7('0x7')](),controller['queueNotify'](_0x3aa7('0x48')));router[_0x3aa7('0x3b')]('/whatsapp/queues/:id/notify',auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x3d')]('whatsapp'));router[_0x3aa7('0x6')](_0x3aa7('0x49'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x4a')]);router[_0x3aa7('0x6')](_0x3aa7('0x4b'),auth[_0x3aa7('0x7')](),controller[_0x3aa7('0x4c')]);router[_0x3aa7('0x3b')]('/agents/:id/notify',auth['isAuthenticated'](),controller[_0x3aa7('0x4d')]);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 8b3023d..70cc559 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 _0x33c5=['VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','merge','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','INTERACTION','length','format','updateAttributes','findOrCreate','SIP/%s','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','Account','findOne','Message','messageId','Interaction','update','queue','InteractionId','From','QueueId','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','Agent\x20not\x20found','\x20Message\x20not\x20found','TransferReport','create','agentTransferTimeout','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0x33c5,0xe6));var _0x533c=function(_0x399849,_0x3b630d){_0x399849=_0x399849-0x0;var _0xfbb04=_0x33c5[_0x399849];return _0xfbb04;};'use strict';var BPromise=require('bluebird');var moment=require(_0x533c('0x0'));var _=require(_0x533c('0x1'));var util=require('util');var db=require(_0x533c('0x2'))['db'];var logger=require(_0x533c('0x3'))(_0x533c('0x4'));var jayson=require(_0x533c('0x5'));var amiClient=jayson[_0x533c('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0x533c('0x6')][_0x533c('0x7')]({'port':0x232b});var routingClient=jayson[_0x533c('0x6')][_0x533c('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x34ca89,_0x1699d5,_0x3a009b){return new BPromise(function(_0x36d74e,_0x2c297c){var _0x1b929b=_0x3a009b?_0x3a009b:amiClient;return _0x1b929b[_0x533c('0x8')](_0x34ca89,_0x1699d5)[_0x533c('0x9')](function(_0x2c0214){if(_0x2c0214[_0x533c('0xa')]){if(_0x2c0214[_0x533c('0xa')][_0x533c('0xb')]===0x1f4){return _0x2c297c(_0x2c0214['error'][_0x533c('0xc')]);}return _0x36d74e(_0x2c0214[_0x533c('0xa')][_0x533c('0xc')]);}else{_0x36d74e(_0x2c0214[_0x533c('0xd')]);}})[_0x533c('0xe')](function(_0x346e0f){_0x2c297c(_0x346e0f);});});}function respondWithResult(_0x530e10,_0x5c9462){_0x5c9462=_0x5c9462||0xc8;return function(_0xf93007){if(_0xf93007){return _0x530e10[_0x533c('0xf')](_0x5c9462)[_0x533c('0x10')](_0xf93007);}return _0x530e10[_0x533c('0x11')](0x194);};}function handleError(_0x1a2a83,_0x8d7c66){_0x8d7c66=_0x8d7c66||0x1f4;return function(_0xa616ca){logger['error'](_0xa616ca[_0x533c('0x12')]);if(_0xa616ca[_0x533c('0x13')]){delete _0xa616ca[_0x533c('0x13')];}_0x1a2a83[_0x533c('0xf')](_0x8d7c66)['send'](_0xa616ca);};}function findById(_0x1031e7){return function(_0x1ed6ba){if(!_[_0x533c('0x14')](_0x1031e7)&&!_[_0x533c('0x14')](_0x1ed6ba)&&!_[_0x533c('0x14')](_0x1ed6ba[_0x533c('0x15')])){return _[_0x533c('0x16')](_0x1ed6ba[_0x533c('0x15')],function(_0x1f9f85){return _0x1f9f85['id']==_0x1031e7;});}return null;};}exports[_0x533c('0x17')]=function(_0x287b9e,_0x2c41e9){return respondWithRpcPromise(_0x533c('0x18'),_0x287b9e[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x2c41e9,null))[_0x533c('0xe')](handleError(_0x2c41e9,null));};exports[_0x533c('0x1a')]=function(_0x2bc58f,_0x4ba0bd){return respondWithRpcPromise(_0x533c('0x1b'),_['merge'](_0x2bc58f['query'],_0x2bc58f[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x4ba0bd,null))['catch'](handleError(_0x4ba0bd,null));};exports[_0x533c('0x1d')]=function(_0x37651e,_0x3839fe){return respondWithRpcPromise(_0x533c('0x1e'),_['merge'](_0x37651e[_0x533c('0x19')],_0x37651e[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x3839fe,null))[_0x533c('0xe')](handleError(_0x3839fe,null));};exports[_0x533c('0x1f')]=function(_0x140269,_0xb51a5){return respondWithRpcPromise(_0x533c('0x20'),_0x140269[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0xb51a5,null))['catch'](handleError(_0xb51a5,null));};exports[_0x533c('0x21')]=function(_0xfab4da,_0x503c2e){return respondWithRpcPromise(_0x533c('0x20'),_0xfab4da['query'])[_0x533c('0x9')](findById(_0xfab4da[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x503c2e,null))[_0x533c('0xe')](handleError(_0x503c2e,null));};exports[_0x533c('0x22')]=function(_0x146a8e,_0x212d1b){return respondWithRpcPromise(_0x533c('0x23'),_[_0x533c('0x24')](_0x146a8e[_0x533c('0x25')],_0x146a8e[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x212d1b,null))['catch'](handleError(_0x212d1b,null));};exports[_0x533c('0x26')]=function(_0x591499,_0x3290de){return respondWithRpcPromise(_0x533c('0x27'),_[_0x533c('0x24')](_0x591499[_0x533c('0x19')],_0x591499[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x3290de,null))[_0x533c('0xe')](handleError(_0x3290de,null));};exports[_0x533c('0x28')]=function(_0x287ee5,_0x47831f){return respondWithRpcPromise(_0x533c('0x29'),_0x287ee5[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x47831f,null))[_0x533c('0xe')](handleError(_0x47831f,null));};exports[_0x533c('0x2a')]=function(_0x5ac6b4,_0x2b801e){return respondWithRpcPromise(_0x533c('0x2b'),_[_0x533c('0x24')](_0x5ac6b4[_0x533c('0x19')],_0x5ac6b4['params']))[_0x533c('0x9')](respondWithResult(_0x2b801e,null))[_0x533c('0xe')](handleError(_0x2b801e,null));};exports[_0x533c('0x2c')]=function(_0x40f077,_0x1255b1){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x40f077['query'],_0x40f077['params']))['then'](respondWithResult(_0x1255b1,null))[_0x533c('0xe')](handleError(_0x1255b1,null));};exports['voiceQueuesChannelRedirect']=function(_0x42994d,_0x55726a){return respondWithRpcPromise(_0x533c('0x2d'),_[_0x533c('0x24')](_0x42994d[_0x533c('0x19')],_0x42994d['params']))[_0x533c('0x9')](respondWithResult(_0x55726a,null))[_0x533c('0xe')](handleError(_0x55726a,null));};exports[_0x533c('0x2e')]=function(_0x55b010,_0x160d4b){return respondWithRpcPromise(_0x533c('0x2f'),_0x55b010[_0x533c('0x19')])['then'](respondWithResult(_0x160d4b,null))[_0x533c('0xe')](handleError(_0x160d4b,null));};exports[_0x533c('0x30')]=function(_0x2cd02f,_0x3f2b53){return respondWithRpcPromise(_0x533c('0x31'),_0x2cd02f[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x3f2b53,null))[_0x533c('0xe')](handleError(_0x3f2b53,null));};exports[_0x533c('0x32')]=function(_0x2c03fa,_0x298cea){var _0x55af6e;return respondWithRpcPromise(_0x533c('0x33'),_0x2c03fa[_0x533c('0x19')])[_0x533c('0x9')](function(_0x3562b8){_0x55af6e=_0x3562b8;return respondWithRpcPromise(_0x533c('0x33'),_0x2c03fa[_0x533c('0x19')],routingClient);})['then'](function(_0x88ea5d){return _[_0x533c('0x24')]({},_0x88ea5d,_0x55af6e);})[_0x533c('0x9')](respondWithResult(_0x298cea,null))['catch'](handleError(_0x298cea,null));};exports[_0x533c('0x34')]=function(_0x4170e4,_0x315e67){if(_0x4170e4[_0x533c('0x25')]&&_0x4170e4['body'][_0x533c('0x35')]&&_0x4170e4['user']&&_0x4170e4[_0x533c('0x36')][_0x533c('0x13')]){for(var _0x55a372 in _0x4170e4[_0x533c('0x25')][_0x533c('0x35')]){if(_0x4170e4[_0x533c('0x25')]['interaction']['hasOwnProperty'](_0x55a372)){db['MemberReport']['findAll']({'where':{'channel':_0x55a372,'membername':_0x4170e4[_0x533c('0x36')]['name'],'type':_0x533c('0x37'),'exitAt':null,'uniqueid':_0x4170e4['body'][_0x533c('0x35')][_0x55a372]&&_0x4170e4['body'][_0x533c('0x35')][_0x55a372][_0x533c('0x38')]?{'$notIn':_0x4170e4['body'][_0x533c('0x35')][_0x55a372]}:{'$ne':null}}})[_0x533c('0x9')](function(_0x27ac8e){var _0x10e374=moment()[_0x533c('0x39')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x47cca7=0x0,_0x22dc87=_0x27ac8e[_0x533c('0x38')];_0x47cca7<_0x22dc87;_0x47cca7+=0x1){_0x27ac8e[_0x47cca7][_0x533c('0x3a')]({'exitAt':_0x10e374});}});for(var _0x4fcdc5=0x0;_0x4fcdc5<_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372]['length'];_0x4fcdc5+=0x1){db['MemberReport'][_0x533c('0x3b')]({'where':{'channel':_0x55a372,'membername':_0x4170e4['user'][_0x533c('0x13')],'type':_0x533c('0x37'),'uniqueid':_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372][_0x4fcdc5],'exitAt':null},'defaults':{'channel':_0x55a372,'membername':_0x4170e4[_0x533c('0x36')][_0x533c('0x13')],'interface':_[_0x533c('0x14')](_0x4170e4[_0x533c('0x36')]['interface'])?util[_0x533c('0x39')](_0x533c('0x3c'),_0x4170e4[_0x533c('0x36')]['name']):_0x4170e4[_0x533c('0x36')][_0x533c('0x3d')],'type':'INTERACTION','enterAt':moment()[_0x533c('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x533c('0x3e'),'internal':_0x4170e4[_0x533c('0x36')][_0x533c('0x3f')],'uniqueid':_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372][_0x4fcdc5]}});}}}}return respondWithRpcPromise(_0x533c('0x40'),{'id':_0x4170e4[_0x533c('0x1c')]['id'],'capacity':_0x4170e4['body'][_0x533c('0x41')]},routingClient)[_0x533c('0x9')](respondWithResult(_0x315e67,null))[_0x533c('0xe')](handleError(_0x315e67,null));};exports[_0x533c('0x42')]=function(_0x24ca50,_0x1558ef){return respondWithRpcPromise(_0x533c('0x43'),_0x24ca50['query'])['then'](respondWithResult(_0x1558ef,null))['catch'](handleError(_0x1558ef,null));};exports['trunks']=function(_0xc99f96,_0x4434a1){return respondWithRpcPromise('Trunks',_0xc99f96[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x4434a1,null))[_0x533c('0xe')](handleError(_0x4434a1,null));};exports['campaigns']=function(_0x1de19e,_0x564a31){return respondWithRpcPromise('Campaigns',_0x1de19e[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x564a31,null))[_0x533c('0xe')](handleError(_0x564a31,null));};exports[_0x533c('0x44')]=function(_0x381544,_0x3bb176){return respondWithRpcPromise(_0x533c('0x45'),_0x381544['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x3bb176,null))['catch'](handleError(_0x3bb176,null));};exports[_0x533c('0x46')]=function(_0x26645d,_0x274686){return respondWithRpcPromise(_0x533c('0x45'),_0x26645d[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x26645d[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x274686,null))['catch'](handleError(_0x274686,null));};exports[_0x533c('0x47')]=function(_0x43a333,_0x163563){return respondWithRpcPromise(_0x533c('0x48'),_0x43a333[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x163563,null))['catch'](handleError(_0x163563,null));};exports[_0x533c('0x49')]=function(_0x554a9f,_0x43383e){return respondWithRpcPromise(_0x533c('0x48'),_0x554a9f[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x554a9f[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x43383e,null))['catch'](handleError(_0x43383e,null));};exports['mailAccounts']=function(_0x1005a6,_0x376619){return respondWithRpcPromise(_0x533c('0x4a'),_0x1005a6[_0x533c('0x19')],mailClient)['then'](respondWithResult(_0x376619,null))[_0x533c('0xe')](handleError(_0x376619,null));};exports[_0x533c('0x4b')]=function(_0x8e04c7,_0x352e07){return respondWithRpcPromise(_0x533c('0x4c'),_0x8e04c7[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x352e07,null))[_0x533c('0xe')](handleError(_0x352e07,null));};exports[_0x533c('0x4d')]=function(_0x3aba19,_0x404a93){return respondWithRpcPromise(_0x533c('0x4c'),_0x3aba19[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x3aba19[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x404a93,null))[_0x533c('0xe')](handleError(_0x404a93,null));};exports['smsQueues']=function(_0x31bba1,_0x5206ad){return respondWithRpcPromise('SmsQueues',_0x31bba1[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x5206ad,null))[_0x533c('0xe')](handleError(_0x5206ad,null));};exports[_0x533c('0x4e')]=function(_0x417158,_0x1eaf34){return respondWithRpcPromise(_0x533c('0x4f'),_0x417158['query'],routingClient)[_0x533c('0x9')](findById(_0x417158[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x1eaf34,null))[_0x533c('0xe')](handleError(_0x1eaf34,null));};exports[_0x533c('0x50')]=function(_0x8174d0,_0x3e3b25){return respondWithRpcPromise('WhatsappQueues',_0x8174d0[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x3e3b25,null))['catch'](handleError(_0x3e3b25,null));};exports[_0x533c('0x51')]=function(_0x3e8d57,_0x5f2b8b){return respondWithRpcPromise(_0x533c('0x52'),_0x3e8d57[_0x533c('0x19')],routingClient)['then'](findById(_0x3e8d57[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x5f2b8b,null))['catch'](handleError(_0x5f2b8b,null));};exports[_0x533c('0x53')]=function(_0x28239c,_0x451def){return respondWithRpcPromise(_0x533c('0x54'),_0x28239c['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x451def,null))[_0x533c('0xe')](handleError(_0x451def,null));};exports[_0x533c('0x55')]=function(_0x245792,_0x20d344){return respondWithRpcPromise('FaxQueues',_0x245792[_0x533c('0x19')],routingClient)['then'](findById(_0x245792[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x20d344,null))[_0x533c('0xe')](handleError(_0x20d344,null));};exports['faxAccounts']=function(_0x4bd014,_0x511f74){return respondWithRpcPromise(_0x533c('0x56'),_0x4bd014[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x511f74,null))['catch'](handleError(_0x511f74,null));};exports[_0x533c('0x57')]=function(_0x24a00c,_0x3fbb08){return respondWithRpcPromise(_0x533c('0x58'),_0x24a00c[_0x533c('0x19')],routingClient)['then'](respondWithResult(_0x3fbb08,null))['catch'](handleError(_0x3fbb08,null));};exports[_0x533c('0x59')]=function(_0x313fa5,_0x2c0f59){return respondWithRpcPromise(_0x533c('0x5a'),_0x313fa5[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x2c0f59,null))[_0x533c('0xe')](handleError(_0x2c0f59,null));};exports[_0x533c('0x5b')]=function(_0x45c4ca,_0x4f0961){return respondWithRpcPromise(_0x533c('0x5c'),_0x45c4ca[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x4f0961,null))[_0x533c('0xe')](handleError(_0x4f0961,null));};exports[_0x533c('0x5d')]=function(_0x18102b,_0x1b9816){return respondWithRpcPromise(_0x533c('0x5c'),_0x18102b[_0x533c('0x19')],routingClient)[_0x533c('0x9')](function(_0xfd598d){if(_0x18102b[_0x533c('0x19')][_0x533c('0x5e')]!==undefined){var _0x452915=_(_0xfd598d[_0x533c('0x15')])[_0x533c('0x5f')]([_0x18102b[_0x533c('0x19')]['type'],_0x18102b[_0x533c('0x1c')]['id']])[_0x533c('0x60')]('queue_id')['uniq']()[_0x533c('0x61')]();return _0xfd598d['rows'][_0x533c('0x5f')](function(_0x307fe5){return _0x452915[_0x533c('0x62')](_0x307fe5[_0x533c('0x63')])>-0x1;});}else{return _0xfd598d[_0x533c('0x15')]['filter'](function(_0x275db2){return _0x275db2[_0x533c('0x63')]===parseInt(_0x18102b[_0x533c('0x1c')]['id']);});}})[_0x533c('0x9')](respondWithResult(_0x1b9816,null))[_0x533c('0xe')](handleError(_0x1b9816,null));};exports[_0x533c('0x64')]=function(_0x1aa938,_0x248ede){return respondWithRpcPromise(_0x533c('0x65'),_0x1aa938[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x248ede,null))[_0x533c('0xe')](handleError(_0x248ede,null));};exports[_0x533c('0x66')]=function(_0x452759,_0x9c8d2){return respondWithRpcPromise(_0x533c('0x67'),_0x452759[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x9c8d2,null))['catch'](handleError(_0x9c8d2,null));};exports[_0x533c('0x68')]=function(_0x15d09a,_0x247915){return respondWithRpcPromise(_0x533c('0x69'),_0x15d09a['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x247915,null))[_0x533c('0xe')](handleError(_0x247915,null));};exports['queueNotify']=function(_0x411f86){return function(_0x5b8ead,_0x291be3){var _0x4be94e,_0x11654c;var _0x33a661=_[_0x533c('0x6a')](_0x411f86);var _0x5c938c=_0x411f86==='chat'?'Website':_0x533c('0x6b');return db[_0x33a661+'Queue'][_0x533c('0x6c')]({'raw':!![],'where':{'id':_0x5b8ead[_0x533c('0x1c')]['id']}})[_0x533c('0x9')](function(_0x450152){if(_['isNil'](_0x450152)){throw new Error(_0x33a661+'\x20Queue\x20not\x20found');}_0x4be94e=_0x450152;return db[_0x33a661+_0x533c('0x6d')]['findOne']({'where':{'id':_0x5b8ead[_0x533c('0x25')][_0x533c('0x6e')]},'include':[{'model':db[_0x33a661+_0x533c('0x6f')],'as':'Interaction'},{'model':db[_0x33a661+_0x5c938c],'as':_0x533c('0x6b')}]});})['then'](function(_0x6e0d38){if(_[_0x533c('0x14')](_0x6e0d38)){throw new Error(_0x33a661+'\x20Message\x20not\x20found');}_0x11654c=_0x6e0d38;return _0x6e0d38[_0x533c('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x533c('0x9')](function(){var _0x1c9381={'uniqueid':_0x411f86+'.'+_0x11654c['id']+'.'+_0x11654c[_0x533c('0x6f')]['id'],'FromUserId':_0x5b8ead[_0x533c('0x36')]['id'],'type':_0x533c('0x71')};_0x1c9381[_0x33a661+'MessageId']=_0x11654c['id'];_0x1c9381[_0x33a661+_0x533c('0x72')]=_0x11654c[_0x533c('0x6f')]['id'];_0x1c9381[_0x533c('0x73')+_0x33a661+_0x5c938c+'Id']=_0x11654c['Account']['id'];_0x1c9381['To'+_0x33a661+_0x533c('0x74')]=_0x4be94e['id'];return db[_0x33a661+'TransferReport']['create'](_0x1c9381);})[_0x533c('0x9')](function(){return respondWithRpcPromise(_0x533c('0x75'),{'channel':_0x411f86,'interaction':_0x11654c['Interaction'],'message':_0x11654c,'account':_0x11654c[_0x533c('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x533c('0x71'),'appdata':_0x4be94e[_0x533c('0x13')]+','+(_0x11654c[_0x533c('0x6b')][_0x533c('0x76')]||0x12c),'interval':_0x533c('0x77')}]},routingClient);})[_0x533c('0x9')](respondWithResult(_0x291be3,null))[_0x533c('0xe')](handleError(_0x291be3,null));};};exports[_0x533c('0x78')]=function(_0x299f43,_0x14db14){var _0x243d1a,_0x368552;if(_['isNil'](_0x299f43[_0x533c('0x25')][_0x533c('0x79')])){throw new Error(_0x533c('0x7a'));}var _0x4c3f6d=_0x299f43[_0x533c('0x25')]['channel'];var _0x2c7faf=_[_0x533c('0x6a')](_0x4c3f6d);var _0x2377a3=_0x4c3f6d==='chat'?_0x533c('0x7b'):_0x533c('0x6b');return db[_0x533c('0x7c')]['findOne']({'raw':!![],'where':{'id':_0x299f43['params']['id'],'role':_0x533c('0x3e')}})['then'](function(_0x392968){if(_['isNil'](_0x392968)){throw new Error(_0x533c('0x7d'));}_0x243d1a=_0x392968;return db[_0x2c7faf+_0x533c('0x6d')][_0x533c('0x6c')]({'where':{'id':_0x299f43['body']['messageId']},'include':[{'model':db[_0x2c7faf+_0x533c('0x6f')],'as':_0x533c('0x6f')},{'model':db[_0x2c7faf+_0x2377a3],'as':_0x533c('0x6b')}]});})[_0x533c('0x9')](function(_0x313916){if(_[_0x533c('0x14')](_0x313916)){throw new Error(_0x2c7faf+_0x533c('0x7e'));}_0x368552=_0x313916;return _0x313916[_0x533c('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x533c('0x9')](function(){var _0x5307b3={'uniqueid':_0x4c3f6d+'.'+_0x368552['id']+'.'+_0x368552[_0x533c('0x6f')]['id'],'FromUserId':_0x299f43[_0x533c('0x36')]['id'],'type':_0x533c('0x71'),'ToUserId':_0x243d1a['id']};_0x5307b3[_0x2c7faf+'MessageId']=_0x368552['id'];_0x5307b3[_0x2c7faf+_0x533c('0x72')]=_0x368552[_0x533c('0x6f')]['id'];_0x5307b3[_0x533c('0x73')+_0x2c7faf+_0x2377a3+'Id']=_0x368552[_0x533c('0x6b')]['id'];return db[_0x2c7faf+_0x533c('0x7f')][_0x533c('0x80')](_0x5307b3);})[_0x533c('0x9')](function(){return respondWithRpcPromise(_0x533c('0x75'),{'channel':_0x4c3f6d,'interaction':_0x368552[_0x533c('0x6f')],'message':_0x368552,'account':_0x368552[_0x533c('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x533c('0x3e'),'appdata':_0x243d1a[_0x533c('0x13')]+','+(_0x368552['Account'][_0x533c('0x81')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x533c('0x9')](respondWithResult(_0x14db14,null))[_0x533c('0xe')](handleError(_0x14db14,null));}; \ No newline at end of file +var _0xed1f=['voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','then','voiceChannelStopMixMonitor','params','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','OutboundChannels','agents','Agents','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','filter','type','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','queue','MessageId','From','QueueId','TransferReport','create','Start','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','chat','User','update','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','code','message','catch','json','sendStatus','stack','name','status','isNil','rows','find','VoiceChannels','query'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xed1f,0x6a));var _0xfed1=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xed1f[_0x9dfc10];return _0x4f938a;};'use strict';var BPromise=require(_0xfed1('0x0'));var moment=require(_0xfed1('0x1'));var _=require(_0xfed1('0x2'));var util=require(_0xfed1('0x3'));var db=require(_0xfed1('0x4'))['db'];var logger=require(_0xfed1('0x5'))(_0xfed1('0x6'));var jayson=require(_0xfed1('0x7'));var amiClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232a});var mailClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232b});var routingClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){var _0x42dd5c=_0x2a6082?_0x2a6082:amiClient;return _0x42dd5c[_0xfed1('0xa')](_0x380e18,_0x612b38)['then'](function(_0x1414be){if(_0x1414be[_0xfed1('0xb')]){if(_0x1414be['error'][_0xfed1('0xc')]===0x1f4){return _0x568d48(_0x1414be['error'][_0xfed1('0xd')]);}return _0x2967ef(_0x1414be[_0xfed1('0xb')]['message']);}else{_0x2967ef(_0x1414be['result']);}})[_0xfed1('0xe')](function(_0xe84ba6){_0x568d48(_0xe84ba6);});});}function respondWithResult(_0x569a6e,_0x17f4fe){_0x17f4fe=_0x17f4fe||0xc8;return function(_0x5a3469){if(_0x5a3469){return _0x569a6e['status'](_0x17f4fe)[_0xfed1('0xf')](_0x5a3469);}return _0x569a6e[_0xfed1('0x10')](0x194);};}function handleError(_0x532537,_0x2dde3a){_0x2dde3a=_0x2dde3a||0x1f4;return function(_0x5b9455){logger['error'](_0x5b9455[_0xfed1('0x11')]);if(_0x5b9455[_0xfed1('0x12')]){delete _0x5b9455[_0xfed1('0x12')];}_0x532537[_0xfed1('0x13')](_0x2dde3a)['send'](_0x5b9455);};}function findById(_0x1a00f6){return function(_0x4af928){if(!_[_0xfed1('0x14')](_0x1a00f6)&&!_[_0xfed1('0x14')](_0x4af928)&&!_['isNil'](_0x4af928[_0xfed1('0x15')])){return _[_0xfed1('0x16')](_0x4af928['rows'],function(_0x59509b){return _0x59509b['id']==_0x1a00f6;});}return null;};}exports['voiceChannels']=function(_0x1e5afb,_0x51f12a){return respondWithRpcPromise(_0xfed1('0x17'),_0x1e5afb[_0xfed1('0x18')])['then'](respondWithResult(_0x51f12a,null))[_0xfed1('0xe')](handleError(_0x51f12a,null));};exports[_0xfed1('0x19')]=function(_0x59ee9d,_0x3ce944){return respondWithRpcPromise(_0xfed1('0x1a'),_[_0xfed1('0x1b')](_0x59ee9d[_0xfed1('0x18')],_0x59ee9d['params']))[_0xfed1('0x1c')](respondWithResult(_0x3ce944,null))['catch'](handleError(_0x3ce944,null));};exports[_0xfed1('0x1d')]=function(_0x1317c8,_0x37c384){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xfed1('0x1b')](_0x1317c8['query'],_0x1317c8[_0xfed1('0x1e')]))[_0xfed1('0x1c')](respondWithResult(_0x37c384,null))[_0xfed1('0xe')](handleError(_0x37c384,null));};exports[_0xfed1('0x1f')]=function(_0x186ecc,_0x1199b7){return respondWithRpcPromise('VoiceQueues',_0x186ecc[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x1199b7,null))['catch'](handleError(_0x1199b7,null));};exports[_0xfed1('0x20')]=function(_0x2b9dd2,_0x1b871a){return respondWithRpcPromise(_0xfed1('0x21'),_0x2b9dd2[_0xfed1('0x18')])[_0xfed1('0x1c')](findById(_0x2b9dd2['params']['id']))[_0xfed1('0x1c')](respondWithResult(_0x1b871a,null))['catch'](handleError(_0x1b871a,null));};exports[_0xfed1('0x22')]=function(_0x4e5249,_0x53b0c9){return respondWithRpcPromise(_0xfed1('0x23'),_[_0xfed1('0x1b')](_0x4e5249[_0xfed1('0x24')],_0x4e5249['params']))[_0xfed1('0x1c')](respondWithResult(_0x53b0c9,null))[_0xfed1('0xe')](handleError(_0x53b0c9,null));};exports[_0xfed1('0x25')]=function(_0x383955,_0x12399f){return respondWithRpcPromise(_0xfed1('0x26'),_['merge'](_0x383955[_0xfed1('0x18')],_0x383955[_0xfed1('0x1e')]))['then'](respondWithResult(_0x12399f,null))['catch'](handleError(_0x12399f,null));};exports[_0xfed1('0x27')]=function(_0x2d10f5,_0x2def09){return respondWithRpcPromise(_0xfed1('0x28'),_0x2d10f5[_0xfed1('0x18')])['then'](respondWithResult(_0x2def09,null))[_0xfed1('0xe')](handleError(_0x2def09,null));};exports[_0xfed1('0x29')]=function(_0x10143b,_0x349de1){return respondWithRpcPromise(_0xfed1('0x2a'),_['merge'](_0x10143b[_0xfed1('0x18')],_0x10143b['params']))[_0xfed1('0x1c')](respondWithResult(_0x349de1,null))[_0xfed1('0xe')](handleError(_0x349de1,null));};exports[_0xfed1('0x2b')]=function(_0x321c1b,_0x1c0523){return respondWithRpcPromise(_0xfed1('0x2c'),_[_0xfed1('0x1b')](_0x321c1b[_0xfed1('0x18')],_0x321c1b['params']))[_0xfed1('0x1c')](respondWithResult(_0x1c0523,null))[_0xfed1('0xe')](handleError(_0x1c0523,null));};exports[_0xfed1('0x2d')]=function(_0x28adfc,_0x57da75){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xfed1('0x1b')](_0x28adfc[_0xfed1('0x18')],_0x28adfc[_0xfed1('0x1e')]))[_0xfed1('0x1c')](respondWithResult(_0x57da75,null))[_0xfed1('0xe')](handleError(_0x57da75,null));};exports[_0xfed1('0x2e')]=function(_0x46a150,_0x2f183c){return respondWithRpcPromise('Outbound',_0x46a150['query'])[_0xfed1('0x1c')](respondWithResult(_0x2f183c,null))[_0xfed1('0xe')](handleError(_0x2f183c,null));};exports['outboundChannels']=function(_0x1dae7c,_0x15339c){return respondWithRpcPromise(_0xfed1('0x2f'),_0x1dae7c[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x15339c,null))[_0xfed1('0xe')](handleError(_0x15339c,null));};exports[_0xfed1('0x30')]=function(_0x4118d4,_0x3c27de){var _0x5f3e1f;return respondWithRpcPromise('Agents',_0x4118d4['query'])[_0xfed1('0x1c')](function(_0x340e3c){_0x5f3e1f=_0x340e3c;return respondWithRpcPromise(_0xfed1('0x31'),_0x4118d4['query'],routingClient);})[_0xfed1('0x1c')](function(_0x4a0b04){return _[_0xfed1('0x1b')]({},_0x4a0b04,_0x5f3e1f);})[_0xfed1('0x1c')](respondWithResult(_0x3c27de,null))[_0xfed1('0xe')](handleError(_0x3c27de,null));};exports['agentCapacity']=function(_0x20bdae,_0x6f1647){if(_0x20bdae[_0xfed1('0x24')]&&_0x20bdae['body'][_0xfed1('0x32')]&&_0x20bdae['user']&&_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')]){for(var _0x229fc7 in _0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')]){if(_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0xfed1('0x34')](_0x229fc7)){db[_0xfed1('0x35')]['findAll']({'where':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'type':_0xfed1('0x36'),'exitAt':null,'uniqueid':_0x20bdae['body']['interaction'][_0x229fc7]&&_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xfed1('0x37')]?{'$notIn':_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7]}:{'$ne':null}}})[_0xfed1('0x1c')](function(_0x2547ee){var _0x24bf7a=moment()[_0xfed1('0x38')](_0xfed1('0x39'));for(var _0x61f65b=0x0,_0x1db6dc=_0x2547ee['length'];_0x61f65b<_0x1db6dc;_0x61f65b+=0x1){_0x2547ee[_0x61f65b][_0xfed1('0x3a')]({'exitAt':_0x24bf7a});}});for(var _0xb61d09=0x0;_0xb61d09<_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xfed1('0x37')];_0xb61d09+=0x1){db[_0xfed1('0x35')]['findOrCreate']({'where':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'type':_0xfed1('0x36'),'uniqueid':_0x20bdae['body'][_0xfed1('0x32')][_0x229fc7][_0xb61d09],'exitAt':null},'defaults':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'interface':_[_0xfed1('0x14')](_0x20bdae['user'][_0xfed1('0x3b')])?util[_0xfed1('0x38')](_0xfed1('0x3c'),_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')]):_0x20bdae[_0xfed1('0x33')][_0xfed1('0x3b')],'type':_0xfed1('0x36'),'enterAt':moment()[_0xfed1('0x38')](_0xfed1('0x39')),'role':_0xfed1('0x3d'),'internal':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x3e')],'uniqueid':_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xb61d09]}});}}}}return respondWithRpcPromise(_0xfed1('0x3f'),{'id':_0x20bdae[_0xfed1('0x1e')]['id'],'capacity':_0x20bdae[_0xfed1('0x24')]['capacity']},routingClient)['then'](respondWithResult(_0x6f1647,null))[_0xfed1('0xe')](handleError(_0x6f1647,null));};exports[_0xfed1('0x40')]=function(_0x5be0c3,_0x1358c1){return respondWithRpcPromise('Telephones',_0x5be0c3[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x1358c1,null))['catch'](handleError(_0x1358c1,null));};exports['trunks']=function(_0x49f696,_0x2376b3){return respondWithRpcPromise(_0xfed1('0x41'),_0x49f696[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x2376b3,null))[_0xfed1('0xe')](handleError(_0x2376b3,null));};exports[_0xfed1('0x42')]=function(_0x1a9f22,_0x144102){return respondWithRpcPromise(_0xfed1('0x43'),_0x1a9f22[_0xfed1('0x18')])['then'](respondWithResult(_0x144102,null))['catch'](handleError(_0x144102,null));};exports[_0xfed1('0x44')]=function(_0x2a2eaa,_0x3f4db7){return respondWithRpcPromise(_0xfed1('0x45'),_0x2a2eaa[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x3f4db7,null))[_0xfed1('0xe')](handleError(_0x3f4db7,null));};exports[_0xfed1('0x46')]=function(_0x117e25,_0x427fa6){return respondWithRpcPromise(_0xfed1('0x45'),_0x117e25[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x117e25[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x427fa6,null))[_0xfed1('0xe')](handleError(_0x427fa6,null));};exports[_0xfed1('0x47')]=function(_0x54eb53,_0x5b167b){return respondWithRpcPromise(_0xfed1('0x48'),_0x54eb53[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x5b167b,null))[_0xfed1('0xe')](handleError(_0x5b167b,null));};exports[_0xfed1('0x49')]=function(_0x41a22a,_0x2ccdc3){return respondWithRpcPromise(_0xfed1('0x48'),_0x41a22a[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x41a22a[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x2ccdc3,null))[_0xfed1('0xe')](handleError(_0x2ccdc3,null));};exports[_0xfed1('0x4a')]=function(_0x59ecc4,_0x30cf99){return respondWithRpcPromise('MailAccounts',_0x59ecc4['query'],mailClient)[_0xfed1('0x1c')](respondWithResult(_0x30cf99,null))['catch'](handleError(_0x30cf99,null));};exports[_0xfed1('0x4b')]=function(_0x5acc45,_0x390fc0){return respondWithRpcPromise(_0xfed1('0x4c'),_0x5acc45['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x390fc0,null))[_0xfed1('0xe')](handleError(_0x390fc0,null));};exports['showOpenchannelQueues']=function(_0x29b51e,_0x41b407){return respondWithRpcPromise(_0xfed1('0x4c'),_0x29b51e[_0xfed1('0x18')],routingClient)['then'](findById(_0x29b51e[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x41b407,null))[_0xfed1('0xe')](handleError(_0x41b407,null));};exports[_0xfed1('0x4d')]=function(_0x23347a,_0xf4e660){return respondWithRpcPromise(_0xfed1('0x4e'),_0x23347a[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0xf4e660,null))[_0xfed1('0xe')](handleError(_0xf4e660,null));};exports[_0xfed1('0x4f')]=function(_0x18e958,_0x4112c1){return respondWithRpcPromise(_0xfed1('0x4e'),_0x18e958[_0xfed1('0x18')],routingClient)['then'](findById(_0x18e958['params']['id']))['then'](respondWithResult(_0x4112c1,null))[_0xfed1('0xe')](handleError(_0x4112c1,null));};exports[_0xfed1('0x50')]=function(_0x3aea22,_0x2fb9b2){return respondWithRpcPromise('WhatsappQueues',_0x3aea22[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0x2fb9b2,null))[_0xfed1('0xe')](handleError(_0x2fb9b2,null));};exports[_0xfed1('0x51')]=function(_0x18af7d,_0x3beef3){return respondWithRpcPromise(_0xfed1('0x52'),_0x18af7d['query'],routingClient)[_0xfed1('0x1c')](findById(_0x18af7d[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x3beef3,null))['catch'](handleError(_0x3beef3,null));};exports[_0xfed1('0x53')]=function(_0x103628,_0x28dbaa){return respondWithRpcPromise(_0xfed1('0x54'),_0x103628['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x28dbaa,null))['catch'](handleError(_0x28dbaa,null));};exports[_0xfed1('0x55')]=function(_0x2d64d3,_0x4b685b){return respondWithRpcPromise('FaxQueues',_0x2d64d3[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x2d64d3[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x4b685b,null))['catch'](handleError(_0x4b685b,null));};exports[_0xfed1('0x56')]=function(_0x440e40,_0x42bc11){return respondWithRpcPromise(_0xfed1('0x57'),_0x440e40[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x42bc11,null))['catch'](handleError(_0x42bc11,null));};exports[_0xfed1('0x58')]=function(_0x93411d,_0x5ceedd){return respondWithRpcPromise(_0xfed1('0x59'),_0x93411d[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x5ceedd,null))[_0xfed1('0xe')](handleError(_0x5ceedd,null));};exports[_0xfed1('0x5a')]=function(_0x26ecb9,_0x4fc7b5){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x26ecb9[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0x4fc7b5,null))[_0xfed1('0xe')](handleError(_0x4fc7b5,null));};exports[_0xfed1('0x5b')]=function(_0x5d8742,_0xdc237c){return respondWithRpcPromise(_0xfed1('0x5c'),_0x5d8742[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0xdc237c,null))[_0xfed1('0xe')](handleError(_0xdc237c,null));};exports[_0xfed1('0x5d')]=function(_0x4104fe,_0x49213b){return respondWithRpcPromise(_0xfed1('0x5c'),_0x4104fe[_0xfed1('0x18')],routingClient)['then'](function(_0x544605){if(_0x4104fe[_0xfed1('0x18')]['type']!==undefined){var _0x1f4e2b=_(_0x544605[_0xfed1('0x15')])[_0xfed1('0x5e')]([_0x4104fe['query'][_0xfed1('0x5f')],_0x4104fe[_0xfed1('0x1e')]['id']])[_0xfed1('0x60')](_0xfed1('0x61'))[_0xfed1('0x62')]()['value']();return _0x544605[_0xfed1('0x15')][_0xfed1('0x5e')](function(_0x45348d){return _0x1f4e2b[_0xfed1('0x63')](_0x45348d[_0xfed1('0x61')])>-0x1;});}else{return _0x544605['rows'][_0xfed1('0x5e')](function(_0xe74336){return _0xe74336[_0xfed1('0x61')]===parseInt(_0x4104fe[_0xfed1('0x1e')]['id']);});}})[_0xfed1('0x1c')](respondWithResult(_0x49213b,null))[_0xfed1('0xe')](handleError(_0x49213b,null));};exports[_0xfed1('0x64')]=function(_0x4238bd,_0x390eb0){return respondWithRpcPromise(_0xfed1('0x65'),_0x4238bd['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x390eb0,null))[_0xfed1('0xe')](handleError(_0x390eb0,null));};exports[_0xfed1('0x66')]=function(_0x383d34,_0x194f42){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x383d34[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x194f42,null))[_0xfed1('0xe')](handleError(_0x194f42,null));};exports[_0xfed1('0x67')]=function(_0x221ed8,_0xb76860){return respondWithRpcPromise(_0xfed1('0x68'),_0x221ed8[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0xb76860,null))['catch'](handleError(_0xb76860,null));};exports['queueNotify']=function(_0xc3b72a){return function(_0x547d9c,_0x25cebc){var _0x3ab92e,_0x483b16;var _0x4b355d=_['capitalize'](_0xc3b72a);var _0x304cc0=_0xc3b72a==='chat'?_0xfed1('0x69'):'Account';return db[_0x4b355d+_0xfed1('0x6a')][_0xfed1('0x6b')]({'raw':!![],'where':{'id':_0x547d9c[_0xfed1('0x1e')]['id']}})[_0xfed1('0x1c')](function(_0x3c6ddd){if(_['isNil'](_0x3c6ddd)){throw new Error(_0x4b355d+_0xfed1('0x6c'));}_0x3ab92e=_0x3c6ddd;return db[_0x4b355d+_0xfed1('0x6d')]['findOne']({'where':{'id':_0x547d9c[_0xfed1('0x24')][_0xfed1('0x6e')]},'include':[{'model':db[_0x4b355d+'Interaction'],'as':_0xfed1('0x6f')},{'model':db[_0x4b355d+_0x304cc0],'as':_0xfed1('0x70')}]});})[_0xfed1('0x1c')](function(_0x5cf634){if(_[_0xfed1('0x14')](_0x5cf634)){throw new Error(_0x4b355d+_0xfed1('0x71'));}_0x483b16=_0x5cf634;return _0x5cf634['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xfed1('0x1c')](function(){var _0xc81c8f={'uniqueid':_0xc3b72a+'.'+_0x483b16['id']+'.'+_0x483b16[_0xfed1('0x6f')]['id'],'FromUserId':_0x547d9c['user']['id'],'type':_0xfed1('0x72')};_0xc81c8f[_0x4b355d+_0xfed1('0x73')]=_0x483b16['id'];_0xc81c8f[_0x4b355d+'InteractionId']=_0x483b16['Interaction']['id'];_0xc81c8f[_0xfed1('0x74')+_0x4b355d+_0x304cc0+'Id']=_0x483b16[_0xfed1('0x70')]['id'];_0xc81c8f['To'+_0x4b355d+_0xfed1('0x75')]=_0x3ab92e['id'];return db[_0x4b355d+_0xfed1('0x76')][_0xfed1('0x77')](_0xc81c8f);})[_0xfed1('0x1c')](function(){return respondWithRpcPromise(_0xfed1('0x78'),{'channel':_0xc3b72a,'interaction':_0x483b16[_0xfed1('0x6f')],'message':_0x483b16,'account':_0x483b16[_0xfed1('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0xfed1('0x72'),'appdata':_0x3ab92e[_0xfed1('0x12')]+','+(_0x483b16[_0xfed1('0x70')]['queueTransferTimeout']||0x12c),'interval':_0xfed1('0x79')}]},routingClient);})[_0xfed1('0x1c')](respondWithResult(_0x25cebc,null))['catch'](handleError(_0x25cebc,null));};};exports[_0xfed1('0x7a')]=function(_0x1f721d,_0x5f5d42){var _0x3d4aee,_0x408ee0;if(_[_0xfed1('0x14')](_0x1f721d[_0xfed1('0x24')]['channel'])){throw new Error(_0xfed1('0x7b'));}var _0x24ab18=_0x1f721d[_0xfed1('0x24')][_0xfed1('0x7c')];var _0x1ecef6=_[_0xfed1('0x7d')](_0x24ab18);var _0x2d0cbb=_0x24ab18===_0xfed1('0x7e')?'Website':_0xfed1('0x70');return db[_0xfed1('0x7f')][_0xfed1('0x6b')]({'raw':!![],'where':{'id':_0x1f721d['params']['id'],'role':_0xfed1('0x3d')}})[_0xfed1('0x1c')](function(_0x45a677){if(_['isNil'](_0x45a677)){throw new Error('Agent\x20not\x20found');}_0x3d4aee=_0x45a677;return db[_0x1ecef6+_0xfed1('0x6d')][_0xfed1('0x6b')]({'where':{'id':_0x1f721d[_0xfed1('0x24')][_0xfed1('0x6e')]},'include':[{'model':db[_0x1ecef6+_0xfed1('0x6f')],'as':_0xfed1('0x6f')},{'model':db[_0x1ecef6+_0x2d0cbb],'as':_0xfed1('0x70')}]});})[_0xfed1('0x1c')](function(_0x130eb2){if(_[_0xfed1('0x14')](_0x130eb2)){throw new Error(_0x1ecef6+_0xfed1('0x71'));}_0x408ee0=_0x130eb2;return _0x130eb2[_0xfed1('0x80')]({'read':0x0,'readAt':null,'UserId':null});})[_0xfed1('0x1c')](function(){var _0x18b086={'uniqueid':_0x24ab18+'.'+_0x408ee0['id']+'.'+_0x408ee0[_0xfed1('0x6f')]['id'],'FromUserId':_0x1f721d[_0xfed1('0x33')]['id'],'type':_0xfed1('0x72'),'ToUserId':_0x3d4aee['id']};_0x18b086[_0x1ecef6+_0xfed1('0x73')]=_0x408ee0['id'];_0x18b086[_0x1ecef6+_0xfed1('0x81')]=_0x408ee0[_0xfed1('0x6f')]['id'];_0x18b086['From'+_0x1ecef6+_0x2d0cbb+'Id']=_0x408ee0[_0xfed1('0x70')]['id'];return db[_0x1ecef6+_0xfed1('0x76')][_0xfed1('0x77')](_0x18b086);})['then'](function(){return respondWithRpcPromise(_0xfed1('0x78'),{'channel':_0x24ab18,'interaction':_0x408ee0[_0xfed1('0x6f')],'message':_0x408ee0,'account':_0x408ee0[_0xfed1('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0xfed1('0x3d'),'appdata':_0x3d4aee[_0xfed1('0x12')]+','+(_0x408ee0[_0xfed1('0x70')][_0xfed1('0x82')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x5f5d42,null))[_0xfed1('0xe')](handleError(_0x5f5d42,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index cc6a589..f564a2b 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 _0xdbdb=['/:id/run','run','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','index','/:id','show'];(function(_0x42c57e,_0xe66986){var _0x5105da=function(_0x4065db){while(--_0x4065db){_0x42c57e['push'](_0x42c57e['shift']());}};_0x5105da(++_0xe66986);}(_0xdbdb,0x162));var _0xbdbd=function(_0x599318,_0x319486){_0x599318=_0x599318-0x0;var _0x7b06fa=_0xdbdb[_0x599318];return _0x7b06fa;};'use strict';var multer=require(_0xbdbd('0x0'));var util=require(_0xbdbd('0x1'));var path=require(_0xbdbd('0x2'));var timeout=require(_0xbdbd('0x3'));var express=require(_0xbdbd('0x4'));var router=express[_0xbdbd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbdbd('0x6'));var interaction=require(_0xbdbd('0x7'));var config=require('../../config/environment');var controller=require(_0xbdbd('0x8'));router[_0xbdbd('0x9')]('/',auth[_0xbdbd('0xa')](),controller[_0xbdbd('0xb')]);router[_0xbdbd('0x9')](_0xbdbd('0xc'),auth['isAuthenticated'](),controller[_0xbdbd('0xd')]);router[_0xbdbd('0x9')](_0xbdbd('0xe'),auth[_0xbdbd('0xa')](),controller[_0xbdbd('0xf')]);router[_0xbdbd('0x10')]('/',auth[_0xbdbd('0xa')](),controller[_0xbdbd('0x11')]);router[_0xbdbd('0x12')](_0xbdbd('0xc'),auth['isAuthenticated'](),controller[_0xbdbd('0x13')]);router[_0xbdbd('0x14')](_0xbdbd('0xc'),auth[_0xbdbd('0xa')](),controller[_0xbdbd('0x15')]);module[_0xbdbd('0x16')]=router; \ No newline at end of file +var _0x866b=['isAuthenticated','index','/:id','show','/:id/run','run','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','get'];(function(_0x989334,_0x4b2b99){var _0x42e15c=function(_0x24e747){while(--_0x24e747){_0x989334['push'](_0x989334['shift']());}};_0x42e15c(++_0x4b2b99);}(_0x866b,0x1c5));var _0xb866=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x866b[_0x2aea9e];return _0x430b92;};'use strict';var multer=require(_0xb866('0x0'));var util=require(_0xb866('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb866('0x2'));var router=express[_0xb866('0x3')]();var fs_extra=require(_0xb866('0x4'));var auth=require(_0xb866('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./schedule.controller');router[_0xb866('0x6')]('/',auth[_0xb866('0x7')](),controller[_0xb866('0x8')]);router[_0xb866('0x6')](_0xb866('0x9'),auth[_0xb866('0x7')](),controller[_0xb866('0xa')]);router[_0xb866('0x6')](_0xb866('0xb'),auth[_0xb866('0x7')](),controller[_0xb866('0xc')]);router[_0xb866('0xd')]('/',auth[_0xb866('0x7')](),controller[_0xb866('0xe')]);router[_0xb866('0xf')](_0xb866('0x9'),auth[_0xb866('0x7')](),controller[_0xb866('0x10')]);router[_0xb866('0x11')](_0xb866('0x9'),auth[_0xb866('0x7')](),controller[_0xb866('0x12')]);module[_0xb866('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index be0e5f9..9b9bdc7 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 _0xd5ca=['csv','pdf','xlsx','custom','default','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours'];(function(_0x322b42,_0x5e16f6){var _0x20ae2d=function(_0x9c6299){while(--_0x9c6299){_0x322b42['push'](_0x322b42['shift']());}};_0x20ae2d(++_0x5e16f6);}(_0xd5ca,0x123));var _0xad5c=function(_0xba761c,_0x7da8db){_0xba761c=_0xba761c-0x0;var _0x3ae3d6=_0xd5ca[_0xba761c];return _0x3ae3d6;};'use strict';var Sequelize=require(_0xad5c('0x0'));module['exports']={'name':{'type':Sequelize[_0xad5c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xad5c('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xad5c('0x1')],'allowNull':![],'defaultValue':_0xad5c('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xad5c('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xad5c('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xad5c('0x6')](_0xad5c('0x7'),_0xad5c('0x8'),_0xad5c('0x9'),_0xad5c('0xa'),_0xad5c('0xb'),_0xad5c('0xc'),'minutes'),'allowNull':![],'defaultValue':_0xad5c('0xb')},'output':{'type':Sequelize[_0xad5c('0x6')](_0xad5c('0xd'),_0xad5c('0xe'),_0xad5c('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xad5c('0x6')](_0xad5c('0x10'),_0xad5c('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xad5c('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xad5c('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xad5c('0x12')]},'sendIfEmpty':{'type':Sequelize[_0xad5c('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x28b5=['0\x200\x20*\x20*\x20*','DATE','years','quarters','months','weeks','days','hours','minutes','ENUM','pdf','xlsx','csv','custom','BOOLEAN','TEXT','sequelize','exports','STRING'];(function(_0x1943d9,_0x245bb8){var _0x4b4f3f=function(_0x3bba90){while(--_0x3bba90){_0x1943d9['push'](_0x1943d9['shift']());}};_0x4b4f3f(++_0x245bb8);}(_0x28b5,0x1c5));var _0x528b=function(_0x4402b6,_0x2c8543){_0x4402b6=_0x4402b6-0x0;var _0x1c9a9b=_0x28b5[_0x4402b6];return _0x1c9a9b;};'use strict';var Sequelize=require(_0x528b('0x0'));module[_0x528b('0x1')]={'name':{'type':Sequelize[_0x528b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x528b('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x528b('0x2')],'allowNull':![],'defaultValue':_0x528b('0x3')},'startAt':{'type':Sequelize[_0x528b('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x528b('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x528b('0x5'),_0x528b('0x6'),_0x528b('0x7'),_0x528b('0x8'),_0x528b('0x9'),_0x528b('0xa'),_0x528b('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x528b('0xc')]('csv',_0x528b('0xd'),_0x528b('0xe')),'allowNull':![],'defaultValue':_0x528b('0xf')},'type':{'type':Sequelize[_0x528b('0xc')](_0x528b('0x10'),'default'),'allowNull':![],'defaultValue':_0x528b('0x10')},'sendMail':{'type':Sequelize[_0x528b('0x11')],'defaultValue':![]},'email':{'type':Sequelize[_0x528b('0x2')]},'cc':{'type':Sequelize[_0x528b('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index bbd81c1..5d864fa 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 _0xd287=['params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','reject','update','then','destroy','Scheduler','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','include','findAll','rows','catch','show'];(function(_0x187866,_0x5ec51a){var _0x5d55cd=function(_0x4d91ae){while(--_0x4d91ae){_0x187866['push'](_0x187866['shift']());}};_0x5d55cd(++_0x5ec51a);}(_0xd287,0x64));var _0x7d28=function(_0x59aa53,_0x29e3a4){_0x59aa53=_0x59aa53-0x0;var _0x3e7196=_0xd287[_0x59aa53];return _0x3e7196;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d28('0x0'));var zipdir=require(_0x7d28('0x1'));var jsonpatch=require(_0x7d28('0x2'));var rp=require(_0x7d28('0x3'));var moment=require(_0x7d28('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7d28('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7d28('0x6'));var csv=require(_0x7d28('0x7'));var ejs=require(_0x7d28('0x8'));var fs=require('fs');var fs_extra=require(_0x7d28('0x9'));var _=require('lodash');var squel=require(_0x7d28('0xa'));var crypto=require(_0x7d28('0xb'));var jsforce=require(_0x7d28('0xc'));var deskjs=require(_0x7d28('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7d28('0xe'));var Redis=require(_0x7d28('0xf'));var authService=require(_0x7d28('0x10'));var qs=require(_0x7d28('0x11'));var as=require(_0x7d28('0x12'));var hardwareService=require(_0x7d28('0x13'));var logger=require(_0x7d28('0x14'))(_0x7d28('0x15'));var utils=require('../../config/utils');var config=require(_0x7d28('0x16'));var licenseUtil=require(_0x7d28('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c2649,_0x14a8e3){_0x14a8e3=_0x14a8e3||0xcc;return function(_0x2489e5){if(_0x2489e5){return _0x2c2649[_0x7d28('0x18')](_0x14a8e3);}return _0x2c2649[_0x7d28('0x19')](_0x14a8e3)[_0x7d28('0x1a')]();};}function respondWithResult(_0x5e2e6c,_0x5bf0bc){_0x5bf0bc=_0x5bf0bc||0xc8;return function(_0x5cff82){if(_0x5cff82){return _0x5e2e6c[_0x7d28('0x19')](_0x5bf0bc)[_0x7d28('0x1b')](_0x5cff82);}};}function respondWithFilteredResult(_0x5bfc4b,_0x10b3da){return function(_0x431fea){if(_0x431fea){var _0x255b0f=typeof _0x10b3da[_0x7d28('0x1c')]==='undefined'&&typeof _0x10b3da[_0x7d28('0x1d')]==='undefined';var _0x4b5084=_0x431fea[_0x7d28('0x1e')];var _0x2aaf70=_0x255b0f?0x0:_0x10b3da[_0x7d28('0x1c')];var _0x1f4ccf=_0x255b0f?_0x431fea[_0x7d28('0x1e')]:_0x10b3da[_0x7d28('0x1c')]+_0x10b3da['limit'];var _0x2f87ed;if(_0x1f4ccf>=_0x4b5084){_0x1f4ccf=_0x4b5084;_0x2f87ed=0xc8;}else{_0x2f87ed=0xce;}_0x5bfc4b[_0x7d28('0x19')](_0x2f87ed);return _0x5bfc4b[_0x7d28('0x1f')]('Content-Range',_0x2aaf70+'-'+_0x1f4ccf+'/'+_0x4b5084)[_0x7d28('0x1b')](_0x431fea);}return null;};}function patchUpdates(_0x5cd8b6){return function(_0x1a0f50){try{jsonpatch['apply'](_0x1a0f50,_0x5cd8b6,!![]);}catch(_0x2305e8){return BPromise[_0x7d28('0x20')](_0x2305e8);}return _0x1a0f50['save']();};}function saveUpdates(_0x7f18f2,_0x233d85){return function(_0x400938){if(_0x400938){return _0x400938[_0x7d28('0x21')](_0x7f18f2)[_0x7d28('0x22')](function(_0x12a763){return _0x12a763;});}return null;};}function removeEntity(_0x24204b,_0xe15202){return function(_0x2f1e98){if(_0x2f1e98){return _0x2f1e98[_0x7d28('0x23')]()[_0x7d28('0x22')](function(){var _0x3e9ad1=_0x2f1e98['get']({'plain':!![]});var _0x2cde4f=_0x7d28('0x24');return db['UserProfileResource'][_0x7d28('0x23')]({'where':{'type':_0x2cde4f,'resourceId':_0x3e9ad1['id']}})[_0x7d28('0x22')](function(){return _0x2f1e98;});})[_0x7d28('0x22')](function(){_0x24204b['status'](0xcc)[_0x7d28('0x1a')]();});}};}function handleEntityNotFound(_0x9c29ff,_0x5187ed){return function(_0x1fe523){if(!_0x1fe523){_0x9c29ff[_0x7d28('0x18')](0x194);}return _0x1fe523;};}function handleError(_0x137f51,_0x2feba5){_0x2feba5=_0x2feba5||0x1f4;return function(_0x509542){logger[_0x7d28('0x25')](_0x509542[_0x7d28('0x26')]);if(_0x509542[_0x7d28('0x27')]){delete _0x509542[_0x7d28('0x27')];}_0x137f51[_0x7d28('0x19')](_0x2feba5)[_0x7d28('0x28')](_0x509542);};}exports[_0x7d28('0x29')]=function(_0x7acbae,_0x21fa26){var _0xe8664a={},_0x40dee1={},_0x4a5f2b={'count':0x0,'rows':[]};var _0x5ae342=_[_0x7d28('0x2a')](db[_0x7d28('0x2b')][_0x7d28('0x2c')],function(_0x42c302){return{'name':_0x42c302[_0x7d28('0x2d')],'type':_0x42c302['type']['key']};});_0x40dee1['model']=_[_0x7d28('0x2a')](_0x5ae342,_0x7d28('0x27'));_0x40dee1['query']=_[_0x7d28('0x2e')](_0x7acbae[_0x7d28('0x2f')]);_0x40dee1[_0x7d28('0x30')]=_[_0x7d28('0x31')](_0x40dee1[_0x7d28('0x32')],_0x40dee1[_0x7d28('0x2f')]);_0xe8664a['attributes']=_[_0x7d28('0x31')](_0x40dee1[_0x7d28('0x32')],qs[_0x7d28('0x33')](_0x7acbae[_0x7d28('0x2f')][_0x7d28('0x33')]));_0xe8664a[_0x7d28('0x34')]=_0xe8664a[_0x7d28('0x34')][_0x7d28('0x35')]?_0xe8664a[_0x7d28('0x34')]:_0x40dee1['model'];if(!_0x7acbae[_0x7d28('0x2f')][_0x7d28('0x36')](_0x7d28('0x37'))){_0xe8664a['limit']=qs[_0x7d28('0x1d')](_0x7acbae[_0x7d28('0x2f')][_0x7d28('0x1d')]);_0xe8664a[_0x7d28('0x1c')]=qs[_0x7d28('0x1c')](_0x7acbae[_0x7d28('0x2f')][_0x7d28('0x1c')]);}_0xe8664a[_0x7d28('0x38')]=qs[_0x7d28('0x39')](_0x7acbae[_0x7d28('0x2f')][_0x7d28('0x39')]);_0xe8664a['where']=qs[_0x7d28('0x30')](_[_0x7d28('0x3a')](_0x7acbae[_0x7d28('0x2f')],_0x40dee1[_0x7d28('0x30')]),_0x5ae342);if(_0x7acbae[_0x7d28('0x2f')][_0x7d28('0x3b')]){_0xe8664a[_0x7d28('0x3c')]=_['merge'](_0xe8664a['where'],{'$or':_['map'](_0x5ae342,function(_0x43cb97){if(_0x43cb97[_0x7d28('0x3d')]!==_0x7d28('0x3e')){var _0x5271fd={};_0x5271fd[_0x43cb97['name']]={'$like':'%'+_0x7acbae['query']['filter']+'%'};return _0x5271fd;}})});}_0xe8664a=_[_0x7d28('0x3f')]({},_0xe8664a,_0x7acbae[_0x7d28('0x40')]);var _0x39f94c={'where':_0xe8664a[_0x7d28('0x3c')]};return db[_0x7d28('0x2b')][_0x7d28('0x1e')](_0x39f94c)['then'](function(_0x33b7e0){_0x4a5f2b[_0x7d28('0x1e')]=_0x33b7e0;if(_0x7acbae[_0x7d28('0x2f')]['includeAll']){_0xe8664a[_0x7d28('0x41')]=[{'all':!![]}];}return db['Schedule'][_0x7d28('0x42')](_0xe8664a);})[_0x7d28('0x22')](function(_0x4db3a6){_0x4a5f2b[_0x7d28('0x43')]=_0x4db3a6;return _0x4a5f2b;})['then'](respondWithFilteredResult(_0x21fa26,_0xe8664a))[_0x7d28('0x44')](handleError(_0x21fa26,null));};exports[_0x7d28('0x45')]=function(_0x2c4dcd,_0x35161a){var _0x31dc09={'raw':![],'where':{'id':_0x2c4dcd[_0x7d28('0x46')]['id']}},_0x229fb7={};_0x229fb7[_0x7d28('0x32')]=_[_0x7d28('0x2e')](db[_0x7d28('0x2b')][_0x7d28('0x2c')]);_0x229fb7['query']=_[_0x7d28('0x2e')](_0x2c4dcd[_0x7d28('0x2f')]);_0x229fb7['filters']=_[_0x7d28('0x31')](_0x229fb7['model'],_0x229fb7[_0x7d28('0x2f')]);_0x31dc09['attributes']=_[_0x7d28('0x31')](_0x229fb7[_0x7d28('0x32')],qs[_0x7d28('0x33')](_0x2c4dcd[_0x7d28('0x2f')]['fields']));_0x31dc09[_0x7d28('0x34')]=_0x31dc09[_0x7d28('0x34')][_0x7d28('0x35')]?_0x31dc09['attributes']:_0x229fb7[_0x7d28('0x32')];if(_0x2c4dcd['query'][_0x7d28('0x47')]){_0x31dc09[_0x7d28('0x41')]=[{'all':!![]}];}_0x31dc09=_[_0x7d28('0x3f')]({},_0x31dc09,_0x2c4dcd[_0x7d28('0x40')]);return db[_0x7d28('0x2b')][_0x7d28('0x48')](_0x31dc09)[_0x7d28('0x22')](handleEntityNotFound(_0x35161a,null))[_0x7d28('0x22')](respondWithResult(_0x35161a,null))[_0x7d28('0x44')](handleError(_0x35161a,null));};exports[_0x7d28('0x49')]=function(_0x5c5033,_0x3d5e95){return db[_0x7d28('0x2b')][_0x7d28('0x49')](_0x5c5033[_0x7d28('0x4a')],{})[_0x7d28('0x22')](function(_0x54b7c4){var _0x2074db=_0x5c5033[_0x7d28('0x4b')][_0x7d28('0x4c')]({'plain':!![]});if(!_0x2074db)throw new Error(_0x7d28('0x4d'));if(_0x2074db[_0x7d28('0x4e')]==='user'){var _0x15add9=_0x54b7c4['get']({'plain':!![]});var _0x1beac1=_0x7d28('0x24');return db[_0x7d28('0x4f')]['find']({'where':{'name':_0x1beac1,'userProfileId':_0x2074db[_0x7d28('0x50')]},'raw':!![]})[_0x7d28('0x22')](function(_0x5db637){if(_0x5db637&&_0x5db637['autoAssociation']===0x0){return db[_0x7d28('0x51')][_0x7d28('0x49')]({'name':_0x15add9['name'],'resourceId':_0x15add9['id'],'type':_0x5db637['name'],'sectionId':_0x5db637['id']},{})[_0x7d28('0x22')](function(){return _0x54b7c4;});}else{return _0x54b7c4;}})[_0x7d28('0x44')](function(_0x32ad27){logger[_0x7d28('0x25')](_0x7d28('0x52'),_0x32ad27);throw _0x32ad27;});}return _0x54b7c4;})[_0x7d28('0x22')](respondWithResult(_0x3d5e95,0xc9))[_0x7d28('0x44')](handleError(_0x3d5e95,null));};exports[_0x7d28('0x21')]=function(_0x2b100e,_0x101cbb){if(_0x2b100e[_0x7d28('0x4a')]['id']){delete _0x2b100e[_0x7d28('0x4a')]['id'];}return db['Schedule'][_0x7d28('0x48')]({'where':{'id':_0x2b100e['params']['id']}})['then'](handleEntityNotFound(_0x101cbb,null))[_0x7d28('0x22')](saveUpdates(_0x2b100e['body'],null))[_0x7d28('0x22')](respondWithResult(_0x101cbb,null))[_0x7d28('0x44')](handleError(_0x101cbb,null));};exports[_0x7d28('0x23')]=function(_0x36562e,_0x28fe10){return db[_0x7d28('0x2b')][_0x7d28('0x48')]({'where':{'id':_0x36562e['params']['id']}})[_0x7d28('0x22')](handleEntityNotFound(_0x28fe10,null))[_0x7d28('0x22')](removeEntity(_0x28fe10,null))['catch'](handleError(_0x28fe10,null));};exports[_0x7d28('0x53')]=function(_0x51696f,_0x77080f,_0x1aa0fd){var _0x1e1675=require(_0x7d28('0x54'));return db[_0x7d28('0x2b')]['find']({'where':{'id':_0x51696f[_0x7d28('0x46')]['id']},'raw':!![]})[_0x7d28('0x22')](handleEntityNotFound(_0x77080f,null))[_0x7d28('0x22')](function(){_0x1e1675[_0x7d28('0x53')](_0x51696f[_0x7d28('0x46')]['id']);})[_0x7d28('0x22')](respondWithStatusCode(_0x77080f,null))[_0x7d28('0x44')](handleError(_0x77080f,null));}; \ No newline at end of file +var _0x4c94=['rimraf','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format'];(function(_0x3e478c,_0x152670){var _0x29ef89=function(_0x3d0d77){while(--_0x3d0d77){_0x3e478c['push'](_0x3e478c['shift']());}};_0x29ef89(++_0x152670);}(_0x4c94,0xad));var _0x44c9=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x4c94[_0x4e9628];return _0x27bc8c;};'use strict';var emlformat=require(_0x44c9('0x0'));var rimraf=require(_0x44c9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x44c9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x44c9('0x3'));var Mustache=require(_0x44c9('0x4'));var util=require('util');var path=require('path');var sox=require(_0x44c9('0x5'));var csv=require(_0x44c9('0x6'));var ejs=require(_0x44c9('0x7'));var fs=require('fs');var fs_extra=require(_0x44c9('0x8'));var _=require(_0x44c9('0x9'));var squel=require(_0x44c9('0xa'));var crypto=require(_0x44c9('0xb'));var jsforce=require(_0x44c9('0xc'));var deskjs=require(_0x44c9('0xd'));var toCsv=require(_0x44c9('0x6'));var querystring=require(_0x44c9('0xe'));var Papa=require(_0x44c9('0xf'));var Redis=require(_0x44c9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x44c9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x44c9('0x12'))(_0x44c9('0x13'));var utils=require(_0x44c9('0x14'));var config=require(_0x44c9('0x15'));var licenseUtil=require(_0x44c9('0x16'));var db=require(_0x44c9('0x17'))['db'];function respondWithStatusCode(_0x1da252,_0x445ce7){_0x445ce7=_0x445ce7||0xcc;return function(_0x43bbf3){if(_0x43bbf3){return _0x1da252[_0x44c9('0x18')](_0x445ce7);}return _0x1da252[_0x44c9('0x19')](_0x445ce7)[_0x44c9('0x1a')]();};}function respondWithResult(_0x3328b4,_0x1e306c){_0x1e306c=_0x1e306c||0xc8;return function(_0x4df7fb){if(_0x4df7fb){return _0x3328b4[_0x44c9('0x19')](_0x1e306c)[_0x44c9('0x1b')](_0x4df7fb);}};}function respondWithFilteredResult(_0x5cf214,_0x10874a){return function(_0x5e2ede){if(_0x5e2ede){var _0x4d951e=typeof _0x10874a[_0x44c9('0x1c')]===_0x44c9('0x1d')&&typeof _0x10874a['limit']===_0x44c9('0x1d');var _0x4f350f=_0x5e2ede['count'];var _0xb6fe73=_0x4d951e?0x0:_0x10874a[_0x44c9('0x1c')];var _0x127bfa=_0x4d951e?_0x5e2ede[_0x44c9('0x1e')]:_0x10874a['offset']+_0x10874a[_0x44c9('0x1f')];var _0x4327de;if(_0x127bfa>=_0x4f350f){_0x127bfa=_0x4f350f;_0x4327de=0xc8;}else{_0x4327de=0xce;}_0x5cf214[_0x44c9('0x19')](_0x4327de);return _0x5cf214['set'](_0x44c9('0x20'),_0xb6fe73+'-'+_0x127bfa+'/'+_0x4f350f)[_0x44c9('0x1b')](_0x5e2ede);}return null;};}function patchUpdates(_0xd18c2a){return function(_0xafc6b8){try{jsonpatch['apply'](_0xafc6b8,_0xd18c2a,!![]);}catch(_0x443e77){return BPromise[_0x44c9('0x21')](_0x443e77);}return _0xafc6b8[_0x44c9('0x22')]();};}function saveUpdates(_0x2d3c06,_0x5c1c52){return function(_0x267c7a){if(_0x267c7a){return _0x267c7a[_0x44c9('0x23')](_0x2d3c06)[_0x44c9('0x24')](function(_0x3d2c64){return _0x3d2c64;});}return null;};}function removeEntity(_0x37344b,_0x3dd978){return function(_0x4c37c3){if(_0x4c37c3){return _0x4c37c3[_0x44c9('0x25')]()['then'](function(){var _0x19ae2a=_0x4c37c3[_0x44c9('0x26')]({'plain':!![]});var _0xb43466=_0x44c9('0x27');return db[_0x44c9('0x28')][_0x44c9('0x25')]({'where':{'type':_0xb43466,'resourceId':_0x19ae2a['id']}})['then'](function(){return _0x4c37c3;});})[_0x44c9('0x24')](function(){_0x37344b[_0x44c9('0x19')](0xcc)[_0x44c9('0x1a')]();});}};}function handleEntityNotFound(_0x504b27,_0x3724f4){return function(_0xd0edd1){if(!_0xd0edd1){_0x504b27['sendStatus'](0x194);}return _0xd0edd1;};}function handleError(_0x254713,_0x81be7f){_0x81be7f=_0x81be7f||0x1f4;return function(_0x5e52d2){logger[_0x44c9('0x29')](_0x5e52d2[_0x44c9('0x2a')]);if(_0x5e52d2['name']){delete _0x5e52d2['name'];}_0x254713[_0x44c9('0x19')](_0x81be7f)[_0x44c9('0x2b')](_0x5e52d2);};}exports[_0x44c9('0x2c')]=function(_0x583697,_0x1aa3be){var _0x30989d={},_0xeb88e8={},_0xa8dec1={'count':0x0,'rows':[]};var _0x2e4660=_[_0x44c9('0x2d')](db[_0x44c9('0x2e')][_0x44c9('0x2f')],function(_0x918728){return{'name':_0x918728[_0x44c9('0x30')],'type':_0x918728[_0x44c9('0x31')][_0x44c9('0x32')]};});_0xeb88e8[_0x44c9('0x33')]=_[_0x44c9('0x2d')](_0x2e4660,_0x44c9('0x34'));_0xeb88e8[_0x44c9('0x35')]=_[_0x44c9('0x36')](_0x583697[_0x44c9('0x35')]);_0xeb88e8['filters']=_[_0x44c9('0x37')](_0xeb88e8[_0x44c9('0x33')],_0xeb88e8[_0x44c9('0x35')]);_0x30989d[_0x44c9('0x38')]=_[_0x44c9('0x37')](_0xeb88e8['model'],qs[_0x44c9('0x39')](_0x583697['query'][_0x44c9('0x39')]));_0x30989d[_0x44c9('0x38')]=_0x30989d['attributes'][_0x44c9('0x3a')]?_0x30989d[_0x44c9('0x38')]:_0xeb88e8[_0x44c9('0x33')];if(!_0x583697['query'][_0x44c9('0x3b')](_0x44c9('0x3c'))){_0x30989d[_0x44c9('0x1f')]=qs[_0x44c9('0x1f')](_0x583697['query'][_0x44c9('0x1f')]);_0x30989d[_0x44c9('0x1c')]=qs[_0x44c9('0x1c')](_0x583697[_0x44c9('0x35')][_0x44c9('0x1c')]);}_0x30989d[_0x44c9('0x3d')]=qs[_0x44c9('0x3e')](_0x583697[_0x44c9('0x35')]['sort']);_0x30989d[_0x44c9('0x3f')]=qs['filters'](_[_0x44c9('0x40')](_0x583697[_0x44c9('0x35')],_0xeb88e8[_0x44c9('0x41')]),_0x2e4660);if(_0x583697[_0x44c9('0x35')][_0x44c9('0x42')]){_0x30989d['where']=_['merge'](_0x30989d['where'],{'$or':_[_0x44c9('0x2d')](_0x2e4660,function(_0x14748d){if(_0x14748d[_0x44c9('0x31')]!==_0x44c9('0x43')){var _0x2aae20={};_0x2aae20[_0x14748d[_0x44c9('0x34')]]={'$like':'%'+_0x583697[_0x44c9('0x35')][_0x44c9('0x42')]+'%'};return _0x2aae20;}})});}_0x30989d=_[_0x44c9('0x44')]({},_0x30989d,_0x583697['options']);var _0x7c5bbe={'where':_0x30989d[_0x44c9('0x3f')]};return db[_0x44c9('0x2e')][_0x44c9('0x1e')](_0x7c5bbe)[_0x44c9('0x24')](function(_0x5d9d0c){_0xa8dec1[_0x44c9('0x1e')]=_0x5d9d0c;if(_0x583697[_0x44c9('0x35')][_0x44c9('0x45')]){_0x30989d['include']=[{'all':!![]}];}return db[_0x44c9('0x2e')][_0x44c9('0x46')](_0x30989d);})[_0x44c9('0x24')](function(_0x4f37d){_0xa8dec1[_0x44c9('0x47')]=_0x4f37d;return _0xa8dec1;})[_0x44c9('0x24')](respondWithFilteredResult(_0x1aa3be,_0x30989d))[_0x44c9('0x48')](handleError(_0x1aa3be,null));};exports[_0x44c9('0x49')]=function(_0x41e31b,_0x450103){var _0x5a4d6d={'raw':![],'where':{'id':_0x41e31b[_0x44c9('0x4a')]['id']}},_0x2bfd8a={};_0x2bfd8a['model']=_[_0x44c9('0x36')](db[_0x44c9('0x2e')][_0x44c9('0x2f')]);_0x2bfd8a[_0x44c9('0x35')]=_['keys'](_0x41e31b[_0x44c9('0x35')]);_0x2bfd8a['filters']=_[_0x44c9('0x37')](_0x2bfd8a[_0x44c9('0x33')],_0x2bfd8a[_0x44c9('0x35')]);_0x5a4d6d['attributes']=_[_0x44c9('0x37')](_0x2bfd8a[_0x44c9('0x33')],qs[_0x44c9('0x39')](_0x41e31b[_0x44c9('0x35')][_0x44c9('0x39')]));_0x5a4d6d[_0x44c9('0x38')]=_0x5a4d6d[_0x44c9('0x38')][_0x44c9('0x3a')]?_0x5a4d6d[_0x44c9('0x38')]:_0x2bfd8a['model'];if(_0x41e31b[_0x44c9('0x35')][_0x44c9('0x45')]){_0x5a4d6d[_0x44c9('0x4b')]=[{'all':!![]}];}_0x5a4d6d=_[_0x44c9('0x44')]({},_0x5a4d6d,_0x41e31b[_0x44c9('0x4c')]);return db[_0x44c9('0x2e')][_0x44c9('0x4d')](_0x5a4d6d)[_0x44c9('0x24')](handleEntityNotFound(_0x450103,null))[_0x44c9('0x24')](respondWithResult(_0x450103,null))['catch'](handleError(_0x450103,null));};exports['create']=function(_0x128960,_0x167189){return db[_0x44c9('0x2e')][_0x44c9('0x4e')](_0x128960[_0x44c9('0x4f')],{})[_0x44c9('0x24')](function(_0x33f7e6){var _0x597029=_0x128960[_0x44c9('0x50')][_0x44c9('0x26')]({'plain':!![]});if(!_0x597029)throw new Error(_0x44c9('0x51'));if(_0x597029['role']===_0x44c9('0x50')){var _0x5556c3=_0x33f7e6[_0x44c9('0x26')]({'plain':!![]});var _0x3ab425=_0x44c9('0x27');return db['UserProfileSection'][_0x44c9('0x4d')]({'where':{'name':_0x3ab425,'userProfileId':_0x597029[_0x44c9('0x52')]},'raw':!![]})['then'](function(_0x3ef56f){if(_0x3ef56f&&_0x3ef56f[_0x44c9('0x53')]===0x0){return db[_0x44c9('0x28')][_0x44c9('0x4e')]({'name':_0x5556c3[_0x44c9('0x34')],'resourceId':_0x5556c3['id'],'type':_0x3ef56f[_0x44c9('0x34')],'sectionId':_0x3ef56f['id']},{})['then'](function(){return _0x33f7e6;});}else{return _0x33f7e6;}})['catch'](function(_0xb2848e){logger[_0x44c9('0x29')](_0x44c9('0x54'),_0xb2848e);throw _0xb2848e;});}return _0x33f7e6;})[_0x44c9('0x24')](respondWithResult(_0x167189,0xc9))[_0x44c9('0x48')](handleError(_0x167189,null));};exports[_0x44c9('0x23')]=function(_0x299a48,_0x97739c){if(_0x299a48[_0x44c9('0x4f')]['id']){delete _0x299a48[_0x44c9('0x4f')]['id'];}return db['Schedule'][_0x44c9('0x4d')]({'where':{'id':_0x299a48[_0x44c9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x97739c,null))[_0x44c9('0x24')](saveUpdates(_0x299a48[_0x44c9('0x4f')],null))[_0x44c9('0x24')](respondWithResult(_0x97739c,null))[_0x44c9('0x48')](handleError(_0x97739c,null));};exports['destroy']=function(_0x26842d,_0x329c25){return db[_0x44c9('0x2e')][_0x44c9('0x4d')]({'where':{'id':_0x26842d['params']['id']}})[_0x44c9('0x24')](handleEntityNotFound(_0x329c25,null))[_0x44c9('0x24')](removeEntity(_0x329c25,null))[_0x44c9('0x48')](handleError(_0x329c25,null));};exports[_0x44c9('0x55')]=function(_0x40b5ed,_0x17486f,_0x1a5526){var _0x3cf788=require(_0x44c9('0x56'));return db[_0x44c9('0x2e')]['find']({'where':{'id':_0x40b5ed['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x17486f,null))[_0x44c9('0x24')](function(){_0x3cf788[_0x44c9('0x55')](_0x40b5ed[_0x44c9('0x4a')]['id']);})['then'](respondWithStatusCode(_0x17486f,null))[_0x44c9('0x48')](handleError(_0x17486f,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 093c3f3..1501e98 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 _0xc274=['path','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4a2ad7,_0x3f55f8){var _0x50e7dd=function(_0xca70e6){while(--_0xca70e6){_0x4a2ad7['push'](_0x4a2ad7['shift']());}};_0x50e7dd(++_0x3f55f8);}(_0xc274,0x1ab));var _0x4c27=function(_0x53b930,_0x1d4577){_0x53b930=_0x53b930-0x0;var _0x3ff92e=_0xc274[_0x53b930];return _0x3ff92e;};'use strict';var _=require(_0x4c27('0x0'));var util=require(_0x4c27('0x1'));var logger=require(_0x4c27('0x2'))(_0x4c27('0x3'));var moment=require(_0x4c27('0x4'));var BPromise=require(_0x4c27('0x5'));var rp=require(_0x4c27('0x6'));var fs=require('fs');var path=require(_0x4c27('0x7'));var rimraf=require('rimraf');var config=require(_0x4c27('0x8'));var attributes=require(_0x4c27('0x9'));module[_0x4c27('0xa')]=function(_0x5becb7,_0x31243){return _0x5becb7[_0x4c27('0xb')](_0x4c27('0xc'),attributes,{'tableName':_0x4c27('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9386=['request-promise','path','rimraf','../../config/environment','./schedule.attributes','define','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1708d2,_0x742cf4){var _0x5a6d52=function(_0x3a0c4b){while(--_0x3a0c4b){_0x1708d2['push'](_0x1708d2['shift']());}};_0x5a6d52(++_0x742cf4);}(_0x9386,0xe4));var _0x6938=function(_0x10f3fa,_0xcb3aa1){_0x10f3fa=_0x10f3fa-0x0;var _0x151dd4=_0x9386[_0x10f3fa];return _0x151dd4;};'use strict';var _=require(_0x6938('0x0'));var util=require(_0x6938('0x1'));var logger=require(_0x6938('0x2'))(_0x6938('0x3'));var moment=require(_0x6938('0x4'));var BPromise=require(_0x6938('0x5'));var rp=require(_0x6938('0x6'));var fs=require('fs');var path=require(_0x6938('0x7'));var rimraf=require(_0x6938('0x8'));var config=require(_0x6938('0x9'));var attributes=require(_0x6938('0xa'));module['exports']=function(_0x429fd7,_0x37ad8f){return _0x429fd7[_0x6938('0xb')]('Schedule',attributes,{'tableName':_0x6938('0xc'),'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 a7618e6..30f6756 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 _0xcc4c=['message','result','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x12822f,_0x7c39ab){var _0x46f7b0=function(_0x5c729d){while(--_0x5c729d){_0x12822f['push'](_0x12822f['shift']());}};_0x46f7b0(++_0x7c39ab);}(_0xcc4c,0x74));var _0xccc4=function(_0xc1f186,_0x219f51){_0xc1f186=_0xc1f186-0x0;var _0x30a59a=_0xcc4c[_0xc1f186];return _0x30a59a;};'use strict';var _=require('lodash');var util=require(_0xccc4('0x0'));var moment=require('moment');var BPromise=require(_0xccc4('0x1'));var rs=require(_0xccc4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xccc4('0x3'));var logger=require('../../config/logger')(_0xccc4('0x4'));var config=require(_0xccc4('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xccc4('0x6')][_0xccc4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d3835,_0xd7d438,_0x302a7a){return new BPromise(function(_0x185aec,_0xffa787){return client[_0xccc4('0x8')](_0x2d3835,_0x302a7a)[_0xccc4('0x9')](function(_0x70c1f0){logger[_0xccc4('0xa')](_0xccc4('0xb'),_0xd7d438,_0xccc4('0xc'));logger[_0xccc4('0xd')](_0xccc4('0xe'),_0xd7d438,_0xccc4('0xc'),JSON['stringify'](_0x70c1f0));if(_0x70c1f0[_0xccc4('0xf')]){if(_0x70c1f0[_0xccc4('0xf')][_0xccc4('0x10')]===0x1f4){logger[_0xccc4('0xf')](_0xccc4('0xb'),_0xd7d438,_0x70c1f0[_0xccc4('0xf')]['message']);return _0xffa787(_0x70c1f0[_0xccc4('0xf')][_0xccc4('0x11')]);}logger[_0xccc4('0xf')](_0xccc4('0xb'),_0xd7d438,_0x70c1f0['error'][_0xccc4('0x11')]);return _0x185aec(_0x70c1f0['error'][_0xccc4('0x11')]);}else{logger[_0xccc4('0xa')](_0xccc4('0xb'),_0xd7d438,_0xccc4('0xc'));_0x185aec(_0x70c1f0[_0xccc4('0x12')][_0xccc4('0x11')]);}})['catch'](function(_0xaac69){logger[_0xccc4('0xf')](_0xccc4('0xb'),_0xd7d438,_0xaac69);_0xffa787(_0xaac69);});});} \ No newline at end of file +var _0x7ed6=['client','http','request','then','info','Schedule,\x20%s,\x20%s','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x4fc9c1,_0x570e05){var _0x15d7a1=function(_0xa5af50){while(--_0xa5af50){_0x4fc9c1['push'](_0x4fc9c1['shift']());}};_0x15d7a1(++_0x570e05);}(_0x7ed6,0xa3));var _0x67ed=function(_0x3d0937,_0x5a5dc2){_0x3d0937=_0x3d0937-0x0;var _0x1c3529=_0x7ed6[_0x3d0937];return _0x1c3529;};'use strict';var _=require(_0x67ed('0x0'));var util=require(_0x67ed('0x1'));var moment=require('moment');var BPromise=require(_0x67ed('0x2'));var rs=require(_0x67ed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67ed('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x67ed('0x5'))(_0x67ed('0x6'));var config=require('../../config/environment');var jayson=require(_0x67ed('0x7'));var client=jayson[_0x67ed('0x8')][_0x67ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x130e93,_0x338fb5,_0x4dc4be){return new BPromise(function(_0x273545,_0x4e1ffe){return client[_0x67ed('0xa')](_0x130e93,_0x4dc4be)[_0x67ed('0xb')](function(_0x2bfd28){logger[_0x67ed('0xc')](_0x67ed('0xd'),_0x338fb5,'request\x20sent');logger['debug'](_0x67ed('0xe'),_0x338fb5,_0x67ed('0xf'),JSON['stringify'](_0x2bfd28));if(_0x2bfd28[_0x67ed('0x10')]){if(_0x2bfd28['error']['code']===0x1f4){logger[_0x67ed('0x10')](_0x67ed('0xd'),_0x338fb5,_0x2bfd28[_0x67ed('0x10')][_0x67ed('0x11')]);return _0x4e1ffe(_0x2bfd28['error'][_0x67ed('0x11')]);}logger[_0x67ed('0x10')](_0x67ed('0xd'),_0x338fb5,_0x2bfd28[_0x67ed('0x10')][_0x67ed('0x11')]);return _0x273545(_0x2bfd28['error'][_0x67ed('0x11')]);}else{logger[_0x67ed('0xc')](_0x67ed('0xd'),_0x338fb5,_0x67ed('0xf'));_0x273545(_0x2bfd28['result']['message']);}})[_0x67ed('0x12')](function(_0x5d5420){logger[_0x67ed('0x10')](_0x67ed('0xd'),_0x338fb5,_0x5d5420);_0x4e1ffe(_0x5d5420);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index ffe2669..f72d97d 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 _0xb138=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/download','put','destroy','exports','path','connect-timeout','express','fs-extra'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb138,0x12e));var _0x8b13=function(_0x30f251,_0x4428fe){_0x30f251=_0x30f251-0x0;var _0x51a94d=_0xb138[_0x30f251];return _0x51a94d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8b13('0x0'));var timeout=require(_0x8b13('0x1'));var express=require(_0x8b13('0x2'));var router=express['Router']();var fs_extra=require(_0x8b13('0x3'));var auth=require(_0x8b13('0x4'));var interaction=require(_0x8b13('0x5'));var config=require(_0x8b13('0x6'));var controller=require('./screenRecording.controller');router[_0x8b13('0x7')]('/',auth['isAuthenticated'](),controller[_0x8b13('0x8')]);router[_0x8b13('0x7')](_0x8b13('0x9'),auth['isAuthenticated'](),controller[_0x8b13('0xa')]);router[_0x8b13('0x7')](_0x8b13('0xb'),auth[_0x8b13('0xc')](),controller[_0x8b13('0xd')]);router[_0x8b13('0x7')](_0x8b13('0xe'),auth[_0x8b13('0xc')](),controller['download']);router['post']('/',auth[_0x8b13('0xc')](),controller['create']);router[_0x8b13('0xf')](_0x8b13('0xb'),auth[_0x8b13('0xc')](),controller['update']);router['delete'](_0x8b13('0xb'),auth['isAuthenticated'](),controller[_0x8b13('0x10')]);module[_0x8b13('0x11')]=router; \ No newline at end of file +var _0x43c1=['./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3cc300,_0x7dc758){var _0x426af9=function(_0x5b6ca7){while(--_0x5b6ca7){_0x3cc300['push'](_0x3cc300['shift']());}};_0x426af9(++_0x7dc758);}(_0x43c1,0x1ac));var _0x143c=function(_0x12ecce,_0xa89c30){_0x12ecce=_0x12ecce-0x0;var _0x5bbe4e=_0x43c1[_0x12ecce];return _0x5bbe4e;};'use strict';var multer=require(_0x143c('0x0'));var util=require(_0x143c('0x1'));var path=require(_0x143c('0x2'));var timeout=require(_0x143c('0x3'));var express=require('express');var router=express[_0x143c('0x4')]();var fs_extra=require(_0x143c('0x5'));var auth=require(_0x143c('0x6'));var interaction=require(_0x143c('0x7'));var config=require(_0x143c('0x8'));var controller=require(_0x143c('0x9'));router[_0x143c('0xa')]('/',auth[_0x143c('0xb')](),controller[_0x143c('0xc')]);router[_0x143c('0xa')](_0x143c('0xd'),auth[_0x143c('0xb')](),controller['describe']);router[_0x143c('0xa')](_0x143c('0xe'),auth[_0x143c('0xb')](),controller[_0x143c('0xf')]);router[_0x143c('0xa')](_0x143c('0x10'),auth[_0x143c('0xb')](),controller['download']);router[_0x143c('0x11')]('/',auth[_0x143c('0xb')](),controller['create']);router[_0x143c('0x12')](_0x143c('0xe'),auth[_0x143c('0xb')](),controller[_0x143c('0x13')]);router[_0x143c('0x14')]('/:id',auth[_0x143c('0xb')](),controller[_0x143c('0x15')]);module[_0x143c('0x16')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 1504c41..b8c4228 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 _0xa866=['duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','../../config/environment','exports','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt'];(function(_0x1100d1,_0x4d3024){var _0x13484d=function(_0x391e99){while(--_0x391e99){_0x1100d1['push'](_0x1100d1['shift']());}};_0x13484d(++_0x4d3024);}(_0xa866,0x6a));var _0x6a86=function(_0x1d37b0,_0x40df44){_0x1d37b0=_0x1d37b0-0x0;var _0x1be4e5=_0xa866[_0x1d37b0];return _0x1be4e5;};'use strict';var Sequelize=require(_0x6a86('0x0'));var moment=require(_0x6a86('0x1'));var path=require(_0x6a86('0x2'));var config=require(_0x6a86('0x3'));module[_0x6a86('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x6a86('0x5')](_0x6a86('0x6'))?path[_0x6a86('0x7')](this['getDataValue'](_0x6a86('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x6a86('0x8')]},'channel':{'type':Sequelize[_0x6a86('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x183997){var _0x288910=_0x183997[_0x6a86('0x9')](/\\/g,'/');this[_0x6a86('0xa')](_0x6a86('0x6'),_0x288910);}},'rating':{'type':Sequelize[_0x6a86('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x6a86('0xb')],'set':function(_0x4a83c9){this[_0x6a86('0xa')]('startedAt',moment()[_0x6a86('0xc')](_0x4a83c9,'ms'));this[_0x6a86('0xa')](_0x6a86('0xd'),moment());this['setDataValue'](_0x6a86('0xe'),_0x4a83c9);}},'startedAt':{'type':Sequelize[_0x6a86('0xf')],'get':function(){return moment(this['getDataValue']('startedAt'))[_0x6a86('0x10')](_0x6a86('0x11'))[_0x6a86('0x12')]();}},'closedAt':{'type':Sequelize[_0x6a86('0xf')],'get':function(){return moment(this[_0x6a86('0x5')](_0x6a86('0xd')))[_0x6a86('0x10')](_0x6a86('0x11'))['toString']();}},'createdAt':{'type':Sequelize[_0x6a86('0xf')],'get':function(){return moment(this[_0x6a86('0x5')]('createdAt'))[_0x6a86('0x10')](_0x6a86('0x11'))[_0x6a86('0x12')]();}},'updatedAt':{'type':Sequelize[_0x6a86('0xf')],'get':function(){return moment(this[_0x6a86('0x5')](_0x6a86('0x13')))['format'](_0x6a86('0x11'))[_0x6a86('0x12')]();}}}; \ No newline at end of file +var _0x7af9=['createdAt','updatedAt','sequelize','path','../../config/environment','VIRTUAL','getDataValue','value','extname','STRING','replace','INTEGER','setDataValue','subtract','closedAt','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7af9,0x95));var _0x97af=function(_0x376690,_0x39b2b9){_0x376690=_0x376690-0x0;var _0x3c4c5d=_0x7af9[_0x376690];return _0x3c4c5d;};'use strict';var Sequelize=require(_0x97af('0x0'));var moment=require('moment');var path=require(_0x97af('0x1'));var config=require(_0x97af('0x2'));module['exports']={'format':{'type':Sequelize[_0x97af('0x3')],'get':function(){return this[_0x97af('0x4')](_0x97af('0x5'))?path[_0x97af('0x6')](this[_0x97af('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x97af('0x7')],'set':function(_0x966c4e){var _0x265d22=_0x966c4e[_0x97af('0x8')](/\\/g,'/');this['setDataValue'](_0x97af('0x5'),_0x265d22);}},'rating':{'type':Sequelize[_0x97af('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x97af('0x9')],'set':function(_0x4b866a){this[_0x97af('0xa')]('startedAt',moment()[_0x97af('0xb')](_0x4b866a,'ms'));this[_0x97af('0xa')](_0x97af('0xc'),moment());this[_0x97af('0xa')](_0x97af('0xd'),_0x4b866a);}},'startedAt':{'type':Sequelize[_0x97af('0xe')],'get':function(){return moment(this[_0x97af('0x4')](_0x97af('0xf')))[_0x97af('0x10')](_0x97af('0x11'))[_0x97af('0x12')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x97af('0x4')]('closedAt'))['format'](_0x97af('0x11'))[_0x97af('0x12')]();}},'createdAt':{'type':Sequelize[_0x97af('0xe')],'get':function(){return moment(this[_0x97af('0x4')](_0x97af('0x13')))[_0x97af('0x10')](_0x97af('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0x97af('0xe')],'get':function(){return moment(this['getDataValue'](_0x97af('0x14')))['format'](_0x97af('0x11'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index a646913..128597e 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 _0x3eea=['filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','merge','find','create','body','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','format','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','download','filename','extname','Not\x20found','isNil','root','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys'];(function(_0xeea5f8,_0x1cbbaf){var _0x2e172e=function(_0x367351){while(--_0x367351){_0xeea5f8['push'](_0xeea5f8['shift']());}};_0x2e172e(++_0x1cbbaf);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x220018,_0x3dda0c){_0x220018=_0x220018-0x0;var _0x1c2f51=_0x3eea[_0x220018];return _0x1c2f51;};'use strict';var emlformat=require(_0xa3ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3ee('0x1'));var jsonpatch=require(_0xa3ee('0x2'));var rp=require(_0xa3ee('0x3'));var moment=require(_0xa3ee('0x4'));var BPromise=require(_0xa3ee('0x5'));var Mustache=require(_0xa3ee('0x6'));var util=require(_0xa3ee('0x7'));var path=require(_0xa3ee('0x8'));var sox=require(_0xa3ee('0x9'));var csv=require(_0xa3ee('0xa'));var ejs=require(_0xa3ee('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa3ee('0xc'));var crypto=require('crypto');var jsforce=require(_0xa3ee('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa3ee('0xa'));var querystring=require('querystring');var Papa=require(_0xa3ee('0xe'));var Redis=require('ioredis');var authService=require(_0xa3ee('0xf'));var qs=require(_0xa3ee('0x10'));var as=require(_0xa3ee('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3ee('0x12'))(_0xa3ee('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa3ee('0x14'));var db=require(_0xa3ee('0x15'))['db'];function respondWithStatusCode(_0x403518,_0x4363d1){_0x4363d1=_0x4363d1||0xcc;return function(_0x594c88){if(_0x594c88){return _0x403518[_0xa3ee('0x16')](_0x4363d1);}return _0x403518['status'](_0x4363d1)[_0xa3ee('0x17')]();};}function respondWithResult(_0x20535f,_0x2c34cf){_0x2c34cf=_0x2c34cf||0xc8;return function(_0x150e20){if(_0x150e20){return _0x20535f['status'](_0x2c34cf)[_0xa3ee('0x18')](_0x150e20);}};}function respondWithFilteredResult(_0x23df7d,_0x5da681){return function(_0x5358aa){if(_0x5358aa){var _0x4b2c66=typeof _0x5da681[_0xa3ee('0x19')]===_0xa3ee('0x1a')&&typeof _0x5da681[_0xa3ee('0x1b')]===_0xa3ee('0x1a');var _0x4cc8bb=_0x5358aa[_0xa3ee('0x1c')];var _0x40ffdb=_0x4b2c66?0x0:_0x5da681[_0xa3ee('0x19')];var _0x299b1e=_0x4b2c66?_0x5358aa[_0xa3ee('0x1c')]:_0x5da681['offset']+_0x5da681[_0xa3ee('0x1b')];var _0x18b738;if(_0x299b1e>=_0x4cc8bb){_0x299b1e=_0x4cc8bb;_0x18b738=0xc8;}else{_0x18b738=0xce;}_0x23df7d[_0xa3ee('0x1d')](_0x18b738);return _0x23df7d[_0xa3ee('0x1e')](_0xa3ee('0x1f'),_0x40ffdb+'-'+_0x299b1e+'/'+_0x4cc8bb)[_0xa3ee('0x18')](_0x5358aa);}return null;};}function patchUpdates(_0x4f8c56){return function(_0x3f5d70){try{jsonpatch[_0xa3ee('0x20')](_0x3f5d70,_0x4f8c56,!![]);}catch(_0x4b8445){return BPromise[_0xa3ee('0x21')](_0x4b8445);}return _0x3f5d70['save']();};}function saveUpdates(_0x2fab5,_0x29df43){return function(_0x1d3022){if(_0x1d3022){return _0x1d3022[_0xa3ee('0x22')](_0x2fab5)[_0xa3ee('0x23')](function(_0x47108f){return _0x47108f;});}return null;};}function removeEntity(_0x3ce61b,_0x12108e){return function(_0x5ae0a1){if(_0x5ae0a1){return _0x5ae0a1[_0xa3ee('0x24')]()['then'](function(){_0x3ce61b[_0xa3ee('0x1d')](0xcc)[_0xa3ee('0x17')]();});}};}function handleEntityNotFound(_0x157071,_0x1fe4b4){return function(_0x2c48db){if(!_0x2c48db){_0x157071['sendStatus'](0x194);}return _0x2c48db;};}function handleError(_0x3c68f9,_0x1b766e){_0x1b766e=_0x1b766e||0x1f4;return function(_0x146493){logger[_0xa3ee('0x25')](_0x146493[_0xa3ee('0x26')]);if(_0x146493[_0xa3ee('0x27')]){delete _0x146493[_0xa3ee('0x27')];}_0x3c68f9[_0xa3ee('0x1d')](_0x1b766e)[_0xa3ee('0x28')](_0x146493);};}exports[_0xa3ee('0x29')]=function(_0x59c6f9,_0x5ba571){var _0x4abf49={},_0x78e581={},_0x481358={'count':0x0,'rows':[]};var _0x3fa094=_[_0xa3ee('0x2a')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')],function(_0x26b222){return{'name':_0x26b222[_0xa3ee('0x2d')],'type':_0x26b222[_0xa3ee('0x2e')][_0xa3ee('0x2f')]};});_0x78e581[_0xa3ee('0x30')]=_[_0xa3ee('0x31')](_['map'](_0x3fa094,_0xa3ee('0x27')),['format']);_0x78e581[_0xa3ee('0x32')]=_[_0xa3ee('0x33')](_0x59c6f9['query']);_0x78e581[_0xa3ee('0x34')]=_['intersection'](_0x78e581[_0xa3ee('0x30')],_0x78e581['query']);_0x4abf49[_0xa3ee('0x35')]=_[_0xa3ee('0x36')](_0x78e581[_0xa3ee('0x30')],qs[_0xa3ee('0x37')](_0x59c6f9[_0xa3ee('0x32')]['fields']));_0x4abf49[_0xa3ee('0x35')]=_0x4abf49[_0xa3ee('0x35')][_0xa3ee('0x38')]?_0x4abf49['attributes']:_0x78e581[_0xa3ee('0x30')];if(!_0x59c6f9['query'][_0xa3ee('0x39')]('nolimit')){_0x4abf49[_0xa3ee('0x1b')]=qs['limit'](_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x1b')]);_0x4abf49[_0xa3ee('0x19')]=qs[_0xa3ee('0x19')](_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x19')]);}_0x4abf49[_0xa3ee('0x3a')]=qs[_0xa3ee('0x3b')](_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x3b')]);_0x4abf49[_0xa3ee('0x3c')]=qs[_0xa3ee('0x34')](_[_0xa3ee('0x3d')](_0x59c6f9['query'],_0x78e581[_0xa3ee('0x34')]),_0x3fa094);if(_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x3e')]){_0x4abf49[_0xa3ee('0x3c')]=_['merge'](_0x4abf49[_0xa3ee('0x3c')],{'$or':_[_0xa3ee('0x2a')](_0x3fa094,function(_0x1a9b63){if(_0x1a9b63['type']!==_0xa3ee('0x3f')){var _0x3554eb={};_0x3554eb[_0x1a9b63['name']]={'$like':'%'+_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x3e')]+'%'};return _0x3554eb;}})});}_0x4abf49=_['merge']({},_0x4abf49,_0x59c6f9[_0xa3ee('0x40')]);var _0x6dd235={'where':_0x4abf49[_0xa3ee('0x3c')]};return db[_0xa3ee('0x2b')][_0xa3ee('0x1c')](_0x6dd235)[_0xa3ee('0x23')](function(_0x2ca04f){_0x481358[_0xa3ee('0x1c')]=_0x2ca04f;if(_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x41')]){_0x4abf49[_0xa3ee('0x42')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x4abf49);})['then'](function(_0x45aeec){_0x481358[_0xa3ee('0x43')]=_0x45aeec;return _0x481358;})['then'](respondWithFilteredResult(_0x5ba571,_0x4abf49))[_0xa3ee('0x44')](handleError(_0x5ba571,null));};exports[_0xa3ee('0x45')]=function(_0x279834,_0x55f47f){var _0x1af10b={'raw':![],'where':{'id':_0x279834[_0xa3ee('0x46')]['id']}},_0x559cc1={};_0x559cc1[_0xa3ee('0x30')]=_[_0xa3ee('0x33')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')]);_0x559cc1[_0xa3ee('0x32')]=_[_0xa3ee('0x33')](_0x279834[_0xa3ee('0x32')]);_0x559cc1[_0xa3ee('0x34')]=_[_0xa3ee('0x36')](_0x559cc1[_0xa3ee('0x30')],_0x559cc1[_0xa3ee('0x32')]);_0x1af10b[_0xa3ee('0x35')]=_[_0xa3ee('0x36')](_0x559cc1[_0xa3ee('0x30')],qs[_0xa3ee('0x37')](_0x279834[_0xa3ee('0x32')][_0xa3ee('0x37')]));_0x1af10b['attributes']=_0x1af10b[_0xa3ee('0x35')][_0xa3ee('0x38')]?_0x1af10b[_0xa3ee('0x35')]:_0x559cc1[_0xa3ee('0x30')];if(_0x279834['query'][_0xa3ee('0x41')]){_0x1af10b['include']=[{'all':!![]}];}_0x1af10b=_[_0xa3ee('0x47')]({},_0x1af10b,_0x279834[_0xa3ee('0x40')]);return db[_0xa3ee('0x2b')][_0xa3ee('0x48')](_0x1af10b)[_0xa3ee('0x23')](handleEntityNotFound(_0x55f47f,null))[_0xa3ee('0x23')](respondWithResult(_0x55f47f,null))[_0xa3ee('0x44')](handleError(_0x55f47f,null));};exports[_0xa3ee('0x49')]=function(_0x3c3677,_0xd6160e){return db['ScreenRecording'][_0xa3ee('0x49')](_0x3c3677['body'],{})['then'](respondWithResult(_0xd6160e,0xc9))[_0xa3ee('0x44')](handleError(_0xd6160e,null));};exports[_0xa3ee('0x22')]=function(_0x45029f,_0x1ec479){if(_0x45029f[_0xa3ee('0x4a')]['id']){delete _0x45029f[_0xa3ee('0x4a')]['id'];}delete _0x45029f[_0xa3ee('0x4a')]['duration'];delete _0x45029f[_0xa3ee('0x4a')][_0xa3ee('0x4b')];delete _0x45029f['body'][_0xa3ee('0x4c')];delete _0x45029f[_0xa3ee('0x4a')][_0xa3ee('0x4d')];return db['ScreenRecording']['find']({'where':{'id':_0x45029f[_0xa3ee('0x46')]['id']}})[_0xa3ee('0x23')](handleEntityNotFound(_0x1ec479,null))[_0xa3ee('0x23')](saveUpdates(_0x45029f[_0xa3ee('0x4a')],null))[_0xa3ee('0x23')](respondWithResult(_0x1ec479,null))['catch'](handleError(_0x1ec479,null));};exports['describe']=function(_0x15b55e,_0x441b23){return db['ScreenRecording'][_0xa3ee('0x4e')]()[_0xa3ee('0x23')](respondWithResult(_0x441b23,null))[_0xa3ee('0x44')](handleError(_0x441b23,null));};exports['download']=function(_0x505444,_0x2388f7,_0x49057c){var _0x172a73=require(_0xa3ee('0x4f'));var _0x5b8e79=![];var _0x4232e0={};if(_0x505444[_0xa3ee('0x32')][_0xa3ee('0x2e')]&&_0x505444['query'][_0xa3ee('0x2e')]===_0xa3ee('0x50')){_0x4232e0['uniqueid']=_0x505444[_0xa3ee('0x46')]['id'];}else{_0x4232e0['id']=_0x505444[_0xa3ee('0x46')]['id'];}return db[_0xa3ee('0x2b')]['find']({'where':_0x4232e0,'attributes':['id','value'],'raw':!![]})[_0xa3ee('0x23')](handleEntityNotFound(_0x2388f7,null))[_0xa3ee('0x23')](function(_0x4a1a2f){if(_0x4a1a2f){var _0x1f9913=path[_0xa3ee('0x51')](config['root'],'server/files/screen_recordings',_0x4a1a2f[_0xa3ee('0x4d')]);var _0x659491=util[_0xa3ee('0x52')]('%s.cypher',_0x1f9913);if(fs[_0xa3ee('0x53')](_0x659491)){_0x5b8e79=!![];return _0x172a73[_0xa3ee('0x54')](_0x659491,_0x1f9913,config[_0xa3ee('0x55')][_0xa3ee('0x56')])[_0xa3ee('0x23')](function(){return _0x4a1a2f;});}return _0x4a1a2f;}})[_0xa3ee('0x23')](function(_0x497be4){if(_0x497be4){var _0x10f508=path[_0xa3ee('0x51')](config['root'],_0xa3ee('0x57'),_0x497be4[_0xa3ee('0x4d')]);if(!fs[_0xa3ee('0x53')](_0x10f508)){throw new db[(_0xa3ee('0x58'))][(_0xa3ee('0x59'))](_0xa3ee('0x5a'));}if(_0x497be4['filename']){return _0x2388f7[_0xa3ee('0x5b')](_0x10f508,_0x497be4[_0xa3ee('0x5c')]+path[_0xa3ee('0x5d')](_0x10f508),function(){if(_0x5b8e79){fs['unlink'](_0x10f508);}});}else{return _0x2388f7[_0xa3ee('0x5b')](_0x10f508,function(_0x13b81b){if(_0x5b8e79){fs['unlink'](_0x10f508);}});}}})['catch'](function(_0x4df186){if(_0x4df186['message']===_0xa3ee('0x5a')){_0x2388f7[_0xa3ee('0x1d')](0x194)[_0xa3ee('0x28')](_0xa3ee('0x5e'));}else{return handleError(_0x2388f7,null);}});};exports[_0xa3ee('0x24')]=function(_0x18a164,_0x4000ee){return db['ScreenRecording'][_0xa3ee('0x48')]({'where':{'id':_0x18a164[_0xa3ee('0x46')]['id']}})[_0xa3ee('0x23')](function(_0xaff641){if(_[_0xa3ee('0x5f')](_0xaff641)){throw new ReferenceError('Entity\x20not\x20found');}return _0xaff641;})['then'](function(_0x7b1e97){var _0x303b71=path[_0xa3ee('0x51')](config[_0xa3ee('0x60')],_0xa3ee('0x57'),_0x7b1e97[_0xa3ee('0x4d')]);logger[_0xa3ee('0x61')](_0xa3ee('0x62'),_0x303b71);if(!_[_0xa3ee('0x5f')](_0x7b1e97[_0xa3ee('0x4d')])&&fs[_0xa3ee('0x53')](_0x303b71)){logger[_0xa3ee('0x61')](_0xa3ee('0x63')+_0x303b71+_0xa3ee('0x64'));fs[_0xa3ee('0x65')](_0x303b71);}_0x303b71=_0x303b71+'.cypher';if(!_[_0xa3ee('0x5f')](_0x7b1e97['value'])&&fs['existsSync'](_0x303b71)){logger[_0xa3ee('0x61')]('File:\x20\x22'+_0x303b71+_0xa3ee('0x64'));fs[_0xa3ee('0x65')](_0x303b71);}return _0x7b1e97;})[_0xa3ee('0x23')](function(_0x221deb){if(!_0x221deb)throw new InternalError();return _0x221deb['destroy']();})[_0xa3ee('0x23')](function(){_0x4000ee[_0xa3ee('0x1d')](0xcc)[_0xa3ee('0x17')]();})[_0xa3ee('0x44')](handleError(_0x4000ee,null));}; \ No newline at end of file +var _0xdc97=['join','root','%s.cypher','existsSync','decryptFile','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','sendStatus','error','name','send','index','map','format','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','options','ScreenRecording','includeAll','rows','catch','show','params','include','find','create','body','duration','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid'];(function(_0x184c2c,_0x46777d){var _0x356f01=function(_0xfa6fb){while(--_0xfa6fb){_0x184c2c['push'](_0x184c2c['shift']());}};_0x356f01(++_0x46777d);}(_0xdc97,0x13b));var _0x7dc9=function(_0x18dcf6,_0x588111){_0x18dcf6=_0x18dcf6-0x0;var _0x281f12=_0xdc97[_0x18dcf6];return _0x281f12;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){_0xffc080[_0x7dc9('0x16')](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x55a482,_0x48c6bc){return function(_0x4b9ba6){if(!_0x4b9ba6){_0x55a482[_0x7dc9('0x22')](0x194);}return _0x4b9ba6;};}function handleError(_0x32d032,_0x5843bf){_0x5843bf=_0x5843bf||0x1f4;return function(_0x585eef){logger[_0x7dc9('0x23')](_0x585eef['stack']);if(_0x585eef[_0x7dc9('0x24')]){delete _0x585eef[_0x7dc9('0x24')];}_0x32d032[_0x7dc9('0x16')](_0x5843bf)[_0x7dc9('0x25')](_0x585eef);};}exports[_0x7dc9('0x26')]=function(_0x450124,_0x236d42){var _0x229f8e={},_0x1fcf0e={},_0x3c4379={'count':0x0,'rows':[]};var _0x14083d=_[_0x7dc9('0x27')](db['ScreenRecording']['rawAttributes'],function(_0x513dd6){return{'name':_0x513dd6['fieldName'],'type':_0x513dd6['type']['key']};});_0x1fcf0e['model']=_['differenceBy'](_[_0x7dc9('0x27')](_0x14083d,_0x7dc9('0x24')),[_0x7dc9('0x28')]);_0x1fcf0e[_0x7dc9('0x29')]=_[_0x7dc9('0x2a')](_0x450124[_0x7dc9('0x29')]);_0x1fcf0e['filters']=_['intersection'](_0x1fcf0e['model'],_0x1fcf0e[_0x7dc9('0x29')]);_0x229f8e['attributes']=_[_0x7dc9('0x2b')](_0x1fcf0e[_0x7dc9('0x2c')],qs[_0x7dc9('0x2d')](_0x450124[_0x7dc9('0x29')][_0x7dc9('0x2d')]));_0x229f8e[_0x7dc9('0x2e')]=_0x229f8e[_0x7dc9('0x2e')][_0x7dc9('0x2f')]?_0x229f8e['attributes']:_0x1fcf0e[_0x7dc9('0x2c')];if(!_0x450124['query'][_0x7dc9('0x30')](_0x7dc9('0x31'))){_0x229f8e[_0x7dc9('0x1a')]=qs[_0x7dc9('0x1a')](_0x450124['query'][_0x7dc9('0x1a')]);_0x229f8e['offset']=qs[_0x7dc9('0x18')](_0x450124['query']['offset']);}_0x229f8e[_0x7dc9('0x32')]=qs[_0x7dc9('0x33')](_0x450124[_0x7dc9('0x29')][_0x7dc9('0x33')]);_0x229f8e['where']=qs[_0x7dc9('0x34')](_[_0x7dc9('0x35')](_0x450124[_0x7dc9('0x29')],_0x1fcf0e[_0x7dc9('0x34')]),_0x14083d);if(_0x450124[_0x7dc9('0x29')][_0x7dc9('0x36')]){_0x229f8e[_0x7dc9('0x37')]=_[_0x7dc9('0x38')](_0x229f8e[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x27')](_0x14083d,function(_0x452aed){if(_0x452aed[_0x7dc9('0x39')]!=='VIRTUAL'){var _0x34b5c9={};_0x34b5c9[_0x452aed[_0x7dc9('0x24')]]={'$like':'%'+_0x450124[_0x7dc9('0x29')][_0x7dc9('0x36')]+'%'};return _0x34b5c9;}})});}_0x229f8e=_['merge']({},_0x229f8e,_0x450124[_0x7dc9('0x3a')]);var _0x89db0e={'where':_0x229f8e[_0x7dc9('0x37')]};return db[_0x7dc9('0x3b')][_0x7dc9('0x1b')](_0x89db0e)[_0x7dc9('0x21')](function(_0x5a1201){_0x3c4379['count']=_0x5a1201;if(_0x450124[_0x7dc9('0x29')][_0x7dc9('0x3c')]){_0x229f8e['include']=[{'all':!![]}];}return db[_0x7dc9('0x3b')]['findAll'](_0x229f8e);})[_0x7dc9('0x21')](function(_0x2a91fe){_0x3c4379[_0x7dc9('0x3d')]=_0x2a91fe;return _0x3c4379;})['then'](respondWithFilteredResult(_0x236d42,_0x229f8e))[_0x7dc9('0x3e')](handleError(_0x236d42,null));};exports[_0x7dc9('0x3f')]=function(_0x1929b6,_0x95513c){var _0x28ffc0={'raw':![],'where':{'id':_0x1929b6[_0x7dc9('0x40')]['id']}},_0x23499a={};_0x23499a['model']=_[_0x7dc9('0x2a')](db['ScreenRecording']['rawAttributes']);_0x23499a[_0x7dc9('0x29')]=_[_0x7dc9('0x2a')](_0x1929b6[_0x7dc9('0x29')]);_0x23499a[_0x7dc9('0x34')]=_[_0x7dc9('0x2b')](_0x23499a[_0x7dc9('0x2c')],_0x23499a[_0x7dc9('0x29')]);_0x28ffc0[_0x7dc9('0x2e')]=_[_0x7dc9('0x2b')](_0x23499a['model'],qs[_0x7dc9('0x2d')](_0x1929b6[_0x7dc9('0x29')][_0x7dc9('0x2d')]));_0x28ffc0[_0x7dc9('0x2e')]=_0x28ffc0[_0x7dc9('0x2e')][_0x7dc9('0x2f')]?_0x28ffc0['attributes']:_0x23499a[_0x7dc9('0x2c')];if(_0x1929b6[_0x7dc9('0x29')]['includeAll']){_0x28ffc0[_0x7dc9('0x41')]=[{'all':!![]}];}_0x28ffc0=_[_0x7dc9('0x38')]({},_0x28ffc0,_0x1929b6[_0x7dc9('0x3a')]);return db['ScreenRecording'][_0x7dc9('0x42')](_0x28ffc0)['then'](handleEntityNotFound(_0x95513c,null))['then'](respondWithResult(_0x95513c,null))[_0x7dc9('0x3e')](handleError(_0x95513c,null));};exports[_0x7dc9('0x43')]=function(_0x36d591,_0x5e0dc5){return db['ScreenRecording'][_0x7dc9('0x43')](_0x36d591['body'],{})[_0x7dc9('0x21')](respondWithResult(_0x5e0dc5,0xc9))[_0x7dc9('0x3e')](handleError(_0x5e0dc5,null));};exports['update']=function(_0x24ccce,_0x1d6c0a){if(_0x24ccce[_0x7dc9('0x44')]['id']){delete _0x24ccce[_0x7dc9('0x44')]['id'];}delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x45')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x46')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x47')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x48')];return db[_0x7dc9('0x3b')]['find']({'where':{'id':_0x24ccce[_0x7dc9('0x40')]['id']}})['then'](handleEntityNotFound(_0x1d6c0a,null))['then'](saveUpdates(_0x24ccce[_0x7dc9('0x44')],null))[_0x7dc9('0x21')](respondWithResult(_0x1d6c0a,null))[_0x7dc9('0x3e')](handleError(_0x1d6c0a,null));};exports[_0x7dc9('0x49')]=function(_0x346d27,_0x510e2a){return db[_0x7dc9('0x3b')][_0x7dc9('0x49')]()[_0x7dc9('0x21')](respondWithResult(_0x510e2a,null))['catch'](handleError(_0x510e2a,null));};exports[_0x7dc9('0x4a')]=function(_0x3fc164,_0x2cf133,_0x32bc31){var _0xf41b8c=require(_0x7dc9('0x4b'));var _0x593132=![];var _0x366b8b={};if(_0x3fc164[_0x7dc9('0x29')][_0x7dc9('0x39')]&&_0x3fc164[_0x7dc9('0x29')][_0x7dc9('0x39')]===_0x7dc9('0x4c')){_0x366b8b[_0x7dc9('0x4c')]=_0x3fc164[_0x7dc9('0x40')]['id'];}else{_0x366b8b['id']=_0x3fc164[_0x7dc9('0x40')]['id'];}return db[_0x7dc9('0x3b')][_0x7dc9('0x42')]({'where':_0x366b8b,'attributes':['id',_0x7dc9('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x2cf133,null))[_0x7dc9('0x21')](function(_0x39be46){if(_0x39be46){var _0x38df9a=path[_0x7dc9('0x4d')](config[_0x7dc9('0x4e')],'server/files/screen_recordings',_0x39be46[_0x7dc9('0x48')]);var _0xd8d327=util[_0x7dc9('0x28')](_0x7dc9('0x4f'),_0x38df9a);if(fs[_0x7dc9('0x50')](_0xd8d327)){_0x593132=!![];return _0xf41b8c[_0x7dc9('0x51')](_0xd8d327,_0x38df9a,config['secrets']['recording'])['then'](function(){return _0x39be46;});}return _0x39be46;}})[_0x7dc9('0x21')](function(_0x3daf33){if(_0x3daf33){var _0x32a64f=path[_0x7dc9('0x4d')](config['root'],'server/files/screen_recordings',_0x3daf33[_0x7dc9('0x48')]);if(!fs[_0x7dc9('0x50')](_0x32a64f)){throw new db[(_0x7dc9('0x52'))][(_0x7dc9('0x53'))](_0x7dc9('0x54'));}if(_0x3daf33[_0x7dc9('0x55')]){return _0x2cf133[_0x7dc9('0x4a')](_0x32a64f,_0x3daf33['filename']+path[_0x7dc9('0x56')](_0x32a64f),function(){if(_0x593132){fs[_0x7dc9('0x57')](_0x32a64f);}});}else{return _0x2cf133[_0x7dc9('0x4a')](_0x32a64f,function(_0x1dad95){if(_0x593132){fs[_0x7dc9('0x57')](_0x32a64f);}});}}})['catch'](function(_0x175858){if(_0x175858[_0x7dc9('0x58')]===_0x7dc9('0x54')){_0x2cf133[_0x7dc9('0x16')](0x194)[_0x7dc9('0x25')](_0x7dc9('0x59'));}else{return handleError(_0x2cf133,null);}});};exports[_0x7dc9('0x5a')]=function(_0x2a02ed,_0x3463e4){return db[_0x7dc9('0x3b')][_0x7dc9('0x42')]({'where':{'id':_0x2a02ed[_0x7dc9('0x40')]['id']}})[_0x7dc9('0x21')](function(_0x5eee27){if(_[_0x7dc9('0x5b')](_0x5eee27)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5eee27;})[_0x7dc9('0x21')](function(_0x15cf19){var _0x48ea37=path[_0x7dc9('0x4d')](config[_0x7dc9('0x4e')],'server/files/screen_recordings',_0x15cf19[_0x7dc9('0x48')]);logger[_0x7dc9('0x5c')](_0x7dc9('0x5d'),_0x48ea37);if(!_['isNil'](_0x15cf19['value'])&&fs[_0x7dc9('0x50')](_0x48ea37)){logger[_0x7dc9('0x5c')](_0x7dc9('0x5e')+_0x48ea37+_0x7dc9('0x5f'));fs[_0x7dc9('0x60')](_0x48ea37);}_0x48ea37=_0x48ea37+_0x7dc9('0x61');if(!_[_0x7dc9('0x5b')](_0x15cf19[_0x7dc9('0x48')])&&fs[_0x7dc9('0x50')](_0x48ea37)){logger['info'](_0x7dc9('0x5e')+_0x48ea37+_0x7dc9('0x5f'));fs[_0x7dc9('0x60')](_0x48ea37);}return _0x15cf19;})['then'](function(_0x4f80bd){if(!_0x4f80bd)throw new InternalError();return _0x4f80bd[_0x7dc9('0x5a')]();})[_0x7dc9('0x21')](function(){_0x3463e4[_0x7dc9('0x16')](0xcc)[_0x7dc9('0x17')]();})['catch'](handleError(_0x3463e4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 22cefdf..1e7a376 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 _0xd3ae=['exports','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./screenRecording.attributes'];(function(_0x2d36fb,_0x3ce03d){var _0x41d176=function(_0x2a524a){while(--_0x2a524a){_0x2d36fb['push'](_0x2d36fb['shift']());}};_0x41d176(++_0x3ce03d);}(_0xd3ae,0x162));var _0xed3a=function(_0x209f9c,_0x4ea385){_0x209f9c=_0x209f9c-0x0;var _0x13c1ef=_0xd3ae[_0x209f9c];return _0x13c1ef;};'use strict';var _=require(_0xed3a('0x0'));var util=require(_0xed3a('0x1'));var logger=require(_0xed3a('0x2'))(_0xed3a('0x3'));var moment=require(_0xed3a('0x4'));var BPromise=require(_0xed3a('0x5'));var rp=require(_0xed3a('0x6'));var fs=require('fs');var path=require(_0xed3a('0x7'));var rimraf=require(_0xed3a('0x8'));var config=require('../../config/environment');var attributes=require(_0xed3a('0x9'));module[_0xed3a('0xa')]=function(_0x2df292,_0x30b73f){return _0x2df292['define'](_0xed3a('0xb'),attributes,{'tableName':_0xed3a('0xc'),'paranoid':![],'indexes':[{'name':_0xed3a('0xd'),'fields':[_0xed3a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7e9a=['define','ScreenRecording','interactionid','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x3cb93a,_0x5048cf){var _0x49b7b7=function(_0x2bb13d){while(--_0x2bb13d){_0x3cb93a['push'](_0x3cb93a['shift']());}};_0x49b7b7(++_0x5048cf);}(_0x7e9a,0xdf));var _0xa7e9=function(_0x21832f,_0x42dd69){_0x21832f=_0x21832f-0x0;var _0x16861d=_0x7e9a[_0x21832f];return _0x16861d;};'use strict';var _=require(_0xa7e9('0x0'));var util=require('util');var logger=require(_0xa7e9('0x1'))(_0xa7e9('0x2'));var moment=require(_0xa7e9('0x3'));var BPromise=require(_0xa7e9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa7e9('0x5'));var config=require(_0xa7e9('0x6'));var attributes=require(_0xa7e9('0x7'));module['exports']=function(_0x5674b2,_0x251d2b){return _0x5674b2[_0xa7e9('0x8')](_0xa7e9('0x9'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xa7e9('0xa'),'fields':[_0xa7e9('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 406a3db..e6e957d 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 _0xd4f4=['ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','ScreenRecording,\x20%s,\x20%s','message','info','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug'];(function(_0x1b820d,_0x3c4692){var _0x148802=function(_0x3e1d39){while(--_0x3e1d39){_0x1b820d['push'](_0x1b820d['shift']());}};_0x148802(++_0x3c4692);}(_0xd4f4,0xa1));var _0x4d4f=function(_0x3b3c59,_0x2012c6){_0x3b3c59=_0x3b3c59-0x0;var _0xe6038e=_0xd4f4[_0x3b3c59];return _0xe6038e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4d4f('0x0'));var BPromise=require(_0x4d4f('0x1'));var rs=require(_0x4d4f('0x2'));var fs=require('fs');var Redis=require(_0x4d4f('0x3'));var db=require(_0x4d4f('0x4'))['db'];var utils=require(_0x4d4f('0x5'));var logger=require(_0x4d4f('0x6'))(_0x4d4f('0x7'));var config=require(_0x4d4f('0x8'));var jayson=require(_0x4d4f('0x9'));var client=jayson[_0x4d4f('0xa')][_0x4d4f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a7415,_0xe27ae6,_0x25b2fd){return new BPromise(function(_0x55244a,_0x3c47ae){return client['request'](_0x4a7415,_0x25b2fd)[_0x4d4f('0xc')](function(_0x17e6ad){logger['info']('ScreenRecording,\x20%s,\x20%s',_0xe27ae6,_0x4d4f('0xd'));logger[_0x4d4f('0xe')](_0x4d4f('0xf'),_0xe27ae6,'request\x20sent',JSON[_0x4d4f('0x10')](_0x17e6ad));if(_0x17e6ad[_0x4d4f('0x11')]){if(_0x17e6ad[_0x4d4f('0x11')]['code']===0x1f4){logger[_0x4d4f('0x11')](_0x4d4f('0x12'),_0xe27ae6,_0x17e6ad[_0x4d4f('0x11')]['message']);return _0x3c47ae(_0x17e6ad[_0x4d4f('0x11')]['message']);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0xe27ae6,_0x17e6ad[_0x4d4f('0x11')][_0x4d4f('0x13')]);return _0x55244a(_0x17e6ad[_0x4d4f('0x11')][_0x4d4f('0x13')]);}else{logger[_0x4d4f('0x14')](_0x4d4f('0x12'),_0xe27ae6,_0x4d4f('0xd'));_0x55244a(_0x17e6ad['result']['message']);}})[_0x4d4f('0x15')](function(_0x592d18){logger[_0x4d4f('0x11')](_0x4d4f('0x12'),_0xe27ae6,_0x592d18);_0x3c47ae(_0x592d18);});});} \ No newline at end of file +var _0x6864=['http','then','info','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x4ea493,_0x5c8102){var _0x17103a=function(_0x1b51f3){while(--_0x1b51f3){_0x4ea493['push'](_0x4ea493['shift']());}};_0x17103a(++_0x5c8102);}(_0x6864,0xf0));var _0x4686=function(_0x79e3b,_0xe55c7e){_0x79e3b=_0x79e3b-0x0;var _0x529d58=_0x6864[_0x79e3b];return _0x529d58;};'use strict';var _=require('lodash');var util=require(_0x4686('0x0'));var moment=require(_0x4686('0x1'));var BPromise=require('bluebird');var rs=require(_0x4686('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4686('0x3'))['db'];var utils=require(_0x4686('0x4'));var logger=require('../../config/logger')(_0x4686('0x5'));var config=require('../../config/environment');var jayson=require(_0x4686('0x6'));var client=jayson['client'][_0x4686('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x39ca84,_0x5783bf,_0x2cd4ce){return new BPromise(function(_0x377294,_0x5ac66a){return client['request'](_0x39ca84,_0x2cd4ce)[_0x4686('0x8')](function(_0xc0476a){logger[_0x4686('0x9')](_0x4686('0xa'),_0x5783bf,'request\x20sent');logger[_0x4686('0xb')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x5783bf,_0x4686('0xc'),JSON[_0x4686('0xd')](_0xc0476a));if(_0xc0476a['error']){if(_0xc0476a[_0x4686('0xe')][_0x4686('0xf')]===0x1f4){logger['error'](_0x4686('0xa'),_0x5783bf,_0xc0476a[_0x4686('0xe')][_0x4686('0x10')]);return _0x5ac66a(_0xc0476a['error'][_0x4686('0x10')]);}logger[_0x4686('0xe')](_0x4686('0xa'),_0x5783bf,_0xc0476a[_0x4686('0xe')][_0x4686('0x10')]);return _0x377294(_0xc0476a['error'][_0x4686('0x10')]);}else{logger[_0x4686('0x9')](_0x4686('0xa'),_0x5783bf,'request\x20sent');_0x377294(_0xc0476a[_0x4686('0x11')][_0x4686('0x10')]);}})[_0x4686('0x12')](function(_0x23d8b0){logger[_0x4686('0xe')](_0x4686('0xa'),_0x5783bf,_0x23d8b0);_0x5ac66a(_0x23d8b0);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 40e818b..fd8584a 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 _0x47f3=['getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','extname','post','single','file','addLogo','logologin','addLogoLogin','format','preferred','addPreferred','favicon','originalname','addFavicon','isAuthenticated','update','exports','multer','path','Router','fs-extra','../../components/auth/service','./setting.controller','get','index','/now','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','/:id/preferred','/:id/favicon'];(function(_0x433920,_0x3059eb){var _0x183996=function(_0x3ef728){while(--_0x3ef728){_0x433920['push'](_0x433920['shift']());}};_0x183996(++_0x3059eb);}(_0x47f3,0x1c3));var _0x347f=function(_0x57e015,_0x5b596e){_0x57e015=_0x57e015-0x0;var _0x1ca9f9=_0x47f3[_0x57e015];return _0x1ca9f9;};'use strict';var multer=require(_0x347f('0x0'));var util=require('util');var path=require(_0x347f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x347f('0x2')]();var fs_extra=require(_0x347f('0x3'));var auth=require(_0x347f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x347f('0x5'));router[_0x347f('0x6')]('/',auth['isAuthenticated'](),controller[_0x347f('0x7')]);router[_0x347f('0x6')](_0x347f('0x8'),controller['getDate']);router[_0x347f('0x6')](_0x347f('0x9'),controller[_0x347f('0xa')]);router[_0x347f('0x6')](_0x347f('0xb'),controller[_0x347f('0xc')]);router[_0x347f('0x6')](_0x347f('0xd'),controller['getLogoLogin']);router[_0x347f('0x6')](_0x347f('0xe'),controller['gdpr']);router[_0x347f('0x6')](_0x347f('0xf'),controller['getPreferred']);router[_0x347f('0x6')](_0x347f('0x10'),controller[_0x347f('0x11')]);var upload=multer({'storage':multer[_0x347f('0x12')]({'destination':function(_0x20085e,_0x19f6d1,_0x589a89){_0x589a89(null,path[_0x347f('0x13')](config[_0x347f('0x14')],_0x347f('0x15')));},'filename':function(_0x28ce69,_0x37520b,_0x176044){_0x176044(null,util['format'](_0x347f('0x16'),'logo',path[_0x347f('0x17')](_0x37520b['originalname'])));}})});router[_0x347f('0x18')](_0x347f('0xb'),upload[_0x347f('0x19')](_0x347f('0x1a')),controller[_0x347f('0x1b')]);var upload=multer({'storage':multer[_0x347f('0x12')]({'destination':function(_0x322555,_0x478a0d,_0x1a92a7){_0x1a92a7(null,path['join'](config[_0x347f('0x14')],_0x347f('0x15')));},'filename':function(_0x512e64,_0x373491,_0x127400){_0x127400(null,util['format']('%s%s',_0x347f('0x1c'),path[_0x347f('0x17')](_0x373491['originalname'])));}})});router[_0x347f('0x18')]('/:id/logo_login',upload[_0x347f('0x19')](_0x347f('0x1a')),controller[_0x347f('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3759b5,_0x59f9d5,_0x577889){_0x577889(null,path[_0x347f('0x13')](config[_0x347f('0x14')],'server/files/images/logos/'));},'filename':function(_0x290346,_0x18b773,_0x5d7ff4){_0x5d7ff4(null,util[_0x347f('0x1e')](_0x347f('0x16'),_0x347f('0x1f'),path['extname'](_0x18b773['originalname'])));}})});router[_0x347f('0x18')](_0x347f('0xf'),upload[_0x347f('0x19')](_0x347f('0x1a')),controller[_0x347f('0x20')]);var upload=multer({'storage':multer[_0x347f('0x12')]({'destination':function(_0x3cf3c9,_0x37aac7,_0xf9fd7e){_0xf9fd7e(null,path[_0x347f('0x13')](config[_0x347f('0x14')],_0x347f('0x15')));},'filename':function(_0xac9905,_0x23737d,_0xd5095c){_0xd5095c(null,util[_0x347f('0x1e')](_0x347f('0x16'),_0x347f('0x21'),path[_0x347f('0x17')](_0x23737d[_0x347f('0x22')])));}})});router['post'](_0x347f('0x10'),upload['single'](_0x347f('0x1a')),controller[_0x347f('0x23')]);router['put'](_0x347f('0x9'),auth[_0x347f('0x24')](),controller[_0x347f('0x25')]);module[_0x347f('0x26')]=router; \ No newline at end of file +var _0x7982=['single','file','addLogo','logologin','addLogoLogin','addPreferred','favicon','addFavicon','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get','/:id','show','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','/:id/logo'];(function(_0x473482,_0x4844ee){var _0x2897f8=function(_0x35342d){while(--_0x35342d){_0x473482['push'](_0x473482['shift']());}};_0x2897f8(++_0x4844ee);}(_0x7982,0x1eb));var _0x2798=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x7982[_0x288f5e];return _0x476cc9;};'use strict';var multer=require(_0x2798('0x0'));var util=require('util');var path=require(_0x2798('0x1'));var timeout=require(_0x2798('0x2'));var express=require(_0x2798('0x3'));var router=express[_0x2798('0x4')]();var fs_extra=require(_0x2798('0x5'));var auth=require(_0x2798('0x6'));var interaction=require(_0x2798('0x7'));var config=require('../../config/environment');var controller=require(_0x2798('0x8'));router[_0x2798('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2798('0x9')]('/now',controller['getDate']);router[_0x2798('0x9')](_0x2798('0xa'),controller[_0x2798('0xb')]);router[_0x2798('0x9')]('/:id/logo',controller['getLogo']);router['get'](_0x2798('0xc'),controller['getLogoLogin']);router[_0x2798('0x9')](_0x2798('0xd'),controller[_0x2798('0xe')]);router[_0x2798('0x9')](_0x2798('0xf'),controller[_0x2798('0x10')]);router[_0x2798('0x9')](_0x2798('0x11'),controller['getFavicon']);var upload=multer({'storage':multer[_0x2798('0x12')]({'destination':function(_0x1230a5,_0x7cf567,_0x1d6060){_0x1d6060(null,path[_0x2798('0x13')](config[_0x2798('0x14')],_0x2798('0x15')));},'filename':function(_0x3bb9d8,_0x31bd30,_0x4a13d4){_0x4a13d4(null,util[_0x2798('0x16')](_0x2798('0x17'),_0x2798('0x18'),path[_0x2798('0x19')](_0x31bd30[_0x2798('0x1a')])));}})});router[_0x2798('0x1b')](_0x2798('0x1c'),upload[_0x2798('0x1d')](_0x2798('0x1e')),controller[_0x2798('0x1f')]);var upload=multer({'storage':multer[_0x2798('0x12')]({'destination':function(_0x12a9ce,_0x3d2782,_0xc54162){_0xc54162(null,path[_0x2798('0x13')](config[_0x2798('0x14')],'server/files/images/logos/'));},'filename':function(_0x4f6d7a,_0x41bb00,_0x3c90ab){_0x3c90ab(null,util['format'](_0x2798('0x17'),_0x2798('0x20'),path[_0x2798('0x19')](_0x41bb00[_0x2798('0x1a')])));}})});router[_0x2798('0x1b')]('/:id/logo_login',upload[_0x2798('0x1d')](_0x2798('0x1e')),controller[_0x2798('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2b7493,_0x40bbb3,_0x1032b0){_0x1032b0(null,path[_0x2798('0x13')](config[_0x2798('0x14')],_0x2798('0x15')));},'filename':function(_0x1d86a2,_0x1e1f33,_0x37d3c7){_0x37d3c7(null,util[_0x2798('0x16')](_0x2798('0x17'),'preferred',path['extname'](_0x1e1f33[_0x2798('0x1a')])));}})});router[_0x2798('0x1b')]('/:id/preferred',upload[_0x2798('0x1d')](_0x2798('0x1e')),controller[_0x2798('0x22')]);var upload=multer({'storage':multer[_0x2798('0x12')]({'destination':function(_0x50ba32,_0x5c0542,_0x52579f){_0x52579f(null,path[_0x2798('0x13')](config[_0x2798('0x14')],_0x2798('0x15')));},'filename':function(_0x29993b,_0x24a519,_0x96350a){_0x96350a(null,util[_0x2798('0x16')]('%s%s',_0x2798('0x23'),path[_0x2798('0x19')](_0x24a519[_0x2798('0x1a')])));}})});router['post']('/:id/favicon',upload[_0x2798('0x1d')](_0x2798('0x1e')),controller[_0x2798('0x24')]);router[_0x2798('0x25')](_0x2798('0xa'),auth['isAuthenticated'](),controller[_0x2798('0x26')]);module[_0x2798('0x27')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 728d54a..7325cec 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 _0x5f2f=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','alternate','UNSIGNED','sequelize','exports'];(function(_0xb667fe,_0x5d5d3b){var _0x24f49b=function(_0x41dd3d){while(--_0x41dd3d){_0xb667fe['push'](_0xb667fe['shift']());}};_0x24f49b(++_0x5d5d3b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x38866d,_0x250fd6){_0x38866d=_0x38866d-0x0;var _0x262316=_0x5f2f[_0x38866d];return _0x262316;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'min_internal':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf5f2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf5f2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf5f2('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnusername':{'type':Sequelize[_0xf5f2('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xf5f2('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':_0xf5f2('0x7')},'chatTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf5f2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'transcribeRegion':{'type':Sequelize[_0xf5f2('0x5')]},'sentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'sentimentRegion':{'type':Sequelize[_0xf5f2('0x5')]},'language':{'type':Sequelize[_0xf5f2('0x5')]},'bucket':{'type':Sequelize[_0xf5f2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xf5f2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x1261=['exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED'];(function(_0x39dd10,_0x134622){var _0x35bd8a=function(_0x156710){while(--_0x156710){_0x39dd10['push'](_0x39dd10['shift']());}};_0x35bd8a(++_0x134622);}(_0x1261,0x144));var _0x1126=function(_0x58e92d,_0x1181bd){_0x58e92d=_0x58e92d-0x0;var _0x45d179=_0x1261[_0x58e92d];return _0x45d179;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'min_internal':{'type':Sequelize[_0x1126('0x1')](0xb),'unique':_0x1126('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x1126('0x1')](0xb),'unique':_0x1126('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x1126('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x1126('0x4')],'defaultValue':_0x1126('0x5')},'logo':{'type':Sequelize[_0x1126('0x4')]},'defaultLogo':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x1126('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x1126('0x4')]},'turnaddr':{'type':Sequelize[_0x1126('0x4')]},'turnusername':{'type':Sequelize[_0x1126('0x4')]},'turnpassword':{'type':Sequelize[_0x1126('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x1126('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x1126('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x1126('0x4')],'defaultValue':_0x1126('0x7')},'chatTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x1126('0x4')]},'defaultPreferred':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x1126('0x4')]},'defaultFavicon':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x1126('0x1')]},'transcribeRegion':{'type':Sequelize[_0x1126('0x4')]},'sentiment':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x1126('0x1')]},'sentimentRegion':{'type':Sequelize[_0x1126('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x1126('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x1126('0x1')](0x2)[_0x1126('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x1126('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 8492595..6fd9af1 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 _0x4812=['securePassword','addPreferred','getPreferred','defaultLogo','default_preferred.png','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','reject','destroy','stack','name','send','index','map','Setting','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','length','find','update','body','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','logo','preferred','favicon','defaultLoginLogo','defaultPreferred','existsSync','join','toLower','root','default','custom','default_logo.svg','Sequelize','ValidationError','getLogoLogin','getLicense','defaultFavicon','upperFirst','default_loginLogo.svg','\x20not\x20found','download','gdpr'];(function(_0xbd09c6,_0x433eed){var _0x3bf671=function(_0x2bab9f){while(--_0x2bab9f){_0xbd09c6['push'](_0xbd09c6['shift']());}};_0x3bf671(++_0x433eed);}(_0x4812,0x10a));var _0x2481=function(_0x10e5b2,_0x4c3fb6){_0x10e5b2=_0x10e5b2-0x0;var _0x3bef6a=_0x4812[_0x10e5b2];return _0x3bef6a;};'use strict';var emlformat=require(_0x2481('0x0'));var rimraf=require(_0x2481('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2481('0x2'));var rp=require(_0x2481('0x3'));var moment=require(_0x2481('0x4'));var BPromise=require(_0x2481('0x5'));var Mustache=require('mustache');var util=require(_0x2481('0x6'));var path=require('path');var sox=require(_0x2481('0x7'));var csv=require('to-csv');var ejs=require(_0x2481('0x8'));var fs=require('fs');var fs_extra=require(_0x2481('0x9'));var _=require(_0x2481('0xa'));var squel=require(_0x2481('0xb'));var crypto=require(_0x2481('0xc'));var jsforce=require(_0x2481('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2481('0xe'));var Papa=require(_0x2481('0xf'));var Redis=require(_0x2481('0x10'));var authService=require(_0x2481('0x11'));var qs=require(_0x2481('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2481('0x13'));var logger=require(_0x2481('0x14'))(_0x2481('0x15'));var utils=require(_0x2481('0x16'));var config=require(_0x2481('0x17'));var licenseUtil=require(_0x2481('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x2481('0x19'));var client=jayson[_0x2481('0x1a')][_0x2481('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3d490c,_0x348806,_0x2e0392,_0x3039e3){return new BPromise(function(_0x1f6499,_0x49cef0){var _0x3020d6=_0x3039e3||client;return _0x3020d6[_0x2481('0x1c')](_0x3d490c,_0x2e0392)[_0x2481('0x1d')](function(_0x29db67){logger[_0x2481('0x1e')]('Setting,\x20%s,\x20%s',_0x348806,_0x2481('0x1f'));logger[_0x2481('0x20')](_0x2481('0x21'),_0x348806,'request\x20sent',JSON[_0x2481('0x22')](_0x29db67));if(_0x29db67['error']){if(_0x29db67[_0x2481('0x23')][_0x2481('0x24')]===0x1f4){logger[_0x2481('0x23')](_0x2481('0x25'),_0x348806,_0x29db67[_0x2481('0x23')][_0x2481('0x26')]);return _0x49cef0(_0x29db67[_0x2481('0x23')]['message']);}logger[_0x2481('0x23')](_0x2481('0x25'),_0x348806,_0x29db67['error'][_0x2481('0x26')]);return _0x1f6499(_0x29db67[_0x2481('0x23')][_0x2481('0x26')]);}else{logger['info'](_0x2481('0x25'),_0x348806,_0x2481('0x1f'));_0x1f6499(_0x29db67[_0x2481('0x27')][_0x2481('0x26')]);}})[_0x2481('0x28')](function(_0x12f9fb){logger[_0x2481('0x23')](_0x2481('0x25'),_0x348806,_0x12f9fb);_0x49cef0(_0x12f9fb);});});}function respondWithStatusCode(_0x589603,_0x19aff5){_0x19aff5=_0x19aff5||0xcc;return function(_0x646000){if(_0x646000){return _0x589603[_0x2481('0x29')](_0x19aff5);}return _0x589603[_0x2481('0x2a')](_0x19aff5)['end']();};}function respondWithResult(_0x32f88c,_0x2c9fa5){_0x2c9fa5=_0x2c9fa5||0xc8;return function(_0x402881){if(_0x402881){return _0x32f88c[_0x2481('0x2a')](_0x2c9fa5)[_0x2481('0x2b')](_0x402881);}};}function respondWithFilteredResult(_0x428255,_0x1fbdf1){return function(_0x20849b){if(_0x20849b){var _0x5dde90=typeof _0x1fbdf1['offset']===_0x2481('0x2c')&&typeof _0x1fbdf1[_0x2481('0x2d')]===_0x2481('0x2c');var _0x54fd93=_0x20849b[_0x2481('0x2e')];var _0x896a69=_0x5dde90?0x0:_0x1fbdf1['offset'];var _0x26a651=_0x5dde90?_0x20849b[_0x2481('0x2e')]:_0x1fbdf1['offset']+_0x1fbdf1[_0x2481('0x2d')];var _0xd87f0f;if(_0x26a651>=_0x54fd93){_0x26a651=_0x54fd93;_0xd87f0f=0xc8;}else{_0xd87f0f=0xce;}_0x428255['status'](_0xd87f0f);return _0x428255[_0x2481('0x2f')](_0x2481('0x30'),_0x896a69+'-'+_0x26a651+'/'+_0x54fd93)['json'](_0x20849b);}return null;};}function patchUpdates(_0x16ba78){return function(_0x26dc53){try{jsonpatch[_0x2481('0x31')](_0x26dc53,_0x16ba78,!![]);}catch(_0x8e9ed0){return BPromise[_0x2481('0x32')](_0x8e9ed0);}return _0x26dc53['save']();};}function saveUpdates(_0x1ab6f0,_0x3f6579){return function(_0x527df3){if(_0x527df3){return _0x527df3['update'](_0x1ab6f0)[_0x2481('0x1d')](function(_0x1281b8){return _0x1281b8;});}return null;};}function removeEntity(_0x142e72,_0x4b8308){return function(_0xaf5fc9){if(_0xaf5fc9){return _0xaf5fc9[_0x2481('0x33')]()[_0x2481('0x1d')](function(){_0x142e72[_0x2481('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x274f68,_0xed679c){return function(_0x184b97){if(!_0x184b97){_0x274f68[_0x2481('0x29')](0x194);}return _0x184b97;};}function handleError(_0x2745e7,_0x3ae7ce){_0x3ae7ce=_0x3ae7ce||0x1f4;return function(_0x3d123b){logger[_0x2481('0x23')](_0x3d123b[_0x2481('0x34')]);if(_0x3d123b[_0x2481('0x35')]){delete _0x3d123b[_0x2481('0x35')];}_0x2745e7[_0x2481('0x2a')](_0x3ae7ce)[_0x2481('0x36')](_0x3d123b);};}exports[_0x2481('0x37')]=function(_0x263eb4,_0x4abe1d){var _0x21b9f6={},_0x3e0ef4={},_0x260834={'count':0x0,'rows':[]};var _0x1a4ded=_[_0x2481('0x38')](db[_0x2481('0x39')][_0x2481('0x3a')],function(_0x21ec13){return{'name':_0x21ec13['fieldName'],'type':_0x21ec13[_0x2481('0x3b')][_0x2481('0x3c')]};});_0x3e0ef4[_0x2481('0x3d')]=_[_0x2481('0x38')](_0x1a4ded,_0x2481('0x35'));_0x3e0ef4['query']=_[_0x2481('0x3e')](_0x263eb4[_0x2481('0x3f')]);_0x3e0ef4['filters']=_[_0x2481('0x40')](_0x3e0ef4['model'],_0x3e0ef4[_0x2481('0x3f')]);_0x21b9f6[_0x2481('0x41')]=_[_0x2481('0x40')](_0x3e0ef4[_0x2481('0x3d')],qs[_0x2481('0x42')](_0x263eb4[_0x2481('0x3f')][_0x2481('0x42')]));_0x21b9f6['attributes']=_0x21b9f6[_0x2481('0x41')]['length']?_0x21b9f6[_0x2481('0x41')]:_0x3e0ef4[_0x2481('0x3d')];if(!_0x263eb4[_0x2481('0x3f')][_0x2481('0x43')](_0x2481('0x44'))){_0x21b9f6[_0x2481('0x2d')]=qs['limit'](_0x263eb4[_0x2481('0x3f')][_0x2481('0x2d')]);_0x21b9f6['offset']=qs[_0x2481('0x45')](_0x263eb4[_0x2481('0x3f')]['offset']);}_0x21b9f6['order']=qs[_0x2481('0x46')](_0x263eb4[_0x2481('0x3f')]['sort']);_0x21b9f6[_0x2481('0x47')]=qs[_0x2481('0x48')](_[_0x2481('0x49')](_0x263eb4[_0x2481('0x3f')],_0x3e0ef4[_0x2481('0x48')]),_0x1a4ded);if(_0x263eb4[_0x2481('0x3f')][_0x2481('0x4a')]){_0x21b9f6[_0x2481('0x47')]=_['merge'](_0x21b9f6['where'],{'$or':_[_0x2481('0x38')](_0x1a4ded,function(_0x43d7b0){if(_0x43d7b0[_0x2481('0x3b')]!==_0x2481('0x4b')){var _0x3482d0={};_0x3482d0[_0x43d7b0['name']]={'$like':'%'+_0x263eb4[_0x2481('0x3f')][_0x2481('0x4a')]+'%'};return _0x3482d0;}})});}_0x21b9f6=_[_0x2481('0x4c')]({},_0x21b9f6,_0x263eb4[_0x2481('0x4d')]);var _0x4395a9={'where':_0x21b9f6[_0x2481('0x47')]};return db[_0x2481('0x39')][_0x2481('0x2e')](_0x4395a9)[_0x2481('0x1d')](function(_0xf0f32c){_0x260834['count']=_0xf0f32c;if(_0x263eb4[_0x2481('0x3f')][_0x2481('0x4e')]){_0x21b9f6[_0x2481('0x4f')]=[{'all':!![]}];}return db['Setting'][_0x2481('0x50')](_0x21b9f6);})[_0x2481('0x1d')](function(_0xc18c9e){_0x260834['rows']=_0xc18c9e;return _0x260834;})[_0x2481('0x1d')](respondWithFilteredResult(_0x4abe1d,_0x21b9f6))[_0x2481('0x28')](handleError(_0x4abe1d,null));};exports[_0x2481('0x51')]=function(_0x4442ec,_0x37133f){var _0x597c13={'raw':![],'where':{'id':_0x4442ec[_0x2481('0x52')]['id']}},_0x418d91={};_0x418d91[_0x2481('0x3d')]=_[_0x2481('0x3e')](db[_0x2481('0x39')][_0x2481('0x3a')]);_0x418d91['query']=_[_0x2481('0x3e')](_0x4442ec['query']);_0x418d91[_0x2481('0x48')]=_[_0x2481('0x40')](_0x418d91['model'],_0x418d91[_0x2481('0x3f')]);_0x597c13[_0x2481('0x41')]=_['intersection'](_0x418d91[_0x2481('0x3d')],qs['fields'](_0x4442ec[_0x2481('0x3f')]['fields']));_0x597c13['attributes']=_0x597c13[_0x2481('0x41')][_0x2481('0x53')]?_0x597c13[_0x2481('0x41')]:_0x418d91[_0x2481('0x3d')];if(_0x4442ec[_0x2481('0x3f')]['includeAll']){_0x597c13[_0x2481('0x4f')]=[{'all':!![]}];}_0x597c13=_['merge']({},_0x597c13,_0x4442ec[_0x2481('0x4d')]);return db[_0x2481('0x39')][_0x2481('0x54')](_0x597c13)[_0x2481('0x1d')](handleEntityNotFound(_0x37133f,null))[_0x2481('0x1d')](respondWithResult(_0x37133f,null))[_0x2481('0x28')](handleError(_0x37133f,null));};exports[_0x2481('0x55')]=function(_0x46a149,_0x3f9242){if(_0x46a149[_0x2481('0x56')]['id']){delete _0x46a149['body']['id'];}return db[_0x2481('0x39')][_0x2481('0x54')]({'where':{'id':_0x46a149[_0x2481('0x52')]['id']}})[_0x2481('0x1d')](handleEntityNotFound(_0x3f9242,null))[_0x2481('0x1d')](saveUpdates(_0x46a149[_0x2481('0x56')],null))['then'](respondWithResult(_0x3f9242,null))[_0x2481('0x28')](handleError(_0x3f9242,null));};exports['addLogo']=function(_0xa2327a,_0x58c722,_0x1e9937){if(_0xa2327a[_0x2481('0x57')]&&_0xa2327a[_0x2481('0x57')][_0x2481('0x58')]){_0xa2327a[_0x2481('0x56')]['logo']=_0xa2327a[_0x2481('0x57')][_0x2481('0x58')];}return db['Setting'][_0x2481('0x54')]({'where':{'id':_0xa2327a[_0x2481('0x52')]['id']}})[_0x2481('0x1d')](handleEntityNotFound(_0x58c722,null))[_0x2481('0x1d')](saveUpdates(_0xa2327a[_0x2481('0x56')],null))[_0x2481('0x1d')](respondWithResult(_0x58c722,null))[_0x2481('0x28')](handleError(_0x58c722,null));};exports[_0x2481('0x59')]=function(_0x591746,_0x1294f6,_0x206b4b){if(_0x591746[_0x2481('0x57')]&&_0x591746[_0x2481('0x57')][_0x2481('0x58')]){_0x591746[_0x2481('0x56')][_0x2481('0x5a')]=_0x591746[_0x2481('0x57')][_0x2481('0x58')];}return db[_0x2481('0x39')][_0x2481('0x54')]({'where':{'id':_0x591746[_0x2481('0x52')]['id']}})[_0x2481('0x1d')](handleEntityNotFound(_0x1294f6,null))['then'](saveUpdates(_0x591746[_0x2481('0x56')],null))[_0x2481('0x1d')](respondWithResult(_0x1294f6,null))[_0x2481('0x28')](handleError(_0x1294f6,null));};var utilLicense=require(_0x2481('0x18'));exports[_0x2481('0x5b')]=function(_0x20a8cf,_0x29575f,_0x52a327){var _0x1a45e6=_0x2481('0x5c');var _0x3a38e0={'custom':![]};return utilLicense['getLicense']()[_0x2481('0x1d')](function(_0x153a30){if(_0x153a30){_0x3a38e0=_0x153a30;}return db[_0x2481('0x39')]['find']({'where':{'id':_0x20a8cf[_0x2481('0x52')]['id']},'attributes':[_0x2481('0x5d'),_0x2481('0x5a'),_0x2481('0x5e'),_0x2481('0x5f'),'defaultLogo',_0x2481('0x60'),_0x2481('0x61'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x29575f,null))[_0x2481('0x1d')](function(_0x5b4936){if(_0x5b4936){var _0x5b96da=_0x5b4936[_0x2481('0x5d')]&&fs[_0x2481('0x62')](path[_0x2481('0x63')](config['root'],_0x1a45e6,_[_0x2481('0x64')](_0x5b4936[_0x2481('0x5d')])))?path['join'](config[_0x2481('0x65')],_0x1a45e6,_[_0x2481('0x64')](_0x5b4936[_0x2481('0x5d')])):path[_0x2481('0x63')](config['root'],_0x1a45e6,_[_0x2481('0x64')]('default_logo.svg'));var _0x47cc76=_0x2481('0x66')+_['upperFirst'](_0x2481('0x5d'));if(_0x5b4936[_0x47cc76]||!_0x3a38e0[_0x2481('0x67')]){_0x5b96da=path[_0x2481('0x63')](config[_0x2481('0x65')],_0x1a45e6,_[_0x2481('0x64')](_0x2481('0x68')));}if(!fs[_0x2481('0x62')](_0x5b96da)){throw new db[(_0x2481('0x69'))][(_0x2481('0x6a'))](_['upperFirst'](_0x2481('0x5d'))+'\x20not\x20found');}return _0x29575f['download'](_0x5b96da);}})[_0x2481('0x28')](handleError(_0x29575f,null));};var utilLicense=require(_0x2481('0x18'));exports[_0x2481('0x6b')]=function(_0x598365,_0x22b84c,_0x5617af){var _0x3ad623=_0x2481('0x5c');var _0x33409c={'custom':![]};return utilLicense[_0x2481('0x6c')]()[_0x2481('0x1d')](function(_0x3ba660){if(_0x3ba660){_0x33409c=_0x3ba660;}return db[_0x2481('0x39')]['find']({'where':{'id':_0x598365[_0x2481('0x52')]['id']},'attributes':['logo','loginLogo',_0x2481('0x5e'),_0x2481('0x5f'),'defaultLogo',_0x2481('0x60'),_0x2481('0x61'),_0x2481('0x6d')],'raw':!![]});})[_0x2481('0x1d')](handleEntityNotFound(_0x22b84c,null))[_0x2481('0x1d')](function(_0x3d1a60){if(_0x3d1a60){var _0xe34365=_0x3d1a60[_0x2481('0x5a')]&&fs[_0x2481('0x62')](path[_0x2481('0x63')](config[_0x2481('0x65')],_0x3ad623,_[_0x2481('0x64')](_0x3d1a60[_0x2481('0x5a')])))?path[_0x2481('0x63')](config[_0x2481('0x65')],_0x3ad623,_[_0x2481('0x64')](_0x3d1a60['loginLogo'])):path[_0x2481('0x63')](config[_0x2481('0x65')],_0x3ad623,_[_0x2481('0x64')]('default_loginLogo.svg'));var _0x1971e2='default'+_[_0x2481('0x6e')](_0x2481('0x5a'));if(_0x3d1a60[_0x1971e2]||!_0x33409c[_0x2481('0x67')]){_0xe34365=path['join'](config[_0x2481('0x65')],_0x3ad623,_[_0x2481('0x64')](_0x2481('0x6f')));}if(!fs[_0x2481('0x62')](_0xe34365)){throw new db[(_0x2481('0x69'))][(_0x2481('0x6a'))](_['upperFirst'](_0x2481('0x5a'))+_0x2481('0x70'));}return _0x22b84c[_0x2481('0x71')](_0xe34365);}})['catch'](handleError(_0x22b84c,null));};exports[_0x2481('0x72')]=function(_0x18f914,_0x2d9a9c){return db['Setting'][_0x2481('0x54')]({'where':{'id':_0x18f914['params']['id']},'attributes':[_0x2481('0x73')]})[_0x2481('0x1d')](respondWithResult(_0x2d9a9c,null))[_0x2481('0x28')](handleError(_0x2d9a9c,null));};exports[_0x2481('0x74')]=function(_0x488cb3,_0x590fa7,_0x174baa){if(_0x488cb3[_0x2481('0x57')]&&_0x488cb3[_0x2481('0x57')][_0x2481('0x58')]){_0x488cb3[_0x2481('0x56')][_0x2481('0x5e')]=_0x488cb3[_0x2481('0x57')][_0x2481('0x58')];}return db['Setting'][_0x2481('0x54')]({'where':{'id':_0x488cb3[_0x2481('0x52')]['id']}})[_0x2481('0x1d')](handleEntityNotFound(_0x590fa7,null))['then'](saveUpdates(_0x488cb3[_0x2481('0x56')],null))[_0x2481('0x1d')](respondWithResult(_0x590fa7,null))[_0x2481('0x28')](handleError(_0x590fa7,null));};var utilLicense=require(_0x2481('0x18'));exports[_0x2481('0x75')]=function(_0x5d9fcf,_0x19ad5a,_0x3e0d8f){var _0x8c81ef=_0x2481('0x5c');var _0x8c2425={'custom':![]};return utilLicense[_0x2481('0x6c')]()['then'](function(_0x2c2e5c){if(_0x2c2e5c){_0x8c2425=_0x2c2e5c;}return db[_0x2481('0x39')][_0x2481('0x54')]({'where':{'id':_0x5d9fcf[_0x2481('0x52')]['id']},'attributes':[_0x2481('0x5d'),_0x2481('0x5a'),_0x2481('0x5e'),'favicon',_0x2481('0x76'),_0x2481('0x60'),_0x2481('0x61'),_0x2481('0x6d')],'raw':!![]});})[_0x2481('0x1d')](handleEntityNotFound(_0x19ad5a,null))[_0x2481('0x1d')](function(_0x31fc99){if(_0x31fc99){var _0xa3482=_0x31fc99[_0x2481('0x5e')]&&fs[_0x2481('0x62')](path[_0x2481('0x63')](config[_0x2481('0x65')],_0x8c81ef,_[_0x2481('0x64')](_0x31fc99[_0x2481('0x5e')])))?path['join'](config[_0x2481('0x65')],_0x8c81ef,_['toLower'](_0x31fc99[_0x2481('0x5e')])):path[_0x2481('0x63')](config[_0x2481('0x65')],_0x8c81ef,_[_0x2481('0x64')](_0x2481('0x77')));var _0x3c6c25=_0x2481('0x66')+_['upperFirst'](_0x2481('0x5e'));if(_0x31fc99[_0x3c6c25]||!_0x8c2425[_0x2481('0x67')]||!_0x8c2425[_0x2481('0x5e')]){_0xa3482=path[_0x2481('0x63')](config['root'],_0x8c81ef,_['toLower']('default_preferred.png'));}if(!fs['existsSync'](_0xa3482)){throw new db[(_0x2481('0x69'))][(_0x2481('0x6a'))](_[_0x2481('0x6e')](_0x2481('0x5e'))+_0x2481('0x70'));}return _0x19ad5a[_0x2481('0x71')](_0xa3482);}})[_0x2481('0x28')](handleError(_0x19ad5a,null));};exports['addFavicon']=function(_0x2e42f9,_0x5a2566,_0x87719a){if(_0x2e42f9[_0x2481('0x57')]&&_0x2e42f9[_0x2481('0x57')][_0x2481('0x58')]){_0x2e42f9[_0x2481('0x56')][_0x2481('0x5f')]=_0x2e42f9[_0x2481('0x57')][_0x2481('0x58')];}return db[_0x2481('0x39')][_0x2481('0x54')]({'where':{'id':_0x2e42f9['params']['id']}})[_0x2481('0x1d')](handleEntityNotFound(_0x5a2566,null))[_0x2481('0x1d')](saveUpdates(_0x2e42f9[_0x2481('0x56')],null))[_0x2481('0x1d')](respondWithResult(_0x5a2566,null))['catch'](handleError(_0x5a2566,null));};var utilLicense=require('../../config/license/util');exports[_0x2481('0x78')]=function(_0x589b8e,_0x11c189,_0x49ceca){var _0x16e050=_0x2481('0x5c');var _0x8f49a2={'custom':![]};return utilLicense['getLicense']()[_0x2481('0x1d')](function(_0x48c330){if(_0x48c330){_0x8f49a2=_0x48c330;}return db['Setting'][_0x2481('0x54')]({'where':{'id':_0x589b8e[_0x2481('0x52')]['id']},'attributes':[_0x2481('0x5d'),_0x2481('0x5a'),_0x2481('0x5e'),_0x2481('0x5f'),_0x2481('0x76'),_0x2481('0x60'),_0x2481('0x61'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x11c189,null))['then'](function(_0x48d98a){if(_0x48d98a){var _0x42e0f7=_0x48d98a[_0x2481('0x5f')]&&fs['existsSync'](path[_0x2481('0x63')](config[_0x2481('0x65')],_0x16e050,_['toLower'](_0x48d98a[_0x2481('0x5f')])))?path[_0x2481('0x63')](config[_0x2481('0x65')],_0x16e050,_[_0x2481('0x64')](_0x48d98a[_0x2481('0x5f')])):path[_0x2481('0x63')](config['root'],_0x16e050,_[_0x2481('0x64')](_0x2481('0x79')));var _0x4be727=_0x2481('0x66')+_['upperFirst'](_0x2481('0x5f'));if(_0x48d98a[_0x4be727]||!_0x8f49a2[_0x2481('0x67')]){_0x42e0f7=path[_0x2481('0x63')](config['root'],_0x16e050,_[_0x2481('0x64')](_0x2481('0x79')));}if(!fs['existsSync'](_0x42e0f7)){throw new db[(_0x2481('0x69'))][(_0x2481('0x6a'))](_[_0x2481('0x6e')]('favicon')+'\x20not\x20found');}return _0x11c189[_0x2481('0x71')](_0x42e0f7);}})[_0x2481('0x28')](handleError(_0x11c189,null));};exports[_0x2481('0x7a')]=function(_0x176cbe,_0x38e6fc){var _0x447203={'offset':moment()[_0x2481('0x7b')]()};_0x447203[_0x2481('0x7c')]=moment()['utcOffset'](_0x447203[_0x2481('0x45')])[_0x2481('0x7d')](_0x2481('0x7e'));return _0x38e6fc[_0x2481('0x2a')](0xc8)[_0x2481('0x36')](_0x447203);}; \ No newline at end of file +var _0xccef=['getPreferred','default_preferred.png','favicon','getFavicon','default_favicon.ico','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','stack','name','index','Setting','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','include','findAll','rows','show','params','rawAttributes','includeAll','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','defaultLoginLogo','defaultPreferred','join','root','toLower','default','upperFirst','custom','default_logo.svg','existsSync','Sequelize','ValidationError','\x20not\x20found','../../config/license/util','getLogoLogin','defaultLogo','defaultFavicon','default_loginLogo.svg','download','gdpr','securePassword'];(function(_0x7e5ffa,_0x1c45d4){var _0x624d47=function(_0x3e5bf2){while(--_0x3e5bf2){_0x7e5ffa['push'](_0x7e5ffa['shift']());}};_0x624d47(++_0x1c45d4);}(_0xccef,0x1ee));var _0xfcce=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xccef[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfcce('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfcce('0x1'));var rp=require(_0xfcce('0x2'));var moment=require('moment');var BPromise=require(_0xfcce('0x3'));var Mustache=require(_0xfcce('0x4'));var util=require(_0xfcce('0x5'));var path=require('path');var sox=require(_0xfcce('0x6'));var csv=require(_0xfcce('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcce('0x8'));var _=require(_0xfcce('0x9'));var squel=require('squel');var crypto=require(_0xfcce('0xa'));var jsforce=require(_0xfcce('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfcce('0xc'));var Papa=require(_0xfcce('0xd'));var Redis=require(_0xfcce('0xe'));var authService=require(_0xfcce('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfcce('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfcce('0x11'))(_0xfcce('0x12'));var utils=require('../../config/utils');var config=require(_0xfcce('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xfcce('0x14'))['db'];var jayson=require(_0xfcce('0x15'));var client=jayson[_0xfcce('0x16')][_0xfcce('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x526238,_0x30529c,_0x2281ad,_0x16aa15){return new BPromise(function(_0x408b95,_0x5dfb69){var _0x5ba45b=_0x16aa15||client;return _0x5ba45b[_0xfcce('0x18')](_0x526238,_0x2281ad)[_0xfcce('0x19')](function(_0x4c5f3d){logger[_0xfcce('0x1a')](_0xfcce('0x1b'),_0x30529c,'request\x20sent');logger[_0xfcce('0x1c')]('Setting,\x20%s,\x20%s,\x20%s',_0x30529c,_0xfcce('0x1d'),JSON[_0xfcce('0x1e')](_0x4c5f3d));if(_0x4c5f3d['error']){if(_0x4c5f3d[_0xfcce('0x1f')][_0xfcce('0x20')]===0x1f4){logger[_0xfcce('0x1f')](_0xfcce('0x1b'),_0x30529c,_0x4c5f3d[_0xfcce('0x1f')]['message']);return _0x5dfb69(_0x4c5f3d[_0xfcce('0x1f')][_0xfcce('0x21')]);}logger[_0xfcce('0x1f')](_0xfcce('0x1b'),_0x30529c,_0x4c5f3d[_0xfcce('0x1f')][_0xfcce('0x21')]);return _0x408b95(_0x4c5f3d[_0xfcce('0x1f')][_0xfcce('0x21')]);}else{logger['info'](_0xfcce('0x1b'),_0x30529c,_0xfcce('0x1d'));_0x408b95(_0x4c5f3d[_0xfcce('0x22')][_0xfcce('0x21')]);}})[_0xfcce('0x23')](function(_0xde5a7f){logger[_0xfcce('0x1f')](_0xfcce('0x1b'),_0x30529c,_0xde5a7f);_0x5dfb69(_0xde5a7f);});});}function respondWithStatusCode(_0x3ebc8f,_0x487fcc){_0x487fcc=_0x487fcc||0xcc;return function(_0x517fa0){if(_0x517fa0){return _0x3ebc8f[_0xfcce('0x24')](_0x487fcc);}return _0x3ebc8f[_0xfcce('0x25')](_0x487fcc)[_0xfcce('0x26')]();};}function respondWithResult(_0x4b2b93,_0x34c8c9){_0x34c8c9=_0x34c8c9||0xc8;return function(_0x5ad980){if(_0x5ad980){return _0x4b2b93[_0xfcce('0x25')](_0x34c8c9)[_0xfcce('0x27')](_0x5ad980);}};}function respondWithFilteredResult(_0x36797e,_0x23c93c){return function(_0x5af1c8){if(_0x5af1c8){var _0x27dcc4=typeof _0x23c93c[_0xfcce('0x28')]===_0xfcce('0x29')&&typeof _0x23c93c[_0xfcce('0x2a')]==='undefined';var _0x14d074=_0x5af1c8['count'];var _0x44f82a=_0x27dcc4?0x0:_0x23c93c[_0xfcce('0x28')];var _0x40716c=_0x27dcc4?_0x5af1c8[_0xfcce('0x2b')]:_0x23c93c[_0xfcce('0x28')]+_0x23c93c['limit'];var _0x3b4b2c;if(_0x40716c>=_0x14d074){_0x40716c=_0x14d074;_0x3b4b2c=0xc8;}else{_0x3b4b2c=0xce;}_0x36797e[_0xfcce('0x25')](_0x3b4b2c);return _0x36797e[_0xfcce('0x2c')]('Content-Range',_0x44f82a+'-'+_0x40716c+'/'+_0x14d074)[_0xfcce('0x27')](_0x5af1c8);}return null;};}function patchUpdates(_0x12933f){return function(_0x296836){try{jsonpatch['apply'](_0x296836,_0x12933f,!![]);}catch(_0x590ffa){return BPromise[_0xfcce('0x2d')](_0x590ffa);}return _0x296836[_0xfcce('0x2e')]();};}function saveUpdates(_0xc76958,_0x1c79e1){return function(_0x5bec9d){if(_0x5bec9d){return _0x5bec9d[_0xfcce('0x2f')](_0xc76958)[_0xfcce('0x19')](function(_0x4974ab){return _0x4974ab;});}return null;};}function removeEntity(_0x2ac161,_0x431e4a){return function(_0x48b46f){if(_0x48b46f){return _0x48b46f[_0xfcce('0x30')]()[_0xfcce('0x19')](function(){_0x2ac161[_0xfcce('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x162432,_0x304d60){return function(_0x49ed79){if(!_0x49ed79){_0x162432[_0xfcce('0x24')](0x194);}return _0x49ed79;};}function handleError(_0xd981e2,_0x515417){_0x515417=_0x515417||0x1f4;return function(_0x329cf0){logger[_0xfcce('0x1f')](_0x329cf0[_0xfcce('0x31')]);if(_0x329cf0[_0xfcce('0x32')]){delete _0x329cf0[_0xfcce('0x32')];}_0xd981e2[_0xfcce('0x25')](_0x515417)['send'](_0x329cf0);};}exports[_0xfcce('0x33')]=function(_0xe9fe35,_0x53d468){var _0x40e2da={},_0x2f1dff={},_0x3f2427={'count':0x0,'rows':[]};var _0x2652da=_['map'](db[_0xfcce('0x34')]['rawAttributes'],function(_0x2539af){return{'name':_0x2539af[_0xfcce('0x35')],'type':_0x2539af[_0xfcce('0x36')][_0xfcce('0x37')]};});_0x2f1dff[_0xfcce('0x38')]=_[_0xfcce('0x39')](_0x2652da,'name');_0x2f1dff['query']=_[_0xfcce('0x3a')](_0xe9fe35['query']);_0x2f1dff[_0xfcce('0x3b')]=_[_0xfcce('0x3c')](_0x2f1dff['model'],_0x2f1dff['query']);_0x40e2da[_0xfcce('0x3d')]=_['intersection'](_0x2f1dff['model'],qs[_0xfcce('0x3e')](_0xe9fe35[_0xfcce('0x3f')][_0xfcce('0x3e')]));_0x40e2da[_0xfcce('0x3d')]=_0x40e2da['attributes'][_0xfcce('0x40')]?_0x40e2da[_0xfcce('0x3d')]:_0x2f1dff['model'];if(!_0xe9fe35['query'][_0xfcce('0x41')]('nolimit')){_0x40e2da[_0xfcce('0x2a')]=qs['limit'](_0xe9fe35['query']['limit']);_0x40e2da[_0xfcce('0x28')]=qs[_0xfcce('0x28')](_0xe9fe35[_0xfcce('0x3f')][_0xfcce('0x28')]);}_0x40e2da[_0xfcce('0x42')]=qs['sort'](_0xe9fe35[_0xfcce('0x3f')]['sort']);_0x40e2da[_0xfcce('0x43')]=qs['filters'](_['pick'](_0xe9fe35[_0xfcce('0x3f')],_0x2f1dff[_0xfcce('0x3b')]),_0x2652da);if(_0xe9fe35[_0xfcce('0x3f')][_0xfcce('0x44')]){_0x40e2da['where']=_[_0xfcce('0x45')](_0x40e2da[_0xfcce('0x43')],{'$or':_[_0xfcce('0x39')](_0x2652da,function(_0x168e83){if(_0x168e83[_0xfcce('0x36')]!==_0xfcce('0x46')){var _0xec6778={};_0xec6778[_0x168e83[_0xfcce('0x32')]]={'$like':'%'+_0xe9fe35[_0xfcce('0x3f')][_0xfcce('0x44')]+'%'};return _0xec6778;}})});}_0x40e2da=_[_0xfcce('0x45')]({},_0x40e2da,_0xe9fe35['options']);var _0xb22152={'where':_0x40e2da[_0xfcce('0x43')]};return db[_0xfcce('0x34')][_0xfcce('0x2b')](_0xb22152)['then'](function(_0x4c57ee){_0x3f2427[_0xfcce('0x2b')]=_0x4c57ee;if(_0xe9fe35[_0xfcce('0x3f')]['includeAll']){_0x40e2da[_0xfcce('0x47')]=[{'all':!![]}];}return db[_0xfcce('0x34')][_0xfcce('0x48')](_0x40e2da);})[_0xfcce('0x19')](function(_0x7361d9){_0x3f2427[_0xfcce('0x49')]=_0x7361d9;return _0x3f2427;})['then'](respondWithFilteredResult(_0x53d468,_0x40e2da))[_0xfcce('0x23')](handleError(_0x53d468,null));};exports[_0xfcce('0x4a')]=function(_0x46983a,_0x1feedf){var _0x5e18f9={'raw':![],'where':{'id':_0x46983a[_0xfcce('0x4b')]['id']}},_0x5bbe8f={};_0x5bbe8f[_0xfcce('0x38')]=_[_0xfcce('0x3a')](db['Setting'][_0xfcce('0x4c')]);_0x5bbe8f[_0xfcce('0x3f')]=_[_0xfcce('0x3a')](_0x46983a['query']);_0x5bbe8f[_0xfcce('0x3b')]=_[_0xfcce('0x3c')](_0x5bbe8f[_0xfcce('0x38')],_0x5bbe8f[_0xfcce('0x3f')]);_0x5e18f9['attributes']=_['intersection'](_0x5bbe8f[_0xfcce('0x38')],qs[_0xfcce('0x3e')](_0x46983a[_0xfcce('0x3f')][_0xfcce('0x3e')]));_0x5e18f9[_0xfcce('0x3d')]=_0x5e18f9['attributes'][_0xfcce('0x40')]?_0x5e18f9[_0xfcce('0x3d')]:_0x5bbe8f['model'];if(_0x46983a[_0xfcce('0x3f')][_0xfcce('0x4d')]){_0x5e18f9['include']=[{'all':!![]}];}_0x5e18f9=_[_0xfcce('0x45')]({},_0x5e18f9,_0x46983a['options']);return db[_0xfcce('0x34')][_0xfcce('0x4e')](_0x5e18f9)['then'](handleEntityNotFound(_0x1feedf,null))[_0xfcce('0x19')](respondWithResult(_0x1feedf,null))[_0xfcce('0x23')](handleError(_0x1feedf,null));};exports[_0xfcce('0x2f')]=function(_0x16aba7,_0x5a8c3e){if(_0x16aba7[_0xfcce('0x4f')]['id']){delete _0x16aba7[_0xfcce('0x4f')]['id'];}return db[_0xfcce('0x34')][_0xfcce('0x4e')]({'where':{'id':_0x16aba7['params']['id']}})[_0xfcce('0x19')](handleEntityNotFound(_0x5a8c3e,null))[_0xfcce('0x19')](saveUpdates(_0x16aba7[_0xfcce('0x4f')],null))[_0xfcce('0x19')](respondWithResult(_0x5a8c3e,null))['catch'](handleError(_0x5a8c3e,null));};exports[_0xfcce('0x50')]=function(_0x57975d,_0x30200e,_0x381ee5){if(_0x57975d[_0xfcce('0x51')]&&_0x57975d[_0xfcce('0x51')][_0xfcce('0x52')]){_0x57975d[_0xfcce('0x4f')][_0xfcce('0x53')]=_0x57975d['file']['filename'];}return db[_0xfcce('0x34')][_0xfcce('0x4e')]({'where':{'id':_0x57975d[_0xfcce('0x4b')]['id']}})[_0xfcce('0x19')](handleEntityNotFound(_0x30200e,null))['then'](saveUpdates(_0x57975d[_0xfcce('0x4f')],null))[_0xfcce('0x19')](respondWithResult(_0x30200e,null))['catch'](handleError(_0x30200e,null));};exports[_0xfcce('0x54')]=function(_0x216c1d,_0x4d06f1,_0x5ab2f0){if(_0x216c1d['file']&&_0x216c1d['file'][_0xfcce('0x52')]){_0x216c1d[_0xfcce('0x4f')][_0xfcce('0x55')]=_0x216c1d[_0xfcce('0x51')]['filename'];}return db['Setting'][_0xfcce('0x4e')]({'where':{'id':_0x216c1d[_0xfcce('0x4b')]['id']}})[_0xfcce('0x19')](handleEntityNotFound(_0x4d06f1,null))[_0xfcce('0x19')](saveUpdates(_0x216c1d[_0xfcce('0x4f')],null))[_0xfcce('0x19')](respondWithResult(_0x4d06f1,null))[_0xfcce('0x23')](handleError(_0x4d06f1,null));};var utilLicense=require('../../config/license/util');exports[_0xfcce('0x56')]=function(_0x5ccdd3,_0x3ad143,_0x284252){var _0x3cc8ee=_0xfcce('0x57');var _0x53349b={'custom':![]};return utilLicense[_0xfcce('0x58')]()[_0xfcce('0x19')](function(_0x4a5ce0){if(_0x4a5ce0){_0x53349b=_0x4a5ce0;}return db[_0xfcce('0x34')]['find']({'where':{'id':_0x5ccdd3[_0xfcce('0x4b')]['id']},'attributes':[_0xfcce('0x53'),_0xfcce('0x55'),_0xfcce('0x59'),'favicon','defaultLogo',_0xfcce('0x5a'),_0xfcce('0x5b'),'defaultFavicon'],'raw':!![]});})[_0xfcce('0x19')](handleEntityNotFound(_0x3ad143,null))[_0xfcce('0x19')](function(_0x1f8770){if(_0x1f8770){var _0x1383ec=_0x1f8770[_0xfcce('0x53')]&&fs['existsSync'](path[_0xfcce('0x5c')](config[_0xfcce('0x5d')],_0x3cc8ee,_['toLower'](_0x1f8770[_0xfcce('0x53')])))?path['join'](config[_0xfcce('0x5d')],_0x3cc8ee,_[_0xfcce('0x5e')](_0x1f8770[_0xfcce('0x53')])):path[_0xfcce('0x5c')](config[_0xfcce('0x5d')],_0x3cc8ee,_[_0xfcce('0x5e')]('default_logo.svg'));var _0x42597a=_0xfcce('0x5f')+_[_0xfcce('0x60')](_0xfcce('0x53'));if(_0x1f8770[_0x42597a]||!_0x53349b[_0xfcce('0x61')]){_0x1383ec=path['join'](config[_0xfcce('0x5d')],_0x3cc8ee,_['toLower'](_0xfcce('0x62')));}if(!fs[_0xfcce('0x63')](_0x1383ec)){throw new db[(_0xfcce('0x64'))][(_0xfcce('0x65'))](_[_0xfcce('0x60')](_0xfcce('0x53'))+_0xfcce('0x66'));}return _0x3ad143['download'](_0x1383ec);}})['catch'](handleError(_0x3ad143,null));};var utilLicense=require(_0xfcce('0x67'));exports[_0xfcce('0x68')]=function(_0x2bd79b,_0x4e1b40,_0xbf3d96){var _0x69308d=_0xfcce('0x57');var _0x537590={'custom':![]};return utilLicense[_0xfcce('0x58')]()['then'](function(_0x229dbd){if(_0x229dbd){_0x537590=_0x229dbd;}return db['Setting']['find']({'where':{'id':_0x2bd79b[_0xfcce('0x4b')]['id']},'attributes':[_0xfcce('0x53'),_0xfcce('0x55'),_0xfcce('0x59'),'favicon',_0xfcce('0x69'),_0xfcce('0x5a'),_0xfcce('0x5b'),_0xfcce('0x6a')],'raw':!![]});})[_0xfcce('0x19')](handleEntityNotFound(_0x4e1b40,null))[_0xfcce('0x19')](function(_0x8ba5bd){if(_0x8ba5bd){var _0x465ed1=_0x8ba5bd['loginLogo']&&fs[_0xfcce('0x63')](path[_0xfcce('0x5c')](config[_0xfcce('0x5d')],_0x69308d,_[_0xfcce('0x5e')](_0x8ba5bd[_0xfcce('0x55')])))?path[_0xfcce('0x5c')](config['root'],_0x69308d,_[_0xfcce('0x5e')](_0x8ba5bd[_0xfcce('0x55')])):path[_0xfcce('0x5c')](config['root'],_0x69308d,_[_0xfcce('0x5e')]('default_loginLogo.svg'));var _0x217bb9=_0xfcce('0x5f')+_[_0xfcce('0x60')](_0xfcce('0x55'));if(_0x8ba5bd[_0x217bb9]||!_0x537590[_0xfcce('0x61')]){_0x465ed1=path['join'](config[_0xfcce('0x5d')],_0x69308d,_[_0xfcce('0x5e')](_0xfcce('0x6b')));}if(!fs[_0xfcce('0x63')](_0x465ed1)){throw new db[(_0xfcce('0x64'))][(_0xfcce('0x65'))](_[_0xfcce('0x60')]('loginLogo')+_0xfcce('0x66'));}return _0x4e1b40[_0xfcce('0x6c')](_0x465ed1);}})[_0xfcce('0x23')](handleError(_0x4e1b40,null));};exports[_0xfcce('0x6d')]=function(_0x5f4d97,_0xa7ff35){return db[_0xfcce('0x34')]['find']({'where':{'id':_0x5f4d97[_0xfcce('0x4b')]['id']},'attributes':[_0xfcce('0x6e')]})[_0xfcce('0x19')](respondWithResult(_0xa7ff35,null))[_0xfcce('0x23')](handleError(_0xa7ff35,null));};exports['addPreferred']=function(_0x56d9bf,_0x498329,_0x12af85){if(_0x56d9bf[_0xfcce('0x51')]&&_0x56d9bf[_0xfcce('0x51')][_0xfcce('0x52')]){_0x56d9bf['body'][_0xfcce('0x59')]=_0x56d9bf[_0xfcce('0x51')][_0xfcce('0x52')];}return db[_0xfcce('0x34')][_0xfcce('0x4e')]({'where':{'id':_0x56d9bf[_0xfcce('0x4b')]['id']}})[_0xfcce('0x19')](handleEntityNotFound(_0x498329,null))[_0xfcce('0x19')](saveUpdates(_0x56d9bf['body'],null))['then'](respondWithResult(_0x498329,null))[_0xfcce('0x23')](handleError(_0x498329,null));};var utilLicense=require(_0xfcce('0x67'));exports[_0xfcce('0x6f')]=function(_0x50470c,_0xd8d8ad,_0x15b727){var _0x5eca0d=_0xfcce('0x57');var _0x38f155={'custom':![]};return utilLicense[_0xfcce('0x58')]()[_0xfcce('0x19')](function(_0x59ed80){if(_0x59ed80){_0x38f155=_0x59ed80;}return db[_0xfcce('0x34')]['find']({'where':{'id':_0x50470c['params']['id']},'attributes':['logo',_0xfcce('0x55'),_0xfcce('0x59'),'favicon','defaultLogo',_0xfcce('0x5a'),_0xfcce('0x5b'),_0xfcce('0x6a')],'raw':!![]});})[_0xfcce('0x19')](handleEntityNotFound(_0xd8d8ad,null))[_0xfcce('0x19')](function(_0x2d6d73){if(_0x2d6d73){var _0x1e8912=_0x2d6d73[_0xfcce('0x59')]&&fs[_0xfcce('0x63')](path[_0xfcce('0x5c')](config[_0xfcce('0x5d')],_0x5eca0d,_[_0xfcce('0x5e')](_0x2d6d73[_0xfcce('0x59')])))?path[_0xfcce('0x5c')](config['root'],_0x5eca0d,_[_0xfcce('0x5e')](_0x2d6d73[_0xfcce('0x59')])):path[_0xfcce('0x5c')](config[_0xfcce('0x5d')],_0x5eca0d,_[_0xfcce('0x5e')](_0xfcce('0x70')));var _0x217976='default'+_[_0xfcce('0x60')](_0xfcce('0x59'));if(_0x2d6d73[_0x217976]||!_0x38f155[_0xfcce('0x61')]||!_0x38f155[_0xfcce('0x59')]){_0x1e8912=path['join'](config[_0xfcce('0x5d')],_0x5eca0d,_[_0xfcce('0x5e')](_0xfcce('0x70')));}if(!fs[_0xfcce('0x63')](_0x1e8912)){throw new db[(_0xfcce('0x64'))][(_0xfcce('0x65'))](_[_0xfcce('0x60')](_0xfcce('0x59'))+_0xfcce('0x66'));}return _0xd8d8ad['download'](_0x1e8912);}})['catch'](handleError(_0xd8d8ad,null));};exports['addFavicon']=function(_0x21b4c9,_0x4b7b4b,_0x5c05f8){if(_0x21b4c9[_0xfcce('0x51')]&&_0x21b4c9['file'][_0xfcce('0x52')]){_0x21b4c9[_0xfcce('0x4f')][_0xfcce('0x71')]=_0x21b4c9[_0xfcce('0x51')][_0xfcce('0x52')];}return db['Setting'][_0xfcce('0x4e')]({'where':{'id':_0x21b4c9['params']['id']}})[_0xfcce('0x19')](handleEntityNotFound(_0x4b7b4b,null))[_0xfcce('0x19')](saveUpdates(_0x21b4c9['body'],null))['then'](respondWithResult(_0x4b7b4b,null))[_0xfcce('0x23')](handleError(_0x4b7b4b,null));};var utilLicense=require('../../config/license/util');exports[_0xfcce('0x72')]=function(_0x3e11fd,_0x574a8b,_0x38fb98){var _0x44e326=_0xfcce('0x57');var _0x6e13c9={'custom':![]};return utilLicense['getLicense']()[_0xfcce('0x19')](function(_0x9bfc50){if(_0x9bfc50){_0x6e13c9=_0x9bfc50;}return db['Setting'][_0xfcce('0x4e')]({'where':{'id':_0x3e11fd['params']['id']},'attributes':['logo','loginLogo',_0xfcce('0x59'),_0xfcce('0x71'),_0xfcce('0x69'),_0xfcce('0x5a'),_0xfcce('0x5b'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x574a8b,null))['then'](function(_0x484971){if(_0x484971){var _0x5c5751=_0x484971[_0xfcce('0x71')]&&fs[_0xfcce('0x63')](path[_0xfcce('0x5c')](config[_0xfcce('0x5d')],_0x44e326,_[_0xfcce('0x5e')](_0x484971['favicon'])))?path['join'](config[_0xfcce('0x5d')],_0x44e326,_[_0xfcce('0x5e')](_0x484971[_0xfcce('0x71')])):path['join'](config['root'],_0x44e326,_['toLower'](_0xfcce('0x73')));var _0x57372c=_0xfcce('0x5f')+_[_0xfcce('0x60')]('favicon');if(_0x484971[_0x57372c]||!_0x6e13c9['custom']){_0x5c5751=path['join'](config[_0xfcce('0x5d')],_0x44e326,_[_0xfcce('0x5e')](_0xfcce('0x73')));}if(!fs['existsSync'](_0x5c5751)){throw new db[(_0xfcce('0x64'))][(_0xfcce('0x65'))](_[_0xfcce('0x60')]('favicon')+_0xfcce('0x66'));}return _0x574a8b[_0xfcce('0x6c')](_0x5c5751);}})['catch'](handleError(_0x574a8b,null));};exports['getDate']=function(_0x81e549,_0xc0323){var _0x17efbd={'offset':moment()[_0xfcce('0x74')]()};_0x17efbd[_0xfcce('0x75')]=moment()[_0xfcce('0x74')](_0x17efbd[_0xfcce('0x28')])[_0xfcce('0x76')](_0xfcce('0x77'));return _0xc0323[_0xfcce('0x25')](0xc8)[_0xfcce('0x78')](_0x17efbd);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index b45e6ff..551ae43 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x25ab47,_0x57280d){var _0x1b3d1e=function(_0x47bfb9){while(--_0x47bfb9){_0x25ab47['push'](_0x25ab47['shift']());}};_0x1b3d1e(++_0x57280d);}(_0xedd9,0xfc));var _0x9edd=function(_0x2cafad,_0xb17748){_0x2cafad=_0x2cafad-0x0;var _0x374e65=_0xedd9[_0x2cafad];return _0x374e65;};'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 +var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x37d5ff,_0x5ee83b){var _0x146b37=function(_0x596170){while(--_0x596170){_0x37d5ff['push'](_0x37d5ff['shift']());}};_0x146b37(++_0x5ee83b);}(_0x3e74,0x175));var _0x43e7=function(_0x4c7288,_0x50ebc4){_0x4c7288=_0x4c7288-0x0;var _0x2db75e=_0x3e74[_0x4c7288];return _0x2db75e;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 059ec3f..6751f2f 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 _0xb606=['Setting','find','options','raw','attributes','include','map','model','ShowSetting','debug','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result'];(function(_0x34eb31,_0x8f0f70){var _0x254994=function(_0xbec9a3){while(--_0xbec9a3){_0x34eb31['push'](_0x34eb31['shift']());}};_0x254994(++_0x8f0f70);}(_0xb606,0xd2));var _0x6b60=function(_0x52bfa5,_0x42cf21){_0x52bfa5=_0x52bfa5-0x0;var _0x26f80b=_0xb606[_0x52bfa5];return _0x26f80b;};'use strict';var _=require(_0x6b60('0x0'));var util=require(_0x6b60('0x1'));var moment=require(_0x6b60('0x2'));var BPromise=require(_0x6b60('0x3'));var rs=require(_0x6b60('0x4'));var fs=require('fs');var Redis=require(_0x6b60('0x5'));var db=require(_0x6b60('0x6'))['db'];var utils=require(_0x6b60('0x7'));var logger=require(_0x6b60('0x8'))(_0x6b60('0x9'));var config=require(_0x6b60('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5861ea,_0x410eb2,_0x34d217){return new BPromise(function(_0x382f85,_0x2c8ab3){return client[_0x6b60('0xb')](_0x5861ea,_0x34d217)[_0x6b60('0xc')](function(_0x27eaed){logger['info'](_0x6b60('0xd'),_0x410eb2,'request\x20sent');logger['debug'](_0x6b60('0xe'),_0x410eb2,'request\x20sent',JSON['stringify'](_0x27eaed));if(_0x27eaed[_0x6b60('0xf')]){if(_0x27eaed[_0x6b60('0xf')][_0x6b60('0x10')]===0x1f4){logger[_0x6b60('0xf')](_0x6b60('0xd'),_0x410eb2,_0x27eaed['error'][_0x6b60('0x11')]);return _0x2c8ab3(_0x27eaed['error'][_0x6b60('0x11')]);}logger['error']('Setting,\x20%s,\x20%s',_0x410eb2,_0x27eaed[_0x6b60('0xf')][_0x6b60('0x11')]);return _0x382f85(_0x27eaed[_0x6b60('0xf')][_0x6b60('0x11')]);}else{logger[_0x6b60('0x12')](_0x6b60('0xd'),_0x410eb2,_0x6b60('0x13'));_0x382f85(_0x27eaed[_0x6b60('0x14')]['message']);}})['catch'](function(_0x18e54c){logger[_0x6b60('0xf')](_0x6b60('0xd'),_0x410eb2,_0x18e54c);_0x2c8ab3(_0x18e54c);});});}exports['ShowSetting']=function(_0x17a4d2){var _0x17ce2a=this;return new Promise(function(_0x1e10df,_0x44cbbd){return db[_0x6b60('0x15')][_0x6b60('0x16')]({'raw':_0x17a4d2[_0x6b60('0x17')]?_0x17a4d2[_0x6b60('0x17')][_0x6b60('0x18')]===undefined?!![]:![]:!![],'where':_0x17a4d2[_0x6b60('0x17')]?_0x17a4d2[_0x6b60('0x17')]['where']||null:null,'attributes':_0x17a4d2[_0x6b60('0x17')]?_0x17a4d2['options'][_0x6b60('0x19')]||null:null,'include':_0x17a4d2[_0x6b60('0x17')]?_0x17a4d2[_0x6b60('0x17')][_0x6b60('0x1a')]?_[_0x6b60('0x1b')](_0x17a4d2['options'][_0x6b60('0x1a')],function(_0x3b0ca1){return{'model':db[_0x3b0ca1['model']],'as':_0x3b0ca1['as'],'attributes':_0x3b0ca1[_0x6b60('0x19')],'include':_0x3b0ca1[_0x6b60('0x1a')]?_[_0x6b60('0x1b')](_0x3b0ca1[_0x6b60('0x1a')],function(_0x59a9ad){return{'model':db[_0x59a9ad[_0x6b60('0x1c')]],'as':_0x59a9ad['as'],'attributes':_0x59a9ad[_0x6b60('0x19')],'include':_0x59a9ad[_0x6b60('0x1a')]?_['map'](_0x59a9ad['include'],function(_0x351464){return{'model':db[_0x351464['model']],'as':_0x351464['as'],'attributes':_0x351464[_0x6b60('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6b60('0xc')](function(_0x957f2a){logger[_0x6b60('0x12')](_0x6b60('0x1d'),_0x17a4d2);logger[_0x6b60('0x1e')](_0x6b60('0x1d'),_0x17a4d2,JSON[_0x6b60('0x1f')](_0x957f2a));_0x1e10df(_0x957f2a);})[_0x6b60('0x20')](function(_0x42276f){logger['error'](_0x6b60('0x1d'),_0x42276f[_0x6b60('0x11')],_0x17a4d2);_0x44cbbd(_0x17ce2a['error'](0x1f4,_0x42276f[_0x6b60('0x11')]));});});}; \ No newline at end of file +var _0x1329=['message','Setting,\x20%s,\x20%s','result','catch','ShowSetting','Setting','find','options','raw','include','model','attributes','map','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4e7654,_0x5ca510){var _0x3a837e=function(_0xdb231){while(--_0xdb231){_0x4e7654['push'](_0x4e7654['shift']());}};_0x3a837e(++_0x5ca510);}(_0x1329,0x18d));var _0x9132=function(_0x6e8f74,_0x339a6a){_0x6e8f74=_0x6e8f74-0x0;var _0x29b868=_0x1329[_0x6e8f74];return _0x29b868;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9132('0x0'));var rs=require(_0x9132('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9132('0x2'))['db'];var utils=require(_0x9132('0x3'));var logger=require(_0x9132('0x4'))(_0x9132('0x5'));var config=require(_0x9132('0x6'));var jayson=require(_0x9132('0x7'));var client=jayson[_0x9132('0x8')][_0x9132('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x964b8e,_0x5cd814,_0xb0ac3f){return new BPromise(function(_0x50f7ca,_0x3ca795){return client[_0x9132('0xa')](_0x964b8e,_0xb0ac3f)[_0x9132('0xb')](function(_0x17fde5){logger[_0x9132('0xc')]('Setting,\x20%s,\x20%s',_0x5cd814,_0x9132('0xd'));logger[_0x9132('0xe')](_0x9132('0xf'),_0x5cd814,_0x9132('0xd'),JSON[_0x9132('0x10')](_0x17fde5));if(_0x17fde5['error']){if(_0x17fde5[_0x9132('0x11')][_0x9132('0x12')]===0x1f4){logger[_0x9132('0x11')]('Setting,\x20%s,\x20%s',_0x5cd814,_0x17fde5['error'][_0x9132('0x13')]);return _0x3ca795(_0x17fde5['error'][_0x9132('0x13')]);}logger['error']('Setting,\x20%s,\x20%s',_0x5cd814,_0x17fde5[_0x9132('0x11')][_0x9132('0x13')]);return _0x50f7ca(_0x17fde5['error'][_0x9132('0x13')]);}else{logger[_0x9132('0xc')](_0x9132('0x14'),_0x5cd814,_0x9132('0xd'));_0x50f7ca(_0x17fde5[_0x9132('0x15')][_0x9132('0x13')]);}})[_0x9132('0x16')](function(_0x3093f2){logger['error'](_0x9132('0x14'),_0x5cd814,_0x3093f2);_0x3ca795(_0x3093f2);});});}exports[_0x9132('0x17')]=function(_0x162770){var _0x1af995=this;return new Promise(function(_0x5b7fac,_0x2af8eb){return db[_0x9132('0x18')][_0x9132('0x19')]({'raw':_0x162770[_0x9132('0x1a')]?_0x162770[_0x9132('0x1a')][_0x9132('0x1b')]===undefined?!![]:![]:!![],'where':_0x162770[_0x9132('0x1a')]?_0x162770[_0x9132('0x1a')]['where']||null:null,'attributes':_0x162770[_0x9132('0x1a')]?_0x162770['options']['attributes']||null:null,'include':_0x162770[_0x9132('0x1a')]?_0x162770[_0x9132('0x1a')][_0x9132('0x1c')]?_['map'](_0x162770[_0x9132('0x1a')]['include'],function(_0x56ccd4){return{'model':db[_0x56ccd4[_0x9132('0x1d')]],'as':_0x56ccd4['as'],'attributes':_0x56ccd4['attributes'],'include':_0x56ccd4['include']?_['map'](_0x56ccd4[_0x9132('0x1c')],function(_0x123305){return{'model':db[_0x123305[_0x9132('0x1d')]],'as':_0x123305['as'],'attributes':_0x123305[_0x9132('0x1e')],'include':_0x123305[_0x9132('0x1c')]?_[_0x9132('0x1f')](_0x123305[_0x9132('0x1c')],function(_0x34e1eb){return{'model':db[_0x34e1eb['model']],'as':_0x34e1eb['as'],'attributes':_0x34e1eb[_0x9132('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9132('0xb')](function(_0x2ac4ee){logger['info'](_0x9132('0x17'),_0x162770);logger['debug'](_0x9132('0x17'),_0x162770,JSON[_0x9132('0x10')](_0x2ac4ee));_0x5b7fac(_0x2ac4ee);})[_0x9132('0x16')](function(_0x3b00ac){logger[_0x9132('0x11')](_0x9132('0x17'),_0x3b00ac[_0x9132('0x13')],_0x162770);_0x2af8eb(_0x1af995[_0x9132('0x11')](0x1f4,_0x3b00ac[_0x9132('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index ca35c7f..68d4c03 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 _0xabce=['/:id/users','getAgents','create','post','addAnswer','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x23835f,_0x55b8ce){var _0x4e90d9=function(_0x47259b){while(--_0x47259b){_0x23835f['push'](_0x23835f['shift']());}};_0x4e90d9(++_0x55b8ce);}(_0xabce,0x103));var _0xeabc=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xabce[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/describe',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0x9')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0x9')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xf')]);router[_0xeabc('0x9')](_0xeabc('0x10'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x11')]);router[_0xeabc('0x9')](_0xeabc('0x12'),auth['isAuthenticated'](),controller[_0xeabc('0x13')]);router[_0xeabc('0x9')](_0xeabc('0x14'),controller['statusGet']);router['get'](_0xeabc('0x15'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x16')]);router['post']('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0x17')]);router['post']('/:id/dispositions',auth[_0xeabc('0x8')](),controller['addDisposition']);router[_0xeabc('0x18')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x19')]);router[_0xeabc('0x18')](_0xeabc('0x1a'),controller[_0xeabc('0x1b')]);router[_0xeabc('0x18')]('/:id/applications',auth[_0xeabc('0x8')](),controller['addApplications']);router[_0xeabc('0x18')](_0xeabc('0x1c'),auth['isAuthenticated'](),controller[_0xeabc('0x1d')]);router[_0xeabc('0x18')](_0xeabc('0x14'),controller[_0xeabc('0x1e')]);router[_0xeabc('0x18')]('/:id/users',auth[_0xeabc('0x8')](),controller[_0xeabc('0x1f')]);router[_0xeabc('0x20')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0x21')]);router[_0xeabc('0x22')](_0xeabc('0x23'),auth['isAuthenticated'](),controller[_0xeabc('0x24')]);router['delete'](_0xeabc('0xc'),auth['isAuthenticated'](),controller[_0xeabc('0x25')]);router[_0xeabc('0x22')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x26')]);router[_0xeabc('0x22')](_0xeabc('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xeabc('0x27')]=router; \ No newline at end of file +var _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x38dfa5,_0x5d87a0){_0x38dfa5=_0x38dfa5-0x0;var _0x4d7735=_0x1cb9[_0x38dfa5];return _0x4d7735;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 402a2e8..fe9aef9 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 _0xb775=['name','STRING','generate','ENUM','twilio','skebby','clickatell','bandwidth','infobip','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','randomstring','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb775,0x13e));var _0x5b77=function(_0x4cfb9e,_0xbed9d6){_0x4cfb9e=_0x4cfb9e-0x0;var _0x1fdace=_0xb775[_0x4cfb9e];return _0x1fdace;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x5b77('0x0'));module[_0x5b77('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5b77('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x5b77('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x5b77('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x5b77('0x3')],'defaultValue':function(){return rs[_0x5b77('0x4')]();}},'phone':{'type':Sequelize[_0x5b77('0x3')]},'type':{'type':Sequelize[_0x5b77('0x5')](_0x5b77('0x6'),_0x5b77('0x7'),'connectel','clicksend','plivo',_0x5b77('0x8'),_0x5b77('0x9'),'csc',_0x5b77('0xa'),'intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x5b77('0x3')]},'smsMethod':{'type':Sequelize[_0x5b77('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x5b77('0x3')]},'password':{'type':Sequelize[_0x5b77('0x3')]},'apiKey':{'type':Sequelize[_0x5b77('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x5b77('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x5b77('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x5b77('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x5b77('0xc');}},'notificationSound':{'type':Sequelize[_0x5b77('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5b77('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5b77('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5b77('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5b77('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5b77('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x5b77('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5b77('0xd')],'comment':_0x5b77('0xe')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2e02ce){if(!_0x2e02ce)this[_0x5b77('0xf')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x2e02ce);}}}; \ No newline at end of file +var _0xe36f=['twilio','connectel','clicksend','plivo','clickatell','bandwidth','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','generate'];(function(_0x360641,_0x3cf8be){var _0x25056b=function(_0x1472ef){while(--_0x1472ef){_0x360641['push'](_0x360641['shift']());}};_0x25056b(++_0x3cf8be);}(_0xe36f,0x10e));var _0xfe36=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe36f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xfe36('0x0'));var rs=require(_0xfe36('0x1'));module[_0xfe36('0x2')]={'name':{'type':Sequelize[_0xfe36('0x3')],'unique':_0xfe36('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xfe36('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xfe36('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xfe36('0x3')],'defaultValue':function(){return rs[_0xfe36('0x5')]();}},'phone':{'type':Sequelize[_0xfe36('0x3')]},'type':{'type':Sequelize['ENUM'](_0xfe36('0x6'),'skebby',_0xfe36('0x7'),_0xfe36('0x8'),_0xfe36('0x9'),_0xfe36('0xa'),_0xfe36('0xb'),_0xfe36('0xc'),_0xfe36('0xd'),_0xfe36('0xe'))},'accountSid':{'type':Sequelize[_0xfe36('0x3')]},'authId':{'type':Sequelize[_0xfe36('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xfe36('0x3')]},'apiKey':{'type':Sequelize[_0xfe36('0x3')]},'applicationId':{'type':Sequelize[_0xfe36('0x3')]},'accountId':{'type':Sequelize[_0xfe36('0x3')]},'senderString':{'type':Sequelize[_0xfe36('0x3')]},'deliveryReport':{'type':Sequelize[_0xfe36('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0xfe36('0x3')]},'notificationTemplate':{'type':Sequelize[_0xfe36('0x10')],'defaultValue':function(){return _0xfe36('0x11');}},'notificationSound':{'type':Sequelize[_0xfe36('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfe36('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfe36('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfe36('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfe36('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xfe36('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xfe36('0xf')],'defaultValue':![],'comment':_0xfe36('0x14'),'set':function(_0x141cc0){if(!_0x141cc0)this[_0xfe36('0x15')](_0xfe36('0x16'),null);this['setDataValue']('mandatoryDisposition',_0x141cc0);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 03c01fb..1d43322 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 _0xb020=['emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','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','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','reject','update','then','destroy','SmsAccounts','UserProfileResource','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','count','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','SmsApplication','Applications','account','priority','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','messageId','MessageSid','skebby','sender','text','clicksend','plivo','Text','MessageUUID','infobip','results','csc','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','applications','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','User','name','unshift','Start','startRouting','info','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','addApplications','transaction','bulkCreate','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','SmsMessage','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','message_id','status_code','groupName','DELIVERED','clickatell','redif','connectel','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','message-id','addAgents'];(function(_0x5b69a1,_0x554420){var _0x18a038=function(_0x40dacf){while(--_0x40dacf){_0x5b69a1['push'](_0x5b69a1['shift']());}};_0x18a038(++_0x554420);}(_0xb020,0x1bc));var _0x0b02=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0xb020[_0x5ac84c];return _0x3c53d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b02('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0b02('0x1'));var rp=require(_0x0b02('0x2'));var moment=require(_0x0b02('0x3'));var BPromise=require(_0x0b02('0x4'));var Mustache=require('mustache');var util=require(_0x0b02('0x5'));var path=require(_0x0b02('0x6'));var sox=require(_0x0b02('0x7'));var csv=require(_0x0b02('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b02('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0b02('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0b02('0xb'));var toCsv=require(_0x0b02('0x8'));var querystring=require(_0x0b02('0xc'));var Papa=require(_0x0b02('0xd'));var Redis=require(_0x0b02('0xe'));var authService=require(_0x0b02('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0b02('0x10'));var hardwareService=require(_0x0b02('0x11'));var logger=require(_0x0b02('0x12'))(_0x0b02('0x13'));var utils=require(_0x0b02('0x14'));var config=require(_0x0b02('0x15'));var licenseUtil=require(_0x0b02('0x16'));var db=require('../../mysqldb')['db'];config[_0x0b02('0x17')]=_[_0x0b02('0x18')](config[_0x0b02('0x17')],{'host':_0x0b02('0x19'),'port':0x18eb});var socket=require(_0x0b02('0x1a'))(new Redis(config['redis']));require(_0x0b02('0x1b'))['register'](socket);var jayson=require(_0x0b02('0x1c'));var client=jayson[_0x0b02('0x1d')][_0x0b02('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x509dee,_0x7ddc88,_0x5f5ba7,_0x52a486){return new BPromise(function(_0x38063a,_0x20703d){var _0xd4a0c=_0x52a486||client;return _0xd4a0c[_0x0b02('0x1f')](_0x509dee,_0x5f5ba7)['then'](function(_0x2e1188){logger['info'](_0x0b02('0x20'),_0x7ddc88,_0x0b02('0x21'));logger[_0x0b02('0x22')](_0x0b02('0x23'),_0x7ddc88,_0x0b02('0x21'),JSON[_0x0b02('0x24')](_0x2e1188));if(_0x2e1188[_0x0b02('0x25')]){if(_0x2e1188[_0x0b02('0x25')]['code']===0x1f4){logger['error'](_0x0b02('0x20'),_0x7ddc88,_0x2e1188[_0x0b02('0x25')][_0x0b02('0x26')]);return _0x20703d(_0x2e1188['error'][_0x0b02('0x26')]);}logger[_0x0b02('0x25')](_0x0b02('0x20'),_0x7ddc88,_0x2e1188['error'][_0x0b02('0x26')]);return _0x38063a(_0x2e1188['error']['message']);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x7ddc88,'request\x20sent');_0x38063a(_0x2e1188['result'][_0x0b02('0x26')]);}})['catch'](function(_0x5d6d0b){logger[_0x0b02('0x25')]('SmsAccount,\x20%s,\x20%s',_0x7ddc88,_0x5d6d0b);_0x20703d(_0x5d6d0b);});});}function respondWithStatusCode(_0x33202d,_0x415d66){_0x415d66=_0x415d66||0xcc;return function(_0x984c32){if(_0x984c32){return _0x33202d[_0x0b02('0x27')](_0x415d66);}return _0x33202d['status'](_0x415d66)[_0x0b02('0x28')]();};}function respondWithResult(_0x315df5,_0x48d6c1){_0x48d6c1=_0x48d6c1||0xc8;return function(_0x2e482b){if(_0x2e482b){return _0x315df5[_0x0b02('0x29')](_0x48d6c1)[_0x0b02('0x2a')](_0x2e482b);}};}function respondWithFilteredResult(_0x8e44ef,_0xa8b37a){return function(_0x6bbcc1){if(_0x6bbcc1){var _0x2b6895=typeof _0xa8b37a['offset']===_0x0b02('0x2b')&&typeof _0xa8b37a[_0x0b02('0x2c')]==='undefined';var _0x4590aa=_0x6bbcc1['count'];var _0x17c91f=_0x2b6895?0x0:_0xa8b37a[_0x0b02('0x2d')];var _0x17a938=_0x2b6895?_0x6bbcc1['count']:_0xa8b37a[_0x0b02('0x2d')]+_0xa8b37a[_0x0b02('0x2c')];var _0x1dee90;if(_0x17a938>=_0x4590aa){_0x17a938=_0x4590aa;_0x1dee90=0xc8;}else{_0x1dee90=0xce;}_0x8e44ef[_0x0b02('0x29')](_0x1dee90);return _0x8e44ef[_0x0b02('0x2e')](_0x0b02('0x2f'),_0x17c91f+'-'+_0x17a938+'/'+_0x4590aa)['json'](_0x6bbcc1);}return null;};}function patchUpdates(_0x5538f8){return function(_0x18a5e5){try{jsonpatch['apply'](_0x18a5e5,_0x5538f8,!![]);}catch(_0x4a8425){return BPromise[_0x0b02('0x30')](_0x4a8425);}return _0x18a5e5['save']();};}function saveUpdates(_0x3516a5,_0x5cc4d5){return function(_0x20db6f){if(_0x20db6f){return _0x20db6f[_0x0b02('0x31')](_0x3516a5)[_0x0b02('0x32')](function(_0x91fac2){return _0x91fac2;});}return null;};}function removeEntity(_0x24248f,_0x5f24e5){return function(_0x58d75d){if(_0x58d75d){return _0x58d75d[_0x0b02('0x33')]()[_0x0b02('0x32')](function(){var _0x2aa8e7=_0x58d75d['get']({'plain':!![]});var _0x2827e2=_0x0b02('0x34');return db[_0x0b02('0x35')]['destroy']({'where':{'type':_0x2827e2,'resourceId':_0x2aa8e7['id']}})[_0x0b02('0x32')](function(){return _0x58d75d;});})['then'](function(){_0x24248f[_0x0b02('0x29')](0xcc)[_0x0b02('0x28')]();});}};}function handleEntityNotFound(_0x33c87a,_0x2fd32e){return function(_0x25ffff){if(!_0x25ffff){_0x33c87a[_0x0b02('0x27')](0x194);}return _0x25ffff;};}function handleError(_0x8337aa,_0x25c5fe){_0x25c5fe=_0x25c5fe||0x1f4;return function(_0x2fe80a){logger[_0x0b02('0x25')](_0x2fe80a['stack']);if(_0x2fe80a['name']){delete _0x2fe80a['name'];}_0x8337aa[_0x0b02('0x29')](_0x25c5fe)['send'](_0x2fe80a);};}exports[_0x0b02('0x36')]=function(_0x52dc26,_0x4625fe){var _0x35fa6b={'include':[{'model':db[_0x0b02('0x37')],'as':_0x0b02('0x38')}]},_0x5f7259={},_0xc6bed8={'count':0x0,'rows':[]};var _0x41e56b=_[_0x0b02('0x39')](db[_0x0b02('0x3a')][_0x0b02('0x3b')],function(_0x3493e3){return{'name':_0x3493e3[_0x0b02('0x3c')],'type':_0x3493e3['type']['key']};});_0x5f7259[_0x0b02('0x3d')]=_[_0x0b02('0x39')](_0x41e56b,'name');_0x5f7259['query']=_[_0x0b02('0x3e')](_0x52dc26[_0x0b02('0x3f')]);_0x5f7259[_0x0b02('0x40')]=_[_0x0b02('0x41')](_0x5f7259[_0x0b02('0x3d')],_0x5f7259[_0x0b02('0x3f')]);_0x35fa6b[_0x0b02('0x42')]=_['intersection'](_0x5f7259[_0x0b02('0x3d')],qs[_0x0b02('0x43')](_0x52dc26[_0x0b02('0x3f')][_0x0b02('0x43')]));_0x35fa6b[_0x0b02('0x42')]=_0x35fa6b['attributes']['length']?_0x35fa6b[_0x0b02('0x42')]:_0x5f7259[_0x0b02('0x3d')];if(!_0x52dc26[_0x0b02('0x3f')][_0x0b02('0x44')](_0x0b02('0x45'))){_0x35fa6b['limit']=qs[_0x0b02('0x2c')](_0x52dc26[_0x0b02('0x3f')][_0x0b02('0x2c')]);_0x35fa6b[_0x0b02('0x2d')]=qs['offset'](_0x52dc26[_0x0b02('0x3f')][_0x0b02('0x2d')]);}_0x35fa6b[_0x0b02('0x46')]=qs[_0x0b02('0x47')](_0x52dc26[_0x0b02('0x3f')][_0x0b02('0x47')]);_0x35fa6b[_0x0b02('0x48')]=qs[_0x0b02('0x40')](_[_0x0b02('0x49')](_0x52dc26['query'],_0x5f7259[_0x0b02('0x40')]),_0x41e56b);if(_0x52dc26[_0x0b02('0x3f')]['filter']){_0x35fa6b[_0x0b02('0x48')]=_[_0x0b02('0x4a')](_0x35fa6b[_0x0b02('0x48')],{'$or':_[_0x0b02('0x39')](_0x41e56b,function(_0x4ef0e2){if(_0x4ef0e2[_0x0b02('0x4b')]!==_0x0b02('0x4c')){var _0x2d348d={};_0x2d348d[_0x4ef0e2['name']]={'$like':'%'+_0x52dc26[_0x0b02('0x3f')][_0x0b02('0x4d')]+'%'};return _0x2d348d;}})});}_0x35fa6b=_[_0x0b02('0x4a')]({},_0x35fa6b,_0x52dc26[_0x0b02('0x4e')]);var _0x5ede46={'where':_0x35fa6b[_0x0b02('0x48')]};return db[_0x0b02('0x3a')]['count'](_0x5ede46)[_0x0b02('0x32')](function(_0x4ad8aa){_0xc6bed8['count']=_0x4ad8aa;if(_0x52dc26['query'][_0x0b02('0x4f')]){_0x35fa6b[_0x0b02('0x50')]=[{'all':!![]}];}return db[_0x0b02('0x3a')][_0x0b02('0x51')](_0x35fa6b);})['then'](function(_0x56fd29){_0xc6bed8[_0x0b02('0x52')]=_0x56fd29;return _0xc6bed8;})[_0x0b02('0x32')](respondWithFilteredResult(_0x4625fe,_0x35fa6b))[_0x0b02('0x53')](handleError(_0x4625fe,null));};exports[_0x0b02('0x54')]=function(_0x1569b4,_0xcbf9bb){var _0x54f6b1={'raw':![],'where':{'id':_0x1569b4[_0x0b02('0x55')]['id']},'include':[{'model':db[_0x0b02('0x37')],'as':_0x0b02('0x38')}]},_0xa70033={};_0xa70033[_0x0b02('0x3d')]=_['keys'](db[_0x0b02('0x3a')][_0x0b02('0x3b')]);_0xa70033['query']=_[_0x0b02('0x3e')](_0x1569b4['query']);_0xa70033['filters']=_[_0x0b02('0x41')](_0xa70033[_0x0b02('0x3d')],_0xa70033['query']);_0x54f6b1['attributes']=_[_0x0b02('0x41')](_0xa70033[_0x0b02('0x3d')],qs[_0x0b02('0x43')](_0x1569b4[_0x0b02('0x3f')][_0x0b02('0x43')]));_0x54f6b1['attributes']=_0x54f6b1[_0x0b02('0x42')][_0x0b02('0x56')]?_0x54f6b1['attributes']:_0xa70033[_0x0b02('0x3d')];if(_0x1569b4[_0x0b02('0x3f')][_0x0b02('0x4f')]){_0x54f6b1[_0x0b02('0x50')]=[{'all':!![]}];}_0x54f6b1=_['merge']({},_0x54f6b1,_0x1569b4[_0x0b02('0x4e')]);return db['SmsAccount'][_0x0b02('0x57')](_0x54f6b1)[_0x0b02('0x32')](handleEntityNotFound(_0xcbf9bb,null))['then'](respondWithResult(_0xcbf9bb,null))[_0x0b02('0x53')](handleError(_0xcbf9bb,null));};exports[_0x0b02('0x58')]=function(_0x5decf6,_0x823d84){return db[_0x0b02('0x3a')][_0x0b02('0x58')](_0x5decf6[_0x0b02('0x59')],{})['then'](function(_0x257dd3){var _0x4f54ce=_0x5decf6[_0x0b02('0x5a')][_0x0b02('0x5b')]({'plain':!![]});if(!_0x4f54ce)throw new Error(_0x0b02('0x5c'));if(_0x4f54ce['role']===_0x0b02('0x5a')){var _0x45503e=_0x257dd3[_0x0b02('0x5b')]({'plain':!![]});var _0x3151b9=_0x0b02('0x34');return db[_0x0b02('0x5d')][_0x0b02('0x57')]({'where':{'name':_0x3151b9,'userProfileId':_0x4f54ce['userProfileId']},'raw':!![]})[_0x0b02('0x32')](function(_0x47709d){if(_0x47709d&&_0x47709d[_0x0b02('0x5e')]===0x0){return db['UserProfileResource']['create']({'name':_0x45503e['name'],'resourceId':_0x45503e['id'],'type':_0x47709d['name'],'sectionId':_0x47709d['id']},{})['then'](function(){return _0x257dd3;});}else{return _0x257dd3;}})[_0x0b02('0x53')](function(_0x1a62b1){logger['error'](_0x0b02('0x5f'),_0x1a62b1);throw _0x1a62b1;});}return _0x257dd3;})[_0x0b02('0x32')](respondWithResult(_0x823d84,0xc9))[_0x0b02('0x53')](handleError(_0x823d84,null));};exports['update']=function(_0x58591f,_0x351ab9){if(_0x58591f[_0x0b02('0x59')]['id']){delete _0x58591f[_0x0b02('0x59')]['id'];}return db[_0x0b02('0x3a')][_0x0b02('0x57')]({'where':{'id':_0x58591f[_0x0b02('0x55')]['id']},'include':[{'model':db[_0x0b02('0x37')],'as':_0x0b02('0x38')}]})['then'](handleEntityNotFound(_0x351ab9,null))[_0x0b02('0x32')](saveUpdates(_0x58591f['body'],null))[_0x0b02('0x32')](respondWithResult(_0x351ab9,null))[_0x0b02('0x53')](handleError(_0x351ab9,null));};exports['destroy']=function(_0xfada3a,_0x1264aa){return db[_0x0b02('0x3a')][_0x0b02('0x57')]({'where':{'id':_0xfada3a[_0x0b02('0x55')]['id']}})[_0x0b02('0x32')](handleEntityNotFound(_0x1264aa,null))[_0x0b02('0x32')](removeEntity(_0x1264aa,null))[_0x0b02('0x53')](handleError(_0x1264aa,null));};exports[_0x0b02('0x60')]=function(_0x194149,_0xd677ed){return db[_0x0b02('0x3a')][_0x0b02('0x60')]()[_0x0b02('0x32')](respondWithResult(_0xd677ed,null))[_0x0b02('0x53')](handleError(_0xd677ed,null));};exports['addDisposition']=function(_0xb739c2,_0x49363d,_0x66a16f){if(_0xb739c2['body']['id']){delete _0xb739c2[_0x0b02('0x59')]['id'];}return db[_0x0b02('0x3a')][_0x0b02('0x57')]({'where':{'id':_0xb739c2[_0x0b02('0x55')]['id']}})[_0x0b02('0x32')](handleEntityNotFound(_0x49363d,null))['then'](function(_0x73c99e){if(_0x73c99e){_0xb739c2['body'][_0x0b02('0x61')]=_0x73c99e['id'];return db['Disposition'][_0x0b02('0x58')](_0xb739c2[_0x0b02('0x59')]);}})[_0x0b02('0x32')](respondWithResult(_0x49363d,null))['catch'](handleError(_0x49363d,null));};exports['getDispositions']=function(_0x81d49f,_0xd7dd15,_0x35362d){var _0x5b5ecb={'raw':![],'where':{}};var _0x5c6397={};var _0x19638a={'count':0x0,'rows':[]};return db[_0x0b02('0x3a')]['findOne']({'where':{'id':_0x81d49f[_0x0b02('0x55')]['id']}})[_0x0b02('0x32')](handleEntityNotFound(_0xd7dd15,null))['then'](function(_0x3839ac){if(_0x3839ac){_0x5c6397[_0x0b02('0x3d')]=_[_0x0b02('0x3e')](db[_0x0b02('0x62')]['rawAttributes']);_0x5c6397[_0x0b02('0x3f')]=_[_0x0b02('0x3e')](_0x81d49f[_0x0b02('0x3f')]);_0x5c6397[_0x0b02('0x40')]=_[_0x0b02('0x41')](_0x5c6397[_0x0b02('0x3d')],_0x5c6397['query']);_0x5b5ecb['attributes']=_[_0x0b02('0x41')](_0x5c6397[_0x0b02('0x3d')],qs[_0x0b02('0x43')](_0x81d49f[_0x0b02('0x3f')][_0x0b02('0x43')]));_0x5b5ecb['attributes']=_0x5b5ecb[_0x0b02('0x42')][_0x0b02('0x56')]?_0x5b5ecb[_0x0b02('0x42')]:_0x5c6397[_0x0b02('0x3d')];if(!_0x81d49f[_0x0b02('0x3f')][_0x0b02('0x44')](_0x0b02('0x45'))){_0x5b5ecb[_0x0b02('0x2c')]=qs[_0x0b02('0x2c')](_0x81d49f[_0x0b02('0x3f')]['limit']);_0x5b5ecb[_0x0b02('0x2d')]=qs[_0x0b02('0x2d')](_0x81d49f[_0x0b02('0x3f')][_0x0b02('0x2d')]);}_0x5b5ecb[_0x0b02('0x46')]=qs[_0x0b02('0x47')](_0x81d49f[_0x0b02('0x3f')]['sort']);_0x5b5ecb[_0x0b02('0x48')]=qs[_0x0b02('0x40')](_['pick'](_0x81d49f[_0x0b02('0x3f')],_0x5c6397[_0x0b02('0x40')]));_0x5b5ecb['where'][_0x0b02('0x61')]=_0x3839ac['id'];if(_0x81d49f[_0x0b02('0x3f')][_0x0b02('0x4d')]){_0x5b5ecb[_0x0b02('0x48')]=_[_0x0b02('0x4a')](_0x5b5ecb['where'],{'$or':_[_0x0b02('0x39')](_0x5b5ecb[_0x0b02('0x42')],function(_0x532259){var _0x56a773={};_0x56a773[_0x532259]={'$like':'%'+_0x81d49f[_0x0b02('0x3f')][_0x0b02('0x4d')]+'%'};return _0x56a773;})});}_0x5b5ecb=_[_0x0b02('0x4a')]({},_0x5b5ecb,_0x81d49f['options']);return db[_0x0b02('0x62')][_0x0b02('0x63')]({'where':_0x5b5ecb[_0x0b02('0x48')]})[_0x0b02('0x32')](function(_0x179738){_0x19638a[_0x0b02('0x63')]=_0x179738;if(_0x81d49f['query']['includeAll']){_0x5b5ecb['include']=[{'all':!![]}];}return db['Disposition'][_0x0b02('0x51')](_0x5b5ecb);})[_0x0b02('0x32')](function(_0x27380e){_0x19638a[_0x0b02('0x52')]=_0x27380e;return _0x19638a;});}})[_0x0b02('0x32')](respondWithFilteredResult(_0xd7dd15,_0x5b5ecb))['catch'](handleError(_0xd7dd15,null));};exports[_0x0b02('0x64')]=function(_0x566741,_0x3650da,_0x10526e){return db[_0x0b02('0x3a')][_0x0b02('0x57')]({'where':{'id':_0x566741[_0x0b02('0x55')]['id']}})['then'](handleEntityNotFound(_0x3650da,null))[_0x0b02('0x32')](function(_0x21982c){if(_0x21982c){return _0x21982c[_0x0b02('0x64')](_0x566741[_0x0b02('0x3f')][_0x0b02('0x65')]);}})[_0x0b02('0x32')](respondWithStatusCode(_0x3650da,null))[_0x0b02('0x53')](handleError(_0x3650da,null));};exports[_0x0b02('0x66')]=function(_0x291612,_0x3d220f,_0x2fc8b8){if(_0x291612[_0x0b02('0x59')]['id']){delete _0x291612['body']['id'];}return db['SmsAccount']['find']({'where':{'id':_0x291612[_0x0b02('0x55')]['id']}})['then'](handleEntityNotFound(_0x3d220f,null))[_0x0b02('0x32')](function(_0x528dff){if(_0x528dff){_0x291612[_0x0b02('0x59')][_0x0b02('0x61')]=_0x528dff['id'];return db[_0x0b02('0x67')][_0x0b02('0x58')](_0x291612[_0x0b02('0x59')]);}})[_0x0b02('0x32')](respondWithResult(_0x3d220f,null))[_0x0b02('0x53')](handleError(_0x3d220f,null));};exports['getAnswers']=function(_0xa24b48,_0x11544e,_0xfa6b84){var _0x40b6d5={'raw':![],'where':{}};var _0x55210c={};var _0x48a1eb={'count':0x0,'rows':[]};return db[_0x0b02('0x3a')][_0x0b02('0x68')]({'where':{'id':_0xa24b48[_0x0b02('0x55')]['id']}})[_0x0b02('0x32')](handleEntityNotFound(_0x11544e,null))[_0x0b02('0x32')](function(_0x4591b5){if(_0x4591b5){_0x55210c[_0x0b02('0x3d')]=_[_0x0b02('0x3e')](db['CannedAnswer'][_0x0b02('0x3b')]);_0x55210c[_0x0b02('0x3f')]=_[_0x0b02('0x3e')](_0xa24b48[_0x0b02('0x3f')]);_0x55210c[_0x0b02('0x40')]=_[_0x0b02('0x41')](_0x55210c['model'],_0x55210c['query']);_0x40b6d5['attributes']=_[_0x0b02('0x41')](_0x55210c[_0x0b02('0x3d')],qs[_0x0b02('0x43')](_0xa24b48[_0x0b02('0x3f')][_0x0b02('0x43')]));_0x40b6d5['attributes']=_0x40b6d5[_0x0b02('0x42')][_0x0b02('0x56')]?_0x40b6d5[_0x0b02('0x42')]:_0x55210c[_0x0b02('0x3d')];if(!_0xa24b48[_0x0b02('0x3f')][_0x0b02('0x44')]('nolimit')){_0x40b6d5[_0x0b02('0x2c')]=qs[_0x0b02('0x2c')](_0xa24b48[_0x0b02('0x3f')][_0x0b02('0x2c')]);_0x40b6d5[_0x0b02('0x2d')]=qs[_0x0b02('0x2d')](_0xa24b48[_0x0b02('0x3f')][_0x0b02('0x2d')]);}_0x40b6d5['order']=qs[_0x0b02('0x47')](_0xa24b48[_0x0b02('0x3f')][_0x0b02('0x47')]);_0x40b6d5[_0x0b02('0x48')]=qs[_0x0b02('0x40')](_[_0x0b02('0x49')](_0xa24b48[_0x0b02('0x3f')],_0x55210c[_0x0b02('0x40')]));_0x40b6d5['where']['SmsAccountId']=_0x4591b5['id'];if(_0xa24b48[_0x0b02('0x3f')][_0x0b02('0x4d')]){_0x40b6d5[_0x0b02('0x48')]=_[_0x0b02('0x4a')](_0x40b6d5['where'],{'$or':_[_0x0b02('0x39')](_0x40b6d5[_0x0b02('0x42')],function(_0x189af3){var _0x2e11d2={};_0x2e11d2[_0x189af3]={'$like':'%'+_0xa24b48['query'][_0x0b02('0x4d')]+'%'};return _0x2e11d2;})});}_0x40b6d5=_['merge']({},_0x40b6d5,_0xa24b48['options']);return db[_0x0b02('0x67')][_0x0b02('0x63')]({'where':_0x40b6d5[_0x0b02('0x48')]})['then'](function(_0x2d7ac7){_0x48a1eb[_0x0b02('0x63')]=_0x2d7ac7;if(_0xa24b48[_0x0b02('0x3f')][_0x0b02('0x4f')]){_0x40b6d5[_0x0b02('0x50')]=[{'all':!![]}];}return db['CannedAnswer'][_0x0b02('0x51')](_0x40b6d5);})[_0x0b02('0x32')](function(_0x49a62f){_0x48a1eb[_0x0b02('0x52')]=_0x49a62f;return _0x48a1eb;});}})['then'](respondWithFilteredResult(_0x11544e,_0x40b6d5))[_0x0b02('0x53')](handleError(_0x11544e,null));};exports[_0x0b02('0x69')]=function(_0x35d4a6,_0x3a102b,_0x198308){return db[_0x0b02('0x3a')][_0x0b02('0x57')]({'where':{'id':_0x35d4a6[_0x0b02('0x55')]['id']}})['then'](handleEntityNotFound(_0x3a102b,null))[_0x0b02('0x32')](function(_0x6868f8){if(_0x6868f8){return _0x6868f8[_0x0b02('0x69')](_0x35d4a6[_0x0b02('0x3f')][_0x0b02('0x65')]);}})[_0x0b02('0x32')](respondWithStatusCode(_0x3a102b,null))['catch'](handleError(_0x3a102b,null));};exports[_0x0b02('0x6a')]=function(_0x97ee18,_0x530931,_0x41690b){var _0x3cfa37={'channel':'sms'};var _0x43a90c=[];var _0x3aa186=[];var _0x52a7ce={};return db['SmsAccount'][_0x0b02('0x57')]({'where':{'id':_0x97ee18[_0x0b02('0x55')]['id']},'include':[{'model':db[_0x0b02('0x6b')],'as':_0x0b02('0x6c')}]})['then'](handleEntityNotFound(_0x530931,null))[_0x0b02('0x32')](function(_0x2ff48a){_0x3cfa37[_0x0b02('0x6d')]=_0x2ff48a;_0x3cfa37['applications']=_['orderBy'](_0x2ff48a['Applications'],[_0x0b02('0x6e')],[_0x0b02('0x6f')]);if(_0x3cfa37[_0x0b02('0x6d')]['Applications']){delete _0x3cfa37[_0x0b02('0x6d')]['Applications'];}return db[_0x0b02('0x70')][_0x0b02('0x60')]();})[_0x0b02('0x32')](function(_0x3befc4){if(!_0x3befc4){throw new db[(_0x0b02('0x71'))][(_0x0b02('0x72'))]('no\x20available\x20attributes');}_0x43a90c=_[_0x0b02('0x73')](_[_0x0b02('0x3e')](_0x3befc4),[_0x0b02('0x74'),_0x0b02('0x75')]);_0x3aa186=_[_0x0b02('0x73')](_[_0x0b02('0x3e')](_0x3befc4),[_0x0b02('0x74'),_0x0b02('0x75'),_0x0b02('0x76'),_0x0b02('0x77')]);_0x3cfa37[_0x0b02('0x59')]={'mapKey':'mobile'};if(_0x3cfa37['account'][_0x0b02('0x4b')]){switch(_0x3cfa37[_0x0b02('0x6d')][_0x0b02('0x4b')]){case _0x0b02('0x78'):_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x79')]=_0x97ee18[_0x0b02('0x59')][_0x0b02('0x7a')];_0x3cfa37['body'][_0x0b02('0x59')]=_0x97ee18['body']['Body'];_0x3cfa37['body'][_0x0b02('0x7b')]=_0x97ee18['body'][_0x0b02('0x7c')];break;case _0x0b02('0x7d'):_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x79')]='+'+_0x97ee18[_0x0b02('0x59')][_0x0b02('0x7e')];_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x59')]=_0x97ee18['body'][_0x0b02('0x7f')];break;case'connectel':_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x79')]=_0x97ee18[_0x0b02('0x59')][_0x0b02('0x79')];_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x59')]=_0x97ee18[_0x0b02('0x59')]['message'];break;case _0x0b02('0x80'):_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x79')]=_0x97ee18[_0x0b02('0x59')][_0x0b02('0x79')];_0x3cfa37[_0x0b02('0x59')]['body']=_0x97ee18[_0x0b02('0x59')][_0x0b02('0x59')];_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x7b')]=_0x97ee18[_0x0b02('0x59')]['message_id'];break;case _0x0b02('0x81'):_0x3cfa37['body'][_0x0b02('0x79')]=_0x97ee18[_0x0b02('0x59')]['From'];_0x3cfa37['body']['body']=_0x97ee18[_0x0b02('0x59')][_0x0b02('0x82')];_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x7b')]=_0x97ee18[_0x0b02('0x59')][_0x0b02('0x83')];break;case _0x0b02('0x84'):_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x79')]='+'+_0x97ee18[_0x0b02('0x59')][_0x0b02('0x85')][0x0][_0x0b02('0x79')];_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x59')]=_0x97ee18[_0x0b02('0x59')][_0x0b02('0x85')][0x0][_0x0b02('0x7f')];_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x7b')]=_0x97ee18[_0x0b02('0x59')][_0x0b02('0x85')][0x0]['messageId'];break;case _0x0b02('0x86'):_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x79')]=_0x97ee18[_0x0b02('0x59')]['originatingAddress'];_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x59')]=_0x97ee18['body']['segmentedMessage'][_0x0b02('0x26')];break;case'clickatell':_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x79')]=_0x97ee18[_0x0b02('0x59')][_0x0b02('0x87')];_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x59')]=_0x97ee18['body'][_0x0b02('0x7f')];_0x3cfa37['body'][_0x0b02('0x7b')]=_0x97ee18[_0x0b02('0x59')][_0x0b02('0x88')];break;case _0x0b02('0x89'):_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x7b')]=_0x97ee18[_0x0b02('0x59')][0x0][_0x0b02('0x26')]['id'];_0x3cfa37['body'][_0x0b02('0x79')]=_0x97ee18[_0x0b02('0x59')][0x0]['message'][_0x0b02('0x79')];_0x3cfa37[_0x0b02('0x59')]['body']=_0x97ee18[_0x0b02('0x59')][0x0][_0x0b02('0x26')][_0x0b02('0x7f')];break;case _0x0b02('0x8a'):_0x3cfa37['body'][_0x0b02('0x79')]=_0x97ee18[_0x0b02('0x59')][_0x0b02('0x79')];_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x59')]=_0x97ee18['body'][_0x0b02('0x26')];_0x3cfa37['body'][_0x0b02('0x7b')]=_0x97ee18[_0x0b02('0x59')][_0x0b02('0x8b')];break;}}if(_0x3cfa37['body']['id']){delete _0x3cfa37[_0x0b02('0x59')]['id'];}if(_[_0x0b02('0x8c')](_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x79')])){throw new db[(_0x0b02('0x71'))][(_0x0b02('0x72'))](_0x0b02('0x8d'));}if(_[_0x0b02('0x8c')](_0x3cfa37['body'][_0x0b02('0x59')])||_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x59')]===''){throw new db[(_0x0b02('0x71'))]['ValidationError'](_0x0b02('0x8e'));}if(_['isNil'](_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x8f')])){throw new db[(_0x0b02('0x71'))][(_0x0b02('0x72'))](_0x0b02('0x90')+_0x3aa186);}if(!_[_0x0b02('0x91')](_0x3aa186,_0x3cfa37['body']['mapKey'])){throw new db[(_0x0b02('0x71'))]['ValidationError'](_0x0b02('0x92')+_0x3aa186);}_0x52a7ce[_0x3cfa37[_0x0b02('0x59')]['mapKey']]=_0x3cfa37['body'][_0x0b02('0x79')];return db[_0x0b02('0x93')][_0x0b02('0x57')]({'where':{'id':_0x3cfa37['account'][_0x0b02('0x77')]},'include':[{'model':db[_0x0b02('0x70')],'as':'Contacts','where':_0x52a7ce,'limit':0x1,'order':[[_0x0b02('0x75'),_0x0b02('0x94')]]}]});})[_0x0b02('0x32')](handleEntityNotFound(_0x530931,null))[_0x0b02('0x32')](function(_0x1e3c07){if(_0x1e3c07){_0x3cfa37[_0x0b02('0x95')]=_[_0x0b02('0x96')](_0x1e3c07,[_0x0b02('0x97')]);if(_0x1e3c07[_0x0b02('0x97')]['length']){return _0x1e3c07[_0x0b02('0x97')][0x0];}var _0x1a731d=_[_0x0b02('0x18')](_0x3cfa37[_0x0b02('0x59')],{'firstName':_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x79')],'ListId':_0x1e3c07['id']});_0x1a731d[_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x8f')]]=_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x79')];return db[_0x0b02('0x70')]['create'](_0x1a731d,{'fields':_0x43a90c,'raw':!![]});}})[_0x0b02('0x32')](handleEntityNotFound(_0x530931,null))[_0x0b02('0x32')](function(_0x5790fc){if(_0x5790fc){_0x3cfa37[_0x0b02('0x98')]=_0x5790fc;var _0x2eec11={'ContactId':_0x5790fc['id'],'phone':_0x3cfa37[_0x0b02('0x59')][_0x0b02('0x79')],'SmsAccountId':_0x97ee18['params']['id']};var _0x5a8926={'ContactId':_0x5790fc['id'],'SmsAccountId':_0x97ee18[_0x0b02('0x55')]['id'],'closed':![]};return db[_0x0b02('0x99')][_0x0b02('0x57')]({'where':_0x5a8926})[_0x0b02('0x32')](function(_0x4f093d){if(_0x4f093d){return[_0x4f093d,![]];}return db[_0x0b02('0x99')][_0x0b02('0x58')](_0x2eec11)['then'](function(_0x56a9e0){return[_0x56a9e0,!![]];});});}})[_0x0b02('0x9a')](function(_0x3399ba,_0x1006e6){_0x3cfa37[_0x0b02('0x9b')]=_0x3399ba[_0x0b02('0x5b')]({'plain':!![]});_0x3cfa37[_0x0b02('0x9b')][_0x0b02('0x9c')]=![];if(_0x1006e6){if(_0x3cfa37[_0x0b02('0x6d')][_0x0b02('0x9d')]){_0x3cfa37[_0x0b02('0x9e')][_0x0b02('0x9f')]({'id':0x0,'priority':_0x3cfa37[_0x0b02('0x9e')]['length']+0x1,'app':_0x0b02('0xa0'),'appdata':_0x0b02('0xa1'),'interval':_0x0b02('0xa2')});}_0x3cfa37['interaction']['created']=!![];}return db['SmsMessage'][_0x0b02('0x58')]({'phone':_0x3cfa37['body'][_0x0b02('0x79')],'messageId':_0x3cfa37[_0x0b02('0x59')]['messageId'],'body':_0x3cfa37['body'][_0x0b02('0x59')],'SmsAccountId':_0x97ee18[_0x0b02('0x55')]['id'],'SmsInteractionId':_0x3399ba['id'],'direction':'in','ContactId':_0x3399ba[_0x0b02('0xa3')],'AttachmentId':_0x3cfa37[_0x0b02('0x59')][_0x0b02('0xa4')]});})[_0x0b02('0x32')](function(_0x4cdfc5){_0x3cfa37[_0x0b02('0x26')]=_0x4cdfc5;if(_0x3cfa37[_0x0b02('0x9b')][_0x0b02('0xa5')]){return db[_0x0b02('0xa6')][_0x0b02('0x57')]({'attributes':['id',_0x0b02('0xa7')],'where':{'id':_0x3cfa37[_0x0b02('0x9b')][_0x0b02('0xa5')]}})[_0x0b02('0x32')](function(_0x5e42b4){if(_0x5e42b4){_0x3cfa37[_0x0b02('0x9e')][_0x0b02('0xa8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5e42b4[_0x0b02('0xa7')]+','+(_0x3cfa37[_0x0b02('0x6d')]['waitForTheAssignedAgent']||0xa),'interval':_0x0b02('0xa2')});}return respondWithRpcPromise(_0x0b02('0xa9'),_0x0b02('0xaa'),_0x3cfa37);});}return respondWithRpcPromise(_0x0b02('0xa9'),'startRouting',_0x3cfa37);})[_0x0b02('0x32')](function(_0x2ee43f){if(_0x2ee43f){var _0x10b84e=0xc8;var _0x947863='receiveMessage';logger[_0x0b02('0xab')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x947863,_0x10b84e,_0x0b02('0xac'));logger[_0x0b02('0x22')](_0x0b02('0xad'),_0x947863,_0x10b84e,_0x0b02('0xac'),JSON[_0x0b02('0x24')](_0x2ee43f));if(_0x3cfa37[_0x0b02('0x6d')][_0x0b02('0x4b')]===_0x0b02('0x78')){return _0x530931[_0x0b02('0x29')](_0x10b84e)[_0x0b02('0x2e')](_0x0b02('0xae'),_0x0b02('0xaf'))[_0x0b02('0xb0')]('\x0a');}else{return _0x530931[_0x0b02('0x29')](_0x10b84e)[_0x0b02('0x2a')](_0x2ee43f);}}})[_0x0b02('0x53')](handleError(_0x530931,null));};exports[_0x0b02('0xb1')]=function(_0x3dcab4,_0x3cff2b,_0x2f932b){return db[_0x0b02('0x3a')][_0x0b02('0x68')]({'where':{'id':_0x3dcab4['params']['id']}})[_0x0b02('0x32')](handleEntityNotFound(_0x3cff2b,null))[_0x0b02('0x32')](function(_0x26f679){if(_0x26f679){return db['sequelize'][_0x0b02('0xb2')](function(_0x125460){return db[_0x0b02('0x6b')]['destroy']({'where':{'SmsAccountId':_0x3dcab4[_0x0b02('0x55')]['id']},'transaction':_0x125460})['then'](function(_0x3ba3a9){var _0x28ee70=_['map'](_0x3dcab4[_0x0b02('0x59')],function(_0x2ed9a9){_0x2ed9a9[_0x0b02('0x61')]=_0x3dcab4[_0x0b02('0x55')]['id'];return _0x2ed9a9;});return db[_0x0b02('0x6b')][_0x0b02('0xb3')](_0x28ee70,{'transaction':_0x125460});});})['then'](function(){return db[_0x0b02('0x6b')]['findAndCountAll']({'where':{'SmsAccountId':_0x3dcab4[_0x0b02('0x55')]['id']},'order':_0x0b02('0x6e')});});}})[_0x0b02('0x32')](respondWithResult(_0x3cff2b,null))[_0x0b02('0x53')](handleError(_0x3cff2b,null));};exports['getApplications']=function(_0xfd4d4d,_0x4ee726,_0x1e26dc){var _0x3d3f3e={};var _0x559902={};var _0x15fe2e;var _0x12aae6;return db['SmsAccount']['findOne']({'where':{'id':_0xfd4d4d[_0x0b02('0x55')]['id']}})[_0x0b02('0x32')](handleEntityNotFound(_0x4ee726,null))['then'](function(_0x1a31ea){if(_0x1a31ea){_0x15fe2e=_0x1a31ea;_0x559902[_0x0b02('0x3d')]=_['keys'](db[_0x0b02('0x6b')][_0x0b02('0x3b')]);_0x559902[_0x0b02('0x3f')]=_[_0x0b02('0x3e')](_0xfd4d4d[_0x0b02('0x3f')]);_0x559902[_0x0b02('0x40')]=_['intersection'](_0x559902[_0x0b02('0x3d')],_0x559902['query']);_0x3d3f3e[_0x0b02('0x42')]=_[_0x0b02('0x41')](_0x559902['model'],qs[_0x0b02('0x43')](_0xfd4d4d['query']['fields']));_0x3d3f3e[_0x0b02('0x42')]=_0x3d3f3e[_0x0b02('0x42')][_0x0b02('0x56')]?_0x3d3f3e[_0x0b02('0x42')]:_0x559902['model'];_0x3d3f3e[_0x0b02('0x46')]=qs[_0x0b02('0x47')](_0xfd4d4d[_0x0b02('0x3f')][_0x0b02('0x47')]);_0x3d3f3e[_0x0b02('0x48')]=qs[_0x0b02('0x40')](_[_0x0b02('0x49')](_0xfd4d4d[_0x0b02('0x3f')],_0x559902['filters']));if(_0xfd4d4d[_0x0b02('0x3f')][_0x0b02('0x4d')]){_0x3d3f3e[_0x0b02('0x48')]=_[_0x0b02('0x4a')](_0x3d3f3e['where'],{'$or':_[_0x0b02('0x39')](_0x3d3f3e[_0x0b02('0x42')],function(_0x3ab56b){var _0x300cf2={};_0x300cf2[_0x3ab56b]={'$like':'%'+_0xfd4d4d[_0x0b02('0x3f')][_0x0b02('0x4d')]+'%'};return _0x300cf2;})});}_0x3d3f3e=_[_0x0b02('0x4a')]({},_0x3d3f3e,_0xfd4d4d[_0x0b02('0x4e')]);return _0x15fe2e[_0x0b02('0xb4')](_0x3d3f3e);}})[_0x0b02('0x32')](function(_0xa00833){if(_0xa00833){_0x12aae6=_0xa00833[_0x0b02('0x56')];if(!_0xfd4d4d[_0x0b02('0x3f')][_0x0b02('0x44')](_0x0b02('0x45'))){_0x3d3f3e[_0x0b02('0x2c')]=qs[_0x0b02('0x2c')](_0xfd4d4d['query'][_0x0b02('0x2c')]);_0x3d3f3e[_0x0b02('0x2d')]=qs[_0x0b02('0x2d')](_0xfd4d4d['query'][_0x0b02('0x2d')]);}return _0x15fe2e[_0x0b02('0xb4')](_0x3d3f3e);}})[_0x0b02('0x32')](function(_0x3331ff){if(_0x3331ff){return _0x3331ff?{'count':_0x12aae6,'rows':_0x3331ff}:null;}})[_0x0b02('0x32')](respondWithResult(_0x4ee726,null))[_0x0b02('0x53')](handleError(_0x4ee726,null));};exports[_0x0b02('0xb5')]=function(_0x56d35f,_0x2871e8,_0x5041ee){var _0x4dcd55={'raw':![],'where':{}};var _0x1507cd={};var _0x1701c1={'count':0x0,'rows':[]};return db[_0x0b02('0x3a')][_0x0b02('0x68')]({'where':{'id':_0x56d35f['params']['id']}})[_0x0b02('0x32')](handleEntityNotFound(_0x2871e8,null))['then'](function(_0x5728ef){if(_0x5728ef){_0x1507cd['model']=_[_0x0b02('0x3e')](db[_0x0b02('0x99')][_0x0b02('0x3b')]);_0x1507cd[_0x0b02('0x3f')]=_[_0x0b02('0x3e')](_0x56d35f[_0x0b02('0x3f')]);_0x1507cd[_0x0b02('0x40')]=_[_0x0b02('0x41')](_0x1507cd['model'],_0x1507cd[_0x0b02('0x3f')]);_0x4dcd55[_0x0b02('0x42')]=_[_0x0b02('0x41')](_0x1507cd['model'],qs[_0x0b02('0x43')](_0x56d35f['query'][_0x0b02('0x43')]));_0x4dcd55['attributes']=_0x4dcd55[_0x0b02('0x42')]['length']?_0x4dcd55[_0x0b02('0x42')]:_0x1507cd[_0x0b02('0x3d')];if(!_0x56d35f[_0x0b02('0x3f')][_0x0b02('0x44')](_0x0b02('0x45'))){_0x4dcd55[_0x0b02('0x2c')]=qs[_0x0b02('0x2c')](_0x56d35f[_0x0b02('0x3f')][_0x0b02('0x2c')]);_0x4dcd55[_0x0b02('0x2d')]=qs[_0x0b02('0x2d')](_0x56d35f[_0x0b02('0x3f')][_0x0b02('0x2d')]);}_0x4dcd55[_0x0b02('0x46')]=qs[_0x0b02('0x47')](_0x56d35f[_0x0b02('0x3f')][_0x0b02('0x47')]);_0x4dcd55[_0x0b02('0x48')]=qs[_0x0b02('0x40')](_[_0x0b02('0x49')](_0x56d35f[_0x0b02('0x3f')],_0x1507cd[_0x0b02('0x40')]));_0x4dcd55[_0x0b02('0x48')][_0x0b02('0x61')]=_0x5728ef['id'];if(_0x56d35f['query'][_0x0b02('0x4d')]){_0x4dcd55[_0x0b02('0x48')]=_[_0x0b02('0x4a')](_0x4dcd55[_0x0b02('0x48')],{'$or':_[_0x0b02('0x39')](_0x4dcd55[_0x0b02('0x42')],function(_0x387701){var _0x53ce33={};_0x53ce33[_0x387701]={'$like':'%'+_0x56d35f[_0x0b02('0x3f')]['filter']+'%'};return _0x53ce33;})});}_0x4dcd55=_[_0x0b02('0x4a')]({},_0x4dcd55,_0x56d35f['options']);return db[_0x0b02('0x99')][_0x0b02('0x63')]({'where':_0x4dcd55[_0x0b02('0x48')]})['then'](function(_0x570019){_0x1701c1[_0x0b02('0x63')]=_0x570019;if(_0x56d35f[_0x0b02('0x3f')]['includeAll']){_0x4dcd55[_0x0b02('0x50')]=[{'model':db[_0x0b02('0x70')],'as':_0x0b02('0xb6'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x0b02('0xa7'),_0x0b02('0xb7'),_0x0b02('0xb8')],'required':![]},{'model':db[_0x0b02('0xb9')],'as':_0x0b02('0xba'),'attributes':['id',_0x0b02('0xa7'),_0x0b02('0xbb')],'where':_0x56d35f[_0x0b02('0x3f')][_0x0b02('0xbc')]?{'id':_0x56d35f[_0x0b02('0x3f')][_0x0b02('0xbc')]}:undefined,'required':_0x56d35f[_0x0b02('0x3f')]['tag']?!![]:![]}];}return db[_0x0b02('0x99')][_0x0b02('0x51')](_0x4dcd55);})[_0x0b02('0x32')](function(_0x1d9a7b){_0x1701c1[_0x0b02('0x52')]=_0x1d9a7b;return _0x1701c1;});}})[_0x0b02('0x32')](respondWithFilteredResult(_0x2871e8,_0x4dcd55))[_0x0b02('0x53')](handleError(_0x2871e8,null));};exports[_0x0b02('0xb0')]=function(_0x26574c,_0x5dec65,_0x50a41d){var _0x1e1dca,_0xc55a0f,_0x5b2b3e;if(_[_0x0b02('0x8c')](_0x26574c[_0x0b02('0x59')]['body'])||_0x26574c[_0x0b02('0x59')][_0x0b02('0x59')]===''){throw new db[(_0x0b02('0x71'))]['ValidationError'](_0x0b02('0x8e'));}if(_[_0x0b02('0x8c')](_0x26574c[_0x0b02('0x59')]['to'])){throw new db[(_0x0b02('0x71'))]['ValidationError'](_0x0b02('0xbd'));}_0x1e1dca=_0x26574c[_0x0b02('0x59')]['to'];return db[_0x0b02('0x3a')][_0x0b02('0x57')]({'where':{'id':_0x26574c['params']['id']},'include':[{'model':db[_0x0b02('0x93')],'as':_0x0b02('0xbe'),'include':[{'model':db[_0x0b02('0x70')],'as':_0x0b02('0x97'),'where':{'mobile':_0x1e1dca},'limit':0x1,'order':[[_0x0b02('0x75'),_0x0b02('0x94')]]}]}]})[_0x0b02('0x32')](handleEntityNotFound(_0x5dec65,null))['then'](function(_0x35c8d8){if(_0x35c8d8&&_0x35c8d8[_0x0b02('0xbe')]){_0xc55a0f=_0x35c8d8[_0x0b02('0x5b')]({'plain':!![]});if(_0xc55a0f[_0x0b02('0xbe')]&&_0xc55a0f['List']['Contacts']['length']){return _0xc55a0f[_0x0b02('0xbe')][_0x0b02('0x97')][0x0];}return db[_0x0b02('0x70')][_0x0b02('0x58')](_[_0x0b02('0x18')](_0x26574c['body'],{'firstName':_0x1e1dca,'mobile':_0x1e1dca,'phone':_0x1e1dca,'ListId':_0xc55a0f[_0x0b02('0x77')]}));}})[_0x0b02('0x32')](handleEntityNotFound(_0x5dec65,null))[_0x0b02('0x32')](function(_0x16a9c0){if(_0x16a9c0){_0x5b2b3e=_0x16a9c0;return db[_0x0b02('0x99')]['find']({'where':{'ContactId':_0x5b2b3e['id'],'closed':![],'SmsAccountId':_0xc55a0f['id']}})[_0x0b02('0x32')](function(_0x5145a4){if(_0x5145a4){return[_0x5145a4,![]];}return db[_0x0b02('0x99')][_0x0b02('0x58')]({'UserId':_0x26574c[_0x0b02('0x5a')]['id'],'ContactId':_0x5b2b3e['id'],'SmsAccountId':_0xc55a0f['id'],'phone':_0x1e1dca,'firstMsgDirection':_0x0b02('0xbf'),'Messages':[_[_0x0b02('0x4a')](_0x26574c['body'],{'read':![],'body':_0x26574c[_0x0b02('0x59')]['body'],'phone':_0x1e1dca,'SmsAccountId':_0xc55a0f['id'],'UserId':_0x26574c[_0x0b02('0x5a')]['id'],'ContactId':_0x5b2b3e['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x0b02('0xc0')}]})['then'](function(_0x3cc4b8){return[_0x3cc4b8,!![]];});});}})['spread'](function(_0x3f91e6,_0x29c907){if(_0x29c907){return _0x3f91e6;}return db[_0x0b02('0xc1')][_0x0b02('0x58')](_[_0x0b02('0x4a')](_0x26574c[_0x0b02('0x59')],{'read':![],'body':_0x26574c[_0x0b02('0x59')]['body'],'phone':_0x1e1dca,'SmsAccountId':_0xc55a0f['id'],'SmsInteractionId':_0x3f91e6['id'],'UserId':_0x26574c[_0x0b02('0x5a')]['id'],'ContactId':_0x5b2b3e['id']}))[_0x0b02('0x32')](function(_0x22c3b7){_0x3f91e6[_0x0b02('0xc2')][_0x0b02('0xc0')]=[];_0x3f91e6[_0x0b02('0xc2')][_0x0b02('0xc0')][_0x0b02('0x9f')](_0x22c3b7['dataValues']);return _0x3f91e6;});})['then'](respondWithResult(_0x5dec65,null))[_0x0b02('0x53')](handleError(_0x5dec65,null));};exports[_0x0b02('0x29')]=function(_0x1571da,_0x56cf5c,_0x2c9fe6){if(_0x1571da[_0x0b02('0x59')]['id']){delete _0x1571da[_0x0b02('0x59')]['id'];}var _0x3b6506,_0x30f7a9,_0x17e2bb;return db[_0x0b02('0x3a')]['find']({'where':{'id':_0x1571da[_0x0b02('0x55')]['id']}})['then'](handleEntityNotFound(_0x56cf5c,null))['then'](function(_0x256c4b){if(_0x256c4b){_0x17e2bb=_0x256c4b;logger[_0x0b02('0x22')](_0x0b02('0x23'),_0x0b02('0x29'),_0x0b02('0xc3'),_0x256c4b[_0x0b02('0x4b')],util[_0x0b02('0xc4')](_0x1571da['body'],{'showHidden':![],'depth':null}));switch(_0x256c4b[_0x0b02('0x4b')]){case _0x0b02('0x7d'):if(_0x1571da[_0x0b02('0x59')][_0x0b02('0xc5')]&&_0x1571da['body'][_0x0b02('0x29')]){_0x30f7a9=_0x1571da['body'][_0x0b02('0x29')];return db[_0x0b02('0xc1')][_0x0b02('0x57')]({'where':{'messageId':_0x1571da[_0x0b02('0x59')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x1571da[_0x0b02('0x59')][_0x0b02('0xc6')]&&_0x1571da['body'][_0x0b02('0xc7')]){_0x30f7a9=_0x1571da[_0x0b02('0x59')]['statusInt'];return db[_0x0b02('0xc1')][_0x0b02('0x57')]({'where':{'messageId':_0x1571da[_0x0b02('0x59')][_0x0b02('0xc6')]}});}break;case'clicksend':if(_0x1571da['body'][_0x0b02('0xc8')]&&_0x1571da['body'][_0x0b02('0xc9')]){_0x30f7a9=_0x1571da[_0x0b02('0x59')]['status_code'];return db[_0x0b02('0xc1')][_0x0b02('0x57')]({'where':{'messageId':_0x1571da[_0x0b02('0x59')]['message_id']}});}break;case _0x0b02('0x84'):var _0x204afc=_0x1571da[_0x0b02('0x59')]['results'][0x0];if(_0x204afc[_0x0b02('0x7b')]&&_0x204afc['status'][_0x0b02('0xca')]===_0x0b02('0xcb')){_0x30f7a9=_0x204afc[_0x0b02('0x29')][_0x0b02('0xca')];return db[_0x0b02('0xc1')][_0x0b02('0x57')]({'where':{'messageId':_0x204afc['messageId']}});}break;case _0x0b02('0xcc'):if(_0x1571da['body']['messageId']&&_0x1571da[_0x0b02('0x59')][_0x0b02('0x29')]){_0x30f7a9=_0x1571da['body'][_0x0b02('0x29')];return db['SmsMessage'][_0x0b02('0x57')]({'where':{'messageId':_0x1571da[_0x0b02('0x59')][_0x0b02('0x7b')]}});}break;case'bandwidth':if(_0x1571da[_0x0b02('0x59')][0x0][_0x0b02('0x26')]['id']){_0x30f7a9=_0x1571da[_0x0b02('0x59')][0x0][_0x0b02('0x4b')];return db['SmsMessage'][_0x0b02('0x57')]({'where':{'messageId':_0x1571da[_0x0b02('0x59')][0x0]['message']['id']}});}break;case'intelepeer':if(_0x1571da[_0x0b02('0x59')][_0x0b02('0xcd')]&&_0x1571da[_0x0b02('0x59')][_0x0b02('0x29')]){_0x30f7a9=_0x1571da['body'][_0x0b02('0x29')];return db[_0x0b02('0xc1')][_0x0b02('0x57')]({'where':{'messageId':_0x1571da[_0x0b02('0x59')][_0x0b02('0xcd')]}});}break;}}})['then'](handleEntityNotFound(_0x56cf5c,null))[_0x0b02('0x32')](function(_0x51e405){if(_0x51e405){_0x3b6506=_0x51e405;switch(_0x17e2bb[_0x0b02('0x4b')]){case _0x0b02('0x7d'):if(_0x30f7a9===_0x0b02('0xcb')){return _0x3b6506[_0x0b02('0x31')]({'read':!![]});}else{logger[_0x0b02('0x25')](_0x0b02('0x23'),_0x0b02('0x29'),'skebby',util[_0x0b02('0xc4')](_0x1571da[_0x0b02('0x59')],{'showHidden':![],'depth':null}));}break;case _0x0b02('0xce'):if(_0x30f7a9==='1'){return _0x3b6506[_0x0b02('0x31')]({'read':!![]});}else{logger[_0x0b02('0x25')](_0x0b02('0x23'),_0x0b02('0x29'),'skebby',util[_0x0b02('0xc4')](_0x1571da[_0x0b02('0x59')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x1571da[_0x0b02('0x59')]['error_code']&&_0x30f7a9>=0xc8&&_0x30f7a9<=0xce){return _0x3b6506['update']({'read':!![]});}else{logger['error'](_0x0b02('0x23'),_0x0b02('0x29'),_0x0b02('0x80'),util[_0x0b02('0xc4')](_0x1571da[_0x0b02('0x59')],{'showHidden':![],'depth':null}));}break;case _0x0b02('0x84'):var _0x1541c2=_0x1571da[_0x0b02('0x59')][_0x0b02('0x85')][0x0];if(_0x1541c2[_0x0b02('0x29')][_0x0b02('0xca')]==='DELIVERED'){return _0x3b6506[_0x0b02('0x31')]({'read':!![]});}else{logger[_0x0b02('0x25')](_0x0b02('0x23'),_0x0b02('0x29'),_0x0b02('0x84'),util[_0x0b02('0xc4')](_0x1571da[_0x0b02('0x59')],{'showHidden':![],'depth':null}));}break;case _0x0b02('0xcc'):if(_0x30f7a9=='DELIVERED_TO_GATEWAY'||_0x30f7a9==_0x0b02('0xcf')){return _0x3b6506['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x0b02('0xcc'),util['inspect'](_0x1571da[_0x0b02('0x59')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x30f7a9==_0x0b02('0xd0')){return _0x3b6506['update']({'read':!![]});}else{logger['error'](_0x0b02('0x23'),_0x0b02('0x29'),_0x0b02('0x89'),util[_0x0b02('0xc4')](_0x1571da['body'],{'showHidden':![],'depth':null}));}break;case _0x0b02('0x8a'):if(_0x30f7a9==='DELIVRD'||_0x30f7a9===_0x0b02('0xd1')){return _0x3b6506[_0x0b02('0x31')]({'read':!![]});}else{logger['error'](_0x0b02('0x23'),_0x0b02('0x29'),'intelepeer',util['inspect'](_0x1571da[_0x0b02('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x3b6506;}})[_0x0b02('0x32')](respondWithResult(_0x56cf5c,null))['catch'](handleError(_0x56cf5c,null));};exports[_0x0b02('0xd2')]=function(_0x5f3a82,_0x153794,_0x41c4d6){var _0xf35273,_0x2c6775,_0x519e62;return db[_0x0b02('0x3a')][_0x0b02('0x57')]({'where':{'id':_0x5f3a82[_0x0b02('0x55')]['id']}})[_0x0b02('0x32')](handleEntityNotFound(_0x153794,null))['then'](function(_0x32138a){if(_0x32138a){_0x519e62=_0x32138a;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0b02('0x29'),_0x0b02('0xc3'),_0x32138a['type'],util['inspect'](_0x5f3a82['query'],{'showHidden':![],'depth':null}));switch(_0x32138a[_0x0b02('0x4b')]){case _0x0b02('0x86'):if(_0x5f3a82[_0x0b02('0x3f')][_0x0b02('0xd3')]&&_0x5f3a82['query']['state']){_0x2c6775=_0x5f3a82[_0x0b02('0x3f')]['state'];return db['SmsMessage']['find']({'where':{'messageId':_0x5f3a82['query'][_0x0b02('0xd3')]}});}break;}}})[_0x0b02('0x32')](handleEntityNotFound(_0x153794,null))[_0x0b02('0x32')](function(_0x59f646){if(_0x59f646){_0xf35273=_0x59f646;switch(_0x519e62[_0x0b02('0x4b')]){case _0x0b02('0x86'):if(_0x2c6775==='2'||_0x2c6775==='6'){return _0xf35273[_0x0b02('0x31')]({'read':!![]});}else{logger[_0x0b02('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','csc',util[_0x0b02('0xc4')](_0x5f3a82[_0x0b02('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0xf35273;}})[_0x0b02('0x32')](respondWithResult(_0x153794,null))[_0x0b02('0x53')](handleError(_0x153794,null));};exports[_0x0b02('0xd4')]=function(_0x1aad83,_0xd3c400,_0x1ae413){return db[_0x0b02('0x3a')][_0x0b02('0x57')]({'where':{'id':_0x1aad83[_0x0b02('0x55')]['id']}})[_0x0b02('0x32')](handleEntityNotFound(_0xd3c400,null))[_0x0b02('0x32')](function(_0x562d3c){if(_0x562d3c){return _0x562d3c['addAgents'](_0x1aad83[_0x0b02('0x59')][_0x0b02('0x65')],_['omit'](_0x1aad83[_0x0b02('0x59')],[_0x0b02('0x65'),'id'])||{})['spread'](function(_0x37bb12){for(var _0x32cfad=0x0;_0x32cfad<_0x1aad83['body']['ids'][_0x0b02('0x56')];_0x32cfad+=0x1){socket[_0x0b02('0xd5')](_0x0b02('0xd6'),{'UserId':Number(_0x1aad83[_0x0b02('0x59')][_0x0b02('0x65')][_0x32cfad]),'SmsAccountId':Number(_0x1aad83[_0x0b02('0x55')]['id'])});}return _0x37bb12;});}})[_0x0b02('0x32')](respondWithResult(_0xd3c400,null))[_0x0b02('0x53')](handleError(_0xd3c400,null));};exports[_0x0b02('0xd7')]=function(_0x1e8fe6,_0x157d72,_0x4d5517){return db[_0x0b02('0x3a')][_0x0b02('0x57')]({'where':{'id':_0x1e8fe6[_0x0b02('0x55')]['id']}})[_0x0b02('0x32')](handleEntityNotFound(_0x157d72,null))['then'](function(_0x450dce){if(_0x450dce){return _0x450dce['removeAgents'](_0x1e8fe6[_0x0b02('0x3f')][_0x0b02('0x65')])[_0x0b02('0x32')](function(){if(_[_0x0b02('0xd8')](_0x1e8fe6[_0x0b02('0x3f')]['ids'])){for(var _0x29c454=0x0;_0x29c454<_0x1e8fe6[_0x0b02('0x3f')][_0x0b02('0x65')][_0x0b02('0x56')];_0x29c454+=0x1){socket[_0x0b02('0xd5')](_0x0b02('0xd9'),{'UserId':Number(_0x1e8fe6[_0x0b02('0x3f')][_0x0b02('0x65')][_0x29c454]),'SmsAccountId':Number(_0x1e8fe6['params']['id'])});}}else{socket['emit'](_0x0b02('0xd9'),{'UserId':Number(_0x1e8fe6[_0x0b02('0x3f')][_0x0b02('0x65')]),'SmsAccountId':Number(_0x1e8fe6[_0x0b02('0x55')]['id'])});}});}})[_0x0b02('0x32')](respondWithStatusCode(_0x157d72,null))[_0x0b02('0x53')](handleError(_0x157d72,null));};exports['getAgents']=function(_0x65f477,_0x10e76a,_0x42b7c5){var _0x316b54={};var _0x202b3f={};var _0x2fabc3;var _0x1803c7;return db['SmsAccount'][_0x0b02('0x68')]({'where':{'id':_0x65f477[_0x0b02('0x55')]['id']}})[_0x0b02('0x32')](handleEntityNotFound(_0x10e76a,null))[_0x0b02('0x32')](function(_0x31a6df){if(_0x31a6df){_0x2fabc3=_0x31a6df;_0x202b3f[_0x0b02('0x3d')]=_[_0x0b02('0x3e')](db[_0x0b02('0xa6')][_0x0b02('0x3b')]);_0x202b3f[_0x0b02('0x3f')]=_[_0x0b02('0x3e')](_0x65f477[_0x0b02('0x3f')]);_0x202b3f[_0x0b02('0x40')]=_[_0x0b02('0x41')](_0x202b3f[_0x0b02('0x3d')],_0x202b3f[_0x0b02('0x3f')]);_0x316b54[_0x0b02('0x42')]=_[_0x0b02('0x41')](_0x202b3f[_0x0b02('0x3d')],qs['fields'](_0x65f477[_0x0b02('0x3f')]['fields']));_0x316b54[_0x0b02('0x42')]=_0x316b54['attributes']['length']?_0x316b54['attributes']:_0x202b3f[_0x0b02('0x3d')];_0x316b54[_0x0b02('0x46')]=qs[_0x0b02('0x47')](_0x65f477[_0x0b02('0x3f')]['sort']);_0x316b54['where']=qs['filters'](_['pick'](_0x65f477[_0x0b02('0x3f')],_0x202b3f[_0x0b02('0x40')]));if(_0x65f477[_0x0b02('0x3f')][_0x0b02('0x4d')]){_0x316b54[_0x0b02('0x48')]=_[_0x0b02('0x4a')](_0x316b54[_0x0b02('0x48')],{'$or':_['map'](_0x316b54[_0x0b02('0x42')],function(_0x1150a1){var _0x47d131={};_0x47d131[_0x1150a1]={'$like':'%'+_0x65f477['query'][_0x0b02('0x4d')]+'%'};return _0x47d131;})});}_0x316b54=_['merge']({},_0x316b54,_0x65f477[_0x0b02('0x4e')]);return _0x2fabc3[_0x0b02('0xda')](_0x316b54);}})[_0x0b02('0x32')](function(_0xd53b9f){if(_0xd53b9f){_0x1803c7=_0xd53b9f[_0x0b02('0x56')];if(!_0x65f477[_0x0b02('0x3f')][_0x0b02('0x44')](_0x0b02('0x45'))){_0x316b54['limit']=qs['limit'](_0x65f477['query']['limit']);_0x316b54[_0x0b02('0x2d')]=qs[_0x0b02('0x2d')](_0x65f477[_0x0b02('0x3f')][_0x0b02('0x2d')]);}return _0x2fabc3[_0x0b02('0xda')](_0x316b54);}})[_0x0b02('0x32')](function(_0x323be6){if(_0x323be6){return _0x323be6?{'count':_0x1803c7,'rows':_0x323be6}:null;}})[_0x0b02('0x32')](respondWithResult(_0x10e76a,null))[_0x0b02('0x53')](handleError(_0x10e76a,null));}; \ No newline at end of file +var _0x3320=['api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','status','json','offset','undefined','limit','count','set','Content-Range','destroy','get','SmsAccounts','UserProfileResource','end','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','fields','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','getDispositions','findOne','Disposition','order','SmsAccountId','rows','removeDispositions','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','applications','orderBy','priority','asc','account','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','sender','connectel','Text','results','text','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','Sequelize','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','list','omit','Contacts','defaults','CmContact','contact','SmsInteraction','interaction','created','autoclose','close','SmsMessage','AttachmentId','UserId','User','agent','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','text/xml','\x0a','sequelize','transaction','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','List','DESC','Messages','spread','dataValues','push','skebby','skebby_dispatch_id','statusInt','requestid','clicksend','message_id','infobip','redif','DELIVERED','inspect','error_code','groupName','DELIVERED_TO_GATEWAY','message-delivered','bandwidth','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','state','message-id','addAgents','ids','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','ejs','fs-extra','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3cde36,_0x1fd3c9){var _0x5c99bf=function(_0x53e265){while(--_0x53e265){_0x3cde36['push'](_0x3cde36['shift']());}};_0x5c99bf(++_0x1fd3c9);}(_0x3320,0xc8));var _0x0332=function(_0x335f08,_0x1cc873){_0x335f08=_0x335f08-0x0;var _0x2b4f92=_0x3320[_0x335f08];return _0x2b4f92;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0332('0x0'));var zipdir=require(_0x0332('0x1'));var jsonpatch=require(_0x0332('0x2'));var rp=require(_0x0332('0x3'));var moment=require(_0x0332('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0332('0x5'));var sox=require('sox');var csv=require(_0x0332('0x6'));var ejs=require(_0x0332('0x7'));var fs=require('fs');var fs_extra=require(_0x0332('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0332('0x9'));var deskjs=require(_0x0332('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0332('0xb'));var authService=require(_0x0332('0xc'));var qs=require(_0x0332('0xd'));var as=require(_0x0332('0xe'));var hardwareService=require(_0x0332('0xf'));var logger=require(_0x0332('0x10'))(_0x0332('0x11'));var utils=require(_0x0332('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x0332('0x13'));var db=require('../../mysqldb')['db'];config[_0x0332('0x14')]=_['defaults'](config[_0x0332('0x14')],{'host':_0x0332('0x15'),'port':0x18eb});var socket=require(_0x0332('0x16'))(new Redis(config[_0x0332('0x14')]));require(_0x0332('0x17'))[_0x0332('0x18')](socket);var jayson=require(_0x0332('0x19'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1c6759,_0x14cd26,_0x3820cd,_0x32ee77){return new BPromise(function(_0x315aaf,_0x528675){var _0x14e1b4=_0x32ee77||client;return _0x14e1b4[_0x0332('0x1a')](_0x1c6759,_0x3820cd)[_0x0332('0x1b')](function(_0x294c9f){logger['info'](_0x0332('0x1c'),_0x14cd26,_0x0332('0x1d'));logger[_0x0332('0x1e')](_0x0332('0x1f'),_0x14cd26,_0x0332('0x1d'),JSON['stringify'](_0x294c9f));if(_0x294c9f[_0x0332('0x20')]){if(_0x294c9f[_0x0332('0x20')][_0x0332('0x21')]===0x1f4){logger['error'](_0x0332('0x1c'),_0x14cd26,_0x294c9f[_0x0332('0x20')]['message']);return _0x528675(_0x294c9f[_0x0332('0x20')][_0x0332('0x22')]);}logger[_0x0332('0x20')](_0x0332('0x1c'),_0x14cd26,_0x294c9f[_0x0332('0x20')][_0x0332('0x22')]);return _0x315aaf(_0x294c9f[_0x0332('0x20')]['message']);}else{logger[_0x0332('0x23')](_0x0332('0x1c'),_0x14cd26,_0x0332('0x1d'));_0x315aaf(_0x294c9f[_0x0332('0x24')][_0x0332('0x22')]);}})['catch'](function(_0x2ede27){logger[_0x0332('0x20')](_0x0332('0x1c'),_0x14cd26,_0x2ede27);_0x528675(_0x2ede27);});});}function respondWithStatusCode(_0x3b56f2,_0x3ca910){_0x3ca910=_0x3ca910||0xcc;return function(_0x2ac98e){if(_0x2ac98e){return _0x3b56f2['sendStatus'](_0x3ca910);}return _0x3b56f2[_0x0332('0x25')](_0x3ca910)['end']();};}function respondWithResult(_0x17dd97,_0x8059a8){_0x8059a8=_0x8059a8||0xc8;return function(_0x262a9f){if(_0x262a9f){return _0x17dd97['status'](_0x8059a8)[_0x0332('0x26')](_0x262a9f);}};}function respondWithFilteredResult(_0x264430,_0x509099){return function(_0x1dd315){if(_0x1dd315){var _0x44ef17=typeof _0x509099[_0x0332('0x27')]===_0x0332('0x28')&&typeof _0x509099[_0x0332('0x29')]===_0x0332('0x28');var _0x16b181=_0x1dd315[_0x0332('0x2a')];var _0x15b8dc=_0x44ef17?0x0:_0x509099[_0x0332('0x27')];var _0x137577=_0x44ef17?_0x1dd315['count']:_0x509099[_0x0332('0x27')]+_0x509099[_0x0332('0x29')];var _0x3f4640;if(_0x137577>=_0x16b181){_0x137577=_0x16b181;_0x3f4640=0xc8;}else{_0x3f4640=0xce;}_0x264430[_0x0332('0x25')](_0x3f4640);return _0x264430[_0x0332('0x2b')](_0x0332('0x2c'),_0x15b8dc+'-'+_0x137577+'/'+_0x16b181)['json'](_0x1dd315);}return null;};}function patchUpdates(_0x38f4f0){return function(_0x33abd2){try{jsonpatch['apply'](_0x33abd2,_0x38f4f0,!![]);}catch(_0x225eb9){return BPromise['reject'](_0x225eb9);}return _0x33abd2['save']();};}function saveUpdates(_0x204795,_0x5972e0){return function(_0x120743){if(_0x120743){return _0x120743['update'](_0x204795)[_0x0332('0x1b')](function(_0x5cab39){return _0x5cab39;});}return null;};}function removeEntity(_0x292e15,_0x315874){return function(_0xb3e5f7){if(_0xb3e5f7){return _0xb3e5f7[_0x0332('0x2d')]()[_0x0332('0x1b')](function(){var _0x41b3f5=_0xb3e5f7[_0x0332('0x2e')]({'plain':!![]});var _0x561d91=_0x0332('0x2f');return db[_0x0332('0x30')][_0x0332('0x2d')]({'where':{'type':_0x561d91,'resourceId':_0x41b3f5['id']}})[_0x0332('0x1b')](function(){return _0xb3e5f7;});})['then'](function(){_0x292e15[_0x0332('0x25')](0xcc)[_0x0332('0x31')]();});}};}function handleEntityNotFound(_0x1140d4,_0x1b0cd7){return function(_0x27c5fb){if(!_0x27c5fb){_0x1140d4[_0x0332('0x32')](0x194);}return _0x27c5fb;};}function handleError(_0x25379e,_0x303e3d){_0x303e3d=_0x303e3d||0x1f4;return function(_0x12325d){logger[_0x0332('0x20')](_0x12325d[_0x0332('0x33')]);if(_0x12325d['name']){delete _0x12325d[_0x0332('0x34')];}_0x25379e[_0x0332('0x25')](_0x303e3d)[_0x0332('0x35')](_0x12325d);};}exports['index']=function(_0x73cf69,_0x48e07a){var _0x545c42={'include':[{'model':db[_0x0332('0x36')],'as':_0x0332('0x37')}]},_0x3fde1f={},_0x193096={'count':0x0,'rows':[]};var _0x39301e=_[_0x0332('0x38')](db[_0x0332('0x39')][_0x0332('0x3a')],function(_0x271849){return{'name':_0x271849['fieldName'],'type':_0x271849['type'][_0x0332('0x3b')]};});_0x3fde1f[_0x0332('0x3c')]=_[_0x0332('0x38')](_0x39301e,_0x0332('0x34'));_0x3fde1f[_0x0332('0x3d')]=_[_0x0332('0x3e')](_0x73cf69[_0x0332('0x3d')]);_0x3fde1f[_0x0332('0x3f')]=_[_0x0332('0x40')](_0x3fde1f[_0x0332('0x3c')],_0x3fde1f[_0x0332('0x3d')]);_0x545c42[_0x0332('0x41')]=_[_0x0332('0x40')](_0x3fde1f[_0x0332('0x3c')],qs['fields'](_0x73cf69['query']['fields']));_0x545c42[_0x0332('0x41')]=_0x545c42['attributes'][_0x0332('0x42')]?_0x545c42[_0x0332('0x41')]:_0x3fde1f['model'];if(!_0x73cf69[_0x0332('0x3d')][_0x0332('0x43')](_0x0332('0x44'))){_0x545c42[_0x0332('0x29')]=qs[_0x0332('0x29')](_0x73cf69[_0x0332('0x3d')][_0x0332('0x29')]);_0x545c42['offset']=qs['offset'](_0x73cf69[_0x0332('0x3d')][_0x0332('0x27')]);}_0x545c42['order']=qs['sort'](_0x73cf69[_0x0332('0x3d')][_0x0332('0x45')]);_0x545c42['where']=qs[_0x0332('0x3f')](_[_0x0332('0x46')](_0x73cf69[_0x0332('0x3d')],_0x3fde1f[_0x0332('0x3f')]),_0x39301e);if(_0x73cf69[_0x0332('0x3d')][_0x0332('0x47')]){_0x545c42['where']=_['merge'](_0x545c42[_0x0332('0x48')],{'$or':_[_0x0332('0x38')](_0x39301e,function(_0xe111da){if(_0xe111da[_0x0332('0x49')]!==_0x0332('0x4a')){var _0x24730b={};_0x24730b[_0xe111da[_0x0332('0x34')]]={'$like':'%'+_0x73cf69['query'][_0x0332('0x47')]+'%'};return _0x24730b;}})});}_0x545c42=_[_0x0332('0x4b')]({},_0x545c42,_0x73cf69[_0x0332('0x4c')]);var _0x374098={'where':_0x545c42[_0x0332('0x48')]};return db[_0x0332('0x39')]['count'](_0x374098)['then'](function(_0x556a6f){_0x193096['count']=_0x556a6f;if(_0x73cf69[_0x0332('0x3d')][_0x0332('0x4d')]){_0x545c42['include']=[{'all':!![]}];}return db[_0x0332('0x39')][_0x0332('0x4e')](_0x545c42);})['then'](function(_0x2d2e96){_0x193096['rows']=_0x2d2e96;return _0x193096;})[_0x0332('0x1b')](respondWithFilteredResult(_0x48e07a,_0x545c42))[_0x0332('0x4f')](handleError(_0x48e07a,null));};exports[_0x0332('0x50')]=function(_0x4ef987,_0x2f67ce){var _0x436c8f={'raw':![],'where':{'id':_0x4ef987[_0x0332('0x51')]['id']},'include':[{'model':db['Pause'],'as':_0x0332('0x37')}]},_0x16ac3d={};_0x16ac3d[_0x0332('0x3c')]=_[_0x0332('0x3e')](db[_0x0332('0x39')][_0x0332('0x3a')]);_0x16ac3d[_0x0332('0x3d')]=_[_0x0332('0x3e')](_0x4ef987[_0x0332('0x3d')]);_0x16ac3d[_0x0332('0x3f')]=_[_0x0332('0x40')](_0x16ac3d['model'],_0x16ac3d['query']);_0x436c8f[_0x0332('0x41')]=_['intersection'](_0x16ac3d[_0x0332('0x3c')],qs[_0x0332('0x52')](_0x4ef987[_0x0332('0x3d')][_0x0332('0x52')]));_0x436c8f[_0x0332('0x41')]=_0x436c8f['attributes'][_0x0332('0x42')]?_0x436c8f[_0x0332('0x41')]:_0x16ac3d[_0x0332('0x3c')];if(_0x4ef987[_0x0332('0x3d')][_0x0332('0x4d')]){_0x436c8f[_0x0332('0x53')]=[{'all':!![]}];}_0x436c8f=_[_0x0332('0x4b')]({},_0x436c8f,_0x4ef987[_0x0332('0x4c')]);return db[_0x0332('0x39')]['find'](_0x436c8f)[_0x0332('0x1b')](handleEntityNotFound(_0x2f67ce,null))[_0x0332('0x1b')](respondWithResult(_0x2f67ce,null))[_0x0332('0x4f')](handleError(_0x2f67ce,null));};exports[_0x0332('0x54')]=function(_0x1ae8a3,_0x26753d){return db[_0x0332('0x39')][_0x0332('0x54')](_0x1ae8a3[_0x0332('0x55')],{})['then'](function(_0x113f46){var _0x8fa72a=_0x1ae8a3['user'][_0x0332('0x2e')]({'plain':!![]});if(!_0x8fa72a)throw new Error(_0x0332('0x56'));if(_0x8fa72a[_0x0332('0x57')]===_0x0332('0x58')){var _0x479492=_0x113f46['get']({'plain':!![]});var _0x15fe4e=_0x0332('0x2f');return db['UserProfileSection'][_0x0332('0x59')]({'where':{'name':_0x15fe4e,'userProfileId':_0x8fa72a[_0x0332('0x5a')]},'raw':!![]})['then'](function(_0x2dffc4){if(_0x2dffc4&&_0x2dffc4[_0x0332('0x5b')]===0x0){return db[_0x0332('0x30')]['create']({'name':_0x479492[_0x0332('0x34')],'resourceId':_0x479492['id'],'type':_0x2dffc4['name'],'sectionId':_0x2dffc4['id']},{})['then'](function(){return _0x113f46;});}else{return _0x113f46;}})[_0x0332('0x4f')](function(_0x11c27c){logger[_0x0332('0x20')](_0x0332('0x5c'),_0x11c27c);throw _0x11c27c;});}return _0x113f46;})['then'](respondWithResult(_0x26753d,0xc9))[_0x0332('0x4f')](handleError(_0x26753d,null));};exports[_0x0332('0x5d')]=function(_0x3c8165,_0x2368ee){if(_0x3c8165[_0x0332('0x55')]['id']){delete _0x3c8165[_0x0332('0x55')]['id'];}return db[_0x0332('0x39')][_0x0332('0x59')]({'where':{'id':_0x3c8165[_0x0332('0x51')]['id']},'include':[{'model':db[_0x0332('0x36')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x2368ee,null))[_0x0332('0x1b')](saveUpdates(_0x3c8165[_0x0332('0x55')],null))[_0x0332('0x1b')](respondWithResult(_0x2368ee,null))[_0x0332('0x4f')](handleError(_0x2368ee,null));};exports[_0x0332('0x2d')]=function(_0x18f4a1,_0x2b588f){return db[_0x0332('0x39')]['find']({'where':{'id':_0x18f4a1[_0x0332('0x51')]['id']}})['then'](handleEntityNotFound(_0x2b588f,null))['then'](removeEntity(_0x2b588f,null))[_0x0332('0x4f')](handleError(_0x2b588f,null));};exports[_0x0332('0x5e')]=function(_0x5e34f7,_0x3290ff){return db[_0x0332('0x39')][_0x0332('0x5e')]()[_0x0332('0x1b')](respondWithResult(_0x3290ff,null))[_0x0332('0x4f')](handleError(_0x3290ff,null));};exports[_0x0332('0x5f')]=function(_0x4ee255,_0x56d820,_0x2adefd){if(_0x4ee255[_0x0332('0x55')]['id']){delete _0x4ee255[_0x0332('0x55')]['id'];}return db['SmsAccount'][_0x0332('0x59')]({'where':{'id':_0x4ee255['params']['id']}})[_0x0332('0x1b')](handleEntityNotFound(_0x56d820,null))[_0x0332('0x1b')](function(_0x4ff431){if(_0x4ff431){_0x4ee255[_0x0332('0x55')]['SmsAccountId']=_0x4ff431['id'];return db['Disposition'][_0x0332('0x54')](_0x4ee255[_0x0332('0x55')]);}})[_0x0332('0x1b')](respondWithResult(_0x56d820,null))[_0x0332('0x4f')](handleError(_0x56d820,null));};exports[_0x0332('0x60')]=function(_0x575181,_0xfc12cb,_0x3085db){var _0x4d13f8={'raw':![],'where':{}};var _0x52bd4f={};var _0x8a9835={'count':0x0,'rows':[]};return db[_0x0332('0x39')][_0x0332('0x61')]({'where':{'id':_0x575181[_0x0332('0x51')]['id']}})[_0x0332('0x1b')](handleEntityNotFound(_0xfc12cb,null))['then'](function(_0x34d89e){if(_0x34d89e){_0x52bd4f[_0x0332('0x3c')]=_['keys'](db[_0x0332('0x62')][_0x0332('0x3a')]);_0x52bd4f[_0x0332('0x3d')]=_[_0x0332('0x3e')](_0x575181['query']);_0x52bd4f[_0x0332('0x3f')]=_[_0x0332('0x40')](_0x52bd4f['model'],_0x52bd4f[_0x0332('0x3d')]);_0x4d13f8[_0x0332('0x41')]=_['intersection'](_0x52bd4f[_0x0332('0x3c')],qs[_0x0332('0x52')](_0x575181[_0x0332('0x3d')][_0x0332('0x52')]));_0x4d13f8['attributes']=_0x4d13f8[_0x0332('0x41')][_0x0332('0x42')]?_0x4d13f8[_0x0332('0x41')]:_0x52bd4f[_0x0332('0x3c')];if(!_0x575181[_0x0332('0x3d')][_0x0332('0x43')](_0x0332('0x44'))){_0x4d13f8[_0x0332('0x29')]=qs[_0x0332('0x29')](_0x575181[_0x0332('0x3d')][_0x0332('0x29')]);_0x4d13f8[_0x0332('0x27')]=qs[_0x0332('0x27')](_0x575181['query'][_0x0332('0x27')]);}_0x4d13f8[_0x0332('0x63')]=qs['sort'](_0x575181[_0x0332('0x3d')][_0x0332('0x45')]);_0x4d13f8[_0x0332('0x48')]=qs[_0x0332('0x3f')](_[_0x0332('0x46')](_0x575181[_0x0332('0x3d')],_0x52bd4f[_0x0332('0x3f')]));_0x4d13f8[_0x0332('0x48')][_0x0332('0x64')]=_0x34d89e['id'];if(_0x575181[_0x0332('0x3d')][_0x0332('0x47')]){_0x4d13f8[_0x0332('0x48')]=_[_0x0332('0x4b')](_0x4d13f8[_0x0332('0x48')],{'$or':_[_0x0332('0x38')](_0x4d13f8[_0x0332('0x41')],function(_0x1838c6){var _0x4cfa12={};_0x4cfa12[_0x1838c6]={'$like':'%'+_0x575181[_0x0332('0x3d')][_0x0332('0x47')]+'%'};return _0x4cfa12;})});}_0x4d13f8=_[_0x0332('0x4b')]({},_0x4d13f8,_0x575181['options']);return db[_0x0332('0x62')][_0x0332('0x2a')]({'where':_0x4d13f8[_0x0332('0x48')]})[_0x0332('0x1b')](function(_0x4b08bc){_0x8a9835[_0x0332('0x2a')]=_0x4b08bc;if(_0x575181[_0x0332('0x3d')][_0x0332('0x4d')]){_0x4d13f8[_0x0332('0x53')]=[{'all':!![]}];}return db['Disposition'][_0x0332('0x4e')](_0x4d13f8);})['then'](function(_0x556e79){_0x8a9835[_0x0332('0x65')]=_0x556e79;return _0x8a9835;});}})[_0x0332('0x1b')](respondWithFilteredResult(_0xfc12cb,_0x4d13f8))[_0x0332('0x4f')](handleError(_0xfc12cb,null));};exports[_0x0332('0x66')]=function(_0x2e54f8,_0x5864cd,_0x1033c6){return db[_0x0332('0x39')][_0x0332('0x59')]({'where':{'id':_0x2e54f8[_0x0332('0x51')]['id']}})[_0x0332('0x1b')](handleEntityNotFound(_0x5864cd,null))[_0x0332('0x1b')](function(_0x1246ed){if(_0x1246ed){return _0x1246ed[_0x0332('0x66')](_0x2e54f8[_0x0332('0x3d')]['ids']);}})[_0x0332('0x1b')](respondWithStatusCode(_0x5864cd,null))[_0x0332('0x4f')](handleError(_0x5864cd,null));};exports['addAnswer']=function(_0x3017e8,_0x43cdb5,_0x1824f9){if(_0x3017e8['body']['id']){delete _0x3017e8[_0x0332('0x55')]['id'];}return db[_0x0332('0x39')]['find']({'where':{'id':_0x3017e8[_0x0332('0x51')]['id']}})[_0x0332('0x1b')](handleEntityNotFound(_0x43cdb5,null))[_0x0332('0x1b')](function(_0x166743){if(_0x166743){_0x3017e8[_0x0332('0x55')][_0x0332('0x64')]=_0x166743['id'];return db[_0x0332('0x67')][_0x0332('0x54')](_0x3017e8['body']);}})[_0x0332('0x1b')](respondWithResult(_0x43cdb5,null))['catch'](handleError(_0x43cdb5,null));};exports['getAnswers']=function(_0x3a4949,_0x56b406,_0x2a80e9){var _0x3d845c={'raw':![],'where':{}};var _0x4eb24a={};var _0x2c1850={'count':0x0,'rows':[]};return db['SmsAccount'][_0x0332('0x61')]({'where':{'id':_0x3a4949[_0x0332('0x51')]['id']}})['then'](handleEntityNotFound(_0x56b406,null))[_0x0332('0x1b')](function(_0x544ff7){if(_0x544ff7){_0x4eb24a[_0x0332('0x3c')]=_['keys'](db[_0x0332('0x67')][_0x0332('0x3a')]);_0x4eb24a[_0x0332('0x3d')]=_[_0x0332('0x3e')](_0x3a4949['query']);_0x4eb24a['filters']=_[_0x0332('0x40')](_0x4eb24a[_0x0332('0x3c')],_0x4eb24a[_0x0332('0x3d')]);_0x3d845c[_0x0332('0x41')]=_['intersection'](_0x4eb24a['model'],qs[_0x0332('0x52')](_0x3a4949[_0x0332('0x3d')][_0x0332('0x52')]));_0x3d845c['attributes']=_0x3d845c[_0x0332('0x41')]['length']?_0x3d845c[_0x0332('0x41')]:_0x4eb24a[_0x0332('0x3c')];if(!_0x3a4949[_0x0332('0x3d')][_0x0332('0x43')](_0x0332('0x44'))){_0x3d845c[_0x0332('0x29')]=qs['limit'](_0x3a4949[_0x0332('0x3d')]['limit']);_0x3d845c[_0x0332('0x27')]=qs[_0x0332('0x27')](_0x3a4949[_0x0332('0x3d')][_0x0332('0x27')]);}_0x3d845c['order']=qs[_0x0332('0x45')](_0x3a4949[_0x0332('0x3d')][_0x0332('0x45')]);_0x3d845c[_0x0332('0x48')]=qs[_0x0332('0x3f')](_[_0x0332('0x46')](_0x3a4949['query'],_0x4eb24a['filters']));_0x3d845c[_0x0332('0x48')][_0x0332('0x64')]=_0x544ff7['id'];if(_0x3a4949[_0x0332('0x3d')][_0x0332('0x47')]){_0x3d845c[_0x0332('0x48')]=_[_0x0332('0x4b')](_0x3d845c['where'],{'$or':_['map'](_0x3d845c[_0x0332('0x41')],function(_0x70dcf2){var _0x3e6aa0={};_0x3e6aa0[_0x70dcf2]={'$like':'%'+_0x3a4949[_0x0332('0x3d')]['filter']+'%'};return _0x3e6aa0;})});}_0x3d845c=_[_0x0332('0x4b')]({},_0x3d845c,_0x3a4949['options']);return db[_0x0332('0x67')][_0x0332('0x2a')]({'where':_0x3d845c['where']})['then'](function(_0x471567){_0x2c1850[_0x0332('0x2a')]=_0x471567;if(_0x3a4949[_0x0332('0x3d')][_0x0332('0x4d')]){_0x3d845c[_0x0332('0x53')]=[{'all':!![]}];}return db[_0x0332('0x67')]['findAll'](_0x3d845c);})['then'](function(_0x2e8e46){_0x2c1850[_0x0332('0x65')]=_0x2e8e46;return _0x2c1850;});}})[_0x0332('0x1b')](respondWithFilteredResult(_0x56b406,_0x3d845c))[_0x0332('0x4f')](handleError(_0x56b406,null));};exports[_0x0332('0x68')]=function(_0xa1b12e,_0xd8badd,_0x260697){return db[_0x0332('0x39')]['find']({'where':{'id':_0xa1b12e['params']['id']}})[_0x0332('0x1b')](handleEntityNotFound(_0xd8badd,null))[_0x0332('0x1b')](function(_0x55ce0f){if(_0x55ce0f){return _0x55ce0f[_0x0332('0x68')](_0xa1b12e[_0x0332('0x3d')]['ids']);}})[_0x0332('0x1b')](respondWithStatusCode(_0xd8badd,null))[_0x0332('0x4f')](handleError(_0xd8badd,null));};exports[_0x0332('0x69')]=function(_0xfa3fab,_0xe82801,_0x5f227d){var _0x2be3c7={'channel':_0x0332('0x6a')};var _0x24906c=[];var _0x303c7a=[];var _0x182f39={};return db[_0x0332('0x39')][_0x0332('0x59')]({'where':{'id':_0xfa3fab[_0x0332('0x51')]['id']},'include':[{'model':db[_0x0332('0x6b')],'as':_0x0332('0x6c')}]})[_0x0332('0x1b')](handleEntityNotFound(_0xe82801,null))[_0x0332('0x1b')](function(_0x3dce2b){_0x2be3c7['account']=_0x3dce2b;_0x2be3c7[_0x0332('0x6d')]=_[_0x0332('0x6e')](_0x3dce2b[_0x0332('0x6c')],[_0x0332('0x6f')],[_0x0332('0x70')]);if(_0x2be3c7[_0x0332('0x71')]['Applications']){delete _0x2be3c7[_0x0332('0x71')][_0x0332('0x6c')];}return db['CmContact'][_0x0332('0x5e')]();})[_0x0332('0x1b')](function(_0x5c1f64){if(!_0x5c1f64){throw new db['Sequelize'][(_0x0332('0x72'))](_0x0332('0x73'));}_0x24906c=_['difference'](_[_0x0332('0x3e')](_0x5c1f64),[_0x0332('0x74'),_0x0332('0x75')]);_0x303c7a=_[_0x0332('0x76')](_[_0x0332('0x3e')](_0x5c1f64),[_0x0332('0x74'),'updatedAt',_0x0332('0x77'),_0x0332('0x78')]);_0x2be3c7[_0x0332('0x55')]={'mapKey':_0x0332('0x79')};if(_0x2be3c7['account'][_0x0332('0x49')]){switch(_0x2be3c7['account']['type']){case _0x0332('0x7a'):_0x2be3c7[_0x0332('0x55')][_0x0332('0x7b')]=_0xfa3fab['body'][_0x0332('0x7c')];_0x2be3c7[_0x0332('0x55')]['body']=_0xfa3fab['body'][_0x0332('0x7d')];_0x2be3c7['body'][_0x0332('0x7e')]=_0xfa3fab[_0x0332('0x55')][_0x0332('0x7f')];break;case'skebby':_0x2be3c7[_0x0332('0x55')][_0x0332('0x7b')]='+'+_0xfa3fab[_0x0332('0x55')][_0x0332('0x80')];_0x2be3c7['body'][_0x0332('0x55')]=_0xfa3fab[_0x0332('0x55')]['text'];break;case _0x0332('0x81'):_0x2be3c7['body'][_0x0332('0x7b')]=_0xfa3fab['body'][_0x0332('0x7b')];_0x2be3c7['body']['body']=_0xfa3fab[_0x0332('0x55')][_0x0332('0x22')];break;case'clicksend':_0x2be3c7['body'][_0x0332('0x7b')]=_0xfa3fab[_0x0332('0x55')][_0x0332('0x7b')];_0x2be3c7[_0x0332('0x55')][_0x0332('0x55')]=_0xfa3fab[_0x0332('0x55')]['body'];_0x2be3c7[_0x0332('0x55')][_0x0332('0x7e')]=_0xfa3fab['body']['message_id'];break;case'plivo':_0x2be3c7[_0x0332('0x55')][_0x0332('0x7b')]=_0xfa3fab[_0x0332('0x55')]['From'];_0x2be3c7['body'][_0x0332('0x55')]=_0xfa3fab[_0x0332('0x55')][_0x0332('0x82')];_0x2be3c7[_0x0332('0x55')][_0x0332('0x7e')]=_0xfa3fab['body']['MessageUUID'];break;case'infobip':_0x2be3c7[_0x0332('0x55')][_0x0332('0x7b')]='+'+_0xfa3fab[_0x0332('0x55')][_0x0332('0x83')][0x0][_0x0332('0x7b')];_0x2be3c7[_0x0332('0x55')][_0x0332('0x55')]=_0xfa3fab[_0x0332('0x55')][_0x0332('0x83')][0x0][_0x0332('0x84')];_0x2be3c7['body'][_0x0332('0x7e')]=_0xfa3fab[_0x0332('0x55')][_0x0332('0x83')][0x0]['messageId'];break;case _0x0332('0x85'):_0x2be3c7[_0x0332('0x55')][_0x0332('0x7b')]=_0xfa3fab[_0x0332('0x55')]['originatingAddress'];_0x2be3c7['body']['body']=_0xfa3fab['body'][_0x0332('0x86')][_0x0332('0x22')];break;case _0x0332('0x87'):_0x2be3c7[_0x0332('0x55')][_0x0332('0x7b')]=_0xfa3fab['body'][_0x0332('0x88')];_0x2be3c7[_0x0332('0x55')]['body']=_0xfa3fab[_0x0332('0x55')][_0x0332('0x84')];_0x2be3c7['body'][_0x0332('0x7e')]=_0xfa3fab['body'][_0x0332('0x89')];break;case'bandwidth':_0x2be3c7['body'][_0x0332('0x7e')]=_0xfa3fab[_0x0332('0x55')][0x0][_0x0332('0x22')]['id'];_0x2be3c7[_0x0332('0x55')][_0x0332('0x7b')]=_0xfa3fab[_0x0332('0x55')][0x0][_0x0332('0x22')][_0x0332('0x7b')];_0x2be3c7[_0x0332('0x55')]['body']=_0xfa3fab['body'][0x0][_0x0332('0x22')][_0x0332('0x84')];break;case _0x0332('0x8a'):_0x2be3c7['body']['from']=_0xfa3fab['body'][_0x0332('0x7b')];_0x2be3c7[_0x0332('0x55')]['body']=_0xfa3fab[_0x0332('0x55')][_0x0332('0x22')];_0x2be3c7[_0x0332('0x55')]['messageId']=_0xfa3fab['body'][_0x0332('0x8b')];break;}}if(_0x2be3c7[_0x0332('0x55')]['id']){delete _0x2be3c7[_0x0332('0x55')]['id'];}if(_[_0x0332('0x8c')](_0x2be3c7[_0x0332('0x55')]['from'])){throw new db[(_0x0332('0x8d'))]['ValidationError'](_0x0332('0x8e'));}if(_[_0x0332('0x8c')](_0x2be3c7[_0x0332('0x55')][_0x0332('0x55')])||_0x2be3c7[_0x0332('0x55')]['body']===''){throw new db[(_0x0332('0x8d'))][(_0x0332('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2be3c7[_0x0332('0x55')][_0x0332('0x8f')])){throw new db['Sequelize'][(_0x0332('0x72'))](_0x0332('0x90')+_0x303c7a);}if(!_[_0x0332('0x91')](_0x303c7a,_0x2be3c7['body'][_0x0332('0x8f')])){throw new db[(_0x0332('0x8d'))][(_0x0332('0x72'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x303c7a);}_0x182f39[_0x2be3c7[_0x0332('0x55')][_0x0332('0x8f')]]=_0x2be3c7[_0x0332('0x55')]['from'];return db[_0x0332('0x92')][_0x0332('0x59')]({'where':{'id':_0x2be3c7[_0x0332('0x71')][_0x0332('0x78')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x182f39,'limit':0x1,'order':[[_0x0332('0x75'),'DESC']]}]});})[_0x0332('0x1b')](handleEntityNotFound(_0xe82801,null))[_0x0332('0x1b')](function(_0x9f40f8){if(_0x9f40f8){_0x2be3c7[_0x0332('0x93')]=_[_0x0332('0x94')](_0x9f40f8,[_0x0332('0x95')]);if(_0x9f40f8[_0x0332('0x95')][_0x0332('0x42')]){return _0x9f40f8['Contacts'][0x0];}var _0x1f5a6d=_[_0x0332('0x96')](_0x2be3c7['body'],{'firstName':_0x2be3c7['body'][_0x0332('0x7b')],'ListId':_0x9f40f8['id']});_0x1f5a6d[_0x2be3c7[_0x0332('0x55')][_0x0332('0x8f')]]=_0x2be3c7[_0x0332('0x55')]['from'];return db[_0x0332('0x97')]['create'](_0x1f5a6d,{'fields':_0x24906c,'raw':!![]});}})[_0x0332('0x1b')](handleEntityNotFound(_0xe82801,null))[_0x0332('0x1b')](function(_0x28b06b){if(_0x28b06b){_0x2be3c7[_0x0332('0x98')]=_0x28b06b;var _0xe066e6={'ContactId':_0x28b06b['id'],'phone':_0x2be3c7['body'][_0x0332('0x7b')],'SmsAccountId':_0xfa3fab[_0x0332('0x51')]['id']};var _0xd53290={'ContactId':_0x28b06b['id'],'SmsAccountId':_0xfa3fab['params']['id'],'closed':![]};return db[_0x0332('0x99')][_0x0332('0x59')]({'where':_0xd53290})['then'](function(_0x20bb41){if(_0x20bb41){return[_0x20bb41,![]];}return db['SmsInteraction'][_0x0332('0x54')](_0xe066e6)[_0x0332('0x1b')](function(_0x5c0ae7){return[_0x5c0ae7,!![]];});});}})['spread'](function(_0x5bfbb7,_0x259ab9){_0x2be3c7[_0x0332('0x9a')]=_0x5bfbb7[_0x0332('0x2e')]({'plain':!![]});_0x2be3c7['interaction'][_0x0332('0x9b')]=![];if(_0x259ab9){if(_0x2be3c7[_0x0332('0x71')][_0x0332('0x9c')]){_0x2be3c7[_0x0332('0x6d')]['push']({'id':0x0,'priority':_0x2be3c7[_0x0332('0x6d')][_0x0332('0x42')]+0x1,'app':_0x0332('0x9d'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x2be3c7['interaction'][_0x0332('0x9b')]=!![];}return db[_0x0332('0x9e')][_0x0332('0x54')]({'phone':_0x2be3c7[_0x0332('0x55')][_0x0332('0x7b')],'messageId':_0x2be3c7[_0x0332('0x55')][_0x0332('0x7e')],'body':_0x2be3c7['body'][_0x0332('0x55')],'SmsAccountId':_0xfa3fab[_0x0332('0x51')]['id'],'SmsInteractionId':_0x5bfbb7['id'],'direction':'in','ContactId':_0x5bfbb7['ContactId'],'AttachmentId':_0x2be3c7[_0x0332('0x55')][_0x0332('0x9f')]});})[_0x0332('0x1b')](function(_0x2bccca){_0x2be3c7[_0x0332('0x22')]=_0x2bccca;if(_0x2be3c7[_0x0332('0x9a')][_0x0332('0xa0')]){return db[_0x0332('0xa1')]['find']({'attributes':['id',_0x0332('0x34')],'where':{'id':_0x2be3c7[_0x0332('0x9a')][_0x0332('0xa0')]}})[_0x0332('0x1b')](function(_0x31f11f){if(_0x31f11f){_0x2be3c7[_0x0332('0x6d')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0332('0xa2'),'appdata':_0x31f11f['name']+','+(_0x2be3c7[_0x0332('0x71')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x2be3c7);});}return respondWithRpcPromise('Start',_0x0332('0xa3'),_0x2be3c7);})[_0x0332('0x1b')](function(_0x40e85e){if(_0x40e85e){var _0x1ca9de=0xc8;var _0x2dbb5d=_0x0332('0xa4');logger[_0x0332('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2dbb5d,_0x1ca9de,_0x0332('0xa5'));logger[_0x0332('0x1e')](_0x0332('0xa6'),_0x2dbb5d,_0x1ca9de,_0x0332('0xa5'),JSON[_0x0332('0xa7')](_0x40e85e));if(_0x2be3c7[_0x0332('0x71')][_0x0332('0x49')]===_0x0332('0x7a')){return _0xe82801[_0x0332('0x25')](_0x1ca9de)[_0x0332('0x2b')]('Content-Type',_0x0332('0xa8'))[_0x0332('0x35')](_0x0332('0xa9'));}else{return _0xe82801['status'](_0x1ca9de)[_0x0332('0x26')](_0x40e85e);}}})[_0x0332('0x4f')](handleError(_0xe82801,null));};exports['addApplications']=function(_0x23554a,_0x4262a4,_0x4c82fb){return db['SmsAccount'][_0x0332('0x61')]({'where':{'id':_0x23554a[_0x0332('0x51')]['id']}})[_0x0332('0x1b')](handleEntityNotFound(_0x4262a4,null))[_0x0332('0x1b')](function(_0x1644c5){if(_0x1644c5){return db[_0x0332('0xaa')][_0x0332('0xab')](function(_0xdbb699){return db[_0x0332('0x6b')][_0x0332('0x2d')]({'where':{'SmsAccountId':_0x23554a['params']['id']},'transaction':_0xdbb699})[_0x0332('0x1b')](function(_0x2e5242){var _0x46a7f1=_[_0x0332('0x38')](_0x23554a[_0x0332('0x55')],function(_0x2a6d71){_0x2a6d71[_0x0332('0x64')]=_0x23554a[_0x0332('0x51')]['id'];return _0x2a6d71;});return db[_0x0332('0x6b')]['bulkCreate'](_0x46a7f1,{'transaction':_0xdbb699});});})[_0x0332('0x1b')](function(){return db[_0x0332('0x6b')][_0x0332('0xac')]({'where':{'SmsAccountId':_0x23554a['params']['id']},'order':_0x0332('0x6f')});});}})[_0x0332('0x1b')](respondWithResult(_0x4262a4,null))[_0x0332('0x4f')](handleError(_0x4262a4,null));};exports[_0x0332('0xad')]=function(_0x5d5794,_0x15ca16,_0x307750){var _0x179e17={};var _0x5d9858={};var _0xfb4db8;var _0x5ea91e;return db[_0x0332('0x39')][_0x0332('0x61')]({'where':{'id':_0x5d5794[_0x0332('0x51')]['id']}})[_0x0332('0x1b')](handleEntityNotFound(_0x15ca16,null))[_0x0332('0x1b')](function(_0x457d65){if(_0x457d65){_0xfb4db8=_0x457d65;_0x5d9858[_0x0332('0x3c')]=_[_0x0332('0x3e')](db[_0x0332('0x6b')]['rawAttributes']);_0x5d9858[_0x0332('0x3d')]=_[_0x0332('0x3e')](_0x5d5794[_0x0332('0x3d')]);_0x5d9858['filters']=_[_0x0332('0x40')](_0x5d9858[_0x0332('0x3c')],_0x5d9858[_0x0332('0x3d')]);_0x179e17[_0x0332('0x41')]=_[_0x0332('0x40')](_0x5d9858[_0x0332('0x3c')],qs[_0x0332('0x52')](_0x5d5794[_0x0332('0x3d')][_0x0332('0x52')]));_0x179e17[_0x0332('0x41')]=_0x179e17[_0x0332('0x41')][_0x0332('0x42')]?_0x179e17[_0x0332('0x41')]:_0x5d9858[_0x0332('0x3c')];_0x179e17['order']=qs['sort'](_0x5d5794[_0x0332('0x3d')][_0x0332('0x45')]);_0x179e17['where']=qs[_0x0332('0x3f')](_['pick'](_0x5d5794[_0x0332('0x3d')],_0x5d9858['filters']));if(_0x5d5794['query'][_0x0332('0x47')]){_0x179e17[_0x0332('0x48')]=_['merge'](_0x179e17['where'],{'$or':_['map'](_0x179e17[_0x0332('0x41')],function(_0x35feb9){var _0x13deb2={};_0x13deb2[_0x35feb9]={'$like':'%'+_0x5d5794[_0x0332('0x3d')][_0x0332('0x47')]+'%'};return _0x13deb2;})});}_0x179e17=_['merge']({},_0x179e17,_0x5d5794[_0x0332('0x4c')]);return _0xfb4db8[_0x0332('0xad')](_0x179e17);}})[_0x0332('0x1b')](function(_0x58cadd){if(_0x58cadd){_0x5ea91e=_0x58cadd['length'];if(!_0x5d5794[_0x0332('0x3d')][_0x0332('0x43')](_0x0332('0x44'))){_0x179e17[_0x0332('0x29')]=qs[_0x0332('0x29')](_0x5d5794[_0x0332('0x3d')][_0x0332('0x29')]);_0x179e17['offset']=qs[_0x0332('0x27')](_0x5d5794[_0x0332('0x3d')]['offset']);}return _0xfb4db8['getApplications'](_0x179e17);}})[_0x0332('0x1b')](function(_0x10e699){if(_0x10e699){return _0x10e699?{'count':_0x5ea91e,'rows':_0x10e699}:null;}})[_0x0332('0x1b')](respondWithResult(_0x15ca16,null))[_0x0332('0x4f')](handleError(_0x15ca16,null));};exports[_0x0332('0xae')]=function(_0x309632,_0x3ddf83,_0x87c468){var _0x6bc148={'raw':![],'where':{}};var _0x261ffe={};var _0x1cf095={'count':0x0,'rows':[]};return db[_0x0332('0x39')][_0x0332('0x61')]({'where':{'id':_0x309632[_0x0332('0x51')]['id']}})[_0x0332('0x1b')](handleEntityNotFound(_0x3ddf83,null))['then'](function(_0x4998b6){if(_0x4998b6){_0x261ffe[_0x0332('0x3c')]=_['keys'](db[_0x0332('0x99')][_0x0332('0x3a')]);_0x261ffe[_0x0332('0x3d')]=_[_0x0332('0x3e')](_0x309632[_0x0332('0x3d')]);_0x261ffe['filters']=_[_0x0332('0x40')](_0x261ffe[_0x0332('0x3c')],_0x261ffe[_0x0332('0x3d')]);_0x6bc148[_0x0332('0x41')]=_[_0x0332('0x40')](_0x261ffe[_0x0332('0x3c')],qs[_0x0332('0x52')](_0x309632[_0x0332('0x3d')]['fields']));_0x6bc148['attributes']=_0x6bc148['attributes'][_0x0332('0x42')]?_0x6bc148[_0x0332('0x41')]:_0x261ffe['model'];if(!_0x309632[_0x0332('0x3d')][_0x0332('0x43')](_0x0332('0x44'))){_0x6bc148['limit']=qs['limit'](_0x309632[_0x0332('0x3d')][_0x0332('0x29')]);_0x6bc148[_0x0332('0x27')]=qs[_0x0332('0x27')](_0x309632[_0x0332('0x3d')][_0x0332('0x27')]);}_0x6bc148[_0x0332('0x63')]=qs['sort'](_0x309632[_0x0332('0x3d')]['sort']);_0x6bc148[_0x0332('0x48')]=qs['filters'](_[_0x0332('0x46')](_0x309632[_0x0332('0x3d')],_0x261ffe[_0x0332('0x3f')]));_0x6bc148[_0x0332('0x48')][_0x0332('0x64')]=_0x4998b6['id'];if(_0x309632[_0x0332('0x3d')][_0x0332('0x47')]){_0x6bc148[_0x0332('0x48')]=_[_0x0332('0x4b')](_0x6bc148[_0x0332('0x48')],{'$or':_[_0x0332('0x38')](_0x6bc148[_0x0332('0x41')],function(_0x9b91c7){var _0x16dfa9={};_0x16dfa9[_0x9b91c7]={'$like':'%'+_0x309632[_0x0332('0x3d')][_0x0332('0x47')]+'%'};return _0x16dfa9;})});}_0x6bc148=_[_0x0332('0x4b')]({},_0x6bc148,_0x309632[_0x0332('0x4c')]);return db[_0x0332('0x99')][_0x0332('0x2a')]({'where':_0x6bc148[_0x0332('0x48')]})['then'](function(_0x3a8ad2){_0x1cf095[_0x0332('0x2a')]=_0x3a8ad2;if(_0x309632[_0x0332('0x3d')][_0x0332('0x4d')]){_0x6bc148['include']=[{'model':db[_0x0332('0x97')],'as':_0x0332('0xaf'),'required':![]},{'model':db[_0x0332('0xa1')],'as':_0x0332('0xb0'),'attributes':[_0x0332('0x34'),_0x0332('0xb1'),_0x0332('0xb2')],'required':![]},{'model':db[_0x0332('0xb3')],'as':'Tags','attributes':['id',_0x0332('0x34'),_0x0332('0xb4')],'where':_0x309632[_0x0332('0x3d')][_0x0332('0xb5')]?{'id':_0x309632[_0x0332('0x3d')][_0x0332('0xb5')]}:undefined,'required':_0x309632['query'][_0x0332('0xb5')]?!![]:![]}];}return db[_0x0332('0x99')]['findAll'](_0x6bc148);})[_0x0332('0x1b')](function(_0x2f3a52){_0x1cf095[_0x0332('0x65')]=_0x2f3a52;return _0x1cf095;});}})[_0x0332('0x1b')](respondWithFilteredResult(_0x3ddf83,_0x6bc148))[_0x0332('0x4f')](handleError(_0x3ddf83,null));};exports['send']=function(_0x59af66,_0x53cf33,_0x5b1350){var _0x3fb22e,_0x4be98a,_0x448fa3;if(_[_0x0332('0x8c')](_0x59af66[_0x0332('0x55')]['body'])||_0x59af66['body'][_0x0332('0x55')]===''){throw new db[(_0x0332('0x8d'))][(_0x0332('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x59af66[_0x0332('0x55')]['to'])){throw new db[(_0x0332('0x8d'))][(_0x0332('0x72'))](_0x0332('0xb6'));}_0x3fb22e=_0x59af66[_0x0332('0x55')]['to'];return db[_0x0332('0x39')]['find']({'where':{'id':_0x59af66[_0x0332('0x51')]['id']},'include':[{'model':db[_0x0332('0x92')],'as':_0x0332('0xb7'),'include':[{'model':db[_0x0332('0x97')],'as':'Contacts','where':{'mobile':_0x3fb22e},'limit':0x1,'order':[['updatedAt',_0x0332('0xb8')]]}]}]})['then'](handleEntityNotFound(_0x53cf33,null))[_0x0332('0x1b')](function(_0x1ade6e){if(_0x1ade6e&&_0x1ade6e[_0x0332('0xb7')]){_0x4be98a=_0x1ade6e[_0x0332('0x2e')]({'plain':!![]});if(_0x4be98a[_0x0332('0xb7')]&&_0x4be98a['List'][_0x0332('0x95')][_0x0332('0x42')]){return _0x4be98a[_0x0332('0xb7')][_0x0332('0x95')][0x0];}return db[_0x0332('0x97')]['create'](_['defaults'](_0x59af66[_0x0332('0x55')],{'firstName':_0x3fb22e,'mobile':_0x3fb22e,'phone':_0x3fb22e,'ListId':_0x4be98a['ListId']}));}})['then'](handleEntityNotFound(_0x53cf33,null))[_0x0332('0x1b')](function(_0x39fac9){if(_0x39fac9){_0x448fa3=_0x39fac9;return db['SmsInteraction'][_0x0332('0x59')]({'where':{'ContactId':_0x448fa3['id'],'closed':![],'SmsAccountId':_0x4be98a['id']}})[_0x0332('0x1b')](function(_0x1c6c40){if(_0x1c6c40){return[_0x1c6c40,![]];}return db[_0x0332('0x99')][_0x0332('0x54')]({'UserId':_0x59af66['user']['id'],'ContactId':_0x448fa3['id'],'SmsAccountId':_0x4be98a['id'],'phone':_0x3fb22e,'firstMsgDirection':'out','Messages':[_[_0x0332('0x4b')](_0x59af66[_0x0332('0x55')],{'read':![],'body':_0x59af66['body'][_0x0332('0x55')],'phone':_0x3fb22e,'SmsAccountId':_0x4be98a['id'],'UserId':_0x59af66[_0x0332('0x58')]['id'],'ContactId':_0x448fa3['id']})]},{'include':[{'model':db[_0x0332('0x9e')],'as':_0x0332('0xb9')}]})[_0x0332('0x1b')](function(_0x384b5a){return[_0x384b5a,!![]];});});}})[_0x0332('0xba')](function(_0xf3cfb3,_0x144066){if(_0x144066){return _0xf3cfb3;}return db[_0x0332('0x9e')][_0x0332('0x54')](_[_0x0332('0x4b')](_0x59af66[_0x0332('0x55')],{'read':![],'body':_0x59af66[_0x0332('0x55')][_0x0332('0x55')],'phone':_0x3fb22e,'SmsAccountId':_0x4be98a['id'],'SmsInteractionId':_0xf3cfb3['id'],'UserId':_0x59af66[_0x0332('0x58')]['id'],'ContactId':_0x448fa3['id']}))[_0x0332('0x1b')](function(_0x26c778){_0xf3cfb3[_0x0332('0xbb')][_0x0332('0xb9')]=[];_0xf3cfb3[_0x0332('0xbb')][_0x0332('0xb9')][_0x0332('0xbc')](_0x26c778[_0x0332('0xbb')]);return _0xf3cfb3;});})['then'](respondWithResult(_0x53cf33,null))[_0x0332('0x4f')](handleError(_0x53cf33,null));};exports[_0x0332('0x25')]=function(_0x187ea4,_0x200ac6,_0x3f245e){if(_0x187ea4[_0x0332('0x55')]['id']){delete _0x187ea4[_0x0332('0x55')]['id'];}var _0x13c0be,_0x184140,_0x4eeaca;return db[_0x0332('0x39')][_0x0332('0x59')]({'where':{'id':_0x187ea4[_0x0332('0x51')]['id']}})['then'](handleEntityNotFound(_0x200ac6,null))['then'](function(_0x346b22){if(_0x346b22){_0x4eeaca=_0x346b22;logger[_0x0332('0x1e')](_0x0332('0x1f'),_0x0332('0x25'),'received\x20delivery\x20report\x20from',_0x346b22['type'],util['inspect'](_0x187ea4[_0x0332('0x55')],{'showHidden':![],'depth':null}));switch(_0x346b22['type']){case _0x0332('0xbd'):if(_0x187ea4['body'][_0x0332('0xbe')]&&_0x187ea4[_0x0332('0x55')][_0x0332('0x25')]){_0x184140=_0x187ea4['body']['status'];return db[_0x0332('0x9e')]['find']({'where':{'messageId':_0x187ea4['body']['skebby_dispatch_id']}});}break;case _0x0332('0x81'):if(_0x187ea4[_0x0332('0x55')]['requestid']&&_0x187ea4[_0x0332('0x55')][_0x0332('0xbf')]){_0x184140=_0x187ea4[_0x0332('0x55')][_0x0332('0xbf')];return db['SmsMessage'][_0x0332('0x59')]({'where':{'messageId':_0x187ea4[_0x0332('0x55')][_0x0332('0xc0')]}});}break;case _0x0332('0xc1'):if(_0x187ea4['body'][_0x0332('0xc2')]&&_0x187ea4[_0x0332('0x55')]['status_code']){_0x184140=_0x187ea4[_0x0332('0x55')]['status_code'];return db[_0x0332('0x9e')][_0x0332('0x59')]({'where':{'messageId':_0x187ea4[_0x0332('0x55')][_0x0332('0xc2')]}});}break;case _0x0332('0xc3'):var _0x13769e=_0x187ea4[_0x0332('0x55')][_0x0332('0x83')][0x0];if(_0x13769e[_0x0332('0x7e')]&&_0x13769e[_0x0332('0x25')]['groupName']==='DELIVERED'){_0x184140=_0x13769e[_0x0332('0x25')]['groupName'];return db[_0x0332('0x9e')][_0x0332('0x59')]({'where':{'messageId':_0x13769e['messageId']}});}break;case _0x0332('0x87'):if(_0x187ea4[_0x0332('0x55')][_0x0332('0x7e')]&&_0x187ea4['body'][_0x0332('0x25')]){_0x184140=_0x187ea4[_0x0332('0x55')][_0x0332('0x25')];return db['SmsMessage'][_0x0332('0x59')]({'where':{'messageId':_0x187ea4['body'][_0x0332('0x7e')]}});}break;case'bandwidth':if(_0x187ea4[_0x0332('0x55')][0x0][_0x0332('0x22')]['id']){_0x184140=_0x187ea4[_0x0332('0x55')][0x0][_0x0332('0x49')];return db[_0x0332('0x9e')]['find']({'where':{'messageId':_0x187ea4['body'][0x0][_0x0332('0x22')]['id']}});}break;case _0x0332('0x8a'):if(_0x187ea4['body']['redif']&&_0x187ea4[_0x0332('0x55')][_0x0332('0x25')]){_0x184140=_0x187ea4['body'][_0x0332('0x25')];return db[_0x0332('0x9e')]['find']({'where':{'messageId':_0x187ea4[_0x0332('0x55')][_0x0332('0xc4')]}});}break;}}})[_0x0332('0x1b')](handleEntityNotFound(_0x200ac6,null))[_0x0332('0x1b')](function(_0xbd1ce0){if(_0xbd1ce0){_0x13c0be=_0xbd1ce0;switch(_0x4eeaca[_0x0332('0x49')]){case _0x0332('0xbd'):if(_0x184140===_0x0332('0xc5')){return _0x13c0be[_0x0332('0x5d')]({'read':!![]});}else{logger[_0x0332('0x20')](_0x0332('0x1f'),_0x0332('0x25'),_0x0332('0xbd'),util['inspect'](_0x187ea4['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x184140==='1'){return _0x13c0be[_0x0332('0x5d')]({'read':!![]});}else{logger['error'](_0x0332('0x1f'),_0x0332('0x25'),_0x0332('0xbd'),util[_0x0332('0xc6')](_0x187ea4[_0x0332('0x55')],{'showHidden':![],'depth':null}));}break;case _0x0332('0xc1'):if(!_0x187ea4['body'][_0x0332('0xc7')]&&_0x184140>=0xc8&&_0x184140<=0xce){return _0x13c0be[_0x0332('0x5d')]({'read':!![]});}else{logger[_0x0332('0x20')](_0x0332('0x1f'),_0x0332('0x25'),_0x0332('0xc1'),util['inspect'](_0x187ea4[_0x0332('0x55')],{'showHidden':![],'depth':null}));}break;case _0x0332('0xc3'):var _0x5bfaab=_0x187ea4[_0x0332('0x55')][_0x0332('0x83')][0x0];if(_0x5bfaab[_0x0332('0x25')][_0x0332('0xc8')]===_0x0332('0xc5')){return _0x13c0be[_0x0332('0x5d')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0332('0x25'),_0x0332('0xc3'),util[_0x0332('0xc6')](_0x187ea4[_0x0332('0x55')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x184140==_0x0332('0xc9')||_0x184140=='RECEIVED_BY_RECIPIENT'){return _0x13c0be['update']({'read':!![]});}else{logger['error'](_0x0332('0x1f'),_0x0332('0x25'),'clickatell',util['inspect'](_0x187ea4[_0x0332('0x55')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x184140==_0x0332('0xca')){return _0x13c0be[_0x0332('0x5d')]({'read':!![]});}else{logger[_0x0332('0x20')](_0x0332('0x1f'),_0x0332('0x25'),_0x0332('0xcb'),util[_0x0332('0xc6')](_0x187ea4[_0x0332('0x55')],{'showHidden':![],'depth':null}));}break;case _0x0332('0x8a'):if(_0x184140===_0x0332('0xcc')||_0x184140===_0x0332('0xcd')){return _0x13c0be[_0x0332('0x5d')]({'read':!![]});}else{logger['error'](_0x0332('0x1f'),_0x0332('0x25'),'intelepeer',util[_0x0332('0xc6')](_0x187ea4[_0x0332('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x13c0be;}})[_0x0332('0x1b')](respondWithResult(_0x200ac6,null))[_0x0332('0x4f')](handleError(_0x200ac6,null));};exports[_0x0332('0xce')]=function(_0x4ebf65,_0x2b6121,_0x5e51ff){var _0x39a50d,_0x1d7825,_0x21bb68;return db['SmsAccount']['find']({'where':{'id':_0x4ebf65[_0x0332('0x51')]['id']}})[_0x0332('0x1b')](handleEntityNotFound(_0x2b6121,null))[_0x0332('0x1b')](function(_0x4ea5b1){if(_0x4ea5b1){_0x21bb68=_0x4ea5b1;logger[_0x0332('0x1e')](_0x0332('0x1f'),_0x0332('0x25'),_0x0332('0xcf'),_0x4ea5b1[_0x0332('0x49')],util[_0x0332('0xc6')](_0x4ebf65[_0x0332('0x3d')],{'showHidden':![],'depth':null}));switch(_0x4ea5b1[_0x0332('0x49')]){case _0x0332('0x85'):if(_0x4ebf65[_0x0332('0x3d')]['message-id']&&_0x4ebf65['query'][_0x0332('0xd0')]){_0x1d7825=_0x4ebf65[_0x0332('0x3d')][_0x0332('0xd0')];return db[_0x0332('0x9e')][_0x0332('0x59')]({'where':{'messageId':_0x4ebf65[_0x0332('0x3d')][_0x0332('0xd1')]}});}break;}}})[_0x0332('0x1b')](handleEntityNotFound(_0x2b6121,null))[_0x0332('0x1b')](function(_0x2185f4){if(_0x2185f4){_0x39a50d=_0x2185f4;switch(_0x21bb68['type']){case _0x0332('0x85'):if(_0x1d7825==='2'||_0x1d7825==='6'){return _0x39a50d['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x0332('0x85'),util[_0x0332('0xc6')](_0x4ebf65[_0x0332('0x3d')],{'showHidden':![],'depth':null}));};break;}return _0x39a50d;}})[_0x0332('0x1b')](respondWithResult(_0x2b6121,null))[_0x0332('0x4f')](handleError(_0x2b6121,null));};exports[_0x0332('0xd2')]=function(_0x631c73,_0x4036be,_0x333a62){return db['SmsAccount']['find']({'where':{'id':_0x631c73['params']['id']}})[_0x0332('0x1b')](handleEntityNotFound(_0x4036be,null))[_0x0332('0x1b')](function(_0x252502){if(_0x252502){return _0x252502[_0x0332('0xd2')](_0x631c73[_0x0332('0x55')][_0x0332('0xd3')],_[_0x0332('0x94')](_0x631c73[_0x0332('0x55')],[_0x0332('0xd3'),'id'])||{})[_0x0332('0xba')](function(_0x3b04e3){for(var _0x4c1625=0x0;_0x4c1625<_0x631c73['body'][_0x0332('0xd3')]['length'];_0x4c1625+=0x1){socket[_0x0332('0xd4')]('userSmsAccount:save',{'UserId':Number(_0x631c73[_0x0332('0x55')][_0x0332('0xd3')][_0x4c1625]),'SmsAccountId':Number(_0x631c73[_0x0332('0x51')]['id'])});}return _0x3b04e3;});}})[_0x0332('0x1b')](respondWithResult(_0x4036be,null))[_0x0332('0x4f')](handleError(_0x4036be,null));};exports['removeAgents']=function(_0x439732,_0x5a58e4,_0x5a61c2){return db['SmsAccount'][_0x0332('0x59')]({'where':{'id':_0x439732['params']['id']}})[_0x0332('0x1b')](handleEntityNotFound(_0x5a58e4,null))[_0x0332('0x1b')](function(_0x50c299){if(_0x50c299){return _0x50c299[_0x0332('0xd5')](_0x439732['query']['ids'])['then'](function(){if(_[_0x0332('0xd6')](_0x439732[_0x0332('0x3d')]['ids'])){for(var _0x4eb3d8=0x0;_0x4eb3d8<_0x439732['query'][_0x0332('0xd3')][_0x0332('0x42')];_0x4eb3d8+=0x1){socket[_0x0332('0xd4')](_0x0332('0xd7'),{'UserId':Number(_0x439732[_0x0332('0x3d')]['ids'][_0x4eb3d8]),'SmsAccountId':Number(_0x439732['params']['id'])});}}else{socket[_0x0332('0xd4')](_0x0332('0xd7'),{'UserId':Number(_0x439732[_0x0332('0x3d')][_0x0332('0xd3')]),'SmsAccountId':Number(_0x439732[_0x0332('0x51')]['id'])});}});}})[_0x0332('0x1b')](respondWithStatusCode(_0x5a58e4,null))['catch'](handleError(_0x5a58e4,null));};exports[_0x0332('0xd8')]=function(_0x58cb86,_0x4f8b5e,_0x1fe9f0){var _0xa66d74={};var _0xd4950c={};var _0x423deb;var _0x3d85fa;return db['SmsAccount'][_0x0332('0x61')]({'where':{'id':_0x58cb86[_0x0332('0x51')]['id']}})['then'](handleEntityNotFound(_0x4f8b5e,null))[_0x0332('0x1b')](function(_0x5d7139){if(_0x5d7139){_0x423deb=_0x5d7139;_0xd4950c[_0x0332('0x3c')]=_[_0x0332('0x3e')](db['User'][_0x0332('0x3a')]);_0xd4950c['query']=_['keys'](_0x58cb86[_0x0332('0x3d')]);_0xd4950c['filters']=_[_0x0332('0x40')](_0xd4950c[_0x0332('0x3c')],_0xd4950c[_0x0332('0x3d')]);_0xa66d74['attributes']=_['intersection'](_0xd4950c[_0x0332('0x3c')],qs['fields'](_0x58cb86['query'][_0x0332('0x52')]));_0xa66d74[_0x0332('0x41')]=_0xa66d74[_0x0332('0x41')][_0x0332('0x42')]?_0xa66d74['attributes']:_0xd4950c['model'];_0xa66d74[_0x0332('0x63')]=qs['sort'](_0x58cb86[_0x0332('0x3d')][_0x0332('0x45')]);_0xa66d74['where']=qs[_0x0332('0x3f')](_[_0x0332('0x46')](_0x58cb86[_0x0332('0x3d')],_0xd4950c[_0x0332('0x3f')]));if(_0x58cb86[_0x0332('0x3d')][_0x0332('0x47')]){_0xa66d74[_0x0332('0x48')]=_[_0x0332('0x4b')](_0xa66d74['where'],{'$or':_[_0x0332('0x38')](_0xa66d74[_0x0332('0x41')],function(_0x25832b){var _0x2126ec={};_0x2126ec[_0x25832b]={'$like':'%'+_0x58cb86[_0x0332('0x3d')][_0x0332('0x47')]+'%'};return _0x2126ec;})});}_0xa66d74=_[_0x0332('0x4b')]({},_0xa66d74,_0x58cb86[_0x0332('0x4c')]);return _0x423deb['getAgents'](_0xa66d74);}})[_0x0332('0x1b')](function(_0x1e0398){if(_0x1e0398){_0x3d85fa=_0x1e0398['length'];if(!_0x58cb86[_0x0332('0x3d')][_0x0332('0x43')](_0x0332('0x44'))){_0xa66d74['limit']=qs['limit'](_0x58cb86[_0x0332('0x3d')][_0x0332('0x29')]);_0xa66d74[_0x0332('0x27')]=qs[_0x0332('0x27')](_0x58cb86[_0x0332('0x3d')][_0x0332('0x27')]);}return _0x423deb[_0x0332('0xd8')](_0xa66d74);}})['then'](function(_0x30b6b3){if(_0x30b6b3){return _0x30b6b3?{'count':_0x3d85fa,'rows':_0x30b6b3}:null;}})[_0x0332('0x1b')](respondWithResult(_0x4f8b5e,null))['catch'](handleError(_0x4f8b5e,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 6b5eeca..9d7a136 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 _0xf60a=['SmsAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4adc84,_0xae2c08){var _0x5da55e=function(_0x6dd287){while(--_0x6dd287){_0x4adc84['push'](_0x4adc84['shift']());}};_0x5da55e(++_0xae2c08);}(_0xf60a,0x8a));var _0xaf60=function(_0x3932aa,_0x1af93f){_0x3932aa=_0x3932aa-0x0;var _0x379ab0=_0xf60a[_0x3932aa];return _0x379ab0;};'use strict';var EventEmitter=require(_0xaf60('0x0'));var SmsAccount=require(_0xaf60('0x1'))['db'][_0xaf60('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xaf60('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaf60('0x4'),'afterDestroy':_0xaf60('0x5')};function emitEvent(_0x2a184e){return function(_0x437b27,_0x1c64d1,_0x48d740){SmsAccountEvents[_0xaf60('0x6')](_0x2a184e+':'+_0x437b27['id'],_0x437b27);SmsAccountEvents[_0xaf60('0x6')](_0x2a184e,_0x437b27);_0x48d740(null);};}for(var e in events){if(events[_0xaf60('0x7')](e)){var event=events[e];SmsAccount[_0xaf60('0x8')](e,emitEvent(event));}}module[_0xaf60('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0x6976=['hasOwnProperty','hook','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0x6976,0xe3));var _0x6697=function(_0x4246b4,_0x4cee25){_0x4246b4=_0x4246b4-0x0;var _0x28f8a0=_0x6976[_0x4246b4];return _0x28f8a0;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x6697('0x0'))['db'][_0x6697('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6697('0x2')](0x0);var events={'afterCreate':_0x6697('0x3'),'afterUpdate':_0x6697('0x4'),'afterDestroy':_0x6697('0x5')};function emitEvent(_0xd157b7){return function(_0x42a216,_0x164de6,_0x21dc04){SmsAccountEvents['emit'](_0xd157b7+':'+_0x42a216['id'],_0x42a216);SmsAccountEvents[_0x6697('0x6')](_0xd157b7,_0x42a216);_0x21dc04(null);};}for(var e in events){if(events[_0x6697('0x7')](e)){var event=events[e];SmsAccount[_0x6697('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index d4f2306..c87742c 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 _0xecfd=['api','moment','request-promise','rimraf','SmsAccount'];(function(_0x366547,_0x40e444){var _0x2c3c69=function(_0x167345){while(--_0x167345){_0x366547['push'](_0x366547['shift']());}};_0x2c3c69(++_0x40e444);}(_0xecfd,0x190));var _0xdecf=function(_0x1e47ad,_0x231b11){_0x1e47ad=_0x1e47ad-0x0;var _0x2858aa=_0xecfd[_0x1e47ad];return _0x2858aa;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdecf('0x0'));var moment=require(_0xdecf('0x1'));var BPromise=require('bluebird');var rp=require(_0xdecf('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdecf('0x3'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module['exports']=function(_0x2e5ed8,_0x4011ec){return _0x2e5ed8['define'](_0xdecf('0x4'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdbc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','SmsAccount','lodash','util','api'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbdbc,0x1b5));var _0xcbdb=function(_0x327f1e,_0x203ecd){_0x327f1e=_0x327f1e-0x0;var _0x1753d0=_0xbdbc[_0x327f1e];return _0x1753d0;};'use strict';var _=require(_0xcbdb('0x0'));var util=require(_0xcbdb('0x1'));var logger=require('../../config/logger')(_0xcbdb('0x2'));var moment=require(_0xcbdb('0x3'));var BPromise=require(_0xcbdb('0x4'));var rp=require(_0xcbdb('0x5'));var fs=require('fs');var path=require(_0xcbdb('0x6'));var rimraf=require(_0xcbdb('0x7'));var config=require(_0xcbdb('0x8'));var attributes=require('./smsAccount.attributes');module[_0xcbdb('0x9')]=function(_0x139557,_0x23bd44){return _0x139557['define'](_0xcbdb('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index efb3cc8..7437feb 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 _0xea2d=['../../config/environment','jayson/promise','client','http','redis','localhost','./smsAccount.socket','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowSmsAccount','find','raw','options','include','model','attributes','map','lodash','moment','randomstring','../../config/utils','rpc'];(function(_0x128313,_0x50691d){var _0x77a919=function(_0x320065){while(--_0x320065){_0x128313['push'](_0x128313['shift']());}};_0x77a919(++_0x50691d);}(_0xea2d,0x17b));var _0xdea2=function(_0x5be994,_0x2ed8f2){_0x5be994=_0x5be994-0x0;var _0x107d3d=_0xea2d[_0x5be994];return _0x107d3d;};'use strict';var _=require(_0xdea2('0x0'));var util=require('util');var moment=require(_0xdea2('0x1'));var BPromise=require('bluebird');var rs=require(_0xdea2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdea2('0x3'));var logger=require('../../config/logger')(_0xdea2('0x4'));var config=require(_0xdea2('0x5'));var jayson=require(_0xdea2('0x6'));var client=jayson[_0xdea2('0x7')][_0xdea2('0x8')]({'port':0x232a});config[_0xdea2('0x9')]=_['defaults'](config[_0xdea2('0x9')],{'host':_0xdea2('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdea2('0x9')]));require(_0xdea2('0xb'))['register'](socket);function respondWithRpcPromise(_0x60fb5b,_0x201e91,_0x69e491){return new BPromise(function(_0x4c39ca,_0xa95db1){return client[_0xdea2('0xc')](_0x60fb5b,_0x69e491)[_0xdea2('0xd')](function(_0x10e912){logger['info'](_0xdea2('0xe'),_0x201e91,_0xdea2('0xf'));logger[_0xdea2('0x10')](_0xdea2('0x11'),_0x201e91,'request\x20sent',JSON[_0xdea2('0x12')](_0x10e912));if(_0x10e912[_0xdea2('0x13')]){if(_0x10e912[_0xdea2('0x13')][_0xdea2('0x14')]===0x1f4){logger[_0xdea2('0x13')]('SmsAccount,\x20%s,\x20%s',_0x201e91,_0x10e912[_0xdea2('0x13')][_0xdea2('0x15')]);return _0xa95db1(_0x10e912['error']['message']);}logger['error'](_0xdea2('0xe'),_0x201e91,_0x10e912[_0xdea2('0x13')][_0xdea2('0x15')]);return _0x4c39ca(_0x10e912[_0xdea2('0x13')]['message']);}else{logger[_0xdea2('0x16')](_0xdea2('0xe'),_0x201e91,_0xdea2('0xf'));_0x4c39ca(_0x10e912['result'][_0xdea2('0x15')]);}})[_0xdea2('0x17')](function(_0x1ac069){logger[_0xdea2('0x13')](_0xdea2('0xe'),_0x201e91,_0x1ac069);_0xa95db1(_0x1ac069);});});}exports[_0xdea2('0x18')]=function(_0x59baca){var _0x51cbaa=this;return new Promise(function(_0x3a2101,_0x4b2174){return db['SmsAccount'][_0xdea2('0x19')]({'raw':_0x59baca['options']?_0x59baca['options'][_0xdea2('0x1a')]===undefined?!![]:![]:!![],'where':_0x59baca[_0xdea2('0x1b')]?_0x59baca[_0xdea2('0x1b')]['where']||null:null,'attributes':_0x59baca['options']?_0x59baca[_0xdea2('0x1b')]['attributes']||null:null,'include':_0x59baca[_0xdea2('0x1b')]?_0x59baca[_0xdea2('0x1b')][_0xdea2('0x1c')]?_['map'](_0x59baca[_0xdea2('0x1b')][_0xdea2('0x1c')],function(_0x1272b2){return{'model':db[_0x1272b2[_0xdea2('0x1d')]],'as':_0x1272b2['as'],'attributes':_0x1272b2[_0xdea2('0x1e')],'include':_0x1272b2[_0xdea2('0x1c')]?_['map'](_0x1272b2[_0xdea2('0x1c')],function(_0x3b553a){return{'model':db[_0x3b553a[_0xdea2('0x1d')]],'as':_0x3b553a['as'],'attributes':_0x3b553a[_0xdea2('0x1e')],'include':_0x3b553a[_0xdea2('0x1c')]?_[_0xdea2('0x1f')](_0x3b553a[_0xdea2('0x1c')],function(_0x101590){return{'model':db[_0x101590[_0xdea2('0x1d')]],'as':_0x101590['as'],'attributes':_0x101590[_0xdea2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdea2('0xd')](function(_0x596489){logger[_0xdea2('0x16')](_0xdea2('0x18'),_0x59baca);logger[_0xdea2('0x10')](_0xdea2('0x18'),_0x59baca,JSON[_0xdea2('0x12')](_0x596489));_0x3a2101(_0x596489);})['catch'](function(_0x507e8b){logger[_0xdea2('0x13')](_0xdea2('0x18'),_0x507e8b[_0xdea2('0x15')],_0x59baca);_0x4b2174(_0x51cbaa[_0xdea2('0x13')](0x1f4,_0x507e8b[_0xdea2('0x15')]));});});}; \ No newline at end of file +var _0x7e7b=['map','debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','socket.io-emitter','register','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ShowSmsAccount','SmsAccount','find','options','raw','attributes','include','model'];(function(_0x5f511f,_0x57a484){var _0x30aa77=function(_0x52bb2d){while(--_0x52bb2d){_0x5f511f['push'](_0x5f511f['shift']());}};_0x30aa77(++_0x57a484);}(_0x7e7b,0x1e3));var _0xb7e7=function(_0x53f485,_0x3f00e1){_0x53f485=_0x53f485-0x0;var _0x2efc6c=_0x7e7b[_0x53f485];return _0x2efc6c;};'use strict';var _=require('lodash');var util=require(_0xb7e7('0x0'));var moment=require(_0xb7e7('0x1'));var BPromise=require(_0xb7e7('0x2'));var rs=require(_0xb7e7('0x3'));var fs=require('fs');var Redis=require(_0xb7e7('0x4'));var db=require(_0xb7e7('0x5'))['db'];var utils=require(_0xb7e7('0x6'));var logger=require('../../config/logger')(_0xb7e7('0x7'));var config=require(_0xb7e7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb7e7('0x9')]({'port':0x232a});config[_0xb7e7('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb7e7('0xb'))(new Redis(config[_0xb7e7('0xa')]));require('./smsAccount.socket')[_0xb7e7('0xc')](socket);function respondWithRpcPromise(_0x4418ae,_0xb8dc49,_0x51ab89){return new BPromise(function(_0x1e9154,_0x37eca0){return client['request'](_0x4418ae,_0x51ab89)[_0xb7e7('0xd')](function(_0x394bc2){logger[_0xb7e7('0xe')](_0xb7e7('0xf'),_0xb8dc49,'request\x20sent');logger['debug'](_0xb7e7('0x10'),_0xb8dc49,_0xb7e7('0x11'),JSON['stringify'](_0x394bc2));if(_0x394bc2[_0xb7e7('0x12')]){if(_0x394bc2['error'][_0xb7e7('0x13')]===0x1f4){logger[_0xb7e7('0x12')](_0xb7e7('0xf'),_0xb8dc49,_0x394bc2[_0xb7e7('0x12')][_0xb7e7('0x14')]);return _0x37eca0(_0x394bc2[_0xb7e7('0x12')]['message']);}logger[_0xb7e7('0x12')]('SmsAccount,\x20%s,\x20%s',_0xb8dc49,_0x394bc2[_0xb7e7('0x12')][_0xb7e7('0x14')]);return _0x1e9154(_0x394bc2[_0xb7e7('0x12')][_0xb7e7('0x14')]);}else{logger[_0xb7e7('0xe')](_0xb7e7('0xf'),_0xb8dc49,_0xb7e7('0x11'));_0x1e9154(_0x394bc2['result'][_0xb7e7('0x14')]);}})['catch'](function(_0x5d8e65){logger[_0xb7e7('0x12')](_0xb7e7('0xf'),_0xb8dc49,_0x5d8e65);_0x37eca0(_0x5d8e65);});});}exports[_0xb7e7('0x15')]=function(_0x2b0187){var _0x3203d0=this;return new Promise(function(_0x10fb5e,_0x555455){return db[_0xb7e7('0x16')][_0xb7e7('0x17')]({'raw':_0x2b0187[_0xb7e7('0x18')]?_0x2b0187[_0xb7e7('0x18')][_0xb7e7('0x19')]===undefined?!![]:![]:!![],'where':_0x2b0187[_0xb7e7('0x18')]?_0x2b0187[_0xb7e7('0x18')]['where']||null:null,'attributes':_0x2b0187[_0xb7e7('0x18')]?_0x2b0187[_0xb7e7('0x18')][_0xb7e7('0x1a')]||null:null,'include':_0x2b0187[_0xb7e7('0x18')]?_0x2b0187['options'][_0xb7e7('0x1b')]?_['map'](_0x2b0187[_0xb7e7('0x18')][_0xb7e7('0x1b')],function(_0x12c8af){return{'model':db[_0x12c8af[_0xb7e7('0x1c')]],'as':_0x12c8af['as'],'attributes':_0x12c8af[_0xb7e7('0x1a')],'include':_0x12c8af['include']?_[_0xb7e7('0x1d')](_0x12c8af[_0xb7e7('0x1b')],function(_0x5ef7c7){return{'model':db[_0x5ef7c7['model']],'as':_0x5ef7c7['as'],'attributes':_0x5ef7c7[_0xb7e7('0x1a')],'include':_0x5ef7c7[_0xb7e7('0x1b')]?_[_0xb7e7('0x1d')](_0x5ef7c7[_0xb7e7('0x1b')],function(_0x5d3540){return{'model':db[_0x5d3540[_0xb7e7('0x1c')]],'as':_0x5d3540['as'],'attributes':_0x5d3540[_0xb7e7('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b721c){logger['info'](_0xb7e7('0x15'),_0x2b0187);logger[_0xb7e7('0x1e')](_0xb7e7('0x15'),_0x2b0187,JSON['stringify'](_0x5b721c));_0x10fb5e(_0x5b721c);})[_0xb7e7('0x1f')](function(_0x53fefe){logger[_0xb7e7('0x12')](_0xb7e7('0x15'),_0x53fefe['message'],_0x2b0187);_0x555455(_0x3203d0[_0xb7e7('0x12')](0x1f4,_0x53fefe['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 7622ab3..6654984 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 293ab2f..1b53fb1 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(_0x95121c,_0x33e189){var _0x34d2b5=function(_0x5ce65d){while(--_0x5ce65d){_0x95121c['push'](_0x95121c['shift']());}};_0x34d2b5(++_0x33e189);}(_0xe14b,0x93));var _0xbe14=function(_0x4a214c,_0x4ce604){_0x4a214c=_0x4a214c-0x0;var _0xc0eb7b=_0xe14b[_0x4a214c];return _0xc0eb7b;};'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 _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x27ebe8,_0x21dd01){var _0x431778=function(_0xcf97c6){while(--_0xcf97c6){_0x27ebe8['push'](_0x27ebe8['shift']());}};_0x431778(++_0x21dd01);}(_0x3e74,0x175));var _0x43e7=function(_0x3f34b7,_0xd0b271){_0x3f34b7=_0x3f34b7-0x0;var _0x6e797=_0x3e74[_0x3f34b7];return _0x6e797;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 7a402d4..b297b10 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 _0xf6a5=['*,*,*,*','sequelize','INTEGER','TEXT','STRING'];(function(_0x2351c4,_0x1dca54){var _0x1dd3f8=function(_0x4c3fa2){while(--_0x4c3fa2){_0x2351c4['push'](_0x2351c4['shift']());}};_0x1dd3f8(++_0x1dca54);}(_0xf6a5,0x1eb));var _0x5f6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf6a5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5f6a('0x0'));module['exports']={'priority':{'type':Sequelize[_0x5f6a('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5f6a('0x2')]()},'description':{'type':Sequelize[_0x5f6a('0x3')]},'interval':{'type':Sequelize[_0x5f6a('0x3')],'defaultValue':_0x5f6a('0x4')}}; \ No newline at end of file +var _0x50ce=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0xe96931,_0x2f59d7){var _0x332f08=function(_0x400f8c){while(--_0x400f8c){_0xe96931['push'](_0xe96931['shift']());}};_0x332f08(++_0x2f59d7);}(_0x50ce,0x1ef));var _0xe50c=function(_0x38ecda,_0x3b551e){_0x38ecda=_0x38ecda-0x0;var _0x3fa8f3=_0x50ce[_0x38ecda];return _0x3fa8f3;};'use strict';var Sequelize=require(_0xe50c('0x0'));module[_0xe50c('0x1')]={'priority':{'type':Sequelize[_0xe50c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe50c('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe50c('0x4')]()},'description':{'type':Sequelize[_0xe50c('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xe50c('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 7f53800..1b2aad1 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 _0xdd32=['jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','type','VIRTUAL','options','where','SmsApplication','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','lodash','squel','crypto'];(function(_0x3e25e5,_0x57e59b){var _0x105686=function(_0x5a394f){while(--_0x5a394f){_0x3e25e5['push'](_0x3e25e5['shift']());}};_0x105686(++_0x57e59b);}(_0xdd32,0x166));var _0x2dd3=function(_0x160e9f,_0x21072f){_0x160e9f=_0x160e9f-0x0;var _0x1712f8=_0xdd32[_0x160e9f];return _0x1712f8;};'use strict';var emlformat=require(_0x2dd3('0x0'));var rimraf=require(_0x2dd3('0x1'));var zipdir=require(_0x2dd3('0x2'));var jsonpatch=require(_0x2dd3('0x3'));var rp=require(_0x2dd3('0x4'));var moment=require(_0x2dd3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2dd3('0x6'));var util=require('util');var path=require(_0x2dd3('0x7'));var sox=require('sox');var csv=require(_0x2dd3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2dd3('0x9'));var squel=require(_0x2dd3('0xa'));var crypto=require(_0x2dd3('0xb'));var jsforce=require(_0x2dd3('0xc'));var deskjs=require(_0x2dd3('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2dd3('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2dd3('0xf'));var qs=require(_0x2dd3('0x10'));var as=require(_0x2dd3('0x11'));var hardwareService=require(_0x2dd3('0x12'));var logger=require('../../config/logger')(_0x2dd3('0x13'));var utils=require('../../config/utils');var config=require(_0x2dd3('0x14'));var licenseUtil=require(_0x2dd3('0x15'));var db=require(_0x2dd3('0x16'))['db'];function respondWithStatusCode(_0x2d2e28,_0xc10dd4){_0xc10dd4=_0xc10dd4||0xcc;return function(_0x441da7){if(_0x441da7){return _0x2d2e28[_0x2dd3('0x17')](_0xc10dd4);}return _0x2d2e28['status'](_0xc10dd4)[_0x2dd3('0x18')]();};}function respondWithResult(_0x1c87b7,_0x353921){_0x353921=_0x353921||0xc8;return function(_0x23092b){if(_0x23092b){return _0x1c87b7[_0x2dd3('0x19')](_0x353921)[_0x2dd3('0x1a')](_0x23092b);}};}function respondWithFilteredResult(_0x26eb7f,_0x413db7){return function(_0x5b98a0){if(_0x5b98a0){var _0x3409b6=typeof _0x413db7[_0x2dd3('0x1b')]===_0x2dd3('0x1c')&&typeof _0x413db7[_0x2dd3('0x1d')]===_0x2dd3('0x1c');var _0x4d7578=_0x5b98a0['count'];var _0x417357=_0x3409b6?0x0:_0x413db7['offset'];var _0x53bef8=_0x3409b6?_0x5b98a0[_0x2dd3('0x1e')]:_0x413db7[_0x2dd3('0x1b')]+_0x413db7[_0x2dd3('0x1d')];var _0x3f859b;if(_0x53bef8>=_0x4d7578){_0x53bef8=_0x4d7578;_0x3f859b=0xc8;}else{_0x3f859b=0xce;}_0x26eb7f[_0x2dd3('0x19')](_0x3f859b);return _0x26eb7f[_0x2dd3('0x1f')](_0x2dd3('0x20'),_0x417357+'-'+_0x53bef8+'/'+_0x4d7578)[_0x2dd3('0x1a')](_0x5b98a0);}return null;};}function patchUpdates(_0x5ae3a3){return function(_0x57b767){try{jsonpatch[_0x2dd3('0x21')](_0x57b767,_0x5ae3a3,!![]);}catch(_0x552582){return BPromise[_0x2dd3('0x22')](_0x552582);}return _0x57b767[_0x2dd3('0x23')]();};}function saveUpdates(_0x355f78,_0x75a43c){return function(_0x106321){if(_0x106321){return _0x106321['update'](_0x355f78)[_0x2dd3('0x24')](function(_0x1b386b){return _0x1b386b;});}return null;};}function removeEntity(_0x40afc2,_0x3e1cc4){return function(_0x201b68){if(_0x201b68){return _0x201b68[_0x2dd3('0x25')]()[_0x2dd3('0x24')](function(){_0x40afc2[_0x2dd3('0x19')](0xcc)[_0x2dd3('0x18')]();});}};}function handleEntityNotFound(_0x3ccca5,_0x352473){return function(_0x358d45){if(!_0x358d45){_0x3ccca5[_0x2dd3('0x17')](0x194);}return _0x358d45;};}function handleError(_0x783887,_0x5f38ac){_0x5f38ac=_0x5f38ac||0x1f4;return function(_0x500e28){logger[_0x2dd3('0x26')](_0x500e28[_0x2dd3('0x27')]);if(_0x500e28['name']){delete _0x500e28[_0x2dd3('0x28')];}_0x783887[_0x2dd3('0x19')](_0x5f38ac)['send'](_0x500e28);};}exports[_0x2dd3('0x29')]=function(_0x46365e,_0x34954a){var _0x44cfae={},_0x4eec52={},_0x1bf90c={'count':0x0,'rows':[]};var _0x1ddf41=_[_0x2dd3('0x2a')](db['SmsApplication']['rawAttributes'],function(_0x7299c0){return{'name':_0x7299c0[_0x2dd3('0x2b')],'type':_0x7299c0['type'][_0x2dd3('0x2c')]};});_0x4eec52[_0x2dd3('0x2d')]=_[_0x2dd3('0x2a')](_0x1ddf41,_0x2dd3('0x28'));_0x4eec52['query']=_['keys'](_0x46365e[_0x2dd3('0x2e')]);_0x4eec52[_0x2dd3('0x2f')]=_[_0x2dd3('0x30')](_0x4eec52[_0x2dd3('0x2d')],_0x4eec52['query']);_0x44cfae[_0x2dd3('0x31')]=_['intersection'](_0x4eec52[_0x2dd3('0x2d')],qs[_0x2dd3('0x32')](_0x46365e['query'][_0x2dd3('0x32')]));_0x44cfae[_0x2dd3('0x31')]=_0x44cfae[_0x2dd3('0x31')][_0x2dd3('0x33')]?_0x44cfae[_0x2dd3('0x31')]:_0x4eec52[_0x2dd3('0x2d')];if(!_0x46365e[_0x2dd3('0x2e')][_0x2dd3('0x34')]('nolimit')){_0x44cfae[_0x2dd3('0x1d')]=qs['limit'](_0x46365e[_0x2dd3('0x2e')][_0x2dd3('0x1d')]);_0x44cfae[_0x2dd3('0x1b')]=qs[_0x2dd3('0x1b')](_0x46365e[_0x2dd3('0x2e')]['offset']);}_0x44cfae[_0x2dd3('0x35')]=qs[_0x2dd3('0x36')](_0x46365e[_0x2dd3('0x2e')][_0x2dd3('0x36')]);_0x44cfae['where']=qs[_0x2dd3('0x2f')](_['pick'](_0x46365e[_0x2dd3('0x2e')],_0x4eec52[_0x2dd3('0x2f')]),_0x1ddf41);if(_0x46365e[_0x2dd3('0x2e')][_0x2dd3('0x37')]){_0x44cfae['where']=_[_0x2dd3('0x38')](_0x44cfae['where'],{'$or':_[_0x2dd3('0x2a')](_0x1ddf41,function(_0x251771){if(_0x251771[_0x2dd3('0x39')]!==_0x2dd3('0x3a')){var _0x3c733f={};_0x3c733f[_0x251771[_0x2dd3('0x28')]]={'$like':'%'+_0x46365e[_0x2dd3('0x2e')]['filter']+'%'};return _0x3c733f;}})});}_0x44cfae=_[_0x2dd3('0x38')]({},_0x44cfae,_0x46365e[_0x2dd3('0x3b')]);var _0x3d2862={'where':_0x44cfae[_0x2dd3('0x3c')]};return db[_0x2dd3('0x3d')][_0x2dd3('0x1e')](_0x3d2862)[_0x2dd3('0x24')](function(_0x21c77d){_0x1bf90c['count']=_0x21c77d;if(_0x46365e[_0x2dd3('0x2e')][_0x2dd3('0x3e')]){_0x44cfae[_0x2dd3('0x3f')]=[{'all':!![]}];}return db['SmsApplication'][_0x2dd3('0x40')](_0x44cfae);})[_0x2dd3('0x24')](function(_0x1b98d2){_0x1bf90c['rows']=_0x1b98d2;return _0x1bf90c;})['then'](respondWithFilteredResult(_0x34954a,_0x44cfae))[_0x2dd3('0x41')](handleError(_0x34954a,null));};exports[_0x2dd3('0x42')]=function(_0xab612a,_0xe5460f){var _0x397ed1={'raw':!![],'where':{'id':_0xab612a[_0x2dd3('0x43')]['id']}},_0x46c93e={};_0x46c93e[_0x2dd3('0x2d')]=_[_0x2dd3('0x44')](db[_0x2dd3('0x3d')][_0x2dd3('0x45')]);_0x46c93e[_0x2dd3('0x2e')]=_['keys'](_0xab612a[_0x2dd3('0x2e')]);_0x46c93e[_0x2dd3('0x2f')]=_['intersection'](_0x46c93e[_0x2dd3('0x2d')],_0x46c93e['query']);_0x397ed1[_0x2dd3('0x31')]=_[_0x2dd3('0x30')](_0x46c93e[_0x2dd3('0x2d')],qs['fields'](_0xab612a[_0x2dd3('0x2e')][_0x2dd3('0x32')]));_0x397ed1[_0x2dd3('0x31')]=_0x397ed1[_0x2dd3('0x31')]['length']?_0x397ed1[_0x2dd3('0x31')]:_0x46c93e[_0x2dd3('0x2d')];if(_0xab612a[_0x2dd3('0x2e')]['includeAll']){_0x397ed1[_0x2dd3('0x3f')]=[{'all':!![]}];}_0x397ed1=_[_0x2dd3('0x38')]({},_0x397ed1,_0xab612a[_0x2dd3('0x3b')]);return db['SmsApplication'][_0x2dd3('0x46')](_0x397ed1)[_0x2dd3('0x24')](handleEntityNotFound(_0xe5460f,null))[_0x2dd3('0x24')](respondWithResult(_0xe5460f,null))['catch'](handleError(_0xe5460f,null));};exports[_0x2dd3('0x47')]=function(_0x1a8694,_0x54b1b8){return db[_0x2dd3('0x3d')][_0x2dd3('0x47')](_0x1a8694[_0x2dd3('0x48')],{})[_0x2dd3('0x24')](respondWithResult(_0x54b1b8,0xc9))['catch'](handleError(_0x54b1b8,null));};exports[_0x2dd3('0x49')]=function(_0xe3a7ce,_0x1f2b1b){if(_0xe3a7ce[_0x2dd3('0x48')]['id']){delete _0xe3a7ce[_0x2dd3('0x48')]['id'];}return db[_0x2dd3('0x3d')][_0x2dd3('0x46')]({'where':{'id':_0xe3a7ce[_0x2dd3('0x43')]['id']}})[_0x2dd3('0x24')](handleEntityNotFound(_0x1f2b1b,null))[_0x2dd3('0x24')](saveUpdates(_0xe3a7ce[_0x2dd3('0x48')],null))[_0x2dd3('0x24')](respondWithResult(_0x1f2b1b,null))['catch'](handleError(_0x1f2b1b,null));};exports['destroy']=function(_0x10ebfb,_0x28e56b){return db[_0x2dd3('0x3d')][_0x2dd3('0x46')]({'where':{'id':_0x10ebfb[_0x2dd3('0x43')]['id']}})[_0x2dd3('0x24')](handleEntityNotFound(_0x28e56b,null))[_0x2dd3('0x24')](removeEntity(_0x28e56b,null))['catch'](handleError(_0x28e56b,null));}; \ No newline at end of file +var _0x4e5a=['send','map','SmsApplication','rawAttributes','fieldName','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','include','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name'];(function(_0xdeb958,_0x38bb5e){var _0x489ddf=function(_0x2c236a){while(--_0x2c236a){_0xdeb958['push'](_0xdeb958['shift']());}};_0x489ddf(++_0x38bb5e);}(_0x4e5a,0xb8));var _0xa4e5=function(_0x1bfc7b,_0x360a77){_0x1bfc7b=_0x1bfc7b-0x0;var _0x3004cf=_0x4e5a[_0x1bfc7b];return _0x3004cf;};'use strict';var emlformat=require(_0xa4e5('0x0'));var rimraf=require(_0xa4e5('0x1'));var zipdir=require(_0xa4e5('0x2'));var jsonpatch=require(_0xa4e5('0x3'));var rp=require(_0xa4e5('0x4'));var moment=require(_0xa4e5('0x5'));var BPromise=require(_0xa4e5('0x6'));var Mustache=require(_0xa4e5('0x7'));var util=require(_0xa4e5('0x8'));var path=require(_0xa4e5('0x9'));var sox=require('sox');var csv=require(_0xa4e5('0xa'));var ejs=require(_0xa4e5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa4e5('0xc'));var squel=require('squel');var crypto=require(_0xa4e5('0xd'));var jsforce=require(_0xa4e5('0xe'));var deskjs=require(_0xa4e5('0xf'));var toCsv=require(_0xa4e5('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa4e5('0x10'));var qs=require(_0xa4e5('0x11'));var as=require(_0xa4e5('0x12'));var hardwareService=require(_0xa4e5('0x13'));var logger=require(_0xa4e5('0x14'))(_0xa4e5('0x15'));var utils=require(_0xa4e5('0x16'));var config=require(_0xa4e5('0x17'));var licenseUtil=require(_0xa4e5('0x18'));var db=require(_0xa4e5('0x19'))['db'];function respondWithStatusCode(_0x354b56,_0x5e8123){_0x5e8123=_0x5e8123||0xcc;return function(_0x38ea51){if(_0x38ea51){return _0x354b56[_0xa4e5('0x1a')](_0x5e8123);}return _0x354b56['status'](_0x5e8123)[_0xa4e5('0x1b')]();};}function respondWithResult(_0x58b8d4,_0x3143f0){_0x3143f0=_0x3143f0||0xc8;return function(_0x3640da){if(_0x3640da){return _0x58b8d4[_0xa4e5('0x1c')](_0x3143f0)['json'](_0x3640da);}};}function respondWithFilteredResult(_0x1d3be4,_0x1d4b1b){return function(_0x4b0f49){if(_0x4b0f49){var _0xa3fdc3=typeof _0x1d4b1b[_0xa4e5('0x1d')]===_0xa4e5('0x1e')&&typeof _0x1d4b1b[_0xa4e5('0x1f')]===_0xa4e5('0x1e');var _0x569754=_0x4b0f49[_0xa4e5('0x20')];var _0x4a7bb5=_0xa3fdc3?0x0:_0x1d4b1b[_0xa4e5('0x1d')];var _0x5468cc=_0xa3fdc3?_0x4b0f49[_0xa4e5('0x20')]:_0x1d4b1b[_0xa4e5('0x1d')]+_0x1d4b1b[_0xa4e5('0x1f')];var _0x541113;if(_0x5468cc>=_0x569754){_0x5468cc=_0x569754;_0x541113=0xc8;}else{_0x541113=0xce;}_0x1d3be4[_0xa4e5('0x1c')](_0x541113);return _0x1d3be4[_0xa4e5('0x21')]('Content-Range',_0x4a7bb5+'-'+_0x5468cc+'/'+_0x569754)['json'](_0x4b0f49);}return null;};}function patchUpdates(_0xb9f7da){return function(_0x42afd4){try{jsonpatch[_0xa4e5('0x22')](_0x42afd4,_0xb9f7da,!![]);}catch(_0x343d59){return BPromise[_0xa4e5('0x23')](_0x343d59);}return _0x42afd4[_0xa4e5('0x24')]();};}function saveUpdates(_0x3ac38c,_0x33cadb){return function(_0x2b24e5){if(_0x2b24e5){return _0x2b24e5[_0xa4e5('0x25')](_0x3ac38c)[_0xa4e5('0x26')](function(_0x4a035e){return _0x4a035e;});}return null;};}function removeEntity(_0x3e735a,_0x55b8c1){return function(_0x1a1635){if(_0x1a1635){return _0x1a1635['destroy']()[_0xa4e5('0x26')](function(){_0x3e735a[_0xa4e5('0x1c')](0xcc)[_0xa4e5('0x1b')]();});}};}function handleEntityNotFound(_0x4d1188,_0x55a823){return function(_0x50418d){if(!_0x50418d){_0x4d1188['sendStatus'](0x194);}return _0x50418d;};}function handleError(_0x57aaf0,_0x189998){_0x189998=_0x189998||0x1f4;return function(_0x1c6424){logger['error'](_0x1c6424[_0xa4e5('0x27')]);if(_0x1c6424[_0xa4e5('0x28')]){delete _0x1c6424['name'];}_0x57aaf0[_0xa4e5('0x1c')](_0x189998)[_0xa4e5('0x29')](_0x1c6424);};}exports['index']=function(_0x358b58,_0x3cfa07){var _0x5ac87d={},_0x3d8a5b={},_0x1562b3={'count':0x0,'rows':[]};var _0x1c1fb1=_[_0xa4e5('0x2a')](db[_0xa4e5('0x2b')][_0xa4e5('0x2c')],function(_0x2efcb1){return{'name':_0x2efcb1[_0xa4e5('0x2d')],'type':_0x2efcb1['type']['key']};});_0x3d8a5b['model']=_[_0xa4e5('0x2a')](_0x1c1fb1,_0xa4e5('0x28'));_0x3d8a5b[_0xa4e5('0x2e')]=_[_0xa4e5('0x2f')](_0x358b58[_0xa4e5('0x2e')]);_0x3d8a5b['filters']=_[_0xa4e5('0x30')](_0x3d8a5b['model'],_0x3d8a5b['query']);_0x5ac87d[_0xa4e5('0x31')]=_[_0xa4e5('0x30')](_0x3d8a5b['model'],qs[_0xa4e5('0x32')](_0x358b58[_0xa4e5('0x2e')][_0xa4e5('0x32')]));_0x5ac87d['attributes']=_0x5ac87d[_0xa4e5('0x31')][_0xa4e5('0x33')]?_0x5ac87d['attributes']:_0x3d8a5b[_0xa4e5('0x34')];if(!_0x358b58['query'][_0xa4e5('0x35')](_0xa4e5('0x36'))){_0x5ac87d[_0xa4e5('0x1f')]=qs[_0xa4e5('0x1f')](_0x358b58[_0xa4e5('0x2e')][_0xa4e5('0x1f')]);_0x5ac87d[_0xa4e5('0x1d')]=qs[_0xa4e5('0x1d')](_0x358b58[_0xa4e5('0x2e')][_0xa4e5('0x1d')]);}_0x5ac87d[_0xa4e5('0x37')]=qs[_0xa4e5('0x38')](_0x358b58[_0xa4e5('0x2e')][_0xa4e5('0x38')]);_0x5ac87d[_0xa4e5('0x39')]=qs[_0xa4e5('0x3a')](_[_0xa4e5('0x3b')](_0x358b58[_0xa4e5('0x2e')],_0x3d8a5b['filters']),_0x1c1fb1);if(_0x358b58[_0xa4e5('0x2e')][_0xa4e5('0x3c')]){_0x5ac87d['where']=_['merge'](_0x5ac87d[_0xa4e5('0x39')],{'$or':_['map'](_0x1c1fb1,function(_0x4ebc24){if(_0x4ebc24[_0xa4e5('0x3d')]!==_0xa4e5('0x3e')){var _0x2605d0={};_0x2605d0[_0x4ebc24[_0xa4e5('0x28')]]={'$like':'%'+_0x358b58[_0xa4e5('0x2e')][_0xa4e5('0x3c')]+'%'};return _0x2605d0;}})});}_0x5ac87d=_[_0xa4e5('0x3f')]({},_0x5ac87d,_0x358b58[_0xa4e5('0x40')]);var _0x13b205={'where':_0x5ac87d['where']};return db[_0xa4e5('0x2b')][_0xa4e5('0x20')](_0x13b205)[_0xa4e5('0x26')](function(_0x1d2c23){_0x1562b3[_0xa4e5('0x20')]=_0x1d2c23;if(_0x358b58[_0xa4e5('0x2e')][_0xa4e5('0x41')]){_0x5ac87d['include']=[{'all':!![]}];}return db[_0xa4e5('0x2b')][_0xa4e5('0x42')](_0x5ac87d);})[_0xa4e5('0x26')](function(_0x23d5f6){_0x1562b3[_0xa4e5('0x43')]=_0x23d5f6;return _0x1562b3;})[_0xa4e5('0x26')](respondWithFilteredResult(_0x3cfa07,_0x5ac87d))['catch'](handleError(_0x3cfa07,null));};exports['show']=function(_0x8352e1,_0x1c1f4b){var _0x354eac={'raw':!![],'where':{'id':_0x8352e1['params']['id']}},_0x3f6e07={};_0x3f6e07[_0xa4e5('0x34')]=_['keys'](db['SmsApplication'][_0xa4e5('0x2c')]);_0x3f6e07[_0xa4e5('0x2e')]=_[_0xa4e5('0x2f')](_0x8352e1[_0xa4e5('0x2e')]);_0x3f6e07[_0xa4e5('0x3a')]=_[_0xa4e5('0x30')](_0x3f6e07['model'],_0x3f6e07[_0xa4e5('0x2e')]);_0x354eac[_0xa4e5('0x31')]=_[_0xa4e5('0x30')](_0x3f6e07[_0xa4e5('0x34')],qs['fields'](_0x8352e1[_0xa4e5('0x2e')][_0xa4e5('0x32')]));_0x354eac['attributes']=_0x354eac[_0xa4e5('0x31')][_0xa4e5('0x33')]?_0x354eac[_0xa4e5('0x31')]:_0x3f6e07[_0xa4e5('0x34')];if(_0x8352e1[_0xa4e5('0x2e')][_0xa4e5('0x41')]){_0x354eac[_0xa4e5('0x44')]=[{'all':!![]}];}_0x354eac=_['merge']({},_0x354eac,_0x8352e1[_0xa4e5('0x40')]);return db[_0xa4e5('0x2b')][_0xa4e5('0x45')](_0x354eac)[_0xa4e5('0x26')](handleEntityNotFound(_0x1c1f4b,null))['then'](respondWithResult(_0x1c1f4b,null))[_0xa4e5('0x46')](handleError(_0x1c1f4b,null));};exports[_0xa4e5('0x47')]=function(_0x423a28,_0x2aee08){return db[_0xa4e5('0x2b')][_0xa4e5('0x47')](_0x423a28[_0xa4e5('0x48')],{})[_0xa4e5('0x26')](respondWithResult(_0x2aee08,0xc9))[_0xa4e5('0x46')](handleError(_0x2aee08,null));};exports[_0xa4e5('0x25')]=function(_0x49c76a,_0x36e009){if(_0x49c76a[_0xa4e5('0x48')]['id']){delete _0x49c76a['body']['id'];}return db[_0xa4e5('0x2b')][_0xa4e5('0x45')]({'where':{'id':_0x49c76a[_0xa4e5('0x49')]['id']}})['then'](handleEntityNotFound(_0x36e009,null))[_0xa4e5('0x26')](saveUpdates(_0x49c76a[_0xa4e5('0x48')],null))[_0xa4e5('0x26')](respondWithResult(_0x36e009,null))[_0xa4e5('0x46')](handleError(_0x36e009,null));};exports[_0xa4e5('0x4a')]=function(_0x1dbe43,_0x5645d1){return db['SmsApplication']['find']({'where':{'id':_0x1dbe43[_0xa4e5('0x49')]['id']}})[_0xa4e5('0x26')](handleEntityNotFound(_0x5645d1,null))[_0xa4e5('0x26')](removeEntity(_0x5645d1,null))['catch'](handleError(_0x5645d1,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 6ad7fcb..5c051ca 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 _0x28e6=['rimraf','./smsApplication.attributes','exports','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x28e6,0xb7));var _0x628e=function(_0x4adafa,_0x32de75){_0x4adafa=_0x4adafa-0x0;var _0xc594b3=_0x28e6[_0x4adafa];return _0xc594b3;};'use strict';var _=require('lodash');var util=require(_0x628e('0x0'));var logger=require('../../config/logger')(_0x628e('0x1'));var moment=require('moment');var BPromise=require(_0x628e('0x2'));var rp=require(_0x628e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x628e('0x4'));var config=require('../../config/environment');var attributes=require(_0x628e('0x5'));module[_0x628e('0x6')]=function(_0x223c7f,_0x1ef246){return _0x223c7f[_0x628e('0x7')](_0x628e('0x8'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x628e('0x9'),'collate':_0x628e('0xa')});}; \ No newline at end of file +var _0x2873=['define','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0x2873,0x1f2));var _0x3287=function(_0x5dec53,_0x19cb42){_0x5dec53=_0x5dec53-0x0;var _0x2df8a2=_0x2873[_0x5dec53];return _0x2df8a2;};'use strict';var _=require(_0x3287('0x0'));var util=require(_0x3287('0x1'));var logger=require(_0x3287('0x2'))(_0x3287('0x3'));var moment=require('moment');var BPromise=require(_0x3287('0x4'));var rp=require(_0x3287('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3287('0x6'));var config=require(_0x3287('0x7'));var attributes=require('./smsApplication.attributes');module[_0x3287('0x8')]=function(_0x795e58,_0x5b30c4){return _0x795e58[_0x3287('0x9')]('SmsApplication',attributes,{'tableName':_0x3287('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3287('0xb'),'collate':_0x3287('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index f31ee36..edee8fa 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 _0x97e6=['SmsApplication,\x20%s,\x20%s,\x20%s','error','message','info','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x231473,_0x33b93e){var _0x16d666=function(_0x35ed3a){while(--_0x35ed3a){_0x231473['push'](_0x231473['shift']());}};_0x16d666(++_0x33b93e);}(_0x97e6,0x159));var _0x697e=function(_0x2da357,_0x1f9b2f){_0x2da357=_0x2da357-0x0;var _0x138fdd=_0x97e6[_0x2da357];return _0x138fdd;};'use strict';var _=require(_0x697e('0x0'));var util=require('util');var moment=require(_0x697e('0x1'));var BPromise=require(_0x697e('0x2'));var rs=require(_0x697e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x697e('0x4'))['db'];var utils=require(_0x697e('0x5'));var logger=require('../../config/logger')(_0x697e('0x6'));var config=require('../../config/environment');var jayson=require(_0x697e('0x7'));var client=jayson[_0x697e('0x8')][_0x697e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x546438,_0x371e2f,_0x21b9d5){return new BPromise(function(_0x4cf39f,_0x5670e3){return client[_0x697e('0xa')](_0x546438,_0x21b9d5)[_0x697e('0xb')](function(_0x2499f6){logger['info'](_0x697e('0xc'),_0x371e2f,_0x697e('0xd'));logger[_0x697e('0xe')](_0x697e('0xf'),_0x371e2f,_0x697e('0xd'),JSON['stringify'](_0x2499f6));if(_0x2499f6[_0x697e('0x10')]){if(_0x2499f6['error']['code']===0x1f4){logger[_0x697e('0x10')](_0x697e('0xc'),_0x371e2f,_0x2499f6[_0x697e('0x10')]['message']);return _0x5670e3(_0x2499f6[_0x697e('0x10')][_0x697e('0x11')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x371e2f,_0x2499f6[_0x697e('0x10')][_0x697e('0x11')]);return _0x4cf39f(_0x2499f6[_0x697e('0x10')][_0x697e('0x11')]);}else{logger[_0x697e('0x12')](_0x697e('0xc'),_0x371e2f,_0x697e('0xd'));_0x4cf39f(_0x2499f6[_0x697e('0x13')][_0x697e('0x11')]);}})['catch'](function(_0x316bdb){logger[_0x697e('0x10')]('SmsApplication,\x20%s,\x20%s',_0x371e2f,_0x316bdb);_0x5670e3(_0x316bdb);});});} \ No newline at end of file +var _0x94d4=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','message','SmsApplication,\x20%s,\x20%s','result','catch','lodash','util','bluebird'];(function(_0x4710e,_0x1c425c){var _0x501072=function(_0x4870d7){while(--_0x4870d7){_0x4710e['push'](_0x4710e['shift']());}};_0x501072(++_0x1c425c);}(_0x94d4,0xa5));var _0x494d=function(_0x5ce3da,_0xa84af){_0x5ce3da=_0x5ce3da-0x0;var _0x5ec3a8=_0x94d4[_0x5ce3da];return _0x5ec3a8;};'use strict';var _=require(_0x494d('0x0'));var util=require(_0x494d('0x1'));var moment=require('moment');var BPromise=require(_0x494d('0x2'));var rs=require(_0x494d('0x3'));var fs=require('fs');var Redis=require(_0x494d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x494d('0x5'));var logger=require(_0x494d('0x6'))(_0x494d('0x7'));var config=require(_0x494d('0x8'));var jayson=require(_0x494d('0x9'));var client=jayson[_0x494d('0xa')][_0x494d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c53d7,_0x4f4576,_0x5269db){return new BPromise(function(_0x396280,_0x3f6b68){return client['request'](_0x4c53d7,_0x5269db)['then'](function(_0x456fe8){logger[_0x494d('0xc')]('SmsApplication,\x20%s,\x20%s',_0x4f4576,_0x494d('0xd'));logger[_0x494d('0xe')](_0x494d('0xf'),_0x4f4576,_0x494d('0xd'),JSON['stringify'](_0x456fe8));if(_0x456fe8[_0x494d('0x10')]){if(_0x456fe8[_0x494d('0x10')]['code']===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x4f4576,_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);return _0x3f6b68(_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);}logger[_0x494d('0x10')](_0x494d('0x12'),_0x4f4576,_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);return _0x396280(_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);}else{logger[_0x494d('0xc')]('SmsApplication,\x20%s,\x20%s',_0x4f4576,_0x494d('0xd'));_0x396280(_0x456fe8[_0x494d('0x13')][_0x494d('0x11')]);}})[_0x494d('0x14')](function(_0x120488){logger[_0x494d('0x10')](_0x494d('0x12'),_0x4f4576,_0x120488);_0x3f6b68(_0x120488);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 380f984..b9f33ee 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 _0x757a=['smsinteraction:update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','post','tracked','sms','smsinteraction:addtags','addTags','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x757a,0xde));var _0xa757=function(_0xde3bb4,_0x4aad8b){_0xde3bb4=_0xde3bb4-0x0;var _0x2cfdbe=_0x757a[_0xde3bb4];return _0x2cfdbe;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/describe',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['show']);router[_0xa757('0x7')](_0xa757('0xc'),auth[_0xa757('0x9')](),controller[_0xa757('0xd')]);router[_0xa757('0x7')](_0xa757('0xe'),auth[_0xa757('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xa757('0xc'),auth['isAuthenticated'](),controller['addMessage']);router[_0xa757('0xf')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xa757('0x10')](_0xa757('0x11'),_0xa757('0x12')),controller[_0xa757('0x13')]);router[_0xa757('0x14')](_0xa757('0xb'),auth[_0xa757('0x9')](),interaction[_0xa757('0x10')](_0xa757('0x11'),_0xa757('0x15')),controller['update']);router[_0xa757('0x16')](_0xa757('0xb'),auth[_0xa757('0x9')](),interaction['tracked']('sms',_0xa757('0x17')),controller[_0xa757('0x18')]);router[_0xa757('0x16')](_0xa757('0x19'),auth[_0xa757('0x9')](),controller[_0xa757('0x1a')]);module['exports']=router; \ No newline at end of file +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(_0x18d582,_0x520ff6){var _0x168d25=function(_0x1706a7){while(--_0x1706a7){_0x18d582['push'](_0x18d582['shift']());}};_0x168d25(++_0x520ff6);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x48c2ae,_0x4cea90){_0x48c2ae=_0x48c2ae-0x0;var _0x8f7531=_0x4cf8[_0x48c2ae];return _0x8f7531;};'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 153845c..0cb9c1e 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 _0xf105=['sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x2b71da,_0x1a6441){var _0x314281=function(_0x492f51){while(--_0x492f51){_0x2b71da['push'](_0x2b71da['shift']());}};_0x314281(++_0x1a6441);}(_0xf105,0x1b0));var _0x5f10=function(_0x88d510,_0x30b313){_0x88d510=_0x88d510-0x0;var _0x5793df=_0xf105[_0x88d510];return _0x5793df;};'use strict';var Sequelize=require(_0x5f10('0x0'));var moment=require(_0x5f10('0x1'));module[_0x5f10('0x2')]={'closed':{'type':Sequelize[_0x5f10('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5f10('0x4')]},'disposition':{'type':Sequelize[_0x5f10('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5f10('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x5f10('0x5')]},'read1stAt':{'type':Sequelize[_0x5f10('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x5f10('0x6')]('in',_0x5f10('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5f10('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x5f10('0x6')]('in',_0x5f10('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5f10('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xcf12=['ENUM','out','moment','BOOLEAN','DATE','STRING'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xcf12,0x140));var _0x2cf1=function(_0x43c78c,_0x2734e9){_0x43c78c=_0x43c78c-0x0;var _0xd334b1=_0xcf12[_0x43c78c];return _0xd334b1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2cf1('0x0'));module['exports']={'closed':{'type':Sequelize[_0x2cf1('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2cf1('0x2')]},'disposition':{'type':Sequelize[_0x2cf1('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2cf1('0x3')]},'note':{'type':Sequelize[_0x2cf1('0x3')]},'phone':{'type':Sequelize[_0x2cf1('0x3')]},'read1stAt':{'type':Sequelize[_0x2cf1('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x2cf1('0x4')]('in',_0x2cf1('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2cf1('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x2cf1('0x4')]('in',_0x2cf1('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 4a80050..30906d9 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 _0xdb95=['format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','spread','Tag','smsInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','Messages','direction','secret','SmsAccount','Owner','get','Sms','Account','N.A.','closed','disposition','out','System','lastName','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','offset','count','limit','apply','reject','save','then','destroy','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','index','map','SmsInteraction','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','sort','where','pick','select','field','color','from','user_has_sms_interactions','left_join','users','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','`\x20=\x200','having','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','buildExpression','some','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`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','QueryTypes','SELECT','clone','i.id','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','fields','a.key','Account.key','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','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','catch','params','rawAttributes','include','create','update','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb95,0x111));var _0x5db9=function(_0x329723,_0x356afd){_0x329723=_0x329723-0x0;var _0x460e28=_0xdb95[_0x329723];return _0x460e28;};'use strict';var emlformat=require(_0x5db9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5db9('0x1'));var rp=require(_0x5db9('0x2'));var moment=require(_0x5db9('0x3'));var BPromise=require(_0x5db9('0x4'));var Mustache=require(_0x5db9('0x5'));var util=require(_0x5db9('0x6'));var path=require(_0x5db9('0x7'));var sox=require(_0x5db9('0x8'));var csv=require(_0x5db9('0x9'));var ejs=require(_0x5db9('0xa'));var fs=require('fs');var fs_extra=require(_0x5db9('0xb'));var _=require(_0x5db9('0xc'));var squel=require('squel');var crypto=require(_0x5db9('0xd'));var jsforce=require(_0x5db9('0xe'));var deskjs=require(_0x5db9('0xf'));var toCsv=require(_0x5db9('0x9'));var querystring=require(_0x5db9('0x10'));var Papa=require(_0x5db9('0x11'));var Redis=require(_0x5db9('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5db9('0x13'));var pdf=require(_0x5db9('0x14'));var hardwareService=require(_0x5db9('0x15'));var logger=require(_0x5db9('0x16'))(_0x5db9('0x17'));var utils=require(_0x5db9('0x18'));var config=require(_0x5db9('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5db9('0x1a'))['db'];config[_0x5db9('0x1b')]=_[_0x5db9('0x1c')](config['redis'],{'host':_0x5db9('0x1d'),'port':0x18eb});var socket=require(_0x5db9('0x1e'))(new Redis(config[_0x5db9('0x1b')]));require(_0x5db9('0x1f'))['register'](socket);function respondWithStatusCode(_0x12a131,_0x2c011c){_0x2c011c=_0x2c011c||0xcc;return function(_0x53a24b){if(_0x53a24b){return _0x12a131[_0x5db9('0x20')](_0x2c011c);}return _0x12a131[_0x5db9('0x21')](_0x2c011c)[_0x5db9('0x22')]();};}function respondWithResult(_0x9dc19f,_0x134f89){_0x134f89=_0x134f89||0xc8;return function(_0x493041){if(_0x493041){return _0x9dc19f[_0x5db9('0x21')](_0x134f89)[_0x5db9('0x23')](_0x493041);}};}function respondWithFilteredResult(_0x1a4327,_0x195377){return function(_0x329665){if(_0x329665){var _0x454e89=typeof _0x195377[_0x5db9('0x24')]==='undefined'&&typeof _0x195377['limit']==='undefined';var _0x21de4f=_0x329665[_0x5db9('0x25')];var _0x1d71be=_0x454e89?0x0:_0x195377[_0x5db9('0x24')];var _0x3aa47=_0x454e89?_0x329665[_0x5db9('0x25')]:_0x195377[_0x5db9('0x24')]+_0x195377[_0x5db9('0x26')];var _0x1916de;if(_0x3aa47>=_0x21de4f){_0x3aa47=_0x21de4f;_0x1916de=0xc8;}else{_0x1916de=0xce;}_0x1a4327['status'](_0x1916de);return _0x1a4327['set']('Content-Range',_0x1d71be+'-'+_0x3aa47+'/'+_0x21de4f)[_0x5db9('0x23')](_0x329665);}return null;};}function patchUpdates(_0x5c763e){return function(_0x154f67){try{jsonpatch[_0x5db9('0x27')](_0x154f67,_0x5c763e,!![]);}catch(_0x1fe166){return BPromise[_0x5db9('0x28')](_0x1fe166);}return _0x154f67[_0x5db9('0x29')]();};}function saveUpdates(_0x4dfc53,_0x18b9c3){return function(_0x5e3b6c){if(_0x5e3b6c){return _0x5e3b6c['update'](_0x4dfc53)[_0x5db9('0x2a')](function(_0x151d0f){return _0x151d0f;});}return null;};}function removeEntity(_0x1c9e59,_0x10ddd4){return function(_0x59f339){if(_0x59f339){return _0x59f339[_0x5db9('0x2b')]()[_0x5db9('0x2a')](function(){_0x1c9e59[_0x5db9('0x21')](0xcc)[_0x5db9('0x22')]();});}};}function handleEntityNotFound(_0x443ba6,_0x566f77){return function(_0x3a3561){if(!_0x3a3561){_0x443ba6['sendStatus'](0x194);}return _0x3a3561;};}function handleError(_0x9e45c1,_0x185595){_0x185595=_0x185595||0x1f4;return function(_0x37d117){logger[_0x5db9('0x2c')](_0x37d117[_0x5db9('0x2d')]);if(_0x37d117['name']){delete _0x37d117[_0x5db9('0x2e')];}_0x9e45c1[_0x5db9('0x21')](_0x185595)[_0x5db9('0x2f')](_0x37d117);};}function getInteractionUsers(_0x6ecfe8,_0x275da0){return new BPromise(function(_0x1b3eb2,_0xf871fe){try{if(_0x275da0[_0x6ecfe8['id']]){_0x6ecfe8[_0x5db9('0x30')]=_['map'](_0x275da0[_0x6ecfe8['id']],function(_0x44ac15){return{'id':_0x44ac15['id'],'fullname':_0x44ac15[_0x5db9('0x31')]};});}}catch(_0xc81551){_0xf871fe(_0xc81551);}_0x1b3eb2(_0x6ecfe8);});}function getInteractionTags(_0xcb50fa,_0x122924){return new BPromise(function(_0x28d760,_0x3dbad4){try{if(_0xcb50fa[_0x5db9('0x32')]){_0xcb50fa[_0x5db9('0x33')]=[];_0xcb50fa['TagIds'][_0x5db9('0x34')](',')[_0x5db9('0x35')](function(_0x5bc00b){_0xcb50fa[_0x5db9('0x33')][_0x5db9('0x36')](_0x122924[_0x5bc00b]);});}delete _0xcb50fa[_0x5db9('0x32')];}catch(_0x43721b){_0x3dbad4(_0x43721b);}_0x28d760(_0xcb50fa);});}function updateSmsInteraction(_0x143fcf,_0x404492,_0x39f3e0){return new BPromise(function(_0x5c0850,_0x37260b){return getInteractionUsers(_0x143fcf,_0x39f3e0)[_0x5db9('0x2a')](function(_0x3e2e82){return getInteractionTags(_0x3e2e82,_0x404492);})[_0x5db9('0x2a')](function(_0x3e16d2){_0x5c0850(_0x3e16d2);})['catch'](function(_0x5e156e){_0x37260b(_0x5e156e);});});}exports[_0x5db9('0x37')]=function(_0x314ae8,_0x4824a4){var _0x59ade6={},_0x3ea088={},_0x30336d={'count':0x0,'rows':[]};var _0x4724e2=_[_0x5db9('0x38')](db[_0x5db9('0x39')]['rawAttributes'],function(_0x30f71c){return{'name':_0x30f71c[_0x5db9('0x3a')],'type':_0x30f71c[_0x5db9('0x3b')][_0x5db9('0x3c')]};});_0x3ea088['model']=_['map'](_0x4724e2,_0x5db9('0x2e'));_0x3ea088[_0x5db9('0x3d')]=_[_0x5db9('0x3e')](_0x314ae8[_0x5db9('0x3d')]);_0x3ea088[_0x5db9('0x3f')]=_[_0x5db9('0x40')](_0x3ea088[_0x5db9('0x41')],_0x3ea088[_0x5db9('0x3d')]);_0x59ade6[_0x5db9('0x42')]=_[_0x5db9('0x40')](_0x3ea088['model'],qs['fields'](_0x314ae8[_0x5db9('0x3d')]['fields']));_0x59ade6[_0x5db9('0x42')]=_0x59ade6[_0x5db9('0x42')][_0x5db9('0x43')]?_0x59ade6['attributes']:_0x3ea088[_0x5db9('0x41')];if(!_0x314ae8['query'][_0x5db9('0x44')]('nolimit')){_0x59ade6['limit']=qs[_0x5db9('0x26')](_0x314ae8[_0x5db9('0x3d')]['limit']);_0x59ade6[_0x5db9('0x24')]=qs[_0x5db9('0x24')](_0x314ae8[_0x5db9('0x3d')][_0x5db9('0x24')]);}_0x59ade6['order']=qs['sort'](_0x314ae8[_0x5db9('0x3d')][_0x5db9('0x45')]);_0x59ade6[_0x5db9('0x46')]=qs[_0x5db9('0x3f')](_[_0x5db9('0x47')](_0x314ae8[_0x5db9('0x3d')],_0x3ea088[_0x5db9('0x3f')]),_0x4724e2);var _0x4b1c48=[];var _0x5abfcb=squel[_0x5db9('0x48')]()['field']('id')[_0x5db9('0x49')](_0x5db9('0x2e'))[_0x5db9('0x49')](_0x5db9('0x4a'))[_0x5db9('0x4b')]('tools_tags');var _0x3a73cd=squel[_0x5db9('0x48')]()['field']('u.id')['field']('u.fullname')[_0x5db9('0x49')]('ui.SmsInteractionId')[_0x5db9('0x4b')](_0x5db9('0x4c'),'ui')[_0x5db9('0x4d')](_0x5db9('0x4e'),'u','u.id\x20=\x20ui.UserId');var _0x3b74f8=squel[_0x5db9('0x48')]()[_0x5db9('0x4b')]('sms_interactions','i')[_0x5db9('0x4d')](_0x5db9('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x5db9('0x4d')](_0x5db9('0x4e'),'o',_0x5db9('0x50'))[_0x5db9('0x4d')](_0x5db9('0x51'),'a',_0x5db9('0x52'))[_0x5db9('0x4d')]('sms_messages','me',_0x5db9('0x53'))[_0x5db9('0x4d')](_0x5db9('0x54'),'it','it.SmsInteractionId\x20=\x20i.id')['left_join'](_0x5db9('0x55'),'t',_0x5db9('0x56'));var _0x76b455=squel[_0x5db9('0x57')]();var _0x3055e3=[];var _0xd1ecdd=squel[_0x5db9('0x57')]();var _0xdb1a27;if(_0x314ae8[_0x5db9('0x3d')][_0x5db9('0x58')]){_0xdb1a27=as[_0x5db9('0x59')](_0x314ae8[_0x5db9('0x3d')][_0x5db9('0x58')]);var _0x1f09dd=_0xdb1a27[_0x5db9('0x5a')];for(var _0x1255b3=0x0;_0x1255b3<_0xdb1a27[_0x5db9('0x5b')]['length'];_0x1255b3++){var _0x226359=_0xdb1a27[_0x5db9('0x5b')][_0x1255b3];var _0xa7a3d0='i';var _0x49248a=_[_0x5db9('0x5c')](_0x4724e2,[_0x5db9('0x2e'),_0x226359[_0x5db9('0x49')]]);if(!_0x49248a){switch(_0x226359[_0x5db9('0x49')]){case'unreadMessages':if(_0x226359[_0x5db9('0x5d')]==0x1){_0x3b74f8['having']('`'+_0x226359['field']+_0x5db9('0x5e'));}else{_0x3b74f8[_0x5db9('0x5f')]('`'+_0x226359[_0x5db9('0x49')]+'`\x20>\x200');}break;case _0x5db9('0x60'):if(_0x226359['operator']==='$substring'){if(_0x226359[_0x5db9('0x5d')][_0x5db9('0x34')]('\x20')[_0x5db9('0x43')]>0x1){_0x76b455[_0x1f09dd](_0x5db9('0x61'),qs[_0x5db9('0x62')](_0x226359[_0x5db9('0x5d')]),null);}else{var _0x2d4953='%'+_0x226359[_0x5db9('0x5d')]+'%';_0x76b455[_0x1f09dd]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2d4953,_0x2d4953,_0x2d4953);}}else{_0x49248a=_[_0x5db9('0x5c')](_0x4724e2,[_0x5db9('0x2e'),'ContactId']);_0x226359['field']=_0x5db9('0x63');_0x2b226c=as['buildExpression'](_0xa7a3d0,_0x49248a[_0x5db9('0x3b')],_0x226359);_0x76b455[_0x1f09dd](_0x2b226c[_0x5db9('0x64')],_0x2b226c[_0x5db9('0x5d')][_0x5db9('0x65')],_0x2b226c[_0x5db9('0x5d')]['end']);}break;case'Tag':var _0x345279=_0x226359[_0x5db9('0x5d')][_0x5db9('0x34')](',')[_0x5db9('0x38')](function(_0xe62cde){return Number(_0xe62cde);});_0x345279[_0x5db9('0x35')](function(_0xd3ed81){_0xd1ecdd['or'](_0x5db9('0x66'),'%,'+_0xd3ed81+',%');});_0x3055e3=_[_0x5db9('0x67')](_0x3055e3,_0x345279);break;case _0x5db9('0x68'):if(_0x226359[_0x5db9('0x69')]===_0x5db9('0x6a')){_0x76b455[_0x1f09dd](_0x5db9('0x6b'),'%'+_0x226359[_0x5db9('0x5d')]+'%',null);}else{_0x49248a=_[_0x5db9('0x5c')](_0x4724e2,[_0x5db9('0x2e'),_0x5db9('0x6c')]);_0x226359[_0x5db9('0x49')]=_0x5db9('0x6c');_0x2b226c=as['buildExpression'](_0xa7a3d0,_0x49248a[_0x5db9('0x3b')],_0x226359);_0x76b455[_0x1f09dd](_0x2b226c['text'],_0x2b226c[_0x5db9('0x5d')]['start'],_0x2b226c[_0x5db9('0x5d')][_0x5db9('0x22')]);}break;case _0x5db9('0x6d'):_0x2b226c=as[_0x5db9('0x6e')]('me',null,_0x226359);_0x76b455[_0x1f09dd](_0x2b226c[_0x5db9('0x64')],_0x2b226c['value']['start'],_0x2b226c[_0x5db9('0x5d')][_0x5db9('0x22')]);break;}}else{var _0x2b226c=as[_0x5db9('0x6e')](_0xa7a3d0,_0x49248a[_0x5db9('0x3b')],_0x226359);_0x76b455[_0x1f09dd](_0x2b226c['text'],_0x2b226c[_0x5db9('0x5d')][_0x5db9('0x65')],_0x2b226c[_0x5db9('0x5d')][_0x5db9('0x22')]);}}}else{var _0x414055=_(_0x314ae8['query'])[_0x5db9('0x3e')]()[_0x5db9('0x38')](function(_0x3b0858){return _[_0x5db9('0x6f')](_0x4724e2,[_0x5db9('0x2e'),_0x3b0858])?_0x3b0858:undefined;})['compact']()['value']();if(!_[_0x5db9('0x70')](_0x414055)){_0x414055[_0x5db9('0x35')](function(_0x6e1180){if(_0x6e1180===_0x5db9('0x71')){_0x3b74f8[_0x5db9('0x46')](_0x5db9('0x72'),[][_0x5db9('0x73')](_0x314ae8[_0x5db9('0x3d')][_0x6e1180]));}else if(_0x6e1180===_0x5db9('0x74')){var _0x3058a8=JSON[_0x5db9('0x75')](_0x314ae8[_0x5db9('0x3d')][_0x6e1180])[_0x5db9('0x76')];var _0x1e8322=JSON['parse'](_0x314ae8[_0x5db9('0x3d')][_0x6e1180])[_0x5db9('0x77')];_0x3b74f8[_0x5db9('0x46')](_0x5db9('0x78'),_0x3058a8,_0x1e8322);}else{if(_0x314ae8[_0x5db9('0x3d')][_0x6e1180]===_0x5db9('0x79')){_0x3b74f8[_0x5db9('0x46')]('i.'+_0x6e1180+'\x20IS\x20NULL');}else{_0x3b74f8[_0x5db9('0x46')]('i.'+_0x6e1180+'\x20=\x20?',_0x314ae8[_0x5db9('0x3d')][_0x6e1180]);}}});}if(_0x314ae8['query']['read']){if(_0x314ae8[_0x5db9('0x3d')][_0x5db9('0x7a')]==0x1){_0x3b74f8['having'](_0x5db9('0x7b'));}else{_0x3b74f8[_0x5db9('0x5f')](_0x5db9('0x7c'));}}if(_0x314ae8[_0x5db9('0x3d')][_0x5db9('0x7d')]){_0x3055e3=_[_0x5db9('0x7e')](_0x314ae8[_0x5db9('0x3d')][_0x5db9('0x7d')])?_0x314ae8[_0x5db9('0x3d')][_0x5db9('0x7d')]:new Array(_0x314ae8[_0x5db9('0x3d')][_0x5db9('0x7d')]);_0x3055e3[_0x5db9('0x35')](function(_0x8b288a){_0xd1ecdd['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x8b288a+',%');});}if(_0x314ae8[_0x5db9('0x3d')][_0x5db9('0x7f')]){var _0x5ecf93=_0x314ae8[_0x5db9('0x3d')]['filter'][_0x5db9('0x80')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5ecf93)){_0x76b455['or'](_0x5db9('0x81'),_0x5ecf93+'%')['or'](_0x5db9('0x82'),_0x5ecf93+'%');}else{_0x76b455['or'](_0x5db9('0x83'),qs[_0x5db9('0x62')](_0x5ecf93))['or'](_0x5db9('0x84'),_0x5ecf93+'%');}}}_0x3b74f8[_0x5db9('0x46')](_0x76b455);_0x3b74f8[_0x5db9('0x85')]('i.id');var _0x59bae1={'type':db['Sequelize'][_0x5db9('0x86')][_0x5db9('0x87')],'raw':!![]};var _0x3c90c4=_0x3b74f8[_0x5db9('0x88')]();_0x3c90c4['field'](_0x5db9('0x89'));_0x3c90c4[_0x5db9('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5db9('0x8a'));if(_0x59ade6[_0x5db9('0x8b')]){_0x59ade6[_0x5db9('0x8b')][_0x5db9('0x35')](function(_0x5b187e){var _0xe4c254=_0x5b187e[0x0]===_0x5db9('0x8c')?_0x5b187e[0x0]:'i.'+_0x5b187e[0x0];_0x3b74f8[_0x5db9('0x8b')](_0xe4c254,_0x5b187e[0x1]===_0x5db9('0x8d')?![]:!![]);});}if(!_[_0x5db9('0x70')](_0x3055e3)){_0x3b74f8[_0x5db9('0x5f')](_0xd1ecdd);_0x3c90c4[_0x5db9('0x46')](_0x5db9('0x8e'),_0x3055e3);}BPromise[_0x5db9('0x8f')]()['then'](function(){if(!_0xdb1a27){if(_0x314ae8[_0x5db9('0x3d')][_0x5db9('0x71')])return;_0x3c90c4[_0x5db9('0x46')](_0x5db9('0x90'));_0x3b74f8[_0x5db9('0x46')](_0x5db9('0x90'));return;}if(_0x314ae8[_0x5db9('0x91')][_0x5db9('0x92')]!==_0x5db9('0x93'))return;return _0x314ae8[_0x5db9('0x91')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x5db9('0x2a')](function(_0x5ea201){if(_[_0x5db9('0x70')](_0x5ea201)){_0x3c90c4['where'](_0x5db9('0x94'));_0x3b74f8['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x3c90c4[_0x5db9('0x46')](_0x5db9('0x72'),_[_0x5db9('0x38')](_0x5ea201,'id'));_0x3b74f8[_0x5db9('0x46')](_0x5db9('0x72'),_[_0x5db9('0x38')](_0x5ea201,'id'));}});})[_0x5db9('0x2a')](function(){if(_0x314ae8['user'][_0x5db9('0x92')]===_0x5db9('0x93')&&!_0xdb1a27&&!_0x314ae8[_0x5db9('0x3d')][_0x5db9('0x71')])return[];return db[_0x5db9('0x95')][_0x5db9('0x3d')](_0x3c90c4[_0x5db9('0x96')](),_0x59bae1);})[_0x5db9('0x2a')](function(_0x8cc6d1){_0x30336d['count']=_0x8cc6d1['length'];if(_0x30336d[_0x5db9('0x25')]===0x0)return[];return db[_0x5db9('0x95')][_0x5db9('0x3d')](_0x5abfcb[_0x5db9('0x96')](),_0x59bae1)['then'](function(_0x4de517){_0x4b1c48=_[_0x5db9('0x97')](_0x4de517,'id');_0x59bae1=_[_0x5db9('0x98')](_0x59bae1,{'model':db[_0x5db9('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x314ae8['query'][_0x5db9('0x99')]){_0x59ade6[_0x5db9('0x42')][_0x5db9('0x35')](function(_0x2e6d9e){_0x3b74f8[_0x5db9('0x49')]('i.'+_0x2e6d9e);});}else{_0x3b74f8[_0x5db9('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5db9('0x8a'));_0x3b74f8[_0x5db9('0x49')](_0x5db9('0x9a'),_0x5db9('0x9b'));_0x3b74f8[_0x5db9('0x49')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x3b74f8[_0x5db9('0x49')](_0x5db9('0x9c'),_0x5db9('0x8c'));_0x3b74f8['field'](_0x5db9('0x9d'));_0x3b74f8[_0x5db9('0x49')](_0x5db9('0x9e'),_0x5db9('0x9f'));_0x3b74f8[_0x5db9('0x49')]('c.lastName','Contact.lastName');_0x3b74f8['field']('c.email',_0x5db9('0xa0'));_0x3b74f8[_0x5db9('0x49')](_0x5db9('0xa1'),_0x5db9('0xa2'));_0x3b74f8[_0x5db9('0x49')](_0x5db9('0xa3'),_0x5db9('0xa4'));_0x3b74f8[_0x5db9('0x49')](_0x5db9('0xa5'),_0x5db9('0xa6'));_0x3b74f8[_0x5db9('0x49')]('o.fullname',_0x5db9('0xa7'));_0x3b74f8[_0x5db9('0x49')](_0x5db9('0xa8'),_0x5db9('0xa9'));_0x3b74f8[_0x5db9('0x49')](_0x5db9('0xaa'),_0x5db9('0x32'));}if(_0x59ade6[_0x5db9('0x26')])_0x3b74f8[_0x5db9('0x26')](_0x59ade6[_0x5db9('0x26')]);if(_0x59ade6['offset'])_0x3b74f8[_0x5db9('0x24')](_0x59ade6['offset']);return db[_0x5db9('0x95')][_0x5db9('0x3d')](_0x3b74f8['toString'](),_0x59bae1);})[_0x5db9('0x2a')](function(_0x49e9cd){if(_0x49e9cd[_0x5db9('0x43')]>0x0)_0x3a73cd[_0x5db9('0x46')](_0x5db9('0xab'),_[_0x5db9('0x38')](_0x49e9cd,'id'));return db[_0x5db9('0x95')][_0x5db9('0x3d')](_0x3a73cd[_0x5db9('0x96')](),_0x59bae1)[_0x5db9('0x2a')](function(_0x252de7){var _0x4e6370=_[_0x5db9('0xac')](_0x252de7,_0x5db9('0xad'));var _0x4d6fad=[];_0x49e9cd[_0x5db9('0x35')](function(_0x41b292){_0x4d6fad[_0x5db9('0x36')](updateSmsInteraction(_0x41b292,_0x4b1c48,_0x4e6370));});return BPromise[_0x5db9('0xae')](_0x4d6fad);});});})[_0x5db9('0x2a')](function(_0x3b67f8){_0x30336d[_0x5db9('0xaf')]=_0x3b67f8;return _0x30336d;})[_0x5db9('0x2a')](respondWithFilteredResult(_0x4824a4,_0x59ade6))[_0x5db9('0xb0')](handleError(_0x4824a4,null));};exports['show']=function(_0x17f137,_0x2757fc){var _0x1c1134={'raw':![],'where':{'id':_0x17f137[_0x5db9('0xb1')]['id']}},_0x2017b4={};_0x2017b4[_0x5db9('0x41')]=_[_0x5db9('0x3e')](db[_0x5db9('0x39')][_0x5db9('0xb2')]);_0x2017b4[_0x5db9('0x3d')]=_[_0x5db9('0x3e')](_0x17f137['query']);_0x2017b4['filters']=_[_0x5db9('0x40')](_0x2017b4[_0x5db9('0x41')],_0x2017b4[_0x5db9('0x3d')]);_0x1c1134['attributes']=_[_0x5db9('0x40')](_0x2017b4[_0x5db9('0x41')],qs[_0x5db9('0x99')](_0x17f137[_0x5db9('0x3d')][_0x5db9('0x99')]));_0x1c1134[_0x5db9('0x42')]=_0x1c1134[_0x5db9('0x42')][_0x5db9('0x43')]?_0x1c1134[_0x5db9('0x42')]:_0x2017b4['model'];if(_0x17f137[_0x5db9('0x3d')]['includeAll']){_0x1c1134[_0x5db9('0xb3')]=[{'all':!![]}];}_0x1c1134=_[_0x5db9('0x98')]({},_0x1c1134,_0x17f137['options']);return db[_0x5db9('0x39')]['find'](_0x1c1134)['then'](handleEntityNotFound(_0x2757fc,null))['then'](respondWithResult(_0x2757fc,null))[_0x5db9('0xb0')](handleError(_0x2757fc,null));};exports[_0x5db9('0xb4')]=function(_0x337179,_0x402988){return db['SmsInteraction']['create'](_0x337179[_0x5db9('0x6d')],{})['then'](respondWithResult(_0x402988,0xc9))[_0x5db9('0xb0')](handleError(_0x402988,null));};exports[_0x5db9('0xb5')]=function(_0x404ffe,_0x52af5a){if(_0x404ffe[_0x5db9('0x6d')]['id']){delete _0x404ffe['body']['id'];}return db['SmsInteraction'][_0x5db9('0x5c')]({'where':{'id':_0x404ffe['params']['id']}})[_0x5db9('0x2a')](handleEntityNotFound(_0x52af5a,null))[_0x5db9('0x2a')](saveUpdates(_0x404ffe[_0x5db9('0x6d')],null))[_0x5db9('0x2a')](respondWithResult(_0x52af5a,null))[_0x5db9('0xb0')](handleError(_0x52af5a,null));};exports[_0x5db9('0x2b')]=function(_0x5349af,_0x32c464){return db[_0x5db9('0x39')][_0x5db9('0x5c')]({'where':{'id':_0x5349af[_0x5db9('0xb1')]['id']}})[_0x5db9('0x2a')](handleEntityNotFound(_0x32c464,null))['then'](removeEntity(_0x32c464,null))[_0x5db9('0xb0')](handleError(_0x32c464,null));};exports['describe']=function(_0x24c0f4,_0x5b6390){return db[_0x5db9('0x39')][_0x5db9('0xb6')]()[_0x5db9('0x2a')](respondWithResult(_0x5b6390,null))['catch'](handleError(_0x5b6390,null));};exports[_0x5db9('0xb7')]=function(_0x8aa44d,_0x673098,_0xd5dc80){return db['SmsMessage']['find']({'where':{'id':_0x8aa44d[_0x5db9('0xb1')]['id']}})[_0x5db9('0x2a')](handleEntityNotFound(_0x673098,null))[_0x5db9('0x2a')](function(_0x50599b){if(_0x50599b){return _0x50599b['addMessage'](_0x8aa44d[_0x5db9('0x6d')][_0x5db9('0xb8')],_[_0x5db9('0xb9')](_0x8aa44d[_0x5db9('0x6d')],[_0x5db9('0xb8'),'id'])||{});}})[_0x5db9('0x2a')](respondWithResult(_0x673098,null))[_0x5db9('0xb0')](handleError(_0x673098,null));};exports[_0x5db9('0xba')]=function(_0x45b6b3,_0x1565ba,_0x3f361b){var _0x5ce3ed={'raw':![],'where':{}};var _0x8fc8b={};var _0xbfe4cb={'count':0x0,'rows':[]};return db[_0x5db9('0x39')][_0x5db9('0xbb')]({'where':{'id':_0x45b6b3['params']['id']}})[_0x5db9('0x2a')](handleEntityNotFound(_0x1565ba,null))[_0x5db9('0x2a')](function(_0x524f51){if(_0x524f51){_0x8fc8b[_0x5db9('0x41')]=_[_0x5db9('0x3e')](db[_0x5db9('0xbc')][_0x5db9('0xb2')]);_0x8fc8b[_0x5db9('0x3d')]=_[_0x5db9('0x3e')](_0x45b6b3[_0x5db9('0x3d')]);_0x8fc8b['filters']=_[_0x5db9('0x40')](_0x8fc8b[_0x5db9('0x41')],_0x8fc8b[_0x5db9('0x3d')]);_0x5ce3ed['attributes']=_[_0x5db9('0x40')](_0x8fc8b['model'],qs[_0x5db9('0x99')](_0x45b6b3[_0x5db9('0x3d')][_0x5db9('0x99')]));_0x5ce3ed[_0x5db9('0x42')]=_0x5ce3ed[_0x5db9('0x42')]['length']?_0x5ce3ed[_0x5db9('0x42')]:_0x8fc8b[_0x5db9('0x41')];if(!_0x45b6b3[_0x5db9('0x3d')]['hasOwnProperty']('nolimit')){_0x5ce3ed[_0x5db9('0x26')]=qs[_0x5db9('0x26')](_0x45b6b3[_0x5db9('0x3d')]['limit']);_0x5ce3ed[_0x5db9('0x24')]=qs['offset'](_0x45b6b3[_0x5db9('0x3d')][_0x5db9('0x24')]);}_0x5ce3ed[_0x5db9('0x8b')]=qs[_0x5db9('0x45')](_0x45b6b3[_0x5db9('0x3d')][_0x5db9('0x45')]);_0x5ce3ed[_0x5db9('0x46')]=qs[_0x5db9('0x3f')](_[_0x5db9('0x47')](_0x45b6b3[_0x5db9('0x3d')],_0x8fc8b[_0x5db9('0x3f')]));_0x5ce3ed['where'][_0x5db9('0xad')]=_0x524f51['id'];if(_0x45b6b3[_0x5db9('0x3d')][_0x5db9('0x7f')]){_0x5ce3ed[_0x5db9('0x46')]=_[_0x5db9('0x98')](_0x5ce3ed[_0x5db9('0x46')],{'$or':_['map'](_0x5ce3ed[_0x5db9('0x42')],function(_0x757405){var _0x49d497={};_0x49d497[_0x757405]={'$like':'%'+_0x45b6b3[_0x5db9('0x3d')][_0x5db9('0x7f')]+'%'};return _0x49d497;})});}if(_0x45b6b3[_0x5db9('0x3d')]['$gte']){var _0x10b97a=_0x45b6b3[_0x5db9('0x3d')][_0x5db9('0x76')]['split'](',');var _0x4430b6={};_0x4430b6[_0x10b97a[0x0]]={'$gte':moment(_0x10b97a[0x1])[_0x5db9('0xbd')](_0x5db9('0xbe'))};_0x5ce3ed[_0x5db9('0x46')]=_[_0x5db9('0x98')](_0x5ce3ed[_0x5db9('0x46')],_0x4430b6);}_0x5ce3ed=_[_0x5db9('0x98')]({},_0x5ce3ed,_0x45b6b3[_0x5db9('0xbf')]);return db[_0x5db9('0xbc')][_0x5db9('0x25')]({'where':_0x5ce3ed[_0x5db9('0x46')]})[_0x5db9('0x2a')](function(_0x1534b5){_0xbfe4cb['count']=_0x1534b5;if(_0x45b6b3[_0x5db9('0x3d')][_0x5db9('0xc0')]){_0x5ce3ed['include']=[{'all':!![]}];}return db[_0x5db9('0xbc')][_0x5db9('0xc1')](_0x5ce3ed);})[_0x5db9('0x2a')](function(_0x2901a4){_0xbfe4cb[_0x5db9('0xaf')]=_0x2901a4;return _0xbfe4cb;});}})[_0x5db9('0x2a')](respondWithFilteredResult(_0x1565ba,_0x5ce3ed))[_0x5db9('0xb0')](handleError(_0x1565ba,null));};exports['addTags']=function(_0x7e49cf,_0x4ded01,_0xc7b0f7){return db[_0x5db9('0x39')][_0x5db9('0x5c')]({'where':{'id':_0x7e49cf[_0x5db9('0xb1')]['id']}})[_0x5db9('0x2a')](handleEntityNotFound(_0x4ded01,null))['then'](function(_0x7da774){if(_0x7da774){return _0x7da774['setTags'](_0x7e49cf[_0x5db9('0x6d')]['ids'],_[_0x5db9('0xb9')](_0x7e49cf[_0x5db9('0x6d')],[_0x5db9('0xb8'),'id'])||{})[_0x5db9('0xc2')](function(){return db[_0x5db9('0xc3')][_0x5db9('0xc1')]({'attributes':['id','name','color'],'where':{'id':_0x7e49cf[_0x5db9('0x6d')][_0x5db9('0xb8')]}});})[_0x5db9('0x2a')](function(_0x5b416e){socket['emit'](_0x5db9('0xc4'),{'id':Number(_0x7e49cf[_0x5db9('0xb1')]['id']),'tags':_0x5b416e||[]});return{'id':Number(_0x7e49cf[_0x5db9('0xb1')]['id']),'tags':_0x5b416e||[]};});}})[_0x5db9('0x2a')](respondWithResult(_0x4ded01,null))['catch'](handleError(_0x4ded01,null));};exports['removeTags']=function(_0x24cf1a,_0x40213b,_0x33b691){return db[_0x5db9('0x39')]['find']({'where':{'id':_0x24cf1a['params']['id']}})['then'](handleEntityNotFound(_0x40213b,null))[_0x5db9('0x2a')](function(_0x4fae84){if(_0x4fae84){return _0x4fae84[_0x5db9('0xc5')](_0x24cf1a[_0x5db9('0x3d')][_0x5db9('0xb8')]);}})[_0x5db9('0x2a')](respondWithStatusCode(_0x40213b,null))[_0x5db9('0xb0')](handleError(_0x40213b,null));};exports['download']=function(_0x208162,_0x4aca2c){var _0x26f07c=moment()[_0x5db9('0xc6')]()['toString']();var _0x2528c1=path[_0x5db9('0xc7')](config[_0x5db9('0xc8')],_0x5db9('0xc9'),_0x5db9('0xca'),_0x5db9('0xcb'));var _0x25c293=path['join'](config[_0x5db9('0xc8')],_0x5db9('0xc9'),'files',_0x5db9('0xcc'));var _0x436062=path[_0x5db9('0xc7')](_0x2528c1,_0x26f07c);var _0x39406e=util[_0x5db9('0xbd')](_0x5db9('0xcd'),_0x208162[_0x5db9('0xb1')]['id'],_0x26f07c);var _0x3fe497=path[_0x5db9('0xc7')](_0x2528c1,_0x39406e);var _0x261bc7=[];_0x261bc7['push']({'model':db[_0x5db9('0x68')],'as':_0x5db9('0x68'),'attributes':['id',_0x5db9('0x31')],'raw':!![]});_0x261bc7['push']({'model':db[_0x5db9('0xce')],'as':_0x5db9('0x60'),'attributes':['id',_0x5db9('0xcf'),'lastName'],'raw':!![]});var _0x4e406d=[{'model':db['SmsMessage'],'as':_0x5db9('0xd0'),'attributes':['id',_0x5db9('0x6d'),_0x5db9('0x74'),_0x5db9('0xd1'),_0x5db9('0xd2'),_0x5db9('0x7a')],'include':_0x261bc7}];_0x4e406d[_0x5db9('0x36')]({'model':db[_0x5db9('0xd3')],'as':'Account','attributes':['id',_0x5db9('0x2e')]});_0x4e406d[_0x5db9('0x36')]({'model':db['User'],'as':_0x5db9('0xd4'),'attributes':['id',_0x5db9('0x31')]});return db[_0x5db9('0x39')]['find']({'where':{'id':_0x208162[_0x5db9('0xb1')]['id']},'include':_0x4e406d})[_0x5db9('0x2a')](handleEntityNotFound(_0x4aca2c,null))[_0x5db9('0x2a')](function(_0x30fd9d){if(_0x30fd9d){var _0x2c5b6d=_0x30fd9d[_0x5db9('0xd5')]({'plain':!![]});fs['mkdirSync'](_0x436062);var _0x634b2b={'channel':_0x5db9('0xd6'),'account':_0x2c5b6d[_0x5db9('0xd7')][_0x5db9('0x2e')],'agent':_0x2c5b6d[_0x5db9('0xd4')]?_0x2c5b6d[_0x5db9('0xd4')]['fullname']:_0x5db9('0xd8'),'createdAt':moment(_0x2c5b6d['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x5db9('0x96')](),'closedAt':_0x2c5b6d[_0x5db9('0xd9')]?moment(_0x2c5b6d['closedAt'])[_0x5db9('0xbd')](_0x5db9('0xbe'))['toString']():'','disposition':_0x2c5b6d[_0x5db9('0xda')],'messages':_(_0x2c5b6d[_0x5db9('0xd0')])[_0x5db9('0x7f')]({'secret':![]})['map'](function(_0x11fc1e){return{'date':moment(_0x11fc1e['createdAt'])[_0x5db9('0xbd')](_0x5db9('0xbe'))[_0x5db9('0x96')](),'sender':_0x11fc1e[_0x5db9('0xd1')]===_0x5db9('0xdb')?_0x11fc1e['User']?_0x11fc1e[_0x5db9('0x68')][_0x5db9('0x31')]:_0x5db9('0xdc'):_0x11fc1e['Contact'][_0x5db9('0xcf')]+(_0x11fc1e[_0x5db9('0x60')][_0x5db9('0xdd')]?'\x20'+_0x11fc1e['Contact'][_0x5db9('0xdd')]:''),'body':_0x11fc1e[_0x5db9('0x6d')],'direction':_0x11fc1e[_0x5db9('0xd1')]===_0x5db9('0xdb')?'A':'C','secret':_0x11fc1e[_0x5db9('0xd2')],'read':_0x11fc1e[_0x5db9('0x7a')]};})[_0x5db9('0x5d')]()};return ejs[_0x5db9('0xde')](path[_0x5db9('0xc7')](config[_0x5db9('0xc8')],'server','views',_0x5db9('0xdf')),{'interaction':_0x634b2b})[_0x5db9('0x2a')](function(_0x4907dd){var _0x2c758e=path[_0x5db9('0xc7')](_0x436062,_0x5db9('0xe0')+_0x2c5b6d['id']+'-'+_0x26f07c+_0x5db9('0xe1'));var _0x3d16fd={'path':_0x2c758e,'channel':'Sms','interactionId':_0x2c5b6d['id']};return pdf[_0x5db9('0xe2')](_0x4907dd,_0x3d16fd);})['then'](function(){return new BPromise(function(_0x4e7c8b,_0x54b62d){zipdir(_0x436062,{'saveTo':_0x3fe497},function(_0xff9847,_0x46ee8c){if(_0xff9847)return _0x54b62d(_0xff9847);return _0x4e7c8b(_0x46ee8c);});})[_0x5db9('0x2a')](function(){return new BPromise(function(_0x107023,_0x1b56ce){rimraf(_0x436062,function(_0x3722d2){if(_0x3722d2)_0x1b56ce(_0x3722d2);return _0x107023();});});})[_0x5db9('0x2a')](function(){return _0x4aca2c[_0x5db9('0xe3')](_0x3fe497,_0x39406e,function(_0x58001b){if(_0x58001b){console[_0x5db9('0xe4')](_0x5db9('0xe5'),_0x58001b);}else{fs[_0x5db9('0xe6')](_0x3fe497);}});});});}else{return _0x4aca2c[_0x5db9('0x20')](0xc8);}})[_0x5db9('0xb0')](handleError(_0x4aca2c,null));}; \ No newline at end of file +var _0x57df=['crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','name','send','Users','map','Tags','split','push','TagIds','catch','index','SmsInteraction','rawAttributes','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','u.id','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','find','ContactId','buildExpression','type','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','compact','isEmpty','SmsAccountId','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.phone\x20LIKE\x20?','getFullTextValue','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','keyBy','merge','a.key','Account.key','a.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.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','show','params','includeAll','include','options','create','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','rows','spread','findAll','emit','join','root','server','files','attachments','CmContact','firstName','lastName','Messages','secret','SmsAccount','Account','Owner','fullname','get','mkdirSync','Sms','N.A.','closed','disposition','direction','out','System','transcript-','.pdf','createPdfFromHTML','log','err','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x29eeec,_0x337c09){var _0x2cf46e=function(_0x491b79){while(--_0x491b79){_0x29eeec['push'](_0x29eeec['shift']());}};_0x2cf46e(++_0x337c09);}(_0x57df,0xd4));var _0xf57d=function(_0x6747af,_0x2f7a49){_0x6747af=_0x6747af-0x0;var _0x560abe=_0x57df[_0x6747af];return _0x560abe;};'use strict';var emlformat=require(_0xf57d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf57d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf57d('0x2'));var moment=require(_0xf57d('0x3'));var BPromise=require(_0xf57d('0x4'));var Mustache=require(_0xf57d('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf57d('0x6'));var csv=require(_0xf57d('0x7'));var ejs=require(_0xf57d('0x8'));var fs=require('fs');var fs_extra=require(_0xf57d('0x9'));var _=require(_0xf57d('0xa'));var squel=require(_0xf57d('0xb'));var crypto=require(_0xf57d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf57d('0xd'));var toCsv=require(_0xf57d('0x7'));var querystring=require(_0xf57d('0xe'));var Papa=require(_0xf57d('0xf'));var Redis=require('ioredis');var authService=require(_0xf57d('0x10'));var qs=require(_0xf57d('0x11'));var as=require(_0xf57d('0x12'));var pdf=require(_0xf57d('0x13'));var hardwareService=require(_0xf57d('0x14'));var logger=require('../../config/logger')(_0xf57d('0x15'));var utils=require(_0xf57d('0x16'));var config=require(_0xf57d('0x17'));var licenseUtil=require(_0xf57d('0x18'));var db=require(_0xf57d('0x19'))['db'];config[_0xf57d('0x1a')]=_[_0xf57d('0x1b')](config[_0xf57d('0x1a')],{'host':_0xf57d('0x1c'),'port':0x18eb});var socket=require(_0xf57d('0x1d'))(new Redis(config['redis']));require(_0xf57d('0x1e'))[_0xf57d('0x1f')](socket);function respondWithStatusCode(_0x2f0809,_0x45b9c5){_0x45b9c5=_0x45b9c5||0xcc;return function(_0x49666b){if(_0x49666b){return _0x2f0809['sendStatus'](_0x45b9c5);}return _0x2f0809[_0xf57d('0x20')](_0x45b9c5)[_0xf57d('0x21')]();};}function respondWithResult(_0x21e72f,_0x587b02){_0x587b02=_0x587b02||0xc8;return function(_0x51b6dc){if(_0x51b6dc){return _0x21e72f['status'](_0x587b02)[_0xf57d('0x22')](_0x51b6dc);}};}function respondWithFilteredResult(_0x3d6fda,_0x5971d3){return function(_0x46a907){if(_0x46a907){var _0x48b714=typeof _0x5971d3['offset']===_0xf57d('0x23')&&typeof _0x5971d3[_0xf57d('0x24')]===_0xf57d('0x23');var _0x58132a=_0x46a907[_0xf57d('0x25')];var _0x8210e9=_0x48b714?0x0:_0x5971d3[_0xf57d('0x26')];var _0xc48f1=_0x48b714?_0x46a907[_0xf57d('0x25')]:_0x5971d3['offset']+_0x5971d3[_0xf57d('0x24')];var _0x464740;if(_0xc48f1>=_0x58132a){_0xc48f1=_0x58132a;_0x464740=0xc8;}else{_0x464740=0xce;}_0x3d6fda['status'](_0x464740);return _0x3d6fda[_0xf57d('0x27')](_0xf57d('0x28'),_0x8210e9+'-'+_0xc48f1+'/'+_0x58132a)[_0xf57d('0x22')](_0x46a907);}return null;};}function patchUpdates(_0x396557){return function(_0x453926){try{jsonpatch[_0xf57d('0x29')](_0x453926,_0x396557,!![]);}catch(_0x3a3290){return BPromise['reject'](_0x3a3290);}return _0x453926[_0xf57d('0x2a')]();};}function saveUpdates(_0x256e1d,_0x5e2daf){return function(_0x27f536){if(_0x27f536){return _0x27f536[_0xf57d('0x2b')](_0x256e1d)['then'](function(_0xa5acbc){return _0xa5acbc;});}return null;};}function removeEntity(_0x42905e,_0xd99393){return function(_0x5b10b1){if(_0x5b10b1){return _0x5b10b1[_0xf57d('0x2c')]()[_0xf57d('0x2d')](function(){_0x42905e[_0xf57d('0x20')](0xcc)[_0xf57d('0x21')]();});}};}function handleEntityNotFound(_0x57a3b1,_0x1a1bac){return function(_0x57e723){if(!_0x57e723){_0x57a3b1[_0xf57d('0x2e')](0x194);}return _0x57e723;};}function handleError(_0x5e799e,_0x1817fb){_0x1817fb=_0x1817fb||0x1f4;return function(_0x57fa16){logger[_0xf57d('0x2f')](_0x57fa16['stack']);if(_0x57fa16[_0xf57d('0x30')]){delete _0x57fa16[_0xf57d('0x30')];}_0x5e799e[_0xf57d('0x20')](_0x1817fb)[_0xf57d('0x31')](_0x57fa16);};}function getInteractionUsers(_0xdd3ca7,_0x21ea01){return new BPromise(function(_0x8bd2d,_0x261e55){try{if(_0x21ea01[_0xdd3ca7['id']]){_0xdd3ca7[_0xf57d('0x32')]=_[_0xf57d('0x33')](_0x21ea01[_0xdd3ca7['id']],function(_0x1c4f0d){return{'id':_0x1c4f0d['id'],'fullname':_0x1c4f0d['fullname']};});}}catch(_0x541e6){_0x261e55(_0x541e6);}_0x8bd2d(_0xdd3ca7);});}function getInteractionTags(_0x9f293e,_0x5c7deb){return new BPromise(function(_0x39a53a,_0xc0209){try{if(_0x9f293e['TagIds']){_0x9f293e[_0xf57d('0x34')]=[];_0x9f293e['TagIds'][_0xf57d('0x35')](',')['forEach'](function(_0x1ccee5){_0x9f293e['Tags'][_0xf57d('0x36')](_0x5c7deb[_0x1ccee5]);});}delete _0x9f293e[_0xf57d('0x37')];}catch(_0x3418b6){_0xc0209(_0x3418b6);}_0x39a53a(_0x9f293e);});}function updateSmsInteraction(_0x5e867c,_0x532125,_0x18ea64){return new BPromise(function(_0x656a6f,_0x1f62ad){return getInteractionUsers(_0x5e867c,_0x18ea64)['then'](function(_0x285d4b){return getInteractionTags(_0x285d4b,_0x532125);})[_0xf57d('0x2d')](function(_0x3080b8){_0x656a6f(_0x3080b8);})[_0xf57d('0x38')](function(_0x3df9d2){_0x1f62ad(_0x3df9d2);});});}exports[_0xf57d('0x39')]=function(_0x36d932,_0x50cff3){var _0x3401c4={},_0x16b910={},_0x30efe0={'count':0x0,'rows':[]};var _0xb011c5=_[_0xf57d('0x33')](db[_0xf57d('0x3a')][_0xf57d('0x3b')],function(_0x404c03){return{'name':_0x404c03['fieldName'],'type':_0x404c03['type']['key']};});_0x16b910[_0xf57d('0x3c')]=_[_0xf57d('0x33')](_0xb011c5,'name');_0x16b910[_0xf57d('0x3d')]=_['keys'](_0x36d932[_0xf57d('0x3d')]);_0x16b910[_0xf57d('0x3e')]=_['intersection'](_0x16b910[_0xf57d('0x3c')],_0x16b910['query']);_0x3401c4[_0xf57d('0x3f')]=_[_0xf57d('0x40')](_0x16b910[_0xf57d('0x3c')],qs['fields'](_0x36d932[_0xf57d('0x3d')][_0xf57d('0x41')]));_0x3401c4[_0xf57d('0x3f')]=_0x3401c4[_0xf57d('0x3f')][_0xf57d('0x42')]?_0x3401c4[_0xf57d('0x3f')]:_0x16b910[_0xf57d('0x3c')];if(!_0x36d932[_0xf57d('0x3d')][_0xf57d('0x43')](_0xf57d('0x44'))){_0x3401c4[_0xf57d('0x24')]=qs[_0xf57d('0x24')](_0x36d932[_0xf57d('0x3d')][_0xf57d('0x24')]);_0x3401c4['offset']=qs[_0xf57d('0x26')](_0x36d932[_0xf57d('0x3d')]['offset']);}_0x3401c4[_0xf57d('0x45')]=qs['sort'](_0x36d932[_0xf57d('0x3d')][_0xf57d('0x46')]);_0x3401c4[_0xf57d('0x47')]=qs[_0xf57d('0x3e')](_[_0xf57d('0x48')](_0x36d932['query'],_0x16b910[_0xf57d('0x3e')]),_0xb011c5);var _0x53bb01=[];var _0x31dd4e=squel[_0xf57d('0x49')]()['field']('id')[_0xf57d('0x4a')](_0xf57d('0x30'))[_0xf57d('0x4a')]('color')['from']('tools_tags');var _0x10ee62=squel[_0xf57d('0x49')]()['field'](_0xf57d('0x4b'))[_0xf57d('0x4a')]('u.fullname')[_0xf57d('0x4a')](_0xf57d('0x4c'))[_0xf57d('0x4d')](_0xf57d('0x4e'),'ui')[_0xf57d('0x4f')](_0xf57d('0x50'),'u',_0xf57d('0x51'));var _0x498023=squel[_0xf57d('0x49')]()[_0xf57d('0x4d')](_0xf57d('0x52'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf57d('0x4f')](_0xf57d('0x50'),'o',_0xf57d('0x53'))[_0xf57d('0x4f')](_0xf57d('0x54'),'a',_0xf57d('0x55'))[_0xf57d('0x4f')](_0xf57d('0x56'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xf57d('0x4f')](_0xf57d('0x57'),'it',_0xf57d('0x58'))[_0xf57d('0x4f')](_0xf57d('0x59'),'t',_0xf57d('0x5a'));var _0x16e819=squel[_0xf57d('0x5b')]();var _0x23fc54=[];var _0x5bf6df=squel[_0xf57d('0x5b')]();var _0xf03168;if(_0x36d932[_0xf57d('0x3d')][_0xf57d('0x5c')]){_0xf03168=as[_0xf57d('0x5d')](_0x36d932[_0xf57d('0x3d')][_0xf57d('0x5c')]);var _0x216448=_0xf03168[_0xf57d('0x5e')];for(var _0x12137a=0x0;_0x12137a<_0xf03168[_0xf57d('0x5f')][_0xf57d('0x42')];_0x12137a++){var _0x1b5270=_0xf03168[_0xf57d('0x5f')][_0x12137a];var _0xe591c2='i';var _0x4a2384=_['find'](_0xb011c5,[_0xf57d('0x30'),_0x1b5270['field']]);if(!_0x4a2384){switch(_0x1b5270['field']){case _0xf57d('0x60'):if(_0x1b5270[_0xf57d('0x61')]==0x1){_0x498023[_0xf57d('0x62')]('`'+_0x1b5270['field']+_0xf57d('0x63'));}else{_0x498023['having']('`'+_0x1b5270[_0xf57d('0x4a')]+'`\x20>\x200');}break;case _0xf57d('0x64'):if(_0x1b5270[_0xf57d('0x65')]===_0xf57d('0x66')){if(_0x1b5270['value']['split']('\x20')[_0xf57d('0x42')]>0x1){_0x16e819[_0x216448]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x1b5270[_0xf57d('0x61')]),null);}else{var _0x5a7cd2='%'+_0x1b5270[_0xf57d('0x61')]+'%';_0x16e819[_0x216448]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5a7cd2,_0x5a7cd2,_0x5a7cd2);}}else{_0x4a2384=_[_0xf57d('0x67')](_0xb011c5,[_0xf57d('0x30'),'ContactId']);_0x1b5270['field']=_0xf57d('0x68');_0x592041=as[_0xf57d('0x69')](_0xe591c2,_0x4a2384[_0xf57d('0x6a')],_0x1b5270);_0x16e819[_0x216448](_0x592041[_0xf57d('0x6b')],_0x592041[_0xf57d('0x61')][_0xf57d('0x6c')],_0x592041['value'][_0xf57d('0x21')]);}break;case _0xf57d('0x6d'):var _0x46871b=_0x1b5270[_0xf57d('0x61')][_0xf57d('0x35')](',')[_0xf57d('0x33')](function(_0x3e4392){return Number(_0x3e4392);});_0x46871b[_0xf57d('0x6e')](function(_0x2b5931){_0x5bf6df['or'](_0xf57d('0x6f'),'%,'+_0x2b5931+',%');});_0x23fc54=_[_0xf57d('0x70')](_0x23fc54,_0x46871b);break;case _0xf57d('0x71'):if(_0x1b5270[_0xf57d('0x65')]===_0xf57d('0x66')){_0x16e819[_0x216448](_0xf57d('0x72'),'%'+_0x1b5270[_0xf57d('0x61')]+'%',null);}else{_0x4a2384=_['find'](_0xb011c5,[_0xf57d('0x30'),_0xf57d('0x73')]);_0x1b5270[_0xf57d('0x4a')]='UserId';_0x592041=as['buildExpression'](_0xe591c2,_0x4a2384['type'],_0x1b5270);_0x16e819[_0x216448](_0x592041['text'],_0x592041[_0xf57d('0x61')][_0xf57d('0x6c')],_0x592041[_0xf57d('0x61')][_0xf57d('0x21')]);}break;case _0xf57d('0x74'):_0x592041=as[_0xf57d('0x69')]('me',null,_0x1b5270);_0x16e819[_0x216448](_0x592041[_0xf57d('0x6b')],_0x592041['value'][_0xf57d('0x6c')],_0x592041[_0xf57d('0x61')][_0xf57d('0x21')]);break;}}else{var _0x592041=as[_0xf57d('0x69')](_0xe591c2,_0x4a2384[_0xf57d('0x6a')],_0x1b5270);_0x16e819[_0x216448](_0x592041['text'],_0x592041['value']['start'],_0x592041[_0xf57d('0x61')][_0xf57d('0x21')]);}}}else{var _0x42ae30=_(_0x36d932[_0xf57d('0x3d')])[_0xf57d('0x75')]()[_0xf57d('0x33')](function(_0x2a6f9e){return _['some'](_0xb011c5,[_0xf57d('0x30'),_0x2a6f9e])?_0x2a6f9e:undefined;})[_0xf57d('0x76')]()[_0xf57d('0x61')]();if(!_[_0xf57d('0x77')](_0x42ae30)){_0x42ae30[_0xf57d('0x6e')](function(_0x412eaf){if(_0x412eaf===_0xf57d('0x78')){_0x498023[_0xf57d('0x47')]('i.SmsAccountId\x20IN\x20?',[][_0xf57d('0x79')](_0x36d932[_0xf57d('0x3d')][_0x412eaf]));}else if(_0x412eaf===_0xf57d('0x7a')){var _0xe1cac2=JSON[_0xf57d('0x7b')](_0x36d932[_0xf57d('0x3d')][_0x412eaf])[_0xf57d('0x7c')];var _0x1d5734=JSON[_0xf57d('0x7b')](_0x36d932[_0xf57d('0x3d')][_0x412eaf])['$lte'];_0x498023[_0xf57d('0x47')](_0xf57d('0x7d'),_0xe1cac2,_0x1d5734);}else{if(_0x36d932[_0xf57d('0x3d')][_0x412eaf]===_0xf57d('0x7e')){_0x498023[_0xf57d('0x47')]('i.'+_0x412eaf+_0xf57d('0x7f'));}else{_0x498023['where']('i.'+_0x412eaf+_0xf57d('0x80'),_0x36d932[_0xf57d('0x3d')][_0x412eaf]);}}});}if(_0x36d932[_0xf57d('0x3d')][_0xf57d('0x81')]){if(_0x36d932[_0xf57d('0x3d')][_0xf57d('0x81')]==0x1){_0x498023[_0xf57d('0x62')]('`unreadMessages`\x20=\x200');}else{_0x498023[_0xf57d('0x62')](_0xf57d('0x82'));}}if(_0x36d932[_0xf57d('0x3d')]['tag']){_0x23fc54=_[_0xf57d('0x83')](_0x36d932[_0xf57d('0x3d')][_0xf57d('0x84')])?_0x36d932['query']['tag']:new Array(_0x36d932['query']['tag']);_0x23fc54[_0xf57d('0x6e')](function(_0x45d217){_0x5bf6df['or'](_0xf57d('0x6f'),'%,'+_0x45d217+',%');});}if(_0x36d932[_0xf57d('0x3d')]['filter']){var _0x50f463=_0x36d932[_0xf57d('0x3d')][_0xf57d('0x85')][_0xf57d('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x50f463)){_0x16e819['or']('i.id\x20LIKE\x20?',_0x50f463+'%')['or'](_0xf57d('0x87'),_0x50f463+'%');}else{_0x16e819['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf57d('0x88')](_0x50f463))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x50f463+'%');}}}_0x498023[_0xf57d('0x47')](_0x16e819);_0x498023['group'](_0xf57d('0x89'));var _0x3166ec={'type':db['Sequelize'][_0xf57d('0x8a')][_0xf57d('0x8b')],'raw':!![]};var _0x409466=_0x498023[_0xf57d('0x8c')]();_0x409466[_0xf57d('0x4a')](_0xf57d('0x89'));_0x409466[_0xf57d('0x4a')](_0xf57d('0x8d'),_0xf57d('0x60'));if(_0x3401c4[_0xf57d('0x45')]){_0x3401c4[_0xf57d('0x45')][_0xf57d('0x6e')](function(_0xd2b0f9){var _0x37606b=_0xd2b0f9[0x0]===_0xf57d('0x8e')?_0xd2b0f9[0x0]:'i.'+_0xd2b0f9[0x0];_0x498023['order'](_0x37606b,_0xd2b0f9[0x1]===_0xf57d('0x8f')?![]:!![]);});}if(!_[_0xf57d('0x77')](_0x23fc54)){_0x498023[_0xf57d('0x62')](_0x5bf6df);_0x409466[_0xf57d('0x47')](_0xf57d('0x90'),_0x23fc54);}BPromise[_0xf57d('0x91')]()[_0xf57d('0x2d')](function(){if(!_0xf03168){if(_0x36d932[_0xf57d('0x3d')][_0xf57d('0x78')])return;_0x409466[_0xf57d('0x47')](_0xf57d('0x92'));_0x498023['where'](_0xf57d('0x92'));return;}if(_0x36d932['user'][_0xf57d('0x93')]!==_0xf57d('0x94'))return;return _0x36d932[_0xf57d('0x95')][_0xf57d('0x96')]({'attributes':['id'],'raw':!![]})[_0xf57d('0x2d')](function(_0x5f24bb){if(_[_0xf57d('0x77')](_0x5f24bb)){_0x409466['where'](_0xf57d('0x97'));_0x498023[_0xf57d('0x47')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x409466[_0xf57d('0x47')](_0xf57d('0x98'),_[_0xf57d('0x33')](_0x5f24bb,'id'));_0x498023[_0xf57d('0x47')](_0xf57d('0x98'),_[_0xf57d('0x33')](_0x5f24bb,'id'));}});})[_0xf57d('0x2d')](function(){if(_0x36d932[_0xf57d('0x95')][_0xf57d('0x93')]==='agent'&&!_0xf03168&&!_0x36d932['query'][_0xf57d('0x78')])return[];return db['sequelize'][_0xf57d('0x3d')](_0x409466['toString'](),_0x3166ec);})['then'](function(_0x4c3e80){_0x30efe0[_0xf57d('0x25')]=_0x4c3e80[_0xf57d('0x42')];if(_0x30efe0[_0xf57d('0x25')]===0x0)return[];return db[_0xf57d('0x99')][_0xf57d('0x3d')](_0x31dd4e['toString'](),_0x3166ec)[_0xf57d('0x2d')](function(_0x40ab2e){_0x53bb01=_[_0xf57d('0x9a')](_0x40ab2e,'id');_0x3166ec=_[_0xf57d('0x9b')](_0x3166ec,{'model':db[_0xf57d('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x36d932[_0xf57d('0x3d')]['fields']){_0x3401c4[_0xf57d('0x3f')][_0xf57d('0x6e')](function(_0xf184de){_0x498023[_0xf57d('0x4a')]('i.'+_0xf184de);});}else{_0x498023[_0xf57d('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf57d('0x60'));_0x498023[_0xf57d('0x4a')](_0xf57d('0x9c'),_0xf57d('0x9d'));_0x498023[_0xf57d('0x4a')](_0xf57d('0x9e'),'Account.mandatoryDisposition');_0x498023[_0xf57d('0x4a')](_0xf57d('0x9f'),_0xf57d('0x8e'));_0x498023[_0xf57d('0x4a')]('i.*');_0x498023['field']('c.firstName','Contact.firstName');_0x498023[_0xf57d('0x4a')](_0xf57d('0xa0'),_0xf57d('0xa1'));_0x498023['field'](_0xf57d('0xa2'),_0xf57d('0xa3'));_0x498023[_0xf57d('0x4a')]('c.phone',_0xf57d('0xa4'));_0x498023[_0xf57d('0x4a')](_0xf57d('0xa5'),_0xf57d('0xa6'));_0x498023[_0xf57d('0x4a')](_0xf57d('0xa7'),_0xf57d('0xa8'));_0x498023[_0xf57d('0x4a')](_0xf57d('0xa9'),_0xf57d('0xaa'));_0x498023[_0xf57d('0x4a')]('o.internal',_0xf57d('0xab'));_0x498023[_0xf57d('0x4a')](_0xf57d('0xac'),_0xf57d('0x37'));}if(_0x3401c4[_0xf57d('0x24')])_0x498023[_0xf57d('0x24')](_0x3401c4[_0xf57d('0x24')]);if(_0x3401c4['offset'])_0x498023[_0xf57d('0x26')](_0x3401c4['offset']);return db['sequelize'][_0xf57d('0x3d')](_0x498023[_0xf57d('0xad')](),_0x3166ec);})[_0xf57d('0x2d')](function(_0xf52e8a){if(_0xf52e8a['length']>0x0)_0x10ee62['where'](_0xf57d('0xae'),_[_0xf57d('0x33')](_0xf52e8a,'id'));return db[_0xf57d('0x99')][_0xf57d('0x3d')](_0x10ee62[_0xf57d('0xad')](),_0x3166ec)[_0xf57d('0x2d')](function(_0xef04d){var _0x16fe8f=_[_0xf57d('0xaf')](_0xef04d,_0xf57d('0xb0'));var _0x1bad1d=[];_0xf52e8a[_0xf57d('0x6e')](function(_0x3aa7b5){_0x1bad1d['push'](updateSmsInteraction(_0x3aa7b5,_0x53bb01,_0x16fe8f));});return BPromise['all'](_0x1bad1d);});});})['then'](function(_0x35c471){_0x30efe0['rows']=_0x35c471;return _0x30efe0;})[_0xf57d('0x2d')](respondWithFilteredResult(_0x50cff3,_0x3401c4))[_0xf57d('0x38')](handleError(_0x50cff3,null));};exports[_0xf57d('0xb1')]=function(_0x40e2ba,_0x34d6e5){var _0x2324fa={'raw':![],'where':{'id':_0x40e2ba[_0xf57d('0xb2')]['id']}},_0x2ab39a={};_0x2ab39a[_0xf57d('0x3c')]=_[_0xf57d('0x75')](db[_0xf57d('0x3a')][_0xf57d('0x3b')]);_0x2ab39a[_0xf57d('0x3d')]=_[_0xf57d('0x75')](_0x40e2ba[_0xf57d('0x3d')]);_0x2ab39a[_0xf57d('0x3e')]=_[_0xf57d('0x40')](_0x2ab39a[_0xf57d('0x3c')],_0x2ab39a['query']);_0x2324fa['attributes']=_[_0xf57d('0x40')](_0x2ab39a['model'],qs['fields'](_0x40e2ba[_0xf57d('0x3d')][_0xf57d('0x41')]));_0x2324fa[_0xf57d('0x3f')]=_0x2324fa['attributes']['length']?_0x2324fa[_0xf57d('0x3f')]:_0x2ab39a['model'];if(_0x40e2ba[_0xf57d('0x3d')][_0xf57d('0xb3')]){_0x2324fa[_0xf57d('0xb4')]=[{'all':!![]}];}_0x2324fa=_[_0xf57d('0x9b')]({},_0x2324fa,_0x40e2ba[_0xf57d('0xb5')]);return db[_0xf57d('0x3a')][_0xf57d('0x67')](_0x2324fa)[_0xf57d('0x2d')](handleEntityNotFound(_0x34d6e5,null))[_0xf57d('0x2d')](respondWithResult(_0x34d6e5,null))[_0xf57d('0x38')](handleError(_0x34d6e5,null));};exports[_0xf57d('0xb6')]=function(_0x4eb315,_0x77fe1a){return db[_0xf57d('0x3a')]['create'](_0x4eb315[_0xf57d('0x74')],{})['then'](respondWithResult(_0x77fe1a,0xc9))[_0xf57d('0x38')](handleError(_0x77fe1a,null));};exports[_0xf57d('0x2b')]=function(_0x4cd87c,_0x44f821){if(_0x4cd87c[_0xf57d('0x74')]['id']){delete _0x4cd87c[_0xf57d('0x74')]['id'];}return db[_0xf57d('0x3a')][_0xf57d('0x67')]({'where':{'id':_0x4cd87c[_0xf57d('0xb2')]['id']}})['then'](handleEntityNotFound(_0x44f821,null))['then'](saveUpdates(_0x4cd87c['body'],null))['then'](respondWithResult(_0x44f821,null))[_0xf57d('0x38')](handleError(_0x44f821,null));};exports[_0xf57d('0x2c')]=function(_0x5ae370,_0x3fe75d){return db[_0xf57d('0x3a')]['find']({'where':{'id':_0x5ae370[_0xf57d('0xb2')]['id']}})['then'](handleEntityNotFound(_0x3fe75d,null))[_0xf57d('0x2d')](removeEntity(_0x3fe75d,null))['catch'](handleError(_0x3fe75d,null));};exports[_0xf57d('0xb7')]=function(_0x523f88,_0x1af165){return db[_0xf57d('0x3a')][_0xf57d('0xb7')]()['then'](respondWithResult(_0x1af165,null))['catch'](handleError(_0x1af165,null));};exports[_0xf57d('0xb8')]=function(_0x117394,_0x147f61,_0x2c4723){return db[_0xf57d('0xb9')]['find']({'where':{'id':_0x117394[_0xf57d('0xb2')]['id']}})['then'](handleEntityNotFound(_0x147f61,null))['then'](function(_0x45ef1f){if(_0x45ef1f){return _0x45ef1f[_0xf57d('0xb8')](_0x117394[_0xf57d('0x74')][_0xf57d('0xba')],_[_0xf57d('0xbb')](_0x117394['body'],[_0xf57d('0xba'),'id'])||{});}})[_0xf57d('0x2d')](respondWithResult(_0x147f61,null))['catch'](handleError(_0x147f61,null));};exports[_0xf57d('0xbc')]=function(_0x9ad389,_0x5bc58b,_0x4346f8){var _0x3a2208={'raw':![],'where':{}};var _0x5a9da3={};var _0x2debff={'count':0x0,'rows':[]};return db[_0xf57d('0x3a')][_0xf57d('0xbd')]({'where':{'id':_0x9ad389[_0xf57d('0xb2')]['id']}})['then'](handleEntityNotFound(_0x5bc58b,null))[_0xf57d('0x2d')](function(_0x78f1e5){if(_0x78f1e5){_0x5a9da3[_0xf57d('0x3c')]=_[_0xf57d('0x75')](db[_0xf57d('0xb9')][_0xf57d('0x3b')]);_0x5a9da3[_0xf57d('0x3d')]=_[_0xf57d('0x75')](_0x9ad389[_0xf57d('0x3d')]);_0x5a9da3[_0xf57d('0x3e')]=_[_0xf57d('0x40')](_0x5a9da3[_0xf57d('0x3c')],_0x5a9da3[_0xf57d('0x3d')]);_0x3a2208[_0xf57d('0x3f')]=_['intersection'](_0x5a9da3[_0xf57d('0x3c')],qs[_0xf57d('0x41')](_0x9ad389[_0xf57d('0x3d')]['fields']));_0x3a2208['attributes']=_0x3a2208['attributes'][_0xf57d('0x42')]?_0x3a2208['attributes']:_0x5a9da3[_0xf57d('0x3c')];if(!_0x9ad389[_0xf57d('0x3d')][_0xf57d('0x43')](_0xf57d('0x44'))){_0x3a2208[_0xf57d('0x24')]=qs[_0xf57d('0x24')](_0x9ad389[_0xf57d('0x3d')][_0xf57d('0x24')]);_0x3a2208[_0xf57d('0x26')]=qs[_0xf57d('0x26')](_0x9ad389[_0xf57d('0x3d')][_0xf57d('0x26')]);}_0x3a2208[_0xf57d('0x45')]=qs['sort'](_0x9ad389['query']['sort']);_0x3a2208[_0xf57d('0x47')]=qs[_0xf57d('0x3e')](_[_0xf57d('0x48')](_0x9ad389[_0xf57d('0x3d')],_0x5a9da3[_0xf57d('0x3e')]));_0x3a2208[_0xf57d('0x47')][_0xf57d('0xb0')]=_0x78f1e5['id'];if(_0x9ad389[_0xf57d('0x3d')][_0xf57d('0x85')]){_0x3a2208[_0xf57d('0x47')]=_[_0xf57d('0x9b')](_0x3a2208['where'],{'$or':_[_0xf57d('0x33')](_0x3a2208[_0xf57d('0x3f')],function(_0x3c1885){var _0x1d84e0={};_0x1d84e0[_0x3c1885]={'$like':'%'+_0x9ad389[_0xf57d('0x3d')][_0xf57d('0x85')]+'%'};return _0x1d84e0;})});}if(_0x9ad389[_0xf57d('0x3d')][_0xf57d('0x7c')]){var _0x20bd0f=_0x9ad389['query'][_0xf57d('0x7c')][_0xf57d('0x35')](',');var _0x388668={};_0x388668[_0x20bd0f[0x0]]={'$gte':moment(_0x20bd0f[0x1])[_0xf57d('0xbe')](_0xf57d('0xbf'))};_0x3a2208['where']=_[_0xf57d('0x9b')](_0x3a2208[_0xf57d('0x47')],_0x388668);}_0x3a2208=_['merge']({},_0x3a2208,_0x9ad389[_0xf57d('0xb5')]);return db[_0xf57d('0xb9')][_0xf57d('0x25')]({'where':_0x3a2208[_0xf57d('0x47')]})[_0xf57d('0x2d')](function(_0x95f4f2){_0x2debff[_0xf57d('0x25')]=_0x95f4f2;if(_0x9ad389[_0xf57d('0x3d')]['includeAll']){_0x3a2208[_0xf57d('0xb4')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x3a2208);})['then'](function(_0x3fdc79){_0x2debff[_0xf57d('0xc0')]=_0x3fdc79;return _0x2debff;});}})[_0xf57d('0x2d')](respondWithFilteredResult(_0x5bc58b,_0x3a2208))[_0xf57d('0x38')](handleError(_0x5bc58b,null));};exports['addTags']=function(_0x4c45da,_0x3cb268,_0x4c86bf){return db[_0xf57d('0x3a')][_0xf57d('0x67')]({'where':{'id':_0x4c45da['params']['id']}})['then'](handleEntityNotFound(_0x3cb268,null))[_0xf57d('0x2d')](function(_0x566127){if(_0x566127){return _0x566127['setTags'](_0x4c45da[_0xf57d('0x74')][_0xf57d('0xba')],_[_0xf57d('0xbb')](_0x4c45da[_0xf57d('0x74')],['ids','id'])||{})[_0xf57d('0xc1')](function(){return db[_0xf57d('0x6d')][_0xf57d('0xc2')]({'attributes':['id','name','color'],'where':{'id':_0x4c45da[_0xf57d('0x74')]['ids']}});})['then'](function(_0x5a8943){socket[_0xf57d('0xc3')]('smsInteractionTags:save',{'id':Number(_0x4c45da[_0xf57d('0xb2')]['id']),'tags':_0x5a8943||[]});return{'id':Number(_0x4c45da[_0xf57d('0xb2')]['id']),'tags':_0x5a8943||[]};});}})['then'](respondWithResult(_0x3cb268,null))[_0xf57d('0x38')](handleError(_0x3cb268,null));};exports['removeTags']=function(_0x461d51,_0x140e7b,_0x4db299){return db[_0xf57d('0x3a')]['find']({'where':{'id':_0x461d51[_0xf57d('0xb2')]['id']}})[_0xf57d('0x2d')](handleEntityNotFound(_0x140e7b,null))[_0xf57d('0x2d')](function(_0x27a525){if(_0x27a525){return _0x27a525['removeTags'](_0x461d51[_0xf57d('0x3d')][_0xf57d('0xba')]);}})['then'](respondWithStatusCode(_0x140e7b,null))['catch'](handleError(_0x140e7b,null));};exports['download']=function(_0x1eb40d,_0x5af466){var _0x29f761=moment()['unix']()['toString']();var _0x45471b=path[_0xf57d('0xc4')](config[_0xf57d('0xc5')],_0xf57d('0xc6'),'files','tmp');var _0x360a5d=path[_0xf57d('0xc4')](config[_0xf57d('0xc5')],_0xf57d('0xc6'),_0xf57d('0xc7'),_0xf57d('0xc8'));var _0x33991c=path[_0xf57d('0xc4')](_0x45471b,_0x29f761);var _0xcac2db=util['format']('transcript-%d-%s.zip',_0x1eb40d[_0xf57d('0xb2')]['id'],_0x29f761);var _0x1b6ef7=path[_0xf57d('0xc4')](_0x45471b,_0xcac2db);var _0x371aeb=[];_0x371aeb[_0xf57d('0x36')]({'model':db[_0xf57d('0x71')],'as':_0xf57d('0x71'),'attributes':['id','fullname'],'raw':!![]});_0x371aeb[_0xf57d('0x36')]({'model':db[_0xf57d('0xc9')],'as':_0xf57d('0x64'),'attributes':['id',_0xf57d('0xca'),_0xf57d('0xcb')],'raw':!![]});var _0x46fa36=[{'model':db[_0xf57d('0xb9')],'as':_0xf57d('0xcc'),'attributes':['id','body',_0xf57d('0x7a'),'direction',_0xf57d('0xcd'),_0xf57d('0x81')],'include':_0x371aeb}];_0x46fa36[_0xf57d('0x36')]({'model':db[_0xf57d('0xce')],'as':_0xf57d('0xcf'),'attributes':['id','name']});_0x46fa36[_0xf57d('0x36')]({'model':db[_0xf57d('0x71')],'as':_0xf57d('0xd0'),'attributes':['id',_0xf57d('0xd1')]});return db['SmsInteraction'][_0xf57d('0x67')]({'where':{'id':_0x1eb40d[_0xf57d('0xb2')]['id']},'include':_0x46fa36})[_0xf57d('0x2d')](handleEntityNotFound(_0x5af466,null))['then'](function(_0x33eb7b){if(_0x33eb7b){var _0xb166e6=_0x33eb7b[_0xf57d('0xd2')]({'plain':!![]});fs[_0xf57d('0xd3')](_0x33991c);var _0x5d7109={'channel':_0xf57d('0xd4'),'account':_0xb166e6['Account'][_0xf57d('0x30')],'agent':_0xb166e6[_0xf57d('0xd0')]?_0xb166e6[_0xf57d('0xd0')][_0xf57d('0xd1')]:_0xf57d('0xd5'),'createdAt':moment(_0xb166e6['createdAt'])[_0xf57d('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0xb166e6[_0xf57d('0xd6')]?moment(_0xb166e6['closedAt'])[_0xf57d('0xbe')](_0xf57d('0xbf'))[_0xf57d('0xad')]():'','disposition':_0xb166e6[_0xf57d('0xd7')],'messages':_(_0xb166e6['Messages'])[_0xf57d('0x85')]({'secret':![]})['map'](function(_0x5384e4){return{'date':moment(_0x5384e4['createdAt'])[_0xf57d('0xbe')](_0xf57d('0xbf'))[_0xf57d('0xad')](),'sender':_0x5384e4[_0xf57d('0xd8')]===_0xf57d('0xd9')?_0x5384e4[_0xf57d('0x71')]?_0x5384e4['User'][_0xf57d('0xd1')]:_0xf57d('0xda'):_0x5384e4['Contact'][_0xf57d('0xca')]+(_0x5384e4[_0xf57d('0x64')][_0xf57d('0xcb')]?'\x20'+_0x5384e4[_0xf57d('0x64')][_0xf57d('0xcb')]:''),'body':_0x5384e4[_0xf57d('0x74')],'direction':_0x5384e4['direction']===_0xf57d('0xd9')?'A':'C','secret':_0x5384e4[_0xf57d('0xcd')],'read':_0x5384e4['read']};})[_0xf57d('0x61')]()};return ejs['renderFile'](path[_0xf57d('0xc4')](config[_0xf57d('0xc5')],_0xf57d('0xc6'),'views','downloadInteraction.ejs'),{'interaction':_0x5d7109})[_0xf57d('0x2d')](function(_0x21cab2){var _0x4b032a=path[_0xf57d('0xc4')](_0x33991c,_0xf57d('0xdb')+_0xb166e6['id']+'-'+_0x29f761+_0xf57d('0xdc'));var _0x2a5b01={'path':_0x4b032a,'channel':_0xf57d('0xd4'),'interactionId':_0xb166e6['id']};return pdf[_0xf57d('0xdd')](_0x21cab2,_0x2a5b01);})['then'](function(){return new BPromise(function(_0x5e1298,_0x4c83a9){zipdir(_0x33991c,{'saveTo':_0x1b6ef7},function(_0x2de47f,_0x303085){if(_0x2de47f)return _0x4c83a9(_0x2de47f);return _0x5e1298(_0x303085);});})[_0xf57d('0x2d')](function(){return new BPromise(function(_0x2a18c5,_0x4bba0f){rimraf(_0x33991c,function(_0x7723c6){if(_0x7723c6)_0x4bba0f(_0x7723c6);return _0x2a18c5();});});})[_0xf57d('0x2d')](function(){return _0x5af466['download'](_0x1b6ef7,_0xcac2db,function(_0x410cfd){if(_0x410cfd){console[_0xf57d('0xde')](_0xf57d('0xdf'),_0x410cfd);}else{fs['unlinkSync'](_0x1b6ef7);}});});});}else{return _0x5af466['sendStatus'](0xc8);}})[_0xf57d('0x38')](handleError(_0x5af466,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 9e73d0c..69e384f 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 _0x065e=['emit','catch','hasOwnProperty','events','SmsMessage','setMaxListeners','save','getUsers','then','setDataValue','map','findAll','unreadMessages','length'];(function(_0x57a695,_0x3b2f4e){var _0x2fb322=function(_0x483da1){while(--_0x483da1){_0x57a695['push'](_0x57a695['shift']());}};_0x2fb322(++_0x3b2f4e);}(_0x065e,0x1a7));var _0xe065=function(_0x13a933,_0x37002a){_0x13a933=_0x13a933-0x0;var _0x58d82e=_0x065e[_0x13a933];return _0x58d82e;};'use strict';var EventEmitter=require(_0xe065('0x0'));var SmsInteraction=require('../../mysqldb')['db']['SmsInteraction'];var SmsMessage=require('../../mysqldb')['db'][_0xe065('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xe065('0x2')](0x0);var events={'afterCreate':_0xe065('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4610a3){return function(_0x2f90aa,_0x5b099e,_0x10b45f){_0x2f90aa[_0xe065('0x4')]({'attributes':['id'],'raw':!![]})[_0xe065('0x5')](function(_0x52403a){_0x2f90aa[_0xe065('0x6')]('Users',_0x52403a[_0xe065('0x7')](function(_0x2f072e){return{'id':_0x2f072e['id']};}));return SmsMessage[_0xe065('0x8')]({'where':{'SmsInteractionId':_0x2f90aa['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe065('0x5')](function(_0x85001e){_0x2f90aa['setDataValue'](_0xe065('0x9'),_0x85001e[_0xe065('0xa')]);SmsInteractionEvents[_0xe065('0xb')](_0x4610a3+':'+_0x2f90aa['id'],_0x2f90aa);SmsInteractionEvents[_0xe065('0xb')](_0x4610a3,_0x2f90aa);_0x10b45f(null);})[_0xe065('0xc')](_0x10b45f(null));};}for(var e in events){if(events[_0xe065('0xd')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0xab40=['remove','then','setDataValue','Users','unreadMessages','length','emit','catch','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x1c0a6d,_0x5f4acd){var _0x2fb447=function(_0xbda13c){while(--_0xbda13c){_0x1c0a6d['push'](_0x1c0a6d['shift']());}};_0x2fb447(++_0x5f4acd);}(_0xab40,0xcd));var _0x0ab4=function(_0x2c2b7e,_0x16d35c){_0x2c2b7e=_0x2c2b7e-0x0;var _0xb23fe7=_0xab40[_0x2c2b7e];return _0xb23fe7;};'use strict';var EventEmitter=require(_0x0ab4('0x0'));var SmsInteraction=require(_0x0ab4('0x1'))['db']['SmsInteraction'];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x0ab4('0x2')](0x0);var events={'afterCreate':_0x0ab4('0x3'),'afterUpdate':_0x0ab4('0x4'),'afterDestroy':_0x0ab4('0x5')};function emitEvent(_0x14634a){return function(_0x57fac1,_0x5f01aa,_0x28b17a){_0x57fac1['getUsers']({'attributes':['id'],'raw':!![]})[_0x0ab4('0x6')](function(_0x46d16a){_0x57fac1[_0x0ab4('0x7')](_0x0ab4('0x8'),_0x46d16a['map'](function(_0x55263d){return{'id':_0x55263d['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x57fac1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0ab4('0x6')](function(_0x30e726){_0x57fac1[_0x0ab4('0x7')](_0x0ab4('0x9'),_0x30e726[_0x0ab4('0xa')]);SmsInteractionEvents[_0x0ab4('0xb')](_0x14634a+':'+_0x57fac1['id'],_0x57fac1);SmsInteractionEvents[_0x0ab4('0xb')](_0x14634a,_0x57fac1);_0x28b17a(null);})[_0x0ab4('0xc')](_0x28b17a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x0ab4('0xd')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index fc6dd3c..b02f3e3 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 _0x10c8=['../../config/environment','exports','define','SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x5e5218,_0x4226ef){var _0x2dcd35=function(_0x11049f){while(--_0x11049f){_0x5e5218['push'](_0x5e5218['shift']());}};_0x2dcd35(++_0x4226ef);}(_0x10c8,0xf7));var _0x810c=function(_0x54c04f,_0x3c6e42){_0x54c04f=_0x54c04f-0x0;var _0xc45a00=_0x10c8[_0x54c04f];return _0xc45a00;};'use strict';var _=require(_0x810c('0x0'));var util=require(_0x810c('0x1'));var logger=require(_0x810c('0x2'))(_0x810c('0x3'));var moment=require('moment');var BPromise=require(_0x810c('0x4'));var rp=require(_0x810c('0x5'));var fs=require('fs');var path=require(_0x810c('0x6'));var rimraf=require(_0x810c('0x7'));var config=require(_0x810c('0x8'));var attributes=require('./smsInteraction.attributes');module[_0x810c('0x9')]=function(_0x427631,_0x473632){return _0x427631[_0x810c('0xa')](_0x810c('0xb'),attributes,{'tableName':_0x810c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4ab7cc,_0x13e540,_0x559d64){if(_0x4ab7cc[_0x810c('0xd')]('closed')){_0x4ab7cc[_0x810c('0xe')]=moment()[_0x810c('0xf')](_0x810c('0x10'));}_0x559d64(null,_0x4ab7cc);}}});}; \ No newline at end of file +var _0xf1da=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions'];(function(_0x33af0a,_0x32d6df){var _0x1504f1=function(_0x3a6ae2){while(--_0x3a6ae2){_0x33af0a['push'](_0x33af0a['shift']());}};_0x1504f1(++_0x32d6df);}(_0xf1da,0x1f4));var _0xaf1d=function(_0x3221f5,_0x22928f){_0x3221f5=_0x3221f5-0x0;var _0x242743=_0xf1da[_0x3221f5];return _0x242743;};'use strict';var _=require(_0xaf1d('0x0'));var util=require(_0xaf1d('0x1'));var logger=require(_0xaf1d('0x2'))('api');var moment=require(_0xaf1d('0x3'));var BPromise=require('bluebird');var rp=require(_0xaf1d('0x4'));var fs=require('fs');var path=require(_0xaf1d('0x5'));var rimraf=require('rimraf');var config=require(_0xaf1d('0x6'));var attributes=require(_0xaf1d('0x7'));module[_0xaf1d('0x8')]=function(_0x88bb03,_0x23eaaa){return _0x88bb03[_0xaf1d('0x9')](_0xaf1d('0xa'),attributes,{'tableName':_0xaf1d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x508315,_0xfced2,_0x15bf44){if(_0x508315[_0xaf1d('0xc')](_0xaf1d('0xd'))){_0x508315[_0xaf1d('0xe')]=moment()['format'](_0xaf1d('0xf'));}_0x15bf44(null,_0x508315);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 354868f..32c5d2f 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 _0x93da=['attributes','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SmsInteraction','update','options','raw','where'];(function(_0x4c4777,_0x4a1a88){var _0x31eea6=function(_0x689a8f){while(--_0x689a8f){_0x4c4777['push'](_0x4c4777['shift']());}};_0x31eea6(++_0x4a1a88);}(_0x93da,0x8b));var _0xa93d=function(_0x59afb4,_0x456158){_0x59afb4=_0x59afb4-0x0;var _0x2569f1=_0x93da[_0x59afb4];return _0x2569f1;};'use strict';var _=require(_0xa93d('0x0'));var util=require(_0xa93d('0x1'));var moment=require('moment');var BPromise=require(_0xa93d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa93d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa93d('0x4'))(_0xa93d('0x5'));var config=require(_0xa93d('0x6'));var jayson=require(_0xa93d('0x7'));var client=jayson['client'][_0xa93d('0x8')]({'port':0x232a});config['redis']=_[_0xa93d('0x9')](config[_0xa93d('0xa')],{'host':_0xa93d('0xb'),'port':0x18eb});var socket=require(_0xa93d('0xc'))(new Redis(config[_0xa93d('0xa')]));require(_0xa93d('0xd'))[_0xa93d('0xe')](socket);function respondWithRpcPromise(_0x5ecd7c,_0x5e5771,_0x33b655){return new BPromise(function(_0x36eaff,_0x15111c){return client[_0xa93d('0xf')](_0x5ecd7c,_0x33b655)[_0xa93d('0x10')](function(_0x39b6a1){logger['info'](_0xa93d('0x11'),_0x5e5771,_0xa93d('0x12'));logger[_0xa93d('0x13')](_0xa93d('0x14'),_0x5e5771,'request\x20sent',JSON[_0xa93d('0x15')](_0x39b6a1));if(_0x39b6a1[_0xa93d('0x16')]){if(_0x39b6a1['error'][_0xa93d('0x17')]===0x1f4){logger['error'](_0xa93d('0x11'),_0x5e5771,_0x39b6a1[_0xa93d('0x16')][_0xa93d('0x18')]);return _0x15111c(_0x39b6a1['error']['message']);}logger['error'](_0xa93d('0x11'),_0x5e5771,_0x39b6a1[_0xa93d('0x16')][_0xa93d('0x18')]);return _0x36eaff(_0x39b6a1[_0xa93d('0x16')][_0xa93d('0x18')]);}else{logger[_0xa93d('0x19')](_0xa93d('0x11'),_0x5e5771,_0xa93d('0x12'));_0x36eaff(_0x39b6a1[_0xa93d('0x1a')][_0xa93d('0x18')]);}})[_0xa93d('0x1b')](function(_0x28e52b){logger[_0xa93d('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x5e5771,_0x28e52b);_0x15111c(_0x28e52b);});});}exports['UpdateSmsInteraction']=function(_0x33d5af){var _0x477f26=this;return new Promise(function(_0x5c9a8f,_0x4ed40a){return db[_0xa93d('0x1c')][_0xa93d('0x1d')](_0x33d5af['body'],{'raw':_0x33d5af[_0xa93d('0x1e')]?_0x33d5af[_0xa93d('0x1e')][_0xa93d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33d5af[_0xa93d('0x1e')]?_0x33d5af[_0xa93d('0x1e')][_0xa93d('0x20')]||null:null,'attributes':_0x33d5af[_0xa93d('0x1e')]?_0x33d5af[_0xa93d('0x1e')][_0xa93d('0x21')]||null:null,'limit':_0x33d5af['options']?_0x33d5af['options']['limit']||null:null})['then'](function(_0x28cc2e){logger[_0xa93d('0x19')](_0xa93d('0x22'),_0x33d5af);logger[_0xa93d('0x13')](_0xa93d('0x22'),_0x33d5af,JSON[_0xa93d('0x15')](_0x28cc2e));_0x5c9a8f(_0x28cc2e);})[_0xa93d('0x1b')](function(_0x40a72d){logger[_0xa93d('0x16')](_0xa93d('0x22'),_0x40a72d[_0xa93d('0x18')],_0x33d5af);_0x4ed40a(_0x477f26['error'](0x1f4,_0x40a72d[_0xa93d('0x18')]));});});};exports[_0xa93d('0x23')]=function(_0x142245){return new Promise(function(_0x1d6a40,_0x489c2e){return db[_0xa93d('0x1c')][_0xa93d('0x24')]({'where':_0x142245[_0xa93d('0x1e')]?_0x142245[_0xa93d('0x1e')]['where']||null:null})[_0xa93d('0x10')](function(_0x16a125){if(_0x16a125){return _0x16a125[_0xa93d('0x25')](_0x142245[_0xa93d('0x26')][_0xa93d('0x27')],_[_0xa93d('0x28')](_0x142245[_0xa93d('0x26')],[_0xa93d('0x27'),'id'])||{});}})[_0xa93d('0x29')](function(_0x1a3132){logger[_0xa93d('0x19')](_0xa93d('0x2a'),_0x142245);logger[_0xa93d('0x13')](_0xa93d('0x2a'),_0x142245,JSON['stringify'](_0x1a3132));_0x1d6a40(_0x1a3132);})['catch'](function(_0x321240){logger[_0xa93d('0x16')](_0xa93d('0x2a'),_0x321240[_0xa93d('0x18')],_0x142245);_0x489c2e(_this[_0xa93d('0x16')](0x1f4,_0x321240[_0xa93d('0x18')]));});});}; \ No newline at end of file +var _0x4b97=['spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','SmsInteraction','update','options','raw','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','body','ids'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x4b97,0x80));var _0x74b9=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4b97[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x74b9('0x0'));var util=require(_0x74b9('0x1'));var moment=require(_0x74b9('0x2'));var BPromise=require(_0x74b9('0x3'));var rs=require(_0x74b9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74b9('0x5'))['db'];var utils=require(_0x74b9('0x6'));var logger=require(_0x74b9('0x7'))(_0x74b9('0x8'));var config=require(_0x74b9('0x9'));var jayson=require(_0x74b9('0xa'));var client=jayson['client'][_0x74b9('0xb')]({'port':0x232a});config[_0x74b9('0xc')]=_[_0x74b9('0xd')](config['redis'],{'host':_0x74b9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x74b9('0xc')]));require(_0x74b9('0xf'))['register'](socket);function respondWithRpcPromise(_0x4f9572,_0x2c5346,_0x4a8799){return new BPromise(function(_0x509e88,_0x2a964f){return client[_0x74b9('0x10')](_0x4f9572,_0x4a8799)[_0x74b9('0x11')](function(_0x6e52f2){logger[_0x74b9('0x12')](_0x74b9('0x13'),_0x2c5346,'request\x20sent');logger[_0x74b9('0x14')](_0x74b9('0x15'),_0x2c5346,_0x74b9('0x16'),JSON[_0x74b9('0x17')](_0x6e52f2));if(_0x6e52f2[_0x74b9('0x18')]){if(_0x6e52f2[_0x74b9('0x18')][_0x74b9('0x19')]===0x1f4){logger[_0x74b9('0x18')](_0x74b9('0x13'),_0x2c5346,_0x6e52f2[_0x74b9('0x18')][_0x74b9('0x1a')]);return _0x2a964f(_0x6e52f2[_0x74b9('0x18')][_0x74b9('0x1a')]);}logger['error'](_0x74b9('0x13'),_0x2c5346,_0x6e52f2[_0x74b9('0x18')][_0x74b9('0x1a')]);return _0x509e88(_0x6e52f2[_0x74b9('0x18')]['message']);}else{logger['info'](_0x74b9('0x13'),_0x2c5346,_0x74b9('0x16'));_0x509e88(_0x6e52f2['result'][_0x74b9('0x1a')]);}})[_0x74b9('0x1b')](function(_0x33fc4c){logger[_0x74b9('0x18')]('SmsInteraction,\x20%s,\x20%s',_0x2c5346,_0x33fc4c);_0x2a964f(_0x33fc4c);});});}exports['UpdateSmsInteraction']=function(_0x3b0ca0){var _0x179838=this;return new Promise(function(_0x1fe4a3,_0x5735e8){return db[_0x74b9('0x1c')][_0x74b9('0x1d')](_0x3b0ca0['body'],{'raw':_0x3b0ca0[_0x74b9('0x1e')]?_0x3b0ca0['options'][_0x74b9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b0ca0[_0x74b9('0x1e')]?_0x3b0ca0['options'][_0x74b9('0x20')]||null:null,'attributes':_0x3b0ca0['options']?_0x3b0ca0[_0x74b9('0x1e')][_0x74b9('0x21')]||null:null,'limit':_0x3b0ca0[_0x74b9('0x1e')]?_0x3b0ca0[_0x74b9('0x1e')][_0x74b9('0x22')]||null:null})[_0x74b9('0x11')](function(_0x26b695){logger[_0x74b9('0x12')](_0x74b9('0x23'),_0x3b0ca0);logger[_0x74b9('0x14')]('UpdateSmsInteraction',_0x3b0ca0,JSON[_0x74b9('0x17')](_0x26b695));_0x1fe4a3(_0x26b695);})[_0x74b9('0x1b')](function(_0x2196fa){logger['error'](_0x74b9('0x23'),_0x2196fa['message'],_0x3b0ca0);_0x5735e8(_0x179838[_0x74b9('0x18')](0x1f4,_0x2196fa[_0x74b9('0x1a')]));});});};exports[_0x74b9('0x24')]=function(_0x20f1a0){return new Promise(function(_0x130b7c,_0x2e626a){return db[_0x74b9('0x1c')][_0x74b9('0x25')]({'where':_0x20f1a0[_0x74b9('0x1e')]?_0x20f1a0['options'][_0x74b9('0x20')]||null:null})['then'](function(_0x367c70){if(_0x367c70){return _0x367c70['addTags'](_0x20f1a0[_0x74b9('0x26')][_0x74b9('0x27')],_['omit'](_0x20f1a0[_0x74b9('0x26')],[_0x74b9('0x27'),'id'])||{});}})[_0x74b9('0x28')](function(_0x44fb4e){logger[_0x74b9('0x12')](_0x74b9('0x29'),_0x20f1a0);logger['debug']('AddTags',_0x20f1a0,JSON[_0x74b9('0x17')](_0x44fb4e));_0x130b7c(_0x44fb4e);})[_0x74b9('0x1b')](function(_0xf7dd5a){logger[_0x74b9('0x18')](_0x74b9('0x29'),_0xf7dd5a[_0x74b9('0x1a')],_0x20f1a0);_0x2e626a(_this['error'](0x1f4,_0xf7dd5a[_0x74b9('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 7750889..3291f86 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 _0xe5bb=['removeListener','register','length','smsInteraction:','./smsInteraction.events','remove','emit'];(function(_0x35f727,_0x427d67){var _0x3c566e=function(_0x40eef6){while(--_0x40eef6){_0x35f727['push'](_0x35f727['shift']());}};_0x3c566e(++_0x427d67);}(_0xe5bb,0x6d));var _0xbe5b=function(_0x1fb0f2,_0x7a8047){_0x1fb0f2=_0x1fb0f2-0x0;var _0x3cecb4=_0xe5bb[_0x1fb0f2];return _0x3cecb4;};'use strict';var SmsInteractionEvents=require(_0xbe5b('0x0'));var events=['save',_0xbe5b('0x1'),'update'];function createListener(_0x4460a2,_0x3afd90){return function(_0x349025){_0x3afd90[_0xbe5b('0x2')](_0x4460a2,_0x349025);};}function removeListener(_0x580402,_0x1df104){return function(){SmsInteractionEvents[_0xbe5b('0x3')](_0x580402,_0x1df104);};}exports[_0xbe5b('0x4')]=function(_0x175474){for(var _0x5915ce=0x0,_0x4d35f3=events[_0xbe5b('0x5')];_0x5915ce<_0x4d35f3;_0x5915ce++){var _0x559b0a=events[_0x5915ce];var _0xd4be26=createListener(_0xbe5b('0x6')+_0x559b0a,_0x175474);SmsInteractionEvents['on'](_0x559b0a,_0xd4be26);}}; \ No newline at end of file +var _0xbfcf=['removeListener','register','smsInteraction:','./smsInteraction.events','remove','update','emit'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xbfcf,0x1bc));var _0xfbfc=function(_0x15b380,_0x1a3c5f){_0x15b380=_0x15b380-0x0;var _0x232c5c=_0xbfcf[_0x15b380];return _0x232c5c;};'use strict';var SmsInteractionEvents=require(_0xfbfc('0x0'));var events=['save',_0xfbfc('0x1'),_0xfbfc('0x2')];function createListener(_0x35df44,_0x23203f){return function(_0x41c9d1){_0x23203f[_0xfbfc('0x3')](_0x35df44,_0x41c9d1);};}function removeListener(_0x20027c,_0x2d89ca){return function(){SmsInteractionEvents[_0xfbfc('0x4')](_0x20027c,_0x2d89ca);};}exports[_0xfbfc('0x5')]=function(_0x5ec7d2){for(var _0x477bf8=0x0,_0x2d0efd=events['length'];_0x477bf8<_0x2d0efd;_0x477bf8++){var _0x1b5e09=events[_0x477bf8];var _0xea1696=createListener(_0xfbfc('0x6')+_0x1b5e09,_0x5ec7d2);SmsInteractionEvents['on'](_0x1b5e09,_0xea1696);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index a28022c..b43a348 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 _0x4588=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','tracked','sms','create','/:id/status','status','update','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x2de81b,_0x322f1d){var _0x3df553=function(_0x551338){while(--_0x551338){_0x2de81b['push'](_0x2de81b['shift']());}};_0x3df553(++_0x322f1d);}(_0x4588,0x113));var _0x8458=function(_0x534c8f,_0x500079){_0x534c8f=_0x534c8f-0x0;var _0x5a57f5=_0x4588[_0x534c8f];return _0x5a57f5;};'use strict';var multer=require(_0x8458('0x0'));var util=require(_0x8458('0x1'));var path=require(_0x8458('0x2'));var timeout=require(_0x8458('0x3'));var express=require('express');var router=express[_0x8458('0x4')]();var fs_extra=require(_0x8458('0x5'));var auth=require(_0x8458('0x6'));var interaction=require(_0x8458('0x7'));var config=require(_0x8458('0x8'));var controller=require('./smsMessage.controller');router[_0x8458('0x9')]('/',auth[_0x8458('0xa')](),controller['index']);router['get']('/describe',auth[_0x8458('0xa')](),controller[_0x8458('0xb')]);router[_0x8458('0x9')](_0x8458('0xc'),auth[_0x8458('0xa')](),controller[_0x8458('0xd')]);router[_0x8458('0xe')]('/',auth[_0x8458('0xa')](),interaction[_0x8458('0xf')](_0x8458('0x10'),'smsmessage:create'),controller[_0x8458('0x11')]);router[_0x8458('0xe')](_0x8458('0x12'),controller[_0x8458('0x13')]);router['put'](_0x8458('0xc'),auth[_0x8458('0xa')](),controller[_0x8458('0x14')]);router[_0x8458('0x15')](_0x8458('0x16'),auth[_0x8458('0xa')](),controller['accept']);router[_0x8458('0x15')](_0x8458('0x17'),auth[_0x8458('0xa')](),controller[_0x8458('0x18')]);router[_0x8458('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x8458('0x1a')]);module[_0x8458('0x1b')]=router; \ No newline at end of file +var _0xfef3=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','sms','smsmessage:create','/:id/status','status','update','put','/:id/accept','accept','/:id/reject','delete','destroy','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfef3,0x118));var _0x3fef=function(_0x2db845,_0x38d794){_0x2db845=_0x2db845-0x0;var _0x247735=_0xfef3[_0x2db845];return _0x247735;};'use strict';var multer=require(_0x3fef('0x0'));var util=require('util');var path=require(_0x3fef('0x1'));var timeout=require('connect-timeout');var express=require(_0x3fef('0x2'));var router=express[_0x3fef('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3fef('0x4'));var interaction=require(_0x3fef('0x5'));var config=require('../../config/environment');var controller=require(_0x3fef('0x6'));router[_0x3fef('0x7')]('/',auth['isAuthenticated'](),controller[_0x3fef('0x8')]);router[_0x3fef('0x7')](_0x3fef('0x9'),auth[_0x3fef('0xa')](),controller[_0x3fef('0xb')]);router[_0x3fef('0x7')](_0x3fef('0xc'),auth[_0x3fef('0xa')](),controller[_0x3fef('0xd')]);router[_0x3fef('0xe')]('/',auth[_0x3fef('0xa')](),interaction[_0x3fef('0xf')](_0x3fef('0x10'),_0x3fef('0x11')),controller['create']);router[_0x3fef('0xe')](_0x3fef('0x12'),controller[_0x3fef('0x13')]);router['put'](_0x3fef('0xc'),auth['isAuthenticated'](),controller[_0x3fef('0x14')]);router[_0x3fef('0x15')](_0x3fef('0x16'),auth['isAuthenticated'](),controller[_0x3fef('0x17')]);router['put'](_0x3fef('0x18'),auth[_0x3fef('0xa')](),controller['reject']);router[_0x3fef('0x19')](_0x3fef('0xc'),auth[_0x3fef('0xa')](),controller[_0x3fef('0x1a')]);module[_0x3fef('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index b0c15f1..8c588cc 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 _0xca4a=['medium','BOOLEAN','ENUM','out','STRING','sequelize','TEXT'];(function(_0x50f030,_0x25bfbc){var _0x259abd=function(_0x13c5ab){while(--_0x13c5ab){_0x50f030['push'](_0x50f030['shift']());}};_0x259abd(++_0x25bfbc);}(_0xca4a,0xa6));var _0xaca4=function(_0x331956,_0x2d031f){_0x331956=_0x331956-0x0;var _0x5d3fb9=_0xca4a[_0x331956];return _0x5d3fb9;};'use strict';var Sequelize=require(_0xaca4('0x0'));module['exports']={'body':{'type':Sequelize[_0xaca4('0x1')](_0xaca4('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xaca4('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xaca4('0x4')]('in',_0xaca4('0x5')),'defaultValue':_0xaca4('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xaca4('0x6')](0xbe)},'phone':{'type':Sequelize[_0xaca4('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xaca4('0x6')]},'providerResponse':{'type':Sequelize[_0xaca4('0x1')]}}; \ No newline at end of file +var _0x5e53=['exports','medium','ENUM','out','STRING','DATE','BOOLEAN','sequelize'];(function(_0x9c8e15,_0x3a7a93){var _0x5555cf=function(_0xb7ad8a){while(--_0xb7ad8a){_0x9c8e15['push'](_0x9c8e15['shift']());}};_0x5555cf(++_0x3a7a93);}(_0x5e53,0xa7));var _0x35e5=function(_0x52d9eb,_0x28cfd0){_0x52d9eb=_0x52d9eb-0x0;var _0x1dad70=_0x5e53[_0x52d9eb];return _0x1dad70;};'use strict';var Sequelize=require(_0x35e5('0x0'));module[_0x35e5('0x1')]={'body':{'type':Sequelize['TEXT'](_0x35e5('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x35e5('0x3')]('in',_0x35e5('0x4')),'defaultValue':_0x35e5('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x35e5('0x5')]},'readAt':{'type':Sequelize[_0x35e5('0x6')]},'secret':{'type':Sequelize[_0x35e5('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x35e5('0x5')]},'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 1ace70f..1825b88 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 _0xad85=['to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','destroy','name','send','index','SmsMessage','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','order','sort','where','filters','VIRTUAL','filter','include','findAll','rows','show','params','keys','includeAll','options','create','update','body','find','describe','sms-interactions','accept','sms','read','format','UserId','user','get','SmsInteraction','SmsInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','fullname','email','internal','agent','manual','SIP/%s','channel','EventManager','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','rejectMessage','SELECT','User','interface','event','rejectmessage','SmsAccount','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','delivered','Status','plivio','infobip','results','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xad85,0x1a0));var _0x5ad8=function(_0x111c47,_0x2c867b){_0x111c47=_0x111c47-0x0;var _0x30790f=_0xad85[_0x111c47];return _0x30790f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ad8('0x0'));var zipdir=require(_0x5ad8('0x1'));var jsonpatch=require(_0x5ad8('0x2'));var rp=require(_0x5ad8('0x3'));var moment=require('moment');var BPromise=require(_0x5ad8('0x4'));var Mustache=require(_0x5ad8('0x5'));var util=require('util');var path=require(_0x5ad8('0x6'));var sox=require('sox');var csv=require(_0x5ad8('0x7'));var ejs=require(_0x5ad8('0x8'));var fs=require('fs');var fs_extra=require(_0x5ad8('0x9'));var _=require('lodash');var squel=require(_0x5ad8('0xa'));var crypto=require(_0x5ad8('0xb'));var jsforce=require(_0x5ad8('0xc'));var deskjs=require(_0x5ad8('0xd'));var toCsv=require(_0x5ad8('0x7'));var querystring=require(_0x5ad8('0xe'));var Papa=require(_0x5ad8('0xf'));var Redis=require('ioredis');var authService=require(_0x5ad8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5ad8('0x11'));var hardwareService=require(_0x5ad8('0x12'));var logger=require(_0x5ad8('0x13'))('api');var utils=require(_0x5ad8('0x14'));var config=require(_0x5ad8('0x15'));var licenseUtil=require(_0x5ad8('0x16'));var db=require('../../mysqldb')['db'];config[_0x5ad8('0x17')]=_['defaults'](config['redis'],{'host':_0x5ad8('0x18'),'port':0x18eb});var socket=require(_0x5ad8('0x19'))(new Redis(config[_0x5ad8('0x17')]));require(_0x5ad8('0x1a'))[_0x5ad8('0x1b')](socket);var jayson=require(_0x5ad8('0x1c'));var client=jayson[_0x5ad8('0x1d')][_0x5ad8('0x1e')]({'port':0x232c});var client9002=jayson[_0x5ad8('0x1d')][_0x5ad8('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x11f939,_0x48bab4,_0x21b805,_0x5c6a3a){return new BPromise(function(_0x59daea,_0x1883c9){var _0x57cc9b=_0x5c6a3a||client;return _0x57cc9b[_0x5ad8('0x1f')](_0x11f939,_0x21b805)[_0x5ad8('0x20')](function(_0x559632){logger[_0x5ad8('0x21')](_0x5ad8('0x22'),_0x48bab4,'request\x20sent');logger[_0x5ad8('0x23')](_0x5ad8('0x24'),_0x48bab4,_0x5ad8('0x25'),JSON['stringify'](_0x559632));if(_0x559632['error']){if(_0x559632[_0x5ad8('0x26')]['code']===0x1f4){logger[_0x5ad8('0x26')](_0x5ad8('0x22'),_0x48bab4,_0x559632[_0x5ad8('0x26')][_0x5ad8('0x27')]);return _0x1883c9(_0x559632['error']['message']);}logger[_0x5ad8('0x26')](_0x5ad8('0x22'),_0x48bab4,_0x559632[_0x5ad8('0x26')][_0x5ad8('0x27')]);return _0x59daea(_0x559632[_0x5ad8('0x26')][_0x5ad8('0x27')]);}else{logger[_0x5ad8('0x21')](_0x5ad8('0x22'),_0x48bab4,'request\x20sent');_0x59daea(_0x559632['result'][_0x5ad8('0x27')]);}})[_0x5ad8('0x28')](function(_0x5670fb){logger[_0x5ad8('0x26')](_0x5ad8('0x22'),_0x48bab4,_0x5670fb);_0x1883c9(_0x5670fb);});});}function respondWithStatusCode(_0x21a4c9,_0x2eb0ee){_0x2eb0ee=_0x2eb0ee||0xcc;return function(_0xad370b){if(_0xad370b){return _0x21a4c9[_0x5ad8('0x29')](_0x2eb0ee);}return _0x21a4c9[_0x5ad8('0x2a')](_0x2eb0ee)[_0x5ad8('0x2b')]();};}function respondWithResult(_0x1548e3,_0x572554){_0x572554=_0x572554||0xc8;return function(_0x4d2bd3){if(_0x4d2bd3){return _0x1548e3[_0x5ad8('0x2a')](_0x572554)[_0x5ad8('0x2c')](_0x4d2bd3);}};}function respondWithFilteredResult(_0xea1a51,_0x39ca29){return function(_0x1765e7){if(_0x1765e7){var _0x3ee54e=typeof _0x39ca29['offset']==='undefined'&&typeof _0x39ca29[_0x5ad8('0x2d')]===_0x5ad8('0x2e');var _0x5075b1=_0x1765e7[_0x5ad8('0x2f')];var _0x199374=_0x3ee54e?0x0:_0x39ca29[_0x5ad8('0x30')];var _0x19a603=_0x3ee54e?_0x1765e7[_0x5ad8('0x2f')]:_0x39ca29['offset']+_0x39ca29[_0x5ad8('0x2d')];var _0x2fc03c;if(_0x19a603>=_0x5075b1){_0x19a603=_0x5075b1;_0x2fc03c=0xc8;}else{_0x2fc03c=0xce;}_0xea1a51[_0x5ad8('0x2a')](_0x2fc03c);return _0xea1a51['set'](_0x5ad8('0x31'),_0x199374+'-'+_0x19a603+'/'+_0x5075b1)[_0x5ad8('0x2c')](_0x1765e7);}return null;};}function patchUpdates(_0x48192b){return function(_0x44aacd){try{jsonpatch[_0x5ad8('0x32')](_0x44aacd,_0x48192b,!![]);}catch(_0x5818e9){return BPromise[_0x5ad8('0x33')](_0x5818e9);}return _0x44aacd[_0x5ad8('0x34')]();};}function saveUpdates(_0x2ee16c,_0x3967ed){return function(_0x25aa6c){if(_0x25aa6c){return _0x25aa6c['update'](_0x2ee16c)[_0x5ad8('0x20')](function(_0x215882){return _0x215882;});}return null;};}function removeEntity(_0x124aef,_0x5ee0e3){return function(_0x58225d){if(_0x58225d){return _0x58225d[_0x5ad8('0x35')]()[_0x5ad8('0x20')](function(){_0x124aef['status'](0xcc)[_0x5ad8('0x2b')]();});}};}function handleEntityNotFound(_0x103400,_0x852936){return function(_0x5ec139){if(!_0x5ec139){_0x103400[_0x5ad8('0x29')](0x194);}return _0x5ec139;};}function handleError(_0x4372ae,_0x6bbc77){_0x6bbc77=_0x6bbc77||0x1f4;return function(_0x391fb3){logger['error'](_0x391fb3['stack']);if(_0x391fb3['name']){delete _0x391fb3[_0x5ad8('0x36')];}_0x4372ae[_0x5ad8('0x2a')](_0x6bbc77)[_0x5ad8('0x37')](_0x391fb3);};}exports[_0x5ad8('0x38')]=function(_0x25d97d,_0x27b64a){var _0x28ba9d={},_0x31e0cc={},_0x188089={'count':0x0,'rows':[]};var _0x4d3f5c=_['map'](db[_0x5ad8('0x39')][_0x5ad8('0x3a')],function(_0x54dd6a){return{'name':_0x54dd6a['fieldName'],'type':_0x54dd6a[_0x5ad8('0x3b')][_0x5ad8('0x3c')]};});_0x31e0cc[_0x5ad8('0x3d')]=_[_0x5ad8('0x3e')](_0x4d3f5c,_0x5ad8('0x36'));_0x31e0cc[_0x5ad8('0x3f')]=_['keys'](_0x25d97d[_0x5ad8('0x3f')]);_0x31e0cc['filters']=_[_0x5ad8('0x40')](_0x31e0cc[_0x5ad8('0x3d')],_0x31e0cc[_0x5ad8('0x3f')]);_0x28ba9d[_0x5ad8('0x41')]=_['intersection'](_0x31e0cc[_0x5ad8('0x3d')],qs[_0x5ad8('0x42')](_0x25d97d['query']['fields']));_0x28ba9d[_0x5ad8('0x41')]=_0x28ba9d[_0x5ad8('0x41')][_0x5ad8('0x43')]?_0x28ba9d[_0x5ad8('0x41')]:_0x31e0cc[_0x5ad8('0x3d')];if(!_0x25d97d[_0x5ad8('0x3f')]['hasOwnProperty']('nolimit')){_0x28ba9d[_0x5ad8('0x2d')]=qs[_0x5ad8('0x2d')](_0x25d97d[_0x5ad8('0x3f')][_0x5ad8('0x2d')]);_0x28ba9d[_0x5ad8('0x30')]=qs[_0x5ad8('0x30')](_0x25d97d[_0x5ad8('0x3f')]['offset']);}_0x28ba9d[_0x5ad8('0x44')]=qs['sort'](_0x25d97d[_0x5ad8('0x3f')][_0x5ad8('0x45')]);_0x28ba9d[_0x5ad8('0x46')]=qs[_0x5ad8('0x47')](_['pick'](_0x25d97d[_0x5ad8('0x3f')],_0x31e0cc[_0x5ad8('0x47')]),_0x4d3f5c);if(_0x25d97d[_0x5ad8('0x3f')]['filter']){_0x28ba9d[_0x5ad8('0x46')]=_['merge'](_0x28ba9d[_0x5ad8('0x46')],{'$or':_[_0x5ad8('0x3e')](_0x4d3f5c,function(_0x55035a){if(_0x55035a[_0x5ad8('0x3b')]!==_0x5ad8('0x48')){var _0x14b621={};_0x14b621[_0x55035a[_0x5ad8('0x36')]]={'$like':'%'+_0x25d97d[_0x5ad8('0x3f')][_0x5ad8('0x49')]+'%'};return _0x14b621;}})});}_0x28ba9d=_['merge']({},_0x28ba9d,_0x25d97d['options']);var _0x4f1305={'where':_0x28ba9d[_0x5ad8('0x46')]};return db['SmsMessage']['count'](_0x4f1305)[_0x5ad8('0x20')](function(_0x5c03b4){_0x188089[_0x5ad8('0x2f')]=_0x5c03b4;if(_0x25d97d['query']['includeAll']){_0x28ba9d[_0x5ad8('0x4a')]=[{'all':!![]}];}return db[_0x5ad8('0x39')][_0x5ad8('0x4b')](_0x28ba9d);})['then'](function(_0x305238){_0x188089[_0x5ad8('0x4c')]=_0x305238;return _0x188089;})[_0x5ad8('0x20')](respondWithFilteredResult(_0x27b64a,_0x28ba9d))[_0x5ad8('0x28')](handleError(_0x27b64a,null));};exports[_0x5ad8('0x4d')]=function(_0x32b904,_0x577f04){var _0x106c2c={'raw':!![],'where':{'id':_0x32b904[_0x5ad8('0x4e')]['id']}},_0xc03996={};_0xc03996['model']=_[_0x5ad8('0x4f')](db[_0x5ad8('0x39')]['rawAttributes']);_0xc03996[_0x5ad8('0x3f')]=_[_0x5ad8('0x4f')](_0x32b904['query']);_0xc03996[_0x5ad8('0x47')]=_[_0x5ad8('0x40')](_0xc03996['model'],_0xc03996[_0x5ad8('0x3f')]);_0x106c2c[_0x5ad8('0x41')]=_[_0x5ad8('0x40')](_0xc03996[_0x5ad8('0x3d')],qs[_0x5ad8('0x42')](_0x32b904[_0x5ad8('0x3f')]['fields']));_0x106c2c['attributes']=_0x106c2c[_0x5ad8('0x41')][_0x5ad8('0x43')]?_0x106c2c[_0x5ad8('0x41')]:_0xc03996['model'];if(_0x32b904['query'][_0x5ad8('0x50')]){_0x106c2c[_0x5ad8('0x4a')]=[{'all':!![]}];}_0x106c2c=_['merge']({},_0x106c2c,_0x32b904[_0x5ad8('0x51')]);return db[_0x5ad8('0x39')]['find'](_0x106c2c)[_0x5ad8('0x20')](handleEntityNotFound(_0x577f04,null))['then'](respondWithResult(_0x577f04,null))[_0x5ad8('0x28')](handleError(_0x577f04,null));};exports[_0x5ad8('0x52')]=function(_0xbd951,_0x27b5df){return db[_0x5ad8('0x39')][_0x5ad8('0x52')](_0xbd951['body'],{})[_0x5ad8('0x20')](respondWithResult(_0x27b5df,0xc9))[_0x5ad8('0x28')](handleError(_0x27b5df,null));};exports[_0x5ad8('0x53')]=function(_0xdb6949,_0x27d451){if(_0xdb6949['body']['id']){delete _0xdb6949[_0x5ad8('0x54')]['id'];}return db['SmsMessage'][_0x5ad8('0x55')]({'where':{'id':_0xdb6949['params']['id']}})['then'](handleEntityNotFound(_0x27d451,null))[_0x5ad8('0x20')](saveUpdates(_0xdb6949[_0x5ad8('0x54')],null))[_0x5ad8('0x20')](respondWithResult(_0x27d451,null))[_0x5ad8('0x28')](handleError(_0x27d451,null));};exports['destroy']=function(_0x5ba064,_0x4b2c3f){return db[_0x5ad8('0x39')][_0x5ad8('0x55')]({'where':{'id':_0x5ba064[_0x5ad8('0x4e')]['id']}})[_0x5ad8('0x20')](handleEntityNotFound(_0x4b2c3f,null))[_0x5ad8('0x20')](removeEntity(_0x4b2c3f,null))[_0x5ad8('0x28')](handleError(_0x4b2c3f,null));};exports[_0x5ad8('0x56')]=function(_0x151242,_0x31412e){return db[_0x5ad8('0x39')][_0x5ad8('0x56')]()['then'](respondWithResult(_0x31412e,null))[_0x5ad8('0x28')](handleError(_0x31412e,null));};var interaction_log=require('../../config/logger')(_0x5ad8('0x57'));exports[_0x5ad8('0x58')]=function(_0x2c23f5,_0x27d265,_0x166e8a){var _0x5841ce={'agent':{},'channel':_0x5ad8('0x59')};if(_0x2c23f5[_0x5ad8('0x54')]['id']){delete _0x2c23f5['body']['id'];}_0x2c23f5['body'][_0x5ad8('0x5a')]=!![];_0x2c23f5[_0x5ad8('0x54')]['readAt']=moment()[_0x5ad8('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c23f5['body'][_0x5ad8('0x5c')]=_0x2c23f5['body'][_0x5ad8('0x5c')]||_0x2c23f5[_0x5ad8('0x5d')]['id'];_0x5841ce['agent']['id']=_0x2c23f5[_0x5ad8('0x54')][_0x5ad8('0x5c')];return db[_0x5ad8('0x39')][_0x5ad8('0x55')]({'where':{'id':_0x2c23f5['params']['id'],'UserId':null}})[_0x5ad8('0x20')](handleEntityNotFound(_0x27d265,null))['then'](saveUpdates(_0x2c23f5[_0x5ad8('0x54')],null))[_0x5ad8('0x20')](function(_0x23dc25){if(_0x23dc25){_0x5841ce[_0x5ad8('0x27')]=_0x23dc25[_0x5ad8('0x5e')]({'plain':!![]});return db[_0x5ad8('0x5f')][_0x5ad8('0x55')]({'where':{'id':_0x23dc25[_0x5ad8('0x60')]}});}return null;})[_0x5ad8('0x20')](handleEntityNotFound(_0x27d265,null))[_0x5ad8('0x20')](function(_0x532f57){if(_0x532f57){return _0x532f57['update']({'UserId':_0x2c23f5[_0x5ad8('0x54')][_0x5ad8('0x5c')],'read1stAt':_['isNil'](_0x532f57[_0x5ad8('0x61')])?moment()[_0x5ad8('0x5b')](_0x5ad8('0x62')):undefined});}return null;})[_0x5ad8('0x20')](function(_0x5ef81c){if(_0x5ef81c){_0x5841ce[_0x5ad8('0x63')]=_0x5ef81c[_0x5ad8('0x5e')]({'plain':!![]});interaction_log['info'](_0x5ad8('0x64'),_0x2c23f5[_0x5ad8('0x5d')]['id'],_0x2c23f5['user'][_0x5ad8('0x36')],_0x2c23f5[_0x5ad8('0x5d')]['role'],_0x5841ce[_0x5ad8('0x63')]['id'],_0x2c23f5['body']?JSON['stringify'](_0x2c23f5[_0x5ad8('0x54')]):_0x5ad8('0x65'));return respondWithRpcPromise(_0x5ad8('0x66'),'acceptMessage',_0x5841ce);}return null;})[_0x5ad8('0x20')](function(_0x385ed8){var _0x52797a=_0x5ad8('0x67')+_0x385ed8[_0x5ad8('0x27')][_0x5ad8('0x68')];return db['sequelize']['query'](_0x52797a,{'type':db[_0x5ad8('0x69')][_0x5ad8('0x6a')]['SELECT'],'raw':!![]})[_0x5ad8('0x20')](function(_0x4291d6){return _0x4291d6;});})['then'](function(_0x2c166d){if(_0x2c166d){_0x5841ce['message'][_0x5ad8('0x6b')]=_0x2c166d[0x0];if(!_0x2c23f5[_0x5ad8('0x54')][_0x5ad8('0x5c')])return;return db['User'][_0x5ad8('0x55')]({'where':{'id':_0x2c23f5['body'][_0x5ad8('0x5c')],'role':'agent'},'attributes':['id',_0x5ad8('0x36'),_0x5ad8('0x6c'),_0x5ad8('0x6d'),_0x5ad8('0x6e')],'raw':!![]});}return null;})[_0x5ad8('0x20')](function(_0x316c21){if(!_0x316c21)return null;_0x5841ce['message'][_0x5ad8('0x6f')]=_0x316c21;return _0x5841ce;})[_0x5ad8('0x20')](function(_0x2cd66f){if(_0x2cd66f){if(_0x2c23f5[_0x5ad8('0x54')][_0x5ad8('0x70')]){_0x5841ce[_0x5ad8('0x27')]['interface']=util[_0x5ad8('0x5b')](_0x5ad8('0x71'),_0x2c23f5[_0x5ad8('0x5d')][_0x5ad8('0x36')]);_0x5841ce[_0x5ad8('0x27')][_0x5ad8('0x72')]=_0x5841ce[_0x5ad8('0x72')];_0x5841ce[_0x5ad8('0x27')]['event']=_0x5ad8('0x58');return respondWithRpcPromise(_0x5ad8('0x73'),_0x5ad8('0x73'),{'event':'acceptmessage','message':_0x5841ce['message']},client9002)[_0x5ad8('0x20')](function(){return _0x5841ce;});}return _0x5841ce;}return null;})['then'](respondWithResult(_0x27d265,null))[_0x5ad8('0x28')](handleError(_0x27d265,null));};var interaction_log=require(_0x5ad8('0x13'))(_0x5ad8('0x57'));exports[_0x5ad8('0x33')]=function(_0x457e67,_0x1ef031,_0x1bcc89){var _0x34c006={'agent':{},'channel':_0x5ad8('0x59')};if(_0x457e67[_0x5ad8('0x54')]['id']){delete _0x457e67[_0x5ad8('0x54')]['id'];}_0x457e67[_0x5ad8('0x54')]['UserId']=_0x457e67[_0x5ad8('0x54')][_0x5ad8('0x5c')]||_0x457e67['user']['id'];_0x34c006[_0x5ad8('0x6f')]['id']=_0x457e67['body']['UserId'];return db[_0x5ad8('0x39')][_0x5ad8('0x55')]({'where':{'id':_0x457e67[_0x5ad8('0x4e')]['id'],'UserId':null}})[_0x5ad8('0x20')](handleEntityNotFound(_0x1ef031,null))[_0x5ad8('0x20')](function(_0x38b464){if(_0x38b464){_0x34c006[_0x5ad8('0x27')]=_0x38b464[_0x5ad8('0x5e')]({'plain':!![]});return db[_0x5ad8('0x5f')][_0x5ad8('0x55')]({'where':{'id':_0x38b464[_0x5ad8('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x1ef031,null))[_0x5ad8('0x20')](function(_0x4ed1ae){if(_0x4ed1ae){_0x34c006['interaction']=_0x4ed1ae[_0x5ad8('0x5e')]({'plain':!![]});interaction_log['info'](_0x5ad8('0x74'),_0x457e67[_0x5ad8('0x5d')]['id'],_0x457e67[_0x5ad8('0x5d')][_0x5ad8('0x36')],_0x457e67[_0x5ad8('0x5d')][_0x5ad8('0x75')],_0x34c006[_0x5ad8('0x63')]['id'],_0x457e67[_0x5ad8('0x54')]?JSON[_0x5ad8('0x76')](_0x457e67[_0x5ad8('0x54')]):_0x5ad8('0x65'));return respondWithRpcPromise('RejectMessage',_0x5ad8('0x77'),_0x34c006);}return null;})[_0x5ad8('0x20')](function(_0x1f43be){var _0x2283b1=_0x5ad8('0x67')+_0x1f43be[_0x5ad8('0x27')]['ContactId'];return db['sequelize'][_0x5ad8('0x3f')](_0x2283b1,{'type':db[_0x5ad8('0x69')][_0x5ad8('0x6a')][_0x5ad8('0x78')],'raw':!![]})[_0x5ad8('0x20')](function(_0x62c2fd){return _0x62c2fd;});})[_0x5ad8('0x20')](function(_0x553ba4){if(_0x553ba4){_0x34c006[_0x5ad8('0x27')][_0x5ad8('0x6b')]=_0x553ba4[0x0];if(!_0x457e67['body'][_0x5ad8('0x5c')])return;return db[_0x5ad8('0x79')][_0x5ad8('0x55')]({'where':{'id':_0x457e67[_0x5ad8('0x54')][_0x5ad8('0x5c')],'role':_0x5ad8('0x6f')},'attributes':['id',_0x5ad8('0x36'),_0x5ad8('0x6c'),'email',_0x5ad8('0x6e')],'raw':!![]});}return null;})[_0x5ad8('0x20')](function(_0xb23317){if(!_0xb23317)return null;_0x34c006[_0x5ad8('0x27')][_0x5ad8('0x6f')]=_0xb23317;return _0x34c006;})['then'](function(_0x4b47e6){if(_0x4b47e6){_0x4b47e6[_0x5ad8('0x27')][_0x5ad8('0x7a')]=util['format'](_0x5ad8('0x71'),_0x457e67[_0x5ad8('0x5d')][_0x5ad8('0x36')]);_0x4b47e6[_0x5ad8('0x27')]['channel']=_0x34c006[_0x5ad8('0x72')];_0x4b47e6[_0x5ad8('0x27')][_0x5ad8('0x7b')]=_0x5ad8('0x33');respondWithRpcPromise('EventManager','EventManager',{'event':_0x5ad8('0x7c'),'message':_0x4b47e6[_0x5ad8('0x27')]},client9002);return _0x34c006;}return null;})[_0x5ad8('0x20')](respondWithResult(_0x1ef031,null))[_0x5ad8('0x28')](handleError(_0x1ef031,null));};exports['status']=function(_0x2efa10,_0x33d075,_0x33b035){if(_0x2efa10[_0x5ad8('0x54')]['id']){delete _0x2efa10['body']['id'];}var _0x3136cc;return db[_0x5ad8('0x39')][_0x5ad8('0x55')]({'where':{'id':_0x2efa10[_0x5ad8('0x4e')]['id']}})[_0x5ad8('0x20')](handleEntityNotFound(_0x33d075,null))[_0x5ad8('0x20')](function(_0x42a993){if(_0x42a993){_0x3136cc=_0x42a993;return db[_0x5ad8('0x7d')][_0x5ad8('0x55')]({'where':{'id':_0x42a993['SmsAccountId']}});}})[_0x5ad8('0x20')](handleEntityNotFound(_0x33d075,null))['then'](function(_0x3dd916){if(_0x3dd916){logger[_0x5ad8('0x23')](_0x5ad8('0x24'),_0x5ad8('0x2a'),'received\x20delivery\x20report\x20from',_0x3dd916['type'],util['inspect'](_0x2efa10[_0x5ad8('0x54')],{'showHidden':![],'depth':null}));switch(_0x3dd916['type']){case _0x5ad8('0x7e'):if(_0x2efa10['body'][_0x5ad8('0x7f')]&&_0x2efa10[_0x5ad8('0x54')]['MessageSid']===_0x3136cc[_0x5ad8('0x80')]){return _0x3136cc[_0x5ad8('0x53')]({'read':!![]});}else{logger[_0x5ad8('0x26')](_0x5ad8('0x81'),_0x5ad8('0x2a'),_0x5ad8('0x7e'),util[_0x5ad8('0x82')](_0x2efa10['body'],{'showHidden':![],'depth':null}));}break;case _0x5ad8('0x83'):if(_0x2efa10[_0x5ad8('0x54')][_0x5ad8('0x84')]&&_0x2efa10[_0x5ad8('0x54')][_0x5ad8('0x84')]===_0x3136cc['messageId']&&_[_0x5ad8('0x85')](['sent',_0x5ad8('0x86')],_0x2efa10[_0x5ad8('0x54')][_0x5ad8('0x87')])>=0x0){return _0x3136cc[_0x5ad8('0x53')]({'read':!![]});}else{logger[_0x5ad8('0x26')](_0x5ad8('0x81'),_0x5ad8('0x2a'),_0x5ad8('0x88'),util[_0x5ad8('0x82')](_0x2efa10[_0x5ad8('0x54')],{'showHidden':![],'depth':null}));}break;case _0x5ad8('0x89'):var _0x2d5a34=_0x2efa10[_0x5ad8('0x54')][_0x5ad8('0x8a')][0x0];if(_0x2d5a34['status'][_0x5ad8('0x8b')]===_0x5ad8('0x8c')){return _0x3136cc[_0x5ad8('0x53')]({'read':!![]});}else{logger['error'](_0x5ad8('0x81'),'status','infobip',util[_0x5ad8('0x82')](_0x2efa10['body'],{'showHidden':![],'depth':null}));}break;}return _0x3136cc;}})[_0x5ad8('0x20')](respondWithResult(_0x33d075,null))['catch'](handleError(_0x33d075,null));}; \ No newline at end of file +var _0xba88=['status','offset','undefined','limit','count','apply','reject','destroy','end','name','send','index','map','SmsMessage','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','update','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','interface','SIP/%s','channel','EventManager','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','email','event','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','sent','delivered','plivio','infobip','groupName','DELIVERED','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','jayson/promise','http','client','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus'];(function(_0x49c68e,_0x1c1673){var _0x33032b=function(_0x42ac31){while(--_0x42ac31){_0x49c68e['push'](_0x49c68e['shift']());}};_0x33032b(++_0x1c1673);}(_0xba88,0x64));var _0x8ba8=function(_0x45f138,_0x4ee0e5){_0x45f138=_0x45f138-0x0;var _0xa58ffa=_0xba88[_0x45f138];return _0xa58ffa;};'use strict';var emlformat=require(_0x8ba8('0x0'));var rimraf=require(_0x8ba8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8ba8('0x2'));var moment=require(_0x8ba8('0x3'));var BPromise=require(_0x8ba8('0x4'));var Mustache=require(_0x8ba8('0x5'));var util=require('util');var path=require(_0x8ba8('0x6'));var sox=require('sox');var csv=require(_0x8ba8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ba8('0x8'));var squel=require(_0x8ba8('0x9'));var crypto=require(_0x8ba8('0xa'));var jsforce=require(_0x8ba8('0xb'));var deskjs=require(_0x8ba8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8ba8('0xd'));var Papa=require(_0x8ba8('0xe'));var Redis=require(_0x8ba8('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ba8('0x10'));var logger=require(_0x8ba8('0x11'))(_0x8ba8('0x12'));var utils=require(_0x8ba8('0x13'));var config=require(_0x8ba8('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8ba8('0x15'))['db'];config['redis']=_[_0x8ba8('0x16')](config['redis'],{'host':_0x8ba8('0x17'),'port':0x18eb});var socket=require(_0x8ba8('0x18'))(new Redis(config[_0x8ba8('0x19')]));require('./smsMessage.socket')[_0x8ba8('0x1a')](socket);var jayson=require(_0x8ba8('0x1b'));var client=jayson['client'][_0x8ba8('0x1c')]({'port':0x232c});var client9002=jayson[_0x8ba8('0x1d')][_0x8ba8('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x43d36c,_0x1c8689,_0x2f7b17,_0x1cd6c0){return new BPromise(function(_0x5b021f,_0x123f9d){var _0x23876e=_0x1cd6c0||client;return _0x23876e['request'](_0x43d36c,_0x2f7b17)[_0x8ba8('0x1e')](function(_0x5d256d){logger[_0x8ba8('0x1f')](_0x8ba8('0x20'),_0x1c8689,'request\x20sent');logger[_0x8ba8('0x21')](_0x8ba8('0x22'),_0x1c8689,_0x8ba8('0x23'),JSON[_0x8ba8('0x24')](_0x5d256d));if(_0x5d256d[_0x8ba8('0x25')]){if(_0x5d256d[_0x8ba8('0x25')]['code']===0x1f4){logger[_0x8ba8('0x25')](_0x8ba8('0x20'),_0x1c8689,_0x5d256d[_0x8ba8('0x25')][_0x8ba8('0x26')]);return _0x123f9d(_0x5d256d[_0x8ba8('0x25')][_0x8ba8('0x26')]);}logger[_0x8ba8('0x25')](_0x8ba8('0x20'),_0x1c8689,_0x5d256d['error']['message']);return _0x5b021f(_0x5d256d[_0x8ba8('0x25')][_0x8ba8('0x26')]);}else{logger['info'](_0x8ba8('0x20'),_0x1c8689,'request\x20sent');_0x5b021f(_0x5d256d['result']['message']);}})['catch'](function(_0x149af4){logger[_0x8ba8('0x25')](_0x8ba8('0x20'),_0x1c8689,_0x149af4);_0x123f9d(_0x149af4);});});}function respondWithStatusCode(_0x297ed2,_0x29cf86){_0x29cf86=_0x29cf86||0xcc;return function(_0x272cd7){if(_0x272cd7){return _0x297ed2[_0x8ba8('0x27')](_0x29cf86);}return _0x297ed2[_0x8ba8('0x28')](_0x29cf86)['end']();};}function respondWithResult(_0x1c0da8,_0x26709d){_0x26709d=_0x26709d||0xc8;return function(_0x45de65){if(_0x45de65){return _0x1c0da8['status'](_0x26709d)['json'](_0x45de65);}};}function respondWithFilteredResult(_0x380be0,_0x2adc0b){return function(_0x225030){if(_0x225030){var _0x3c449d=typeof _0x2adc0b[_0x8ba8('0x29')]===_0x8ba8('0x2a')&&typeof _0x2adc0b[_0x8ba8('0x2b')]===_0x8ba8('0x2a');var _0x12b002=_0x225030[_0x8ba8('0x2c')];var _0x293860=_0x3c449d?0x0:_0x2adc0b['offset'];var _0x16e11a=_0x3c449d?_0x225030[_0x8ba8('0x2c')]:_0x2adc0b[_0x8ba8('0x29')]+_0x2adc0b[_0x8ba8('0x2b')];var _0x2d208e;if(_0x16e11a>=_0x12b002){_0x16e11a=_0x12b002;_0x2d208e=0xc8;}else{_0x2d208e=0xce;}_0x380be0['status'](_0x2d208e);return _0x380be0['set']('Content-Range',_0x293860+'-'+_0x16e11a+'/'+_0x12b002)['json'](_0x225030);}return null;};}function patchUpdates(_0x329cd6){return function(_0x39c85b){try{jsonpatch[_0x8ba8('0x2d')](_0x39c85b,_0x329cd6,!![]);}catch(_0x56b963){return BPromise[_0x8ba8('0x2e')](_0x56b963);}return _0x39c85b['save']();};}function saveUpdates(_0x553eec,_0x35ee5c){return function(_0x2d9652){if(_0x2d9652){return _0x2d9652['update'](_0x553eec)[_0x8ba8('0x1e')](function(_0x4b388c){return _0x4b388c;});}return null;};}function removeEntity(_0x34b190,_0x56757c){return function(_0x491ea6){if(_0x491ea6){return _0x491ea6[_0x8ba8('0x2f')]()['then'](function(){_0x34b190['status'](0xcc)[_0x8ba8('0x30')]();});}};}function handleEntityNotFound(_0x58d25d,_0x10c878){return function(_0x5bc8f6){if(!_0x5bc8f6){_0x58d25d[_0x8ba8('0x27')](0x194);}return _0x5bc8f6;};}function handleError(_0x15437b,_0x242cc2){_0x242cc2=_0x242cc2||0x1f4;return function(_0x22772f){logger[_0x8ba8('0x25')](_0x22772f['stack']);if(_0x22772f[_0x8ba8('0x31')]){delete _0x22772f[_0x8ba8('0x31')];}_0x15437b[_0x8ba8('0x28')](_0x242cc2)[_0x8ba8('0x32')](_0x22772f);};}exports[_0x8ba8('0x33')]=function(_0x46c825,_0x1dad21){var _0x207f85={},_0x27f36e={},_0x5f087a={'count':0x0,'rows':[]};var _0x66e09c=_[_0x8ba8('0x34')](db[_0x8ba8('0x35')]['rawAttributes'],function(_0xe0c54a){return{'name':_0xe0c54a[_0x8ba8('0x36')],'type':_0xe0c54a['type'][_0x8ba8('0x37')]};});_0x27f36e['model']=_[_0x8ba8('0x34')](_0x66e09c,_0x8ba8('0x31'));_0x27f36e[_0x8ba8('0x38')]=_[_0x8ba8('0x39')](_0x46c825[_0x8ba8('0x38')]);_0x27f36e[_0x8ba8('0x3a')]=_[_0x8ba8('0x3b')](_0x27f36e[_0x8ba8('0x3c')],_0x27f36e[_0x8ba8('0x38')]);_0x207f85[_0x8ba8('0x3d')]=_['intersection'](_0x27f36e[_0x8ba8('0x3c')],qs[_0x8ba8('0x3e')](_0x46c825[_0x8ba8('0x38')]['fields']));_0x207f85[_0x8ba8('0x3d')]=_0x207f85[_0x8ba8('0x3d')][_0x8ba8('0x3f')]?_0x207f85['attributes']:_0x27f36e[_0x8ba8('0x3c')];if(!_0x46c825['query'][_0x8ba8('0x40')](_0x8ba8('0x41'))){_0x207f85['limit']=qs[_0x8ba8('0x2b')](_0x46c825[_0x8ba8('0x38')][_0x8ba8('0x2b')]);_0x207f85[_0x8ba8('0x29')]=qs[_0x8ba8('0x29')](_0x46c825[_0x8ba8('0x38')][_0x8ba8('0x29')]);}_0x207f85[_0x8ba8('0x42')]=qs['sort'](_0x46c825[_0x8ba8('0x38')][_0x8ba8('0x43')]);_0x207f85[_0x8ba8('0x44')]=qs[_0x8ba8('0x3a')](_[_0x8ba8('0x45')](_0x46c825['query'],_0x27f36e[_0x8ba8('0x3a')]),_0x66e09c);if(_0x46c825['query'][_0x8ba8('0x46')]){_0x207f85['where']=_[_0x8ba8('0x47')](_0x207f85[_0x8ba8('0x44')],{'$or':_[_0x8ba8('0x34')](_0x66e09c,function(_0xeffe65){if(_0xeffe65[_0x8ba8('0x48')]!==_0x8ba8('0x49')){var _0x6de0a9={};_0x6de0a9[_0xeffe65[_0x8ba8('0x31')]]={'$like':'%'+_0x46c825[_0x8ba8('0x38')][_0x8ba8('0x46')]+'%'};return _0x6de0a9;}})});}_0x207f85=_[_0x8ba8('0x47')]({},_0x207f85,_0x46c825['options']);var _0x270fed={'where':_0x207f85[_0x8ba8('0x44')]};return db['SmsMessage'][_0x8ba8('0x2c')](_0x270fed)[_0x8ba8('0x1e')](function(_0x2db463){_0x5f087a['count']=_0x2db463;if(_0x46c825[_0x8ba8('0x38')][_0x8ba8('0x4a')]){_0x207f85[_0x8ba8('0x4b')]=[{'all':!![]}];}return db[_0x8ba8('0x35')]['findAll'](_0x207f85);})[_0x8ba8('0x1e')](function(_0x38558a){_0x5f087a[_0x8ba8('0x4c')]=_0x38558a;return _0x5f087a;})[_0x8ba8('0x1e')](respondWithFilteredResult(_0x1dad21,_0x207f85))[_0x8ba8('0x4d')](handleError(_0x1dad21,null));};exports[_0x8ba8('0x4e')]=function(_0x50157a,_0x46ded5){var _0x19c12d={'raw':!![],'where':{'id':_0x50157a[_0x8ba8('0x4f')]['id']}},_0x5d9a56={};_0x5d9a56[_0x8ba8('0x3c')]=_[_0x8ba8('0x39')](db[_0x8ba8('0x35')][_0x8ba8('0x50')]);_0x5d9a56[_0x8ba8('0x38')]=_[_0x8ba8('0x39')](_0x50157a[_0x8ba8('0x38')]);_0x5d9a56['filters']=_['intersection'](_0x5d9a56['model'],_0x5d9a56[_0x8ba8('0x38')]);_0x19c12d[_0x8ba8('0x3d')]=_[_0x8ba8('0x3b')](_0x5d9a56[_0x8ba8('0x3c')],qs[_0x8ba8('0x3e')](_0x50157a[_0x8ba8('0x38')][_0x8ba8('0x3e')]));_0x19c12d[_0x8ba8('0x3d')]=_0x19c12d[_0x8ba8('0x3d')][_0x8ba8('0x3f')]?_0x19c12d[_0x8ba8('0x3d')]:_0x5d9a56[_0x8ba8('0x3c')];if(_0x50157a[_0x8ba8('0x38')]['includeAll']){_0x19c12d[_0x8ba8('0x4b')]=[{'all':!![]}];}_0x19c12d=_[_0x8ba8('0x47')]({},_0x19c12d,_0x50157a[_0x8ba8('0x51')]);return db['SmsMessage'][_0x8ba8('0x52')](_0x19c12d)['then'](handleEntityNotFound(_0x46ded5,null))['then'](respondWithResult(_0x46ded5,null))['catch'](handleError(_0x46ded5,null));};exports[_0x8ba8('0x53')]=function(_0x8d6497,_0x3caf20){return db[_0x8ba8('0x35')]['create'](_0x8d6497[_0x8ba8('0x54')],{})[_0x8ba8('0x1e')](respondWithResult(_0x3caf20,0xc9))[_0x8ba8('0x4d')](handleError(_0x3caf20,null));};exports[_0x8ba8('0x55')]=function(_0x42b850,_0x5b900c){if(_0x42b850[_0x8ba8('0x54')]['id']){delete _0x42b850['body']['id'];}return db['SmsMessage'][_0x8ba8('0x52')]({'where':{'id':_0x42b850['params']['id']}})[_0x8ba8('0x1e')](handleEntityNotFound(_0x5b900c,null))['then'](saveUpdates(_0x42b850[_0x8ba8('0x54')],null))[_0x8ba8('0x1e')](respondWithResult(_0x5b900c,null))[_0x8ba8('0x4d')](handleError(_0x5b900c,null));};exports[_0x8ba8('0x2f')]=function(_0x147339,_0x1975cf){return db[_0x8ba8('0x35')]['find']({'where':{'id':_0x147339[_0x8ba8('0x4f')]['id']}})[_0x8ba8('0x1e')](handleEntityNotFound(_0x1975cf,null))[_0x8ba8('0x1e')](removeEntity(_0x1975cf,null))[_0x8ba8('0x4d')](handleError(_0x1975cf,null));};exports[_0x8ba8('0x56')]=function(_0x5b4a52,_0x3a1160){return db['SmsMessage'][_0x8ba8('0x56')]()[_0x8ba8('0x1e')](respondWithResult(_0x3a1160,null))['catch'](handleError(_0x3a1160,null));};var interaction_log=require(_0x8ba8('0x11'))(_0x8ba8('0x57'));exports[_0x8ba8('0x58')]=function(_0x36dde3,_0x301bdf,_0x2da62d){var _0x586e1f={'agent':{},'channel':_0x8ba8('0x59')};if(_0x36dde3[_0x8ba8('0x54')]['id']){delete _0x36dde3[_0x8ba8('0x54')]['id'];}_0x36dde3[_0x8ba8('0x54')][_0x8ba8('0x5a')]=!![];_0x36dde3[_0x8ba8('0x54')][_0x8ba8('0x5b')]=moment()[_0x8ba8('0x5c')](_0x8ba8('0x5d'));_0x36dde3[_0x8ba8('0x54')][_0x8ba8('0x5e')]=_0x36dde3['body'][_0x8ba8('0x5e')]||_0x36dde3['user']['id'];_0x586e1f[_0x8ba8('0x5f')]['id']=_0x36dde3[_0x8ba8('0x54')][_0x8ba8('0x5e')];return db[_0x8ba8('0x35')]['find']({'where':{'id':_0x36dde3['params']['id'],'UserId':null}})[_0x8ba8('0x1e')](handleEntityNotFound(_0x301bdf,null))['then'](saveUpdates(_0x36dde3[_0x8ba8('0x54')],null))[_0x8ba8('0x1e')](function(_0x2931da){if(_0x2931da){_0x586e1f['message']=_0x2931da[_0x8ba8('0x60')]({'plain':!![]});return db[_0x8ba8('0x61')][_0x8ba8('0x52')]({'where':{'id':_0x2931da['SmsInteractionId']}});}return null;})[_0x8ba8('0x1e')](handleEntityNotFound(_0x301bdf,null))[_0x8ba8('0x1e')](function(_0x46b8f2){if(_0x46b8f2){return _0x46b8f2[_0x8ba8('0x55')]({'UserId':_0x36dde3[_0x8ba8('0x54')][_0x8ba8('0x5e')],'read1stAt':_['isNil'](_0x46b8f2[_0x8ba8('0x62')])?moment()[_0x8ba8('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x8ba8('0x1e')](function(_0x4a3e4d){if(_0x4a3e4d){_0x586e1f[_0x8ba8('0x63')]=_0x4a3e4d['get']({'plain':!![]});interaction_log[_0x8ba8('0x1f')](_0x8ba8('0x64'),_0x36dde3[_0x8ba8('0x65')]['id'],_0x36dde3[_0x8ba8('0x65')][_0x8ba8('0x31')],_0x36dde3['user'][_0x8ba8('0x66')],_0x586e1f[_0x8ba8('0x63')]['id'],_0x36dde3[_0x8ba8('0x54')]?JSON[_0x8ba8('0x24')](_0x36dde3[_0x8ba8('0x54')]):'null');return respondWithRpcPromise(_0x8ba8('0x67'),'acceptMessage',_0x586e1f);}return null;})[_0x8ba8('0x1e')](function(_0x2e7a63){var _0x3708=_0x8ba8('0x68')+_0x2e7a63[_0x8ba8('0x26')][_0x8ba8('0x69')];return db['sequelize'][_0x8ba8('0x38')](_0x3708,{'type':db[_0x8ba8('0x6a')][_0x8ba8('0x6b')][_0x8ba8('0x6c')],'raw':!![]})[_0x8ba8('0x1e')](function(_0x329e21){return _0x329e21;});})[_0x8ba8('0x1e')](function(_0x331b18){if(_0x331b18){_0x586e1f[_0x8ba8('0x26')][_0x8ba8('0x6d')]=_0x331b18[0x0];if(!_0x36dde3[_0x8ba8('0x54')][_0x8ba8('0x5e')])return;return db[_0x8ba8('0x6e')]['find']({'where':{'id':_0x36dde3[_0x8ba8('0x54')]['UserId'],'role':'agent'},'attributes':['id',_0x8ba8('0x31'),_0x8ba8('0x6f'),'email',_0x8ba8('0x70')],'raw':!![]});}return null;})[_0x8ba8('0x1e')](function(_0x1da7c){if(!_0x1da7c)return null;_0x586e1f[_0x8ba8('0x26')]['agent']=_0x1da7c;return _0x586e1f;})[_0x8ba8('0x1e')](function(_0x459e89){if(_0x459e89){if(_0x36dde3[_0x8ba8('0x54')]['manual']){_0x586e1f[_0x8ba8('0x26')][_0x8ba8('0x71')]=util[_0x8ba8('0x5c')](_0x8ba8('0x72'),_0x36dde3[_0x8ba8('0x65')][_0x8ba8('0x31')]);_0x586e1f['message'][_0x8ba8('0x73')]=_0x586e1f['channel'];_0x586e1f[_0x8ba8('0x26')]['event']='accept';return respondWithRpcPromise('EventManager',_0x8ba8('0x74'),{'event':'acceptmessage','message':_0x586e1f[_0x8ba8('0x26')]},client9002)[_0x8ba8('0x1e')](function(){return _0x586e1f;});}return _0x586e1f;}return null;})[_0x8ba8('0x1e')](respondWithResult(_0x301bdf,null))[_0x8ba8('0x4d')](handleError(_0x301bdf,null));};var interaction_log=require(_0x8ba8('0x11'))(_0x8ba8('0x57'));exports[_0x8ba8('0x2e')]=function(_0x255348,_0x1ce687,_0x3221fc){var _0x285d94={'agent':{},'channel':_0x8ba8('0x59')};if(_0x255348[_0x8ba8('0x54')]['id']){delete _0x255348['body']['id'];}_0x255348[_0x8ba8('0x54')]['UserId']=_0x255348[_0x8ba8('0x54')][_0x8ba8('0x5e')]||_0x255348[_0x8ba8('0x65')]['id'];_0x285d94[_0x8ba8('0x5f')]['id']=_0x255348[_0x8ba8('0x54')][_0x8ba8('0x5e')];return db[_0x8ba8('0x35')]['find']({'where':{'id':_0x255348[_0x8ba8('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1ce687,null))['then'](function(_0x1471c1){if(_0x1471c1){_0x285d94[_0x8ba8('0x26')]=_0x1471c1[_0x8ba8('0x60')]({'plain':!![]});return db[_0x8ba8('0x61')][_0x8ba8('0x52')]({'where':{'id':_0x1471c1[_0x8ba8('0x75')]}});}return null;})['then'](handleEntityNotFound(_0x1ce687,null))[_0x8ba8('0x1e')](function(_0x582d97){if(_0x582d97){_0x285d94[_0x8ba8('0x63')]=_0x582d97[_0x8ba8('0x60')]({'plain':!![]});interaction_log[_0x8ba8('0x1f')](_0x8ba8('0x76'),_0x255348[_0x8ba8('0x65')]['id'],_0x255348[_0x8ba8('0x65')][_0x8ba8('0x31')],_0x255348['user'][_0x8ba8('0x66')],_0x285d94['interaction']['id'],_0x255348[_0x8ba8('0x54')]?JSON[_0x8ba8('0x24')](_0x255348[_0x8ba8('0x54')]):_0x8ba8('0x77'));return respondWithRpcPromise(_0x8ba8('0x78'),_0x8ba8('0x79'),_0x285d94);}return null;})[_0x8ba8('0x1e')](function(_0x3ae4b2){var _0x4ef409='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3ae4b2['message']['ContactId'];return db['sequelize']['query'](_0x4ef409,{'type':db['Sequelize'][_0x8ba8('0x6b')]['SELECT'],'raw':!![]})[_0x8ba8('0x1e')](function(_0x55f5cf){return _0x55f5cf;});})['then'](function(_0x280edc){if(_0x280edc){_0x285d94[_0x8ba8('0x26')][_0x8ba8('0x6d')]=_0x280edc[0x0];if(!_0x255348[_0x8ba8('0x54')][_0x8ba8('0x5e')])return;return db[_0x8ba8('0x6e')][_0x8ba8('0x52')]({'where':{'id':_0x255348[_0x8ba8('0x54')][_0x8ba8('0x5e')],'role':_0x8ba8('0x5f')},'attributes':['id',_0x8ba8('0x31'),_0x8ba8('0x6f'),_0x8ba8('0x7a'),_0x8ba8('0x70')],'raw':!![]});}return null;})[_0x8ba8('0x1e')](function(_0x1428e6){if(!_0x1428e6)return null;_0x285d94[_0x8ba8('0x26')][_0x8ba8('0x5f')]=_0x1428e6;return _0x285d94;})[_0x8ba8('0x1e')](function(_0x59bfd2){if(_0x59bfd2){_0x59bfd2[_0x8ba8('0x26')][_0x8ba8('0x71')]=util[_0x8ba8('0x5c')](_0x8ba8('0x72'),_0x255348[_0x8ba8('0x65')][_0x8ba8('0x31')]);_0x59bfd2['message'][_0x8ba8('0x73')]=_0x285d94[_0x8ba8('0x73')];_0x59bfd2[_0x8ba8('0x26')][_0x8ba8('0x7b')]=_0x8ba8('0x2e');respondWithRpcPromise(_0x8ba8('0x74'),_0x8ba8('0x74'),{'event':_0x8ba8('0x7c'),'message':_0x59bfd2[_0x8ba8('0x26')]},client9002);return _0x285d94;}return null;})[_0x8ba8('0x1e')](respondWithResult(_0x1ce687,null))[_0x8ba8('0x4d')](handleError(_0x1ce687,null));};exports[_0x8ba8('0x28')]=function(_0x1462a0,_0x10236f,_0x5505f){if(_0x1462a0[_0x8ba8('0x54')]['id']){delete _0x1462a0[_0x8ba8('0x54')]['id'];}var _0x5f31ec;return db['SmsMessage'][_0x8ba8('0x52')]({'where':{'id':_0x1462a0[_0x8ba8('0x4f')]['id']}})[_0x8ba8('0x1e')](handleEntityNotFound(_0x10236f,null))[_0x8ba8('0x1e')](function(_0x2cffeb){if(_0x2cffeb){_0x5f31ec=_0x2cffeb;return db['SmsAccount'][_0x8ba8('0x52')]({'where':{'id':_0x2cffeb[_0x8ba8('0x7d')]}});}})[_0x8ba8('0x1e')](handleEntityNotFound(_0x10236f,null))[_0x8ba8('0x1e')](function(_0x7b1798){if(_0x7b1798){logger[_0x8ba8('0x21')](_0x8ba8('0x22'),_0x8ba8('0x28'),_0x8ba8('0x7e'),_0x7b1798[_0x8ba8('0x48')],util[_0x8ba8('0x7f')](_0x1462a0[_0x8ba8('0x54')],{'showHidden':![],'depth':null}));switch(_0x7b1798[_0x8ba8('0x48')]){case _0x8ba8('0x80'):if(_0x1462a0[_0x8ba8('0x54')]['MessageSid']&&_0x1462a0[_0x8ba8('0x54')][_0x8ba8('0x81')]===_0x5f31ec['messageId']){return _0x5f31ec['update']({'read':!![]});}else{logger['error'](_0x8ba8('0x82'),'status','twilio',util[_0x8ba8('0x7f')](_0x1462a0[_0x8ba8('0x54')],{'showHidden':![],'depth':null}));}break;case _0x8ba8('0x83'):if(_0x1462a0[_0x8ba8('0x54')][_0x8ba8('0x84')]&&_0x1462a0['body'][_0x8ba8('0x84')]===_0x5f31ec[_0x8ba8('0x85')]&&_['indexOf']([_0x8ba8('0x86'),_0x8ba8('0x87')],_0x1462a0['body']['Status'])>=0x0){return _0x5f31ec[_0x8ba8('0x55')]({'read':!![]});}else{logger[_0x8ba8('0x25')](_0x8ba8('0x82'),_0x8ba8('0x28'),_0x8ba8('0x88'),util[_0x8ba8('0x7f')](_0x1462a0[_0x8ba8('0x54')],{'showHidden':![],'depth':null}));}break;case _0x8ba8('0x89'):var _0x57933a=_0x1462a0[_0x8ba8('0x54')]['results'][0x0];if(_0x57933a[_0x8ba8('0x28')][_0x8ba8('0x8a')]===_0x8ba8('0x8b')){return _0x5f31ec['update']({'read':!![]});}else{logger[_0x8ba8('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8ba8('0x28'),'infobip',util[_0x8ba8('0x7f')](_0x1462a0['body'],{'showHidden':![],'depth':null}));}break;}return _0x5f31ec;}})['then'](respondWithResult(_0x10236f,null))['catch'](handleError(_0x10236f,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 5d15893..f2ddba2 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 _0x5294=['SmsMessage','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x5a125c,_0x155fa2){var _0x4c70af=function(_0x5dccb6){while(--_0x5dccb6){_0x5a125c['push'](_0x5a125c['shift']());}};_0x4c70af(++_0x155fa2);}(_0x5294,0x1d5));var _0x4529=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5294[_0x2f5ac5];return _0x37c9a8;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db'][_0x4529('0x0')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x4529('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4529('0x2'),'afterDestroy':_0x4529('0x3')};function emitEvent(_0x4a20f2){return function(_0x55355a,_0x4e99ca,_0x4cdf5a){SmsMessageEvents[_0x4529('0x4')](_0x4a20f2+':'+_0x55355a['id'],_0x55355a);SmsMessageEvents['emit'](_0x4a20f2,_0x55355a);_0x4cdf5a(null);};}for(var e in events){if(events[_0x4529('0x5')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x4529('0x6')]=SmsMessageEvents; \ No newline at end of file +var _0x61cc=['setMaxListeners','save','update','emit','hook','events','../../mysqldb'];(function(_0x329437,_0x1de73a){var _0x3789d9=function(_0x37832e){while(--_0x37832e){_0x329437['push'](_0x329437['shift']());}};_0x3789d9(++_0x1de73a);}(_0x61cc,0xbb));var _0xc61c=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x61cc[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0xc61c('0x0'));var SmsMessage=require(_0xc61c('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xc61c('0x2')](0x0);var events={'afterCreate':_0xc61c('0x3'),'afterUpdate':_0xc61c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x443d9a){return function(_0x39c066,_0x27dd78,_0x35eaa5){SmsMessageEvents[_0xc61c('0x5')](_0x443d9a+':'+_0x39c066['id'],_0x39c066);SmsMessageEvents[_0xc61c('0x5')](_0x443d9a,_0x39c066);_0x35eaa5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xc61c('0x6')](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 b27928d..0ff73ad 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 _0x3e5c=['apiKey','timestamp','keys','sort','length','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','smsMethod','deliveryReport','read','afterCreate','connectel','senderString','requestid','Missing\x20parameters:\x20authToken','clicksend','password','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','message_id','clickSend','plivo','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20username,\x20password','csc','crypto'];(function(_0x1b9b06,_0x245a8d){var _0x254126=function(_0x1ef918){while(--_0x1ef918){_0x1b9b06['push'](_0x1b9b06['shift']());}};_0x254126(++_0x245a8d);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x55823c,_0x9731a1){_0x55823c=_0x55823c-0x0;var _0x4eb7f5=_0x3e5c[_0x55823c];return _0x4eb7f5;};'use strict';var _=require(_0xc3e5('0x0'));var util=require(_0xc3e5('0x1'));var logger=require(_0xc3e5('0x2'))(_0xc3e5('0x3'));var moment=require('moment');var BPromise=require(_0xc3e5('0x4'));var rp=require(_0xc3e5('0x5'));var fs=require('fs');var path=require(_0xc3e5('0x6'));var rimraf=require(_0xc3e5('0x7'));var config=require(_0xc3e5('0x8'));var attributes=require(_0xc3e5('0x9'));module['exports']=function(_0xf61ec2,_0xdf5a06){return _0xf61ec2[_0xc3e5('0xa')](_0xc3e5('0xb'),attributes,{'tableName':_0xc3e5('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xc3e5('0xd')]},{'name':_0xc3e5('0xe'),'fields':[_0xc3e5('0xf')],'type':_0xc3e5('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x448454,_0x644286,_0xd1ef16){var _0x55bece=_0xf61ec2[_0xc3e5('0x11')];var _0x2768d5=_0x448454[_0xc3e5('0x12')]({'plain':!![]});if(_0x2768d5[_0xc3e5('0x13')]['toLowerCase']()==='in'||_0x2768d5[_0xc3e5('0x13')][_0xc3e5('0x14')]()===_0xc3e5('0x15')&&!_0x2768d5[_0xc3e5('0x16')]&&!_[_0xc3e5('0x17')](_0x2768d5[_0xc3e5('0x18')])){_0x55bece['SmsInteraction']['findOne']({'where':{'id':_0x2768d5['SmsInteractionId']}})[_0xc3e5('0x19')](function(_0x5a52f1){if(_0x5a52f1){_0x5a52f1[_0xc3e5('0x1a')]({'lastMsgAt':_0x2768d5[_0xc3e5('0x1b')],'lastMsgDirection':_0x2768d5['direction'][_0xc3e5('0x14')]()});}})[_0xc3e5('0x1c')](function(_0x2cc476){console[_0xc3e5('0x1d')](_0x2cc476);});}if(_0x2768d5[_0xc3e5('0x13')]==='out'&&!_0x2768d5[_0xc3e5('0x16')]){var _0x277063;_0x55bece[_0xc3e5('0x1e')][_0xc3e5('0x1f')]({'where':{'id':_0x2768d5[_0xc3e5('0x20')]},'raw':!![]})[_0xc3e5('0x19')](function(_0x538f71){_0x277063=_0x538f71;if(_0x277063&&_0x277063[_0xc3e5('0x21')]){switch(_0x277063[_0xc3e5('0x21')]){case'twilio':var _0x1d0c5a=require('twilio');if(_0x277063[_0xc3e5('0x22')]&&_0x277063[_0xc3e5('0x23')]&&_0x277063[_0xc3e5('0x24')]){var _0xebf6dc=new _0x1d0c5a(_0x277063[_0xc3e5('0x22')],_0x277063['authToken']);_0xebf6dc[_0xc3e5('0x25')][_0xc3e5('0x26')]({'body':_0x2768d5[_0xc3e5('0xf')],'to':_0x2768d5[_0xc3e5('0x24')],'from':_0x277063[_0xc3e5('0x24')],'statusCallback':_0x277063[_0xc3e5('0x27')]+_0xc3e5('0x28')+_0x2768d5['id']+'/status?token='+_0x277063[_0xc3e5('0x29')]})[_0xc3e5('0x19')](function(_0x43d01e){if(_0x43d01e[_0xc3e5('0x2a')]){return _0x448454[_0xc3e5('0x1a')]({'messageId':_0x43d01e[_0xc3e5('0x2a')]});}})[_0xc3e5('0x1c')](function(_0x45556e){logger['error'](_0xc3e5('0x2b'),'afterCreate','twilio',util[_0xc3e5('0x2c')](_0x45556e,{'showHidden':![],'depth':null}));});}else{logger[_0xc3e5('0x1d')](_0xc3e5('0x2b'),'afterCreate',_0xc3e5('0x2d'),_0xc3e5('0x2e'));}break;case _0xc3e5('0x2f'):var _0x3ad580='https://api.skebby.it/API/v1.0/REST/';if(_0x277063[_0xc3e5('0x30')]&&_0x277063['password']){var _0x45ca6d={'recipient':[_0x2768d5[_0xc3e5('0x24')]],'message':_0x2768d5[_0xc3e5('0xf')],'message_type':_0x277063['smsMethod']};if(_0x277063['smsMethod']&&_0x277063['smsMethod']!=='SI'){_0x45ca6d[_0xc3e5('0x31')]=_0x277063[_0xc3e5('0x24')];}var _0x18c15b={'url':_0x3ad580+_0xc3e5('0x32')+_0x277063[_0xc3e5('0x30')]+_0xc3e5('0x33')+_0x277063['password'],'method':_0xc3e5('0x34')};rp(_0x18c15b)[_0xc3e5('0x19')](function(_0x440617){var _0x9e1a69=_0x440617[_0xc3e5('0x35')](';');var _0x8a057b={'user_key':_0x9e1a69[0x0],'session_key':_0x9e1a69[0x1]};_0x18c15b={'url':_0x3ad580+_0xc3e5('0x36'),'method':_0xc3e5('0x37'),'headers':{'user_key':_0x8a057b[_0xc3e5('0x38')],'Session_key':_0x8a057b[_0xc3e5('0x39')]},'json':!![],'body':_0x45ca6d};return rp(_0x18c15b);})[_0xc3e5('0x19')](function(_0x5d4297){if(_0x5d4297[_0xc3e5('0x3a')]>=0x1){var _0x4a8bd4={'messageId':_0x5d4297[_0xc3e5('0x3b')]};if(_0x277063[_0xc3e5('0x3c')]!=='GP'||!_0x277063[_0xc3e5('0x3d')]){_0x4a8bd4[_0xc3e5('0x3e')]=!![];}return _0x448454['update'](_0x4a8bd4);}else{return logger[_0xc3e5('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc3e5('0x2f'),util['inspect'](_0x5d4297,{'showHidden':![],'depth':null}));}})[_0xc3e5('0x1c')](function(_0x3952dd){return logger[_0xc3e5('0x1d')](_0xc3e5('0x2b'),_0xc3e5('0x3f'),'skebby',util[_0xc3e5('0x2c')](_0x3952dd,{'showHidden':![],'depth':null}));});}else{logger[_0xc3e5('0x1d')](_0xc3e5('0x2b'),_0xc3e5('0x3f'),_0xc3e5('0x2f'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xc3e5('0x40'):if(_0x277063['authToken']){var _0xb62987={'recipient':_0x2768d5[_0xc3e5('0x24')],'message':_0x2768d5['body'],'sender':_0x277063[_0xc3e5('0x41')]||_0x277063['phone'],'authorization':_0x277063[_0xc3e5('0x23')]};var _0x644286={'method':_0xc3e5('0x37'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0xb62987,'json':!![]};rp(_0x644286)[_0xc3e5('0x19')](function(_0x3c496f){var _0xc410aa={'messageId':_0x3c496f[_0xc3e5('0x42')]};if(!_0x277063[_0xc3e5('0x3d')]){_0xc410aa['read']=!![];}return _0x448454['update'](_0xc410aa);})['catch'](function(_0x7a81fd){logger[_0xc3e5('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3e5('0x3f'),'connectel',util[_0xc3e5('0x2c')](_0x7a81fd,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc3e5('0x2b'),'afterCreate',_0xc3e5('0x40'),_0xc3e5('0x43'));}break;case _0xc3e5('0x44'):if(_0x277063[_0xc3e5('0x30')]&&_0x277063[_0xc3e5('0x45')]){var _0xb62987={'messages':[{'source':'xCALLY\x20Motion','to':_0x2768d5['phone'],'body':_0x2768d5[_0xc3e5('0xf')],'from':_0x277063['senderString']||_0x277063[_0xc3e5('0x24')]}]};var _0x2abe5c=util[_0xc3e5('0x46')](_0xc3e5('0x47'),_0x277063[_0xc3e5('0x30')],_0x277063[_0xc3e5('0x45')]);var _0x644286={'method':_0xc3e5('0x37'),'uri':_0xc3e5('0x48'),'body':_0xb62987,'headers':{'Authorization':util[_0xc3e5('0x46')](_0xc3e5('0x49'),new Buffer(_0x2abe5c)[_0xc3e5('0x4a')](_0xc3e5('0x4b')))},'json':!![]};rp(_0x644286)[_0xc3e5('0x19')](function(_0x62f66){if(_0x62f66[_0xc3e5('0x4c')]>=0xc8&&_0x62f66[_0xc3e5('0x4c')]<=0xce){if(_0x62f66['data']&&_0x62f66['data']['queued_count']>0x0){var _0x3c7119=_['head'](_0x62f66[_0xc3e5('0x4d')][_0xc3e5('0x25')]);var _0x31587d={'messageId':_0x3c7119[_0xc3e5('0x4e')]};if(!_0x277063['deliveryReport']){_0x31587d[_0xc3e5('0x3e')]=!![];}return _0x448454[_0xc3e5('0x1a')](_0x31587d);}else{logger[_0xc3e5('0x1d')](_0xc3e5('0x2b'),'afterCreate','clickSend',util[_0xc3e5('0x2c')](_0x62f66,{'showHidden':![],'depth':null}));}}else{logger[_0xc3e5('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3e5('0x3f'),'clickSend',util[_0xc3e5('0x2c')](_0x62f66,{'showHidden':![],'depth':null}));}})['catch'](function(_0x17e12f){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc3e5('0x4f'),util[_0xc3e5('0x2c')](_0x17e12f,{'showHidden':![],'depth':null}));});}else{logger[_0xc3e5('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc3e5('0x4f'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xc3e5('0x50'):if(_0x277063[_0xc3e5('0x51')]&&_0x277063[_0xc3e5('0x23')]){var _0xb62987={'dst':_0x2768d5[_0xc3e5('0x24')],'text':_0x2768d5[_0xc3e5('0xf')],'src':_0x277063['senderString']||_0x277063[_0xc3e5('0x24')],'url':_0x277063['remote']+'/api/sms/messages/'+_0x2768d5['id']+_0xc3e5('0x52')+_0x277063['token']};var _0x2abe5c=util['format']('%s:%s',_0x277063[_0xc3e5('0x51')],_0x277063[_0xc3e5('0x23')]);var _0x644286={'method':'POST','uri':util[_0xc3e5('0x46')](_0xc3e5('0x53'),_0x277063['authId']),'body':_0xb62987,'headers':{'Authorization':util[_0xc3e5('0x46')](_0xc3e5('0x49'),new Buffer(_0x2abe5c)[_0xc3e5('0x4a')](_0xc3e5('0x4b')))},'json':!![]};rp(_0x644286)[_0xc3e5('0x19')](function(_0x3d56e0){var _0x10a04c={'messageId':_0x3d56e0['message_uuid'][0x0]};return _0x448454[_0xc3e5('0x1a')](_0x10a04c);})[_0xc3e5('0x1c')](function(_0x586d75){logger['error'](_0xc3e5('0x2b'),_0xc3e5('0x3f'),'plivo',util['inspect'](_0x586d75,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3e5('0x3f'),_0xc3e5('0x50'),_0xc3e5('0x54'));}break;case _0xc3e5('0x55'):if(_0x277063[_0xc3e5('0x30')]&&_0x277063['password']){if(_0x277063[_0xc3e5('0x56')]){var _0x209fc6={'method':_0xc3e5('0x37'),'uri':_0x277063['baseUrl']+_0xc3e5('0x57'),'body':{'username':_0x277063[_0xc3e5('0x30')],'password':_0x277063[_0xc3e5('0x45')]},'json':!![]};return rp(_0x209fc6)[_0xc3e5('0x19')](function(_0x39108f){var _0x576bef={'method':'POST','uri':_0x277063[_0xc3e5('0x56')]+_0xc3e5('0x58'),'body':{'messages':[{'from':_0x277063['phone'],'destinations':[{'to':_0x2768d5[_0xc3e5('0x24')]}],'text':_0x2768d5[_0xc3e5('0xf')],'notifyUrl':_0x277063['remote']+_0xc3e5('0x28')+_0x2768d5['id']+_0xc3e5('0x52')+_0x277063[_0xc3e5('0x29')],'notifyContentType':_0xc3e5('0x59'),'callbackData':_0x277063[_0xc3e5('0x24')]+';'+_0x2768d5[_0xc3e5('0xf')]}]},'headers':{'Authorization':_0xc3e5('0x5a')+_0x39108f[_0xc3e5('0x29')]},'json':!![]};return rp(_0x576bef)['then'](function(_0x35d2b2){if(_0x35d2b2[_0xc3e5('0x25')]){var _0x3db9ac={'messageId':_0x35d2b2['messages'][0x0]['messageId']};if(!_0x277063[_0xc3e5('0x3d')]){_0x3db9ac[_0xc3e5('0x3e')]=!![];}return _0x448454[_0xc3e5('0x1a')](_0x3db9ac);}else{return logger[_0xc3e5('0x1d')](_0xc3e5('0x2b'),_0xc3e5('0x3f'),'infobip',util[_0xc3e5('0x2c')](_0x35d2b2,{'showHidden':![],'depth':null}));}});})['catch'](function(_0xdc503b){return logger[_0xc3e5('0x1d')](_0xc3e5('0x2b'),_0xc3e5('0x3f'),_0xc3e5('0x55'),util[_0xc3e5('0x2c')](_0xdc503b,{'showHidden':![],'depth':null}));});}else{logger[_0xc3e5('0x1d')](_0xc3e5('0x2b'),_0xc3e5('0x3f'),_0xc3e5('0x55'),'Missing\x20parameters:\x20base_url');}}else{logger['error'](_0xc3e5('0x2b'),_0xc3e5('0x3f'),_0xc3e5('0x55'),_0xc3e5('0x5b'));}break;case _0xc3e5('0x5c'):var _0x4ea3c1=require(_0xc3e5('0x5d'));if(_0x277063[_0xc3e5('0x5e')]){var _0x7b49a={};_0x7b49a['login']=_0x277063['username'];_0x7b49a[_0xc3e5('0x24')]=_0x2768d5[_0xc3e5('0x24')];_0x7b49a[_0xc3e5('0x31')]=_0x277063[_0xc3e5('0x24')];_0x7b49a['text']=_0x2768d5[_0xc3e5('0xf')];_0x7b49a[_0xc3e5('0x5f')]=+new Date();var _0x5ae5bf='';var _0x1cf94c='';var _0x447bdc=Object[_0xc3e5('0x60')](_0x7b49a);_0x447bdc[_0xc3e5('0x61')]();for(var _0x4e3e8a=0x0;_0x4e3e8a<_0x447bdc[_0xc3e5('0x62')];_0x4e3e8a++){if(_0x5ae5bf!=''){_0x5ae5bf+='&';}_0x5ae5bf+=_0x447bdc[_0x4e3e8a]+'='+encodeURIComponent(_0x7b49a[_0x447bdc[_0x4e3e8a]]);_0x1cf94c+=_0x7b49a[_0x447bdc[_0x4e3e8a]];}_0x1cf94c+=_0x277063[_0xc3e5('0x5e')];_0x1cf94c=_0x4ea3c1['createHash'](_0xc3e5('0x63'))[_0xc3e5('0x1a')](_0x1cf94c)[_0xc3e5('0x64')](_0xc3e5('0x65'));if(_0x5ae5bf!==''){_0x5ae5bf+='&';}_0x5ae5bf+=_0xc3e5('0x66')+_0x1cf94c;var _0x18c15b={'method':_0xc3e5('0x34'),'uri':_0x277063[_0xc3e5('0x56')]+_0xc3e5('0x67')+_0x5ae5bf,'json':!![]};return rp(_0x18c15b)[_0xc3e5('0x19')](function(_0x55f2ef){var _0x209126=Object[_0xc3e5('0x60')](_0x55f2ef);if(_0x55f2ef[_0x209126[0x0]][_0xc3e5('0x1d')]&&parseInt(_0x55f2ef[_0x209126[0x0]][_0xc3e5('0x1d')])===0x0){var _0x264eb4={'messageId':_0x55f2ef[_0x209126[0x0]][_0xc3e5('0x68')]};if(!_0x277063[_0xc3e5('0x3d')]){_0x264eb4['read']=!![];}return _0x448454[_0xc3e5('0x1a')](_0x264eb4);}else{return logger[_0xc3e5('0x1d')](_0xc3e5('0x2b'),_0xc3e5('0x3f'),_0xc3e5('0x5c'),util[_0xc3e5('0x2c')](_0x55f2ef[_0xc3e5('0x1d')],{'showHidden':![],'depth':null}));}})[_0xc3e5('0x1c')](function(_0x5aa68c){return logger['error'](_0xc3e5('0x2b'),_0xc3e5('0x3f'),_0xc3e5('0x5c'),util[_0xc3e5('0x2c')](_0x5aa68c,{'showHidden':![],'depth':null}));});}else{logger[_0xc3e5('0x1d')](_0xc3e5('0x2b'),'afterCreate','csc',_0xc3e5('0x69'));}break;case _0xc3e5('0x6a'):if(_0x277063[_0xc3e5('0x5e')]){var _0x547b27={'method':_0xc3e5('0x37'),'uri':_0xc3e5('0x6b'),'headers':{'Authorization':_0x277063[_0xc3e5('0x5e')]},'body':{'content':_0x2768d5[_0xc3e5('0xf')],'to':[_0x2768d5['phone']],'from':_0x277063[_0xc3e5('0x24')],'binary':![],'clientMessageId':'uuid','charset':_0xc3e5('0x6c')},'json':!![]};rp(_0x547b27)[_0xc3e5('0x19')](function(_0x5e7ab3){if(!_0x5e7ab3['error']){var _0x1787d4={'messageId':_0x5e7ab3[_0xc3e5('0x25')][0x0][_0xc3e5('0x6d')]};if(!_0x277063[_0xc3e5('0x3d')]){_0x1787d4[_0xc3e5('0x3e')]=!![];}return _0x448454[_0xc3e5('0x1a')](_0x1787d4);}else{return logger['error'](_0xc3e5('0x2b'),_0xc3e5('0x3f'),'clickatell',util[_0xc3e5('0x2c')](_0x5e7ab3[_0xc3e5('0x1d')],{'showHidden':![],'depth':null}));}})[_0xc3e5('0x1c')](function(_0x343aa1){return logger['error'](_0xc3e5('0x2b'),_0xc3e5('0x3f'),'clickatell',util[_0xc3e5('0x2c')](_0x343aa1,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3e5('0x3f'),_0xc3e5('0x6a'),_0xc3e5('0x69'));}break;case _0xc3e5('0x6e'):if(_0x277063['username']&&_0x277063['password']){var _0x2abe5c=util[_0xc3e5('0x46')](_0xc3e5('0x47'),_0x277063[_0xc3e5('0x30')],_0x277063[_0xc3e5('0x45')]);var _0x644286={'method':_0xc3e5('0x37'),'uri':_0xc3e5('0x6f')+_0x277063[_0xc3e5('0x70')]+_0xc3e5('0x71'),'body':{'to':[_0x2768d5[_0xc3e5('0x24')]],'text':_0x2768d5[_0xc3e5('0xf')],'from':_0x277063[_0xc3e5('0x24')],'applicationId':_0x277063['applicationId']},'headers':{'Authorization':util[_0xc3e5('0x46')](_0xc3e5('0x49'),new Buffer(_0x2abe5c)[_0xc3e5('0x4a')](_0xc3e5('0x4b')))},'json':!![]};rp(_0x644286)[_0xc3e5('0x19')](function(_0x4542c1){if(_0x4542c1['id']){var _0x587736={'messageId':_0x4542c1['id']};return _0x448454[_0xc3e5('0x1a')](_0x587736);}else{logger['error'](_0xc3e5('0x2b'),_0xc3e5('0x3f'),_0xc3e5('0x6e'),util[_0xc3e5('0x2c')](_0x4542c1,{'showHidden':![],'depth':null}));}})['catch'](function(_0x175bf6){logger[_0xc3e5('0x1d')](_0xc3e5('0x2b'),_0xc3e5('0x3f'),_0xc3e5('0x6e'),util[_0xc3e5('0x2c')](_0x175bf6,{'showHidden':![],'depth':null}));});}else{logger[_0xc3e5('0x1d')](_0xc3e5('0x2b'),_0xc3e5('0x3f'),_0xc3e5('0x6e'),_0xc3e5('0x5b'));}break;case _0xc3e5('0x72'):if(_0x277063['apiKey']){var _0x30af58={};var _0x18c15b={'method':_0xc3e5('0x37'),'uri':_0xc3e5('0x73'),'headers':{'Authorization':_0xc3e5('0x74')+_0x277063['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x277063[_0xc3e5('0x24')],'to':_0x2768d5['phone'],'text':_0x2768d5[_0xc3e5('0xf')]},'json':!![]};return rp(_0x18c15b)[_0xc3e5('0x19')](function(_0x2953ad){if(_0x2953ad[_0xc3e5('0x75')]==0xca){_0x30af58[_0xc3e5('0x76')]=_0x2953ad;var _0x52aaa8={'method':_0xc3e5('0x37'),'uri':_0xc3e5('0x77'),'headers':{'Authorization':'Bearer\x20'+_0x277063['apiKey'],'Content-Type':_0xc3e5('0x59')},'body':{'refid':_0x30af58[_0xc3e5('0x76')][_0xc3e5('0x78')]},'json':!![]};return rp(_0x52aaa8)[_0xc3e5('0x19')](function(_0x4386cf){_0x30af58[_0xc3e5('0x79')]=_0x4386cf;var _0x1e6360={'messageId':_0x30af58[_0xc3e5('0x76')]['refid'],'read':!![]};return _0x448454[_0xc3e5('0x1a')](_0x1e6360);});}else{return logger[_0xc3e5('0x1d')](_0xc3e5('0x2b'),_0xc3e5('0x3f'),'intelepeer',util[_0xc3e5('0x2c')](_0x2953ad,{'showHidden':![],'depth':null}));}})['catch'](function(_0x20a9c8){return logger[_0xc3e5('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3e5('0x3f'),_0xc3e5('0x72'),util['inspect'](_0x20a9c8,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xc3e5('0x2b'),_0xc3e5('0x3f'),_0xc3e5('0x72'),_0xc3e5('0x7a'));}break;}}})['finally'](function(){_0xd1ef16();});}else{_0xd1ef16();}}},'charset':_0xc3e5('0x7b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x38c3=['https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','head','message_id','clickSend','plivo','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','crypto','login','text','timestamp','keys','sort','length','apiKey','createHash','md5','digest','hex','signature=','GET','/external/get/send.php?','id_sms','csc','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','get','toLowerCase','out','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','direction','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','split','sms','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s'];(function(_0x225a29,_0x12b4c3){var _0x371e1d=function(_0x376b93){while(--_0x376b93){_0x225a29['push'](_0x225a29['shift']());}};_0x371e1d(++_0x12b4c3);}(_0x38c3,0x13d));var _0x338c=function(_0x3a2225,_0xb6600){_0x3a2225=_0x3a2225-0x0;var _0x5c8040=_0x38c3[_0x3a2225];return _0x5c8040;};'use strict';var _=require(_0x338c('0x0'));var util=require(_0x338c('0x1'));var logger=require('../../config/logger')(_0x338c('0x2'));var moment=require(_0x338c('0x3'));var BPromise=require(_0x338c('0x4'));var rp=require(_0x338c('0x5'));var fs=require('fs');var path=require(_0x338c('0x6'));var rimraf=require(_0x338c('0x7'));var config=require('../../config/environment');var attributes=require(_0x338c('0x8'));module['exports']=function(_0x41c16d,_0x28eeb3){return _0x41c16d['define'](_0x338c('0x9'),attributes,{'tableName':_0x338c('0xa'),'paranoid':![],'indexes':[{'name':_0x338c('0xb'),'fields':['messageId']},{'name':_0x338c('0xc'),'fields':[_0x338c('0xd')],'type':_0x338c('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x367047,_0x372839,_0x2861b0){var _0x12cebe=_0x41c16d['models'];var _0x50ba99=_0x367047[_0x338c('0xf')]({'plain':!![]});if(_0x50ba99['direction'][_0x338c('0x10')]()==='in'||_0x50ba99['direction'][_0x338c('0x10')]()===_0x338c('0x11')&&!_0x50ba99['secret']&&!_[_0x338c('0x12')](_0x50ba99[_0x338c('0x13')])){_0x12cebe[_0x338c('0x14')][_0x338c('0x15')]({'where':{'id':_0x50ba99[_0x338c('0x16')]}})[_0x338c('0x17')](function(_0x11928e){if(_0x11928e){_0x11928e[_0x338c('0x18')]({'lastMsgAt':_0x50ba99[_0x338c('0x19')],'lastMsgDirection':_0x50ba99[_0x338c('0x1a')]['toLowerCase']()});}})['catch'](function(_0x26a6dd){console[_0x338c('0x1b')](_0x26a6dd);});}if(_0x50ba99[_0x338c('0x1a')]===_0x338c('0x11')&&!_0x50ba99['secret']){var _0x22a70b;_0x12cebe[_0x338c('0x1c')][_0x338c('0x1d')]({'where':{'id':_0x50ba99[_0x338c('0x1e')]},'raw':!![]})[_0x338c('0x17')](function(_0x3c988a){_0x22a70b=_0x3c988a;if(_0x22a70b&&_0x22a70b[_0x338c('0x1f')]){switch(_0x22a70b[_0x338c('0x1f')]){case _0x338c('0x20'):var _0x7221f9=require(_0x338c('0x20'));if(_0x22a70b[_0x338c('0x21')]&&_0x22a70b[_0x338c('0x22')]&&_0x22a70b['phone']){var _0x4efa92=new _0x7221f9(_0x22a70b[_0x338c('0x21')],_0x22a70b[_0x338c('0x22')]);_0x4efa92[_0x338c('0x23')][_0x338c('0x24')]({'body':_0x50ba99['body'],'to':_0x50ba99[_0x338c('0x25')],'from':_0x22a70b['phone'],'statusCallback':_0x22a70b[_0x338c('0x26')]+_0x338c('0x27')+_0x50ba99['id']+'/status?token='+_0x22a70b[_0x338c('0x28')]})[_0x338c('0x17')](function(_0x5bb7bf){if(_0x5bb7bf[_0x338c('0x29')]){return _0x367047[_0x338c('0x18')]({'messageId':_0x5bb7bf[_0x338c('0x29')]});}})[_0x338c('0x2a')](function(_0x26013d){logger[_0x338c('0x1b')](_0x338c('0x2b'),_0x338c('0x2c'),_0x338c('0x20'),util['inspect'](_0x26013d,{'showHidden':![],'depth':null}));});}else{logger[_0x338c('0x1b')](_0x338c('0x2b'),_0x338c('0x2c'),'twilio',_0x338c('0x2d'));}break;case _0x338c('0x2e'):var _0x4f1d0a=_0x338c('0x2f');if(_0x22a70b[_0x338c('0x30')]&&_0x22a70b[_0x338c('0x31')]){var _0x37e72a={'recipient':[_0x50ba99[_0x338c('0x25')]],'message':_0x50ba99[_0x338c('0xd')],'message_type':_0x22a70b['smsMethod']};if(_0x22a70b['smsMethod']&&_0x22a70b[_0x338c('0x32')]!=='SI'){_0x37e72a[_0x338c('0x33')]=_0x22a70b[_0x338c('0x25')];}var _0xa581b3={'url':_0x4f1d0a+_0x338c('0x34')+_0x22a70b['username']+'&password='+_0x22a70b[_0x338c('0x31')],'method':'GET'};rp(_0xa581b3)[_0x338c('0x17')](function(_0xe32c1c){var _0x361c70=_0xe32c1c[_0x338c('0x35')](';');var _0x19d8c4={'user_key':_0x361c70[0x0],'session_key':_0x361c70[0x1]};_0xa581b3={'url':_0x4f1d0a+_0x338c('0x36'),'method':'POST','headers':{'user_key':_0x19d8c4['user_key'],'Session_key':_0x19d8c4['session_key']},'json':!![],'body':_0x37e72a};return rp(_0xa581b3);})[_0x338c('0x17')](function(_0x1c1dc5){if(_0x1c1dc5['total_sent']>=0x1){var _0x1656c6={'messageId':_0x1c1dc5[_0x338c('0x37')]};if(_0x22a70b[_0x338c('0x32')]!=='GP'||!_0x22a70b[_0x338c('0x38')]){_0x1656c6[_0x338c('0x39')]=!![];}return _0x367047[_0x338c('0x18')](_0x1656c6);}else{return logger['error'](_0x338c('0x2b'),_0x338c('0x2c'),_0x338c('0x2e'),util['inspect'](_0x1c1dc5,{'showHidden':![],'depth':null}));}})[_0x338c('0x2a')](function(_0x358d4d){return logger[_0x338c('0x1b')](_0x338c('0x2b'),_0x338c('0x2c'),_0x338c('0x2e'),util[_0x338c('0x3a')](_0x358d4d,{'showHidden':![],'depth':null}));});}else{logger[_0x338c('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x338c('0x2c'),_0x338c('0x2e'),_0x338c('0x3b'));}break;case _0x338c('0x3c'):if(_0x22a70b['authToken']){var _0x3930f0={'recipient':_0x50ba99[_0x338c('0x25')],'message':_0x50ba99[_0x338c('0xd')],'sender':_0x22a70b[_0x338c('0x3d')]||_0x22a70b['phone'],'authorization':_0x22a70b[_0x338c('0x22')]};var _0x372839={'method':_0x338c('0x3e'),'uri':_0x338c('0x3f'),'body':_0x3930f0,'json':!![]};rp(_0x372839)[_0x338c('0x17')](function(_0x38e891){var _0xba3b1b={'messageId':_0x38e891[_0x338c('0x40')]};if(!_0x22a70b[_0x338c('0x38')]){_0xba3b1b[_0x338c('0x39')]=!![];}return _0x367047[_0x338c('0x18')](_0xba3b1b);})[_0x338c('0x2a')](function(_0x1cdc14){logger[_0x338c('0x1b')](_0x338c('0x2b'),_0x338c('0x2c'),_0x338c('0x3c'),util[_0x338c('0x3a')](_0x1cdc14,{'showHidden':![],'depth':null}));});}else{logger[_0x338c('0x1b')](_0x338c('0x2b'),_0x338c('0x2c'),_0x338c('0x3c'),_0x338c('0x41'));}break;case _0x338c('0x42'):if(_0x22a70b[_0x338c('0x30')]&&_0x22a70b[_0x338c('0x31')]){var _0x3930f0={'messages':[{'source':_0x338c('0x43'),'to':_0x50ba99['phone'],'body':_0x50ba99[_0x338c('0xd')],'from':_0x22a70b[_0x338c('0x3d')]||_0x22a70b[_0x338c('0x25')]}]};var _0x2ead0d=util[_0x338c('0x44')](_0x338c('0x45'),_0x22a70b[_0x338c('0x30')],_0x22a70b[_0x338c('0x31')]);var _0x372839={'method':_0x338c('0x3e'),'uri':_0x338c('0x46'),'body':_0x3930f0,'headers':{'Authorization':util[_0x338c('0x44')](_0x338c('0x47'),new Buffer(_0x2ead0d)[_0x338c('0x48')]('base64'))},'json':!![]};rp(_0x372839)[_0x338c('0x17')](function(_0x146608){if(_0x146608[_0x338c('0x49')]>=0xc8&&_0x146608['http_code']<=0xce){if(_0x146608[_0x338c('0x4a')]&&_0x146608[_0x338c('0x4a')]['queued_count']>0x0){var _0x7a5339=_[_0x338c('0x4b')](_0x146608[_0x338c('0x4a')][_0x338c('0x23')]);var _0x53c67f={'messageId':_0x7a5339[_0x338c('0x4c')]};if(!_0x22a70b[_0x338c('0x38')]){_0x53c67f['read']=!![];}return _0x367047[_0x338c('0x18')](_0x53c67f);}else{logger[_0x338c('0x1b')](_0x338c('0x2b'),_0x338c('0x2c'),_0x338c('0x4d'),util[_0x338c('0x3a')](_0x146608,{'showHidden':![],'depth':null}));}}else{logger[_0x338c('0x1b')](_0x338c('0x2b'),'afterCreate',_0x338c('0x4d'),util[_0x338c('0x3a')](_0x146608,{'showHidden':![],'depth':null}));}})[_0x338c('0x2a')](function(_0x3e8b39){logger['error'](_0x338c('0x2b'),_0x338c('0x2c'),'clickSend',util['inspect'](_0x3e8b39,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x338c('0x2b'),_0x338c('0x2c'),_0x338c('0x4d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x338c('0x4e'):if(_0x22a70b[_0x338c('0x4f')]&&_0x22a70b['authToken']){var _0x3930f0={'dst':_0x50ba99[_0x338c('0x25')],'text':_0x50ba99[_0x338c('0xd')],'src':_0x22a70b['senderString']||_0x22a70b[_0x338c('0x25')],'url':_0x22a70b[_0x338c('0x26')]+'/api/sms/messages/'+_0x50ba99['id']+_0x338c('0x50')+_0x22a70b['token']};var _0x2ead0d=util[_0x338c('0x44')](_0x338c('0x45'),_0x22a70b[_0x338c('0x4f')],_0x22a70b[_0x338c('0x22')]);var _0x372839={'method':_0x338c('0x3e'),'uri':util[_0x338c('0x44')](_0x338c('0x51'),_0x22a70b[_0x338c('0x4f')]),'body':_0x3930f0,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x2ead0d)[_0x338c('0x48')](_0x338c('0x52')))},'json':!![]};rp(_0x372839)[_0x338c('0x17')](function(_0x31630e){var _0x40459b={'messageId':_0x31630e[_0x338c('0x53')][0x0]};return _0x367047[_0x338c('0x18')](_0x40459b);})[_0x338c('0x2a')](function(_0x24b6c1){logger[_0x338c('0x1b')](_0x338c('0x2b'),_0x338c('0x2c'),'plivo',util[_0x338c('0x3a')](_0x24b6c1,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x338c('0x2c'),_0x338c('0x4e'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x22a70b['username']&&_0x22a70b[_0x338c('0x31')]){if(_0x22a70b[_0x338c('0x54')]){var _0x1bbea2={'method':_0x338c('0x3e'),'uri':_0x22a70b[_0x338c('0x54')]+_0x338c('0x55'),'body':{'username':_0x22a70b['username'],'password':_0x22a70b['password']},'json':!![]};return rp(_0x1bbea2)[_0x338c('0x17')](function(_0x4b9d55){var _0x24c14d={'method':'POST','uri':_0x22a70b[_0x338c('0x54')]+_0x338c('0x56'),'body':{'messages':[{'from':_0x22a70b[_0x338c('0x25')],'destinations':[{'to':_0x50ba99[_0x338c('0x25')]}],'text':_0x50ba99[_0x338c('0xd')],'notifyUrl':_0x22a70b[_0x338c('0x26')]+_0x338c('0x27')+_0x50ba99['id']+_0x338c('0x50')+_0x22a70b[_0x338c('0x28')],'notifyContentType':_0x338c('0x57'),'callbackData':_0x22a70b[_0x338c('0x25')]+';'+_0x50ba99[_0x338c('0xd')]}]},'headers':{'Authorization':_0x338c('0x58')+_0x4b9d55['token']},'json':!![]};return rp(_0x24c14d)['then'](function(_0x2d127b){if(_0x2d127b[_0x338c('0x23')]){var _0x211768={'messageId':_0x2d127b[_0x338c('0x23')][0x0][_0x338c('0xb')]};if(!_0x22a70b[_0x338c('0x38')]){_0x211768[_0x338c('0x39')]=!![];}return _0x367047[_0x338c('0x18')](_0x211768);}else{return logger[_0x338c('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x338c('0x59'),util['inspect'](_0x2d127b,{'showHidden':![],'depth':null}));}});})[_0x338c('0x2a')](function(_0x31b057){return logger['error'](_0x338c('0x2b'),_0x338c('0x2c'),'infobip',util['inspect'](_0x31b057,{'showHidden':![],'depth':null}));});}else{logger[_0x338c('0x1b')](_0x338c('0x2b'),_0x338c('0x2c'),_0x338c('0x59'),'Missing\x20parameters:\x20base_url');}}else{logger['error'](_0x338c('0x2b'),_0x338c('0x2c'),_0x338c('0x59'),_0x338c('0x3b'));}break;case'csc':var _0x182df7=require(_0x338c('0x5a'));if(_0x22a70b['apiKey']){var _0x5ce6b2={};_0x5ce6b2[_0x338c('0x5b')]=_0x22a70b[_0x338c('0x30')];_0x5ce6b2[_0x338c('0x25')]=_0x50ba99[_0x338c('0x25')];_0x5ce6b2[_0x338c('0x33')]=_0x22a70b[_0x338c('0x25')];_0x5ce6b2[_0x338c('0x5c')]=_0x50ba99[_0x338c('0xd')];_0x5ce6b2[_0x338c('0x5d')]=+new Date();var _0x375d87='';var _0x220500='';var _0x41f371=Object[_0x338c('0x5e')](_0x5ce6b2);_0x41f371[_0x338c('0x5f')]();for(var _0x4d0d05=0x0;_0x4d0d05<_0x41f371[_0x338c('0x60')];_0x4d0d05++){if(_0x375d87!=''){_0x375d87+='&';}_0x375d87+=_0x41f371[_0x4d0d05]+'='+encodeURIComponent(_0x5ce6b2[_0x41f371[_0x4d0d05]]);_0x220500+=_0x5ce6b2[_0x41f371[_0x4d0d05]];}_0x220500+=_0x22a70b[_0x338c('0x61')];_0x220500=_0x182df7[_0x338c('0x62')](_0x338c('0x63'))['update'](_0x220500)[_0x338c('0x64')](_0x338c('0x65'));if(_0x375d87!==''){_0x375d87+='&';}_0x375d87+=_0x338c('0x66')+_0x220500;var _0xa581b3={'method':_0x338c('0x67'),'uri':_0x22a70b[_0x338c('0x54')]+_0x338c('0x68')+_0x375d87,'json':!![]};return rp(_0xa581b3)[_0x338c('0x17')](function(_0xd3802e){var _0x17bb47=Object[_0x338c('0x5e')](_0xd3802e);if(_0xd3802e[_0x17bb47[0x0]][_0x338c('0x1b')]&&parseInt(_0xd3802e[_0x17bb47[0x0]][_0x338c('0x1b')])===0x0){var _0x4eb69d={'messageId':_0xd3802e[_0x17bb47[0x0]][_0x338c('0x69')]};if(!_0x22a70b[_0x338c('0x38')]){_0x4eb69d[_0x338c('0x39')]=!![];}return _0x367047['update'](_0x4eb69d);}else{return logger['error'](_0x338c('0x2b'),_0x338c('0x2c'),_0x338c('0x6a'),util[_0x338c('0x3a')](_0xd3802e['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x24cf9c){return logger[_0x338c('0x1b')](_0x338c('0x2b'),_0x338c('0x2c'),'csc',util[_0x338c('0x3a')](_0x24cf9c,{'showHidden':![],'depth':null}));});}else{logger[_0x338c('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x338c('0x2c'),_0x338c('0x6a'),'Missing\x20parameters:\x20apiKey');}break;case _0x338c('0x6b'):if(_0x22a70b[_0x338c('0x61')]){var _0x3eb1b1={'method':'POST','uri':_0x338c('0x6c'),'headers':{'Authorization':_0x22a70b[_0x338c('0x61')]},'body':{'content':_0x50ba99['body'],'to':[_0x50ba99[_0x338c('0x25')]],'from':_0x22a70b[_0x338c('0x25')],'binary':![],'clientMessageId':_0x338c('0x6d'),'charset':_0x338c('0x6e')},'json':!![]};rp(_0x3eb1b1)[_0x338c('0x17')](function(_0x19c583){if(!_0x19c583[_0x338c('0x1b')]){var _0x10f59d={'messageId':_0x19c583['messages'][0x0][_0x338c('0x6f')]};if(!_0x22a70b[_0x338c('0x38')]){_0x10f59d['read']=!![];}return _0x367047['update'](_0x10f59d);}else{return logger[_0x338c('0x1b')](_0x338c('0x2b'),_0x338c('0x2c'),_0x338c('0x6b'),util['inspect'](_0x19c583[_0x338c('0x1b')],{'showHidden':![],'depth':null}));}})[_0x338c('0x2a')](function(_0xa6e600){return logger[_0x338c('0x1b')](_0x338c('0x2b'),_0x338c('0x2c'),'clickatell',util[_0x338c('0x3a')](_0xa6e600,{'showHidden':![],'depth':null}));});}else{logger[_0x338c('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x338c('0x2c'),_0x338c('0x6b'),_0x338c('0x70'));}break;case _0x338c('0x71'):if(_0x22a70b[_0x338c('0x30')]&&_0x22a70b['password']){var _0x2ead0d=util[_0x338c('0x44')]('%s:%s',_0x22a70b[_0x338c('0x30')],_0x22a70b[_0x338c('0x31')]);var _0x372839={'method':'POST','uri':_0x338c('0x72')+_0x22a70b[_0x338c('0x73')]+_0x338c('0x74'),'body':{'to':[_0x50ba99['phone']],'text':_0x50ba99[_0x338c('0xd')],'from':_0x22a70b[_0x338c('0x25')],'applicationId':_0x22a70b[_0x338c('0x75')]},'headers':{'Authorization':util[_0x338c('0x44')](_0x338c('0x47'),new Buffer(_0x2ead0d)['toString'](_0x338c('0x52')))},'json':!![]};rp(_0x372839)['then'](function(_0x4e7593){if(_0x4e7593['id']){var _0x5b82e6={'messageId':_0x4e7593['id']};return _0x367047[_0x338c('0x18')](_0x5b82e6);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x338c('0x2c'),_0x338c('0x71'),util['inspect'](_0x4e7593,{'showHidden':![],'depth':null}));}})[_0x338c('0x2a')](function(_0x4651bd){logger[_0x338c('0x1b')](_0x338c('0x2b'),_0x338c('0x2c'),_0x338c('0x71'),util[_0x338c('0x3a')](_0x4651bd,{'showHidden':![],'depth':null}));});}else{logger[_0x338c('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x338c('0x2c'),'bandwidth',_0x338c('0x3b'));}break;case _0x338c('0x76'):if(_0x22a70b['apiKey']){var _0x3d7803={};var _0xa581b3={'method':_0x338c('0x3e'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x338c('0x77')+_0x22a70b[_0x338c('0x61')],'Content-Type':'application/json'},'body':{'from':_0x22a70b['phone'],'to':_0x50ba99[_0x338c('0x25')],'text':_0x50ba99['body']},'json':!![]};return rp(_0xa581b3)[_0x338c('0x17')](function(_0x8ce800){if(_0x8ce800[_0x338c('0x78')]==0xca){_0x3d7803[_0x338c('0x79')]=_0x8ce800;var _0x2f7dad={'method':'POST','uri':_0x338c('0x7a'),'headers':{'Authorization':_0x338c('0x77')+_0x22a70b[_0x338c('0x61')],'Content-Type':'application/json'},'body':{'refid':_0x3d7803[_0x338c('0x79')][_0x338c('0x7b')]},'json':!![]};return rp(_0x2f7dad)[_0x338c('0x17')](function(_0x568553){_0x3d7803[_0x338c('0x7c')]=_0x568553;var _0x2604c5={'messageId':_0x3d7803['message'][_0x338c('0x7b')],'read':!![]};return _0x367047[_0x338c('0x18')](_0x2604c5);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x338c('0x2c'),_0x338c('0x76'),util[_0x338c('0x3a')](_0x8ce800,{'showHidden':![],'depth':null}));}})[_0x338c('0x2a')](function(_0x2cb920){return logger[_0x338c('0x1b')](_0x338c('0x2b'),_0x338c('0x2c'),_0x338c('0x76'),util[_0x338c('0x3a')](_0x2cb920,{'showHidden':![],'depth':null}));});}else{return logger[_0x338c('0x1b')](_0x338c('0x2b'),'afterCreate',_0x338c('0x76'),_0x338c('0x7d'));}break;}}})[_0x338c('0x7e')](function(){_0x2861b0();});}else{_0x2861b0();}}},'charset':_0x338c('0x7f'),'collate':_0x338c('0x80')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 8df114d..004667e 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 _0x1450=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','./smsMessage.socket','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','SmsMessage','create','body','options','raw','info','CreateSmsMessage','util','moment','bluebird'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x1450,0x93));var _0x0145=function(_0xa5bd6b,_0x216eac){_0xa5bd6b=_0xa5bd6b-0x0;var _0x301185=_0x1450[_0xa5bd6b];return _0x301185;};'use strict';var _=require('lodash');var util=require(_0x0145('0x0'));var moment=require(_0x0145('0x1'));var BPromise=require(_0x0145('0x2'));var rs=require(_0x0145('0x3'));var fs=require('fs');var Redis=require(_0x0145('0x4'));var db=require(_0x0145('0x5'))['db'];var utils=require(_0x0145('0x6'));var logger=require('../../config/logger')(_0x0145('0x7'));var config=require(_0x0145('0x8'));var jayson=require(_0x0145('0x9'));var client=jayson['client'][_0x0145('0xa')]({'port':0x232a});config[_0x0145('0xb')]=_[_0x0145('0xc')](config[_0x0145('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0145('0xb')]));require(_0x0145('0xd'))['register'](socket);function respondWithRpcPromise(_0x97b3ce,_0x1bf9db,_0x8b3af3){return new BPromise(function(_0x1d122b,_0x3df636){return client[_0x0145('0xe')](_0x97b3ce,_0x8b3af3)[_0x0145('0xf')](function(_0x26d092){logger['info'](_0x0145('0x10'),_0x1bf9db,_0x0145('0x11'));logger[_0x0145('0x12')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1bf9db,_0x0145('0x11'),JSON[_0x0145('0x13')](_0x26d092));if(_0x26d092[_0x0145('0x14')]){if(_0x26d092[_0x0145('0x14')][_0x0145('0x15')]===0x1f4){logger['error'](_0x0145('0x10'),_0x1bf9db,_0x26d092['error'][_0x0145('0x16')]);return _0x3df636(_0x26d092['error'][_0x0145('0x16')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x1bf9db,_0x26d092[_0x0145('0x14')][_0x0145('0x16')]);return _0x1d122b(_0x26d092[_0x0145('0x14')][_0x0145('0x16')]);}else{logger['info'](_0x0145('0x10'),_0x1bf9db,_0x0145('0x11'));_0x1d122b(_0x26d092['result'][_0x0145('0x16')]);}})['catch'](function(_0x24bb66){logger['error'](_0x0145('0x10'),_0x1bf9db,_0x24bb66);_0x3df636(_0x24bb66);});});}exports['CreateSmsMessage']=function(_0x43e51f){var _0x1b7946=this;return new Promise(function(_0x434b45,_0x173f40){return db[_0x0145('0x17')][_0x0145('0x18')](_0x43e51f[_0x0145('0x19')],{'raw':_0x43e51f[_0x0145('0x1a')]?_0x43e51f[_0x0145('0x1a')][_0x0145('0x1b')]===undefined?!![]:![]:!![]})[_0x0145('0xf')](function(_0x20b3fc){logger[_0x0145('0x1c')](_0x0145('0x1d'),_0x43e51f);logger[_0x0145('0x12')]('CreateSmsMessage',_0x43e51f,JSON[_0x0145('0x13')](_0x20b3fc));_0x434b45(_0x20b3fc);})['catch'](function(_0x10d7f9){logger[_0x0145('0x14')](_0x0145('0x1d'),_0x10d7f9[_0x0145('0x16')],_0x43e51f);_0x173f40(_0x1b7946[_0x0145('0x14')](0x1f4,_0x10d7f9[_0x0145('0x16')]));});});}; \ No newline at end of file +var _0x670e=['CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./smsMessage.socket','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','catch'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x670e,0x69));var _0xe670=function(_0x2f5e26,_0x1250ce){_0x2f5e26=_0x2f5e26-0x0;var _0x2b046e=_0x670e[_0x2f5e26];return _0x2b046e;};'use strict';var _=require(_0xe670('0x0'));var util=require(_0xe670('0x1'));var moment=require(_0xe670('0x2'));var BPromise=require(_0xe670('0x3'));var rs=require(_0xe670('0x4'));var fs=require('fs');var Redis=require(_0xe670('0x5'));var db=require(_0xe670('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe670('0x7'))(_0xe670('0x8'));var config=require('../../config/environment');var jayson=require(_0xe670('0x9'));var client=jayson[_0xe670('0xa')]['http']({'port':0x232a});config[_0xe670('0xb')]=_[_0xe670('0xc')](config[_0xe670('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe670('0xd'))(new Redis(config[_0xe670('0xb')]));require(_0xe670('0xe'))['register'](socket);function respondWithRpcPromise(_0x4b0bc0,_0x352afd,_0xfa9e3c){return new BPromise(function(_0x1fc076,_0x370fda){return client[_0xe670('0xf')](_0x4b0bc0,_0xfa9e3c)[_0xe670('0x10')](function(_0x17e78b){logger[_0xe670('0x11')]('SmsMessage,\x20%s,\x20%s',_0x352afd,_0xe670('0x12'));logger[_0xe670('0x13')](_0xe670('0x14'),_0x352afd,'request\x20sent',JSON[_0xe670('0x15')](_0x17e78b));if(_0x17e78b[_0xe670('0x16')]){if(_0x17e78b[_0xe670('0x16')][_0xe670('0x17')]===0x1f4){logger[_0xe670('0x16')](_0xe670('0x18'),_0x352afd,_0x17e78b[_0xe670('0x16')][_0xe670('0x19')]);return _0x370fda(_0x17e78b[_0xe670('0x16')][_0xe670('0x19')]);}logger[_0xe670('0x16')](_0xe670('0x18'),_0x352afd,_0x17e78b[_0xe670('0x16')][_0xe670('0x19')]);return _0x1fc076(_0x17e78b[_0xe670('0x16')][_0xe670('0x19')]);}else{logger[_0xe670('0x11')](_0xe670('0x18'),_0x352afd,_0xe670('0x12'));_0x1fc076(_0x17e78b['result']['message']);}})[_0xe670('0x1a')](function(_0x583fd9){logger[_0xe670('0x16')](_0xe670('0x18'),_0x352afd,_0x583fd9);_0x370fda(_0x583fd9);});});}exports[_0xe670('0x1b')]=function(_0x9cb05a){var _0x101f75=this;return new Promise(function(_0x28034c,_0x370525){return db[_0xe670('0x1c')][_0xe670('0x1d')](_0x9cb05a[_0xe670('0x1e')],{'raw':_0x9cb05a[_0xe670('0x1f')]?_0x9cb05a[_0xe670('0x1f')][_0xe670('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x375669){logger[_0xe670('0x11')](_0xe670('0x1b'),_0x9cb05a);logger['debug'](_0xe670('0x1b'),_0x9cb05a,JSON['stringify'](_0x375669));_0x28034c(_0x375669);})[_0xe670('0x1a')](function(_0x47bd7b){logger[_0xe670('0x16')](_0xe670('0x1b'),_0x47bd7b[_0xe670('0x19')],_0x9cb05a);_0x370525(_0x101f75[_0xe670('0x16')](0x1f4,_0x47bd7b[_0xe670('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index bdf8bc2..3299ae8 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 _0x5ec8=['save','remove','update','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x339702,_0x465d98){var _0x55cc03=function(_0x570dad){while(--_0x570dad){_0x339702['push'](_0x339702['shift']());}};_0x55cc03(++_0x465d98);}(_0x5ec8,0xcf));var _0x85ec=function(_0x498b38,_0x2d9583){_0x498b38=_0x498b38-0x0;var _0x10feb7=_0x5ec8[_0x498b38];return _0x10feb7;};'use strict';var SmsMessageEvents=require(_0x85ec('0x0'));var events=[_0x85ec('0x1'),_0x85ec('0x2'),_0x85ec('0x3')];function createListener(_0x76c0b9,_0x1dd642){return function(_0x379047){_0x1dd642['emit'](_0x76c0b9,_0x379047);};}function removeListener(_0x3b3e2a,_0x5b6599){return function(){SmsMessageEvents[_0x85ec('0x4')](_0x3b3e2a,_0x5b6599);};}exports[_0x85ec('0x5')]=function(_0x54abc3){for(var _0x1563ec=0x0,_0x3a037b=events[_0x85ec('0x6')];_0x1563ec<_0x3a037b;_0x1563ec++){var _0x5bc2f9=events[_0x1563ec];var _0x2d73e8=createListener(_0x85ec('0x7')+_0x5bc2f9,_0x54abc3);SmsMessageEvents['on'](_0x5bc2f9,_0x2d73e8);}}; \ No newline at end of file +var _0x03fc=['emit','length','smsMessage:','./smsMessage.events','save','remove','update'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x03fc,0x106));var _0xc03f=function(_0x226155,_0x11670e){_0x226155=_0x226155-0x0;var _0x3056c8=_0x03fc[_0x226155];return _0x3056c8;};'use strict';var SmsMessageEvents=require(_0xc03f('0x0'));var events=[_0xc03f('0x1'),_0xc03f('0x2'),_0xc03f('0x3')];function createListener(_0x3dbe5a,_0x3fb771){return function(_0x1f977f){_0x3fb771[_0xc03f('0x4')](_0x3dbe5a,_0x1f977f);};}function removeListener(_0x100356,_0x3511c0){return function(){SmsMessageEvents['removeListener'](_0x100356,_0x3511c0);};}exports['register']=function(_0x105bfc){for(var _0x1b0a6b=0x0,_0x401fdd=events[_0xc03f('0x5')];_0x1b0a6b<_0x401fdd;_0x1b0a6b++){var _0x5a6f67=events[_0x1b0a6b];var _0x47a6ee=createListener(_0xc03f('0x6')+_0x5a6f67,_0x105bfc);SmsMessageEvents['on'](_0x5a6f67,_0x47a6ee);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 5506d9a..296a97a 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 _0xa8d5=['post','/:id/teams','addTeams','addAgents','put','delete','destroy','removeTeams','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/:id','show','/:id/members','getMembers','/:id/users','getAgents','create'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0xa8d5,0x105));var _0x5a8d=function(_0x3d18cd,_0x4271d7){_0x3d18cd=_0x3d18cd-0x0;var _0x4c6f25=_0xa8d5[_0x3d18cd];return _0x4c6f25;};'use strict';var multer=require(_0x5a8d('0x0'));var util=require(_0x5a8d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5a8d('0x2'));var router=express[_0x5a8d('0x3')]();var fs_extra=require(_0x5a8d('0x4'));var auth=require(_0x5a8d('0x5'));var interaction=require(_0x5a8d('0x6'));var config=require(_0x5a8d('0x7'));var controller=require(_0x5a8d('0x8'));router[_0x5a8d('0x9')]('/',auth[_0x5a8d('0xa')](),controller[_0x5a8d('0xb')]);router[_0x5a8d('0x9')]('/describe',auth[_0x5a8d('0xa')](),controller['describe']);router[_0x5a8d('0x9')](_0x5a8d('0xc'),auth[_0x5a8d('0xa')](),controller[_0x5a8d('0xd')]);router[_0x5a8d('0x9')](_0x5a8d('0xe'),auth[_0x5a8d('0xa')](),controller[_0x5a8d('0xf')]);router[_0x5a8d('0x9')]('/:id/teams',auth[_0x5a8d('0xa')](),controller['getTeams']);router[_0x5a8d('0x9')](_0x5a8d('0x10'),auth[_0x5a8d('0xa')](),controller[_0x5a8d('0x11')]);router['post']('/',auth[_0x5a8d('0xa')](),controller[_0x5a8d('0x12')]);router[_0x5a8d('0x13')](_0x5a8d('0x14'),auth[_0x5a8d('0xa')](),controller[_0x5a8d('0x15')]);router[_0x5a8d('0x13')](_0x5a8d('0x10'),auth['isAuthenticated'](),controller[_0x5a8d('0x16')]);router[_0x5a8d('0x17')](_0x5a8d('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x5a8d('0x18')](_0x5a8d('0xc'),auth[_0x5a8d('0xa')](),controller[_0x5a8d('0x19')]);router[_0x5a8d('0x18')]('/:id/teams',auth[_0x5a8d('0xa')](),controller[_0x5a8d('0x1a')]);router[_0x5a8d('0x18')]('/:id/users',auth[_0x5a8d('0xa')](),controller['removeAgents']);module[_0x5a8d('0x1b')]=router; \ No newline at end of file +var _0x4e47=['./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','post','addTeams','addAgents','update','delete','destroy','removeTeams','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2e223b,_0x3bc763){var _0x11b78c=function(_0x405be0){while(--_0x405be0){_0x2e223b['push'](_0x2e223b['shift']());}};_0x11b78c(++_0x3bc763);}(_0x4e47,0xec));var _0x74e4=function(_0xdb7c94,_0x4b3019){_0xdb7c94=_0xdb7c94-0x0;var _0xee35e1=_0x4e47[_0xdb7c94];return _0xee35e1;};'use strict';var multer=require('multer');var util=require(_0x74e4('0x0'));var path=require(_0x74e4('0x1'));var timeout=require('connect-timeout');var express=require(_0x74e4('0x2'));var router=express[_0x74e4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x74e4('0x4'));var interaction=require(_0x74e4('0x5'));var config=require(_0x74e4('0x6'));var controller=require(_0x74e4('0x7'));router[_0x74e4('0x8')]('/',auth[_0x74e4('0x9')](),controller[_0x74e4('0xa')]);router[_0x74e4('0x8')](_0x74e4('0xb'),auth['isAuthenticated'](),controller[_0x74e4('0xc')]);router['get'](_0x74e4('0xd'),auth['isAuthenticated'](),controller[_0x74e4('0xe')]);router[_0x74e4('0x8')](_0x74e4('0xf'),auth['isAuthenticated'](),controller[_0x74e4('0x10')]);router[_0x74e4('0x8')](_0x74e4('0x11'),auth[_0x74e4('0x9')](),controller['getTeams']);router[_0x74e4('0x8')](_0x74e4('0x12'),auth[_0x74e4('0x9')](),controller['getAgents']);router[_0x74e4('0x13')]('/',auth[_0x74e4('0x9')](),controller['create']);router[_0x74e4('0x13')]('/:id/teams',auth[_0x74e4('0x9')](),controller[_0x74e4('0x14')]);router['post'](_0x74e4('0x12'),auth[_0x74e4('0x9')](),controller[_0x74e4('0x15')]);router['put']('/:id',auth[_0x74e4('0x9')](),controller[_0x74e4('0x16')]);router[_0x74e4('0x17')](_0x74e4('0xd'),auth[_0x74e4('0x9')](),controller[_0x74e4('0x18')]);router[_0x74e4('0x17')]('/:id/teams',auth[_0x74e4('0x9')](),controller[_0x74e4('0x19')]);router[_0x74e4('0x17')](_0x74e4('0x12'),auth[_0x74e4('0x9')](),controller['removeAgents']);module[_0x74e4('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 46f0668..cd00f32 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 _0x930c=['beepall','roundrobin','sequelize','STRING','name','INTEGER','rrmemory'];(function(_0x2f4748,_0x24af55){var _0x18eece=function(_0x489dd6){while(--_0x489dd6){_0x2f4748['push'](_0x2f4748['shift']());}};_0x18eece(++_0x24af55);}(_0x930c,0x113));var _0xc930=function(_0x4f0504,_0x5f14fb){_0x4f0504=_0x4f0504-0x0;var _0x1fb242=_0x930c[_0x4f0504];return _0x1fb242;};'use strict';var Sequelize=require(_0xc930('0x0'));module['exports']={'name':{'type':Sequelize[_0xc930('0x1')],'unique':_0xc930('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc930('0x1')]},'timeout':{'type':Sequelize[_0xc930('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc930('0x4'),_0xc930('0x5'),_0xc930('0x6'))}}; \ No newline at end of file +var _0x7d6d=['INTEGER','ENUM','rrmemory','beepall','name','STRING'];(function(_0x2f8d56,_0x376c64){var _0x36081d=function(_0x86d523){while(--_0x86d523){_0x2f8d56['push'](_0x2f8d56['shift']());}};_0x36081d(++_0x376c64);}(_0x7d6d,0x100));var _0xd7d6=function(_0x3de842,_0x218b19){_0x3de842=_0x3de842-0x0;var _0x3e214c=_0x7d6d[_0x3de842];return _0x3e214c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xd7d6('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd7d6('0x1')]},'timeout':{'type':Sequelize[_0xd7d6('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd7d6('0x3')](_0xd7d6('0x4'),_0xd7d6('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index e41b788..7dd3f59 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 _0x6a80=['role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','UserSmsQueue','rawAttributes','hasOwnProperty','nolimit','SmsQueueId','User','findAndCountAll','UserId','smsPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','Agents','online','voicePause','flatMap','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userSmsQueue:remove','addAgents','ids','spread','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','SmsQueues','stack','name','index','SmsQueue','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x229bd1,_0x5dd11a){var _0x188c9f=function(_0x215577){while(--_0x215577){_0x229bd1['push'](_0x229bd1['shift']());}};_0x188c9f(++_0x5dd11a);}(_0x6a80,0x1e7));var _0x06a8=function(_0x2c8f3e,_0x40cff8){_0x2c8f3e=_0x2c8f3e-0x0;var _0x44bcf2=_0x6a80[_0x2c8f3e];return _0x44bcf2;};'use strict';var emlformat=require(_0x06a8('0x0'));var rimraf=require(_0x06a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06a8('0x2'));var rp=require(_0x06a8('0x3'));var moment=require(_0x06a8('0x4'));var BPromise=require(_0x06a8('0x5'));var Mustache=require(_0x06a8('0x6'));var util=require('util');var path=require('path');var sox=require(_0x06a8('0x7'));var csv=require(_0x06a8('0x8'));var ejs=require(_0x06a8('0x9'));var fs=require('fs');var fs_extra=require(_0x06a8('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x06a8('0xb'));var jsforce=require(_0x06a8('0xc'));var deskjs=require(_0x06a8('0xd'));var toCsv=require(_0x06a8('0x8'));var querystring=require(_0x06a8('0xe'));var Papa=require('papaparse');var Redis=require(_0x06a8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x06a8('0x10'));var as=require(_0x06a8('0x11'));var hardwareService=require(_0x06a8('0x12'));var logger=require(_0x06a8('0x13'))(_0x06a8('0x14'));var utils=require(_0x06a8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x06a8('0x16'));var db=require(_0x06a8('0x17'))['db'];config[_0x06a8('0x18')]=_[_0x06a8('0x19')](config[_0x06a8('0x18')],{'host':_0x06a8('0x1a'),'port':0x18eb});var socket=require(_0x06a8('0x1b'))(new Redis(config['redis']));require(_0x06a8('0x1c'))['register'](socket);function respondWithStatusCode(_0x352a40,_0x3b6833){_0x3b6833=_0x3b6833||0xcc;return function(_0x304795){if(_0x304795){return _0x352a40[_0x06a8('0x1d')](_0x3b6833);}return _0x352a40[_0x06a8('0x1e')](_0x3b6833)[_0x06a8('0x1f')]();};}function respondWithResult(_0x1a915e,_0x23980b){_0x23980b=_0x23980b||0xc8;return function(_0x18b3ef){if(_0x18b3ef){return _0x1a915e[_0x06a8('0x1e')](_0x23980b)[_0x06a8('0x20')](_0x18b3ef);}};}function respondWithFilteredResult(_0xe66777,_0x49bc7f){return function(_0x2e6292){if(_0x2e6292){var _0x4abe1c=typeof _0x49bc7f[_0x06a8('0x21')]===_0x06a8('0x22')&&typeof _0x49bc7f[_0x06a8('0x23')]==='undefined';var _0x2a2548=_0x2e6292[_0x06a8('0x24')];var _0x23d0b0=_0x4abe1c?0x0:_0x49bc7f['offset'];var _0x2343c2=_0x4abe1c?_0x2e6292[_0x06a8('0x24')]:_0x49bc7f['offset']+_0x49bc7f[_0x06a8('0x23')];var _0x2c23fb;if(_0x2343c2>=_0x2a2548){_0x2343c2=_0x2a2548;_0x2c23fb=0xc8;}else{_0x2c23fb=0xce;}_0xe66777[_0x06a8('0x1e')](_0x2c23fb);return _0xe66777[_0x06a8('0x25')](_0x06a8('0x26'),_0x23d0b0+'-'+_0x2343c2+'/'+_0x2a2548)[_0x06a8('0x20')](_0x2e6292);}return null;};}function patchUpdates(_0x4cb8b7){return function(_0x4d78ac){try{jsonpatch['apply'](_0x4d78ac,_0x4cb8b7,!![]);}catch(_0x5934a4){return BPromise[_0x06a8('0x27')](_0x5934a4);}return _0x4d78ac[_0x06a8('0x28')]();};}function saveUpdates(_0x985ec7,_0xc3c59b){return function(_0x5dfe41){if(_0x5dfe41){return _0x5dfe41[_0x06a8('0x29')](_0x985ec7)[_0x06a8('0x2a')](function(_0x473b86){return _0x473b86;});}return null;};}function removeEntity(_0x83d8e,_0x31eaec){return function(_0xfd677f){if(_0xfd677f){return _0xfd677f[_0x06a8('0x2b')]()[_0x06a8('0x2a')](function(){var _0x5ce44f=_0xfd677f[_0x06a8('0x2c')]({'plain':!![]});var _0x199b5a=_0x06a8('0x2d');return db['UserProfileResource'][_0x06a8('0x2b')]({'where':{'type':_0x199b5a,'resourceId':_0x5ce44f['id']}})[_0x06a8('0x2a')](function(){return _0xfd677f;});})[_0x06a8('0x2a')](function(){_0x83d8e[_0x06a8('0x1e')](0xcc)[_0x06a8('0x1f')]();});}};}function handleEntityNotFound(_0x4ba9af,_0x1c39f4){return function(_0xaf4ee8){if(!_0xaf4ee8){_0x4ba9af[_0x06a8('0x1d')](0x194);}return _0xaf4ee8;};}function handleError(_0x577d22,_0x43f514){_0x43f514=_0x43f514||0x1f4;return function(_0x2bb44b){logger['error'](_0x2bb44b[_0x06a8('0x2e')]);if(_0x2bb44b['name']){delete _0x2bb44b[_0x06a8('0x2f')];}_0x577d22['status'](_0x43f514)['send'](_0x2bb44b);};}exports[_0x06a8('0x30')]=function(_0x3e5408,_0x1305e6){var _0x321150={},_0x37490d={},_0xf03bea={'count':0x0,'rows':[]};var _0x5ac176=_['map'](db[_0x06a8('0x31')]['rawAttributes'],function(_0x3176eb){return{'name':_0x3176eb[_0x06a8('0x32')],'type':_0x3176eb[_0x06a8('0x33')][_0x06a8('0x34')]};});_0x37490d['model']=_[_0x06a8('0x35')](_0x5ac176,_0x06a8('0x2f'));_0x37490d[_0x06a8('0x36')]=_[_0x06a8('0x37')](_0x3e5408[_0x06a8('0x36')]);_0x37490d['filters']=_[_0x06a8('0x38')](_0x37490d[_0x06a8('0x39')],_0x37490d[_0x06a8('0x36')]);_0x321150[_0x06a8('0x3a')]=_[_0x06a8('0x38')](_0x37490d[_0x06a8('0x39')],qs[_0x06a8('0x3b')](_0x3e5408[_0x06a8('0x36')]['fields']));_0x321150[_0x06a8('0x3a')]=_0x321150['attributes'][_0x06a8('0x3c')]?_0x321150[_0x06a8('0x3a')]:_0x37490d['model'];if(!_0x3e5408[_0x06a8('0x36')]['hasOwnProperty']('nolimit')){_0x321150['limit']=qs[_0x06a8('0x23')](_0x3e5408['query'][_0x06a8('0x23')]);_0x321150[_0x06a8('0x21')]=qs[_0x06a8('0x21')](_0x3e5408[_0x06a8('0x36')][_0x06a8('0x21')]);}_0x321150[_0x06a8('0x3d')]=qs[_0x06a8('0x3e')](_0x3e5408[_0x06a8('0x36')]['sort']);_0x321150[_0x06a8('0x3f')]=qs[_0x06a8('0x40')](_[_0x06a8('0x41')](_0x3e5408[_0x06a8('0x36')],_0x37490d[_0x06a8('0x40')]),_0x5ac176);if(_0x3e5408[_0x06a8('0x36')][_0x06a8('0x42')]){_0x321150[_0x06a8('0x3f')]=_[_0x06a8('0x43')](_0x321150[_0x06a8('0x3f')],{'$or':_[_0x06a8('0x35')](_0x5ac176,function(_0x169ecb){if(_0x169ecb[_0x06a8('0x33')]!==_0x06a8('0x44')){var _0xdb861b={};_0xdb861b[_0x169ecb['name']]={'$like':'%'+_0x3e5408[_0x06a8('0x36')][_0x06a8('0x42')]+'%'};return _0xdb861b;}})});}_0x321150=_['merge']({},_0x321150,_0x3e5408[_0x06a8('0x45')]);var _0x23b695={'where':_0x321150[_0x06a8('0x3f')]};return db['SmsQueue'][_0x06a8('0x24')](_0x23b695)[_0x06a8('0x2a')](function(_0x4e1cb8){_0xf03bea[_0x06a8('0x24')]=_0x4e1cb8;if(_0x3e5408[_0x06a8('0x36')][_0x06a8('0x46')]){_0x321150[_0x06a8('0x47')]=[{'all':!![]}];}return db[_0x06a8('0x31')][_0x06a8('0x48')](_0x321150);})['then'](function(_0x311838){_0xf03bea[_0x06a8('0x49')]=_0x311838;return _0xf03bea;})['then'](respondWithFilteredResult(_0x1305e6,_0x321150))[_0x06a8('0x4a')](handleError(_0x1305e6,null));};exports[_0x06a8('0x4b')]=function(_0x346794,_0x2eb22c){var _0x4721e1={'raw':!![],'where':{'id':_0x346794[_0x06a8('0x4c')]['id']}},_0x1fc0fe={};_0x1fc0fe['model']=_[_0x06a8('0x37')](db[_0x06a8('0x31')]['rawAttributes']);_0x1fc0fe[_0x06a8('0x36')]=_[_0x06a8('0x37')](_0x346794[_0x06a8('0x36')]);_0x1fc0fe['filters']=_[_0x06a8('0x38')](_0x1fc0fe[_0x06a8('0x39')],_0x1fc0fe['query']);_0x4721e1['attributes']=_[_0x06a8('0x38')](_0x1fc0fe['model'],qs[_0x06a8('0x3b')](_0x346794['query'][_0x06a8('0x3b')]));_0x4721e1[_0x06a8('0x3a')]=_0x4721e1['attributes'][_0x06a8('0x3c')]?_0x4721e1['attributes']:_0x1fc0fe[_0x06a8('0x39')];if(_0x346794[_0x06a8('0x36')][_0x06a8('0x46')]){_0x4721e1[_0x06a8('0x47')]=[{'all':!![]}];}_0x4721e1=_[_0x06a8('0x43')]({},_0x4721e1,_0x346794[_0x06a8('0x45')]);return db[_0x06a8('0x31')][_0x06a8('0x4d')](_0x4721e1)['then'](handleEntityNotFound(_0x2eb22c,null))[_0x06a8('0x2a')](respondWithResult(_0x2eb22c,null))[_0x06a8('0x4a')](handleError(_0x2eb22c,null));};exports['create']=function(_0x4bb685,_0x3bfa32){return db[_0x06a8('0x31')][_0x06a8('0x4e')](_0x4bb685[_0x06a8('0x4f')],{})[_0x06a8('0x2a')](function(_0x1f402f){var _0x515527=_0x4bb685['user'][_0x06a8('0x2c')]({'plain':!![]});if(!_0x515527)throw new Error(_0x06a8('0x50'));if(_0x515527[_0x06a8('0x51')]===_0x06a8('0x52')){var _0x5f439b=_0x1f402f['get']({'plain':!![]});var _0x448174=_0x06a8('0x2d');return db[_0x06a8('0x53')][_0x06a8('0x4d')]({'where':{'name':_0x448174,'userProfileId':_0x515527[_0x06a8('0x54')]},'raw':!![]})['then'](function(_0x2bb766){if(_0x2bb766&&_0x2bb766[_0x06a8('0x55')]===0x0){return db[_0x06a8('0x56')][_0x06a8('0x4e')]({'name':_0x5f439b[_0x06a8('0x2f')],'resourceId':_0x5f439b['id'],'type':_0x2bb766[_0x06a8('0x2f')],'sectionId':_0x2bb766['id']},{})['then'](function(){return _0x1f402f;});}else{return _0x1f402f;}})['catch'](function(_0x4d5b4e){logger[_0x06a8('0x57')](_0x06a8('0x58'),_0x4d5b4e);throw _0x4d5b4e;});}return _0x1f402f;})[_0x06a8('0x2a')](respondWithResult(_0x3bfa32,0xc9))[_0x06a8('0x4a')](handleError(_0x3bfa32,null));};exports[_0x06a8('0x29')]=function(_0x3be948,_0x4abeb6){if(_0x3be948[_0x06a8('0x4f')]['id']){delete _0x3be948[_0x06a8('0x4f')]['id'];}return db[_0x06a8('0x31')][_0x06a8('0x4d')]({'where':{'id':_0x3be948[_0x06a8('0x4c')]['id']}})[_0x06a8('0x2a')](handleEntityNotFound(_0x4abeb6,null))[_0x06a8('0x2a')](saveUpdates(_0x3be948[_0x06a8('0x4f')],null))[_0x06a8('0x2a')](respondWithResult(_0x4abeb6,null))[_0x06a8('0x4a')](handleError(_0x4abeb6,null));};exports[_0x06a8('0x2b')]=function(_0x5df068,_0x54850e){return db[_0x06a8('0x31')][_0x06a8('0x4d')]({'where':{'id':_0x5df068[_0x06a8('0x4c')]['id']}})[_0x06a8('0x2a')](handleEntityNotFound(_0x54850e,null))[_0x06a8('0x2a')](removeEntity(_0x54850e,null))[_0x06a8('0x4a')](handleError(_0x54850e,null));};exports['describe']=function(_0x392bbd,_0x1dd4e7){return db[_0x06a8('0x31')]['describe']()[_0x06a8('0x2a')](respondWithResult(_0x1dd4e7,null))[_0x06a8('0x4a')](handleError(_0x1dd4e7,null));};exports['getMembers']=function(_0xb8e60e,_0x4bfa58,_0x424f56){var _0x21740b={'raw':!![],'where':{}},_0x411a47={},_0x56f195;return db[_0x06a8('0x31')][_0x06a8('0x59')]({'where':{'id':_0xb8e60e[_0x06a8('0x4c')]['id']}})[_0x06a8('0x2a')](handleEntityNotFound(_0x4bfa58,null))['then'](function(_0x4f0a9f){if(_0x4f0a9f){_0x56f195=_0x4f0a9f[_0x06a8('0x2c')]({'plain':!![]});_0x411a47[_0x06a8('0x39')]=_[_0x06a8('0x37')](db[_0x06a8('0x5a')][_0x06a8('0x5b')]);_0x411a47['query']=_['keys'](_0xb8e60e['query']);_0x411a47[_0x06a8('0x40')]=_[_0x06a8('0x38')](_0x411a47[_0x06a8('0x39')],_0x411a47['query']);_0x21740b[_0x06a8('0x3a')]=_[_0x06a8('0x38')](_0x411a47[_0x06a8('0x39')],qs['fields'](_0xb8e60e['query']['fields']));_0x21740b['attributes']=_0x21740b[_0x06a8('0x3a')][_0x06a8('0x3c')]?_0x21740b['attributes']:_0x411a47[_0x06a8('0x39')];if(!_0xb8e60e['query'][_0x06a8('0x5c')](_0x06a8('0x5d'))){_0x21740b['limit']=qs[_0x06a8('0x23')](_0xb8e60e[_0x06a8('0x36')]['limit']);_0x21740b[_0x06a8('0x21')]=qs['offset'](_0xb8e60e[_0x06a8('0x36')][_0x06a8('0x21')]);}_0x21740b[_0x06a8('0x3d')]=qs[_0x06a8('0x3e')](_0xb8e60e[_0x06a8('0x36')][_0x06a8('0x3e')]);_0x21740b[_0x06a8('0x3f')]=qs[_0x06a8('0x40')](_[_0x06a8('0x41')](_0xb8e60e[_0x06a8('0x36')],_0x411a47[_0x06a8('0x40')]));_0x21740b['where'][_0x06a8('0x5e')]=_0x4f0a9f['id'];if(_0xb8e60e[_0x06a8('0x36')][_0x06a8('0x42')]){_0x21740b['where']=_[_0x06a8('0x43')](_0x21740b['where'],{'$or':_[_0x06a8('0x35')](_0x21740b[_0x06a8('0x3a')],function(_0x2ef30d){var _0xba319d={};_0xba319d[_0x2ef30d]={'$like':'%'+_0xb8e60e[_0x06a8('0x36')][_0x06a8('0x42')]+'%'};return _0xba319d;})});}_0x21740b=_[_0x06a8('0x43')]({},_0x21740b,_0xb8e60e[_0x06a8('0x45')]);return db[_0x06a8('0x5a')][_0x06a8('0x48')](_0x21740b);}})[_0x06a8('0x2a')](function(_0x2f83a0){if(_0x2f83a0){return db[_0x06a8('0x5f')][_0x06a8('0x60')]({'where':{'id':_[_0x06a8('0x35')](_0x2f83a0,_0x06a8('0x61')),'role':'agent'},'attributes':['id',_0x06a8('0x2f'),_0x06a8('0x62'),_0x06a8('0x63'),_0x06a8('0x64')]});}})['then'](function(_0x1d4471){if(_0x1d4471){return{'count':_0x1d4471[_0x06a8('0x24')],'rows':_['map'](_0x1d4471[_0x06a8('0x49')],function(_0x150583){return{'membername':_0x150583[_0x06a8('0x2f')],'UserId':_0x150583['id'],'queue_name':_0x56f195[_0x06a8('0x2f')],'SmsQueueId':_0x56f195['id'],'interface':util[_0x06a8('0x65')]('%s/%s',_0x06a8('0x66'),_0x150583[_0x06a8('0x2f')]),'penalty':0x0,'paused':_0x150583[_0x06a8('0x62')],'createdAt':_0x150583[_0x06a8('0x64')],'updatedAt':_0x150583['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x06a8('0x2a')](respondWithFilteredResult(_0x4bfa58,_0x21740b))['catch'](handleError(_0x4bfa58,null));};exports[_0x06a8('0x67')]=function(_0x2cd80e,_0x2a31d1,_0xfdff65){var _0x3e178e={};var _0x66bb55={};var _0x534a9d;var _0x2d6a40;return db[_0x06a8('0x31')][_0x06a8('0x59')]({'where':{'id':_0x2cd80e[_0x06a8('0x4c')]['id']}})[_0x06a8('0x2a')](handleEntityNotFound(_0x2a31d1,null))[_0x06a8('0x2a')](function(_0x576d99){if(_0x576d99){_0x534a9d=_0x576d99;_0x66bb55[_0x06a8('0x39')]=_[_0x06a8('0x37')](db[_0x06a8('0x68')][_0x06a8('0x5b')]);_0x66bb55[_0x06a8('0x36')]=_[_0x06a8('0x37')](_0x2cd80e[_0x06a8('0x36')]);_0x66bb55[_0x06a8('0x40')]=_[_0x06a8('0x38')](_0x66bb55['model'],_0x66bb55[_0x06a8('0x36')]);_0x3e178e[_0x06a8('0x3a')]=_[_0x06a8('0x38')](_0x66bb55['model'],qs['fields'](_0x2cd80e['query'][_0x06a8('0x3b')]));_0x3e178e[_0x06a8('0x3a')]=_0x3e178e[_0x06a8('0x3a')][_0x06a8('0x3c')]?_0x3e178e['attributes']:_0x66bb55[_0x06a8('0x39')];_0x3e178e['order']=qs[_0x06a8('0x3e')](_0x2cd80e[_0x06a8('0x36')][_0x06a8('0x3e')]);_0x3e178e[_0x06a8('0x3f')]=qs[_0x06a8('0x40')](_['pick'](_0x2cd80e['query'],_0x66bb55[_0x06a8('0x40')]));if(_0x2cd80e[_0x06a8('0x36')]['filter']){_0x3e178e[_0x06a8('0x3f')]=_['merge'](_0x3e178e[_0x06a8('0x3f')],{'$or':_['map'](_0x3e178e[_0x06a8('0x3a')],function(_0x55f8e8){var _0x2c73c5={};_0x2c73c5[_0x55f8e8]={'$like':'%'+_0x2cd80e[_0x06a8('0x36')][_0x06a8('0x42')]+'%'};return _0x2c73c5;})});}_0x3e178e=_[_0x06a8('0x43')]({},_0x3e178e,_0x2cd80e[_0x06a8('0x45')]);return _0x534a9d[_0x06a8('0x67')](_0x3e178e);}})[_0x06a8('0x2a')](function(_0xeb33ac){if(_0xeb33ac){_0x2d6a40=_0xeb33ac[_0x06a8('0x3c')];if(!_0x2cd80e[_0x06a8('0x36')][_0x06a8('0x5c')](_0x06a8('0x5d'))){_0x3e178e['limit']=qs['limit'](_0x2cd80e['query'][_0x06a8('0x23')]);_0x3e178e[_0x06a8('0x21')]=qs['offset'](_0x2cd80e[_0x06a8('0x36')][_0x06a8('0x21')]);}return _0x534a9d[_0x06a8('0x67')](_0x3e178e);}})[_0x06a8('0x2a')](function(_0x79e759){if(_0x79e759){return _0x79e759?{'count':_0x2d6a40,'rows':_0x79e759}:null;}})[_0x06a8('0x2a')](respondWithResult(_0x2a31d1,null))[_0x06a8('0x4a')](handleError(_0x2a31d1,null));};exports[_0x06a8('0x69')]=function(_0x529dd7,_0x99a630,_0x122850){var _0x16462e=_0x529dd7[_0x06a8('0x4f')]['ids'];return db[_0x06a8('0x68')][_0x06a8('0x48')]({'where':{'id':_0x16462e},'attributes':['id'],'include':[{'model':db[_0x06a8('0x5f')],'as':_0x06a8('0x6a'),'attributes':['id',_0x06a8('0x2f'),_0x06a8('0x6b'),_0x06a8('0x6c'),'interface'],'raw':!![]}]})[_0x06a8('0x2a')](function(_0x444295){if(_0x444295){var _0xe74375=_[_0x06a8('0x6d')](_0x444295,function(_0x54025b){var _0x50a9b1=_0x54025b[_0x06a8('0x2c')]({'plain':!![]});return _0x50a9b1[_0x06a8('0x6a')];});return db['SmsQueue'][_0x06a8('0x4d')]({'where':{'id':_0x529dd7[_0x06a8('0x4c')]['id']}})[_0x06a8('0x2a')](function(_0x2af705){return db['sequelize']['transaction'](function(_0x114581){return _0x2af705[_0x06a8('0x69')](_0x16462e,{'transaction':_0x114581})[_0x06a8('0x2a')](function(){return BPromise['each'](_0xe74375,function(_0x35e9ac){return db[_0x06a8('0x5a')][_0x06a8('0x6e')]({'where':{'UserId':_0x35e9ac['id'],'SmsQueueId':_0x529dd7['params']['id']},'transaction':_0x114581});});})[_0x06a8('0x2a')](function(){_0xe74375[_0x06a8('0x6f')](function(_0xb9ea3a){socket[_0x06a8('0x70')](_0x06a8('0x71'),{'UserId':_0xb9ea3a['id'],'SmsQueueId':_0x2af705['id']});});});});});}})[_0x06a8('0x2a')](respondWithStatusCode(_0x99a630,null))[_0x06a8('0x4a')](handleError(_0x99a630,null));};exports[_0x06a8('0x72')]=function(_0x36a5cc,_0x44451e,_0x4fa66c){return db['Team'][_0x06a8('0x48')]({'where':{'id':_0x36a5cc['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x06a8('0x5f')],'as':_0x06a8('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x06a8('0x2a')](handleEntityNotFound(_0x44451e,null))[_0x06a8('0x2a')](function(_0x33d175){var _0x104dc7=_['map'](_0x33d175,'id');var _0x5c79ca=[];var _0x46c07f=[];var _0x2bfcb6=squel[_0x06a8('0x73')]();_0x2bfcb6['field'](_0x06a8('0x74'))['from'](_0x06a8('0x75'),'tq')[_0x06a8('0x76')](_0x06a8('0x77'),'ut',_0x06a8('0x78'))[_0x06a8('0x3f')](_0x06a8('0x79'),_0x36a5cc[_0x06a8('0x4c')]['id']);for(var _0x401d1c=0x0;_0x401d1c<_0x33d175['length'];_0x401d1c+=0x1){let _0x51f549=_0x33d175[_0x401d1c];for(var _0x7564a6=0x0;_0x7564a6<_0x51f549[_0x06a8('0x6a')][_0x06a8('0x3c')];_0x7564a6+=0x1){let _0x50457c=_0x51f549[_0x06a8('0x6a')][_0x7564a6];var _0x2b9acc=_0x2bfcb6['clone']();_0x2b9acc[_0x06a8('0x3f')](_0x06a8('0x7a'),_0x50457c['id']);_0x46c07f[_0x06a8('0x7b')](db[_0x06a8('0x7c')]['query'](_0x2b9acc[_0x06a8('0x7d')](),{'type':db[_0x06a8('0x7c')]['QueryTypes'][_0x06a8('0x7e')]})[_0x06a8('0x2a')](function(_0x119951){if(_0x119951[_0x06a8('0x3c')]===0x1){return _0x50457c['id'];}else{var _0x375b0c=_[_0x06a8('0x7f')](_['map'](_0x119951,_0x06a8('0x80')),function(_0x5c85e0){return _[_0x06a8('0x81')](_0x104dc7,_0x5c85e0);});if(_0x375b0c){return _0x50457c['id'];}}}));}}return BPromise[_0x06a8('0x82')](_0x46c07f)[_0x06a8('0x2a')](function(_0x53fc3d){_0x5c79ca=_(_0x5c79ca)[_0x06a8('0x83')](_0x53fc3d)[_0x06a8('0x84')]()[_0x06a8('0x85')]();return db[_0x06a8('0x31')]['find']({'where':{'id':_0x36a5cc[_0x06a8('0x4c')]['id']}})[_0x06a8('0x2a')](function(_0x314096){return db[_0x06a8('0x7c')][_0x06a8('0x86')](function(_0x4f074d){return _0x314096[_0x06a8('0x72')](_0x36a5cc['query']['ids'],{'transaction':_0x4f074d})[_0x06a8('0x2a')](function(){if(!_[_0x06a8('0x87')](_0x5c79ca)){return _0x314096[_0x06a8('0x88')](_0x5c79ca,{'transaction':_0x4f074d});}})[_0x06a8('0x2a')](function(){_0x5c79ca[_0x06a8('0x6f')](function(_0x360161){socket[_0x06a8('0x70')](_0x06a8('0x89'),{'UserId':_0x360161,'SmsQueueId':_0x314096['id']});});});});});});})[_0x06a8('0x2a')](respondWithStatusCode(_0x44451e,null))[_0x06a8('0x4a')](handleError(_0x44451e,null));};exports[_0x06a8('0x8a')]=function(_0x129df3,_0x2ff6f5,_0x4a12aa){return db[_0x06a8('0x31')]['find']({'where':{'id':_0x129df3['params']['id']}})[_0x06a8('0x2a')](handleEntityNotFound(_0x2ff6f5,null))[_0x06a8('0x2a')](function(_0x32b08f){if(_0x32b08f){return _0x32b08f[_0x06a8('0x8a')](_0x129df3[_0x06a8('0x4f')][_0x06a8('0x8b')],_['omit'](_0x129df3['body'],[_0x06a8('0x8b'),'id'])||{})[_0x06a8('0x8c')](function(_0x4f5f2c){for(var _0x4e9045=0x0;_0x4e9045<_0x129df3['body'][_0x06a8('0x8b')]['length'];_0x4e9045+=0x1){socket['emit'](_0x06a8('0x71'),{'UserId':Number(_0x129df3['body']['ids'][_0x4e9045]),'SmsQueueId':Number(_0x129df3[_0x06a8('0x4c')]['id'])});}return _0x4f5f2c;});}})[_0x06a8('0x2a')](respondWithResult(_0x2ff6f5,null))['catch'](handleError(_0x2ff6f5,null));};exports[_0x06a8('0x88')]=function(_0x50689e,_0x367fe7,_0x434756){return db['SmsQueue'][_0x06a8('0x4d')]({'where':{'id':_0x50689e[_0x06a8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x367fe7,null))[_0x06a8('0x2a')](function(_0x14d3e4){if(_0x14d3e4){return _0x14d3e4[_0x06a8('0x88')](_0x50689e[_0x06a8('0x36')]['ids'])[_0x06a8('0x2a')](function(){if(_['isArray'](_0x50689e[_0x06a8('0x36')][_0x06a8('0x8b')])){for(var _0x2fa981=0x0;_0x2fa981<_0x50689e[_0x06a8('0x36')][_0x06a8('0x8b')][_0x06a8('0x3c')];_0x2fa981+=0x1){socket[_0x06a8('0x70')](_0x06a8('0x89'),{'UserId':Number(_0x50689e['query'][_0x06a8('0x8b')][_0x2fa981]),'SmsQueueId':Number(_0x50689e['params']['id'])});}}else{socket[_0x06a8('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x50689e[_0x06a8('0x36')][_0x06a8('0x8b')]),'SmsQueueId':Number(_0x50689e[_0x06a8('0x4c')]['id'])});}});}})[_0x06a8('0x2a')](respondWithStatusCode(_0x367fe7,null))[_0x06a8('0x4a')](handleError(_0x367fe7,null));};exports[_0x06a8('0x8d')]=function(_0x37cb0f,_0x3058ae,_0x1ee8c4){var _0x4ed4cd={};var _0x58abc6={};var _0x5b86d6;var _0x2684f0;return db[_0x06a8('0x31')][_0x06a8('0x59')]({'where':{'id':_0x37cb0f[_0x06a8('0x4c')]['id']}})[_0x06a8('0x2a')](handleEntityNotFound(_0x3058ae,null))['then'](function(_0x1f126a){if(_0x1f126a){_0x5b86d6=_0x1f126a;_0x58abc6[_0x06a8('0x39')]=_[_0x06a8('0x37')](db[_0x06a8('0x5f')][_0x06a8('0x5b')]);_0x58abc6[_0x06a8('0x36')]=_[_0x06a8('0x37')](_0x37cb0f[_0x06a8('0x36')]);_0x58abc6[_0x06a8('0x40')]=_[_0x06a8('0x38')](_0x58abc6[_0x06a8('0x39')],_0x58abc6[_0x06a8('0x36')]);_0x4ed4cd[_0x06a8('0x3a')]=_[_0x06a8('0x38')](_0x58abc6['model'],qs[_0x06a8('0x3b')](_0x37cb0f[_0x06a8('0x36')][_0x06a8('0x3b')]));_0x4ed4cd['attributes']=_0x4ed4cd['attributes'][_0x06a8('0x3c')]?_0x4ed4cd[_0x06a8('0x3a')]:_0x58abc6['model'];_0x4ed4cd['order']=qs[_0x06a8('0x3e')](_0x37cb0f[_0x06a8('0x36')][_0x06a8('0x3e')]);_0x4ed4cd[_0x06a8('0x3f')]=qs[_0x06a8('0x40')](_['pick'](_0x37cb0f['query'],_0x58abc6[_0x06a8('0x40')]));if(_0x37cb0f['query'][_0x06a8('0x42')]){_0x4ed4cd[_0x06a8('0x3f')]=_[_0x06a8('0x43')](_0x4ed4cd['where'],{'$or':_[_0x06a8('0x35')](_0x4ed4cd[_0x06a8('0x3a')],function(_0x4d120e){var _0x42266a={};_0x42266a[_0x4d120e]={'$like':'%'+_0x37cb0f[_0x06a8('0x36')][_0x06a8('0x42')]+'%'};return _0x42266a;})});}_0x4ed4cd=_['merge']({},_0x4ed4cd,_0x37cb0f[_0x06a8('0x45')]);return _0x5b86d6[_0x06a8('0x8d')](_0x4ed4cd);}})[_0x06a8('0x2a')](function(_0x3eee6e){if(_0x3eee6e){_0x2684f0=_0x3eee6e[_0x06a8('0x3c')];if(!_0x37cb0f['query']['hasOwnProperty']('nolimit')){_0x4ed4cd[_0x06a8('0x23')]=qs['limit'](_0x37cb0f[_0x06a8('0x36')][_0x06a8('0x23')]);_0x4ed4cd[_0x06a8('0x21')]=qs[_0x06a8('0x21')](_0x37cb0f[_0x06a8('0x36')][_0x06a8('0x21')]);}return _0x5b86d6['getAgents'](_0x4ed4cd);}})[_0x06a8('0x2a')](function(_0x383863){if(_0x383863){return _0x383863?{'count':_0x2684f0,'rows':_0x383863}:null;}})[_0x06a8('0x2a')](respondWithResult(_0x3058ae,null))[_0x06a8('0x4a')](handleError(_0x3058ae,null));}; \ No newline at end of file +var _0x609b=['describe','getMembers','findOne','UserSmsQueue','filters','order','findAndCountAll','UserId','updatedAt','createdAt','smsPause','getTeams','addTeams','ids','Team','User','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','Agents','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','get','SmsQueues','UserProfileResource','end','stack','name','SmsQueue','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy'];(function(_0x27fc15,_0x1ed084){var _0x1db3b5=function(_0x5132f1){while(--_0x5132f1){_0x27fc15['push'](_0x27fc15['shift']());}};_0x1db3b5(++_0x1ed084);}(_0x609b,0xba));var _0xb609=function(_0x173d0f,_0x13712d){_0x173d0f=_0x173d0f-0x0;var _0x2df04c=_0x609b[_0x173d0f];return _0x2df04c;};'use strict';var emlformat=require(_0xb609('0x0'));var rimraf=require(_0xb609('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb609('0x2'));var rp=require(_0xb609('0x3'));var moment=require(_0xb609('0x4'));var BPromise=require(_0xb609('0x5'));var Mustache=require('mustache');var util=require(_0xb609('0x6'));var path=require('path');var sox=require(_0xb609('0x7'));var csv=require('to-csv');var ejs=require(_0xb609('0x8'));var fs=require('fs');var fs_extra=require(_0xb609('0x9'));var _=require(_0xb609('0xa'));var squel=require(_0xb609('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb609('0xc'));var toCsv=require(_0xb609('0xd'));var querystring=require('querystring');var Papa=require(_0xb609('0xe'));var Redis=require(_0xb609('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb609('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb609('0x11'));var logger=require(_0xb609('0x12'))(_0xb609('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb609('0x14'));var db=require(_0xb609('0x15'))['db'];config['redis']=_[_0xb609('0x16')](config[_0xb609('0x17')],{'host':_0xb609('0x18'),'port':0x18eb});var socket=require(_0xb609('0x19'))(new Redis(config[_0xb609('0x17')]));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x1f293c,_0x341c8c){_0x341c8c=_0x341c8c||0xcc;return function(_0x7f2669){if(_0x7f2669){return _0x1f293c[_0xb609('0x1a')](_0x341c8c);}return _0x1f293c['status'](_0x341c8c)['end']();};}function respondWithResult(_0x1a6803,_0x53fed2){_0x53fed2=_0x53fed2||0xc8;return function(_0x220bb2){if(_0x220bb2){return _0x1a6803[_0xb609('0x1b')](_0x53fed2)['json'](_0x220bb2);}};}function respondWithFilteredResult(_0x4bebf7,_0x56d95c){return function(_0x3ad0ff){if(_0x3ad0ff){var _0x12ce1c=typeof _0x56d95c[_0xb609('0x1c')]===_0xb609('0x1d')&&typeof _0x56d95c[_0xb609('0x1e')]===_0xb609('0x1d');var _0x30d1aa=_0x3ad0ff[_0xb609('0x1f')];var _0x4e1357=_0x12ce1c?0x0:_0x56d95c[_0xb609('0x1c')];var _0x34aa12=_0x12ce1c?_0x3ad0ff['count']:_0x56d95c['offset']+_0x56d95c[_0xb609('0x1e')];var _0x1c3d32;if(_0x34aa12>=_0x30d1aa){_0x34aa12=_0x30d1aa;_0x1c3d32=0xc8;}else{_0x1c3d32=0xce;}_0x4bebf7[_0xb609('0x1b')](_0x1c3d32);return _0x4bebf7['set'](_0xb609('0x20'),_0x4e1357+'-'+_0x34aa12+'/'+_0x30d1aa)[_0xb609('0x21')](_0x3ad0ff);}return null;};}function patchUpdates(_0x3f70d9){return function(_0x22eab1){try{jsonpatch[_0xb609('0x22')](_0x22eab1,_0x3f70d9,!![]);}catch(_0x3ce09f){return BPromise[_0xb609('0x23')](_0x3ce09f);}return _0x22eab1['save']();};}function saveUpdates(_0x156e5e,_0x21d6b5){return function(_0xbadde9){if(_0xbadde9){return _0xbadde9[_0xb609('0x24')](_0x156e5e)[_0xb609('0x25')](function(_0x3616b8){return _0x3616b8;});}return null;};}function removeEntity(_0x1eab17,_0x1acfd5){return function(_0x18257a){if(_0x18257a){return _0x18257a['destroy']()[_0xb609('0x25')](function(){var _0x2850be=_0x18257a[_0xb609('0x26')]({'plain':!![]});var _0x50f151=_0xb609('0x27');return db[_0xb609('0x28')]['destroy']({'where':{'type':_0x50f151,'resourceId':_0x2850be['id']}})[_0xb609('0x25')](function(){return _0x18257a;});})[_0xb609('0x25')](function(){_0x1eab17[_0xb609('0x1b')](0xcc)[_0xb609('0x29')]();});}};}function handleEntityNotFound(_0x2ff859,_0x2d6498){return function(_0x5167d9){if(!_0x5167d9){_0x2ff859[_0xb609('0x1a')](0x194);}return _0x5167d9;};}function handleError(_0x5db916,_0x276bf9){_0x276bf9=_0x276bf9||0x1f4;return function(_0xe733d4){logger['error'](_0xe733d4[_0xb609('0x2a')]);if(_0xe733d4['name']){delete _0xe733d4[_0xb609('0x2b')];}_0x5db916[_0xb609('0x1b')](_0x276bf9)['send'](_0xe733d4);};}exports['index']=function(_0x5aee0d,_0x38c1c5){var _0x29ac73={},_0x16435b={},_0x542263={'count':0x0,'rows':[]};var _0x2693c1=_['map'](db[_0xb609('0x2c')][_0xb609('0x2d')],function(_0x198364){return{'name':_0x198364[_0xb609('0x2e')],'type':_0x198364[_0xb609('0x2f')][_0xb609('0x30')]};});_0x16435b[_0xb609('0x31')]=_[_0xb609('0x32')](_0x2693c1,_0xb609('0x2b'));_0x16435b[_0xb609('0x33')]=_[_0xb609('0x34')](_0x5aee0d[_0xb609('0x33')]);_0x16435b['filters']=_['intersection'](_0x16435b['model'],_0x16435b[_0xb609('0x33')]);_0x29ac73[_0xb609('0x35')]=_[_0xb609('0x36')](_0x16435b[_0xb609('0x31')],qs[_0xb609('0x37')](_0x5aee0d[_0xb609('0x33')][_0xb609('0x37')]));_0x29ac73[_0xb609('0x35')]=_0x29ac73[_0xb609('0x35')][_0xb609('0x38')]?_0x29ac73[_0xb609('0x35')]:_0x16435b[_0xb609('0x31')];if(!_0x5aee0d[_0xb609('0x33')][_0xb609('0x39')](_0xb609('0x3a'))){_0x29ac73[_0xb609('0x1e')]=qs[_0xb609('0x1e')](_0x5aee0d[_0xb609('0x33')]['limit']);_0x29ac73[_0xb609('0x1c')]=qs[_0xb609('0x1c')](_0x5aee0d['query'][_0xb609('0x1c')]);}_0x29ac73['order']=qs['sort'](_0x5aee0d[_0xb609('0x33')][_0xb609('0x3b')]);_0x29ac73['where']=qs['filters'](_[_0xb609('0x3c')](_0x5aee0d[_0xb609('0x33')],_0x16435b['filters']),_0x2693c1);if(_0x5aee0d[_0xb609('0x33')][_0xb609('0x3d')]){_0x29ac73[_0xb609('0x3e')]=_['merge'](_0x29ac73['where'],{'$or':_['map'](_0x2693c1,function(_0x923b24){if(_0x923b24[_0xb609('0x2f')]!==_0xb609('0x3f')){var _0x4245cb={};_0x4245cb[_0x923b24['name']]={'$like':'%'+_0x5aee0d['query'][_0xb609('0x3d')]+'%'};return _0x4245cb;}})});}_0x29ac73=_[_0xb609('0x40')]({},_0x29ac73,_0x5aee0d[_0xb609('0x41')]);var _0x1c087b={'where':_0x29ac73['where']};return db[_0xb609('0x2c')][_0xb609('0x1f')](_0x1c087b)['then'](function(_0x3988d1){_0x542263[_0xb609('0x1f')]=_0x3988d1;if(_0x5aee0d[_0xb609('0x33')][_0xb609('0x42')]){_0x29ac73[_0xb609('0x43')]=[{'all':!![]}];}return db['SmsQueue'][_0xb609('0x44')](_0x29ac73);})[_0xb609('0x25')](function(_0x4b3fbe){_0x542263['rows']=_0x4b3fbe;return _0x542263;})[_0xb609('0x25')](respondWithFilteredResult(_0x38c1c5,_0x29ac73))[_0xb609('0x45')](handleError(_0x38c1c5,null));};exports[_0xb609('0x46')]=function(_0x1405ee,_0x134e02){var _0x1a9bc7={'raw':!![],'where':{'id':_0x1405ee[_0xb609('0x47')]['id']}},_0x56c02e={};_0x56c02e[_0xb609('0x31')]=_[_0xb609('0x34')](db[_0xb609('0x2c')][_0xb609('0x2d')]);_0x56c02e[_0xb609('0x33')]=_['keys'](_0x1405ee['query']);_0x56c02e['filters']=_['intersection'](_0x56c02e['model'],_0x56c02e[_0xb609('0x33')]);_0x1a9bc7[_0xb609('0x35')]=_[_0xb609('0x36')](_0x56c02e['model'],qs[_0xb609('0x37')](_0x1405ee[_0xb609('0x33')][_0xb609('0x37')]));_0x1a9bc7[_0xb609('0x35')]=_0x1a9bc7[_0xb609('0x35')][_0xb609('0x38')]?_0x1a9bc7[_0xb609('0x35')]:_0x56c02e[_0xb609('0x31')];if(_0x1405ee[_0xb609('0x33')][_0xb609('0x42')]){_0x1a9bc7[_0xb609('0x43')]=[{'all':!![]}];}_0x1a9bc7=_[_0xb609('0x40')]({},_0x1a9bc7,_0x1405ee[_0xb609('0x41')]);return db[_0xb609('0x2c')][_0xb609('0x48')](_0x1a9bc7)['then'](handleEntityNotFound(_0x134e02,null))[_0xb609('0x25')](respondWithResult(_0x134e02,null))[_0xb609('0x45')](handleError(_0x134e02,null));};exports['create']=function(_0x212f2e,_0x38b491){return db[_0xb609('0x2c')][_0xb609('0x49')](_0x212f2e[_0xb609('0x4a')],{})[_0xb609('0x25')](function(_0x396353){var _0x54e104=_0x212f2e[_0xb609('0x4b')][_0xb609('0x26')]({'plain':!![]});if(!_0x54e104)throw new Error(_0xb609('0x4c'));if(_0x54e104['role']===_0xb609('0x4b')){var _0x250bcc=_0x396353['get']({'plain':!![]});var _0x5d13f7=_0xb609('0x27');return db['UserProfileSection'][_0xb609('0x48')]({'where':{'name':_0x5d13f7,'userProfileId':_0x54e104[_0xb609('0x4d')]},'raw':!![]})['then'](function(_0x537b16){if(_0x537b16&&_0x537b16[_0xb609('0x4e')]===0x0){return db[_0xb609('0x28')][_0xb609('0x49')]({'name':_0x250bcc[_0xb609('0x2b')],'resourceId':_0x250bcc['id'],'type':_0x537b16[_0xb609('0x2b')],'sectionId':_0x537b16['id']},{})[_0xb609('0x25')](function(){return _0x396353;});}else{return _0x396353;}})[_0xb609('0x45')](function(_0x5173e2){logger[_0xb609('0x4f')](_0xb609('0x50'),_0x5173e2);throw _0x5173e2;});}return _0x396353;})[_0xb609('0x25')](respondWithResult(_0x38b491,0xc9))[_0xb609('0x45')](handleError(_0x38b491,null));};exports['update']=function(_0x3d45c2,_0xc12974){if(_0x3d45c2[_0xb609('0x4a')]['id']){delete _0x3d45c2[_0xb609('0x4a')]['id'];}return db[_0xb609('0x2c')][_0xb609('0x48')]({'where':{'id':_0x3d45c2[_0xb609('0x47')]['id']}})[_0xb609('0x25')](handleEntityNotFound(_0xc12974,null))[_0xb609('0x25')](saveUpdates(_0x3d45c2[_0xb609('0x4a')],null))['then'](respondWithResult(_0xc12974,null))[_0xb609('0x45')](handleError(_0xc12974,null));};exports[_0xb609('0x51')]=function(_0x598629,_0x3ba9d5){return db[_0xb609('0x2c')]['find']({'where':{'id':_0x598629['params']['id']}})[_0xb609('0x25')](handleEntityNotFound(_0x3ba9d5,null))['then'](removeEntity(_0x3ba9d5,null))[_0xb609('0x45')](handleError(_0x3ba9d5,null));};exports[_0xb609('0x52')]=function(_0x349a31,_0x283513){return db['SmsQueue'][_0xb609('0x52')]()[_0xb609('0x25')](respondWithResult(_0x283513,null))[_0xb609('0x45')](handleError(_0x283513,null));};exports[_0xb609('0x53')]=function(_0x17102d,_0x2fd745,_0x4d2869){var _0x9642b={'raw':!![],'where':{}},_0x38b2ed={},_0x36c881;return db['SmsQueue'][_0xb609('0x54')]({'where':{'id':_0x17102d['params']['id']}})[_0xb609('0x25')](handleEntityNotFound(_0x2fd745,null))[_0xb609('0x25')](function(_0x5219a4){if(_0x5219a4){_0x36c881=_0x5219a4[_0xb609('0x26')]({'plain':!![]});_0x38b2ed[_0xb609('0x31')]=_[_0xb609('0x34')](db[_0xb609('0x55')][_0xb609('0x2d')]);_0x38b2ed[_0xb609('0x33')]=_[_0xb609('0x34')](_0x17102d[_0xb609('0x33')]);_0x38b2ed[_0xb609('0x56')]=_['intersection'](_0x38b2ed['model'],_0x38b2ed[_0xb609('0x33')]);_0x9642b[_0xb609('0x35')]=_['intersection'](_0x38b2ed['model'],qs[_0xb609('0x37')](_0x17102d[_0xb609('0x33')][_0xb609('0x37')]));_0x9642b[_0xb609('0x35')]=_0x9642b[_0xb609('0x35')][_0xb609('0x38')]?_0x9642b[_0xb609('0x35')]:_0x38b2ed['model'];if(!_0x17102d[_0xb609('0x33')][_0xb609('0x39')](_0xb609('0x3a'))){_0x9642b[_0xb609('0x1e')]=qs[_0xb609('0x1e')](_0x17102d[_0xb609('0x33')][_0xb609('0x1e')]);_0x9642b[_0xb609('0x1c')]=qs[_0xb609('0x1c')](_0x17102d['query'][_0xb609('0x1c')]);}_0x9642b[_0xb609('0x57')]=qs[_0xb609('0x3b')](_0x17102d[_0xb609('0x33')][_0xb609('0x3b')]);_0x9642b[_0xb609('0x3e')]=qs['filters'](_[_0xb609('0x3c')](_0x17102d[_0xb609('0x33')],_0x38b2ed[_0xb609('0x56')]));_0x9642b['where']['SmsQueueId']=_0x5219a4['id'];if(_0x17102d[_0xb609('0x33')]['filter']){_0x9642b[_0xb609('0x3e')]=_[_0xb609('0x40')](_0x9642b[_0xb609('0x3e')],{'$or':_['map'](_0x9642b[_0xb609('0x35')],function(_0x4946ee){var _0x2aaec1={};_0x2aaec1[_0x4946ee]={'$like':'%'+_0x17102d[_0xb609('0x33')][_0xb609('0x3d')]+'%'};return _0x2aaec1;})});}_0x9642b=_[_0xb609('0x40')]({},_0x9642b,_0x17102d[_0xb609('0x41')]);return db[_0xb609('0x55')]['findAll'](_0x9642b);}})[_0xb609('0x25')](function(_0x59bc20){if(_0x59bc20){return db['User'][_0xb609('0x58')]({'where':{'id':_[_0xb609('0x32')](_0x59bc20,_0xb609('0x59')),'role':'agent'},'attributes':['id',_0xb609('0x2b'),'smsPause',_0xb609('0x5a'),_0xb609('0x5b')]});}})[_0xb609('0x25')](function(_0x352650){if(_0x352650){return{'count':_0x352650[_0xb609('0x1f')],'rows':_[_0xb609('0x32')](_0x352650['rows'],function(_0x2c1ef8){return{'membername':_0x2c1ef8[_0xb609('0x2b')],'UserId':_0x2c1ef8['id'],'queue_name':_0x36c881['name'],'SmsQueueId':_0x36c881['id'],'interface':util['format']('%s/%s','SIP',_0x2c1ef8[_0xb609('0x2b')]),'penalty':0x0,'paused':_0x2c1ef8[_0xb609('0x5c')],'createdAt':_0x2c1ef8[_0xb609('0x5b')],'updatedAt':_0x2c1ef8[_0xb609('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb609('0x25')](respondWithFilteredResult(_0x2fd745,_0x9642b))[_0xb609('0x45')](handleError(_0x2fd745,null));};exports['getTeams']=function(_0x2bb7e6,_0x4adb97,_0x34e32d){var _0x54a09d={};var _0x273fce={};var _0x3b0e81;var _0x2cac2b;return db[_0xb609('0x2c')][_0xb609('0x54')]({'where':{'id':_0x2bb7e6[_0xb609('0x47')]['id']}})[_0xb609('0x25')](handleEntityNotFound(_0x4adb97,null))['then'](function(_0x5d0ec3){if(_0x5d0ec3){_0x3b0e81=_0x5d0ec3;_0x273fce['model']=_['keys'](db['Team'][_0xb609('0x2d')]);_0x273fce[_0xb609('0x33')]=_[_0xb609('0x34')](_0x2bb7e6[_0xb609('0x33')]);_0x273fce[_0xb609('0x56')]=_[_0xb609('0x36')](_0x273fce[_0xb609('0x31')],_0x273fce[_0xb609('0x33')]);_0x54a09d['attributes']=_[_0xb609('0x36')](_0x273fce[_0xb609('0x31')],qs[_0xb609('0x37')](_0x2bb7e6[_0xb609('0x33')]['fields']));_0x54a09d['attributes']=_0x54a09d['attributes']['length']?_0x54a09d['attributes']:_0x273fce[_0xb609('0x31')];_0x54a09d[_0xb609('0x57')]=qs[_0xb609('0x3b')](_0x2bb7e6[_0xb609('0x33')][_0xb609('0x3b')]);_0x54a09d[_0xb609('0x3e')]=qs[_0xb609('0x56')](_[_0xb609('0x3c')](_0x2bb7e6[_0xb609('0x33')],_0x273fce['filters']));if(_0x2bb7e6[_0xb609('0x33')][_0xb609('0x3d')]){_0x54a09d[_0xb609('0x3e')]=_['merge'](_0x54a09d[_0xb609('0x3e')],{'$or':_[_0xb609('0x32')](_0x54a09d['attributes'],function(_0xd8bb22){var _0x12190b={};_0x12190b[_0xd8bb22]={'$like':'%'+_0x2bb7e6[_0xb609('0x33')][_0xb609('0x3d')]+'%'};return _0x12190b;})});}_0x54a09d=_['merge']({},_0x54a09d,_0x2bb7e6[_0xb609('0x41')]);return _0x3b0e81[_0xb609('0x5d')](_0x54a09d);}})[_0xb609('0x25')](function(_0x2b069b){if(_0x2b069b){_0x2cac2b=_0x2b069b[_0xb609('0x38')];if(!_0x2bb7e6[_0xb609('0x33')][_0xb609('0x39')](_0xb609('0x3a'))){_0x54a09d['limit']=qs[_0xb609('0x1e')](_0x2bb7e6['query'][_0xb609('0x1e')]);_0x54a09d[_0xb609('0x1c')]=qs[_0xb609('0x1c')](_0x2bb7e6[_0xb609('0x33')]['offset']);}return _0x3b0e81[_0xb609('0x5d')](_0x54a09d);}})[_0xb609('0x25')](function(_0x59b81f){if(_0x59b81f){return _0x59b81f?{'count':_0x2cac2b,'rows':_0x59b81f}:null;}})[_0xb609('0x25')](respondWithResult(_0x4adb97,null))['catch'](handleError(_0x4adb97,null));};exports[_0xb609('0x5e')]=function(_0x58ef9f,_0x5e13c8,_0x45050e){var _0x21fc07=_0x58ef9f[_0xb609('0x4a')][_0xb609('0x5f')];return db[_0xb609('0x60')]['findAll']({'where':{'id':_0x21fc07},'attributes':['id'],'include':[{'model':db[_0xb609('0x61')],'as':'Agents','attributes':['id',_0xb609('0x2b'),'online',_0xb609('0x62'),_0xb609('0x63')],'raw':!![]}]})[_0xb609('0x25')](function(_0x10871c){if(_0x10871c){var _0x427412=_[_0xb609('0x64')](_0x10871c,function(_0x34d845){var _0x4d3213=_0x34d845[_0xb609('0x26')]({'plain':!![]});return _0x4d3213['Agents'];});return db[_0xb609('0x2c')]['find']({'where':{'id':_0x58ef9f[_0xb609('0x47')]['id']}})[_0xb609('0x25')](function(_0x5c3503){return db[_0xb609('0x65')][_0xb609('0x66')](function(_0x3fe176){return _0x5c3503[_0xb609('0x5e')](_0x21fc07,{'transaction':_0x3fe176})[_0xb609('0x25')](function(){return BPromise[_0xb609('0x67')](_0x427412,function(_0x37cad0){return db['UserSmsQueue'][_0xb609('0x68')]({'where':{'UserId':_0x37cad0['id'],'SmsQueueId':_0x58ef9f['params']['id']},'transaction':_0x3fe176});});})['then'](function(){_0x427412[_0xb609('0x69')](function(_0xf7d75c){socket[_0xb609('0x6a')](_0xb609('0x6b'),{'UserId':_0xf7d75c['id'],'SmsQueueId':_0x5c3503['id']});});});});});}})[_0xb609('0x25')](respondWithStatusCode(_0x5e13c8,null))[_0xb609('0x45')](handleError(_0x5e13c8,null));};exports[_0xb609('0x6c')]=function(_0x52fc19,_0x5be0f1,_0x4d842b){return db['Team']['findAll']({'where':{'id':_0x52fc19[_0xb609('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb609('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb609('0x25')](handleEntityNotFound(_0x5be0f1,null))[_0xb609('0x25')](function(_0x53f44a){var _0x2f79d1=_[_0xb609('0x32')](_0x53f44a,'id');var _0x50d436=[];var _0x5a39e3=[];var _0x641ed3=squel[_0xb609('0x6d')]();_0x641ed3[_0xb609('0x6e')](_0xb609('0x6f'))[_0xb609('0x70')](_0xb609('0x71'),'tq')[_0xb609('0x72')]('user_has_teams','ut',_0xb609('0x73'))[_0xb609('0x3e')](_0xb609('0x74'),_0x52fc19[_0xb609('0x47')]['id']);for(var _0x425702=0x0;_0x425702<_0x53f44a[_0xb609('0x38')];_0x425702+=0x1){let _0x460568=_0x53f44a[_0x425702];for(var _0x1f043f=0x0;_0x1f043f<_0x460568[_0xb609('0x75')][_0xb609('0x38')];_0x1f043f+=0x1){let _0x9dd2cd=_0x460568[_0xb609('0x75')][_0x1f043f];var _0x4e4219=_0x641ed3[_0xb609('0x76')]();_0x4e4219[_0xb609('0x3e')]('ut.UserId\x20=\x20?',_0x9dd2cd['id']);_0x5a39e3['push'](db[_0xb609('0x65')][_0xb609('0x33')](_0x4e4219[_0xb609('0x77')](),{'type':db[_0xb609('0x65')][_0xb609('0x78')][_0xb609('0x79')]})[_0xb609('0x25')](function(_0x2a6e68){if(_0x2a6e68['length']===0x1){return _0x9dd2cd['id'];}else{var _0x3dc09d=_[_0xb609('0x7a')](_[_0xb609('0x32')](_0x2a6e68,_0xb609('0x7b')),function(_0x1648f4){return _[_0xb609('0x7c')](_0x2f79d1,_0x1648f4);});if(_0x3dc09d){return _0x9dd2cd['id'];}}}));}}return BPromise[_0xb609('0x7d')](_0x5a39e3)[_0xb609('0x25')](function(_0x43001f){_0x50d436=_(_0x50d436)['union'](_0x43001f)['compact']()[_0xb609('0x7e')]();return db[_0xb609('0x2c')][_0xb609('0x48')]({'where':{'id':_0x52fc19[_0xb609('0x47')]['id']}})[_0xb609('0x25')](function(_0x5c066d){return db['sequelize'][_0xb609('0x66')](function(_0x140f8c){return _0x5c066d['removeTeams'](_0x52fc19[_0xb609('0x33')][_0xb609('0x5f')],{'transaction':_0x140f8c})[_0xb609('0x25')](function(){if(!_[_0xb609('0x7f')](_0x50d436)){return _0x5c066d[_0xb609('0x80')](_0x50d436,{'transaction':_0x140f8c});}})['then'](function(){_0x50d436['forEach'](function(_0x509a06){socket['emit'](_0xb609('0x81'),{'UserId':_0x509a06,'SmsQueueId':_0x5c066d['id']});});});});});});})['then'](respondWithStatusCode(_0x5be0f1,null))[_0xb609('0x45')](handleError(_0x5be0f1,null));};exports[_0xb609('0x82')]=function(_0x4299d0,_0x3fbb97,_0x259b49){return db[_0xb609('0x2c')]['find']({'where':{'id':_0x4299d0[_0xb609('0x47')]['id']}})[_0xb609('0x25')](handleEntityNotFound(_0x3fbb97,null))['then'](function(_0x58f2f3){if(_0x58f2f3){return _0x58f2f3[_0xb609('0x82')](_0x4299d0[_0xb609('0x4a')][_0xb609('0x5f')],_['omit'](_0x4299d0[_0xb609('0x4a')],[_0xb609('0x5f'),'id'])||{})[_0xb609('0x83')](function(_0x3de06d){for(var _0x3af5d1=0x0;_0x3af5d1<_0x4299d0[_0xb609('0x4a')][_0xb609('0x5f')][_0xb609('0x38')];_0x3af5d1+=0x1){socket[_0xb609('0x6a')](_0xb609('0x6b'),{'UserId':Number(_0x4299d0[_0xb609('0x4a')][_0xb609('0x5f')][_0x3af5d1]),'SmsQueueId':Number(_0x4299d0['params']['id'])});}return _0x3de06d;});}})['then'](respondWithResult(_0x3fbb97,null))[_0xb609('0x45')](handleError(_0x3fbb97,null));};exports[_0xb609('0x80')]=function(_0x526df7,_0x484fb0,_0x332182){return db[_0xb609('0x2c')]['find']({'where':{'id':_0x526df7['params']['id']}})['then'](handleEntityNotFound(_0x484fb0,null))[_0xb609('0x25')](function(_0x1534db){if(_0x1534db){return _0x1534db['removeAgents'](_0x526df7[_0xb609('0x33')][_0xb609('0x5f')])[_0xb609('0x25')](function(){if(_[_0xb609('0x84')](_0x526df7[_0xb609('0x33')][_0xb609('0x5f')])){for(var _0x1ee6eb=0x0;_0x1ee6eb<_0x526df7[_0xb609('0x33')]['ids'][_0xb609('0x38')];_0x1ee6eb+=0x1){socket[_0xb609('0x6a')](_0xb609('0x81'),{'UserId':Number(_0x526df7[_0xb609('0x33')][_0xb609('0x5f')][_0x1ee6eb]),'SmsQueueId':Number(_0x526df7[_0xb609('0x47')]['id'])});}}else{socket['emit'](_0xb609('0x81'),{'UserId':Number(_0x526df7['query'][_0xb609('0x5f')]),'SmsQueueId':Number(_0x526df7[_0xb609('0x47')]['id'])});}});}})[_0xb609('0x25')](respondWithStatusCode(_0x484fb0,null))[_0xb609('0x45')](handleError(_0x484fb0,null));};exports[_0xb609('0x85')]=function(_0x3a0670,_0x3c02db,_0x13cc8d){var _0x418d36={};var _0x2be4f5={};var _0x138a9b;var _0xe98471;return db[_0xb609('0x2c')]['findOne']({'where':{'id':_0x3a0670[_0xb609('0x47')]['id']}})[_0xb609('0x25')](handleEntityNotFound(_0x3c02db,null))[_0xb609('0x25')](function(_0x54b31f){if(_0x54b31f){_0x138a9b=_0x54b31f;_0x2be4f5['model']=_[_0xb609('0x34')](db[_0xb609('0x61')][_0xb609('0x2d')]);_0x2be4f5[_0xb609('0x33')]=_[_0xb609('0x34')](_0x3a0670[_0xb609('0x33')]);_0x2be4f5[_0xb609('0x56')]=_[_0xb609('0x36')](_0x2be4f5[_0xb609('0x31')],_0x2be4f5[_0xb609('0x33')]);_0x418d36[_0xb609('0x35')]=_['intersection'](_0x2be4f5[_0xb609('0x31')],qs['fields'](_0x3a0670[_0xb609('0x33')][_0xb609('0x37')]));_0x418d36[_0xb609('0x35')]=_0x418d36[_0xb609('0x35')][_0xb609('0x38')]?_0x418d36['attributes']:_0x2be4f5[_0xb609('0x31')];_0x418d36['order']=qs[_0xb609('0x3b')](_0x3a0670[_0xb609('0x33')][_0xb609('0x3b')]);_0x418d36[_0xb609('0x3e')]=qs[_0xb609('0x56')](_[_0xb609('0x3c')](_0x3a0670[_0xb609('0x33')],_0x2be4f5[_0xb609('0x56')]));if(_0x3a0670[_0xb609('0x33')]['filter']){_0x418d36['where']=_[_0xb609('0x40')](_0x418d36[_0xb609('0x3e')],{'$or':_[_0xb609('0x32')](_0x418d36[_0xb609('0x35')],function(_0xabe43f){var _0xdb62bd={};_0xdb62bd[_0xabe43f]={'$like':'%'+_0x3a0670[_0xb609('0x33')][_0xb609('0x3d')]+'%'};return _0xdb62bd;})});}_0x418d36=_['merge']({},_0x418d36,_0x3a0670['options']);return _0x138a9b[_0xb609('0x85')](_0x418d36);}})['then'](function(_0x2c4995){if(_0x2c4995){_0xe98471=_0x2c4995[_0xb609('0x38')];if(!_0x3a0670[_0xb609('0x33')][_0xb609('0x39')]('nolimit')){_0x418d36[_0xb609('0x1e')]=qs[_0xb609('0x1e')](_0x3a0670[_0xb609('0x33')]['limit']);_0x418d36[_0xb609('0x1c')]=qs[_0xb609('0x1c')](_0x3a0670[_0xb609('0x33')][_0xb609('0x1c')]);}return _0x138a9b[_0xb609('0x85')](_0x418d36);}})[_0xb609('0x25')](function(_0x157e75){if(_0x157e75){return _0x157e75?{'count':_0xe98471,'rows':_0x157e75}:null;}})['then'](respondWithResult(_0x3c02db,null))['catch'](handleError(_0x3c02db,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index bb145f0..8585e57 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 _0x0fef=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x31fc0f,_0x40478e){var _0x47acec=function(_0x1985f9){while(--_0x1985f9){_0x31fc0f['push'](_0x31fc0f['shift']());}};_0x47acec(++_0x40478e);}(_0x0fef,0xca));var _0xf0fe=function(_0x2a7d57,_0x27a648){_0x2a7d57=_0x2a7d57-0x0;var _0x5daa90=_0x0fef[_0x2a7d57];return _0x5daa90;};'use strict';var EventEmitter=require(_0xf0fe('0x0'));var SmsQueue=require(_0xf0fe('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf0fe('0x2')](0x0);var events={'afterCreate':_0xf0fe('0x3'),'afterUpdate':_0xf0fe('0x4'),'afterDestroy':_0xf0fe('0x5')};function emitEvent(_0x84a2c4){return function(_0x4019a6,_0x5f3a80,_0x32b716){SmsQueueEvents[_0xf0fe('0x6')](_0x84a2c4+':'+_0x4019a6['id'],_0x4019a6);SmsQueueEvents[_0xf0fe('0x6')](_0x84a2c4,_0x4019a6);_0x32b716(null);};}for(var e in events){if(events[_0xf0fe('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xf0fe('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0xa16e=['emit','hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners','save','remove'];(function(_0x109861,_0x1dec8a){var _0x1befb3=function(_0x357030){while(--_0x357030){_0x109861['push'](_0x109861['shift']());}};_0x1befb3(++_0x1dec8a);}(_0xa16e,0xd3));var _0xea16=function(_0x5acb1f,_0x420ecf){_0x5acb1f=_0x5acb1f-0x0;var _0x2f97de=_0xa16e[_0x5acb1f];return _0x2f97de;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xea16('0x0'))['db'][_0xea16('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xea16('0x2')](0x0);var events={'afterCreate':_0xea16('0x3'),'afterUpdate':'update','afterDestroy':_0xea16('0x4')};function emitEvent(_0x57d04f){return function(_0x4ab6d8,_0x43b971,_0xc08331){SmsQueueEvents[_0xea16('0x5')](_0x57d04f+':'+_0x4ab6d8['id'],_0x4ab6d8);SmsQueueEvents['emit'](_0x57d04f,_0x4ab6d8);_0xc08331(null);};}for(var e in events){if(events[_0xea16('0x6')](e)){var event=events[e];SmsQueue[_0xea16('0x7')](e,emitEvent(event));}}module[_0xea16('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index a0337cb..c69b280 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 _0xfdeb=['lodash','util','moment','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xfdeb,0x197));var _0xbfde=function(_0x2b4448,_0x5bcc69){_0x2b4448=_0x2b4448-0x0;var _0xb4b465=_0xfdeb[_0x2b4448];return _0xb4b465;};'use strict';var _=require(_0xbfde('0x0'));var util=require(_0xbfde('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbfde('0x2'));var BPromise=require(_0xbfde('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfde('0x4'));var rimraf=require(_0xbfde('0x5'));var config=require(_0xbfde('0x6'));var attributes=require(_0xbfde('0x7'));module[_0xbfde('0x8')]=function(_0x5d73dc,_0x376634){return _0x5d73dc[_0xbfde('0x9')](_0xbfde('0xa'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa084=['bluebird','path','../../config/environment','define','SmsQueue','lodash','util','../../config/logger','api','moment'];(function(_0xfd8e00,_0x2e2928){var _0x315f8e=function(_0x51ee5c){while(--_0x51ee5c){_0xfd8e00['push'](_0xfd8e00['shift']());}};_0x315f8e(++_0x2e2928);}(_0xa084,0xe1));var _0x4a08=function(_0x31e8f1,_0xb5b06f){_0x31e8f1=_0x31e8f1-0x0;var _0x3f8b14=_0xa084[_0x31e8f1];return _0x3f8b14;};'use strict';var _=require(_0x4a08('0x0'));var util=require(_0x4a08('0x1'));var logger=require(_0x4a08('0x2'))(_0x4a08('0x3'));var moment=require(_0x4a08('0x4'));var BPromise=require(_0x4a08('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a08('0x6'));var rimraf=require('rimraf');var config=require(_0x4a08('0x7'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x421f55,_0x537561){return _0x421f55[_0x4a08('0x8')](_0x4a08('0x9'),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 0d39df7..a616091 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 _0xa671=['then','GetSmsQueue','stringify','where','ShowSmsQueue','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','SmsQueue,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','findAll','options','attributes','limit','include','map','model'];(function(_0x3c504b,_0x437693){var _0x2e5354=function(_0x456709){while(--_0x456709){_0x3c504b['push'](_0x3c504b['shift']());}};_0x2e5354(++_0x437693);}(_0xa671,0x153));var _0x1a67=function(_0x3c0e23,_0x137648){_0x3c0e23=_0x3c0e23-0x0;var _0x59850f=_0xa671[_0x3c0e23];return _0x59850f;};'use strict';var _=require('lodash');var util=require(_0x1a67('0x0'));var moment=require(_0x1a67('0x1'));var BPromise=require(_0x1a67('0x2'));var rs=require(_0x1a67('0x3'));var fs=require('fs');var Redis=require(_0x1a67('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a67('0x5'));var logger=require(_0x1a67('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1a67('0x7'));var client=jayson[_0x1a67('0x8')][_0x1a67('0x9')]({'port':0x232a});config[_0x1a67('0xa')]=_[_0x1a67('0xb')](config[_0x1a67('0xa')],{'host':_0x1a67('0xc'),'port':0x18eb});var socket=require(_0x1a67('0xd'))(new Redis(config[_0x1a67('0xa')]));require('./smsQueue.socket')[_0x1a67('0xe')](socket);function respondWithRpcPromise(_0x27c247,_0x4e0f0b,_0x9370ab){return new BPromise(function(_0x4415b4,_0xe5ba49){return client[_0x1a67('0xf')](_0x27c247,_0x9370ab)['then'](function(_0xf9395){logger[_0x1a67('0x10')](_0x1a67('0x11'),_0x4e0f0b,'request\x20sent');logger[_0x1a67('0x12')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x4e0f0b,'request\x20sent',JSON['stringify'](_0xf9395));if(_0xf9395[_0x1a67('0x13')]){if(_0xf9395[_0x1a67('0x13')][_0x1a67('0x14')]===0x1f4){logger[_0x1a67('0x13')](_0x1a67('0x11'),_0x4e0f0b,_0xf9395[_0x1a67('0x13')][_0x1a67('0x15')]);return _0xe5ba49(_0xf9395['error'][_0x1a67('0x15')]);}logger['error'](_0x1a67('0x11'),_0x4e0f0b,_0xf9395['error'][_0x1a67('0x15')]);return _0x4415b4(_0xf9395['error'][_0x1a67('0x15')]);}else{logger[_0x1a67('0x10')](_0x1a67('0x11'),_0x4e0f0b,_0x1a67('0x16'));_0x4415b4(_0xf9395[_0x1a67('0x17')][_0x1a67('0x15')]);}})['catch'](function(_0x433e65){logger[_0x1a67('0x13')](_0x1a67('0x11'),_0x4e0f0b,_0x433e65);_0xe5ba49(_0x433e65);});});}exports['GetSmsQueue']=function(_0x258146){var _0x365c2f=this;return new Promise(function(_0x1baf8f,_0x76a3ae){return db['SmsQueue'][_0x1a67('0x18')]({'raw':_0x258146['options']?_0x258146['options']['raw']===undefined?!![]:![]:!![],'where':_0x258146[_0x1a67('0x19')]?_0x258146[_0x1a67('0x19')]['where']||null:null,'attributes':_0x258146[_0x1a67('0x19')]?_0x258146[_0x1a67('0x19')][_0x1a67('0x1a')]||null:null,'limit':_0x258146[_0x1a67('0x19')]?_0x258146[_0x1a67('0x19')][_0x1a67('0x1b')]||null:null,'include':_0x258146['options']?_0x258146[_0x1a67('0x19')][_0x1a67('0x1c')]?_[_0x1a67('0x1d')](_0x258146[_0x1a67('0x19')]['include'],function(_0x19e145){return{'model':db[_0x19e145[_0x1a67('0x1e')]],'as':_0x19e145['as'],'attributes':_0x19e145[_0x1a67('0x1a')],'include':_0x19e145[_0x1a67('0x1c')]?_[_0x1a67('0x1d')](_0x19e145['include'],function(_0x3b7a16){return{'model':db[_0x3b7a16[_0x1a67('0x1e')]],'as':_0x3b7a16['as'],'attributes':_0x3b7a16[_0x1a67('0x1a')],'include':_0x3b7a16[_0x1a67('0x1c')]?_[_0x1a67('0x1d')](_0x3b7a16[_0x1a67('0x1c')],function(_0xed79ad){return{'model':db[_0xed79ad[_0x1a67('0x1e')]],'as':_0xed79ad['as'],'attributes':_0xed79ad[_0x1a67('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1a67('0x1f')](function(_0x474e07){logger[_0x1a67('0x10')](_0x1a67('0x20'),_0x258146);logger[_0x1a67('0x12')](_0x1a67('0x20'),_0x258146,JSON[_0x1a67('0x21')](_0x474e07));_0x1baf8f(_0x474e07);})['catch'](function(_0x303512){logger['error'](_0x1a67('0x20'),_0x303512[_0x1a67('0x15')],_0x258146);_0x76a3ae(_0x365c2f[_0x1a67('0x13')](0x1f4,_0x303512['message']));});});};exports['ShowSmsQueue']=function(_0x26b0d2){var _0x51aafd=this;return new Promise(function(_0x3fd7b0,_0x19292d){return db['SmsQueue']['find']({'raw':_0x26b0d2[_0x1a67('0x19')]?_0x26b0d2[_0x1a67('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x26b0d2[_0x1a67('0x19')]?_0x26b0d2[_0x1a67('0x19')][_0x1a67('0x22')]||null:null,'attributes':_0x26b0d2['options']?_0x26b0d2[_0x1a67('0x19')][_0x1a67('0x1a')]||null:null,'include':_0x26b0d2[_0x1a67('0x19')]?_0x26b0d2[_0x1a67('0x19')]['include']?_[_0x1a67('0x1d')](_0x26b0d2['options'][_0x1a67('0x1c')],function(_0x5d3e81){return{'model':db[_0x5d3e81[_0x1a67('0x1e')]],'as':_0x5d3e81['as'],'attributes':_0x5d3e81[_0x1a67('0x1a')],'include':_0x5d3e81[_0x1a67('0x1c')]?_[_0x1a67('0x1d')](_0x5d3e81[_0x1a67('0x1c')],function(_0x4f43ed){return{'model':db[_0x4f43ed[_0x1a67('0x1e')]],'as':_0x4f43ed['as'],'attributes':_0x4f43ed['attributes'],'include':_0x4f43ed['include']?_['map'](_0x4f43ed[_0x1a67('0x1c')],function(_0x443392){return{'model':db[_0x443392[_0x1a67('0x1e')]],'as':_0x443392['as'],'attributes':_0x443392[_0x1a67('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x221cca){logger['info'](_0x1a67('0x23'),_0x26b0d2);logger[_0x1a67('0x12')](_0x1a67('0x23'),_0x26b0d2,JSON['stringify'](_0x221cca));_0x3fd7b0(_0x221cca);})[_0x1a67('0x24')](function(_0x1f60f2){logger[_0x1a67('0x13')](_0x1a67('0x23'),_0x1f60f2[_0x1a67('0x15')],_0x26b0d2);_0x19292d(_0x51aafd[_0x1a67('0x13')](0x1f4,_0x1f60f2[_0x1a67('0x15')]));});});}; \ No newline at end of file +var _0x75d6=['find','where','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','./smsQueue.socket','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','SmsQueue','findAll','options','raw','attributes','include','map','model','GetSmsQueue','catch','ShowSmsQueue'];(function(_0x496220,_0x2f748d){var _0x1fc9c0=function(_0x10e7c3){while(--_0x10e7c3){_0x496220['push'](_0x496220['shift']());}};_0x1fc9c0(++_0x2f748d);}(_0x75d6,0x9a));var _0x675d=function(_0x27c24e,_0x5db1c7){_0x27c24e=_0x27c24e-0x0;var _0x39004a=_0x75d6[_0x27c24e];return _0x39004a;};'use strict';var _=require(_0x675d('0x0'));var util=require(_0x675d('0x1'));var moment=require(_0x675d('0x2'));var BPromise=require('bluebird');var rs=require(_0x675d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x675d('0x4'))['db'];var utils=require(_0x675d('0x5'));var logger=require(_0x675d('0x6'))(_0x675d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x675d('0x8')][_0x675d('0x9')]({'port':0x232a});config[_0x675d('0xa')]=_[_0x675d('0xb')](config[_0x675d('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x675d('0xa')]));require(_0x675d('0xc'))[_0x675d('0xd')](socket);function respondWithRpcPromise(_0x4315e1,_0x40d8fe,_0x45d56f){return new BPromise(function(_0x3bdeb7,_0x62bb3b){return client['request'](_0x4315e1,_0x45d56f)[_0x675d('0xe')](function(_0x36ef08){logger[_0x675d('0xf')](_0x675d('0x10'),_0x40d8fe,_0x675d('0x11'));logger[_0x675d('0x12')](_0x675d('0x13'),_0x40d8fe,_0x675d('0x11'),JSON[_0x675d('0x14')](_0x36ef08));if(_0x36ef08[_0x675d('0x15')]){if(_0x36ef08[_0x675d('0x15')][_0x675d('0x16')]===0x1f4){logger[_0x675d('0x15')](_0x675d('0x10'),_0x40d8fe,_0x36ef08[_0x675d('0x15')][_0x675d('0x17')]);return _0x62bb3b(_0x36ef08[_0x675d('0x15')][_0x675d('0x17')]);}logger[_0x675d('0x15')](_0x675d('0x10'),_0x40d8fe,_0x36ef08['error'][_0x675d('0x17')]);return _0x3bdeb7(_0x36ef08[_0x675d('0x15')][_0x675d('0x17')]);}else{logger['info'](_0x675d('0x10'),_0x40d8fe,_0x675d('0x11'));_0x3bdeb7(_0x36ef08[_0x675d('0x18')][_0x675d('0x17')]);}})['catch'](function(_0x50cdd2){logger['error'](_0x675d('0x10'),_0x40d8fe,_0x50cdd2);_0x62bb3b(_0x50cdd2);});});}exports['GetSmsQueue']=function(_0x4dc9e8){var _0x11a6e2=this;return new Promise(function(_0x41a192,_0x17ba2d){return db[_0x675d('0x19')][_0x675d('0x1a')]({'raw':_0x4dc9e8[_0x675d('0x1b')]?_0x4dc9e8['options'][_0x675d('0x1c')]===undefined?!![]:![]:!![],'where':_0x4dc9e8[_0x675d('0x1b')]?_0x4dc9e8[_0x675d('0x1b')]['where']||null:null,'attributes':_0x4dc9e8[_0x675d('0x1b')]?_0x4dc9e8[_0x675d('0x1b')][_0x675d('0x1d')]||null:null,'limit':_0x4dc9e8['options']?_0x4dc9e8[_0x675d('0x1b')]['limit']||null:null,'include':_0x4dc9e8[_0x675d('0x1b')]?_0x4dc9e8[_0x675d('0x1b')][_0x675d('0x1e')]?_['map'](_0x4dc9e8[_0x675d('0x1b')][_0x675d('0x1e')],function(_0x1f3311){return{'model':db[_0x1f3311['model']],'as':_0x1f3311['as'],'attributes':_0x1f3311['attributes'],'include':_0x1f3311['include']?_[_0x675d('0x1f')](_0x1f3311[_0x675d('0x1e')],function(_0x6f117a){return{'model':db[_0x6f117a[_0x675d('0x20')]],'as':_0x6f117a['as'],'attributes':_0x6f117a[_0x675d('0x1d')],'include':_0x6f117a['include']?_[_0x675d('0x1f')](_0x6f117a[_0x675d('0x1e')],function(_0x3f0074){return{'model':db[_0x3f0074['model']],'as':_0x3f0074['as'],'attributes':_0x3f0074[_0x675d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x675d('0xe')](function(_0x1defa4){logger[_0x675d('0xf')](_0x675d('0x21'),_0x4dc9e8);logger[_0x675d('0x12')](_0x675d('0x21'),_0x4dc9e8,JSON[_0x675d('0x14')](_0x1defa4));_0x41a192(_0x1defa4);})[_0x675d('0x22')](function(_0x4238b7){logger[_0x675d('0x15')](_0x675d('0x21'),_0x4238b7['message'],_0x4dc9e8);_0x17ba2d(_0x11a6e2['error'](0x1f4,_0x4238b7[_0x675d('0x17')]));});});};exports[_0x675d('0x23')]=function(_0x476ecf){var _0x476052=this;return new Promise(function(_0x5aa464,_0x2b12a6){return db[_0x675d('0x19')][_0x675d('0x24')]({'raw':_0x476ecf[_0x675d('0x1b')]?_0x476ecf[_0x675d('0x1b')][_0x675d('0x1c')]===undefined?!![]:![]:!![],'where':_0x476ecf[_0x675d('0x1b')]?_0x476ecf[_0x675d('0x1b')][_0x675d('0x25')]||null:null,'attributes':_0x476ecf[_0x675d('0x1b')]?_0x476ecf[_0x675d('0x1b')][_0x675d('0x1d')]||null:null,'include':_0x476ecf['options']?_0x476ecf[_0x675d('0x1b')][_0x675d('0x1e')]?_[_0x675d('0x1f')](_0x476ecf['options'][_0x675d('0x1e')],function(_0x37a3fd){return{'model':db[_0x37a3fd[_0x675d('0x20')]],'as':_0x37a3fd['as'],'attributes':_0x37a3fd[_0x675d('0x1d')],'include':_0x37a3fd['include']?_[_0x675d('0x1f')](_0x37a3fd[_0x675d('0x1e')],function(_0x5cdced){return{'model':db[_0x5cdced[_0x675d('0x20')]],'as':_0x5cdced['as'],'attributes':_0x5cdced[_0x675d('0x1d')],'include':_0x5cdced[_0x675d('0x1e')]?_[_0x675d('0x1f')](_0x5cdced['include'],function(_0x56b47d){return{'model':db[_0x56b47d[_0x675d('0x20')]],'as':_0x56b47d['as'],'attributes':_0x56b47d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x130738){logger['info'](_0x675d('0x23'),_0x476ecf);logger[_0x675d('0x12')](_0x675d('0x23'),_0x476ecf,JSON[_0x675d('0x14')](_0x130738));_0x5aa464(_0x130738);})[_0x675d('0x22')](function(_0x2e7def){logger['error'](_0x675d('0x23'),_0x2e7def[_0x675d('0x17')],_0x476ecf);_0x2b12a6(_0x476052['error'](0x1f4,_0x2e7def[_0x675d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 1b067e3..2ee7831 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 _0x4fb0=['./smsQueue.events','remove','update','emit','removeListener','length','smsQueue:'];(function(_0x1df1dc,_0x4f1066){var _0xee0e16=function(_0x253fe4){while(--_0x253fe4){_0x1df1dc['push'](_0x1df1dc['shift']());}};_0xee0e16(++_0x4f1066);}(_0x4fb0,0x1c7));var _0x04fb=function(_0x4209ae,_0x12750b){_0x4209ae=_0x4209ae-0x0;var _0x597f0e=_0x4fb0[_0x4209ae];return _0x597f0e;};'use strict';var SmsQueueEvents=require(_0x04fb('0x0'));var events=['save',_0x04fb('0x1'),_0x04fb('0x2')];function createListener(_0x17ae8d,_0x551428){return function(_0x4a0cda){_0x551428[_0x04fb('0x3')](_0x17ae8d,_0x4a0cda);};}function removeListener(_0xb45169,_0x4ffcf1){return function(){SmsQueueEvents[_0x04fb('0x4')](_0xb45169,_0x4ffcf1);};}exports['register']=function(_0x32392b){for(var _0x5ded35=0x0,_0x10620c=events[_0x04fb('0x5')];_0x5ded35<_0x10620c;_0x5ded35++){var _0x3529b5=events[_0x5ded35];var _0x49c223=createListener(_0x04fb('0x6')+_0x3529b5,_0x32392b);SmsQueueEvents['on'](_0x3529b5,_0x49c223);}}; \ No newline at end of file +var _0x8ccf=['save','remove','update','emit','removeListener','register','length','smsQueue:','./smsQueue.events'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0x8ccf,0x104));var _0xf8cc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8ccf[_0x2dafbe];return _0x58a45a;};'use strict';var SmsQueueEvents=require(_0xf8cc('0x0'));var events=[_0xf8cc('0x1'),_0xf8cc('0x2'),_0xf8cc('0x3')];function createListener(_0x375dd1,_0x77e051){return function(_0x30465){_0x77e051[_0xf8cc('0x4')](_0x375dd1,_0x30465);};}function removeListener(_0x13622f,_0x221cf8){return function(){SmsQueueEvents[_0xf8cc('0x5')](_0x13622f,_0x221cf8);};}exports[_0xf8cc('0x6')]=function(_0x33e21a){for(var _0x3053fa=0x0,_0x313d46=events[_0xf8cc('0x7')];_0x3053fa<_0x313d46;_0x3053fa++){var _0x28c0f1=events[_0x3053fa];var _0x452db4=createListener(_0xf8cc('0x8')+_0x28c0f1,_0x33e21a);SmsQueueEvents['on'](_0x28c0f1,_0x452db4);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 708c684..aea69ba 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 _0x2624=['index','get','/describe','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller'];(function(_0xf23ea1,_0x2ef317){var _0x1e1bce=function(_0x52e9e2){while(--_0x52e9e2){_0xf23ea1['push'](_0xf23ea1['shift']());}};_0x1e1bce(++_0x2ef317);}(_0x2624,0x75));var _0x4262=function(_0x18bb75,_0x1a8305){_0x18bb75=_0x18bb75-0x0;var _0x14be67=_0x2624[_0x18bb75];return _0x14be67;};'use strict';var multer=require(_0x4262('0x0'));var util=require(_0x4262('0x1'));var path=require('path');var timeout=require(_0x4262('0x2'));var express=require(_0x4262('0x3'));var router=express[_0x4262('0x4')]();var fs_extra=require(_0x4262('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4262('0x6'));var config=require(_0x4262('0x7'));var controller=require(_0x4262('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4262('0x9')]);router[_0x4262('0xa')](_0x4262('0xb'),auth[_0x4262('0xc')](),controller['describe']);router['get'](_0x4262('0xd'),auth[_0x4262('0xc')](),controller[_0x4262('0xe')]);router[_0x4262('0xf')]('/',auth[_0x4262('0xc')](),controller[_0x4262('0x10')]);router[_0x4262('0x11')](_0x4262('0xd'),auth[_0x4262('0xc')](),controller[_0x4262('0x12')]);router['delete']('/:id',auth[_0x4262('0xc')](),controller[_0x4262('0x13')]);module[_0x4262('0x14')]=router; \ No newline at end of file +var _0xad91=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','multer'];(function(_0x507d4f,_0x2e4903){var _0x1fe97f=function(_0x8fffed){while(--_0x8fffed){_0x507d4f['push'](_0x507d4f['shift']());}};_0x1fe97f(++_0x2e4903);}(_0xad91,0xd0));var _0x1ad9=function(_0x7767c3,_0x4825ac){_0x7767c3=_0x7767c3-0x0;var _0x1f22a1=_0xad91[_0x7767c3];return _0x1f22a1;};'use strict';var multer=require(_0x1ad9('0x0'));var util=require(_0x1ad9('0x1'));var path=require(_0x1ad9('0x2'));var timeout=require(_0x1ad9('0x3'));var express=require('express');var router=express[_0x1ad9('0x4')]();var fs_extra=require(_0x1ad9('0x5'));var auth=require(_0x1ad9('0x6'));var interaction=require(_0x1ad9('0x7'));var config=require(_0x1ad9('0x8'));var controller=require(_0x1ad9('0x9'));router[_0x1ad9('0xa')]('/',auth[_0x1ad9('0xb')](),controller[_0x1ad9('0xc')]);router[_0x1ad9('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x1ad9('0xa')](_0x1ad9('0xd'),auth[_0x1ad9('0xb')](),controller['show']);router[_0x1ad9('0xe')]('/',auth[_0x1ad9('0xb')](),controller[_0x1ad9('0xf')]);router['put'](_0x1ad9('0xd'),auth[_0x1ad9('0xb')](),controller[_0x1ad9('0x10')]);router[_0x1ad9('0x11')](_0x1ad9('0xd'),auth[_0x1ad9('0xb')](),controller[_0x1ad9('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 97b4468..04644bd 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 _0xd60b=['sequelize','STRING','DATE'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xd60b,0x198));var _0xbd60=function(_0x2c770a,_0x46a906){_0x2c770a=_0x2c770a-0x0;var _0x2e9930=_0xd60b[_0x2c770a];return _0x2e9930;};'use strict';var moment=require('moment');var Sequelize=require(_0xbd60('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xbd60('0x1')]},'joinAt':{'type':Sequelize[_0xbd60('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xbd60('0x2')]},'exitAt':{'type':Sequelize[_0xbd60('0x2')]},'reason':{'type':Sequelize[_0xbd60('0x1')]}}; \ No newline at end of file +var _0x35c8=['STRING','DATE','exports'];(function(_0x996bc8,_0x291e01){var _0x20b0ea=function(_0x5ba992){while(--_0x5ba992){_0x996bc8['push'](_0x996bc8['shift']());}};_0x20b0ea(++_0x291e01);}(_0x35c8,0x125));var _0x835c=function(_0x1f6d79,_0x2a57a4){_0x1f6d79=_0x1f6d79-0x0;var _0x4b5fb3=_0x35c8[_0x1f6d79];return _0x4b5fb3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x835c('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x835c('0x1')]},'joinAt':{'type':Sequelize[_0x835c('0x2')]},'leaveAt':{'type':Sequelize[_0x835c('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x835c('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 12f6e71..a5d1fcd 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 _0xd0f7=['Content-Range','json','apply','reject','save','update','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','SmsQueueReport','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','limit','undefined','count','offset','set'];(function(_0x217542,_0x15cc22){var _0x4bb071=function(_0x5f471b){while(--_0x5f471b){_0x217542['push'](_0x217542['shift']());}};_0x4bb071(++_0x15cc22);}(_0xd0f7,0x1b8));var _0x7d0f=function(_0x14f1d7,_0x5ae07d){_0x14f1d7=_0x14f1d7-0x0;var _0x294aa4=_0xd0f7[_0x14f1d7];return _0x294aa4;};'use strict';var emlformat=require(_0x7d0f('0x0'));var rimraf=require(_0x7d0f('0x1'));var zipdir=require(_0x7d0f('0x2'));var jsonpatch=require(_0x7d0f('0x3'));var rp=require(_0x7d0f('0x4'));var moment=require(_0x7d0f('0x5'));var BPromise=require(_0x7d0f('0x6'));var Mustache=require(_0x7d0f('0x7'));var util=require(_0x7d0f('0x8'));var path=require(_0x7d0f('0x9'));var sox=require(_0x7d0f('0xa'));var csv=require('to-csv');var ejs=require(_0x7d0f('0xb'));var fs=require('fs');var fs_extra=require(_0x7d0f('0xc'));var _=require(_0x7d0f('0xd'));var squel=require(_0x7d0f('0xe'));var crypto=require(_0x7d0f('0xf'));var jsforce=require(_0x7d0f('0x10'));var deskjs=require(_0x7d0f('0x11'));var toCsv=require('to-csv');var querystring=require(_0x7d0f('0x12'));var Papa=require('papaparse');var Redis=require(_0x7d0f('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7d0f('0x14'));var hardwareService=require(_0x7d0f('0x15'));var logger=require(_0x7d0f('0x16'))(_0x7d0f('0x17'));var utils=require(_0x7d0f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7d0f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e4bd0,_0x2ce7ba){_0x2ce7ba=_0x2ce7ba||0xcc;return function(_0x5db9d9){if(_0x5db9d9){return _0x5e4bd0[_0x7d0f('0x1a')](_0x2ce7ba);}return _0x5e4bd0[_0x7d0f('0x1b')](_0x2ce7ba)[_0x7d0f('0x1c')]();};}function respondWithResult(_0x4427f3,_0x2063cf){_0x2063cf=_0x2063cf||0xc8;return function(_0x299881){if(_0x299881){return _0x4427f3[_0x7d0f('0x1b')](_0x2063cf)['json'](_0x299881);}};}function respondWithFilteredResult(_0x99b241,_0x48bca5){return function(_0x3bb973){if(_0x3bb973){var _0x4d9aec=typeof _0x48bca5['offset']==='undefined'&&typeof _0x48bca5[_0x7d0f('0x1d')]===_0x7d0f('0x1e');var _0xaadbb1=_0x3bb973[_0x7d0f('0x1f')];var _0x5f23fc=_0x4d9aec?0x0:_0x48bca5[_0x7d0f('0x20')];var _0x2922d1=_0x4d9aec?_0x3bb973[_0x7d0f('0x1f')]:_0x48bca5[_0x7d0f('0x20')]+_0x48bca5['limit'];var _0x2ee525;if(_0x2922d1>=_0xaadbb1){_0x2922d1=_0xaadbb1;_0x2ee525=0xc8;}else{_0x2ee525=0xce;}_0x99b241[_0x7d0f('0x1b')](_0x2ee525);return _0x99b241[_0x7d0f('0x21')](_0x7d0f('0x22'),_0x5f23fc+'-'+_0x2922d1+'/'+_0xaadbb1)[_0x7d0f('0x23')](_0x3bb973);}return null;};}function patchUpdates(_0x46e32b){return function(_0x47c663){try{jsonpatch[_0x7d0f('0x24')](_0x47c663,_0x46e32b,!![]);}catch(_0x8d923c){return BPromise[_0x7d0f('0x25')](_0x8d923c);}return _0x47c663[_0x7d0f('0x26')]();};}function saveUpdates(_0x253e25,_0x2f9dcc){return function(_0x4377ae){if(_0x4377ae){return _0x4377ae[_0x7d0f('0x27')](_0x253e25)[_0x7d0f('0x28')](function(_0x1132fa){return _0x1132fa;});}return null;};}function removeEntity(_0x3dcb96,_0xaed8d1){return function(_0x1634e5){if(_0x1634e5){return _0x1634e5['destroy']()['then'](function(){_0x3dcb96[_0x7d0f('0x1b')](0xcc)[_0x7d0f('0x1c')]();});}};}function handleEntityNotFound(_0x44879a,_0x247435){return function(_0x47c734){if(!_0x47c734){_0x44879a[_0x7d0f('0x1a')](0x194);}return _0x47c734;};}function handleError(_0x59b187,_0x5c27e6){_0x5c27e6=_0x5c27e6||0x1f4;return function(_0x45bb05){logger['error'](_0x45bb05[_0x7d0f('0x29')]);if(_0x45bb05[_0x7d0f('0x2a')]){delete _0x45bb05[_0x7d0f('0x2a')];}_0x59b187[_0x7d0f('0x1b')](_0x5c27e6)[_0x7d0f('0x2b')](_0x45bb05);};}exports[_0x7d0f('0x2c')]=function(_0x4be02d,_0x50be46){var _0x3c0466={},_0x1fc7eb={},_0x5bc9d7={'count':0x0,'rows':[]};var _0x9d436b=_['map'](db['SmsQueueReport'][_0x7d0f('0x2d')],function(_0x1a5672){return{'name':_0x1a5672[_0x7d0f('0x2e')],'type':_0x1a5672[_0x7d0f('0x2f')][_0x7d0f('0x30')]};});_0x1fc7eb[_0x7d0f('0x31')]=_[_0x7d0f('0x32')](_0x9d436b,_0x7d0f('0x2a'));_0x1fc7eb[_0x7d0f('0x33')]=_[_0x7d0f('0x34')](_0x4be02d[_0x7d0f('0x33')]);_0x1fc7eb['filters']=_[_0x7d0f('0x35')](_0x1fc7eb[_0x7d0f('0x31')],_0x1fc7eb['query']);_0x3c0466['attributes']=_[_0x7d0f('0x35')](_0x1fc7eb[_0x7d0f('0x31')],qs[_0x7d0f('0x36')](_0x4be02d[_0x7d0f('0x33')][_0x7d0f('0x36')]));_0x3c0466[_0x7d0f('0x37')]=_0x3c0466[_0x7d0f('0x37')][_0x7d0f('0x38')]?_0x3c0466[_0x7d0f('0x37')]:_0x1fc7eb[_0x7d0f('0x31')];if(!_0x4be02d[_0x7d0f('0x33')][_0x7d0f('0x39')](_0x7d0f('0x3a'))){_0x3c0466[_0x7d0f('0x1d')]=qs[_0x7d0f('0x1d')](_0x4be02d['query'][_0x7d0f('0x1d')]);_0x3c0466['offset']=qs['offset'](_0x4be02d['query'][_0x7d0f('0x20')]);}_0x3c0466[_0x7d0f('0x3b')]=qs[_0x7d0f('0x3c')](_0x4be02d[_0x7d0f('0x33')]['sort']);_0x3c0466[_0x7d0f('0x3d')]=qs[_0x7d0f('0x3e')](_['pick'](_0x4be02d[_0x7d0f('0x33')],_0x1fc7eb['filters']),_0x9d436b);if(_0x4be02d[_0x7d0f('0x33')][_0x7d0f('0x3f')]){_0x3c0466[_0x7d0f('0x3d')]=_[_0x7d0f('0x40')](_0x3c0466[_0x7d0f('0x3d')],{'$or':_[_0x7d0f('0x32')](_0x9d436b,function(_0x3f48e5){if(_0x3f48e5['type']!==_0x7d0f('0x41')){var _0xadfc92={};_0xadfc92[_0x3f48e5[_0x7d0f('0x2a')]]={'$like':'%'+_0x4be02d[_0x7d0f('0x33')][_0x7d0f('0x3f')]+'%'};return _0xadfc92;}})});}_0x3c0466=_['merge']({},_0x3c0466,_0x4be02d[_0x7d0f('0x42')]);var _0x4e9f8f={'where':_0x3c0466[_0x7d0f('0x3d')]};return db['SmsQueueReport'][_0x7d0f('0x1f')](_0x4e9f8f)[_0x7d0f('0x28')](function(_0x33a3c8){_0x5bc9d7['count']=_0x33a3c8;if(_0x4be02d[_0x7d0f('0x33')][_0x7d0f('0x43')]){_0x3c0466['include']=[{'all':!![]}];}return db['SmsQueueReport'][_0x7d0f('0x44')](_0x3c0466);})[_0x7d0f('0x28')](function(_0x3b1498){_0x5bc9d7[_0x7d0f('0x45')]=_0x3b1498;return _0x5bc9d7;})[_0x7d0f('0x28')](respondWithFilteredResult(_0x50be46,_0x3c0466))[_0x7d0f('0x46')](handleError(_0x50be46,null));};exports[_0x7d0f('0x47')]=function(_0x108f71,_0x258c38){var _0x2530e1={'raw':!![],'where':{'id':_0x108f71['params']['id']}},_0x31acd1={};_0x31acd1[_0x7d0f('0x31')]=_[_0x7d0f('0x34')](db[_0x7d0f('0x48')][_0x7d0f('0x2d')]);_0x31acd1[_0x7d0f('0x33')]=_['keys'](_0x108f71['query']);_0x31acd1[_0x7d0f('0x3e')]=_[_0x7d0f('0x35')](_0x31acd1[_0x7d0f('0x31')],_0x31acd1[_0x7d0f('0x33')]);_0x2530e1['attributes']=_[_0x7d0f('0x35')](_0x31acd1[_0x7d0f('0x31')],qs['fields'](_0x108f71[_0x7d0f('0x33')][_0x7d0f('0x36')]));_0x2530e1[_0x7d0f('0x37')]=_0x2530e1['attributes'][_0x7d0f('0x38')]?_0x2530e1['attributes']:_0x31acd1[_0x7d0f('0x31')];if(_0x108f71[_0x7d0f('0x33')][_0x7d0f('0x43')]){_0x2530e1['include']=[{'all':!![]}];}_0x2530e1=_[_0x7d0f('0x40')]({},_0x2530e1,_0x108f71['options']);return db[_0x7d0f('0x48')][_0x7d0f('0x49')](_0x2530e1)[_0x7d0f('0x28')](handleEntityNotFound(_0x258c38,null))['then'](respondWithResult(_0x258c38,null))['catch'](handleError(_0x258c38,null));};exports[_0x7d0f('0x4a')]=function(_0x1486b4,_0x3af04f){return db[_0x7d0f('0x48')]['create'](_0x1486b4[_0x7d0f('0x4b')],{})['then'](respondWithResult(_0x3af04f,0xc9))[_0x7d0f('0x46')](handleError(_0x3af04f,null));};exports[_0x7d0f('0x27')]=function(_0x394370,_0xe93d2c){if(_0x394370['body']['id']){delete _0x394370[_0x7d0f('0x4b')]['id'];}return db[_0x7d0f('0x48')]['find']({'where':{'id':_0x394370[_0x7d0f('0x4c')]['id']}})['then'](handleEntityNotFound(_0xe93d2c,null))[_0x7d0f('0x28')](saveUpdates(_0x394370[_0x7d0f('0x4b')],null))[_0x7d0f('0x28')](respondWithResult(_0xe93d2c,null))[_0x7d0f('0x46')](handleError(_0xe93d2c,null));};exports[_0x7d0f('0x4d')]=function(_0x3d200f,_0x2218fc){return db[_0x7d0f('0x48')][_0x7d0f('0x49')]({'where':{'id':_0x3d200f['params']['id']}})['then'](handleEntityNotFound(_0x2218fc,null))['then'](removeEntity(_0x2218fc,null))[_0x7d0f('0x46')](handleError(_0x2218fc,null));};exports['describe']=function(_0x1d3efb,_0x39615a){return db[_0x7d0f('0x48')][_0x7d0f('0x4e')]()[_0x7d0f('0x28')](respondWithResult(_0x39615a,null))[_0x7d0f('0x46')](handleError(_0x39615a,null));}; \ No newline at end of file +var _0xaa64=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','json','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','pick','merge','where','VIRTUAL','includeAll','findAll','params','include','options','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x20268d,_0x537c2d){var _0x1ab644=function(_0x99a392){while(--_0x99a392){_0x20268d['push'](_0x20268d['shift']());}};_0x1ab644(++_0x537c2d);}(_0xaa64,0x85));var _0x4aa6=function(_0x23ec5a,_0x39c3bb){_0x23ec5a=_0x23ec5a-0x0;var _0x1af467=_0xaa64[_0x23ec5a];return _0x1af467;};'use strict';var emlformat=require(_0x4aa6('0x0'));var rimraf=require(_0x4aa6('0x1'));var zipdir=require(_0x4aa6('0x2'));var jsonpatch=require(_0x4aa6('0x3'));var rp=require('request-promise');var moment=require(_0x4aa6('0x4'));var BPromise=require(_0x4aa6('0x5'));var Mustache=require(_0x4aa6('0x6'));var util=require(_0x4aa6('0x7'));var path=require(_0x4aa6('0x8'));var sox=require('sox');var csv=require(_0x4aa6('0x9'));var ejs=require(_0x4aa6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4aa6('0xb'));var crypto=require(_0x4aa6('0xc'));var jsforce=require(_0x4aa6('0xd'));var deskjs=require(_0x4aa6('0xe'));var toCsv=require(_0x4aa6('0x9'));var querystring=require(_0x4aa6('0xf'));var Papa=require(_0x4aa6('0x10'));var Redis=require(_0x4aa6('0x11'));var authService=require(_0x4aa6('0x12'));var qs=require(_0x4aa6('0x13'));var as=require(_0x4aa6('0x14'));var hardwareService=require(_0x4aa6('0x15'));var logger=require('../../config/logger')(_0x4aa6('0x16'));var utils=require(_0x4aa6('0x17'));var config=require(_0x4aa6('0x18'));var licenseUtil=require(_0x4aa6('0x19'));var db=require(_0x4aa6('0x1a'))['db'];function respondWithStatusCode(_0xc59fd7,_0x4cd236){_0x4cd236=_0x4cd236||0xcc;return function(_0x46e0d7){if(_0x46e0d7){return _0xc59fd7['sendStatus'](_0x4cd236);}return _0xc59fd7['status'](_0x4cd236)[_0x4aa6('0x1b')]();};}function respondWithResult(_0x2cb93f,_0x166c8f){_0x166c8f=_0x166c8f||0xc8;return function(_0x25b156){if(_0x25b156){return _0x2cb93f[_0x4aa6('0x1c')](_0x166c8f)['json'](_0x25b156);}};}function respondWithFilteredResult(_0x5c5c8f,_0x16054f){return function(_0x4bc79d){if(_0x4bc79d){var _0x938098=typeof _0x16054f[_0x4aa6('0x1d')]===_0x4aa6('0x1e')&&typeof _0x16054f['limit']===_0x4aa6('0x1e');var _0x22d392=_0x4bc79d[_0x4aa6('0x1f')];var _0x393cc8=_0x938098?0x0:_0x16054f[_0x4aa6('0x1d')];var _0xfee679=_0x938098?_0x4bc79d['count']:_0x16054f['offset']+_0x16054f['limit'];var _0x582cbb;if(_0xfee679>=_0x22d392){_0xfee679=_0x22d392;_0x582cbb=0xc8;}else{_0x582cbb=0xce;}_0x5c5c8f[_0x4aa6('0x1c')](_0x582cbb);return _0x5c5c8f['set']('Content-Range',_0x393cc8+'-'+_0xfee679+'/'+_0x22d392)[_0x4aa6('0x20')](_0x4bc79d);}return null;};}function patchUpdates(_0x2ebbfb){return function(_0xa307c4){try{jsonpatch[_0x4aa6('0x21')](_0xa307c4,_0x2ebbfb,!![]);}catch(_0x59773c){return BPromise[_0x4aa6('0x22')](_0x59773c);}return _0xa307c4[_0x4aa6('0x23')]();};}function saveUpdates(_0x167de5,_0x3bbc79){return function(_0x3a3401){if(_0x3a3401){return _0x3a3401['update'](_0x167de5)['then'](function(_0x8b1054){return _0x8b1054;});}return null;};}function removeEntity(_0x4b78a3,_0x4b34f1){return function(_0x192d1c){if(_0x192d1c){return _0x192d1c[_0x4aa6('0x24')]()[_0x4aa6('0x25')](function(){_0x4b78a3[_0x4aa6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x182485,_0x241d71){return function(_0x4b2913){if(!_0x4b2913){_0x182485[_0x4aa6('0x26')](0x194);}return _0x4b2913;};}function handleError(_0x25706a,_0x2a6964){_0x2a6964=_0x2a6964||0x1f4;return function(_0x10cef5){logger[_0x4aa6('0x27')](_0x10cef5[_0x4aa6('0x28')]);if(_0x10cef5[_0x4aa6('0x29')]){delete _0x10cef5[_0x4aa6('0x29')];}_0x25706a[_0x4aa6('0x1c')](_0x2a6964)[_0x4aa6('0x2a')](_0x10cef5);};}exports[_0x4aa6('0x2b')]=function(_0x406d9f,_0x5688d4){var _0x5d1909={},_0x2a92e4={},_0x7e32cb={'count':0x0,'rows':[]};var _0x101393=_[_0x4aa6('0x2c')](db[_0x4aa6('0x2d')][_0x4aa6('0x2e')],function(_0x2cad1a){return{'name':_0x2cad1a[_0x4aa6('0x2f')],'type':_0x2cad1a[_0x4aa6('0x30')][_0x4aa6('0x31')]};});_0x2a92e4[_0x4aa6('0x32')]=_[_0x4aa6('0x2c')](_0x101393,_0x4aa6('0x29'));_0x2a92e4[_0x4aa6('0x33')]=_[_0x4aa6('0x34')](_0x406d9f['query']);_0x2a92e4[_0x4aa6('0x35')]=_[_0x4aa6('0x36')](_0x2a92e4['model'],_0x2a92e4[_0x4aa6('0x33')]);_0x5d1909['attributes']=_[_0x4aa6('0x36')](_0x2a92e4[_0x4aa6('0x32')],qs[_0x4aa6('0x37')](_0x406d9f[_0x4aa6('0x33')]['fields']));_0x5d1909[_0x4aa6('0x38')]=_0x5d1909[_0x4aa6('0x38')][_0x4aa6('0x39')]?_0x5d1909[_0x4aa6('0x38')]:_0x2a92e4[_0x4aa6('0x32')];if(!_0x406d9f[_0x4aa6('0x33')]['hasOwnProperty'](_0x4aa6('0x3a'))){_0x5d1909[_0x4aa6('0x3b')]=qs[_0x4aa6('0x3b')](_0x406d9f[_0x4aa6('0x33')][_0x4aa6('0x3b')]);_0x5d1909[_0x4aa6('0x1d')]=qs[_0x4aa6('0x1d')](_0x406d9f[_0x4aa6('0x33')][_0x4aa6('0x1d')]);}_0x5d1909[_0x4aa6('0x3c')]=qs[_0x4aa6('0x3d')](_0x406d9f[_0x4aa6('0x33')][_0x4aa6('0x3d')]);_0x5d1909['where']=qs[_0x4aa6('0x35')](_[_0x4aa6('0x3e')](_0x406d9f['query'],_0x2a92e4[_0x4aa6('0x35')]),_0x101393);if(_0x406d9f['query']['filter']){_0x5d1909['where']=_[_0x4aa6('0x3f')](_0x5d1909[_0x4aa6('0x40')],{'$or':_[_0x4aa6('0x2c')](_0x101393,function(_0x3c7704){if(_0x3c7704[_0x4aa6('0x30')]!==_0x4aa6('0x41')){var _0x4bf6c4={};_0x4bf6c4[_0x3c7704[_0x4aa6('0x29')]]={'$like':'%'+_0x406d9f[_0x4aa6('0x33')]['filter']+'%'};return _0x4bf6c4;}})});}_0x5d1909=_[_0x4aa6('0x3f')]({},_0x5d1909,_0x406d9f['options']);var _0x2e3ef2={'where':_0x5d1909[_0x4aa6('0x40')]};return db[_0x4aa6('0x2d')][_0x4aa6('0x1f')](_0x2e3ef2)['then'](function(_0x1e7f33){_0x7e32cb[_0x4aa6('0x1f')]=_0x1e7f33;if(_0x406d9f[_0x4aa6('0x33')][_0x4aa6('0x42')]){_0x5d1909['include']=[{'all':!![]}];}return db[_0x4aa6('0x2d')][_0x4aa6('0x43')](_0x5d1909);})['then'](function(_0x37e5b8){_0x7e32cb['rows']=_0x37e5b8;return _0x7e32cb;})['then'](respondWithFilteredResult(_0x5688d4,_0x5d1909))['catch'](handleError(_0x5688d4,null));};exports['show']=function(_0x2b66b9,_0x446053){var _0x2be108={'raw':!![],'where':{'id':_0x2b66b9[_0x4aa6('0x44')]['id']}},_0x597770={};_0x597770[_0x4aa6('0x32')]=_['keys'](db[_0x4aa6('0x2d')][_0x4aa6('0x2e')]);_0x597770[_0x4aa6('0x33')]=_[_0x4aa6('0x34')](_0x2b66b9[_0x4aa6('0x33')]);_0x597770[_0x4aa6('0x35')]=_[_0x4aa6('0x36')](_0x597770['model'],_0x597770['query']);_0x2be108[_0x4aa6('0x38')]=_['intersection'](_0x597770[_0x4aa6('0x32')],qs['fields'](_0x2b66b9[_0x4aa6('0x33')][_0x4aa6('0x37')]));_0x2be108[_0x4aa6('0x38')]=_0x2be108[_0x4aa6('0x38')]['length']?_0x2be108[_0x4aa6('0x38')]:_0x597770[_0x4aa6('0x32')];if(_0x2b66b9[_0x4aa6('0x33')]['includeAll']){_0x2be108[_0x4aa6('0x45')]=[{'all':!![]}];}_0x2be108=_['merge']({},_0x2be108,_0x2b66b9[_0x4aa6('0x46')]);return db[_0x4aa6('0x2d')][_0x4aa6('0x47')](_0x2be108)[_0x4aa6('0x25')](handleEntityNotFound(_0x446053,null))[_0x4aa6('0x25')](respondWithResult(_0x446053,null))[_0x4aa6('0x48')](handleError(_0x446053,null));};exports[_0x4aa6('0x49')]=function(_0x59b499,_0x2d15dd){return db[_0x4aa6('0x2d')][_0x4aa6('0x49')](_0x59b499[_0x4aa6('0x4a')],{})[_0x4aa6('0x25')](respondWithResult(_0x2d15dd,0xc9))['catch'](handleError(_0x2d15dd,null));};exports[_0x4aa6('0x4b')]=function(_0xfef016,_0x3b7883){if(_0xfef016['body']['id']){delete _0xfef016[_0x4aa6('0x4a')]['id'];}return db[_0x4aa6('0x2d')][_0x4aa6('0x47')]({'where':{'id':_0xfef016[_0x4aa6('0x44')]['id']}})[_0x4aa6('0x25')](handleEntityNotFound(_0x3b7883,null))[_0x4aa6('0x25')](saveUpdates(_0xfef016[_0x4aa6('0x4a')],null))[_0x4aa6('0x25')](respondWithResult(_0x3b7883,null))[_0x4aa6('0x48')](handleError(_0x3b7883,null));};exports[_0x4aa6('0x24')]=function(_0x3d19f5,_0x209c09){return db[_0x4aa6('0x2d')][_0x4aa6('0x47')]({'where':{'id':_0x3d19f5[_0x4aa6('0x44')]['id']}})['then'](handleEntityNotFound(_0x209c09,null))[_0x4aa6('0x25')](removeEntity(_0x209c09,null))[_0x4aa6('0x48')](handleError(_0x209c09,null));};exports['describe']=function(_0x18de94,_0x59b8a3){return db['SmsQueueReport'][_0x4aa6('0x4c')]()['then'](respondWithResult(_0x59b8a3,null))[_0x4aa6('0x48')](handleError(_0x59b8a3,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 5baf3d9..44865f8 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(_0x4086f9,_0x58d442){var _0x15f079=function(_0x1c12b7){while(--_0x1c12b7){_0x4086f9['push'](_0x4086f9['shift']());}};_0x15f079(++_0x58d442);}(_0xb7e7,0x121));var _0x7b7e=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xb7e7[_0xaa0309];return _0x5de7ce;};'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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0xe4d6c6,_0x3bdbf2){var _0x3a8935=function(_0x131483){while(--_0x131483){_0xe4d6c6['push'](_0xe4d6c6['shift']());}};_0x3a8935(++_0x3bdbf2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 3dc37ea..5f3c282 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 _0x231c=['message','result','catch','SmsQueueReport','create','body','options','debug','stringify','UpdateSmsQueueReport','update','raw','where','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0xac1d19,_0x447fa8){var _0x1133e0=function(_0x44a661){while(--_0x44a661){_0xac1d19['push'](_0xac1d19['shift']());}};_0x1133e0(++_0x447fa8);}(_0x231c,0x16e));var _0xc231=function(_0x4e4468,_0x2c3da9){_0x4e4468=_0x4e4468-0x0;var _0x52a64b=_0x231c[_0x4e4468];return _0x52a64b;};'use strict';var _=require(_0xc231('0x0'));var util=require(_0xc231('0x1'));var moment=require(_0xc231('0x2'));var BPromise=require('bluebird');var rs=require(_0xc231('0x3'));var fs=require('fs');var Redis=require(_0xc231('0x4'));var db=require(_0xc231('0x5'))['db'];var utils=require(_0xc231('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc231('0x7'));var jayson=require(_0xc231('0x8'));var client=jayson[_0xc231('0x9')][_0xc231('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b2820,_0x38cef7,_0x2517f9){return new BPromise(function(_0x3a0d50,_0xcca18e){return client[_0xc231('0xb')](_0x5b2820,_0x2517f9)[_0xc231('0xc')](function(_0x3a5aa3){logger[_0xc231('0xd')](_0xc231('0xe'),_0x38cef7,'request\x20sent');logger['debug'](_0xc231('0xf'),_0x38cef7,_0xc231('0x10'),JSON['stringify'](_0x3a5aa3));if(_0x3a5aa3[_0xc231('0x11')]){if(_0x3a5aa3[_0xc231('0x11')]['code']===0x1f4){logger[_0xc231('0x11')](_0xc231('0xe'),_0x38cef7,_0x3a5aa3[_0xc231('0x11')][_0xc231('0x12')]);return _0xcca18e(_0x3a5aa3[_0xc231('0x11')][_0xc231('0x12')]);}logger[_0xc231('0x11')](_0xc231('0xe'),_0x38cef7,_0x3a5aa3[_0xc231('0x11')][_0xc231('0x12')]);return _0x3a0d50(_0x3a5aa3['error']['message']);}else{logger[_0xc231('0xd')](_0xc231('0xe'),_0x38cef7,_0xc231('0x10'));_0x3a0d50(_0x3a5aa3[_0xc231('0x13')][_0xc231('0x12')]);}})[_0xc231('0x14')](function(_0x5da613){logger[_0xc231('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x38cef7,_0x5da613);_0xcca18e(_0x5da613);});});}exports['CreateSmsQueueReport']=function(_0x3511d3){var _0x20088d=this;return new Promise(function(_0x5b023c,_0x1dbcd9){return db[_0xc231('0x15')][_0xc231('0x16')](_0x3511d3[_0xc231('0x17')],{'raw':_0x3511d3['options']?_0x3511d3[_0xc231('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xc231('0xc')](function(_0x2a1d07){logger[_0xc231('0xd')]('CreateSmsQueueReport',_0x3511d3);logger[_0xc231('0x19')]('CreateSmsQueueReport',_0x3511d3,JSON[_0xc231('0x1a')](_0x2a1d07));_0x5b023c(_0x2a1d07);})['catch'](function(_0xd9084a){logger[_0xc231('0x11')]('CreateSmsQueueReport',_0xd9084a['message'],_0x3511d3);_0x1dbcd9(_0x20088d[_0xc231('0x11')](0x1f4,_0xd9084a['message']));});});};exports[_0xc231('0x1b')]=function(_0x4173c4){var _0xd1d96e=this;return new Promise(function(_0x9e3215,_0x423d42){return db[_0xc231('0x15')][_0xc231('0x1c')](_0x4173c4['body'],{'raw':_0x4173c4[_0xc231('0x18')]?_0x4173c4[_0xc231('0x18')][_0xc231('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4173c4[_0xc231('0x18')]?_0x4173c4[_0xc231('0x18')][_0xc231('0x1e')]||null:null,'attributes':_0x4173c4[_0xc231('0x18')]?_0x4173c4[_0xc231('0x18')][_0xc231('0x1f')]||null:null,'limit':_0x4173c4[_0xc231('0x18')]?_0x4173c4[_0xc231('0x18')]['limit']||null:null})[_0xc231('0xc')](function(_0x5d265e){logger[_0xc231('0xd')](_0xc231('0x1b'),_0x4173c4);logger[_0xc231('0x19')](_0xc231('0x1b'),_0x4173c4,JSON[_0xc231('0x1a')](_0x5d265e));_0x9e3215(_0x5d265e);})[_0xc231('0x14')](function(_0x5e76bb){logger[_0xc231('0x11')]('UpdateSmsQueueReport',_0x5e76bb[_0xc231('0x12')],_0x4173c4);_0x423d42(_0xd1d96e[_0xc231('0x11')](0x1f4,_0x5e76bb[_0xc231('0x12')]));});});}; \ No newline at end of file +var _0xc3cb=['then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','catch','UpdateSmsQueueReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc3cb,0xdb));var _0xbc3c=function(_0x3f178e,_0x420977){_0x3f178e=_0x3f178e-0x0;var _0x2a3f9d=_0xc3cb[_0x3f178e];return _0x2a3f9d;};'use strict';var _=require(_0xbc3c('0x0'));var util=require(_0xbc3c('0x1'));var moment=require(_0xbc3c('0x2'));var BPromise=require(_0xbc3c('0x3'));var rs=require(_0xbc3c('0x4'));var fs=require('fs');var Redis=require(_0xbc3c('0x5'));var db=require(_0xbc3c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbc3c('0x7'));var jayson=require(_0xbc3c('0x8'));var client=jayson[_0xbc3c('0x9')][_0xbc3c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x374a49,_0x1c7919,_0xc54fb0){return new BPromise(function(_0x2f601e,_0x52d2a0){return client[_0xbc3c('0xb')](_0x374a49,_0xc54fb0)[_0xbc3c('0xc')](function(_0x5cfa7f){logger[_0xbc3c('0xd')](_0xbc3c('0xe'),_0x1c7919,_0xbc3c('0xf'));logger[_0xbc3c('0x10')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x1c7919,'request\x20sent',JSON[_0xbc3c('0x11')](_0x5cfa7f));if(_0x5cfa7f[_0xbc3c('0x12')]){if(_0x5cfa7f[_0xbc3c('0x12')][_0xbc3c('0x13')]===0x1f4){logger[_0xbc3c('0x12')](_0xbc3c('0xe'),_0x1c7919,_0x5cfa7f[_0xbc3c('0x12')]['message']);return _0x52d2a0(_0x5cfa7f['error'][_0xbc3c('0x14')]);}logger[_0xbc3c('0x12')](_0xbc3c('0xe'),_0x1c7919,_0x5cfa7f[_0xbc3c('0x12')][_0xbc3c('0x14')]);return _0x2f601e(_0x5cfa7f[_0xbc3c('0x12')]['message']);}else{logger[_0xbc3c('0xd')](_0xbc3c('0xe'),_0x1c7919,'request\x20sent');_0x2f601e(_0x5cfa7f[_0xbc3c('0x15')][_0xbc3c('0x14')]);}})['catch'](function(_0x844914){logger[_0xbc3c('0x12')](_0xbc3c('0xe'),_0x1c7919,_0x844914);_0x52d2a0(_0x844914);});});}exports[_0xbc3c('0x16')]=function(_0x3d4592){var _0x267c04=this;return new Promise(function(_0x2dba1f,_0x5e4f9f){return db[_0xbc3c('0x17')][_0xbc3c('0x18')](_0x3d4592[_0xbc3c('0x19')],{'raw':_0x3d4592[_0xbc3c('0x1a')]?_0x3d4592['options'][_0xbc3c('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x53786e){logger[_0xbc3c('0xd')](_0xbc3c('0x16'),_0x3d4592);logger[_0xbc3c('0x10')](_0xbc3c('0x16'),_0x3d4592,JSON['stringify'](_0x53786e));_0x2dba1f(_0x53786e);})[_0xbc3c('0x1c')](function(_0x21093b){logger['error'](_0xbc3c('0x16'),_0x21093b['message'],_0x3d4592);_0x5e4f9f(_0x267c04['error'](0x1f4,_0x21093b[_0xbc3c('0x14')]));});});};exports[_0xbc3c('0x1d')]=function(_0x2235ce){var _0x55be0=this;return new Promise(function(_0x20f587,_0x33b0f7){return db[_0xbc3c('0x17')][_0xbc3c('0x1e')](_0x2235ce['body'],{'raw':_0x2235ce[_0xbc3c('0x1a')]?_0x2235ce[_0xbc3c('0x1a')][_0xbc3c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2235ce[_0xbc3c('0x1a')]?_0x2235ce[_0xbc3c('0x1a')][_0xbc3c('0x1f')]||null:null,'attributes':_0x2235ce[_0xbc3c('0x1a')]?_0x2235ce['options']['attributes']||null:null,'limit':_0x2235ce[_0xbc3c('0x1a')]?_0x2235ce[_0xbc3c('0x1a')][_0xbc3c('0x20')]||null:null})[_0xbc3c('0xc')](function(_0x5f1bae){logger[_0xbc3c('0xd')]('UpdateSmsQueueReport',_0x2235ce);logger[_0xbc3c('0x10')]('UpdateSmsQueueReport',_0x2235ce,JSON[_0xbc3c('0x11')](_0x5f1bae));_0x20f587(_0x5f1bae);})[_0xbc3c('0x1c')](function(_0x5e1fcb){logger[_0xbc3c('0x12')](_0xbc3c('0x1d'),_0x5e1fcb[_0xbc3c('0x14')],_0x2235ce);_0x33b0f7(_0x55be0[_0xbc3c('0x12')](0x1f4,_0x5e1fcb['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 95d6459..77c1d96 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 _0xf120=['Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','show','post','put','/:id','update','delete','exports','util','path','connect-timeout'];(function(_0x74763b,_0x3adad4){var _0x738f43=function(_0x136773){while(--_0x136773){_0x74763b['push'](_0x74763b['shift']());}};_0x738f43(++_0x3adad4);}(_0xf120,0x179));var _0x0f12=function(_0x161f64,_0x144b0c){_0x161f64=_0x161f64-0x0;var _0x2b7894=_0xf120[_0x161f64];return _0x2b7894;};'use strict';var multer=require('multer');var util=require(_0x0f12('0x0'));var path=require(_0x0f12('0x1'));var timeout=require(_0x0f12('0x2'));var express=require('express');var router=express[_0x0f12('0x3')]();var fs_extra=require(_0x0f12('0x4'));var auth=require(_0x0f12('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0f12('0x6'));var controller=require(_0x0f12('0x7'));router[_0x0f12('0x8')]('/',auth[_0x0f12('0x9')](),controller[_0x0f12('0xa')]);router[_0x0f12('0x8')](_0x0f12('0xb'),auth[_0x0f12('0x9')](),controller['describe']);router[_0x0f12('0x8')]('/:id',auth[_0x0f12('0x9')](),controller[_0x0f12('0xc')]);router[_0x0f12('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0f12('0xe')](_0x0f12('0xf'),auth[_0x0f12('0x9')](),controller[_0x0f12('0x10')]);router[_0x0f12('0x11')](_0x0f12('0xf'),auth[_0x0f12('0x9')](),controller['destroy']);module[_0x0f12('0x12')]=router; \ No newline at end of file +var _0x5ad3=['isAuthenticated','index','describe','create','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get'];(function(_0x57c0bb,_0x24d7f1){var _0x3626b6=function(_0x3d07e1){while(--_0x3d07e1){_0x57c0bb['push'](_0x57c0bb['shift']());}};_0x3626b6(++_0x24d7f1);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0x5ad3[_0x1b3564];return _0x504069;};'use strict';var multer=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var path=require(_0x35ad('0x2'));var timeout=require(_0x35ad('0x3'));var express=require('express');var router=express[_0x35ad('0x4')]();var fs_extra=require(_0x35ad('0x5'));var auth=require(_0x35ad('0x6'));var interaction=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var controller=require(_0x35ad('0x9'));router[_0x35ad('0xa')]('/',auth[_0x35ad('0xb')](),controller[_0x35ad('0xc')]);router[_0x35ad('0xa')]('/describe',auth[_0x35ad('0xb')](),controller[_0x35ad('0xd')]);router[_0x35ad('0xa')]('/:id',auth[_0x35ad('0xb')](),controller['show']);router['post']('/',auth[_0x35ad('0xb')](),controller[_0x35ad('0xe')]);router['put'](_0x35ad('0xf'),auth[_0x35ad('0xb')](),controller['update']);router['delete'](_0x35ad('0xf'),auth[_0x35ad('0xb')](),controller['destroy']);module[_0x35ad('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 27b7ce7..09561fb 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x80905f,_0x43e891){var _0xc16ed9=function(_0x739f9f){while(--_0x739f9f){_0x80905f['push'](_0x80905f['shift']());}};_0xc16ed9(++_0x43e891);}(_0x70e0,0x17b));var _0x070e=function(_0x36eb45,_0x415f98){_0x36eb45=_0x36eb45-0x0;var _0x2d01d=_0x70e0[_0x36eb45];return _0x2d01d;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x5d69ea,_0x58d95b){var _0x49ecf4=function(_0x56bef2){while(--_0x56bef2){_0x5d69ea['push'](_0x5d69ea['shift']());}};_0x49ecf4(++_0x58d95b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0xcb91[_0x420b24];return _0x4da552;};'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 0f07b47..d32b63c 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 _0x2a5c=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','count','includeAll','SmsTransferReport','findAll','catch','show','keys','rawAttributes','include','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x32cfaf,_0x42db30){var _0x3b1055=function(_0x15d635){while(--_0x15d635){_0x32cfaf['push'](_0x32cfaf['shift']());}};_0x3b1055(++_0x42db30);}(_0x2a5c,0x8d));var _0xc2a5=function(_0x1e006e,_0x36f215){_0x1e006e=_0x1e006e-0x0;var _0x1fd8f1=_0x2a5c[_0x1e006e];return _0x1fd8f1;};'use strict';var emlformat=require(_0xc2a5('0x0'));var rimraf=require(_0xc2a5('0x1'));var zipdir=require(_0xc2a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc2a5('0x3'));var moment=require(_0xc2a5('0x4'));var BPromise=require(_0xc2a5('0x5'));var Mustache=require(_0xc2a5('0x6'));var util=require('util');var path=require(_0xc2a5('0x7'));var sox=require(_0xc2a5('0x8'));var csv=require(_0xc2a5('0x9'));var ejs=require(_0xc2a5('0xa'));var fs=require('fs');var fs_extra=require(_0xc2a5('0xb'));var _=require(_0xc2a5('0xc'));var squel=require('squel');var crypto=require(_0xc2a5('0xd'));var jsforce=require(_0xc2a5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc2a5('0x9'));var querystring=require('querystring');var Papa=require(_0xc2a5('0xf'));var Redis=require(_0xc2a5('0x10'));var authService=require(_0xc2a5('0x11'));var qs=require(_0xc2a5('0x12'));var as=require(_0xc2a5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc2a5('0x14'))(_0xc2a5('0x15'));var utils=require(_0xc2a5('0x16'));var config=require(_0xc2a5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc2a5('0x18'))['db'];function respondWithStatusCode(_0x23a333,_0x57824a){_0x57824a=_0x57824a||0xcc;return function(_0x51ab71){if(_0x51ab71){return _0x23a333[_0xc2a5('0x19')](_0x57824a);}return _0x23a333['status'](_0x57824a)[_0xc2a5('0x1a')]();};}function respondWithResult(_0x372c68,_0x4fcb0b){_0x4fcb0b=_0x4fcb0b||0xc8;return function(_0x3d971e){if(_0x3d971e){return _0x372c68[_0xc2a5('0x1b')](_0x4fcb0b)[_0xc2a5('0x1c')](_0x3d971e);}};}function respondWithFilteredResult(_0x37654c,_0x5df3d5){return function(_0x15cd57){if(_0x15cd57){var _0x358378=typeof _0x5df3d5[_0xc2a5('0x1d')]===_0xc2a5('0x1e')&&typeof _0x5df3d5['limit']==='undefined';var _0x42218a=_0x15cd57['count'];var _0x1d74ee=_0x358378?0x0:_0x5df3d5[_0xc2a5('0x1d')];var _0x6c8333=_0x358378?_0x15cd57['count']:_0x5df3d5[_0xc2a5('0x1d')]+_0x5df3d5[_0xc2a5('0x1f')];var _0x3469af;if(_0x6c8333>=_0x42218a){_0x6c8333=_0x42218a;_0x3469af=0xc8;}else{_0x3469af=0xce;}_0x37654c[_0xc2a5('0x1b')](_0x3469af);return _0x37654c[_0xc2a5('0x20')](_0xc2a5('0x21'),_0x1d74ee+'-'+_0x6c8333+'/'+_0x42218a)[_0xc2a5('0x1c')](_0x15cd57);}return null;};}function patchUpdates(_0x1a0cd7){return function(_0x2818cd){try{jsonpatch[_0xc2a5('0x22')](_0x2818cd,_0x1a0cd7,!![]);}catch(_0x16d03c){return BPromise[_0xc2a5('0x23')](_0x16d03c);}return _0x2818cd[_0xc2a5('0x24')]();};}function saveUpdates(_0x4740fe,_0x182fb4){return function(_0xb11a31){if(_0xb11a31){return _0xb11a31[_0xc2a5('0x25')](_0x4740fe)['then'](function(_0x450ad8){return _0x450ad8;});}return null;};}function removeEntity(_0x5baf15,_0xded95b){return function(_0x20b7ee){if(_0x20b7ee){return _0x20b7ee[_0xc2a5('0x26')]()[_0xc2a5('0x27')](function(){_0x5baf15['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x84ba1f,_0x41b48f){return function(_0x1b4bbd){if(!_0x1b4bbd){_0x84ba1f[_0xc2a5('0x19')](0x194);}return _0x1b4bbd;};}function handleError(_0x1187f2,_0x1d6267){_0x1d6267=_0x1d6267||0x1f4;return function(_0x4d283b){logger[_0xc2a5('0x28')](_0x4d283b[_0xc2a5('0x29')]);if(_0x4d283b[_0xc2a5('0x2a')]){delete _0x4d283b[_0xc2a5('0x2a')];}_0x1187f2['status'](_0x1d6267)[_0xc2a5('0x2b')](_0x4d283b);};}exports['index']=function(_0x2cb44b,_0x346941){var _0x1d939d={},_0x80d140={},_0x46e9f8={'count':0x0,'rows':[]};var _0x53684d=_[_0xc2a5('0x2c')](db['SmsTransferReport']['rawAttributes'],function(_0x104a9c){return{'name':_0x104a9c[_0xc2a5('0x2d')],'type':_0x104a9c[_0xc2a5('0x2e')][_0xc2a5('0x2f')]};});_0x80d140[_0xc2a5('0x30')]=_[_0xc2a5('0x2c')](_0x53684d,'name');_0x80d140[_0xc2a5('0x31')]=_['keys'](_0x2cb44b['query']);_0x80d140[_0xc2a5('0x32')]=_[_0xc2a5('0x33')](_0x80d140[_0xc2a5('0x30')],_0x80d140[_0xc2a5('0x31')]);_0x1d939d[_0xc2a5('0x34')]=_[_0xc2a5('0x33')](_0x80d140['model'],qs[_0xc2a5('0x35')](_0x2cb44b[_0xc2a5('0x31')][_0xc2a5('0x35')]));_0x1d939d[_0xc2a5('0x34')]=_0x1d939d[_0xc2a5('0x34')][_0xc2a5('0x36')]?_0x1d939d['attributes']:_0x80d140['model'];if(!_0x2cb44b[_0xc2a5('0x31')][_0xc2a5('0x37')](_0xc2a5('0x38'))){_0x1d939d[_0xc2a5('0x1f')]=qs[_0xc2a5('0x1f')](_0x2cb44b[_0xc2a5('0x31')][_0xc2a5('0x1f')]);_0x1d939d['offset']=qs['offset'](_0x2cb44b[_0xc2a5('0x31')][_0xc2a5('0x1d')]);}_0x1d939d[_0xc2a5('0x39')]=qs['sort'](_0x2cb44b[_0xc2a5('0x31')][_0xc2a5('0x3a')]);_0x1d939d[_0xc2a5('0x3b')]=qs[_0xc2a5('0x32')](_['pick'](_0x2cb44b[_0xc2a5('0x31')],_0x80d140[_0xc2a5('0x32')]),_0x53684d);if(_0x2cb44b[_0xc2a5('0x31')]['filter']){_0x1d939d[_0xc2a5('0x3b')]=_[_0xc2a5('0x3c')](_0x1d939d['where'],{'$or':_[_0xc2a5('0x2c')](_0x53684d,function(_0x443c70){if(_0x443c70[_0xc2a5('0x2e')]!==_0xc2a5('0x3d')){var _0x554bae={};_0x554bae[_0x443c70[_0xc2a5('0x2a')]]={'$like':'%'+_0x2cb44b[_0xc2a5('0x31')][_0xc2a5('0x3e')]+'%'};return _0x554bae;}})});}_0x1d939d=_[_0xc2a5('0x3c')]({},_0x1d939d,_0x2cb44b['options']);var _0x33e916={'where':_0x1d939d[_0xc2a5('0x3b')]};return db['SmsTransferReport'][_0xc2a5('0x3f')](_0x33e916)['then'](function(_0x3f0338){_0x46e9f8[_0xc2a5('0x3f')]=_0x3f0338;if(_0x2cb44b[_0xc2a5('0x31')][_0xc2a5('0x40')]){_0x1d939d['include']=[{'all':!![]}];}return db[_0xc2a5('0x41')][_0xc2a5('0x42')](_0x1d939d);})[_0xc2a5('0x27')](function(_0x55a837){_0x46e9f8['rows']=_0x55a837;return _0x46e9f8;})[_0xc2a5('0x27')](respondWithFilteredResult(_0x346941,_0x1d939d))[_0xc2a5('0x43')](handleError(_0x346941,null));};exports[_0xc2a5('0x44')]=function(_0x9bf563,_0x15a1b9){var _0x30a15d={'raw':!![],'where':{'id':_0x9bf563['params']['id']}},_0xab76e3={};_0xab76e3[_0xc2a5('0x30')]=_[_0xc2a5('0x45')](db['SmsTransferReport'][_0xc2a5('0x46')]);_0xab76e3[_0xc2a5('0x31')]=_[_0xc2a5('0x45')](_0x9bf563[_0xc2a5('0x31')]);_0xab76e3[_0xc2a5('0x32')]=_[_0xc2a5('0x33')](_0xab76e3[_0xc2a5('0x30')],_0xab76e3[_0xc2a5('0x31')]);_0x30a15d[_0xc2a5('0x34')]=_[_0xc2a5('0x33')](_0xab76e3['model'],qs[_0xc2a5('0x35')](_0x9bf563['query'][_0xc2a5('0x35')]));_0x30a15d[_0xc2a5('0x34')]=_0x30a15d[_0xc2a5('0x34')]['length']?_0x30a15d[_0xc2a5('0x34')]:_0xab76e3[_0xc2a5('0x30')];if(_0x9bf563[_0xc2a5('0x31')][_0xc2a5('0x40')]){_0x30a15d[_0xc2a5('0x47')]=[{'all':!![]}];}_0x30a15d=_['merge']({},_0x30a15d,_0x9bf563[_0xc2a5('0x48')]);return db[_0xc2a5('0x41')][_0xc2a5('0x49')](_0x30a15d)[_0xc2a5('0x27')](handleEntityNotFound(_0x15a1b9,null))[_0xc2a5('0x27')](respondWithResult(_0x15a1b9,null))[_0xc2a5('0x43')](handleError(_0x15a1b9,null));};exports[_0xc2a5('0x4a')]=function(_0x283538,_0x22c581){return db[_0xc2a5('0x41')][_0xc2a5('0x4a')](_0x283538[_0xc2a5('0x4b')],{})['then'](respondWithResult(_0x22c581,0xc9))[_0xc2a5('0x43')](handleError(_0x22c581,null));};exports['update']=function(_0x45625b,_0xc9b457){if(_0x45625b[_0xc2a5('0x4b')]['id']){delete _0x45625b[_0xc2a5('0x4b')]['id'];}return db[_0xc2a5('0x41')][_0xc2a5('0x49')]({'where':{'id':_0x45625b['params']['id']}})['then'](handleEntityNotFound(_0xc9b457,null))[_0xc2a5('0x27')](saveUpdates(_0x45625b[_0xc2a5('0x4b')],null))['then'](respondWithResult(_0xc9b457,null))[_0xc2a5('0x43')](handleError(_0xc9b457,null));};exports[_0xc2a5('0x26')]=function(_0x74c917,_0x278629){return db['SmsTransferReport'][_0xc2a5('0x49')]({'where':{'id':_0x74c917[_0xc2a5('0x4c')]['id']}})[_0xc2a5('0x27')](handleEntityNotFound(_0x278629,null))[_0xc2a5('0x27')](removeEntity(_0x278629,null))[_0xc2a5('0x43')](handleError(_0x278629,null));};exports['describe']=function(_0x35ede2,_0x17e6ec){return db[_0xc2a5('0x41')][_0xc2a5('0x4d')]()[_0xc2a5('0x27')](respondWithResult(_0x17e6ec,null))[_0xc2a5('0x43')](handleError(_0x17e6ec,null));}; \ No newline at end of file +var _0x4ad5=['request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','SmsTransferReport','includeAll','findAll','rows','catch','show','params','keys','create','body','find','describe','eml-format','fast-json-patch'];(function(_0x5da277,_0x4d61f3){var _0x44ba71=function(_0x4ecfc3){while(--_0x4ecfc3){_0x5da277['push'](_0x5da277['shift']());}};_0x44ba71(++_0x4d61f3);}(_0x4ad5,0x92));var _0x54ad=function(_0x1f3280,_0x775176){_0x1f3280=_0x1f3280-0x0;var _0x2cc36b=_0x4ad5[_0x1f3280];return _0x2cc36b;};'use strict';var emlformat=require(_0x54ad('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x54ad('0x1'));var rp=require(_0x54ad('0x2'));var moment=require(_0x54ad('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x54ad('0x4'));var util=require(_0x54ad('0x5'));var path=require(_0x54ad('0x6'));var sox=require('sox');var csv=require(_0x54ad('0x7'));var ejs=require(_0x54ad('0x8'));var fs=require('fs');var fs_extra=require(_0x54ad('0x9'));var _=require('lodash');var squel=require(_0x54ad('0xa'));var crypto=require(_0x54ad('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x54ad('0xc'));var toCsv=require(_0x54ad('0x7'));var querystring=require(_0x54ad('0xd'));var Papa=require(_0x54ad('0xe'));var Redis=require(_0x54ad('0xf'));var authService=require(_0x54ad('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x54ad('0x11'));var hardwareService=require(_0x54ad('0x12'));var logger=require(_0x54ad('0x13'))(_0x54ad('0x14'));var utils=require(_0x54ad('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x54ad('0x16'));var db=require(_0x54ad('0x17'))['db'];function respondWithStatusCode(_0x4c3467,_0x2dbe17){_0x2dbe17=_0x2dbe17||0xcc;return function(_0x3c64f0){if(_0x3c64f0){return _0x4c3467[_0x54ad('0x18')](_0x2dbe17);}return _0x4c3467['status'](_0x2dbe17)[_0x54ad('0x19')]();};}function respondWithResult(_0x5f000c,_0x442075){_0x442075=_0x442075||0xc8;return function(_0x3534ef){if(_0x3534ef){return _0x5f000c[_0x54ad('0x1a')](_0x442075)[_0x54ad('0x1b')](_0x3534ef);}};}function respondWithFilteredResult(_0x4566da,_0x474de2){return function(_0x593f0d){if(_0x593f0d){var _0x5c373b=typeof _0x474de2[_0x54ad('0x1c')]===_0x54ad('0x1d')&&typeof _0x474de2[_0x54ad('0x1e')]===_0x54ad('0x1d');var _0x10e73f=_0x593f0d['count'];var _0x443ab=_0x5c373b?0x0:_0x474de2[_0x54ad('0x1c')];var _0x4389f5=_0x5c373b?_0x593f0d[_0x54ad('0x1f')]:_0x474de2[_0x54ad('0x1c')]+_0x474de2['limit'];var _0x224fd1;if(_0x4389f5>=_0x10e73f){_0x4389f5=_0x10e73f;_0x224fd1=0xc8;}else{_0x224fd1=0xce;}_0x4566da['status'](_0x224fd1);return _0x4566da[_0x54ad('0x20')](_0x54ad('0x21'),_0x443ab+'-'+_0x4389f5+'/'+_0x10e73f)[_0x54ad('0x1b')](_0x593f0d);}return null;};}function patchUpdates(_0x4641c7){return function(_0x2a4f78){try{jsonpatch[_0x54ad('0x22')](_0x2a4f78,_0x4641c7,!![]);}catch(_0x1b082f){return BPromise[_0x54ad('0x23')](_0x1b082f);}return _0x2a4f78['save']();};}function saveUpdates(_0x4e4f79,_0x180919){return function(_0xc4fc25){if(_0xc4fc25){return _0xc4fc25[_0x54ad('0x24')](_0x4e4f79)[_0x54ad('0x25')](function(_0x459732){return _0x459732;});}return null;};}function removeEntity(_0x30e580,_0x47e532){return function(_0x282a59){if(_0x282a59){return _0x282a59[_0x54ad('0x26')]()['then'](function(){_0x30e580[_0x54ad('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33366f,_0xf38cb2){return function(_0x11e2f4){if(!_0x11e2f4){_0x33366f[_0x54ad('0x18')](0x194);}return _0x11e2f4;};}function handleError(_0x41b4a7,_0x590f83){_0x590f83=_0x590f83||0x1f4;return function(_0x23f4d0){logger['error'](_0x23f4d0['stack']);if(_0x23f4d0[_0x54ad('0x27')]){delete _0x23f4d0[_0x54ad('0x27')];}_0x41b4a7['status'](_0x590f83)[_0x54ad('0x28')](_0x23f4d0);};}exports[_0x54ad('0x29')]=function(_0x22f8c0,_0x54e667){var _0x1a61cd={},_0x4dc0a5={},_0xcffef4={'count':0x0,'rows':[]};var _0x82a360=_[_0x54ad('0x2a')](db['SmsTransferReport'][_0x54ad('0x2b')],function(_0x1dac3f){return{'name':_0x1dac3f['fieldName'],'type':_0x1dac3f[_0x54ad('0x2c')][_0x54ad('0x2d')]};});_0x4dc0a5[_0x54ad('0x2e')]=_[_0x54ad('0x2a')](_0x82a360,_0x54ad('0x27'));_0x4dc0a5[_0x54ad('0x2f')]=_['keys'](_0x22f8c0[_0x54ad('0x2f')]);_0x4dc0a5[_0x54ad('0x30')]=_[_0x54ad('0x31')](_0x4dc0a5[_0x54ad('0x2e')],_0x4dc0a5[_0x54ad('0x2f')]);_0x1a61cd['attributes']=_[_0x54ad('0x31')](_0x4dc0a5[_0x54ad('0x2e')],qs['fields'](_0x22f8c0[_0x54ad('0x2f')][_0x54ad('0x32')]));_0x1a61cd[_0x54ad('0x33')]=_0x1a61cd[_0x54ad('0x33')][_0x54ad('0x34')]?_0x1a61cd[_0x54ad('0x33')]:_0x4dc0a5[_0x54ad('0x2e')];if(!_0x22f8c0[_0x54ad('0x2f')][_0x54ad('0x35')](_0x54ad('0x36'))){_0x1a61cd[_0x54ad('0x1e')]=qs[_0x54ad('0x1e')](_0x22f8c0[_0x54ad('0x2f')][_0x54ad('0x1e')]);_0x1a61cd[_0x54ad('0x1c')]=qs[_0x54ad('0x1c')](_0x22f8c0[_0x54ad('0x2f')]['offset']);}_0x1a61cd[_0x54ad('0x37')]=qs[_0x54ad('0x38')](_0x22f8c0['query']['sort']);_0x1a61cd[_0x54ad('0x39')]=qs[_0x54ad('0x30')](_[_0x54ad('0x3a')](_0x22f8c0[_0x54ad('0x2f')],_0x4dc0a5[_0x54ad('0x30')]),_0x82a360);if(_0x22f8c0[_0x54ad('0x2f')]['filter']){_0x1a61cd[_0x54ad('0x39')]=_[_0x54ad('0x3b')](_0x1a61cd[_0x54ad('0x39')],{'$or':_['map'](_0x82a360,function(_0x8f1662){if(_0x8f1662['type']!==_0x54ad('0x3c')){var _0x5da276={};_0x5da276[_0x8f1662[_0x54ad('0x27')]]={'$like':'%'+_0x22f8c0['query'][_0x54ad('0x3d')]+'%'};return _0x5da276;}})});}_0x1a61cd=_[_0x54ad('0x3b')]({},_0x1a61cd,_0x22f8c0['options']);var _0x12811b={'where':_0x1a61cd[_0x54ad('0x39')]};return db[_0x54ad('0x3e')]['count'](_0x12811b)['then'](function(_0x3f707a){_0xcffef4[_0x54ad('0x1f')]=_0x3f707a;if(_0x22f8c0[_0x54ad('0x2f')][_0x54ad('0x3f')]){_0x1a61cd['include']=[{'all':!![]}];}return db[_0x54ad('0x3e')][_0x54ad('0x40')](_0x1a61cd);})[_0x54ad('0x25')](function(_0xbfbd1){_0xcffef4[_0x54ad('0x41')]=_0xbfbd1;return _0xcffef4;})[_0x54ad('0x25')](respondWithFilteredResult(_0x54e667,_0x1a61cd))[_0x54ad('0x42')](handleError(_0x54e667,null));};exports[_0x54ad('0x43')]=function(_0x2981cc,_0x5e0ac7){var _0x304d7f={'raw':!![],'where':{'id':_0x2981cc[_0x54ad('0x44')]['id']}},_0x37fc27={};_0x37fc27[_0x54ad('0x2e')]=_[_0x54ad('0x45')](db['SmsTransferReport']['rawAttributes']);_0x37fc27[_0x54ad('0x2f')]=_['keys'](_0x2981cc[_0x54ad('0x2f')]);_0x37fc27[_0x54ad('0x30')]=_[_0x54ad('0x31')](_0x37fc27[_0x54ad('0x2e')],_0x37fc27['query']);_0x304d7f[_0x54ad('0x33')]=_[_0x54ad('0x31')](_0x37fc27[_0x54ad('0x2e')],qs[_0x54ad('0x32')](_0x2981cc[_0x54ad('0x2f')][_0x54ad('0x32')]));_0x304d7f[_0x54ad('0x33')]=_0x304d7f[_0x54ad('0x33')][_0x54ad('0x34')]?_0x304d7f[_0x54ad('0x33')]:_0x37fc27['model'];if(_0x2981cc[_0x54ad('0x2f')][_0x54ad('0x3f')]){_0x304d7f['include']=[{'all':!![]}];}_0x304d7f=_[_0x54ad('0x3b')]({},_0x304d7f,_0x2981cc['options']);return db[_0x54ad('0x3e')]['find'](_0x304d7f)[_0x54ad('0x25')](handleEntityNotFound(_0x5e0ac7,null))[_0x54ad('0x25')](respondWithResult(_0x5e0ac7,null))[_0x54ad('0x42')](handleError(_0x5e0ac7,null));};exports[_0x54ad('0x46')]=function(_0x189502,_0x43a46b){return db[_0x54ad('0x3e')][_0x54ad('0x46')](_0x189502[_0x54ad('0x47')],{})[_0x54ad('0x25')](respondWithResult(_0x43a46b,0xc9))[_0x54ad('0x42')](handleError(_0x43a46b,null));};exports['update']=function(_0x1941c0,_0x54b123){if(_0x1941c0[_0x54ad('0x47')]['id']){delete _0x1941c0[_0x54ad('0x47')]['id'];}return db[_0x54ad('0x3e')]['find']({'where':{'id':_0x1941c0['params']['id']}})[_0x54ad('0x25')](handleEntityNotFound(_0x54b123,null))[_0x54ad('0x25')](saveUpdates(_0x1941c0['body'],null))[_0x54ad('0x25')](respondWithResult(_0x54b123,null))[_0x54ad('0x42')](handleError(_0x54b123,null));};exports[_0x54ad('0x26')]=function(_0x33727a,_0x4b8997){return db[_0x54ad('0x3e')][_0x54ad('0x48')]({'where':{'id':_0x33727a[_0x54ad('0x44')]['id']}})[_0x54ad('0x25')](handleEntityNotFound(_0x4b8997,null))[_0x54ad('0x25')](removeEntity(_0x4b8997,null))['catch'](handleError(_0x4b8997,null));};exports['describe']=function(_0x567bdb,_0xa414a5){return db[_0x54ad('0x3e')][_0x54ad('0x49')]()[_0x54ad('0x25')](respondWithResult(_0xa414a5,null))[_0x54ad('0x42')](handleError(_0xa414a5,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 96d7425..c888fd2 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 _0xc6e6=['path','./smsTransferReport.attributes','exports','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x16efcd,_0x52bc16){var _0x298b68=function(_0x550c8c){while(--_0x550c8c){_0x16efcd['push'](_0x16efcd['shift']());}};_0x298b68(++_0x52bc16);}(_0xc6e6,0xc2));var _0x6c6e=function(_0x5f58db,_0x36e473){_0x5f58db=_0x5f58db-0x0;var _0x59dcc4=_0xc6e6[_0x5f58db];return _0x59dcc4;};'use strict';var _=require(_0x6c6e('0x0'));var util=require(_0x6c6e('0x1'));var logger=require(_0x6c6e('0x2'))(_0x6c6e('0x3'));var moment=require('moment');var BPromise=require(_0x6c6e('0x4'));var rp=require(_0x6c6e('0x5'));var fs=require('fs');var path=require(_0x6c6e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6c6e('0x7'));module[_0x6c6e('0x8')]=function(_0x4d2b66,_0x32c759){return _0x4d2b66['define']('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6c6e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2467=['lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x4db46b,_0xadcb1a){var _0x565be8=function(_0x5d2e50){while(--_0x5d2e50){_0x4db46b['push'](_0x4db46b['shift']());}};_0x565be8(++_0xadcb1a);}(_0x2467,0xfc));var _0x7246=function(_0x584422,_0x5b3fb0){_0x584422=_0x584422-0x0;var _0x2bed35=_0x2467[_0x584422];return _0x2bed35;};'use strict';var _=require(_0x7246('0x0'));var util=require('util');var logger=require(_0x7246('0x1'))('api');var moment=require(_0x7246('0x2'));var BPromise=require(_0x7246('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7246('0x4'));var rimraf=require(_0x7246('0x5'));var config=require(_0x7246('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x7246('0x7')]=function(_0x499f18,_0x4d70a2){return _0x499f18[_0x7246('0x8')](_0x7246('0x9'),attributes,{'tableName':_0x7246('0xa'),'paranoid':![],'indexes':[{'name':_0x7246('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 3c05d7c..0f990b9 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 _0xf6d1=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','catch','lodash'];(function(_0x9d85d4,_0x181e98){var _0xb6bf23=function(_0x2aa149){while(--_0x2aa149){_0x9d85d4['push'](_0x9d85d4['shift']());}};_0xb6bf23(++_0x181e98);}(_0xf6d1,0x99));var _0x1f6d=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xf6d1[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x1f6d('0x0'));var util=require(_0x1f6d('0x1'));var moment=require(_0x1f6d('0x2'));var BPromise=require(_0x1f6d('0x3'));var rs=require(_0x1f6d('0x4'));var fs=require('fs');var Redis=require(_0x1f6d('0x5'));var db=require(_0x1f6d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f6d('0x7'))('rpc');var config=require(_0x1f6d('0x8'));var jayson=require(_0x1f6d('0x9'));var client=jayson[_0x1f6d('0xa')][_0x1f6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b90fb,_0x2f8fff,_0xf4dd78){return new BPromise(function(_0x234155,_0x21813f){return client[_0x1f6d('0xc')](_0x1b90fb,_0xf4dd78)[_0x1f6d('0xd')](function(_0x23f741){logger['info'](_0x1f6d('0xe'),_0x2f8fff,'request\x20sent');logger[_0x1f6d('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x2f8fff,_0x1f6d('0x10'),JSON[_0x1f6d('0x11')](_0x23f741));if(_0x23f741[_0x1f6d('0x12')]){if(_0x23f741[_0x1f6d('0x12')]['code']===0x1f4){logger['error'](_0x1f6d('0xe'),_0x2f8fff,_0x23f741[_0x1f6d('0x12')][_0x1f6d('0x13')]);return _0x21813f(_0x23f741[_0x1f6d('0x12')][_0x1f6d('0x13')]);}logger[_0x1f6d('0x12')](_0x1f6d('0xe'),_0x2f8fff,_0x23f741[_0x1f6d('0x12')][_0x1f6d('0x13')]);return _0x234155(_0x23f741[_0x1f6d('0x12')]['message']);}else{logger[_0x1f6d('0x14')](_0x1f6d('0xe'),_0x2f8fff,_0x1f6d('0x10'));_0x234155(_0x23f741['result'][_0x1f6d('0x13')]);}})[_0x1f6d('0x15')](function(_0x58b375){logger[_0x1f6d('0x12')](_0x1f6d('0xe'),_0x2f8fff,_0x58b375);_0x21813f(_0x58b375);});});} \ No newline at end of file +var _0xdc97=['SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x55640c,_0x1678f1){var _0x5766a2=function(_0x49f6e1){while(--_0x49f6e1){_0x55640c['push'](_0x55640c['shift']());}};_0x5766a2(++_0x1678f1);}(_0xdc97,0x13b));var _0x7dc9=function(_0x514463,_0x234507){_0x514463=_0x514463-0x0;var _0x4640ef=_0xdc97[_0x514463];return _0x4640ef;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var moment=require(_0x7dc9('0x2'));var BPromise=require('bluebird');var rs=require(_0x7dc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dc9('0x4'))['db'];var utils=require(_0x7dc9('0x5'));var logger=require('../../config/logger')(_0x7dc9('0x6'));var config=require(_0x7dc9('0x7'));var jayson=require(_0x7dc9('0x8'));var client=jayson[_0x7dc9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2636ef,_0x4f91c7,_0x4b3229){return new BPromise(function(_0x2ff923,_0x23737d){return client[_0x7dc9('0xa')](_0x2636ef,_0x4b3229)[_0x7dc9('0xb')](function(_0x3dd07e){logger['info'](_0x7dc9('0xc'),_0x4f91c7,_0x7dc9('0xd'));logger[_0x7dc9('0xe')](_0x7dc9('0xf'),_0x4f91c7,_0x7dc9('0xd'),JSON[_0x7dc9('0x10')](_0x3dd07e));if(_0x3dd07e[_0x7dc9('0x11')]){if(_0x3dd07e['error']['code']===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x4f91c7,_0x3dd07e[_0x7dc9('0x11')][_0x7dc9('0x12')]);return _0x23737d(_0x3dd07e['error'][_0x7dc9('0x12')]);}logger[_0x7dc9('0x11')](_0x7dc9('0xc'),_0x4f91c7,_0x3dd07e[_0x7dc9('0x11')][_0x7dc9('0x12')]);return _0x2ff923(_0x3dd07e[_0x7dc9('0x11')]['message']);}else{logger[_0x7dc9('0x13')](_0x7dc9('0xc'),_0x4f91c7,_0x7dc9('0xd'));_0x2ff923(_0x3dd07e[_0x7dc9('0x14')][_0x7dc9('0x12')]);}})[_0x7dc9('0x15')](function(_0x45698c){logger[_0x7dc9('0x11')](_0x7dc9('0xc'),_0x4f91c7,_0x45698c);_0x23737d(_0x45698c);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 193b0df..193a7fe 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 _0xcdb3=['diskStorage','join','root','originalname','format','%s-%s%s','basename','extname','now','file','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','show','download'];(function(_0x4e7ff8,_0x3b1d28){var _0x2de647=function(_0x4b605b){while(--_0x4b605b){_0x4e7ff8['push'](_0x4e7ff8['shift']());}};_0x2de647(++_0x3b1d28);}(_0xcdb3,0x1c2));var _0x3cdb=function(_0x312e50,_0x3bfe30){_0x312e50=_0x312e50-0x0;var _0x4e581d=_0xcdb3[_0x312e50];return _0x4e581d;};'use strict';var multer=require('multer');var util=require(_0x3cdb('0x0'));var path=require(_0x3cdb('0x1'));var timeout=require(_0x3cdb('0x2'));var express=require(_0x3cdb('0x3'));var router=express[_0x3cdb('0x4')]();var fs_extra=require(_0x3cdb('0x5'));var auth=require(_0x3cdb('0x6'));var interaction=require(_0x3cdb('0x7'));var config=require(_0x3cdb('0x8'));var controller=require(_0x3cdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3cdb('0xa')]('/:id',auth[_0x3cdb('0xb')](),controller[_0x3cdb('0xc')]);router['get']('/:id/download',auth[_0x3cdb('0xb')](),controller[_0x3cdb('0xd')]);var upload=multer({'storage':multer[_0x3cdb('0xe')]({'destination':function(_0x1cd43f,_0x9c7f17,_0x21fd29){_0x21fd29(null,path[_0x3cdb('0xf')](config[_0x3cdb('0x10')],'server/files/sounds/original/'));},'filename':function(_0x13433b,_0x52f704,_0xc99b5d){_0x52f704[_0x3cdb('0x11')]=_0x52f704[_0x3cdb('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xc99b5d(null,util[_0x3cdb('0x12')](_0x3cdb('0x13'),path[_0x3cdb('0x14')](_0x52f704[_0x3cdb('0x11')],path[_0x3cdb('0x15')](_0x52f704[_0x3cdb('0x11')])),Date[_0x3cdb('0x16')](),path[_0x3cdb('0x15')](_0x52f704[_0x3cdb('0x11')])));}})});router['post']('/',upload['single'](_0x3cdb('0x17')),controller['create']);router[_0x3cdb('0x18')](_0x3cdb('0x19'),auth[_0x3cdb('0xb')](),controller[_0x3cdb('0x1a')]);router[_0x3cdb('0x1b')]('/:id',auth[_0x3cdb('0xb')](),controller[_0x3cdb('0x1b')]);module[_0x3cdb('0x1c')]=router; \ No newline at end of file +var _0xd87a=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','basename','extname','now','single','file','create','put','update','exports','multer','util','path'];(function(_0x2550ef,_0x56ef46){var _0x2ed0e4=function(_0x556147){while(--_0x556147){_0x2550ef['push'](_0x2550ef['shift']());}};_0x2ed0e4(++_0x56ef46);}(_0xd87a,0x98));var _0xad87=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0xd87a[_0x28394f];return _0x2618d2;};'use strict';var multer=require(_0xad87('0x0'));var util=require(_0xad87('0x1'));var path=require(_0xad87('0x2'));var timeout=require(_0xad87('0x3'));var express=require('express');var router=express[_0xad87('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xad87('0x5'));var config=require(_0xad87('0x6'));var controller=require(_0xad87('0x7'));router[_0xad87('0x8')]('/',auth[_0xad87('0x9')](),controller[_0xad87('0xa')]);router[_0xad87('0x8')](_0xad87('0xb'),auth[_0xad87('0x9')](),controller[_0xad87('0xc')]);router[_0xad87('0x8')](_0xad87('0xd'),auth[_0xad87('0x9')](),controller[_0xad87('0xe')]);var upload=multer({'storage':multer[_0xad87('0xf')]({'destination':function(_0x105d35,_0x1b8082,_0x149a8c){_0x149a8c(null,path[_0xad87('0x10')](config[_0xad87('0x11')],_0xad87('0x12')));},'filename':function(_0x56a4f6,_0x2bc88d,_0x2aec9d){_0x2bc88d[_0xad87('0x13')]=_0x2bc88d['originalname'][_0xad87('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2aec9d(null,util[_0xad87('0x15')]('%s-%s%s',path[_0xad87('0x16')](_0x2bc88d['originalname'],path[_0xad87('0x17')](_0x2bc88d[_0xad87('0x13')])),Date[_0xad87('0x18')](),path[_0xad87('0x17')](_0x2bc88d[_0xad87('0x13')])));}})});router['post']('/',upload[_0xad87('0x19')](_0xad87('0x1a')),controller[_0xad87('0x1b')]);router[_0xad87('0x1c')](_0xad87('0xb'),auth[_0xad87('0x9')](),controller[_0xad87('0x1d')]);router['delete']('/:id',auth['isAuthenticated'](),controller['delete']);module[_0xad87('0x1e')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index ad8a867..22e62f8 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 _0x2fe5=['FLOAT','INTEGER','BIGINT','sequelize','STRING','name'];(function(_0x3494e8,_0x4111ea){var _0x20bd8c=function(_0x2f8fcd){while(--_0x2f8fcd){_0x3494e8['push'](_0x3494e8['shift']());}};_0x20bd8c(++_0x4111ea);}(_0x2fe5,0xd5));var _0x52fe=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2fe5[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x52fe('0x0'));module['exports']={'name':{'type':Sequelize[_0x52fe('0x1')],'unique':_0x52fe('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x52fe('0x1')]},'display_name':{'type':Sequelize[_0x52fe('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x52fe('0x1')]},'original_format':{'type':Sequelize[_0x52fe('0x1')]},'original_duration':{'type':Sequelize[_0x52fe('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x52fe('0x4')]},'original_bitRate':{'type':Sequelize[_0x52fe('0x5')]},'original_sampleRate':{'type':Sequelize[_0x52fe('0x4')]},'converted_format':{'type':Sequelize[_0x52fe('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x52fe('0x5')]},'converted_channelCount':{'type':Sequelize[_0x52fe('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xcf8f=['sequelize','exports','STRING','FLOAT','INTEGER','BIGINT'];(function(_0x411dbe,_0x436cde){var _0x57efb0=function(_0xab6225){while(--_0xab6225){_0x411dbe['push'](_0x411dbe['shift']());}};_0x57efb0(++_0x436cde);}(_0xcf8f,0x102));var _0xfcf8=function(_0x440bd6,_0x6ee88d){_0x440bd6=_0x440bd6-0x0;var _0x9ca3d8=_0xcf8f[_0x440bd6];return _0x9ca3d8;};'use strict';var Sequelize=require(_0xfcf8('0x0'));module[_0xfcf8('0x1')]={'name':{'type':Sequelize[_0xfcf8('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xfcf8('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xfcf8('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xfcf8('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xfcf8('0x4')]},'original_bitRate':{'type':Sequelize[_0xfcf8('0x5')]},'original_sampleRate':{'type':Sequelize[_0xfcf8('0x4')]},'converted_format':{'type':Sequelize[_0xfcf8('0x2')]},'converted_duration':{'type':Sequelize[_0xfcf8('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xfcf8('0x5')]},'converted_channelCount':{'type':Sequelize[_0xfcf8('0x4')]},'converted_bitRate':{'type':Sequelize[_0xfcf8('0x5')]},'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 286a284..03d116d 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 _0xc19e=['get','UserProfileResource','destroy','error','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','save_name','converted_format','existsSync','root','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','join','format','%s.%s','create','file','originalname','extname','basename','filename','substring','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','wav','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','autoAssociation','start','body','delete','server/files/sounds/original','original_format','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','update','then'];(function(_0x255d6f,_0x2c31d1){var _0x3c3ebe=function(_0x310372){while(--_0x310372){_0x255d6f['push'](_0x255d6f['shift']());}};_0x3c3ebe(++_0x2c31d1);}(_0xc19e,0xd6));var _0xec19=function(_0x31319f,_0x170d49){_0x31319f=_0x31319f-0x0;var _0x45fcb7=_0xc19e[_0x31319f];return _0x45fcb7;};'use strict';var emlformat=require(_0xec19('0x0'));var rimraf=require(_0xec19('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xec19('0x2'));var moment=require(_0xec19('0x3'));var BPromise=require(_0xec19('0x4'));var Mustache=require(_0xec19('0x5'));var util=require(_0xec19('0x6'));var path=require(_0xec19('0x7'));var sox=require(_0xec19('0x8'));var csv=require(_0xec19('0x9'));var ejs=require(_0xec19('0xa'));var fs=require('fs');var fs_extra=require(_0xec19('0xb'));var _=require(_0xec19('0xc'));var squel=require(_0xec19('0xd'));var crypto=require('crypto');var jsforce=require(_0xec19('0xe'));var deskjs=require(_0xec19('0xf'));var toCsv=require(_0xec19('0x9'));var querystring=require(_0xec19('0x10'));var Papa=require('papaparse');var Redis=require(_0xec19('0x11'));var authService=require(_0xec19('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xec19('0x13'));var hardwareService=require(_0xec19('0x14'));var logger=require('../../config/logger')(_0xec19('0x15'));var utils=require('../../config/utils');var config=require(_0xec19('0x16'));var licenseUtil=require(_0xec19('0x17'));var db=require(_0xec19('0x18'))['db'];function respondWithStatusCode(_0x369265,_0x1043e9){_0x1043e9=_0x1043e9||0xcc;return function(_0x6c3670){if(_0x6c3670){return _0x369265['sendStatus'](_0x1043e9);}return _0x369265[_0xec19('0x19')](_0x1043e9)[_0xec19('0x1a')]();};}function respondWithResult(_0x148ba0,_0x129c76){_0x129c76=_0x129c76||0xc8;return function(_0x5dae7c){if(_0x5dae7c){return _0x148ba0[_0xec19('0x19')](_0x129c76)[_0xec19('0x1b')](_0x5dae7c);}};}function respondWithFilteredResult(_0x49d6e4,_0xddb112){return function(_0x35496b){if(_0x35496b){var _0x3091e3=typeof _0xddb112[_0xec19('0x1c')]===_0xec19('0x1d')&&typeof _0xddb112[_0xec19('0x1e')]===_0xec19('0x1d');var _0x8e206c=_0x35496b[_0xec19('0x1f')];var _0x2e24dd=_0x3091e3?0x0:_0xddb112[_0xec19('0x1c')];var _0x2c776c=_0x3091e3?_0x35496b[_0xec19('0x1f')]:_0xddb112[_0xec19('0x1c')]+_0xddb112[_0xec19('0x1e')];var _0x366e26;if(_0x2c776c>=_0x8e206c){_0x2c776c=_0x8e206c;_0x366e26=0xc8;}else{_0x366e26=0xce;}_0x49d6e4[_0xec19('0x19')](_0x366e26);return _0x49d6e4[_0xec19('0x20')]('Content-Range',_0x2e24dd+'-'+_0x2c776c+'/'+_0x8e206c)[_0xec19('0x1b')](_0x35496b);}return null;};}function patchUpdates(_0x26df17){return function(_0x463dd0){try{jsonpatch[_0xec19('0x21')](_0x463dd0,_0x26df17,!![]);}catch(_0x268244){return BPromise['reject'](_0x268244);}return _0x463dd0['save']();};}function saveUpdates(_0x3ff2be,_0x3432d0){return function(_0xad4a69){if(_0xad4a69){return _0xad4a69[_0xec19('0x22')](_0x3ff2be)['then'](function(_0x538ea9){return _0x538ea9;});}return null;};}function removeEntity(_0x3efffe,_0x49c835){return function(_0x5704e6){if(_0x5704e6){return _0x5704e6['destroy']()[_0xec19('0x23')](function(){var _0x2030e3=_0x5704e6[_0xec19('0x24')]({'plain':!![]});var _0x1a401d='Sounds';return db[_0xec19('0x25')][_0xec19('0x26')]({'where':{'type':_0x1a401d,'resourceId':_0x2030e3['id']}})['then'](function(){return _0x5704e6;});})[_0xec19('0x23')](function(){_0x3efffe['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35d0fe,_0x229729){return function(_0x2c67ee){if(!_0x2c67ee){_0x35d0fe['sendStatus'](0x194);}return _0x2c67ee;};}function handleError(_0x47743e,_0x300668){_0x300668=_0x300668||0x1f4;return function(_0x555ce9){logger[_0xec19('0x27')](_0x555ce9['stack']);if(_0x555ce9[_0xec19('0x28')]){delete _0x555ce9[_0xec19('0x28')];}_0x47743e[_0xec19('0x19')](_0x300668)[_0xec19('0x29')](_0x555ce9);};}exports[_0xec19('0x2a')]=function(_0x3200cb,_0x54c3b7){var _0x36025c={},_0x11dcce={},_0x510451={'count':0x0,'rows':[]};var _0x378bac=_[_0xec19('0x2b')](db[_0xec19('0x2c')][_0xec19('0x2d')],function(_0x5c005a){return{'name':_0x5c005a[_0xec19('0x2e')],'type':_0x5c005a[_0xec19('0x2f')][_0xec19('0x30')]};});_0x11dcce[_0xec19('0x31')]=_['map'](_0x378bac,_0xec19('0x28'));_0x11dcce['query']=_[_0xec19('0x32')](_0x3200cb[_0xec19('0x33')]);_0x11dcce[_0xec19('0x34')]=_[_0xec19('0x35')](_0x11dcce[_0xec19('0x31')],_0x11dcce[_0xec19('0x33')]);_0x36025c[_0xec19('0x36')]=_[_0xec19('0x35')](_0x11dcce[_0xec19('0x31')],qs[_0xec19('0x37')](_0x3200cb[_0xec19('0x33')]['fields']));_0x36025c['attributes']=_0x36025c[_0xec19('0x36')][_0xec19('0x38')]?_0x36025c['attributes']:_0x11dcce[_0xec19('0x31')];if(!_0x3200cb[_0xec19('0x33')][_0xec19('0x39')](_0xec19('0x3a'))){_0x36025c[_0xec19('0x1e')]=qs['limit'](_0x3200cb['query'][_0xec19('0x1e')]);_0x36025c['offset']=qs[_0xec19('0x1c')](_0x3200cb['query'][_0xec19('0x1c')]);}_0x36025c[_0xec19('0x3b')]=qs[_0xec19('0x3c')](_0x3200cb[_0xec19('0x33')][_0xec19('0x3c')]);_0x36025c[_0xec19('0x3d')]=qs[_0xec19('0x34')](_[_0xec19('0x3e')](_0x3200cb[_0xec19('0x33')],_0x11dcce[_0xec19('0x34')]),_0x378bac);if(_0x3200cb[_0xec19('0x33')]['filter']){_0x36025c[_0xec19('0x3d')]=_[_0xec19('0x3f')](_0x36025c['where'],{'$or':_[_0xec19('0x2b')](_0x378bac,function(_0x18a183){if(_0x18a183[_0xec19('0x2f')]!==_0xec19('0x40')){var _0x4bc8c7={};_0x4bc8c7[_0x18a183['name']]={'$like':'%'+_0x3200cb[_0xec19('0x33')][_0xec19('0x41')]+'%'};return _0x4bc8c7;}})});}_0x36025c=_['merge']({},_0x36025c,_0x3200cb[_0xec19('0x42')]);var _0x685fe4={'where':_0x36025c[_0xec19('0x3d')]};return db['Sound'][_0xec19('0x1f')](_0x685fe4)[_0xec19('0x23')](function(_0x3d4930){_0x510451[_0xec19('0x1f')]=_0x3d4930;if(_0x3200cb['query'][_0xec19('0x43')]){_0x36025c[_0xec19('0x44')]=[{'all':!![]}];}return db[_0xec19('0x2c')][_0xec19('0x45')](_0x36025c);})[_0xec19('0x23')](function(_0x1fcd36){_0x510451[_0xec19('0x46')]=_0x1fcd36;return _0x510451;})[_0xec19('0x23')](respondWithFilteredResult(_0x54c3b7,_0x36025c))[_0xec19('0x47')](handleError(_0x54c3b7,null));};exports[_0xec19('0x48')]=function(_0xf8f4e3,_0x2700dd){var _0x504b27={'raw':!![],'where':{'id':_0xf8f4e3[_0xec19('0x49')]['id']}},_0x204f51={};_0x204f51['model']=_['keys'](db['Sound'][_0xec19('0x2d')]);_0x204f51['query']=_[_0xec19('0x32')](_0xf8f4e3[_0xec19('0x33')]);_0x204f51[_0xec19('0x34')]=_[_0xec19('0x35')](_0x204f51[_0xec19('0x31')],_0x204f51[_0xec19('0x33')]);_0x504b27[_0xec19('0x36')]=_['intersection'](_0x204f51[_0xec19('0x31')],qs[_0xec19('0x37')](_0xf8f4e3['query']['fields']));_0x504b27['attributes']=_0x504b27[_0xec19('0x36')][_0xec19('0x38')]?_0x504b27[_0xec19('0x36')]:_0x204f51[_0xec19('0x31')];if(_0xf8f4e3[_0xec19('0x33')][_0xec19('0x43')]){_0x504b27[_0xec19('0x44')]=[{'all':!![]}];}_0x504b27=_[_0xec19('0x3f')]({},_0x504b27,_0xf8f4e3['options']);return db['Sound'][_0xec19('0x4a')](_0x504b27)[_0xec19('0x23')](handleEntityNotFound(_0x2700dd,null))[_0xec19('0x23')](respondWithResult(_0x2700dd,null))[_0xec19('0x47')](handleError(_0x2700dd,null));};exports['download']=function(_0x1825a7,_0x26409c,_0x57cc0f){return db[_0xec19('0x2c')][_0xec19('0x4a')]({'where':{'id':_0x1825a7[_0xec19('0x49')]['id']},'attributes':[_0xec19('0x28'),_0xec19('0x4b'),_0xec19('0x4c')],'raw':!![]})[_0xec19('0x23')](handleEntityNotFound(_0x26409c,null))[_0xec19('0x23')](function(_0x166d96){if(_0x166d96){if(!fs[_0xec19('0x4d')](path['join'](config[_0xec19('0x4e')],_0xec19('0x4f'),_0x166d96[_0xec19('0x4b')]+'.'+_0x166d96[_0xec19('0x4c')]))){throw new db['Sequelize'][(_0xec19('0x50'))](_0xec19('0x51'));}return _0x26409c['download'](path[_0xec19('0x52')](config['root'],'server/files/sounds/converted',util[_0xec19('0x53')](_0xec19('0x54'),_0x166d96[_0xec19('0x4b')],_0x166d96['converted_format'])),util[_0xec19('0x53')](_0xec19('0x54'),_0x166d96[_0xec19('0x28')],_0x166d96[_0xec19('0x4c')]));}return null;})[_0xec19('0x47')](handleError(_0x26409c,null));};exports[_0xec19('0x55')]=function(_0x29b063,_0x55b4f5,_0x590e1a){var _0x4e8f6c={'name':path['basename'](_0x29b063[_0xec19('0x56')][_0xec19('0x57')],path[_0xec19('0x58')](_0x29b063[_0xec19('0x56')][_0xec19('0x57')])),'save_name':path[_0xec19('0x59')](_0x29b063[_0xec19('0x56')][_0xec19('0x5a')],path[_0xec19('0x58')](_0x29b063[_0xec19('0x56')][_0xec19('0x5a')])),'original_format':path[_0xec19('0x58')](_0x29b063['file'][_0xec19('0x57')])[_0xec19('0x5b')](0x1),'converted_format':'wav'};var _0x33524b=path['join'](config[_0xec19('0x4e')],'server/files/sounds/original',_0x29b063[_0xec19('0x56')][_0xec19('0x5a')]);var _0x4f67ae=path['join'](config[_0xec19('0x4e')],'server/files/sounds/converted',util[_0xec19('0x53')](_0xec19('0x54'),path[_0xec19('0x59')](_0x29b063[_0xec19('0x56')][_0xec19('0x5a')],path[_0xec19('0x58')](_0x29b063[_0xec19('0x56')][_0xec19('0x5a')])),_0x4e8f6c[_0xec19('0x4c')]));logger[_0xec19('0x5c')](_0xec19('0x5d'),_0x33524b);logger['info'](_0xec19('0x5e'),_0x4f67ae);try{fs[_0xec19('0x5f')](_0x33524b,parseInt('0777',0x8));var _0x22fa44=sox[_0xec19('0x60')](_0x33524b,_0x4f67ae,{'sampleRate':0x1f40,'format':_0xec19('0x61'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x22fa44['on']('error',function(_0x3b26d2){fs[_0xec19('0x62')](_0x33524b);_0x55b4f5['status'](0x1f4)[_0xec19('0x29')](_0x3b26d2);});_0x22fa44['on']('src',function(_0x11e63c){_0x4e8f6c[_0xec19('0x63')]=isNaN(_0x11e63c[_0xec19('0x64')])?null:_0x11e63c[_0xec19('0x64')]*0x3e8;_0x4e8f6c[_0xec19('0x65')]=isNaN(_0x11e63c[_0xec19('0x66')])?null:_0x11e63c[_0xec19('0x66')];_0x4e8f6c[_0xec19('0x67')]=isNaN(_0x11e63c[_0xec19('0x68')])?null:_0x11e63c[_0xec19('0x68')];_0x4e8f6c['original_bitRate']=isNaN(_0x11e63c[_0xec19('0x69')])?null:_0x11e63c[_0xec19('0x69')];_0x4e8f6c[_0xec19('0x6a')]=isNaN(_0x11e63c['sampleRate'])?null:_0x11e63c[_0xec19('0x6b')];});_0x22fa44['on'](_0xec19('0x6c'),function(_0x297cc1){_0x4e8f6c[_0xec19('0x6d')]=isNaN(_0x297cc1[_0xec19('0x64')])?null:_0x297cc1[_0xec19('0x64')]*0x3e8;_0x4e8f6c[_0xec19('0x6e')]=isNaN(_0x297cc1[_0xec19('0x66')])?null:_0x297cc1[_0xec19('0x66')];_0x4e8f6c[_0xec19('0x6f')]=isNaN(_0x297cc1[_0xec19('0x68')])?null:_0x297cc1[_0xec19('0x68')];_0x4e8f6c[_0xec19('0x70')]=isNaN(_0x297cc1[_0xec19('0x69')])?null:_0x297cc1[_0xec19('0x69')];_0x4e8f6c[_0xec19('0x71')]=isNaN(_0x297cc1[_0xec19('0x6b')])?null:_0x297cc1[_0xec19('0x6b')];});_0x22fa44['on'](_0xec19('0x1a'),function(){fs['chmodSync'](_0x4f67ae,parseInt('0777',0x8));return db[_0xec19('0x2c')]['create'](_0x4e8f6c)['then'](function(_0x413e31){var _0x474483={'role':_0x29b063['body']['role'],'userProfileId':_0x29b063['body'][_0xec19('0x72')]};if(!_0x474483)throw new Error(_0xec19('0x73'));if(_0x474483['role']===_0xec19('0x74')){var _0x520e34=_0x413e31['get']({'plain':!![]});return db[_0xec19('0x75')]['find']({'where':{'name':_0xec19('0x76'),'userProfileId':_0x474483[_0xec19('0x72')]},'raw':!![]})[_0xec19('0x23')](function(_0x29fd48){if(_0x29fd48&&_0x29fd48[_0xec19('0x77')]===0x0){return db[_0xec19('0x25')][_0xec19('0x55')]({'name':_0x520e34[_0xec19('0x28')],'resourceId':_0x520e34['id'],'type':_0x29fd48[_0xec19('0x28')],'sectionId':_0x29fd48['id']},{})[_0xec19('0x23')](function(){return _0x413e31;});}else{return _0x413e31;}})[_0xec19('0x47')](function(_0x1ba7cf){logger[_0xec19('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ba7cf);throw _0x1ba7cf;});}return _0x413e31;})[_0xec19('0x23')](respondWithResult(_0x55b4f5,null))[_0xec19('0x47')](handleError(_0x55b4f5,null));});_0x22fa44[_0xec19('0x78')]();}catch(_0x393c8f){_0x55b4f5[_0xec19('0x19')](0x1f4)[_0xec19('0x29')](_0x393c8f);}};exports[_0xec19('0x22')]=function(_0x89de9b,_0x17d8a9,_0x490e5f){return db['Sound']['find']({'where':{'id':_0x89de9b[_0xec19('0x49')]['id']}})[_0xec19('0x23')](handleEntityNotFound(_0x17d8a9,null))[_0xec19('0x23')](saveUpdates(_[_0xec19('0x3e')](_0x89de9b[_0xec19('0x79')],[_0xec19('0x28'),'description']),null))[_0xec19('0x23')](respondWithResult(_0x17d8a9,null))['catch'](handleError(_0x17d8a9,null));};exports[_0xec19('0x7a')]=function(_0xd628d,_0x302455,_0x5c60be){return db['Sound'][_0xec19('0x4a')]({'where':{'id':_0xd628d[_0xec19('0x49')]['id']}})[_0xec19('0x23')](function(_0x4746c6){if(_0x4746c6){return _0x4746c6[_0xec19('0x26')]();}})[_0xec19('0x23')](function(_0x3465c5){var _0x5c3d32=path[_0xec19('0x52')](config['root'],_0xec19('0x7b'),util[_0xec19('0x53')](_0xec19('0x54'),_0x3465c5[_0xec19('0x4b')],_0x3465c5[_0xec19('0x7c')]));var _0x3f28c1=path[_0xec19('0x52')](config[_0xec19('0x4e')],_0xec19('0x4f'),util[_0xec19('0x53')]('%s.%s',_0x3465c5[_0xec19('0x4b')],_0x3465c5[_0xec19('0x4c')]));fs[_0xec19('0x62')](_0x5c3d32);fs[_0xec19('0x62')](_0x3f28c1);return _0x3465c5;})[_0xec19('0x23')](function(_0x4a29e4){if(_0x4a29e4){return _0x302455[_0xec19('0x19')](0xcc)[_0xec19('0x1a')]();}})[_0xec19('0x23')](handleEntityNotFound(_0x302455,null))['catch'](handleError(_0x302455,null));}; \ No newline at end of file +var _0x8f23=['ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','originalname','extname','file','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_sampleRate','0777','body','role','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','delete','original_format','end','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../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','then','destroy','UserProfileResource','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','length','download','find','save_name','converted_format','join','root','server/files/sounds/converted'];(function(_0x2bd443,_0x3b60d8){var _0x45159a=function(_0x1ddbec){while(--_0x1ddbec){_0x2bd443['push'](_0x2bd443['shift']());}};_0x45159a(++_0x3b60d8);}(_0x8f23,0xac));var _0x38f2=function(_0x316330,_0x44f8b6){_0x316330=_0x316330-0x0;var _0x143e4f=_0x8f23[_0x316330];return _0x143e4f;};'use strict';var emlformat=require(_0x38f2('0x0'));var rimraf=require(_0x38f2('0x1'));var zipdir=require(_0x38f2('0x2'));var jsonpatch=require(_0x38f2('0x3'));var rp=require(_0x38f2('0x4'));var moment=require(_0x38f2('0x5'));var BPromise=require(_0x38f2('0x6'));var Mustache=require(_0x38f2('0x7'));var util=require('util');var path=require(_0x38f2('0x8'));var sox=require(_0x38f2('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x38f2('0xa'));var squel=require(_0x38f2('0xb'));var crypto=require(_0x38f2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x38f2('0xd'));var toCsv=require(_0x38f2('0xe'));var querystring=require(_0x38f2('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x38f2('0x10'));var qs=require(_0x38f2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38f2('0x12'));var logger=require(_0x38f2('0x13'))(_0x38f2('0x14'));var utils=require(_0x38f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x38f2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48303c,_0x30c7d3){_0x30c7d3=_0x30c7d3||0xcc;return function(_0x4c9939){if(_0x4c9939){return _0x48303c[_0x38f2('0x17')](_0x30c7d3);}return _0x48303c['status'](_0x30c7d3)['end']();};}function respondWithResult(_0x5f17c1,_0x19ade4){_0x19ade4=_0x19ade4||0xc8;return function(_0x7b7792){if(_0x7b7792){return _0x5f17c1[_0x38f2('0x18')](_0x19ade4)[_0x38f2('0x19')](_0x7b7792);}};}function respondWithFilteredResult(_0x61e5dd,_0x579b76){return function(_0x4d12e9){if(_0x4d12e9){var _0x179ecf=typeof _0x579b76[_0x38f2('0x1a')]===_0x38f2('0x1b')&&typeof _0x579b76[_0x38f2('0x1c')]===_0x38f2('0x1b');var _0x37c30a=_0x4d12e9[_0x38f2('0x1d')];var _0x2ed9a4=_0x179ecf?0x0:_0x579b76[_0x38f2('0x1a')];var _0x103ef5=_0x179ecf?_0x4d12e9['count']:_0x579b76['offset']+_0x579b76[_0x38f2('0x1c')];var _0x5755b9;if(_0x103ef5>=_0x37c30a){_0x103ef5=_0x37c30a;_0x5755b9=0xc8;}else{_0x5755b9=0xce;}_0x61e5dd['status'](_0x5755b9);return _0x61e5dd[_0x38f2('0x1e')](_0x38f2('0x1f'),_0x2ed9a4+'-'+_0x103ef5+'/'+_0x37c30a)[_0x38f2('0x19')](_0x4d12e9);}return null;};}function patchUpdates(_0x1135da){return function(_0x14d456){try{jsonpatch[_0x38f2('0x20')](_0x14d456,_0x1135da,!![]);}catch(_0x153a53){return BPromise[_0x38f2('0x21')](_0x153a53);}return _0x14d456[_0x38f2('0x22')]();};}function saveUpdates(_0x503933,_0x512543){return function(_0x3d8d83){if(_0x3d8d83){return _0x3d8d83[_0x38f2('0x23')](_0x503933)[_0x38f2('0x24')](function(_0x260006){return _0x260006;});}return null;};}function removeEntity(_0x661dbb,_0x1d09d6){return function(_0x3315fe){if(_0x3315fe){return _0x3315fe[_0x38f2('0x25')]()[_0x38f2('0x24')](function(){var _0x435562=_0x3315fe['get']({'plain':!![]});var _0x4c7e2d='Sounds';return db[_0x38f2('0x26')][_0x38f2('0x25')]({'where':{'type':_0x4c7e2d,'resourceId':_0x435562['id']}})[_0x38f2('0x24')](function(){return _0x3315fe;});})[_0x38f2('0x24')](function(){_0x661dbb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x73e7aa,_0x6ea598){return function(_0x183a84){if(!_0x183a84){_0x73e7aa[_0x38f2('0x17')](0x194);}return _0x183a84;};}function handleError(_0x389106,_0x3d0d7e){_0x3d0d7e=_0x3d0d7e||0x1f4;return function(_0x2497d9){logger[_0x38f2('0x27')](_0x2497d9[_0x38f2('0x28')]);if(_0x2497d9[_0x38f2('0x29')]){delete _0x2497d9['name'];}_0x389106[_0x38f2('0x18')](_0x3d0d7e)[_0x38f2('0x2a')](_0x2497d9);};}exports[_0x38f2('0x2b')]=function(_0x2cb992,_0x28c45e){var _0xc28fb8={},_0x1abcd6={},_0x4707a6={'count':0x0,'rows':[]};var _0x80e6c7=_[_0x38f2('0x2c')](db[_0x38f2('0x2d')][_0x38f2('0x2e')],function(_0x2a2448){return{'name':_0x2a2448[_0x38f2('0x2f')],'type':_0x2a2448[_0x38f2('0x30')][_0x38f2('0x31')]};});_0x1abcd6[_0x38f2('0x32')]=_[_0x38f2('0x2c')](_0x80e6c7,_0x38f2('0x29'));_0x1abcd6[_0x38f2('0x33')]=_[_0x38f2('0x34')](_0x2cb992['query']);_0x1abcd6[_0x38f2('0x35')]=_[_0x38f2('0x36')](_0x1abcd6[_0x38f2('0x32')],_0x1abcd6[_0x38f2('0x33')]);_0xc28fb8[_0x38f2('0x37')]=_[_0x38f2('0x36')](_0x1abcd6['model'],qs[_0x38f2('0x38')](_0x2cb992[_0x38f2('0x33')][_0x38f2('0x38')]));_0xc28fb8['attributes']=_0xc28fb8['attributes']['length']?_0xc28fb8[_0x38f2('0x37')]:_0x1abcd6['model'];if(!_0x2cb992['query'][_0x38f2('0x39')](_0x38f2('0x3a'))){_0xc28fb8[_0x38f2('0x1c')]=qs['limit'](_0x2cb992[_0x38f2('0x33')][_0x38f2('0x1c')]);_0xc28fb8[_0x38f2('0x1a')]=qs[_0x38f2('0x1a')](_0x2cb992[_0x38f2('0x33')][_0x38f2('0x1a')]);}_0xc28fb8[_0x38f2('0x3b')]=qs['sort'](_0x2cb992[_0x38f2('0x33')]['sort']);_0xc28fb8[_0x38f2('0x3c')]=qs[_0x38f2('0x35')](_['pick'](_0x2cb992[_0x38f2('0x33')],_0x1abcd6[_0x38f2('0x35')]),_0x80e6c7);if(_0x2cb992['query']['filter']){_0xc28fb8[_0x38f2('0x3c')]=_[_0x38f2('0x3d')](_0xc28fb8[_0x38f2('0x3c')],{'$or':_['map'](_0x80e6c7,function(_0x3fda17){if(_0x3fda17[_0x38f2('0x30')]!=='VIRTUAL'){var _0x249af3={};_0x249af3[_0x3fda17[_0x38f2('0x29')]]={'$like':'%'+_0x2cb992[_0x38f2('0x33')][_0x38f2('0x3e')]+'%'};return _0x249af3;}})});}_0xc28fb8=_['merge']({},_0xc28fb8,_0x2cb992[_0x38f2('0x3f')]);var _0x55f3ce={'where':_0xc28fb8[_0x38f2('0x3c')]};return db[_0x38f2('0x2d')]['count'](_0x55f3ce)[_0x38f2('0x24')](function(_0x48ba0c){_0x4707a6[_0x38f2('0x1d')]=_0x48ba0c;if(_0x2cb992[_0x38f2('0x33')][_0x38f2('0x40')]){_0xc28fb8[_0x38f2('0x41')]=[{'all':!![]}];}return db['Sound'][_0x38f2('0x42')](_0xc28fb8);})[_0x38f2('0x24')](function(_0x1fd596){_0x4707a6[_0x38f2('0x43')]=_0x1fd596;return _0x4707a6;})['then'](respondWithFilteredResult(_0x28c45e,_0xc28fb8))[_0x38f2('0x44')](handleError(_0x28c45e,null));};exports['show']=function(_0x2cdd77,_0x3229df){var _0x3e6eaa={'raw':!![],'where':{'id':_0x2cdd77[_0x38f2('0x45')]['id']}},_0x99bb24={};_0x99bb24[_0x38f2('0x32')]=_[_0x38f2('0x34')](db['Sound'][_0x38f2('0x2e')]);_0x99bb24[_0x38f2('0x33')]=_[_0x38f2('0x34')](_0x2cdd77[_0x38f2('0x33')]);_0x99bb24[_0x38f2('0x35')]=_[_0x38f2('0x36')](_0x99bb24['model'],_0x99bb24[_0x38f2('0x33')]);_0x3e6eaa[_0x38f2('0x37')]=_[_0x38f2('0x36')](_0x99bb24['model'],qs['fields'](_0x2cdd77[_0x38f2('0x33')][_0x38f2('0x38')]));_0x3e6eaa[_0x38f2('0x37')]=_0x3e6eaa[_0x38f2('0x37')][_0x38f2('0x46')]?_0x3e6eaa['attributes']:_0x99bb24[_0x38f2('0x32')];if(_0x2cdd77[_0x38f2('0x33')]['includeAll']){_0x3e6eaa['include']=[{'all':!![]}];}_0x3e6eaa=_[_0x38f2('0x3d')]({},_0x3e6eaa,_0x2cdd77[_0x38f2('0x3f')]);return db[_0x38f2('0x2d')]['find'](_0x3e6eaa)['then'](handleEntityNotFound(_0x3229df,null))[_0x38f2('0x24')](respondWithResult(_0x3229df,null))[_0x38f2('0x44')](handleError(_0x3229df,null));};exports[_0x38f2('0x47')]=function(_0x14b41a,_0xe7eba2,_0x204480){return db[_0x38f2('0x2d')][_0x38f2('0x48')]({'where':{'id':_0x14b41a['params']['id']},'attributes':[_0x38f2('0x29'),_0x38f2('0x49'),_0x38f2('0x4a')],'raw':!![]})[_0x38f2('0x24')](handleEntityNotFound(_0xe7eba2,null))[_0x38f2('0x24')](function(_0x3ee894){if(_0x3ee894){if(!fs['existsSync'](path[_0x38f2('0x4b')](config[_0x38f2('0x4c')],_0x38f2('0x4d'),_0x3ee894[_0x38f2('0x49')]+'.'+_0x3ee894[_0x38f2('0x4a')]))){throw new db['Sequelize'][(_0x38f2('0x4e'))](_0x38f2('0x4f'));}return _0xe7eba2[_0x38f2('0x47')](path[_0x38f2('0x4b')](config[_0x38f2('0x4c')],_0x38f2('0x4d'),util[_0x38f2('0x50')](_0x38f2('0x51'),_0x3ee894['save_name'],_0x3ee894[_0x38f2('0x4a')])),util[_0x38f2('0x50')]('%s.%s',_0x3ee894[_0x38f2('0x29')],_0x3ee894[_0x38f2('0x4a')]));}return null;})[_0x38f2('0x44')](handleError(_0xe7eba2,null));};exports[_0x38f2('0x52')]=function(_0x3912d1,_0x4490ef,_0x2071bc){var _0x5496d2={'name':path[_0x38f2('0x53')](_0x3912d1['file'][_0x38f2('0x54')],path[_0x38f2('0x55')](_0x3912d1['file'][_0x38f2('0x54')])),'save_name':path['basename'](_0x3912d1[_0x38f2('0x56')][_0x38f2('0x57')],path[_0x38f2('0x55')](_0x3912d1[_0x38f2('0x56')]['filename'])),'original_format':path['extname'](_0x3912d1[_0x38f2('0x56')][_0x38f2('0x54')])[_0x38f2('0x58')](0x1),'converted_format':_0x38f2('0x59')};var _0x1227d7=path[_0x38f2('0x4b')](config[_0x38f2('0x4c')],_0x38f2('0x5a'),_0x3912d1[_0x38f2('0x56')][_0x38f2('0x57')]);var _0x107d7b=path[_0x38f2('0x4b')](config[_0x38f2('0x4c')],_0x38f2('0x4d'),util['format'](_0x38f2('0x51'),path['basename'](_0x3912d1[_0x38f2('0x56')][_0x38f2('0x57')],path[_0x38f2('0x55')](_0x3912d1[_0x38f2('0x56')][_0x38f2('0x57')])),_0x5496d2[_0x38f2('0x4a')]));logger[_0x38f2('0x5b')](_0x38f2('0x5c'),_0x1227d7);logger[_0x38f2('0x5b')](_0x38f2('0x5d'),_0x107d7b);try{fs[_0x38f2('0x5e')](_0x1227d7,parseInt('0777',0x8));var _0x2b4c3d=sox[_0x38f2('0x5f')](_0x1227d7,_0x107d7b,{'sampleRate':0x1f40,'format':_0x38f2('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2b4c3d['on'](_0x38f2('0x27'),function(_0x4f96c3){fs[_0x38f2('0x60')](_0x1227d7);_0x4490ef[_0x38f2('0x18')](0x1f4)[_0x38f2('0x2a')](_0x4f96c3);});_0x2b4c3d['on'](_0x38f2('0x61'),function(_0x4a0cd8){_0x5496d2[_0x38f2('0x62')]=isNaN(_0x4a0cd8[_0x38f2('0x63')])?null:_0x4a0cd8[_0x38f2('0x63')]*0x3e8;_0x5496d2[_0x38f2('0x64')]=isNaN(_0x4a0cd8[_0x38f2('0x65')])?null:_0x4a0cd8[_0x38f2('0x65')];_0x5496d2[_0x38f2('0x66')]=isNaN(_0x4a0cd8[_0x38f2('0x67')])?null:_0x4a0cd8[_0x38f2('0x67')];_0x5496d2['original_bitRate']=isNaN(_0x4a0cd8[_0x38f2('0x68')])?null:_0x4a0cd8['bitRate'];_0x5496d2[_0x38f2('0x69')]=isNaN(_0x4a0cd8[_0x38f2('0x6a')])?null:_0x4a0cd8[_0x38f2('0x6a')];});_0x2b4c3d['on'](_0x38f2('0x6b'),function(_0x4454cf){_0x5496d2['converted_duration']=isNaN(_0x4454cf['duration'])?null:_0x4454cf['duration']*0x3e8;_0x5496d2[_0x38f2('0x6c')]=isNaN(_0x4454cf[_0x38f2('0x65')])?null:_0x4454cf['sampleCount'];_0x5496d2['converted_channelCount']=isNaN(_0x4454cf['channelCount'])?null:_0x4454cf[_0x38f2('0x67')];_0x5496d2['converted_bitRate']=isNaN(_0x4454cf[_0x38f2('0x68')])?null:_0x4454cf[_0x38f2('0x68')];_0x5496d2[_0x38f2('0x6d')]=isNaN(_0x4454cf[_0x38f2('0x6a')])?null:_0x4454cf[_0x38f2('0x6a')];});_0x2b4c3d['on']('end',function(){fs[_0x38f2('0x5e')](_0x107d7b,parseInt(_0x38f2('0x6e'),0x8));return db[_0x38f2('0x2d')][_0x38f2('0x52')](_0x5496d2)[_0x38f2('0x24')](function(_0x4fb3ee){var _0x4a86aa={'role':_0x3912d1[_0x38f2('0x6f')][_0x38f2('0x70')],'userProfileId':_0x3912d1[_0x38f2('0x6f')]['userProfileId']};if(!_0x4a86aa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a86aa[_0x38f2('0x70')]===_0x38f2('0x71')){var _0x3caad4=_0x4fb3ee[_0x38f2('0x72')]({'plain':!![]});return db[_0x38f2('0x73')]['find']({'where':{'name':'Sounds','userProfileId':_0x4a86aa[_0x38f2('0x74')]},'raw':!![]})['then'](function(_0x6a35f3){if(_0x6a35f3&&_0x6a35f3[_0x38f2('0x75')]===0x0){return db['UserProfileResource'][_0x38f2('0x52')]({'name':_0x3caad4[_0x38f2('0x29')],'resourceId':_0x3caad4['id'],'type':_0x6a35f3[_0x38f2('0x29')],'sectionId':_0x6a35f3['id']},{})[_0x38f2('0x24')](function(){return _0x4fb3ee;});}else{return _0x4fb3ee;}})[_0x38f2('0x44')](function(_0x4c2dd4){logger[_0x38f2('0x27')](_0x38f2('0x76'),_0x4c2dd4);throw _0x4c2dd4;});}return _0x4fb3ee;})['then'](respondWithResult(_0x4490ef,null))[_0x38f2('0x44')](handleError(_0x4490ef,null));});_0x2b4c3d[_0x38f2('0x77')]();}catch(_0x5b2bd5){_0x4490ef[_0x38f2('0x18')](0x1f4)['send'](_0x5b2bd5);}};exports['update']=function(_0x20371f,_0x214edb,_0x52723b){return db[_0x38f2('0x2d')][_0x38f2('0x48')]({'where':{'id':_0x20371f[_0x38f2('0x45')]['id']}})[_0x38f2('0x24')](handleEntityNotFound(_0x214edb,null))['then'](saveUpdates(_[_0x38f2('0x78')](_0x20371f[_0x38f2('0x6f')],[_0x38f2('0x29'),_0x38f2('0x79')]),null))[_0x38f2('0x24')](respondWithResult(_0x214edb,null))[_0x38f2('0x44')](handleError(_0x214edb,null));};exports[_0x38f2('0x7a')]=function(_0x41b20b,_0x393e9f,_0x28adc1){return db['Sound']['find']({'where':{'id':_0x41b20b['params']['id']}})['then'](function(_0x46d16){if(_0x46d16){return _0x46d16[_0x38f2('0x25')]();}})[_0x38f2('0x24')](function(_0x2eae5d){var _0x36d3cd=path[_0x38f2('0x4b')](config[_0x38f2('0x4c')],_0x38f2('0x5a'),util['format'](_0x38f2('0x51'),_0x2eae5d[_0x38f2('0x49')],_0x2eae5d[_0x38f2('0x7b')]));var _0x45668b=path[_0x38f2('0x4b')](config['root'],_0x38f2('0x4d'),util[_0x38f2('0x50')]('%s.%s',_0x2eae5d[_0x38f2('0x49')],_0x2eae5d[_0x38f2('0x4a')]));fs['unlinkSync'](_0x36d3cd);fs['unlinkSync'](_0x45668b);return _0x2eae5d;})[_0x38f2('0x24')](function(_0x53d80a){if(_0x53d80a){return _0x393e9f[_0x38f2('0x18')](0xcc)[_0x38f2('0x7c')]();}})[_0x38f2('0x24')](handleEntityNotFound(_0x393e9f,null))[_0x38f2('0x44')](handleError(_0x393e9f,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 3144e06..eb5603f 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 _0x475e=['exports','Sound','tools_sounds','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./sound.attributes'];(function(_0x31c42e,_0x52292e){var _0x7a48ce=function(_0x4c0efb){while(--_0x4c0efb){_0x31c42e['push'](_0x31c42e['shift']());}};_0x7a48ce(++_0x52292e);}(_0x475e,0x158));var _0xe475=function(_0x91c468,_0x11323e){_0x91c468=_0x91c468-0x0;var _0x1a15e9=_0x475e[_0x91c468];return _0x1a15e9;};'use strict';var _=require(_0xe475('0x0'));var util=require(_0xe475('0x1'));var logger=require(_0xe475('0x2'))(_0xe475('0x3'));var moment=require(_0xe475('0x4'));var BPromise=require('bluebird');var rp=require(_0xe475('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe475('0x6'));var attributes=require(_0xe475('0x7'));module[_0xe475('0x8')]=function(_0x892044,_0x4e0a01){return _0x892044['define'](_0xe475('0x9'),attributes,{'tableName':_0xe475('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x562d=['./sound.attributes','define','Sound','tools_sounds','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5eaaba,_0x33161c){var _0x59d4b7=function(_0x8c1a2d){while(--_0x8c1a2d){_0x5eaaba['push'](_0x5eaaba['shift']());}};_0x59d4b7(++_0x33161c);}(_0x562d,0x1e4));var _0xd562=function(_0x263b9f,_0x510f5a){_0x263b9f=_0x263b9f-0x0;var _0x4db4ab=_0x562d[_0x263b9f];return _0x4db4ab;};'use strict';var _=require(_0xd562('0x0'));var util=require(_0xd562('0x1'));var logger=require('../../config/logger')(_0xd562('0x2'));var moment=require('moment');var BPromise=require(_0xd562('0x3'));var rp=require(_0xd562('0x4'));var fs=require('fs');var path=require(_0xd562('0x5'));var rimraf=require(_0xd562('0x6'));var config=require(_0xd562('0x7'));var attributes=require(_0xd562('0x8'));module['exports']=function(_0x4fa1a4,_0x18e277){return _0x4fa1a4[_0xd562('0x9')](_0xd562('0xa'),attributes,{'tableName':_0xd562('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index fba2d80..ac30fb1 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 _0x5c4a=['Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','options','raw','where','attributes','include','map','model','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info'];(function(_0x1bf065,_0x2b798a){var _0x26d36c=function(_0x4a3db9){while(--_0x4a3db9){_0x1bf065['push'](_0x1bf065['shift']());}};_0x26d36c(++_0x2b798a);}(_0x5c4a,0x1d1));var _0xa5c4=function(_0x1eb84,_0xeb0a45){_0x1eb84=_0x1eb84-0x0;var _0x1d7318=_0x5c4a[_0x1eb84];return _0x1d7318;};'use strict';var _=require(_0xa5c4('0x0'));var util=require('util');var moment=require(_0xa5c4('0x1'));var BPromise=require(_0xa5c4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa5c4('0x3'));var db=require(_0xa5c4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa5c4('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa5c4('0x6')][_0xa5c4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x46b94d,_0x3a76de,_0x2b5d0a){return new BPromise(function(_0x37bdea,_0x32832a){return client[_0xa5c4('0x8')](_0x46b94d,_0x2b5d0a)[_0xa5c4('0x9')](function(_0x5d1c26){logger[_0xa5c4('0xa')](_0xa5c4('0xb'),_0x3a76de,_0xa5c4('0xc'));logger['debug'](_0xa5c4('0xd'),_0x3a76de,_0xa5c4('0xc'),JSON[_0xa5c4('0xe')](_0x5d1c26));if(_0x5d1c26[_0xa5c4('0xf')]){if(_0x5d1c26[_0xa5c4('0xf')][_0xa5c4('0x10')]===0x1f4){logger[_0xa5c4('0xf')]('Sound,\x20%s,\x20%s',_0x3a76de,_0x5d1c26[_0xa5c4('0xf')][_0xa5c4('0x11')]);return _0x32832a(_0x5d1c26[_0xa5c4('0xf')][_0xa5c4('0x11')]);}logger[_0xa5c4('0xf')](_0xa5c4('0xb'),_0x3a76de,_0x5d1c26[_0xa5c4('0xf')][_0xa5c4('0x11')]);return _0x37bdea(_0x5d1c26[_0xa5c4('0xf')][_0xa5c4('0x11')]);}else{logger[_0xa5c4('0xa')](_0xa5c4('0xb'),_0x3a76de,_0xa5c4('0xc'));_0x37bdea(_0x5d1c26[_0xa5c4('0x12')][_0xa5c4('0x11')]);}})[_0xa5c4('0x13')](function(_0x2d5fce){logger[_0xa5c4('0xf')](_0xa5c4('0xb'),_0x3a76de,_0x2d5fce);_0x32832a(_0x2d5fce);});});}exports[_0xa5c4('0x14')]=function(_0x434da4){var _0x7bb94=this;return new Promise(function(_0x43bdae,_0x3cefcd){return db['Sound']['find']({'raw':_0x434da4[_0xa5c4('0x15')]?_0x434da4[_0xa5c4('0x15')][_0xa5c4('0x16')]===undefined?!![]:![]:!![],'where':_0x434da4['options']?_0x434da4[_0xa5c4('0x15')][_0xa5c4('0x17')]||null:null,'attributes':_0x434da4['options']?_0x434da4[_0xa5c4('0x15')][_0xa5c4('0x18')]||null:null,'include':_0x434da4['options']?_0x434da4[_0xa5c4('0x15')][_0xa5c4('0x19')]?_[_0xa5c4('0x1a')](_0x434da4[_0xa5c4('0x15')][_0xa5c4('0x19')],function(_0x4d7203){return{'model':db[_0x4d7203[_0xa5c4('0x1b')]],'as':_0x4d7203['as'],'attributes':_0x4d7203[_0xa5c4('0x18')],'include':_0x4d7203[_0xa5c4('0x19')]?_[_0xa5c4('0x1a')](_0x4d7203[_0xa5c4('0x19')],function(_0x138612){return{'model':db[_0x138612[_0xa5c4('0x1b')]],'as':_0x138612['as'],'attributes':_0x138612[_0xa5c4('0x18')],'include':_0x138612[_0xa5c4('0x19')]?_[_0xa5c4('0x1a')](_0x138612['include'],function(_0x2f04b9){return{'model':db[_0x2f04b9[_0xa5c4('0x1b')]],'as':_0x2f04b9['as'],'attributes':_0x2f04b9[_0xa5c4('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1569f){logger[_0xa5c4('0xa')](_0xa5c4('0x14'),_0x434da4);logger['debug'](_0xa5c4('0x14'),_0x434da4,JSON[_0xa5c4('0xe')](_0x1569f));_0x43bdae(_0x1569f);})[_0xa5c4('0x13')](function(_0x5c8e67){logger['error'](_0xa5c4('0x14'),_0x5c8e67[_0xa5c4('0x11')],_0x434da4);_0x3cefcd(_0x7bb94['error'](0x1f4,_0x5c8e67['message']));});});}; \ No newline at end of file +var _0xc0dd=['Sound,\x20%s,\x20%s,\x20%s','stringify','code','error','Sound,\x20%s,\x20%s','message','catch','ShowSound','find','options','raw','where','attributes','include','map','model','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x1ef720,_0x228c82){var _0x17add3=function(_0x551e0e){while(--_0x551e0e){_0x1ef720['push'](_0x1ef720['shift']());}};_0x17add3(++_0x228c82);}(_0xc0dd,0x1be));var _0xdc0d=function(_0x156eb3,_0x5026e3){_0x156eb3=_0x156eb3-0x0;var _0x4d5276=_0xc0dd[_0x156eb3];return _0x4d5276;};'use strict';var _=require(_0xdc0d('0x0'));var util=require('util');var moment=require(_0xdc0d('0x1'));var BPromise=require(_0xdc0d('0x2'));var rs=require(_0xdc0d('0x3'));var fs=require('fs');var Redis=require(_0xdc0d('0x4'));var db=require(_0xdc0d('0x5'))['db'];var utils=require(_0xdc0d('0x6'));var logger=require(_0xdc0d('0x7'))(_0xdc0d('0x8'));var config=require(_0xdc0d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdc0d('0xa')][_0xdc0d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43e945,_0x544751,_0x3d44c7){return new BPromise(function(_0x2f277d,_0xb34824){return client[_0xdc0d('0xc')](_0x43e945,_0x3d44c7)[_0xdc0d('0xd')](function(_0x441cc8){logger[_0xdc0d('0xe')]('Sound,\x20%s,\x20%s',_0x544751,_0xdc0d('0xf'));logger['debug'](_0xdc0d('0x10'),_0x544751,'request\x20sent',JSON[_0xdc0d('0x11')](_0x441cc8));if(_0x441cc8['error']){if(_0x441cc8['error'][_0xdc0d('0x12')]===0x1f4){logger[_0xdc0d('0x13')](_0xdc0d('0x14'),_0x544751,_0x441cc8[_0xdc0d('0x13')][_0xdc0d('0x15')]);return _0xb34824(_0x441cc8[_0xdc0d('0x13')]['message']);}logger['error'](_0xdc0d('0x14'),_0x544751,_0x441cc8[_0xdc0d('0x13')]['message']);return _0x2f277d(_0x441cc8[_0xdc0d('0x13')][_0xdc0d('0x15')]);}else{logger[_0xdc0d('0xe')](_0xdc0d('0x14'),_0x544751,_0xdc0d('0xf'));_0x2f277d(_0x441cc8['result']['message']);}})[_0xdc0d('0x16')](function(_0x461b7e){logger[_0xdc0d('0x13')]('Sound,\x20%s,\x20%s',_0x544751,_0x461b7e);_0xb34824(_0x461b7e);});});}exports[_0xdc0d('0x17')]=function(_0x54b405){var _0x25e0f3=this;return new Promise(function(_0x8913af,_0x504a57){return db['Sound'][_0xdc0d('0x18')]({'raw':_0x54b405[_0xdc0d('0x19')]?_0x54b405[_0xdc0d('0x19')][_0xdc0d('0x1a')]===undefined?!![]:![]:!![],'where':_0x54b405[_0xdc0d('0x19')]?_0x54b405[_0xdc0d('0x19')][_0xdc0d('0x1b')]||null:null,'attributes':_0x54b405['options']?_0x54b405[_0xdc0d('0x19')][_0xdc0d('0x1c')]||null:null,'include':_0x54b405[_0xdc0d('0x19')]?_0x54b405[_0xdc0d('0x19')][_0xdc0d('0x1d')]?_['map'](_0x54b405[_0xdc0d('0x19')][_0xdc0d('0x1d')],function(_0x5d1d20){return{'model':db[_0x5d1d20['model']],'as':_0x5d1d20['as'],'attributes':_0x5d1d20[_0xdc0d('0x1c')],'include':_0x5d1d20[_0xdc0d('0x1d')]?_[_0xdc0d('0x1e')](_0x5d1d20[_0xdc0d('0x1d')],function(_0x2267fd){return{'model':db[_0x2267fd[_0xdc0d('0x1f')]],'as':_0x2267fd['as'],'attributes':_0x2267fd[_0xdc0d('0x1c')],'include':_0x2267fd[_0xdc0d('0x1d')]?_[_0xdc0d('0x1e')](_0x2267fd[_0xdc0d('0x1d')],function(_0x2f2b5d){return{'model':db[_0x2f2b5d[_0xdc0d('0x1f')]],'as':_0x2f2b5d['as'],'attributes':_0x2f2b5d[_0xdc0d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdc0d('0xd')](function(_0x510118){logger[_0xdc0d('0xe')]('ShowSound',_0x54b405);logger[_0xdc0d('0x20')](_0xdc0d('0x17'),_0x54b405,JSON[_0xdc0d('0x11')](_0x510118));_0x8913af(_0x510118);})['catch'](function(_0x3b0a5c){logger[_0xdc0d('0x13')]('ShowSound',_0x3b0a5c[_0xdc0d('0x15')],_0x54b405);_0x504a57(_0x25e0f3[_0xdc0d('0x13')](0x1f4,_0x3b0a5c[_0xdc0d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 83dc308..86ba355 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 _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0xd2d54,_0x5329f7){var _0x78b113=function(_0x7d2b29){while(--_0x7d2b29){_0xd2d54['push'](_0xd2d54['shift']());}};_0x78b113(++_0x5329f7);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x149e35,_0x3691e0){_0x149e35=_0x149e35-0x0;var _0x4c8b2a=_0x9ffd[_0x149e35];return _0x4c8b2a;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file +var _0xbaf0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x2ed5da,_0x2ba17f){var _0x17dc5c=function(_0x2b96c9){while(--_0x2b96c9){_0x2ed5da['push'](_0x2ed5da['shift']());}};_0x17dc5c(++_0x2ba17f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);module[_0x0baf('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index ff3570b..90906c3 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 _0xb31f=['STRING','TEXT','medium','ENUM','out','sequelize','exports'];(function(_0x4d59f8,_0x231506){var _0x5715b1=function(_0x50876c){while(--_0x50876c){_0x4d59f8['push'](_0x4d59f8['shift']());}};_0x5715b1(++_0x231506);}(_0xb31f,0x186));var _0xfb31=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xb31f[_0x3ce3c];return _0x55a2c9;};'use strict';var Sequelize=require(_0xfb31('0x0'));module[_0xfb31('0x1')]={'uniqueid':{'type':Sequelize[_0xfb31('0x2')]},'body':{'type':Sequelize[_0xfb31('0x3')](_0xfb31('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xfb31('0x5')]('in',_0xfb31('0x6')),'defaultValue':_0xfb31('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0xfb31('0x2')]},'providerResponse':{'type':Sequelize[_0xfb31('0x3')]}}; \ No newline at end of file +var _0x94d6=['ENUM','out','sequelize','exports','STRING','TEXT','medium'];(function(_0x524603,_0x1b500b){var _0x408512=function(_0x6793f8){while(--_0x6793f8){_0x524603['push'](_0x524603['shift']());}};_0x408512(++_0x1b500b);}(_0x94d6,0x13d));var _0x694d=function(_0x234c18,_0xb65b5b){_0x234c18=_0x234c18-0x0;var _0x58c0b8=_0x94d6[_0x234c18];return _0x58c0b8;};'use strict';var Sequelize=require(_0x694d('0x0'));module[_0x694d('0x1')]={'uniqueid':{'type':Sequelize[_0x694d('0x2')]},'body':{'type':Sequelize[_0x694d('0x3')](_0x694d('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x694d('0x5')]('in',_0x694d('0x6')),'defaultValue':_0x694d('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0x694d('0x2')]},'providerResponse':{'type':Sequelize[_0x694d('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 7d75584..1135af4 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 _0xb5e7=['keys','merge','find','SquareMessage','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','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','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','error','stack','name','send','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0xb5e7,0x9f));var _0x7b5e=function(_0x2c741b,_0x30ddee){_0x2c741b=_0x2c741b-0x0;var _0x12dbe4=_0xb5e7[_0x2c741b];return _0x12dbe4;};'use strict';var emlformat=require(_0x7b5e('0x0'));var rimraf=require(_0x7b5e('0x1'));var zipdir=require(_0x7b5e('0x2'));var jsonpatch=require(_0x7b5e('0x3'));var rp=require(_0x7b5e('0x4'));var moment=require('moment');var BPromise=require(_0x7b5e('0x5'));var Mustache=require(_0x7b5e('0x6'));var util=require(_0x7b5e('0x7'));var path=require(_0x7b5e('0x8'));var sox=require(_0x7b5e('0x9'));var csv=require(_0x7b5e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b5e('0xb'));var _=require(_0x7b5e('0xc'));var squel=require('squel');var crypto=require(_0x7b5e('0xd'));var jsforce=require(_0x7b5e('0xe'));var deskjs=require(_0x7b5e('0xf'));var toCsv=require(_0x7b5e('0xa'));var querystring=require(_0x7b5e('0x10'));var Papa=require(_0x7b5e('0x11'));var Redis=require(_0x7b5e('0x12'));var authService=require(_0x7b5e('0x13'));var qs=require(_0x7b5e('0x14'));var as=require(_0x7b5e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b5e('0x16'))(_0x7b5e('0x17'));var utils=require(_0x7b5e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7b5e('0x19'));var db=require(_0x7b5e('0x1a'))['db'];function respondWithStatusCode(_0x50bdfe,_0x5b5374){_0x5b5374=_0x5b5374||0xcc;return function(_0x22dd44){if(_0x22dd44){return _0x50bdfe[_0x7b5e('0x1b')](_0x5b5374);}return _0x50bdfe[_0x7b5e('0x1c')](_0x5b5374)[_0x7b5e('0x1d')]();};}function respondWithResult(_0x5b3993,_0x374145){_0x374145=_0x374145||0xc8;return function(_0x2d0463){if(_0x2d0463){return _0x5b3993[_0x7b5e('0x1c')](_0x374145)[_0x7b5e('0x1e')](_0x2d0463);}};}function respondWithFilteredResult(_0x3d70bc,_0x25bf4a){return function(_0x36ec0d){if(_0x36ec0d){var _0x42795b=typeof _0x25bf4a[_0x7b5e('0x1f')]===_0x7b5e('0x20')&&typeof _0x25bf4a[_0x7b5e('0x21')]===_0x7b5e('0x20');var _0x45692f=_0x36ec0d[_0x7b5e('0x22')];var _0x278401=_0x42795b?0x0:_0x25bf4a[_0x7b5e('0x1f')];var _0x416076=_0x42795b?_0x36ec0d[_0x7b5e('0x22')]:_0x25bf4a[_0x7b5e('0x1f')]+_0x25bf4a[_0x7b5e('0x21')];var _0xa14417;if(_0x416076>=_0x45692f){_0x416076=_0x45692f;_0xa14417=0xc8;}else{_0xa14417=0xce;}_0x3d70bc[_0x7b5e('0x1c')](_0xa14417);return _0x3d70bc[_0x7b5e('0x23')](_0x7b5e('0x24'),_0x278401+'-'+_0x416076+'/'+_0x45692f)[_0x7b5e('0x1e')](_0x36ec0d);}return null;};}function patchUpdates(_0x3d2298){return function(_0x17ed5e){try{jsonpatch['apply'](_0x17ed5e,_0x3d2298,!![]);}catch(_0x25a47a){return BPromise[_0x7b5e('0x25')](_0x25a47a);}return _0x17ed5e[_0x7b5e('0x26')]();};}function saveUpdates(_0x2c32b4,_0x450eea){return function(_0x272759){if(_0x272759){return _0x272759['update'](_0x2c32b4)['then'](function(_0x4f76a6){return _0x4f76a6;});}return null;};}function removeEntity(_0x21f3d4,_0x55e128){return function(_0x52112e){if(_0x52112e){return _0x52112e[_0x7b5e('0x27')]()[_0x7b5e('0x28')](function(){_0x21f3d4[_0x7b5e('0x1c')](0xcc)[_0x7b5e('0x1d')]();});}};}function handleEntityNotFound(_0x15ef82,_0x46d43c){return function(_0x35b2c6){if(!_0x35b2c6){_0x15ef82['sendStatus'](0x194);}return _0x35b2c6;};}function handleError(_0x23baa2,_0x560fad){_0x560fad=_0x560fad||0x1f4;return function(_0x2dd61f){logger[_0x7b5e('0x29')](_0x2dd61f[_0x7b5e('0x2a')]);if(_0x2dd61f[_0x7b5e('0x2b')]){delete _0x2dd61f['name'];}_0x23baa2[_0x7b5e('0x1c')](_0x560fad)[_0x7b5e('0x2c')](_0x2dd61f);};}exports['index']=function(_0xbd80ba,_0xc85588){var _0x1cc87f={},_0x523d58={},_0xd0b1d1={'count':0x0,'rows':[]};var _0x2d0018=_['map'](db['SquareMessage'][_0x7b5e('0x2d')],function(_0x1b44b3){return{'name':_0x1b44b3[_0x7b5e('0x2e')],'type':_0x1b44b3[_0x7b5e('0x2f')]['key']};});_0x523d58[_0x7b5e('0x30')]=_[_0x7b5e('0x31')](_0x2d0018,_0x7b5e('0x2b'));_0x523d58[_0x7b5e('0x32')]=_['keys'](_0xbd80ba[_0x7b5e('0x32')]);_0x523d58['filters']=_[_0x7b5e('0x33')](_0x523d58[_0x7b5e('0x30')],_0x523d58[_0x7b5e('0x32')]);_0x1cc87f[_0x7b5e('0x34')]=_[_0x7b5e('0x33')](_0x523d58['model'],qs[_0x7b5e('0x35')](_0xbd80ba[_0x7b5e('0x32')]['fields']));_0x1cc87f[_0x7b5e('0x34')]=_0x1cc87f[_0x7b5e('0x34')][_0x7b5e('0x36')]?_0x1cc87f[_0x7b5e('0x34')]:_0x523d58[_0x7b5e('0x30')];if(!_0xbd80ba[_0x7b5e('0x32')]['hasOwnProperty']('nolimit')){_0x1cc87f[_0x7b5e('0x21')]=qs[_0x7b5e('0x21')](_0xbd80ba[_0x7b5e('0x32')][_0x7b5e('0x21')]);_0x1cc87f['offset']=qs[_0x7b5e('0x1f')](_0xbd80ba[_0x7b5e('0x32')][_0x7b5e('0x1f')]);}_0x1cc87f[_0x7b5e('0x37')]=qs[_0x7b5e('0x38')](_0xbd80ba[_0x7b5e('0x32')][_0x7b5e('0x38')]);_0x1cc87f[_0x7b5e('0x39')]=qs[_0x7b5e('0x3a')](_[_0x7b5e('0x3b')](_0xbd80ba[_0x7b5e('0x32')],_0x523d58[_0x7b5e('0x3a')]),_0x2d0018);if(_0xbd80ba['query'][_0x7b5e('0x3c')]){_0x1cc87f[_0x7b5e('0x39')]=_['merge'](_0x1cc87f[_0x7b5e('0x39')],{'$or':_[_0x7b5e('0x31')](_0x2d0018,function(_0x4c8d46){if(_0x4c8d46[_0x7b5e('0x2f')]!==_0x7b5e('0x3d')){var _0x37168a={};_0x37168a[_0x4c8d46['name']]={'$like':'%'+_0xbd80ba[_0x7b5e('0x32')][_0x7b5e('0x3c')]+'%'};return _0x37168a;}})});}_0x1cc87f=_['merge']({},_0x1cc87f,_0xbd80ba[_0x7b5e('0x3e')]);var _0x6710dc={'where':_0x1cc87f[_0x7b5e('0x39')]};return db['SquareMessage'][_0x7b5e('0x22')](_0x6710dc)['then'](function(_0x285870){_0xd0b1d1[_0x7b5e('0x22')]=_0x285870;if(_0xbd80ba[_0x7b5e('0x32')][_0x7b5e('0x3f')]){_0x1cc87f[_0x7b5e('0x40')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x1cc87f);})[_0x7b5e('0x28')](function(_0x43b791){_0xd0b1d1[_0x7b5e('0x41')]=_0x43b791;return _0xd0b1d1;})[_0x7b5e('0x28')](respondWithFilteredResult(_0xc85588,_0x1cc87f))[_0x7b5e('0x42')](handleError(_0xc85588,null));};exports[_0x7b5e('0x43')]=function(_0x71ee31,_0x5d1c7d){var _0x3464f7={'raw':!![],'where':{'id':_0x71ee31[_0x7b5e('0x44')]['id']}},_0x2515b6={};_0x2515b6[_0x7b5e('0x30')]=_[_0x7b5e('0x45')](db['SquareMessage'][_0x7b5e('0x2d')]);_0x2515b6[_0x7b5e('0x32')]=_[_0x7b5e('0x45')](_0x71ee31[_0x7b5e('0x32')]);_0x2515b6[_0x7b5e('0x3a')]=_[_0x7b5e('0x33')](_0x2515b6['model'],_0x2515b6[_0x7b5e('0x32')]);_0x3464f7[_0x7b5e('0x34')]=_['intersection'](_0x2515b6['model'],qs['fields'](_0x71ee31[_0x7b5e('0x32')][_0x7b5e('0x35')]));_0x3464f7[_0x7b5e('0x34')]=_0x3464f7[_0x7b5e('0x34')][_0x7b5e('0x36')]?_0x3464f7[_0x7b5e('0x34')]:_0x2515b6[_0x7b5e('0x30')];if(_0x71ee31['query']['includeAll']){_0x3464f7['include']=[{'all':!![]}];}_0x3464f7=_[_0x7b5e('0x46')]({},_0x3464f7,_0x71ee31[_0x7b5e('0x3e')]);return db['SquareMessage'][_0x7b5e('0x47')](_0x3464f7)[_0x7b5e('0x28')](handleEntityNotFound(_0x5d1c7d,null))[_0x7b5e('0x28')](respondWithResult(_0x5d1c7d,null))['catch'](handleError(_0x5d1c7d,null));};exports['create']=function(_0x1deac2,_0x241e4a){return db[_0x7b5e('0x48')][_0x7b5e('0x49')](_0x1deac2['body'],{})['then'](respondWithResult(_0x241e4a,0xc9))[_0x7b5e('0x42')](handleError(_0x241e4a,null));};exports[_0x7b5e('0x4a')]=function(_0xf3cb32,_0x1d4f7e){if(_0xf3cb32[_0x7b5e('0x4b')]['id']){delete _0xf3cb32[_0x7b5e('0x4b')]['id'];}return db[_0x7b5e('0x48')][_0x7b5e('0x47')]({'where':{'id':_0xf3cb32[_0x7b5e('0x44')]['id']}})[_0x7b5e('0x28')](handleEntityNotFound(_0x1d4f7e,null))[_0x7b5e('0x28')](saveUpdates(_0xf3cb32['body'],null))[_0x7b5e('0x28')](respondWithResult(_0x1d4f7e,null))['catch'](handleError(_0x1d4f7e,null));};exports[_0x7b5e('0x27')]=function(_0x412223,_0x91577f){return db['SquareMessage']['find']({'where':{'id':_0x412223[_0x7b5e('0x44')]['id']}})['then'](handleEntityNotFound(_0x91577f,null))[_0x7b5e('0x28')](removeEntity(_0x91577f,null))[_0x7b5e('0x42')](handleError(_0x91577f,null));}; \ No newline at end of file +var _0x7c10=['nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','params','includeAll','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','SquareMessage','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x1cd096,_0x19f7d9){var _0x12d1a4=function(_0x16ea18){while(--_0x16ea18){_0x1cd096['push'](_0x1cd096['shift']());}};_0x12d1a4(++_0x19f7d9);}(_0x7c10,0x142));var _0x07c1=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7c10[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0x07c1('0x0'));var rimraf=require(_0x07c1('0x1'));var zipdir=require(_0x07c1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x07c1('0x3'));var moment=require(_0x07c1('0x4'));var BPromise=require(_0x07c1('0x5'));var Mustache=require(_0x07c1('0x6'));var util=require('util');var path=require(_0x07c1('0x7'));var sox=require(_0x07c1('0x8'));var csv=require('to-csv');var ejs=require(_0x07c1('0x9'));var fs=require('fs');var fs_extra=require(_0x07c1('0xa'));var _=require(_0x07c1('0xb'));var squel=require(_0x07c1('0xc'));var crypto=require(_0x07c1('0xd'));var jsforce=require(_0x07c1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x07c1('0xf'));var Papa=require('papaparse');var Redis=require(_0x07c1('0x10'));var authService=require(_0x07c1('0x11'));var qs=require(_0x07c1('0x12'));var as=require(_0x07c1('0x13'));var hardwareService=require(_0x07c1('0x14'));var logger=require(_0x07c1('0x15'))(_0x07c1('0x16'));var utils=require(_0x07c1('0x17'));var config=require(_0x07c1('0x18'));var licenseUtil=require(_0x07c1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13f434,_0x5489e0){_0x5489e0=_0x5489e0||0xcc;return function(_0x1d0d32){if(_0x1d0d32){return _0x13f434[_0x07c1('0x1a')](_0x5489e0);}return _0x13f434[_0x07c1('0x1b')](_0x5489e0)[_0x07c1('0x1c')]();};}function respondWithResult(_0x320137,_0xbb5ee8){_0xbb5ee8=_0xbb5ee8||0xc8;return function(_0x217b1c){if(_0x217b1c){return _0x320137['status'](_0xbb5ee8)[_0x07c1('0x1d')](_0x217b1c);}};}function respondWithFilteredResult(_0x531966,_0x3d368c){return function(_0x10b3e5){if(_0x10b3e5){var _0x4715c8=typeof _0x3d368c[_0x07c1('0x1e')]===_0x07c1('0x1f')&&typeof _0x3d368c[_0x07c1('0x20')]===_0x07c1('0x1f');var _0x5b086b=_0x10b3e5[_0x07c1('0x21')];var _0x375112=_0x4715c8?0x0:_0x3d368c['offset'];var _0x4ec65f=_0x4715c8?_0x10b3e5[_0x07c1('0x21')]:_0x3d368c[_0x07c1('0x1e')]+_0x3d368c[_0x07c1('0x20')];var _0x4aa5fa;if(_0x4ec65f>=_0x5b086b){_0x4ec65f=_0x5b086b;_0x4aa5fa=0xc8;}else{_0x4aa5fa=0xce;}_0x531966['status'](_0x4aa5fa);return _0x531966[_0x07c1('0x22')](_0x07c1('0x23'),_0x375112+'-'+_0x4ec65f+'/'+_0x5b086b)[_0x07c1('0x1d')](_0x10b3e5);}return null;};}function patchUpdates(_0x3a0ec0){return function(_0x117f84){try{jsonpatch[_0x07c1('0x24')](_0x117f84,_0x3a0ec0,!![]);}catch(_0x18fc20){return BPromise[_0x07c1('0x25')](_0x18fc20);}return _0x117f84[_0x07c1('0x26')]();};}function saveUpdates(_0xe89ae8,_0x2d5ebb){return function(_0x3b298d){if(_0x3b298d){return _0x3b298d['update'](_0xe89ae8)[_0x07c1('0x27')](function(_0x1cf036){return _0x1cf036;});}return null;};}function removeEntity(_0x155f79,_0x59df37){return function(_0x37c8e6){if(_0x37c8e6){return _0x37c8e6[_0x07c1('0x28')]()[_0x07c1('0x27')](function(){_0x155f79[_0x07c1('0x1b')](0xcc)[_0x07c1('0x1c')]();});}};}function handleEntityNotFound(_0x128250,_0x2481c7){return function(_0x3f2451){if(!_0x3f2451){_0x128250[_0x07c1('0x1a')](0x194);}return _0x3f2451;};}function handleError(_0x2a6caf,_0x55334f){_0x55334f=_0x55334f||0x1f4;return function(_0x4bd70){logger[_0x07c1('0x29')](_0x4bd70['stack']);if(_0x4bd70[_0x07c1('0x2a')]){delete _0x4bd70[_0x07c1('0x2a')];}_0x2a6caf[_0x07c1('0x1b')](_0x55334f)[_0x07c1('0x2b')](_0x4bd70);};}exports[_0x07c1('0x2c')]=function(_0x12ac19,_0x392675){var _0x24596f={},_0x539af3={},_0x6ee00c={'count':0x0,'rows':[]};var _0x5e355f=_[_0x07c1('0x2d')](db[_0x07c1('0x2e')]['rawAttributes'],function(_0x268ff8){return{'name':_0x268ff8[_0x07c1('0x2f')],'type':_0x268ff8[_0x07c1('0x30')][_0x07c1('0x31')]};});_0x539af3[_0x07c1('0x32')]=_[_0x07c1('0x2d')](_0x5e355f,_0x07c1('0x2a'));_0x539af3[_0x07c1('0x33')]=_[_0x07c1('0x34')](_0x12ac19[_0x07c1('0x33')]);_0x539af3[_0x07c1('0x35')]=_[_0x07c1('0x36')](_0x539af3['model'],_0x539af3[_0x07c1('0x33')]);_0x24596f['attributes']=_[_0x07c1('0x36')](_0x539af3[_0x07c1('0x32')],qs[_0x07c1('0x37')](_0x12ac19[_0x07c1('0x33')]['fields']));_0x24596f['attributes']=_0x24596f[_0x07c1('0x38')][_0x07c1('0x39')]?_0x24596f[_0x07c1('0x38')]:_0x539af3[_0x07c1('0x32')];if(!_0x12ac19[_0x07c1('0x33')]['hasOwnProperty'](_0x07c1('0x3a'))){_0x24596f[_0x07c1('0x20')]=qs[_0x07c1('0x20')](_0x12ac19['query'][_0x07c1('0x20')]);_0x24596f[_0x07c1('0x1e')]=qs[_0x07c1('0x1e')](_0x12ac19[_0x07c1('0x33')][_0x07c1('0x1e')]);}_0x24596f[_0x07c1('0x3b')]=qs[_0x07c1('0x3c')](_0x12ac19['query']['sort']);_0x24596f[_0x07c1('0x3d')]=qs['filters'](_[_0x07c1('0x3e')](_0x12ac19['query'],_0x539af3[_0x07c1('0x35')]),_0x5e355f);if(_0x12ac19[_0x07c1('0x33')][_0x07c1('0x3f')]){_0x24596f[_0x07c1('0x3d')]=_[_0x07c1('0x40')](_0x24596f['where'],{'$or':_[_0x07c1('0x2d')](_0x5e355f,function(_0x3ec8aa){if(_0x3ec8aa[_0x07c1('0x30')]!=='VIRTUAL'){var _0x5c51d1={};_0x5c51d1[_0x3ec8aa[_0x07c1('0x2a')]]={'$like':'%'+_0x12ac19[_0x07c1('0x33')][_0x07c1('0x3f')]+'%'};return _0x5c51d1;}})});}_0x24596f=_[_0x07c1('0x40')]({},_0x24596f,_0x12ac19[_0x07c1('0x41')]);var _0x37922d={'where':_0x24596f[_0x07c1('0x3d')]};return db[_0x07c1('0x2e')][_0x07c1('0x21')](_0x37922d)[_0x07c1('0x27')](function(_0x3624f6){_0x6ee00c['count']=_0x3624f6;if(_0x12ac19[_0x07c1('0x33')]['includeAll']){_0x24596f[_0x07c1('0x42')]=[{'all':!![]}];}return db[_0x07c1('0x2e')][_0x07c1('0x43')](_0x24596f);})[_0x07c1('0x27')](function(_0x495cea){_0x6ee00c[_0x07c1('0x44')]=_0x495cea;return _0x6ee00c;})[_0x07c1('0x27')](respondWithFilteredResult(_0x392675,_0x24596f))[_0x07c1('0x45')](handleError(_0x392675,null));};exports['show']=function(_0x3df38d,_0x50deb4){var _0x1c7470={'raw':!![],'where':{'id':_0x3df38d[_0x07c1('0x46')]['id']}},_0x132b38={};_0x132b38[_0x07c1('0x32')]=_['keys'](db[_0x07c1('0x2e')]['rawAttributes']);_0x132b38[_0x07c1('0x33')]=_['keys'](_0x3df38d['query']);_0x132b38[_0x07c1('0x35')]=_[_0x07c1('0x36')](_0x132b38['model'],_0x132b38[_0x07c1('0x33')]);_0x1c7470[_0x07c1('0x38')]=_[_0x07c1('0x36')](_0x132b38['model'],qs[_0x07c1('0x37')](_0x3df38d[_0x07c1('0x33')][_0x07c1('0x37')]));_0x1c7470[_0x07c1('0x38')]=_0x1c7470[_0x07c1('0x38')]['length']?_0x1c7470[_0x07c1('0x38')]:_0x132b38['model'];if(_0x3df38d[_0x07c1('0x33')][_0x07c1('0x47')]){_0x1c7470[_0x07c1('0x42')]=[{'all':!![]}];}_0x1c7470=_[_0x07c1('0x40')]({},_0x1c7470,_0x3df38d[_0x07c1('0x41')]);return db[_0x07c1('0x2e')][_0x07c1('0x48')](_0x1c7470)[_0x07c1('0x27')](handleEntityNotFound(_0x50deb4,null))[_0x07c1('0x27')](respondWithResult(_0x50deb4,null))[_0x07c1('0x45')](handleError(_0x50deb4,null));};exports[_0x07c1('0x49')]=function(_0x1beab4,_0x29e342){return db[_0x07c1('0x2e')][_0x07c1('0x49')](_0x1beab4[_0x07c1('0x4a')],{})['then'](respondWithResult(_0x29e342,0xc9))['catch'](handleError(_0x29e342,null));};exports[_0x07c1('0x4b')]=function(_0x23a998,_0x5a761b){if(_0x23a998[_0x07c1('0x4a')]['id']){delete _0x23a998[_0x07c1('0x4a')]['id'];}return db[_0x07c1('0x2e')]['find']({'where':{'id':_0x23a998[_0x07c1('0x46')]['id']}})[_0x07c1('0x27')](handleEntityNotFound(_0x5a761b,null))[_0x07c1('0x27')](saveUpdates(_0x23a998[_0x07c1('0x4a')],null))[_0x07c1('0x27')](respondWithResult(_0x5a761b,null))[_0x07c1('0x45')](handleError(_0x5a761b,null));};exports[_0x07c1('0x28')]=function(_0x29adb6,_0x460281){return db[_0x07c1('0x2e')]['find']({'where':{'id':_0x29adb6[_0x07c1('0x46')]['id']}})[_0x07c1('0x27')](handleEntityNotFound(_0x460281,null))['then'](removeEntity(_0x460281,null))[_0x07c1('0x45')](handleError(_0x460281,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index be205f1..9b6843d 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 _0x781f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareMessage','square_messages','lodash','util'];(function(_0x819ce,_0xf25f51){var _0x1edcf0=function(_0x192389){while(--_0x192389){_0x819ce['push'](_0x819ce['shift']());}};_0x1edcf0(++_0xf25f51);}(_0x781f,0x124));var _0xf781=function(_0x42bafd,_0x3f0fe3){_0x42bafd=_0x42bafd-0x0;var _0x2ed705=_0x781f[_0x42bafd];return _0x2ed705;};'use strict';var _=require(_0xf781('0x0'));var util=require(_0xf781('0x1'));var logger=require(_0xf781('0x2'))(_0xf781('0x3'));var moment=require(_0xf781('0x4'));var BPromise=require(_0xf781('0x5'));var rp=require(_0xf781('0x6'));var fs=require('fs');var path=require(_0xf781('0x7'));var rimraf=require(_0xf781('0x8'));var config=require(_0xf781('0x9'));var attributes=require('./squareMessage.attributes');module[_0xf781('0xa')]=function(_0x383f65,_0x47d67f){return _0x383f65[_0xf781('0xb')](_0xf781('0xc'),attributes,{'tableName':_0xf781('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfacc=['./squareMessage.attributes','exports','SquareMessage','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xfacc,0x8a));var _0xcfac=function(_0x18e84d,_0x400654){_0x18e84d=_0x18e84d-0x0;var _0x154f7c=_0xfacc[_0x18e84d];return _0x154f7c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcfac('0x0'))(_0xcfac('0x1'));var moment=require('moment');var BPromise=require(_0xcfac('0x2'));var rp=require(_0xcfac('0x3'));var fs=require('fs');var path=require(_0xcfac('0x4'));var rimraf=require(_0xcfac('0x5'));var config=require('../../config/environment');var attributes=require(_0xcfac('0x6'));module[_0xcfac('0x7')]=function(_0x21ff75,_0x5dd630){return _0x21ff75['define'](_0xcfac('0x8'),attributes,{'tableName':'square_messages','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 fc9209b..c6f3cbc 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 _0x7a81=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','SquareMessage','create','body','options','raw','CreateSquareMessage'];(function(_0x27981f,_0x452fd5){var _0x87b04a=function(_0x48bb6f){while(--_0x48bb6f){_0x27981f['push'](_0x27981f['shift']());}};_0x87b04a(++_0x452fd5);}(_0x7a81,0x16d));var _0x17a8=function(_0x37c1e8,_0x55ba00){_0x37c1e8=_0x37c1e8-0x0;var _0x153e9e=_0x7a81[_0x37c1e8];return _0x153e9e;};'use strict';var _=require(_0x17a8('0x0'));var util=require('util');var moment=require(_0x17a8('0x1'));var BPromise=require(_0x17a8('0x2'));var rs=require(_0x17a8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17a8('0x4'))['db'];var utils=require(_0x17a8('0x5'));var logger=require(_0x17a8('0x6'))(_0x17a8('0x7'));var config=require('../../config/environment');var jayson=require(_0x17a8('0x8'));var client=jayson[_0x17a8('0x9')][_0x17a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x369147,_0x284ffa,_0x5b623f){return new BPromise(function(_0x3c650b,_0x3ec921){return client[_0x17a8('0xb')](_0x369147,_0x5b623f)[_0x17a8('0xc')](function(_0x5823ba){logger[_0x17a8('0xd')]('SquareMessage,\x20%s,\x20%s',_0x284ffa,_0x17a8('0xe'));logger[_0x17a8('0xf')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x284ffa,'request\x20sent',JSON[_0x17a8('0x10')](_0x5823ba));if(_0x5823ba[_0x17a8('0x11')]){if(_0x5823ba[_0x17a8('0x11')][_0x17a8('0x12')]===0x1f4){logger['error'](_0x17a8('0x13'),_0x284ffa,_0x5823ba[_0x17a8('0x11')][_0x17a8('0x14')]);return _0x3ec921(_0x5823ba[_0x17a8('0x11')]['message']);}logger[_0x17a8('0x11')](_0x17a8('0x13'),_0x284ffa,_0x5823ba[_0x17a8('0x11')]['message']);return _0x3c650b(_0x5823ba[_0x17a8('0x11')][_0x17a8('0x14')]);}else{logger[_0x17a8('0xd')]('SquareMessage,\x20%s,\x20%s',_0x284ffa,_0x17a8('0xe'));_0x3c650b(_0x5823ba['result'][_0x17a8('0x14')]);}})['catch'](function(_0x449dd7){logger[_0x17a8('0x11')]('SquareMessage,\x20%s,\x20%s',_0x284ffa,_0x449dd7);_0x3ec921(_0x449dd7);});});}exports['CreateSquareMessage']=function(_0x5ed155){var _0xb0d372=this;return new Promise(function(_0x10e7cc,_0x400b5b){return db[_0x17a8('0x15')][_0x17a8('0x16')](_0x5ed155[_0x17a8('0x17')],{'raw':_0x5ed155[_0x17a8('0x18')]?_0x5ed155[_0x17a8('0x18')][_0x17a8('0x19')]===undefined?!![]:![]:!![]})[_0x17a8('0xc')](function(_0x29f337){logger[_0x17a8('0xd')](_0x17a8('0x1a'),_0x5ed155);logger[_0x17a8('0xf')](_0x17a8('0x1a'),_0x5ed155,JSON[_0x17a8('0x10')](_0x29f337));_0x10e7cc(_0x29f337);})[_0x17a8('0x1b')](function(_0x1847bb){logger[_0x17a8('0x11')]('CreateSquareMessage',_0x1847bb[_0x17a8('0x14')],_0x5ed155);_0x400b5b(_0xb0d372[_0x17a8('0x11')](0x1f4,_0x1847bb['message']));});});}; \ No newline at end of file +var _0x5630=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5630,0x193));var _0x0563=function(_0x515244,_0x362842){_0x515244=_0x515244-0x0;var _0x9a9358=_0x5630[_0x515244];return _0x9a9358;};'use strict';var _=require(_0x0563('0x0'));var util=require(_0x0563('0x1'));var moment=require(_0x0563('0x2'));var BPromise=require(_0x0563('0x3'));var rs=require(_0x0563('0x4'));var fs=require('fs');var Redis=require(_0x0563('0x5'));var db=require(_0x0563('0x6'))['db'];var utils=require(_0x0563('0x7'));var logger=require(_0x0563('0x8'))(_0x0563('0x9'));var config=require(_0x0563('0xa'));var jayson=require(_0x0563('0xb'));var client=jayson[_0x0563('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2989bc,_0x42408d,_0x280818){return new BPromise(function(_0x597541,_0x55338e){return client[_0x0563('0xd')](_0x2989bc,_0x280818)[_0x0563('0xe')](function(_0x148ba0){logger[_0x0563('0xf')](_0x0563('0x10'),_0x42408d,'request\x20sent');logger[_0x0563('0x11')](_0x0563('0x12'),_0x42408d,_0x0563('0x13'),JSON[_0x0563('0x14')](_0x148ba0));if(_0x148ba0[_0x0563('0x15')]){if(_0x148ba0[_0x0563('0x15')]['code']===0x1f4){logger[_0x0563('0x15')](_0x0563('0x10'),_0x42408d,_0x148ba0[_0x0563('0x15')][_0x0563('0x16')]);return _0x55338e(_0x148ba0[_0x0563('0x15')][_0x0563('0x16')]);}logger[_0x0563('0x15')](_0x0563('0x10'),_0x42408d,_0x148ba0[_0x0563('0x15')][_0x0563('0x16')]);return _0x597541(_0x148ba0[_0x0563('0x15')][_0x0563('0x16')]);}else{logger[_0x0563('0xf')](_0x0563('0x10'),_0x42408d,_0x0563('0x13'));_0x597541(_0x148ba0[_0x0563('0x17')][_0x0563('0x16')]);}})[_0x0563('0x18')](function(_0x4a67a7){logger['error'](_0x0563('0x10'),_0x42408d,_0x4a67a7);_0x55338e(_0x4a67a7);});});}exports[_0x0563('0x19')]=function(_0xa98343){var _0x469fd1=this;return new Promise(function(_0xfb3357,_0x44365b){return db[_0x0563('0x1a')][_0x0563('0x1b')](_0xa98343[_0x0563('0x1c')],{'raw':_0xa98343['options']?_0xa98343[_0x0563('0x1d')][_0x0563('0x1e')]===undefined?!![]:![]:!![]})[_0x0563('0xe')](function(_0x311f53){logger[_0x0563('0xf')](_0x0563('0x19'),_0xa98343);logger[_0x0563('0x11')](_0x0563('0x19'),_0xa98343,JSON['stringify'](_0x311f53));_0xfb3357(_0x311f53);})[_0x0563('0x18')](function(_0x50f9ea){logger[_0x0563('0x15')]('CreateSquareMessage',_0x50f9ea[_0x0563('0x16')],_0xa98343);_0x44365b(_0x469fd1['error'](0x1f4,_0x50f9ea[_0x0563('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index e44396d..a65ceaf 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 _0x9dbb=['show','/:id/test','15s','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id'];(function(_0x23bc15,_0x3f1ca5){var _0x5bcf52=function(_0x326df1){while(--_0x326df1){_0x23bc15['push'](_0x23bc15['shift']());}};_0x5bcf52(++_0x3f1ca5);}(_0x9dbb,0x183));var _0xb9db=function(_0xf15036,_0x52e137){_0xf15036=_0xf15036-0x0;var _0x2985dd=_0x9dbb[_0xf15036];return _0x2985dd;};'use strict';var multer=require('multer');var util=require(_0xb9db('0x0'));var path=require(_0xb9db('0x1'));var timeout=require(_0xb9db('0x2'));var express=require(_0xb9db('0x3'));var router=express[_0xb9db('0x4')]();var fs_extra=require(_0xb9db('0x5'));var auth=require(_0xb9db('0x6'));var interaction=require(_0xb9db('0x7'));var config=require('../../config/environment');var controller=require(_0xb9db('0x8'));router[_0xb9db('0x9')]('/',auth[_0xb9db('0xa')](),controller[_0xb9db('0xb')]);router[_0xb9db('0x9')](_0xb9db('0xc'),auth[_0xb9db('0xa')](),controller[_0xb9db('0xd')]);router[_0xb9db('0x9')](_0xb9db('0xe'),auth[_0xb9db('0xa')](),timeout(_0xb9db('0xf')),controller['test']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb9db('0x10')]('/:id',auth[_0xb9db('0xa')](),controller['update']);router[_0xb9db('0x11')]('/:id',auth[_0xb9db('0xa')](),controller[_0xb9db('0x12')]);module[_0xb9db('0x13')]=router; \ No newline at end of file +var _0x8356=['fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/:id','isAuthenticated','show','/:id/test','test','post','create','update','destroy','multer','util','path','connect-timeout','Router'];(function(_0x281297,_0x4c8e7a){var _0x4f518a=function(_0x1887bd){while(--_0x1887bd){_0x281297['push'](_0x281297['shift']());}};_0x4f518a(++_0x4c8e7a);}(_0x8356,0xf2));var _0x6835=function(_0xa0d6e8,_0x41e320){_0xa0d6e8=_0xa0d6e8-0x0;var _0x4ba300=_0x8356[_0xa0d6e8];return _0x4ba300;};'use strict';var multer=require(_0x6835('0x0'));var util=require(_0x6835('0x1'));var path=require(_0x6835('0x2'));var timeout=require(_0x6835('0x3'));var express=require('express');var router=express[_0x6835('0x4')]();var fs_extra=require(_0x6835('0x5'));var auth=require(_0x6835('0x6'));var interaction=require(_0x6835('0x7'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6835('0x8')]);router[_0x6835('0x9')](_0x6835('0xa'),auth[_0x6835('0xb')](),controller[_0x6835('0xc')]);router[_0x6835('0x9')](_0x6835('0xd'),auth[_0x6835('0xb')](),timeout('15s'),controller[_0x6835('0xe')]);router[_0x6835('0xf')]('/',auth[_0x6835('0xb')](),controller[_0x6835('0x10')]);router['put'](_0x6835('0xa'),auth[_0x6835('0xb')](),controller[_0x6835('0x11')]);router['delete'](_0x6835('0xa'),auth['isAuthenticated'](),controller[_0x6835('0x12')]);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 407ff92..4b05bf1 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 _0x2c13=['STRING','name','sequelize','exports'];(function(_0x5e0682,_0x35dfa7){var _0x3d7432=function(_0xc883e8){while(--_0xc883e8){_0x5e0682['push'](_0x5e0682['shift']());}};_0x3d7432(++_0x35dfa7);}(_0x2c13,0xf6));var _0x32c1=function(_0x36daeb,_0x472eec){_0x36daeb=_0x36daeb-0x0;var _0x9ba42c=_0x2c13[_0x36daeb];return _0x9ba42c;};'use strict';var Sequelize=require(_0x32c1('0x0'));module[_0x32c1('0x1')]={'name':{'type':Sequelize[_0x32c1('0x2')],'unique':_0x32c1('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x32c1('0x2')]},'description':{'type':Sequelize[_0x32c1('0x2')]}}; \ No newline at end of file +var _0x7107=['STRING','exports','name'];(function(_0x45ea51,_0x1d49d2){var _0x55a569=function(_0x2b539b){while(--_0x2b539b){_0x45ea51['push'](_0x45ea51['shift']());}};_0x55a569(++_0x1d49d2);}(_0x7107,0x157));var _0x7710=function(_0x239c7f,_0x342874){_0x239c7f=_0x239c7f-0x0;var _0x2339e9=_0x7107[_0x239c7f];return _0x2339e9;};'use strict';var Sequelize=require('sequelize');module[_0x7710('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x7710('0x1'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7710('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index e6ee686..bcadfbb 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 _0x8455=['bluebird','mustache','util','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','UserProfileResource','then','stack','name','send','map','SquareOdbc','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ODBC','userProfileId','autoAssociation','error','params','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x4b5cfa,_0x41b1c4){var _0x7c0a62=function(_0x17ba38){while(--_0x17ba38){_0x4b5cfa['push'](_0x4b5cfa['shift']());}};_0x7c0a62(++_0x41b1c4);}(_0x8455,0x15a));var _0x5845=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8455[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x5845('0x0'));var rimraf=require(_0x5845('0x1'));var zipdir=require(_0x5845('0x2'));var jsonpatch=require(_0x5845('0x3'));var rp=require(_0x5845('0x4'));var moment=require(_0x5845('0x5'));var BPromise=require(_0x5845('0x6'));var Mustache=require(_0x5845('0x7'));var util=require(_0x5845('0x8'));var path=require('path');var sox=require(_0x5845('0x9'));var csv=require(_0x5845('0xa'));var ejs=require(_0x5845('0xb'));var fs=require('fs');var fs_extra=require(_0x5845('0xc'));var _=require(_0x5845('0xd'));var squel=require(_0x5845('0xe'));var crypto=require(_0x5845('0xf'));var jsforce=require(_0x5845('0x10'));var deskjs=require(_0x5845('0x11'));var toCsv=require(_0x5845('0xa'));var querystring=require(_0x5845('0x12'));var Papa=require('papaparse');var Redis=require(_0x5845('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5845('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5845('0x15'));var logger=require('../../config/logger')(_0x5845('0x16'));var utils=require(_0x5845('0x17'));var config=require(_0x5845('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5845('0x19'))['db'];function respondWithStatusCode(_0x357d97,_0x1f2683){_0x1f2683=_0x1f2683||0xcc;return function(_0x388acb){if(_0x388acb){return _0x357d97[_0x5845('0x1a')](_0x1f2683);}return _0x357d97[_0x5845('0x1b')](_0x1f2683)[_0x5845('0x1c')]();};}function respondWithResult(_0x589ca4,_0x1348e5){_0x1348e5=_0x1348e5||0xc8;return function(_0x1b3f80){if(_0x1b3f80){return _0x589ca4[_0x5845('0x1b')](_0x1348e5)[_0x5845('0x1d')](_0x1b3f80);}};}function respondWithFilteredResult(_0x45ef2b,_0x5260e5){return function(_0x4e340f){if(_0x4e340f){var _0x28f873=typeof _0x5260e5[_0x5845('0x1e')]===_0x5845('0x1f')&&typeof _0x5260e5[_0x5845('0x20')]===_0x5845('0x1f');var _0xf3ab51=_0x4e340f[_0x5845('0x21')];var _0x10edf7=_0x28f873?0x0:_0x5260e5[_0x5845('0x1e')];var _0x22a08c=_0x28f873?_0x4e340f[_0x5845('0x21')]:_0x5260e5[_0x5845('0x1e')]+_0x5260e5['limit'];var _0x54e803;if(_0x22a08c>=_0xf3ab51){_0x22a08c=_0xf3ab51;_0x54e803=0xc8;}else{_0x54e803=0xce;}_0x45ef2b['status'](_0x54e803);return _0x45ef2b[_0x5845('0x22')](_0x5845('0x23'),_0x10edf7+'-'+_0x22a08c+'/'+_0xf3ab51)[_0x5845('0x1d')](_0x4e340f);}return null;};}function patchUpdates(_0xd358f3){return function(_0x3652f4){try{jsonpatch[_0x5845('0x24')](_0x3652f4,_0xd358f3,!![]);}catch(_0xdbf69e){return BPromise[_0x5845('0x25')](_0xdbf69e);}return _0x3652f4['save']();};}function saveUpdates(_0x1b2d2b,_0x1c42ad){return function(_0x4a209d){if(_0x4a209d){return _0x4a209d[_0x5845('0x26')](_0x1b2d2b)['then'](function(_0x154e86){return _0x154e86;});}return null;};}function removeEntity(_0xe15ae0,_0xc10c8f){return function(_0x3f421f){if(_0x3f421f){return _0x3f421f[_0x5845('0x27')]()['then'](function(){var _0x1cadb4=_0x3f421f['get']({'plain':!![]});var _0x182d27='ODBC';return db[_0x5845('0x28')][_0x5845('0x27')]({'where':{'type':_0x182d27,'resourceId':_0x1cadb4['id']}})[_0x5845('0x29')](function(){return _0x3f421f;});})[_0x5845('0x29')](function(){_0xe15ae0[_0x5845('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b426c,_0x2266ec){return function(_0x4d7240){if(!_0x4d7240){_0x1b426c[_0x5845('0x1a')](0x194);}return _0x4d7240;};}function handleError(_0x1ec36d,_0x253a34){_0x253a34=_0x253a34||0x1f4;return function(_0x1ed45a){logger['error'](_0x1ed45a[_0x5845('0x2a')]);if(_0x1ed45a['name']){delete _0x1ed45a[_0x5845('0x2b')];}_0x1ec36d[_0x5845('0x1b')](_0x253a34)[_0x5845('0x2c')](_0x1ed45a);};}exports['index']=function(_0x112c6b,_0x1c8c40){var _0x3b4ad6={},_0x55e16a={},_0x323b52={'count':0x0,'rows':[]};var _0x510f2f=_[_0x5845('0x2d')](db[_0x5845('0x2e')][_0x5845('0x2f')],function(_0x3e5900){return{'name':_0x3e5900['fieldName'],'type':_0x3e5900['type'][_0x5845('0x30')]};});_0x55e16a[_0x5845('0x31')]=_[_0x5845('0x2d')](_0x510f2f,_0x5845('0x2b'));_0x55e16a['query']=_[_0x5845('0x32')](_0x112c6b[_0x5845('0x33')]);_0x55e16a[_0x5845('0x34')]=_[_0x5845('0x35')](_0x55e16a[_0x5845('0x31')],_0x55e16a[_0x5845('0x33')]);_0x3b4ad6['attributes']=_[_0x5845('0x35')](_0x55e16a['model'],qs[_0x5845('0x36')](_0x112c6b['query']['fields']));_0x3b4ad6['attributes']=_0x3b4ad6[_0x5845('0x37')]['length']?_0x3b4ad6[_0x5845('0x37')]:_0x55e16a['model'];if(!_0x112c6b[_0x5845('0x33')][_0x5845('0x38')]('nolimit')){_0x3b4ad6[_0x5845('0x20')]=qs[_0x5845('0x20')](_0x112c6b[_0x5845('0x33')][_0x5845('0x20')]);_0x3b4ad6[_0x5845('0x1e')]=qs[_0x5845('0x1e')](_0x112c6b[_0x5845('0x33')]['offset']);}_0x3b4ad6[_0x5845('0x39')]=qs['sort'](_0x112c6b[_0x5845('0x33')][_0x5845('0x3a')]);_0x3b4ad6['where']=qs[_0x5845('0x34')](_[_0x5845('0x3b')](_0x112c6b[_0x5845('0x33')],_0x55e16a['filters']),_0x510f2f);if(_0x112c6b['query'][_0x5845('0x3c')]){_0x3b4ad6[_0x5845('0x3d')]=_[_0x5845('0x3e')](_0x3b4ad6[_0x5845('0x3d')],{'$or':_[_0x5845('0x2d')](_0x510f2f,function(_0xbe0fbf){if(_0xbe0fbf[_0x5845('0x3f')]!==_0x5845('0x40')){var _0x269919={};_0x269919[_0xbe0fbf[_0x5845('0x2b')]]={'$like':'%'+_0x112c6b[_0x5845('0x33')][_0x5845('0x3c')]+'%'};return _0x269919;}})});}_0x3b4ad6=_[_0x5845('0x3e')]({},_0x3b4ad6,_0x112c6b['options']);var _0x3c368b={'where':_0x3b4ad6['where']};return db[_0x5845('0x2e')][_0x5845('0x21')](_0x3c368b)[_0x5845('0x29')](function(_0xd4400b){_0x323b52[_0x5845('0x21')]=_0xd4400b;if(_0x112c6b[_0x5845('0x33')][_0x5845('0x41')]){_0x3b4ad6[_0x5845('0x42')]=[{'all':!![]}];}return db[_0x5845('0x2e')][_0x5845('0x43')](_0x3b4ad6);})['then'](function(_0xe1275c){_0x323b52[_0x5845('0x44')]=_0xe1275c;return _0x323b52;})[_0x5845('0x29')](respondWithFilteredResult(_0x1c8c40,_0x3b4ad6))[_0x5845('0x45')](handleError(_0x1c8c40,null));};exports['show']=function(_0x357e38,_0xb36415){var _0x2810cd={'raw':!![],'where':{'id':_0x357e38['params']['id']}},_0x5a02a7={};_0x5a02a7[_0x5845('0x31')]=_['keys'](db[_0x5845('0x2e')][_0x5845('0x2f')]);_0x5a02a7[_0x5845('0x33')]=_[_0x5845('0x32')](_0x357e38[_0x5845('0x33')]);_0x5a02a7[_0x5845('0x34')]=_[_0x5845('0x35')](_0x5a02a7[_0x5845('0x31')],_0x5a02a7[_0x5845('0x33')]);_0x2810cd[_0x5845('0x37')]=_['intersection'](_0x5a02a7['model'],qs['fields'](_0x357e38[_0x5845('0x33')]['fields']));_0x2810cd[_0x5845('0x37')]=_0x2810cd[_0x5845('0x37')][_0x5845('0x46')]?_0x2810cd[_0x5845('0x37')]:_0x5a02a7[_0x5845('0x31')];if(_0x357e38[_0x5845('0x33')][_0x5845('0x41')]){_0x2810cd[_0x5845('0x42')]=[{'all':!![]}];}_0x2810cd=_['merge']({},_0x2810cd,_0x357e38['options']);return db[_0x5845('0x2e')][_0x5845('0x47')](_0x2810cd)[_0x5845('0x29')](handleEntityNotFound(_0xb36415,null))[_0x5845('0x29')](respondWithResult(_0xb36415,null))[_0x5845('0x45')](handleError(_0xb36415,null));};exports[_0x5845('0x48')]=function(_0x95bba1,_0x11b18a){return db['SquareOdbc'][_0x5845('0x48')](_0x95bba1[_0x5845('0x49')],{})[_0x5845('0x29')](function(_0x3b2e50){var _0x6159fd=_0x95bba1[_0x5845('0x4a')]['get']({'plain':!![]});if(!_0x6159fd)throw new Error(_0x5845('0x4b'));if(_0x6159fd[_0x5845('0x4c')]===_0x5845('0x4a')){var _0x1dc63d=_0x3b2e50[_0x5845('0x4d')]({'plain':!![]});var _0x287cb1=_0x5845('0x4e');return db['UserProfileSection'][_0x5845('0x47')]({'where':{'name':_0x287cb1,'userProfileId':_0x6159fd[_0x5845('0x4f')]},'raw':!![]})[_0x5845('0x29')](function(_0x3fdddf){if(_0x3fdddf&&_0x3fdddf[_0x5845('0x50')]===0x0){return db[_0x5845('0x28')]['create']({'name':_0x1dc63d['name'],'resourceId':_0x1dc63d['id'],'type':_0x3fdddf['name'],'sectionId':_0x3fdddf['id']},{})[_0x5845('0x29')](function(){return _0x3b2e50;});}else{return _0x3b2e50;}})[_0x5845('0x45')](function(_0x126dd5){logger[_0x5845('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x126dd5);throw _0x126dd5;});}return _0x3b2e50;})[_0x5845('0x29')](respondWithResult(_0x11b18a,0xc9))[_0x5845('0x45')](handleError(_0x11b18a,null));};exports[_0x5845('0x26')]=function(_0x13e6fd,_0x23b52a){if(_0x13e6fd['body']['id']){delete _0x13e6fd[_0x5845('0x49')]['id'];}return db[_0x5845('0x2e')][_0x5845('0x47')]({'where':{'id':_0x13e6fd[_0x5845('0x52')]['id']}})[_0x5845('0x29')](handleEntityNotFound(_0x23b52a,null))[_0x5845('0x29')](saveUpdates(_0x13e6fd[_0x5845('0x49')],null))[_0x5845('0x29')](respondWithResult(_0x23b52a,null))[_0x5845('0x45')](handleError(_0x23b52a,null));};exports['destroy']=function(_0xe75e65,_0x532118){return db[_0x5845('0x2e')][_0x5845('0x47')]({'where':{'id':_0xe75e65[_0x5845('0x52')]['id']}})[_0x5845('0x29')](handleEntityNotFound(_0x532118,null))['then'](removeEntity(_0x532118,null))[_0x5845('0x45')](handleError(_0x532118,null));};exports[_0x5845('0x53')]=function(_0x566559,_0x56a7f2,_0x3d6cd6){var _0x20e6bf;return db[_0x5845('0x2e')]['find']({'where':{'id':_0x566559[_0x5845('0x52')]['id']},'attributes':['id',_0x5845('0x54')]})['then'](handleEntityNotFound(_0x56a7f2,null))[_0x5845('0x29')](function(_0x12c1f7){if(_0x12c1f7){var _0x52b140=require(_0x5845('0x55'))();_0x52b140[_0x5845('0x56')](_0x12c1f7[_0x5845('0x54')]);_0x52b140[_0x5845('0x57')]();return _0x12c1f7;}})[_0x5845('0x29')](respondWithResult(_0x56a7f2,null))[_0x5845('0x45')](handleError(_0x56a7f2,null));}; \ No newline at end of file +var _0x30d8=['findAll','rows','catch','show','params','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','update','test','odbc','openSync','dsn','closeSync','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','destroy','then','get','ODBC','end','error','stack','name','send','map','SquareOdbc','rawAttributes','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x30d8,0x170));var _0x830d=function(_0x619df8,_0x3c9b3c){_0x619df8=_0x619df8-0x0;var _0x5e11b2=_0x30d8[_0x619df8];return _0x5e11b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x830d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x830d('0x1'));var rp=require(_0x830d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x830d('0x3'));var util=require(_0x830d('0x4'));var path=require(_0x830d('0x5'));var sox=require(_0x830d('0x6'));var csv=require('to-csv');var ejs=require(_0x830d('0x7'));var fs=require('fs');var fs_extra=require(_0x830d('0x8'));var _=require(_0x830d('0x9'));var squel=require(_0x830d('0xa'));var crypto=require('crypto');var jsforce=require(_0x830d('0xb'));var deskjs=require(_0x830d('0xc'));var toCsv=require(_0x830d('0xd'));var querystring=require('querystring');var Papa=require(_0x830d('0xe'));var Redis=require(_0x830d('0xf'));var authService=require(_0x830d('0x10'));var qs=require(_0x830d('0x11'));var as=require(_0x830d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x830d('0x13'))(_0x830d('0x14'));var utils=require(_0x830d('0x15'));var config=require(_0x830d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x830d('0x17'))['db'];function respondWithStatusCode(_0xecc646,_0x4f8faa){_0x4f8faa=_0x4f8faa||0xcc;return function(_0x576517){if(_0x576517){return _0xecc646[_0x830d('0x18')](_0x4f8faa);}return _0xecc646[_0x830d('0x19')](_0x4f8faa)['end']();};}function respondWithResult(_0x13bedf,_0xc1b87d){_0xc1b87d=_0xc1b87d||0xc8;return function(_0x3e146b){if(_0x3e146b){return _0x13bedf[_0x830d('0x19')](_0xc1b87d)[_0x830d('0x1a')](_0x3e146b);}};}function respondWithFilteredResult(_0x45dc93,_0x2323e1){return function(_0x494bed){if(_0x494bed){var _0x429266=typeof _0x2323e1[_0x830d('0x1b')]===_0x830d('0x1c')&&typeof _0x2323e1[_0x830d('0x1d')]===_0x830d('0x1c');var _0xf3da76=_0x494bed[_0x830d('0x1e')];var _0x3ecf08=_0x429266?0x0:_0x2323e1[_0x830d('0x1b')];var _0x40ae0c=_0x429266?_0x494bed[_0x830d('0x1e')]:_0x2323e1['offset']+_0x2323e1[_0x830d('0x1d')];var _0x26af73;if(_0x40ae0c>=_0xf3da76){_0x40ae0c=_0xf3da76;_0x26af73=0xc8;}else{_0x26af73=0xce;}_0x45dc93['status'](_0x26af73);return _0x45dc93[_0x830d('0x1f')]('Content-Range',_0x3ecf08+'-'+_0x40ae0c+'/'+_0xf3da76)['json'](_0x494bed);}return null;};}function patchUpdates(_0x2aa87c){return function(_0x4309e7){try{jsonpatch['apply'](_0x4309e7,_0x2aa87c,!![]);}catch(_0x17c6f6){return BPromise[_0x830d('0x20')](_0x17c6f6);}return _0x4309e7[_0x830d('0x21')]();};}function saveUpdates(_0x3271b2,_0x2d08e5){return function(_0x53260e){if(_0x53260e){return _0x53260e['update'](_0x3271b2)['then'](function(_0x59a596){return _0x59a596;});}return null;};}function removeEntity(_0x5e2774,_0x492a7a){return function(_0x3c55fa){if(_0x3c55fa){return _0x3c55fa[_0x830d('0x22')]()[_0x830d('0x23')](function(){var _0x74c73a=_0x3c55fa[_0x830d('0x24')]({'plain':!![]});var _0x48bdc5=_0x830d('0x25');return db['UserProfileResource'][_0x830d('0x22')]({'where':{'type':_0x48bdc5,'resourceId':_0x74c73a['id']}})['then'](function(){return _0x3c55fa;});})['then'](function(){_0x5e2774[_0x830d('0x19')](0xcc)[_0x830d('0x26')]();});}};}function handleEntityNotFound(_0x1f54f0,_0x3d7e54){return function(_0x1bddfa){if(!_0x1bddfa){_0x1f54f0[_0x830d('0x18')](0x194);}return _0x1bddfa;};}function handleError(_0x86f443,_0x5da48c){_0x5da48c=_0x5da48c||0x1f4;return function(_0x164f57){logger[_0x830d('0x27')](_0x164f57[_0x830d('0x28')]);if(_0x164f57[_0x830d('0x29')]){delete _0x164f57['name'];}_0x86f443[_0x830d('0x19')](_0x5da48c)[_0x830d('0x2a')](_0x164f57);};}exports['index']=function(_0x2643ac,_0x7c67be){var _0xb637a5={},_0x50a7c8={},_0x203aaf={'count':0x0,'rows':[]};var _0x4b8b1a=_[_0x830d('0x2b')](db[_0x830d('0x2c')][_0x830d('0x2d')],function(_0x3a7cbc){return{'name':_0x3a7cbc['fieldName'],'type':_0x3a7cbc['type'][_0x830d('0x2e')]};});_0x50a7c8[_0x830d('0x2f')]=_[_0x830d('0x2b')](_0x4b8b1a,_0x830d('0x29'));_0x50a7c8[_0x830d('0x30')]=_[_0x830d('0x31')](_0x2643ac[_0x830d('0x30')]);_0x50a7c8[_0x830d('0x32')]=_['intersection'](_0x50a7c8[_0x830d('0x2f')],_0x50a7c8['query']);_0xb637a5[_0x830d('0x33')]=_['intersection'](_0x50a7c8[_0x830d('0x2f')],qs[_0x830d('0x34')](_0x2643ac[_0x830d('0x30')][_0x830d('0x34')]));_0xb637a5[_0x830d('0x33')]=_0xb637a5[_0x830d('0x33')][_0x830d('0x35')]?_0xb637a5[_0x830d('0x33')]:_0x50a7c8[_0x830d('0x2f')];if(!_0x2643ac[_0x830d('0x30')][_0x830d('0x36')](_0x830d('0x37'))){_0xb637a5[_0x830d('0x1d')]=qs[_0x830d('0x1d')](_0x2643ac['query']['limit']);_0xb637a5[_0x830d('0x1b')]=qs[_0x830d('0x1b')](_0x2643ac[_0x830d('0x30')][_0x830d('0x1b')]);}_0xb637a5[_0x830d('0x38')]=qs['sort'](_0x2643ac[_0x830d('0x30')][_0x830d('0x39')]);_0xb637a5[_0x830d('0x3a')]=qs[_0x830d('0x32')](_[_0x830d('0x3b')](_0x2643ac['query'],_0x50a7c8[_0x830d('0x32')]),_0x4b8b1a);if(_0x2643ac[_0x830d('0x30')]['filter']){_0xb637a5['where']=_[_0x830d('0x3c')](_0xb637a5[_0x830d('0x3a')],{'$or':_[_0x830d('0x2b')](_0x4b8b1a,function(_0x459a43){if(_0x459a43[_0x830d('0x3d')]!==_0x830d('0x3e')){var _0x49eb02={};_0x49eb02[_0x459a43['name']]={'$like':'%'+_0x2643ac[_0x830d('0x30')][_0x830d('0x3f')]+'%'};return _0x49eb02;}})});}_0xb637a5=_[_0x830d('0x3c')]({},_0xb637a5,_0x2643ac[_0x830d('0x40')]);var _0x19c627={'where':_0xb637a5['where']};return db['SquareOdbc']['count'](_0x19c627)['then'](function(_0x58789f){_0x203aaf['count']=_0x58789f;if(_0x2643ac[_0x830d('0x30')][_0x830d('0x41')]){_0xb637a5[_0x830d('0x42')]=[{'all':!![]}];}return db[_0x830d('0x2c')][_0x830d('0x43')](_0xb637a5);})[_0x830d('0x23')](function(_0x22be21){_0x203aaf[_0x830d('0x44')]=_0x22be21;return _0x203aaf;})[_0x830d('0x23')](respondWithFilteredResult(_0x7c67be,_0xb637a5))[_0x830d('0x45')](handleError(_0x7c67be,null));};exports[_0x830d('0x46')]=function(_0x322cd7,_0xcf357e){var _0x4b1bfc={'raw':!![],'where':{'id':_0x322cd7[_0x830d('0x47')]['id']}},_0x4b6cb4={};_0x4b6cb4[_0x830d('0x2f')]=_[_0x830d('0x31')](db[_0x830d('0x2c')]['rawAttributes']);_0x4b6cb4[_0x830d('0x30')]=_[_0x830d('0x31')](_0x322cd7[_0x830d('0x30')]);_0x4b6cb4[_0x830d('0x32')]=_[_0x830d('0x48')](_0x4b6cb4[_0x830d('0x2f')],_0x4b6cb4[_0x830d('0x30')]);_0x4b1bfc[_0x830d('0x33')]=_['intersection'](_0x4b6cb4['model'],qs[_0x830d('0x34')](_0x322cd7[_0x830d('0x30')][_0x830d('0x34')]));_0x4b1bfc[_0x830d('0x33')]=_0x4b1bfc['attributes'][_0x830d('0x35')]?_0x4b1bfc[_0x830d('0x33')]:_0x4b6cb4['model'];if(_0x322cd7['query'][_0x830d('0x41')]){_0x4b1bfc[_0x830d('0x42')]=[{'all':!![]}];}_0x4b1bfc=_[_0x830d('0x3c')]({},_0x4b1bfc,_0x322cd7[_0x830d('0x40')]);return db[_0x830d('0x2c')][_0x830d('0x49')](_0x4b1bfc)[_0x830d('0x23')](handleEntityNotFound(_0xcf357e,null))['then'](respondWithResult(_0xcf357e,null))[_0x830d('0x45')](handleError(_0xcf357e,null));};exports[_0x830d('0x4a')]=function(_0x58bbaa,_0x1ce6ec){return db[_0x830d('0x2c')][_0x830d('0x4a')](_0x58bbaa[_0x830d('0x4b')],{})[_0x830d('0x23')](function(_0x464d02){var _0x384ed8=_0x58bbaa['user'][_0x830d('0x24')]({'plain':!![]});if(!_0x384ed8)throw new Error(_0x830d('0x4c'));if(_0x384ed8[_0x830d('0x4d')]==='user'){var _0x2ba745=_0x464d02[_0x830d('0x24')]({'plain':!![]});var _0x305f72=_0x830d('0x25');return db['UserProfileSection'][_0x830d('0x49')]({'where':{'name':_0x305f72,'userProfileId':_0x384ed8[_0x830d('0x4e')]},'raw':!![]})[_0x830d('0x23')](function(_0x19c6fa){if(_0x19c6fa&&_0x19c6fa[_0x830d('0x4f')]===0x0){return db[_0x830d('0x50')][_0x830d('0x4a')]({'name':_0x2ba745[_0x830d('0x29')],'resourceId':_0x2ba745['id'],'type':_0x19c6fa[_0x830d('0x29')],'sectionId':_0x19c6fa['id']},{})['then'](function(){return _0x464d02;});}else{return _0x464d02;}})['catch'](function(_0x7bef04){logger[_0x830d('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7bef04);throw _0x7bef04;});}return _0x464d02;})['then'](respondWithResult(_0x1ce6ec,0xc9))['catch'](handleError(_0x1ce6ec,null));};exports[_0x830d('0x51')]=function(_0x2dd174,_0x1a0f54){if(_0x2dd174[_0x830d('0x4b')]['id']){delete _0x2dd174[_0x830d('0x4b')]['id'];}return db['SquareOdbc'][_0x830d('0x49')]({'where':{'id':_0x2dd174[_0x830d('0x47')]['id']}})[_0x830d('0x23')](handleEntityNotFound(_0x1a0f54,null))[_0x830d('0x23')](saveUpdates(_0x2dd174[_0x830d('0x4b')],null))[_0x830d('0x23')](respondWithResult(_0x1a0f54,null))[_0x830d('0x45')](handleError(_0x1a0f54,null));};exports['destroy']=function(_0x64ea76,_0x198c7a){return db[_0x830d('0x2c')][_0x830d('0x49')]({'where':{'id':_0x64ea76[_0x830d('0x47')]['id']}})[_0x830d('0x23')](handleEntityNotFound(_0x198c7a,null))[_0x830d('0x23')](removeEntity(_0x198c7a,null))[_0x830d('0x45')](handleError(_0x198c7a,null));};exports[_0x830d('0x52')]=function(_0x29756d,_0x42137f,_0x3d73bb){var _0x657ca;return db['SquareOdbc'][_0x830d('0x49')]({'where':{'id':_0x29756d['params']['id']},'attributes':['id','dsn']})[_0x830d('0x23')](handleEntityNotFound(_0x42137f,null))[_0x830d('0x23')](function(_0x3b3895){if(_0x3b3895){var _0x53533f=require(_0x830d('0x53'))();_0x53533f[_0x830d('0x54')](_0x3b3895[_0x830d('0x55')]);_0x53533f[_0x830d('0x56')]();return _0x3b3895;}})['then'](respondWithResult(_0x42137f,null))[_0x830d('0x45')](handleError(_0x42137f,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index bece755..b62ab53 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 _0x00af=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc','util'];(function(_0xd97ebe,_0x509b3d){var _0x541e5a=function(_0xb86ced){while(--_0xb86ced){_0xd97ebe['push'](_0xd97ebe['shift']());}};_0x541e5a(++_0x509b3d);}(_0x00af,0xe3));var _0xf00a=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x00af[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0xf00a('0x0'));var logger=require('../../config/logger')(_0xf00a('0x1'));var moment=require(_0xf00a('0x2'));var BPromise=require(_0xf00a('0x3'));var rp=require(_0xf00a('0x4'));var fs=require('fs');var path=require(_0xf00a('0x5'));var rimraf=require(_0xf00a('0x6'));var config=require(_0xf00a('0x7'));var attributes=require(_0xf00a('0x8'));module['exports']=function(_0x311bf5,_0x415443){return _0x311bf5[_0xf00a('0x9')](_0xf00a('0xa'),attributes,{'tableName':_0xf00a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3fd=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','SquareOdbc','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3fd,0x1c2));var _0xda3f=function(_0x1b1f88,_0x3fe1cb){_0x1b1f88=_0x1b1f88-0x0;var _0x5045b9=_0xa3fd[_0x1b1f88];return _0x5045b9;};'use strict';var _=require('lodash');var util=require(_0xda3f('0x0'));var logger=require('../../config/logger')(_0xda3f('0x1'));var moment=require(_0xda3f('0x2'));var BPromise=require(_0xda3f('0x3'));var rp=require(_0xda3f('0x4'));var fs=require('fs');var path=require(_0xda3f('0x5'));var rimraf=require(_0xda3f('0x6'));var config=require(_0xda3f('0x7'));var attributes=require(_0xda3f('0x8'));module[_0xda3f('0x9')]=function(_0x1dcf8a,_0x24ddc8){return _0x1dcf8a['define'](_0xda3f('0xa'),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 ec06a52..13baaec 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 _0x3459=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','include','map','model','attributes','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x136e4d,_0x4ddd6d){var _0x4d3992=function(_0x1f49cf){while(--_0x1f49cf){_0x136e4d['push'](_0x136e4d['shift']());}};_0x4d3992(++_0x4ddd6d);}(_0x3459,0x157));var _0x9345=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3459[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x9345('0x0'));var util=require(_0x9345('0x1'));var moment=require(_0x9345('0x2'));var BPromise=require(_0x9345('0x3'));var rs=require(_0x9345('0x4'));var fs=require('fs');var Redis=require(_0x9345('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9345('0x6'));var logger=require(_0x9345('0x7'))(_0x9345('0x8'));var config=require(_0x9345('0x9'));var jayson=require(_0x9345('0xa'));var client=jayson[_0x9345('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bc530,_0x745eb5,_0x5f2b69){return new BPromise(function(_0x39f6b0,_0x5a11f3){return client[_0x9345('0xc')](_0x4bc530,_0x5f2b69)[_0x9345('0xd')](function(_0x22703b){logger['info'](_0x9345('0xe'),_0x745eb5,_0x9345('0xf'));logger[_0x9345('0x10')](_0x9345('0x11'),_0x745eb5,_0x9345('0xf'),JSON[_0x9345('0x12')](_0x22703b));if(_0x22703b[_0x9345('0x13')]){if(_0x22703b[_0x9345('0x13')][_0x9345('0x14')]===0x1f4){logger[_0x9345('0x13')](_0x9345('0xe'),_0x745eb5,_0x22703b['error'][_0x9345('0x15')]);return _0x5a11f3(_0x22703b[_0x9345('0x13')][_0x9345('0x15')]);}logger['error'](_0x9345('0xe'),_0x745eb5,_0x22703b[_0x9345('0x13')][_0x9345('0x15')]);return _0x39f6b0(_0x22703b[_0x9345('0x13')][_0x9345('0x15')]);}else{logger['info'](_0x9345('0xe'),_0x745eb5,'request\x20sent');_0x39f6b0(_0x22703b[_0x9345('0x16')][_0x9345('0x15')]);}})[_0x9345('0x17')](function(_0x258c84){logger[_0x9345('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x745eb5,_0x258c84);_0x5a11f3(_0x258c84);});});}exports[_0x9345('0x18')]=function(_0x3604ee){var _0xdab545=this;return new Promise(function(_0x2038c1,_0x3aecd3){return db[_0x9345('0x19')][_0x9345('0x1a')]({'raw':_0x3604ee[_0x9345('0x1b')]?_0x3604ee[_0x9345('0x1b')][_0x9345('0x1c')]===undefined?!![]:![]:!![],'where':_0x3604ee[_0x9345('0x1b')]?_0x3604ee['options'][_0x9345('0x1d')]||null:null,'attributes':_0x3604ee[_0x9345('0x1b')]?_0x3604ee['options']['attributes']||null:null,'include':_0x3604ee[_0x9345('0x1b')]?_0x3604ee[_0x9345('0x1b')][_0x9345('0x1e')]?_[_0x9345('0x1f')](_0x3604ee['options'][_0x9345('0x1e')],function(_0x892a82){return{'model':db[_0x892a82[_0x9345('0x20')]],'as':_0x892a82['as'],'attributes':_0x892a82[_0x9345('0x21')],'include':_0x892a82['include']?_[_0x9345('0x1f')](_0x892a82[_0x9345('0x1e')],function(_0x3ed920){return{'model':db[_0x3ed920['model']],'as':_0x3ed920['as'],'attributes':_0x3ed920['attributes'],'include':_0x3ed920['include']?_['map'](_0x3ed920[_0x9345('0x1e')],function(_0x493ea3){return{'model':db[_0x493ea3[_0x9345('0x20')]],'as':_0x493ea3['as'],'attributes':_0x493ea3[_0x9345('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c09a2){logger[_0x9345('0x22')](_0x9345('0x18'),_0x3604ee);logger['debug'](_0x9345('0x18'),_0x3604ee,JSON[_0x9345('0x12')](_0x3c09a2));_0x2038c1(_0x3c09a2);})[_0x9345('0x17')](function(_0x158792){logger[_0x9345('0x13')](_0x9345('0x18'),_0x158792['message'],_0x3604ee);_0x3aecd3(_0xdab545[_0x9345('0x13')](0x1f4,_0x158792[_0x9345('0x15')]));});});}; \ No newline at end of file +var _0xbec4=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareOdbc','find','options','raw','where','map','include','model','attributes','ShowSquareOdbc','lodash'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xbec4,0x1c6));var _0x4bec=function(_0x346417,_0x3332e3){_0x346417=_0x346417-0x0;var _0x5dbe8a=_0xbec4[_0x346417];return _0x5dbe8a;};'use strict';var _=require(_0x4bec('0x0'));var util=require(_0x4bec('0x1'));var moment=require(_0x4bec('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4bec('0x3'));var db=require(_0x4bec('0x4'))['db'];var utils=require(_0x4bec('0x5'));var logger=require(_0x4bec('0x6'))(_0x4bec('0x7'));var config=require(_0x4bec('0x8'));var jayson=require(_0x4bec('0x9'));var client=jayson[_0x4bec('0xa')][_0x4bec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x273f2c,_0x350e09,_0x2deb3c){return new BPromise(function(_0x2b5f8e,_0x21316e){return client[_0x4bec('0xc')](_0x273f2c,_0x2deb3c)[_0x4bec('0xd')](function(_0x637bf5){logger[_0x4bec('0xe')](_0x4bec('0xf'),_0x350e09,_0x4bec('0x10'));logger[_0x4bec('0x11')](_0x4bec('0x12'),_0x350e09,_0x4bec('0x10'),JSON[_0x4bec('0x13')](_0x637bf5));if(_0x637bf5['error']){if(_0x637bf5[_0x4bec('0x14')][_0x4bec('0x15')]===0x1f4){logger['error'](_0x4bec('0xf'),_0x350e09,_0x637bf5['error'][_0x4bec('0x16')]);return _0x21316e(_0x637bf5['error'][_0x4bec('0x16')]);}logger[_0x4bec('0x14')](_0x4bec('0xf'),_0x350e09,_0x637bf5[_0x4bec('0x14')][_0x4bec('0x16')]);return _0x2b5f8e(_0x637bf5[_0x4bec('0x14')]['message']);}else{logger[_0x4bec('0xe')](_0x4bec('0xf'),_0x350e09,'request\x20sent');_0x2b5f8e(_0x637bf5[_0x4bec('0x17')][_0x4bec('0x16')]);}})[_0x4bec('0x18')](function(_0x2972a7){logger['error'](_0x4bec('0xf'),_0x350e09,_0x2972a7);_0x21316e(_0x2972a7);});});}exports['ShowSquareOdbc']=function(_0x34cf41){var _0x3372f0=this;return new Promise(function(_0x4794eb,_0x35bff4){return db[_0x4bec('0x19')][_0x4bec('0x1a')]({'raw':_0x34cf41[_0x4bec('0x1b')]?_0x34cf41[_0x4bec('0x1b')][_0x4bec('0x1c')]===undefined?!![]:![]:!![],'where':_0x34cf41[_0x4bec('0x1b')]?_0x34cf41['options'][_0x4bec('0x1d')]||null:null,'attributes':_0x34cf41[_0x4bec('0x1b')]?_0x34cf41[_0x4bec('0x1b')]['attributes']||null:null,'include':_0x34cf41[_0x4bec('0x1b')]?_0x34cf41[_0x4bec('0x1b')]['include']?_[_0x4bec('0x1e')](_0x34cf41['options'][_0x4bec('0x1f')],function(_0x44e8be){return{'model':db[_0x44e8be[_0x4bec('0x20')]],'as':_0x44e8be['as'],'attributes':_0x44e8be['attributes'],'include':_0x44e8be[_0x4bec('0x1f')]?_[_0x4bec('0x1e')](_0x44e8be[_0x4bec('0x1f')],function(_0x331e91){return{'model':db[_0x331e91[_0x4bec('0x20')]],'as':_0x331e91['as'],'attributes':_0x331e91[_0x4bec('0x21')],'include':_0x331e91[_0x4bec('0x1f')]?_['map'](_0x331e91[_0x4bec('0x1f')],function(_0xc754c3){return{'model':db[_0xc754c3['model']],'as':_0xc754c3['as'],'attributes':_0xc754c3['attributes']};}):[]};}):[]};}):[]:[]})[_0x4bec('0xd')](function(_0x25e773){logger[_0x4bec('0xe')](_0x4bec('0x22'),_0x34cf41);logger[_0x4bec('0x11')](_0x4bec('0x22'),_0x34cf41,JSON[_0x4bec('0x13')](_0x25e773));_0x4794eb(_0x25e773);})[_0x4bec('0x18')](function(_0x5f5259){logger[_0x4bec('0x14')](_0x4bec('0x22'),_0x5f5259[_0x4bec('0x16')],_0x34cf41);_0x35bff4(_0x3372f0[_0x4bec('0x14')](0x1f4,_0x5f5259['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 4d307ec..043b695 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 _0xc15c=['destroy','removeUsers','exports','path','connect-timeout','express','fs-extra','../../config/environment','isAuthenticated','index','show','get','/:id/users','post','create','addUsers','put','update','/:id'];(function(_0x4ce6ec,_0x509d04){var _0x57718f=function(_0x1b7201){while(--_0x1b7201){_0x4ce6ec['push'](_0x4ce6ec['shift']());}};_0x57718f(++_0x509d04);}(_0xc15c,0xae));var _0xcc15=function(_0x1cbaa8,_0x2f595f){_0x1cbaa8=_0x1cbaa8-0x0;var _0x14304d=_0xc15c[_0x1cbaa8];return _0x14304d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcc15('0x0'));var timeout=require(_0xcc15('0x1'));var express=require(_0xcc15('0x2'));var router=express['Router']();var fs_extra=require(_0xcc15('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcc15('0x4'));var controller=require('./squareProject.controller');router['get']('/',auth[_0xcc15('0x5')](),controller[_0xcc15('0x6')]);router['get']('/:id',auth[_0xcc15('0x5')](),controller[_0xcc15('0x7')]);router[_0xcc15('0x8')](_0xcc15('0x9'),auth[_0xcc15('0x5')](),controller['getUsers']);router[_0xcc15('0xa')]('/',auth[_0xcc15('0x5')](),controller[_0xcc15('0xb')]);router[_0xcc15('0xa')]('/:id/users',auth[_0xcc15('0x5')](),controller[_0xcc15('0xc')]);router[_0xcc15('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xcc15('0xe')]);router['delete'](_0xcc15('0xf'),auth['isAuthenticated'](),controller[_0xcc15('0x10')]);router['delete'](_0xcc15('0x9'),auth['isAuthenticated'](),controller[_0xcc15('0x11')]);module[_0xcc15('0x12')]=router; \ No newline at end of file +var _0x6124=['getUsers','post','create','addUsers','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','/:id','show','/:id/users'];(function(_0x4ef724,_0x2eaa8f){var _0x16b426=function(_0x2c336b){while(--_0x2c336b){_0x4ef724['push'](_0x4ef724['shift']());}};_0x16b426(++_0x2eaa8f);}(_0x6124,0x140));var _0x4612=function(_0x1ef261,_0x4f58ee){_0x1ef261=_0x1ef261-0x0;var _0x4bd0bb=_0x6124[_0x1ef261];return _0x4bd0bb;};'use strict';var multer=require(_0x4612('0x0'));var util=require(_0x4612('0x1'));var path=require(_0x4612('0x2'));var timeout=require('connect-timeout');var express=require(_0x4612('0x3'));var router=express[_0x4612('0x4')]();var fs_extra=require(_0x4612('0x5'));var auth=require(_0x4612('0x6'));var interaction=require(_0x4612('0x7'));var config=require(_0x4612('0x8'));var controller=require(_0x4612('0x9'));router['get']('/',auth[_0x4612('0xa')](),controller[_0x4612('0xb')]);router[_0x4612('0xc')](_0x4612('0xd'),auth['isAuthenticated'](),controller[_0x4612('0xe')]);router[_0x4612('0xc')](_0x4612('0xf'),auth[_0x4612('0xa')](),controller[_0x4612('0x10')]);router[_0x4612('0x11')]('/',auth[_0x4612('0xa')](),controller[_0x4612('0x12')]);router[_0x4612('0x11')](_0x4612('0xf'),auth[_0x4612('0xa')](),controller[_0x4612('0x13')]);router[_0x4612('0x14')](_0x4612('0xd'),auth[_0x4612('0xa')](),controller[_0x4612('0x15')]);router[_0x4612('0x16')]('/:id',auth[_0x4612('0xa')](),controller[_0x4612('0x17')]);router[_0x4612('0x16')](_0x4612('0xf'),auth[_0x4612('0xa')](),controller['removeUsers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 1c00bc4..9ad8688 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 _0x4ab2=['exports','STRING','name','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE'];(function(_0x1e8a90,_0x27bf2f){var _0x15fa83=function(_0x2fa13e){while(--_0x2fa13e){_0x1e8a90['push'](_0x1e8a90['shift']());}};_0x15fa83(++_0x27bf2f);}(_0x4ab2,0xbb));var _0x24ab=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4ab2[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0x24ab('0x0')]={'name':{'type':Sequelize[_0x24ab('0x1')],'unique':_0x24ab('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x24ab('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x24ab('0x3')](_0x24ab('0x4')),'get':function(){if(this[_0x24ab('0x5')](_0x24ab('0x6'))){return this[_0x24ab('0x5')]('preproduction')[_0x24ab('0x7')](_0x24ab('0x8'));}}},'production':{'type':Sequelize[_0x24ab('0x3')](_0x24ab('0x4')),'get':function(){if(this[_0x24ab('0x5')](_0x24ab('0x9'))){return this['getDataValue']('production')['toString'](_0x24ab('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x24ab('0xa')]}}; \ No newline at end of file +var _0xd07e=['STRING','name','BLOB','long','getDataValue','preproduction','utf8','production','toString','DATE','sequelize','exports'];(function(_0x2f490e,_0x9adb99){var _0x48d1f6=function(_0x1917db){while(--_0x1917db){_0x2f490e['push'](_0x2f490e['shift']());}};_0x48d1f6(++_0x9adb99);}(_0xd07e,0x8e));var _0xed07=function(_0x5a8585,_0x29fb9c){_0x5a8585=_0x5a8585-0x0;var _0x319e30=_0xd07e[_0x5a8585];return _0x319e30;};'use strict';var Sequelize=require(_0xed07('0x0'));module[_0xed07('0x1')]={'name':{'type':Sequelize[_0xed07('0x2')],'unique':_0xed07('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xed07('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xed07('0x4')](_0xed07('0x5')),'get':function(){if(this[_0xed07('0x6')]('preproduction')){return this[_0xed07('0x6')](_0xed07('0x7'))['toString'](_0xed07('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0xed07('0x5')),'get':function(){if(this[_0xed07('0x6')](_0xed07('0x9'))){return this[_0xed07('0x6')](_0xed07('0x9'))[_0xed07('0xa')](_0xed07('0x8'));}}},'savedAt':{'type':Sequelize[_0xed07('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index d5add91..c1c8aca 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 _0x846c=['VIRTUAL','options','SquareProject','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','omit','removeUsers','ids','isArray','emit','userSquareProject:remove','getUsers','User','pick','hasOwnProperty','nolimit','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','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','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','apply','reject','save','update','then','destroy','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','length','order','sort','where','filters','filter','merge'];(function(_0x74a990,_0x4d35c7){var _0x249691=function(_0x1ea228){while(--_0x1ea228){_0x74a990['push'](_0x74a990['shift']());}};_0x249691(++_0x4d35c7);}(_0x846c,0xec));var _0xc846=function(_0x3e238d,_0x2cd22e){_0x3e238d=_0x3e238d-0x0;var _0xf7263d=_0x846c[_0x3e238d];return _0xf7263d;};'use strict';var emlformat=require(_0xc846('0x0'));var rimraf=require(_0xc846('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc846('0x2'));var rp=require('request-promise');var moment=require(_0xc846('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc846('0x4'));var util=require(_0xc846('0x5'));var path=require(_0xc846('0x6'));var sox=require(_0xc846('0x7'));var csv=require('to-csv');var ejs=require(_0xc846('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc846('0x9'));var squel=require(_0xc846('0xa'));var crypto=require(_0xc846('0xb'));var jsforce=require(_0xc846('0xc'));var deskjs=require(_0xc846('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc846('0xe'));var Redis=require(_0xc846('0xf'));var authService=require(_0xc846('0x10'));var qs=require(_0xc846('0x11'));var as=require(_0xc846('0x12'));var hardwareService=require(_0xc846('0x13'));var logger=require('../../config/logger')(_0xc846('0x14'));var utils=require(_0xc846('0x15'));var config=require(_0xc846('0x16'));var licenseUtil=require(_0xc846('0x17'));var db=require(_0xc846('0x18'))['db'];config[_0xc846('0x19')]=_[_0xc846('0x1a')](config[_0xc846('0x19')],{'host':_0xc846('0x1b'),'port':0x18eb});var socket=require(_0xc846('0x1c'))(new Redis(config[_0xc846('0x19')]));require(_0xc846('0x1d'))[_0xc846('0x1e')](socket);function respondWithStatusCode(_0x5a937f,_0x3d9629){_0x3d9629=_0x3d9629||0xcc;return function(_0x5656b4){if(_0x5656b4){return _0x5a937f[_0xc846('0x1f')](_0x3d9629);}return _0x5a937f[_0xc846('0x20')](_0x3d9629)[_0xc846('0x21')]();};}function respondWithResult(_0xbc320e,_0x555ed9){_0x555ed9=_0x555ed9||0xc8;return function(_0x115ea2){if(_0x115ea2){return _0xbc320e['status'](_0x555ed9)[_0xc846('0x22')](_0x115ea2);}};}function respondWithFilteredResult(_0xae060d,_0x413cf9){return function(_0x49be28){if(_0x49be28){var _0x557198=typeof _0x413cf9[_0xc846('0x23')]===_0xc846('0x24')&&typeof _0x413cf9[_0xc846('0x25')]==='undefined';var _0x298b16=_0x49be28['count'];var _0xe83302=_0x557198?0x0:_0x413cf9['offset'];var _0x2c3fb8=_0x557198?_0x49be28['count']:_0x413cf9[_0xc846('0x23')]+_0x413cf9[_0xc846('0x25')];var _0x2de4c7;if(_0x2c3fb8>=_0x298b16){_0x2c3fb8=_0x298b16;_0x2de4c7=0xc8;}else{_0x2de4c7=0xce;}_0xae060d['status'](_0x2de4c7);return _0xae060d['set']('Content-Range',_0xe83302+'-'+_0x2c3fb8+'/'+_0x298b16)[_0xc846('0x22')](_0x49be28);}return null;};}function patchUpdates(_0x5c8dbe){return function(_0x4f3b8e){try{jsonpatch[_0xc846('0x26')](_0x4f3b8e,_0x5c8dbe,!![]);}catch(_0x5e6a36){return BPromise[_0xc846('0x27')](_0x5e6a36);}return _0x4f3b8e[_0xc846('0x28')]();};}function saveUpdates(_0x5e8096,_0x3d1749){return function(_0x5e3281){if(_0x5e3281){return _0x5e3281[_0xc846('0x29')](_0x5e8096)[_0xc846('0x2a')](function(_0x3d4936){return _0x3d4936;});}return null;};}function removeEntity(_0x45687e,_0x3b0e32){return function(_0x4b1253){if(_0x4b1253){return _0x4b1253[_0xc846('0x2b')]()[_0xc846('0x2a')](function(){var _0x41229e=_0x4b1253['get']({'plain':!![]});var _0x200948='SquareProjects';return db[_0xc846('0x2c')][_0xc846('0x2b')]({'where':{'type':_0x200948,'resourceId':_0x41229e['id']}})[_0xc846('0x2a')](function(){return _0x4b1253;});})[_0xc846('0x2a')](function(){_0x45687e[_0xc846('0x20')](0xcc)[_0xc846('0x21')]();});}};}function handleEntityNotFound(_0x5de373,_0x1ede4c){return function(_0x13a298){if(!_0x13a298){_0x5de373[_0xc846('0x1f')](0x194);}return _0x13a298;};}function handleError(_0x5aa32d,_0x5e2e8a){_0x5e2e8a=_0x5e2e8a||0x1f4;return function(_0x40df17){logger['error'](_0x40df17[_0xc846('0x2d')]);if(_0x40df17[_0xc846('0x2e')]){delete _0x40df17[_0xc846('0x2e')];}_0x5aa32d[_0xc846('0x20')](_0x5e2e8a)[_0xc846('0x2f')](_0x40df17);};}exports[_0xc846('0x30')]=function(_0x5128f,_0x100f9d){var _0x30fa64={},_0x125736={},_0x17ce68={'count':0x0,'rows':[]};var _0x3faeae=_['map'](db['SquareProject'][_0xc846('0x31')],function(_0x566ffd){return{'name':_0x566ffd[_0xc846('0x32')],'type':_0x566ffd[_0xc846('0x33')][_0xc846('0x34')]};});_0x125736[_0xc846('0x35')]=_[_0xc846('0x36')](_0x3faeae,_0xc846('0x2e'));_0x125736['query']=_[_0xc846('0x37')](_0x5128f[_0xc846('0x38')]);_0x125736['filters']=_[_0xc846('0x39')](_0x125736[_0xc846('0x35')],_0x125736[_0xc846('0x38')]);_0x30fa64['attributes']=_['intersection'](_0x125736[_0xc846('0x35')],qs['fields'](_0x5128f[_0xc846('0x38')][_0xc846('0x3a')]));_0x30fa64[_0xc846('0x3b')]=_0x30fa64[_0xc846('0x3b')][_0xc846('0x3c')]?_0x30fa64[_0xc846('0x3b')]:_0x125736['model'];if(!_0x5128f[_0xc846('0x38')]['hasOwnProperty']('nolimit')){_0x30fa64[_0xc846('0x25')]=qs['limit'](_0x5128f['query'][_0xc846('0x25')]);_0x30fa64[_0xc846('0x23')]=qs[_0xc846('0x23')](_0x5128f[_0xc846('0x38')][_0xc846('0x23')]);}_0x30fa64[_0xc846('0x3d')]=qs[_0xc846('0x3e')](_0x5128f[_0xc846('0x38')][_0xc846('0x3e')]);_0x30fa64[_0xc846('0x3f')]=qs[_0xc846('0x40')](_['pick'](_0x5128f[_0xc846('0x38')],_0x125736[_0xc846('0x40')]),_0x3faeae);if(_0x5128f[_0xc846('0x38')][_0xc846('0x41')]){_0x30fa64['where']=_[_0xc846('0x42')](_0x30fa64[_0xc846('0x3f')],{'$or':_[_0xc846('0x36')](_0x3faeae,function(_0x371a77){if(_0x371a77[_0xc846('0x33')]!==_0xc846('0x43')){var _0x153431={};_0x153431[_0x371a77[_0xc846('0x2e')]]={'$like':'%'+_0x5128f[_0xc846('0x38')][_0xc846('0x41')]+'%'};return _0x153431;}})});}_0x30fa64=_[_0xc846('0x42')]({},_0x30fa64,_0x5128f[_0xc846('0x44')]);var _0x21f490={'where':_0x30fa64['where']};return db[_0xc846('0x45')][_0xc846('0x46')](_0x21f490)[_0xc846('0x2a')](function(_0x479d03){_0x17ce68[_0xc846('0x46')]=_0x479d03;if(_0x5128f[_0xc846('0x38')][_0xc846('0x47')]){_0x30fa64[_0xc846('0x48')]=[{'all':!![]}];}return db[_0xc846('0x45')][_0xc846('0x49')](_0x30fa64);})[_0xc846('0x2a')](function(_0x2b6884){_0x17ce68[_0xc846('0x4a')]=_0x2b6884;return _0x17ce68;})[_0xc846('0x2a')](respondWithFilteredResult(_0x100f9d,_0x30fa64))[_0xc846('0x4b')](handleError(_0x100f9d,null));};exports[_0xc846('0x4c')]=function(_0x55a6d7,_0x345c95){var _0x184f64={'raw':![],'where':{'id':_0x55a6d7[_0xc846('0x4d')]['id']}},_0xc40ce9={};_0xc40ce9[_0xc846('0x35')]=_[_0xc846('0x37')](db[_0xc846('0x45')][_0xc846('0x31')]);_0xc40ce9[_0xc846('0x38')]=_[_0xc846('0x37')](_0x55a6d7[_0xc846('0x38')]);_0xc40ce9[_0xc846('0x40')]=_[_0xc846('0x39')](_0xc40ce9['model'],_0xc40ce9['query']);_0x184f64['attributes']=_['intersection'](_0xc40ce9[_0xc846('0x35')],qs[_0xc846('0x3a')](_0x55a6d7[_0xc846('0x38')][_0xc846('0x3a')]));_0x184f64[_0xc846('0x3b')]=_0x184f64[_0xc846('0x3b')]['length']?_0x184f64[_0xc846('0x3b')]:_0xc40ce9[_0xc846('0x35')];if(_0x55a6d7[_0xc846('0x38')]['includeAll']){_0x184f64[_0xc846('0x48')]=[{'all':!![]}];}_0x184f64=_[_0xc846('0x42')]({},_0x184f64,_0x55a6d7[_0xc846('0x44')]);return db[_0xc846('0x45')][_0xc846('0x4e')](_0x184f64)[_0xc846('0x2a')](handleEntityNotFound(_0x345c95,null))[_0xc846('0x2a')](respondWithResult(_0x345c95,null))[_0xc846('0x4b')](handleError(_0x345c95,null));};exports[_0xc846('0x4f')]=function(_0x13123e,_0x7851cb){return db['SquareProject'][_0xc846('0x4f')](_0x13123e[_0xc846('0x50')],{})[_0xc846('0x2a')](function(_0x55c2d5){var _0x4c34b6=_0x13123e[_0xc846('0x51')][_0xc846('0x52')]({'plain':!![]});if(!_0x4c34b6)throw new Error(_0xc846('0x53'));if(_0x4c34b6[_0xc846('0x54')]===_0xc846('0x51')){var _0x3a94c3=_0x55c2d5[_0xc846('0x52')]({'plain':!![]});var _0x23d47a='SquareProjects';return db['UserProfileSection'][_0xc846('0x4e')]({'where':{'name':_0x23d47a,'userProfileId':_0x4c34b6[_0xc846('0x55')]},'raw':!![]})['then'](function(_0xd6fe62){if(_0xd6fe62&&_0xd6fe62[_0xc846('0x56')]===0x0){return db[_0xc846('0x2c')][_0xc846('0x4f')]({'name':_0x3a94c3[_0xc846('0x2e')],'resourceId':_0x3a94c3['id'],'type':_0xd6fe62[_0xc846('0x2e')],'sectionId':_0xd6fe62['id']},{})[_0xc846('0x2a')](function(){return _0x55c2d5;});}else{return _0x55c2d5;}})[_0xc846('0x4b')](function(_0x346497){logger[_0xc846('0x57')](_0xc846('0x58'),_0x346497);throw _0x346497;});}return _0x55c2d5;})[_0xc846('0x2a')](respondWithResult(_0x7851cb,0xc9))['catch'](handleError(_0x7851cb,null));};exports['update']=function(_0x557b14,_0xbe1d1){if(_0x557b14[_0xc846('0x50')]['id']){delete _0x557b14[_0xc846('0x50')]['id'];}return db[_0xc846('0x45')][_0xc846('0x4e')]({'where':{'id':_0x557b14[_0xc846('0x4d')]['id']}})[_0xc846('0x2a')](handleEntityNotFound(_0xbe1d1,null))[_0xc846('0x2a')](saveUpdates(_0x557b14[_0xc846('0x50')],null))[_0xc846('0x2a')](respondWithResult(_0xbe1d1,null))[_0xc846('0x4b')](handleError(_0xbe1d1,null));};exports['destroy']=function(_0x59b2de,_0x45dc43){return db[_0xc846('0x45')][_0xc846('0x4e')]({'where':{'id':_0x59b2de[_0xc846('0x4d')]['id']}})['then'](handleEntityNotFound(_0x45dc43,null))[_0xc846('0x2a')](removeEntity(_0x45dc43,null))[_0xc846('0x4b')](handleError(_0x45dc43,null));};exports[_0xc846('0x59')]=function(_0x96d3b2,_0x3d7528,_0x590dd0){return db['SquareProject'][_0xc846('0x4e')]({'where':{'id':_0x96d3b2[_0xc846('0x4d')]['id']}})[_0xc846('0x2a')](handleEntityNotFound(_0x3d7528,null))['then'](function(_0x3a4cc3){if(_0x3a4cc3){return _0x3a4cc3[_0xc846('0x59')](_0x96d3b2['body']['ids'],_[_0xc846('0x5a')](_0x96d3b2[_0xc846('0x50')],['ids','id'])||{});}})['then'](respondWithResult(_0x3d7528,null))[_0xc846('0x4b')](handleError(_0x3d7528,null));};exports['removeUsers']=function(_0x182bb1,_0x27e19f,_0x2552b0){return db[_0xc846('0x45')][_0xc846('0x4e')]({'where':{'id':_0x182bb1[_0xc846('0x4d')]['id']}})[_0xc846('0x2a')](handleEntityNotFound(_0x27e19f,null))[_0xc846('0x2a')](function(_0x551afa){if(_0x551afa){return _0x551afa[_0xc846('0x5b')](_0x182bb1[_0xc846('0x38')][_0xc846('0x5c')])[_0xc846('0x2a')](function(){if(_[_0xc846('0x5d')](_0x182bb1[_0xc846('0x38')]['ids'])){for(var _0x3aa5ca=0x0;_0x3aa5ca<_0x182bb1['query'][_0xc846('0x5c')][_0xc846('0x3c')];_0x3aa5ca+=0x1){socket[_0xc846('0x5e')](_0xc846('0x5f'),{'UserId':Number(_0x182bb1['query'][_0xc846('0x5c')][_0x3aa5ca]),'SquareProjectId':Number(_0x182bb1[_0xc846('0x4d')]['id'])});}}else{socket[_0xc846('0x5e')](_0xc846('0x5f'),{'UserId':Number(_0x182bb1['query'][_0xc846('0x5c')]),'SquareProjectId':Number(_0x182bb1[_0xc846('0x4d')]['id'])});}});}})[_0xc846('0x2a')](respondWithStatusCode(_0x27e19f,null))[_0xc846('0x4b')](handleError(_0x27e19f,null));};exports[_0xc846('0x60')]=function(_0x5e226a,_0x3f3fdc,_0x14873e){var _0xea8798={};var _0x40bc15={};var _0x238d45;var _0x29abca;return db[_0xc846('0x45')]['findOne']({'where':{'id':_0x5e226a[_0xc846('0x4d')]['id']}})[_0xc846('0x2a')](handleEntityNotFound(_0x3f3fdc,null))['then'](function(_0x352e28){if(_0x352e28){_0x238d45=_0x352e28;_0x40bc15['model']=_[_0xc846('0x37')](db[_0xc846('0x61')]['rawAttributes']);_0x40bc15['query']=_[_0xc846('0x37')](_0x5e226a[_0xc846('0x38')]);_0x40bc15[_0xc846('0x40')]=_[_0xc846('0x39')](_0x40bc15[_0xc846('0x35')],_0x40bc15[_0xc846('0x38')]);_0xea8798[_0xc846('0x3b')]=_[_0xc846('0x39')](_0x40bc15['model'],qs['fields'](_0x5e226a['query'][_0xc846('0x3a')]));_0xea8798['attributes']=_0xea8798[_0xc846('0x3b')]['length']?_0xea8798[_0xc846('0x3b')]:_0x40bc15[_0xc846('0x35')];_0xea8798['order']=qs[_0xc846('0x3e')](_0x5e226a[_0xc846('0x38')]['sort']);_0xea8798[_0xc846('0x3f')]=qs[_0xc846('0x40')](_[_0xc846('0x62')](_0x5e226a[_0xc846('0x38')],_0x40bc15['filters']));if(_0x5e226a[_0xc846('0x38')][_0xc846('0x41')]){_0xea8798['where']=_[_0xc846('0x42')](_0xea8798[_0xc846('0x3f')],{'$or':_['map'](_0xea8798[_0xc846('0x3b')],function(_0x444762){var _0x354095={};_0x354095[_0x444762]={'$like':'%'+_0x5e226a[_0xc846('0x38')]['filter']+'%'};return _0x354095;})});}_0xea8798=_['merge']({},_0xea8798,_0x5e226a[_0xc846('0x44')]);return _0x238d45[_0xc846('0x60')](_0xea8798);}})['then'](function(_0x57d93c){if(_0x57d93c){_0x29abca=_0x57d93c[_0xc846('0x3c')];if(!_0x5e226a['query'][_0xc846('0x63')](_0xc846('0x64'))){_0xea8798['limit']=qs[_0xc846('0x25')](_0x5e226a['query'][_0xc846('0x25')]);_0xea8798[_0xc846('0x23')]=qs['offset'](_0x5e226a[_0xc846('0x38')]['offset']);}return _0x238d45[_0xc846('0x60')](_0xea8798);}})[_0xc846('0x2a')](function(_0x3cbcf6){if(_0x3cbcf6){return _0x3cbcf6?{'count':_0x29abca,'rows':_0x3cbcf6}:null;}})[_0xc846('0x2a')](respondWithResult(_0x3f3fdc,null))[_0xc846('0x4b')](handleError(_0x3f3fdc,null));}; \ No newline at end of file +var _0x87c4=['autoAssociation','UserProfileResource','params','destroy','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','User','fields','getUsers','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./squareProject.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','get','error','name','send','index','map','SquareProject','rawAttributes','key','model','query','keys','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','userProfileId'];(function(_0x280a73,_0x143850){var _0x49d68c=function(_0x1ca30d){while(--_0x1ca30d){_0x280a73['push'](_0x280a73['shift']());}};_0x49d68c(++_0x143850);}(_0x87c4,0x13d));var _0x487c=function(_0x31d400,_0x13fb14){_0x31d400=_0x31d400-0x0;var _0x58806e=_0x87c4[_0x31d400];return _0x58806e;};'use strict';var emlformat=require(_0x487c('0x0'));var rimraf=require(_0x487c('0x1'));var zipdir=require(_0x487c('0x2'));var jsonpatch=require(_0x487c('0x3'));var rp=require(_0x487c('0x4'));var moment=require(_0x487c('0x5'));var BPromise=require(_0x487c('0x6'));var Mustache=require(_0x487c('0x7'));var util=require(_0x487c('0x8'));var path=require(_0x487c('0x9'));var sox=require(_0x487c('0xa'));var csv=require(_0x487c('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x487c('0xc'));var _=require('lodash');var squel=require(_0x487c('0xd'));var crypto=require(_0x487c('0xe'));var jsforce=require(_0x487c('0xf'));var deskjs=require(_0x487c('0x10'));var toCsv=require(_0x487c('0xb'));var querystring=require(_0x487c('0x11'));var Papa=require(_0x487c('0x12'));var Redis=require(_0x487c('0x13'));var authService=require(_0x487c('0x14'));var qs=require(_0x487c('0x15'));var as=require(_0x487c('0x16'));var hardwareService=require(_0x487c('0x17'));var logger=require('../../config/logger')(_0x487c('0x18'));var utils=require(_0x487c('0x19'));var config=require(_0x487c('0x1a'));var licenseUtil=require(_0x487c('0x1b'));var db=require(_0x487c('0x1c'))['db'];config[_0x487c('0x1d')]=_[_0x487c('0x1e')](config[_0x487c('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x487c('0x1d')]));require(_0x487c('0x1f'))[_0x487c('0x20')](socket);function respondWithStatusCode(_0x18d1fb,_0x8f178f){_0x8f178f=_0x8f178f||0xcc;return function(_0xd4f5e5){if(_0xd4f5e5){return _0x18d1fb[_0x487c('0x21')](_0x8f178f);}return _0x18d1fb[_0x487c('0x22')](_0x8f178f)[_0x487c('0x23')]();};}function respondWithResult(_0x12dcd5,_0x2a2c4f){_0x2a2c4f=_0x2a2c4f||0xc8;return function(_0x45657c){if(_0x45657c){return _0x12dcd5['status'](_0x2a2c4f)['json'](_0x45657c);}};}function respondWithFilteredResult(_0x90f154,_0x222a32){return function(_0x4a9c05){if(_0x4a9c05){var _0x1fb48a=typeof _0x222a32[_0x487c('0x24')]===_0x487c('0x25')&&typeof _0x222a32[_0x487c('0x26')]===_0x487c('0x25');var _0x47922f=_0x4a9c05[_0x487c('0x27')];var _0x542455=_0x1fb48a?0x0:_0x222a32[_0x487c('0x24')];var _0x591cc8=_0x1fb48a?_0x4a9c05[_0x487c('0x27')]:_0x222a32[_0x487c('0x24')]+_0x222a32[_0x487c('0x26')];var _0x2b1e6c;if(_0x591cc8>=_0x47922f){_0x591cc8=_0x47922f;_0x2b1e6c=0xc8;}else{_0x2b1e6c=0xce;}_0x90f154[_0x487c('0x22')](_0x2b1e6c);return _0x90f154[_0x487c('0x28')](_0x487c('0x29'),_0x542455+'-'+_0x591cc8+'/'+_0x47922f)[_0x487c('0x2a')](_0x4a9c05);}return null;};}function patchUpdates(_0x2e1a0c){return function(_0x350118){try{jsonpatch['apply'](_0x350118,_0x2e1a0c,!![]);}catch(_0xac2841){return BPromise[_0x487c('0x2b')](_0xac2841);}return _0x350118[_0x487c('0x2c')]();};}function saveUpdates(_0x196f13,_0x443c7a){return function(_0x8314d0){if(_0x8314d0){return _0x8314d0[_0x487c('0x2d')](_0x196f13)[_0x487c('0x2e')](function(_0x251c45){return _0x251c45;});}return null;};}function removeEntity(_0x4056c6,_0x5f0438){return function(_0x405544){if(_0x405544){return _0x405544['destroy']()[_0x487c('0x2e')](function(){var _0x4f89df=_0x405544[_0x487c('0x2f')]({'plain':!![]});var _0xacff27='SquareProjects';return db['UserProfileResource']['destroy']({'where':{'type':_0xacff27,'resourceId':_0x4f89df['id']}})[_0x487c('0x2e')](function(){return _0x405544;});})[_0x487c('0x2e')](function(){_0x4056c6['status'](0xcc)[_0x487c('0x23')]();});}};}function handleEntityNotFound(_0x367a76,_0x43d706){return function(_0x166da4){if(!_0x166da4){_0x367a76['sendStatus'](0x194);}return _0x166da4;};}function handleError(_0x145a4e,_0x47d84b){_0x47d84b=_0x47d84b||0x1f4;return function(_0x2693b0){logger[_0x487c('0x30')](_0x2693b0['stack']);if(_0x2693b0[_0x487c('0x31')]){delete _0x2693b0[_0x487c('0x31')];}_0x145a4e[_0x487c('0x22')](_0x47d84b)[_0x487c('0x32')](_0x2693b0);};}exports[_0x487c('0x33')]=function(_0x21e6eb,_0x202150){var _0x25d0e6={},_0x6f249a={},_0x486275={'count':0x0,'rows':[]};var _0x2dc6ff=_[_0x487c('0x34')](db[_0x487c('0x35')][_0x487c('0x36')],function(_0x1d1116){return{'name':_0x1d1116['fieldName'],'type':_0x1d1116['type'][_0x487c('0x37')]};});_0x6f249a[_0x487c('0x38')]=_['map'](_0x2dc6ff,_0x487c('0x31'));_0x6f249a[_0x487c('0x39')]=_[_0x487c('0x3a')](_0x21e6eb[_0x487c('0x39')]);_0x6f249a['filters']=_['intersection'](_0x6f249a[_0x487c('0x38')],_0x6f249a['query']);_0x25d0e6[_0x487c('0x3b')]=_[_0x487c('0x3c')](_0x6f249a[_0x487c('0x38')],qs['fields'](_0x21e6eb['query']['fields']));_0x25d0e6[_0x487c('0x3b')]=_0x25d0e6[_0x487c('0x3b')][_0x487c('0x3d')]?_0x25d0e6[_0x487c('0x3b')]:_0x6f249a['model'];if(!_0x21e6eb[_0x487c('0x39')][_0x487c('0x3e')](_0x487c('0x3f'))){_0x25d0e6[_0x487c('0x26')]=qs[_0x487c('0x26')](_0x21e6eb[_0x487c('0x39')]['limit']);_0x25d0e6[_0x487c('0x24')]=qs[_0x487c('0x24')](_0x21e6eb[_0x487c('0x39')][_0x487c('0x24')]);}_0x25d0e6[_0x487c('0x40')]=qs[_0x487c('0x41')](_0x21e6eb[_0x487c('0x39')][_0x487c('0x41')]);_0x25d0e6[_0x487c('0x42')]=qs[_0x487c('0x43')](_[_0x487c('0x44')](_0x21e6eb[_0x487c('0x39')],_0x6f249a[_0x487c('0x43')]),_0x2dc6ff);if(_0x21e6eb[_0x487c('0x39')][_0x487c('0x45')]){_0x25d0e6[_0x487c('0x42')]=_[_0x487c('0x46')](_0x25d0e6[_0x487c('0x42')],{'$or':_['map'](_0x2dc6ff,function(_0x5e327f){if(_0x5e327f[_0x487c('0x47')]!==_0x487c('0x48')){var _0x1dc328={};_0x1dc328[_0x5e327f[_0x487c('0x31')]]={'$like':'%'+_0x21e6eb['query'][_0x487c('0x45')]+'%'};return _0x1dc328;}})});}_0x25d0e6=_[_0x487c('0x46')]({},_0x25d0e6,_0x21e6eb[_0x487c('0x49')]);var _0x5cf7d2={'where':_0x25d0e6[_0x487c('0x42')]};return db[_0x487c('0x35')][_0x487c('0x27')](_0x5cf7d2)[_0x487c('0x2e')](function(_0x5b46a2){_0x486275[_0x487c('0x27')]=_0x5b46a2;if(_0x21e6eb[_0x487c('0x39')][_0x487c('0x4a')]){_0x25d0e6['include']=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x25d0e6);})[_0x487c('0x2e')](function(_0x2882b1){_0x486275[_0x487c('0x4b')]=_0x2882b1;return _0x486275;})['then'](respondWithFilteredResult(_0x202150,_0x25d0e6))[_0x487c('0x4c')](handleError(_0x202150,null));};exports['show']=function(_0x3eb9e4,_0x390ef5){var _0xc19b75={'raw':![],'where':{'id':_0x3eb9e4['params']['id']}},_0x4b6ac1={};_0x4b6ac1[_0x487c('0x38')]=_[_0x487c('0x3a')](db['SquareProject'][_0x487c('0x36')]);_0x4b6ac1[_0x487c('0x39')]=_[_0x487c('0x3a')](_0x3eb9e4[_0x487c('0x39')]);_0x4b6ac1[_0x487c('0x43')]=_[_0x487c('0x3c')](_0x4b6ac1[_0x487c('0x38')],_0x4b6ac1[_0x487c('0x39')]);_0xc19b75[_0x487c('0x3b')]=_[_0x487c('0x3c')](_0x4b6ac1[_0x487c('0x38')],qs['fields'](_0x3eb9e4[_0x487c('0x39')]['fields']));_0xc19b75['attributes']=_0xc19b75[_0x487c('0x3b')][_0x487c('0x3d')]?_0xc19b75[_0x487c('0x3b')]:_0x4b6ac1[_0x487c('0x38')];if(_0x3eb9e4[_0x487c('0x39')]['includeAll']){_0xc19b75[_0x487c('0x4d')]=[{'all':!![]}];}_0xc19b75=_[_0x487c('0x46')]({},_0xc19b75,_0x3eb9e4['options']);return db['SquareProject'][_0x487c('0x4e')](_0xc19b75)[_0x487c('0x2e')](handleEntityNotFound(_0x390ef5,null))[_0x487c('0x2e')](respondWithResult(_0x390ef5,null))[_0x487c('0x4c')](handleError(_0x390ef5,null));};exports[_0x487c('0x4f')]=function(_0x5605e3,_0x178531){return db['SquareProject'][_0x487c('0x4f')](_0x5605e3[_0x487c('0x50')],{})[_0x487c('0x2e')](function(_0x59add3){var _0x82e2ae=_0x5605e3[_0x487c('0x51')][_0x487c('0x2f')]({'plain':!![]});if(!_0x82e2ae)throw new Error(_0x487c('0x52'));if(_0x82e2ae[_0x487c('0x53')]===_0x487c('0x51')){var _0x5b12eb=_0x59add3['get']({'plain':!![]});var _0x12c191=_0x487c('0x54');return db[_0x487c('0x55')]['find']({'where':{'name':_0x12c191,'userProfileId':_0x82e2ae[_0x487c('0x56')]},'raw':!![]})[_0x487c('0x2e')](function(_0x55c9c8){if(_0x55c9c8&&_0x55c9c8[_0x487c('0x57')]===0x0){return db[_0x487c('0x58')][_0x487c('0x4f')]({'name':_0x5b12eb[_0x487c('0x31')],'resourceId':_0x5b12eb['id'],'type':_0x55c9c8[_0x487c('0x31')],'sectionId':_0x55c9c8['id']},{})[_0x487c('0x2e')](function(){return _0x59add3;});}else{return _0x59add3;}})[_0x487c('0x4c')](function(_0x9a1e4a){logger[_0x487c('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9a1e4a);throw _0x9a1e4a;});}return _0x59add3;})[_0x487c('0x2e')](respondWithResult(_0x178531,0xc9))[_0x487c('0x4c')](handleError(_0x178531,null));};exports[_0x487c('0x2d')]=function(_0x26f3f7,_0x226124){if(_0x26f3f7[_0x487c('0x50')]['id']){delete _0x26f3f7[_0x487c('0x50')]['id'];}return db[_0x487c('0x35')][_0x487c('0x4e')]({'where':{'id':_0x26f3f7[_0x487c('0x59')]['id']}})['then'](handleEntityNotFound(_0x226124,null))[_0x487c('0x2e')](saveUpdates(_0x26f3f7[_0x487c('0x50')],null))[_0x487c('0x2e')](respondWithResult(_0x226124,null))[_0x487c('0x4c')](handleError(_0x226124,null));};exports[_0x487c('0x5a')]=function(_0x3e6e7a,_0x29f3b2){return db[_0x487c('0x35')][_0x487c('0x4e')]({'where':{'id':_0x3e6e7a[_0x487c('0x59')]['id']}})[_0x487c('0x2e')](handleEntityNotFound(_0x29f3b2,null))['then'](removeEntity(_0x29f3b2,null))[_0x487c('0x4c')](handleError(_0x29f3b2,null));};exports['addUsers']=function(_0x27a905,_0xc851c9,_0x3baa59){return db[_0x487c('0x35')][_0x487c('0x4e')]({'where':{'id':_0x27a905[_0x487c('0x59')]['id']}})[_0x487c('0x2e')](handleEntityNotFound(_0xc851c9,null))['then'](function(_0x5834de){if(_0x5834de){return _0x5834de[_0x487c('0x5b')](_0x27a905[_0x487c('0x50')]['ids'],_[_0x487c('0x5c')](_0x27a905['body'],[_0x487c('0x5d'),'id'])||{});}})[_0x487c('0x2e')](respondWithResult(_0xc851c9,null))[_0x487c('0x4c')](handleError(_0xc851c9,null));};exports['removeUsers']=function(_0x4e26fc,_0x191ccb,_0x1b2d6f){return db[_0x487c('0x35')][_0x487c('0x4e')]({'where':{'id':_0x4e26fc['params']['id']}})[_0x487c('0x2e')](handleEntityNotFound(_0x191ccb,null))[_0x487c('0x2e')](function(_0x1bef1f){if(_0x1bef1f){return _0x1bef1f[_0x487c('0x5e')](_0x4e26fc[_0x487c('0x39')][_0x487c('0x5d')])[_0x487c('0x2e')](function(){if(_[_0x487c('0x5f')](_0x4e26fc[_0x487c('0x39')][_0x487c('0x5d')])){for(var _0x30546e=0x0;_0x30546e<_0x4e26fc['query']['ids'][_0x487c('0x3d')];_0x30546e+=0x1){socket[_0x487c('0x60')](_0x487c('0x61'),{'UserId':Number(_0x4e26fc[_0x487c('0x39')][_0x487c('0x5d')][_0x30546e]),'SquareProjectId':Number(_0x4e26fc[_0x487c('0x59')]['id'])});}}else{socket[_0x487c('0x60')](_0x487c('0x61'),{'UserId':Number(_0x4e26fc[_0x487c('0x39')][_0x487c('0x5d')]),'SquareProjectId':Number(_0x4e26fc[_0x487c('0x59')]['id'])});}});}})[_0x487c('0x2e')](respondWithStatusCode(_0x191ccb,null))[_0x487c('0x4c')](handleError(_0x191ccb,null));};exports['getUsers']=function(_0x47f746,_0x30ad00,_0x14626f){var _0x25150d={};var _0x441006={};var _0x53ddec;var _0x3f7783;return db[_0x487c('0x35')]['findOne']({'where':{'id':_0x47f746[_0x487c('0x59')]['id']}})[_0x487c('0x2e')](handleEntityNotFound(_0x30ad00,null))[_0x487c('0x2e')](function(_0x359e95){if(_0x359e95){_0x53ddec=_0x359e95;_0x441006[_0x487c('0x38')]=_[_0x487c('0x3a')](db[_0x487c('0x62')][_0x487c('0x36')]);_0x441006[_0x487c('0x39')]=_[_0x487c('0x3a')](_0x47f746['query']);_0x441006['filters']=_[_0x487c('0x3c')](_0x441006['model'],_0x441006[_0x487c('0x39')]);_0x25150d['attributes']=_[_0x487c('0x3c')](_0x441006[_0x487c('0x38')],qs[_0x487c('0x63')](_0x47f746[_0x487c('0x39')][_0x487c('0x63')]));_0x25150d[_0x487c('0x3b')]=_0x25150d[_0x487c('0x3b')][_0x487c('0x3d')]?_0x25150d[_0x487c('0x3b')]:_0x441006[_0x487c('0x38')];_0x25150d[_0x487c('0x40')]=qs['sort'](_0x47f746[_0x487c('0x39')]['sort']);_0x25150d[_0x487c('0x42')]=qs['filters'](_['pick'](_0x47f746['query'],_0x441006['filters']));if(_0x47f746[_0x487c('0x39')]['filter']){_0x25150d[_0x487c('0x42')]=_[_0x487c('0x46')](_0x25150d[_0x487c('0x42')],{'$or':_[_0x487c('0x34')](_0x25150d[_0x487c('0x3b')],function(_0x38294e){var _0x49e382={};_0x49e382[_0x38294e]={'$like':'%'+_0x47f746[_0x487c('0x39')][_0x487c('0x45')]+'%'};return _0x49e382;})});}_0x25150d=_[_0x487c('0x46')]({},_0x25150d,_0x47f746[_0x487c('0x49')]);return _0x53ddec[_0x487c('0x64')](_0x25150d);}})[_0x487c('0x2e')](function(_0x4d8854){if(_0x4d8854){_0x3f7783=_0x4d8854[_0x487c('0x3d')];if(!_0x47f746[_0x487c('0x39')]['hasOwnProperty'](_0x487c('0x3f'))){_0x25150d[_0x487c('0x26')]=qs[_0x487c('0x26')](_0x47f746['query'][_0x487c('0x26')]);_0x25150d['offset']=qs[_0x487c('0x24')](_0x47f746['query'][_0x487c('0x24')]);}return _0x53ddec['getUsers'](_0x25150d);}})[_0x487c('0x2e')](function(_0x5d50e2){if(_0x5d50e2){return _0x5d50e2?{'count':_0x3f7783,'rows':_0x5d50e2}:null;}})[_0x487c('0x2e')](respondWithResult(_0x30ad00,null))['catch'](handleError(_0x30ad00,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index b606a00..a7a81fa 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 _0x17a7=['hook','exports','events','SquareProject','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x4e8f37,_0x4dba9a){var _0x4d7461=function(_0x9f26ff){while(--_0x9f26ff){_0x4e8f37['push'](_0x4e8f37['shift']());}};_0x4d7461(++_0x4dba9a);}(_0x17a7,0x1cd));var _0x717a=function(_0x567355,_0x3700e9){_0x567355=_0x567355-0x0;var _0x2c385c=_0x17a7[_0x567355];return _0x2c385c;};'use strict';var EventEmitter=require(_0x717a('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x717a('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x717a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x717a('0x3'),'afterDestroy':_0x717a('0x4')};function emitEvent(_0x2bb9a9){return function(_0x2c348b,_0xc16e04,_0x55cf4c){SquareProjectEvents[_0x717a('0x5')](_0x2bb9a9+':'+_0x2c348b['id'],_0x2c348b);SquareProjectEvents['emit'](_0x2bb9a9,_0x2c348b);_0x55cf4c(null);};}for(var e in events){if(events[_0x717a('0x6')](e)){var event=events[e];SquareProject[_0x717a('0x7')](e,emitEvent(event));}}module[_0x717a('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x9fc4=['../../mysqldb','SquareProject','save','update','emit','hasOwnProperty','exports','events'];(function(_0x3295c0,_0x297363){var _0x344793=function(_0x4ebe47){while(--_0x4ebe47){_0x3295c0['push'](_0x3295c0['shift']());}};_0x344793(++_0x297363);}(_0x9fc4,0x117));var _0x49fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9fc4[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x49fc('0x0'));var SquareProject=require(_0x49fc('0x1'))['db'][_0x49fc('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x49fc('0x3'),'afterUpdate':_0x49fc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5496be){return function(_0x18c55b,_0x35df52,_0x51365d){SquareProjectEvents[_0x49fc('0x5')](_0x5496be+':'+_0x18c55b['id'],_0x18c55b);SquareProjectEvents[_0x49fc('0x5')](_0x5496be,_0x18c55b);_0x51365d(null);};}for(var e in events){if(events[_0x49fc('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x49fc('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index f12d91c..6322511 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 _0x728c=['publishedAt','lodash','util','moment','bluebird','path','../../config/environment','./squareProject.attributes','define','SquareProject','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed'];(function(_0x1f85ac,_0x599259){var _0x5dc668=function(_0x5a803a){while(--_0x5a803a){_0x1f85ac['push'](_0x1f85ac['shift']());}};_0x5dc668(++_0x599259);}(_0x728c,0x196));var _0xc728=function(_0x3b89f1,_0x1eadf5){_0x3b89f1=_0x3b89f1-0x0;var _0x46b880=_0x728c[_0x3b89f1];return _0x46b880;};'use strict';var _=require(_0xc728('0x0'));var util=require(_0xc728('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc728('0x2'));var BPromise=require(_0xc728('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc728('0x4'));var rimraf=require('rimraf');var config=require(_0xc728('0x5'));var attributes=require(_0xc728('0x6'));module['exports']=function(_0x4f4a4b,_0x2c60af){return _0x4f4a4b[_0xc728('0x7')](_0xc728('0x8'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d947f,_0x39afec,_0x39faaa){if(_0x2d947f['changed'](_0xc728('0x9'))){_0x2d947f[_0xc728('0xa')]=moment()[_0xc728('0xb')](_0xc728('0xc'));}if(_0x2d947f[_0xc728('0xd')]('production')){_0x2d947f[_0xc728('0xe')]=moment()[_0xc728('0xb')](_0xc728('0xc'));}_0x39faaa(null,_0x2d947f);}}});}; \ No newline at end of file +var _0x5ec8=['production','publishedAt','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4adfa4,_0x121c5a){var _0x14cec1=function(_0x4fd975){while(--_0x4fd975){_0x4adfa4['push'](_0x4adfa4['shift']());}};_0x14cec1(++_0x121c5a);}(_0x5ec8,0x134));var _0x85ec=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0x5ec8[_0x18f152];return _0xa10b34;};'use strict';var _=require(_0x85ec('0x0'));var util=require(_0x85ec('0x1'));var logger=require(_0x85ec('0x2'))('api');var moment=require('moment');var BPromise=require(_0x85ec('0x3'));var rp=require(_0x85ec('0x4'));var fs=require('fs');var path=require(_0x85ec('0x5'));var rimraf=require(_0x85ec('0x6'));var config=require(_0x85ec('0x7'));var attributes=require(_0x85ec('0x8'));module[_0x85ec('0x9')]=function(_0x559f93,_0x3b98a1){return _0x559f93['define'](_0x85ec('0xa'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x41a7b4,_0x1f8d0b,_0x62bd0a){if(_0x41a7b4[_0x85ec('0xb')](_0x85ec('0xc'))){_0x41a7b4['savedAt']=moment()[_0x85ec('0xd')](_0x85ec('0xe'));}if(_0x41a7b4[_0x85ec('0xb')](_0x85ec('0xf'))){_0x41a7b4[_0x85ec('0x10')]=moment()[_0x85ec('0xd')](_0x85ec('0xe'));}_0x62bd0a(null,_0x41a7b4);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 3c143f4..3a60b3b 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 _0x21ff=['localhost','socket.io-emitter','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x21ff,0x8c));var _0xf21f=function(_0x5d31f3,_0x4239b0){_0x5d31f3=_0x5d31f3-0x0;var _0x1cc88c=_0x21ff[_0x5d31f3];return _0x1cc88c;};'use strict';var _=require(_0xf21f('0x0'));var util=require(_0xf21f('0x1'));var moment=require(_0xf21f('0x2'));var BPromise=require(_0xf21f('0x3'));var rs=require(_0xf21f('0x4'));var fs=require('fs');var Redis=require(_0xf21f('0x5'));var db=require(_0xf21f('0x6'))['db'];var utils=require(_0xf21f('0x7'));var logger=require(_0xf21f('0x8'))(_0xf21f('0x9'));var config=require(_0xf21f('0xa'));var jayson=require(_0xf21f('0xb'));var client=jayson[_0xf21f('0xc')][_0xf21f('0xd')]({'port':0x232a});config['redis']=_[_0xf21f('0xe')](config[_0xf21f('0xf')],{'host':_0xf21f('0x10'),'port':0x18eb});var socket=require(_0xf21f('0x11'))(new Redis(config[_0xf21f('0xf')]));require('./squareProject.socket')['register'](socket);function respondWithRpcPromise(_0x3b6a5b,_0x5d25b4,_0x773752){return new BPromise(function(_0x54f86c,_0x4f4c5d){return client[_0xf21f('0x12')](_0x3b6a5b,_0x773752)['then'](function(_0x384466){logger[_0xf21f('0x13')](_0xf21f('0x14'),_0x5d25b4,_0xf21f('0x15'));logger[_0xf21f('0x16')](_0xf21f('0x17'),_0x5d25b4,_0xf21f('0x15'),JSON[_0xf21f('0x18')](_0x384466));if(_0x384466['error']){if(_0x384466[_0xf21f('0x19')][_0xf21f('0x1a')]===0x1f4){logger[_0xf21f('0x19')]('SquareProject,\x20%s,\x20%s',_0x5d25b4,_0x384466[_0xf21f('0x19')][_0xf21f('0x1b')]);return _0x4f4c5d(_0x384466['error'][_0xf21f('0x1b')]);}logger[_0xf21f('0x19')](_0xf21f('0x14'),_0x5d25b4,_0x384466['error'][_0xf21f('0x1b')]);return _0x54f86c(_0x384466[_0xf21f('0x19')][_0xf21f('0x1b')]);}else{logger[_0xf21f('0x13')](_0xf21f('0x14'),_0x5d25b4,_0xf21f('0x15'));_0x54f86c(_0x384466['result'][_0xf21f('0x1b')]);}})['catch'](function(_0x20fc34){logger[_0xf21f('0x19')]('SquareProject,\x20%s,\x20%s',_0x5d25b4,_0x20fc34);_0x4f4c5d(_0x20fc34);});});}exports[_0xf21f('0x1c')]=function(_0x344102){var _0x257582=this;return new Promise(function(_0x28b3ac,_0x549623){return db[_0xf21f('0x1d')][_0xf21f('0x1e')]({'raw':_0x344102[_0xf21f('0x1f')]?_0x344102[_0xf21f('0x1f')][_0xf21f('0x20')]===undefined?!![]:![]:!![],'where':_0x344102['options']?_0x344102[_0xf21f('0x1f')][_0xf21f('0x21')]||null:null,'attributes':_0x344102['options']?_0x344102[_0xf21f('0x1f')][_0xf21f('0x22')]||null:null,'include':_0x344102[_0xf21f('0x1f')]?_0x344102[_0xf21f('0x1f')][_0xf21f('0x23')]?_[_0xf21f('0x24')](_0x344102[_0xf21f('0x1f')][_0xf21f('0x23')],function(_0x4378e3){return{'model':db[_0x4378e3[_0xf21f('0x25')]],'as':_0x4378e3['as'],'attributes':_0x4378e3['attributes'],'include':_0x4378e3[_0xf21f('0x23')]?_[_0xf21f('0x24')](_0x4378e3['include'],function(_0x1ab268){return{'model':db[_0x1ab268[_0xf21f('0x25')]],'as':_0x1ab268['as'],'attributes':_0x1ab268['attributes'],'include':_0x1ab268[_0xf21f('0x23')]?_['map'](_0x1ab268[_0xf21f('0x23')],function(_0x3f34f4){return{'model':db[_0x3f34f4[_0xf21f('0x25')]],'as':_0x3f34f4['as'],'attributes':_0x3f34f4[_0xf21f('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf21f('0x26')](function(_0x13eca0){logger[_0xf21f('0x13')](_0xf21f('0x1c'),_0x344102);logger[_0xf21f('0x16')](_0xf21f('0x1c'),_0x344102,JSON['stringify'](_0x13eca0));_0x28b3ac(_0x13eca0);})['catch'](function(_0x230aa3){logger[_0xf21f('0x19')](_0xf21f('0x1c'),_0x230aa3[_0xf21f('0x1b')],_0x344102);_0x549623(_0x257582[_0xf21f('0x19')](0x1f4,_0x230aa3[_0xf21f('0x1b')]));});});}; \ No newline at end of file +var _0x54cb=['map','model','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareProject','find','options','raw','where','attributes','include'];(function(_0xc420cf,_0x11dd68){var _0xac9f8a=function(_0x36fd7d){while(--_0x36fd7d){_0xc420cf['push'](_0xc420cf['shift']());}};_0xac9f8a(++_0x11dd68);}(_0x54cb,0x106));var _0xb54c=function(_0xf3e31a,_0x3b9ea3){_0xf3e31a=_0xf3e31a-0x0;var _0x18333a=_0x54cb[_0xf3e31a];return _0x18333a;};'use strict';var _=require('lodash');var util=require(_0xb54c('0x0'));var moment=require(_0xb54c('0x1'));var BPromise=require(_0xb54c('0x2'));var rs=require(_0xb54c('0x3'));var fs=require('fs');var Redis=require(_0xb54c('0x4'));var db=require(_0xb54c('0x5'))['db'];var utils=require(_0xb54c('0x6'));var logger=require(_0xb54c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb54c('0x8'));var client=jayson[_0xb54c('0x9')][_0xb54c('0xa')]({'port':0x232a});config[_0xb54c('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb54c('0xc'))(new Redis(config['redis']));require(_0xb54c('0xd'))[_0xb54c('0xe')](socket);function respondWithRpcPromise(_0x3e4a9f,_0xa4e00d,_0x289b90){return new BPromise(function(_0x41dde1,_0x4c593f){return client[_0xb54c('0xf')](_0x3e4a9f,_0x289b90)[_0xb54c('0x10')](function(_0x1447ec){logger[_0xb54c('0x11')](_0xb54c('0x12'),_0xa4e00d,_0xb54c('0x13'));logger[_0xb54c('0x14')](_0xb54c('0x15'),_0xa4e00d,_0xb54c('0x13'),JSON['stringify'](_0x1447ec));if(_0x1447ec['error']){if(_0x1447ec[_0xb54c('0x16')][_0xb54c('0x17')]===0x1f4){logger[_0xb54c('0x16')]('SquareProject,\x20%s,\x20%s',_0xa4e00d,_0x1447ec[_0xb54c('0x16')][_0xb54c('0x18')]);return _0x4c593f(_0x1447ec[_0xb54c('0x16')][_0xb54c('0x18')]);}logger['error'](_0xb54c('0x12'),_0xa4e00d,_0x1447ec[_0xb54c('0x16')][_0xb54c('0x18')]);return _0x41dde1(_0x1447ec[_0xb54c('0x16')][_0xb54c('0x18')]);}else{logger[_0xb54c('0x11')]('SquareProject,\x20%s,\x20%s',_0xa4e00d,'request\x20sent');_0x41dde1(_0x1447ec[_0xb54c('0x19')][_0xb54c('0x18')]);}})[_0xb54c('0x1a')](function(_0x33377a){logger[_0xb54c('0x16')](_0xb54c('0x12'),_0xa4e00d,_0x33377a);_0x4c593f(_0x33377a);});});}exports[_0xb54c('0x1b')]=function(_0x26d57d){var _0x4138cc=this;return new Promise(function(_0xfff9aa,_0x3a0deb){return db['SquareProject'][_0xb54c('0x1c')]({'raw':_0x26d57d[_0xb54c('0x1d')]?_0x26d57d[_0xb54c('0x1d')][_0xb54c('0x1e')]===undefined?!![]:![]:!![],'where':_0x26d57d[_0xb54c('0x1d')]?_0x26d57d['options'][_0xb54c('0x1f')]||null:null,'attributes':_0x26d57d['options']?_0x26d57d[_0xb54c('0x1d')][_0xb54c('0x20')]||null:null,'include':_0x26d57d['options']?_0x26d57d[_0xb54c('0x1d')][_0xb54c('0x21')]?_[_0xb54c('0x22')](_0x26d57d['options'][_0xb54c('0x21')],function(_0x596579){return{'model':db[_0x596579[_0xb54c('0x23')]],'as':_0x596579['as'],'attributes':_0x596579[_0xb54c('0x20')],'include':_0x596579[_0xb54c('0x21')]?_[_0xb54c('0x22')](_0x596579['include'],function(_0x2e8aa2){return{'model':db[_0x2e8aa2[_0xb54c('0x23')]],'as':_0x2e8aa2['as'],'attributes':_0x2e8aa2[_0xb54c('0x20')],'include':_0x2e8aa2['include']?_['map'](_0x2e8aa2[_0xb54c('0x21')],function(_0x1e4f48){return{'model':db[_0x1e4f48[_0xb54c('0x23')]],'as':_0x1e4f48['as'],'attributes':_0x1e4f48['attributes']};}):[]};}):[]};}):[]:[]})[_0xb54c('0x10')](function(_0x5f59aa){logger['info'](_0xb54c('0x1b'),_0x26d57d);logger[_0xb54c('0x14')](_0xb54c('0x1b'),_0x26d57d,JSON[_0xb54c('0x24')](_0x5f59aa));_0xfff9aa(_0x5f59aa);})[_0xb54c('0x1a')](function(_0x30f234){logger['error'](_0xb54c('0x1b'),_0x30f234[_0xb54c('0x18')],_0x26d57d);_0x3a0deb(_0x4138cc['error'](0x1f4,_0x30f234[_0xb54c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index c89f0f2..74d0f7a 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 _0xf44d=['register','length','squareProject:','./squareProject.events','save','update','emit','removeListener'];(function(_0x3b6668,_0x3b3c41){var _0x4e47e6=function(_0x4120d3){while(--_0x4120d3){_0x3b6668['push'](_0x3b6668['shift']());}};_0x4e47e6(++_0x3b3c41);}(_0xf44d,0xfb));var _0xdf44=function(_0x563266,_0x5ab285){_0x563266=_0x563266-0x0;var _0x18beb9=_0xf44d[_0x563266];return _0x18beb9;};'use strict';var SquareProjectEvents=require(_0xdf44('0x0'));var events=[_0xdf44('0x1'),'remove',_0xdf44('0x2')];function createListener(_0x336cad,_0x2e59d2){return function(_0x1f9bb9){_0x2e59d2[_0xdf44('0x3')](_0x336cad,_0x1f9bb9);};}function removeListener(_0x38d24f,_0x9d2beb){return function(){SquareProjectEvents[_0xdf44('0x4')](_0x38d24f,_0x9d2beb);};}exports[_0xdf44('0x5')]=function(_0x10b4fc){for(var _0x1e3514=0x0,_0x41c53d=events[_0xdf44('0x6')];_0x1e3514<_0x41c53d;_0x1e3514++){var _0x44b93e=events[_0x1e3514];var _0x50a7e0=createListener(_0xdf44('0x7')+_0x44b93e,_0x10b4fc);SquareProjectEvents['on'](_0x44b93e,_0x50a7e0);}}; \ No newline at end of file +var _0xfa15=['removeListener','register','./squareProject.events','remove','update'];(function(_0x3e69ae,_0x366e8d){var _0x3d7f42=function(_0x5df093){while(--_0x5df093){_0x3e69ae['push'](_0x3e69ae['shift']());}};_0x3d7f42(++_0x366e8d);}(_0xfa15,0x1b0));var _0x5fa1=function(_0x2b2970,_0x2c72c1){_0x2b2970=_0x2b2970-0x0;var _0x981e4f=_0xfa15[_0x2b2970];return _0x981e4f;};'use strict';var SquareProjectEvents=require(_0x5fa1('0x0'));var events=['save',_0x5fa1('0x1'),_0x5fa1('0x2')];function createListener(_0x28fd7f,_0x39e62a){return function(_0x59b1d2){_0x39e62a['emit'](_0x28fd7f,_0x59b1d2);};}function removeListener(_0x410dc6,_0x2816f8){return function(){SquareProjectEvents[_0x5fa1('0x3')](_0x410dc6,_0x2816f8);};}exports[_0x5fa1('0x4')]=function(_0x1b1551){for(var _0x246173=0x0,_0x4da435=events['length'];_0x246173<_0x4da435;_0x246173++){var _0x4b6cae=events[_0x246173];var _0x2b752c=createListener('squareProject:'+_0x4b6cae,_0x1b1551);SquareProjectEvents['on'](_0x4b6cae,_0x2b752c);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 4682f8b..bf50b94 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 _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x35be79,_0x396686){var _0x46d13e=function(_0x12a25f){while(--_0x12a25f){_0x35be79['push'](_0x35be79['shift']());}};_0x46d13e(++_0x396686);}(_0x5fab,0x177));var _0xb5fa=function(_0x3be82c,_0x3307d7){_0x3be82c=_0x3be82c-0x0;var _0x40d25a=_0x5fab[_0x3be82c];return _0x40d25a;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file +var _0xabce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','download','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x268c3e,_0x4089c4){var _0x15fcf0=function(_0x3797d5){while(--_0x3797d5){_0x268c3e['push'](_0x268c3e['shift']());}};_0x15fcf0(++_0x4089c4);}(_0xabce,0x103));var _0xeabc=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xabce[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./squareRecording.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id/download',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x12')]);module[_0xeabc('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index f2ba39d..3034b23 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 _0xee14=['VIRTUAL','getDataValue','savePath','substring','STRING'];(function(_0x26a544,_0xa16150){var _0x10e18c=function(_0x246bc6){while(--_0x246bc6){_0x26a544['push'](_0x26a544['shift']());}};_0x10e18c(++_0xa16150);}(_0xee14,0x13a));var _0x4ee1=function(_0x398ca4,_0x2ac3cc){_0x398ca4=_0x398ca4-0x0;var _0x19befd=_0xee14[_0x398ca4];return _0x19befd;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4ee1('0x0')]},'callerid':{'type':Sequelize[_0x4ee1('0x0')]},'calleridname':{'type':Sequelize[_0x4ee1('0x0')]},'context':{'type':Sequelize[_0x4ee1('0x0')]},'extension':{'type':Sequelize[_0x4ee1('0x0')]},'priority':{'type':Sequelize[_0x4ee1('0x0')]},'accountcode':{'type':Sequelize[_0x4ee1('0x0')]},'dnid':{'type':Sequelize[_0x4ee1('0x0')]},'projectName':{'type':Sequelize[_0x4ee1('0x0')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x4ee1('0x0')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x4ee1('0x1')],'get':function(){var _0x3a45a3='';var _0x187656=this[_0x4ee1('0x2')](_0x4ee1('0x3'));if(_0x187656){_0x3a45a3=_0x187656[_0x4ee1('0x4')](_0x187656['lastIndexOf']('.'));}return _0x3a45a3;}}}; \ No newline at end of file +var _0xac9d=['VIRTUAL','savePath','lastIndexOf','sequelize','exports','STRING'];(function(_0x12fe5b,_0xe3dd66){var _0x6d518f=function(_0x376460){while(--_0x376460){_0x12fe5b['push'](_0x12fe5b['shift']());}};_0x6d518f(++_0xe3dd66);}(_0xac9d,0x14d));var _0xdac9=function(_0x1fb6e2,_0x3a22ce){_0x1fb6e2=_0x1fb6e2-0x0;var _0x354690=_0xac9d[_0x1fb6e2];return _0x354690;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'uniqueid':{'type':Sequelize[_0xdac9('0x2')]},'callerid':{'type':Sequelize[_0xdac9('0x2')]},'calleridname':{'type':Sequelize[_0xdac9('0x2')]},'context':{'type':Sequelize[_0xdac9('0x2')]},'extension':{'type':Sequelize[_0xdac9('0x2')]},'priority':{'type':Sequelize[_0xdac9('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xdac9('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xdac9('0x2')]},'filename':{'type':Sequelize[_0xdac9('0x2')]},'savePath':{'type':Sequelize[_0xdac9('0x2')]},'format':{'type':Sequelize[_0xdac9('0x3')],'get':function(){var _0x1c78c5='';var _0x39f560=this['getDataValue'](_0xdac9('0x4'));if(_0x39f560){_0x1c78c5=_0x39f560['substring'](_0x39f560[_0xdac9('0x5')]('.'));}return _0x1c78c5;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index a0e68e8..873e663 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 _0x0554=['nolimit','order','sort','where','pick','merge','filter','include','findAll','catch','params','length','includeAll','options','find','create','body','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','recording','Sequelize','SquareRecording\x20not\x20found','extname','download','unlink','message','destroy','isNil','info','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','apply','save','update','then','stack','name','send','index','SquareRecording','rawAttributes','type','map','keys','query','filters','intersection','attributes','model','fields'];(function(_0x4a4e87,_0x485791){var _0x83444f=function(_0x2b666e){while(--_0x2b666e){_0x4a4e87['push'](_0x4a4e87['shift']());}};_0x83444f(++_0x485791);}(_0x0554,0x12c));var _0x4055=function(_0x39772f,_0x5605cb){_0x39772f=_0x39772f-0x0;var _0xc9edbf=_0x0554[_0x39772f];return _0xc9edbf;};'use strict';var emlformat=require(_0x4055('0x0'));var rimraf=require(_0x4055('0x1'));var zipdir=require(_0x4055('0x2'));var jsonpatch=require(_0x4055('0x3'));var rp=require('request-promise');var moment=require(_0x4055('0x4'));var BPromise=require(_0x4055('0x5'));var Mustache=require(_0x4055('0x6'));var util=require('util');var path=require(_0x4055('0x7'));var sox=require('sox');var csv=require(_0x4055('0x8'));var ejs=require(_0x4055('0x9'));var fs=require('fs');var fs_extra=require(_0x4055('0xa'));var _=require(_0x4055('0xb'));var squel=require(_0x4055('0xc'));var crypto=require(_0x4055('0xd'));var jsforce=require(_0x4055('0xe'));var deskjs=require(_0x4055('0xf'));var toCsv=require(_0x4055('0x8'));var querystring=require(_0x4055('0x10'));var Papa=require(_0x4055('0x11'));var Redis=require(_0x4055('0x12'));var authService=require(_0x4055('0x13'));var qs=require(_0x4055('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4055('0x15'));var utils=require(_0x4055('0x16'));var config=require(_0x4055('0x17'));var licenseUtil=require(_0x4055('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x392374,_0x4e730d){_0x4e730d=_0x4e730d||0xcc;return function(_0x17bbdc){if(_0x17bbdc){return _0x392374[_0x4055('0x19')](_0x4e730d);}return _0x392374[_0x4055('0x1a')](_0x4e730d)[_0x4055('0x1b')]();};}function respondWithResult(_0x14ac53,_0x2f5863){_0x2f5863=_0x2f5863||0xc8;return function(_0xb6d10c){if(_0xb6d10c){return _0x14ac53[_0x4055('0x1a')](_0x2f5863)[_0x4055('0x1c')](_0xb6d10c);}};}function respondWithFilteredResult(_0x184a1e,_0xa10466){return function(_0x8389b8){if(_0x8389b8){var _0x5d9c99=typeof _0xa10466['offset']==='undefined'&&typeof _0xa10466[_0x4055('0x1d')]===_0x4055('0x1e');var _0x173e90=_0x8389b8[_0x4055('0x1f')];var _0x37d0e6=_0x5d9c99?0x0:_0xa10466[_0x4055('0x20')];var _0xa37d50=_0x5d9c99?_0x8389b8[_0x4055('0x1f')]:_0xa10466[_0x4055('0x20')]+_0xa10466[_0x4055('0x1d')];var _0x4cbc21;if(_0xa37d50>=_0x173e90){_0xa37d50=_0x173e90;_0x4cbc21=0xc8;}else{_0x4cbc21=0xce;}_0x184a1e['status'](_0x4cbc21);return _0x184a1e['set']('Content-Range',_0x37d0e6+'-'+_0xa37d50+'/'+_0x173e90)[_0x4055('0x1c')](_0x8389b8);}return null;};}function patchUpdates(_0x1fe32d){return function(_0x30b556){try{jsonpatch[_0x4055('0x21')](_0x30b556,_0x1fe32d,!![]);}catch(_0x178032){return BPromise['reject'](_0x178032);}return _0x30b556[_0x4055('0x22')]();};}function saveUpdates(_0x31d7fd,_0x23474f){return function(_0x1c2dc1){if(_0x1c2dc1){return _0x1c2dc1[_0x4055('0x23')](_0x31d7fd)[_0x4055('0x24')](function(_0x20d177){return _0x20d177;});}return null;};}function removeEntity(_0x37bd0f,_0x560e4c){return function(_0x488ad2){if(_0x488ad2){return _0x488ad2['destroy']()[_0x4055('0x24')](function(){_0x37bd0f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c8b0b,_0x22f282){return function(_0x203713){if(!_0x203713){_0x2c8b0b[_0x4055('0x19')](0x194);}return _0x203713;};}function handleError(_0x3a29a9,_0x4fad91){_0x4fad91=_0x4fad91||0x1f4;return function(_0x33ed00){logger['error'](_0x33ed00[_0x4055('0x25')]);if(_0x33ed00[_0x4055('0x26')]){delete _0x33ed00[_0x4055('0x26')];}_0x3a29a9[_0x4055('0x1a')](_0x4fad91)[_0x4055('0x27')](_0x33ed00);};}exports[_0x4055('0x28')]=function(_0x56ef6a,_0x35f980){var _0x68466c={},_0xff0024={},_0x5d842c={'count':0x0,'rows':[]};var _0x4f161c=_['map'](db[_0x4055('0x29')][_0x4055('0x2a')],function(_0x4a686a){return{'name':_0x4a686a['fieldName'],'type':_0x4a686a[_0x4055('0x2b')]['key']};});_0xff0024['model']=_[_0x4055('0x2c')](_0x4f161c,_0x4055('0x26'));_0xff0024['query']=_[_0x4055('0x2d')](_0x56ef6a[_0x4055('0x2e')]);_0xff0024[_0x4055('0x2f')]=_[_0x4055('0x30')](_0xff0024['model'],_0xff0024[_0x4055('0x2e')]);_0x68466c[_0x4055('0x31')]=_[_0x4055('0x30')](_0xff0024[_0x4055('0x32')],qs[_0x4055('0x33')](_0x56ef6a[_0x4055('0x2e')]['fields']));_0x68466c[_0x4055('0x31')]=_0x68466c[_0x4055('0x31')]['length']?_0x68466c['attributes']:_0xff0024[_0x4055('0x32')];if(!_0x56ef6a['query']['hasOwnProperty'](_0x4055('0x34'))){_0x68466c[_0x4055('0x1d')]=qs[_0x4055('0x1d')](_0x56ef6a[_0x4055('0x2e')][_0x4055('0x1d')]);_0x68466c[_0x4055('0x20')]=qs[_0x4055('0x20')](_0x56ef6a[_0x4055('0x2e')]['offset']);}_0x68466c[_0x4055('0x35')]=qs[_0x4055('0x36')](_0x56ef6a[_0x4055('0x2e')][_0x4055('0x36')]);_0x68466c[_0x4055('0x37')]=qs[_0x4055('0x2f')](_[_0x4055('0x38')](_0x56ef6a[_0x4055('0x2e')],_0xff0024[_0x4055('0x2f')]),_0x4f161c);if(_0x56ef6a[_0x4055('0x2e')]['filter']){_0x68466c[_0x4055('0x37')]=_[_0x4055('0x39')](_0x68466c['where'],{'$or':_[_0x4055('0x2c')](_0x4f161c,function(_0x514035){if(_0x514035['type']!=='VIRTUAL'){var _0x1d0645={};_0x1d0645[_0x514035[_0x4055('0x26')]]={'$like':'%'+_0x56ef6a[_0x4055('0x2e')][_0x4055('0x3a')]+'%'};return _0x1d0645;}})});}_0x68466c=_['merge']({},_0x68466c,_0x56ef6a['options']);var _0x79faa2={'where':_0x68466c[_0x4055('0x37')]};return db[_0x4055('0x29')][_0x4055('0x1f')](_0x79faa2)['then'](function(_0xf2f015){_0x5d842c['count']=_0xf2f015;if(_0x56ef6a[_0x4055('0x2e')]['includeAll']){_0x68466c[_0x4055('0x3b')]=[{'all':!![]}];}return db[_0x4055('0x29')][_0x4055('0x3c')](_0x68466c);})['then'](function(_0x4ae949){_0x5d842c['rows']=_0x4ae949;return _0x5d842c;})[_0x4055('0x24')](respondWithFilteredResult(_0x35f980,_0x68466c))[_0x4055('0x3d')](handleError(_0x35f980,null));};exports['show']=function(_0xd7bbb5,_0x195e19){var _0x5dd3d6={'raw':!![],'where':{'id':_0xd7bbb5[_0x4055('0x3e')]['id']}},_0x41e688={};_0x41e688[_0x4055('0x32')]=_['keys'](db[_0x4055('0x29')][_0x4055('0x2a')]);_0x41e688[_0x4055('0x2e')]=_[_0x4055('0x2d')](_0xd7bbb5['query']);_0x41e688[_0x4055('0x2f')]=_[_0x4055('0x30')](_0x41e688[_0x4055('0x32')],_0x41e688[_0x4055('0x2e')]);_0x5dd3d6[_0x4055('0x31')]=_[_0x4055('0x30')](_0x41e688[_0x4055('0x32')],qs[_0x4055('0x33')](_0xd7bbb5['query'][_0x4055('0x33')]));_0x5dd3d6[_0x4055('0x31')]=_0x5dd3d6[_0x4055('0x31')][_0x4055('0x3f')]?_0x5dd3d6[_0x4055('0x31')]:_0x41e688['model'];if(_0xd7bbb5[_0x4055('0x2e')][_0x4055('0x40')]){_0x5dd3d6[_0x4055('0x3b')]=[{'all':!![]}];}_0x5dd3d6=_[_0x4055('0x39')]({},_0x5dd3d6,_0xd7bbb5[_0x4055('0x41')]);return db[_0x4055('0x29')][_0x4055('0x42')](_0x5dd3d6)['then'](handleEntityNotFound(_0x195e19,null))[_0x4055('0x24')](respondWithResult(_0x195e19,null))[_0x4055('0x3d')](handleError(_0x195e19,null));};exports[_0x4055('0x43')]=function(_0x6797aa,_0x2f75bd){return db[_0x4055('0x29')][_0x4055('0x43')](_0x6797aa['body'],{})[_0x4055('0x24')](respondWithResult(_0x2f75bd,0xc9))[_0x4055('0x3d')](handleError(_0x2f75bd,null));};exports[_0x4055('0x23')]=function(_0x2eb526,_0x5e75b6){if(_0x2eb526[_0x4055('0x44')]['id']){delete _0x2eb526[_0x4055('0x44')]['id'];}return db[_0x4055('0x29')]['find']({'where':{'id':_0x2eb526['params']['id']}})['then'](handleEntityNotFound(_0x5e75b6,null))[_0x4055('0x24')](saveUpdates(_0x2eb526[_0x4055('0x44')],null))[_0x4055('0x24')](respondWithResult(_0x5e75b6,null))[_0x4055('0x3d')](handleError(_0x5e75b6,null));};exports['download']=function(_0x5fcbb,_0x3607c7,_0x19abf1){var _0x3e691a=require(_0x4055('0x45'));var _0x17884e=![];var _0x5ba283={};if(_0x5fcbb[_0x4055('0x2e')]['type']&&_0x5fcbb[_0x4055('0x2e')][_0x4055('0x2b')]===_0x4055('0x46')){_0x5ba283['uniqueid']=_0x5fcbb[_0x4055('0x3e')]['id'];}else{_0x5ba283['id']=_0x5fcbb['params']['id'];}return db[_0x4055('0x29')]['find']({'where':_0x5ba283,'attributes':['id',_0x4055('0x47'),_0x4055('0x48')],'raw':!![]})[_0x4055('0x24')](handleEntityNotFound(_0x3607c7,null))['then'](function(_0x1fe31e){if(_0x1fe31e){var _0x66902b=_0x1fe31e[_0x4055('0x47')];var _0x5f3c65=util[_0x4055('0x49')]('%s.cypher',_0x66902b);if(fs[_0x4055('0x4a')](_0x5f3c65)){_0x17884e=!![];return _0x3e691a['decryptFile'](_0x5f3c65,_0x66902b,config['secrets'][_0x4055('0x4b')])[_0x4055('0x24')](function(){return _0x1fe31e;});}return _0x1fe31e;}})[_0x4055('0x24')](function(_0x28f90a){if(_0x28f90a){var _0x2b661e=_0x28f90a['savePath'];if(!fs[_0x4055('0x4a')](_0x2b661e)){throw new db[(_0x4055('0x4c'))]['ValidationError'](_0x4055('0x4d'));}if(_0x28f90a[_0x4055('0x48')]){return _0x3607c7['download'](_0x2b661e,_0x28f90a[_0x4055('0x48')]+path[_0x4055('0x4e')](_0x2b661e),function(){if(_0x17884e){fs['unlink'](_0x2b661e);}});}else{return _0x3607c7[_0x4055('0x4f')](_0x2b661e,function(_0x3eb1ca){if(_0x17884e){fs[_0x4055('0x50')](_0x2b661e);}});}}})['catch'](function(_0x1375a1){if(_0x1375a1[_0x4055('0x51')]==='SquareRecording\x20not\x20found'){_0x3607c7['status'](0x194)[_0x4055('0x27')]('Not\x20found');}else{return handleError(_0x3607c7,null);}});};exports[_0x4055('0x52')]=function(_0x34fc75,_0x1ed173){return db[_0x4055('0x29')][_0x4055('0x42')]({'where':{'id':_0x34fc75[_0x4055('0x3e')]['id']}})[_0x4055('0x24')](function(_0x498dbb){if(_[_0x4055('0x53')](_0x498dbb)){throw new ReferenceError('Entity\x20not\x20found');}return _0x498dbb;})[_0x4055('0x24')](function(_0x3c81a8){var _0x819fc4=_0x3c81a8[_0x4055('0x47')];logger[_0x4055('0x54')]('cancellazione\x20fisica\x20documento\x20%s',_0x819fc4);if(!_[_0x4055('0x53')](_0x3c81a8['savePath'])&&fs['existsSync'](_0x819fc4)){logger['info'](_0x4055('0x55')+_0x819fc4+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x4055('0x56')](_0x819fc4);}_0x819fc4=_0x819fc4+'.cypher';if(!_['isNil'](_0x3c81a8[_0x4055('0x47')])&&fs[_0x4055('0x4a')](_0x819fc4)){logger[_0x4055('0x54')]('File:\x20\x22'+_0x819fc4+_0x4055('0x57'));fs[_0x4055('0x56')](_0x819fc4);}return _0x3c81a8;})['then'](function(_0x4343a1){if(!_0x4343a1)throw new InternalError();return _0x4343a1[_0x4055('0x52')]();})[_0x4055('0x24')](function(){_0x1ed173[_0x4055('0x1a')](0xcc)[_0x4055('0x1b')]();})[_0x4055('0x3d')](handleError(_0x1ed173,null));}; \ No newline at end of file +var _0xa0db=['SquareRecording\x20not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','apply','update','then','error','stack','name','send','index','map','SquareRecording','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','length','find','create','body','uniqueid','savePath','filename','format','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','download','unlink','message'];(function(_0x8b0e2c,_0x4d0807){var _0x74c7bf=function(_0x8d4d0a){while(--_0x8d4d0a){_0x8b0e2c['push'](_0x8b0e2c['shift']());}};_0x74c7bf(++_0x4d0807);}(_0xa0db,0x179));var _0xba0d=function(_0x558c0d,_0x11c3e5){_0x558c0d=_0x558c0d-0x0;var _0x47a30c=_0xa0db[_0x558c0d];return _0x47a30c;};'use strict';var emlformat=require(_0xba0d('0x0'));var rimraf=require(_0xba0d('0x1'));var zipdir=require(_0xba0d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba0d('0x3'));var moment=require(_0xba0d('0x4'));var BPromise=require(_0xba0d('0x5'));var Mustache=require(_0xba0d('0x6'));var util=require('util');var path=require('path');var sox=require(_0xba0d('0x7'));var csv=require(_0xba0d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba0d('0x9'));var _=require(_0xba0d('0xa'));var squel=require(_0xba0d('0xb'));var crypto=require(_0xba0d('0xc'));var jsforce=require(_0xba0d('0xd'));var deskjs=require(_0xba0d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xba0d('0xf'));var Papa=require(_0xba0d('0x10'));var Redis=require(_0xba0d('0x11'));var authService=require(_0xba0d('0x12'));var qs=require(_0xba0d('0x13'));var as=require(_0xba0d('0x14'));var hardwareService=require(_0xba0d('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xba0d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xba0d('0x17'));var db=require(_0xba0d('0x18'))['db'];function respondWithStatusCode(_0xc3a776,_0x451f01){_0x451f01=_0x451f01||0xcc;return function(_0x27e264){if(_0x27e264){return _0xc3a776[_0xba0d('0x19')](_0x451f01);}return _0xc3a776[_0xba0d('0x1a')](_0x451f01)[_0xba0d('0x1b')]();};}function respondWithResult(_0x21243a,_0x347559){_0x347559=_0x347559||0xc8;return function(_0x3d67e1){if(_0x3d67e1){return _0x21243a[_0xba0d('0x1a')](_0x347559)['json'](_0x3d67e1);}};}function respondWithFilteredResult(_0x3bdce6,_0x5d6320){return function(_0x3d66a8){if(_0x3d66a8){var _0x262683=typeof _0x5d6320[_0xba0d('0x1c')]===_0xba0d('0x1d')&&typeof _0x5d6320['limit']===_0xba0d('0x1d');var _0x6c0016=_0x3d66a8[_0xba0d('0x1e')];var _0x5460c9=_0x262683?0x0:_0x5d6320['offset'];var _0x422873=_0x262683?_0x3d66a8['count']:_0x5d6320[_0xba0d('0x1c')]+_0x5d6320['limit'];var _0x2214c2;if(_0x422873>=_0x6c0016){_0x422873=_0x6c0016;_0x2214c2=0xc8;}else{_0x2214c2=0xce;}_0x3bdce6[_0xba0d('0x1a')](_0x2214c2);return _0x3bdce6['set']('Content-Range',_0x5460c9+'-'+_0x422873+'/'+_0x6c0016)['json'](_0x3d66a8);}return null;};}function patchUpdates(_0x57d9e7){return function(_0x333a4d){try{jsonpatch[_0xba0d('0x1f')](_0x333a4d,_0x57d9e7,!![]);}catch(_0x3a4d3e){return BPromise['reject'](_0x3a4d3e);}return _0x333a4d['save']();};}function saveUpdates(_0x568329,_0x1be67c){return function(_0x34dce0){if(_0x34dce0){return _0x34dce0[_0xba0d('0x20')](_0x568329)[_0xba0d('0x21')](function(_0x3e593d){return _0x3e593d;});}return null;};}function removeEntity(_0x210bc9,_0x14c0e9){return function(_0x4d7357){if(_0x4d7357){return _0x4d7357['destroy']()[_0xba0d('0x21')](function(){_0x210bc9[_0xba0d('0x1a')](0xcc)[_0xba0d('0x1b')]();});}};}function handleEntityNotFound(_0x2ab9d9,_0x249d9f){return function(_0xbc8426){if(!_0xbc8426){_0x2ab9d9[_0xba0d('0x19')](0x194);}return _0xbc8426;};}function handleError(_0x403e97,_0x51e7ca){_0x51e7ca=_0x51e7ca||0x1f4;return function(_0x22e87b){logger[_0xba0d('0x22')](_0x22e87b[_0xba0d('0x23')]);if(_0x22e87b[_0xba0d('0x24')]){delete _0x22e87b[_0xba0d('0x24')];}_0x403e97[_0xba0d('0x1a')](_0x51e7ca)[_0xba0d('0x25')](_0x22e87b);};}exports[_0xba0d('0x26')]=function(_0x387036,_0x2e5d0a){var _0x2b95cb={},_0x259955={},_0x14834e={'count':0x0,'rows':[]};var _0x41fda2=_[_0xba0d('0x27')](db[_0xba0d('0x28')]['rawAttributes'],function(_0x4d25f7){return{'name':_0x4d25f7['fieldName'],'type':_0x4d25f7['type'][_0xba0d('0x29')]};});_0x259955[_0xba0d('0x2a')]=_[_0xba0d('0x27')](_0x41fda2,'name');_0x259955['query']=_[_0xba0d('0x2b')](_0x387036[_0xba0d('0x2c')]);_0x259955[_0xba0d('0x2d')]=_['intersection'](_0x259955[_0xba0d('0x2a')],_0x259955[_0xba0d('0x2c')]);_0x2b95cb['attributes']=_[_0xba0d('0x2e')](_0x259955[_0xba0d('0x2a')],qs['fields'](_0x387036['query'][_0xba0d('0x2f')]));_0x2b95cb['attributes']=_0x2b95cb[_0xba0d('0x30')]['length']?_0x2b95cb[_0xba0d('0x30')]:_0x259955[_0xba0d('0x2a')];if(!_0x387036[_0xba0d('0x2c')][_0xba0d('0x31')](_0xba0d('0x32'))){_0x2b95cb['limit']=qs[_0xba0d('0x33')](_0x387036[_0xba0d('0x2c')][_0xba0d('0x33')]);_0x2b95cb[_0xba0d('0x1c')]=qs['offset'](_0x387036[_0xba0d('0x2c')][_0xba0d('0x1c')]);}_0x2b95cb[_0xba0d('0x34')]=qs[_0xba0d('0x35')](_0x387036[_0xba0d('0x2c')][_0xba0d('0x35')]);_0x2b95cb[_0xba0d('0x36')]=qs[_0xba0d('0x2d')](_[_0xba0d('0x37')](_0x387036[_0xba0d('0x2c')],_0x259955[_0xba0d('0x2d')]),_0x41fda2);if(_0x387036[_0xba0d('0x2c')][_0xba0d('0x38')]){_0x2b95cb[_0xba0d('0x36')]=_[_0xba0d('0x39')](_0x2b95cb[_0xba0d('0x36')],{'$or':_[_0xba0d('0x27')](_0x41fda2,function(_0x158171){if(_0x158171[_0xba0d('0x3a')]!==_0xba0d('0x3b')){var _0x3f4584={};_0x3f4584[_0x158171[_0xba0d('0x24')]]={'$like':'%'+_0x387036['query'][_0xba0d('0x38')]+'%'};return _0x3f4584;}})});}_0x2b95cb=_[_0xba0d('0x39')]({},_0x2b95cb,_0x387036[_0xba0d('0x3c')]);var _0x517bf8={'where':_0x2b95cb[_0xba0d('0x36')]};return db[_0xba0d('0x28')][_0xba0d('0x1e')](_0x517bf8)[_0xba0d('0x21')](function(_0x5c2c9c){_0x14834e[_0xba0d('0x1e')]=_0x5c2c9c;if(_0x387036['query'][_0xba0d('0x3d')]){_0x2b95cb[_0xba0d('0x3e')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x2b95cb);})[_0xba0d('0x21')](function(_0x3b1e4f){_0x14834e[_0xba0d('0x3f')]=_0x3b1e4f;return _0x14834e;})['then'](respondWithFilteredResult(_0x2e5d0a,_0x2b95cb))[_0xba0d('0x40')](handleError(_0x2e5d0a,null));};exports['show']=function(_0x5a732d,_0x2cc387){var _0x45d4c5={'raw':!![],'where':{'id':_0x5a732d[_0xba0d('0x41')]['id']}},_0x3178cb={};_0x3178cb[_0xba0d('0x2a')]=_[_0xba0d('0x2b')](db[_0xba0d('0x28')]['rawAttributes']);_0x3178cb['query']=_['keys'](_0x5a732d[_0xba0d('0x2c')]);_0x3178cb[_0xba0d('0x2d')]=_[_0xba0d('0x2e')](_0x3178cb[_0xba0d('0x2a')],_0x3178cb['query']);_0x45d4c5[_0xba0d('0x30')]=_[_0xba0d('0x2e')](_0x3178cb[_0xba0d('0x2a')],qs[_0xba0d('0x2f')](_0x5a732d[_0xba0d('0x2c')][_0xba0d('0x2f')]));_0x45d4c5[_0xba0d('0x30')]=_0x45d4c5[_0xba0d('0x30')][_0xba0d('0x42')]?_0x45d4c5[_0xba0d('0x30')]:_0x3178cb[_0xba0d('0x2a')];if(_0x5a732d[_0xba0d('0x2c')][_0xba0d('0x3d')]){_0x45d4c5['include']=[{'all':!![]}];}_0x45d4c5=_[_0xba0d('0x39')]({},_0x45d4c5,_0x5a732d[_0xba0d('0x3c')]);return db['SquareRecording'][_0xba0d('0x43')](_0x45d4c5)[_0xba0d('0x21')](handleEntityNotFound(_0x2cc387,null))['then'](respondWithResult(_0x2cc387,null))[_0xba0d('0x40')](handleError(_0x2cc387,null));};exports[_0xba0d('0x44')]=function(_0x56033e,_0x247df7){return db['SquareRecording'][_0xba0d('0x44')](_0x56033e[_0xba0d('0x45')],{})['then'](respondWithResult(_0x247df7,0xc9))[_0xba0d('0x40')](handleError(_0x247df7,null));};exports[_0xba0d('0x20')]=function(_0x10f509,_0x4a94bf){if(_0x10f509['body']['id']){delete _0x10f509[_0xba0d('0x45')]['id'];}return db[_0xba0d('0x28')][_0xba0d('0x43')]({'where':{'id':_0x10f509['params']['id']}})[_0xba0d('0x21')](handleEntityNotFound(_0x4a94bf,null))[_0xba0d('0x21')](saveUpdates(_0x10f509[_0xba0d('0x45')],null))[_0xba0d('0x21')](respondWithResult(_0x4a94bf,null))[_0xba0d('0x40')](handleError(_0x4a94bf,null));};exports['download']=function(_0x26563d,_0x59e569,_0x44228c){var _0x4782ec=require('../../components/encryptor');var _0x2539a6=![];var _0x3a5557={};if(_0x26563d[_0xba0d('0x2c')][_0xba0d('0x3a')]&&_0x26563d[_0xba0d('0x2c')][_0xba0d('0x3a')]==='uniqueid'){_0x3a5557[_0xba0d('0x46')]=_0x26563d[_0xba0d('0x41')]['id'];}else{_0x3a5557['id']=_0x26563d['params']['id'];}return db[_0xba0d('0x28')][_0xba0d('0x43')]({'where':_0x3a5557,'attributes':['id',_0xba0d('0x47'),_0xba0d('0x48')],'raw':!![]})[_0xba0d('0x21')](handleEntityNotFound(_0x59e569,null))[_0xba0d('0x21')](function(_0x412981){if(_0x412981){var _0x305f41=_0x412981[_0xba0d('0x47')];var _0x483a75=util[_0xba0d('0x49')]('%s.cypher',_0x305f41);if(fs['existsSync'](_0x483a75)){_0x2539a6=!![];return _0x4782ec[_0xba0d('0x4a')](_0x483a75,_0x305f41,config[_0xba0d('0x4b')][_0xba0d('0x4c')])['then'](function(){return _0x412981;});}return _0x412981;}})[_0xba0d('0x21')](function(_0x4a5a6d){if(_0x4a5a6d){var _0x39cac2=_0x4a5a6d[_0xba0d('0x47')];if(!fs[_0xba0d('0x4d')](_0x39cac2)){throw new db[(_0xba0d('0x4e'))][(_0xba0d('0x4f'))]('SquareRecording\x20not\x20found');}if(_0x4a5a6d[_0xba0d('0x48')]){return _0x59e569[_0xba0d('0x50')](_0x39cac2,_0x4a5a6d[_0xba0d('0x48')]+path['extname'](_0x39cac2),function(){if(_0x2539a6){fs[_0xba0d('0x51')](_0x39cac2);}});}else{return _0x59e569[_0xba0d('0x50')](_0x39cac2,function(_0xbb08c5){if(_0x2539a6){fs[_0xba0d('0x51')](_0x39cac2);}});}}})[_0xba0d('0x40')](function(_0x244c27){if(_0x244c27[_0xba0d('0x52')]===_0xba0d('0x53')){_0x59e569['status'](0x194)[_0xba0d('0x25')]('Not\x20found');}else{return handleError(_0x59e569,null);}});};exports[_0xba0d('0x54')]=function(_0x145c1f,_0x2dd316){return db[_0xba0d('0x28')][_0xba0d('0x43')]({'where':{'id':_0x145c1f[_0xba0d('0x41')]['id']}})[_0xba0d('0x21')](function(_0x198722){if(_[_0xba0d('0x55')](_0x198722)){throw new ReferenceError('Entity\x20not\x20found');}return _0x198722;})[_0xba0d('0x21')](function(_0x43fbac){var _0x709cf=_0x43fbac[_0xba0d('0x47')];logger[_0xba0d('0x56')](_0xba0d('0x57'),_0x709cf);if(!_[_0xba0d('0x55')](_0x43fbac['savePath'])&&fs[_0xba0d('0x4d')](_0x709cf)){logger[_0xba0d('0x56')](_0xba0d('0x58')+_0x709cf+_0xba0d('0x59'));fs[_0xba0d('0x5a')](_0x709cf);}_0x709cf=_0x709cf+_0xba0d('0x5b');if(!_[_0xba0d('0x55')](_0x43fbac['savePath'])&&fs['existsSync'](_0x709cf)){logger[_0xba0d('0x56')](_0xba0d('0x58')+_0x709cf+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xba0d('0x5a')](_0x709cf);}return _0x43fbac;})[_0xba0d('0x21')](function(_0x2a4ec9){if(!_0x2a4ec9)throw new InternalError();return _0x2a4ec9[_0xba0d('0x54')]();})[_0xba0d('0x21')](function(){_0x2dd316[_0xba0d('0x1a')](0xcc)['end']();})[_0xba0d('0x40')](handleError(_0x2dd316,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 1647f15..20ef4ed 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 _0xa24d=['request-promise','rimraf','../../config/environment','./squareRecording.attributes','exports','define','square_recordings','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xbc005c,_0x5ce36b){var _0x498f2c=function(_0xf6d94e){while(--_0xf6d94e){_0xbc005c['push'](_0xbc005c['shift']());}};_0x498f2c(++_0x5ce36b);}(_0xa24d,0x1c1));var _0xda24=function(_0x502773,_0xe55d92){_0x502773=_0x502773-0x0;var _0x568f34=_0xa24d[_0x502773];return _0x568f34;};'use strict';var _=require(_0xda24('0x0'));var util=require(_0xda24('0x1'));var logger=require(_0xda24('0x2'))(_0xda24('0x3'));var moment=require(_0xda24('0x4'));var BPromise=require(_0xda24('0x5'));var rp=require(_0xda24('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xda24('0x7'));var config=require(_0xda24('0x8'));var attributes=require(_0xda24('0x9'));module[_0xda24('0xa')]=function(_0x561d74,_0x3557cb){return _0x561d74[_0xda24('0xb')]('SquareRecording',attributes,{'tableName':_0xda24('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7096=['exports','define','SquareRecording','square_recordings','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x7096,0x10c));var _0x6709=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x7096[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var logger=require('../../config/logger')(_0x6709('0x1'));var moment=require('moment');var BPromise=require(_0x6709('0x2'));var rp=require(_0x6709('0x3'));var fs=require('fs');var path=require(_0x6709('0x4'));var rimraf=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var attributes=require(_0x6709('0x7'));module[_0x6709('0x8')]=function(_0x9d630f,_0xa35832){return _0x9d630f[_0x6709('0x9')](_0x6709('0xa'),attributes,{'tableName':_0x6709('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 3a8349f..8e41f48 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 _0x044b=['then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareRecording','body','options','raw','CreateSquareRecording','lodash','util','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x216c2f,_0xaf2d0e){var _0x1b6b9a=function(_0x3871be){while(--_0x3871be){_0x216c2f['push'](_0x216c2f['shift']());}};_0x1b6b9a(++_0xaf2d0e);}(_0x044b,0x98));var _0xb044=function(_0x200427,_0x5119c3){_0x200427=_0x200427-0x0;var _0x88b56b=_0x044b[_0x200427];return _0x88b56b;};'use strict';var _=require(_0xb044('0x0'));var util=require(_0xb044('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb044('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb044('0x3'))(_0xb044('0x4'));var config=require(_0xb044('0x5'));var jayson=require(_0xb044('0x6'));var client=jayson[_0xb044('0x7')][_0xb044('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x912744,_0x5b6f26,_0x132089){return new BPromise(function(_0x14bfc0,_0x46a769){return client[_0xb044('0x9')](_0x912744,_0x132089)[_0xb044('0xa')](function(_0x27c07b){logger[_0xb044('0xb')](_0xb044('0xc'),_0x5b6f26,_0xb044('0xd'));logger[_0xb044('0xe')](_0xb044('0xf'),_0x5b6f26,_0xb044('0xd'),JSON[_0xb044('0x10')](_0x27c07b));if(_0x27c07b[_0xb044('0x11')]){if(_0x27c07b[_0xb044('0x11')][_0xb044('0x12')]===0x1f4){logger[_0xb044('0x11')]('SquareRecording,\x20%s,\x20%s',_0x5b6f26,_0x27c07b[_0xb044('0x11')][_0xb044('0x13')]);return _0x46a769(_0x27c07b['error'][_0xb044('0x13')]);}logger[_0xb044('0x11')](_0xb044('0xc'),_0x5b6f26,_0x27c07b[_0xb044('0x11')][_0xb044('0x13')]);return _0x14bfc0(_0x27c07b[_0xb044('0x11')]['message']);}else{logger['info'](_0xb044('0xc'),_0x5b6f26,_0xb044('0xd'));_0x14bfc0(_0x27c07b[_0xb044('0x14')][_0xb044('0x13')]);}})[_0xb044('0x15')](function(_0x1824ea){logger[_0xb044('0x11')]('SquareRecording,\x20%s,\x20%s',_0x5b6f26,_0x1824ea);_0x46a769(_0x1824ea);});});}exports['CreateSquareRecording']=function(_0x289a2e){var _0x5219c1=this;return new Promise(function(_0x34ece4,_0x7b1527){return db[_0xb044('0x16')]['create'](_0x289a2e[_0xb044('0x17')],{'raw':_0x289a2e[_0xb044('0x18')]?_0x289a2e[_0xb044('0x18')][_0xb044('0x19')]===undefined?!![]:![]:!![]})[_0xb044('0xa')](function(_0x4c812f){logger[_0xb044('0xb')](_0xb044('0x1a'),_0x289a2e);logger[_0xb044('0xe')](_0xb044('0x1a'),_0x289a2e,JSON['stringify'](_0x4c812f));_0x34ece4(_0x4c812f);})['catch'](function(_0x4117e9){logger[_0xb044('0x11')](_0xb044('0x1a'),_0x4117e9['message'],_0x289a2e);_0x7b1527(_0x5219c1[_0xb044('0x11')](0x1f4,_0x4117e9[_0xb044('0x13')]));});});}; \ No newline at end of file +var _0xf67c=['client','request','then','info','SquareRecording,\x20%s,\x20%s','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','options','debug','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x5c5fca,_0x3332b8){var _0x1721de=function(_0x2ec5a6){while(--_0x2ec5a6){_0x5c5fca['push'](_0x5c5fca['shift']());}};_0x1721de(++_0x3332b8);}(_0xf67c,0x19a));var _0xcf67=function(_0x3a2724,_0x16a61b){_0x3a2724=_0x3a2724-0x0;var _0x29caa3=_0xf67c[_0x3a2724];return _0x29caa3;};'use strict';var _=require(_0xcf67('0x0'));var util=require(_0xcf67('0x1'));var moment=require(_0xcf67('0x2'));var BPromise=require(_0xcf67('0x3'));var rs=require(_0xcf67('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf67('0x5'))['db'];var utils=require(_0xcf67('0x6'));var logger=require(_0xcf67('0x7'))('rpc');var config=require(_0xcf67('0x8'));var jayson=require(_0xcf67('0x9'));var client=jayson[_0xcf67('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30da8e,_0xbf6ddd,_0x1e3289){return new BPromise(function(_0x329a5c,_0x3c45cc){return client[_0xcf67('0xb')](_0x30da8e,_0x1e3289)[_0xcf67('0xc')](function(_0xdd395c){logger[_0xcf67('0xd')](_0xcf67('0xe'),_0xbf6ddd,'request\x20sent');logger['debug'](_0xcf67('0xf'),_0xbf6ddd,_0xcf67('0x10'),JSON['stringify'](_0xdd395c));if(_0xdd395c[_0xcf67('0x11')]){if(_0xdd395c['error'][_0xcf67('0x12')]===0x1f4){logger[_0xcf67('0x11')](_0xcf67('0xe'),_0xbf6ddd,_0xdd395c[_0xcf67('0x11')][_0xcf67('0x13')]);return _0x3c45cc(_0xdd395c[_0xcf67('0x11')][_0xcf67('0x13')]);}logger[_0xcf67('0x11')](_0xcf67('0xe'),_0xbf6ddd,_0xdd395c[_0xcf67('0x11')][_0xcf67('0x13')]);return _0x329a5c(_0xdd395c[_0xcf67('0x11')][_0xcf67('0x13')]);}else{logger[_0xcf67('0xd')](_0xcf67('0xe'),_0xbf6ddd,_0xcf67('0x10'));_0x329a5c(_0xdd395c[_0xcf67('0x14')][_0xcf67('0x13')]);}})[_0xcf67('0x15')](function(_0x5e06fa){logger[_0xcf67('0x11')]('SquareRecording,\x20%s,\x20%s',_0xbf6ddd,_0x5e06fa);_0x3c45cc(_0x5e06fa);});});}exports[_0xcf67('0x16')]=function(_0x5631be){var _0x531cb8=this;return new Promise(function(_0x4c80d8,_0x48d3a8){return db[_0xcf67('0x17')][_0xcf67('0x18')](_0x5631be['body'],{'raw':_0x5631be[_0xcf67('0x19')]?_0x5631be['options']['raw']===undefined?!![]:![]:!![]})[_0xcf67('0xc')](function(_0x332e4c){logger[_0xcf67('0xd')](_0xcf67('0x16'),_0x5631be);logger[_0xcf67('0x1a')](_0xcf67('0x16'),_0x5631be,JSON[_0xcf67('0x1b')](_0x332e4c));_0x4c80d8(_0x332e4c);})[_0xcf67('0x15')](function(_0x5d2af8){logger[_0xcf67('0x11')](_0xcf67('0x16'),_0x5d2af8[_0xcf67('0x13')],_0x5631be);_0x48d3a8(_0x531cb8['error'](0x1f4,_0x5d2af8[_0xcf67('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index c63c1c1..21c1399 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0xd76857,_0x137b6b){var _0x1fd9b1=function(_0xeb1dc4){while(--_0xeb1dc4){_0xd76857['push'](_0xd76857['shift']());}};_0x1fd9b1(++_0x137b6b);}(_0xe706,0xa3));var _0x6e70=function(_0x3509d8,_0x5074b5){_0x3509d8=_0x3509d8-0x0;var _0x4dcedb=_0xe706[_0x3509d8];return _0x4dcedb;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index f0fe68d..2373a57 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 _0xa261=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x13346d,_0xe88312){var _0x422ccd=function(_0x3e88df){while(--_0x3e88df){_0x13346d['push'](_0x13346d['shift']());}};_0x422ccd(++_0xe88312);}(_0xa261,0x94));var _0x1a26=function(_0x433e36,_0x37cb83){_0x433e36=_0x433e36-0x0;var _0x313278=_0xa261[_0x433e36];return _0x313278;};'use strict';var Sequelize=require(_0x1a26('0x0'));module[_0x1a26('0x1')]={'network':{'type':Sequelize[_0x1a26('0x2')]},'network_script':{'type':Sequelize[_0x1a26('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1a26('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1a26('0x2')]},'uniqueid':{'type':Sequelize[_0x1a26('0x2')]},'version':{'type':Sequelize[_0x1a26('0x2')]},'callerid':{'type':Sequelize[_0x1a26('0x2')]},'calleridname':{'type':Sequelize[_0x1a26('0x2')]},'callingpres':{'type':Sequelize[_0x1a26('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x1a26('0x2')]},'callingtns':{'type':Sequelize[_0x1a26('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x1a26('0x2')]},'context':{'type':Sequelize[_0x1a26('0x2')]},'extension':{'type':Sequelize[_0x1a26('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x1a26('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1a26('0x3')]},'leaveAt':{'type':Sequelize[_0x1a26('0x3')]},'bot':{'type':Sequelize[_0x1a26('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x9571=['STRING','DATE','sequelize','exports'];(function(_0x38aaaf,_0x815035){var _0x45104c=function(_0x410bdd){while(--_0x410bdd){_0x38aaaf['push'](_0x38aaaf['shift']());}};_0x45104c(++_0x815035);}(_0x9571,0x1c2));var _0x1957=function(_0x114356,_0x561b7a){_0x114356=_0x114356-0x0;var _0xd46fa7=_0x9571[_0x114356];return _0xd46fa7;};'use strict';var Sequelize=require(_0x1957('0x0'));module[_0x1957('0x1')]={'network':{'type':Sequelize[_0x1957('0x2')]},'network_script':{'type':Sequelize[_0x1957('0x2')]},'request':{'type':Sequelize[_0x1957('0x2')]},'channel':{'type':Sequelize[_0x1957('0x2')]},'language':{'type':Sequelize[_0x1957('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1957('0x2')]},'version':{'type':Sequelize[_0x1957('0x2')]},'callerid':{'type':Sequelize[_0x1957('0x2')]},'calleridname':{'type':Sequelize[_0x1957('0x2')]},'callingpres':{'type':Sequelize[_0x1957('0x2')]},'callingani2':{'type':Sequelize[_0x1957('0x2')]},'callington':{'type':Sequelize[_0x1957('0x2')]},'callingtns':{'type':Sequelize[_0x1957('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x1957('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x1957('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1957('0x3')]},'leaveAt':{'type':Sequelize[_0x1957('0x3')]},'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 7bdb152..c96eafd 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 _0xd456=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','json','apply','reject','save','update','destroy','end','error','stack','name','index','map','SquareReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','then','include','rows','catch','show','params','includeAll','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xd456,0x17a));var _0x6d45=function(_0xe16c35,_0x436938){_0xe16c35=_0xe16c35-0x0;var _0x1079f0=_0xd456[_0xe16c35];return _0x1079f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d45('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d45('0x1'));var rp=require(_0x6d45('0x2'));var moment=require(_0x6d45('0x3'));var BPromise=require(_0x6d45('0x4'));var Mustache=require(_0x6d45('0x5'));var util=require(_0x6d45('0x6'));var path=require(_0x6d45('0x7'));var sox=require(_0x6d45('0x8'));var csv=require('to-csv');var ejs=require(_0x6d45('0x9'));var fs=require('fs');var fs_extra=require(_0x6d45('0xa'));var _=require(_0x6d45('0xb'));var squel=require('squel');var crypto=require(_0x6d45('0xc'));var jsforce=require(_0x6d45('0xd'));var deskjs=require(_0x6d45('0xe'));var toCsv=require(_0x6d45('0xf'));var querystring=require(_0x6d45('0x10'));var Papa=require(_0x6d45('0x11'));var Redis=require(_0x6d45('0x12'));var authService=require(_0x6d45('0x13'));var qs=require(_0x6d45('0x14'));var as=require(_0x6d45('0x15'));var hardwareService=require(_0x6d45('0x16'));var logger=require(_0x6d45('0x17'))(_0x6d45('0x18'));var utils=require(_0x6d45('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x6d45('0x1a'));var db=require(_0x6d45('0x1b'))['db'];function respondWithStatusCode(_0x3717fe,_0xc28a58){_0xc28a58=_0xc28a58||0xcc;return function(_0x58c58a){if(_0x58c58a){return _0x3717fe[_0x6d45('0x1c')](_0xc28a58);}return _0x3717fe[_0x6d45('0x1d')](_0xc28a58)['end']();};}function respondWithResult(_0x2d6a2d,_0x1b0026){_0x1b0026=_0x1b0026||0xc8;return function(_0x4514cb){if(_0x4514cb){return _0x2d6a2d[_0x6d45('0x1d')](_0x1b0026)['json'](_0x4514cb);}};}function respondWithFilteredResult(_0xe60c3a,_0x151703){return function(_0x53ac21){if(_0x53ac21){var _0x280ef5=typeof _0x151703['offset']===_0x6d45('0x1e')&&typeof _0x151703[_0x6d45('0x1f')]===_0x6d45('0x1e');var _0x3ea3bd=_0x53ac21[_0x6d45('0x20')];var _0x25795a=_0x280ef5?0x0:_0x151703[_0x6d45('0x21')];var _0xb08905=_0x280ef5?_0x53ac21[_0x6d45('0x20')]:_0x151703['offset']+_0x151703[_0x6d45('0x1f')];var _0x4d9270;if(_0xb08905>=_0x3ea3bd){_0xb08905=_0x3ea3bd;_0x4d9270=0xc8;}else{_0x4d9270=0xce;}_0xe60c3a[_0x6d45('0x1d')](_0x4d9270);return _0xe60c3a[_0x6d45('0x22')]('Content-Range',_0x25795a+'-'+_0xb08905+'/'+_0x3ea3bd)[_0x6d45('0x23')](_0x53ac21);}return null;};}function patchUpdates(_0x6c8d25){return function(_0x382e4a){try{jsonpatch[_0x6d45('0x24')](_0x382e4a,_0x6c8d25,!![]);}catch(_0x3038b0){return BPromise[_0x6d45('0x25')](_0x3038b0);}return _0x382e4a[_0x6d45('0x26')]();};}function saveUpdates(_0x541da6,_0x457d06){return function(_0x32a692){if(_0x32a692){return _0x32a692[_0x6d45('0x27')](_0x541da6)['then'](function(_0x2f652d){return _0x2f652d;});}return null;};}function removeEntity(_0x2c339a,_0x467217){return function(_0x12151f){if(_0x12151f){return _0x12151f[_0x6d45('0x28')]()['then'](function(){_0x2c339a[_0x6d45('0x1d')](0xcc)[_0x6d45('0x29')]();});}};}function handleEntityNotFound(_0x461e69,_0x17e978){return function(_0xf9307d){if(!_0xf9307d){_0x461e69[_0x6d45('0x1c')](0x194);}return _0xf9307d;};}function handleError(_0x2eea9c,_0x1bed01){_0x1bed01=_0x1bed01||0x1f4;return function(_0x3567b8){logger[_0x6d45('0x2a')](_0x3567b8[_0x6d45('0x2b')]);if(_0x3567b8[_0x6d45('0x2c')]){delete _0x3567b8[_0x6d45('0x2c')];}_0x2eea9c[_0x6d45('0x1d')](_0x1bed01)['send'](_0x3567b8);};}exports[_0x6d45('0x2d')]=function(_0x31b21b,_0x3bc326){var _0x5c8bf2={},_0x3edcc0={},_0x1c9530={'count':0x0,'rows':[]};var _0xf458be=_[_0x6d45('0x2e')](db[_0x6d45('0x2f')]['rawAttributes'],function(_0x3bfe63){return{'name':_0x3bfe63[_0x6d45('0x30')],'type':_0x3bfe63['type'][_0x6d45('0x31')]};});_0x3edcc0[_0x6d45('0x32')]=_['map'](_0xf458be,_0x6d45('0x2c'));_0x3edcc0[_0x6d45('0x33')]=_[_0x6d45('0x34')](_0x31b21b[_0x6d45('0x33')]);_0x3edcc0[_0x6d45('0x35')]=_[_0x6d45('0x36')](_0x3edcc0[_0x6d45('0x32')],_0x3edcc0[_0x6d45('0x33')]);_0x5c8bf2[_0x6d45('0x37')]=_[_0x6d45('0x36')](_0x3edcc0[_0x6d45('0x32')],qs['fields'](_0x31b21b[_0x6d45('0x33')][_0x6d45('0x38')]));_0x5c8bf2[_0x6d45('0x37')]=_0x5c8bf2[_0x6d45('0x37')][_0x6d45('0x39')]?_0x5c8bf2[_0x6d45('0x37')]:_0x3edcc0[_0x6d45('0x32')];if(!_0x31b21b[_0x6d45('0x33')]['hasOwnProperty'](_0x6d45('0x3a'))){_0x5c8bf2[_0x6d45('0x1f')]=qs[_0x6d45('0x1f')](_0x31b21b['query'][_0x6d45('0x1f')]);_0x5c8bf2['offset']=qs['offset'](_0x31b21b['query'][_0x6d45('0x21')]);}_0x5c8bf2['order']=qs['sort'](_0x31b21b[_0x6d45('0x33')][_0x6d45('0x3b')]);_0x5c8bf2[_0x6d45('0x3c')]=qs[_0x6d45('0x35')](_[_0x6d45('0x3d')](_0x31b21b['query'],_0x3edcc0['filters']),_0xf458be);if(_0x31b21b['query'][_0x6d45('0x3e')]){_0x5c8bf2[_0x6d45('0x3c')]=_['merge'](_0x5c8bf2['where'],{'$or':_[_0x6d45('0x2e')](_0xf458be,function(_0x4b7c5e){if(_0x4b7c5e[_0x6d45('0x3f')]!==_0x6d45('0x40')){var _0x1c20e4={};_0x1c20e4[_0x4b7c5e[_0x6d45('0x2c')]]={'$like':'%'+_0x31b21b[_0x6d45('0x33')]['filter']+'%'};return _0x1c20e4;}})});}_0x5c8bf2=_[_0x6d45('0x41')]({},_0x5c8bf2,_0x31b21b[_0x6d45('0x42')]);var _0x568446={'where':_0x5c8bf2['where']};return db[_0x6d45('0x2f')][_0x6d45('0x20')](_0x568446)[_0x6d45('0x43')](function(_0x43c9de){_0x1c9530[_0x6d45('0x20')]=_0x43c9de;if(_0x31b21b[_0x6d45('0x33')]['includeAll']){_0x5c8bf2[_0x6d45('0x44')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x5c8bf2);})[_0x6d45('0x43')](function(_0x4b4f9a){_0x1c9530[_0x6d45('0x45')]=_0x4b4f9a;return _0x1c9530;})['then'](respondWithFilteredResult(_0x3bc326,_0x5c8bf2))[_0x6d45('0x46')](handleError(_0x3bc326,null));};exports[_0x6d45('0x47')]=function(_0x317dd7,_0x3f8a61){var _0x22c2b8={'raw':!![],'where':{'id':_0x317dd7[_0x6d45('0x48')]['id']}},_0x12d94c={};_0x12d94c[_0x6d45('0x32')]=_[_0x6d45('0x34')](db['SquareReport']['rawAttributes']);_0x12d94c[_0x6d45('0x33')]=_[_0x6d45('0x34')](_0x317dd7[_0x6d45('0x33')]);_0x12d94c['filters']=_[_0x6d45('0x36')](_0x12d94c['model'],_0x12d94c[_0x6d45('0x33')]);_0x22c2b8[_0x6d45('0x37')]=_[_0x6d45('0x36')](_0x12d94c[_0x6d45('0x32')],qs[_0x6d45('0x38')](_0x317dd7['query']['fields']));_0x22c2b8['attributes']=_0x22c2b8[_0x6d45('0x37')]['length']?_0x22c2b8[_0x6d45('0x37')]:_0x12d94c[_0x6d45('0x32')];if(_0x317dd7['query'][_0x6d45('0x49')]){_0x22c2b8[_0x6d45('0x44')]=[{'all':!![]}];}_0x22c2b8=_['merge']({},_0x22c2b8,_0x317dd7[_0x6d45('0x42')]);return db[_0x6d45('0x2f')][_0x6d45('0x4a')](_0x22c2b8)[_0x6d45('0x43')](handleEntityNotFound(_0x3f8a61,null))[_0x6d45('0x43')](respondWithResult(_0x3f8a61,null))[_0x6d45('0x46')](handleError(_0x3f8a61,null));};exports[_0x6d45('0x4b')]=function(_0x4e93f9,_0x1281ab){return db[_0x6d45('0x2f')][_0x6d45('0x4b')](_0x4e93f9[_0x6d45('0x4c')],{})[_0x6d45('0x43')](respondWithResult(_0x1281ab,0xc9))[_0x6d45('0x46')](handleError(_0x1281ab,null));};exports[_0x6d45('0x27')]=function(_0x126cb7,_0x228773){if(_0x126cb7[_0x6d45('0x4c')]['id']){delete _0x126cb7['body']['id'];}return db[_0x6d45('0x2f')][_0x6d45('0x4a')]({'where':{'id':_0x126cb7[_0x6d45('0x48')]['id']}})[_0x6d45('0x43')](handleEntityNotFound(_0x228773,null))[_0x6d45('0x43')](saveUpdates(_0x126cb7['body'],null))[_0x6d45('0x43')](respondWithResult(_0x228773,null))[_0x6d45('0x46')](handleError(_0x228773,null));};exports[_0x6d45('0x28')]=function(_0x585293,_0x4b4c62){return db[_0x6d45('0x2f')][_0x6d45('0x4a')]({'where':{'id':_0x585293[_0x6d45('0x48')]['id']}})['then'](handleEntityNotFound(_0x4b4c62,null))[_0x6d45('0x43')](removeEntity(_0x4b4c62,null))[_0x6d45('0x46')](handleError(_0x4b4c62,null));};exports[_0x6d45('0x4d')]=function(_0x36a443,_0x2b0278){return db[_0x6d45('0x2f')][_0x6d45('0x4d')]()[_0x6d45('0x43')](respondWithResult(_0x2b0278,null))[_0x6d45('0x46')](handleError(_0x2b0278,null));}; \ No newline at end of file +var _0x8e75=['destroy','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','reject','save','then','error','stack','name','send','map','SquareReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','update'];(function(_0x18ac49,_0x9ce459){var _0x5ecaa2=function(_0x119301){while(--_0x119301){_0x18ac49['push'](_0x18ac49['shift']());}};_0x5ecaa2(++_0x9ce459);}(_0x8e75,0xe1));var _0x58e7=function(_0x486867,_0x52a530){_0x486867=_0x486867-0x0;var _0x3d3c99=_0x8e75[_0x486867];return _0x3d3c99;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x58e7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x58e7('0x1'));var rp=require(_0x58e7('0x2'));var moment=require(_0x58e7('0x3'));var BPromise=require(_0x58e7('0x4'));var Mustache=require(_0x58e7('0x5'));var util=require(_0x58e7('0x6'));var path=require('path');var sox=require(_0x58e7('0x7'));var csv=require(_0x58e7('0x8'));var ejs=require(_0x58e7('0x9'));var fs=require('fs');var fs_extra=require(_0x58e7('0xa'));var _=require(_0x58e7('0xb'));var squel=require(_0x58e7('0xc'));var crypto=require('crypto');var jsforce=require(_0x58e7('0xd'));var deskjs=require(_0x58e7('0xe'));var toCsv=require(_0x58e7('0x8'));var querystring=require(_0x58e7('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x58e7('0x10'));var qs=require(_0x58e7('0x11'));var as=require(_0x58e7('0x12'));var hardwareService=require(_0x58e7('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x58e7('0x14'));var config=require(_0x58e7('0x15'));var licenseUtil=require(_0x58e7('0x16'));var db=require(_0x58e7('0x17'))['db'];function respondWithStatusCode(_0x49b135,_0x51b5e3){_0x51b5e3=_0x51b5e3||0xcc;return function(_0x379dfd){if(_0x379dfd){return _0x49b135[_0x58e7('0x18')](_0x51b5e3);}return _0x49b135['status'](_0x51b5e3)[_0x58e7('0x19')]();};}function respondWithResult(_0x437c24,_0x378289){_0x378289=_0x378289||0xc8;return function(_0x35a23b){if(_0x35a23b){return _0x437c24['status'](_0x378289)[_0x58e7('0x1a')](_0x35a23b);}};}function respondWithFilteredResult(_0x4e7c40,_0x427285){return function(_0x187454){if(_0x187454){var _0x19b883=typeof _0x427285[_0x58e7('0x1b')]===_0x58e7('0x1c')&&typeof _0x427285[_0x58e7('0x1d')]==='undefined';var _0x5b00b8=_0x187454[_0x58e7('0x1e')];var _0x284105=_0x19b883?0x0:_0x427285['offset'];var _0x16576a=_0x19b883?_0x187454['count']:_0x427285[_0x58e7('0x1b')]+_0x427285['limit'];var _0x4a4f34;if(_0x16576a>=_0x5b00b8){_0x16576a=_0x5b00b8;_0x4a4f34=0xc8;}else{_0x4a4f34=0xce;}_0x4e7c40[_0x58e7('0x1f')](_0x4a4f34);return _0x4e7c40[_0x58e7('0x20')]('Content-Range',_0x284105+'-'+_0x16576a+'/'+_0x5b00b8)['json'](_0x187454);}return null;};}function patchUpdates(_0x1a292b){return function(_0x26fe3d){try{jsonpatch['apply'](_0x26fe3d,_0x1a292b,!![]);}catch(_0x16e9a7){return BPromise[_0x58e7('0x21')](_0x16e9a7);}return _0x26fe3d[_0x58e7('0x22')]();};}function saveUpdates(_0x51c6be,_0x8ac68b){return function(_0x7fdb7b){if(_0x7fdb7b){return _0x7fdb7b['update'](_0x51c6be)[_0x58e7('0x23')](function(_0x1de604){return _0x1de604;});}return null;};}function removeEntity(_0x43ad4c,_0x58d7b8){return function(_0x2b1510){if(_0x2b1510){return _0x2b1510['destroy']()[_0x58e7('0x23')](function(){_0x43ad4c[_0x58e7('0x1f')](0xcc)[_0x58e7('0x19')]();});}};}function handleEntityNotFound(_0x31685e,_0x12a14a){return function(_0x20be5f){if(!_0x20be5f){_0x31685e['sendStatus'](0x194);}return _0x20be5f;};}function handleError(_0x3f2e73,_0x1b75a6){_0x1b75a6=_0x1b75a6||0x1f4;return function(_0x3bd676){logger[_0x58e7('0x24')](_0x3bd676[_0x58e7('0x25')]);if(_0x3bd676[_0x58e7('0x26')]){delete _0x3bd676[_0x58e7('0x26')];}_0x3f2e73[_0x58e7('0x1f')](_0x1b75a6)[_0x58e7('0x27')](_0x3bd676);};}exports['index']=function(_0x12553a,_0x35bd54){var _0x471516={},_0x3d2fe9={},_0x15bfd2={'count':0x0,'rows':[]};var _0x1b1a70=_[_0x58e7('0x28')](db[_0x58e7('0x29')][_0x58e7('0x2a')],function(_0x36b3c3){return{'name':_0x36b3c3[_0x58e7('0x2b')],'type':_0x36b3c3['type'][_0x58e7('0x2c')]};});_0x3d2fe9[_0x58e7('0x2d')]=_[_0x58e7('0x28')](_0x1b1a70,_0x58e7('0x26'));_0x3d2fe9[_0x58e7('0x2e')]=_[_0x58e7('0x2f')](_0x12553a[_0x58e7('0x2e')]);_0x3d2fe9[_0x58e7('0x30')]=_[_0x58e7('0x31')](_0x3d2fe9[_0x58e7('0x2d')],_0x3d2fe9[_0x58e7('0x2e')]);_0x471516['attributes']=_[_0x58e7('0x31')](_0x3d2fe9[_0x58e7('0x2d')],qs['fields'](_0x12553a['query'][_0x58e7('0x32')]));_0x471516['attributes']=_0x471516[_0x58e7('0x33')][_0x58e7('0x34')]?_0x471516[_0x58e7('0x33')]:_0x3d2fe9['model'];if(!_0x12553a[_0x58e7('0x2e')]['hasOwnProperty'](_0x58e7('0x35'))){_0x471516['limit']=qs[_0x58e7('0x1d')](_0x12553a[_0x58e7('0x2e')][_0x58e7('0x1d')]);_0x471516['offset']=qs[_0x58e7('0x1b')](_0x12553a[_0x58e7('0x2e')]['offset']);}_0x471516['order']=qs[_0x58e7('0x36')](_0x12553a[_0x58e7('0x2e')]['sort']);_0x471516[_0x58e7('0x37')]=qs['filters'](_['pick'](_0x12553a[_0x58e7('0x2e')],_0x3d2fe9[_0x58e7('0x30')]),_0x1b1a70);if(_0x12553a[_0x58e7('0x2e')][_0x58e7('0x38')]){_0x471516[_0x58e7('0x37')]=_[_0x58e7('0x39')](_0x471516['where'],{'$or':_[_0x58e7('0x28')](_0x1b1a70,function(_0x3064a0){if(_0x3064a0[_0x58e7('0x3a')]!==_0x58e7('0x3b')){var _0x4fa05d={};_0x4fa05d[_0x3064a0[_0x58e7('0x26')]]={'$like':'%'+_0x12553a[_0x58e7('0x2e')]['filter']+'%'};return _0x4fa05d;}})});}_0x471516=_[_0x58e7('0x39')]({},_0x471516,_0x12553a[_0x58e7('0x3c')]);var _0x5d2394={'where':_0x471516[_0x58e7('0x37')]};return db[_0x58e7('0x29')][_0x58e7('0x1e')](_0x5d2394)[_0x58e7('0x23')](function(_0x48bfad){_0x15bfd2[_0x58e7('0x1e')]=_0x48bfad;if(_0x12553a[_0x58e7('0x2e')][_0x58e7('0x3d')]){_0x471516[_0x58e7('0x3e')]=[{'all':!![]}];}return db[_0x58e7('0x29')][_0x58e7('0x3f')](_0x471516);})[_0x58e7('0x23')](function(_0x21ef8a){_0x15bfd2[_0x58e7('0x40')]=_0x21ef8a;return _0x15bfd2;})[_0x58e7('0x23')](respondWithFilteredResult(_0x35bd54,_0x471516))[_0x58e7('0x41')](handleError(_0x35bd54,null));};exports[_0x58e7('0x42')]=function(_0x1530f8,_0x250a08){var _0x974a18={'raw':!![],'where':{'id':_0x1530f8['params']['id']}},_0x3a9d77={};_0x3a9d77[_0x58e7('0x2d')]=_[_0x58e7('0x2f')](db[_0x58e7('0x29')]['rawAttributes']);_0x3a9d77[_0x58e7('0x2e')]=_['keys'](_0x1530f8[_0x58e7('0x2e')]);_0x3a9d77[_0x58e7('0x30')]=_[_0x58e7('0x31')](_0x3a9d77['model'],_0x3a9d77[_0x58e7('0x2e')]);_0x974a18[_0x58e7('0x33')]=_[_0x58e7('0x31')](_0x3a9d77['model'],qs[_0x58e7('0x32')](_0x1530f8[_0x58e7('0x2e')][_0x58e7('0x32')]));_0x974a18[_0x58e7('0x33')]=_0x974a18[_0x58e7('0x33')][_0x58e7('0x34')]?_0x974a18[_0x58e7('0x33')]:_0x3a9d77['model'];if(_0x1530f8[_0x58e7('0x2e')][_0x58e7('0x3d')]){_0x974a18[_0x58e7('0x3e')]=[{'all':!![]}];}_0x974a18=_['merge']({},_0x974a18,_0x1530f8[_0x58e7('0x3c')]);return db[_0x58e7('0x29')][_0x58e7('0x43')](_0x974a18)['then'](handleEntityNotFound(_0x250a08,null))['then'](respondWithResult(_0x250a08,null))['catch'](handleError(_0x250a08,null));};exports[_0x58e7('0x44')]=function(_0x1d2ee3,_0x30b736){return db['SquareReport'][_0x58e7('0x44')](_0x1d2ee3[_0x58e7('0x45')],{})['then'](respondWithResult(_0x30b736,0xc9))[_0x58e7('0x41')](handleError(_0x30b736,null));};exports[_0x58e7('0x46')]=function(_0x2306bf,_0x26ae65){if(_0x2306bf[_0x58e7('0x45')]['id']){delete _0x2306bf[_0x58e7('0x45')]['id'];}return db[_0x58e7('0x29')][_0x58e7('0x43')]({'where':{'id':_0x2306bf['params']['id']}})[_0x58e7('0x23')](handleEntityNotFound(_0x26ae65,null))[_0x58e7('0x23')](saveUpdates(_0x2306bf[_0x58e7('0x45')],null))['then'](respondWithResult(_0x26ae65,null))['catch'](handleError(_0x26ae65,null));};exports[_0x58e7('0x47')]=function(_0x54d0c2,_0x1e3c0a){return db[_0x58e7('0x29')]['find']({'where':{'id':_0x54d0c2[_0x58e7('0x48')]['id']}})[_0x58e7('0x23')](handleEntityNotFound(_0x1e3c0a,null))[_0x58e7('0x23')](removeEntity(_0x1e3c0a,null))[_0x58e7('0x41')](handleError(_0x1e3c0a,null));};exports['describe']=function(_0x4f8257,_0x15f4bf){return db[_0x58e7('0x29')][_0x58e7('0x49')]()[_0x58e7('0x23')](respondWithResult(_0x15f4bf,null))[_0x58e7('0x41')](handleError(_0x15f4bf,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 87788da..ba8ecf5 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 _0x62ac=['leaveAt','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','project_name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x62ac,0x81));var _0xc62a=function(_0x518189,_0x280941){_0x518189=_0x518189-0x0;var _0x14f749=_0x62ac[_0x518189];return _0x14f749;};'use strict';var _=require(_0xc62a('0x0'));var util=require(_0xc62a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc62a('0x2'));var BPromise=require(_0xc62a('0x3'));var rp=require(_0xc62a('0x4'));var fs=require('fs');var path=require(_0xc62a('0x5'));var rimraf=require(_0xc62a('0x6'));var config=require(_0xc62a('0x7'));var attributes=require(_0xc62a('0x8'));module[_0xc62a('0x9')]=function(_0x55f1f6,_0x135181){return _0x55f1f6[_0xc62a('0xa')](_0xc62a('0xb'),attributes,{'tableName':_0xc62a('0xc'),'paranoid':![],'indexes':[{'name':_0xc62a('0xd'),'fields':['uniqueid',_0xc62a('0xe')]},{'name':_0xc62a('0xf'),'fields':[_0xc62a('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xea4c=['SquareReport','report_square','uid_pname','leaveAt','util','api','request-promise','../../config/environment','./squareReport.attributes','exports'];(function(_0x130d82,_0x25f49b){var _0x112070=function(_0x5795ee){while(--_0x5795ee){_0x130d82['push'](_0x130d82['shift']());}};_0x112070(++_0x25f49b);}(_0xea4c,0x1c6));var _0xcea4=function(_0x290946,_0x29a1f1){_0x290946=_0x290946-0x0;var _0x2c6568=_0xea4c[_0x290946];return _0x2c6568;};'use strict';var _=require('lodash');var util=require(_0xcea4('0x0'));var logger=require('../../config/logger')(_0xcea4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcea4('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcea4('0x3'));var attributes=require(_0xcea4('0x4'));module[_0xcea4('0x5')]=function(_0xbabd27,_0x18045a){return _0xbabd27['define'](_0xcea4('0x6'),attributes,{'tableName':_0xcea4('0x7'),'paranoid':![],'indexes':[{'name':_0xcea4('0x8'),'fields':['uniqueid','project_name']},{'name':_0xcea4('0x9'),'fields':[_0xcea4('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 604e0b6..ddaeb03 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 _0xf2ce=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','CreateSquareReport','SquareReport','update','attributes','limit','UpdateSquareReport','debug'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xf2ce,0x132));var _0xef2c=function(_0x20546,_0x23eddf){_0x20546=_0x20546-0x0;var _0x3d74a1=_0xf2ce[_0x20546];return _0x3d74a1;};'use strict';var _=require(_0xef2c('0x0'));var util=require(_0xef2c('0x1'));var moment=require('moment');var BPromise=require(_0xef2c('0x2'));var rs=require(_0xef2c('0x3'));var fs=require('fs');var Redis=require(_0xef2c('0x4'));var db=require(_0xef2c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xef2c('0x6'))(_0xef2c('0x7'));var config=require(_0xef2c('0x8'));var jayson=require(_0xef2c('0x9'));var client=jayson[_0xef2c('0xa')][_0xef2c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15feba,_0x42a9b9,_0x4a49e8){return new BPromise(function(_0x1dc296,_0x2dd029){return client['request'](_0x15feba,_0x4a49e8)[_0xef2c('0xc')](function(_0x185086){logger[_0xef2c('0xd')](_0xef2c('0xe'),_0x42a9b9,_0xef2c('0xf'));logger['debug'](_0xef2c('0x10'),_0x42a9b9,_0xef2c('0xf'),JSON[_0xef2c('0x11')](_0x185086));if(_0x185086[_0xef2c('0x12')]){if(_0x185086[_0xef2c('0x12')][_0xef2c('0x13')]===0x1f4){logger[_0xef2c('0x12')]('SquareReport,\x20%s,\x20%s',_0x42a9b9,_0x185086[_0xef2c('0x12')][_0xef2c('0x14')]);return _0x2dd029(_0x185086[_0xef2c('0x12')][_0xef2c('0x14')]);}logger['error'](_0xef2c('0xe'),_0x42a9b9,_0x185086[_0xef2c('0x12')][_0xef2c('0x14')]);return _0x1dc296(_0x185086[_0xef2c('0x12')][_0xef2c('0x14')]);}else{logger[_0xef2c('0xd')]('SquareReport,\x20%s,\x20%s',_0x42a9b9,'request\x20sent');_0x1dc296(_0x185086[_0xef2c('0x15')][_0xef2c('0x14')]);}})[_0xef2c('0x16')](function(_0x343e8f){logger[_0xef2c('0x12')](_0xef2c('0xe'),_0x42a9b9,_0x343e8f);_0x2dd029(_0x343e8f);});});}exports['CreateSquareReport']=function(_0x1bcffb){var _0x795625=this;return new Promise(function(_0x2d967c,_0x30b1f3){return db['SquareReport'][_0xef2c('0x17')](_0x1bcffb[_0xef2c('0x18')],{'raw':_0x1bcffb[_0xef2c('0x19')]?_0x1bcffb[_0xef2c('0x19')][_0xef2c('0x1a')]===undefined?!![]:![]:!![]})[_0xef2c('0xc')](function(_0x1c28b0){logger['info']('CreateSquareReport',_0x1bcffb);logger['debug'](_0xef2c('0x1b'),_0x1bcffb,JSON[_0xef2c('0x11')](_0x1c28b0));_0x2d967c(_0x1c28b0);})[_0xef2c('0x16')](function(_0x523379){logger[_0xef2c('0x12')]('CreateSquareReport',_0x523379[_0xef2c('0x14')],_0x1bcffb);_0x30b1f3(_0x795625[_0xef2c('0x12')](0x1f4,_0x523379['message']));});});};exports['UpdateSquareReport']=function(_0x260951){var _0x56e0bb=this;return new Promise(function(_0x51deea,_0x1a3445){return db[_0xef2c('0x1c')][_0xef2c('0x1d')](_0x260951['body'],{'raw':_0x260951['options']?_0x260951['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x260951['options']?_0x260951['options']['where']||null:null,'attributes':_0x260951['options']?_0x260951[_0xef2c('0x19')][_0xef2c('0x1e')]||null:null,'limit':_0x260951[_0xef2c('0x19')]?_0x260951[_0xef2c('0x19')][_0xef2c('0x1f')]||null:null})[_0xef2c('0xc')](function(_0x470402){logger[_0xef2c('0xd')](_0xef2c('0x20'),_0x260951);logger[_0xef2c('0x21')](_0xef2c('0x20'),_0x260951,JSON['stringify'](_0x470402));_0x51deea(_0x470402);})[_0xef2c('0x16')](function(_0x3f1979){logger[_0xef2c('0x12')]('UpdateSquareReport',_0x3f1979[_0xef2c('0x14')],_0x260951);_0x1a3445(_0x56e0bb[_0xef2c('0x12')](0x1f4,_0x3f1979[_0xef2c('0x14')]));});});}; \ No newline at end of file +var _0xee62=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','stringify','UpdateSquareReport','update','where','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xee62,0x12c));var _0x2ee6=function(_0x1cf098,_0x18317a){_0x1cf098=_0x1cf098-0x0;var _0x25c460=_0xee62[_0x1cf098];return _0x25c460;};'use strict';var _=require(_0x2ee6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2ee6('0x1'));var rs=require(_0x2ee6('0x2'));var fs=require('fs');var Redis=require(_0x2ee6('0x3'));var db=require(_0x2ee6('0x4'))['db'];var utils=require(_0x2ee6('0x5'));var logger=require(_0x2ee6('0x6'))(_0x2ee6('0x7'));var config=require(_0x2ee6('0x8'));var jayson=require(_0x2ee6('0x9'));var client=jayson[_0x2ee6('0xa')][_0x2ee6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20f59c,_0x5978a5,_0x12aede){return new BPromise(function(_0x835db9,_0x224e27){return client[_0x2ee6('0xc')](_0x20f59c,_0x12aede)[_0x2ee6('0xd')](function(_0x3cf1e9){logger[_0x2ee6('0xe')](_0x2ee6('0xf'),_0x5978a5,_0x2ee6('0x10'));logger['debug'](_0x2ee6('0x11'),_0x5978a5,_0x2ee6('0x10'),JSON['stringify'](_0x3cf1e9));if(_0x3cf1e9[_0x2ee6('0x12')]){if(_0x3cf1e9[_0x2ee6('0x12')][_0x2ee6('0x13')]===0x1f4){logger[_0x2ee6('0x12')](_0x2ee6('0xf'),_0x5978a5,_0x3cf1e9[_0x2ee6('0x12')][_0x2ee6('0x14')]);return _0x224e27(_0x3cf1e9['error'][_0x2ee6('0x14')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x5978a5,_0x3cf1e9[_0x2ee6('0x12')][_0x2ee6('0x14')]);return _0x835db9(_0x3cf1e9[_0x2ee6('0x12')][_0x2ee6('0x14')]);}else{logger[_0x2ee6('0xe')](_0x2ee6('0xf'),_0x5978a5,_0x2ee6('0x10'));_0x835db9(_0x3cf1e9[_0x2ee6('0x15')]['message']);}})[_0x2ee6('0x16')](function(_0x134885){logger['error'](_0x2ee6('0xf'),_0x5978a5,_0x134885);_0x224e27(_0x134885);});});}exports[_0x2ee6('0x17')]=function(_0x22a4ee){var _0x2d1ede=this;return new Promise(function(_0x3bdcdd,_0x585814){return db[_0x2ee6('0x18')][_0x2ee6('0x19')](_0x22a4ee[_0x2ee6('0x1a')],{'raw':_0x22a4ee[_0x2ee6('0x1b')]?_0x22a4ee['options'][_0x2ee6('0x1c')]===undefined?!![]:![]:!![]})[_0x2ee6('0xd')](function(_0xdd6464){logger[_0x2ee6('0xe')](_0x2ee6('0x17'),_0x22a4ee);logger['debug'](_0x2ee6('0x17'),_0x22a4ee,JSON[_0x2ee6('0x1d')](_0xdd6464));_0x3bdcdd(_0xdd6464);})[_0x2ee6('0x16')](function(_0x53b67c){logger[_0x2ee6('0x12')](_0x2ee6('0x17'),_0x53b67c[_0x2ee6('0x14')],_0x22a4ee);_0x585814(_0x2d1ede[_0x2ee6('0x12')](0x1f4,_0x53b67c[_0x2ee6('0x14')]));});});};exports[_0x2ee6('0x1e')]=function(_0xfb4592){var _0xe9b08d=this;return new Promise(function(_0x58ad31,_0x3d8004){return db[_0x2ee6('0x18')][_0x2ee6('0x1f')](_0xfb4592[_0x2ee6('0x1a')],{'raw':_0xfb4592[_0x2ee6('0x1b')]?_0xfb4592[_0x2ee6('0x1b')][_0x2ee6('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfb4592[_0x2ee6('0x1b')]?_0xfb4592['options'][_0x2ee6('0x20')]||null:null,'attributes':_0xfb4592[_0x2ee6('0x1b')]?_0xfb4592[_0x2ee6('0x1b')][_0x2ee6('0x21')]||null:null,'limit':_0xfb4592[_0x2ee6('0x1b')]?_0xfb4592[_0x2ee6('0x1b')]['limit']||null:null})['then'](function(_0x43e23f){logger[_0x2ee6('0xe')]('UpdateSquareReport',_0xfb4592);logger['debug'](_0x2ee6('0x1e'),_0xfb4592,JSON[_0x2ee6('0x1d')](_0x43e23f));_0x58ad31(_0x43e23f);})[_0x2ee6('0x16')](function(_0x48ab){logger['error']('UpdateSquareReport',_0x48ab[_0x2ee6('0x14')],_0xfb4592);_0x3d8004(_0xe9b08d[_0x2ee6('0x12')](0x1f4,_0x48ab['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index d1d0b04..49d680c 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 _0xfd63=['create','put','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xfd63,0x108));var _0x3fd6=function(_0x2c7879,_0x36ff31){_0x2c7879=_0x2c7879-0x0;var _0x10b363=_0xfd63[_0x2c7879];return _0x10b363;};'use strict';var multer=require(_0x3fd6('0x0'));var util=require('util');var path=require(_0x3fd6('0x1'));var timeout=require(_0x3fd6('0x2'));var express=require('express');var router=express[_0x3fd6('0x3')]();var fs_extra=require(_0x3fd6('0x4'));var auth=require(_0x3fd6('0x5'));var interaction=require(_0x3fd6('0x6'));var config=require('../../config/environment');var controller=require(_0x3fd6('0x7'));router[_0x3fd6('0x8')]('/',auth[_0x3fd6('0x9')](),controller[_0x3fd6('0xa')]);router[_0x3fd6('0x8')](_0x3fd6('0xb'),auth[_0x3fd6('0x9')](),controller[_0x3fd6('0xc')]);router[_0x3fd6('0x8')](_0x3fd6('0xd'),auth[_0x3fd6('0x9')](),controller[_0x3fd6('0xe')]);router[_0x3fd6('0xf')]('/',auth[_0x3fd6('0x9')](),controller[_0x3fd6('0x10')]);router[_0x3fd6('0x11')]('/:id',auth[_0x3fd6('0x9')](),controller['update']);router['delete'](_0x3fd6('0xd'),auth[_0x3fd6('0x9')](),controller[_0x3fd6('0x12')]);module[_0x3fd6('0x13')]=router; \ No newline at end of file +var _0x8d09=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x1fd5eb,_0x235203){var _0x102365=function(_0x54de1f){while(--_0x54de1f){_0x1fd5eb['push'](_0x1fd5eb['shift']());}};_0x102365(++_0x235203);}(_0x8d09,0xac));var _0x98d0=function(_0x2d50be,_0x4e2d7c){_0x2d50be=_0x2d50be-0x0;var _0x2d3545=_0x8d09[_0x2d50be];return _0x2d3545;};'use strict';var multer=require(_0x98d0('0x0'));var util=require(_0x98d0('0x1'));var path=require(_0x98d0('0x2'));var timeout=require(_0x98d0('0x3'));var express=require(_0x98d0('0x4'));var router=express[_0x98d0('0x5')]();var fs_extra=require(_0x98d0('0x6'));var auth=require(_0x98d0('0x7'));var interaction=require(_0x98d0('0x8'));var config=require(_0x98d0('0x9'));var controller=require(_0x98d0('0xa'));router[_0x98d0('0xb')]('/',auth[_0x98d0('0xc')](),controller[_0x98d0('0xd')]);router[_0x98d0('0xb')](_0x98d0('0xe'),auth[_0x98d0('0xc')](),controller[_0x98d0('0xf')]);router[_0x98d0('0xb')](_0x98d0('0x10'),auth[_0x98d0('0xc')](),controller['show']);router[_0x98d0('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x98d0('0x12')](_0x98d0('0x10'),auth[_0x98d0('0xc')](),controller[_0x98d0('0x13')]);router[_0x98d0('0x14')](_0x98d0('0x10'),auth[_0x98d0('0xc')](),controller['destroy']);module[_0x98d0('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 5d2e7d7..cae3273 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 _0x4457=['STRING','TEXT','sequelize','exports'];(function(_0x382b04,_0x1f92fd){var _0x49e2a8=function(_0x3ef19f){while(--_0x3ef19f){_0x382b04['push'](_0x382b04['shift']());}};_0x49e2a8(++_0x1f92fd);}(_0x4457,0xba));var _0x7445=function(_0x4cb1ee,_0x466384){_0x4cb1ee=_0x4cb1ee-0x0;var _0x1367ff=_0x4457[_0x4cb1ee];return _0x1367ff;};'use strict';var Sequelize=require(_0x7445('0x0'));module[_0x7445('0x1')]={'uniqueid':{'type':Sequelize[_0x7445('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x7445('0x2')]},'data':{'type':Sequelize[_0x7445('0x3')]},'project_name':{'type':Sequelize[_0x7445('0x2')]},'callerid':{'type':Sequelize[_0x7445('0x2')]}}; \ No newline at end of file +var _0x9fdc=['STRING','TEXT','exports'];(function(_0x2658b0,_0x254269){var _0x24c5df=function(_0x2f1de6){while(--_0x2f1de6){_0x2658b0['push'](_0x2658b0['shift']());}};_0x24c5df(++_0x254269);}(_0x9fdc,0xce));var _0xc9fd=function(_0xab9f3d,_0xb336fa){_0xab9f3d=_0xab9f3d-0x0;var _0x5283bf=_0x9fdc[_0xab9f3d];return _0x5283bf;};'use strict';var Sequelize=require('sequelize');module[_0xc9fd('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xc9fd('0x1')]},'application':{'type':Sequelize[_0xc9fd('0x1')]},'data':{'type':Sequelize[_0xc9fd('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xc9fd('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 94b6202..a60ad3b 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 _0x13c1=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareDetailsReport','count','catch','show','params','includeAll','include','find','create','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0xf40646,_0x13cae5){var _0x4e21b6=function(_0x50bc07){while(--_0x50bc07){_0xf40646['push'](_0xf40646['shift']());}};_0x4e21b6(++_0x13cae5);}(_0x13c1,0x156));var _0x113c=function(_0x338ce2,_0x206d50){_0x338ce2=_0x338ce2-0x0;var _0x4da67d=_0x13c1[_0x338ce2];return _0x4da67d;};'use strict';var emlformat=require(_0x113c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x113c('0x1'));var jsonpatch=require(_0x113c('0x2'));var rp=require(_0x113c('0x3'));var moment=require('moment');var BPromise=require(_0x113c('0x4'));var Mustache=require('mustache');var util=require(_0x113c('0x5'));var path=require(_0x113c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x113c('0x7'));var _=require(_0x113c('0x8'));var squel=require(_0x113c('0x9'));var crypto=require(_0x113c('0xa'));var jsforce=require(_0x113c('0xb'));var deskjs=require(_0x113c('0xc'));var toCsv=require(_0x113c('0xd'));var querystring=require(_0x113c('0xe'));var Papa=require(_0x113c('0xf'));var Redis=require('ioredis');var authService=require(_0x113c('0x10'));var qs=require(_0x113c('0x11'));var as=require(_0x113c('0x12'));var hardwareService=require(_0x113c('0x13'));var logger=require(_0x113c('0x14'))(_0x113c('0x15'));var utils=require(_0x113c('0x16'));var config=require(_0x113c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x113c('0x18'))['db'];function respondWithStatusCode(_0x2ae3d9,_0x2a9d4d){_0x2a9d4d=_0x2a9d4d||0xcc;return function(_0x44a286){if(_0x44a286){return _0x2ae3d9[_0x113c('0x19')](_0x2a9d4d);}return _0x2ae3d9[_0x113c('0x1a')](_0x2a9d4d)[_0x113c('0x1b')]();};}function respondWithResult(_0x10a5c6,_0x93b854){_0x93b854=_0x93b854||0xc8;return function(_0x4d1356){if(_0x4d1356){return _0x10a5c6[_0x113c('0x1a')](_0x93b854)[_0x113c('0x1c')](_0x4d1356);}};}function respondWithFilteredResult(_0x3cde52,_0x6a69d5){return function(_0x28c71f){if(_0x28c71f){var _0x2ec761=typeof _0x6a69d5[_0x113c('0x1d')]===_0x113c('0x1e')&&typeof _0x6a69d5[_0x113c('0x1f')]===_0x113c('0x1e');var _0x24f9c1=_0x28c71f['count'];var _0x1872e0=_0x2ec761?0x0:_0x6a69d5[_0x113c('0x1d')];var _0x4f3e9e=_0x2ec761?_0x28c71f['count']:_0x6a69d5[_0x113c('0x1d')]+_0x6a69d5[_0x113c('0x1f')];var _0x2bbbdf;if(_0x4f3e9e>=_0x24f9c1){_0x4f3e9e=_0x24f9c1;_0x2bbbdf=0xc8;}else{_0x2bbbdf=0xce;}_0x3cde52['status'](_0x2bbbdf);return _0x3cde52['set'](_0x113c('0x20'),_0x1872e0+'-'+_0x4f3e9e+'/'+_0x24f9c1)['json'](_0x28c71f);}return null;};}function patchUpdates(_0x402bfe){return function(_0x4394c9){try{jsonpatch[_0x113c('0x21')](_0x4394c9,_0x402bfe,!![]);}catch(_0x27f83a){return BPromise[_0x113c('0x22')](_0x27f83a);}return _0x4394c9[_0x113c('0x23')]();};}function saveUpdates(_0x21db3c,_0x1e9ef5){return function(_0x4886ce){if(_0x4886ce){return _0x4886ce['update'](_0x21db3c)[_0x113c('0x24')](function(_0x290218){return _0x290218;});}return null;};}function removeEntity(_0x312360,_0x2328e9){return function(_0x2c974a){if(_0x2c974a){return _0x2c974a[_0x113c('0x25')]()[_0x113c('0x24')](function(){_0x312360[_0x113c('0x1a')](0xcc)[_0x113c('0x1b')]();});}};}function handleEntityNotFound(_0x3db57c,_0xa59aa9){return function(_0x59eb01){if(!_0x59eb01){_0x3db57c['sendStatus'](0x194);}return _0x59eb01;};}function handleError(_0x5926c9,_0x1cb12c){_0x1cb12c=_0x1cb12c||0x1f4;return function(_0x2264cb){logger[_0x113c('0x26')](_0x2264cb[_0x113c('0x27')]);if(_0x2264cb['name']){delete _0x2264cb[_0x113c('0x28')];}_0x5926c9[_0x113c('0x1a')](_0x1cb12c)[_0x113c('0x29')](_0x2264cb);};}exports[_0x113c('0x2a')]=function(_0x5a0a26,_0x23d427){var _0x1884cc={},_0x5f2bac={},_0x2685e8={'count':0x0,'rows':[]};var _0x1da34b=_[_0x113c('0x2b')](db['SquareDetailsReport'][_0x113c('0x2c')],function(_0x4ec4a6){return{'name':_0x4ec4a6[_0x113c('0x2d')],'type':_0x4ec4a6[_0x113c('0x2e')][_0x113c('0x2f')]};});_0x5f2bac[_0x113c('0x30')]=_[_0x113c('0x2b')](_0x1da34b,_0x113c('0x28'));_0x5f2bac[_0x113c('0x31')]=_[_0x113c('0x32')](_0x5a0a26[_0x113c('0x31')]);_0x5f2bac[_0x113c('0x33')]=_[_0x113c('0x34')](_0x5f2bac[_0x113c('0x30')],_0x5f2bac[_0x113c('0x31')]);_0x1884cc[_0x113c('0x35')]=_[_0x113c('0x34')](_0x5f2bac['model'],qs[_0x113c('0x36')](_0x5a0a26[_0x113c('0x31')][_0x113c('0x36')]));_0x1884cc[_0x113c('0x35')]=_0x1884cc[_0x113c('0x35')][_0x113c('0x37')]?_0x1884cc[_0x113c('0x35')]:_0x5f2bac['model'];if(!_0x5a0a26[_0x113c('0x31')][_0x113c('0x38')](_0x113c('0x39'))){_0x1884cc[_0x113c('0x1f')]=qs['limit'](_0x5a0a26[_0x113c('0x31')]['limit']);_0x1884cc[_0x113c('0x1d')]=qs[_0x113c('0x1d')](_0x5a0a26[_0x113c('0x31')][_0x113c('0x1d')]);}_0x1884cc[_0x113c('0x3a')]=qs[_0x113c('0x3b')](_0x5a0a26[_0x113c('0x31')][_0x113c('0x3b')]);_0x1884cc[_0x113c('0x3c')]=qs['filters'](_[_0x113c('0x3d')](_0x5a0a26[_0x113c('0x31')],_0x5f2bac['filters']),_0x1da34b);if(_0x5a0a26[_0x113c('0x31')][_0x113c('0x3e')]){_0x1884cc[_0x113c('0x3c')]=_[_0x113c('0x3f')](_0x1884cc['where'],{'$or':_[_0x113c('0x2b')](_0x1da34b,function(_0x1ae7d5){if(_0x1ae7d5[_0x113c('0x2e')]!==_0x113c('0x40')){var _0x84b042={};_0x84b042[_0x1ae7d5[_0x113c('0x28')]]={'$like':'%'+_0x5a0a26['query']['filter']+'%'};return _0x84b042;}})});}_0x1884cc=_['merge']({},_0x1884cc,_0x5a0a26[_0x113c('0x41')]);var _0x2f3dd4={'where':_0x1884cc[_0x113c('0x3c')]};return db[_0x113c('0x42')][_0x113c('0x43')](_0x2f3dd4)[_0x113c('0x24')](function(_0x3fe647){_0x2685e8[_0x113c('0x43')]=_0x3fe647;if(_0x5a0a26[_0x113c('0x31')]['includeAll']){_0x1884cc['include']=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x1884cc);})[_0x113c('0x24')](function(_0x4442e5){_0x2685e8['rows']=_0x4442e5;return _0x2685e8;})[_0x113c('0x24')](respondWithFilteredResult(_0x23d427,_0x1884cc))[_0x113c('0x44')](handleError(_0x23d427,null));};exports[_0x113c('0x45')]=function(_0x562fd6,_0x5cc0f4){var _0x40a7f7={'raw':!![],'where':{'id':_0x562fd6[_0x113c('0x46')]['id']}},_0x326c5a={};_0x326c5a[_0x113c('0x30')]=_[_0x113c('0x32')](db[_0x113c('0x42')][_0x113c('0x2c')]);_0x326c5a['query']=_[_0x113c('0x32')](_0x562fd6[_0x113c('0x31')]);_0x326c5a[_0x113c('0x33')]=_['intersection'](_0x326c5a[_0x113c('0x30')],_0x326c5a[_0x113c('0x31')]);_0x40a7f7[_0x113c('0x35')]=_[_0x113c('0x34')](_0x326c5a['model'],qs[_0x113c('0x36')](_0x562fd6[_0x113c('0x31')]['fields']));_0x40a7f7[_0x113c('0x35')]=_0x40a7f7[_0x113c('0x35')][_0x113c('0x37')]?_0x40a7f7[_0x113c('0x35')]:_0x326c5a[_0x113c('0x30')];if(_0x562fd6[_0x113c('0x31')][_0x113c('0x47')]){_0x40a7f7[_0x113c('0x48')]=[{'all':!![]}];}_0x40a7f7=_['merge']({},_0x40a7f7,_0x562fd6[_0x113c('0x41')]);return db['SquareDetailsReport'][_0x113c('0x49')](_0x40a7f7)['then'](handleEntityNotFound(_0x5cc0f4,null))['then'](respondWithResult(_0x5cc0f4,null))[_0x113c('0x44')](handleError(_0x5cc0f4,null));};exports[_0x113c('0x4a')]=function(_0x4d522f,_0x4293ae){return db[_0x113c('0x42')]['create'](_0x4d522f['body'],{})['then'](respondWithResult(_0x4293ae,0xc9))[_0x113c('0x44')](handleError(_0x4293ae,null));};exports[_0x113c('0x4b')]=function(_0x240171,_0x47bd09){if(_0x240171[_0x113c('0x4c')]['id']){delete _0x240171[_0x113c('0x4c')]['id'];}return db[_0x113c('0x42')][_0x113c('0x49')]({'where':{'id':_0x240171[_0x113c('0x46')]['id']}})[_0x113c('0x24')](handleEntityNotFound(_0x47bd09,null))['then'](saveUpdates(_0x240171[_0x113c('0x4c')],null))['then'](respondWithResult(_0x47bd09,null))[_0x113c('0x44')](handleError(_0x47bd09,null));};exports['destroy']=function(_0x52e773,_0x544b6d){return db[_0x113c('0x42')][_0x113c('0x49')]({'where':{'id':_0x52e773[_0x113c('0x46')]['id']}})[_0x113c('0x24')](handleEntityNotFound(_0x544b6d,null))[_0x113c('0x24')](removeEntity(_0x544b6d,null))['catch'](handleError(_0x544b6d,null));};exports[_0x113c('0x4d')]=function(_0x460b84,_0x492e35){return db['SquareDetailsReport'][_0x113c('0x4d')]()['then'](respondWithResult(_0x492e35,null))[_0x113c('0x44')](handleError(_0x492e35,null));}; \ No newline at end of file +var _0xc181=['jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','save','then','error','stack','send','index','SquareDetailsReport','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','lodash','squel'];(function(_0x3ce6db,_0x2af913){var _0x5c5164=function(_0x387c03){while(--_0x387c03){_0x3ce6db['push'](_0x3ce6db['shift']());}};_0x5c5164(++_0x2af913);}(_0xc181,0x1a4));var _0x1c18=function(_0x566bdf,_0x1f4861){_0x566bdf=_0x566bdf-0x0;var _0x331215=_0xc181[_0x566bdf];return _0x331215;};'use strict';var emlformat=require(_0x1c18('0x0'));var rimraf=require(_0x1c18('0x1'));var zipdir=require(_0x1c18('0x2'));var jsonpatch=require(_0x1c18('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1c18('0x4'));var util=require(_0x1c18('0x5'));var path=require(_0x1c18('0x6'));var sox=require(_0x1c18('0x7'));var csv=require(_0x1c18('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c18('0x9'));var _=require(_0x1c18('0xa'));var squel=require(_0x1c18('0xb'));var crypto=require('crypto');var jsforce=require(_0x1c18('0xc'));var deskjs=require(_0x1c18('0xd'));var toCsv=require(_0x1c18('0x8'));var querystring=require('querystring');var Papa=require(_0x1c18('0xe'));var Redis=require(_0x1c18('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1c18('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c18('0x11'))(_0x1c18('0x12'));var utils=require(_0x1c18('0x13'));var config=require(_0x1c18('0x14'));var licenseUtil=require(_0x1c18('0x15'));var db=require(_0x1c18('0x16'))['db'];function respondWithStatusCode(_0x28bbac,_0x5b7123){_0x5b7123=_0x5b7123||0xcc;return function(_0x1b1a30){if(_0x1b1a30){return _0x28bbac[_0x1c18('0x17')](_0x5b7123);}return _0x28bbac[_0x1c18('0x18')](_0x5b7123)['end']();};}function respondWithResult(_0x234e98,_0x34db5b){_0x34db5b=_0x34db5b||0xc8;return function(_0x282a32){if(_0x282a32){return _0x234e98[_0x1c18('0x18')](_0x34db5b)[_0x1c18('0x19')](_0x282a32);}};}function respondWithFilteredResult(_0x105c76,_0x218fec){return function(_0x4479d2){if(_0x4479d2){var _0xe04e5a=typeof _0x218fec['offset']===_0x1c18('0x1a')&&typeof _0x218fec['limit']===_0x1c18('0x1a');var _0x2f1986=_0x4479d2[_0x1c18('0x1b')];var _0x1a174a=_0xe04e5a?0x0:_0x218fec[_0x1c18('0x1c')];var _0x311897=_0xe04e5a?_0x4479d2[_0x1c18('0x1b')]:_0x218fec[_0x1c18('0x1c')]+_0x218fec[_0x1c18('0x1d')];var _0x1cca68;if(_0x311897>=_0x2f1986){_0x311897=_0x2f1986;_0x1cca68=0xc8;}else{_0x1cca68=0xce;}_0x105c76['status'](_0x1cca68);return _0x105c76[_0x1c18('0x1e')]('Content-Range',_0x1a174a+'-'+_0x311897+'/'+_0x2f1986)[_0x1c18('0x19')](_0x4479d2);}return null;};}function patchUpdates(_0x31e9d3){return function(_0x24fa15){try{jsonpatch[_0x1c18('0x1f')](_0x24fa15,_0x31e9d3,!![]);}catch(_0x4ca27a){return BPromise[_0x1c18('0x20')](_0x4ca27a);}return _0x24fa15[_0x1c18('0x21')]();};}function saveUpdates(_0x4800dc,_0x47c96d){return function(_0x4d30e2){if(_0x4d30e2){return _0x4d30e2['update'](_0x4800dc)[_0x1c18('0x22')](function(_0x15a450){return _0x15a450;});}return null;};}function removeEntity(_0x29573e,_0xaa170d){return function(_0x368f8f){if(_0x368f8f){return _0x368f8f['destroy']()[_0x1c18('0x22')](function(){_0x29573e[_0x1c18('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20c755,_0x5061b9){return function(_0x3e7612){if(!_0x3e7612){_0x20c755['sendStatus'](0x194);}return _0x3e7612;};}function handleError(_0x279bb0,_0x1e9ef9){_0x1e9ef9=_0x1e9ef9||0x1f4;return function(_0x69e26c){logger[_0x1c18('0x23')](_0x69e26c[_0x1c18('0x24')]);if(_0x69e26c['name']){delete _0x69e26c['name'];}_0x279bb0[_0x1c18('0x18')](_0x1e9ef9)[_0x1c18('0x25')](_0x69e26c);};}exports[_0x1c18('0x26')]=function(_0x159eb9,_0x32485c){var _0x43801a={},_0x5f50a3={},_0x2369a3={'count':0x0,'rows':[]};var _0x38dddf=_['map'](db[_0x1c18('0x27')]['rawAttributes'],function(_0x59e776){return{'name':_0x59e776[_0x1c18('0x28')],'type':_0x59e776[_0x1c18('0x29')][_0x1c18('0x2a')]};});_0x5f50a3[_0x1c18('0x2b')]=_['map'](_0x38dddf,_0x1c18('0x2c'));_0x5f50a3['query']=_[_0x1c18('0x2d')](_0x159eb9[_0x1c18('0x2e')]);_0x5f50a3[_0x1c18('0x2f')]=_[_0x1c18('0x30')](_0x5f50a3[_0x1c18('0x2b')],_0x5f50a3[_0x1c18('0x2e')]);_0x43801a[_0x1c18('0x31')]=_[_0x1c18('0x30')](_0x5f50a3[_0x1c18('0x2b')],qs[_0x1c18('0x32')](_0x159eb9[_0x1c18('0x2e')][_0x1c18('0x32')]));_0x43801a[_0x1c18('0x31')]=_0x43801a[_0x1c18('0x31')][_0x1c18('0x33')]?_0x43801a[_0x1c18('0x31')]:_0x5f50a3[_0x1c18('0x2b')];if(!_0x159eb9[_0x1c18('0x2e')][_0x1c18('0x34')]('nolimit')){_0x43801a[_0x1c18('0x1d')]=qs[_0x1c18('0x1d')](_0x159eb9[_0x1c18('0x2e')][_0x1c18('0x1d')]);_0x43801a['offset']=qs['offset'](_0x159eb9[_0x1c18('0x2e')][_0x1c18('0x1c')]);}_0x43801a[_0x1c18('0x35')]=qs[_0x1c18('0x36')](_0x159eb9[_0x1c18('0x2e')]['sort']);_0x43801a['where']=qs[_0x1c18('0x2f')](_['pick'](_0x159eb9['query'],_0x5f50a3[_0x1c18('0x2f')]),_0x38dddf);if(_0x159eb9[_0x1c18('0x2e')]['filter']){_0x43801a[_0x1c18('0x37')]=_[_0x1c18('0x38')](_0x43801a['where'],{'$or':_[_0x1c18('0x39')](_0x38dddf,function(_0x289f6e){if(_0x289f6e[_0x1c18('0x29')]!==_0x1c18('0x3a')){var _0xc1c459={};_0xc1c459[_0x289f6e['name']]={'$like':'%'+_0x159eb9[_0x1c18('0x2e')][_0x1c18('0x3b')]+'%'};return _0xc1c459;}})});}_0x43801a=_['merge']({},_0x43801a,_0x159eb9['options']);var _0x579263={'where':_0x43801a[_0x1c18('0x37')]};return db['SquareDetailsReport'][_0x1c18('0x1b')](_0x579263)[_0x1c18('0x22')](function(_0x51142f){_0x2369a3[_0x1c18('0x1b')]=_0x51142f;if(_0x159eb9[_0x1c18('0x2e')][_0x1c18('0x3c')]){_0x43801a[_0x1c18('0x3d')]=[{'all':!![]}];}return db[_0x1c18('0x27')][_0x1c18('0x3e')](_0x43801a);})[_0x1c18('0x22')](function(_0x4c9044){_0x2369a3[_0x1c18('0x3f')]=_0x4c9044;return _0x2369a3;})[_0x1c18('0x22')](respondWithFilteredResult(_0x32485c,_0x43801a))[_0x1c18('0x40')](handleError(_0x32485c,null));};exports[_0x1c18('0x41')]=function(_0x49d7e1,_0x1b66d1){var _0x2951b3={'raw':!![],'where':{'id':_0x49d7e1[_0x1c18('0x42')]['id']}},_0x424efc={};_0x424efc['model']=_[_0x1c18('0x2d')](db[_0x1c18('0x27')][_0x1c18('0x43')]);_0x424efc[_0x1c18('0x2e')]=_[_0x1c18('0x2d')](_0x49d7e1[_0x1c18('0x2e')]);_0x424efc[_0x1c18('0x2f')]=_[_0x1c18('0x30')](_0x424efc[_0x1c18('0x2b')],_0x424efc[_0x1c18('0x2e')]);_0x2951b3[_0x1c18('0x31')]=_[_0x1c18('0x30')](_0x424efc[_0x1c18('0x2b')],qs[_0x1c18('0x32')](_0x49d7e1[_0x1c18('0x2e')][_0x1c18('0x32')]));_0x2951b3['attributes']=_0x2951b3[_0x1c18('0x31')][_0x1c18('0x33')]?_0x2951b3[_0x1c18('0x31')]:_0x424efc['model'];if(_0x49d7e1[_0x1c18('0x2e')][_0x1c18('0x3c')]){_0x2951b3['include']=[{'all':!![]}];}_0x2951b3=_[_0x1c18('0x38')]({},_0x2951b3,_0x49d7e1['options']);return db['SquareDetailsReport'][_0x1c18('0x44')](_0x2951b3)['then'](handleEntityNotFound(_0x1b66d1,null))[_0x1c18('0x22')](respondWithResult(_0x1b66d1,null))[_0x1c18('0x40')](handleError(_0x1b66d1,null));};exports[_0x1c18('0x45')]=function(_0x31d2cf,_0xaada64){return db['SquareDetailsReport'][_0x1c18('0x45')](_0x31d2cf[_0x1c18('0x46')],{})[_0x1c18('0x22')](respondWithResult(_0xaada64,0xc9))[_0x1c18('0x40')](handleError(_0xaada64,null));};exports['update']=function(_0x13eed6,_0x14afcf){if(_0x13eed6['body']['id']){delete _0x13eed6[_0x1c18('0x46')]['id'];}return db['SquareDetailsReport'][_0x1c18('0x44')]({'where':{'id':_0x13eed6[_0x1c18('0x42')]['id']}})[_0x1c18('0x22')](handleEntityNotFound(_0x14afcf,null))[_0x1c18('0x22')](saveUpdates(_0x13eed6[_0x1c18('0x46')],null))[_0x1c18('0x22')](respondWithResult(_0x14afcf,null))[_0x1c18('0x40')](handleError(_0x14afcf,null));};exports['destroy']=function(_0x5e9c7b,_0x922d4f){return db['SquareDetailsReport']['find']({'where':{'id':_0x5e9c7b[_0x1c18('0x42')]['id']}})[_0x1c18('0x22')](handleEntityNotFound(_0x922d4f,null))[_0x1c18('0x22')](removeEntity(_0x922d4f,null))[_0x1c18('0x40')](handleError(_0x922d4f,null));};exports['describe']=function(_0x8fdb99,_0x3b9cb8){return db['SquareDetailsReport'][_0x1c18('0x47')]()[_0x1c18('0x22')](respondWithResult(_0x3b9cb8,null))[_0x1c18('0x40')](handleError(_0x3b9cb8,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 72f9860..8997e3f 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 _0x7f63=['report_square_details','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport'];(function(_0x519209,_0x4e722a){var _0x52865d=function(_0x1cdd41){while(--_0x1cdd41){_0x519209['push'](_0x519209['shift']());}};_0x52865d(++_0x4e722a);}(_0x7f63,0x181));var _0x37f6=function(_0x442614,_0x2542e5){_0x442614=_0x442614-0x0;var _0x225e21=_0x7f63[_0x442614];return _0x225e21;};'use strict';var _=require('lodash');var util=require(_0x37f6('0x0'));var logger=require(_0x37f6('0x1'))(_0x37f6('0x2'));var moment=require(_0x37f6('0x3'));var BPromise=require('bluebird');var rp=require(_0x37f6('0x4'));var fs=require('fs');var path=require(_0x37f6('0x5'));var rimraf=require(_0x37f6('0x6'));var config=require(_0x37f6('0x7'));var attributes=require(_0x37f6('0x8'));module[_0x37f6('0x9')]=function(_0x30c5f6,_0x2f51b3){return _0x30c5f6['define'](_0x37f6('0xa'),attributes,{'tableName':_0x37f6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec21=['SquareDetailsReport','report_square_details','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x19df6a,_0x55d5d9){var _0x8376d4=function(_0x7a3f59){while(--_0x7a3f59){_0x19df6a['push'](_0x19df6a['shift']());}};_0x8376d4(++_0x55d5d9);}(_0xec21,0x16d));var _0x1ec2=function(_0x46cf00,_0x457a43){_0x46cf00=_0x46cf00-0x0;var _0x3974dc=_0xec21[_0x46cf00];return _0x3974dc;};'use strict';var _=require(_0x1ec2('0x0'));var util=require(_0x1ec2('0x1'));var logger=require(_0x1ec2('0x2'))('api');var moment=require(_0x1ec2('0x3'));var BPromise=require(_0x1ec2('0x4'));var rp=require(_0x1ec2('0x5'));var fs=require('fs');var path=require(_0x1ec2('0x6'));var rimraf=require('rimraf');var config=require(_0x1ec2('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x1ec2('0x8')]=function(_0x56c3d5,_0x2aafd9){return _0x56c3d5['define'](_0x1ec2('0x9'),attributes,{'tableName':_0x1ec2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index d1155da..a425b4e 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 _0x1c3d=['http','request','then','info','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x22e03d,_0x34a3ec){_0x22e03d=_0x22e03d-0x0;var _0xaabbaa=_0x1c3d[_0x22e03d];return _0xaabbaa;};'use strict';var _=require('lodash');var util=require(_0xd1c3('0x0'));var moment=require(_0xd1c3('0x1'));var BPromise=require(_0xd1c3('0x2'));var rs=require(_0xd1c3('0x3'));var fs=require('fs');var Redis=require(_0xd1c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd1c3('0x5'))(_0xd1c3('0x6'));var config=require(_0xd1c3('0x7'));var jayson=require(_0xd1c3('0x8'));var client=jayson[_0xd1c3('0x9')][_0xd1c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5adcb7,_0x398766,_0x420ab0){return new BPromise(function(_0x5db2f0,_0x1afc71){return client[_0xd1c3('0xb')](_0x5adcb7,_0x420ab0)[_0xd1c3('0xc')](function(_0x18556c){logger[_0xd1c3('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x398766,'request\x20sent');logger[_0xd1c3('0xe')](_0xd1c3('0xf'),_0x398766,_0xd1c3('0x10'),JSON[_0xd1c3('0x11')](_0x18556c));if(_0x18556c[_0xd1c3('0x12')]){if(_0x18556c[_0xd1c3('0x12')][_0xd1c3('0x13')]===0x1f4){logger[_0xd1c3('0x12')](_0xd1c3('0x14'),_0x398766,_0x18556c['error'][_0xd1c3('0x15')]);return _0x1afc71(_0x18556c['error']['message']);}logger[_0xd1c3('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x398766,_0x18556c[_0xd1c3('0x12')][_0xd1c3('0x15')]);return _0x5db2f0(_0x18556c[_0xd1c3('0x12')]['message']);}else{logger[_0xd1c3('0xd')](_0xd1c3('0x14'),_0x398766,_0xd1c3('0x10'));_0x5db2f0(_0x18556c[_0xd1c3('0x16')][_0xd1c3('0x15')]);}})[_0xd1c3('0x17')](function(_0x586fa7){logger[_0xd1c3('0x12')](_0xd1c3('0x14'),_0x398766,_0x586fa7);_0x1afc71(_0x586fa7);});});}exports[_0xd1c3('0x18')]=function(_0x5d26c2){var _0x53a5e1=this;return new Promise(function(_0x14f6cb,_0x3a1a74){return db[_0xd1c3('0x19')][_0xd1c3('0x1a')](_0x5d26c2[_0xd1c3('0x1b')],{'raw':_0x5d26c2['options']?_0x5d26c2[_0xd1c3('0x1c')][_0xd1c3('0x1d')]===undefined?!![]:![]:!![]})[_0xd1c3('0xc')](function(_0x588f4e){logger['info'](_0xd1c3('0x18'),_0x5d26c2);logger[_0xd1c3('0xe')]('CreateSquareDetailsReport',_0x5d26c2,JSON['stringify'](_0x588f4e));_0x14f6cb(_0x588f4e);})[_0xd1c3('0x17')](function(_0xc45d5d){logger[_0xd1c3('0x12')](_0xd1c3('0x18'),_0xc45d5d[_0xd1c3('0x15')],_0x5d26c2);_0x3a1a74(_0x53a5e1[_0xd1c3('0x12')](0x1f4,_0xc45d5d[_0xd1c3('0x15')]));});});}; \ No newline at end of file +var _0xae60=['client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x71bb53,_0x5970da){var _0x46c0bd=function(_0x1716b0){while(--_0x1716b0){_0x71bb53['push'](_0x71bb53['shift']());}};_0x46c0bd(++_0x5970da);}(_0xae60,0x1c7));var _0x0ae6=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xae60[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var moment=require(_0x0ae6('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ae6('0x3'));var fs=require('fs');var Redis=require(_0x0ae6('0x4'));var db=require(_0x0ae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ae6('0x6'))(_0x0ae6('0x7'));var config=require('../../config/environment');var jayson=require(_0x0ae6('0x8'));var client=jayson[_0x0ae6('0x9')][_0x0ae6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46fed4,_0xbb596c,_0x447a1d){return new BPromise(function(_0x120910,_0x1b5e80){return client['request'](_0x46fed4,_0x447a1d)[_0x0ae6('0xb')](function(_0x36a5e0){logger[_0x0ae6('0xc')](_0x0ae6('0xd'),_0xbb596c,'request\x20sent');logger[_0x0ae6('0xe')](_0x0ae6('0xf'),_0xbb596c,_0x0ae6('0x10'),JSON[_0x0ae6('0x11')](_0x36a5e0));if(_0x36a5e0[_0x0ae6('0x12')]){if(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x13')]===0x1f4){logger[_0x0ae6('0x12')](_0x0ae6('0xd'),_0xbb596c,_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);return _0x1b5e80(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);}logger[_0x0ae6('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0xbb596c,_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);return _0x120910(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);}else{logger[_0x0ae6('0xc')](_0x0ae6('0xd'),_0xbb596c,_0x0ae6('0x10'));_0x120910(_0x36a5e0[_0x0ae6('0x15')][_0x0ae6('0x14')]);}})[_0x0ae6('0x16')](function(_0x8a4c9a){logger[_0x0ae6('0x12')](_0x0ae6('0xd'),_0xbb596c,_0x8a4c9a);_0x1b5e80(_0x8a4c9a);});});}exports[_0x0ae6('0x17')]=function(_0xda4f01){var _0x3f5c41=this;return new Promise(function(_0x2fdf25,_0x1735ba){return db[_0x0ae6('0x18')][_0x0ae6('0x19')](_0xda4f01[_0x0ae6('0x1a')],{'raw':_0xda4f01[_0x0ae6('0x1b')]?_0xda4f01['options'][_0x0ae6('0x1c')]===undefined?!![]:![]:!![]})[_0x0ae6('0xb')](function(_0x140a3b){logger[_0x0ae6('0xc')](_0x0ae6('0x17'),_0xda4f01);logger[_0x0ae6('0xe')](_0x0ae6('0x17'),_0xda4f01,JSON[_0x0ae6('0x11')](_0x140a3b));_0x2fdf25(_0x140a3b);})['catch'](function(_0x39b22e){logger[_0x0ae6('0x12')](_0x0ae6('0x17'),_0x39b22e[_0x0ae6('0x14')],_0xda4f01);_0x1735ba(_0x3f5c41[_0x0ae6('0x12')](0x1f4,_0x39b22e['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index c17be17..b2e7bdf 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 _0x4567=['Router','./system.controller','get','/process/:pid/kill','killProcess','exports','express'];(function(_0x337eee,_0x221155){var _0x408143=function(_0x489d2c){while(--_0x489d2c){_0x337eee['push'](_0x337eee['shift']());}};_0x408143(++_0x221155);}(_0x4567,0xb5));var _0x7456=function(_0x4e44c0,_0x2cb040){_0x4e44c0=_0x4e44c0-0x0;var _0x141b4e=_0x4567[_0x4e44c0];return _0x141b4e;};'use strict';var express=require(_0x7456('0x0'));var router=express[_0x7456('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x7456('0x2'));router[_0x7456('0x3')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7456('0x3')](_0x7456('0x4'),auth['isAuthenticated'](),controller[_0x7456('0x5')]);module[_0x7456('0x6')]=router; \ No newline at end of file +var _0xa408=['get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','./system.controller'];(function(_0x451353,_0x19710b){var _0x102315=function(_0x51204c){while(--_0x51204c){_0x451353['push'](_0x451353['shift']());}};_0x102315(++_0x19710b);}(_0xa408,0x92));var _0x8a40=function(_0x104a84,_0x285970){_0x104a84=_0x104a84-0x0;var _0x4973ff=_0xa408[_0x104a84];return _0x4973ff;};'use strict';var express=require(_0x8a40('0x0'));var router=express[_0x8a40('0x1')]();var auth=require(_0x8a40('0x2'));var controller=require(_0x8a40('0x3'));router[_0x8a40('0x4')]('/',auth[_0x8a40('0x5')](),controller[_0x8a40('0x6')]);router['get'](_0x8a40('0x7'),auth['isAuthenticated'](),controller[_0x8a40('0x8')]);module[_0x8a40('0x9')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 739a176..3b3456b 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 _0x4053=['components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','../../config/logger','api','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','killProcess'];(function(_0x20d90d,_0x3b88da){var _0x10b85e=function(_0x2bb1d0){while(--_0x2bb1d0){_0x20d90d['push'](_0x20d90d['shift']());}};_0x10b85e(++_0x3b88da);}(_0x4053,0xd7));var _0x3405=function(_0x331b08,_0x2c5937){_0x331b08=_0x331b08-0x0;var _0x5034d9=_0x4053[_0x331b08];return _0x5034d9;};'use strict';var info=require(_0x3405('0x0'));var exec=require(_0x3405('0x1'))[_0x3405('0x2')];var logger=require(_0x3405('0x3'))(_0x3405('0x4'));var util=require(_0x3405('0x5'));var BPromise=require('bluebird');var _=require(_0x3405('0x6'));function handleError(_0x31cfde,_0x3204bd,_0xa3d605){_0x3204bd=_0x3204bd||0x1f4;return function(_0x4f762d){logger['error'](_0x3405('0x7'),_0xa3d605,_0x3204bd,util[_0x3405('0x8')](_0x4f762d,{'showHidden':![],'depth':null}));delete _0x4f762d[_0x3405('0x9')];_0x31cfde[_0x3405('0xa')](_0x3204bd)[_0x3405('0xb')](_0x4f762d);};}exports[_0x3405('0xc')]=function(_0x2b70f1,_0x48f655){return info[_0x3405('0xd')]()[_0x3405('0xe')](function(_0x437403){return _0x48f655[_0x3405('0xa')](0xc8)[_0x3405('0xf')](_0x437403);})['catch'](function(_0xa50208){return _0x48f655['status'](0x1f4)[_0x3405('0xf')](_0xa50208);});};exports[_0x3405('0x10')]=function(_0x179319,_0x2b6141){var _0x45800f=[_0x3405('0x11')];return new BPromise(function(_0x3538e7,_0x1f69ab){return exec(util[_0x3405('0x12')](_0x3405('0x13'),_0x179319[_0x3405('0x14')]['pid']),function(_0x1c3013,_0x21bd02,_0x3beab5){if(_0x1c3013){return _0x1f69ab(_0x1c3013);}return _0x3538e7(_0x21bd02);});})['then'](function(_0x4c3144){var _0x464673=![];var _0x39582e=_0x4c3144[_0x3405('0x15')](/\n/);for(var _0x33bbf1=0x0,_0x28a854=_0x45800f[_0x3405('0x16')];_0x33bbf1<_0x28a854,_0x464673===![];_0x33bbf1+=0x1){if(_0x4c3144[_0x3405('0x17')](_0x45800f[_0x33bbf1])>=0x0){_0x464673=!![];}}if(!_0x464673){throw new Error(util[_0x3405('0x12')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x179319[_0x3405('0x14')][_0x3405('0x18')]));}process[_0x3405('0x19')](_0x179319[_0x3405('0x14')][_0x3405('0x18')],_0x3405('0x1a'));return _0x2b6141[_0x3405('0xa')](0xc8)[_0x3405('0xf')]({'message':util[_0x3405('0x12')](_0x3405('0x1b'),_0x179319[_0x3405('0x14')][_0x3405('0x18')])});})[_0x3405('0x1c')](handleError(_0x2b6141,null,_0x3405('0x10')));}; \ No newline at end of file +var _0xa986=['name','status','send','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect'];(function(_0x308157,_0x9a4eb2){var _0x37303e=function(_0x5ebe48){while(--_0x5ebe48){_0x308157['push'](_0x308157['shift']());}};_0x37303e(++_0x9a4eb2);}(_0xa986,0x1a8));var _0x6a98=function(_0x20a9e7,_0x1f2a2a){_0x20a9e7=_0x20a9e7-0x0;var _0x49e927=_0xa986[_0x20a9e7];return _0x49e927;};'use strict';var info=require(_0x6a98('0x0'));var exec=require(_0x6a98('0x1'))[_0x6a98('0x2')];var logger=require('../../config/logger')('api');var util=require(_0x6a98('0x3'));var BPromise=require(_0x6a98('0x4'));var _=require(_0x6a98('0x5'));function handleError(_0x5a6797,_0x13eecd,_0x30fac3){_0x13eecd=_0x13eecd||0x1f4;return function(_0x562c8c){logger['error'](_0x6a98('0x6'),_0x30fac3,_0x13eecd,util[_0x6a98('0x7')](_0x562c8c,{'showHidden':![],'depth':null}));delete _0x562c8c[_0x6a98('0x8')];_0x5a6797[_0x6a98('0x9')](_0x13eecd)[_0x6a98('0xa')](_0x562c8c);};}exports['index']=function(_0x43ccb9,_0x4c6726){return info[_0x6a98('0xb')]()[_0x6a98('0xc')](function(_0x4c5b82){return _0x4c6726[_0x6a98('0x9')](0xc8)[_0x6a98('0xd')](_0x4c5b82);})[_0x6a98('0xe')](function(_0x3b7b76){return _0x4c6726[_0x6a98('0x9')](0x1f4)[_0x6a98('0xd')](_0x3b7b76);});};exports[_0x6a98('0xf')]=function(_0x5c5e89,_0xffa22b){var _0x18bc4a=[_0x6a98('0x10')];return new BPromise(function(_0xe1bb01,_0x35d819){return exec(util[_0x6a98('0x11')](_0x6a98('0x12'),_0x5c5e89[_0x6a98('0x13')][_0x6a98('0x14')]),function(_0x45da07,_0x501b8b,_0x578f4a){if(_0x45da07){return _0x35d819(_0x45da07);}return _0xe1bb01(_0x501b8b);});})[_0x6a98('0xc')](function(_0x30da0d){var _0x1fd7d3=![];var _0x3dc4ee=_0x30da0d['split'](/\n/);for(var _0x418210=0x0,_0x39e45b=_0x18bc4a[_0x6a98('0x15')];_0x418210<_0x39e45b,_0x1fd7d3===![];_0x418210+=0x1){if(_0x30da0d[_0x6a98('0x16')](_0x18bc4a[_0x418210])>=0x0){_0x1fd7d3=!![];}}if(!_0x1fd7d3){throw new Error(util[_0x6a98('0x11')](_0x6a98('0x17'),_0x5c5e89[_0x6a98('0x13')][_0x6a98('0x14')]));}process[_0x6a98('0x18')](_0x5c5e89[_0x6a98('0x13')][_0x6a98('0x14')],_0x6a98('0x19'));return _0xffa22b[_0x6a98('0x9')](0xc8)[_0x6a98('0xd')]({'message':util['format'](_0x6a98('0x1a'),_0x5c5e89[_0x6a98('0x13')][_0x6a98('0x14')])});})[_0x6a98('0xe')](handleError(_0xffa22b,null,_0x6a98('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 01ac696..d138025 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 _0xacfd=['fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','Router'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xacfd,0x119));var _0xdacf=function(_0x134c14,_0x52bdbb){_0x134c14=_0x134c14-0x0;var _0xbfdc67=_0xacfd[_0x134c14];return _0xbfdc67;};'use strict';var multer=require(_0xdacf('0x0'));var util=require(_0xdacf('0x1'));var path=require('path');var timeout=require(_0xdacf('0x2'));var express=require('express');var router=express[_0xdacf('0x3')]();var fs_extra=require(_0xdacf('0x4'));var auth=require(_0xdacf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdacf('0x6'));var controller=require(_0xdacf('0x7'));router[_0xdacf('0x8')]('/',auth['isAuthenticated'](),controller[_0xdacf('0x9')]);router['get']('/:id',auth[_0xdacf('0xa')](),controller[_0xdacf('0xb')]);router[_0xdacf('0xc')]('/',auth['isAuthenticated'](),controller[_0xdacf('0xd')]);router[_0xdacf('0xe')](_0xdacf('0xf'),auth[_0xdacf('0xa')](),controller[_0xdacf('0x10')]);router[_0xdacf('0x11')](_0xdacf('0xf'),auth[_0xdacf('0xa')](),controller[_0xdacf('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb072=['update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0xb072,0x1a7));var _0x2b07=function(_0x2d6346,_0x5a58b2){_0x2d6346=_0x2d6346-0x0;var _0x23aee5=_0xb072[_0x2d6346];return _0x23aee5;};'use strict';var multer=require(_0x2b07('0x0'));var util=require(_0x2b07('0x1'));var path=require('path');var timeout=require(_0x2b07('0x2'));var express=require(_0x2b07('0x3'));var router=express[_0x2b07('0x4')]();var fs_extra=require(_0x2b07('0x5'));var auth=require(_0x2b07('0x6'));var interaction=require(_0x2b07('0x7'));var config=require(_0x2b07('0x8'));var controller=require(_0x2b07('0x9'));router[_0x2b07('0xa')]('/',auth[_0x2b07('0xb')](),controller['index']);router[_0x2b07('0xa')](_0x2b07('0xc'),auth['isAuthenticated'](),controller[_0x2b07('0xd')]);router[_0x2b07('0xe')]('/',auth['isAuthenticated'](),controller[_0x2b07('0xf')]);router[_0x2b07('0x10')](_0x2b07('0xc'),auth[_0x2b07('0xb')](),controller[_0x2b07('0x11')]);router['delete']('/:id',auth[_0x2b07('0xb')](),controller[_0x2b07('0x12')]);module[_0x2b07('0x13')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index f9cbba1..d86dc15 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 _0x4ca7=['exports','STRING','#0091EA','sequelize'];(function(_0x130879,_0x23f0bd){var _0x4ad51c=function(_0x5278b8){while(--_0x5278b8){_0x130879['push'](_0x130879['shift']());}};_0x4ad51c(++_0x23f0bd);}(_0x4ca7,0x1e3));var _0x74ca=function(_0x20a8c3,_0x272949){_0x20a8c3=_0x20a8c3-0x0;var _0x1123e1=_0x4ca7[_0x20a8c3];return _0x1123e1;};'use strict';var Sequelize=require(_0x74ca('0x0'));module[_0x74ca('0x1')]={'name':{'type':Sequelize[_0x74ca('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x74ca('0x2')],'defaultValue':_0x74ca('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf7b4=['name','STRING','sequelize'];(function(_0x3104e5,_0x534338){var _0x215936=function(_0x5a49c6){while(--_0x5a49c6){_0x3104e5['push'](_0x3104e5['shift']());}};_0x215936(++_0x534338);}(_0xf7b4,0x152));var _0x4f7b=function(_0x908ebc,_0x356592){_0x908ebc=_0x908ebc-0x0;var _0x30c9e6=_0xf7b4[_0x908ebc];return _0x30c9e6;};'use strict';var Sequelize=require(_0x4f7b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4f7b('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x4f7b('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 7ad663c..de31c9b 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 _0x5b02=['sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','get','Tags','UserProfileResource','destroy','error','stack','name','send','index','Tag','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x94fa14,_0x130b69){var _0x247b1f=function(_0x4eee2f){while(--_0x4eee2f){_0x94fa14['push'](_0x94fa14['shift']());}};_0x247b1f(++_0x130b69);}(_0x5b02,0xe9));var _0x25b0=function(_0x37a90f,_0x1ab3b7){_0x37a90f=_0x37a90f-0x0;var _0x2efc9b=_0x5b02[_0x37a90f];return _0x2efc9b;};'use strict';var emlformat=require(_0x25b0('0x0'));var rimraf=require(_0x25b0('0x1'));var zipdir=require(_0x25b0('0x2'));var jsonpatch=require(_0x25b0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x25b0('0x4'));var Mustache=require('mustache');var util=require(_0x25b0('0x5'));var path=require(_0x25b0('0x6'));var sox=require(_0x25b0('0x7'));var csv=require(_0x25b0('0x8'));var ejs=require(_0x25b0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25b0('0xa'));var squel=require(_0x25b0('0xb'));var crypto=require('crypto');var jsforce=require(_0x25b0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x25b0('0xd'));var Papa=require(_0x25b0('0xe'));var Redis=require(_0x25b0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b0('0x10'));var as=require(_0x25b0('0x11'));var hardwareService=require(_0x25b0('0x12'));var logger=require(_0x25b0('0x13'))(_0x25b0('0x14'));var utils=require(_0x25b0('0x15'));var config=require(_0x25b0('0x16'));var licenseUtil=require(_0x25b0('0x17'));var db=require(_0x25b0('0x18'))['db'];function respondWithStatusCode(_0x1d3178,_0x184452){_0x184452=_0x184452||0xcc;return function(_0x26a34f){if(_0x26a34f){return _0x1d3178[_0x25b0('0x19')](_0x184452);}return _0x1d3178[_0x25b0('0x1a')](_0x184452)[_0x25b0('0x1b')]();};}function respondWithResult(_0x42cc07,_0x293203){_0x293203=_0x293203||0xc8;return function(_0x211658){if(_0x211658){return _0x42cc07[_0x25b0('0x1a')](_0x293203)[_0x25b0('0x1c')](_0x211658);}};}function respondWithFilteredResult(_0x40071c,_0x5ac18d){return function(_0x51542b){if(_0x51542b){var _0xfe1ea6=typeof _0x5ac18d['offset']===_0x25b0('0x1d')&&typeof _0x5ac18d[_0x25b0('0x1e')]===_0x25b0('0x1d');var _0x3267b9=_0x51542b['count'];var _0x1d850f=_0xfe1ea6?0x0:_0x5ac18d[_0x25b0('0x1f')];var _0x20762e=_0xfe1ea6?_0x51542b[_0x25b0('0x20')]:_0x5ac18d[_0x25b0('0x1f')]+_0x5ac18d[_0x25b0('0x1e')];var _0x54f458;if(_0x20762e>=_0x3267b9){_0x20762e=_0x3267b9;_0x54f458=0xc8;}else{_0x54f458=0xce;}_0x40071c[_0x25b0('0x1a')](_0x54f458);return _0x40071c[_0x25b0('0x21')](_0x25b0('0x22'),_0x1d850f+'-'+_0x20762e+'/'+_0x3267b9)[_0x25b0('0x1c')](_0x51542b);}return null;};}function patchUpdates(_0x1dc691){return function(_0xea4162){try{jsonpatch[_0x25b0('0x23')](_0xea4162,_0x1dc691,!![]);}catch(_0x19599b){return BPromise[_0x25b0('0x24')](_0x19599b);}return _0xea4162[_0x25b0('0x25')]();};}function saveUpdates(_0x2b2eda,_0x3ce1da){return function(_0x5cb746){if(_0x5cb746){return _0x5cb746[_0x25b0('0x26')](_0x2b2eda)[_0x25b0('0x27')](function(_0x517ec5){return _0x517ec5;});}return null;};}function removeEntity(_0x2d7c17,_0x2023d8){return function(_0x3546f0){if(_0x3546f0){return _0x3546f0['destroy']()['then'](function(){var _0x50089e=_0x3546f0[_0x25b0('0x28')]({'plain':!![]});var _0x433085=_0x25b0('0x29');return db[_0x25b0('0x2a')][_0x25b0('0x2b')]({'where':{'type':_0x433085,'resourceId':_0x50089e['id']}})[_0x25b0('0x27')](function(){return _0x3546f0;});})[_0x25b0('0x27')](function(){_0x2d7c17[_0x25b0('0x1a')](0xcc)[_0x25b0('0x1b')]();});}};}function handleEntityNotFound(_0x596d14,_0x2ea408){return function(_0xbfba84){if(!_0xbfba84){_0x596d14['sendStatus'](0x194);}return _0xbfba84;};}function handleError(_0x567775,_0x5de43d){_0x5de43d=_0x5de43d||0x1f4;return function(_0x1a6212){logger[_0x25b0('0x2c')](_0x1a6212[_0x25b0('0x2d')]);if(_0x1a6212[_0x25b0('0x2e')]){delete _0x1a6212[_0x25b0('0x2e')];}_0x567775[_0x25b0('0x1a')](_0x5de43d)[_0x25b0('0x2f')](_0x1a6212);};}exports[_0x25b0('0x30')]=function(_0x36b81d,_0x285a2b){var _0x1e217c={},_0x3161c1={},_0x1ea374={'count':0x0,'rows':[]};var _0x4f640f=_['map'](db[_0x25b0('0x31')]['rawAttributes'],function(_0x4dfeea){return{'name':_0x4dfeea[_0x25b0('0x32')],'type':_0x4dfeea[_0x25b0('0x33')][_0x25b0('0x34')]};});_0x3161c1[_0x25b0('0x35')]=_[_0x25b0('0x36')](_0x4f640f,'name');_0x3161c1[_0x25b0('0x37')]=_[_0x25b0('0x38')](_0x36b81d['query']);_0x3161c1[_0x25b0('0x39')]=_[_0x25b0('0x3a')](_0x3161c1['model'],_0x3161c1[_0x25b0('0x37')]);_0x1e217c['attributes']=_[_0x25b0('0x3a')](_0x3161c1[_0x25b0('0x35')],qs[_0x25b0('0x3b')](_0x36b81d[_0x25b0('0x37')][_0x25b0('0x3b')]));_0x1e217c[_0x25b0('0x3c')]=_0x1e217c[_0x25b0('0x3c')][_0x25b0('0x3d')]?_0x1e217c[_0x25b0('0x3c')]:_0x3161c1['model'];if(!_0x36b81d[_0x25b0('0x37')][_0x25b0('0x3e')](_0x25b0('0x3f'))){_0x1e217c[_0x25b0('0x1e')]=qs[_0x25b0('0x1e')](_0x36b81d[_0x25b0('0x37')][_0x25b0('0x1e')]);_0x1e217c[_0x25b0('0x1f')]=qs[_0x25b0('0x1f')](_0x36b81d[_0x25b0('0x37')]['offset']);}_0x1e217c[_0x25b0('0x40')]=qs[_0x25b0('0x41')](_0x36b81d[_0x25b0('0x37')]['sort']);_0x1e217c[_0x25b0('0x42')]=qs[_0x25b0('0x39')](_[_0x25b0('0x43')](_0x36b81d[_0x25b0('0x37')],_0x3161c1[_0x25b0('0x39')]),_0x4f640f);if(_0x36b81d[_0x25b0('0x37')][_0x25b0('0x44')]){_0x1e217c[_0x25b0('0x42')]=_['merge'](_0x1e217c['where'],{'$or':_[_0x25b0('0x36')](_0x4f640f,function(_0x30d1e3){if(_0x30d1e3[_0x25b0('0x33')]!=='VIRTUAL'){var _0x9c6ab4={};_0x9c6ab4[_0x30d1e3['name']]={'$like':'%'+_0x36b81d[_0x25b0('0x37')][_0x25b0('0x44')]+'%'};return _0x9c6ab4;}})});}_0x1e217c=_[_0x25b0('0x45')]({},_0x1e217c,_0x36b81d[_0x25b0('0x46')]);var _0x8a2eeb={'where':_0x1e217c['where']};return db[_0x25b0('0x31')][_0x25b0('0x20')](_0x8a2eeb)[_0x25b0('0x27')](function(_0x376d8a){_0x1ea374[_0x25b0('0x20')]=_0x376d8a;if(_0x36b81d['query'][_0x25b0('0x47')]){_0x1e217c[_0x25b0('0x48')]=[{'all':!![]}];}return db[_0x25b0('0x31')][_0x25b0('0x49')](_0x1e217c);})[_0x25b0('0x27')](function(_0x1adf8d){_0x1ea374[_0x25b0('0x4a')]=_0x1adf8d;return _0x1ea374;})[_0x25b0('0x27')](respondWithFilteredResult(_0x285a2b,_0x1e217c))[_0x25b0('0x4b')](handleError(_0x285a2b,null));};exports[_0x25b0('0x4c')]=function(_0x124d4b,_0x5186cc){var _0x13e2cf={'raw':!![],'where':{'id':_0x124d4b[_0x25b0('0x4d')]['id']}},_0x5cb047={};_0x5cb047[_0x25b0('0x35')]=_[_0x25b0('0x38')](db[_0x25b0('0x31')]['rawAttributes']);_0x5cb047[_0x25b0('0x37')]=_[_0x25b0('0x38')](_0x124d4b[_0x25b0('0x37')]);_0x5cb047['filters']=_[_0x25b0('0x3a')](_0x5cb047[_0x25b0('0x35')],_0x5cb047[_0x25b0('0x37')]);_0x13e2cf[_0x25b0('0x3c')]=_[_0x25b0('0x3a')](_0x5cb047[_0x25b0('0x35')],qs[_0x25b0('0x3b')](_0x124d4b['query'][_0x25b0('0x3b')]));_0x13e2cf[_0x25b0('0x3c')]=_0x13e2cf[_0x25b0('0x3c')]['length']?_0x13e2cf[_0x25b0('0x3c')]:_0x5cb047[_0x25b0('0x35')];if(_0x124d4b[_0x25b0('0x37')][_0x25b0('0x47')]){_0x13e2cf[_0x25b0('0x48')]=[{'all':!![]}];}_0x13e2cf=_['merge']({},_0x13e2cf,_0x124d4b[_0x25b0('0x46')]);return db[_0x25b0('0x31')][_0x25b0('0x4e')](_0x13e2cf)['then'](handleEntityNotFound(_0x5186cc,null))[_0x25b0('0x27')](respondWithResult(_0x5186cc,null))[_0x25b0('0x4b')](handleError(_0x5186cc,null));};exports[_0x25b0('0x4f')]=function(_0x1d6d55,_0x29165e){return db[_0x25b0('0x31')]['create'](_0x1d6d55['body'],{})['then'](function(_0x1eb908){var _0x4bd7ba=_0x1d6d55['user'][_0x25b0('0x28')]({'plain':!![]});if(!_0x4bd7ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bd7ba[_0x25b0('0x50')]==='user'){var _0x4fc22d=_0x1eb908[_0x25b0('0x28')]({'plain':!![]});var _0x14a8a7=_0x25b0('0x29');return db[_0x25b0('0x51')][_0x25b0('0x4e')]({'where':{'name':_0x14a8a7,'userProfileId':_0x4bd7ba[_0x25b0('0x52')]},'raw':!![]})[_0x25b0('0x27')](function(_0x2d5522){if(_0x2d5522&&_0x2d5522[_0x25b0('0x53')]===0x0){return db[_0x25b0('0x2a')]['create']({'name':_0x4fc22d['name'],'resourceId':_0x4fc22d['id'],'type':_0x2d5522['name'],'sectionId':_0x2d5522['id']},{})[_0x25b0('0x27')](function(){return _0x1eb908;});}else{return _0x1eb908;}})[_0x25b0('0x4b')](function(_0x2a28fb){logger[_0x25b0('0x2c')](_0x25b0('0x54'),_0x2a28fb);throw _0x2a28fb;});}return _0x1eb908;})[_0x25b0('0x27')](respondWithResult(_0x29165e,0xc9))[_0x25b0('0x4b')](handleError(_0x29165e,null));};exports['update']=function(_0x64ffa3,_0x4a8adc){if(_0x64ffa3[_0x25b0('0x55')]['id']){delete _0x64ffa3['body']['id'];}return db['Tag'][_0x25b0('0x4e')]({'where':{'id':_0x64ffa3['params']['id']}})['then'](handleEntityNotFound(_0x4a8adc,null))[_0x25b0('0x27')](saveUpdates(_0x64ffa3[_0x25b0('0x55')],null))[_0x25b0('0x27')](respondWithResult(_0x4a8adc,null))[_0x25b0('0x4b')](handleError(_0x4a8adc,null));};exports[_0x25b0('0x2b')]=function(_0x367d57,_0x8bbdb3){return db[_0x25b0('0x31')][_0x25b0('0x4e')]({'where':{'id':_0x367d57[_0x25b0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x8bbdb3,null))['then'](removeEntity(_0x8bbdb3,null))[_0x25b0('0x4b')](handleError(_0x8bbdb3,null));}; \ No newline at end of file +var _0x9099=['includeAll','findAll','rows','catch','show','keys','length','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','UserProfileResource','update','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','then','get','Tags','destroy','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x25656f,_0x4cf8be){var _0x6e703f=function(_0x334697){while(--_0x334697){_0x25656f['push'](_0x25656f['shift']());}};_0x6e703f(++_0x4cf8be);}(_0x9099,0x1ac));var _0x9909=function(_0x29ce14,_0x334166){_0x29ce14=_0x29ce14-0x0;var _0x48f289=_0x9099[_0x29ce14];return _0x48f289;};'use strict';var emlformat=require(_0x9909('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9909('0x1'));var jsonpatch=require(_0x9909('0x2'));var rp=require(_0x9909('0x3'));var moment=require(_0x9909('0x4'));var BPromise=require(_0x9909('0x5'));var Mustache=require(_0x9909('0x6'));var util=require(_0x9909('0x7'));var path=require(_0x9909('0x8'));var sox=require(_0x9909('0x9'));var csv=require(_0x9909('0xa'));var ejs=require(_0x9909('0xb'));var fs=require('fs');var fs_extra=require(_0x9909('0xc'));var _=require(_0x9909('0xd'));var squel=require(_0x9909('0xe'));var crypto=require('crypto');var jsforce=require(_0x9909('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9909('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9909('0x11'));var as=require(_0x9909('0x12'));var hardwareService=require(_0x9909('0x13'));var logger=require('../../config/logger')(_0x9909('0x14'));var utils=require('../../config/utils');var config=require(_0x9909('0x15'));var licenseUtil=require(_0x9909('0x16'));var db=require(_0x9909('0x17'))['db'];function respondWithStatusCode(_0x3ba080,_0x1c69bb){_0x1c69bb=_0x1c69bb||0xcc;return function(_0x5cc11e){if(_0x5cc11e){return _0x3ba080[_0x9909('0x18')](_0x1c69bb);}return _0x3ba080[_0x9909('0x19')](_0x1c69bb)[_0x9909('0x1a')]();};}function respondWithResult(_0xef3295,_0x1c2668){_0x1c2668=_0x1c2668||0xc8;return function(_0x38c2e3){if(_0x38c2e3){return _0xef3295[_0x9909('0x19')](_0x1c2668)['json'](_0x38c2e3);}};}function respondWithFilteredResult(_0x33a8e3,_0x55e800){return function(_0x1f32cc){if(_0x1f32cc){var _0x5bd7e7=typeof _0x55e800[_0x9909('0x1b')]===_0x9909('0x1c')&&typeof _0x55e800[_0x9909('0x1d')]==='undefined';var _0x9a16a6=_0x1f32cc[_0x9909('0x1e')];var _0x180929=_0x5bd7e7?0x0:_0x55e800[_0x9909('0x1b')];var _0x1106e5=_0x5bd7e7?_0x1f32cc[_0x9909('0x1e')]:_0x55e800[_0x9909('0x1b')]+_0x55e800['limit'];var _0x1b038f;if(_0x1106e5>=_0x9a16a6){_0x1106e5=_0x9a16a6;_0x1b038f=0xc8;}else{_0x1b038f=0xce;}_0x33a8e3[_0x9909('0x19')](_0x1b038f);return _0x33a8e3['set'](_0x9909('0x1f'),_0x180929+'-'+_0x1106e5+'/'+_0x9a16a6)[_0x9909('0x20')](_0x1f32cc);}return null;};}function patchUpdates(_0x20c236){return function(_0x1553ae){try{jsonpatch[_0x9909('0x21')](_0x1553ae,_0x20c236,!![]);}catch(_0x222cd9){return BPromise[_0x9909('0x22')](_0x222cd9);}return _0x1553ae['save']();};}function saveUpdates(_0x112727,_0x319c31){return function(_0x4a626b){if(_0x4a626b){return _0x4a626b['update'](_0x112727)[_0x9909('0x23')](function(_0x176593){return _0x176593;});}return null;};}function removeEntity(_0xdd5088,_0x19e66b){return function(_0x2f15fa){if(_0x2f15fa){return _0x2f15fa['destroy']()['then'](function(){var _0x2d83a5=_0x2f15fa[_0x9909('0x24')]({'plain':!![]});var _0x614308=_0x9909('0x25');return db['UserProfileResource'][_0x9909('0x26')]({'where':{'type':_0x614308,'resourceId':_0x2d83a5['id']}})[_0x9909('0x23')](function(){return _0x2f15fa;});})[_0x9909('0x23')](function(){_0xdd5088[_0x9909('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x405c5e,_0x22ff12){return function(_0x19c7e8){if(!_0x19c7e8){_0x405c5e[_0x9909('0x18')](0x194);}return _0x19c7e8;};}function handleError(_0x5250d8,_0xb0b66f){_0xb0b66f=_0xb0b66f||0x1f4;return function(_0x175d52){logger[_0x9909('0x27')](_0x175d52[_0x9909('0x28')]);if(_0x175d52[_0x9909('0x29')]){delete _0x175d52[_0x9909('0x29')];}_0x5250d8[_0x9909('0x19')](_0xb0b66f)['send'](_0x175d52);};}exports[_0x9909('0x2a')]=function(_0x3a3f4f,_0x87ac8a){var _0x42f1e5={},_0x3e4e07={},_0x519066={'count':0x0,'rows':[]};var _0x4245eb=_[_0x9909('0x2b')](db[_0x9909('0x2c')][_0x9909('0x2d')],function(_0xc1bd06){return{'name':_0xc1bd06[_0x9909('0x2e')],'type':_0xc1bd06[_0x9909('0x2f')][_0x9909('0x30')]};});_0x3e4e07['model']=_['map'](_0x4245eb,_0x9909('0x29'));_0x3e4e07[_0x9909('0x31')]=_['keys'](_0x3a3f4f[_0x9909('0x31')]);_0x3e4e07[_0x9909('0x32')]=_[_0x9909('0x33')](_0x3e4e07[_0x9909('0x34')],_0x3e4e07[_0x9909('0x31')]);_0x42f1e5[_0x9909('0x35')]=_[_0x9909('0x33')](_0x3e4e07['model'],qs[_0x9909('0x36')](_0x3a3f4f[_0x9909('0x31')][_0x9909('0x36')]));_0x42f1e5[_0x9909('0x35')]=_0x42f1e5[_0x9909('0x35')]['length']?_0x42f1e5[_0x9909('0x35')]:_0x3e4e07[_0x9909('0x34')];if(!_0x3a3f4f['query'][_0x9909('0x37')](_0x9909('0x38'))){_0x42f1e5[_0x9909('0x1d')]=qs[_0x9909('0x1d')](_0x3a3f4f[_0x9909('0x31')][_0x9909('0x1d')]);_0x42f1e5['offset']=qs[_0x9909('0x1b')](_0x3a3f4f[_0x9909('0x31')][_0x9909('0x1b')]);}_0x42f1e5[_0x9909('0x39')]=qs[_0x9909('0x3a')](_0x3a3f4f[_0x9909('0x31')][_0x9909('0x3a')]);_0x42f1e5[_0x9909('0x3b')]=qs[_0x9909('0x32')](_[_0x9909('0x3c')](_0x3a3f4f[_0x9909('0x31')],_0x3e4e07[_0x9909('0x32')]),_0x4245eb);if(_0x3a3f4f[_0x9909('0x31')][_0x9909('0x3d')]){_0x42f1e5[_0x9909('0x3b')]=_[_0x9909('0x3e')](_0x42f1e5[_0x9909('0x3b')],{'$or':_[_0x9909('0x2b')](_0x4245eb,function(_0x1b5e2b){if(_0x1b5e2b[_0x9909('0x2f')]!==_0x9909('0x3f')){var _0x1b224d={};_0x1b224d[_0x1b5e2b[_0x9909('0x29')]]={'$like':'%'+_0x3a3f4f['query']['filter']+'%'};return _0x1b224d;}})});}_0x42f1e5=_[_0x9909('0x3e')]({},_0x42f1e5,_0x3a3f4f['options']);var _0x52724f={'where':_0x42f1e5[_0x9909('0x3b')]};return db[_0x9909('0x2c')][_0x9909('0x1e')](_0x52724f)[_0x9909('0x23')](function(_0x556fad){_0x519066[_0x9909('0x1e')]=_0x556fad;if(_0x3a3f4f[_0x9909('0x31')][_0x9909('0x40')]){_0x42f1e5['include']=[{'all':!![]}];}return db[_0x9909('0x2c')][_0x9909('0x41')](_0x42f1e5);})[_0x9909('0x23')](function(_0x4b0a4c){_0x519066[_0x9909('0x42')]=_0x4b0a4c;return _0x519066;})[_0x9909('0x23')](respondWithFilteredResult(_0x87ac8a,_0x42f1e5))[_0x9909('0x43')](handleError(_0x87ac8a,null));};exports[_0x9909('0x44')]=function(_0x1f57bd,_0x856057){var _0xef5aa6={'raw':!![],'where':{'id':_0x1f57bd['params']['id']}},_0x3b1844={};_0x3b1844[_0x9909('0x34')]=_[_0x9909('0x45')](db['Tag'][_0x9909('0x2d')]);_0x3b1844[_0x9909('0x31')]=_['keys'](_0x1f57bd['query']);_0x3b1844[_0x9909('0x32')]=_[_0x9909('0x33')](_0x3b1844[_0x9909('0x34')],_0x3b1844[_0x9909('0x31')]);_0xef5aa6[_0x9909('0x35')]=_[_0x9909('0x33')](_0x3b1844[_0x9909('0x34')],qs[_0x9909('0x36')](_0x1f57bd[_0x9909('0x31')][_0x9909('0x36')]));_0xef5aa6['attributes']=_0xef5aa6[_0x9909('0x35')][_0x9909('0x46')]?_0xef5aa6[_0x9909('0x35')]:_0x3b1844[_0x9909('0x34')];if(_0x1f57bd['query']['includeAll']){_0xef5aa6[_0x9909('0x47')]=[{'all':!![]}];}_0xef5aa6=_['merge']({},_0xef5aa6,_0x1f57bd[_0x9909('0x48')]);return db[_0x9909('0x2c')][_0x9909('0x49')](_0xef5aa6)['then'](handleEntityNotFound(_0x856057,null))[_0x9909('0x23')](respondWithResult(_0x856057,null))[_0x9909('0x43')](handleError(_0x856057,null));};exports[_0x9909('0x4a')]=function(_0x54152c,_0x271984){return db[_0x9909('0x2c')][_0x9909('0x4a')](_0x54152c[_0x9909('0x4b')],{})[_0x9909('0x23')](function(_0x137fb6){var _0x8fbd0c=_0x54152c['user'][_0x9909('0x24')]({'plain':!![]});if(!_0x8fbd0c)throw new Error(_0x9909('0x4c'));if(_0x8fbd0c['role']===_0x9909('0x4d')){var _0x240947=_0x137fb6[_0x9909('0x24')]({'plain':!![]});var _0x37697d=_0x9909('0x25');return db['UserProfileSection'][_0x9909('0x49')]({'where':{'name':_0x37697d,'userProfileId':_0x8fbd0c['userProfileId']},'raw':!![]})[_0x9909('0x23')](function(_0x159e08){if(_0x159e08&&_0x159e08[_0x9909('0x4e')]===0x0){return db[_0x9909('0x4f')][_0x9909('0x4a')]({'name':_0x240947[_0x9909('0x29')],'resourceId':_0x240947['id'],'type':_0x159e08[_0x9909('0x29')],'sectionId':_0x159e08['id']},{})[_0x9909('0x23')](function(){return _0x137fb6;});}else{return _0x137fb6;}})['catch'](function(_0x51b214){logger[_0x9909('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51b214);throw _0x51b214;});}return _0x137fb6;})['then'](respondWithResult(_0x271984,0xc9))[_0x9909('0x43')](handleError(_0x271984,null));};exports[_0x9909('0x50')]=function(_0x49659a,_0x1144e0){if(_0x49659a[_0x9909('0x4b')]['id']){delete _0x49659a[_0x9909('0x4b')]['id'];}return db[_0x9909('0x2c')][_0x9909('0x49')]({'where':{'id':_0x49659a[_0x9909('0x51')]['id']}})['then'](handleEntityNotFound(_0x1144e0,null))[_0x9909('0x23')](saveUpdates(_0x49659a[_0x9909('0x4b')],null))['then'](respondWithResult(_0x1144e0,null))['catch'](handleError(_0x1144e0,null));};exports[_0x9909('0x26')]=function(_0x508b6a,_0x180cf5){return db[_0x9909('0x2c')][_0x9909('0x49')]({'where':{'id':_0x508b6a[_0x9909('0x51')]['id']}})['then'](handleEntityNotFound(_0x180cf5,null))['then'](removeEntity(_0x180cf5,null))['catch'](handleError(_0x180cf5,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index e848e9d..fd89aca 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 _0x26ed=['Tag','tools_tags','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define'];(function(_0x2e07bd,_0x285a42){var _0x511795=function(_0x55c2fb){while(--_0x55c2fb){_0x2e07bd['push'](_0x2e07bd['shift']());}};_0x511795(++_0x285a42);}(_0x26ed,0x1f0));var _0xd26e=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0x26ed[_0x30cd7e];return _0x462a02;};'use strict';var _=require(_0xd26e('0x0'));var util=require('util');var logger=require(_0xd26e('0x1'))(_0xd26e('0x2'));var moment=require('moment');var BPromise=require(_0xd26e('0x3'));var rp=require(_0xd26e('0x4'));var fs=require('fs');var path=require(_0xd26e('0x5'));var rimraf=require(_0xd26e('0x6'));var config=require(_0xd26e('0x7'));var attributes=require(_0xd26e('0x8'));module[_0xd26e('0x9')]=function(_0x260b31,_0x4b94f3){return _0x260b31[_0xd26e('0xa')](_0xd26e('0xb'),attributes,{'tableName':_0xd26e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5fc=['define','Tag','tools_tags','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./tag.attributes','exports'];(function(_0x3727d3,_0x48ee26){var _0x400020=function(_0x659fe3){while(--_0x659fe3){_0x3727d3['push'](_0x3727d3['shift']());}};_0x400020(++_0x48ee26);}(_0xb5fc,0x1e3));var _0xcb5f=function(_0x2cb7c8,_0x3ae9ed){_0x2cb7c8=_0x2cb7c8-0x0;var _0x554d91=_0xb5fc[_0x2cb7c8];return _0x554d91;};'use strict';var _=require(_0xcb5f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcb5f('0x1'));var moment=require(_0xcb5f('0x2'));var BPromise=require(_0xcb5f('0x3'));var rp=require(_0xcb5f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb5f('0x5'));var config=require(_0xcb5f('0x6'));var attributes=require(_0xcb5f('0x7'));module[_0xcb5f('0x8')]=function(_0x366cf3,_0xc97300){return _0x366cf3[_0xcb5f('0x9')](_0xcb5f('0xa'),attributes,{'tableName':_0xcb5f('0xb'),'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 ef28351..0fa14d1 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 _0xd691=['jayson/promise','client','http','request','then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3d8c36,_0x4cf4e7){var _0x3856f2=function(_0xf0c8c3){while(--_0xf0c8c3){_0x3d8c36['push'](_0x3d8c36['shift']());}};_0x3856f2(++_0x4cf4e7);}(_0xd691,0xe6));var _0x1d69=function(_0x2a1185,_0x2740c5){_0x2a1185=_0x2a1185-0x0;var _0x5588d9=_0xd691[_0x2a1185];return _0x5588d9;};'use strict';var _=require(_0x1d69('0x0'));var util=require(_0x1d69('0x1'));var moment=require(_0x1d69('0x2'));var BPromise=require('bluebird');var rs=require(_0x1d69('0x3'));var fs=require('fs');var Redis=require(_0x1d69('0x4'));var db=require(_0x1d69('0x5'))['db'];var utils=require(_0x1d69('0x6'));var logger=require(_0x1d69('0x7'))(_0x1d69('0x8'));var config=require(_0x1d69('0x9'));var jayson=require(_0x1d69('0xa'));var client=jayson[_0x1d69('0xb')][_0x1d69('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a5b0c,_0x520acb,_0x267da3){return new BPromise(function(_0x49f008,_0x369d44){return client[_0x1d69('0xd')](_0x5a5b0c,_0x267da3)[_0x1d69('0xe')](function(_0x364061){logger['info'](_0x1d69('0xf'),_0x520acb,_0x1d69('0x10'));logger[_0x1d69('0x11')](_0x1d69('0x12'),_0x520acb,_0x1d69('0x10'),JSON['stringify'](_0x364061));if(_0x364061['error']){if(_0x364061[_0x1d69('0x13')][_0x1d69('0x14')]===0x1f4){logger[_0x1d69('0x13')](_0x1d69('0xf'),_0x520acb,_0x364061[_0x1d69('0x13')][_0x1d69('0x15')]);return _0x369d44(_0x364061[_0x1d69('0x13')][_0x1d69('0x15')]);}logger[_0x1d69('0x13')](_0x1d69('0xf'),_0x520acb,_0x364061[_0x1d69('0x13')][_0x1d69('0x15')]);return _0x49f008(_0x364061[_0x1d69('0x13')]['message']);}else{logger['info'](_0x1d69('0xf'),_0x520acb,_0x1d69('0x10'));_0x49f008(_0x364061[_0x1d69('0x16')][_0x1d69('0x15')]);}})[_0x1d69('0x17')](function(_0x383771){logger['error'](_0x1d69('0xf'),_0x520acb,_0x383771);_0x369d44(_0x383771);});});} \ No newline at end of file +var _0x26c2=['message','info','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','Tag,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xa48af,_0x4d3bb5){var _0x10b6dd=function(_0x22c97c){while(--_0x22c97c){_0xa48af['push'](_0xa48af['shift']());}};_0x10b6dd(++_0x4d3bb5);}(_0x26c2,0x130));var _0x226c=function(_0x2eaf78,_0x416362){_0x2eaf78=_0x2eaf78-0x0;var _0xc39f63=_0x26c2[_0x2eaf78];return _0xc39f63;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x226c('0x0'));var rs=require(_0x226c('0x1'));var fs=require('fs');var Redis=require(_0x226c('0x2'));var db=require(_0x226c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x226c('0x4'))(_0x226c('0x5'));var config=require('../../config/environment');var jayson=require(_0x226c('0x6'));var client=jayson[_0x226c('0x7')][_0x226c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c4e5d,_0x4306c9,_0x59804e){return new BPromise(function(_0x34cbc3,_0x461773){return client[_0x226c('0x9')](_0x3c4e5d,_0x59804e)[_0x226c('0xa')](function(_0x127f10){logger['info'](_0x226c('0xb'),_0x4306c9,_0x226c('0xc'));logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0x4306c9,_0x226c('0xc'),JSON[_0x226c('0xd')](_0x127f10));if(_0x127f10[_0x226c('0xe')]){if(_0x127f10[_0x226c('0xe')][_0x226c('0xf')]===0x1f4){logger[_0x226c('0xe')](_0x226c('0xb'),_0x4306c9,_0x127f10['error']['message']);return _0x461773(_0x127f10[_0x226c('0xe')][_0x226c('0x10')]);}logger[_0x226c('0xe')](_0x226c('0xb'),_0x4306c9,_0x127f10['error']['message']);return _0x34cbc3(_0x127f10[_0x226c('0xe')][_0x226c('0x10')]);}else{logger[_0x226c('0x11')]('Tag,\x20%s,\x20%s',_0x4306c9,'request\x20sent');_0x34cbc3(_0x127f10[_0x226c('0x12')][_0x226c('0x10')]);}})[_0x226c('0x13')](function(_0x45a804){logger[_0x226c('0xe')]('Tag,\x20%s,\x20%s',_0x4306c9,_0x45a804);_0x461773(_0x45a804);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index e6f05c1..81d91ce 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 3f65fd4..ceaab8a 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['exports','STRING'];(function(_0x53a28a,_0x1ffb7d){var _0x178c61=function(_0xe07625){while(--_0xe07625){_0x53a28a['push'](_0x53a28a['shift']());}};_0x178c61(++_0x1ffb7d);}(_0x757a,0xde));var _0xa757=function(_0x399460,_0xea9c34){_0x399460=_0x399460-0x0;var _0x13b7b2=_0x757a[_0x399460];return _0x13b7b2;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 4b18df8..d2363d0 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 _0x82d6=['Whatsapp','sequelize','transaction','through','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','emit','Queue:save','voicePause','UserVoiceQueueRt','SIP/%s','interface','all','spread','removeAgents','parse','Queue:remove','getAgents','nolimit','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','get','Teams','error','stack','name','send','index','map','Team','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','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','getQueues','channel','ValidationError','Unknown\x20channel','toLowerCase','capitalize','Queues','addQueues','findOne','isValidChannel','Sequelize','add','ids','removeQueues','remove','addAgents','Voice','Chat','Sms','Fax','Openchannel'];(function(_0x4aaa6b,_0x14ff31){var _0x529370=function(_0x2d4b03){while(--_0x2d4b03){_0x4aaa6b['push'](_0x4aaa6b['shift']());}};_0x529370(++_0x14ff31);}(_0x82d6,0x9e));var _0x682d=function(_0x183901,_0x5201e1){_0x183901=_0x183901-0x0;var _0x4c6d80=_0x82d6[_0x183901];return _0x4c6d80;};'use strict';var emlformat=require(_0x682d('0x0'));var rimraf=require(_0x682d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x682d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x682d('0x3'));var Mustache=require(_0x682d('0x4'));var util=require(_0x682d('0x5'));var path=require(_0x682d('0x6'));var sox=require(_0x682d('0x7'));var csv=require(_0x682d('0x8'));var ejs=require(_0x682d('0x9'));var fs=require('fs');var fs_extra=require(_0x682d('0xa'));var _=require(_0x682d('0xb'));var squel=require(_0x682d('0xc'));var crypto=require(_0x682d('0xd'));var jsforce=require(_0x682d('0xe'));var deskjs=require(_0x682d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x682d('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x682d('0x11'));var as=require(_0x682d('0x12'));var hardwareService=require(_0x682d('0x13'));var logger=require(_0x682d('0x14'))('api');var utils=require(_0x682d('0x15'));var config=require(_0x682d('0x16'));var licenseUtil=require(_0x682d('0x17'));var db=require(_0x682d('0x18'))['db'];config['redis']=_[_0x682d('0x19')](config['redis'],{'host':_0x682d('0x1a'),'port':0x18eb});var socket=require(_0x682d('0x1b'))(new Redis(config['redis']));require('./team.socket')[_0x682d('0x1c')](socket);function respondWithStatusCode(_0x3881bb,_0xd92b1f){_0xd92b1f=_0xd92b1f||0xcc;return function(_0xfb0393){if(_0xfb0393){return _0x3881bb[_0x682d('0x1d')](_0xd92b1f);}return _0x3881bb['status'](_0xd92b1f)[_0x682d('0x1e')]();};}function respondWithResult(_0x608c79,_0x99b66d){_0x99b66d=_0x99b66d||0xc8;return function(_0x5bd99a){if(_0x5bd99a){return _0x608c79[_0x682d('0x1f')](_0x99b66d)['json'](_0x5bd99a);}};}function respondWithFilteredResult(_0x368501,_0x2f6e99){return function(_0x35991d){if(_0x35991d){var _0x3bd65d=typeof _0x2f6e99[_0x682d('0x20')]==='undefined'&&typeof _0x2f6e99[_0x682d('0x21')]===_0x682d('0x22');var _0x1054b8=_0x35991d[_0x682d('0x23')];var _0x1cfde9=_0x3bd65d?0x0:_0x2f6e99[_0x682d('0x20')];var _0x1afee5=_0x3bd65d?_0x35991d[_0x682d('0x23')]:_0x2f6e99[_0x682d('0x20')]+_0x2f6e99[_0x682d('0x21')];var _0x37d2e;if(_0x1afee5>=_0x1054b8){_0x1afee5=_0x1054b8;_0x37d2e=0xc8;}else{_0x37d2e=0xce;}_0x368501['status'](_0x37d2e);return _0x368501[_0x682d('0x24')]('Content-Range',_0x1cfde9+'-'+_0x1afee5+'/'+_0x1054b8)[_0x682d('0x25')](_0x35991d);}return null;};}function patchUpdates(_0x3c1856){return function(_0x20c72d){try{jsonpatch[_0x682d('0x26')](_0x20c72d,_0x3c1856,!![]);}catch(_0x228d76){return BPromise[_0x682d('0x27')](_0x228d76);}return _0x20c72d[_0x682d('0x28')]();};}function saveUpdates(_0x26c46b,_0x25c939){return function(_0xa5f491){if(_0xa5f491){return _0xa5f491[_0x682d('0x29')](_0x26c46b)[_0x682d('0x2a')](function(_0x16b2de){return _0x16b2de;});}return null;};}function removeEntity(_0xa6f8eb,_0x155eb8){return function(_0x29f983){if(_0x29f983){return _0x29f983[_0x682d('0x2b')]()[_0x682d('0x2a')](function(){var _0xae64d3=_0x29f983[_0x682d('0x2c')]({'plain':!![]});var _0x4a75d6=_0x682d('0x2d');return db['UserProfileResource'][_0x682d('0x2b')]({'where':{'type':_0x4a75d6,'resourceId':_0xae64d3['id']}})[_0x682d('0x2a')](function(){return _0x29f983;});})[_0x682d('0x2a')](function(){_0xa6f8eb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bb172,_0x44ed9c){return function(_0x413a73){if(!_0x413a73){_0x4bb172['sendStatus'](0x194);}return _0x413a73;};}function handleError(_0xc6d24,_0x583e9b){_0x583e9b=_0x583e9b||0x1f4;return function(_0x2abe6f){logger[_0x682d('0x2e')](_0x2abe6f[_0x682d('0x2f')]);if(_0x2abe6f[_0x682d('0x30')]){delete _0x2abe6f[_0x682d('0x30')];}_0xc6d24[_0x682d('0x1f')](_0x583e9b)[_0x682d('0x31')](_0x2abe6f);};}exports[_0x682d('0x32')]=function(_0x4519f2,_0x39da47){var _0x10a6c2={},_0x5c387a={},_0x588aa0={'count':0x0,'rows':[]};var _0x1559a3=_[_0x682d('0x33')](db[_0x682d('0x34')]['rawAttributes'],function(_0x3705fc){return{'name':_0x3705fc[_0x682d('0x35')],'type':_0x3705fc[_0x682d('0x36')][_0x682d('0x37')]};});_0x5c387a['model']=_[_0x682d('0x33')](_0x1559a3,'name');_0x5c387a[_0x682d('0x38')]=_[_0x682d('0x39')](_0x4519f2[_0x682d('0x38')]);_0x5c387a[_0x682d('0x3a')]=_[_0x682d('0x3b')](_0x5c387a[_0x682d('0x3c')],_0x5c387a[_0x682d('0x38')]);_0x10a6c2[_0x682d('0x3d')]=_[_0x682d('0x3b')](_0x5c387a['model'],qs['fields'](_0x4519f2['query'][_0x682d('0x3e')]));_0x10a6c2[_0x682d('0x3d')]=_0x10a6c2[_0x682d('0x3d')][_0x682d('0x3f')]?_0x10a6c2[_0x682d('0x3d')]:_0x5c387a['model'];if(!_0x4519f2[_0x682d('0x38')][_0x682d('0x40')]('nolimit')){_0x10a6c2[_0x682d('0x21')]=qs[_0x682d('0x21')](_0x4519f2[_0x682d('0x38')][_0x682d('0x21')]);_0x10a6c2[_0x682d('0x20')]=qs[_0x682d('0x20')](_0x4519f2[_0x682d('0x38')][_0x682d('0x20')]);}_0x10a6c2[_0x682d('0x41')]=qs[_0x682d('0x42')](_0x4519f2['query'][_0x682d('0x42')]);_0x10a6c2[_0x682d('0x43')]=qs[_0x682d('0x3a')](_[_0x682d('0x44')](_0x4519f2[_0x682d('0x38')],_0x5c387a['filters']),_0x1559a3);if(_0x4519f2['query'][_0x682d('0x45')]){_0x10a6c2[_0x682d('0x43')]=_[_0x682d('0x46')](_0x10a6c2[_0x682d('0x43')],{'$or':_[_0x682d('0x33')](_0x1559a3,function(_0x680efb){if(_0x680efb[_0x682d('0x36')]!==_0x682d('0x47')){var _0x22da06={};_0x22da06[_0x680efb[_0x682d('0x30')]]={'$like':'%'+_0x4519f2['query'][_0x682d('0x45')]+'%'};return _0x22da06;}})});}_0x10a6c2=_[_0x682d('0x46')]({},_0x10a6c2,_0x4519f2[_0x682d('0x48')]);var _0x5a7fbc={'where':_0x10a6c2['where']};return db[_0x682d('0x34')][_0x682d('0x23')](_0x5a7fbc)['then'](function(_0x14b3c1){_0x588aa0[_0x682d('0x23')]=_0x14b3c1;if(_0x4519f2[_0x682d('0x38')][_0x682d('0x49')]){_0x10a6c2[_0x682d('0x4a')]=[{'all':!![]}];}return db[_0x682d('0x34')][_0x682d('0x4b')](_0x10a6c2);})[_0x682d('0x2a')](function(_0x5be6a4){_0x588aa0['rows']=_0x5be6a4;return _0x588aa0;})['then'](respondWithFilteredResult(_0x39da47,_0x10a6c2))[_0x682d('0x4c')](handleError(_0x39da47,null));};exports[_0x682d('0x4d')]=function(_0x349caf,_0x42be81){var _0x51265c={'raw':![],'where':{'id':_0x349caf[_0x682d('0x4e')]['id']}},_0x418b30={};_0x418b30[_0x682d('0x3c')]=_[_0x682d('0x39')](db[_0x682d('0x34')][_0x682d('0x4f')]);_0x418b30[_0x682d('0x38')]=_[_0x682d('0x39')](_0x349caf[_0x682d('0x38')]);_0x418b30['filters']=_[_0x682d('0x3b')](_0x418b30[_0x682d('0x3c')],_0x418b30['query']);_0x51265c[_0x682d('0x3d')]=_['intersection'](_0x418b30[_0x682d('0x3c')],qs[_0x682d('0x3e')](_0x349caf[_0x682d('0x38')]['fields']));_0x51265c['attributes']=_0x51265c[_0x682d('0x3d')][_0x682d('0x3f')]?_0x51265c[_0x682d('0x3d')]:_0x418b30[_0x682d('0x3c')];if(_0x349caf[_0x682d('0x38')][_0x682d('0x49')]){_0x51265c['include']=[{'all':!![]}];}_0x51265c=_['merge']({},_0x51265c,_0x349caf[_0x682d('0x48')]);return db[_0x682d('0x34')][_0x682d('0x50')](_0x51265c)[_0x682d('0x2a')](handleEntityNotFound(_0x42be81,null))[_0x682d('0x2a')](respondWithResult(_0x42be81,null))[_0x682d('0x4c')](handleError(_0x42be81,null));};exports[_0x682d('0x51')]=function(_0x436a38,_0x3626c9){return db['Team'][_0x682d('0x51')](_0x436a38[_0x682d('0x52')],{})[_0x682d('0x2a')](function(_0x24f976){var _0xfa2943=_0x436a38[_0x682d('0x53')]['get']({'plain':!![]});if(!_0xfa2943)throw new Error(_0x682d('0x54'));if(_0xfa2943[_0x682d('0x55')]===_0x682d('0x53')){var _0x38c679=_0x24f976['get']({'plain':!![]});var _0x5b913e=_0x682d('0x2d');return db[_0x682d('0x56')][_0x682d('0x50')]({'where':{'name':_0x5b913e,'userProfileId':_0xfa2943[_0x682d('0x57')]},'raw':!![]})[_0x682d('0x2a')](function(_0x43097b){if(_0x43097b&&_0x43097b[_0x682d('0x58')]===0x0){return db[_0x682d('0x59')][_0x682d('0x51')]({'name':_0x38c679[_0x682d('0x30')],'resourceId':_0x38c679['id'],'type':_0x43097b[_0x682d('0x30')],'sectionId':_0x43097b['id']},{})[_0x682d('0x2a')](function(){return _0x24f976;});}else{return _0x24f976;}})[_0x682d('0x4c')](function(_0x134086){logger[_0x682d('0x2e')](_0x682d('0x5a'),_0x134086);throw _0x134086;});}return _0x24f976;})[_0x682d('0x2a')](respondWithResult(_0x3626c9,0xc9))[_0x682d('0x4c')](handleError(_0x3626c9,null));};exports['update']=function(_0x8c8a2b,_0x5059bb){if(_0x8c8a2b['body']['id']){delete _0x8c8a2b[_0x682d('0x52')]['id'];}return db[_0x682d('0x34')][_0x682d('0x50')]({'where':{'id':_0x8c8a2b[_0x682d('0x4e')]['id']}})[_0x682d('0x2a')](handleEntityNotFound(_0x5059bb,null))[_0x682d('0x2a')](saveUpdates(_0x8c8a2b[_0x682d('0x52')],null))['then'](respondWithResult(_0x5059bb,null))[_0x682d('0x4c')](handleError(_0x5059bb,null));};exports['destroy']=function(_0x238e06,_0x1f3d78){return db[_0x682d('0x34')]['find']({'where':{'id':_0x238e06['params']['id']}})[_0x682d('0x2a')](handleEntityNotFound(_0x1f3d78,null))['then'](removeEntity(_0x1f3d78,null))[_0x682d('0x4c')](handleError(_0x1f3d78,null));};exports[_0x682d('0x5b')]=function(_0x313af0,_0x1ffdfb,_0x40be04){return db[_0x682d('0x34')]['findOne']({'where':{'id':_0x313af0[_0x682d('0x4e')]['id']}})[_0x682d('0x2a')](handleEntityNotFound(_0x1ffdfb,null))[_0x682d('0x2a')](function(_0x32bb12){if(!_0x313af0['query'][_0x682d('0x5c')]||!utils['isValidChannel'](_0x313af0[_0x682d('0x38')][_0x682d('0x5c')])){throw new db['Sequelize'][(_0x682d('0x5d'))](_0x682d('0x5e'));}var _0xe24629={};var _0x5f2fe1={};_0x5f2fe1['model']=_[_0x682d('0x39')](db[_['capitalize'](_0x313af0[_0x682d('0x38')][_0x682d('0x5c')][_0x682d('0x5f')]())+'Queue'][_0x682d('0x4f')]);_0x5f2fe1[_0x682d('0x38')]=_[_0x682d('0x39')](_0x313af0[_0x682d('0x38')]);_0x5f2fe1[_0x682d('0x3a')]=_[_0x682d('0x3b')](_0x5f2fe1[_0x682d('0x3c')],_0x5f2fe1[_0x682d('0x38')]);_0xe24629[_0x682d('0x3d')]=_[_0x682d('0x3b')](_0x5f2fe1[_0x682d('0x3c')],qs['fields'](_0x313af0['query'][_0x682d('0x3e')]));_0xe24629['attributes']=_0xe24629['attributes'][_0x682d('0x3f')]?_0xe24629[_0x682d('0x3d')]:_0x5f2fe1[_0x682d('0x3c')];_0xe24629[_0x682d('0x21')]=qs[_0x682d('0x21')](_0x313af0['query'][_0x682d('0x21')]);_0xe24629[_0x682d('0x20')]=qs[_0x682d('0x20')](_0x313af0[_0x682d('0x38')][_0x682d('0x20')]);_0xe24629[_0x682d('0x41')]=qs[_0x682d('0x42')](_0x313af0[_0x682d('0x38')][_0x682d('0x42')]);_0xe24629['where']=qs[_0x682d('0x3a')](_[_0x682d('0x44')](_0x313af0[_0x682d('0x38')],_0x5f2fe1[_0x682d('0x3a')]));_0xe24629=_[_0x682d('0x46')]({},_0xe24629,_0x313af0[_0x682d('0x48')]);return _0x32bb12[_0x682d('0x2c')+_[_0x682d('0x60')](_0x313af0[_0x682d('0x38')]['channel']['toLowerCase']())+_0x682d('0x61')](_0xe24629);})['then'](respondWithResult(_0x1ffdfb,null))[_0x682d('0x4c')](handleError(_0x1ffdfb,null));};exports[_0x682d('0x62')]=function(_0x391e40,_0x25b275,_0x2208f5){return db['Team'][_0x682d('0x63')]({'where':{'id':_0x391e40[_0x682d('0x4e')]['id']}})[_0x682d('0x2a')](function(_0x53f16d){if(_0x53f16d){if(!_0x391e40[_0x682d('0x52')][_0x682d('0x5c')]||!utils[_0x682d('0x64')](_0x391e40[_0x682d('0x52')][_0x682d('0x5c')])){throw new db[(_0x682d('0x65'))][(_0x682d('0x5d'))](_0x682d('0x5e'));}return _0x53f16d[_0x682d('0x66')+_[_0x682d('0x60')](_0x391e40['body'][_0x682d('0x5c')][_0x682d('0x5f')]())+_0x682d('0x61')](_0x391e40[_0x682d('0x52')][_0x682d('0x67')]);}return null;})[_0x682d('0x2a')](handleEntityNotFound(_0x25b275,null))[_0x682d('0x2a')](respondWithStatusCode(_0x25b275,null))['catch'](handleError(_0x25b275,null));};exports[_0x682d('0x68')]=function(_0x870883,_0xeb6752,_0x466aa9){return db[_0x682d('0x34')][_0x682d('0x63')]({'where':{'id':_0x870883[_0x682d('0x4e')]['id']}})[_0x682d('0x2a')](function(_0x4e0e4b){if(_0x4e0e4b){if(!_0x870883[_0x682d('0x38')][_0x682d('0x5c')]||!utils[_0x682d('0x64')](_0x870883[_0x682d('0x38')][_0x682d('0x5c')])){throw new db[(_0x682d('0x65'))][(_0x682d('0x5d'))](_0x682d('0x5e'));}return _0x4e0e4b[_0x682d('0x69')+_[_0x682d('0x60')](_0x870883[_0x682d('0x38')]['channel'][_0x682d('0x5f')]())+'Queues'](_0x870883[_0x682d('0x38')][_0x682d('0x67')]);}return null;})[_0x682d('0x2a')](handleEntityNotFound(_0xeb6752,null))[_0x682d('0x2a')](respondWithStatusCode(_0xeb6752,null))[_0x682d('0x4c')](handleError(_0xeb6752,null));};exports[_0x682d('0x6a')]=function(_0x2f521e,_0xd9b8fe){return db[_0x682d('0x34')][_0x682d('0x50')]({'where':{'id':_0x2f521e[_0x682d('0x4e')]['id']}})[_0x682d('0x2a')](handleEntityNotFound(_0xd9b8fe,null))[_0x682d('0x2a')](function(_0x3423ea){if(_0x3423ea){var _0x1fb952=[_0x682d('0x6b'),_0x682d('0x6c'),'Mail',_0x682d('0x6d'),_0x682d('0x6e'),_0x682d('0x6f'),_0x682d('0x70')];return db[_0x682d('0x71')][_0x682d('0x72')](function(_0x12197e){var _0x132860=_[_0x682d('0x33')](_0x1fb952,function(_0x32bc76){var _0x466f89={'attributes':['id',_0x682d('0x30')]};if(_0x32bc76===_0x682d('0x6b')){_0x466f89[_0x682d('0x73')]={'attributes':[_0x682d('0x74')]};}return _0x3423ea[_0x682d('0x2c')+_0x32bc76+_0x682d('0x61')](_0x466f89)[_0x682d('0x2a')](function(_0x2daae3){var _0x16fd43=_[_0x682d('0x33')](_0x2daae3,function(_0x3cef79){var _0x4b95b0=_[_0x682d('0x33')](_0x2f521e[_0x682d('0x52')][_0x682d('0x67')],function(_0x203d44){var _0x242f1f={'where':{'UserId':_0x203d44,[_0x32bc76+_0x682d('0x75')]:_0x3cef79['id']},'transaction':_0x12197e};if(_0x32bc76===_0x682d('0x6b')){_0x242f1f[_0x682d('0x19')]={'penalty':_0x3cef79[_0x682d('0x76')][_0x682d('0x74')]};}return db[_0x682d('0x77')+_0x32bc76+_0x682d('0x78')][_0x682d('0x79')](_0x242f1f)[_0x682d('0x2a')](function(){socket[_0x682d('0x7a')]('user'+_0x32bc76+_0x682d('0x7b'),{'UserId':_0x203d44,[_0x32bc76+'QueueId']:_0x3cef79['id']});if(_0x32bc76!=='Voice')return;return db[_0x682d('0x77')][_0x682d('0x4b')]({'where':{'id':_0x2f521e['body']['ids'],'online':0x1},'attributes':['id',_0x682d('0x30'),'online',_0x682d('0x7c'),'interface'],'raw':!![]})[_0x682d('0x2a')](function(_0x46be3c){var _0x279e0a=_['map'](_0x46be3c,function(_0x431164){return db[_0x682d('0x7d')]['upsert']({'membername':_0x431164['name'],'UserId':_0x431164['id'],'queue_name':_0x3cef79['name'],'VoiceQueueId':_0x3cef79['id'],'interface':_['isNil'](_0x431164['interface'])?util['format'](_0x682d('0x7e'),_0x431164[_0x682d('0x30')]):_0x431164[_0x682d('0x7f')],'paused':_0x431164[_0x682d('0x7c')]||![],'penalty':_0x3cef79[_0x682d('0x76')][_0x682d('0x74')]},{'transaction':_0x12197e});});return Promise[_0x682d('0x80')](_0x279e0a);});});});return Promise[_0x682d('0x80')](_0x4b95b0);});return Promise[_0x682d('0x80')](_0x16fd43);});});return Promise['all'](_0x132860)[_0x682d('0x2a')](function(){return _0x3423ea['addAgents'](_0x2f521e[_0x682d('0x52')][_0x682d('0x67')],{'transaction':_0x12197e})[_0x682d('0x81')](function(_0x1dd221){return _0x1dd221;});});});}})[_0x682d('0x2a')](respondWithResult(_0xd9b8fe,null))[_0x682d('0x4c')](handleError(_0xd9b8fe,null));};exports[_0x682d('0x82')]=function(_0x1067eb,_0x250cb1){return db['Team'][_0x682d('0x50')]({'where':{'id':_0x1067eb[_0x682d('0x4e')]['id']}})[_0x682d('0x2a')](handleEntityNotFound(_0x250cb1,null))['then'](function(_0x575e6e){if(_0x575e6e){var _0x2c1fbd=[_0x682d('0x6b'),_0x682d('0x6c'),'Mail',_0x682d('0x6d'),_0x682d('0x6e'),'Openchannel','Whatsapp'];return db[_0x682d('0x71')][_0x682d('0x72')](function(_0x35acda){var _0x18582a=_['map'](_0x2c1fbd,function(_0xf8d681){var _0x53f250={'attributes':['id',_0x682d('0x30')]};return _0x575e6e['get'+_0xf8d681+_0x682d('0x61')](_0x53f250)['then'](function(_0x272a52){var _0x5ad2ef=_[_0x682d('0x33')](_0x272a52,function(_0x35eb96){return _0x35eb96['removeAgents'](_0x1067eb['query'][_0x682d('0x67')],{'transaction':_0x35acda})[_0x682d('0x2a')](function(){var _0x35f3a0=JSON[_0x682d('0x83')]('['+_0x1067eb[_0x682d('0x38')][_0x682d('0x67')]+']');var _0x4d7d0e=_['map'](_0x35f3a0,function(_0x1d6386){socket[_0x682d('0x7a')](_0x682d('0x53')+_0xf8d681+_0x682d('0x84'),{'UserId':Number(_0x1d6386),[_0xf8d681+_0x682d('0x75')]:_0x35eb96['id']});if(_0xf8d681!=='Voice')return;return db['UserVoiceQueueRt'][_0x682d('0x2b')]({'where':{'VoiceQueueId':_0x35eb96['id'],'UserId':_0x1d6386},'transaction':_0x35acda});});return Promise[_0x682d('0x80')](_0x4d7d0e);});});return Promise[_0x682d('0x80')](_0x5ad2ef);});});return Promise[_0x682d('0x80')](_0x18582a)[_0x682d('0x2a')](function(){return _0x575e6e['removeAgents'](_0x1067eb[_0x682d('0x38')]['ids'],{'transaction':_0x35acda});});});}})[_0x682d('0x2a')](respondWithStatusCode(_0x250cb1,null))['catch'](handleError(_0x250cb1,null));};exports[_0x682d('0x85')]=function(_0x14b230,_0x56500e,_0x12ff20){var _0x49479c={};var _0x49d1ee={};var _0x5c4413;var _0x313062;return db[_0x682d('0x34')]['findOne']({'where':{'id':_0x14b230[_0x682d('0x4e')]['id']}})[_0x682d('0x2a')](handleEntityNotFound(_0x56500e,null))[_0x682d('0x2a')](function(_0xa0f1c3){if(_0xa0f1c3){_0x5c4413=_0xa0f1c3;_0x49d1ee[_0x682d('0x3c')]=_[_0x682d('0x39')](db[_0x682d('0x77')][_0x682d('0x4f')]);_0x49d1ee['query']=_['keys'](_0x14b230[_0x682d('0x38')]);_0x49d1ee[_0x682d('0x3a')]=_[_0x682d('0x3b')](_0x49d1ee[_0x682d('0x3c')],_0x49d1ee[_0x682d('0x38')]);_0x49479c[_0x682d('0x3d')]=_[_0x682d('0x3b')](_0x49d1ee[_0x682d('0x3c')],qs[_0x682d('0x3e')](_0x14b230[_0x682d('0x38')][_0x682d('0x3e')]));_0x49479c[_0x682d('0x3d')]=_0x49479c['attributes'][_0x682d('0x3f')]?_0x49479c[_0x682d('0x3d')]:_0x49d1ee[_0x682d('0x3c')];_0x49479c['order']=qs[_0x682d('0x42')](_0x14b230[_0x682d('0x38')][_0x682d('0x42')]);_0x49479c[_0x682d('0x43')]=qs['filters'](_[_0x682d('0x44')](_0x14b230[_0x682d('0x38')],_0x49d1ee['filters']));if(_0x14b230['query'][_0x682d('0x45')]){_0x49479c[_0x682d('0x43')]=_[_0x682d('0x46')](_0x49479c[_0x682d('0x43')],{'$or':_[_0x682d('0x33')](_0x49479c[_0x682d('0x3d')],function(_0x27dac8){var _0x44692f={};_0x44692f[_0x27dac8]={'$like':'%'+_0x14b230[_0x682d('0x38')][_0x682d('0x45')]+'%'};return _0x44692f;})});}_0x49479c=_[_0x682d('0x46')]({},_0x49479c,_0x14b230[_0x682d('0x48')]);return _0x5c4413[_0x682d('0x85')](_0x49479c);}})[_0x682d('0x2a')](function(_0x2c3f00){if(_0x2c3f00){_0x313062=_0x2c3f00[_0x682d('0x3f')];if(!_0x14b230[_0x682d('0x38')][_0x682d('0x40')](_0x682d('0x86'))){_0x49479c[_0x682d('0x21')]=qs['limit'](_0x14b230['query']['limit']);_0x49479c[_0x682d('0x20')]=qs[_0x682d('0x20')](_0x14b230[_0x682d('0x38')][_0x682d('0x20')]);}return _0x5c4413[_0x682d('0x85')](_0x49479c);}})[_0x682d('0x2a')](function(_0x25ee79){if(_0x25ee79){return _0x25ee79?{'count':_0x313062,'rows':_0x25ee79}:null;}})[_0x682d('0x2a')](respondWithResult(_0x56500e,null))[_0x682d('0x4c')](handleError(_0x56500e,null));}; \ No newline at end of file +var _0x9c98=['Queue:remove','getAgents','hasOwnProperty','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Teams','stack','name','send','map','Team','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','merge','where','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','error','getQueues','findOne','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','channel','addQueues','add','Queues','ids','removeQueues','remove','Voice','Mail','Sms','Fax','Openchannel','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','Queue:save','online','voicePause','UserVoiceQueueRt','upsert','isNil','format','interface','all','addAgents','spread','removeAgents','Chat','Whatsapp','parse','emit'];(function(_0x1fa760,_0x1bf063){var _0xd8eda1=function(_0x4a21d6){while(--_0x4a21d6){_0x1fa760['push'](_0x1fa760['shift']());}};_0xd8eda1(++_0x1bf063);}(_0x9c98,0x105));var _0x89c9=function(_0x2614a3,_0xdaef9f){_0x2614a3=_0x2614a3-0x0;var _0x431318=_0x9c98[_0x2614a3];return _0x431318;};'use strict';var emlformat=require(_0x89c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x89c9('0x1'));var jsonpatch=require(_0x89c9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x89c9('0x3'));var Mustache=require('mustache');var util=require(_0x89c9('0x4'));var path=require(_0x89c9('0x5'));var sox=require(_0x89c9('0x6'));var csv=require(_0x89c9('0x7'));var ejs=require(_0x89c9('0x8'));var fs=require('fs');var fs_extra=require(_0x89c9('0x9'));var _=require('lodash');var squel=require(_0x89c9('0xa'));var crypto=require(_0x89c9('0xb'));var jsforce=require(_0x89c9('0xc'));var deskjs=require(_0x89c9('0xd'));var toCsv=require(_0x89c9('0x7'));var querystring=require(_0x89c9('0xe'));var Papa=require(_0x89c9('0xf'));var Redis=require(_0x89c9('0x10'));var authService=require(_0x89c9('0x11'));var qs=require(_0x89c9('0x12'));var as=require(_0x89c9('0x13'));var hardwareService=require(_0x89c9('0x14'));var logger=require('../../config/logger')(_0x89c9('0x15'));var utils=require('../../config/utils');var config=require(_0x89c9('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x89c9('0x17'))['db'];config['redis']=_['defaults'](config[_0x89c9('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x89c9('0x18')]));require(_0x89c9('0x19'))[_0x89c9('0x1a')](socket);function respondWithStatusCode(_0x5dec51,_0xaefca8){_0xaefca8=_0xaefca8||0xcc;return function(_0x4d431a){if(_0x4d431a){return _0x5dec51[_0x89c9('0x1b')](_0xaefca8);}return _0x5dec51[_0x89c9('0x1c')](_0xaefca8)[_0x89c9('0x1d')]();};}function respondWithResult(_0x3a1d71,_0x38f397){_0x38f397=_0x38f397||0xc8;return function(_0x57fe05){if(_0x57fe05){return _0x3a1d71[_0x89c9('0x1c')](_0x38f397)[_0x89c9('0x1e')](_0x57fe05);}};}function respondWithFilteredResult(_0x4628fa,_0x45fa29){return function(_0x4624b0){if(_0x4624b0){var _0x1c3aef=typeof _0x45fa29[_0x89c9('0x1f')]===_0x89c9('0x20')&&typeof _0x45fa29[_0x89c9('0x21')]===_0x89c9('0x20');var _0x4b1932=_0x4624b0[_0x89c9('0x22')];var _0x258bc3=_0x1c3aef?0x0:_0x45fa29['offset'];var _0xf1cb5=_0x1c3aef?_0x4624b0[_0x89c9('0x22')]:_0x45fa29[_0x89c9('0x1f')]+_0x45fa29[_0x89c9('0x21')];var _0x540a19;if(_0xf1cb5>=_0x4b1932){_0xf1cb5=_0x4b1932;_0x540a19=0xc8;}else{_0x540a19=0xce;}_0x4628fa[_0x89c9('0x1c')](_0x540a19);return _0x4628fa[_0x89c9('0x23')](_0x89c9('0x24'),_0x258bc3+'-'+_0xf1cb5+'/'+_0x4b1932)[_0x89c9('0x1e')](_0x4624b0);}return null;};}function patchUpdates(_0x273e85){return function(_0x2c7d53){try{jsonpatch[_0x89c9('0x25')](_0x2c7d53,_0x273e85,!![]);}catch(_0x49fafc){return BPromise['reject'](_0x49fafc);}return _0x2c7d53['save']();};}function saveUpdates(_0x4017c9,_0x199e24){return function(_0x281080){if(_0x281080){return _0x281080[_0x89c9('0x26')](_0x4017c9)[_0x89c9('0x27')](function(_0x3cba3d){return _0x3cba3d;});}return null;};}function removeEntity(_0x328a11,_0x2dac23){return function(_0x2e18fb){if(_0x2e18fb){return _0x2e18fb[_0x89c9('0x28')]()[_0x89c9('0x27')](function(){var _0x2adc17=_0x2e18fb[_0x89c9('0x29')]({'plain':!![]});var _0x327a28=_0x89c9('0x2a');return db['UserProfileResource'][_0x89c9('0x28')]({'where':{'type':_0x327a28,'resourceId':_0x2adc17['id']}})[_0x89c9('0x27')](function(){return _0x2e18fb;});})['then'](function(){_0x328a11['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xdc5c70,_0x147cd1){return function(_0x359110){if(!_0x359110){_0xdc5c70[_0x89c9('0x1b')](0x194);}return _0x359110;};}function handleError(_0x3ad57d,_0xc5ec98){_0xc5ec98=_0xc5ec98||0x1f4;return function(_0x35144d){logger['error'](_0x35144d[_0x89c9('0x2b')]);if(_0x35144d[_0x89c9('0x2c')]){delete _0x35144d[_0x89c9('0x2c')];}_0x3ad57d[_0x89c9('0x1c')](_0xc5ec98)[_0x89c9('0x2d')](_0x35144d);};}exports['index']=function(_0x32cfaa,_0x107ea3){var _0x2e2501={},_0xfff938={},_0x5a28a1={'count':0x0,'rows':[]};var _0x3648b8=_[_0x89c9('0x2e')](db[_0x89c9('0x2f')][_0x89c9('0x30')],function(_0x4481ec){return{'name':_0x4481ec[_0x89c9('0x31')],'type':_0x4481ec[_0x89c9('0x32')][_0x89c9('0x33')]};});_0xfff938[_0x89c9('0x34')]=_[_0x89c9('0x2e')](_0x3648b8,_0x89c9('0x2c'));_0xfff938[_0x89c9('0x35')]=_['keys'](_0x32cfaa[_0x89c9('0x35')]);_0xfff938['filters']=_[_0x89c9('0x36')](_0xfff938[_0x89c9('0x34')],_0xfff938[_0x89c9('0x35')]);_0x2e2501[_0x89c9('0x37')]=_['intersection'](_0xfff938[_0x89c9('0x34')],qs['fields'](_0x32cfaa[_0x89c9('0x35')][_0x89c9('0x38')]));_0x2e2501[_0x89c9('0x37')]=_0x2e2501[_0x89c9('0x37')][_0x89c9('0x39')]?_0x2e2501[_0x89c9('0x37')]:_0xfff938[_0x89c9('0x34')];if(!_0x32cfaa[_0x89c9('0x35')]['hasOwnProperty'](_0x89c9('0x3a'))){_0x2e2501['limit']=qs['limit'](_0x32cfaa[_0x89c9('0x35')][_0x89c9('0x21')]);_0x2e2501[_0x89c9('0x1f')]=qs[_0x89c9('0x1f')](_0x32cfaa['query'][_0x89c9('0x1f')]);}_0x2e2501[_0x89c9('0x3b')]=qs[_0x89c9('0x3c')](_0x32cfaa[_0x89c9('0x35')][_0x89c9('0x3c')]);_0x2e2501['where']=qs[_0x89c9('0x3d')](_[_0x89c9('0x3e')](_0x32cfaa[_0x89c9('0x35')],_0xfff938['filters']),_0x3648b8);if(_0x32cfaa['query'][_0x89c9('0x3f')]){_0x2e2501['where']=_[_0x89c9('0x40')](_0x2e2501[_0x89c9('0x41')],{'$or':_['map'](_0x3648b8,function(_0x10a40d){if(_0x10a40d[_0x89c9('0x32')]!=='VIRTUAL'){var _0x4e40dd={};_0x4e40dd[_0x10a40d[_0x89c9('0x2c')]]={'$like':'%'+_0x32cfaa[_0x89c9('0x35')][_0x89c9('0x3f')]+'%'};return _0x4e40dd;}})});}_0x2e2501=_[_0x89c9('0x40')]({},_0x2e2501,_0x32cfaa[_0x89c9('0x42')]);var _0xbc41ab={'where':_0x2e2501[_0x89c9('0x41')]};return db[_0x89c9('0x2f')][_0x89c9('0x22')](_0xbc41ab)['then'](function(_0x21b324){_0x5a28a1[_0x89c9('0x22')]=_0x21b324;if(_0x32cfaa['query'][_0x89c9('0x43')]){_0x2e2501[_0x89c9('0x44')]=[{'all':!![]}];}return db[_0x89c9('0x2f')][_0x89c9('0x45')](_0x2e2501);})['then'](function(_0x3f4bb6){_0x5a28a1['rows']=_0x3f4bb6;return _0x5a28a1;})[_0x89c9('0x27')](respondWithFilteredResult(_0x107ea3,_0x2e2501))[_0x89c9('0x46')](handleError(_0x107ea3,null));};exports[_0x89c9('0x47')]=function(_0x4d9062,_0x5d8217){var _0xec2882={'raw':![],'where':{'id':_0x4d9062[_0x89c9('0x48')]['id']}},_0x18e982={};_0x18e982['model']=_['keys'](db['Team'][_0x89c9('0x30')]);_0x18e982[_0x89c9('0x35')]=_[_0x89c9('0x49')](_0x4d9062[_0x89c9('0x35')]);_0x18e982[_0x89c9('0x3d')]=_['intersection'](_0x18e982[_0x89c9('0x34')],_0x18e982[_0x89c9('0x35')]);_0xec2882[_0x89c9('0x37')]=_['intersection'](_0x18e982[_0x89c9('0x34')],qs['fields'](_0x4d9062[_0x89c9('0x35')][_0x89c9('0x38')]));_0xec2882[_0x89c9('0x37')]=_0xec2882[_0x89c9('0x37')][_0x89c9('0x39')]?_0xec2882[_0x89c9('0x37')]:_0x18e982['model'];if(_0x4d9062[_0x89c9('0x35')][_0x89c9('0x43')]){_0xec2882[_0x89c9('0x44')]=[{'all':!![]}];}_0xec2882=_[_0x89c9('0x40')]({},_0xec2882,_0x4d9062[_0x89c9('0x42')]);return db['Team'][_0x89c9('0x4a')](_0xec2882)[_0x89c9('0x27')](handleEntityNotFound(_0x5d8217,null))[_0x89c9('0x27')](respondWithResult(_0x5d8217,null))['catch'](handleError(_0x5d8217,null));};exports[_0x89c9('0x4b')]=function(_0x3cb674,_0x239b55){return db[_0x89c9('0x2f')]['create'](_0x3cb674[_0x89c9('0x4c')],{})['then'](function(_0x254b23){var _0x18ecfc=_0x3cb674['user']['get']({'plain':!![]});if(!_0x18ecfc)throw new Error(_0x89c9('0x4d'));if(_0x18ecfc[_0x89c9('0x4e')]===_0x89c9('0x4f')){var _0x546740=_0x254b23[_0x89c9('0x29')]({'plain':!![]});var _0xf01d0e=_0x89c9('0x2a');return db['UserProfileSection'][_0x89c9('0x4a')]({'where':{'name':_0xf01d0e,'userProfileId':_0x18ecfc[_0x89c9('0x50')]},'raw':!![]})['then'](function(_0x2f3e3c){if(_0x2f3e3c&&_0x2f3e3c[_0x89c9('0x51')]===0x0){return db[_0x89c9('0x52')][_0x89c9('0x4b')]({'name':_0x546740[_0x89c9('0x2c')],'resourceId':_0x546740['id'],'type':_0x2f3e3c['name'],'sectionId':_0x2f3e3c['id']},{})[_0x89c9('0x27')](function(){return _0x254b23;});}else{return _0x254b23;}})[_0x89c9('0x46')](function(_0x1fdce5){logger[_0x89c9('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1fdce5);throw _0x1fdce5;});}return _0x254b23;})[_0x89c9('0x27')](respondWithResult(_0x239b55,0xc9))['catch'](handleError(_0x239b55,null));};exports[_0x89c9('0x26')]=function(_0x41f87f,_0x4f8105){if(_0x41f87f[_0x89c9('0x4c')]['id']){delete _0x41f87f['body']['id'];}return db[_0x89c9('0x2f')][_0x89c9('0x4a')]({'where':{'id':_0x41f87f['params']['id']}})[_0x89c9('0x27')](handleEntityNotFound(_0x4f8105,null))['then'](saveUpdates(_0x41f87f[_0x89c9('0x4c')],null))[_0x89c9('0x27')](respondWithResult(_0x4f8105,null))[_0x89c9('0x46')](handleError(_0x4f8105,null));};exports[_0x89c9('0x28')]=function(_0x1de14e,_0x167284){return db[_0x89c9('0x2f')]['find']({'where':{'id':_0x1de14e[_0x89c9('0x48')]['id']}})[_0x89c9('0x27')](handleEntityNotFound(_0x167284,null))['then'](removeEntity(_0x167284,null))[_0x89c9('0x46')](handleError(_0x167284,null));};exports[_0x89c9('0x54')]=function(_0x595bb7,_0x805230,_0x6c8226){return db['Team'][_0x89c9('0x55')]({'where':{'id':_0x595bb7[_0x89c9('0x48')]['id']}})[_0x89c9('0x27')](handleEntityNotFound(_0x805230,null))[_0x89c9('0x27')](function(_0x597eb5){if(!_0x595bb7[_0x89c9('0x35')]['channel']||!utils[_0x89c9('0x56')](_0x595bb7[_0x89c9('0x35')]['channel'])){throw new db[(_0x89c9('0x57'))][(_0x89c9('0x58'))](_0x89c9('0x59'));}var _0x5706ca={};var _0xb02622={};_0xb02622[_0x89c9('0x34')]=_[_0x89c9('0x49')](db[_[_0x89c9('0x5a')](_0x595bb7[_0x89c9('0x35')]['channel'][_0x89c9('0x5b')]())+_0x89c9('0x5c')][_0x89c9('0x30')]);_0xb02622[_0x89c9('0x35')]=_[_0x89c9('0x49')](_0x595bb7[_0x89c9('0x35')]);_0xb02622['filters']=_[_0x89c9('0x36')](_0xb02622[_0x89c9('0x34')],_0xb02622[_0x89c9('0x35')]);_0x5706ca[_0x89c9('0x37')]=_[_0x89c9('0x36')](_0xb02622[_0x89c9('0x34')],qs[_0x89c9('0x38')](_0x595bb7[_0x89c9('0x35')][_0x89c9('0x38')]));_0x5706ca[_0x89c9('0x37')]=_0x5706ca['attributes'][_0x89c9('0x39')]?_0x5706ca[_0x89c9('0x37')]:_0xb02622['model'];_0x5706ca['limit']=qs[_0x89c9('0x21')](_0x595bb7[_0x89c9('0x35')][_0x89c9('0x21')]);_0x5706ca[_0x89c9('0x1f')]=qs[_0x89c9('0x1f')](_0x595bb7['query'][_0x89c9('0x1f')]);_0x5706ca[_0x89c9('0x3b')]=qs[_0x89c9('0x3c')](_0x595bb7[_0x89c9('0x35')][_0x89c9('0x3c')]);_0x5706ca[_0x89c9('0x41')]=qs[_0x89c9('0x3d')](_['pick'](_0x595bb7[_0x89c9('0x35')],_0xb02622[_0x89c9('0x3d')]));_0x5706ca=_[_0x89c9('0x40')]({},_0x5706ca,_0x595bb7[_0x89c9('0x42')]);return _0x597eb5['get'+_[_0x89c9('0x5a')](_0x595bb7[_0x89c9('0x35')][_0x89c9('0x5d')][_0x89c9('0x5b')]())+'Queues'](_0x5706ca);})[_0x89c9('0x27')](respondWithResult(_0x805230,null))[_0x89c9('0x46')](handleError(_0x805230,null));};exports[_0x89c9('0x5e')]=function(_0x1fad71,_0x42950,_0x53463b){return db['Team'][_0x89c9('0x55')]({'where':{'id':_0x1fad71[_0x89c9('0x48')]['id']}})[_0x89c9('0x27')](function(_0x1ad3d6){if(_0x1ad3d6){if(!_0x1fad71[_0x89c9('0x4c')]['channel']||!utils[_0x89c9('0x56')](_0x1fad71['body']['channel'])){throw new db[(_0x89c9('0x57'))][(_0x89c9('0x58'))](_0x89c9('0x59'));}return _0x1ad3d6[_0x89c9('0x5f')+_[_0x89c9('0x5a')](_0x1fad71[_0x89c9('0x4c')][_0x89c9('0x5d')][_0x89c9('0x5b')]())+_0x89c9('0x60')](_0x1fad71['body'][_0x89c9('0x61')]);}return null;})[_0x89c9('0x27')](handleEntityNotFound(_0x42950,null))[_0x89c9('0x27')](respondWithStatusCode(_0x42950,null))[_0x89c9('0x46')](handleError(_0x42950,null));};exports[_0x89c9('0x62')]=function(_0x6589,_0x9090a6,_0x4b4d6d){return db[_0x89c9('0x2f')][_0x89c9('0x55')]({'where':{'id':_0x6589[_0x89c9('0x48')]['id']}})[_0x89c9('0x27')](function(_0x387239){if(_0x387239){if(!_0x6589[_0x89c9('0x35')][_0x89c9('0x5d')]||!utils[_0x89c9('0x56')](_0x6589[_0x89c9('0x35')]['channel'])){throw new db[(_0x89c9('0x57'))][(_0x89c9('0x58'))](_0x89c9('0x59'));}return _0x387239[_0x89c9('0x63')+_[_0x89c9('0x5a')](_0x6589[_0x89c9('0x35')][_0x89c9('0x5d')][_0x89c9('0x5b')]())+_0x89c9('0x60')](_0x6589[_0x89c9('0x35')][_0x89c9('0x61')]);}return null;})['then'](handleEntityNotFound(_0x9090a6,null))[_0x89c9('0x27')](respondWithStatusCode(_0x9090a6,null))[_0x89c9('0x46')](handleError(_0x9090a6,null));};exports['addAgents']=function(_0x4bc10e,_0xe38c9d){return db[_0x89c9('0x2f')][_0x89c9('0x4a')]({'where':{'id':_0x4bc10e[_0x89c9('0x48')]['id']}})[_0x89c9('0x27')](handleEntityNotFound(_0xe38c9d,null))[_0x89c9('0x27')](function(_0xe46cc4){if(_0xe46cc4){var _0x4446ee=[_0x89c9('0x64'),'Chat',_0x89c9('0x65'),_0x89c9('0x66'),_0x89c9('0x67'),_0x89c9('0x68'),'Whatsapp'];return db['sequelize']['transaction'](function(_0x519e88){var _0xf16f5=_[_0x89c9('0x2e')](_0x4446ee,function(_0x335361){var _0x2df314={'attributes':['id',_0x89c9('0x2c')]};if(_0x335361===_0x89c9('0x64')){_0x2df314['through']={'attributes':[_0x89c9('0x69')]};}return _0xe46cc4[_0x89c9('0x29')+_0x335361+_0x89c9('0x60')](_0x2df314)[_0x89c9('0x27')](function(_0x44c473){var _0x5d707f=_[_0x89c9('0x2e')](_0x44c473,function(_0x54f62a){var _0x3e5781=_[_0x89c9('0x2e')](_0x4bc10e['body']['ids'],function(_0x29983a){var _0x4a02f4={'where':{'UserId':_0x29983a,[_0x335361+_0x89c9('0x6a')]:_0x54f62a['id']},'transaction':_0x519e88};if(_0x335361===_0x89c9('0x64')){_0x4a02f4['defaults']={'penalty':_0x54f62a[_0x89c9('0x6b')][_0x89c9('0x69')]};}return db[_0x89c9('0x6c')+_0x335361+'Queue'][_0x89c9('0x6d')](_0x4a02f4)[_0x89c9('0x27')](function(){socket['emit'](_0x89c9('0x4f')+_0x335361+_0x89c9('0x6e'),{'UserId':_0x29983a,[_0x335361+'QueueId']:_0x54f62a['id']});if(_0x335361!=='Voice')return;return db['User'][_0x89c9('0x45')]({'where':{'id':_0x4bc10e['body'][_0x89c9('0x61')],'online':0x1},'attributes':['id','name',_0x89c9('0x6f'),_0x89c9('0x70'),'interface'],'raw':!![]})[_0x89c9('0x27')](function(_0x19ed18){var _0xf0c47f=_[_0x89c9('0x2e')](_0x19ed18,function(_0x4b15ef){return db[_0x89c9('0x71')][_0x89c9('0x72')]({'membername':_0x4b15ef[_0x89c9('0x2c')],'UserId':_0x4b15ef['id'],'queue_name':_0x54f62a['name'],'VoiceQueueId':_0x54f62a['id'],'interface':_[_0x89c9('0x73')](_0x4b15ef['interface'])?util[_0x89c9('0x74')]('SIP/%s',_0x4b15ef[_0x89c9('0x2c')]):_0x4b15ef[_0x89c9('0x75')],'paused':_0x4b15ef[_0x89c9('0x70')]||![],'penalty':_0x54f62a[_0x89c9('0x6b')][_0x89c9('0x69')]},{'transaction':_0x519e88});});return Promise[_0x89c9('0x76')](_0xf0c47f);});});});return Promise[_0x89c9('0x76')](_0x3e5781);});return Promise[_0x89c9('0x76')](_0x5d707f);});});return Promise[_0x89c9('0x76')](_0xf16f5)['then'](function(){return _0xe46cc4[_0x89c9('0x77')](_0x4bc10e[_0x89c9('0x4c')][_0x89c9('0x61')],{'transaction':_0x519e88})[_0x89c9('0x78')](function(_0x150e18){return _0x150e18;});});});}})[_0x89c9('0x27')](respondWithResult(_0xe38c9d,null))[_0x89c9('0x46')](handleError(_0xe38c9d,null));};exports[_0x89c9('0x79')]=function(_0xdd7825,_0x558e52){return db['Team'][_0x89c9('0x4a')]({'where':{'id':_0xdd7825[_0x89c9('0x48')]['id']}})[_0x89c9('0x27')](handleEntityNotFound(_0x558e52,null))[_0x89c9('0x27')](function(_0x1d00e6){if(_0x1d00e6){var _0x2b711d=[_0x89c9('0x64'),_0x89c9('0x7a'),_0x89c9('0x65'),_0x89c9('0x66'),'Fax',_0x89c9('0x68'),_0x89c9('0x7b')];return db['sequelize']['transaction'](function(_0x5575fb){var _0x52a588=_[_0x89c9('0x2e')](_0x2b711d,function(_0x1f9544){var _0x49335a={'attributes':['id','name']};return _0x1d00e6[_0x89c9('0x29')+_0x1f9544+_0x89c9('0x60')](_0x49335a)[_0x89c9('0x27')](function(_0x5c1d69){var _0x5d5ab4=_[_0x89c9('0x2e')](_0x5c1d69,function(_0x14bb16){return _0x14bb16[_0x89c9('0x79')](_0xdd7825['query'][_0x89c9('0x61')],{'transaction':_0x5575fb})[_0x89c9('0x27')](function(){var _0x5ec69a=JSON[_0x89c9('0x7c')]('['+_0xdd7825['query']['ids']+']');var _0x4fd965=_[_0x89c9('0x2e')](_0x5ec69a,function(_0x4ab247){socket[_0x89c9('0x7d')](_0x89c9('0x4f')+_0x1f9544+_0x89c9('0x7e'),{'UserId':Number(_0x4ab247),[_0x1f9544+'QueueId']:_0x14bb16['id']});if(_0x1f9544!=='Voice')return;return db[_0x89c9('0x71')][_0x89c9('0x28')]({'where':{'VoiceQueueId':_0x14bb16['id'],'UserId':_0x4ab247},'transaction':_0x5575fb});});return Promise[_0x89c9('0x76')](_0x4fd965);});});return Promise[_0x89c9('0x76')](_0x5d5ab4);});});return Promise[_0x89c9('0x76')](_0x52a588)['then'](function(){return _0x1d00e6[_0x89c9('0x79')](_0xdd7825[_0x89c9('0x35')]['ids'],{'transaction':_0x5575fb});});});}})['then'](respondWithStatusCode(_0x558e52,null))[_0x89c9('0x46')](handleError(_0x558e52,null));};exports[_0x89c9('0x7f')]=function(_0x5b21ea,_0x18ee64,_0x4f6a25){var _0x1fe990={};var _0x208f30={};var _0x1145f4;var _0x369063;return db[_0x89c9('0x2f')]['findOne']({'where':{'id':_0x5b21ea[_0x89c9('0x48')]['id']}})[_0x89c9('0x27')](handleEntityNotFound(_0x18ee64,null))[_0x89c9('0x27')](function(_0x5d1495){if(_0x5d1495){_0x1145f4=_0x5d1495;_0x208f30[_0x89c9('0x34')]=_[_0x89c9('0x49')](db[_0x89c9('0x6c')][_0x89c9('0x30')]);_0x208f30[_0x89c9('0x35')]=_['keys'](_0x5b21ea[_0x89c9('0x35')]);_0x208f30[_0x89c9('0x3d')]=_[_0x89c9('0x36')](_0x208f30[_0x89c9('0x34')],_0x208f30[_0x89c9('0x35')]);_0x1fe990[_0x89c9('0x37')]=_[_0x89c9('0x36')](_0x208f30['model'],qs[_0x89c9('0x38')](_0x5b21ea[_0x89c9('0x35')][_0x89c9('0x38')]));_0x1fe990[_0x89c9('0x37')]=_0x1fe990[_0x89c9('0x37')][_0x89c9('0x39')]?_0x1fe990[_0x89c9('0x37')]:_0x208f30[_0x89c9('0x34')];_0x1fe990[_0x89c9('0x3b')]=qs[_0x89c9('0x3c')](_0x5b21ea[_0x89c9('0x35')][_0x89c9('0x3c')]);_0x1fe990[_0x89c9('0x41')]=qs[_0x89c9('0x3d')](_[_0x89c9('0x3e')](_0x5b21ea[_0x89c9('0x35')],_0x208f30[_0x89c9('0x3d')]));if(_0x5b21ea[_0x89c9('0x35')][_0x89c9('0x3f')]){_0x1fe990['where']=_[_0x89c9('0x40')](_0x1fe990[_0x89c9('0x41')],{'$or':_[_0x89c9('0x2e')](_0x1fe990[_0x89c9('0x37')],function(_0x1d73c1){var _0x37ff07={};_0x37ff07[_0x1d73c1]={'$like':'%'+_0x5b21ea[_0x89c9('0x35')][_0x89c9('0x3f')]+'%'};return _0x37ff07;})});}_0x1fe990=_[_0x89c9('0x40')]({},_0x1fe990,_0x5b21ea[_0x89c9('0x42')]);return _0x1145f4[_0x89c9('0x7f')](_0x1fe990);}})[_0x89c9('0x27')](function(_0x16b6b7){if(_0x16b6b7){_0x369063=_0x16b6b7['length'];if(!_0x5b21ea[_0x89c9('0x35')][_0x89c9('0x80')]('nolimit')){_0x1fe990[_0x89c9('0x21')]=qs[_0x89c9('0x21')](_0x5b21ea[_0x89c9('0x35')][_0x89c9('0x21')]);_0x1fe990[_0x89c9('0x1f')]=qs['offset'](_0x5b21ea[_0x89c9('0x35')][_0x89c9('0x1f')]);}return _0x1145f4[_0x89c9('0x7f')](_0x1fe990);}})[_0x89c9('0x27')](function(_0x1d4754){if(_0x1d4754){return _0x1d4754?{'count':_0x369063,'rows':_0x1d4754}:null;}})['then'](respondWithResult(_0x18ee64,null))[_0x89c9('0x46')](handleError(_0x18ee64,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index c9ba6da..b8454c9 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 _0x7227=['Team','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x2233f5,_0x2f086a){var _0x3d006b=function(_0x7df381){while(--_0x7df381){_0x2233f5['push'](_0x2233f5['shift']());}};_0x3d006b(++_0x2f086a);}(_0x7227,0x70));var _0x7722=function(_0x1a8385,_0x2be4bc){_0x1a8385=_0x1a8385-0x0;var _0x125b1d=_0x7227[_0x1a8385];return _0x125b1d;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db'][_0x7722('0x0')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7722('0x1'),'afterUpdate':_0x7722('0x2'),'afterDestroy':_0x7722('0x3')};function emitEvent(_0x3c4bde){return function(_0x414898,_0xfa91f4,_0x4e7906){TeamEvents[_0x7722('0x4')](_0x3c4bde+':'+_0x414898['id'],_0x414898);TeamEvents['emit'](_0x3c4bde,_0x414898);_0x4e7906(null);};}for(var e in events){if(events[_0x7722('0x5')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x7722('0x6')]=TeamEvents; \ No newline at end of file +var _0xa6fb=['setMaxListeners','remove','emit','hasOwnProperty','hook','events','Team'];(function(_0x58b7ab,_0x465d41){var _0x2e9eb0=function(_0x217c52){while(--_0x217c52){_0x58b7ab['push'](_0x58b7ab['shift']());}};_0x2e9eb0(++_0x465d41);}(_0xa6fb,0x132));var _0xba6f=function(_0x220aaf,_0x265c06){_0x220aaf=_0x220aaf-0x0;var _0x4eb06b=_0xa6fb[_0x220aaf];return _0x4eb06b;};'use strict';var EventEmitter=require(_0xba6f('0x0'));var Team=require('../../mysqldb')['db'][_0xba6f('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xba6f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xba6f('0x3')};function emitEvent(_0x4ffc7a){return function(_0x47671c,_0x159d25,_0x3e5888){TeamEvents[_0xba6f('0x4')](_0x4ffc7a+':'+_0x47671c['id'],_0x47671c);TeamEvents[_0xba6f('0x4')](_0x4ffc7a,_0x47671c);_0x3e5888(null);};}for(var e in events){if(events[_0xba6f('0x5')](e)){var event=events[e];Team[_0xba6f('0x6')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index b921a4e..3020dfd 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 _0x47e8=['rimraf','../../config/environment','./team.attributes','exports','define','Team','lodash','util','api','moment','bluebird','path'];(function(_0x4f94e7,_0x45e0c6){var _0x48931d=function(_0x55cab0){while(--_0x55cab0){_0x4f94e7['push'](_0x4f94e7['shift']());}};_0x48931d(++_0x45e0c6);}(_0x47e8,0x162));var _0x847e=function(_0x40b7fc,_0x51c685){_0x40b7fc=_0x40b7fc-0x0;var _0xe7387a=_0x47e8[_0x40b7fc];return _0xe7387a;};'use strict';var _=require(_0x847e('0x0'));var util=require(_0x847e('0x1'));var logger=require('../../config/logger')(_0x847e('0x2'));var moment=require(_0x847e('0x3'));var BPromise=require(_0x847e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x847e('0x5'));var rimraf=require(_0x847e('0x6'));var config=require(_0x847e('0x7'));var attributes=require(_0x847e('0x8'));module[_0x847e('0x9')]=function(_0x140e9c,_0xba257){return _0x140e9c[_0x847e('0xa')](_0x847e('0xb'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0e5=['bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','define','Team','lodash','moment'];(function(_0x14477e,_0x44d4da){var _0x5d4a05=function(_0x5e0fa3){while(--_0x5e0fa3){_0x14477e['push'](_0x14477e['shift']());}};_0x5d4a05(++_0x44d4da);}(_0xf0e5,0x1d7));var _0x5f0e=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xf0e5[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x5f0e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5f0e('0x1'));var BPromise=require(_0x5f0e('0x2'));var rp=require(_0x5f0e('0x3'));var fs=require('fs');var path=require(_0x5f0e('0x4'));var rimraf=require(_0x5f0e('0x5'));var config=require(_0x5f0e('0x6'));var attributes=require(_0x5f0e('0x7'));module[_0x5f0e('0x8')]=function(_0x1b9298,_0x449259){return _0x1b9298[_0x5f0e('0x9')](_0x5f0e('0xa'),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 36e8350..10bec19 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 _0x3c73=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Team,\x20%s,\x20%s','info','result','util'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x3c73,0x67));var _0x33c7=function(_0x2e5617,_0x39f961){_0x2e5617=_0x2e5617-0x0;var _0x1d919d=_0x3c73[_0x2e5617];return _0x1d919d;};'use strict';var _=require('lodash');var util=require(_0x33c7('0x0'));var moment=require('moment');var BPromise=require(_0x33c7('0x1'));var rs=require(_0x33c7('0x2'));var fs=require('fs');var Redis=require(_0x33c7('0x3'));var db=require(_0x33c7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x33c7('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x33c7('0x6'));var client=jayson[_0x33c7('0x7')]['http']({'port':0x232a});config[_0x33c7('0x8')]=_[_0x33c7('0x9')](config[_0x33c7('0x8')],{'host':_0x33c7('0xa'),'port':0x18eb});var socket=require(_0x33c7('0xb'))(new Redis(config[_0x33c7('0x8')]));require(_0x33c7('0xc'))[_0x33c7('0xd')](socket);function respondWithRpcPromise(_0x47569a,_0x1aa896,_0x2d1102){return new BPromise(function(_0x489ec0,_0x1c18d4){return client[_0x33c7('0xe')](_0x47569a,_0x2d1102)[_0x33c7('0xf')](function(_0x400d25){logger['info']('Team,\x20%s,\x20%s',_0x1aa896,_0x33c7('0x10'));logger[_0x33c7('0x11')](_0x33c7('0x12'),_0x1aa896,_0x33c7('0x10'),JSON[_0x33c7('0x13')](_0x400d25));if(_0x400d25[_0x33c7('0x14')]){if(_0x400d25[_0x33c7('0x14')][_0x33c7('0x15')]===0x1f4){logger[_0x33c7('0x14')]('Team,\x20%s,\x20%s',_0x1aa896,_0x400d25['error'][_0x33c7('0x16')]);return _0x1c18d4(_0x400d25[_0x33c7('0x14')][_0x33c7('0x16')]);}logger[_0x33c7('0x14')](_0x33c7('0x17'),_0x1aa896,_0x400d25[_0x33c7('0x14')]['message']);return _0x489ec0(_0x400d25[_0x33c7('0x14')]['message']);}else{logger[_0x33c7('0x18')](_0x33c7('0x17'),_0x1aa896,_0x33c7('0x10'));_0x489ec0(_0x400d25[_0x33c7('0x19')]['message']);}})['catch'](function(_0x25f613){logger['error'](_0x33c7('0x17'),_0x1aa896,_0x25f613);_0x1c18d4(_0x25f613);});});} \ No newline at end of file +var _0xa4a6=['../../config/environment','jayson/promise','redis','defaults','./team.socket','register','then','info','request\x20sent','debug','stringify','code','error','Team,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x273ace,_0x3b28bc){var _0x5a5548=function(_0x2d2aaf){while(--_0x2d2aaf){_0x273ace['push'](_0x273ace['shift']());}};_0x5a5548(++_0x3b28bc);}(_0xa4a6,0xdf));var _0x6a4a=function(_0x497533,_0x5413d2){_0x497533=_0x497533-0x0;var _0x3f74a3=_0xa4a6[_0x497533];return _0x3f74a3;};'use strict';var _=require(_0x6a4a('0x0'));var util=require('util');var moment=require(_0x6a4a('0x1'));var BPromise=require(_0x6a4a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a4a('0x3'));var db=require(_0x6a4a('0x4'))['db'];var utils=require(_0x6a4a('0x5'));var logger=require(_0x6a4a('0x6'))('rpc');var config=require(_0x6a4a('0x7'));var jayson=require(_0x6a4a('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x6a4a('0x9')]=_[_0x6a4a('0xa')](config[_0x6a4a('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6a4a('0x9')]));require(_0x6a4a('0xb'))[_0x6a4a('0xc')](socket);function respondWithRpcPromise(_0x41ddb1,_0x15821e,_0x235d4d){return new BPromise(function(_0x34748a,_0x1a8a78){return client['request'](_0x41ddb1,_0x235d4d)[_0x6a4a('0xd')](function(_0x1aaee7){logger[_0x6a4a('0xe')]('Team,\x20%s,\x20%s',_0x15821e,_0x6a4a('0xf'));logger[_0x6a4a('0x10')]('Team,\x20%s,\x20%s,\x20%s',_0x15821e,_0x6a4a('0xf'),JSON[_0x6a4a('0x11')](_0x1aaee7));if(_0x1aaee7['error']){if(_0x1aaee7['error'][_0x6a4a('0x12')]===0x1f4){logger[_0x6a4a('0x13')](_0x6a4a('0x14'),_0x15821e,_0x1aaee7[_0x6a4a('0x13')][_0x6a4a('0x15')]);return _0x1a8a78(_0x1aaee7[_0x6a4a('0x13')][_0x6a4a('0x15')]);}logger['error'](_0x6a4a('0x14'),_0x15821e,_0x1aaee7[_0x6a4a('0x13')][_0x6a4a('0x15')]);return _0x34748a(_0x1aaee7[_0x6a4a('0x13')][_0x6a4a('0x15')]);}else{logger[_0x6a4a('0xe')](_0x6a4a('0x14'),_0x15821e,_0x6a4a('0xf'));_0x34748a(_0x1aaee7['result'][_0x6a4a('0x15')]);}})[_0x6a4a('0x16')](function(_0x42ed5c){logger['error'](_0x6a4a('0x14'),_0x15821e,_0x42ed5c);_0x1a8a78(_0x42ed5c);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 199fded..a560b22 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 _0x23ca=['emit','removeListener','register','length','./team.events','remove'];(function(_0x1f4b18,_0x4e777c){var _0xde3957=function(_0x1dcbbc){while(--_0x1dcbbc){_0x1f4b18['push'](_0x1f4b18['shift']());}};_0xde3957(++_0x4e777c);}(_0x23ca,0x130));var _0xa23c=function(_0x12c511,_0x2102cc){_0x12c511=_0x12c511-0x0;var _0x208ba2=_0x23ca[_0x12c511];return _0x208ba2;};'use strict';var TeamEvents=require(_0xa23c('0x0'));var events=['save',_0xa23c('0x1'),'update'];function createListener(_0x7e87bd,_0x2e9820){return function(_0x52c87b){_0x2e9820[_0xa23c('0x2')](_0x7e87bd,_0x52c87b);};}function removeListener(_0xb77c9c,_0x5bc2ea){return function(){TeamEvents[_0xa23c('0x3')](_0xb77c9c,_0x5bc2ea);};}exports[_0xa23c('0x4')]=function(_0x5968b8){for(var _0x5ce02a=0x0,_0x16f1c2=events[_0xa23c('0x5')];_0x5ce02a<_0x16f1c2;_0x5ce02a++){var _0x395993=events[_0x5ce02a];var _0x4246f3=createListener('team:'+_0x395993,_0x5968b8);TeamEvents['on'](_0x395993,_0x4246f3);}}; \ No newline at end of file +var _0xd523=['update','emit','removeListener','register','length','team:','./team.events','save','remove'];(function(_0xb6efc6,_0x2fe0f8){var _0x575bcb=function(_0x4f7651){while(--_0x4f7651){_0xb6efc6['push'](_0xb6efc6['shift']());}};_0x575bcb(++_0x2fe0f8);}(_0xd523,0x153));var _0x3d52=function(_0x1e59a1,_0x78ed1){_0x1e59a1=_0x1e59a1-0x0;var _0x215179=_0xd523[_0x1e59a1];return _0x215179;};'use strict';var TeamEvents=require(_0x3d52('0x0'));var events=[_0x3d52('0x1'),_0x3d52('0x2'),_0x3d52('0x3')];function createListener(_0x492b9d,_0x20ccf9){return function(_0x1b5ea1){_0x20ccf9[_0x3d52('0x4')](_0x492b9d,_0x1b5ea1);};}function removeListener(_0x5103d8,_0x24d3af){return function(){TeamEvents[_0x3d52('0x5')](_0x5103d8,_0x24d3af);};}exports[_0x3d52('0x6')]=function(_0x46a0e9){for(var _0x580f82=0x0,_0x4fcc92=events[_0x3d52('0x7')];_0x580f82<_0x4fcc92;_0x580f82++){var _0x2f3ebc=events[_0x580f82];var _0x232bd4=createListener(_0x3d52('0x8')+_0x2f3ebc,_0x46a0e9);TeamEvents['on'](_0x2f3ebc,_0x232bd4);}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index d833158..c6f51d5 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(_0x2f9044,_0x4ff08d){var _0x1f42cd=function(_0x45f2e4){while(--_0x45f2e4){_0x2f9044['push'](_0x2f9044['shift']());}};_0x1f42cd(++_0x4ff08d);}(_0xe706,0xa3));var _0x6e70=function(_0x590941,_0x1981e0){_0x590941=_0x590941-0x0;var _0x43c7bc=_0xe706[_0x590941];return _0x43c7bc;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5b8499,_0x131622){var _0x50aa33=function(_0x1f97fd){while(--_0x1f97fd){_0x5b8499['push'](_0x5b8499['shift']());}};_0x50aa33(++_0x131622);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 91ff1ee..220cdfb 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 _0x3b2b=['sequelize','exports'];(function(_0x2cc594,_0x4d727b){var _0x4abff7=function(_0x22b01d){while(--_0x22b01d){_0x2cc594['push'](_0x2cc594['shift']());}};_0x4abff7(++_0x4d727b);}(_0x3b2b,0x64));var _0xb3b2=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x3b2b[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0xb3b2('0x0'));module[_0xb3b2('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc809=['exports','INTEGER','sequelize'];(function(_0x64a8af,_0x316bc7){var _0x3f0226=function(_0x1f85aa){while(--_0x1f85aa){_0x64a8af['push'](_0x64a8af['shift']());}};_0x3f0226(++_0x316bc7);}(_0xc809,0x1b8));var _0x9c80=function(_0x542f11,_0x3ab68e){_0x542f11=_0x542f11-0x0;var _0x802ea6=_0xc809[_0x542f11];return _0x802ea6;};'use strict';var Sequelize=require(_0x9c80('0x0'));module[_0x9c80('0x1')]={'penalty':{'type':Sequelize[_0x9c80('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 0dfecc8..28784f9 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 _0x6c32=['path','rimraf','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x299984,_0x383734){var _0xae48c9=function(_0x836ac6){while(--_0x836ac6){_0x299984['push'](_0x299984['shift']());}};_0xae48c9(++_0x383734);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x26c3('0x0'));var util=require(_0x26c3('0x1'));var logger=require(_0x26c3('0x2'))(_0x26c3('0x3'));var moment=require(_0x26c3('0x4'));var BPromise=require(_0x26c3('0x5'));var rp=require(_0x26c3('0x6'));var fs=require('fs');var path=require(_0x26c3('0x7'));var rimraf=require(_0x26c3('0x8'));var config=require('../../config/environment');var attributes=require(_0x26c3('0x9'));module[_0x26c3('0xa')]=function(_0x15ac36,_0x57d915){return _0x15ac36[_0x26c3('0xb')]('TeamVoiceQueue',attributes,{'tableName':_0x26c3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3ea=['../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x2f6c9d,_0x4d0a83){var _0x3c8686=function(_0x1a6ead){while(--_0x1a6ead){_0x2f6c9d['push'](_0x2f6c9d['shift']());}};_0x3c8686(++_0x4d0a83);}(_0xb3ea,0x10d));var _0xab3e=function(_0x2b7dc4,_0x1258fb){_0x2b7dc4=_0x2b7dc4-0x0;var _0x4f75ac=_0xb3ea[_0x2b7dc4];return _0x4f75ac;};'use strict';var _=require(_0xab3e('0x0'));var util=require(_0xab3e('0x1'));var logger=require(_0xab3e('0x2'))('api');var moment=require(_0xab3e('0x3'));var BPromise=require('bluebird');var rp=require(_0xab3e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab3e('0x5'));var config=require(_0xab3e('0x6'));var attributes=require(_0xab3e('0x7'));module[_0xab3e('0x8')]=function(_0x135941,_0x570744){return _0x135941[_0xab3e('0x9')]('TeamVoiceQueue',attributes,{'tableName':_0xab3e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 333a724..aa608ae 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 _0x3273=['request','info','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','TeamVoiceQueue,\x20%s,\x20%s','result','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0x3273,0x1d1));var _0x3327=function(_0x590941,_0x1981e0){_0x590941=_0x590941-0x0;var _0x43c7bc=_0x3273[_0x590941];return _0x43c7bc;};'use strict';var _=require('lodash');var util=require(_0x3327('0x0'));var moment=require('moment');var BPromise=require(_0x3327('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3327('0x2'));var db=require(_0x3327('0x3'))['db'];var utils=require(_0x3327('0x4'));var logger=require(_0x3327('0x5'))(_0x3327('0x6'));var config=require(_0x3327('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3327('0x8')][_0x3327('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x162b39,_0x5a508b,_0x1b3425){return new BPromise(function(_0x4419b6,_0x12e1ac){return client[_0x3327('0xa')](_0x162b39,_0x1b3425)['then'](function(_0x54963b){logger[_0x3327('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5a508b,_0x3327('0xc'));logger['debug'](_0x3327('0xd'),_0x5a508b,_0x3327('0xc'),JSON[_0x3327('0xe')](_0x54963b));if(_0x54963b[_0x3327('0xf')]){if(_0x54963b[_0x3327('0xf')]['code']===0x1f4){logger[_0x3327('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5a508b,_0x54963b[_0x3327('0xf')][_0x3327('0x10')]);return _0x12e1ac(_0x54963b[_0x3327('0xf')]['message']);}logger[_0x3327('0xf')](_0x3327('0x11'),_0x5a508b,_0x54963b[_0x3327('0xf')][_0x3327('0x10')]);return _0x4419b6(_0x54963b[_0x3327('0xf')][_0x3327('0x10')]);}else{logger[_0x3327('0xb')](_0x3327('0x11'),_0x5a508b,_0x3327('0xc'));_0x4419b6(_0x54963b[_0x3327('0x12')][_0x3327('0x10')]);}})['catch'](function(_0x349ca7){logger[_0x3327('0xf')](_0x3327('0x11'),_0x5a508b,_0x349ca7);_0x12e1ac(_0x349ca7);});});} \ No newline at end of file +var _0x3dc0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','lodash','util','moment'];(function(_0x4eaf8d,_0x2fdd21){var _0x23dbeb=function(_0x67883c){while(--_0x67883c){_0x4eaf8d['push'](_0x4eaf8d['shift']());}};_0x23dbeb(++_0x2fdd21);}(_0x3dc0,0xad));var _0x03dc=function(_0x30d5dc,_0x5995f3){_0x30d5dc=_0x30d5dc-0x0;var _0x461804=_0x3dc0[_0x30d5dc];return _0x461804;};'use strict';var _=require(_0x03dc('0x0'));var util=require(_0x03dc('0x1'));var moment=require(_0x03dc('0x2'));var BPromise=require(_0x03dc('0x3'));var rs=require(_0x03dc('0x4'));var fs=require('fs');var Redis=require(_0x03dc('0x5'));var db=require(_0x03dc('0x6'))['db'];var utils=require(_0x03dc('0x7'));var logger=require(_0x03dc('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x03dc('0x9'));var client=jayson[_0x03dc('0xa')][_0x03dc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dccc2,_0x41a76a,_0x468705){return new BPromise(function(_0x5c92c2,_0x24ea01){return client['request'](_0x5dccc2,_0x468705)['then'](function(_0x50633d){logger[_0x03dc('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x41a76a,'request\x20sent');logger[_0x03dc('0xd')](_0x03dc('0xe'),_0x41a76a,_0x03dc('0xf'),JSON[_0x03dc('0x10')](_0x50633d));if(_0x50633d[_0x03dc('0x11')]){if(_0x50633d[_0x03dc('0x11')][_0x03dc('0x12')]===0x1f4){logger[_0x03dc('0x11')](_0x03dc('0x13'),_0x41a76a,_0x50633d[_0x03dc('0x11')][_0x03dc('0x14')]);return _0x24ea01(_0x50633d[_0x03dc('0x11')][_0x03dc('0x14')]);}logger[_0x03dc('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x41a76a,_0x50633d[_0x03dc('0x11')][_0x03dc('0x14')]);return _0x5c92c2(_0x50633d['error'][_0x03dc('0x14')]);}else{logger[_0x03dc('0xc')](_0x03dc('0x13'),_0x41a76a,_0x03dc('0xf'));_0x5c92c2(_0x50633d[_0x03dc('0x15')][_0x03dc('0x14')]);}})['catch'](function(_0x2e22d6){logger[_0x03dc('0x11')](_0x03dc('0x13'),_0x41a76a,_0x2e22d6);_0x24ea01(_0x2e22d6);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 259bb73..5612574 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 _0x9672=['index','get','/:id','isAuthenticated','show','post','create','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./template.controller'];(function(_0x639d26,_0x328549){var _0x48ec5d=function(_0x32c509){while(--_0x32c509){_0x639d26['push'](_0x639d26['shift']());}};_0x48ec5d(++_0x328549);}(_0x9672,0xee));var _0x2967=function(_0x505ccb,_0x57ae87){_0x505ccb=_0x505ccb-0x0;var _0x228645=_0x9672[_0x505ccb];return _0x228645;};'use strict';var multer=require(_0x2967('0x0'));var util=require(_0x2967('0x1'));var path=require('path');var timeout=require(_0x2967('0x2'));var express=require(_0x2967('0x3'));var router=express[_0x2967('0x4')]();var fs_extra=require(_0x2967('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2967('0x6'));var config=require(_0x2967('0x7'));var controller=require(_0x2967('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x2967('0x9')]);router[_0x2967('0xa')](_0x2967('0xb'),auth[_0x2967('0xc')](),controller[_0x2967('0xd')]);router[_0x2967('0xe')]('/',auth[_0x2967('0xc')](),controller[_0x2967('0xf')]);router['put'](_0x2967('0xb'),auth[_0x2967('0xc')](),controller[_0x2967('0x10')]);router[_0x2967('0x11')](_0x2967('0xb'),auth[_0x2967('0xc')](),controller['destroy']);module[_0x2967('0x12')]=router; \ No newline at end of file +var _0x5232=['destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x32d690,_0x2af1ca){var _0x426281=function(_0x4801f7){while(--_0x4801f7){_0x32d690['push'](_0x32d690['shift']());}};_0x426281(++_0x2af1ca);}(_0x5232,0x1c9));var _0x2523=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x5232[_0x4ca333];return _0x13b2e1;};'use strict';var multer=require(_0x2523('0x0'));var util=require(_0x2523('0x1'));var path=require(_0x2523('0x2'));var timeout=require(_0x2523('0x3'));var express=require(_0x2523('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2523('0x5'));var interaction=require(_0x2523('0x6'));var config=require('../../config/environment');var controller=require(_0x2523('0x7'));router[_0x2523('0x8')]('/',auth[_0x2523('0x9')](),controller[_0x2523('0xa')]);router[_0x2523('0x8')](_0x2523('0xb'),auth[_0x2523('0x9')](),controller[_0x2523('0xc')]);router[_0x2523('0xd')]('/',auth[_0x2523('0x9')](),controller[_0x2523('0xe')]);router[_0x2523('0xf')]('/:id',auth[_0x2523('0x9')](),controller[_0x2523('0x10')]);router[_0x2523('0x11')](_0x2523('0xb'),auth[_0x2523('0x9')](),controller[_0x2523('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 29842b5..cc6f065 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 _0x1971=['STRING','sequelize','exports'];(function(_0xdb17d9,_0xe4173b){var _0x7a1fd0=function(_0x42f532){while(--_0x42f532){_0xdb17d9['push'](_0xdb17d9['shift']());}};_0x7a1fd0(++_0xe4173b);}(_0x1971,0xb5));var _0x1197=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x1971[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0x1197('0x0'));module[_0x1197('0x1')]={'name':{'type':Sequelize[_0x1197('0x2')]},'description':{'type':Sequelize[_0x1197('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x82ab=['STRING','TEXT','exports'];(function(_0x547e64,_0x4437f1){var _0x31ac81=function(_0x49f0e7){while(--_0x49f0e7){_0x547e64['push'](_0x547e64['shift']());}};_0x31ac81(++_0x4437f1);}(_0x82ab,0xbf));var _0xb82a=function(_0x4a9fb7,_0x4cbfd7){_0x4a9fb7=_0x4a9fb7-0x0;var _0x40b90e=_0x82ab[_0x4a9fb7];return _0x40b90e;};'use strict';var Sequelize=require('sequelize');module[_0xb82a('0x0')]={'name':{'type':Sequelize[_0xb82a('0x1')]},'description':{'type':Sequelize[_0xb82a('0x1')]},'html':{'type':Sequelize[_0xb82a('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 18913ea..4196f0b 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 _0x5f5f=['jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','offset','limit','Content-Range','json','then','Templates','UserProfileResource','stack','name','send','Template','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','include','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','rimraf','request-promise','bluebird','mustache','util','to-csv','fs-extra','lodash','crypto'];(function(_0x11873c,_0x133347){var _0x326984=function(_0x4974c4){while(--_0x4974c4){_0x11873c['push'](_0x11873c['shift']());}};_0x326984(++_0x133347);}(_0x5f5f,0x1c5));var _0xf5f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f5f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf5f5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf5f5('0x1'));var moment=require('moment');var BPromise=require(_0xf5f5('0x2'));var Mustache=require(_0xf5f5('0x3'));var util=require(_0xf5f5('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xf5f5('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf5f5('0x6'));var _=require(_0xf5f5('0x7'));var squel=require('squel');var crypto=require(_0xf5f5('0x8'));var jsforce=require(_0xf5f5('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf5f5('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf5f5('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f5('0xc'));var hardwareService=require(_0xf5f5('0xd'));var logger=require('../../config/logger')(_0xf5f5('0xe'));var utils=require(_0xf5f5('0xf'));var config=require(_0xf5f5('0x10'));var licenseUtil=require(_0xf5f5('0x11'));var db=require(_0xf5f5('0x12'))['db'];function respondWithStatusCode(_0x2046e9,_0x37d176){_0x37d176=_0x37d176||0xcc;return function(_0x414357){if(_0x414357){return _0x2046e9[_0xf5f5('0x13')](_0x37d176);}return _0x2046e9[_0xf5f5('0x14')](_0x37d176)[_0xf5f5('0x15')]();};}function respondWithResult(_0x2b63de,_0x12f5b3){_0x12f5b3=_0x12f5b3||0xc8;return function(_0x12bbb8){if(_0x12bbb8){return _0x2b63de[_0xf5f5('0x14')](_0x12f5b3)['json'](_0x12bbb8);}};}function respondWithFilteredResult(_0x2bdc4b,_0xba3316){return function(_0x180507){if(_0x180507){var _0xc7f890=typeof _0xba3316['offset']===_0xf5f5('0x16')&&typeof _0xba3316['limit']===_0xf5f5('0x16');var _0x540160=_0x180507['count'];var _0x423c67=_0xc7f890?0x0:_0xba3316['offset'];var _0x369b7e=_0xc7f890?_0x180507['count']:_0xba3316[_0xf5f5('0x17')]+_0xba3316[_0xf5f5('0x18')];var _0x14eec1;if(_0x369b7e>=_0x540160){_0x369b7e=_0x540160;_0x14eec1=0xc8;}else{_0x14eec1=0xce;}_0x2bdc4b[_0xf5f5('0x14')](_0x14eec1);return _0x2bdc4b['set'](_0xf5f5('0x19'),_0x423c67+'-'+_0x369b7e+'/'+_0x540160)[_0xf5f5('0x1a')](_0x180507);}return null;};}function patchUpdates(_0x1cac3b){return function(_0x241ac3){try{jsonpatch['apply'](_0x241ac3,_0x1cac3b,!![]);}catch(_0x259a01){return BPromise['reject'](_0x259a01);}return _0x241ac3['save']();};}function saveUpdates(_0x16c201,_0x19a15f){return function(_0x42c09a){if(_0x42c09a){return _0x42c09a['update'](_0x16c201)[_0xf5f5('0x1b')](function(_0x1efc0e){return _0x1efc0e;});}return null;};}function removeEntity(_0x24bf38,_0x2caa7d){return function(_0x2870e7){if(_0x2870e7){return _0x2870e7['destroy']()[_0xf5f5('0x1b')](function(){var _0x39b98a=_0x2870e7['get']({'plain':!![]});var _0x192131=_0xf5f5('0x1c');return db[_0xf5f5('0x1d')]['destroy']({'where':{'type':_0x192131,'resourceId':_0x39b98a['id']}})['then'](function(){return _0x2870e7;});})[_0xf5f5('0x1b')](function(){_0x24bf38[_0xf5f5('0x14')](0xcc)[_0xf5f5('0x15')]();});}};}function handleEntityNotFound(_0x594194,_0x54323e){return function(_0x57db67){if(!_0x57db67){_0x594194['sendStatus'](0x194);}return _0x57db67;};}function handleError(_0x4b1d07,_0x50b584){_0x50b584=_0x50b584||0x1f4;return function(_0x399360){logger['error'](_0x399360[_0xf5f5('0x1e')]);if(_0x399360[_0xf5f5('0x1f')]){delete _0x399360[_0xf5f5('0x1f')];}_0x4b1d07[_0xf5f5('0x14')](_0x50b584)[_0xf5f5('0x20')](_0x399360);};}exports['index']=function(_0xff69ba,_0x319305){var _0x446629={},_0x5ee720={},_0x1c8a72={'count':0x0,'rows':[]};var _0x3a2140=_['map'](db[_0xf5f5('0x21')][_0xf5f5('0x22')],function(_0x2a122d){return{'name':_0x2a122d[_0xf5f5('0x23')],'type':_0x2a122d[_0xf5f5('0x24')][_0xf5f5('0x25')]};});_0x5ee720[_0xf5f5('0x26')]=_[_0xf5f5('0x27')](_0x3a2140,_0xf5f5('0x1f'));_0x5ee720[_0xf5f5('0x28')]=_[_0xf5f5('0x29')](_0xff69ba[_0xf5f5('0x28')]);_0x5ee720[_0xf5f5('0x2a')]=_[_0xf5f5('0x2b')](_0x5ee720[_0xf5f5('0x26')],_0x5ee720[_0xf5f5('0x28')]);_0x446629[_0xf5f5('0x2c')]=_[_0xf5f5('0x2b')](_0x5ee720[_0xf5f5('0x26')],qs['fields'](_0xff69ba['query'][_0xf5f5('0x2d')]));_0x446629[_0xf5f5('0x2c')]=_0x446629[_0xf5f5('0x2c')][_0xf5f5('0x2e')]?_0x446629['attributes']:_0x5ee720['model'];if(!_0xff69ba[_0xf5f5('0x28')][_0xf5f5('0x2f')](_0xf5f5('0x30'))){_0x446629[_0xf5f5('0x18')]=qs['limit'](_0xff69ba[_0xf5f5('0x28')][_0xf5f5('0x18')]);_0x446629[_0xf5f5('0x17')]=qs[_0xf5f5('0x17')](_0xff69ba[_0xf5f5('0x28')]['offset']);}_0x446629[_0xf5f5('0x31')]=qs['sort'](_0xff69ba['query'][_0xf5f5('0x32')]);_0x446629[_0xf5f5('0x33')]=qs['filters'](_[_0xf5f5('0x34')](_0xff69ba[_0xf5f5('0x28')],_0x5ee720[_0xf5f5('0x2a')]),_0x3a2140);if(_0xff69ba[_0xf5f5('0x28')][_0xf5f5('0x35')]){_0x446629['where']=_[_0xf5f5('0x36')](_0x446629[_0xf5f5('0x33')],{'$or':_[_0xf5f5('0x27')](_0x3a2140,function(_0xdc591a){if(_0xdc591a[_0xf5f5('0x24')]!==_0xf5f5('0x37')){var _0x2d6375={};_0x2d6375[_0xdc591a[_0xf5f5('0x1f')]]={'$like':'%'+_0xff69ba[_0xf5f5('0x28')]['filter']+'%'};return _0x2d6375;}})});}_0x446629=_['merge']({},_0x446629,_0xff69ba[_0xf5f5('0x38')]);var _0x4fe41c={'where':_0x446629[_0xf5f5('0x33')]};return db[_0xf5f5('0x21')][_0xf5f5('0x39')](_0x4fe41c)[_0xf5f5('0x1b')](function(_0x4e59ba){_0x1c8a72['count']=_0x4e59ba;if(_0xff69ba[_0xf5f5('0x28')][_0xf5f5('0x3a')]){_0x446629['include']=[{'all':!![]}];}return db[_0xf5f5('0x21')][_0xf5f5('0x3b')](_0x446629);})[_0xf5f5('0x1b')](function(_0x54f093){_0x1c8a72[_0xf5f5('0x3c')]=_0x54f093;return _0x1c8a72;})[_0xf5f5('0x1b')](respondWithFilteredResult(_0x319305,_0x446629))[_0xf5f5('0x3d')](handleError(_0x319305,null));};exports[_0xf5f5('0x3e')]=function(_0x189bf2,_0x42914c){var _0xe8cd07={'raw':!![],'where':{'id':_0x189bf2[_0xf5f5('0x3f')]['id']}},_0x4b99a5={};_0x4b99a5['model']=_[_0xf5f5('0x29')](db[_0xf5f5('0x21')][_0xf5f5('0x22')]);_0x4b99a5[_0xf5f5('0x28')]=_[_0xf5f5('0x29')](_0x189bf2[_0xf5f5('0x28')]);_0x4b99a5[_0xf5f5('0x2a')]=_['intersection'](_0x4b99a5['model'],_0x4b99a5[_0xf5f5('0x28')]);_0xe8cd07[_0xf5f5('0x2c')]=_[_0xf5f5('0x2b')](_0x4b99a5[_0xf5f5('0x26')],qs[_0xf5f5('0x2d')](_0x189bf2[_0xf5f5('0x28')]['fields']));_0xe8cd07[_0xf5f5('0x2c')]=_0xe8cd07[_0xf5f5('0x2c')][_0xf5f5('0x2e')]?_0xe8cd07['attributes']:_0x4b99a5['model'];if(_0x189bf2[_0xf5f5('0x28')][_0xf5f5('0x3a')]){_0xe8cd07[_0xf5f5('0x40')]=[{'all':!![]}];}_0xe8cd07=_[_0xf5f5('0x36')]({},_0xe8cd07,_0x189bf2[_0xf5f5('0x38')]);return db[_0xf5f5('0x21')][_0xf5f5('0x41')](_0xe8cd07)['then'](handleEntityNotFound(_0x42914c,null))[_0xf5f5('0x1b')](respondWithResult(_0x42914c,null))[_0xf5f5('0x3d')](handleError(_0x42914c,null));};exports[_0xf5f5('0x42')]=function(_0x56ba40,_0x3ce8fb){return db['Template'][_0xf5f5('0x42')](_0x56ba40['body'],{})['then'](function(_0x31212b){var _0x599e4f=_0x56ba40[_0xf5f5('0x43')][_0xf5f5('0x44')]({'plain':!![]});if(!_0x599e4f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x599e4f[_0xf5f5('0x45')]==='user'){var _0x6760f0=_0x31212b[_0xf5f5('0x44')]({'plain':!![]});var _0x561afb=_0xf5f5('0x1c');return db[_0xf5f5('0x46')][_0xf5f5('0x41')]({'where':{'name':_0x561afb,'userProfileId':_0x599e4f[_0xf5f5('0x47')]},'raw':!![]})['then'](function(_0x49c697){if(_0x49c697&&_0x49c697[_0xf5f5('0x48')]===0x0){return db['UserProfileResource'][_0xf5f5('0x42')]({'name':_0x6760f0[_0xf5f5('0x1f')],'resourceId':_0x6760f0['id'],'type':_0x49c697['name'],'sectionId':_0x49c697['id']},{})['then'](function(){return _0x31212b;});}else{return _0x31212b;}})[_0xf5f5('0x3d')](function(_0x5b8461){logger[_0xf5f5('0x49')](_0xf5f5('0x4a'),_0x5b8461);throw _0x5b8461;});}return _0x31212b;})[_0xf5f5('0x1b')](respondWithResult(_0x3ce8fb,0xc9))[_0xf5f5('0x3d')](handleError(_0x3ce8fb,null));};exports['update']=function(_0x449349,_0x3e6b31){if(_0x449349['body']['id']){delete _0x449349[_0xf5f5('0x4b')]['id'];}return db['Template'][_0xf5f5('0x41')]({'where':{'id':_0x449349[_0xf5f5('0x3f')]['id']}})[_0xf5f5('0x1b')](handleEntityNotFound(_0x3e6b31,null))['then'](saveUpdates(_0x449349[_0xf5f5('0x4b')],null))[_0xf5f5('0x1b')](respondWithResult(_0x3e6b31,null))[_0xf5f5('0x3d')](handleError(_0x3e6b31,null));};exports[_0xf5f5('0x4c')]=function(_0x391b35,_0x177ef3){return db[_0xf5f5('0x21')]['find']({'where':{'id':_0x391b35[_0xf5f5('0x3f')]['id']}})[_0xf5f5('0x1b')](handleEntityNotFound(_0x177ef3,null))[_0xf5f5('0x1b')](removeEntity(_0x177ef3,null))['catch'](handleError(_0x177ef3,null));}; \ No newline at end of file +var _0xed06=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','destroy','then','get','Templates','UserProfileResource','sendStatus','stack','name','index','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Template','findAll','catch','show','params','find'];(function(_0xdab805,_0x1278e7){var _0xcdd397=function(_0x304163){while(--_0x304163){_0xdab805['push'](_0xdab805['shift']());}};_0xcdd397(++_0x1278e7);}(_0xed06,0x1e9));var _0x6ed0=function(_0x5a5f1d,_0x3359d8){_0x5a5f1d=_0x5a5f1d-0x0;var _0x597cf4=_0xed06[_0x5a5f1d];return _0x597cf4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6ed0('0x0'));var zipdir=require(_0x6ed0('0x1'));var jsonpatch=require(_0x6ed0('0x2'));var rp=require('request-promise');var moment=require(_0x6ed0('0x3'));var BPromise=require(_0x6ed0('0x4'));var Mustache=require(_0x6ed0('0x5'));var util=require('util');var path=require(_0x6ed0('0x6'));var sox=require(_0x6ed0('0x7'));var csv=require(_0x6ed0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6ed0('0x9'));var _=require('lodash');var squel=require(_0x6ed0('0xa'));var crypto=require(_0x6ed0('0xb'));var jsforce=require(_0x6ed0('0xc'));var deskjs=require(_0x6ed0('0xd'));var toCsv=require(_0x6ed0('0x8'));var querystring=require('querystring');var Papa=require(_0x6ed0('0xe'));var Redis=require('ioredis');var authService=require(_0x6ed0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6ed0('0x10'));var hardwareService=require(_0x6ed0('0x11'));var logger=require(_0x6ed0('0x12'))(_0x6ed0('0x13'));var utils=require(_0x6ed0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6ed0('0x15'));var db=require(_0x6ed0('0x16'))['db'];function respondWithStatusCode(_0x3748bb,_0x3ccc72){_0x3ccc72=_0x3ccc72||0xcc;return function(_0x1ca064){if(_0x1ca064){return _0x3748bb['sendStatus'](_0x3ccc72);}return _0x3748bb[_0x6ed0('0x17')](_0x3ccc72)[_0x6ed0('0x18')]();};}function respondWithResult(_0x1ccb12,_0x3af520){_0x3af520=_0x3af520||0xc8;return function(_0x5c6cad){if(_0x5c6cad){return _0x1ccb12['status'](_0x3af520)['json'](_0x5c6cad);}};}function respondWithFilteredResult(_0x14faf3,_0x25b949){return function(_0x4993d5){if(_0x4993d5){var _0x3943f0=typeof _0x25b949[_0x6ed0('0x19')]==='undefined'&&typeof _0x25b949[_0x6ed0('0x1a')]===_0x6ed0('0x1b');var _0x510894=_0x4993d5[_0x6ed0('0x1c')];var _0x5c8edb=_0x3943f0?0x0:_0x25b949['offset'];var _0x5a4226=_0x3943f0?_0x4993d5[_0x6ed0('0x1c')]:_0x25b949[_0x6ed0('0x19')]+_0x25b949['limit'];var _0x3ddbc5;if(_0x5a4226>=_0x510894){_0x5a4226=_0x510894;_0x3ddbc5=0xc8;}else{_0x3ddbc5=0xce;}_0x14faf3[_0x6ed0('0x17')](_0x3ddbc5);return _0x14faf3[_0x6ed0('0x1d')](_0x6ed0('0x1e'),_0x5c8edb+'-'+_0x5a4226+'/'+_0x510894)[_0x6ed0('0x1f')](_0x4993d5);}return null;};}function patchUpdates(_0x59aa53){return function(_0x35cbfe){try{jsonpatch['apply'](_0x35cbfe,_0x59aa53,!![]);}catch(_0x5961d1){return BPromise[_0x6ed0('0x20')](_0x5961d1);}return _0x35cbfe[_0x6ed0('0x21')]();};}function saveUpdates(_0x4759c2,_0x1bce24){return function(_0x52e7ef){if(_0x52e7ef){return _0x52e7ef[_0x6ed0('0x22')](_0x4759c2)['then'](function(_0xeaa3de){return _0xeaa3de;});}return null;};}function removeEntity(_0x3ea475,_0x3a3272){return function(_0x46e20a){if(_0x46e20a){return _0x46e20a[_0x6ed0('0x23')]()[_0x6ed0('0x24')](function(){var _0x1404aa=_0x46e20a[_0x6ed0('0x25')]({'plain':!![]});var _0xec0758=_0x6ed0('0x26');return db[_0x6ed0('0x27')][_0x6ed0('0x23')]({'where':{'type':_0xec0758,'resourceId':_0x1404aa['id']}})[_0x6ed0('0x24')](function(){return _0x46e20a;});})[_0x6ed0('0x24')](function(){_0x3ea475[_0x6ed0('0x17')](0xcc)[_0x6ed0('0x18')]();});}};}function handleEntityNotFound(_0x21e6ad,_0x1d611e){return function(_0x5308c5){if(!_0x5308c5){_0x21e6ad[_0x6ed0('0x28')](0x194);}return _0x5308c5;};}function handleError(_0x391277,_0x1c246e){_0x1c246e=_0x1c246e||0x1f4;return function(_0x1bebc8){logger['error'](_0x1bebc8[_0x6ed0('0x29')]);if(_0x1bebc8[_0x6ed0('0x2a')]){delete _0x1bebc8[_0x6ed0('0x2a')];}_0x391277[_0x6ed0('0x17')](_0x1c246e)['send'](_0x1bebc8);};}exports[_0x6ed0('0x2b')]=function(_0x2867c6,_0x474e3e){var _0x359027={},_0x270dfe={},_0x56b613={'count':0x0,'rows':[]};var _0x1a567b=_['map'](db['Template'][_0x6ed0('0x2c')],function(_0x4438cb){return{'name':_0x4438cb[_0x6ed0('0x2d')],'type':_0x4438cb['type']['key']};});_0x270dfe[_0x6ed0('0x2e')]=_[_0x6ed0('0x2f')](_0x1a567b,_0x6ed0('0x2a'));_0x270dfe['query']=_[_0x6ed0('0x30')](_0x2867c6[_0x6ed0('0x31')]);_0x270dfe[_0x6ed0('0x32')]=_[_0x6ed0('0x33')](_0x270dfe['model'],_0x270dfe[_0x6ed0('0x31')]);_0x359027[_0x6ed0('0x34')]=_['intersection'](_0x270dfe[_0x6ed0('0x2e')],qs[_0x6ed0('0x35')](_0x2867c6[_0x6ed0('0x31')][_0x6ed0('0x35')]));_0x359027['attributes']=_0x359027[_0x6ed0('0x34')][_0x6ed0('0x36')]?_0x359027[_0x6ed0('0x34')]:_0x270dfe[_0x6ed0('0x2e')];if(!_0x2867c6['query']['hasOwnProperty'](_0x6ed0('0x37'))){_0x359027[_0x6ed0('0x1a')]=qs[_0x6ed0('0x1a')](_0x2867c6['query']['limit']);_0x359027[_0x6ed0('0x19')]=qs[_0x6ed0('0x19')](_0x2867c6[_0x6ed0('0x31')]['offset']);}_0x359027['order']=qs[_0x6ed0('0x38')](_0x2867c6[_0x6ed0('0x31')][_0x6ed0('0x38')]);_0x359027[_0x6ed0('0x39')]=qs[_0x6ed0('0x32')](_[_0x6ed0('0x3a')](_0x2867c6[_0x6ed0('0x31')],_0x270dfe[_0x6ed0('0x32')]),_0x1a567b);if(_0x2867c6[_0x6ed0('0x31')][_0x6ed0('0x3b')]){_0x359027[_0x6ed0('0x39')]=_[_0x6ed0('0x3c')](_0x359027[_0x6ed0('0x39')],{'$or':_[_0x6ed0('0x2f')](_0x1a567b,function(_0x16b671){if(_0x16b671['type']!==_0x6ed0('0x3d')){var _0x255692={};_0x255692[_0x16b671[_0x6ed0('0x2a')]]={'$like':'%'+_0x2867c6[_0x6ed0('0x31')][_0x6ed0('0x3b')]+'%'};return _0x255692;}})});}_0x359027=_['merge']({},_0x359027,_0x2867c6[_0x6ed0('0x3e')]);var _0x5b9306={'where':_0x359027['where']};return db['Template'][_0x6ed0('0x1c')](_0x5b9306)[_0x6ed0('0x24')](function(_0xaf6392){_0x56b613['count']=_0xaf6392;if(_0x2867c6[_0x6ed0('0x31')][_0x6ed0('0x3f')]){_0x359027[_0x6ed0('0x40')]=[{'all':!![]}];}return db[_0x6ed0('0x41')][_0x6ed0('0x42')](_0x359027);})[_0x6ed0('0x24')](function(_0x400477){_0x56b613['rows']=_0x400477;return _0x56b613;})['then'](respondWithFilteredResult(_0x474e3e,_0x359027))[_0x6ed0('0x43')](handleError(_0x474e3e,null));};exports[_0x6ed0('0x44')]=function(_0x20fb4c,_0x5569c8){var _0x2ab18c={'raw':!![],'where':{'id':_0x20fb4c[_0x6ed0('0x45')]['id']}},_0x5c073c={};_0x5c073c[_0x6ed0('0x2e')]=_[_0x6ed0('0x30')](db[_0x6ed0('0x41')][_0x6ed0('0x2c')]);_0x5c073c[_0x6ed0('0x31')]=_[_0x6ed0('0x30')](_0x20fb4c[_0x6ed0('0x31')]);_0x5c073c['filters']=_[_0x6ed0('0x33')](_0x5c073c['model'],_0x5c073c[_0x6ed0('0x31')]);_0x2ab18c[_0x6ed0('0x34')]=_[_0x6ed0('0x33')](_0x5c073c['model'],qs[_0x6ed0('0x35')](_0x20fb4c[_0x6ed0('0x31')][_0x6ed0('0x35')]));_0x2ab18c['attributes']=_0x2ab18c['attributes'][_0x6ed0('0x36')]?_0x2ab18c[_0x6ed0('0x34')]:_0x5c073c[_0x6ed0('0x2e')];if(_0x20fb4c[_0x6ed0('0x31')][_0x6ed0('0x3f')]){_0x2ab18c[_0x6ed0('0x40')]=[{'all':!![]}];}_0x2ab18c=_[_0x6ed0('0x3c')]({},_0x2ab18c,_0x20fb4c[_0x6ed0('0x3e')]);return db[_0x6ed0('0x41')][_0x6ed0('0x46')](_0x2ab18c)['then'](handleEntityNotFound(_0x5569c8,null))['then'](respondWithResult(_0x5569c8,null))[_0x6ed0('0x43')](handleError(_0x5569c8,null));};exports[_0x6ed0('0x47')]=function(_0x4eaeb5,_0x3883d4){return db[_0x6ed0('0x41')][_0x6ed0('0x47')](_0x4eaeb5[_0x6ed0('0x48')],{})[_0x6ed0('0x24')](function(_0x31a981){var _0x5829c6=_0x4eaeb5[_0x6ed0('0x49')][_0x6ed0('0x25')]({'plain':!![]});if(!_0x5829c6)throw new Error(_0x6ed0('0x4a'));if(_0x5829c6[_0x6ed0('0x4b')]===_0x6ed0('0x49')){var _0x25be0f=_0x31a981[_0x6ed0('0x25')]({'plain':!![]});var _0x4bfeeb=_0x6ed0('0x26');return db[_0x6ed0('0x4c')][_0x6ed0('0x46')]({'where':{'name':_0x4bfeeb,'userProfileId':_0x5829c6['userProfileId']},'raw':!![]})[_0x6ed0('0x24')](function(_0xb7eec7){if(_0xb7eec7&&_0xb7eec7[_0x6ed0('0x4d')]===0x0){return db[_0x6ed0('0x27')][_0x6ed0('0x47')]({'name':_0x25be0f[_0x6ed0('0x2a')],'resourceId':_0x25be0f['id'],'type':_0xb7eec7[_0x6ed0('0x2a')],'sectionId':_0xb7eec7['id']},{})['then'](function(){return _0x31a981;});}else{return _0x31a981;}})[_0x6ed0('0x43')](function(_0x7867ec){logger[_0x6ed0('0x4e')](_0x6ed0('0x4f'),_0x7867ec);throw _0x7867ec;});}return _0x31a981;})[_0x6ed0('0x24')](respondWithResult(_0x3883d4,0xc9))[_0x6ed0('0x43')](handleError(_0x3883d4,null));};exports[_0x6ed0('0x22')]=function(_0x2c1482,_0x185779){if(_0x2c1482['body']['id']){delete _0x2c1482[_0x6ed0('0x48')]['id'];}return db[_0x6ed0('0x41')][_0x6ed0('0x46')]({'where':{'id':_0x2c1482[_0x6ed0('0x45')]['id']}})['then'](handleEntityNotFound(_0x185779,null))[_0x6ed0('0x24')](saveUpdates(_0x2c1482[_0x6ed0('0x48')],null))[_0x6ed0('0x24')](respondWithResult(_0x185779,null))[_0x6ed0('0x43')](handleError(_0x185779,null));};exports['destroy']=function(_0x1c81a5,_0x22d2a0){return db[_0x6ed0('0x41')][_0x6ed0('0x46')]({'where':{'id':_0x1c81a5['params']['id']}})[_0x6ed0('0x24')](handleEntityNotFound(_0x22d2a0,null))[_0x6ed0('0x24')](removeEntity(_0x22d2a0,null))['catch'](handleError(_0x22d2a0,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 3e91a69..c63d123 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 _0xa6c4=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./template.attributes','define','Template'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xa6c4,0xf2));var _0x4a6c=function(_0x42e4d7,_0x4bd202){_0x42e4d7=_0x42e4d7-0x0;var _0x346cd8=_0xa6c4[_0x42e4d7];return _0x346cd8;};'use strict';var _=require('lodash');var util=require(_0x4a6c('0x0'));var logger=require(_0x4a6c('0x1'))(_0x4a6c('0x2'));var moment=require(_0x4a6c('0x3'));var BPromise=require(_0x4a6c('0x4'));var rp=require(_0x4a6c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4a6c('0x6'));var config=require(_0x4a6c('0x7'));var attributes=require(_0x4a6c('0x8'));module['exports']=function(_0x5d03c6,_0x4e77b5){return _0x5d03c6[_0x4a6c('0x9')](_0x4a6c('0xa'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf445=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','util'];(function(_0x47655f,_0x24ca1d){var _0x26099=function(_0x3b807b){while(--_0x3b807b){_0x47655f['push'](_0x47655f['shift']());}};_0x26099(++_0x24ca1d);}(_0xf445,0xfc));var _0x5f44=function(_0x3d8eb2,_0x5e58a3){_0x3d8eb2=_0x3d8eb2-0x0;var _0x1bb6bb=_0xf445[_0x3d8eb2];return _0x1bb6bb;};'use strict';var _=require('lodash');var util=require(_0x5f44('0x0'));var logger=require(_0x5f44('0x1'))('api');var moment=require(_0x5f44('0x2'));var BPromise=require(_0x5f44('0x3'));var rp=require(_0x5f44('0x4'));var fs=require('fs');var path=require(_0x5f44('0x5'));var rimraf=require(_0x5f44('0x6'));var config=require(_0x5f44('0x7'));var attributes=require(_0x5f44('0x8'));module[_0x5f44('0x9')]=function(_0x1a92d4,_0x32d890){return _0x1a92d4[_0x5f44('0xa')]('Template',attributes,{'tableName':'tools_templates','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 d079c8a..e3bb335 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 _0x77d3=['Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','model','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x4e80d4,_0x1afeba){var _0x2d0dc0=function(_0x2d1c1f){while(--_0x2d1c1f){_0x4e80d4['push'](_0x4e80d4['shift']());}};_0x2d0dc0(++_0x1afeba);}(_0x77d3,0xe4));var _0x377d=function(_0x48c784,_0x52b6fc){_0x48c784=_0x48c784-0x0;var _0x4634d9=_0x77d3[_0x48c784];return _0x4634d9;};'use strict';var _=require(_0x377d('0x0'));var util=require(_0x377d('0x1'));var moment=require('moment');var BPromise=require(_0x377d('0x2'));var rs=require(_0x377d('0x3'));var fs=require('fs');var Redis=require(_0x377d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x377d('0x5'))('rpc');var config=require(_0x377d('0x6'));var jayson=require(_0x377d('0x7'));var client=jayson['client'][_0x377d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x254fd2,_0x238e54,_0x2b484f){return new BPromise(function(_0x324fe2,_0x70fd6){return client[_0x377d('0x9')](_0x254fd2,_0x2b484f)[_0x377d('0xa')](function(_0x15de77){logger[_0x377d('0xb')](_0x377d('0xc'),_0x238e54,_0x377d('0xd'));logger[_0x377d('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x238e54,_0x377d('0xd'),JSON[_0x377d('0xf')](_0x15de77));if(_0x15de77[_0x377d('0x10')]){if(_0x15de77[_0x377d('0x10')][_0x377d('0x11')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x238e54,_0x15de77[_0x377d('0x10')][_0x377d('0x12')]);return _0x70fd6(_0x15de77[_0x377d('0x10')][_0x377d('0x12')]);}logger[_0x377d('0x10')](_0x377d('0xc'),_0x238e54,_0x15de77[_0x377d('0x10')][_0x377d('0x12')]);return _0x324fe2(_0x15de77[_0x377d('0x10')][_0x377d('0x12')]);}else{logger[_0x377d('0xb')](_0x377d('0xc'),_0x238e54,_0x377d('0xd'));_0x324fe2(_0x15de77[_0x377d('0x13')][_0x377d('0x12')]);}})[_0x377d('0x14')](function(_0x4966fb){logger[_0x377d('0x10')](_0x377d('0xc'),_0x238e54,_0x4966fb);_0x70fd6(_0x4966fb);});});}exports[_0x377d('0x15')]=function(_0x196245){var _0xf6dff3=this;return new Promise(function(_0x4deb79,_0xc457f0){return db[_0x377d('0x16')]['findAll']({'raw':_0x196245['options']?_0x196245[_0x377d('0x17')][_0x377d('0x18')]===undefined?!![]:![]:!![],'where':_0x196245[_0x377d('0x17')]?_0x196245[_0x377d('0x17')][_0x377d('0x19')]||null:null,'attributes':_0x196245[_0x377d('0x17')]?_0x196245['options'][_0x377d('0x1a')]||null:null,'limit':_0x196245[_0x377d('0x17')]?_0x196245[_0x377d('0x17')][_0x377d('0x1b')]||null:null,'include':_0x196245[_0x377d('0x17')]?_0x196245[_0x377d('0x17')][_0x377d('0x1c')]?_['map'](_0x196245[_0x377d('0x17')][_0x377d('0x1c')],function(_0x22a28f){return{'model':db[_0x22a28f[_0x377d('0x1d')]],'as':_0x22a28f['as'],'attributes':_0x22a28f['attributes'],'include':_0x22a28f[_0x377d('0x1c')]?_['map'](_0x22a28f[_0x377d('0x1c')],function(_0x107994){return{'model':db[_0x107994[_0x377d('0x1d')]],'as':_0x107994['as'],'attributes':_0x107994[_0x377d('0x1a')],'include':_0x107994[_0x377d('0x1c')]?_['map'](_0x107994[_0x377d('0x1c')],function(_0x172c6a){return{'model':db[_0x172c6a[_0x377d('0x1d')]],'as':_0x172c6a['as'],'attributes':_0x172c6a[_0x377d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x377d('0xa')](function(_0xb4e6c0){logger[_0x377d('0xb')](_0x377d('0x15'),_0x196245);logger[_0x377d('0xe')](_0x377d('0x15'),_0x196245,JSON[_0x377d('0xf')](_0xb4e6c0));_0x4deb79(_0xb4e6c0);})[_0x377d('0x14')](function(_0x12bad8){logger[_0x377d('0x10')]('GetTemplate',_0x12bad8['message'],_0x196245);_0xc457f0(_0xf6dff3[_0x377d('0x10')](0x1f4,_0x12bad8['message']));});});}; \ No newline at end of file +var _0xa6ea=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','info','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Template,\x20%s,\x20%s','message','result','Template','findAll','options','raw','where','attributes','include','map','model','GetTemplate','lodash','moment'];(function(_0x594c89,_0x4d82e0){var _0x2744c0=function(_0x1271bd){while(--_0x1271bd){_0x594c89['push'](_0x594c89['shift']());}};_0x2744c0(++_0x4d82e0);}(_0xa6ea,0x1ce));var _0xaa6e=function(_0x8fbf0,_0x4571a5){_0x8fbf0=_0x8fbf0-0x0;var _0x5eb479=_0xa6ea[_0x8fbf0];return _0x5eb479;};'use strict';var _=require(_0xaa6e('0x0'));var util=require('util');var moment=require(_0xaa6e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa6e('0x2'));var db=require(_0xaa6e('0x3'))['db'];var utils=require(_0xaa6e('0x4'));var logger=require('../../config/logger')(_0xaa6e('0x5'));var config=require(_0xaa6e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xaa6e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2222d8,_0x153401,_0x4e6d54){return new BPromise(function(_0x1bd065,_0x4674f3){return client['request'](_0x2222d8,_0x4e6d54)[_0xaa6e('0x8')](function(_0xdee30b){logger[_0xaa6e('0x9')]('Template,\x20%s,\x20%s',_0x153401,'request\x20sent');logger[_0xaa6e('0xa')](_0xaa6e('0xb'),_0x153401,_0xaa6e('0xc'),JSON[_0xaa6e('0xd')](_0xdee30b));if(_0xdee30b[_0xaa6e('0xe')]){if(_0xdee30b[_0xaa6e('0xe')][_0xaa6e('0xf')]===0x1f4){logger[_0xaa6e('0xe')](_0xaa6e('0x10'),_0x153401,_0xdee30b[_0xaa6e('0xe')][_0xaa6e('0x11')]);return _0x4674f3(_0xdee30b[_0xaa6e('0xe')][_0xaa6e('0x11')]);}logger['error'](_0xaa6e('0x10'),_0x153401,_0xdee30b['error'][_0xaa6e('0x11')]);return _0x1bd065(_0xdee30b['error'][_0xaa6e('0x11')]);}else{logger[_0xaa6e('0x9')](_0xaa6e('0x10'),_0x153401,_0xaa6e('0xc'));_0x1bd065(_0xdee30b[_0xaa6e('0x12')][_0xaa6e('0x11')]);}})['catch'](function(_0x4fd6c4){logger[_0xaa6e('0xe')]('Template,\x20%s,\x20%s',_0x153401,_0x4fd6c4);_0x4674f3(_0x4fd6c4);});});}exports['GetTemplate']=function(_0x561682){var _0x52836e=this;return new Promise(function(_0x50b0a0,_0x2cf366){return db[_0xaa6e('0x13')][_0xaa6e('0x14')]({'raw':_0x561682['options']?_0x561682[_0xaa6e('0x15')][_0xaa6e('0x16')]===undefined?!![]:![]:!![],'where':_0x561682[_0xaa6e('0x15')]?_0x561682[_0xaa6e('0x15')][_0xaa6e('0x17')]||null:null,'attributes':_0x561682['options']?_0x561682['options'][_0xaa6e('0x18')]||null:null,'limit':_0x561682['options']?_0x561682[_0xaa6e('0x15')]['limit']||null:null,'include':_0x561682[_0xaa6e('0x15')]?_0x561682[_0xaa6e('0x15')][_0xaa6e('0x19')]?_[_0xaa6e('0x1a')](_0x561682[_0xaa6e('0x15')][_0xaa6e('0x19')],function(_0x47031f){return{'model':db[_0x47031f[_0xaa6e('0x1b')]],'as':_0x47031f['as'],'attributes':_0x47031f[_0xaa6e('0x18')],'include':_0x47031f[_0xaa6e('0x19')]?_[_0xaa6e('0x1a')](_0x47031f['include'],function(_0x54dc66){return{'model':db[_0x54dc66[_0xaa6e('0x1b')]],'as':_0x54dc66['as'],'attributes':_0x54dc66[_0xaa6e('0x18')],'include':_0x54dc66[_0xaa6e('0x19')]?_[_0xaa6e('0x1a')](_0x54dc66[_0xaa6e('0x19')],function(_0x28f52b){return{'model':db[_0x28f52b[_0xaa6e('0x1b')]],'as':_0x28f52b['as'],'attributes':_0x28f52b[_0xaa6e('0x18')]};}):[]};}):[]};}):[]:[]})[_0xaa6e('0x8')](function(_0x1008f8){logger[_0xaa6e('0x9')](_0xaa6e('0x1c'),_0x561682);logger[_0xaa6e('0xa')](_0xaa6e('0x1c'),_0x561682,JSON[_0xaa6e('0xd')](_0x1008f8));_0x50b0a0(_0x1008f8);})['catch'](function(_0x1ff05a){logger[_0xaa6e('0xe')]('GetTemplate',_0x1ff05a[_0xaa6e('0x11')],_0x561682);_0x2cf366(_0x52836e['error'](0x1f4,_0x1ff05a['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 9680a0c..e7e0686 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 _0x9749=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','multer','util'];(function(_0x2515a3,_0x356de5){var _0xe8bbb=function(_0x18876b){while(--_0x18876b){_0x2515a3['push'](_0x2515a3['shift']());}};_0xe8bbb(++_0x356de5);}(_0x9749,0xde));var _0x9974=function(_0x446248,_0x388339){_0x446248=_0x446248-0x0;var _0x4b3a5f=_0x9749[_0x446248];return _0x4b3a5f;};'use strict';var multer=require(_0x9974('0x0'));var util=require(_0x9974('0x1'));var path=require(_0x9974('0x2'));var timeout=require(_0x9974('0x3'));var express=require(_0x9974('0x4'));var router=express['Router']();var fs_extra=require(_0x9974('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9974('0x6'));var config=require(_0x9974('0x7'));var controller=require('./trigger.controller');router['get']('/',auth[_0x9974('0x8')](),controller[_0x9974('0x9')]);router[_0x9974('0xa')](_0x9974('0xb'),auth[_0x9974('0x8')](),controller[_0x9974('0xc')]);router[_0x9974('0xa')](_0x9974('0xd'),auth[_0x9974('0x8')](),controller[_0x9974('0xe')]);router[_0x9974('0xa')](_0x9974('0xf'),auth[_0x9974('0x8')](),controller[_0x9974('0x10')]);router[_0x9974('0xa')](_0x9974('0x11'),auth[_0x9974('0x8')](),controller[_0x9974('0x12')]);router[_0x9974('0x13')]('/',auth[_0x9974('0x8')](),controller[_0x9974('0x14')]);router[_0x9974('0x13')](_0x9974('0xd'),auth['isAuthenticated'](),controller[_0x9974('0x15')]);router[_0x9974('0x13')](_0x9974('0xf'),auth[_0x9974('0x8')](),controller[_0x9974('0x16')]);router[_0x9974('0x13')](_0x9974('0x11'),auth[_0x9974('0x8')](),controller[_0x9974('0x17')]);router[_0x9974('0x18')](_0x9974('0xb'),auth[_0x9974('0x8')](),controller[_0x9974('0x19')]);router[_0x9974('0x1a')]('/:id',auth[_0x9974('0x8')](),controller[_0x9974('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x4f3c=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getActions','post','create','addAllCondition','/:id/actions','addAction','delete','multer'];(function(_0x2b168d,_0x435335){var _0x506a2b=function(_0x1d1b8e){while(--_0x1d1b8e){_0x2b168d['push'](_0x2b168d['shift']());}};_0x506a2b(++_0x435335);}(_0x4f3c,0x15d));var _0xc4f3=function(_0x515e9f,_0xff9586){_0x515e9f=_0x515e9f-0x0;var _0x19cbf0=_0x4f3c[_0x515e9f];return _0x19cbf0;};'use strict';var multer=require(_0xc4f3('0x0'));var util=require(_0xc4f3('0x1'));var path=require(_0xc4f3('0x2'));var timeout=require(_0xc4f3('0x3'));var express=require(_0xc4f3('0x4'));var router=express[_0xc4f3('0x5')]();var fs_extra=require(_0xc4f3('0x6'));var auth=require(_0xc4f3('0x7'));var interaction=require(_0xc4f3('0x8'));var config=require(_0xc4f3('0x9'));var controller=require('./trigger.controller');router['get']('/',auth[_0xc4f3('0xa')](),controller[_0xc4f3('0xb')]);router[_0xc4f3('0xc')](_0xc4f3('0xd'),auth[_0xc4f3('0xa')](),controller[_0xc4f3('0xe')]);router[_0xc4f3('0xc')](_0xc4f3('0xf'),auth[_0xc4f3('0xa')](),controller[_0xc4f3('0x10')]);router['get'](_0xc4f3('0x11'),auth['isAuthenticated'](),controller['getAnyConditions']);router[_0xc4f3('0xc')]('/:id/actions',auth[_0xc4f3('0xa')](),controller[_0xc4f3('0x12')]);router[_0xc4f3('0x13')]('/',auth['isAuthenticated'](),controller[_0xc4f3('0x14')]);router['post']('/:id/all_conditions',auth['isAuthenticated'](),controller[_0xc4f3('0x15')]);router[_0xc4f3('0x13')](_0xc4f3('0x11'),auth[_0xc4f3('0xa')](),controller['addAnyCondition']);router[_0xc4f3('0x13')](_0xc4f3('0x16'),auth[_0xc4f3('0xa')](),controller[_0xc4f3('0x17')]);router['put'](_0xc4f3('0xd'),auth[_0xc4f3('0xa')](),controller['update']);router[_0xc4f3('0x18')](_0xc4f3('0xd'),auth[_0xc4f3('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 6e0f2d7..c7ffd72 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 _0x77b0=['BOOLEAN','sequelize','exports','STRING'];(function(_0x409fb8,_0x5ab3d3){var _0x278270=function(_0x58849c){while(--_0x58849c){_0x409fb8['push'](_0x409fb8['shift']());}};_0x278270(++_0x5ab3d3);}(_0x77b0,0x8d));var _0x077b=function(_0x4ffd32,_0x115fae){_0x4ffd32=_0x4ffd32-0x0;var _0x3f5e16=_0x77b0[_0x4ffd32];return _0x3f5e16;};'use strict';var Sequelize=require(_0x077b('0x0'));module[_0x077b('0x1')]={'name':{'type':Sequelize[_0x077b('0x2')]},'channel':{'type':Sequelize[_0x077b('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x077b('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xc0cd=['BOOLEAN','exports','STRING'];(function(_0x2f6adb,_0x25b36c){var _0x362a0e=function(_0x2efb88){while(--_0x2efb88){_0x2f6adb['push'](_0x2f6adb['shift']());}};_0x362a0e(++_0x25b36c);}(_0xc0cd,0x97));var _0xdc0c=function(_0x2e411d,_0x4821b6){_0x2e411d=_0x2e411d-0x0;var _0x5e8eb7=_0xc0cd[_0x2e411d];return _0x5e8eb7;};'use strict';var Sequelize=require('sequelize');module[_0xdc0c('0x0')]={'name':{'type':Sequelize[_0xdc0c('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xdc0c('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 875c6e0..2019f38 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 _0x864b=['save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','Trigger','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','keys','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','body','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x52b91f,_0x499757){var _0x15f8f5=function(_0x33fbf6){while(--_0x33fbf6){_0x52b91f['push'](_0x52b91f['shift']());}};_0x15f8f5(++_0x499757);}(_0x864b,0x94));var _0xb864=function(_0x35e003,_0x21f047){_0x35e003=_0x35e003-0x0;var _0x2d7382=_0x864b[_0x35e003];return _0x2d7382;};'use strict';var emlformat=require(_0xb864('0x0'));var rimraf=require(_0xb864('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb864('0x2'));var rp=require('request-promise');var moment=require(_0xb864('0x3'));var BPromise=require(_0xb864('0x4'));var Mustache=require(_0xb864('0x5'));var util=require('util');var path=require(_0xb864('0x6'));var sox=require(_0xb864('0x7'));var csv=require(_0xb864('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb864('0x9'));var _=require(_0xb864('0xa'));var squel=require(_0xb864('0xb'));var crypto=require(_0xb864('0xc'));var jsforce=require(_0xb864('0xd'));var deskjs=require(_0xb864('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb864('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb864('0x10'));var qs=require(_0xb864('0x11'));var as=require(_0xb864('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb864('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xb864('0x14'));var licenseUtil=require(_0xb864('0x15'));var db=require(_0xb864('0x16'))['db'];function respondWithStatusCode(_0xf05973,_0x59787e){_0x59787e=_0x59787e||0xcc;return function(_0x31dd77){if(_0x31dd77){return _0xf05973[_0xb864('0x17')](_0x59787e);}return _0xf05973[_0xb864('0x18')](_0x59787e)['end']();};}function respondWithResult(_0x312e28,_0x59343b){_0x59343b=_0x59343b||0xc8;return function(_0x55c817){if(_0x55c817){return _0x312e28[_0xb864('0x18')](_0x59343b)[_0xb864('0x19')](_0x55c817);}};}function respondWithFilteredResult(_0x236c0d,_0x463a72){return function(_0x455fbf){if(_0x455fbf){var _0x377e33=typeof _0x463a72[_0xb864('0x1a')]===_0xb864('0x1b')&&typeof _0x463a72[_0xb864('0x1c')]==='undefined';var _0x2e5882=_0x455fbf['count'];var _0x4a8109=_0x377e33?0x0:_0x463a72[_0xb864('0x1a')];var _0x15b646=_0x377e33?_0x455fbf[_0xb864('0x1d')]:_0x463a72[_0xb864('0x1a')]+_0x463a72[_0xb864('0x1c')];var _0x331d32;if(_0x15b646>=_0x2e5882){_0x15b646=_0x2e5882;_0x331d32=0xc8;}else{_0x331d32=0xce;}_0x236c0d[_0xb864('0x18')](_0x331d32);return _0x236c0d[_0xb864('0x1e')](_0xb864('0x1f'),_0x4a8109+'-'+_0x15b646+'/'+_0x2e5882)[_0xb864('0x19')](_0x455fbf);}return null;};}function patchUpdates(_0x2f905e){return function(_0x148f18){try{jsonpatch[_0xb864('0x20')](_0x148f18,_0x2f905e,!![]);}catch(_0x5c2675){return BPromise[_0xb864('0x21')](_0x5c2675);}return _0x148f18[_0xb864('0x22')]();};}function saveUpdates(_0x4693e8,_0xf181f3){return function(_0xb2ecb5){if(_0xb2ecb5){return _0xb2ecb5[_0xb864('0x23')](_0x4693e8)[_0xb864('0x24')](function(_0x5f3d79){return _0x5f3d79;});}return null;};}function removeEntity(_0x56c666,_0x53ef16){return function(_0x551a9f){if(_0x551a9f){return _0x551a9f['destroy']()[_0xb864('0x24')](function(){var _0x2db010=_0x551a9f[_0xb864('0x25')]({'plain':!![]});var _0x4d42e8='Triggers';return db[_0xb864('0x26')][_0xb864('0x27')]({'where':{'type':_0x4d42e8,'resourceId':_0x2db010['id']}})[_0xb864('0x24')](function(){return _0x551a9f;});})[_0xb864('0x24')](function(){_0x56c666[_0xb864('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21f0c0,_0x38a583){return function(_0x4d02f9){if(!_0x4d02f9){_0x21f0c0['sendStatus'](0x194);}return _0x4d02f9;};}function handleError(_0x7109fd,_0x499c13){_0x499c13=_0x499c13||0x1f4;return function(_0x1cc350){logger[_0xb864('0x28')](_0x1cc350['stack']);if(_0x1cc350[_0xb864('0x29')]){delete _0x1cc350[_0xb864('0x29')];}_0x7109fd[_0xb864('0x18')](_0x499c13)[_0xb864('0x2a')](_0x1cc350);};}exports[_0xb864('0x2b')]=function(_0x339667,_0x2f0557){var _0xab0225={},_0x29a9ac={},_0x4b7256={'count':0x0,'rows':[]};var _0x4f607c=_[_0xb864('0x2c')](db[_0xb864('0x2d')][_0xb864('0x2e')],function(_0x27c2c0){return{'name':_0x27c2c0['fieldName'],'type':_0x27c2c0[_0xb864('0x2f')][_0xb864('0x30')]};});_0x29a9ac[_0xb864('0x31')]=_['map'](_0x4f607c,_0xb864('0x29'));_0x29a9ac[_0xb864('0x32')]=_['keys'](_0x339667[_0xb864('0x32')]);_0x29a9ac[_0xb864('0x33')]=_['intersection'](_0x29a9ac[_0xb864('0x31')],_0x29a9ac[_0xb864('0x32')]);_0xab0225[_0xb864('0x34')]=_[_0xb864('0x35')](_0x29a9ac[_0xb864('0x31')],qs['fields'](_0x339667[_0xb864('0x32')][_0xb864('0x36')]));_0xab0225[_0xb864('0x34')]=_0xab0225[_0xb864('0x34')]['length']?_0xab0225['attributes']:_0x29a9ac[_0xb864('0x31')];if(!_0x339667[_0xb864('0x32')][_0xb864('0x37')](_0xb864('0x38'))){_0xab0225[_0xb864('0x1c')]=qs['limit'](_0x339667[_0xb864('0x32')][_0xb864('0x1c')]);_0xab0225[_0xb864('0x1a')]=qs[_0xb864('0x1a')](_0x339667[_0xb864('0x32')][_0xb864('0x1a')]);}_0xab0225[_0xb864('0x39')]=qs[_0xb864('0x3a')](_0x339667['query']['sort']);_0xab0225[_0xb864('0x3b')]=qs['filters'](_[_0xb864('0x3c')](_0x339667[_0xb864('0x32')],_0x29a9ac[_0xb864('0x33')]),_0x4f607c);if(_0x339667[_0xb864('0x32')][_0xb864('0x3d')]){_0xab0225[_0xb864('0x3b')]=_[_0xb864('0x3e')](_0xab0225[_0xb864('0x3b')],{'$or':_[_0xb864('0x2c')](_0x4f607c,function(_0x22fc99){if(_0x22fc99[_0xb864('0x2f')]!==_0xb864('0x3f')){var _0x5dd2b9={};_0x5dd2b9[_0x22fc99[_0xb864('0x29')]]={'$like':'%'+_0x339667[_0xb864('0x32')][_0xb864('0x3d')]+'%'};return _0x5dd2b9;}})});}_0xab0225=_['merge']({},_0xab0225,_0x339667[_0xb864('0x40')]);var _0x3cc4ec={'where':_0xab0225[_0xb864('0x3b')]};return db['Trigger'][_0xb864('0x1d')](_0x3cc4ec)[_0xb864('0x24')](function(_0x5b381e){_0x4b7256[_0xb864('0x1d')]=_0x5b381e;if(_0x339667[_0xb864('0x32')][_0xb864('0x41')]){_0xab0225[_0xb864('0x42')]=[{'all':!![]}];}return db['Trigger']['findAll'](_0xab0225);})['then'](function(_0x5c9279){_0x4b7256[_0xb864('0x43')]=_0x5c9279;return _0x4b7256;})[_0xb864('0x24')](respondWithFilteredResult(_0x2f0557,_0xab0225))['catch'](handleError(_0x2f0557,null));};exports[_0xb864('0x44')]=function(_0x49c755,_0x3d90ac){var _0x5b0b9e={'raw':![],'where':{'id':_0x49c755['params']['id']}},_0x26fe9f={};_0x26fe9f[_0xb864('0x31')]=_['keys'](db[_0xb864('0x2d')][_0xb864('0x2e')]);_0x26fe9f[_0xb864('0x32')]=_[_0xb864('0x45')](_0x49c755[_0xb864('0x32')]);_0x26fe9f[_0xb864('0x33')]=_[_0xb864('0x35')](_0x26fe9f['model'],_0x26fe9f[_0xb864('0x32')]);_0x5b0b9e[_0xb864('0x34')]=_[_0xb864('0x35')](_0x26fe9f[_0xb864('0x31')],qs[_0xb864('0x36')](_0x49c755[_0xb864('0x32')][_0xb864('0x36')]));_0x5b0b9e[_0xb864('0x34')]=_0x5b0b9e['attributes'][_0xb864('0x46')]?_0x5b0b9e[_0xb864('0x34')]:_0x26fe9f[_0xb864('0x31')];if(_0x49c755[_0xb864('0x32')][_0xb864('0x41')]){_0x5b0b9e[_0xb864('0x42')]=[{'all':!![]}];}_0x5b0b9e=_[_0xb864('0x3e')]({},_0x5b0b9e,_0x49c755[_0xb864('0x40')]);return db['Trigger'][_0xb864('0x47')](_0x5b0b9e)[_0xb864('0x24')](handleEntityNotFound(_0x3d90ac,null))[_0xb864('0x24')](respondWithResult(_0x3d90ac,null))[_0xb864('0x48')](handleError(_0x3d90ac,null));};exports['create']=function(_0x238bcb,_0x4c5257){return db[_0xb864('0x2d')][_0xb864('0x49')](_0x238bcb['body'],{})[_0xb864('0x24')](function(_0xffae41){var _0x15799f=_0x238bcb[_0xb864('0x4a')][_0xb864('0x25')]({'plain':!![]});if(!_0x15799f)throw new Error(_0xb864('0x4b'));if(_0x15799f[_0xb864('0x4c')]===_0xb864('0x4a')){var _0x53b76f=_0xffae41['get']({'plain':!![]});var _0xbf7805='Triggers';return db[_0xb864('0x4d')][_0xb864('0x47')]({'where':{'name':_0xbf7805,'userProfileId':_0x15799f[_0xb864('0x4e')]},'raw':!![]})[_0xb864('0x24')](function(_0x38cd5e){if(_0x38cd5e&&_0x38cd5e['autoAssociation']===0x0){return db[_0xb864('0x26')][_0xb864('0x49')]({'name':_0x53b76f[_0xb864('0x29')],'resourceId':_0x53b76f['id'],'type':_0x38cd5e[_0xb864('0x29')],'sectionId':_0x38cd5e['id']},{})[_0xb864('0x24')](function(){return _0xffae41;});}else{return _0xffae41;}})[_0xb864('0x48')](function(_0x3a125f){logger[_0xb864('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a125f);throw _0x3a125f;});}return _0xffae41;})[_0xb864('0x24')](respondWithResult(_0x4c5257,0xc9))[_0xb864('0x48')](handleError(_0x4c5257,null));};exports['update']=function(_0x4d598b,_0x4fa034){if(_0x4d598b[_0xb864('0x4f')]['id']){delete _0x4d598b[_0xb864('0x4f')]['id'];}return db['Trigger']['find']({'where':{'id':_0x4d598b[_0xb864('0x50')]['id']}})[_0xb864('0x24')](handleEntityNotFound(_0x4fa034,null))['then'](saveUpdates(_0x4d598b[_0xb864('0x4f')],null))[_0xb864('0x24')](respondWithResult(_0x4fa034,null))['catch'](handleError(_0x4fa034,null));};exports[_0xb864('0x27')]=function(_0x30db24,_0x569f1d){return db[_0xb864('0x2d')]['find']({'where':{'id':_0x30db24['params']['id']}})['then'](handleEntityNotFound(_0x569f1d,null))[_0xb864('0x24')](removeEntity(_0x569f1d,null))[_0xb864('0x48')](handleError(_0x569f1d,null));};exports[_0xb864('0x51')]=function(_0x64c736,_0x4d0a0f,_0x38b7ac){if(_0x64c736['body']['id']){delete _0x64c736[_0xb864('0x4f')]['id'];}return db[_0xb864('0x2d')][_0xb864('0x47')]({'where':{'id':_0x64c736[_0xb864('0x50')]['id']}})['then'](handleEntityNotFound(_0x4d0a0f,null))[_0xb864('0x24')](function(_0x3c75b8){if(_0x3c75b8){_0x64c736['body'][_0xb864('0x52')]=_0x3c75b8['id'];return db[_0xb864('0x53')][_0xb864('0x49')](_0x64c736[_0xb864('0x4f')]);}})[_0xb864('0x24')](respondWithResult(_0x4d0a0f,null))[_0xb864('0x48')](handleError(_0x4d0a0f,null));};exports[_0xb864('0x54')]=function(_0x406206,_0x339f40,_0x2b3135){if(_0x406206[_0xb864('0x4f')]['id']){delete _0x406206[_0xb864('0x4f')]['id'];}return db[_0xb864('0x2d')][_0xb864('0x47')]({'where':{'id':_0x406206['params']['id']}})[_0xb864('0x24')](handleEntityNotFound(_0x339f40,null))[_0xb864('0x24')](function(_0x51c7b1){if(_0x51c7b1){_0x406206['body']['TriggerAnyId']=_0x51c7b1['id'];return db[_0xb864('0x53')][_0xb864('0x49')](_0x406206[_0xb864('0x4f')]);}})['then'](respondWithResult(_0x339f40,null))[_0xb864('0x48')](handleError(_0x339f40,null));};exports[_0xb864('0x55')]=function(_0x561d5b,_0x237729,_0x392d76){var _0x1caa73={};var _0x506faa={};var _0x321cbd;var _0x28b6e0;return db['Trigger'][_0xb864('0x56')]({'where':{'id':_0x561d5b[_0xb864('0x50')]['id']}})['then'](handleEntityNotFound(_0x237729,null))[_0xb864('0x24')](function(_0x5d8808){if(_0x5d8808){_0x321cbd=_0x5d8808;_0x506faa[_0xb864('0x31')]=_['keys'](db[_0xb864('0x53')][_0xb864('0x2e')]);_0x506faa[_0xb864('0x32')]=_[_0xb864('0x45')](_0x561d5b[_0xb864('0x32')]);_0x506faa[_0xb864('0x33')]=_['intersection'](_0x506faa[_0xb864('0x31')],_0x506faa['query']);_0x1caa73[_0xb864('0x34')]=_[_0xb864('0x35')](_0x506faa[_0xb864('0x31')],qs['fields'](_0x561d5b[_0xb864('0x32')][_0xb864('0x36')]));_0x1caa73[_0xb864('0x34')]=_0x1caa73['attributes'][_0xb864('0x46')]?_0x1caa73[_0xb864('0x34')]:_0x506faa[_0xb864('0x31')];_0x1caa73[_0xb864('0x39')]=qs[_0xb864('0x3a')](_0x561d5b[_0xb864('0x32')][_0xb864('0x3a')]);_0x1caa73['where']=qs[_0xb864('0x33')](_[_0xb864('0x3c')](_0x561d5b['query'],_0x506faa[_0xb864('0x33')]));if(_0x561d5b[_0xb864('0x32')][_0xb864('0x3d')]){_0x1caa73[_0xb864('0x3b')]=_[_0xb864('0x3e')](_0x1caa73[_0xb864('0x3b')],{'$or':_[_0xb864('0x2c')](_0x1caa73['attributes'],function(_0x97ce3e){var _0x29bb86={};_0x29bb86[_0x97ce3e]={'$like':'%'+_0x561d5b[_0xb864('0x32')]['filter']+'%'};return _0x29bb86;})});}_0x1caa73=_[_0xb864('0x3e')]({},_0x1caa73,_0x561d5b[_0xb864('0x40')]);return _0x321cbd[_0xb864('0x55')](_0x1caa73);}})[_0xb864('0x24')](function(_0x2203ce){if(_0x2203ce){_0x28b6e0=_0x2203ce[_0xb864('0x46')];if(!_0x561d5b[_0xb864('0x32')]['hasOwnProperty'](_0xb864('0x38'))){_0x1caa73[_0xb864('0x1c')]=qs['limit'](_0x561d5b['query']['limit']);_0x1caa73[_0xb864('0x1a')]=qs[_0xb864('0x1a')](_0x561d5b['query'][_0xb864('0x1a')]);}return _0x321cbd[_0xb864('0x55')](_0x1caa73);}})[_0xb864('0x24')](function(_0x4d30a8){if(_0x4d30a8){return _0x4d30a8?{'count':_0x28b6e0,'rows':_0x4d30a8}:null;}})[_0xb864('0x24')](respondWithResult(_0x237729,null))[_0xb864('0x48')](handleError(_0x237729,null));};exports[_0xb864('0x57')]=function(_0x33a702,_0x5f529b,_0x425be1){var _0x56a45f={};var _0x29dce7={};var _0x8f5fe2;var _0x4a9503;return db[_0xb864('0x2d')][_0xb864('0x56')]({'where':{'id':_0x33a702[_0xb864('0x50')]['id']}})['then'](handleEntityNotFound(_0x5f529b,null))['then'](function(_0x3b20ba){if(_0x3b20ba){_0x8f5fe2=_0x3b20ba;_0x29dce7[_0xb864('0x31')]=_[_0xb864('0x45')](db[_0xb864('0x53')][_0xb864('0x2e')]);_0x29dce7[_0xb864('0x32')]=_[_0xb864('0x45')](_0x33a702[_0xb864('0x32')]);_0x29dce7[_0xb864('0x33')]=_[_0xb864('0x35')](_0x29dce7[_0xb864('0x31')],_0x29dce7[_0xb864('0x32')]);_0x56a45f[_0xb864('0x34')]=_[_0xb864('0x35')](_0x29dce7['model'],qs[_0xb864('0x36')](_0x33a702[_0xb864('0x32')][_0xb864('0x36')]));_0x56a45f[_0xb864('0x34')]=_0x56a45f['attributes'][_0xb864('0x46')]?_0x56a45f[_0xb864('0x34')]:_0x29dce7[_0xb864('0x31')];_0x56a45f['order']=qs[_0xb864('0x3a')](_0x33a702['query'][_0xb864('0x3a')]);_0x56a45f[_0xb864('0x3b')]=qs[_0xb864('0x33')](_[_0xb864('0x3c')](_0x33a702[_0xb864('0x32')],_0x29dce7[_0xb864('0x33')]));if(_0x33a702['query'][_0xb864('0x3d')]){_0x56a45f[_0xb864('0x3b')]=_[_0xb864('0x3e')](_0x56a45f[_0xb864('0x3b')],{'$or':_[_0xb864('0x2c')](_0x56a45f['attributes'],function(_0xb45c97){var _0x3922d5={};_0x3922d5[_0xb45c97]={'$like':'%'+_0x33a702[_0xb864('0x32')][_0xb864('0x3d')]+'%'};return _0x3922d5;})});}_0x56a45f=_[_0xb864('0x3e')]({},_0x56a45f,_0x33a702[_0xb864('0x40')]);return _0x8f5fe2['getAnyConditions'](_0x56a45f);}})[_0xb864('0x24')](function(_0x431782){if(_0x431782){_0x4a9503=_0x431782[_0xb864('0x46')];if(!_0x33a702['query'][_0xb864('0x37')]('nolimit')){_0x56a45f['limit']=qs['limit'](_0x33a702[_0xb864('0x32')]['limit']);_0x56a45f[_0xb864('0x1a')]=qs[_0xb864('0x1a')](_0x33a702[_0xb864('0x32')]['offset']);}return _0x8f5fe2[_0xb864('0x57')](_0x56a45f);}})[_0xb864('0x24')](function(_0x1da5c4){if(_0x1da5c4){return _0x1da5c4?{'count':_0x4a9503,'rows':_0x1da5c4}:null;}})[_0xb864('0x24')](respondWithResult(_0x5f529b,null))[_0xb864('0x48')](handleError(_0x5f529b,null));};exports[_0xb864('0x58')]=function(_0x1184a4,_0x5db170,_0x2d1262){if(_0x1184a4[_0xb864('0x4f')]['id']){delete _0x1184a4[_0xb864('0x4f')]['id'];}return db[_0xb864('0x2d')]['find']({'where':{'id':_0x1184a4[_0xb864('0x50')]['id']}})[_0xb864('0x24')](handleEntityNotFound(_0x5db170,null))['then'](function(_0x35e181){if(_0x35e181){_0x1184a4[_0xb864('0x4f')]['TriggerId']=_0x35e181['id'];return db[_0xb864('0x59')][_0xb864('0x49')](_0x1184a4['body']);}})[_0xb864('0x24')](respondWithResult(_0x5db170,null))[_0xb864('0x48')](handleError(_0x5db170,null));};exports['getActions']=function(_0x49989f,_0x8f5933,_0x312d8f){var _0x108685={};var _0x5a3420={};var _0x499223;var _0x4424bd;return db[_0xb864('0x2d')]['findOne']({'where':{'id':_0x49989f[_0xb864('0x50')]['id']}})[_0xb864('0x24')](handleEntityNotFound(_0x8f5933,null))[_0xb864('0x24')](function(_0x5bb582){if(_0x5bb582){_0x499223=_0x5bb582;_0x5a3420[_0xb864('0x31')]=_['keys'](db[_0xb864('0x59')][_0xb864('0x2e')]);_0x5a3420['query']=_[_0xb864('0x45')](_0x49989f[_0xb864('0x32')]);_0x5a3420['filters']=_[_0xb864('0x35')](_0x5a3420['model'],_0x5a3420['query']);_0x108685['attributes']=_['intersection'](_0x5a3420[_0xb864('0x31')],qs['fields'](_0x49989f[_0xb864('0x32')][_0xb864('0x36')]));_0x108685['attributes']=_0x108685[_0xb864('0x34')][_0xb864('0x46')]?_0x108685[_0xb864('0x34')]:_0x5a3420[_0xb864('0x31')];_0x108685[_0xb864('0x39')]=qs[_0xb864('0x3a')](_0x49989f[_0xb864('0x32')][_0xb864('0x3a')]);_0x108685[_0xb864('0x3b')]=qs[_0xb864('0x33')](_[_0xb864('0x3c')](_0x49989f['query'],_0x5a3420[_0xb864('0x33')]));if(_0x49989f['query'][_0xb864('0x3d')]){_0x108685[_0xb864('0x3b')]=_[_0xb864('0x3e')](_0x108685[_0xb864('0x3b')],{'$or':_[_0xb864('0x2c')](_0x108685[_0xb864('0x34')],function(_0x532a57){var _0x48b069={};_0x48b069[_0x532a57]={'$like':'%'+_0x49989f['query'][_0xb864('0x3d')]+'%'};return _0x48b069;})});}_0x108685=_[_0xb864('0x3e')]({},_0x108685,_0x49989f[_0xb864('0x40')]);return _0x499223[_0xb864('0x5a')](_0x108685);}})['then'](function(_0x30ed66){if(_0x30ed66){_0x4424bd=_0x30ed66[_0xb864('0x46')];if(!_0x49989f[_0xb864('0x32')][_0xb864('0x37')](_0xb864('0x38'))){_0x108685['limit']=qs[_0xb864('0x1c')](_0x49989f['query'][_0xb864('0x1c')]);_0x108685[_0xb864('0x1a')]=qs['offset'](_0x49989f['query']['offset']);}return _0x499223[_0xb864('0x5a')](_0x108685);}})[_0xb864('0x24')](function(_0x1d3688){if(_0x1d3688){return _0x1d3688?{'count':_0x4424bd,'rows':_0x1d3688}:null;}})['then'](respondWithResult(_0x8f5933,null))['catch'](handleError(_0x8f5933,null));}; \ No newline at end of file +var _0xf06a=['role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','sort','pick','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','json','reject','save','update','then','destroy','get','Triggers','UserProfileResource','end','error','stack','name','send','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','options','Trigger','includeAll','include','findAll','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xf06a,0xc5));var _0xaf06=function(_0x223b0c,_0x371c5a){_0x223b0c=_0x223b0c-0x0;var _0x4ce5ed=_0xf06a[_0x223b0c];return _0x4ce5ed;};'use strict';var emlformat=require(_0xaf06('0x0'));var rimraf=require(_0xaf06('0x1'));var zipdir=require(_0xaf06('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf06('0x3'));var moment=require('moment');var BPromise=require(_0xaf06('0x4'));var Mustache=require(_0xaf06('0x5'));var util=require(_0xaf06('0x6'));var path=require(_0xaf06('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaf06('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaf06('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaf06('0xa'));var toCsv=require(_0xaf06('0xb'));var querystring=require(_0xaf06('0xc'));var Papa=require(_0xaf06('0xd'));var Redis=require(_0xaf06('0xe'));var authService=require(_0xaf06('0xf'));var qs=require(_0xaf06('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf06('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xaf06('0x12'));var licenseUtil=require(_0xaf06('0x13'));var db=require(_0xaf06('0x14'))['db'];function respondWithStatusCode(_0x4f3c99,_0x309910){_0x309910=_0x309910||0xcc;return function(_0x17212d){if(_0x17212d){return _0x4f3c99[_0xaf06('0x15')](_0x309910);}return _0x4f3c99[_0xaf06('0x16')](_0x309910)['end']();};}function respondWithResult(_0x458e6a,_0x2a8942){_0x2a8942=_0x2a8942||0xc8;return function(_0x1741bd){if(_0x1741bd){return _0x458e6a[_0xaf06('0x16')](_0x2a8942)['json'](_0x1741bd);}};}function respondWithFilteredResult(_0x6125d5,_0x400c3d){return function(_0x1ce503){if(_0x1ce503){var _0x2ef9a1=typeof _0x400c3d[_0xaf06('0x17')]==='undefined'&&typeof _0x400c3d[_0xaf06('0x18')]===_0xaf06('0x19');var _0x3fd8a5=_0x1ce503[_0xaf06('0x1a')];var _0x489935=_0x2ef9a1?0x0:_0x400c3d[_0xaf06('0x17')];var _0x21dc26=_0x2ef9a1?_0x1ce503[_0xaf06('0x1a')]:_0x400c3d[_0xaf06('0x17')]+_0x400c3d[_0xaf06('0x18')];var _0xcb62ea;if(_0x21dc26>=_0x3fd8a5){_0x21dc26=_0x3fd8a5;_0xcb62ea=0xc8;}else{_0xcb62ea=0xce;}_0x6125d5[_0xaf06('0x16')](_0xcb62ea);return _0x6125d5['set']('Content-Range',_0x489935+'-'+_0x21dc26+'/'+_0x3fd8a5)[_0xaf06('0x1b')](_0x1ce503);}return null;};}function patchUpdates(_0x155b9c){return function(_0x325cdf){try{jsonpatch['apply'](_0x325cdf,_0x155b9c,!![]);}catch(_0x3341b1){return BPromise[_0xaf06('0x1c')](_0x3341b1);}return _0x325cdf[_0xaf06('0x1d')]();};}function saveUpdates(_0x4a4954,_0x37171f){return function(_0x4ce9a9){if(_0x4ce9a9){return _0x4ce9a9[_0xaf06('0x1e')](_0x4a4954)[_0xaf06('0x1f')](function(_0x497a5d){return _0x497a5d;});}return null;};}function removeEntity(_0x4a2a08,_0x1cf783){return function(_0x41c024){if(_0x41c024){return _0x41c024[_0xaf06('0x20')]()[_0xaf06('0x1f')](function(){var _0x19bff8=_0x41c024[_0xaf06('0x21')]({'plain':!![]});var _0xcd941f=_0xaf06('0x22');return db[_0xaf06('0x23')][_0xaf06('0x20')]({'where':{'type':_0xcd941f,'resourceId':_0x19bff8['id']}})[_0xaf06('0x1f')](function(){return _0x41c024;});})['then'](function(){_0x4a2a08['status'](0xcc)[_0xaf06('0x24')]();});}};}function handleEntityNotFound(_0x1616d0,_0x5a7f49){return function(_0x121269){if(!_0x121269){_0x1616d0['sendStatus'](0x194);}return _0x121269;};}function handleError(_0x2701f7,_0x1590b5){_0x1590b5=_0x1590b5||0x1f4;return function(_0x38e6c5){logger[_0xaf06('0x25')](_0x38e6c5[_0xaf06('0x26')]);if(_0x38e6c5[_0xaf06('0x27')]){delete _0x38e6c5['name'];}_0x2701f7['status'](_0x1590b5)[_0xaf06('0x28')](_0x38e6c5);};}exports['index']=function(_0x3aa14d,_0x1aacde){var _0x4202c7={},_0x4fa311={},_0x36a648={'count':0x0,'rows':[]};var _0x31716f=_['map'](db['Trigger'][_0xaf06('0x29')],function(_0x346412){return{'name':_0x346412[_0xaf06('0x2a')],'type':_0x346412[_0xaf06('0x2b')]['key']};});_0x4fa311['model']=_[_0xaf06('0x2c')](_0x31716f,_0xaf06('0x27'));_0x4fa311['query']=_[_0xaf06('0x2d')](_0x3aa14d[_0xaf06('0x2e')]);_0x4fa311[_0xaf06('0x2f')]=_[_0xaf06('0x30')](_0x4fa311[_0xaf06('0x31')],_0x4fa311[_0xaf06('0x2e')]);_0x4202c7[_0xaf06('0x32')]=_[_0xaf06('0x30')](_0x4fa311[_0xaf06('0x31')],qs[_0xaf06('0x33')](_0x3aa14d[_0xaf06('0x2e')][_0xaf06('0x33')]));_0x4202c7['attributes']=_0x4202c7[_0xaf06('0x32')][_0xaf06('0x34')]?_0x4202c7['attributes']:_0x4fa311[_0xaf06('0x31')];if(!_0x3aa14d[_0xaf06('0x2e')][_0xaf06('0x35')](_0xaf06('0x36'))){_0x4202c7['limit']=qs['limit'](_0x3aa14d[_0xaf06('0x2e')][_0xaf06('0x18')]);_0x4202c7[_0xaf06('0x17')]=qs['offset'](_0x3aa14d[_0xaf06('0x2e')]['offset']);}_0x4202c7[_0xaf06('0x37')]=qs['sort'](_0x3aa14d['query']['sort']);_0x4202c7[_0xaf06('0x38')]=qs[_0xaf06('0x2f')](_['pick'](_0x3aa14d[_0xaf06('0x2e')],_0x4fa311[_0xaf06('0x2f')]),_0x31716f);if(_0x3aa14d[_0xaf06('0x2e')][_0xaf06('0x39')]){_0x4202c7['where']=_[_0xaf06('0x3a')](_0x4202c7[_0xaf06('0x38')],{'$or':_[_0xaf06('0x2c')](_0x31716f,function(_0x324b87){if(_0x324b87[_0xaf06('0x2b')]!=='VIRTUAL'){var _0x35b310={};_0x35b310[_0x324b87[_0xaf06('0x27')]]={'$like':'%'+_0x3aa14d[_0xaf06('0x2e')]['filter']+'%'};return _0x35b310;}})});}_0x4202c7=_[_0xaf06('0x3a')]({},_0x4202c7,_0x3aa14d[_0xaf06('0x3b')]);var _0x5a5e3c={'where':_0x4202c7[_0xaf06('0x38')]};return db[_0xaf06('0x3c')]['count'](_0x5a5e3c)['then'](function(_0xdbc5b1){_0x36a648[_0xaf06('0x1a')]=_0xdbc5b1;if(_0x3aa14d['query'][_0xaf06('0x3d')]){_0x4202c7[_0xaf06('0x3e')]=[{'all':!![]}];}return db['Trigger'][_0xaf06('0x3f')](_0x4202c7);})[_0xaf06('0x1f')](function(_0x4dacdc){_0x36a648['rows']=_0x4dacdc;return _0x36a648;})[_0xaf06('0x1f')](respondWithFilteredResult(_0x1aacde,_0x4202c7))[_0xaf06('0x40')](handleError(_0x1aacde,null));};exports[_0xaf06('0x41')]=function(_0x1a3bc7,_0x56c051){var _0x239d31={'raw':![],'where':{'id':_0x1a3bc7['params']['id']}},_0x288ed4={};_0x288ed4[_0xaf06('0x31')]=_[_0xaf06('0x2d')](db[_0xaf06('0x3c')][_0xaf06('0x29')]);_0x288ed4[_0xaf06('0x2e')]=_[_0xaf06('0x2d')](_0x1a3bc7[_0xaf06('0x2e')]);_0x288ed4[_0xaf06('0x2f')]=_[_0xaf06('0x30')](_0x288ed4['model'],_0x288ed4[_0xaf06('0x2e')]);_0x239d31[_0xaf06('0x32')]=_['intersection'](_0x288ed4[_0xaf06('0x31')],qs['fields'](_0x1a3bc7[_0xaf06('0x2e')][_0xaf06('0x33')]));_0x239d31[_0xaf06('0x32')]=_0x239d31['attributes'][_0xaf06('0x34')]?_0x239d31[_0xaf06('0x32')]:_0x288ed4[_0xaf06('0x31')];if(_0x1a3bc7[_0xaf06('0x2e')][_0xaf06('0x3d')]){_0x239d31[_0xaf06('0x3e')]=[{'all':!![]}];}_0x239d31=_[_0xaf06('0x3a')]({},_0x239d31,_0x1a3bc7[_0xaf06('0x3b')]);return db[_0xaf06('0x3c')][_0xaf06('0x42')](_0x239d31)['then'](handleEntityNotFound(_0x56c051,null))[_0xaf06('0x1f')](respondWithResult(_0x56c051,null))[_0xaf06('0x40')](handleError(_0x56c051,null));};exports[_0xaf06('0x43')]=function(_0x362cf1,_0x205098){return db[_0xaf06('0x3c')][_0xaf06('0x43')](_0x362cf1['body'],{})[_0xaf06('0x1f')](function(_0x50eb81){var _0x2c8171=_0x362cf1[_0xaf06('0x44')]['get']({'plain':!![]});if(!_0x2c8171)throw new Error(_0xaf06('0x45'));if(_0x2c8171[_0xaf06('0x46')]===_0xaf06('0x44')){var _0x1be712=_0x50eb81[_0xaf06('0x21')]({'plain':!![]});var _0x682187=_0xaf06('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x682187,'userProfileId':_0x2c8171[_0xaf06('0x47')]},'raw':!![]})[_0xaf06('0x1f')](function(_0x39dcb5){if(_0x39dcb5&&_0x39dcb5[_0xaf06('0x48')]===0x0){return db[_0xaf06('0x23')][_0xaf06('0x43')]({'name':_0x1be712[_0xaf06('0x27')],'resourceId':_0x1be712['id'],'type':_0x39dcb5[_0xaf06('0x27')],'sectionId':_0x39dcb5['id']},{})[_0xaf06('0x1f')](function(){return _0x50eb81;});}else{return _0x50eb81;}})[_0xaf06('0x40')](function(_0x2e45b2){logger['error'](_0xaf06('0x49'),_0x2e45b2);throw _0x2e45b2;});}return _0x50eb81;})[_0xaf06('0x1f')](respondWithResult(_0x205098,0xc9))[_0xaf06('0x40')](handleError(_0x205098,null));};exports[_0xaf06('0x1e')]=function(_0x5efdc0,_0x387b18){if(_0x5efdc0['body']['id']){delete _0x5efdc0[_0xaf06('0x4a')]['id'];}return db[_0xaf06('0x3c')]['find']({'where':{'id':_0x5efdc0[_0xaf06('0x4b')]['id']}})[_0xaf06('0x1f')](handleEntityNotFound(_0x387b18,null))[_0xaf06('0x1f')](saveUpdates(_0x5efdc0['body'],null))[_0xaf06('0x1f')](respondWithResult(_0x387b18,null))[_0xaf06('0x40')](handleError(_0x387b18,null));};exports['destroy']=function(_0x247698,_0x3953cd){return db[_0xaf06('0x3c')]['find']({'where':{'id':_0x247698[_0xaf06('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3953cd,null))['then'](removeEntity(_0x3953cd,null))[_0xaf06('0x40')](handleError(_0x3953cd,null));};exports[_0xaf06('0x4c')]=function(_0x461ae4,_0x2a4bb3,_0x488654){if(_0x461ae4[_0xaf06('0x4a')]['id']){delete _0x461ae4[_0xaf06('0x4a')]['id'];}return db['Trigger'][_0xaf06('0x42')]({'where':{'id':_0x461ae4[_0xaf06('0x4b')]['id']}})[_0xaf06('0x1f')](handleEntityNotFound(_0x2a4bb3,null))[_0xaf06('0x1f')](function(_0x5719b4){if(_0x5719b4){_0x461ae4[_0xaf06('0x4a')]['TriggerAllId']=_0x5719b4['id'];return db[_0xaf06('0x4d')][_0xaf06('0x43')](_0x461ae4[_0xaf06('0x4a')]);}})[_0xaf06('0x1f')](respondWithResult(_0x2a4bb3,null))['catch'](handleError(_0x2a4bb3,null));};exports[_0xaf06('0x4e')]=function(_0x56f0f1,_0x45814b,_0x58cb35){if(_0x56f0f1[_0xaf06('0x4a')]['id']){delete _0x56f0f1[_0xaf06('0x4a')]['id'];}return db[_0xaf06('0x3c')]['find']({'where':{'id':_0x56f0f1[_0xaf06('0x4b')]['id']}})[_0xaf06('0x1f')](handleEntityNotFound(_0x45814b,null))[_0xaf06('0x1f')](function(_0x47bf87){if(_0x47bf87){_0x56f0f1[_0xaf06('0x4a')][_0xaf06('0x4f')]=_0x47bf87['id'];return db[_0xaf06('0x4d')][_0xaf06('0x43')](_0x56f0f1['body']);}})['then'](respondWithResult(_0x45814b,null))[_0xaf06('0x40')](handleError(_0x45814b,null));};exports[_0xaf06('0x50')]=function(_0x26a21f,_0x11fe67,_0x21a5fd){var _0x50684c={};var _0x3f4e01={};var _0x19620c;var _0x3713e9;return db[_0xaf06('0x3c')][_0xaf06('0x51')]({'where':{'id':_0x26a21f[_0xaf06('0x4b')]['id']}})[_0xaf06('0x1f')](handleEntityNotFound(_0x11fe67,null))[_0xaf06('0x1f')](function(_0x388ab0){if(_0x388ab0){_0x19620c=_0x388ab0;_0x3f4e01[_0xaf06('0x31')]=_[_0xaf06('0x2d')](db['Condition']['rawAttributes']);_0x3f4e01['query']=_[_0xaf06('0x2d')](_0x26a21f['query']);_0x3f4e01['filters']=_[_0xaf06('0x30')](_0x3f4e01[_0xaf06('0x31')],_0x3f4e01[_0xaf06('0x2e')]);_0x50684c[_0xaf06('0x32')]=_[_0xaf06('0x30')](_0x3f4e01['model'],qs['fields'](_0x26a21f[_0xaf06('0x2e')][_0xaf06('0x33')]));_0x50684c['attributes']=_0x50684c[_0xaf06('0x32')][_0xaf06('0x34')]?_0x50684c[_0xaf06('0x32')]:_0x3f4e01[_0xaf06('0x31')];_0x50684c['order']=qs[_0xaf06('0x52')](_0x26a21f['query'][_0xaf06('0x52')]);_0x50684c[_0xaf06('0x38')]=qs[_0xaf06('0x2f')](_[_0xaf06('0x53')](_0x26a21f['query'],_0x3f4e01[_0xaf06('0x2f')]));if(_0x26a21f[_0xaf06('0x2e')]['filter']){_0x50684c[_0xaf06('0x38')]=_[_0xaf06('0x3a')](_0x50684c['where'],{'$or':_[_0xaf06('0x2c')](_0x50684c['attributes'],function(_0x389acf){var _0x2331fa={};_0x2331fa[_0x389acf]={'$like':'%'+_0x26a21f[_0xaf06('0x2e')][_0xaf06('0x39')]+'%'};return _0x2331fa;})});}_0x50684c=_[_0xaf06('0x3a')]({},_0x50684c,_0x26a21f[_0xaf06('0x3b')]);return _0x19620c[_0xaf06('0x50')](_0x50684c);}})[_0xaf06('0x1f')](function(_0x599082){if(_0x599082){_0x3713e9=_0x599082[_0xaf06('0x34')];if(!_0x26a21f[_0xaf06('0x2e')][_0xaf06('0x35')](_0xaf06('0x36'))){_0x50684c['limit']=qs[_0xaf06('0x18')](_0x26a21f[_0xaf06('0x2e')][_0xaf06('0x18')]);_0x50684c[_0xaf06('0x17')]=qs['offset'](_0x26a21f['query'][_0xaf06('0x17')]);}return _0x19620c[_0xaf06('0x50')](_0x50684c);}})[_0xaf06('0x1f')](function(_0x4c2c6d){if(_0x4c2c6d){return _0x4c2c6d?{'count':_0x3713e9,'rows':_0x4c2c6d}:null;}})['then'](respondWithResult(_0x11fe67,null))[_0xaf06('0x40')](handleError(_0x11fe67,null));};exports[_0xaf06('0x54')]=function(_0x5d41bb,_0x16966c,_0x4c9675){var _0x288630={};var _0x4a8117={};var _0x137bb0;var _0x523f11;return db['Trigger'][_0xaf06('0x51')]({'where':{'id':_0x5d41bb[_0xaf06('0x4b')]['id']}})[_0xaf06('0x1f')](handleEntityNotFound(_0x16966c,null))[_0xaf06('0x1f')](function(_0x968ee6){if(_0x968ee6){_0x137bb0=_0x968ee6;_0x4a8117[_0xaf06('0x31')]=_['keys'](db['Condition']['rawAttributes']);_0x4a8117[_0xaf06('0x2e')]=_['keys'](_0x5d41bb[_0xaf06('0x2e')]);_0x4a8117[_0xaf06('0x2f')]=_['intersection'](_0x4a8117[_0xaf06('0x31')],_0x4a8117[_0xaf06('0x2e')]);_0x288630[_0xaf06('0x32')]=_['intersection'](_0x4a8117[_0xaf06('0x31')],qs[_0xaf06('0x33')](_0x5d41bb[_0xaf06('0x2e')][_0xaf06('0x33')]));_0x288630[_0xaf06('0x32')]=_0x288630[_0xaf06('0x32')][_0xaf06('0x34')]?_0x288630[_0xaf06('0x32')]:_0x4a8117[_0xaf06('0x31')];_0x288630['order']=qs[_0xaf06('0x52')](_0x5d41bb[_0xaf06('0x2e')][_0xaf06('0x52')]);_0x288630['where']=qs[_0xaf06('0x2f')](_['pick'](_0x5d41bb[_0xaf06('0x2e')],_0x4a8117[_0xaf06('0x2f')]));if(_0x5d41bb[_0xaf06('0x2e')][_0xaf06('0x39')]){_0x288630[_0xaf06('0x38')]=_[_0xaf06('0x3a')](_0x288630[_0xaf06('0x38')],{'$or':_['map'](_0x288630[_0xaf06('0x32')],function(_0x5daf69){var _0x52b87d={};_0x52b87d[_0x5daf69]={'$like':'%'+_0x5d41bb[_0xaf06('0x2e')][_0xaf06('0x39')]+'%'};return _0x52b87d;})});}_0x288630=_[_0xaf06('0x3a')]({},_0x288630,_0x5d41bb[_0xaf06('0x3b')]);return _0x137bb0['getAnyConditions'](_0x288630);}})['then'](function(_0x426dd6){if(_0x426dd6){_0x523f11=_0x426dd6['length'];if(!_0x5d41bb[_0xaf06('0x2e')][_0xaf06('0x35')](_0xaf06('0x36'))){_0x288630[_0xaf06('0x18')]=qs['limit'](_0x5d41bb[_0xaf06('0x2e')][_0xaf06('0x18')]);_0x288630['offset']=qs['offset'](_0x5d41bb[_0xaf06('0x2e')][_0xaf06('0x17')]);}return _0x137bb0['getAnyConditions'](_0x288630);}})[_0xaf06('0x1f')](function(_0x3c15eb){if(_0x3c15eb){return _0x3c15eb?{'count':_0x523f11,'rows':_0x3c15eb}:null;}})[_0xaf06('0x1f')](respondWithResult(_0x16966c,null))[_0xaf06('0x40')](handleError(_0x16966c,null));};exports[_0xaf06('0x55')]=function(_0x558743,_0x4737f3,_0x15c560){if(_0x558743[_0xaf06('0x4a')]['id']){delete _0x558743[_0xaf06('0x4a')]['id'];}return db[_0xaf06('0x3c')][_0xaf06('0x42')]({'where':{'id':_0x558743['params']['id']}})[_0xaf06('0x1f')](handleEntityNotFound(_0x4737f3,null))[_0xaf06('0x1f')](function(_0x3182c0){if(_0x3182c0){_0x558743['body'][_0xaf06('0x56')]=_0x3182c0['id'];return db[_0xaf06('0x57')][_0xaf06('0x43')](_0x558743['body']);}})[_0xaf06('0x1f')](respondWithResult(_0x4737f3,null))[_0xaf06('0x40')](handleError(_0x4737f3,null));};exports[_0xaf06('0x58')]=function(_0xd3fdcc,_0x5e50d3,_0x464e5a){var _0x11f5d5={};var _0x3325b0={};var _0x16c4b9;var _0x39cd2a;return db[_0xaf06('0x3c')][_0xaf06('0x51')]({'where':{'id':_0xd3fdcc[_0xaf06('0x4b')]['id']}})[_0xaf06('0x1f')](handleEntityNotFound(_0x5e50d3,null))['then'](function(_0xf814bc){if(_0xf814bc){_0x16c4b9=_0xf814bc;_0x3325b0['model']=_[_0xaf06('0x2d')](db[_0xaf06('0x57')][_0xaf06('0x29')]);_0x3325b0[_0xaf06('0x2e')]=_[_0xaf06('0x2d')](_0xd3fdcc[_0xaf06('0x2e')]);_0x3325b0[_0xaf06('0x2f')]=_['intersection'](_0x3325b0[_0xaf06('0x31')],_0x3325b0[_0xaf06('0x2e')]);_0x11f5d5[_0xaf06('0x32')]=_['intersection'](_0x3325b0['model'],qs[_0xaf06('0x33')](_0xd3fdcc[_0xaf06('0x2e')][_0xaf06('0x33')]));_0x11f5d5[_0xaf06('0x32')]=_0x11f5d5[_0xaf06('0x32')][_0xaf06('0x34')]?_0x11f5d5[_0xaf06('0x32')]:_0x3325b0[_0xaf06('0x31')];_0x11f5d5['order']=qs[_0xaf06('0x52')](_0xd3fdcc['query'][_0xaf06('0x52')]);_0x11f5d5['where']=qs[_0xaf06('0x2f')](_[_0xaf06('0x53')](_0xd3fdcc['query'],_0x3325b0[_0xaf06('0x2f')]));if(_0xd3fdcc[_0xaf06('0x2e')][_0xaf06('0x39')]){_0x11f5d5[_0xaf06('0x38')]=_['merge'](_0x11f5d5[_0xaf06('0x38')],{'$or':_['map'](_0x11f5d5[_0xaf06('0x32')],function(_0xdb7100){var _0x56b0ee={};_0x56b0ee[_0xdb7100]={'$like':'%'+_0xd3fdcc[_0xaf06('0x2e')][_0xaf06('0x39')]+'%'};return _0x56b0ee;})});}_0x11f5d5=_[_0xaf06('0x3a')]({},_0x11f5d5,_0xd3fdcc[_0xaf06('0x3b')]);return _0x16c4b9[_0xaf06('0x58')](_0x11f5d5);}})[_0xaf06('0x1f')](function(_0x5f4658){if(_0x5f4658){_0x39cd2a=_0x5f4658[_0xaf06('0x34')];if(!_0xd3fdcc[_0xaf06('0x2e')][_0xaf06('0x35')](_0xaf06('0x36'))){_0x11f5d5['limit']=qs[_0xaf06('0x18')](_0xd3fdcc[_0xaf06('0x2e')]['limit']);_0x11f5d5[_0xaf06('0x17')]=qs['offset'](_0xd3fdcc['query'][_0xaf06('0x17')]);}return _0x16c4b9[_0xaf06('0x58')](_0x11f5d5);}})[_0xaf06('0x1f')](function(_0x2499e2){if(_0x2499e2){return _0x2499e2?{'count':_0x39cd2a,'rows':_0x2499e2}:null;}})[_0xaf06('0x1f')](respondWithResult(_0x5e50d3,null))[_0xaf06('0x40')](handleError(_0x5e50d3,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index c18c681..30bd40d 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 _0xe0c3=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe0c3,0xea));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3e0c('0x0'));var util=require('util');var logger=require(_0x3e0c('0x1'))(_0x3e0c('0x2'));var moment=require(_0x3e0c('0x3'));var BPromise=require(_0x3e0c('0x4'));var rp=require(_0x3e0c('0x5'));var fs=require('fs');var path=require(_0x3e0c('0x6'));var rimraf=require(_0x3e0c('0x7'));var config=require(_0x3e0c('0x8'));var attributes=require(_0x3e0c('0x9'));module['exports']=function(_0x530ebf,_0x163adf){return _0x530ebf[_0x3e0c('0xa')](_0x3e0c('0xb'),attributes,{'tableName':_0x3e0c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeedf=['exports','define','tools_triggers','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xeedf,0x12c));var _0xfeed=function(_0x90dc96,_0x1fb9fd){_0x90dc96=_0x90dc96-0x0;var _0x1892cd=_0xeedf[_0x90dc96];return _0x1892cd;};'use strict';var _=require(_0xfeed('0x0'));var util=require(_0xfeed('0x1'));var logger=require(_0xfeed('0x2'))('api');var moment=require(_0xfeed('0x3'));var BPromise=require('bluebird');var rp=require(_0xfeed('0x4'));var fs=require('fs');var path=require(_0xfeed('0x5'));var rimraf=require(_0xfeed('0x6'));var config=require(_0xfeed('0x7'));var attributes=require('./trigger.attributes');module[_0xfeed('0x8')]=function(_0x2c211d,_0x5df4fe){return _0x2c211d[_0xfeed('0x9')]('Trigger',attributes,{'tableName':_0xfeed('0xa'),'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 05c19ef..5f9b32a 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 _0xf8a0=['map','model','ShowTrigger','Trigger','find','lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','findAll','options','raw','where','attributes','limit','include'];(function(_0x3a3e39,_0x22f7fd){var _0x20b662=function(_0x53e4a0){while(--_0x53e4a0){_0x3a3e39['push'](_0x3a3e39['shift']());}};_0x20b662(++_0x22f7fd);}(_0xf8a0,0x6b));var _0x0f8a=function(_0x321730,_0x1fb230){_0x321730=_0x321730-0x0;var _0x4344eb=_0xf8a0[_0x321730];return _0x4344eb;};'use strict';var _=require(_0x0f8a('0x0'));var util=require(_0x0f8a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0f8a('0x2'));var fs=require('fs');var Redis=require(_0x0f8a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f8a('0x4'));var logger=require('../../config/logger')(_0x0f8a('0x5'));var config=require(_0x0f8a('0x6'));var jayson=require(_0x0f8a('0x7'));var client=jayson[_0x0f8a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fc737,_0x4fd316,_0x5334d8){return new BPromise(function(_0x42dca8,_0xb3cbce){return client[_0x0f8a('0x9')](_0x4fc737,_0x5334d8)[_0x0f8a('0xa')](function(_0x3d6674){logger[_0x0f8a('0xb')](_0x0f8a('0xc'),_0x4fd316,_0x0f8a('0xd'));logger[_0x0f8a('0xe')](_0x0f8a('0xf'),_0x4fd316,_0x0f8a('0xd'),JSON[_0x0f8a('0x10')](_0x3d6674));if(_0x3d6674['error']){if(_0x3d6674[_0x0f8a('0x11')][_0x0f8a('0x12')]===0x1f4){logger[_0x0f8a('0x11')](_0x0f8a('0xc'),_0x4fd316,_0x3d6674[_0x0f8a('0x11')][_0x0f8a('0x13')]);return _0xb3cbce(_0x3d6674[_0x0f8a('0x11')][_0x0f8a('0x13')]);}logger[_0x0f8a('0x11')](_0x0f8a('0xc'),_0x4fd316,_0x3d6674['error'][_0x0f8a('0x13')]);return _0x42dca8(_0x3d6674[_0x0f8a('0x11')][_0x0f8a('0x13')]);}else{logger[_0x0f8a('0xb')](_0x0f8a('0xc'),_0x4fd316,_0x0f8a('0xd'));_0x42dca8(_0x3d6674['result'][_0x0f8a('0x13')]);}})[_0x0f8a('0x14')](function(_0x4e972b){logger[_0x0f8a('0x11')](_0x0f8a('0xc'),_0x4fd316,_0x4e972b);_0xb3cbce(_0x4e972b);});});}exports[_0x0f8a('0x15')]=function(_0x54c348){var _0x1ebd04=this;return new Promise(function(_0x35729d,_0xe5d059){return db['Trigger'][_0x0f8a('0x16')]({'raw':_0x54c348['options']?_0x54c348[_0x0f8a('0x17')][_0x0f8a('0x18')]===undefined?!![]:![]:!![],'where':_0x54c348[_0x0f8a('0x17')]?_0x54c348[_0x0f8a('0x17')][_0x0f8a('0x19')]||null:null,'attributes':_0x54c348['options']?_0x54c348[_0x0f8a('0x17')][_0x0f8a('0x1a')]||null:null,'limit':_0x54c348[_0x0f8a('0x17')]?_0x54c348['options'][_0x0f8a('0x1b')]||null:null,'include':_0x54c348[_0x0f8a('0x17')]?_0x54c348[_0x0f8a('0x17')][_0x0f8a('0x1c')]?_[_0x0f8a('0x1d')](_0x54c348['options'][_0x0f8a('0x1c')],function(_0x1f82bf){return{'model':db[_0x1f82bf['model']],'as':_0x1f82bf['as'],'attributes':_0x1f82bf[_0x0f8a('0x1a')],'include':_0x1f82bf['include']?_['map'](_0x1f82bf['include'],function(_0x2f672a){return{'model':db[_0x2f672a[_0x0f8a('0x1e')]],'as':_0x2f672a['as'],'attributes':_0x2f672a['attributes'],'include':_0x2f672a[_0x0f8a('0x1c')]?_[_0x0f8a('0x1d')](_0x2f672a['include'],function(_0x1056c9){return{'model':db[_0x1056c9[_0x0f8a('0x1e')]],'as':_0x1056c9['as'],'attributes':_0x1056c9[_0x0f8a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0f8a('0xa')](function(_0x4ef5ce){logger['info'](_0x0f8a('0x15'),_0x54c348);logger['debug'](_0x0f8a('0x15'),_0x54c348,JSON[_0x0f8a('0x10')](_0x4ef5ce));_0x35729d(_0x4ef5ce);})['catch'](function(_0x5ab7ba){logger[_0x0f8a('0x11')](_0x0f8a('0x15'),_0x5ab7ba['message'],_0x54c348);_0xe5d059(_0x1ebd04[_0x0f8a('0x11')](0x1f4,_0x5ab7ba[_0x0f8a('0x13')]));});});};exports[_0x0f8a('0x1f')]=function(_0x104544){var _0x211eb9=this;return new Promise(function(_0xc69861,_0x1d91d2){return db[_0x0f8a('0x20')][_0x0f8a('0x21')]({'raw':_0x104544[_0x0f8a('0x17')]?_0x104544[_0x0f8a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x104544['options']?_0x104544['options']['where']||null:null,'attributes':_0x104544[_0x0f8a('0x17')]?_0x104544[_0x0f8a('0x17')][_0x0f8a('0x1a')]||null:null,'include':_0x104544[_0x0f8a('0x17')]?_0x104544[_0x0f8a('0x17')][_0x0f8a('0x1c')]?_[_0x0f8a('0x1d')](_0x104544[_0x0f8a('0x17')][_0x0f8a('0x1c')],function(_0x56d5ba){return{'model':db[_0x56d5ba[_0x0f8a('0x1e')]],'as':_0x56d5ba['as'],'attributes':_0x56d5ba[_0x0f8a('0x1a')],'include':_0x56d5ba[_0x0f8a('0x1c')]?_[_0x0f8a('0x1d')](_0x56d5ba[_0x0f8a('0x1c')],function(_0x6823fd){return{'model':db[_0x6823fd[_0x0f8a('0x1e')]],'as':_0x6823fd['as'],'attributes':_0x6823fd[_0x0f8a('0x1a')],'include':_0x6823fd[_0x0f8a('0x1c')]?_[_0x0f8a('0x1d')](_0x6823fd['include'],function(_0x1b5815){return{'model':db[_0x1b5815[_0x0f8a('0x1e')]],'as':_0x1b5815['as'],'attributes':_0x1b5815['attributes']};}):[]};}):[]};}):[]:[]})[_0x0f8a('0xa')](function(_0x49e4a9){logger['info'](_0x0f8a('0x1f'),_0x104544);logger[_0x0f8a('0xe')]('ShowTrigger',_0x104544,JSON['stringify'](_0x49e4a9));_0xc69861(_0x49e4a9);})['catch'](function(_0x1e953f){logger[_0x0f8a('0x11')]('ShowTrigger',_0x1e953f[_0x0f8a('0x13')],_0x104544);_0x1d91d2(_0x211eb9[_0x0f8a('0x11')](0x1f4,_0x1e953f[_0x0f8a('0x13')]));});});}; \ No newline at end of file +var _0xe1c0=['client','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetTrigger','Trigger','options','raw','where','attributes','include','model','map','ShowTrigger','find','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xa22539,_0x4683ca){var _0x12d52f=function(_0x165b7d){while(--_0x165b7d){_0xa22539['push'](_0xa22539['shift']());}};_0x12d52f(++_0x4683ca);}(_0xe1c0,0x120));var _0x0e1c=function(_0x42feea,_0x33ecfa){_0x42feea=_0x42feea-0x0;var _0x479b86=_0xe1c0[_0x42feea];return _0x479b86;};'use strict';var _=require(_0x0e1c('0x0'));var util=require(_0x0e1c('0x1'));var moment=require(_0x0e1c('0x2'));var BPromise=require(_0x0e1c('0x3'));var rs=require(_0x0e1c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0e1c('0x5'))(_0x0e1c('0x6'));var config=require(_0x0e1c('0x7'));var jayson=require(_0x0e1c('0x8'));var client=jayson[_0x0e1c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bdd62,_0x321532,_0x2573a6){return new BPromise(function(_0x15f506,_0x3b0168){return client[_0x0e1c('0xa')](_0x5bdd62,_0x2573a6)[_0x0e1c('0xb')](function(_0x48d837){logger['info'](_0x0e1c('0xc'),_0x321532,_0x0e1c('0xd'));logger[_0x0e1c('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x321532,'request\x20sent',JSON[_0x0e1c('0xf')](_0x48d837));if(_0x48d837[_0x0e1c('0x10')]){if(_0x48d837[_0x0e1c('0x10')][_0x0e1c('0x11')]===0x1f4){logger[_0x0e1c('0x10')](_0x0e1c('0xc'),_0x321532,_0x48d837[_0x0e1c('0x10')][_0x0e1c('0x12')]);return _0x3b0168(_0x48d837[_0x0e1c('0x10')][_0x0e1c('0x12')]);}logger['error'](_0x0e1c('0xc'),_0x321532,_0x48d837[_0x0e1c('0x10')]['message']);return _0x15f506(_0x48d837[_0x0e1c('0x10')][_0x0e1c('0x12')]);}else{logger[_0x0e1c('0x13')](_0x0e1c('0xc'),_0x321532,_0x0e1c('0xd'));_0x15f506(_0x48d837[_0x0e1c('0x14')][_0x0e1c('0x12')]);}})[_0x0e1c('0x15')](function(_0x275214){logger['error'](_0x0e1c('0xc'),_0x321532,_0x275214);_0x3b0168(_0x275214);});});}exports[_0x0e1c('0x16')]=function(_0x3213d8){var _0x15485e=this;return new Promise(function(_0xd8b252,_0x5aecf9){return db[_0x0e1c('0x17')]['findAll']({'raw':_0x3213d8[_0x0e1c('0x18')]?_0x3213d8['options'][_0x0e1c('0x19')]===undefined?!![]:![]:!![],'where':_0x3213d8['options']?_0x3213d8[_0x0e1c('0x18')][_0x0e1c('0x1a')]||null:null,'attributes':_0x3213d8[_0x0e1c('0x18')]?_0x3213d8[_0x0e1c('0x18')][_0x0e1c('0x1b')]||null:null,'limit':_0x3213d8[_0x0e1c('0x18')]?_0x3213d8[_0x0e1c('0x18')]['limit']||null:null,'include':_0x3213d8[_0x0e1c('0x18')]?_0x3213d8[_0x0e1c('0x18')][_0x0e1c('0x1c')]?_['map'](_0x3213d8['options'][_0x0e1c('0x1c')],function(_0x2393bb){return{'model':db[_0x2393bb['model']],'as':_0x2393bb['as'],'attributes':_0x2393bb[_0x0e1c('0x1b')],'include':_0x2393bb[_0x0e1c('0x1c')]?_['map'](_0x2393bb['include'],function(_0x27c8f4){return{'model':db[_0x27c8f4[_0x0e1c('0x1d')]],'as':_0x27c8f4['as'],'attributes':_0x27c8f4['attributes'],'include':_0x27c8f4[_0x0e1c('0x1c')]?_[_0x0e1c('0x1e')](_0x27c8f4['include'],function(_0x231706){return{'model':db[_0x231706['model']],'as':_0x231706['as'],'attributes':_0x231706[_0x0e1c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0e1c('0xb')](function(_0x4c57c6){logger[_0x0e1c('0x13')](_0x0e1c('0x16'),_0x3213d8);logger[_0x0e1c('0xe')](_0x0e1c('0x16'),_0x3213d8,JSON[_0x0e1c('0xf')](_0x4c57c6));_0xd8b252(_0x4c57c6);})[_0x0e1c('0x15')](function(_0xf659aa){logger[_0x0e1c('0x10')](_0x0e1c('0x16'),_0xf659aa[_0x0e1c('0x12')],_0x3213d8);_0x5aecf9(_0x15485e[_0x0e1c('0x10')](0x1f4,_0xf659aa[_0x0e1c('0x12')]));});});};exports[_0x0e1c('0x1f')]=function(_0x54f5bc){var _0x45f3ff=this;return new Promise(function(_0x34af33,_0x5e6135){return db['Trigger'][_0x0e1c('0x20')]({'raw':_0x54f5bc['options']?_0x54f5bc[_0x0e1c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x54f5bc[_0x0e1c('0x18')]?_0x54f5bc[_0x0e1c('0x18')][_0x0e1c('0x1a')]||null:null,'attributes':_0x54f5bc['options']?_0x54f5bc[_0x0e1c('0x18')][_0x0e1c('0x1b')]||null:null,'include':_0x54f5bc[_0x0e1c('0x18')]?_0x54f5bc[_0x0e1c('0x18')][_0x0e1c('0x1c')]?_[_0x0e1c('0x1e')](_0x54f5bc[_0x0e1c('0x18')][_0x0e1c('0x1c')],function(_0x474bd4){return{'model':db[_0x474bd4[_0x0e1c('0x1d')]],'as':_0x474bd4['as'],'attributes':_0x474bd4['attributes'],'include':_0x474bd4[_0x0e1c('0x1c')]?_[_0x0e1c('0x1e')](_0x474bd4['include'],function(_0x3a209b){return{'model':db[_0x3a209b['model']],'as':_0x3a209b['as'],'attributes':_0x3a209b[_0x0e1c('0x1b')],'include':_0x3a209b['include']?_['map'](_0x3a209b[_0x0e1c('0x1c')],function(_0x426bf2){return{'model':db[_0x426bf2['model']],'as':_0x426bf2['as'],'attributes':_0x426bf2[_0x0e1c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0e1c('0xb')](function(_0x51fa69){logger[_0x0e1c('0x13')](_0x0e1c('0x1f'),_0x54f5bc);logger['debug'](_0x0e1c('0x1f'),_0x54f5bc,JSON[_0x0e1c('0xf')](_0x51fa69));_0x34af33(_0x51fa69);})['catch'](function(_0x24cbb6){logger[_0x0e1c('0x10')](_0x0e1c('0x1f'),_0x24cbb6[_0x0e1c('0x12')],_0x54f5bc);_0x5e6135(_0x45f3ff['error'](0x1f4,_0x24cbb6[_0x0e1c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 46377c0..2365132 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 _0x7c02=['clone','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated','show','/:id/clone'];(function(_0x54e292,_0x13e9eb){var _0x52e913=function(_0x1b4992){while(--_0x1b4992){_0x54e292['push'](_0x54e292['shift']());}};_0x52e913(++_0x13e9eb);}(_0x7c02,0x1c0));var _0x27c0=function(_0x5ec634,_0xa835b9){_0x5ec634=_0x5ec634-0x0;var _0x5b94a9=_0x7c02[_0x5ec634];return _0x5b94a9;};'use strict';var multer=require(_0x27c0('0x0'));var util=require(_0x27c0('0x1'));var path=require(_0x27c0('0x2'));var timeout=require(_0x27c0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x27c0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x27c0('0x5'));var config=require(_0x27c0('0x6'));var controller=require(_0x27c0('0x7'));router[_0x27c0('0x8')]('/',auth['isAuthenticated'](),controller[_0x27c0('0x9')]);router[_0x27c0('0x8')](_0x27c0('0xa'),auth[_0x27c0('0xb')](),controller[_0x27c0('0xc')]);router['post'](_0x27c0('0xd'),auth[_0x27c0('0xb')](),controller[_0x27c0('0xe')]);router[_0x27c0('0xf')]('/',auth[_0x27c0('0xb')](),controller[_0x27c0('0x10')]);router['put'](_0x27c0('0xa'),auth[_0x27c0('0xb')](),controller[_0x27c0('0x11')]);router[_0x27c0('0x12')]('/:id',auth[_0x27c0('0xb')](),controller[_0x27c0('0x13')]);module[_0x27c0('0x14')]=router; \ No newline at end of file +var _0x575b=['fs-extra','../../components/interaction/service','isAuthenticated','get','/:id','show','post','/:id/clone','put','update','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x3f0ed7,_0x1f439f){var _0x34578f=function(_0x498fe4){while(--_0x498fe4){_0x3f0ed7['push'](_0x3f0ed7['shift']());}};_0x34578f(++_0x1f439f);}(_0x575b,0x10b));var _0xb575=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x575b[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0xb575('0x0'));var util=require(_0xb575('0x1'));var path=require('path');var timeout=require(_0xb575('0x2'));var express=require(_0xb575('0x3'));var router=express[_0xb575('0x4')]();var fs_extra=require(_0xb575('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb575('0x6'));var config=require('../../config/environment');var controller=require('./trunk.controller');router['get']('/',auth[_0xb575('0x7')](),controller['index']);router[_0xb575('0x8')](_0xb575('0x9'),auth[_0xb575('0x7')](),controller[_0xb575('0xa')]);router[_0xb575('0xb')](_0xb575('0xc'),auth[_0xb575('0x7')](),controller['clone']);router['post']('/',auth[_0xb575('0x7')](),controller['create']);router[_0xb575('0xd')]('/:id',auth[_0xb575('0x7')](),controller[_0xb575('0xe')]);router['delete'](_0xb575('0x9'),auth['isAuthenticated'](),controller[_0xb575('0xf')]);module[_0xb575('0x10')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 16981b0..0eb10e9 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 _0x4b64=['ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','nonat','update','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','port,invite','insecure','never','INTEGER','always','refuse','uac','uas','passive','actpass','dynamic','update,nonat','sequelize','name','ENUM','friend','peer','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN'];(function(_0x1e3e59,_0x596d22){var _0x4cdd16=function(_0xec196f){while(--_0xec196f){_0x1e3e59['push'](_0x1e3e59['shift']());}};_0x4cdd16(++_0x596d22);}(_0x4b64,0xdd));var _0x44b6=function(_0xd60ec9,_0x4c62fd){_0xd60ec9=_0xd60ec9-0x0;var _0x4a6c4b=_0x4b64[_0xd60ec9];return _0x4a6c4b;};'use strict';var Sequelize=require(_0x44b6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x44b6('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x3'),'user',_0x44b6('0x4')),'allowNull':![],'defaultValue':_0x44b6('0x3')},'context':{'type':Sequelize[_0x44b6('0x5')],'allowNull':![],'defaultValue':_0x44b6('0x6')},'callingpres':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x7'),_0x44b6('0x8'),'ALLOWED_FAILED_SCREEN',_0x44b6('0x9'),_0x44b6('0xa'),_0x44b6('0xb'),_0x44b6('0xc'),_0x44b6('0xd'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x44b6('0x5')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x44b6('0x5')]},'remotesecret':{'type':Sequelize[_0x44b6('0x5')]},'transport':{'type':Sequelize[_0x44b6('0x5')],'defaultValue':_0x44b6('0xe'),'set':function(_0x46e446){this[_0x44b6('0xf')]('transport',_0x46e446?_0x46e446[_0x44b6('0x10')](','):null);},'get':function(){return this[_0x44b6('0x11')](_0x44b6('0x12'))?this[_0x44b6('0x11')](_0x44b6('0x12'))[_0x44b6('0x13')](','):null;},'comment':_0x44b6('0x14')},'dtmfmode':{'type':Sequelize['ENUM'](_0x44b6('0x15'),_0x44b6('0x16'),'shortinfo',_0x44b6('0x17'),_0x44b6('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x44b6('0x2')]('yes','no',_0x44b6('0x19'),_0x44b6('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x44b6('0x5')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x44b6('0x1c'),'set':function(_0x5659e6){this[_0x44b6('0xf')](_0x44b6('0x1d'),_0x5659e6?_0x5659e6[_0x44b6('0x10')](','):null);},'get':function(){return this[_0x44b6('0x11')](_0x44b6('0x1d'))?this[_0x44b6('0x11')]('nat')[_0x44b6('0x13')](','):null;},'comment':_0x44b6('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x44b6('0x5')]},'pickupgroup':{'type':Sequelize[_0x44b6('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x44b6('0x5')]},'language':{'type':Sequelize[_0x44b6('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x44b6('0x5')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x44b6('0x5')],'defaultValue':_0x44b6('0x1f')},'allow':{'type':Sequelize[_0x44b6('0x5')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x23e638){this['setDataValue']('allow',_0x23e638?_0x23e638[_0x44b6('0x10')](';'):_0x44b6('0x20'));},'get':function(){return this[_0x44b6('0x11')]('allow')?this['getDataValue'](_0x44b6('0x21'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x44b6('0x2')]('yes','no')},'insecure':{'type':Sequelize[_0x44b6('0x5')],'defaultValue':_0x44b6('0x22'),'set':function(_0x350256){this['setDataValue'](_0x44b6('0x23'),_0x350256?_0x350256['join'](','):null);},'get':function(){return this[_0x44b6('0x11')]('insecure')?this[_0x44b6('0x11')](_0x44b6('0x23'))[_0x44b6('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x1b'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x1b'),'no',_0x44b6('0x24'))},'promiscredir':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x1b'),'no')},'useclientcode':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x1b'),'no')},'accountcode':{'type':Sequelize[_0x44b6('0x25')](0xb)},'setvar':{'type':Sequelize[_0x44b6('0x5')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x44b6('0x5')]},'callcounter':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x1b'),'no'),'defaultValue':_0x44b6('0x1b')},'busylevel':{'type':Sequelize[_0x44b6('0x25')](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x1b'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x44b6('0x1b'),'no')},'ignoresdpversion':{'type':Sequelize[_0x44b6('0x2')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x44b6('0x5')]},'template':{'type':Sequelize[_0x44b6('0x5')]},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0x44b6('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x44b6('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x1b'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x44b6('0x2')]('accept',_0x44b6('0x27'),'originate')},'session_expires':{'type':Sequelize[_0x44b6('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x44b6('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x28'),_0x44b6('0x29')),'defaultValue':_0x44b6('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x44b6('0x5')]},'regexten':{'type':Sequelize[_0x44b6('0x5')]},'fromdomain':{'type':Sequelize[_0x44b6('0x5')]},'fromuser':{'type':Sequelize[_0x44b6('0x5')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x44b6('0x2')]('yes','no'),'defaultValue':_0x44b6('0x1b')},'keepalive':{'type':Sequelize[_0x44b6('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x44b6('0x5')]},'defaultuser':{'type':Sequelize[_0x44b6('0x5')]},'rtptimeout':{'type':Sequelize[_0x44b6('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x44b6('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x44b6('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x44b6('0x2')]('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x44b6('0x5')]},'callbackextension':{'type':Sequelize[_0x44b6('0x5')]},'timert1':{'type':Sequelize[_0x44b6('0x25')](0xb)},'timerb':{'type':Sequelize[_0x44b6('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x44b6('0x5')]},'contactdeny':{'type':Sequelize[_0x44b6('0x5')]},'contactacl':{'type':Sequelize[_0x44b6('0x5')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x44b6('0x5')]},'maxforwards':{'type':Sequelize[_0x44b6('0x25')](0xb)},'encryption':{'type':Sequelize[_0x44b6('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x1b'),'no')},'force_avp':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x1b'),'no')},'icesupport':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x1b'),'no')},'dtlsenable':{'type':Sequelize[_0x44b6('0x2')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x44b6('0x1b'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0x44b6('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x44b6('0x5')]},'dtlsprivatekey':{'type':Sequelize[_0x44b6('0x5')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x44b6('0x5')]},'dtlscapath':{'type':Sequelize[_0x44b6('0x5')]},'dtlssetup':{'type':Sequelize[_0x44b6('0x2')]('active',_0x44b6('0x2a'),_0x44b6('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x44b6('0x5')]},'usereqphone':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x1b'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x44b6('0x5')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x44b6('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x1b'),'no')},'subscribemwi':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x1b'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x44b6('0x5')]},'mohsuggest':{'type':Sequelize[_0x44b6('0x5')]},'parkinglot':{'type':Sequelize[_0x44b6('0x5')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x44b6('0x5')],'defaultValue':_0x44b6('0x2c')},'canreinvite':{'type':Sequelize[_0x44b6('0x2')](_0x44b6('0x1b'),'no','nonat',_0x44b6('0x1a'),_0x44b6('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x44b6('0x5')]},'otherFields':{'type':Sequelize[_0x44b6('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x44b6('0x5')],'defaultValue':'no'}}; \ No newline at end of file +var _0x224d=['never','\x22\x22\x20<>','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','active','passive','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','getDataValue','split','rfc2833','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'];(function(_0x43d4b6,_0xad7ddc){var _0x2ed67c=function(_0x378410){while(--_0x378410){_0x43d4b6['push'](_0x43d4b6['shift']());}};_0x2ed67c(++_0xad7ddc);}(_0x224d,0x114));var _0xd224=function(_0x348d8d,_0x25a6dd){_0x348d8d=_0x348d8d-0x0;var _0x2a7d1f=_0x224d[_0x348d8d];return _0x2a7d1f;};'use strict';var Sequelize=require(_0xd224('0x0'));module[_0xd224('0x1')]={'name':{'type':Sequelize[_0xd224('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x4'),_0xd224('0x5'),_0xd224('0x6')),'allowNull':![],'defaultValue':_0xd224('0x4')},'context':{'type':Sequelize[_0xd224('0x2')],'allowNull':![],'defaultValue':_0xd224('0x7')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0xd224('0x8'),_0xd224('0x9'),_0xd224('0xa'),_0xd224('0xb'),_0xd224('0xc'),_0xd224('0xd'),_0xd224('0xe'))},'deny':{'type':Sequelize[_0xd224('0x2')]},'permit':{'type':Sequelize[_0xd224('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xd224('0x2')]},'remotesecret':{'type':Sequelize[_0xd224('0x2')]},'transport':{'type':Sequelize[_0xd224('0x2')],'defaultValue':_0xd224('0xf'),'set':function(_0xe9ae83){this['setDataValue'](_0xd224('0x10'),_0xe9ae83?_0xe9ae83['join'](','):null);},'get':function(){return this[_0xd224('0x11')](_0xd224('0x10'))?this['getDataValue'](_0xd224('0x10'))[_0xd224('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0xd224('0x13'),'info','shortinfo',_0xd224('0x14'),_0xd224('0x15')),'defaultValue':_0xd224('0x13')},'directmedia':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x16'),'no',_0xd224('0x17'),_0xd224('0x18'),_0xd224('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xd224('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd224('0x2')]},'directmediadeny':{'type':Sequelize[_0xd224('0x2')]},'nat':{'type':Sequelize[_0xd224('0x2')],'defaultValue':_0xd224('0x1a'),'set':function(_0x1a2edd){this[_0xd224('0x1b')](_0xd224('0x1c'),_0x1a2edd?_0x1a2edd[_0xd224('0x1d')](','):null);},'get':function(){return this[_0xd224('0x11')](_0xd224('0x1c'))?this['getDataValue'](_0xd224('0x1c'))['split'](','):null;},'comment':_0xd224('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xd224('0x2')]},'pickupgroup':{'type':Sequelize[_0xd224('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xd224('0x2')]},'language':{'type':Sequelize[_0xd224('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd224('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0xd224('0x2')],'allowNull':![],'defaultValue':_0xd224('0x1f'),'set':function(_0x37c951){this[_0xd224('0x1b')](_0xd224('0x20'),_0x37c951?_0x37c951[_0xd224('0x1d')](';'):_0xd224('0x1f'));},'get':function(){return this['getDataValue']('allow')?this[_0xd224('0x11')](_0xd224('0x20'))[_0xd224('0x12')](';'):null;},'comment':_0xd224('0x21')},'autoframing':{'type':Sequelize['ENUM'](_0xd224('0x16'),'no')},'insecure':{'type':Sequelize[_0xd224('0x2')],'defaultValue':'port,invite','set':function(_0x37c38a){this[_0xd224('0x1b')](_0xd224('0x22'),_0x37c38a?_0x37c38a['join'](','):null);},'get':function(){return this[_0xd224('0x11')](_0xd224('0x22'))?this['getDataValue'](_0xd224('0x22'))[_0xd224('0x12')](','):null;},'comment':_0xd224('0x23')},'trustrpid':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd224('0x3')]('yes','no',_0xd224('0x24'))},'promiscredir':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x16'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xd224('0x16'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xd224('0x2')]},'callerid':{'type':Sequelize[_0xd224('0x2')],'defaultValue':_0xd224('0x25')},'amaflags':{'type':Sequelize[_0xd224('0x2')]},'callcounter':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x16'),'no'),'defaultValue':_0xd224('0x16')},'busylevel':{'type':Sequelize[_0xd224('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0xd224('0x3')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0xd224('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xd224('0x2')]},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0xd224('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd224('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xd224('0x16'),'no')},'mailbox':{'type':Sequelize[_0xd224('0x2')]},'session_timers':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x28'),_0xd224('0x29'),_0xd224('0x2a'))},'session_expires':{'type':Sequelize[_0xd224('0x26')](0xb)},'session_minse':{'type':Sequelize[_0xd224('0x26')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xd224('0x2b'),_0xd224('0x2c')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xd224('0x2')]},'regexten':{'type':Sequelize[_0xd224('0x2')]},'fromdomain':{'type':Sequelize[_0xd224('0x2')]},'fromuser':{'type':Sequelize[_0xd224('0x2')]},'port':{'type':Sequelize[_0xd224('0x26')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xd224('0x16'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xd224('0x2')]},'rtptimeout':{'type':Sequelize[_0xd224('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xd224('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x16'),'no',_0xd224('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd224('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xd224('0x26')](0xb)},'timerb':{'type':Sequelize[_0xd224('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0xd224('0x26')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xd224('0x2')]},'contactacl':{'type':Sequelize[_0xd224('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xd224('0x16'),'no')},'force_avp':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x16'),'no')},'icesupport':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x16'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x16'),'no',_0xd224('0x2e'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xd224('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0xd224('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xd224('0x2')]},'dtlscipher':{'type':Sequelize[_0xd224('0x2')]},'dtlscafile':{'type':Sequelize[_0xd224('0x2')]},'dtlscapath':{'type':Sequelize[_0xd224('0x2')]},'dtlssetup':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x2f'),_0xd224('0x30'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd224('0x2')]},'usereqphone':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd224('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xd224('0x3')](_0xd224('0x16'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0xd224('0x2')]},'mohinterpret':{'type':Sequelize[_0xd224('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xd224('0x2')]},'description':{'type':Sequelize[_0xd224('0x2')]},'host':{'type':Sequelize[_0xd224('0x2')],'defaultValue':_0xd224('0x31')},'canreinvite':{'type':Sequelize['ENUM'](_0xd224('0x16'),'no',_0xd224('0x17'),_0xd224('0x18'),_0xd224('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xd224('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xd224('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 8490d24..5dcdf70 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 _0xbec5=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','Trunks','UserProfileResource','destroy','stack','name','send','map','Trunk','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','attributes','find','clone','get','omit','updatedAt','body','createdAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','join','server/files/templates/trunk.ejs','utf8'];(function(_0x27a101,_0x33ee36){var _0x21348c=function(_0x293a8a){while(--_0x293a8a){_0x27a101['push'](_0x27a101['shift']());}};_0x21348c(++_0x33ee36);}(_0xbec5,0xe5));var _0x5bec=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0xbec5[_0x2132a3];return _0x21890c;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];var jayson=require(_0x5bec('0x19'));var client=jayson['client'][_0x5bec('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xaa984d,_0x35393a,_0x6888a4,_0x3198e0){return new BPromise(function(_0xcd6d90,_0x24dcd6){var _0x43fd2a=_0x3198e0||client;return _0x43fd2a[_0x5bec('0x1b')](_0xaa984d,_0x6888a4)[_0x5bec('0x1c')](function(_0x31b9e4){logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,'request\x20sent');logger['debug'](_0x5bec('0x1f'),_0x35393a,_0x5bec('0x20'),JSON[_0x5bec('0x21')](_0x31b9e4));if(_0x31b9e4[_0x5bec('0x22')]){if(_0x31b9e4['error']['code']===0x1f4){logger[_0x5bec('0x22')](_0x5bec('0x1e'),_0x35393a,_0x31b9e4['error'][_0x5bec('0x23')]);return _0x24dcd6(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x31b9e4[_0x5bec('0x22')]['message']);return _0xcd6d90(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}else{logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,_0x5bec('0x20'));_0xcd6d90(_0x31b9e4['result'][_0x5bec('0x23')]);}})['catch'](function(_0x2b2d26){logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x2b2d26);_0x24dcd6(_0x2b2d26);});});}function respondWithStatusCode(_0xa414f8,_0xbef70b){_0xbef70b=_0xbef70b||0xcc;return function(_0x4e0ca2){if(_0x4e0ca2){return _0xa414f8[_0x5bec('0x24')](_0xbef70b);}return _0xa414f8[_0x5bec('0x25')](_0xbef70b)[_0x5bec('0x26')]();};}function respondWithResult(_0x20da89,_0x226d55){_0x226d55=_0x226d55||0xc8;return function(_0x131143){if(_0x131143){return _0x20da89[_0x5bec('0x25')](_0x226d55)['json'](_0x131143);}};}function respondWithFilteredResult(_0x5b63ab,_0x5e44b3){return function(_0x2961bd){if(_0x2961bd){var _0x2cdd2f=typeof _0x5e44b3[_0x5bec('0x27')]==='undefined'&&typeof _0x5e44b3[_0x5bec('0x28')]===_0x5bec('0x29');var _0x57331b=_0x2961bd[_0x5bec('0x2a')];var _0x63ac8=_0x2cdd2f?0x0:_0x5e44b3['offset'];var _0x5336b3=_0x2cdd2f?_0x2961bd[_0x5bec('0x2a')]:_0x5e44b3[_0x5bec('0x27')]+_0x5e44b3[_0x5bec('0x28')];var _0x2c7a7b;if(_0x5336b3>=_0x57331b){_0x5336b3=_0x57331b;_0x2c7a7b=0xc8;}else{_0x2c7a7b=0xce;}_0x5b63ab[_0x5bec('0x25')](_0x2c7a7b);return _0x5b63ab[_0x5bec('0x2b')]('Content-Range',_0x63ac8+'-'+_0x5336b3+'/'+_0x57331b)[_0x5bec('0x2c')](_0x2961bd);}return null;};}function patchUpdates(_0x59b5b6){return function(_0x45863b){try{jsonpatch[_0x5bec('0x2d')](_0x45863b,_0x59b5b6,!![]);}catch(_0x3034c9){return BPromise[_0x5bec('0x2e')](_0x3034c9);}return _0x45863b['save']();};}function saveUpdates(_0x2b42c8,_0x1aba46){return function(_0xfc7d41){if(_0xfc7d41){return _0xfc7d41['update'](_0x2b42c8)[_0x5bec('0x1c')](function(_0x4cfb89){return _0x4cfb89;});}return null;};}function removeEntity(_0x14cdbf,_0x207192){return function(_0x29df14){if(_0x29df14){return _0x29df14['destroy']()[_0x5bec('0x1c')](function(){var _0x420ad4=_0x29df14['get']({'plain':!![]});var _0x34b441=_0x5bec('0x2f');return db[_0x5bec('0x30')][_0x5bec('0x31')]({'where':{'type':_0x34b441,'resourceId':_0x420ad4['id']}})[_0x5bec('0x1c')](function(){return _0x29df14;});})['then'](function(){_0x14cdbf[_0x5bec('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3793,_0x384f04){return function(_0x182b86){if(!_0x182b86){_0x2d3793[_0x5bec('0x24')](0x194);}return _0x182b86;};}function handleError(_0x2e421e,_0x1923fc){_0x1923fc=_0x1923fc||0x1f4;return function(_0x49c8ef){logger[_0x5bec('0x22')](_0x49c8ef[_0x5bec('0x32')]);if(_0x49c8ef[_0x5bec('0x33')]){delete _0x49c8ef['name'];}_0x2e421e[_0x5bec('0x25')](_0x1923fc)[_0x5bec('0x34')](_0x49c8ef);};}exports['index']=function(_0xdb0430,_0x58c34e){var _0x400e22={},_0x2c0b08={},_0x402e5d={'count':0x0,'rows':[]};var _0x49cdfa=_[_0x5bec('0x35')](db[_0x5bec('0x36')][_0x5bec('0x37')],function(_0x139859){return{'name':_0x139859[_0x5bec('0x38')],'type':_0x139859[_0x5bec('0x39')][_0x5bec('0x3a')]};});_0x2c0b08['model']=_[_0x5bec('0x35')](_0x49cdfa,_0x5bec('0x33'));_0x2c0b08[_0x5bec('0x3b')]=_[_0x5bec('0x3c')](_0xdb0430['query']);_0x2c0b08[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],_0x2c0b08['query']);_0x400e22['attributes']=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x40')]));_0x400e22['attributes']=_0x400e22['attributes'][_0x5bec('0x41')]?_0x400e22['attributes']:_0x2c0b08[_0x5bec('0x3f')];if(!_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x42')]('nolimit')){_0x400e22[_0x5bec('0x28')]=qs[_0x5bec('0x28')](_0xdb0430['query'][_0x5bec('0x28')]);_0x400e22[_0x5bec('0x27')]=qs[_0x5bec('0x27')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x27')]);}_0x400e22[_0x5bec('0x43')]=qs[_0x5bec('0x44')](_0xdb0430['query']['sort']);_0x400e22[_0x5bec('0x45')]=qs['filters'](_['pick'](_0xdb0430[_0x5bec('0x3b')],_0x2c0b08['filters']),_0x49cdfa);if(_0xdb0430['query']['filter']){_0x400e22[_0x5bec('0x45')]=_[_0x5bec('0x46')](_0x400e22[_0x5bec('0x45')],{'$or':_[_0x5bec('0x35')](_0x49cdfa,function(_0x48858a){if(_0x48858a[_0x5bec('0x39')]!==_0x5bec('0x47')){var _0xa4d32={};_0xa4d32[_0x48858a[_0x5bec('0x33')]]={'$like':'%'+_0xdb0430['query'][_0x5bec('0x48')]+'%'};return _0xa4d32;}})});}_0x400e22=_[_0x5bec('0x46')]({},_0x400e22,_0xdb0430[_0x5bec('0x49')]);var _0x51a3f9={'where':_0x400e22[_0x5bec('0x45')]};return db['Trunk'][_0x5bec('0x2a')](_0x51a3f9)[_0x5bec('0x1c')](function(_0x133d5c){_0x402e5d[_0x5bec('0x2a')]=_0x133d5c;if(_0xdb0430['query'][_0x5bec('0x4a')]){_0x400e22[_0x5bec('0x4b')]=[{'all':!![]}];}return db[_0x5bec('0x36')][_0x5bec('0x4c')](_0x400e22);})[_0x5bec('0x1c')](function(_0x123758){_0x402e5d[_0x5bec('0x4d')]=_0x123758;return _0x402e5d;})['then'](respondWithFilteredResult(_0x58c34e,_0x400e22))[_0x5bec('0x4e')](handleError(_0x58c34e,null));};exports[_0x5bec('0x4f')]=function(_0x5775ca,_0x273e09){var _0x3e6180={'raw':![],'where':{'id':_0x5775ca[_0x5bec('0x50')]['id']}},_0x34ee24={};_0x34ee24[_0x5bec('0x3f')]=_[_0x5bec('0x3c')](db[_0x5bec('0x36')]['rawAttributes']);_0x34ee24[_0x5bec('0x3b')]=_['keys'](_0x5775ca[_0x5bec('0x3b')]);_0x34ee24[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],_0x34ee24[_0x5bec('0x3b')]);_0x3e6180[_0x5bec('0x51')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0x5775ca[_0x5bec('0x3b')]['fields']));_0x3e6180[_0x5bec('0x51')]=_0x3e6180['attributes']['length']?_0x3e6180[_0x5bec('0x51')]:_0x34ee24['model'];if(_0x5775ca['query'][_0x5bec('0x4a')]){_0x3e6180[_0x5bec('0x4b')]=[{'all':!![]}];}_0x3e6180=_[_0x5bec('0x46')]({},_0x3e6180,_0x5775ca['options']);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0x3e6180)[_0x5bec('0x1c')](handleEntityNotFound(_0x273e09,null))[_0x5bec('0x1c')](respondWithResult(_0x273e09,null))['catch'](handleError(_0x273e09,null));};exports[_0x5bec('0x53')]=function(_0x209da3,_0x9cae50){var _0xc8563a={'where':{'id':_0x209da3[_0x5bec('0x50')]['id']}},_0x2f736c={};_0x2f736c[_0x5bec('0x3f')]=_['keys'](db['Trunk'][_0x5bec('0x37')]);_0xc8563a['attributes']=_[_0x5bec('0x3e')](_0x2f736c[_0x5bec('0x3f')],qs['fields'](_0x209da3[_0x5bec('0x3b')]['fields']));_0xc8563a[_0x5bec('0x51')]=_0xc8563a[_0x5bec('0x51')][_0x5bec('0x41')]?_0xc8563a[_0x5bec('0x51')]:_0x2f736c[_0x5bec('0x3f')];if(_0x209da3[_0x5bec('0x3b')][_0x5bec('0x4a')]){_0xc8563a[_0x5bec('0x4b')]=[{'all':!![]}];}_0xc8563a=_[_0x5bec('0x46')]({},_0xc8563a,_0x209da3[_0x5bec('0x49')]);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0xc8563a)[_0x5bec('0x1c')](handleEntityNotFound(_0x9cae50,null))[_0x5bec('0x1c')](function(_0x51b25d){if(_0x51b25d){var _0x2e33a7=_0x51b25d[_0x5bec('0x54')]({'plain':!![]});_0x2e33a7=qs[_0x5bec('0x55')](_0x2e33a7,['id','createdAt',_0x5bec('0x56')]);_0x209da3[_0x5bec('0x57')]=_[_0x5bec('0x55')](_0x209da3[_0x5bec('0x57')],['id',_0x5bec('0x58'),'updatedAt']);return db[_0x5bec('0x36')][_0x5bec('0x59')](_[_0x5bec('0x46')](_0x2e33a7,_0x209da3[_0x5bec('0x57')]),{'include':_0x209da3['query'][_0x5bec('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b701f){var _0x38deb0=_0x209da3[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0x38deb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38deb0[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x1b3c40=_0x2b701f[_0x5bec('0x54')]({'plain':!![]});var _0xc3e3df=_0x5bec('0x2f');return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0xc3e3df,'userProfileId':_0x38deb0[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0xfa751f){if(_0xfa751f&&_0xfa751f[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x1b3c40[_0x5bec('0x33')],'resourceId':_0x1b3c40['id'],'type':_0xfa751f['name'],'sectionId':_0xfa751f['id']},{})[_0x5bec('0x1c')](function(){return _0x2b701f;});}else{return _0x2b701f;}})[_0x5bec('0x4e')](function(_0x4e899c){logger[_0x5bec('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e899c);throw _0x4e899c;});}return _0x2b701f;});}})[_0x5bec('0x1c')](respondWithResult(_0x9cae50,0xc9))[_0x5bec('0x4e')](handleError(_0x9cae50,null));};exports['create']=function(_0x5a2a85,_0xd54be0,_0xcac51d){var _0xb6cf85;return db[_0x5bec('0x36')][_0x5bec('0x59')](_0x5a2a85['body'],{'raw':!![]})[_0x5bec('0x1c')](function(_0x39cb06){_0xb6cf85=_0x39cb06;return db['Trunk'][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x44a945){var _0x34f31c=fs['readFileSync'](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),_0x5bec('0x61'));var _0x3ede1d=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x1ee139=ejs[_0x5bec('0x65')](_0x34f31c,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ee139);if(_0xb6cf85['registry']){var _0x3c305e=ejs[_0x5bec('0x65')](_0x3ede1d,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0x3c305e);}})[_0x5bec('0x1c')](function(){return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x59'),{'module':'chan_sip.so'});})['then'](function(){var _0xc81e8f=_0x5a2a85[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0xc81e8f)throw new Error(_0x5bec('0x69'));if(_0xc81e8f[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x17cd00=_0xb6cf85[_0x5bec('0x54')]({'plain':!![]});return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0x5bec('0x2f'),'userProfileId':_0xc81e8f[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0x325044){if(_0x325044&&_0x325044[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x17cd00[_0x5bec('0x33')],'resourceId':_0x17cd00['id'],'type':_0x325044[_0x5bec('0x33')],'sectionId':_0x325044['id']},{})[_0x5bec('0x1c')](function(){return _0xb6cf85;});}else{return _0xb6cf85;}})['catch'](function(_0x2e76c0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e76c0);throw _0x2e76c0;});}return _0xb6cf85;})[_0x5bec('0x1c')](respondWithResult(_0xd54be0,0xc9))['catch'](handleError(_0xd54be0,null));};exports[_0x5bec('0x6a')]=function(_0x5d6af3,_0x5ca280,_0x2e849b){var _0x1b5ec0;return db['Trunk'][_0x5bec('0x52')]({'where':{'id':_0x5d6af3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x5ca280,null))[_0x5bec('0x1c')](saveUpdates(_0x5d6af3[_0x5bec('0x57')],null))[_0x5bec('0x1c')](function(_0xb76af2){if(_0xb76af2){_0x1b5ec0=_0xb76af2;return db[_0x5bec('0x36')]['findAll']({'raw':!![]});}})['then'](function(_0x2e8cd3){if(_0x2e8cd3){var _0x122c7f=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),'utf8');var _0x44ceec=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x38be2d=ejs[_0x5bec('0x65')](_0x122c7f,{'trunks':_0x2e8cd3||[]});fs['writeFileSync'](_0x5bec('0x6b'),_0x38be2d);var _0xe5f9e5=ejs[_0x5bec('0x65')](_0x44ceec,{'trunks':_0x2e8cd3||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0xe5f9e5);return respondWithRpcPromise('Reload',_0x5bec('0x6a'),{'module':_0x5bec('0x6c')});}return null;})['then'](function(_0x195c12){if(_0x195c12){return _0x1b5ec0;}})['then'](respondWithResult(_0x5ca280,null))[_0x5bec('0x4e')](handleError(_0x5ca280,null));};exports[_0x5bec('0x31')]=function(_0x4646a3,_0x313e1c,_0x437c3e){var _0x3d7600;return db[_0x5bec('0x36')][_0x5bec('0x52')]({'where':{'id':_0x4646a3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x313e1c,null))[_0x5bec('0x1c')](removeEntity(_0x313e1c,null))[_0x5bec('0x1c')](function(){return db[_0x5bec('0x36')][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x1eaf2f){var _0x317e2a=fs[_0x5bec('0x62')](path['join'](config[_0x5bec('0x63')],'server/files/templates/trunk.ejs'),_0x5bec('0x61'));var _0xfcef92=fs['readFileSync'](path['join'](config[_0x5bec('0x63')],'server/files/templates/registry.ejs'),_0x5bec('0x61'));var _0x4b70df=ejs[_0x5bec('0x65')](_0x317e2a,{'trunks':_0x1eaf2f});var _0x27b40b=ejs['render'](_0xfcef92,{'trunks':_0x1eaf2f});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4b70df);fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0x27b40b);return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x31'),{'module':'chan_sip.so'});})[_0x5bec('0x4e')](handleError(_0x313e1c,null));}; \ No newline at end of file +var _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x35efb8,_0x1299ee){var _0x283e2d=function(_0x1cd674){while(--_0x1cd674){_0x35efb8['push'](_0x35efb8['shift']());}};_0x283e2d(++_0x1299ee);}(_0x98a8,0x12c));var _0x898a=function(_0x7c3bb,_0x8d5c18){_0x7c3bb=_0x7c3bb-0x0;var _0x4749e7=_0x98a8[_0x7c3bb];return _0x4749e7;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 3437c80..19f2f45 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 _0x6f50=['../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','rimraf'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0x6f50,0x1da));var _0x06f5=function(_0x5cb157,_0x26a384){_0x5cb157=_0x5cb157-0x0;var _0x233e33=_0x6f50[_0x5cb157];return _0x233e33;};'use strict';var _=require(_0x06f5('0x0'));var util=require(_0x06f5('0x1'));var logger=require(_0x06f5('0x2'))(_0x06f5('0x3'));var moment=require(_0x06f5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x06f5('0x5'));var config=require(_0x06f5('0x6'));var attributes=require(_0x06f5('0x7'));module[_0x06f5('0x8')]=function(_0x42233a,_0x4f1fc9){return _0x42233a[_0x06f5('0x9')](_0x06f5('0xa'),attributes,{'tableName':_0x06f5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6abc=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Trunk','lodash'];(function(_0x9adf1b,_0x3ac695){var _0x960269=function(_0x368ca6){while(--_0x368ca6){_0x9adf1b['push'](_0x9adf1b['shift']());}};_0x960269(++_0x3ac695);}(_0x6abc,0x1bb));var _0xc6ab=function(_0x1f2d97,_0x81abcf){_0x1f2d97=_0x1f2d97-0x0;var _0x2569a6=_0x6abc[_0x1f2d97];return _0x2569a6;};'use strict';var _=require(_0xc6ab('0x0'));var util=require(_0xc6ab('0x1'));var logger=require(_0xc6ab('0x2'))(_0xc6ab('0x3'));var moment=require(_0xc6ab('0x4'));var BPromise=require(_0xc6ab('0x5'));var rp=require(_0xc6ab('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc6ab('0x7'));var config=require(_0xc6ab('0x8'));var attributes=require('./trunk.attributes');module[_0xc6ab('0x9')]=function(_0x305a0c,_0x11e44e){return _0x305a0c[_0xc6ab('0xa')](_0xc6ab('0xb'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index c743161..64fc4b0 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 _0xd81f=['rpc','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','message','find','ShowTrunk','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x47f40f,_0x231896){var _0x495a19=function(_0x441064){while(--_0x441064){_0x47f40f['push'](_0x47f40f['shift']());}};_0x495a19(++_0x231896);}(_0xd81f,0x157));var _0xfd81=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0xd81f[_0x29db36];return _0x234e87;};'use strict';var _=require(_0xfd81('0x0'));var util=require(_0xfd81('0x1'));var moment=require(_0xfd81('0x2'));var BPromise=require('bluebird');var rs=require(_0xfd81('0x3'));var fs=require('fs');var Redis=require(_0xfd81('0x4'));var db=require(_0xfd81('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd81('0x6'))(_0xfd81('0x7'));var config=require(_0xfd81('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfd81('0x9')][_0xfd81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbbc8d,_0x40f572,_0x1c2e24){return new BPromise(function(_0x266916,_0x15fe51){return client[_0xfd81('0xb')](_0xbbc8d,_0x1c2e24)[_0xfd81('0xc')](function(_0x554d19){logger[_0xfd81('0xd')](_0xfd81('0xe'),_0x40f572,_0xfd81('0xf'));logger[_0xfd81('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x40f572,'request\x20sent',JSON[_0xfd81('0x11')](_0x554d19));if(_0x554d19[_0xfd81('0x12')]){if(_0x554d19[_0xfd81('0x12')][_0xfd81('0x13')]===0x1f4){logger['error'](_0xfd81('0xe'),_0x40f572,_0x554d19[_0xfd81('0x12')]['message']);return _0x15fe51(_0x554d19[_0xfd81('0x12')]['message']);}logger[_0xfd81('0x12')](_0xfd81('0xe'),_0x40f572,_0x554d19['error']['message']);return _0x266916(_0x554d19[_0xfd81('0x12')]['message']);}else{logger['info'](_0xfd81('0xe'),_0x40f572,_0xfd81('0xf'));_0x266916(_0x554d19['result']['message']);}})[_0xfd81('0x14')](function(_0x4bf9d6){logger[_0xfd81('0x12')](_0xfd81('0xe'),_0x40f572,_0x4bf9d6);_0x15fe51(_0x4bf9d6);});});}exports[_0xfd81('0x15')]=function(_0x2be9a9){var _0xb56eb1=this;return new Promise(function(_0x4baaaa,_0x1306cb){return db[_0xfd81('0x16')][_0xfd81('0x17')]({'raw':_0x2be9a9[_0xfd81('0x18')]?_0x2be9a9[_0xfd81('0x18')][_0xfd81('0x19')]===undefined?!![]:![]:!![],'where':_0x2be9a9[_0xfd81('0x18')]?_0x2be9a9[_0xfd81('0x18')][_0xfd81('0x1a')]||null:null,'attributes':_0x2be9a9[_0xfd81('0x18')]?_0x2be9a9[_0xfd81('0x18')][_0xfd81('0x1b')]||null:null,'limit':_0x2be9a9[_0xfd81('0x18')]?_0x2be9a9[_0xfd81('0x18')][_0xfd81('0x1c')]||null:null,'include':_0x2be9a9[_0xfd81('0x18')]?_0x2be9a9[_0xfd81('0x18')][_0xfd81('0x1d')]?_[_0xfd81('0x1e')](_0x2be9a9[_0xfd81('0x18')]['include'],function(_0x4585ff){return{'model':db[_0x4585ff[_0xfd81('0x1f')]],'as':_0x4585ff['as'],'attributes':_0x4585ff[_0xfd81('0x1b')],'include':_0x4585ff[_0xfd81('0x1d')]?_[_0xfd81('0x1e')](_0x4585ff[_0xfd81('0x1d')],function(_0x238fd6){return{'model':db[_0x238fd6[_0xfd81('0x1f')]],'as':_0x238fd6['as'],'attributes':_0x238fd6[_0xfd81('0x1b')],'include':_0x238fd6['include']?_[_0xfd81('0x1e')](_0x238fd6[_0xfd81('0x1d')],function(_0x236e49){return{'model':db[_0x236e49[_0xfd81('0x1f')]],'as':_0x236e49['as'],'attributes':_0x236e49[_0xfd81('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfd81('0xc')](function(_0x4a998c){logger['info'](_0xfd81('0x15'),_0x2be9a9);logger['debug'](_0xfd81('0x15'),_0x2be9a9,JSON['stringify'](_0x4a998c));_0x4baaaa(_0x4a998c);})['catch'](function(_0x588d21){logger[_0xfd81('0x12')](_0xfd81('0x15'),_0x588d21[_0xfd81('0x20')],_0x2be9a9);_0x1306cb(_0xb56eb1[_0xfd81('0x12')](0x1f4,_0x588d21[_0xfd81('0x20')]));});});};exports['ShowTrunk']=function(_0x4620bb){var _0x6db7db=this;return new Promise(function(_0xb2d9a,_0x339efc){return db[_0xfd81('0x16')][_0xfd81('0x21')]({'raw':_0x4620bb[_0xfd81('0x18')]?_0x4620bb[_0xfd81('0x18')][_0xfd81('0x19')]===undefined?!![]:![]:!![],'where':_0x4620bb['options']?_0x4620bb[_0xfd81('0x18')]['where']||null:null,'attributes':_0x4620bb[_0xfd81('0x18')]?_0x4620bb[_0xfd81('0x18')][_0xfd81('0x1b')]||null:null,'include':_0x4620bb['options']?_0x4620bb[_0xfd81('0x18')][_0xfd81('0x1d')]?_[_0xfd81('0x1e')](_0x4620bb[_0xfd81('0x18')][_0xfd81('0x1d')],function(_0x12861c){return{'model':db[_0x12861c[_0xfd81('0x1f')]],'as':_0x12861c['as'],'attributes':_0x12861c[_0xfd81('0x1b')],'include':_0x12861c[_0xfd81('0x1d')]?_[_0xfd81('0x1e')](_0x12861c[_0xfd81('0x1d')],function(_0x3da37d){return{'model':db[_0x3da37d[_0xfd81('0x1f')]],'as':_0x3da37d['as'],'attributes':_0x3da37d[_0xfd81('0x1b')],'include':_0x3da37d[_0xfd81('0x1d')]?_[_0xfd81('0x1e')](_0x3da37d[_0xfd81('0x1d')],function(_0x1810ca){return{'model':db[_0x1810ca[_0xfd81('0x1f')]],'as':_0x1810ca['as'],'attributes':_0x1810ca['attributes']};}):[]};}):[]};}):[]:[]})[_0xfd81('0xc')](function(_0x4b2653){logger[_0xfd81('0xd')]('ShowTrunk',_0x4620bb);logger[_0xfd81('0x10')](_0xfd81('0x22'),_0x4620bb,JSON['stringify'](_0x4b2653));_0xb2d9a(_0x4b2653);})['catch'](function(_0x50bf4b){logger[_0xfd81('0x12')](_0xfd81('0x22'),_0x50bf4b['message'],_0x4620bb);_0x339efc(_0x6db7db[_0xfd81('0x12')](0x1f4,_0x50bf4b['message']));});});}; \ No newline at end of file +var _0x4ed0=['result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowTrunk','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x4ed0,0x79));var _0x04ed=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4ed0[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x04ed('0x0'));var util=require('util');var moment=require(_0x04ed('0x1'));var BPromise=require('bluebird');var rs=require(_0x04ed('0x2'));var fs=require('fs');var Redis=require(_0x04ed('0x3'));var db=require(_0x04ed('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x04ed('0x5'))(_0x04ed('0x6'));var config=require('../../config/environment');var jayson=require(_0x04ed('0x7'));var client=jayson[_0x04ed('0x8')][_0x04ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x461e2d,_0xb69c27,_0x31e19e){return new BPromise(function(_0x2c1b25,_0x389eb6){return client[_0x04ed('0xa')](_0x461e2d,_0x31e19e)[_0x04ed('0xb')](function(_0x17560f){logger[_0x04ed('0xc')](_0x04ed('0xd'),_0xb69c27,_0x04ed('0xe'));logger['debug'](_0x04ed('0xf'),_0xb69c27,_0x04ed('0xe'),JSON[_0x04ed('0x10')](_0x17560f));if(_0x17560f[_0x04ed('0x11')]){if(_0x17560f['error']['code']===0x1f4){logger[_0x04ed('0x11')](_0x04ed('0xd'),_0xb69c27,_0x17560f['error'][_0x04ed('0x12')]);return _0x389eb6(_0x17560f[_0x04ed('0x11')][_0x04ed('0x12')]);}logger['error'](_0x04ed('0xd'),_0xb69c27,_0x17560f[_0x04ed('0x11')]['message']);return _0x2c1b25(_0x17560f[_0x04ed('0x11')]['message']);}else{logger[_0x04ed('0xc')](_0x04ed('0xd'),_0xb69c27,_0x04ed('0xe'));_0x2c1b25(_0x17560f[_0x04ed('0x13')][_0x04ed('0x12')]);}})[_0x04ed('0x14')](function(_0x5277f9){logger['error'](_0x04ed('0xd'),_0xb69c27,_0x5277f9);_0x389eb6(_0x5277f9);});});}exports[_0x04ed('0x15')]=function(_0x1b3c94){var _0x588edb=this;return new Promise(function(_0x555195,_0x132017){return db[_0x04ed('0x16')][_0x04ed('0x17')]({'raw':_0x1b3c94[_0x04ed('0x18')]?_0x1b3c94['options'][_0x04ed('0x19')]===undefined?!![]:![]:!![],'where':_0x1b3c94['options']?_0x1b3c94[_0x04ed('0x18')][_0x04ed('0x1a')]||null:null,'attributes':_0x1b3c94[_0x04ed('0x18')]?_0x1b3c94[_0x04ed('0x18')][_0x04ed('0x1b')]||null:null,'limit':_0x1b3c94['options']?_0x1b3c94[_0x04ed('0x18')][_0x04ed('0x1c')]||null:null,'include':_0x1b3c94[_0x04ed('0x18')]?_0x1b3c94[_0x04ed('0x18')][_0x04ed('0x1d')]?_[_0x04ed('0x1e')](_0x1b3c94[_0x04ed('0x18')][_0x04ed('0x1d')],function(_0x3d642f){return{'model':db[_0x3d642f[_0x04ed('0x1f')]],'as':_0x3d642f['as'],'attributes':_0x3d642f[_0x04ed('0x1b')],'include':_0x3d642f[_0x04ed('0x1d')]?_[_0x04ed('0x1e')](_0x3d642f[_0x04ed('0x1d')],function(_0x464a1b){return{'model':db[_0x464a1b[_0x04ed('0x1f')]],'as':_0x464a1b['as'],'attributes':_0x464a1b[_0x04ed('0x1b')],'include':_0x464a1b['include']?_['map'](_0x464a1b['include'],function(_0x34191d){return{'model':db[_0x34191d[_0x04ed('0x1f')]],'as':_0x34191d['as'],'attributes':_0x34191d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x55767c){logger[_0x04ed('0xc')](_0x04ed('0x15'),_0x1b3c94);logger['debug'](_0x04ed('0x15'),_0x1b3c94,JSON[_0x04ed('0x10')](_0x55767c));_0x555195(_0x55767c);})[_0x04ed('0x14')](function(_0x3dc6e5){logger['error'](_0x04ed('0x15'),_0x3dc6e5[_0x04ed('0x12')],_0x1b3c94);_0x132017(_0x588edb['error'](0x1f4,_0x3dc6e5[_0x04ed('0x12')]));});});};exports['ShowTrunk']=function(_0x3d2b69){var _0x2c8f59=this;return new Promise(function(_0x5c6776,_0xd2086){return db[_0x04ed('0x16')][_0x04ed('0x20')]({'raw':_0x3d2b69[_0x04ed('0x18')]?_0x3d2b69['options'][_0x04ed('0x19')]===undefined?!![]:![]:!![],'where':_0x3d2b69[_0x04ed('0x18')]?_0x3d2b69[_0x04ed('0x18')][_0x04ed('0x1a')]||null:null,'attributes':_0x3d2b69[_0x04ed('0x18')]?_0x3d2b69['options'][_0x04ed('0x1b')]||null:null,'include':_0x3d2b69[_0x04ed('0x18')]?_0x3d2b69[_0x04ed('0x18')][_0x04ed('0x1d')]?_[_0x04ed('0x1e')](_0x3d2b69[_0x04ed('0x18')][_0x04ed('0x1d')],function(_0x2dff87){return{'model':db[_0x2dff87[_0x04ed('0x1f')]],'as':_0x2dff87['as'],'attributes':_0x2dff87['attributes'],'include':_0x2dff87['include']?_[_0x04ed('0x1e')](_0x2dff87[_0x04ed('0x1d')],function(_0x270927){return{'model':db[_0x270927[_0x04ed('0x1f')]],'as':_0x270927['as'],'attributes':_0x270927['attributes'],'include':_0x270927[_0x04ed('0x1d')]?_[_0x04ed('0x1e')](_0x270927[_0x04ed('0x1d')],function(_0x4258c8){return{'model':db[_0x4258c8['model']],'as':_0x4258c8['as'],'attributes':_0x4258c8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x516007){logger[_0x04ed('0xc')](_0x04ed('0x21'),_0x3d2b69);logger[_0x04ed('0x22')](_0x04ed('0x21'),_0x3d2b69,JSON['stringify'](_0x516007));_0x5c6776(_0x516007);})[_0x04ed('0x14')](function(_0x4f4375){logger[_0x04ed('0x11')](_0x04ed('0x21'),_0x4f4375[_0x04ed('0x12')],_0x3d2b69);_0xd2086(_0x2c8f59[_0x04ed('0x11')](0x1f4,_0x4f4375[_0x04ed('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index dc1f063..a30d79a 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 _0x4d20=['/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','server/files/images/','format','%s-%s','now','originalname','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','/:id/api_key','createApiKey','put','update','/:id/password','changePassword','removeQueues','removeTeams','destroy','delete','/:id/mail_interactions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','/describe','describe','get'];(function(_0x3d27ba,_0x2671a3){var _0xf01885=function(_0x311f5c){while(--_0x311f5c){_0x3d27ba['push'](_0x3d27ba['shift']());}};_0xf01885(++_0x2671a3);}(_0x4d20,0x6a));var _0x04d2=function(_0x42f413,_0x34a5c6){_0x42f413=_0x42f413-0x0;var _0x554f60=_0x4d20[_0x42f413];return _0x554f60;};'use strict';var multer=require(_0x04d2('0x0'));var util=require(_0x04d2('0x1'));var path=require(_0x04d2('0x2'));var timeout=require(_0x04d2('0x3'));var express=require(_0x04d2('0x4'));var router=express[_0x04d2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x04d2('0x6'));var interaction=require(_0x04d2('0x7'));var config=require(_0x04d2('0x8'));var controller=require(_0x04d2('0x9'));router['get']('/',auth[_0x04d2('0xa')](),controller[_0x04d2('0xb')]);router['get'](_0x04d2('0xc'),auth[_0x04d2('0xa')](),controller[_0x04d2('0xd')]);router['get']('/whoami',auth['isAuthenticated'](),controller['whoami']);router[_0x04d2('0xe')](_0x04d2('0xf'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x10')]);router[_0x04d2('0xe')](_0x04d2('0x11'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x12')]);router['get'](_0x04d2('0x13'),controller[_0x04d2('0x14')]);router[_0x04d2('0xe')](_0x04d2('0x15'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x16')]);router[_0x04d2('0xe')](_0x04d2('0x17'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x18')]);router[_0x04d2('0xe')](_0x04d2('0x19'),auth[_0x04d2('0xa')](),controller['getQueues']);router[_0x04d2('0xe')](_0x04d2('0x1a'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x1b')]);router[_0x04d2('0xe')](_0x04d2('0x1c'),auth[_0x04d2('0xa')](),controller['getGroups']);router[_0x04d2('0xe')](_0x04d2('0x1d'),auth[_0x04d2('0xa')](),controller['getRecordings']);router[_0x04d2('0xe')]('/:id/screen_recordings',auth[_0x04d2('0xa')](),controller[_0x04d2('0x1e')]);router[_0x04d2('0xe')](_0x04d2('0x1f'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x20')]);router[_0x04d2('0xe')](_0x04d2('0x21'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x22')]);router[_0x04d2('0xe')](_0x04d2('0x23'),auth['isAuthenticated'](),controller[_0x04d2('0x24')]);router[_0x04d2('0xe')]('/:id/sms/interactions',auth[_0x04d2('0xa')](),controller[_0x04d2('0x25')]);router[_0x04d2('0xe')](_0x04d2('0x26'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x27')]);router['get'](_0x04d2('0x28'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x29')]);router['get'](_0x04d2('0x2a'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x2b')]);router[_0x04d2('0xe')](_0x04d2('0x2c'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x2d')]);router[_0x04d2('0xe')](_0x04d2('0x2e'),auth[_0x04d2('0xa')](),controller['getAgents']);router[_0x04d2('0xe')]('/:id/prefixes',auth[_0x04d2('0xa')](),controller[_0x04d2('0x2f')]);router['get'](_0x04d2('0x30'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x31')]);router[_0x04d2('0xe')](_0x04d2('0x32'),auth['isAuthenticated'](),controller['getMailAccounts']);router[_0x04d2('0xe')](_0x04d2('0x33'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0x04d2('0xe')](_0x04d2('0x34'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x35')]);router[_0x04d2('0xe')](_0x04d2('0x36'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x37')]);router[_0x04d2('0xe')](_0x04d2('0x38'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x39')]);router[_0x04d2('0xe')](_0x04d2('0x3a'),auth[_0x04d2('0xa')](),controller['getSquareProjects']);router[_0x04d2('0xe')](_0x04d2('0x3b'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x3c')]);router[_0x04d2('0xe')]('/:id/api_key',auth[_0x04d2('0xa')](),controller['getApiKey']);router[_0x04d2('0x3d')](_0x04d2('0x17'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x3e')]);router['post']('/',auth[_0x04d2('0xa')](),controller[_0x04d2('0x3f')]);router[_0x04d2('0x3d')](_0x04d2('0x40'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x41')]);router[_0x04d2('0x3d')]('/:id/queues',auth[_0x04d2('0xa')](),controller[_0x04d2('0x42')]);var upload=multer({'storage':multer[_0x04d2('0x43')]({'destination':function(_0x2fc026,_0x440781,_0x585414){_0x585414(null,path[_0x04d2('0x44')](config['root'],_0x04d2('0x45')));},'filename':function(_0x2ce5b9,_0x5512ee,_0x41f78c){_0x41f78c(null,util[_0x04d2('0x46')](_0x04d2('0x47'),Date[_0x04d2('0x48')](),_0x5512ee[_0x04d2('0x49')]));}})});router[_0x04d2('0x3d')](_0x04d2('0x13'),upload['single']('file'),controller[_0x04d2('0x4a')]);router['post'](_0x04d2('0x4b'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x4c')]);router[_0x04d2('0x3d')](_0x04d2('0x4d'),auth[_0x04d2('0xa')](),controller['logout']);router['post'](_0x04d2('0x4e'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x4f')]);router[_0x04d2('0x3d')](_0x04d2('0x50'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x51')]);router[_0x04d2('0x3d')]('/:id/teams',auth['isAuthenticated'](),controller[_0x04d2('0x52')]);router[_0x04d2('0x3d')](_0x04d2('0x53'),auth['isAuthenticated'](),controller[_0x04d2('0x54')]);router['post']('/:id/mail_interactions',auth[_0x04d2('0xa')](),controller[_0x04d2('0x55')]);router[_0x04d2('0x3d')]('/:id/fax_interactions',auth[_0x04d2('0xa')](),controller[_0x04d2('0x56')]);router[_0x04d2('0x3d')](_0x04d2('0x57'),auth[_0x04d2('0xa')](),controller['addSmsInteractions']);router['post'](_0x04d2('0x58'),auth['isAuthenticated'](),controller[_0x04d2('0x59')]);router[_0x04d2('0x3d')]('/:id/whatsapp_interactions',auth[_0x04d2('0xa')](),controller[_0x04d2('0x5a')]);router[_0x04d2('0x3d')](_0x04d2('0x30'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x5b')]);router[_0x04d2('0x3d')]('/:id/mail_accounts',auth['isAuthenticated'](),controller['addMailAccounts']);router['post'](_0x04d2('0x33'),auth['isAuthenticated'](),controller[_0x04d2('0x5c')]);router['post'](_0x04d2('0x34'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x5d')]);router[_0x04d2('0x3d')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x04d2('0x5e')]);router[_0x04d2('0x3d')](_0x04d2('0x38'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x5f')]);router[_0x04d2('0x3d')](_0x04d2('0x3a'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x60')]);router[_0x04d2('0x3d')](_0x04d2('0x61'),auth['isAuthenticated'](),controller[_0x04d2('0x62')]);router[_0x04d2('0x63')]('/:id',auth[_0x04d2('0xa')](),controller[_0x04d2('0x64')]);router['put'](_0x04d2('0x65'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x66')]);router['delete']('/:id/queues',auth[_0x04d2('0xa')](),controller[_0x04d2('0x67')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x04d2('0x68')]);router['delete'](_0x04d2('0x11'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x69')]);router[_0x04d2('0x6a')](_0x04d2('0x53'),auth[_0x04d2('0xa')](),controller['removeChatInteractions']);router[_0x04d2('0x6a')](_0x04d2('0x6b'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x6c')]);router[_0x04d2('0x6a')](_0x04d2('0x6d'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x6e')]);router[_0x04d2('0x6a')](_0x04d2('0x57'),auth[_0x04d2('0xa')](),controller['removeSmsInteractions']);router[_0x04d2('0x6a')](_0x04d2('0x58'),auth['isAuthenticated'](),controller[_0x04d2('0x6f')]);router[_0x04d2('0x6a')](_0x04d2('0x70'),auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router[_0x04d2('0x6a')](_0x04d2('0x30'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x71')]);router[_0x04d2('0x6a')](_0x04d2('0x32'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x72')]);router[_0x04d2('0x6a')](_0x04d2('0x33'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x73')]);router['delete'](_0x04d2('0x34'),auth['isAuthenticated'](),controller[_0x04d2('0x74')]);router['delete'](_0x04d2('0x36'),auth['isAuthenticated'](),controller[_0x04d2('0x75')]);router['delete'](_0x04d2('0x38'),auth[_0x04d2('0xa')](),controller['removeWhatsappAccounts']);router[_0x04d2('0x6a')](_0x04d2('0x3a'),auth['isAuthenticated'](),controller[_0x04d2('0x76')]);router[_0x04d2('0x6a')](_0x04d2('0x61'),auth[_0x04d2('0xa')](),controller[_0x04d2('0x77')]);module[_0x04d2('0x78')]=router; \ No newline at end of file +var _0x0140=['Router','fs-extra','./user.controller','isAuthenticated','index','get','/describe','describe','/whoami','whoami','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','addContacts','post','create','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','/:id/login','logout','/:id/pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','/:id/square_projects','removeSquareProjects','removeApiKey','multer','util','connect-timeout'];(function(_0x40e553,_0x251be6){var _0x418796=function(_0x42c4ae){while(--_0x42c4ae){_0x40e553['push'](_0x40e553['shift']());}};_0x418796(++_0x251be6);}(_0x0140,0x75));var _0x0014=function(_0x487496,_0x249683){_0x487496=_0x487496-0x0;var _0x539dc8=_0x0140[_0x487496];return _0x539dc8;};'use strict';var multer=require(_0x0014('0x0'));var util=require(_0x0014('0x1'));var path=require('path');var timeout=require(_0x0014('0x2'));var express=require('express');var router=express[_0x0014('0x3')]();var fs_extra=require(_0x0014('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0014('0x5'));router['get']('/',auth[_0x0014('0x6')](),controller[_0x0014('0x7')]);router[_0x0014('0x8')](_0x0014('0x9'),auth['isAuthenticated'](),controller[_0x0014('0xa')]);router[_0x0014('0x8')](_0x0014('0xb'),auth[_0x0014('0x6')](),controller[_0x0014('0xc')]);router[_0x0014('0x8')]('/presence',auth[_0x0014('0x6')](),controller[_0x0014('0xd')]);router[_0x0014('0x8')](_0x0014('0xe'),auth[_0x0014('0x6')](),controller[_0x0014('0xf')]);router['get'](_0x0014('0x10'),controller[_0x0014('0x11')]);router['get'](_0x0014('0x12'),auth[_0x0014('0x6')](),controller[_0x0014('0x13')]);router[_0x0014('0x8')](_0x0014('0x14'),auth[_0x0014('0x6')](),controller[_0x0014('0x15')]);router[_0x0014('0x8')](_0x0014('0x16'),auth[_0x0014('0x6')](),controller[_0x0014('0x17')]);router[_0x0014('0x8')](_0x0014('0x18'),auth[_0x0014('0x6')](),controller['getVoiceQueuesRt']);router['get'](_0x0014('0x19'),auth[_0x0014('0x6')](),controller[_0x0014('0x1a')]);router[_0x0014('0x8')](_0x0014('0x1b'),auth[_0x0014('0x6')](),controller[_0x0014('0x1c')]);router[_0x0014('0x8')](_0x0014('0x1d'),auth[_0x0014('0x6')](),controller['getScreenRecordings']);router[_0x0014('0x8')](_0x0014('0x1e'),auth[_0x0014('0x6')](),controller[_0x0014('0x1f')]);router['get'](_0x0014('0x20'),auth['isAuthenticated'](),controller[_0x0014('0x21')]);router[_0x0014('0x8')](_0x0014('0x22'),auth[_0x0014('0x6')](),controller[_0x0014('0x23')]);router[_0x0014('0x8')](_0x0014('0x24'),auth[_0x0014('0x6')](),controller[_0x0014('0x25')]);router['get'](_0x0014('0x26'),auth[_0x0014('0x6')](),controller[_0x0014('0x27')]);router['get'](_0x0014('0x28'),auth[_0x0014('0x6')](),controller['getWhatsappInteractions']);router[_0x0014('0x8')](_0x0014('0x29'),auth['isAuthenticated'](),controller[_0x0014('0x2a')]);router[_0x0014('0x8')]('/:id/lists',auth[_0x0014('0x6')](),controller['getLists']);router[_0x0014('0x8')]('/:id/agents',auth[_0x0014('0x6')](),controller[_0x0014('0x2b')]);router[_0x0014('0x8')](_0x0014('0x2c'),auth[_0x0014('0x6')](),controller[_0x0014('0x2d')]);router[_0x0014('0x8')]('/:id/fax_accounts',auth[_0x0014('0x6')](),controller[_0x0014('0x2e')]);router[_0x0014('0x8')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x0014('0x2f')]);router[_0x0014('0x8')](_0x0014('0x30'),auth[_0x0014('0x6')](),controller[_0x0014('0x31')]);router[_0x0014('0x8')](_0x0014('0x32'),auth[_0x0014('0x6')](),controller['getSmsAccounts']);router[_0x0014('0x8')](_0x0014('0x33'),auth[_0x0014('0x6')](),controller[_0x0014('0x34')]);router['get'](_0x0014('0x35'),auth[_0x0014('0x6')](),controller[_0x0014('0x36')]);router['get']('/:id/square_projects',auth['isAuthenticated'](),controller[_0x0014('0x37')]);router[_0x0014('0x8')]('/:id/scheduled_calls',auth[_0x0014('0x6')](),controller[_0x0014('0x38')]);router[_0x0014('0x8')](_0x0014('0x39'),auth[_0x0014('0x6')](),controller[_0x0014('0x3a')]);router['post'](_0x0014('0x14'),auth[_0x0014('0x6')](),controller[_0x0014('0x3b')]);router[_0x0014('0x3c')]('/',auth[_0x0014('0x6')](),controller[_0x0014('0x3d')]);router[_0x0014('0x3c')]('/create_many',auth['isAuthenticated'](),controller[_0x0014('0x3e')]);router[_0x0014('0x3c')](_0x0014('0x16'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer[_0x0014('0x3f')]({'destination':function(_0x1e9b65,_0x114ae6,_0x211735){_0x211735(null,path[_0x0014('0x40')](config[_0x0014('0x41')],_0x0014('0x42')));},'filename':function(_0x2b0b21,_0x2f61f0,_0x30ba4c){_0x30ba4c(null,util[_0x0014('0x43')](_0x0014('0x44'),Date[_0x0014('0x45')](),_0x2f61f0[_0x0014('0x46')]));}})});router[_0x0014('0x3c')](_0x0014('0x10'),upload[_0x0014('0x47')](_0x0014('0x48')),controller['addAvatar']);router[_0x0014('0x3c')](_0x0014('0x49'),auth['isAuthenticated'](),controller['login']);router[_0x0014('0x3c')]('/:id/logout',auth[_0x0014('0x6')](),controller[_0x0014('0x4a')]);router[_0x0014('0x3c')](_0x0014('0x4b'),auth[_0x0014('0x6')](),controller['pause']);router[_0x0014('0x3c')](_0x0014('0x4c'),auth[_0x0014('0x6')](),controller[_0x0014('0x4d')]);router[_0x0014('0x3c')]('/:id/teams',auth[_0x0014('0x6')](),controller[_0x0014('0x4e')]);router[_0x0014('0x3c')](_0x0014('0x4f'),auth[_0x0014('0x6')](),controller[_0x0014('0x50')]);router[_0x0014('0x3c')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x0014('0x51')]);router['post'](_0x0014('0x52'),auth[_0x0014('0x6')](),controller[_0x0014('0x53')]);router[_0x0014('0x3c')](_0x0014('0x54'),auth['isAuthenticated'](),controller[_0x0014('0x55')]);router[_0x0014('0x3c')](_0x0014('0x56'),auth[_0x0014('0x6')](),controller[_0x0014('0x57')]);router[_0x0014('0x3c')](_0x0014('0x58'),auth[_0x0014('0x6')](),controller[_0x0014('0x59')]);router[_0x0014('0x3c')]('/:id/fax_accounts',auth[_0x0014('0x6')](),controller[_0x0014('0x5a')]);router[_0x0014('0x3c')](_0x0014('0x5b'),auth[_0x0014('0x6')](),controller['addMailAccounts']);router[_0x0014('0x3c')](_0x0014('0x30'),auth['isAuthenticated'](),controller[_0x0014('0x5c')]);router[_0x0014('0x3c')](_0x0014('0x32'),auth[_0x0014('0x6')](),controller[_0x0014('0x5d')]);router[_0x0014('0x3c')](_0x0014('0x33'),auth[_0x0014('0x6')](),controller[_0x0014('0x5e')]);router['post']('/:id/whatsapp_accounts',auth[_0x0014('0x6')](),controller[_0x0014('0x5f')]);router[_0x0014('0x3c')]('/:id/square_projects',auth[_0x0014('0x6')](),controller['addSquareProjects']);router['post'](_0x0014('0x39'),auth[_0x0014('0x6')](),controller['createApiKey']);router[_0x0014('0x60')](_0x0014('0xe'),auth['isAuthenticated'](),controller[_0x0014('0x61')]);router[_0x0014('0x60')](_0x0014('0x62'),auth[_0x0014('0x6')](),controller[_0x0014('0x63')]);router[_0x0014('0x64')]('/:id/queues',auth[_0x0014('0x6')](),controller[_0x0014('0x65')]);router[_0x0014('0x64')]('/:id/teams',auth[_0x0014('0x6')](),controller[_0x0014('0x66')]);router[_0x0014('0x64')](_0x0014('0xe'),auth[_0x0014('0x6')](),controller[_0x0014('0x67')]);router[_0x0014('0x64')](_0x0014('0x4f'),auth['isAuthenticated'](),controller[_0x0014('0x68')]);router['delete'](_0x0014('0x69'),auth[_0x0014('0x6')](),controller[_0x0014('0x6a')]);router[_0x0014('0x64')](_0x0014('0x52'),auth[_0x0014('0x6')](),controller[_0x0014('0x6b')]);router['delete'](_0x0014('0x54'),auth[_0x0014('0x6')](),controller[_0x0014('0x6c')]);router['delete'](_0x0014('0x56'),auth[_0x0014('0x6')](),controller[_0x0014('0x6d')]);router[_0x0014('0x64')](_0x0014('0x58'),auth[_0x0014('0x6')](),controller[_0x0014('0x6e')]);router[_0x0014('0x64')](_0x0014('0x6f'),auth[_0x0014('0x6')](),controller[_0x0014('0x70')]);router['delete'](_0x0014('0x5b'),auth['isAuthenticated'](),controller[_0x0014('0x71')]);router[_0x0014('0x64')](_0x0014('0x30'),auth[_0x0014('0x6')](),controller[_0x0014('0x72')]);router[_0x0014('0x64')](_0x0014('0x32'),auth[_0x0014('0x6')](),controller[_0x0014('0x73')]);router[_0x0014('0x64')](_0x0014('0x33'),auth[_0x0014('0x6')](),controller['removeChatWebsites']);router[_0x0014('0x64')](_0x0014('0x35'),auth['isAuthenticated'](),controller[_0x0014('0x74')]);router['delete'](_0x0014('0x75'),auth[_0x0014('0x6')](),controller[_0x0014('0x76')]);router['delete'](_0x0014('0x39'),auth['isAuthenticated'](),controller[_0x0014('0x77')]);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 2235098..12ba22d 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 _0x869e=['toLowerCase','user','telephone','local','INTEGER','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','auto','rfc2833','yes','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','uas','fingerprint','active','passive','actpass','nonat','update,nonat','showWebBar','get','join','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','wss','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email'];(function(_0x478830,_0x266465){var _0x1f2420=function(_0x236912){while(--_0x236912){_0x478830['push'](_0x478830['shift']());}};_0x1f2420(++_0x266465);}(_0x869e,0x15c));var _0xe869=function(_0x300339,_0x2e2a14){_0x300339=_0x300339-0x0;var _0x28430b=_0x869e[_0x300339];return _0x28430b;};'use strict';var Sequelize=require(_0xe869('0x0'));var moment=require(_0xe869('0x1'));var util=require(_0xe869('0x2'));var _=require('lodash');module[_0xe869('0x3')]={'name':{'type':Sequelize[_0xe869('0x4')],'allowNull':![],'unique':_0xe869('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x34b325){this[_0xe869('0x6')]('name',_0x34b325);this[_0xe869('0x6')](_0xe869('0x7'),_0x34b325);},'comment':_0xe869('0x8')},'fullname':{'type':Sequelize[_0xe869('0x4')],'allowNull':![],'set':function(_0x587ead){this['setDataValue'](_0xe869('0x9'),_0x587ead);this[_0xe869('0x6')](_0xe869('0xa'),util[_0xe869('0xb')](_0xe869('0xc'),_0x587ead,this[_0xe869('0xd')](_0xe869('0xe'))));}},'alias':{'type':Sequelize[_0xe869('0x4')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x16ec63){if(_0x16ec63){this[_0xe869('0x6')](_0xe869('0xf'),_0x16ec63[_0xe869('0x10')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0xe869('0x11'),'agent',_0xe869('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0xe869('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xe869('0x13')},'internal':{'type':Sequelize[_0xe869('0x14')](0xb),'allowNull':![],'unique':_0xe869('0xe'),'set':function(_0x17ee8f){this[_0xe869('0x6')]('internal',_0x17ee8f);this['setDataValue']('accountcode',_0x17ee8f);this[_0xe869('0x6')]('callerid',util[_0xe869('0xb')](_0xe869('0xc'),this[_0xe869('0xd')]('fullname'),_0x17ee8f));}},'salt':{'type':Sequelize[_0xe869('0x4')]},'phone':{'type':Sequelize[_0xe869('0x4')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xe869('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xe869('0x4')]},'city':{'type':Sequelize[_0xe869('0x4')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xe869('0x15')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xe869('0x4')],'defaultValue':_0xe869('0x17')},'lastPauseAt':{'type':Sequelize[_0xe869('0x15')]},'chatCapacity':{'type':Sequelize[_0xe869('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xe869('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xe869('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xe869('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xe869('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xe869('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xe869('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xe869('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![],'defaultValue':_0xe869('0x18')},'ipaddr':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xe869('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xe869('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xe869('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x1a'),_0xe869('0x11'),'peer'),'allowNull':!![],'defaultValue':_0xe869('0x1a')},'context':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize['ENUM'](_0xe869('0x1b'),'ALLOWED_PASSED_SCREEN',_0xe869('0x1c'),'ALLOWED','PROHIB_NOT_SCREENED',_0xe869('0x1d'),_0xe869('0x1e'),_0xe869('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![],'defaultValue':_0xe869('0x20'),'set':function(_0x17a0fa){this[_0xe869('0x6')](_0xe869('0x21'),_0x17a0fa?_0x17a0fa['join'](','):null);},'get':function(){return this[_0xe869('0xd')](_0xe869('0x21'))?this[_0xe869('0xd')]('transport')['split'](','):null;},'comment':_0xe869('0x22')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xe869('0x23'),_0xe869('0x24'),'inband',_0xe869('0x25')),'allowNull':!![],'defaultValue':_0xe869('0x26')},'directmedia':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x27'),'no','nonat',_0xe869('0x28'),_0xe869('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe869('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xe869('0x2a'),'set':function(_0x456a6b){this['setDataValue'](_0xe869('0x2b'),_0x456a6b?_0x456a6b['join'](','):null);},'get':function(){return this[_0xe869('0xd')](_0xe869('0x2b'))?this['getDataValue'](_0xe869('0x2b'))[_0xe869('0x2c')](','):null;},'comment':_0xe869('0x2d')},'callgroup':{'type':Sequelize[_0xe869('0x4')]},'namedcallgroup':{'type':Sequelize[_0xe869('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xe869('0x4')]},'language':{'type':Sequelize[_0xe869('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe869('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe869('0x2e')},'allow':{'type':Sequelize[_0xe869('0x4')],'allowNull':![],'defaultValue':_0xe869('0x2f'),'set':function(_0x3bf052){this[_0xe869('0x6')](_0xe869('0x30'),_0x3bf052?_0x3bf052['join'](';'):_0xe869('0x2f'));},'get':function(){return this[_0xe869('0xd')](_0xe869('0x30'))?this['getDataValue'](_0xe869('0x30'))['split'](';'):null;},'comment':_0xe869('0x31')},'autoframing':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![],'set':function(_0x4f5bfa){this[_0xe869('0x6')](_0xe869('0x32'),_0x4f5bfa?_0x4f5bfa['join'](','):null);},'get':function(){return this[_0xe869('0xd')](_0xe869('0x32'))?this[_0xe869('0xd')](_0xe869('0x32'))[_0xe869('0x2c')](','):null;},'comment':_0xe869('0x33')},'trustrpid':{'type':Sequelize['ENUM'](_0xe869('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xe869('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x27'),'no',_0xe869('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x27'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xe869('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![],'defaultValue':_0xe869('0x35')},'amaflags':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xe869('0x19')]('yes','no'),'allowNull':!![],'defaultValue':_0xe869('0x27')},'busylevel':{'type':Sequelize[_0xe869('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xe869('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xe869('0x27'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x27'),'no',_0xe869('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x37'),_0xe869('0x38'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xe869('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xe869('0x19')]('uac','uas'),'allowNull':!![],'defaultValue':_0xe869('0x39')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x27'),'no'),'allowNull':!![],'defaultValue':_0xe869('0x27')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xe869('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xe869('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xe869('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xe869('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xe869('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xe869('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xe869('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xe869('0x19')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0xe869('0x27'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xe869('0x19')]('yes','no',_0xe869('0x3a'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xe869('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x3b'),_0xe869('0x3c'),_0xe869('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xe869('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xe869('0x19')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xe869('0x19')]('yes','no',_0xe869('0x3e'),_0xe869('0x28'),_0xe869('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xe869('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xe869('0x14')],'defaultValue':0x0,'set':function(_0x39e970){this['setDataValue'](_0xe869('0x40'),_0x39e970);var _0x6631d1=this[_0xe869('0x41')]({'plain':!![]});switch(_0x39e970){case 0x0:case 0x1:var _0x1c0b1c=_0x6631d1[_0xe869('0x21')]?_['isArray'](_0x6631d1[_0xe869('0x21')])?_0x6631d1[_0xe869('0x21')][_0xe869('0x42')]():_0x6631d1[_0xe869('0x21')]:_0xe869('0x20');if(_0x1c0b1c==='wss'){_0x1c0b1c=_0xe869('0x20');}this[_0xe869('0x6')](_0xe869('0x21'),_0x1c0b1c);this[_0xe869('0x6')](_0xe869('0x43'),'no');this[_0xe869('0x6')](_0xe869('0x44'),null);this[_0xe869('0x6')](_0xe869('0x45'),null);this[_0xe869('0x6')](_0xe869('0x46'),null);this['setDataValue'](_0xe869('0x47'),null);this['setDataValue'](_0xe869('0x48'),null);this['setDataValue'](_0xe869('0x49'),null);this['setDataValue'](_0xe869('0x4a'),null);this[_0xe869('0x6')](_0xe869('0x4b'),null);this[_0xe869('0x6')]('rtcp_mux','no');break;case 0x2:this[_0xe869('0x6')]('transport',_0xe869('0x4c'));this[_0xe869('0x6')](_0xe869('0x43'),_0xe869('0x27'));this[_0xe869('0x6')](_0xe869('0x44'),'yes');this[_0xe869('0x6')](_0xe869('0x45'),_0xe869('0x27'));this[_0xe869('0x6')](_0xe869('0x46'),'yes');this[_0xe869('0x6')](_0xe869('0x47'),_0xe869('0x27'));this['setDataValue'](_0xe869('0x48'),'no');this[_0xe869('0x6')]('dtlssetup',_0xe869('0x3d'));this[_0xe869('0x6')](_0xe869('0x4a'),_0x6631d1[_0xe869('0x4a')]||_0xe869('0x4d'));this[_0xe869('0x6')](_0xe869('0x4b'),_0x6631d1[_0xe869('0x4b')]||_0xe869('0x4e'));this[_0xe869('0x6')](_0xe869('0x4f'),_0xe869('0x27'));break;default:}}},'permissions':{'type':Sequelize[_0xe869('0x50')],'set':function(_0x31427a){this['setDataValue'](_0xe869('0x51'),_0x31427a?_0x31427a['join'](','):[]);},'get':function(){return this[_0xe869('0xd')](_0xe869('0x51'))?_[_0xe869('0x52')](this[_0xe869('0xd')](_0xe869('0x51'))['split'](','),function(_0x23c3de){return parseInt(_0x23c3de,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xe869('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xe869('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xe869('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xe869('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xe869('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xe869('0x19')](_0xe869('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xe869('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xe869('0xd')](_0xe869('0x53'))?this[_0xe869('0xd')](_0xe869('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xe869('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xe869('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xe869('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x521c36){if(typeof _0x521c36===_0xe869('0x54')){var _0x24582e=_0x521c36==='1'?!![]:_0x521c36==='0'?![]:_0x521c36===_0xe869('0x55')?!![]:_0x521c36==='false'?![]:![];this['setDataValue'](_0xe869('0x56'),_0x24582e);}else{this[_0xe869('0x6')](_0xe869('0x56'),_0x521c36);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x5592ef){this[_0xe869('0x6')](_0xe869('0x57'),_0x5592ef);if(_0x5592ef===!![]){this[_0xe869('0x6')]('blockedAt',moment());this['setDataValue'](_0xe869('0x58'),0x0);}else{this[_0xe869('0x6')](_0xe869('0x59'),null);}}},'blockedAt':{'type':Sequelize[_0xe869('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xe869('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xe869('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xe869('0x14')](0x5)[_0xe869('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xe869('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xe869('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xe869('0x16')],'defaultValue':!![]}}; \ No newline at end of file +var _0x36bb=['nonat','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','refuse','originate','uas','fingerprint','certificate','active','actpass','update','update,nonat','DATE','showWebBar','get','transport','wss','avpf','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlssetup','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','peer','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','inband','auto','yes'];(function(_0x5ba298,_0x349fe8){var _0x49478b=function(_0x49249d){while(--_0x49249d){_0x5ba298['push'](_0x5ba298['shift']());}};_0x49478b(++_0x349fe8);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb36b('0x0'));var moment=require(_0xb36b('0x1'));var util=require(_0xb36b('0x2'));var _=require('lodash');module[_0xb36b('0x3')]={'name':{'type':Sequelize[_0xb36b('0x4')],'allowNull':![],'unique':_0xb36b('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4003b8){this[_0xb36b('0x6')](_0xb36b('0x5'),_0x4003b8);this[_0xb36b('0x6')](_0xb36b('0x7'),_0x4003b8);},'comment':_0xb36b('0x8')},'fullname':{'type':Sequelize[_0xb36b('0x4')],'allowNull':![],'set':function(_0x181f45){this[_0xb36b('0x6')](_0xb36b('0x9'),_0x181f45);this[_0xb36b('0x6')](_0xb36b('0xa'),util[_0xb36b('0xb')](_0xb36b('0xc'),_0x181f45,this[_0xb36b('0xd')](_0xb36b('0xe'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xb36b('0x4')],'allowNull':![],'unique':_0xb36b('0xf'),'validate':{'isEmail':!![]},'set':function(_0x2bd78b){if(_0x2bd78b){this['setDataValue'](_0xb36b('0xf'),_0x2bd78b[_0xb36b('0x10')]());}}},'role':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x12'),_0xb36b('0x13'),_0xb36b('0x14'),_0xb36b('0x15')),'allowNull':![]},'password':{'type':Sequelize[_0xb36b('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xb36b('0x4')],'defaultValue':_0xb36b('0x16')},'internal':{'type':Sequelize[_0xb36b('0x17')](0xb),'allowNull':![],'unique':'internal','set':function(_0x1aef0b){this['setDataValue']('internal',_0x1aef0b);this[_0xb36b('0x6')](_0xb36b('0x18'),_0x1aef0b);this[_0xb36b('0x6')](_0xb36b('0xa'),util[_0xb36b('0xb')](_0xb36b('0xc'),this['getDataValue'](_0xb36b('0x9')),_0x1aef0b));}},'salt':{'type':Sequelize[_0xb36b('0x4')]},'phone':{'type':Sequelize[_0xb36b('0x4')]},'mobile':{'type':Sequelize[_0xb36b('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xb36b('0x4')]},'userpic':{'type':Sequelize[_0xb36b('0x4')]},'city':{'type':Sequelize[_0xb36b('0x4')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xb36b('0x1a')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xb36b('0x17')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xb36b('0x17')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xb36b('0x17')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xb36b('0x17')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xb36b('0x17')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xb36b('0x17')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xb36b('0x17')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![],'defaultValue':_0xb36b('0x1b')},'ipaddr':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xb36b('0x17')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xb36b('0x17')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xb36b('0x1c'),_0xb36b('0x13'),_0xb36b('0x1d')),'allowNull':!![],'defaultValue':_0xb36b('0x1c')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xb36b('0x11')]('ALLOWED_NOT_SCREENED',_0xb36b('0x1e'),_0xb36b('0x1f'),'ALLOWED',_0xb36b('0x20'),_0xb36b('0x21'),_0xb36b('0x22'),_0xb36b('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![],'defaultValue':_0xb36b('0x24'),'set':function(_0x474165){this['setDataValue']('transport',_0x474165?_0x474165[_0xb36b('0x25')](','):null);},'get':function(){return this[_0xb36b('0xd')]('transport')?this[_0xb36b('0xd')]('transport')['split'](','):null;},'comment':_0xb36b('0x26')},'dtmfmode':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x27'),'info','shortinfo',_0xb36b('0x28'),_0xb36b('0x29')),'allowNull':!![],'defaultValue':_0xb36b('0x27')},'directmedia':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no',_0xb36b('0x2b'),'update',_0xb36b('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![],'defaultValue':_0xb36b('0x2d'),'set':function(_0x2ac11f){this[_0xb36b('0x6')]('nat',_0x2ac11f?_0x2ac11f[_0xb36b('0x25')](','):null);},'get':function(){return this[_0xb36b('0xd')](_0xb36b('0x2e'))?this['getDataValue'](_0xb36b('0x2e'))[_0xb36b('0x2f')](','):null;},'comment':_0xb36b('0x30')},'callgroup':{'type':Sequelize[_0xb36b('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xb36b('0x4')]},'language':{'type':Sequelize[_0xb36b('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xb36b('0x4')]},'disallow':{'type':Sequelize[_0xb36b('0x4')],'allowNull':![],'defaultValue':_0xb36b('0x31')},'allow':{'type':Sequelize[_0xb36b('0x4')],'allowNull':![],'defaultValue':_0xb36b('0x32'),'set':function(_0x5911cc){this['setDataValue']('allow',_0x5911cc?_0x5911cc[_0xb36b('0x25')](';'):_0xb36b('0x32'));},'get':function(){return this[_0xb36b('0xd')]('allow')?this[_0xb36b('0xd')](_0xb36b('0x33'))[_0xb36b('0x2f')](';'):null;},'comment':_0xb36b('0x34')},'autoframing':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![],'set':function(_0x4667a3){this[_0xb36b('0x6')](_0xb36b('0x35'),_0x4667a3?_0x4667a3['join'](','):null);},'get':function(){return this[_0xb36b('0xd')]('insecure')?this['getDataValue'](_0xb36b('0x35'))[_0xb36b('0x2f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0xb36b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xb36b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no',_0xb36b('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xb36b('0x11')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xb36b('0x37')},'amaflags':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xb36b('0x2a')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xb36b('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xb36b('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no',_0xb36b('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xb36b('0x17')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xb36b('0x11')]('accept',_0xb36b('0x39'),_0xb36b('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xb36b('0x17')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xb36b('0x17')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM']('uac','uas'),'allowNull':!![],'defaultValue':_0xb36b('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xb36b('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xb36b('0x2a')},'keepalive':{'type':Sequelize[_0xb36b('0x17')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xb36b('0x17')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xb36b('0x17')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xb36b('0x17')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xb36b('0x17')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xb36b('0x17')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xb36b('0x11')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no',_0xb36b('0x3c'),_0xb36b('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xb36b('0x17')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x3e'),'passive',_0xb36b('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xb36b('0x17')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xb36b('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no','nonat',_0xb36b('0x40'),_0xb36b('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xb36b('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xb36b('0x42')]},'passwordResetAt':{'type':Sequelize[_0xb36b('0x42')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xb36b('0x17')],'defaultValue':0x0,'set':function(_0x4eda64){this['setDataValue'](_0xb36b('0x43'),_0x4eda64);var _0x26a6ee=this[_0xb36b('0x44')]({'plain':!![]});switch(_0x4eda64){case 0x0:case 0x1:var _0x4b6b21=_0x26a6ee[_0xb36b('0x45')]?_['isArray'](_0x26a6ee['transport'])?_0x26a6ee['transport'][_0xb36b('0x25')]():_0x26a6ee[_0xb36b('0x45')]:_0xb36b('0x24');if(_0x4b6b21===_0xb36b('0x46')){_0x4b6b21=_0xb36b('0x24');}this[_0xb36b('0x6')](_0xb36b('0x45'),_0x4b6b21);this[_0xb36b('0x6')]('encryption','no');this['setDataValue'](_0xb36b('0x47'),null);this['setDataValue']('force_avp',null);this[_0xb36b('0x6')]('icesupport',null);this[_0xb36b('0x6')](_0xb36b('0x48'),null);this[_0xb36b('0x6')](_0xb36b('0x49'),null);this[_0xb36b('0x6')]('dtlssetup',null);this[_0xb36b('0x6')](_0xb36b('0x4a'),null);this[_0xb36b('0x6')](_0xb36b('0x4b'),null);this[_0xb36b('0x6')](_0xb36b('0x4c'),'no');break;case 0x2:this['setDataValue'](_0xb36b('0x45'),'wss');this[_0xb36b('0x6')]('encryption',_0xb36b('0x2a'));this[_0xb36b('0x6')](_0xb36b('0x47'),_0xb36b('0x2a'));this[_0xb36b('0x6')]('force_avp',_0xb36b('0x2a'));this[_0xb36b('0x6')]('icesupport',_0xb36b('0x2a'));this['setDataValue'](_0xb36b('0x48'),_0xb36b('0x2a'));this[_0xb36b('0x6')](_0xb36b('0x49'),'no');this[_0xb36b('0x6')](_0xb36b('0x4d'),_0xb36b('0x3f'));this[_0xb36b('0x6')]('dtlscertfile',_0x26a6ee[_0xb36b('0x4a')]||_0xb36b('0x4e'));this['setDataValue']('dtlsprivatekey',_0x26a6ee[_0xb36b('0x4b')]||_0xb36b('0x4f'));this[_0xb36b('0x6')](_0xb36b('0x4c'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0xb36b('0x50')],'set':function(_0x45c81b){this['setDataValue'](_0xb36b('0x51'),_0x45c81b?_0x45c81b[_0xb36b('0x25')](','):[]);},'get':function(){return this[_0xb36b('0xd')](_0xb36b('0x51'))?_[_0xb36b('0x52')](this['getDataValue'](_0xb36b('0x51'))[_0xb36b('0x2f')](','),function(_0x3fa0de){return parseInt(_0x3fa0de,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xb36b('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xb36b('0x17')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xb36b('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xb36b('0x11')](_0xb36b('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xb36b('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb36b('0xd')]('phoneBarEnableScreenRecordingByAgent')?this[_0xb36b('0xd')](_0xb36b('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xb36b('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![],'set':function(_0x1b9801){if(typeof _0x1b9801===_0xb36b('0x54')){var _0x21a08e=_0x1b9801==='1'?!![]:_0x1b9801==='0'?![]:_0x1b9801===_0xb36b('0x55')?!![]:_0x1b9801===_0xb36b('0x56')?![]:![];this[_0xb36b('0x6')]('screenrecording',_0x21a08e);}else{this['setDataValue'](_0xb36b('0x57'),_0x1b9801);}}},'blocked':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![],'set':function(_0x378a54){this[_0xb36b('0x6')](_0xb36b('0x58'),_0x378a54);if(_0x378a54===!![]){this[_0xb36b('0x6')]('blockedAt',moment());this[_0xb36b('0x6')]('loginAttempts',0x0);}else{this[_0xb36b('0x6')](_0xb36b('0x59'),null);}}},'blockedAt':{'type':Sequelize[_0xb36b('0x42')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xb36b('0x17')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xb36b('0x17')](0x5)[_0xb36b('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xb36b('0x19')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 8f7fd07..ad484ad 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 _0x1619=['OpenTabs','util','lodash','squel','jayson/promise','../../components/auth/service','../../config/logger','../../config/environment','../../config/license/util','socket.io-emitter','redis','register','defaults','localhost','client','http','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','end','offset','undefined','limit','count','status','set','json','update','destroy','get','role','Users','user','agent','Telephones','telephone','filter','ignore','map','value','includes','find','name','UserProfileResource','stack','send','index','User','type','key','password','getOptions','where','include','attributes','push','findAll','rows','query','openTabs','true','sms','dataValues','mail','openchannel','whatsapp','all','catch','show','params','keys','rawAttributes','salt','filters','intersection','model','fields','includeAll','merge','options','fax','body','describe','ids','omit','internal','Setting','findById','securePassword','max','min_internal','sequelize','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)','QueryTypes','SELECT','length','isNil','from','voicemail','mailbox','VoiceMail','email','permissions','101','103','113','110','105','106','108','109','111','114','115','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','Agents','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','UserProfileSection','isEmpty','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','online','loginInPause','interface','isValidChannel','add','toLowerCase','Queues','spread','capitalize','QueueId','Queue:save','voice','VoiceQueue','format','SIP/%s','voicePause','UserVoiceQueueRt','upsert','channel','Unknown\x20channel','remove','isArray','emit','Queue:remove','addAvatar','userpic','file','filename','join','root','download','existsSync','server/files/images/','getOpenTabs','chat','CHAT','FaxOpenTabs','FAX','createdAt','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','WhatsappOpenTabs','WHATSAPP','CmContact','order','sort','pick','CmList','Tags','color','tag','hasOwnProperty','nolimit','getContacts','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','ChatGroup','getGroups','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','phone','mobile','intrf','user:%s','user:forcelogout','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','PAUSE','concat','LOGININPAUSE','isMiddleware','resolve','logout','forEach','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','smsPause','whatsapppause','lastPauseAt','manual','%s%s','Pause','getTeams','addTeams','Voice','getChatQueues','setDataValue','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','getOpenchannelQueues','Openchannel','flatten','addAgent','getDataValue','penalty','removeTeams','Fax','transaction','removeAgent','getLists','values','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:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','$and','$gt','$gte','$lte','$eq','$between','$notBetween','$in','$like','$notLike','$notILike','$overlap','$contains','$contained','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','API\x20key\x20not\x20available','whoami','getPresence','teams','queues','Team','getAgents','lower','col','toString','asc','desc','uniqBy','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','idle','unknown','ringing','voiceStatus','busy','slice','toUpperCase','select','field','ui.','InteractionId','_interactions'];(function(_0xda9b6,_0x54ea66){var _0x14f93c=function(_0x5d02c6){while(--_0x5d02c6){_0xda9b6['push'](_0xda9b6['shift']());}};_0x14f93c(++_0x54ea66);}(_0x1619,0x189));var _0x9161=function(_0x5c04df,_0x3b4d30){_0x5c04df=_0x5c04df-0x0;var _0x2e34fb=_0x1619[_0x5c04df];return _0x2e34fb;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x9161('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x9161('0x1'));var squel=require(_0x9161('0x2'));var jayson=require(_0x9161('0x3'));var Redis=require('ioredis');var authService=require(_0x9161('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x9161('0x5'))('api');var utils=require('../../config/utils');var config=require(_0x9161('0x6'));var licenseUtil=require(_0x9161('0x7'));var db=require('../../mysqldb')['db'];var socket=require(_0x9161('0x8'))(new Redis(config[_0x9161('0x9')]));require('./user.socket')[_0x9161('0xa')](socket);config['redis']=_[_0x9161('0xb')](config['redis'],{'host':_0x9161('0xc'),'port':0x18eb});var client=jayson[_0x9161('0xd')][_0x9161('0xe')]({'port':0x232a});var values;function respondWithRpcPromise(_0x251ee2,_0x37dcc7,_0x442399,_0x32ef57){return new BPromise(function(_0x51030c,_0x5a9a1c){var _0x52f17c=_0x32ef57||client;return _0x52f17c['request'](_0x251ee2,_0x442399)[_0x9161('0xf')](function(_0x575ce5){logger[_0x9161('0x10')](_0x9161('0x11'),_0x37dcc7,_0x9161('0x12'));logger[_0x9161('0x13')](_0x9161('0x14'),_0x37dcc7,_0x9161('0x12'),JSON[_0x9161('0x15')](_0x575ce5));if(_0x575ce5[_0x9161('0x16')]){if(_0x575ce5['error'][_0x9161('0x17')]===0x1f4){logger[_0x9161('0x16')](_0x9161('0x11'),_0x37dcc7,_0x575ce5['error'][_0x9161('0x18')]);return _0x5a9a1c(_0x575ce5[_0x9161('0x16')][_0x9161('0x18')]);}logger['error'](_0x9161('0x11'),_0x37dcc7,_0x575ce5[_0x9161('0x16')]['message']);return _0x51030c(_0x575ce5[_0x9161('0x16')][_0x9161('0x18')]);}else{logger[_0x9161('0x10')](_0x9161('0x11'),_0x37dcc7,_0x9161('0x12'));_0x51030c(_0x575ce5[_0x9161('0x19')][_0x9161('0x18')]);}})['catch'](function(_0x73d1cc){logger['error'](_0x9161('0x11'),_0x37dcc7,_0x73d1cc);_0x5a9a1c(_0x73d1cc);});});}function respondWithStatusCode(_0x12918e,_0x2db6a0){_0x2db6a0=_0x2db6a0||0xcc;return function(_0x56b77a){if(_0x56b77a){return _0x12918e['sendStatus'](_0x2db6a0);}return _0x12918e['status'](_0x2db6a0)[_0x9161('0x1a')]();};}function respondWithResult(_0x30f97f,_0x5b735a){_0x5b735a=_0x5b735a||0xc8;return function(_0x49f1ea){if(_0x49f1ea){return _0x30f97f['status'](_0x5b735a)['json'](_0x49f1ea);}};}function respondWithFilteredResult(_0x20fa48,_0x41a5f8){return function(_0x214e1b){if(_0x214e1b){var _0x2ffeb4=typeof _0x41a5f8[_0x9161('0x1b')]===_0x9161('0x1c')&&typeof _0x41a5f8[_0x9161('0x1d')]==='undefined';var _0x8c4949=_0x214e1b[_0x9161('0x1e')];var _0x20899d=_0x2ffeb4?0x0:_0x41a5f8[_0x9161('0x1b')];var _0x2b17a3=_0x2ffeb4?_0x214e1b[_0x9161('0x1e')]:_0x41a5f8[_0x9161('0x1b')]+_0x41a5f8[_0x9161('0x1d')];var _0x588ea6;if(_0x2b17a3>=_0x8c4949){_0x2b17a3=_0x8c4949;_0x588ea6=0xc8;}else{_0x588ea6=0xce;}_0x20fa48[_0x9161('0x1f')](_0x588ea6);return _0x20fa48[_0x9161('0x20')]('Content-Range',_0x20899d+'-'+_0x2b17a3+'/'+_0x8c4949)[_0x9161('0x21')](_0x214e1b);}return null;};}function saveUpdates(_0x3124dc){return function(_0x522a04){if(_0x522a04){return _0x522a04[_0x9161('0x22')](_0x3124dc)[_0x9161('0xf')](function(_0x5ce294){return _0x5ce294;});}return null;};}function removeEntity(_0x2b29ff){return function(_0x464786){if(_0x464786){return _0x464786[_0x9161('0x23')]()['then'](function(){var _0x40daaf=_0x464786[_0x9161('0x24')]({'plain':!![]});if(_0x40daaf[_0x9161('0x25')]==='admin')return;var _0x4523dd=[{'name':_0x9161('0x26'),'value':_0x9161('0x27'),'ignore':!![]},{'name':'Agents','value':_0x9161('0x28'),'ignore':![]},{'name':_0x9161('0x29'),'value':_0x9161('0x2a'),'ignore':![]}];var _0x207519=_(_0x4523dd)[_0x9161('0x2b')](_0x9161('0x2c'))[_0x9161('0x2d')](_0x9161('0x2e'))[_0x9161('0x2e')]();if(_[_0x9161('0x2f')](_0x207519,_0x40daaf[_0x9161('0x25')])){return;}var _0x44cb29=_[_0x9161('0x30')](_0x4523dd,[_0x9161('0x2e'),_0x40daaf[_0x9161('0x25')]])[_0x9161('0x31')];return db[_0x9161('0x32')][_0x9161('0x23')]({'where':{'type':_0x44cb29,'resourceId':_0x40daaf['id']}})[_0x9161('0xf')](function(){return _0x464786;});})[_0x9161('0xf')](function(){_0x2b29ff[_0x9161('0x1f')](0xcc)[_0x9161('0x1a')]();});}};}function handleEntityNotFound(_0x5b9b49){return function(_0x55b787){if(!_0x55b787){_0x5b9b49['sendStatus'](0x194);}return _0x55b787;};}function handleError(_0xc7b85d,_0x378849){_0x378849=_0x378849||0x1f4;return function(_0x16706b){logger[_0x9161('0x16')](_0x16706b[_0x9161('0x33')]);if(_0x16706b['name']){delete _0x16706b[_0x9161('0x31')];}_0xc7b85d['status'](_0x378849)[_0x9161('0x34')](_0x16706b);};}exports[_0x9161('0x35')]=function(_0x1f6ec1,_0x56f755){var _0x1e9ce3={},_0xa613fe={'count':0x0,'rows':[]};var _0x566711=_(db[_0x9161('0x36')]['rawAttributes'])['map'](function(_0x5b6cdc){return{'name':_0x5b6cdc['fieldName'],'type':_0x5b6cdc[_0x9161('0x37')][_0x9161('0x38')]};})['filter'](function(_0x4d1092){return!_[_0x9161('0x2f')]([_0x9161('0x39'),'salt'],_0x4d1092[_0x9161('0x31')]);})['value']();_0x1e9ce3=qs[_0x9161('0x3a')](_0x566711,_0x1f6ec1);var _0x27be74={'where':_0x1e9ce3[_0x9161('0x3b')]};return db[_0x9161('0x36')]['count'](_0x27be74)['then'](function(_0x2c8eeb){_0xa613fe[_0x9161('0x1e')]=_0x2c8eeb;if(_0x1f6ec1['query']['includeAll']){_0x1e9ce3[_0x9161('0x3c')]=[{'all':!![]}];}if(!_[_0x9161('0x2f')](_0x1e9ce3[_0x9161('0x3d')],'id')){_0x1e9ce3[_0x9161('0x3d')][_0x9161('0x3e')]('id');}return db[_0x9161('0x36')][_0x9161('0x3f')](_0x1e9ce3);})[_0x9161('0xf')](function(_0x2553bd){_0xa613fe[_0x9161('0x40')]=_0x2553bd;if(_0x1f6ec1[_0x9161('0x41')][_0x9161('0x42')]===_0x9161('0x43')){var _0x2ef987=[];for(var _0x177849=0x0;_0x177849<_0xa613fe[_0x9161('0x40')]['length'];_0x177849++){_0x2ef987[_0x9161('0x3e')](get_open_tabs('chat',_0xa613fe[_0x9161('0x40')][_0x177849]['dataValues']));_0x2ef987[_0x9161('0x3e')](get_open_tabs(_0x9161('0x44'),_0xa613fe[_0x9161('0x40')][_0x177849][_0x9161('0x45')]));_0x2ef987[_0x9161('0x3e')](get_open_tabs('fax',_0xa613fe[_0x9161('0x40')][_0x177849]['dataValues']));_0x2ef987[_0x9161('0x3e')](get_open_tabs(_0x9161('0x46'),_0xa613fe[_0x9161('0x40')][_0x177849][_0x9161('0x45')]));_0x2ef987[_0x9161('0x3e')](get_open_tabs(_0x9161('0x47'),_0xa613fe[_0x9161('0x40')][_0x177849][_0x9161('0x45')]));_0x2ef987[_0x9161('0x3e')](get_open_tabs(_0x9161('0x48'),_0xa613fe[_0x9161('0x40')][_0x177849][_0x9161('0x45')]));}return BPromise[_0x9161('0x49')](_0x2ef987)['then'](function(_0x3dfefc){return _0xa613fe;});}else{return _0xa613fe;}})[_0x9161('0xf')](respondWithFilteredResult(_0x56f755,_0x1e9ce3))[_0x9161('0x4a')](handleError(_0x56f755,null));};exports[_0x9161('0x4b')]=function(_0x1a56f8,_0x2af28e){var _0x43db88={'raw':![],'where':{'id':_0x1a56f8[_0x9161('0x4c')]['id']}},_0x3a9492={};_0x3a9492['model']=_['differenceBy'](_[_0x9161('0x4d')](db[_0x9161('0x36')][_0x9161('0x4e')]),[_0x9161('0x39'),_0x9161('0x4f')]);_0x3a9492[_0x9161('0x41')]=_[_0x9161('0x4d')](_0x1a56f8[_0x9161('0x41')]);_0x3a9492[_0x9161('0x50')]=_[_0x9161('0x51')](_0x3a9492[_0x9161('0x52')],_0x3a9492[_0x9161('0x41')]);_0x43db88[_0x9161('0x3d')]=_[_0x9161('0x51')](_0x3a9492['model'],qs[_0x9161('0x53')](_0x1a56f8[_0x9161('0x41')][_0x9161('0x53')]));_0x43db88[_0x9161('0x3d')]=_0x43db88[_0x9161('0x3d')]['length']?_0x43db88['attributes']:_0x3a9492[_0x9161('0x52')];if(_0x1a56f8[_0x9161('0x41')][_0x9161('0x54')]){_0x43db88[_0x9161('0x3c')]=[{'all':!![]}];}_0x43db88=_[_0x9161('0x55')]({},_0x43db88,_0x1a56f8[_0x9161('0x56')]);if(!_[_0x9161('0x2f')](_0x43db88[_0x9161('0x3d')],'id')){_0x43db88['attributes']['push']('id');}return db[_0x9161('0x36')][_0x9161('0x30')](_0x43db88)[_0x9161('0xf')](handleEntityNotFound(_0x2af28e,null))[_0x9161('0xf')](function(_0x4c62db){var _0x1deb75=[];values=_0x4c62db;if(_0x1a56f8[_0x9161('0x41')][_0x9161('0x42')]===_0x9161('0x43')){_0x1deb75[_0x9161('0x3e')](get_open_tabs('chat',_0x4c62db[_0x9161('0x45')]));_0x1deb75['push'](get_open_tabs('sms',_0x4c62db[_0x9161('0x45')]));_0x1deb75['push'](get_open_tabs(_0x9161('0x47'),_0x4c62db['dataValues']));_0x1deb75['push'](get_open_tabs(_0x9161('0x48'),_0x4c62db[_0x9161('0x45')]));_0x1deb75[_0x9161('0x3e')](get_open_tabs(_0x9161('0x57'),_0x4c62db['dataValues']));_0x1deb75[_0x9161('0x3e')](get_open_tabs('mail',_0x4c62db[_0x9161('0x45')]));return BPromise[_0x9161('0x49')](_0x1deb75);}else{return values;}})[_0x9161('0xf')](function(_0x229c73){return values;})[_0x9161('0xf')](respondWithResult(_0x2af28e,null))[_0x9161('0x4a')](handleError(_0x2af28e,null));};exports['update']=function(_0x39ec3e,_0x3edb6b){if(_0x39ec3e[_0x9161('0x58')]['id']){delete _0x39ec3e[_0x9161('0x58')]['id'];}delete _0x39ec3e[_0x9161('0x58')][_0x9161('0x25')];return db[_0x9161('0x36')]['find']({'where':{'id':_0x39ec3e['params']['id']}})['then'](handleEntityNotFound(_0x3edb6b,null))[_0x9161('0xf')](saveUpdates(_0x39ec3e[_0x9161('0x58')],null))[_0x9161('0xf')](respondWithResult(_0x3edb6b,null))[_0x9161('0x4a')](handleError(_0x3edb6b,null));};exports[_0x9161('0x59')]=function(_0x4398d2,_0x23d5d9){return db[_0x9161('0x36')][_0x9161('0x59')]()[_0x9161('0xf')](respondWithResult(_0x23d5d9,null))['catch'](handleError(_0x23d5d9,null));};exports['addContacts']=function(_0x23d291,_0x42f381){return db[_0x9161('0x36')][_0x9161('0x30')]({'where':{'id':_0x23d291[_0x9161('0x4c')]['id']}})['then'](handleEntityNotFound(_0x42f381,null))[_0x9161('0xf')](function(_0xd060a2){if(_0xd060a2){return _0xd060a2['addContacts'](_0x23d291['body'][_0x9161('0x5a')],_[_0x9161('0x5b')](_0x23d291[_0x9161('0x58')],[_0x9161('0x5a'),'id'])||{});}})[_0x9161('0xf')](respondWithResult(_0x42f381,null))[_0x9161('0x4a')](handleError(_0x42f381,null));};function validateUser(_0x1390e3){return new BPromise(function(_0x24064c,_0x3f564c){if(_0x1390e3[_0x9161('0x5c')])return _0x24064c(_0x1390e3);return db[_0x9161('0x5d')][_0x9161('0x5e')](0x1)[_0x9161('0xf')](function(_0x24c68d){if(_0x24c68d[_0x9161('0x5f')])authService['validatePasswordPattern'](_0x1390e3[_0x9161('0x39')]);db['User'][_0x9161('0x60')](_0x9161('0x5c'))[_0x9161('0xf')](function(_0x2941c1){if(_['isNil'](_0x2941c1)){_0x1390e3[_0x9161('0x5c')]=_0x24c68d[_0x9161('0x61')]||0x1;return;}if(_['isNil'](_0x24c68d[_0x9161('0x61')])||_0x24c68d[_0x9161('0x61')]===_0x2941c1){_0x1390e3[_0x9161('0x5c')]=_0x2941c1+0x1;return;}if(_0x24c68d['min_internal']>_0x2941c1){_0x1390e3[_0x9161('0x5c')]=_0x24c68d['min_internal'];return;}return db[_0x9161('0x62')][_0x9161('0x41')](_0x9161('0x63'),{'type':db[_0x9161('0x62')][_0x9161('0x64')][_0x9161('0x65')]})['then'](function(_0x35c254){if(_0x35c254&&_0x35c254['length']){for(var _0x5d3d39=0x0,_0x461b17=_0x35c254[_0x9161('0x66')];_0x5d3d39<_0x461b17&&_[_0x9161('0x67')](_0x1390e3['internal']);_0x5d3d39++){if(_0x24c68d[_0x9161('0x61')]<=_0x35c254[_0x5d3d39]['from']){_0x1390e3['internal']=_0x35c254[_0x5d3d39]['from'];}else if(_0x24c68d[_0x9161('0x61')]>_0x35c254[_0x5d3d39][_0x9161('0x68')]&&_0x24c68d[_0x9161('0x61')]<=_0x35c254[_0x5d3d39]['to']){_0x1390e3[_0x9161('0x5c')]=_0x24c68d[_0x9161('0x61')];}}}if(_[_0x9161('0x67')](_0x1390e3[_0x9161('0x5c')])){_0x1390e3[_0x9161('0x5c')]=_0x2941c1+0x1;}return _0x24064c(_0x1390e3);});});})[_0x9161('0x4a')](function(_0x5b7bc3){_0x3f564c(_0x5b7bc3);});});}function updateUser(_0x2a9b17){return new BPromise(function(_0x15f139,_0x4d5211){try{if(_0x2a9b17[_0x9161('0x69')]){_0x2a9b17[_0x9161('0x6a')]=_0x2a9b17[_0x9161('0x5c')];_0x2a9b17[_0x9161('0x6b')]={'mailbox':_0x2a9b17[_0x9161('0x5c')],'password':_0x2a9b17[_0x9161('0x39')],'fullname':_0x2a9b17['fullname'],'email':_0x2a9b17[_0x9161('0x6c')]};}if(_0x2a9b17[_0x9161('0x25')]==='agent'){if(!_0x2a9b17[_0x9161('0x6d')])_0x2a9b17[_0x9161('0x6d')]=[_0x9161('0x6e'),'102',_0x9161('0x6f'),_0x9161('0x70'),_0x9161('0x71'),'104',_0x9161('0x72'),_0x9161('0x73'),'107',_0x9161('0x74'),_0x9161('0x75'),'100',_0x9161('0x76'),_0x9161('0x77'),_0x9161('0x78')];}_0x15f139(_0x2a9b17);}catch(_0x5f4a30){_0x4d5211(_0x5f4a30);}});}exports['create']=function(_0x26699d,_0x272f3f){if(_0x26699d[_0x9161('0x27')][_0x9161('0x25')]===_0x9161('0x28'))throw new Error('Unauthorized');if(_0x26699d[_0x9161('0x58')][_0x9161('0x25')]===_0x9161('0x27')&&_0x26699d[_0x9161('0x27')][_0x9161('0x25')]!==_0x9161('0x79')){throw new Error(_0x9161('0x7a'));}if(_0x26699d[_0x9161('0x58')]['role']===_0x9161('0x79')&&_0x26699d[_0x9161('0x27')][_0x9161('0x25')]!==_0x9161('0x79')){throw new Error(_0x9161('0x7b'));}return licenseUtil[_0x9161('0x7c')]([_0x26699d[_0x9161('0x58')]])[_0x9161('0xf')](function(){return validateUser(_0x26699d[_0x9161('0x58')]);})[_0x9161('0xf')](function(_0x375c52){return updateUser(_0x375c52)[_0x9161('0xf')](function(_0x4b4b85){if(_0x4b4b85['role']==='admin'){_0x4b4b85[_0x9161('0x7d')]=_0x26699d[_0x9161('0x27')]['settingsEnabled'];delete _0x4b4b85['userProfileId'];}return _0x4b4b85;});})[_0x9161('0xf')](function(_0x102402){return db[_0x9161('0x36')]['create'](_0x102402,{'include':[{'model':db[_0x9161('0x6b')],'as':_0x9161('0x6b')}]});})['then'](function(_0x15ba6c){if(_0x26699d[_0x9161('0x58')]['role']===_0x9161('0x27'))return _0x15ba6c;if(_0x26699d[_0x9161('0x27')][_0x9161('0x25')]!==_0x9161('0x27'))return _0x15ba6c;return db['UserProfileSection'][_0x9161('0x30')]({'where':{'name':_0x15ba6c[_0x9161('0x25')]===_0x9161('0x28')?_0x9161('0x7e'):'Telephones','userProfileId':_0x26699d['user'][_0x9161('0x7f')]},'raw':!![]})[_0x9161('0xf')](function(_0xedba89){if(!_0xedba89||_0xedba89[_0x9161('0x80')]!=0x0)return _0x15ba6c;return db['UserProfileResource'][_0x9161('0x81')]({'name':_0x15ba6c['name'],'resourceId':_0x15ba6c['id'],'type':_0xedba89['name'],'sectionId':_0xedba89['id']},{})[_0x9161('0xf')](function(){return _0x15ba6c;});})[_0x9161('0x4a')](function(_0x2b3556){logger[_0x9161('0x16')](_0x9161('0x82'),_0x2b3556);throw _0x2b3556;});})[_0x9161('0xf')](respondWithResult(_0x272f3f,0xc9))[_0x9161('0x4a')](handleError(_0x272f3f,null));};exports[_0x9161('0x83')]=function(_0x47ccec,_0x27623a){var _0x4c22f4=_0x47ccec[_0x9161('0x58')];var _0x24aec3=[];if(_0x47ccec[_0x9161('0x27')][_0x9161('0x25')]==='agent')throw new Error('Unauthorized');if(_['some'](_0x4c22f4,[_0x9161('0x25'),'user'])&&_0x47ccec[_0x9161('0x27')][_0x9161('0x25')]!==_0x9161('0x79')){throw new Error(_0x9161('0x7a'));}if(_[_0x9161('0x84')](_0x4c22f4,['role','admin'])&&_0x47ccec[_0x9161('0x27')][_0x9161('0x25')]!=='admin'){throw new Error(_0x9161('0x85'));}return licenseUtil[_0x9161('0x7c')](_0x4c22f4)[_0x9161('0xf')](function(){return validateUser(_0x4c22f4[0x0]);})[_0x9161('0xf')](function(){for(var _0x57aaba=0x1;_0x57aaba<_0x4c22f4[_0x9161('0x66')];_0x57aaba++){var _0x5de16f=_0x4c22f4[_0x57aaba-0x1][_0x9161('0x5c')];if(!_0x4c22f4[_0x57aaba]['internal'])_0x4c22f4[_0x57aaba][_0x9161('0x5c')]=_0x5de16f+0x1;_0x24aec3[_0x9161('0x3e')](validateUser(_0x4c22f4[_0x57aaba]));}return BPromise['all'](_0x24aec3);})[_0x9161('0xf')](function(){_0x24aec3=[];for(var _0x4700a8=0x0;_0x4700a8<_0x4c22f4[_0x9161('0x66')];_0x4700a8++){_0x24aec3['push'](updateUser(_0x4c22f4[_0x4700a8]));}return BPromise['all'](_0x24aec3);})[_0x9161('0xf')](function(){return BPromise[_0x9161('0x86')](_0x4c22f4,function(_0x2dbe3f){return db[_0x9161('0x36')][_0x9161('0x81')](_0x2dbe3f,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})[_0x9161('0xf')](function(_0x178e33){_0x2dbe3f['id']=_0x178e33['id'];return _0x2dbe3f;});});})['then'](function(_0x1b00e3){if(_0x47ccec[_0x9161('0x58')][_0x9161('0x25')]===_0x9161('0x27'))return _0x1b00e3;if(_0x47ccec[_0x9161('0x27')]['role']!=='user')return _0x1b00e3;var _0x80b5b8=_['some'](_0x1b00e3,function(_0x17b2d1){return _0x17b2d1['role']===_0x9161('0x28')||_0x17b2d1[_0x9161('0x25')]===_0x9161('0x2a');});if(!_0x80b5b8)return _0x1b00e3;return db[_0x9161('0x87')][_0x9161('0x3f')]({'where':{'name':{'$or':['Agents',_0x9161('0x29')]},'userProfileId':_0x47ccec[_0x9161('0x27')][_0x9161('0x7f')]},'raw':!![]})[_0x9161('0xf')](function(_0x1619ac){if(_[_0x9161('0x88')](_0x1619ac)||!_[_0x9161('0x84')](_0x1619ac,['autoAssociation',0x0]))return _0x1b00e3;_0x24aec3=[];var _0x2ccb78=_(_0x1619ac)[_0x9161('0x2d')](function(_0x4d1a31){if(_0x4d1a31[_0x9161('0x80')]===0x1)return;return _0x4d1a31[_0x9161('0x31')]===_0x9161('0x7e')?_0x9161('0x28'):_0x9161('0x2a');})['compact']()[_0x9161('0x2e')]();for(var _0x1a93a2=0x0;_0x1a93a2<_0x1b00e3[_0x9161('0x66')];_0x1a93a2++){if(!_[_0x9161('0x2f')](_0x2ccb78,_0x1b00e3[_0x1a93a2]['role']))return;var _0x39b2b1=_0x1b00e3[_0x1a93a2][_0x9161('0x25')]==='agent'?_0x9161('0x7e'):_0x9161('0x29');_0x24aec3[_0x9161('0x3e')](db['UserProfileResource']['create']({'name':_0x1b00e3[_0x1a93a2][_0x9161('0x31')],'resourceId':_0x1b00e3[_0x1a93a2]['id'],'type':_0x39b2b1,'sectionId':_['find'](_0x1619ac,[_0x9161('0x31'),_0x39b2b1])['id']},{}));}return BPromise['all'](_0x24aec3);});})[_0x9161('0xf')](respondWithResult(_0x27623a,0xc9))[_0x9161('0x4a')](handleError(_0x27623a,null));};exports[_0x9161('0x89')]=function(_0x43d1fd,_0x42d54a){if(_0x43d1fd['body']['id']){delete _0x43d1fd[_0x9161('0x58')]['id'];}return db[_0x9161('0x36')][_0x9161('0x30')]({'where':{'id':_0x43d1fd[_0x9161('0x4c')]['id']}})[_0x9161('0xf')](function(_0x1935d0){if(!_0x1935d0)return null;if(_0x1935d0['id']===_0x43d1fd[_0x9161('0x27')]['id']){if(!_0x43d1fd[_0x9161('0x58')][_0x9161('0x8a')]||!_0x43d1fd[_0x9161('0x58')][_0x9161('0x8b')]){throw new db[(_0x9161('0x8c'))][(_0x9161('0x8d'))](_0x9161('0x8e'));}if(!_0x1935d0['authenticate'](_0x43d1fd['body'][_0x9161('0x8a')])){throw new db[(_0x9161('0x8c'))][(_0x9161('0x8d'))]('Wrong\x20credentials');}if(_0x43d1fd[_0x9161('0x58')][_0x9161('0x8a')]===_0x43d1fd[_0x9161('0x58')]['newPassword']){throw new db['Sequelize']['ValidationError'](_0x9161('0x8f'));}}else if(_0x43d1fd['user'][_0x9161('0x25')]===_0x9161('0x79')){if(!_0x43d1fd[_0x9161('0x58')][_0x9161('0x8b')]){throw new db[(_0x9161('0x8c'))][(_0x9161('0x8d'))](_0x9161('0x90'));}}else if(_0x43d1fd[_0x9161('0x27')][_0x9161('0x25')]===_0x9161('0x27')){if(!_0x43d1fd[_0x9161('0x58')][_0x9161('0x8b')]){throw new db[(_0x9161('0x8c'))]['ValidationError'](_0x9161('0x90'));}if(_0x1935d0[_0x9161('0x25')]!==_0x9161('0x28')){throw new db[(_0x9161('0x8c'))][(_0x9161('0x8d'))](_0x9161('0x91'));}}else{throw new db[(_0x9161('0x8c'))][(_0x9161('0x8d'))](_0x9161('0x91'));}return _0x1935d0;})[_0x9161('0xf')](handleEntityNotFound(_0x42d54a,null))[_0x9161('0xf')](function(_0xfc328b){return db[_0x9161('0x5d')][_0x9161('0x92')]({'attributes':['id',_0x9161('0x5f'),_0x9161('0x93'),'passwordHistoryLimit']})[_0x9161('0xf')](function(_0x4dbbc1){if(_0x4dbbc1[_0x9161('0x5f')])authService[_0x9161('0x94')](_0x43d1fd[_0x9161('0x58')][_0x9161('0x8b')]);if(!_0x4dbbc1[_0x9161('0x93')]||!_0xfc328b[_0x9161('0x95')])return _0xfc328b;authService[_0x9161('0x96')](_0x43d1fd[_0x9161('0x58')][_0x9161('0x8b')],_0xfc328b[_0x9161('0x95')],_0x4dbbc1[_0x9161('0x97')]);return _0xfc328b;})[_0x9161('0xf')](saveUpdates({'password':_0x43d1fd[_0x9161('0x58')][_0x9161('0x8b')],'passwordResetAt':_0x43d1fd[_0x9161('0x27')]['id']==_0x43d1fd[_0x9161('0x4c')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x43d1fd[_0x9161('0x58')][_0x9161('0x8b')],_0xfc328b[_0x9161('0x95')])},null));})['then'](respondWithResult(_0x42d54a,null))[_0x9161('0x4a')](handleError(_0x42d54a,null));};exports['addQueues']=function(_0x1db9e0,_0x142e2c){var _0x2e9834=_0x1db9e0['body']['channel'];return db['User']['find']({'where':{'id':_0x1db9e0['params']['id']},'attributes':['id',_0x9161('0x31'),_0x9161('0x25'),_0x9161('0x98'),_0x9161('0x99'),'voicePause',_0x9161('0x9a')]})['then'](handleEntityNotFound(_0x142e2c,null))['then'](function(_0x49f519){if(_0x49f519){if(!utils[_0x9161('0x9b')](_0x2e9834)){throw new db['Sequelize'][(_0x9161('0x8d'))]('Unknown\x20channel');}return _0x49f519[_0x9161('0x9c')+_['capitalize'](_0x2e9834[_0x9161('0x9d')]())+_0x9161('0x9e')](_0x1db9e0[_0x9161('0x58')][_0x9161('0x5a')],{'penalty':_0x1db9e0['body']['penalty']||0x0})[_0x9161('0x9f')](function(_0x4ff055){for(var _0x12f67d=0x0;_0x12f67d<_0x1db9e0[_0x9161('0x58')][_0x9161('0x5a')][_0x9161('0x66')];_0x12f67d+=0x1){var _0x56eb88={'UserId':Number(_0x1db9e0[_0x9161('0x4c')]['id'])};_0x56eb88[_[_0x9161('0xa0')](_0x2e9834[_0x9161('0x9d')]())+_0x9161('0xa1')]=Number(_0x1db9e0['body'][_0x9161('0x5a')][_0x12f67d]);socket['emit'](_0x9161('0x27')+_[_0x9161('0xa0')](_0x2e9834[_0x9161('0x9d')]())+_0x9161('0xa2'),_0x56eb88);}return _0x4ff055;})[_0x9161('0xf')](function(){if(_0x2e9834===_0x9161('0xa3')){return db[_0x9161('0xa4')][_0x9161('0x3f')]({'where':{'id':_0x1db9e0[_0x9161('0x58')][_0x9161('0x5a')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x9161('0xf')](function(_0x21e866){var _0x51611d=_0x49f519['get']({'plain':!![]});var _0x2810b4=[];if(_0x2e9834===_0x9161('0xa3')&&_0x51611d[_0x9161('0x25')]===_0x9161('0x28')&&_0x51611d[_0x9161('0x98')]){for(var _0x215a93=0x0;_0x215a93<_0x21e866[_0x9161('0x66')];_0x215a93+=0x1){_0x2810b4[_0x9161('0x3e')]({'membername':_0x51611d[_0x9161('0x31')],'UserId':_0x51611d['id'],'queue_name':_0x21e866[_0x215a93][_0x9161('0x31')],'VoiceQueueId':_0x21e866[_0x215a93]['id'],'interface':_[_0x9161('0x67')](_0x51611d[_0x9161('0x9a')])?util[_0x9161('0xa5')](_0x9161('0xa6'),_0x51611d[_0x9161('0x31')]):_0x51611d['interface'],'paused':_0x51611d[_0x9161('0xa7')]||![],'penalty':_0x1db9e0[_0x9161('0x58')]['penalty']||0x0});}return BPromise[_0x9161('0x86')](_0x2810b4,function(_0x2f4923){return db[_0x9161('0xa8')][_0x9161('0xa9')](_0x2f4923);});}return _0x49f519;});}})[_0x9161('0xf')](respondWithStatusCode(_0x142e2c,null))[_0x9161('0x4a')](handleError(_0x142e2c,null));};exports['removeQueues']=function(_0x5b88bf,_0x522d1f){var _0x2ee027;return db[_0x9161('0x36')]['find']({'where':{'id':_0x5b88bf[_0x9161('0x4c')]['id']},'attributes':['id',_0x9161('0x31'),_0x9161('0x25')]})[_0x9161('0xf')](handleEntityNotFound(_0x522d1f,null))[_0x9161('0xf')](function(_0x540f9a){if(_0x540f9a){_0x2ee027=_0x540f9a;if(!_0x5b88bf[_0x9161('0x41')]['channel']||!utils['isValidChannel'](_0x5b88bf[_0x9161('0x41')][_0x9161('0xaa')])){throw new db[(_0x9161('0x8c'))][(_0x9161('0x8d'))](_0x9161('0xab'));}return _0x540f9a[_0x9161('0xac')+_[_0x9161('0xa0')](_0x5b88bf['query'][_0x9161('0xaa')][_0x9161('0x9d')]())+_0x9161('0x9e')](_0x5b88bf[_0x9161('0x41')][_0x9161('0x5a')]);}})[_0x9161('0xf')](function(_0x1562fa){if(_[_0x9161('0xad')](_0x5b88bf[_0x9161('0x41')][_0x9161('0x5a')])){for(var _0x5ab314=0x0;_0x5ab314<_0x5b88bf['query'][_0x9161('0x5a')][_0x9161('0x66')];_0x5ab314+=0x1){var _0x545140={'UserId':Number(_0x5b88bf[_0x9161('0x4c')]['id'])};_0x545140[_[_0x9161('0xa0')](_0x5b88bf[_0x9161('0x41')]['channel'][_0x9161('0x9d')]())+'QueueId']=Number(_0x5b88bf[_0x9161('0x41')][_0x9161('0x5a')][_0x5ab314]);socket[_0x9161('0xae')](_0x9161('0x27')+_[_0x9161('0xa0')](_0x5b88bf[_0x9161('0x41')][_0x9161('0xaa')][_0x9161('0x9d')]())+'Queue:remove',_0x545140);}}else{var _0x545140={'UserId':Number(_0x5b88bf[_0x9161('0x4c')]['id'])};_0x545140[_[_0x9161('0xa0')](_0x5b88bf['query'][_0x9161('0xaa')][_0x9161('0x9d')]())+_0x9161('0xa1')]=Number(_0x5b88bf[_0x9161('0x41')][_0x9161('0x5a')]);socket['emit'](_0x9161('0x27')+_['capitalize'](_0x5b88bf[_0x9161('0x41')][_0x9161('0xaa')][_0x9161('0x9d')]())+_0x9161('0xaf'),_0x545140);}return _0x1562fa;})['then'](function(){if(_0x5b88bf[_0x9161('0x41')][_0x9161('0xaa')]===_0x9161('0xa3')){return db[_0x9161('0xa8')][_0x9161('0x23')]({'where':{'UserId':_0x5b88bf['params']['id'],'VoiceQueueId':_0x5b88bf[_0x9161('0x41')][_0x9161('0x5a')]},'individualHooks':!![]})[_0x9161('0xf')](function(){return _0x2ee027;});}return _0x2ee027;})[_0x9161('0xf')](respondWithStatusCode(_0x522d1f,null))['catch'](handleError(_0x522d1f,null));};exports[_0x9161('0xb0')]=function(_0x338659,_0x4d50e2){_0x338659['body'][_0x9161('0xb1')]=_0x338659[_0x9161('0xb2')][_0x9161('0xb3')];return db['User'][_0x9161('0x30')]({'where':{'id':_0x338659[_0x9161('0x4c')]['id']}})[_0x9161('0xf')](handleEntityNotFound(_0x4d50e2,null))[_0x9161('0xf')](saveUpdates(_0x338659[_0x9161('0x58')],null))[_0x9161('0xf')](respondWithResult(_0x4d50e2,null))[_0x9161('0x4a')](handleError(_0x4d50e2,null));};exports['getAvatar']=function(_0x204643,_0x53ef87){var _0x1d6e82=path[_0x9161('0xb4')](config[_0x9161('0xb5')],'server/files/images/logos/default_profile.png');return db[_0x9161('0x36')]['find']({'where':{'id':_0x204643[_0x9161('0x4c')]['id']},'attributes':['id',_0x9161('0xb1')],'raw':!![]})[_0x9161('0xf')](handleEntityNotFound(_0x53ef87,null))[_0x9161('0xf')](function(_0x492516){if(_0x492516){if(_[_0x9161('0x67')](_0x492516[_0x9161('0xb1')])){return _0x53ef87[_0x9161('0xb6')](_0x1d6e82);}else{if(!fs[_0x9161('0xb7')](path['join'](config[_0x9161('0xb5')],_0x9161('0xb8'),_0x492516['userpic']))){return _0x53ef87[_0x9161('0xb6')](_0x1d6e82);}return _0x53ef87['download'](path[_0x9161('0xb4')](config['root'],_0x9161('0xb8'),_0x492516[_0x9161('0xb1')]));}}})[_0x9161('0x4a')](handleError(_0x53ef87,null));};exports[_0x9161('0xb9')]=function(_0x1c7c8c,_0x4dac04){return db['User'][_0x9161('0x30')]({'where':{'id':_0x1c7c8c['params']['id']},'attributes':['id']})[_0x9161('0xf')](handleEntityNotFound(_0x4dac04,null))[_0x9161('0xf')](function(_0x492090){var _0x2a06db=[];values=_0x492090[_0x9161('0x45')];_0x2a06db['push'](get_open_tabs(_0x9161('0xba'),_0x492090['dataValues']));_0x2a06db[_0x9161('0x3e')](get_open_tabs(_0x9161('0x44'),_0x492090[_0x9161('0x45')]));_0x2a06db['push'](get_open_tabs(_0x9161('0x47'),_0x492090[_0x9161('0x45')]));_0x2a06db[_0x9161('0x3e')](get_open_tabs(_0x9161('0x48'),_0x492090[_0x9161('0x45')]));_0x2a06db['push'](get_open_tabs(_0x9161('0x57'),_0x492090['dataValues']));_0x2a06db[_0x9161('0x3e')](get_open_tabs(_0x9161('0x46'),_0x492090[_0x9161('0x45')]));return BPromise[_0x9161('0x49')](_0x2a06db);})[_0x9161('0xf')](function(_0x5a118b){var _0xe25158=[];if(_0x5a118b){for(var _0x3fb79e=0x0;_0x3fb79e=_0x307b90){_0x182958=_0x307b90;_0x29a4bb=0xc8;}else{_0x29a4bb=0xce;}_0x520eed[_0x4789('0x20')](_0x29a4bb);return _0x520eed[_0x4789('0x26')](_0x4789('0x27'),_0x435016+'-'+_0x182958+'/'+_0x307b90)[_0x4789('0x21')](_0x1ca6ca);}return null;};}function saveUpdates(_0x3095a1){return function(_0xa0f67e){if(_0xa0f67e){return _0xa0f67e[_0x4789('0x28')](_0x3095a1)['then'](function(_0x59de58){return _0x59de58;});}return null;};}function removeEntity(_0x3d414e){return function(_0x5c6385){if(_0x5c6385){return _0x5c6385['destroy']()['then'](function(){var _0xab907b=_0x5c6385[_0x4789('0x29')]({'plain':!![]});if(_0xab907b[_0x4789('0x2a')]===_0x4789('0x2b'))return;var _0x17e699=[{'name':_0x4789('0x2c'),'value':_0x4789('0x2d'),'ignore':!![]},{'name':_0x4789('0x2e'),'value':_0x4789('0x2f'),'ignore':![]},{'name':'Telephones','value':_0x4789('0x30'),'ignore':![]}];var _0x7ba45a=_(_0x17e699)[_0x4789('0x31')](_0x4789('0x32'))[_0x4789('0x33')](_0x4789('0x34'))[_0x4789('0x34')]();if(_[_0x4789('0x35')](_0x7ba45a,_0xab907b[_0x4789('0x2a')])){return;}var _0x409af2=_[_0x4789('0x36')](_0x17e699,[_0x4789('0x34'),_0xab907b[_0x4789('0x2a')]])[_0x4789('0x37')];return db[_0x4789('0x38')]['destroy']({'where':{'type':_0x409af2,'resourceId':_0xab907b['id']}})[_0x4789('0x14')](function(){return _0x5c6385;});})[_0x4789('0x14')](function(){_0x3d414e[_0x4789('0x20')](0xcc)[_0x4789('0x39')]();});}};}function handleEntityNotFound(_0x45785a){return function(_0xbb8ab2){if(!_0xbb8ab2){_0x45785a[_0x4789('0x1f')](0x194);}return _0xbb8ab2;};}function handleError(_0x5486c6,_0x39e379){_0x39e379=_0x39e379||0x1f4;return function(_0xc697bb){logger['error'](_0xc697bb['stack']);if(_0xc697bb[_0x4789('0x37')]){delete _0xc697bb[_0x4789('0x37')];}_0x5486c6[_0x4789('0x20')](_0x39e379)[_0x4789('0x3a')](_0xc697bb);};}exports[_0x4789('0x3b')]=function(_0x164940,_0x765afd){var _0x54dbeb={},_0x5c2314={'count':0x0,'rows':[]};var _0x5e669b=_(db[_0x4789('0x3c')][_0x4789('0x3d')])[_0x4789('0x33')](function(_0x41f062){return{'name':_0x41f062[_0x4789('0x3e')],'type':_0x41f062[_0x4789('0x3f')][_0x4789('0x40')]};})['filter'](function(_0xcf3216){return!_[_0x4789('0x35')]([_0x4789('0x41'),'salt'],_0xcf3216[_0x4789('0x37')]);})[_0x4789('0x34')]();_0x54dbeb=qs[_0x4789('0x42')](_0x5e669b,_0x164940);var _0x35cb7e={'where':_0x54dbeb[_0x4789('0x43')]};return db['User'][_0x4789('0x25')](_0x35cb7e)['then'](function(_0xaeb49e){_0x5c2314[_0x4789('0x25')]=_0xaeb49e;if(_0x164940[_0x4789('0x44')][_0x4789('0x45')]){_0x54dbeb[_0x4789('0x46')]=[{'all':!![]}];}if(!_['includes'](_0x54dbeb[_0x4789('0x47')],'id')){_0x54dbeb['attributes'][_0x4789('0x48')]('id');}return db[_0x4789('0x3c')]['findAll'](_0x54dbeb);})[_0x4789('0x14')](function(_0x4c30e8){_0x5c2314[_0x4789('0x49')]=_0x4c30e8;if(_0x164940[_0x4789('0x44')][_0x4789('0x4a')]===_0x4789('0x4b')){var _0x4f6c3b=[];for(var _0x955032=0x0;_0x955032<_0x5c2314[_0x4789('0x49')]['length'];_0x955032++){_0x4f6c3b[_0x4789('0x48')](get_open_tabs(_0x4789('0x4c'),_0x5c2314[_0x4789('0x49')][_0x955032]['dataValues']));_0x4f6c3b['push'](get_open_tabs(_0x4789('0x4d'),_0x5c2314['rows'][_0x955032][_0x4789('0x4e')]));_0x4f6c3b['push'](get_open_tabs(_0x4789('0x4f'),_0x5c2314[_0x4789('0x49')][_0x955032][_0x4789('0x4e')]));_0x4f6c3b[_0x4789('0x48')](get_open_tabs(_0x4789('0x50'),_0x5c2314[_0x4789('0x49')][_0x955032][_0x4789('0x4e')]));_0x4f6c3b['push'](get_open_tabs(_0x4789('0x51'),_0x5c2314[_0x4789('0x49')][_0x955032][_0x4789('0x4e')]));_0x4f6c3b[_0x4789('0x48')](get_open_tabs(_0x4789('0x52'),_0x5c2314[_0x4789('0x49')][_0x955032][_0x4789('0x4e')]));}return BPromise[_0x4789('0x53')](_0x4f6c3b)[_0x4789('0x14')](function(_0xcf3dd5){return _0x5c2314;});}else{return _0x5c2314;}})['then'](respondWithFilteredResult(_0x765afd,_0x54dbeb))[_0x4789('0x1e')](handleError(_0x765afd,null));};exports[_0x4789('0x54')]=function(_0x5a7812,_0x605a12){var _0x46d1ad={'raw':![],'where':{'id':_0x5a7812[_0x4789('0x55')]['id']}},_0x237987={};_0x237987[_0x4789('0x56')]=_['differenceBy'](_[_0x4789('0x57')](db[_0x4789('0x3c')][_0x4789('0x3d')]),[_0x4789('0x41'),_0x4789('0x58')]);_0x237987[_0x4789('0x44')]=_[_0x4789('0x57')](_0x5a7812[_0x4789('0x44')]);_0x237987[_0x4789('0x59')]=_[_0x4789('0x5a')](_0x237987[_0x4789('0x56')],_0x237987['query']);_0x46d1ad[_0x4789('0x47')]=_[_0x4789('0x5a')](_0x237987[_0x4789('0x56')],qs[_0x4789('0x5b')](_0x5a7812[_0x4789('0x44')]['fields']));_0x46d1ad[_0x4789('0x47')]=_0x46d1ad['attributes']['length']?_0x46d1ad[_0x4789('0x47')]:_0x237987[_0x4789('0x56')];if(_0x5a7812[_0x4789('0x44')][_0x4789('0x45')]){_0x46d1ad[_0x4789('0x46')]=[{'all':!![]}];}_0x46d1ad=_[_0x4789('0x5c')]({},_0x46d1ad,_0x5a7812[_0x4789('0x5d')]);if(!_[_0x4789('0x35')](_0x46d1ad['attributes'],'id')){_0x46d1ad[_0x4789('0x47')]['push']('id');}return db['User'][_0x4789('0x36')](_0x46d1ad)['then'](handleEntityNotFound(_0x605a12,null))[_0x4789('0x14')](function(_0x3dac68){var _0x3039b0=[];values=_0x3dac68;if(_0x5a7812['query'][_0x4789('0x4a')]==='true'){_0x3039b0[_0x4789('0x48')](get_open_tabs('chat',_0x3dac68[_0x4789('0x4e')]));_0x3039b0[_0x4789('0x48')](get_open_tabs(_0x4789('0x4d'),_0x3dac68[_0x4789('0x4e')]));_0x3039b0[_0x4789('0x48')](get_open_tabs(_0x4789('0x51'),_0x3dac68[_0x4789('0x4e')]));_0x3039b0[_0x4789('0x48')](get_open_tabs(_0x4789('0x52'),_0x3dac68['dataValues']));_0x3039b0[_0x4789('0x48')](get_open_tabs('fax',_0x3dac68[_0x4789('0x4e')]));_0x3039b0[_0x4789('0x48')](get_open_tabs('mail',_0x3dac68[_0x4789('0x4e')]));return BPromise[_0x4789('0x53')](_0x3039b0);}else{return values;}})[_0x4789('0x14')](function(_0x3b0e6c){return values;})[_0x4789('0x14')](respondWithResult(_0x605a12,null))[_0x4789('0x1e')](handleError(_0x605a12,null));};exports[_0x4789('0x28')]=function(_0x10cf2b,_0x2e7126){if(_0x10cf2b[_0x4789('0x5e')]['id']){delete _0x10cf2b[_0x4789('0x5e')]['id'];}delete _0x10cf2b[_0x4789('0x5e')]['role'];return db['User'][_0x4789('0x36')]({'where':{'id':_0x10cf2b['params']['id']}})[_0x4789('0x14')](handleEntityNotFound(_0x2e7126,null))[_0x4789('0x14')](saveUpdates(_0x10cf2b[_0x4789('0x5e')],null))[_0x4789('0x14')](respondWithResult(_0x2e7126,null))[_0x4789('0x1e')](handleError(_0x2e7126,null));};exports[_0x4789('0x5f')]=function(_0x1c231e,_0x451bcd){return db['User'][_0x4789('0x5f')]()[_0x4789('0x14')](respondWithResult(_0x451bcd,null))['catch'](handleError(_0x451bcd,null));};exports[_0x4789('0x60')]=function(_0x2ab2e7,_0x39f4b1){return db[_0x4789('0x3c')][_0x4789('0x36')]({'where':{'id':_0x2ab2e7[_0x4789('0x55')]['id']}})['then'](handleEntityNotFound(_0x39f4b1,null))['then'](function(_0x2df571){if(_0x2df571){return _0x2df571[_0x4789('0x60')](_0x2ab2e7[_0x4789('0x5e')][_0x4789('0x61')],_[_0x4789('0x62')](_0x2ab2e7[_0x4789('0x5e')],[_0x4789('0x61'),'id'])||{});}})[_0x4789('0x14')](respondWithResult(_0x39f4b1,null))[_0x4789('0x1e')](handleError(_0x39f4b1,null));};function validateUser(_0x85e7d4){return new BPromise(function(_0x492146,_0x436b54){if(_0x85e7d4[_0x4789('0x63')])return _0x492146(_0x85e7d4);return db[_0x4789('0x64')]['findById'](0x1)[_0x4789('0x14')](function(_0x170b2e){if(_0x170b2e['securePassword'])authService['validatePasswordPattern'](_0x85e7d4['password']);db[_0x4789('0x3c')]['max'](_0x4789('0x63'))[_0x4789('0x14')](function(_0x9a6529){if(_['isNil'](_0x9a6529)){_0x85e7d4[_0x4789('0x63')]=_0x170b2e[_0x4789('0x65')]||0x1;return;}if(_['isNil'](_0x170b2e['min_internal'])||_0x170b2e[_0x4789('0x65')]===_0x9a6529){_0x85e7d4[_0x4789('0x63')]=_0x9a6529+0x1;return;}if(_0x170b2e['min_internal']>_0x9a6529){_0x85e7d4[_0x4789('0x63')]=_0x170b2e['min_internal'];return;}return db[_0x4789('0x66')][_0x4789('0x44')](_0x4789('0x67'),{'type':db[_0x4789('0x66')]['QueryTypes'][_0x4789('0x68')]})[_0x4789('0x14')](function(_0x327003){if(_0x327003&&_0x327003[_0x4789('0x69')]){for(var _0x538855=0x0,_0xe970e1=_0x327003[_0x4789('0x69')];_0x538855<_0xe970e1&&_[_0x4789('0x6a')](_0x85e7d4[_0x4789('0x63')]);_0x538855++){if(_0x170b2e[_0x4789('0x65')]<=_0x327003[_0x538855][_0x4789('0x6b')]){_0x85e7d4[_0x4789('0x63')]=_0x327003[_0x538855][_0x4789('0x6b')];}else if(_0x170b2e[_0x4789('0x65')]>_0x327003[_0x538855][_0x4789('0x6b')]&&_0x170b2e[_0x4789('0x65')]<=_0x327003[_0x538855]['to']){_0x85e7d4['internal']=_0x170b2e['min_internal'];}}}if(_['isNil'](_0x85e7d4['internal'])){_0x85e7d4[_0x4789('0x63')]=_0x9a6529+0x1;}return _0x492146(_0x85e7d4);});});})['catch'](function(_0xf6e010){_0x436b54(_0xf6e010);});});}function updateUser(_0x3920f6){return new BPromise(function(_0x33a766,_0x3f350f){try{if(_0x3920f6[_0x4789('0x6c')]){_0x3920f6[_0x4789('0x6d')]=_0x3920f6['internal'];_0x3920f6[_0x4789('0x6e')]={'mailbox':_0x3920f6[_0x4789('0x63')],'password':_0x3920f6[_0x4789('0x41')],'fullname':_0x3920f6[_0x4789('0x6f')],'email':_0x3920f6['email']};}if(_0x3920f6['role']==='agent'){if(!_0x3920f6[_0x4789('0x70')])_0x3920f6[_0x4789('0x70')]=[_0x4789('0x71'),_0x4789('0x72'),_0x4789('0x73'),_0x4789('0x74'),_0x4789('0x75'),_0x4789('0x76'),'105',_0x4789('0x77'),_0x4789('0x78'),_0x4789('0x79'),_0x4789('0x7a'),_0x4789('0x7b'),_0x4789('0x7c'),_0x4789('0x7d'),_0x4789('0x7e')];}_0x33a766(_0x3920f6);}catch(_0x1871eb){_0x3f350f(_0x1871eb);}});}exports[_0x4789('0x7f')]=function(_0x2785d3,_0x12faef){if(_0x2785d3[_0x4789('0x2d')]['role']===_0x4789('0x2f'))throw new Error(_0x4789('0x80'));if(_0x2785d3[_0x4789('0x5e')][_0x4789('0x2a')]===_0x4789('0x2d')&&_0x2785d3[_0x4789('0x2d')][_0x4789('0x2a')]!==_0x4789('0x2b')){throw new Error(_0x4789('0x81'));}if(_0x2785d3[_0x4789('0x5e')][_0x4789('0x2a')]==='admin'&&_0x2785d3[_0x4789('0x2d')][_0x4789('0x2a')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x4789('0x82')]([_0x2785d3[_0x4789('0x5e')]])[_0x4789('0x14')](function(){return validateUser(_0x2785d3[_0x4789('0x5e')]);})[_0x4789('0x14')](function(_0x590938){return updateUser(_0x590938)[_0x4789('0x14')](function(_0x122127){if(_0x122127[_0x4789('0x2a')]===_0x4789('0x2b')){_0x122127[_0x4789('0x83')]=_0x2785d3[_0x4789('0x2d')]['settingsEnabled'];delete _0x122127['userProfileId'];}return _0x122127;});})[_0x4789('0x14')](function(_0x433a65){return db[_0x4789('0x3c')][_0x4789('0x7f')](_0x433a65,{'include':[{'model':db[_0x4789('0x6e')],'as':'VoiceMail'}]});})[_0x4789('0x14')](function(_0xbae08e){if(_0x2785d3[_0x4789('0x5e')][_0x4789('0x2a')]===_0x4789('0x2d'))return _0xbae08e;if(_0x2785d3['user'][_0x4789('0x2a')]!==_0x4789('0x2d'))return _0xbae08e;return db[_0x4789('0x84')][_0x4789('0x36')]({'where':{'name':_0xbae08e[_0x4789('0x2a')]===_0x4789('0x2f')?_0x4789('0x2e'):_0x4789('0x85'),'userProfileId':_0x2785d3[_0x4789('0x2d')]['userProfileId']},'raw':!![]})[_0x4789('0x14')](function(_0x1d4a0c){if(!_0x1d4a0c||_0x1d4a0c['autoAssociation']!=0x0)return _0xbae08e;return db[_0x4789('0x38')][_0x4789('0x7f')]({'name':_0xbae08e[_0x4789('0x37')],'resourceId':_0xbae08e['id'],'type':_0x1d4a0c[_0x4789('0x37')],'sectionId':_0x1d4a0c['id']},{})[_0x4789('0x14')](function(){return _0xbae08e;});})['catch'](function(_0x2c6faf){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c6faf);throw _0x2c6faf;});})['then'](respondWithResult(_0x12faef,0xc9))[_0x4789('0x1e')](handleError(_0x12faef,null));};exports[_0x4789('0x86')]=function(_0x165995,_0x2449e1){var _0x1bcf2e=_0x165995[_0x4789('0x5e')];var _0x4494c7=[];if(_0x165995[_0x4789('0x2d')][_0x4789('0x2a')]===_0x4789('0x2f'))throw new Error(_0x4789('0x80'));if(_[_0x4789('0x87')](_0x1bcf2e,[_0x4789('0x2a'),_0x4789('0x2d')])&&_0x165995[_0x4789('0x2d')]['role']!==_0x4789('0x2b')){throw new Error(_0x4789('0x81'));}if(_[_0x4789('0x87')](_0x1bcf2e,[_0x4789('0x2a'),_0x4789('0x2b')])&&_0x165995[_0x4789('0x2d')][_0x4789('0x2a')]!==_0x4789('0x2b')){throw new Error(_0x4789('0x88'));}return licenseUtil[_0x4789('0x82')](_0x1bcf2e)[_0x4789('0x14')](function(){return validateUser(_0x1bcf2e[0x0]);})[_0x4789('0x14')](function(){for(var _0x35687b=0x1;_0x35687b<_0x1bcf2e[_0x4789('0x69')];_0x35687b++){var _0xf39a73=_0x1bcf2e[_0x35687b-0x1][_0x4789('0x63')];if(!_0x1bcf2e[_0x35687b][_0x4789('0x63')])_0x1bcf2e[_0x35687b][_0x4789('0x63')]=_0xf39a73+0x1;_0x4494c7[_0x4789('0x48')](validateUser(_0x1bcf2e[_0x35687b]));}return BPromise[_0x4789('0x53')](_0x4494c7);})[_0x4789('0x14')](function(){_0x4494c7=[];for(var _0x3061f3=0x0;_0x3061f3<_0x1bcf2e[_0x4789('0x69')];_0x3061f3++){_0x4494c7[_0x4789('0x48')](updateUser(_0x1bcf2e[_0x3061f3]));}return BPromise[_0x4789('0x53')](_0x4494c7);})['then'](function(){return BPromise[_0x4789('0x89')](_0x1bcf2e,function(_0x12e47d){return db['User'][_0x4789('0x7f')](_0x12e47d,{'include':[{'model':db['VoiceMail'],'as':_0x4789('0x6e')}]})[_0x4789('0x14')](function(_0x2bd683){_0x12e47d['id']=_0x2bd683['id'];return _0x12e47d;});});})['then'](function(_0x55c86d){if(_0x165995[_0x4789('0x5e')][_0x4789('0x2a')]===_0x4789('0x2d'))return _0x55c86d;if(_0x165995['user'][_0x4789('0x2a')]!==_0x4789('0x2d'))return _0x55c86d;var _0x272ff9=_['some'](_0x55c86d,function(_0x16149b){return _0x16149b[_0x4789('0x2a')]===_0x4789('0x2f')||_0x16149b[_0x4789('0x2a')]===_0x4789('0x30');});if(!_0x272ff9)return _0x55c86d;return db[_0x4789('0x84')][_0x4789('0x8a')]({'where':{'name':{'$or':[_0x4789('0x2e'),'Telephones']},'userProfileId':_0x165995[_0x4789('0x2d')][_0x4789('0x8b')]},'raw':!![]})[_0x4789('0x14')](function(_0x2441f1){if(_['isEmpty'](_0x2441f1)||!_[_0x4789('0x87')](_0x2441f1,['autoAssociation',0x0]))return _0x55c86d;_0x4494c7=[];var _0x4d7f7f=_(_0x2441f1)[_0x4789('0x33')](function(_0x427789){if(_0x427789['autoAssociation']===0x1)return;return _0x427789[_0x4789('0x37')]===_0x4789('0x2e')?'agent':_0x4789('0x30');})[_0x4789('0x8c')]()['value']();for(var _0x338ceb=0x0;_0x338ceb<_0x55c86d[_0x4789('0x69')];_0x338ceb++){if(!_[_0x4789('0x35')](_0x4d7f7f,_0x55c86d[_0x338ceb][_0x4789('0x2a')]))return;var _0xff015e=_0x55c86d[_0x338ceb][_0x4789('0x2a')]===_0x4789('0x2f')?'Agents':'Telephones';_0x4494c7['push'](db['UserProfileResource'][_0x4789('0x7f')]({'name':_0x55c86d[_0x338ceb]['name'],'resourceId':_0x55c86d[_0x338ceb]['id'],'type':_0xff015e,'sectionId':_['find'](_0x2441f1,[_0x4789('0x37'),_0xff015e])['id']},{}));}return BPromise[_0x4789('0x53')](_0x4494c7);});})[_0x4789('0x14')](respondWithResult(_0x2449e1,0xc9))[_0x4789('0x1e')](handleError(_0x2449e1,null));};exports['changePassword']=function(_0x1eae09,_0x13a10a){if(_0x1eae09[_0x4789('0x5e')]['id']){delete _0x1eae09[_0x4789('0x5e')]['id'];}return db[_0x4789('0x3c')][_0x4789('0x36')]({'where':{'id':_0x1eae09['params']['id']}})[_0x4789('0x14')](function(_0x19c172){if(!_0x19c172)return null;if(_0x19c172['id']===_0x1eae09[_0x4789('0x2d')]['id']){if(!_0x1eae09[_0x4789('0x5e')][_0x4789('0x8d')]||!_0x1eae09[_0x4789('0x5e')][_0x4789('0x8e')]){throw new db[(_0x4789('0x8f'))][(_0x4789('0x90'))](_0x4789('0x91'));}if(!_0x19c172[_0x4789('0x92')](_0x1eae09['body'][_0x4789('0x8d')])){throw new db[(_0x4789('0x8f'))]['ValidationError'](_0x4789('0x93'));}if(_0x1eae09[_0x4789('0x5e')][_0x4789('0x8d')]===_0x1eae09['body'][_0x4789('0x8e')]){throw new db[(_0x4789('0x8f'))][(_0x4789('0x90'))](_0x4789('0x94'));}}else if(_0x1eae09[_0x4789('0x2d')][_0x4789('0x2a')]===_0x4789('0x2b')){if(!_0x1eae09[_0x4789('0x5e')][_0x4789('0x8e')]){throw new db[(_0x4789('0x8f'))][(_0x4789('0x90'))](_0x4789('0x95'));}}else if(_0x1eae09[_0x4789('0x2d')][_0x4789('0x2a')]===_0x4789('0x2d')){if(!_0x1eae09[_0x4789('0x5e')][_0x4789('0x8e')]){throw new db[(_0x4789('0x8f'))][(_0x4789('0x90'))](_0x4789('0x95'));}if(_0x19c172['role']!==_0x4789('0x2f')){throw new db[(_0x4789('0x8f'))][(_0x4789('0x90'))]('Unauthorized');}}else{throw new db[(_0x4789('0x8f'))]['ValidationError'](_0x4789('0x80'));}return _0x19c172;})[_0x4789('0x14')](handleEntityNotFound(_0x13a10a,null))[_0x4789('0x14')](function(_0x2c1aaa){return db['Setting'][_0x4789('0x96')]({'attributes':['id',_0x4789('0x97'),_0x4789('0x98'),_0x4789('0x99')]})['then'](function(_0x1fd512){if(_0x1fd512['securePassword'])authService['validatePasswordPattern'](_0x1eae09['body'][_0x4789('0x8e')]);if(!_0x1fd512[_0x4789('0x98')]||!_0x2c1aaa[_0x4789('0x9a')])return _0x2c1aaa;authService[_0x4789('0x9b')](_0x1eae09[_0x4789('0x5e')][_0x4789('0x8e')],_0x2c1aaa[_0x4789('0x9a')],_0x1fd512[_0x4789('0x99')]);return _0x2c1aaa;})['then'](saveUpdates({'password':_0x1eae09[_0x4789('0x5e')][_0x4789('0x8e')],'passwordResetAt':_0x1eae09[_0x4789('0x2d')]['id']==_0x1eae09[_0x4789('0x55')]['id']?moment():null,'previousPasswords':authService[_0x4789('0x9c')](_0x1eae09[_0x4789('0x5e')][_0x4789('0x8e')],_0x2c1aaa['previousPasswords'])},null));})['then'](respondWithResult(_0x13a10a,null))[_0x4789('0x1e')](handleError(_0x13a10a,null));};exports['addQueues']=function(_0x14d05e,_0x299d78){var _0x2cefcd=_0x14d05e[_0x4789('0x5e')][_0x4789('0x9d')];return db[_0x4789('0x3c')]['find']({'where':{'id':_0x14d05e[_0x4789('0x55')]['id']},'attributes':['id',_0x4789('0x37'),'role',_0x4789('0x9e'),_0x4789('0x9f'),_0x4789('0xa0'),_0x4789('0xa1')]})['then'](handleEntityNotFound(_0x299d78,null))[_0x4789('0x14')](function(_0x5cda88){if(_0x5cda88){if(!utils[_0x4789('0xa2')](_0x2cefcd)){throw new db[(_0x4789('0x8f'))][(_0x4789('0x90'))]('Unknown\x20channel');}return _0x5cda88['add'+_['capitalize'](_0x2cefcd[_0x4789('0xa3')]())+_0x4789('0xa4')](_0x14d05e['body']['ids'],{'penalty':_0x14d05e['body']['penalty']||0x0})[_0x4789('0xa5')](function(_0x510152){for(var _0x31b39b=0x0;_0x31b39b<_0x14d05e[_0x4789('0x5e')][_0x4789('0x61')]['length'];_0x31b39b+=0x1){var _0x18bcee={'UserId':Number(_0x14d05e[_0x4789('0x55')]['id'])};_0x18bcee[_['capitalize'](_0x2cefcd['toLowerCase']())+'QueueId']=Number(_0x14d05e[_0x4789('0x5e')][_0x4789('0x61')][_0x31b39b]);socket['emit'](_0x4789('0x2d')+_[_0x4789('0xa6')](_0x2cefcd[_0x4789('0xa3')]())+'Queue:save',_0x18bcee);}return _0x510152;})[_0x4789('0x14')](function(){if(_0x2cefcd===_0x4789('0xa7')){return db[_0x4789('0xa8')][_0x4789('0x8a')]({'where':{'id':_0x14d05e[_0x4789('0x5e')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x33fc9e){var _0x33c48c=_0x5cda88['get']({'plain':!![]});var _0x467f99=[];if(_0x2cefcd===_0x4789('0xa7')&&_0x33c48c[_0x4789('0x2a')]===_0x4789('0x2f')&&_0x33c48c[_0x4789('0x9e')]){for(var _0x2d968d=0x0;_0x2d968d<_0x33fc9e[_0x4789('0x69')];_0x2d968d+=0x1){_0x467f99['push']({'membername':_0x33c48c[_0x4789('0x37')],'UserId':_0x33c48c['id'],'queue_name':_0x33fc9e[_0x2d968d][_0x4789('0x37')],'VoiceQueueId':_0x33fc9e[_0x2d968d]['id'],'interface':_['isNil'](_0x33c48c['interface'])?util[_0x4789('0xa9')]('SIP/%s',_0x33c48c[_0x4789('0x37')]):_0x33c48c['interface'],'paused':_0x33c48c[_0x4789('0xa0')]||![],'penalty':_0x14d05e[_0x4789('0x5e')][_0x4789('0xaa')]||0x0});}return BPromise[_0x4789('0x89')](_0x467f99,function(_0x61e449){return db[_0x4789('0xab')][_0x4789('0xac')](_0x61e449);});}return _0x5cda88;});}})[_0x4789('0x14')](respondWithStatusCode(_0x299d78,null))[_0x4789('0x1e')](handleError(_0x299d78,null));};exports[_0x4789('0xad')]=function(_0x516a6c,_0x534411){var _0x1a2b17;return db[_0x4789('0x3c')][_0x4789('0x36')]({'where':{'id':_0x516a6c[_0x4789('0x55')]['id']},'attributes':['id',_0x4789('0x37'),_0x4789('0x2a')]})[_0x4789('0x14')](handleEntityNotFound(_0x534411,null))['then'](function(_0x1222f4){if(_0x1222f4){_0x1a2b17=_0x1222f4;if(!_0x516a6c[_0x4789('0x44')][_0x4789('0x9d')]||!utils['isValidChannel'](_0x516a6c[_0x4789('0x44')][_0x4789('0x9d')])){throw new db[(_0x4789('0x8f'))][(_0x4789('0x90'))](_0x4789('0xae'));}return _0x1222f4[_0x4789('0xaf')+_[_0x4789('0xa6')](_0x516a6c[_0x4789('0x44')][_0x4789('0x9d')]['toLowerCase']())+_0x4789('0xa4')](_0x516a6c[_0x4789('0x44')][_0x4789('0x61')]);}})[_0x4789('0x14')](function(_0xefba38){if(_[_0x4789('0xb0')](_0x516a6c[_0x4789('0x44')]['ids'])){for(var _0xb5ad31=0x0;_0xb5ad31<_0x516a6c['query'][_0x4789('0x61')]['length'];_0xb5ad31+=0x1){var _0x77ca9c={'UserId':Number(_0x516a6c[_0x4789('0x55')]['id'])};_0x77ca9c[_[_0x4789('0xa6')](_0x516a6c[_0x4789('0x44')]['channel'][_0x4789('0xa3')]())+'QueueId']=Number(_0x516a6c[_0x4789('0x44')][_0x4789('0x61')][_0xb5ad31]);socket[_0x4789('0xb1')]('user'+_[_0x4789('0xa6')](_0x516a6c[_0x4789('0x44')][_0x4789('0x9d')][_0x4789('0xa3')]())+_0x4789('0xb2'),_0x77ca9c);}}else{var _0x77ca9c={'UserId':Number(_0x516a6c[_0x4789('0x55')]['id'])};_0x77ca9c[_[_0x4789('0xa6')](_0x516a6c['query'][_0x4789('0x9d')][_0x4789('0xa3')]())+_0x4789('0xb3')]=Number(_0x516a6c[_0x4789('0x44')][_0x4789('0x61')]);socket['emit']('user'+_[_0x4789('0xa6')](_0x516a6c[_0x4789('0x44')][_0x4789('0x9d')][_0x4789('0xa3')]())+_0x4789('0xb2'),_0x77ca9c);}return _0xefba38;})[_0x4789('0x14')](function(){if(_0x516a6c['query']['channel']==='voice'){return db['UserVoiceQueueRt'][_0x4789('0xb4')]({'where':{'UserId':_0x516a6c[_0x4789('0x55')]['id'],'VoiceQueueId':_0x516a6c[_0x4789('0x44')][_0x4789('0x61')]},'individualHooks':!![]})[_0x4789('0x14')](function(){return _0x1a2b17;});}return _0x1a2b17;})[_0x4789('0x14')](respondWithStatusCode(_0x534411,null))['catch'](handleError(_0x534411,null));};exports[_0x4789('0xb5')]=function(_0xb1f223,_0x21c193){_0xb1f223[_0x4789('0x5e')][_0x4789('0xb6')]=_0xb1f223[_0x4789('0xb7')][_0x4789('0xb8')];return db['User'][_0x4789('0x36')]({'where':{'id':_0xb1f223[_0x4789('0x55')]['id']}})[_0x4789('0x14')](handleEntityNotFound(_0x21c193,null))['then'](saveUpdates(_0xb1f223[_0x4789('0x5e')],null))[_0x4789('0x14')](respondWithResult(_0x21c193,null))[_0x4789('0x1e')](handleError(_0x21c193,null));};exports[_0x4789('0xb9')]=function(_0x13a3ef,_0x2be8be){var _0x4b8127=path[_0x4789('0xba')](config[_0x4789('0xbb')],_0x4789('0xbc'));return db[_0x4789('0x3c')][_0x4789('0x36')]({'where':{'id':_0x13a3ef[_0x4789('0x55')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x2be8be,null))[_0x4789('0x14')](function(_0x323e18){if(_0x323e18){if(_[_0x4789('0x6a')](_0x323e18[_0x4789('0xb6')])){return _0x2be8be[_0x4789('0xbd')](_0x4b8127);}else{if(!fs[_0x4789('0xbe')](path['join'](config['root'],_0x4789('0xbf'),_0x323e18['userpic']))){return _0x2be8be[_0x4789('0xbd')](_0x4b8127);}return _0x2be8be[_0x4789('0xbd')](path[_0x4789('0xba')](config[_0x4789('0xbb')],_0x4789('0xbf'),_0x323e18['userpic']));}}})[_0x4789('0x1e')](handleError(_0x2be8be,null));};exports[_0x4789('0xc0')]=function(_0x32544c,_0x34f6dd){return db[_0x4789('0x3c')][_0x4789('0x36')]({'where':{'id':_0x32544c['params']['id']},'attributes':['id']})[_0x4789('0x14')](handleEntityNotFound(_0x34f6dd,null))[_0x4789('0x14')](function(_0x46f042){var _0x3c47f8=[];values=_0x46f042[_0x4789('0x4e')];_0x3c47f8[_0x4789('0x48')](get_open_tabs('chat',_0x46f042[_0x4789('0x4e')]));_0x3c47f8[_0x4789('0x48')](get_open_tabs('sms',_0x46f042[_0x4789('0x4e')]));_0x3c47f8[_0x4789('0x48')](get_open_tabs(_0x4789('0x51'),_0x46f042[_0x4789('0x4e')]));_0x3c47f8[_0x4789('0x48')](get_open_tabs(_0x4789('0x52'),_0x46f042[_0x4789('0x4e')]));_0x3c47f8[_0x4789('0x48')](get_open_tabs(_0x4789('0x4f'),_0x46f042['dataValues']));_0x3c47f8['push'](get_open_tabs('mail',_0x46f042[_0x4789('0x4e')]));return BPromise['all'](_0x3c47f8);})[_0x4789('0x14')](function(_0x15518f){var _0x3781f6=[];if(_0x15518f){for(var _0x1ce1f2=0x0;_0x1ce1f2=_0x5c75ac[_0xacab('0x50')]){throw new Error(_0xacab('0x51'));}})[_0xacab('0xd')](function(){if(_0x289468){return db['UserVoiceQueueRt'][_0xacab('0x46')]({'where':{'membername':_0x289468[_0xacab('0x29')]},'individualHooks':!![]});}})[_0xacab('0xd')](function(){if(_0x289468){return _0x289468[_0xacab('0x52')]({'raw':!![]});}})[_0xacab('0xd')](function(_0x4b2d98){if(_0x289468){if(_0x4b2d98){var _0x325c2d=[];_0x474b8b=_0x4b2d98;if(_0x474b8b[_0xacab('0x2c')]){for(var _0x5e9d2b=0x0;_0x5e9d2b<_0x474b8b['length'];_0x5e9d2b++){_0x325c2d[_0xacab('0x44')](db[_0xacab('0x27')][_0xacab('0x53')]({'membername':_0x289468[_0xacab('0x29')],'UserId':_0x289468['id'],'queue_name':_0x474b8b[_0x5e9d2b][_0xacab('0x29')],'VoiceQueueId':_0x474b8b[_0x5e9d2b]['id'],'interface':_0x27b84a,'paused':_0x289468[_0xacab('0x4c')]||![],'penalty':_0x474b8b[_0x5e9d2b][_0xacab('0x54')]||0x0}));}return BPromise[_0xacab('0x47')](_0x325c2d);}}}})[_0xacab('0xd')](function(){if(_0x289468){return db['MemberReport'][_0xacab('0x19')]({'where':{'membername':_0x289468[_0xacab('0x29')],'exitAt':null}});}})[_0xacab('0xd')](function(_0x4d38eb){if(_0x289468){if(_0x4d38eb&&_0x4d38eb[_0xacab('0x2c')]){var _0x3d1ea1=[];_0x4d38eb[_0xacab('0x2e')](function(_0x1973a5){_0x3d1ea1[_0xacab('0x44')](_0x1973a5[_0xacab('0x37')]({'exitAt':moment()['format'](_0xacab('0x2b'))}));});return BPromise[_0xacab('0x47')](_0x3d1ea1);}}})[_0xacab('0xd')](function(_0x431ab6){if(_0x289468){var _0x3a5866=[];var _0x4df6ea=[];var _0xa6ac15=utils[_0xacab('0x2d')]();var _0x50d95e={'membername':_0x289468[_0xacab('0x29')],'interface':_0x27b84a,'enterAt':moment()[_0xacab('0x30')](_0xacab('0x2b')),'role':_0x289468[_0xacab('0x49')],'internal':_0x289468[_0xacab('0x33')]};_0xa6ac15[_0xacab('0x2e')](function(_0x2e1f68){_0x3a5866['push'](_['merge']({'channel':_0x2e1f68,'type':_0xacab('0x55'),'data1':_0xacab('0x56'),'data2':_0x27b84a},_0x50d95e));if(_0x289468[_0xacab('0x4c')]){_0x4df6ea[_0xacab('0x44')](_[_0xacab('0x57')]({'channel':_0x2e1f68,'type':_0xacab('0x2a'),'data1':_0xacab('0x58')},_0x50d95e));}});return db[_0xacab('0x28')][_0xacab('0x36')](_0x3a5866[_0xacab('0x59')](_0x4df6ea),{'individualHooks':!![]});}})[_0xacab('0xd')](function(){if(_0x289468){return _0x289468[_0xacab('0x37')]({'online':!![],'lastLoginAt':moment()[_0xacab('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x289468[_0xacab('0x4c')]||![],'mailPause':_0x289468[_0xacab('0x4c')]||![],'chatPause':_0x289468[_0xacab('0x4c')]||![],'faxPause':_0x289468[_0xacab('0x4c')]||![],'smsPause':_0x289468[_0xacab('0x4c')]||![],'openchannelPause':_0x289468[_0xacab('0x4c')]||![],'pauseType':_0x289468[_0xacab('0x4c')]?_0xacab('0x58'):null,'lastPauseAt':moment()[_0xacab('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x27b84a});}})[_0xacab('0xd')](function(_0x2de462){_0x1541d0(_0x2de462);})[_0xacab('0x17')](function(_0x23a399){_0xde5aca(_0x1d016e[_0xacab('0x12')](0x1f4,_0x23a399[_0xacab('0x15')]));});});}; \ No newline at end of file +var _0xd69b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./user.socket','register','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetUser','findAll','options','raw','where','include','model','attributes','map','ShowUser','User','find','PauseUser','name','role','internal','update','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','push','isNil','interface','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','format','UnpauseUser','channel','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','system','mail','chat','fax','sms','openchannel','whatsapp','set','%s%s','Pause','all','findOne','LoginUser','mobile','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x379d12,_0x2f59d6){var _0x87e673=function(_0x4d7388){while(--_0x4d7388){_0x379d12['push'](_0x379d12['shift']());}};_0x87e673(++_0x2f59d6);}(_0xd69b,0x116));var _0xbd69=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xd69b[_0x1a9204];return _0x17ca68;};'use strict';var _=require(_0xbd69('0x0'));var util=require(_0xbd69('0x1'));var moment=require(_0xbd69('0x2'));var BPromise=require(_0xbd69('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd69('0x4'));var db=require(_0xbd69('0x5'))['db'];var utils=require(_0xbd69('0x6'));var logger=require(_0xbd69('0x7'))(_0xbd69('0x8'));var config=require(_0xbd69('0x9'));var jayson=require(_0xbd69('0xa'));var client=jayson[_0xbd69('0xb')][_0xbd69('0xc')]({'port':0x232a});config[_0xbd69('0xd')]=_[_0xbd69('0xe')](config[_0xbd69('0xd')],{'host':_0xbd69('0xf'),'port':0x18eb});var socket=require(_0xbd69('0x10'))(new Redis(config['redis']));require(_0xbd69('0x11'))[_0xbd69('0x12')](socket);function respondWithRpcPromise(_0x2affde,_0x110e1e,_0x72c825){return new BPromise(function(_0x3f2535,_0x1fbd0a){return client['request'](_0x2affde,_0x72c825)[_0xbd69('0x13')](function(_0x122638){logger[_0xbd69('0x14')](_0xbd69('0x15'),_0x110e1e,_0xbd69('0x16'));logger[_0xbd69('0x17')](_0xbd69('0x18'),_0x110e1e,_0xbd69('0x16'),JSON[_0xbd69('0x19')](_0x122638));if(_0x122638[_0xbd69('0x1a')]){if(_0x122638[_0xbd69('0x1a')]['code']===0x1f4){logger[_0xbd69('0x1a')](_0xbd69('0x15'),_0x110e1e,_0x122638[_0xbd69('0x1a')][_0xbd69('0x1b')]);return _0x1fbd0a(_0x122638[_0xbd69('0x1a')][_0xbd69('0x1b')]);}logger['error']('User,\x20%s,\x20%s',_0x110e1e,_0x122638[_0xbd69('0x1a')][_0xbd69('0x1b')]);return _0x3f2535(_0x122638['error'][_0xbd69('0x1b')]);}else{logger[_0xbd69('0x14')](_0xbd69('0x15'),_0x110e1e,_0xbd69('0x16'));_0x3f2535(_0x122638[_0xbd69('0x1c')][_0xbd69('0x1b')]);}})[_0xbd69('0x1d')](function(_0x1527f5){logger[_0xbd69('0x1a')](_0xbd69('0x15'),_0x110e1e,_0x1527f5);_0x1fbd0a(_0x1527f5);});});}exports[_0xbd69('0x1e')]=function(_0x2e32ea){var _0x55141e=this;return new Promise(function(_0x40bea3,_0x5d91b0){return db['User'][_0xbd69('0x1f')]({'raw':_0x2e32ea[_0xbd69('0x20')]?_0x2e32ea['options'][_0xbd69('0x21')]===undefined?!![]:![]:!![],'where':_0x2e32ea['options']?_0x2e32ea[_0xbd69('0x20')][_0xbd69('0x22')]||null:null,'attributes':_0x2e32ea['options']?_0x2e32ea['options']['attributes']||null:null,'limit':_0x2e32ea['options']?_0x2e32ea[_0xbd69('0x20')]['limit']||null:null,'include':_0x2e32ea['options']?_0x2e32ea['options'][_0xbd69('0x23')]?_['map'](_0x2e32ea[_0xbd69('0x20')]['include'],function(_0x2691f1){return{'model':db[_0x2691f1[_0xbd69('0x24')]],'as':_0x2691f1['as'],'attributes':_0x2691f1[_0xbd69('0x25')],'include':_0x2691f1[_0xbd69('0x23')]?_[_0xbd69('0x26')](_0x2691f1[_0xbd69('0x23')],function(_0x4415b7){return{'model':db[_0x4415b7[_0xbd69('0x24')]],'as':_0x4415b7['as'],'attributes':_0x4415b7[_0xbd69('0x25')],'include':_0x4415b7[_0xbd69('0x23')]?_[_0xbd69('0x26')](_0x4415b7[_0xbd69('0x23')],function(_0x3d5181){return{'model':db[_0x3d5181[_0xbd69('0x24')]],'as':_0x3d5181['as'],'attributes':_0x3d5181['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd69('0x13')](function(_0x52250f){logger[_0xbd69('0x14')](_0xbd69('0x1e'),_0x2e32ea);logger['debug'](_0xbd69('0x1e'),_0x2e32ea,JSON['stringify'](_0x52250f));_0x40bea3(_0x52250f);})[_0xbd69('0x1d')](function(_0x436a5f){logger[_0xbd69('0x1a')](_0xbd69('0x1e'),_0x436a5f[_0xbd69('0x1b')],_0x2e32ea);_0x5d91b0(_0x55141e[_0xbd69('0x1a')](0x1f4,_0x436a5f[_0xbd69('0x1b')]));});});};exports[_0xbd69('0x27')]=function(_0x59e2d2){var _0x3008e0=this;return new Promise(function(_0x32ca30,_0x1a5639){return db[_0xbd69('0x28')][_0xbd69('0x29')]({'raw':_0x59e2d2['options']?_0x59e2d2['options'][_0xbd69('0x21')]===undefined?!![]:![]:!![],'where':_0x59e2d2[_0xbd69('0x20')]?_0x59e2d2[_0xbd69('0x20')]['where']||null:null,'attributes':_0x59e2d2[_0xbd69('0x20')]?_0x59e2d2['options'][_0xbd69('0x25')]||null:null,'include':_0x59e2d2[_0xbd69('0x20')]?_0x59e2d2[_0xbd69('0x20')][_0xbd69('0x23')]?_[_0xbd69('0x26')](_0x59e2d2[_0xbd69('0x20')]['include'],function(_0x291325){return{'model':db[_0x291325[_0xbd69('0x24')]],'as':_0x291325['as'],'attributes':_0x291325[_0xbd69('0x25')],'include':_0x291325[_0xbd69('0x23')]?_[_0xbd69('0x26')](_0x291325[_0xbd69('0x23')],function(_0x4decfe){return{'model':db[_0x4decfe[_0xbd69('0x24')]],'as':_0x4decfe['as'],'attributes':_0x4decfe['attributes'],'include':_0x4decfe[_0xbd69('0x23')]?_[_0xbd69('0x26')](_0x4decfe[_0xbd69('0x23')],function(_0x5006e5){return{'model':db[_0x5006e5[_0xbd69('0x24')]],'as':_0x5006e5['as'],'attributes':_0x5006e5[_0xbd69('0x25')]};}):[]};}):[]};}):[]:[]})[_0xbd69('0x13')](function(_0x33f796){logger[_0xbd69('0x14')](_0xbd69('0x27'),_0x59e2d2);logger[_0xbd69('0x17')](_0xbd69('0x27'),_0x59e2d2,JSON[_0xbd69('0x19')](_0x33f796));_0x32ca30(_0x33f796);})['catch'](function(_0x308861){logger[_0xbd69('0x1a')](_0xbd69('0x27'),_0x308861[_0xbd69('0x1b')],_0x59e2d2);_0x1a5639(_0x3008e0[_0xbd69('0x1a')](0x1f4,_0x308861[_0xbd69('0x1b')]));});});};exports[_0xbd69('0x2a')]=function(_0x184b66){var _0x5248bf=this;return new Promise(function(_0x29e49f,_0x1cfe70){var _0x35b1e8;return db[_0xbd69('0x28')][_0xbd69('0x29')]({'where':_0x184b66[_0xbd69('0x20')][_0xbd69('0x22')]||{},'attributes':['id',_0xbd69('0x2b'),_0xbd69('0x2c'),_0xbd69('0x2d'),'interface']})[_0xbd69('0x13')](function(_0x346659){if(_0x346659){_0x35b1e8=_0x346659;return db['UserVoiceQueueRt'][_0xbd69('0x2e')]({'paused':0x1},{'where':{'UserId':_0x35b1e8['id']},'individualHooks':!![]});}})[_0xbd69('0x13')](function(){if(_0x35b1e8){return db[_0xbd69('0x2f')][_0xbd69('0x1f')]({'where':{'membername':_0x35b1e8[_0xbd69('0x2b')],'type':_0xbd69('0x30'),'exitAt':null}});}})['then'](function(_0x33f0ed){if(_0x35b1e8){if(_0x33f0ed&&_0x33f0ed[_0xbd69('0x31')]){var _0x2c9b05=moment()['format'](_0xbd69('0x32'));for(var _0x33cf77=0x0,_0x1b6c36=_0x33f0ed[_0xbd69('0x31')];_0x33cf77<_0x1b6c36;_0x33cf77++){_0x33f0ed[_0x33cf77][_0xbd69('0x33')]({'exitAt':_0x2c9b05});}}}})[_0xbd69('0x13')](function(){if(_0x35b1e8){var _0x4962f0=[];var _0x18419a=utils['getChannels']();_0x18419a[_0xbd69('0x34')](function(_0x301a9c){_0x4962f0[_0xbd69('0x35')]({'channel':_0x301a9c,'membername':_0x35b1e8[_0xbd69('0x2b')],'interface':_[_0xbd69('0x36')](_0x35b1e8[_0xbd69('0x37')])?util['format'](_0xbd69('0x38'),_0x35b1e8[_0xbd69('0x2b')]):_0x35b1e8['interface'],'type':'PAUSE','enterAt':moment()['format'](_0xbd69('0x32')),'data1':_0x184b66[_0xbd69('0x39')][_0xbd69('0x3a')]||_0xbd69('0x3b'),'role':_0x35b1e8[_0xbd69('0x2c')],'internal':_0x35b1e8[_0xbd69('0x2d')],'uniqueid':_0x184b66[_0xbd69('0x39')][_0xbd69('0x3c')]||null});});return db[_0xbd69('0x2f')]['bulkCreate'](_0x4962f0,{'individualHooks':!![]});}})[_0xbd69('0x13')](function(){if(_0x35b1e8){return _0x35b1e8['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x184b66[_0xbd69('0x39')][_0xbd69('0x3a')]||_0xbd69('0x3b'),'lastPauseAt':moment()[_0xbd69('0x3d')](_0xbd69('0x32'))});}})[_0xbd69('0x13')](function(_0x22a350){_0x29e49f(_0x22a350);})[_0xbd69('0x1d')](function(_0x2c6fd4){_0x1cfe70(_0x5248bf[_0xbd69('0x1a')](0x1f4,_0x2c6fd4[_0xbd69('0x1b')]));});});};exports[_0xbd69('0x3e')]=function(_0x29c099){var _0x21aa6d=this;return new Promise(function(_0x3dc2d2,_0x334b81){var _0x7a39a0;return db[_0xbd69('0x28')]['findOne']({'where':_0x29c099[_0xbd69('0x20')][_0xbd69('0x22')]||{},'attributes':['id','name']})[_0xbd69('0x13')](function(_0x2c72b){if(_0x2c72b){_0x7a39a0=_0x2c72b;if(_0x29c099[_0xbd69('0x39')][_0xbd69('0x3f')]&&!utils[_0xbd69('0x40')](_0x29c099[_0xbd69('0x39')][_0xbd69('0x3f')])){throw new Error(_0xbd69('0x41'));}switch(_0x29c099['body']['channel']){case _0xbd69('0x42'):return db[_0xbd69('0x43')][_0xbd69('0x2e')]({'paused':0x0},{'where':{'UserId':_0x7a39a0['id']}})[_0xbd69('0x13')](function(){return db['MemberReport']['find']({'where':{'channel':_0x29c099[_0xbd69('0x39')]['channel'],'membername':_0x7a39a0[_0xbd69('0x2b')],'type':_0xbd69('0x30'),'exitAt':null}});})[_0xbd69('0x13')](function(_0x3df026){if(_0x3df026){return _0x3df026[_0xbd69('0x2e')]({'exitAt':moment()[_0xbd69('0x3d')](_0xbd69('0x32')),'data2':_0xbd69('0x44')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x7a39a0[_0xbd69('0x2e')]({'voicePause':![]});});case _0xbd69('0x45'):case _0xbd69('0x46'):case _0xbd69('0x47'):case _0xbd69('0x48'):case _0xbd69('0x49'):case _0xbd69('0x4a'):return db[_0xbd69('0x2f')][_0xbd69('0x29')]({'where':{'channel':_0x29c099['body'][_0xbd69('0x3f')],'membername':_0x7a39a0[_0xbd69('0x2b')],'type':'PAUSE','exitAt':null}})['then'](function(_0x42b5dd){return _0x42b5dd['update']({'exitAt':moment()[_0xbd69('0x3d')](_0xbd69('0x32')),'data2':_0xbd69('0x44')},{'individualHooks':!![]});})[_0xbd69('0x13')](function(){var _0x5931e6={};_[_0xbd69('0x4b')](_0x5931e6,util[_0xbd69('0x3d')](_0xbd69('0x4c'),_0x29c099[_0xbd69('0x39')][_0xbd69('0x3f')],_0xbd69('0x4d')),![]);return _0x7a39a0['update'](_0x5931e6);});default:return db[_0xbd69('0x43')][_0xbd69('0x2e')]({'paused':0x0},{'where':{'UserId':_0x7a39a0['id']}})[_0xbd69('0x13')](function(){return db[_0xbd69('0x2f')]['findAll']({'where':{'membername':_0x7a39a0[_0xbd69('0x2b')],'type':_0xbd69('0x30'),'exitAt':null}});})['then'](function(_0x1fda24){var _0x1f4550=[];_0x1fda24[_0xbd69('0x34')](function(_0x2e4ad8){_0x1f4550[_0xbd69('0x35')](_0x2e4ad8[_0xbd69('0x2e')]({'exitAt':moment()['format'](_0xbd69('0x32')),'data2':_0xbd69('0x44')}));});return BPromise[_0xbd69('0x4e')](_0x1f4550);})[_0xbd69('0x13')](function(){return _0x7a39a0[_0xbd69('0x2e')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xbd69('0x13')](function(_0x183f7b){_0x3dc2d2(_0x183f7b);})['catch'](function(_0x1bafaa){_0x334b81(_0x21aa6d[_0xbd69('0x1a')](0x1f4,_0x1bafaa['message']));});});};exports['LogoutUser']=function(_0x1a046a){var _0x4585ee=this;return new Promise(function(_0x6faff0,_0x36c6c0){var _0x4739cd;return db['User'][_0xbd69('0x4f')]({'where':_0x1a046a[_0xbd69('0x20')]['where']||{},'attributes':['id',_0xbd69('0x2b')]})[_0xbd69('0x13')](function(_0xf9c86b){if(_0xf9c86b){_0x4739cd=_0xf9c86b;return db[_0xbd69('0x43')]['destroy']({'where':{'membername':_0x4739cd[_0xbd69('0x2b')]},'individualHooks':!![]});}})[_0xbd69('0x13')](function(){if(_0x4739cd){return db['MemberReport'][_0xbd69('0x1f')]({'where':{'membername':_0x4739cd[_0xbd69('0x2b')],'exitAt':null}});}})[_0xbd69('0x13')](function(_0x11ab9e){if(_0x4739cd){if(_0x11ab9e&&_0x11ab9e[_0xbd69('0x31')]){var _0x1878f9=[];_0x11ab9e[_0xbd69('0x34')](function(_0x51a107){_0x1878f9[_0xbd69('0x35')](_0x51a107[_0xbd69('0x2e')]({'exitAt':moment()[_0xbd69('0x3d')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xbd69('0x4e')](_0x1878f9);}}})[_0xbd69('0x13')](function(){if(_0x4739cd){return _0x4739cd[_0xbd69('0x2e')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xbd69('0x13')](function(_0x53b8f9){_0x6faff0(_0x53b8f9);})[_0xbd69('0x1d')](function(_0x1ecaff){_0x36c6c0(_0x4585ee[_0xbd69('0x1a')](0x1f4,_0x1ecaff[_0xbd69('0x1b')]));});});};exports[_0xbd69('0x50')]=function(_0x734a09){var _0x1755f0=this;return new Promise(function(_0x256651,_0x5145ad){var _0x51c5c9;var _0x3a8d40;var _0x417ab4;var _0x45e3ab;return db[_0xbd69('0x28')]['findOne']({'where':_0x734a09[_0xbd69('0x20')][_0xbd69('0x22')]||{},'attributes':['id','name',_0xbd69('0x2c'),_0xbd69('0x51'),'phone',_0xbd69('0x2d'),_0xbd69('0x52'),_0xbd69('0x37')]})['then'](function(_0x3acad9){if(_0x3acad9){_0x51c5c9=_0x3acad9;_0x45e3ab=_0x734a09[_0xbd69('0x39')][_0xbd69('0x37')]?_0x734a09[_0xbd69('0x39')]['interface']:util['format']('SIP/%s',_0x51c5c9[_0xbd69('0x2b')]);return db['User'][_0xbd69('0x53')]({'where':{'role':_0xbd69('0x54'),'online':!![],'id':{'$ne':_0x51c5c9['id']}}});}})[_0xbd69('0x13')](function(_0x460702){if(_0x460702){_0x417ab4=_0x460702;return require(_0xbd69('0x55'))['getLicense']();}})[_0xbd69('0x13')](function(_0x18799b){if(_0x18799b&&_0x18799b[_0xbd69('0x56')]&&_0x417ab4>=_0x18799b['agents']){throw new Error(_0xbd69('0x57'));}})[_0xbd69('0x13')](function(){if(_0x51c5c9){return db[_0xbd69('0x43')]['destroy']({'where':{'membername':_0x51c5c9[_0xbd69('0x2b')]},'individualHooks':!![]});}})[_0xbd69('0x13')](function(){if(_0x51c5c9){return _0x51c5c9[_0xbd69('0x58')]({'raw':!![]});}})[_0xbd69('0x13')](function(_0x26ba33){if(_0x51c5c9){if(_0x26ba33){var _0x1576d7=[];_0x3a8d40=_0x26ba33;if(_0x3a8d40[_0xbd69('0x31')]){for(var _0x35fa38=0x0;_0x35fa38<_0x3a8d40[_0xbd69('0x31')];_0x35fa38++){_0x1576d7[_0xbd69('0x35')](db[_0xbd69('0x43')]['upsert']({'membername':_0x51c5c9[_0xbd69('0x2b')],'UserId':_0x51c5c9['id'],'queue_name':_0x3a8d40[_0x35fa38][_0xbd69('0x2b')],'VoiceQueueId':_0x3a8d40[_0x35fa38]['id'],'interface':_0x45e3ab,'paused':_0x51c5c9[_0xbd69('0x52')]||![],'penalty':_0x3a8d40[_0x35fa38]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbd69('0x4e')](_0x1576d7);}}}})[_0xbd69('0x13')](function(){if(_0x51c5c9){return db[_0xbd69('0x2f')][_0xbd69('0x1f')]({'where':{'membername':_0x51c5c9['name'],'exitAt':null}});}})[_0xbd69('0x13')](function(_0x7fda9b){if(_0x51c5c9){if(_0x7fda9b&&_0x7fda9b[_0xbd69('0x31')]){var _0x572541=[];_0x7fda9b['forEach'](function(_0x1f96b1){_0x572541['push'](_0x1f96b1[_0xbd69('0x2e')]({'exitAt':moment()[_0xbd69('0x3d')](_0xbd69('0x32'))}));});return BPromise['all'](_0x572541);}}})['then'](function(_0x1a6d6a){if(_0x51c5c9){var _0x3bd5c1=[];var _0x36415e=[];var _0x49e7a9=utils[_0xbd69('0x59')]();var _0x363391={'membername':_0x51c5c9[_0xbd69('0x2b')],'interface':_0x45e3ab,'enterAt':moment()[_0xbd69('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x51c5c9[_0xbd69('0x2c')],'internal':_0x51c5c9[_0xbd69('0x2d')]};_0x49e7a9[_0xbd69('0x34')](function(_0x4d7a8d){_0x3bd5c1[_0xbd69('0x35')](_[_0xbd69('0x5a')]({'channel':_0x4d7a8d,'type':_0xbd69('0x5b'),'data1':_0xbd69('0x5c'),'data2':_0x45e3ab},_0x363391));if(_0x51c5c9['loginInPause']){_0x36415e[_0xbd69('0x35')](_[_0xbd69('0x5a')]({'channel':_0x4d7a8d,'type':'PAUSE','data1':_0xbd69('0x5d')},_0x363391));}});return db[_0xbd69('0x2f')]['bulkCreate'](_0x3bd5c1[_0xbd69('0x5e')](_0x36415e),{'individualHooks':!![]});}})['then'](function(){if(_0x51c5c9){return _0x51c5c9[_0xbd69('0x2e')]({'online':!![],'lastLoginAt':moment()[_0xbd69('0x3d')](_0xbd69('0x32')),'voicePause':_0x51c5c9[_0xbd69('0x52')]||![],'mailPause':_0x51c5c9[_0xbd69('0x52')]||![],'chatPause':_0x51c5c9[_0xbd69('0x52')]||![],'faxPause':_0x51c5c9['loginInPause']||![],'smsPause':_0x51c5c9[_0xbd69('0x52')]||![],'openchannelPause':_0x51c5c9[_0xbd69('0x52')]||![],'pauseType':_0x51c5c9[_0xbd69('0x52')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xbd69('0x3d')](_0xbd69('0x32')),'interface':_0x45e3ab});}})[_0xbd69('0x13')](function(_0x131024){_0x256651(_0x131024);})[_0xbd69('0x1d')](function(_0x5d514b){_0x5145ad(_0x1755f0['error'](0x1f4,_0x5d514b[_0xbd69('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 468fad9..f2b8d82 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 _0x4436=['update','emit','register','length','user:','./user.events','save','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4436,0x105));var _0x6443=function(_0x373406,_0x141916){_0x373406=_0x373406-0x0;var _0x1affd2=_0x4436[_0x373406];return _0x1affd2;};'use strict';var UserEvents=require(_0x6443('0x0'));var events=[_0x6443('0x1'),_0x6443('0x2'),_0x6443('0x3')];function createListener(_0x59459c,_0x3ea228){return function(_0x1c56c2){_0x3ea228[_0x6443('0x4')](_0x59459c,_0x1c56c2);};}function removeListener(_0x4b896f,_0x3a4922){return function(){UserEvents['removeListener'](_0x4b896f,_0x3a4922);};}exports[_0x6443('0x5')]=function(_0x564fdd){for(var _0x4f48b0=0x0,_0x4056aa=events[_0x6443('0x6')];_0x4f48b0<_0x4056aa;_0x4f48b0++){var _0x46d26e=events[_0x4f48b0];var _0x5b2c65=createListener(_0x6443('0x7')+_0x46d26e,_0x564fdd);UserEvents['on'](_0x46d26e,_0x5b2c65);}}; \ No newline at end of file +var _0x4ec7=['remove','update','emit','removeListener','register','user:'];(function(_0x3ac1eb,_0x469d68){var _0x155aca=function(_0x2cfb94){while(--_0x2cfb94){_0x3ac1eb['push'](_0x3ac1eb['shift']());}};_0x155aca(++_0x469d68);}(_0x4ec7,0x1b6));var _0x74ec=function(_0x3fbce4,_0x51f0b9){_0x3fbce4=_0x3fbce4-0x0;var _0x2712d2=_0x4ec7[_0x3fbce4];return _0x2712d2;};'use strict';var UserEvents=require('./user.events');var events=['save',_0x74ec('0x0'),_0x74ec('0x1')];function createListener(_0x2cdfd3,_0x28c200){return function(_0x1751e9){_0x28c200[_0x74ec('0x2')](_0x2cdfd3,_0x1751e9);};}function removeListener(_0x3a9137,_0x212957){return function(){UserEvents[_0x74ec('0x3')](_0x3a9137,_0x212957);};}exports[_0x74ec('0x4')]=function(_0x5bbf4b){for(var _0x58be9a=0x0,_0x18300a=events['length'];_0x58be9a<_0x18300a;_0x58be9a++){var _0x471033=events[_0x58be9a];var _0xff0d58=createListener(_0x74ec('0x5')+_0x471033,_0x5bbf4b);UserEvents['on'](_0x471033,_0xff0d58);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 0d99244..8d301c1 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x43e36d,_0x528a9d){var _0x1cd6e6=function(_0x53fdd3){while(--_0x53fdd3){_0x43e36d['push'](_0x43e36d['shift']());}};_0x1cd6e6(++_0x528a9d);}(_0xe706,0xa3));var _0x6e70=function(_0x1c79a7,_0x38220e){_0x1c79a7=_0x1c79a7-0x0;var _0x4de69f=_0xe706[_0x1c79a7];return _0x4de69f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x19a83e,_0x48cceb){var _0x50a33d=function(_0x506849){while(--_0x506849){_0x19a83e['push'](_0x19a83e['shift']());}};_0x50a33d(++_0x48cceb);}(_0x70e0,0x17b));var _0x070e=function(_0xa77dfa,_0x2ac77a){_0xa77dfa=_0xa77dfa-0x0;var _0x2fdd22=_0x70e0[_0xa77dfa];return _0x2fdd22;};'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 1f5d9b5..9006424 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 _0x931b=['sequelize','exports','INTEGER'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0x931b,0x1e0));var _0xb931=function(_0x467f94,_0x1b5238){_0x467f94=_0x467f94-0x0;var _0x459ece=_0x931b[_0x467f94];return _0x459ece;};'use strict';var Sequelize=require(_0xb931('0x0'));module[_0xb931('0x1')]={'penalty':{'type':Sequelize[_0xb931('0x2')],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'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 9572cef..a429f6c 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 _0xa731=['define','UserChatQueue','user_has_chat_queues','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports'];(function(_0x70efd8,_0x5e23b8){var _0x8a4aa=function(_0x3da864){while(--_0x3da864){_0x70efd8['push'](_0x70efd8['shift']());}};_0x8a4aa(++_0x5e23b8);}(_0xa731,0x1e3));var _0x1a73=function(_0x598657,_0x1ea39a){_0x598657=_0x598657-0x0;var _0x417714=_0xa731[_0x598657];return _0x417714;};'use strict';var _=require(_0x1a73('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1a73('0x1'));var moment=require(_0x1a73('0x2'));var BPromise=require(_0x1a73('0x3'));var rp=require(_0x1a73('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1a73('0x5'));var config=require(_0x1a73('0x6'));var attributes=require(_0x1a73('0x7'));module[_0x1a73('0x8')]=function(_0x2f91c4,_0x577f8f){return _0x2f91c4[_0x1a73('0x9')](_0x1a73('0xa'),attributes,{'tableName':_0x1a73('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fd1=['UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./userChatQueue.attributes','exports','define'];(function(_0x4c722d,_0x23ac93){var _0x1e0481=function(_0x26d477){while(--_0x26d477){_0x4c722d['push'](_0x4c722d['shift']());}};_0x1e0481(++_0x23ac93);}(_0x8fd1,0x13a));var _0x18fd=function(_0x374ada,_0x27b3a5){_0x374ada=_0x374ada-0x0;var _0x449ed8=_0x8fd1[_0x374ada];return _0x449ed8;};'use strict';var _=require(_0x18fd('0x0'));var util=require('util');var logger=require(_0x18fd('0x1'))(_0x18fd('0x2'));var moment=require('moment');var BPromise=require(_0x18fd('0x3'));var rp=require(_0x18fd('0x4'));var fs=require('fs');var path=require(_0x18fd('0x5'));var rimraf=require(_0x18fd('0x6'));var config=require('../../config/environment');var attributes=require(_0x18fd('0x7'));module[_0x18fd('0x8')]=function(_0x4403d3,_0x247fa5){return _0x4403d3[_0x18fd('0x9')](_0x18fd('0xa'),attributes,{'tableName':_0x18fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index ad2b4a5..0d21085 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 _0x73f9=['client','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x48654e,_0x11fc50){var _0x5bc9a2=function(_0xcf6801){while(--_0xcf6801){_0x48654e['push'](_0x48654e['shift']());}};_0x5bc9a2(++_0x11fc50);}(_0x73f9,0x109));var _0x973f=function(_0x3feb20,_0x53493e){_0x3feb20=_0x3feb20-0x0;var _0x3d93fd=_0x73f9[_0x3feb20];return _0x3d93fd;};'use strict';var _=require(_0x973f('0x0'));var util=require(_0x973f('0x1'));var moment=require(_0x973f('0x2'));var BPromise=require(_0x973f('0x3'));var rs=require(_0x973f('0x4'));var fs=require('fs');var Redis=require(_0x973f('0x5'));var db=require(_0x973f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x973f('0x7'))(_0x973f('0x8'));var config=require(_0x973f('0x9'));var jayson=require(_0x973f('0xa'));var client=jayson[_0x973f('0xb')][_0x973f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ecdd8,_0x3e8787,_0x30a3bb){return new BPromise(function(_0x4a6627,_0x56bec1){return client['request'](_0x2ecdd8,_0x30a3bb)[_0x973f('0xd')](function(_0x2d5e4a){logger[_0x973f('0xe')](_0x973f('0xf'),_0x3e8787,_0x973f('0x10'));logger['debug'](_0x973f('0x11'),_0x3e8787,_0x973f('0x10'),JSON[_0x973f('0x12')](_0x2d5e4a));if(_0x2d5e4a['error']){if(_0x2d5e4a[_0x973f('0x13')]['code']===0x1f4){logger[_0x973f('0x13')](_0x973f('0xf'),_0x3e8787,_0x2d5e4a['error'][_0x973f('0x14')]);return _0x56bec1(_0x2d5e4a[_0x973f('0x13')][_0x973f('0x14')]);}logger[_0x973f('0x13')](_0x973f('0xf'),_0x3e8787,_0x2d5e4a['error'][_0x973f('0x14')]);return _0x4a6627(_0x2d5e4a[_0x973f('0x13')][_0x973f('0x14')]);}else{logger[_0x973f('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x3e8787,_0x973f('0x10'));_0x4a6627(_0x2d5e4a[_0x973f('0x15')][_0x973f('0x14')]);}})[_0x973f('0x16')](function(_0x2910e3){logger[_0x973f('0x13')](_0x973f('0xf'),_0x3e8787,_0x2910e3);_0x56bec1(_0x2910e3);});});} \ No newline at end of file +var _0x0c38=['message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x0c38,0xf3));var _0x80c3=function(_0x479b43,_0x5b35c0){_0x479b43=_0x479b43-0x0;var _0x31a3ad=_0x0c38[_0x479b43];return _0x31a3ad;};'use strict';var _=require(_0x80c3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x80c3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80c3('0x2'));var db=require(_0x80c3('0x3'))['db'];var utils=require(_0x80c3('0x4'));var logger=require(_0x80c3('0x5'))(_0x80c3('0x6'));var config=require(_0x80c3('0x7'));var jayson=require(_0x80c3('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d3eb5,_0x23a413,_0x2ff35e){return new BPromise(function(_0xfb7d2c,_0x2c949e){return client['request'](_0x2d3eb5,_0x2ff35e)[_0x80c3('0x9')](function(_0x20f482){logger[_0x80c3('0xa')](_0x80c3('0xb'),_0x23a413,_0x80c3('0xc'));logger['debug'](_0x80c3('0xd'),_0x23a413,_0x80c3('0xc'),JSON[_0x80c3('0xe')](_0x20f482));if(_0x20f482[_0x80c3('0xf')]){if(_0x20f482['error'][_0x80c3('0x10')]===0x1f4){logger['error'](_0x80c3('0xb'),_0x23a413,_0x20f482[_0x80c3('0xf')]['message']);return _0x2c949e(_0x20f482[_0x80c3('0xf')]['message']);}logger['error'](_0x80c3('0xb'),_0x23a413,_0x20f482[_0x80c3('0xf')]['message']);return _0xfb7d2c(_0x20f482[_0x80c3('0xf')][_0x80c3('0x11')]);}else{logger[_0x80c3('0xa')](_0x80c3('0xb'),_0x23a413,_0x80c3('0xc'));_0xfb7d2c(_0x20f482[_0x80c3('0x12')][_0x80c3('0x11')]);}})[_0x80c3('0x13')](function(_0x20e1a7){logger[_0x80c3('0xf')](_0x80c3('0xb'),_0x23a413,_0x20e1a7);_0x2c949e(_0x20e1a7);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 0ed3f12..4204e04 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5ed97f,_0x3506b){var _0x162924=function(_0x4341fc){while(--_0x4341fc){_0x5ed97f['push'](_0x5ed97f['shift']());}};_0x162924(++_0x3506b);}(_0x70e0,0x17b));var _0x070e=function(_0x1ba389,_0x85936){_0x1ba389=_0x1ba389-0x0;var _0x324416=_0x70e0[_0x1ba389];return _0x324416;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x12390d,_0x310733){var _0x1e7b3f=function(_0x31b0ed){while(--_0x31b0ed){_0x12390d['push'](_0x12390d['shift']());}};_0x1e7b3f(++_0x310733);}(_0x70e0,0x17b));var _0x070e=function(_0x399dc9,_0x38b950){_0x399dc9=_0x399dc9-0x0;var _0x23b136=_0x70e0[_0x399dc9];return _0x23b136;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 5341635..83cf77a 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 _0xe3b8=['exports','INTEGER','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3b8,0x183));var _0x8e3b=function(_0x498647,_0x33e75f){_0x498647=_0x498647-0x0;var _0x4f7cec=_0xe3b8[_0x498647];return _0x4f7cec;};'use strict';var Sequelize=require(_0x8e3b('0x0'));module[_0x8e3b('0x1')]={'penalty':{'type':Sequelize[_0x8e3b('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8e3b('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8e3b('0x3')]}}; \ No newline at end of file +var _0x3311=['INTEGER','STRING','sequelize','exports'];(function(_0x5f57e7,_0x152d2d){var _0x298bcf=function(_0x344096){while(--_0x344096){_0x5f57e7['push'](_0x5f57e7['shift']());}};_0x298bcf(++_0x152d2d);}(_0x3311,0x162));var _0x1331=function(_0x1e5763,_0x160133){_0x1e5763=_0x1e5763-0x0;var _0x779271=_0x3311[_0x1e5763];return _0x779271;};'use strict';var Sequelize=require(_0x1331('0x0'));module[_0x1331('0x1')]={'penalty':{'type':Sequelize[_0x1331('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1331('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x1331('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 27adbab..254be2d 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 _0xeefe=['bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api'];(function(_0x4d553a,_0x5de1cd){var _0xc9945b=function(_0x4220b3){while(--_0x4220b3){_0x4d553a['push'](_0x4d553a['shift']());}};_0xc9945b(++_0x5de1cd);}(_0xeefe,0x1ac));var _0xeeef=function(_0x558053,_0x5bf902){_0x558053=_0x558053-0x0;var _0xc73fe=_0xeefe[_0x558053];return _0xc73fe;};'use strict';var _=require(_0xeeef('0x0'));var util=require(_0xeeef('0x1'));var logger=require(_0xeeef('0x2'))(_0xeeef('0x3'));var moment=require('moment');var BPromise=require(_0xeeef('0x4'));var rp=require(_0xeeef('0x5'));var fs=require('fs');var path=require(_0xeeef('0x6'));var rimraf=require('rimraf');var config=require(_0xeeef('0x7'));var attributes=require(_0xeeef('0x8'));module['exports']=function(_0x31323d,_0x536da7){return _0x31323d[_0xeeef('0x9')](_0xeeef('0xa'),attributes,{'tableName':_0xeeef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80d2=['rimraf','exports','UserFaxQueue','user_has_fax_queues','lodash','util','api','bluebird','request-promise','path'];(function(_0x5bd7b6,_0x448e11){var _0x8a7ae1=function(_0x2170d5){while(--_0x2170d5){_0x5bd7b6['push'](_0x5bd7b6['shift']());}};_0x8a7ae1(++_0x448e11);}(_0x80d2,0x158));var _0x280d=function(_0x1f4e80,_0x1bd195){_0x1f4e80=_0x1f4e80-0x0;var _0x9a9c86=_0x80d2[_0x1f4e80];return _0x9a9c86;};'use strict';var _=require(_0x280d('0x0'));var util=require(_0x280d('0x1'));var logger=require('../../config/logger')(_0x280d('0x2'));var moment=require('moment');var BPromise=require(_0x280d('0x3'));var rp=require(_0x280d('0x4'));var fs=require('fs');var path=require(_0x280d('0x5'));var rimraf=require(_0x280d('0x6'));var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module[_0x280d('0x7')]=function(_0x3ef6c5,_0x3f18a){return _0x3ef6c5['define'](_0x280d('0x8'),attributes,{'tableName':_0x280d('0x9'),'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 97b0d55..86c4bd4 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 _0x34cc=['http','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x209ad0,_0x178ba3){var _0x1859dd=function(_0x592de6){while(--_0x592de6){_0x209ad0['push'](_0x209ad0['shift']());}};_0x1859dd(++_0x178ba3);}(_0x34cc,0x9d));var _0xc34c=function(_0x47991c,_0x26c6bb){_0x47991c=_0x47991c-0x0;var _0x3b010d=_0x34cc[_0x47991c];return _0x3b010d;};'use strict';var _=require('lodash');var util=require(_0xc34c('0x0'));var moment=require(_0xc34c('0x1'));var BPromise=require(_0xc34c('0x2'));var rs=require(_0xc34c('0x3'));var fs=require('fs');var Redis=require(_0xc34c('0x4'));var db=require(_0xc34c('0x5'))['db'];var utils=require(_0xc34c('0x6'));var logger=require(_0xc34c('0x7'))(_0xc34c('0x8'));var config=require('../../config/environment');var jayson=require(_0xc34c('0x9'));var client=jayson[_0xc34c('0xa')][_0xc34c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a0946,_0x1938da,_0x2d6294){return new BPromise(function(_0x493e35,_0x514a9e){return client['request'](_0x1a0946,_0x2d6294)[_0xc34c('0xc')](function(_0x4cf426){logger['info'](_0xc34c('0xd'),_0x1938da,_0xc34c('0xe'));logger[_0xc34c('0xf')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x1938da,_0xc34c('0xe'),JSON[_0xc34c('0x10')](_0x4cf426));if(_0x4cf426[_0xc34c('0x11')]){if(_0x4cf426[_0xc34c('0x11')]['code']===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x1938da,_0x4cf426[_0xc34c('0x11')][_0xc34c('0x12')]);return _0x514a9e(_0x4cf426[_0xc34c('0x11')][_0xc34c('0x12')]);}logger[_0xc34c('0x11')](_0xc34c('0xd'),_0x1938da,_0x4cf426[_0xc34c('0x11')]['message']);return _0x493e35(_0x4cf426[_0xc34c('0x11')][_0xc34c('0x12')]);}else{logger[_0xc34c('0x13')](_0xc34c('0xd'),_0x1938da,_0xc34c('0xe'));_0x493e35(_0x4cf426['result'][_0xc34c('0x12')]);}})[_0xc34c('0x14')](function(_0x4e6d00){logger[_0xc34c('0x11')](_0xc34c('0xd'),_0x1938da,_0x4e6d00);_0x514a9e(_0x4e6d00);});});} \ No newline at end of file +var _0xce8b=['request\x20sent','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0xbb7389,_0x12b29d){var _0x12537b=function(_0x42a1f9){while(--_0x42a1f9){_0xbb7389['push'](_0xbb7389['shift']());}};_0x12537b(++_0x12b29d);}(_0xce8b,0x157));var _0xbce8=function(_0x515283,_0x813dea){_0x515283=_0x515283-0x0;var _0x38f836=_0xce8b[_0x515283];return _0x38f836;};'use strict';var _=require('lodash');var util=require(_0xbce8('0x0'));var moment=require(_0xbce8('0x1'));var BPromise=require(_0xbce8('0x2'));var rs=require(_0xbce8('0x3'));var fs=require('fs');var Redis=require(_0xbce8('0x4'));var db=require(_0xbce8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbce8('0x6'))(_0xbce8('0x7'));var config=require(_0xbce8('0x8'));var jayson=require(_0xbce8('0x9'));var client=jayson[_0xbce8('0xa')][_0xbce8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7a6889,_0x368993,_0x945665){return new BPromise(function(_0x140af2,_0x2642b0){return client[_0xbce8('0xc')](_0x7a6889,_0x945665)[_0xbce8('0xd')](function(_0x19865e){logger['info'](_0xbce8('0xe'),_0x368993,'request\x20sent');logger[_0xbce8('0xf')](_0xbce8('0x10'),_0x368993,_0xbce8('0x11'),JSON[_0xbce8('0x12')](_0x19865e));if(_0x19865e[_0xbce8('0x13')]){if(_0x19865e[_0xbce8('0x13')][_0xbce8('0x14')]===0x1f4){logger['error'](_0xbce8('0xe'),_0x368993,_0x19865e[_0xbce8('0x13')][_0xbce8('0x15')]);return _0x2642b0(_0x19865e[_0xbce8('0x13')][_0xbce8('0x15')]);}logger[_0xbce8('0x13')](_0xbce8('0xe'),_0x368993,_0x19865e[_0xbce8('0x13')][_0xbce8('0x15')]);return _0x140af2(_0x19865e[_0xbce8('0x13')][_0xbce8('0x15')]);}else{logger[_0xbce8('0x16')](_0xbce8('0xe'),_0x368993,_0xbce8('0x11'));_0x140af2(_0x19865e[_0xbce8('0x17')][_0xbce8('0x15')]);}})['catch'](function(_0x3fc461){logger[_0xbce8('0x13')](_0xbce8('0xe'),_0x368993,_0x3fc461);_0x2642b0(_0x3fc461);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index a2fbbda..08415ce 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x51be7f,_0xd159f3){var _0x58f88c=function(_0x29c5d7){while(--_0x29c5d7){_0x51be7f['push'](_0x51be7f['shift']());}};_0x58f88c(++_0xd159f3);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5f5079,_0xa7acce){var _0x232086=function(_0x5ed517){while(--_0x5ed517){_0x5f5079['push'](_0x5f5079['shift']());}};_0x232086(++_0xa7acce);}(_0xe706,0xa3));var _0x6e70=function(_0xfa2f68,_0x23836e){_0xfa2f68=_0xfa2f68-0x0;var _0x252d9a=_0xe706[_0xfa2f68];return _0x252d9a;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 63330f0..e1c9157 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 _0x58fb=['INTEGER','sequelize'];(function(_0x40be86,_0x68fe5d){var _0xda3c3b=function(_0x39deab){while(--_0x39deab){_0x40be86['push'](_0x40be86['shift']());}};_0xda3c3b(++_0x68fe5d);}(_0x58fb,0xef));var _0xb58f=function(_0x26ae57,_0x58d5f6){_0x26ae57=_0x26ae57-0x0;var _0x21efd9=_0x58fb[_0x26ae57];return _0x21efd9;};'use strict';var Sequelize=require(_0xb58f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xb58f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x542d=['INTEGER','exports'];(function(_0x2d093a,_0x7a6ed0){var _0x3a7db6=function(_0x5c5bcb){while(--_0x5c5bcb){_0x2d093a['push'](_0x2d093a['shift']());}};_0x3a7db6(++_0x7a6ed0);}(_0x542d,0x12f));var _0xd542=function(_0x5f54eb,_0x3ecebe){_0x5f54eb=_0x5f54eb-0x0;var _0x4a40b4=_0x542d[_0x5f54eb];return _0x4a40b4;};'use strict';var Sequelize=require('sequelize');module[_0xd542('0x0')]={'penalty':{'type':Sequelize[_0xd542('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 081c09b..af0cee1 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 _0x1558=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash'];(function(_0x2a5c01,_0x1d4a70){var _0xa07bf0=function(_0x518c1d){while(--_0x518c1d){_0x2a5c01['push'](_0x2a5c01['shift']());}};_0xa07bf0(++_0x1d4a70);}(_0x1558,0xfb));var _0x8155=function(_0x4c7149,_0x335342){_0x4c7149=_0x4c7149-0x0;var _0x200122=_0x1558[_0x4c7149];return _0x200122;};'use strict';var _=require(_0x8155('0x0'));var util=require(_0x8155('0x1'));var logger=require(_0x8155('0x2'))(_0x8155('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8155('0x4'));var fs=require('fs');var path=require(_0x8155('0x5'));var rimraf=require(_0x8155('0x6'));var config=require(_0x8155('0x7'));var attributes=require(_0x8155('0x8'));module[_0x8155('0x9')]=function(_0x10af94,_0x51ed3e){return _0x10af94[_0x8155('0xa')](_0x8155('0xb'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6aa=['UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','define'];(function(_0x138585,_0x45b088){var _0x58894f=function(_0x338021){while(--_0x338021){_0x138585['push'](_0x138585['shift']());}};_0x58894f(++_0x45b088);}(_0xe6aa,0x1d6));var _0xae6a=function(_0x53d8b5,_0x43fd53){_0x53d8b5=_0x53d8b5-0x0;var _0x5c8ec2=_0xe6aa[_0x53d8b5];return _0x5c8ec2;};'use strict';var _=require(_0xae6a('0x0'));var util=require(_0xae6a('0x1'));var logger=require(_0xae6a('0x2'))('api');var moment=require(_0xae6a('0x3'));var BPromise=require(_0xae6a('0x4'));var rp=require(_0xae6a('0x5'));var fs=require('fs');var path=require(_0xae6a('0x6'));var rimraf=require(_0xae6a('0x7'));var config=require(_0xae6a('0x8'));var attributes=require(_0xae6a('0x9'));module['exports']=function(_0x43af53,_0x1aac60){return _0x43af53[_0xae6a('0xa')](_0xae6a('0xb'),attributes,{'tableName':_0xae6a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 1c74541..fb363dc 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x469bff,_0x2aad22){var _0x47bff2=function(_0x59025e){while(--_0x59025e){_0x469bff['push'](_0x469bff['shift']());}};_0x47bff2(++_0x2aad22);}(_0x4b84,0x1cc));var _0x44b8=function(_0x82140,_0x3a9d87){_0x82140=_0x82140-0x0;var _0x2b15a6=_0x4b84[_0x82140];return _0x2b15a6;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ No newline at end of file +var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x13815a,_0x50e9a5){var _0x57546b=function(_0x426b37){while(--_0x426b37){_0x13815a['push'](_0x13815a['shift']());}};_0x57546b(++_0x50e9a5);}(_0x55ca,0x126));var _0xa55c=function(_0x3f6bab,_0x47fdb0){_0x3f6bab=_0x3f6bab-0x0;var _0x26d34b=_0x55ca[_0x3f6bab];return _0x26d34b;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 0fa0ba7..690980f 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 _0xc7e2=['sendUserNotification','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','post'];(function(_0x1f0da6,_0x6b2bfb){var _0x46a94d=function(_0x2680ee){while(--_0x2680ee){_0x1f0da6['push'](_0x1f0da6['shift']());}};_0x46a94d(++_0x6b2bfb);}(_0xc7e2,0xd4));var _0x2c7e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7e2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2c7e('0x0'));var util=require(_0x2c7e('0x1'));var path=require('path');var timeout=require(_0x2c7e('0x2'));var express=require('express');var router=express[_0x2c7e('0x3')]();var fs_extra=require(_0x2c7e('0x4'));var auth=require(_0x2c7e('0x5'));var interaction=require(_0x2c7e('0x6'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0x2c7e('0x7')]('/',auth['isAuthenticated'](),controller[_0x2c7e('0x8')]);module[_0x2c7e('0x9')]=router; \ No newline at end of file +var _0x8f97=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4c7f15,_0x36f85e){var _0xaa7d33=function(_0x215bfe){while(--_0x215bfe){_0x4c7f15['push'](_0x4c7f15['shift']());}};_0xaa7d33(++_0x36f85e);}(_0x8f97,0x159));var _0x78f9=function(_0x4b075e,_0x57874c){_0x4b075e=_0x4b075e-0x0;var _0x31385c=_0x8f97[_0x4b075e];return _0x31385c;};'use strict';var multer=require(_0x78f9('0x0'));var util=require(_0x78f9('0x1'));var path=require(_0x78f9('0x2'));var timeout=require(_0x78f9('0x3'));var express=require(_0x78f9('0x4'));var router=express[_0x78f9('0x5')]();var fs_extra=require(_0x78f9('0x6'));var auth=require(_0x78f9('0x7'));var interaction=require(_0x78f9('0x8'));var config=require(_0x78f9('0x9'));var controller=require(_0x78f9('0xa'));router['post']('/',auth[_0x78f9('0xb')](),controller['sendUserNotification']);module[_0x78f9('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 8b4e2bc..c4a2a5a 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 _0x4a90=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x374782,_0x58d702){var _0x4ca8e5=function(_0x586754){while(--_0x586754){_0x374782['push'](_0x374782['shift']());}};_0x4ca8e5(++_0x58d702);}(_0x4a90,0x1d3));var _0x04a9=function(_0x39e4d4,_0x3fe3a3){_0x39e4d4=_0x39e4d4-0x0;var _0x4a050c=_0x4a90[_0x39e4d4];return _0x4a050c;};'use strict';var Sequelize=require(_0x04a9('0x0'));module[_0x04a9('0x1')]={'body':{'type':Sequelize[_0x04a9('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x04a9('0x3')]},'beep':{'type':Sequelize[_0x04a9('0x4')]}}; \ No newline at end of file +var _0x8b3c=['STRING','sequelize','exports','TEXT'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8b3c,0x105));var _0xc8b3=function(_0x439d59,_0x11ccdf){_0x439d59=_0x439d59-0x0;var _0x3670c7=_0x8b3c[_0x439d59];return _0x3670c7;};'use strict';var Sequelize=require(_0xc8b3('0x0'));module[_0xc8b3('0x1')]={'body':{'type':Sequelize[_0xc8b3('0x2')]},'senderName':{'type':Sequelize[_0xc8b3('0x3')]},'recipientsId':{'type':Sequelize[_0xc8b3('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index b8ee1b0..46309b7 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 _0xabf4=['../../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','register','status','end','json','offset','undefined','count','limit','apply','save','update','then','destroy','sendStatus','name','send','sendUserNotification','body','text','TemplateId','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','hasOwnProperty','view','Sequelize','ValidationError','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','User','union','ids','includes','queue','replace','Queue','push','all','flatten','findOne','getAgents','map','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xabf4,0x12b));var _0x4abf=function(_0x5edddd,_0x55f252){_0x5edddd=_0x5edddd-0x0;var _0x269e2b=_0xabf4[_0x5edddd];return _0x269e2b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4abf('0x0'));var rp=require(_0x4abf('0x1'));var moment=require(_0x4abf('0x2'));var BPromise=require(_0x4abf('0x3'));var Mustache=require(_0x4abf('0x4'));var util=require(_0x4abf('0x5'));var path=require(_0x4abf('0x6'));var sox=require(_0x4abf('0x7'));var csv=require('to-csv');var ejs=require(_0x4abf('0x8'));var fs=require('fs');var fs_extra=require(_0x4abf('0x9'));var _=require(_0x4abf('0xa'));var squel=require(_0x4abf('0xb'));var crypto=require(_0x4abf('0xc'));var jsforce=require(_0x4abf('0xd'));var deskjs=require(_0x4abf('0xe'));var toCsv=require(_0x4abf('0xf'));var querystring=require(_0x4abf('0x10'));var Papa=require(_0x4abf('0x11'));var Redis=require('ioredis');var authService=require(_0x4abf('0x12'));var qs=require(_0x4abf('0x13'));var as=require(_0x4abf('0x14'));var hardwareService=require(_0x4abf('0x15'));var logger=require(_0x4abf('0x16'))(_0x4abf('0x17'));var utils=require(_0x4abf('0x18'));var config=require(_0x4abf('0x19'));var licenseUtil=require(_0x4abf('0x1a'));var db=require(_0x4abf('0x1b'))['db'];config[_0x4abf('0x1c')]=_[_0x4abf('0x1d')](config[_0x4abf('0x1c')],{'host':_0x4abf('0x1e'),'port':0x18eb});var socket=require(_0x4abf('0x1f'))(new Redis(config[_0x4abf('0x1c')]));require('./userNotification.socket')[_0x4abf('0x20')](socket);function respondWithStatusCode(_0x213ee1,_0x29574d){_0x29574d=_0x29574d||0xcc;return function(_0xd43231){if(_0xd43231){return _0x213ee1['sendStatus'](_0x29574d);}return _0x213ee1[_0x4abf('0x21')](_0x29574d)[_0x4abf('0x22')]();};}function respondWithResult(_0x425580,_0x39d9f2){_0x39d9f2=_0x39d9f2||0xc8;return function(_0x551f93){if(_0x551f93){return _0x425580[_0x4abf('0x21')](_0x39d9f2)[_0x4abf('0x23')](_0x551f93);}};}function respondWithFilteredResult(_0x1fd4d0,_0x28c802){return function(_0x399c71){if(_0x399c71){var _0x4cbffa=typeof _0x28c802[_0x4abf('0x24')]===_0x4abf('0x25')&&typeof _0x28c802['limit']===_0x4abf('0x25');var _0x97dea0=_0x399c71[_0x4abf('0x26')];var _0x263ae2=_0x4cbffa?0x0:_0x28c802[_0x4abf('0x24')];var _0x1851a7=_0x4cbffa?_0x399c71[_0x4abf('0x26')]:_0x28c802[_0x4abf('0x24')]+_0x28c802[_0x4abf('0x27')];var _0x3fb8c6;if(_0x1851a7>=_0x97dea0){_0x1851a7=_0x97dea0;_0x3fb8c6=0xc8;}else{_0x3fb8c6=0xce;}_0x1fd4d0[_0x4abf('0x21')](_0x3fb8c6);return _0x1fd4d0['set']('Content-Range',_0x263ae2+'-'+_0x1851a7+'/'+_0x97dea0)[_0x4abf('0x23')](_0x399c71);}return null;};}function patchUpdates(_0x1c7be3){return function(_0x4eb196){try{jsonpatch[_0x4abf('0x28')](_0x4eb196,_0x1c7be3,!![]);}catch(_0x29aef5){return BPromise['reject'](_0x29aef5);}return _0x4eb196[_0x4abf('0x29')]();};}function saveUpdates(_0x4afeab,_0x4e6393){return function(_0x9d8bf3){if(_0x9d8bf3){return _0x9d8bf3[_0x4abf('0x2a')](_0x4afeab)[_0x4abf('0x2b')](function(_0x1ab87d){return _0x1ab87d;});}return null;};}function removeEntity(_0x48d1ff,_0x52fe22){return function(_0x118f88){if(_0x118f88){return _0x118f88[_0x4abf('0x2c')]()[_0x4abf('0x2b')](function(){_0x48d1ff[_0x4abf('0x21')](0xcc)[_0x4abf('0x22')]();});}};}function handleEntityNotFound(_0x39a7a7,_0x2887b0){return function(_0x463870){if(!_0x463870){_0x39a7a7[_0x4abf('0x2d')](0x194);}return _0x463870;};}function handleError(_0x3c7990,_0x1d44eb){_0x1d44eb=_0x1d44eb||0x1f4;return function(_0x380fe0){logger['error'](_0x380fe0['stack']);if(_0x380fe0['name']){delete _0x380fe0[_0x4abf('0x2e')];}_0x3c7990[_0x4abf('0x21')](_0x1d44eb)[_0x4abf('0x2f')](_0x380fe0);};}exports[_0x4abf('0x30')]=function(_0x5a3fcd,_0x7a48df,_0x59735c){if(!_0x5a3fcd[_0x4abf('0x31')]['hasOwnProperty'](_0x4abf('0x32'))&&!_0x5a3fcd[_0x4abf('0x31')]['hasOwnProperty'](_0x4abf('0x33'))){throw new db['Sequelize']['ValidationError'](_0x4abf('0x34'));}else{if(_0x5a3fcd[_0x4abf('0x31')][_0x4abf('0x35')](_0x4abf('0x33'))&&!_0x5a3fcd['body'][_0x4abf('0x35')](_0x4abf('0x36'))){throw new db[(_0x4abf('0x37'))][(_0x4abf('0x38'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x5a3fcd['body']['hasOwnProperty'](_0x4abf('0x39'))){throw new db['Sequelize']['ValidationError'](_0x4abf('0x3a'));}else{try{var _0x43942d=JSON[_0x4abf('0x3b')](_0x5a3fcd[_0x4abf('0x31')]['recipients']);}catch(_0x444fbe){logger[_0x4abf('0x3c')](_0x444fbe);throw new db['Sequelize'][(_0x4abf('0x38'))](_0x4abf('0x3d'));}var _0x58e0a2=[_0x4abf('0x3e'),_0x4abf('0x3f'),_0x4abf('0x40'),_0x4abf('0x41'),_0x4abf('0x42'),_0x4abf('0x43'),_0x4abf('0x44'),'team',_0x4abf('0x45')];if(_[_0x4abf('0x46')](_0x43942d,function(_0x497ef1){return!_['includes'](_0x58e0a2,_0x497ef1[_0x4abf('0x47')][_0x4abf('0x48')]());})){throw new db[(_0x4abf('0x37'))][(_0x4abf('0x38'))](_0x4abf('0x49'));}}}var _0x38839d={};_0x38839d[_0x4abf('0x4a')]=_0x5a3fcd['body'][_0x4abf('0x35')](_0x4abf('0x4a'))?_0x5a3fcd[_0x4abf('0x31')][_0x4abf('0x4a')]:_0x5a3fcd['user'][_0x4abf('0x4b')];_0x38839d[_0x4abf('0x4c')]=_['isEmpty'](_0x5a3fcd[_0x4abf('0x31')][_0x4abf('0x4c')])?null:_0x5a3fcd[_0x4abf('0x31')][_0x4abf('0x4c')];_0x38839d[_0x4abf('0x4d')]=_0x5a3fcd[_0x4abf('0x31')][_0x4abf('0x4d')]||![];_0x38839d[_0x4abf('0x4e')]=_0x5a3fcd[_0x4abf('0x45')]['id'];return getContent(_0x5a3fcd[_0x4abf('0x31')])[_0x4abf('0x2b')](function(_0x48bc68){_0x38839d[_0x4abf('0x31')]=_0x48bc68;return getRecipients(_0x43942d);})[_0x4abf('0x2b')](function(_0x2d10bd){_0x38839d[_0x4abf('0x4f')]=_[_0x4abf('0x50')](_0x2d10bd)[_0x4abf('0x51')](',');return db[_0x4abf('0x52')][_0x4abf('0x53')](function(_0x5a21fb){return db[_0x4abf('0x54')]['create'](_0x38839d,{'raw':!![],'transaction':_0x5a21fb})[_0x4abf('0x2b')](function(_0x55be4c){var _0x89827b={'sender':_0x38839d[_0x4abf('0x4a')],'description':_0x38839d[_0x4abf('0x4c')],'content':_0x38839d['body'],'beep':_0x38839d[_0x4abf('0x4d')]};_0x2d10bd[_0x4abf('0x55')](function(_0x4f6fd8){_0x89827b[_0x4abf('0x56')]=_0x4f6fd8;socket[_0x4abf('0x57')](_0x4abf('0x58'),_0x89827b);});return _0x55be4c;});});})[_0x4abf('0x2b')](respondWithResult(_0x7a48df,0xc9))[_0x4abf('0x59')](handleError(_0x7a48df,null));};function getContent(_0x1a7198){return new BPromise(function(_0xaba86,_0x2c86a3){if(_0x1a7198[_0x4abf('0x32')]){_0xaba86(_0x1a7198[_0x4abf('0x32')]);return;}return db['Template']['findOne']({'attributes':[_0x4abf('0x5a')],'where':{'id':_0x1a7198[_0x4abf('0x33')]},'raw':!![]})[_0x4abf('0x2b')](function(_0xe0fd79){if(!_0xe0fd79)throw new db[(_0x4abf('0x37'))][(_0x4abf('0x38'))](_0x4abf('0x5b'));var _0x2b2aed=Mustache[_0x4abf('0x5c')](_0xe0fd79[_0x4abf('0x5a')],_0x1a7198[_0x4abf('0x36')]);_0xaba86(_0x2b2aed);})['catch'](function(_0x556ae9){_0x2c86a3(_0x556ae9);});});}function getRecipients(_0xa8e1dd){return new BPromise(function(_0x58288a,_0x629c84){var _0x3fd386=[];var _0x1f27d7=[];_0xa8e1dd[_0x4abf('0x55')](function(_0x3d1fa8){var _0x5eda70=_['startCase'](_0x3d1fa8[_0x4abf('0x47')][_0x4abf('0x48')]());if(_0x5eda70===_0x4abf('0x5d')){_0x3fd386=_[_0x4abf('0x5e')](_0x3fd386,_0x3d1fa8[_0x4abf('0x5f')]);}else{if(_[_0x4abf('0x60')](_0x5eda70,_0x4abf('0x61')))_0x5eda70=_0x5eda70[_0x4abf('0x62')](_0x4abf('0x61'),_0x4abf('0x63'));_0x3d1fa8['ids']['forEach'](function(_0x59eb9d){_0x1f27d7[_0x4abf('0x64')](getAgents(_0x5eda70,_0x59eb9d));});}});return BPromise[_0x4abf('0x65')](_0x1f27d7)[_0x4abf('0x2b')](function(_0x7a1e60){_0x3fd386=_[_0x4abf('0x5e')](_0x3fd386,_[_0x4abf('0x66')](_0x7a1e60));_0x58288a(_0x3fd386);})[_0x4abf('0x59')](function(_0x5cdbae){_0x629c84(_0x5cdbae);});});}function getAgents(_0x1957e8,_0x4a59e5){return new BPromise(function(_0x59a15d,_0x2c3833){return db[_0x1957e8][_0x4abf('0x67')]({'where':{'id':_0x4a59e5}})[_0x4abf('0x2b')](function(_0xf0b37){return _0xf0b37[_0x4abf('0x68')]({'attributes':['id'],'raw':!![]})[_0x4abf('0x2b')](function(_0x160fd7){var _0x2d5e3b=_[_0x4abf('0x69')](_0x160fd7,'id');_0x59a15d(_0x2d5e3b);});})[_0x4abf('0x59')](function(_0x4249d7){_0x2c3833(_0x4249d7);});});} \ No newline at end of file +var _0x0344=['json','offset','undefined','count','limit','set','Content-Range','reject','save','then','sendStatus','error','stack','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','mailqueue','smsqueue','voicequeue','whatsappqueue','team','user','toLowerCase','fullname','isEmpty','beep','SenderId','recipientsId','sortBy','sequelize','transaction','UserNotification','senderName','recipient','emit','userNotification:send','catch','text','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','startCase','model','union','includes','queue','replace','Queue','ids','all','getAgents','map','eml-format','rimraf','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./userNotification.socket','register','status'];(function(_0x32cba4,_0x1f6074){var _0x191477=function(_0x1adc1b){while(--_0x1adc1b){_0x32cba4['push'](_0x32cba4['shift']());}};_0x191477(++_0x1f6074);}(_0x0344,0x15b));var _0x4034=function(_0x50d5c0,_0x579e8c){_0x50d5c0=_0x50d5c0-0x0;var _0x5519fb=_0x0344[_0x50d5c0];return _0x5519fb;};'use strict';var emlformat=require(_0x4034('0x0'));var rimraf=require(_0x4034('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4034('0x2'));var Mustache=require(_0x4034('0x3'));var util=require(_0x4034('0x4'));var path=require(_0x4034('0x5'));var sox=require(_0x4034('0x6'));var csv=require(_0x4034('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4034('0x8'));var _=require('lodash');var squel=require(_0x4034('0x9'));var crypto=require('crypto');var jsforce=require(_0x4034('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4034('0xb'));var Papa=require(_0x4034('0xc'));var Redis=require(_0x4034('0xd'));var authService=require(_0x4034('0xe'));var qs=require(_0x4034('0xf'));var as=require(_0x4034('0x10'));var hardwareService=require(_0x4034('0x11'));var logger=require(_0x4034('0x12'))(_0x4034('0x13'));var utils=require(_0x4034('0x14'));var config=require(_0x4034('0x15'));var licenseUtil=require(_0x4034('0x16'));var db=require(_0x4034('0x17'))['db'];config[_0x4034('0x18')]=_['defaults'](config[_0x4034('0x18')],{'host':_0x4034('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4034('0x18')]));require(_0x4034('0x1a'))[_0x4034('0x1b')](socket);function respondWithStatusCode(_0x4b6cf6,_0x1d5cd5){_0x1d5cd5=_0x1d5cd5||0xcc;return function(_0x56316a){if(_0x56316a){return _0x4b6cf6['sendStatus'](_0x1d5cd5);}return _0x4b6cf6[_0x4034('0x1c')](_0x1d5cd5)['end']();};}function respondWithResult(_0x4a20a2,_0x151ce1){_0x151ce1=_0x151ce1||0xc8;return function(_0x190dc4){if(_0x190dc4){return _0x4a20a2[_0x4034('0x1c')](_0x151ce1)[_0x4034('0x1d')](_0x190dc4);}};}function respondWithFilteredResult(_0x3eed98,_0x5972fa){return function(_0x1613e5){if(_0x1613e5){var _0x1518f1=typeof _0x5972fa[_0x4034('0x1e')]===_0x4034('0x1f')&&typeof _0x5972fa['limit']===_0x4034('0x1f');var _0x310102=_0x1613e5['count'];var _0x47e25f=_0x1518f1?0x0:_0x5972fa['offset'];var _0x5a6287=_0x1518f1?_0x1613e5[_0x4034('0x20')]:_0x5972fa['offset']+_0x5972fa[_0x4034('0x21')];var _0x43162d;if(_0x5a6287>=_0x310102){_0x5a6287=_0x310102;_0x43162d=0xc8;}else{_0x43162d=0xce;}_0x3eed98[_0x4034('0x1c')](_0x43162d);return _0x3eed98[_0x4034('0x22')](_0x4034('0x23'),_0x47e25f+'-'+_0x5a6287+'/'+_0x310102)['json'](_0x1613e5);}return null;};}function patchUpdates(_0x2963e1){return function(_0x42e24d){try{jsonpatch['apply'](_0x42e24d,_0x2963e1,!![]);}catch(_0x2714fc){return BPromise[_0x4034('0x24')](_0x2714fc);}return _0x42e24d[_0x4034('0x25')]();};}function saveUpdates(_0x38cdd3,_0x4f34f7){return function(_0x108def){if(_0x108def){return _0x108def['update'](_0x38cdd3)[_0x4034('0x26')](function(_0x43f64c){return _0x43f64c;});}return null;};}function removeEntity(_0x301e03,_0x591f3f){return function(_0x1ba2f6){if(_0x1ba2f6){return _0x1ba2f6['destroy']()[_0x4034('0x26')](function(){_0x301e03['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23f0aa,_0x280539){return function(_0x368fea){if(!_0x368fea){_0x23f0aa[_0x4034('0x27')](0x194);}return _0x368fea;};}function handleError(_0x1c0de8,_0x487c7b){_0x487c7b=_0x487c7b||0x1f4;return function(_0x5ac28d){logger[_0x4034('0x28')](_0x5ac28d[_0x4034('0x29')]);if(_0x5ac28d[_0x4034('0x2a')]){delete _0x5ac28d[_0x4034('0x2a')];}_0x1c0de8[_0x4034('0x1c')](_0x487c7b)[_0x4034('0x2b')](_0x5ac28d);};}exports[_0x4034('0x2c')]=function(_0x4037fb,_0x2a8fbb,_0x584db7){if(!_0x4037fb[_0x4034('0x2d')][_0x4034('0x2e')]('text')&&!_0x4037fb['body']['hasOwnProperty'](_0x4034('0x2f'))){throw new db[(_0x4034('0x30'))]['ValidationError'](_0x4034('0x31'));}else{if(_0x4037fb[_0x4034('0x2d')][_0x4034('0x2e')](_0x4034('0x2f'))&&!_0x4037fb['body'][_0x4034('0x2e')](_0x4034('0x32'))){throw new db['Sequelize'][(_0x4034('0x33'))](_0x4034('0x34'));}if(!_0x4037fb[_0x4034('0x2d')][_0x4034('0x2e')](_0x4034('0x35'))){throw new db[(_0x4034('0x30'))]['ValidationError'](_0x4034('0x36'));}else{try{var _0x587527=JSON[_0x4034('0x37')](_0x4037fb[_0x4034('0x2d')][_0x4034('0x35')]);}catch(_0x2dc469){logger[_0x4034('0x28')](_0x2dc469);throw new db['Sequelize'][(_0x4034('0x33'))](_0x4034('0x38'));}var _0x1546ff=['chatqueue','faxqueue',_0x4034('0x39'),'openchannelqueue',_0x4034('0x3a'),_0x4034('0x3b'),_0x4034('0x3c'),_0x4034('0x3d'),_0x4034('0x3e')];if(_['some'](_0x587527,function(_0x18b8da){return!_['includes'](_0x1546ff,_0x18b8da['model'][_0x4034('0x3f')]());})){throw new db[(_0x4034('0x30'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x124aac={};_0x124aac['senderName']=_0x4037fb['body'][_0x4034('0x2e')]('senderName')?_0x4037fb[_0x4034('0x2d')]['senderName']:_0x4037fb[_0x4034('0x3e')][_0x4034('0x40')];_0x124aac['recipientsDescription']=_[_0x4034('0x41')](_0x4037fb[_0x4034('0x2d')]['recipientsDescription'])?null:_0x4037fb[_0x4034('0x2d')]['recipientsDescription'];_0x124aac[_0x4034('0x42')]=_0x4037fb[_0x4034('0x2d')][_0x4034('0x42')]||![];_0x124aac[_0x4034('0x43')]=_0x4037fb[_0x4034('0x3e')]['id'];return getContent(_0x4037fb[_0x4034('0x2d')])['then'](function(_0x4c2a58){_0x124aac[_0x4034('0x2d')]=_0x4c2a58;return getRecipients(_0x587527);})['then'](function(_0xcf7cab){_0x124aac[_0x4034('0x44')]=_[_0x4034('0x45')](_0xcf7cab)['join'](',');return db[_0x4034('0x46')][_0x4034('0x47')](function(_0x482a14){return db[_0x4034('0x48')]['create'](_0x124aac,{'raw':!![],'transaction':_0x482a14})[_0x4034('0x26')](function(_0x1df32c){var _0x25e3d4={'sender':_0x124aac[_0x4034('0x49')],'description':_0x124aac['recipientsDescription'],'content':_0x124aac[_0x4034('0x2d')],'beep':_0x124aac[_0x4034('0x42')]};_0xcf7cab['forEach'](function(_0x336875){_0x25e3d4[_0x4034('0x4a')]=_0x336875;socket[_0x4034('0x4b')](_0x4034('0x4c'),_0x25e3d4);});return _0x1df32c;});});})[_0x4034('0x26')](respondWithResult(_0x2a8fbb,0xc9))[_0x4034('0x4d')](handleError(_0x2a8fbb,null));};function getContent(_0x515c8b){return new BPromise(function(_0x127c2c,_0x47479e){if(_0x515c8b[_0x4034('0x4e')]){_0x127c2c(_0x515c8b[_0x4034('0x4e')]);return;}return db['Template'][_0x4034('0x4f')]({'attributes':['html'],'where':{'id':_0x515c8b['TemplateId']},'raw':!![]})[_0x4034('0x26')](function(_0x446bd3){if(!_0x446bd3)throw new db['Sequelize'][(_0x4034('0x33'))](_0x4034('0x50'));var _0x1c41f=Mustache[_0x4034('0x51')](_0x446bd3['html'],_0x515c8b[_0x4034('0x32')]);_0x127c2c(_0x1c41f);})[_0x4034('0x4d')](function(_0x2aba02){_0x47479e(_0x2aba02);});});}function getRecipients(_0x161b12){return new BPromise(function(_0x26c948,_0x4f440b){var _0x3208cc=[];var _0x579538=[];_0x161b12[_0x4034('0x52')](function(_0x6631bb){var _0x5e8236=_[_0x4034('0x53')](_0x6631bb[_0x4034('0x54')][_0x4034('0x3f')]());if(_0x5e8236==='User'){_0x3208cc=_[_0x4034('0x55')](_0x3208cc,_0x6631bb['ids']);}else{if(_[_0x4034('0x56')](_0x5e8236,_0x4034('0x57')))_0x5e8236=_0x5e8236[_0x4034('0x58')](_0x4034('0x57'),_0x4034('0x59'));_0x6631bb[_0x4034('0x5a')][_0x4034('0x52')](function(_0x55e385){_0x579538['push'](getAgents(_0x5e8236,_0x55e385));});}});return BPromise[_0x4034('0x5b')](_0x579538)[_0x4034('0x26')](function(_0x11d5dd){_0x3208cc=_[_0x4034('0x55')](_0x3208cc,_['flatten'](_0x11d5dd));_0x26c948(_0x3208cc);})[_0x4034('0x4d')](function(_0x4dd965){_0x4f440b(_0x4dd965);});});}function getAgents(_0x3afbd4,_0xd23abf){return new BPromise(function(_0x5896cb,_0xe56676){return db[_0x3afbd4][_0x4034('0x4f')]({'where':{'id':_0xd23abf}})['then'](function(_0xa0399c){return _0xa0399c[_0x4034('0x5c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x133f0f){var _0x1c4c42=_[_0x4034('0x5d')](_0x133f0f,'id');_0x5896cb(_0x1c4c42);});})['catch'](function(_0x426e38){_0xe56676(_0x426e38);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index c8a67e7..99e5bc8 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 _0x5293=['../../mysqldb','UserNotification','save','update','emit','hook','events'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5293,0x14f));var _0x3529=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x5293[_0x20c9b2];return _0x2c6030;};'use strict';var EventEmitter=require(_0x3529('0x0'));var UserNotification=require(_0x3529('0x1'))['db'][_0x3529('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3529('0x3'),'afterUpdate':_0x3529('0x4'),'afterDestroy':'remove'};function emitEvent(_0x35d9b1){return function(_0x38f152,_0x39415a,_0x266993){UserNotificationEvents['emit'](_0x35d9b1+':'+_0x38f152['id'],_0x38f152);UserNotificationEvents[_0x3529('0x5')](_0x35d9b1,_0x38f152);_0x266993(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x3529('0x6')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0xb6ed=['hasOwnProperty','hook','events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit'];(function(_0x459b74,_0x5773bd){var _0x46cb16=function(_0x97867f){while(--_0x97867f){_0x459b74['push'](_0x459b74['shift']());}};_0x46cb16(++_0x5773bd);}(_0xb6ed,0x1d8));var _0xdb6e=function(_0x292835,_0x26cd15){_0x292835=_0x292835-0x0;var _0x376628=_0xb6ed[_0x292835];return _0x376628;};'use strict';var EventEmitter=require(_0xdb6e('0x0'));var UserNotification=require(_0xdb6e('0x1'))['db'][_0xdb6e('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xdb6e('0x3')](0x0);var events={'afterCreate':_0xdb6e('0x4'),'afterUpdate':_0xdb6e('0x5'),'afterDestroy':_0xdb6e('0x6')};function emitEvent(_0x331416){return function(_0x10cc04,_0x53f200,_0x4df390){UserNotificationEvents[_0xdb6e('0x7')](_0x331416+':'+_0x10cc04['id'],_0x10cc04);UserNotificationEvents[_0xdb6e('0x7')](_0x331416,_0x10cc04);_0x4df390(null);};}for(var e in events){if(events[_0xdb6e('0x8')](e)){var event=events[e];UserNotification[_0xdb6e('0x9')](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 797eba0..ec3e54d 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 _0x23cb=['path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x23cb,0xea));var _0xb23c=function(_0x211b08,_0xa24f83){_0x211b08=_0x211b08-0x0;var _0x41e020=_0x23cb[_0x211b08];return _0x41e020;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb23c('0x0'))(_0xb23c('0x1'));var moment=require('moment');var BPromise=require(_0xb23c('0x2'));var rp=require(_0xb23c('0x3'));var fs=require('fs');var path=require(_0xb23c('0x4'));var rimraf=require(_0xb23c('0x5'));var config=require(_0xb23c('0x6'));var attributes=require(_0xb23c('0x7'));module[_0xb23c('0x8')]=function(_0x537bdf,_0xeef70){return _0x537bdf[_0xb23c('0x9')](_0xb23c('0xa'),attributes,{'tableName':_0xb23c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb23c('0xc'),'collate':_0xb23c('0xd')});}; \ No newline at end of file +var _0x19f0=['exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','./userNotification.attributes'];(function(_0x5e1e25,_0xdc1421){var _0x548e5f=function(_0x576360){while(--_0x576360){_0x5e1e25['push'](_0x5e1e25['shift']());}};_0x548e5f(++_0xdc1421);}(_0x19f0,0xa0));var _0x019f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x19f0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x019f('0x0'));var util=require(_0x019f('0x1'));var logger=require(_0x019f('0x2'))(_0x019f('0x3'));var moment=require(_0x019f('0x4'));var BPromise=require('bluebird');var rp=require(_0x019f('0x5'));var fs=require('fs');var path=require(_0x019f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x019f('0x7'));module[_0x019f('0x8')]=function(_0x1c5420,_0x1b47be){return _0x1c5420[_0x019f('0x9')](_0x019f('0xa'),attributes,{'tableName':_0x019f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x019f('0xc'),'collate':_0x019f('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index a4f4685..46b7f12 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 _0xa769=['request','UserNotification,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','socket.io-emitter','./userNotification.socket','register'];(function(_0x29125b,_0x4321cd){var _0x1b0711=function(_0x563be5){while(--_0x563be5){_0x29125b['push'](_0x29125b['shift']());}};_0x1b0711(++_0x4321cd);}(_0xa769,0x169));var _0x9a76=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa769[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x9a76('0x0'));var util=require('util');var moment=require(_0x9a76('0x1'));var BPromise=require(_0x9a76('0x2'));var rs=require(_0x9a76('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9a76('0x4'));var logger=require(_0x9a76('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9a76('0x6'));var client=jayson[_0x9a76('0x7')][_0x9a76('0x8')]({'port':0x232a});config['redis']=_[_0x9a76('0x9')](config[_0x9a76('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9a76('0xb'))(new Redis(config[_0x9a76('0xa')]));require(_0x9a76('0xc'))[_0x9a76('0xd')](socket);function respondWithRpcPromise(_0x30292f,_0xfcb673,_0x59c1e9){return new BPromise(function(_0x48bdef,_0x20448c){return client[_0x9a76('0xe')](_0x30292f,_0x59c1e9)['then'](function(_0x45c9ad){logger['info'](_0x9a76('0xf'),_0xfcb673,_0x9a76('0x10'));logger[_0x9a76('0x11')]('UserNotification,\x20%s,\x20%s,\x20%s',_0xfcb673,_0x9a76('0x10'),JSON[_0x9a76('0x12')](_0x45c9ad));if(_0x45c9ad[_0x9a76('0x13')]){if(_0x45c9ad[_0x9a76('0x13')][_0x9a76('0x14')]===0x1f4){logger[_0x9a76('0x13')]('UserNotification,\x20%s,\x20%s',_0xfcb673,_0x45c9ad[_0x9a76('0x13')]['message']);return _0x20448c(_0x45c9ad['error'][_0x9a76('0x15')]);}logger['error']('UserNotification,\x20%s,\x20%s',_0xfcb673,_0x45c9ad[_0x9a76('0x13')][_0x9a76('0x15')]);return _0x48bdef(_0x45c9ad[_0x9a76('0x13')][_0x9a76('0x15')]);}else{logger[_0x9a76('0x16')](_0x9a76('0xf'),_0xfcb673,_0x9a76('0x10'));_0x48bdef(_0x45c9ad[_0x9a76('0x17')]['message']);}})[_0x9a76('0x18')](function(_0x242cfc){logger[_0x9a76('0x13')](_0x9a76('0xf'),_0xfcb673,_0x242cfc);_0x20448c(_0x242cfc);});});} \ No newline at end of file +var _0x031a=['defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','info','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','UserNotification,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis'];(function(_0x36915e,_0xbf511e){var _0x23988f=function(_0x2ea13f){while(--_0x2ea13f){_0x36915e['push'](_0x36915e['shift']());}};_0x23988f(++_0xbf511e);}(_0x031a,0x17d));var _0xa031=function(_0x50bbee,_0x4e2e44){_0x50bbee=_0x50bbee-0x0;var _0xa5a82f=_0x031a[_0x50bbee];return _0xa5a82f;};'use strict';var _=require(_0xa031('0x0'));var util=require('util');var moment=require(_0xa031('0x1'));var BPromise=require(_0xa031('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa031('0x3'));var db=require(_0xa031('0x4'))['db'];var utils=require(_0xa031('0x5'));var logger=require(_0xa031('0x6'))(_0xa031('0x7'));var config=require('../../config/environment');var jayson=require(_0xa031('0x8'));var client=jayson[_0xa031('0x9')]['http']({'port':0x232a});config[_0xa031('0xa')]=_[_0xa031('0xb')](config['redis'],{'host':_0xa031('0xc'),'port':0x18eb});var socket=require(_0xa031('0xd'))(new Redis(config['redis']));require(_0xa031('0xe'))[_0xa031('0xf')](socket);function respondWithRpcPromise(_0x52a79a,_0x1d056,_0x3fb1d6){return new BPromise(function(_0x4e1157,_0x5a1231){return client[_0xa031('0x10')](_0x52a79a,_0x3fb1d6)['then'](function(_0xb34254){logger[_0xa031('0x11')]('UserNotification,\x20%s,\x20%s',_0x1d056,'request\x20sent');logger[_0xa031('0x12')](_0xa031('0x13'),_0x1d056,_0xa031('0x14'),JSON[_0xa031('0x15')](_0xb34254));if(_0xb34254['error']){if(_0xb34254['error'][_0xa031('0x16')]===0x1f4){logger[_0xa031('0x17')]('UserNotification,\x20%s,\x20%s',_0x1d056,_0xb34254[_0xa031('0x17')][_0xa031('0x18')]);return _0x5a1231(_0xb34254['error'][_0xa031('0x18')]);}logger[_0xa031('0x17')]('UserNotification,\x20%s,\x20%s',_0x1d056,_0xb34254[_0xa031('0x17')][_0xa031('0x18')]);return _0x4e1157(_0xb34254[_0xa031('0x17')]['message']);}else{logger[_0xa031('0x11')](_0xa031('0x19'),_0x1d056,_0xa031('0x14'));_0x4e1157(_0xb34254[_0xa031('0x1a')][_0xa031('0x18')]);}})[_0xa031('0x1b')](function(_0x112f84){logger[_0xa031('0x17')](_0xa031('0x19'),_0x1d056,_0x112f84);_0x5a1231(_0x112f84);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 6c3e9e6..b561d69 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 _0x29a8=['userNotification:','./userNotification.events','save','update','emit','removeListener'];(function(_0x52ab8a,_0xee034b){var _0x5d6ddc=function(_0x283fa6){while(--_0x283fa6){_0x52ab8a['push'](_0x52ab8a['shift']());}};_0x5d6ddc(++_0xee034b);}(_0x29a8,0x11b));var _0x829a=function(_0x3afa56,_0x53a18b){_0x3afa56=_0x3afa56-0x0;var _0x1c0a2b=_0x29a8[_0x3afa56];return _0x1c0a2b;};'use strict';var UserNotificationEvents=require(_0x829a('0x0'));var events=[_0x829a('0x1'),'remove',_0x829a('0x2')];function createListener(_0x34429d,_0x27d432){return function(_0x258ac1){_0x27d432[_0x829a('0x3')](_0x34429d,_0x258ac1);};}function removeListener(_0xc2208b,_0x5e678b){return function(){UserNotificationEvents[_0x829a('0x4')](_0xc2208b,_0x5e678b);};}exports['register']=function(_0x298824){for(var _0x5ee5b5=0x0,_0xecfe24=events['length'];_0x5ee5b5<_0xecfe24;_0x5ee5b5++){var _0x2e3642=events[_0x5ee5b5];var _0x967680=createListener(_0x829a('0x5')+_0x2e3642,_0x298824);UserNotificationEvents['on'](_0x2e3642,_0x967680);}}; \ No newline at end of file +var _0x0f2d=['removeListener','register','length','userNotification:','./userNotification.events','save','update','emit'];(function(_0x33da1e,_0x5e3280){var _0x17edb2=function(_0x13cd72){while(--_0x13cd72){_0x33da1e['push'](_0x33da1e['shift']());}};_0x17edb2(++_0x5e3280);}(_0x0f2d,0xb4));var _0xd0f2=function(_0x4f0c2b,_0x533898){_0x4f0c2b=_0x4f0c2b-0x0;var _0x48a7c7=_0x0f2d[_0x4f0c2b];return _0x48a7c7;};'use strict';var UserNotificationEvents=require(_0xd0f2('0x0'));var events=[_0xd0f2('0x1'),'remove',_0xd0f2('0x2')];function createListener(_0x431f3d,_0x4f60a1){return function(_0x1b8ca0){_0x4f60a1[_0xd0f2('0x3')](_0x431f3d,_0x1b8ca0);};}function removeListener(_0xf07c00,_0x2011eb){return function(){UserNotificationEvents[_0xd0f2('0x4')](_0xf07c00,_0x2011eb);};}exports[_0xd0f2('0x5')]=function(_0x32781e){for(var _0x4aaee5=0x0,_0x506308=events[_0xd0f2('0x6')];_0x4aaee5<_0x506308;_0x4aaee5++){var _0x3abdb6=events[_0x4aaee5];var _0x56f5bd=createListener(_0xd0f2('0x7')+_0x3abdb6,_0x32781e);UserNotificationEvents['on'](_0x3abdb6,_0x56f5bd);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 6c55e0a..f76e471 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(_0x4a7c19,_0x18a5df){var _0x1c2fb0=function(_0x15d9a2){while(--_0x15d9a2){_0x4a7c19['push'](_0x4a7c19['shift']());}};_0x1c2fb0(++_0x18a5df);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x36962c,_0x110cd3){var _0x1fc013=function(_0x5c632e){while(--_0x5c632e){_0x36962c['push'](_0x36962c['shift']());}};_0x1fc013(++_0x110cd3);}(_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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 335e05a..2cf8c27 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 _0x201d=['INTEGER','sequelize'];(function(_0x5b7bb6,_0x2efffe){var _0x341bb7=function(_0x4c7c43){while(--_0x4c7c43){_0x5b7bb6['push'](_0x5b7bb6['shift']());}};_0x341bb7(++_0x2efffe);}(_0x201d,0xa1));var _0xd201=function(_0x272ac2,_0x3624d8){_0x272ac2=_0x272ac2-0x0;var _0x237e25=_0x201d[_0x272ac2];return _0x237e25;};'use strict';var Sequelize=require(_0xd201('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xd201('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5dfe=['sequelize','exports','INTEGER'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5dfe,0x1a4));var _0xe5df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5dfe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe5df('0x0'));module[_0xe5df('0x1')]={'penalty':{'type':Sequelize[_0xe5df('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 3402971..b8e0bba 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 _0xf4a0=['bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api'];(function(_0x2ad534,_0x5c4cb0){var _0x51c45f=function(_0x2c9b83){while(--_0x2c9b83){_0x2ad534['push'](_0x2ad534['shift']());}};_0x51c45f(++_0x5c4cb0);}(_0xf4a0,0xa4));var _0x0f4a=function(_0x2ef183,_0x34d55b){_0x2ef183=_0x2ef183-0x0;var _0x2d7c3e=_0xf4a0[_0x2ef183];return _0x2d7c3e;};'use strict';var _=require(_0x0f4a('0x0'));var util=require(_0x0f4a('0x1'));var logger=require(_0x0f4a('0x2'))(_0x0f4a('0x3'));var moment=require('moment');var BPromise=require(_0x0f4a('0x4'));var rp=require(_0x0f4a('0x5'));var fs=require('fs');var path=require(_0x0f4a('0x6'));var rimraf=require(_0x0f4a('0x7'));var config=require(_0x0f4a('0x8'));var attributes=require(_0x0f4a('0x9'));module[_0x0f4a('0xa')]=function(_0x38cb3f,_0x204db3){return _0x38cb3f[_0x0f4a('0xb')](_0x0f4a('0xc'),attributes,{'tableName':_0x0f4a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9638=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','lodash','util','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9638,0x186));var _0x8963=function(_0x1d5ba8,_0x412a52){_0x1d5ba8=_0x1d5ba8-0x0;var _0x1022a2=_0x9638[_0x1d5ba8];return _0x1022a2;};'use strict';var _=require(_0x8963('0x0'));var util=require(_0x8963('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8963('0x2'));var BPromise=require(_0x8963('0x3'));var rp=require(_0x8963('0x4'));var fs=require('fs');var path=require(_0x8963('0x5'));var rimraf=require(_0x8963('0x6'));var config=require(_0x8963('0x7'));var attributes=require(_0x8963('0x8'));module[_0x8963('0x9')]=function(_0x3d1646,_0x4616cb){return _0x3d1646['define'](_0x8963('0xa'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index d6e60eb..15988a9 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 _0x61f3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x61f3,0xf8));var _0x361f=function(_0x5287a1,_0x32e11e){_0x5287a1=_0x5287a1-0x0;var _0x546a37=_0x61f3[_0x5287a1];return _0x546a37;};'use strict';var _=require(_0x361f('0x0'));var util=require(_0x361f('0x1'));var moment=require(_0x361f('0x2'));var BPromise=require('bluebird');var rs=require(_0x361f('0x3'));var fs=require('fs');var Redis=require(_0x361f('0x4'));var db=require(_0x361f('0x5'))['db'];var utils=require(_0x361f('0x6'));var logger=require(_0x361f('0x7'))(_0x361f('0x8'));var config=require(_0x361f('0x9'));var jayson=require(_0x361f('0xa'));var client=jayson[_0x361f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f9183,_0x435e93,_0xf01295){return new BPromise(function(_0x20cf9a,_0x5d6889){return client[_0x361f('0xc')](_0x2f9183,_0xf01295)[_0x361f('0xd')](function(_0x4165bb){logger[_0x361f('0xe')](_0x361f('0xf'),_0x435e93,_0x361f('0x10'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x435e93,_0x361f('0x10'),JSON['stringify'](_0x4165bb));if(_0x4165bb[_0x361f('0x11')]){if(_0x4165bb[_0x361f('0x11')][_0x361f('0x12')]===0x1f4){logger[_0x361f('0x11')](_0x361f('0xf'),_0x435e93,_0x4165bb['error'][_0x361f('0x13')]);return _0x5d6889(_0x4165bb[_0x361f('0x11')]['message']);}logger[_0x361f('0x11')](_0x361f('0xf'),_0x435e93,_0x4165bb[_0x361f('0x11')][_0x361f('0x13')]);return _0x20cf9a(_0x4165bb[_0x361f('0x11')][_0x361f('0x13')]);}else{logger[_0x361f('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x435e93,'request\x20sent');_0x20cf9a(_0x4165bb['result']['message']);}})[_0x361f('0x14')](function(_0x4f2843){logger[_0x361f('0x11')](_0x361f('0xf'),_0x435e93,_0x4f2843);_0x5d6889(_0x4f2843);});});} \ No newline at end of file +var _0x5755=['error','code','message','UserOpenchannelQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x207783,_0x411198){var _0x4dd174=function(_0x24951e){while(--_0x24951e){_0x207783['push'](_0x207783['shift']());}};_0x4dd174(++_0x411198);}(_0x5755,0x131));var _0x5575=function(_0xe679de,_0x56d513){_0xe679de=_0xe679de-0x0;var _0x1ba35f=_0x5755[_0xe679de];return _0x1ba35f;};'use strict';var _=require(_0x5575('0x0'));var util=require(_0x5575('0x1'));var moment=require(_0x5575('0x2'));var BPromise=require('bluebird');var rs=require(_0x5575('0x3'));var fs=require('fs');var Redis=require(_0x5575('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5575('0x5'));var logger=require(_0x5575('0x6'))(_0x5575('0x7'));var config=require(_0x5575('0x8'));var jayson=require(_0x5575('0x9'));var client=jayson['client'][_0x5575('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x566153,_0xc78fba,_0x20fd65){return new BPromise(function(_0x313598,_0xbf0c7a){return client['request'](_0x566153,_0x20fd65)[_0x5575('0xb')](function(_0x4ed0b1){logger[_0x5575('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xc78fba,_0x5575('0xd'));logger[_0x5575('0xe')](_0x5575('0xf'),_0xc78fba,_0x5575('0xd'),JSON[_0x5575('0x10')](_0x4ed0b1));if(_0x4ed0b1[_0x5575('0x11')]){if(_0x4ed0b1[_0x5575('0x11')][_0x5575('0x12')]===0x1f4){logger[_0x5575('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xc78fba,_0x4ed0b1[_0x5575('0x11')][_0x5575('0x13')]);return _0xbf0c7a(_0x4ed0b1[_0x5575('0x11')][_0x5575('0x13')]);}logger[_0x5575('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xc78fba,_0x4ed0b1[_0x5575('0x11')]['message']);return _0x313598(_0x4ed0b1[_0x5575('0x11')][_0x5575('0x13')]);}else{logger[_0x5575('0xc')](_0x5575('0x14'),_0xc78fba,'request\x20sent');_0x313598(_0x4ed0b1[_0x5575('0x15')][_0x5575('0x13')]);}})[_0x5575('0x16')](function(_0xf8ac48){logger[_0x5575('0x11')](_0x5575('0x14'),_0xc78fba,_0xf8ac48);_0xbf0c7a(_0xf8ac48);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index e15c45e..87649f8 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 _0x00ad=['show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','put','update','delete','destroy','removeResources','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','index','isAuthenticated','describe','/:id'];(function(_0x10d8c7,_0xa80d12){var _0x4105b9=function(_0x46684b){while(--_0x46684b){_0x10d8c7['push'](_0x10d8c7['shift']());}};_0x4105b9(++_0xa80d12);}(_0x00ad,0x15a));var _0xd00a=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x00ad[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0xd00a('0x0'));var util=require(_0xd00a('0x1'));var path=require('path');var timeout=require(_0xd00a('0x2'));var express=require(_0xd00a('0x3'));var router=express[_0xd00a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd00a('0x5'));var interaction=require(_0xd00a('0x6'));var config=require(_0xd00a('0x7'));var controller=require(_0xd00a('0x8'));router[_0xd00a('0x9')]('/',auth['isAuthenticated'](),controller[_0xd00a('0xa')]);router[_0xd00a('0x9')]('/describe',auth[_0xd00a('0xb')](),controller[_0xd00a('0xc')]);router[_0xd00a('0x9')](_0xd00a('0xd'),auth[_0xd00a('0xb')](),controller[_0xd00a('0xe')]);router['get'](_0xd00a('0xf'),auth['isAuthenticated'](),controller[_0xd00a('0x10')]);router[_0xd00a('0x9')](_0xd00a('0x11'),auth[_0xd00a('0xb')](),controller[_0xd00a('0x12')]);router[_0xd00a('0x13')]('/',auth['isAuthenticated'](),controller[_0xd00a('0x14')]);router[_0xd00a('0x13')](_0xd00a('0x15'),auth[_0xd00a('0xb')](),controller[_0xd00a('0x16')]);router[_0xd00a('0x13')](_0xd00a('0xf'),auth[_0xd00a('0xb')](),controller[_0xd00a('0x17')]);router['post'](_0xd00a('0x11'),auth[_0xd00a('0xb')](),controller['addResources']);router[_0xd00a('0x18')](_0xd00a('0xd'),auth[_0xd00a('0xb')](),controller[_0xd00a('0x19')]);router[_0xd00a('0x1a')]('/:id',auth[_0xd00a('0xb')](),controller[_0xd00a('0x1b')]);router[_0xd00a('0x1a')](_0xd00a('0xf'),auth['isAuthenticated'](),controller['removeSections']);router[_0xd00a('0x1a')]('/:id/resources',auth[_0xd00a('0xb')](),controller[_0xd00a('0x1c')]);module[_0xd00a('0x1d')]=router; \ No newline at end of file +var _0xc895=['clone','addSections','/:id/resources','put','update','delete','removeSections','removeResources','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/sections','getSections','getResources','post','create','/:id/clone'];(function(_0x19de6b,_0x4b8505){var _0x1d35e7=function(_0x115a90){while(--_0x115a90){_0x19de6b['push'](_0x19de6b['shift']());}};_0x1d35e7(++_0x4b8505);}(_0xc895,0x165));var _0x5c89=function(_0x2a9e6f,_0x216211){_0x2a9e6f=_0x2a9e6f-0x0;var _0x1159d1=_0xc895[_0x2a9e6f];return _0x1159d1;};'use strict';var multer=require('multer');var util=require(_0x5c89('0x0'));var path=require(_0x5c89('0x1'));var timeout=require(_0x5c89('0x2'));var express=require('express');var router=express[_0x5c89('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5c89('0x4'));var interaction=require(_0x5c89('0x5'));var config=require(_0x5c89('0x6'));var controller=require(_0x5c89('0x7'));router[_0x5c89('0x8')]('/',auth[_0x5c89('0x9')](),controller['index']);router['get'](_0x5c89('0xa'),auth[_0x5c89('0x9')](),controller[_0x5c89('0xb')]);router['get'](_0x5c89('0xc'),auth[_0x5c89('0x9')](),controller[_0x5c89('0xd')]);router[_0x5c89('0x8')](_0x5c89('0xe'),auth[_0x5c89('0x9')](),controller[_0x5c89('0xf')]);router[_0x5c89('0x8')]('/:id/resources',auth[_0x5c89('0x9')](),controller[_0x5c89('0x10')]);router[_0x5c89('0x11')]('/',auth[_0x5c89('0x9')](),controller[_0x5c89('0x12')]);router[_0x5c89('0x11')](_0x5c89('0x13'),auth[_0x5c89('0x9')](),controller[_0x5c89('0x14')]);router[_0x5c89('0x11')](_0x5c89('0xe'),auth[_0x5c89('0x9')](),controller[_0x5c89('0x15')]);router['post'](_0x5c89('0x16'),auth['isAuthenticated'](),controller['addResources']);router[_0x5c89('0x17')](_0x5c89('0xc'),auth[_0x5c89('0x9')](),controller[_0x5c89('0x18')]);router['delete'](_0x5c89('0xc'),auth[_0x5c89('0x9')](),controller['destroy']);router[_0x5c89('0x19')](_0x5c89('0xe'),auth[_0x5c89('0x9')](),controller[_0x5c89('0x1a')]);router[_0x5c89('0x19')]('/:id/resources',auth[_0x5c89('0x9')](),controller[_0x5c89('0x1b')]);module[_0x5c89('0x1c')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index e1d455f..de4395f 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 _0x526b=['setDataValue','crudPermissions','split','BOOLEAN','sequelize','STRING','name'];(function(_0x4c2dfc,_0x4814c0){var _0xfd728d=function(_0x5b8d81){while(--_0x5b8d81){_0x4c2dfc['push'](_0x4c2dfc['shift']());}};_0xfd728d(++_0x4814c0);}(_0x526b,0x1a8));var _0xb526=function(_0x26849e,_0x14444b){_0x26849e=_0x26849e-0x0;var _0x18ed95=_0x526b[_0x26849e];return _0x18ed95;};'use strict';var Sequelize=require(_0xb526('0x0'));module['exports']={'name':{'type':Sequelize[_0xb526('0x1')],'allowNull':![],'unique':_0xb526('0x2')},'crudPermissions':{'type':Sequelize[_0xb526('0x1')],'set':function(_0x4bd2c4){this[_0xb526('0x3')](_0xb526('0x4'),_0x4bd2c4?_0x4bd2c4['join'](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this['getDataValue'](_0xb526('0x4'))[_0xb526('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xb526('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xb526('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xb526('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xb526('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xb526('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xb526('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x68ae=['BOOLEAN','sequelize','exports','STRING','name','join','crudPermissions'];(function(_0x47a397,_0x267dc6){var _0x36d592=function(_0x273645){while(--_0x273645){_0x47a397['push'](_0x47a397['shift']());}};_0x36d592(++_0x267dc6);}(_0x68ae,0xe1));var _0xe68a=function(_0x1b8381,_0x49a3d9){_0x1b8381=_0x1b8381-0x0;var _0x4f4b03=_0x68ae[_0x1b8381];return _0x4f4b03;};'use strict';var Sequelize=require(_0xe68a('0x0'));module[_0xe68a('0x1')]={'name':{'type':Sequelize[_0xe68a('0x2')],'allowNull':![],'unique':_0xe68a('0x3')},'crudPermissions':{'type':Sequelize[_0xe68a('0x2')],'set':function(_0x17e299){this['setDataValue']('crudPermissions',_0x17e299?_0x17e299[_0xe68a('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0xe68a('0x5'))?this['getDataValue']('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xe68a('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xe68a('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xe68a('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xe68a('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xe68a('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xe68a('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 8787aaa..0cf89c0 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 _0x1a37=['name','send','index','map','UserProfile','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','catch','show','params','length','find','create','body','clone','get','updatedAt','crudPermissions','omit','sequelize','transaction','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','createdAt','Resources','destroy','describe','addSections','push','removeSections','ids','getSections','enabled','includes','isEmpty','sectionId','subsections','forEach','resourceId','addResources','userProfileId','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','end','error','stack'];(function(_0xafcbd2,_0x3c48d6){var _0x5e8e3a=function(_0x3763cf){while(--_0x3763cf){_0xafcbd2['push'](_0xafcbd2['shift']());}};_0x5e8e3a(++_0x3c48d6);}(_0x1a37,0xb4));var _0x71a3=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x1a37[_0x494d1f];return _0x457b6e;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];config[_0x71a3('0x18')]=_[_0x71a3('0x19')](config[_0x71a3('0x18')],{'host':_0x71a3('0x1a'),'port':0x18eb});var socket=require(_0x71a3('0x1b'))(new Redis(config[_0x71a3('0x18')]));require(_0x71a3('0x1c'))[_0x71a3('0x1d')](socket);function respondWithStatusCode(_0x203ee1,_0x21a34d){_0x21a34d=_0x21a34d||0xcc;return function(_0x5a40c3){if(_0x5a40c3){return _0x203ee1[_0x71a3('0x1e')](_0x21a34d);}return _0x203ee1[_0x71a3('0x1f')](_0x21a34d)['end']();};}function respondWithResult(_0x4aa918,_0x41fe1c){_0x41fe1c=_0x41fe1c||0xc8;return function(_0x3a1c81){if(_0x3a1c81){return _0x4aa918[_0x71a3('0x1f')](_0x41fe1c)[_0x71a3('0x20')](_0x3a1c81);}};}function respondWithFilteredResult(_0x1af1bc,_0x318ff6){return function(_0x5d4dee){if(_0x5d4dee){var _0x656cd2=typeof _0x318ff6[_0x71a3('0x21')]==='undefined'&&typeof _0x318ff6['limit']===_0x71a3('0x22');var _0x250db3=_0x5d4dee[_0x71a3('0x23')];var _0x1c4ec2=_0x656cd2?0x0:_0x318ff6[_0x71a3('0x21')];var _0x596328=_0x656cd2?_0x5d4dee[_0x71a3('0x23')]:_0x318ff6[_0x71a3('0x21')]+_0x318ff6[_0x71a3('0x24')];var _0x3ea036;if(_0x596328>=_0x250db3){_0x596328=_0x250db3;_0x3ea036=0xc8;}else{_0x3ea036=0xce;}_0x1af1bc[_0x71a3('0x1f')](_0x3ea036);return _0x1af1bc['set'](_0x71a3('0x25'),_0x1c4ec2+'-'+_0x596328+'/'+_0x250db3)['json'](_0x5d4dee);}return null;};}function patchUpdates(_0x3bf78e){return function(_0x35d1d4){try{jsonpatch[_0x71a3('0x26')](_0x35d1d4,_0x3bf78e,!![]);}catch(_0x21899d){return BPromise[_0x71a3('0x27')](_0x21899d);}return _0x35d1d4[_0x71a3('0x28')]();};}function saveUpdates(_0x5f33c5,_0x26e6e7){return function(_0x299d1d){if(_0x299d1d){return _0x299d1d[_0x71a3('0x29')](_0x5f33c5)[_0x71a3('0x2a')](function(_0xb0f3aa){return _0xb0f3aa;});}return null;};}function removeEntity(_0x4fd214,_0x107fbd){return function(_0x2b414d){if(_0x2b414d){return _0x2b414d['destroy']()[_0x71a3('0x2a')](function(){_0x4fd214['status'](0xcc)[_0x71a3('0x2b')]();});}};}function handleEntityNotFound(_0x2fd3b6,_0x211ea8){return function(_0x35b5c7){if(!_0x35b5c7){_0x2fd3b6[_0x71a3('0x1e')](0x194);}return _0x35b5c7;};}function handleError(_0x314439,_0x2317ec){_0x2317ec=_0x2317ec||0x1f4;return function(_0x242b85){logger[_0x71a3('0x2c')](_0x242b85[_0x71a3('0x2d')]);if(_0x242b85[_0x71a3('0x2e')]){delete _0x242b85[_0x71a3('0x2e')];}_0x314439['status'](_0x2317ec)[_0x71a3('0x2f')](_0x242b85);};}exports[_0x71a3('0x30')]=function(_0x334db0,_0x23ae85){var _0x4a750c={},_0x18a8fe={},_0x216d84={'count':0x0,'rows':[]};var _0x45d13d=_[_0x71a3('0x31')](db[_0x71a3('0x32')][_0x71a3('0x33')],function(_0x1d09bd){return{'name':_0x1d09bd['fieldName'],'type':_0x1d09bd[_0x71a3('0x34')][_0x71a3('0x35')]};});_0x18a8fe[_0x71a3('0x36')]=_[_0x71a3('0x31')](_0x45d13d,_0x71a3('0x2e'));_0x18a8fe[_0x71a3('0x37')]=_[_0x71a3('0x38')](_0x334db0[_0x71a3('0x37')]);_0x18a8fe[_0x71a3('0x39')]=_[_0x71a3('0x3a')](_0x18a8fe[_0x71a3('0x36')],_0x18a8fe[_0x71a3('0x37')]);_0x4a750c[_0x71a3('0x3b')]=_['intersection'](_0x18a8fe['model'],qs[_0x71a3('0x3c')](_0x334db0[_0x71a3('0x37')]['fields']));_0x4a750c[_0x71a3('0x3b')]=_0x4a750c[_0x71a3('0x3b')]['length']?_0x4a750c[_0x71a3('0x3b')]:_0x18a8fe[_0x71a3('0x36')];if(!_0x334db0[_0x71a3('0x37')][_0x71a3('0x3d')](_0x71a3('0x3e'))){_0x4a750c[_0x71a3('0x24')]=qs[_0x71a3('0x24')](_0x334db0['query'][_0x71a3('0x24')]);_0x4a750c[_0x71a3('0x21')]=qs[_0x71a3('0x21')](_0x334db0['query'][_0x71a3('0x21')]);}_0x4a750c[_0x71a3('0x3f')]=qs[_0x71a3('0x40')](_0x334db0[_0x71a3('0x37')][_0x71a3('0x40')]);_0x4a750c['where']=qs['filters'](_[_0x71a3('0x41')](_0x334db0[_0x71a3('0x37')],_0x18a8fe[_0x71a3('0x39')]),_0x45d13d);if(_0x334db0[_0x71a3('0x37')][_0x71a3('0x42')]){_0x4a750c['where']=_[_0x71a3('0x43')](_0x4a750c[_0x71a3('0x44')],{'$or':_[_0x71a3('0x31')](_0x45d13d,function(_0x58b833){if(_0x58b833[_0x71a3('0x34')]!=='VIRTUAL'){var _0x3edeff={};_0x3edeff[_0x58b833[_0x71a3('0x2e')]]={'$like':'%'+_0x334db0[_0x71a3('0x37')][_0x71a3('0x42')]+'%'};return _0x3edeff;}})});}_0x4a750c=_[_0x71a3('0x43')]({},_0x4a750c,_0x334db0[_0x71a3('0x45')]);var _0x468ca4={'where':_0x4a750c[_0x71a3('0x44')]};return db[_0x71a3('0x32')][_0x71a3('0x23')](_0x468ca4)['then'](function(_0xa49846){_0x216d84['count']=_0xa49846;if(_0x334db0[_0x71a3('0x37')][_0x71a3('0x46')]){_0x4a750c[_0x71a3('0x47')]=[{'all':!![]}];}return db[_0x71a3('0x32')]['findAll'](_0x4a750c);})[_0x71a3('0x2a')](function(_0x4b4fde){_0x216d84['rows']=_0x4b4fde;return _0x216d84;})[_0x71a3('0x2a')](respondWithFilteredResult(_0x23ae85,_0x4a750c))[_0x71a3('0x48')](handleError(_0x23ae85,null));};exports[_0x71a3('0x49')]=function(_0x1dc34b,_0x519242){var _0x248a04={'raw':![],'where':{'id':_0x1dc34b[_0x71a3('0x4a')]['id']}},_0x615c6f={};_0x615c6f[_0x71a3('0x36')]=_[_0x71a3('0x38')](db[_0x71a3('0x32')][_0x71a3('0x33')]);_0x615c6f[_0x71a3('0x37')]=_[_0x71a3('0x38')](_0x1dc34b[_0x71a3('0x37')]);_0x615c6f[_0x71a3('0x39')]=_[_0x71a3('0x3a')](_0x615c6f[_0x71a3('0x36')],_0x615c6f[_0x71a3('0x37')]);_0x248a04[_0x71a3('0x3b')]=_[_0x71a3('0x3a')](_0x615c6f['model'],qs[_0x71a3('0x3c')](_0x1dc34b[_0x71a3('0x37')]['fields']));_0x248a04[_0x71a3('0x3b')]=_0x248a04[_0x71a3('0x3b')][_0x71a3('0x4b')]?_0x248a04[_0x71a3('0x3b')]:_0x615c6f[_0x71a3('0x36')];if(_0x1dc34b['query']['includeAll']){_0x248a04[_0x71a3('0x47')]=[{'all':!![]}];}_0x248a04=_[_0x71a3('0x43')]({},_0x248a04,_0x1dc34b['options']);return db[_0x71a3('0x32')][_0x71a3('0x4c')](_0x248a04)[_0x71a3('0x2a')](handleEntityNotFound(_0x519242,null))[_0x71a3('0x2a')](respondWithResult(_0x519242,null))[_0x71a3('0x48')](handleError(_0x519242,null));};exports[_0x71a3('0x4d')]=function(_0x501a62,_0x1c9ba6){return db['UserProfile'][_0x71a3('0x4d')](_0x501a62[_0x71a3('0x4e')],{})[_0x71a3('0x2a')](respondWithResult(_0x1c9ba6,0xc9))[_0x71a3('0x48')](handleError(_0x1c9ba6,null));};exports[_0x71a3('0x4f')]=function(_0x48fcd7,_0x263706){var _0x144872={'where':{'id':_0x48fcd7['params']['id']}},_0xa0e8aa={};_0xa0e8aa[_0x71a3('0x36')]=_['keys'](db[_0x71a3('0x32')][_0x71a3('0x33')]);_0x144872['attributes']=_[_0x71a3('0x3a')](_0xa0e8aa[_0x71a3('0x36')],qs[_0x71a3('0x3c')](_0x48fcd7[_0x71a3('0x37')][_0x71a3('0x3c')]));_0x144872[_0x71a3('0x3b')]=_0x144872[_0x71a3('0x3b')]['length']?_0x144872[_0x71a3('0x3b')]:_0xa0e8aa['model'];if(_0x48fcd7[_0x71a3('0x37')]['includeAll']){_0x144872[_0x71a3('0x47')]=[{'all':!![]}];}_0x144872=_[_0x71a3('0x43')]({},_0x144872,_0x48fcd7[_0x71a3('0x45')]);return db[_0x71a3('0x32')]['find'](_0x144872)['then'](handleEntityNotFound(_0x263706,null))[_0x71a3('0x2a')](function(_0x2a4e29){if(_0x2a4e29){var _0x3b82f7=_0x2a4e29[_0x71a3('0x50')]({'plain':!![]});_0x3b82f7=qs['omit'](_0x3b82f7,['id','createdAt',_0x71a3('0x51'),_0x71a3('0x52')]);_0x48fcd7[_0x71a3('0x4e')]=_[_0x71a3('0x53')](_0x48fcd7[_0x71a3('0x4e')],['id','createdAt',_0x71a3('0x51')]);return db[_0x71a3('0x54')][_0x71a3('0x55')](function(_0xef4e53){return db[_0x71a3('0x32')][_0x71a3('0x4d')](_[_0x71a3('0x43')](_0x3b82f7,_0x48fcd7[_0x71a3('0x4e')]),{'include':_0x48fcd7['query'][_0x71a3('0x46')]?[{'all':!![]}]:undefined,'transaction':_0xef4e53})[_0x71a3('0x2a')](function(_0x563270){var _0x56dea4=_0x563270[_0x71a3('0x50')]({'plain':!![]});return db[_0x71a3('0x56')][_0x71a3('0x57')]({'where':{'userProfileId':_0x48fcd7[_0x71a3('0x4a')]['id']},'raw':!![]})[_0x71a3('0x2a')](function(_0x2b7c00){if(_0x2b7c00){return BPromise[_0x71a3('0x58')](_0x2b7c00,function(_0x302dab){return new BPromise(function(_0x3ebf59,_0x11b951){if(_0x302dab['autoAssociation']===null||_0x302dab[_0x71a3('0x59')]===0x1)_0x3ebf59(null);return db[_0x71a3('0x5a')]['findAll']({'where':{'sectionId':_0x302dab['id']},'raw':!![]})[_0x71a3('0x2a')](function(_0x59bf1b){var _0x566bc5=_[_0x71a3('0x31')](_0x59bf1b,function(_0x8040d3){return qs[_0x71a3('0x53')](_0x8040d3,['id',_0x71a3('0x5b'),_0x71a3('0x51'),'sectionId']);});_0x3ebf59(_0x566bc5);})[_0x71a3('0x48')](function(_0x2b88f8){_0x11b951(_0x2b88f8);});})['then'](function(_0x7240bf){var _0x4da072=qs[_0x71a3('0x53')](_0x302dab,['id',_0x71a3('0x5b'),'updatedAt']);_0x4da072['userProfileId']=_0x56dea4['id'];if(_0x7240bf)_0x4da072[_0x71a3('0x5c')]=_0x7240bf;return _0x4da072;})[_0x71a3('0x2a')](function(_0x4d703a){return db[_0x71a3('0x56')][_0x71a3('0x4d')](_0x4d703a,{'include':[{'model':db[_0x71a3('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0xef4e53});});})[_0x71a3('0x2a')](function(){return _0x56dea4;});}});});});}})[_0x71a3('0x2a')](respondWithResult(_0x263706,0xc9))[_0x71a3('0x48')](handleError(_0x263706,null));};exports[_0x71a3('0x29')]=function(_0x1c1c6d,_0x85c7ed){if(_0x1c1c6d[_0x71a3('0x4e')]['id']){delete _0x1c1c6d[_0x71a3('0x4e')]['id'];}return db[_0x71a3('0x32')]['find']({'where':{'id':_0x1c1c6d[_0x71a3('0x4a')]['id']}})[_0x71a3('0x2a')](handleEntityNotFound(_0x85c7ed,null))[_0x71a3('0x2a')](saveUpdates(_0x1c1c6d['body'],null))[_0x71a3('0x2a')](respondWithResult(_0x85c7ed,null))[_0x71a3('0x48')](handleError(_0x85c7ed,null));};exports[_0x71a3('0x5d')]=function(_0x2e8523,_0x265cd5){return db[_0x71a3('0x32')][_0x71a3('0x4c')]({'where':{'id':_0x2e8523[_0x71a3('0x4a')]['id']}})[_0x71a3('0x2a')](handleEntityNotFound(_0x265cd5,null))['then'](removeEntity(_0x265cd5,null))[_0x71a3('0x48')](handleError(_0x265cd5,null));};exports['describe']=function(_0x37e602,_0x5e57da){return db['UserProfile'][_0x71a3('0x5e')]()['then'](respondWithResult(_0x5e57da,null))[_0x71a3('0x48')](handleError(_0x5e57da,null));};exports[_0x71a3('0x5f')]=function(_0x239d18,_0x4aa296){var _0x238b9a=_0x239d18[_0x71a3('0x4e')];return db['UserProfile'][_0x71a3('0x4c')]({'where':{'id':_0x239d18[_0x71a3('0x4a')]['id']}})[_0x71a3('0x2a')](handleEntityNotFound(_0x4aa296,null))[_0x71a3('0x2a')](function(_0x4430f2){if(_0x4430f2){return db[_0x71a3('0x54')][_0x71a3('0x55')](function(_0x30eb3c){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x239d18[_0x71a3('0x4a')]['id'],'sectionId':_[_0x71a3('0x31')](_0x238b9a,function(_0x1b3c9b){return _0x1b3c9b['sectionId'];})},'transaction':_0x30eb3c})[_0x71a3('0x2a')](function(){var _0x789f2a=_['map'](_0x238b9a,function(_0x160d7f){_0x160d7f['userProfileId']=_0x239d18[_0x71a3('0x4a')]['id'];return _0x160d7f;});var _0x1f6cbe=[];return BPromise[_0x71a3('0x58')](_0x789f2a,function(_0x184389){return db['UserProfileSection'][_0x71a3('0x4d')](_0x184389,{'include':[{'model':db[_0x71a3('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0x30eb3c})[_0x71a3('0x2a')](function(_0x43b307){_0x1f6cbe[_0x71a3('0x60')](_0x43b307[_0x71a3('0x50')]({'plain':!![]}));});})[_0x71a3('0x2a')](function(){return _0x1f6cbe;});});});}})[_0x71a3('0x2a')](function(_0x3fbbec){return _0x3fbbec;})[_0x71a3('0x2a')](respondWithResult(_0x4aa296,null))[_0x71a3('0x48')](handleError(_0x4aa296,null));};exports[_0x71a3('0x61')]=function(_0x3dce03,_0x19e7d1){var _0x539bdb;return db[_0x71a3('0x32')]['find']({'where':{'id':_0x3dce03[_0x71a3('0x4a')]['id']},'attributes':['id',_0x71a3('0x2e')]})[_0x71a3('0x2a')](handleEntityNotFound(_0x19e7d1,null))[_0x71a3('0x2a')](function(_0x3031da){if(_0x3031da){_0x539bdb=_0x3031da;return db[_0x71a3('0x56')][_0x71a3('0x5d')]({'where':{'userProfileId':_0x3dce03[_0x71a3('0x4a')]['id'],'sectionId':_0x3dce03[_0x71a3('0x37')][_0x71a3('0x62')]}});}})[_0x71a3('0x2a')](function(){return _0x539bdb;})[_0x71a3('0x2a')](respondWithStatusCode(_0x19e7d1,null))[_0x71a3('0x48')](handleError(_0x19e7d1,null));};exports[_0x71a3('0x63')]=function(_0x2e303e,_0x1227a9){var _0x3b14e0=[];var _0x295ff4=[];return db[_0x71a3('0x56')]['findAll']({'where':{'userProfileId':_0x2e303e[_0x71a3('0x4a')]['id']},'raw':!![]})[_0x71a3('0x2a')](function(_0x20abef){_0x3b14e0=_[_0x71a3('0x42')](_0x20abef,function(_0x375412){return _0x375412[_0x71a3('0x64')]===0x1||_[_0x71a3('0x65')]([0x3eb,0x709],_0x375412['sectionId']);});if(!_[_0x71a3('0x66')](_0x3b14e0)){return _['map'](_0x3b14e0,function(_0x552ff7){return _0x552ff7['sectionId'];});}else{return;}})['then'](function(_0x579faf){if(_0x579faf)_0x295ff4=_0x579faf;if(_['includes'](_0x295ff4,0x64)){var _0x40cb6e=_[_0x71a3('0x4c')](_0x3b14e0,{'sectionId':0x64});return hasDefaultDashboard(_0x40cb6e)[_0x71a3('0x2a')](function(_0x248521){return _[_0x71a3('0x31')](_0x3b14e0,function(_0x161ad2){if(_0x161ad2[_0x71a3('0x67')]===0x64){_0x161ad2[_0x71a3('0x68')]=_0x248521;}return _0x161ad2;});});}else{return;}})[_0x71a3('0x2a')](function(_0x291c32){if(_0x291c32)_0x3b14e0=_0x291c32;if(_[_0x71a3('0x65')](_0x295ff4,0x3eb)){var _0x2eb25c=_[_0x71a3('0x4c')](_0x3b14e0,{'sectionId':0x3eb});return getCustomDashboards(_0x2eb25c)['then'](function(_0x295213){return _[_0x71a3('0x31')](_0x3b14e0,function(_0x27cad5){if(_0x2eb25c[_0x71a3('0x64')]){if(_0x27cad5[_0x71a3('0x67')]===0x3eb){_0x27cad5[_0x71a3('0x68')]=_0x295213;}}else{if(_0x27cad5['sectionId']===0x64){_0x27cad5['subsections']=_0x295213;}}return _0x27cad5;});});}else{return;}})['then'](function(_0xc8166a){if(_0xc8166a)_0x3b14e0=_0xc8166a;if(_[_0x71a3('0x65')](_0x295ff4,0x709)){var _0x35c287=_['find'](_0x3b14e0,{'sectionId':0x709});return getPlugins(_0x35c287)[_0x71a3('0x2a')](function(_0x148279){if(_0x35c287[_0x71a3('0x64')]){return _[_0x71a3('0x31')](_0x3b14e0,function(_0x2fb980){if(_0x2fb980[_0x71a3('0x67')]===0x709){_0x2fb980[_0x71a3('0x68')]=_0x148279;}return _0x2fb980;});}else{var _0x28c184={'sectionId':0x76c,'enabled':0x1,'subsections':_0x148279};var _0x2e281d=_['map'](_0x3b14e0);_0x2e281d[_0x71a3('0x60')](_0x28c184);return _0x2e281d;}});}else{return;}})[_0x71a3('0x2a')](function(_0x48b3fc){if(_0x48b3fc)_0x3b14e0=_0x48b3fc;return _[_0x71a3('0x42')](_0x3b14e0,['enabled',0x1]);})[_0x71a3('0x2a')](respondWithResult(_0x1227a9,null))[_0x71a3('0x48')](handleError(_0x1227a9,null));};function hasDefaultDashboard(_0x37e71e){var _0x32096f=[0x65];return new BPromise(function(_0x45ac5e,_0x518edf){try{if(_0x37e71e[_0x71a3('0x59')]){_0x45ac5e(_0x32096f);}else{return db[_0x71a3('0x5a')]['findOne']({'where':{'sectionId':_0x37e71e['id']},'raw':!![]})[_0x71a3('0x2a')](function(_0x358853){_0x358853?_0x45ac5e(_0x32096f):_0x45ac5e();});}}catch(_0xeeac56){_0x518edf(_0xeeac56);}});}function getCustomDashboards(_0x4cddbd){var _0xfb7700=[];return new BPromise(function(_0x391c52,_0x120f87){try{if(_0x4cddbd['autoAssociation']){return db['Dashboard'][_0x71a3('0x57')]({'raw':!![]})[_0x71a3('0x2a')](function(_0xf2266e){_0xf2266e['forEach'](function(_0x1c66ca){_0xfb7700['push'](_0x1c66ca['id']+0x1869f);});_0x391c52(_0xfb7700);});}else{return db[_0x71a3('0x5a')][_0x71a3('0x57')]({'where':{'sectionId':_0x4cddbd['id']},'raw':!![]})[_0x71a3('0x2a')](function(_0x5f0624){_0x5f0624[_0x71a3('0x69')](function(_0x5ba04a){_0xfb7700[_0x71a3('0x60')](_0x5ba04a[_0x71a3('0x6a')]+0x1869f);});_0x391c52(_0xfb7700);});}}catch(_0x333ab6){_0x120f87(_0x333ab6);}});}function getPlugins(_0x2d045b){var _0x4713a3=[];return new BPromise(function(_0x5e7e9b,_0x158fd1){try{if(_0x2d045b[_0x71a3('0x59')]){return db['Plugin']['findAll']({'raw':!![]})[_0x71a3('0x2a')](function(_0xbd5fcc){_0xbd5fcc[_0x71a3('0x69')](function(_0x48079f){_0x4713a3[_0x71a3('0x60')](_0x48079f['id']+0x15b38);});_0x5e7e9b(_0x4713a3);});}else{return db[_0x71a3('0x5a')][_0x71a3('0x57')]({'where':{'sectionId':_0x2d045b['id']},'raw':!![]})[_0x71a3('0x2a')](function(_0x34c97c){_0x34c97c[_0x71a3('0x69')](function(_0x12db6f){_0x4713a3['push'](_0x12db6f[_0x71a3('0x6a')]+0x15b38);});_0x5e7e9b(_0x4713a3);});}}catch(_0xd87f34){_0x158fd1(_0xd87f34);}});}exports[_0x71a3('0x6b')]=function(_0x2fc088,_0x5776c8){return db[_0x71a3('0x32')][_0x71a3('0x4c')]({'where':{'id':_0x2fc088[_0x71a3('0x4a')]['id']}})[_0x71a3('0x2a')](handleEntityNotFound(_0x5776c8,null))[_0x71a3('0x2a')](function(_0x220299){if(_0x220299){return db[_0x71a3('0x54')][_0x71a3('0x55')](function(_0x590627){return db[_0x71a3('0x56')]['findAll']({'where':{'userProfileId':_0x2fc088[_0x71a3('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0x71a3('0x2a')](function(_0x212596){if(_0x212596){return db[_0x71a3('0x56')]['destroy']({'where':{'userProfileId':_0x2fc088['params']['id'],'id':_['map'](_0x212596,function(_0x2fb60b){return _0x2fb60b['id'];})},'transaction':_0x590627});}})[_0x71a3('0x2a')](function(_0x1dd77f){var _0x3fb03e=_[_0x71a3('0x31')](_0x2fc088[_0x71a3('0x4e')],function(_0x22ef74){_0x22ef74[_0x71a3('0x6c')]=_0x2fc088[_0x71a3('0x4a')]['id'];return _0x22ef74;});return db[_0x71a3('0x56')]['bulkCreate'](_0x3fb03e,{'raw':!![],'transaction':_0x590627});})[_0x71a3('0x2a')](function(_0x209406){var _0x21d6cb=_[_0x71a3('0x42')](_[_0x71a3('0x31')](_0x209406,function(_0x149b02){return _0x149b02['get']({'plain':!![]});}),{'includeAll':![]});if(_0x21d6cb){return db[_0x71a3('0x56')]['findAll']({'where':{'userProfileId':_0x2fc088[_0x71a3('0x4a')]['id'],'sectionId':_['map'](_0x21d6cb,function(_0x36ceed){return _0x36ceed[_0x71a3('0x67')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x71a3('0x2a')](function(_0x55c03e){var _0x3d59f8=_['map'](_0x2fc088[_0x71a3('0x4e')],function(_0x2c1350){_0x2c1350['userProfileId']=_0x2fc088[_0x71a3('0x4a')]['id'];return _0x2c1350;});return db[_0x71a3('0x5a')][_0x71a3('0x6d')](_0x3d59f8,{'raw':!![],'transaction':_0x590627});});}})[_0x71a3('0x48')](handleError(_0x5776c8,null));});}})[_0x71a3('0x2a')](function(_0x14e9a9){var _0x1a551a=_[_0x71a3('0x31')](_0x14e9a9,function(_0x564019){return _0x564019[_0x71a3('0x50')]({'plain':!![]});});})[_0x71a3('0x2a')](respondWithResult(_0x5776c8,null))[_0x71a3('0x48')](handleError(_0x5776c8,null));};exports['removeResources']=function(_0xb3e0df,_0x1ab4f5,_0x221ce0){return db['UserProfile']['find']({'where':{'id':_0xb3e0df[_0x71a3('0x4a')]['id']}})[_0x71a3('0x2a')](handleEntityNotFound(_0x1ab4f5,null))['then'](function(_0x34eecb){if(_0x34eecb){return _0x34eecb[_0x71a3('0x6e')](_0xb3e0df[_0x71a3('0x37')][_0x71a3('0x62')]);}})[_0x71a3('0x2a')](respondWithStatusCode(_0x1ab4f5,null))[_0x71a3('0x48')](handleError(_0x1ab4f5,null));};exports[_0x71a3('0x6f')]=function(_0x5709ba,_0xe4be10){var _0x2fce30={};if(!_0x5709ba['query']['section'])throw new Error(_0x71a3('0x70'));if(!_0x5709ba[_0x71a3('0x37')]['hasOwnProperty'](_0x71a3('0x3e'))){_0x2fce30[_0x71a3('0x24')]=qs[_0x71a3('0x24')](_0x5709ba['query']['limit']);_0x2fce30[_0x71a3('0x21')]=qs[_0x71a3('0x21')](_0x5709ba[_0x71a3('0x37')][_0x71a3('0x21')]);}return db[_0x71a3('0x32')][_0x71a3('0x4c')]({'where':{'id':_0x5709ba[_0x71a3('0x4a')]['id']}})[_0x71a3('0x2a')](function(_0x17636b){if(!_0x17636b)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x5709ba[_0x71a3('0x4a')]['id']);return db['UserProfile'][_0x71a3('0x6f')](_0x5709ba);})[_0x71a3('0x2a')](respondWithFilteredResult(_0xe4be10,_0x2fce30))[_0x71a3('0x48')](handleError(_0xe4be10,null));}; \ No newline at end of file +var _0x80cd=['ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','each','autoAssociation','UserProfileResource','userProfileId','Resources','UserProfileSection','update','find','describe','get','removeSections','ids','getSections','enabled','sectionId','subsections','includes','push','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x9e7b3e,_0x757f6f){var _0x2d6b9c=function(_0x62e1fe){while(--_0x62e1fe){_0x9e7b3e['push'](_0x9e7b3e['shift']());}};_0x2d6b9c(++_0x757f6f);}(_0x80cd,0x146));var _0xd80c=function(_0x21090b,_0x39dd3b){_0x21090b=_0x21090b-0x0;var _0x3c68d7=_0x80cd[_0x21090b];return _0x3c68d7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd80c('0x0'));var zipdir=require(_0xd80c('0x1'));var jsonpatch=require(_0xd80c('0x2'));var rp=require(_0xd80c('0x3'));var moment=require(_0xd80c('0x4'));var BPromise=require(_0xd80c('0x5'));var Mustache=require(_0xd80c('0x6'));var util=require(_0xd80c('0x7'));var path=require('path');var sox=require(_0xd80c('0x8'));var csv=require(_0xd80c('0x9'));var ejs=require(_0xd80c('0xa'));var fs=require('fs');var fs_extra=require(_0xd80c('0xb'));var _=require('lodash');var squel=require(_0xd80c('0xc'));var crypto=require(_0xd80c('0xd'));var jsforce=require(_0xd80c('0xe'));var deskjs=require(_0xd80c('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd80c('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd80c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd80c('0x12'));var hardwareService=require(_0xd80c('0x13'));var logger=require(_0xd80c('0x14'))(_0xd80c('0x15'));var utils=require(_0xd80c('0x16'));var config=require(_0xd80c('0x17'));var licenseUtil=require(_0xd80c('0x18'));var db=require('../../mysqldb')['db'];config[_0xd80c('0x19')]=_[_0xd80c('0x1a')](config[_0xd80c('0x19')],{'host':_0xd80c('0x1b'),'port':0x18eb});var socket=require(_0xd80c('0x1c'))(new Redis(config[_0xd80c('0x19')]));require(_0xd80c('0x1d'))[_0xd80c('0x1e')](socket);function respondWithStatusCode(_0x67c0d1,_0x56e014){_0x56e014=_0x56e014||0xcc;return function(_0x36925d){if(_0x36925d){return _0x67c0d1[_0xd80c('0x1f')](_0x56e014);}return _0x67c0d1[_0xd80c('0x20')](_0x56e014)[_0xd80c('0x21')]();};}function respondWithResult(_0x34419c,_0x52c6e0){_0x52c6e0=_0x52c6e0||0xc8;return function(_0x387877){if(_0x387877){return _0x34419c[_0xd80c('0x20')](_0x52c6e0)[_0xd80c('0x22')](_0x387877);}};}function respondWithFilteredResult(_0x233677,_0xbeab7c){return function(_0x41aac6){if(_0x41aac6){var _0x3b6a9c=typeof _0xbeab7c[_0xd80c('0x23')]==='undefined'&&typeof _0xbeab7c[_0xd80c('0x24')]===_0xd80c('0x25');var _0x229710=_0x41aac6[_0xd80c('0x26')];var _0x52b7f1=_0x3b6a9c?0x0:_0xbeab7c[_0xd80c('0x23')];var _0x3bb25c=_0x3b6a9c?_0x41aac6[_0xd80c('0x26')]:_0xbeab7c['offset']+_0xbeab7c[_0xd80c('0x24')];var _0x1b29a6;if(_0x3bb25c>=_0x229710){_0x3bb25c=_0x229710;_0x1b29a6=0xc8;}else{_0x1b29a6=0xce;}_0x233677['status'](_0x1b29a6);return _0x233677[_0xd80c('0x27')]('Content-Range',_0x52b7f1+'-'+_0x3bb25c+'/'+_0x229710)['json'](_0x41aac6);}return null;};}function patchUpdates(_0x5d73b4){return function(_0x4ab7c6){try{jsonpatch[_0xd80c('0x28')](_0x4ab7c6,_0x5d73b4,!![]);}catch(_0x205124){return BPromise[_0xd80c('0x29')](_0x205124);}return _0x4ab7c6[_0xd80c('0x2a')]();};}function saveUpdates(_0x48c1b1,_0x5a2530){return function(_0x330411){if(_0x330411){return _0x330411['update'](_0x48c1b1)[_0xd80c('0x2b')](function(_0x38de68){return _0x38de68;});}return null;};}function removeEntity(_0xaed56f,_0x3f0d7e){return function(_0x5673b9){if(_0x5673b9){return _0x5673b9[_0xd80c('0x2c')]()[_0xd80c('0x2b')](function(){_0xaed56f[_0xd80c('0x20')](0xcc)[_0xd80c('0x21')]();});}};}function handleEntityNotFound(_0x180e16,_0x2a2114){return function(_0x16a844){if(!_0x16a844){_0x180e16[_0xd80c('0x1f')](0x194);}return _0x16a844;};}function handleError(_0x13d4c5,_0x34d56c){_0x34d56c=_0x34d56c||0x1f4;return function(_0x2829a3){logger[_0xd80c('0x2d')](_0x2829a3[_0xd80c('0x2e')]);if(_0x2829a3[_0xd80c('0x2f')]){delete _0x2829a3[_0xd80c('0x2f')];}_0x13d4c5['status'](_0x34d56c)[_0xd80c('0x30')](_0x2829a3);};}exports[_0xd80c('0x31')]=function(_0x32184d,_0x240267){var _0x47638e={},_0x40823e={},_0xcefbfc={'count':0x0,'rows':[]};var _0x519ee6=_[_0xd80c('0x32')](db[_0xd80c('0x33')][_0xd80c('0x34')],function(_0x3bb003){return{'name':_0x3bb003['fieldName'],'type':_0x3bb003[_0xd80c('0x35')]['key']};});_0x40823e[_0xd80c('0x36')]=_[_0xd80c('0x32')](_0x519ee6,'name');_0x40823e[_0xd80c('0x37')]=_['keys'](_0x32184d[_0xd80c('0x37')]);_0x40823e[_0xd80c('0x38')]=_['intersection'](_0x40823e[_0xd80c('0x36')],_0x40823e[_0xd80c('0x37')]);_0x47638e[_0xd80c('0x39')]=_[_0xd80c('0x3a')](_0x40823e[_0xd80c('0x36')],qs[_0xd80c('0x3b')](_0x32184d[_0xd80c('0x37')][_0xd80c('0x3b')]));_0x47638e['attributes']=_0x47638e[_0xd80c('0x39')][_0xd80c('0x3c')]?_0x47638e[_0xd80c('0x39')]:_0x40823e['model'];if(!_0x32184d[_0xd80c('0x37')][_0xd80c('0x3d')](_0xd80c('0x3e'))){_0x47638e['limit']=qs['limit'](_0x32184d[_0xd80c('0x37')][_0xd80c('0x24')]);_0x47638e[_0xd80c('0x23')]=qs[_0xd80c('0x23')](_0x32184d['query'][_0xd80c('0x23')]);}_0x47638e[_0xd80c('0x3f')]=qs['sort'](_0x32184d['query']['sort']);_0x47638e[_0xd80c('0x40')]=qs[_0xd80c('0x38')](_[_0xd80c('0x41')](_0x32184d[_0xd80c('0x37')],_0x40823e[_0xd80c('0x38')]),_0x519ee6);if(_0x32184d[_0xd80c('0x37')][_0xd80c('0x42')]){_0x47638e[_0xd80c('0x40')]=_[_0xd80c('0x43')](_0x47638e['where'],{'$or':_['map'](_0x519ee6,function(_0x9336a6){if(_0x9336a6['type']!==_0xd80c('0x44')){var _0x2dd4e7={};_0x2dd4e7[_0x9336a6[_0xd80c('0x2f')]]={'$like':'%'+_0x32184d[_0xd80c('0x37')][_0xd80c('0x42')]+'%'};return _0x2dd4e7;}})});}_0x47638e=_[_0xd80c('0x43')]({},_0x47638e,_0x32184d[_0xd80c('0x45')]);var _0x55a0e2={'where':_0x47638e[_0xd80c('0x40')]};return db[_0xd80c('0x33')][_0xd80c('0x26')](_0x55a0e2)[_0xd80c('0x2b')](function(_0x1a2637){_0xcefbfc[_0xd80c('0x26')]=_0x1a2637;if(_0x32184d[_0xd80c('0x37')][_0xd80c('0x46')]){_0x47638e[_0xd80c('0x47')]=[{'all':!![]}];}return db[_0xd80c('0x33')][_0xd80c('0x48')](_0x47638e);})['then'](function(_0x55a494){_0xcefbfc[_0xd80c('0x49')]=_0x55a494;return _0xcefbfc;})['then'](respondWithFilteredResult(_0x240267,_0x47638e))[_0xd80c('0x4a')](handleError(_0x240267,null));};exports['show']=function(_0x2bdc0d,_0x672c7b){var _0x27a12f={'raw':![],'where':{'id':_0x2bdc0d[_0xd80c('0x4b')]['id']}},_0x412304={};_0x412304[_0xd80c('0x36')]=_[_0xd80c('0x4c')](db[_0xd80c('0x33')]['rawAttributes']);_0x412304['query']=_[_0xd80c('0x4c')](_0x2bdc0d[_0xd80c('0x37')]);_0x412304['filters']=_['intersection'](_0x412304[_0xd80c('0x36')],_0x412304['query']);_0x27a12f['attributes']=_[_0xd80c('0x3a')](_0x412304['model'],qs['fields'](_0x2bdc0d[_0xd80c('0x37')]['fields']));_0x27a12f[_0xd80c('0x39')]=_0x27a12f['attributes'][_0xd80c('0x3c')]?_0x27a12f[_0xd80c('0x39')]:_0x412304['model'];if(_0x2bdc0d[_0xd80c('0x37')][_0xd80c('0x46')]){_0x27a12f['include']=[{'all':!![]}];}_0x27a12f=_['merge']({},_0x27a12f,_0x2bdc0d[_0xd80c('0x45')]);return db[_0xd80c('0x33')]['find'](_0x27a12f)[_0xd80c('0x2b')](handleEntityNotFound(_0x672c7b,null))['then'](respondWithResult(_0x672c7b,null))[_0xd80c('0x4a')](handleError(_0x672c7b,null));};exports['create']=function(_0xde4804,_0xdd2aa2){return db[_0xd80c('0x33')][_0xd80c('0x4d')](_0xde4804[_0xd80c('0x4e')],{})[_0xd80c('0x2b')](respondWithResult(_0xdd2aa2,0xc9))[_0xd80c('0x4a')](handleError(_0xdd2aa2,null));};exports['clone']=function(_0x78379,_0x2cfd19){var _0x36f81={'where':{'id':_0x78379[_0xd80c('0x4b')]['id']}},_0x5ad76e={};_0x5ad76e[_0xd80c('0x36')]=_[_0xd80c('0x4c')](db[_0xd80c('0x33')][_0xd80c('0x34')]);_0x36f81['attributes']=_['intersection'](_0x5ad76e[_0xd80c('0x36')],qs[_0xd80c('0x3b')](_0x78379[_0xd80c('0x37')][_0xd80c('0x3b')]));_0x36f81[_0xd80c('0x39')]=_0x36f81[_0xd80c('0x39')][_0xd80c('0x3c')]?_0x36f81[_0xd80c('0x39')]:_0x5ad76e[_0xd80c('0x36')];if(_0x78379[_0xd80c('0x37')]['includeAll']){_0x36f81['include']=[{'all':!![]}];}_0x36f81=_[_0xd80c('0x43')]({},_0x36f81,_0x78379[_0xd80c('0x45')]);return db[_0xd80c('0x33')]['find'](_0x36f81)[_0xd80c('0x2b')](handleEntityNotFound(_0x2cfd19,null))['then'](function(_0x146263){if(_0x146263){var _0x2e70da=_0x146263['get']({'plain':!![]});_0x2e70da=qs[_0xd80c('0x4f')](_0x2e70da,['id','createdAt',_0xd80c('0x50'),_0xd80c('0x51')]);_0x78379[_0xd80c('0x4e')]=_[_0xd80c('0x4f')](_0x78379[_0xd80c('0x4e')],['id',_0xd80c('0x52'),_0xd80c('0x50')]);return db[_0xd80c('0x53')][_0xd80c('0x54')](function(_0x56d5f8){return db['UserProfile']['create'](_[_0xd80c('0x43')](_0x2e70da,_0x78379[_0xd80c('0x4e')]),{'include':_0x78379['query'][_0xd80c('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x56d5f8})[_0xd80c('0x2b')](function(_0x33963f){var _0x7d41dd=_0x33963f['get']({'plain':!![]});return db['UserProfileSection'][_0xd80c('0x48')]({'where':{'userProfileId':_0x78379['params']['id']},'raw':!![]})[_0xd80c('0x2b')](function(_0x23602a){if(_0x23602a){return BPromise[_0xd80c('0x55')](_0x23602a,function(_0x5a55c4){return new BPromise(function(_0x14854c,_0x1c4563){if(_0x5a55c4['autoAssociation']===null||_0x5a55c4[_0xd80c('0x56')]===0x1)_0x14854c(null);return db[_0xd80c('0x57')]['findAll']({'where':{'sectionId':_0x5a55c4['id']},'raw':!![]})[_0xd80c('0x2b')](function(_0x2cb1fe){var _0xc3c1e=_[_0xd80c('0x32')](_0x2cb1fe,function(_0x29b470){return qs['omit'](_0x29b470,['id',_0xd80c('0x52'),_0xd80c('0x50'),'sectionId']);});_0x14854c(_0xc3c1e);})['catch'](function(_0xdc551a){_0x1c4563(_0xdc551a);});})[_0xd80c('0x2b')](function(_0x5b26bf){var _0x5896ff=qs[_0xd80c('0x4f')](_0x5a55c4,['id',_0xd80c('0x52'),_0xd80c('0x50')]);_0x5896ff[_0xd80c('0x58')]=_0x7d41dd['id'];if(_0x5b26bf)_0x5896ff[_0xd80c('0x59')]=_0x5b26bf;return _0x5896ff;})[_0xd80c('0x2b')](function(_0x35d3e4){return db[_0xd80c('0x5a')][_0xd80c('0x4d')](_0x35d3e4,{'include':[{'model':db[_0xd80c('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x56d5f8});});})[_0xd80c('0x2b')](function(){return _0x7d41dd;});}});});});}})[_0xd80c('0x2b')](respondWithResult(_0x2cfd19,0xc9))[_0xd80c('0x4a')](handleError(_0x2cfd19,null));};exports[_0xd80c('0x5b')]=function(_0x3b2196,_0x1ca453){if(_0x3b2196[_0xd80c('0x4e')]['id']){delete _0x3b2196[_0xd80c('0x4e')]['id'];}return db[_0xd80c('0x33')][_0xd80c('0x5c')]({'where':{'id':_0x3b2196[_0xd80c('0x4b')]['id']}})[_0xd80c('0x2b')](handleEntityNotFound(_0x1ca453,null))[_0xd80c('0x2b')](saveUpdates(_0x3b2196[_0xd80c('0x4e')],null))[_0xd80c('0x2b')](respondWithResult(_0x1ca453,null))[_0xd80c('0x4a')](handleError(_0x1ca453,null));};exports[_0xd80c('0x2c')]=function(_0x38a03a,_0x32ffc0){return db[_0xd80c('0x33')][_0xd80c('0x5c')]({'where':{'id':_0x38a03a['params']['id']}})[_0xd80c('0x2b')](handleEntityNotFound(_0x32ffc0,null))[_0xd80c('0x2b')](removeEntity(_0x32ffc0,null))[_0xd80c('0x4a')](handleError(_0x32ffc0,null));};exports[_0xd80c('0x5d')]=function(_0x46cc45,_0x198647){return db[_0xd80c('0x33')][_0xd80c('0x5d')]()[_0xd80c('0x2b')](respondWithResult(_0x198647,null))[_0xd80c('0x4a')](handleError(_0x198647,null));};exports['addSections']=function(_0x70f0ff,_0x1ec1e1){var _0x1868b2=_0x70f0ff[_0xd80c('0x4e')];return db['UserProfile']['find']({'where':{'id':_0x70f0ff[_0xd80c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1ec1e1,null))['then'](function(_0x58e655){if(_0x58e655){return db[_0xd80c('0x53')][_0xd80c('0x54')](function(_0x2a3946){return db[_0xd80c('0x5a')]['destroy']({'where':{'userProfileId':_0x70f0ff['params']['id'],'sectionId':_[_0xd80c('0x32')](_0x1868b2,function(_0x4d68d4){return _0x4d68d4['sectionId'];})},'transaction':_0x2a3946})[_0xd80c('0x2b')](function(){var _0x2045d0=_[_0xd80c('0x32')](_0x1868b2,function(_0x49dd2a){_0x49dd2a['userProfileId']=_0x70f0ff[_0xd80c('0x4b')]['id'];return _0x49dd2a;});var _0x4fac2c=[];return BPromise['each'](_0x2045d0,function(_0x109701){return db[_0xd80c('0x5a')][_0xd80c('0x4d')](_0x109701,{'include':[{'model':db[_0xd80c('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x2a3946})[_0xd80c('0x2b')](function(_0x3389b){_0x4fac2c['push'](_0x3389b[_0xd80c('0x5e')]({'plain':!![]}));});})['then'](function(){return _0x4fac2c;});});});}})[_0xd80c('0x2b')](function(_0x141d03){return _0x141d03;})['then'](respondWithResult(_0x1ec1e1,null))[_0xd80c('0x4a')](handleError(_0x1ec1e1,null));};exports[_0xd80c('0x5f')]=function(_0x53e310,_0x2b54ec){var _0x2d841a;return db['UserProfile'][_0xd80c('0x5c')]({'where':{'id':_0x53e310[_0xd80c('0x4b')]['id']},'attributes':['id',_0xd80c('0x2f')]})[_0xd80c('0x2b')](handleEntityNotFound(_0x2b54ec,null))[_0xd80c('0x2b')](function(_0x144727){if(_0x144727){_0x2d841a=_0x144727;return db[_0xd80c('0x5a')][_0xd80c('0x2c')]({'where':{'userProfileId':_0x53e310[_0xd80c('0x4b')]['id'],'sectionId':_0x53e310['query'][_0xd80c('0x60')]}});}})['then'](function(){return _0x2d841a;})[_0xd80c('0x2b')](respondWithStatusCode(_0x2b54ec,null))['catch'](handleError(_0x2b54ec,null));};exports[_0xd80c('0x61')]=function(_0x20c16b,_0x40cf9f){var _0x3f417e=[];var _0x39114f=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x20c16b[_0xd80c('0x4b')]['id']},'raw':!![]})['then'](function(_0x4e4557){_0x3f417e=_['filter'](_0x4e4557,function(_0x456a9e){return _0x456a9e[_0xd80c('0x62')]===0x1||_['includes']([0x3eb,0x709],_0x456a9e[_0xd80c('0x63')]);});if(!_['isEmpty'](_0x3f417e)){return _['map'](_0x3f417e,function(_0x5bf101){return _0x5bf101[_0xd80c('0x63')];});}else{return;}})[_0xd80c('0x2b')](function(_0x1adc37){if(_0x1adc37)_0x39114f=_0x1adc37;if(_['includes'](_0x39114f,0x64)){var _0x582910=_[_0xd80c('0x5c')](_0x3f417e,{'sectionId':0x64});return hasDefaultDashboard(_0x582910)[_0xd80c('0x2b')](function(_0x33c1dd){return _[_0xd80c('0x32')](_0x3f417e,function(_0x36be94){if(_0x36be94[_0xd80c('0x63')]===0x64){_0x36be94[_0xd80c('0x64')]=_0x33c1dd;}return _0x36be94;});});}else{return;}})[_0xd80c('0x2b')](function(_0xf78c6c){if(_0xf78c6c)_0x3f417e=_0xf78c6c;if(_[_0xd80c('0x65')](_0x39114f,0x3eb)){var _0x194ac1=_['find'](_0x3f417e,{'sectionId':0x3eb});return getCustomDashboards(_0x194ac1)[_0xd80c('0x2b')](function(_0x586aae){return _[_0xd80c('0x32')](_0x3f417e,function(_0x5382d3){if(_0x194ac1[_0xd80c('0x62')]){if(_0x5382d3[_0xd80c('0x63')]===0x3eb){_0x5382d3[_0xd80c('0x64')]=_0x586aae;}}else{if(_0x5382d3[_0xd80c('0x63')]===0x64){_0x5382d3['subsections']=_0x586aae;}}return _0x5382d3;});});}else{return;}})['then'](function(_0x1d2a6f){if(_0x1d2a6f)_0x3f417e=_0x1d2a6f;if(_[_0xd80c('0x65')](_0x39114f,0x709)){var _0xcdfa30=_[_0xd80c('0x5c')](_0x3f417e,{'sectionId':0x709});return getPlugins(_0xcdfa30)[_0xd80c('0x2b')](function(_0x11f8d7){if(_0xcdfa30['enabled']){return _[_0xd80c('0x32')](_0x3f417e,function(_0xbead6f){if(_0xbead6f[_0xd80c('0x63')]===0x709){_0xbead6f[_0xd80c('0x64')]=_0x11f8d7;}return _0xbead6f;});}else{var _0x416e1d={'sectionId':0x76c,'enabled':0x1,'subsections':_0x11f8d7};var _0x41125f=_[_0xd80c('0x32')](_0x3f417e);_0x41125f[_0xd80c('0x66')](_0x416e1d);return _0x41125f;}});}else{return;}})[_0xd80c('0x2b')](function(_0x4c3c6e){if(_0x4c3c6e)_0x3f417e=_0x4c3c6e;return _['filter'](_0x3f417e,[_0xd80c('0x62'),0x1]);})['then'](respondWithResult(_0x40cf9f,null))[_0xd80c('0x4a')](handleError(_0x40cf9f,null));};function hasDefaultDashboard(_0x1df70c){var _0xa3968c=[0x65];return new BPromise(function(_0x4061fc,_0x31dd54){try{if(_0x1df70c['autoAssociation']){_0x4061fc(_0xa3968c);}else{return db[_0xd80c('0x57')][_0xd80c('0x67')]({'where':{'sectionId':_0x1df70c['id']},'raw':!![]})['then'](function(_0x455986){_0x455986?_0x4061fc(_0xa3968c):_0x4061fc();});}}catch(_0x7c8fcc){_0x31dd54(_0x7c8fcc);}});}function getCustomDashboards(_0x2c7abd){var _0x2cf7b7=[];return new BPromise(function(_0x5a028b,_0x3f6060){try{if(_0x2c7abd[_0xd80c('0x56')]){return db['Dashboard']['findAll']({'raw':!![]})[_0xd80c('0x2b')](function(_0x3fad20){_0x3fad20[_0xd80c('0x68')](function(_0x47f59a){_0x2cf7b7[_0xd80c('0x66')](_0x47f59a['id']+0x1869f);});_0x5a028b(_0x2cf7b7);});}else{return db[_0xd80c('0x57')]['findAll']({'where':{'sectionId':_0x2c7abd['id']},'raw':!![]})['then'](function(_0x1d68e5){_0x1d68e5['forEach'](function(_0x3c05f6){_0x2cf7b7[_0xd80c('0x66')](_0x3c05f6[_0xd80c('0x69')]+0x1869f);});_0x5a028b(_0x2cf7b7);});}}catch(_0x19ed57){_0x3f6060(_0x19ed57);}});}function getPlugins(_0x2bf719){var _0x3844c1=[];return new BPromise(function(_0x4981c4,_0x110c47){try{if(_0x2bf719[_0xd80c('0x56')]){return db[_0xd80c('0x6a')][_0xd80c('0x48')]({'raw':!![]})[_0xd80c('0x2b')](function(_0x4b5e70){_0x4b5e70[_0xd80c('0x68')](function(_0x4784ce){_0x3844c1[_0xd80c('0x66')](_0x4784ce['id']+0x15b38);});_0x4981c4(_0x3844c1);});}else{return db[_0xd80c('0x57')][_0xd80c('0x48')]({'where':{'sectionId':_0x2bf719['id']},'raw':!![]})['then'](function(_0x23b074){_0x23b074['forEach'](function(_0xf84ec6){_0x3844c1[_0xd80c('0x66')](_0xf84ec6[_0xd80c('0x69')]+0x15b38);});_0x4981c4(_0x3844c1);});}}catch(_0x1bbee6){_0x110c47(_0x1bbee6);}});}exports[_0xd80c('0x6b')]=function(_0x519596,_0xb0f7bc){return db[_0xd80c('0x33')][_0xd80c('0x5c')]({'where':{'id':_0x519596['params']['id']}})[_0xd80c('0x2b')](handleEntityNotFound(_0xb0f7bc,null))[_0xd80c('0x2b')](function(_0x5e533b){if(_0x5e533b){return db[_0xd80c('0x53')][_0xd80c('0x54')](function(_0x35e32e){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x519596['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x47f034){if(_0x47f034){return db[_0xd80c('0x5a')]['destroy']({'where':{'userProfileId':_0x519596[_0xd80c('0x4b')]['id'],'id':_[_0xd80c('0x32')](_0x47f034,function(_0x1e09e1){return _0x1e09e1['id'];})},'transaction':_0x35e32e});}})[_0xd80c('0x2b')](function(_0x3da976){var _0x3ad35f=_[_0xd80c('0x32')](_0x519596[_0xd80c('0x4e')],function(_0x4af215){_0x4af215[_0xd80c('0x58')]=_0x519596[_0xd80c('0x4b')]['id'];return _0x4af215;});return db[_0xd80c('0x5a')][_0xd80c('0x6c')](_0x3ad35f,{'raw':!![],'transaction':_0x35e32e});})[_0xd80c('0x2b')](function(_0x54bb84){var _0xebab09=_['filter'](_[_0xd80c('0x32')](_0x54bb84,function(_0x45dd2d){return _0x45dd2d[_0xd80c('0x5e')]({'plain':!![]});}),{'includeAll':![]});if(_0xebab09){return db[_0xd80c('0x5a')]['findAll']({'where':{'userProfileId':_0x519596[_0xd80c('0x4b')]['id'],'sectionId':_[_0xd80c('0x32')](_0xebab09,function(_0x3590eb){return _0x3590eb[_0xd80c('0x63')];})},'attributes':['id',_0xd80c('0x63')],'raw':!![]})['then'](function(_0x48e0e3){var _0x4586f0=_['map'](_0x519596[_0xd80c('0x4e')],function(_0x1bec27){_0x1bec27[_0xd80c('0x58')]=_0x519596[_0xd80c('0x4b')]['id'];return _0x1bec27;});return db[_0xd80c('0x57')][_0xd80c('0x6c')](_0x4586f0,{'raw':!![],'transaction':_0x35e32e});});}})['catch'](handleError(_0xb0f7bc,null));});}})[_0xd80c('0x2b')](function(_0x4907b8){var _0x171e7a=_['map'](_0x4907b8,function(_0x3df1c8){return _0x3df1c8['get']({'plain':!![]});});})[_0xd80c('0x2b')](respondWithResult(_0xb0f7bc,null))['catch'](handleError(_0xb0f7bc,null));};exports['removeResources']=function(_0x1662fa,_0x59cfa8,_0x567bf7){return db[_0xd80c('0x33')][_0xd80c('0x5c')]({'where':{'id':_0x1662fa[_0xd80c('0x4b')]['id']}})[_0xd80c('0x2b')](handleEntityNotFound(_0x59cfa8,null))[_0xd80c('0x2b')](function(_0x5ceafe){if(_0x5ceafe){return _0x5ceafe[_0xd80c('0x6d')](_0x1662fa[_0xd80c('0x37')][_0xd80c('0x60')]);}})[_0xd80c('0x2b')](respondWithStatusCode(_0x59cfa8,null))[_0xd80c('0x4a')](handleError(_0x59cfa8,null));};exports[_0xd80c('0x6e')]=function(_0x1ac46e,_0x313a8a){var _0xb45237={};if(!_0x1ac46e['query'][_0xd80c('0x6f')])throw new Error('Missing\x20section\x20parameter');if(!_0x1ac46e['query'][_0xd80c('0x3d')](_0xd80c('0x3e'))){_0xb45237['limit']=qs['limit'](_0x1ac46e[_0xd80c('0x37')][_0xd80c('0x24')]);_0xb45237[_0xd80c('0x23')]=qs[_0xd80c('0x23')](_0x1ac46e[_0xd80c('0x37')][_0xd80c('0x23')]);}return db[_0xd80c('0x33')][_0xd80c('0x5c')]({'where':{'id':_0x1ac46e['params']['id']}})[_0xd80c('0x2b')](function(_0x4b3deb){if(!_0x4b3deb)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x1ac46e[_0xd80c('0x4b')]['id']);return db['UserProfile'][_0xd80c('0x6e')](_0x1ac46e);})[_0xd80c('0x2b')](respondWithFilteredResult(_0x313a8a,_0xb45237))[_0xd80c('0x4a')](handleError(_0x313a8a,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index d50a871..615eecf 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 _0x4ccb=['UserProfile','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1cf7e8,_0x3cea71){var _0x3a9a74=function(_0x4b05ff){while(--_0x4b05ff){_0x1cf7e8['push'](_0x1cf7e8['shift']());}};_0x3a9a74(++_0x3cea71);}(_0x4ccb,0x196));var _0xb4cc=function(_0x2ad977,_0x3578ac){_0x2ad977=_0x2ad977-0x0;var _0x138e08=_0x4ccb[_0x2ad977];return _0x138e08;};'use strict';var EventEmitter=require(_0xb4cc('0x0'));var UserProfile=require(_0xb4cc('0x1'))['db'][_0xb4cc('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb4cc('0x3'),'afterUpdate':_0xb4cc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2cdc0c){return function(_0x2ae5e6,_0x23c968,_0x4cad3f){UserProfileEvents[_0xb4cc('0x5')](_0x2cdc0c+':'+_0x2ae5e6['id'],_0x2ae5e6);UserProfileEvents[_0xb4cc('0x5')](_0x2cdc0c,_0x2ae5e6);_0x4cad3f(null);};}for(var e in events){if(events[_0xb4cc('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xb4cc('0x7')]=UserProfileEvents; \ No newline at end of file +var _0xd26f=['emit','hook','exports','events','../../mysqldb','save','update','remove'];(function(_0x4702ee,_0xaf6a45){var _0x62ca7d=function(_0x5b3af7){while(--_0x5b3af7){_0x4702ee['push'](_0x4702ee['shift']());}};_0x62ca7d(++_0xaf6a45);}(_0xd26f,0x113));var _0xfd26=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xd26f[_0x1caf6a];return _0x1bf493;};'use strict';var EventEmitter=require(_0xfd26('0x0'));var UserProfile=require(_0xfd26('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfd26('0x2'),'afterUpdate':_0xfd26('0x3'),'afterDestroy':_0xfd26('0x4')};function emitEvent(_0x3e3583){return function(_0x30e7fc,_0x29c235,_0x3983a2){UserProfileEvents[_0xfd26('0x5')](_0x3e3583+':'+_0x30e7fc['id'],_0x30e7fc);UserProfileEvents[_0xfd26('0x5')](_0x3e3583,_0x30e7fc);_0x3983a2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xfd26('0x6')](e,emitEvent(event));}}module[_0xfd26('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 2666641..5122c54 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 _0x1623=['childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','JscriptyProject','contacts','Lists','ListId','lists','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','inboundroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','name','membername','User','role','agent','Telephones','telephone','queue','VoiceQueue','type','inbound','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','Campaign','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','QueueCampaigns','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Interval','pauses','Pause','scheduler','Schedule','tags','Tag','Template','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','user_has_','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','autoAssociation','rawAttributes','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','filters','pick','merge','AnalyticExtractedReport','foreignKey','forEach','options','includeAll','include','reportType','default','custom','CustomReports','count','CmContact','Tags','ThroughTags','color','tag','rows','openTabs','true','dataValues','mail','whatsapp','lodash','squel','exports','models','filter','field','value','findAll','then','associatedResources','model','map','catch','resolve','UserProfileResource','resourceId','toLowerCase','squareprojects'];(function(_0x2751c6,_0x4ad7ac){var _0x3333bc=function(_0x591a5c){while(--_0x591a5c){_0x2751c6['push'](_0x2751c6['shift']());}};_0x3333bc(++_0x4ad7ac);}(_0x1623,0xab));var _0x3162=function(_0x134c97,_0x85e2a5){_0x134c97=_0x134c97-0x0;var _0x29a47c=_0x1623[_0x134c97];return _0x29a47c;};'use strict';var _=require(_0x3162('0x0'));var attributes=require('./userProfile.attributes');var qs=require('../../components/parsers/qs');var squel=require(_0x3162('0x1'));module[_0x3162('0x2')]=function(_0x36ccc3){var _0x2cc4d7=_0x36ccc3[_0x3162('0x3')];function _0x4ce2bd(_0x5d49d0,_0x7a4559){return new Promise(function(_0x4b77c4,_0x1b55f2){if(!_0x7a4559)return _0x4b77c4(null);var _0x428de6=_0x7a4559['filter']?{[_0x7a4559[_0x3162('0x4')][_0x3162('0x5')]]:_0x7a4559[_0x3162('0x4')][_0x3162('0x6')]}:undefined;return _0x2cc4d7[_0x5d49d0][_0x3162('0x7')]({'where':_0x428de6,'raw':!![]})[_0x3162('0x8')](function(_0xe43099){_0x7a4559[_0x3162('0x9')]=_['map'](_0xe43099,'id');_0x4b77c4(_0x7a4559);})['catch'](function(_0x270de3){_0x1b55f2(_0x270de3);});});}function _0x3106d5(_0x1c3772,_0x34cfd8){return new Promise(function(_0x813d62,_0x208f4e){var _0x458a05=_0x1c3772[_0x3162('0x4')]?{[_0x1c3772[_0x3162('0x4')]['field']]:_0x1c3772[_0x3162('0x4')]['value']}:undefined;return _0x2cc4d7[_0x1c3772[_0x3162('0xa')]][_0x3162('0x7')]({'where':_0x458a05,'raw':!![]})['then'](function(_0x4a393a){_0x34cfd8[_0x3162('0x9')]=_[_0x3162('0xb')](_0x4a393a,function(_0x1eea65){return _0x1eea65['name'];});_0x813d62(_0x34cfd8);})[_0x3162('0xc')](function(_0x3d0bea){_0x208f4e(_0x3d0bea);});});}function _0x2705d1(_0x490371,_0x78a56c,_0x42cf7d){if(!_0x78a56c)return Promise[_0x3162('0xd')](null);return new Promise(function(_0xc3ee06,_0x930415){return _0x2cc4d7[_0x3162('0xe')][_0x3162('0x7')]({'where':{'sectionId':_0x78a56c['id']},'raw':!![]})['then'](function(_0x42f283){if(_0x490371[_0x3162('0x5')]&&_0x490371[_0x3162('0x5')]!=='id'){_0x78a56c[_0x3162('0x9')]=_['map'](_0x42f283,function(_0x1dfd5c){return _0x1dfd5c[_0x490371['field']];});}else{if(_0x42cf7d==='AnalyticExtractedReport'){_0x78a56c[_0x3162('0x9')]=_[_0x3162('0xb')](_0x42f283,function(_0x31946d){return{'id':_0x31946d['resourceId'],'type':_0x31946d['type']};});}else{_0x78a56c[_0x3162('0x9')]=_[_0x3162('0xb')](_0x42f283,function(_0x32c051){return _0x32c051[_0x3162('0xf')];});}}_0xc3ee06(_0x78a56c);})[_0x3162('0xc')](function(_0x14cbba){_0x930415(_0x14cbba);});});}function _0x52ae25(_0x1b2713,_0x5a4994){var _0xd283d6={'parentSections':[]};switch(_0x1b2713[_0x3162('0x10')]()){case _0x3162('0x11'):_0xd283d6[_0x3162('0x12')]=_0x3162('0x13');break;case _0x3162('0x14'):_0xd283d6[_0x3162('0x12')]=_0x3162('0x15');break;case _0x3162('0x16'):_0xd283d6[_0x3162('0x12')]=_0x3162('0x17');_0xd283d6[_0x3162('0x18')]=[{'name':_0x3162('0x19'),'field':'name','foreignKey':_0x3162('0x1a')}];break;case'projects':_0xd283d6[_0x3162('0x12')]=_0x3162('0x1b');break;case _0x3162('0x1c'):_0xd283d6['childModel']='CmContact';_0xd283d6[_0x3162('0x18')]=[{'name':_0x3162('0x1d'),'field':'id','foreignKey':_0x3162('0x1e')}];break;case _0x3162('0x1f'):_0xd283d6[_0x3162('0x12')]='CmList';break;case _0x3162('0x20'):_0xd283d6['childModel']=_0x3162('0x21');break;case _0x3162('0x22'):_0xd283d6[_0x3162('0x12')]=_0x3162('0x23');break;case _0x3162('0x24'):_0xd283d6[_0x3162('0x12')]=_0x3162('0x25');break;case _0x3162('0x26'):_0xd283d6['childModel']=_0x3162('0x27');break;case _0x3162('0x28'):_0xd283d6['childModel']=_0x3162('0x29');break;case _0x3162('0x2a'):_0xd283d6['childModel']='FaxAccount';break;case _0x3162('0x2b'):case'internalroutes':case _0x3162('0x2c'):_0xd283d6[_0x3162('0x12')]=_0x3162('0x2d');break;case'contexts':_0xd283d6['childModel']=_0x3162('0x2e');break;case _0x3162('0x2f'):_0xd283d6['childModel']=_0x3162('0x30');break;case'voicerecordings':_0xd283d6[_0x3162('0x12')]=_0x3162('0x31');_0xd283d6[_0x3162('0x18')]=[{'name':_0x3162('0x32'),'field':_0x3162('0x33'),'foreignKey':_0x3162('0x34'),'model':_0x3162('0x35'),'filter':{'field':_0x3162('0x36'),'value':[_0x3162('0x37')]}},{'name':_0x3162('0x38'),'field':_0x3162('0x33'),'foreignKey':'membername','model':_0x3162('0x35'),'filter':{'field':_0x3162('0x36'),'value':[_0x3162('0x39')]}},{'name':'VoiceQueues','field':'name','foreignKey':_0x3162('0x3a'),'model':_0x3162('0x3b'),'filter':{'field':_0x3162('0x3c'),'value':[_0x3162('0x3d')]}},{'name':'QueueCampaigns','field':_0x3162('0x33'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':'type','value':[_0x3162('0x3e')]}}];break;case _0x3162('0x3f'):_0xd283d6[_0x3162('0x12')]='VoiceMusicOnHold';break;case _0x3162('0x40'):_0xd283d6[_0x3162('0x12')]=_0x3162('0x41');break;case _0x3162('0x42'):_0xd283d6[_0x3162('0x12')]='VoicePrefix';break;case'ivrcampaigns':_0xd283d6[_0x3162('0x12')]=_0x3162('0x43');break;case'mailqueues':_0xd283d6['childModel']=_0x3162('0x44');break;case _0x3162('0x45'):_0xd283d6[_0x3162('0x12')]='MailAccount';break;case _0x3162('0x46'):_0xd283d6[_0x3162('0x12')]=_0x3162('0x47');break;case _0x3162('0x48'):_0xd283d6['childModel']=_0x3162('0x49');break;case _0x3162('0x4a'):_0xd283d6['childModel']=_0x3162('0x4b');break;case _0x3162('0x4c'):_0xd283d6['childModel']=_0x3162('0x4d');break;case _0x3162('0x4e'):_0xd283d6['childModel']=_0x3162('0x4f');break;case'whatsappqueues':_0xd283d6[_0x3162('0x12')]=_0x3162('0x50');break;case _0x3162('0x51'):_0xd283d6[_0x3162('0x12')]=_0x3162('0x52');break;case _0x3162('0x53'):_0xd283d6['childModel']=_0x3162('0x54');break;case _0x3162('0x55'):case _0x3162('0x56'):_0xd283d6['childModel']=_0x3162('0x3b');if(_0x5a4994){_0xd283d6[_0x3162('0x18')]=[{'name':'VoiceQueues'},{'name':_0x3162('0x57')}];}break;case'users':case'agents':case'telephones':_0xd283d6[_0x3162('0x12')]=_0x3162('0x35');if(_0x5a4994){_0xd283d6[_0x3162('0x18')]=[{'name':_0x3162('0x58'),'filter':{'field':_0x3162('0x36'),'value':[_0x3162('0x59'),_0x3162('0x5a')]},'ignore':!![]},{'name':_0x3162('0x32')},{'name':_0x3162('0x38')}];}break;case _0x3162('0x5b'):_0xd283d6[_0x3162('0x12')]=_0x3162('0x5c');break;case _0x3162('0x5d'):_0xd283d6['childModel']=_0x3162('0x5e');break;case'freshdeskaccounts':_0xd283d6['childModel']=_0x3162('0x5f');break;case _0x3162('0x60'):_0xd283d6[_0x3162('0x12')]=_0x3162('0x61');break;case'deskaccounts':_0xd283d6[_0x3162('0x12')]='DeskAccount';break;case _0x3162('0x62'):_0xd283d6[_0x3162('0x12')]='ZohoAccount';break;case _0x3162('0x63'):_0xd283d6['childModel']='User';break;case _0x3162('0x64'):_0xd283d6[_0x3162('0x12')]=_0x3162('0x65');break;case _0x3162('0x66'):_0xd283d6[_0x3162('0x12')]=_0x3162('0x67');break;case _0x3162('0x68'):_0xd283d6[_0x3162('0x12')]='Dashboard';break;case'intervals':_0xd283d6['childModel']=_0x3162('0x69');break;case _0x3162('0x6a'):_0xd283d6[_0x3162('0x12')]=_0x3162('0x6b');break;case _0x3162('0x6c'):_0xd283d6[_0x3162('0x12')]=_0x3162('0x6d');break;case'sounds':_0xd283d6[_0x3162('0x12')]='Sound';break;case _0x3162('0x6e'):_0xd283d6['childModel']=_0x3162('0x6f');break;case'templates':_0xd283d6[_0x3162('0x12')]=_0x3162('0x70');break;case'triggers':_0xd283d6['childModel']=_0x3162('0x71');break;case _0x3162('0x72'):_0xd283d6['childModel']=_0x3162('0x73');break;case _0x3162('0x74'):_0xd283d6[_0x3162('0x12')]=_0x3162('0x75');break;case _0x3162('0x76'):_0xd283d6['childModel']=_0x3162('0x77');break;case _0x3162('0x78'):_0xd283d6['childModel']='AnalyticExtractedReport';_0xd283d6[_0x3162('0x18')]=[{'name':_0x3162('0x79'),'field':'id','foreignKey':_0x3162('0x7a')}];break;case'metrics':_0xd283d6[_0x3162('0x12')]=_0x3162('0x7b');break;}return _0xd283d6;}function _0xca72d0(_0x32c999,_0x5c948d){var _0x434cb2=_0x32c999[_0x3162('0x7c')](0x0)['toUpperCase']()+_0x32c999[_0x3162('0x7d')](0x1);var _0x4fd42f={'type':_0x2cc4d7[_0x3162('0x7e')][_0x3162('0x7f')][_0x3162('0x80')],'raw':!![]};return new Promise(function(_0x53ad9b,_0x291aa7){var _0x1ce946=squel[_0x3162('0x81')]()[_0x3162('0x5')](_0x3162('0x82')+_0x434cb2+_0x3162('0x83'),'id')['field']('ui.createdAt')['from'](_0x3162('0x84')+_0x32c999+'_interactions','ui')[_0x3162('0x85')](_0x3162('0x86'),_0x5c948d['id']);return _0x2cc4d7[_0x3162('0x87')][_0x3162('0x88')](_0x1ce946[_0x3162('0x89')](),_0x4fd42f)['then'](function(_0x5a832c){_0x5c948d[_0x434cb2+_0x3162('0x8a')]=_0x5a832c;_0x53ad9b(_0x5a832c);})[_0x3162('0xc')](function(_0x5c6fd9){_0x291aa7(_0x5c6fd9);});});}return _0x36ccc3[_0x3162('0x8b')](_0x3162('0x8c'),attributes,{'tableName':_0x3162('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x26c98f){var _0xa273c3={'raw':![],'where':{}};var _0x4fdcec={};var _0x631cc0={'count':0x0,'rows':[]};var _0x1e904f=_0x26c98f[_0x3162('0x88')][_0x3162('0x8e')];var _0x1f0ab9=_0x26c98f['query'][_0x3162('0x8f')]||![];var _0x401b4e=_0x52ae25(_0x1e904f,_0x1f0ab9);if(!_0x401b4e[_0x3162('0x12')])throw new Error(_0x3162('0x90')+_0x1e904f+'\x27');var _0x53edaa=[{'name':_0x1e904f}];if(!_[_0x3162('0x91')](_0x401b4e[_0x3162('0x18')]))_0x53edaa=_0x401b4e[_0x3162('0x18')];var _0x45b05d=[];for(var _0x2f6fa2=0x0;_0x2f6fa2<_0x53edaa[_0x3162('0x92')];_0x2f6fa2++){_0x45b05d[_0x3162('0x93')](_0x2cc4d7[_0x3162('0x94')][_0x3162('0x95')]({'where':{'userProfileId':_0x26c98f[_0x3162('0x96')]['id'],'name':_0x53edaa[_0x2f6fa2]['name']},'raw':!![]}));}return Promise[_0x3162('0x97')](_0x45b05d)[_0x3162('0x8')](function(_0x4b9b84){var _0x3083f1=_['filter'](_0x4b9b84,function(_0x12167f){return _0x12167f?_0x12167f:undefined;});var _0x26da84=_[_0x3162('0x4')](_0x53edaa,[_0x3162('0x98'),!![]]);var _0xd2d0f9=_[_0x3162('0x91')](_0x3083f1)&&_['isEmpty'](_0x26da84)?null:_[_0x3162('0x99')](_0x26da84,_0x3083f1);if(!_0xd2d0f9)return null;var _0x43ca9b=[];for(var _0xb68765=0x0;_0xb68765<_0xd2d0f9[_0x3162('0x92')];_0xb68765++){var _0x3147a8=_[_0x3162('0x95')](_0x53edaa,function(_0x509c99){return _0xd2d0f9[_0xb68765]?_0x509c99[_0x3162('0x33')]===_0xd2d0f9[_0xb68765][_0x3162('0x33')]:null;});if(_0x3147a8){if(_0xd2d0f9[_0xb68765][_0x3162('0x98')]){_0x43ca9b[_0x3162('0x93')](_0x4ce2bd(_0x401b4e[_0x3162('0x12')],_0xd2d0f9[_0xb68765]));}else{if(!_0xd2d0f9[_0xb68765][_0x3162('0x9a')]){_0x43ca9b[_0x3162('0x93')](_0x2705d1(_0x3147a8,_0xd2d0f9[_0xb68765],_0x401b4e['childModel']));}else{if(_0x3147a8['model']){_0x43ca9b['push'](_0x3106d5(_0x3147a8,_0xd2d0f9[_0xb68765]));}}}}}return Promise[_0x3162('0x97')](_0x43ca9b);})[_0x3162('0x8')](function(_0x59b3f7){var _0x129005=_0x59b3f7;var _0x836b18=null;if(_0x129005){_0x836b18=_0x129005[_0x3162('0x92')]===0x1?_0x129005[0x0]:null;}if(!_0x836b18&&!_0x129005)return _0x631cc0;var _0x25caaf=_0x2cc4d7[_0x401b4e['childModel']][_0x3162('0x9b')];_0x4fdcec[_0x3162('0xa')]=_['keys'](_0x25caaf);_0x4fdcec[_0x3162('0x88')]=_['keys'](_0x26c98f[_0x3162('0x88')]);_0x4fdcec['filters']=_[_0x3162('0x9c')](_0x4fdcec['model'],_0x4fdcec[_0x3162('0x88')]);_0xa273c3[_0x3162('0x9d')]=_[_0x3162('0x9c')](_0x4fdcec[_0x3162('0xa')],qs[_0x3162('0x9e')](_0x26c98f[_0x3162('0x88')]['fields']));_0xa273c3[_0x3162('0x9d')]=_0xa273c3[_0x3162('0x9d')][_0x3162('0x92')]?_0xa273c3['attributes']:_0x4fdcec[_0x3162('0xa')];if(!_0x26c98f[_0x3162('0x88')][_0x3162('0x9f')](_0x3162('0xa0'))){_0xa273c3[_0x3162('0xa1')]=qs['limit'](_0x26c98f[_0x3162('0x88')][_0x3162('0xa1')]);_0xa273c3['offset']=qs['offset'](_0x26c98f[_0x3162('0x88')][_0x3162('0xa2')]);}_0xa273c3['order']=qs[_0x3162('0xa3')](_0x26c98f[_0x3162('0x88')][_0x3162('0xa3')]);_0xa273c3[_0x3162('0x85')]=qs[_0x3162('0xa4')](_[_0x3162('0xa5')](_0x26c98f[_0x3162('0x88')],_0x4fdcec[_0x3162('0xa4')]));if(_0x26c98f[_0x3162('0x88')]['filter']){_0xa273c3['where']=_[_0x3162('0xa6')](_0xa273c3[_0x3162('0x85')],{'$or':_['map'](_0x25caaf,function(_0xc13745){if(_0xc13745['type']['key']!=='VIRTUAL'){var _0x31981a={};_0x31981a[_0xc13745['field']]={'$like':'%'+_0x26c98f[_0x3162('0x88')][_0x3162('0x4')]+'%'};return _0x31981a;}})});}var _0x433059=[];var _0xfc0538=null;var _0x1bd5f6={};if(_0x836b18){_0xfc0538=_[_0x3162('0x95')](_0x53edaa,[_0x3162('0x33'),_0x836b18[_0x3162('0x33')]]);if(_0xfc0538[_0x3162('0x5')]){_0x1bd5f6={};if(_0x401b4e[_0x3162('0x12')]===_0x3162('0xa7')){_0x1bd5f6[_0xfc0538['foreignKey']]=_[_0x3162('0xb')](_0x836b18[_0x3162('0x9')],'id');}else{_0x1bd5f6[_0xfc0538[_0x3162('0xa8')]]=_0x836b18[_0x3162('0x9')];}_0x433059[_0x3162('0x93')](_0x1bd5f6);}else{_0xa273c3[_0x3162('0x85')]['id']=_0x836b18[_0x3162('0x9')];}}else{for(var _0x333eb8=0x0;_0x333eb8<_0x129005[_0x3162('0x92')];_0x333eb8++){_0xfc0538=_[_0x3162('0x95')](_0x53edaa,[_0x3162('0x33'),_0x129005[_0x333eb8][_0x3162('0x33')]]);if(_0xfc0538['field']){_0x1bd5f6={};_0x1bd5f6[_0xfc0538[_0x3162('0xa8')]]=_0x129005[_0x333eb8][_0x3162('0x9')];_0x433059[_0x3162('0x93')](_0x1bd5f6);}else{if(!_0xa273c3['where']['id'])_0xa273c3[_0x3162('0x85')]['id']=[];_0x129005[_0x333eb8]['associatedResources'][_0x3162('0xa9')](function(_0x1caf1d){_0xa273c3['where']['id']['push'](_0x1caf1d);});}}}if(!_[_0x3162('0x91')](_0x433059)){_0xa273c3[_0x3162('0x85')]=_['merge'](_0xa273c3[_0x3162('0x85')],{'$and':{'$or':_0x433059}});}_0xa273c3=_['merge']({},_0xa273c3,_0x26c98f[_0x3162('0xaa')]);if(_0x836b18&&!_0x836b18[_0x3162('0x9a')]&&_0x401b4e[_0x3162('0x12')]===_0x3162('0xa7')){if(_0x26c98f[_0x3162('0x88')][_0x3162('0xab')]){_0xa273c3[_0x3162('0xac')]=[{'all':!![]}];}return _0x2cc4d7[_0x401b4e[_0x3162('0x12')]][_0x3162('0x7')](_0xa273c3)['then'](function(_0x42e4ef){var _0x528bf6=[];_0x42e4ef[_0x3162('0xa9')](function(_0x28c632){var _0x4e5420;switch(_0x28c632[_0x3162('0xad')]){case _0x3162('0xae'):_0x4e5420=_[_0x3162('0x95')](_0x836b18[_0x3162('0x9')],function(_0x456266){return _0x456266['id']===_0x28c632[_0x3162('0x7a')]&&_0x456266[_0x3162('0x3c')]==='DefaultReports';});break;case _0x3162('0xaf'):_0x4e5420=_[_0x3162('0x95')](_0x836b18[_0x3162('0x9')],function(_0x53341c){return _0x53341c['id']===_0x28c632[_0x3162('0x7a')]&&_0x53341c[_0x3162('0x3c')]===_0x3162('0xb0');});break;}if(_0x4e5420)_0x528bf6[_0x3162('0x93')](_0x28c632);});_0x631cc0[_0x3162('0xb1')]=_0x528bf6[_0x3162('0x92')];_0x631cc0['rows']=_0x528bf6;return _0x631cc0;});}else{return _0x2cc4d7[_0x401b4e[_0x3162('0x12')]][_0x3162('0xb1')]({'where':_0xa273c3[_0x3162('0x85')]})[_0x3162('0x8')](function(_0x40ae99){_0x631cc0['count']=_0x40ae99;if(_0x26c98f[_0x3162('0x88')]['includeAll']){if(_0x401b4e[_0x3162('0x12')]===_0x3162('0xb2')){_0xa273c3['include']=[{'model':_0x2cc4d7[_0x3162('0x6f')],'as':_0x3162('0xb3'),'attributes':['id',_0x3162('0x33'),'color'],'required':_0x26c98f[_0x3162('0x88')]['tag']?!![]:![]},{'model':_0x2cc4d7['Tag'],'as':_0x3162('0xb4'),'attributes':['id',_0x3162('0x33'),_0x3162('0xb5')],'through':_0x26c98f[_0x3162('0x88')][_0x3162('0xb6')]?{'attributes':[],'where':{'TagId':_0x26c98f[_0x3162('0x88')][_0x3162('0xb6')]||undefined}}:{},'required':_0x26c98f['query']['tag']?!![]:![]}];}else{_0xa273c3['include']=[{'all':!![]}];}}return _0x2cc4d7[_0x401b4e[_0x3162('0x12')]][_0x3162('0x7')](_0xa273c3);})['then'](function(_0x5c6a78){_0x631cc0[_0x3162('0xb7')]=_0x5c6a78;if(_0x1e904f==='Agents'&&_0x26c98f[_0x3162('0x88')][_0x3162('0xb8')]===_0x3162('0xb9')){var _0x377edb=[];for(var _0x563197=0x0;_0x563197<_0x631cc0[_0x3162('0xb7')][_0x3162('0x92')];_0x563197++){_0x377edb[_0x3162('0x93')](_0xca72d0('chat',_0x631cc0[_0x3162('0xb7')][_0x563197]['dataValues']));_0x377edb[_0x3162('0x93')](_0xca72d0('sms',_0x631cc0[_0x3162('0xb7')][_0x563197][_0x3162('0xba')]));_0x377edb[_0x3162('0x93')](_0xca72d0('fax',_0x631cc0[_0x3162('0xb7')][_0x563197][_0x3162('0xba')]));_0x377edb[_0x3162('0x93')](_0xca72d0(_0x3162('0xbb'),_0x631cc0['rows'][_0x563197][_0x3162('0xba')]));_0x377edb[_0x3162('0x93')](_0xca72d0('openchannel',_0x631cc0[_0x3162('0xb7')][_0x563197][_0x3162('0xba')]));_0x377edb[_0x3162('0x93')](_0xca72d0(_0x3162('0xbc'),_0x631cc0[_0x3162('0xb7')][_0x563197][_0x3162('0xba')]));}return Promise[_0x3162('0x97')](_0x377edb)[_0x3162('0x8')](function(){return _0x631cc0;});}return _0x631cc0;});}});}}});}; \ No newline at end of file +var _0x9536=['options','includeAll','include','reportType','custom','count','rows','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','fax','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','field','findAll','then','map','catch','value','model','associatedResources','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','childModel','SquareProject','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','contacts','CmContact','Lists','lists','CmList','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','FaxAccount','inboundroutes','internalroutes','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','users','agents','telephones','Users','user','zendeskaccounts','salesforceaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','pauses','Pause','Schedule','sounds','Tag','Template','triggers','Trigger','trunks','Trunk','variables','Variable','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','Sequelize','SELECT','select','ui.','InteractionId','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','define','UserProfile','user_profiles','query','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','rawAttributes','keys','filters','attributes','intersection','fields','nolimit','limit','offset','order','pick','key','VIRTUAL','foreignKey','forEach','merge'];(function(_0x274e2c,_0x29eba9){var _0x788e50=function(_0x62924c){while(--_0x62924c){_0x274e2c['push'](_0x274e2c['shift']());}};_0x788e50(++_0x29eba9);}(_0x9536,0x179));var _0x6953=function(_0x592d48,_0x23f1ba){_0x592d48=_0x592d48-0x0;var _0x5d789e=_0x9536[_0x592d48];return _0x5d789e;};'use strict';var _=require(_0x6953('0x0'));var attributes=require(_0x6953('0x1'));var qs=require(_0x6953('0x2'));var squel=require(_0x6953('0x3'));module['exports']=function(_0xc3e4dd){var _0x53b172=_0xc3e4dd[_0x6953('0x4')];function _0x3c32c7(_0x1dee7c,_0x3ba964){return new Promise(function(_0x2f3cc3,_0x494ac2){if(!_0x3ba964)return _0x2f3cc3(null);var _0x2b273e=_0x3ba964[_0x6953('0x5')]?{[_0x3ba964[_0x6953('0x5')][_0x6953('0x6')]]:_0x3ba964[_0x6953('0x5')]['value']}:undefined;return _0x53b172[_0x1dee7c][_0x6953('0x7')]({'where':_0x2b273e,'raw':!![]})[_0x6953('0x8')](function(_0x449acb){_0x3ba964['associatedResources']=_[_0x6953('0x9')](_0x449acb,'id');_0x2f3cc3(_0x3ba964);})[_0x6953('0xa')](function(_0x300c48){_0x494ac2(_0x300c48);});});}function _0xb13f2c(_0x448c89,_0x1f3062){return new Promise(function(_0x246534,_0x2144c5){var _0xdd0b40=_0x448c89['filter']?{[_0x448c89[_0x6953('0x5')]['field']]:_0x448c89[_0x6953('0x5')][_0x6953('0xb')]}:undefined;return _0x53b172[_0x448c89[_0x6953('0xc')]][_0x6953('0x7')]({'where':_0xdd0b40,'raw':!![]})[_0x6953('0x8')](function(_0x244713){_0x1f3062[_0x6953('0xd')]=_[_0x6953('0x9')](_0x244713,function(_0x28433e){return _0x28433e[_0x6953('0xe')];});_0x246534(_0x1f3062);})[_0x6953('0xa')](function(_0x548473){_0x2144c5(_0x548473);});});}function _0x5f49db(_0x399b9b,_0x44e8a2,_0x16b79b){if(!_0x44e8a2)return Promise[_0x6953('0xf')](null);return new Promise(function(_0x510d46,_0x1b6dcb){return _0x53b172[_0x6953('0x10')]['findAll']({'where':{'sectionId':_0x44e8a2['id']},'raw':!![]})[_0x6953('0x8')](function(_0x3207dd){if(_0x399b9b[_0x6953('0x6')]&&_0x399b9b[_0x6953('0x6')]!=='id'){_0x44e8a2[_0x6953('0xd')]=_['map'](_0x3207dd,function(_0x3a93e1){return _0x3a93e1[_0x399b9b[_0x6953('0x6')]];});}else{if(_0x16b79b===_0x6953('0x11')){_0x44e8a2[_0x6953('0xd')]=_[_0x6953('0x9')](_0x3207dd,function(_0x5e33ec){return{'id':_0x5e33ec[_0x6953('0x12')],'type':_0x5e33ec[_0x6953('0x13')]};});}else{_0x44e8a2['associatedResources']=_[_0x6953('0x9')](_0x3207dd,function(_0x40c9d1){return _0x40c9d1[_0x6953('0x12')];});}}_0x510d46(_0x44e8a2);})[_0x6953('0xa')](function(_0x53640a){_0x1b6dcb(_0x53640a);});});}function _0x37f339(_0x231cb2,_0x2a7f6a){var _0x508ea7={'parentSections':[]};switch(_0x231cb2['toLowerCase']()){case'squareprojects':_0x508ea7[_0x6953('0x14')]=_0x6953('0x15');break;case'odbc':_0x508ea7[_0x6953('0x14')]='SquareOdbc';break;case _0x6953('0x16'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x17');_0x508ea7[_0x6953('0x18')]=[{'name':_0x6953('0x19'),'field':_0x6953('0xe'),'foreignKey':'projectName'}];break;case _0x6953('0x1a'):_0x508ea7[_0x6953('0x14')]='JscriptyProject';break;case _0x6953('0x1b'):_0x508ea7['childModel']=_0x6953('0x1c');_0x508ea7[_0x6953('0x18')]=[{'name':_0x6953('0x1d'),'field':'id','foreignKey':'ListId'}];break;case _0x6953('0x1e'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x1f');break;case'companies':_0x508ea7[_0x6953('0x14')]=_0x6953('0x20');break;case'globalcustomfields':_0x508ea7['childModel']=_0x6953('0x21');break;case _0x6953('0x22'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x23');break;case _0x6953('0x24'):_0x508ea7['childModel']=_0x6953('0x25');break;case'faxqueues':_0x508ea7[_0x6953('0x14')]=_0x6953('0x26');break;case'faxaccounts':_0x508ea7['childModel']=_0x6953('0x27');break;case _0x6953('0x28'):case _0x6953('0x29'):case'outboundroutes':_0x508ea7[_0x6953('0x14')]='VoiceExtension';break;case'contexts':_0x508ea7['childModel']='VoiceContext';break;case _0x6953('0x2a'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x2b');break;case _0x6953('0x2c'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x2d');_0x508ea7['parentSections']=[{'name':_0x6953('0x2e'),'field':'name','foreignKey':_0x6953('0x2f'),'model':'User','filter':{'field':_0x6953('0x30'),'value':[_0x6953('0x31')]}},{'name':_0x6953('0x32'),'field':_0x6953('0xe'),'foreignKey':'membername','model':_0x6953('0x33'),'filter':{'field':_0x6953('0x30'),'value':[_0x6953('0x34')]}},{'name':_0x6953('0x35'),'field':_0x6953('0xe'),'foreignKey':_0x6953('0x36'),'model':_0x6953('0x37'),'filter':{'field':_0x6953('0x13'),'value':[_0x6953('0x38')]}},{'name':_0x6953('0x39'),'field':_0x6953('0xe'),'foreignKey':'queue','model':_0x6953('0x37'),'filter':{'field':_0x6953('0x13'),'value':[_0x6953('0x3a')]}}];break;case'musiconholds':_0x508ea7['childModel']=_0x6953('0x3b');break;case'chanspies':_0x508ea7['childModel']=_0x6953('0x3c');break;case _0x6953('0x3d'):_0x508ea7['childModel']=_0x6953('0x3e');break;case _0x6953('0x3f'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x40');break;case _0x6953('0x41'):_0x508ea7[_0x6953('0x14')]='MailQueue';break;case _0x6953('0x42'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x43');break;case _0x6953('0x44'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x45');break;case'openchannelqueues':_0x508ea7['childModel']=_0x6953('0x46');break;case'openchannelaccounts':_0x508ea7['childModel']=_0x6953('0x47');break;case _0x6953('0x48'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x49');break;case _0x6953('0x4a'):_0x508ea7['childModel']='SmsAccount';break;case _0x6953('0x4b'):_0x508ea7[_0x6953('0x14')]='WhatsappQueue';break;case _0x6953('0x4c'):_0x508ea7['childModel']=_0x6953('0x4d');break;case _0x6953('0x4e'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x4f');break;case'voicequeues':case _0x6953('0x50'):_0x508ea7[_0x6953('0x14')]='VoiceQueue';if(_0x2a7f6a){_0x508ea7[_0x6953('0x18')]=[{'name':_0x6953('0x35')},{'name':_0x6953('0x39')}];}break;case _0x6953('0x51'):case _0x6953('0x52'):case _0x6953('0x53'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x33');if(_0x2a7f6a){_0x508ea7[_0x6953('0x18')]=[{'name':_0x6953('0x54'),'filter':{'field':_0x6953('0x30'),'value':['admin',_0x6953('0x55')]},'ignore':!![]},{'name':'Agents'},{'name':_0x6953('0x32')}];}break;case _0x6953('0x56'):_0x508ea7[_0x6953('0x14')]='ZendeskAccount';break;case _0x6953('0x57'):_0x508ea7[_0x6953('0x14')]='SalesforceAccount';break;case'freshdeskaccounts':_0x508ea7[_0x6953('0x14')]=_0x6953('0x58');break;case _0x6953('0x59'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x5a');break;case _0x6953('0x5b'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x5c');break;case _0x6953('0x5d'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x5e');break;case'vtigeraccounts':_0x508ea7['childModel']=_0x6953('0x33');break;case _0x6953('0x5f'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x60');break;case _0x6953('0x61'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x62');break;case _0x6953('0x63'):_0x508ea7[_0x6953('0x14')]='Dashboard';break;case'intervals':_0x508ea7['childModel']='Interval';break;case _0x6953('0x64'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x65');break;case'scheduler':_0x508ea7['childModel']=_0x6953('0x66');break;case _0x6953('0x67'):_0x508ea7[_0x6953('0x14')]='Sound';break;case'tags':_0x508ea7[_0x6953('0x14')]=_0x6953('0x68');break;case'templates':_0x508ea7['childModel']=_0x6953('0x69');break;case _0x6953('0x6a'):_0x508ea7[_0x6953('0x14')]=_0x6953('0x6b');break;case _0x6953('0x6c'):_0x508ea7['childModel']=_0x6953('0x6d');break;case _0x6953('0x6e'):_0x508ea7['childModel']=_0x6953('0x6f');break;case'plugins':_0x508ea7[_0x6953('0x14')]=_0x6953('0x70');break;case _0x6953('0x71'):_0x508ea7[_0x6953('0x14')]='AnalyticExtractedReport';_0x508ea7[_0x6953('0x18')]=[{'name':_0x6953('0x72'),'field':'id','foreignKey':_0x6953('0x73')}];break;case'metrics':_0x508ea7['childModel']=_0x6953('0x74');break;}return _0x508ea7;}function _0x224ce6(_0x2d0abd,_0x482f3b){var _0x4c6180=_0x2d0abd[_0x6953('0x75')](0x0)[_0x6953('0x76')]()+_0x2d0abd['slice'](0x1);var _0x4f3df2={'type':_0x53b172[_0x6953('0x77')]['QueryTypes'][_0x6953('0x78')],'raw':!![]};return new Promise(function(_0x1e824a,_0x109b5e){var _0x4443e2=squel[_0x6953('0x79')]()['field'](_0x6953('0x7a')+_0x4c6180+_0x6953('0x7b'),'id')[_0x6953('0x6')]('ui.createdAt')['from'](_0x6953('0x7c')+_0x2d0abd+_0x6953('0x7d'),'ui')[_0x6953('0x7e')](_0x6953('0x7f'),_0x482f3b['id']);return _0x53b172[_0x6953('0x80')]['query'](_0x4443e2[_0x6953('0x81')](),_0x4f3df2)[_0x6953('0x8')](function(_0xe93bf2){_0x482f3b[_0x4c6180+_0x6953('0x82')]=_0xe93bf2;_0x1e824a(_0xe93bf2);})[_0x6953('0xa')](function(_0x1d3520){_0x109b5e(_0x1d3520);});});}return _0xc3e4dd[_0x6953('0x83')](_0x6953('0x84'),attributes,{'tableName':_0x6953('0x85'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xcbbba5){var _0xb26c63={'raw':![],'where':{}};var _0x390ba0={};var _0x25ac55={'count':0x0,'rows':[]};var _0x583e1f=_0xcbbba5[_0x6953('0x86')][_0x6953('0x87')];var _0x3f5ab9=_0xcbbba5[_0x6953('0x86')][_0x6953('0x88')]||![];var _0x523a4a=_0x37f339(_0x583e1f,_0x3f5ab9);if(!_0x523a4a['childModel'])throw new Error(_0x6953('0x89')+_0x583e1f+'\x27');var _0x54822e=[{'name':_0x583e1f}];if(!_[_0x6953('0x8a')](_0x523a4a[_0x6953('0x18')]))_0x54822e=_0x523a4a[_0x6953('0x18')];var _0x235739=[];for(var _0x4c8e6c=0x0;_0x4c8e6c<_0x54822e[_0x6953('0x8b')];_0x4c8e6c++){_0x235739[_0x6953('0x8c')](_0x53b172[_0x6953('0x8d')][_0x6953('0x8e')]({'where':{'userProfileId':_0xcbbba5[_0x6953('0x8f')]['id'],'name':_0x54822e[_0x4c8e6c][_0x6953('0xe')]},'raw':!![]}));}return Promise[_0x6953('0x90')](_0x235739)[_0x6953('0x8')](function(_0x3582b6){var _0x155c63=_[_0x6953('0x5')](_0x3582b6,function(_0xce3eef){return _0xce3eef?_0xce3eef:undefined;});var _0x2e97ac=_[_0x6953('0x5')](_0x54822e,[_0x6953('0x91'),!![]]);var _0x5c5942=_[_0x6953('0x8a')](_0x155c63)&&_[_0x6953('0x8a')](_0x2e97ac)?null:_[_0x6953('0x92')](_0x2e97ac,_0x155c63);if(!_0x5c5942)return null;var _0x2d4b48=[];for(var _0x3f0c9e=0x0;_0x3f0c9e<_0x5c5942[_0x6953('0x8b')];_0x3f0c9e++){var _0x3e19f1=_['find'](_0x54822e,function(_0x3bb873){return _0x5c5942[_0x3f0c9e]?_0x3bb873[_0x6953('0xe')]===_0x5c5942[_0x3f0c9e]['name']:null;});if(_0x3e19f1){if(_0x5c5942[_0x3f0c9e][_0x6953('0x91')]){_0x2d4b48[_0x6953('0x8c')](_0x3c32c7(_0x523a4a[_0x6953('0x14')],_0x5c5942[_0x3f0c9e]));}else{if(!_0x5c5942[_0x3f0c9e]['autoAssociation']){_0x2d4b48['push'](_0x5f49db(_0x3e19f1,_0x5c5942[_0x3f0c9e],_0x523a4a[_0x6953('0x14')]));}else{if(_0x3e19f1[_0x6953('0xc')]){_0x2d4b48[_0x6953('0x8c')](_0xb13f2c(_0x3e19f1,_0x5c5942[_0x3f0c9e]));}}}}}return Promise[_0x6953('0x90')](_0x2d4b48);})[_0x6953('0x8')](function(_0x43a39f){var _0x3cf1c0=_0x43a39f;var _0x1515a9=null;if(_0x3cf1c0){_0x1515a9=_0x3cf1c0[_0x6953('0x8b')]===0x1?_0x3cf1c0[0x0]:null;}if(!_0x1515a9&&!_0x3cf1c0)return _0x25ac55;var _0x51bf39=_0x53b172[_0x523a4a[_0x6953('0x14')]][_0x6953('0x93')];_0x390ba0[_0x6953('0xc')]=_[_0x6953('0x94')](_0x51bf39);_0x390ba0['query']=_[_0x6953('0x94')](_0xcbbba5[_0x6953('0x86')]);_0x390ba0[_0x6953('0x95')]=_['intersection'](_0x390ba0[_0x6953('0xc')],_0x390ba0[_0x6953('0x86')]);_0xb26c63[_0x6953('0x96')]=_[_0x6953('0x97')](_0x390ba0['model'],qs[_0x6953('0x98')](_0xcbbba5[_0x6953('0x86')][_0x6953('0x98')]));_0xb26c63[_0x6953('0x96')]=_0xb26c63['attributes']['length']?_0xb26c63[_0x6953('0x96')]:_0x390ba0[_0x6953('0xc')];if(!_0xcbbba5['query']['hasOwnProperty'](_0x6953('0x99'))){_0xb26c63[_0x6953('0x9a')]=qs[_0x6953('0x9a')](_0xcbbba5[_0x6953('0x86')]['limit']);_0xb26c63[_0x6953('0x9b')]=qs[_0x6953('0x9b')](_0xcbbba5['query'][_0x6953('0x9b')]);}_0xb26c63[_0x6953('0x9c')]=qs['sort'](_0xcbbba5['query']['sort']);_0xb26c63[_0x6953('0x7e')]=qs[_0x6953('0x95')](_[_0x6953('0x9d')](_0xcbbba5[_0x6953('0x86')],_0x390ba0[_0x6953('0x95')]));if(_0xcbbba5[_0x6953('0x86')][_0x6953('0x5')]){_0xb26c63[_0x6953('0x7e')]=_['merge'](_0xb26c63[_0x6953('0x7e')],{'$or':_[_0x6953('0x9')](_0x51bf39,function(_0x131ea7){if(_0x131ea7[_0x6953('0x13')][_0x6953('0x9e')]!==_0x6953('0x9f')){var _0x481102={};_0x481102[_0x131ea7[_0x6953('0x6')]]={'$like':'%'+_0xcbbba5['query'][_0x6953('0x5')]+'%'};return _0x481102;}})});}var _0x52e762=[];var _0x1691dc=null;var _0x9de87a={};if(_0x1515a9){_0x1691dc=_[_0x6953('0x8e')](_0x54822e,['name',_0x1515a9[_0x6953('0xe')]]);if(_0x1691dc[_0x6953('0x6')]){_0x9de87a={};if(_0x523a4a[_0x6953('0x14')]===_0x6953('0x11')){_0x9de87a[_0x1691dc[_0x6953('0xa0')]]=_[_0x6953('0x9')](_0x1515a9['associatedResources'],'id');}else{_0x9de87a[_0x1691dc[_0x6953('0xa0')]]=_0x1515a9[_0x6953('0xd')];}_0x52e762[_0x6953('0x8c')](_0x9de87a);}else{_0xb26c63[_0x6953('0x7e')]['id']=_0x1515a9[_0x6953('0xd')];}}else{for(var _0x32c681=0x0;_0x32c681<_0x3cf1c0[_0x6953('0x8b')];_0x32c681++){_0x1691dc=_[_0x6953('0x8e')](_0x54822e,[_0x6953('0xe'),_0x3cf1c0[_0x32c681][_0x6953('0xe')]]);if(_0x1691dc[_0x6953('0x6')]){_0x9de87a={};_0x9de87a[_0x1691dc['foreignKey']]=_0x3cf1c0[_0x32c681][_0x6953('0xd')];_0x52e762[_0x6953('0x8c')](_0x9de87a);}else{if(!_0xb26c63[_0x6953('0x7e')]['id'])_0xb26c63[_0x6953('0x7e')]['id']=[];_0x3cf1c0[_0x32c681][_0x6953('0xd')][_0x6953('0xa1')](function(_0x16f3db){_0xb26c63[_0x6953('0x7e')]['id'][_0x6953('0x8c')](_0x16f3db);});}}}if(!_[_0x6953('0x8a')](_0x52e762)){_0xb26c63[_0x6953('0x7e')]=_['merge'](_0xb26c63[_0x6953('0x7e')],{'$and':{'$or':_0x52e762}});}_0xb26c63=_[_0x6953('0xa2')]({},_0xb26c63,_0xcbbba5[_0x6953('0xa3')]);if(_0x1515a9&&!_0x1515a9['autoAssociation']&&_0x523a4a[_0x6953('0x14')]==='AnalyticExtractedReport'){if(_0xcbbba5['query'][_0x6953('0xa4')]){_0xb26c63[_0x6953('0xa5')]=[{'all':!![]}];}return _0x53b172[_0x523a4a[_0x6953('0x14')]][_0x6953('0x7')](_0xb26c63)[_0x6953('0x8')](function(_0x2928c3){var _0x228544=[];_0x2928c3['forEach'](function(_0x150720){var _0x3113c0;switch(_0x150720[_0x6953('0xa6')]){case'default':_0x3113c0=_[_0x6953('0x8e')](_0x1515a9[_0x6953('0xd')],function(_0x4e48ef){return _0x4e48ef['id']===_0x150720[_0x6953('0x73')]&&_0x4e48ef['type']==='DefaultReports';});break;case _0x6953('0xa7'):_0x3113c0=_['find'](_0x1515a9['associatedResources'],function(_0x3c3dd4){return _0x3c3dd4['id']===_0x150720[_0x6953('0x73')]&&_0x3c3dd4[_0x6953('0x13')]==='CustomReports';});break;}if(_0x3113c0)_0x228544[_0x6953('0x8c')](_0x150720);});_0x25ac55[_0x6953('0xa8')]=_0x228544['length'];_0x25ac55[_0x6953('0xa9')]=_0x228544;return _0x25ac55;});}else{return _0x53b172[_0x523a4a[_0x6953('0x14')]][_0x6953('0xa8')]({'where':_0xb26c63[_0x6953('0x7e')]})[_0x6953('0x8')](function(_0x31d847){_0x25ac55[_0x6953('0xa8')]=_0x31d847;if(_0xcbbba5[_0x6953('0x86')][_0x6953('0xa4')]){if(_0x523a4a['childModel']===_0x6953('0x1c')){_0xb26c63[_0x6953('0xa5')]=[{'model':_0x53b172['Tag'],'as':_0x6953('0xaa'),'attributes':['id',_0x6953('0xe'),_0x6953('0xab')],'required':_0xcbbba5[_0x6953('0x86')][_0x6953('0xac')]?!![]:![]},{'model':_0x53b172[_0x6953('0x68')],'as':_0x6953('0xad'),'attributes':['id','name',_0x6953('0xab')],'through':_0xcbbba5[_0x6953('0x86')][_0x6953('0xac')]?{'attributes':[],'where':{'TagId':_0xcbbba5[_0x6953('0x86')][_0x6953('0xac')]||undefined}}:{},'required':_0xcbbba5[_0x6953('0x86')][_0x6953('0xac')]?!![]:![]}];}else{_0xb26c63[_0x6953('0xa5')]=[{'all':!![]}];}}return _0x53b172[_0x523a4a[_0x6953('0x14')]]['findAll'](_0xb26c63);})[_0x6953('0x8')](function(_0x5661d2){_0x25ac55[_0x6953('0xa9')]=_0x5661d2;if(_0x583e1f==='Agents'&&_0xcbbba5[_0x6953('0x86')][_0x6953('0xae')]===_0x6953('0xaf')){var _0x46bcec=[];for(var _0x2dae06=0x0;_0x2dae06<_0x25ac55['rows'][_0x6953('0x8b')];_0x2dae06++){_0x46bcec['push'](_0x224ce6(_0x6953('0xb0'),_0x25ac55[_0x6953('0xa9')][_0x2dae06][_0x6953('0xb1')]));_0x46bcec[_0x6953('0x8c')](_0x224ce6('sms',_0x25ac55[_0x6953('0xa9')][_0x2dae06][_0x6953('0xb1')]));_0x46bcec[_0x6953('0x8c')](_0x224ce6(_0x6953('0xb2'),_0x25ac55[_0x6953('0xa9')][_0x2dae06][_0x6953('0xb1')]));_0x46bcec[_0x6953('0x8c')](_0x224ce6('mail',_0x25ac55[_0x6953('0xa9')][_0x2dae06][_0x6953('0xb1')]));_0x46bcec[_0x6953('0x8c')](_0x224ce6(_0x6953('0xb3'),_0x25ac55[_0x6953('0xa9')][_0x2dae06]['dataValues']));_0x46bcec['push'](_0x224ce6('whatsapp',_0x25ac55[_0x6953('0xa9')][_0x2dae06][_0x6953('0xb1')]));}return Promise[_0x6953('0x90')](_0x46bcec)['then'](function(){return _0x25ac55;});}return _0x25ac55;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 6211983..510b029 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 _0x13c5=['request\x20sent','result','lodash','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','info','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message'];(function(_0x36a6f7,_0x1b0752){var _0x17d179=function(_0x5b61b8){while(--_0x5b61b8){_0x36a6f7['push'](_0x36a6f7['shift']());}};_0x17d179(++_0x1b0752);}(_0x13c5,0x7a));var _0x513c=function(_0x20205f,_0x30479b){_0x20205f=_0x20205f-0x0;var _0x377c35=_0x13c5[_0x20205f];return _0x377c35;};'use strict';var _=require(_0x513c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x513c('0x1'));var logger=require('../../config/logger')('rpc');var config=require(_0x513c('0x2'));var jayson=require(_0x513c('0x3'));var client=jayson[_0x513c('0x4')][_0x513c('0x5')]({'port':0x232a});config['redis']=_['defaults'](config[_0x513c('0x6')],{'host':_0x513c('0x7'),'port':0x18eb});var socket=require(_0x513c('0x8'))(new Redis(config[_0x513c('0x6')]));require(_0x513c('0x9'))[_0x513c('0xa')](socket);function respondWithRpcPromise(_0x222c25,_0x18471d,_0x4adc04){return new BPromise(function(_0xd70448,_0x224eb2){return client['request'](_0x222c25,_0x4adc04)['then'](function(_0x798eed){logger[_0x513c('0xb')]('UserProfile,\x20%s,\x20%s',_0x18471d,'request\x20sent');logger['debug'](_0x513c('0xc'),_0x18471d,'request\x20sent',JSON[_0x513c('0xd')](_0x798eed));if(_0x798eed[_0x513c('0xe')]){if(_0x798eed['error'][_0x513c('0xf')]===0x1f4){logger[_0x513c('0xe')](_0x513c('0x10'),_0x18471d,_0x798eed[_0x513c('0xe')][_0x513c('0x11')]);return _0x224eb2(_0x798eed['error'][_0x513c('0x11')]);}logger['error'](_0x513c('0x10'),_0x18471d,_0x798eed[_0x513c('0xe')][_0x513c('0x11')]);return _0xd70448(_0x798eed[_0x513c('0xe')]['message']);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x18471d,_0x513c('0x12'));_0xd70448(_0x798eed[_0x513c('0x13')]['message']);}})['catch'](function(_0x217e7a){logger[_0x513c('0xe')](_0x513c('0x10'),_0x18471d,_0x217e7a);_0x224eb2(_0x217e7a);});});} \ No newline at end of file +var _0x6869=['jayson/promise','http','redis','defaults','socket.io-emitter','./userProfile.socket','register','request','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x265110,_0x2cbf81){var _0x1e4501=function(_0x383606){while(--_0x383606){_0x265110['push'](_0x265110['shift']());}};_0x1e4501(++_0x2cbf81);}(_0x6869,0xe2));var _0x9686=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x6869[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x9686('0x0'));var util=require(_0x9686('0x1'));var moment=require(_0x9686('0x2'));var BPromise=require('bluebird');var rs=require(_0x9686('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9686('0x4'));var logger=require(_0x9686('0x5'))(_0x9686('0x6'));var config=require(_0x9686('0x7'));var jayson=require(_0x9686('0x8'));var client=jayson['client'][_0x9686('0x9')]({'port':0x232a});config[_0x9686('0xa')]=_[_0x9686('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9686('0xc'))(new Redis(config[_0x9686('0xa')]));require(_0x9686('0xd'))[_0x9686('0xe')](socket);function respondWithRpcPromise(_0x4db745,_0x464155,_0x2a62e8){return new BPromise(function(_0x155de1,_0x2088aa){return client[_0x9686('0xf')](_0x4db745,_0x2a62e8)['then'](function(_0x58d9b6){logger['info'](_0x9686('0x10'),_0x464155,_0x9686('0x11'));logger[_0x9686('0x12')](_0x9686('0x13'),_0x464155,_0x9686('0x11'),JSON[_0x9686('0x14')](_0x58d9b6));if(_0x58d9b6['error']){if(_0x58d9b6[_0x9686('0x15')][_0x9686('0x16')]===0x1f4){logger['error'](_0x9686('0x10'),_0x464155,_0x58d9b6[_0x9686('0x15')][_0x9686('0x17')]);return _0x2088aa(_0x58d9b6[_0x9686('0x15')][_0x9686('0x17')]);}logger[_0x9686('0x15')]('UserProfile,\x20%s,\x20%s',_0x464155,_0x58d9b6[_0x9686('0x15')][_0x9686('0x17')]);return _0x155de1(_0x58d9b6[_0x9686('0x15')][_0x9686('0x17')]);}else{logger[_0x9686('0x18')](_0x9686('0x10'),_0x464155,_0x9686('0x11'));_0x155de1(_0x58d9b6[_0x9686('0x19')][_0x9686('0x17')]);}})['catch'](function(_0x31b688){logger[_0x9686('0x15')](_0x9686('0x10'),_0x464155,_0x31b688);_0x2088aa(_0x31b688);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 1654aac..2b35035 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 _0xd93a=['save','remove','update','register','length','userProfile:','./userProfile.events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd93a,0xd8));var _0xad93=function(_0x2913a5,_0x55fe24){_0x2913a5=_0x2913a5-0x0;var _0x4e6437=_0xd93a[_0x2913a5];return _0x4e6437;};'use strict';var UserProfileEvents=require(_0xad93('0x0'));var events=[_0xad93('0x1'),_0xad93('0x2'),_0xad93('0x3')];function createListener(_0x1dcb9c,_0x30f198){return function(_0x1734c2){_0x30f198['emit'](_0x1dcb9c,_0x1734c2);};}function removeListener(_0x1a7a37,_0x584489){return function(){UserProfileEvents['removeListener'](_0x1a7a37,_0x584489);};}exports[_0xad93('0x4')]=function(_0x1fa586){for(var _0xb02e17=0x0,_0x147b93=events[_0xad93('0x5')];_0xb02e17<_0x147b93;_0xb02e17++){var _0x5369d8=events[_0xb02e17];var _0x2ae833=createListener(_0xad93('0x6')+_0x5369d8,_0x1fa586);UserProfileEvents['on'](_0x5369d8,_0x2ae833);}}; \ No newline at end of file +var _0x658c=['update','emit','length','userProfile:','./userProfile.events','save'];(function(_0x11fdaf,_0x1f519c){var _0x1bc53a=function(_0x3180cc){while(--_0x3180cc){_0x11fdaf['push'](_0x11fdaf['shift']());}};_0x1bc53a(++_0x1f519c);}(_0x658c,0x18a));var _0xc658=function(_0x2097fc,_0x50a0bf){_0x2097fc=_0x2097fc-0x0;var _0x2fcdf4=_0x658c[_0x2097fc];return _0x2fcdf4;};'use strict';var UserProfileEvents=require(_0xc658('0x0'));var events=[_0xc658('0x1'),'remove',_0xc658('0x2')];function createListener(_0x5f58d5,_0x5d07fd){return function(_0x4a2730){_0x5d07fd[_0xc658('0x3')](_0x5f58d5,_0x4a2730);};}function removeListener(_0x1036bd,_0x22788b){return function(){UserProfileEvents['removeListener'](_0x1036bd,_0x22788b);};}exports['register']=function(_0x244623){for(var _0x1c96a6=0x0,_0x264bab=events[_0xc658('0x4')];_0x1c96a6<_0x264bab;_0x1c96a6++){var _0x3108fa=events[_0x1c96a6];var _0x303e4a=createListener(_0xc658('0x5')+_0x3108fa,_0x244623);UserProfileEvents['on'](_0x3108fa,_0x303e4a);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 4cb700c..3b95e60 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 _0xe7dc=['../../config/environment','./userProfileResource.controller','get','index','describe','/:id','show','post','put','isAuthenticated','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x32e649,_0x228649){var _0x14d386=function(_0x3fb3ed){while(--_0x3fb3ed){_0x32e649['push'](_0x32e649['shift']());}};_0x14d386(++_0x228649);}(_0xe7dc,0x186));var _0xce7d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe7dc[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xce7d('0x0'));var path=require(_0xce7d('0x1'));var timeout=require(_0xce7d('0x2'));var express=require(_0xce7d('0x3'));var router=express[_0xce7d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xce7d('0x5'));var config=require(_0xce7d('0x6'));var controller=require(_0xce7d('0x7'));router[_0xce7d('0x8')]('/',auth['isAuthenticated'](),controller[_0xce7d('0x9')]);router[_0xce7d('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xce7d('0xa')]);router[_0xce7d('0x8')](_0xce7d('0xb'),auth['isAuthenticated'](),controller[_0xce7d('0xc')]);router[_0xce7d('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xce7d('0xe')](_0xce7d('0xb'),auth[_0xce7d('0xf')](),controller['update']);router[_0xce7d('0x10')](_0xce7d('0xb'),auth[_0xce7d('0xf')](),controller['destroy']);module[_0xce7d('0x11')]=router; \ No newline at end of file +var _0x1088=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x19bb1f,_0x4b45ec){var _0x4a41b8=function(_0x71a138){while(--_0x71a138){_0x19bb1f['push'](_0x19bb1f['shift']());}};_0x4a41b8(++_0x4b45ec);}(_0x1088,0x160));var _0x8108=function(_0x37b136,_0x46b3e8){_0x37b136=_0x37b136-0x0;var _0x4a7a95=_0x1088[_0x37b136];return _0x4a7a95;};'use strict';var multer=require(_0x8108('0x0'));var util=require(_0x8108('0x1'));var path=require(_0x8108('0x2'));var timeout=require(_0x8108('0x3'));var express=require(_0x8108('0x4'));var router=express[_0x8108('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8108('0x6'));var interaction=require(_0x8108('0x7'));var config=require(_0x8108('0x8'));var controller=require('./userProfileResource.controller');router[_0x8108('0x9')]('/',auth[_0x8108('0xa')](),controller[_0x8108('0xb')]);router[_0x8108('0x9')](_0x8108('0xc'),auth[_0x8108('0xa')](),controller[_0x8108('0xd')]);router['get'](_0x8108('0xe'),auth[_0x8108('0xa')](),controller[_0x8108('0xf')]);router['post']('/',auth[_0x8108('0xa')](),controller[_0x8108('0x10')]);router['put'](_0x8108('0xe'),auth[_0x8108('0xa')](),controller['update']);router[_0x8108('0x11')](_0x8108('0xe'),auth['isAuthenticated'](),controller[_0x8108('0x12')]);module[_0x8108('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index e853b2a..f3fab42 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 _0x512d=['STRING','INTEGER','exports'];(function(_0x40aae1,_0x5cb495){var _0x4b9c80=function(_0x3772af){while(--_0x3772af){_0x40aae1['push'](_0x40aae1['shift']());}};_0x4b9c80(++_0x5cb495);}(_0x512d,0x19d));var _0xd512=function(_0x21d869,_0x2550ef){_0x21d869=_0x21d869-0x0;var _0x105271=_0x512d[_0x21d869];return _0x105271;};'use strict';var Sequelize=require('sequelize');module[_0xd512('0x0')]={'name':{'type':Sequelize[_0xd512('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xd512('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x30bf=['INTEGER','STRING','sequelize','exports'];(function(_0x3f8149,_0x389d82){var _0x231099=function(_0xd35f51){while(--_0xd35f51){_0x3f8149['push'](_0x3f8149['shift']());}};_0x231099(++_0x389d82);}(_0x30bf,0xde));var _0xf30b=function(_0x17054b,_0x57366f){_0x17054b=_0x17054b-0x0;var _0x207ca6=_0x30bf[_0x17054b];return _0x207ca6;};'use strict';var Sequelize=require(_0xf30b('0x0'));module[_0xf30b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xf30b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf30b('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index c80e25a..6b3c5af 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 _0xb016=['util','path','to-csv','ejs','fs-extra','crypto','jsforce','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','apply','reject','save','then','destroy','end','error','name','send','index','map','UserProfileResource','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','find','body','describe','eml-format','rimraf','request-promise','bluebird','mustache'];(function(_0xa77681,_0x26dd0b){var _0x2f9604=function(_0xaf821b){while(--_0xaf821b){_0xa77681['push'](_0xa77681['shift']());}};_0x2f9604(++_0x26dd0b);}(_0xb016,0x159));var _0x6b01=function(_0x4573f1,_0x329c84){_0x4573f1=_0x4573f1-0x0;var _0xaed2dd=_0xb016[_0x4573f1];return _0xaed2dd;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['create']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['create'](_0x408bb0['body'],{})['then'](respondWithResult(_0x27442e,0xc9))[_0x6b01('0x40')](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x518d94,_0x34cef6){if(_0x518d94['body']['id']){delete _0x518d94['body']['id'];}return db['UserProfileResource'][_0x6b01('0x43')]({'where':{'id':_0x518d94[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x34cef6,null))['then'](saveUpdates(_0x518d94[_0x6b01('0x44')],null))['then'](respondWithResult(_0x34cef6,null))[_0x6b01('0x40')](handleError(_0x34cef6,null));};exports[_0x6b01('0x22')]=function(_0x32d446,_0x172a56){return db[_0x6b01('0x29')]['find']({'where':{'id':_0x32d446[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x172a56,null))[_0x6b01('0x21')](removeEntity(_0x172a56,null))['catch'](handleError(_0x172a56,null));};exports[_0x6b01('0x45')]=function(_0x13ab4f,_0x5617d7){return db[_0x6b01('0x29')][_0x6b01('0x45')]()[_0x6b01('0x21')](respondWithResult(_0x5617d7,null))[_0x6b01('0x40')](handleError(_0x5617d7,null));}; \ No newline at end of file +var _0x0598=['include','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','json','undefined','limit','count','offset','set','apply','update','destroy','then','end','error','stack','name','index','map','UserProfileResource','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x0598,0x92));var _0x8059=function(_0x14bbae,_0x58e0a9){_0x14bbae=_0x14bbae-0x0;var _0x12877d=_0x0598[_0x14bbae];return _0x12877d;};'use strict';var emlformat=require(_0x8059('0x0'));var rimraf=require(_0x8059('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8059('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8059('0x3'));var Mustache=require(_0x8059('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8059('0x5'));var ejs=require(_0x8059('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8059('0x7'));var crypto=require(_0x8059('0x8'));var jsforce=require(_0x8059('0x9'));var deskjs=require(_0x8059('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8059('0xb'));var Redis=require(_0x8059('0xc'));var authService=require(_0x8059('0xd'));var qs=require(_0x8059('0xe'));var as=require(_0x8059('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8059('0x10'));var utils=require(_0x8059('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ead10,_0x2d26e2){_0x2d26e2=_0x2d26e2||0xcc;return function(_0x306467){if(_0x306467){return _0x1ead10[_0x8059('0x12')](_0x2d26e2);}return _0x1ead10[_0x8059('0x13')](_0x2d26e2)['end']();};}function respondWithResult(_0x11218f,_0x5480a5){_0x5480a5=_0x5480a5||0xc8;return function(_0x346b23){if(_0x346b23){return _0x11218f['status'](_0x5480a5)[_0x8059('0x14')](_0x346b23);}};}function respondWithFilteredResult(_0x13bf07,_0x4810fd){return function(_0x4d3873){if(_0x4d3873){var _0x516c1f=typeof _0x4810fd['offset']===_0x8059('0x15')&&typeof _0x4810fd[_0x8059('0x16')]===_0x8059('0x15');var _0x246c9d=_0x4d3873[_0x8059('0x17')];var _0x4b6d55=_0x516c1f?0x0:_0x4810fd[_0x8059('0x18')];var _0x2bb670=_0x516c1f?_0x4d3873[_0x8059('0x17')]:_0x4810fd[_0x8059('0x18')]+_0x4810fd['limit'];var _0x5456a9;if(_0x2bb670>=_0x246c9d){_0x2bb670=_0x246c9d;_0x5456a9=0xc8;}else{_0x5456a9=0xce;}_0x13bf07['status'](_0x5456a9);return _0x13bf07[_0x8059('0x19')]('Content-Range',_0x4b6d55+'-'+_0x2bb670+'/'+_0x246c9d)[_0x8059('0x14')](_0x4d3873);}return null;};}function patchUpdates(_0x56d794){return function(_0x466a88){try{jsonpatch[_0x8059('0x1a')](_0x466a88,_0x56d794,!![]);}catch(_0x1e9ac5){return BPromise['reject'](_0x1e9ac5);}return _0x466a88['save']();};}function saveUpdates(_0x21a80f,_0x232f1b){return function(_0x32aeda){if(_0x32aeda){return _0x32aeda[_0x8059('0x1b')](_0x21a80f)['then'](function(_0x3bc226){return _0x3bc226;});}return null;};}function removeEntity(_0x21ac82,_0x3da080){return function(_0x5449d9){if(_0x5449d9){return _0x5449d9[_0x8059('0x1c')]()[_0x8059('0x1d')](function(){_0x21ac82[_0x8059('0x13')](0xcc)[_0x8059('0x1e')]();});}};}function handleEntityNotFound(_0x59d3a6,_0x140f64){return function(_0x2cd179){if(!_0x2cd179){_0x59d3a6[_0x8059('0x12')](0x194);}return _0x2cd179;};}function handleError(_0x3e2d2b,_0x202b30){_0x202b30=_0x202b30||0x1f4;return function(_0x54b88b){logger[_0x8059('0x1f')](_0x54b88b[_0x8059('0x20')]);if(_0x54b88b[_0x8059('0x21')]){delete _0x54b88b['name'];}_0x3e2d2b['status'](_0x202b30)['send'](_0x54b88b);};}exports[_0x8059('0x22')]=function(_0xbebe0e,_0xc32b1f){var _0x1009af={},_0x59abe9={},_0x1eb71b={'count':0x0,'rows':[]};var _0x50b737=_[_0x8059('0x23')](db[_0x8059('0x24')]['rawAttributes'],function(_0x3814f5){return{'name':_0x3814f5[_0x8059('0x25')],'type':_0x3814f5[_0x8059('0x26')][_0x8059('0x27')]};});_0x59abe9[_0x8059('0x28')]=_[_0x8059('0x23')](_0x50b737,_0x8059('0x21'));_0x59abe9[_0x8059('0x29')]=_['keys'](_0xbebe0e[_0x8059('0x29')]);_0x59abe9[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],_0x59abe9[_0x8059('0x29')]);_0x1009af['attributes']=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],qs[_0x8059('0x2c')](_0xbebe0e[_0x8059('0x29')][_0x8059('0x2c')]));_0x1009af[_0x8059('0x2d')]=_0x1009af[_0x8059('0x2d')][_0x8059('0x2e')]?_0x1009af[_0x8059('0x2d')]:_0x59abe9[_0x8059('0x28')];if(!_0xbebe0e['query'][_0x8059('0x2f')]('nolimit')){_0x1009af[_0x8059('0x16')]=qs['limit'](_0xbebe0e['query'][_0x8059('0x16')]);_0x1009af['offset']=qs[_0x8059('0x18')](_0xbebe0e['query'][_0x8059('0x18')]);}_0x1009af['order']=qs[_0x8059('0x30')](_0xbebe0e[_0x8059('0x29')]['sort']);_0x1009af[_0x8059('0x31')]=qs[_0x8059('0x2a')](_[_0x8059('0x32')](_0xbebe0e['query'],_0x59abe9[_0x8059('0x2a')]),_0x50b737);if(_0xbebe0e['query'][_0x8059('0x33')]){_0x1009af['where']=_[_0x8059('0x34')](_0x1009af[_0x8059('0x31')],{'$or':_[_0x8059('0x23')](_0x50b737,function(_0xb3b3c1){if(_0xb3b3c1['type']!==_0x8059('0x35')){var _0x55aaec={};_0x55aaec[_0xb3b3c1['name']]={'$like':'%'+_0xbebe0e[_0x8059('0x29')][_0x8059('0x33')]+'%'};return _0x55aaec;}})});}_0x1009af=_[_0x8059('0x34')]({},_0x1009af,_0xbebe0e[_0x8059('0x36')]);var _0x2f68b0={'where':_0x1009af['where']};return db['UserProfileResource']['count'](_0x2f68b0)['then'](function(_0x373e10){_0x1eb71b[_0x8059('0x17')]=_0x373e10;if(_0xbebe0e[_0x8059('0x29')]['includeAll']){_0x1009af[_0x8059('0x37')]=[{'all':!![]}];}return db[_0x8059('0x24')]['findAll'](_0x1009af);})[_0x8059('0x1d')](function(_0x2980cb){_0x1eb71b[_0x8059('0x38')]=_0x2980cb;return _0x1eb71b;})['then'](respondWithFilteredResult(_0xc32b1f,_0x1009af))[_0x8059('0x39')](handleError(_0xc32b1f,null));};exports[_0x8059('0x3a')]=function(_0x57eb56,_0x338493){var _0x280047={'raw':![],'where':{'id':_0x57eb56[_0x8059('0x3b')]['id']}},_0x3f00de={};_0x3f00de[_0x8059('0x28')]=_[_0x8059('0x3c')](db[_0x8059('0x24')][_0x8059('0x3d')]);_0x3f00de[_0x8059('0x29')]=_[_0x8059('0x3c')](_0x57eb56[_0x8059('0x29')]);_0x3f00de[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],_0x3f00de[_0x8059('0x29')]);_0x280047[_0x8059('0x2d')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],qs[_0x8059('0x2c')](_0x57eb56[_0x8059('0x29')][_0x8059('0x2c')]));_0x280047[_0x8059('0x2d')]=_0x280047[_0x8059('0x2d')]['length']?_0x280047[_0x8059('0x2d')]:_0x3f00de['model'];if(_0x57eb56['query'][_0x8059('0x3e')]){_0x280047['include']=[{'all':!![]}];}_0x280047=_[_0x8059('0x34')]({},_0x280047,_0x57eb56['options']);return db[_0x8059('0x24')][_0x8059('0x3f')](_0x280047)[_0x8059('0x1d')](handleEntityNotFound(_0x338493,null))[_0x8059('0x1d')](respondWithResult(_0x338493,null))[_0x8059('0x39')](handleError(_0x338493,null));};exports[_0x8059('0x40')]=function(_0x538ab6,_0x301dca){return db['UserProfileResource'][_0x8059('0x40')](_0x538ab6[_0x8059('0x41')],{})[_0x8059('0x1d')](respondWithResult(_0x301dca,0xc9))['catch'](handleError(_0x301dca,null));};exports[_0x8059('0x1b')]=function(_0x120665,_0x46bec8){if(_0x120665[_0x8059('0x41')]['id']){delete _0x120665['body']['id'];}return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x120665[_0x8059('0x3b')]['id']}})['then'](handleEntityNotFound(_0x46bec8,null))[_0x8059('0x1d')](saveUpdates(_0x120665['body'],null))['then'](respondWithResult(_0x46bec8,null))[_0x8059('0x39')](handleError(_0x46bec8,null));};exports['destroy']=function(_0x20caa3,_0x54d2d2){return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x20caa3['params']['id']}})[_0x8059('0x1d')](handleEntityNotFound(_0x54d2d2,null))['then'](removeEntity(_0x54d2d2,null))[_0x8059('0x39')](handleError(_0x54d2d2,null));};exports[_0x8059('0x42')]=function(_0x429cf0,_0x5d5f16){return db[_0x8059('0x24')]['describe']()[_0x8059('0x1d')](respondWithResult(_0x5d5f16,null))[_0x8059('0x39')](handleError(_0x5d5f16,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 8163421..1c01caa 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 _0x814d=['sectionId','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex'];(function(_0x238d76,_0x542717){var _0x1dbf3f=function(_0x4ee26b){while(--_0x4ee26b){_0x238d76['push'](_0x238d76['shift']());}};_0x1dbf3f(++_0x542717);}(_0x814d,0x88));var _0xd814=function(_0x5c62bf,_0x4844e0){_0x5c62bf=_0x5c62bf-0x0;var _0x3533c2=_0x814d[_0x5c62bf];return _0x3533c2;};'use strict';var _=require(_0xd814('0x0'));var util=require(_0xd814('0x1'));var logger=require(_0xd814('0x2'))(_0xd814('0x3'));var moment=require('moment');var BPromise=require(_0xd814('0x4'));var rp=require(_0xd814('0x5'));var fs=require('fs');var path=require(_0xd814('0x6'));var rimraf=require('rimraf');var config=require(_0xd814('0x7'));var attributes=require(_0xd814('0x8'));module[_0xd814('0x9')]=function(_0x251fb1,_0x1eeb63){return _0x251fb1[_0xd814('0xa')](_0xd814('0xb'),attributes,{'tableName':_0xd814('0xc'),'paranoid':![],'indexes':[{'name':_0xd814('0xd'),'fields':['resourceId',_0xd814('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x93f7=['exports','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','moment','bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x93f7,0x158));var _0x793f=function(_0x430204,_0x9d70ed){_0x430204=_0x430204-0x0;var _0x3819c7=_0x93f7[_0x430204];return _0x3819c7;};'use strict';var _=require(_0x793f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x793f('0x1'));var BPromise=require(_0x793f('0x2'));var rp=require(_0x793f('0x3'));var fs=require('fs');var path=require(_0x793f('0x4'));var rimraf=require('rimraf');var config=require(_0x793f('0x5'));var attributes=require(_0x793f('0x6'));module[_0x793f('0x7')]=function(_0x48bfb8,_0x5555fc){return _0x48bfb8[_0x793f('0x8')]('UserProfileResource',attributes,{'tableName':_0x793f('0x9'),'paranoid':![],'indexes':[{'name':_0x793f('0xa'),'fields':[_0x793f('0xb'),_0x793f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 3166be3..8a131d2 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 _0x1896=['request\x20sent','debug','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','UserProfileResource,\x20%s,\x20%s'];(function(_0x65201d,_0x1e4940){var _0x2ed26f=function(_0x198862){while(--_0x198862){_0x65201d['push'](_0x65201d['shift']());}};_0x2ed26f(++_0x1e4940);}(_0x1896,0x125));var _0x6189=function(_0x17f129,_0x396813){_0x17f129=_0x17f129-0x0;var _0x2e923d=_0x1896[_0x17f129];return _0x2e923d;};'use strict';var _=require(_0x6189('0x0'));var util=require(_0x6189('0x1'));var moment=require(_0x6189('0x2'));var BPromise=require(_0x6189('0x3'));var rs=require(_0x6189('0x4'));var fs=require('fs');var Redis=require(_0x6189('0x5'));var db=require(_0x6189('0x6'))['db'];var utils=require(_0x6189('0x7'));var logger=require(_0x6189('0x8'))(_0x6189('0x9'));var config=require(_0x6189('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6189('0xb')][_0x6189('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28b470,_0x139181,_0x2499a4){return new BPromise(function(_0x51f4e2,_0x431cf0){return client['request'](_0x28b470,_0x2499a4)[_0x6189('0xd')](function(_0x57226f){logger['info'](_0x6189('0xe'),_0x139181,_0x6189('0xf'));logger[_0x6189('0x10')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x139181,_0x6189('0xf'),JSON[_0x6189('0x11')](_0x57226f));if(_0x57226f[_0x6189('0x12')]){if(_0x57226f[_0x6189('0x12')]['code']===0x1f4){logger[_0x6189('0x12')](_0x6189('0xe'),_0x139181,_0x57226f[_0x6189('0x12')][_0x6189('0x13')]);return _0x431cf0(_0x57226f[_0x6189('0x12')][_0x6189('0x13')]);}logger['error'](_0x6189('0xe'),_0x139181,_0x57226f[_0x6189('0x12')]['message']);return _0x51f4e2(_0x57226f[_0x6189('0x12')][_0x6189('0x13')]);}else{logger[_0x6189('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x139181,'request\x20sent');_0x51f4e2(_0x57226f[_0x6189('0x15')][_0x6189('0x13')]);}})['catch'](function(_0x1a96d4){logger[_0x6189('0x12')](_0x6189('0xe'),_0x139181,_0x1a96d4);_0x431cf0(_0x1a96d4);});});} \ No newline at end of file +var _0x6f2a=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x2bc46d,_0x450778){var _0x29b4ce=function(_0x45ee10){while(--_0x45ee10){_0x2bc46d['push'](_0x2bc46d['shift']());}};_0x29b4ce(++_0x450778);}(_0x6f2a,0x189));var _0xa6f2=function(_0x43d33d,_0x354519){_0x43d33d=_0x43d33d-0x0;var _0x4296c3=_0x6f2a[_0x43d33d];return _0x4296c3;};'use strict';var _=require(_0xa6f2('0x0'));var util=require('util');var moment=require(_0xa6f2('0x1'));var BPromise=require(_0xa6f2('0x2'));var rs=require(_0xa6f2('0x3'));var fs=require('fs');var Redis=require(_0xa6f2('0x4'));var db=require(_0xa6f2('0x5'))['db'];var utils=require(_0xa6f2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa6f2('0x7'));var jayson=require(_0xa6f2('0x8'));var client=jayson[_0xa6f2('0x9')][_0xa6f2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dc568,_0x3e785f,_0x27fc13){return new BPromise(function(_0x400149,_0x24340c){return client[_0xa6f2('0xb')](_0x2dc568,_0x27fc13)[_0xa6f2('0xc')](function(_0x23a9fe){logger[_0xa6f2('0xd')](_0xa6f2('0xe'),_0x3e785f,_0xa6f2('0xf'));logger['debug'](_0xa6f2('0x10'),_0x3e785f,_0xa6f2('0xf'),JSON['stringify'](_0x23a9fe));if(_0x23a9fe[_0xa6f2('0x11')]){if(_0x23a9fe[_0xa6f2('0x11')][_0xa6f2('0x12')]===0x1f4){logger[_0xa6f2('0x11')](_0xa6f2('0xe'),_0x3e785f,_0x23a9fe[_0xa6f2('0x11')][_0xa6f2('0x13')]);return _0x24340c(_0x23a9fe[_0xa6f2('0x11')]['message']);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x3e785f,_0x23a9fe['error'][_0xa6f2('0x13')]);return _0x400149(_0x23a9fe[_0xa6f2('0x11')][_0xa6f2('0x13')]);}else{logger[_0xa6f2('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x3e785f,'request\x20sent');_0x400149(_0x23a9fe[_0xa6f2('0x14')][_0xa6f2('0x13')]);}})[_0xa6f2('0x15')](function(_0x5de7a9){logger['error'](_0xa6f2('0xe'),_0x3e785f,_0x5de7a9);_0x24340c(_0x5de7a9);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 0dd6fd9..3a3cbe8 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 _0x6f11=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','delete'];(function(_0x2c0c0c,_0xcb00c2){var _0x27b9a1=function(_0x267ee8){while(--_0x267ee8){_0x2c0c0c['push'](_0x2c0c0c['shift']());}};_0x27b9a1(++_0xcb00c2);}(_0x6f11,0x95));var _0x16f1=function(_0x5925ed,_0x40d03d){_0x5925ed=_0x5925ed-0x0;var _0x1e1a99=_0x6f11[_0x5925ed];return _0x1e1a99;};'use strict';var multer=require('multer');var util=require(_0x16f1('0x0'));var path=require(_0x16f1('0x1'));var timeout=require(_0x16f1('0x2'));var express=require(_0x16f1('0x3'));var router=express[_0x16f1('0x4')]();var fs_extra=require(_0x16f1('0x5'));var auth=require(_0x16f1('0x6'));var interaction=require(_0x16f1('0x7'));var config=require(_0x16f1('0x8'));var controller=require(_0x16f1('0x9'));router[_0x16f1('0xa')]('/',auth[_0x16f1('0xb')](),controller[_0x16f1('0xc')]);router[_0x16f1('0xa')](_0x16f1('0xd'),auth[_0x16f1('0xb')](),controller[_0x16f1('0xe')]);router[_0x16f1('0xa')](_0x16f1('0xf'),auth[_0x16f1('0xb')](),controller[_0x16f1('0x10')]);router[_0x16f1('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x16f1('0xf'),auth[_0x16f1('0xb')](),controller['update']);router[_0x16f1('0x12')](_0x16f1('0xf'),auth[_0x16f1('0xb')](),controller[_0x16f1('0x13')]);module[_0x16f1('0x14')]=router; \ No newline at end of file +var _0x69c3=['post','create','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','describe','get','/:id','show'];(function(_0x3d206d,_0x5ca6dd){var _0x33ea93=function(_0x33d6d3){while(--_0x33d6d3){_0x3d206d['push'](_0x3d206d['shift']());}};_0x33ea93(++_0x5ca6dd);}(_0x69c3,0x10a));var _0x369c=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x69c3[_0x42bdad];return _0x122626;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x369c('0x0'));var timeout=require(_0x369c('0x1'));var express=require(_0x369c('0x2'));var router=express[_0x369c('0x3')]();var fs_extra=require(_0x369c('0x4'));var auth=require(_0x369c('0x5'));var interaction=require(_0x369c('0x6'));var config=require(_0x369c('0x7'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0x369c('0x8')](),controller[_0x369c('0x9')]);router['get']('/describe',auth[_0x369c('0x8')](),controller[_0x369c('0xa')]);router[_0x369c('0xb')](_0x369c('0xc'),auth[_0x369c('0x8')](),controller[_0x369c('0xd')]);router[_0x369c('0xe')]('/',auth[_0x369c('0x8')](),controller[_0x369c('0xf')]);router[_0x369c('0x10')](_0x369c('0xc'),auth[_0x369c('0x8')](),controller[_0x369c('0x11')]);router[_0x369c('0x12')](_0x369c('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x369c('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 beb496c..0182db8 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 _0xf7b4=['getDataValue','split','sequelize','STRING','INTEGER','setDataValue','crudPermissions','join'];(function(_0x453cd7,_0x2e0965){var _0x449e74=function(_0x21b9ff){while(--_0x21b9ff){_0x453cd7['push'](_0x453cd7['shift']());}};_0x449e74(++_0x2e0965);}(_0xf7b4,0x152));var _0x4f7b=function(_0x55d478,_0x516f1b){_0x55d478=_0x55d478-0x0;var _0x3b35b3=_0xf7b4[_0x55d478];return _0x3b35b3;};'use strict';var Sequelize=require(_0x4f7b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4f7b('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4f7b('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4f7b('0x1')],'set':function(_0x3e18fd){this[_0x4f7b('0x3')](_0x4f7b('0x4'),_0x3e18fd?_0x3e18fd[_0x4f7b('0x5')](''):[]);},'get':function(){return this[_0x4f7b('0x6')](_0x4f7b('0x4'))?this[_0x4f7b('0x6')](_0x4f7b('0x4'))[_0x4f7b('0x7')](''):[];}}}; \ No newline at end of file +var _0xb574=['BOOLEAN','setDataValue','crudPermissions','sequelize','exports','STRING','INTEGER'];(function(_0x43a759,_0x14b371){var _0x514ac9=function(_0x4f96e4){while(--_0x4f96e4){_0x43a759['push'](_0x43a759['shift']());}};_0x514ac9(++_0x14b371);}(_0xb574,0x106));var _0x4b57=function(_0x259636,_0xb3d31){_0x259636=_0x259636-0x0;var _0x5ab829=_0xb574[_0x259636];return _0x5ab829;};'use strict';var Sequelize=require(_0x4b57('0x0'));module[_0x4b57('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4b57('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4b57('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4b57('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4b57('0x2')],'set':function(_0x168524){this[_0x4b57('0x5')](_0x4b57('0x6'),_0x168524?_0x168524['join'](''):[]);},'get':function(){return this['getDataValue'](_0x4b57('0x6'))?this['getDataValue']('crudPermissions')['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index dfc919c..ac70727 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 _0x599d=['body','find','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','end','sendStatus','error','stack','name','send','map','UserProfileSection','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','include','rows','catch','show','includeAll','options'];(function(_0x5e5f6f,_0x6e7d2e){var _0x3cde7b=function(_0x125369){while(--_0x125369){_0x5e5f6f['push'](_0x5e5f6f['shift']());}};_0x3cde7b(++_0x6e7d2e);}(_0x599d,0x1c6));var _0xd599=function(_0x1e5e77,_0x1f483c){_0x1e5e77=_0x1e5e77-0x0;var _0x1ab455=_0x599d[_0x1e5e77];return _0x1ab455;};'use strict';var emlformat=require(_0xd599('0x0'));var rimraf=require(_0xd599('0x1'));var zipdir=require(_0xd599('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd599('0x3'));var moment=require('moment');var BPromise=require(_0xd599('0x4'));var Mustache=require(_0xd599('0x5'));var util=require(_0xd599('0x6'));var path=require(_0xd599('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd599('0x8'));var _=require(_0xd599('0x9'));var squel=require(_0xd599('0xa'));var crypto=require(_0xd599('0xb'));var jsforce=require(_0xd599('0xc'));var deskjs=require(_0xd599('0xd'));var toCsv=require(_0xd599('0xe'));var querystring=require(_0xd599('0xf'));var Papa=require(_0xd599('0x10'));var Redis=require(_0xd599('0x11'));var authService=require(_0xd599('0x12'));var qs=require(_0xd599('0x13'));var as=require(_0xd599('0x14'));var hardwareService=require(_0xd599('0x15'));var logger=require(_0xd599('0x16'))(_0xd599('0x17'));var utils=require(_0xd599('0x18'));var config=require(_0xd599('0x19'));var licenseUtil=require(_0xd599('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdefe29,_0x4cab88){_0x4cab88=_0x4cab88||0xcc;return function(_0x6e9240){if(_0x6e9240){return _0xdefe29['sendStatus'](_0x4cab88);}return _0xdefe29[_0xd599('0x1b')](_0x4cab88)['end']();};}function respondWithResult(_0xaeefc,_0xd4b44){_0xd4b44=_0xd4b44||0xc8;return function(_0x2c659f){if(_0x2c659f){return _0xaeefc[_0xd599('0x1b')](_0xd4b44)[_0xd599('0x1c')](_0x2c659f);}};}function respondWithFilteredResult(_0x4d5b6f,_0x1baeb7){return function(_0x1c6324){if(_0x1c6324){var _0x347678=typeof _0x1baeb7[_0xd599('0x1d')]==='undefined'&&typeof _0x1baeb7[_0xd599('0x1e')]===_0xd599('0x1f');var _0xcd9cd0=_0x1c6324[_0xd599('0x20')];var _0xfefe46=_0x347678?0x0:_0x1baeb7[_0xd599('0x1d')];var _0x1ce89f=_0x347678?_0x1c6324['count']:_0x1baeb7[_0xd599('0x1d')]+_0x1baeb7[_0xd599('0x1e')];var _0x115b18;if(_0x1ce89f>=_0xcd9cd0){_0x1ce89f=_0xcd9cd0;_0x115b18=0xc8;}else{_0x115b18=0xce;}_0x4d5b6f['status'](_0x115b18);return _0x4d5b6f[_0xd599('0x21')](_0xd599('0x22'),_0xfefe46+'-'+_0x1ce89f+'/'+_0xcd9cd0)[_0xd599('0x1c')](_0x1c6324);}return null;};}function patchUpdates(_0x566fd0){return function(_0x5303f3){try{jsonpatch[_0xd599('0x23')](_0x5303f3,_0x566fd0,!![]);}catch(_0x33a9e3){return BPromise['reject'](_0x33a9e3);}return _0x5303f3['save']();};}function saveUpdates(_0x5e093a,_0x435549){return function(_0x34d2b6){if(_0x34d2b6){return _0x34d2b6[_0xd599('0x24')](_0x5e093a)[_0xd599('0x25')](function(_0x2c50d9){return _0x2c50d9;});}return null;};}function removeEntity(_0x2f34d0,_0x11f6ef){return function(_0x119041){if(_0x119041){return _0x119041[_0xd599('0x26')]()[_0xd599('0x25')](function(){_0x2f34d0[_0xd599('0x1b')](0xcc)[_0xd599('0x27')]();});}};}function handleEntityNotFound(_0x21e704,_0x50f858){return function(_0x158254){if(!_0x158254){_0x21e704[_0xd599('0x28')](0x194);}return _0x158254;};}function handleError(_0x52ad61,_0x37550a){_0x37550a=_0x37550a||0x1f4;return function(_0x429363){logger[_0xd599('0x29')](_0x429363[_0xd599('0x2a')]);if(_0x429363['name']){delete _0x429363[_0xd599('0x2b')];}_0x52ad61[_0xd599('0x1b')](_0x37550a)[_0xd599('0x2c')](_0x429363);};}exports['index']=function(_0x9e6f8c,_0x4352fa){var _0x227b8b={},_0x342b8d={},_0xd6e523={'count':0x0,'rows':[]};var _0x18226d=_[_0xd599('0x2d')](db[_0xd599('0x2e')][_0xd599('0x2f')],function(_0x5840e2){return{'name':_0x5840e2['fieldName'],'type':_0x5840e2[_0xd599('0x30')][_0xd599('0x31')]};});_0x342b8d['model']=_[_0xd599('0x2d')](_0x18226d,_0xd599('0x2b'));_0x342b8d[_0xd599('0x32')]=_[_0xd599('0x33')](_0x9e6f8c[_0xd599('0x32')]);_0x342b8d[_0xd599('0x34')]=_[_0xd599('0x35')](_0x342b8d[_0xd599('0x36')],_0x342b8d[_0xd599('0x32')]);_0x227b8b[_0xd599('0x37')]=_[_0xd599('0x35')](_0x342b8d[_0xd599('0x36')],qs['fields'](_0x9e6f8c[_0xd599('0x32')][_0xd599('0x38')]));_0x227b8b[_0xd599('0x37')]=_0x227b8b[_0xd599('0x37')][_0xd599('0x39')]?_0x227b8b[_0xd599('0x37')]:_0x342b8d[_0xd599('0x36')];if(!_0x9e6f8c['query'][_0xd599('0x3a')](_0xd599('0x3b'))){_0x227b8b['limit']=qs[_0xd599('0x1e')](_0x9e6f8c[_0xd599('0x32')][_0xd599('0x1e')]);_0x227b8b[_0xd599('0x1d')]=qs[_0xd599('0x1d')](_0x9e6f8c['query']['offset']);}_0x227b8b[_0xd599('0x3c')]=qs[_0xd599('0x3d')](_0x9e6f8c[_0xd599('0x32')]['sort']);_0x227b8b[_0xd599('0x3e')]=qs['filters'](_['pick'](_0x9e6f8c['query'],_0x342b8d[_0xd599('0x34')]),_0x18226d);if(_0x9e6f8c[_0xd599('0x32')][_0xd599('0x3f')]){_0x227b8b[_0xd599('0x3e')]=_[_0xd599('0x40')](_0x227b8b[_0xd599('0x3e')],{'$or':_[_0xd599('0x2d')](_0x18226d,function(_0x5c0ccb){if(_0x5c0ccb[_0xd599('0x30')]!=='VIRTUAL'){var _0x681958={};_0x681958[_0x5c0ccb['name']]={'$like':'%'+_0x9e6f8c[_0xd599('0x32')][_0xd599('0x3f')]+'%'};return _0x681958;}})});}_0x227b8b=_['merge']({},_0x227b8b,_0x9e6f8c['options']);var _0x5b0360={'where':_0x227b8b[_0xd599('0x3e')]};return db[_0xd599('0x2e')][_0xd599('0x20')](_0x5b0360)[_0xd599('0x25')](function(_0x1f5f6a){_0xd6e523[_0xd599('0x20')]=_0x1f5f6a;if(_0x9e6f8c[_0xd599('0x32')]['includeAll']){_0x227b8b[_0xd599('0x41')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x227b8b);})['then'](function(_0x43c5bc){_0xd6e523[_0xd599('0x42')]=_0x43c5bc;return _0xd6e523;})[_0xd599('0x25')](respondWithFilteredResult(_0x4352fa,_0x227b8b))[_0xd599('0x43')](handleError(_0x4352fa,null));};exports[_0xd599('0x44')]=function(_0x57590d,_0x5a7079){var _0x47270b={'raw':![],'where':{'id':_0x57590d['params']['id']}},_0x3f8c4c={};_0x3f8c4c[_0xd599('0x36')]=_['keys'](db['UserProfileSection'][_0xd599('0x2f')]);_0x3f8c4c['query']=_[_0xd599('0x33')](_0x57590d[_0xd599('0x32')]);_0x3f8c4c[_0xd599('0x34')]=_[_0xd599('0x35')](_0x3f8c4c['model'],_0x3f8c4c['query']);_0x47270b[_0xd599('0x37')]=_[_0xd599('0x35')](_0x3f8c4c[_0xd599('0x36')],qs['fields'](_0x57590d[_0xd599('0x32')][_0xd599('0x38')]));_0x47270b['attributes']=_0x47270b['attributes'][_0xd599('0x39')]?_0x47270b[_0xd599('0x37')]:_0x3f8c4c[_0xd599('0x36')];if(_0x57590d['query'][_0xd599('0x45')]){_0x47270b[_0xd599('0x41')]=[{'all':!![]}];}_0x47270b=_[_0xd599('0x40')]({},_0x47270b,_0x57590d[_0xd599('0x46')]);return db[_0xd599('0x2e')]['find'](_0x47270b)[_0xd599('0x25')](handleEntityNotFound(_0x5a7079,null))[_0xd599('0x25')](respondWithResult(_0x5a7079,null))['catch'](handleError(_0x5a7079,null));};exports['create']=function(_0x420487,_0x339a4b){return db['UserProfileSection']['create'](_0x420487[_0xd599('0x47')],{})['then'](respondWithResult(_0x339a4b,0xc9))['catch'](handleError(_0x339a4b,null));};exports[_0xd599('0x24')]=function(_0x35934b,_0x3847cb){if(_0x35934b[_0xd599('0x47')]['id']){delete _0x35934b['body']['id'];}return db['UserProfileSection'][_0xd599('0x48')]({'where':{'id':_0x35934b[_0xd599('0x49')]['id']}})[_0xd599('0x25')](handleEntityNotFound(_0x3847cb,null))[_0xd599('0x25')](saveUpdates(_0x35934b['body'],null))['then'](respondWithResult(_0x3847cb,null))[_0xd599('0x43')](handleError(_0x3847cb,null));};exports['destroy']=function(_0xa12521,_0x387228){return db[_0xd599('0x2e')][_0xd599('0x48')]({'where':{'id':_0xa12521['params']['id']}})[_0xd599('0x25')](handleEntityNotFound(_0x387228,null))[_0xd599('0x25')](removeEntity(_0x387228,null))[_0xd599('0x43')](handleError(_0x387228,null));};exports[_0xd599('0x4a')]=function(_0x3fc3ae,_0x36f506){return db[_0xd599('0x2e')][_0xd599('0x4a')]()[_0xd599('0x25')](respondWithResult(_0x36f506,null))[_0xd599('0x43')](handleError(_0x36f506,null));}; \ No newline at end of file +var _0x6bd4=['catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','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','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','order','where','filters','pick','merge','VIRTUAL','options','UserProfileSection','includeAll','include','rows','show','params','find'];(function(_0x5189de,_0x561558){var _0xe73585=function(_0x404fdf){while(--_0x404fdf){_0x5189de['push'](_0x5189de['shift']());}};_0xe73585(++_0x561558);}(_0x6bd4,0xeb));var _0x46bd=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x6bd4[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require(_0x46bd('0x0'));var rimraf=require(_0x46bd('0x1'));var zipdir=require(_0x46bd('0x2'));var jsonpatch=require(_0x46bd('0x3'));var rp=require(_0x46bd('0x4'));var moment=require(_0x46bd('0x5'));var BPromise=require(_0x46bd('0x6'));var Mustache=require('mustache');var util=require(_0x46bd('0x7'));var path=require(_0x46bd('0x8'));var sox=require(_0x46bd('0x9'));var csv=require(_0x46bd('0xa'));var ejs=require(_0x46bd('0xb'));var fs=require('fs');var fs_extra=require(_0x46bd('0xc'));var _=require(_0x46bd('0xd'));var squel=require(_0x46bd('0xe'));var crypto=require(_0x46bd('0xf'));var jsforce=require(_0x46bd('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x46bd('0xa'));var querystring=require(_0x46bd('0x11'));var Papa=require(_0x46bd('0x12'));var Redis=require(_0x46bd('0x13'));var authService=require(_0x46bd('0x14'));var qs=require(_0x46bd('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46bd('0x16'));var logger=require(_0x46bd('0x17'))('api');var utils=require(_0x46bd('0x18'));var config=require(_0x46bd('0x19'));var licenseUtil=require(_0x46bd('0x1a'));var db=require(_0x46bd('0x1b'))['db'];function respondWithStatusCode(_0x5a9b67,_0x5a964a){_0x5a964a=_0x5a964a||0xcc;return function(_0x89f84a){if(_0x89f84a){return _0x5a9b67[_0x46bd('0x1c')](_0x5a964a);}return _0x5a9b67[_0x46bd('0x1d')](_0x5a964a)[_0x46bd('0x1e')]();};}function respondWithResult(_0x558dc2,_0x1551a4){_0x1551a4=_0x1551a4||0xc8;return function(_0x2ce300){if(_0x2ce300){return _0x558dc2[_0x46bd('0x1d')](_0x1551a4)[_0x46bd('0x1f')](_0x2ce300);}};}function respondWithFilteredResult(_0x4cf65a,_0x15d7cb){return function(_0x2e4916){if(_0x2e4916){var _0x2e708a=typeof _0x15d7cb[_0x46bd('0x20')]===_0x46bd('0x21')&&typeof _0x15d7cb[_0x46bd('0x22')]==='undefined';var _0x20116b=_0x2e4916[_0x46bd('0x23')];var _0x35ef9f=_0x2e708a?0x0:_0x15d7cb[_0x46bd('0x20')];var _0x13f0bf=_0x2e708a?_0x2e4916[_0x46bd('0x23')]:_0x15d7cb[_0x46bd('0x20')]+_0x15d7cb[_0x46bd('0x22')];var _0x324f94;if(_0x13f0bf>=_0x20116b){_0x13f0bf=_0x20116b;_0x324f94=0xc8;}else{_0x324f94=0xce;}_0x4cf65a[_0x46bd('0x1d')](_0x324f94);return _0x4cf65a[_0x46bd('0x24')](_0x46bd('0x25'),_0x35ef9f+'-'+_0x13f0bf+'/'+_0x20116b)['json'](_0x2e4916);}return null;};}function patchUpdates(_0x264bc3){return function(_0x415a83){try{jsonpatch[_0x46bd('0x26')](_0x415a83,_0x264bc3,!![]);}catch(_0x156378){return BPromise[_0x46bd('0x27')](_0x156378);}return _0x415a83[_0x46bd('0x28')]();};}function saveUpdates(_0x1ff434,_0x2d7dda){return function(_0x272195){if(_0x272195){return _0x272195['update'](_0x1ff434)[_0x46bd('0x29')](function(_0x298b70){return _0x298b70;});}return null;};}function removeEntity(_0x216fbd,_0x253708){return function(_0x7f3e22){if(_0x7f3e22){return _0x7f3e22[_0x46bd('0x2a')]()['then'](function(){_0x216fbd['status'](0xcc)[_0x46bd('0x1e')]();});}};}function handleEntityNotFound(_0x3c7e72,_0x407e47){return function(_0x434341){if(!_0x434341){_0x3c7e72['sendStatus'](0x194);}return _0x434341;};}function handleError(_0x1e9355,_0x9d01ec){_0x9d01ec=_0x9d01ec||0x1f4;return function(_0x2073c7){logger[_0x46bd('0x2b')](_0x2073c7[_0x46bd('0x2c')]);if(_0x2073c7[_0x46bd('0x2d')]){delete _0x2073c7[_0x46bd('0x2d')];}_0x1e9355[_0x46bd('0x1d')](_0x9d01ec)['send'](_0x2073c7);};}exports[_0x46bd('0x2e')]=function(_0x3960fc,_0x13d895){var _0x122c89={},_0x18752d={},_0x3f4f64={'count':0x0,'rows':[]};var _0x38ffa7=_[_0x46bd('0x2f')](db['UserProfileSection']['rawAttributes'],function(_0xe7aef9){return{'name':_0xe7aef9[_0x46bd('0x30')],'type':_0xe7aef9[_0x46bd('0x31')][_0x46bd('0x32')]};});_0x18752d['model']=_[_0x46bd('0x2f')](_0x38ffa7,_0x46bd('0x2d'));_0x18752d['query']=_[_0x46bd('0x33')](_0x3960fc[_0x46bd('0x34')]);_0x18752d['filters']=_[_0x46bd('0x35')](_0x18752d[_0x46bd('0x36')],_0x18752d[_0x46bd('0x34')]);_0x122c89[_0x46bd('0x37')]=_[_0x46bd('0x35')](_0x18752d[_0x46bd('0x36')],qs[_0x46bd('0x38')](_0x3960fc[_0x46bd('0x34')][_0x46bd('0x38')]));_0x122c89[_0x46bd('0x37')]=_0x122c89[_0x46bd('0x37')][_0x46bd('0x39')]?_0x122c89[_0x46bd('0x37')]:_0x18752d[_0x46bd('0x36')];if(!_0x3960fc['query'][_0x46bd('0x3a')]('nolimit')){_0x122c89[_0x46bd('0x22')]=qs[_0x46bd('0x22')](_0x3960fc[_0x46bd('0x34')][_0x46bd('0x22')]);_0x122c89[_0x46bd('0x20')]=qs['offset'](_0x3960fc[_0x46bd('0x34')]['offset']);}_0x122c89[_0x46bd('0x3b')]=qs['sort'](_0x3960fc[_0x46bd('0x34')]['sort']);_0x122c89[_0x46bd('0x3c')]=qs[_0x46bd('0x3d')](_[_0x46bd('0x3e')](_0x3960fc[_0x46bd('0x34')],_0x18752d[_0x46bd('0x3d')]),_0x38ffa7);if(_0x3960fc[_0x46bd('0x34')]['filter']){_0x122c89[_0x46bd('0x3c')]=_[_0x46bd('0x3f')](_0x122c89[_0x46bd('0x3c')],{'$or':_[_0x46bd('0x2f')](_0x38ffa7,function(_0x549ef5){if(_0x549ef5[_0x46bd('0x31')]!==_0x46bd('0x40')){var _0x4bc7a7={};_0x4bc7a7[_0x549ef5[_0x46bd('0x2d')]]={'$like':'%'+_0x3960fc['query']['filter']+'%'};return _0x4bc7a7;}})});}_0x122c89=_[_0x46bd('0x3f')]({},_0x122c89,_0x3960fc[_0x46bd('0x41')]);var _0x40d7dc={'where':_0x122c89[_0x46bd('0x3c')]};return db[_0x46bd('0x42')][_0x46bd('0x23')](_0x40d7dc)[_0x46bd('0x29')](function(_0x53d046){_0x3f4f64[_0x46bd('0x23')]=_0x53d046;if(_0x3960fc[_0x46bd('0x34')][_0x46bd('0x43')]){_0x122c89[_0x46bd('0x44')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x122c89);})[_0x46bd('0x29')](function(_0x295d2d){_0x3f4f64[_0x46bd('0x45')]=_0x295d2d;return _0x3f4f64;})['then'](respondWithFilteredResult(_0x13d895,_0x122c89))['catch'](handleError(_0x13d895,null));};exports[_0x46bd('0x46')]=function(_0x4b0a35,_0x37142f){var _0x181af4={'raw':![],'where':{'id':_0x4b0a35[_0x46bd('0x47')]['id']}},_0x127b53={};_0x127b53[_0x46bd('0x36')]=_[_0x46bd('0x33')](db[_0x46bd('0x42')]['rawAttributes']);_0x127b53[_0x46bd('0x34')]=_[_0x46bd('0x33')](_0x4b0a35['query']);_0x127b53[_0x46bd('0x3d')]=_[_0x46bd('0x35')](_0x127b53['model'],_0x127b53[_0x46bd('0x34')]);_0x181af4[_0x46bd('0x37')]=_[_0x46bd('0x35')](_0x127b53[_0x46bd('0x36')],qs['fields'](_0x4b0a35[_0x46bd('0x34')][_0x46bd('0x38')]));_0x181af4[_0x46bd('0x37')]=_0x181af4[_0x46bd('0x37')][_0x46bd('0x39')]?_0x181af4['attributes']:_0x127b53[_0x46bd('0x36')];if(_0x4b0a35[_0x46bd('0x34')][_0x46bd('0x43')]){_0x181af4[_0x46bd('0x44')]=[{'all':!![]}];}_0x181af4=_[_0x46bd('0x3f')]({},_0x181af4,_0x4b0a35['options']);return db[_0x46bd('0x42')][_0x46bd('0x48')](_0x181af4)[_0x46bd('0x29')](handleEntityNotFound(_0x37142f,null))[_0x46bd('0x29')](respondWithResult(_0x37142f,null))[_0x46bd('0x49')](handleError(_0x37142f,null));};exports[_0x46bd('0x4a')]=function(_0x1e86bc,_0x576e85){return db[_0x46bd('0x42')]['create'](_0x1e86bc[_0x46bd('0x4b')],{})[_0x46bd('0x29')](respondWithResult(_0x576e85,0xc9))[_0x46bd('0x49')](handleError(_0x576e85,null));};exports['update']=function(_0xba5897,_0x53ec89){if(_0xba5897['body']['id']){delete _0xba5897['body']['id'];}return db[_0x46bd('0x42')][_0x46bd('0x48')]({'where':{'id':_0xba5897['params']['id']}})[_0x46bd('0x29')](handleEntityNotFound(_0x53ec89,null))[_0x46bd('0x29')](saveUpdates(_0xba5897[_0x46bd('0x4b')],null))['then'](respondWithResult(_0x53ec89,null))['catch'](handleError(_0x53ec89,null));};exports[_0x46bd('0x2a')]=function(_0x49d3dd,_0x25971a){return db[_0x46bd('0x42')][_0x46bd('0x48')]({'where':{'id':_0x49d3dd[_0x46bd('0x47')]['id']}})[_0x46bd('0x29')](handleEntityNotFound(_0x25971a,null))[_0x46bd('0x29')](removeEntity(_0x25971a,null))[_0x46bd('0x49')](handleError(_0x25971a,null));};exports[_0x46bd('0x4c')]=function(_0xe4dc89,_0x3badd2){return db[_0x46bd('0x42')][_0x46bd('0x4c')]()[_0x46bd('0x29')](respondWithResult(_0x3badd2,null))[_0x46bd('0x49')](handleError(_0x3badd2,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index f3fd05e..73efe10 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 _0xa31d=['../../config/logger','moment','bluebird','path','rimraf','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util'];(function(_0x47f2de,_0x23cbaa){var _0x1c34ed=function(_0x153b88){while(--_0x153b88){_0x47f2de['push'](_0x47f2de['shift']());}};_0x1c34ed(++_0x23cbaa);}(_0xa31d,0x132));var _0xda31=function(_0x375325,_0x57a850){_0x375325=_0x375325-0x0;var _0x228f57=_0xa31d[_0x375325];return _0x228f57;};'use strict';var _=require(_0xda31('0x0'));var util=require(_0xda31('0x1'));var logger=require(_0xda31('0x2'))('api');var moment=require(_0xda31('0x3'));var BPromise=require(_0xda31('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda31('0x5'));var rimraf=require(_0xda31('0x6'));var config=require('../../config/environment');var attributes=require(_0xda31('0x7'));module[_0xda31('0x8')]=function(_0x27b13f,_0x3fbdeb){return _0x27b13f['define'](_0xda31('0x9'),attributes,{'tableName':_0xda31('0xa'),'paranoid':![],'indexes':[{'name':_0xda31('0xb'),'fields':[_0xda31('0xc'),_0xda31('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd9c9=['../../config/logger','bluebird','request-promise','path','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xd9c9,0x103));var _0x9d9c=function(_0x453ef9,_0x2f5a9a){_0x453ef9=_0x453ef9-0x0;var _0x2f40a3=_0xd9c9[_0x453ef9];return _0x2f40a3;};'use strict';var _=require(_0x9d9c('0x0'));var util=require('util');var logger=require(_0x9d9c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9d9c('0x2'));var rp=require(_0x9d9c('0x3'));var fs=require('fs');var path=require(_0x9d9c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x2dfa09,_0x121f37){return _0x2dfa09['define'](_0x9d9c('0x5'),attributes,{'tableName':_0x9d9c('0x6'),'paranoid':![],'indexes':[{'name':_0x9d9c('0x7'),'fields':[_0x9d9c('0x8'),_0x9d9c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index c187ac7..9c3314d 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 _0xd05f=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xb58d0b,_0x285a1a){var _0x198edf=function(_0x28e194){while(--_0x28e194){_0xb58d0b['push'](_0xb58d0b['shift']());}};_0x198edf(++_0x285a1a);}(_0xd05f,0x102));var _0xfd05=function(_0x5b37c7,_0xb93edd){_0x5b37c7=_0x5b37c7-0x0;var _0x4142b7=_0xd05f[_0x5b37c7];return _0x4142b7;};'use strict';var _=require(_0xfd05('0x0'));var util=require(_0xfd05('0x1'));var moment=require(_0xfd05('0x2'));var BPromise=require(_0xfd05('0x3'));var rs=require(_0xfd05('0x4'));var fs=require('fs');var Redis=require(_0xfd05('0x5'));var db=require(_0xfd05('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd05('0x7'))('rpc');var config=require(_0xfd05('0x8'));var jayson=require(_0xfd05('0x9'));var client=jayson[_0xfd05('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15ee0e,_0x15390f,_0x4001ca){return new BPromise(function(_0x41a1e4,_0x3ae43e){return client[_0xfd05('0xb')](_0x15ee0e,_0x4001ca)[_0xfd05('0xc')](function(_0x49fde9){logger[_0xfd05('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x15390f,_0xfd05('0xe'));logger['debug'](_0xfd05('0xf'),_0x15390f,_0xfd05('0xe'),JSON['stringify'](_0x49fde9));if(_0x49fde9[_0xfd05('0x10')]){if(_0x49fde9['error'][_0xfd05('0x11')]===0x1f4){logger[_0xfd05('0x10')](_0xfd05('0x12'),_0x15390f,_0x49fde9[_0xfd05('0x10')][_0xfd05('0x13')]);return _0x3ae43e(_0x49fde9[_0xfd05('0x10')][_0xfd05('0x13')]);}logger[_0xfd05('0x10')](_0xfd05('0x12'),_0x15390f,_0x49fde9[_0xfd05('0x10')]['message']);return _0x41a1e4(_0x49fde9['error']['message']);}else{logger[_0xfd05('0xd')](_0xfd05('0x12'),_0x15390f,_0xfd05('0xe'));_0x41a1e4(_0x49fde9[_0xfd05('0x14')][_0xfd05('0x13')]);}})[_0xfd05('0x15')](function(_0x547900){logger['error'](_0xfd05('0x12'),_0x15390f,_0x547900);_0x3ae43e(_0x547900);});});} \ No newline at end of file +var _0xef4d=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x3a1156,_0x29daab){var _0x1b70cf=function(_0x4ce216){while(--_0x4ce216){_0x3a1156['push'](_0x3a1156['shift']());}};_0x1b70cf(++_0x29daab);}(_0xef4d,0xad));var _0xdef4=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xef4d[_0x34843e];return _0x598f7f;};'use strict';var _=require(_0xdef4('0x0'));var util=require(_0xdef4('0x1'));var moment=require('moment');var BPromise=require(_0xdef4('0x2'));var rs=require(_0xdef4('0x3'));var fs=require('fs');var Redis=require(_0xdef4('0x4'));var db=require(_0xdef4('0x5'))['db'];var utils=require(_0xdef4('0x6'));var logger=require('../../config/logger')(_0xdef4('0x7'));var config=require('../../config/environment');var jayson=require(_0xdef4('0x8'));var client=jayson[_0xdef4('0x9')][_0xdef4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c4ebf,_0x1fdb4a,_0x5d7f82){return new BPromise(function(_0x2f1cdb,_0x52e1ed){return client['request'](_0x3c4ebf,_0x5d7f82)[_0xdef4('0xb')](function(_0x176094){logger[_0xdef4('0xc')](_0xdef4('0xd'),_0x1fdb4a,_0xdef4('0xe'));logger[_0xdef4('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x1fdb4a,'request\x20sent',JSON[_0xdef4('0x10')](_0x176094));if(_0x176094[_0xdef4('0x11')]){if(_0x176094[_0xdef4('0x11')][_0xdef4('0x12')]===0x1f4){logger['error'](_0xdef4('0xd'),_0x1fdb4a,_0x176094[_0xdef4('0x11')][_0xdef4('0x13')]);return _0x52e1ed(_0x176094['error']['message']);}logger[_0xdef4('0x11')](_0xdef4('0xd'),_0x1fdb4a,_0x176094[_0xdef4('0x11')][_0xdef4('0x13')]);return _0x2f1cdb(_0x176094[_0xdef4('0x11')][_0xdef4('0x13')]);}else{logger['info'](_0xdef4('0xd'),_0x1fdb4a,_0xdef4('0xe'));_0x2f1cdb(_0x176094[_0xdef4('0x14')][_0xdef4('0x13')]);}})[_0xdef4('0x15')](function(_0x540b95){logger[_0xdef4('0x11')](_0xdef4('0xd'),_0x1fdb4a,_0x540b95);_0x52e1ed(_0x540b95);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 9522adb..40df6da 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(_0x50e6d7,_0x64c311){var _0x3df90e=function(_0x379bde){while(--_0x379bde){_0x50e6d7['push'](_0x50e6d7['shift']());}};_0x3df90e(++_0x64c311);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x95eba8,_0x128c50){var _0x54f606=function(_0x75bbce){while(--_0x75bbce){_0x95eba8['push'](_0x95eba8['shift']());}};_0x54f606(++_0x128c50);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index d2b0df7..a890b64 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 _0x41eb=['INTEGER','sequelize'];(function(_0x2dfa30,_0xf585a0){var _0x406c61=function(_0x500d38){while(--_0x500d38){_0x2dfa30['push'](_0x2dfa30['shift']());}};_0x406c61(++_0xf585a0);}(_0x41eb,0x7d));var _0xb41e=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0x41eb[_0x4da356];return _0x321b07;};'use strict';var Sequelize=require(_0xb41e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xb41e('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfada=['sequelize','exports'];(function(_0x15b34d,_0x54b59e){var _0x2fe9df=function(_0x5f0c83){while(--_0x5f0c83){_0x15b34d['push'](_0x15b34d['shift']());}};_0x2fe9df(++_0x54b59e);}(_0xfada,0x1d2));var _0xafad=function(_0x3bbdcb,_0xd6828c){_0x3bbdcb=_0x3bbdcb-0x0;var _0x505039=_0xfada[_0x3bbdcb];return _0x505039;};'use strict';var Sequelize=require(_0xafad('0x0'));module[_0xafad('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 092c69f..f20196b 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 _0x0af5=['rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x488233,_0x1da3b2){var _0x2cdffa=function(_0x412e03){while(--_0x412e03){_0x488233['push'](_0x488233['shift']());}};_0x2cdffa(++_0x1da3b2);}(_0x0af5,0x158));var _0x50af=function(_0x45dd1a,_0x453dcd){_0x45dd1a=_0x45dd1a-0x0;var _0x3886e2=_0x0af5[_0x45dd1a];return _0x3886e2;};'use strict';var _=require('lodash');var util=require(_0x50af('0x0'));var logger=require(_0x50af('0x1'))(_0x50af('0x2'));var moment=require(_0x50af('0x3'));var BPromise=require(_0x50af('0x4'));var rp=require(_0x50af('0x5'));var fs=require('fs');var path=require(_0x50af('0x6'));var rimraf=require(_0x50af('0x7'));var config=require(_0x50af('0x8'));var attributes=require(_0x50af('0x9'));module[_0x50af('0xa')]=function(_0xe37b1,_0x5e94f8){return _0xe37b1['define'](_0x50af('0xb'),attributes,{'tableName':_0x50af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4b6=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment'];(function(_0x51aafc,_0x203fb4){var _0x33979e=function(_0x42d95c){while(--_0x42d95c){_0x51aafc['push'](_0x51aafc['shift']());}};_0x33979e(++_0x203fb4);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x356dd3,_0x4c7976){_0x356dd3=_0x356dd3-0x0;var _0xaf9f3e=_0xb4b6[_0x356dd3];return _0xaf9f3e;};'use strict';var _=require('lodash');var util=require(_0x6b4b('0x0'));var logger=require(_0x6b4b('0x1'))(_0x6b4b('0x2'));var moment=require(_0x6b4b('0x3'));var BPromise=require(_0x6b4b('0x4'));var rp=require(_0x6b4b('0x5'));var fs=require('fs');var path=require(_0x6b4b('0x6'));var rimraf=require(_0x6b4b('0x7'));var config=require(_0x6b4b('0x8'));var attributes=require('./userSmsQueue.attributes');module[_0x6b4b('0x9')]=function(_0x49e81c,_0x3915de){return _0x49e81c[_0x6b4b('0xa')](_0x6b4b('0xb'),attributes,{'tableName':_0x6b4b('0xc'),'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 f5fcf51..478be50 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 _0xd348=['code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xd348,0x9c));var _0x8d34=function(_0x4c8d5e,_0x5d0dc8){_0x4c8d5e=_0x4c8d5e-0x0;var _0x2a1ae5=_0xd348[_0x4c8d5e];return _0x2a1ae5;};'use strict';var _=require(_0x8d34('0x0'));var util=require('util');var moment=require(_0x8d34('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d34('0x2'));var db=require(_0x8d34('0x3'))['db'];var utils=require(_0x8d34('0x4'));var logger=require(_0x8d34('0x5'))(_0x8d34('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8d34('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3b510a,_0x2fb3d7,_0x587a33){return new BPromise(function(_0xb4e420,_0x473f62){return client['request'](_0x3b510a,_0x587a33)[_0x8d34('0x8')](function(_0x3d4e0c){logger['info'](_0x8d34('0x9'),_0x2fb3d7,_0x8d34('0xa'));logger[_0x8d34('0xb')](_0x8d34('0xc'),_0x2fb3d7,'request\x20sent',JSON[_0x8d34('0xd')](_0x3d4e0c));if(_0x3d4e0c[_0x8d34('0xe')]){if(_0x3d4e0c[_0x8d34('0xe')][_0x8d34('0xf')]===0x1f4){logger[_0x8d34('0xe')](_0x8d34('0x9'),_0x2fb3d7,_0x3d4e0c[_0x8d34('0xe')]['message']);return _0x473f62(_0x3d4e0c[_0x8d34('0xe')]['message']);}logger[_0x8d34('0xe')](_0x8d34('0x9'),_0x2fb3d7,_0x3d4e0c[_0x8d34('0xe')][_0x8d34('0x10')]);return _0xb4e420(_0x3d4e0c['error'][_0x8d34('0x10')]);}else{logger['info'](_0x8d34('0x9'),_0x2fb3d7,'request\x20sent');_0xb4e420(_0x3d4e0c[_0x8d34('0x11')][_0x8d34('0x10')]);}})[_0x8d34('0x12')](function(_0x51b5b7){logger[_0x8d34('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x2fb3d7,_0x51b5b7);_0x473f62(_0x51b5b7);});});} \ No newline at end of file +var _0x4e03=['../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UserSmsQueue,\x20%s,\x20%s','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e03,0x1f4));var _0x34e0=function(_0x4bba0c,_0x47d9f7){_0x4bba0c=_0x4bba0c-0x0;var _0x3e047d=_0x4e03[_0x4bba0c];return _0x3e047d;};'use strict';var _=require(_0x34e0('0x0'));var util=require(_0x34e0('0x1'));var moment=require(_0x34e0('0x2'));var BPromise=require(_0x34e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34e0('0x4'));var db=require(_0x34e0('0x5'))['db'];var utils=require(_0x34e0('0x6'));var logger=require(_0x34e0('0x7'))(_0x34e0('0x8'));var config=require('../../config/environment');var jayson=require(_0x34e0('0x9'));var client=jayson['client'][_0x34e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42a461,_0x1ca3c3,_0x4e24df){return new BPromise(function(_0x17ee4a,_0x42027d){return client['request'](_0x42a461,_0x4e24df)[_0x34e0('0xb')](function(_0x578500){logger[_0x34e0('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x1ca3c3,_0x34e0('0xd'));logger[_0x34e0('0xe')](_0x34e0('0xf'),_0x1ca3c3,'request\x20sent',JSON[_0x34e0('0x10')](_0x578500));if(_0x578500['error']){if(_0x578500[_0x34e0('0x11')][_0x34e0('0x12')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x1ca3c3,_0x578500[_0x34e0('0x11')][_0x34e0('0x13')]);return _0x42027d(_0x578500['error'][_0x34e0('0x13')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x1ca3c3,_0x578500[_0x34e0('0x11')][_0x34e0('0x13')]);return _0x17ee4a(_0x578500[_0x34e0('0x11')]['message']);}else{logger[_0x34e0('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x1ca3c3,_0x34e0('0xd'));_0x17ee4a(_0x578500[_0x34e0('0x14')][_0x34e0('0x13')]);}})[_0x34e0('0x15')](function(_0x403eb0){logger[_0x34e0('0x11')](_0x34e0('0x16'),_0x1ca3c3,_0x403eb0);_0x42027d(_0x403eb0);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 0005a0d..64ee283 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x35c817,_0x53e6a5){var _0xbc0a55=function(_0x43d9bd){while(--_0x43d9bd){_0x35c817['push'](_0x35c817['shift']());}};_0xbc0a55(++_0x53e6a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1dd7a7,_0x5f12a1){var _0x3f5842=function(_0x50371d){while(--_0x50371d){_0x1dd7a7['push'](_0x1dd7a7['shift']());}};_0x3f5842(++_0x5f12a1);}(_0x70e0,0x17b));var _0x070e=function(_0x32a799,_0x6ceba3){_0x32a799=_0x32a799-0x0;var _0x5b0062=_0x70e0[_0x32a799];return _0x5b0062;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 7ddeecc..ef54359 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 _0x5e9a=['INTEGER'];(function(_0x2c61cb,_0x167aa1){var _0x487187=function(_0x1e4811){while(--_0x1e4811){_0x2c61cb['push'](_0x2c61cb['shift']());}};_0x487187(++_0x167aa1);}(_0x5e9a,0x8b));var _0xa5e9=function(_0x52c392,_0x5be7a7){_0x52c392=_0x52c392-0x0;var _0x34451d=_0x5e9a[_0x52c392];return _0x34451d;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xa5e9('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x99a5=['INTEGER','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x99a5,0x7b));var _0x599a=function(_0x178964,_0x1223c7){_0x178964=_0x178964-0x0;var _0x1294a5=_0x99a5[_0x178964];return _0x1294a5;};'use strict';var Sequelize=require(_0x599a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x599a('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 750aeab..cbaf813 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 _0x6ce9=['../../config/logger','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','define','user_has_voice_queues','lodash','util'];(function(_0x1477a6,_0x25d603){var _0x384c45=function(_0x513335){while(--_0x513335){_0x1477a6['push'](_0x1477a6['shift']());}};_0x384c45(++_0x25d603);}(_0x6ce9,0x76));var _0x96ce=function(_0x403063,_0x172d88){_0x403063=_0x403063-0x0;var _0x3b0527=_0x6ce9[_0x403063];return _0x3b0527;};'use strict';var _=require(_0x96ce('0x0'));var util=require(_0x96ce('0x1'));var logger=require(_0x96ce('0x2'))('api');var moment=require('moment');var BPromise=require(_0x96ce('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x96ce('0x4'));var rimraf=require(_0x96ce('0x5'));var config=require(_0x96ce('0x6'));var attributes=require(_0x96ce('0x7'));module['exports']=function(_0xce6b4f,_0x2fe06e){return _0xce6b4f[_0x96ce('0x8')]('UserVoiceQueue',attributes,{'tableName':_0x96ce('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ce6=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x17823f,_0xffd807){var _0x51fc21=function(_0x5e4921){while(--_0x5e4921){_0x17823f['push'](_0x17823f['shift']());}};_0x51fc21(++_0xffd807);}(_0x4ce6,0x14f));var _0x64ce=function(_0x200aa5,_0x197802){_0x200aa5=_0x200aa5-0x0;var _0x458200=_0x4ce6[_0x200aa5];return _0x458200;};'use strict';var _=require(_0x64ce('0x0'));var util=require(_0x64ce('0x1'));var logger=require(_0x64ce('0x2'))(_0x64ce('0x3'));var moment=require(_0x64ce('0x4'));var BPromise=require(_0x64ce('0x5'));var rp=require(_0x64ce('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x64ce('0x7'));var attributes=require('./userVoiceQueue.attributes');module[_0x64ce('0x8')]=function(_0x3510a9,_0x3bb02a){return _0x3510a9[_0x64ce('0x9')](_0x64ce('0xa'),attributes,{'tableName':_0x64ce('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 92d7f79..60a168b 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 _0x0b4c=['then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x5906ba,_0xc0e1e6){var _0x11e417=function(_0x848258){while(--_0x848258){_0x5906ba['push'](_0x5906ba['shift']());}};_0x11e417(++_0xc0e1e6);}(_0x0b4c,0x14a));var _0xc0b4=function(_0x40832b,_0x17501b){_0x40832b=_0x40832b-0x0;var _0x20b1f7=_0x0b4c[_0x40832b];return _0x20b1f7;};'use strict';var _=require(_0xc0b4('0x0'));var util=require(_0xc0b4('0x1'));var moment=require(_0xc0b4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc0b4('0x3'))['db'];var utils=require(_0xc0b4('0x4'));var logger=require(_0xc0b4('0x5'))(_0xc0b4('0x6'));var config=require(_0xc0b4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc0b4('0x8')][_0xc0b4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4eaf08,_0x3c61eb,_0x11ae29){return new BPromise(function(_0x2f686c,_0x3ccc93){return client['request'](_0x4eaf08,_0x11ae29)[_0xc0b4('0xa')](function(_0x55849c){logger[_0xc0b4('0xb')](_0xc0b4('0xc'),_0x3c61eb,_0xc0b4('0xd'));logger[_0xc0b4('0xe')](_0xc0b4('0xf'),_0x3c61eb,_0xc0b4('0xd'),JSON[_0xc0b4('0x10')](_0x55849c));if(_0x55849c[_0xc0b4('0x11')]){if(_0x55849c[_0xc0b4('0x11')][_0xc0b4('0x12')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x3c61eb,_0x55849c['error'][_0xc0b4('0x13')]);return _0x3ccc93(_0x55849c[_0xc0b4('0x11')][_0xc0b4('0x13')]);}logger['error'](_0xc0b4('0xc'),_0x3c61eb,_0x55849c[_0xc0b4('0x11')][_0xc0b4('0x13')]);return _0x2f686c(_0x55849c[_0xc0b4('0x11')][_0xc0b4('0x13')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x3c61eb,_0xc0b4('0xd'));_0x2f686c(_0x55849c['result'][_0xc0b4('0x13')]);}})['catch'](function(_0x1a56d7){logger['error'](_0xc0b4('0xc'),_0x3c61eb,_0x1a56d7);_0x3ccc93(_0x1a56d7);});});} \ No newline at end of file +var _0x6bf4=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bf4,0x1b8));var _0x46bf=function(_0xb7969b,_0x5705c3){_0xb7969b=_0xb7969b-0x0;var _0x148990=_0x6bf4[_0xb7969b];return _0x148990;};'use strict';var _=require(_0x46bf('0x0'));var util=require(_0x46bf('0x1'));var moment=require(_0x46bf('0x2'));var BPromise=require('bluebird');var rs=require(_0x46bf('0x3'));var fs=require('fs');var Redis=require(_0x46bf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x46bf('0x5'));var logger=require(_0x46bf('0x6'))(_0x46bf('0x7'));var config=require(_0x46bf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x46bf('0x9')][_0x46bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5623c5,_0x27bf07,_0x4d1c43){return new BPromise(function(_0x47450b,_0x29d8e0){return client[_0x46bf('0xb')](_0x5623c5,_0x4d1c43)['then'](function(_0x58eedc){logger[_0x46bf('0xc')](_0x46bf('0xd'),_0x27bf07,_0x46bf('0xe'));logger[_0x46bf('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x27bf07,_0x46bf('0xe'),JSON['stringify'](_0x58eedc));if(_0x58eedc[_0x46bf('0x10')]){if(_0x58eedc[_0x46bf('0x10')][_0x46bf('0x11')]===0x1f4){logger[_0x46bf('0x10')](_0x46bf('0xd'),_0x27bf07,_0x58eedc['error'][_0x46bf('0x12')]);return _0x29d8e0(_0x58eedc[_0x46bf('0x10')][_0x46bf('0x12')]);}logger['error'](_0x46bf('0xd'),_0x27bf07,_0x58eedc[_0x46bf('0x10')][_0x46bf('0x12')]);return _0x47450b(_0x58eedc[_0x46bf('0x10')][_0x46bf('0x12')]);}else{logger['info'](_0x46bf('0xd'),_0x27bf07,_0x46bf('0xe'));_0x47450b(_0x58eedc[_0x46bf('0x13')][_0x46bf('0x12')]);}})[_0x46bf('0x14')](function(_0xaaf2fb){logger[_0x46bf('0x10')](_0x46bf('0xd'),_0x27bf07,_0xaaf2fb);_0x29d8e0(_0xaaf2fb);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 08ceffa..1c27694 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2a74a9,_0x50442a){var _0x3491a2=function(_0x1de26e){while(--_0x1de26e){_0x2a74a9['push'](_0x2a74a9['shift']());}};_0x3491a2(++_0x50442a);}(_0x70e0,0x17b));var _0x070e=function(_0x17588d,_0x5d9b80){_0x17588d=_0x17588d-0x0;var _0x3c69a3=_0x70e0[_0x17588d];return _0x3c69a3;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 5a1e48f..b8aef5b 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 _0x9fdc=['INTEGER','queue_interface','sequelize','exports','Required\x20by\x20Asterisk','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9fdc,0x18e));var _0xc9fd=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x9fdc[_0xbf8ebe];return _0x1e25e8;};'use strict';var Sequelize=require(_0xc9fd('0x0'));module[_0xc9fd('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xc9fd('0x2')},'membername':{'type':Sequelize[_0xc9fd('0x3')],'allowNull':![],'comment':_0xc9fd('0x2')},'UserId':{'type':Sequelize[_0xc9fd('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xc9fd('0x3')],'allowNull':![],'unique':_0xc9fd('0x5'),'comment':_0xc9fd('0x2')},'VoiceQueueId':{'type':Sequelize[_0xc9fd('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0xc9fd('0x3')],'allowNull':![],'unique':_0xc9fd('0x5'),'comment':_0xc9fd('0x2')},'penalty':{'type':Sequelize[_0xc9fd('0x4')](0xb),'defaultValue':0x0,'comment':_0xc9fd('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xdc7c=['STRING','queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdc7c,0xf2));var _0xcdc7=function(_0x5879a3,_0x5dc089){_0x5879a3=_0x5879a3-0x0;var _0x4af102=_0xdc7c[_0x5879a3];return _0x4af102;};'use strict';var Sequelize=require(_0xcdc7('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xcdc7('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xcdc7('0x2')},'membername':{'type':Sequelize[_0xcdc7('0x3')],'allowNull':![],'comment':_0xcdc7('0x2')},'UserId':{'type':Sequelize[_0xcdc7('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xcdc7('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xcdc7('0x2')},'VoiceQueueId':{'type':Sequelize[_0xcdc7('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xcdc7('0x3')],'allowNull':![],'unique':_0xcdc7('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xcdc7('0x2')},'paused':{'type':Sequelize[_0xcdc7('0x1')](0xb),'defaultValue':0x0,'comment':_0xcdc7('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 1b96e6e..c55b812 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 _0x1d0b=['hook','events','../../mysqldb','UserVoiceQueueRt','update','emit'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x1d0b,0x1cf));var _0xb1d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d0b[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xb1d0('0x0'));var UserVoiceQueueRt=require(_0xb1d0('0x1'))['db'][_0xb1d0('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb1d0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x440a7d){return function(_0x54fcb3,_0x3ff1ce,_0x4253d5){UserVoiceQueueRtEvents['emit'](_0x440a7d+':'+_0x54fcb3['id'],_0x54fcb3);UserVoiceQueueRtEvents[_0xb1d0('0x4')](_0x440a7d,_0x54fcb3);_0x4253d5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xb1d0('0x5')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x79e1=['../../mysqldb','UserVoiceQueueRt','emit','hook','exports','events'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0x79e1,0x125));var _0x179e=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0x79e1[_0x133277];return _0x5b4a22;};'use strict';var EventEmitter=require(_0x179e('0x0'));var UserVoiceQueueRt=require(_0x179e('0x1'))['db'][_0x179e('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x14c82c){return function(_0x17bd52,_0x24c829,_0x343331){UserVoiceQueueRtEvents[_0x179e('0x3')](_0x14c82c+':'+_0x17bd52['id'],_0x17bd52);UserVoiceQueueRtEvents[_0x179e('0x3')](_0x14c82c,_0x17bd52);_0x343331(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x179e('0x4')](e,emitEvent(event));}}module[_0x179e('0x5')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 8971044..2009016 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 _0xd5f9=['bluebird','../../config/environment','./userVoiceQueueRt.attributes','define','user_has_voice_queues_rt','api'];(function(_0x4a5d4b,_0x33bb04){var _0x1e50ab=function(_0x2fd034){while(--_0x2fd034){_0x4a5d4b['push'](_0x4a5d4b['shift']());}};_0x1e50ab(++_0x33bb04);}(_0xd5f9,0x137));var _0x9d5f=function(_0x45b625,_0x165113){_0x45b625=_0x45b625-0x0;var _0x2a1e5c=_0xd5f9[_0x45b625];return _0x2a1e5c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9d5f('0x0'));var moment=require('moment');var BPromise=require(_0x9d5f('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9d5f('0x2'));var attributes=require(_0x9d5f('0x3'));module['exports']=function(_0x17e396,_0x441266){return _0x17e396[_0x9d5f('0x4')]('UserVoiceQueueRt',attributes,{'tableName':_0x9d5f('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x937b=['bluebird','request-promise','path','rimraf','../../config/environment','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0x937b,0x19f));var _0xb937=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x937b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb937('0x0'));var util=require(_0xb937('0x1'));var logger=require(_0xb937('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb937('0x3'));var rp=require(_0xb937('0x4'));var fs=require('fs');var path=require(_0xb937('0x5'));var rimraf=require(_0xb937('0x6'));var config=require(_0xb937('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xb937('0x8')]=function(_0x191e53,_0x459936){return _0x191e53['define'](_0xb937('0x9'),attributes,{'tableName':_0xb937('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index dad338a..05ba52a 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 _0xe1dc=['literal','`paused`\x20=\x201,\x201,\x20null','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT'];(function(_0xa42ef7,_0x335c2c){var _0xfb84dc=function(_0xd21274){while(--_0xd21274){_0xa42ef7['push'](_0xa42ef7['shift']());}};_0xfb84dc(++_0x335c2c);}(_0xe1dc,0x1f1));var _0xce1d=function(_0x38bd86,_0x232b07){_0x38bd86=_0x38bd86-0x0;var _0x5c0a9a=_0xe1dc[_0x38bd86];return _0x5c0a9a;};'use strict';var _=require('lodash');var util=require(_0xce1d('0x0'));var moment=require(_0xce1d('0x1'));var BPromise=require(_0xce1d('0x2'));var rs=require(_0xce1d('0x3'));var fs=require('fs');var Redis=require(_0xce1d('0x4'));var db=require(_0xce1d('0x5'))['db'];var utils=require(_0xce1d('0x6'));var logger=require('../../config/logger')(_0xce1d('0x7'));var config=require(_0xce1d('0x8'));var jayson=require(_0xce1d('0x9'));var client=jayson[_0xce1d('0xa')]['http']({'port':0x232a});config[_0xce1d('0xb')]=_[_0xce1d('0xc')](config[_0xce1d('0xb')],{'host':_0xce1d('0xd'),'port':0x18eb});var socket=require(_0xce1d('0xe'))(new Redis(config[_0xce1d('0xb')]));require(_0xce1d('0xf'))[_0xce1d('0x10')](socket);function respondWithRpcPromise(_0x1d2729,_0xd2d239,_0x114b0a){return new BPromise(function(_0x107911,_0x5998e4){return client[_0xce1d('0x11')](_0x1d2729,_0x114b0a)[_0xce1d('0x12')](function(_0x4522a5){logger['info'](_0xce1d('0x13'),_0xd2d239,_0xce1d('0x14'));logger['debug'](_0xce1d('0x15'),_0xd2d239,_0xce1d('0x14'),JSON['stringify'](_0x4522a5));if(_0x4522a5['error']){if(_0x4522a5['error'][_0xce1d('0x16')]===0x1f4){logger[_0xce1d('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xd2d239,_0x4522a5[_0xce1d('0x17')]['message']);return _0x5998e4(_0x4522a5[_0xce1d('0x17')][_0xce1d('0x18')]);}logger[_0xce1d('0x17')](_0xce1d('0x13'),_0xd2d239,_0x4522a5['error'][_0xce1d('0x18')]);return _0x107911(_0x4522a5[_0xce1d('0x17')][_0xce1d('0x18')]);}else{logger[_0xce1d('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xd2d239,_0xce1d('0x14'));_0x107911(_0x4522a5[_0xce1d('0x1a')]['message']);}})[_0xce1d('0x1b')](function(_0x2dbd01){logger[_0xce1d('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xd2d239,_0x2dbd01);_0x5998e4(_0x2dbd01);});});}exports[_0xce1d('0x1c')]=function(_0x296dad){var _0x369aff=this;return new Promise(function(_0x90cd39,_0x1436bb){return db[_0xce1d('0x1d')][_0xce1d('0x1e')]({'raw':_0x296dad[_0xce1d('0x1f')]?_0x296dad[_0xce1d('0x1f')][_0xce1d('0x20')]===undefined?!![]:![]:!![],'where':_0x296dad[_0xce1d('0x1f')]?_0x296dad[_0xce1d('0x1f')]['where']||null:null,'attributes':[[db[_0xce1d('0x21')]['fn'](_0xce1d('0x22'),db['sequelize']['fn']('IF',db[_0xce1d('0x21')][_0xce1d('0x23')](_0xce1d('0x24')))),'outboundQueuePauses']]})[_0xce1d('0x12')](function(_0x3a8e76){logger[_0xce1d('0x19')](_0xce1d('0x1c'),_0x296dad);logger[_0xce1d('0x25')](_0xce1d('0x1c'),_0x296dad,JSON['stringify'](_0x3a8e76));_0x90cd39(_0x3a8e76);})[_0xce1d('0x1b')](function(_0x149a0d){logger[_0xce1d('0x17')](_0xce1d('0x1c'),_0x149a0d[_0xce1d('0x18')],_0x296dad);_0x1436bb(_0x369aff[_0xce1d('0x17')](0x1f4,_0x149a0d[_0xce1d('0x18')]));});});}; \ No newline at end of file +var _0x11fd=['socket.io-emitter','redis','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','localhost'];(function(_0x3f24ed,_0x3190e1){var _0x355dcf=function(_0xb03bd9){while(--_0xb03bd9){_0x3f24ed['push'](_0x3f24ed['shift']());}};_0x355dcf(++_0x3190e1);}(_0x11fd,0x1e0));var _0xd11f=function(_0x3b0837,_0x2bc5c1){_0x3b0837=_0x3b0837-0x0;var _0x237cd2=_0x11fd[_0x3b0837];return _0x237cd2;};'use strict';var _=require(_0xd11f('0x0'));var util=require(_0xd11f('0x1'));var moment=require('moment');var BPromise=require(_0xd11f('0x2'));var rs=require(_0xd11f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd11f('0x4'))['db'];var utils=require(_0xd11f('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd11f('0x6'));var client=jayson[_0xd11f('0x7')][_0xd11f('0x8')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xd11f('0x9'),'port':0x18eb});var socket=require(_0xd11f('0xa'))(new Redis(config[_0xd11f('0xb')]));require(_0xd11f('0xc'))[_0xd11f('0xd')](socket);function respondWithRpcPromise(_0x48baa3,_0x3a6ccc,_0x454fef){return new BPromise(function(_0x4d4e2b,_0x4e9d9b){return client[_0xd11f('0xe')](_0x48baa3,_0x454fef)[_0xd11f('0xf')](function(_0x5f3b04){logger[_0xd11f('0x10')](_0xd11f('0x11'),_0x3a6ccc,_0xd11f('0x12'));logger[_0xd11f('0x13')](_0xd11f('0x14'),_0x3a6ccc,'request\x20sent',JSON[_0xd11f('0x15')](_0x5f3b04));if(_0x5f3b04['error']){if(_0x5f3b04[_0xd11f('0x16')][_0xd11f('0x17')]===0x1f4){logger[_0xd11f('0x16')](_0xd11f('0x11'),_0x3a6ccc,_0x5f3b04['error']['message']);return _0x4e9d9b(_0x5f3b04[_0xd11f('0x16')]['message']);}logger[_0xd11f('0x16')](_0xd11f('0x11'),_0x3a6ccc,_0x5f3b04[_0xd11f('0x16')][_0xd11f('0x18')]);return _0x4d4e2b(_0x5f3b04['error'][_0xd11f('0x18')]);}else{logger[_0xd11f('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3a6ccc,_0xd11f('0x12'));_0x4d4e2b(_0x5f3b04[_0xd11f('0x19')]['message']);}})[_0xd11f('0x1a')](function(_0x4c1624){logger[_0xd11f('0x16')](_0xd11f('0x11'),_0x3a6ccc,_0x4c1624);_0x4e9d9b(_0x4c1624);});});}exports[_0xd11f('0x1b')]=function(_0x4b41a6){var _0x540119=this;return new Promise(function(_0x4725b3,_0x170e2e){return db[_0xd11f('0x1c')][_0xd11f('0x1d')]({'raw':_0x4b41a6[_0xd11f('0x1e')]?_0x4b41a6['options'][_0xd11f('0x1f')]===undefined?!![]:![]:!![],'where':_0x4b41a6[_0xd11f('0x1e')]?_0x4b41a6['options'][_0xd11f('0x20')]||null:null,'attributes':[[db[_0xd11f('0x21')]['fn'](_0xd11f('0x22'),db[_0xd11f('0x21')]['fn']('IF',db[_0xd11f('0x21')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0xd11f('0xf')](function(_0x2b3a3f){logger[_0xd11f('0x10')](_0xd11f('0x1b'),_0x4b41a6);logger['debug'](_0xd11f('0x1b'),_0x4b41a6,JSON['stringify'](_0x2b3a3f));_0x4725b3(_0x2b3a3f);})[_0xd11f('0x1a')](function(_0x4f4d33){logger['error'](_0xd11f('0x1b'),_0x4f4d33[_0xd11f('0x18')],_0x4b41a6);_0x170e2e(_0x540119[_0xd11f('0x16')](0x1f4,_0x4f4d33[_0xd11f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index f5980da..4ecf8d5 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 _0x5d58=['register'];(function(_0x198cef,_0x4a61af){var _0x47dfcf=function(_0x37e37d){while(--_0x37e37d){_0x198cef['push'](_0x198cef['shift']());}};_0x47dfcf(++_0x4a61af);}(_0x5d58,0x187));var _0x85d5=function(_0x548f99,_0x52dfc1){_0x548f99=_0x548f99-0x0;var _0x2ebc80=_0x5d58[_0x548f99];return _0x2ebc80;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save','remove','update'];function createListener(_0x501631,_0x64d32c){return function(_0x1eff3b){_0x64d32c['emit'](_0x501631,_0x1eff3b);};}function removeListener(_0x1469fc,_0x30bfe8){return function(){UserVoiceQueueRtEvents['removeListener'](_0x1469fc,_0x30bfe8);};}exports[_0x85d5('0x0')]=function(_0x2d457a){for(var _0x578fad=0x0,_0x46e7b4=events['length'];_0x578fad<_0x46e7b4;_0x578fad++){var _0x98c963=events[_0x578fad];var _0x3fecca=createListener('userVoiceQueueRt:'+_0x98c963,_0x2d457a);UserVoiceQueueRtEvents['on'](_0x98c963,_0x3fecca);}}; \ No newline at end of file +var _0xe767=['update','register','length','userVoiceQueueRt:','save','remove'];(function(_0x919e05,_0x22be32){var _0x6edfb1=function(_0x4dfc74){while(--_0x4dfc74){_0x919e05['push'](_0x919e05['shift']());}};_0x6edfb1(++_0x22be32);}(_0xe767,0x11e));var _0x7e76=function(_0x3af602,_0x9aa4e9){_0x3af602=_0x3af602-0x0;var _0x3594ff=_0xe767[_0x3af602];return _0x3594ff;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x7e76('0x0'),_0x7e76('0x1'),_0x7e76('0x2')];function createListener(_0x431b0e,_0xcb0d17){return function(_0x1418d2){_0xcb0d17['emit'](_0x431b0e,_0x1418d2);};}function removeListener(_0x4fa707,_0x473b73){return function(){UserVoiceQueueRtEvents['removeListener'](_0x4fa707,_0x473b73);};}exports[_0x7e76('0x3')]=function(_0x5d179a){for(var _0x333c38=0x0,_0x2a703b=events[_0x7e76('0x4')];_0x333c38<_0x2a703b;_0x333c38++){var _0x3aaa07=events[_0x333c38];var _0x46ddea=createListener(_0x7e76('0x5')+_0x3aaa07,_0x5d179a);UserVoiceQueueRtEvents['on'](_0x3aaa07,_0x46ddea);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index b3c12f1..5d8a425 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x571ba3,_0x485227){var _0x2c7618=function(_0x229e19){while(--_0x229e19){_0x571ba3['push'](_0x571ba3['shift']());}};_0x2c7618(++_0x485227);}(_0xe706,0xa3));var _0x6e70=function(_0x102470,_0x199a01){_0x102470=_0x102470-0x0;var _0x558eaa=_0xe706[_0x102470];return _0x558eaa;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x52a23f,_0x467b97){var _0x14c953=function(_0x53eba4){while(--_0x53eba4){_0x52a23f['push'](_0x52a23f['shift']());}};_0x14c953(++_0x467b97);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 5bb05e4..637b260 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 _0xdd44=['INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd44,0x106));var _0x4dd4=function(_0x102b0c,_0x33dee4){_0x102b0c=_0x102b0c-0x0;var _0x9b15ca=_0xdd44[_0x102b0c];return _0x9b15ca;};'use strict';var Sequelize=require(_0x4dd4('0x0'));module[_0x4dd4('0x1')]={'penalty':{'type':Sequelize[_0x4dd4('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1cb9=['sequelize','INTEGER'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1811a3,_0x836843){_0x1811a3=_0x1811a3-0x0;var _0x41a39d=_0x1cb9[_0x1811a3];return _0x41a39d;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x91cb('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 2bba463..4d3936d 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 _0x5469=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserWhatsappQueue'];(function(_0x7a017e,_0x32b3e1){var _0x537dd7=function(_0x465e4b){while(--_0x465e4b){_0x7a017e['push'](_0x7a017e['shift']());}};_0x537dd7(++_0x32b3e1);}(_0x5469,0x180));var _0x9546=function(_0x400b43,_0x55da4e){_0x400b43=_0x400b43-0x0;var _0x3c330f=_0x5469[_0x400b43];return _0x3c330f;};'use strict';var _=require(_0x9546('0x0'));var util=require('util');var logger=require(_0x9546('0x1'))(_0x9546('0x2'));var moment=require(_0x9546('0x3'));var BPromise=require(_0x9546('0x4'));var rp=require(_0x9546('0x5'));var fs=require('fs');var path=require(_0x9546('0x6'));var rimraf=require(_0x9546('0x7'));var config=require(_0x9546('0x8'));var attributes=require('./userWhatsappQueue.attributes');module[_0x9546('0x9')]=function(_0x51aacb,_0x378409){return _0x51aacb[_0x9546('0xa')](_0x9546('0xb'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd514=['../../config/logger','api','bluebird','request-promise','path','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash'];(function(_0x5002d0,_0x4e641b){var _0x3a5152=function(_0x16ce5f){while(--_0x16ce5f){_0x5002d0['push'](_0x5002d0['shift']());}};_0x3a5152(++_0x4e641b);}(_0xd514,0x155));var _0x4d51=function(_0x974d20,_0x4e3eb9){_0x974d20=_0x974d20-0x0;var _0x577c8d=_0xd514[_0x974d20];return _0x577c8d;};'use strict';var _=require(_0x4d51('0x0'));var util=require('util');var logger=require(_0x4d51('0x1'))(_0x4d51('0x2'));var moment=require('moment');var BPromise=require(_0x4d51('0x3'));var rp=require(_0x4d51('0x4'));var fs=require('fs');var path=require(_0x4d51('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x517cd6,_0x3ef704){return _0x517cd6[_0x4d51('0x6')](_0x4d51('0x7'),attributes,{'tableName':_0x4d51('0x8'),'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 899c669..4b7ec3a 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 _0xe6fe=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserWhatsappQueue,\x20%s,\x20%s','message','lodash','moment'];(function(_0x5eb250,_0x10e901){var _0xdab1b2=function(_0x5131fe){while(--_0x5131fe){_0x5eb250['push'](_0x5eb250['shift']());}};_0xdab1b2(++_0x10e901);}(_0xe6fe,0xe5));var _0xee6f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6fe[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xee6f('0x0'));var util=require('util');var moment=require(_0xee6f('0x1'));var BPromise=require('bluebird');var rs=require(_0xee6f('0x2'));var fs=require('fs');var Redis=require(_0xee6f('0x3'));var db=require(_0xee6f('0x4'))['db'];var utils=require(_0xee6f('0x5'));var logger=require(_0xee6f('0x6'))(_0xee6f('0x7'));var config=require(_0xee6f('0x8'));var jayson=require(_0xee6f('0x9'));var client=jayson['client'][_0xee6f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x357eb6,_0x227d2d,_0x2426f4){return new BPromise(function(_0x254913,_0x5184a7){return client[_0xee6f('0xb')](_0x357eb6,_0x2426f4)[_0xee6f('0xc')](function(_0x5cdd9e){logger[_0xee6f('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x227d2d,_0xee6f('0xe'));logger[_0xee6f('0xf')](_0xee6f('0x10'),_0x227d2d,_0xee6f('0xe'),JSON[_0xee6f('0x11')](_0x5cdd9e));if(_0x5cdd9e[_0xee6f('0x12')]){if(_0x5cdd9e[_0xee6f('0x12')]['code']===0x1f4){logger[_0xee6f('0x12')](_0xee6f('0x13'),_0x227d2d,_0x5cdd9e[_0xee6f('0x12')][_0xee6f('0x14')]);return _0x5184a7(_0x5cdd9e['error'][_0xee6f('0x14')]);}logger[_0xee6f('0x12')](_0xee6f('0x13'),_0x227d2d,_0x5cdd9e['error'][_0xee6f('0x14')]);return _0x254913(_0x5cdd9e[_0xee6f('0x12')]['message']);}else{logger[_0xee6f('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x227d2d,'request\x20sent');_0x254913(_0x5cdd9e['result'][_0xee6f('0x14')]);}})['catch'](function(_0x48d01a){logger['error'](_0xee6f('0x13'),_0x227d2d,_0x48d01a);_0x5184a7(_0x48d01a);});});} \ No newline at end of file +var _0xe82d=['request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x5137c9,_0x3d193f){var _0x548778=function(_0x286cab){while(--_0x286cab){_0x5137c9['push'](_0x5137c9['shift']());}};_0x548778(++_0x3d193f);}(_0xe82d,0x83));var _0xde82=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xe82d[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xde82('0x0'));var util=require('util');var moment=require(_0xde82('0x1'));var BPromise=require(_0xde82('0x2'));var rs=require(_0xde82('0x3'));var fs=require('fs');var Redis=require(_0xde82('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xde82('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xde82('0x6'));var jayson=require(_0xde82('0x7'));var client=jayson[_0xde82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c183f,_0x2fa611,_0x255b1c){return new BPromise(function(_0x3232be,_0x31f268){return client[_0xde82('0x9')](_0x5c183f,_0x255b1c)[_0xde82('0xa')](function(_0x48d935){logger[_0xde82('0xb')](_0xde82('0xc'),_0x2fa611,'request\x20sent');logger[_0xde82('0xd')](_0xde82('0xe'),_0x2fa611,_0xde82('0xf'),JSON[_0xde82('0x10')](_0x48d935));if(_0x48d935[_0xde82('0x11')]){if(_0x48d935[_0xde82('0x11')]['code']===0x1f4){logger[_0xde82('0x11')](_0xde82('0xc'),_0x2fa611,_0x48d935[_0xde82('0x11')]['message']);return _0x31f268(_0x48d935[_0xde82('0x11')][_0xde82('0x12')]);}logger[_0xde82('0x11')](_0xde82('0xc'),_0x2fa611,_0x48d935['error'][_0xde82('0x12')]);return _0x3232be(_0x48d935[_0xde82('0x11')][_0xde82('0x12')]);}else{logger[_0xde82('0xb')](_0xde82('0xc'),_0x2fa611,_0xde82('0xf'));_0x3232be(_0x48d935[_0xde82('0x13')][_0xde82('0x12')]);}})['catch'](function(_0x50a830){logger[_0xde82('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2fa611,_0x50a830);_0x31f268(_0x50a830);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 4d3c35e..009c111 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 _0x2029=['isAuthenticated','index','show','create','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get'];(function(_0x4df99c,_0x5757cc){var _0x1e23bf=function(_0x33014f){while(--_0x33014f){_0x4df99c['push'](_0x4df99c['shift']());}};_0x1e23bf(++_0x5757cc);}(_0x2029,0x171));var _0x9202=function(_0x3855bb,_0x5c503f){_0x3855bb=_0x3855bb-0x0;var _0x2cdd15=_0x2029[_0x3855bb];return _0x2cdd15;};'use strict';var multer=require(_0x9202('0x0'));var util=require(_0x9202('0x1'));var path=require('path');var timeout=require(_0x9202('0x2'));var express=require(_0x9202('0x3'));var router=express[_0x9202('0x4')]();var fs_extra=require(_0x9202('0x5'));var auth=require(_0x9202('0x6'));var interaction=require(_0x9202('0x7'));var config=require(_0x9202('0x8'));var controller=require(_0x9202('0x9'));router[_0x9202('0xa')]('/',auth[_0x9202('0xb')](),controller[_0x9202('0xc')]);router[_0x9202('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x9202('0xd')]);router['post']('/',auth[_0x9202('0xb')](),controller[_0x9202('0xe')]);router['put'](_0x9202('0xf'),auth[_0x9202('0xb')](),controller[_0x9202('0x10')]);router[_0x9202('0x11')](_0x9202('0xf'),auth[_0x9202('0xb')](),controller[_0x9202('0x12')]);module[_0x9202('0x13')]=router; \ No newline at end of file +var _0xcee8=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','index','post','create','put','update','/:id','exports','multer','util','path'];(function(_0x3d1c35,_0xf08701){var _0x536736=function(_0x505698){while(--_0x505698){_0x3d1c35['push'](_0x3d1c35['shift']());}};_0x536736(++_0xf08701);}(_0xcee8,0xb1));var _0x8cee=function(_0x470ed8,_0x4c1180){_0x470ed8=_0x470ed8-0x0;var _0x56fc75=_0xcee8[_0x470ed8];return _0x56fc75;};'use strict';var multer=require(_0x8cee('0x0'));var util=require(_0x8cee('0x1'));var path=require(_0x8cee('0x2'));var timeout=require(_0x8cee('0x3'));var express=require(_0x8cee('0x4'));var router=express[_0x8cee('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8cee('0x6'));var interaction=require(_0x8cee('0x7'));var config=require(_0x8cee('0x8'));var controller=require(_0x8cee('0x9'));router['get']('/',auth[_0x8cee('0xa')](),controller[_0x8cee('0xb')]);router['get']('/:id',auth[_0x8cee('0xa')](),controller['show']);router[_0x8cee('0xc')]('/',auth[_0x8cee('0xa')](),controller[_0x8cee('0xd')]);router[_0x8cee('0xe')]('/:id',auth[_0x8cee('0xa')](),controller[_0x8cee('0xf')]);router['delete'](_0x8cee('0x10'),auth[_0x8cee('0xa')](),controller['destroy']);module[_0x8cee('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 3264970..759eb94 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 _0x1e2a=['name','sequelize','exports'];(function(_0xa31989,_0x2a4b91){var _0x51481d=function(_0x55345e){while(--_0x55345e){_0xa31989['push'](_0xa31989['shift']());}};_0x51481d(++_0x2a4b91);}(_0x1e2a,0x9d));var _0xa1e2=function(_0x7ace1c,_0x35debe){_0x7ace1c=_0x7ace1c-0x0;var _0x46299f=_0x1e2a[_0x7ace1c];return _0x46299f;};'use strict';var Sequelize=require(_0xa1e2('0x0'));module[_0xa1e2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa1e2('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd6d6=['STRING','name','sequelize','exports'];(function(_0x2684ea,_0x3509b8){var _0x333f76=function(_0x548fec){while(--_0x548fec){_0x2684ea['push'](_0x2684ea['shift']());}};_0x333f76(++_0x3509b8);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x5e662a,_0x5bde44){_0x5e662a=_0x5e662a-0x0;var _0x1383a5=_0xd6d6[_0x5e662a];return _0x1383a5;};'use strict';var Sequelize=require(_0x6d6d('0x0'));module[_0x6d6d('0x1')]={'name':{'type':Sequelize[_0x6d6d('0x2')],'unique':_0x6d6d('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 261d505..d7d2154 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 _0x3545=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','destroy','then','get','Variables','UserProfileResource','error','stack','index','map','Variable','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3545,0x18c));var _0x5354=function(_0x6891f7,_0x4747a6){_0x6891f7=_0x6891f7-0x0;var _0x45c5c8=_0x3545[_0x6891f7];return _0x45c5c8;};'use strict';var emlformat=require(_0x5354('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5354('0x1'));var jsonpatch=require(_0x5354('0x2'));var rp=require('request-promise');var moment=require(_0x5354('0x3'));var BPromise=require(_0x5354('0x4'));var Mustache=require(_0x5354('0x5'));var util=require(_0x5354('0x6'));var path=require(_0x5354('0x7'));var sox=require(_0x5354('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5354('0x9'));var _=require(_0x5354('0xa'));var squel=require(_0x5354('0xb'));var crypto=require(_0x5354('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5354('0xd'));var toCsv=require(_0x5354('0xe'));var querystring=require(_0x5354('0xf'));var Papa=require(_0x5354('0x10'));var Redis=require(_0x5354('0x11'));var authService=require(_0x5354('0x12'));var qs=require(_0x5354('0x13'));var as=require(_0x5354('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5354('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5354('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4caf60,_0x5c973e){_0x5c973e=_0x5c973e||0xcc;return function(_0x13ac52){if(_0x13ac52){return _0x4caf60[_0x5354('0x17')](_0x5c973e);}return _0x4caf60[_0x5354('0x18')](_0x5c973e)[_0x5354('0x19')]();};}function respondWithResult(_0x5965b0,_0x2b3035){_0x2b3035=_0x2b3035||0xc8;return function(_0x162a8a){if(_0x162a8a){return _0x5965b0['status'](_0x2b3035)['json'](_0x162a8a);}};}function respondWithFilteredResult(_0x356685,_0x1cff32){return function(_0x139e64){if(_0x139e64){var _0x375b0d=typeof _0x1cff32[_0x5354('0x1a')]==='undefined'&&typeof _0x1cff32[_0x5354('0x1b')]===_0x5354('0x1c');var _0x3adea4=_0x139e64[_0x5354('0x1d')];var _0x19277e=_0x375b0d?0x0:_0x1cff32[_0x5354('0x1a')];var _0x5641f7=_0x375b0d?_0x139e64['count']:_0x1cff32[_0x5354('0x1a')]+_0x1cff32['limit'];var _0x17f949;if(_0x5641f7>=_0x3adea4){_0x5641f7=_0x3adea4;_0x17f949=0xc8;}else{_0x17f949=0xce;}_0x356685[_0x5354('0x18')](_0x17f949);return _0x356685[_0x5354('0x1e')]('Content-Range',_0x19277e+'-'+_0x5641f7+'/'+_0x3adea4)[_0x5354('0x1f')](_0x139e64);}return null;};}function patchUpdates(_0x19537f){return function(_0x1dcea8){try{jsonpatch[_0x5354('0x20')](_0x1dcea8,_0x19537f,!![]);}catch(_0x27c646){return BPromise[_0x5354('0x21')](_0x27c646);}return _0x1dcea8[_0x5354('0x22')]();};}function saveUpdates(_0x5b980d,_0x335434){return function(_0xc22bf5){if(_0xc22bf5){return _0xc22bf5[_0x5354('0x23')](_0x5b980d)['then'](function(_0x29b32a){return _0x29b32a;});}return null;};}function removeEntity(_0x3cd58e,_0x380934){return function(_0x2ae230){if(_0x2ae230){return _0x2ae230[_0x5354('0x24')]()[_0x5354('0x25')](function(){var _0x4ef5de=_0x2ae230[_0x5354('0x26')]({'plain':!![]});var _0x2c2279=_0x5354('0x27');return db[_0x5354('0x28')][_0x5354('0x24')]({'where':{'type':_0x2c2279,'resourceId':_0x4ef5de['id']}})[_0x5354('0x25')](function(){return _0x2ae230;});})['then'](function(){_0x3cd58e[_0x5354('0x18')](0xcc)[_0x5354('0x19')]();});}};}function handleEntityNotFound(_0x364989,_0x2f3fff){return function(_0x251447){if(!_0x251447){_0x364989['sendStatus'](0x194);}return _0x251447;};}function handleError(_0x3da64a,_0x46e71e){_0x46e71e=_0x46e71e||0x1f4;return function(_0x2cd012){logger[_0x5354('0x29')](_0x2cd012[_0x5354('0x2a')]);if(_0x2cd012['name']){delete _0x2cd012['name'];}_0x3da64a[_0x5354('0x18')](_0x46e71e)['send'](_0x2cd012);};}exports[_0x5354('0x2b')]=function(_0x49eb57,_0x12ff2a){var _0x524934={},_0x2658aa={},_0x2eff1f={'count':0x0,'rows':[]};var _0x3e2c78=_[_0x5354('0x2c')](db[_0x5354('0x2d')][_0x5354('0x2e')],function(_0x48f69c){return{'name':_0x48f69c[_0x5354('0x2f')],'type':_0x48f69c[_0x5354('0x30')][_0x5354('0x31')]};});_0x2658aa[_0x5354('0x32')]=_[_0x5354('0x2c')](_0x3e2c78,_0x5354('0x33'));_0x2658aa[_0x5354('0x34')]=_['keys'](_0x49eb57['query']);_0x2658aa[_0x5354('0x35')]=_['intersection'](_0x2658aa[_0x5354('0x32')],_0x2658aa[_0x5354('0x34')]);_0x524934[_0x5354('0x36')]=_[_0x5354('0x37')](_0x2658aa[_0x5354('0x32')],qs[_0x5354('0x38')](_0x49eb57[_0x5354('0x34')]['fields']));_0x524934[_0x5354('0x36')]=_0x524934[_0x5354('0x36')][_0x5354('0x39')]?_0x524934[_0x5354('0x36')]:_0x2658aa[_0x5354('0x32')];if(!_0x49eb57[_0x5354('0x34')][_0x5354('0x3a')]('nolimit')){_0x524934[_0x5354('0x1b')]=qs[_0x5354('0x1b')](_0x49eb57[_0x5354('0x34')][_0x5354('0x1b')]);_0x524934[_0x5354('0x1a')]=qs['offset'](_0x49eb57[_0x5354('0x34')][_0x5354('0x1a')]);}_0x524934[_0x5354('0x3b')]=qs[_0x5354('0x3c')](_0x49eb57['query'][_0x5354('0x3c')]);_0x524934[_0x5354('0x3d')]=qs[_0x5354('0x35')](_[_0x5354('0x3e')](_0x49eb57['query'],_0x2658aa[_0x5354('0x35')]),_0x3e2c78);if(_0x49eb57[_0x5354('0x34')][_0x5354('0x3f')]){_0x524934['where']=_['merge'](_0x524934['where'],{'$or':_[_0x5354('0x2c')](_0x3e2c78,function(_0x1fe167){if(_0x1fe167['type']!==_0x5354('0x40')){var _0x2f0e74={};_0x2f0e74[_0x1fe167['name']]={'$like':'%'+_0x49eb57[_0x5354('0x34')]['filter']+'%'};return _0x2f0e74;}})});}_0x524934=_[_0x5354('0x41')]({},_0x524934,_0x49eb57[_0x5354('0x42')]);var _0x3e4598={'where':_0x524934['where']};return db[_0x5354('0x2d')][_0x5354('0x1d')](_0x3e4598)[_0x5354('0x25')](function(_0x462840){_0x2eff1f[_0x5354('0x1d')]=_0x462840;if(_0x49eb57[_0x5354('0x34')][_0x5354('0x43')]){_0x524934[_0x5354('0x44')]=[{'all':!![]}];}return db[_0x5354('0x2d')]['findAll'](_0x524934);})[_0x5354('0x25')](function(_0x3cf579){_0x2eff1f[_0x5354('0x45')]=_0x3cf579;return _0x2eff1f;})[_0x5354('0x25')](respondWithFilteredResult(_0x12ff2a,_0x524934))[_0x5354('0x46')](handleError(_0x12ff2a,null));};exports[_0x5354('0x47')]=function(_0x408664,_0x55ceda){var _0x2de6b2={'raw':!![],'where':{'id':_0x408664[_0x5354('0x48')]['id']}},_0x33e444={};_0x33e444[_0x5354('0x32')]=_[_0x5354('0x49')](db[_0x5354('0x2d')]['rawAttributes']);_0x33e444[_0x5354('0x34')]=_[_0x5354('0x49')](_0x408664['query']);_0x33e444[_0x5354('0x35')]=_['intersection'](_0x33e444[_0x5354('0x32')],_0x33e444['query']);_0x2de6b2['attributes']=_[_0x5354('0x37')](_0x33e444['model'],qs['fields'](_0x408664[_0x5354('0x34')][_0x5354('0x38')]));_0x2de6b2[_0x5354('0x36')]=_0x2de6b2[_0x5354('0x36')]['length']?_0x2de6b2[_0x5354('0x36')]:_0x33e444['model'];if(_0x408664['query'][_0x5354('0x43')]){_0x2de6b2[_0x5354('0x44')]=[{'all':!![]}];}_0x2de6b2=_[_0x5354('0x41')]({},_0x2de6b2,_0x408664[_0x5354('0x42')]);return db[_0x5354('0x2d')][_0x5354('0x4a')](_0x2de6b2)[_0x5354('0x25')](handleEntityNotFound(_0x55ceda,null))[_0x5354('0x25')](respondWithResult(_0x55ceda,null))['catch'](handleError(_0x55ceda,null));};exports[_0x5354('0x4b')]=function(_0xc3f6d0,_0x9c59dd){return db[_0x5354('0x2d')][_0x5354('0x4b')](_0xc3f6d0['body'],{})[_0x5354('0x25')](function(_0x5c17a4){var _0x47ede7=_0xc3f6d0[_0x5354('0x4c')]['get']({'plain':!![]});if(!_0x47ede7)throw new Error(_0x5354('0x4d'));if(_0x47ede7['role']===_0x5354('0x4c')){var _0x26842d=_0x5c17a4[_0x5354('0x26')]({'plain':!![]});var _0x268bb4='Variables';return db[_0x5354('0x4e')][_0x5354('0x4a')]({'where':{'name':_0x268bb4,'userProfileId':_0x47ede7[_0x5354('0x4f')]},'raw':!![]})[_0x5354('0x25')](function(_0x705799){if(_0x705799&&_0x705799['autoAssociation']===0x0){return db[_0x5354('0x28')]['create']({'name':_0x26842d['name'],'resourceId':_0x26842d['id'],'type':_0x705799[_0x5354('0x33')],'sectionId':_0x705799['id']},{})[_0x5354('0x25')](function(){return _0x5c17a4;});}else{return _0x5c17a4;}})['catch'](function(_0x565b3b){logger['error'](_0x5354('0x50'),_0x565b3b);throw _0x565b3b;});}return _0x5c17a4;})[_0x5354('0x25')](respondWithResult(_0x9c59dd,0xc9))[_0x5354('0x46')](handleError(_0x9c59dd,null));};exports['update']=function(_0x5962d1,_0x3d08f2){if(_0x5962d1['body']['id']){delete _0x5962d1[_0x5354('0x51')]['id'];}return db[_0x5354('0x2d')][_0x5354('0x4a')]({'where':{'id':_0x5962d1['params']['id']}})['then'](handleEntityNotFound(_0x3d08f2,null))[_0x5354('0x25')](saveUpdates(_0x5962d1[_0x5354('0x51')],null))[_0x5354('0x25')](respondWithResult(_0x3d08f2,null))['catch'](handleError(_0x3d08f2,null));};exports['destroy']=function(_0x3f2665,_0x1aea62){return db['Variable']['find']({'where':{'id':_0x3f2665['params']['id']}})['then'](handleEntityNotFound(_0x1aea62,null))[_0x5354('0x25')](removeEntity(_0x1aea62,null))[_0x5354('0x46')](handleError(_0x1aea62,null));}; \ No newline at end of file +var _0xe4bc=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','set','apply','reject','save','update','destroy','get','Variables','then','sendStatus','error','name','index','map','Variable','rawAttributes','type','model','query','keys','intersection','attributes','length','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','params','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring'];(function(_0x2fee45,_0x1a4784){var _0x2e56cf=function(_0x3e0485){while(--_0x3e0485){_0x2fee45['push'](_0x2fee45['shift']());}};_0x2e56cf(++_0x1a4784);}(_0xe4bc,0x8d));var _0xce4b=function(_0x8ed621,_0x42efda){_0x8ed621=_0x8ed621-0x0;var _0x80cfb9=_0xe4bc[_0x8ed621];return _0x80cfb9;};'use strict';var emlformat=require(_0xce4b('0x0'));var rimraf=require(_0xce4b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce4b('0x2'));var rp=require(_0xce4b('0x3'));var moment=require('moment');var BPromise=require(_0xce4b('0x4'));var Mustache=require(_0xce4b('0x5'));var util=require('util');var path=require(_0xce4b('0x6'));var sox=require(_0xce4b('0x7'));var csv=require(_0xce4b('0x8'));var ejs=require(_0xce4b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce4b('0xa'));var squel=require(_0xce4b('0xb'));var crypto=require('crypto');var jsforce=require(_0xce4b('0xc'));var deskjs=require(_0xce4b('0xd'));var toCsv=require(_0xce4b('0x8'));var querystring=require(_0xce4b('0xe'));var Papa=require(_0xce4b('0xf'));var Redis=require(_0xce4b('0x10'));var authService=require(_0xce4b('0x11'));var qs=require(_0xce4b('0x12'));var as=require(_0xce4b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xce4b('0x14'));var utils=require(_0xce4b('0x15'));var config=require(_0xce4b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xce4b('0x17'))['db'];function respondWithStatusCode(_0x18f883,_0x2efbbe){_0x2efbbe=_0x2efbbe||0xcc;return function(_0x23203e){if(_0x23203e){return _0x18f883['sendStatus'](_0x2efbbe);}return _0x18f883[_0xce4b('0x18')](_0x2efbbe)[_0xce4b('0x19')]();};}function respondWithResult(_0x4ef526,_0x1e434f){_0x1e434f=_0x1e434f||0xc8;return function(_0x3d6070){if(_0x3d6070){return _0x4ef526[_0xce4b('0x18')](_0x1e434f)[_0xce4b('0x1a')](_0x3d6070);}};}function respondWithFilteredResult(_0x3b6b88,_0x32de77){return function(_0x188731){if(_0x188731){var _0x4bb808=typeof _0x32de77['offset']===_0xce4b('0x1b')&&typeof _0x32de77[_0xce4b('0x1c')]==='undefined';var _0x434c74=_0x188731[_0xce4b('0x1d')];var _0x575c12=_0x4bb808?0x0:_0x32de77['offset'];var _0x40dac1=_0x4bb808?_0x188731[_0xce4b('0x1d')]:_0x32de77['offset']+_0x32de77[_0xce4b('0x1c')];var _0x28bb73;if(_0x40dac1>=_0x434c74){_0x40dac1=_0x434c74;_0x28bb73=0xc8;}else{_0x28bb73=0xce;}_0x3b6b88[_0xce4b('0x18')](_0x28bb73);return _0x3b6b88[_0xce4b('0x1e')]('Content-Range',_0x575c12+'-'+_0x40dac1+'/'+_0x434c74)['json'](_0x188731);}return null;};}function patchUpdates(_0x42691d){return function(_0x21c5f8){try{jsonpatch[_0xce4b('0x1f')](_0x21c5f8,_0x42691d,!![]);}catch(_0x1eaa53){return BPromise[_0xce4b('0x20')](_0x1eaa53);}return _0x21c5f8[_0xce4b('0x21')]();};}function saveUpdates(_0x4b737a,_0x553d9a){return function(_0x1d2cd6){if(_0x1d2cd6){return _0x1d2cd6[_0xce4b('0x22')](_0x4b737a)['then'](function(_0x19b592){return _0x19b592;});}return null;};}function removeEntity(_0x27df73,_0xbb1e86){return function(_0x70703b){if(_0x70703b){return _0x70703b[_0xce4b('0x23')]()['then'](function(){var _0x45b5e1=_0x70703b[_0xce4b('0x24')]({'plain':!![]});var _0x3e60ca=_0xce4b('0x25');return db['UserProfileResource'][_0xce4b('0x23')]({'where':{'type':_0x3e60ca,'resourceId':_0x45b5e1['id']}})['then'](function(){return _0x70703b;});})[_0xce4b('0x26')](function(){_0x27df73['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x217fd9,_0x5ef097){return function(_0x1a74e1){if(!_0x1a74e1){_0x217fd9[_0xce4b('0x27')](0x194);}return _0x1a74e1;};}function handleError(_0x5f5ddf,_0x312766){_0x312766=_0x312766||0x1f4;return function(_0x1fbadf){logger[_0xce4b('0x28')](_0x1fbadf['stack']);if(_0x1fbadf[_0xce4b('0x29')]){delete _0x1fbadf['name'];}_0x5f5ddf[_0xce4b('0x18')](_0x312766)['send'](_0x1fbadf);};}exports[_0xce4b('0x2a')]=function(_0x1342ed,_0x459fce){var _0xf9c4a={},_0x251d4b={},_0x5149a6={'count':0x0,'rows':[]};var _0x4b5c48=_[_0xce4b('0x2b')](db[_0xce4b('0x2c')][_0xce4b('0x2d')],function(_0x52f0fb){return{'name':_0x52f0fb['fieldName'],'type':_0x52f0fb[_0xce4b('0x2e')]['key']};});_0x251d4b[_0xce4b('0x2f')]=_[_0xce4b('0x2b')](_0x4b5c48,_0xce4b('0x29'));_0x251d4b[_0xce4b('0x30')]=_[_0xce4b('0x31')](_0x1342ed['query']);_0x251d4b['filters']=_[_0xce4b('0x32')](_0x251d4b[_0xce4b('0x2f')],_0x251d4b[_0xce4b('0x30')]);_0xf9c4a[_0xce4b('0x33')]=_['intersection'](_0x251d4b['model'],qs['fields'](_0x1342ed[_0xce4b('0x30')]['fields']));_0xf9c4a[_0xce4b('0x33')]=_0xf9c4a[_0xce4b('0x33')][_0xce4b('0x34')]?_0xf9c4a[_0xce4b('0x33')]:_0x251d4b['model'];if(!_0x1342ed[_0xce4b('0x30')]['hasOwnProperty']('nolimit')){_0xf9c4a[_0xce4b('0x1c')]=qs[_0xce4b('0x1c')](_0x1342ed[_0xce4b('0x30')][_0xce4b('0x1c')]);_0xf9c4a[_0xce4b('0x35')]=qs[_0xce4b('0x35')](_0x1342ed[_0xce4b('0x30')]['offset']);}_0xf9c4a[_0xce4b('0x36')]=qs[_0xce4b('0x37')](_0x1342ed[_0xce4b('0x30')][_0xce4b('0x37')]);_0xf9c4a[_0xce4b('0x38')]=qs[_0xce4b('0x39')](_[_0xce4b('0x3a')](_0x1342ed[_0xce4b('0x30')],_0x251d4b[_0xce4b('0x39')]),_0x4b5c48);if(_0x1342ed[_0xce4b('0x30')][_0xce4b('0x3b')]){_0xf9c4a[_0xce4b('0x38')]=_[_0xce4b('0x3c')](_0xf9c4a[_0xce4b('0x38')],{'$or':_['map'](_0x4b5c48,function(_0x3be400){if(_0x3be400[_0xce4b('0x2e')]!==_0xce4b('0x3d')){var _0x49311a={};_0x49311a[_0x3be400[_0xce4b('0x29')]]={'$like':'%'+_0x1342ed['query'][_0xce4b('0x3b')]+'%'};return _0x49311a;}})});}_0xf9c4a=_[_0xce4b('0x3c')]({},_0xf9c4a,_0x1342ed[_0xce4b('0x3e')]);var _0x5efeeb={'where':_0xf9c4a['where']};return db[_0xce4b('0x2c')][_0xce4b('0x1d')](_0x5efeeb)['then'](function(_0x38533c){_0x5149a6[_0xce4b('0x1d')]=_0x38533c;if(_0x1342ed[_0xce4b('0x30')][_0xce4b('0x3f')]){_0xf9c4a['include']=[{'all':!![]}];}return db[_0xce4b('0x2c')]['findAll'](_0xf9c4a);})['then'](function(_0x1877e7){_0x5149a6['rows']=_0x1877e7;return _0x5149a6;})[_0xce4b('0x26')](respondWithFilteredResult(_0x459fce,_0xf9c4a))[_0xce4b('0x40')](handleError(_0x459fce,null));};exports[_0xce4b('0x41')]=function(_0x3f48c3,_0x42928e){var _0x3c0c01={'raw':!![],'where':{'id':_0x3f48c3[_0xce4b('0x42')]['id']}},_0x2723f={};_0x2723f[_0xce4b('0x2f')]=_[_0xce4b('0x31')](db[_0xce4b('0x2c')]['rawAttributes']);_0x2723f[_0xce4b('0x30')]=_[_0xce4b('0x31')](_0x3f48c3[_0xce4b('0x30')]);_0x2723f[_0xce4b('0x39')]=_[_0xce4b('0x32')](_0x2723f['model'],_0x2723f[_0xce4b('0x30')]);_0x3c0c01[_0xce4b('0x33')]=_[_0xce4b('0x32')](_0x2723f[_0xce4b('0x2f')],qs[_0xce4b('0x43')](_0x3f48c3['query']['fields']));_0x3c0c01[_0xce4b('0x33')]=_0x3c0c01[_0xce4b('0x33')][_0xce4b('0x34')]?_0x3c0c01[_0xce4b('0x33')]:_0x2723f[_0xce4b('0x2f')];if(_0x3f48c3[_0xce4b('0x30')][_0xce4b('0x3f')]){_0x3c0c01['include']=[{'all':!![]}];}_0x3c0c01=_['merge']({},_0x3c0c01,_0x3f48c3[_0xce4b('0x3e')]);return db[_0xce4b('0x2c')]['find'](_0x3c0c01)[_0xce4b('0x26')](handleEntityNotFound(_0x42928e,null))['then'](respondWithResult(_0x42928e,null))[_0xce4b('0x40')](handleError(_0x42928e,null));};exports['create']=function(_0x250a18,_0x3b4f5a){return db[_0xce4b('0x2c')][_0xce4b('0x44')](_0x250a18[_0xce4b('0x45')],{})[_0xce4b('0x26')](function(_0xbc4a2){var _0x58cd9e=_0x250a18[_0xce4b('0x46')][_0xce4b('0x24')]({'plain':!![]});if(!_0x58cd9e)throw new Error(_0xce4b('0x47'));if(_0x58cd9e[_0xce4b('0x48')]==='user'){var _0x18e648=_0xbc4a2[_0xce4b('0x24')]({'plain':!![]});var _0xdd900f=_0xce4b('0x25');return db[_0xce4b('0x49')][_0xce4b('0x4a')]({'where':{'name':_0xdd900f,'userProfileId':_0x58cd9e[_0xce4b('0x4b')]},'raw':!![]})[_0xce4b('0x26')](function(_0x57eb58){if(_0x57eb58&&_0x57eb58['autoAssociation']===0x0){return db[_0xce4b('0x4c')]['create']({'name':_0x18e648[_0xce4b('0x29')],'resourceId':_0x18e648['id'],'type':_0x57eb58['name'],'sectionId':_0x57eb58['id']},{})[_0xce4b('0x26')](function(){return _0xbc4a2;});}else{return _0xbc4a2;}})[_0xce4b('0x40')](function(_0x9ea16e){logger[_0xce4b('0x28')](_0xce4b('0x4d'),_0x9ea16e);throw _0x9ea16e;});}return _0xbc4a2;})[_0xce4b('0x26')](respondWithResult(_0x3b4f5a,0xc9))['catch'](handleError(_0x3b4f5a,null));};exports[_0xce4b('0x22')]=function(_0x549710,_0x10e0f1){if(_0x549710[_0xce4b('0x45')]['id']){delete _0x549710[_0xce4b('0x45')]['id'];}return db[_0xce4b('0x2c')]['find']({'where':{'id':_0x549710[_0xce4b('0x42')]['id']}})['then'](handleEntityNotFound(_0x10e0f1,null))[_0xce4b('0x26')](saveUpdates(_0x549710['body'],null))[_0xce4b('0x26')](respondWithResult(_0x10e0f1,null))[_0xce4b('0x40')](handleError(_0x10e0f1,null));};exports[_0xce4b('0x23')]=function(_0xaec71f,_0x26ea74){return db['Variable'][_0xce4b('0x4a')]({'where':{'id':_0xaec71f[_0xce4b('0x42')]['id']}})['then'](handleEntityNotFound(_0x26ea74,null))[_0xce4b('0x26')](removeEntity(_0x26ea74,null))[_0xce4b('0x40')](handleError(_0x26ea74,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index a24f0e3..9656f89 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 _0x74ad=['rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','../../config/logger','api','request-promise','path'];(function(_0x529b9a,_0x3ddafe){var _0x15b1f2=function(_0x584921){while(--_0x584921){_0x529b9a['push'](_0x529b9a['shift']());}};_0x15b1f2(++_0x3ddafe);}(_0x74ad,0x1b4));var _0xd74a=function(_0x2ece52,_0x538ee5){_0x2ece52=_0x2ece52-0x0;var _0x585ea8=_0x74ad[_0x2ece52];return _0x585ea8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd74a('0x0'))(_0xd74a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd74a('0x2'));var fs=require('fs');var path=require(_0xd74a('0x3'));var rimraf=require(_0xd74a('0x4'));var config=require(_0xd74a('0x5'));var attributes=require(_0xd74a('0x6'));module[_0xd74a('0x7')]=function(_0x3b4ddd,_0xac1c66){return _0x3b4ddd[_0xd74a('0x8')](_0xd74a('0x9'),attributes,{'tableName':_0xd74a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d49=['exports','define','Variable','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./variable.attributes'];(function(_0x1196bd,_0xba4aea){var _0x26014f=function(_0x542a3d){while(--_0x542a3d){_0x1196bd['push'](_0x1196bd['shift']());}};_0x26014f(++_0xba4aea);}(_0x7d49,0x1c5));var _0x97d4=function(_0xe618a9,_0x3eddc5){_0xe618a9=_0xe618a9-0x0;var _0x20aae0=_0x7d49[_0xe618a9];return _0x20aae0;};'use strict';var _=require(_0x97d4('0x0'));var util=require('util');var logger=require(_0x97d4('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x97d4('0x2'));var fs=require('fs');var path=require(_0x97d4('0x3'));var rimraf=require(_0x97d4('0x4'));var config=require(_0x97d4('0x5'));var attributes=require(_0x97d4('0x6'));module[_0x97d4('0x7')]=function(_0x20af5f,_0x271d79){return _0x20af5f[_0x97d4('0x8')](_0x97d4('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 8f4756e..bfdf9cb 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 _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x3dc473,_0x4b2a0b){var _0x4820a6=function(_0x31cc73){while(--_0x31cc73){_0x3dc473['push'](_0x3dc473['shift']());}};_0x4820a6(++_0x4b2a0b);}(_0xe14b,0x93));var _0xbe14=function(_0x2e06ab,_0x2d1009){_0x2e06ab=_0x2e06ab-0x0;var _0x5adf12=_0xe14b[_0x2e06ab];return _0x5adf12;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file +var _0x9957=['stringify','error','code','message','result','catch','ShowVariable','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x5257d6,_0x5be71e){var _0x41a696=function(_0x36d7b1){while(--_0x36d7b1){_0x5257d6['push'](_0x5257d6['shift']());}};_0x41a696(++_0x5be71e);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var 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']('Variable,\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);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Variable'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowVariable',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 2a88f15..8b4b724 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 _0x1992=['/fetch','isAuthenticated','fetch','/reset','canUpdate','reset','/pull','pull','/restart','restart','/migrations','migrations','express','Router','../../components/auth/service','get','index'];(function(_0x71b765,_0x3053f8){var _0x34cb24=function(_0x2dd237){while(--_0x2dd237){_0x71b765['push'](_0x71b765['shift']());}};_0x34cb24(++_0x3053f8);}(_0x1992,0x72));var _0x2199=function(_0x4bb434,_0x582b21){_0x4bb434=_0x4bb434-0x0;var _0x4e1c91=_0x1992[_0x4bb434];return _0x4e1c91;};'use strict';var express=require(_0x2199('0x0'));var router=express[_0x2199('0x1')]();var auth=require(_0x2199('0x2'));var controller=require('./version.controller');router[_0x2199('0x3')]('/',controller[_0x2199('0x4')]);router['get'](_0x2199('0x5'),auth[_0x2199('0x6')](),auth['canUpdate'](),controller[_0x2199('0x7')]);router[_0x2199('0x3')](_0x2199('0x8'),auth[_0x2199('0x6')](),auth[_0x2199('0x9')](),controller[_0x2199('0xa')]);router[_0x2199('0x3')](_0x2199('0xb'),auth[_0x2199('0x6')](),auth[_0x2199('0x9')](),controller[_0x2199('0xc')]);router['get'](_0x2199('0xd'),auth[_0x2199('0x6')](),controller[_0x2199('0xe')]);router[_0x2199('0x3')](_0x2199('0xf'),controller[_0x2199('0x10')]);module['exports']=router; \ No newline at end of file +var _0x295f=['/restart','restart','/migrations','exports','express','Router','../../components/auth/service','index','/fetch','isAuthenticated','canUpdate','fetch','get','/reset','/pull','pull'];(function(_0x2c3aed,_0xa4011f){var _0x473dc4=function(_0x2a4ffc){while(--_0x2a4ffc){_0x2c3aed['push'](_0x2c3aed['shift']());}};_0x473dc4(++_0xa4011f);}(_0x295f,0x174));var _0xf295=function(_0x1d53cf,_0x4dc725){_0x1d53cf=_0x1d53cf-0x0;var _0x581409=_0x295f[_0x1d53cf];return _0x581409;};'use strict';var express=require(_0xf295('0x0'));var router=express[_0xf295('0x1')]();var auth=require(_0xf295('0x2'));var controller=require('./version.controller');router['get']('/',controller[_0xf295('0x3')]);router['get'](_0xf295('0x4'),auth[_0xf295('0x5')](),auth[_0xf295('0x6')](),controller[_0xf295('0x7')]);router[_0xf295('0x8')](_0xf295('0x9'),auth['isAuthenticated'](),auth['canUpdate'](),controller['reset']);router[_0xf295('0x8')](_0xf295('0xa'),auth[_0xf295('0x5')](),auth['canUpdate'](),controller[_0xf295('0xb')]);router[_0xf295('0x8')](_0xf295('0xc'),auth[_0xf295('0x5')](),controller[_0xf295('0xd')]);router['get'](_0xf295('0xe'),controller['migrations']);module[_0xf295('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 474bd28..3965c9c 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 _0xf692=['pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','server','migrations','length','sort','Migration','constructor','join','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','umzug','path','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then'];(function(_0x23071e,_0x4df73d){var _0x397837=function(_0x3a1e44){while(--_0x3a1e44){_0x23071e['push'](_0x23071e['shift']());}};_0x397837(++_0x4df73d);}(_0xf692,0x156));var _0x2f69=function(_0x57f70d,_0x187e05){_0x57f70d=_0x57f70d-0x0;var _0x328a35=_0xf692[_0x57f70d];return _0x328a35;};'use strict';var Umzug=require(_0x2f69('0x0'));var path=require(_0x2f69('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0x2f69('0x2'));var compareVersions=require(_0x2f69('0x3'));var exec=require(_0x2f69('0x4'))['exec'];var db=require(_0x2f69('0x5'))['db'];var config=require(_0x2f69('0x6'));var pm2=require(_0x2f69('0x7'));var logger=require('../../config/logger')(_0x2f69('0x8'));var git=require(_0x2f69('0x9'))(config[_0x2f69('0xa')]);exports[_0x2f69('0xb')]=function(_0x31a1e5,_0x5834da){var _0x178e1e={'current':module[_0x2f69('0xc')][_0x2f69('0x2')],'phonebar':0x2};if(_0x31a1e5[_0x2f69('0xd')]&&_0x31a1e5[_0x2f69('0xd')][_0x2f69('0xe')]){return git[_0x2f69('0xf')]()[_0x2f69('0x10')](function(_0xb6b480,_0x333337){_0x178e1e[_0x2f69('0xe')]=(_0xb6b480?module[_0x2f69('0xc')][_0x2f69('0x2')]:_0x333337[_0x2f69('0xe')])||_0x2f69('0x11');return _0x5834da[_0x2f69('0x12')](0xc8)[_0x2f69('0x13')](_0x178e1e);});}else{return _0x5834da[_0x2f69('0x12')](0xc8)[_0x2f69('0x13')](_0x178e1e);}};exports[_0x2f69('0xf')]=function(_0x8d496d,_0x11fcf1){return git[_0x2f69('0xf')]([_0x2f69('0x14'),_0x2f69('0x15')],function(_0x4e349c){if(_0x4e349c){logger['error'](_0x4e349c);return _0x11fcf1[_0x2f69('0x12')](0x1f4)[_0x2f69('0x13')](_0x4e349c);}logger[_0x2f69('0x16')]('git\x20fetch');return _0x11fcf1['status'](0xc8)[_0x2f69('0x13')]({'output':_0x2f69('0x17')});});};exports[_0x2f69('0x18')]=function(_0x667494,_0x5b39d4){return git['reset']([_0x2f69('0x19'),_0x2f69('0x1a')],function(_0x422877){if(_0x422877){logger[_0x2f69('0x1b')](_0x422877);return _0x5b39d4[_0x2f69('0x12')](0x1f4)[_0x2f69('0x13')](_0x422877);}logger[_0x2f69('0x16')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x5b39d4[_0x2f69('0x12')](0xc8)[_0x2f69('0x13')]({'output':_0x2f69('0x1c')});});};exports[_0x2f69('0x1d')]=function(_0x482bf4,_0x29a52f){exec(_0x2f69('0x1e'),function(_0xba66a9,_0x182ccc,_0x58ee85){logger['info'](_0x182ccc);logger['info'](_0x58ee85);if(_0xba66a9){logger['error'](_0xba66a9);return _0x29a52f[_0x2f69('0x12')](0x1f4)[_0x2f69('0x13')](_0xba66a9);}return _0x29a52f[_0x2f69('0x12')](0xc8)[_0x2f69('0x13')]({'output':_0x182ccc});});};exports[_0x2f69('0x1f')]=function(_0x3472c9,_0x39f73d){return pm2[_0x2f69('0x1f')](_0x2f69('0x20'))[_0x2f69('0x21')](function(_0x16e1b3){logger[_0x2f69('0x16')](_0x2f69('0x22'),_0x16e1b3);return _0x39f73d['status'](0xc8)[_0x2f69('0x13')]({'output':_0x2f69('0x23')});})['catch'](function(_0x58539b){logger[_0x2f69('0x1b')](_0x58539b);return _0x39f73d[_0x2f69('0x12')](0x1f4)[_0x2f69('0x13')](_0x58539b);});};exports['migrations']=function(_0x10ed41,_0x26b57b){var _0x327c74=fs['readdirSync'](path['join'](config[_0x2f69('0xa')],_0x2f69('0x24'),_0x2f69('0x25')));var _0x3c7800=[];for(var _0x15590d=0x0;_0x15590d<_0x327c74[_0x2f69('0x26')];_0x15590d++){var _0x3e9005=_0x327c74[_0x15590d]['replace']('.js','');if(compareVersions(module[_0x2f69('0xc')][_0x2f69('0x2')],_0x3e9005)===-0x1){_0x3c7800['push'](_0x3e9005);}}if(_0x3c7800[_0x2f69('0x26')]){var _0x128acb=_0x3c7800[_0x2f69('0x27')](compareVersions);var _0x555f3e=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x2f69('0x28')],'modelName':'Migration','columnName':_0x2f69('0x2')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db['sequelize'][_0x2f69('0x29')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x2f69('0x2a')](config['root'],_0x2f69('0x24'),_0x2f69('0x25')),'pattern':/\.js$/}});_0x555f3e['up']({'migrations':_['map'](_0x128acb,function(_0x5b06cc){return _0x5b06cc+'.js';})})[_0x2f69('0x21')](function(){return _0x26b57b[_0x2f69('0x12')](0xc8)[_0x2f69('0x13')]({'output':_0x2f69('0x2b')+module['exports']['version']+_0x2f69('0x2c')+_[_0x2f69('0x2d')](_0x128acb),'migrations':_['join'](_0x128acb)});})[_0x2f69('0x2e')](function(_0xec6de5){if(_0xec6de5 instanceof db['sequelize']['UniqueConstraintError']){return _0x26b57b[_0x2f69('0x12')](0xc8)[_0x2f69('0x13')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x26b57b[_0x2f69('0x12')](0x1f4)['json'](_0xec6de5);}});}else{return _0x26b57b['status'](0xc8)[_0x2f69('0x13')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x99be=['latest','fetch','tags','2.0.0','status','json','master','error','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','npm\x20install\x20--production','info','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','join','server','length','.js','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','root','index','exports'];(function(_0x7395c7,_0x2f973f){var _0x30d3d9=function(_0x69894){while(--_0x69894){_0x7395c7['push'](_0x7395c7['shift']());}};_0x30d3d9(++_0x2f973f);}(_0x99be,0xe7));var _0xe99b=function(_0x522ca0,_0x5a8631){_0x522ca0=_0x522ca0-0x0;var _0x26beb8=_0x99be[_0x522ca0];return _0x26beb8;};'use strict';var Umzug=require('umzug');var path=require(_0xe99b('0x0'));var fs=require('fs');var _=require(_0xe99b('0x1'));var pkginfo=require(_0xe99b('0x2'))(module,_0xe99b('0x3'));var compareVersions=require(_0xe99b('0x4'));var exec=require(_0xe99b('0x5'))['exec'];var db=require(_0xe99b('0x6'))['db'];var config=require(_0xe99b('0x7'));var pm2=require(_0xe99b('0x8'));var logger=require(_0xe99b('0x9'))(_0xe99b('0xa'));var git=require('simple-git')(config[_0xe99b('0xb')]);exports[_0xe99b('0xc')]=function(_0x21dfff,_0x4ca50e){var _0x3b1242={'current':module[_0xe99b('0xd')][_0xe99b('0x3')],'phonebar':0x2};if(_0x21dfff['query']&&_0x21dfff['query'][_0xe99b('0xe')]){return git[_0xe99b('0xf')]()[_0xe99b('0x10')](function(_0x44c168,_0x15fcef){_0x3b1242[_0xe99b('0xe')]=(_0x44c168?module[_0xe99b('0xd')][_0xe99b('0x3')]:_0x15fcef[_0xe99b('0xe')])||_0xe99b('0x11');return _0x4ca50e[_0xe99b('0x12')](0xc8)[_0xe99b('0x13')](_0x3b1242);});}else{return _0x4ca50e[_0xe99b('0x12')](0xc8)[_0xe99b('0x13')](_0x3b1242);}};exports[_0xe99b('0xf')]=function(_0x3b7348,_0x168993){return git[_0xe99b('0xf')](['origin',_0xe99b('0x14')],function(_0x520e36){if(_0x520e36){logger[_0xe99b('0x15')](_0x520e36);return _0x168993[_0xe99b('0x12')](0x1f4)[_0xe99b('0x13')](_0x520e36);}logger['info'](_0xe99b('0x16'));return _0x168993[_0xe99b('0x12')](0xc8)[_0xe99b('0x13')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x4eb0f6,_0x2a4d21){return git[_0xe99b('0x17')]([_0xe99b('0x18'),_0xe99b('0x19')],function(_0x22d0bf){if(_0x22d0bf){logger[_0xe99b('0x15')](_0x22d0bf);return _0x2a4d21[_0xe99b('0x12')](0x1f4)['json'](_0x22d0bf);}logger['info'](_0xe99b('0x1a'));return _0x2a4d21['status'](0xc8)[_0xe99b('0x13')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x57b2ba,_0x3ccf1a){exec(_0xe99b('0x1b'),function(_0x5526e1,_0x9c4903,_0x409f35){logger[_0xe99b('0x1c')](_0x9c4903);logger[_0xe99b('0x1c')](_0x409f35);if(_0x5526e1){logger[_0xe99b('0x15')](_0x5526e1);return _0x3ccf1a[_0xe99b('0x12')](0x1f4)['json'](_0x5526e1);}return _0x3ccf1a[_0xe99b('0x12')](0xc8)[_0xe99b('0x13')]({'output':_0x9c4903});});};exports[_0xe99b('0x1d')]=function(_0x582ec3,_0x5bf590){return pm2[_0xe99b('0x1d')]('motion2')[_0xe99b('0x1e')](function(_0x2f1c8d){logger[_0xe99b('0x1c')](_0xe99b('0x1f'),_0x2f1c8d);return _0x5bf590['status'](0xc8)['json']({'output':_0xe99b('0x20')});})['catch'](function(_0x2f924f){logger['error'](_0x2f924f);return _0x5bf590[_0xe99b('0x12')](0x1f4)['json'](_0x2f924f);});};exports[_0xe99b('0x21')]=function(_0x23a5f0,_0xe7901b){var _0x50545c=fs['readdirSync'](path[_0xe99b('0x22')](config[_0xe99b('0xb')],_0xe99b('0x23'),'migrations'));var _0x208e52=[];for(var _0x573c61=0x0;_0x573c61<_0x50545c[_0xe99b('0x24')];_0x573c61++){var _0x17bd4d=_0x50545c[_0x573c61]['replace'](_0xe99b('0x25'),'');if(compareVersions(module[_0xe99b('0xd')]['version'],_0x17bd4d)===-0x1){_0x208e52['push'](_0x17bd4d);}}if(_0x208e52[_0xe99b('0x24')]){var _0x4a91c6=_0x208e52[_0xe99b('0x26')](compareVersions);var _0x4ce1f5=new Umzug({'storage':_0xe99b('0x27'),'storageOptions':{'model':db[_0xe99b('0x28')],'modelName':'Migration','columnName':_0xe99b('0x3')},'migrations':{'params':[db['sequelize'][_0xe99b('0x29')](),db['sequelize'][_0xe99b('0x2a')],function(){throw new Error(_0xe99b('0x2b'));}],'path':path[_0xe99b('0x22')](config[_0xe99b('0xb')],_0xe99b('0x23'),_0xe99b('0x21')),'pattern':/\.js$/}});_0x4ce1f5['up']({'migrations':_[_0xe99b('0x2c')](_0x4a91c6,function(_0x373635){return _0x373635+_0xe99b('0x25');})})[_0xe99b('0x1e')](function(){return _0xe7901b[_0xe99b('0x12')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports']['version']+_0xe99b('0x2d')+_[_0xe99b('0x2e')](_0x4a91c6),'migrations':_[_0xe99b('0x22')](_0x4a91c6)});})['catch'](function(_0x5d6565){if(_0x5d6565 instanceof db[_0xe99b('0x27')][_0xe99b('0x2f')]){return _0xe7901b['status'](0xc8)[_0xe99b('0x13')]({'output':_0xe99b('0x30')});}else{return _0xe7901b[_0xe99b('0x12')](0x1f4)[_0xe99b('0x13')](_0x5d6565);}});}else{return _0xe7901b[_0xe99b('0x12')](0xc8)[_0xe99b('0x13')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index e445d67..63f1752 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 _0xd460=['index','describe','/:id','show','post','create','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated'];(function(_0xc1ca9,_0xba0789){var _0xeb22a1=function(_0x20656c){while(--_0x20656c){_0xc1ca9['push'](_0xc1ca9['shift']());}};_0xeb22a1(++_0xba0789);}(_0xd460,0x121));var _0x0d46=function(_0x168df1,_0x2664fe){_0x168df1=_0x168df1-0x0;var _0xabf190=_0xd460[_0x168df1];return _0xabf190;};'use strict';var multer=require(_0x0d46('0x0'));var util=require(_0x0d46('0x1'));var path=require(_0x0d46('0x2'));var timeout=require('connect-timeout');var express=require(_0x0d46('0x3'));var router=express[_0x0d46('0x4')]();var fs_extra=require(_0x0d46('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0d46('0x6'));var config=require(_0x0d46('0x7'));var controller=require(_0x0d46('0x8'));router[_0x0d46('0x9')]('/',auth[_0x0d46('0xa')](),controller[_0x0d46('0xb')]);router[_0x0d46('0x9')]('/describe',auth[_0x0d46('0xa')](),controller[_0x0d46('0xc')]);router['get'](_0x0d46('0xd'),auth[_0x0d46('0xa')](),controller[_0x0d46('0xe')]);router[_0x0d46('0xf')]('/',auth['isAuthenticated'](),controller[_0x0d46('0x10')]);router[_0x0d46('0x11')](_0x0d46('0xd'),auth[_0x0d46('0xa')](),controller['update']);router[_0x0d46('0x12')](_0x0d46('0xd'),auth['isAuthenticated'](),controller[_0x0d46('0x13')]);module['exports']=router; \ No newline at end of file +var _0xb636=['get','/describe','describe','/:id','post','create','put','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index'];(function(_0x1f03b9,_0x505409){var _0x54d5cf=function(_0x873d51){while(--_0x873d51){_0x1f03b9['push'](_0x1f03b9['shift']());}};_0x54d5cf(++_0x505409);}(_0xb636,0x198));var _0x6b63=function(_0x493fe6,_0x527078){_0x493fe6=_0x493fe6-0x0;var _0x92a94e=_0xb636[_0x493fe6];return _0x92a94e;};'use strict';var multer=require(_0x6b63('0x0'));var util=require(_0x6b63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b63('0x2'));var router=express['Router']();var fs_extra=require(_0x6b63('0x3'));var auth=require(_0x6b63('0x4'));var interaction=require(_0x6b63('0x5'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0x6b63('0x6')](),controller[_0x6b63('0x7')]);router[_0x6b63('0x8')](_0x6b63('0x9'),auth[_0x6b63('0x6')](),controller[_0x6b63('0xa')]);router['get'](_0x6b63('0xb'),auth[_0x6b63('0x6')](),controller['show']);router[_0x6b63('0xc')]('/',auth[_0x6b63('0x6')](),controller[_0x6b63('0xd')]);router[_0x6b63('0xe')](_0x6b63('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6b63('0xb'),auth[_0x6b63('0x6')](),controller['destroy']);module[_0x6b63('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 9bf4286..134fcd9 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 _0xd732=['DATE','BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x174ead,_0x4c014f){var _0x89ab47=function(_0x517df3){while(--_0x517df3){_0x174ead['push'](_0x174ead['shift']());}};_0x89ab47(++_0x4c014f);}(_0xd732,0x18e));var _0x2d73=function(_0xb5aeb4,_0x35eaac){_0xb5aeb4=_0xb5aeb4-0x0;var _0xc48c2=_0xd732[_0xb5aeb4];return _0xc48c2;};'use strict';var Sequelize=require(_0x2d73('0x0'));module['exports']={'type':{'type':Sequelize[_0x2d73('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2d73('0x1')]},'queue':{'type':Sequelize[_0x2d73('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x2d73('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x2d73('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x2d73('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x2d73('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x2d73('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x2d73('0x4')]},'agentacw':{'type':Sequelize[_0x2d73('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2d73('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x2d73('0x1')]},'channel':{'type':Sequelize[_0x2d73('0x1')]},'channelstate':{'type':Sequelize[_0x2d73('0x4')]},'channelstatedesc':{'type':Sequelize[_0x2d73('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x2d73('0x1')]},'language':{'type':Sequelize[_0x2d73('0x1')]},'accountcode':{'type':Sequelize[_0x2d73('0x1')]},'context':{'type':Sequelize[_0x2d73('0x1')]},'exten':{'type':Sequelize[_0x2d73('0x1')]},'priority':{'type':Sequelize[_0x2d73('0x1')]},'destchannel':{'type':Sequelize[_0x2d73('0x1')]},'destchannelstate':{'type':Sequelize[_0x2d73('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x2d73('0x1')]},'destcalleridnum':{'type':Sequelize[_0x2d73('0x1')]},'destcalleridname':{'type':Sequelize[_0x2d73('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x2d73('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x2d73('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x2d73('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x2d73('0x1')]},'destuniqueid':{'type':Sequelize[_0x2d73('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x2d73('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x2d73('0x1')]},'transfer':{'type':Sequelize[_0x2d73('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x2d73('0x1')]},'agententerreason':{'type':Sequelize[_0x2d73('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa7fa=['sequelize','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x57690f,_0x1cf9e4){var _0x2216c7=function(_0x2cf60c){while(--_0x2cf60c){_0x57690f['push'](_0x57690f['shift']());}};_0x2216c7(++_0x1cf9e4);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7fa[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaa7f('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xaa7f('0x1')]},'calleridnum':{'type':Sequelize[_0xaa7f('0x1')]},'calleridname':{'type':Sequelize[_0xaa7f('0x1')]},'queue':{'type':Sequelize[_0xaa7f('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xaa7f('0x1')]},'agentcalledAt':{'type':Sequelize[_0xaa7f('0x2')]},'agentconnectAt':{'type':Sequelize[_0xaa7f('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xaa7f('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xaa7f('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xaa7f('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xaa7f('0x4')]},'agentacw':{'type':Sequelize[_0xaa7f('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xaa7f('0x4')]},'reason':{'type':Sequelize[_0xaa7f('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaa7f('0x1')]},'channelstate':{'type':Sequelize[_0xaa7f('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xaa7f('0x1')]},'connectedlinename':{'type':Sequelize[_0xaa7f('0x1')]},'language':{'type':Sequelize[_0xaa7f('0x1')]},'accountcode':{'type':Sequelize[_0xaa7f('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xaa7f('0x1')]},'destchannel':{'type':Sequelize[_0xaa7f('0x1')]},'destchannelstate':{'type':Sequelize[_0xaa7f('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xaa7f('0x1')]},'destcalleridnum':{'type':Sequelize[_0xaa7f('0x1')]},'destcalleridname':{'type':Sequelize[_0xaa7f('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xaa7f('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xaa7f('0x1')]},'destlanguage':{'type':Sequelize[_0xaa7f('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xaa7f('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xaa7f('0x1')]},'destuniqueid':{'type':Sequelize[_0xaa7f('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xaa7f('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xaa7f('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xaa7f('0x1')],'comment':_0xaa7f('0x5')},'transferexten':{'type':Sequelize[_0xaa7f('0x1')]},'transferuniqueid':{'type':Sequelize[_0xaa7f('0x1')]},'agententerreason':{'type':Sequelize[_0xaa7f('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index b626bd8..ffada08 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(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_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'];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(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 50cbd31..f98df68 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 _0xb194=['report_agent','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','VoiceAgentReport'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xb194,0x1b2));var _0x4b19=function(_0x720f58,_0x51ad3d){_0x720f58=_0x720f58-0x0;var _0x4a7755=_0xb194[_0x720f58];return _0x4a7755;};'use strict';var _=require(_0x4b19('0x0'));var util=require('util');var logger=require(_0x4b19('0x1'))(_0x4b19('0x2'));var moment=require(_0x4b19('0x3'));var BPromise=require(_0x4b19('0x4'));var rp=require(_0x4b19('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b19('0x6'));var config=require(_0x4b19('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x4b19('0x8')]=function(_0x570374,_0x22033b){return _0x570374['define'](_0x4b19('0x9'),attributes,{'tableName':_0x4b19('0xa'),'paranoid':![],'indexes':[{'fields':[_0x4b19('0xb'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a5a=['moment','bluebird','path','rimraf','../../config/environment','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util','../../config/logger','api'];(function(_0x5a8d65,_0x280985){var _0x33fbe5=function(_0x21d0f2){while(--_0x21d0f2){_0x5a8d65['push'](_0x5a8d65['shift']());}};_0x33fbe5(++_0x280985);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x2bc6a2,_0x44e6ea){_0x2bc6a2=_0x2bc6a2-0x0;var _0x50f1ce=_0x5a5a[_0x2bc6a2];return _0x50f1ce;};'use strict';var _=require('lodash');var util=require(_0xa5a5('0x0'));var logger=require(_0xa5a5('0x1'))(_0xa5a5('0x2'));var moment=require(_0xa5a5('0x3'));var BPromise=require(_0xa5a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa5a5('0x5'));var rimraf=require(_0xa5a5('0x6'));var config=require(_0xa5a5('0x7'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x43943d,_0x1fe96d){return _0x43943d['define'](_0xa5a5('0x8'),attributes,{'tableName':_0xa5a5('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa5a5('0xa'),_0xa5a5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index e68ee68..55bdba6 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 _0x88a4=['UpdateVoiceAgentReport','update','body','where','limit','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','VoiceAgentReport','create','options','raw','CreateVoiceAgentReport','stringify'];(function(_0x491ec2,_0x540c00){var _0x1748db=function(_0x5a6258){while(--_0x5a6258){_0x491ec2['push'](_0x491ec2['shift']());}};_0x1748db(++_0x540c00);}(_0x88a4,0xab));var _0x488a=function(_0x4542bd,_0x404889){_0x4542bd=_0x4542bd-0x0;var _0x53eb8=_0x88a4[_0x4542bd];return _0x53eb8;};'use strict';var _=require(_0x488a('0x0'));var util=require(_0x488a('0x1'));var moment=require(_0x488a('0x2'));var BPromise=require(_0x488a('0x3'));var rs=require(_0x488a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x488a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x488a('0x6'));var config=require('../../config/environment');var jayson=require(_0x488a('0x7'));var client=jayson[_0x488a('0x8')][_0x488a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11b458,_0x26a33e,_0x49211a){return new BPromise(function(_0x5d5aad,_0x2f286d){return client[_0x488a('0xa')](_0x11b458,_0x49211a)[_0x488a('0xb')](function(_0x46234e){logger[_0x488a('0xc')](_0x488a('0xd'),_0x26a33e,_0x488a('0xe'));logger[_0x488a('0xf')](_0x488a('0x10'),_0x26a33e,_0x488a('0xe'),JSON['stringify'](_0x46234e));if(_0x46234e[_0x488a('0x11')]){if(_0x46234e['error'][_0x488a('0x12')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x26a33e,_0x46234e[_0x488a('0x11')]['message']);return _0x2f286d(_0x46234e['error']['message']);}logger[_0x488a('0x11')](_0x488a('0xd'),_0x26a33e,_0x46234e['error'][_0x488a('0x13')]);return _0x5d5aad(_0x46234e[_0x488a('0x11')][_0x488a('0x13')]);}else{logger['info'](_0x488a('0xd'),_0x26a33e,'request\x20sent');_0x5d5aad(_0x46234e[_0x488a('0x14')][_0x488a('0x13')]);}})['catch'](function(_0x4dd7d2){logger[_0x488a('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x26a33e,_0x4dd7d2);_0x2f286d(_0x4dd7d2);});});}exports['CreateVoiceAgentReport']=function(_0x2a5433){var _0x35f415=this;return new Promise(function(_0x504234,_0x36202a){return db[_0x488a('0x15')][_0x488a('0x16')](_0x2a5433['body'],{'raw':_0x2a5433[_0x488a('0x17')]?_0x2a5433[_0x488a('0x17')][_0x488a('0x18')]===undefined?!![]:![]:!![]})[_0x488a('0xb')](function(_0x2d1ec7){logger[_0x488a('0xc')](_0x488a('0x19'),_0x2a5433);logger[_0x488a('0xf')](_0x488a('0x19'),_0x2a5433,JSON[_0x488a('0x1a')](_0x2d1ec7));_0x504234(_0x2d1ec7);})['catch'](function(_0x4e86e5){logger[_0x488a('0x11')](_0x488a('0x19'),_0x4e86e5[_0x488a('0x13')],_0x2a5433);_0x36202a(_0x35f415[_0x488a('0x11')](0x1f4,_0x4e86e5['message']));});});};exports[_0x488a('0x1b')]=function(_0xa6bcac){var _0x18c8c6=this;return new Promise(function(_0x3a95a4,_0x3d0ee9){return db['VoiceAgentReport'][_0x488a('0x1c')](_0xa6bcac[_0x488a('0x1d')],{'raw':_0xa6bcac['options']?_0xa6bcac['options'][_0x488a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa6bcac['options']?_0xa6bcac[_0x488a('0x17')][_0x488a('0x1e')]||null:null,'attributes':_0xa6bcac['options']?_0xa6bcac[_0x488a('0x17')]['attributes']||null:null,'limit':_0xa6bcac[_0x488a('0x17')]?_0xa6bcac[_0x488a('0x17')][_0x488a('0x1f')]||null:null})[_0x488a('0xb')](function(_0x31ce94){logger[_0x488a('0xc')](_0x488a('0x1b'),_0xa6bcac);logger['debug'](_0x488a('0x1b'),_0xa6bcac,JSON[_0x488a('0x1a')](_0x31ce94));_0x3a95a4(_0x31ce94);})[_0x488a('0x20')](function(_0x4dac6c){logger[_0x488a('0x11')](_0x488a('0x1b'),_0x4dac6c['message'],_0xa6bcac);_0x3d0ee9(_0x18c8c6[_0x488a('0x11')](0x1f4,_0x4dac6c[_0x488a('0x13')]));});});}; \ No newline at end of file +var _0x3925=['body','options','raw','stringify','catch','UpdateVoiceAgentReport','VoiceAgentReport','update','where','limit','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','CreateVoiceAgentReport','create'];(function(_0x36f87a,_0x27c613){var _0x2fe7ab=function(_0x44eb65){while(--_0x44eb65){_0x36f87a['push'](_0x36f87a['shift']());}};_0x2fe7ab(++_0x27c613);}(_0x3925,0x190));var _0x5392=function(_0x4bf457,_0x14dcf4){_0x4bf457=_0x4bf457-0x0;var _0x232be2=_0x3925[_0x4bf457];return _0x232be2;};'use strict';var _=require(_0x5392('0x0'));var util=require(_0x5392('0x1'));var moment=require('moment');var BPromise=require(_0x5392('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5392('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5392('0x4'));var logger=require(_0x5392('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5392('0x6'));var client=jayson[_0x5392('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dd984,_0x291def,_0x519f9c){return new BPromise(function(_0x2aae85,_0xb8542e){return client['request'](_0x3dd984,_0x519f9c)[_0x5392('0x8')](function(_0x1a1690){logger['info'](_0x5392('0x9'),_0x291def,_0x5392('0xa'));logger[_0x5392('0xb')](_0x5392('0xc'),_0x291def,_0x5392('0xa'),JSON['stringify'](_0x1a1690));if(_0x1a1690['error']){if(_0x1a1690[_0x5392('0xd')][_0x5392('0xe')]===0x1f4){logger[_0x5392('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x291def,_0x1a1690[_0x5392('0xd')][_0x5392('0xf')]);return _0xb8542e(_0x1a1690[_0x5392('0xd')][_0x5392('0xf')]);}logger['error'](_0x5392('0x9'),_0x291def,_0x1a1690[_0x5392('0xd')]['message']);return _0x2aae85(_0x1a1690[_0x5392('0xd')][_0x5392('0xf')]);}else{logger[_0x5392('0x10')](_0x5392('0x9'),_0x291def,'request\x20sent');_0x2aae85(_0x1a1690[_0x5392('0x11')]['message']);}})['catch'](function(_0x4cf3ab){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x291def,_0x4cf3ab);_0xb8542e(_0x4cf3ab);});});}exports[_0x5392('0x12')]=function(_0x2cf7b5){var _0x2574af=this;return new Promise(function(_0x5f3ca5,_0x4f2f1e){return db['VoiceAgentReport'][_0x5392('0x13')](_0x2cf7b5[_0x5392('0x14')],{'raw':_0x2cf7b5['options']?_0x2cf7b5[_0x5392('0x15')][_0x5392('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x4a0b9a){logger['info']('CreateVoiceAgentReport',_0x2cf7b5);logger[_0x5392('0xb')](_0x5392('0x12'),_0x2cf7b5,JSON[_0x5392('0x17')](_0x4a0b9a));_0x5f3ca5(_0x4a0b9a);})[_0x5392('0x18')](function(_0x5f4a3a){logger[_0x5392('0xd')]('CreateVoiceAgentReport',_0x5f4a3a['message'],_0x2cf7b5);_0x4f2f1e(_0x2574af[_0x5392('0xd')](0x1f4,_0x5f4a3a['message']));});});};exports[_0x5392('0x19')]=function(_0xcd404e){var _0x27d3f7=this;return new Promise(function(_0x2c3518,_0x194ac5){return db[_0x5392('0x1a')][_0x5392('0x1b')](_0xcd404e['body'],{'raw':_0xcd404e['options']?_0xcd404e[_0x5392('0x15')][_0x5392('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcd404e[_0x5392('0x15')]?_0xcd404e[_0x5392('0x15')][_0x5392('0x1c')]||null:null,'attributes':_0xcd404e[_0x5392('0x15')]?_0xcd404e[_0x5392('0x15')]['attributes']||null:null,'limit':_0xcd404e[_0x5392('0x15')]?_0xcd404e[_0x5392('0x15')][_0x5392('0x1d')]||null:null})[_0x5392('0x8')](function(_0xa16ec1){logger[_0x5392('0x10')]('UpdateVoiceAgentReport',_0xcd404e);logger[_0x5392('0xb')](_0x5392('0x19'),_0xcd404e,JSON[_0x5392('0x17')](_0xa16ec1));_0x2c3518(_0xa16ec1);})[_0x5392('0x18')](function(_0x10032f){logger[_0x5392('0xd')](_0x5392('0x19'),_0x10032f[_0x5392('0xf')],_0xcd404e);_0x194ac5(_0x27d3f7['error'](0x1f4,_0x10032f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index c43aa17..033b9ed 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 _0x277c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x277c,0x153));var _0xc277=function(_0x32267e,_0xe0b212){_0x32267e=_0x32267e-0x0;var _0x4a0118=_0x277c[_0x32267e];return _0x4a0118;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var fs_extra=require(_0xc277('0x5'));var auth=require(_0xc277('0x6'));var interaction=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var controller=require('./voiceCallReport.controller');router['get']('/',auth[_0xc277('0x9')](),controller['index']);router[_0xc277('0xa')]('/describe',auth[_0xc277('0x9')](),controller[_0xc277('0xb')]);router['get'](_0xc277('0xc'),auth[_0xc277('0x9')](),controller[_0xc277('0xd')]);router[_0xc277('0xe')]('/',auth[_0xc277('0x9')](),controller[_0xc277('0xf')]);router['put']('/:id',auth[_0xc277('0x9')](),controller[_0xc277('0x10')]);router[_0xc277('0x11')](_0xc277('0xc'),auth['isAuthenticated'](),controller[_0xc277('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa630=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','/describe'];(function(_0xbc5f6a,_0x530d8f){var _0x14af64=function(_0x2d55ed){while(--_0x2d55ed){_0xbc5f6a['push'](_0xbc5f6a['shift']());}};_0x14af64(++_0x530d8f);}(_0xa630,0xbe));var _0x0a63=function(_0x3a784d,_0x12aa89){_0x3a784d=_0x3a784d-0x0;var _0x5721d2=_0xa630[_0x3a784d];return _0x5721d2;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')]('/',auth[_0x0a63('0x8')](),controller['index']);router[_0x0a63('0x7')](_0x0a63('0x9'),auth[_0x0a63('0x8')](),controller[_0x0a63('0xa')]);router[_0x0a63('0x7')](_0x0a63('0xb'),auth['isAuthenticated'](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')]('/',auth[_0x0a63('0x8')](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0xb'),auth[_0x0a63('0x8')](),controller[_0x0a63('0x10')]);router[_0x0a63('0x11')](_0x0a63('0xb'),auth['isAuthenticated'](),controller[_0x0a63('0x12')]);module[_0x0a63('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 1ac979e..cb3a9e6 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 _0x8eba=['outbound','inbound-fax','outbound-fax','STRING','DATE','INTEGER','sequelize','exports','internal'];(function(_0xa05d5c,_0x5cf78c){var _0x52512c=function(_0x5aed48){while(--_0x5aed48){_0xa05d5c['push'](_0xa05d5c['shift']());}};_0x52512c(++_0x5cf78c);}(_0x8eba,0xc3));var _0xa8eb=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x8eba[_0x23b655];return _0x364b32;};'use strict';var Sequelize=require(_0xa8eb('0x0'));module[_0xa8eb('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('inbound',_0xa8eb('0x2'),_0xa8eb('0x3'),_0xa8eb('0x4'),_0xa8eb('0x5'),'dialer')},'tag':{'type':Sequelize[_0xa8eb('0x6')]},'accountcode':{'type':Sequelize[_0xa8eb('0x6')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xa8eb('0x6')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa8eb('0x6')]},'channel':{'type':Sequelize[_0xa8eb('0x6')]},'destinationchannel':{'type':Sequelize[_0xa8eb('0x6')]},'lastapplication':{'type':Sequelize[_0xa8eb('0x6')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xa8eb('0x7')]},'systemanswertime':{'type':Sequelize[_0xa8eb('0x7')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa8eb('0x7')]},'duration':{'type':Sequelize[_0xa8eb('0x8')]},'billableseconds':{'type':Sequelize[_0xa8eb('0x8')]},'mohtime':{'type':Sequelize[_0xa8eb('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xa8eb('0x6')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xa8eb('0x6')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xa8eb('0x6')]},'note':{'type':Sequelize[_0xa8eb('0x6')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xa8eb('0x8')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8281=['inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','STRING','ENUM','internal','outbound'];(function(_0x101595,_0x1748af){var _0x1198ae=function(_0x443d08){while(--_0x443d08){_0x101595['push'](_0x101595['shift']());}};_0x1198ae(++_0x1748af);}(_0x8281,0x182));var _0x1828=function(_0x114af9,_0x31df82){_0x114af9=_0x114af9-0x0;var _0x249bc0=_0x8281[_0x114af9];return _0x249bc0;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x1828('0x0')]},'type':{'type':Sequelize[_0x1828('0x1')]('inbound',_0x1828('0x2'),_0x1828('0x3'),_0x1828('0x4'),_0x1828('0x5'),_0x1828('0x6'))},'tag':{'type':Sequelize[_0x1828('0x0')]},'accountcode':{'type':Sequelize[_0x1828('0x0')]},'source':{'type':Sequelize[_0x1828('0x0')]},'destination':{'type':Sequelize[_0x1828('0x0')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x1828('0x0')]},'channel':{'type':Sequelize[_0x1828('0x0')]},'destinationchannel':{'type':Sequelize[_0x1828('0x0')]},'lastapplication':{'type':Sequelize[_0x1828('0x0')]},'lastdata':{'type':Sequelize[_0x1828('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x1828('0x8')]},'answertime':{'type':Sequelize[_0x1828('0x8')]},'endtime':{'type':Sequelize[_0x1828('0x8')]},'duration':{'type':Sequelize[_0x1828('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x1828('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1828('0x0')]},'amaflags':{'type':Sequelize[_0x1828('0x0')]},'userfield':{'type':Sequelize[_0x1828('0x0')]},'userDisposition':{'type':Sequelize[_0x1828('0x0')]},'userSecondDisposition':{'type':Sequelize[_0x1828('0x0')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1828('0x0')]},'prefix':{'type':Sequelize[_0x1828('0x0')]},'routeid':{'type':Sequelize[_0x1828('0x9')]},'sipcallid':{'type':Sequelize[_0x1828('0x0')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index c7ca928..2b4c95a 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x5dad8d,_0x3336ef){var _0x50d231=function(_0x562354){while(--_0x562354){_0x5dad8d['push'](_0x5dad8d['shift']());}};_0x50d231(++_0x3336ef);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0xb10b[_0x1e6db3];return _0x1de886;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5f0bf6,_0x277825){_0x5f0bf6=_0x5f0bf6-0x0;var _0x213dcf=_0x5f2f[_0x5f0bf6];return _0x213dcf;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index ebcc165..9b50b7b 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 _0xc5d6=['../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport','report_call','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x481844,_0x259b1f){var _0x2afc17=function(_0x3404d4){while(--_0x3404d4){_0x481844['push'](_0x481844['shift']());}};_0x2afc17(++_0x259b1f);}(_0xc5d6,0x155));var _0x6c5d=function(_0xaff4d5,_0x3b5afe){_0xaff4d5=_0xaff4d5-0x0;var _0x324bff=_0xc5d6[_0xaff4d5];return _0x324bff;};'use strict';var _=require(_0x6c5d('0x0'));var util=require('util');var logger=require(_0x6c5d('0x1'))('api');var moment=require(_0x6c5d('0x2'));var BPromise=require(_0x6c5d('0x3'));var rp=require(_0x6c5d('0x4'));var fs=require('fs');var path=require(_0x6c5d('0x5'));var rimraf=require(_0x6c5d('0x6'));var config=require(_0x6c5d('0x7'));var attributes=require(_0x6c5d('0x8'));module[_0x6c5d('0x9')]=function(_0x51801d,_0x47c822){return _0x51801d['define'](_0x6c5d('0xa'),attributes,{'tableName':_0x6c5d('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc220=['../../config/logger','api','moment','path','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc220,0xfa));var _0x0c22=function(_0x277a55,_0x3ba560){_0x277a55=_0x277a55-0x0;var _0x301186=_0xc220[_0x277a55];return _0x301186;};'use strict';var _=require(_0x0c22('0x0'));var util=require(_0x0c22('0x1'));var logger=require(_0x0c22('0x2'))(_0x0c22('0x3'));var moment=require(_0x0c22('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c22('0x5'));var rimraf=require('rimraf');var config=require(_0x0c22('0x6'));var attributes=require(_0x0c22('0x7'));module[_0x0c22('0x8')]=function(_0x3588da,_0x484c1b){return _0x3588da[_0x0c22('0x9')](_0x0c22('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x0c22('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index bb2bf09..38442b7 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 _0xca72=['then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','findAll','options','raw','where','attributes','include','map','model','GetVoiceCallReport','stringify','CreateVoiceCallReport','VoiceCallReport','UpdateVoiceCallReport','update','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0xb0634d,_0x30c333){var _0x24c97d=function(_0x33f946){while(--_0x33f946){_0xb0634d['push'](_0xb0634d['shift']());}};_0x24c97d(++_0x30c333);}(_0xca72,0x1ec));var _0x2ca7=function(_0x10b48a,_0x1a0a3f){_0x10b48a=_0x10b48a-0x0;var _0x2c4533=_0xca72[_0x10b48a];return _0x2c4533;};'use strict';var _=require(_0x2ca7('0x0'));var util=require(_0x2ca7('0x1'));var moment=require(_0x2ca7('0x2'));var BPromise=require(_0x2ca7('0x3'));var rs=require(_0x2ca7('0x4'));var fs=require('fs');var Redis=require(_0x2ca7('0x5'));var db=require(_0x2ca7('0x6'))['db'];var utils=require(_0x2ca7('0x7'));var logger=require(_0x2ca7('0x8'))('rpc');var config=require(_0x2ca7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2ca7('0xa')][_0x2ca7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f3d48,_0x1d05c0,_0x43d61f){return new BPromise(function(_0x12a4df,_0x9c0672){return client['request'](_0x4f3d48,_0x43d61f)[_0x2ca7('0xc')](function(_0x41330b){logger[_0x2ca7('0xd')](_0x2ca7('0xe'),_0x1d05c0,_0x2ca7('0xf'));logger[_0x2ca7('0x10')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x1d05c0,'request\x20sent',JSON['stringify'](_0x41330b));if(_0x41330b[_0x2ca7('0x11')]){if(_0x41330b['error']['code']===0x1f4){logger[_0x2ca7('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x1d05c0,_0x41330b[_0x2ca7('0x11')][_0x2ca7('0x12')]);return _0x9c0672(_0x41330b[_0x2ca7('0x11')][_0x2ca7('0x12')]);}logger[_0x2ca7('0x11')](_0x2ca7('0xe'),_0x1d05c0,_0x41330b['error'][_0x2ca7('0x12')]);return _0x12a4df(_0x41330b[_0x2ca7('0x11')][_0x2ca7('0x12')]);}else{logger['info'](_0x2ca7('0xe'),_0x1d05c0,_0x2ca7('0xf'));_0x12a4df(_0x41330b[_0x2ca7('0x13')][_0x2ca7('0x12')]);}})[_0x2ca7('0x14')](function(_0x1e000b){logger['error'](_0x2ca7('0xe'),_0x1d05c0,_0x1e000b);_0x9c0672(_0x1e000b);});});}exports['GetVoiceCallReport']=function(_0x2f1b7a){var _0x8cb30=this;return new Promise(function(_0x35b5c0,_0x1a5843){return db['VoiceCallReport'][_0x2ca7('0x15')]({'raw':_0x2f1b7a[_0x2ca7('0x16')]?_0x2f1b7a[_0x2ca7('0x16')][_0x2ca7('0x17')]===undefined?!![]:![]:!![],'where':_0x2f1b7a[_0x2ca7('0x16')]?_0x2f1b7a['options'][_0x2ca7('0x18')]||null:null,'attributes':_0x2f1b7a['options']?_0x2f1b7a[_0x2ca7('0x16')][_0x2ca7('0x19')]||null:null,'limit':_0x2f1b7a[_0x2ca7('0x16')]?_0x2f1b7a[_0x2ca7('0x16')]['limit']||null:null,'include':_0x2f1b7a[_0x2ca7('0x16')]?_0x2f1b7a['options'][_0x2ca7('0x1a')]?_[_0x2ca7('0x1b')](_0x2f1b7a['options'][_0x2ca7('0x1a')],function(_0x487ba3){return{'model':db[_0x487ba3[_0x2ca7('0x1c')]],'as':_0x487ba3['as'],'attributes':_0x487ba3[_0x2ca7('0x19')],'include':_0x487ba3[_0x2ca7('0x1a')]?_[_0x2ca7('0x1b')](_0x487ba3[_0x2ca7('0x1a')],function(_0x46d770){return{'model':db[_0x46d770[_0x2ca7('0x1c')]],'as':_0x46d770['as'],'attributes':_0x46d770[_0x2ca7('0x19')],'include':_0x46d770[_0x2ca7('0x1a')]?_['map'](_0x46d770[_0x2ca7('0x1a')],function(_0x51378a){return{'model':db[_0x51378a[_0x2ca7('0x1c')]],'as':_0x51378a['as'],'attributes':_0x51378a[_0x2ca7('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2ca7('0xc')](function(_0x503613){logger[_0x2ca7('0xd')](_0x2ca7('0x1d'),_0x2f1b7a);logger['debug'](_0x2ca7('0x1d'),_0x2f1b7a,JSON[_0x2ca7('0x1e')](_0x503613));_0x35b5c0(_0x503613);})[_0x2ca7('0x14')](function(_0x1d51aa){logger['error'](_0x2ca7('0x1d'),_0x1d51aa[_0x2ca7('0x12')],_0x2f1b7a);_0x1a5843(_0x8cb30[_0x2ca7('0x11')](0x1f4,_0x1d51aa['message']));});});};exports[_0x2ca7('0x1f')]=function(_0x29451a){var _0x22dc91=this;return new Promise(function(_0x4b6c47,_0x314e81){return db[_0x2ca7('0x20')]['create'](_0x29451a['body'],{'raw':_0x29451a['options']?_0x29451a[_0x2ca7('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e9923){logger[_0x2ca7('0xd')](_0x2ca7('0x1f'),_0x29451a);logger[_0x2ca7('0x10')](_0x2ca7('0x1f'),_0x29451a,JSON['stringify'](_0x1e9923));_0x4b6c47(_0x1e9923);})[_0x2ca7('0x14')](function(_0x223739){logger[_0x2ca7('0x11')]('CreateVoiceCallReport',_0x223739['message'],_0x29451a);_0x314e81(_0x22dc91['error'](0x1f4,_0x223739[_0x2ca7('0x12')]));});});};exports[_0x2ca7('0x21')]=function(_0x332a3b){var _0x1e40a3=this;return new Promise(function(_0x50141e,_0x1bc2c1){return db[_0x2ca7('0x20')][_0x2ca7('0x22')](_0x332a3b['body'],{'raw':_0x332a3b['options']?_0x332a3b[_0x2ca7('0x16')][_0x2ca7('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x332a3b['options']?_0x332a3b[_0x2ca7('0x16')][_0x2ca7('0x18')]||null:null,'attributes':_0x332a3b[_0x2ca7('0x16')]?_0x332a3b[_0x2ca7('0x16')]['attributes']||null:null,'limit':_0x332a3b[_0x2ca7('0x16')]?_0x332a3b[_0x2ca7('0x16')][_0x2ca7('0x23')]||null:null})[_0x2ca7('0xc')](function(_0x59cc1b){logger[_0x2ca7('0xd')]('UpdateVoiceCallReport',_0x332a3b);logger['debug']('UpdateVoiceCallReport',_0x332a3b,JSON['stringify'](_0x59cc1b));_0x50141e(_0x59cc1b);})[_0x2ca7('0x14')](function(_0x31a1d5){logger[_0x2ca7('0x11')](_0x2ca7('0x21'),_0x31a1d5['message'],_0x332a3b);_0x1bc2c1(_0x1e40a3[_0x2ca7('0x11')](0x1f4,_0x31a1d5['message']));});});}; \ No newline at end of file +var _0x6446=['UpdateVoiceCallReport','update','where','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','limit','include','model','map','attributes','CreateVoiceCallReport','create','body'];(function(_0x2417eb,_0x3fc6b1){var _0xfb449c=function(_0x20b4e0){while(--_0x20b4e0){_0x2417eb['push'](_0x2417eb['shift']());}};_0xfb449c(++_0x3fc6b1);}(_0x6446,0x1a5));var _0x6644=function(_0x5e7692,_0x1caa40){_0x5e7692=_0x5e7692-0x0;var _0x120367=_0x6446[_0x5e7692];return _0x120367;};'use strict';var _=require(_0x6644('0x0'));var util=require(_0x6644('0x1'));var moment=require('moment');var BPromise=require(_0x6644('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6644('0x3'));var db=require(_0x6644('0x4'))['db'];var utils=require(_0x6644('0x5'));var logger=require(_0x6644('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6644('0x7'));var client=jayson[_0x6644('0x8')][_0x6644('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x505f89,_0x4b460d,_0x5c5071){return new BPromise(function(_0x7d9b8f,_0x34d669){return client[_0x6644('0xa')](_0x505f89,_0x5c5071)[_0x6644('0xb')](function(_0x2a54a1){logger[_0x6644('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x4b460d,_0x6644('0xd'));logger[_0x6644('0xe')](_0x6644('0xf'),_0x4b460d,_0x6644('0xd'),JSON[_0x6644('0x10')](_0x2a54a1));if(_0x2a54a1[_0x6644('0x11')]){if(_0x2a54a1[_0x6644('0x11')]['code']===0x1f4){logger[_0x6644('0x11')](_0x6644('0x12'),_0x4b460d,_0x2a54a1[_0x6644('0x11')]['message']);return _0x34d669(_0x2a54a1[_0x6644('0x11')]['message']);}logger[_0x6644('0x11')](_0x6644('0x12'),_0x4b460d,_0x2a54a1['error'][_0x6644('0x13')]);return _0x7d9b8f(_0x2a54a1[_0x6644('0x11')][_0x6644('0x13')]);}else{logger[_0x6644('0xc')](_0x6644('0x12'),_0x4b460d,_0x6644('0xd'));_0x7d9b8f(_0x2a54a1[_0x6644('0x14')]['message']);}})[_0x6644('0x15')](function(_0x5da33e){logger[_0x6644('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x4b460d,_0x5da33e);_0x34d669(_0x5da33e);});});}exports[_0x6644('0x16')]=function(_0x3f32e4){var _0x28ef6c=this;return new Promise(function(_0x511406,_0x477c8d){return db[_0x6644('0x17')][_0x6644('0x18')]({'raw':_0x3f32e4[_0x6644('0x19')]?_0x3f32e4[_0x6644('0x19')][_0x6644('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f32e4[_0x6644('0x19')]?_0x3f32e4[_0x6644('0x19')]['where']||null:null,'attributes':_0x3f32e4[_0x6644('0x19')]?_0x3f32e4[_0x6644('0x19')]['attributes']||null:null,'limit':_0x3f32e4[_0x6644('0x19')]?_0x3f32e4[_0x6644('0x19')][_0x6644('0x1b')]||null:null,'include':_0x3f32e4[_0x6644('0x19')]?_0x3f32e4[_0x6644('0x19')][_0x6644('0x1c')]?_['map'](_0x3f32e4[_0x6644('0x19')][_0x6644('0x1c')],function(_0x26dd3f){return{'model':db[_0x26dd3f[_0x6644('0x1d')]],'as':_0x26dd3f['as'],'attributes':_0x26dd3f['attributes'],'include':_0x26dd3f[_0x6644('0x1c')]?_[_0x6644('0x1e')](_0x26dd3f[_0x6644('0x1c')],function(_0x4b5d06){return{'model':db[_0x4b5d06['model']],'as':_0x4b5d06['as'],'attributes':_0x4b5d06[_0x6644('0x1f')],'include':_0x4b5d06[_0x6644('0x1c')]?_[_0x6644('0x1e')](_0x4b5d06[_0x6644('0x1c')],function(_0x1df84e){return{'model':db[_0x1df84e['model']],'as':_0x1df84e['as'],'attributes':_0x1df84e[_0x6644('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6644('0xb')](function(_0x321404){logger[_0x6644('0xc')](_0x6644('0x16'),_0x3f32e4);logger[_0x6644('0xe')](_0x6644('0x16'),_0x3f32e4,JSON[_0x6644('0x10')](_0x321404));_0x511406(_0x321404);})[_0x6644('0x15')](function(_0x521764){logger[_0x6644('0x11')](_0x6644('0x16'),_0x521764[_0x6644('0x13')],_0x3f32e4);_0x477c8d(_0x28ef6c[_0x6644('0x11')](0x1f4,_0x521764[_0x6644('0x13')]));});});};exports[_0x6644('0x20')]=function(_0x1b2458){var _0x39c932=this;return new Promise(function(_0x651995,_0x2539a2){return db[_0x6644('0x17')][_0x6644('0x21')](_0x1b2458[_0x6644('0x22')],{'raw':_0x1b2458[_0x6644('0x19')]?_0x1b2458[_0x6644('0x19')][_0x6644('0x1a')]===undefined?!![]:![]:!![]})[_0x6644('0xb')](function(_0x387b12){logger[_0x6644('0xc')](_0x6644('0x20'),_0x1b2458);logger[_0x6644('0xe')](_0x6644('0x20'),_0x1b2458,JSON[_0x6644('0x10')](_0x387b12));_0x651995(_0x387b12);})['catch'](function(_0x1247d8){logger[_0x6644('0x11')](_0x6644('0x20'),_0x1247d8[_0x6644('0x13')],_0x1b2458);_0x2539a2(_0x39c932['error'](0x1f4,_0x1247d8[_0x6644('0x13')]));});});};exports[_0x6644('0x23')]=function(_0x3d3f3a){var _0x19f90d=this;return new Promise(function(_0x21b49c,_0x102fdf){return db[_0x6644('0x17')][_0x6644('0x24')](_0x3d3f3a[_0x6644('0x22')],{'raw':_0x3d3f3a[_0x6644('0x19')]?_0x3d3f3a[_0x6644('0x19')][_0x6644('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d3f3a['options']?_0x3d3f3a[_0x6644('0x19')][_0x6644('0x25')]||null:null,'attributes':_0x3d3f3a[_0x6644('0x19')]?_0x3d3f3a[_0x6644('0x19')][_0x6644('0x1f')]||null:null,'limit':_0x3d3f3a[_0x6644('0x19')]?_0x3d3f3a[_0x6644('0x19')][_0x6644('0x1b')]||null:null})[_0x6644('0xb')](function(_0x4e06bc){logger['info'](_0x6644('0x23'),_0x3d3f3a);logger[_0x6644('0xe')]('UpdateVoiceCallReport',_0x3d3f3a,JSON[_0x6644('0x10')](_0x4e06bc));_0x21b49c(_0x4e06bc);})[_0x6644('0x15')](function(_0x2383b2){logger[_0x6644('0x11')](_0x6644('0x23'),_0x2383b2['message'],_0x3d3f3a);_0x102fdf(_0x19f90d[_0x6644('0x11')](0x1f4,_0x2383b2[_0x6644('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 3060162..bf21541 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 _0xfb1c=['/:id','show','post','update','delete','destroy','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated'];(function(_0xea46d,_0x254082){var _0x1fa4c5=function(_0x4d7817){while(--_0x4d7817){_0xea46d['push'](_0xea46d['shift']());}};_0x1fa4c5(++_0x254082);}(_0xfb1c,0x187));var _0xcfb1=function(_0x1ce266,_0xf99ee4){_0x1ce266=_0x1ce266-0x0;var _0x2d08a6=_0xfb1c[_0x1ce266];return _0x2d08a6;};'use strict';var multer=require(_0xcfb1('0x0'));var util=require(_0xcfb1('0x1'));var path=require(_0xcfb1('0x2'));var timeout=require('connect-timeout');var express=require(_0xcfb1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcfb1('0x4'));var config=require(_0xcfb1('0x5'));var controller=require(_0xcfb1('0x6'));router[_0xcfb1('0x7')]('/',auth[_0xcfb1('0x8')](),controller['index']);router['get'](_0xcfb1('0x9'),auth[_0xcfb1('0x8')](),controller[_0xcfb1('0xa')]);router[_0xcfb1('0xb')]('/',auth[_0xcfb1('0x8')](),controller['create']);router['put']('/:id',auth[_0xcfb1('0x8')](),controller[_0xcfb1('0xc')]);router[_0xcfb1('0xd')](_0xcfb1('0x9'),auth[_0xcfb1('0x8')](),controller[_0xcfb1('0xe')]);module[_0xcfb1('0xf')]=router; \ No newline at end of file +var _0x492b=['multer','path','express','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','/:id','show','post','create','update','destroy'];(function(_0x2ec7f2,_0xe24da3){var _0x29de00=function(_0x383338){while(--_0x383338){_0x2ec7f2['push'](_0x2ec7f2['shift']());}};_0x29de00(++_0xe24da3);}(_0x492b,0x1ea));var _0xb492=function(_0x116967,_0x302d8c){_0x116967=_0x116967-0x0;var _0x349f96=_0x492b[_0x116967];return _0x349f96;};'use strict';var multer=require(_0xb492('0x0'));var util=require('util');var path=require(_0xb492('0x1'));var timeout=require('connect-timeout');var express=require(_0xb492('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb492('0x3'));var config=require(_0xb492('0x4'));var controller=require(_0xb492('0x5'));router[_0xb492('0x6')]('/',auth[_0xb492('0x7')](),controller['index']);router['get'](_0xb492('0x8'),auth[_0xb492('0x7')](),controller[_0xb492('0x9')]);router[_0xb492('0xa')]('/',auth[_0xb492('0x7')](),controller[_0xb492('0xb')]);router['put'](_0xb492('0x8'),auth[_0xb492('0x7')](),controller[_0xb492('0xc')]);router['delete'](_0xb492('0x8'),auth[_0xb492('0x7')](),controller[_0xb492('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index c4a29ba..2b6f733 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 _0x7950=['join','getDataValue','BOOLEAN','sequelize','STRING','name','setDataValue','options'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7950,0x10b));var _0x0795=function(_0x21c478,_0x296bf6){_0x21c478=_0x21c478-0x0;var _0x36fed5=_0x7950[_0x21c478];return _0x36fed5;};'use strict';var Sequelize=require(_0x0795('0x0'));module['exports']={'name':{'type':Sequelize[_0x0795('0x1')]},'prefix':{'type':Sequelize[_0x0795('0x1')],'unique':_0x0795('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x0795('0x1')],'set':function(_0x4f2baf){this[_0x0795('0x3')](_0x0795('0x4'),_0x4f2baf?_0x4f2baf[_0x0795('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x0795('0x4'))?this[_0x0795('0x6')](_0x0795('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0x0795('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x0795('0x1')]},'record':{'type':Sequelize[_0x0795('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0795('0x1')]}}; \ No newline at end of file +var _0x5990=['join','getDataValue','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options'];(function(_0x2a9b9b,_0x14c245){var _0x5139a8=function(_0x2c72a3){while(--_0x2c72a3){_0x2a9b9b['push'](_0x2a9b9b['shift']());}};_0x5139a8(++_0x14c245);}(_0x5990,0x66));var _0x0599=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5990[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x0599('0x0'));module[_0x0599('0x1')]={'name':{'type':Sequelize[_0x0599('0x2')]},'prefix':{'type':Sequelize[_0x0599('0x2')],'unique':_0x0599('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x41b7c1){this[_0x0599('0x4')](_0x0599('0x5'),_0x41b7c1?_0x41b7c1[_0x0599('0x6')](''):[]);},'get':function(){return this[_0x0599('0x7')](_0x0599('0x5'))?this[_0x0599('0x7')](_0x0599('0x5'))['split'](''):[];}},'auth':{'type':Sequelize[_0x0599('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x0599('0x2')]},'record':{'type':Sequelize[_0x0599('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x0599('0x2')]},'description':{'type':Sequelize[_0x0599('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 6658ed4..29a7f80 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 _0x2621=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','then','ChanSpies','destroy','error','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','filters','type','includeAll','include','findAll','length','merge','options','catch','create','body','user','get','role','userProfileId','autoAssociation'];(function(_0x226bd5,_0x48e239){var _0x149b94=function(_0x50332b){while(--_0x50332b){_0x226bd5['push'](_0x226bd5['shift']());}};_0x149b94(++_0x48e239);}(_0x2621,0x1d2));var _0x1262=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2621[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1262('0x0'));var rimraf=require(_0x1262('0x1'));var zipdir=require(_0x1262('0x2'));var jsonpatch=require(_0x1262('0x3'));var rp=require(_0x1262('0x4'));var moment=require(_0x1262('0x5'));var BPromise=require(_0x1262('0x6'));var Mustache=require(_0x1262('0x7'));var util=require(_0x1262('0x8'));var path=require(_0x1262('0x9'));var sox=require(_0x1262('0xa'));var csv=require(_0x1262('0xb'));var ejs=require(_0x1262('0xc'));var fs=require('fs');var fs_extra=require(_0x1262('0xd'));var _=require('lodash');var squel=require(_0x1262('0xe'));var crypto=require('crypto');var jsforce=require(_0x1262('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1262('0xb'));var querystring=require(_0x1262('0x10'));var Papa=require(_0x1262('0x11'));var Redis=require('ioredis');var authService=require(_0x1262('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1262('0x13'));var hardwareService=require(_0x1262('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1262('0x15'));var config=require(_0x1262('0x16'));var licenseUtil=require(_0x1262('0x17'));var db=require(_0x1262('0x18'))['db'];function respondWithStatusCode(_0x2fe558,_0x278fdb){_0x278fdb=_0x278fdb||0xcc;return function(_0x4d90df){if(_0x4d90df){return _0x2fe558[_0x1262('0x19')](_0x278fdb);}return _0x2fe558[_0x1262('0x1a')](_0x278fdb)[_0x1262('0x1b')]();};}function respondWithResult(_0x566bb2,_0x36b4ee){_0x36b4ee=_0x36b4ee||0xc8;return function(_0x3a66b0){if(_0x3a66b0){return _0x566bb2['status'](_0x36b4ee)['json'](_0x3a66b0);}};}function respondWithFilteredResult(_0x2d93a2,_0x4435c7){return function(_0x5a91b7){if(_0x5a91b7){var _0x66e634=typeof _0x4435c7['offset']===_0x1262('0x1c')&&typeof _0x4435c7[_0x1262('0x1d')]===_0x1262('0x1c');var _0x3ebd19=_0x5a91b7[_0x1262('0x1e')];var _0x347901=_0x66e634?0x0:_0x4435c7[_0x1262('0x1f')];var _0x548764=_0x66e634?_0x5a91b7['count']:_0x4435c7['offset']+_0x4435c7[_0x1262('0x1d')];var _0x5b25e4;if(_0x548764>=_0x3ebd19){_0x548764=_0x3ebd19;_0x5b25e4=0xc8;}else{_0x5b25e4=0xce;}_0x2d93a2['status'](_0x5b25e4);return _0x2d93a2['set'](_0x1262('0x20'),_0x347901+'-'+_0x548764+'/'+_0x3ebd19)[_0x1262('0x21')](_0x5a91b7);}return null;};}function patchUpdates(_0x51010a){return function(_0x2e7e16){try{jsonpatch[_0x1262('0x22')](_0x2e7e16,_0x51010a,!![]);}catch(_0x3120fb){return BPromise['reject'](_0x3120fb);}return _0x2e7e16['save']();};}function saveUpdates(_0x2162c1,_0x5b3e00){return function(_0x4db04d){if(_0x4db04d){return _0x4db04d['update'](_0x2162c1)[_0x1262('0x23')](function(_0x58cf78){return _0x58cf78;});}return null;};}function removeEntity(_0x5a8279,_0x2aa124){return function(_0x386b91){if(_0x386b91){return _0x386b91['destroy']()['then'](function(){var _0x3c4a9e=_0x386b91['get']({'plain':!![]});var _0x4e8b70=_0x1262('0x24');return db['UserProfileResource'][_0x1262('0x25')]({'where':{'type':_0x4e8b70,'resourceId':_0x3c4a9e['id']}})[_0x1262('0x23')](function(){return _0x386b91;});})[_0x1262('0x23')](function(){_0x5a8279[_0x1262('0x1a')](0xcc)[_0x1262('0x1b')]();});}};}function handleEntityNotFound(_0x3b6533,_0x3044f6){return function(_0x1229da){if(!_0x1229da){_0x3b6533[_0x1262('0x19')](0x194);}return _0x1229da;};}function handleError(_0x144086,_0x2ffd00){_0x2ffd00=_0x2ffd00||0x1f4;return function(_0x10034a){logger[_0x1262('0x26')](_0x10034a[_0x1262('0x27')]);if(_0x10034a[_0x1262('0x28')]){delete _0x10034a['name'];}_0x144086[_0x1262('0x1a')](_0x2ffd00)[_0x1262('0x29')](_0x10034a);};}exports['index']=function(_0x28d936,_0x53c596){var _0x17f972={},_0x214491={},_0x37e5a0={'count':0x0,'rows':[]};var _0x2fe4ba=_[_0x1262('0x2a')](db[_0x1262('0x2b')][_0x1262('0x2c')],function(_0x331bc7){return{'name':_0x331bc7[_0x1262('0x2d')],'type':_0x331bc7['type'][_0x1262('0x2e')]};});_0x214491[_0x1262('0x2f')]=_['map'](_0x2fe4ba,_0x1262('0x28'));_0x214491[_0x1262('0x30')]=_[_0x1262('0x31')](_0x28d936[_0x1262('0x30')]);_0x214491['filters']=_[_0x1262('0x32')](_0x214491[_0x1262('0x2f')],_0x214491[_0x1262('0x30')]);_0x17f972['attributes']=_[_0x1262('0x32')](_0x214491['model'],qs['fields'](_0x28d936['query'][_0x1262('0x33')]));_0x17f972[_0x1262('0x34')]=_0x17f972[_0x1262('0x34')]['length']?_0x17f972['attributes']:_0x214491[_0x1262('0x2f')];if(!_0x28d936[_0x1262('0x30')][_0x1262('0x35')](_0x1262('0x36'))){_0x17f972[_0x1262('0x1d')]=qs[_0x1262('0x1d')](_0x28d936[_0x1262('0x30')][_0x1262('0x1d')]);_0x17f972['offset']=qs['offset'](_0x28d936[_0x1262('0x30')][_0x1262('0x1f')]);}_0x17f972[_0x1262('0x37')]=qs['sort'](_0x28d936[_0x1262('0x30')]['sort']);_0x17f972[_0x1262('0x38')]=qs['filters'](_['pick'](_0x28d936['query'],_0x214491[_0x1262('0x39')]),_0x2fe4ba);if(_0x28d936[_0x1262('0x30')]['filter']){_0x17f972[_0x1262('0x38')]=_['merge'](_0x17f972[_0x1262('0x38')],{'$or':_[_0x1262('0x2a')](_0x2fe4ba,function(_0x49bcc2){if(_0x49bcc2[_0x1262('0x3a')]!=='VIRTUAL'){var _0x13cd38={};_0x13cd38[_0x49bcc2[_0x1262('0x28')]]={'$like':'%'+_0x28d936[_0x1262('0x30')]['filter']+'%'};return _0x13cd38;}})});}_0x17f972=_['merge']({},_0x17f972,_0x28d936['options']);var _0x205a98={'where':_0x17f972[_0x1262('0x38')]};return db[_0x1262('0x2b')][_0x1262('0x1e')](_0x205a98)[_0x1262('0x23')](function(_0x3aed24){_0x37e5a0[_0x1262('0x1e')]=_0x3aed24;if(_0x28d936[_0x1262('0x30')][_0x1262('0x3b')]){_0x17f972[_0x1262('0x3c')]=[{'all':!![]}];}return db[_0x1262('0x2b')][_0x1262('0x3d')](_0x17f972);})[_0x1262('0x23')](function(_0x541e56){_0x37e5a0['rows']=_0x541e56;return _0x37e5a0;})['then'](respondWithFilteredResult(_0x53c596,_0x17f972))['catch'](handleError(_0x53c596,null));};exports['show']=function(_0x5a784b,_0x240aa3){var _0x2da92a={'raw':![],'where':{'id':_0x5a784b['params']['id']}},_0x48a3b9={};_0x48a3b9[_0x1262('0x2f')]=_[_0x1262('0x31')](db[_0x1262('0x2b')]['rawAttributes']);_0x48a3b9[_0x1262('0x30')]=_[_0x1262('0x31')](_0x5a784b[_0x1262('0x30')]);_0x48a3b9[_0x1262('0x39')]=_[_0x1262('0x32')](_0x48a3b9[_0x1262('0x2f')],_0x48a3b9[_0x1262('0x30')]);_0x2da92a['attributes']=_[_0x1262('0x32')](_0x48a3b9[_0x1262('0x2f')],qs[_0x1262('0x33')](_0x5a784b[_0x1262('0x30')][_0x1262('0x33')]));_0x2da92a[_0x1262('0x34')]=_0x2da92a[_0x1262('0x34')][_0x1262('0x3e')]?_0x2da92a[_0x1262('0x34')]:_0x48a3b9['model'];if(_0x5a784b[_0x1262('0x30')][_0x1262('0x3b')]){_0x2da92a[_0x1262('0x3c')]=[{'all':!![]}];}_0x2da92a=_[_0x1262('0x3f')]({},_0x2da92a,_0x5a784b[_0x1262('0x40')]);return db[_0x1262('0x2b')]['find'](_0x2da92a)['then'](handleEntityNotFound(_0x240aa3,null))['then'](respondWithResult(_0x240aa3,null))[_0x1262('0x41')](handleError(_0x240aa3,null));};exports[_0x1262('0x42')]=function(_0x27269b,_0x61deec){return db[_0x1262('0x2b')][_0x1262('0x42')](_0x27269b[_0x1262('0x43')],{})[_0x1262('0x23')](function(_0x7d5ca0){var _0x57fbec=_0x27269b[_0x1262('0x44')][_0x1262('0x45')]({'plain':!![]});if(!_0x57fbec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57fbec[_0x1262('0x46')]===_0x1262('0x44')){var _0x46fd55=_0x7d5ca0[_0x1262('0x45')]({'plain':!![]});var _0xa819c6=_0x1262('0x24');return db['UserProfileSection']['find']({'where':{'name':_0xa819c6,'userProfileId':_0x57fbec[_0x1262('0x47')]},'raw':!![]})['then'](function(_0x2b19b2){if(_0x2b19b2&&_0x2b19b2[_0x1262('0x48')]===0x0){return db['UserProfileResource'][_0x1262('0x42')]({'name':_0x46fd55[_0x1262('0x28')],'resourceId':_0x46fd55['id'],'type':_0x2b19b2[_0x1262('0x28')],'sectionId':_0x2b19b2['id']},{})[_0x1262('0x23')](function(){return _0x7d5ca0;});}else{return _0x7d5ca0;}})[_0x1262('0x41')](function(_0x166cd0){logger[_0x1262('0x26')](_0x1262('0x49'),_0x166cd0);throw _0x166cd0;});}return _0x7d5ca0;})[_0x1262('0x23')](respondWithResult(_0x61deec,0xc9))[_0x1262('0x41')](handleError(_0x61deec,null));};exports[_0x1262('0x4a')]=function(_0x871365,_0x18c338){if(_0x871365[_0x1262('0x43')]['id']){delete _0x871365[_0x1262('0x43')]['id'];}return db['VoiceChanSpy'][_0x1262('0x4b')]({'where':{'id':_0x871365['params']['id']}})['then'](handleEntityNotFound(_0x18c338,null))[_0x1262('0x23')](saveUpdates(_0x871365[_0x1262('0x43')],null))[_0x1262('0x23')](respondWithResult(_0x18c338,null))[_0x1262('0x41')](handleError(_0x18c338,null));};exports['destroy']=function(_0x5a2cc4,_0x1599ab){return db[_0x1262('0x2b')][_0x1262('0x4b')]({'where':{'id':_0x5a2cc4[_0x1262('0x4c')]['id']}})[_0x1262('0x23')](handleEntityNotFound(_0x1599ab,null))['then'](removeEntity(_0x1599ab,null))[_0x1262('0x41')](handleError(_0x1599ab,null));}; \ No newline at end of file +var _0xbc9d=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','then','get','UserProfileResource','stack','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','name','options','include','VoiceChanSpy','findAll','rows','params','fields','includeAll','find'];(function(_0x272b4c,_0x40f5d0){var _0x2bfe47=function(_0x421572){while(--_0x421572){_0x272b4c['push'](_0x272b4c['shift']());}};_0x2bfe47(++_0x40f5d0);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x3513fc,_0x46f835){_0x3513fc=_0x3513fc-0x0;var _0x4168f7=_0xbc9d[_0x3513fc];return _0x4168f7;};'use strict';var emlformat=require(_0xdbc9('0x0'));var rimraf=require(_0xdbc9('0x1'));var zipdir=require(_0xdbc9('0x2'));var jsonpatch=require(_0xdbc9('0x3'));var rp=require(_0xdbc9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdbc9('0x5'));var path=require(_0xdbc9('0x6'));var sox=require(_0xdbc9('0x7'));var csv=require(_0xdbc9('0x8'));var ejs=require(_0xdbc9('0x9'));var fs=require('fs');var fs_extra=require(_0xdbc9('0xa'));var _=require(_0xdbc9('0xb'));var squel=require('squel');var crypto=require(_0xdbc9('0xc'));var jsforce=require(_0xdbc9('0xd'));var deskjs=require(_0xdbc9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbc9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbc9('0x10'));var qs=require(_0xdbc9('0x11'));var as=require(_0xdbc9('0x12'));var hardwareService=require(_0xdbc9('0x13'));var logger=require('../../config/logger')(_0xdbc9('0x14'));var utils=require(_0xdbc9('0x15'));var config=require(_0xdbc9('0x16'));var licenseUtil=require(_0xdbc9('0x17'));var db=require(_0xdbc9('0x18'))['db'];function respondWithStatusCode(_0x103d54,_0x48bc83){_0x48bc83=_0x48bc83||0xcc;return function(_0x567e71){if(_0x567e71){return _0x103d54[_0xdbc9('0x19')](_0x48bc83);}return _0x103d54[_0xdbc9('0x1a')](_0x48bc83)[_0xdbc9('0x1b')]();};}function respondWithResult(_0x436e50,_0x53495d){_0x53495d=_0x53495d||0xc8;return function(_0x4a9dcb){if(_0x4a9dcb){return _0x436e50[_0xdbc9('0x1a')](_0x53495d)[_0xdbc9('0x1c')](_0x4a9dcb);}};}function respondWithFilteredResult(_0x3a8a7b,_0x4c7b4f){return function(_0x1b4616){if(_0x1b4616){var _0x1abee8=typeof _0x4c7b4f['offset']===_0xdbc9('0x1d')&&typeof _0x4c7b4f[_0xdbc9('0x1e')]===_0xdbc9('0x1d');var _0x14e655=_0x1b4616[_0xdbc9('0x1f')];var _0x33f1bd=_0x1abee8?0x0:_0x4c7b4f[_0xdbc9('0x20')];var _0xc2ddd2=_0x1abee8?_0x1b4616[_0xdbc9('0x1f')]:_0x4c7b4f[_0xdbc9('0x20')]+_0x4c7b4f['limit'];var _0x1ca5fd;if(_0xc2ddd2>=_0x14e655){_0xc2ddd2=_0x14e655;_0x1ca5fd=0xc8;}else{_0x1ca5fd=0xce;}_0x3a8a7b['status'](_0x1ca5fd);return _0x3a8a7b[_0xdbc9('0x21')](_0xdbc9('0x22'),_0x33f1bd+'-'+_0xc2ddd2+'/'+_0x14e655)['json'](_0x1b4616);}return null;};}function patchUpdates(_0x4408e9){return function(_0x5367dc){try{jsonpatch['apply'](_0x5367dc,_0x4408e9,!![]);}catch(_0x4ab00d){return BPromise['reject'](_0x4ab00d);}return _0x5367dc[_0xdbc9('0x23')]();};}function saveUpdates(_0x2011a2,_0x570ad9){return function(_0x16dcf7){if(_0x16dcf7){return _0x16dcf7[_0xdbc9('0x24')](_0x2011a2)['then'](function(_0x1bc073){return _0x1bc073;});}return null;};}function removeEntity(_0x6b788,_0x1b1c0d){return function(_0x119230){if(_0x119230){return _0x119230[_0xdbc9('0x25')]()[_0xdbc9('0x26')](function(){var _0x32822f=_0x119230[_0xdbc9('0x27')]({'plain':!![]});var _0x3c8c1d='ChanSpies';return db[_0xdbc9('0x28')][_0xdbc9('0x25')]({'where':{'type':_0x3c8c1d,'resourceId':_0x32822f['id']}})[_0xdbc9('0x26')](function(){return _0x119230;});})[_0xdbc9('0x26')](function(){_0x6b788[_0xdbc9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf121e9,_0x2ee00a){return function(_0x5300bd){if(!_0x5300bd){_0xf121e9['sendStatus'](0x194);}return _0x5300bd;};}function handleError(_0x45aebe,_0x278db2){_0x278db2=_0x278db2||0x1f4;return function(_0x473430){logger['error'](_0x473430[_0xdbc9('0x29')]);if(_0x473430['name']){delete _0x473430['name'];}_0x45aebe[_0xdbc9('0x1a')](_0x278db2)['send'](_0x473430);};}exports['index']=function(_0x417b17,_0x20eb4f){var _0x1cb557={},_0x4db824={},_0x35eaf8={'count':0x0,'rows':[]};var _0x22f8aa=_['map'](db['VoiceChanSpy'][_0xdbc9('0x2a')],function(_0x245496){return{'name':_0x245496[_0xdbc9('0x2b')],'type':_0x245496[_0xdbc9('0x2c')][_0xdbc9('0x2d')]};});_0x4db824[_0xdbc9('0x2e')]=_[_0xdbc9('0x2f')](_0x22f8aa,'name');_0x4db824[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x417b17[_0xdbc9('0x30')]);_0x4db824[_0xdbc9('0x32')]=_[_0xdbc9('0x33')](_0x4db824[_0xdbc9('0x2e')],_0x4db824['query']);_0x1cb557[_0xdbc9('0x34')]=_['intersection'](_0x4db824['model'],qs['fields'](_0x417b17['query']['fields']));_0x1cb557[_0xdbc9('0x34')]=_0x1cb557[_0xdbc9('0x34')][_0xdbc9('0x35')]?_0x1cb557['attributes']:_0x4db824[_0xdbc9('0x2e')];if(!_0x417b17[_0xdbc9('0x30')][_0xdbc9('0x36')](_0xdbc9('0x37'))){_0x1cb557[_0xdbc9('0x1e')]=qs[_0xdbc9('0x1e')](_0x417b17['query'][_0xdbc9('0x1e')]);_0x1cb557[_0xdbc9('0x20')]=qs[_0xdbc9('0x20')](_0x417b17['query'][_0xdbc9('0x20')]);}_0x1cb557[_0xdbc9('0x38')]=qs[_0xdbc9('0x39')](_0x417b17[_0xdbc9('0x30')]['sort']);_0x1cb557['where']=qs[_0xdbc9('0x32')](_[_0xdbc9('0x3a')](_0x417b17[_0xdbc9('0x30')],_0x4db824[_0xdbc9('0x32')]),_0x22f8aa);if(_0x417b17['query'][_0xdbc9('0x3b')]){_0x1cb557[_0xdbc9('0x3c')]=_[_0xdbc9('0x3d')](_0x1cb557['where'],{'$or':_[_0xdbc9('0x2f')](_0x22f8aa,function(_0x38a2a7){if(_0x38a2a7[_0xdbc9('0x2c')]!=='VIRTUAL'){var _0xa11bc8={};_0xa11bc8[_0x38a2a7[_0xdbc9('0x3e')]]={'$like':'%'+_0x417b17['query']['filter']+'%'};return _0xa11bc8;}})});}_0x1cb557=_[_0xdbc9('0x3d')]({},_0x1cb557,_0x417b17[_0xdbc9('0x3f')]);var _0x387b57={'where':_0x1cb557[_0xdbc9('0x3c')]};return db['VoiceChanSpy'][_0xdbc9('0x1f')](_0x387b57)[_0xdbc9('0x26')](function(_0x577725){_0x35eaf8[_0xdbc9('0x1f')]=_0x577725;if(_0x417b17[_0xdbc9('0x30')]['includeAll']){_0x1cb557[_0xdbc9('0x40')]=[{'all':!![]}];}return db[_0xdbc9('0x41')][_0xdbc9('0x42')](_0x1cb557);})[_0xdbc9('0x26')](function(_0x3ed4de){_0x35eaf8[_0xdbc9('0x43')]=_0x3ed4de;return _0x35eaf8;})[_0xdbc9('0x26')](respondWithFilteredResult(_0x20eb4f,_0x1cb557))['catch'](handleError(_0x20eb4f,null));};exports['show']=function(_0x768856,_0x3b8437){var _0xc77676={'raw':![],'where':{'id':_0x768856[_0xdbc9('0x44')]['id']}},_0x41f56a={};_0x41f56a[_0xdbc9('0x2e')]=_[_0xdbc9('0x31')](db[_0xdbc9('0x41')][_0xdbc9('0x2a')]);_0x41f56a[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x768856['query']);_0x41f56a['filters']=_[_0xdbc9('0x33')](_0x41f56a[_0xdbc9('0x2e')],_0x41f56a[_0xdbc9('0x30')]);_0xc77676[_0xdbc9('0x34')]=_[_0xdbc9('0x33')](_0x41f56a[_0xdbc9('0x2e')],qs[_0xdbc9('0x45')](_0x768856[_0xdbc9('0x30')]['fields']));_0xc77676['attributes']=_0xc77676[_0xdbc9('0x34')][_0xdbc9('0x35')]?_0xc77676[_0xdbc9('0x34')]:_0x41f56a[_0xdbc9('0x2e')];if(_0x768856[_0xdbc9('0x30')][_0xdbc9('0x46')]){_0xc77676[_0xdbc9('0x40')]=[{'all':!![]}];}_0xc77676=_[_0xdbc9('0x3d')]({},_0xc77676,_0x768856[_0xdbc9('0x3f')]);return db['VoiceChanSpy'][_0xdbc9('0x47')](_0xc77676)[_0xdbc9('0x26')](handleEntityNotFound(_0x3b8437,null))['then'](respondWithResult(_0x3b8437,null))['catch'](handleError(_0x3b8437,null));};exports[_0xdbc9('0x48')]=function(_0xc3db3c,_0x133a13){return db['VoiceChanSpy'][_0xdbc9('0x48')](_0xc3db3c[_0xdbc9('0x49')],{})[_0xdbc9('0x26')](function(_0x274607){var _0x5aee83=_0xc3db3c[_0xdbc9('0x4a')][_0xdbc9('0x27')]({'plain':!![]});if(!_0x5aee83)throw new Error(_0xdbc9('0x4b'));if(_0x5aee83[_0xdbc9('0x4c')]==='user'){var _0x3e89f5=_0x274607[_0xdbc9('0x27')]({'plain':!![]});var _0x3f49b7=_0xdbc9('0x4d');return db[_0xdbc9('0x4e')][_0xdbc9('0x47')]({'where':{'name':_0x3f49b7,'userProfileId':_0x5aee83[_0xdbc9('0x4f')]},'raw':!![]})[_0xdbc9('0x26')](function(_0x4b34dd){if(_0x4b34dd&&_0x4b34dd[_0xdbc9('0x50')]===0x0){return db['UserProfileResource'][_0xdbc9('0x48')]({'name':_0x3e89f5[_0xdbc9('0x3e')],'resourceId':_0x3e89f5['id'],'type':_0x4b34dd['name'],'sectionId':_0x4b34dd['id']},{})['then'](function(){return _0x274607;});}else{return _0x274607;}})[_0xdbc9('0x51')](function(_0x4b55df){logger[_0xdbc9('0x52')](_0xdbc9('0x53'),_0x4b55df);throw _0x4b55df;});}return _0x274607;})[_0xdbc9('0x26')](respondWithResult(_0x133a13,0xc9))['catch'](handleError(_0x133a13,null));};exports[_0xdbc9('0x24')]=function(_0x1c52e6,_0x3d8b01){if(_0x1c52e6[_0xdbc9('0x49')]['id']){delete _0x1c52e6[_0xdbc9('0x49')]['id'];}return db[_0xdbc9('0x41')][_0xdbc9('0x47')]({'where':{'id':_0x1c52e6[_0xdbc9('0x44')]['id']}})['then'](handleEntityNotFound(_0x3d8b01,null))['then'](saveUpdates(_0x1c52e6['body'],null))[_0xdbc9('0x26')](respondWithResult(_0x3d8b01,null))[_0xdbc9('0x51')](handleError(_0x3d8b01,null));};exports[_0xdbc9('0x25')]=function(_0x55d8ba,_0x519ac9){return db[_0xdbc9('0x41')][_0xdbc9('0x47')]({'where':{'id':_0x55d8ba['params']['id']}})['then'](handleEntityNotFound(_0x519ac9,null))[_0xdbc9('0x26')](removeEntity(_0x519ac9,null))[_0xdbc9('0x51')](handleError(_0x519ac9,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 20c3f36..a38feaf 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 _0x6e16=['format','prefix','push','merge','Set','record','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','length','concat','internal','findAll','then','catch','models','define','voice_chanspy','bulkCreate','VoiceExtension','lodash','util','bluebird','context','from-sip'];(function(_0x5a97b8,_0x5a7945){var _0x54b165=function(_0x3cc5ca){while(--_0x3cc5ca){_0x5a97b8['push'](_0x5a97b8['shift']());}};_0x54b165(++_0x5a7945);}(_0x6e16,0x91));var _0x66e1=function(_0x282b26,_0x236b7b){_0x282b26=_0x282b26-0x0;var _0x355e51=_0x6e16[_0x282b26];return _0x355e51;};'use strict';var _=require(_0x66e1('0x0'));var util=require(_0x66e1('0x1'));var BPromise=require(_0x66e1('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x5b81f9,_0x33ae92,_0x5275bc){var _0x250695=0x1;var _0x5ac59b=[];var _0x568079={'context':_0x33ae92[_0x66e1('0x3')]||_0x66e1('0x4'),'exten':util[_0x66e1('0x5')]('%s%s',_0x5b81f9[_0x66e1('0x6')],_0x5275bc),'type':'system','isApp':![],'ChanSpyId':_0x5b81f9['id'],'UserId':_0x33ae92['id']};_0x5ac59b[_0x66e1('0x7')](_[_0x66e1('0x8')]({'app':_0x66e1('0x9'),'appdata':util[_0x66e1('0x5')]('CDR(type)=%s','chanspy'),'priority':_0x250695++},_0x568079));if(_0x5b81f9[_0x66e1('0xa')]){_0x5ac59b[_0x66e1('0x7')](_[_0x66e1('0x8')]({'app':'MixMonitor','appdata':util[_0x66e1('0x5')]('${UNIQUEID}.%s,a',_0x5b81f9[_0x66e1('0xb')]),'priority':_0x250695++},_0x568079));}if(_0x5b81f9[_0x66e1('0xc')]){_0x5ac59b[_0x66e1('0x7')](_[_0x66e1('0x8')]({'app':_0x66e1('0xd'),'appdata':_0x5b81f9['password'],'priority':_0x250695++},_0x568079));}_0x5ac59b[_0x66e1('0x7')](_['merge']({'app':_0x66e1('0xe'),'appdata':util[_0x66e1('0x5')](_0x66e1('0xf'),_0x33ae92[_0x66e1('0x10')],_0x5b81f9[_0x66e1('0x11')]?_0x5b81f9['options'][_0x66e1('0x12')](''):''),'priority':_0x250695++},_0x568079));if(_0x5b81f9[_0x66e1('0xa')]){_0x5ac59b[_0x66e1('0x7')](_[_0x66e1('0x8')]({'app':'StopMixMonitor','priority':_0x250695++},_0x568079));}return _0x5ac59b;};var getChanSpyApplications=function(_0x49f298,_0x425cc2){var _0x2aa16d=[];for(var _0x3f89c1=0x0,_0x108304=0x1;_0x3f89c1<_0x425cc2[_0x66e1('0x13')];_0x3f89c1++,_0x108304=0x1){_0x2aa16d=_0x2aa16d[_0x66e1('0x14')](getUserApplications(_0x49f298,_0x425cc2[_0x3f89c1],_0x425cc2[_0x3f89c1][_0x66e1('0x15')]));if(_0x425cc2[_0x3f89c1]['internal']!=_0x425cc2[_0x3f89c1]['name']){_0x2aa16d=_0x2aa16d[_0x66e1('0x14')](getUserApplications(_0x49f298,_0x425cc2[_0x3f89c1],_0x425cc2[_0x3f89c1][_0x66e1('0x10')]));}}return _0x2aa16d;};var getChanSpyPromise=function(_0x350614,_0x42c73e){return new BPromise(function(_0x493f2a,_0x43a393){return _0x350614['User'][_0x66e1('0x16')]({'attributes':['id',_0x66e1('0x10'),'internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x66e1('0x17')](function(_0xb0d8fa){if(_0xb0d8fa){return _0x493f2a(getChanSpyApplications(_0x42c73e,_0xb0d8fa));}return _0x493f2a([]);})[_0x66e1('0x18')](function(_0x407d03){_0x43a393(_0x407d03);});});};module['exports']=function(_0x5d4b37,_0x9ca831){var _0xcc0652=_0x5d4b37[_0x66e1('0x19')];return _0x5d4b37[_0x66e1('0x1a')]('VoiceChanSpy',attributes,{'tableName':_0x66e1('0x1b'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x585ac6,_0x60aba0,_0x4c75c8){return getChanSpyPromise(_0xcc0652,_0x585ac6)[_0x66e1('0x17')](function(_0x284665){if(_0x284665&&_0x284665['length']){return _0xcc0652['VoiceExtension'][_0x66e1('0x1c')](_0x284665);}})[_0x66e1('0x17')](function(){_0x4c75c8();})[_0x66e1('0x18')](function(_0x4dbe10){_0x4c75c8(_0x4dbe10);});},'afterUpdate':function(_0x3b9207,_0x57e20e,_0x1a5b13){return _0xcc0652[_0x66e1('0x1d')]['destroy']({'where':{'ChanSpyId':_0x3b9207['id']}})[_0x66e1('0x17')](function(){return getChanSpyPromise(_0xcc0652,_0x3b9207);})[_0x66e1('0x17')](function(_0x405392){if(_0x405392&&_0x405392['length']){return _0xcc0652[_0x66e1('0x1d')]['bulkCreate'](_0x405392);}})[_0x66e1('0x17')](function(){_0x1a5b13();})['catch'](function(_0x475d6f){_0x1a5b13(_0x475d6f);});},'afterDestroy':function(_0x5f164d,_0x4b2759,_0x20d039){return _0xcc0652['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x5f164d['id']}})[_0x66e1('0x17')](function(){_0x20d039();})[_0x66e1('0x18')](function(_0x476673){_0x20d039(_0x476673);});}}});}; \ No newline at end of file +var _0xaf65=['internal','agent','then','exports','models','define','VoiceChanSpy','length','VoiceExtension','catch','destroy','bulkCreate','lodash','bluebird','context','from-sip','prefix','system','merge','Set','format','CDR(type)=%s','record','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','concat','User','findAll'];(function(_0x5d1817,_0x4847cc){var _0x14cf81=function(_0x4c0fb7){while(--_0x4c0fb7){_0x5d1817['push'](_0x5d1817['shift']());}};_0x14cf81(++_0x4847cc);}(_0xaf65,0x188));var _0x5af6=function(_0x3aa864,_0x4e96c7){_0x3aa864=_0x3aa864-0x0;var _0x452f4c=_0xaf65[_0x3aa864];return _0x452f4c;};'use strict';var _=require(_0x5af6('0x0'));var util=require('util');var BPromise=require(_0x5af6('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x33ad30,_0x1ce177,_0x55bcc8){var _0x171fcf=0x1;var _0x419c6b=[];var _0x40c024={'context':_0x1ce177[_0x5af6('0x2')]||_0x5af6('0x3'),'exten':util['format']('%s%s',_0x33ad30[_0x5af6('0x4')],_0x55bcc8),'type':_0x5af6('0x5'),'isApp':![],'ChanSpyId':_0x33ad30['id'],'UserId':_0x1ce177['id']};_0x419c6b['push'](_[_0x5af6('0x6')]({'app':_0x5af6('0x7'),'appdata':util[_0x5af6('0x8')](_0x5af6('0x9'),'chanspy'),'priority':_0x171fcf++},_0x40c024));if(_0x33ad30[_0x5af6('0xa')]){_0x419c6b[_0x5af6('0xb')](_[_0x5af6('0x6')]({'app':_0x5af6('0xc'),'appdata':util['format'](_0x5af6('0xd'),_0x33ad30[_0x5af6('0xe')]),'priority':_0x171fcf++},_0x40c024));}if(_0x33ad30[_0x5af6('0xf')]){_0x419c6b[_0x5af6('0xb')](_['merge']({'app':_0x5af6('0x10'),'appdata':_0x33ad30['password'],'priority':_0x171fcf++},_0x40c024));}_0x419c6b[_0x5af6('0xb')](_[_0x5af6('0x6')]({'app':_0x5af6('0x11'),'appdata':util[_0x5af6('0x8')](_0x5af6('0x12'),_0x1ce177[_0x5af6('0x13')],_0x33ad30[_0x5af6('0x14')]?_0x33ad30[_0x5af6('0x14')][_0x5af6('0x15')](''):''),'priority':_0x171fcf++},_0x40c024));if(_0x33ad30[_0x5af6('0xa')]){_0x419c6b['push'](_[_0x5af6('0x6')]({'app':_0x5af6('0x16'),'priority':_0x171fcf++},_0x40c024));}return _0x419c6b;};var getChanSpyApplications=function(_0x3a9df6,_0x5d9783){var _0x22d8ae=[];for(var _0x1c3847=0x0,_0x4184a3=0x1;_0x1c3847<_0x5d9783['length'];_0x1c3847++,_0x4184a3=0x1){_0x22d8ae=_0x22d8ae[_0x5af6('0x17')](getUserApplications(_0x3a9df6,_0x5d9783[_0x1c3847],_0x5d9783[_0x1c3847]['internal']));if(_0x5d9783[_0x1c3847]['internal']!=_0x5d9783[_0x1c3847][_0x5af6('0x13')]){_0x22d8ae=_0x22d8ae[_0x5af6('0x17')](getUserApplications(_0x3a9df6,_0x5d9783[_0x1c3847],_0x5d9783[_0x1c3847][_0x5af6('0x13')]));}}return _0x22d8ae;};var getChanSpyPromise=function(_0x457907,_0x1e2faf){return new BPromise(function(_0x4e3df2,_0x11bc7e){return _0x457907[_0x5af6('0x18')][_0x5af6('0x19')]({'attributes':['id','name',_0x5af6('0x1a')],'where':{'role':_0x5af6('0x1b'),'chanspy':!![]},'raw':!![]})[_0x5af6('0x1c')](function(_0x37b27f){if(_0x37b27f){return _0x4e3df2(getChanSpyApplications(_0x1e2faf,_0x37b27f));}return _0x4e3df2([]);})['catch'](function(_0x24c2e4){_0x11bc7e(_0x24c2e4);});});};module[_0x5af6('0x1d')]=function(_0x24045f,_0x4935b8){var _0x13d181=_0x24045f[_0x5af6('0x1e')];return _0x24045f[_0x5af6('0x1f')](_0x5af6('0x20'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x30c84c,_0x2e1cb6,_0x32043d){return getChanSpyPromise(_0x13d181,_0x30c84c)[_0x5af6('0x1c')](function(_0x560718){if(_0x560718&&_0x560718[_0x5af6('0x21')]){return _0x13d181[_0x5af6('0x22')]['bulkCreate'](_0x560718);}})['then'](function(){_0x32043d();})[_0x5af6('0x23')](function(_0x393b5c){_0x32043d(_0x393b5c);});},'afterUpdate':function(_0xbdbd93,_0x52051a,_0x22e6f6){return _0x13d181[_0x5af6('0x22')][_0x5af6('0x24')]({'where':{'ChanSpyId':_0xbdbd93['id']}})['then'](function(){return getChanSpyPromise(_0x13d181,_0xbdbd93);})[_0x5af6('0x1c')](function(_0x171a6a){if(_0x171a6a&&_0x171a6a[_0x5af6('0x21')]){return _0x13d181['VoiceExtension'][_0x5af6('0x25')](_0x171a6a);}})[_0x5af6('0x1c')](function(){_0x22e6f6();})[_0x5af6('0x23')](function(_0x5bb72a){_0x22e6f6(_0x5bb72a);});},'afterDestroy':function(_0x54abb8,_0x523d93,_0x41714c){return _0x13d181[_0x5af6('0x22')]['destroy']({'where':{'ChanSpyId':_0x54abb8['id']}})[_0x5af6('0x1c')](function(){_0x41714c();})[_0x5af6('0x23')](function(_0x3ae1fa){_0x41714c(_0x3ae1fa);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 9c4e71d..f022db0 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 _0x702d=['stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x2de123,_0xc380d0){var _0x2256d3=function(_0x5703e2){while(--_0x5703e2){_0x2de123['push'](_0x2de123['shift']());}};_0x2256d3(++_0xc380d0);}(_0x702d,0x147));var _0xd702=function(_0x5e3208,_0x2159a6){_0x5e3208=_0x5e3208-0x0;var _0x143b77=_0x702d[_0x5e3208];return _0x143b77;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var moment=require(_0xd702('0x2'));var BPromise=require(_0xd702('0x3'));var rs=require(_0xd702('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd702('0x5'))['db'];var utils=require(_0xd702('0x6'));var logger=require(_0xd702('0x7'))(_0xd702('0x8'));var config=require('../../config/environment');var jayson=require(_0xd702('0x9'));var client=jayson['client'][_0xd702('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a2c03,_0xf4bf4f,_0x5af246){return new BPromise(function(_0x12bb75,_0x53bd02){return client[_0xd702('0xb')](_0x3a2c03,_0x5af246)[_0xd702('0xc')](function(_0x907a9f){logger[_0xd702('0xd')](_0xd702('0xe'),_0xf4bf4f,_0xd702('0xf'));logger[_0xd702('0x10')](_0xd702('0x11'),_0xf4bf4f,_0xd702('0xf'),JSON[_0xd702('0x12')](_0x907a9f));if(_0x907a9f['error']){if(_0x907a9f['error'][_0xd702('0x13')]===0x1f4){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f['error'][_0xd702('0x15')]);return _0x53bd02(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f[_0xd702('0x14')]['message']);return _0x12bb75(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}else{logger['info'](_0xd702('0xe'),_0xf4bf4f,'request\x20sent');_0x12bb75(_0x907a9f[_0xd702('0x16')][_0xd702('0x15')]);}})['catch'](function(_0x2ba791){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x2ba791);_0x53bd02(_0x2ba791);});});} \ No newline at end of file +var _0xa74f=['result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x2e6dee,_0x1a61b0){var _0x47706=function(_0x365546){while(--_0x365546){_0x2e6dee['push'](_0x2e6dee['shift']());}};_0x47706(++_0x1a61b0);}(_0xa74f,0x9a));var _0xfa74=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0xa74f[_0x2eb3db];return _0x358f33;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x9ddbd2,_0x3ac32e,_0x2d9fa9){return new BPromise(function(_0x287921,_0x344e04){return client['request'](_0x9ddbd2,_0x2d9fa9)[_0xfa74('0x7')](function(_0x37d4d8){logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,'request\x20sent');logger[_0xfa74('0xa')](_0xfa74('0xb'),_0x3ac32e,'request\x20sent',JSON[_0xfa74('0xc')](_0x37d4d8));if(_0x37d4d8[_0xfa74('0xd')]){if(_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xe')]===0x1f4){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x344e04(_0x37d4d8[_0xfa74('0xd')]['message']);}logger[_0xfa74('0xd')](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x287921(_0x37d4d8[_0xfa74('0xd')]['message']);}else{logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,_0xfa74('0x10'));_0x287921(_0x37d4d8[_0xfa74('0x11')][_0xfa74('0xf')]);}})[_0xfa74('0x12')](function(_0x3b9e32){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x3b9e32);_0x344e04(_0x3b9e32);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 5fc5aba..d6632b8 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 _0xb619=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','create','put','update','delete'];(function(_0x1446ae,_0xe1e05d){var _0xd5d15e=function(_0x262196){while(--_0x262196){_0x1446ae['push'](_0x1446ae['shift']());}};_0xd5d15e(++_0xe1e05d);}(_0xb619,0x1dd));var _0x9b61=function(_0x21c53e,_0x434410){_0x21c53e=_0x21c53e-0x0;var _0x26ccff=_0xb619[_0x21c53e];return _0x26ccff;};'use strict';var multer=require(_0x9b61('0x0'));var util=require(_0x9b61('0x1'));var path=require(_0x9b61('0x2'));var timeout=require(_0x9b61('0x3'));var express=require(_0x9b61('0x4'));var router=express[_0x9b61('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9b61('0x6'));var config=require(_0x9b61('0x7'));var controller=require('./voiceContext.controller');router['get']('/',auth[_0x9b61('0x8')](),controller[_0x9b61('0x9')]);router[_0x9b61('0xa')](_0x9b61('0xb'),auth[_0x9b61('0x8')](),controller[_0x9b61('0xc')]);router['post']('/',auth[_0x9b61('0x8')](),controller[_0x9b61('0xd')]);router[_0x9b61('0xe')]('/:id',auth[_0x9b61('0x8')](),controller[_0x9b61('0xf')]);router[_0x9b61('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9b61('0x11')]);module[_0x9b61('0x12')]=router; \ No newline at end of file +var _0x49fb=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy'];(function(_0x193fd7,_0x11aad5){var _0x1b9cd2=function(_0x3a26d6){while(--_0x3a26d6){_0x193fd7['push'](_0x193fd7['shift']());}};_0x1b9cd2(++_0x11aad5);}(_0x49fb,0x17d));var _0xb49f=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x49fb[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xb49f('0x0'));var util=require(_0xb49f('0x1'));var path=require(_0xb49f('0x2'));var timeout=require(_0xb49f('0x3'));var express=require(_0xb49f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb49f('0x5'));var interaction=require(_0xb49f('0x6'));var config=require('../../config/environment');var controller=require(_0xb49f('0x7'));router[_0xb49f('0x8')]('/',auth[_0xb49f('0x9')](),controller[_0xb49f('0xa')]);router[_0xb49f('0x8')](_0xb49f('0xb'),auth[_0xb49f('0x9')](),controller[_0xb49f('0xc')]);router[_0xb49f('0xd')]('/',auth[_0xb49f('0x9')](),controller[_0xb49f('0xe')]);router[_0xb49f('0xf')](_0xb49f('0xb'),auth[_0xb49f('0x9')](),controller[_0xb49f('0x10')]);router[_0xb49f('0x11')](_0xb49f('0xb'),auth[_0xb49f('0x9')](),controller[_0xb49f('0x12')]);module[_0xb49f('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 3f58024..d836f3e 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 _0xc01d=['name','BOOLEAN','exports','STRING'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xc01d,0x1d2));var _0xdc01=function(_0x54bd5a,_0x5a3a87){_0x54bd5a=_0x54bd5a-0x0;var _0x268668=_0xc01d[_0x54bd5a];return _0x268668;};'use strict';var Sequelize=require('sequelize');module[_0xdc01('0x0')]={'name':{'type':Sequelize[_0xdc01('0x1')],'unique':_0xdc01('0x2')},'description':{'type':Sequelize[_0xdc01('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xdc01('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x97ab=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x97ab,0x99));var _0xb97a=function(_0x3d2f1e,_0x2ec05b){_0x3d2f1e=_0x3d2f1e-0x0;var _0xf07f62=_0x97ab[_0x3d2f1e];return _0xf07f62;};'use strict';var Sequelize=require(_0xb97a('0x0'));module[_0xb97a('0x1')]={'name':{'type':Sequelize[_0xb97a('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xb97a('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xb97a('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 79da5dd..f62f946 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 _0x6b05=['findAll','rows','catch','include','options','create','body','join','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','writeFileSync','params','readFileSync','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','VIRTUAL','includeAll'];(function(_0x54f01f,_0x36d4e5){var _0x428c78=function(_0x3d1d0d){while(--_0x3d1d0d){_0x54f01f['push'](_0x54f01f['shift']());}};_0x428c78(++_0x36d4e5);}(_0x6b05,0x199));var _0x56b0=function(_0x5b31fc,_0x4831b0){_0x5b31fc=_0x5b31fc-0x0;var _0x3a692a=_0x6b05[_0x5b31fc];return _0x3a692a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x56b0('0x0'));var zipdir=require(_0x56b0('0x1'));var jsonpatch=require(_0x56b0('0x2'));var rp=require(_0x56b0('0x3'));var moment=require('moment');var BPromise=require(_0x56b0('0x4'));var Mustache=require(_0x56b0('0x5'));var util=require('util');var path=require(_0x56b0('0x6'));var sox=require('sox');var csv=require(_0x56b0('0x7'));var ejs=require(_0x56b0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x56b0('0x9'));var squel=require(_0x56b0('0xa'));var crypto=require('crypto');var jsforce=require(_0x56b0('0xb'));var deskjs=require(_0x56b0('0xc'));var toCsv=require(_0x56b0('0x7'));var querystring=require(_0x56b0('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x56b0('0xe'));var qs=require(_0x56b0('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x56b0('0x10'));var logger=require(_0x56b0('0x11'))(_0x56b0('0x12'));var utils=require('../../config/utils');var config=require(_0x56b0('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x56b0('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x56b0('0x15')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56fb2b,_0x490791,_0x33b95d,_0x225184){return new BPromise(function(_0x3adb31,_0x49d4f1){var _0x27904a=_0x225184||client;return _0x27904a[_0x56b0('0x16')](_0x56fb2b,_0x33b95d)[_0x56b0('0x17')](function(_0x236d00){logger[_0x56b0('0x18')](_0x56b0('0x19'),_0x490791,_0x56b0('0x1a'));logger[_0x56b0('0x1b')](_0x56b0('0x1c'),_0x490791,_0x56b0('0x1a'),JSON[_0x56b0('0x1d')](_0x236d00));if(_0x236d00[_0x56b0('0x1e')]){if(_0x236d00['error'][_0x56b0('0x1f')]===0x1f4){logger['error'](_0x56b0('0x19'),_0x490791,_0x236d00['error'][_0x56b0('0x20')]);return _0x49d4f1(_0x236d00[_0x56b0('0x1e')][_0x56b0('0x20')]);}logger[_0x56b0('0x1e')](_0x56b0('0x19'),_0x490791,_0x236d00[_0x56b0('0x1e')]['message']);return _0x3adb31(_0x236d00[_0x56b0('0x1e')][_0x56b0('0x20')]);}else{logger[_0x56b0('0x18')](_0x56b0('0x19'),_0x490791,_0x56b0('0x1a'));_0x3adb31(_0x236d00[_0x56b0('0x21')][_0x56b0('0x20')]);}})['catch'](function(_0x20e485){logger[_0x56b0('0x1e')](_0x56b0('0x19'),_0x490791,_0x20e485);_0x49d4f1(_0x20e485);});});}function respondWithStatusCode(_0xdb1c91,_0x301ce8){_0x301ce8=_0x301ce8||0xcc;return function(_0x474e9e){if(_0x474e9e){return _0xdb1c91[_0x56b0('0x22')](_0x301ce8);}return _0xdb1c91[_0x56b0('0x23')](_0x301ce8)[_0x56b0('0x24')]();};}function respondWithResult(_0x46bbb7,_0x44034b){_0x44034b=_0x44034b||0xc8;return function(_0x30aba3){if(_0x30aba3){return _0x46bbb7['status'](_0x44034b)[_0x56b0('0x25')](_0x30aba3);}};}function respondWithFilteredResult(_0x77a158,_0x5487b3){return function(_0x263e87){if(_0x263e87){var _0x174277=typeof _0x5487b3[_0x56b0('0x26')]===_0x56b0('0x27')&&typeof _0x5487b3['limit']==='undefined';var _0x4143a9=_0x263e87[_0x56b0('0x28')];var _0x157da8=_0x174277?0x0:_0x5487b3[_0x56b0('0x26')];var _0x259709=_0x174277?_0x263e87[_0x56b0('0x28')]:_0x5487b3['offset']+_0x5487b3[_0x56b0('0x29')];var _0x1a26f2;if(_0x259709>=_0x4143a9){_0x259709=_0x4143a9;_0x1a26f2=0xc8;}else{_0x1a26f2=0xce;}_0x77a158[_0x56b0('0x23')](_0x1a26f2);return _0x77a158['set'](_0x56b0('0x2a'),_0x157da8+'-'+_0x259709+'/'+_0x4143a9)[_0x56b0('0x25')](_0x263e87);}return null;};}function patchUpdates(_0x2252ce){return function(_0x285cda){try{jsonpatch['apply'](_0x285cda,_0x2252ce,!![]);}catch(_0x2cddf2){return BPromise['reject'](_0x2cddf2);}return _0x285cda['save']();};}function saveUpdates(_0x3b5d98,_0x756f74){return function(_0x4c6059){if(_0x4c6059){return _0x4c6059[_0x56b0('0x2b')](_0x3b5d98)[_0x56b0('0x17')](function(_0x1abae7){return _0x1abae7;});}return null;};}function removeEntity(_0x28f2a0,_0x22911b){return function(_0x501b9f){if(_0x501b9f){return _0x501b9f[_0x56b0('0x2c')]()[_0x56b0('0x17')](function(){var _0x462322=_0x501b9f[_0x56b0('0x2d')]({'plain':!![]});var _0x3f2744=_0x56b0('0x2e');return db[_0x56b0('0x2f')]['destroy']({'where':{'type':_0x3f2744,'resourceId':_0x462322['id']}})['then'](function(){return _0x501b9f;});})[_0x56b0('0x17')](function(){_0x28f2a0['status'](0xcc)[_0x56b0('0x24')]();});}};}function handleEntityNotFound(_0x1fae15,_0x3914e2){return function(_0x12d613){if(!_0x12d613){_0x1fae15[_0x56b0('0x22')](0x194);}return _0x12d613;};}function handleError(_0x5e54fb,_0x2631c1){_0x2631c1=_0x2631c1||0x1f4;return function(_0x2bd29f){logger[_0x56b0('0x1e')](_0x2bd29f[_0x56b0('0x30')]);if(_0x2bd29f['name']){delete _0x2bd29f[_0x56b0('0x31')];}_0x5e54fb['status'](_0x2631c1)[_0x56b0('0x32')](_0x2bd29f);};}exports[_0x56b0('0x33')]=function(_0x1b0db0,_0x2e49dd){var _0x57f1ab={},_0x4c245c={},_0x56e32d={'count':0x0,'rows':[]};var _0x581df7=_[_0x56b0('0x34')](db[_0x56b0('0x35')]['rawAttributes'],function(_0x44964b){return{'name':_0x44964b[_0x56b0('0x36')],'type':_0x44964b[_0x56b0('0x37')][_0x56b0('0x38')]};});_0x4c245c[_0x56b0('0x39')]=_[_0x56b0('0x34')](_0x581df7,_0x56b0('0x31'));_0x4c245c['query']=_[_0x56b0('0x3a')](_0x1b0db0[_0x56b0('0x3b')]);_0x4c245c['filters']=_[_0x56b0('0x3c')](_0x4c245c[_0x56b0('0x39')],_0x4c245c[_0x56b0('0x3b')]);_0x57f1ab[_0x56b0('0x3d')]=_[_0x56b0('0x3c')](_0x4c245c['model'],qs[_0x56b0('0x3e')](_0x1b0db0[_0x56b0('0x3b')]['fields']));_0x57f1ab['attributes']=_0x57f1ab[_0x56b0('0x3d')][_0x56b0('0x3f')]?_0x57f1ab[_0x56b0('0x3d')]:_0x4c245c[_0x56b0('0x39')];if(!_0x1b0db0['query'][_0x56b0('0x40')]('nolimit')){_0x57f1ab[_0x56b0('0x29')]=qs[_0x56b0('0x29')](_0x1b0db0[_0x56b0('0x3b')][_0x56b0('0x29')]);_0x57f1ab[_0x56b0('0x26')]=qs['offset'](_0x1b0db0[_0x56b0('0x3b')]['offset']);}_0x57f1ab['order']=qs[_0x56b0('0x41')](_0x1b0db0[_0x56b0('0x3b')][_0x56b0('0x41')]);_0x57f1ab[_0x56b0('0x42')]=qs[_0x56b0('0x43')](_[_0x56b0('0x44')](_0x1b0db0['query'],_0x4c245c[_0x56b0('0x43')]),_0x581df7);if(_0x1b0db0[_0x56b0('0x3b')]['filter']){_0x57f1ab[_0x56b0('0x42')]=_['merge'](_0x57f1ab[_0x56b0('0x42')],{'$or':_[_0x56b0('0x34')](_0x581df7,function(_0x39123d){if(_0x39123d['type']!==_0x56b0('0x45')){var _0x12fab4={};_0x12fab4[_0x39123d['name']]={'$like':'%'+_0x1b0db0[_0x56b0('0x3b')]['filter']+'%'};return _0x12fab4;}})});}_0x57f1ab=_['merge']({},_0x57f1ab,_0x1b0db0['options']);var _0x54273a={'where':_0x57f1ab[_0x56b0('0x42')]};return db[_0x56b0('0x35')][_0x56b0('0x28')](_0x54273a)[_0x56b0('0x17')](function(_0x5e134b){_0x56e32d[_0x56b0('0x28')]=_0x5e134b;if(_0x1b0db0['query'][_0x56b0('0x46')]){_0x57f1ab['include']=[{'all':!![]}];}return db[_0x56b0('0x35')][_0x56b0('0x47')](_0x57f1ab);})[_0x56b0('0x17')](function(_0x59819a){_0x56e32d[_0x56b0('0x48')]=_0x59819a;return _0x56e32d;})['then'](respondWithFilteredResult(_0x2e49dd,_0x57f1ab))[_0x56b0('0x49')](handleError(_0x2e49dd,null));};exports['show']=function(_0x1ff49d,_0x41b6cb){var _0x108403={'raw':![],'where':{'id':_0x1ff49d['params']['id']}},_0x31a901={};_0x31a901[_0x56b0('0x39')]=_[_0x56b0('0x3a')](db[_0x56b0('0x35')]['rawAttributes']);_0x31a901['query']=_['keys'](_0x1ff49d[_0x56b0('0x3b')]);_0x31a901[_0x56b0('0x43')]=_[_0x56b0('0x3c')](_0x31a901[_0x56b0('0x39')],_0x31a901[_0x56b0('0x3b')]);_0x108403[_0x56b0('0x3d')]=_[_0x56b0('0x3c')](_0x31a901[_0x56b0('0x39')],qs[_0x56b0('0x3e')](_0x1ff49d['query'][_0x56b0('0x3e')]));_0x108403[_0x56b0('0x3d')]=_0x108403[_0x56b0('0x3d')][_0x56b0('0x3f')]?_0x108403[_0x56b0('0x3d')]:_0x31a901['model'];if(_0x1ff49d['query'][_0x56b0('0x46')]){_0x108403[_0x56b0('0x4a')]=[{'all':!![]}];}_0x108403=_['merge']({},_0x108403,_0x1ff49d[_0x56b0('0x4b')]);return db[_0x56b0('0x35')]['find'](_0x108403)[_0x56b0('0x17')](handleEntityNotFound(_0x41b6cb,null))[_0x56b0('0x17')](respondWithResult(_0x41b6cb,null))[_0x56b0('0x49')](handleError(_0x41b6cb,null));};exports[_0x56b0('0x4c')]=function(_0xf17d02,_0x4b3be5,_0xdaf978){var _0x1dedf0;return db[_0x56b0('0x35')][_0x56b0('0x4c')](_0xf17d02[_0x56b0('0x4d')],{'raw':!![]})['then'](function(_0x4ea46a){_0x1dedf0=_0x4ea46a;return db['VoiceContext'][_0x56b0('0x47')]({'raw':!![]});})[_0x56b0('0x17')](function(_0x3b9b2e){var _0xd3f5f7=fs['readFileSync'](path[_0x56b0('0x4e')](config[_0x56b0('0x4f')],_0x56b0('0x50')),_0x56b0('0x51'));var _0x5dfd63=ejs[_0x56b0('0x52')](_0xd3f5f7,{'contexts':_0x3b9b2e||[]});fs['writeFileSync'](_0x56b0('0x53'),_0x5dfd63);})[_0x56b0('0x17')](function(){return respondWithRpcPromise(_0x56b0('0x54'),_0x56b0('0x4c'),{'module':_0x56b0('0x55')});})[_0x56b0('0x17')](function(){var _0x51d797=_0xf17d02[_0x56b0('0x56')][_0x56b0('0x2d')]({'plain':!![]});if(!_0x51d797)throw new Error(_0x56b0('0x57'));if(_0x51d797['role']===_0x56b0('0x56')){var _0x14e376=_0x1dedf0[_0x56b0('0x2d')]({'plain':!![]});return db[_0x56b0('0x58')]['find']({'where':{'name':_0x56b0('0x2e'),'userProfileId':_0x51d797[_0x56b0('0x59')]},'raw':!![]})[_0x56b0('0x17')](function(_0x31d1ab){if(_0x31d1ab&&_0x31d1ab[_0x56b0('0x5a')]===0x0){return db['UserProfileResource']['create']({'name':_0x14e376[_0x56b0('0x31')],'resourceId':_0x14e376['id'],'type':_0x31d1ab['name'],'sectionId':_0x31d1ab['id']},{})[_0x56b0('0x17')](function(){return _0x1dedf0;});}else{return _0x1dedf0;}})[_0x56b0('0x49')](function(_0x3d8932){logger[_0x56b0('0x1e')](_0x56b0('0x5b'),_0x3d8932);throw _0x3d8932;});}return _0x1dedf0;})[_0x56b0('0x17')](respondWithResult(_0x4b3be5,0xc9))['catch'](handleError(_0x4b3be5,null));};exports[_0x56b0('0x2b')]=function(_0x248fa8,_0x39337a,_0x1ccc63){var _0x3ba478;return db[_0x56b0('0x35')][_0x56b0('0x5c')]({'where':{'id':_0x248fa8['params']['id']}})[_0x56b0('0x17')](handleEntityNotFound(_0x39337a,null))['then'](saveUpdates(_0x248fa8[_0x56b0('0x4d')],null))[_0x56b0('0x17')](function(_0x49d67b){if(_0x49d67b){_0x3ba478=_0x49d67b;return db[_0x56b0('0x35')][_0x56b0('0x47')]({'raw':!![]});}})['then'](function(_0x1f6214){var _0x25f677=fs['readFileSync'](path[_0x56b0('0x4e')](config[_0x56b0('0x4f')],_0x56b0('0x50')),'utf8');var _0x81482f=ejs[_0x56b0('0x52')](_0x25f677,{'contexts':_0x1f6214||[]});fs[_0x56b0('0x5d')](_0x56b0('0x53'),_0x81482f);})[_0x56b0('0x17')](function(){return respondWithRpcPromise('Reload',_0x56b0('0x2b'),{'module':'chan_sip.so'});})[_0x56b0('0x17')](function(){return _0x3ba478;})[_0x56b0('0x17')](respondWithResult(_0x39337a,null))[_0x56b0('0x49')](handleError(_0x39337a,null));};exports[_0x56b0('0x2c')]=function(_0x32e65f,_0x48b829,_0x5935f2){var _0x1639cd;return db['VoiceContext']['find']({'where':{'id':_0x32e65f[_0x56b0('0x5e')]['id']}})['then'](handleEntityNotFound(_0x48b829,null))[_0x56b0('0x17')](removeEntity(_0x48b829,null))[_0x56b0('0x17')](function(){return db['VoiceContext'][_0x56b0('0x47')]({'raw':!![]});})[_0x56b0('0x17')](function(_0x507c87){var _0x265d46=fs[_0x56b0('0x5f')](path[_0x56b0('0x4e')](config[_0x56b0('0x4f')],_0x56b0('0x50')),_0x56b0('0x51'));var _0x1a13bc=ejs[_0x56b0('0x52')](_0x265d46,{'contexts':_0x507c87});fs[_0x56b0('0x5d')](_0x56b0('0x53'),_0x1a13bc);return respondWithRpcPromise(_0x56b0('0x54'),'destroy',{'module':_0x56b0('0x55')});})['catch'](handleError(_0x48b829,null));}; \ No newline at end of file +var _0x9dea=['client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','destroy','get','Contexts','stack','name','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','options','VoiceContext','includeAll','findAll','rows','show','params','include','find','create','body','join','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','writeFileSync','readFileSync','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise'];(function(_0x20008a,_0x362490){var _0x5d0f1c=function(_0x122ecf){while(--_0x122ecf){_0x20008a['push'](_0x20008a['shift']());}};_0x5d0f1c(++_0x362490);}(_0x9dea,0x1d5));var _0xa9de=function(_0x50caf3,_0x177887){_0x50caf3=_0x50caf3-0x0;var _0x43fa75=_0x9dea[_0x50caf3];return _0x43fa75;};'use strict';var emlformat=require(_0xa9de('0x0'));var rimraf=require(_0xa9de('0x1'));var zipdir=require(_0xa9de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa9de('0x3'));var BPromise=require(_0xa9de('0x4'));var Mustache=require(_0xa9de('0x5'));var util=require(_0xa9de('0x6'));var path=require(_0xa9de('0x7'));var sox=require(_0xa9de('0x8'));var csv=require(_0xa9de('0x9'));var ejs=require(_0xa9de('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa9de('0xb'));var squel=require('squel');var crypto=require(_0xa9de('0xc'));var jsforce=require(_0xa9de('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa9de('0x9'));var querystring=require(_0xa9de('0xe'));var Papa=require(_0xa9de('0xf'));var Redis=require('ioredis');var authService=require(_0xa9de('0x10'));var qs=require(_0xa9de('0x11'));var as=require(_0xa9de('0x12'));var hardwareService=require(_0xa9de('0x13'));var logger=require(_0xa9de('0x14'))(_0xa9de('0x15'));var utils=require(_0xa9de('0x16'));var config=require(_0xa9de('0x17'));var licenseUtil=require(_0xa9de('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa9de('0x19'));var client=jayson[_0xa9de('0x1a')][_0xa9de('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2d594e,_0x58a8a0,_0x1b86dc,_0x25db42){return new BPromise(function(_0x4f1c22,_0x4cee61){var _0xb294bb=_0x25db42||client;return _0xb294bb['request'](_0x2d594e,_0x1b86dc)[_0xa9de('0x1c')](function(_0xcddfac){logger[_0xa9de('0x1d')](_0xa9de('0x1e'),_0x58a8a0,_0xa9de('0x1f'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x58a8a0,'request\x20sent',JSON[_0xa9de('0x20')](_0xcddfac));if(_0xcddfac[_0xa9de('0x21')]){if(_0xcddfac[_0xa9de('0x21')][_0xa9de('0x22')]===0x1f4){logger[_0xa9de('0x21')](_0xa9de('0x1e'),_0x58a8a0,_0xcddfac['error'][_0xa9de('0x23')]);return _0x4cee61(_0xcddfac[_0xa9de('0x21')]['message']);}logger[_0xa9de('0x21')](_0xa9de('0x1e'),_0x58a8a0,_0xcddfac[_0xa9de('0x21')][_0xa9de('0x23')]);return _0x4f1c22(_0xcddfac['error'][_0xa9de('0x23')]);}else{logger[_0xa9de('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x58a8a0,_0xa9de('0x1f'));_0x4f1c22(_0xcddfac['result'][_0xa9de('0x23')]);}})[_0xa9de('0x24')](function(_0x4ed9cf){logger[_0xa9de('0x21')]('VoiceContext,\x20%s,\x20%s',_0x58a8a0,_0x4ed9cf);_0x4cee61(_0x4ed9cf);});});}function respondWithStatusCode(_0x31f41b,_0x409b07){_0x409b07=_0x409b07||0xcc;return function(_0x40b3fd){if(_0x40b3fd){return _0x31f41b[_0xa9de('0x25')](_0x409b07);}return _0x31f41b[_0xa9de('0x26')](_0x409b07)[_0xa9de('0x27')]();};}function respondWithResult(_0x1e6d17,_0x3278b6){_0x3278b6=_0x3278b6||0xc8;return function(_0x96844b){if(_0x96844b){return _0x1e6d17[_0xa9de('0x26')](_0x3278b6)[_0xa9de('0x28')](_0x96844b);}};}function respondWithFilteredResult(_0x410cd5,_0x30ed0e){return function(_0x310dfd){if(_0x310dfd){var _0x45ad52=typeof _0x30ed0e[_0xa9de('0x29')]===_0xa9de('0x2a')&&typeof _0x30ed0e[_0xa9de('0x2b')]===_0xa9de('0x2a');var _0x580839=_0x310dfd[_0xa9de('0x2c')];var _0x2c17c1=_0x45ad52?0x0:_0x30ed0e[_0xa9de('0x29')];var _0x1ead15=_0x45ad52?_0x310dfd['count']:_0x30ed0e['offset']+_0x30ed0e[_0xa9de('0x2b')];var _0x19a090;if(_0x1ead15>=_0x580839){_0x1ead15=_0x580839;_0x19a090=0xc8;}else{_0x19a090=0xce;}_0x410cd5[_0xa9de('0x26')](_0x19a090);return _0x410cd5[_0xa9de('0x2d')]('Content-Range',_0x2c17c1+'-'+_0x1ead15+'/'+_0x580839)['json'](_0x310dfd);}return null;};}function patchUpdates(_0x3a343){return function(_0x5772b4){try{jsonpatch['apply'](_0x5772b4,_0x3a343,!![]);}catch(_0x717392){return BPromise['reject'](_0x717392);}return _0x5772b4[_0xa9de('0x2e')]();};}function saveUpdates(_0x192751,_0x20a91b){return function(_0xb729af){if(_0xb729af){return _0xb729af[_0xa9de('0x2f')](_0x192751)[_0xa9de('0x1c')](function(_0x55e482){return _0x55e482;});}return null;};}function removeEntity(_0x401935,_0x5b51f3){return function(_0x36df2a){if(_0x36df2a){return _0x36df2a[_0xa9de('0x30')]()[_0xa9de('0x1c')](function(){var _0x1b2b84=_0x36df2a[_0xa9de('0x31')]({'plain':!![]});var _0x35fc50=_0xa9de('0x32');return db['UserProfileResource'][_0xa9de('0x30')]({'where':{'type':_0x35fc50,'resourceId':_0x1b2b84['id']}})['then'](function(){return _0x36df2a;});})[_0xa9de('0x1c')](function(){_0x401935[_0xa9de('0x26')](0xcc)[_0xa9de('0x27')]();});}};}function handleEntityNotFound(_0x52c186,_0x33e7f3){return function(_0x28161c){if(!_0x28161c){_0x52c186[_0xa9de('0x25')](0x194);}return _0x28161c;};}function handleError(_0x45622b,_0x12c386){_0x12c386=_0x12c386||0x1f4;return function(_0x5c77d1){logger[_0xa9de('0x21')](_0x5c77d1[_0xa9de('0x33')]);if(_0x5c77d1[_0xa9de('0x34')]){delete _0x5c77d1[_0xa9de('0x34')];}_0x45622b[_0xa9de('0x26')](_0x12c386)['send'](_0x5c77d1);};}exports[_0xa9de('0x35')]=function(_0x554bf5,_0x147a29){var _0x2f8a58={},_0x224a21={},_0xc306b8={'count':0x0,'rows':[]};var _0x3e2cd3=_[_0xa9de('0x36')](db['VoiceContext'][_0xa9de('0x37')],function(_0x2840ed){return{'name':_0x2840ed['fieldName'],'type':_0x2840ed[_0xa9de('0x38')][_0xa9de('0x39')]};});_0x224a21['model']=_[_0xa9de('0x36')](_0x3e2cd3,'name');_0x224a21[_0xa9de('0x3a')]=_[_0xa9de('0x3b')](_0x554bf5[_0xa9de('0x3a')]);_0x224a21[_0xa9de('0x3c')]=_[_0xa9de('0x3d')](_0x224a21['model'],_0x224a21[_0xa9de('0x3a')]);_0x2f8a58['attributes']=_[_0xa9de('0x3d')](_0x224a21[_0xa9de('0x3e')],qs[_0xa9de('0x3f')](_0x554bf5[_0xa9de('0x3a')][_0xa9de('0x3f')]));_0x2f8a58[_0xa9de('0x40')]=_0x2f8a58[_0xa9de('0x40')][_0xa9de('0x41')]?_0x2f8a58[_0xa9de('0x40')]:_0x224a21[_0xa9de('0x3e')];if(!_0x554bf5['query'][_0xa9de('0x42')](_0xa9de('0x43'))){_0x2f8a58[_0xa9de('0x2b')]=qs[_0xa9de('0x2b')](_0x554bf5[_0xa9de('0x3a')][_0xa9de('0x2b')]);_0x2f8a58['offset']=qs[_0xa9de('0x29')](_0x554bf5['query']['offset']);}_0x2f8a58[_0xa9de('0x44')]=qs['sort'](_0x554bf5[_0xa9de('0x3a')]['sort']);_0x2f8a58[_0xa9de('0x45')]=qs[_0xa9de('0x3c')](_['pick'](_0x554bf5[_0xa9de('0x3a')],_0x224a21[_0xa9de('0x3c')]),_0x3e2cd3);if(_0x554bf5[_0xa9de('0x3a')][_0xa9de('0x46')]){_0x2f8a58['where']=_[_0xa9de('0x47')](_0x2f8a58[_0xa9de('0x45')],{'$or':_[_0xa9de('0x36')](_0x3e2cd3,function(_0x235f68){if(_0x235f68['type']!=='VIRTUAL'){var _0x45f831={};_0x45f831[_0x235f68[_0xa9de('0x34')]]={'$like':'%'+_0x554bf5[_0xa9de('0x3a')][_0xa9de('0x46')]+'%'};return _0x45f831;}})});}_0x2f8a58=_[_0xa9de('0x47')]({},_0x2f8a58,_0x554bf5[_0xa9de('0x48')]);var _0x535ffe={'where':_0x2f8a58[_0xa9de('0x45')]};return db[_0xa9de('0x49')][_0xa9de('0x2c')](_0x535ffe)['then'](function(_0xd949fc){_0xc306b8[_0xa9de('0x2c')]=_0xd949fc;if(_0x554bf5[_0xa9de('0x3a')][_0xa9de('0x4a')]){_0x2f8a58['include']=[{'all':!![]}];}return db[_0xa9de('0x49')][_0xa9de('0x4b')](_0x2f8a58);})[_0xa9de('0x1c')](function(_0x277479){_0xc306b8[_0xa9de('0x4c')]=_0x277479;return _0xc306b8;})['then'](respondWithFilteredResult(_0x147a29,_0x2f8a58))[_0xa9de('0x24')](handleError(_0x147a29,null));};exports[_0xa9de('0x4d')]=function(_0x44f290,_0x1f2bc5){var _0x23097d={'raw':![],'where':{'id':_0x44f290[_0xa9de('0x4e')]['id']}},_0x1cae4c={};_0x1cae4c[_0xa9de('0x3e')]=_[_0xa9de('0x3b')](db[_0xa9de('0x49')][_0xa9de('0x37')]);_0x1cae4c[_0xa9de('0x3a')]=_[_0xa9de('0x3b')](_0x44f290[_0xa9de('0x3a')]);_0x1cae4c[_0xa9de('0x3c')]=_[_0xa9de('0x3d')](_0x1cae4c[_0xa9de('0x3e')],_0x1cae4c['query']);_0x23097d['attributes']=_[_0xa9de('0x3d')](_0x1cae4c[_0xa9de('0x3e')],qs['fields'](_0x44f290[_0xa9de('0x3a')][_0xa9de('0x3f')]));_0x23097d[_0xa9de('0x40')]=_0x23097d['attributes'][_0xa9de('0x41')]?_0x23097d[_0xa9de('0x40')]:_0x1cae4c[_0xa9de('0x3e')];if(_0x44f290[_0xa9de('0x3a')][_0xa9de('0x4a')]){_0x23097d[_0xa9de('0x4f')]=[{'all':!![]}];}_0x23097d=_[_0xa9de('0x47')]({},_0x23097d,_0x44f290[_0xa9de('0x48')]);return db[_0xa9de('0x49')][_0xa9de('0x50')](_0x23097d)[_0xa9de('0x1c')](handleEntityNotFound(_0x1f2bc5,null))[_0xa9de('0x1c')](respondWithResult(_0x1f2bc5,null))['catch'](handleError(_0x1f2bc5,null));};exports[_0xa9de('0x51')]=function(_0x3fcd37,_0x156e5a,_0x543ed4){var _0x57ecfb;return db[_0xa9de('0x49')][_0xa9de('0x51')](_0x3fcd37[_0xa9de('0x52')],{'raw':!![]})[_0xa9de('0x1c')](function(_0x4202a2){_0x57ecfb=_0x4202a2;return db['VoiceContext']['findAll']({'raw':!![]});})[_0xa9de('0x1c')](function(_0x28fd66){var _0x15d1f7=fs['readFileSync'](path[_0xa9de('0x53')](config['root'],_0xa9de('0x54')),_0xa9de('0x55'));var _0x2d5854=ejs[_0xa9de('0x56')](_0x15d1f7,{'contexts':_0x28fd66||[]});fs['writeFileSync'](_0xa9de('0x57'),_0x2d5854);})[_0xa9de('0x1c')](function(){return respondWithRpcPromise(_0xa9de('0x58'),'create',{'module':_0xa9de('0x59')});})[_0xa9de('0x1c')](function(){var _0x105b70=_0x3fcd37['user']['get']({'plain':!![]});if(!_0x105b70)throw new Error(_0xa9de('0x5a'));if(_0x105b70['role']===_0xa9de('0x5b')){var _0xc20819=_0x57ecfb[_0xa9de('0x31')]({'plain':!![]});return db['UserProfileSection'][_0xa9de('0x50')]({'where':{'name':_0xa9de('0x32'),'userProfileId':_0x105b70[_0xa9de('0x5c')]},'raw':!![]})['then'](function(_0x5aeb36){if(_0x5aeb36&&_0x5aeb36[_0xa9de('0x5d')]===0x0){return db[_0xa9de('0x5e')][_0xa9de('0x51')]({'name':_0xc20819[_0xa9de('0x34')],'resourceId':_0xc20819['id'],'type':_0x5aeb36[_0xa9de('0x34')],'sectionId':_0x5aeb36['id']},{})[_0xa9de('0x1c')](function(){return _0x57ecfb;});}else{return _0x57ecfb;}})[_0xa9de('0x24')](function(_0x3f96dc){logger[_0xa9de('0x21')](_0xa9de('0x5f'),_0x3f96dc);throw _0x3f96dc;});}return _0x57ecfb;})[_0xa9de('0x1c')](respondWithResult(_0x156e5a,0xc9))[_0xa9de('0x24')](handleError(_0x156e5a,null));};exports['update']=function(_0x1128fa,_0x19977d,_0xb29e44){var _0x1a510d;return db[_0xa9de('0x49')][_0xa9de('0x50')]({'where':{'id':_0x1128fa['params']['id']}})[_0xa9de('0x1c')](handleEntityNotFound(_0x19977d,null))[_0xa9de('0x1c')](saveUpdates(_0x1128fa['body'],null))[_0xa9de('0x1c')](function(_0x13f1c9){if(_0x13f1c9){_0x1a510d=_0x13f1c9;return db[_0xa9de('0x49')][_0xa9de('0x4b')]({'raw':!![]});}})[_0xa9de('0x1c')](function(_0x563c6e){var _0x37adeb=fs['readFileSync'](path[_0xa9de('0x53')](config[_0xa9de('0x60')],'server/files/templates/context.ejs'),_0xa9de('0x55'));var _0x5ee50a=ejs[_0xa9de('0x56')](_0x37adeb,{'contexts':_0x563c6e||[]});fs[_0xa9de('0x61')](_0xa9de('0x57'),_0x5ee50a);})[_0xa9de('0x1c')](function(){return respondWithRpcPromise('Reload',_0xa9de('0x2f'),{'module':'chan_sip.so'});})[_0xa9de('0x1c')](function(){return _0x1a510d;})[_0xa9de('0x1c')](respondWithResult(_0x19977d,null))[_0xa9de('0x24')](handleError(_0x19977d,null));};exports[_0xa9de('0x30')]=function(_0x33062f,_0x492df7,_0xda9087){var _0x19aa41;return db['VoiceContext'][_0xa9de('0x50')]({'where':{'id':_0x33062f[_0xa9de('0x4e')]['id']}})[_0xa9de('0x1c')](handleEntityNotFound(_0x492df7,null))[_0xa9de('0x1c')](removeEntity(_0x492df7,null))[_0xa9de('0x1c')](function(){return db['VoiceContext'][_0xa9de('0x4b')]({'raw':!![]});})[_0xa9de('0x1c')](function(_0x1ea379){var _0xc36e=fs[_0xa9de('0x62')](path[_0xa9de('0x53')](config[_0xa9de('0x60')],'server/files/templates/context.ejs'),_0xa9de('0x55'));var _0x27e007=ejs[_0xa9de('0x56')](_0xc36e,{'contexts':_0x1ea379});fs[_0xa9de('0x61')](_0xa9de('0x57'),_0x27e007);return respondWithRpcPromise(_0xa9de('0x58'),'destroy',{'module':'chan_sip.so'});})[_0xa9de('0x24')](handleError(_0x492df7,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 84ebe26..cdd088d 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 _0x97c0=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','voice_contexts'];(function(_0x534c22,_0xdbeed6){var _0x4db706=function(_0x31f145){while(--_0x31f145){_0x534c22['push'](_0x534c22['shift']());}};_0x4db706(++_0xdbeed6);}(_0x97c0,0xd2));var _0x097c=function(_0x1683b4,_0x4fb110){_0x1683b4=_0x1683b4-0x0;var _0x41a3e7=_0x97c0[_0x1683b4];return _0x41a3e7;};'use strict';var _=require(_0x097c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x097c('0x1'));var moment=require(_0x097c('0x2'));var BPromise=require(_0x097c('0x3'));var rp=require(_0x097c('0x4'));var fs=require('fs');var path=require(_0x097c('0x5'));var rimraf=require(_0x097c('0x6'));var config=require(_0x097c('0x7'));var attributes=require(_0x097c('0x8'));module['exports']=function(_0xefa937,_0x20aeaa){return _0xefa937['define']('VoiceContext',attributes,{'tableName':_0x097c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2100=['../../config/environment','exports','define','voice_contexts','api','moment','rimraf'];(function(_0x44330c,_0x22f9b5){var _0x5b3cd9=function(_0x3fa058){while(--_0x3fa058){_0x44330c['push'](_0x44330c['shift']());}};_0x5b3cd9(++_0x22f9b5);}(_0x2100,0x15b));var _0x0210=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x2100[_0x48d6a3];return _0x38bfa0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0210('0x0'));var moment=require(_0x0210('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0210('0x2'));var config=require(_0x0210('0x3'));var attributes=require('./voiceContext.attributes');module[_0x0210('0x4')]=function(_0x378158,_0x148df6){return _0x378158[_0x0210('0x5')]('VoiceContext',attributes,{'tableName':_0x0210('0x6'),'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 7e726e6..47ad1a0 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 _0xcb9c=['request\x20sent','debug','VoiceContext,\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','http','request','then','info','VoiceContext,\x20%s,\x20%s'];(function(_0x1ff9ea,_0x1f7156){var _0x2eefcc=function(_0x4baebe){while(--_0x4baebe){_0x1ff9ea['push'](_0x1ff9ea['shift']());}};_0x2eefcc(++_0x1f7156);}(_0xcb9c,0x110));var _0xccb9=function(_0x3f0f46,_0x16ee37){_0x3f0f46=_0x3f0f46-0x0;var _0xe94de0=_0xcb9c[_0x3f0f46];return _0xe94de0;};'use strict';var _=require(_0xccb9('0x0'));var util=require(_0xccb9('0x1'));var moment=require(_0xccb9('0x2'));var BPromise=require(_0xccb9('0x3'));var rs=require(_0xccb9('0x4'));var fs=require('fs');var Redis=require(_0xccb9('0x5'));var db=require(_0xccb9('0x6'))['db'];var utils=require(_0xccb9('0x7'));var logger=require('../../config/logger')(_0xccb9('0x8'));var config=require(_0xccb9('0x9'));var jayson=require(_0xccb9('0xa'));var client=jayson['client'][_0xccb9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x114fa3,_0x1d807e,_0x54e899){return new BPromise(function(_0x3dfe21,_0x378d39){return client[_0xccb9('0xc')](_0x114fa3,_0x54e899)[_0xccb9('0xd')](function(_0x47889f){logger[_0xccb9('0xe')](_0xccb9('0xf'),_0x1d807e,_0xccb9('0x10'));logger[_0xccb9('0x11')](_0xccb9('0x12'),_0x1d807e,'request\x20sent',JSON[_0xccb9('0x13')](_0x47889f));if(_0x47889f[_0xccb9('0x14')]){if(_0x47889f[_0xccb9('0x14')]['code']===0x1f4){logger[_0xccb9('0x14')](_0xccb9('0xf'),_0x1d807e,_0x47889f[_0xccb9('0x14')][_0xccb9('0x15')]);return _0x378d39(_0x47889f['error'][_0xccb9('0x15')]);}logger[_0xccb9('0x14')](_0xccb9('0xf'),_0x1d807e,_0x47889f[_0xccb9('0x14')][_0xccb9('0x15')]);return _0x3dfe21(_0x47889f[_0xccb9('0x14')][_0xccb9('0x15')]);}else{logger[_0xccb9('0xe')](_0xccb9('0xf'),_0x1d807e,'request\x20sent');_0x3dfe21(_0x47889f[_0xccb9('0x16')][_0xccb9('0x15')]);}})[_0xccb9('0x17')](function(_0x561ca6){logger['error'](_0xccb9('0xf'),_0x1d807e,_0x561ca6);_0x378d39(_0x561ca6);});});} \ No newline at end of file +var _0xb114=['rpc','../../config/environment','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x37382e,_0x43baef){var _0x1caf12=function(_0x3b9ff8){while(--_0x3b9ff8){_0x37382e['push'](_0x37382e['shift']());}};_0x1caf12(++_0x43baef);}(_0xb114,0x11f));var _0x4b11=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xb114[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x4b11('0x0'));var util=require('util');var moment=require(_0x4b11('0x1'));var BPromise=require(_0x4b11('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b11('0x3'));var db=require(_0x4b11('0x4'))['db'];var utils=require(_0x4b11('0x5'));var logger=require(_0x4b11('0x6'))(_0x4b11('0x7'));var config=require(_0x4b11('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4b11('0x9')][_0x4b11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41fac6,_0x91f371,_0x132ad2){return new BPromise(function(_0x283039,_0x25ff0a){return client['request'](_0x41fac6,_0x132ad2)[_0x4b11('0xb')](function(_0x4cde8d){logger[_0x4b11('0xc')](_0x4b11('0xd'),_0x91f371,_0x4b11('0xe'));logger[_0x4b11('0xf')](_0x4b11('0x10'),_0x91f371,_0x4b11('0xe'),JSON['stringify'](_0x4cde8d));if(_0x4cde8d[_0x4b11('0x11')]){if(_0x4cde8d[_0x4b11('0x11')][_0x4b11('0x12')]===0x1f4){logger[_0x4b11('0x11')]('VoiceContext,\x20%s,\x20%s',_0x91f371,_0x4cde8d['error'][_0x4b11('0x13')]);return _0x25ff0a(_0x4cde8d[_0x4b11('0x11')][_0x4b11('0x13')]);}logger[_0x4b11('0x11')](_0x4b11('0xd'),_0x91f371,_0x4cde8d[_0x4b11('0x11')][_0x4b11('0x13')]);return _0x283039(_0x4cde8d[_0x4b11('0x11')]['message']);}else{logger['info'](_0x4b11('0xd'),_0x91f371,_0x4b11('0xe'));_0x283039(_0x4cde8d[_0x4b11('0x14')]['message']);}})['catch'](function(_0x4dd039){logger[_0x4b11('0x11')](_0x4b11('0xd'),_0x91f371,_0x4dd039);_0x25ff0a(_0x4dd039);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 5b9717a..60e53b3 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 _0xe188=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe188,0x88));var _0x8e18=function(_0x70df03,_0x49dbe6){_0x70df03=_0x70df03-0x0;var _0x536af1=_0xe188[_0x70df03];return _0x536af1;};'use strict';var multer=require(_0x8e18('0x0'));var util=require(_0x8e18('0x1'));var path=require('path');var timeout=require(_0x8e18('0x2'));var express=require(_0x8e18('0x3'));var router=express[_0x8e18('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8e18('0x5'));var interaction=require(_0x8e18('0x6'));var config=require(_0x8e18('0x7'));var controller=require(_0x8e18('0x8'));router[_0x8e18('0x9')]('/',auth['isAuthenticated'](),controller[_0x8e18('0xa')]);router[_0x8e18('0x9')](_0x8e18('0xb'),auth[_0x8e18('0xc')](),controller[_0x8e18('0xd')]);router[_0x8e18('0x9')](_0x8e18('0xe'),auth['isAuthenticated'](),controller[_0x8e18('0xf')]);router[_0x8e18('0x10')]('/',auth['isAuthenticated'](),controller[_0x8e18('0x11')]);router[_0x8e18('0x12')](_0x8e18('0xe'),auth[_0x8e18('0xc')](),controller[_0x8e18('0x13')]);router[_0x8e18('0x14')](_0x8e18('0xe'),auth[_0x8e18('0xc')](),controller[_0x8e18('0x15')]);module[_0x8e18('0x16')]=router; \ No newline at end of file +var _0xdf0a=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xdf0a,0x1a9));var _0xadf0=function(_0x172511,_0x23bf9f){_0x172511=_0x172511-0x0;var _0x12466b=_0xdf0a[_0x172511];return _0x12466b;};'use strict';var multer=require(_0xadf0('0x0'));var util=require(_0xadf0('0x1'));var path=require(_0xadf0('0x2'));var timeout=require(_0xadf0('0x3'));var express=require(_0xadf0('0x4'));var router=express['Router']();var fs_extra=require(_0xadf0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xadf0('0x6'));var controller=require(_0xadf0('0x7'));router['get']('/',auth[_0xadf0('0x8')](),controller[_0xadf0('0x9')]);router[_0xadf0('0xa')](_0xadf0('0xb'),auth[_0xadf0('0x8')](),controller[_0xadf0('0xc')]);router[_0xadf0('0xa')](_0xadf0('0xd'),auth['isAuthenticated'](),controller[_0xadf0('0xe')]);router[_0xadf0('0xf')]('/',auth[_0xadf0('0x8')](),controller[_0xadf0('0x10')]);router['put'](_0xadf0('0xd'),auth[_0xadf0('0x8')](),controller[_0xadf0('0x11')]);router[_0xadf0('0x12')](_0xadf0('0xd'),auth['isAuthenticated'](),controller[_0xadf0('0x13')]);module[_0xadf0('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 666fb93..4275d80 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 _0x84ab=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x19fa95,_0x1cca0a){var _0x58a835=function(_0x3e1957){while(--_0x3e1957){_0x19fa95['push'](_0x19fa95['shift']());}};_0x58a835(++_0x1cca0a);}(_0x84ab,0x12f));var _0xb84a=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x84ab[_0x9df060];return _0x338dfe;};'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 +var _0xf3cd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x1dfa80,_0x20841b){var _0x5043d2=function(_0x5d8239){while(--_0x5d8239){_0x1dfa80['push'](_0x1dfa80['shift']());}};_0x5043d2(++_0x20841b);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3abe6a,_0xdd7b1a){_0x3abe6a=_0x3abe6a-0x0;var _0x2fc39e=_0xf3cd[_0x3abe6a];return _0x2fc39e;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'privilege':{'type':Sequelize[_0xdf3c('0x2')]},'channel':{'type':Sequelize[_0xdf3c('0x2')]},'channelstate':{'type':Sequelize[_0xdf3c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xdf3c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinename':{'type':Sequelize[_0xdf3c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdf3c('0x2')]},'context':{'type':Sequelize[_0xdf3c('0x2')]},'exten':{'type':Sequelize[_0xdf3c('0x2')]},'priority':{'type':Sequelize[_0xdf3c('0x3')]},'uniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'linkedid':{'type':Sequelize[_0xdf3c('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdf3c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xdf3c('0x2')]},'destaccountcode':{'type':Sequelize[_0xdf3c('0x2')]},'destcontext':{'type':Sequelize[_0xdf3c('0x2')]},'destexten':{'type':Sequelize[_0xdf3c('0x2')]},'destpriority':{'type':Sequelize[_0xdf3c('0x3')]},'destuniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'destlinkedid':{'type':Sequelize[_0xdf3c('0x2')]},'dialstring':{'type':Sequelize[_0xdf3c('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xdf3c('0x4')]},'answertime':{'type':Sequelize[_0xdf3c('0x4')]},'endtime':{'type':Sequelize[_0xdf3c('0x4')]},'lastevent':{'type':Sequelize[_0xdf3c('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xdf3c('0x3')]},'duration':{'type':Sequelize[_0xdf3c('0x3')]},'holdtime':{'type':Sequelize[_0xdf3c('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index bcc3f9f..9670472 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 _0x864c=['order','sort','where','pick','filter','merge','options','include','findAll','rows','params','rawAttributes','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','squel','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceDialReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0x864c,0x17a));var _0xc864=function(_0xba78e1,_0x452ddb){_0xba78e1=_0xba78e1-0x0;var _0x4a7b98=_0x864c[_0xba78e1];return _0x4a7b98;};'use strict';var emlformat=require(_0xc864('0x0'));var rimraf=require(_0xc864('0x1'));var zipdir=require(_0xc864('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc864('0x3'));var BPromise=require(_0xc864('0x4'));var Mustache=require('mustache');var util=require(_0xc864('0x5'));var path=require(_0xc864('0x6'));var sox=require(_0xc864('0x7'));var csv=require('to-csv');var ejs=require(_0xc864('0x8'));var fs=require('fs');var fs_extra=require(_0xc864('0x9'));var _=require('lodash');var squel=require(_0xc864('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc864('0xb'));var querystring=require(_0xc864('0xc'));var Papa=require('papaparse');var Redis=require(_0xc864('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc864('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc864('0xf'))(_0xc864('0x10'));var utils=require(_0xc864('0x11'));var config=require(_0xc864('0x12'));var licenseUtil=require(_0xc864('0x13'));var db=require(_0xc864('0x14'))['db'];function respondWithStatusCode(_0x35fa03,_0x49a7a4){_0x49a7a4=_0x49a7a4||0xcc;return function(_0x214f9a){if(_0x214f9a){return _0x35fa03['sendStatus'](_0x49a7a4);}return _0x35fa03['status'](_0x49a7a4)[_0xc864('0x15')]();};}function respondWithResult(_0x595569,_0x50db58){_0x50db58=_0x50db58||0xc8;return function(_0x126b3b){if(_0x126b3b){return _0x595569[_0xc864('0x16')](_0x50db58)[_0xc864('0x17')](_0x126b3b);}};}function respondWithFilteredResult(_0x25d225,_0x2d00bb){return function(_0x11a989){if(_0x11a989){var _0x5782ee=typeof _0x2d00bb[_0xc864('0x18')]===_0xc864('0x19')&&typeof _0x2d00bb[_0xc864('0x1a')]===_0xc864('0x19');var _0x46c9b4=_0x11a989[_0xc864('0x1b')];var _0x4bda2b=_0x5782ee?0x0:_0x2d00bb[_0xc864('0x18')];var _0x48a321=_0x5782ee?_0x11a989[_0xc864('0x1b')]:_0x2d00bb[_0xc864('0x18')]+_0x2d00bb[_0xc864('0x1a')];var _0x5b8768;if(_0x48a321>=_0x46c9b4){_0x48a321=_0x46c9b4;_0x5b8768=0xc8;}else{_0x5b8768=0xce;}_0x25d225[_0xc864('0x16')](_0x5b8768);return _0x25d225[_0xc864('0x1c')]('Content-Range',_0x4bda2b+'-'+_0x48a321+'/'+_0x46c9b4)[_0xc864('0x17')](_0x11a989);}return null;};}function patchUpdates(_0x41092d){return function(_0x532ca1){try{jsonpatch[_0xc864('0x1d')](_0x532ca1,_0x41092d,!![]);}catch(_0x5eaa72){return BPromise[_0xc864('0x1e')](_0x5eaa72);}return _0x532ca1['save']();};}function saveUpdates(_0x244566,_0x9ed658){return function(_0x35cc9e){if(_0x35cc9e){return _0x35cc9e[_0xc864('0x1f')](_0x244566)[_0xc864('0x20')](function(_0x26710c){return _0x26710c;});}return null;};}function removeEntity(_0x40132f,_0x1028f6){return function(_0xc9a81d){if(_0xc9a81d){return _0xc9a81d[_0xc864('0x21')]()[_0xc864('0x20')](function(){_0x40132f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc12d,_0x579764){return function(_0x1b4148){if(!_0x1b4148){_0x5cc12d[_0xc864('0x22')](0x194);}return _0x1b4148;};}function handleError(_0x47b9db,_0x2685be){_0x2685be=_0x2685be||0x1f4;return function(_0x32851f){logger[_0xc864('0x23')](_0x32851f[_0xc864('0x24')]);if(_0x32851f[_0xc864('0x25')]){delete _0x32851f[_0xc864('0x25')];}_0x47b9db[_0xc864('0x16')](_0x2685be)[_0xc864('0x26')](_0x32851f);};}exports[_0xc864('0x27')]=function(_0x4b2325,_0x38c399){var _0x44c73b={},_0x2b8fba={},_0x9fcff5={'count':0x0,'rows':[]};var _0x130450=_[_0xc864('0x28')](db[_0xc864('0x29')]['rawAttributes'],function(_0x5ce557){return{'name':_0x5ce557[_0xc864('0x2a')],'type':_0x5ce557[_0xc864('0x2b')][_0xc864('0x2c')]};});_0x2b8fba['model']=_[_0xc864('0x28')](_0x130450,_0xc864('0x25'));_0x2b8fba[_0xc864('0x2d')]=_[_0xc864('0x2e')](_0x4b2325[_0xc864('0x2d')]);_0x2b8fba[_0xc864('0x2f')]=_[_0xc864('0x30')](_0x2b8fba[_0xc864('0x31')],_0x2b8fba['query']);_0x44c73b[_0xc864('0x32')]=_[_0xc864('0x30')](_0x2b8fba['model'],qs[_0xc864('0x33')](_0x4b2325[_0xc864('0x2d')][_0xc864('0x33')]));_0x44c73b['attributes']=_0x44c73b[_0xc864('0x32')][_0xc864('0x34')]?_0x44c73b[_0xc864('0x32')]:_0x2b8fba[_0xc864('0x31')];if(!_0x4b2325[_0xc864('0x2d')][_0xc864('0x35')]('nolimit')){_0x44c73b[_0xc864('0x1a')]=qs[_0xc864('0x1a')](_0x4b2325[_0xc864('0x2d')]['limit']);_0x44c73b[_0xc864('0x18')]=qs[_0xc864('0x18')](_0x4b2325[_0xc864('0x2d')][_0xc864('0x18')]);}_0x44c73b[_0xc864('0x36')]=qs[_0xc864('0x37')](_0x4b2325[_0xc864('0x2d')][_0xc864('0x37')]);_0x44c73b[_0xc864('0x38')]=qs[_0xc864('0x2f')](_[_0xc864('0x39')](_0x4b2325[_0xc864('0x2d')],_0x2b8fba[_0xc864('0x2f')]),_0x130450);if(_0x4b2325[_0xc864('0x2d')][_0xc864('0x3a')]){_0x44c73b[_0xc864('0x38')]=_[_0xc864('0x3b')](_0x44c73b[_0xc864('0x38')],{'$or':_['map'](_0x130450,function(_0x1a8018){if(_0x1a8018[_0xc864('0x2b')]!=='VIRTUAL'){var _0x1e9cb0={};_0x1e9cb0[_0x1a8018[_0xc864('0x25')]]={'$like':'%'+_0x4b2325[_0xc864('0x2d')]['filter']+'%'};return _0x1e9cb0;}})});}_0x44c73b=_[_0xc864('0x3b')]({},_0x44c73b,_0x4b2325[_0xc864('0x3c')]);var _0x1d07c9={'where':_0x44c73b[_0xc864('0x38')]};return db[_0xc864('0x29')][_0xc864('0x1b')](_0x1d07c9)[_0xc864('0x20')](function(_0x4321cd){_0x9fcff5[_0xc864('0x1b')]=_0x4321cd;if(_0x4b2325['query']['includeAll']){_0x44c73b[_0xc864('0x3d')]=[{'all':!![]}];}return db[_0xc864('0x29')][_0xc864('0x3e')](_0x44c73b);})['then'](function(_0x54d968){_0x9fcff5[_0xc864('0x3f')]=_0x54d968;return _0x9fcff5;})[_0xc864('0x20')](respondWithFilteredResult(_0x38c399,_0x44c73b))['catch'](handleError(_0x38c399,null));};exports['show']=function(_0x362cb5,_0x283c6d){var _0x5abf42={'raw':!![],'where':{'id':_0x362cb5[_0xc864('0x40')]['id']}},_0xb0b904={};_0xb0b904[_0xc864('0x31')]=_[_0xc864('0x2e')](db[_0xc864('0x29')][_0xc864('0x41')]);_0xb0b904[_0xc864('0x2d')]=_[_0xc864('0x2e')](_0x362cb5['query']);_0xb0b904[_0xc864('0x2f')]=_[_0xc864('0x30')](_0xb0b904[_0xc864('0x31')],_0xb0b904['query']);_0x5abf42[_0xc864('0x32')]=_['intersection'](_0xb0b904['model'],qs['fields'](_0x362cb5[_0xc864('0x2d')][_0xc864('0x33')]));_0x5abf42[_0xc864('0x32')]=_0x5abf42[_0xc864('0x32')][_0xc864('0x34')]?_0x5abf42[_0xc864('0x32')]:_0xb0b904[_0xc864('0x31')];if(_0x362cb5[_0xc864('0x2d')][_0xc864('0x42')]){_0x5abf42[_0xc864('0x3d')]=[{'all':!![]}];}_0x5abf42=_[_0xc864('0x3b')]({},_0x5abf42,_0x362cb5['options']);return db[_0xc864('0x29')][_0xc864('0x43')](_0x5abf42)['then'](handleEntityNotFound(_0x283c6d,null))[_0xc864('0x20')](respondWithResult(_0x283c6d,null))[_0xc864('0x44')](handleError(_0x283c6d,null));};exports[_0xc864('0x45')]=function(_0xc0292c,_0x43fe24){return db['VoiceDialReport'][_0xc864('0x45')](_0xc0292c[_0xc864('0x46')],{})[_0xc864('0x20')](respondWithResult(_0x43fe24,0xc9))[_0xc864('0x44')](handleError(_0x43fe24,null));};exports[_0xc864('0x1f')]=function(_0x404a4d,_0x39bed2){if(_0x404a4d[_0xc864('0x46')]['id']){delete _0x404a4d[_0xc864('0x46')]['id'];}return db[_0xc864('0x29')][_0xc864('0x43')]({'where':{'id':_0x404a4d[_0xc864('0x40')]['id']}})[_0xc864('0x20')](handleEntityNotFound(_0x39bed2,null))[_0xc864('0x20')](saveUpdates(_0x404a4d[_0xc864('0x46')],null))[_0xc864('0x20')](respondWithResult(_0x39bed2,null))[_0xc864('0x44')](handleError(_0x39bed2,null));};exports[_0xc864('0x21')]=function(_0x4085e5,_0x5a755b){return db[_0xc864('0x29')][_0xc864('0x43')]({'where':{'id':_0x4085e5[_0xc864('0x40')]['id']}})[_0xc864('0x20')](handleEntityNotFound(_0x5a755b,null))[_0xc864('0x20')](removeEntity(_0x5a755b,null))[_0xc864('0x44')](handleError(_0x5a755b,null));};exports['describe']=function(_0x440743,_0x2b269c){return db[_0xc864('0x29')][_0xc864('0x47')]()[_0xc864('0x20')](respondWithResult(_0x2b269c,null))['catch'](handleError(_0x2b269c,null));}; \ No newline at end of file +var _0xbcc0=['where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','include','options','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','save','then','destroy','sendStatus','error','name','send','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x183f5a,_0x5174b0){var _0x228f16=function(_0x542b76){while(--_0x542b76){_0x183f5a['push'](_0x183f5a['shift']());}};_0x228f16(++_0x5174b0);}(_0xbcc0,0x192));var _0x0bcc=function(_0x3f22f1,_0x102ad9){_0x3f22f1=_0x3f22f1-0x0;var _0x1b57fc=_0xbcc0[_0x3f22f1];return _0x1b57fc;};'use strict';var emlformat=require(_0x0bcc('0x0'));var rimraf=require(_0x0bcc('0x1'));var zipdir=require(_0x0bcc('0x2'));var jsonpatch=require(_0x0bcc('0x3'));var rp=require(_0x0bcc('0x4'));var moment=require(_0x0bcc('0x5'));var BPromise=require(_0x0bcc('0x6'));var Mustache=require(_0x0bcc('0x7'));var util=require(_0x0bcc('0x8'));var path=require('path');var sox=require(_0x0bcc('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0bcc('0xa'));var _=require(_0x0bcc('0xb'));var squel=require(_0x0bcc('0xc'));var crypto=require('crypto');var jsforce=require(_0x0bcc('0xd'));var deskjs=require(_0x0bcc('0xe'));var toCsv=require(_0x0bcc('0xf'));var querystring=require(_0x0bcc('0x10'));var Papa=require(_0x0bcc('0x11'));var Redis=require('ioredis');var authService=require(_0x0bcc('0x12'));var qs=require(_0x0bcc('0x13'));var as=require(_0x0bcc('0x14'));var hardwareService=require(_0x0bcc('0x15'));var logger=require(_0x0bcc('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x0bcc('0x17'));var licenseUtil=require(_0x0bcc('0x18'));var db=require(_0x0bcc('0x19'))['db'];function respondWithStatusCode(_0x1c9123,_0xb519c6){_0xb519c6=_0xb519c6||0xcc;return function(_0xfc802f){if(_0xfc802f){return _0x1c9123['sendStatus'](_0xb519c6);}return _0x1c9123[_0x0bcc('0x1a')](_0xb519c6)[_0x0bcc('0x1b')]();};}function respondWithResult(_0x29aff9,_0x1ff3c2){_0x1ff3c2=_0x1ff3c2||0xc8;return function(_0x1cc059){if(_0x1cc059){return _0x29aff9[_0x0bcc('0x1a')](_0x1ff3c2)['json'](_0x1cc059);}};}function respondWithFilteredResult(_0x239d04,_0x2f59cf){return function(_0x4a578b){if(_0x4a578b){var _0x521b51=typeof _0x2f59cf[_0x0bcc('0x1c')]===_0x0bcc('0x1d')&&typeof _0x2f59cf['limit']===_0x0bcc('0x1d');var _0x3df98=_0x4a578b['count'];var _0x35c3c4=_0x521b51?0x0:_0x2f59cf['offset'];var _0x14827c=_0x521b51?_0x4a578b[_0x0bcc('0x1e')]:_0x2f59cf[_0x0bcc('0x1c')]+_0x2f59cf[_0x0bcc('0x1f')];var _0x395e5c;if(_0x14827c>=_0x3df98){_0x14827c=_0x3df98;_0x395e5c=0xc8;}else{_0x395e5c=0xce;}_0x239d04['status'](_0x395e5c);return _0x239d04[_0x0bcc('0x20')]('Content-Range',_0x35c3c4+'-'+_0x14827c+'/'+_0x3df98)[_0x0bcc('0x21')](_0x4a578b);}return null;};}function patchUpdates(_0x5669f9){return function(_0x54fa42){try{jsonpatch[_0x0bcc('0x22')](_0x54fa42,_0x5669f9,!![]);}catch(_0x3c2dd3){return BPromise[_0x0bcc('0x23')](_0x3c2dd3);}return _0x54fa42[_0x0bcc('0x24')]();};}function saveUpdates(_0x12c8f9,_0x337d44){return function(_0x420198){if(_0x420198){return _0x420198['update'](_0x12c8f9)[_0x0bcc('0x25')](function(_0x2a390d){return _0x2a390d;});}return null;};}function removeEntity(_0xde8480,_0x47b288){return function(_0x5ae73b){if(_0x5ae73b){return _0x5ae73b[_0x0bcc('0x26')]()[_0x0bcc('0x25')](function(){_0xde8480[_0x0bcc('0x1a')](0xcc)[_0x0bcc('0x1b')]();});}};}function handleEntityNotFound(_0x1b19e4,_0xf53a59){return function(_0x2b5f8b){if(!_0x2b5f8b){_0x1b19e4[_0x0bcc('0x27')](0x194);}return _0x2b5f8b;};}function handleError(_0x252d40,_0x36db5b){_0x36db5b=_0x36db5b||0x1f4;return function(_0x183dc8){logger[_0x0bcc('0x28')](_0x183dc8['stack']);if(_0x183dc8['name']){delete _0x183dc8[_0x0bcc('0x29')];}_0x252d40['status'](_0x36db5b)[_0x0bcc('0x2a')](_0x183dc8);};}exports['index']=function(_0x2793bb,_0x15acc8){var _0xca5d1d={},_0x1be0c6={},_0xb98f18={'count':0x0,'rows':[]};var _0xacdf05=_[_0x0bcc('0x2b')](db[_0x0bcc('0x2c')][_0x0bcc('0x2d')],function(_0x553445){return{'name':_0x553445[_0x0bcc('0x2e')],'type':_0x553445[_0x0bcc('0x2f')][_0x0bcc('0x30')]};});_0x1be0c6[_0x0bcc('0x31')]=_[_0x0bcc('0x2b')](_0xacdf05,_0x0bcc('0x29'));_0x1be0c6[_0x0bcc('0x32')]=_[_0x0bcc('0x33')](_0x2793bb[_0x0bcc('0x32')]);_0x1be0c6[_0x0bcc('0x34')]=_[_0x0bcc('0x35')](_0x1be0c6[_0x0bcc('0x31')],_0x1be0c6['query']);_0xca5d1d[_0x0bcc('0x36')]=_[_0x0bcc('0x35')](_0x1be0c6['model'],qs[_0x0bcc('0x37')](_0x2793bb[_0x0bcc('0x32')][_0x0bcc('0x37')]));_0xca5d1d['attributes']=_0xca5d1d[_0x0bcc('0x36')][_0x0bcc('0x38')]?_0xca5d1d[_0x0bcc('0x36')]:_0x1be0c6[_0x0bcc('0x31')];if(!_0x2793bb[_0x0bcc('0x32')][_0x0bcc('0x39')]('nolimit')){_0xca5d1d[_0x0bcc('0x1f')]=qs[_0x0bcc('0x1f')](_0x2793bb[_0x0bcc('0x32')][_0x0bcc('0x1f')]);_0xca5d1d[_0x0bcc('0x1c')]=qs[_0x0bcc('0x1c')](_0x2793bb[_0x0bcc('0x32')][_0x0bcc('0x1c')]);}_0xca5d1d[_0x0bcc('0x3a')]=qs['sort'](_0x2793bb[_0x0bcc('0x32')][_0x0bcc('0x3b')]);_0xca5d1d[_0x0bcc('0x3c')]=qs['filters'](_[_0x0bcc('0x3d')](_0x2793bb[_0x0bcc('0x32')],_0x1be0c6[_0x0bcc('0x34')]),_0xacdf05);if(_0x2793bb['query'][_0x0bcc('0x3e')]){_0xca5d1d[_0x0bcc('0x3c')]=_[_0x0bcc('0x3f')](_0xca5d1d[_0x0bcc('0x3c')],{'$or':_[_0x0bcc('0x2b')](_0xacdf05,function(_0xb1dfc4){if(_0xb1dfc4['type']!==_0x0bcc('0x40')){var _0x49d774={};_0x49d774[_0xb1dfc4[_0x0bcc('0x29')]]={'$like':'%'+_0x2793bb[_0x0bcc('0x32')][_0x0bcc('0x3e')]+'%'};return _0x49d774;}})});}_0xca5d1d=_[_0x0bcc('0x3f')]({},_0xca5d1d,_0x2793bb['options']);var _0x40cfb2={'where':_0xca5d1d[_0x0bcc('0x3c')]};return db[_0x0bcc('0x2c')]['count'](_0x40cfb2)['then'](function(_0x478345){_0xb98f18[_0x0bcc('0x1e')]=_0x478345;if(_0x2793bb[_0x0bcc('0x32')][_0x0bcc('0x41')]){_0xca5d1d['include']=[{'all':!![]}];}return db[_0x0bcc('0x2c')][_0x0bcc('0x42')](_0xca5d1d);})[_0x0bcc('0x25')](function(_0x462e27){_0xb98f18[_0x0bcc('0x43')]=_0x462e27;return _0xb98f18;})[_0x0bcc('0x25')](respondWithFilteredResult(_0x15acc8,_0xca5d1d))['catch'](handleError(_0x15acc8,null));};exports[_0x0bcc('0x44')]=function(_0x38a8dc,_0x1a3e98){var _0x2f047d={'raw':!![],'where':{'id':_0x38a8dc['params']['id']}},_0x41b543={};_0x41b543[_0x0bcc('0x31')]=_[_0x0bcc('0x33')](db['VoiceDialReport'][_0x0bcc('0x2d')]);_0x41b543[_0x0bcc('0x32')]=_['keys'](_0x38a8dc[_0x0bcc('0x32')]);_0x41b543[_0x0bcc('0x34')]=_[_0x0bcc('0x35')](_0x41b543[_0x0bcc('0x31')],_0x41b543[_0x0bcc('0x32')]);_0x2f047d[_0x0bcc('0x36')]=_['intersection'](_0x41b543['model'],qs[_0x0bcc('0x37')](_0x38a8dc[_0x0bcc('0x32')][_0x0bcc('0x37')]));_0x2f047d[_0x0bcc('0x36')]=_0x2f047d[_0x0bcc('0x36')]['length']?_0x2f047d[_0x0bcc('0x36')]:_0x41b543[_0x0bcc('0x31')];if(_0x38a8dc[_0x0bcc('0x32')][_0x0bcc('0x41')]){_0x2f047d[_0x0bcc('0x45')]=[{'all':!![]}];}_0x2f047d=_['merge']({},_0x2f047d,_0x38a8dc[_0x0bcc('0x46')]);return db[_0x0bcc('0x2c')][_0x0bcc('0x47')](_0x2f047d)[_0x0bcc('0x25')](handleEntityNotFound(_0x1a3e98,null))['then'](respondWithResult(_0x1a3e98,null))[_0x0bcc('0x48')](handleError(_0x1a3e98,null));};exports[_0x0bcc('0x49')]=function(_0xa1feb3,_0x3b4914){return db[_0x0bcc('0x2c')]['create'](_0xa1feb3[_0x0bcc('0x4a')],{})[_0x0bcc('0x25')](respondWithResult(_0x3b4914,0xc9))[_0x0bcc('0x48')](handleError(_0x3b4914,null));};exports['update']=function(_0x43d712,_0x2effbd){if(_0x43d712[_0x0bcc('0x4a')]['id']){delete _0x43d712[_0x0bcc('0x4a')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x43d712[_0x0bcc('0x4b')]['id']}})[_0x0bcc('0x25')](handleEntityNotFound(_0x2effbd,null))[_0x0bcc('0x25')](saveUpdates(_0x43d712[_0x0bcc('0x4a')],null))[_0x0bcc('0x25')](respondWithResult(_0x2effbd,null))[_0x0bcc('0x48')](handleError(_0x2effbd,null));};exports[_0x0bcc('0x26')]=function(_0xb12af4,_0x54eb4f){return db['VoiceDialReport'][_0x0bcc('0x47')]({'where':{'id':_0xb12af4[_0x0bcc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x54eb4f,null))[_0x0bcc('0x25')](removeEntity(_0x54eb4f,null))[_0x0bcc('0x48')](handleError(_0x54eb4f,null));};exports[_0x0bcc('0x4c')]=function(_0x11166d,_0x53b5c2){return db[_0x0bcc('0x2c')][_0x0bcc('0x4c')]()[_0x0bcc('0x25')](respondWithResult(_0x53b5c2,null))[_0x0bcc('0x48')](handleError(_0x53b5c2,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 19a3e35..2301210 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 _0xd2bb=['moment','bluebird','request-promise','path','rimraf','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','util','api'];(function(_0x7a3247,_0x15cb12){var _0x1bfde5=function(_0x62bbef){while(--_0x62bbef){_0x7a3247['push'](_0x7a3247['shift']());}};_0x1bfde5(++_0x15cb12);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x2fe691,_0x1a85ed){_0x2fe691=_0x2fe691-0x0;var _0x49cb1d=_0xd2bb[_0x2fe691];return _0x49cb1d;};'use strict';var _=require('lodash');var util=require(_0xbd2b('0x0'));var logger=require('../../config/logger')(_0xbd2b('0x1'));var moment=require(_0xbd2b('0x2'));var BPromise=require(_0xbd2b('0x3'));var rp=require(_0xbd2b('0x4'));var fs=require('fs');var path=require(_0xbd2b('0x5'));var rimraf=require(_0xbd2b('0x6'));var config=require('../../config/environment');var attributes=require(_0xbd2b('0x7'));module[_0xbd2b('0x8')]=function(_0xdcd8bd,_0x2f64a8){return _0xdcd8bd[_0xbd2b('0x9')](_0xbd2b('0xa'),attributes,{'tableName':_0xbd2b('0xb'),'paranoid':![],'indexes':[{'fields':[_0xbd2b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd50e=['VoiceDialReport','report_dial','uniqueid','util','moment','request-promise','path','rimraf','./voiceDialReport.attributes','define'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0xd50e,0x12f));var _0xed50=function(_0x17f857,_0x592dd1){_0x17f857=_0x17f857-0x0;var _0x1b2af3=_0xd50e[_0x17f857];return _0x1b2af3;};'use strict';var _=require('lodash');var util=require(_0xed50('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xed50('0x1'));var BPromise=require('bluebird');var rp=require(_0xed50('0x2'));var fs=require('fs');var path=require(_0xed50('0x3'));var rimraf=require(_0xed50('0x4'));var config=require('../../config/environment');var attributes=require(_0xed50('0x5'));module['exports']=function(_0x3166f4,_0x5a8f85){return _0x3166f4[_0xed50('0x6')](_0xed50('0x7'),attributes,{'tableName':_0xed50('0x8'),'paranoid':![],'indexes':[{'fields':[_0xed50('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index eaee283..5262e27 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 _0xf57c=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','catch','UpdateVoiceDialReport','update','attributes','limit'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xf57c,0xe0));var _0xcf57=function(_0x4d21ec,_0xa48e2){_0x4d21ec=_0x4d21ec-0x0;var _0x3d0692=_0xf57c[_0x4d21ec];return _0x3d0692;};'use strict';var _=require(_0xcf57('0x0'));var util=require(_0xcf57('0x1'));var moment=require(_0xcf57('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf57('0x3'));var db=require(_0xcf57('0x4'))['db'];var utils=require(_0xcf57('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xcf57('0x6'));var jayson=require(_0xcf57('0x7'));var client=jayson[_0xcf57('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d3eed,_0x49c2c5,_0x14550b){return new BPromise(function(_0x52c767,_0x23c5cd){return client[_0xcf57('0x9')](_0x4d3eed,_0x14550b)[_0xcf57('0xa')](function(_0x135cd3){logger[_0xcf57('0xb')](_0xcf57('0xc'),_0x49c2c5,_0xcf57('0xd'));logger[_0xcf57('0xe')](_0xcf57('0xf'),_0x49c2c5,_0xcf57('0xd'),JSON[_0xcf57('0x10')](_0x135cd3));if(_0x135cd3['error']){if(_0x135cd3[_0xcf57('0x11')][_0xcf57('0x12')]===0x1f4){logger[_0xcf57('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x49c2c5,_0x135cd3[_0xcf57('0x11')][_0xcf57('0x13')]);return _0x23c5cd(_0x135cd3['error']['message']);}logger['error'](_0xcf57('0xc'),_0x49c2c5,_0x135cd3[_0xcf57('0x11')][_0xcf57('0x13')]);return _0x52c767(_0x135cd3['error']['message']);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x49c2c5,_0xcf57('0xd'));_0x52c767(_0x135cd3[_0xcf57('0x14')][_0xcf57('0x13')]);}})['catch'](function(_0xc6094){logger[_0xcf57('0x11')](_0xcf57('0xc'),_0x49c2c5,_0xc6094);_0x23c5cd(_0xc6094);});});}exports[_0xcf57('0x15')]=function(_0x15fef8){var _0xdfafb9=this;return new Promise(function(_0x580622,_0x1513bf){return db[_0xcf57('0x16')][_0xcf57('0x17')](_0x15fef8[_0xcf57('0x18')],{'raw':_0x15fef8[_0xcf57('0x19')]?_0x15fef8[_0xcf57('0x19')][_0xcf57('0x1a')]===undefined?!![]:![]:!![]})[_0xcf57('0xa')](function(_0x1866bb){logger[_0xcf57('0xb')](_0xcf57('0x15'),_0x15fef8);logger['debug'](_0xcf57('0x15'),_0x15fef8,JSON[_0xcf57('0x10')](_0x1866bb));_0x580622(_0x1866bb);})[_0xcf57('0x1b')](function(_0xfff8a5){logger['error'](_0xcf57('0x15'),_0xfff8a5['message'],_0x15fef8);_0x1513bf(_0xdfafb9[_0xcf57('0x11')](0x1f4,_0xfff8a5[_0xcf57('0x13')]));});});};exports[_0xcf57('0x1c')]=function(_0x292c0f){var _0x1265b1=this;return new Promise(function(_0x94a618,_0x6c7d5){return db['VoiceDialReport'][_0xcf57('0x1d')](_0x292c0f[_0xcf57('0x18')],{'raw':_0x292c0f['options']?_0x292c0f[_0xcf57('0x19')][_0xcf57('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x292c0f[_0xcf57('0x19')]?_0x292c0f[_0xcf57('0x19')]['where']||null:null,'attributes':_0x292c0f[_0xcf57('0x19')]?_0x292c0f['options'][_0xcf57('0x1e')]||null:null,'limit':_0x292c0f['options']?_0x292c0f[_0xcf57('0x19')][_0xcf57('0x1f')]||null:null})[_0xcf57('0xa')](function(_0x462102){logger[_0xcf57('0xb')](_0xcf57('0x1c'),_0x292c0f);logger[_0xcf57('0xe')](_0xcf57('0x1c'),_0x292c0f,JSON[_0xcf57('0x10')](_0x462102));_0x94a618(_0x462102);})[_0xcf57('0x1b')](function(_0x3c7126){logger['error']('UpdateVoiceDialReport',_0x3c7126[_0xcf57('0x13')],_0x292c0f);_0x6c7d5(_0x1265b1['error'](0x1f4,_0x3c7126['message']));});});}; \ No newline at end of file +var _0x30c6=['where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','VoiceDialReport','create','options','raw','CreateVoiceDialReport','stringify','UpdateVoiceDialReport','update','body'];(function(_0x286731,_0x116916){var _0x50f5a5=function(_0x18ef71){while(--_0x18ef71){_0x286731['push'](_0x286731['shift']());}};_0x50f5a5(++_0x116916);}(_0x30c6,0xf8));var _0x630c=function(_0x2e42ff,_0x12211a){_0x2e42ff=_0x2e42ff-0x0;var _0x1598b2=_0x30c6[_0x2e42ff];return _0x1598b2;};'use strict';var _=require(_0x630c('0x0'));var util=require(_0x630c('0x1'));var moment=require(_0x630c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x630c('0x3'));var db=require(_0x630c('0x4'))['db'];var utils=require(_0x630c('0x5'));var logger=require(_0x630c('0x6'))(_0x630c('0x7'));var config=require(_0x630c('0x8'));var jayson=require(_0x630c('0x9'));var client=jayson[_0x630c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58516f,_0x515654,_0x244145){return new BPromise(function(_0x91c46c,_0x4ee48d){return client[_0x630c('0xb')](_0x58516f,_0x244145)[_0x630c('0xc')](function(_0x17b252){logger[_0x630c('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x515654,_0x630c('0xe'));logger[_0x630c('0xf')](_0x630c('0x10'),_0x515654,_0x630c('0xe'),JSON['stringify'](_0x17b252));if(_0x17b252[_0x630c('0x11')]){if(_0x17b252[_0x630c('0x11')][_0x630c('0x12')]===0x1f4){logger[_0x630c('0x11')](_0x630c('0x13'),_0x515654,_0x17b252[_0x630c('0x11')]['message']);return _0x4ee48d(_0x17b252[_0x630c('0x11')][_0x630c('0x14')]);}logger[_0x630c('0x11')](_0x630c('0x13'),_0x515654,_0x17b252[_0x630c('0x11')][_0x630c('0x14')]);return _0x91c46c(_0x17b252[_0x630c('0x11')]['message']);}else{logger[_0x630c('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x515654,'request\x20sent');_0x91c46c(_0x17b252[_0x630c('0x15')][_0x630c('0x14')]);}})[_0x630c('0x16')](function(_0x4f9e2b){logger[_0x630c('0x11')](_0x630c('0x13'),_0x515654,_0x4f9e2b);_0x4ee48d(_0x4f9e2b);});});}exports['CreateVoiceDialReport']=function(_0x182c1b){var _0x2fc0b2=this;return new Promise(function(_0x453cfb,_0x283217){return db[_0x630c('0x17')][_0x630c('0x18')](_0x182c1b['body'],{'raw':_0x182c1b[_0x630c('0x19')]?_0x182c1b[_0x630c('0x19')][_0x630c('0x1a')]===undefined?!![]:![]:!![]})[_0x630c('0xc')](function(_0x300b33){logger['info'](_0x630c('0x1b'),_0x182c1b);logger[_0x630c('0xf')]('CreateVoiceDialReport',_0x182c1b,JSON[_0x630c('0x1c')](_0x300b33));_0x453cfb(_0x300b33);})['catch'](function(_0x477a41){logger[_0x630c('0x11')]('CreateVoiceDialReport',_0x477a41[_0x630c('0x14')],_0x182c1b);_0x283217(_0x2fc0b2[_0x630c('0x11')](0x1f4,_0x477a41[_0x630c('0x14')]));});});};exports[_0x630c('0x1d')]=function(_0x4db646){var _0x5901d0=this;return new Promise(function(_0x1f00dd,_0x407422){return db[_0x630c('0x17')][_0x630c('0x1e')](_0x4db646[_0x630c('0x1f')],{'raw':_0x4db646[_0x630c('0x19')]?_0x4db646[_0x630c('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4db646['options']?_0x4db646[_0x630c('0x19')][_0x630c('0x20')]||null:null,'attributes':_0x4db646[_0x630c('0x19')]?_0x4db646[_0x630c('0x19')][_0x630c('0x21')]||null:null,'limit':_0x4db646[_0x630c('0x19')]?_0x4db646['options'][_0x630c('0x22')]||null:null})[_0x630c('0xc')](function(_0x4363bd){logger[_0x630c('0xd')](_0x630c('0x1d'),_0x4db646);logger[_0x630c('0xf')](_0x630c('0x1d'),_0x4db646,JSON[_0x630c('0x1c')](_0x4363bd));_0x1f00dd(_0x4363bd);})[_0x630c('0x16')](function(_0x1ac1a5){logger[_0x630c('0x11')]('UpdateVoiceDialReport',_0x1ac1a5[_0x630c('0x14')],_0x4db646);_0x407422(_0x5901d0['error'](0x1f4,_0x1ac1a5[_0x630c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index c53edca..0b5964e 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 _0x4dc7=['show','create','post','/:id/applications','addApplications','put','delete','destroy','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','/:id'];(function(_0x5c22c9,_0x4deaa){var _0x126c40=function(_0x3c92d3){while(--_0x3c92d3){_0x5c22c9['push'](_0x5c22c9['shift']());}};_0x126c40(++_0x4deaa);}(_0x4dc7,0x75));var _0x74dc=function(_0xdd5de6,_0x59fdc5){_0xdd5de6=_0xdd5de6-0x0;var _0x43d8be=_0x4dc7[_0xdd5de6];return _0x43d8be;};'use strict';var multer=require(_0x74dc('0x0'));var util=require(_0x74dc('0x1'));var path=require(_0x74dc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x74dc('0x3'));var interaction=require(_0x74dc('0x4'));var config=require('../../config/environment');var controller=require(_0x74dc('0x5'));router[_0x74dc('0x6')]('/',auth[_0x74dc('0x7')](),controller['index']);router[_0x74dc('0x6')](_0x74dc('0x8'),auth[_0x74dc('0x7')](),controller[_0x74dc('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x74dc('0xa')]);router[_0x74dc('0xb')](_0x74dc('0xc'),auth[_0x74dc('0x7')](),controller[_0x74dc('0xd')]);router[_0x74dc('0xe')](_0x74dc('0x8'),auth[_0x74dc('0x7')](),controller['update']);router[_0x74dc('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x74dc('0x10')]);module[_0x74dc('0x11')]=router; \ No newline at end of file +var _0xeb4e=['create','/:id/applications','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','post'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0xeb4e,0x184));var _0xeeb4=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xeb4e[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require('multer');var util=require(_0xeeb4('0x0'));var path=require('path');var timeout=require(_0xeeb4('0x1'));var express=require(_0xeeb4('0x2'));var router=express[_0xeeb4('0x3')]();var fs_extra=require(_0xeeb4('0x4'));var auth=require(_0xeeb4('0x5'));var interaction=require(_0xeeb4('0x6'));var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router['get']('/',auth[_0xeeb4('0x7')](),controller[_0xeeb4('0x8')]);router[_0xeeb4('0x9')](_0xeeb4('0xa'),auth[_0xeeb4('0x7')](),controller['show']);router[_0xeeb4('0xb')]('/',auth['isAuthenticated'](),controller[_0xeeb4('0xc')]);router[_0xeeb4('0xb')](_0xeeb4('0xd'),auth[_0xeeb4('0x7')](),controller['addApplications']);router['put'](_0xeeb4('0xa'),auth[_0xeeb4('0x7')](),controller['update']);router[_0xeeb4('0xe')]('/:id',auth[_0xeeb4('0x7')](),controller['destroy']);module[_0xeeb4('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 23a5c79..6991086 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 _0x03b6=['inbound','outbound','outbound-fax','any','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM'];(function(_0x3b50de,_0x226b23){var _0x14f4a8=function(_0x44d317){while(--_0x44d317){_0x3b50de['push'](_0x3b50de['shift']());}};_0x14f4a8(++_0x226b23);}(_0x03b6,0x9a));var _0x603b=function(_0x4639ac,_0x454118){_0x4639ac=_0x4639ac-0x0;var _0x4b61e3=_0x03b6[_0x4639ac];return _0x4b61e3;};'use strict';var Sequelize=require(_0x603b('0x0'));module[_0x603b('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x603b('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x603b('0x2')},'priority':{'type':Sequelize[_0x603b('0x3')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x603b('0x3')],'allowNull':![],'defaultValue':_0x603b('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x603b('0x5')](_0x603b('0x6'),_0x603b('0x7'),'internal','inbound-fax',_0x603b('0x8'),'system',_0x603b('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x603b('0x3')]},'interval':{'type':Sequelize[_0x603b('0x3')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x603b('0xa')]},'isApp':{'type':Sequelize[_0x603b('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x603b('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x603b('0x3')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x603b('0xa')]},'recordingFormat':{'type':Sequelize[_0x603b('0x3')],'defaultValue':_0x603b('0xc')},'answer':{'type':Sequelize[_0x603b('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x603b('0xd')],'get':function(_0x23e6e4){return this[_0x603b('0xe')](_0x603b('0xf'));}},'alias':{'type':Sequelize[_0x603b('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0xcbaf=['inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','sequelize','STRING','compositeIndex','NoOp','outbound','internal'];(function(_0x23a8aa,_0x43f152){var _0x11728f=function(_0x3c887a){while(--_0x3c887a){_0x23a8aa['push'](_0x23a8aa['shift']());}};_0x11728f(++_0x43f152);}(_0xcbaf,0x1bc));var _0xfcba=function(_0x45ca21,_0x47bfce){_0x45ca21=_0x45ca21-0x0;var _0x1154d2=_0xcbaf[_0x45ca21];return _0x1154d2;};'use strict';var Sequelize=require(_0xfcba('0x0'));module['exports']={'context':{'type':Sequelize[_0xfcba('0x1')],'allowNull':![],'unique':_0xfcba('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xfcba('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xfcba('0x2')},'tag':{'type':Sequelize[_0xfcba('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xfcba('0x1')],'allowNull':![],'defaultValue':_0xfcba('0x3')},'appdata':{'type':Sequelize[_0xfcba('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0xfcba('0x4'),_0xfcba('0x5'),_0xfcba('0x6'),_0xfcba('0x7'),_0xfcba('0x8'),_0xfcba('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xfcba('0x1')]},'interval':{'type':Sequelize[_0xfcba('0x1')],'allowNull':![],'defaultValue':_0xfcba('0xa')},'IntervalId':{'type':Sequelize[_0xfcba('0xb')]},'isApp':{'type':Sequelize[_0xfcba('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xfcba('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xfcba('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xfcba('0xd')},'answer':{'type':Sequelize[_0xfcba('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xfcba('0xe')],'get':function(_0x23a0c7){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0xfcba('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index ad90d3d..62c4636 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 _0xcf6a=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','InboundRoutes','inbound','outbound','InternalRoutes','internal','filter','ignore','value','type','name','UserProfileResource','error','send','VoiceExtension','rawAttributes','fieldName','key','map','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','startsWith','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','rewriteDial','true','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x36d66d,_0x33fea6){var _0x438117=function(_0x751c0c){while(--_0x751c0c){_0x36d66d['push'](_0x36d66d['shift']());}};_0x438117(++_0x33fea6);}(_0xcf6a,0xdd));var _0xacf6=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xcf6a[_0xe66cf2];return _0x2d84e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xacf6('0x0'));var zipdir=require(_0xacf6('0x1'));var jsonpatch=require(_0xacf6('0x2'));var rp=require(_0xacf6('0x3'));var moment=require(_0xacf6('0x4'));var BPromise=require(_0xacf6('0x5'));var Mustache=require(_0xacf6('0x6'));var util=require(_0xacf6('0x7'));var path=require(_0xacf6('0x8'));var sox=require(_0xacf6('0x9'));var csv=require(_0xacf6('0xa'));var ejs=require(_0xacf6('0xb'));var fs=require('fs');var fs_extra=require(_0xacf6('0xc'));var _=require(_0xacf6('0xd'));var squel=require(_0xacf6('0xe'));var crypto=require(_0xacf6('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xacf6('0x10'));var toCsv=require(_0xacf6('0xa'));var querystring=require(_0xacf6('0x11'));var Papa=require(_0xacf6('0x12'));var Redis=require(_0xacf6('0x13'));var authService=require(_0xacf6('0x14'));var qs=require(_0xacf6('0x15'));var as=require(_0xacf6('0x16'));var hardwareService=require(_0xacf6('0x17'));var logger=require('../../config/logger')(_0xacf6('0x18'));var utils=require(_0xacf6('0x19'));var config=require(_0xacf6('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xacf6('0x1b')](config[_0xacf6('0x1c')],{'host':_0xacf6('0x1d'),'port':0x18eb});var socket=require(_0xacf6('0x1e'))(new Redis(config['redis']));require(_0xacf6('0x1f'))[_0xacf6('0x20')](socket);function respondWithStatusCode(_0x9d18d8,_0xec5346){_0xec5346=_0xec5346||0xcc;return function(_0x24068a){if(_0x24068a){return _0x9d18d8[_0xacf6('0x21')](_0xec5346);}return _0x9d18d8[_0xacf6('0x22')](_0xec5346)[_0xacf6('0x23')]();};}function respondWithResult(_0x4df332,_0x4c434d){_0x4c434d=_0x4c434d||0xc8;return function(_0x2d33a0){if(_0x2d33a0){return _0x4df332[_0xacf6('0x22')](_0x4c434d)[_0xacf6('0x24')](_0x2d33a0);}};}function respondWithFilteredResult(_0x101ee0,_0x359436){return function(_0x59da1d){if(_0x59da1d){var _0x510592=typeof _0x359436[_0xacf6('0x25')]===_0xacf6('0x26')&&typeof _0x359436[_0xacf6('0x27')]===_0xacf6('0x26');var _0x3c4951=_0x59da1d['count'];var _0x448f93=_0x510592?0x0:_0x359436['offset'];var _0x234928=_0x510592?_0x59da1d[_0xacf6('0x28')]:_0x359436[_0xacf6('0x25')]+_0x359436[_0xacf6('0x27')];var _0x2f350f;if(_0x234928>=_0x3c4951){_0x234928=_0x3c4951;_0x2f350f=0xc8;}else{_0x2f350f=0xce;}_0x101ee0['status'](_0x2f350f);return _0x101ee0[_0xacf6('0x29')](_0xacf6('0x2a'),_0x448f93+'-'+_0x234928+'/'+_0x3c4951)[_0xacf6('0x24')](_0x59da1d);}return null;};}function patchUpdates(_0x5de50b){return function(_0x1063d3){try{jsonpatch['apply'](_0x1063d3,_0x5de50b,!![]);}catch(_0x49c014){return BPromise[_0xacf6('0x2b')](_0x49c014);}return _0x1063d3['save']();};}function saveUpdates(_0xb2d416,_0x41486f){return function(_0x23c041){if(_0x23c041){return _0x23c041[_0xacf6('0x2c')](_0xb2d416)[_0xacf6('0x2d')](function(_0x1f5eba){return _0x1f5eba;});}return null;};}function removeEntity(_0x119242,_0x4d5258){return function(_0x58e5cf){if(_0x58e5cf){return _0x58e5cf[_0xacf6('0x2e')]()[_0xacf6('0x2d')](function(){var _0x5df51c=_0x58e5cf[_0xacf6('0x2f')]({'plain':!![]});var _0xbb7765=[{'name':_0xacf6('0x30'),'value':_0xacf6('0x31'),'ignore':![]},{'name':'OutboundRoutes','value':_0xacf6('0x32'),'ignore':![]},{'name':_0xacf6('0x33'),'value':_0xacf6('0x34'),'ignore':![]}];var _0xac5d38=_(_0xbb7765)[_0xacf6('0x35')](_0xacf6('0x36'))['map'](_0xacf6('0x37'))[_0xacf6('0x37')]();if(_['includes'](_0xac5d38,_0x5df51c[_0xacf6('0x38')])){return;}var _0x4337c5=_['find'](_0xbb7765,['value',_0x5df51c['type']])[_0xacf6('0x39')];return db[_0xacf6('0x3a')]['destroy']({'where':{'type':_0x4337c5,'resourceId':_0x5df51c['id']}})['then'](function(){return _0x58e5cf;});})['then'](function(){_0x119242[_0xacf6('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25629a,_0x30906f){return function(_0x5be92d){if(!_0x5be92d){_0x25629a[_0xacf6('0x21')](0x194);}return _0x5be92d;};}function handleError(_0x1545bc,_0x66eef4){_0x66eef4=_0x66eef4||0x1f4;return function(_0xd55adf){logger[_0xacf6('0x3b')](_0xd55adf['stack']);if(_0xd55adf[_0xacf6('0x39')]){delete _0xd55adf[_0xacf6('0x39')];}_0x1545bc[_0xacf6('0x22')](_0x66eef4)[_0xacf6('0x3c')](_0xd55adf);};}exports['index']=function(_0x349044,_0x2b0269){var _0x3243e8={},_0x4d5a50={},_0x35246d={'count':0x0,'rows':[]};var _0x2ec0a0=_['map'](db[_0xacf6('0x3d')][_0xacf6('0x3e')],function(_0x33fd61){return{'name':_0x33fd61[_0xacf6('0x3f')],'type':_0x33fd61[_0xacf6('0x38')][_0xacf6('0x40')]};});_0x4d5a50['model']=_[_0xacf6('0x41')](_0x2ec0a0,_0xacf6('0x39'));_0x4d5a50['query']=_[_0xacf6('0x42')](_0x349044['query']);_0x4d5a50[_0xacf6('0x43')]=_[_0xacf6('0x44')](_0x4d5a50[_0xacf6('0x45')],_0x4d5a50[_0xacf6('0x46')]);_0x3243e8[_0xacf6('0x47')]=_[_0xacf6('0x44')](_0x4d5a50['model'],qs[_0xacf6('0x48')](_0x349044[_0xacf6('0x46')]['fields']));_0x3243e8[_0xacf6('0x47')]=_0x3243e8[_0xacf6('0x47')][_0xacf6('0x49')]?_0x3243e8[_0xacf6('0x47')]:_0x4d5a50[_0xacf6('0x45')];if(!_0x349044[_0xacf6('0x46')][_0xacf6('0x4a')](_0xacf6('0x4b'))){_0x3243e8['limit']=qs[_0xacf6('0x27')](_0x349044[_0xacf6('0x46')][_0xacf6('0x27')]);_0x3243e8[_0xacf6('0x25')]=qs[_0xacf6('0x25')](_0x349044[_0xacf6('0x46')][_0xacf6('0x25')]);}_0x3243e8[_0xacf6('0x4c')]=qs[_0xacf6('0x4d')](_0x349044['query'][_0xacf6('0x4d')]);_0x3243e8[_0xacf6('0x4e')]=qs['filters'](_['pick'](_0x349044['query'],_0x4d5a50[_0xacf6('0x43')]),_0x2ec0a0);if(_0x349044[_0xacf6('0x46')][_0xacf6('0x35')]){_0x3243e8[_0xacf6('0x4e')]=_[_0xacf6('0x4f')](_0x3243e8['where'],{'$or':_[_0xacf6('0x41')](_0x2ec0a0,function(_0x5286ce){if(_0x5286ce[_0xacf6('0x38')]!==_0xacf6('0x50')){var _0x36f210={};_0x36f210[_0x5286ce[_0xacf6('0x39')]]={'$like':'%'+_0x349044[_0xacf6('0x46')][_0xacf6('0x35')]+'%'};return _0x36f210;}})});}_0x3243e8=_[_0xacf6('0x4f')]({},_0x3243e8,_0x349044[_0xacf6('0x51')]);var _0x113dcb={'where':_0x3243e8['where']};return db[_0xacf6('0x3d')][_0xacf6('0x28')](_0x113dcb)[_0xacf6('0x2d')](function(_0x29e2ff){_0x35246d[_0xacf6('0x28')]=_0x29e2ff;if(_0x349044[_0xacf6('0x46')][_0xacf6('0x52')]){_0x3243e8[_0xacf6('0x53')]=[{'all':!![]}];}return db[_0xacf6('0x3d')]['findAll'](_0x3243e8);})['then'](function(_0x58c95e){_0x35246d[_0xacf6('0x54')]=_0x58c95e;return _0x35246d;})[_0xacf6('0x2d')](respondWithFilteredResult(_0x2b0269,_0x3243e8))[_0xacf6('0x55')](handleError(_0x2b0269,null));};exports[_0xacf6('0x56')]=function(_0x1e2857,_0x36c6a3){var _0xc739fc={'raw':![],'where':{'id':_0x1e2857[_0xacf6('0x57')]['id']}},_0x27fac4={};_0x27fac4[_0xacf6('0x45')]=_[_0xacf6('0x42')](db['VoiceExtension'][_0xacf6('0x3e')]);_0x27fac4[_0xacf6('0x46')]=_[_0xacf6('0x42')](_0x1e2857[_0xacf6('0x46')]);_0x27fac4[_0xacf6('0x43')]=_[_0xacf6('0x44')](_0x27fac4[_0xacf6('0x45')],_0x27fac4[_0xacf6('0x46')]);_0xc739fc[_0xacf6('0x47')]=_[_0xacf6('0x44')](_0x27fac4[_0xacf6('0x45')],qs[_0xacf6('0x48')](_0x1e2857['query'][_0xacf6('0x48')]));_0xc739fc[_0xacf6('0x47')]=_0xc739fc[_0xacf6('0x47')][_0xacf6('0x49')]?_0xc739fc[_0xacf6('0x47')]:_0x27fac4[_0xacf6('0x45')];if(_0x1e2857['query'][_0xacf6('0x52')]){_0xc739fc[_0xacf6('0x53')]=[{'all':!![]}];}_0xc739fc=_['merge']({},_0xc739fc,_0x1e2857[_0xacf6('0x51')]);return db['VoiceExtension']['find'](_0xc739fc)[_0xacf6('0x2d')](handleEntityNotFound(_0x36c6a3,null))['then'](respondWithResult(_0x36c6a3,null))['catch'](handleError(_0x36c6a3,null));};exports['destroy']=function(_0x3a1a6f,_0x300df9){return db[_0xacf6('0x3d')][_0xacf6('0x58')]({'where':{'id':_0x3a1a6f[_0xacf6('0x57')]['id']}})[_0xacf6('0x2d')](handleEntityNotFound(_0x300df9,null))[_0xacf6('0x2d')](removeEntity(_0x300df9,null))[_0xacf6('0x55')](handleError(_0x300df9,null));};exports['create']=function(_0x736773,_0x5e9f65){if(_0x736773[_0xacf6('0x59')]['type']===_0xacf6('0x32')&&!_[_0xacf6('0x5a')](_0x736773[_0xacf6('0x59')][_0xacf6('0x5b')],'_')){_0x736773['body'][_0xacf6('0x5b')]='_'[_0xacf6('0x5c')](_0x736773[_0xacf6('0x59')][_0xacf6('0x5b')]);}return db[_0xacf6('0x3d')][_0xacf6('0x5d')](_0x736773[_0xacf6('0x59')],{'raw':![]})['then'](function(_0x298e8d){var _0x10faa5=_0x736773[_0xacf6('0x5e')][_0xacf6('0x2f')]({'plain':!![]});if(!_0x10faa5)throw new Error(_0xacf6('0x5f'));if(_0x10faa5[_0xacf6('0x60')]===_0xacf6('0x5e')){var _0x5481da=_0x298e8d['get']({'plain':!![]});var _0x388a1c=[{'name':_0xacf6('0x30'),'value':'inbound'},{'name':_0xacf6('0x61'),'value':_0xacf6('0x32')},{'name':_0xacf6('0x33'),'value':'internal'}];var _0x5ed76d=_[_0xacf6('0x58')](_0x388a1c,[_0xacf6('0x37'),_0x5481da[_0xacf6('0x38')]])[_0xacf6('0x39')];return db[_0xacf6('0x62')][_0xacf6('0x58')]({'where':{'name':_0x5ed76d,'userProfileId':_0x10faa5['userProfileId']},'raw':!![]})['then'](function(_0x345970){if(_0x345970&&_0x345970[_0xacf6('0x63')]===0x0){return db[_0xacf6('0x3a')][_0xacf6('0x5d')]({'name':_0x5481da[_0xacf6('0x39')],'resourceId':_0x5481da['id'],'type':_0x345970[_0xacf6('0x39')],'sectionId':_0x345970['id']},{})[_0xacf6('0x2d')](function(){return _0x298e8d;});}else{return _0x298e8d;}})['catch'](function(_0x54e11d){logger[_0xacf6('0x3b')](_0xacf6('0x64'),_0x54e11d);throw _0x54e11d;});}return _0x298e8d;})[_0xacf6('0x2d')](respondWithResult(_0x5e9f65,0xc9))['catch'](handleError(_0x5e9f65,null));};exports['update']=function(_0x4b45ef,_0x10fd93){if(_0x4b45ef[_0xacf6('0x59')]['id']){delete _0x4b45ef[_0xacf6('0x59')]['id'];}return db['VoiceExtension'][_0xacf6('0x58')]({'where':{'id':_0x4b45ef[_0xacf6('0x57')]['id']}})[_0xacf6('0x2d')](handleEntityNotFound(_0x10fd93,null))[_0xacf6('0x2d')](function(_0x43372a){if(_0x43372a){return db['VoiceExtension'][_0xacf6('0x2c')](_[_0xacf6('0x65')](_0x4b45ef[_0xacf6('0x59')],['exten',_0xacf6('0x66'),'description','recordingFormat','cutdigits','mandatoryDisposition','alias']),{'where':{'context':_0x43372a[_0xacf6('0x66')],'exten':_0x43372a['exten']},'individualHooks':!![]})['then'](function(_0x531667){return _0x531667;});}return null;})['then'](respondWithStatusCode(_0x10fd93,null))[_0xacf6('0x55')](handleError(_0x10fd93,null));};exports[_0xacf6('0x67')]=function(_0x53d9ba,_0x2be141){return db[_0xacf6('0x3d')][_0xacf6('0x68')]({'where':{'id':_0x53d9ba[_0xacf6('0x57')]['id']}})[_0xacf6('0x2d')](function(_0x3f2555){if(_0x3f2555){return db[_0xacf6('0x69')][_0xacf6('0x6a')](function(_0x205b6d){return db[_0xacf6('0x3d')]['destroy']({'where':{'VoiceExtensionId':_0x53d9ba[_0xacf6('0x57')]['id']},'transaction':_0x205b6d})[_0xacf6('0x2d')](function(){var _0x5a3340=_['map'](_0x53d9ba[_0xacf6('0x59')],function(_0x81a568){_0x81a568[_0xacf6('0x6b')]=_0x53d9ba[_0xacf6('0x57')]['id'];_0x81a568[_0xacf6('0x6c')]=!![];return _0x81a568;});var _0x16edf5=_0x53d9ba['query'][_0xacf6('0x6d')]&&_0x53d9ba[_0xacf6('0x46')][_0xacf6('0x6d')]['toLowerCase']()===_0xacf6('0x6e')?!![]:![];return _0x3f2555[_0xacf6('0x6f')](_0x5a3340,_0x16edf5);})[_0xacf6('0x2d')](function(_0x233c84){return db[_0xacf6('0x3d')][_0xacf6('0x70')](_0x233c84,{'transaction':_0x205b6d});});})[_0xacf6('0x2d')](function(){return db['VoiceExtension'][_0xacf6('0x71')]({'where':{'isApp':!![],'VoiceExtensionId':_0x53d9ba[_0xacf6('0x57')]['id']},'order':_0xacf6('0x72')});});}})['then'](respondWithResult(_0x2be141,null))[_0xacf6('0x55')](handleError(_0x2be141,null));}; \ No newline at end of file +var _0xdacd=['squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','./voiceExtension.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','filter','ignore','type','find','value','name','UserProfileResource','error','stack','send','index','map','VoiceExtension','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','pick','where','merge','options','include','rows','catch','includeAll','destroy','params','startsWith','body','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','internal','UserProfileSection','userProfileId','autoAssociation','context','description','recordingFormat','mandatoryDisposition','alias','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','true','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x33a08a,_0x94441e){var _0x4a8afd=function(_0x4db6f6){while(--_0x4db6f6){_0x33a08a['push'](_0x33a08a['shift']());}};_0x4a8afd(++_0x94441e);}(_0xdacd,0x143));var _0xddac=function(_0x9f8949,_0x3c99f5){_0x9f8949=_0x9f8949-0x0;var _0x5d7a86=_0xdacd[_0x9f8949];return _0x5d7a86;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xddac('0x0'));var jsonpatch=require(_0xddac('0x1'));var rp=require(_0xddac('0x2'));var moment=require(_0xddac('0x3'));var BPromise=require(_0xddac('0x4'));var Mustache=require(_0xddac('0x5'));var util=require(_0xddac('0x6'));var path=require(_0xddac('0x7'));var sox=require(_0xddac('0x8'));var csv=require('to-csv');var ejs=require(_0xddac('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xddac('0xa'));var crypto=require('crypto');var jsforce=require(_0xddac('0xb'));var deskjs=require(_0xddac('0xc'));var toCsv=require(_0xddac('0xd'));var querystring=require(_0xddac('0xe'));var Papa=require(_0xddac('0xf'));var Redis=require(_0xddac('0x10'));var authService=require(_0xddac('0x11'));var qs=require(_0xddac('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddac('0x13'));var logger=require(_0xddac('0x14'))(_0xddac('0x15'));var utils=require(_0xddac('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xddac('0x17'));var db=require(_0xddac('0x18'))['db'];config['redis']=_['defaults'](config[_0xddac('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xddac('0x19')]));require(_0xddac('0x1a'))[_0xddac('0x1b')](socket);function respondWithStatusCode(_0x9a3c1d,_0x4d6b2b){_0x4d6b2b=_0x4d6b2b||0xcc;return function(_0x4fe5d6){if(_0x4fe5d6){return _0x9a3c1d[_0xddac('0x1c')](_0x4d6b2b);}return _0x9a3c1d['status'](_0x4d6b2b)[_0xddac('0x1d')]();};}function respondWithResult(_0x4be5e7,_0x45f787){_0x45f787=_0x45f787||0xc8;return function(_0x56313f){if(_0x56313f){return _0x4be5e7[_0xddac('0x1e')](_0x45f787)['json'](_0x56313f);}};}function respondWithFilteredResult(_0x223022,_0x1e0c2e){return function(_0x24fcda){if(_0x24fcda){var _0xa0e04=typeof _0x1e0c2e[_0xddac('0x1f')]===_0xddac('0x20')&&typeof _0x1e0c2e[_0xddac('0x21')]===_0xddac('0x20');var _0x5608e3=_0x24fcda[_0xddac('0x22')];var _0x53c8bd=_0xa0e04?0x0:_0x1e0c2e[_0xddac('0x1f')];var _0x512072=_0xa0e04?_0x24fcda[_0xddac('0x22')]:_0x1e0c2e[_0xddac('0x1f')]+_0x1e0c2e[_0xddac('0x21')];var _0x25f0a5;if(_0x512072>=_0x5608e3){_0x512072=_0x5608e3;_0x25f0a5=0xc8;}else{_0x25f0a5=0xce;}_0x223022[_0xddac('0x1e')](_0x25f0a5);return _0x223022[_0xddac('0x23')](_0xddac('0x24'),_0x53c8bd+'-'+_0x512072+'/'+_0x5608e3)[_0xddac('0x25')](_0x24fcda);}return null;};}function patchUpdates(_0x5ab427){return function(_0x191ca0){try{jsonpatch[_0xddac('0x26')](_0x191ca0,_0x5ab427,!![]);}catch(_0x190f68){return BPromise[_0xddac('0x27')](_0x190f68);}return _0x191ca0['save']();};}function saveUpdates(_0x1f7c24,_0x36d2b5){return function(_0x18e918){if(_0x18e918){return _0x18e918[_0xddac('0x28')](_0x1f7c24)[_0xddac('0x29')](function(_0x228e6c){return _0x228e6c;});}return null;};}function removeEntity(_0x112d99,_0x341647){return function(_0x1d8572){if(_0x1d8572){return _0x1d8572['destroy']()[_0xddac('0x29')](function(){var _0x54d8b3=_0x1d8572[_0xddac('0x2a')]({'plain':!![]});var _0x1f1e3e=[{'name':_0xddac('0x2b'),'value':_0xddac('0x2c'),'ignore':![]},{'name':_0xddac('0x2d'),'value':_0xddac('0x2e'),'ignore':![]},{'name':_0xddac('0x2f'),'value':'internal','ignore':![]}];var _0x52351b=_(_0x1f1e3e)[_0xddac('0x30')](_0xddac('0x31'))['map']('value')['value']();if(_['includes'](_0x52351b,_0x54d8b3[_0xddac('0x32')])){return;}var _0x278a2e=_[_0xddac('0x33')](_0x1f1e3e,[_0xddac('0x34'),_0x54d8b3['type']])[_0xddac('0x35')];return db[_0xddac('0x36')]['destroy']({'where':{'type':_0x278a2e,'resourceId':_0x54d8b3['id']}})[_0xddac('0x29')](function(){return _0x1d8572;});})[_0xddac('0x29')](function(){_0x112d99[_0xddac('0x1e')](0xcc)[_0xddac('0x1d')]();});}};}function handleEntityNotFound(_0x5c379f,_0xf0e69b){return function(_0x2b2848){if(!_0x2b2848){_0x5c379f[_0xddac('0x1c')](0x194);}return _0x2b2848;};}function handleError(_0x2bafde,_0x1fc15d){_0x1fc15d=_0x1fc15d||0x1f4;return function(_0x27e064){logger[_0xddac('0x37')](_0x27e064[_0xddac('0x38')]);if(_0x27e064[_0xddac('0x35')]){delete _0x27e064[_0xddac('0x35')];}_0x2bafde[_0xddac('0x1e')](_0x1fc15d)[_0xddac('0x39')](_0x27e064);};}exports[_0xddac('0x3a')]=function(_0x22856d,_0x11921a){var _0x5b9f89={},_0x10278c={},_0x29de68={'count':0x0,'rows':[]};var _0x905c83=_[_0xddac('0x3b')](db[_0xddac('0x3c')]['rawAttributes'],function(_0x5554da){return{'name':_0x5554da[_0xddac('0x3d')],'type':_0x5554da['type'][_0xddac('0x3e')]};});_0x10278c[_0xddac('0x3f')]=_[_0xddac('0x3b')](_0x905c83,_0xddac('0x35'));_0x10278c[_0xddac('0x40')]=_[_0xddac('0x41')](_0x22856d['query']);_0x10278c[_0xddac('0x42')]=_[_0xddac('0x43')](_0x10278c[_0xddac('0x3f')],_0x10278c[_0xddac('0x40')]);_0x5b9f89[_0xddac('0x44')]=_[_0xddac('0x43')](_0x10278c['model'],qs['fields'](_0x22856d['query'][_0xddac('0x45')]));_0x5b9f89[_0xddac('0x44')]=_0x5b9f89[_0xddac('0x44')][_0xddac('0x46')]?_0x5b9f89['attributes']:_0x10278c[_0xddac('0x3f')];if(!_0x22856d[_0xddac('0x40')][_0xddac('0x47')](_0xddac('0x48'))){_0x5b9f89[_0xddac('0x21')]=qs[_0xddac('0x21')](_0x22856d[_0xddac('0x40')][_0xddac('0x21')]);_0x5b9f89[_0xddac('0x1f')]=qs[_0xddac('0x1f')](_0x22856d['query'][_0xddac('0x1f')]);}_0x5b9f89['order']=qs['sort'](_0x22856d[_0xddac('0x40')]['sort']);_0x5b9f89['where']=qs[_0xddac('0x42')](_[_0xddac('0x49')](_0x22856d[_0xddac('0x40')],_0x10278c[_0xddac('0x42')]),_0x905c83);if(_0x22856d[_0xddac('0x40')][_0xddac('0x30')]){_0x5b9f89[_0xddac('0x4a')]=_['merge'](_0x5b9f89[_0xddac('0x4a')],{'$or':_[_0xddac('0x3b')](_0x905c83,function(_0x4ef6b2){if(_0x4ef6b2['type']!=='VIRTUAL'){var _0x48c1c8={};_0x48c1c8[_0x4ef6b2[_0xddac('0x35')]]={'$like':'%'+_0x22856d['query'][_0xddac('0x30')]+'%'};return _0x48c1c8;}})});}_0x5b9f89=_[_0xddac('0x4b')]({},_0x5b9f89,_0x22856d[_0xddac('0x4c')]);var _0x25457a={'where':_0x5b9f89['where']};return db[_0xddac('0x3c')][_0xddac('0x22')](_0x25457a)[_0xddac('0x29')](function(_0x3b4f16){_0x29de68[_0xddac('0x22')]=_0x3b4f16;if(_0x22856d[_0xddac('0x40')]['includeAll']){_0x5b9f89[_0xddac('0x4d')]=[{'all':!![]}];}return db[_0xddac('0x3c')]['findAll'](_0x5b9f89);})[_0xddac('0x29')](function(_0x4531d0){_0x29de68[_0xddac('0x4e')]=_0x4531d0;return _0x29de68;})['then'](respondWithFilteredResult(_0x11921a,_0x5b9f89))[_0xddac('0x4f')](handleError(_0x11921a,null));};exports['show']=function(_0x3a16ae,_0xddbd8a){var _0x1c7af7={'raw':![],'where':{'id':_0x3a16ae['params']['id']}},_0x252526={};_0x252526[_0xddac('0x3f')]=_[_0xddac('0x41')](db['VoiceExtension']['rawAttributes']);_0x252526[_0xddac('0x40')]=_['keys'](_0x3a16ae['query']);_0x252526['filters']=_['intersection'](_0x252526[_0xddac('0x3f')],_0x252526[_0xddac('0x40')]);_0x1c7af7[_0xddac('0x44')]=_[_0xddac('0x43')](_0x252526[_0xddac('0x3f')],qs[_0xddac('0x45')](_0x3a16ae['query']['fields']));_0x1c7af7['attributes']=_0x1c7af7[_0xddac('0x44')]['length']?_0x1c7af7[_0xddac('0x44')]:_0x252526['model'];if(_0x3a16ae['query'][_0xddac('0x50')]){_0x1c7af7[_0xddac('0x4d')]=[{'all':!![]}];}_0x1c7af7=_['merge']({},_0x1c7af7,_0x3a16ae[_0xddac('0x4c')]);return db[_0xddac('0x3c')][_0xddac('0x33')](_0x1c7af7)['then'](handleEntityNotFound(_0xddbd8a,null))[_0xddac('0x29')](respondWithResult(_0xddbd8a,null))['catch'](handleError(_0xddbd8a,null));};exports[_0xddac('0x51')]=function(_0xd97b25,_0x20b45c){return db['VoiceExtension']['find']({'where':{'id':_0xd97b25[_0xddac('0x52')]['id']}})[_0xddac('0x29')](handleEntityNotFound(_0x20b45c,null))[_0xddac('0x29')](removeEntity(_0x20b45c,null))[_0xddac('0x4f')](handleError(_0x20b45c,null));};exports['create']=function(_0x102619,_0x50dd93){if(_0x102619['body'][_0xddac('0x32')]==='outbound'&&!_[_0xddac('0x53')](_0x102619[_0xddac('0x54')][_0xddac('0x55')],'_')){_0x102619[_0xddac('0x54')][_0xddac('0x55')]='_'[_0xddac('0x56')](_0x102619[_0xddac('0x54')]['exten']);}return db[_0xddac('0x3c')][_0xddac('0x57')](_0x102619[_0xddac('0x54')],{'raw':![]})[_0xddac('0x29')](function(_0x159109){var _0x328845=_0x102619[_0xddac('0x58')][_0xddac('0x2a')]({'plain':!![]});if(!_0x328845)throw new Error(_0xddac('0x59'));if(_0x328845['role']===_0xddac('0x58')){var _0x5e1c63=_0x159109[_0xddac('0x2a')]({'plain':!![]});var _0x1766e5=[{'name':_0xddac('0x2b'),'value':_0xddac('0x2c')},{'name':'OutboundRoutes','value':_0xddac('0x2e')},{'name':_0xddac('0x2f'),'value':_0xddac('0x5a')}];var _0x7b4a0e=_[_0xddac('0x33')](_0x1766e5,['value',_0x5e1c63[_0xddac('0x32')]])['name'];return db[_0xddac('0x5b')]['find']({'where':{'name':_0x7b4a0e,'userProfileId':_0x328845[_0xddac('0x5c')]},'raw':!![]})['then'](function(_0x3aa6c6){if(_0x3aa6c6&&_0x3aa6c6[_0xddac('0x5d')]===0x0){return db[_0xddac('0x36')][_0xddac('0x57')]({'name':_0x5e1c63['name'],'resourceId':_0x5e1c63['id'],'type':_0x3aa6c6[_0xddac('0x35')],'sectionId':_0x3aa6c6['id']},{})[_0xddac('0x29')](function(){return _0x159109;});}else{return _0x159109;}})[_0xddac('0x4f')](function(_0xa26ee){logger[_0xddac('0x37')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa26ee);throw _0xa26ee;});}return _0x159109;})['then'](respondWithResult(_0x50dd93,0xc9))[_0xddac('0x4f')](handleError(_0x50dd93,null));};exports[_0xddac('0x28')]=function(_0x154b56,_0x35628d){if(_0x154b56[_0xddac('0x54')]['id']){delete _0x154b56[_0xddac('0x54')]['id'];}return db[_0xddac('0x3c')][_0xddac('0x33')]({'where':{'id':_0x154b56['params']['id']}})[_0xddac('0x29')](handleEntityNotFound(_0x35628d,null))['then'](function(_0x55c6eb){if(_0x55c6eb){return db[_0xddac('0x3c')][_0xddac('0x28')](_[_0xddac('0x49')](_0x154b56[_0xddac('0x54')],['exten',_0xddac('0x5e'),_0xddac('0x5f'),_0xddac('0x60'),'cutdigits',_0xddac('0x61'),_0xddac('0x62')]),{'where':{'context':_0x55c6eb[_0xddac('0x5e')],'exten':_0x55c6eb[_0xddac('0x55')]},'individualHooks':!![]})[_0xddac('0x29')](function(_0xebc13){return _0xebc13;});}return null;})[_0xddac('0x29')](respondWithStatusCode(_0x35628d,null))[_0xddac('0x4f')](handleError(_0x35628d,null));};exports[_0xddac('0x63')]=function(_0x1f42d3,_0x11db18){return db[_0xddac('0x3c')][_0xddac('0x64')]({'where':{'id':_0x1f42d3[_0xddac('0x52')]['id']}})[_0xddac('0x29')](function(_0x26b747){if(_0x26b747){return db[_0xddac('0x65')][_0xddac('0x66')](function(_0x3a8018){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x1f42d3[_0xddac('0x52')]['id']},'transaction':_0x3a8018})[_0xddac('0x29')](function(){var _0x272fb8=_[_0xddac('0x3b')](_0x1f42d3[_0xddac('0x54')],function(_0x40b92e){_0x40b92e[_0xddac('0x67')]=_0x1f42d3[_0xddac('0x52')]['id'];_0x40b92e[_0xddac('0x68')]=!![];return _0x40b92e;});var _0x22de7e=_0x1f42d3[_0xddac('0x40')][_0xddac('0x69')]&&_0x1f42d3[_0xddac('0x40')][_0xddac('0x69')][_0xddac('0x6a')]()===_0xddac('0x6b')?!![]:![];return _0x26b747[_0xddac('0x6c')](_0x272fb8,_0x22de7e);})[_0xddac('0x29')](function(_0x2eb0c8){return db[_0xddac('0x3c')]['bulkCreate'](_0x2eb0c8,{'transaction':_0x3a8018});});})[_0xddac('0x29')](function(){return db[_0xddac('0x3c')][_0xddac('0x6d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1f42d3['params']['id']},'order':_0xddac('0x6e')});});}})[_0xddac('0x29')](respondWithResult(_0x11db18,null))[_0xddac('0x4f')](handleError(_0x11db18,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index d348d0b..7058252 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 _0x17f0=['save','update','remove','emit','hasOwnProperty','exports','events','setMaxListeners'];(function(_0x1cc12d,_0x1325df){var _0x46395c=function(_0x230f60){while(--_0x230f60){_0x1cc12d['push'](_0x1cc12d['shift']());}};_0x46395c(++_0x1325df);}(_0x17f0,0x146));var _0x017f=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x17f0[_0x4ae6ef];return _0x3cbb4e;};'use strict';var EventEmitter=require(_0x017f('0x0'));var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x017f('0x1')](0x0);var events={'afterCreate':_0x017f('0x2'),'afterUpdate':_0x017f('0x3'),'afterDestroy':_0x017f('0x4')};function emitEvent(_0x3ec3c0){return function(_0x5a1241,_0x27e9ef,_0x12e017){VoiceExtensionEvents[_0x017f('0x5')](_0x3ec3c0+':'+_0x5a1241['id'],_0x5a1241);VoiceExtensionEvents['emit'](_0x3ec3c0,_0x5a1241);_0x12e017(null);};}for(var e in events){if(events[_0x017f('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x017f('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0x8a73=['remove','emit','hasOwnProperty','hook','events','VoiceExtension','setMaxListeners','update'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x8a73,0x11c));var _0x38a7=function(_0x4e2e6e,_0xafe3d3){_0x4e2e6e=_0x4e2e6e-0x0;var _0xac69b9=_0x8a73[_0x4e2e6e];return _0xac69b9;};'use strict';var EventEmitter=require(_0x38a7('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x38a7('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x38a7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x38a7('0x3'),'afterDestroy':_0x38a7('0x4')};function emitEvent(_0x2d74f0){return function(_0x24f537,_0x13330c,_0x4dd9c9){VoiceExtensionEvents[_0x38a7('0x5')](_0x2d74f0+':'+_0x24f537['id'],_0x24f537);VoiceExtensionEvents[_0x38a7('0x5')](_0x2d74f0,_0x24f537);_0x4dd9c9(null);};}for(var e in events){if(events[_0x38a7('0x6')](e)){var event=events[e];VoiceExtension[_0x38a7('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 98e8ecf..fe3f956 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 _0x8145=['catch','define','VoiceExtension','Hangup','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','CDR(type)=outbound','CDR(routeAlias)=','outbound','CDR(destination)=','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','cutdigits','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','name','param','split','prefix','phone','SIP','join','none','indexOf','U(xcally-mixmonitor-context)','replace','Interval','IntervalId','then','interval','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','length','answer','queue','playback','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','appdata','priority','concat','last'];(function(_0x986cc4,_0x1c3717){var _0x55cec2=function(_0x261b36){while(--_0x261b36){_0x986cc4['push'](_0x986cc4['shift']());}};_0x55cec2(++_0x1c3717);}(_0x8145,0xa8));var _0x5814=function(_0x3e308c,_0x4691cb){_0x3e308c=_0x3e308c-0x0;var _0x651441=_0x8145[_0x3e308c];return _0x651441;};'use strict';var util=require('util');var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0x5814('0x0')]=function(_0x2d7380){var _0x3ecb37=_0x2d7380[_0x5814('0x1')];function _0x3102a7(_0xc3c381){var _0xbf2cf1=0x2;var _0x1f5e2a=[{'type':_0xc3c381[_0x5814('0x2')],'app':_0x5814('0x3'),'appdata':_0x5814('0x4')+_0xc3c381[_0x5814('0x2')],'context':_0xc3c381[_0x5814('0x5')],'exten':_0xc3c381[_0x5814('0x6')],'priority':_0xbf2cf1++,'VoiceExtensionId':_0xc3c381['id']},{'type':_0xc3c381['type'],'app':_0xc3c381[_0x5814('0x7')]?_0x5814('0x3'):_0x5814('0x8'),'appdata':_0xc3c381[_0x5814('0x7')]?'CDR(routeAlias)='+_0xc3c381[_0x5814('0x7')]:_0x5814('0x9'),'context':_0xc3c381['context'],'exten':_0xc3c381[_0x5814('0x6')],'priority':_0xbf2cf1++,'VoiceExtensionId':_0xc3c381['id']}];if(_0xc3c381[_0x5814('0x2')]===_0x5814('0xa')){_0x1f5e2a[_0x5814('0xb')]({'type':_0x5814('0xa'),'app':_0x5814('0x3'),'appdata':_0x5814('0xc')+_0xc3c381['id'],'context':_0xc3c381[_0x5814('0x5')],'exten':_0xc3c381[_0x5814('0x6')],'priority':_0xbf2cf1++,'VoiceExtensionId':_0xc3c381['id']});}_0x1f5e2a[_0x5814('0xb')]({'type':_0xc3c381['type'],'app':'Set','appdata':_0x5814('0xd'),'context':_0xc3c381[_0x5814('0x5')],'exten':_0xc3c381[_0x5814('0x6')],'priority':_0xbf2cf1++,'VoiceExtensionId':_0xc3c381['id']},{'type':_0xc3c381[_0x5814('0x2')],'app':_0x5814('0x3'),'appdata':_0x5814('0xe'),'context':_0xc3c381[_0x5814('0x5')],'exten':_0xc3c381[_0x5814('0x6')],'priority':_0xbf2cf1++,'VoiceExtensionId':_0xc3c381['id']},{'type':_0xc3c381[_0x5814('0x2')],'app':_0x5814('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0xc3c381['context'],'exten':_0xc3c381[_0x5814('0x6')],'priority':_0xbf2cf1++,'VoiceExtensionId':_0xc3c381['id']});return _0x1f5e2a;}function _0x5e0179(_0x5951c3){var _0x3a9aec=0x2;var _0x423db5=[{'type':'outbound','app':_0x5814('0x3'),'appdata':_0x5814('0xf'),'context':_0x5951c3[_0x5814('0x5')],'exten':_0x5951c3[_0x5814('0x6')],'priority':_0x3a9aec++,'VoiceExtensionId':_0x5951c3['id']},{'type':'outbound','app':_0x5951c3[_0x5814('0x7')]?_0x5814('0x3'):_0x5814('0x8'),'appdata':_0x5951c3[_0x5814('0x7')]?_0x5814('0x10')+_0x5951c3[_0x5814('0x7')]:_0x5814('0x9'),'context':_0x5951c3[_0x5814('0x5')],'exten':_0x5951c3['exten'],'priority':_0x3a9aec++,'VoiceExtensionId':_0x5951c3['id']},{'type':_0x5814('0x11'),'app':_0x5814('0x3'),'appdata':_0x5814('0x12')+(_0x5951c3['cutdigits']?_0x5814('0x13')+_0x5951c3['cutdigits']+'}':_0x5814('0x14')),'context':_0x5951c3[_0x5814('0x5')],'exten':_0x5951c3[_0x5814('0x6')],'priority':_0x3a9aec++,'VoiceExtensionId':_0x5951c3['id']},{'type':_0x5814('0x11'),'app':_0x5814('0x3'),'appdata':_0x5814('0xc')+_0x5951c3['id'],'context':_0x5951c3[_0x5814('0x5')],'exten':_0x5951c3['exten'],'priority':_0x3a9aec++,'VoiceExtensionId':_0x5951c3['id']},{'type':_0x5814('0x11'),'app':_0x5814('0x15'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3a9aec+0x2)+_0x5814('0x16')+(_0x3a9aec+0x1)+')','context':_0x5951c3['context'],'exten':_0x5951c3[_0x5814('0x6')],'priority':_0x3a9aec++,'VoiceExtensionId':_0x5951c3['id']},{'type':_0x5814('0x11'),'app':_0x5814('0x3'),'appdata':_0x5951c3['cutdigits']?_0x5814('0x17')+_0x5951c3[_0x5814('0x18')]+'}':_0x5814('0x19'),'context':_0x5951c3[_0x5814('0x5')],'exten':_0x5951c3['exten'],'priority':_0x3a9aec++,'VoiceExtensionId':_0x5951c3['id']},{'type':_0x5814('0x11'),'app':_0x5814('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x5951c3[_0x5814('0x5')],'exten':_0x5951c3[_0x5814('0x6')],'priority':_0x3a9aec++,'VoiceExtensionId':_0x5951c3['id']},{'type':_0x5814('0x11'),'app':'Set','appdata':_0x5814('0xe'),'context':_0x5951c3['context'],'exten':_0x5951c3['exten'],'priority':_0x3a9aec++,'VoiceExtensionId':_0x5951c3['id']},{'type':_0x5814('0x11'),'app':_0x5814('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x5951c3[_0x5814('0x5')],'exten':_0x5951c3['exten'],'priority':_0x3a9aec++,'VoiceExtensionId':_0x5951c3['id']},{'type':'outbound','app':'Set','appdata':_0x5814('0x1a')+_0x5951c3['id'],'context':_0x5951c3[_0x5814('0x5')],'exten':_0x5951c3['exten'],'priority':_0x3a9aec++,'VoiceExtensionId':_0x5951c3['id']}];if(_0x5951c3['hasOwnProperty'](_0x5814('0x1b'))&&_0x5951c3[_0x5814('0x1b')]!=='none'){_0x423db5[_0x5814('0xb')]({'type':_0x5814('0x11'),'app':_0x5814('0x3'),'appdata':_0x5814('0x1c'),'context':_0x5951c3[_0x5814('0x5')],'exten':_0x5951c3[_0x5814('0x6')],'priority':_0x3a9aec++,'VoiceExtensionId':_0x5951c3['id']},{'type':'outbound','app':'Set','appdata':_0x5814('0x1d')+_0x5951c3[_0x5814('0x1b')]||_0x5814('0x1e'),'context':_0x5951c3['context'],'exten':_0x5951c3[_0x5814('0x6')],'priority':_0x3a9aec++,'VoiceExtensionId':_0x5951c3['id']});}return _0x423db5;}function _0x5e93cf(_0x35b1c6){var _0x5544b4=[{'name':_0x5814('0x1f'),'param':0x0},{'name':_0x5814('0x20'),'param':0x1},{'name':_0x5814('0x21'),'param':0x2},{'name':_0x5814('0x22'),'param':0x3}];var _0x361869={};var _0x5b50f6=_0x35b1c6['split'](',');var _0x2c4fc7=[];for(var _0x8891a4=0x0;_0x8891a4<_0x5544b4['length'];_0x8891a4++){switch(_0x5544b4[_0x8891a4][_0x5814('0x23')]){case _0x5814('0x1f'):_0x361869[_0x5814('0x1f')]=_0x5b50f6[_0x5544b4[_0x8891a4]['param']]['split']('/')[0x1];_0x361869['phone']=_0x5b50f6[_0x5544b4[_0x8891a4][_0x5814('0x24')]][_0x5814('0x25')]('/')[0x2];_0x361869[_0x5814('0x26')]=_0x361869['phone']?_0x361869[_0x5814('0x27')][_0x5814('0x25')]('$')[0x0]:undefined;_0x361869[_0x5814('0x27')]=route[_0x5814('0x18')]?(_0x361869[_0x5814('0x26')]||'')+_0x5814('0x13')+route[_0x5814('0x18')]+'}':(_0x361869[_0x5814('0x26')]||'')+_0x5814('0x14');_0x2c4fc7[_0x5544b4[_0x8891a4][_0x5814('0x24')]]=[_0x5814('0x28'),_0x361869[_0x5814('0x1f')],_0x361869[_0x5814('0x27')]][_0x5814('0x29')]('/');break;case _0x5814('0x21'):_0x361869[_0x5814('0x21')]=_0x5b50f6[_0x5544b4[_0x8891a4]['param']];if(route[_0x5814('0x1b')]!==_0x5814('0x2a')){if(_0x361869['options'][_0x5814('0x2b')](_0x5814('0x2c'))<0x0){_0x361869[_0x5814('0x21')]+=_0x5814('0x2c');}}else{_0x361869['options']=_0x361869['options'][_0x5814('0x2d')]('U(xcally-mixmonitor-context)','');}_0x2c4fc7[_0x5544b4[_0x8891a4][_0x5814('0x24')]]=_0x361869[_0x5814('0x21')];break;default:_0x2c4fc7[_0x5544b4[_0x8891a4][_0x5814('0x24')]]=_0x5b50f6[_0x5544b4[_0x8891a4]['param']];}}return _0x2c4fc7[_0x5814('0x29')](',');}function _0x5b8900(_0x1feaa7,_0x46f379,_0x4b7eb2,_0x175a91){return new Promise(function(_0x10445a,_0x42ba3c){var _0x1c6db3=[];if(_['isEmpty'](_0x46f379))return _0x10445a(_0x1c6db3);_0x3ecb37[_0x5814('0x2e')]['findAll']({'attributes':['id','interval',_0x5814('0x2f')],'raw':!![]})[_0x5814('0x30')](function(_0x550115){for(var _0x58cc95=0x0,_0x23adc8=0x0;_0x58cc95<_0x46f379['length'];_0x58cc95++,_0x23adc8=0x0){var _0x2cf292=_0x46f379[_0x58cc95];var _0x1dcd9a=[];var _0x3e2ff5=[];if(_0x2cf292[_0x5814('0x31')]!==_0x5814('0x32')){_0x2cf292[_0x5814('0x33')]=[_0x2cf292['interval']];}else{_0x2cf292[_0x5814('0x33')]=_0x2cf292['IntervalId']?_[_0x5814('0x34')](_[_0x5814('0x35')](_0x550115,{'IntervalId':_0x2cf292['IntervalId']}),_0x5814('0x31')):[];}_0x2cf292[_0x5814('0x5')]=_0x1feaa7[_0x5814('0x5')];_0x2cf292[_0x5814('0x6')]=_0x1feaa7[_0x5814('0x6')];if(_0x2cf292['type'])_0x2cf292[_0x5814('0x2')]=_0x2cf292[_0x5814('0x2')][_0x5814('0x36')]();if(_0x1feaa7[_0x5814('0x2')]===_0x5814('0x11')){if(_0x2cf292['hasOwnProperty'](_0x5814('0x37'))&&_0x2cf292['tag']&&_0x2cf292['tag']!=='--'){_0x1dcd9a[_0x5814('0xb')]({'type':_0x2cf292[_0x5814('0x2')][_0x5814('0x36')](),'app':'Set','appdata':_0x5814('0x38')+_0x2cf292[_0x5814('0x37')],'context':_0x1feaa7[_0x5814('0x5')],'exten':_0x1feaa7['exten'],'priority':_0x2cf292['intervals']['length']+_0x4b7eb2+_0x23adc8++,'VoiceExtensionId':_0x1feaa7['id']});}_0x1dcd9a[_0x5814('0xb')]({'type':_0x2cf292[_0x5814('0x2')][_0x5814('0x36')](),'app':_0x5814('0x15'),'appdata':_0x5814('0x39')+(_0x2cf292[_0x5814('0x3a')]?_0x5814('0x3b')+_0x2cf292['callerID']+')':_0x5814('0x3c')),'context':_0x1feaa7[_0x5814('0x5')],'exten':_0x1feaa7[_0x5814('0x6')],'priority':_0x2cf292['intervals'][_0x5814('0x3d')]+_0x4b7eb2+_0x23adc8++,'VoiceExtensionId':_0x1feaa7['id']});}else{if(_0x2cf292['hasOwnProperty'](_0x5814('0x3e'))){if([_0x5814('0x3f'),_0x5814('0x40')]['includes'](_0x2cf292[_0x5814('0x41')]['toLowerCase']())&&_0x2cf292[_0x5814('0x42')]!==_0x5814('0x43')){if(_0x2cf292[_0x5814('0x3e')]){_0x1dcd9a[_0x5814('0xb')]({'type':_0x2cf292[_0x5814('0x2')]['toLowerCase'](),'app':_0x5814('0x15'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x1feaa7[_0x5814('0x5')],'exten':_0x1feaa7['exten'],'priority':_0x2cf292[_0x5814('0x33')][_0x5814('0x3d')]+_0x4b7eb2+_0x23adc8++,'VoiceExtensionId':_0x1feaa7['id']});_0x1dcd9a[_0x5814('0xb')]({'type':_0x2cf292[_0x5814('0x2')][_0x5814('0x36')](),'app':_0x5814('0x3'),'appdata':_0x5814('0x44'),'context':_0x1feaa7[_0x5814('0x5')],'exten':_0x1feaa7[_0x5814('0x6')],'priority':_0x2cf292['intervals'][_0x5814('0x3d')]+_0x4b7eb2+_0x23adc8++,'VoiceExtensionId':_0x1feaa7['id']});}else{_0x1dcd9a[_0x5814('0xb')]({'type':_0x2cf292['type']['toLowerCase'](),'app':_0x5814('0x15'),'appdata':_0x5814('0x45'),'context':_0x1feaa7[_0x5814('0x5')],'exten':_0x1feaa7[_0x5814('0x6')],'priority':_0x2cf292['intervals'][_0x5814('0x3d')]+_0x4b7eb2+_0x23adc8++,'VoiceExtensionId':_0x1feaa7['id']});_0x1dcd9a[_0x5814('0xb')]({'type':_0x2cf292[_0x5814('0x2')][_0x5814('0x36')](),'app':_0x5814('0x3'),'appdata':_0x5814('0x46'),'context':_0x1feaa7[_0x5814('0x5')],'exten':_0x1feaa7[_0x5814('0x6')],'priority':_0x2cf292[_0x5814('0x33')]['length']+_0x4b7eb2+_0x23adc8++,'VoiceExtensionId':_0x1feaa7['id']});}}}}for(var _0x5f3002=0x0;_0x5f3002<_0x2cf292[_0x5814('0x33')][_0x5814('0x3d')];_0x5f3002++){var _0x380417=_0x4b7eb2+_0x2cf292[_0x5814('0x33')][_0x5814('0x3d')];var _0x15987d=_0x5f3002===_0x2cf292['intervals'][_0x5814('0x3d')]-0x1?_0x4b7eb2+_0x1dcd9a[_0x5814('0x3d')]+_0x3e2ff5[_0x5814('0x3d')]+0x2:_0x4b7eb2+_0x5f3002+0x1;_0x1dcd9a[_0x5814('0x47')](_0x5f3002,0x0,{'type':_0x1feaa7[_0x5814('0x2')],'app':'GotoIfTime','appdata':_0x2cf292[_0x5814('0x33')][_0x5f3002]+'?'+_0x1feaa7['context']+_0x5814('0x48')+_0x380417+':'+_0x1feaa7[_0x5814('0x5')]+_0x5814('0x48')+_0x15987d,'exten':_0x1feaa7['exten'],'context':_0x1feaa7[_0x5814('0x5')],'priority':_0x4b7eb2+_0x5f3002,'VoiceExtensionId':_0x1feaa7['id']});}if(_0x175a91&&_0x2cf292[_0x5814('0x42')]===_0x5814('0x49'))_0x2cf292[_0x5814('0x4a')]=_0x5e93cf(_0x2cf292['appdata']);_0x2cf292[_0x5814('0x4b')]=_0x1dcd9a[_0x5814('0x3d')]?_['last'](_0x1dcd9a)['priority']+0x1:_0x4b7eb2;_0x1c6db3=_[_0x5814('0x4c')](_0x1c6db3,_0x1dcd9a,[_0x2cf292],_0x3e2ff5);_0x4b7eb2=_[_0x5814('0x4d')](_0x1c6db3)[_0x5814('0x4b')]+0x1;}return _0x10445a(_0x1c6db3);})[_0x5814('0x4e')](function(_0x59ae1b){_0x42ba3c(_0x59ae1b);});});}return _0x2d7380[_0x5814('0x4f')](_0x5814('0x50'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3caf42,_0x377f56){var _0x4543ee=this;var _0x2008b4=_0x4543ee[_0x5814('0x2')]==='outbound'?_0x5e0179(_0x4543ee):_0x3102a7(_0x4543ee);return _0x5b8900(_0x4543ee,_0x3caf42,_['last'](_0x2008b4)[_0x5814('0x4b')]+0x1,_0x377f56)[_0x5814('0x30')](function(_0x4293cf){var _0x2f3b62=_['concat'](_0x2008b4,_0x4293cf);_0x2f3b62['push']({'type':_0x4543ee['type'],'app':_0x5814('0x51'),'exten':_0x4543ee[_0x5814('0x6')],'context':_0x4543ee[_0x5814('0x5')],'priority':_[_0x5814('0x4d')](_0x2f3b62)[_0x5814('0x4b')]+0x1,'VoiceExtensionId':_0x4543ee['id']});return _0x2f3b62;});}}});}; \ No newline at end of file +var _0x247e=['map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','answer','queue','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appdata','priority','last','define','VoiceExtension','voice_extensions','Hangup','util','lodash','./voiceExtension.attributes','exports','models','CDR(type)=','type','alias','Set','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','options','length','trunk','param','phone','split','prefix','${EXTEN}','SIP','U(xcally-mixmonitor-context)','replace','join','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals'];(function(_0x2dc04b,_0x276482){var _0x2a9064=function(_0x3d5c7d){while(--_0x3d5c7d){_0x2dc04b['push'](_0x2dc04b['shift']());}};_0x2a9064(++_0x276482);}(_0x247e,0x1a0));var _0xe247=function(_0x4059c4,_0x1e8014){_0x4059c4=_0x4059c4-0x0;var _0x53fd8a=_0x247e[_0x4059c4];return _0x53fd8a;};'use strict';var util=require(_0xe247('0x0'));var _=require(_0xe247('0x1'));var attributes=require(_0xe247('0x2'));module[_0xe247('0x3')]=function(_0x44ae62){var _0xda6870=_0x44ae62[_0xe247('0x4')];function _0x436d73(_0x5624bd){var _0x52cb75=0x2;var _0x2674d0=[{'type':_0x5624bd['type'],'app':'Set','appdata':_0xe247('0x5')+_0x5624bd[_0xe247('0x6')],'context':_0x5624bd['context'],'exten':_0x5624bd['exten'],'priority':_0x52cb75++,'VoiceExtensionId':_0x5624bd['id']},{'type':_0x5624bd[_0xe247('0x6')],'app':_0x5624bd[_0xe247('0x7')]?_0xe247('0x8'):_0xe247('0x9'),'appdata':_0x5624bd[_0xe247('0x7')]?_0xe247('0xa')+_0x5624bd[_0xe247('0x7')]:_0xe247('0xb'),'context':_0x5624bd[_0xe247('0xc')],'exten':_0x5624bd[_0xe247('0xd')],'priority':_0x52cb75++,'VoiceExtensionId':_0x5624bd['id']}];if(_0x5624bd[_0xe247('0x6')]===_0xe247('0xe')){_0x2674d0[_0xe247('0xf')]({'type':_0xe247('0xe'),'app':_0xe247('0x8'),'appdata':_0xe247('0x10')+_0x5624bd['id'],'context':_0x5624bd[_0xe247('0xc')],'exten':_0x5624bd[_0xe247('0xd')],'priority':_0x52cb75++,'VoiceExtensionId':_0x5624bd['id']});}_0x2674d0['push']({'type':_0x5624bd['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x5624bd[_0xe247('0xc')],'exten':_0x5624bd[_0xe247('0xd')],'priority':_0x52cb75++,'VoiceExtensionId':_0x5624bd['id']},{'type':_0x5624bd[_0xe247('0x6')],'app':_0xe247('0x8'),'appdata':_0xe247('0x11'),'context':_0x5624bd[_0xe247('0xc')],'exten':_0x5624bd[_0xe247('0xd')],'priority':_0x52cb75++,'VoiceExtensionId':_0x5624bd['id']},{'type':_0x5624bd['type'],'app':_0xe247('0x8'),'appdata':_0xe247('0x12'),'context':_0x5624bd['context'],'exten':_0x5624bd[_0xe247('0xd')],'priority':_0x52cb75++,'VoiceExtensionId':_0x5624bd['id']});return _0x2674d0;}function _0x1bcacc(_0x402ec3){var _0x482cf7=0x2;var _0x4a5ad5=[{'type':_0xe247('0x13'),'app':_0xe247('0x8'),'appdata':_0xe247('0x14'),'context':_0x402ec3[_0xe247('0xc')],'exten':_0x402ec3['exten'],'priority':_0x482cf7++,'VoiceExtensionId':_0x402ec3['id']},{'type':_0xe247('0x13'),'app':_0x402ec3[_0xe247('0x7')]?_0xe247('0x8'):_0xe247('0x9'),'appdata':_0x402ec3[_0xe247('0x7')]?_0xe247('0xa')+_0x402ec3['alias']:'No\x20alias\x20set','context':_0x402ec3['context'],'exten':_0x402ec3[_0xe247('0xd')],'priority':_0x482cf7++,'VoiceExtensionId':_0x402ec3['id']},{'type':_0xe247('0x13'),'app':_0xe247('0x8'),'appdata':'CDR(destination)='+(_0x402ec3[_0xe247('0x15')]?_0xe247('0x16')+_0x402ec3[_0xe247('0x15')]+'}':'${EXTEN}'),'context':_0x402ec3['context'],'exten':_0x402ec3[_0xe247('0xd')],'priority':_0x482cf7++,'VoiceExtensionId':_0x402ec3['id']},{'type':_0xe247('0x13'),'app':_0xe247('0x8'),'appdata':_0xe247('0x10')+_0x402ec3['id'],'context':_0x402ec3[_0xe247('0xc')],'exten':_0x402ec3['exten'],'priority':_0x482cf7++,'VoiceExtensionId':_0x402ec3['id']},{'type':_0xe247('0x13'),'app':_0xe247('0x17'),'appdata':_0xe247('0x18')+(_0x482cf7+0x2)+'):Goto('+(_0x482cf7+0x1)+')','context':_0x402ec3[_0xe247('0xc')],'exten':_0x402ec3[_0xe247('0xd')],'priority':_0x482cf7++,'VoiceExtensionId':_0x402ec3['id']},{'type':_0xe247('0x13'),'app':_0xe247('0x8'),'appdata':_0x402ec3[_0xe247('0x15')]?_0xe247('0x19')+_0x402ec3[_0xe247('0x15')]+'}':_0xe247('0x1a'),'context':_0x402ec3[_0xe247('0xc')],'exten':_0x402ec3[_0xe247('0xd')],'priority':_0x482cf7++,'VoiceExtensionId':_0x402ec3['id']},{'type':_0xe247('0x13'),'app':_0xe247('0x8'),'appdata':_0xe247('0x1b'),'context':_0x402ec3[_0xe247('0xc')],'exten':_0x402ec3[_0xe247('0xd')],'priority':_0x482cf7++,'VoiceExtensionId':_0x402ec3['id']},{'type':_0xe247('0x13'),'app':_0xe247('0x8'),'appdata':_0xe247('0x11'),'context':_0x402ec3[_0xe247('0xc')],'exten':_0x402ec3[_0xe247('0xd')],'priority':_0x482cf7++,'VoiceExtensionId':_0x402ec3['id']},{'type':_0xe247('0x13'),'app':'Set','appdata':_0xe247('0x12'),'context':_0x402ec3['context'],'exten':_0x402ec3['exten'],'priority':_0x482cf7++,'VoiceExtensionId':_0x402ec3['id']},{'type':_0xe247('0x13'),'app':_0xe247('0x8'),'appdata':_0xe247('0x1c')+_0x402ec3['id'],'context':_0x402ec3[_0xe247('0xc')],'exten':_0x402ec3[_0xe247('0xd')],'priority':_0x482cf7++,'VoiceExtensionId':_0x402ec3['id']}];if(_0x402ec3['hasOwnProperty'](_0xe247('0x1d'))&&_0x402ec3[_0xe247('0x1d')]!==_0xe247('0x1e')){_0x4a5ad5[_0xe247('0xf')]({'type':'outbound','app':_0xe247('0x8'),'appdata':_0xe247('0x1f'),'context':_0x402ec3[_0xe247('0xc')],'exten':_0x402ec3[_0xe247('0xd')],'priority':_0x482cf7++,'VoiceExtensionId':_0x402ec3['id']},{'type':_0xe247('0x13'),'app':_0xe247('0x8'),'appdata':_0xe247('0x20')+_0x402ec3[_0xe247('0x1d')]||'wav','context':_0x402ec3[_0xe247('0xc')],'exten':_0x402ec3[_0xe247('0xd')],'priority':_0x482cf7++,'VoiceExtensionId':_0x402ec3['id']});}return _0x4a5ad5;}function _0x12e634(_0x347f02){var _0x41e7d4=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0xe247('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0x16e4c1={};var _0x48973d=_0x347f02['split'](',');var _0x4217f4=[];for(var _0x1fd767=0x0;_0x1fd767<_0x41e7d4[_0xe247('0x22')];_0x1fd767++){switch(_0x41e7d4[_0x1fd767]['name']){case'trunk':_0x16e4c1[_0xe247('0x23')]=_0x48973d[_0x41e7d4[_0x1fd767][_0xe247('0x24')]]['split']('/')[0x1];_0x16e4c1[_0xe247('0x25')]=_0x48973d[_0x41e7d4[_0x1fd767][_0xe247('0x24')]][_0xe247('0x26')]('/')[0x2];_0x16e4c1[_0xe247('0x27')]=_0x16e4c1[_0xe247('0x25')]?_0x16e4c1[_0xe247('0x25')][_0xe247('0x26')]('$')[0x0]:undefined;_0x16e4c1[_0xe247('0x25')]=route[_0xe247('0x15')]?(_0x16e4c1[_0xe247('0x27')]||'')+_0xe247('0x16')+route[_0xe247('0x15')]+'}':(_0x16e4c1[_0xe247('0x27')]||'')+_0xe247('0x28');_0x4217f4[_0x41e7d4[_0x1fd767]['param']]=[_0xe247('0x29'),_0x16e4c1[_0xe247('0x23')],_0x16e4c1[_0xe247('0x25')]]['join']('/');break;case _0xe247('0x21'):_0x16e4c1[_0xe247('0x21')]=_0x48973d[_0x41e7d4[_0x1fd767][_0xe247('0x24')]];if(route[_0xe247('0x1d')]!==_0xe247('0x1e')){if(_0x16e4c1[_0xe247('0x21')]['indexOf'](_0xe247('0x2a'))<0x0){_0x16e4c1['options']+='U(xcally-mixmonitor-context)';}}else{_0x16e4c1[_0xe247('0x21')]=_0x16e4c1[_0xe247('0x21')][_0xe247('0x2b')](_0xe247('0x2a'),'');}_0x4217f4[_0x41e7d4[_0x1fd767][_0xe247('0x24')]]=_0x16e4c1['options'];break;default:_0x4217f4[_0x41e7d4[_0x1fd767][_0xe247('0x24')]]=_0x48973d[_0x41e7d4[_0x1fd767][_0xe247('0x24')]];}}return _0x4217f4[_0xe247('0x2c')](',');}function _0x4959a7(_0x50d80b,_0x56df56,_0x41160f,_0x38cfbc){return new Promise(function(_0x329181,_0x335ced){var _0x4efa38=[];if(_['isEmpty'](_0x56df56))return _0x329181(_0x4efa38);_0xda6870[_0xe247('0x2d')][_0xe247('0x2e')]({'attributes':['id',_0xe247('0x2f'),_0xe247('0x30')],'raw':!![]})[_0xe247('0x31')](function(_0x11756a){for(var _0x5022b2=0x0,_0x227f38=0x0;_0x5022b2<_0x56df56[_0xe247('0x22')];_0x5022b2++,_0x227f38=0x0){var _0x37f14e=_0x56df56[_0x5022b2];var _0x4f7ca0=[];var _0x4081ff=[];if(_0x37f14e[_0xe247('0x2f')]!==_0xe247('0x32')){_0x37f14e[_0xe247('0x33')]=[_0x37f14e['interval']];}else{_0x37f14e[_0xe247('0x33')]=_0x37f14e[_0xe247('0x30')]?_[_0xe247('0x34')](_[_0xe247('0x35')](_0x11756a,{'IntervalId':_0x37f14e[_0xe247('0x30')]}),_0xe247('0x2f')):[];}_0x37f14e[_0xe247('0xc')]=_0x50d80b[_0xe247('0xc')];_0x37f14e[_0xe247('0xd')]=_0x50d80b[_0xe247('0xd')];if(_0x37f14e[_0xe247('0x6')])_0x37f14e[_0xe247('0x6')]=_0x37f14e[_0xe247('0x6')][_0xe247('0x36')]();if(_0x50d80b[_0xe247('0x6')]===_0xe247('0x13')){if(_0x37f14e[_0xe247('0x37')]('tag')&&_0x37f14e[_0xe247('0x38')]&&_0x37f14e[_0xe247('0x38')]!=='--'){_0x4f7ca0['push']({'type':_0x37f14e[_0xe247('0x6')][_0xe247('0x36')](),'app':'Set','appdata':_0xe247('0x39')+_0x37f14e['tag'],'context':_0x50d80b[_0xe247('0xc')],'exten':_0x50d80b['exten'],'priority':_0x37f14e[_0xe247('0x33')][_0xe247('0x22')]+_0x41160f+_0x227f38++,'VoiceExtensionId':_0x50d80b['id']});}_0x4f7ca0['push']({'type':_0x37f14e[_0xe247('0x6')][_0xe247('0x36')](),'app':'ExecIf','appdata':_0xe247('0x3a')+(_0x37f14e[_0xe247('0x3b')]?'Set(CALLERID(all)='+_0x37f14e[_0xe247('0x3b')]+')':'NoOp(No\x20number\x20available)'),'context':_0x50d80b[_0xe247('0xc')],'exten':_0x50d80b['exten'],'priority':_0x37f14e[_0xe247('0x33')]['length']+_0x41160f+_0x227f38++,'VoiceExtensionId':_0x50d80b['id']});}else{if(_0x37f14e[_0xe247('0x37')](_0xe247('0x3c'))){if([_0xe247('0x3d'),_0xe247('0x3e')][_0xe247('0x3f')](_0x37f14e[_0xe247('0x40')][_0xe247('0x36')]())&&_0x37f14e[_0xe247('0x41')]!==_0xe247('0x42')){if(_0x37f14e['answer']){_0x4f7ca0[_0xe247('0xf')]({'type':_0x37f14e[_0xe247('0x6')][_0xe247('0x36')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x50d80b[_0xe247('0xc')],'exten':_0x50d80b[_0xe247('0xd')],'priority':_0x37f14e[_0xe247('0x33')]['length']+_0x41160f+_0x227f38++,'VoiceExtensionId':_0x50d80b['id']});_0x4f7ca0[_0xe247('0xf')]({'type':_0x37f14e[_0xe247('0x6')][_0xe247('0x36')](),'app':_0xe247('0x8'),'appdata':_0xe247('0x43'),'context':_0x50d80b['context'],'exten':_0x50d80b[_0xe247('0xd')],'priority':_0x37f14e[_0xe247('0x33')][_0xe247('0x22')]+_0x41160f+_0x227f38++,'VoiceExtensionId':_0x50d80b['id']});}else{_0x4f7ca0['push']({'type':_0x37f14e[_0xe247('0x6')][_0xe247('0x36')](),'app':_0xe247('0x17'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x50d80b['context'],'exten':_0x50d80b[_0xe247('0xd')],'priority':_0x37f14e['intervals'][_0xe247('0x22')]+_0x41160f+_0x227f38++,'VoiceExtensionId':_0x50d80b['id']});_0x4f7ca0[_0xe247('0xf')]({'type':_0x37f14e['type'][_0xe247('0x36')](),'app':_0xe247('0x8'),'appdata':_0xe247('0x44'),'context':_0x50d80b[_0xe247('0xc')],'exten':_0x50d80b[_0xe247('0xd')],'priority':_0x37f14e['intervals'][_0xe247('0x22')]+_0x41160f+_0x227f38++,'VoiceExtensionId':_0x50d80b['id']});}}}}for(var _0x5079c6=0x0;_0x5079c6<_0x37f14e[_0xe247('0x33')][_0xe247('0x22')];_0x5079c6++){var _0x47ec7d=_0x41160f+_0x37f14e['intervals'][_0xe247('0x22')];var _0x2958fb=_0x5079c6===_0x37f14e[_0xe247('0x33')][_0xe247('0x22')]-0x1?_0x41160f+_0x4f7ca0[_0xe247('0x22')]+_0x4081ff[_0xe247('0x22')]+0x2:_0x41160f+_0x5079c6+0x1;_0x4f7ca0['splice'](_0x5079c6,0x0,{'type':_0x50d80b['type'],'app':_0xe247('0x45'),'appdata':_0x37f14e[_0xe247('0x33')][_0x5079c6]+'?'+_0x50d80b['context']+_0xe247('0x46')+_0x47ec7d+':'+_0x50d80b[_0xe247('0xc')]+',${EXTEN},'+_0x2958fb,'exten':_0x50d80b['exten'],'context':_0x50d80b['context'],'priority':_0x41160f+_0x5079c6,'VoiceExtensionId':_0x50d80b['id']});}if(_0x38cfbc&&_0x37f14e[_0xe247('0x41')]==='outboundDial')_0x37f14e[_0xe247('0x47')]=_0x12e634(_0x37f14e[_0xe247('0x47')]);_0x37f14e[_0xe247('0x48')]=_0x4f7ca0[_0xe247('0x22')]?_[_0xe247('0x49')](_0x4f7ca0)['priority']+0x1:_0x41160f;_0x4efa38=_['concat'](_0x4efa38,_0x4f7ca0,[_0x37f14e],_0x4081ff);_0x41160f=_['last'](_0x4efa38)[_0xe247('0x48')]+0x1;}return _0x329181(_0x4efa38);})['catch'](function(_0x57c201){_0x335ced(_0x57c201);});});}return _0x44ae62[_0xe247('0x4a')](_0xe247('0x4b'),attributes,{'tableName':_0xe247('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5f433e,_0x5a34ed){var _0x2be154=this;var _0x1c46ec=_0x2be154[_0xe247('0x6')]===_0xe247('0x13')?_0x1bcacc(_0x2be154):_0x436d73(_0x2be154);return _0x4959a7(_0x2be154,_0x5f433e,_[_0xe247('0x49')](_0x1c46ec)[_0xe247('0x48')]+0x1,_0x5a34ed)[_0xe247('0x31')](function(_0x34d497){var _0x4f9fa0=_['concat'](_0x1c46ec,_0x34d497);_0x4f9fa0[_0xe247('0xf')]({'type':_0x2be154[_0xe247('0x6')],'app':_0xe247('0x4d'),'exten':_0x2be154[_0xe247('0xd')],'context':_0x2be154['context'],'priority':_[_0xe247('0x49')](_0x4f9fa0)[_0xe247('0x48')]+0x1,'VoiceExtensionId':_0x2be154['id']});return _0x4f9fa0;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 602ee56..5d0d904 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 _0x3dd6=['redis','defaults','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','include','map','model','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x4575bf,_0x5d06ab){var _0x1848c2=function(_0x54dd4c){while(--_0x54dd4c){_0x4575bf['push'](_0x4575bf['shift']());}};_0x1848c2(++_0x5d06ab);}(_0x3dd6,0xcf));var _0x63dd=function(_0x2c9427,_0x331c7b){_0x2c9427=_0x2c9427-0x0;var _0x1b6dc8=_0x3dd6[_0x2c9427];return _0x1b6dc8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x63dd('0x0'));var rs=require(_0x63dd('0x1'));var fs=require('fs');var Redis=require(_0x63dd('0x2'));var db=require(_0x63dd('0x3'))['db'];var utils=require(_0x63dd('0x4'));var logger=require(_0x63dd('0x5'))('rpc');var config=require(_0x63dd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x63dd('0x7')][_0x63dd('0x8')]({'port':0x232a});config[_0x63dd('0x9')]=_[_0x63dd('0xa')](config[_0x63dd('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x63dd('0xb'))(new Redis(config[_0x63dd('0x9')]));require(_0x63dd('0xc'))[_0x63dd('0xd')](socket);function respondWithRpcPromise(_0x5b9c34,_0x5b7d81,_0x374f8e){return new BPromise(function(_0x1508c4,_0x165462){return client[_0x63dd('0xe')](_0x5b9c34,_0x374f8e)[_0x63dd('0xf')](function(_0x4f4230){logger[_0x63dd('0x10')](_0x63dd('0x11'),_0x5b7d81,_0x63dd('0x12'));logger[_0x63dd('0x13')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x5b7d81,_0x63dd('0x12'),JSON[_0x63dd('0x14')](_0x4f4230));if(_0x4f4230[_0x63dd('0x15')]){if(_0x4f4230[_0x63dd('0x15')][_0x63dd('0x16')]===0x1f4){logger[_0x63dd('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x5b7d81,_0x4f4230['error'][_0x63dd('0x17')]);return _0x165462(_0x4f4230[_0x63dd('0x15')][_0x63dd('0x17')]);}logger['error'](_0x63dd('0x11'),_0x5b7d81,_0x4f4230[_0x63dd('0x15')][_0x63dd('0x17')]);return _0x1508c4(_0x4f4230['error'][_0x63dd('0x17')]);}else{logger[_0x63dd('0x10')](_0x63dd('0x11'),_0x5b7d81,_0x63dd('0x12'));_0x1508c4(_0x4f4230[_0x63dd('0x18')][_0x63dd('0x17')]);}})[_0x63dd('0x19')](function(_0x460980){logger[_0x63dd('0x15')](_0x63dd('0x11'),_0x5b7d81,_0x460980);_0x165462(_0x460980);});});}exports[_0x63dd('0x1a')]=function(_0x1e09a5){var _0x4f9e9d=this;return new Promise(function(_0x2e1305,_0x596046){return db[_0x63dd('0x1b')][_0x63dd('0x1c')]({'raw':_0x1e09a5[_0x63dd('0x1d')]?_0x1e09a5['options'][_0x63dd('0x1e')]===undefined?!![]:![]:!![],'where':_0x1e09a5[_0x63dd('0x1d')]?_0x1e09a5[_0x63dd('0x1d')][_0x63dd('0x1f')]||null:null,'attributes':_0x1e09a5[_0x63dd('0x1d')]?_0x1e09a5[_0x63dd('0x1d')][_0x63dd('0x20')]||null:null,'limit':_0x1e09a5[_0x63dd('0x1d')]?_0x1e09a5[_0x63dd('0x1d')]['limit']||null:null,'include':_0x1e09a5['options']?_0x1e09a5['options'][_0x63dd('0x21')]?_[_0x63dd('0x22')](_0x1e09a5['options'][_0x63dd('0x21')],function(_0x222e13){return{'model':db[_0x222e13['model']],'as':_0x222e13['as'],'attributes':_0x222e13[_0x63dd('0x20')],'include':_0x222e13[_0x63dd('0x21')]?_['map'](_0x222e13['include'],function(_0x2417f0){return{'model':db[_0x2417f0[_0x63dd('0x23')]],'as':_0x2417f0['as'],'attributes':_0x2417f0[_0x63dd('0x20')],'include':_0x2417f0[_0x63dd('0x21')]?_[_0x63dd('0x22')](_0x2417f0['include'],function(_0x7ca662){return{'model':db[_0x7ca662['model']],'as':_0x7ca662['as'],'attributes':_0x7ca662[_0x63dd('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c23d9){logger[_0x63dd('0x10')](_0x63dd('0x1a'),_0x1e09a5);logger[_0x63dd('0x13')](_0x63dd('0x1a'),_0x1e09a5,JSON[_0x63dd('0x14')](_0x5c23d9));_0x2e1305(_0x5c23d9);})[_0x63dd('0x19')](function(_0x5525fd){logger[_0x63dd('0x15')](_0x63dd('0x1a'),_0x5525fd[_0x63dd('0x17')],_0x1e09a5);_0x596046(_0x4f9e9d[_0x63dd('0x15')](0x1f4,_0x5525fd['message']));});});}; \ No newline at end of file +var _0x2159=['message','request\x20sent','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xad5bb5,_0x356f53){var _0x394484=function(_0x22b644){while(--_0x22b644){_0xad5bb5['push'](_0xad5bb5['shift']());}};_0x394484(++_0x356f53);}(_0x2159,0x17f));var _0x9215=function(_0x12d013,_0x286e4c){_0x12d013=_0x12d013-0x0;var _0x54220c=_0x2159[_0x12d013];return _0x54220c;};'use strict';var _=require(_0x9215('0x0'));var util=require(_0x9215('0x1'));var moment=require(_0x9215('0x2'));var BPromise=require(_0x9215('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9215('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9215('0x5'));var logger=require(_0x9215('0x6'))(_0x9215('0x7'));var config=require(_0x9215('0x8'));var jayson=require(_0x9215('0x9'));var client=jayson[_0x9215('0xa')][_0x9215('0xb')]({'port':0x232a});config[_0x9215('0xc')]=_['defaults'](config[_0x9215('0xc')],{'host':_0x9215('0xd'),'port':0x18eb});var socket=require(_0x9215('0xe'))(new Redis(config[_0x9215('0xc')]));require(_0x9215('0xf'))['register'](socket);function respondWithRpcPromise(_0x33b7ed,_0x33be6a,_0x9d11c1){return new BPromise(function(_0xf2a925,_0x57ba44){return client[_0x9215('0x10')](_0x33b7ed,_0x9d11c1)[_0x9215('0x11')](function(_0x4960ba){logger[_0x9215('0x12')](_0x9215('0x13'),_0x33be6a,'request\x20sent');logger[_0x9215('0x14')](_0x9215('0x15'),_0x33be6a,'request\x20sent',JSON[_0x9215('0x16')](_0x4960ba));if(_0x4960ba['error']){if(_0x4960ba[_0x9215('0x17')]['code']===0x1f4){logger[_0x9215('0x17')](_0x9215('0x13'),_0x33be6a,_0x4960ba[_0x9215('0x17')][_0x9215('0x18')]);return _0x57ba44(_0x4960ba['error'][_0x9215('0x18')]);}logger[_0x9215('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x33be6a,_0x4960ba[_0x9215('0x17')][_0x9215('0x18')]);return _0xf2a925(_0x4960ba[_0x9215('0x17')][_0x9215('0x18')]);}else{logger[_0x9215('0x12')](_0x9215('0x13'),_0x33be6a,_0x9215('0x19'));_0xf2a925(_0x4960ba['result'][_0x9215('0x18')]);}})[_0x9215('0x1a')](function(_0x32b658){logger[_0x9215('0x17')](_0x9215('0x13'),_0x33be6a,_0x32b658);_0x57ba44(_0x32b658);});});}exports[_0x9215('0x1b')]=function(_0x315320){var _0x52dc87=this;return new Promise(function(_0x5b8aac,_0x5bc65b){return db[_0x9215('0x1c')][_0x9215('0x1d')]({'raw':_0x315320['options']?_0x315320[_0x9215('0x1e')][_0x9215('0x1f')]===undefined?!![]:![]:!![],'where':_0x315320[_0x9215('0x1e')]?_0x315320[_0x9215('0x1e')]['where']||null:null,'attributes':_0x315320[_0x9215('0x1e')]?_0x315320[_0x9215('0x1e')][_0x9215('0x20')]||null:null,'limit':_0x315320[_0x9215('0x1e')]?_0x315320[_0x9215('0x1e')][_0x9215('0x21')]||null:null,'include':_0x315320[_0x9215('0x1e')]?_0x315320[_0x9215('0x1e')][_0x9215('0x22')]?_[_0x9215('0x23')](_0x315320[_0x9215('0x1e')]['include'],function(_0x34092e){return{'model':db[_0x34092e[_0x9215('0x24')]],'as':_0x34092e['as'],'attributes':_0x34092e[_0x9215('0x20')],'include':_0x34092e['include']?_[_0x9215('0x23')](_0x34092e[_0x9215('0x22')],function(_0x4159a3){return{'model':db[_0x4159a3[_0x9215('0x24')]],'as':_0x4159a3['as'],'attributes':_0x4159a3[_0x9215('0x20')],'include':_0x4159a3[_0x9215('0x22')]?_['map'](_0x4159a3[_0x9215('0x22')],function(_0x83774f){return{'model':db[_0x83774f[_0x9215('0x24')]],'as':_0x83774f['as'],'attributes':_0x83774f[_0x9215('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c38eb){logger['info'](_0x9215('0x1b'),_0x315320);logger['debug'](_0x9215('0x1b'),_0x315320,JSON['stringify'](_0x1c38eb));_0x5b8aac(_0x1c38eb);})[_0x9215('0x1a')](function(_0x4ff78a){logger['error'](_0x9215('0x1b'),_0x4ff78a[_0x9215('0x18')],_0x315320);_0x5bc65b(_0x52dc87['error'](0x1f4,_0x4ff78a['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 23f2e4e..8765eed 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 _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x7688,_0x263b71){var _0x52a4e6=function(_0x12623a){while(--_0x12623a){_0x7688['push'](_0x7688['shift']());}};_0x52a4e6(++_0x263b71);}(_0xabce,0x103));var _0xeabc=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xabce[_0x550d12];return _0x12103d;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file +var _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x5194c2,_0x4a29f2){var _0x1d2cc5=function(_0x25ba2d){while(--_0x25ba2d){_0x5194c2['push'](_0x5194c2['shift']());}};_0x1d2cc5(++_0x4a29f2);}(_0xabce,0x103));var _0xeabc=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xabce[_0x2160a9];return _0xa88cf7;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 44d9698..81574a5 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 _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x0295,0x1f0));var _0x5029=function(_0x2db0e0,_0x43c8c0){_0x2db0e0=_0x2db0e0-0x0;var _0x1d78ca=_0x0295[_0x2db0e0];return _0x1d78ca;};'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')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5029('0x7')]('/:id/messages',auth[_0x5029('0x8')](),controller['getMessages']);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 +var _0xeda8=['show','/:id/messages','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index'];(function(_0x35e489,_0x245a54){var _0x368472=function(_0x58a3d3){while(--_0x58a3d3){_0x35e489['push'](_0x35e489['shift']());}};_0x368472(++_0x245a54);}(_0xeda8,0x104));var _0x8eda=function(_0x37d9cb,_0x4bccfd){_0x37d9cb=_0x37d9cb-0x0;var _0x2b866c=_0xeda8[_0x37d9cb];return _0x2b866c;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')]('/',auth[_0x8eda('0xb')](),controller[_0x8eda('0xc')]);router[_0x8eda('0xa')]('/:id',auth[_0x8eda('0xb')](),controller[_0x8eda('0xd')]);router[_0x8eda('0xa')](_0x8eda('0xe'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x8eda('0xf')]);router[_0x8eda('0x10')](_0x8eda('0x11'),auth['isAuthenticated'](),controller[_0x8eda('0x12')]);router['delete'](_0x8eda('0x11'),auth[_0x8eda('0xb')](),controller[_0x8eda('0x13')]);module[_0x8eda('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index aa2c53d..a22de58 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 _0x8cec=['exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x8cec,0x17a));var _0xc8ce=function(_0x5260e6,_0x3c0636){_0x5260e6=_0x5260e6-0x0;var _0x1d3b66=_0x8cec[_0x5260e6];return _0x1d3b66;};'use strict';var Sequelize=require('sequelize');module[_0xc8ce('0x0')]={'customer_id':{'type':Sequelize[_0xc8ce('0x1')]},'context':{'type':Sequelize[_0xc8ce('0x1')],'defaultValue':_0xc8ce('0x2'),'unique':_0xc8ce('0x3')},'mailbox':{'type':Sequelize[_0xc8ce('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xc8ce('0x1')]},'email':{'type':Sequelize[_0xc8ce('0x1')],'validate':{'isEmail':!![]},'set':function(_0x7d59a7){this[_0xc8ce('0x4')](_0xc8ce('0x5'),typeof _0x7d59a7==='string'&&_0x7d59a7[_0xc8ce('0x6')]()?_0x7d59a7[_0xc8ce('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xc8ce('0x1')],'defaultValue':_0xc8ce('0x7')},'attach':{'type':Sequelize[_0xc8ce('0x8')](_0xc8ce('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xc8ce('0x8')]('yes','no'),'defaultValue':_0xc8ce('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xc8ce('0x1')]},'callback':{'type':Sequelize[_0xc8ce('0x1')]},'review':{'type':Sequelize['ENUM'](_0xc8ce('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xc8ce('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xc8ce('0x8')](_0xc8ce('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xc8ce('0x8')](_0xc8ce('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xc8ce('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xc8ce('0x8')](_0xc8ce('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xc8ce('0x9'),'no'),'defaultValue':_0xc8ce('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xc8ce('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xc8ce('0x8')](_0xc8ce('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xc8ce('0x9'),'no'),'defaultValue':_0xc8ce('0x9'),'allowNull':![]},'stamp':{'type':_0xc8ce('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xc8ce('0x1')]},'maxsecs':{'type':Sequelize[_0xc8ce('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xc8ce('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xc8ce('0xd')],'get':function(){return this[_0xc8ce('0xe')](_0xc8ce('0xf'))+_0xc8ce('0x10')+this[_0xc8ce('0xe')](_0xc8ce('0x11'));}}}; \ No newline at end of file +var _0x2b12=['ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','mailbox','exports','STRING','contest_mailbox','email','string','trim','central'];(function(_0x5ecfdd,_0x24bd5c){var _0x3a7281=function(_0xf7588e){while(--_0xf7588e){_0x5ecfdd['push'](_0x5ecfdd['shift']());}};_0x3a7281(++_0x24bd5c);}(_0x2b12,0xe9));var _0x22b1=function(_0xf75c37,_0x2fa1c7){_0xf75c37=_0xf75c37-0x0;var _0x568a1f=_0x2b12[_0xf75c37];return _0x568a1f;};'use strict';var Sequelize=require('sequelize');module[_0x22b1('0x0')]={'customer_id':{'type':Sequelize[_0x22b1('0x1')]},'context':{'type':Sequelize[_0x22b1('0x1')],'defaultValue':'from-voicemail','unique':_0x22b1('0x2')},'mailbox':{'type':Sequelize[_0x22b1('0x1')],'defaultValue':'','allowNull':![],'unique':_0x22b1('0x2')},'password':{'type':Sequelize[_0x22b1('0x1')]},'fullname':{'type':Sequelize[_0x22b1('0x1')]},'email':{'type':Sequelize[_0x22b1('0x1')],'validate':{'isEmail':!![]},'set':function(_0x93e65b){this['setDataValue'](_0x22b1('0x3'),typeof _0x93e65b===_0x22b1('0x4')&&_0x93e65b[_0x22b1('0x5')]()?_0x93e65b['trim']():null);}},'pager':{'type':Sequelize[_0x22b1('0x1')]},'tz':{'type':Sequelize[_0x22b1('0x1')],'defaultValue':_0x22b1('0x6')},'attach':{'type':Sequelize[_0x22b1('0x7')](_0x22b1('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x22b1('0x7')](_0x22b1('0x8'),'no'),'defaultValue':_0x22b1('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x22b1('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM'](_0x22b1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x22b1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x22b1('0x7')](_0x22b1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x22b1('0x7')](_0x22b1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x22b1('0x7')](_0x22b1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x22b1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x22b1('0x7')](_0x22b1('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x22b1('0x7')](_0x22b1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x22b1('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x22b1('0x8'),'no'),'defaultValue':_0x22b1('0x8'),'allowNull':![]},'stamp':{'type':_0x22b1('0x9')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x22b1('0x1')]},'maxsecs':{'type':Sequelize[_0x22b1('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x22b1('0xb')],'get':function(){return this['getDataValue'](_0x22b1('0xc'))+_0x22b1('0xd')+this['getDataValue'](_0x22b1('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 20c33ec..ef708a6 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 _0x80ed=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','VoiceMailMessage','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','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','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','end','sendStatus','error','stack','name','send','index','map','VoiceMail','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId'];(function(_0xedc9ed,_0x18870a){var _0x174596=function(_0x80fd13){while(--_0x80fd13){_0xedc9ed['push'](_0xedc9ed['shift']());}};_0x174596(++_0x18870a);}(_0x80ed,0x11c));var _0xd80e=function(_0x4276cc,_0x2ad2cc){_0x4276cc=_0x4276cc-0x0;var _0x183d64=_0x80ed[_0x4276cc];return _0x183d64;};'use strict';var emlformat=require(_0xd80e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd80e('0x1'));var jsonpatch=require(_0xd80e('0x2'));var rp=require(_0xd80e('0x3'));var moment=require('moment');var BPromise=require(_0xd80e('0x4'));var Mustache=require(_0xd80e('0x5'));var util=require(_0xd80e('0x6'));var path=require(_0xd80e('0x7'));var sox=require('sox');var csv=require(_0xd80e('0x8'));var ejs=require(_0xd80e('0x9'));var fs=require('fs');var fs_extra=require(_0xd80e('0xa'));var _=require('lodash');var squel=require(_0xd80e('0xb'));var crypto=require(_0xd80e('0xc'));var jsforce=require(_0xd80e('0xd'));var deskjs=require(_0xd80e('0xe'));var toCsv=require(_0xd80e('0x8'));var querystring=require(_0xd80e('0xf'));var Papa=require(_0xd80e('0x10'));var Redis=require(_0xd80e('0x11'));var authService=require(_0xd80e('0x12'));var qs=require(_0xd80e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd80e('0x14'));var logger=require(_0xd80e('0x15'))(_0xd80e('0x16'));var utils=require(_0xd80e('0x17'));var config=require(_0xd80e('0x18'));var licenseUtil=require(_0xd80e('0x19'));var db=require(_0xd80e('0x1a'))['db'];function respondWithStatusCode(_0x118f53,_0x1d3fcf){_0x1d3fcf=_0x1d3fcf||0xcc;return function(_0x4fb01c){if(_0x4fb01c){return _0x118f53['sendStatus'](_0x1d3fcf);}return _0x118f53['status'](_0x1d3fcf)['end']();};}function respondWithResult(_0x145766,_0x3d233b){_0x3d233b=_0x3d233b||0xc8;return function(_0x3096ae){if(_0x3096ae){return _0x145766[_0xd80e('0x1b')](_0x3d233b)[_0xd80e('0x1c')](_0x3096ae);}};}function respondWithFilteredResult(_0x58a17e,_0x595683){return function(_0x2c8c61){if(_0x2c8c61){var _0x3124e8=typeof _0x595683[_0xd80e('0x1d')]===_0xd80e('0x1e')&&typeof _0x595683[_0xd80e('0x1f')]===_0xd80e('0x1e');var _0x22ab67=_0x2c8c61['count'];var _0x21ceec=_0x3124e8?0x0:_0x595683[_0xd80e('0x1d')];var _0x3b543d=_0x3124e8?_0x2c8c61[_0xd80e('0x20')]:_0x595683['offset']+_0x595683[_0xd80e('0x1f')];var _0x175c67;if(_0x3b543d>=_0x22ab67){_0x3b543d=_0x22ab67;_0x175c67=0xc8;}else{_0x175c67=0xce;}_0x58a17e[_0xd80e('0x1b')](_0x175c67);return _0x58a17e['set'](_0xd80e('0x21'),_0x21ceec+'-'+_0x3b543d+'/'+_0x22ab67)[_0xd80e('0x1c')](_0x2c8c61);}return null;};}function patchUpdates(_0x2765ea){return function(_0x147134){try{jsonpatch[_0xd80e('0x22')](_0x147134,_0x2765ea,!![]);}catch(_0x5509d4){return BPromise['reject'](_0x5509d4);}return _0x147134[_0xd80e('0x23')]();};}function saveUpdates(_0x3fa159,_0x3b39bf){return function(_0x2d46e7){if(_0x2d46e7){return _0x2d46e7[_0xd80e('0x24')](_0x3fa159)[_0xd80e('0x25')](function(_0x43152c){return _0x43152c;});}return null;};}function removeEntity(_0x5430b6,_0x1fbf8a){return function(_0x57d70){if(_0x57d70){return _0x57d70[_0xd80e('0x26')]()['then'](function(){var _0x635ce0=_0x57d70[_0xd80e('0x27')]({'plain':!![]});var _0xe9bb59='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0xe9bb59,'resourceId':_0x635ce0['id']}})[_0xd80e('0x25')](function(){return _0x57d70;});})['then'](function(){_0x5430b6[_0xd80e('0x1b')](0xcc)[_0xd80e('0x28')]();});}};}function handleEntityNotFound(_0x4e8ed9,_0x24bafb){return function(_0xe1c04a){if(!_0xe1c04a){_0x4e8ed9[_0xd80e('0x29')](0x194);}return _0xe1c04a;};}function handleError(_0x46c05d,_0x5376eb){_0x5376eb=_0x5376eb||0x1f4;return function(_0x15f317){logger[_0xd80e('0x2a')](_0x15f317[_0xd80e('0x2b')]);if(_0x15f317[_0xd80e('0x2c')]){delete _0x15f317[_0xd80e('0x2c')];}_0x46c05d[_0xd80e('0x1b')](_0x5376eb)[_0xd80e('0x2d')](_0x15f317);};}exports[_0xd80e('0x2e')]=function(_0x5522dd,_0x54504e){var _0x30f9bd={},_0x1303eb={},_0x400220={'count':0x0,'rows':[]};var _0x32360c=_[_0xd80e('0x2f')](db[_0xd80e('0x30')]['rawAttributes'],function(_0x568d82){return{'name':_0x568d82[_0xd80e('0x31')],'type':_0x568d82[_0xd80e('0x32')][_0xd80e('0x33')]};});_0x1303eb[_0xd80e('0x34')]=_[_0xd80e('0x2f')](_0x32360c,_0xd80e('0x2c'));_0x1303eb[_0xd80e('0x35')]=_[_0xd80e('0x36')](_0x5522dd['query']);_0x1303eb['filters']=_[_0xd80e('0x37')](_0x1303eb[_0xd80e('0x34')],_0x1303eb[_0xd80e('0x35')]);_0x30f9bd[_0xd80e('0x38')]=_[_0xd80e('0x37')](_0x1303eb[_0xd80e('0x34')],qs[_0xd80e('0x39')](_0x5522dd[_0xd80e('0x35')][_0xd80e('0x39')]));_0x30f9bd[_0xd80e('0x38')]=_0x30f9bd['attributes'][_0xd80e('0x3a')]?_0x30f9bd['attributes']:_0x1303eb[_0xd80e('0x34')];if(!_0x5522dd[_0xd80e('0x35')][_0xd80e('0x3b')](_0xd80e('0x3c'))){_0x30f9bd['limit']=qs[_0xd80e('0x1f')](_0x5522dd['query'][_0xd80e('0x1f')]);_0x30f9bd['offset']=qs[_0xd80e('0x1d')](_0x5522dd[_0xd80e('0x35')]['offset']);}_0x30f9bd[_0xd80e('0x3d')]=qs[_0xd80e('0x3e')](_0x5522dd[_0xd80e('0x35')]['sort']);_0x30f9bd[_0xd80e('0x3f')]=qs[_0xd80e('0x40')](_[_0xd80e('0x41')](_0x5522dd[_0xd80e('0x35')],_0x1303eb[_0xd80e('0x40')]),_0x32360c);if(_0x5522dd[_0xd80e('0x35')][_0xd80e('0x42')]){_0x30f9bd[_0xd80e('0x3f')]=_[_0xd80e('0x43')](_0x30f9bd['where'],{'$or':_['map'](_0x32360c,function(_0x4e92f6){if(_0x4e92f6[_0xd80e('0x32')]!==_0xd80e('0x44')){var _0x55925e={};_0x55925e[_0x4e92f6[_0xd80e('0x2c')]]={'$like':'%'+_0x5522dd['query'][_0xd80e('0x42')]+'%'};return _0x55925e;}})});}_0x30f9bd=_['merge']({},_0x30f9bd,_0x5522dd[_0xd80e('0x45')]);var _0xae1514={'where':_0x30f9bd['where']};return db['VoiceMail'][_0xd80e('0x20')](_0xae1514)[_0xd80e('0x25')](function(_0x439673){_0x400220[_0xd80e('0x20')]=_0x439673;if(_0x5522dd[_0xd80e('0x35')][_0xd80e('0x46')]){_0x30f9bd[_0xd80e('0x47')]=[{'all':!![]}];}return db[_0xd80e('0x30')][_0xd80e('0x48')](_0x30f9bd);})[_0xd80e('0x25')](function(_0x1bbb36){_0x400220[_0xd80e('0x49')]=_0x1bbb36;return _0x400220;})[_0xd80e('0x25')](respondWithFilteredResult(_0x54504e,_0x30f9bd))[_0xd80e('0x4a')](handleError(_0x54504e,null));};exports[_0xd80e('0x4b')]=function(_0x7f80a,_0x558911){var _0x52213c={'raw':!![],'where':{'id':_0x7f80a[_0xd80e('0x4c')]['id']}},_0x5bdea5={};_0x5bdea5['model']=_[_0xd80e('0x36')](db[_0xd80e('0x30')][_0xd80e('0x4d')]);_0x5bdea5[_0xd80e('0x35')]=_[_0xd80e('0x36')](_0x7f80a[_0xd80e('0x35')]);_0x5bdea5['filters']=_['intersection'](_0x5bdea5['model'],_0x5bdea5[_0xd80e('0x35')]);_0x52213c['attributes']=_[_0xd80e('0x37')](_0x5bdea5[_0xd80e('0x34')],qs[_0xd80e('0x39')](_0x7f80a[_0xd80e('0x35')][_0xd80e('0x39')]));_0x52213c['attributes']=_0x52213c[_0xd80e('0x38')][_0xd80e('0x3a')]?_0x52213c[_0xd80e('0x38')]:_0x5bdea5['model'];if(_0x7f80a[_0xd80e('0x35')][_0xd80e('0x46')]){_0x52213c[_0xd80e('0x47')]=[{'all':!![]}];}_0x52213c=_['merge']({},_0x52213c,_0x7f80a[_0xd80e('0x45')]);return db[_0xd80e('0x30')][_0xd80e('0x4e')](_0x52213c)[_0xd80e('0x25')](handleEntityNotFound(_0x558911,null))[_0xd80e('0x25')](respondWithResult(_0x558911,null))[_0xd80e('0x4a')](handleError(_0x558911,null));};exports['create']=function(_0x5aad1b,_0x275985){return db[_0xd80e('0x30')][_0xd80e('0x4f')](_0x5aad1b['body'],{})['then'](function(_0x1762a8){var _0xff0980=_0x5aad1b[_0xd80e('0x50')][_0xd80e('0x27')]({'plain':!![]});if(!_0xff0980)throw new Error(_0xd80e('0x51'));if(_0xff0980['role']===_0xd80e('0x50')){var _0x5c392d=_0x1762a8[_0xd80e('0x27')]({'plain':!![]});var _0x31107b='Voicemails';return db[_0xd80e('0x52')][_0xd80e('0x4e')]({'where':{'name':_0x31107b,'userProfileId':_0xff0980[_0xd80e('0x53')]},'raw':!![]})[_0xd80e('0x25')](function(_0x44b2f5){if(_0x44b2f5&&_0x44b2f5[_0xd80e('0x54')]===0x0){return db[_0xd80e('0x55')]['create']({'name':_0x5c392d[_0xd80e('0x2c')],'resourceId':_0x5c392d['id'],'type':_0x44b2f5[_0xd80e('0x2c')],'sectionId':_0x44b2f5['id']},{})[_0xd80e('0x25')](function(){return _0x1762a8;});}else{return _0x1762a8;}})['catch'](function(_0x52ab04){logger[_0xd80e('0x2a')](_0xd80e('0x56'),_0x52ab04);throw _0x52ab04;});}return _0x1762a8;})[_0xd80e('0x25')](respondWithResult(_0x275985,0xc9))[_0xd80e('0x4a')](handleError(_0x275985,null));};exports[_0xd80e('0x24')]=function(_0x8b7a70,_0x53b2b8){if(_0x8b7a70[_0xd80e('0x57')]['id']){delete _0x8b7a70['body']['id'];}return db[_0xd80e('0x30')]['find']({'where':{'id':_0x8b7a70[_0xd80e('0x4c')]['id']}})[_0xd80e('0x25')](handleEntityNotFound(_0x53b2b8,null))[_0xd80e('0x25')](saveUpdates(_0x8b7a70[_0xd80e('0x57')],null))[_0xd80e('0x25')](respondWithResult(_0x53b2b8,null))[_0xd80e('0x4a')](handleError(_0x53b2b8,null));};exports['destroy']=function(_0x13270c,_0x4e7edd){return db[_0xd80e('0x30')][_0xd80e('0x4e')]({'where':{'id':_0x13270c['params']['id']}})['then'](handleEntityNotFound(_0x4e7edd,null))[_0xd80e('0x25')](removeEntity(_0x4e7edd,null))[_0xd80e('0x4a')](handleError(_0x4e7edd,null));};exports[_0xd80e('0x58')]=function(_0x570a02,_0x568770,_0x1ba0ed){return db[_0xd80e('0x30')]['findOne']({'where':{'id':_0x570a02[_0xd80e('0x4c')]['id']}})[_0xd80e('0x25')](handleEntityNotFound(_0x568770,null))[_0xd80e('0x25')](function(_0x539390){var _0x41dda0;var _0x589c0b={},_0x720eab={};_0x720eab[_0xd80e('0x34')]=_[_0xd80e('0x36')](db[_0xd80e('0x59')]['rawAttributes']);_0x720eab[_0xd80e('0x35')]=_['keys'](_0x570a02[_0xd80e('0x35')]);_0x720eab['filters']=_[_0xd80e('0x37')](_0x720eab[_0xd80e('0x34')],_0x720eab[_0xd80e('0x35')]);_0x589c0b[_0xd80e('0x38')]=_['intersection'](_0x720eab[_0xd80e('0x34')],qs[_0xd80e('0x39')](_0x570a02['query'][_0xd80e('0x39')]));_0x589c0b[_0xd80e('0x38')]=_0x589c0b[_0xd80e('0x38')][_0xd80e('0x3a')]?_0x589c0b['attributes']:_0x720eab[_0xd80e('0x34')];if(!_0x570a02[_0xd80e('0x35')]['hasOwnProperty'](_0xd80e('0x3c'))){_0x589c0b[_0xd80e('0x1f')]=qs[_0xd80e('0x1f')](_0x570a02['query']['limit']);_0x589c0b['offset']=qs['offset'](_0x570a02[_0xd80e('0x35')]['offset']);}_0x589c0b[_0xd80e('0x3d')]=qs[_0xd80e('0x3e')](_0x570a02[_0xd80e('0x35')]['sort']);_0x589c0b[_0xd80e('0x3f')]=qs[_0xd80e('0x40')](_[_0xd80e('0x41')](_0x570a02[_0xd80e('0x35')],_0x720eab[_0xd80e('0x40')]));if(_0x570a02[_0xd80e('0x35')][_0xd80e('0x42')]){_0x589c0b[_0xd80e('0x3f')]=_[_0xd80e('0x43')](_0x589c0b['where'],{'$or':_['map'](_0x589c0b[_0xd80e('0x38')],function(_0x410ed6){var _0x10104c={};_0x10104c[_0x410ed6]={'$like':'%'+_0x570a02[_0xd80e('0x35')]['filter']+'%'};return _0x10104c;})});}_0x589c0b[_0xd80e('0x3f')]=_[_0xd80e('0x43')](_0x589c0b[_0xd80e('0x3f')],{'mailboxuser':_0x539390[_0xd80e('0x5a')]});_0x589c0b=_[_0xd80e('0x43')]({},_0x589c0b,_0x570a02['options']);return db[_0xd80e('0x59')][_0xd80e('0x5b')](_0x589c0b)[_0xd80e('0x25')](respondWithFilteredResult(_0x568770,_0x589c0b));})[_0xd80e('0x4a')](handleError(_0x568770,null));}; \ No newline at end of file +var _0x97c1=['error','stack','name','VoiceMail','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','getMessages','pick','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Voicemails','sendStatus'];(function(_0x3fd428,_0xe4fbe8){var _0x112ad4=function(_0x5bc689){while(--_0x5bc689){_0x3fd428['push'](_0x3fd428['shift']());}};_0x112ad4(++_0xe4fbe8);}(_0x97c1,0xdf));var _0x197c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x97c1[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x197c('0x0'));var rimraf=require(_0x197c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x197c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x197c('0x3'));var Mustache=require(_0x197c('0x4'));var util=require(_0x197c('0x5'));var path=require(_0x197c('0x6'));var sox=require(_0x197c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x197c('0x8'));var _=require(_0x197c('0x9'));var squel=require(_0x197c('0xa'));var crypto=require(_0x197c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x197c('0xc'));var querystring=require('querystring');var Papa=require(_0x197c('0xd'));var Redis=require(_0x197c('0xe'));var authService=require(_0x197c('0xf'));var qs=require(_0x197c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x197c('0x11'));var logger=require(_0x197c('0x12'))(_0x197c('0x13'));var utils=require(_0x197c('0x14'));var config=require(_0x197c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x197c('0x16'))['db'];function respondWithStatusCode(_0x668f8,_0x27e46f){_0x27e46f=_0x27e46f||0xcc;return function(_0x1adcfa){if(_0x1adcfa){return _0x668f8['sendStatus'](_0x27e46f);}return _0x668f8[_0x197c('0x17')](_0x27e46f)[_0x197c('0x18')]();};}function respondWithResult(_0x5a7e1c,_0xf735ce){_0xf735ce=_0xf735ce||0xc8;return function(_0x188ff2){if(_0x188ff2){return _0x5a7e1c[_0x197c('0x17')](_0xf735ce)['json'](_0x188ff2);}};}function respondWithFilteredResult(_0x5194c3,_0x422dfa){return function(_0x2bc612){if(_0x2bc612){var _0x2083d4=typeof _0x422dfa[_0x197c('0x19')]===_0x197c('0x1a')&&typeof _0x422dfa[_0x197c('0x1b')]===_0x197c('0x1a');var _0x75beba=_0x2bc612['count'];var _0x372311=_0x2083d4?0x0:_0x422dfa['offset'];var _0x50ac52=_0x2083d4?_0x2bc612[_0x197c('0x1c')]:_0x422dfa[_0x197c('0x19')]+_0x422dfa[_0x197c('0x1b')];var _0x2ce10d;if(_0x50ac52>=_0x75beba){_0x50ac52=_0x75beba;_0x2ce10d=0xc8;}else{_0x2ce10d=0xce;}_0x5194c3['status'](_0x2ce10d);return _0x5194c3[_0x197c('0x1d')](_0x197c('0x1e'),_0x372311+'-'+_0x50ac52+'/'+_0x75beba)[_0x197c('0x1f')](_0x2bc612);}return null;};}function patchUpdates(_0x5c278a){return function(_0x1adb43){try{jsonpatch[_0x197c('0x20')](_0x1adb43,_0x5c278a,!![]);}catch(_0x3b5c4c){return BPromise[_0x197c('0x21')](_0x3b5c4c);}return _0x1adb43[_0x197c('0x22')]();};}function saveUpdates(_0x3c2151,_0x362bbf){return function(_0x2092a0){if(_0x2092a0){return _0x2092a0[_0x197c('0x23')](_0x3c2151)[_0x197c('0x24')](function(_0x29b266){return _0x29b266;});}return null;};}function removeEntity(_0x177bc9,_0x174942){return function(_0x2a1310){if(_0x2a1310){return _0x2a1310[_0x197c('0x25')]()[_0x197c('0x24')](function(){var _0x5f4a02=_0x2a1310[_0x197c('0x26')]({'plain':!![]});var _0x2911dd=_0x197c('0x27');return db['UserProfileResource'][_0x197c('0x25')]({'where':{'type':_0x2911dd,'resourceId':_0x5f4a02['id']}})[_0x197c('0x24')](function(){return _0x2a1310;});})['then'](function(){_0x177bc9['status'](0xcc)[_0x197c('0x18')]();});}};}function handleEntityNotFound(_0x48f759,_0xfbca7a){return function(_0x14b0aa){if(!_0x14b0aa){_0x48f759[_0x197c('0x28')](0x194);}return _0x14b0aa;};}function handleError(_0x16e026,_0x2f031c){_0x2f031c=_0x2f031c||0x1f4;return function(_0x3cdcd8){logger[_0x197c('0x29')](_0x3cdcd8[_0x197c('0x2a')]);if(_0x3cdcd8[_0x197c('0x2b')]){delete _0x3cdcd8['name'];}_0x16e026['status'](_0x2f031c)['send'](_0x3cdcd8);};}exports['index']=function(_0x5f7425,_0x4c9256){var _0x252cde={},_0x35dbf3={},_0x58bc60={'count':0x0,'rows':[]};var _0x422ac6=_['map'](db[_0x197c('0x2c')][_0x197c('0x2d')],function(_0x2ace33){return{'name':_0x2ace33[_0x197c('0x2e')],'type':_0x2ace33[_0x197c('0x2f')][_0x197c('0x30')]};});_0x35dbf3[_0x197c('0x31')]=_[_0x197c('0x32')](_0x422ac6,_0x197c('0x2b'));_0x35dbf3['query']=_['keys'](_0x5f7425[_0x197c('0x33')]);_0x35dbf3[_0x197c('0x34')]=_[_0x197c('0x35')](_0x35dbf3[_0x197c('0x31')],_0x35dbf3[_0x197c('0x33')]);_0x252cde[_0x197c('0x36')]=_[_0x197c('0x35')](_0x35dbf3['model'],qs['fields'](_0x5f7425[_0x197c('0x33')][_0x197c('0x37')]));_0x252cde['attributes']=_0x252cde['attributes'][_0x197c('0x38')]?_0x252cde[_0x197c('0x36')]:_0x35dbf3[_0x197c('0x31')];if(!_0x5f7425[_0x197c('0x33')][_0x197c('0x39')](_0x197c('0x3a'))){_0x252cde[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x5f7425[_0x197c('0x33')]['limit']);_0x252cde[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x5f7425[_0x197c('0x33')][_0x197c('0x19')]);}_0x252cde[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x5f7425['query'][_0x197c('0x3c')]);_0x252cde[_0x197c('0x3d')]=qs[_0x197c('0x34')](_['pick'](_0x5f7425[_0x197c('0x33')],_0x35dbf3[_0x197c('0x34')]),_0x422ac6);if(_0x5f7425[_0x197c('0x33')][_0x197c('0x3e')]){_0x252cde[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x252cde[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x422ac6,function(_0x323a14){if(_0x323a14[_0x197c('0x2f')]!=='VIRTUAL'){var _0x2705f5={};_0x2705f5[_0x323a14[_0x197c('0x2b')]]={'$like':'%'+_0x5f7425['query']['filter']+'%'};return _0x2705f5;}})});}_0x252cde=_[_0x197c('0x3f')]({},_0x252cde,_0x5f7425[_0x197c('0x40')]);var _0x3517a6={'where':_0x252cde[_0x197c('0x3d')]};return db[_0x197c('0x2c')]['count'](_0x3517a6)[_0x197c('0x24')](function(_0x3efae){_0x58bc60[_0x197c('0x1c')]=_0x3efae;if(_0x5f7425[_0x197c('0x33')][_0x197c('0x41')]){_0x252cde['include']=[{'all':!![]}];}return db[_0x197c('0x2c')][_0x197c('0x42')](_0x252cde);})[_0x197c('0x24')](function(_0x197b27){_0x58bc60[_0x197c('0x43')]=_0x197b27;return _0x58bc60;})['then'](respondWithFilteredResult(_0x4c9256,_0x252cde))[_0x197c('0x44')](handleError(_0x4c9256,null));};exports[_0x197c('0x45')]=function(_0x3b7fc1,_0x35f36d){var _0x3e6d6e={'raw':!![],'where':{'id':_0x3b7fc1[_0x197c('0x46')]['id']}},_0x41eb51={};_0x41eb51[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x2c')][_0x197c('0x2d')]);_0x41eb51['query']=_['keys'](_0x3b7fc1['query']);_0x41eb51['filters']=_[_0x197c('0x35')](_0x41eb51[_0x197c('0x31')],_0x41eb51['query']);_0x3e6d6e[_0x197c('0x36')]=_[_0x197c('0x35')](_0x41eb51['model'],qs[_0x197c('0x37')](_0x3b7fc1[_0x197c('0x33')]['fields']));_0x3e6d6e[_0x197c('0x36')]=_0x3e6d6e[_0x197c('0x36')]['length']?_0x3e6d6e[_0x197c('0x36')]:_0x41eb51[_0x197c('0x31')];if(_0x3b7fc1[_0x197c('0x33')]['includeAll']){_0x3e6d6e[_0x197c('0x48')]=[{'all':!![]}];}_0x3e6d6e=_[_0x197c('0x3f')]({},_0x3e6d6e,_0x3b7fc1[_0x197c('0x40')]);return db[_0x197c('0x2c')]['find'](_0x3e6d6e)[_0x197c('0x24')](handleEntityNotFound(_0x35f36d,null))[_0x197c('0x24')](respondWithResult(_0x35f36d,null))[_0x197c('0x44')](handleError(_0x35f36d,null));};exports['create']=function(_0x5994bf,_0x3a5089){return db[_0x197c('0x2c')][_0x197c('0x49')](_0x5994bf[_0x197c('0x4a')],{})[_0x197c('0x24')](function(_0x28fac4){var _0x4c82d5=_0x5994bf[_0x197c('0x4b')]['get']({'plain':!![]});if(!_0x4c82d5)throw new Error(_0x197c('0x4c'));if(_0x4c82d5[_0x197c('0x4d')]===_0x197c('0x4b')){var _0x9e8c6a=_0x28fac4[_0x197c('0x26')]({'plain':!![]});var _0x2ab21f=_0x197c('0x27');return db[_0x197c('0x4e')]['find']({'where':{'name':_0x2ab21f,'userProfileId':_0x4c82d5[_0x197c('0x4f')]},'raw':!![]})[_0x197c('0x24')](function(_0x43e9b7){if(_0x43e9b7&&_0x43e9b7['autoAssociation']===0x0){return db[_0x197c('0x50')]['create']({'name':_0x9e8c6a[_0x197c('0x2b')],'resourceId':_0x9e8c6a['id'],'type':_0x43e9b7[_0x197c('0x2b')],'sectionId':_0x43e9b7['id']},{})[_0x197c('0x24')](function(){return _0x28fac4;});}else{return _0x28fac4;}})[_0x197c('0x44')](function(_0x1d7cdd){logger[_0x197c('0x29')](_0x197c('0x51'),_0x1d7cdd);throw _0x1d7cdd;});}return _0x28fac4;})[_0x197c('0x24')](respondWithResult(_0x3a5089,0xc9))['catch'](handleError(_0x3a5089,null));};exports[_0x197c('0x23')]=function(_0x3a9261,_0x275294){if(_0x3a9261['body']['id']){delete _0x3a9261[_0x197c('0x4a')]['id'];}return db[_0x197c('0x2c')][_0x197c('0x52')]({'where':{'id':_0x3a9261[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x275294,null))['then'](saveUpdates(_0x3a9261['body'],null))[_0x197c('0x24')](respondWithResult(_0x275294,null))[_0x197c('0x44')](handleError(_0x275294,null));};exports[_0x197c('0x25')]=function(_0x42a13f,_0x15e50f){return db['VoiceMail']['find']({'where':{'id':_0x42a13f[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x15e50f,null))['then'](removeEntity(_0x15e50f,null))[_0x197c('0x44')](handleError(_0x15e50f,null));};exports[_0x197c('0x53')]=function(_0x1a607c,_0x40867c,_0xc10419){return db[_0x197c('0x2c')]['findOne']({'where':{'id':_0x1a607c[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x40867c,null))['then'](function(_0x480cab){var _0x1b71cf;var _0x5a70dd={},_0xfc9461={};_0xfc9461[_0x197c('0x31')]=_[_0x197c('0x47')](db['VoiceMailMessage'][_0x197c('0x2d')]);_0xfc9461[_0x197c('0x33')]=_['keys'](_0x1a607c[_0x197c('0x33')]);_0xfc9461[_0x197c('0x34')]=_[_0x197c('0x35')](_0xfc9461['model'],_0xfc9461[_0x197c('0x33')]);_0x5a70dd[_0x197c('0x36')]=_['intersection'](_0xfc9461['model'],qs[_0x197c('0x37')](_0x1a607c[_0x197c('0x33')][_0x197c('0x37')]));_0x5a70dd['attributes']=_0x5a70dd[_0x197c('0x36')][_0x197c('0x38')]?_0x5a70dd[_0x197c('0x36')]:_0xfc9461['model'];if(!_0x1a607c[_0x197c('0x33')][_0x197c('0x39')](_0x197c('0x3a'))){_0x5a70dd[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x1a607c[_0x197c('0x33')][_0x197c('0x1b')]);_0x5a70dd[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x1a607c[_0x197c('0x33')]['offset']);}_0x5a70dd[_0x197c('0x3b')]=qs['sort'](_0x1a607c['query']['sort']);_0x5a70dd['where']=qs[_0x197c('0x34')](_[_0x197c('0x54')](_0x1a607c[_0x197c('0x33')],_0xfc9461[_0x197c('0x34')]));if(_0x1a607c['query'][_0x197c('0x3e')]){_0x5a70dd['where']=_[_0x197c('0x3f')](_0x5a70dd['where'],{'$or':_[_0x197c('0x32')](_0x5a70dd['attributes'],function(_0x12d31a){var _0x1f6c6f={};_0x1f6c6f[_0x12d31a]={'$like':'%'+_0x1a607c[_0x197c('0x33')][_0x197c('0x3e')]+'%'};return _0x1f6c6f;})});}_0x5a70dd['where']=_[_0x197c('0x3f')](_0x5a70dd[_0x197c('0x3d')],{'mailboxuser':_0x480cab[_0x197c('0x55')]});_0x5a70dd=_['merge']({},_0x5a70dd,_0x1a607c[_0x197c('0x40')]);return db[_0x197c('0x56')][_0x197c('0x57')](_0x5a70dd)[_0x197c('0x24')](respondWithFilteredResult(_0x40867c,_0x5a70dd));})[_0x197c('0x44')](handleError(_0x40867c,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 8a0d8cd..54b796a 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 _0x8533=['request-promise','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','mailbox','context','lodash','util','../../config/logger','api','bluebird'];(function(_0x5b6cf1,_0x32fdcd){var _0x46278c=function(_0x53fd9b){while(--_0x53fd9b){_0x5b6cf1['push'](_0x5b6cf1['shift']());}};_0x46278c(++_0x32fdcd);}(_0x8533,0x181));var _0x3853=function(_0x5103bd,_0x19d3b0){_0x5103bd=_0x5103bd-0x0;var _0x1a06c5=_0x8533[_0x5103bd];return _0x1a06c5;};'use strict';var _=require(_0x3853('0x0'));var util=require(_0x3853('0x1'));var logger=require(_0x3853('0x2'))(_0x3853('0x3'));var moment=require('moment');var BPromise=require(_0x3853('0x4'));var rp=require(_0x3853('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3853('0x6'));var config=require(_0x3853('0x7'));var attributes=require(_0x3853('0x8'));module['exports']=function(_0x4250ef,_0x3bb119){return _0x4250ef[_0x3853('0x9')](_0x3853('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x3853('0xb'),_0x3853('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x87fd=['VoiceMail','voice_voicemail','mailbox','context','util','../../config/logger','api','bluebird','request-promise','rimraf','./voiceMail.attributes','exports'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0x87fd,0x1a8));var _0xd87f=function(_0x259d08,_0x475b1d){_0x259d08=_0x259d08-0x0;var _0x2ddc04=_0x87fd[_0x259d08];return _0x2ddc04;};'use strict';var _=require('lodash');var util=require(_0xd87f('0x0'));var logger=require(_0xd87f('0x1'))(_0xd87f('0x2'));var moment=require('moment');var BPromise=require(_0xd87f('0x3'));var rp=require(_0xd87f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd87f('0x5'));var config=require('../../config/environment');var attributes=require(_0xd87f('0x6'));module[_0xd87f('0x7')]=function(_0x55b8a2,_0x3e564f){return _0x55b8a2['define'](_0xd87f('0x8'),attributes,{'tableName':_0xd87f('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xd87f('0xa'),_0xd87f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index d15f12d..0a99ac6 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 _0x1b5d=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result'];(function(_0x11f28f,_0x30ebf9){var _0x413f1a=function(_0x537f8b){while(--_0x537f8b){_0x11f28f['push'](_0x11f28f['shift']());}};_0x413f1a(++_0x30ebf9);}(_0x1b5d,0xe7));var _0xd1b5=function(_0x5d7463,_0x3dbc4a){_0x5d7463=_0x5d7463-0x0;var _0x316d29=_0x1b5d[_0x5d7463];return _0x316d29;};'use strict';var _=require(_0xd1b5('0x0'));var util=require(_0xd1b5('0x1'));var moment=require(_0xd1b5('0x2'));var BPromise=require(_0xd1b5('0x3'));var rs=require(_0xd1b5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1b5('0x5'))['db'];var utils=require(_0xd1b5('0x6'));var logger=require(_0xd1b5('0x7'))(_0xd1b5('0x8'));var config=require(_0xd1b5('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd1b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18d7ab,_0x133146,_0x58c77c){return new BPromise(function(_0x152a6d,_0x3d43c7){return client[_0xd1b5('0xb')](_0x18d7ab,_0x58c77c)[_0xd1b5('0xc')](function(_0x963056){logger['info']('VoiceMail,\x20%s,\x20%s',_0x133146,_0xd1b5('0xd'));logger[_0xd1b5('0xe')](_0xd1b5('0xf'),_0x133146,_0xd1b5('0xd'),JSON[_0xd1b5('0x10')](_0x963056));if(_0x963056['error']){if(_0x963056[_0xd1b5('0x11')][_0xd1b5('0x12')]===0x1f4){logger[_0xd1b5('0x11')](_0xd1b5('0x13'),_0x133146,_0x963056[_0xd1b5('0x11')][_0xd1b5('0x14')]);return _0x3d43c7(_0x963056['error'][_0xd1b5('0x14')]);}logger[_0xd1b5('0x11')]('VoiceMail,\x20%s,\x20%s',_0x133146,_0x963056['error']['message']);return _0x152a6d(_0x963056[_0xd1b5('0x11')][_0xd1b5('0x14')]);}else{logger['info'](_0xd1b5('0x13'),_0x133146,_0xd1b5('0xd'));_0x152a6d(_0x963056[_0xd1b5('0x15')][_0xd1b5('0x14')]);}})[_0xd1b5('0x16')](function(_0x14a52b){logger[_0xd1b5('0x11')](_0xd1b5('0x13'),_0x133146,_0x14a52b);_0x3d43c7(_0x14a52b);});});} \ No newline at end of file +var _0x25ff=['request\x20sent','debug','stringify','code','error','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x5e0575,_0x34c467){var _0x2168b8=function(_0x4f2bd4){while(--_0x4f2bd4){_0x5e0575['push'](_0x5e0575['shift']());}};_0x2168b8(++_0x34c467);}(_0x25ff,0xdb));var _0xf25f=function(_0x439da9,_0x38ce05){_0x439da9=_0x439da9-0x0;var _0x235d48=_0x25ff[_0x439da9];return _0x235d48;};'use strict';var _=require(_0xf25f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf25f('0x1'));var rs=require(_0xf25f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf25f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf25f('0x4'))(_0xf25f('0x5'));var config=require(_0xf25f('0x6'));var jayson=require(_0xf25f('0x7'));var client=jayson[_0xf25f('0x8')][_0xf25f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c387,_0xdda4e1,_0x354e00){return new BPromise(function(_0x46d8a4,_0x43718f){return client['request'](_0x5c387,_0x354e00)[_0xf25f('0xa')](function(_0x19cff5){logger[_0xf25f('0xb')]('VoiceMail,\x20%s,\x20%s',_0xdda4e1,_0xf25f('0xc'));logger[_0xf25f('0xd')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0xdda4e1,_0xf25f('0xc'),JSON[_0xf25f('0xe')](_0x19cff5));if(_0x19cff5['error']){if(_0x19cff5['error'][_0xf25f('0xf')]===0x1f4){logger[_0xf25f('0x10')](_0xf25f('0x11'),_0xdda4e1,_0x19cff5[_0xf25f('0x10')][_0xf25f('0x12')]);return _0x43718f(_0x19cff5[_0xf25f('0x10')][_0xf25f('0x12')]);}logger['error'](_0xf25f('0x11'),_0xdda4e1,_0x19cff5[_0xf25f('0x10')]['message']);return _0x46d8a4(_0x19cff5[_0xf25f('0x10')][_0xf25f('0x12')]);}else{logger[_0xf25f('0xb')]('VoiceMail,\x20%s,\x20%s',_0xdda4e1,_0xf25f('0xc'));_0x46d8a4(_0x19cff5[_0xf25f('0x13')]['message']);}})[_0xf25f('0x14')](function(_0xaf0b1b){logger[_0xf25f('0x10')](_0xf25f('0x11'),_0xdda4e1,_0xaf0b1b);_0x43718f(_0xaf0b1b);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index ee19046..2a1e19a 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 _0x1f6e=['download','post','isAuthenticated','create','update','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','index','/:id','show'];(function(_0x5f0d29,_0x2722bb){var _0xd19e7a=function(_0x5e7302){while(--_0x5e7302){_0x5f0d29['push'](_0x5f0d29['shift']());}};_0xd19e7a(++_0x2722bb);}(_0x1f6e,0x124));var _0xe1f6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1f6e[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xe1f6('0x0'));var path=require('path');var timeout=require(_0xe1f6('0x1'));var express=require('express');var router=express[_0xe1f6('0x2')]();var fs_extra=require(_0xe1f6('0x3'));var auth=require(_0xe1f6('0x4'));var interaction=require(_0xe1f6('0x5'));var config=require(_0xe1f6('0x6'));var controller=require(_0xe1f6('0x7'));router[_0xe1f6('0x8')]('/',auth['isAuthenticated'](),controller[_0xe1f6('0x9')]);router['get'](_0xe1f6('0xa'),auth['isAuthenticated'](),controller[_0xe1f6('0xb')]);router[_0xe1f6('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xe1f6('0xc')]);router[_0xe1f6('0xd')]('/',auth[_0xe1f6('0xe')](),controller[_0xe1f6('0xf')]);router['put'](_0xe1f6('0xa'),auth[_0xe1f6('0xe')](),controller[_0xe1f6('0x10')]);router['delete']('/:id',auth[_0xe1f6('0xe')](),controller[_0xe1f6('0x11')]);module[_0xe1f6('0x12')]=router; \ No newline at end of file +var _0x3304=['/:id','show','download','create','put','update','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x3304,0x128));var _0x4330=function(_0x222ea2,_0x5a715f){_0x222ea2=_0x222ea2-0x0;var _0xc6a3c6=_0x3304[_0x222ea2];return _0xc6a3c6;};'use strict';var multer=require('multer');var util=require(_0x4330('0x0'));var path=require(_0x4330('0x1'));var timeout=require(_0x4330('0x2'));var express=require(_0x4330('0x3'));var router=express['Router']();var fs_extra=require(_0x4330('0x4'));var auth=require(_0x4330('0x5'));var interaction=require(_0x4330('0x6'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0x4330('0x7')]('/',auth[_0x4330('0x8')](),controller[_0x4330('0x9')]);router['get'](_0x4330('0xa'),auth['isAuthenticated'](),controller[_0x4330('0xb')]);router['get']('/:id/download',auth[_0x4330('0x8')](),controller[_0x4330('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4330('0xd')]);router[_0x4330('0xe')](_0x4330('0xa'),auth[_0x4330('0x8')](),controller[_0x4330('0xf')]);router['delete'](_0x4330('0xa'),auth[_0x4330('0x8')](),controller[_0x4330('0x10')]);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 889d448..2f32a3c 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 _0xb426=['STRING','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','getDataValue','INTEGER'];(function(_0x1b09d1,_0x21084c){var _0x2bf34f=function(_0x3264a8){while(--_0x3264a8){_0x1b09d1['push'](_0x1b09d1['shift']());}};_0x2bf34f(++_0x21084c);}(_0xb426,0x1ef));var _0x6b42=function(_0x3955b1,_0x51bf3a){_0x3955b1=_0x3955b1-0x0;var _0x15ce0b=_0xb426[_0x3955b1];return _0x15ce0b;};'use strict';var Sequelize=require(_0x6b42('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x226d72){return this[_0x6b42('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x6b42('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x6b42('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x6b42('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x6b42('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x6b42('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x6b42('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x6b42('0x3')],'defaultValue':''},'stamp':{'type':_0x6b42('0x4'),'defaultValue':Sequelize['literal'](_0x6b42('0x5'))}}; \ No newline at end of file +var _0xe7dd=['TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','STRING','BLOB','long'];(function(_0x4c081a,_0x364482){var _0x173615=function(_0x6d5f98){while(--_0x6d5f98){_0x4c081a['push'](_0x4c081a['shift']());}};_0x173615(++_0x364482);}(_0xe7dd,0x1bb));var _0xde7d=function(_0x2ed7eb,_0x4f3eab){_0x2ed7eb=_0x2ed7eb-0x0;var _0x56d195=_0xe7dd[_0x2ed7eb];return _0x56d195;};'use strict';var Sequelize=require(_0xde7d('0x0'));module[_0xde7d('0x1')]={'name':{'type':Sequelize[_0xde7d('0x2')],'get':function(_0x2d2d2f){return this[_0xde7d('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xde7d('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xde7d('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xde7d('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xde7d('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xde7d('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xde7d('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xde7d('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xde7d('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xde7d('0x5')](_0xde7d('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xde7d('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xde7d('0x4')],'defaultValue':''},'stamp':{'type':_0xde7d('0x7'),'defaultValue':Sequelize[_0xde7d('0x8')](_0xde7d('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 4d69f83..2b1607e 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 _0xcdb0=['options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','update','then','end','error','stack','name','index','VoiceMailMessage','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge'];(function(_0x5dbb84,_0x1bbce9){var _0x1d6eae=function(_0xd93967){while(--_0xd93967){_0x5dbb84['push'](_0x5dbb84['shift']());}};_0x1d6eae(++_0x1bbce9);}(_0xcdb0,0x1d1));var _0x0cdb=function(_0x20bf75,_0x14ccfc){_0x20bf75=_0x20bf75-0x0;var _0x463f4e=_0xcdb0[_0x20bf75];return _0x463f4e;};'use strict';var emlformat=require(_0x0cdb('0x0'));var rimraf=require(_0x0cdb('0x1'));var zipdir=require(_0x0cdb('0x2'));var jsonpatch=require(_0x0cdb('0x3'));var rp=require('request-promise');var moment=require(_0x0cdb('0x4'));var BPromise=require(_0x0cdb('0x5'));var Mustache=require(_0x0cdb('0x6'));var util=require('util');var path=require(_0x0cdb('0x7'));var sox=require(_0x0cdb('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cdb('0x9'));var _=require(_0x0cdb('0xa'));var squel=require(_0x0cdb('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0cdb('0xc'));var toCsv=require(_0x0cdb('0xd'));var querystring=require(_0x0cdb('0xe'));var Papa=require(_0x0cdb('0xf'));var Redis=require(_0x0cdb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0cdb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0cdb('0x12'));var logger=require(_0x0cdb('0x13'))('api');var utils=require(_0x0cdb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0cdb('0x15'));var db=require(_0x0cdb('0x16'))['db'];function respondWithStatusCode(_0x9d168d,_0x4ddf3d){_0x4ddf3d=_0x4ddf3d||0xcc;return function(_0x198a06){if(_0x198a06){return _0x9d168d[_0x0cdb('0x17')](_0x4ddf3d);}return _0x9d168d[_0x0cdb('0x18')](_0x4ddf3d)['end']();};}function respondWithResult(_0x140e2a,_0x10b7ff){_0x10b7ff=_0x10b7ff||0xc8;return function(_0x2309d6){if(_0x2309d6){return _0x140e2a[_0x0cdb('0x18')](_0x10b7ff)['json'](_0x2309d6);}};}function respondWithFilteredResult(_0x4e2fd5,_0x593f8c){return function(_0x2907f3){if(_0x2907f3){var _0x47d0bd=typeof _0x593f8c[_0x0cdb('0x19')]===_0x0cdb('0x1a')&&typeof _0x593f8c[_0x0cdb('0x1b')]===_0x0cdb('0x1a');var _0x1906b3=_0x2907f3[_0x0cdb('0x1c')];var _0xf54e25=_0x47d0bd?0x0:_0x593f8c[_0x0cdb('0x19')];var _0x3bffcc=_0x47d0bd?_0x2907f3[_0x0cdb('0x1c')]:_0x593f8c[_0x0cdb('0x19')]+_0x593f8c[_0x0cdb('0x1b')];var _0x175c56;if(_0x3bffcc>=_0x1906b3){_0x3bffcc=_0x1906b3;_0x175c56=0xc8;}else{_0x175c56=0xce;}_0x4e2fd5[_0x0cdb('0x18')](_0x175c56);return _0x4e2fd5[_0x0cdb('0x1d')]('Content-Range',_0xf54e25+'-'+_0x3bffcc+'/'+_0x1906b3)['json'](_0x2907f3);}return null;};}function patchUpdates(_0x4ef6de){return function(_0x4c8f69){try{jsonpatch[_0x0cdb('0x1e')](_0x4c8f69,_0x4ef6de,!![]);}catch(_0x4aa06e){return BPromise['reject'](_0x4aa06e);}return _0x4c8f69['save']();};}function saveUpdates(_0x29719f,_0x3b4b28){return function(_0x35f8fd){if(_0x35f8fd){return _0x35f8fd[_0x0cdb('0x1f')](_0x29719f)[_0x0cdb('0x20')](function(_0x5cbe8f){return _0x5cbe8f;});}return null;};}function removeEntity(_0x219f3a,_0x3342f4){return function(_0x581db7){if(_0x581db7){return _0x581db7['destroy']()[_0x0cdb('0x20')](function(){_0x219f3a[_0x0cdb('0x18')](0xcc)[_0x0cdb('0x21')]();});}};}function handleEntityNotFound(_0x4c11ca,_0x10844a){return function(_0x142f5d){if(!_0x142f5d){_0x4c11ca[_0x0cdb('0x17')](0x194);}return _0x142f5d;};}function handleError(_0x15afc9,_0x2851a5){_0x2851a5=_0x2851a5||0x1f4;return function(_0x2afc38){logger[_0x0cdb('0x22')](_0x2afc38[_0x0cdb('0x23')]);if(_0x2afc38[_0x0cdb('0x24')]){delete _0x2afc38[_0x0cdb('0x24')];}_0x15afc9[_0x0cdb('0x18')](_0x2851a5)['send'](_0x2afc38);};}exports[_0x0cdb('0x25')]=function(_0x25f817,_0x30e4b9){var _0x49e062={},_0x40fe9f={},_0x48061a={'count':0x0,'rows':[]};var _0x49460d=_['map'](db[_0x0cdb('0x26')]['rawAttributes'],function(_0x2bf9ca){return{'name':_0x2bf9ca['fieldName'],'type':_0x2bf9ca[_0x0cdb('0x27')]['key']};});_0x40fe9f[_0x0cdb('0x28')]=_['differenceBy'](_['map'](_0x49460d,_0x0cdb('0x24')),[_0x0cdb('0x24')]);_0x40fe9f[_0x0cdb('0x29')]=_['keys'](_0x25f817[_0x0cdb('0x29')]);_0x40fe9f[_0x0cdb('0x2a')]=_[_0x0cdb('0x2b')](_0x40fe9f[_0x0cdb('0x28')],_0x40fe9f[_0x0cdb('0x29')]);_0x49e062[_0x0cdb('0x2c')]=_['intersection'](_0x40fe9f['model'],qs[_0x0cdb('0x2d')](_0x25f817[_0x0cdb('0x29')][_0x0cdb('0x2d')]));_0x49e062['attributes']=_0x49e062[_0x0cdb('0x2c')][_0x0cdb('0x2e')]?_0x49e062[_0x0cdb('0x2c')]:_0x40fe9f[_0x0cdb('0x28')];if(!_0x25f817[_0x0cdb('0x29')][_0x0cdb('0x2f')]('nolimit')){_0x49e062['limit']=qs['limit'](_0x25f817['query'][_0x0cdb('0x1b')]);_0x49e062[_0x0cdb('0x19')]=qs['offset'](_0x25f817['query'][_0x0cdb('0x19')]);}_0x49e062['order']=qs[_0x0cdb('0x30')](_0x25f817[_0x0cdb('0x29')]['sort']);_0x49e062[_0x0cdb('0x31')]=qs[_0x0cdb('0x2a')](_[_0x0cdb('0x32')](_0x25f817[_0x0cdb('0x29')],_0x40fe9f[_0x0cdb('0x2a')]),_0x49460d);if(_0x25f817[_0x0cdb('0x29')][_0x0cdb('0x33')]){_0x49e062[_0x0cdb('0x31')]=_[_0x0cdb('0x34')](_0x49e062[_0x0cdb('0x31')],{'$or':_['map'](_0x49460d,function(_0x5ef24e){if(_0x5ef24e[_0x0cdb('0x27')]!=='VIRTUAL'){var _0x49a882={};_0x49a882[_0x5ef24e[_0x0cdb('0x24')]]={'$like':'%'+_0x25f817[_0x0cdb('0x29')][_0x0cdb('0x33')]+'%'};return _0x49a882;}})});}_0x49e062=_['merge']({},_0x49e062,_0x25f817[_0x0cdb('0x35')]);var _0x5926f6={'where':_0x49e062[_0x0cdb('0x31')]};return db[_0x0cdb('0x26')][_0x0cdb('0x1c')](_0x5926f6)['then'](function(_0x1850ec){_0x48061a['count']=_0x1850ec;if(_0x25f817[_0x0cdb('0x29')][_0x0cdb('0x36')]){_0x49e062[_0x0cdb('0x37')]=[{'all':!![]}];}return db[_0x0cdb('0x26')][_0x0cdb('0x38')](_0x49e062);})[_0x0cdb('0x20')](function(_0x5d2ab7){_0x48061a[_0x0cdb('0x39')]=_0x5d2ab7;return _0x48061a;})[_0x0cdb('0x20')](respondWithFilteredResult(_0x30e4b9,_0x49e062))[_0x0cdb('0x3a')](handleError(_0x30e4b9,null));};exports[_0x0cdb('0x3b')]=function(_0x21981d,_0xb15622){var _0x4294ec={'raw':!![],'where':{'id':_0x21981d[_0x0cdb('0x3c')]['id']}},_0x57e089={};_0x57e089[_0x0cdb('0x28')]=_[_0x0cdb('0x3d')](db[_0x0cdb('0x26')]['rawAttributes']);_0x57e089[_0x0cdb('0x29')]=_[_0x0cdb('0x3d')](_0x21981d['query']);_0x57e089[_0x0cdb('0x2a')]=_[_0x0cdb('0x2b')](_0x57e089[_0x0cdb('0x28')],_0x57e089[_0x0cdb('0x29')]);_0x4294ec['attributes']=_[_0x0cdb('0x2b')](_0x57e089[_0x0cdb('0x28')],qs[_0x0cdb('0x2d')](_0x21981d[_0x0cdb('0x29')][_0x0cdb('0x2d')]));_0x4294ec[_0x0cdb('0x2c')]=_0x4294ec[_0x0cdb('0x2c')][_0x0cdb('0x2e')]?_0x4294ec[_0x0cdb('0x2c')]:_0x57e089[_0x0cdb('0x28')];if(_0x21981d[_0x0cdb('0x29')]['includeAll']){_0x4294ec[_0x0cdb('0x37')]=[{'all':!![]}];}_0x4294ec=_[_0x0cdb('0x34')]({},_0x4294ec,_0x21981d[_0x0cdb('0x35')]);return db['VoiceMailMessage']['find'](_0x4294ec)[_0x0cdb('0x20')](handleEntityNotFound(_0xb15622,null))['then'](respondWithResult(_0xb15622,null))[_0x0cdb('0x3a')](handleError(_0xb15622,null));};exports[_0x0cdb('0x3e')]=function(_0x1ecc55,_0x4bbfe3){return db[_0x0cdb('0x26')][_0x0cdb('0x3e')](_0x1ecc55[_0x0cdb('0x3f')],{})[_0x0cdb('0x20')](respondWithResult(_0x4bbfe3,0xc9))[_0x0cdb('0x3a')](handleError(_0x4bbfe3,null));};exports[_0x0cdb('0x1f')]=function(_0xb0a22,_0x570ab0){if(_0xb0a22['body']['id']){delete _0xb0a22[_0x0cdb('0x3f')]['id'];}return db[_0x0cdb('0x26')]['find']({'where':{'id':_0xb0a22[_0x0cdb('0x3c')]['id']}})['then'](handleEntityNotFound(_0x570ab0,null))[_0x0cdb('0x20')](saveUpdates(_0xb0a22[_0x0cdb('0x3f')],null))[_0x0cdb('0x20')](respondWithResult(_0x570ab0,null))[_0x0cdb('0x3a')](handleError(_0x570ab0,null));};exports['destroy']=function(_0x3d252c,_0x361644){return db[_0x0cdb('0x26')][_0x0cdb('0x40')]({'where':{'id':_0x3d252c[_0x0cdb('0x3c')]['id']}})[_0x0cdb('0x20')](handleEntityNotFound(_0x361644,null))[_0x0cdb('0x20')](removeEntity(_0x361644,null))['catch'](handleError(_0x361644,null));};exports[_0x0cdb('0x41')]=function(_0x346ac7,_0x3de765,_0x19da27){return db[_0x0cdb('0x26')][_0x0cdb('0x40')]({'where':{'id':_0x346ac7[_0x0cdb('0x3c')]['id']},'attributes':['id',_0x0cdb('0x42'),'msg_id']})[_0x0cdb('0x20')](handleEntityNotFound(_0x3de765,null))['then'](function(_0x5b5293){if(_0x5b5293){if(!_0x5b5293['recording']){throw new db[(_0x0cdb('0x43'))][(_0x0cdb('0x44'))](_0x0cdb('0x45'));}var _0xbffeed={'Content-Type':_0x0cdb('0x46'),'Content-Disposition':_0x0cdb('0x47')};if(_0x5b5293['msg_id']){_0xbffeed[_0x0cdb('0x48')]='attachment;\x20filename=\x22'+_0x5b5293['msg_id']+_0x0cdb('0x49');}_0x3de765[_0x0cdb('0x1d')](_0xbffeed);return _0x3de765['send'](new Buffer(_0x5b5293[_0x0cdb('0x42')]));}})[_0x0cdb('0x3a')](handleError(_0x3de765,null));}; \ No newline at end of file +var _0xac26=['jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','fieldName','type','key','model','differenceBy','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','rawAttributes','length','find','create','body','download','recording','msg_id','VoiceMailMessage\x20not\x20found','audio/wav','attachment','.wav\x22','eml-format','rimraf','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x56c777,_0x4dfb40){var _0x5db70e=function(_0x562718){while(--_0x562718){_0x56c777['push'](_0x56c777['shift']());}};_0x5db70e(++_0x4dfb40);}(_0xac26,0x18a));var _0x6ac2=function(_0x254bfb,_0x266c28){_0x254bfb=_0x254bfb-0x0;var _0x1f28c1=_0xac26[_0x254bfb];return _0x1f28c1;};'use strict';var emlformat=require(_0x6ac2('0x0'));var rimraf=require(_0x6ac2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6ac2('0x2'));var moment=require(_0x6ac2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6ac2('0x4'));var util=require('util');var path=require(_0x6ac2('0x5'));var sox=require('sox');var csv=require(_0x6ac2('0x6'));var ejs=require(_0x6ac2('0x7'));var fs=require('fs');var fs_extra=require(_0x6ac2('0x8'));var _=require(_0x6ac2('0x9'));var squel=require('squel');var crypto=require(_0x6ac2('0xa'));var jsforce=require(_0x6ac2('0xb'));var deskjs=require(_0x6ac2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6ac2('0xd'));var Redis=require('ioredis');var authService=require(_0x6ac2('0xe'));var qs=require(_0x6ac2('0xf'));var as=require(_0x6ac2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6ac2('0x11'));var utils=require(_0x6ac2('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x6ac2('0x13'));var db=require(_0x6ac2('0x14'))['db'];function respondWithStatusCode(_0x23b4b2,_0x9d1550){_0x9d1550=_0x9d1550||0xcc;return function(_0xaceb0){if(_0xaceb0){return _0x23b4b2[_0x6ac2('0x15')](_0x9d1550);}return _0x23b4b2[_0x6ac2('0x16')](_0x9d1550)[_0x6ac2('0x17')]();};}function respondWithResult(_0x48ede1,_0x1c9de1){_0x1c9de1=_0x1c9de1||0xc8;return function(_0x1f0eb9){if(_0x1f0eb9){return _0x48ede1[_0x6ac2('0x16')](_0x1c9de1)[_0x6ac2('0x18')](_0x1f0eb9);}};}function respondWithFilteredResult(_0x357f11,_0x28a50f){return function(_0x2267c3){if(_0x2267c3){var _0x8af0dc=typeof _0x28a50f['offset']===_0x6ac2('0x19')&&typeof _0x28a50f[_0x6ac2('0x1a')]===_0x6ac2('0x19');var _0x252cc9=_0x2267c3[_0x6ac2('0x1b')];var _0xe3566b=_0x8af0dc?0x0:_0x28a50f[_0x6ac2('0x1c')];var _0x346ce2=_0x8af0dc?_0x2267c3[_0x6ac2('0x1b')]:_0x28a50f[_0x6ac2('0x1c')]+_0x28a50f[_0x6ac2('0x1a')];var _0x45df2f;if(_0x346ce2>=_0x252cc9){_0x346ce2=_0x252cc9;_0x45df2f=0xc8;}else{_0x45df2f=0xce;}_0x357f11[_0x6ac2('0x16')](_0x45df2f);return _0x357f11[_0x6ac2('0x1d')]('Content-Range',_0xe3566b+'-'+_0x346ce2+'/'+_0x252cc9)[_0x6ac2('0x18')](_0x2267c3);}return null;};}function patchUpdates(_0x7cc0f8){return function(_0x53fe32){try{jsonpatch[_0x6ac2('0x1e')](_0x53fe32,_0x7cc0f8,!![]);}catch(_0x4e2a3e){return BPromise[_0x6ac2('0x1f')](_0x4e2a3e);}return _0x53fe32[_0x6ac2('0x20')]();};}function saveUpdates(_0xc5ca91,_0x478e5f){return function(_0x7440bd){if(_0x7440bd){return _0x7440bd[_0x6ac2('0x21')](_0xc5ca91)[_0x6ac2('0x22')](function(_0x54b085){return _0x54b085;});}return null;};}function removeEntity(_0x44ee6d,_0x5b1fce){return function(_0x222a66){if(_0x222a66){return _0x222a66[_0x6ac2('0x23')]()['then'](function(){_0x44ee6d[_0x6ac2('0x16')](0xcc)[_0x6ac2('0x17')]();});}};}function handleEntityNotFound(_0x527a06,_0x2099e2){return function(_0x49ed22){if(!_0x49ed22){_0x527a06['sendStatus'](0x194);}return _0x49ed22;};}function handleError(_0x1aa735,_0x5cad76){_0x5cad76=_0x5cad76||0x1f4;return function(_0x1e97cc){logger[_0x6ac2('0x24')](_0x1e97cc[_0x6ac2('0x25')]);if(_0x1e97cc[_0x6ac2('0x26')]){delete _0x1e97cc['name'];}_0x1aa735[_0x6ac2('0x16')](_0x5cad76)[_0x6ac2('0x27')](_0x1e97cc);};}exports[_0x6ac2('0x28')]=function(_0x547fa0,_0x69a13b){var _0x4e07f7={},_0x49691b={},_0x54a3b3={'count':0x0,'rows':[]};var _0x36df8b=_[_0x6ac2('0x29')](db[_0x6ac2('0x2a')]['rawAttributes'],function(_0xf8edb5){return{'name':_0xf8edb5[_0x6ac2('0x2b')],'type':_0xf8edb5[_0x6ac2('0x2c')][_0x6ac2('0x2d')]};});_0x49691b[_0x6ac2('0x2e')]=_[_0x6ac2('0x2f')](_['map'](_0x36df8b,_0x6ac2('0x26')),['name']);_0x49691b['query']=_[_0x6ac2('0x30')](_0x547fa0['query']);_0x49691b[_0x6ac2('0x31')]=_[_0x6ac2('0x32')](_0x49691b[_0x6ac2('0x2e')],_0x49691b[_0x6ac2('0x33')]);_0x4e07f7[_0x6ac2('0x34')]=_[_0x6ac2('0x32')](_0x49691b[_0x6ac2('0x2e')],qs[_0x6ac2('0x35')](_0x547fa0[_0x6ac2('0x33')]['fields']));_0x4e07f7['attributes']=_0x4e07f7[_0x6ac2('0x34')]['length']?_0x4e07f7[_0x6ac2('0x34')]:_0x49691b[_0x6ac2('0x2e')];if(!_0x547fa0[_0x6ac2('0x33')][_0x6ac2('0x36')](_0x6ac2('0x37'))){_0x4e07f7[_0x6ac2('0x1a')]=qs[_0x6ac2('0x1a')](_0x547fa0['query'][_0x6ac2('0x1a')]);_0x4e07f7[_0x6ac2('0x1c')]=qs[_0x6ac2('0x1c')](_0x547fa0[_0x6ac2('0x33')]['offset']);}_0x4e07f7[_0x6ac2('0x38')]=qs['sort'](_0x547fa0[_0x6ac2('0x33')][_0x6ac2('0x39')]);_0x4e07f7['where']=qs[_0x6ac2('0x31')](_[_0x6ac2('0x3a')](_0x547fa0[_0x6ac2('0x33')],_0x49691b[_0x6ac2('0x31')]),_0x36df8b);if(_0x547fa0[_0x6ac2('0x33')]['filter']){_0x4e07f7[_0x6ac2('0x3b')]=_[_0x6ac2('0x3c')](_0x4e07f7[_0x6ac2('0x3b')],{'$or':_['map'](_0x36df8b,function(_0x5ebdf8){if(_0x5ebdf8[_0x6ac2('0x2c')]!==_0x6ac2('0x3d')){var _0x4ea8f0={};_0x4ea8f0[_0x5ebdf8[_0x6ac2('0x26')]]={'$like':'%'+_0x547fa0[_0x6ac2('0x33')][_0x6ac2('0x3e')]+'%'};return _0x4ea8f0;}})});}_0x4e07f7=_[_0x6ac2('0x3c')]({},_0x4e07f7,_0x547fa0[_0x6ac2('0x3f')]);var _0x269694={'where':_0x4e07f7[_0x6ac2('0x3b')]};return db[_0x6ac2('0x2a')]['count'](_0x269694)[_0x6ac2('0x22')](function(_0x529608){_0x54a3b3['count']=_0x529608;if(_0x547fa0[_0x6ac2('0x33')][_0x6ac2('0x40')]){_0x4e07f7[_0x6ac2('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x4e07f7);})[_0x6ac2('0x22')](function(_0x43fd57){_0x54a3b3[_0x6ac2('0x42')]=_0x43fd57;return _0x54a3b3;})[_0x6ac2('0x22')](respondWithFilteredResult(_0x69a13b,_0x4e07f7))[_0x6ac2('0x43')](handleError(_0x69a13b,null));};exports['show']=function(_0x182d57,_0xae4c10){var _0x257794={'raw':!![],'where':{'id':_0x182d57[_0x6ac2('0x44')]['id']}},_0x1b8f56={};_0x1b8f56['model']=_['keys'](db[_0x6ac2('0x2a')][_0x6ac2('0x45')]);_0x1b8f56[_0x6ac2('0x33')]=_['keys'](_0x182d57['query']);_0x1b8f56[_0x6ac2('0x31')]=_[_0x6ac2('0x32')](_0x1b8f56[_0x6ac2('0x2e')],_0x1b8f56[_0x6ac2('0x33')]);_0x257794['attributes']=_[_0x6ac2('0x32')](_0x1b8f56['model'],qs[_0x6ac2('0x35')](_0x182d57[_0x6ac2('0x33')]['fields']));_0x257794['attributes']=_0x257794[_0x6ac2('0x34')][_0x6ac2('0x46')]?_0x257794[_0x6ac2('0x34')]:_0x1b8f56[_0x6ac2('0x2e')];if(_0x182d57[_0x6ac2('0x33')][_0x6ac2('0x40')]){_0x257794[_0x6ac2('0x41')]=[{'all':!![]}];}_0x257794=_[_0x6ac2('0x3c')]({},_0x257794,_0x182d57[_0x6ac2('0x3f')]);return db[_0x6ac2('0x2a')][_0x6ac2('0x47')](_0x257794)[_0x6ac2('0x22')](handleEntityNotFound(_0xae4c10,null))[_0x6ac2('0x22')](respondWithResult(_0xae4c10,null))[_0x6ac2('0x43')](handleError(_0xae4c10,null));};exports[_0x6ac2('0x48')]=function(_0x164a0e,_0xb93807){return db[_0x6ac2('0x2a')]['create'](_0x164a0e[_0x6ac2('0x49')],{})[_0x6ac2('0x22')](respondWithResult(_0xb93807,0xc9))[_0x6ac2('0x43')](handleError(_0xb93807,null));};exports[_0x6ac2('0x21')]=function(_0x48cc17,_0xfa32e5){if(_0x48cc17[_0x6ac2('0x49')]['id']){delete _0x48cc17[_0x6ac2('0x49')]['id'];}return db['VoiceMailMessage'][_0x6ac2('0x47')]({'where':{'id':_0x48cc17[_0x6ac2('0x44')]['id']}})[_0x6ac2('0x22')](handleEntityNotFound(_0xfa32e5,null))[_0x6ac2('0x22')](saveUpdates(_0x48cc17[_0x6ac2('0x49')],null))[_0x6ac2('0x22')](respondWithResult(_0xfa32e5,null))[_0x6ac2('0x43')](handleError(_0xfa32e5,null));};exports[_0x6ac2('0x23')]=function(_0x5e4812,_0x3cca12){return db[_0x6ac2('0x2a')][_0x6ac2('0x47')]({'where':{'id':_0x5e4812[_0x6ac2('0x44')]['id']}})[_0x6ac2('0x22')](handleEntityNotFound(_0x3cca12,null))['then'](removeEntity(_0x3cca12,null))[_0x6ac2('0x43')](handleError(_0x3cca12,null));};exports[_0x6ac2('0x4a')]=function(_0x16f2b9,_0x51ef15,_0x32b0f3){return db[_0x6ac2('0x2a')][_0x6ac2('0x47')]({'where':{'id':_0x16f2b9['params']['id']},'attributes':['id',_0x6ac2('0x4b'),_0x6ac2('0x4c')]})[_0x6ac2('0x22')](handleEntityNotFound(_0x51ef15,null))[_0x6ac2('0x22')](function(_0x11f21f){if(_0x11f21f){if(!_0x11f21f[_0x6ac2('0x4b')]){throw new db['Sequelize']['ValidationError'](_0x6ac2('0x4d'));}var _0x347d07={'Content-Type':_0x6ac2('0x4e'),'Content-Disposition':_0x6ac2('0x4f')};if(_0x11f21f[_0x6ac2('0x4c')]){_0x347d07['Content-Disposition']='attachment;\x20filename=\x22'+_0x11f21f[_0x6ac2('0x4c')]+_0x6ac2('0x50');}_0x51ef15[_0x6ac2('0x1d')](_0x347d07);return _0x51ef15[_0x6ac2('0x27')](new Buffer(_0x11f21f[_0x6ac2('0x4b')]));}})['catch'](handleError(_0x51ef15,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index a0c737e..fc07cc0 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 _0x2fef=['VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x565fe0,_0x1c1b82){var _0x42df4d=function(_0x1e52a3){while(--_0x1e52a3){_0x565fe0['push'](_0x565fe0['shift']());}};_0x42df4d(++_0x1c1b82);}(_0x2fef,0x14d));var _0xf2fe=function(_0x1bfd25,_0x349005){_0x1bfd25=_0x1bfd25-0x0;var _0x11804d=_0x2fef[_0x1bfd25];return _0x11804d;};'use strict';var _=require(_0xf2fe('0x0'));var util=require(_0xf2fe('0x1'));var logger=require(_0xf2fe('0x2'))(_0xf2fe('0x3'));var moment=require(_0xf2fe('0x4'));var BPromise=require(_0xf2fe('0x5'));var rp=require(_0xf2fe('0x6'));var fs=require('fs');var path=require(_0xf2fe('0x7'));var rimraf=require(_0xf2fe('0x8'));var config=require(_0xf2fe('0x9'));var attributes=require('./voiceMailMessage.attributes');module[_0xf2fe('0xa')]=function(_0x33d803,_0xcb0084){return _0x33d803[_0xf2fe('0xb')](_0xf2fe('0xc'),attributes,{'tableName':_0xf2fe('0xd'),'paranoid':![],'indexes':[{'name':_0xf2fe('0xe'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0xcada=['request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xcada,0x1da));var _0xacad=function(_0x37ac94,_0x3dd629){_0x37ac94=_0x37ac94-0x0;var _0x2f1557=_0xcada[_0x37ac94];return _0x2f1557;};'use strict';var _=require(_0xacad('0x0'));var util=require(_0xacad('0x1'));var logger=require(_0xacad('0x2'))(_0xacad('0x3'));var moment=require(_0xacad('0x4'));var BPromise=require(_0xacad('0x5'));var rp=require(_0xacad('0x6'));var fs=require('fs');var path=require(_0xacad('0x7'));var rimraf=require(_0xacad('0x8'));var config=require(_0xacad('0x9'));var attributes=require(_0xacad('0xa'));module[_0xacad('0xb')]=function(_0xe78cd0,_0x39d848){return _0xe78cd0[_0xacad('0xc')](_0xacad('0xd'),attributes,{'tableName':_0xacad('0xe'),'paranoid':![],'indexes':[{'name':_0xacad('0xf'),'fields':[_0xacad('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 67c8a71..bc0b014 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 _0xf4d2=['../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x4b7150,_0x5c23df){var _0x298641=function(_0x27e5b0){while(--_0x27e5b0){_0x4b7150['push'](_0x4b7150['shift']());}};_0x298641(++_0x5c23df);}(_0xf4d2,0x151));var _0x2f4d=function(_0x317a3d,_0xa3d8ad){_0x317a3d=_0x317a3d-0x0;var _0x41e886=_0xf4d2[_0x317a3d];return _0x41e886;};'use strict';var _=require(_0x2f4d('0x0'));var util=require(_0x2f4d('0x1'));var moment=require(_0x2f4d('0x2'));var BPromise=require(_0x2f4d('0x3'));var rs=require(_0x2f4d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f4d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f4d('0x6'))(_0x2f4d('0x7'));var config=require(_0x2f4d('0x8'));var jayson=require(_0x2f4d('0x9'));var client=jayson[_0x2f4d('0xa')][_0x2f4d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17f565,_0x17cab2,_0x12a50d){return new BPromise(function(_0x545172,_0xd84336){return client[_0x2f4d('0xc')](_0x17f565,_0x12a50d)[_0x2f4d('0xd')](function(_0x1f6f7b){logger[_0x2f4d('0xe')](_0x2f4d('0xf'),_0x17cab2,_0x2f4d('0x10'));logger[_0x2f4d('0x11')](_0x2f4d('0x12'),_0x17cab2,_0x2f4d('0x10'),JSON['stringify'](_0x1f6f7b));if(_0x1f6f7b['error']){if(_0x1f6f7b[_0x2f4d('0x13')][_0x2f4d('0x14')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x17cab2,_0x1f6f7b['error'][_0x2f4d('0x15')]);return _0xd84336(_0x1f6f7b[_0x2f4d('0x13')][_0x2f4d('0x15')]);}logger[_0x2f4d('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x17cab2,_0x1f6f7b[_0x2f4d('0x13')][_0x2f4d('0x15')]);return _0x545172(_0x1f6f7b[_0x2f4d('0x13')][_0x2f4d('0x15')]);}else{logger[_0x2f4d('0xe')](_0x2f4d('0xf'),_0x17cab2,_0x2f4d('0x10'));_0x545172(_0x1f6f7b['result'][_0x2f4d('0x15')]);}})[_0x2f4d('0x16')](function(_0x342ade){logger['error'](_0x2f4d('0xf'),_0x17cab2,_0x342ade);_0xd84336(_0x342ade);});});} \ No newline at end of file +var _0x1bd2=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1fd99c,_0x40edb2){var _0xa0af73=function(_0x309c94){while(--_0x309c94){_0x1fd99c['push'](_0x1fd99c['shift']());}};_0xa0af73(++_0x40edb2);}(_0x1bd2,0xb3));var _0x21bd=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x1bd2[_0xa148b7];return _0x51efd3;};'use strict';var _=require('lodash');var util=require(_0x21bd('0x0'));var moment=require(_0x21bd('0x1'));var BPromise=require(_0x21bd('0x2'));var rs=require(_0x21bd('0x3'));var fs=require('fs');var Redis=require(_0x21bd('0x4'));var db=require(_0x21bd('0x5'))['db'];var utils=require(_0x21bd('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x21bd('0x7'));var jayson=require(_0x21bd('0x8'));var client=jayson['client'][_0x21bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44f437,_0x29a054,_0x15ec41){return new BPromise(function(_0x485250,_0xb01539){return client[_0x21bd('0xa')](_0x44f437,_0x15ec41)[_0x21bd('0xb')](function(_0x4a9fa2){logger[_0x21bd('0xc')](_0x21bd('0xd'),_0x29a054,_0x21bd('0xe'));logger['debug'](_0x21bd('0xf'),_0x29a054,_0x21bd('0xe'),JSON[_0x21bd('0x10')](_0x4a9fa2));if(_0x4a9fa2[_0x21bd('0x11')]){if(_0x4a9fa2[_0x21bd('0x11')][_0x21bd('0x12')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x29a054,_0x4a9fa2[_0x21bd('0x11')]['message']);return _0xb01539(_0x4a9fa2[_0x21bd('0x11')]['message']);}logger[_0x21bd('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x29a054,_0x4a9fa2[_0x21bd('0x11')][_0x21bd('0x13')]);return _0x485250(_0x4a9fa2['error'][_0x21bd('0x13')]);}else{logger[_0x21bd('0xc')](_0x21bd('0xd'),_0x29a054,_0x21bd('0xe'));_0x485250(_0x4a9fa2[_0x21bd('0x14')][_0x21bd('0x13')]);}})[_0x21bd('0x15')](function(_0x6138ea){logger['error'](_0x21bd('0xd'),_0x29a054,_0x6138ea);_0xb01539(_0x6138ea);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 3cf523d..da4c3da 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 _0x36d7=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','/:id/sounds','post','create','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports'];(function(_0xe12c2e,_0x3fcdc9){var _0xa5da69=function(_0xf8ff23){while(--_0xf8ff23){_0xe12c2e['push'](_0xe12c2e['shift']());}};_0xa5da69(++_0x3fcdc9);}(_0x36d7,0x1e3));var _0x736d=function(_0x33ddea,_0x222f65){_0x33ddea=_0x33ddea-0x0;var _0x5e2f59=_0x36d7[_0x33ddea];return _0x5e2f59;};'use strict';var multer=require('multer');var util=require(_0x736d('0x0'));var path=require(_0x736d('0x1'));var timeout=require(_0x736d('0x2'));var express=require(_0x736d('0x3'));var router=express[_0x736d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x736d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x736d('0x6'));var controller=require(_0x736d('0x7'));router[_0x736d('0x8')]('/',auth[_0x736d('0x9')](),controller[_0x736d('0xa')]);router[_0x736d('0x8')](_0x736d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x736d('0x8')](_0x736d('0xc'),auth[_0x736d('0x9')](),controller['getSounds']);router[_0x736d('0xd')]('/',auth['isAuthenticated'](),controller[_0x736d('0xe')]);router[_0x736d('0xd')](_0x736d('0xc'),auth[_0x736d('0x9')](),controller[_0x736d('0xf')]);router[_0x736d('0x10')]('/:id',auth[_0x736d('0x9')](),controller[_0x736d('0x11')]);router[_0x736d('0x12')](_0x736d('0xb'),auth['isAuthenticated'](),controller[_0x736d('0x13')]);router['delete'](_0x736d('0x14'),auth[_0x736d('0x9')](),controller[_0x736d('0x15')]);module[_0x736d('0x16')]=router; \ No newline at end of file +var _0xb853=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/sounds','post','create','addSound','put','update','/:id','destroy','delete','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','express','Router'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xb853,0x8d));var _0x3b85=function(_0x2727f7,_0x224e26){_0x2727f7=_0x2727f7-0x0;var _0x58c95e=_0xb853[_0x2727f7];return _0x58c95e;};'use strict';var multer=require(_0x3b85('0x0'));var util=require(_0x3b85('0x1'));var path=require(_0x3b85('0x2'));var timeout=require(_0x3b85('0x3'));var express=require(_0x3b85('0x4'));var router=express[_0x3b85('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3b85('0x6'));var config=require(_0x3b85('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0x3b85('0x8')]('/',auth[_0x3b85('0x9')](),controller['index']);router['get']('/:id',auth[_0x3b85('0x9')](),controller['show']);router['get'](_0x3b85('0xa'),auth['isAuthenticated'](),controller['getSounds']);router[_0x3b85('0xb')]('/',auth[_0x3b85('0x9')](),controller[_0x3b85('0xc')]);router[_0x3b85('0xb')](_0x3b85('0xa'),auth[_0x3b85('0x9')](),controller[_0x3b85('0xd')]);router[_0x3b85('0xe')]('/:id',auth[_0x3b85('0x9')](),controller[_0x3b85('0xf')]);router['delete'](_0x3b85('0x10'),auth[_0x3b85('0x9')](),controller[_0x3b85('0x11')]);router[_0x3b85('0x12')](_0x3b85('0x13'),auth[_0x3b85('0x9')](),controller[_0x3b85('0x14')]);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 686f913..649d09a 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 _0x4af3=['alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','name','ENUM','custom','files','mp3nb','quietmp3','mp3'];(function(_0x34ee9c,_0x5d3459){var _0x293774=function(_0x2953c1){while(--_0x2953c1){_0x34ee9c['push'](_0x34ee9c['shift']());}};_0x293774(++_0x5d3459);}(_0x4af3,0xcf));var _0x34af=function(_0x4cbce7,_0x139ba2){_0x4cbce7=_0x4cbce7-0x0;var _0x127bf5=_0x4af3[_0x4cbce7];return _0x127bf5;};'use strict';var Sequelize=require(_0x34af('0x0'));module['exports']={'name':{'type':Sequelize[_0x34af('0x1')],'allowNull':![],'unique':_0x34af('0x2')},'mode':{'type':Sequelize[_0x34af('0x3')](_0x34af('0x4'),_0x34af('0x5'),_0x34af('0x6'),'quietmp3nb',_0x34af('0x7'),_0x34af('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x34af('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x34af('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x34af('0x1')],'allowNull':!![],'defaultValue':_0x34af('0x9')},'format':{'type':Sequelize[_0x34af('0x1')],'allowNull':!![]},'stamp':{'type':_0x34af('0xa')},'defaultEntry':{'type':Sequelize[_0x34af('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8f25=['sequelize','exports','name','ENUM','files','mp3nb','quietmp3nb','quietmp3','STRING','BOOLEAN'];(function(_0x25dc00,_0x41d856){var _0x4e6fa6=function(_0x5e2191){while(--_0x5e2191){_0x25dc00['push'](_0x25dc00['shift']());}};_0x4e6fa6(++_0x41d856);}(_0x8f25,0xbe));var _0x58f2=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8f25[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x58f2('0x0'));module[_0x58f2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x58f2('0x2')},'mode':{'type':Sequelize[_0x58f2('0x3')]('custom',_0x58f2('0x4'),_0x58f2('0x5'),_0x58f2('0x6'),_0x58f2('0x7'),'mp3'),'allowNull':!![],'defaultValue':_0x58f2('0x4')},'directory':{'type':Sequelize[_0x58f2('0x8')],'allowNull':!![]},'application':{'type':Sequelize[_0x58f2('0x8')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x58f2('0x8')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x58f2('0x9')],'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 74a6077..829906e 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 _0x3538=['transaction','mode','files','directory','join','server/files/moh','mkdirSync','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','sequelize','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','findOne','save_name','converted_format','root','server/files/sounds/converted','format','symlinkSync','removeSound','id2','Sound','createdAt','%s.%s','getSounds','rawAttributes','pick','merge','nolimit','eml-format','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','update','destroy','then','get','MusicOnHolds','UserProfileResource','error','stack','name','index','map','VoiceMusicOnHold','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','create'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x3538,0x1df));var _0x8353=function(_0x1bcd9e,_0x5ba095){_0x1bcd9e=_0x1bcd9e-0x0;var _0x5a7045=_0x3538[_0x1bcd9e];return _0x5a7045;};'use strict';var emlformat=require(_0x8353('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8353('0x1'));var rp=require(_0x8353('0x2'));var moment=require(_0x8353('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8353('0x4'));var path=require('path');var sox=require(_0x8353('0x5'));var csv=require(_0x8353('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8353('0x7'));var _=require(_0x8353('0x8'));var squel=require(_0x8353('0x9'));var crypto=require(_0x8353('0xa'));var jsforce=require(_0x8353('0xb'));var deskjs=require(_0x8353('0xc'));var toCsv=require(_0x8353('0x6'));var querystring=require(_0x8353('0xd'));var Papa=require(_0x8353('0xe'));var Redis=require(_0x8353('0xf'));var authService=require(_0x8353('0x10'));var qs=require(_0x8353('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8353('0x12'));var logger=require(_0x8353('0x13'))(_0x8353('0x14'));var utils=require(_0x8353('0x15'));var config=require(_0x8353('0x16'));var licenseUtil=require(_0x8353('0x17'));var db=require(_0x8353('0x18'))['db'];function respondWithStatusCode(_0x2fad28,_0x4635d0){_0x4635d0=_0x4635d0||0xcc;return function(_0x502c95){if(_0x502c95){return _0x2fad28[_0x8353('0x19')](_0x4635d0);}return _0x2fad28[_0x8353('0x1a')](_0x4635d0)[_0x8353('0x1b')]();};}function respondWithResult(_0x7efd5e,_0x4a7a56){_0x4a7a56=_0x4a7a56||0xc8;return function(_0x4bcbeb){if(_0x4bcbeb){return _0x7efd5e['status'](_0x4a7a56)[_0x8353('0x1c')](_0x4bcbeb);}};}function respondWithFilteredResult(_0x59ffc5,_0x26e297){return function(_0xb7cdd1){if(_0xb7cdd1){var _0x3d6367=typeof _0x26e297[_0x8353('0x1d')]==='undefined'&&typeof _0x26e297[_0x8353('0x1e')]===_0x8353('0x1f');var _0x391bd4=_0xb7cdd1[_0x8353('0x20')];var _0x30d764=_0x3d6367?0x0:_0x26e297[_0x8353('0x1d')];var _0x40e144=_0x3d6367?_0xb7cdd1['count']:_0x26e297[_0x8353('0x1d')]+_0x26e297['limit'];var _0x5e9eca;if(_0x40e144>=_0x391bd4){_0x40e144=_0x391bd4;_0x5e9eca=0xc8;}else{_0x5e9eca=0xce;}_0x59ffc5[_0x8353('0x1a')](_0x5e9eca);return _0x59ffc5['set']('Content-Range',_0x30d764+'-'+_0x40e144+'/'+_0x391bd4)['json'](_0xb7cdd1);}return null;};}function patchUpdates(_0x20ae9f){return function(_0x29f190){try{jsonpatch['apply'](_0x29f190,_0x20ae9f,!![]);}catch(_0x5b075f){return BPromise['reject'](_0x5b075f);}return _0x29f190['save']();};}function saveUpdates(_0x14a2e5,_0x12d56a){return function(_0x223400){if(_0x223400){return _0x223400[_0x8353('0x21')](_0x14a2e5)['then'](function(_0x33fa59){return _0x33fa59;});}return null;};}function removeEntity(_0x15a4ad,_0x5d9967){return function(_0x44acf9){if(_0x44acf9){return _0x44acf9[_0x8353('0x22')]()[_0x8353('0x23')](function(){var _0x28577e=_0x44acf9[_0x8353('0x24')]({'plain':!![]});var _0x4e9660=_0x8353('0x25');return db[_0x8353('0x26')][_0x8353('0x22')]({'where':{'type':_0x4e9660,'resourceId':_0x28577e['id']}})[_0x8353('0x23')](function(){return _0x44acf9;});})[_0x8353('0x23')](function(){_0x15a4ad[_0x8353('0x1a')](0xcc)[_0x8353('0x1b')]();});}};}function handleEntityNotFound(_0x5d9d05,_0x25b4e3){return function(_0x254520){if(!_0x254520){_0x5d9d05[_0x8353('0x19')](0x194);}return _0x254520;};}function handleError(_0x4c110a,_0x1741ee){_0x1741ee=_0x1741ee||0x1f4;return function(_0x3d7577){logger[_0x8353('0x27')](_0x3d7577[_0x8353('0x28')]);if(_0x3d7577[_0x8353('0x29')]){delete _0x3d7577[_0x8353('0x29')];}_0x4c110a['status'](_0x1741ee)['send'](_0x3d7577);};}exports[_0x8353('0x2a')]=function(_0x793d43,_0x4aeff0){var _0x66296e={},_0x25d220={},_0xa223fe={'count':0x0,'rows':[]};var _0x56e7f1=_[_0x8353('0x2b')](db[_0x8353('0x2c')]['rawAttributes'],function(_0xf0a207){return{'name':_0xf0a207[_0x8353('0x2d')],'type':_0xf0a207[_0x8353('0x2e')]['key']};});_0x25d220[_0x8353('0x2f')]=_[_0x8353('0x2b')](_0x56e7f1,'name');_0x25d220[_0x8353('0x30')]=_[_0x8353('0x31')](_0x793d43[_0x8353('0x30')]);_0x25d220[_0x8353('0x32')]=_[_0x8353('0x33')](_0x25d220[_0x8353('0x2f')],_0x25d220['query']);_0x66296e['attributes']=_[_0x8353('0x33')](_0x25d220['model'],qs['fields'](_0x793d43['query'][_0x8353('0x34')]));_0x66296e['attributes']=_0x66296e[_0x8353('0x35')][_0x8353('0x36')]?_0x66296e[_0x8353('0x35')]:_0x25d220['model'];if(!_0x793d43[_0x8353('0x30')][_0x8353('0x37')]('nolimit')){_0x66296e[_0x8353('0x1e')]=qs[_0x8353('0x1e')](_0x793d43[_0x8353('0x30')][_0x8353('0x1e')]);_0x66296e[_0x8353('0x1d')]=qs['offset'](_0x793d43[_0x8353('0x30')][_0x8353('0x1d')]);}_0x66296e[_0x8353('0x38')]=qs[_0x8353('0x39')](_0x793d43[_0x8353('0x30')]['sort']);delete _0x793d43[_0x8353('0x30')][_0x8353('0x39')];_0x66296e[_0x8353('0x3a')]=qs[_0x8353('0x32')](_['pick'](_0x793d43[_0x8353('0x30')],_0x25d220[_0x8353('0x32')]),_0x56e7f1);if(_0x793d43[_0x8353('0x30')][_0x8353('0x3b')]){_0x66296e[_0x8353('0x3a')]=_['merge'](_0x66296e[_0x8353('0x3a')],{'$or':_['map'](_0x56e7f1,function(_0x3509d0){if(_0x3509d0[_0x8353('0x2e')]!==_0x8353('0x3c')){var _0x54360e={};_0x54360e[_0x3509d0[_0x8353('0x29')]]={'$like':'%'+_0x793d43[_0x8353('0x30')]['filter']+'%'};return _0x54360e;}})});}_0x66296e=_['merge']({},_0x66296e,_0x793d43[_0x8353('0x3d')]);var _0x4afd0e={'where':_0x66296e[_0x8353('0x3a')]};return db[_0x8353('0x2c')][_0x8353('0x20')](_0x4afd0e)['then'](function(_0x51feff){_0xa223fe[_0x8353('0x20')]=_0x51feff;if(_0x793d43['query'][_0x8353('0x3e')]){_0x66296e[_0x8353('0x3f')]=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x66296e);})[_0x8353('0x23')](function(_0xa3c27c){_0xa223fe[_0x8353('0x40')]=_0xa3c27c;return _0xa223fe;})[_0x8353('0x23')](respondWithFilteredResult(_0x4aeff0,_0x66296e))[_0x8353('0x41')](handleError(_0x4aeff0,null));};exports[_0x8353('0x42')]=function(_0x23c08e,_0x501684){var _0x533e0b={'raw':![],'where':{'id':_0x23c08e[_0x8353('0x43')]['id']}},_0x349d12={};_0x349d12[_0x8353('0x2f')]=_[_0x8353('0x31')](db[_0x8353('0x2c')]['rawAttributes']);_0x349d12[_0x8353('0x30')]=_[_0x8353('0x31')](_0x23c08e['query']);_0x349d12[_0x8353('0x32')]=_[_0x8353('0x33')](_0x349d12['model'],_0x349d12[_0x8353('0x30')]);_0x533e0b[_0x8353('0x35')]=_[_0x8353('0x33')](_0x349d12[_0x8353('0x2f')],qs[_0x8353('0x34')](_0x23c08e['query']['fields']));_0x533e0b[_0x8353('0x35')]=_0x533e0b[_0x8353('0x35')][_0x8353('0x36')]?_0x533e0b[_0x8353('0x35')]:_0x349d12[_0x8353('0x2f')];if(_0x23c08e[_0x8353('0x30')]['includeAll']){_0x533e0b['include']=[{'all':!![]}];}_0x533e0b=_['merge']({},_0x533e0b,_0x23c08e[_0x8353('0x3d')]);return db[_0x8353('0x2c')][_0x8353('0x44')](_0x533e0b)[_0x8353('0x23')](handleEntityNotFound(_0x501684,null))[_0x8353('0x23')](respondWithResult(_0x501684,null))[_0x8353('0x41')](handleError(_0x501684,null));};exports[_0x8353('0x21')]=function(_0x25171e,_0x2f2a9a){if(_0x25171e[_0x8353('0x45')]['id']){delete _0x25171e[_0x8353('0x45')]['id'];}return db[_0x8353('0x2c')][_0x8353('0x44')]({'where':{'id':_0x25171e[_0x8353('0x43')]['id']}})[_0x8353('0x23')](handleEntityNotFound(_0x2f2a9a,null))[_0x8353('0x23')](saveUpdates(_0x25171e[_0x8353('0x45')],null))['then'](respondWithResult(_0x2f2a9a,null))[_0x8353('0x41')](handleError(_0x2f2a9a,null));};exports[_0x8353('0x46')]=function(_0x1b1f2f,_0x9de570,_0x1938f4){return db['sequelize'][_0x8353('0x47')](function(_0x580628){if(_0x1b1f2f[_0x8353('0x45')][_0x8353('0x48')]===_0x8353('0x49')){_0x1b1f2f[_0x8353('0x45')][_0x8353('0x4a')]=path[_0x8353('0x4b')](config['root'],_0x8353('0x4c'),_0x1b1f2f[_0x8353('0x45')]['name']);}return db[_0x8353('0x2c')][_0x8353('0x46')](_0x1b1f2f[_0x8353('0x45')],{'transaction':_0x580628})['then'](function(_0x56e2f5){if(_0x1b1f2f['body']['mode']===_0x8353('0x49')){fs[_0x8353('0x4d')](_0x56e2f5[_0x8353('0x4a')],parseInt('0777',0x8));}var _0x1bab7f=_0x1b1f2f['user'][_0x8353('0x24')]({'plain':!![]});if(!_0x1bab7f)throw new Error(_0x8353('0x4e'));if(_0x1bab7f[_0x8353('0x4f')]===_0x8353('0x50')){var _0x59aa31=_0x56e2f5[_0x8353('0x24')]({'plain':!![]});return db[_0x8353('0x51')][_0x8353('0x44')]({'where':{'name':_0x8353('0x25'),'userProfileId':_0x1bab7f[_0x8353('0x52')]},'raw':!![]})[_0x8353('0x23')](function(_0x3f90cb){if(_0x3f90cb&&_0x3f90cb[_0x8353('0x53')]===0x0){return db[_0x8353('0x26')][_0x8353('0x46')]({'name':_0x59aa31[_0x8353('0x29')],'resourceId':_0x59aa31['id'],'type':_0x3f90cb['name'],'sectionId':_0x3f90cb['id']},{})[_0x8353('0x23')](function(){return _0x56e2f5;});}else{return _0x56e2f5;}})['catch'](function(_0xad2d12){logger[_0x8353('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xad2d12);});}return _0x56e2f5;});})[_0x8353('0x23')](respondWithResult(_0x9de570,0xc9))[_0x8353('0x41')](handleError(_0x9de570,null));};exports[_0x8353('0x22')]=function(_0x51458f,_0x5e9c95,_0x308c1c){var _0x32b030;return db[_0x8353('0x2c')][_0x8353('0x44')]({'where':{'id':_0x51458f['params']['id']}})['then'](function(_0x533e94){if(_0x533e94){return db[_0x8353('0x54')][_0x8353('0x47')](function(_0x44d6e6){return _0x533e94[_0x8353('0x22')]({'transaction':_0x44d6e6,'raw':!![]})[_0x8353('0x23')](function(_0xca0065){if(_0xca0065[_0x8353('0x4a')]){fs[_0x8353('0x55')](_0xca0065[_0x8353('0x4a')])[_0x8353('0x56')](function(_0x3ab9f8){fs[_0x8353('0x57')](path['join'](_0xca0065['directory'],_0x3ab9f8));});fs[_0x8353('0x58')](_0xca0065[_0x8353('0x4a')]);}return _0xca0065;});})['catch'](function(_0x49d490){throw new db[(_0x8353('0x59'))][(_0x8353('0x5a'))](_0x49d490[_0x8353('0x5b')]);});}})[_0x8353('0x23')](handleEntityNotFound(_0x5e9c95,null))[_0x8353('0x23')](removeEntity(_0x5e9c95,null))['catch'](handleError(_0x5e9c95,null));};exports[_0x8353('0x5c')]=function(_0x227ab9,_0x4c7974,_0x33eca2){return db['sequelize'][_0x8353('0x47')](function(_0x24c558){var _0x14b2a0;return db[_0x8353('0x2c')][_0x8353('0x44')]({'where':{'id':_0x227ab9[_0x8353('0x43')]['id']}})['then'](function(_0x34c5ca){if(_0x34c5ca){_0x14b2a0=_0x34c5ca;return _0x34c5ca['addSound'](_0x227ab9['body']['id'],{'transaction':_0x24c558});}})[_0x8353('0x23')](function(_0x5d274e){if(_0x5d274e){return db['Sound'][_0x8353('0x5d')]({'where':{'id':_0x227ab9[_0x8353('0x45')]['id']},'attributes':['id',_0x8353('0x29'),_0x8353('0x5e'),_0x8353('0x5f'),'createdAt'],'raw':!![]});}})[_0x8353('0x23')](function(_0x1903ac){if(_0x1903ac){var _0x3da89d=path[_0x8353('0x4b')](config[_0x8353('0x60')],_0x8353('0x61'),util[_0x8353('0x62')]('%s.%s',path['basename'](_0x1903ac[_0x8353('0x5e')],path['extname'](_0x1903ac[_0x8353('0x5e')])),_0x1903ac['converted_format']));var _0x44c837=path[_0x8353('0x4b')](config[_0x8353('0x60')],'server/files/moh',_0x14b2a0['name'],util[_0x8353('0x62')]('%s.%s',_0x1903ac[_0x8353('0x29')],_0x1903ac[_0x8353('0x5f')]));fs[_0x8353('0x63')](_0x3da89d,_0x44c837);return _0x1903ac;}})[_0x8353('0x41')](function(_0x258948){throw new db[(_0x8353('0x59'))][(_0x8353('0x5a'))](_0x258948['message']);});})[_0x8353('0x23')](handleEntityNotFound(_0x4c7974,null))['then'](respondWithResult(_0x4c7974,0xc9))[_0x8353('0x41')](handleError(_0x4c7974,null));};exports['removeSound']=function(_0x3ed9c9,_0x1b3004,_0x4f5cd3){return db['sequelize'][_0x8353('0x47')](function(_0x5643d3){var _0x28a026;return db[_0x8353('0x2c')]['findOne']({'where':{'id':_0x3ed9c9['params']['id']}})['then'](handleEntityNotFound(_0x1b3004,null))['then'](function(_0x15b0ce){if(_0x15b0ce){_0x28a026=_0x15b0ce;return _0x15b0ce[_0x8353('0x64')](_0x3ed9c9[_0x8353('0x43')][_0x8353('0x65')]);}})[_0x8353('0x23')](function(_0x20dfc9){if(_0x20dfc9){return db[_0x8353('0x66')][_0x8353('0x5d')]({'where':{'id':_0x3ed9c9[_0x8353('0x43')][_0x8353('0x65')]},'attributes':['id','name','save_name','converted_format',_0x8353('0x67')],'raw':!![]});}})['then'](function(_0x54bcff){if(_0x54bcff){fs[_0x8353('0x57')](path[_0x8353('0x4b')](_0x28a026['directory'],util[_0x8353('0x62')](_0x8353('0x68'),_0x54bcff[_0x8353('0x29')],_0x54bcff[_0x8353('0x5f')])));return _0x54bcff;}})[_0x8353('0x41')](function(_0x2cd79f){throw new db[(_0x8353('0x59'))][(_0x8353('0x5a'))](_0x2cd79f[_0x8353('0x5b')]);});})['then'](handleEntityNotFound(_0x1b3004,null))['then'](respondWithStatusCode(_0x1b3004,0xcc))[_0x8353('0x41')](handleError(_0x1b3004,null));};exports[_0x8353('0x69')]=function(_0x1ba425,_0x5b1685,_0x10385c){var _0x3b8500={};var _0xcd820c={};var _0x39597f;var _0x4c4e17;return db[_0x8353('0x2c')][_0x8353('0x5d')]({'where':{'id':_0x1ba425['params']['id']}})[_0x8353('0x23')](handleEntityNotFound(_0x5b1685,null))[_0x8353('0x23')](function(_0x42bb6e){if(_0x42bb6e){_0x39597f=_0x42bb6e;_0xcd820c[_0x8353('0x2f')]=_[_0x8353('0x31')](db[_0x8353('0x66')][_0x8353('0x6a')]);_0xcd820c['query']=_[_0x8353('0x31')](_0x1ba425[_0x8353('0x30')]);_0xcd820c[_0x8353('0x32')]=_[_0x8353('0x33')](_0xcd820c['model'],_0xcd820c[_0x8353('0x30')]);_0x3b8500['attributes']=_[_0x8353('0x33')](_0xcd820c['model'],qs[_0x8353('0x34')](_0x1ba425['query']['fields']));_0x3b8500[_0x8353('0x35')]=_0x3b8500[_0x8353('0x35')][_0x8353('0x36')]?_0x3b8500[_0x8353('0x35')]:_0xcd820c[_0x8353('0x2f')];_0x3b8500['order']=qs[_0x8353('0x39')](_0x1ba425[_0x8353('0x30')][_0x8353('0x39')]);_0x3b8500['where']=qs['filters'](_[_0x8353('0x6b')](_0x1ba425[_0x8353('0x30')],_0xcd820c['filters']));if(_0x1ba425['query'][_0x8353('0x3b')]){_0x3b8500[_0x8353('0x3a')]=_['merge'](_0x3b8500[_0x8353('0x3a')],{'$or':_[_0x8353('0x2b')](_0x3b8500['attributes'],function(_0xa4f892){var _0x56df22={};_0x56df22[_0xa4f892]={'$like':'%'+_0x1ba425[_0x8353('0x30')]['filter']+'%'};return _0x56df22;})});}_0x3b8500=_[_0x8353('0x6c')]({},_0x3b8500,_0x1ba425[_0x8353('0x3d')]);return _0x39597f['getSounds'](_0x3b8500);}})[_0x8353('0x23')](function(_0x2e934d){if(_0x2e934d){_0x4c4e17=_0x2e934d[_0x8353('0x36')];if(!_0x1ba425[_0x8353('0x30')][_0x8353('0x37')](_0x8353('0x6d'))){_0x3b8500[_0x8353('0x1e')]=qs[_0x8353('0x1e')](_0x1ba425[_0x8353('0x30')][_0x8353('0x1e')]);_0x3b8500[_0x8353('0x1d')]=qs[_0x8353('0x1d')](_0x1ba425[_0x8353('0x30')][_0x8353('0x1d')]);}return _0x39597f[_0x8353('0x69')](_0x3b8500);}})['then'](function(_0x345212){if(_0x345212){return _0x345212?{'count':_0x4c4e17,'rows':_0x345212}:null;}})['then'](respondWithResult(_0x5b1685,null))[_0x8353('0x41')](handleError(_0x5b1685,null));}; \ No newline at end of file +var _0xaa02=['0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','extname','symlinkSync','message','removeSound','id2','getSounds','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','MusicOnHolds','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMusicOnHold','include','findAll','rows','catch','show','params','includeAll','update','body','create','sequelize','mode','files','join','root','server/files/moh','mkdirSync','directory'];(function(_0x42c6f1,_0x338d7b){var _0x3c7398=function(_0x151494){while(--_0x151494){_0x42c6f1['push'](_0x42c6f1['shift']());}};_0x3c7398(++_0x338d7b);}(_0xaa02,0x1ef));var _0x2aa0=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xaa02[_0x5c2e3e];return _0x53f64a;};'use strict';var emlformat=require(_0x2aa0('0x0'));var rimraf=require(_0x2aa0('0x1'));var zipdir=require(_0x2aa0('0x2'));var jsonpatch=require(_0x2aa0('0x3'));var rp=require(_0x2aa0('0x4'));var moment=require('moment');var BPromise=require(_0x2aa0('0x5'));var Mustache=require('mustache');var util=require(_0x2aa0('0x6'));var path=require(_0x2aa0('0x7'));var sox=require(_0x2aa0('0x8'));var csv=require(_0x2aa0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2aa0('0xa'));var _=require('lodash');var squel=require(_0x2aa0('0xb'));var crypto=require(_0x2aa0('0xc'));var jsforce=require(_0x2aa0('0xd'));var deskjs=require(_0x2aa0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2aa0('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2aa0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2aa0('0x11'));var logger=require(_0x2aa0('0x12'))(_0x2aa0('0x13'));var utils=require(_0x2aa0('0x14'));var config=require(_0x2aa0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2aa0('0x16'))['db'];function respondWithStatusCode(_0x382f6a,_0x5b8747){_0x5b8747=_0x5b8747||0xcc;return function(_0x191073){if(_0x191073){return _0x382f6a['sendStatus'](_0x5b8747);}return _0x382f6a['status'](_0x5b8747)[_0x2aa0('0x17')]();};}function respondWithResult(_0x1090ff,_0x2a7ae6){_0x2a7ae6=_0x2a7ae6||0xc8;return function(_0x1914d1){if(_0x1914d1){return _0x1090ff[_0x2aa0('0x18')](_0x2a7ae6)[_0x2aa0('0x19')](_0x1914d1);}};}function respondWithFilteredResult(_0x3a4027,_0x3597b6){return function(_0xa51bf3){if(_0xa51bf3){var _0x2bd032=typeof _0x3597b6[_0x2aa0('0x1a')]===_0x2aa0('0x1b')&&typeof _0x3597b6[_0x2aa0('0x1c')]==='undefined';var _0x219222=_0xa51bf3[_0x2aa0('0x1d')];var _0x4603ec=_0x2bd032?0x0:_0x3597b6[_0x2aa0('0x1a')];var _0x1a7fc3=_0x2bd032?_0xa51bf3['count']:_0x3597b6[_0x2aa0('0x1a')]+_0x3597b6[_0x2aa0('0x1c')];var _0x4d4a3b;if(_0x1a7fc3>=_0x219222){_0x1a7fc3=_0x219222;_0x4d4a3b=0xc8;}else{_0x4d4a3b=0xce;}_0x3a4027[_0x2aa0('0x18')](_0x4d4a3b);return _0x3a4027['set'](_0x2aa0('0x1e'),_0x4603ec+'-'+_0x1a7fc3+'/'+_0x219222)[_0x2aa0('0x19')](_0xa51bf3);}return null;};}function patchUpdates(_0x398359){return function(_0x4fe3ef){try{jsonpatch[_0x2aa0('0x1f')](_0x4fe3ef,_0x398359,!![]);}catch(_0x2d18de){return BPromise[_0x2aa0('0x20')](_0x2d18de);}return _0x4fe3ef[_0x2aa0('0x21')]();};}function saveUpdates(_0x571373,_0x1ea300){return function(_0x3fe909){if(_0x3fe909){return _0x3fe909['update'](_0x571373)[_0x2aa0('0x22')](function(_0x552a88){return _0x552a88;});}return null;};}function removeEntity(_0x4b1056,_0x548ed3){return function(_0x168700){if(_0x168700){return _0x168700[_0x2aa0('0x23')]()[_0x2aa0('0x22')](function(){var _0x1430fb=_0x168700[_0x2aa0('0x24')]({'plain':!![]});var _0x2713b6=_0x2aa0('0x25');return db[_0x2aa0('0x26')][_0x2aa0('0x23')]({'where':{'type':_0x2713b6,'resourceId':_0x1430fb['id']}})[_0x2aa0('0x22')](function(){return _0x168700;});})[_0x2aa0('0x22')](function(){_0x4b1056[_0x2aa0('0x18')](0xcc)[_0x2aa0('0x17')]();});}};}function handleEntityNotFound(_0x1502a5,_0x3d4778){return function(_0x126552){if(!_0x126552){_0x1502a5[_0x2aa0('0x27')](0x194);}return _0x126552;};}function handleError(_0x1f85fb,_0x598032){_0x598032=_0x598032||0x1f4;return function(_0x556ad4){logger[_0x2aa0('0x28')](_0x556ad4[_0x2aa0('0x29')]);if(_0x556ad4[_0x2aa0('0x2a')]){delete _0x556ad4[_0x2aa0('0x2a')];}_0x1f85fb['status'](_0x598032)[_0x2aa0('0x2b')](_0x556ad4);};}exports[_0x2aa0('0x2c')]=function(_0x48f6fb,_0x3ab79c){var _0xbf20c9={},_0x4241c1={},_0x4a083d={'count':0x0,'rows':[]};var _0x47bed6=_['map'](db['VoiceMusicOnHold'][_0x2aa0('0x2d')],function(_0x8816d3){return{'name':_0x8816d3[_0x2aa0('0x2e')],'type':_0x8816d3['type'][_0x2aa0('0x2f')]};});_0x4241c1['model']=_[_0x2aa0('0x30')](_0x47bed6,_0x2aa0('0x2a'));_0x4241c1[_0x2aa0('0x31')]=_[_0x2aa0('0x32')](_0x48f6fb[_0x2aa0('0x31')]);_0x4241c1[_0x2aa0('0x33')]=_[_0x2aa0('0x34')](_0x4241c1[_0x2aa0('0x35')],_0x4241c1[_0x2aa0('0x31')]);_0xbf20c9[_0x2aa0('0x36')]=_[_0x2aa0('0x34')](_0x4241c1[_0x2aa0('0x35')],qs[_0x2aa0('0x37')](_0x48f6fb[_0x2aa0('0x31')]['fields']));_0xbf20c9[_0x2aa0('0x36')]=_0xbf20c9[_0x2aa0('0x36')][_0x2aa0('0x38')]?_0xbf20c9[_0x2aa0('0x36')]:_0x4241c1[_0x2aa0('0x35')];if(!_0x48f6fb[_0x2aa0('0x31')][_0x2aa0('0x39')]('nolimit')){_0xbf20c9[_0x2aa0('0x1c')]=qs[_0x2aa0('0x1c')](_0x48f6fb[_0x2aa0('0x31')]['limit']);_0xbf20c9[_0x2aa0('0x1a')]=qs['offset'](_0x48f6fb[_0x2aa0('0x31')][_0x2aa0('0x1a')]);}_0xbf20c9[_0x2aa0('0x3a')]=qs[_0x2aa0('0x3b')](_0x48f6fb[_0x2aa0('0x31')][_0x2aa0('0x3b')]);delete _0x48f6fb[_0x2aa0('0x31')]['sort'];_0xbf20c9[_0x2aa0('0x3c')]=qs[_0x2aa0('0x33')](_[_0x2aa0('0x3d')](_0x48f6fb['query'],_0x4241c1[_0x2aa0('0x33')]),_0x47bed6);if(_0x48f6fb['query'][_0x2aa0('0x3e')]){_0xbf20c9['where']=_[_0x2aa0('0x3f')](_0xbf20c9[_0x2aa0('0x3c')],{'$or':_['map'](_0x47bed6,function(_0x259c6d){if(_0x259c6d['type']!==_0x2aa0('0x40')){var _0x48b9da={};_0x48b9da[_0x259c6d['name']]={'$like':'%'+_0x48f6fb['query']['filter']+'%'};return _0x48b9da;}})});}_0xbf20c9=_[_0x2aa0('0x3f')]({},_0xbf20c9,_0x48f6fb[_0x2aa0('0x41')]);var _0x51c168={'where':_0xbf20c9[_0x2aa0('0x3c')]};return db[_0x2aa0('0x42')]['count'](_0x51c168)['then'](function(_0x49596b){_0x4a083d['count']=_0x49596b;if(_0x48f6fb['query']['includeAll']){_0xbf20c9[_0x2aa0('0x43')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x2aa0('0x44')](_0xbf20c9);})[_0x2aa0('0x22')](function(_0x56afad){_0x4a083d[_0x2aa0('0x45')]=_0x56afad;return _0x4a083d;})[_0x2aa0('0x22')](respondWithFilteredResult(_0x3ab79c,_0xbf20c9))[_0x2aa0('0x46')](handleError(_0x3ab79c,null));};exports[_0x2aa0('0x47')]=function(_0xfe8019,_0x3ee3f2){var _0x112ab1={'raw':![],'where':{'id':_0xfe8019[_0x2aa0('0x48')]['id']}},_0x4e9785={};_0x4e9785[_0x2aa0('0x35')]=_[_0x2aa0('0x32')](db[_0x2aa0('0x42')][_0x2aa0('0x2d')]);_0x4e9785[_0x2aa0('0x31')]=_[_0x2aa0('0x32')](_0xfe8019['query']);_0x4e9785[_0x2aa0('0x33')]=_['intersection'](_0x4e9785[_0x2aa0('0x35')],_0x4e9785[_0x2aa0('0x31')]);_0x112ab1[_0x2aa0('0x36')]=_[_0x2aa0('0x34')](_0x4e9785[_0x2aa0('0x35')],qs[_0x2aa0('0x37')](_0xfe8019[_0x2aa0('0x31')][_0x2aa0('0x37')]));_0x112ab1[_0x2aa0('0x36')]=_0x112ab1[_0x2aa0('0x36')]['length']?_0x112ab1['attributes']:_0x4e9785[_0x2aa0('0x35')];if(_0xfe8019[_0x2aa0('0x31')][_0x2aa0('0x49')]){_0x112ab1[_0x2aa0('0x43')]=[{'all':!![]}];}_0x112ab1=_[_0x2aa0('0x3f')]({},_0x112ab1,_0xfe8019[_0x2aa0('0x41')]);return db['VoiceMusicOnHold']['find'](_0x112ab1)[_0x2aa0('0x22')](handleEntityNotFound(_0x3ee3f2,null))[_0x2aa0('0x22')](respondWithResult(_0x3ee3f2,null))['catch'](handleError(_0x3ee3f2,null));};exports[_0x2aa0('0x4a')]=function(_0x1e2c61,_0x20b494){if(_0x1e2c61[_0x2aa0('0x4b')]['id']){delete _0x1e2c61[_0x2aa0('0x4b')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x1e2c61[_0x2aa0('0x48')]['id']}})[_0x2aa0('0x22')](handleEntityNotFound(_0x20b494,null))[_0x2aa0('0x22')](saveUpdates(_0x1e2c61[_0x2aa0('0x4b')],null))[_0x2aa0('0x22')](respondWithResult(_0x20b494,null))['catch'](handleError(_0x20b494,null));};exports[_0x2aa0('0x4c')]=function(_0x229dae,_0x1621e7,_0x41cf73){return db[_0x2aa0('0x4d')]['transaction'](function(_0x756673){if(_0x229dae[_0x2aa0('0x4b')][_0x2aa0('0x4e')]===_0x2aa0('0x4f')){_0x229dae[_0x2aa0('0x4b')]['directory']=path[_0x2aa0('0x50')](config[_0x2aa0('0x51')],_0x2aa0('0x52'),_0x229dae[_0x2aa0('0x4b')]['name']);}return db[_0x2aa0('0x42')][_0x2aa0('0x4c')](_0x229dae['body'],{'transaction':_0x756673})[_0x2aa0('0x22')](function(_0x26dcd2){if(_0x229dae[_0x2aa0('0x4b')][_0x2aa0('0x4e')]===_0x2aa0('0x4f')){fs[_0x2aa0('0x53')](_0x26dcd2[_0x2aa0('0x54')],parseInt(_0x2aa0('0x55'),0x8));}var _0x16b73e=_0x229dae[_0x2aa0('0x56')]['get']({'plain':!![]});if(!_0x16b73e)throw new Error(_0x2aa0('0x57'));if(_0x16b73e[_0x2aa0('0x58')]==='user'){var _0x35fa41=_0x26dcd2['get']({'plain':!![]});return db[_0x2aa0('0x59')][_0x2aa0('0x5a')]({'where':{'name':_0x2aa0('0x25'),'userProfileId':_0x16b73e[_0x2aa0('0x5b')]},'raw':!![]})[_0x2aa0('0x22')](function(_0x1bd985){if(_0x1bd985&&_0x1bd985[_0x2aa0('0x5c')]===0x0){return db[_0x2aa0('0x26')][_0x2aa0('0x4c')]({'name':_0x35fa41['name'],'resourceId':_0x35fa41['id'],'type':_0x1bd985[_0x2aa0('0x2a')],'sectionId':_0x1bd985['id']},{})[_0x2aa0('0x22')](function(){return _0x26dcd2;});}else{return _0x26dcd2;}})['catch'](function(_0x510284){logger['error'](_0x2aa0('0x5d'),_0x510284);});}return _0x26dcd2;});})[_0x2aa0('0x22')](respondWithResult(_0x1621e7,0xc9))['catch'](handleError(_0x1621e7,null));};exports[_0x2aa0('0x23')]=function(_0x42b46c,_0x440373,_0x60d549){var _0x4400e6;return db[_0x2aa0('0x42')][_0x2aa0('0x5a')]({'where':{'id':_0x42b46c[_0x2aa0('0x48')]['id']}})[_0x2aa0('0x22')](function(_0x2fe408){if(_0x2fe408){return db[_0x2aa0('0x4d')][_0x2aa0('0x5e')](function(_0x98bc8c){return _0x2fe408[_0x2aa0('0x23')]({'transaction':_0x98bc8c,'raw':!![]})[_0x2aa0('0x22')](function(_0x331dc2){if(_0x331dc2[_0x2aa0('0x54')]){fs['readdirSync'](_0x331dc2['directory'])[_0x2aa0('0x5f')](function(_0x2e45a1){fs[_0x2aa0('0x60')](path[_0x2aa0('0x50')](_0x331dc2[_0x2aa0('0x54')],_0x2e45a1));});fs[_0x2aa0('0x61')](_0x331dc2['directory']);}return _0x331dc2;});})[_0x2aa0('0x46')](function(_0xa94e47){throw new db[(_0x2aa0('0x62'))][(_0x2aa0('0x63'))](_0xa94e47['message']);});}})[_0x2aa0('0x22')](handleEntityNotFound(_0x440373,null))[_0x2aa0('0x22')](removeEntity(_0x440373,null))[_0x2aa0('0x46')](handleError(_0x440373,null));};exports[_0x2aa0('0x64')]=function(_0x4f4b8f,_0x453bf4,_0x4fa1a1){return db[_0x2aa0('0x4d')]['transaction'](function(_0x904e72){var _0x57052c;return db[_0x2aa0('0x42')][_0x2aa0('0x5a')]({'where':{'id':_0x4f4b8f[_0x2aa0('0x48')]['id']}})['then'](function(_0x5f178b){if(_0x5f178b){_0x57052c=_0x5f178b;return _0x5f178b[_0x2aa0('0x64')](_0x4f4b8f[_0x2aa0('0x4b')]['id'],{'transaction':_0x904e72});}})[_0x2aa0('0x22')](function(_0x4ed593){if(_0x4ed593){return db[_0x2aa0('0x65')][_0x2aa0('0x66')]({'where':{'id':_0x4f4b8f[_0x2aa0('0x4b')]['id']},'attributes':['id',_0x2aa0('0x2a'),_0x2aa0('0x67'),_0x2aa0('0x68'),_0x2aa0('0x69')],'raw':!![]});}})[_0x2aa0('0x22')](function(_0x166652){if(_0x166652){var _0x103269=path[_0x2aa0('0x50')](config['root'],_0x2aa0('0x6a'),util[_0x2aa0('0x6b')](_0x2aa0('0x6c'),path['basename'](_0x166652[_0x2aa0('0x67')],path[_0x2aa0('0x6d')](_0x166652['save_name'])),_0x166652['converted_format']));var _0x283244=path[_0x2aa0('0x50')](config[_0x2aa0('0x51')],_0x2aa0('0x52'),_0x57052c[_0x2aa0('0x2a')],util['format'](_0x2aa0('0x6c'),_0x166652[_0x2aa0('0x2a')],_0x166652[_0x2aa0('0x68')]));fs[_0x2aa0('0x6e')](_0x103269,_0x283244);return _0x166652;}})['catch'](function(_0x8320f4){throw new db[(_0x2aa0('0x62'))][(_0x2aa0('0x63'))](_0x8320f4[_0x2aa0('0x6f')]);});})[_0x2aa0('0x22')](handleEntityNotFound(_0x453bf4,null))[_0x2aa0('0x22')](respondWithResult(_0x453bf4,0xc9))[_0x2aa0('0x46')](handleError(_0x453bf4,null));};exports[_0x2aa0('0x70')]=function(_0x2f484c,_0x1acd28,_0x1dfbb3){return db[_0x2aa0('0x4d')][_0x2aa0('0x5e')](function(_0x25363e){var _0x4e0bcd;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x2f484c[_0x2aa0('0x48')]['id']}})[_0x2aa0('0x22')](handleEntityNotFound(_0x1acd28,null))[_0x2aa0('0x22')](function(_0x2a0acc){if(_0x2a0acc){_0x4e0bcd=_0x2a0acc;return _0x2a0acc[_0x2aa0('0x70')](_0x2f484c[_0x2aa0('0x48')][_0x2aa0('0x71')]);}})[_0x2aa0('0x22')](function(_0x4d407f){if(_0x4d407f){return db['Sound'][_0x2aa0('0x66')]({'where':{'id':_0x2f484c[_0x2aa0('0x48')][_0x2aa0('0x71')]},'attributes':['id',_0x2aa0('0x2a'),'save_name',_0x2aa0('0x68'),_0x2aa0('0x69')],'raw':!![]});}})[_0x2aa0('0x22')](function(_0x58e117){if(_0x58e117){fs[_0x2aa0('0x60')](path[_0x2aa0('0x50')](_0x4e0bcd[_0x2aa0('0x54')],util[_0x2aa0('0x6b')](_0x2aa0('0x6c'),_0x58e117[_0x2aa0('0x2a')],_0x58e117[_0x2aa0('0x68')])));return _0x58e117;}})[_0x2aa0('0x46')](function(_0x5358fe){throw new db[(_0x2aa0('0x62'))]['ValidationError'](_0x5358fe['message']);});})[_0x2aa0('0x22')](handleEntityNotFound(_0x1acd28,null))[_0x2aa0('0x22')](respondWithStatusCode(_0x1acd28,0xcc))['catch'](handleError(_0x1acd28,null));};exports['getSounds']=function(_0x379811,_0x1d8a29,_0x2dba0f){var _0x5effde={};var _0x2c73f0={};var _0x4af74d;var _0x50d99e;return db[_0x2aa0('0x42')][_0x2aa0('0x66')]({'where':{'id':_0x379811[_0x2aa0('0x48')]['id']}})[_0x2aa0('0x22')](handleEntityNotFound(_0x1d8a29,null))['then'](function(_0x53cdc2){if(_0x53cdc2){_0x4af74d=_0x53cdc2;_0x2c73f0[_0x2aa0('0x35')]=_[_0x2aa0('0x32')](db[_0x2aa0('0x65')]['rawAttributes']);_0x2c73f0[_0x2aa0('0x31')]=_['keys'](_0x379811[_0x2aa0('0x31')]);_0x2c73f0['filters']=_[_0x2aa0('0x34')](_0x2c73f0[_0x2aa0('0x35')],_0x2c73f0[_0x2aa0('0x31')]);_0x5effde[_0x2aa0('0x36')]=_[_0x2aa0('0x34')](_0x2c73f0['model'],qs[_0x2aa0('0x37')](_0x379811['query'][_0x2aa0('0x37')]));_0x5effde['attributes']=_0x5effde['attributes'][_0x2aa0('0x38')]?_0x5effde[_0x2aa0('0x36')]:_0x2c73f0['model'];_0x5effde[_0x2aa0('0x3a')]=qs[_0x2aa0('0x3b')](_0x379811[_0x2aa0('0x31')][_0x2aa0('0x3b')]);_0x5effde[_0x2aa0('0x3c')]=qs[_0x2aa0('0x33')](_[_0x2aa0('0x3d')](_0x379811['query'],_0x2c73f0[_0x2aa0('0x33')]));if(_0x379811[_0x2aa0('0x31')][_0x2aa0('0x3e')]){_0x5effde[_0x2aa0('0x3c')]=_['merge'](_0x5effde[_0x2aa0('0x3c')],{'$or':_[_0x2aa0('0x30')](_0x5effde[_0x2aa0('0x36')],function(_0x3ac7f7){var _0x263a97={};_0x263a97[_0x3ac7f7]={'$like':'%'+_0x379811['query'][_0x2aa0('0x3e')]+'%'};return _0x263a97;})});}_0x5effde=_[_0x2aa0('0x3f')]({},_0x5effde,_0x379811[_0x2aa0('0x41')]);return _0x4af74d[_0x2aa0('0x72')](_0x5effde);}})['then'](function(_0x45f358){if(_0x45f358){_0x50d99e=_0x45f358[_0x2aa0('0x38')];if(!_0x379811[_0x2aa0('0x31')][_0x2aa0('0x39')](_0x2aa0('0x73'))){_0x5effde[_0x2aa0('0x1c')]=qs['limit'](_0x379811[_0x2aa0('0x31')][_0x2aa0('0x1c')]);_0x5effde[_0x2aa0('0x1a')]=qs[_0x2aa0('0x1a')](_0x379811[_0x2aa0('0x31')]['offset']);}return _0x4af74d[_0x2aa0('0x72')](_0x5effde);}})['then'](function(_0x19697a){if(_0x19697a){return _0x19697a?{'count':_0x50d99e,'rows':_0x19697a}:null;}})[_0x2aa0('0x22')](respondWithResult(_0x1d8a29,null))['catch'](handleError(_0x1d8a29,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 5d2617b..4472ff9 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 _0xbf91=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','lodash'];(function(_0xe0cb01,_0x370366){var _0xe0c3f0=function(_0x4dc187){while(--_0x4dc187){_0xe0cb01['push'](_0xe0cb01['shift']());}};_0xe0c3f0(++_0x370366);}(_0xbf91,0x1bb));var _0x1bf9=function(_0x461695,_0x447787){_0x461695=_0x461695-0x0;var _0x29472a=_0xbf91[_0x461695];return _0x29472a;};'use strict';var _=require(_0x1bf9('0x0'));var util=require(_0x1bf9('0x1'));var logger=require(_0x1bf9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1bf9('0x3'));var rp=require(_0x1bf9('0x4'));var fs=require('fs');var path=require(_0x1bf9('0x5'));var rimraf=require(_0x1bf9('0x6'));var config=require(_0x1bf9('0x7'));var attributes=require(_0x1bf9('0x8'));module[_0x1bf9('0x9')]=function(_0x51703f,_0x5538c6){return _0x51703f['define'](_0x1bf9('0xa'),attributes,{'tableName':_0x1bf9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0892=['./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x24d983,_0x49a3e7){var _0xf948a4=function(_0x26917b){while(--_0x26917b){_0x24d983['push'](_0x24d983['shift']());}};_0xf948a4(++_0x49a3e7);}(_0x0892,0x118));var _0x2089=function(_0x19a47e,_0x4ee2c8){_0x19a47e=_0x19a47e-0x0;var _0x2adaec=_0x0892[_0x19a47e];return _0x2adaec;};'use strict';var _=require(_0x2089('0x0'));var util=require(_0x2089('0x1'));var logger=require(_0x2089('0x2'))('api');var moment=require(_0x2089('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2089('0x4'));var rimraf=require(_0x2089('0x5'));var config=require('../../config/environment');var attributes=require(_0x2089('0x6'));module[_0x2089('0x7')]=function(_0x274263,_0x31a26f){return _0x274263[_0x2089('0x8')](_0x2089('0x9'),attributes,{'tableName':_0x2089('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 16c62e5..9421a1a 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(_0x3469a0,_0x44e294){var _0x185ae0=function(_0x38c8b4){while(--_0x38c8b4){_0x3469a0['push'](_0x3469a0['shift']());}};_0x185ae0(++_0x44e294);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'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(_0x2f6cf5,_0x315e2d){var _0x49c941=function(_0x3cf4eb){while(--_0x3cf4eb){_0x2f6cf5['push'](_0x2f6cf5['shift']());}};_0x49c941(++_0x315e2d);}(_0x70e0,0x17b));var _0x070e=function(_0x26a7de,_0x48b8f1){_0x26a7de=_0x26a7de-0x0;var _0x4f7107=_0x70e0[_0x26a7de];return _0x4f7107;};'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 d334b3c..e1c70d9 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 _0x0367=['describe','get','/:id/users','getAgents','post','addAgents','put','delete','/:id','destroy','removeAgents','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','isAuthenticated','/describe'];(function(_0xfcb0f1,_0x3f2d57){var _0x4ed14e=function(_0x29cc13){while(--_0x29cc13){_0xfcb0f1['push'](_0xfcb0f1['shift']());}};_0x4ed14e(++_0x3f2d57);}(_0x0367,0xf3));var _0x7036=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0367[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7036('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7036('0x1'));var express=require(_0x7036('0x2'));var router=express['Router']();var fs_extra=require(_0x7036('0x3'));var auth=require(_0x7036('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7036('0x5'));var controller=require(_0x7036('0x6'));router['get']('/',auth[_0x7036('0x7')](),controller['index']);router['get'](_0x7036('0x8'),auth['isAuthenticated'](),controller[_0x7036('0x9')]);router[_0x7036('0xa')]('/:id',auth[_0x7036('0x7')](),controller['show']);router['get'](_0x7036('0xb'),auth[_0x7036('0x7')](),controller[_0x7036('0xc')]);router[_0x7036('0xd')]('/',auth[_0x7036('0x7')](),controller['create']);router[_0x7036('0xd')]('/:id/users',auth[_0x7036('0x7')](),controller[_0x7036('0xe')]);router[_0x7036('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7036('0x10')](_0x7036('0x11'),auth['isAuthenticated'](),controller[_0x7036('0x12')]);router[_0x7036('0x10')](_0x7036('0xb'),auth[_0x7036('0x7')](),controller[_0x7036('0x13')]);module[_0x7036('0x14')]=router; \ No newline at end of file +var _0x56bd=['update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/users','getAgents','post','create','addAgents','put'];(function(_0xb2b3ae,_0x5f186d){var _0x2e18a3=function(_0x1743ce){while(--_0x1743ce){_0xb2b3ae['push'](_0xb2b3ae['shift']());}};_0x2e18a3(++_0x5f186d);}(_0x56bd,0x1f3));var _0xd56b=function(_0x41b393,_0x303329){_0x41b393=_0x41b393-0x0;var _0x161fb0=_0x56bd[_0x41b393];return _0x161fb0;};'use strict';var multer=require(_0xd56b('0x0'));var util=require(_0xd56b('0x1'));var path=require(_0xd56b('0x2'));var timeout=require(_0xd56b('0x3'));var express=require(_0xd56b('0x4'));var router=express['Router']();var fs_extra=require(_0xd56b('0x5'));var auth=require(_0xd56b('0x6'));var interaction=require(_0xd56b('0x7'));var config=require(_0xd56b('0x8'));var controller=require('./voicePrefix.controller');router[_0xd56b('0x9')]('/',auth[_0xd56b('0xa')](),controller[_0xd56b('0xb')]);router[_0xd56b('0x9')](_0xd56b('0xc'),auth[_0xd56b('0xa')](),controller[_0xd56b('0xd')]);router[_0xd56b('0x9')](_0xd56b('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0xd56b('0xf'),auth[_0xd56b('0xa')](),controller[_0xd56b('0x10')]);router[_0xd56b('0x11')]('/',auth['isAuthenticated'](),controller[_0xd56b('0x12')]);router[_0xd56b('0x11')](_0xd56b('0xf'),auth[_0xd56b('0xa')](),controller[_0xd56b('0x13')]);router[_0xd56b('0x14')]('/:id',auth[_0xd56b('0xa')](),controller[_0xd56b('0x15')]);router[_0xd56b('0x16')](_0xd56b('0xe'),auth[_0xd56b('0xa')](),controller[_0xd56b('0x17')]);router['delete'](_0xd56b('0xf'),auth['isAuthenticated'](),controller[_0xd56b('0x18')]);module[_0xd56b('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 2c44ff3..8f35bcf 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 _0x3162=['system-','getDataValue','name','STRING','INTEGER','sequelize','VIRTUAL'];(function(_0x646685,_0x35a13d){var _0x546f8f=function(_0x199e5c){while(--_0x199e5c){_0x646685['push'](_0x646685['shift']());}};_0x546f8f(++_0x35a13d);}(_0x3162,0xd0));var _0x2316=function(_0x47677f,_0x28c987){_0x47677f=_0x47677f-0x0;var _0xde4698=_0x3162[_0x47677f];return _0xde4698;};'use strict';var Sequelize=require(_0x2316('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x2316('0x1')],'get':function(_0x4af44e){return _0x2316('0x2')+this[_0x2316('0x3')](_0x2316('0x4'))+'-';}},'description':{'type':Sequelize[_0x2316('0x5')]},'callerIdAll':{'type':Sequelize[_0x2316('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0x2316('0x6')]}}; \ No newline at end of file +var _0xfaec=['INTEGER','sequelize','exports','STRING','system-','getDataValue','name'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0xfaec,0x182));var _0xcfae=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xfaec[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xcfae('0x0'));module[_0xcfae('0x1')]={'name':{'type':Sequelize[_0xcfae('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x24e80e){return _0xcfae('0x3')+this[_0xcfae('0x4')](_0xcfae('0x5'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xcfae('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xcfae('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 93f5963..00d997b 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 _0x117c=['fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','VoicePrefix','findAll','catch','params','options','find','describe','create','sequelize','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','system-','transaction','findById','addAgents','ids','removeAgents','emit','userVoicePrefix:remove','User','getAgents','nolimit'];(function(_0x417140,_0x3e3814){var _0x1f6fd0=function(_0x5c7576){while(--_0x5c7576){_0x417140['push'](_0x417140['shift']());}};_0x1f6fd0(++_0x3e3814);}(_0x117c,0x71));var _0xc117=function(_0x42bedd,_0x157a71){_0x42bedd=_0x42bedd-0x0;var _0x1a2b17=_0x117c[_0x42bedd];return _0x1a2b17;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc117('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc117('0x1'));var Mustache=require(_0xc117('0x2'));var util=require(_0xc117('0x3'));var path=require(_0xc117('0x4'));var sox=require(_0xc117('0x5'));var csv=require(_0xc117('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc117('0x7'));var _=require(_0xc117('0x8'));var squel=require('squel');var crypto=require(_0xc117('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc117('0xa'));var toCsv=require(_0xc117('0x6'));var querystring=require(_0xc117('0xb'));var Papa=require(_0xc117('0xc'));var Redis=require(_0xc117('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc117('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc117('0xf'));var logger=require('../../config/logger')(_0xc117('0x10'));var utils=require(_0xc117('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xc117('0x12'));var db=require('../../mysqldb')['db'];config[_0xc117('0x13')]=_[_0xc117('0x14')](config[_0xc117('0x13')],{'host':_0xc117('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc117('0x13')]));require(_0xc117('0x16'))[_0xc117('0x17')](socket);function respondWithStatusCode(_0x9dec18,_0x534955){_0x534955=_0x534955||0xcc;return function(_0x375334){if(_0x375334){return _0x9dec18[_0xc117('0x18')](_0x534955);}return _0x9dec18[_0xc117('0x19')](_0x534955)[_0xc117('0x1a')]();};}function respondWithResult(_0x58bce8,_0x5350e9){_0x5350e9=_0x5350e9||0xc8;return function(_0x1dfaa6){if(_0x1dfaa6){return _0x58bce8[_0xc117('0x19')](_0x5350e9)[_0xc117('0x1b')](_0x1dfaa6);}};}function respondWithFilteredResult(_0x2c3a28,_0xe01373){return function(_0x339239){if(_0x339239){var _0x19a34c=typeof _0xe01373[_0xc117('0x1c')]===_0xc117('0x1d')&&typeof _0xe01373[_0xc117('0x1e')]===_0xc117('0x1d');var _0x224395=_0x339239['count'];var _0x1b9095=_0x19a34c?0x0:_0xe01373[_0xc117('0x1c')];var _0xf5307f=_0x19a34c?_0x339239[_0xc117('0x1f')]:_0xe01373[_0xc117('0x1c')]+_0xe01373[_0xc117('0x1e')];var _0x32ef4e;if(_0xf5307f>=_0x224395){_0xf5307f=_0x224395;_0x32ef4e=0xc8;}else{_0x32ef4e=0xce;}_0x2c3a28['status'](_0x32ef4e);return _0x2c3a28['set'](_0xc117('0x20'),_0x1b9095+'-'+_0xf5307f+'/'+_0x224395)[_0xc117('0x1b')](_0x339239);}return null;};}function patchUpdates(_0x1492d0){return function(_0x219819){try{jsonpatch[_0xc117('0x21')](_0x219819,_0x1492d0,!![]);}catch(_0x2531f1){return BPromise['reject'](_0x2531f1);}return _0x219819['save']();};}function saveUpdates(_0x3d670e,_0x481e10){return function(_0xa0ee6b){if(_0xa0ee6b){return _0xa0ee6b[_0xc117('0x22')](_0x3d670e)[_0xc117('0x23')](function(_0x4e6616){return _0x4e6616;});}return null;};}function removeEntity(_0x3d71f8,_0xfefce5){return function(_0x41e376){if(_0x41e376){return _0x41e376[_0xc117('0x24')]()[_0xc117('0x23')](function(){var _0x28575b=_0x41e376['get']({'plain':!![]});var _0x334041='VoicePrefixes';return db['UserProfileResource'][_0xc117('0x24')]({'where':{'type':_0x334041,'resourceId':_0x28575b['id']}})[_0xc117('0x23')](function(){return _0x41e376;});})[_0xc117('0x23')](function(){_0x3d71f8['status'](0xcc)[_0xc117('0x1a')]();});}};}function handleEntityNotFound(_0x5db129,_0x4a2a10){return function(_0x459b8a){if(!_0x459b8a){_0x5db129[_0xc117('0x18')](0x194);}return _0x459b8a;};}function handleError(_0x2093d8,_0x4e8630){_0x4e8630=_0x4e8630||0x1f4;return function(_0x416074){logger['error'](_0x416074[_0xc117('0x25')]);if(_0x416074[_0xc117('0x26')]){delete _0x416074[_0xc117('0x26')];}_0x2093d8[_0xc117('0x19')](_0x4e8630)['send'](_0x416074);};}exports[_0xc117('0x27')]=function(_0x3aaf53,_0x180d0a){var _0x3d4887={},_0x59e817={},_0x2cb54a={'count':0x0,'rows':[]};var _0x5a675a=_[_0xc117('0x28')](db['VoicePrefix'][_0xc117('0x29')],function(_0x5a00ae){return{'name':_0x5a00ae[_0xc117('0x2a')],'type':_0x5a00ae['type'][_0xc117('0x2b')]};});_0x59e817[_0xc117('0x2c')]=_[_0xc117('0x28')](_0x5a675a,'name');_0x59e817[_0xc117('0x2d')]=_[_0xc117('0x2e')](_0x3aaf53[_0xc117('0x2d')]);_0x59e817[_0xc117('0x2f')]=_[_0xc117('0x30')](_0x59e817[_0xc117('0x2c')],_0x59e817[_0xc117('0x2d')]);_0x3d4887[_0xc117('0x31')]=_['intersection'](_0x59e817[_0xc117('0x2c')],qs[_0xc117('0x32')](_0x3aaf53[_0xc117('0x2d')]['fields']));_0x3d4887[_0xc117('0x31')]=_0x3d4887[_0xc117('0x31')][_0xc117('0x33')]?_0x3d4887[_0xc117('0x31')]:_0x59e817[_0xc117('0x2c')];if(!_0x3aaf53[_0xc117('0x2d')][_0xc117('0x34')]('nolimit')){_0x3d4887[_0xc117('0x1e')]=qs[_0xc117('0x1e')](_0x3aaf53['query'][_0xc117('0x1e')]);_0x3d4887[_0xc117('0x1c')]=qs[_0xc117('0x1c')](_0x3aaf53['query']['offset']);}_0x3d4887['order']=qs[_0xc117('0x35')](_0x3aaf53['query'][_0xc117('0x35')]);_0x3d4887[_0xc117('0x36')]=qs[_0xc117('0x2f')](_[_0xc117('0x37')](_0x3aaf53[_0xc117('0x2d')],_0x59e817[_0xc117('0x2f')]),_0x5a675a);if(_0x3aaf53['query'][_0xc117('0x38')]){_0x3d4887[_0xc117('0x36')]=_['merge'](_0x3d4887[_0xc117('0x36')],{'$or':_['map'](_0x5a675a,function(_0x3dd2cf){if(_0x3dd2cf[_0xc117('0x39')]!==_0xc117('0x3a')){var _0x4f77a5={};_0x4f77a5[_0x3dd2cf[_0xc117('0x26')]]={'$like':'%'+_0x3aaf53[_0xc117('0x2d')][_0xc117('0x38')]+'%'};return _0x4f77a5;}})});}_0x3d4887=_[_0xc117('0x3b')]({},_0x3d4887,_0x3aaf53['options']);var _0x1a7ceb={'where':_0x3d4887[_0xc117('0x36')]};return db['VoicePrefix'][_0xc117('0x1f')](_0x1a7ceb)[_0xc117('0x23')](function(_0x5128ef){_0x2cb54a[_0xc117('0x1f')]=_0x5128ef;if(_0x3aaf53['query'][_0xc117('0x3c')]){_0x3d4887[_0xc117('0x3d')]=[{'all':!![]}];}return db[_0xc117('0x3e')][_0xc117('0x3f')](_0x3d4887);})['then'](function(_0x5762ab){_0x2cb54a['rows']=_0x5762ab;return _0x2cb54a;})[_0xc117('0x23')](respondWithFilteredResult(_0x180d0a,_0x3d4887))[_0xc117('0x40')](handleError(_0x180d0a,null));};exports['show']=function(_0x5bd085,_0x54f801){var _0x3b1c8b={'raw':![],'where':{'id':_0x5bd085[_0xc117('0x41')]['id']}},_0x37c9ff={};_0x37c9ff[_0xc117('0x2c')]=_[_0xc117('0x2e')](db[_0xc117('0x3e')]['rawAttributes']);_0x37c9ff['query']=_[_0xc117('0x2e')](_0x5bd085[_0xc117('0x2d')]);_0x37c9ff['filters']=_['intersection'](_0x37c9ff[_0xc117('0x2c')],_0x37c9ff['query']);_0x3b1c8b[_0xc117('0x31')]=_[_0xc117('0x30')](_0x37c9ff[_0xc117('0x2c')],qs[_0xc117('0x32')](_0x5bd085['query'][_0xc117('0x32')]));_0x3b1c8b[_0xc117('0x31')]=_0x3b1c8b['attributes'][_0xc117('0x33')]?_0x3b1c8b[_0xc117('0x31')]:_0x37c9ff['model'];if(_0x5bd085['query']['includeAll']){_0x3b1c8b[_0xc117('0x3d')]=[{'all':!![]}];}_0x3b1c8b=_[_0xc117('0x3b')]({},_0x3b1c8b,_0x5bd085[_0xc117('0x42')]);return db[_0xc117('0x3e')][_0xc117('0x43')](_0x3b1c8b)[_0xc117('0x23')](handleEntityNotFound(_0x54f801,null))['then'](respondWithResult(_0x54f801,null))['catch'](handleError(_0x54f801,null));};exports[_0xc117('0x24')]=function(_0x293e84,_0x444129){return db[_0xc117('0x3e')][_0xc117('0x43')]({'where':{'id':_0x293e84[_0xc117('0x41')]['id']}})['then'](handleEntityNotFound(_0x444129,null))[_0xc117('0x23')](removeEntity(_0x444129,null))[_0xc117('0x40')](handleError(_0x444129,null));};exports[_0xc117('0x44')]=function(_0x46d116,_0x3abdde){return db[_0xc117('0x3e')][_0xc117('0x44')]()[_0xc117('0x23')](respondWithResult(_0x3abdde,null))[_0xc117('0x40')](handleError(_0x3abdde,null));};exports[_0xc117('0x45')]=function(_0x4c648f,_0x154c91){var _0x4d179d;return db[_0xc117('0x46')]['transaction'](function(_0x3e6ae5){return db[_0xc117('0x3e')][_0xc117('0x45')](_0x4c648f[_0xc117('0x47')],{'transaction':_0x3e6ae5})[_0xc117('0x23')](function(_0x58fc35){_0x4d179d=_0x58fc35[_0xc117('0x48')]({'plain':!![]});return db[_0xc117('0x49')]['find']({'where':{'id':_0x4d179d[_0xc117('0x4a')]},'raw':!![]})[_0xc117('0x23')](function(_0x5c1a2d){return createVoicePrefixExtensions(_0x4d179d,_0x5c1a2d,_0x3e6ae5);});});})[_0xc117('0x23')](function(){var _0x491d00=_0x4c648f[_0xc117('0x4b')]['get']({'plain':!![]});if(!_0x491d00)throw new Error(_0xc117('0x4c'));if(_0x491d00['role']===_0xc117('0x4b')){var _0x100e28=_0x4d179d;return db[_0xc117('0x4d')][_0xc117('0x43')]({'where':{'name':_0xc117('0x4e'),'userProfileId':_0x491d00[_0xc117('0x4f')]},'raw':!![]})['then'](function(_0x51e163){if(_0x51e163&&_0x51e163[_0xc117('0x50')]===0x0){return db['UserProfileResource'][_0xc117('0x45')]({'name':_0x100e28[_0xc117('0x26')],'resourceId':_0x100e28['id'],'type':_0x51e163[_0xc117('0x26')],'sectionId':_0x51e163['id']},{})['then'](function(){return _0x4d179d;});}else{return _0x4d179d;}})[_0xc117('0x40')](function(_0x3a28f1){logger['error'](_0xc117('0x51'),_0x3a28f1);throw _0x3a28f1;});}return _0x4d179d;})[_0xc117('0x23')](respondWithResult(_0x154c91,null))[_0xc117('0x40')](handleError(_0x154c91,null));};function Extension(_0x155240,_0x14529d,_0x27663d,_0x34f8cb){this[_0xc117('0x52')]=_0xc117('0x53');this[_0xc117('0x54')]=_0x155240;this[_0xc117('0x55')]=_0x27663d;this[_0xc117('0x39')]=_0xc117('0x56');this['description']='Voice\x20Prefix\x20Extension';this[_0xc117('0x57')]=_0x14529d;this[_0xc117('0x58')]=_0x34f8cb;}function createVoicePrefixExtensions(_0x5a9176,_0x3db786,_0x45d86e){return new BPromise(function(_0x78631f,_0x17c753){var _0x21d5ac=new Extension(formatPrefixName(_0x5a9176[_0xc117('0x59')]),0x1,_0xc117('0x5a'),_0xc117('0x5b'));_0x21d5ac[_0xc117('0x5c')]=_0x5a9176['id'];return db[_0xc117('0x49')][_0xc117('0x45')](_0x21d5ac,{'transaction':_0x45d86e})['then'](function(_0x44302e){var _0x2fd5dc=_0x44302e[_0xc117('0x48')]({'plain':!![]});var _0x15eadf=_[_0xc117('0x28')](addVoicePrefixExtensions(_0x5a9176,_0x3db786),function(_0xef1733){_0xef1733[_0xc117('0x4a')]=_0x2fd5dc['id'];_0xef1733[_0xc117('0x5c')]=_0x5a9176['id'];return _0xef1733;});return db[_0xc117('0x49')][_0xc117('0x5d')](_0x15eadf,{'transaction':_0x45d86e})['then'](function(_0x29a9ad){if(!_0x29a9ad){return _0x17c753('Extensions\x20creation\x20failed');}else{return _0x78631f(_0x29a9ad);}})[_0xc117('0x40')](function(_0x3c5011){return _0x17c753(_0x3c5011);});});;});};function addVoicePrefixExtensions(_0x3f1330,_0x3796ae){var _0x26eccd=[];var _0xd29117=formatPrefixName(_0x3f1330['prefix']);_0x26eccd[_0xc117('0x5e')](new Extension(_0xd29117,0x2,_0xc117('0x5f'),_0xc117('0x60')+_0x3f1330[_0xc117('0x26')]));if(_0x3f1330[_0xc117('0x61')]){_0x26eccd[_0xc117('0x5e')](new Extension(_0xd29117,0x3,_0xc117('0x5f'),_0xc117('0x62')+_0x3f1330[_0xc117('0x61')]));}else{_0x26eccd[_0xc117('0x5e')](new Extension(_0xd29117,0x3,_0xc117('0x5a'),'No\x20callerid\x20available'));}_0x26eccd[_0xc117('0x5e')](new Extension(_0xd29117,0x4,_0xc117('0x63'),_0x3796ae['context']+','+_0xc117('0x64')+(0x8+_0x3f1330['name']['length'])+'}'+','+0x1));return _0x26eccd;}function formatPrefixName(_0x46960e){var _0x42032c='_';for(var _0x3b45ba=0x0;_0x3b45ba<_0x46960e['length'];_0x3b45ba++){if(_0x46960e['charAt'](_0x3b45ba)=='-'){_0x42032c+=_0x46960e[_0xc117('0x65')](_0x3b45ba);}else{_0x42032c+='['+_0x46960e[_0xc117('0x65')](_0x3b45ba)+']';}}_0x42032c+='.';return _0x42032c;}exports['update']=function(_0x195ea4,_0x3c65ab,_0x19537f){var _0x4b71b6=_0x195ea4[_0xc117('0x47')];_0x4b71b6['prefix']=_0xc117('0x66')+_0x4b71b6['name']+'-';return db['sequelize'][_0xc117('0x67')](function(_0x120df9){return db[_0xc117('0x3e')][_0xc117('0x22')](_0x4b71b6,{'where':{'id':_0x4b71b6['id']},'transaction':_0x120df9})[_0xc117('0x23')](function(){return db[_0xc117('0x49')][_0xc117('0x24')]({'where':{'VoicePrefixId':_0x4b71b6['id']},'transaction':_0x120df9})[_0xc117('0x23')](function(){return db[_0xc117('0x49')][_0xc117('0x43')]({'where':{'id':_0x4b71b6[_0xc117('0x4a')]},'raw':!![]})[_0xc117('0x23')](function(_0x5403ab){return createVoicePrefixExtensions(_0x4b71b6,_0x5403ab,_0x120df9);});});});})[_0xc117('0x23')](function(){return db[_0xc117('0x3e')][_0xc117('0x68')](_0x4b71b6['id']);})[_0xc117('0x23')](respondWithResult(_0x3c65ab,null))[_0xc117('0x40')](handleError(_0x3c65ab,null));};exports[_0xc117('0x69')]=function(_0x2893b4,_0x5db3bb,_0x2279d3){return db['VoicePrefix'][_0xc117('0x43')]({'where':{'id':_0x2893b4[_0xc117('0x41')]['id']}})[_0xc117('0x23')](handleEntityNotFound(_0x5db3bb,null))[_0xc117('0x23')](function(_0x1dcd93){if(_0x1dcd93){return _0x1dcd93[_0xc117('0x69')](_0x2893b4[_0xc117('0x47')][_0xc117('0x6a')],_['omit'](_0x2893b4[_0xc117('0x47')],[_0xc117('0x6a'),'id'])||{})['spread'](function(_0x3f4dda){for(var _0x53f53e=0x0;_0x53f53e<_0x2893b4[_0xc117('0x47')][_0xc117('0x6a')][_0xc117('0x33')];_0x53f53e+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x2893b4[_0xc117('0x47')][_0xc117('0x6a')][_0x53f53e]),'VoicePrefixId':Number(_0x2893b4[_0xc117('0x41')]['id'])});}return _0x3f4dda;});}})['then'](respondWithResult(_0x5db3bb,null))[_0xc117('0x40')](handleError(_0x5db3bb,null));};exports[_0xc117('0x6b')]=function(_0x1a328a,_0x57bc3b,_0x479ab3){return db['VoicePrefix'][_0xc117('0x43')]({'where':{'id':_0x1a328a[_0xc117('0x41')]['id']}})[_0xc117('0x23')](handleEntityNotFound(_0x57bc3b,null))[_0xc117('0x23')](function(_0x1466b9){if(_0x1466b9){return _0x1466b9[_0xc117('0x6b')](_0x1a328a[_0xc117('0x2d')][_0xc117('0x6a')])[_0xc117('0x23')](function(){if(_['isArray'](_0x1a328a[_0xc117('0x2d')][_0xc117('0x6a')])){for(var _0x3294be=0x0;_0x3294be<_0x1a328a[_0xc117('0x2d')][_0xc117('0x6a')]['length'];_0x3294be+=0x1){socket[_0xc117('0x6c')](_0xc117('0x6d'),{'UserId':Number(_0x1a328a[_0xc117('0x2d')]['ids'][_0x3294be]),'VoicePrefixId':Number(_0x1a328a[_0xc117('0x41')]['id'])});}}else{socket[_0xc117('0x6c')](_0xc117('0x6d'),{'UserId':Number(_0x1a328a['query']['ids']),'VoicePrefixId':Number(_0x1a328a[_0xc117('0x41')]['id'])});}});}})[_0xc117('0x23')](respondWithStatusCode(_0x57bc3b,null))['catch'](handleError(_0x57bc3b,null));};exports['getAgents']=function(_0x4a0719,_0x51d741,_0x45c258){var _0x40e650={};var _0x46a769={};var _0x4aa43e;var _0x39d014;return db['VoicePrefix']['findOne']({'where':{'id':_0x4a0719['params']['id']}})['then'](handleEntityNotFound(_0x51d741,null))[_0xc117('0x23')](function(_0x319bc5){if(_0x319bc5){_0x4aa43e=_0x319bc5;_0x46a769[_0xc117('0x2c')]=_['keys'](db[_0xc117('0x6e')]['rawAttributes']);_0x46a769[_0xc117('0x2d')]=_['keys'](_0x4a0719[_0xc117('0x2d')]);_0x46a769[_0xc117('0x2f')]=_['intersection'](_0x46a769[_0xc117('0x2c')],_0x46a769[_0xc117('0x2d')]);_0x40e650['attributes']=_[_0xc117('0x30')](_0x46a769[_0xc117('0x2c')],qs[_0xc117('0x32')](_0x4a0719[_0xc117('0x2d')][_0xc117('0x32')]));_0x40e650[_0xc117('0x31')]=_0x40e650[_0xc117('0x31')][_0xc117('0x33')]?_0x40e650[_0xc117('0x31')]:_0x46a769['model'];_0x40e650['order']=qs[_0xc117('0x35')](_0x4a0719[_0xc117('0x2d')][_0xc117('0x35')]);_0x40e650[_0xc117('0x36')]=qs[_0xc117('0x2f')](_['pick'](_0x4a0719[_0xc117('0x2d')],_0x46a769[_0xc117('0x2f')]));if(_0x4a0719['query'][_0xc117('0x38')]){_0x40e650[_0xc117('0x36')]=_['merge'](_0x40e650['where'],{'$or':_[_0xc117('0x28')](_0x40e650[_0xc117('0x31')],function(_0x59652c){var _0x1eca43={};_0x1eca43[_0x59652c]={'$like':'%'+_0x4a0719[_0xc117('0x2d')][_0xc117('0x38')]+'%'};return _0x1eca43;})});}_0x40e650=_[_0xc117('0x3b')]({},_0x40e650,_0x4a0719[_0xc117('0x42')]);return _0x4aa43e[_0xc117('0x6f')](_0x40e650);}})[_0xc117('0x23')](function(_0x12e282){if(_0x12e282){_0x39d014=_0x12e282[_0xc117('0x33')];if(!_0x4a0719[_0xc117('0x2d')][_0xc117('0x34')](_0xc117('0x70'))){_0x40e650[_0xc117('0x1e')]=qs[_0xc117('0x1e')](_0x4a0719[_0xc117('0x2d')][_0xc117('0x1e')]);_0x40e650[_0xc117('0x1c')]=qs['offset'](_0x4a0719['query'][_0xc117('0x1c')]);}return _0x4aa43e[_0xc117('0x6f')](_0x40e650);}})[_0xc117('0x23')](function(_0x3f986c){if(_0x3f986c){return _0x3f986c?{'count':_0x39d014,'rows':_0x3f986c}:null;}})['then'](respondWithResult(_0x51d741,null))['catch'](handleError(_0x51d741,null));}; \ No newline at end of file +var _0x15da=['prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','body','update','findById','addAgents','params','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','findOne','rawAttributes','getAgents','rimraf','zip-dir','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','get','VoicePrefixes','UserProfileResource','end','sendStatus','stack','name','send','index','map','VoicePrefix','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','show','includeAll','find','catch','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority'];(function(_0x5cbb48,_0x3c630e){var _0x439605=function(_0x54d371){while(--_0x54d371){_0x5cbb48['push'](_0x5cbb48['shift']());}};_0x439605(++_0x3c630e);}(_0x15da,0x98));var _0xa15d=function(_0x27d020,_0x3e50af){_0x27d020=_0x27d020-0x0;var _0x14a24b=_0x15da[_0x27d020];return _0x14a24b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa15d('0x0'));var zipdir=require(_0xa15d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa15d('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa15d('0x3'));var path=require(_0xa15d('0x4'));var sox=require(_0xa15d('0x5'));var csv=require(_0xa15d('0x6'));var ejs=require(_0xa15d('0x7'));var fs=require('fs');var fs_extra=require(_0xa15d('0x8'));var _=require(_0xa15d('0x9'));var squel=require('squel');var crypto=require(_0xa15d('0xa'));var jsforce=require(_0xa15d('0xb'));var deskjs=require(_0xa15d('0xc'));var toCsv=require(_0xa15d('0x6'));var querystring=require(_0xa15d('0xd'));var Papa=require(_0xa15d('0xe'));var Redis=require(_0xa15d('0xf'));var authService=require(_0xa15d('0x10'));var qs=require(_0xa15d('0x11'));var as=require(_0xa15d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa15d('0x13'))(_0xa15d('0x14'));var utils=require(_0xa15d('0x15'));var config=require(_0xa15d('0x16'));var licenseUtil=require(_0xa15d('0x17'));var db=require(_0xa15d('0x18'))['db'];config['redis']=_['defaults'](config[_0xa15d('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa15d('0x1a'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0xa15d('0x1b')](socket);function respondWithStatusCode(_0xce4d51,_0x4a7856){_0x4a7856=_0x4a7856||0xcc;return function(_0x19578c){if(_0x19578c){return _0xce4d51['sendStatus'](_0x4a7856);}return _0xce4d51['status'](_0x4a7856)['end']();};}function respondWithResult(_0x2b4845,_0x4a0bea){_0x4a0bea=_0x4a0bea||0xc8;return function(_0x1e32ac){if(_0x1e32ac){return _0x2b4845[_0xa15d('0x1c')](_0x4a0bea)[_0xa15d('0x1d')](_0x1e32ac);}};}function respondWithFilteredResult(_0x45ebb0,_0x28a640){return function(_0xb353cb){if(_0xb353cb){var _0x2f1353=typeof _0x28a640[_0xa15d('0x1e')]===_0xa15d('0x1f')&&typeof _0x28a640['limit']===_0xa15d('0x1f');var _0x3753e3=_0xb353cb[_0xa15d('0x20')];var _0x5c9e6a=_0x2f1353?0x0:_0x28a640[_0xa15d('0x1e')];var _0x246152=_0x2f1353?_0xb353cb['count']:_0x28a640[_0xa15d('0x1e')]+_0x28a640[_0xa15d('0x21')];var _0x4dd7ca;if(_0x246152>=_0x3753e3){_0x246152=_0x3753e3;_0x4dd7ca=0xc8;}else{_0x4dd7ca=0xce;}_0x45ebb0[_0xa15d('0x1c')](_0x4dd7ca);return _0x45ebb0['set'](_0xa15d('0x22'),_0x5c9e6a+'-'+_0x246152+'/'+_0x3753e3)[_0xa15d('0x1d')](_0xb353cb);}return null;};}function patchUpdates(_0x2340f0){return function(_0x5c1827){try{jsonpatch[_0xa15d('0x23')](_0x5c1827,_0x2340f0,!![]);}catch(_0x5a386a){return BPromise[_0xa15d('0x24')](_0x5a386a);}return _0x5c1827[_0xa15d('0x25')]();};}function saveUpdates(_0x14ce9d,_0x1bf324){return function(_0x1132fb){if(_0x1132fb){return _0x1132fb['update'](_0x14ce9d)[_0xa15d('0x26')](function(_0x553025){return _0x553025;});}return null;};}function removeEntity(_0x33c9d4,_0x3ca0cf){return function(_0x2cfe62){if(_0x2cfe62){return _0x2cfe62[_0xa15d('0x27')]()[_0xa15d('0x26')](function(){var _0x589f83=_0x2cfe62[_0xa15d('0x28')]({'plain':!![]});var _0x42bed3=_0xa15d('0x29');return db[_0xa15d('0x2a')][_0xa15d('0x27')]({'where':{'type':_0x42bed3,'resourceId':_0x589f83['id']}})['then'](function(){return _0x2cfe62;});})[_0xa15d('0x26')](function(){_0x33c9d4[_0xa15d('0x1c')](0xcc)[_0xa15d('0x2b')]();});}};}function handleEntityNotFound(_0x3a60ae,_0x150b08){return function(_0x541d0e){if(!_0x541d0e){_0x3a60ae[_0xa15d('0x2c')](0x194);}return _0x541d0e;};}function handleError(_0x90829e,_0x2f8e2d){_0x2f8e2d=_0x2f8e2d||0x1f4;return function(_0x3d54bd){logger['error'](_0x3d54bd[_0xa15d('0x2d')]);if(_0x3d54bd[_0xa15d('0x2e')]){delete _0x3d54bd[_0xa15d('0x2e')];}_0x90829e['status'](_0x2f8e2d)[_0xa15d('0x2f')](_0x3d54bd);};}exports[_0xa15d('0x30')]=function(_0x5ba3a3,_0x37857f){var _0x115f19={},_0x36852e={},_0x4019b5={'count':0x0,'rows':[]};var _0x7d4dac=_[_0xa15d('0x31')](db[_0xa15d('0x32')]['rawAttributes'],function(_0x19e580){return{'name':_0x19e580[_0xa15d('0x33')],'type':_0x19e580['type'][_0xa15d('0x34')]};});_0x36852e[_0xa15d('0x35')]=_[_0xa15d('0x31')](_0x7d4dac,_0xa15d('0x2e'));_0x36852e[_0xa15d('0x36')]=_[_0xa15d('0x37')](_0x5ba3a3[_0xa15d('0x36')]);_0x36852e[_0xa15d('0x38')]=_[_0xa15d('0x39')](_0x36852e['model'],_0x36852e[_0xa15d('0x36')]);_0x115f19[_0xa15d('0x3a')]=_['intersection'](_0x36852e[_0xa15d('0x35')],qs[_0xa15d('0x3b')](_0x5ba3a3[_0xa15d('0x36')]['fields']));_0x115f19[_0xa15d('0x3a')]=_0x115f19[_0xa15d('0x3a')][_0xa15d('0x3c')]?_0x115f19['attributes']:_0x36852e[_0xa15d('0x35')];if(!_0x5ba3a3[_0xa15d('0x36')][_0xa15d('0x3d')](_0xa15d('0x3e'))){_0x115f19[_0xa15d('0x21')]=qs[_0xa15d('0x21')](_0x5ba3a3[_0xa15d('0x36')][_0xa15d('0x21')]);_0x115f19[_0xa15d('0x1e')]=qs[_0xa15d('0x1e')](_0x5ba3a3[_0xa15d('0x36')][_0xa15d('0x1e')]);}_0x115f19[_0xa15d('0x3f')]=qs[_0xa15d('0x40')](_0x5ba3a3['query'][_0xa15d('0x40')]);_0x115f19[_0xa15d('0x41')]=qs[_0xa15d('0x38')](_[_0xa15d('0x42')](_0x5ba3a3[_0xa15d('0x36')],_0x36852e[_0xa15d('0x38')]),_0x7d4dac);if(_0x5ba3a3['query'][_0xa15d('0x43')]){_0x115f19[_0xa15d('0x41')]=_[_0xa15d('0x44')](_0x115f19[_0xa15d('0x41')],{'$or':_['map'](_0x7d4dac,function(_0xd96a96){if(_0xd96a96[_0xa15d('0x45')]!==_0xa15d('0x46')){var _0x5b91dd={};_0x5b91dd[_0xd96a96[_0xa15d('0x2e')]]={'$like':'%'+_0x5ba3a3[_0xa15d('0x36')][_0xa15d('0x43')]+'%'};return _0x5b91dd;}})});}_0x115f19=_[_0xa15d('0x44')]({},_0x115f19,_0x5ba3a3[_0xa15d('0x47')]);var _0x1d971e={'where':_0x115f19[_0xa15d('0x41')]};return db[_0xa15d('0x32')][_0xa15d('0x20')](_0x1d971e)[_0xa15d('0x26')](function(_0x22fcf0){_0x4019b5['count']=_0x22fcf0;if(_0x5ba3a3['query']['includeAll']){_0x115f19[_0xa15d('0x48')]=[{'all':!![]}];}return db[_0xa15d('0x32')]['findAll'](_0x115f19);})[_0xa15d('0x26')](function(_0x59b1b4){_0x4019b5[_0xa15d('0x49')]=_0x59b1b4;return _0x4019b5;})['then'](respondWithFilteredResult(_0x37857f,_0x115f19))['catch'](handleError(_0x37857f,null));};exports[_0xa15d('0x4a')]=function(_0x41597f,_0x17676f){var _0x568aab={'raw':![],'where':{'id':_0x41597f['params']['id']}},_0x11c9b5={};_0x11c9b5[_0xa15d('0x35')]=_[_0xa15d('0x37')](db[_0xa15d('0x32')]['rawAttributes']);_0x11c9b5[_0xa15d('0x36')]=_[_0xa15d('0x37')](_0x41597f[_0xa15d('0x36')]);_0x11c9b5[_0xa15d('0x38')]=_['intersection'](_0x11c9b5['model'],_0x11c9b5['query']);_0x568aab[_0xa15d('0x3a')]=_[_0xa15d('0x39')](_0x11c9b5[_0xa15d('0x35')],qs[_0xa15d('0x3b')](_0x41597f[_0xa15d('0x36')]['fields']));_0x568aab[_0xa15d('0x3a')]=_0x568aab[_0xa15d('0x3a')][_0xa15d('0x3c')]?_0x568aab[_0xa15d('0x3a')]:_0x11c9b5['model'];if(_0x41597f[_0xa15d('0x36')][_0xa15d('0x4b')]){_0x568aab[_0xa15d('0x48')]=[{'all':!![]}];}_0x568aab=_['merge']({},_0x568aab,_0x41597f['options']);return db['VoicePrefix'][_0xa15d('0x4c')](_0x568aab)['then'](handleEntityNotFound(_0x17676f,null))[_0xa15d('0x26')](respondWithResult(_0x17676f,null))[_0xa15d('0x4d')](handleError(_0x17676f,null));};exports['destroy']=function(_0x34813f,_0x430ed5){return db[_0xa15d('0x32')][_0xa15d('0x4c')]({'where':{'id':_0x34813f['params']['id']}})[_0xa15d('0x26')](handleEntityNotFound(_0x430ed5,null))['then'](removeEntity(_0x430ed5,null))[_0xa15d('0x4d')](handleError(_0x430ed5,null));};exports[_0xa15d('0x4e')]=function(_0x38c274,_0x3e97db){return db['VoicePrefix'][_0xa15d('0x4e')]()['then'](respondWithResult(_0x3e97db,null))['catch'](handleError(_0x3e97db,null));};exports[_0xa15d('0x4f')]=function(_0x312527,_0x288b26){var _0x2a4ce7;return db[_0xa15d('0x50')][_0xa15d('0x51')](function(_0x17b809){return db[_0xa15d('0x32')][_0xa15d('0x4f')](_0x312527['body'],{'transaction':_0x17b809})[_0xa15d('0x26')](function(_0x59397c){_0x2a4ce7=_0x59397c[_0xa15d('0x28')]({'plain':!![]});return db[_0xa15d('0x52')][_0xa15d('0x4c')]({'where':{'id':_0x2a4ce7[_0xa15d('0x53')]},'raw':!![]})['then'](function(_0x378904){return createVoicePrefixExtensions(_0x2a4ce7,_0x378904,_0x17b809);});});})['then'](function(){var _0x50dcea=_0x312527[_0xa15d('0x54')][_0xa15d('0x28')]({'plain':!![]});if(!_0x50dcea)throw new Error(_0xa15d('0x55'));if(_0x50dcea['role']===_0xa15d('0x54')){var _0x58f1fb=_0x2a4ce7;return db[_0xa15d('0x56')][_0xa15d('0x4c')]({'where':{'name':_0xa15d('0x29'),'userProfileId':_0x50dcea['userProfileId']},'raw':!![]})['then'](function(_0x570500){if(_0x570500&&_0x570500[_0xa15d('0x57')]===0x0){return db['UserProfileResource'][_0xa15d('0x4f')]({'name':_0x58f1fb[_0xa15d('0x2e')],'resourceId':_0x58f1fb['id'],'type':_0x570500[_0xa15d('0x2e')],'sectionId':_0x570500['id']},{})[_0xa15d('0x26')](function(){return _0x2a4ce7;});}else{return _0x2a4ce7;}})[_0xa15d('0x4d')](function(_0x3094cc){logger[_0xa15d('0x58')](_0xa15d('0x59'),_0x3094cc);throw _0x3094cc;});}return _0x2a4ce7;})[_0xa15d('0x26')](respondWithResult(_0x288b26,null))[_0xa15d('0x4d')](handleError(_0x288b26,null));};function Extension(_0x57e250,_0x101a6c,_0xeaf7a5,_0x34e2d4){this['context']=_0xa15d('0x5a');this[_0xa15d('0x5b')]=_0x57e250;this[_0xa15d('0x5c')]=_0xeaf7a5;this['type']='system';this[_0xa15d('0x5d')]=_0xa15d('0x5e');this[_0xa15d('0x5f')]=_0x101a6c;this['appdata']=_0x34e2d4;}function createVoicePrefixExtensions(_0x46e45c,_0x41f14e,_0x4e27eb){return new BPromise(function(_0x45db09,_0xf54fc){var _0xbe32e0=new Extension(formatPrefixName(_0x46e45c[_0xa15d('0x60')]),0x1,_0xa15d('0x61'),_0xa15d('0x62'));_0xbe32e0[_0xa15d('0x63')]=_0x46e45c['id'];return db[_0xa15d('0x52')][_0xa15d('0x4f')](_0xbe32e0,{'transaction':_0x4e27eb})[_0xa15d('0x26')](function(_0x236bdc){var _0x5f2054=_0x236bdc[_0xa15d('0x28')]({'plain':!![]});var _0x32eab5=_['map'](addVoicePrefixExtensions(_0x46e45c,_0x41f14e),function(_0x2777f9){_0x2777f9[_0xa15d('0x53')]=_0x5f2054['id'];_0x2777f9['VoicePrefixId']=_0x46e45c['id'];return _0x2777f9;});return db[_0xa15d('0x52')][_0xa15d('0x64')](_0x32eab5,{'transaction':_0x4e27eb})[_0xa15d('0x26')](function(_0x10d3bd){if(!_0x10d3bd){return _0xf54fc(_0xa15d('0x65'));}else{return _0x45db09(_0x10d3bd);}})[_0xa15d('0x4d')](function(_0x33d7f0){return _0xf54fc(_0x33d7f0);});});;});};function addVoicePrefixExtensions(_0x2d6595,_0x4c05e5){var _0x51fa88=[];var _0x36d005=formatPrefixName(_0x2d6595['prefix']);_0x51fa88[_0xa15d('0x66')](new Extension(_0x36d005,0x2,_0xa15d('0x67'),_0xa15d('0x68')+_0x2d6595[_0xa15d('0x2e')]));if(_0x2d6595[_0xa15d('0x69')]){_0x51fa88[_0xa15d('0x66')](new Extension(_0x36d005,0x3,'Set',_0xa15d('0x6a')+_0x2d6595[_0xa15d('0x69')]));}else{_0x51fa88['push'](new Extension(_0x36d005,0x3,_0xa15d('0x61'),'No\x20callerid\x20available'));}_0x51fa88['push'](new Extension(_0x36d005,0x4,_0xa15d('0x6b'),_0x4c05e5['context']+','+_0xa15d('0x6c')+(0x8+_0x2d6595['name'][_0xa15d('0x3c')])+'}'+','+0x1));return _0x51fa88;}function formatPrefixName(_0xa3f91d){var _0x5eacb8='_';for(var _0x5885b7=0x0;_0x5885b7<_0xa3f91d[_0xa15d('0x3c')];_0x5885b7++){if(_0xa3f91d[_0xa15d('0x6d')](_0x5885b7)=='-'){_0x5eacb8+=_0xa3f91d[_0xa15d('0x6d')](_0x5885b7);}else{_0x5eacb8+='['+_0xa3f91d['charAt'](_0x5885b7)+']';}}_0x5eacb8+='.';return _0x5eacb8;}exports['update']=function(_0x4f319e,_0x506372,_0x2f6c1b){var _0x21ef3f=_0x4f319e[_0xa15d('0x6e')];_0x21ef3f[_0xa15d('0x60')]='system-'+_0x21ef3f[_0xa15d('0x2e')]+'-';return db[_0xa15d('0x50')][_0xa15d('0x51')](function(_0x35a2e4){return db[_0xa15d('0x32')][_0xa15d('0x6f')](_0x21ef3f,{'where':{'id':_0x21ef3f['id']},'transaction':_0x35a2e4})[_0xa15d('0x26')](function(){return db[_0xa15d('0x52')]['destroy']({'where':{'VoicePrefixId':_0x21ef3f['id']},'transaction':_0x35a2e4})[_0xa15d('0x26')](function(){return db[_0xa15d('0x52')]['find']({'where':{'id':_0x21ef3f[_0xa15d('0x53')]},'raw':!![]})[_0xa15d('0x26')](function(_0x542d58){return createVoicePrefixExtensions(_0x21ef3f,_0x542d58,_0x35a2e4);});});});})[_0xa15d('0x26')](function(){return db[_0xa15d('0x32')][_0xa15d('0x70')](_0x21ef3f['id']);})[_0xa15d('0x26')](respondWithResult(_0x506372,null))['catch'](handleError(_0x506372,null));};exports[_0xa15d('0x71')]=function(_0x424884,_0x1ac849,_0x1966ac){return db['VoicePrefix'][_0xa15d('0x4c')]({'where':{'id':_0x424884[_0xa15d('0x72')]['id']}})['then'](handleEntityNotFound(_0x1ac849,null))[_0xa15d('0x26')](function(_0x405a7a){if(_0x405a7a){return _0x405a7a['addAgents'](_0x424884[_0xa15d('0x6e')][_0xa15d('0x73')],_['omit'](_0x424884[_0xa15d('0x6e')],[_0xa15d('0x73'),'id'])||{})[_0xa15d('0x74')](function(_0x130eb2){for(var _0x4eef34=0x0;_0x4eef34<_0x424884[_0xa15d('0x6e')][_0xa15d('0x73')][_0xa15d('0x3c')];_0x4eef34+=0x1){socket[_0xa15d('0x75')](_0xa15d('0x76'),{'UserId':Number(_0x424884[_0xa15d('0x6e')][_0xa15d('0x73')][_0x4eef34]),'VoicePrefixId':Number(_0x424884[_0xa15d('0x72')]['id'])});}return _0x130eb2;});}})[_0xa15d('0x26')](respondWithResult(_0x1ac849,null))[_0xa15d('0x4d')](handleError(_0x1ac849,null));};exports['removeAgents']=function(_0xde4b25,_0x1e25ee,_0x1638c4){return db[_0xa15d('0x32')][_0xa15d('0x4c')]({'where':{'id':_0xde4b25[_0xa15d('0x72')]['id']}})[_0xa15d('0x26')](handleEntityNotFound(_0x1e25ee,null))['then'](function(_0x6c62ac){if(_0x6c62ac){return _0x6c62ac[_0xa15d('0x77')](_0xde4b25[_0xa15d('0x36')]['ids'])[_0xa15d('0x26')](function(){if(_['isArray'](_0xde4b25[_0xa15d('0x36')][_0xa15d('0x73')])){for(var _0x4ea3ce=0x0;_0x4ea3ce<_0xde4b25[_0xa15d('0x36')][_0xa15d('0x73')][_0xa15d('0x3c')];_0x4ea3ce+=0x1){socket[_0xa15d('0x75')](_0xa15d('0x78'),{'UserId':Number(_0xde4b25['query'][_0xa15d('0x73')][_0x4ea3ce]),'VoicePrefixId':Number(_0xde4b25[_0xa15d('0x72')]['id'])});}}else{socket[_0xa15d('0x75')](_0xa15d('0x78'),{'UserId':Number(_0xde4b25[_0xa15d('0x36')][_0xa15d('0x73')]),'VoicePrefixId':Number(_0xde4b25[_0xa15d('0x72')]['id'])});}});}})[_0xa15d('0x26')](respondWithStatusCode(_0x1e25ee,null))[_0xa15d('0x4d')](handleError(_0x1e25ee,null));};exports['getAgents']=function(_0x4a1da2,_0x2e3330,_0x4bfd71){var _0x12ba73={};var _0x2c46af={};var _0x16f4d6;var _0x34003d;return db['VoicePrefix'][_0xa15d('0x79')]({'where':{'id':_0x4a1da2['params']['id']}})[_0xa15d('0x26')](handleEntityNotFound(_0x2e3330,null))[_0xa15d('0x26')](function(_0x28a510){if(_0x28a510){_0x16f4d6=_0x28a510;_0x2c46af[_0xa15d('0x35')]=_['keys'](db['User'][_0xa15d('0x7a')]);_0x2c46af['query']=_[_0xa15d('0x37')](_0x4a1da2[_0xa15d('0x36')]);_0x2c46af[_0xa15d('0x38')]=_[_0xa15d('0x39')](_0x2c46af[_0xa15d('0x35')],_0x2c46af[_0xa15d('0x36')]);_0x12ba73[_0xa15d('0x3a')]=_[_0xa15d('0x39')](_0x2c46af['model'],qs['fields'](_0x4a1da2['query']['fields']));_0x12ba73[_0xa15d('0x3a')]=_0x12ba73['attributes'][_0xa15d('0x3c')]?_0x12ba73['attributes']:_0x2c46af['model'];_0x12ba73[_0xa15d('0x3f')]=qs['sort'](_0x4a1da2['query'][_0xa15d('0x40')]);_0x12ba73[_0xa15d('0x41')]=qs['filters'](_[_0xa15d('0x42')](_0x4a1da2[_0xa15d('0x36')],_0x2c46af[_0xa15d('0x38')]));if(_0x4a1da2['query'][_0xa15d('0x43')]){_0x12ba73['where']=_[_0xa15d('0x44')](_0x12ba73[_0xa15d('0x41')],{'$or':_['map'](_0x12ba73[_0xa15d('0x3a')],function(_0x30f339){var _0x39f0e7={};_0x39f0e7[_0x30f339]={'$like':'%'+_0x4a1da2[_0xa15d('0x36')][_0xa15d('0x43')]+'%'};return _0x39f0e7;})});}_0x12ba73=_[_0xa15d('0x44')]({},_0x12ba73,_0x4a1da2[_0xa15d('0x47')]);return _0x16f4d6[_0xa15d('0x7b')](_0x12ba73);}})[_0xa15d('0x26')](function(_0x48fd22){if(_0x48fd22){_0x34003d=_0x48fd22[_0xa15d('0x3c')];if(!_0x4a1da2[_0xa15d('0x36')]['hasOwnProperty'](_0xa15d('0x3e'))){_0x12ba73[_0xa15d('0x21')]=qs[_0xa15d('0x21')](_0x4a1da2[_0xa15d('0x36')][_0xa15d('0x21')]);_0x12ba73[_0xa15d('0x1e')]=qs['offset'](_0x4a1da2[_0xa15d('0x36')][_0xa15d('0x1e')]);}return _0x16f4d6[_0xa15d('0x7b')](_0x12ba73);}})[_0xa15d('0x26')](function(_0x325ecd){if(_0x325ecd){return _0x325ecd?{'count':_0x34003d,'rows':_0x325ecd}:null;}})[_0xa15d('0x26')](respondWithResult(_0x2e3330,null))[_0xa15d('0x4d')](handleError(_0x2e3330,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 1de02d1..0155209 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 _0x4293=['emit','exports','../../mysqldb','setMaxListeners','update'];(function(_0x11e03f,_0x20b967){var _0x5666fe=function(_0x19ce63){while(--_0x19ce63){_0x11e03f['push'](_0x11e03f['shift']());}};_0x5666fe(++_0x20b967);}(_0x4293,0x1b0));var _0x3429=function(_0x56c122,_0x45f00d){_0x56c122=_0x56c122-0x0;var _0x381bad=_0x4293[_0x56c122];return _0x381bad;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x3429('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x3429('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3429('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2c1fa8){return function(_0x16b53f,_0x440b73,_0x2f0ab4){VoicePrefixEvents[_0x3429('0x3')](_0x2c1fa8+':'+_0x16b53f['id'],_0x16b53f);VoicePrefixEvents[_0x3429('0x3')](_0x2c1fa8,_0x16b53f);_0x2f0ab4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x3429('0x4')]=VoicePrefixEvents; \ No newline at end of file +var _0xdc76=['remove','emit','hasOwnProperty','events','../../mysqldb','VoicePrefix','save'];(function(_0x3cb7e8,_0xb8f77){var _0x72798f=function(_0x114662){while(--_0x114662){_0x3cb7e8['push'](_0x3cb7e8['shift']());}};_0x72798f(++_0xb8f77);}(_0xdc76,0x106));var _0x6dc7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdc76[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x6dc7('0x0'));var VoicePrefix=require(_0x6dc7('0x1'))['db'][_0x6dc7('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6dc7('0x3'),'afterUpdate':'update','afterDestroy':_0x6dc7('0x4')};function emitEvent(_0x31c72d){return function(_0x503788,_0x14830a,_0x50984d){VoicePrefixEvents['emit'](_0x31c72d+':'+_0x503788['id'],_0x503788);VoicePrefixEvents[_0x6dc7('0x5')](_0x31c72d,_0x503788);_0x50984d(null);};}for(var e in events){if(events[_0x6dc7('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 547a95d..06b3757 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 _0x8a20=['bluebird','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','util','../../config/logger'];(function(_0x85fca,_0x1bf3de){var _0x80d3bd=function(_0x4fd7c6){while(--_0x4fd7c6){_0x85fca['push'](_0x85fca['shift']());}};_0x80d3bd(++_0x1bf3de);}(_0x8a20,0x73));var _0x08a2=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x8a20[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0x08a2('0x0'));var logger=require(_0x08a2('0x1'))('api');var moment=require('moment');var BPromise=require(_0x08a2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x08a2('0x3'));var rimraf=require(_0x08a2('0x4'));var config=require(_0x08a2('0x5'));var attributes=require(_0x08a2('0x6'));module[_0x08a2('0x7')]=function(_0x94f7f5,_0x38ed9f){return _0x94f7f5[_0x08a2('0x8')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x085b=['define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./voicePrefix.attributes','exports'];(function(_0x2fbb2b,_0x2de99d){var _0x56a823=function(_0xe5e446){while(--_0xe5e446){_0x2fbb2b['push'](_0x2fbb2b['shift']());}};_0x56a823(++_0x2de99d);}(_0x085b,0x1a7));var _0xb085=function(_0x24940d,_0x334b24){_0x24940d=_0x24940d-0x0;var _0x1d5ea2=_0x085b[_0x24940d];return _0x1d5ea2;};'use strict';var _=require(_0xb085('0x0'));var util=require(_0xb085('0x1'));var logger=require(_0xb085('0x2'))(_0xb085('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb085('0x4'));var fs=require('fs');var path=require(_0xb085('0x5'));var rimraf=require('rimraf');var config=require(_0xb085('0x6'));var attributes=require(_0xb085('0x7'));module[_0xb085('0x8')]=function(_0xed619b,_0x53a61a){return _0xed619b[_0xb085('0x9')](_0xb085('0xa'),attributes,{'tableName':_0xb085('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index ed1722a..936d67e 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 _0x958a=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','randomstring'];(function(_0x16cb98,_0x150c3a){var _0x161640=function(_0x1c36a4){while(--_0x1c36a4){_0x16cb98['push'](_0x16cb98['shift']());}};_0x161640(++_0x150c3a);}(_0x958a,0x128));var _0xa958=function(_0xcb0f5d,_0x2c9e3f){_0xcb0f5d=_0xcb0f5d-0x0;var _0x2ca50d=_0x958a[_0xcb0f5d];return _0x2ca50d;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});config[_0xa958('0xb')]=_[_0xa958('0xc')](config[_0xa958('0xb')],{'host':_0xa958('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa958('0xe'))[_0xa958('0xf')](socket);function respondWithRpcPromise(_0x11f090,_0x44b66e,_0x37afa0){return new BPromise(function(_0x94caac,_0xebb1c6){return client[_0xa958('0x10')](_0x11f090,_0x37afa0)[_0xa958('0x11')](function(_0x250999){logger[_0xa958('0x12')](_0xa958('0x13'),_0x44b66e,_0xa958('0x14'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x44b66e,'request\x20sent',JSON[_0xa958('0x15')](_0x250999));if(_0x250999[_0xa958('0x16')]){if(_0x250999[_0xa958('0x16')]['code']===0x1f4){logger[_0xa958('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x44b66e,_0x250999['error']['message']);return _0xebb1c6(_0x250999[_0xa958('0x16')][_0xa958('0x17')]);}logger[_0xa958('0x16')](_0xa958('0x13'),_0x44b66e,_0x250999[_0xa958('0x16')][_0xa958('0x17')]);return _0x94caac(_0x250999[_0xa958('0x16')][_0xa958('0x17')]);}else{logger['info'](_0xa958('0x13'),_0x44b66e,'request\x20sent');_0x94caac(_0x250999[_0xa958('0x18')][_0xa958('0x17')]);}})['catch'](function(_0xe4129a){logger[_0xa958('0x16')](_0xa958('0x13'),_0x44b66e,_0xe4129a);_0xebb1c6(_0xe4129a);});});} \ No newline at end of file +var _0x79bf=['../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x79bf,0x1df));var _0xf79b=function(_0xe3bbea,_0x3ae4d3){_0xe3bbea=_0xe3bbea-0x0;var _0x18713d=_0x79bf[_0xe3bbea];return _0x18713d;};'use strict';var _=require('lodash');var util=require(_0xf79b('0x0'));var moment=require('moment');var BPromise=require(_0xf79b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf79b('0x2'));var db=require(_0xf79b('0x3'))['db'];var utils=require(_0xf79b('0x4'));var logger=require(_0xf79b('0x5'))(_0xf79b('0x6'));var config=require(_0xf79b('0x7'));var jayson=require(_0xf79b('0x8'));var client=jayson['client'][_0xf79b('0x9')]({'port':0x232a});config[_0xf79b('0xa')]=_[_0xf79b('0xb')](config['redis'],{'host':_0xf79b('0xc'),'port':0x18eb});var socket=require(_0xf79b('0xd'))(new Redis(config[_0xf79b('0xa')]));require(_0xf79b('0xe'))['register'](socket);function respondWithRpcPromise(_0x5c3518,_0x183424,_0x1eeddd){return new BPromise(function(_0x285865,_0x1c65cc){return client[_0xf79b('0xf')](_0x5c3518,_0x1eeddd)[_0xf79b('0x10')](function(_0x39945f){logger['info'](_0xf79b('0x11'),_0x183424,_0xf79b('0x12'));logger[_0xf79b('0x13')](_0xf79b('0x14'),_0x183424,_0xf79b('0x12'),JSON[_0xf79b('0x15')](_0x39945f));if(_0x39945f[_0xf79b('0x16')]){if(_0x39945f[_0xf79b('0x16')][_0xf79b('0x17')]===0x1f4){logger[_0xf79b('0x16')](_0xf79b('0x11'),_0x183424,_0x39945f[_0xf79b('0x16')]['message']);return _0x1c65cc(_0x39945f['error'][_0xf79b('0x18')]);}logger['error'](_0xf79b('0x11'),_0x183424,_0x39945f['error'][_0xf79b('0x18')]);return _0x285865(_0x39945f['error']['message']);}else{logger[_0xf79b('0x19')]('VoicePrefix,\x20%s,\x20%s',_0x183424,_0xf79b('0x12'));_0x285865(_0x39945f[_0xf79b('0x1a')][_0xf79b('0x18')]);}})['catch'](function(_0xf13a4){logger['error'](_0xf79b('0x11'),_0x183424,_0xf13a4);_0x1c65cc(_0xf13a4);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 2f5a364..9e5ca67 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 _0x579c=['voicePrefix:','./voicePrefix.events','save','remove','update','removeListener','register'];(function(_0x5a38c1,_0x57a953){var _0x3bbc44=function(_0x526837){while(--_0x526837){_0x5a38c1['push'](_0x5a38c1['shift']());}};_0x3bbc44(++_0x57a953);}(_0x579c,0xda));var _0xc579=function(_0x2e351b,_0x4a967d){_0x2e351b=_0x2e351b-0x0;var _0x153613=_0x579c[_0x2e351b];return _0x153613;};'use strict';var VoicePrefixEvents=require(_0xc579('0x0'));var events=[_0xc579('0x1'),_0xc579('0x2'),_0xc579('0x3')];function createListener(_0x397136,_0x586948){return function(_0x1e2808){_0x586948['emit'](_0x397136,_0x1e2808);};}function removeListener(_0x21a0a2,_0x3b913c){return function(){VoicePrefixEvents[_0xc579('0x4')](_0x21a0a2,_0x3b913c);};}exports[_0xc579('0x5')]=function(_0x124ee5){for(var _0x1bd276=0x0,_0x2e451b=events['length'];_0x1bd276<_0x2e451b;_0x1bd276++){var _0x1c6d9c=events[_0x1bd276];var _0x293c4a=createListener(_0xc579('0x6')+_0x1c6d9c,_0x124ee5);VoicePrefixEvents['on'](_0x1c6d9c,_0x293c4a);}}; \ No newline at end of file +var _0xbc8b=['emit','removeListener','register','save','update'];(function(_0x2770b7,_0x1f8d0d){var _0x3cc528=function(_0x5be37d){while(--_0x5be37d){_0x2770b7['push'](_0x2770b7['shift']());}};_0x3cc528(++_0x1f8d0d);}(_0xbc8b,0x16b));var _0xbbc8=function(_0x5550b3,_0x2d0ee0){_0x5550b3=_0x5550b3-0x0;var _0x4b8fc4=_0xbc8b[_0x5550b3];return _0x4b8fc4;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xbbc8('0x0'),'remove',_0xbbc8('0x1')];function createListener(_0x258371,_0x472e52){return function(_0x1bb600){_0x472e52[_0xbbc8('0x2')](_0x258371,_0x1bb600);};}function removeListener(_0x8abfdb,_0x49218a){return function(){VoicePrefixEvents[_0xbbc8('0x3')](_0x8abfdb,_0x49218a);};}exports[_0xbbc8('0x4')]=function(_0x15cdc6){for(var _0x21f15a=0x0,_0x18c3d7=events['length'];_0x21f15a<_0x18c3d7;_0x21f15a++){var _0x396aa2=events[_0x21f15a];var _0x313a01=createListener('voicePrefix:'+_0x396aa2,_0x15cdc6);VoicePrefixEvents['on'](_0x396aa2,_0x313a01);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index c0bb71c..93c3fc1 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 _0xcc19=['post','/:id/clone','clone','addTeams','addLists','addBlackLists','put','update','delete','destroy','removeTeams','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','/:id/lists','getLists','/:id/blacklists'];(function(_0x158d88,_0x489365){var _0x22e983=function(_0x46c4a8){while(--_0x46c4a8){_0x158d88['push'](_0x158d88['shift']());}};_0x22e983(++_0x489365);}(_0xcc19,0xea));var _0x9cc1=function(_0x43841f,_0x4df0c4){_0x43841f=_0x43841f-0x0;var _0x417f61=_0xcc19[_0x43841f];return _0x417f61;};'use strict';var multer=require(_0x9cc1('0x0'));var util=require(_0x9cc1('0x1'));var path=require(_0x9cc1('0x2'));var timeout=require(_0x9cc1('0x3'));var express=require(_0x9cc1('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9cc1('0x5'));var interaction=require(_0x9cc1('0x6'));var config=require(_0x9cc1('0x7'));var controller=require(_0x9cc1('0x8'));router['get']('/',auth[_0x9cc1('0x9')](),controller[_0x9cc1('0xa')]);router[_0x9cc1('0xb')](_0x9cc1('0xc'),auth[_0x9cc1('0x9')](),controller[_0x9cc1('0xd')]);router['get'](_0x9cc1('0xe'),auth[_0x9cc1('0x9')](),controller[_0x9cc1('0xf')]);router[_0x9cc1('0xb')](_0x9cc1('0x10'),auth[_0x9cc1('0x9')](),controller[_0x9cc1('0x11')]);router[_0x9cc1('0xb')](_0x9cc1('0x12'),auth['isAuthenticated'](),controller[_0x9cc1('0x13')]);router[_0x9cc1('0xb')](_0x9cc1('0x14'),auth[_0x9cc1('0x9')](),controller[_0x9cc1('0x15')]);router[_0x9cc1('0xb')](_0x9cc1('0x16'),auth['isAuthenticated'](),controller[_0x9cc1('0x17')]);router[_0x9cc1('0xb')](_0x9cc1('0x18'),auth[_0x9cc1('0x9')](),controller[_0x9cc1('0x19')]);router[_0x9cc1('0xb')](_0x9cc1('0x1a'),auth[_0x9cc1('0x9')](),controller['getMembers']);router['get'](_0x9cc1('0x1b'),auth['isAuthenticated'](),controller[_0x9cc1('0x1c')]);router[_0x9cc1('0xb')](_0x9cc1('0x1d'),auth[_0x9cc1('0x9')](),controller['getBlackLists']);router[_0x9cc1('0x1e')]('/',auth[_0x9cc1('0x9')](),controller['create']);router[_0x9cc1('0x1e')](_0x9cc1('0x1f'),auth['isAuthenticated'](),controller[_0x9cc1('0x20')]);router[_0x9cc1('0x1e')]('/:id/teams',auth[_0x9cc1('0x9')](),controller[_0x9cc1('0x21')]);router[_0x9cc1('0x1e')](_0x9cc1('0x18'),auth['isAuthenticated'](),controller['addAgents']);router[_0x9cc1('0x1e')](_0x9cc1('0x1b'),auth['isAuthenticated'](),controller[_0x9cc1('0x22')]);router['post'](_0x9cc1('0x1d'),auth['isAuthenticated'](),controller[_0x9cc1('0x23')]);router[_0x9cc1('0x24')](_0x9cc1('0xc'),auth['isAuthenticated'](),controller[_0x9cc1('0x25')]);router[_0x9cc1('0x26')](_0x9cc1('0xc'),auth[_0x9cc1('0x9')](),controller[_0x9cc1('0x27')]);router[_0x9cc1('0x26')](_0x9cc1('0x16'),auth[_0x9cc1('0x9')](),controller[_0x9cc1('0x28')]);router['delete']('/:id/users',auth[_0x9cc1('0x9')](),controller['removeAgents']);router[_0x9cc1('0x26')](_0x9cc1('0x1b'),auth[_0x9cc1('0x9')](),controller[_0x9cc1('0x29')]);router[_0x9cc1('0x26')](_0x9cc1('0x1d'),auth['isAuthenticated'](),controller[_0x9cc1('0x2a')]);module[_0x9cc1('0x2b')]=router; \ No newline at end of file +var _0x8e72=['isAuthenticated','/:id','show','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','getMembers','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x132d12,_0x2c9799){var _0x1c3163=function(_0x7d9136){while(--_0x7d9136){_0x132d12['push'](_0x132d12['shift']());}};_0x1c3163(++_0x2c9799);}(_0x8e72,0x1e1));var _0x28e7=function(_0x18284b,_0x53c508){_0x18284b=_0x18284b-0x0;var _0x3caa79=_0x8e72[_0x18284b];return _0x3caa79;};'use strict';var multer=require(_0x28e7('0x0'));var util=require(_0x28e7('0x1'));var path=require(_0x28e7('0x2'));var timeout=require(_0x28e7('0x3'));var express=require(_0x28e7('0x4'));var router=express[_0x28e7('0x5')]();var fs_extra=require(_0x28e7('0x6'));var auth=require(_0x28e7('0x7'));var interaction=require(_0x28e7('0x8'));var config=require(_0x28e7('0x9'));var controller=require('./voiceQueue.controller');router[_0x28e7('0xa')]('/',auth[_0x28e7('0xb')](),controller['index']);router[_0x28e7('0xa')](_0x28e7('0xc'),auth[_0x28e7('0xb')](),controller[_0x28e7('0xd')]);router[_0x28e7('0xa')]('/:id/hoppers',auth[_0x28e7('0xb')](),controller['getHoppers']);router[_0x28e7('0xa')]('/:id/hopper_histories',auth[_0x28e7('0xb')](),controller[_0x28e7('0xe')]);router[_0x28e7('0xa')](_0x28e7('0xf'),auth[_0x28e7('0xb')](),controller['getHopperFinals']);router[_0x28e7('0xa')](_0x28e7('0x10'),auth[_0x28e7('0xb')](),controller[_0x28e7('0x11')]);router[_0x28e7('0xa')](_0x28e7('0x12'),auth[_0x28e7('0xb')](),controller[_0x28e7('0x13')]);router[_0x28e7('0xa')](_0x28e7('0x14'),auth[_0x28e7('0xb')](),controller['getAgents']);router[_0x28e7('0xa')](_0x28e7('0x15'),auth[_0x28e7('0xb')](),controller[_0x28e7('0x16')]);router['get'](_0x28e7('0x17'),auth[_0x28e7('0xb')](),controller[_0x28e7('0x18')]);router[_0x28e7('0xa')]('/:id/blacklists',auth[_0x28e7('0xb')](),controller[_0x28e7('0x19')]);router[_0x28e7('0x1a')]('/',auth[_0x28e7('0xb')](),controller[_0x28e7('0x1b')]);router['post'](_0x28e7('0x1c'),auth[_0x28e7('0xb')](),controller['clone']);router[_0x28e7('0x1a')](_0x28e7('0x12'),auth[_0x28e7('0xb')](),controller[_0x28e7('0x1d')]);router[_0x28e7('0x1a')](_0x28e7('0x14'),auth['isAuthenticated'](),controller[_0x28e7('0x1e')]);router['post']('/:id/lists',auth[_0x28e7('0xb')](),controller[_0x28e7('0x1f')]);router[_0x28e7('0x1a')](_0x28e7('0x20'),auth[_0x28e7('0xb')](),controller[_0x28e7('0x21')]);router['put'](_0x28e7('0xc'),auth[_0x28e7('0xb')](),controller[_0x28e7('0x22')]);router[_0x28e7('0x23')]('/:id',auth[_0x28e7('0xb')](),controller[_0x28e7('0x24')]);router[_0x28e7('0x23')](_0x28e7('0x12'),auth[_0x28e7('0xb')](),controller[_0x28e7('0x25')]);router[_0x28e7('0x23')](_0x28e7('0x14'),auth[_0x28e7('0xb')](),controller[_0x28e7('0x26')]);router['delete']('/:id/lists',auth[_0x28e7('0xb')](),controller[_0x28e7('0x27')]);router[_0x28e7('0x23')]('/:id/blacklists',auth[_0x28e7('0xb')](),controller['removeBlackLists']);module[_0x28e7('0x28')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 7429e70..1a84ac3 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 _0x2e35=['Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','inbound','outbound','default','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','booked','progressive','predictive','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','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.','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never'];(function(_0x3c4062,_0x3767fc){var _0x3f5bf3=function(_0x105e55){while(--_0x105e55){_0x3c4062['push'](_0x3c4062['shift']());}};_0x3f5bf3(++_0x3767fc);}(_0x2e35,0x101));var _0x52e3=function(_0x152bab,_0xbf4ad5){_0x152bab=_0x152bab-0x0;var _0x417170=_0x2e35[_0x152bab];return _0x417170;};'use strict';var Sequelize=require(_0x52e3('0x0'));module['exports']={'name':{'type':Sequelize[_0x52e3('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x52e3('0x2')](_0x52e3('0x3'),_0x52e3('0x4')),'allowNull':![],'defaultValue':_0x52e3('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x52e3('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall',_0x52e3('0x6'),_0x52e3('0x7'),_0x52e3('0x8'),_0x52e3('0x9'),_0x52e3('0xa'),_0x52e3('0xb'),_0x52e3('0xc')),'allowNull':![],'defaultValue':_0x52e3('0xd'),'set':function(_0x5c0069){this[_0x52e3('0xe')](_0x52e3('0xf'),_0x5c0069?_0x5c0069:_0x52e3('0x9'));},'get':function(){var _0x33155f=this[_0x52e3('0x10')](_0x52e3('0x11'));var _0x58b74b=this['getDataValue']('dialMethod');var _0x53c6f4=this[_0x52e3('0x10')](_0x52e3('0xf'));if(_0x33155f===_0x52e3('0x3')){return _0x53c6f4;}if(_0x58b74b==='booked'&&_0x53c6f4===_0x52e3('0x9')||_0x58b74b===_0x52e3('0x12')&&_0x53c6f4==='roundrobin'){return _0x53c6f4;}if(_0x58b74b===_0x52e3('0x13')||_0x58b74b===_0x52e3('0x14')||_0x58b74b==='power'){return _0x53c6f4;}return null;}},'servicelevel':{'type':Sequelize[_0x52e3('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x52e3('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x52e3('0x15')](0xb)},'timeout':{'type':Sequelize[_0x52e3('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x52e3('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x52e3('0x1')]},'weight':{'type':Sequelize[_0x52e3('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x52e3('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x52e3('0x2')](_0x52e3('0x16'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x52e3('0x2')](_0x52e3('0x16'),'no',_0x52e3('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x52e3('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x52e3('0x2')](_0x52e3('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x52e3('0x2')](_0x52e3('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x52e3('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x52e3('0x2')](_0x52e3('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x52e3('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x52e3('0x2')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x52e3('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x52e3('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x52e3('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x52e3('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x52e3('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x52e3('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x52e3('0x2')](_0x52e3('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x52e3('0x2')](_0x52e3('0x16'),'no'),'defaultValue':_0x52e3('0x16')},'announce_holdtime':{'type':Sequelize[_0x52e3('0x2')](_0x52e3('0x16'),'no',_0x52e3('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x52e3('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x52e3('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x52e3('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x52e3('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x52e3('0x1')]},'queue_youarenext':{'type':Sequelize[_0x52e3('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x52e3('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x52e3('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x52e3('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x52e3('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x52e3('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x52e3('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x52e3('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x52e3('0x1')]},'queue_less_than':{'type':Sequelize[_0x52e3('0x1')]},'periodic_announce':{'type':Sequelize[_0x52e3('0x19')],'set':function(_0x574bb1){this[_0x52e3('0xe')](_0x52e3('0x1a'),_0x574bb1?_0x574bb1[_0x52e3('0x1b')](','):[]);},'get':function(){return this[_0x52e3('0x10')](_0x52e3('0x1a'))?this[_0x52e3('0x10')]('periodic_announce')[_0x52e3('0x1c')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x52e3('0x16'),'set':function(_0x32fa8a){this[_0x52e3('0xe')]('joinempty',_0x32fa8a?_0x32fa8a[_0x52e3('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x52e3('0x1d'))?this[_0x52e3('0x10')](_0x52e3('0x1d'))[_0x52e3('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x52e3('0x1')],'defaultValue':'no','set':function(_0x29235c){this['setDataValue'](_0x52e3('0x1e'),_0x29235c?_0x29235c[_0x52e3('0x1b')](','):undefined);},'get':function(){return this[_0x52e3('0x10')]('leavewhenempty')?this[_0x52e3('0x10')](_0x52e3('0x1e'))[_0x52e3('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x52e3('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x52e3('0x2')](_0x52e3('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x52e3('0x2')](_0x52e3('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x52e3('0x1')]},'description':{'type':Sequelize[_0x52e3('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0xfca834){this['setDataValue'](_0x52e3('0x1f'),_0xfca834);if(_0xfca834){if(this['getDataValue']('wrapuptime')<0x2){this['setDataValue'](_0x52e3('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x52e3('0x21')],'defaultValue':0x0,'comment':_0x52e3('0x22')},'dialMethod':{'type':Sequelize[_0x52e3('0x2')](_0x52e3('0x23'),_0x52e3('0x13'),_0x52e3('0x24'),_0x52e3('0x14'),_0x52e3('0x12')),'defaultValue':'progressive','comment':_0x52e3('0x25')},'dialLimitChannel':{'type':Sequelize[_0x52e3('0x15')](0x4)[_0x52e3('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x52e3('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x52e3('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x52e3('0x28')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x52e3('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x52e3('0x29'),'dropRate'),'defaultValue':'dropRate','comment':_0x52e3('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x52e3('0x2b')](0x2)[_0x52e3('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x52e3('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x52e3('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x52e3('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x52e3('0x15')](0x3)[_0x52e3('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52e3('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x52e3('0x1')],'defaultValue':'tTxX','comment':_0x52e3('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x52e3('0x15')](0x3)[_0x52e3('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52e3('0x30')},'dialQueueProject':{'type':Sequelize[_0x52e3('0x1')],'comment':_0x52e3('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x52e3('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52e3('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52e3('0x33')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52e3('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x52e3('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52e3('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x52e3('0x15')](0x3)[_0x52e3('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x52e3('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52e3('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0x52e3('0x15')](0x3)[_0x52e3('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x52e3('0x37')},'dialTimezone':{'type':Sequelize[_0x52e3('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x52e3('0x1')],'defaultValue':_0x52e3('0x38')},'dialPrefix':{'type':Sequelize[_0x52e3('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x52e3('0x2')](_0x52e3('0x39'),_0x52e3('0x3a'),'onlyIfOpen'),'defaultValue':_0x52e3('0x39')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x52e3('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x52e3('0x15')](0x9)[_0x52e3('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x52e3('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x52e3('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x52e3('0x15')](0x9)[_0x52e3('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x52e3('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x52e3('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x52e3('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x52e3('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x52e3('0x15')](0x9)[_0x52e3('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x52e3('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x52e3('0x15')](0x9)[_0x52e3('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x52e3('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x52e3('0x15')](0x5)[_0x52e3('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x52e3('0x15')](0x9)[_0x52e3('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x52e3('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x52e3('0x15')](0x5)[_0x52e3('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x52e3('0x42')},'dialRecallInQueue':{'type':Sequelize[_0x52e3('0x21')],'defaultValue':0x0,'comment':_0x52e3('0x43')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x52e3('0x44'),_0x52e3('0x45')),'defaultValue':_0x52e3('0x44')},'dialQueueProject2':{'type':Sequelize[_0x52e3('0x1')],'comment':_0x52e3('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x52e3('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x52e3('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x52e3('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x52e3('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x52e3('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x52e3('0x15')](0x3)[_0x52e3('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x52e3('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x52e3('0x15')](0x3)[_0x52e3('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52e3('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x52e3('0x15')](0x5)[_0x52e3('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52e3('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x52e3('0x15')](0x3)[_0x52e3('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52e3('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x52e3('0x15')](0x5)[_0x52e3('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52e3('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x52e3('0x15')](0x3)[_0x52e3('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x52e3('0x15')](0x5)[_0x52e3('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52e3('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x52e3('0x15')](0x3)[_0x52e3('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x52e3('0x15')](0x5)[_0x52e3('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x52e3('0x15')],'allowNull':!![],'comment':_0x52e3('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0x52e3('0x21')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3a8bbf){if(!_0x3a8bbf)this[_0x52e3('0xe')](_0x52e3('0x4d'),null);this[_0x52e3('0xe')](_0x52e3('0x4e'),_0x3a8bbf);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x52e3('0x15')](0x3)[_0x52e3('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x52e3('0x15')](0x3)[_0x52e3('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xeea0=['dialMethod','progressive','predictive','INTEGER','yes','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','acw','wrapuptime','BOOLEAN','preview','power','booked','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','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\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','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)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','outbound','inbound','default','ringall','fewestcalls','random','rrmemory','linear','wrandom','setDataValue','strategy','getDataValue'];(function(_0x55e565,_0x371bf7){var _0x21b288=function(_0x3fabcf){while(--_0x3fabcf){_0x55e565['push'](_0x55e565['shift']());}};_0x21b288(++_0x371bf7);}(_0xeea0,0x91));var _0x0eea=function(_0x3b0c43,_0x1bb7e2){_0x3b0c43=_0x3b0c43-0x0;var _0x38ef84=_0xeea0[_0x3b0c43];return _0x38ef84;};'use strict';var Sequelize=require(_0x0eea('0x0'));module[_0x0eea('0x1')]={'name':{'type':Sequelize[_0x0eea('0x2')],'allowNull':![],'unique':_0x0eea('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0eea('0x4')]('inbound',_0x0eea('0x5')),'allowNull':![],'defaultValue':_0x0eea('0x6')},'musiconhold':{'type':Sequelize[_0x0eea('0x2')],'defaultValue':_0x0eea('0x7')},'announce':{'type':Sequelize[_0x0eea('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0eea('0x4')]('rr',_0x0eea('0x8'),'leastrecent',_0x0eea('0x9'),_0x0eea('0xa'),_0x0eea('0xb'),_0x0eea('0xc'),_0x0eea('0xd'),'rrordered'),'allowNull':![],'defaultValue':_0x0eea('0x8'),'set':function(_0x14fad3){this[_0x0eea('0xe')](_0x0eea('0xf'),_0x14fad3?_0x14fad3:'rrmemory');},'get':function(){var _0x4fd6b1=this[_0x0eea('0x10')]('type');var _0x5ab324=this[_0x0eea('0x10')](_0x0eea('0x11'));var _0x48bf32=this[_0x0eea('0x10')]('strategy');if(_0x4fd6b1===_0x0eea('0x6')){return _0x48bf32;}if(_0x5ab324==='booked'&&_0x48bf32===_0x0eea('0xb')||_0x5ab324==='booked'&&_0x48bf32==='roundrobin'){return _0x48bf32;}if(_0x5ab324===_0x0eea('0x12')||_0x5ab324===_0x0eea('0x13')||_0x5ab324==='power'){return _0x48bf32;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0eea('0x14')](0xb)},'timeout':{'type':Sequelize[_0x0eea('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x0eea('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0eea('0x2')]},'weight':{'type':Sequelize[_0x0eea('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0eea('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x0eea('0x15'),'no'),'defaultValue':_0x0eea('0x15')},'autopause':{'type':Sequelize[_0x0eea('0x4')](_0x0eea('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0eea('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x0eea('0x4')](_0x0eea('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0eea('0x4')](_0x0eea('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0eea('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x0eea('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0eea('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x0eea('0x4')](_0x0eea('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0eea('0x4')](_0x0eea('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x0eea('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0eea('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0eea('0x4')](_0x0eea('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x0eea('0x4')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x0eea('0x4')](_0x0eea('0x15'),'no',_0x0eea('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0eea('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x0eea('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x0eea('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0eea('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0eea('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0eea('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0eea('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x0eea('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0eea('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x0eea('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0eea('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0eea('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0eea('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0eea('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0eea('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0eea('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0eea('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0eea('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x0eea('0x17')],'set':function(_0x3b694f){this[_0x0eea('0xe')](_0x0eea('0x18'),_0x3b694f?_0x3b694f[_0x0eea('0x19')](','):[]);},'get':function(){return this[_0x0eea('0x10')](_0x0eea('0x18'))?this[_0x0eea('0x10')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0x0eea('0x2')],'defaultValue':_0x0eea('0x15'),'set':function(_0x3e3c12){this[_0x0eea('0xe')](_0x0eea('0x1a'),_0x3e3c12?_0x3e3c12['join'](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this[_0x0eea('0x10')]('joinempty')[_0x0eea('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x5c7d32){this[_0x0eea('0xe')](_0x0eea('0x1c'),_0x5c7d32?_0x5c7d32[_0x0eea('0x19')](','):undefined);},'get':function(){return this[_0x0eea('0x10')]('leavewhenempty')?this[_0x0eea('0x10')](_0x0eea('0x1c'))[_0x0eea('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0eea('0x4')](_0x0eea('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0eea('0x4')](_0x0eea('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x0eea('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0eea('0x4')](_0x0eea('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0xc7d3ed){this[_0x0eea('0xe')](_0x0eea('0x1d'),_0xc7d3ed);if(_0xc7d3ed){if(this[_0x0eea('0x10')](_0x0eea('0x1e'))<0x2){this['setDataValue'](_0x0eea('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0eea('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM'](_0x0eea('0x20'),_0x0eea('0x12'),_0x0eea('0x21'),_0x0eea('0x13'),_0x0eea('0x22')),'defaultValue':_0x0eea('0x12'),'comment':_0x0eea('0x23')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x0eea('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0eea('0x25')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0eea('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0eea('0x26')},'dialPowerLevel':{'type':Sequelize[_0x0eea('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0eea('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x0eea('0x4')]('agentBusyFactor',_0x0eea('0x29')),'defaultValue':'dropRate','comment':_0x0eea('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x0eea('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0eea('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x0eea('0x14')](0x3)[_0x0eea('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0eea('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0eea('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0eea('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x0eea('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x0eea('0x2')],'defaultValue':_0x0eea('0x2d'),'comment':_0x0eea('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x0eea('0x14')](0x3)[_0x0eea('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0eea('0x2f')},'dialQueueProject':{'type':Sequelize[_0x0eea('0x2')],'comment':_0x0eea('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0eea('0x14')](0x3)[_0x0eea('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0eea('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0eea('0x14')](0x5)[_0x0eea('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x0eea('0x14')](0x3)[_0x0eea('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0eea('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0eea('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0eea('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0eea('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x0eea('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0eea('0x14')](0x5)[_0x0eea('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0eea('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0eea('0x14')](0x3)[_0x0eea('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0eea('0x36')},'dialTimezone':{'type':Sequelize[_0x0eea('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x0eea('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x0eea('0x4')](_0x0eea('0x37'),_0x0eea('0x38'),_0x0eea('0x39')),'defaultValue':_0x0eea('0x37')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0eea('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x0eea('0x14')](0x9)[_0x0eea('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0eea('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x0eea('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0eea('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0eea('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0eea('0x14')](0x9)[_0x0eea('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0eea('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x0eea('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0eea('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0eea('0x14')](0x9)[_0x0eea('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0eea('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0eea('0x14')](0x9)[_0x0eea('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x0eea('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0eea('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0eea('0x14')](0x9)[_0x0eea('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x0eea('0x14')](0x5)[_0x0eea('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x0eea('0x1f')],'defaultValue':0x0,'comment':_0x0eea('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0eea('0x4')](_0x0eea('0x43'),'ASC'),'defaultValue':_0x0eea('0x43')},'dialQueueProject2':{'type':Sequelize[_0x0eea('0x2')],'comment':_0x0eea('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0eea('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0eea('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0eea('0x14')](0x3)[_0x0eea('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x0eea('0x14')](0x3)[_0x0eea('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0eea('0x14')](0x3)[_0x0eea('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0eea('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0eea('0x14')](0x5)[_0x0eea('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0eea('0x45')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0eea('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0eea('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0x0eea('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0eea('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0eea('0x14')](0x3)[_0x0eea('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0eea('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0eea('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0eea('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0x0eea('0x14')](0x3)[_0x0eea('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0eea('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0eea('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0eea('0x14')](0x3)[_0x0eea('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0eea('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0eea('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0eea('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0eea('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x0eea('0x1f')],'defaultValue':![],'comment':_0x0eea('0x4e'),'set':function(_0x2f86){if(!_0x2f86)this[_0x0eea('0xe')](_0x0eea('0x4f'),null);this[_0x0eea('0xe')](_0x0eea('0x50'),_0x2f86);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0eea('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0eea('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 0b6a81a..a95c75f 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 _0xbd95=['VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','all','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','select','ListId','NOW()','updatedAt','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','find','type','name','UserProfileResource','destroy','error','stack','send','index','map','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','VoiceQueue','includeAll','include','findAll','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','omit','createdAt','userProfileId','autoAssociation','params','findOne','CmHopper','order','rows','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','User','Agents','online','voicePause','interface','forEach','penalty','sequelize','transaction','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','Team','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId'];(function(_0x111d14,_0x314768){var _0x1f451d=function(_0x3db9e5){while(--_0x3db9e5){_0x111d14['push'](_0x111d14['shift']());}};_0x1f451d(++_0x314768);}(_0xbd95,0xed));var _0x5bd9=function(_0x2657d1,_0x17a63a){_0x2657d1=_0x2657d1-0x0;var _0x4d1734=_0xbd95[_0x2657d1];return _0x4d1734;};'use strict';var emlformat=require(_0x5bd9('0x0'));var rimraf=require(_0x5bd9('0x1'));var zipdir=require(_0x5bd9('0x2'));var jsonpatch=require(_0x5bd9('0x3'));var rp=require(_0x5bd9('0x4'));var moment=require(_0x5bd9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5bd9('0x6'));var util=require(_0x5bd9('0x7'));var path=require('path');var sox=require(_0x5bd9('0x8'));var csv=require('to-csv');var ejs=require(_0x5bd9('0x9'));var fs=require('fs');var fs_extra=require(_0x5bd9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5bd9('0xb'));var jsforce=require(_0x5bd9('0xc'));var deskjs=require(_0x5bd9('0xd'));var toCsv=require(_0x5bd9('0xe'));var querystring=require(_0x5bd9('0xf'));var Papa=require(_0x5bd9('0x10'));var Redis=require('ioredis');var authService=require(_0x5bd9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bd9('0x12'));var logger=require(_0x5bd9('0x13'))('api');var utils=require(_0x5bd9('0x14'));var config=require(_0x5bd9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bd9('0x16'))['db'];config[_0x5bd9('0x17')]=_[_0x5bd9('0x18')](config[_0x5bd9('0x17')],{'host':_0x5bd9('0x19'),'port':0x18eb});var socket=require(_0x5bd9('0x1a'))(new Redis(config['redis']));require(_0x5bd9('0x1b'))[_0x5bd9('0x1c')](socket);function respondWithStatusCode(_0x35b21a,_0x555920){_0x555920=_0x555920||0xcc;return function(_0x482809){if(_0x482809){return _0x35b21a[_0x5bd9('0x1d')](_0x555920);}return _0x35b21a[_0x5bd9('0x1e')](_0x555920)[_0x5bd9('0x1f')]();};}function respondWithResult(_0x4c902d,_0x4f1de4){_0x4f1de4=_0x4f1de4||0xc8;return function(_0x3f3000){if(_0x3f3000){return _0x4c902d[_0x5bd9('0x1e')](_0x4f1de4)[_0x5bd9('0x20')](_0x3f3000);}};}function respondWithFilteredResult(_0x44a556,_0x4d7013){return function(_0x21d281){if(_0x21d281){var _0x49cfc1=typeof _0x4d7013[_0x5bd9('0x21')]===_0x5bd9('0x22')&&typeof _0x4d7013[_0x5bd9('0x23')]===_0x5bd9('0x22');var _0x3ad6bb=_0x21d281[_0x5bd9('0x24')];var _0x37ba8e=_0x49cfc1?0x0:_0x4d7013[_0x5bd9('0x21')];var _0x575f4d=_0x49cfc1?_0x21d281[_0x5bd9('0x24')]:_0x4d7013[_0x5bd9('0x21')]+_0x4d7013[_0x5bd9('0x23')];var _0x4a5d48;if(_0x575f4d>=_0x3ad6bb){_0x575f4d=_0x3ad6bb;_0x4a5d48=0xc8;}else{_0x4a5d48=0xce;}_0x44a556[_0x5bd9('0x1e')](_0x4a5d48);return _0x44a556[_0x5bd9('0x25')](_0x5bd9('0x26'),_0x37ba8e+'-'+_0x575f4d+'/'+_0x3ad6bb)['json'](_0x21d281);}return null;};}function patchUpdates(_0x34632e){return function(_0x137f6b){try{jsonpatch[_0x5bd9('0x27')](_0x137f6b,_0x34632e,!![]);}catch(_0x1af101){return BPromise[_0x5bd9('0x28')](_0x1af101);}return _0x137f6b[_0x5bd9('0x29')]();};}function saveUpdates(_0x14f05f,_0x5ab785){return function(_0x4035eb){if(_0x4035eb){return _0x4035eb[_0x5bd9('0x2a')](_0x14f05f)[_0x5bd9('0x2b')](function(_0x35d87c){return _0x35d87c;});}return null;};}function removeEntity(_0xdbb39e,_0x1bb785){return function(_0x5def3f){if(_0x5def3f){return _0x5def3f['destroy']()[_0x5bd9('0x2b')](function(){var _0x202094=_0x5def3f[_0x5bd9('0x2c')]({'plain':!![]});var _0x35b124=[{'name':_0x5bd9('0x2d'),'value':_0x5bd9('0x2e'),'ignore':![]},{'name':_0x5bd9('0x2f'),'value':_0x5bd9('0x30'),'ignore':![]}];var _0x46d21d=_(_0x35b124)[_0x5bd9('0x31')](_0x5bd9('0x32'))['map'](_0x5bd9('0x33'))[_0x5bd9('0x33')]();if(_[_0x5bd9('0x34')](_0x46d21d,_0x202094['type'])){return;}var _0x2282bd=_[_0x5bd9('0x35')](_0x35b124,[_0x5bd9('0x33'),_0x202094[_0x5bd9('0x36')]])[_0x5bd9('0x37')];return db[_0x5bd9('0x38')][_0x5bd9('0x39')]({'where':{'type':_0x2282bd,'resourceId':_0x202094['id']}})[_0x5bd9('0x2b')](function(){return _0x5def3f;});})[_0x5bd9('0x2b')](function(){_0xdbb39e[_0x5bd9('0x1e')](0xcc)[_0x5bd9('0x1f')]();});}};}function handleEntityNotFound(_0x38b34a,_0x4dfceb){return function(_0x18121f){if(!_0x18121f){_0x38b34a[_0x5bd9('0x1d')](0x194);}return _0x18121f;};}function handleError(_0x2d6dd3,_0x443d96){_0x443d96=_0x443d96||0x1f4;return function(_0x2de7ff){logger[_0x5bd9('0x3a')](_0x2de7ff[_0x5bd9('0x3b')]);if(_0x2de7ff[_0x5bd9('0x37')]){delete _0x2de7ff[_0x5bd9('0x37')];}_0x2d6dd3[_0x5bd9('0x1e')](_0x443d96)[_0x5bd9('0x3c')](_0x2de7ff);};}exports[_0x5bd9('0x3d')]=function(_0x705459,_0x4a7ff7){var _0x5a0990={},_0x56c4d5={},_0x795e67={'count':0x0,'rows':[]};var _0x4f48c4=_[_0x5bd9('0x3e')](db['VoiceQueue'][_0x5bd9('0x3f')],function(_0x15ac9a){return{'name':_0x15ac9a[_0x5bd9('0x40')],'type':_0x15ac9a['type'][_0x5bd9('0x41')]};});_0x56c4d5[_0x5bd9('0x42')]=_[_0x5bd9('0x3e')](_0x4f48c4,_0x5bd9('0x37'));_0x56c4d5[_0x5bd9('0x43')]=_[_0x5bd9('0x44')](_0x705459[_0x5bd9('0x43')]);_0x56c4d5['filters']=_['intersection'](_0x56c4d5['model'],_0x56c4d5[_0x5bd9('0x43')]);_0x5a0990[_0x5bd9('0x45')]=_[_0x5bd9('0x46')](_0x56c4d5[_0x5bd9('0x42')],qs[_0x5bd9('0x47')](_0x705459[_0x5bd9('0x43')]['fields']));_0x5a0990['attributes']=_0x5a0990['attributes']['length']?_0x5a0990['attributes']:_0x56c4d5[_0x5bd9('0x42')];if(!_0x705459['query'][_0x5bd9('0x48')](_0x5bd9('0x49'))){_0x5a0990[_0x5bd9('0x23')]=qs[_0x5bd9('0x23')](_0x705459[_0x5bd9('0x43')][_0x5bd9('0x23')]);_0x5a0990[_0x5bd9('0x21')]=qs[_0x5bd9('0x21')](_0x705459['query'][_0x5bd9('0x21')]);}_0x5a0990['order']=qs[_0x5bd9('0x4a')](_0x705459[_0x5bd9('0x43')][_0x5bd9('0x4a')]);_0x5a0990[_0x5bd9('0x4b')]=qs[_0x5bd9('0x4c')](_[_0x5bd9('0x4d')](_0x705459['query'],_0x56c4d5[_0x5bd9('0x4c')]),_0x4f48c4);if(_0x705459[_0x5bd9('0x43')][_0x5bd9('0x31')]){_0x5a0990['where']=_[_0x5bd9('0x4e')](_0x5a0990[_0x5bd9('0x4b')],{'$or':_[_0x5bd9('0x3e')](_0x4f48c4,function(_0x31ce46){if(_0x31ce46[_0x5bd9('0x36')]!==_0x5bd9('0x4f')){var _0x366a50={};_0x366a50[_0x31ce46[_0x5bd9('0x37')]]={'$like':'%'+_0x705459[_0x5bd9('0x43')][_0x5bd9('0x31')]+'%'};return _0x366a50;}})});}_0x5a0990=_[_0x5bd9('0x4e')]({},_0x5a0990,_0x705459['options']);var _0xd95d01={'where':_0x5a0990[_0x5bd9('0x4b')]};return db[_0x5bd9('0x50')][_0x5bd9('0x24')](_0xd95d01)[_0x5bd9('0x2b')](function(_0x243b72){_0x795e67[_0x5bd9('0x24')]=_0x243b72;if(_0x705459[_0x5bd9('0x43')][_0x5bd9('0x51')]){_0x5a0990[_0x5bd9('0x52')]=[{'all':!![]}];}return db[_0x5bd9('0x50')][_0x5bd9('0x53')](_0x5a0990);})[_0x5bd9('0x2b')](function(_0x78be38){_0x795e67['rows']=_0x78be38;return _0x795e67;})[_0x5bd9('0x2b')](respondWithFilteredResult(_0x4a7ff7,_0x5a0990))[_0x5bd9('0x54')](handleError(_0x4a7ff7,null));};exports[_0x5bd9('0x55')]=function(_0x4fdad0,_0x98cb87){var _0x3a5da7={'raw':![],'where':{'id':_0x4fdad0['params']['id']}},_0x47faac={};_0x47faac[_0x5bd9('0x42')]=_['keys'](db[_0x5bd9('0x50')]['rawAttributes']);_0x47faac[_0x5bd9('0x43')]=_[_0x5bd9('0x44')](_0x4fdad0['query']);_0x47faac['filters']=_['intersection'](_0x47faac[_0x5bd9('0x42')],_0x47faac[_0x5bd9('0x43')]);_0x3a5da7['attributes']=_[_0x5bd9('0x46')](_0x47faac['model'],qs[_0x5bd9('0x47')](_0x4fdad0[_0x5bd9('0x43')]['fields']));_0x3a5da7['attributes']=_0x3a5da7[_0x5bd9('0x45')][_0x5bd9('0x56')]?_0x3a5da7[_0x5bd9('0x45')]:_0x47faac[_0x5bd9('0x42')];if(_0x4fdad0[_0x5bd9('0x43')]['includeAll']){_0x3a5da7[_0x5bd9('0x52')]=[{'all':!![]}];}_0x3a5da7=_[_0x5bd9('0x4e')]({},_0x3a5da7,_0x4fdad0['options']);return db[_0x5bd9('0x50')]['find'](_0x3a5da7)[_0x5bd9('0x2b')](handleEntityNotFound(_0x98cb87,null))[_0x5bd9('0x2b')](respondWithResult(_0x98cb87,null))['catch'](handleError(_0x98cb87,null));};exports[_0x5bd9('0x57')]=function(_0x1304a3,_0x4b171b){return db[_0x5bd9('0x50')][_0x5bd9('0x57')](_0x1304a3[_0x5bd9('0x58')],{})[_0x5bd9('0x2b')](function(_0x112e01){var _0x4f2444=_0x1304a3[_0x5bd9('0x59')]['get']({'plain':!![]});if(!_0x4f2444)throw new Error(_0x5bd9('0x5a'));if(_0x4f2444[_0x5bd9('0x5b')]==='user'){var _0x342afa=_0x112e01[_0x5bd9('0x2c')]({'plain':!![]});var _0x315e6e=[{'name':_0x5bd9('0x2d'),'value':_0x5bd9('0x2e')},{'name':_0x5bd9('0x2f'),'value':_0x5bd9('0x30')}];var _0x111ebe=_[_0x5bd9('0x35')](_0x315e6e,[_0x5bd9('0x33'),_0x342afa[_0x5bd9('0x36')]])['name'];return db[_0x5bd9('0x5c')][_0x5bd9('0x35')]({'where':{'name':_0x111ebe,'userProfileId':_0x4f2444['userProfileId']},'raw':!![]})['then'](function(_0x4e2ae5){if(_0x4e2ae5&&_0x4e2ae5['autoAssociation']===0x0){return db[_0x5bd9('0x38')][_0x5bd9('0x57')]({'name':_0x342afa[_0x5bd9('0x37')],'resourceId':_0x342afa['id'],'type':_0x4e2ae5[_0x5bd9('0x37')],'sectionId':_0x4e2ae5['id']},{})['then'](function(){return _0x112e01;});}else{return _0x112e01;}})[_0x5bd9('0x54')](function(_0x287165){logger[_0x5bd9('0x3a')](_0x5bd9('0x5d'),_0x287165);throw _0x287165;});}return _0x112e01;})[_0x5bd9('0x2b')](respondWithResult(_0x4b171b,0xc9))['catch'](handleError(_0x4b171b,null));};exports[_0x5bd9('0x5e')]=function(_0x509bed,_0x2189e2){var _0x88394d={'where':{'id':_0x509bed['params']['id']}},_0x245acf={};_0x245acf[_0x5bd9('0x42')]=_[_0x5bd9('0x44')](db['VoiceQueue'][_0x5bd9('0x3f')]);_0x88394d[_0x5bd9('0x45')]=_[_0x5bd9('0x46')](_0x245acf[_0x5bd9('0x42')],qs['fields'](_0x509bed[_0x5bd9('0x43')][_0x5bd9('0x47')]));_0x88394d[_0x5bd9('0x45')]=_0x88394d['attributes'][_0x5bd9('0x56')]?_0x88394d[_0x5bd9('0x45')]:_0x245acf['model'];if(_0x509bed['query'][_0x5bd9('0x51')]){_0x88394d[_0x5bd9('0x52')]=[{'all':!![]}];}_0x88394d=_[_0x5bd9('0x4e')]({},_0x88394d,_0x509bed[_0x5bd9('0x5f')]);return db['VoiceQueue'][_0x5bd9('0x35')](_0x88394d)[_0x5bd9('0x2b')](handleEntityNotFound(_0x2189e2,null))[_0x5bd9('0x2b')](function(_0x39d060){if(_0x39d060){var _0xb8070e=_0x39d060[_0x5bd9('0x2c')]({'plain':!![]});_0xb8070e=qs[_0x5bd9('0x60')](_0xb8070e,['id',_0x5bd9('0x61'),'updatedAt']);_0x509bed['body']=_[_0x5bd9('0x60')](_0x509bed[_0x5bd9('0x58')],['id',_0x5bd9('0x61'),'updatedAt']);return db['VoiceQueue'][_0x5bd9('0x57')](_[_0x5bd9('0x4e')](_0xb8070e,_0x509bed[_0x5bd9('0x58')]),{'include':_0x509bed[_0x5bd9('0x43')][_0x5bd9('0x51')]?[{'all':!![]}]:undefined})[_0x5bd9('0x2b')](function(_0x5bc90a){var _0x458ac4=_0x509bed[_0x5bd9('0x59')][_0x5bd9('0x2c')]({'plain':!![]});if(!_0x458ac4)throw new Error(_0x5bd9('0x5a'));if(_0x458ac4[_0x5bd9('0x5b')]===_0x5bd9('0x59')){var _0x1472df=_0x5bc90a['get']({'plain':!![]});var _0x52354a=[{'name':_0x5bd9('0x2d'),'value':_0x5bd9('0x2e')},{'name':_0x5bd9('0x2f'),'value':'outbound'}];var _0x2ad2b1=_[_0x5bd9('0x35')](_0x52354a,[_0x5bd9('0x33'),_0x1472df[_0x5bd9('0x36')]])['name'];return db[_0x5bd9('0x5c')][_0x5bd9('0x35')]({'where':{'name':_0x2ad2b1,'userProfileId':_0x458ac4[_0x5bd9('0x62')]},'raw':!![]})[_0x5bd9('0x2b')](function(_0x4a3744){if(_0x4a3744&&_0x4a3744[_0x5bd9('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x1472df[_0x5bd9('0x37')],'resourceId':_0x1472df['id'],'type':_0x4a3744[_0x5bd9('0x37')],'sectionId':_0x4a3744['id']},{})[_0x5bd9('0x2b')](function(){return _0x5bc90a;});}else{return _0x5bc90a;}})[_0x5bd9('0x54')](function(_0x5387d3){logger[_0x5bd9('0x3a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5387d3);throw _0x5387d3;});}return _0x5bc90a;});}})['then'](respondWithResult(_0x2189e2,0xc9))[_0x5bd9('0x54')](handleError(_0x2189e2,null));};exports[_0x5bd9('0x2a')]=function(_0x4b88b1,_0x574fb1){if(_0x4b88b1[_0x5bd9('0x58')]['id']){delete _0x4b88b1[_0x5bd9('0x58')]['id'];}return db[_0x5bd9('0x50')][_0x5bd9('0x35')]({'where':{'id':_0x4b88b1['params']['id']}})[_0x5bd9('0x2b')](handleEntityNotFound(_0x574fb1,null))[_0x5bd9('0x2b')](saveUpdates(_0x4b88b1['body'],null))[_0x5bd9('0x2b')](respondWithResult(_0x574fb1,null))['catch'](handleError(_0x574fb1,null));};exports[_0x5bd9('0x39')]=function(_0x14fdbd,_0x207150){return db[_0x5bd9('0x50')][_0x5bd9('0x35')]({'where':{'id':_0x14fdbd[_0x5bd9('0x64')]['id']}})[_0x5bd9('0x2b')](handleEntityNotFound(_0x207150,null))[_0x5bd9('0x2b')](removeEntity(_0x207150,null))[_0x5bd9('0x54')](handleError(_0x207150,null));};exports['getHoppers']=function(_0x4223b2,_0x36dae5,_0x4cecda){var _0x29474e={'raw':![],'where':{}};var _0x2b9fdb={};var _0x3e1562={'count':0x0,'rows':[]};return db[_0x5bd9('0x50')][_0x5bd9('0x65')]({'where':{'id':_0x4223b2[_0x5bd9('0x64')]['id']}})[_0x5bd9('0x2b')](handleEntityNotFound(_0x36dae5,null))['then'](function(_0x277b8a){if(_0x277b8a){_0x2b9fdb[_0x5bd9('0x42')]=_['keys'](db[_0x5bd9('0x66')][_0x5bd9('0x3f')]);_0x2b9fdb['query']=_[_0x5bd9('0x44')](_0x4223b2[_0x5bd9('0x43')]);_0x2b9fdb[_0x5bd9('0x4c')]=_[_0x5bd9('0x46')](_0x2b9fdb[_0x5bd9('0x42')],_0x2b9fdb[_0x5bd9('0x43')]);_0x29474e['attributes']=_['intersection'](_0x2b9fdb['model'],qs[_0x5bd9('0x47')](_0x4223b2['query'][_0x5bd9('0x47')]));_0x29474e[_0x5bd9('0x45')]=_0x29474e[_0x5bd9('0x45')][_0x5bd9('0x56')]?_0x29474e[_0x5bd9('0x45')]:_0x2b9fdb[_0x5bd9('0x42')];if(!_0x4223b2[_0x5bd9('0x43')][_0x5bd9('0x48')](_0x5bd9('0x49'))){_0x29474e[_0x5bd9('0x23')]=qs['limit'](_0x4223b2[_0x5bd9('0x43')][_0x5bd9('0x23')]);_0x29474e[_0x5bd9('0x21')]=qs[_0x5bd9('0x21')](_0x4223b2['query'][_0x5bd9('0x21')]);}_0x29474e[_0x5bd9('0x67')]=qs[_0x5bd9('0x4a')](_0x4223b2['query'][_0x5bd9('0x4a')]);_0x29474e[_0x5bd9('0x4b')]=qs[_0x5bd9('0x4c')](_[_0x5bd9('0x4d')](_0x4223b2['query'],_0x2b9fdb[_0x5bd9('0x4c')]));_0x29474e[_0x5bd9('0x4b')]['VoiceQueueId']=_0x277b8a['id'];if(_0x4223b2[_0x5bd9('0x43')]['filter']){_0x29474e[_0x5bd9('0x4b')]=_['merge'](_0x29474e[_0x5bd9('0x4b')],{'$or':_[_0x5bd9('0x3e')](_0x29474e['attributes'],function(_0x32cdd1){var _0xe22fb1={};_0xe22fb1[_0x32cdd1]={'$like':'%'+_0x4223b2[_0x5bd9('0x43')][_0x5bd9('0x31')]+'%'};return _0xe22fb1;})});}_0x29474e=_[_0x5bd9('0x4e')]({},_0x29474e,_0x4223b2[_0x5bd9('0x5f')]);return db['CmHopper'][_0x5bd9('0x24')]({'where':_0x29474e['where']})[_0x5bd9('0x2b')](function(_0x1654a2){_0x3e1562[_0x5bd9('0x24')]=_0x1654a2;if(_0x4223b2[_0x5bd9('0x43')][_0x5bd9('0x51')]){_0x29474e['include']=[{'all':!![]}];}return db[_0x5bd9('0x66')][_0x5bd9('0x53')](_0x29474e);})[_0x5bd9('0x2b')](function(_0x459fb3){_0x3e1562[_0x5bd9('0x68')]=_0x459fb3;return _0x3e1562;});}})[_0x5bd9('0x2b')](respondWithFilteredResult(_0x36dae5,_0x29474e))['catch'](handleError(_0x36dae5,null));};exports['getHopperHistories']=function(_0x330ee7,_0x505cb7,_0x29f4a4){var _0x23780d={'raw':!![],'where':{}};var _0x3dff9d={};var _0x7f774f={'count':0x0,'rows':[]};return db[_0x5bd9('0x50')][_0x5bd9('0x65')]({'where':{'id':_0x330ee7[_0x5bd9('0x64')]['id']}})[_0x5bd9('0x2b')](handleEntityNotFound(_0x505cb7,null))['then'](function(_0x33e719){if(_0x33e719){_0x3dff9d[_0x5bd9('0x42')]=_['keys'](db[_0x5bd9('0x69')]['rawAttributes']);_0x3dff9d[_0x5bd9('0x43')]=_['keys'](_0x330ee7[_0x5bd9('0x43')]);_0x3dff9d[_0x5bd9('0x4c')]=_[_0x5bd9('0x46')](_0x3dff9d[_0x5bd9('0x42')],_0x3dff9d[_0x5bd9('0x43')]);_0x23780d[_0x5bd9('0x45')]=_[_0x5bd9('0x46')](_0x3dff9d[_0x5bd9('0x42')],qs[_0x5bd9('0x47')](_0x330ee7['query'][_0x5bd9('0x47')]));_0x23780d[_0x5bd9('0x45')]=_0x23780d[_0x5bd9('0x45')]['length']?_0x23780d[_0x5bd9('0x45')]:_0x3dff9d['model'];if(!_0x330ee7[_0x5bd9('0x43')]['hasOwnProperty'](_0x5bd9('0x49'))){_0x23780d[_0x5bd9('0x23')]=qs['limit'](_0x330ee7[_0x5bd9('0x43')][_0x5bd9('0x23')]);_0x23780d[_0x5bd9('0x21')]=qs['offset'](_0x330ee7['query'][_0x5bd9('0x21')]);}_0x23780d[_0x5bd9('0x67')]=qs[_0x5bd9('0x4a')](_0x330ee7[_0x5bd9('0x43')]['sort']);_0x23780d[_0x5bd9('0x4b')]=qs['filters'](_[_0x5bd9('0x4d')](_0x330ee7[_0x5bd9('0x43')],_0x3dff9d[_0x5bd9('0x4c')]));_0x23780d[_0x5bd9('0x4b')][_0x5bd9('0x6a')]=_0x33e719['id'];if(_0x330ee7['query'][_0x5bd9('0x31')]){_0x23780d['where']=_['merge'](_0x23780d['where'],{'$or':_[_0x5bd9('0x3e')](_0x23780d[_0x5bd9('0x45')],function(_0x28e773){var _0x555310={};_0x555310[_0x28e773]={'$like':'%'+_0x330ee7[_0x5bd9('0x43')][_0x5bd9('0x31')]+'%'};return _0x555310;})});}_0x23780d=_['merge']({},_0x23780d,_0x330ee7['options']);return db['CmHopperHistory'][_0x5bd9('0x24')]({'where':_0x23780d['where']})['then'](function(_0x48eb12){_0x7f774f['count']=_0x48eb12;if(_0x330ee7[_0x5bd9('0x43')]['includeAll']){_0x23780d[_0x5bd9('0x52')]=[{'all':!![]}];}return db[_0x5bd9('0x69')][_0x5bd9('0x53')](_0x23780d);})[_0x5bd9('0x2b')](function(_0x65d815){_0x7f774f[_0x5bd9('0x68')]=_0x65d815;return _0x7f774f;});}})[_0x5bd9('0x2b')](respondWithFilteredResult(_0x505cb7,_0x23780d))[_0x5bd9('0x54')](handleError(_0x505cb7,null));};exports[_0x5bd9('0x6b')]=function(_0x156eb3,_0x1ede18,_0x588a5b){var _0x4b21ff={'raw':!![],'where':{}};var _0x2f36b6={};var _0x328769={'count':0x0,'rows':[]};return db[_0x5bd9('0x50')][_0x5bd9('0x65')]({'where':{'id':_0x156eb3[_0x5bd9('0x64')]['id']}})['then'](handleEntityNotFound(_0x1ede18,null))[_0x5bd9('0x2b')](function(_0x3e98e2){if(_0x3e98e2){_0x2f36b6[_0x5bd9('0x42')]=_[_0x5bd9('0x44')](db[_0x5bd9('0x6c')][_0x5bd9('0x3f')]);_0x2f36b6[_0x5bd9('0x43')]=_[_0x5bd9('0x44')](_0x156eb3['query']);_0x2f36b6['filters']=_['intersection'](_0x2f36b6['model'],_0x2f36b6[_0x5bd9('0x43')]);_0x4b21ff[_0x5bd9('0x45')]=_[_0x5bd9('0x46')](_0x2f36b6['model'],qs[_0x5bd9('0x47')](_0x156eb3[_0x5bd9('0x43')][_0x5bd9('0x47')]));_0x4b21ff['attributes']=_0x4b21ff['attributes'][_0x5bd9('0x56')]?_0x4b21ff[_0x5bd9('0x45')]:_0x2f36b6[_0x5bd9('0x42')];if(!_0x156eb3[_0x5bd9('0x43')][_0x5bd9('0x48')](_0x5bd9('0x49'))){_0x4b21ff[_0x5bd9('0x23')]=qs[_0x5bd9('0x23')](_0x156eb3[_0x5bd9('0x43')]['limit']);_0x4b21ff[_0x5bd9('0x21')]=qs[_0x5bd9('0x21')](_0x156eb3[_0x5bd9('0x43')][_0x5bd9('0x21')]);}_0x4b21ff[_0x5bd9('0x67')]=qs[_0x5bd9('0x4a')](_0x156eb3[_0x5bd9('0x43')][_0x5bd9('0x4a')]);_0x4b21ff[_0x5bd9('0x4b')]=qs[_0x5bd9('0x4c')](_[_0x5bd9('0x4d')](_0x156eb3['query'],_0x2f36b6[_0x5bd9('0x4c')]));_0x4b21ff[_0x5bd9('0x4b')][_0x5bd9('0x6a')]=_0x3e98e2['id'];if(_0x156eb3[_0x5bd9('0x43')][_0x5bd9('0x31')]){_0x4b21ff[_0x5bd9('0x4b')]=_[_0x5bd9('0x4e')](_0x4b21ff['where'],{'$or':_['map'](_0x4b21ff[_0x5bd9('0x45')],function(_0x2867fc){var _0x2b7a9e={};_0x2b7a9e[_0x2867fc]={'$like':'%'+_0x156eb3[_0x5bd9('0x43')][_0x5bd9('0x31')]+'%'};return _0x2b7a9e;})});}_0x4b21ff=_[_0x5bd9('0x4e')]({},_0x4b21ff,_0x156eb3[_0x5bd9('0x5f')]);return db[_0x5bd9('0x6c')]['count']({'where':_0x4b21ff[_0x5bd9('0x4b')]})[_0x5bd9('0x2b')](function(_0x8c1397){_0x328769[_0x5bd9('0x24')]=_0x8c1397;if(_0x156eb3[_0x5bd9('0x43')][_0x5bd9('0x51')]){_0x4b21ff[_0x5bd9('0x52')]=[{'all':!![]}];}return db[_0x5bd9('0x6c')][_0x5bd9('0x53')](_0x4b21ff);})[_0x5bd9('0x2b')](function(_0x304340){_0x328769[_0x5bd9('0x68')]=_0x304340;return _0x328769;});}})[_0x5bd9('0x2b')](respondWithFilteredResult(_0x1ede18,_0x4b21ff))[_0x5bd9('0x54')](handleError(_0x1ede18,null));};exports[_0x5bd9('0x6d')]=function(_0x1813f4,_0x1585f9,_0x35c81e){var _0x175d5c={'raw':!![],'where':{}};var _0x42d696={};var _0x53610a={'count':0x0,'rows':[]};return db[_0x5bd9('0x50')]['findOne']({'where':{'id':_0x1813f4['params']['id']}})[_0x5bd9('0x2b')](handleEntityNotFound(_0x1585f9,null))[_0x5bd9('0x2b')](function(_0x23547d){if(_0x23547d){_0x42d696[_0x5bd9('0x42')]=_[_0x5bd9('0x44')](db[_0x5bd9('0x6e')]['rawAttributes']);_0x42d696['query']=_[_0x5bd9('0x44')](_0x1813f4[_0x5bd9('0x43')]);_0x42d696[_0x5bd9('0x4c')]=_[_0x5bd9('0x46')](_0x42d696[_0x5bd9('0x42')],_0x42d696['query']);_0x175d5c[_0x5bd9('0x45')]=_['intersection'](_0x42d696[_0x5bd9('0x42')],qs[_0x5bd9('0x47')](_0x1813f4[_0x5bd9('0x43')][_0x5bd9('0x47')]));_0x175d5c['attributes']=_0x175d5c[_0x5bd9('0x45')]['length']?_0x175d5c[_0x5bd9('0x45')]:_0x42d696[_0x5bd9('0x42')];if(!_0x1813f4[_0x5bd9('0x43')][_0x5bd9('0x48')](_0x5bd9('0x49'))){_0x175d5c['limit']=qs[_0x5bd9('0x23')](_0x1813f4['query'][_0x5bd9('0x23')]);_0x175d5c['offset']=qs[_0x5bd9('0x21')](_0x1813f4[_0x5bd9('0x43')][_0x5bd9('0x21')]);}_0x175d5c[_0x5bd9('0x67')]=qs[_0x5bd9('0x4a')](_0x1813f4[_0x5bd9('0x43')]['sort']);_0x175d5c['where']=qs[_0x5bd9('0x4c')](_[_0x5bd9('0x4d')](_0x1813f4[_0x5bd9('0x43')],_0x42d696[_0x5bd9('0x4c')]));_0x175d5c[_0x5bd9('0x4b')][_0x5bd9('0x6a')]=_0x23547d['id'];if(_0x1813f4[_0x5bd9('0x43')]['filter']){_0x175d5c[_0x5bd9('0x4b')]=_['merge'](_0x175d5c[_0x5bd9('0x4b')],{'$or':_[_0x5bd9('0x3e')](_0x175d5c[_0x5bd9('0x45')],function(_0x37683d){var _0x304cfc={};_0x304cfc[_0x37683d]={'$like':'%'+_0x1813f4[_0x5bd9('0x43')]['filter']+'%'};return _0x304cfc;})});}_0x175d5c=_[_0x5bd9('0x4e')]({},_0x175d5c,_0x1813f4[_0x5bd9('0x5f')]);return db['CmHopperBlack']['count']({'where':_0x175d5c[_0x5bd9('0x4b')]})[_0x5bd9('0x2b')](function(_0x39bc37){_0x53610a[_0x5bd9('0x24')]=_0x39bc37;if(_0x1813f4[_0x5bd9('0x43')][_0x5bd9('0x51')]){_0x175d5c['include']=[{'all':!![]}];}return db[_0x5bd9('0x6e')][_0x5bd9('0x53')](_0x175d5c);})[_0x5bd9('0x2b')](function(_0x3e8a9c){_0x53610a['rows']=_0x3e8a9c;return _0x53610a;});}})[_0x5bd9('0x2b')](respondWithFilteredResult(_0x1585f9,_0x175d5c))[_0x5bd9('0x54')](handleError(_0x1585f9,null));};exports[_0x5bd9('0x6f')]=function(_0x29d221,_0xa1605b,_0x4f756d){var _0x5b2059={};var _0x2c62f7={};var _0x1b717c;var _0x6bab74;return db[_0x5bd9('0x50')][_0x5bd9('0x65')]({'where':{'id':_0x29d221[_0x5bd9('0x64')]['id']}})['then'](handleEntityNotFound(_0xa1605b,null))[_0x5bd9('0x2b')](function(_0x47afd8){if(_0x47afd8){_0x1b717c=_0x47afd8;_0x2c62f7[_0x5bd9('0x42')]=_[_0x5bd9('0x44')](db['Team'][_0x5bd9('0x3f')]);_0x2c62f7['query']=_['keys'](_0x29d221['query']);_0x2c62f7[_0x5bd9('0x4c')]=_[_0x5bd9('0x46')](_0x2c62f7[_0x5bd9('0x42')],_0x2c62f7[_0x5bd9('0x43')]);_0x5b2059[_0x5bd9('0x45')]=_[_0x5bd9('0x46')](_0x2c62f7[_0x5bd9('0x42')],qs[_0x5bd9('0x47')](_0x29d221['query']['fields']));_0x5b2059[_0x5bd9('0x45')]=_0x5b2059[_0x5bd9('0x45')][_0x5bd9('0x56')]?_0x5b2059[_0x5bd9('0x45')]:_0x2c62f7['model'];_0x5b2059[_0x5bd9('0x67')]=qs[_0x5bd9('0x4a')](_0x29d221['query'][_0x5bd9('0x4a')]);_0x5b2059['where']=qs['filters'](_[_0x5bd9('0x4d')](_0x29d221[_0x5bd9('0x43')],_0x2c62f7[_0x5bd9('0x4c')]));if(_0x29d221[_0x5bd9('0x43')][_0x5bd9('0x31')]){_0x5b2059['where']=_[_0x5bd9('0x4e')](_0x5b2059[_0x5bd9('0x4b')],{'$or':_[_0x5bd9('0x3e')](_0x5b2059['attributes'],function(_0x54865c){var _0x197b81={};_0x197b81[_0x54865c]={'$like':'%'+_0x29d221['query']['filter']+'%'};return _0x197b81;})});}_0x5b2059=_[_0x5bd9('0x4e')]({},_0x5b2059,_0x29d221[_0x5bd9('0x5f')]);return _0x1b717c['getTeams'](_0x5b2059);}})['then'](function(_0x54f1bb){if(_0x54f1bb){_0x6bab74=_0x54f1bb['length'];if(!_0x29d221['query'][_0x5bd9('0x48')](_0x5bd9('0x49'))){_0x5b2059[_0x5bd9('0x23')]=qs[_0x5bd9('0x23')](_0x29d221[_0x5bd9('0x43')]['limit']);_0x5b2059[_0x5bd9('0x21')]=qs[_0x5bd9('0x21')](_0x29d221[_0x5bd9('0x43')]['offset']);}return _0x1b717c['getTeams'](_0x5b2059);}})[_0x5bd9('0x2b')](function(_0x52fca7){if(_0x52fca7){return _0x52fca7?{'count':_0x6bab74,'rows':_0x52fca7}:null;}})[_0x5bd9('0x2b')](respondWithResult(_0xa1605b,null))[_0x5bd9('0x54')](handleError(_0xa1605b,null));};exports[_0x5bd9('0x70')]=function(_0x2e28b5,_0x293c06,_0x42f776){var _0x4de62b=_0x2e28b5[_0x5bd9('0x58')][_0x5bd9('0x71')];var _0x22f414=_['map'](_0x4de62b,'id');return db['Team']['findAll']({'where':{'id':_0x22f414},'attributes':['id'],'include':[{'model':db[_0x5bd9('0x72')],'as':_0x5bd9('0x73'),'attributes':['id',_0x5bd9('0x37'),_0x5bd9('0x74'),_0x5bd9('0x75'),_0x5bd9('0x76')],'raw':!![]}]})[_0x5bd9('0x2b')](function(_0x2e9348){if(_0x2e9348){var _0x5e36bd=_['flatMap'](_0x2e9348,function(_0x1f244a){var _0x450f6d=_0x1f244a[_0x5bd9('0x2c')]({'plain':!![]});_0x450f6d[_0x5bd9('0x73')][_0x5bd9('0x77')](function(_0x238b9b){_0x238b9b[_0x5bd9('0x78')]=_[_0x5bd9('0x35')](_0x4de62b,{'id':_0x450f6d['id']})[_0x5bd9('0x78')];});return _0x450f6d[_0x5bd9('0x73')];});return db[_0x5bd9('0x50')][_0x5bd9('0x35')]({'where':{'id':_0x2e28b5[_0x5bd9('0x64')]['id']}})[_0x5bd9('0x2b')](function(_0x577a55){return db[_0x5bd9('0x79')][_0x5bd9('0x7a')](function(_0xf5ecdf){return _0x577a55[_0x5bd9('0x70')](_0x22f414,{'transaction':_0xf5ecdf})[_0x5bd9('0x2b')](function(){return BPromise[_0x5bd9('0x7b')](_0x4de62b,function(_0x3d38d2){return db['TeamVoiceQueue'][_0x5bd9('0x7c')]({'TeamId':_0x3d38d2['id'],'VoiceQueueId':_0x2e28b5[_0x5bd9('0x64')]['id'],'penalty':_0x3d38d2[_0x5bd9('0x78')]},{'transaction':_0xf5ecdf});});})['then'](function(){return BPromise[_0x5bd9('0x7b')](_0x5e36bd,function(_0x1bfea7){return db[_0x5bd9('0x7d')][_0x5bd9('0x7e')]({'where':{'UserId':_0x1bfea7['id'],'VoiceQueueId':_0x2e28b5[_0x5bd9('0x64')]['id']},'defaults':{'penalty':_0x1bfea7[_0x5bd9('0x78')]},'transaction':_0xf5ecdf});});})['then'](function(){return BPromise[_0x5bd9('0x7b')](_['filter'](_0x5e36bd,{'online':!![]}),function(_0x505cdf){return db[_0x5bd9('0x7f')][_0x5bd9('0x7c')]({'membername':_0x505cdf['name'],'UserId':_0x505cdf['id'],'queue_name':_0x577a55[_0x5bd9('0x37')],'VoiceQueueId':_0x577a55['id'],'interface':_[_0x5bd9('0x80')](_0x505cdf[_0x5bd9('0x76')])?util[_0x5bd9('0x81')](_0x5bd9('0x82'),_0x505cdf['name']):_0x505cdf['interface'],'paused':_0x505cdf['voicePause']||![],'penalty':_0x505cdf['penalty']},{'transaction':_0xf5ecdf});});})[_0x5bd9('0x2b')](function(){_0x5e36bd[_0x5bd9('0x77')](function(_0x4d9a1){socket[_0x5bd9('0x83')](_0x5bd9('0x84'),{'UserId':_0x4d9a1['id'],'VoiceQueueId':_0x577a55['id']});});});});});}})['then'](respondWithStatusCode(_0x293c06,null))['catch'](handleError(_0x293c06,null));};exports[_0x5bd9('0x85')]=function(_0x35580e,_0x10c5e4,_0x2c1cd0){return db[_0x5bd9('0x86')][_0x5bd9('0x53')]({'where':{'id':_0x35580e['query'][_0x5bd9('0x87')]},'attributes':['id'],'include':[{'model':db[_0x5bd9('0x72')],'as':_0x5bd9('0x73'),'attributes':['id'],'raw':!![]}]})[_0x5bd9('0x2b')](handleEntityNotFound(_0x10c5e4,null))[_0x5bd9('0x2b')](function(_0xa5339f){var _0x2a82ab=_[_0x5bd9('0x3e')](_0xa5339f,'id');var _0x4e3635=[];var _0x5a7fd7=[];var _0x1bf437=squel['select']();_0x1bf437[_0x5bd9('0x88')](_0x5bd9('0x89'))[_0x5bd9('0x8a')](_0x5bd9('0x8b'),'tq')[_0x5bd9('0x8c')](_0x5bd9('0x8d'),'ut',_0x5bd9('0x8e'))['where'](_0x5bd9('0x8f'),_0x35580e[_0x5bd9('0x64')]['id']);for(var _0x5dcf46=0x0;_0x5dcf46<_0xa5339f['length'];_0x5dcf46+=0x1){let _0x858853=_0xa5339f[_0x5dcf46];for(var _0x23f91a=0x0;_0x23f91a<_0x858853[_0x5bd9('0x73')][_0x5bd9('0x56')];_0x23f91a+=0x1){let _0x1bf8b8=_0x858853['Agents'][_0x23f91a];var _0x341191=_0x1bf437['clone']();_0x341191['where'](_0x5bd9('0x90'),_0x1bf8b8['id']);_0x5a7fd7[_0x5bd9('0x91')](db[_0x5bd9('0x79')][_0x5bd9('0x43')](_0x341191[_0x5bd9('0x92')](),{'type':db[_0x5bd9('0x79')]['QueryTypes'][_0x5bd9('0x93')]})[_0x5bd9('0x2b')](function(_0x337522){if(_0x337522[_0x5bd9('0x56')]===0x1){return _0x1bf8b8['id'];}else{var _0x47e0fd=_[_0x5bd9('0x94')](_['map'](_0x337522,'TeamId'),function(_0x265f68){return _['includes'](_0x2a82ab,_0x265f68);});if(_0x47e0fd){return _0x1bf8b8['id'];}}}));}}return BPromise[_0x5bd9('0x95')](_0x5a7fd7)[_0x5bd9('0x2b')](function(_0x467045){_0x4e3635=_(_0x4e3635)['union'](_0x467045)[_0x5bd9('0x96')]()['value']();return db[_0x5bd9('0x50')][_0x5bd9('0x35')]({'where':{'id':_0x35580e[_0x5bd9('0x64')]['id']}})[_0x5bd9('0x2b')](function(_0x3eab31){return db[_0x5bd9('0x79')]['transaction'](function(_0x3005b1){return _0x3eab31[_0x5bd9('0x85')](_0x35580e[_0x5bd9('0x43')]['ids'],{'transaction':_0x3005b1})['then'](function(){if(!_[_0x5bd9('0x97')](_0x4e3635)){return _0x3eab31[_0x5bd9('0x98')](_0x4e3635,{'transaction':_0x3005b1})['then'](function(){return db['UserVoiceQueueRt'][_0x5bd9('0x39')]({'where':{'VoiceQueueId':_0x35580e[_0x5bd9('0x64')]['id'],'UserId':_0x4e3635},'transaction':_0x3005b1});});}})[_0x5bd9('0x2b')](function(){_0x4e3635[_0x5bd9('0x77')](function(_0x461d56){socket[_0x5bd9('0x83')](_0x5bd9('0x99'),{'UserId':_0x461d56,'VoiceQueueId':_0x3eab31['id']});});});});});});})['then'](respondWithStatusCode(_0x10c5e4,null))[_0x5bd9('0x54')](handleError(_0x10c5e4,null));};exports[_0x5bd9('0x9a')]=function(_0x199f75,_0x5c7472,_0x3707bb){var _0xcde842,_0x33220e;return db[_0x5bd9('0x50')][_0x5bd9('0x35')]({'where':{'id':_0x199f75['params']['id']}})[_0x5bd9('0x2b')](handleEntityNotFound(_0x5c7472,null))[_0x5bd9('0x2b')](function(_0x56003b){if(_0x56003b){_0x33220e=_0x56003b;return _0x56003b[_0x5bd9('0x9a')](_0x199f75['body']['ids'],_[_0x5bd9('0x60')](_0x199f75[_0x5bd9('0x58')],['ids','id'])||{})[_0x5bd9('0x9b')](function(_0x19e748){for(var _0x22cf03=0x0;_0x22cf03<_0x199f75[_0x5bd9('0x58')][_0x5bd9('0x87')]['length'];_0x22cf03+=0x1){socket[_0x5bd9('0x83')](_0x5bd9('0x84'),{'UserId':Number(_0x199f75['body']['ids'][_0x22cf03]),'VoiceQueueId':Number(_0x199f75[_0x5bd9('0x64')]['id'])});}return _0x19e748;});}})[_0x5bd9('0x2b')](function(_0x19d783){_0xcde842=_0x19d783||[];if(_0x33220e){return db[_0x5bd9('0x72')][_0x5bd9('0x53')]({'where':{'id':_0x199f75['body'][_0x5bd9('0x87')]},'attributes':['id','name',_0x5bd9('0x74'),_0x5bd9('0x75'),'interface'],'raw':!![]});}})['then'](function(_0x352bb5){if(!_[_0x5bd9('0x97')](_0x352bb5)){var _0x22528f=[];for(var _0x13c571=0x0;_0x13c571<_0x352bb5[_0x5bd9('0x56')];_0x13c571++){if(_0x352bb5[_0x13c571][_0x5bd9('0x74')]){_0x22528f[_0x5bd9('0x91')](db['UserVoiceQueueRt'][_0x5bd9('0x7c')]({'membername':_0x352bb5[_0x13c571][_0x5bd9('0x37')],'UserId':_0x352bb5[_0x13c571]['id'],'queue_name':_0x33220e[_0x5bd9('0x37')],'VoiceQueueId':_0x33220e['id'],'interface':_[_0x5bd9('0x80')](_0x352bb5[_0x13c571]['interface'])?util[_0x5bd9('0x81')](_0x5bd9('0x82'),_0x352bb5[_0x13c571][_0x5bd9('0x37')]):_0x352bb5[_0x13c571][_0x5bd9('0x76')],'paused':_0x352bb5[_0x13c571][_0x5bd9('0x75')]||![],'penalty':_0x199f75[_0x5bd9('0x58')][_0x5bd9('0x78')]||0x0}));}}return BPromise[_0x5bd9('0x95')](_0x22528f);}})['then'](function(){return _0xcde842;})['then'](respondWithResult(_0x5c7472,null))[_0x5bd9('0x54')](handleError(_0x5c7472,null));};exports[_0x5bd9('0x98')]=function(_0x218548,_0x419820,_0x3b5dcd){return db['VoiceQueue'][_0x5bd9('0x35')]({'where':{'id':_0x218548[_0x5bd9('0x64')]['id']}})[_0x5bd9('0x2b')](handleEntityNotFound(_0x419820,null))['then'](function(_0x2c0919){if(_0x2c0919){return _0x2c0919['removeAgents'](_0x218548[_0x5bd9('0x43')][_0x5bd9('0x87')])['then'](function(){if(_[_0x5bd9('0x9c')](_0x218548[_0x5bd9('0x43')]['ids'])){for(var _0x27691c=0x0;_0x27691c<_0x218548['query'][_0x5bd9('0x87')][_0x5bd9('0x56')];_0x27691c+=0x1){socket[_0x5bd9('0x83')](_0x5bd9('0x99'),{'UserId':Number(_0x218548[_0x5bd9('0x43')][_0x5bd9('0x87')][_0x27691c]),'VoiceQueueId':Number(_0x218548[_0x5bd9('0x64')]['id'])});}}else{socket['emit'](_0x5bd9('0x99'),{'UserId':Number(_0x218548['query'][_0x5bd9('0x87')]),'VoiceQueueId':Number(_0x218548[_0x5bd9('0x64')]['id'])});}});}})['then'](function(_0x3dfe0c){return db[_0x5bd9('0x7f')]['destroy']({'where':{'VoiceQueueId':_0x218548[_0x5bd9('0x64')]['id'],'UserId':_0x218548['query'][_0x5bd9('0x87')]}})[_0x5bd9('0x2b')](function(){return _0x3dfe0c;});})[_0x5bd9('0x2b')](respondWithStatusCode(_0x419820,null))[_0x5bd9('0x54')](handleError(_0x419820,null));};exports[_0x5bd9('0x9d')]=function(_0x1927ea,_0x32af59,_0x2f0689){var _0x50b1dc={};var _0x2c9a6d={};var _0x17f6d2;var _0x569dd7;return db[_0x5bd9('0x50')][_0x5bd9('0x65')]({'where':{'id':_0x1927ea[_0x5bd9('0x64')]['id']}})[_0x5bd9('0x2b')](handleEntityNotFound(_0x32af59,null))['then'](function(_0x5144ae){if(_0x5144ae){_0x17f6d2=_0x5144ae;_0x2c9a6d[_0x5bd9('0x42')]=_['keys'](db[_0x5bd9('0x72')][_0x5bd9('0x3f')]);_0x2c9a6d[_0x5bd9('0x43')]=_[_0x5bd9('0x44')](_0x1927ea['query']);_0x2c9a6d[_0x5bd9('0x4c')]=_[_0x5bd9('0x46')](_0x2c9a6d[_0x5bd9('0x42')],_0x2c9a6d[_0x5bd9('0x43')]);_0x50b1dc[_0x5bd9('0x45')]=_[_0x5bd9('0x46')](_0x2c9a6d[_0x5bd9('0x42')],qs[_0x5bd9('0x47')](_0x1927ea['query'][_0x5bd9('0x47')]));_0x50b1dc[_0x5bd9('0x45')]=_0x50b1dc['attributes'][_0x5bd9('0x56')]?_0x50b1dc[_0x5bd9('0x45')]:_0x2c9a6d[_0x5bd9('0x42')];_0x50b1dc['order']=qs[_0x5bd9('0x4a')](_0x1927ea['query'][_0x5bd9('0x4a')]);_0x50b1dc[_0x5bd9('0x4b')]=qs[_0x5bd9('0x4c')](_[_0x5bd9('0x4d')](_0x1927ea[_0x5bd9('0x43')],_0x2c9a6d[_0x5bd9('0x4c')]));if(_0x1927ea['query'][_0x5bd9('0x31')]){_0x50b1dc[_0x5bd9('0x4b')]=_['merge'](_0x50b1dc[_0x5bd9('0x4b')],{'$or':_[_0x5bd9('0x3e')](_0x50b1dc[_0x5bd9('0x45')],function(_0x503ebf){var _0x3d9413={};_0x3d9413[_0x503ebf]={'$like':'%'+_0x1927ea[_0x5bd9('0x43')][_0x5bd9('0x31')]+'%'};return _0x3d9413;})});}_0x50b1dc=_['merge']({},_0x50b1dc,_0x1927ea[_0x5bd9('0x5f')]);return _0x17f6d2[_0x5bd9('0x9d')](_0x50b1dc);}})['then'](function(_0x323f15){if(_0x323f15){_0x569dd7=_0x323f15[_0x5bd9('0x56')];if(!_0x1927ea[_0x5bd9('0x43')][_0x5bd9('0x48')](_0x5bd9('0x49'))){_0x50b1dc['limit']=qs[_0x5bd9('0x23')](_0x1927ea[_0x5bd9('0x43')]['limit']);_0x50b1dc[_0x5bd9('0x21')]=qs[_0x5bd9('0x21')](_0x1927ea[_0x5bd9('0x43')][_0x5bd9('0x21')]);}return _0x17f6d2['getAgents'](_0x50b1dc);}})[_0x5bd9('0x2b')](function(_0x3c5e72){if(_0x3c5e72){return _0x3c5e72?{'count':_0x569dd7,'rows':_0x3c5e72}:null;}})[_0x5bd9('0x2b')](respondWithResult(_0x32af59,null))[_0x5bd9('0x54')](handleError(_0x32af59,null));};exports[_0x5bd9('0x9e')]=function(_0x25bfea,_0x3125c1,_0x5bc791){var _0x19c286={};var _0x493b70={};var _0x5c9dac;var _0x27f9b5;return db[_0x5bd9('0x50')][_0x5bd9('0x65')]({'where':{'id':_0x25bfea[_0x5bd9('0x64')]['id']}})[_0x5bd9('0x2b')](handleEntityNotFound(_0x3125c1,null))['then'](function(_0x61d421){if(_0x61d421){_0x5c9dac=_0x61d421;_0x493b70[_0x5bd9('0x42')]=_['keys'](db[_0x5bd9('0x7f')][_0x5bd9('0x3f')]);_0x493b70[_0x5bd9('0x43')]=_[_0x5bd9('0x44')](_0x25bfea['query']);_0x493b70[_0x5bd9('0x4c')]=_['intersection'](_0x493b70['model'],_0x493b70[_0x5bd9('0x43')]);_0x19c286[_0x5bd9('0x45')]=_['intersection'](_0x493b70[_0x5bd9('0x42')],qs['fields'](_0x25bfea['query']['fields']));_0x19c286[_0x5bd9('0x45')]=_0x19c286['attributes'][_0x5bd9('0x56')]?_0x19c286[_0x5bd9('0x45')]:_0x493b70[_0x5bd9('0x42')];_0x19c286[_0x5bd9('0x67')]=qs['sort'](_0x25bfea['query'][_0x5bd9('0x4a')]);_0x19c286[_0x5bd9('0x4b')]=qs['filters'](_[_0x5bd9('0x4d')](_0x25bfea['query'],_0x493b70[_0x5bd9('0x4c')]));if(_0x25bfea['query'][_0x5bd9('0x31')]){_0x19c286['where']=_[_0x5bd9('0x4e')](_0x19c286[_0x5bd9('0x4b')],{'$or':_[_0x5bd9('0x3e')](_0x19c286[_0x5bd9('0x45')],function(_0x148abd){var _0x399f9c={};_0x399f9c[_0x148abd]={'$like':'%'+_0x25bfea[_0x5bd9('0x43')][_0x5bd9('0x31')]+'%'};return _0x399f9c;})});}_0x19c286=_[_0x5bd9('0x4e')]({},_0x19c286,_0x25bfea[_0x5bd9('0x5f')]);return _0x5c9dac[_0x5bd9('0x9e')](_0x19c286);}})['then'](function(_0x17d5cd){if(_0x17d5cd){_0x27f9b5=_0x17d5cd[_0x5bd9('0x56')];if(!_0x25bfea[_0x5bd9('0x43')][_0x5bd9('0x48')](_0x5bd9('0x49'))){_0x19c286[_0x5bd9('0x23')]=qs[_0x5bd9('0x23')](_0x25bfea[_0x5bd9('0x43')][_0x5bd9('0x23')]);_0x19c286['offset']=qs[_0x5bd9('0x21')](_0x25bfea['query']['offset']);}return _0x5c9dac[_0x5bd9('0x9e')](_0x19c286);}})[_0x5bd9('0x2b')](function(_0x125df8){return _0x125df8?{'count':_0x27f9b5,'rows':_0x125df8}:null;})[_0x5bd9('0x2b')](respondWithResult(_0x3125c1,null))[_0x5bd9('0x54')](handleError(_0x3125c1,null));};exports[_0x5bd9('0x9f')]=function(_0x23a88c,_0x383578,_0x5c40ae){var _0x150d2c={};var _0x84cf7a={};var _0x32ea98;var _0x267beb;return db[_0x5bd9('0x50')][_0x5bd9('0x65')]({'where':{'id':_0x23a88c['params']['id']}})[_0x5bd9('0x2b')](handleEntityNotFound(_0x383578,null))[_0x5bd9('0x2b')](function(_0x497f44){if(_0x497f44){_0x32ea98=_0x497f44;_0x84cf7a[_0x5bd9('0x42')]=_[_0x5bd9('0x44')](db[_0x5bd9('0xa0')][_0x5bd9('0x3f')]);_0x84cf7a[_0x5bd9('0x43')]=_[_0x5bd9('0x44')](_0x23a88c[_0x5bd9('0x43')]);_0x84cf7a['filters']=_[_0x5bd9('0x46')](_0x84cf7a[_0x5bd9('0x42')],_0x84cf7a['query']);_0x150d2c[_0x5bd9('0x45')]=_[_0x5bd9('0x46')](_0x84cf7a[_0x5bd9('0x42')],qs[_0x5bd9('0x47')](_0x23a88c['query'][_0x5bd9('0x47')]));_0x150d2c[_0x5bd9('0x45')]=_0x150d2c[_0x5bd9('0x45')][_0x5bd9('0x56')]?_0x150d2c[_0x5bd9('0x45')]:_0x84cf7a[_0x5bd9('0x42')];_0x150d2c['order']=qs['sort'](_0x23a88c['query'][_0x5bd9('0x4a')]);_0x150d2c[_0x5bd9('0x4b')]=qs['filters'](_['pick'](_0x23a88c['query'],_0x84cf7a[_0x5bd9('0x4c')]));if(_0x23a88c[_0x5bd9('0x43')]['filter']){_0x150d2c['where']=_[_0x5bd9('0x4e')](_0x150d2c['where'],{'$or':_[_0x5bd9('0x3e')](_0x150d2c[_0x5bd9('0x45')],function(_0x23edfe){var _0x1a62dc={};_0x1a62dc[_0x23edfe]={'$like':'%'+_0x23a88c[_0x5bd9('0x43')][_0x5bd9('0x31')]+'%'};return _0x1a62dc;})});}_0x150d2c=_[_0x5bd9('0x4e')]({},_0x150d2c,_0x23a88c[_0x5bd9('0x5f')]);return _0x32ea98[_0x5bd9('0x9f')](_0x150d2c);}})[_0x5bd9('0x2b')](function(_0x42e4d9){if(_0x42e4d9){_0x267beb=_0x42e4d9['length'];if(!_0x23a88c[_0x5bd9('0x43')][_0x5bd9('0x48')](_0x5bd9('0x49'))){_0x150d2c[_0x5bd9('0x23')]=qs[_0x5bd9('0x23')](_0x23a88c['query'][_0x5bd9('0x23')]);_0x150d2c[_0x5bd9('0x21')]=qs[_0x5bd9('0x21')](_0x23a88c[_0x5bd9('0x43')][_0x5bd9('0x21')]);}return _0x32ea98[_0x5bd9('0x9f')](_0x150d2c);}})[_0x5bd9('0x2b')](function(_0x39f048){if(_0x39f048){return _0x39f048?{'count':_0x267beb,'rows':_0x39f048}:null;}})[_0x5bd9('0x2b')](respondWithResult(_0x383578,null))[_0x5bd9('0x54')](handleError(_0x383578,null));};exports[_0x5bd9('0xa1')]=function(_0x38467d,_0x2e9dfe,_0x5a2e9f){var _0x4e73ec,_0x31dc36;return db[_0x5bd9('0x50')][_0x5bd9('0x35')]({'where':{'id':_0x38467d[_0x5bd9('0x64')]['id']}})[_0x5bd9('0x2b')](handleEntityNotFound(_0x2e9dfe,null))[_0x5bd9('0x2b')](function(_0x5a4f67){if(_0x5a4f67){_0x31dc36=_0x5a4f67;return _0x5a4f67[_0x5bd9('0xa1')](_0x38467d[_0x5bd9('0x58')]['ids'],_[_0x5bd9('0x60')](_0x38467d[_0x5bd9('0x58')],[_0x5bd9('0x87'),'id'])||{});}return null;})[_0x5bd9('0x9b')](function(_0x1e6185){var _0x57d75f;_0x4e73ec=_0x1e6185||[];var _0x310941=[];if(_0x1e6185){for(var _0x580a0f=0x0;_0x580a0f<_0x1e6185[_0x5bd9('0x56')];_0x580a0f+=0x1){var _0x41ed97=_0x1e6185[_0x580a0f][_0x5bd9('0x2c')]({'plain':!![]});_0x31dc36['dialCheckDuplicateType']=_0x38467d['body'][_0x5bd9('0xa2')]?_0x38467d[_0x5bd9('0x58')]['dialCheckDuplicateType']:_0x31dc36[_0x5bd9('0xa2')];switch(_0x31dc36[_0x5bd9('0xa2')]){case _0x5bd9('0xa3'):_0x57d75f=squel[_0x5bd9('0xa4')]()[_0x5bd9('0xa5')]('cm_hopper')[_0x5bd9('0xa6')]([_0x5bd9('0xa7'),_0x5bd9('0xa8'),_0x5bd9('0xa9'),'ListId',_0x5bd9('0x6a'),'createdAt','updatedAt'],squel[_0x5bd9('0xaa')]()[_0x5bd9('0x88')]('phone',_0x5bd9('0xa7'))[_0x5bd9('0x88')]('NOW()',_0x5bd9('0xa8'))[_0x5bd9('0x88')]('id',_0x5bd9('0xa9'))[_0x5bd9('0x88')](_0x41ed97['CmListId'][_0x5bd9('0x92')](),_0x5bd9('0xab'))[_0x5bd9('0x88')](_0x38467d['params']['id'][_0x5bd9('0x92')](),_0x5bd9('0x6a'))[_0x5bd9('0x88')](_0x5bd9('0xac'),'createdAt')[_0x5bd9('0x88')]('NOW()',_0x5bd9('0xad'))[_0x5bd9('0x8a')](_0x5bd9('0xae'))[_0x5bd9('0x4b')](_0x5bd9('0xaf'))[_0x5bd9('0x4b')]('ListId\x20=\x20?',_0x41ed97[_0x5bd9('0xb0')][_0x5bd9('0x92')]())[_0x5bd9('0x4b')](_0x5bd9('0xb1'))[_0x5bd9('0x4b')](_0x5bd9('0xb2'),squel[_0x5bd9('0xaa')]()[_0x5bd9('0x88')](_0x5bd9('0xb3'))['from'](_0x5bd9('0xb4'))[_0x5bd9('0x4b')](_0x5bd9('0x8f'),_0x38467d['params']['id'][_0x5bd9('0x92')]()))[_0x5bd9('0x4b')](_0x5bd9('0xb2'),squel['select']()[_0x5bd9('0x88')](_0x5bd9('0xb5'))[_0x5bd9('0x8a')](_0x5bd9('0xb6'))[_0x5bd9('0x4b')](_0x5bd9('0x8f'),_0x38467d[_0x5bd9('0x64')]['id']['toString']())))[_0x5bd9('0x92')]();break;case _0x5bd9('0xb7'):_0x57d75f=squel[_0x5bd9('0xa4')]()[_0x5bd9('0xa5')]('cm_hopper')['fromQuery']([_0x5bd9('0xa7'),_0x5bd9('0xa8'),_0x5bd9('0xa9'),_0x5bd9('0xab'),_0x5bd9('0x6a'),_0x5bd9('0x61'),_0x5bd9('0xad')],squel[_0x5bd9('0xaa')]()['field']('phone',_0x5bd9('0xa7'))[_0x5bd9('0x88')](_0x5bd9('0xac'),_0x5bd9('0xa8'))[_0x5bd9('0x88')]('id',_0x5bd9('0xa9'))[_0x5bd9('0x88')](_0x41ed97[_0x5bd9('0xb0')][_0x5bd9('0x92')](),_0x5bd9('0xab'))[_0x5bd9('0x88')](_0x38467d['params']['id'][_0x5bd9('0x92')](),_0x5bd9('0x6a'))[_0x5bd9('0x88')](_0x5bd9('0xac'),_0x5bd9('0x61'))[_0x5bd9('0x88')]('NOW()',_0x5bd9('0xad'))[_0x5bd9('0x8a')](_0x5bd9('0xae'))['where'](_0x5bd9('0xaf'))[_0x5bd9('0x4b')](_0x5bd9('0xb8'),_0x41ed97['CmListId'][_0x5bd9('0x92')]())[_0x5bd9('0x4b')](_0x5bd9('0xb1'))[_0x5bd9('0x4b')](_0x5bd9('0xb2'),squel[_0x5bd9('0xaa')]()['field'](_0x5bd9('0xb5'))['from'](_0x5bd9('0xb6'))[_0x5bd9('0x4b')](_0x5bd9('0x8f'),_0x38467d[_0x5bd9('0x64')]['id'][_0x5bd9('0x92')]())))[_0x5bd9('0x92')]();break;default:_0x57d75f=squel[_0x5bd9('0xa4')]()['into'](_0x5bd9('0xb6'))[_0x5bd9('0xa6')]([_0x5bd9('0xa7'),'scheduledAt',_0x5bd9('0xa9'),_0x5bd9('0xab'),'VoiceQueueId',_0x5bd9('0x61'),'updatedAt'],squel[_0x5bd9('0xaa')]()[_0x5bd9('0x88')](_0x5bd9('0xa7'),_0x5bd9('0xa7'))['field'](_0x5bd9('0xac'),_0x5bd9('0xa8'))['field']('id',_0x5bd9('0xa9'))['field'](_0x41ed97[_0x5bd9('0xb0')][_0x5bd9('0x92')](),'ListId')[_0x5bd9('0x88')](_0x38467d[_0x5bd9('0x64')]['id']['toString'](),_0x5bd9('0x6a'))[_0x5bd9('0x88')](_0x5bd9('0xac'),_0x5bd9('0x61'))['field'](_0x5bd9('0xac'),_0x5bd9('0xad'))[_0x5bd9('0x8a')](_0x5bd9('0xae'))[_0x5bd9('0x4b')](_0x5bd9('0xaf'))[_0x5bd9('0x4b')](_0x5bd9('0xb8'),_0x41ed97[_0x5bd9('0xb0')][_0x5bd9('0x92')]())[_0x5bd9('0x4b')](_0x5bd9('0xb1')))[_0x5bd9('0x92')]();}_0x310941[_0x5bd9('0x91')](db[_0x5bd9('0x79')][_0x5bd9('0x43')](_0x57d75f));}return BPromise[_0x5bd9('0x95')](_0x310941);}})['then'](function(){return _0x4e73ec;})[_0x5bd9('0x2b')](respondWithResult(_0x2e9dfe,null))[_0x5bd9('0x54')](handleError(_0x2e9dfe,null));};exports[_0x5bd9('0xb9')]=function(_0x468f10,_0x252227,_0x12fa8f){return db[_0x5bd9('0x50')][_0x5bd9('0x35')]({'where':{'id':_0x468f10[_0x5bd9('0x64')]['id']}})['then'](handleEntityNotFound(_0x252227,null))[_0x5bd9('0x2b')](function(_0xe9e7d7){if(_0xe9e7d7){return _0xe9e7d7[_0x5bd9('0xb9')](_0x468f10[_0x5bd9('0x43')][_0x5bd9('0x87')]);}})['then'](function(_0x473320){if(_0x473320){return db['CmHopper']['destroy']({'where':{'ListId':_0x468f10[_0x5bd9('0x43')][_0x5bd9('0x87')],'VoiceQueueId':_0x468f10[_0x5bd9('0x64')]['id']}})[_0x5bd9('0x2b')](function(){return _0x473320;});}})[_0x5bd9('0x2b')](respondWithStatusCode(_0x252227,null))[_0x5bd9('0x54')](handleError(_0x252227,null));};exports[_0x5bd9('0xba')]=function(_0x4dd45e,_0x59519a,_0x54f114){var _0x168645={};var _0x477aa2={};var _0x295425;var _0x7eabef;return db['VoiceQueue']['findOne']({'where':{'id':_0x4dd45e['params']['id']}})[_0x5bd9('0x2b')](handleEntityNotFound(_0x59519a,null))[_0x5bd9('0x2b')](function(_0x50ece6){if(_0x50ece6){_0x295425=_0x50ece6;_0x477aa2[_0x5bd9('0x42')]=_[_0x5bd9('0x44')](db['CmList'][_0x5bd9('0x3f')]);_0x477aa2['query']=_['keys'](_0x4dd45e[_0x5bd9('0x43')]);_0x477aa2[_0x5bd9('0x4c')]=_['intersection'](_0x477aa2['model'],_0x477aa2[_0x5bd9('0x43')]);_0x168645[_0x5bd9('0x45')]=_[_0x5bd9('0x46')](_0x477aa2[_0x5bd9('0x42')],qs[_0x5bd9('0x47')](_0x4dd45e['query'][_0x5bd9('0x47')]));_0x168645[_0x5bd9('0x45')]=_0x168645[_0x5bd9('0x45')][_0x5bd9('0x56')]?_0x168645['attributes']:_0x477aa2[_0x5bd9('0x42')];_0x168645[_0x5bd9('0x67')]=qs[_0x5bd9('0x4a')](_0x4dd45e[_0x5bd9('0x43')][_0x5bd9('0x4a')]);_0x168645[_0x5bd9('0x4b')]=qs['filters'](_[_0x5bd9('0x4d')](_0x4dd45e[_0x5bd9('0x43')],_0x477aa2['filters']));if(_0x4dd45e[_0x5bd9('0x43')][_0x5bd9('0x31')]){_0x168645[_0x5bd9('0x4b')]=_[_0x5bd9('0x4e')](_0x168645[_0x5bd9('0x4b')],{'$or':_[_0x5bd9('0x3e')](_0x168645[_0x5bd9('0x45')],function(_0x3995f8){var _0x5a5770={};_0x5a5770[_0x3995f8]={'$like':'%'+_0x4dd45e['query'][_0x5bd9('0x31')]+'%'};return _0x5a5770;})});}_0x168645=_[_0x5bd9('0x4e')]({},_0x168645,_0x4dd45e['options']);return _0x295425[_0x5bd9('0xba')](_0x168645);}})['then'](function(_0x3da28e){if(_0x3da28e){_0x7eabef=_0x3da28e[_0x5bd9('0x56')];if(!_0x4dd45e[_0x5bd9('0x43')][_0x5bd9('0x48')](_0x5bd9('0x49'))){_0x168645[_0x5bd9('0x23')]=qs[_0x5bd9('0x23')](_0x4dd45e['query'][_0x5bd9('0x23')]);_0x168645[_0x5bd9('0x21')]=qs[_0x5bd9('0x21')](_0x4dd45e['query'][_0x5bd9('0x21')]);}return _0x295425[_0x5bd9('0xba')](_0x168645);}})[_0x5bd9('0x2b')](function(_0x2f435b){if(_0x2f435b){return _0x2f435b?{'count':_0x7eabef,'rows':_0x2f435b}:null;}})[_0x5bd9('0x2b')](respondWithResult(_0x59519a,null))[_0x5bd9('0x54')](handleError(_0x59519a,null));};exports[_0x5bd9('0xbb')]=function(_0x391e6c,_0x3a326e,_0x32335f){var _0x5360e5,_0x171223;return db[_0x5bd9('0x50')]['find']({'where':{'id':_0x391e6c[_0x5bd9('0x64')]['id']}})[_0x5bd9('0x2b')](handleEntityNotFound(_0x3a326e,null))['then'](function(_0x2ad549){if(_0x2ad549){_0x171223=_0x2ad549;return _0x2ad549[_0x5bd9('0xbb')](_0x391e6c[_0x5bd9('0x58')][_0x5bd9('0x87')],_[_0x5bd9('0x60')](_0x391e6c['body'],[_0x5bd9('0x87'),'id'])||{});}return null;})[_0x5bd9('0x9b')](function(_0x1972cc){var _0x485a96;_0x5360e5=_0x1972cc||[];var _0x1ba986=[];if(_0x1972cc){for(var _0x5aeeea=0x0;_0x5aeeea<_0x1972cc[_0x5bd9('0x56')];_0x5aeeea+=0x1){var _0x239efd=_0x1972cc[_0x5aeeea][_0x5bd9('0x2c')]({'plain':!![]});_0x485a96=squel[_0x5bd9('0xa4')]()['into'](_0x5bd9('0xbc'))['fromQuery']([_0x5bd9('0xa7'),'ContactId',_0x5bd9('0xab'),_0x5bd9('0x6a'),_0x5bd9('0x61'),_0x5bd9('0xad')],squel[_0x5bd9('0xaa')]()['field']('phone',_0x5bd9('0xa7'))[_0x5bd9('0x88')]('id',_0x5bd9('0xa9'))[_0x5bd9('0x88')](_0x239efd['CmListId'][_0x5bd9('0x92')](),_0x5bd9('0xab'))[_0x5bd9('0x88')](_0x391e6c[_0x5bd9('0x64')]['id'][_0x5bd9('0x92')](),_0x5bd9('0x6a'))[_0x5bd9('0x88')](_0x5bd9('0xac'),_0x5bd9('0x61'))['field'](_0x5bd9('0xac'),_0x5bd9('0xad'))['from'](_0x5bd9('0xae'))[_0x5bd9('0x4b')]('deletedAt\x20IS\x20NULL')['where'](_0x5bd9('0xb8'),_0x239efd[_0x5bd9('0xb0')][_0x5bd9('0x92')]())[_0x5bd9('0x4b')](_0x5bd9('0xb1')))[_0x5bd9('0x92')]();_0x1ba986[_0x5bd9('0x91')](db[_0x5bd9('0x79')][_0x5bd9('0x43')](_0x485a96));}return BPromise[_0x5bd9('0x95')](_0x1ba986);}})[_0x5bd9('0x2b')](function(){return _0x5360e5;})[_0x5bd9('0x2b')](respondWithResult(_0x3a326e,null))['catch'](handleError(_0x3a326e,null));};exports[_0x5bd9('0xbd')]=function(_0x92781f,_0x6efa1d,_0xa5f586){return db['VoiceQueue'][_0x5bd9('0x35')]({'where':{'id':_0x92781f[_0x5bd9('0x64')]['id']}})[_0x5bd9('0x2b')](handleEntityNotFound(_0x6efa1d,null))[_0x5bd9('0x2b')](function(_0x226368){if(_0x226368){return _0x226368['removeBlackLists'](_0x92781f[_0x5bd9('0x43')][_0x5bd9('0x87')]);}})[_0x5bd9('0x2b')](function(_0x5b2491){if(_0x5b2491){return db[_0x5bd9('0x6e')][_0x5bd9('0x39')]({'where':{'ListId':_0x92781f[_0x5bd9('0x43')][_0x5bd9('0x87')],'VoiceQueueId':_0x92781f[_0x5bd9('0x64')]['id']}})[_0x5bd9('0x2b')](function(){return _0x5b2491;});}})[_0x5bd9('0x2b')](respondWithStatusCode(_0x6efa1d,null))[_0x5bd9('0x54')](handleError(_0x6efa1d,null));}; \ No newline at end of file +var _0x7806=['count','limit','set','Content-Range','apply','reject','save','update','destroy','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','includes','find','value','type','name','UserProfileResource','then','error','send','index','VoiceQueue','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','include','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','findOne','CmHopper','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','interface','userVoiceQueue:save','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','all','union','removeTeams','isEmpty','removeAgents','emit','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','into','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','json','offset','undefined'];(function(_0x5e6d82,_0x4fcc5a){var _0x4f0c47=function(_0x3e551e){while(--_0x3e551e){_0x5e6d82['push'](_0x5e6d82['shift']());}};_0x4f0c47(++_0x4fcc5a);}(_0x7806,0x15a));var _0x6780=function(_0x44b2b8,_0x4d0b48){_0x44b2b8=_0x44b2b8-0x0;var _0x52efb5=_0x7806[_0x44b2b8];return _0x52efb5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6780('0x0'));var zipdir=require(_0x6780('0x1'));var jsonpatch=require(_0x6780('0x2'));var rp=require(_0x6780('0x3'));var moment=require(_0x6780('0x4'));var BPromise=require(_0x6780('0x5'));var Mustache=require(_0x6780('0x6'));var util=require(_0x6780('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6780('0x8'));var ejs=require(_0x6780('0x9'));var fs=require('fs');var fs_extra=require(_0x6780('0xa'));var _=require(_0x6780('0xb'));var squel=require(_0x6780('0xc'));var crypto=require(_0x6780('0xd'));var jsforce=require(_0x6780('0xe'));var deskjs=require(_0x6780('0xf'));var toCsv=require(_0x6780('0x8'));var querystring=require(_0x6780('0x10'));var Papa=require('papaparse');var Redis=require(_0x6780('0x11'));var authService=require(_0x6780('0x12'));var qs=require(_0x6780('0x13'));var as=require(_0x6780('0x14'));var hardwareService=require(_0x6780('0x15'));var logger=require('../../config/logger')(_0x6780('0x16'));var utils=require(_0x6780('0x17'));var config=require(_0x6780('0x18'));var licenseUtil=require(_0x6780('0x19'));var db=require(_0x6780('0x1a'))['db'];config[_0x6780('0x1b')]=_[_0x6780('0x1c')](config['redis'],{'host':_0x6780('0x1d'),'port':0x18eb});var socket=require(_0x6780('0x1e'))(new Redis(config[_0x6780('0x1b')]));require(_0x6780('0x1f'))[_0x6780('0x20')](socket);function respondWithStatusCode(_0x276e17,_0x35ca7c){_0x35ca7c=_0x35ca7c||0xcc;return function(_0x5aa4ac){if(_0x5aa4ac){return _0x276e17['sendStatus'](_0x35ca7c);}return _0x276e17[_0x6780('0x21')](_0x35ca7c)[_0x6780('0x22')]();};}function respondWithResult(_0x1b3039,_0x412b9f){_0x412b9f=_0x412b9f||0xc8;return function(_0x3a8b8b){if(_0x3a8b8b){return _0x1b3039[_0x6780('0x21')](_0x412b9f)[_0x6780('0x23')](_0x3a8b8b);}};}function respondWithFilteredResult(_0x51904c,_0x4f1b80){return function(_0x494df1){if(_0x494df1){var _0x3a7f0a=typeof _0x4f1b80[_0x6780('0x24')]==='undefined'&&typeof _0x4f1b80['limit']===_0x6780('0x25');var _0x5e140a=_0x494df1[_0x6780('0x26')];var _0x47a16c=_0x3a7f0a?0x0:_0x4f1b80[_0x6780('0x24')];var _0x271fbd=_0x3a7f0a?_0x494df1['count']:_0x4f1b80[_0x6780('0x24')]+_0x4f1b80[_0x6780('0x27')];var _0x34de4c;if(_0x271fbd>=_0x5e140a){_0x271fbd=_0x5e140a;_0x34de4c=0xc8;}else{_0x34de4c=0xce;}_0x51904c[_0x6780('0x21')](_0x34de4c);return _0x51904c[_0x6780('0x28')](_0x6780('0x29'),_0x47a16c+'-'+_0x271fbd+'/'+_0x5e140a)[_0x6780('0x23')](_0x494df1);}return null;};}function patchUpdates(_0x98c6fd){return function(_0x453c69){try{jsonpatch[_0x6780('0x2a')](_0x453c69,_0x98c6fd,!![]);}catch(_0x2fa871){return BPromise[_0x6780('0x2b')](_0x2fa871);}return _0x453c69[_0x6780('0x2c')]();};}function saveUpdates(_0x236978,_0x4d8009){return function(_0x4d5507){if(_0x4d5507){return _0x4d5507[_0x6780('0x2d')](_0x236978)['then'](function(_0x48fef7){return _0x48fef7;});}return null;};}function removeEntity(_0x5a7854,_0x125234){return function(_0x1bb094){if(_0x1bb094){return _0x1bb094[_0x6780('0x2e')]()['then'](function(){var _0x212d92=_0x1bb094['get']({'plain':!![]});var _0x298a26=[{'name':_0x6780('0x2f'),'value':_0x6780('0x30'),'ignore':![]},{'name':_0x6780('0x31'),'value':_0x6780('0x32'),'ignore':![]}];var _0x2102c1=_(_0x298a26)[_0x6780('0x33')](_0x6780('0x34'))[_0x6780('0x35')]('value')['value']();if(_[_0x6780('0x36')](_0x2102c1,_0x212d92['type'])){return;}var _0x48983b=_[_0x6780('0x37')](_0x298a26,[_0x6780('0x38'),_0x212d92[_0x6780('0x39')]])[_0x6780('0x3a')];return db[_0x6780('0x3b')][_0x6780('0x2e')]({'where':{'type':_0x48983b,'resourceId':_0x212d92['id']}})[_0x6780('0x3c')](function(){return _0x1bb094;});})[_0x6780('0x3c')](function(){_0x5a7854[_0x6780('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46697a,_0x1a18f9){return function(_0x4c3bf){if(!_0x4c3bf){_0x46697a['sendStatus'](0x194);}return _0x4c3bf;};}function handleError(_0x1b151a,_0x59fcbd){_0x59fcbd=_0x59fcbd||0x1f4;return function(_0x1acc44){logger[_0x6780('0x3d')](_0x1acc44['stack']);if(_0x1acc44['name']){delete _0x1acc44[_0x6780('0x3a')];}_0x1b151a[_0x6780('0x21')](_0x59fcbd)[_0x6780('0x3e')](_0x1acc44);};}exports[_0x6780('0x3f')]=function(_0x31ca87,_0x3f6f32){var _0x4d3e13={},_0xa25176={},_0x28c9f1={'count':0x0,'rows':[]};var _0x537031=_[_0x6780('0x35')](db[_0x6780('0x40')]['rawAttributes'],function(_0x2a1f7c){return{'name':_0x2a1f7c[_0x6780('0x41')],'type':_0x2a1f7c[_0x6780('0x39')]['key']};});_0xa25176[_0x6780('0x42')]=_[_0x6780('0x35')](_0x537031,_0x6780('0x3a'));_0xa25176[_0x6780('0x43')]=_[_0x6780('0x44')](_0x31ca87['query']);_0xa25176[_0x6780('0x45')]=_[_0x6780('0x46')](_0xa25176['model'],_0xa25176[_0x6780('0x43')]);_0x4d3e13['attributes']=_[_0x6780('0x46')](_0xa25176[_0x6780('0x42')],qs[_0x6780('0x47')](_0x31ca87['query']['fields']));_0x4d3e13[_0x6780('0x48')]=_0x4d3e13[_0x6780('0x48')][_0x6780('0x49')]?_0x4d3e13[_0x6780('0x48')]:_0xa25176[_0x6780('0x42')];if(!_0x31ca87[_0x6780('0x43')][_0x6780('0x4a')](_0x6780('0x4b'))){_0x4d3e13[_0x6780('0x27')]=qs[_0x6780('0x27')](_0x31ca87[_0x6780('0x43')][_0x6780('0x27')]);_0x4d3e13[_0x6780('0x24')]=qs['offset'](_0x31ca87[_0x6780('0x43')][_0x6780('0x24')]);}_0x4d3e13[_0x6780('0x4c')]=qs[_0x6780('0x4d')](_0x31ca87[_0x6780('0x43')]['sort']);_0x4d3e13[_0x6780('0x4e')]=qs[_0x6780('0x45')](_[_0x6780('0x4f')](_0x31ca87[_0x6780('0x43')],_0xa25176[_0x6780('0x45')]),_0x537031);if(_0x31ca87['query']['filter']){_0x4d3e13[_0x6780('0x4e')]=_['merge'](_0x4d3e13['where'],{'$or':_[_0x6780('0x35')](_0x537031,function(_0x364368){if(_0x364368[_0x6780('0x39')]!==_0x6780('0x50')){var _0x59ed5a={};_0x59ed5a[_0x364368[_0x6780('0x3a')]]={'$like':'%'+_0x31ca87[_0x6780('0x43')][_0x6780('0x33')]+'%'};return _0x59ed5a;}})});}_0x4d3e13=_[_0x6780('0x51')]({},_0x4d3e13,_0x31ca87[_0x6780('0x52')]);var _0x3215ce={'where':_0x4d3e13[_0x6780('0x4e')]};return db[_0x6780('0x40')][_0x6780('0x26')](_0x3215ce)[_0x6780('0x3c')](function(_0x275505){_0x28c9f1[_0x6780('0x26')]=_0x275505;if(_0x31ca87[_0x6780('0x43')][_0x6780('0x53')]){_0x4d3e13['include']=[{'all':!![]}];}return db[_0x6780('0x40')][_0x6780('0x54')](_0x4d3e13);})[_0x6780('0x3c')](function(_0x30d175){_0x28c9f1[_0x6780('0x55')]=_0x30d175;return _0x28c9f1;})[_0x6780('0x3c')](respondWithFilteredResult(_0x3f6f32,_0x4d3e13))[_0x6780('0x56')](handleError(_0x3f6f32,null));};exports['show']=function(_0x3db7ce,_0x387c62){var _0x4d7e0e={'raw':![],'where':{'id':_0x3db7ce[_0x6780('0x57')]['id']}},_0x6d1567={};_0x6d1567['model']=_[_0x6780('0x44')](db['VoiceQueue'][_0x6780('0x58')]);_0x6d1567[_0x6780('0x43')]=_[_0x6780('0x44')](_0x3db7ce[_0x6780('0x43')]);_0x6d1567[_0x6780('0x45')]=_[_0x6780('0x46')](_0x6d1567[_0x6780('0x42')],_0x6d1567['query']);_0x4d7e0e[_0x6780('0x48')]=_[_0x6780('0x46')](_0x6d1567[_0x6780('0x42')],qs[_0x6780('0x47')](_0x3db7ce[_0x6780('0x43')][_0x6780('0x47')]));_0x4d7e0e['attributes']=_0x4d7e0e[_0x6780('0x48')][_0x6780('0x49')]?_0x4d7e0e[_0x6780('0x48')]:_0x6d1567['model'];if(_0x3db7ce[_0x6780('0x43')][_0x6780('0x53')]){_0x4d7e0e[_0x6780('0x59')]=[{'all':!![]}];}_0x4d7e0e=_[_0x6780('0x51')]({},_0x4d7e0e,_0x3db7ce[_0x6780('0x52')]);return db[_0x6780('0x40')][_0x6780('0x37')](_0x4d7e0e)[_0x6780('0x3c')](handleEntityNotFound(_0x387c62,null))['then'](respondWithResult(_0x387c62,null))[_0x6780('0x56')](handleError(_0x387c62,null));};exports[_0x6780('0x5a')]=function(_0x7ce888,_0x1fecdf){return db[_0x6780('0x40')]['create'](_0x7ce888['body'],{})[_0x6780('0x3c')](function(_0x497e1e){var _0x196802=_0x7ce888[_0x6780('0x5b')][_0x6780('0x5c')]({'plain':!![]});if(!_0x196802)throw new Error(_0x6780('0x5d'));if(_0x196802[_0x6780('0x5e')]===_0x6780('0x5b')){var _0x31c1b9=_0x497e1e[_0x6780('0x5c')]({'plain':!![]});var _0x3f69eb=[{'name':_0x6780('0x2f'),'value':_0x6780('0x30')},{'name':_0x6780('0x31'),'value':_0x6780('0x32')}];var _0x4655be=_[_0x6780('0x37')](_0x3f69eb,[_0x6780('0x38'),_0x31c1b9[_0x6780('0x39')]])[_0x6780('0x3a')];return db[_0x6780('0x5f')][_0x6780('0x37')]({'where':{'name':_0x4655be,'userProfileId':_0x196802[_0x6780('0x60')]},'raw':!![]})[_0x6780('0x3c')](function(_0x18cbd4){if(_0x18cbd4&&_0x18cbd4[_0x6780('0x61')]===0x0){return db[_0x6780('0x3b')][_0x6780('0x5a')]({'name':_0x31c1b9[_0x6780('0x3a')],'resourceId':_0x31c1b9['id'],'type':_0x18cbd4[_0x6780('0x3a')],'sectionId':_0x18cbd4['id']},{})['then'](function(){return _0x497e1e;});}else{return _0x497e1e;}})[_0x6780('0x56')](function(_0x57d215){logger[_0x6780('0x3d')](_0x6780('0x62'),_0x57d215);throw _0x57d215;});}return _0x497e1e;})['then'](respondWithResult(_0x1fecdf,0xc9))[_0x6780('0x56')](handleError(_0x1fecdf,null));};exports[_0x6780('0x63')]=function(_0x4da28b,_0x510068){var _0x1938aa={'where':{'id':_0x4da28b['params']['id']}},_0x31294e={};_0x31294e[_0x6780('0x42')]=_[_0x6780('0x44')](db['VoiceQueue']['rawAttributes']);_0x1938aa[_0x6780('0x48')]=_[_0x6780('0x46')](_0x31294e[_0x6780('0x42')],qs[_0x6780('0x47')](_0x4da28b[_0x6780('0x43')]['fields']));_0x1938aa['attributes']=_0x1938aa['attributes'][_0x6780('0x49')]?_0x1938aa[_0x6780('0x48')]:_0x31294e[_0x6780('0x42')];if(_0x4da28b[_0x6780('0x43')][_0x6780('0x53')]){_0x1938aa[_0x6780('0x59')]=[{'all':!![]}];}_0x1938aa=_['merge']({},_0x1938aa,_0x4da28b['options']);return db[_0x6780('0x40')][_0x6780('0x37')](_0x1938aa)[_0x6780('0x3c')](handleEntityNotFound(_0x510068,null))[_0x6780('0x3c')](function(_0x534585){if(_0x534585){var _0xf4abf7=_0x534585[_0x6780('0x5c')]({'plain':!![]});_0xf4abf7=qs[_0x6780('0x64')](_0xf4abf7,['id',_0x6780('0x65'),_0x6780('0x66')]);_0x4da28b['body']=_['omit'](_0x4da28b[_0x6780('0x67')],['id',_0x6780('0x65'),_0x6780('0x66')]);return db[_0x6780('0x40')][_0x6780('0x5a')](_[_0x6780('0x51')](_0xf4abf7,_0x4da28b[_0x6780('0x67')]),{'include':_0x4da28b['query'][_0x6780('0x53')]?[{'all':!![]}]:undefined})[_0x6780('0x3c')](function(_0x2fa5c8){var _0x5190dc=_0x4da28b[_0x6780('0x5b')][_0x6780('0x5c')]({'plain':!![]});if(!_0x5190dc)throw new Error(_0x6780('0x5d'));if(_0x5190dc[_0x6780('0x5e')]==='user'){var _0x4b0c98=_0x2fa5c8['get']({'plain':!![]});var _0x3b840b=[{'name':_0x6780('0x2f'),'value':_0x6780('0x30')},{'name':_0x6780('0x31'),'value':_0x6780('0x32')}];var _0x220d0a=_['find'](_0x3b840b,[_0x6780('0x38'),_0x4b0c98[_0x6780('0x39')]])[_0x6780('0x3a')];return db['UserProfileSection'][_0x6780('0x37')]({'where':{'name':_0x220d0a,'userProfileId':_0x5190dc[_0x6780('0x60')]},'raw':!![]})[_0x6780('0x3c')](function(_0x210165){if(_0x210165&&_0x210165[_0x6780('0x61')]===0x0){return db['UserProfileResource'][_0x6780('0x5a')]({'name':_0x4b0c98['name'],'resourceId':_0x4b0c98['id'],'type':_0x210165[_0x6780('0x3a')],'sectionId':_0x210165['id']},{})[_0x6780('0x3c')](function(){return _0x2fa5c8;});}else{return _0x2fa5c8;}})[_0x6780('0x56')](function(_0x964d6d){logger[_0x6780('0x3d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x964d6d);throw _0x964d6d;});}return _0x2fa5c8;});}})[_0x6780('0x3c')](respondWithResult(_0x510068,0xc9))[_0x6780('0x56')](handleError(_0x510068,null));};exports[_0x6780('0x2d')]=function(_0x5751be,_0x5b323a){if(_0x5751be[_0x6780('0x67')]['id']){delete _0x5751be[_0x6780('0x67')]['id'];}return db[_0x6780('0x40')][_0x6780('0x37')]({'where':{'id':_0x5751be['params']['id']}})['then'](handleEntityNotFound(_0x5b323a,null))[_0x6780('0x3c')](saveUpdates(_0x5751be[_0x6780('0x67')],null))[_0x6780('0x3c')](respondWithResult(_0x5b323a,null))[_0x6780('0x56')](handleError(_0x5b323a,null));};exports[_0x6780('0x2e')]=function(_0x36e943,_0x541d7f){return db[_0x6780('0x40')]['find']({'where':{'id':_0x36e943[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](handleEntityNotFound(_0x541d7f,null))['then'](removeEntity(_0x541d7f,null))['catch'](handleError(_0x541d7f,null));};exports['getHoppers']=function(_0x17aa9e,_0x291f85,_0xaebb48){var _0xb32720={'raw':![],'where':{}};var _0x39f81e={};var _0x279ddd={'count':0x0,'rows':[]};return db[_0x6780('0x40')][_0x6780('0x68')]({'where':{'id':_0x17aa9e[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](handleEntityNotFound(_0x291f85,null))[_0x6780('0x3c')](function(_0x5e25bb){if(_0x5e25bb){_0x39f81e[_0x6780('0x42')]=_['keys'](db[_0x6780('0x69')][_0x6780('0x58')]);_0x39f81e['query']=_['keys'](_0x17aa9e[_0x6780('0x43')]);_0x39f81e[_0x6780('0x45')]=_['intersection'](_0x39f81e[_0x6780('0x42')],_0x39f81e[_0x6780('0x43')]);_0xb32720[_0x6780('0x48')]=_[_0x6780('0x46')](_0x39f81e[_0x6780('0x42')],qs[_0x6780('0x47')](_0x17aa9e[_0x6780('0x43')][_0x6780('0x47')]));_0xb32720[_0x6780('0x48')]=_0xb32720['attributes'][_0x6780('0x49')]?_0xb32720[_0x6780('0x48')]:_0x39f81e[_0x6780('0x42')];if(!_0x17aa9e['query'][_0x6780('0x4a')](_0x6780('0x4b'))){_0xb32720[_0x6780('0x27')]=qs[_0x6780('0x27')](_0x17aa9e[_0x6780('0x43')][_0x6780('0x27')]);_0xb32720['offset']=qs[_0x6780('0x24')](_0x17aa9e[_0x6780('0x43')]['offset']);}_0xb32720[_0x6780('0x4c')]=qs[_0x6780('0x4d')](_0x17aa9e[_0x6780('0x43')][_0x6780('0x4d')]);_0xb32720[_0x6780('0x4e')]=qs[_0x6780('0x45')](_[_0x6780('0x4f')](_0x17aa9e[_0x6780('0x43')],_0x39f81e['filters']));_0xb32720[_0x6780('0x4e')][_0x6780('0x6a')]=_0x5e25bb['id'];if(_0x17aa9e[_0x6780('0x43')][_0x6780('0x33')]){_0xb32720[_0x6780('0x4e')]=_['merge'](_0xb32720[_0x6780('0x4e')],{'$or':_[_0x6780('0x35')](_0xb32720[_0x6780('0x48')],function(_0x3050b6){var _0xab97f4={};_0xab97f4[_0x3050b6]={'$like':'%'+_0x17aa9e[_0x6780('0x43')][_0x6780('0x33')]+'%'};return _0xab97f4;})});}_0xb32720=_['merge']({},_0xb32720,_0x17aa9e[_0x6780('0x52')]);return db['CmHopper'][_0x6780('0x26')]({'where':_0xb32720[_0x6780('0x4e')]})[_0x6780('0x3c')](function(_0x230b73){_0x279ddd[_0x6780('0x26')]=_0x230b73;if(_0x17aa9e[_0x6780('0x43')][_0x6780('0x53')]){_0xb32720[_0x6780('0x59')]=[{'all':!![]}];}return db[_0x6780('0x69')][_0x6780('0x54')](_0xb32720);})[_0x6780('0x3c')](function(_0x3d84f9){_0x279ddd['rows']=_0x3d84f9;return _0x279ddd;});}})[_0x6780('0x3c')](respondWithFilteredResult(_0x291f85,_0xb32720))[_0x6780('0x56')](handleError(_0x291f85,null));};exports['getHopperHistories']=function(_0x57af04,_0x53760f,_0x1670d4){var _0x2f1a9e={'raw':!![],'where':{}};var _0x21829e={};var _0x1dcdd1={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x57af04[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](handleEntityNotFound(_0x53760f,null))[_0x6780('0x3c')](function(_0xacf44){if(_0xacf44){_0x21829e['model']=_['keys'](db[_0x6780('0x6b')]['rawAttributes']);_0x21829e[_0x6780('0x43')]=_[_0x6780('0x44')](_0x57af04[_0x6780('0x43')]);_0x21829e[_0x6780('0x45')]=_[_0x6780('0x46')](_0x21829e[_0x6780('0x42')],_0x21829e[_0x6780('0x43')]);_0x2f1a9e['attributes']=_[_0x6780('0x46')](_0x21829e['model'],qs[_0x6780('0x47')](_0x57af04[_0x6780('0x43')][_0x6780('0x47')]));_0x2f1a9e['attributes']=_0x2f1a9e[_0x6780('0x48')][_0x6780('0x49')]?_0x2f1a9e[_0x6780('0x48')]:_0x21829e[_0x6780('0x42')];if(!_0x57af04[_0x6780('0x43')][_0x6780('0x4a')](_0x6780('0x4b'))){_0x2f1a9e[_0x6780('0x27')]=qs[_0x6780('0x27')](_0x57af04[_0x6780('0x43')][_0x6780('0x27')]);_0x2f1a9e[_0x6780('0x24')]=qs[_0x6780('0x24')](_0x57af04[_0x6780('0x43')][_0x6780('0x24')]);}_0x2f1a9e[_0x6780('0x4c')]=qs[_0x6780('0x4d')](_0x57af04[_0x6780('0x43')][_0x6780('0x4d')]);_0x2f1a9e[_0x6780('0x4e')]=qs[_0x6780('0x45')](_[_0x6780('0x4f')](_0x57af04[_0x6780('0x43')],_0x21829e[_0x6780('0x45')]));_0x2f1a9e[_0x6780('0x4e')][_0x6780('0x6a')]=_0xacf44['id'];if(_0x57af04[_0x6780('0x43')][_0x6780('0x33')]){_0x2f1a9e['where']=_[_0x6780('0x51')](_0x2f1a9e['where'],{'$or':_[_0x6780('0x35')](_0x2f1a9e[_0x6780('0x48')],function(_0x22095e){var _0x1b992e={};_0x1b992e[_0x22095e]={'$like':'%'+_0x57af04[_0x6780('0x43')][_0x6780('0x33')]+'%'};return _0x1b992e;})});}_0x2f1a9e=_[_0x6780('0x51')]({},_0x2f1a9e,_0x57af04[_0x6780('0x52')]);return db['CmHopperHistory'][_0x6780('0x26')]({'where':_0x2f1a9e[_0x6780('0x4e')]})[_0x6780('0x3c')](function(_0x5c3acb){_0x1dcdd1['count']=_0x5c3acb;if(_0x57af04[_0x6780('0x43')][_0x6780('0x53')]){_0x2f1a9e['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x6780('0x54')](_0x2f1a9e);})[_0x6780('0x3c')](function(_0x3586cb){_0x1dcdd1[_0x6780('0x55')]=_0x3586cb;return _0x1dcdd1;});}})[_0x6780('0x3c')](respondWithFilteredResult(_0x53760f,_0x2f1a9e))[_0x6780('0x56')](handleError(_0x53760f,null));};exports[_0x6780('0x6c')]=function(_0x485317,_0x1b55ef,_0x2c3027){var _0xf6be99={'raw':!![],'where':{}};var _0x12c7c6={};var _0x1e8327={'count':0x0,'rows':[]};return db[_0x6780('0x40')][_0x6780('0x68')]({'where':{'id':_0x485317[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](handleEntityNotFound(_0x1b55ef,null))['then'](function(_0x1f4068){if(_0x1f4068){_0x12c7c6['model']=_[_0x6780('0x44')](db[_0x6780('0x6d')][_0x6780('0x58')]);_0x12c7c6[_0x6780('0x43')]=_[_0x6780('0x44')](_0x485317[_0x6780('0x43')]);_0x12c7c6[_0x6780('0x45')]=_['intersection'](_0x12c7c6[_0x6780('0x42')],_0x12c7c6['query']);_0xf6be99['attributes']=_[_0x6780('0x46')](_0x12c7c6[_0x6780('0x42')],qs[_0x6780('0x47')](_0x485317[_0x6780('0x43')][_0x6780('0x47')]));_0xf6be99[_0x6780('0x48')]=_0xf6be99[_0x6780('0x48')]['length']?_0xf6be99[_0x6780('0x48')]:_0x12c7c6[_0x6780('0x42')];if(!_0x485317[_0x6780('0x43')][_0x6780('0x4a')](_0x6780('0x4b'))){_0xf6be99[_0x6780('0x27')]=qs[_0x6780('0x27')](_0x485317[_0x6780('0x43')][_0x6780('0x27')]);_0xf6be99[_0x6780('0x24')]=qs[_0x6780('0x24')](_0x485317[_0x6780('0x43')][_0x6780('0x24')]);}_0xf6be99[_0x6780('0x4c')]=qs['sort'](_0x485317[_0x6780('0x43')][_0x6780('0x4d')]);_0xf6be99[_0x6780('0x4e')]=qs[_0x6780('0x45')](_['pick'](_0x485317[_0x6780('0x43')],_0x12c7c6['filters']));_0xf6be99[_0x6780('0x4e')][_0x6780('0x6a')]=_0x1f4068['id'];if(_0x485317[_0x6780('0x43')]['filter']){_0xf6be99['where']=_[_0x6780('0x51')](_0xf6be99[_0x6780('0x4e')],{'$or':_[_0x6780('0x35')](_0xf6be99[_0x6780('0x48')],function(_0x33d254){var _0x4d6a9f={};_0x4d6a9f[_0x33d254]={'$like':'%'+_0x485317[_0x6780('0x43')][_0x6780('0x33')]+'%'};return _0x4d6a9f;})});}_0xf6be99=_[_0x6780('0x51')]({},_0xf6be99,_0x485317[_0x6780('0x52')]);return db[_0x6780('0x6d')][_0x6780('0x26')]({'where':_0xf6be99[_0x6780('0x4e')]})[_0x6780('0x3c')](function(_0x53b89d){_0x1e8327[_0x6780('0x26')]=_0x53b89d;if(_0x485317[_0x6780('0x43')][_0x6780('0x53')]){_0xf6be99[_0x6780('0x59')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x6780('0x54')](_0xf6be99);})[_0x6780('0x3c')](function(_0x2d4001){_0x1e8327[_0x6780('0x55')]=_0x2d4001;return _0x1e8327;});}})['then'](respondWithFilteredResult(_0x1b55ef,_0xf6be99))['catch'](handleError(_0x1b55ef,null));};exports[_0x6780('0x6e')]=function(_0x422b74,_0xb94855,_0x3a55f4){var _0xfbdd8a={'raw':!![],'where':{}};var _0x5db542={};var _0x559eb9={'count':0x0,'rows':[]};return db[_0x6780('0x40')][_0x6780('0x68')]({'where':{'id':_0x422b74['params']['id']}})[_0x6780('0x3c')](handleEntityNotFound(_0xb94855,null))['then'](function(_0x20be1b){if(_0x20be1b){_0x5db542['model']=_[_0x6780('0x44')](db[_0x6780('0x6f')][_0x6780('0x58')]);_0x5db542['query']=_[_0x6780('0x44')](_0x422b74['query']);_0x5db542[_0x6780('0x45')]=_['intersection'](_0x5db542[_0x6780('0x42')],_0x5db542[_0x6780('0x43')]);_0xfbdd8a['attributes']=_[_0x6780('0x46')](_0x5db542['model'],qs[_0x6780('0x47')](_0x422b74[_0x6780('0x43')][_0x6780('0x47')]));_0xfbdd8a['attributes']=_0xfbdd8a[_0x6780('0x48')]['length']?_0xfbdd8a['attributes']:_0x5db542[_0x6780('0x42')];if(!_0x422b74['query'][_0x6780('0x4a')](_0x6780('0x4b'))){_0xfbdd8a['limit']=qs[_0x6780('0x27')](_0x422b74[_0x6780('0x43')]['limit']);_0xfbdd8a[_0x6780('0x24')]=qs['offset'](_0x422b74[_0x6780('0x43')][_0x6780('0x24')]);}_0xfbdd8a['order']=qs[_0x6780('0x4d')](_0x422b74[_0x6780('0x43')][_0x6780('0x4d')]);_0xfbdd8a[_0x6780('0x4e')]=qs[_0x6780('0x45')](_[_0x6780('0x4f')](_0x422b74[_0x6780('0x43')],_0x5db542[_0x6780('0x45')]));_0xfbdd8a[_0x6780('0x4e')]['VoiceQueueId']=_0x20be1b['id'];if(_0x422b74['query'][_0x6780('0x33')]){_0xfbdd8a[_0x6780('0x4e')]=_[_0x6780('0x51')](_0xfbdd8a['where'],{'$or':_[_0x6780('0x35')](_0xfbdd8a[_0x6780('0x48')],function(_0x4d580e){var _0x2593ad={};_0x2593ad[_0x4d580e]={'$like':'%'+_0x422b74['query']['filter']+'%'};return _0x2593ad;})});}_0xfbdd8a=_[_0x6780('0x51')]({},_0xfbdd8a,_0x422b74[_0x6780('0x52')]);return db['CmHopperBlack'][_0x6780('0x26')]({'where':_0xfbdd8a['where']})[_0x6780('0x3c')](function(_0x2a5b35){_0x559eb9[_0x6780('0x26')]=_0x2a5b35;if(_0x422b74[_0x6780('0x43')][_0x6780('0x53')]){_0xfbdd8a[_0x6780('0x59')]=[{'all':!![]}];}return db[_0x6780('0x6f')]['findAll'](_0xfbdd8a);})[_0x6780('0x3c')](function(_0x278286){_0x559eb9[_0x6780('0x55')]=_0x278286;return _0x559eb9;});}})[_0x6780('0x3c')](respondWithFilteredResult(_0xb94855,_0xfbdd8a))[_0x6780('0x56')](handleError(_0xb94855,null));};exports[_0x6780('0x70')]=function(_0x2fe612,_0x4e7a8a,_0x1e8f2a){var _0x284b82={};var _0x364ffc={};var _0x369467;var _0x1a049a;return db[_0x6780('0x40')][_0x6780('0x68')]({'where':{'id':_0x2fe612[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](handleEntityNotFound(_0x4e7a8a,null))[_0x6780('0x3c')](function(_0x42bc58){if(_0x42bc58){_0x369467=_0x42bc58;_0x364ffc['model']=_[_0x6780('0x44')](db[_0x6780('0x71')]['rawAttributes']);_0x364ffc[_0x6780('0x43')]=_[_0x6780('0x44')](_0x2fe612['query']);_0x364ffc['filters']=_[_0x6780('0x46')](_0x364ffc[_0x6780('0x42')],_0x364ffc['query']);_0x284b82['attributes']=_['intersection'](_0x364ffc[_0x6780('0x42')],qs['fields'](_0x2fe612[_0x6780('0x43')][_0x6780('0x47')]));_0x284b82[_0x6780('0x48')]=_0x284b82[_0x6780('0x48')][_0x6780('0x49')]?_0x284b82[_0x6780('0x48')]:_0x364ffc[_0x6780('0x42')];_0x284b82[_0x6780('0x4c')]=qs[_0x6780('0x4d')](_0x2fe612[_0x6780('0x43')][_0x6780('0x4d')]);_0x284b82[_0x6780('0x4e')]=qs['filters'](_[_0x6780('0x4f')](_0x2fe612[_0x6780('0x43')],_0x364ffc[_0x6780('0x45')]));if(_0x2fe612[_0x6780('0x43')][_0x6780('0x33')]){_0x284b82[_0x6780('0x4e')]=_['merge'](_0x284b82['where'],{'$or':_['map'](_0x284b82[_0x6780('0x48')],function(_0x17db43){var _0x42055d={};_0x42055d[_0x17db43]={'$like':'%'+_0x2fe612[_0x6780('0x43')][_0x6780('0x33')]+'%'};return _0x42055d;})});}_0x284b82=_['merge']({},_0x284b82,_0x2fe612[_0x6780('0x52')]);return _0x369467['getTeams'](_0x284b82);}})[_0x6780('0x3c')](function(_0x16051b){if(_0x16051b){_0x1a049a=_0x16051b['length'];if(!_0x2fe612[_0x6780('0x43')]['hasOwnProperty']('nolimit')){_0x284b82[_0x6780('0x27')]=qs[_0x6780('0x27')](_0x2fe612[_0x6780('0x43')][_0x6780('0x27')]);_0x284b82[_0x6780('0x24')]=qs['offset'](_0x2fe612[_0x6780('0x43')]['offset']);}return _0x369467[_0x6780('0x70')](_0x284b82);}})[_0x6780('0x3c')](function(_0x52115d){if(_0x52115d){return _0x52115d?{'count':_0x1a049a,'rows':_0x52115d}:null;}})[_0x6780('0x3c')](respondWithResult(_0x4e7a8a,null))[_0x6780('0x56')](handleError(_0x4e7a8a,null));};exports[_0x6780('0x72')]=function(_0x24af80,_0x132a3f,_0x32b73c){var _0x5f3f54=_0x24af80[_0x6780('0x67')][_0x6780('0x73')];var _0x36271f=_[_0x6780('0x35')](_0x5f3f54,'id');return db[_0x6780('0x71')][_0x6780('0x54')]({'where':{'id':_0x36271f},'attributes':['id'],'include':[{'model':db[_0x6780('0x74')],'as':_0x6780('0x75'),'attributes':['id',_0x6780('0x3a'),_0x6780('0x76'),_0x6780('0x77'),'interface'],'raw':!![]}]})[_0x6780('0x3c')](function(_0x36ab3b){if(_0x36ab3b){var _0x55cf4a=_[_0x6780('0x78')](_0x36ab3b,function(_0x4ce4a6){var _0x42b2ef=_0x4ce4a6['get']({'plain':!![]});_0x42b2ef[_0x6780('0x75')][_0x6780('0x79')](function(_0x39bd56){_0x39bd56[_0x6780('0x7a')]=_[_0x6780('0x37')](_0x5f3f54,{'id':_0x42b2ef['id']})[_0x6780('0x7a')];});return _0x42b2ef[_0x6780('0x75')];});return db[_0x6780('0x40')][_0x6780('0x37')]({'where':{'id':_0x24af80[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](function(_0x4dc60c){return db[_0x6780('0x7b')][_0x6780('0x7c')](function(_0x1cd95a){return _0x4dc60c['addTeams'](_0x36271f,{'transaction':_0x1cd95a})[_0x6780('0x3c')](function(){return BPromise[_0x6780('0x7d')](_0x5f3f54,function(_0x5a2ddc){return db[_0x6780('0x7e')][_0x6780('0x7f')]({'TeamId':_0x5a2ddc['id'],'VoiceQueueId':_0x24af80[_0x6780('0x57')]['id'],'penalty':_0x5a2ddc['penalty']},{'transaction':_0x1cd95a});});})[_0x6780('0x3c')](function(){return BPromise[_0x6780('0x7d')](_0x55cf4a,function(_0x199796){return db[_0x6780('0x80')][_0x6780('0x81')]({'where':{'UserId':_0x199796['id'],'VoiceQueueId':_0x24af80[_0x6780('0x57')]['id']},'defaults':{'penalty':_0x199796[_0x6780('0x7a')]},'transaction':_0x1cd95a});});})[_0x6780('0x3c')](function(){return BPromise[_0x6780('0x7d')](_[_0x6780('0x33')](_0x55cf4a,{'online':!![]}),function(_0x177517){return db[_0x6780('0x82')][_0x6780('0x7f')]({'membername':_0x177517['name'],'UserId':_0x177517['id'],'queue_name':_0x4dc60c[_0x6780('0x3a')],'VoiceQueueId':_0x4dc60c['id'],'interface':_[_0x6780('0x83')](_0x177517['interface'])?util[_0x6780('0x84')](_0x6780('0x85'),_0x177517['name']):_0x177517[_0x6780('0x86')],'paused':_0x177517[_0x6780('0x77')]||![],'penalty':_0x177517[_0x6780('0x7a')]},{'transaction':_0x1cd95a});});})['then'](function(){_0x55cf4a[_0x6780('0x79')](function(_0x54b4d6){socket['emit'](_0x6780('0x87'),{'UserId':_0x54b4d6['id'],'VoiceQueueId':_0x4dc60c['id']});});});});});}})[_0x6780('0x3c')](respondWithStatusCode(_0x132a3f,null))[_0x6780('0x56')](handleError(_0x132a3f,null));};exports['removeTeams']=function(_0x1871a7,_0x3caa28,_0x97c53b){return db['Team'][_0x6780('0x54')]({'where':{'id':_0x1871a7[_0x6780('0x43')][_0x6780('0x88')]},'attributes':['id'],'include':[{'model':db[_0x6780('0x74')],'as':_0x6780('0x75'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3caa28,null))[_0x6780('0x3c')](function(_0x12bb1d){var _0x9e5f30=_[_0x6780('0x35')](_0x12bb1d,'id');var _0x12219a=[];var _0x2e4542=[];var _0x413d06=squel[_0x6780('0x89')]();_0x413d06[_0x6780('0x8a')](_0x6780('0x8b'))[_0x6780('0x8c')](_0x6780('0x8d'),'tq')[_0x6780('0x8e')](_0x6780('0x8f'),'ut',_0x6780('0x90'))['where'](_0x6780('0x91'),_0x1871a7['params']['id']);for(var _0x528ed5=0x0;_0x528ed5<_0x12bb1d[_0x6780('0x49')];_0x528ed5+=0x1){let _0x3e409f=_0x12bb1d[_0x528ed5];for(var _0x40c97d=0x0;_0x40c97d<_0x3e409f[_0x6780('0x75')]['length'];_0x40c97d+=0x1){let _0x252633=_0x3e409f[_0x6780('0x75')][_0x40c97d];var _0x58fe7d=_0x413d06[_0x6780('0x63')]();_0x58fe7d['where'](_0x6780('0x92'),_0x252633['id']);_0x2e4542[_0x6780('0x93')](db[_0x6780('0x7b')][_0x6780('0x43')](_0x58fe7d[_0x6780('0x94')](),{'type':db[_0x6780('0x7b')]['QueryTypes'][_0x6780('0x95')]})['then'](function(_0x5cafbb){if(_0x5cafbb['length']===0x1){return _0x252633['id'];}else{var _0x242f70=_[_0x6780('0x96')](_[_0x6780('0x35')](_0x5cafbb,_0x6780('0x97')),function(_0x344b82){return _[_0x6780('0x36')](_0x9e5f30,_0x344b82);});if(_0x242f70){return _0x252633['id'];}}}));}}return BPromise[_0x6780('0x98')](_0x2e4542)[_0x6780('0x3c')](function(_0x32ce2a){_0x12219a=_(_0x12219a)[_0x6780('0x99')](_0x32ce2a)['compact']()['value']();return db[_0x6780('0x40')]['find']({'where':{'id':_0x1871a7[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](function(_0x237c55){return db[_0x6780('0x7b')][_0x6780('0x7c')](function(_0x35ab2b){return _0x237c55[_0x6780('0x9a')](_0x1871a7['query']['ids'],{'transaction':_0x35ab2b})[_0x6780('0x3c')](function(){if(!_[_0x6780('0x9b')](_0x12219a)){return _0x237c55[_0x6780('0x9c')](_0x12219a,{'transaction':_0x35ab2b})[_0x6780('0x3c')](function(){return db[_0x6780('0x82')][_0x6780('0x2e')]({'where':{'VoiceQueueId':_0x1871a7[_0x6780('0x57')]['id'],'UserId':_0x12219a},'transaction':_0x35ab2b});});}})[_0x6780('0x3c')](function(){_0x12219a[_0x6780('0x79')](function(_0x286d34){socket[_0x6780('0x9d')](_0x6780('0x9e'),{'UserId':_0x286d34,'VoiceQueueId':_0x237c55['id']});});});});});});})['then'](respondWithStatusCode(_0x3caa28,null))['catch'](handleError(_0x3caa28,null));};exports[_0x6780('0x9f')]=function(_0x7d8634,_0x4d50b9,_0x2d98ad){var _0x130100,_0x40cf07;return db[_0x6780('0x40')][_0x6780('0x37')]({'where':{'id':_0x7d8634[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](handleEntityNotFound(_0x4d50b9,null))[_0x6780('0x3c')](function(_0x371a7e){if(_0x371a7e){_0x40cf07=_0x371a7e;return _0x371a7e['addAgents'](_0x7d8634[_0x6780('0x67')]['ids'],_[_0x6780('0x64')](_0x7d8634[_0x6780('0x67')],[_0x6780('0x88'),'id'])||{})[_0x6780('0xa0')](function(_0x2b130e){for(var _0x53c3aa=0x0;_0x53c3aa<_0x7d8634[_0x6780('0x67')][_0x6780('0x88')]['length'];_0x53c3aa+=0x1){socket[_0x6780('0x9d')](_0x6780('0x87'),{'UserId':Number(_0x7d8634['body']['ids'][_0x53c3aa]),'VoiceQueueId':Number(_0x7d8634['params']['id'])});}return _0x2b130e;});}})[_0x6780('0x3c')](function(_0xe33edb){_0x130100=_0xe33edb||[];if(_0x40cf07){return db[_0x6780('0x74')][_0x6780('0x54')]({'where':{'id':_0x7d8634[_0x6780('0x67')][_0x6780('0x88')]},'attributes':['id',_0x6780('0x3a'),_0x6780('0x76'),_0x6780('0x77'),_0x6780('0x86')],'raw':!![]});}})[_0x6780('0x3c')](function(_0x3f9542){if(!_[_0x6780('0x9b')](_0x3f9542)){var _0x2a03bc=[];for(var _0xaaa693=0x0;_0xaaa693<_0x3f9542[_0x6780('0x49')];_0xaaa693++){if(_0x3f9542[_0xaaa693][_0x6780('0x76')]){_0x2a03bc[_0x6780('0x93')](db['UserVoiceQueueRt'][_0x6780('0x7f')]({'membername':_0x3f9542[_0xaaa693][_0x6780('0x3a')],'UserId':_0x3f9542[_0xaaa693]['id'],'queue_name':_0x40cf07['name'],'VoiceQueueId':_0x40cf07['id'],'interface':_[_0x6780('0x83')](_0x3f9542[_0xaaa693][_0x6780('0x86')])?util[_0x6780('0x84')](_0x6780('0x85'),_0x3f9542[_0xaaa693]['name']):_0x3f9542[_0xaaa693]['interface'],'paused':_0x3f9542[_0xaaa693][_0x6780('0x77')]||![],'penalty':_0x7d8634[_0x6780('0x67')]['penalty']||0x0}));}}return BPromise['all'](_0x2a03bc);}})['then'](function(){return _0x130100;})[_0x6780('0x3c')](respondWithResult(_0x4d50b9,null))[_0x6780('0x56')](handleError(_0x4d50b9,null));};exports[_0x6780('0x9c')]=function(_0x4807b9,_0x136f5f,_0x57172f){return db[_0x6780('0x40')]['find']({'where':{'id':_0x4807b9[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](handleEntityNotFound(_0x136f5f,null))[_0x6780('0x3c')](function(_0x20047d){if(_0x20047d){return _0x20047d[_0x6780('0x9c')](_0x4807b9[_0x6780('0x43')][_0x6780('0x88')])['then'](function(){if(_[_0x6780('0xa1')](_0x4807b9[_0x6780('0x43')][_0x6780('0x88')])){for(var _0x3aed9f=0x0;_0x3aed9f<_0x4807b9[_0x6780('0x43')][_0x6780('0x88')]['length'];_0x3aed9f+=0x1){socket['emit'](_0x6780('0x9e'),{'UserId':Number(_0x4807b9[_0x6780('0x43')][_0x6780('0x88')][_0x3aed9f]),'VoiceQueueId':Number(_0x4807b9['params']['id'])});}}else{socket[_0x6780('0x9d')]('userVoiceQueue:remove',{'UserId':Number(_0x4807b9[_0x6780('0x43')][_0x6780('0x88')]),'VoiceQueueId':Number(_0x4807b9[_0x6780('0x57')]['id'])});}});}})[_0x6780('0x3c')](function(_0x33eccb){return db['UserVoiceQueueRt'][_0x6780('0x2e')]({'where':{'VoiceQueueId':_0x4807b9['params']['id'],'UserId':_0x4807b9[_0x6780('0x43')][_0x6780('0x88')]}})[_0x6780('0x3c')](function(){return _0x33eccb;});})[_0x6780('0x3c')](respondWithStatusCode(_0x136f5f,null))['catch'](handleError(_0x136f5f,null));};exports['getAgents']=function(_0x40c519,_0x17d3e3,_0x354ed9){var _0x5e9a93={};var _0x1372fa={};var _0x215831;var _0x280664;return db[_0x6780('0x40')][_0x6780('0x68')]({'where':{'id':_0x40c519['params']['id']}})[_0x6780('0x3c')](handleEntityNotFound(_0x17d3e3,null))[_0x6780('0x3c')](function(_0x43dfab){if(_0x43dfab){_0x215831=_0x43dfab;_0x1372fa['model']=_[_0x6780('0x44')](db[_0x6780('0x74')]['rawAttributes']);_0x1372fa[_0x6780('0x43')]=_[_0x6780('0x44')](_0x40c519[_0x6780('0x43')]);_0x1372fa['filters']=_[_0x6780('0x46')](_0x1372fa['model'],_0x1372fa[_0x6780('0x43')]);_0x5e9a93[_0x6780('0x48')]=_['intersection'](_0x1372fa[_0x6780('0x42')],qs[_0x6780('0x47')](_0x40c519[_0x6780('0x43')]['fields']));_0x5e9a93[_0x6780('0x48')]=_0x5e9a93[_0x6780('0x48')][_0x6780('0x49')]?_0x5e9a93['attributes']:_0x1372fa[_0x6780('0x42')];_0x5e9a93['order']=qs[_0x6780('0x4d')](_0x40c519[_0x6780('0x43')]['sort']);_0x5e9a93['where']=qs[_0x6780('0x45')](_['pick'](_0x40c519[_0x6780('0x43')],_0x1372fa['filters']));if(_0x40c519[_0x6780('0x43')]['filter']){_0x5e9a93[_0x6780('0x4e')]=_[_0x6780('0x51')](_0x5e9a93[_0x6780('0x4e')],{'$or':_[_0x6780('0x35')](_0x5e9a93[_0x6780('0x48')],function(_0x164763){var _0x332343={};_0x332343[_0x164763]={'$like':'%'+_0x40c519[_0x6780('0x43')]['filter']+'%'};return _0x332343;})});}_0x5e9a93=_['merge']({},_0x5e9a93,_0x40c519[_0x6780('0x52')]);return _0x215831[_0x6780('0xa2')](_0x5e9a93);}})[_0x6780('0x3c')](function(_0x3d554f){if(_0x3d554f){_0x280664=_0x3d554f[_0x6780('0x49')];if(!_0x40c519[_0x6780('0x43')]['hasOwnProperty'](_0x6780('0x4b'))){_0x5e9a93[_0x6780('0x27')]=qs[_0x6780('0x27')](_0x40c519[_0x6780('0x43')][_0x6780('0x27')]);_0x5e9a93['offset']=qs[_0x6780('0x24')](_0x40c519[_0x6780('0x43')][_0x6780('0x24')]);}return _0x215831[_0x6780('0xa2')](_0x5e9a93);}})[_0x6780('0x3c')](function(_0x5ed8a0){if(_0x5ed8a0){return _0x5ed8a0?{'count':_0x280664,'rows':_0x5ed8a0}:null;}})[_0x6780('0x3c')](respondWithResult(_0x17d3e3,null))[_0x6780('0x56')](handleError(_0x17d3e3,null));};exports[_0x6780('0xa3')]=function(_0x105f76,_0x5006bd,_0x50f2cd){var _0x363359={};var _0x20ff43={};var _0x33228d;var _0x43a737;return db[_0x6780('0x40')][_0x6780('0x68')]({'where':{'id':_0x105f76[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](handleEntityNotFound(_0x5006bd,null))['then'](function(_0x445f62){if(_0x445f62){_0x33228d=_0x445f62;_0x20ff43[_0x6780('0x42')]=_[_0x6780('0x44')](db['UserVoiceQueueRt'][_0x6780('0x58')]);_0x20ff43[_0x6780('0x43')]=_['keys'](_0x105f76[_0x6780('0x43')]);_0x20ff43[_0x6780('0x45')]=_[_0x6780('0x46')](_0x20ff43[_0x6780('0x42')],_0x20ff43['query']);_0x363359[_0x6780('0x48')]=_[_0x6780('0x46')](_0x20ff43[_0x6780('0x42')],qs[_0x6780('0x47')](_0x105f76['query']['fields']));_0x363359['attributes']=_0x363359['attributes'][_0x6780('0x49')]?_0x363359['attributes']:_0x20ff43[_0x6780('0x42')];_0x363359[_0x6780('0x4c')]=qs['sort'](_0x105f76[_0x6780('0x43')]['sort']);_0x363359['where']=qs[_0x6780('0x45')](_[_0x6780('0x4f')](_0x105f76[_0x6780('0x43')],_0x20ff43[_0x6780('0x45')]));if(_0x105f76[_0x6780('0x43')][_0x6780('0x33')]){_0x363359['where']=_['merge'](_0x363359[_0x6780('0x4e')],{'$or':_['map'](_0x363359[_0x6780('0x48')],function(_0x170fe7){var _0x5a7eab={};_0x5a7eab[_0x170fe7]={'$like':'%'+_0x105f76[_0x6780('0x43')][_0x6780('0x33')]+'%'};return _0x5a7eab;})});}_0x363359=_[_0x6780('0x51')]({},_0x363359,_0x105f76[_0x6780('0x52')]);return _0x33228d[_0x6780('0xa3')](_0x363359);}})[_0x6780('0x3c')](function(_0x35864e){if(_0x35864e){_0x43a737=_0x35864e[_0x6780('0x49')];if(!_0x105f76[_0x6780('0x43')][_0x6780('0x4a')](_0x6780('0x4b'))){_0x363359[_0x6780('0x27')]=qs['limit'](_0x105f76[_0x6780('0x43')]['limit']);_0x363359[_0x6780('0x24')]=qs['offset'](_0x105f76[_0x6780('0x43')][_0x6780('0x24')]);}return _0x33228d[_0x6780('0xa3')](_0x363359);}})[_0x6780('0x3c')](function(_0x27e683){return _0x27e683?{'count':_0x43a737,'rows':_0x27e683}:null;})[_0x6780('0x3c')](respondWithResult(_0x5006bd,null))[_0x6780('0x56')](handleError(_0x5006bd,null));};exports[_0x6780('0xa4')]=function(_0x29d456,_0x551f90,_0x188957){var _0x1b92fa={};var _0x43a39f={};var _0x53d643;var _0x2d306f;return db[_0x6780('0x40')]['findOne']({'where':{'id':_0x29d456[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](handleEntityNotFound(_0x551f90,null))[_0x6780('0x3c')](function(_0x927712){if(_0x927712){_0x53d643=_0x927712;_0x43a39f[_0x6780('0x42')]=_[_0x6780('0x44')](db[_0x6780('0xa5')][_0x6780('0x58')]);_0x43a39f[_0x6780('0x43')]=_[_0x6780('0x44')](_0x29d456[_0x6780('0x43')]);_0x43a39f[_0x6780('0x45')]=_[_0x6780('0x46')](_0x43a39f[_0x6780('0x42')],_0x43a39f[_0x6780('0x43')]);_0x1b92fa['attributes']=_[_0x6780('0x46')](_0x43a39f['model'],qs[_0x6780('0x47')](_0x29d456[_0x6780('0x43')][_0x6780('0x47')]));_0x1b92fa[_0x6780('0x48')]=_0x1b92fa[_0x6780('0x48')][_0x6780('0x49')]?_0x1b92fa[_0x6780('0x48')]:_0x43a39f['model'];_0x1b92fa[_0x6780('0x4c')]=qs[_0x6780('0x4d')](_0x29d456[_0x6780('0x43')][_0x6780('0x4d')]);_0x1b92fa[_0x6780('0x4e')]=qs['filters'](_[_0x6780('0x4f')](_0x29d456['query'],_0x43a39f[_0x6780('0x45')]));if(_0x29d456[_0x6780('0x43')][_0x6780('0x33')]){_0x1b92fa[_0x6780('0x4e')]=_[_0x6780('0x51')](_0x1b92fa[_0x6780('0x4e')],{'$or':_[_0x6780('0x35')](_0x1b92fa[_0x6780('0x48')],function(_0x30b06a){var _0x2b58f6={};_0x2b58f6[_0x30b06a]={'$like':'%'+_0x29d456[_0x6780('0x43')][_0x6780('0x33')]+'%'};return _0x2b58f6;})});}_0x1b92fa=_[_0x6780('0x51')]({},_0x1b92fa,_0x29d456[_0x6780('0x52')]);return _0x53d643[_0x6780('0xa4')](_0x1b92fa);}})['then'](function(_0x13a82e){if(_0x13a82e){_0x2d306f=_0x13a82e[_0x6780('0x49')];if(!_0x29d456[_0x6780('0x43')][_0x6780('0x4a')]('nolimit')){_0x1b92fa['limit']=qs[_0x6780('0x27')](_0x29d456[_0x6780('0x43')]['limit']);_0x1b92fa[_0x6780('0x24')]=qs[_0x6780('0x24')](_0x29d456[_0x6780('0x43')][_0x6780('0x24')]);}return _0x53d643[_0x6780('0xa4')](_0x1b92fa);}})[_0x6780('0x3c')](function(_0x623816){if(_0x623816){return _0x623816?{'count':_0x2d306f,'rows':_0x623816}:null;}})[_0x6780('0x3c')](respondWithResult(_0x551f90,null))[_0x6780('0x56')](handleError(_0x551f90,null));};exports[_0x6780('0xa6')]=function(_0x12ae0d,_0x49b182,_0x3b0c69){var _0x8ece28,_0x425561;return db[_0x6780('0x40')][_0x6780('0x37')]({'where':{'id':_0x12ae0d[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](handleEntityNotFound(_0x49b182,null))[_0x6780('0x3c')](function(_0x1b7773){if(_0x1b7773){_0x425561=_0x1b7773;return _0x1b7773['addLists'](_0x12ae0d[_0x6780('0x67')][_0x6780('0x88')],_[_0x6780('0x64')](_0x12ae0d['body'],[_0x6780('0x88'),'id'])||{});}return null;})[_0x6780('0xa0')](function(_0xac353){var _0x4f3cb2;_0x8ece28=_0xac353||[];var _0x33a7df=[];if(_0xac353){for(var _0xcd2f83=0x0;_0xcd2f83<_0xac353[_0x6780('0x49')];_0xcd2f83+=0x1){var _0x22c22e=_0xac353[_0xcd2f83]['get']({'plain':!![]});_0x425561[_0x6780('0xa7')]=_0x12ae0d['body'][_0x6780('0xa7')]?_0x12ae0d[_0x6780('0x67')]['dialCheckDuplicateType']:_0x425561[_0x6780('0xa7')];switch(_0x425561[_0x6780('0xa7')]){case'always':_0x4f3cb2=squel[_0x6780('0xa8')]()['into'](_0x6780('0xa9'))[_0x6780('0xaa')]([_0x6780('0xab'),_0x6780('0xac'),_0x6780('0xad'),_0x6780('0xae'),_0x6780('0x6a'),_0x6780('0x65'),_0x6780('0x66')],squel[_0x6780('0x89')]()[_0x6780('0x8a')](_0x6780('0xab'),_0x6780('0xab'))['field'](_0x6780('0xaf'),_0x6780('0xac'))['field']('id',_0x6780('0xad'))['field'](_0x22c22e['CmListId'][_0x6780('0x94')](),_0x6780('0xae'))[_0x6780('0x8a')](_0x12ae0d[_0x6780('0x57')]['id'][_0x6780('0x94')](),_0x6780('0x6a'))['field'](_0x6780('0xaf'),_0x6780('0x65'))[_0x6780('0x8a')](_0x6780('0xaf'),'updatedAt')[_0x6780('0x8c')](_0x6780('0xb0'))[_0x6780('0x4e')](_0x6780('0xb1'))[_0x6780('0x4e')]('ListId\x20=\x20?',_0x22c22e[_0x6780('0xb2')][_0x6780('0x94')]())[_0x6780('0x4e')](_0x6780('0xb3'))[_0x6780('0x4e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6780('0x89')]()[_0x6780('0x8a')](_0x6780('0xb4'))[_0x6780('0x8c')](_0x6780('0xb5'))[_0x6780('0x4e')](_0x6780('0x91'),_0x12ae0d[_0x6780('0x57')]['id']['toString']()))[_0x6780('0x4e')](_0x6780('0xb6'),squel[_0x6780('0x89')]()[_0x6780('0x8a')]('COALESCE(phone,\x27\x27)')[_0x6780('0x8c')]('cm_hopper')[_0x6780('0x4e')]('VoiceQueueId\x20=\x20?',_0x12ae0d['params']['id'][_0x6780('0x94')]())))[_0x6780('0x94')]();break;case _0x6780('0xb7'):_0x4f3cb2=squel[_0x6780('0xa8')]()[_0x6780('0xb8')](_0x6780('0xa9'))[_0x6780('0xaa')]([_0x6780('0xab'),_0x6780('0xac'),_0x6780('0xad'),_0x6780('0xae'),_0x6780('0x6a'),_0x6780('0x65'),_0x6780('0x66')],squel[_0x6780('0x89')]()[_0x6780('0x8a')]('phone',_0x6780('0xab'))[_0x6780('0x8a')](_0x6780('0xaf'),'scheduledAt')['field']('id',_0x6780('0xad'))[_0x6780('0x8a')](_0x22c22e[_0x6780('0xb2')]['toString'](),_0x6780('0xae'))[_0x6780('0x8a')](_0x12ae0d[_0x6780('0x57')]['id']['toString'](),_0x6780('0x6a'))[_0x6780('0x8a')](_0x6780('0xaf'),'createdAt')['field'](_0x6780('0xaf'),_0x6780('0x66'))[_0x6780('0x8c')](_0x6780('0xb0'))[_0x6780('0x4e')](_0x6780('0xb1'))[_0x6780('0x4e')](_0x6780('0xb9'),_0x22c22e[_0x6780('0xb2')][_0x6780('0x94')]())['where'](_0x6780('0xb3'))[_0x6780('0x4e')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x6780('0x8a')](_0x6780('0xba'))['from'](_0x6780('0xa9'))[_0x6780('0x4e')](_0x6780('0x91'),_0x12ae0d['params']['id'][_0x6780('0x94')]())))[_0x6780('0x94')]();break;default:_0x4f3cb2=squel['insert']()[_0x6780('0xb8')](_0x6780('0xa9'))[_0x6780('0xaa')]([_0x6780('0xab'),_0x6780('0xac'),_0x6780('0xad'),_0x6780('0xae'),_0x6780('0x6a'),'createdAt','updatedAt'],squel[_0x6780('0x89')]()[_0x6780('0x8a')]('phone',_0x6780('0xab'))[_0x6780('0x8a')]('NOW()',_0x6780('0xac'))[_0x6780('0x8a')]('id',_0x6780('0xad'))[_0x6780('0x8a')](_0x22c22e['CmListId'][_0x6780('0x94')](),_0x6780('0xae'))[_0x6780('0x8a')](_0x12ae0d[_0x6780('0x57')]['id'][_0x6780('0x94')](),_0x6780('0x6a'))[_0x6780('0x8a')](_0x6780('0xaf'),'createdAt')[_0x6780('0x8a')](_0x6780('0xaf'),_0x6780('0x66'))[_0x6780('0x8c')]('cm_contacts')[_0x6780('0x4e')](_0x6780('0xb1'))[_0x6780('0x4e')](_0x6780('0xb9'),_0x22c22e[_0x6780('0xb2')][_0x6780('0x94')]())[_0x6780('0x4e')](_0x6780('0xb3')))[_0x6780('0x94')]();}_0x33a7df[_0x6780('0x93')](db['sequelize']['query'](_0x4f3cb2));}return BPromise['all'](_0x33a7df);}})[_0x6780('0x3c')](function(){return _0x8ece28;})['then'](respondWithResult(_0x49b182,null))['catch'](handleError(_0x49b182,null));};exports[_0x6780('0xbb')]=function(_0x1ba2a3,_0x2f1def,_0x3a4d68){return db['VoiceQueue']['find']({'where':{'id':_0x1ba2a3[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](handleEntityNotFound(_0x2f1def,null))[_0x6780('0x3c')](function(_0x285de3){if(_0x285de3){return _0x285de3[_0x6780('0xbb')](_0x1ba2a3[_0x6780('0x43')][_0x6780('0x88')]);}})[_0x6780('0x3c')](function(_0x5db364){if(_0x5db364){return db[_0x6780('0x69')][_0x6780('0x2e')]({'where':{'ListId':_0x1ba2a3[_0x6780('0x43')][_0x6780('0x88')],'VoiceQueueId':_0x1ba2a3[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](function(){return _0x5db364;});}})[_0x6780('0x3c')](respondWithStatusCode(_0x2f1def,null))[_0x6780('0x56')](handleError(_0x2f1def,null));};exports[_0x6780('0xbc')]=function(_0x247832,_0x130695,_0x116e3e){var _0xaa2e0b={};var _0x15d79f={};var _0x358c31;var _0x4d73fb;return db[_0x6780('0x40')][_0x6780('0x68')]({'where':{'id':_0x247832[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](handleEntityNotFound(_0x130695,null))['then'](function(_0x576461){if(_0x576461){_0x358c31=_0x576461;_0x15d79f[_0x6780('0x42')]=_[_0x6780('0x44')](db['CmList'][_0x6780('0x58')]);_0x15d79f[_0x6780('0x43')]=_[_0x6780('0x44')](_0x247832[_0x6780('0x43')]);_0x15d79f[_0x6780('0x45')]=_['intersection'](_0x15d79f[_0x6780('0x42')],_0x15d79f['query']);_0xaa2e0b[_0x6780('0x48')]=_['intersection'](_0x15d79f[_0x6780('0x42')],qs[_0x6780('0x47')](_0x247832[_0x6780('0x43')][_0x6780('0x47')]));_0xaa2e0b[_0x6780('0x48')]=_0xaa2e0b['attributes'][_0x6780('0x49')]?_0xaa2e0b[_0x6780('0x48')]:_0x15d79f[_0x6780('0x42')];_0xaa2e0b[_0x6780('0x4c')]=qs[_0x6780('0x4d')](_0x247832[_0x6780('0x43')][_0x6780('0x4d')]);_0xaa2e0b[_0x6780('0x4e')]=qs[_0x6780('0x45')](_[_0x6780('0x4f')](_0x247832['query'],_0x15d79f[_0x6780('0x45')]));if(_0x247832['query']['filter']){_0xaa2e0b[_0x6780('0x4e')]=_[_0x6780('0x51')](_0xaa2e0b[_0x6780('0x4e')],{'$or':_[_0x6780('0x35')](_0xaa2e0b[_0x6780('0x48')],function(_0x26e35b){var _0x4b3a51={};_0x4b3a51[_0x26e35b]={'$like':'%'+_0x247832[_0x6780('0x43')]['filter']+'%'};return _0x4b3a51;})});}_0xaa2e0b=_['merge']({},_0xaa2e0b,_0x247832[_0x6780('0x52')]);return _0x358c31[_0x6780('0xbc')](_0xaa2e0b);}})[_0x6780('0x3c')](function(_0x1d97e0){if(_0x1d97e0){_0x4d73fb=_0x1d97e0['length'];if(!_0x247832[_0x6780('0x43')][_0x6780('0x4a')](_0x6780('0x4b'))){_0xaa2e0b['limit']=qs[_0x6780('0x27')](_0x247832[_0x6780('0x43')][_0x6780('0x27')]);_0xaa2e0b[_0x6780('0x24')]=qs['offset'](_0x247832['query'][_0x6780('0x24')]);}return _0x358c31[_0x6780('0xbc')](_0xaa2e0b);}})[_0x6780('0x3c')](function(_0x36837a){if(_0x36837a){return _0x36837a?{'count':_0x4d73fb,'rows':_0x36837a}:null;}})[_0x6780('0x3c')](respondWithResult(_0x130695,null))[_0x6780('0x56')](handleError(_0x130695,null));};exports['addBlackLists']=function(_0x32b8d9,_0x1751d5,_0x3fe7f7){var _0x410ddf,_0x1ce2d2;return db[_0x6780('0x40')][_0x6780('0x37')]({'where':{'id':_0x32b8d9[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](handleEntityNotFound(_0x1751d5,null))[_0x6780('0x3c')](function(_0x330867){if(_0x330867){_0x1ce2d2=_0x330867;return _0x330867[_0x6780('0xbd')](_0x32b8d9[_0x6780('0x67')]['ids'],_[_0x6780('0x64')](_0x32b8d9['body'],[_0x6780('0x88'),'id'])||{});}return null;})[_0x6780('0xa0')](function(_0x496392){var _0x402482;_0x410ddf=_0x496392||[];var _0x4079c1=[];if(_0x496392){for(var _0x1b8c26=0x0;_0x1b8c26<_0x496392[_0x6780('0x49')];_0x1b8c26+=0x1){var _0xe3986a=_0x496392[_0x1b8c26][_0x6780('0x5c')]({'plain':!![]});_0x402482=squel[_0x6780('0xa8')]()['into'](_0x6780('0xbe'))['fromQuery']([_0x6780('0xab'),_0x6780('0xad'),_0x6780('0xae'),'VoiceQueueId','createdAt',_0x6780('0x66')],squel['select']()[_0x6780('0x8a')](_0x6780('0xab'),_0x6780('0xab'))[_0x6780('0x8a')]('id',_0x6780('0xad'))[_0x6780('0x8a')](_0xe3986a[_0x6780('0xb2')][_0x6780('0x94')](),_0x6780('0xae'))['field'](_0x32b8d9['params']['id'][_0x6780('0x94')](),_0x6780('0x6a'))[_0x6780('0x8a')](_0x6780('0xaf'),_0x6780('0x65'))[_0x6780('0x8a')]('NOW()',_0x6780('0x66'))[_0x6780('0x8c')](_0x6780('0xb0'))[_0x6780('0x4e')](_0x6780('0xb1'))['where'](_0x6780('0xb9'),_0xe3986a['CmListId'][_0x6780('0x94')]())[_0x6780('0x4e')](_0x6780('0xb3')))[_0x6780('0x94')]();_0x4079c1[_0x6780('0x93')](db[_0x6780('0x7b')][_0x6780('0x43')](_0x402482));}return BPromise[_0x6780('0x98')](_0x4079c1);}})[_0x6780('0x3c')](function(){return _0x410ddf;})[_0x6780('0x3c')](respondWithResult(_0x1751d5,null))[_0x6780('0x56')](handleError(_0x1751d5,null));};exports[_0x6780('0xbf')]=function(_0x4e229b,_0x582de9,_0x47af9d){return db[_0x6780('0x40')]['find']({'where':{'id':_0x4e229b[_0x6780('0x57')]['id']}})[_0x6780('0x3c')](handleEntityNotFound(_0x582de9,null))['then'](function(_0x5ec3eb){if(_0x5ec3eb){return _0x5ec3eb[_0x6780('0xbf')](_0x4e229b['query']['ids']);}})[_0x6780('0x3c')](function(_0xa71058){if(_0xa71058){return db[_0x6780('0x6f')][_0x6780('0x2e')]({'where':{'ListId':_0x4e229b[_0x6780('0x43')][_0x6780('0x88')],'VoiceQueueId':_0x4e229b['params']['id']}})[_0x6780('0x3c')](function(){return _0xa71058;});}})[_0x6780('0x3c')](respondWithStatusCode(_0x582de9,null))[_0x6780('0x56')](handleError(_0x582de9,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 0064ee4..2e693b5 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 _0x2f27=['hook','events','../../mysqldb','VoiceQueue','remove','emit'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x2f27,0x13f));var _0x72f2=function(_0x56d05b,_0x1d0c24){_0x56d05b=_0x56d05b-0x0;var _0x471202=_0x2f27[_0x56d05b];return _0x471202;};'use strict';var EventEmitter=require(_0x72f2('0x0'));var VoiceQueue=require(_0x72f2('0x1'))['db'][_0x72f2('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x72f2('0x3')};function emitEvent(_0x40538a){return function(_0x5ee688,_0x5c6b66,_0x3a98aa){VoiceQueueEvents[_0x72f2('0x4')](_0x40538a+':'+_0x5ee688['id'],_0x5ee688);VoiceQueueEvents[_0x72f2('0x4')](_0x40538a,_0x5ee688);_0x3a98aa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x72f2('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0xcea7=['events','../../mysqldb','emit','hasOwnProperty','hook','exports'];(function(_0x179b54,_0x2ea9e4){var _0x39dddd=function(_0x219b63){while(--_0x219b63){_0x179b54['push'](_0x179b54['shift']());}};_0x39dddd(++_0x2ea9e4);}(_0xcea7,0x17a));var _0x7cea=function(_0x3edd48,_0x1be168){_0x3edd48=_0x3edd48-0x0;var _0x1ae654=_0xcea7[_0x3edd48];return _0x1ae654;};'use strict';var EventEmitter=require(_0x7cea('0x0'));var VoiceQueue=require(_0x7cea('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x30346b){return function(_0x53956c,_0x4ab88c,_0xda96f0){VoiceQueueEvents[_0x7cea('0x2')](_0x30346b+':'+_0x53956c['id'],_0x53956c);VoiceQueueEvents[_0x7cea('0x2')](_0x30346b,_0x53956c);_0xda96f0(null);};}for(var e in events){if(events[_0x7cea('0x3')](e)){var event=events[e];VoiceQueue[_0x7cea('0x4')](e,emitEvent(event));}}module[_0x7cea('0x5')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 06de117..022f260 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 _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x2fa3ea,_0x513bac){var _0x205155=function(_0x135052){while(--_0x135052){_0x2fa3ea['push'](_0x2fa3ea['shift']());}};_0x205155(++_0x513bac);}(_0x34e8,0x12c));var _0x834e=function(_0x23015c,_0x14ceda){_0x23015c=_0x23015c-0x0;var _0x2ec345=_0x34e8[_0x23015c];return _0x2ec345;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x508926,_0xa05b4f){var _0x49ab00=function(_0x360b74){while(--_0x360b74){_0x508926['push'](_0x508926['shift']());}};_0x49ab00(++_0xa05b4f);}(_0x008c,0x188));var _0xc008=function(_0x5f23d9,_0x431d9a){_0x5f23d9=_0x5f23d9-0x0;var _0x68fb9e=_0x008c[_0x5f23d9];return _0x68fb9e;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 17f29b3..8f76fa9 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 _0xcf31=['localhost','socket.io-emitter','./voiceQueue.socket','request','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','info','result','catch','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','GetVoiceQueue','ShowVoiceQueue','find','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults'];(function(_0x2329de,_0x2e2400){var _0x38a88d=function(_0x59db2c){while(--_0x59db2c){_0x2329de['push'](_0x2329de['shift']());}};_0x38a88d(++_0x2e2400);}(_0xcf31,0x95));var _0x1cf3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcf31[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cf3('0x0'));var BPromise=require('bluebird');var rs=require(_0x1cf3('0x1'));var fs=require('fs');var Redis=require(_0x1cf3('0x2'));var db=require(_0x1cf3('0x3'))['db'];var utils=require(_0x1cf3('0x4'));var logger=require(_0x1cf3('0x5'))(_0x1cf3('0x6'));var config=require('../../config/environment');var jayson=require(_0x1cf3('0x7'));var client=jayson[_0x1cf3('0x8')]['http']({'port':0x232a});config[_0x1cf3('0x9')]=_[_0x1cf3('0xa')](config[_0x1cf3('0x9')],{'host':_0x1cf3('0xb'),'port':0x18eb});var socket=require(_0x1cf3('0xc'))(new Redis(config[_0x1cf3('0x9')]));require(_0x1cf3('0xd'))['register'](socket);function respondWithRpcPromise(_0x55fdc0,_0x5bd5e7,_0xc7e4a8){return new BPromise(function(_0xdd1950,_0x2a5e1d){return client[_0x1cf3('0xe')](_0x55fdc0,_0xc7e4a8)['then'](function(_0xb869d9){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x5bd5e7,_0x1cf3('0xf'));logger[_0x1cf3('0x10')](_0x1cf3('0x11'),_0x5bd5e7,_0x1cf3('0xf'),JSON[_0x1cf3('0x12')](_0xb869d9));if(_0xb869d9[_0x1cf3('0x13')]){if(_0xb869d9[_0x1cf3('0x13')][_0x1cf3('0x14')]===0x1f4){logger[_0x1cf3('0x13')](_0x1cf3('0x15'),_0x5bd5e7,_0xb869d9[_0x1cf3('0x13')][_0x1cf3('0x16')]);return _0x2a5e1d(_0xb869d9[_0x1cf3('0x13')][_0x1cf3('0x16')]);}logger[_0x1cf3('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x5bd5e7,_0xb869d9['error'][_0x1cf3('0x16')]);return _0xdd1950(_0xb869d9[_0x1cf3('0x13')][_0x1cf3('0x16')]);}else{logger[_0x1cf3('0x17')](_0x1cf3('0x15'),_0x5bd5e7,_0x1cf3('0xf'));_0xdd1950(_0xb869d9[_0x1cf3('0x18')]['message']);}})[_0x1cf3('0x19')](function(_0x2ffb8f){logger['error'](_0x1cf3('0x15'),_0x5bd5e7,_0x2ffb8f);_0x2a5e1d(_0x2ffb8f);});});}exports['GetVoiceQueue']=function(_0x2ea62e){var _0x86b6e3=this;return new Promise(function(_0x2afb3b,_0xf95f4b){return db[_0x1cf3('0x1a')][_0x1cf3('0x1b')]({'raw':_0x2ea62e[_0x1cf3('0x1c')]?_0x2ea62e[_0x1cf3('0x1c')][_0x1cf3('0x1d')]===undefined?!![]:![]:!![],'where':_0x2ea62e['options']?_0x2ea62e[_0x1cf3('0x1c')][_0x1cf3('0x1e')]||null:null,'attributes':_0x2ea62e[_0x1cf3('0x1c')]?_0x2ea62e['options'][_0x1cf3('0x1f')]||null:null,'limit':_0x2ea62e[_0x1cf3('0x1c')]?_0x2ea62e[_0x1cf3('0x1c')][_0x1cf3('0x20')]||null:null,'include':_0x2ea62e[_0x1cf3('0x1c')]?_0x2ea62e['options'][_0x1cf3('0x21')]?_[_0x1cf3('0x22')](_0x2ea62e[_0x1cf3('0x1c')]['include'],function(_0x3ff8e7){return{'model':db[_0x3ff8e7[_0x1cf3('0x23')]],'as':_0x3ff8e7['as'],'attributes':_0x3ff8e7[_0x1cf3('0x1f')],'include':_0x3ff8e7[_0x1cf3('0x21')]?_[_0x1cf3('0x22')](_0x3ff8e7[_0x1cf3('0x21')],function(_0x2c9cfe){return{'model':db[_0x2c9cfe['model']],'as':_0x2c9cfe['as'],'attributes':_0x2c9cfe[_0x1cf3('0x1f')],'include':_0x2c9cfe[_0x1cf3('0x21')]?_[_0x1cf3('0x22')](_0x2c9cfe['include'],function(_0x1bbf44){return{'model':db[_0x1bbf44[_0x1cf3('0x23')]],'as':_0x1bbf44['as'],'attributes':_0x1bbf44[_0x1cf3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1cf3('0x24')](function(_0x5b87e8){logger[_0x1cf3('0x17')](_0x1cf3('0x25'),_0x2ea62e);logger['debug']('GetVoiceQueue',_0x2ea62e,JSON[_0x1cf3('0x12')](_0x5b87e8));_0x2afb3b(_0x5b87e8);})[_0x1cf3('0x19')](function(_0x4ed025){logger[_0x1cf3('0x13')](_0x1cf3('0x25'),_0x4ed025[_0x1cf3('0x16')],_0x2ea62e);_0xf95f4b(_0x86b6e3[_0x1cf3('0x13')](0x1f4,_0x4ed025[_0x1cf3('0x16')]));});});};exports[_0x1cf3('0x26')]=function(_0x45d23f){var _0x2ce6e7=this;return new Promise(function(_0x83410a,_0x34d1d0){return db['VoiceQueue'][_0x1cf3('0x27')]({'raw':_0x45d23f[_0x1cf3('0x1c')]?_0x45d23f[_0x1cf3('0x1c')][_0x1cf3('0x1d')]===undefined?!![]:![]:!![],'where':_0x45d23f[_0x1cf3('0x1c')]?_0x45d23f[_0x1cf3('0x1c')][_0x1cf3('0x1e')]||null:null,'attributes':_0x45d23f[_0x1cf3('0x1c')]?_0x45d23f[_0x1cf3('0x1c')]['attributes']||null:null,'include':_0x45d23f[_0x1cf3('0x1c')]?_0x45d23f[_0x1cf3('0x1c')][_0x1cf3('0x21')]?_['map'](_0x45d23f['options'][_0x1cf3('0x21')],function(_0x1fde2f){return{'model':db[_0x1fde2f[_0x1cf3('0x23')]],'as':_0x1fde2f['as'],'attributes':_0x1fde2f['attributes'],'include':_0x1fde2f[_0x1cf3('0x21')]?_['map'](_0x1fde2f['include'],function(_0x1fb937){return{'model':db[_0x1fb937['model']],'as':_0x1fb937['as'],'attributes':_0x1fb937['attributes'],'include':_0x1fb937['include']?_[_0x1cf3('0x22')](_0x1fb937[_0x1cf3('0x21')],function(_0x28e414){return{'model':db[_0x28e414[_0x1cf3('0x23')]],'as':_0x28e414['as'],'attributes':_0x28e414[_0x1cf3('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13e833){logger['info'](_0x1cf3('0x26'),_0x45d23f);logger[_0x1cf3('0x10')](_0x1cf3('0x26'),_0x45d23f,JSON[_0x1cf3('0x12')](_0x13e833));_0x83410a(_0x13e833);})[_0x1cf3('0x19')](function(_0xada74d){logger[_0x1cf3('0x13')](_0x1cf3('0x26'),_0xada74d[_0x1cf3('0x16')],_0x45d23f);_0x34d1d0(_0x2ce6e7[_0x1cf3('0x13')](0x1f4,_0xada74d[_0x1cf3('0x16')]));});});}; \ No newline at end of file +var _0x895f=['findAll','options','raw','where','attributes','limit','include','map','ShowVoiceQueue','model','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','VoiceQueue'];(function(_0x644363,_0x5f2400){var _0x3cb021=function(_0x407676){while(--_0x407676){_0x644363['push'](_0x644363['shift']());}};_0x3cb021(++_0x5f2400);}(_0x895f,0x13a));var _0xf895=function(_0x24ed15,_0x3d3618){_0x24ed15=_0x24ed15-0x0;var _0x1adb57=_0x895f[_0x24ed15];return _0x1adb57;};'use strict';var _=require(_0xf895('0x0'));var util=require(_0xf895('0x1'));var moment=require(_0xf895('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf895('0x3'))['db'];var utils=require(_0xf895('0x4'));var logger=require(_0xf895('0x5'))(_0xf895('0x6'));var config=require(_0xf895('0x7'));var jayson=require(_0xf895('0x8'));var client=jayson[_0xf895('0x9')][_0xf895('0xa')]({'port':0x232a});config[_0xf895('0xb')]=_['defaults'](config[_0xf895('0xb')],{'host':_0xf895('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf895('0xb')]));require('./voiceQueue.socket')[_0xf895('0xd')](socket);function respondWithRpcPromise(_0x4f38eb,_0x1b4bef,_0x4fbe3a){return new BPromise(function(_0x2b5cd9,_0x4b700e){return client['request'](_0x4f38eb,_0x4fbe3a)[_0xf895('0xe')](function(_0x56dff0){logger['info'](_0xf895('0xf'),_0x1b4bef,_0xf895('0x10'));logger[_0xf895('0x11')](_0xf895('0x12'),_0x1b4bef,_0xf895('0x10'),JSON[_0xf895('0x13')](_0x56dff0));if(_0x56dff0['error']){if(_0x56dff0[_0xf895('0x14')][_0xf895('0x15')]===0x1f4){logger[_0xf895('0x14')](_0xf895('0xf'),_0x1b4bef,_0x56dff0[_0xf895('0x14')][_0xf895('0x16')]);return _0x4b700e(_0x56dff0[_0xf895('0x14')][_0xf895('0x16')]);}logger[_0xf895('0x14')](_0xf895('0xf'),_0x1b4bef,_0x56dff0['error'][_0xf895('0x16')]);return _0x2b5cd9(_0x56dff0[_0xf895('0x14')]['message']);}else{logger[_0xf895('0x17')](_0xf895('0xf'),_0x1b4bef,'request\x20sent');_0x2b5cd9(_0x56dff0[_0xf895('0x18')][_0xf895('0x16')]);}})[_0xf895('0x19')](function(_0x1cff91){logger[_0xf895('0x14')](_0xf895('0xf'),_0x1b4bef,_0x1cff91);_0x4b700e(_0x1cff91);});});}exports[_0xf895('0x1a')]=function(_0x500f39){var _0x34ee40=this;return new Promise(function(_0x425f4f,_0x402877){return db[_0xf895('0x1b')][_0xf895('0x1c')]({'raw':_0x500f39[_0xf895('0x1d')]?_0x500f39[_0xf895('0x1d')][_0xf895('0x1e')]===undefined?!![]:![]:!![],'where':_0x500f39[_0xf895('0x1d')]?_0x500f39[_0xf895('0x1d')][_0xf895('0x1f')]||null:null,'attributes':_0x500f39[_0xf895('0x1d')]?_0x500f39[_0xf895('0x1d')][_0xf895('0x20')]||null:null,'limit':_0x500f39[_0xf895('0x1d')]?_0x500f39[_0xf895('0x1d')][_0xf895('0x21')]||null:null,'include':_0x500f39[_0xf895('0x1d')]?_0x500f39['options'][_0xf895('0x22')]?_[_0xf895('0x23')](_0x500f39['options'][_0xf895('0x22')],function(_0x499400){return{'model':db[_0x499400['model']],'as':_0x499400['as'],'attributes':_0x499400['attributes'],'include':_0x499400['include']?_['map'](_0x499400[_0xf895('0x22')],function(_0x538e7f){return{'model':db[_0x538e7f['model']],'as':_0x538e7f['as'],'attributes':_0x538e7f[_0xf895('0x20')],'include':_0x538e7f[_0xf895('0x22')]?_[_0xf895('0x23')](_0x538e7f[_0xf895('0x22')],function(_0x2f56d8){return{'model':db[_0x2f56d8['model']],'as':_0x2f56d8['as'],'attributes':_0x2f56d8[_0xf895('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf895('0xe')](function(_0x25b810){logger[_0xf895('0x17')](_0xf895('0x1a'),_0x500f39);logger[_0xf895('0x11')](_0xf895('0x1a'),_0x500f39,JSON[_0xf895('0x13')](_0x25b810));_0x425f4f(_0x25b810);})[_0xf895('0x19')](function(_0x39b1f0){logger[_0xf895('0x14')](_0xf895('0x1a'),_0x39b1f0[_0xf895('0x16')],_0x500f39);_0x402877(_0x34ee40[_0xf895('0x14')](0x1f4,_0x39b1f0[_0xf895('0x16')]));});});};exports[_0xf895('0x24')]=function(_0x557035){var _0x530a4b=this;return new Promise(function(_0x4ebe0f,_0x4aca28){return db[_0xf895('0x1b')]['find']({'raw':_0x557035['options']?_0x557035['options'][_0xf895('0x1e')]===undefined?!![]:![]:!![],'where':_0x557035[_0xf895('0x1d')]?_0x557035[_0xf895('0x1d')][_0xf895('0x1f')]||null:null,'attributes':_0x557035[_0xf895('0x1d')]?_0x557035[_0xf895('0x1d')][_0xf895('0x20')]||null:null,'include':_0x557035[_0xf895('0x1d')]?_0x557035[_0xf895('0x1d')]['include']?_[_0xf895('0x23')](_0x557035[_0xf895('0x1d')][_0xf895('0x22')],function(_0x27d016){return{'model':db[_0x27d016[_0xf895('0x25')]],'as':_0x27d016['as'],'attributes':_0x27d016['attributes'],'include':_0x27d016[_0xf895('0x22')]?_[_0xf895('0x23')](_0x27d016[_0xf895('0x22')],function(_0x2c9693){return{'model':db[_0x2c9693['model']],'as':_0x2c9693['as'],'attributes':_0x2c9693['attributes'],'include':_0x2c9693[_0xf895('0x22')]?_[_0xf895('0x23')](_0x2c9693[_0xf895('0x22')],function(_0x2a1c02){return{'model':db[_0x2a1c02['model']],'as':_0x2a1c02['as'],'attributes':_0x2a1c02[_0xf895('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c7e5c){logger[_0xf895('0x17')](_0xf895('0x24'),_0x557035);logger[_0xf895('0x11')](_0xf895('0x24'),_0x557035,JSON[_0xf895('0x13')](_0x2c7e5c));_0x4ebe0f(_0x2c7e5c);})['catch'](function(_0x1e758c){logger['error'](_0xf895('0x24'),_0x1e758c['message'],_0x557035);_0x4aca28(_0x530a4b[_0xf895('0x14')](0x1f4,_0x1e758c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 428ffee..4813019 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 _0x1dcc=['register','voiceQueue:','./voiceQueue.events','save','update','emit','removeListener'];(function(_0x2f87cd,_0xcaf299){var _0x5d7eda=function(_0x37ffb0){while(--_0x37ffb0){_0x2f87cd['push'](_0x2f87cd['shift']());}};_0x5d7eda(++_0xcaf299);}(_0x1dcc,0xbf));var _0xc1dc=function(_0x10a3a9,_0x22e0eb){_0x10a3a9=_0x10a3a9-0x0;var _0x4593b2=_0x1dcc[_0x10a3a9];return _0x4593b2;};'use strict';var VoiceQueueEvents=require(_0xc1dc('0x0'));var events=[_0xc1dc('0x1'),'remove',_0xc1dc('0x2')];function createListener(_0x52be11,_0x388303){return function(_0x2f86a3){_0x388303[_0xc1dc('0x3')](_0x52be11,_0x2f86a3);};}function removeListener(_0x524e36,_0x39781a){return function(){VoiceQueueEvents[_0xc1dc('0x4')](_0x524e36,_0x39781a);};}exports[_0xc1dc('0x5')]=function(_0x39a2bc){for(var _0x1692b2=0x0,_0x5e2e82=events['length'];_0x1692b2<_0x5e2e82;_0x1692b2++){var _0x473511=events[_0x1692b2];var _0x4b0ca3=createListener(_0xc1dc('0x6')+_0x473511,_0x39a2bc);VoiceQueueEvents['on'](_0x473511,_0x4b0ca3);}}; \ No newline at end of file +var _0x31eb=['save','remove','update','emit','register','length','voiceQueue:','./voiceQueue.events'];(function(_0x119cd8,_0x556b73){var _0x7072a3=function(_0x5908d1){while(--_0x5908d1){_0x119cd8['push'](_0x119cd8['shift']());}};_0x7072a3(++_0x556b73);}(_0x31eb,0x187));var _0xb31e=function(_0x9e02f2,_0x33d750){_0x9e02f2=_0x9e02f2-0x0;var _0x4fb4fd=_0x31eb[_0x9e02f2];return _0x4fb4fd;};'use strict';var VoiceQueueEvents=require(_0xb31e('0x0'));var events=[_0xb31e('0x1'),_0xb31e('0x2'),_0xb31e('0x3')];function createListener(_0x5187e3,_0x53efaa){return function(_0x501e46){_0x53efaa[_0xb31e('0x4')](_0x5187e3,_0x501e46);};}function removeListener(_0x17ee71,_0x5ccb05){return function(){VoiceQueueEvents['removeListener'](_0x17ee71,_0x5ccb05);};}exports[_0xb31e('0x5')]=function(_0xe1b3b6){for(var _0x1cb7d4=0x0,_0xb82ad1=events[_0xb31e('0x6')];_0x1cb7d4<_0xb82ad1;_0x1cb7d4++){var _0x479aba=events[_0x1cb7d4];var _0x2c2137=createListener(_0xb31e('0x7')+_0x479aba,_0xe1b3b6);VoiceQueueEvents['on'](_0x479aba,_0x2c2137);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 61c5b46..bce6cde 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 _0x03b9=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','index','get','/describe','isAuthenticated','describe','/index','getVoiceQueuesReport','show','post','create','put','delete','/:id','destroy','exports'];(function(_0x5d93c7,_0x580b09){var _0x54a38b=function(_0x38c4c2){while(--_0x38c4c2){_0x5d93c7['push'](_0x5d93c7['shift']());}};_0x54a38b(++_0x580b09);}(_0x03b9,0x120));var _0x903b=function(_0x535c49,_0x17cf75){_0x535c49=_0x535c49-0x0;var _0x2b3522=_0x03b9[_0x535c49];return _0x2b3522;};'use strict';var multer=require(_0x903b('0x0'));var util=require(_0x903b('0x1'));var path=require(_0x903b('0x2'));var timeout=require(_0x903b('0x3'));var express=require(_0x903b('0x4'));var router=express['Router']();var fs_extra=require(_0x903b('0x5'));var auth=require(_0x903b('0x6'));var interaction=require(_0x903b('0x7'));var config=require('../../config/environment');var controller=require(_0x903b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x903b('0x9')]);router[_0x903b('0xa')](_0x903b('0xb'),auth[_0x903b('0xc')](),controller[_0x903b('0xd')]);router[_0x903b('0xa')](_0x903b('0xe'),auth[_0x903b('0xc')](),controller[_0x903b('0xf')]);router[_0x903b('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x903b('0x10')]);router[_0x903b('0x11')]('/',auth[_0x903b('0xc')](),controller[_0x903b('0x12')]);router[_0x903b('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x903b('0x14')](_0x903b('0x15'),auth[_0x903b('0xc')](),controller[_0x903b('0x16')]);module[_0x903b('0x17')]=router; \ No newline at end of file +var _0x7c59=['../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','describe','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0x5ec21d,_0x5d0772){var _0x43bde8=function(_0x1bfc7c){while(--_0x1bfc7c){_0x5ec21d['push'](_0x5ec21d['shift']());}};_0x43bde8(++_0x5d0772);}(_0x7c59,0xe2));var _0x97c5=function(_0x1a2763,_0x1c1854){_0x1a2763=_0x1a2763-0x0;var _0x2d819b=_0x7c59[_0x1a2763];return _0x2d819b;};'use strict';var multer=require(_0x97c5('0x0'));var util=require(_0x97c5('0x1'));var path=require(_0x97c5('0x2'));var timeout=require(_0x97c5('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x97c5('0x4'));var interaction=require(_0x97c5('0x5'));var config=require(_0x97c5('0x6'));var controller=require(_0x97c5('0x7'));router[_0x97c5('0x8')]('/',auth[_0x97c5('0x9')](),controller[_0x97c5('0xa')]);router[_0x97c5('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x97c5('0xb')]);router[_0x97c5('0x8')]('/index',auth[_0x97c5('0x9')](),controller[_0x97c5('0xc')]);router['get'](_0x97c5('0xd'),auth[_0x97c5('0x9')](),controller[_0x97c5('0xe')]);router[_0x97c5('0xf')]('/',auth[_0x97c5('0x9')](),controller[_0x97c5('0x10')]);router[_0x97c5('0x11')](_0x97c5('0xd'),auth[_0x97c5('0x9')](),controller[_0x97c5('0x12')]);router[_0x97c5('0x13')](_0x97c5('0xd'),auth[_0x97c5('0x9')](),controller[_0x97c5('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index e36e250..2c51202 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 _0x3017=['seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3017,0x92));var _0x7301=function(_0x308043,_0x4cf916){_0x308043=_0x308043-0x0;var _0x559588=_0x3017[_0x308043];return _0x559588;};'use strict';var Sequelize=require(_0x7301('0x0'));var moment=require('moment');module[_0x7301('0x1')]={'type':{'type':Sequelize[_0x7301('0x2')]},'uniqueid':{'type':Sequelize[_0x7301('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7301('0x2')]},'queue':{'type':Sequelize[_0x7301('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x7301('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x7301('0x3')],'set':function(_0x38f4f1){var _0x5a47c8=moment(_0x38f4f1);var _0x3d28bf=moment(this[_0x7301('0x4')]('queuecallerjoinAt'))[_0x7301('0x5')](_0x7301('0x6'));var _0x26c761=_0x5a47c8[_0x7301('0x7')](_0x3d28bf,_0x7301('0x8'));this['setDataValue']('queuecallerleaveAt',_0x38f4f1);this[_0x7301('0x9')](_0x7301('0xa'),_0x26c761||null);}},'position':{'type':Sequelize[_0x7301('0xb')]},'count':{'type':Sequelize[_0x7301('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x7301('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x7301('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x7301('0x3')]},'queuecallerexit':{'type':Sequelize[_0x7301('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x7301('0x2')],'comment':_0x7301('0xd')},'originalposition':{'type':Sequelize[_0x7301('0xb')]},'channel':{'type':Sequelize[_0x7301('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7301('0x2')]},'connectedlinename':{'type':Sequelize[_0x7301('0x2')]},'accountcode':{'type':Sequelize[_0x7301('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x7301('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x7301('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x7301('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x7301('0x2')]},'transfer':{'type':Sequelize[_0x7301('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7301('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x7301('0x2')]},'transferuniqueid':{'type':Sequelize[_0x7301('0x2')]},'disposition':{'type':Sequelize[_0x7301('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x7301('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x653a=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','holdtime','INTEGER','BOOLEAN'];(function(_0x42b9ca,_0x53d8d1){var _0x184996=function(_0x1bd934){while(--_0x1bd934){_0x42b9ca['push'](_0x42b9ca['shift']());}};_0x184996(++_0x53d8d1);}(_0x653a,0x9c));var _0xa653=function(_0x27b0c4,_0xaf6d02){_0x27b0c4=_0x27b0c4-0x0;var _0xcb87b2=_0x653a[_0x27b0c4];return _0xcb87b2;};'use strict';var Sequelize=require(_0xa653('0x0'));var moment=require(_0xa653('0x1'));module['exports']={'type':{'type':Sequelize[_0xa653('0x2')]},'uniqueid':{'type':Sequelize[_0xa653('0x2')]},'calleridnum':{'type':Sequelize[_0xa653('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xa653('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xa653('0x3')],'set':function(_0x4f225c){var _0x4c7a55=moment(_0x4f225c);var _0x1104b0=moment(this[_0xa653('0x4')](_0xa653('0x5')))['format'](_0xa653('0x6'));var _0x4a47d2=_0x4c7a55['diff'](_0x1104b0,_0xa653('0x7'));this[_0xa653('0x8')]('queuecallerleaveAt',_0x4f225c);this['setDataValue'](_0xa653('0x9'),_0x4a47d2||null);}},'position':{'type':Sequelize[_0xa653('0xa')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xa653('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xa653('0x3')]},'queuecallerexit':{'type':Sequelize[_0xa653('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xa653('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xa653('0x2')],'comment':_0xa653('0xc')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xa653('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa653('0x2')]},'connectedlinename':{'type':Sequelize[_0xa653('0x2')]},'accountcode':{'type':Sequelize[_0xa653('0x2')]},'context':{'type':Sequelize[_0xa653('0x2')]},'exten':{'type':Sequelize[_0xa653('0x2')]},'priority':{'type':Sequelize[_0xa653('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa653('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xa653('0x2')]},'transfer':{'type':Sequelize[_0xa653('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa653('0x2')],'comment':_0xa653('0xd')},'transferexten':{'type':Sequelize[_0xa653('0x2')]},'transferuniqueid':{'type':Sequelize[_0xa653('0x2')]},'disposition':{'type':Sequelize[_0xa653('0x2')]},'secondDisposition':{'type':Sequelize[_0xa653('0x2')]},'thirdDisposition':{'type':Sequelize[_0xa653('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'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 7abdf4b..358c61d 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 _0x5564=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','error','stack','name','index','map','VoiceQueueReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','filters','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','update','describe','hasOwnProperty','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x505606,_0x38ed25){var _0x3d2e1a=function(_0x2f26ca){while(--_0x2f26ca){_0x505606['push'](_0x505606['shift']());}};_0x3d2e1a(++_0x38ed25);}(_0x5564,0x1e3));var _0x4556=function(_0x368d28,_0x5b18fc){_0x368d28=_0x368d28-0x0;var _0x5510db=_0x5564[_0x368d28];return _0x5510db;};'use strict';var emlformat=require(_0x4556('0x0'));var rimraf=require(_0x4556('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4556('0x2'));var rp=require(_0x4556('0x3'));var moment=require(_0x4556('0x4'));var BPromise=require(_0x4556('0x5'));var Mustache=require(_0x4556('0x6'));var util=require('util');var path=require(_0x4556('0x7'));var sox=require(_0x4556('0x8'));var csv=require(_0x4556('0x9'));var ejs=require(_0x4556('0xa'));var fs=require('fs');var fs_extra=require(_0x4556('0xb'));var _=require(_0x4556('0xc'));var squel=require(_0x4556('0xd'));var crypto=require(_0x4556('0xe'));var jsforce=require(_0x4556('0xf'));var deskjs=require(_0x4556('0x10'));var toCsv=require(_0x4556('0x9'));var querystring=require(_0x4556('0x11'));var Papa=require(_0x4556('0x12'));var Redis=require(_0x4556('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4556('0x14'));var hardwareService=require(_0x4556('0x15'));var logger=require('../../config/logger')(_0x4556('0x16'));var utils=require(_0x4556('0x17'));var config=require(_0x4556('0x18'));var licenseUtil=require(_0x4556('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4556('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4556('0x1b')]));require(_0x4556('0x1c'))[_0x4556('0x1d')](socket);function respondWithStatusCode(_0x1c6953,_0x56cadf){_0x56cadf=_0x56cadf||0xcc;return function(_0x329ed8){if(_0x329ed8){return _0x1c6953[_0x4556('0x1e')](_0x56cadf);}return _0x1c6953[_0x4556('0x1f')](_0x56cadf)[_0x4556('0x20')]();};}function respondWithResult(_0x290658,_0x413ed8){_0x413ed8=_0x413ed8||0xc8;return function(_0x585efa){if(_0x585efa){return _0x290658['status'](_0x413ed8)[_0x4556('0x21')](_0x585efa);}};}function respondWithFilteredResult(_0x24c5b7,_0x36d2f1){return function(_0x5b861c){if(_0x5b861c){var _0xe38b7d=typeof _0x36d2f1[_0x4556('0x22')]===_0x4556('0x23')&&typeof _0x36d2f1['limit']===_0x4556('0x23');var _0x556ef3=_0x5b861c[_0x4556('0x24')];var _0x64982d=_0xe38b7d?0x0:_0x36d2f1[_0x4556('0x22')];var _0x3cd71b=_0xe38b7d?_0x5b861c[_0x4556('0x24')]:_0x36d2f1[_0x4556('0x22')]+_0x36d2f1[_0x4556('0x25')];var _0x1f205d;if(_0x3cd71b>=_0x556ef3){_0x3cd71b=_0x556ef3;_0x1f205d=0xc8;}else{_0x1f205d=0xce;}_0x24c5b7['status'](_0x1f205d);return _0x24c5b7[_0x4556('0x26')](_0x4556('0x27'),_0x64982d+'-'+_0x3cd71b+'/'+_0x556ef3)[_0x4556('0x21')](_0x5b861c);}return null;};}function patchUpdates(_0x1f04f5){return function(_0xe0076b){try{jsonpatch['apply'](_0xe0076b,_0x1f04f5,!![]);}catch(_0x3e0acd){return BPromise[_0x4556('0x28')](_0x3e0acd);}return _0xe0076b[_0x4556('0x29')]();};}function saveUpdates(_0x4ded60,_0x2881ac){return function(_0x5c0045){if(_0x5c0045){return _0x5c0045['update'](_0x4ded60)['then'](function(_0x44408d){return _0x44408d;});}return null;};}function removeEntity(_0x2ce29c,_0x48af11){return function(_0x1e8fc1){if(_0x1e8fc1){return _0x1e8fc1[_0x4556('0x2a')]()['then'](function(){_0x2ce29c[_0x4556('0x1f')](0xcc)[_0x4556('0x20')]();});}};}function handleEntityNotFound(_0x55716d,_0xd8fc07){return function(_0x2c9564){if(!_0x2c9564){_0x55716d[_0x4556('0x1e')](0x194);}return _0x2c9564;};}function handleError(_0x3ccb5d,_0x1affb6){_0x1affb6=_0x1affb6||0x1f4;return function(_0x5b20f4){logger[_0x4556('0x2b')](_0x5b20f4[_0x4556('0x2c')]);if(_0x5b20f4[_0x4556('0x2d')]){delete _0x5b20f4['name'];}_0x3ccb5d[_0x4556('0x1f')](_0x1affb6)['send'](_0x5b20f4);};}exports[_0x4556('0x2e')]=function(_0x5e7dfb,_0x3ceb99){var _0x4748a7={},_0x3c2623={},_0x5c7634={'count':0x0,'rows':[]};var _0x11c2c2=_[_0x4556('0x2f')](db[_0x4556('0x30')]['rawAttributes'],function(_0x351327){return{'name':_0x351327[_0x4556('0x31')],'type':_0x351327[_0x4556('0x32')][_0x4556('0x33')]};});_0x3c2623[_0x4556('0x34')]=_[_0x4556('0x2f')](_0x11c2c2,_0x4556('0x2d'));_0x3c2623[_0x4556('0x35')]=_[_0x4556('0x36')](_0x5e7dfb['query']);_0x3c2623['filters']=_[_0x4556('0x37')](_0x3c2623[_0x4556('0x34')],_0x3c2623[_0x4556('0x35')]);_0x4748a7[_0x4556('0x38')]=_['intersection'](_0x3c2623[_0x4556('0x34')],qs[_0x4556('0x39')](_0x5e7dfb[_0x4556('0x35')][_0x4556('0x39')]));_0x4748a7['attributes']=_0x4748a7[_0x4556('0x38')][_0x4556('0x3a')]?_0x4748a7[_0x4556('0x38')]:_0x3c2623[_0x4556('0x34')];if(!_0x5e7dfb[_0x4556('0x35')]['hasOwnProperty']('nolimit')){_0x4748a7[_0x4556('0x25')]=qs[_0x4556('0x25')](_0x5e7dfb[_0x4556('0x35')][_0x4556('0x25')]);_0x4748a7[_0x4556('0x22')]=qs[_0x4556('0x22')](_0x5e7dfb[_0x4556('0x35')][_0x4556('0x22')]);}_0x4748a7[_0x4556('0x3b')]=qs[_0x4556('0x3c')](_0x5e7dfb[_0x4556('0x35')][_0x4556('0x3c')]);_0x4748a7['where']=qs[_0x4556('0x3d')](_[_0x4556('0x3e')](_0x5e7dfb['query'],_0x3c2623['filters']),_0x11c2c2);if(_0x5e7dfb[_0x4556('0x35')][_0x4556('0x3f')]){_0x4748a7[_0x4556('0x40')]=_[_0x4556('0x41')](_0x4748a7['where'],{'$or':_['map'](_0x11c2c2,function(_0x50418e){if(_0x50418e[_0x4556('0x32')]!==_0x4556('0x42')){var _0x3d9578={};_0x3d9578[_0x50418e[_0x4556('0x2d')]]={'$like':'%'+_0x5e7dfb[_0x4556('0x35')]['filter']+'%'};return _0x3d9578;}})});}_0x4748a7=_['merge']({},_0x4748a7,_0x5e7dfb['options']);var _0x5e3e56={'where':_0x4748a7['where']};return db[_0x4556('0x30')][_0x4556('0x24')](_0x5e3e56)[_0x4556('0x43')](function(_0x2b66ce){_0x5c7634[_0x4556('0x24')]=_0x2b66ce;if(_0x5e7dfb['query'][_0x4556('0x44')]){_0x4748a7[_0x4556('0x45')]=[{'all':!![]}];}return db[_0x4556('0x30')][_0x4556('0x46')](_0x4748a7);})['then'](function(_0xd7e816){_0x5c7634[_0x4556('0x47')]=_0xd7e816;return _0x5c7634;})['then'](respondWithFilteredResult(_0x3ceb99,_0x4748a7))[_0x4556('0x48')](handleError(_0x3ceb99,null));};exports['show']=function(_0x1026c0,_0x529720){var _0x4bdc0e={'raw':![],'where':{'id':_0x1026c0[_0x4556('0x49')]['id']}},_0x509847={};_0x509847['model']=_[_0x4556('0x36')](db[_0x4556('0x30')][_0x4556('0x4a')]);_0x509847[_0x4556('0x35')]=_[_0x4556('0x36')](_0x1026c0[_0x4556('0x35')]);_0x509847['filters']=_['intersection'](_0x509847['model'],_0x509847[_0x4556('0x35')]);_0x4bdc0e[_0x4556('0x38')]=_[_0x4556('0x37')](_0x509847[_0x4556('0x34')],qs['fields'](_0x1026c0[_0x4556('0x35')][_0x4556('0x39')]));_0x4bdc0e[_0x4556('0x38')]=_0x4bdc0e[_0x4556('0x38')][_0x4556('0x3a')]?_0x4bdc0e[_0x4556('0x38')]:_0x509847[_0x4556('0x34')];if(_0x1026c0[_0x4556('0x35')][_0x4556('0x44')]){_0x4bdc0e[_0x4556('0x45')]=[{'all':!![]}];}_0x4bdc0e=_[_0x4556('0x41')]({},_0x4bdc0e,_0x1026c0['options']);return db['VoiceQueueReport'][_0x4556('0x4b')](_0x4bdc0e)['then'](handleEntityNotFound(_0x529720,null))[_0x4556('0x43')](respondWithResult(_0x529720,null))[_0x4556('0x48')](handleError(_0x529720,null));};exports[_0x4556('0x4c')]=function(_0x40aacc,_0x52cb62){return db[_0x4556('0x30')][_0x4556('0x4c')](_0x40aacc[_0x4556('0x4d')],{})[_0x4556('0x43')](respondWithResult(_0x52cb62,0xc9))[_0x4556('0x48')](handleError(_0x52cb62,null));};exports[_0x4556('0x4e')]=function(_0x5a5ea5,_0x2facb2){if(_0x5a5ea5['body']['id']){delete _0x5a5ea5[_0x4556('0x4d')]['id'];}return db[_0x4556('0x30')]['find']({'where':{'id':_0x5a5ea5['params']['id']}})['then'](handleEntityNotFound(_0x2facb2,null))['then'](saveUpdates(_0x5a5ea5[_0x4556('0x4d')],null))[_0x4556('0x43')](respondWithResult(_0x2facb2,null))[_0x4556('0x48')](handleError(_0x2facb2,null));};exports['destroy']=function(_0xb973f3,_0x4b9890){return db[_0x4556('0x30')][_0x4556('0x4b')]({'where':{'id':_0xb973f3[_0x4556('0x49')]['id']}})[_0x4556('0x43')](handleEntityNotFound(_0x4b9890,null))[_0x4556('0x43')](removeEntity(_0x4b9890,null))['catch'](handleError(_0x4b9890,null));};exports[_0x4556('0x4f')]=function(_0x10359a,_0x31ba7e){return db['VoiceQueueReport'][_0x4556('0x4f')]()[_0x4556('0x43')](respondWithResult(_0x31ba7e,null))['catch'](handleError(_0x31ba7e,null));};exports['getVoiceQueuesReport']=function(_0x2c6184,_0x1a740b){var _0x3298d5={},_0x123188={},_0x361b11={'count':0x0,'rows':[]};_0x123188[_0x4556('0x34')]=_[_0x4556('0x36')](db['VoiceQueueReport'][_0x4556('0x4a')]);_0x123188[_0x4556('0x35')]=_[_0x4556('0x36')](_0x2c6184['query']);_0x123188[_0x4556('0x3d')]=_[_0x4556('0x37')](_0x123188[_0x4556('0x34')],_0x123188['query']);_0x3298d5['attributes']=_[_0x4556('0x37')](_0x123188['model'],qs['fields'](_0x2c6184[_0x4556('0x35')][_0x4556('0x39')]));_0x3298d5[_0x4556('0x38')]=_0x3298d5[_0x4556('0x38')][_0x4556('0x3a')]?_0x3298d5[_0x4556('0x38')]:_0x123188[_0x4556('0x34')];if(!_0x2c6184[_0x4556('0x35')][_0x4556('0x50')](_0x4556('0x51'))){_0x3298d5[_0x4556('0x25')]=qs[_0x4556('0x25')](_0x2c6184[_0x4556('0x35')][_0x4556('0x25')]);_0x3298d5[_0x4556('0x22')]=qs[_0x4556('0x22')](_0x2c6184[_0x4556('0x35')][_0x4556('0x22')]);}_0x3298d5['order']=qs[_0x4556('0x3c')](_0x2c6184['query'][_0x4556('0x3c')]);_0x3298d5[_0x4556('0x40')]=qs[_0x4556('0x3d')](_[_0x4556('0x3e')](_0x2c6184['query'],_0x123188[_0x4556('0x3d')]));if(_0x2c6184[_0x4556('0x35')][_0x4556('0x3f')]){_0x3298d5[_0x4556('0x40')]=_[_0x4556('0x41')](_0x3298d5[_0x4556('0x40')],{'$or':_['map'](_0x3298d5[_0x4556('0x38')],function(_0x1163b6){var _0x59d0cf={};_0x59d0cf[_0x1163b6]={'$like':'%'+_0x2c6184[_0x4556('0x35')]['filter']+'%'};return _0x59d0cf;})});}_0x3298d5=_[_0x4556('0x41')]({},_0x3298d5,_0x2c6184['options']);var _0x45c238={'where':_0x3298d5[_0x4556('0x40')]};return db[_0x4556('0x30')][_0x4556('0x24')](_0x45c238)[_0x4556('0x43')](function(_0x19ce0d){_0x361b11['count']=_0x19ce0d;if(_0x2c6184[_0x4556('0x35')]['includeAll']){_0x3298d5[_0x4556('0x45')]=[{'all':!![]}];}return db[_0x4556('0x30')][_0x4556('0x46')](_0x3298d5);})['then'](function(_0x2f1b17){_0x361b11[_0x4556('0x47')]=_0x2f1b17;return _0x361b11;})[_0x4556('0x43')](respondWithFilteredResult(_0x1a740b,_0x3298d5,'getVoiceQueuesReport'))['catch'](handleError(_0x1a740b,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x88e2=['stack','name','index','VoiceQueueReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','destroy','describe','nolimit','getVoiceQueuesReport','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./voiceQueueReport.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','end'];(function(_0x40538a,_0x52f38c){var _0x596778=function(_0x4885fa){while(--_0x4885fa){_0x40538a['push'](_0x40538a['shift']());}};_0x596778(++_0x52f38c);}(_0x88e2,0x15a));var _0x288e=function(_0x752df7,_0x43ff4d){_0x752df7=_0x752df7-0x0;var _0x306f64=_0x88e2[_0x752df7];return _0x306f64;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x288e('0x0'));var jsonpatch=require(_0x288e('0x1'));var rp=require('request-promise');var moment=require(_0x288e('0x2'));var BPromise=require(_0x288e('0x3'));var Mustache=require(_0x288e('0x4'));var util=require('util');var path=require(_0x288e('0x5'));var sox=require(_0x288e('0x6'));var csv=require(_0x288e('0x7'));var ejs=require(_0x288e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x288e('0x9'));var squel=require(_0x288e('0xa'));var crypto=require(_0x288e('0xb'));var jsforce=require(_0x288e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x288e('0xd'));var Papa=require(_0x288e('0xe'));var Redis=require(_0x288e('0xf'));var authService=require(_0x288e('0x10'));var qs=require(_0x288e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x288e('0x12'));var logger=require('../../config/logger')(_0x288e('0x13'));var utils=require('../../config/utils');var config=require(_0x288e('0x14'));var licenseUtil=require(_0x288e('0x15'));var db=require(_0x288e('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x288e('0x17'),'port':0x18eb});var socket=require(_0x288e('0x18'))(new Redis(config[_0x288e('0x19')]));require(_0x288e('0x1a'))['register'](socket);function respondWithStatusCode(_0x2d8960,_0x1a1647){_0x1a1647=_0x1a1647||0xcc;return function(_0x57d493){if(_0x57d493){return _0x2d8960[_0x288e('0x1b')](_0x1a1647);}return _0x2d8960[_0x288e('0x1c')](_0x1a1647)['end']();};}function respondWithResult(_0x1a9dc1,_0x46ff9b){_0x46ff9b=_0x46ff9b||0xc8;return function(_0x3170e5){if(_0x3170e5){return _0x1a9dc1[_0x288e('0x1c')](_0x46ff9b)[_0x288e('0x1d')](_0x3170e5);}};}function respondWithFilteredResult(_0x3f422b,_0xcb4102){return function(_0x4cc37c){if(_0x4cc37c){var _0x63b6fc=typeof _0xcb4102[_0x288e('0x1e')]===_0x288e('0x1f')&&typeof _0xcb4102[_0x288e('0x20')]===_0x288e('0x1f');var _0x95d470=_0x4cc37c[_0x288e('0x21')];var _0x1a9195=_0x63b6fc?0x0:_0xcb4102['offset'];var _0x50694c=_0x63b6fc?_0x4cc37c[_0x288e('0x21')]:_0xcb4102[_0x288e('0x1e')]+_0xcb4102[_0x288e('0x20')];var _0x48afa1;if(_0x50694c>=_0x95d470){_0x50694c=_0x95d470;_0x48afa1=0xc8;}else{_0x48afa1=0xce;}_0x3f422b[_0x288e('0x1c')](_0x48afa1);return _0x3f422b[_0x288e('0x22')](_0x288e('0x23'),_0x1a9195+'-'+_0x50694c+'/'+_0x95d470)[_0x288e('0x1d')](_0x4cc37c);}return null;};}function patchUpdates(_0x1b0088){return function(_0x3f1af7){try{jsonpatch['apply'](_0x3f1af7,_0x1b0088,!![]);}catch(_0x5e33dd){return BPromise['reject'](_0x5e33dd);}return _0x3f1af7['save']();};}function saveUpdates(_0x20cd8f,_0x34f708){return function(_0x5154c0){if(_0x5154c0){return _0x5154c0[_0x288e('0x24')](_0x20cd8f)['then'](function(_0x366125){return _0x366125;});}return null;};}function removeEntity(_0x58af2e,_0x3671c9){return function(_0x5b1575){if(_0x5b1575){return _0x5b1575['destroy']()[_0x288e('0x25')](function(){_0x58af2e[_0x288e('0x1c')](0xcc)[_0x288e('0x26')]();});}};}function handleEntityNotFound(_0x19e69b,_0x316868){return function(_0x507471){if(!_0x507471){_0x19e69b[_0x288e('0x1b')](0x194);}return _0x507471;};}function handleError(_0x4a12cf,_0x230cf9){_0x230cf9=_0x230cf9||0x1f4;return function(_0x415e06){logger['error'](_0x415e06[_0x288e('0x27')]);if(_0x415e06[_0x288e('0x28')]){delete _0x415e06[_0x288e('0x28')];}_0x4a12cf[_0x288e('0x1c')](_0x230cf9)['send'](_0x415e06);};}exports[_0x288e('0x29')]=function(_0x43b196,_0x4bc9f9){var _0x9b8c03={},_0x4996bf={},_0x9f0bd0={'count':0x0,'rows':[]};var _0x26125a=_['map'](db[_0x288e('0x2a')][_0x288e('0x2b')],function(_0x228c8c){return{'name':_0x228c8c[_0x288e('0x2c')],'type':_0x228c8c[_0x288e('0x2d')][_0x288e('0x2e')]};});_0x4996bf['model']=_[_0x288e('0x2f')](_0x26125a,_0x288e('0x28'));_0x4996bf[_0x288e('0x30')]=_[_0x288e('0x31')](_0x43b196[_0x288e('0x30')]);_0x4996bf[_0x288e('0x32')]=_[_0x288e('0x33')](_0x4996bf['model'],_0x4996bf[_0x288e('0x30')]);_0x9b8c03[_0x288e('0x34')]=_['intersection'](_0x4996bf[_0x288e('0x35')],qs[_0x288e('0x36')](_0x43b196[_0x288e('0x30')][_0x288e('0x36')]));_0x9b8c03[_0x288e('0x34')]=_0x9b8c03[_0x288e('0x34')][_0x288e('0x37')]?_0x9b8c03[_0x288e('0x34')]:_0x4996bf[_0x288e('0x35')];if(!_0x43b196[_0x288e('0x30')]['hasOwnProperty']('nolimit')){_0x9b8c03['limit']=qs[_0x288e('0x20')](_0x43b196['query'][_0x288e('0x20')]);_0x9b8c03[_0x288e('0x1e')]=qs[_0x288e('0x1e')](_0x43b196[_0x288e('0x30')][_0x288e('0x1e')]);}_0x9b8c03[_0x288e('0x38')]=qs['sort'](_0x43b196[_0x288e('0x30')][_0x288e('0x39')]);_0x9b8c03[_0x288e('0x3a')]=qs[_0x288e('0x32')](_[_0x288e('0x3b')](_0x43b196['query'],_0x4996bf[_0x288e('0x32')]),_0x26125a);if(_0x43b196[_0x288e('0x30')][_0x288e('0x3c')]){_0x9b8c03[_0x288e('0x3a')]=_[_0x288e('0x3d')](_0x9b8c03[_0x288e('0x3a')],{'$or':_[_0x288e('0x2f')](_0x26125a,function(_0x155440){if(_0x155440[_0x288e('0x2d')]!==_0x288e('0x3e')){var _0x485d7b={};_0x485d7b[_0x155440[_0x288e('0x28')]]={'$like':'%'+_0x43b196[_0x288e('0x30')]['filter']+'%'};return _0x485d7b;}})});}_0x9b8c03=_['merge']({},_0x9b8c03,_0x43b196['options']);var _0x959e42={'where':_0x9b8c03['where']};return db[_0x288e('0x2a')][_0x288e('0x21')](_0x959e42)[_0x288e('0x25')](function(_0x44b8e7){_0x9f0bd0['count']=_0x44b8e7;if(_0x43b196['query'][_0x288e('0x3f')]){_0x9b8c03[_0x288e('0x40')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x288e('0x41')](_0x9b8c03);})[_0x288e('0x25')](function(_0x24a4a8){_0x9f0bd0[_0x288e('0x42')]=_0x24a4a8;return _0x9f0bd0;})[_0x288e('0x25')](respondWithFilteredResult(_0x4bc9f9,_0x9b8c03))[_0x288e('0x43')](handleError(_0x4bc9f9,null));};exports['show']=function(_0x2e7670,_0x50afab){var _0xb56164={'raw':![],'where':{'id':_0x2e7670[_0x288e('0x44')]['id']}},_0x3b82dc={};_0x3b82dc[_0x288e('0x35')]=_['keys'](db[_0x288e('0x2a')]['rawAttributes']);_0x3b82dc[_0x288e('0x30')]=_[_0x288e('0x31')](_0x2e7670[_0x288e('0x30')]);_0x3b82dc[_0x288e('0x32')]=_[_0x288e('0x33')](_0x3b82dc[_0x288e('0x35')],_0x3b82dc[_0x288e('0x30')]);_0xb56164[_0x288e('0x34')]=_[_0x288e('0x33')](_0x3b82dc['model'],qs[_0x288e('0x36')](_0x2e7670[_0x288e('0x30')]['fields']));_0xb56164[_0x288e('0x34')]=_0xb56164['attributes'][_0x288e('0x37')]?_0xb56164[_0x288e('0x34')]:_0x3b82dc[_0x288e('0x35')];if(_0x2e7670[_0x288e('0x30')][_0x288e('0x3f')]){_0xb56164['include']=[{'all':!![]}];}_0xb56164=_[_0x288e('0x3d')]({},_0xb56164,_0x2e7670[_0x288e('0x45')]);return db[_0x288e('0x2a')][_0x288e('0x46')](_0xb56164)['then'](handleEntityNotFound(_0x50afab,null))[_0x288e('0x25')](respondWithResult(_0x50afab,null))[_0x288e('0x43')](handleError(_0x50afab,null));};exports[_0x288e('0x47')]=function(_0x13aaa3,_0x347dd3){return db[_0x288e('0x2a')]['create'](_0x13aaa3['body'],{})[_0x288e('0x25')](respondWithResult(_0x347dd3,0xc9))[_0x288e('0x43')](handleError(_0x347dd3,null));};exports[_0x288e('0x24')]=function(_0x3806f1,_0x4eee22){if(_0x3806f1['body']['id']){delete _0x3806f1[_0x288e('0x48')]['id'];}return db[_0x288e('0x2a')]['find']({'where':{'id':_0x3806f1[_0x288e('0x44')]['id']}})[_0x288e('0x25')](handleEntityNotFound(_0x4eee22,null))[_0x288e('0x25')](saveUpdates(_0x3806f1[_0x288e('0x48')],null))[_0x288e('0x25')](respondWithResult(_0x4eee22,null))[_0x288e('0x43')](handleError(_0x4eee22,null));};exports[_0x288e('0x49')]=function(_0x5051f7,_0x30f75b){return db[_0x288e('0x2a')][_0x288e('0x46')]({'where':{'id':_0x5051f7[_0x288e('0x44')]['id']}})[_0x288e('0x25')](handleEntityNotFound(_0x30f75b,null))[_0x288e('0x25')](removeEntity(_0x30f75b,null))['catch'](handleError(_0x30f75b,null));};exports[_0x288e('0x4a')]=function(_0x516b83,_0xb82f3c){return db[_0x288e('0x2a')][_0x288e('0x4a')]()[_0x288e('0x25')](respondWithResult(_0xb82f3c,null))[_0x288e('0x43')](handleError(_0xb82f3c,null));};exports['getVoiceQueuesReport']=function(_0x3e5e01,_0x49592e){var _0x1aa25f={},_0x571ae0={},_0x23494a={'count':0x0,'rows':[]};_0x571ae0[_0x288e('0x35')]=_['keys'](db['VoiceQueueReport'][_0x288e('0x2b')]);_0x571ae0[_0x288e('0x30')]=_[_0x288e('0x31')](_0x3e5e01[_0x288e('0x30')]);_0x571ae0[_0x288e('0x32')]=_['intersection'](_0x571ae0[_0x288e('0x35')],_0x571ae0[_0x288e('0x30')]);_0x1aa25f['attributes']=_['intersection'](_0x571ae0['model'],qs[_0x288e('0x36')](_0x3e5e01[_0x288e('0x30')][_0x288e('0x36')]));_0x1aa25f[_0x288e('0x34')]=_0x1aa25f[_0x288e('0x34')][_0x288e('0x37')]?_0x1aa25f[_0x288e('0x34')]:_0x571ae0[_0x288e('0x35')];if(!_0x3e5e01[_0x288e('0x30')]['hasOwnProperty'](_0x288e('0x4b'))){_0x1aa25f[_0x288e('0x20')]=qs[_0x288e('0x20')](_0x3e5e01[_0x288e('0x30')][_0x288e('0x20')]);_0x1aa25f[_0x288e('0x1e')]=qs[_0x288e('0x1e')](_0x3e5e01[_0x288e('0x30')][_0x288e('0x1e')]);}_0x1aa25f[_0x288e('0x38')]=qs[_0x288e('0x39')](_0x3e5e01[_0x288e('0x30')][_0x288e('0x39')]);_0x1aa25f[_0x288e('0x3a')]=qs[_0x288e('0x32')](_[_0x288e('0x3b')](_0x3e5e01[_0x288e('0x30')],_0x571ae0[_0x288e('0x32')]));if(_0x3e5e01[_0x288e('0x30')][_0x288e('0x3c')]){_0x1aa25f[_0x288e('0x3a')]=_[_0x288e('0x3d')](_0x1aa25f[_0x288e('0x3a')],{'$or':_['map'](_0x1aa25f['attributes'],function(_0x3f61f4){var _0x51f59a={};_0x51f59a[_0x3f61f4]={'$like':'%'+_0x3e5e01[_0x288e('0x30')][_0x288e('0x3c')]+'%'};return _0x51f59a;})});}_0x1aa25f=_['merge']({},_0x1aa25f,_0x3e5e01[_0x288e('0x45')]);var _0x5193ac={'where':_0x1aa25f[_0x288e('0x3a')]};return db[_0x288e('0x2a')][_0x288e('0x21')](_0x5193ac)[_0x288e('0x25')](function(_0x7308f9){_0x23494a[_0x288e('0x21')]=_0x7308f9;if(_0x3e5e01[_0x288e('0x30')][_0x288e('0x3f')]){_0x1aa25f['include']=[{'all':!![]}];}return db[_0x288e('0x2a')][_0x288e('0x41')](_0x1aa25f);})[_0x288e('0x25')](function(_0x17baeb){_0x23494a['rows']=_0x17baeb;return _0x23494a;})[_0x288e('0x25')](respondWithFilteredResult(_0x49592e,_0x1aa25f,_0x288e('0x4c')))[_0x288e('0x43')](handleError(_0x49592e,null,_0x288e('0x4c')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index d36a862..f401331 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 _0x48a8=['events','../../mysqldb','VoiceQueueReport','update','remove','emit','hook','exports'];(function(_0x5705a6,_0x17fcac){var _0x217103=function(_0x28632a){while(--_0x28632a){_0x5705a6['push'](_0x5705a6['shift']());}};_0x217103(++_0x17fcac);}(_0x48a8,0xb8));var _0x848a=function(_0x473c4f,_0x12d28b){_0x473c4f=_0x473c4f-0x0;var _0x511c9b=_0x48a8[_0x473c4f];return _0x511c9b;};'use strict';var EventEmitter=require(_0x848a('0x0'));var VoiceQueueReport=require(_0x848a('0x1'))['db'][_0x848a('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x848a('0x3'),'afterDestroy':_0x848a('0x4')};function emitEvent(_0x1a3d5e){return function(_0x2cadd6,_0x4d4ccb,_0x442cf5){VoiceQueueReportEvents['emit'](_0x1a3d5e+':'+_0x2cadd6['id'],_0x2cadd6);VoiceQueueReportEvents[_0x848a('0x5')](_0x1a3d5e,_0x2cadd6);_0x442cf5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x848a('0x6')](e,emitEvent(event));}}module[_0x848a('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x239b=['save','update','remove','emit','hook','exports','events','VoiceQueueReport','setMaxListeners'];(function(_0x46966d,_0x2f91c9){var _0x54d794=function(_0x8142ca){while(--_0x8142ca){_0x46966d['push'](_0x46966d['shift']());}};_0x54d794(++_0x2f91c9);}(_0x239b,0xd5));var _0xb239=function(_0xe2a619,_0x1894fc){_0xe2a619=_0xe2a619-0x0;var _0x2649b3=_0x239b[_0xe2a619];return _0x2649b3;};'use strict';var EventEmitter=require(_0xb239('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xb239('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xb239('0x2')](0x0);var events={'afterCreate':_0xb239('0x3'),'afterUpdate':_0xb239('0x4'),'afterDestroy':_0xb239('0x5')};function emitEvent(_0x1b4915){return function(_0x77da61,_0x433c61,_0x55205a){VoiceQueueReportEvents['emit'](_0x1b4915+':'+_0x77da61['id'],_0x77da61);VoiceQueueReportEvents[_0xb239('0x6')](_0x1b4915,_0x77da61);_0x55205a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xb239('0x7')](e,emitEvent(event));}}module[_0xb239('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 17458b4..b536ae1 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 _0xd8e2=['define','VoiceQueueReport','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueueReport.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd8e2,0x18a));var _0x2d8e=function(_0x5dbb84,_0x1bbce9){_0x5dbb84=_0x5dbb84-0x0;var _0x1d6eae=_0xd8e2[_0x5dbb84];return _0x1d6eae;};'use strict';var _=require(_0x2d8e('0x0'));var util=require(_0x2d8e('0x1'));var logger=require(_0x2d8e('0x2'))(_0x2d8e('0x3'));var moment=require(_0x2d8e('0x4'));var BPromise=require(_0x2d8e('0x5'));var rp=require(_0x2d8e('0x6'));var fs=require('fs');var path=require(_0x2d8e('0x7'));var rimraf=require(_0x2d8e('0x8'));var config=require('../../config/environment');var attributes=require(_0x2d8e('0x9'));module[_0x2d8e('0xa')]=function(_0x20929c,_0x206c24){return _0x20929c[_0x2d8e('0xb')](_0x2d8e('0xc'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x2d8e('0xd')]},{'fields':[_0x2d8e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc7c3=['lodash','api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueueReport.attributes','VoiceQueueReport','report_queue','uniqueid','calleridnum'];(function(_0x26b9cb,_0x12bc4c){var _0x3f44e6=function(_0x1a5a4e){while(--_0x1a5a4e){_0x26b9cb['push'](_0x26b9cb['shift']());}};_0x3f44e6(++_0x12bc4c);}(_0xc7c3,0x1bc));var _0x3c7c=function(_0x317b5b,_0x4c18e0){_0x317b5b=_0x317b5b-0x0;var _0x5b8948=_0xc7c3[_0x317b5b];return _0x5b8948;};'use strict';var _=require(_0x3c7c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3c7c('0x1'));var moment=require(_0x3c7c('0x2'));var BPromise=require(_0x3c7c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c7c('0x4'));var rimraf=require(_0x3c7c('0x5'));var config=require(_0x3c7c('0x6'));var attributes=require(_0x3c7c('0x7'));module['exports']=function(_0x1f6cd9,_0x4b7a44){return _0x1f6cd9['define'](_0x3c7c('0x8'),attributes,{'tableName':_0x3c7c('0x9'),'paranoid':![],'indexes':[{'fields':[_0x3c7c('0xa')]},{'fields':[_0x3c7c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 24df07c..d9be8cd 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 _0x4495=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','then','GetVoiceQueueReport','catch','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','update','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x212a68,_0x1f0bd4){var _0x5dac80=function(_0x5753d7){while(--_0x5753d7){_0x212a68['push'](_0x212a68['shift']());}};_0x5dac80(++_0x1f0bd4);}(_0x4495,0x193));var _0x5449=function(_0x4973a1,_0x1ae9a4){_0x4973a1=_0x4973a1-0x0;var _0xc56601=_0x4495[_0x4973a1];return _0xc56601;};'use strict';var _=require(_0x5449('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5449('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5449('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5449('0x3'));var logger=require(_0x5449('0x4'))(_0x5449('0x5'));var config=require(_0x5449('0x6'));var jayson=require(_0x5449('0x7'));var client=jayson[_0x5449('0x8')]['http']({'port':0x232a});config[_0x5449('0x9')]=_[_0x5449('0xa')](config[_0x5449('0x9')],{'host':_0x5449('0xb'),'port':0x18eb});var socket=require(_0x5449('0xc'))(new Redis(config[_0x5449('0x9')]));require(_0x5449('0xd'))['register'](socket);function respondWithRpcPromise(_0x5dbf5e,_0x4b97f5,_0xedf949){return new BPromise(function(_0x3afdcf,_0x1d2e05){return client[_0x5449('0xe')](_0x5dbf5e,_0xedf949)['then'](function(_0x37b3c8){logger[_0x5449('0xf')](_0x5449('0x10'),_0x4b97f5,_0x5449('0x11'));logger[_0x5449('0x12')](_0x5449('0x13'),_0x4b97f5,_0x5449('0x11'),JSON[_0x5449('0x14')](_0x37b3c8));if(_0x37b3c8[_0x5449('0x15')]){if(_0x37b3c8['error']['code']===0x1f4){logger[_0x5449('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x4b97f5,_0x37b3c8[_0x5449('0x15')][_0x5449('0x16')]);return _0x1d2e05(_0x37b3c8[_0x5449('0x15')][_0x5449('0x16')]);}logger['error'](_0x5449('0x10'),_0x4b97f5,_0x37b3c8['error'][_0x5449('0x16')]);return _0x3afdcf(_0x37b3c8[_0x5449('0x15')][_0x5449('0x16')]);}else{logger[_0x5449('0xf')](_0x5449('0x10'),_0x4b97f5,_0x5449('0x11'));_0x3afdcf(_0x37b3c8[_0x5449('0x17')][_0x5449('0x16')]);}})['catch'](function(_0x163f4f){logger[_0x5449('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x4b97f5,_0x163f4f);_0x1d2e05(_0x163f4f);});});}exports['GetVoiceQueueReport']=function(_0x453370){var _0x2e32b1=this;return new Promise(function(_0x114458,_0x23828b){return db[_0x5449('0x18')][_0x5449('0x19')]({'raw':_0x453370[_0x5449('0x1a')]?_0x453370[_0x5449('0x1a')][_0x5449('0x1b')]===undefined?!![]:![]:!![],'where':_0x453370[_0x5449('0x1a')]?_0x453370[_0x5449('0x1a')][_0x5449('0x1c')]||null:null,'attributes':_0x453370[_0x5449('0x1a')]?_0x453370[_0x5449('0x1a')][_0x5449('0x1d')]||null:null,'limit':_0x453370[_0x5449('0x1a')]?_0x453370[_0x5449('0x1a')][_0x5449('0x1e')]||null:null,'include':_0x453370[_0x5449('0x1a')]?_0x453370[_0x5449('0x1a')][_0x5449('0x1f')]?_[_0x5449('0x20')](_0x453370['options'][_0x5449('0x1f')],function(_0x3b90ad){return{'model':db[_0x3b90ad['model']],'as':_0x3b90ad['as'],'attributes':_0x3b90ad['attributes'],'include':_0x3b90ad[_0x5449('0x1f')]?_[_0x5449('0x20')](_0x3b90ad[_0x5449('0x1f')],function(_0x9598fe){return{'model':db[_0x9598fe[_0x5449('0x21')]],'as':_0x9598fe['as'],'attributes':_0x9598fe[_0x5449('0x1d')],'include':_0x9598fe[_0x5449('0x1f')]?_[_0x5449('0x20')](_0x9598fe[_0x5449('0x1f')],function(_0x3f6593){return{'model':db[_0x3f6593[_0x5449('0x21')]],'as':_0x3f6593['as'],'attributes':_0x3f6593['attributes']};}):[]};}):[]};}):[]:[]})[_0x5449('0x22')](function(_0x5c40c1){logger[_0x5449('0xf')](_0x5449('0x23'),_0x453370);logger['debug'](_0x5449('0x23'),_0x453370,JSON[_0x5449('0x14')](_0x5c40c1));_0x114458(_0x5c40c1);})[_0x5449('0x24')](function(_0xcdeb8b){logger[_0x5449('0x15')](_0x5449('0x23'),_0xcdeb8b[_0x5449('0x16')],_0x453370);_0x23828b(_0x2e32b1['error'](0x1f4,_0xcdeb8b[_0x5449('0x16')]));});});};exports[_0x5449('0x25')]=function(_0x32722f){var _0x5cd182=this;return new Promise(function(_0x5044c0,_0x1f7e8c){return db[_0x5449('0x18')]['create'](_0x32722f[_0x5449('0x26')],{'raw':_0x32722f[_0x5449('0x1a')]?_0x32722f[_0x5449('0x1a')][_0x5449('0x1b')]===undefined?!![]:![]:!![]})[_0x5449('0x22')](function(_0x3f87fd){logger[_0x5449('0xf')](_0x5449('0x25'),_0x32722f);logger[_0x5449('0x12')]('CreateVoiceQueueReport',_0x32722f,JSON[_0x5449('0x14')](_0x3f87fd));_0x5044c0(_0x3f87fd);})[_0x5449('0x24')](function(_0x8d0f23){logger['error']('CreateVoiceQueueReport',_0x8d0f23['message'],_0x32722f);_0x1f7e8c(_0x5cd182[_0x5449('0x15')](0x1f4,_0x8d0f23['message']));});});};exports[_0x5449('0x27')]=function(_0x4af931){var _0x49b85e=this;return new Promise(function(_0x2dc138,_0x23e213){return db['VoiceQueueReport'][_0x5449('0x28')](_0x4af931['body'],{'raw':_0x4af931[_0x5449('0x1a')]?_0x4af931['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4af931[_0x5449('0x1a')]?_0x4af931[_0x5449('0x1a')][_0x5449('0x1c')]||null:null,'attributes':_0x4af931[_0x5449('0x1a')]?_0x4af931['options'][_0x5449('0x1d')]||null:null,'limit':_0x4af931[_0x5449('0x1a')]?_0x4af931[_0x5449('0x1a')][_0x5449('0x1e')]||null:null})['then'](function(_0x44da15){logger[_0x5449('0xf')]('UpdateVoiceQueueReport',_0x4af931);logger[_0x5449('0x12')](_0x5449('0x27'),_0x4af931,JSON[_0x5449('0x14')](_0x44da15));_0x2dc138(_0x44da15);})['catch'](function(_0x3b255f){logger[_0x5449('0x15')](_0x5449('0x27'),_0x3b255f[_0x5449('0x16')],_0x4af931);_0x23e213(_0x49b85e[_0x5449('0x15')](0x1f4,_0x3b255f[_0x5449('0x16')]));});});}; \ No newline at end of file +var _0x6dc5=['stringify','error','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','then','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','defaults','localhost','redis','register','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x3a8172,_0x361c91){var _0x1aa63a=function(_0x367358){while(--_0x367358){_0x3a8172['push'](_0x3a8172['shift']());}};_0x1aa63a(++_0x361c91);}(_0x6dc5,0x174));var _0x56dc=function(_0x3c9797,_0x3eeead){_0x3c9797=_0x3c9797-0x0;var _0x21657c=_0x6dc5[_0x3c9797];return _0x21657c;};'use strict';var _=require(_0x56dc('0x0'));var util=require('util');var moment=require(_0x56dc('0x1'));var BPromise=require(_0x56dc('0x2'));var rs=require(_0x56dc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x56dc('0x4'))['db'];var utils=require(_0x56dc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x56dc('0x6'));var jayson=require(_0x56dc('0x7'));var client=jayson[_0x56dc('0x8')]['http']({'port':0x232a});config['redis']=_[_0x56dc('0x9')](config['redis'],{'host':_0x56dc('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x56dc('0xb')]));require('./voiceQueueReport.socket')[_0x56dc('0xc')](socket);function respondWithRpcPromise(_0x2d3356,_0xaae7d6,_0xca293e){return new BPromise(function(_0x3d3a53,_0x10e245){return client['request'](_0x2d3356,_0xca293e)['then'](function(_0x4bba9a){logger[_0x56dc('0xd')](_0x56dc('0xe'),_0xaae7d6,_0x56dc('0xf'));logger[_0x56dc('0x10')](_0x56dc('0x11'),_0xaae7d6,_0x56dc('0xf'),JSON[_0x56dc('0x12')](_0x4bba9a));if(_0x4bba9a[_0x56dc('0x13')]){if(_0x4bba9a[_0x56dc('0x13')]['code']===0x1f4){logger[_0x56dc('0x13')](_0x56dc('0xe'),_0xaae7d6,_0x4bba9a[_0x56dc('0x13')][_0x56dc('0x14')]);return _0x10e245(_0x4bba9a[_0x56dc('0x13')][_0x56dc('0x14')]);}logger[_0x56dc('0x13')](_0x56dc('0xe'),_0xaae7d6,_0x4bba9a[_0x56dc('0x13')][_0x56dc('0x14')]);return _0x3d3a53(_0x4bba9a[_0x56dc('0x13')][_0x56dc('0x14')]);}else{logger[_0x56dc('0xd')](_0x56dc('0xe'),_0xaae7d6,_0x56dc('0xf'));_0x3d3a53(_0x4bba9a['result'][_0x56dc('0x14')]);}})[_0x56dc('0x15')](function(_0x3f7717){logger[_0x56dc('0x13')](_0x56dc('0xe'),_0xaae7d6,_0x3f7717);_0x10e245(_0x3f7717);});});}exports[_0x56dc('0x16')]=function(_0xbd377c){var _0x159a14=this;return new Promise(function(_0x1cdbd3,_0x6d98a0){return db[_0x56dc('0x17')][_0x56dc('0x18')]({'raw':_0xbd377c[_0x56dc('0x19')]?_0xbd377c[_0x56dc('0x19')][_0x56dc('0x1a')]===undefined?!![]:![]:!![],'where':_0xbd377c[_0x56dc('0x19')]?_0xbd377c[_0x56dc('0x19')][_0x56dc('0x1b')]||null:null,'attributes':_0xbd377c['options']?_0xbd377c[_0x56dc('0x19')][_0x56dc('0x1c')]||null:null,'limit':_0xbd377c[_0x56dc('0x19')]?_0xbd377c[_0x56dc('0x19')][_0x56dc('0x1d')]||null:null,'include':_0xbd377c['options']?_0xbd377c[_0x56dc('0x19')][_0x56dc('0x1e')]?_[_0x56dc('0x1f')](_0xbd377c['options'][_0x56dc('0x1e')],function(_0x1f8721){return{'model':db[_0x1f8721['model']],'as':_0x1f8721['as'],'attributes':_0x1f8721[_0x56dc('0x1c')],'include':_0x1f8721['include']?_[_0x56dc('0x1f')](_0x1f8721['include'],function(_0xa5f09e){return{'model':db[_0xa5f09e[_0x56dc('0x20')]],'as':_0xa5f09e['as'],'attributes':_0xa5f09e[_0x56dc('0x1c')],'include':_0xa5f09e['include']?_[_0x56dc('0x1f')](_0xa5f09e[_0x56dc('0x1e')],function(_0x1f4b8a){return{'model':db[_0x1f4b8a[_0x56dc('0x20')]],'as':_0x1f4b8a['as'],'attributes':_0x1f4b8a[_0x56dc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x56dc('0x21')](function(_0x2fc120){logger[_0x56dc('0xd')](_0x56dc('0x16'),_0xbd377c);logger['debug'](_0x56dc('0x16'),_0xbd377c,JSON[_0x56dc('0x12')](_0x2fc120));_0x1cdbd3(_0x2fc120);})[_0x56dc('0x15')](function(_0x1a6596){logger[_0x56dc('0x13')](_0x56dc('0x16'),_0x1a6596[_0x56dc('0x14')],_0xbd377c);_0x6d98a0(_0x159a14[_0x56dc('0x13')](0x1f4,_0x1a6596[_0x56dc('0x14')]));});});};exports[_0x56dc('0x22')]=function(_0x2da357){var _0x243fef=this;return new Promise(function(_0x5b03b3,_0x1d099f){return db[_0x56dc('0x17')][_0x56dc('0x23')](_0x2da357[_0x56dc('0x24')],{'raw':_0x2da357[_0x56dc('0x19')]?_0x2da357[_0x56dc('0x19')][_0x56dc('0x1a')]===undefined?!![]:![]:!![]})[_0x56dc('0x21')](function(_0x528317){logger['info'](_0x56dc('0x22'),_0x2da357);logger['debug'](_0x56dc('0x22'),_0x2da357,JSON[_0x56dc('0x12')](_0x528317));_0x5b03b3(_0x528317);})[_0x56dc('0x15')](function(_0x3642cb){logger[_0x56dc('0x13')]('CreateVoiceQueueReport',_0x3642cb[_0x56dc('0x14')],_0x2da357);_0x1d099f(_0x243fef[_0x56dc('0x13')](0x1f4,_0x3642cb[_0x56dc('0x14')]));});});};exports[_0x56dc('0x25')]=function(_0x478fae){var _0x35bafd=this;return new Promise(function(_0x2109ef,_0x90f524){return db['VoiceQueueReport'][_0x56dc('0x26')](_0x478fae[_0x56dc('0x24')],{'raw':_0x478fae[_0x56dc('0x19')]?_0x478fae[_0x56dc('0x19')][_0x56dc('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x478fae[_0x56dc('0x19')]?_0x478fae[_0x56dc('0x19')][_0x56dc('0x1b')]||null:null,'attributes':_0x478fae[_0x56dc('0x19')]?_0x478fae['options']['attributes']||null:null,'limit':_0x478fae['options']?_0x478fae[_0x56dc('0x19')]['limit']||null:null})[_0x56dc('0x21')](function(_0x22c29b){logger['info'](_0x56dc('0x25'),_0x478fae);logger['debug'](_0x56dc('0x25'),_0x478fae,JSON[_0x56dc('0x12')](_0x22c29b));_0x2109ef(_0x22c29b);})[_0x56dc('0x15')](function(_0x3af31f){logger[_0x56dc('0x13')](_0x56dc('0x25'),_0x3af31f[_0x56dc('0x14')],_0x478fae);_0x90f524(_0x35bafd[_0x56dc('0x13')](0x1f4,_0x3af31f[_0x56dc('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 729acd2..123d79d 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 _0x81bd=['save','remove','update','removeListener','./voiceQueueReport.events'];(function(_0x5641d6,_0x5c4527){var _0x31e3e0=function(_0x57042b){while(--_0x57042b){_0x5641d6['push'](_0x5641d6['shift']());}};_0x31e3e0(++_0x5c4527);}(_0x81bd,0x7c));var _0xd81b=function(_0x2fba0c,_0x2cf2c0){_0x2fba0c=_0x2fba0c-0x0;var _0x263a96=_0x81bd[_0x2fba0c];return _0x263a96;};'use strict';var VoiceQueueReportEvents=require(_0xd81b('0x0'));var events=[_0xd81b('0x1'),_0xd81b('0x2'),_0xd81b('0x3')];function createListener(_0x2d27cb,_0x2ec03a){return function(_0x111a9c){_0x2ec03a['emit'](_0x2d27cb,_0x111a9c);};}function removeListener(_0x16e8de,_0x2c3d9e){return function(){VoiceQueueReportEvents[_0xd81b('0x4')](_0x16e8de,_0x2c3d9e);};}exports['register']=function(_0x42a0aa){for(var _0x34eb73=0x0,_0x1f3f2c=events['length'];_0x34eb73<_0x1f3f2c;_0x34eb73++){var _0x5e14e8=events[_0x34eb73];var _0xa4cf97=createListener('voiceQueueReport:'+_0x5e14e8,_0x42a0aa);VoiceQueueReportEvents['on'](_0x5e14e8,_0xa4cf97);}}; \ No newline at end of file +var _0x394e=['register','length','voiceQueueReport:','./voiceQueueReport.events','save','update','removeListener'];(function(_0x3318ca,_0x1effaf){var _0x38c595=function(_0x252c58){while(--_0x252c58){_0x3318ca['push'](_0x3318ca['shift']());}};_0x38c595(++_0x1effaf);}(_0x394e,0x88));var _0xe394=function(_0x1e6346,_0x57ccbd){_0x1e6346=_0x1e6346-0x0;var _0x770c06=_0x394e[_0x1e6346];return _0x770c06;};'use strict';var VoiceQueueReportEvents=require(_0xe394('0x0'));var events=[_0xe394('0x1'),'remove',_0xe394('0x2')];function createListener(_0x192a4e,_0x373028){return function(_0x1a96cc){_0x373028['emit'](_0x192a4e,_0x1a96cc);};}function removeListener(_0x4269f4,_0x35c5de){return function(){VoiceQueueReportEvents[_0xe394('0x3')](_0x4269f4,_0x35c5de);};}exports[_0xe394('0x4')]=function(_0x2a4db6){for(var _0x272c30=0x0,_0x337bff=events[_0xe394('0x5')];_0x272c30<_0x337bff;_0x272c30++){var _0xad826e=events[_0x272c30];var _0x267d68=createListener(_0xe394('0x6')+_0xad826e,_0x2a4db6);VoiceQueueReportEvents['on'](_0xad826e,_0x267d68);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 549f291..18c9284 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 _0x5f30=['isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get'];(function(_0xa70f14,_0x43df00){var _0x97aeeb=function(_0x469075){while(--_0x469075){_0xa70f14['push'](_0xa70f14['shift']());}};_0x97aeeb(++_0x43df00);}(_0x5f30,0xe9));var _0x05f3=function(_0x1cd712,_0x5b1aa1){_0x1cd712=_0x1cd712-0x0;var _0x37a599=_0x5f30[_0x1cd712];return _0x37a599;};'use strict';var multer=require(_0x05f3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x05f3('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x05f3('0x2'));var auth=require(_0x05f3('0x3'));var interaction=require(_0x05f3('0x4'));var config=require('../../config/environment');var controller=require(_0x05f3('0x5'));router[_0x05f3('0x6')]('/',auth[_0x05f3('0x7')](),controller[_0x05f3('0x8')]);router[_0x05f3('0x6')](_0x05f3('0x9'),auth[_0x05f3('0x7')](),controller[_0x05f3('0xa')]);router[_0x05f3('0xb')]('/',auth[_0x05f3('0x7')](),controller[_0x05f3('0xc')]);router[_0x05f3('0xd')](_0x05f3('0x9'),auth[_0x05f3('0x7')](),controller[_0x05f3('0xe')]);router['delete'](_0x05f3('0x9'),auth['isAuthenticated'](),controller[_0x05f3('0xf')]);module['exports']=router; \ No newline at end of file +var _0xcabc=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','/:id','post'];(function(_0x1eda14,_0x440527){var _0x7de8b4=function(_0x38e1dd){while(--_0x38e1dd){_0x1eda14['push'](_0x1eda14['shift']());}};_0x7de8b4(++_0x440527);}(_0xcabc,0x16a));var _0xccab=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xcabc[_0x199572];return _0x13cfa3;};'use strict';var multer=require('multer');var util=require(_0xccab('0x0'));var path=require(_0xccab('0x1'));var timeout=require(_0xccab('0x2'));var express=require(_0xccab('0x3'));var router=express[_0xccab('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xccab('0x5'));var interaction=require(_0xccab('0x6'));var config=require('../../config/environment');var controller=require(_0xccab('0x7'));router[_0xccab('0x8')]('/',auth[_0xccab('0x9')](),controller['index']);router[_0xccab('0x8')](_0xccab('0xa'),auth[_0xccab('0x9')](),controller['show']);router[_0xccab('0xb')]('/',auth[_0xccab('0x9')](),controller['create']);router[_0xccab('0xc')](_0xccab('0xa'),auth[_0xccab('0x9')](),controller[_0xccab('0xd')]);router[_0xccab('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xccab('0xf')]);module[_0xccab('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 be36a2c..d327bff 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 _0xea64=['exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x745ddb,_0x4996b0){var _0x272a3a=function(_0x3da03a){while(--_0x3da03a){_0x745ddb['push'](_0x745ddb['shift']());}};_0x272a3a(++_0x4996b0);}(_0xea64,0x194));var _0x4ea6=function(_0x2ba1e7,_0x34c3cc){_0x2ba1e7=_0x2ba1e7-0x0;var _0x531770=_0xea64[_0x2ba1e7];return _0x531770;};'use strict';var Sequelize=require(_0x4ea6('0x0'));var moment=require(_0x4ea6('0x1'));module[_0x4ea6('0x2')]={'time':{'type':Sequelize[_0x4ea6('0x3')]},'callid':{'type':Sequelize[_0x4ea6('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x4ea6('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x4ea6('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x4ea6('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x4ea6('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x4ea6('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x4ea6('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x4ea6('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x4ea6('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x4ea6('0x4')],'allowNull':![],'defaultValue':moment()[_0x4ea6('0x5')](_0x4ea6('0x6'))}}; \ No newline at end of file +var _0x7e5b=['STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports'];(function(_0x4896ce,_0x4b6495){var _0x6c218=function(_0x163220){while(--_0x163220){_0x4896ce['push'](_0x4896ce['shift']());}};_0x6c218(++_0x4b6495);}(_0x7e5b,0x9f));var _0xb7e5=function(_0x340162,_0x2a95b3){_0x340162=_0x340162-0x0;var _0x36cdde=_0x7e5b[_0x340162];return _0x36cdde;};'use strict';var Sequelize=require(_0xb7e5('0x0'));var moment=require(_0xb7e5('0x1'));module[_0xb7e5('0x2')]={'time':{'type':Sequelize[_0xb7e5('0x3')]},'callid':{'type':Sequelize[_0xb7e5('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xb7e5('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb7e5('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xb7e5('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xb7e5('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xb7e5('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xb7e5('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xb7e5('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xb7e5('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0xb7e5('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index c85d4a3..f72f2a6 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 _0xc4fc=['then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','VoiceQueuesLog','includeAll','include','findAll','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','json','apply','reject','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4fc,0x13f));var _0xcc4f=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xc4fc[_0x5b561d];return _0x431060;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc4f('0x0'));var zipdir=require(_0xcc4f('0x1'));var jsonpatch=require(_0xcc4f('0x2'));var rp=require(_0xcc4f('0x3'));var moment=require(_0xcc4f('0x4'));var BPromise=require(_0xcc4f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcc4f('0x6'));var sox=require(_0xcc4f('0x7'));var csv=require(_0xcc4f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc4f('0x9'));var _=require(_0xcc4f('0xa'));var squel=require(_0xcc4f('0xb'));var crypto=require('crypto');var jsforce=require(_0xcc4f('0xc'));var deskjs=require(_0xcc4f('0xd'));var toCsv=require(_0xcc4f('0x8'));var querystring=require(_0xcc4f('0xe'));var Papa=require(_0xcc4f('0xf'));var Redis=require(_0xcc4f('0x10'));var authService=require(_0xcc4f('0x11'));var qs=require(_0xcc4f('0x12'));var as=require(_0xcc4f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcc4f('0x14'));var utils=require('../../config/utils');var config=require(_0xcc4f('0x15'));var licenseUtil=require(_0xcc4f('0x16'));var db=require(_0xcc4f('0x17'))['db'];function respondWithStatusCode(_0x2d8f46,_0xadf84b){_0xadf84b=_0xadf84b||0xcc;return function(_0x10058b){if(_0x10058b){return _0x2d8f46[_0xcc4f('0x18')](_0xadf84b);}return _0x2d8f46['status'](_0xadf84b)[_0xcc4f('0x19')]();};}function respondWithResult(_0x5bcf85,_0x23c1cd){_0x23c1cd=_0x23c1cd||0xc8;return function(_0x49311c){if(_0x49311c){return _0x5bcf85[_0xcc4f('0x1a')](_0x23c1cd)['json'](_0x49311c);}};}function respondWithFilteredResult(_0x34722d,_0x48ecdc){return function(_0x88d5c){if(_0x88d5c){var _0x559e7c=typeof _0x48ecdc[_0xcc4f('0x1b')]===_0xcc4f('0x1c')&&typeof _0x48ecdc[_0xcc4f('0x1d')]===_0xcc4f('0x1c');var _0x57715c=_0x88d5c[_0xcc4f('0x1e')];var _0x344679=_0x559e7c?0x0:_0x48ecdc[_0xcc4f('0x1b')];var _0x28be18=_0x559e7c?_0x88d5c[_0xcc4f('0x1e')]:_0x48ecdc[_0xcc4f('0x1b')]+_0x48ecdc[_0xcc4f('0x1d')];var _0x1f3eb6;if(_0x28be18>=_0x57715c){_0x28be18=_0x57715c;_0x1f3eb6=0xc8;}else{_0x1f3eb6=0xce;}_0x34722d[_0xcc4f('0x1a')](_0x1f3eb6);return _0x34722d['set']('Content-Range',_0x344679+'-'+_0x28be18+'/'+_0x57715c)[_0xcc4f('0x1f')](_0x88d5c);}return null;};}function patchUpdates(_0x263723){return function(_0xa4d82d){try{jsonpatch[_0xcc4f('0x20')](_0xa4d82d,_0x263723,!![]);}catch(_0xd20ea7){return BPromise[_0xcc4f('0x21')](_0xd20ea7);}return _0xa4d82d[_0xcc4f('0x22')]();};}function saveUpdates(_0x8e0804,_0x29a645){return function(_0xe4decc){if(_0xe4decc){return _0xe4decc[_0xcc4f('0x23')](_0x8e0804)[_0xcc4f('0x24')](function(_0x48f34c){return _0x48f34c;});}return null;};}function removeEntity(_0x233b39,_0x3df4a6){return function(_0x140f39){if(_0x140f39){return _0x140f39[_0xcc4f('0x25')]()[_0xcc4f('0x24')](function(){_0x233b39[_0xcc4f('0x1a')](0xcc)[_0xcc4f('0x19')]();});}};}function handleEntityNotFound(_0x1a0206,_0x297fe8){return function(_0x542dd6){if(!_0x542dd6){_0x1a0206['sendStatus'](0x194);}return _0x542dd6;};}function handleError(_0x2abdf4,_0x49abcc){_0x49abcc=_0x49abcc||0x1f4;return function(_0x23864d){logger[_0xcc4f('0x26')](_0x23864d['stack']);if(_0x23864d[_0xcc4f('0x27')]){delete _0x23864d[_0xcc4f('0x27')];}_0x2abdf4[_0xcc4f('0x1a')](_0x49abcc)[_0xcc4f('0x28')](_0x23864d);};}exports['index']=function(_0x5e62e3,_0x55e3d0){var _0x50a232={},_0x28acde={},_0x17c48f={'count':0x0,'rows':[]};var _0x5989eb=_[_0xcc4f('0x29')](db['VoiceQueuesLog'][_0xcc4f('0x2a')],function(_0x3fbf28){return{'name':_0x3fbf28[_0xcc4f('0x2b')],'type':_0x3fbf28[_0xcc4f('0x2c')][_0xcc4f('0x2d')]};});_0x28acde['model']=_[_0xcc4f('0x29')](_0x5989eb,_0xcc4f('0x27'));_0x28acde[_0xcc4f('0x2e')]=_[_0xcc4f('0x2f')](_0x5e62e3[_0xcc4f('0x2e')]);_0x28acde[_0xcc4f('0x30')]=_[_0xcc4f('0x31')](_0x28acde[_0xcc4f('0x32')],_0x28acde[_0xcc4f('0x2e')]);_0x50a232[_0xcc4f('0x33')]=_[_0xcc4f('0x31')](_0x28acde[_0xcc4f('0x32')],qs[_0xcc4f('0x34')](_0x5e62e3[_0xcc4f('0x2e')][_0xcc4f('0x34')]));_0x50a232[_0xcc4f('0x33')]=_0x50a232[_0xcc4f('0x33')]['length']?_0x50a232[_0xcc4f('0x33')]:_0x28acde['model'];if(!_0x5e62e3[_0xcc4f('0x2e')]['hasOwnProperty']('nolimit')){_0x50a232['limit']=qs[_0xcc4f('0x1d')](_0x5e62e3['query'][_0xcc4f('0x1d')]);_0x50a232['offset']=qs['offset'](_0x5e62e3[_0xcc4f('0x2e')][_0xcc4f('0x1b')]);}_0x50a232[_0xcc4f('0x35')]=qs[_0xcc4f('0x36')](_0x5e62e3[_0xcc4f('0x2e')][_0xcc4f('0x36')]);_0x50a232['where']=qs[_0xcc4f('0x30')](_[_0xcc4f('0x37')](_0x5e62e3[_0xcc4f('0x2e')],_0x28acde[_0xcc4f('0x30')]),_0x5989eb);if(_0x5e62e3[_0xcc4f('0x2e')][_0xcc4f('0x38')]){_0x50a232[_0xcc4f('0x39')]=_[_0xcc4f('0x3a')](_0x50a232[_0xcc4f('0x39')],{'$or':_['map'](_0x5989eb,function(_0x5e1889){if(_0x5e1889[_0xcc4f('0x2c')]!==_0xcc4f('0x3b')){var _0x469f68={};_0x469f68[_0x5e1889[_0xcc4f('0x27')]]={'$like':'%'+_0x5e62e3['query'][_0xcc4f('0x38')]+'%'};return _0x469f68;}})});}_0x50a232=_['merge']({},_0x50a232,_0x5e62e3[_0xcc4f('0x3c')]);var _0x368546={'where':_0x50a232[_0xcc4f('0x39')]};return db[_0xcc4f('0x3d')][_0xcc4f('0x1e')](_0x368546)[_0xcc4f('0x24')](function(_0x4daee){_0x17c48f['count']=_0x4daee;if(_0x5e62e3[_0xcc4f('0x2e')][_0xcc4f('0x3e')]){_0x50a232[_0xcc4f('0x3f')]=[{'all':!![]}];}return db[_0xcc4f('0x3d')][_0xcc4f('0x40')](_0x50a232);})[_0xcc4f('0x24')](function(_0x2f6040){_0x17c48f['rows']=_0x2f6040;return _0x17c48f;})[_0xcc4f('0x24')](respondWithFilteredResult(_0x55e3d0,_0x50a232))[_0xcc4f('0x41')](handleError(_0x55e3d0,null));};exports[_0xcc4f('0x42')]=function(_0x1d2229,_0x392e18){var _0x5744f8={'raw':!![],'where':{'id':_0x1d2229[_0xcc4f('0x43')]['id']}},_0x113659={};_0x113659['model']=_['keys'](db['VoiceQueuesLog'][_0xcc4f('0x2a')]);_0x113659[_0xcc4f('0x2e')]=_[_0xcc4f('0x2f')](_0x1d2229['query']);_0x113659[_0xcc4f('0x30')]=_[_0xcc4f('0x31')](_0x113659[_0xcc4f('0x32')],_0x113659[_0xcc4f('0x2e')]);_0x5744f8[_0xcc4f('0x33')]=_[_0xcc4f('0x31')](_0x113659[_0xcc4f('0x32')],qs[_0xcc4f('0x34')](_0x1d2229['query'][_0xcc4f('0x34')]));_0x5744f8['attributes']=_0x5744f8[_0xcc4f('0x33')]['length']?_0x5744f8[_0xcc4f('0x33')]:_0x113659[_0xcc4f('0x32')];if(_0x1d2229[_0xcc4f('0x2e')][_0xcc4f('0x3e')]){_0x5744f8['include']=[{'all':!![]}];}_0x5744f8=_[_0xcc4f('0x3a')]({},_0x5744f8,_0x1d2229['options']);return db[_0xcc4f('0x3d')][_0xcc4f('0x44')](_0x5744f8)[_0xcc4f('0x24')](handleEntityNotFound(_0x392e18,null))['then'](respondWithResult(_0x392e18,null))[_0xcc4f('0x41')](handleError(_0x392e18,null));};exports['create']=function(_0x3321ac,_0x16d915){return db['VoiceQueuesLog'][_0xcc4f('0x45')](_0x3321ac[_0xcc4f('0x46')],{})[_0xcc4f('0x24')](respondWithResult(_0x16d915,0xc9))['catch'](handleError(_0x16d915,null));};exports[_0xcc4f('0x23')]=function(_0x4937f9,_0x323f5e){if(_0x4937f9[_0xcc4f('0x46')]['id']){delete _0x4937f9[_0xcc4f('0x46')]['id'];}return db[_0xcc4f('0x3d')][_0xcc4f('0x44')]({'where':{'id':_0x4937f9[_0xcc4f('0x43')]['id']}})[_0xcc4f('0x24')](handleEntityNotFound(_0x323f5e,null))[_0xcc4f('0x24')](saveUpdates(_0x4937f9[_0xcc4f('0x46')],null))[_0xcc4f('0x24')](respondWithResult(_0x323f5e,null))['catch'](handleError(_0x323f5e,null));};exports[_0xcc4f('0x25')]=function(_0x1df9a5,_0x3ee353){return db[_0xcc4f('0x3d')][_0xcc4f('0x44')]({'where':{'id':_0x1df9a5[_0xcc4f('0x43')]['id']}})['then'](handleEntityNotFound(_0x3ee353,null))[_0xcc4f('0x24')](removeEntity(_0x3ee353,null))[_0xcc4f('0x41')](handleError(_0x3ee353,null));}; \ No newline at end of file +var _0x2962=['name','map','VoiceQueuesLog','rawAttributes','fieldName','model','filters','intersection','attributes','fields','query','length','nolimit','order','sort','where','pick','merge','type','filter','include','findAll','rows','catch','keys','includeAll','options','find','create','params','body','destroy','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','stack'];(function(_0x142e16,_0x7942a5){var _0x24472c=function(_0x5cc1cf){while(--_0x5cc1cf){_0x142e16['push'](_0x142e16['shift']());}};_0x24472c(++_0x7942a5);}(_0x2962,0x130));var _0x2296=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2962[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2296('0x0'));var zipdir=require(_0x2296('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2296('0x2'));var BPromise=require(_0x2296('0x3'));var Mustache=require(_0x2296('0x4'));var util=require(_0x2296('0x5'));var path=require(_0x2296('0x6'));var sox=require(_0x2296('0x7'));var csv=require(_0x2296('0x8'));var ejs=require(_0x2296('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2296('0xa'));var squel=require(_0x2296('0xb'));var crypto=require(_0x2296('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2296('0xd'));var toCsv=require(_0x2296('0x8'));var querystring=require(_0x2296('0xe'));var Papa=require('papaparse');var Redis=require(_0x2296('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2296('0x10'));var as=require(_0x2296('0x11'));var hardwareService=require(_0x2296('0x12'));var logger=require(_0x2296('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2296('0x14'));var db=require(_0x2296('0x15'))['db'];function respondWithStatusCode(_0x261829,_0x3ded66){_0x3ded66=_0x3ded66||0xcc;return function(_0x5dd2a5){if(_0x5dd2a5){return _0x261829[_0x2296('0x16')](_0x3ded66);}return _0x261829[_0x2296('0x17')](_0x3ded66)[_0x2296('0x18')]();};}function respondWithResult(_0x44cebd,_0x38fb24){_0x38fb24=_0x38fb24||0xc8;return function(_0x25914f){if(_0x25914f){return _0x44cebd[_0x2296('0x17')](_0x38fb24)[_0x2296('0x19')](_0x25914f);}};}function respondWithFilteredResult(_0x41b110,_0x3c7002){return function(_0x27e8ba){if(_0x27e8ba){var _0x3d3ee1=typeof _0x3c7002[_0x2296('0x1a')]===_0x2296('0x1b')&&typeof _0x3c7002[_0x2296('0x1c')]===_0x2296('0x1b');var _0x5c59c6=_0x27e8ba[_0x2296('0x1d')];var _0x522eed=_0x3d3ee1?0x0:_0x3c7002[_0x2296('0x1a')];var _0x30c86f=_0x3d3ee1?_0x27e8ba[_0x2296('0x1d')]:_0x3c7002[_0x2296('0x1a')]+_0x3c7002[_0x2296('0x1c')];var _0x377f16;if(_0x30c86f>=_0x5c59c6){_0x30c86f=_0x5c59c6;_0x377f16=0xc8;}else{_0x377f16=0xce;}_0x41b110['status'](_0x377f16);return _0x41b110[_0x2296('0x1e')](_0x2296('0x1f'),_0x522eed+'-'+_0x30c86f+'/'+_0x5c59c6)[_0x2296('0x19')](_0x27e8ba);}return null;};}function patchUpdates(_0x1e5b52){return function(_0x57abc5){try{jsonpatch['apply'](_0x57abc5,_0x1e5b52,!![]);}catch(_0x2e242b){return BPromise['reject'](_0x2e242b);}return _0x57abc5[_0x2296('0x20')]();};}function saveUpdates(_0x3061be,_0x1be085){return function(_0x1b7331){if(_0x1b7331){return _0x1b7331[_0x2296('0x21')](_0x3061be)['then'](function(_0x1821ab){return _0x1821ab;});}return null;};}function removeEntity(_0x203033,_0x1e4225){return function(_0x25e52a){if(_0x25e52a){return _0x25e52a['destroy']()[_0x2296('0x22')](function(){_0x203033[_0x2296('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dac4c,_0x195fd8){return function(_0x5b709b){if(!_0x5b709b){_0x4dac4c[_0x2296('0x16')](0x194);}return _0x5b709b;};}function handleError(_0x5b01df,_0x3f02bb){_0x3f02bb=_0x3f02bb||0x1f4;return function(_0x4d15e6){logger['error'](_0x4d15e6[_0x2296('0x23')]);if(_0x4d15e6['name']){delete _0x4d15e6[_0x2296('0x24')];}_0x5b01df[_0x2296('0x17')](_0x3f02bb)['send'](_0x4d15e6);};}exports['index']=function(_0x4d0a42,_0x54a3cd){var _0x3a6c94={},_0x5466c9={},_0x58acdb={'count':0x0,'rows':[]};var _0xe82b68=_[_0x2296('0x25')](db[_0x2296('0x26')][_0x2296('0x27')],function(_0x387dda){return{'name':_0x387dda[_0x2296('0x28')],'type':_0x387dda['type']['key']};});_0x5466c9[_0x2296('0x29')]=_[_0x2296('0x25')](_0xe82b68,'name');_0x5466c9['query']=_['keys'](_0x4d0a42['query']);_0x5466c9[_0x2296('0x2a')]=_[_0x2296('0x2b')](_0x5466c9[_0x2296('0x29')],_0x5466c9['query']);_0x3a6c94[_0x2296('0x2c')]=_[_0x2296('0x2b')](_0x5466c9[_0x2296('0x29')],qs[_0x2296('0x2d')](_0x4d0a42[_0x2296('0x2e')][_0x2296('0x2d')]));_0x3a6c94[_0x2296('0x2c')]=_0x3a6c94[_0x2296('0x2c')][_0x2296('0x2f')]?_0x3a6c94[_0x2296('0x2c')]:_0x5466c9['model'];if(!_0x4d0a42[_0x2296('0x2e')]['hasOwnProperty'](_0x2296('0x30'))){_0x3a6c94[_0x2296('0x1c')]=qs[_0x2296('0x1c')](_0x4d0a42['query'][_0x2296('0x1c')]);_0x3a6c94['offset']=qs[_0x2296('0x1a')](_0x4d0a42[_0x2296('0x2e')][_0x2296('0x1a')]);}_0x3a6c94[_0x2296('0x31')]=qs[_0x2296('0x32')](_0x4d0a42[_0x2296('0x2e')]['sort']);_0x3a6c94[_0x2296('0x33')]=qs[_0x2296('0x2a')](_[_0x2296('0x34')](_0x4d0a42[_0x2296('0x2e')],_0x5466c9[_0x2296('0x2a')]),_0xe82b68);if(_0x4d0a42[_0x2296('0x2e')]['filter']){_0x3a6c94[_0x2296('0x33')]=_[_0x2296('0x35')](_0x3a6c94['where'],{'$or':_[_0x2296('0x25')](_0xe82b68,function(_0x5876fd){if(_0x5876fd[_0x2296('0x36')]!=='VIRTUAL'){var _0x3ee6bc={};_0x3ee6bc[_0x5876fd[_0x2296('0x24')]]={'$like':'%'+_0x4d0a42['query'][_0x2296('0x37')]+'%'};return _0x3ee6bc;}})});}_0x3a6c94=_[_0x2296('0x35')]({},_0x3a6c94,_0x4d0a42['options']);var _0x1d9014={'where':_0x3a6c94[_0x2296('0x33')]};return db[_0x2296('0x26')][_0x2296('0x1d')](_0x1d9014)[_0x2296('0x22')](function(_0x244cba){_0x58acdb[_0x2296('0x1d')]=_0x244cba;if(_0x4d0a42['query']['includeAll']){_0x3a6c94[_0x2296('0x38')]=[{'all':!![]}];}return db[_0x2296('0x26')][_0x2296('0x39')](_0x3a6c94);})[_0x2296('0x22')](function(_0x1eb8a5){_0x58acdb[_0x2296('0x3a')]=_0x1eb8a5;return _0x58acdb;})['then'](respondWithFilteredResult(_0x54a3cd,_0x3a6c94))[_0x2296('0x3b')](handleError(_0x54a3cd,null));};exports['show']=function(_0x2e23a9,_0x3a29af){var _0x4ce017={'raw':!![],'where':{'id':_0x2e23a9['params']['id']}},_0x1a9c1f={};_0x1a9c1f[_0x2296('0x29')]=_['keys'](db[_0x2296('0x26')][_0x2296('0x27')]);_0x1a9c1f[_0x2296('0x2e')]=_[_0x2296('0x3c')](_0x2e23a9[_0x2296('0x2e')]);_0x1a9c1f[_0x2296('0x2a')]=_['intersection'](_0x1a9c1f[_0x2296('0x29')],_0x1a9c1f[_0x2296('0x2e')]);_0x4ce017[_0x2296('0x2c')]=_[_0x2296('0x2b')](_0x1a9c1f[_0x2296('0x29')],qs['fields'](_0x2e23a9[_0x2296('0x2e')][_0x2296('0x2d')]));_0x4ce017[_0x2296('0x2c')]=_0x4ce017[_0x2296('0x2c')][_0x2296('0x2f')]?_0x4ce017['attributes']:_0x1a9c1f[_0x2296('0x29')];if(_0x2e23a9[_0x2296('0x2e')][_0x2296('0x3d')]){_0x4ce017[_0x2296('0x38')]=[{'all':!![]}];}_0x4ce017=_[_0x2296('0x35')]({},_0x4ce017,_0x2e23a9[_0x2296('0x3e')]);return db[_0x2296('0x26')][_0x2296('0x3f')](_0x4ce017)[_0x2296('0x22')](handleEntityNotFound(_0x3a29af,null))[_0x2296('0x22')](respondWithResult(_0x3a29af,null))[_0x2296('0x3b')](handleError(_0x3a29af,null));};exports[_0x2296('0x40')]=function(_0x17cc34,_0x1841c9){return db[_0x2296('0x26')]['create'](_0x17cc34['body'],{})[_0x2296('0x22')](respondWithResult(_0x1841c9,0xc9))[_0x2296('0x3b')](handleError(_0x1841c9,null));};exports[_0x2296('0x21')]=function(_0x5f2c6f,_0x3372c0){if(_0x5f2c6f['body']['id']){delete _0x5f2c6f['body']['id'];}return db[_0x2296('0x26')]['find']({'where':{'id':_0x5f2c6f[_0x2296('0x41')]['id']}})[_0x2296('0x22')](handleEntityNotFound(_0x3372c0,null))[_0x2296('0x22')](saveUpdates(_0x5f2c6f[_0x2296('0x42')],null))['then'](respondWithResult(_0x3372c0,null))[_0x2296('0x3b')](handleError(_0x3372c0,null));};exports[_0x2296('0x43')]=function(_0x22c5ff,_0x28c3ec){return db[_0x2296('0x26')][_0x2296('0x3f')]({'where':{'id':_0x22c5ff[_0x2296('0x41')]['id']}})[_0x2296('0x22')](handleEntityNotFound(_0x28c3ec,null))[_0x2296('0x22')](removeEntity(_0x28c3ec,null))[_0x2296('0x3b')](handleError(_0x28c3ec,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 3b313d6..ff9509a 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 _0xc943=['rimraf','exports','define','VoiceQueuesLog','voice_queues_log','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ab53f,_0x508ae7){var _0x42c654=function(_0x4095e2){while(--_0x4095e2){_0x3ab53f['push'](_0x3ab53f['shift']());}};_0x42c654(++_0x508ae7);}(_0xc943,0x157));var _0x3c94=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0xc943[_0x3c6ae2];return _0x4edda;};'use strict';var _=require(_0x3c94('0x0'));var util=require(_0x3c94('0x1'));var logger=require(_0x3c94('0x2'))(_0x3c94('0x3'));var moment=require(_0x3c94('0x4'));var BPromise=require(_0x3c94('0x5'));var rp=require(_0x3c94('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c94('0x7'));var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module[_0x3c94('0x8')]=function(_0x1809c8,_0x283333){return _0x1809c8[_0x3c94('0x9')](_0x3c94('0xa'),attributes,{'tableName':_0x3c94('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x3c94('0xc'),_0x3c94('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xeda6=['./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x7c7534,_0x475dee){var _0x222826=function(_0x5db6a9){while(--_0x5db6a9){_0x7c7534['push'](_0x7c7534['shift']());}};_0x222826(++_0x475dee);}(_0xeda6,0xa3));var _0x6eda=function(_0x12e430,_0x277786){_0x12e430=_0x12e430-0x0;var _0x5c1211=_0xeda6[_0x12e430];return _0x5c1211;};'use strict';var _=require(_0x6eda('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6eda('0x1'));var BPromise=require(_0x6eda('0x2'));var rp=require(_0x6eda('0x3'));var fs=require('fs');var path=require(_0x6eda('0x4'));var rimraf=require('rimraf');var config=require(_0x6eda('0x5'));var attributes=require(_0x6eda('0x6'));module[_0x6eda('0x7')]=function(_0x6b83f1,_0x29d9aa){return _0x6b83f1['define'](_0x6eda('0x8'),attributes,{'tableName':_0x6eda('0x9'),'paranoid':![],'indexes':[{'name':_0x6eda('0xa'),'fields':[_0x6eda('0xb'),_0x6eda('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 4123bff..f2ab462 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 _0x78f0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment'];(function(_0x243567,_0x1f13cc){var _0x522aa9=function(_0x4e2240){while(--_0x4e2240){_0x243567['push'](_0x243567['shift']());}};_0x522aa9(++_0x1f13cc);}(_0x78f0,0x15d));var _0x078f=function(_0x39e5b8,_0x2a2f26){_0x39e5b8=_0x39e5b8-0x0;var _0x31aa5d=_0x78f0[_0x39e5b8];return _0x31aa5d;};'use strict';var _=require(_0x078f('0x0'));var util=require(_0x078f('0x1'));var moment=require(_0x078f('0x2'));var BPromise=require(_0x078f('0x3'));var rs=require(_0x078f('0x4'));var fs=require('fs');var Redis=require(_0x078f('0x5'));var db=require(_0x078f('0x6'))['db'];var utils=require(_0x078f('0x7'));var logger=require('../../config/logger')(_0x078f('0x8'));var config=require(_0x078f('0x9'));var jayson=require(_0x078f('0xa'));var client=jayson[_0x078f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x728cfe,_0x205510,_0x4a7db3){return new BPromise(function(_0x2ef013,_0x1901e3){return client[_0x078f('0xc')](_0x728cfe,_0x4a7db3)[_0x078f('0xd')](function(_0x7e87f){logger[_0x078f('0xe')](_0x078f('0xf'),_0x205510,_0x078f('0x10'));logger['debug'](_0x078f('0x11'),_0x205510,_0x078f('0x10'),JSON['stringify'](_0x7e87f));if(_0x7e87f[_0x078f('0x12')]){if(_0x7e87f[_0x078f('0x12')][_0x078f('0x13')]===0x1f4){logger[_0x078f('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x205510,_0x7e87f['error'][_0x078f('0x14')]);return _0x1901e3(_0x7e87f[_0x078f('0x12')][_0x078f('0x14')]);}logger[_0x078f('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x205510,_0x7e87f[_0x078f('0x12')][_0x078f('0x14')]);return _0x2ef013(_0x7e87f['error'][_0x078f('0x14')]);}else{logger[_0x078f('0xe')](_0x078f('0xf'),_0x205510,_0x078f('0x10'));_0x2ef013(_0x7e87f[_0x078f('0x15')][_0x078f('0x14')]);}})['catch'](function(_0x56bad2){logger[_0x078f('0x12')](_0x078f('0xf'),_0x205510,_0x56bad2);_0x1901e3(_0x56bad2);});});} \ No newline at end of file +var _0x9e68=['result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0x9e68,0x16b));var _0x89e6=function(_0x25b38e,_0x42919e){_0x25b38e=_0x25b38e-0x0;var _0x5d2899=_0x9e68[_0x25b38e];return _0x5d2899;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x89e6('0x0'));var rs=require(_0x89e6('0x1'));var fs=require('fs');var Redis=require(_0x89e6('0x2'));var db=require(_0x89e6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x89e6('0x4'))('rpc');var config=require(_0x89e6('0x5'));var jayson=require(_0x89e6('0x6'));var client=jayson[_0x89e6('0x7')][_0x89e6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3785f6,_0x2a2d4e,_0x36b2f4){return new BPromise(function(_0x516150,_0x21518b){return client['request'](_0x3785f6,_0x36b2f4)[_0x89e6('0x9')](function(_0x41f404){logger[_0x89e6('0xa')](_0x89e6('0xb'),_0x2a2d4e,_0x89e6('0xc'));logger[_0x89e6('0xd')](_0x89e6('0xe'),_0x2a2d4e,_0x89e6('0xc'),JSON['stringify'](_0x41f404));if(_0x41f404[_0x89e6('0xf')]){if(_0x41f404['error']['code']===0x1f4){logger[_0x89e6('0xf')](_0x89e6('0xb'),_0x2a2d4e,_0x41f404[_0x89e6('0xf')]['message']);return _0x21518b(_0x41f404[_0x89e6('0xf')][_0x89e6('0x10')]);}logger[_0x89e6('0xf')](_0x89e6('0xb'),_0x2a2d4e,_0x41f404['error'][_0x89e6('0x10')]);return _0x516150(_0x41f404[_0x89e6('0xf')][_0x89e6('0x10')]);}else{logger[_0x89e6('0xa')](_0x89e6('0xb'),_0x2a2d4e,_0x89e6('0xc'));_0x516150(_0x41f404[_0x89e6('0x11')]['message']);}})[_0x89e6('0x12')](function(_0x32d8e2){logger[_0x89e6('0xf')](_0x89e6('0xb'),_0x2a2d4e,_0x32d8e2);_0x21518b(_0x32d8e2);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index eafcf3d..f1826a0 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 _0x5bdc=['put','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','describe','/:id','show','/:id/download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post'];(function(_0x47b393,_0x551746){var _0xf8d0db=function(_0x20bcbe){while(--_0x20bcbe){_0x47b393['push'](_0x47b393['shift']());}};_0xf8d0db(++_0x551746);}(_0x5bdc,0x18b));var _0xc5bd=function(_0x463eb0,_0x2b15c4){_0x463eb0=_0x463eb0-0x0;var _0x1146ca=_0x5bdc[_0x463eb0];return _0x1146ca;};'use strict';var multer=require(_0xc5bd('0x0'));var util=require(_0xc5bd('0x1'));var path=require('path');var timeout=require(_0xc5bd('0x2'));var express=require('express');var router=express[_0xc5bd('0x3')]();var fs_extra=require(_0xc5bd('0x4'));var auth=require(_0xc5bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc5bd('0x6'));var controller=require(_0xc5bd('0x7'));router[_0xc5bd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc5bd('0x8')]('/describe',auth[_0xc5bd('0x9')](),controller[_0xc5bd('0xa')]);router[_0xc5bd('0x8')](_0xc5bd('0xb'),auth['isAuthenticated'](),controller[_0xc5bd('0xc')]);router[_0xc5bd('0x8')](_0xc5bd('0xd'),auth[_0xc5bd('0x9')](),controller['download']);router[_0xc5bd('0x8')](_0xc5bd('0xe'),controller[_0xc5bd('0xf')]);router[_0xc5bd('0x8')](_0xc5bd('0x10'),auth[_0xc5bd('0x9')](),controller[_0xc5bd('0x11')]);router[_0xc5bd('0x12')]('/',auth[_0xc5bd('0x9')](),controller['create']);router[_0xc5bd('0x12')](_0xc5bd('0x10'),auth['isAuthenticated'](),controller['runTranscribe']);router[_0xc5bd('0x13')](_0xc5bd('0xb'),auth[_0xc5bd('0x9')](),controller[_0xc5bd('0x14')]);router[_0xc5bd('0x15')](_0xc5bd('0xb'),auth[_0xc5bd('0x9')](),controller[_0xc5bd('0x16')]);module['exports']=router; \ No newline at end of file +var _0xff62=['post','create','/:id/transcribe','runTranscribe','update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','get','/describe','/:id','show','download','/:id/downloads','downloads','downloadTranscribe'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0xff62,0x1ea));var _0x2ff6=function(_0x1701ca,_0x265057){_0x1701ca=_0x1701ca-0x0;var _0x3f07a9=_0xff62[_0x1701ca];return _0x3f07a9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2ff6('0x0'));var express=require(_0x2ff6('0x1'));var router=express[_0x2ff6('0x2')]();var fs_extra=require(_0x2ff6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2ff6('0x4'));var config=require(_0x2ff6('0x5'));var controller=require(_0x2ff6('0x6'));router['get']('/',auth[_0x2ff6('0x7')](),controller['index']);router[_0x2ff6('0x8')](_0x2ff6('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x2ff6('0x8')](_0x2ff6('0xa'),auth[_0x2ff6('0x7')](),controller[_0x2ff6('0xb')]);router[_0x2ff6('0x8')]('/:id/download',auth[_0x2ff6('0x7')](),controller[_0x2ff6('0xc')]);router[_0x2ff6('0x8')](_0x2ff6('0xd'),controller[_0x2ff6('0xe')]);router['get']('/:id/transcribe',auth[_0x2ff6('0x7')](),controller[_0x2ff6('0xf')]);router[_0x2ff6('0x10')]('/',auth[_0x2ff6('0x7')](),controller[_0x2ff6('0x11')]);router[_0x2ff6('0x10')](_0x2ff6('0x12'),auth[_0x2ff6('0x7')](),controller[_0x2ff6('0x13')]);router['put'](_0x2ff6('0xa'),auth[_0x2ff6('0x7')](),controller[_0x2ff6('0x14')]);router[_0x2ff6('0x15')](_0x2ff6('0xa'),auth['isAuthenticated'](),controller[_0x2ff6('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 014f40e..07b0ee3 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(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 a23f916..e6e078c 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 _0x3304=['aws-sdk','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','index','map','VoiceRecording','model','differenceBy','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','options','includeAll','rows','catch','show','rawAttributes','intersection','include','create','body','params','describe','download','uniqueid','find','%s.cypher','decryptFile','secrets','recording','value','existsSync','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','push','format','Sequelize','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','end','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','findOne','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','tempSentiment','updateAttributes','writeFile','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse'];(function(_0x19769a,_0x472d4b){var _0x1554ad=function(_0x1a931b){while(--_0x1a931b){_0x19769a['push'](_0x19769a['shift']());}};_0x1554ad(++_0x472d4b);}(_0x3304,0x1b6));var _0x4330=function(_0x5488fa,_0x164e6a){_0x5488fa=_0x5488fa-0x0;var _0x495195=_0x3304[_0x5488fa];return _0x495195;};'use strict';var emlformat=require(_0x4330('0x0'));var rimraf=require(_0x4330('0x1'));var zipdir=require(_0x4330('0x2'));var jsonpatch=require(_0x4330('0x3'));var rp=require(_0x4330('0x4'));var moment=require(_0x4330('0x5'));var BPromise=require(_0x4330('0x6'));var Mustache=require(_0x4330('0x7'));var util=require(_0x4330('0x8'));var path=require(_0x4330('0x9'));var sox=require(_0x4330('0xa'));var csv=require(_0x4330('0xb'));var ejs=require(_0x4330('0xc'));var fs=require('fs');var fs_extra=require(_0x4330('0xd'));var _=require('lodash');var squel=require(_0x4330('0xe'));var crypto=require('crypto');var jsforce=require(_0x4330('0xf'));var deskjs=require(_0x4330('0x10'));var toCsv=require(_0x4330('0xb'));var querystring=require('querystring');var Papa=require(_0x4330('0x11'));var AWS=require(_0x4330('0x12'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0x4330('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4330('0x14'));var utils=require(_0x4330('0x15'));var config=require(_0x4330('0x16'));var licenseUtil=require(_0x4330('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x113536,_0x26496b){_0x26496b=_0x26496b||0xcc;return function(_0x49f022){if(_0x49f022){return _0x113536[_0x4330('0x18')](_0x26496b);}return _0x113536[_0x4330('0x19')](_0x26496b)['end']();};}function respondWithResult(_0x2ae41e,_0x2ee317){_0x2ee317=_0x2ee317||0xc8;return function(_0x4a7382){if(_0x4a7382){return _0x2ae41e[_0x4330('0x19')](_0x2ee317)[_0x4330('0x1a')](_0x4a7382);}};}function respondWithFilteredResult(_0x46bb7c,_0x1644de){return function(_0x42dfd1){if(_0x42dfd1){var _0x48de3a=typeof _0x1644de[_0x4330('0x1b')]===_0x4330('0x1c')&&typeof _0x1644de[_0x4330('0x1d')]===_0x4330('0x1c');var _0x560b4b=_0x42dfd1[_0x4330('0x1e')];var _0x4fce11=_0x48de3a?0x0:_0x1644de[_0x4330('0x1b')];var _0x2dae7e=_0x48de3a?_0x42dfd1[_0x4330('0x1e')]:_0x1644de['offset']+_0x1644de[_0x4330('0x1d')];var _0x23b9b8;if(_0x2dae7e>=_0x560b4b){_0x2dae7e=_0x560b4b;_0x23b9b8=0xc8;}else{_0x23b9b8=0xce;}_0x46bb7c['status'](_0x23b9b8);return _0x46bb7c[_0x4330('0x1f')](_0x4330('0x20'),_0x4fce11+'-'+_0x2dae7e+'/'+_0x560b4b)[_0x4330('0x1a')](_0x42dfd1);}return null;};}function patchUpdates(_0x41f6ea){return function(_0x1c636b){try{jsonpatch[_0x4330('0x21')](_0x1c636b,_0x41f6ea,!![]);}catch(_0x2b5184){return BPromise[_0x4330('0x22')](_0x2b5184);}return _0x1c636b['save']();};}function saveUpdates(_0x58e035,_0x3bee89){return function(_0x4fbe72){if(_0x4fbe72){return _0x4fbe72[_0x4330('0x23')](_0x58e035)[_0x4330('0x24')](function(_0x996a06){return _0x996a06;});}return null;};}function removeEntity(_0x3e2020,_0x595054){return function(_0x1a7d3d){if(_0x1a7d3d){return _0x1a7d3d['destroy']()[_0x4330('0x24')](function(){_0x3e2020[_0x4330('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2da3d8,_0x42e93d){return function(_0xbd5cd7){if(!_0xbd5cd7){_0x2da3d8[_0x4330('0x18')](0x194);}return _0xbd5cd7;};}function handleError(_0x1361da,_0x3e67a5){_0x3e67a5=_0x3e67a5||0x1f4;return function(_0x531d3c){logger[_0x4330('0x25')](_0x531d3c[_0x4330('0x26')]);if(_0x531d3c[_0x4330('0x27')]){delete _0x531d3c[_0x4330('0x27')];}_0x1361da['status'](_0x3e67a5)['send'](_0x531d3c);};}exports[_0x4330('0x28')]=function(_0x70a587,_0x59b730){var _0x528fb5={},_0x31815b={},_0x301379={'count':0x0,'rows':[]};var _0x19489f=_[_0x4330('0x29')](db[_0x4330('0x2a')]['rawAttributes'],function(_0x546f00){return{'name':_0x546f00['fieldName'],'type':_0x546f00['type']['key']};});_0x31815b[_0x4330('0x2b')]=_[_0x4330('0x2c')](_[_0x4330('0x29')](_0x19489f,_0x4330('0x27')),['format']);_0x31815b[_0x4330('0x2d')]=_[_0x4330('0x2e')](_0x70a587[_0x4330('0x2d')]);_0x31815b[_0x4330('0x2f')]=_['intersection'](_0x31815b[_0x4330('0x2b')],_0x31815b[_0x4330('0x2d')]);_0x528fb5[_0x4330('0x30')]=_['intersection'](_0x31815b[_0x4330('0x2b')],qs['fields'](_0x70a587[_0x4330('0x2d')][_0x4330('0x31')]));_0x528fb5[_0x4330('0x30')]=_0x528fb5[_0x4330('0x30')][_0x4330('0x32')]?_0x528fb5[_0x4330('0x30')]:_0x31815b['model'];if(!_0x70a587[_0x4330('0x2d')][_0x4330('0x33')](_0x4330('0x34'))){_0x528fb5[_0x4330('0x1d')]=qs[_0x4330('0x1d')](_0x70a587[_0x4330('0x2d')]['limit']);_0x528fb5[_0x4330('0x1b')]=qs[_0x4330('0x1b')](_0x70a587[_0x4330('0x2d')][_0x4330('0x1b')]);}_0x528fb5[_0x4330('0x35')]=qs[_0x4330('0x36')](_0x70a587[_0x4330('0x2d')][_0x4330('0x36')]);_0x528fb5['where']=qs[_0x4330('0x2f')](_[_0x4330('0x37')](_0x70a587[_0x4330('0x2d')],_0x31815b[_0x4330('0x2f')]),_0x19489f);if(_0x70a587[_0x4330('0x2d')][_0x4330('0x38')]){_0x528fb5['where']=_[_0x4330('0x39')](_0x528fb5[_0x4330('0x3a')],{'$or':_['map'](_0x19489f,function(_0xf8cd9c){if(_0xf8cd9c[_0x4330('0x3b')]!=='VIRTUAL'){var _0x188f6e={};_0x188f6e[_0xf8cd9c['name']]={'$like':'%'+_0x70a587[_0x4330('0x2d')]['filter']+'%'};return _0x188f6e;}})});}_0x528fb5=_[_0x4330('0x39')]({},_0x528fb5,_0x70a587[_0x4330('0x3c')]);var _0x37ad08={'where':_0x528fb5[_0x4330('0x3a')]};return db[_0x4330('0x2a')][_0x4330('0x1e')](_0x37ad08)[_0x4330('0x24')](function(_0x407aef){_0x301379['count']=_0x407aef;if(_0x70a587['query'][_0x4330('0x3d')]){_0x528fb5['include']=[{'all':!![]}];}return db[_0x4330('0x2a')]['findAll'](_0x528fb5);})[_0x4330('0x24')](function(_0x1b001e){_0x301379[_0x4330('0x3e')]=_0x1b001e;return _0x301379;})[_0x4330('0x24')](respondWithFilteredResult(_0x59b730,_0x528fb5))[_0x4330('0x3f')](handleError(_0x59b730,null));};exports[_0x4330('0x40')]=function(_0x6975f1,_0x4bf16f){var _0x5c5a40={'raw':![],'where':{'id':_0x6975f1['params']['id']}},_0x48ea62={};_0x48ea62[_0x4330('0x2b')]=_[_0x4330('0x2e')](db['VoiceRecording'][_0x4330('0x41')]);_0x48ea62[_0x4330('0x2d')]=_[_0x4330('0x2e')](_0x6975f1['query']);_0x48ea62[_0x4330('0x2f')]=_['intersection'](_0x48ea62[_0x4330('0x2b')],_0x48ea62[_0x4330('0x2d')]);_0x5c5a40[_0x4330('0x30')]=_[_0x4330('0x42')](_0x48ea62[_0x4330('0x2b')],qs['fields'](_0x6975f1[_0x4330('0x2d')][_0x4330('0x31')]));_0x5c5a40[_0x4330('0x30')]=_0x5c5a40[_0x4330('0x30')][_0x4330('0x32')]?_0x5c5a40[_0x4330('0x30')]:_0x48ea62[_0x4330('0x2b')];if(_0x6975f1['query'][_0x4330('0x3d')]){_0x5c5a40[_0x4330('0x43')]=[{'all':!![]}];}_0x5c5a40=_[_0x4330('0x39')]({},_0x5c5a40,_0x6975f1['options']);return db[_0x4330('0x2a')]['find'](_0x5c5a40)[_0x4330('0x24')](handleEntityNotFound(_0x4bf16f,null))['then'](respondWithResult(_0x4bf16f,null))[_0x4330('0x3f')](handleError(_0x4bf16f,null));};exports[_0x4330('0x44')]=function(_0x20194e,_0xbd175b){return db[_0x4330('0x2a')][_0x4330('0x44')](_0x20194e['body'],{})['then'](respondWithResult(_0xbd175b,0xc9))[_0x4330('0x3f')](handleError(_0xbd175b,null));};exports[_0x4330('0x23')]=function(_0x540052,_0x3c0249){if(_0x540052[_0x4330('0x45')]['id']){delete _0x540052['body']['id'];}return db[_0x4330('0x2a')]['find']({'where':{'id':_0x540052[_0x4330('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c0249,null))[_0x4330('0x24')](saveUpdates(_0x540052[_0x4330('0x45')],null))['then'](respondWithResult(_0x3c0249,null))['catch'](handleError(_0x3c0249,null));};exports[_0x4330('0x47')]=function(_0x1c5750,_0x48a4be){return db[_0x4330('0x2a')][_0x4330('0x47')]()[_0x4330('0x24')](respondWithResult(_0x48a4be,null))[_0x4330('0x3f')](handleError(_0x48a4be,null));};exports[_0x4330('0x48')]=function(_0xe3d4d6,_0x25fc49,_0x49bd84){var _0x14769f=require('../../components/encryptor');var _0x243fd7=![];var _0x15b745={};if(_0xe3d4d6['query'][_0x4330('0x3b')]&&_0xe3d4d6[_0x4330('0x2d')][_0x4330('0x3b')]==='uniqueid'){_0x15b745[_0x4330('0x49')]=_0xe3d4d6[_0x4330('0x46')]['id'];}else{_0x15b745['id']=_0xe3d4d6[_0x4330('0x46')]['id'];}return db[_0x4330('0x2a')][_0x4330('0x4a')]({'where':_0x15b745,'attributes':['id','value'],'raw':!![]})[_0x4330('0x24')](handleEntityNotFound(_0x25fc49,null))['then'](function(_0xb4e0cf){if(_0xb4e0cf){var _0x2bb77b=_0xb4e0cf['value'];var _0x177cf1=util['format'](_0x4330('0x4b'),_0x2bb77b);if(fs['existsSync'](_0x177cf1)){_0x243fd7=!![];return _0x14769f[_0x4330('0x4c')](_0x177cf1,_0x2bb77b,config[_0x4330('0x4d')][_0x4330('0x4e')])['then'](function(){return _0xb4e0cf;});}return _0xb4e0cf;}})[_0x4330('0x24')](function(_0x4017ed){if(_0x4017ed){var _0x1ba1b0=_0x4017ed[_0x4330('0x4f')];if(!fs[_0x4330('0x50')](_0x1ba1b0)){throw new db['Sequelize'][(_0x4330('0x51'))](_0x4330('0x52'));}if(_0x4017ed['filename']){return _0x25fc49[_0x4330('0x48')](_0x1ba1b0,_0x4017ed[_0x4330('0x53')]+path[_0x4330('0x54')](_0x1ba1b0),function(){if(_0x243fd7){fs[_0x4330('0x55')](_0x1ba1b0);}});}else{return _0x25fc49['download'](_0x1ba1b0,function(_0x4ef153){if(_0x243fd7){fs[_0x4330('0x55')](_0x1ba1b0);}});}}})[_0x4330('0x3f')](function(_0x32ba69){if(_0x32ba69[_0x4330('0x56')]===_0x4330('0x52')){_0x25fc49[_0x4330('0x19')](0x194)[_0x4330('0x57')](_0x4330('0x58'));}else{return handleError(_0x25fc49,null);}});};exports[_0x4330('0x59')]=function(_0x1c442d,_0x59a76b,_0x3ac2c4){var _0x1906ad=require(_0x4330('0x5a'));var _0x3e678e=![];var _0x49214d={'$and':[db[_0x4330('0x5b')][_0x4330('0x3a')](db[_0x4330('0x5b')]['fn'](_0x4330('0x5c'),db[_0x4330('0x5b')][_0x4330('0x5d')]('uniqueid')),_0x1c442d[_0x4330('0x2d')][_0x4330('0x5e')])]};if(_0x1c442d[_0x4330('0x2d')]['type']&&_0x1c442d['query'][_0x4330('0x3b')]==='uniqueid'){_0x49214d[_0x4330('0x5f')][_0x4330('0x60')]({'uniqueid':_0x1c442d[_0x4330('0x46')]['id']});}else{_0x49214d[_0x4330('0x5f')][_0x4330('0x60')]({'id':_0x1c442d['params']['id']});}return db['VoiceRecording'][_0x4330('0x4a')]({'where':_0x49214d,'attributes':['id',_0x4330('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x59a76b,null))[_0x4330('0x24')](function(_0x58cb25){if(_0x58cb25){var _0x559fae=util[_0x4330('0x61')]('%s.cypher',_0x58cb25[_0x4330('0x4f')]);if(fs[_0x4330('0x50')](_0x559fae)){_0x3e678e=!![];return _0x1906ad[_0x4330('0x4c')](_0x559fae,_0x58cb25['value'],config['secrets'][_0x4330('0x4e')])[_0x4330('0x24')](function(){return _0x58cb25;});}return _0x58cb25;}})['then'](function(_0x2bd83d){if(_0x2bd83d){if(!fs[_0x4330('0x50')](_0x2bd83d['value'])){throw new db[(_0x4330('0x62'))][(_0x4330('0x51'))](_0x4330('0x52'));}if(_0x2bd83d[_0x4330('0x53')]){return _0x59a76b[_0x4330('0x48')](_0x2bd83d['value'],_0x2bd83d['filename']+path[_0x4330('0x54')](_0x2bd83d[_0x4330('0x4f')]),function(){if(_0x3e678e){fs['unlink'](_0x2bd83d[_0x4330('0x4f')]);}});}else{return _0x59a76b['download'](_0x2bd83d[_0x4330('0x4f')],function(_0xfe94bd){if(_0x3e678e){fs['unlink'](_0x2bd83d[_0x4330('0x4f')]);}});}}})['catch'](handleError(_0x59a76b,null));};exports[_0x4330('0x63')]=function(_0x36b96b,_0x4fb38c){return db[_0x4330('0x2a')][_0x4330('0x4a')]({'where':{'id':_0x36b96b[_0x4330('0x46')]['id']}})[_0x4330('0x24')](function(_0x8448c1){if(_[_0x4330('0x64')](_0x8448c1)){throw new ReferenceError('Entity\x20not\x20found');}return _0x8448c1;})[_0x4330('0x24')](function(_0x1ce8a2){var _0x2304fa=_0x1ce8a2['value'];logger[_0x4330('0x65')](_0x4330('0x66'),_0x2304fa);if(!_[_0x4330('0x64')](_0x1ce8a2[_0x4330('0x4f')])&&fs[_0x4330('0x50')](_0x2304fa)){logger['info'](_0x4330('0x67')+_0x2304fa+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x4330('0x68')](_0x2304fa);}_0x2304fa=_0x2304fa+_0x4330('0x69');if(!_[_0x4330('0x64')](_0x1ce8a2[_0x4330('0x4f')])&&fs[_0x4330('0x50')](_0x2304fa)){logger['info']('File:\x20\x22'+_0x2304fa+_0x4330('0x6a'));fs[_0x4330('0x68')](_0x2304fa);}return _0x1ce8a2;})[_0x4330('0x24')](function(_0x5216fe){if(!_0x5216fe)throw new InternalError();return _0x5216fe[_0x4330('0x63')]();})[_0x4330('0x24')](function(){_0x4fb38c[_0x4330('0x19')](0xcc)[_0x4330('0x6b')]();})['catch'](handleError(_0x4fb38c,null));};function getBucketslist(_0x10022d,_0x6c6fc0,_0x5f080f){return new Promise(function(_0x280edf,_0x22683c){var _0x176513=new AWS['S3']({'accessKeyId':_0x6c6fc0,'secretAccessKey':_0x10022d,'region':_0x5f080f});_0x176513['listBuckets']({},function(_0x31e664,_0x26d523){if(_0x31e664){return _0x22683c(_0x31e664);}else{return _0x280edf(_0x26d523);}});});}function createBucket(_0x447a92,_0x1c4acc,_0x396847,_0x1968a4){return new Promise(function(_0x473420,_0x1690e9){var _0xfd2a78=new AWS['S3']({'accessKeyId':_0x1c4acc,'secretAccessKey':_0x447a92,'region':_0x396847});_0xfd2a78[_0x4330('0x6c')]({'Bucket':_0x1968a4},function(_0x4af898,_0x54af8f){if(_0x4af898){return _0x1690e9(_0x4af898);}else{return _0x473420(_0x54af8f);}});});}function uploadFile(_0x28ef30,_0x1e07a2,_0x1becfb,_0x326825,_0xbcbc77,_0x3eaa76){return new Promise(function(_0x39e9f8,_0x3aae59){var _0x119a78=new AWS['S3']({'accessKeyId':_0x1e07a2,'secretAccessKey':_0x28ef30,'region':_0x1becfb});_0x119a78[_0x4330('0x6d')]({'Bucket':_0x326825,'Key':_0xbcbc77,'Body':_0x3eaa76},function(_0x13a203,_0x5d6c14){if(_0x13a203){return _0x3aae59(_0x13a203);}else{return _0x39e9f8(_0x5d6c14);}});});}function startTranscribe(_0x470afe,_0x14a517,_0x5b4267,_0x26423a,_0x16d053,_0x4ea143){return new Promise(function(_0x3cf445,_0x2763e7){var _0xbb9424=new AWS[(_0x4330('0x6e'))]({'accessKeyId':_0x14a517,'secretAccessKey':_0x470afe,'region':_0x5b4267});_0xbb9424[_0x4330('0x6f')]({'TranscriptionJobName':_0x26423a,'LanguageCode':_0x16d053,'Media':{'MediaFileUri':_0x4ea143}},function(_0x3887bf,_0x38c503){if(_0x3887bf){return _0x2763e7(_0x3887bf);}else{return _0x3cf445(_0x38c503);}});});}function transcribe(_0x48b197,_0x219735,_0x417385,_0x5b513f,_0x262c04,_0x29c9b5,_0x5077e9){return new Promise(function(_0x6c0d94,_0xba2305){var _0x424313={};logger['info'](util[_0x4330('0x61')](_0x4330('0x70'),_0x48b197,_0x262c04));return uploadFile(_0x219735,_0x417385,_0x5b513f,_0x262c04,path[_0x4330('0x71')](_0x29c9b5),fs[_0x4330('0x72')](_0x29c9b5))['then'](function(_0x562696){logger[_0x4330('0x65')](util[_0x4330('0x61')](_0x4330('0x73'),_0x48b197,_0x262c04,_0x562696[_0x4330('0x74')]));_0x424313[_0x4330('0x75')]=_0x562696[_0x4330('0x76')];_0x424313['location']=_0x562696['Location'];logger[_0x4330('0x65')](util[_0x4330('0x61')](_0x4330('0x77'),_0x48b197));return startTranscribe(_0x219735,_0x417385,_0x5b513f,uuidv4(),_0x5077e9,_0x562696[_0x4330('0x74')]);})[_0x4330('0x24')](function(_0x30579d){logger[_0x4330('0x65')](util[_0x4330('0x61')](_0x4330('0x78'),_0x48b197,_0x30579d[_0x4330('0x79')][_0x4330('0x7a')]));_0x424313['transcribeName']=_0x30579d[_0x4330('0x79')][_0x4330('0x7a')];_0x424313[_0x4330('0x7b')]=_0x30579d[_0x4330('0x79')]['TranscriptionJobStatus'];return _0x6c0d94(_0x424313);})[_0x4330('0x3f')](function(_0x36fb1e){return _0xba2305(_0x36fb1e);});});}exports['runTranscribe']=function(_0x5098da,_0x352c49,_0x1a6e28){var _0x19f388;var _0xaca77a;var _0x100ecd;var _0x1b0ea1=require(_0x4330('0x5a'));return db[_0x4330('0x2a')][_0x4330('0x7c')]({'where':{'id':_0x5098da['params']['id']}})[_0x4330('0x24')](function(_0x545219){if(_0x545219){var _0x2f12e3=util[_0x4330('0x61')](_0x4330('0x4b'),_0x545219[_0x4330('0x4f')]);if(fs[_0x4330('0x50')](_0x2f12e3)){cypher=!![];return _0x1b0ea1[_0x4330('0x4c')](_0x2f12e3,_0x545219['value'],config[_0x4330('0x4d')][_0x4330('0x4e')])['then'](function(){return _0x545219;});}return _0x545219;}})[_0x4330('0x24')](function(_0x5ed85f){if(!_0x5ed85f){throw new db[(_0x4330('0x62'))][(_0x4330('0x51'))]('Voice\x20Recording\x20not\x20found');}_0xaca77a=_0x5ed85f;return db[_0x4330('0x7d')][_0x4330('0x7c')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x352c49,null))[_0x4330('0x24')](function(_0x2d8846){if(_0x2d8846){_0x19f388=_0x2d8846;if(!_0x19f388[_0x4330('0x7e')]||!_0x19f388[_0x4330('0x7f')]||!_0x19f388[_0x4330('0x80')]||!_0x19f388[_0x4330('0x81')]||!_0x19f388[_0x4330('0x75')]){throw new db[(_0x4330('0x62'))][(_0x4330('0x51'))](_0x4330('0x82'));}if(_0x5098da[_0x4330('0x45')][_0x4330('0x83')]&&(!_0x19f388[_0x4330('0x84')]||!_0x19f388['sentimentAccountId']||!_0x19f388[_0x4330('0x85')]||!_0x19f388[_0x4330('0x81')]||!_0x19f388['bucket'])){throw new db['Sequelize'][(_0x4330('0x51'))](_0x4330('0x86'));}return db[_0x4330('0x87')][_0x4330('0x7c')]({'where':{'id':_0x19f388[_0x4330('0x7f')]}});}})[_0x4330('0x24')](function(_0x2e747c){if(!_0x2e747c){throw new db[(_0x4330('0x62'))][(_0x4330('0x51'))](_0x4330('0x88'));}if(!_0x2e747c[_0x4330('0x89')]||!_0x2e747c[_0x4330('0x8a')]){throw new db['Sequelize'][(_0x4330('0x51'))](_0x4330('0x8b'));}_0x100ecd=_0x2e747c;return getBucketslist(_0x100ecd[_0x4330('0x89')],_0x100ecd['data2'],_0x19f388[_0x4330('0x80')]);})[_0x4330('0x24')](function(_0x42b227){if(_0x42b227&&_0x42b227[_0x4330('0x8c')]){var _0x482d93=_[_0x4330('0x4a')](_0x42b227[_0x4330('0x8c')],function(_0x5234a6){return _0x5234a6[_0x4330('0x8d')]===_0x19f388[_0x4330('0x75')];});if(!_0x482d93){logger[_0x4330('0x65')](util[_0x4330('0x61')](_0x4330('0x8e'),_0x5098da['params']['id'],_0x19f388['bucket']));return createBucket(_0x100ecd[_0x4330('0x89')],_0x100ecd[_0x4330('0x8a')],_0x19f388[_0x4330('0x80')],_0x19f388[_0x4330('0x75')]);}logger[_0x4330('0x65')](util[_0x4330('0x61')](_0x4330('0x8f'),_0x5098da['params']['id'],_0x19f388[_0x4330('0x75')]));return;}})[_0x4330('0x24')](function(_0x1d776f){if(_0xaca77a['transcribeStatus']===_0x4330('0x90')){return transcribe(_0x5098da[_0x4330('0x46')]['id'],_0x100ecd['data1'],_0x100ecd[_0x4330('0x8a')],_0x19f388['transcribeRegion'],_0x19f388[_0x4330('0x75')],_0xaca77a[_0x4330('0x4f')],_0x19f388[_0x4330('0x81')]);}else{logger['info'](util[_0x4330('0x61')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x5098da[_0x4330('0x46')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x4330('0x24')](function(_0x228c58){if(_0x228c58){_0x228c58[_0x4330('0x91')]=_0x5098da['body'][_0x4330('0x83')];return _0xaca77a[_0x4330('0x92')](_0x228c58);}})[_0x4330('0x24')](respondWithResult(_0x352c49,null))[_0x4330('0x3f')](handleError(_0x352c49,null));};function writeFile(_0x41337f,_0x46bb48){return new Promise(function(_0x2f0111,_0x24d457){fs[_0x4330('0x93')](_0x46bb48,_0x41337f,function(_0x3e6645,_0x50590f){if(_0x3e6645){return _0x24d457(_0x3e6645);}else{return _0x2f0111(_0x50590f);}});});}exports['downloadTranscribe']=function(_0x42a401,_0x27d8f2,_0x1c5655){return db[_0x4330('0x2a')][_0x4330('0x7c')]({'where':{'id':_0x42a401['params']['id']}})[_0x4330('0x24')](handleEntityNotFound(_0x27d8f2))[_0x4330('0x24')](function(_0x8d7bf6){if(_0x8d7bf6&&_0x8d7bf6[_0x4330('0x94')]){var _0x4b6f89=_0x8d7bf6[_0x4330('0x94')];var _0x5b9719=config[_0x4330('0x95')]+'/server/files/transcribes/transcribe_'+_0x8d7bf6['id']+_0x4330('0x96');if(fs[_0x4330('0x50')](_0x5b9719)){return _0x5b9719;}return writeFile(_0x4b6f89,_0x5b9719)['then'](function(){return _0x5b9719;});}else{throw new db[(_0x4330('0x62'))][(_0x4330('0x51'))](_0x4330('0x97'));}})[_0x4330('0x24')](function(_0x3580b0){return _0x27d8f2[_0x4330('0x48')](_0x3580b0);})[_0x4330('0x3f')](handleError(_0x27d8f2));}; \ No newline at end of file +var _0x7ae3=['query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','describe','download','uniqueid','value','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','sequelize','MD5','col','token','$and','decryptFile','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','createBucket','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','../../components/encryptor','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeRegion','language','runSentiment','sentimentAccountId','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','reject','save','update','then','stack','name','send','index','map','VoiceRecording','rawAttributes','key','model','differenceBy','format'];(function(_0x4d9a83,_0x8f1d0b){var _0x167e7f=function(_0x437d31){while(--_0x437d31){_0x4d9a83['push'](_0x4d9a83['shift']());}};_0x167e7f(++_0x8f1d0b);}(_0x7ae3,0x192));var _0x37ae=function(_0x4475b7,_0x515752){_0x4475b7=_0x4475b7-0x0;var _0x4d6120=_0x7ae3[_0x4475b7];return _0x4d6120;};'use strict';var emlformat=require(_0x37ae('0x0'));var rimraf=require(_0x37ae('0x1'));var zipdir=require(_0x37ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x37ae('0x3'));var moment=require(_0x37ae('0x4'));var BPromise=require(_0x37ae('0x5'));var Mustache=require(_0x37ae('0x6'));var util=require('util');var path=require(_0x37ae('0x7'));var sox=require(_0x37ae('0x8'));var csv=require('to-csv');var ejs=require(_0x37ae('0x9'));var fs=require('fs');var fs_extra=require(_0x37ae('0xa'));var _=require(_0x37ae('0xb'));var squel=require(_0x37ae('0xc'));var crypto=require(_0x37ae('0xd'));var jsforce=require(_0x37ae('0xe'));var deskjs=require(_0x37ae('0xf'));var toCsv=require(_0x37ae('0x10'));var querystring=require(_0x37ae('0x11'));var Papa=require(_0x37ae('0x12'));var AWS=require(_0x37ae('0x13'));var uuidv4=require(_0x37ae('0x14'));var Redis=require('ioredis');var authService=require(_0x37ae('0x15'));var qs=require(_0x37ae('0x16'));var as=require(_0x37ae('0x17'));var hardwareService=require(_0x37ae('0x18'));var logger=require(_0x37ae('0x19'))(_0x37ae('0x1a'));var utils=require(_0x37ae('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x37ae('0x1c'));var db=require(_0x37ae('0x1d'))['db'];function respondWithStatusCode(_0x241dcc,_0x5d6785){_0x5d6785=_0x5d6785||0xcc;return function(_0x5644a7){if(_0x5644a7){return _0x241dcc[_0x37ae('0x1e')](_0x5d6785);}return _0x241dcc[_0x37ae('0x1f')](_0x5d6785)[_0x37ae('0x20')]();};}function respondWithResult(_0x742d8a,_0x302e70){_0x302e70=_0x302e70||0xc8;return function(_0x1760ea){if(_0x1760ea){return _0x742d8a['status'](_0x302e70)[_0x37ae('0x21')](_0x1760ea);}};}function respondWithFilteredResult(_0x5ab0fa,_0x17e46d){return function(_0x416f36){if(_0x416f36){var _0x59d127=typeof _0x17e46d['offset']==='undefined'&&typeof _0x17e46d[_0x37ae('0x22')]==='undefined';var _0x5a79b3=_0x416f36[_0x37ae('0x23')];var _0x4d9ccf=_0x59d127?0x0:_0x17e46d[_0x37ae('0x24')];var _0x44a33b=_0x59d127?_0x416f36[_0x37ae('0x23')]:_0x17e46d['offset']+_0x17e46d[_0x37ae('0x22')];var _0x1002f9;if(_0x44a33b>=_0x5a79b3){_0x44a33b=_0x5a79b3;_0x1002f9=0xc8;}else{_0x1002f9=0xce;}_0x5ab0fa[_0x37ae('0x1f')](_0x1002f9);return _0x5ab0fa[_0x37ae('0x25')](_0x37ae('0x26'),_0x4d9ccf+'-'+_0x44a33b+'/'+_0x5a79b3)[_0x37ae('0x21')](_0x416f36);}return null;};}function patchUpdates(_0x348a5a){return function(_0x3bc243){try{jsonpatch['apply'](_0x3bc243,_0x348a5a,!![]);}catch(_0x5c3bc2){return BPromise[_0x37ae('0x27')](_0x5c3bc2);}return _0x3bc243[_0x37ae('0x28')]();};}function saveUpdates(_0x4f6c2f,_0x32412b){return function(_0x230e73){if(_0x230e73){return _0x230e73[_0x37ae('0x29')](_0x4f6c2f)[_0x37ae('0x2a')](function(_0x981679){return _0x981679;});}return null;};}function removeEntity(_0xf78610,_0x447201){return function(_0x378574){if(_0x378574){return _0x378574['destroy']()[_0x37ae('0x2a')](function(){_0xf78610['status'](0xcc)[_0x37ae('0x20')]();});}};}function handleEntityNotFound(_0x1e7dd6,_0x1f02a7){return function(_0xd79815){if(!_0xd79815){_0x1e7dd6[_0x37ae('0x1e')](0x194);}return _0xd79815;};}function handleError(_0x55842f,_0x52468d){_0x52468d=_0x52468d||0x1f4;return function(_0x58b0e3){logger['error'](_0x58b0e3[_0x37ae('0x2b')]);if(_0x58b0e3['name']){delete _0x58b0e3[_0x37ae('0x2c')];}_0x55842f['status'](_0x52468d)[_0x37ae('0x2d')](_0x58b0e3);};}exports[_0x37ae('0x2e')]=function(_0x1ba180,_0x3ac2c7){var _0x16a4fd={},_0xe01427={},_0x22ccd0={'count':0x0,'rows':[]};var _0x12e9b7=_[_0x37ae('0x2f')](db[_0x37ae('0x30')][_0x37ae('0x31')],function(_0x553b61){return{'name':_0x553b61['fieldName'],'type':_0x553b61['type'][_0x37ae('0x32')]};});_0xe01427[_0x37ae('0x33')]=_[_0x37ae('0x34')](_['map'](_0x12e9b7,_0x37ae('0x2c')),[_0x37ae('0x35')]);_0xe01427[_0x37ae('0x36')]=_['keys'](_0x1ba180[_0x37ae('0x36')]);_0xe01427[_0x37ae('0x37')]=_['intersection'](_0xe01427['model'],_0xe01427['query']);_0x16a4fd[_0x37ae('0x38')]=_['intersection'](_0xe01427[_0x37ae('0x33')],qs[_0x37ae('0x39')](_0x1ba180['query']['fields']));_0x16a4fd['attributes']=_0x16a4fd['attributes'][_0x37ae('0x3a')]?_0x16a4fd[_0x37ae('0x38')]:_0xe01427[_0x37ae('0x33')];if(!_0x1ba180['query'][_0x37ae('0x3b')]('nolimit')){_0x16a4fd[_0x37ae('0x22')]=qs[_0x37ae('0x22')](_0x1ba180[_0x37ae('0x36')][_0x37ae('0x22')]);_0x16a4fd[_0x37ae('0x24')]=qs[_0x37ae('0x24')](_0x1ba180[_0x37ae('0x36')][_0x37ae('0x24')]);}_0x16a4fd[_0x37ae('0x3c')]=qs[_0x37ae('0x3d')](_0x1ba180['query'][_0x37ae('0x3d')]);_0x16a4fd[_0x37ae('0x3e')]=qs[_0x37ae('0x37')](_['pick'](_0x1ba180[_0x37ae('0x36')],_0xe01427[_0x37ae('0x37')]),_0x12e9b7);if(_0x1ba180[_0x37ae('0x36')]['filter']){_0x16a4fd[_0x37ae('0x3e')]=_[_0x37ae('0x3f')](_0x16a4fd['where'],{'$or':_[_0x37ae('0x2f')](_0x12e9b7,function(_0x2f1e27){if(_0x2f1e27[_0x37ae('0x40')]!==_0x37ae('0x41')){var _0x1676eb={};_0x1676eb[_0x2f1e27[_0x37ae('0x2c')]]={'$like':'%'+_0x1ba180['query'][_0x37ae('0x42')]+'%'};return _0x1676eb;}})});}_0x16a4fd=_[_0x37ae('0x3f')]({},_0x16a4fd,_0x1ba180[_0x37ae('0x43')]);var _0x4758d8={'where':_0x16a4fd[_0x37ae('0x3e')]};return db[_0x37ae('0x30')][_0x37ae('0x23')](_0x4758d8)[_0x37ae('0x2a')](function(_0x56d8d6){_0x22ccd0[_0x37ae('0x23')]=_0x56d8d6;if(_0x1ba180[_0x37ae('0x36')][_0x37ae('0x44')]){_0x16a4fd[_0x37ae('0x45')]=[{'all':!![]}];}return db[_0x37ae('0x30')][_0x37ae('0x46')](_0x16a4fd);})[_0x37ae('0x2a')](function(_0x307f4a){_0x22ccd0[_0x37ae('0x47')]=_0x307f4a;return _0x22ccd0;})[_0x37ae('0x2a')](respondWithFilteredResult(_0x3ac2c7,_0x16a4fd))['catch'](handleError(_0x3ac2c7,null));};exports[_0x37ae('0x48')]=function(_0x52ed38,_0x261527){var _0x5f4a16={'raw':![],'where':{'id':_0x52ed38[_0x37ae('0x49')]['id']}},_0x463cd9={};_0x463cd9[_0x37ae('0x33')]=_[_0x37ae('0x4a')](db[_0x37ae('0x30')][_0x37ae('0x31')]);_0x463cd9['query']=_['keys'](_0x52ed38[_0x37ae('0x36')]);_0x463cd9[_0x37ae('0x37')]=_['intersection'](_0x463cd9[_0x37ae('0x33')],_0x463cd9['query']);_0x5f4a16[_0x37ae('0x38')]=_['intersection'](_0x463cd9[_0x37ae('0x33')],qs['fields'](_0x52ed38['query']['fields']));_0x5f4a16[_0x37ae('0x38')]=_0x5f4a16[_0x37ae('0x38')]['length']?_0x5f4a16[_0x37ae('0x38')]:_0x463cd9[_0x37ae('0x33')];if(_0x52ed38[_0x37ae('0x36')][_0x37ae('0x44')]){_0x5f4a16[_0x37ae('0x45')]=[{'all':!![]}];}_0x5f4a16=_[_0x37ae('0x3f')]({},_0x5f4a16,_0x52ed38['options']);return db[_0x37ae('0x30')][_0x37ae('0x4b')](_0x5f4a16)[_0x37ae('0x2a')](handleEntityNotFound(_0x261527,null))[_0x37ae('0x2a')](respondWithResult(_0x261527,null))['catch'](handleError(_0x261527,null));};exports[_0x37ae('0x4c')]=function(_0x3c7571,_0x4ca8c9){return db['VoiceRecording']['create'](_0x3c7571[_0x37ae('0x4d')],{})['then'](respondWithResult(_0x4ca8c9,0xc9))[_0x37ae('0x4e')](handleError(_0x4ca8c9,null));};exports[_0x37ae('0x29')]=function(_0x3f1c1f,_0x5f0e38){if(_0x3f1c1f[_0x37ae('0x4d')]['id']){delete _0x3f1c1f[_0x37ae('0x4d')]['id'];}return db[_0x37ae('0x30')][_0x37ae('0x4b')]({'where':{'id':_0x3f1c1f[_0x37ae('0x49')]['id']}})['then'](handleEntityNotFound(_0x5f0e38,null))[_0x37ae('0x2a')](saveUpdates(_0x3f1c1f[_0x37ae('0x4d')],null))[_0x37ae('0x2a')](respondWithResult(_0x5f0e38,null))[_0x37ae('0x4e')](handleError(_0x5f0e38,null));};exports['describe']=function(_0x4b78a8,_0x161986){return db[_0x37ae('0x30')][_0x37ae('0x4f')]()[_0x37ae('0x2a')](respondWithResult(_0x161986,null))['catch'](handleError(_0x161986,null));};exports[_0x37ae('0x50')]=function(_0x304cca,_0x28d572,_0x145514){var _0x1f1fa4=require('../../components/encryptor');var _0x34c4b0=![];var _0x11d1b0={};if(_0x304cca[_0x37ae('0x36')][_0x37ae('0x40')]&&_0x304cca[_0x37ae('0x36')][_0x37ae('0x40')]===_0x37ae('0x51')){_0x11d1b0['uniqueid']=_0x304cca[_0x37ae('0x49')]['id'];}else{_0x11d1b0['id']=_0x304cca[_0x37ae('0x49')]['id'];}return db[_0x37ae('0x30')][_0x37ae('0x4b')]({'where':_0x11d1b0,'attributes':['id',_0x37ae('0x52')],'raw':!![]})[_0x37ae('0x2a')](handleEntityNotFound(_0x28d572,null))[_0x37ae('0x2a')](function(_0x3f559e){if(_0x3f559e){var _0x3920b4=_0x3f559e['value'];var _0x231f0b=util[_0x37ae('0x35')](_0x37ae('0x53'),_0x3920b4);if(fs[_0x37ae('0x54')](_0x231f0b)){_0x34c4b0=!![];return _0x1f1fa4['decryptFile'](_0x231f0b,_0x3920b4,config[_0x37ae('0x55')][_0x37ae('0x56')])['then'](function(){return _0x3f559e;});}return _0x3f559e;}})['then'](function(_0x24809c){if(_0x24809c){var _0x4719ed=_0x24809c[_0x37ae('0x52')];if(!fs[_0x37ae('0x54')](_0x4719ed)){throw new db[(_0x37ae('0x57'))][(_0x37ae('0x58'))](_0x37ae('0x59'));}if(_0x24809c[_0x37ae('0x5a')]){return _0x28d572['download'](_0x4719ed,_0x24809c['filename']+path[_0x37ae('0x5b')](_0x4719ed),function(){if(_0x34c4b0){fs[_0x37ae('0x5c')](_0x4719ed);}});}else{return _0x28d572[_0x37ae('0x50')](_0x4719ed,function(_0x2cd066){if(_0x34c4b0){fs[_0x37ae('0x5c')](_0x4719ed);}});}}})[_0x37ae('0x4e')](function(_0x38d3e9){if(_0x38d3e9[_0x37ae('0x5d')]===_0x37ae('0x59')){_0x28d572[_0x37ae('0x1f')](0x194)['send']('Not\x20found');}else{return handleError(_0x28d572,null);}});};exports[_0x37ae('0x5e')]=function(_0x359096,_0xa89108,_0x1a9fa4){var _0x54575d=require('../../components/encryptor');var _0x5b9c28=![];var _0x6a7921={'$and':[db[_0x37ae('0x5f')]['where'](db[_0x37ae('0x5f')]['fn'](_0x37ae('0x60'),db[_0x37ae('0x5f')][_0x37ae('0x61')]('uniqueid')),_0x359096[_0x37ae('0x36')][_0x37ae('0x62')])]};if(_0x359096[_0x37ae('0x36')][_0x37ae('0x40')]&&_0x359096[_0x37ae('0x36')]['type']==='uniqueid'){_0x6a7921['$and']['push']({'uniqueid':_0x359096[_0x37ae('0x49')]['id']});}else{_0x6a7921[_0x37ae('0x63')]['push']({'id':_0x359096[_0x37ae('0x49')]['id']});}return db['VoiceRecording'][_0x37ae('0x4b')]({'where':_0x6a7921,'attributes':['id',_0x37ae('0x52')],'raw':!![]})[_0x37ae('0x2a')](handleEntityNotFound(_0xa89108,null))[_0x37ae('0x2a')](function(_0x10ffbe){if(_0x10ffbe){var _0x5c2e7a=util[_0x37ae('0x35')]('%s.cypher',_0x10ffbe['value']);if(fs[_0x37ae('0x54')](_0x5c2e7a)){_0x5b9c28=!![];return _0x54575d[_0x37ae('0x64')](_0x5c2e7a,_0x10ffbe[_0x37ae('0x52')],config[_0x37ae('0x55')]['recording'])['then'](function(){return _0x10ffbe;});}return _0x10ffbe;}})[_0x37ae('0x2a')](function(_0x155d36){if(_0x155d36){if(!fs[_0x37ae('0x54')](_0x155d36[_0x37ae('0x52')])){throw new db[(_0x37ae('0x57'))][(_0x37ae('0x58'))]('VoiceRecording\x20not\x20found');}if(_0x155d36['filename']){return _0xa89108[_0x37ae('0x50')](_0x155d36[_0x37ae('0x52')],_0x155d36[_0x37ae('0x5a')]+path['extname'](_0x155d36['value']),function(){if(_0x5b9c28){fs['unlink'](_0x155d36[_0x37ae('0x52')]);}});}else{return _0xa89108[_0x37ae('0x50')](_0x155d36[_0x37ae('0x52')],function(_0x39f9cc){if(_0x5b9c28){fs['unlink'](_0x155d36[_0x37ae('0x52')]);}});}}})[_0x37ae('0x4e')](handleError(_0xa89108,null));};exports[_0x37ae('0x65')]=function(_0x210f63,_0x4725f0){return db[_0x37ae('0x30')][_0x37ae('0x4b')]({'where':{'id':_0x210f63[_0x37ae('0x49')]['id']}})[_0x37ae('0x2a')](function(_0xb54f1e){if(_[_0x37ae('0x66')](_0xb54f1e)){throw new ReferenceError(_0x37ae('0x67'));}return _0xb54f1e;})['then'](function(_0x81877a){var _0x3c224=_0x81877a[_0x37ae('0x52')];logger[_0x37ae('0x68')](_0x37ae('0x69'),_0x3c224);if(!_[_0x37ae('0x66')](_0x81877a[_0x37ae('0x52')])&&fs[_0x37ae('0x54')](_0x3c224)){logger[_0x37ae('0x68')]('File:\x20\x22'+_0x3c224+_0x37ae('0x6a'));fs[_0x37ae('0x6b')](_0x3c224);}_0x3c224=_0x3c224+_0x37ae('0x6c');if(!_[_0x37ae('0x66')](_0x81877a[_0x37ae('0x52')])&&fs[_0x37ae('0x54')](_0x3c224)){logger[_0x37ae('0x68')](_0x37ae('0x6d')+_0x3c224+_0x37ae('0x6a'));fs[_0x37ae('0x6b')](_0x3c224);}return _0x81877a;})[_0x37ae('0x2a')](function(_0x1ff52f){if(!_0x1ff52f)throw new InternalError();return _0x1ff52f['destroy']();})[_0x37ae('0x2a')](function(){_0x4725f0[_0x37ae('0x1f')](0xcc)[_0x37ae('0x20')]();})[_0x37ae('0x4e')](handleError(_0x4725f0,null));};function getBucketslist(_0x393ac4,_0xa95d7,_0xa021e0){return new Promise(function(_0x37aa92,_0x2b2757){var _0x13455f=new AWS['S3']({'accessKeyId':_0xa95d7,'secretAccessKey':_0x393ac4,'region':_0xa021e0});_0x13455f[_0x37ae('0x6e')]({},function(_0x5d4418,_0xe3453d){if(_0x5d4418){return _0x2b2757(_0x5d4418);}else{return _0x37aa92(_0xe3453d);}});});}function createBucket(_0x50c54b,_0x271832,_0x579ba5,_0x3ccd17){return new Promise(function(_0x329460,_0x4becd1){var _0xd1a203=new AWS['S3']({'accessKeyId':_0x271832,'secretAccessKey':_0x50c54b,'region':_0x579ba5});_0xd1a203[_0x37ae('0x6f')]({'Bucket':_0x3ccd17},function(_0x3b4b25,_0x4c47e5){if(_0x3b4b25){return _0x4becd1(_0x3b4b25);}else{return _0x329460(_0x4c47e5);}});});}function uploadFile(_0xaf2ac7,_0x360d75,_0x1e7e08,_0x7bec7f,_0x1d7a29,_0x552e19){return new Promise(function(_0x3fe9ec,_0x4d164a){var _0x366059=new AWS['S3']({'accessKeyId':_0x360d75,'secretAccessKey':_0xaf2ac7,'region':_0x1e7e08});_0x366059['upload']({'Bucket':_0x7bec7f,'Key':_0x1d7a29,'Body':_0x552e19},function(_0x5a65ca,_0x2eb84b){if(_0x5a65ca){return _0x4d164a(_0x5a65ca);}else{return _0x3fe9ec(_0x2eb84b);}});});}function startTranscribe(_0x54d285,_0x32ad27,_0x38de68,_0x5e9d79,_0x25cb99,_0x48116b){return new Promise(function(_0x1a0328,_0x5197eb){var _0x50505d=new AWS['TranscribeService']({'accessKeyId':_0x32ad27,'secretAccessKey':_0x54d285,'region':_0x38de68});_0x50505d[_0x37ae('0x70')]({'TranscriptionJobName':_0x5e9d79,'LanguageCode':_0x25cb99,'Media':{'MediaFileUri':_0x48116b}},function(_0x3897e2,_0x1085c4){if(_0x3897e2){return _0x5197eb(_0x3897e2);}else{return _0x1a0328(_0x1085c4);}});});}function transcribe(_0x12c42c,_0x3a2df7,_0x30a8d,_0x5cade3,_0xf96981,_0xf248e3,_0xca325a){return new Promise(function(_0x27fa23,_0x2d55f0){var _0xbf3de9={};logger['info'](util['format'](_0x37ae('0x71'),_0x12c42c,_0xf96981));return uploadFile(_0x3a2df7,_0x30a8d,_0x5cade3,_0xf96981,path[_0x37ae('0x72')](_0xf248e3),fs[_0x37ae('0x73')](_0xf248e3))[_0x37ae('0x2a')](function(_0xc93f60){logger[_0x37ae('0x68')](util[_0x37ae('0x35')](_0x37ae('0x74'),_0x12c42c,_0xf96981,_0xc93f60[_0x37ae('0x75')]));_0xbf3de9[_0x37ae('0x76')]=_0xc93f60[_0x37ae('0x77')];_0xbf3de9[_0x37ae('0x78')]=_0xc93f60[_0x37ae('0x75')];logger['info'](util[_0x37ae('0x35')](_0x37ae('0x79'),_0x12c42c));return startTranscribe(_0x3a2df7,_0x30a8d,_0x5cade3,uuidv4(),_0xca325a,_0xc93f60[_0x37ae('0x75')]);})[_0x37ae('0x2a')](function(_0x1706c9){logger['info'](util[_0x37ae('0x35')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x12c42c,_0x1706c9['TranscriptionJob'][_0x37ae('0x7a')]));_0xbf3de9[_0x37ae('0x7b')]=_0x1706c9[_0x37ae('0x7c')][_0x37ae('0x7a')];_0xbf3de9[_0x37ae('0x7d')]=_0x1706c9[_0x37ae('0x7c')][_0x37ae('0x7e')];return _0x27fa23(_0xbf3de9);})[_0x37ae('0x4e')](function(_0xfd7b2a){return _0x2d55f0(_0xfd7b2a);});});}exports['runTranscribe']=function(_0x4a4f81,_0x5d2316,_0x3ccc20){var _0x48e4b7;var _0x516798;var _0x35e17f;var _0x199357=require(_0x37ae('0x7f'));return db['VoiceRecording'][_0x37ae('0x80')]({'where':{'id':_0x4a4f81[_0x37ae('0x49')]['id']}})[_0x37ae('0x2a')](function(_0x504958){if(_0x504958){var _0xaac32b=util['format'](_0x37ae('0x53'),_0x504958[_0x37ae('0x52')]);if(fs[_0x37ae('0x54')](_0xaac32b)){cypher=!![];return _0x199357[_0x37ae('0x64')](_0xaac32b,_0x504958[_0x37ae('0x52')],config[_0x37ae('0x55')][_0x37ae('0x56')])[_0x37ae('0x2a')](function(){return _0x504958;});}return _0x504958;}})['then'](function(_0x562923){if(!_0x562923){throw new db['Sequelize'][(_0x37ae('0x58'))](_0x37ae('0x81'));}_0x516798=_0x562923;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x37ae('0x2a')](handleEntityNotFound(_0x5d2316,null))['then'](function(_0x259257){if(_0x259257){_0x48e4b7=_0x259257;if(!_0x48e4b7[_0x37ae('0x82')]||!_0x48e4b7['transcribeAccountId']||!_0x48e4b7[_0x37ae('0x83')]||!_0x48e4b7[_0x37ae('0x84')]||!_0x48e4b7['bucket']){throw new db['Sequelize']['ValidationError']('Transcribe\x20not\x20configured');}if(_0x4a4f81[_0x37ae('0x4d')][_0x37ae('0x85')]&&(!_0x48e4b7['sentiment']||!_0x48e4b7[_0x37ae('0x86')]||!_0x48e4b7['sentimentRegion']||!_0x48e4b7[_0x37ae('0x84')]||!_0x48e4b7[_0x37ae('0x76')])){throw new db['Sequelize'][(_0x37ae('0x58'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x37ae('0x87')]['findOne']({'where':{'id':_0x48e4b7['transcribeAccountId']}});}})[_0x37ae('0x2a')](function(_0x1bccf7){if(!_0x1bccf7){throw new db['Sequelize'][(_0x37ae('0x58'))](_0x37ae('0x88'));}if(!_0x1bccf7[_0x37ae('0x89')]||!_0x1bccf7[_0x37ae('0x8a')]){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x35e17f=_0x1bccf7;return getBucketslist(_0x35e17f[_0x37ae('0x89')],_0x35e17f['data2'],_0x48e4b7['transcribeRegion']);})['then'](function(_0x604643){if(_0x604643&&_0x604643[_0x37ae('0x8b')]){var _0xb35828=_['find'](_0x604643[_0x37ae('0x8b')],function(_0x2135a5){return _0x2135a5[_0x37ae('0x8c')]===_0x48e4b7[_0x37ae('0x76')];});if(!_0xb35828){logger['info'](util[_0x37ae('0x35')](_0x37ae('0x8d'),_0x4a4f81['params']['id'],_0x48e4b7[_0x37ae('0x76')]));return createBucket(_0x35e17f[_0x37ae('0x89')],_0x35e17f[_0x37ae('0x8a')],_0x48e4b7['transcribeRegion'],_0x48e4b7[_0x37ae('0x76')]);}logger[_0x37ae('0x68')](util[_0x37ae('0x35')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x4a4f81[_0x37ae('0x49')]['id'],_0x48e4b7['bucket']));return;}})[_0x37ae('0x2a')](function(_0x1fc68c){if(_0x516798['transcribeStatus']===_0x37ae('0x8e')){return transcribe(_0x4a4f81[_0x37ae('0x49')]['id'],_0x35e17f[_0x37ae('0x89')],_0x35e17f['data2'],_0x48e4b7[_0x37ae('0x83')],_0x48e4b7['bucket'],_0x516798[_0x37ae('0x52')],_0x48e4b7[_0x37ae('0x84')]);}else{logger[_0x37ae('0x68')](util[_0x37ae('0x35')](_0x37ae('0x8f'),_0x4a4f81[_0x37ae('0x49')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x3c34f7){if(_0x3c34f7){_0x3c34f7[_0x37ae('0x90')]=_0x4a4f81[_0x37ae('0x4d')][_0x37ae('0x85')];return _0x516798['updateAttributes'](_0x3c34f7);}})[_0x37ae('0x2a')](respondWithResult(_0x5d2316,null))['catch'](handleError(_0x5d2316,null));};function writeFile(_0x295d5b,_0x30fa35){return new Promise(function(_0x932c9f,_0x5105b3){fs[_0x37ae('0x91')](_0x30fa35,_0x295d5b,function(_0x47aa7c,_0x22999b){if(_0x47aa7c){return _0x5105b3(_0x47aa7c);}else{return _0x932c9f(_0x22999b);}});});}exports[_0x37ae('0x92')]=function(_0x5bbb29,_0x2a600e,_0x5a45bc){return db[_0x37ae('0x30')][_0x37ae('0x80')]({'where':{'id':_0x5bbb29[_0x37ae('0x49')]['id']}})[_0x37ae('0x2a')](handleEntityNotFound(_0x2a600e))[_0x37ae('0x2a')](function(_0x38e3f3){if(_0x38e3f3&&_0x38e3f3[_0x37ae('0x93')]){var _0x392af9=_0x38e3f3[_0x37ae('0x93')];var _0x1af174=config[_0x37ae('0x94')]+_0x37ae('0x95')+_0x38e3f3['id']+_0x37ae('0x96');if(fs['existsSync'](_0x1af174)){return _0x1af174;}return writeFile(_0x392af9,_0x1af174)[_0x37ae('0x2a')](function(){return _0x1af174;});}else{throw new db[(_0x37ae('0x57'))]['ValidationError'](_0x37ae('0x97'));}})[_0x37ae('0x2a')](function(_0x2e5e3b){return _0x2a600e[_0x37ae('0x50')](_0x2e5e3b);})[_0x37ae('0x4e')](handleError(_0x2a600e));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 208c936..5c13584 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 _0x6a0b=['../../config/environment','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid','lodash','api','moment','request-promise','path','rimraf'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x6a0b,0xf6));var _0xb6a0=function(_0x26ef35,_0x216ddf){_0x26ef35=_0x26ef35-0x0;var _0x150389=_0x6a0b[_0x26ef35];return _0x150389;};'use strict';var _=require(_0xb6a0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb6a0('0x1'));var moment=require(_0xb6a0('0x2'));var BPromise=require('bluebird');var rp=require(_0xb6a0('0x3'));var fs=require('fs');var path=require(_0xb6a0('0x4'));var rimraf=require(_0xb6a0('0x5'));var config=require(_0xb6a0('0x6'));var attributes=require(_0xb6a0('0x7'));module['exports']=function(_0x36c035,_0x348d1b){return _0x36c035[_0xb6a0('0x8')](_0xb6a0('0x9'),attributes,{'tableName':_0xb6a0('0xa'),'paranoid':![],'indexes':[{'name':_0xb6a0('0xb'),'fields':[_0xb6a0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa533=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','uniqueid','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa533,0x1c6));var _0x3a53=function(_0x4013da,_0xeaf6dc){_0x4013da=_0x4013da-0x0;var _0x434e19=_0xa533[_0x4013da];return _0x434e19;};'use strict';var _=require(_0x3a53('0x0'));var util=require(_0x3a53('0x1'));var logger=require(_0x3a53('0x2'))(_0x3a53('0x3'));var moment=require(_0x3a53('0x4'));var BPromise=require(_0x3a53('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a53('0x6'));var rimraf=require(_0x3a53('0x7'));var config=require(_0x3a53('0x8'));var attributes=require(_0x3a53('0x9'));module[_0x3a53('0xa')]=function(_0x5f6f8f,_0x3eb254){return _0x5f6f8f[_0x3a53('0xb')]('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x3a53('0xc'),'fields':[_0x3a53('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 3d67e8b..526579a 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 _0xb016=['options','raw','attributes','limit','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','value','format','encryptFile','secrets','recording','unlink','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xb016,0x159));var _0x6b01=function(_0x3bd39c,_0x5d7da3){_0x3bd39c=_0x3bd39c-0x0;var _0x5a8450=_0xb016[_0x3bd39c];return _0x5a8450;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b01('0x3'))['db'];var utils=require(_0x6b01('0x4'));var logger=require(_0x6b01('0x5'))(_0x6b01('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b01('0x7'));var client=jayson[_0x6b01('0x8')][_0x6b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5759a1,_0x5c5bfb,_0x374aab){return new BPromise(function(_0x39f9fa,_0x526a7d){return client['request'](_0x5759a1,_0x374aab)[_0x6b01('0xa')](function(_0x1cb3a6){logger[_0x6b01('0xb')](_0x6b01('0xc'),_0x5c5bfb,_0x6b01('0xd'));logger['debug']('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'),JSON[_0x6b01('0xe')](_0x1cb3a6));if(_0x1cb3a6[_0x6b01('0xf')]){if(_0x1cb3a6['error'][_0x6b01('0x10')]===0x1f4){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x5c5bfb,_0x1cb3a6[_0x6b01('0xf')]['message']);return _0x526a7d(_0x1cb3a6[_0x6b01('0xf')][_0x6b01('0x11')]);}logger['error'](_0x6b01('0xc'),_0x5c5bfb,_0x1cb3a6['error']['message']);return _0x39f9fa(_0x1cb3a6['error'][_0x6b01('0x11')]);}else{logger['info']('VoiceRecording,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'));_0x39f9fa(_0x1cb3a6[_0x6b01('0x12')][_0x6b01('0x11')]);}})[_0x6b01('0x13')](function(_0x3d7045){logger[_0x6b01('0xf')](_0x6b01('0xc'),_0x5c5bfb,_0x3d7045);_0x526a7d(_0x3d7045);});});}exports[_0x6b01('0x14')]=function(_0x9c6571){var _0xc4e1b1=this;return new Promise(function(_0x18f336,_0x4f2d08){return db[_0x6b01('0x15')][_0x6b01('0x16')](_0x9c6571[_0x6b01('0x17')],{'raw':_0x9c6571[_0x6b01('0x18')]?_0x9c6571[_0x6b01('0x18')][_0x6b01('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9c6571[_0x6b01('0x18')]?_0x9c6571[_0x6b01('0x18')]['where']||null:null,'attributes':_0x9c6571[_0x6b01('0x18')]?_0x9c6571[_0x6b01('0x18')][_0x6b01('0x1a')]||null:null,'limit':_0x9c6571[_0x6b01('0x18')]?_0x9c6571[_0x6b01('0x18')][_0x6b01('0x1b')]||null:null})[_0x6b01('0xa')](function(_0x542fab){logger[_0x6b01('0xb')](_0x6b01('0x14'),_0x9c6571);logger[_0x6b01('0x1c')]('UpdateVoiceRecording',_0x9c6571,JSON[_0x6b01('0xe')](_0x542fab));_0x18f336(_0x542fab);})[_0x6b01('0x13')](function(_0x304393){logger[_0x6b01('0xf')](_0x6b01('0x14'),_0x304393[_0x6b01('0x11')],_0x9c6571);_0x4f2d08(_0xc4e1b1[_0x6b01('0xf')](0x1f4,_0x304393[_0x6b01('0x11')]));});});};exports[_0x6b01('0x1d')]=function(_0x152dda){var _0x3c0607=this;return new Promise(function(_0xa846d8,_0x154dfc){var _0x55ca4b=require(_0x6b01('0x1e'));var _0x220efb;return db[_0x6b01('0x1f')][_0x6b01('0x20')]({'attributes':['id',_0x6b01('0x21')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x54f030){_0x220efb=_0x54f030;return db[_0x6b01('0x15')][_0x6b01('0x22')](_0x152dda[_0x6b01('0x17')]);})[_0x6b01('0xa')](function(_0x2a894e){if(_0x220efb[_0x6b01('0x21')]&&fs['existsSync'](_0x2a894e[_0x6b01('0x23')])){var _0x5482a8=util[_0x6b01('0x24')]('%s.cypher',_0x2a894e[_0x6b01('0x23')]);return _0x55ca4b[_0x6b01('0x25')](_0x2a894e[_0x6b01('0x23')],_0x5482a8,config[_0x6b01('0x26')][_0x6b01('0x27')])['then'](function(){fs[_0x6b01('0x28')](_0x2a894e[_0x6b01('0x23')]);logger[_0x6b01('0xb')]('CreateVoiceRecording\x20file\x20encrypted');return _0x2a894e;});}return _0x2a894e;})['then'](function(_0x3578ef){logger['info'](_0x6b01('0x1d'),_0x152dda);logger[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x152dda,JSON['stringify'](_0x3578ef));_0xa846d8(_0x3578ef);})[_0x6b01('0x13')](function(_0x42d5f7){logger[_0x6b01('0xf')]('CreateVoiceRecording',_0x42d5f7[_0x6b01('0x11')],_0x152dda);_0x154dfc(_0x3c0607[_0x6b01('0xf')](0x1f4,_0x42d5f7[_0x6b01('0x11')]));});});}; \ No newline at end of file +var _0x5fdc=['CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceRecording,\x20%s,\x20%s','info','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','catch'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x5fdc,0x127));var _0xc5fd=function(_0x2552d4,_0x1b0e8b){_0x2552d4=_0x2552d4-0x0;var _0x58dcc0=_0x5fdc[_0x2552d4];return _0x58dcc0;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));var BPromise=require(_0xc5fd('0x3'));var rs=require(_0xc5fd('0x4'));var fs=require('fs');var Redis=require(_0xc5fd('0x5'));var db=require(_0xc5fd('0x6'))['db'];var utils=require(_0xc5fd('0x7'));var logger=require(_0xc5fd('0x8'))(_0xc5fd('0x9'));var config=require(_0xc5fd('0xa'));var jayson=require(_0xc5fd('0xb'));var client=jayson[_0xc5fd('0xc')][_0xc5fd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x15ffe7,_0x5a2eb4,_0x5d86e5){return new BPromise(function(_0x493389,_0x224801){return client[_0xc5fd('0xe')](_0x15ffe7,_0x5d86e5)[_0xc5fd('0xf')](function(_0x45c91f){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x5a2eb4,_0xc5fd('0x10'));logger[_0xc5fd('0x11')](_0xc5fd('0x12'),_0x5a2eb4,_0xc5fd('0x10'),JSON[_0xc5fd('0x13')](_0x45c91f));if(_0x45c91f[_0xc5fd('0x14')]){if(_0x45c91f['error'][_0xc5fd('0x15')]===0x1f4){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x224801(_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);}logger[_0xc5fd('0x14')](_0xc5fd('0x17'),_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x493389(_0x45c91f['error'][_0xc5fd('0x16')]);}else{logger[_0xc5fd('0x18')](_0xc5fd('0x17'),_0x5a2eb4,_0xc5fd('0x10'));_0x493389(_0x45c91f['result']['message']);}})['catch'](function(_0x5529b3){logger['error'](_0xc5fd('0x17'),_0x5a2eb4,_0x5529b3);_0x224801(_0x5529b3);});});}exports[_0xc5fd('0x19')]=function(_0x27f611){var _0xd0a9f1=this;return new Promise(function(_0x2ee392,_0x3f981f){return db[_0xc5fd('0x1a')]['update'](_0x27f611[_0xc5fd('0x1b')],{'raw':_0x27f611[_0xc5fd('0x1c')]?_0x27f611[_0xc5fd('0x1c')][_0xc5fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27f611[_0xc5fd('0x1c')]?_0x27f611['options'][_0xc5fd('0x1e')]||null:null,'attributes':_0x27f611[_0xc5fd('0x1c')]?_0x27f611[_0xc5fd('0x1c')][_0xc5fd('0x1f')]||null:null,'limit':_0x27f611['options']?_0x27f611['options'][_0xc5fd('0x20')]||null:null})[_0xc5fd('0xf')](function(_0x3d7211){logger[_0xc5fd('0x18')](_0xc5fd('0x19'),_0x27f611);logger[_0xc5fd('0x11')]('UpdateVoiceRecording',_0x27f611,JSON[_0xc5fd('0x13')](_0x3d7211));_0x2ee392(_0x3d7211);})[_0xc5fd('0x21')](function(_0x1a5174){logger[_0xc5fd('0x14')](_0xc5fd('0x19'),_0x1a5174[_0xc5fd('0x16')],_0x27f611);_0x3f981f(_0xd0a9f1[_0xc5fd('0x14')](0x1f4,_0x1a5174['message']));});});};exports[_0xc5fd('0x22')]=function(_0x48cd1d){var _0x2ee700=this;return new Promise(function(_0x231368,_0x44681d){var _0x2bee22=require('../../components/encryptor');var _0x176313;return db[_0xc5fd('0x23')][_0xc5fd('0x24')]({'attributes':['id',_0xc5fd('0x25')],'where':{'id':0x1},'raw':!![]})[_0xc5fd('0xf')](function(_0x209975){_0x176313=_0x209975;return db['VoiceRecording'][_0xc5fd('0x26')](_0x48cd1d['body']);})['then'](function(_0x12a962){if(_0x176313[_0xc5fd('0x25')]&&fs[_0xc5fd('0x27')](_0x12a962[_0xc5fd('0x28')])){var _0x7693c4=util[_0xc5fd('0x29')](_0xc5fd('0x2a'),_0x12a962[_0xc5fd('0x28')]);return _0x2bee22['encryptFile'](_0x12a962[_0xc5fd('0x28')],_0x7693c4,config[_0xc5fd('0x2b')][_0xc5fd('0x2c')])[_0xc5fd('0xf')](function(){fs[_0xc5fd('0x2d')](_0x12a962[_0xc5fd('0x28')]);logger[_0xc5fd('0x18')](_0xc5fd('0x2e'));return _0x12a962;});}return _0x12a962;})[_0xc5fd('0xf')](function(_0x466aa1){logger[_0xc5fd('0x18')](_0xc5fd('0x22'),_0x48cd1d);logger['debug'](_0xc5fd('0x22'),_0x48cd1d,JSON[_0xc5fd('0x13')](_0x466aa1));_0x231368(_0x466aa1);})[_0xc5fd('0x21')](function(_0x1fa329){logger[_0xc5fd('0x14')](_0xc5fd('0x22'),_0x1fa329[_0xc5fd('0x16')],_0x48cd1d);_0x44681d(_0x2ee700[_0xc5fd('0x14')](0x1f4,_0x1fa329[_0xc5fd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 6c753a7..2434b30 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 _0xc2e1=['../../components/auth/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2f1a51,_0x3c1f80){var _0x581809=function(_0x190b5c){while(--_0x190b5c){_0x2f1a51['push'](_0x2f1a51['shift']());}};_0x581809(++_0x3c1f80);}(_0xc2e1,0xb7));var _0x1c2e=function(_0x3e8539,_0x66e45f){_0x3e8539=_0x3e8539-0x0;var _0x4a361a=_0xc2e1[_0x3e8539];return _0x4a361a;};'use strict';var multer=require('multer');var util=require(_0x1c2e('0x0'));var path=require(_0x1c2e('0x1'));var timeout=require(_0x1c2e('0x2'));var express=require(_0x1c2e('0x3'));var router=express[_0x1c2e('0x4')]();var fs_extra=require(_0x1c2e('0x5'));var auth=require(_0x1c2e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1c2e('0x7'));router[_0x1c2e('0x8')]('/',auth[_0x1c2e('0x9')](),controller[_0x1c2e('0xa')]);router[_0x1c2e('0x8')](_0x1c2e('0xb'),auth['isAuthenticated'](),controller[_0x1c2e('0xc')]);router[_0x1c2e('0x8')](_0x1c2e('0xd'),auth[_0x1c2e('0x9')](),controller[_0x1c2e('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1c2e('0xf')]);router[_0x1c2e('0x10')](_0x1c2e('0xd'),auth['isAuthenticated'](),controller[_0x1c2e('0x11')]);router[_0x1c2e('0x12')](_0x1c2e('0xd'),auth[_0x1c2e('0x9')](),controller[_0x1c2e('0x13')]);module[_0x1c2e('0x14')]=router; \ No newline at end of file +var _0xa072=['update','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id'];(function(_0x14f2dc,_0x53b045){var _0x2510e4=function(_0x19a140){while(--_0x19a140){_0x14f2dc['push'](_0x14f2dc['shift']());}};_0x2510e4(++_0x53b045);}(_0xa072,0x10e));var _0x2a07=function(_0x25e2bc,_0x27d1ef){_0x25e2bc=_0x25e2bc-0x0;var _0x5152d3=_0xa072[_0x25e2bc];return _0x5152d3;};'use strict';var multer=require(_0x2a07('0x0'));var util=require('util');var path=require(_0x2a07('0x1'));var timeout=require(_0x2a07('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2a07('0x3'));var interaction=require(_0x2a07('0x4'));var config=require('../../config/environment');var controller=require(_0x2a07('0x5'));router[_0x2a07('0x6')]('/',auth[_0x2a07('0x7')](),controller[_0x2a07('0x8')]);router['get'](_0x2a07('0x9'),auth[_0x2a07('0x7')](),controller['describe']);router['get']('/:id',auth[_0x2a07('0x7')](),controller[_0x2a07('0xa')]);router[_0x2a07('0xb')]('/',auth['isAuthenticated'](),controller[_0x2a07('0xc')]);router[_0x2a07('0xd')](_0x2a07('0xe'),auth[_0x2a07('0x7')](),controller[_0x2a07('0xf')]);router[_0x2a07('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2a07('0x11')]);module[_0x2a07('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 7719cce..ddd7bb5 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 _0xf839=['sequelize','moment','exports','ENUM','blind','attended','STRING','Yes'];(function(_0xf61d62,_0x5e1ce1){var _0x1b8b00=function(_0x21dbba){while(--_0x21dbba){_0xf61d62['push'](_0xf61d62['shift']());}};_0x1b8b00(++_0x5e1ce1);}(_0xf839,0xe8));var _0x9f83=function(_0x355c01,_0x474953){_0x355c01=_0x355c01-0x0;var _0x52d67e=_0xf839[_0x355c01];return _0x52d67e;};'use strict';var Sequelize=require(_0x9f83('0x0'));var moment=require(_0x9f83('0x1'));module[_0x9f83('0x2')]={'type':{'type':Sequelize[_0x9f83('0x3')](_0x9f83('0x4'),_0x9f83('0x5'))},'result':{'type':Sequelize[_0x9f83('0x6')]},'transfererchannel':{'type':Sequelize[_0x9f83('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x9f83('0x6')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x9f83('0x6')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x9f83('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x9f83('0x6')]},'transfereechannel':{'type':Sequelize[_0x9f83('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x9f83('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x9f83('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x9f83('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x9f83('0x6')]},'transfereecontext':{'type':Sequelize[_0x9f83('0x6')]},'transfereeexten':{'type':Sequelize[_0x9f83('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x9f83('0x6')]},'isexternal':{'type':Sequelize['ENUM'](_0x9f83('0x7'),'No')},'context':{'type':Sequelize[_0x9f83('0x6')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x705f=['ENUM','Yes','sequelize','moment','blind','attended','STRING'];(function(_0x7285e3,_0x2402a7){var _0x523d9d=function(_0x318384){while(--_0x318384){_0x7285e3['push'](_0x7285e3['shift']());}};_0x523d9d(++_0x2402a7);}(_0x705f,0x1b4));var _0xf705=function(_0x3f0752,_0x49c7ce){_0x3f0752=_0x3f0752-0x0;var _0x3d2d59=_0x705f[_0x3f0752];return _0x3d2d59;};'use strict';var Sequelize=require(_0xf705('0x0'));var moment=require(_0xf705('0x1'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xf705('0x2'),_0xf705('0x3'))},'result':{'type':Sequelize[_0xf705('0x4')]},'transfererchannel':{'type':Sequelize[_0xf705('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xf705('0x4')]},'transferercalleridname':{'type':Sequelize[_0xf705('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xf705('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xf705('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xf705('0x4')]},'transferercontext':{'type':Sequelize[_0xf705('0x4')]},'transfererexten':{'type':Sequelize[_0xf705('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xf705('0x4')]},'transfereechannel':{'type':Sequelize[_0xf705('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xf705('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xf705('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xf705('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xf705('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xf705('0x4')]},'isexternal':{'type':Sequelize[_0xf705('0x5')](_0xf705('0x6'),'No')},'context':{'type':Sequelize[_0xf705('0x4')]},'extension':{'type':Sequelize[_0xf705('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index acfd012..f3e015f 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 _0x54e2=['name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VoiceTransferReport','includeAll','findAll','catch','show','params','include','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','error','stack'];(function(_0x50cbac,_0x51fc6d){var _0x77591e=function(_0x5cc60d){while(--_0x5cc60d){_0x50cbac['push'](_0x50cbac['shift']());}};_0x77591e(++_0x51fc6d);}(_0x54e2,0xf2));var _0x254e=function(_0x256a6e,_0x3e60d7){_0x256a6e=_0x256a6e-0x0;var _0xac597d=_0x54e2[_0x256a6e];return _0xac597d;};'use strict';var emlformat=require(_0x254e('0x0'));var rimraf=require(_0x254e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x254e('0x2'));var rp=require(_0x254e('0x3'));var moment=require(_0x254e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x254e('0x5'));var util=require('util');var path=require(_0x254e('0x6'));var sox=require('sox');var csv=require(_0x254e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x254e('0x8'));var _=require(_0x254e('0x9'));var squel=require(_0x254e('0xa'));var crypto=require(_0x254e('0xb'));var jsforce=require(_0x254e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x254e('0x7'));var querystring=require(_0x254e('0xd'));var Papa=require(_0x254e('0xe'));var Redis=require(_0x254e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x254e('0x10'));var as=require(_0x254e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x254e('0x12'))(_0x254e('0x13'));var utils=require('../../config/utils');var config=require(_0x254e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x254e('0x15'))['db'];function respondWithStatusCode(_0x2312dc,_0x39f261){_0x39f261=_0x39f261||0xcc;return function(_0x51f871){if(_0x51f871){return _0x2312dc[_0x254e('0x16')](_0x39f261);}return _0x2312dc[_0x254e('0x17')](_0x39f261)['end']();};}function respondWithResult(_0x338a0f,_0xadc9a5){_0xadc9a5=_0xadc9a5||0xc8;return function(_0x35383c){if(_0x35383c){return _0x338a0f[_0x254e('0x17')](_0xadc9a5)[_0x254e('0x18')](_0x35383c);}};}function respondWithFilteredResult(_0x318068,_0x4c44b2){return function(_0x51e18b){if(_0x51e18b){var _0x1b93f9=typeof _0x4c44b2[_0x254e('0x19')]===_0x254e('0x1a')&&typeof _0x4c44b2[_0x254e('0x1b')]===_0x254e('0x1a');var _0x993e49=_0x51e18b['count'];var _0x718065=_0x1b93f9?0x0:_0x4c44b2['offset'];var _0x181bbc=_0x1b93f9?_0x51e18b[_0x254e('0x1c')]:_0x4c44b2['offset']+_0x4c44b2[_0x254e('0x1b')];var _0x12db1f;if(_0x181bbc>=_0x993e49){_0x181bbc=_0x993e49;_0x12db1f=0xc8;}else{_0x12db1f=0xce;}_0x318068[_0x254e('0x17')](_0x12db1f);return _0x318068[_0x254e('0x1d')](_0x254e('0x1e'),_0x718065+'-'+_0x181bbc+'/'+_0x993e49)['json'](_0x51e18b);}return null;};}function patchUpdates(_0x37f400){return function(_0x4537f3){try{jsonpatch['apply'](_0x4537f3,_0x37f400,!![]);}catch(_0x51f798){return BPromise['reject'](_0x51f798);}return _0x4537f3[_0x254e('0x1f')]();};}function saveUpdates(_0x539d93,_0x258376){return function(_0x30f5dd){if(_0x30f5dd){return _0x30f5dd[_0x254e('0x20')](_0x539d93)[_0x254e('0x21')](function(_0x3ab2d9){return _0x3ab2d9;});}return null;};}function removeEntity(_0x18d0d9,_0x302d36){return function(_0x5126de){if(_0x5126de){return _0x5126de[_0x254e('0x22')]()['then'](function(){_0x18d0d9[_0x254e('0x17')](0xcc)[_0x254e('0x23')]();});}};}function handleEntityNotFound(_0x3d278d,_0x3ffbe6){return function(_0x45aaac){if(!_0x45aaac){_0x3d278d[_0x254e('0x16')](0x194);}return _0x45aaac;};}function handleError(_0x16a0b0,_0x543dbd){_0x543dbd=_0x543dbd||0x1f4;return function(_0x3292bf){logger[_0x254e('0x24')](_0x3292bf[_0x254e('0x25')]);if(_0x3292bf[_0x254e('0x26')]){delete _0x3292bf[_0x254e('0x26')];}_0x16a0b0[_0x254e('0x17')](_0x543dbd)[_0x254e('0x27')](_0x3292bf);};}exports[_0x254e('0x28')]=function(_0x141be4,_0x40ca81){var _0x41a932={},_0x5b95cb={},_0x6d5445={'count':0x0,'rows':[]};var _0x45bcd8=_[_0x254e('0x29')](db['VoiceTransferReport']['rawAttributes'],function(_0x44f15f){return{'name':_0x44f15f[_0x254e('0x2a')],'type':_0x44f15f['type'][_0x254e('0x2b')]};});_0x5b95cb[_0x254e('0x2c')]=_['map'](_0x45bcd8,_0x254e('0x26'));_0x5b95cb[_0x254e('0x2d')]=_[_0x254e('0x2e')](_0x141be4[_0x254e('0x2d')]);_0x5b95cb[_0x254e('0x2f')]=_[_0x254e('0x30')](_0x5b95cb[_0x254e('0x2c')],_0x5b95cb[_0x254e('0x2d')]);_0x41a932[_0x254e('0x31')]=_[_0x254e('0x30')](_0x5b95cb[_0x254e('0x2c')],qs[_0x254e('0x32')](_0x141be4['query']['fields']));_0x41a932['attributes']=_0x41a932['attributes'][_0x254e('0x33')]?_0x41a932[_0x254e('0x31')]:_0x5b95cb[_0x254e('0x2c')];if(!_0x141be4[_0x254e('0x2d')]['hasOwnProperty'](_0x254e('0x34'))){_0x41a932['limit']=qs['limit'](_0x141be4[_0x254e('0x2d')][_0x254e('0x1b')]);_0x41a932[_0x254e('0x19')]=qs[_0x254e('0x19')](_0x141be4[_0x254e('0x2d')][_0x254e('0x19')]);}_0x41a932[_0x254e('0x35')]=qs[_0x254e('0x36')](_0x141be4[_0x254e('0x2d')][_0x254e('0x36')]);_0x41a932[_0x254e('0x37')]=qs[_0x254e('0x2f')](_['pick'](_0x141be4[_0x254e('0x2d')],_0x5b95cb['filters']),_0x45bcd8);if(_0x141be4['query'][_0x254e('0x38')]){_0x41a932[_0x254e('0x37')]=_[_0x254e('0x39')](_0x41a932[_0x254e('0x37')],{'$or':_['map'](_0x45bcd8,function(_0x5e63e4){if(_0x5e63e4[_0x254e('0x3a')]!=='VIRTUAL'){var _0x2bc9f0={};_0x2bc9f0[_0x5e63e4[_0x254e('0x26')]]={'$like':'%'+_0x141be4[_0x254e('0x2d')][_0x254e('0x38')]+'%'};return _0x2bc9f0;}})});}_0x41a932=_['merge']({},_0x41a932,_0x141be4['options']);var _0xa9ab92={'where':_0x41a932[_0x254e('0x37')]};return db[_0x254e('0x3b')][_0x254e('0x1c')](_0xa9ab92)[_0x254e('0x21')](function(_0x37794c){_0x6d5445[_0x254e('0x1c')]=_0x37794c;if(_0x141be4[_0x254e('0x2d')][_0x254e('0x3c')]){_0x41a932['include']=[{'all':!![]}];}return db[_0x254e('0x3b')][_0x254e('0x3d')](_0x41a932);})['then'](function(_0x53ae91){_0x6d5445['rows']=_0x53ae91;return _0x6d5445;})['then'](respondWithFilteredResult(_0x40ca81,_0x41a932))[_0x254e('0x3e')](handleError(_0x40ca81,null));};exports[_0x254e('0x3f')]=function(_0x3ecff6,_0xcb4172){var _0x26726d={'raw':!![],'where':{'id':_0x3ecff6[_0x254e('0x40')]['id']}},_0x7a934c={};_0x7a934c[_0x254e('0x2c')]=_[_0x254e('0x2e')](db['VoiceTransferReport']['rawAttributes']);_0x7a934c['query']=_[_0x254e('0x2e')](_0x3ecff6[_0x254e('0x2d')]);_0x7a934c[_0x254e('0x2f')]=_[_0x254e('0x30')](_0x7a934c[_0x254e('0x2c')],_0x7a934c[_0x254e('0x2d')]);_0x26726d[_0x254e('0x31')]=_[_0x254e('0x30')](_0x7a934c[_0x254e('0x2c')],qs['fields'](_0x3ecff6[_0x254e('0x2d')]['fields']));_0x26726d[_0x254e('0x31')]=_0x26726d[_0x254e('0x31')]['length']?_0x26726d['attributes']:_0x7a934c[_0x254e('0x2c')];if(_0x3ecff6['query'][_0x254e('0x3c')]){_0x26726d[_0x254e('0x41')]=[{'all':!![]}];}_0x26726d=_['merge']({},_0x26726d,_0x3ecff6[_0x254e('0x42')]);return db[_0x254e('0x3b')][_0x254e('0x43')](_0x26726d)['then'](handleEntityNotFound(_0xcb4172,null))[_0x254e('0x21')](respondWithResult(_0xcb4172,null))[_0x254e('0x3e')](handleError(_0xcb4172,null));};exports[_0x254e('0x44')]=function(_0xafacbf,_0x4d03c0){return db[_0x254e('0x3b')][_0x254e('0x44')](_0xafacbf[_0x254e('0x45')],{})[_0x254e('0x21')](respondWithResult(_0x4d03c0,0xc9))[_0x254e('0x3e')](handleError(_0x4d03c0,null));};exports['update']=function(_0x150ff8,_0x3cfcc1){if(_0x150ff8[_0x254e('0x45')]['id']){delete _0x150ff8[_0x254e('0x45')]['id'];}return db['VoiceTransferReport'][_0x254e('0x43')]({'where':{'id':_0x150ff8[_0x254e('0x40')]['id']}})[_0x254e('0x21')](handleEntityNotFound(_0x3cfcc1,null))[_0x254e('0x21')](saveUpdates(_0x150ff8[_0x254e('0x45')],null))[_0x254e('0x21')](respondWithResult(_0x3cfcc1,null))['catch'](handleError(_0x3cfcc1,null));};exports[_0x254e('0x22')]=function(_0x10f483,_0x1960a8){return db[_0x254e('0x3b')]['find']({'where':{'id':_0x10f483[_0x254e('0x40')]['id']}})['then'](handleEntityNotFound(_0x1960a8,null))[_0x254e('0x21')](removeEntity(_0x1960a8,null))[_0x254e('0x3e')](handleError(_0x1960a8,null));};exports['describe']=function(_0x92ab48,_0x821247){return db[_0x254e('0x3b')]['describe']()[_0x254e('0x21')](respondWithResult(_0x821247,null))[_0x254e('0x3e')](handleError(_0x821247,null));}; \ No newline at end of file +var _0xbbce=['create','body','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','map','VoiceTransferReport','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','options','find'];(function(_0x115d5b,_0x26aff2){var _0x6cfc50=function(_0x39a786){while(--_0x39a786){_0x115d5b['push'](_0x115d5b['shift']());}};_0x6cfc50(++_0x26aff2);}(_0xbbce,0xdb));var _0xebbc=function(_0x212901,_0x1b223c){_0x212901=_0x212901-0x0;var _0x134286=_0xbbce[_0x212901];return _0x134286;};'use strict';var emlformat=require(_0xebbc('0x0'));var rimraf=require(_0xebbc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xebbc('0x2'));var moment=require('moment');var BPromise=require(_0xebbc('0x3'));var Mustache=require(_0xebbc('0x4'));var util=require(_0xebbc('0x5'));var path=require(_0xebbc('0x6'));var sox=require(_0xebbc('0x7'));var csv=require('to-csv');var ejs=require(_0xebbc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xebbc('0x9'));var squel=require('squel');var crypto=require(_0xebbc('0xa'));var jsforce=require(_0xebbc('0xb'));var deskjs=require(_0xebbc('0xc'));var toCsv=require(_0xebbc('0xd'));var querystring=require(_0xebbc('0xe'));var Papa=require('papaparse');var Redis=require(_0xebbc('0xf'));var authService=require(_0xebbc('0x10'));var qs=require(_0xebbc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xebbc('0x12'));var logger=require(_0xebbc('0x13'))(_0xebbc('0x14'));var utils=require(_0xebbc('0x15'));var config=require(_0xebbc('0x16'));var licenseUtil=require(_0xebbc('0x17'));var db=require(_0xebbc('0x18'))['db'];function respondWithStatusCode(_0x548b66,_0xf67f0c){_0xf67f0c=_0xf67f0c||0xcc;return function(_0xeca774){if(_0xeca774){return _0x548b66[_0xebbc('0x19')](_0xf67f0c);}return _0x548b66[_0xebbc('0x1a')](_0xf67f0c)[_0xebbc('0x1b')]();};}function respondWithResult(_0x80f280,_0x2f72e9){_0x2f72e9=_0x2f72e9||0xc8;return function(_0x5b655b){if(_0x5b655b){return _0x80f280[_0xebbc('0x1a')](_0x2f72e9)['json'](_0x5b655b);}};}function respondWithFilteredResult(_0x588d8e,_0x471c5d){return function(_0x44152f){if(_0x44152f){var _0x58821c=typeof _0x471c5d[_0xebbc('0x1c')]==='undefined'&&typeof _0x471c5d[_0xebbc('0x1d')]===_0xebbc('0x1e');var _0x4f4d77=_0x44152f[_0xebbc('0x1f')];var _0x5672fa=_0x58821c?0x0:_0x471c5d[_0xebbc('0x1c')];var _0x1ee439=_0x58821c?_0x44152f[_0xebbc('0x1f')]:_0x471c5d[_0xebbc('0x1c')]+_0x471c5d[_0xebbc('0x1d')];var _0x2bff0e;if(_0x1ee439>=_0x4f4d77){_0x1ee439=_0x4f4d77;_0x2bff0e=0xc8;}else{_0x2bff0e=0xce;}_0x588d8e[_0xebbc('0x1a')](_0x2bff0e);return _0x588d8e['set'](_0xebbc('0x20'),_0x5672fa+'-'+_0x1ee439+'/'+_0x4f4d77)[_0xebbc('0x21')](_0x44152f);}return null;};}function patchUpdates(_0x3fd4b6){return function(_0x5f9581){try{jsonpatch[_0xebbc('0x22')](_0x5f9581,_0x3fd4b6,!![]);}catch(_0x2e91af){return BPromise[_0xebbc('0x23')](_0x2e91af);}return _0x5f9581[_0xebbc('0x24')]();};}function saveUpdates(_0x3690de,_0x4f6556){return function(_0x130002){if(_0x130002){return _0x130002[_0xebbc('0x25')](_0x3690de)[_0xebbc('0x26')](function(_0x582bba){return _0x582bba;});}return null;};}function removeEntity(_0x36d635,_0xed9190){return function(_0x2c018c){if(_0x2c018c){return _0x2c018c[_0xebbc('0x27')]()[_0xebbc('0x26')](function(){_0x36d635[_0xebbc('0x1a')](0xcc)[_0xebbc('0x1b')]();});}};}function handleEntityNotFound(_0x55d7cf,_0x4c5451){return function(_0x380a4f){if(!_0x380a4f){_0x55d7cf['sendStatus'](0x194);}return _0x380a4f;};}function handleError(_0x25e783,_0x116c97){_0x116c97=_0x116c97||0x1f4;return function(_0x153e60){logger['error'](_0x153e60[_0xebbc('0x28')]);if(_0x153e60[_0xebbc('0x29')]){delete _0x153e60[_0xebbc('0x29')];}_0x25e783[_0xebbc('0x1a')](_0x116c97)[_0xebbc('0x2a')](_0x153e60);};}exports['index']=function(_0x2671af,_0x1f16f9){var _0x2e2c66={},_0x4bd4cb={},_0x4687b3={'count':0x0,'rows':[]};var _0x5f5457=_[_0xebbc('0x2b')](db[_0xebbc('0x2c')][_0xebbc('0x2d')],function(_0x4183ef){return{'name':_0x4183ef['fieldName'],'type':_0x4183ef[_0xebbc('0x2e')]['key']};});_0x4bd4cb['model']=_[_0xebbc('0x2b')](_0x5f5457,'name');_0x4bd4cb[_0xebbc('0x2f')]=_[_0xebbc('0x30')](_0x2671af[_0xebbc('0x2f')]);_0x4bd4cb[_0xebbc('0x31')]=_[_0xebbc('0x32')](_0x4bd4cb[_0xebbc('0x33')],_0x4bd4cb['query']);_0x2e2c66[_0xebbc('0x34')]=_[_0xebbc('0x32')](_0x4bd4cb[_0xebbc('0x33')],qs[_0xebbc('0x35')](_0x2671af['query'][_0xebbc('0x35')]));_0x2e2c66['attributes']=_0x2e2c66['attributes'][_0xebbc('0x36')]?_0x2e2c66[_0xebbc('0x34')]:_0x4bd4cb[_0xebbc('0x33')];if(!_0x2671af[_0xebbc('0x2f')]['hasOwnProperty']('nolimit')){_0x2e2c66[_0xebbc('0x1d')]=qs['limit'](_0x2671af[_0xebbc('0x2f')][_0xebbc('0x1d')]);_0x2e2c66['offset']=qs[_0xebbc('0x1c')](_0x2671af[_0xebbc('0x2f')][_0xebbc('0x1c')]);}_0x2e2c66['order']=qs[_0xebbc('0x37')](_0x2671af[_0xebbc('0x2f')]['sort']);_0x2e2c66[_0xebbc('0x38')]=qs[_0xebbc('0x31')](_[_0xebbc('0x39')](_0x2671af[_0xebbc('0x2f')],_0x4bd4cb[_0xebbc('0x31')]),_0x5f5457);if(_0x2671af[_0xebbc('0x2f')][_0xebbc('0x3a')]){_0x2e2c66[_0xebbc('0x38')]=_['merge'](_0x2e2c66[_0xebbc('0x38')],{'$or':_['map'](_0x5f5457,function(_0x3272d4){if(_0x3272d4[_0xebbc('0x2e')]!==_0xebbc('0x3b')){var _0x4405c1={};_0x4405c1[_0x3272d4[_0xebbc('0x29')]]={'$like':'%'+_0x2671af[_0xebbc('0x2f')][_0xebbc('0x3a')]+'%'};return _0x4405c1;}})});}_0x2e2c66=_[_0xebbc('0x3c')]({},_0x2e2c66,_0x2671af['options']);var _0x1c374d={'where':_0x2e2c66[_0xebbc('0x38')]};return db[_0xebbc('0x2c')][_0xebbc('0x1f')](_0x1c374d)['then'](function(_0xdaac4b){_0x4687b3[_0xebbc('0x1f')]=_0xdaac4b;if(_0x2671af['query'][_0xebbc('0x3d')]){_0x2e2c66[_0xebbc('0x3e')]=[{'all':!![]}];}return db[_0xebbc('0x2c')][_0xebbc('0x3f')](_0x2e2c66);})['then'](function(_0x19ec4a){_0x4687b3['rows']=_0x19ec4a;return _0x4687b3;})[_0xebbc('0x26')](respondWithFilteredResult(_0x1f16f9,_0x2e2c66))[_0xebbc('0x40')](handleError(_0x1f16f9,null));};exports[_0xebbc('0x41')]=function(_0xc7d82c,_0x3a24c4){var _0x49249b={'raw':!![],'where':{'id':_0xc7d82c[_0xebbc('0x42')]['id']}},_0x269661={};_0x269661['model']=_[_0xebbc('0x30')](db['VoiceTransferReport'][_0xebbc('0x2d')]);_0x269661[_0xebbc('0x2f')]=_['keys'](_0xc7d82c['query']);_0x269661[_0xebbc('0x31')]=_[_0xebbc('0x32')](_0x269661[_0xebbc('0x33')],_0x269661[_0xebbc('0x2f')]);_0x49249b[_0xebbc('0x34')]=_[_0xebbc('0x32')](_0x269661[_0xebbc('0x33')],qs[_0xebbc('0x35')](_0xc7d82c[_0xebbc('0x2f')][_0xebbc('0x35')]));_0x49249b[_0xebbc('0x34')]=_0x49249b['attributes'][_0xebbc('0x36')]?_0x49249b['attributes']:_0x269661[_0xebbc('0x33')];if(_0xc7d82c[_0xebbc('0x2f')]['includeAll']){_0x49249b[_0xebbc('0x3e')]=[{'all':!![]}];}_0x49249b=_[_0xebbc('0x3c')]({},_0x49249b,_0xc7d82c[_0xebbc('0x43')]);return db[_0xebbc('0x2c')][_0xebbc('0x44')](_0x49249b)[_0xebbc('0x26')](handleEntityNotFound(_0x3a24c4,null))[_0xebbc('0x26')](respondWithResult(_0x3a24c4,null))[_0xebbc('0x40')](handleError(_0x3a24c4,null));};exports[_0xebbc('0x45')]=function(_0x11ccd6,_0x5dcef4){return db[_0xebbc('0x2c')]['create'](_0x11ccd6[_0xebbc('0x46')],{})[_0xebbc('0x26')](respondWithResult(_0x5dcef4,0xc9))[_0xebbc('0x40')](handleError(_0x5dcef4,null));};exports[_0xebbc('0x25')]=function(_0x28738b,_0x4a5147){if(_0x28738b['body']['id']){delete _0x28738b['body']['id'];}return db[_0xebbc('0x2c')]['find']({'where':{'id':_0x28738b['params']['id']}})[_0xebbc('0x26')](handleEntityNotFound(_0x4a5147,null))[_0xebbc('0x26')](saveUpdates(_0x28738b[_0xebbc('0x46')],null))[_0xebbc('0x26')](respondWithResult(_0x4a5147,null))['catch'](handleError(_0x4a5147,null));};exports[_0xebbc('0x27')]=function(_0x1950e3,_0x2c11d2){return db[_0xebbc('0x2c')][_0xebbc('0x44')]({'where':{'id':_0x1950e3[_0xebbc('0x42')]['id']}})[_0xebbc('0x26')](handleEntityNotFound(_0x2c11d2,null))[_0xebbc('0x26')](removeEntity(_0x2c11d2,null))[_0xebbc('0x40')](handleError(_0x2c11d2,null));};exports['describe']=function(_0x289da2,_0x497107){return db[_0xebbc('0x2c')][_0xebbc('0x47')]()['then'](respondWithResult(_0x497107,null))[_0xebbc('0x40')](handleError(_0x497107,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index cfe0a27..f100e47 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 _0x17bb=['request-promise','rimraf','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','bluebird'];(function(_0x41f7b2,_0x58547b){var _0x19ec6d=function(_0x11f687){while(--_0x11f687){_0x41f7b2['push'](_0x41f7b2['shift']());}};_0x19ec6d(++_0x58547b);}(_0x17bb,0x1df));var _0xb17b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x17bb[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xb17b('0x0'));var util=require(_0xb17b('0x1'));var logger=require(_0xb17b('0x2'))(_0xb17b('0x3'));var moment=require('moment');var BPromise=require(_0xb17b('0x4'));var rp=require(_0xb17b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb17b('0x6'));var config=require('../../config/environment');var attributes=require(_0xb17b('0x7'));module[_0xb17b('0x8')]=function(_0x2945ac,_0x45a522){return _0x2945ac['define'](_0xb17b('0x9'),attributes,{'tableName':_0xb17b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe881=['report_call_transfer','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport'];(function(_0x5cf485,_0x5d8d37){var _0x38626b=function(_0x49f28c){while(--_0x49f28c){_0x5cf485['push'](_0x5cf485['shift']());}};_0x38626b(++_0x5d8d37);}(_0xe881,0x85));var _0x1e88=function(_0x304bd5,_0xea943d){_0x304bd5=_0x304bd5-0x0;var _0x2bcd87=_0xe881[_0x304bd5];return _0x2bcd87;};'use strict';var _=require(_0x1e88('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1e88('0x1'));var moment=require(_0x1e88('0x2'));var BPromise=require(_0x1e88('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e88('0x4'));var rimraf=require(_0x1e88('0x5'));var config=require(_0x1e88('0x6'));var attributes=require(_0x1e88('0x7'));module[_0x1e88('0x8')]=function(_0x2a98ae,_0x49189d){return _0x2a98ae[_0x1e88('0x9')](_0x1e88('0xa'),attributes,{'tableName':_0x1e88('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index d70fb83..0dbeee2 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 _0x66db=['error','message','request\x20sent','result','catch','CreateVoiceTransferReport','create','body','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x66db,0xee));var _0xb66d=function(_0x294366,_0xb41686){_0x294366=_0x294366-0x0;var _0x120255=_0x66db[_0x294366];return _0x120255;};'use strict';var _=require(_0xb66d('0x0'));var util=require('util');var moment=require(_0xb66d('0x1'));var BPromise=require('bluebird');var rs=require(_0xb66d('0x2'));var fs=require('fs');var Redis=require(_0xb66d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb66d('0x4'));var logger=require('../../config/logger')(_0xb66d('0x5'));var config=require(_0xb66d('0x6'));var jayson=require(_0xb66d('0x7'));var client=jayson[_0xb66d('0x8')][_0xb66d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13f297,_0x4fe1c3,_0x52e9ca){return new BPromise(function(_0x162980,_0x338f60){return client['request'](_0x13f297,_0x52e9ca)['then'](function(_0x2c4f35){logger['info'](_0xb66d('0xa'),_0x4fe1c3,'request\x20sent');logger[_0xb66d('0xb')](_0xb66d('0xc'),_0x4fe1c3,'request\x20sent',JSON[_0xb66d('0xd')](_0x2c4f35));if(_0x2c4f35['error']){if(_0x2c4f35['error'][_0xb66d('0xe')]===0x1f4){logger[_0xb66d('0xf')](_0xb66d('0xa'),_0x4fe1c3,_0x2c4f35[_0xb66d('0xf')]['message']);return _0x338f60(_0x2c4f35[_0xb66d('0xf')][_0xb66d('0x10')]);}logger[_0xb66d('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x4fe1c3,_0x2c4f35['error'][_0xb66d('0x10')]);return _0x162980(_0x2c4f35[_0xb66d('0xf')][_0xb66d('0x10')]);}else{logger['info'](_0xb66d('0xa'),_0x4fe1c3,_0xb66d('0x11'));_0x162980(_0x2c4f35[_0xb66d('0x12')][_0xb66d('0x10')]);}})[_0xb66d('0x13')](function(_0x400399){logger[_0xb66d('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x4fe1c3,_0x400399);_0x338f60(_0x400399);});});}exports[_0xb66d('0x14')]=function(_0x1c1ebb){var _0x967ece=this;return new Promise(function(_0x5e5d83,_0x4bfd70){return db['VoiceTransferReport'][_0xb66d('0x15')](_0x1c1ebb[_0xb66d('0x16')],{'raw':_0x1c1ebb['options']?_0x1c1ebb['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x47f7c0){logger['info']('CreateVoiceTransferReport',_0x1c1ebb);logger[_0xb66d('0xb')]('CreateVoiceTransferReport',_0x1c1ebb,JSON['stringify'](_0x47f7c0));_0x5e5d83(_0x47f7c0);})[_0xb66d('0x13')](function(_0x43cc60){logger[_0xb66d('0xf')]('CreateVoiceTransferReport',_0x43cc60[_0xb66d('0x10')],_0x1c1ebb);_0x4bfd70(_0x967ece[_0xb66d('0xf')](0x1f4,_0x43cc60[_0xb66d('0x10')]));});});}; \ No newline at end of file +var _0x44b1=['rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceTransferReport','create','body','options','CreateVoiceTransferReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x44b1,0x1ac));var _0x144b=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x44b1[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x144b('0x0'));var util=require('util');var moment=require(_0x144b('0x1'));var BPromise=require(_0x144b('0x2'));var rs=require(_0x144b('0x3'));var fs=require('fs');var Redis=require(_0x144b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x144b('0x5'));var logger=require(_0x144b('0x6'))(_0x144b('0x7'));var config=require(_0x144b('0x8'));var jayson=require(_0x144b('0x9'));var client=jayson['client'][_0x144b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2129cc,_0x1ac849,_0x581fec){return new BPromise(function(_0x5b9b70,_0x34e187){return client[_0x144b('0xb')](_0x2129cc,_0x581fec)[_0x144b('0xc')](function(_0x29daa5){logger[_0x144b('0xd')](_0x144b('0xe'),_0x1ac849,_0x144b('0xf'));logger[_0x144b('0x10')](_0x144b('0x11'),_0x1ac849,_0x144b('0xf'),JSON[_0x144b('0x12')](_0x29daa5));if(_0x29daa5[_0x144b('0x13')]){if(_0x29daa5['error'][_0x144b('0x14')]===0x1f4){logger['error'](_0x144b('0xe'),_0x1ac849,_0x29daa5[_0x144b('0x13')]['message']);return _0x34e187(_0x29daa5[_0x144b('0x13')][_0x144b('0x15')]);}logger[_0x144b('0x13')](_0x144b('0xe'),_0x1ac849,_0x29daa5[_0x144b('0x13')]['message']);return _0x5b9b70(_0x29daa5[_0x144b('0x13')][_0x144b('0x15')]);}else{logger[_0x144b('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x1ac849,'request\x20sent');_0x5b9b70(_0x29daa5[_0x144b('0x16')]['message']);}})[_0x144b('0x17')](function(_0xba436){logger['error'](_0x144b('0xe'),_0x1ac849,_0xba436);_0x34e187(_0xba436);});});}exports['CreateVoiceTransferReport']=function(_0x24962f){var _0x8b6e9a=this;return new Promise(function(_0x3c6478,_0x229343){return db[_0x144b('0x18')][_0x144b('0x19')](_0x24962f[_0x144b('0x1a')],{'raw':_0x24962f[_0x144b('0x1b')]?_0x24962f[_0x144b('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x144b('0xc')](function(_0x2a68bd){logger[_0x144b('0xd')](_0x144b('0x1c'),_0x24962f);logger[_0x144b('0x10')](_0x144b('0x1c'),_0x24962f,JSON[_0x144b('0x12')](_0x2a68bd));_0x3c6478(_0x2a68bd);})['catch'](function(_0x282086){logger[_0x144b('0x13')](_0x144b('0x1c'),_0x282086[_0x144b('0x15')],_0x24962f);_0x229343(_0x8b6e9a[_0x144b('0x13')](0x1f4,_0x282086['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 33d104d..92ad924 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 _0x44aa=['exports','express','Router','./webbar.controller','post','isAuthenticated','canUpdate','originate','/hangup','hangup','/answer','answer','/hold','hold','/unhold','unhold','calls','transfer'];(function(_0x50f37f,_0x613d39){var _0x1f496a=function(_0x2c88de){while(--_0x2c88de){_0x50f37f['push'](_0x50f37f['shift']());}};_0x1f496a(++_0x613d39);}(_0x44aa,0x17b));var _0xa44a=function(_0x483716,_0x69ee28){_0x483716=_0x483716-0x0;var _0x259fc6=_0x44aa[_0x483716];return _0x259fc6;};'use strict';var express=require(_0xa44a('0x0'));var router=express[_0xa44a('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xa44a('0x2'));router[_0xa44a('0x3')]('/originate',auth[_0xa44a('0x4')](),auth[_0xa44a('0x5')](),controller[_0xa44a('0x6')]);router[_0xa44a('0x3')](_0xa44a('0x7'),auth[_0xa44a('0x4')](),auth[_0xa44a('0x5')](),controller[_0xa44a('0x8')]);router[_0xa44a('0x3')](_0xa44a('0x9'),auth[_0xa44a('0x4')](),auth[_0xa44a('0x5')](),controller[_0xa44a('0xa')]);router['post'](_0xa44a('0xb'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xa44a('0xc')]);router[_0xa44a('0x3')](_0xa44a('0xd'),auth[_0xa44a('0x4')](),auth[_0xa44a('0x5')](),controller[_0xa44a('0xe')]);router['post']('/calls',auth[_0xa44a('0x4')](),auth[_0xa44a('0x5')](),controller[_0xa44a('0xf')]);router[_0xa44a('0x3')]('/transfer',auth['isAuthenticated'](),auth[_0xa44a('0x5')](),controller[_0xa44a('0x10')]);module[_0xa44a('0x11')]=router; \ No newline at end of file +var _0x5cc7=['calls','/transfer','exports','express','Router','./webbar.controller','post','/originate','isAuthenticated','canUpdate','originate','/hangup','hangup','/answer','answer','hold','/unhold','/calls'];(function(_0x475004,_0x33de48){var _0x2f16fd=function(_0x43d02c){while(--_0x43d02c){_0x475004['push'](_0x475004['shift']());}};_0x2f16fd(++_0x33de48);}(_0x5cc7,0x93));var _0x75cc=function(_0x3c97d0,_0x510862){_0x3c97d0=_0x3c97d0-0x0;var _0x126da0=_0x5cc7[_0x3c97d0];return _0x126da0;};'use strict';var express=require(_0x75cc('0x0'));var router=express[_0x75cc('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x75cc('0x2'));router[_0x75cc('0x3')](_0x75cc('0x4'),auth[_0x75cc('0x5')](),auth[_0x75cc('0x6')](),controller[_0x75cc('0x7')]);router[_0x75cc('0x3')](_0x75cc('0x8'),auth[_0x75cc('0x5')](),auth[_0x75cc('0x6')](),controller[_0x75cc('0x9')]);router[_0x75cc('0x3')](_0x75cc('0xa'),auth[_0x75cc('0x5')](),auth[_0x75cc('0x6')](),controller[_0x75cc('0xb')]);router[_0x75cc('0x3')]('/hold',auth[_0x75cc('0x5')](),auth[_0x75cc('0x6')](),controller[_0x75cc('0xc')]);router[_0x75cc('0x3')](_0x75cc('0xd'),auth[_0x75cc('0x5')](),auth[_0x75cc('0x6')](),controller['unhold']);router[_0x75cc('0x3')](_0x75cc('0xe'),auth[_0x75cc('0x5')](),auth[_0x75cc('0x6')](),controller[_0x75cc('0xf')]);router[_0x75cc('0x3')](_0x75cc('0x10'),auth[_0x75cc('0x5')](),auth[_0x75cc('0x6')](),controller['transfer']);module[_0x75cc('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 665b180..2cf662c 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 _0x9099=['../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','callNumber\x20is\x20required','string','number','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','log','handleError:','error','stack','name','status','send','NotFound','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','length','json','userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','validate','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','entityFound:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transferNumber','transfer\x20executed!','path','../../mysqldb'];(function(_0x2beb3a,_0x556859){var _0x2b1c90=function(_0x5841fb){while(--_0x5841fb){_0x2beb3a['push'](_0x2beb3a['shift']());}};_0x2b1c90(++_0x556859);}(_0x9099,0x1ac));var _0x9909=function(_0x36bfe3,_0x358938){_0x36bfe3=_0x36bfe3-0x0;var _0x9b0436=_0x9099[_0x36bfe3];return _0x9b0436;};'use strict';var path=require(_0x9909('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x9909('0x1'))['db'];var config=require(_0x9909('0x2'));var util=require(_0x9909('0x3'));var BPromise=require(_0x9909('0x4'));var jayson=require(_0x9909('0x5'));var amiClient=jayson[_0x9909('0x6')][_0x9909('0x7')]({'port':0x232a});var logger=require(_0x9909('0x8'))(_0x9909('0x9'));var Redis=require(_0x9909('0xa'));config[_0x9909('0xb')]=_[_0x9909('0xc')](config[_0x9909('0xb')],{'host':_0x9909('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9909('0xb')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0x9909('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x9909('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x9909('0x10'),'required':[!![],_0x9909('0x11')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x9909('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x9909('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x9909('0x10'),'required':[!![],_0x9909('0x11')]},'sessionId':{'type':_0x9909('0xf'),'required':[!![],_0x9909('0x12')]},'transferNumber':{'type':_0x9909('0xf'),'required':[!![],_0x9909('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x9909('0x10'),'required':[!![],_0x9909('0x11')]},'sessionId':{'type':_0x9909('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x9909('0x10'),'required':[!![],_0x9909('0x11')]},'sessionId':{'type':_0x9909('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9909('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9909('0x11')]}});function emit(_0x5bd7e7,_0x1a9c97,_0x1b56c7){logger[_0x9909('0x14')](_0x5bd7e7,_0x1a9c97,JSON['stringify'](_0x1b56c7));io['to'](_0x5bd7e7)[_0x9909('0x15')](_0x1a9c97,_0x1b56c7);}function handleError(_0xb003b6){return function(_0x180929){console[_0x9909('0x16')](_0x9909('0x17'),_0x180929,_0x180929 instanceof RangeError);logger[_0x9909('0x18')](_0x180929[_0x9909('0x19')]);if(_0x180929 instanceof RangeError){if(_0x180929['name']){delete _0x180929[_0x9909('0x1a')];}_0xb003b6[_0x9909('0x1b')](0x194)['send'](_0x180929);}else{if(_0x180929[_0x9909('0x1a')]){delete _0x180929[_0x9909('0x1a')];}_0xb003b6[_0x9909('0x1b')](0x1f4)[_0x9909('0x1c')](_0x180929);}};}function checkError(){return function(_0xe6275e){if(!_0xe6275e){throw new RangeError(_0x9909('0x1d'));}return _0xe6275e;};}function respondWithRpcPromise(_0x262d69,_0x54d0e2){return new BPromise(function(_0x112727,_0x319c31){var _0x4a626b=amiClient;return _0x4a626b['request'](_0x262d69,_0x54d0e2)[_0x9909('0x1e')](function(_0x176593){if(_0x176593[_0x9909('0x18')]){if(_0x176593[_0x9909('0x18')][_0x9909('0x1f')]===0x1f4){return _0x319c31(_0x176593['error']['message']);}return _0x112727(_0x176593[_0x9909('0x18')][_0x9909('0x20')]);}else{_0x112727(_0x176593[_0x9909('0x21')]);}})[_0x9909('0x22')](function(_0x52be17){_0x319c31(_0x52be17);});});}function getAgent(_0x20a8ec){return db[_0x9909('0x23')][_0x9909('0x24')]({'where':{'id':_0x20a8ec,'role':_0x9909('0x25')}})['then'](checkError());}function getAgentCheckSession(_0x405c5e,_0x22ff12){return new BPromise(function(_0x19c7e8,_0x14ec4b){var _0x5250d8=respondWithRpcPromise(_0x9909('0x26'));var _0x175d52=getAgent(_0x405c5e);Promise[_0x9909('0x27')]([_0x5250d8,_0x175d52])[_0x9909('0x1e')](function(_0x26267b){var _0x43f368=_0x26267b[0x0];var _0x427530=_0x26267b[0x1];var _0x4f1e52=_[_0x9909('0x28')](_0x43f368[_0x9909('0x29')],function(_0x87ac8a){return _0x87ac8a[_0x9909('0x2a')]==_0x427530['id']&&_0x87ac8a[_0x9909('0x2b')]==_0x22ff12;});if(_0x4f1e52['length']==0x1){_0x19c7e8(_0x427530);}else{_0x14ec4b(new RangeError(_0x9909('0x2c')+_0x22ff12+_0x9909('0x2d')));}});});}exports[_0x9909('0x2e')]=function(_0x3e599a,_0xc1bd06){logger[_0x9909('0x14')](_0x9909('0x2f'),_0x3e599a[_0x9909('0x30')]);var _0x59886b=originateValidation['validate'](_0x3e599a[_0x9909('0x30')]);if(_0x59886b[_0x9909('0x31')]>0x0){return _0xc1bd06['status'](0x190)[_0x9909('0x32')](_0x59886b);}var _0x323f15=_0x3e599a[_0x9909('0x30')][_0x9909('0x33')];var _0x46affb=_0x3e599a[_0x9909('0x30')][_0x9909('0x34')];var _0x51ed4e=_0x3e599a[_0x9909('0x30')][_0x9909('0x35')];var _0x262452=_0x3e599a[_0x9909('0x30')][_0x9909('0x36')];return getAgent(_0x323f15)['then'](function(_0x7f709e){logger[_0x9909('0x14')]('entityFound:',_0x7f709e[_0x9909('0x1a')]);emit(util[_0x9909('0x37')](_0x9909('0x38'),_0x7f709e[_0x9909('0x1a')]),_0x9909('0x39'),{'callNumber':_0x46affb,'callerId':_0x51ed4e,'callbackUrl':_0x262452});return _0xc1bd06[_0x9909('0x1b')](0xc8)['json']({'error':![],'message':_0x9909('0x3a')});})[_0x9909('0x22')](handleError(_0xc1bd06));};exports[_0x9909('0x3b')]=function(_0x45e897,_0x449074){logger[_0x9909('0x14')](_0x9909('0x3c'),_0x45e897[_0x9909('0x30')]);var _0x222769=hangupValidation[_0x9909('0x3d')](_0x45e897[_0x9909('0x30')]);if(_0x222769[_0x9909('0x31')]>0x0){return _0x449074[_0x9909('0x1b')](0x190)[_0x9909('0x32')](_0x222769);}var _0x201897=_0x45e897[_0x9909('0x30')][_0x9909('0x33')];var _0x3dc4e9=_0x45e897[_0x9909('0x30')][_0x9909('0x2b')];return getAgent(_0x201897)[_0x9909('0x1e')](function(_0x1b224d){logger[_0x9909('0x14')]('entityFound:',_0x1b224d['name']);emit(util[_0x9909('0x37')]('user:%s',_0x1b224d['name']),_0x9909('0x3e'),{'sessionId':_0x3dc4e9});return _0x449074[_0x9909('0x1b')](0xc8)[_0x9909('0x32')]({'error':![],'message':_0x9909('0x3f')});})['catch'](handleError(_0x449074));};exports[_0x9909('0x40')]=function(_0x312373,_0x5e0bd7){logger['info'](_0x9909('0x41'),_0x312373[_0x9909('0x30')]);var _0x345ba0=answerValidation['validate'](_0x312373[_0x9909('0x30')]);if(_0x345ba0[_0x9909('0x31')]>0x0){return _0x5e0bd7[_0x9909('0x1b')](0x190)[_0x9909('0x32')](_0x345ba0);}var _0x1f57bd=_0x312373[_0x9909('0x30')][_0x9909('0x33')];var _0x3b1844=_0x312373['body'][_0x9909('0x2b')];return getAgent(_0x1f57bd)[_0x9909('0x1e')](function(_0x512f97){logger[_0x9909('0x14')](_0x9909('0x42'),_0x512f97['name']);emit(util['format'](_0x9909('0x38'),_0x512f97[_0x9909('0x1a')]),_0x9909('0x43'),{'sessionId':_0x3b1844});return _0x5e0bd7[_0x9909('0x1b')](0xc8)[_0x9909('0x32')]({'error':![],'message':_0x9909('0x44')});})[_0x9909('0x22')](handleError(_0x5e0bd7));};exports[_0x9909('0x45')]=function(_0x415407,_0x33fd6c){logger['info'](_0x9909('0x46'),_0x415407[_0x9909('0x30')]);var _0x4234fd=holdValidation[_0x9909('0x3d')](_0x415407['body']);if(_0x4234fd['length']>0x0){return _0x33fd6c[_0x9909('0x1b')](0x190)['json'](_0x4234fd);}var _0x266957=_0x415407[_0x9909('0x30')][_0x9909('0x33')];var _0x56a3c7=_0x415407[_0x9909('0x30')][_0x9909('0x2b')];return getAgent(_0x266957)[_0x9909('0x1e')](function(_0x54152c){logger[_0x9909('0x14')](_0x9909('0x42'),_0x54152c[_0x9909('0x1a')]);emit(util[_0x9909('0x37')](_0x9909('0x38'),_0x54152c[_0x9909('0x1a')]),_0x9909('0x47'),{'sessionId':_0x56a3c7});return _0x33fd6c['status'](0xc8)[_0x9909('0x32')]({'error':![],'message':_0x9909('0x48')});})['catch'](handleError(_0x33fd6c));};exports[_0x9909('0x49')]=function(_0x240947,_0x3d105f){logger[_0x9909('0x14')](_0x9909('0x4a'),_0x240947['body']);var _0x24e3ae=unholdValidation['validate'](_0x240947[_0x9909('0x30')]);if(_0x24e3ae[_0x9909('0x31')]>0x0){return _0x3d105f[_0x9909('0x1b')](0x190)[_0x9909('0x32')](_0x24e3ae);}var _0xfc8c2=_0x240947[_0x9909('0x30')][_0x9909('0x33')];var _0x109625=_0x240947['body']['sessionId'];return getAgent(_0xfc8c2)[_0x9909('0x1e')](function(_0x55ec6e){logger['info'](_0x9909('0x42'),_0x55ec6e[_0x9909('0x1a')]);emit(util['format'](_0x9909('0x38'),_0x55ec6e[_0x9909('0x1a')]),_0x9909('0x4b'),{'sessionId':_0x109625});return _0x3d105f[_0x9909('0x1b')](0xc8)[_0x9909('0x32')]({'error':![],'message':_0x9909('0x4c')});})['catch'](handleError(_0x3d105f));};exports[_0x9909('0x4d')]=function(_0x2517ff,_0x50ada8){logger['info'](_0x9909('0x4e'),_0x50ada8['body']);var _0x180cf5=callsValidation[_0x9909('0x3d')](_0x2517ff[_0x9909('0x30')]);if(_0x180cf5[_0x9909('0x31')]>0x0){return _0x50ada8['status'](0x190)['json'](_0x180cf5);}var _0x5d9337=_0x2517ff[_0x9909('0x30')][_0x9909('0x33')];var _0x4e48f0=respondWithRpcPromise('VoiceChannels');var _0x2f575b=getAgent(_0x5d9337);return Promise[_0x9909('0x27')]([_0x4e48f0,_0x2f575b])[_0x9909('0x1e')](function(_0x5a7337){var _0xdfa2b0=_0x5a7337[0x0];var _0x42e4fe=_0x5a7337[0x1];var _0x4826b7=_[_0x9909('0x28')](_0xdfa2b0[_0x9909('0x29')],function(_0x400aad){return _0x400aad[_0x9909('0x2a')]==_0x42e4fe['id'];});return _0x50ada8['status'](0xc8)['json']({'count':_0x4826b7[_0x9909('0x31')],'rows':_0x4826b7});})[_0x9909('0x22')](handleError(_0x50ada8));};exports[_0x9909('0x4f')]=function(_0x9cf51d,_0xb73944){logger[_0x9909('0x14')](_0x9909('0x50'),_0x9cf51d[_0x9909('0x30')]);var _0x291c47=conferenceValidation[_0x9909('0x3d')](_0x9cf51d['body']);if(_0x291c47[_0x9909('0x31')]>0x0){return _0xb73944[_0x9909('0x1b')](0x190)[_0x9909('0x32')](_0x291c47);}var _0x3ab49c=_0x9cf51d[_0x9909('0x30')][_0x9909('0x33')];return getAgent(_0x3ab49c)[_0x9909('0x1e')](function(_0x3b92f8){logger[_0x9909('0x14')](_0x9909('0x42'),_0x3b92f8['name']);emit(util[_0x9909('0x37')](_0x9909('0x38'),_0x3b92f8[_0x9909('0x1a')]),_0x9909('0x51'));return _0xb73944[_0x9909('0x1b')](0xc8)['json']({'error':![],'message':_0x9909('0x52')});})['catch'](handleError(_0xb73944));};exports[_0x9909('0x53')]=function(_0xd56c48,_0x884c61){logger[_0x9909('0x14')]('transfer\x20fired:',_0xd56c48[_0x9909('0x30')]);var _0x2bb2f4=transferValidation['validate'](_0xd56c48[_0x9909('0x30')]);if(_0x2bb2f4[_0x9909('0x31')]>0x0){return _0x884c61[_0x9909('0x1b')](0x190)[_0x9909('0x32')](_0x2bb2f4);}var _0x38decb=_0xd56c48[_0x9909('0x30')][_0x9909('0x33')];var _0x2ed52e=_0xd56c48[_0x9909('0x30')]['sessionId'];var _0x5691e2=_0xd56c48['body'][_0x9909('0x54')];return getAgent(_0x38decb)[_0x9909('0x1e')](function(_0x5a15eb){logger[_0x9909('0x14')](_0x9909('0x42'),_0x5a15eb[_0x9909('0x1a')]);emit(util[_0x9909('0x37')](_0x9909('0x38'),_0x5a15eb['name']),'webbar:transfer',{'sessionId':_0x2ed52e,'transferNumber':_0x5691e2});return _0x884c61[_0x9909('0x1b')](0xc8)['json']({'error':![],'message':_0x9909('0x55')});})[_0x9909('0x22')](handleError(_0x884c61));}; \ No newline at end of file +var _0xb821=['hangup','hangup\x20fired:','userId','entityFound:','webbar:hangup','hangup\x20executed!','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','calls\x20fired:','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','lodash','../../mysqldb','bluebird','http','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','info','stringify','emit','log','error','stack','name','status','send','NotFound','then','code','User','findOne','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','callerId','callbackUrl','format','user:%s','originate\x20executed!','catch'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0xb821,0xa7));var _0x1b82=function(_0x295b75,_0x2763f5){_0x295b75=_0x295b75-0x0;var _0x24a29a=_0xb821[_0x295b75];return _0x24a29a;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x1b82('0x0'));var db=require(_0x1b82('0x1'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0x1b82('0x2'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x1b82('0x3')]({'port':0x232a});var logger=require(_0x1b82('0x4'))(_0x1b82('0x5'));var Redis=require(_0x1b82('0x6'));config['redis']=_[_0x1b82('0x7')](config[_0x1b82('0x8')],{'host':_0x1b82('0x9'),'port':0x18eb});var io=require(_0x1b82('0xa'))(new Redis(config[_0x1b82('0x8')]));var Schema=require(_0x1b82('0xb'));var originateValidation=new Schema({'userId':{'type':_0x1b82('0xc'),'required':[!![],_0x1b82('0xd')]},'callNumber':{'type':_0x1b82('0xe'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x1b82('0xe')},'callbackUrl':{'type':_0x1b82('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x1b82('0xc'),'required':[!![],_0x1b82('0xd')]},'sessionId':{'type':_0x1b82('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x1b82('0xc'),'required':[!![],_0x1b82('0xd')]},'sessionId':{'type':_0x1b82('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1b82('0xd')]},'sessionId':{'type':_0x1b82('0xe'),'required':[!![],_0x1b82('0xf')]},'transferNumber':{'type':_0x1b82('0xe'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x1b82('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x1b82('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x1b82('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x1b82('0xc'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x1b82('0xc'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x563261,_0x1b115b,_0x5eb8ed){logger[_0x1b82('0x10')](_0x563261,_0x1b115b,JSON[_0x1b82('0x11')](_0x5eb8ed));io['to'](_0x563261)[_0x1b82('0x12')](_0x1b115b,_0x5eb8ed);}function handleError(_0x4a09a2){return function(_0x514082){console[_0x1b82('0x13')]('handleError:',_0x514082,_0x514082 instanceof RangeError);logger[_0x1b82('0x14')](_0x514082[_0x1b82('0x15')]);if(_0x514082 instanceof RangeError){if(_0x514082[_0x1b82('0x16')]){delete _0x514082['name'];}_0x4a09a2[_0x1b82('0x17')](0x194)[_0x1b82('0x18')](_0x514082);}else{if(_0x514082[_0x1b82('0x16')]){delete _0x514082[_0x1b82('0x16')];}_0x4a09a2[_0x1b82('0x17')](0x1f4)['send'](_0x514082);}};}function checkError(){return function(_0x35a2c8){if(!_0x35a2c8){throw new RangeError(_0x1b82('0x19'));}return _0x35a2c8;};}function respondWithRpcPromise(_0x39e668,_0x1d50b6){return new BPromise(function(_0x26e481,_0x31fd64){var _0x2d07f4=amiClient;return _0x2d07f4['request'](_0x39e668,_0x1d50b6)[_0x1b82('0x1a')](function(_0x233740){if(_0x233740['error']){if(_0x233740[_0x1b82('0x14')][_0x1b82('0x1b')]===0x1f4){return _0x31fd64(_0x233740[_0x1b82('0x14')]['message']);}return _0x26e481(_0x233740[_0x1b82('0x14')]['message']);}else{_0x26e481(_0x233740['result']);}})['catch'](function(_0xf2e556){_0x31fd64(_0xf2e556);});});}function getAgent(_0x149d0f){return db[_0x1b82('0x1c')][_0x1b82('0x1d')]({'where':{'id':_0x149d0f,'role':'agent'}})[_0x1b82('0x1a')](checkError());}function getAgentCheckSession(_0x165b45,_0x1b5260){return new BPromise(function(_0x7455e8,_0x2d78b5){var _0x1b8b6f=respondWithRpcPromise(_0x1b82('0x1e'));var _0x21ea34=getAgent(_0x165b45);Promise[_0x1b82('0x1f')]([_0x1b8b6f,_0x21ea34])[_0x1b82('0x1a')](function(_0x2fe45d){var _0x37275f=_0x2fe45d[0x0];var _0x466441=_0x2fe45d[0x1];var _0x5ea890=_[_0x1b82('0x20')](_0x37275f[_0x1b82('0x21')],function(_0x155a34){return _0x155a34[_0x1b82('0x22')]==_0x466441['id']&&_0x155a34[_0x1b82('0x23')]==_0x1b5260;});if(_0x5ea890[_0x1b82('0x24')]==0x1){_0x7455e8(_0x466441);}else{_0x2d78b5(new RangeError(_0x1b82('0x25')+_0x1b5260+_0x1b82('0x26')));}});});}exports[_0x1b82('0x27')]=function(_0x362657,_0x501ab0){logger[_0x1b82('0x10')](_0x1b82('0x28'),_0x362657[_0x1b82('0x29')]);var _0xc98ee2=originateValidation['validate'](_0x362657[_0x1b82('0x29')]);if(_0xc98ee2[_0x1b82('0x24')]>0x0){return _0x501ab0['status'](0x190)[_0x1b82('0x2a')](_0xc98ee2);}var _0x27b8f1=_0x362657[_0x1b82('0x29')]['userId'];var _0x5efb8e=_0x362657[_0x1b82('0x29')]['callNumber'];var _0x5df802=_0x362657[_0x1b82('0x29')][_0x1b82('0x2b')];var _0x7fd793=_0x362657['body'][_0x1b82('0x2c')];return getAgent(_0x27b8f1)[_0x1b82('0x1a')](function(_0xea774a){logger[_0x1b82('0x10')]('entityFound:',_0xea774a[_0x1b82('0x16')]);emit(util[_0x1b82('0x2d')](_0x1b82('0x2e'),_0xea774a['name']),'webbar:originate',{'callNumber':_0x5efb8e,'callerId':_0x5df802,'callbackUrl':_0x7fd793});return _0x501ab0[_0x1b82('0x17')](0xc8)['json']({'error':![],'message':_0x1b82('0x2f')});})[_0x1b82('0x30')](handleError(_0x501ab0));};exports[_0x1b82('0x31')]=function(_0x348880,_0x1255db){logger[_0x1b82('0x10')](_0x1b82('0x32'),_0x348880[_0x1b82('0x29')]);var _0x47cd9f=hangupValidation['validate'](_0x348880[_0x1b82('0x29')]);if(_0x47cd9f['length']>0x0){return _0x1255db[_0x1b82('0x17')](0x190)['json'](_0x47cd9f);}var _0x1c5bc1=_0x348880[_0x1b82('0x29')][_0x1b82('0x33')];var _0x2c1cd0=_0x348880[_0x1b82('0x29')][_0x1b82('0x23')];return getAgent(_0x1c5bc1)['then'](function(_0x17d214){logger['info'](_0x1b82('0x34'),_0x17d214['name']);emit(util[_0x1b82('0x2d')]('user:%s',_0x17d214['name']),_0x1b82('0x35'),{'sessionId':_0x2c1cd0});return _0x1255db[_0x1b82('0x17')](0xc8)[_0x1b82('0x2a')]({'error':![],'message':_0x1b82('0x36')});})[_0x1b82('0x30')](handleError(_0x1255db));};exports['answer']=function(_0x16f26d,_0x4ffa9e){logger[_0x1b82('0x10')](_0x1b82('0x37'),_0x16f26d[_0x1b82('0x29')]);var _0x3adf9c=answerValidation[_0x1b82('0xb')](_0x16f26d['body']);if(_0x3adf9c[_0x1b82('0x24')]>0x0){return _0x4ffa9e['status'](0x190)[_0x1b82('0x2a')](_0x3adf9c);}var _0x14b3ab=_0x16f26d['body'][_0x1b82('0x33')];var _0x225f6b=_0x16f26d[_0x1b82('0x29')][_0x1b82('0x23')];return getAgent(_0x14b3ab)[_0x1b82('0x1a')](function(_0x199213){logger[_0x1b82('0x10')]('entityFound:',_0x199213[_0x1b82('0x16')]);emit(util['format'](_0x1b82('0x2e'),_0x199213[_0x1b82('0x16')]),_0x1b82('0x38'),{'sessionId':_0x225f6b});return _0x4ffa9e[_0x1b82('0x17')](0xc8)[_0x1b82('0x2a')]({'error':![],'message':_0x1b82('0x39')});})[_0x1b82('0x30')](handleError(_0x4ffa9e));};exports[_0x1b82('0x3a')]=function(_0x192ce3,_0x120b35){logger[_0x1b82('0x10')](_0x1b82('0x3b'),_0x192ce3[_0x1b82('0x29')]);var _0x432e84=holdValidation['validate'](_0x192ce3['body']);if(_0x432e84[_0x1b82('0x24')]>0x0){return _0x120b35['status'](0x190)[_0x1b82('0x2a')](_0x432e84);}var _0x3df0af=_0x192ce3[_0x1b82('0x29')]['userId'];var _0x409a41=_0x192ce3['body']['sessionId'];return getAgent(_0x3df0af)[_0x1b82('0x1a')](function(_0x2aadf7){logger[_0x1b82('0x10')]('entityFound:',_0x2aadf7[_0x1b82('0x16')]);emit(util[_0x1b82('0x2d')]('user:%s',_0x2aadf7['name']),_0x1b82('0x3c'),{'sessionId':_0x409a41});return _0x120b35[_0x1b82('0x17')](0xc8)[_0x1b82('0x2a')]({'error':![],'message':'hold\x20executed!'});})[_0x1b82('0x30')](handleError(_0x120b35));};exports[_0x1b82('0x3d')]=function(_0x31fb5d,_0x29f9ae){logger[_0x1b82('0x10')](_0x1b82('0x3e'),_0x31fb5d['body']);var _0x3914aa=unholdValidation['validate'](_0x31fb5d[_0x1b82('0x29')]);if(_0x3914aa[_0x1b82('0x24')]>0x0){return _0x29f9ae['status'](0x190)[_0x1b82('0x2a')](_0x3914aa);}var _0x5de11b=_0x31fb5d[_0x1b82('0x29')][_0x1b82('0x33')];var _0x26051f=_0x31fb5d[_0x1b82('0x29')][_0x1b82('0x23')];return getAgent(_0x5de11b)[_0x1b82('0x1a')](function(_0x493491){logger['info'](_0x1b82('0x34'),_0x493491[_0x1b82('0x16')]);emit(util[_0x1b82('0x2d')](_0x1b82('0x2e'),_0x493491[_0x1b82('0x16')]),_0x1b82('0x3f'),{'sessionId':_0x26051f});return _0x29f9ae[_0x1b82('0x17')](0xc8)[_0x1b82('0x2a')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x29f9ae));};exports['calls']=function(_0x2658b5,_0x2a95d2){logger[_0x1b82('0x10')](_0x1b82('0x40'),_0x2a95d2[_0x1b82('0x29')]);var _0x15b0d3=callsValidation[_0x1b82('0xb')](_0x2658b5['body']);if(_0x15b0d3[_0x1b82('0x24')]>0x0){return _0x2a95d2[_0x1b82('0x17')](0x190)[_0x1b82('0x2a')](_0x15b0d3);}var _0x42d3e1=_0x2658b5[_0x1b82('0x29')][_0x1b82('0x33')];var _0x25ee4e=respondWithRpcPromise(_0x1b82('0x1e'));var _0x52d4c5=getAgent(_0x42d3e1);return Promise[_0x1b82('0x1f')]([_0x25ee4e,_0x52d4c5])[_0x1b82('0x1a')](function(_0x39be28){var _0x22c6c8=_0x39be28[0x0];var _0x2bce47=_0x39be28[0x1];var _0x4b5dbc=_['filter'](_0x22c6c8[_0x1b82('0x21')],function(_0x326cda){return _0x326cda[_0x1b82('0x22')]==_0x2bce47['id'];});return _0x2a95d2[_0x1b82('0x17')](0xc8)['json']({'count':_0x4b5dbc[_0x1b82('0x24')],'rows':_0x4b5dbc});})[_0x1b82('0x30')](handleError(_0x2a95d2));};exports[_0x1b82('0x41')]=function(_0x26ad1c,_0x152f84){logger[_0x1b82('0x10')](_0x1b82('0x42'),_0x26ad1c[_0x1b82('0x29')]);var _0x181091=conferenceValidation[_0x1b82('0xb')](_0x26ad1c['body']);if(_0x181091[_0x1b82('0x24')]>0x0){return _0x152f84[_0x1b82('0x17')](0x190)['json'](_0x181091);}var _0x333c5e=_0x26ad1c[_0x1b82('0x29')][_0x1b82('0x33')];return getAgent(_0x333c5e)[_0x1b82('0x1a')](function(_0x4b26c4){logger[_0x1b82('0x10')](_0x1b82('0x34'),_0x4b26c4[_0x1b82('0x16')]);emit(util[_0x1b82('0x2d')](_0x1b82('0x2e'),_0x4b26c4[_0x1b82('0x16')]),'webbar:conference');return _0x152f84[_0x1b82('0x17')](0xc8)['json']({'error':![],'message':_0x1b82('0x43')});})['catch'](handleError(_0x152f84));};exports[_0x1b82('0x44')]=function(_0x2adf0e,_0x3e22ae){logger[_0x1b82('0x10')](_0x1b82('0x45'),_0x2adf0e[_0x1b82('0x29')]);var _0x245f20=transferValidation['validate'](_0x2adf0e[_0x1b82('0x29')]);if(_0x245f20[_0x1b82('0x24')]>0x0){return _0x3e22ae[_0x1b82('0x17')](0x190)[_0x1b82('0x2a')](_0x245f20);}var _0x567b9a=_0x2adf0e[_0x1b82('0x29')][_0x1b82('0x33')];var _0xa763a3=_0x2adf0e[_0x1b82('0x29')][_0x1b82('0x23')];var _0x1873de=_0x2adf0e[_0x1b82('0x29')][_0x1b82('0x46')];return getAgent(_0x567b9a)['then'](function(_0x1cf6b5){logger[_0x1b82('0x10')](_0x1b82('0x34'),_0x1cf6b5['name']);emit(util[_0x1b82('0x2d')](_0x1b82('0x2e'),_0x1cf6b5['name']),_0x1b82('0x47'),{'sessionId':_0xa763a3,'transferNumber':_0x1873de});return _0x3e22ae[_0x1b82('0x17')](0xc8)[_0x1b82('0x2a')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x3e22ae));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index d14eac1..db89dae 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 _0xc2c7=['/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe'];(function(_0x14608c,_0x426670){var _0x1a0746=function(_0x16bcf9){while(--_0x16bcf9){_0x14608c['push'](_0x14608c['shift']());}};_0x1a0746(++_0x426670);}(_0xc2c7,0x134));var _0x7c2c=function(_0x334de4,_0x6306f0){_0x334de4=_0x334de4-0x0;var _0x48ebb2=_0xc2c7[_0x334de4];return _0x48ebb2;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['get'](_0x7c2c('0xe'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xf')]);router[_0x7c2c('0x8')](_0x7c2c('0x10'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x11')]);router[_0x7c2c('0x8')](_0x7c2c('0x12'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x13')]);router[_0x7c2c('0x8')](_0x7c2c('0x14'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x15')]);router[_0x7c2c('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7c2c('0x16')](_0x7c2c('0xe'),auth[_0x7c2c('0x9')](),controller['addDisposition']);router[_0x7c2c('0x16')](_0x7c2c('0x10'),auth['isAuthenticated'](),controller[_0x7c2c('0x17')]);router['post'](_0x7c2c('0x12'),auth['isAuthenticated'](),controller[_0x7c2c('0x18')]);router[_0x7c2c('0x16')](_0x7c2c('0x14'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x19')]);router[_0x7c2c('0x16')](_0x7c2c('0x1a'),controller[_0x7c2c('0x1b')]);router[_0x7c2c('0x16')](_0x7c2c('0x1c'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x1d')]);router['put'](_0x7c2c('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x7c2c('0x1e')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x1f')]);router[_0x7c2c('0x1e')](_0x7c2c('0xe'),auth[_0x7c2c('0x9')](),controller['removeDispositions']);router[_0x7c2c('0x1e')]('/:id/canned_answers',auth[_0x7c2c('0x9')](),controller['removeAnswers']);router[_0x7c2c('0x1e')](_0x7c2c('0x12'),auth[_0x7c2c('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xdb28=['removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','getAgents','getApplications','post','create','addDisposition','addAnswer','addAgents','/:id/applications','addApplications','notify','/:id/send','put','update','delete','destroy'];(function(_0x4f8b12,_0x136e45){var _0x4fe3f0=function(_0x5e37f7){while(--_0x5e37f7){_0x4f8b12['push'](_0x4f8b12['shift']());}};_0x4fe3f0(++_0x136e45);}(_0xdb28,0x106));var _0x8db2=function(_0x2b9f2b,_0x135752){_0x2b9f2b=_0x2b9f2b-0x0;var _0x215a46=_0xdb28[_0x2b9f2b];return _0x215a46;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./whatsappAccount.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getAnswers']);router[_0x8db2('0x9')](_0x8db2('0x12'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0x8db2('0x14')]);router[_0x8db2('0x15')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);router[_0x8db2('0x15')](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x17')]);router[_0x8db2('0x15')](_0x8db2('0x11'),auth['isAuthenticated'](),controller[_0x8db2('0x18')]);router[_0x8db2('0x15')]('/:id/users',auth[_0x8db2('0xa')](),controller[_0x8db2('0x19')]);router[_0x8db2('0x15')](_0x8db2('0x1a'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x1b')]);router['post']('/:id/notify',controller[_0x8db2('0x1c')]);router[_0x8db2('0x15')](_0x8db2('0x1d'),auth[_0x8db2('0xa')](),controller['send']);router[_0x8db2('0x1e')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);router[_0x8db2('0x20')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x21')]);router[_0x8db2('0x20')](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x22')]);router[_0x8db2('0x20')]('/:id/canned_answers',auth[_0x8db2('0xa')](),controller['removeAnswers']);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x8db2('0x23')]);module[_0x8db2('0x24')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index ca357be..6beca38 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 _0x75b1=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','twilio','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x304721,_0xd9ceea){var _0x4f25a4=function(_0x240876){while(--_0x240876){_0x304721['push'](_0x304721['shift']());}};_0x4f25a4(++_0xd9ceea);}(_0x75b1,0xd3));var _0x175b=function(_0x4cf46a,_0x2ed812){_0x4cf46a=_0x4cf46a-0x0;var _0x289731=_0x75b1[_0x4cf46a];return _0x289731;};'use strict';var Sequelize=require(_0x175b('0x0'));var rs=require(_0x175b('0x1'));module['exports']={'name':{'type':Sequelize[_0x175b('0x2')],'unique':_0x175b('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x175b('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x175b('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x175b('0x2')]},'type':{'type':Sequelize['ENUM'](_0x175b('0x4'))},'accountSid':{'type':Sequelize[_0x175b('0x2')]},'authToken':{'type':Sequelize[_0x175b('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x175b('0x5');}},'notificationSound':{'type':Sequelize[_0x175b('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x175b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x175b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x175b('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x175b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x175b('0x7')],'comment':_0x175b('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x175b('0x6')],'defaultValue':![],'comment':_0x175b('0x9'),'set':function(_0x1622fc){if(!_0x1622fc){this[_0x175b('0xa')](_0x175b('0xb'),null);}this[_0x175b('0xa')](_0x175b('0xc'),_0x1622fc);}},'description':{'type':Sequelize[_0x175b('0x2')]}}; \ No newline at end of file +var _0x9933=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM'];(function(_0x399873,_0x5dc5eb){var _0x451c43=function(_0x4a5f1c){while(--_0x4a5f1c){_0x399873['push'](_0x399873['shift']());}};_0x451c43(++_0x5dc5eb);}(_0x9933,0x1d9));var _0x3993=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9933[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x3993('0x0'));var rs=require(_0x3993('0x1'));module[_0x3993('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x3993('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x3993('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x3993('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x3993('0x5')]();}},'phone':{'type':Sequelize[_0x3993('0x4')]},'type':{'type':Sequelize[_0x3993('0x6')]('twilio')},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x3993('0x4')]},'notificationTemplate':{'type':Sequelize[_0x3993('0x7')],'defaultValue':function(){return _0x3993('0x8');}},'notificationSound':{'type':Sequelize[_0x3993('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x3993('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3993('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3993('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3993('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3993('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3993('0x9')],'defaultValue':![],'comment':_0x3993('0xb'),'set':function(_0x2e4e36){if(!_0x2e4e36){this[_0x3993('0xc')](_0x3993('0xd'),null);}this[_0x3993('0xc')](_0x3993('0xe'),_0x2e4e36);}},'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 81e0beb..406d723 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 _0xf6fd=['params','mandatoryDispositionPause','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','WhatsappAccountId','findOne','hasOwnProperty','Disposition','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','getApplications','notify','whatsapp','Applications','account','applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','type','twilio','from','From','replace','whatsapp:','messageId','MessageSid','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','updatedAt','list','defaults','interaction','autoclose','push','unmanaged','*,*,*,*','created','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','List','DESC','WhatsappInteraction','out','WhatsappMessage','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','sendStatus','end','status','limit','count','offset','set','json','apply','reject','save','get','WhatsappAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','map','WhatsappAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show'];(function(_0x507e16,_0xc7b884){var _0xacc8b0=function(_0x17d520){while(--_0x17d520){_0x507e16['push'](_0x507e16['shift']());}};_0xacc8b0(++_0xc7b884);}(_0xf6fd,0x1d9));var _0xdf6f=function(_0x289849,_0x2954b7){_0x289849=_0x289849-0x0;var _0x23eb61=_0xf6fd[_0x289849];return _0x23eb61;};'use strict';var emlformat=require(_0xdf6f('0x0'));var rimraf=require(_0xdf6f('0x1'));var zipdir=require(_0xdf6f('0x2'));var jsonpatch=require(_0xdf6f('0x3'));var rp=require(_0xdf6f('0x4'));var moment=require(_0xdf6f('0x5'));var BPromise=require(_0xdf6f('0x6'));var Mustache=require('mustache');var util=require(_0xdf6f('0x7'));var path=require(_0xdf6f('0x8'));var sox=require('sox');var csv=require(_0xdf6f('0x9'));var ejs=require(_0xdf6f('0xa'));var fs=require('fs');var fs_extra=require(_0xdf6f('0xb'));var _=require(_0xdf6f('0xc'));var squel=require(_0xdf6f('0xd'));var crypto=require(_0xdf6f('0xe'));var jsforce=require(_0xdf6f('0xf'));var deskjs=require(_0xdf6f('0x10'));var toCsv=require(_0xdf6f('0x9'));var querystring=require(_0xdf6f('0x11'));var Papa=require(_0xdf6f('0x12'));var Redis=require(_0xdf6f('0x13'));var authService=require(_0xdf6f('0x14'));var qs=require(_0xdf6f('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf6f('0x16'));var logger=require(_0xdf6f('0x17'))(_0xdf6f('0x18'));var utils=require(_0xdf6f('0x19'));var config=require(_0xdf6f('0x1a'));var licenseUtil=require(_0xdf6f('0x1b'));var db=require('../../mysqldb')['db'];config[_0xdf6f('0x1c')]=_['defaults'](config['redis'],{'host':_0xdf6f('0x1d'),'port':0x18eb});var socket=require(_0xdf6f('0x1e'))(new Redis(config[_0xdf6f('0x1c')]));require(_0xdf6f('0x1f'))[_0xdf6f('0x20')](socket);var jayson=require(_0xdf6f('0x21'));var client=jayson[_0xdf6f('0x22')][_0xdf6f('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x2f319f,_0x32bf69,_0x17c31e,_0x5beaca){return new BPromise(function(_0x40f89d,_0x5d002a){var _0x382982=_0x5beaca||client;return _0x382982[_0xdf6f('0x24')](_0x2f319f,_0x17c31e)[_0xdf6f('0x25')](function(_0x45f66e){logger['info'](_0xdf6f('0x26'),_0x32bf69,_0xdf6f('0x27'));logger[_0xdf6f('0x28')](_0xdf6f('0x29'),_0x32bf69,'request\x20sent',JSON[_0xdf6f('0x2a')](_0x45f66e));if(_0x45f66e[_0xdf6f('0x2b')]){if(_0x45f66e[_0xdf6f('0x2b')]['code']===0x1f4){logger[_0xdf6f('0x2b')](_0xdf6f('0x26'),_0x32bf69,_0x45f66e[_0xdf6f('0x2b')]['message']);return _0x5d002a(_0x45f66e['error'][_0xdf6f('0x2c')]);}logger[_0xdf6f('0x2b')]('WhatsappAccount,\x20%s,\x20%s',_0x32bf69,_0x45f66e[_0xdf6f('0x2b')][_0xdf6f('0x2c')]);return _0x40f89d(_0x45f66e['error'][_0xdf6f('0x2c')]);}else{logger[_0xdf6f('0x2d')](_0xdf6f('0x26'),_0x32bf69,_0xdf6f('0x27'));_0x40f89d(_0x45f66e['result'][_0xdf6f('0x2c')]);}})[_0xdf6f('0x2e')](function(_0x3dfca2){logger[_0xdf6f('0x2b')](_0xdf6f('0x26'),_0x32bf69,_0x3dfca2);_0x5d002a(_0x3dfca2);});});}function respondWithStatusCode(_0x30a9d5,_0x37fc78){_0x37fc78=_0x37fc78||0xcc;return function(_0x4f5653){if(_0x4f5653){return _0x30a9d5[_0xdf6f('0x2f')](_0x37fc78);}return _0x30a9d5['status'](_0x37fc78)[_0xdf6f('0x30')]();};}function respondWithResult(_0x5cd524,_0x19a4ab){_0x19a4ab=_0x19a4ab||0xc8;return function(_0x2f9f76){if(_0x2f9f76){return _0x5cd524[_0xdf6f('0x31')](_0x19a4ab)['json'](_0x2f9f76);}};}function respondWithFilteredResult(_0x2c77dd,_0x54b887){return function(_0x296f5a){if(_0x296f5a){var _0x297ba3=typeof _0x54b887['offset']==='undefined'&&typeof _0x54b887[_0xdf6f('0x32')]==='undefined';var _0x424bd7=_0x296f5a[_0xdf6f('0x33')];var _0x378eaf=_0x297ba3?0x0:_0x54b887[_0xdf6f('0x34')];var _0x32aed0=_0x297ba3?_0x296f5a[_0xdf6f('0x33')]:_0x54b887[_0xdf6f('0x34')]+_0x54b887[_0xdf6f('0x32')];var _0x19c304;if(_0x32aed0>=_0x424bd7){_0x32aed0=_0x424bd7;_0x19c304=0xc8;}else{_0x19c304=0xce;}_0x2c77dd[_0xdf6f('0x31')](_0x19c304);return _0x2c77dd[_0xdf6f('0x35')]('Content-Range',_0x378eaf+'-'+_0x32aed0+'/'+_0x424bd7)[_0xdf6f('0x36')](_0x296f5a);}return null;};}function patchUpdates(_0x1e4c6c){return function(_0x38df00){try{jsonpatch[_0xdf6f('0x37')](_0x38df00,_0x1e4c6c,!![]);}catch(_0x515e50){return BPromise[_0xdf6f('0x38')](_0x515e50);}return _0x38df00[_0xdf6f('0x39')]();};}function saveUpdates(_0x25e9ec,_0x3590f2){return function(_0x5c40fb){if(_0x5c40fb){return _0x5c40fb['update'](_0x25e9ec)[_0xdf6f('0x25')](function(_0x5edd6a){return _0x5edd6a;});}return null;};}function removeEntity(_0x2b9a1d,_0x5361ee){return function(_0x19fee1){if(_0x19fee1){return _0x19fee1['destroy']()['then'](function(){var _0x1700ce=_0x19fee1[_0xdf6f('0x3a')]({'plain':!![]});var _0x25e787=_0xdf6f('0x3b');return db[_0xdf6f('0x3c')][_0xdf6f('0x3d')]({'where':{'type':_0x25e787,'resourceId':_0x1700ce['id']}})[_0xdf6f('0x25')](function(){return _0x19fee1;});})['then'](function(){_0x2b9a1d[_0xdf6f('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23f03b,_0x1916bc){return function(_0x5e312c){if(!_0x5e312c){_0x23f03b[_0xdf6f('0x2f')](0x194);}return _0x5e312c;};}function handleError(_0x68c01c,_0x40fa82){_0x40fa82=_0x40fa82||0x1f4;return function(_0x28de37){logger[_0xdf6f('0x2b')](_0x28de37[_0xdf6f('0x3e')]);if(_0x28de37[_0xdf6f('0x3f')]){delete _0x28de37[_0xdf6f('0x3f')];}_0x68c01c[_0xdf6f('0x31')](_0x40fa82)[_0xdf6f('0x40')](_0x28de37);};}exports[_0xdf6f('0x41')]=function(_0x210ce4,_0x177c52){var _0x1d6202={'include':[{'model':db[_0xdf6f('0x42')],'as':'mandatoryDispositionPause'}]},_0x4fcd36={},_0xd7e613={'count':0x0,'rows':[]};var _0x573f6b=_[_0xdf6f('0x43')](db[_0xdf6f('0x44')][_0xdf6f('0x45')],function(_0x28f927){return{'name':_0x28f927[_0xdf6f('0x46')],'type':_0x28f927['type']['key']};});_0x4fcd36[_0xdf6f('0x47')]=_[_0xdf6f('0x43')](_0x573f6b,_0xdf6f('0x3f'));_0x4fcd36[_0xdf6f('0x48')]=_[_0xdf6f('0x49')](_0x210ce4['query']);_0x4fcd36[_0xdf6f('0x4a')]=_[_0xdf6f('0x4b')](_0x4fcd36[_0xdf6f('0x47')],_0x4fcd36[_0xdf6f('0x48')]);_0x1d6202[_0xdf6f('0x4c')]=_[_0xdf6f('0x4b')](_0x4fcd36[_0xdf6f('0x47')],qs[_0xdf6f('0x4d')](_0x210ce4['query'][_0xdf6f('0x4d')]));_0x1d6202[_0xdf6f('0x4c')]=_0x1d6202[_0xdf6f('0x4c')][_0xdf6f('0x4e')]?_0x1d6202['attributes']:_0x4fcd36[_0xdf6f('0x47')];if(!_0x210ce4['query']['hasOwnProperty'](_0xdf6f('0x4f'))){_0x1d6202[_0xdf6f('0x32')]=qs[_0xdf6f('0x32')](_0x210ce4[_0xdf6f('0x48')][_0xdf6f('0x32')]);_0x1d6202[_0xdf6f('0x34')]=qs[_0xdf6f('0x34')](_0x210ce4['query'][_0xdf6f('0x34')]);}_0x1d6202[_0xdf6f('0x50')]=qs[_0xdf6f('0x51')](_0x210ce4[_0xdf6f('0x48')][_0xdf6f('0x51')]);_0x1d6202[_0xdf6f('0x52')]=qs['filters'](_[_0xdf6f('0x53')](_0x210ce4[_0xdf6f('0x48')],_0x4fcd36[_0xdf6f('0x4a')]),_0x573f6b);if(_0x210ce4['query'][_0xdf6f('0x54')]){_0x1d6202[_0xdf6f('0x52')]=_[_0xdf6f('0x55')](_0x1d6202['where'],{'$or':_['map'](_0x573f6b,function(_0x1133cc){if(_0x1133cc['type']!==_0xdf6f('0x56')){var _0x42da8b={};_0x42da8b[_0x1133cc['name']]={'$like':'%'+_0x210ce4[_0xdf6f('0x48')][_0xdf6f('0x54')]+'%'};return _0x42da8b;}})});}_0x1d6202=_[_0xdf6f('0x55')]({},_0x1d6202,_0x210ce4['options']);var _0x51f81a={'where':_0x1d6202[_0xdf6f('0x52')]};return db['WhatsappAccount'][_0xdf6f('0x33')](_0x51f81a)['then'](function(_0x25bbbc){_0xd7e613[_0xdf6f('0x33')]=_0x25bbbc;if(_0x210ce4[_0xdf6f('0x48')][_0xdf6f('0x57')]){_0x1d6202['include']=[{'all':!![]}];}return db[_0xdf6f('0x44')][_0xdf6f('0x58')](_0x1d6202);})[_0xdf6f('0x25')](function(_0x16f0d9){_0xd7e613[_0xdf6f('0x59')]=_0x16f0d9;return _0xd7e613;})[_0xdf6f('0x25')](respondWithFilteredResult(_0x177c52,_0x1d6202))['catch'](handleError(_0x177c52,null));};exports[_0xdf6f('0x5a')]=function(_0x397661,_0x5d6f94){var _0x1af15e={'raw':![],'where':{'id':_0x397661[_0xdf6f('0x5b')]['id']},'include':[{'model':db[_0xdf6f('0x42')],'as':_0xdf6f('0x5c')}]},_0x3a1dc5={};_0x3a1dc5[_0xdf6f('0x47')]=_[_0xdf6f('0x49')](db['WhatsappAccount']['rawAttributes']);_0x3a1dc5[_0xdf6f('0x48')]=_[_0xdf6f('0x49')](_0x397661['query']);_0x3a1dc5[_0xdf6f('0x4a')]=_[_0xdf6f('0x4b')](_0x3a1dc5[_0xdf6f('0x47')],_0x3a1dc5[_0xdf6f('0x48')]);_0x1af15e[_0xdf6f('0x4c')]=_['intersection'](_0x3a1dc5['model'],qs[_0xdf6f('0x4d')](_0x397661[_0xdf6f('0x48')]['fields']));_0x1af15e[_0xdf6f('0x4c')]=_0x1af15e['attributes'][_0xdf6f('0x4e')]?_0x1af15e[_0xdf6f('0x4c')]:_0x3a1dc5['model'];if(_0x397661['query'][_0xdf6f('0x57')]){_0x1af15e['include']=[{'all':!![]}];}_0x1af15e=_[_0xdf6f('0x55')]({},_0x1af15e,_0x397661[_0xdf6f('0x5d')]);return db[_0xdf6f('0x44')][_0xdf6f('0x5e')](_0x1af15e)[_0xdf6f('0x25')](handleEntityNotFound(_0x5d6f94,null))[_0xdf6f('0x25')](respondWithResult(_0x5d6f94,null))[_0xdf6f('0x2e')](handleError(_0x5d6f94,null));};exports[_0xdf6f('0x5f')]=function(_0x4df359,_0x4f26d6){return db[_0xdf6f('0x44')]['create'](_0x4df359[_0xdf6f('0x60')],{})[_0xdf6f('0x25')](function(_0x4c3dcd){var _0x1949ed=_0x4df359[_0xdf6f('0x61')][_0xdf6f('0x3a')]({'plain':!![]});if(!_0x1949ed)throw new Error(_0xdf6f('0x62'));if(_0x1949ed['role']===_0xdf6f('0x61')){var _0x59cbe8=_0x4c3dcd[_0xdf6f('0x3a')]({'plain':!![]});var _0x1cf20b=_0xdf6f('0x3b');return db['UserProfileSection']['find']({'where':{'name':_0x1cf20b,'userProfileId':_0x1949ed[_0xdf6f('0x63')]},'raw':!![]})['then'](function(_0x11b267){if(_0x11b267&&_0x11b267[_0xdf6f('0x64')]===0x0){return db[_0xdf6f('0x3c')][_0xdf6f('0x5f')]({'name':_0x59cbe8[_0xdf6f('0x3f')],'resourceId':_0x59cbe8['id'],'type':_0x11b267['name'],'sectionId':_0x11b267['id']},{})[_0xdf6f('0x25')](function(){return _0x4c3dcd;});}else{return _0x4c3dcd;}})[_0xdf6f('0x2e')](function(_0x137f75){logger[_0xdf6f('0x2b')](_0xdf6f('0x65'),_0x137f75);throw _0x137f75;});}return _0x4c3dcd;})['then'](respondWithResult(_0x4f26d6,0xc9))[_0xdf6f('0x2e')](handleError(_0x4f26d6,null));};exports[_0xdf6f('0x66')]=function(_0x507d2b,_0x521b61){if(_0x507d2b[_0xdf6f('0x60')]['id']){delete _0x507d2b[_0xdf6f('0x60')]['id'];}return db[_0xdf6f('0x44')]['find']({'where':{'id':_0x507d2b[_0xdf6f('0x5b')]['id']},'include':[{'model':db[_0xdf6f('0x42')],'as':_0xdf6f('0x5c')}]})[_0xdf6f('0x25')](handleEntityNotFound(_0x521b61,null))['then'](saveUpdates(_0x507d2b[_0xdf6f('0x60')],null))[_0xdf6f('0x25')](respondWithResult(_0x521b61,null))[_0xdf6f('0x2e')](handleError(_0x521b61,null));};exports[_0xdf6f('0x3d')]=function(_0x5b00cd,_0x37123d){return db[_0xdf6f('0x44')][_0xdf6f('0x5e')]({'where':{'id':_0x5b00cd[_0xdf6f('0x5b')]['id']}})[_0xdf6f('0x25')](handleEntityNotFound(_0x37123d,null))[_0xdf6f('0x25')](removeEntity(_0x37123d,null))[_0xdf6f('0x2e')](handleError(_0x37123d,null));};exports[_0xdf6f('0x67')]=function(_0x26c54e,_0x7b10e3){return db[_0xdf6f('0x44')][_0xdf6f('0x67')]()[_0xdf6f('0x25')](respondWithResult(_0x7b10e3,null))[_0xdf6f('0x2e')](handleError(_0x7b10e3,null));};exports['addDisposition']=function(_0x75cd14,_0x525524,_0x4dd876){if(_0x75cd14[_0xdf6f('0x60')]['id']){delete _0x75cd14[_0xdf6f('0x60')]['id'];}return db[_0xdf6f('0x44')][_0xdf6f('0x5e')]({'where':{'id':_0x75cd14['params']['id']}})[_0xdf6f('0x25')](handleEntityNotFound(_0x525524,null))['then'](function(_0x58c62b){if(_0x58c62b){_0x75cd14[_0xdf6f('0x60')][_0xdf6f('0x68')]=_0x58c62b['id'];return db['Disposition'][_0xdf6f('0x5f')](_0x75cd14[_0xdf6f('0x60')]);}})['then'](respondWithResult(_0x525524,null))['catch'](handleError(_0x525524,null));};exports['getDispositions']=function(_0x11ec48,_0x3b9af5,_0x3ae152){var _0x1f5e81={'raw':![],'where':{}};var _0x26373d={};var _0x277416={'count':0x0,'rows':[]};return db[_0xdf6f('0x44')][_0xdf6f('0x69')]({'where':{'id':_0x11ec48[_0xdf6f('0x5b')]['id']}})[_0xdf6f('0x25')](handleEntityNotFound(_0x3b9af5,null))['then'](function(_0x2b198d){if(_0x2b198d){_0x26373d['model']=_[_0xdf6f('0x49')](db['Disposition']['rawAttributes']);_0x26373d[_0xdf6f('0x48')]=_[_0xdf6f('0x49')](_0x11ec48[_0xdf6f('0x48')]);_0x26373d[_0xdf6f('0x4a')]=_[_0xdf6f('0x4b')](_0x26373d['model'],_0x26373d[_0xdf6f('0x48')]);_0x1f5e81['attributes']=_[_0xdf6f('0x4b')](_0x26373d[_0xdf6f('0x47')],qs[_0xdf6f('0x4d')](_0x11ec48[_0xdf6f('0x48')][_0xdf6f('0x4d')]));_0x1f5e81[_0xdf6f('0x4c')]=_0x1f5e81[_0xdf6f('0x4c')]['length']?_0x1f5e81['attributes']:_0x26373d[_0xdf6f('0x47')];if(!_0x11ec48[_0xdf6f('0x48')][_0xdf6f('0x6a')](_0xdf6f('0x4f'))){_0x1f5e81[_0xdf6f('0x32')]=qs[_0xdf6f('0x32')](_0x11ec48[_0xdf6f('0x48')][_0xdf6f('0x32')]);_0x1f5e81[_0xdf6f('0x34')]=qs[_0xdf6f('0x34')](_0x11ec48[_0xdf6f('0x48')][_0xdf6f('0x34')]);}_0x1f5e81[_0xdf6f('0x50')]=qs[_0xdf6f('0x51')](_0x11ec48['query'][_0xdf6f('0x51')]);_0x1f5e81['where']=qs[_0xdf6f('0x4a')](_[_0xdf6f('0x53')](_0x11ec48[_0xdf6f('0x48')],_0x26373d['filters']));_0x1f5e81['where'][_0xdf6f('0x68')]=_0x2b198d['id'];if(_0x11ec48['query'][_0xdf6f('0x54')]){_0x1f5e81[_0xdf6f('0x52')]=_['merge'](_0x1f5e81[_0xdf6f('0x52')],{'$or':_[_0xdf6f('0x43')](_0x1f5e81[_0xdf6f('0x4c')],function(_0x53d1b2){var _0x3ef766={};_0x3ef766[_0x53d1b2]={'$like':'%'+_0x11ec48[_0xdf6f('0x48')][_0xdf6f('0x54')]+'%'};return _0x3ef766;})});}_0x1f5e81=_['merge']({},_0x1f5e81,_0x11ec48['options']);return db[_0xdf6f('0x6b')][_0xdf6f('0x33')]({'where':_0x1f5e81[_0xdf6f('0x52')]})[_0xdf6f('0x25')](function(_0x4d9312){_0x277416[_0xdf6f('0x33')]=_0x4d9312;if(_0x11ec48[_0xdf6f('0x48')][_0xdf6f('0x57')]){_0x1f5e81[_0xdf6f('0x6c')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1f5e81);})[_0xdf6f('0x25')](function(_0x2bfed9){_0x277416[_0xdf6f('0x59')]=_0x2bfed9;return _0x277416;});}})[_0xdf6f('0x25')](respondWithFilteredResult(_0x3b9af5,_0x1f5e81))[_0xdf6f('0x2e')](handleError(_0x3b9af5,null));};exports[_0xdf6f('0x6d')]=function(_0x4e3894,_0x5410c5,_0x52ff9b){return db[_0xdf6f('0x44')][_0xdf6f('0x5e')]({'where':{'id':_0x4e3894['params']['id']}})[_0xdf6f('0x25')](handleEntityNotFound(_0x5410c5,null))[_0xdf6f('0x25')](function(_0x10c756){if(_0x10c756){return _0x10c756['removeDispositions'](_0x4e3894['query'][_0xdf6f('0x6e')]);}})[_0xdf6f('0x25')](respondWithStatusCode(_0x5410c5,null))[_0xdf6f('0x2e')](handleError(_0x5410c5,null));};exports[_0xdf6f('0x6f')]=function(_0x10b14c,_0xe78d18,_0x566a69){if(_0x10b14c['body']['id']){delete _0x10b14c[_0xdf6f('0x60')]['id'];}return db[_0xdf6f('0x44')][_0xdf6f('0x5e')]({'where':{'id':_0x10b14c[_0xdf6f('0x5b')]['id']}})['then'](handleEntityNotFound(_0xe78d18,null))[_0xdf6f('0x25')](function(_0x4d5c41){if(_0x4d5c41){_0x10b14c[_0xdf6f('0x60')][_0xdf6f('0x68')]=_0x4d5c41['id'];return db[_0xdf6f('0x70')][_0xdf6f('0x5f')](_0x10b14c[_0xdf6f('0x60')]);}})[_0xdf6f('0x25')](respondWithResult(_0xe78d18,null))['catch'](handleError(_0xe78d18,null));};exports[_0xdf6f('0x71')]=function(_0xed5d77,_0x36a881,_0x3d185e){var _0x8c140b={'raw':![],'where':{}};var _0x602f62={};var _0x34dc44={'count':0x0,'rows':[]};return db[_0xdf6f('0x44')]['findOne']({'where':{'id':_0xed5d77[_0xdf6f('0x5b')]['id']}})[_0xdf6f('0x25')](handleEntityNotFound(_0x36a881,null))['then'](function(_0x559934){if(_0x559934){_0x602f62[_0xdf6f('0x47')]=_[_0xdf6f('0x49')](db[_0xdf6f('0x70')][_0xdf6f('0x45')]);_0x602f62['query']=_[_0xdf6f('0x49')](_0xed5d77[_0xdf6f('0x48')]);_0x602f62['filters']=_['intersection'](_0x602f62[_0xdf6f('0x47')],_0x602f62[_0xdf6f('0x48')]);_0x8c140b[_0xdf6f('0x4c')]=_[_0xdf6f('0x4b')](_0x602f62[_0xdf6f('0x47')],qs[_0xdf6f('0x4d')](_0xed5d77[_0xdf6f('0x48')][_0xdf6f('0x4d')]));_0x8c140b['attributes']=_0x8c140b[_0xdf6f('0x4c')][_0xdf6f('0x4e')]?_0x8c140b[_0xdf6f('0x4c')]:_0x602f62[_0xdf6f('0x47')];if(!_0xed5d77[_0xdf6f('0x48')][_0xdf6f('0x6a')](_0xdf6f('0x4f'))){_0x8c140b[_0xdf6f('0x32')]=qs[_0xdf6f('0x32')](_0xed5d77[_0xdf6f('0x48')][_0xdf6f('0x32')]);_0x8c140b['offset']=qs['offset'](_0xed5d77['query'][_0xdf6f('0x34')]);}_0x8c140b[_0xdf6f('0x50')]=qs['sort'](_0xed5d77[_0xdf6f('0x48')][_0xdf6f('0x51')]);_0x8c140b[_0xdf6f('0x52')]=qs[_0xdf6f('0x4a')](_[_0xdf6f('0x53')](_0xed5d77[_0xdf6f('0x48')],_0x602f62[_0xdf6f('0x4a')]));_0x8c140b[_0xdf6f('0x52')][_0xdf6f('0x68')]=_0x559934['id'];if(_0xed5d77[_0xdf6f('0x48')]['filter']){_0x8c140b['where']=_[_0xdf6f('0x55')](_0x8c140b[_0xdf6f('0x52')],{'$or':_['map'](_0x8c140b[_0xdf6f('0x4c')],function(_0x37784d){var _0x3aed87={};_0x3aed87[_0x37784d]={'$like':'%'+_0xed5d77['query'][_0xdf6f('0x54')]+'%'};return _0x3aed87;})});}_0x8c140b=_[_0xdf6f('0x55')]({},_0x8c140b,_0xed5d77[_0xdf6f('0x5d')]);return db[_0xdf6f('0x70')][_0xdf6f('0x33')]({'where':_0x8c140b[_0xdf6f('0x52')]})[_0xdf6f('0x25')](function(_0x3fa710){_0x34dc44[_0xdf6f('0x33')]=_0x3fa710;if(_0xed5d77[_0xdf6f('0x48')][_0xdf6f('0x57')]){_0x8c140b[_0xdf6f('0x6c')]=[{'all':!![]}];}return db[_0xdf6f('0x70')]['findAll'](_0x8c140b);})[_0xdf6f('0x25')](function(_0x444be7){_0x34dc44[_0xdf6f('0x59')]=_0x444be7;return _0x34dc44;});}})[_0xdf6f('0x25')](respondWithFilteredResult(_0x36a881,_0x8c140b))[_0xdf6f('0x2e')](handleError(_0x36a881,null));};exports[_0xdf6f('0x72')]=function(_0x19c53e,_0x28662c,_0xd1940e){return db[_0xdf6f('0x44')][_0xdf6f('0x5e')]({'where':{'id':_0x19c53e[_0xdf6f('0x5b')]['id']}})[_0xdf6f('0x25')](handleEntityNotFound(_0x28662c,null))[_0xdf6f('0x25')](function(_0x5da90f){if(_0x5da90f){return _0x5da90f[_0xdf6f('0x72')](_0x19c53e['query'][_0xdf6f('0x6e')]);}})[_0xdf6f('0x25')](respondWithStatusCode(_0x28662c,null))[_0xdf6f('0x2e')](handleError(_0x28662c,null));};exports[_0xdf6f('0x73')]=function(_0xecf3f2,_0x5d934f,_0x268804){return db['WhatsappAccount'][_0xdf6f('0x5e')]({'where':{'id':_0xecf3f2['params']['id']}})[_0xdf6f('0x25')](handleEntityNotFound(_0x5d934f,null))[_0xdf6f('0x25')](function(_0x86d6c0){if(_0x86d6c0){return _0x86d6c0[_0xdf6f('0x73')](_0xecf3f2[_0xdf6f('0x60')][_0xdf6f('0x6e')],_[_0xdf6f('0x74')](_0xecf3f2[_0xdf6f('0x60')],['ids','id'])||{})[_0xdf6f('0x75')](function(_0x32a7e4){for(var _0x1eb919=0x0;_0x1eb919<_0xecf3f2['body'][_0xdf6f('0x6e')]['length'];_0x1eb919+=0x1){socket[_0xdf6f('0x76')](_0xdf6f('0x77'),{'UserId':Number(_0xecf3f2[_0xdf6f('0x60')][_0xdf6f('0x6e')][_0x1eb919]),'WhatsappAccountId':Number(_0xecf3f2['params']['id'])});}return _0x32a7e4;});}})['then'](respondWithResult(_0x5d934f,null))[_0xdf6f('0x2e')](handleError(_0x5d934f,null));};exports[_0xdf6f('0x78')]=function(_0x2f2eba,_0x13f381,_0x251890){return db[_0xdf6f('0x44')]['find']({'where':{'id':_0x2f2eba[_0xdf6f('0x5b')]['id']}})[_0xdf6f('0x25')](handleEntityNotFound(_0x13f381,null))['then'](function(_0x3da11a){if(_0x3da11a){return _0x3da11a[_0xdf6f('0x78')](_0x2f2eba[_0xdf6f('0x48')][_0xdf6f('0x6e')])[_0xdf6f('0x25')](function(){if(_[_0xdf6f('0x79')](_0x2f2eba[_0xdf6f('0x48')][_0xdf6f('0x6e')])){for(var _0x479bd6=0x0;_0x479bd6<_0x2f2eba['query'][_0xdf6f('0x6e')]['length'];_0x479bd6+=0x1){socket[_0xdf6f('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0x2f2eba[_0xdf6f('0x48')][_0xdf6f('0x6e')][_0x479bd6]),'WhatsappAccountId':Number(_0x2f2eba[_0xdf6f('0x5b')]['id'])});}}else{socket['emit'](_0xdf6f('0x7a'),{'UserId':Number(_0x2f2eba[_0xdf6f('0x48')][_0xdf6f('0x6e')]),'WhatsappAccountId':Number(_0x2f2eba[_0xdf6f('0x5b')]['id'])});}});}})[_0xdf6f('0x25')](respondWithStatusCode(_0x13f381,null))[_0xdf6f('0x2e')](handleError(_0x13f381,null));};exports[_0xdf6f('0x7b')]=function(_0x1310de,_0x4b11eb,_0x299dab){var _0x29dcc2={};var _0x4e651e={};var _0x25bf34;var _0x943f83;return db[_0xdf6f('0x44')][_0xdf6f('0x69')]({'where':{'id':_0x1310de[_0xdf6f('0x5b')]['id']}})[_0xdf6f('0x25')](handleEntityNotFound(_0x4b11eb,null))['then'](function(_0x5dd313){if(_0x5dd313){_0x25bf34=_0x5dd313;_0x4e651e['model']=_[_0xdf6f('0x49')](db[_0xdf6f('0x7c')][_0xdf6f('0x45')]);_0x4e651e[_0xdf6f('0x48')]=_['keys'](_0x1310de['query']);_0x4e651e['filters']=_[_0xdf6f('0x4b')](_0x4e651e[_0xdf6f('0x47')],_0x4e651e[_0xdf6f('0x48')]);_0x29dcc2[_0xdf6f('0x4c')]=_[_0xdf6f('0x4b')](_0x4e651e[_0xdf6f('0x47')],qs[_0xdf6f('0x4d')](_0x1310de[_0xdf6f('0x48')]['fields']));_0x29dcc2[_0xdf6f('0x4c')]=_0x29dcc2[_0xdf6f('0x4c')][_0xdf6f('0x4e')]?_0x29dcc2[_0xdf6f('0x4c')]:_0x4e651e['model'];_0x29dcc2['order']=qs['sort'](_0x1310de[_0xdf6f('0x48')][_0xdf6f('0x51')]);_0x29dcc2[_0xdf6f('0x52')]=qs[_0xdf6f('0x4a')](_['pick'](_0x1310de[_0xdf6f('0x48')],_0x4e651e[_0xdf6f('0x4a')]));if(_0x1310de[_0xdf6f('0x48')]['filter']){_0x29dcc2[_0xdf6f('0x52')]=_[_0xdf6f('0x55')](_0x29dcc2['where'],{'$or':_['map'](_0x29dcc2['attributes'],function(_0x1ab492){var _0x172505={};_0x172505[_0x1ab492]={'$like':'%'+_0x1310de[_0xdf6f('0x48')]['filter']+'%'};return _0x172505;})});}_0x29dcc2=_[_0xdf6f('0x55')]({},_0x29dcc2,_0x1310de[_0xdf6f('0x5d')]);return _0x25bf34[_0xdf6f('0x7b')](_0x29dcc2);}})[_0xdf6f('0x25')](function(_0x529339){if(_0x529339){_0x943f83=_0x529339[_0xdf6f('0x4e')];if(!_0x1310de['query']['hasOwnProperty'](_0xdf6f('0x4f'))){_0x29dcc2[_0xdf6f('0x32')]=qs[_0xdf6f('0x32')](_0x1310de[_0xdf6f('0x48')][_0xdf6f('0x32')]);_0x29dcc2[_0xdf6f('0x34')]=qs[_0xdf6f('0x34')](_0x1310de[_0xdf6f('0x48')][_0xdf6f('0x34')]);}return _0x25bf34['getAgents'](_0x29dcc2);}})[_0xdf6f('0x25')](function(_0x1a5baf){if(_0x1a5baf){return _0x1a5baf?{'count':_0x943f83,'rows':_0x1a5baf}:null;}})['then'](respondWithResult(_0x4b11eb,null))[_0xdf6f('0x2e')](handleError(_0x4b11eb,null));};exports['addApplications']=function(_0x445a7e,_0x33a146,_0xa89a1e){return db[_0xdf6f('0x44')][_0xdf6f('0x69')]({'where':{'id':_0x445a7e['params']['id']}})['then'](handleEntityNotFound(_0x33a146,null))['then'](function(_0x17df98){if(_0x17df98){return db[_0xdf6f('0x7d')][_0xdf6f('0x7e')](function(_0x3304e5){return db[_0xdf6f('0x7f')][_0xdf6f('0x3d')]({'where':{'WhatsappAccountId':_0x445a7e['params']['id']},'transaction':_0x3304e5})[_0xdf6f('0x25')](function(_0x2355e7){var _0x1d16e3=_['map'](_0x445a7e[_0xdf6f('0x60')],function(_0x4fe417){_0x4fe417['WhatsappAccountId']=_0x445a7e[_0xdf6f('0x5b')]['id'];return _0x4fe417;});return db[_0xdf6f('0x7f')][_0xdf6f('0x80')](_0x1d16e3,{'transaction':_0x3304e5});});})[_0xdf6f('0x25')](function(){return db['WhatsappApplication'][_0xdf6f('0x81')]({'where':{'WhatsappAccountId':_0x445a7e['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x33a146,null))[_0xdf6f('0x2e')](handleError(_0x33a146,null));};exports['getApplications']=function(_0x5cf3b1,_0x1e05ad,_0x245634){var _0x3b1935={};var _0x4228aa={};var _0x18bbf7;var _0x2a4c41;return db[_0xdf6f('0x44')][_0xdf6f('0x69')]({'where':{'id':_0x5cf3b1[_0xdf6f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1e05ad,null))['then'](function(_0x59cef0){if(_0x59cef0){_0x18bbf7=_0x59cef0;_0x4228aa['model']=_[_0xdf6f('0x49')](db['WhatsappApplication'][_0xdf6f('0x45')]);_0x4228aa[_0xdf6f('0x48')]=_[_0xdf6f('0x49')](_0x5cf3b1[_0xdf6f('0x48')]);_0x4228aa[_0xdf6f('0x4a')]=_[_0xdf6f('0x4b')](_0x4228aa[_0xdf6f('0x47')],_0x4228aa[_0xdf6f('0x48')]);_0x3b1935[_0xdf6f('0x4c')]=_[_0xdf6f('0x4b')](_0x4228aa[_0xdf6f('0x47')],qs[_0xdf6f('0x4d')](_0x5cf3b1['query'][_0xdf6f('0x4d')]));_0x3b1935[_0xdf6f('0x4c')]=_0x3b1935[_0xdf6f('0x4c')][_0xdf6f('0x4e')]?_0x3b1935[_0xdf6f('0x4c')]:_0x4228aa[_0xdf6f('0x47')];_0x3b1935['order']=qs[_0xdf6f('0x51')](_0x5cf3b1[_0xdf6f('0x48')][_0xdf6f('0x51')]);_0x3b1935[_0xdf6f('0x52')]=qs[_0xdf6f('0x4a')](_[_0xdf6f('0x53')](_0x5cf3b1[_0xdf6f('0x48')],_0x4228aa[_0xdf6f('0x4a')]));if(_0x5cf3b1['query'][_0xdf6f('0x54')]){_0x3b1935[_0xdf6f('0x52')]=_[_0xdf6f('0x55')](_0x3b1935[_0xdf6f('0x52')],{'$or':_[_0xdf6f('0x43')](_0x3b1935['attributes'],function(_0x3626a7){var _0x155dfc={};_0x155dfc[_0x3626a7]={'$like':'%'+_0x5cf3b1['query'][_0xdf6f('0x54')]+'%'};return _0x155dfc;})});}_0x3b1935=_[_0xdf6f('0x55')]({},_0x3b1935,_0x5cf3b1['options']);return _0x18bbf7[_0xdf6f('0x82')](_0x3b1935);}})[_0xdf6f('0x25')](function(_0x1a5d52){if(_0x1a5d52){_0x2a4c41=_0x1a5d52[_0xdf6f('0x4e')];if(!_0x5cf3b1[_0xdf6f('0x48')][_0xdf6f('0x6a')]('nolimit')){_0x3b1935[_0xdf6f('0x32')]=qs[_0xdf6f('0x32')](_0x5cf3b1[_0xdf6f('0x48')][_0xdf6f('0x32')]);_0x3b1935['offset']=qs['offset'](_0x5cf3b1['query'][_0xdf6f('0x34')]);}return _0x18bbf7['getApplications'](_0x3b1935);}})[_0xdf6f('0x25')](function(_0x3fb139){if(_0x3fb139){return _0x3fb139?{'count':_0x2a4c41,'rows':_0x3fb139}:null;}})[_0xdf6f('0x25')](respondWithResult(_0x1e05ad,null))[_0xdf6f('0x2e')](handleError(_0x1e05ad,null));};exports[_0xdf6f('0x83')]=function(_0x49b752,_0x29459b,_0x439fc9){var _0x117644={'channel':_0xdf6f('0x84')};var _0x12e70f=[];var _0x108134=[];var _0x485df7={};return db[_0xdf6f('0x44')][_0xdf6f('0x5e')]({'where':{'id':_0x49b752['params']['id']},'include':[{'model':db[_0xdf6f('0x7f')],'as':_0xdf6f('0x85')}]})[_0xdf6f('0x25')](handleEntityNotFound(_0x29459b,null))[_0xdf6f('0x25')](function(_0x5a27ab){_0x117644[_0xdf6f('0x86')]=_0x5a27ab;_0x117644[_0xdf6f('0x87')]=_['orderBy'](_0x5a27ab[_0xdf6f('0x85')],[_0xdf6f('0x88')],[_0xdf6f('0x89')]);if(_0x117644[_0xdf6f('0x86')]['Applications']){delete _0x117644['account']['Applications'];}return db[_0xdf6f('0x8a')]['describe']();})[_0xdf6f('0x25')](function(_0x30ae92){if(!_0x30ae92){throw new db[(_0xdf6f('0x8b'))][(_0xdf6f('0x8c'))](_0xdf6f('0x8d'));}_0x12e70f=_[_0xdf6f('0x8e')](_[_0xdf6f('0x49')](_0x30ae92),[_0xdf6f('0x8f'),'updatedAt']);_0x108134=_[_0xdf6f('0x8e')](_['keys'](_0x30ae92),[_0xdf6f('0x8f'),'updatedAt',_0xdf6f('0x90'),_0xdf6f('0x91')]);_0x117644[_0xdf6f('0x60')]={'mapKey':'mobile'};if(_0x117644[_0xdf6f('0x86')][_0xdf6f('0x92')]&&_0x117644['account']['type']===_0xdf6f('0x93')){_0x117644[_0xdf6f('0x60')][_0xdf6f('0x94')]=_0x49b752[_0xdf6f('0x60')][_0xdf6f('0x95')][_0xdf6f('0x96')](_0xdf6f('0x97'),'');_0x117644['body']['body']=_0x49b752[_0xdf6f('0x60')]['Body'];_0x117644[_0xdf6f('0x60')][_0xdf6f('0x98')]=_0x49b752[_0xdf6f('0x60')][_0xdf6f('0x99')];}if(_0x117644[_0xdf6f('0x60')]['id']){delete _0x117644[_0xdf6f('0x60')]['id'];}if(_[_0xdf6f('0x9a')](_0x117644[_0xdf6f('0x60')]['from'])){throw new db['Sequelize'][(_0xdf6f('0x8c'))]('from\x20is\x20mandatory');}if(_[_0xdf6f('0x9a')](_0x117644['body'][_0xdf6f('0x60')])||_0x117644[_0xdf6f('0x60')]['body']===''){throw new db[(_0xdf6f('0x8b'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xdf6f('0x9a')](_0x117644['body'][_0xdf6f('0x9b')])){throw new db[(_0xdf6f('0x8b'))]['ValidationError'](_0xdf6f('0x9c')+_0x108134);}if(!_['includes'](_0x108134,_0x117644['body'][_0xdf6f('0x9b')])){throw new db[(_0xdf6f('0x8b'))][(_0xdf6f('0x8c'))](_0xdf6f('0x9d')+_0x108134);}_0x485df7[_0x117644['body'][_0xdf6f('0x9b')]]=_0x117644['body'][_0xdf6f('0x94')];return db['CmList'][_0xdf6f('0x5e')]({'where':{'id':_0x117644[_0xdf6f('0x86')]['ListId']},'include':[{'model':db[_0xdf6f('0x8a')],'as':_0xdf6f('0x9e'),'where':_0x485df7,'limit':0x1,'order':[[_0xdf6f('0x9f'),'DESC']]}]});})[_0xdf6f('0x25')](handleEntityNotFound(_0x29459b,null))['then'](function(_0x5af09a){if(_0x5af09a){_0x117644[_0xdf6f('0xa0')]=_[_0xdf6f('0x74')](_0x5af09a,[_0xdf6f('0x9e')]);if(_0x5af09a[_0xdf6f('0x9e')][_0xdf6f('0x4e')]){return _0x5af09a[_0xdf6f('0x9e')][0x0];}var _0x14fdae=_[_0xdf6f('0xa1')](_0x117644[_0xdf6f('0x60')],{'firstName':_0x117644['body'][_0xdf6f('0x94')],'ListId':_0x5af09a['id']});_0x14fdae[_0x117644['body'][_0xdf6f('0x9b')]]=_0x117644[_0xdf6f('0x60')][_0xdf6f('0x94')];return db[_0xdf6f('0x8a')][_0xdf6f('0x5f')](_0x14fdae,{'fields':_0x12e70f,'raw':!![]});}})[_0xdf6f('0x25')](handleEntityNotFound(_0x29459b,null))[_0xdf6f('0x25')](function(_0x7ca9a1){if(_0x7ca9a1){_0x117644['contact']=_0x7ca9a1;var _0x577d2e={'ContactId':_0x7ca9a1['id'],'phone':_0x117644[_0xdf6f('0x60')][_0xdf6f('0x94')],'WhatsappAccountId':_0x49b752[_0xdf6f('0x5b')]['id']};var _0x55a336={'ContactId':_0x7ca9a1['id'],'WhatsappAccountId':_0x49b752['params']['id'],'closed':![]};return db['WhatsappInteraction'][_0xdf6f('0x5e')]({'where':_0x55a336})[_0xdf6f('0x25')](function(_0x195b66){if(_0x195b66){return[_0x195b66,![]];}return db['WhatsappInteraction'][_0xdf6f('0x5f')](_0x577d2e)['then'](function(_0x41d7e7){return[_0x41d7e7,!![]];});});}})[_0xdf6f('0x75')](function(_0x452b38,_0x425e08){_0x117644[_0xdf6f('0xa2')]=_0x452b38[_0xdf6f('0x3a')]({'plain':!![]});_0x117644[_0xdf6f('0xa2')]['created']=![];if(_0x425e08){if(_0x117644['account'][_0xdf6f('0xa3')]){_0x117644[_0xdf6f('0x87')][_0xdf6f('0xa4')]({'id':0x0,'priority':_0x117644[_0xdf6f('0x87')][_0xdf6f('0x4e')]+0x1,'app':'close','appdata':_0xdf6f('0xa5'),'interval':_0xdf6f('0xa6')});}_0x117644[_0xdf6f('0xa2')][_0xdf6f('0xa7')]=!![];}return db['WhatsappMessage'][_0xdf6f('0x5f')]({'phone':_0x117644[_0xdf6f('0x60')][_0xdf6f('0x94')],'messageId':_0x117644[_0xdf6f('0x60')]['messageId'],'body':_0x117644[_0xdf6f('0x60')][_0xdf6f('0x60')],'WhatsappAccountId':_0x49b752['params']['id'],'WhatsappInteractionId':_0x452b38['id'],'direction':'in','ContactId':_0x452b38['ContactId'],'AttachmentId':_0x117644[_0xdf6f('0x60')][_0xdf6f('0xa8')]});})[_0xdf6f('0x25')](function(_0x2dad88){_0x117644[_0xdf6f('0x2c')]=_0x2dad88;if(_0x117644[_0xdf6f('0xa2')][_0xdf6f('0xa9')]){return db[_0xdf6f('0x7c')]['find']({'attributes':['id',_0xdf6f('0x3f')],'where':{'id':_0x117644[_0xdf6f('0xa2')][_0xdf6f('0xa9')]}})['then'](function(_0x5ca3ae){if(_0x5ca3ae){_0x117644['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xdf6f('0xaa'),'appdata':_0x5ca3ae[_0xdf6f('0x3f')]+','+(_0x117644[_0xdf6f('0x86')][_0xdf6f('0xab')]||0xa),'interval':_0xdf6f('0xa6')});}return respondWithRpcPromise('Start','startRouting',_0x117644);});}return respondWithRpcPromise(_0xdf6f('0xac'),_0xdf6f('0xad'),_0x117644);})[_0xdf6f('0x25')](function(_0x480c66){if(_0x480c66){var _0x1aa34b=0xc8;var _0x154678=_0xdf6f('0xae');logger[_0xdf6f('0x2d')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x154678,_0x1aa34b,_0xdf6f('0xaf'));logger[_0xdf6f('0x28')](_0xdf6f('0xb0'),_0x154678,_0x1aa34b,'entity\x20found',JSON['stringify'](_0x480c66));if(_0x117644[_0xdf6f('0x86')][_0xdf6f('0x92')]==='twilio'){return _0x29459b[_0xdf6f('0x31')](_0x1aa34b)[_0xdf6f('0x35')](_0xdf6f('0xb1'),_0xdf6f('0xb2'))[_0xdf6f('0x40')](_0xdf6f('0xb3'));}else{return _0x29459b['status'](_0x1aa34b)[_0xdf6f('0x36')](_0x480c66);}}})[_0xdf6f('0x2e')](handleError(_0x29459b,null));};exports[_0xdf6f('0x40')]=function(_0x43acbd,_0x4c70b4,_0x561c2b){var _0x5664f6,_0xde5f98,_0x2c1491;if(_['isNil'](_0x43acbd[_0xdf6f('0x60')][_0xdf6f('0x60')])||_0x43acbd[_0xdf6f('0x60')]['body']===''){throw new db[(_0xdf6f('0x8b'))][(_0xdf6f('0x8c'))](_0xdf6f('0xb4'));}if(_['isNil'](_0x43acbd[_0xdf6f('0x60')]['to'])){throw new db[(_0xdf6f('0x8b'))]['ValidationError']('to\x20is\x20mandatory');}_0x5664f6=_0x43acbd[_0xdf6f('0x60')]['to'];return db[_0xdf6f('0x44')][_0xdf6f('0x5e')]({'where':{'id':_0x43acbd[_0xdf6f('0x5b')]['id']},'include':[{'model':db[_0xdf6f('0xb5')],'as':_0xdf6f('0xb6'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x5664f6},'limit':0x1,'order':[[_0xdf6f('0x9f'),_0xdf6f('0xb7')]]}]}]})[_0xdf6f('0x25')](handleEntityNotFound(_0x4c70b4,null))[_0xdf6f('0x25')](function(_0xff2c02){if(_0xff2c02&&_0xff2c02[_0xdf6f('0xb6')]){_0xde5f98=_0xff2c02[_0xdf6f('0x3a')]({'plain':!![]});if(_0xde5f98[_0xdf6f('0xb6')]&&_0xde5f98[_0xdf6f('0xb6')][_0xdf6f('0x9e')][_0xdf6f('0x4e')]){return _0xde5f98[_0xdf6f('0xb6')][_0xdf6f('0x9e')][0x0];}return db[_0xdf6f('0x8a')]['create'](_[_0xdf6f('0xa1')](_0x43acbd[_0xdf6f('0x60')],{'firstName':_0x5664f6,'mobile':_0x5664f6,'phone':_0x5664f6,'ListId':_0xde5f98[_0xdf6f('0x91')]}));}})[_0xdf6f('0x25')](handleEntityNotFound(_0x4c70b4,null))[_0xdf6f('0x25')](function(_0x34c58b){if(_0x34c58b){_0x2c1491=_0x34c58b;return db[_0xdf6f('0xb8')][_0xdf6f('0x5e')]({'where':{'ContactId':_0x2c1491['id'],'closed':![],'WhatsappAccountId':_0xde5f98['id']}})[_0xdf6f('0x25')](function(_0x19eb0a){if(_0x19eb0a){return[_0x19eb0a,![]];}return db[_0xdf6f('0xb8')]['create']({'UserId':_0x43acbd[_0xdf6f('0x61')]['id'],'ContactId':_0x2c1491['id'],'WhatsappAccountId':_0xde5f98['id'],'phone':_0x5664f6,'firstMsgDirection':_0xdf6f('0xb9'),'Messages':[_['merge'](_0x43acbd['body'],{'read':![],'body':_0x43acbd[_0xdf6f('0x60')][_0xdf6f('0x60')],'phone':_0x5664f6,'WhatsappAccountId':_0xde5f98['id'],'UserId':_0x43acbd[_0xdf6f('0x61')]['id'],'ContactId':_0x2c1491['id']})]},{'include':[{'model':db[_0xdf6f('0xba')],'as':_0xdf6f('0xbb')}]})[_0xdf6f('0x25')](function(_0x2133cb){return[_0x2133cb,!![]];});});}})['spread'](function(_0x2907f0,_0x54d8e6){if(_0x54d8e6){return _0x2907f0;}return db[_0xdf6f('0xba')][_0xdf6f('0x5f')](_[_0xdf6f('0x55')](_0x43acbd['body'],{'read':![],'body':_0x43acbd[_0xdf6f('0x60')][_0xdf6f('0x60')],'phone':_0x5664f6,'WhatsappAccountId':_0xde5f98['id'],'WhatsappInteractionId':_0x2907f0['id'],'UserId':_0x43acbd[_0xdf6f('0x61')]['id'],'ContactId':_0x2c1491['id']}))['then'](function(_0x2d320a){_0x2907f0['dataValues'][_0xdf6f('0xbb')]=[];_0x2907f0['dataValues'][_0xdf6f('0xbb')][_0xdf6f('0xa4')](_0x2d320a['dataValues']);return _0x2907f0;});})[_0xdf6f('0x25')](respondWithResult(_0x4c70b4,null))[_0xdf6f('0x2e')](handleError(_0x4c70b4,null));}; \ No newline at end of file +var _0xb2d9=['userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','WhatsappApplication','findAndCountAll','priority','getApplications','notify','whatsapp','applications','orderBy','Applications','asc','account','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','replace','Body','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','close','unmanaged','*,*,*,*','messageId','ContactId','UserId','User','unshift','Start','startRouting','receiveMessage','entity\x20found','text/xml','send','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','List','DESC','out','WhatsappMessage','dataValues','Messages','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','client','http','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','get','UserProfileResource','name','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','Pause','keys','options','create','body','user','WhatsappAccounts','UserProfileSection','find','userProfileId','autoAssociation','WhatsappAccountId','getDispositions','findOne','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','omit','spread','emit'];(function(_0xe6e78c,_0x582369){var _0x2a09c8=function(_0x470ccc){while(--_0x470ccc){_0xe6e78c['push'](_0xe6e78c['shift']());}};_0x2a09c8(++_0x582369);}(_0xb2d9,0x1a6));var _0x9b2d=function(_0x142a0d,_0x2c6d2c){_0x142a0d=_0x142a0d-0x0;var _0x320232=_0xb2d9[_0x142a0d];return _0x320232;};'use strict';var emlformat=require(_0x9b2d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9b2d('0x1'));var rp=require(_0x9b2d('0x2'));var moment=require(_0x9b2d('0x3'));var BPromise=require(_0x9b2d('0x4'));var Mustache=require(_0x9b2d('0x5'));var util=require('util');var path=require(_0x9b2d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9b2d('0x7'));var fs=require('fs');var fs_extra=require(_0x9b2d('0x8'));var _=require(_0x9b2d('0x9'));var squel=require(_0x9b2d('0xa'));var crypto=require(_0x9b2d('0xb'));var jsforce=require(_0x9b2d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9b2d('0xd'));var querystring=require('querystring');var Papa=require(_0x9b2d('0xe'));var Redis=require(_0x9b2d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9b2d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b2d('0x11'));var logger=require(_0x9b2d('0x12'))('api');var utils=require(_0x9b2d('0x13'));var config=require(_0x9b2d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9b2d('0x15'))['db'];config['redis']=_['defaults'](config[_0x9b2d('0x16')],{'host':_0x9b2d('0x17'),'port':0x18eb});var socket=require(_0x9b2d('0x18'))(new Redis(config[_0x9b2d('0x16')]));require(_0x9b2d('0x19'))[_0x9b2d('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9b2d('0x1b')][_0x9b2d('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x24c825,_0x3f28c3,_0x1b860f,_0x50aa63){return new BPromise(function(_0x59920d,_0xda2e04){var _0x422944=_0x50aa63||client;return _0x422944[_0x9b2d('0x1d')](_0x24c825,_0x1b860f)[_0x9b2d('0x1e')](function(_0x5f5136){logger['info'](_0x9b2d('0x1f'),_0x3f28c3,_0x9b2d('0x20'));logger['debug'](_0x9b2d('0x21'),_0x3f28c3,_0x9b2d('0x20'),JSON[_0x9b2d('0x22')](_0x5f5136));if(_0x5f5136[_0x9b2d('0x23')]){if(_0x5f5136[_0x9b2d('0x23')][_0x9b2d('0x24')]===0x1f4){logger[_0x9b2d('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x3f28c3,_0x5f5136[_0x9b2d('0x23')][_0x9b2d('0x25')]);return _0xda2e04(_0x5f5136[_0x9b2d('0x23')][_0x9b2d('0x25')]);}logger[_0x9b2d('0x23')](_0x9b2d('0x1f'),_0x3f28c3,_0x5f5136[_0x9b2d('0x23')][_0x9b2d('0x25')]);return _0x59920d(_0x5f5136['error'][_0x9b2d('0x25')]);}else{logger[_0x9b2d('0x26')](_0x9b2d('0x1f'),_0x3f28c3,_0x9b2d('0x20'));_0x59920d(_0x5f5136[_0x9b2d('0x27')][_0x9b2d('0x25')]);}})[_0x9b2d('0x28')](function(_0x205e9a){logger[_0x9b2d('0x23')](_0x9b2d('0x1f'),_0x3f28c3,_0x205e9a);_0xda2e04(_0x205e9a);});});}function respondWithStatusCode(_0x53bf49,_0x5e9a5c){_0x5e9a5c=_0x5e9a5c||0xcc;return function(_0x45e70f){if(_0x45e70f){return _0x53bf49[_0x9b2d('0x29')](_0x5e9a5c);}return _0x53bf49['status'](_0x5e9a5c)[_0x9b2d('0x2a')]();};}function respondWithResult(_0x23a602,_0x1eede3){_0x1eede3=_0x1eede3||0xc8;return function(_0x5d95d4){if(_0x5d95d4){return _0x23a602[_0x9b2d('0x2b')](_0x1eede3)[_0x9b2d('0x2c')](_0x5d95d4);}};}function respondWithFilteredResult(_0x36bb6e,_0x5e13b8){return function(_0x48fcf2){if(_0x48fcf2){var _0x419f0d=typeof _0x5e13b8[_0x9b2d('0x2d')]==='undefined'&&typeof _0x5e13b8[_0x9b2d('0x2e')]===_0x9b2d('0x2f');var _0x498261=_0x48fcf2[_0x9b2d('0x30')];var _0x5147ef=_0x419f0d?0x0:_0x5e13b8[_0x9b2d('0x2d')];var _0x5e3a17=_0x419f0d?_0x48fcf2[_0x9b2d('0x30')]:_0x5e13b8[_0x9b2d('0x2d')]+_0x5e13b8['limit'];var _0x2701d7;if(_0x5e3a17>=_0x498261){_0x5e3a17=_0x498261;_0x2701d7=0xc8;}else{_0x2701d7=0xce;}_0x36bb6e[_0x9b2d('0x2b')](_0x2701d7);return _0x36bb6e[_0x9b2d('0x31')](_0x9b2d('0x32'),_0x5147ef+'-'+_0x5e3a17+'/'+_0x498261)[_0x9b2d('0x2c')](_0x48fcf2);}return null;};}function patchUpdates(_0x4a727c){return function(_0xf68aea){try{jsonpatch[_0x9b2d('0x33')](_0xf68aea,_0x4a727c,!![]);}catch(_0x10d179){return BPromise['reject'](_0x10d179);}return _0xf68aea['save']();};}function saveUpdates(_0xa8f962,_0x4b861d){return function(_0x193b58){if(_0x193b58){return _0x193b58[_0x9b2d('0x34')](_0xa8f962)[_0x9b2d('0x1e')](function(_0x3636c7){return _0x3636c7;});}return null;};}function removeEntity(_0x837c5a,_0x228fbe){return function(_0x2de7be){if(_0x2de7be){return _0x2de7be[_0x9b2d('0x35')]()['then'](function(){var _0x11a7e7=_0x2de7be[_0x9b2d('0x36')]({'plain':!![]});var _0x21965d='WhatsappAccounts';return db[_0x9b2d('0x37')]['destroy']({'where':{'type':_0x21965d,'resourceId':_0x11a7e7['id']}})['then'](function(){return _0x2de7be;});})[_0x9b2d('0x1e')](function(){_0x837c5a[_0x9b2d('0x2b')](0xcc)[_0x9b2d('0x2a')]();});}};}function handleEntityNotFound(_0x1a1e88,_0x5d2fa1){return function(_0x351d5b){if(!_0x351d5b){_0x1a1e88[_0x9b2d('0x29')](0x194);}return _0x351d5b;};}function handleError(_0x1db054,_0x5ee46a){_0x5ee46a=_0x5ee46a||0x1f4;return function(_0x19fa6d){logger[_0x9b2d('0x23')](_0x19fa6d['stack']);if(_0x19fa6d[_0x9b2d('0x38')]){delete _0x19fa6d[_0x9b2d('0x38')];}_0x1db054['status'](_0x5ee46a)['send'](_0x19fa6d);};}exports['index']=function(_0x1a283d,_0xc9294f){var _0x583a0b={'include':[{'model':db['Pause'],'as':_0x9b2d('0x39')}]},_0x3dfb57={},_0x1e98f8={'count':0x0,'rows':[]};var _0x2fc4c0=_[_0x9b2d('0x3a')](db[_0x9b2d('0x3b')][_0x9b2d('0x3c')],function(_0x29f089){return{'name':_0x29f089[_0x9b2d('0x3d')],'type':_0x29f089['type'][_0x9b2d('0x3e')]};});_0x3dfb57[_0x9b2d('0x3f')]=_[_0x9b2d('0x3a')](_0x2fc4c0,_0x9b2d('0x38'));_0x3dfb57[_0x9b2d('0x40')]=_['keys'](_0x1a283d[_0x9b2d('0x40')]);_0x3dfb57[_0x9b2d('0x41')]=_[_0x9b2d('0x42')](_0x3dfb57['model'],_0x3dfb57['query']);_0x583a0b[_0x9b2d('0x43')]=_[_0x9b2d('0x42')](_0x3dfb57[_0x9b2d('0x3f')],qs[_0x9b2d('0x44')](_0x1a283d[_0x9b2d('0x40')][_0x9b2d('0x44')]));_0x583a0b[_0x9b2d('0x43')]=_0x583a0b[_0x9b2d('0x43')][_0x9b2d('0x45')]?_0x583a0b['attributes']:_0x3dfb57[_0x9b2d('0x3f')];if(!_0x1a283d[_0x9b2d('0x40')][_0x9b2d('0x46')](_0x9b2d('0x47'))){_0x583a0b[_0x9b2d('0x2e')]=qs[_0x9b2d('0x2e')](_0x1a283d['query'][_0x9b2d('0x2e')]);_0x583a0b[_0x9b2d('0x2d')]=qs[_0x9b2d('0x2d')](_0x1a283d['query'][_0x9b2d('0x2d')]);}_0x583a0b[_0x9b2d('0x48')]=qs[_0x9b2d('0x49')](_0x1a283d['query'][_0x9b2d('0x49')]);_0x583a0b[_0x9b2d('0x4a')]=qs['filters'](_[_0x9b2d('0x4b')](_0x1a283d[_0x9b2d('0x40')],_0x3dfb57[_0x9b2d('0x41')]),_0x2fc4c0);if(_0x1a283d[_0x9b2d('0x40')][_0x9b2d('0x4c')]){_0x583a0b[_0x9b2d('0x4a')]=_[_0x9b2d('0x4d')](_0x583a0b[_0x9b2d('0x4a')],{'$or':_[_0x9b2d('0x3a')](_0x2fc4c0,function(_0x40b7f8){if(_0x40b7f8[_0x9b2d('0x4e')]!==_0x9b2d('0x4f')){var _0xb7a856={};_0xb7a856[_0x40b7f8['name']]={'$like':'%'+_0x1a283d[_0x9b2d('0x40')][_0x9b2d('0x4c')]+'%'};return _0xb7a856;}})});}_0x583a0b=_['merge']({},_0x583a0b,_0x1a283d['options']);var _0x169993={'where':_0x583a0b[_0x9b2d('0x4a')]};return db[_0x9b2d('0x3b')][_0x9b2d('0x30')](_0x169993)[_0x9b2d('0x1e')](function(_0xd94124){_0x1e98f8[_0x9b2d('0x30')]=_0xd94124;if(_0x1a283d['query'][_0x9b2d('0x50')]){_0x583a0b[_0x9b2d('0x51')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x9b2d('0x52')](_0x583a0b);})[_0x9b2d('0x1e')](function(_0x179c7f){_0x1e98f8[_0x9b2d('0x53')]=_0x179c7f;return _0x1e98f8;})[_0x9b2d('0x1e')](respondWithFilteredResult(_0xc9294f,_0x583a0b))['catch'](handleError(_0xc9294f,null));};exports['show']=function(_0x40bb7c,_0xcb6a68){var _0xe2aa05={'raw':![],'where':{'id':_0x40bb7c[_0x9b2d('0x54')]['id']},'include':[{'model':db[_0x9b2d('0x55')],'as':_0x9b2d('0x39')}]},_0x2cf401={};_0x2cf401[_0x9b2d('0x3f')]=_[_0x9b2d('0x56')](db[_0x9b2d('0x3b')][_0x9b2d('0x3c')]);_0x2cf401[_0x9b2d('0x40')]=_['keys'](_0x40bb7c[_0x9b2d('0x40')]);_0x2cf401[_0x9b2d('0x41')]=_['intersection'](_0x2cf401[_0x9b2d('0x3f')],_0x2cf401[_0x9b2d('0x40')]);_0xe2aa05[_0x9b2d('0x43')]=_[_0x9b2d('0x42')](_0x2cf401[_0x9b2d('0x3f')],qs[_0x9b2d('0x44')](_0x40bb7c[_0x9b2d('0x40')][_0x9b2d('0x44')]));_0xe2aa05[_0x9b2d('0x43')]=_0xe2aa05['attributes'][_0x9b2d('0x45')]?_0xe2aa05[_0x9b2d('0x43')]:_0x2cf401[_0x9b2d('0x3f')];if(_0x40bb7c[_0x9b2d('0x40')]['includeAll']){_0xe2aa05['include']=[{'all':!![]}];}_0xe2aa05=_[_0x9b2d('0x4d')]({},_0xe2aa05,_0x40bb7c[_0x9b2d('0x57')]);return db[_0x9b2d('0x3b')]['find'](_0xe2aa05)[_0x9b2d('0x1e')](handleEntityNotFound(_0xcb6a68,null))['then'](respondWithResult(_0xcb6a68,null))[_0x9b2d('0x28')](handleError(_0xcb6a68,null));};exports[_0x9b2d('0x58')]=function(_0x24fbd5,_0x3a16f3){return db[_0x9b2d('0x3b')]['create'](_0x24fbd5[_0x9b2d('0x59')],{})['then'](function(_0x17a246){var _0x3f846d=_0x24fbd5[_0x9b2d('0x5a')][_0x9b2d('0x36')]({'plain':!![]});if(!_0x3f846d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f846d['role']==='user'){var _0x217278=_0x17a246[_0x9b2d('0x36')]({'plain':!![]});var _0x7b5dba=_0x9b2d('0x5b');return db[_0x9b2d('0x5c')][_0x9b2d('0x5d')]({'where':{'name':_0x7b5dba,'userProfileId':_0x3f846d[_0x9b2d('0x5e')]},'raw':!![]})[_0x9b2d('0x1e')](function(_0x487425){if(_0x487425&&_0x487425[_0x9b2d('0x5f')]===0x0){return db[_0x9b2d('0x37')][_0x9b2d('0x58')]({'name':_0x217278[_0x9b2d('0x38')],'resourceId':_0x217278['id'],'type':_0x487425[_0x9b2d('0x38')],'sectionId':_0x487425['id']},{})[_0x9b2d('0x1e')](function(){return _0x17a246;});}else{return _0x17a246;}})['catch'](function(_0x1a5283){logger[_0x9b2d('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a5283);throw _0x1a5283;});}return _0x17a246;})[_0x9b2d('0x1e')](respondWithResult(_0x3a16f3,0xc9))[_0x9b2d('0x28')](handleError(_0x3a16f3,null));};exports[_0x9b2d('0x34')]=function(_0x49431e,_0x13db97){if(_0x49431e[_0x9b2d('0x59')]['id']){delete _0x49431e[_0x9b2d('0x59')]['id'];}return db['WhatsappAccount'][_0x9b2d('0x5d')]({'where':{'id':_0x49431e[_0x9b2d('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x9b2d('0x39')}]})['then'](handleEntityNotFound(_0x13db97,null))[_0x9b2d('0x1e')](saveUpdates(_0x49431e[_0x9b2d('0x59')],null))[_0x9b2d('0x1e')](respondWithResult(_0x13db97,null))['catch'](handleError(_0x13db97,null));};exports['destroy']=function(_0x1c78db,_0xf0b2dd){return db[_0x9b2d('0x3b')][_0x9b2d('0x5d')]({'where':{'id':_0x1c78db['params']['id']}})[_0x9b2d('0x1e')](handleEntityNotFound(_0xf0b2dd,null))[_0x9b2d('0x1e')](removeEntity(_0xf0b2dd,null))[_0x9b2d('0x28')](handleError(_0xf0b2dd,null));};exports['describe']=function(_0x2fdf09,_0x1ec868){return db['WhatsappAccount']['describe']()[_0x9b2d('0x1e')](respondWithResult(_0x1ec868,null))[_0x9b2d('0x28')](handleError(_0x1ec868,null));};exports['addDisposition']=function(_0x5ce3e5,_0x498320,_0x5e27d4){if(_0x5ce3e5['body']['id']){delete _0x5ce3e5[_0x9b2d('0x59')]['id'];}return db['WhatsappAccount'][_0x9b2d('0x5d')]({'where':{'id':_0x5ce3e5['params']['id']}})[_0x9b2d('0x1e')](handleEntityNotFound(_0x498320,null))[_0x9b2d('0x1e')](function(_0x52a536){if(_0x52a536){_0x5ce3e5[_0x9b2d('0x59')][_0x9b2d('0x60')]=_0x52a536['id'];return db['Disposition'][_0x9b2d('0x58')](_0x5ce3e5[_0x9b2d('0x59')]);}})[_0x9b2d('0x1e')](respondWithResult(_0x498320,null))[_0x9b2d('0x28')](handleError(_0x498320,null));};exports[_0x9b2d('0x61')]=function(_0x1eb973,_0x41c51d,_0x89d482){var _0x5f4b12={'raw':![],'where':{}};var _0x3cf019={};var _0x5c31f7={'count':0x0,'rows':[]};return db[_0x9b2d('0x3b')][_0x9b2d('0x62')]({'where':{'id':_0x1eb973['params']['id']}})['then'](handleEntityNotFound(_0x41c51d,null))[_0x9b2d('0x1e')](function(_0x2b389a){if(_0x2b389a){_0x3cf019[_0x9b2d('0x3f')]=_['keys'](db[_0x9b2d('0x63')][_0x9b2d('0x3c')]);_0x3cf019[_0x9b2d('0x40')]=_[_0x9b2d('0x56')](_0x1eb973[_0x9b2d('0x40')]);_0x3cf019[_0x9b2d('0x41')]=_[_0x9b2d('0x42')](_0x3cf019[_0x9b2d('0x3f')],_0x3cf019[_0x9b2d('0x40')]);_0x5f4b12['attributes']=_[_0x9b2d('0x42')](_0x3cf019['model'],qs['fields'](_0x1eb973[_0x9b2d('0x40')][_0x9b2d('0x44')]));_0x5f4b12[_0x9b2d('0x43')]=_0x5f4b12[_0x9b2d('0x43')][_0x9b2d('0x45')]?_0x5f4b12[_0x9b2d('0x43')]:_0x3cf019[_0x9b2d('0x3f')];if(!_0x1eb973['query'][_0x9b2d('0x46')](_0x9b2d('0x47'))){_0x5f4b12[_0x9b2d('0x2e')]=qs[_0x9b2d('0x2e')](_0x1eb973['query'][_0x9b2d('0x2e')]);_0x5f4b12[_0x9b2d('0x2d')]=qs[_0x9b2d('0x2d')](_0x1eb973['query']['offset']);}_0x5f4b12[_0x9b2d('0x48')]=qs['sort'](_0x1eb973[_0x9b2d('0x40')][_0x9b2d('0x49')]);_0x5f4b12['where']=qs[_0x9b2d('0x41')](_['pick'](_0x1eb973[_0x9b2d('0x40')],_0x3cf019['filters']));_0x5f4b12[_0x9b2d('0x4a')][_0x9b2d('0x60')]=_0x2b389a['id'];if(_0x1eb973['query'][_0x9b2d('0x4c')]){_0x5f4b12[_0x9b2d('0x4a')]=_[_0x9b2d('0x4d')](_0x5f4b12[_0x9b2d('0x4a')],{'$or':_[_0x9b2d('0x3a')](_0x5f4b12[_0x9b2d('0x43')],function(_0x1da7c7){var _0x1b5c19={};_0x1b5c19[_0x1da7c7]={'$like':'%'+_0x1eb973[_0x9b2d('0x40')][_0x9b2d('0x4c')]+'%'};return _0x1b5c19;})});}_0x5f4b12=_[_0x9b2d('0x4d')]({},_0x5f4b12,_0x1eb973[_0x9b2d('0x57')]);return db[_0x9b2d('0x63')][_0x9b2d('0x30')]({'where':_0x5f4b12[_0x9b2d('0x4a')]})[_0x9b2d('0x1e')](function(_0x3b0fcb){_0x5c31f7[_0x9b2d('0x30')]=_0x3b0fcb;if(_0x1eb973['query'][_0x9b2d('0x50')]){_0x5f4b12['include']=[{'all':!![]}];}return db[_0x9b2d('0x63')]['findAll'](_0x5f4b12);})[_0x9b2d('0x1e')](function(_0x5745a6){_0x5c31f7[_0x9b2d('0x53')]=_0x5745a6;return _0x5c31f7;});}})[_0x9b2d('0x1e')](respondWithFilteredResult(_0x41c51d,_0x5f4b12))['catch'](handleError(_0x41c51d,null));};exports[_0x9b2d('0x64')]=function(_0x5d6954,_0x3faea4,_0x50707b){return db[_0x9b2d('0x3b')][_0x9b2d('0x5d')]({'where':{'id':_0x5d6954[_0x9b2d('0x54')]['id']}})[_0x9b2d('0x1e')](handleEntityNotFound(_0x3faea4,null))['then'](function(_0x11c203){if(_0x11c203){return _0x11c203[_0x9b2d('0x64')](_0x5d6954[_0x9b2d('0x40')]['ids']);}})['then'](respondWithStatusCode(_0x3faea4,null))[_0x9b2d('0x28')](handleError(_0x3faea4,null));};exports[_0x9b2d('0x65')]=function(_0x51d645,_0x581388,_0x55397c){if(_0x51d645['body']['id']){delete _0x51d645[_0x9b2d('0x59')]['id'];}return db[_0x9b2d('0x3b')][_0x9b2d('0x5d')]({'where':{'id':_0x51d645[_0x9b2d('0x54')]['id']}})['then'](handleEntityNotFound(_0x581388,null))['then'](function(_0x3cd75e){if(_0x3cd75e){_0x51d645['body'][_0x9b2d('0x60')]=_0x3cd75e['id'];return db[_0x9b2d('0x66')][_0x9b2d('0x58')](_0x51d645[_0x9b2d('0x59')]);}})[_0x9b2d('0x1e')](respondWithResult(_0x581388,null))['catch'](handleError(_0x581388,null));};exports[_0x9b2d('0x67')]=function(_0x20e5c7,_0x7e869c,_0x58bd54){var _0x5a8e42={'raw':![],'where':{}};var _0x1ed686={};var _0x8777f8={'count':0x0,'rows':[]};return db[_0x9b2d('0x3b')][_0x9b2d('0x62')]({'where':{'id':_0x20e5c7[_0x9b2d('0x54')]['id']}})[_0x9b2d('0x1e')](handleEntityNotFound(_0x7e869c,null))['then'](function(_0x3874a7){if(_0x3874a7){_0x1ed686['model']=_['keys'](db['CannedAnswer'][_0x9b2d('0x3c')]);_0x1ed686['query']=_[_0x9b2d('0x56')](_0x20e5c7[_0x9b2d('0x40')]);_0x1ed686[_0x9b2d('0x41')]=_[_0x9b2d('0x42')](_0x1ed686[_0x9b2d('0x3f')],_0x1ed686[_0x9b2d('0x40')]);_0x5a8e42[_0x9b2d('0x43')]=_[_0x9b2d('0x42')](_0x1ed686[_0x9b2d('0x3f')],qs[_0x9b2d('0x44')](_0x20e5c7[_0x9b2d('0x40')][_0x9b2d('0x44')]));_0x5a8e42[_0x9b2d('0x43')]=_0x5a8e42['attributes'][_0x9b2d('0x45')]?_0x5a8e42[_0x9b2d('0x43')]:_0x1ed686['model'];if(!_0x20e5c7['query'][_0x9b2d('0x46')](_0x9b2d('0x47'))){_0x5a8e42[_0x9b2d('0x2e')]=qs[_0x9b2d('0x2e')](_0x20e5c7[_0x9b2d('0x40')][_0x9b2d('0x2e')]);_0x5a8e42[_0x9b2d('0x2d')]=qs[_0x9b2d('0x2d')](_0x20e5c7[_0x9b2d('0x40')]['offset']);}_0x5a8e42[_0x9b2d('0x48')]=qs[_0x9b2d('0x49')](_0x20e5c7[_0x9b2d('0x40')][_0x9b2d('0x49')]);_0x5a8e42[_0x9b2d('0x4a')]=qs[_0x9b2d('0x41')](_[_0x9b2d('0x4b')](_0x20e5c7[_0x9b2d('0x40')],_0x1ed686['filters']));_0x5a8e42['where'][_0x9b2d('0x60')]=_0x3874a7['id'];if(_0x20e5c7[_0x9b2d('0x40')][_0x9b2d('0x4c')]){_0x5a8e42[_0x9b2d('0x4a')]=_['merge'](_0x5a8e42[_0x9b2d('0x4a')],{'$or':_[_0x9b2d('0x3a')](_0x5a8e42[_0x9b2d('0x43')],function(_0xb301dc){var _0x3f2c18={};_0x3f2c18[_0xb301dc]={'$like':'%'+_0x20e5c7[_0x9b2d('0x40')][_0x9b2d('0x4c')]+'%'};return _0x3f2c18;})});}_0x5a8e42=_[_0x9b2d('0x4d')]({},_0x5a8e42,_0x20e5c7[_0x9b2d('0x57')]);return db['CannedAnswer'][_0x9b2d('0x30')]({'where':_0x5a8e42[_0x9b2d('0x4a')]})[_0x9b2d('0x1e')](function(_0x1ddb36){_0x8777f8[_0x9b2d('0x30')]=_0x1ddb36;if(_0x20e5c7['query'][_0x9b2d('0x50')]){_0x5a8e42[_0x9b2d('0x51')]=[{'all':!![]}];}return db[_0x9b2d('0x66')][_0x9b2d('0x52')](_0x5a8e42);})[_0x9b2d('0x1e')](function(_0x3ae9c3){_0x8777f8[_0x9b2d('0x53')]=_0x3ae9c3;return _0x8777f8;});}})[_0x9b2d('0x1e')](respondWithFilteredResult(_0x7e869c,_0x5a8e42))[_0x9b2d('0x28')](handleError(_0x7e869c,null));};exports[_0x9b2d('0x68')]=function(_0x928d10,_0x2634b1,_0x650079){return db[_0x9b2d('0x3b')]['find']({'where':{'id':_0x928d10[_0x9b2d('0x54')]['id']}})[_0x9b2d('0x1e')](handleEntityNotFound(_0x2634b1,null))['then'](function(_0x34c400){if(_0x34c400){return _0x34c400[_0x9b2d('0x68')](_0x928d10[_0x9b2d('0x40')][_0x9b2d('0x69')]);}})['then'](respondWithStatusCode(_0x2634b1,null))[_0x9b2d('0x28')](handleError(_0x2634b1,null));};exports['addAgents']=function(_0x5cce33,_0x90b171,_0x43a9f3){return db[_0x9b2d('0x3b')][_0x9b2d('0x5d')]({'where':{'id':_0x5cce33[_0x9b2d('0x54')]['id']}})['then'](handleEntityNotFound(_0x90b171,null))[_0x9b2d('0x1e')](function(_0x14025e){if(_0x14025e){return _0x14025e['addAgents'](_0x5cce33['body']['ids'],_[_0x9b2d('0x6a')](_0x5cce33[_0x9b2d('0x59')],['ids','id'])||{})[_0x9b2d('0x6b')](function(_0x9c1c9e){for(var _0xf719b6=0x0;_0xf719b6<_0x5cce33[_0x9b2d('0x59')][_0x9b2d('0x69')]['length'];_0xf719b6+=0x1){socket[_0x9b2d('0x6c')](_0x9b2d('0x6d'),{'UserId':Number(_0x5cce33['body']['ids'][_0xf719b6]),'WhatsappAccountId':Number(_0x5cce33[_0x9b2d('0x54')]['id'])});}return _0x9c1c9e;});}})['then'](respondWithResult(_0x90b171,null))['catch'](handleError(_0x90b171,null));};exports[_0x9b2d('0x6e')]=function(_0xcfa12d,_0x53383a,_0x4f566a){return db[_0x9b2d('0x3b')][_0x9b2d('0x5d')]({'where':{'id':_0xcfa12d[_0x9b2d('0x54')]['id']}})[_0x9b2d('0x1e')](handleEntityNotFound(_0x53383a,null))[_0x9b2d('0x1e')](function(_0x482799){if(_0x482799){return _0x482799[_0x9b2d('0x6e')](_0xcfa12d[_0x9b2d('0x40')][_0x9b2d('0x69')])[_0x9b2d('0x1e')](function(){if(_[_0x9b2d('0x6f')](_0xcfa12d[_0x9b2d('0x40')][_0x9b2d('0x69')])){for(var _0x29c4f7=0x0;_0x29c4f7<_0xcfa12d[_0x9b2d('0x40')][_0x9b2d('0x69')][_0x9b2d('0x45')];_0x29c4f7+=0x1){socket[_0x9b2d('0x6c')](_0x9b2d('0x70'),{'UserId':Number(_0xcfa12d[_0x9b2d('0x40')][_0x9b2d('0x69')][_0x29c4f7]),'WhatsappAccountId':Number(_0xcfa12d[_0x9b2d('0x54')]['id'])});}}else{socket[_0x9b2d('0x6c')]('userWhatsappAccount:remove',{'UserId':Number(_0xcfa12d['query']['ids']),'WhatsappAccountId':Number(_0xcfa12d[_0x9b2d('0x54')]['id'])});}});}})[_0x9b2d('0x1e')](respondWithStatusCode(_0x53383a,null))['catch'](handleError(_0x53383a,null));};exports[_0x9b2d('0x71')]=function(_0x17dedd,_0x56cfcc,_0x4d0116){var _0x2e00ae={};var _0x48517b={};var _0x7363ac;var _0x2a5ead;return db[_0x9b2d('0x3b')][_0x9b2d('0x62')]({'where':{'id':_0x17dedd[_0x9b2d('0x54')]['id']}})[_0x9b2d('0x1e')](handleEntityNotFound(_0x56cfcc,null))[_0x9b2d('0x1e')](function(_0x32d32f){if(_0x32d32f){_0x7363ac=_0x32d32f;_0x48517b['model']=_[_0x9b2d('0x56')](db['User'][_0x9b2d('0x3c')]);_0x48517b[_0x9b2d('0x40')]=_[_0x9b2d('0x56')](_0x17dedd[_0x9b2d('0x40')]);_0x48517b['filters']=_[_0x9b2d('0x42')](_0x48517b[_0x9b2d('0x3f')],_0x48517b['query']);_0x2e00ae[_0x9b2d('0x43')]=_[_0x9b2d('0x42')](_0x48517b['model'],qs['fields'](_0x17dedd['query'][_0x9b2d('0x44')]));_0x2e00ae[_0x9b2d('0x43')]=_0x2e00ae['attributes'][_0x9b2d('0x45')]?_0x2e00ae[_0x9b2d('0x43')]:_0x48517b['model'];_0x2e00ae[_0x9b2d('0x48')]=qs['sort'](_0x17dedd[_0x9b2d('0x40')][_0x9b2d('0x49')]);_0x2e00ae[_0x9b2d('0x4a')]=qs[_0x9b2d('0x41')](_[_0x9b2d('0x4b')](_0x17dedd[_0x9b2d('0x40')],_0x48517b[_0x9b2d('0x41')]));if(_0x17dedd[_0x9b2d('0x40')][_0x9b2d('0x4c')]){_0x2e00ae[_0x9b2d('0x4a')]=_[_0x9b2d('0x4d')](_0x2e00ae[_0x9b2d('0x4a')],{'$or':_[_0x9b2d('0x3a')](_0x2e00ae['attributes'],function(_0x419c41){var _0x5654e3={};_0x5654e3[_0x419c41]={'$like':'%'+_0x17dedd[_0x9b2d('0x40')]['filter']+'%'};return _0x5654e3;})});}_0x2e00ae=_[_0x9b2d('0x4d')]({},_0x2e00ae,_0x17dedd[_0x9b2d('0x57')]);return _0x7363ac[_0x9b2d('0x71')](_0x2e00ae);}})[_0x9b2d('0x1e')](function(_0x4300c2){if(_0x4300c2){_0x2a5ead=_0x4300c2['length'];if(!_0x17dedd[_0x9b2d('0x40')][_0x9b2d('0x46')](_0x9b2d('0x47'))){_0x2e00ae[_0x9b2d('0x2e')]=qs[_0x9b2d('0x2e')](_0x17dedd['query'][_0x9b2d('0x2e')]);_0x2e00ae[_0x9b2d('0x2d')]=qs[_0x9b2d('0x2d')](_0x17dedd[_0x9b2d('0x40')]['offset']);}return _0x7363ac[_0x9b2d('0x71')](_0x2e00ae);}})['then'](function(_0x45f833){if(_0x45f833){return _0x45f833?{'count':_0x2a5ead,'rows':_0x45f833}:null;}})[_0x9b2d('0x1e')](respondWithResult(_0x56cfcc,null))[_0x9b2d('0x28')](handleError(_0x56cfcc,null));};exports[_0x9b2d('0x72')]=function(_0x52b7eb,_0x664979,_0x637230){return db[_0x9b2d('0x3b')][_0x9b2d('0x62')]({'where':{'id':_0x52b7eb[_0x9b2d('0x54')]['id']}})[_0x9b2d('0x1e')](handleEntityNotFound(_0x664979,null))[_0x9b2d('0x1e')](function(_0x5cc690){if(_0x5cc690){return db[_0x9b2d('0x73')][_0x9b2d('0x74')](function(_0x1e32e2){return db[_0x9b2d('0x75')][_0x9b2d('0x35')]({'where':{'WhatsappAccountId':_0x52b7eb[_0x9b2d('0x54')]['id']},'transaction':_0x1e32e2})[_0x9b2d('0x1e')](function(_0x367924){var _0x2d2ce7=_[_0x9b2d('0x3a')](_0x52b7eb[_0x9b2d('0x59')],function(_0x4e21e0){_0x4e21e0[_0x9b2d('0x60')]=_0x52b7eb[_0x9b2d('0x54')]['id'];return _0x4e21e0;});return db[_0x9b2d('0x75')]['bulkCreate'](_0x2d2ce7,{'transaction':_0x1e32e2});});})['then'](function(){return db[_0x9b2d('0x75')][_0x9b2d('0x76')]({'where':{'WhatsappAccountId':_0x52b7eb[_0x9b2d('0x54')]['id']},'order':_0x9b2d('0x77')});});}})['then'](respondWithResult(_0x664979,null))[_0x9b2d('0x28')](handleError(_0x664979,null));};exports[_0x9b2d('0x78')]=function(_0x4a5775,_0x221bc7,_0x1af5bf){var _0xa7207e={};var _0x26b3fa={};var _0x190a37;var _0x4fc6ae;return db[_0x9b2d('0x3b')][_0x9b2d('0x62')]({'where':{'id':_0x4a5775[_0x9b2d('0x54')]['id']}})[_0x9b2d('0x1e')](handleEntityNotFound(_0x221bc7,null))[_0x9b2d('0x1e')](function(_0x27419c){if(_0x27419c){_0x190a37=_0x27419c;_0x26b3fa['model']=_[_0x9b2d('0x56')](db['WhatsappApplication']['rawAttributes']);_0x26b3fa[_0x9b2d('0x40')]=_['keys'](_0x4a5775['query']);_0x26b3fa[_0x9b2d('0x41')]=_['intersection'](_0x26b3fa[_0x9b2d('0x3f')],_0x26b3fa['query']);_0xa7207e[_0x9b2d('0x43')]=_[_0x9b2d('0x42')](_0x26b3fa[_0x9b2d('0x3f')],qs[_0x9b2d('0x44')](_0x4a5775[_0x9b2d('0x40')][_0x9b2d('0x44')]));_0xa7207e[_0x9b2d('0x43')]=_0xa7207e[_0x9b2d('0x43')][_0x9b2d('0x45')]?_0xa7207e[_0x9b2d('0x43')]:_0x26b3fa[_0x9b2d('0x3f')];_0xa7207e[_0x9b2d('0x48')]=qs[_0x9b2d('0x49')](_0x4a5775[_0x9b2d('0x40')][_0x9b2d('0x49')]);_0xa7207e[_0x9b2d('0x4a')]=qs[_0x9b2d('0x41')](_[_0x9b2d('0x4b')](_0x4a5775[_0x9b2d('0x40')],_0x26b3fa[_0x9b2d('0x41')]));if(_0x4a5775[_0x9b2d('0x40')]['filter']){_0xa7207e[_0x9b2d('0x4a')]=_[_0x9b2d('0x4d')](_0xa7207e['where'],{'$or':_['map'](_0xa7207e[_0x9b2d('0x43')],function(_0x31c728){var _0x495748={};_0x495748[_0x31c728]={'$like':'%'+_0x4a5775[_0x9b2d('0x40')]['filter']+'%'};return _0x495748;})});}_0xa7207e=_[_0x9b2d('0x4d')]({},_0xa7207e,_0x4a5775[_0x9b2d('0x57')]);return _0x190a37[_0x9b2d('0x78')](_0xa7207e);}})[_0x9b2d('0x1e')](function(_0x58e178){if(_0x58e178){_0x4fc6ae=_0x58e178[_0x9b2d('0x45')];if(!_0x4a5775['query']['hasOwnProperty'](_0x9b2d('0x47'))){_0xa7207e[_0x9b2d('0x2e')]=qs[_0x9b2d('0x2e')](_0x4a5775[_0x9b2d('0x40')][_0x9b2d('0x2e')]);_0xa7207e[_0x9b2d('0x2d')]=qs[_0x9b2d('0x2d')](_0x4a5775[_0x9b2d('0x40')][_0x9b2d('0x2d')]);}return _0x190a37['getApplications'](_0xa7207e);}})['then'](function(_0xc9d099){if(_0xc9d099){return _0xc9d099?{'count':_0x4fc6ae,'rows':_0xc9d099}:null;}})['then'](respondWithResult(_0x221bc7,null))[_0x9b2d('0x28')](handleError(_0x221bc7,null));};exports[_0x9b2d('0x79')]=function(_0x5c0940,_0x1e7020,_0x44db6f){var _0x620063={'channel':_0x9b2d('0x7a')};var _0x2cfcbd=[];var _0x4acd76=[];var _0x44c11c={};return db[_0x9b2d('0x3b')]['find']({'where':{'id':_0x5c0940[_0x9b2d('0x54')]['id']},'include':[{'model':db[_0x9b2d('0x75')],'as':'Applications'}]})[_0x9b2d('0x1e')](handleEntityNotFound(_0x1e7020,null))['then'](function(_0x32a617){_0x620063['account']=_0x32a617;_0x620063[_0x9b2d('0x7b')]=_[_0x9b2d('0x7c')](_0x32a617[_0x9b2d('0x7d')],[_0x9b2d('0x77')],[_0x9b2d('0x7e')]);if(_0x620063[_0x9b2d('0x7f')][_0x9b2d('0x7d')]){delete _0x620063[_0x9b2d('0x7f')][_0x9b2d('0x7d')];}return db[_0x9b2d('0x80')][_0x9b2d('0x81')]();})[_0x9b2d('0x1e')](function(_0x132e7e){if(!_0x132e7e){throw new db[(_0x9b2d('0x82'))][(_0x9b2d('0x83'))](_0x9b2d('0x84'));}_0x2cfcbd=_[_0x9b2d('0x85')](_[_0x9b2d('0x56')](_0x132e7e),['createdAt','updatedAt']);_0x4acd76=_['difference'](_[_0x9b2d('0x56')](_0x132e7e),[_0x9b2d('0x86'),_0x9b2d('0x87'),_0x9b2d('0x88'),_0x9b2d('0x89')]);_0x620063[_0x9b2d('0x59')]={'mapKey':_0x9b2d('0x8a')};if(_0x620063['account'][_0x9b2d('0x4e')]&&_0x620063['account'][_0x9b2d('0x4e')]===_0x9b2d('0x8b')){_0x620063['body'][_0x9b2d('0x8c')]=_0x5c0940[_0x9b2d('0x59')]['From'][_0x9b2d('0x8d')]('whatsapp:','');_0x620063[_0x9b2d('0x59')]['body']=_0x5c0940[_0x9b2d('0x59')][_0x9b2d('0x8e')];_0x620063[_0x9b2d('0x59')]['messageId']=_0x5c0940['body']['MessageSid'];}if(_0x620063[_0x9b2d('0x59')]['id']){delete _0x620063[_0x9b2d('0x59')]['id'];}if(_[_0x9b2d('0x8f')](_0x620063[_0x9b2d('0x59')][_0x9b2d('0x8c')])){throw new db[(_0x9b2d('0x82'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x9b2d('0x8f')](_0x620063[_0x9b2d('0x59')][_0x9b2d('0x59')])||_0x620063[_0x9b2d('0x59')][_0x9b2d('0x59')]===''){throw new db['Sequelize'][(_0x9b2d('0x83'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9b2d('0x8f')](_0x620063[_0x9b2d('0x59')][_0x9b2d('0x90')])){throw new db[(_0x9b2d('0x82'))]['ValidationError'](_0x9b2d('0x91')+_0x4acd76);}if(!_[_0x9b2d('0x92')](_0x4acd76,_0x620063[_0x9b2d('0x59')][_0x9b2d('0x90')])){throw new db[(_0x9b2d('0x82'))]['ValidationError'](_0x9b2d('0x93')+_0x4acd76);}_0x44c11c[_0x620063['body']['mapKey']]=_0x620063[_0x9b2d('0x59')]['from'];return db[_0x9b2d('0x94')][_0x9b2d('0x5d')]({'where':{'id':_0x620063[_0x9b2d('0x7f')][_0x9b2d('0x89')]},'include':[{'model':db[_0x9b2d('0x80')],'as':_0x9b2d('0x95'),'where':_0x44c11c,'limit':0x1,'order':[[_0x9b2d('0x87'),'DESC']]}]});})[_0x9b2d('0x1e')](handleEntityNotFound(_0x1e7020,null))['then'](function(_0x107ab4){if(_0x107ab4){_0x620063['list']=_['omit'](_0x107ab4,[_0x9b2d('0x95')]);if(_0x107ab4[_0x9b2d('0x95')][_0x9b2d('0x45')]){return _0x107ab4[_0x9b2d('0x95')][0x0];}var _0x39d4e4=_['defaults'](_0x620063[_0x9b2d('0x59')],{'firstName':_0x620063['body'][_0x9b2d('0x8c')],'ListId':_0x107ab4['id']});_0x39d4e4[_0x620063[_0x9b2d('0x59')][_0x9b2d('0x90')]]=_0x620063[_0x9b2d('0x59')]['from'];return db[_0x9b2d('0x80')][_0x9b2d('0x58')](_0x39d4e4,{'fields':_0x2cfcbd,'raw':!![]});}})[_0x9b2d('0x1e')](handleEntityNotFound(_0x1e7020,null))[_0x9b2d('0x1e')](function(_0x2d0a6c){if(_0x2d0a6c){_0x620063[_0x9b2d('0x96')]=_0x2d0a6c;var _0x613198={'ContactId':_0x2d0a6c['id'],'phone':_0x620063[_0x9b2d('0x59')]['from'],'WhatsappAccountId':_0x5c0940[_0x9b2d('0x54')]['id']};var _0xa55bff={'ContactId':_0x2d0a6c['id'],'WhatsappAccountId':_0x5c0940[_0x9b2d('0x54')]['id'],'closed':![]};return db[_0x9b2d('0x97')][_0x9b2d('0x5d')]({'where':_0xa55bff})['then'](function(_0x8dc69d){if(_0x8dc69d){return[_0x8dc69d,![]];}return db[_0x9b2d('0x97')][_0x9b2d('0x58')](_0x613198)[_0x9b2d('0x1e')](function(_0x32eef3){return[_0x32eef3,!![]];});});}})[_0x9b2d('0x6b')](function(_0x12b51f,_0x5ccc14){_0x620063[_0x9b2d('0x98')]=_0x12b51f['get']({'plain':!![]});_0x620063[_0x9b2d('0x98')][_0x9b2d('0x99')]=![];if(_0x5ccc14){if(_0x620063[_0x9b2d('0x7f')][_0x9b2d('0x9a')]){_0x620063[_0x9b2d('0x7b')]['push']({'id':0x0,'priority':_0x620063[_0x9b2d('0x7b')][_0x9b2d('0x45')]+0x1,'app':_0x9b2d('0x9b'),'appdata':_0x9b2d('0x9c'),'interval':_0x9b2d('0x9d')});}_0x620063['interaction'][_0x9b2d('0x99')]=!![];}return db['WhatsappMessage'][_0x9b2d('0x58')]({'phone':_0x620063[_0x9b2d('0x59')]['from'],'messageId':_0x620063['body'][_0x9b2d('0x9e')],'body':_0x620063[_0x9b2d('0x59')][_0x9b2d('0x59')],'WhatsappAccountId':_0x5c0940[_0x9b2d('0x54')]['id'],'WhatsappInteractionId':_0x12b51f['id'],'direction':'in','ContactId':_0x12b51f[_0x9b2d('0x9f')],'AttachmentId':_0x620063['body']['AttachmentId']});})[_0x9b2d('0x1e')](function(_0xd2bc17){_0x620063['message']=_0xd2bc17;if(_0x620063['interaction'][_0x9b2d('0xa0')]){return db[_0x9b2d('0xa1')]['find']({'attributes':['id',_0x9b2d('0x38')],'where':{'id':_0x620063['interaction'][_0x9b2d('0xa0')]}})[_0x9b2d('0x1e')](function(_0x570c5b){if(_0x570c5b){_0x620063[_0x9b2d('0x7b')][_0x9b2d('0xa2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x570c5b[_0x9b2d('0x38')]+','+(_0x620063[_0x9b2d('0x7f')]['waitForTheAssignedAgent']||0xa),'interval':_0x9b2d('0x9d')});}return respondWithRpcPromise(_0x9b2d('0xa3'),'startRouting',_0x620063);});}return respondWithRpcPromise(_0x9b2d('0xa3'),_0x9b2d('0xa4'),_0x620063);})['then'](function(_0x44eb58){if(_0x44eb58){var _0x5b26bb=0xc8;var _0x8a0cfc=_0x9b2d('0xa5');logger[_0x9b2d('0x26')](_0x9b2d('0x21'),_0x8a0cfc,_0x5b26bb,'entity\x20found');logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x8a0cfc,_0x5b26bb,_0x9b2d('0xa6'),JSON['stringify'](_0x44eb58));if(_0x620063[_0x9b2d('0x7f')][_0x9b2d('0x4e')]===_0x9b2d('0x8b')){return _0x1e7020[_0x9b2d('0x2b')](_0x5b26bb)[_0x9b2d('0x31')]('Content-Type',_0x9b2d('0xa7'))[_0x9b2d('0xa8')](_0x9b2d('0xa9'));}else{return _0x1e7020[_0x9b2d('0x2b')](_0x5b26bb)[_0x9b2d('0x2c')](_0x44eb58);}}})[_0x9b2d('0x28')](handleError(_0x1e7020,null));};exports['send']=function(_0x4ef9ef,_0x8cffa1,_0x2f69d7){var _0xfba5c2,_0x4187c5,_0x22b416;if(_[_0x9b2d('0x8f')](_0x4ef9ef['body'][_0x9b2d('0x59')])||_0x4ef9ef[_0x9b2d('0x59')]['body']===''){throw new db[(_0x9b2d('0x82'))]['ValidationError'](_0x9b2d('0xaa'));}if(_[_0x9b2d('0x8f')](_0x4ef9ef[_0x9b2d('0x59')]['to'])){throw new db['Sequelize']['ValidationError']('to\x20is\x20mandatory');}_0xfba5c2=_0x4ef9ef[_0x9b2d('0x59')]['to'];return db[_0x9b2d('0x3b')][_0x9b2d('0x5d')]({'where':{'id':_0x4ef9ef['params']['id']},'include':[{'model':db[_0x9b2d('0x94')],'as':_0x9b2d('0xab'),'include':[{'model':db[_0x9b2d('0x80')],'as':_0x9b2d('0x95'),'where':{'mobile':_0xfba5c2},'limit':0x1,'order':[[_0x9b2d('0x87'),_0x9b2d('0xac')]]}]}]})['then'](handleEntityNotFound(_0x8cffa1,null))[_0x9b2d('0x1e')](function(_0x26968f){if(_0x26968f&&_0x26968f['List']){_0x4187c5=_0x26968f[_0x9b2d('0x36')]({'plain':!![]});if(_0x4187c5['List']&&_0x4187c5['List'][_0x9b2d('0x95')]['length']){return _0x4187c5[_0x9b2d('0xab')][_0x9b2d('0x95')][0x0];}return db['CmContact']['create'](_['defaults'](_0x4ef9ef[_0x9b2d('0x59')],{'firstName':_0xfba5c2,'mobile':_0xfba5c2,'phone':_0xfba5c2,'ListId':_0x4187c5[_0x9b2d('0x89')]}));}})[_0x9b2d('0x1e')](handleEntityNotFound(_0x8cffa1,null))['then'](function(_0x1d688d){if(_0x1d688d){_0x22b416=_0x1d688d;return db['WhatsappInteraction']['find']({'where':{'ContactId':_0x22b416['id'],'closed':![],'WhatsappAccountId':_0x4187c5['id']}})['then'](function(_0x2f6560){if(_0x2f6560){return[_0x2f6560,![]];}return db[_0x9b2d('0x97')]['create']({'UserId':_0x4ef9ef[_0x9b2d('0x5a')]['id'],'ContactId':_0x22b416['id'],'WhatsappAccountId':_0x4187c5['id'],'phone':_0xfba5c2,'firstMsgDirection':_0x9b2d('0xad'),'Messages':[_[_0x9b2d('0x4d')](_0x4ef9ef['body'],{'read':![],'body':_0x4ef9ef[_0x9b2d('0x59')][_0x9b2d('0x59')],'phone':_0xfba5c2,'WhatsappAccountId':_0x4187c5['id'],'UserId':_0x4ef9ef[_0x9b2d('0x5a')]['id'],'ContactId':_0x22b416['id']})]},{'include':[{'model':db[_0x9b2d('0xae')],'as':'Messages'}]})[_0x9b2d('0x1e')](function(_0x2d0054){return[_0x2d0054,!![]];});});}})[_0x9b2d('0x6b')](function(_0x53e7f4,_0x23499a){if(_0x23499a){return _0x53e7f4;}return db[_0x9b2d('0xae')][_0x9b2d('0x58')](_['merge'](_0x4ef9ef[_0x9b2d('0x59')],{'read':![],'body':_0x4ef9ef['body']['body'],'phone':_0xfba5c2,'WhatsappAccountId':_0x4187c5['id'],'WhatsappInteractionId':_0x53e7f4['id'],'UserId':_0x4ef9ef[_0x9b2d('0x5a')]['id'],'ContactId':_0x22b416['id']}))[_0x9b2d('0x1e')](function(_0x24b82b){_0x53e7f4[_0x9b2d('0xaf')]['Messages']=[];_0x53e7f4['dataValues'][_0x9b2d('0xb0')]['push'](_0x24b82b[_0x9b2d('0xaf')]);return _0x53e7f4;});})['then'](respondWithResult(_0x8cffa1,null))['catch'](handleError(_0x8cffa1,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 66e0d55..6373099 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 _0xce21=['emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappAccount','setMaxListeners','update'];(function(_0x6a734c,_0x1b2d9f){var _0x494d0d=function(_0x36fd39){while(--_0x36fd39){_0x6a734c['push'](_0x6a734c['shift']());}};_0x494d0d(++_0x1b2d9f);}(_0xce21,0x184));var _0x1ce2=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0xce21[_0xfcbcb8];return _0x1b1f97;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x1ce2('0x0'))['db'][_0x1ce2('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1ce2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1ce2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x42bb72){return function(_0xe40146,_0x5913df,_0x164904){WhatsappAccountEvents[_0x1ce2('0x4')](_0x42bb72+':'+_0xe40146['id'],_0xe40146);WhatsappAccountEvents[_0x1ce2('0x4')](_0x42bb72,_0xe40146);_0x164904(null);};}for(var e in events){if(events[_0x1ce2('0x5')](e)){var event=events[e];WhatsappAccount[_0x1ce2('0x6')](e,emitEvent(event));}}module[_0x1ce2('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0xc461=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappAccount','setMaxListeners','save','update'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xc461,0x159));var _0x1c46=function(_0x3254c0,_0x57a5ae){_0x3254c0=_0x3254c0-0x0;var _0x380854=_0xc461[_0x3254c0];return _0x380854;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x1c46('0x0'))['db'][_0x1c46('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1c46('0x2')](0x0);var events={'afterCreate':_0x1c46('0x3'),'afterUpdate':_0x1c46('0x4'),'afterDestroy':_0x1c46('0x5')};function emitEvent(_0x56496e){return function(_0x1658e1,_0x563217,_0x49ccc1){WhatsappAccountEvents[_0x1c46('0x6')](_0x56496e+':'+_0x1658e1['id'],_0x1658e1);WhatsappAccountEvents['emit'](_0x56496e,_0x1658e1);_0x49ccc1(null);};}for(var e in events){if(events[_0x1c46('0x7')](e)){var event=events[e];WhatsappAccount[_0x1c46('0x8')](e,emitEvent(event));}}module[_0x1c46('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 9b20cb3..46e1b86 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 _0x3445=['request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','WhatsappAccount','whatsapp_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0x3445,0x10c));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x5344('0x0'));var logger=require(_0x5344('0x1'))(_0x5344('0x2'));var moment=require(_0x5344('0x3'));var BPromise=require(_0x5344('0x4'));var rp=require(_0x5344('0x5'));var fs=require('fs');var path=require(_0x5344('0x6'));var rimraf=require(_0x5344('0x7'));var config=require(_0x5344('0x8'));var attributes=require(_0x5344('0x9'));module[_0x5344('0xa')]=function(_0x17f851,_0x1ae0f0){return _0x17f851['define'](_0x5344('0xb'),attributes,{'tableName':_0x5344('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42cd=['bluebird','request-promise','path','../../config/environment','exports','WhatsappAccount','lodash','api','moment'];(function(_0x37cca3,_0x463b1b){var _0x281614=function(_0x1e8858){while(--_0x1e8858){_0x37cca3['push'](_0x37cca3['shift']());}};_0x281614(++_0x463b1b);}(_0x42cd,0xde));var _0xd42c=function(_0x4858ad,_0xd5513a){_0x4858ad=_0x4858ad-0x0;var _0x3309b6=_0x42cd[_0x4858ad];return _0x3309b6;};'use strict';var _=require(_0xd42c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd42c('0x1'));var moment=require(_0xd42c('0x2'));var BPromise=require(_0xd42c('0x3'));var rp=require(_0xd42c('0x4'));var fs=require('fs');var path=require(_0xd42c('0x5'));var rimraf=require('rimraf');var config=require(_0xd42c('0x6'));var attributes=require('./whatsappAccount.attributes');module[_0xd42c('0x7')]=function(_0x5c941e,_0xa7c2d4){return _0x5c941e['define'](_0xd42c('0x8'),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 4019c1f..cc8dfcb 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 _0x6614=['redis','localhost','./whatsappAccount.socket','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappAccount','find','raw','options','include','map','model','attributes','ShowWhatsappAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6614,0x1e0));var _0x4661=function(_0x3c28e7,_0x169024){_0x3c28e7=_0x3c28e7-0x0;var _0x557b3a=_0x6614[_0x3c28e7];return _0x557b3a;};'use strict';var _=require(_0x4661('0x0'));var util=require('util');var moment=require(_0x4661('0x1'));var BPromise=require(_0x4661('0x2'));var rs=require(_0x4661('0x3'));var fs=require('fs');var Redis=require(_0x4661('0x4'));var db=require(_0x4661('0x5'))['db'];var utils=require(_0x4661('0x6'));var logger=require(_0x4661('0x7'))(_0x4661('0x8'));var config=require(_0x4661('0x9'));var jayson=require(_0x4661('0xa'));var client=jayson[_0x4661('0xb')][_0x4661('0xc')]({'port':0x232a});config['redis']=_[_0x4661('0xd')](config[_0x4661('0xe')],{'host':_0x4661('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4661('0x10'))['register'](socket);function respondWithRpcPromise(_0x3beb85,_0x3d4d7c,_0x24eb97){return new BPromise(function(_0xf50c01,_0x397f97){return client[_0x4661('0x11')](_0x3beb85,_0x24eb97)[_0x4661('0x12')](function(_0x36a737){logger[_0x4661('0x13')](_0x4661('0x14'),_0x3d4d7c,_0x4661('0x15'));logger['debug'](_0x4661('0x16'),_0x3d4d7c,_0x4661('0x15'),JSON[_0x4661('0x17')](_0x36a737));if(_0x36a737[_0x4661('0x18')]){if(_0x36a737[_0x4661('0x18')][_0x4661('0x19')]===0x1f4){logger[_0x4661('0x18')](_0x4661('0x14'),_0x3d4d7c,_0x36a737[_0x4661('0x18')][_0x4661('0x1a')]);return _0x397f97(_0x36a737[_0x4661('0x18')]['message']);}logger['error'](_0x4661('0x14'),_0x3d4d7c,_0x36a737['error']['message']);return _0xf50c01(_0x36a737[_0x4661('0x18')]['message']);}else{logger[_0x4661('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x3d4d7c,_0x4661('0x15'));_0xf50c01(_0x36a737[_0x4661('0x1b')][_0x4661('0x1a')]);}})[_0x4661('0x1c')](function(_0x56607b){logger[_0x4661('0x18')](_0x4661('0x14'),_0x3d4d7c,_0x56607b);_0x397f97(_0x56607b);});});}exports['ShowWhatsappAccount']=function(_0x2083af){var _0x518a96=this;return new Promise(function(_0x23a651,_0x313628){return db[_0x4661('0x1d')][_0x4661('0x1e')]({'raw':_0x2083af['options']?_0x2083af['options'][_0x4661('0x1f')]===undefined?!![]:![]:!![],'where':_0x2083af[_0x4661('0x20')]?_0x2083af['options']['where']||null:null,'attributes':_0x2083af[_0x4661('0x20')]?_0x2083af[_0x4661('0x20')]['attributes']||null:null,'include':_0x2083af[_0x4661('0x20')]?_0x2083af['options'][_0x4661('0x21')]?_[_0x4661('0x22')](_0x2083af[_0x4661('0x20')][_0x4661('0x21')],function(_0x121b41){return{'model':db[_0x121b41[_0x4661('0x23')]],'as':_0x121b41['as'],'attributes':_0x121b41[_0x4661('0x24')],'include':_0x121b41['include']?_[_0x4661('0x22')](_0x121b41[_0x4661('0x21')],function(_0x361d30){return{'model':db[_0x361d30[_0x4661('0x23')]],'as':_0x361d30['as'],'attributes':_0x361d30[_0x4661('0x24')],'include':_0x361d30[_0x4661('0x21')]?_['map'](_0x361d30['include'],function(_0x2e9bb8){return{'model':db[_0x2e9bb8[_0x4661('0x23')]],'as':_0x2e9bb8['as'],'attributes':_0x2e9bb8['attributes']};}):[]};}):[]};}):[]:[]})[_0x4661('0x12')](function(_0x545ae3){logger[_0x4661('0x13')]('ShowWhatsappAccount',_0x2083af);logger['debug'](_0x4661('0x25'),_0x2083af,JSON[_0x4661('0x17')](_0x545ae3));_0x23a651(_0x545ae3);})[_0x4661('0x1c')](function(_0x3dcc40){logger['error']('ShowWhatsappAccount',_0x3dcc40[_0x4661('0x1a')],_0x2083af);_0x313628(_0x518a96[_0x4661('0x18')](0x1f4,_0x3dcc40['message']));});});}; \ No newline at end of file +var _0x3f2b=['http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','then','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','map','model','info','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0xe01eef,_0x19e0a0){var _0x48a6d5=function(_0xcf5789){while(--_0xcf5789){_0xe01eef['push'](_0xe01eef['shift']());}};_0x48a6d5(++_0x19e0a0);}(_0x3f2b,0x1be));var _0xb3f2=function(_0x2c5802,_0x33de02){_0x2c5802=_0x2c5802-0x0;var _0x36b625=_0x3f2b[_0x2c5802];return _0x36b625;};'use strict';var _=require(_0xb3f2('0x0'));var util=require(_0xb3f2('0x1'));var moment=require(_0xb3f2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb3f2('0x3'));var db=require(_0xb3f2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb3f2('0x5'))('rpc');var config=require(_0xb3f2('0x6'));var jayson=require(_0xb3f2('0x7'));var client=jayson[_0xb3f2('0x8')][_0xb3f2('0x9')]({'port':0x232a});config[_0xb3f2('0xa')]=_[_0xb3f2('0xb')](config[_0xb3f2('0xa')],{'host':_0xb3f2('0xc'),'port':0x18eb});var socket=require(_0xb3f2('0xd'))(new Redis(config[_0xb3f2('0xa')]));require(_0xb3f2('0xe'))[_0xb3f2('0xf')](socket);function respondWithRpcPromise(_0x6ec8d0,_0x55d0ee,_0x35028a){return new BPromise(function(_0x54f0d9,_0x5c5f74){return client['request'](_0x6ec8d0,_0x35028a)[_0xb3f2('0x10')](function(_0x4cc8ba){logger['info'](_0xb3f2('0x11'),_0x55d0ee,'request\x20sent');logger[_0xb3f2('0x12')](_0xb3f2('0x13'),_0x55d0ee,_0xb3f2('0x14'),JSON[_0xb3f2('0x15')](_0x4cc8ba));if(_0x4cc8ba[_0xb3f2('0x16')]){if(_0x4cc8ba[_0xb3f2('0x16')]['code']===0x1f4){logger[_0xb3f2('0x16')](_0xb3f2('0x11'),_0x55d0ee,_0x4cc8ba[_0xb3f2('0x16')]['message']);return _0x5c5f74(_0x4cc8ba[_0xb3f2('0x16')][_0xb3f2('0x17')]);}logger[_0xb3f2('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x55d0ee,_0x4cc8ba[_0xb3f2('0x16')][_0xb3f2('0x17')]);return _0x54f0d9(_0x4cc8ba[_0xb3f2('0x16')][_0xb3f2('0x17')]);}else{logger['info'](_0xb3f2('0x11'),_0x55d0ee,_0xb3f2('0x14'));_0x54f0d9(_0x4cc8ba['result'][_0xb3f2('0x17')]);}})[_0xb3f2('0x18')](function(_0x236cac){logger[_0xb3f2('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x55d0ee,_0x236cac);_0x5c5f74(_0x236cac);});});}exports[_0xb3f2('0x19')]=function(_0x2875e8){var _0x53beb9=this;return new Promise(function(_0x91cad5,_0x1118b2){return db[_0xb3f2('0x1a')][_0xb3f2('0x1b')]({'raw':_0x2875e8['options']?_0x2875e8[_0xb3f2('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2875e8[_0xb3f2('0x1c')]?_0x2875e8[_0xb3f2('0x1c')][_0xb3f2('0x1d')]||null:null,'attributes':_0x2875e8[_0xb3f2('0x1c')]?_0x2875e8[_0xb3f2('0x1c')][_0xb3f2('0x1e')]||null:null,'include':_0x2875e8[_0xb3f2('0x1c')]?_0x2875e8[_0xb3f2('0x1c')][_0xb3f2('0x1f')]?_[_0xb3f2('0x20')](_0x2875e8[_0xb3f2('0x1c')]['include'],function(_0x7a7e7c){return{'model':db[_0x7a7e7c[_0xb3f2('0x21')]],'as':_0x7a7e7c['as'],'attributes':_0x7a7e7c[_0xb3f2('0x1e')],'include':_0x7a7e7c['include']?_[_0xb3f2('0x20')](_0x7a7e7c[_0xb3f2('0x1f')],function(_0x7bd2e1){return{'model':db[_0x7bd2e1['model']],'as':_0x7bd2e1['as'],'attributes':_0x7bd2e1[_0xb3f2('0x1e')],'include':_0x7bd2e1[_0xb3f2('0x1f')]?_[_0xb3f2('0x20')](_0x7bd2e1[_0xb3f2('0x1f')],function(_0x25ddff){return{'model':db[_0x25ddff['model']],'as':_0x25ddff['as'],'attributes':_0x25ddff[_0xb3f2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb3f2('0x10')](function(_0x21d3f2){logger[_0xb3f2('0x22')](_0xb3f2('0x19'),_0x2875e8);logger['debug'](_0xb3f2('0x19'),_0x2875e8,JSON[_0xb3f2('0x15')](_0x21d3f2));_0x91cad5(_0x21d3f2);})[_0xb3f2('0x18')](function(_0x2da229){logger[_0xb3f2('0x16')]('ShowWhatsappAccount',_0x2da229[_0xb3f2('0x17')],_0x2875e8);_0x1118b2(_0x53beb9[_0xb3f2('0x16')](0x1f4,_0x2da229[_0xb3f2('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 349b024..364238a 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 _0xf712=['remove','update','emit','removeListener','register','whatsappAccount:','./whatsappAccount.events'];(function(_0x5c1fce,_0x5cb241){var _0x2458c9=function(_0x3f04fe){while(--_0x3f04fe){_0x5c1fce['push'](_0x5c1fce['shift']());}};_0x2458c9(++_0x5cb241);}(_0xf712,0x19c));var _0x2f71=function(_0x4df0d2,_0x1784c5){_0x4df0d2=_0x4df0d2-0x0;var _0x3c15ae=_0xf712[_0x4df0d2];return _0x3c15ae;};'use strict';var WhatsappAccountEvents=require(_0x2f71('0x0'));var events=['save',_0x2f71('0x1'),_0x2f71('0x2')];function createListener(_0x41abdc,_0x2b3526){return function(_0x5391ef){_0x2b3526[_0x2f71('0x3')](_0x41abdc,_0x5391ef);};}function removeListener(_0x11e656,_0x421a9c){return function(){WhatsappAccountEvents[_0x2f71('0x4')](_0x11e656,_0x421a9c);};}exports[_0x2f71('0x5')]=function(_0x53ecbf){for(var _0x3508a2=0x0,_0x50a153=events['length'];_0x3508a2<_0x50a153;_0x3508a2++){var _0xcddd9a=events[_0x3508a2];var _0x578b74=createListener(_0x2f71('0x6')+_0xcddd9a,_0x53ecbf);WhatsappAccountEvents['on'](_0xcddd9a,_0x578b74);}}; \ No newline at end of file +var _0x0049=['save','remove','update','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x441763,_0x51e92a){var _0xdf34c4=function(_0x3199f1){while(--_0x3199f1){_0x441763['push'](_0x441763['shift']());}};_0xdf34c4(++_0x51e92a);}(_0x0049,0x147));var _0x9004=function(_0x2ee907,_0x7c8139){_0x2ee907=_0x2ee907-0x0;var _0x3111f4=_0x0049[_0x2ee907];return _0x3111f4;};'use strict';var WhatsappAccountEvents=require(_0x9004('0x0'));var events=[_0x9004('0x1'),_0x9004('0x2'),_0x9004('0x3')];function createListener(_0x58535,_0x12e133){return function(_0x2240cf){_0x12e133['emit'](_0x58535,_0x2240cf);};}function removeListener(_0x395ace,_0x691e1f){return function(){WhatsappAccountEvents[_0x9004('0x4')](_0x395ace,_0x691e1f);};}exports[_0x9004('0x5')]=function(_0x321189){for(var _0x2ee00f=0x0,_0x428d6e=events[_0x9004('0x6')];_0x2ee00f<_0x428d6e;_0x2ee00f++){var _0x57fa78=events[_0x2ee00f];var _0x3b83ef=createListener(_0x9004('0x7')+_0x57fa78,_0x321189);WhatsappAccountEvents['on'](_0x57fa78,_0x3b83ef);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 7cae834..8afae17 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 _0x31f8=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x31f8,0x13f));var _0x831f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x31f8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x831f('0x0'));var util=require(_0x831f('0x1'));var path=require('path');var timeout=require(_0x831f('0x2'));var express=require(_0x831f('0x3'));var router=express[_0x831f('0x4')]();var fs_extra=require(_0x831f('0x5'));var auth=require(_0x831f('0x6'));var interaction=require(_0x831f('0x7'));var config=require(_0x831f('0x8'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x831f('0x9')](),controller[_0x831f('0xa')]);router[_0x831f('0xb')](_0x831f('0xc'),auth[_0x831f('0x9')](),controller[_0x831f('0xd')]);router[_0x831f('0xe')]('/',auth[_0x831f('0x9')](),controller[_0x831f('0xf')]);router['put'](_0x831f('0xc'),auth['isAuthenticated'](),controller[_0x831f('0x10')]);router[_0x831f('0x11')](_0x831f('0xc'),auth[_0x831f('0x9')](),controller[_0x831f('0x12')]);module[_0x831f('0x13')]=router; \ No newline at end of file +var _0x7768=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','create','/:id','update','delete','destroy'];(function(_0x3c81b5,_0x3f5ed7){var _0x5888c4=function(_0x4e65b0){while(--_0x4e65b0){_0x3c81b5['push'](_0x3c81b5['shift']());}};_0x5888c4(++_0x3f5ed7);}(_0x7768,0xf8));var _0x8776=function(_0x47a5b3,_0x279791){_0x47a5b3=_0x47a5b3-0x0;var _0x187b60=_0x7768[_0x47a5b3];return _0x187b60;};'use strict';var multer=require(_0x8776('0x0'));var util=require(_0x8776('0x1'));var path=require('path');var timeout=require(_0x8776('0x2'));var express=require(_0x8776('0x3'));var router=express[_0x8776('0x4')]();var fs_extra=require(_0x8776('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8776('0x6'));var config=require(_0x8776('0x7'));var controller=require('./whatsappApplication.controller');router[_0x8776('0x8')]('/',auth['isAuthenticated'](),controller[_0x8776('0x9')]);router[_0x8776('0x8')]('/:id',auth[_0x8776('0xa')](),controller[_0x8776('0xb')]);router[_0x8776('0xc')]('/',auth[_0x8776('0xa')](),controller[_0x8776('0xd')]);router['put'](_0x8776('0xe'),auth[_0x8776('0xa')](),controller[_0x8776('0xf')]);router[_0x8776('0x10')](_0x8776('0xe'),auth[_0x8776('0xa')](),controller[_0x8776('0x11')]);module[_0x8776('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 4d99b9e..7ca20d7 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 _0x31d2=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x141186,_0x135552){var _0x53e9d1=function(_0x2b324b){while(--_0x2b324b){_0x141186['push'](_0x141186['shift']());}};_0x53e9d1(++_0x135552);}(_0x31d2,0x1d4));var _0x231d=function(_0x474e22,_0x24fd7c){_0x474e22=_0x474e22-0x0;var _0x5ebcf1=_0x31d2[_0x474e22];return _0x5ebcf1;};'use strict';var Sequelize=require(_0x231d('0x0'));module[_0x231d('0x1')]={'priority':{'type':Sequelize[_0x231d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x231d('0x3')],'allowNull':![],'defaultValue':_0x231d('0x4')},'appdata':{'type':Sequelize[_0x231d('0x5')]()},'description':{'type':Sequelize[_0x231d('0x3')]},'interval':{'type':Sequelize[_0x231d('0x3')],'defaultValue':_0x231d('0x6')}}; \ No newline at end of file +var _0x8fc6=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x512d50,_0x51202b){var _0x24b38a=function(_0x3a83fe){while(--_0x3a83fe){_0x512d50['push'](_0x512d50['shift']());}};_0x24b38a(++_0x51202b);}(_0x8fc6,0x1c1));var _0x68fc=function(_0x37b022,_0x742861){_0x37b022=_0x37b022-0x0;var _0x3b6c68=_0x8fc6[_0x37b022];return _0x3b6c68;};'use strict';var Sequelize=require(_0x68fc('0x0'));module[_0x68fc('0x1')]={'priority':{'type':Sequelize[_0x68fc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x68fc('0x3')],'allowNull':![],'defaultValue':_0x68fc('0x4')},'appdata':{'type':Sequelize[_0x68fc('0x5')]()},'description':{'type':Sequelize[_0x68fc('0x3')]},'interval':{'type':Sequelize[_0x68fc('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 2e67b61..d0df4f6 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 _0x0b0e=['hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x3ce2fb,_0x3585da){var _0x323301=function(_0x42b9bf){while(--_0x42b9bf){_0x3ce2fb['push'](_0x3ce2fb['shift']());}};_0x323301(++_0x3585da);}(_0x0b0e,0x187));var _0xe0b0=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x0b0e[_0x35007a];return _0x574f68;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['WhatsappApplication'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['WhatsappApplication'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['WhatsappApplication']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));}; \ No newline at end of file +var _0x77d4=['set','json','apply','reject','save','update','then','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','filter','options','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x77d4,0x108));var _0x477d=function(_0x5760bd,_0x4f12e4){_0x5760bd=_0x5760bd-0x0;var _0x572625=_0x77d4[_0x5760bd];return _0x572625;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x477d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x477d('0x1'));var rp=require('request-promise');var moment=require(_0x477d('0x2'));var BPromise=require(_0x477d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x477d('0x4'));var sox=require(_0x477d('0x5'));var csv=require(_0x477d('0x6'));var ejs=require(_0x477d('0x7'));var fs=require('fs');var fs_extra=require(_0x477d('0x8'));var _=require(_0x477d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x477d('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x477d('0xb'));var Papa=require(_0x477d('0xc'));var Redis=require(_0x477d('0xd'));var authService=require(_0x477d('0xe'));var qs=require(_0x477d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x477d('0x10'));var logger=require('../../config/logger')(_0x477d('0x11'));var utils=require(_0x477d('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x477d('0x13'));var db=require(_0x477d('0x14'))['db'];function respondWithStatusCode(_0x5a190c,_0x5dd33c){_0x5dd33c=_0x5dd33c||0xcc;return function(_0x6ff724){if(_0x6ff724){return _0x5a190c[_0x477d('0x15')](_0x5dd33c);}return _0x5a190c['status'](_0x5dd33c)[_0x477d('0x16')]();};}function respondWithResult(_0x1d5699,_0x48c73a){_0x48c73a=_0x48c73a||0xc8;return function(_0x4b2021){if(_0x4b2021){return _0x1d5699[_0x477d('0x17')](_0x48c73a)['json'](_0x4b2021);}};}function respondWithFilteredResult(_0x30481f,_0x234b99){return function(_0x25fc02){if(_0x25fc02){var _0x5985b5=typeof _0x234b99[_0x477d('0x18')]===_0x477d('0x19')&&typeof _0x234b99[_0x477d('0x1a')]===_0x477d('0x19');var _0x57b38e=_0x25fc02[_0x477d('0x1b')];var _0x5d5553=_0x5985b5?0x0:_0x234b99[_0x477d('0x18')];var _0x1399d7=_0x5985b5?_0x25fc02[_0x477d('0x1b')]:_0x234b99[_0x477d('0x18')]+_0x234b99[_0x477d('0x1a')];var _0x2145ce;if(_0x1399d7>=_0x57b38e){_0x1399d7=_0x57b38e;_0x2145ce=0xc8;}else{_0x2145ce=0xce;}_0x30481f['status'](_0x2145ce);return _0x30481f[_0x477d('0x1c')]('Content-Range',_0x5d5553+'-'+_0x1399d7+'/'+_0x57b38e)[_0x477d('0x1d')](_0x25fc02);}return null;};}function patchUpdates(_0x24a6d5){return function(_0x40256e){try{jsonpatch[_0x477d('0x1e')](_0x40256e,_0x24a6d5,!![]);}catch(_0x27b3aa){return BPromise[_0x477d('0x1f')](_0x27b3aa);}return _0x40256e[_0x477d('0x20')]();};}function saveUpdates(_0x17154d,_0x45a8bd){return function(_0x5981a){if(_0x5981a){return _0x5981a[_0x477d('0x21')](_0x17154d)[_0x477d('0x22')](function(_0x43c845){return _0x43c845;});}return null;};}function removeEntity(_0x1f3868,_0x4e6a44){return function(_0x4481b0){if(_0x4481b0){return _0x4481b0['destroy']()[_0x477d('0x22')](function(){_0x1f3868[_0x477d('0x17')](0xcc)[_0x477d('0x16')]();});}};}function handleEntityNotFound(_0x2287b4,_0x4bb50e){return function(_0xd6dca5){if(!_0xd6dca5){_0x2287b4[_0x477d('0x15')](0x194);}return _0xd6dca5;};}function handleError(_0x1ca4fe,_0x48ee5e){_0x48ee5e=_0x48ee5e||0x1f4;return function(_0x585648){logger[_0x477d('0x23')](_0x585648[_0x477d('0x24')]);if(_0x585648[_0x477d('0x25')]){delete _0x585648['name'];}_0x1ca4fe[_0x477d('0x17')](_0x48ee5e)[_0x477d('0x26')](_0x585648);};}exports[_0x477d('0x27')]=function(_0xe4dd40,_0x37b332){var _0x537fc4={},_0x2fc959={},_0xeb02f5={'count':0x0,'rows':[]};var _0x17dd16=_[_0x477d('0x28')](db[_0x477d('0x29')][_0x477d('0x2a')],function(_0x180046){return{'name':_0x180046[_0x477d('0x2b')],'type':_0x180046[_0x477d('0x2c')][_0x477d('0x2d')]};});_0x2fc959[_0x477d('0x2e')]=_[_0x477d('0x28')](_0x17dd16,_0x477d('0x25'));_0x2fc959[_0x477d('0x2f')]=_[_0x477d('0x30')](_0xe4dd40[_0x477d('0x2f')]);_0x2fc959[_0x477d('0x31')]=_[_0x477d('0x32')](_0x2fc959[_0x477d('0x2e')],_0x2fc959[_0x477d('0x2f')]);_0x537fc4['attributes']=_[_0x477d('0x32')](_0x2fc959['model'],qs[_0x477d('0x33')](_0xe4dd40[_0x477d('0x2f')][_0x477d('0x33')]));_0x537fc4['attributes']=_0x537fc4[_0x477d('0x34')][_0x477d('0x35')]?_0x537fc4[_0x477d('0x34')]:_0x2fc959[_0x477d('0x2e')];if(!_0xe4dd40[_0x477d('0x2f')][_0x477d('0x36')](_0x477d('0x37'))){_0x537fc4[_0x477d('0x1a')]=qs[_0x477d('0x1a')](_0xe4dd40[_0x477d('0x2f')]['limit']);_0x537fc4[_0x477d('0x18')]=qs[_0x477d('0x18')](_0xe4dd40[_0x477d('0x2f')]['offset']);}_0x537fc4[_0x477d('0x38')]=qs[_0x477d('0x39')](_0xe4dd40[_0x477d('0x2f')]['sort']);_0x537fc4['where']=qs[_0x477d('0x31')](_[_0x477d('0x3a')](_0xe4dd40[_0x477d('0x2f')],_0x2fc959[_0x477d('0x31')]),_0x17dd16);if(_0xe4dd40[_0x477d('0x2f')]['filter']){_0x537fc4[_0x477d('0x3b')]=_['merge'](_0x537fc4[_0x477d('0x3b')],{'$or':_[_0x477d('0x28')](_0x17dd16,function(_0x356f41){if(_0x356f41['type']!=='VIRTUAL'){var _0x184d50={};_0x184d50[_0x356f41[_0x477d('0x25')]]={'$like':'%'+_0xe4dd40[_0x477d('0x2f')][_0x477d('0x3c')]+'%'};return _0x184d50;}})});}_0x537fc4=_['merge']({},_0x537fc4,_0xe4dd40[_0x477d('0x3d')]);var _0xc091e={'where':_0x537fc4[_0x477d('0x3b')]};return db[_0x477d('0x29')][_0x477d('0x1b')](_0xc091e)['then'](function(_0x472149){_0xeb02f5[_0x477d('0x1b')]=_0x472149;if(_0xe4dd40['query'][_0x477d('0x3e')]){_0x537fc4['include']=[{'all':!![]}];}return db[_0x477d('0x29')][_0x477d('0x3f')](_0x537fc4);})[_0x477d('0x22')](function(_0x335b2a){_0xeb02f5[_0x477d('0x40')]=_0x335b2a;return _0xeb02f5;})[_0x477d('0x22')](respondWithFilteredResult(_0x37b332,_0x537fc4))[_0x477d('0x41')](handleError(_0x37b332,null));};exports[_0x477d('0x42')]=function(_0x43ffd1,_0x4c22f5){var _0x5759f={'raw':!![],'where':{'id':_0x43ffd1[_0x477d('0x43')]['id']}},_0x31c9a1={};_0x31c9a1[_0x477d('0x2e')]=_['keys'](db['WhatsappApplication'][_0x477d('0x2a')]);_0x31c9a1[_0x477d('0x2f')]=_['keys'](_0x43ffd1[_0x477d('0x2f')]);_0x31c9a1['filters']=_['intersection'](_0x31c9a1[_0x477d('0x2e')],_0x31c9a1[_0x477d('0x2f')]);_0x5759f[_0x477d('0x34')]=_[_0x477d('0x32')](_0x31c9a1[_0x477d('0x2e')],qs[_0x477d('0x33')](_0x43ffd1['query'][_0x477d('0x33')]));_0x5759f[_0x477d('0x34')]=_0x5759f[_0x477d('0x34')][_0x477d('0x35')]?_0x5759f[_0x477d('0x34')]:_0x31c9a1['model'];if(_0x43ffd1['query'][_0x477d('0x3e')]){_0x5759f[_0x477d('0x44')]=[{'all':!![]}];}_0x5759f=_[_0x477d('0x45')]({},_0x5759f,_0x43ffd1['options']);return db[_0x477d('0x29')][_0x477d('0x46')](_0x5759f)[_0x477d('0x22')](handleEntityNotFound(_0x4c22f5,null))[_0x477d('0x22')](respondWithResult(_0x4c22f5,null))[_0x477d('0x41')](handleError(_0x4c22f5,null));};exports[_0x477d('0x47')]=function(_0x13f606,_0x4d4e19){return db[_0x477d('0x29')][_0x477d('0x47')](_0x13f606[_0x477d('0x48')],{})[_0x477d('0x22')](respondWithResult(_0x4d4e19,0xc9))[_0x477d('0x41')](handleError(_0x4d4e19,null));};exports[_0x477d('0x21')]=function(_0x2aad84,_0x30e474){if(_0x2aad84[_0x477d('0x48')]['id']){delete _0x2aad84[_0x477d('0x48')]['id'];}return db[_0x477d('0x29')][_0x477d('0x46')]({'where':{'id':_0x2aad84[_0x477d('0x43')]['id']}})[_0x477d('0x22')](handleEntityNotFound(_0x30e474,null))[_0x477d('0x22')](saveUpdates(_0x2aad84['body'],null))[_0x477d('0x22')](respondWithResult(_0x30e474,null))[_0x477d('0x41')](handleError(_0x30e474,null));};exports['destroy']=function(_0x566ba0,_0x5cb3ca){return db[_0x477d('0x29')][_0x477d('0x46')]({'where':{'id':_0x566ba0[_0x477d('0x43')]['id']}})[_0x477d('0x22')](handleEntityNotFound(_0x5cb3ca,null))[_0x477d('0x22')](removeEntity(_0x5cb3ca,null))[_0x477d('0x41')](handleError(_0x5cb3ca,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 0757afc..2d61c2e 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 _0x2070=['moment','request-promise','path','../../config/environment','./whatsappApplication.attributes','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x1f9edf,_0x17d7c2){var _0x3ab992=function(_0x131a5e){while(--_0x131a5e){_0x1f9edf['push'](_0x1f9edf['shift']());}};_0x3ab992(++_0x17d7c2);}(_0x2070,0x1a2));var _0x0207=function(_0x1cc6d2,_0x74d53){_0x1cc6d2=_0x1cc6d2-0x0;var _0x25a24a=_0x2070[_0x1cc6d2];return _0x25a24a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0207('0x0'))(_0x0207('0x1'));var moment=require(_0x0207('0x2'));var BPromise=require('bluebird');var rp=require(_0x0207('0x3'));var fs=require('fs');var path=require(_0x0207('0x4'));var rimraf=require('rimraf');var config=require(_0x0207('0x5'));var attributes=require(_0x0207('0x6'));module['exports']=function(_0x5573e8,_0x5cf734){return _0x5573e8['define'](_0x0207('0x7'),attributes,{'tableName':_0x0207('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0207('0x9')});}; \ No newline at end of file +var _0xfa2b=['exports','define','WhatsappApplication','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x4d2399,_0x392051){_0x4d2399=_0x4d2399-0x0;var _0x212f0d=_0xfa2b[_0x4d2399];return _0x212f0d;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var logger=require(_0xbfa2('0x2'))(_0xbfa2('0x3'));var moment=require(_0xbfa2('0x4'));var BPromise=require(_0xbfa2('0x5'));var rp=require(_0xbfa2('0x6'));var fs=require('fs');var path=require(_0xbfa2('0x7'));var rimraf=require(_0xbfa2('0x8'));var config=require(_0xbfa2('0x9'));var attributes=require(_0xbfa2('0xa'));module[_0xbfa2('0xb')]=function(_0x12d71e,_0x237a99){return _0x12d71e[_0xbfa2('0xc')](_0xbfa2('0xd'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbfa2('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 34ae3b9..49688fc 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 _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','result'];(function(_0x130526,_0x1a3367){var _0x331c66=function(_0x5bc477){while(--_0x5bc477){_0x130526['push'](_0x130526['shift']());}};_0x331c66(++_0x1a3367);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xf3cd[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file +var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x20a1c4,_0x4ed269){var _0x1315bd=function(_0x49cb71){while(--_0x49cb71){_0x20a1c4['push'](_0x20a1c4['shift']());}};_0x1315bd(++_0x4ed269);}(_0xa41a,0x6b));var _0xaa41=function(_0x206c11,_0x49f687){_0x206c11=_0x206c11-0x0;var _0x5425aa=_0xa41a[_0x206c11];return _0x5425aa;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 956246b..b2ee816 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 _0xb934=['addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','/:id/messages','/:id/download','download','post','create'];(function(_0x54386a,_0x464eaf){var _0x2485bb=function(_0x267ab2){while(--_0x267ab2){_0x54386a['push'](_0x54386a['shift']());}};_0x2485bb(++_0x464eaf);}(_0xb934,0x92));var _0x4b93=function(_0x48ab90,_0x4f5ca2){_0x48ab90=_0x48ab90-0x0;var _0x4452af=_0xb934[_0x48ab90];return _0x4452af;};'use strict';var multer=require(_0x4b93('0x0'));var util=require(_0x4b93('0x1'));var path=require(_0x4b93('0x2'));var timeout=require('connect-timeout');var express=require(_0x4b93('0x3'));var router=express[_0x4b93('0x4')]();var fs_extra=require(_0x4b93('0x5'));var auth=require(_0x4b93('0x6'));var interaction=require(_0x4b93('0x7'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0x4b93('0x8')]('/',auth[_0x4b93('0x9')](),controller[_0x4b93('0xa')]);router[_0x4b93('0x8')]('/describe',auth[_0x4b93('0x9')](),controller[_0x4b93('0xb')]);router[_0x4b93('0x8')](_0x4b93('0xc'),auth[_0x4b93('0x9')](),controller[_0x4b93('0xd')]);router[_0x4b93('0x8')](_0x4b93('0xe'),auth[_0x4b93('0x9')](),controller['getMessages']);router[_0x4b93('0x8')](_0x4b93('0xf'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x10')]);router[_0x4b93('0x11')]('/',auth[_0x4b93('0x9')](),controller[_0x4b93('0x12')]);router[_0x4b93('0x11')](_0x4b93('0xe'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x13')]);router[_0x4b93('0x11')](_0x4b93('0x14'),auth[_0x4b93('0x9')](),interaction[_0x4b93('0x15')]('whatsapp',_0x4b93('0x16')),controller[_0x4b93('0x17')]);router[_0x4b93('0x18')]('/:id',auth[_0x4b93('0x9')](),interaction[_0x4b93('0x15')](_0x4b93('0x19'),_0x4b93('0x1a')),controller[_0x4b93('0x1b')]);router['delete'](_0x4b93('0xc'),auth[_0x4b93('0x9')](),interaction['tracked']('whatsapp',_0x4b93('0x1c')),controller[_0x4b93('0x1d')]);router[_0x4b93('0x1e')](_0x4b93('0x14'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x1f')]);module[_0x4b93('0x20')]=router; \ No newline at end of file +var _0x0309=['whatsappinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','index','get','isAuthenticated','/:id','/:id/messages','/:id/download','download','post','create','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete'];(function(_0xebc2e1,_0x351488){var _0x1cf115=function(_0x7bbcda){while(--_0x7bbcda){_0xebc2e1['push'](_0xebc2e1['shift']());}};_0x1cf115(++_0x351488);}(_0x0309,0x165));var _0x9030=function(_0xd93385,_0x1885f7){_0xd93385=_0xd93385-0x0;var _0x4df629=_0x0309[_0xd93385];return _0x4df629;};'use strict';var multer=require(_0x9030('0x0'));var util=require('util');var path=require(_0x9030('0x1'));var timeout=require('connect-timeout');var express=require(_0x9030('0x2'));var router=express[_0x9030('0x3')]();var fs_extra=require(_0x9030('0x4'));var auth=require(_0x9030('0x5'));var interaction=require(_0x9030('0x6'));var config=require(_0x9030('0x7'));var controller=require(_0x9030('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9030('0x9')]);router[_0x9030('0xa')]('/describe',auth[_0x9030('0xb')](),controller['describe']);router[_0x9030('0xa')](_0x9030('0xc'),auth[_0x9030('0xb')](),controller['show']);router[_0x9030('0xa')](_0x9030('0xd'),auth[_0x9030('0xb')](),controller['getMessages']);router[_0x9030('0xa')](_0x9030('0xe'),auth[_0x9030('0xb')](),controller[_0x9030('0xf')]);router[_0x9030('0x10')]('/',auth[_0x9030('0xb')](),controller[_0x9030('0x11')]);router['post'](_0x9030('0xd'),auth[_0x9030('0xb')](),controller[_0x9030('0x12')]);router[_0x9030('0x10')]('/:id/tags',auth[_0x9030('0xb')](),interaction[_0x9030('0x13')](_0x9030('0x14'),_0x9030('0x15')),controller[_0x9030('0x16')]);router[_0x9030('0x17')](_0x9030('0xc'),auth[_0x9030('0xb')](),interaction[_0x9030('0x13')]('whatsapp',_0x9030('0x18')),controller[_0x9030('0x19')]);router[_0x9030('0x1a')](_0x9030('0xc'),auth[_0x9030('0xb')](),interaction[_0x9030('0x13')](_0x9030('0x14'),_0x9030('0x1b')),controller[_0x9030('0x1c')]);router[_0x9030('0x1a')](_0x9030('0x1d'),auth[_0x9030('0xb')](),controller[_0x9030('0x1e')]);module[_0x9030('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 48478bf..e486ac0 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 _0x35d0=['DATE','STRING','ENUM','out','sequelize','moment','BOOLEAN'];(function(_0x54f3e8,_0x3ed493){var _0x267b37=function(_0x58247e){while(--_0x58247e){_0x54f3e8['push'](_0x54f3e8['shift']());}};_0x267b37(++_0x3ed493);}(_0x35d0,0xf9));var _0x035d=function(_0x285800,_0x26765e){_0x285800=_0x285800-0x0;var _0x4b809e=_0x35d0[_0x285800];return _0x4b809e;};'use strict';var Sequelize=require(_0x035d('0x0'));var moment=require(_0x035d('0x1'));module['exports']={'closed':{'type':Sequelize[_0x035d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x035d('0x3')]},'disposition':{'type':Sequelize[_0x035d('0x4')]},'secondDisposition':{'type':Sequelize[_0x035d('0x4')]},'thirdDisposition':{'type':Sequelize[_0x035d('0x4')]},'note':{'type':Sequelize[_0x035d('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x035d('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x035d('0x5')]('in',_0x035d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x035d('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x035d('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x035d('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xd101=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd101,0xc1));var _0x1d10=function(_0x53de5a,_0x36cf2d){_0x53de5a=_0x53de5a-0x0;var _0x17c567=_0xd101[_0x53de5a];return _0x17c567;};'use strict';var Sequelize=require(_0x1d10('0x0'));var moment=require('moment');module[_0x1d10('0x1')]={'closed':{'type':Sequelize[_0x1d10('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1d10('0x3')]},'disposition':{'type':Sequelize[_0x1d10('0x4')]},'secondDisposition':{'type':Sequelize[_0x1d10('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1d10('0x4')]},'note':{'type':Sequelize[_0x1d10('0x4')]},'phone':{'type':Sequelize[_0x1d10('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x1d10('0x5')]('in',_0x1d10('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1d10('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x1d10('0x5')]('in',_0x1d10('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1d10('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 c034009..1de228a 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 _0x3df4=['firstName','lastName','Attachment','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closed','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','map','fullname','TagIds','Tags','split','forEach','catch','index','WhatsappInteraction','fieldName','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','filters','select','field','color','tools_tags','u.id','ui.WhatsappInteractionId','from','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','type','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','UserId','text','start','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`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)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','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','c.lastName','Contact.lastName','Contact.email','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','length','groupBy','WhatsappInteractionId','push','all','rows','show','params','rawAttributes','include','options','create','describe','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','sort','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','Tag','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','CmContact','Contact'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x3df4,0x102));var _0x43df=function(_0xb359ca,_0x5c3e1a){_0xb359ca=_0xb359ca-0x0;var _0x5ba75f=_0x3df4[_0xb359ca];return _0x5ba75f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x43df('0x0'));var jsonpatch=require(_0x43df('0x1'));var rp=require(_0x43df('0x2'));var moment=require(_0x43df('0x3'));var BPromise=require(_0x43df('0x4'));var Mustache=require(_0x43df('0x5'));var util=require(_0x43df('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x43df('0x7'));var ejs=require(_0x43df('0x8'));var fs=require('fs');var fs_extra=require(_0x43df('0x9'));var _=require(_0x43df('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x43df('0xb'));var deskjs=require(_0x43df('0xc'));var toCsv=require(_0x43df('0x7'));var querystring=require(_0x43df('0xd'));var Papa=require('papaparse');var Redis=require(_0x43df('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x43df('0xf'));var as=require(_0x43df('0x10'));var pdf=require(_0x43df('0x11'));var hardwareService=require(_0x43df('0x12'));var logger=require(_0x43df('0x13'))(_0x43df('0x14'));var utils=require(_0x43df('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x43df('0x16'));var db=require(_0x43df('0x17'))['db'];config['redis']=_[_0x43df('0x18')](config['redis'],{'host':_0x43df('0x19'),'port':0x18eb});var socket=require(_0x43df('0x1a'))(new Redis(config['redis']));require(_0x43df('0x1b'))['register'](socket);function respondWithStatusCode(_0x4a8734,_0x3c4ea1){_0x3c4ea1=_0x3c4ea1||0xcc;return function(_0x3748f2){if(_0x3748f2){return _0x4a8734['sendStatus'](_0x3c4ea1);}return _0x4a8734[_0x43df('0x1c')](_0x3c4ea1)['end']();};}function respondWithResult(_0x3bed20,_0x54965f){_0x54965f=_0x54965f||0xc8;return function(_0x14b258){if(_0x14b258){return _0x3bed20[_0x43df('0x1c')](_0x54965f)[_0x43df('0x1d')](_0x14b258);}};}function respondWithFilteredResult(_0x1b7066,_0x571404){return function(_0x376373){if(_0x376373){var _0x334fae=typeof _0x571404[_0x43df('0x1e')]===_0x43df('0x1f')&&typeof _0x571404['limit']===_0x43df('0x1f');var _0x1e3bc8=_0x376373[_0x43df('0x20')];var _0x4ab87c=_0x334fae?0x0:_0x571404['offset'];var _0x4303c5=_0x334fae?_0x376373[_0x43df('0x20')]:_0x571404['offset']+_0x571404[_0x43df('0x21')];var _0x11aea4;if(_0x4303c5>=_0x1e3bc8){_0x4303c5=_0x1e3bc8;_0x11aea4=0xc8;}else{_0x11aea4=0xce;}_0x1b7066[_0x43df('0x1c')](_0x11aea4);return _0x1b7066['set'](_0x43df('0x22'),_0x4ab87c+'-'+_0x4303c5+'/'+_0x1e3bc8)['json'](_0x376373);}return null;};}function patchUpdates(_0x13b93a){return function(_0x5ec284){try{jsonpatch[_0x43df('0x23')](_0x5ec284,_0x13b93a,!![]);}catch(_0x37ecf9){return BPromise[_0x43df('0x24')](_0x37ecf9);}return _0x5ec284['save']();};}function saveUpdates(_0x228afb,_0x591a8d){return function(_0x252bcb){if(_0x252bcb){return _0x252bcb[_0x43df('0x25')](_0x228afb)[_0x43df('0x26')](function(_0x143123){return _0x143123;});}return null;};}function removeEntity(_0x84521,_0x188937){return function(_0x1a09be){if(_0x1a09be){return _0x1a09be[_0x43df('0x27')]()[_0x43df('0x26')](function(){_0x84521[_0x43df('0x1c')](0xcc)[_0x43df('0x28')]();});}};}function handleEntityNotFound(_0x4ade02,_0x38f9b8){return function(_0x2555ad){if(!_0x2555ad){_0x4ade02[_0x43df('0x29')](0x194);}return _0x2555ad;};}function handleError(_0x29f984,_0x250fda){_0x250fda=_0x250fda||0x1f4;return function(_0x290dae){logger[_0x43df('0x2a')](_0x290dae[_0x43df('0x2b')]);if(_0x290dae[_0x43df('0x2c')]){delete _0x290dae['name'];}_0x29f984['status'](_0x250fda)[_0x43df('0x2d')](_0x290dae);};}function getInteractionUsers(_0x5fdcab,_0x257a57){return new BPromise(function(_0x4665c7,_0x2c6b4d){try{if(_0x257a57[_0x5fdcab['id']]){_0x5fdcab['Users']=_[_0x43df('0x2e')](_0x257a57[_0x5fdcab['id']],function(_0x2b5d9d){return{'id':_0x2b5d9d['id'],'fullname':_0x2b5d9d[_0x43df('0x2f')]};});}}catch(_0x1a480a){_0x2c6b4d(_0x1a480a);}_0x4665c7(_0x5fdcab);});}function getInteractionTags(_0xd7aaf9,_0x228a27){return new BPromise(function(_0x2fe4f5,_0x2b72ef){try{if(_0xd7aaf9[_0x43df('0x30')]){_0xd7aaf9[_0x43df('0x31')]=[];_0xd7aaf9[_0x43df('0x30')][_0x43df('0x32')](',')[_0x43df('0x33')](function(_0x4276c3){_0xd7aaf9['Tags']['push'](_0x228a27[_0x4276c3]);});}delete _0xd7aaf9[_0x43df('0x30')];}catch(_0x59b326){_0x2b72ef(_0x59b326);}_0x2fe4f5(_0xd7aaf9);});}function updateWhatsappInteraction(_0x33bd7d,_0x7823f7,_0x1788ce){return new BPromise(function(_0x1ed18f,_0x4f5a51){return getInteractionUsers(_0x33bd7d,_0x1788ce)[_0x43df('0x26')](function(_0x1c1440){return getInteractionTags(_0x1c1440,_0x7823f7);})[_0x43df('0x26')](function(_0x5071a4){_0x1ed18f(_0x5071a4);})[_0x43df('0x34')](function(_0x24a20e){_0x4f5a51(_0x24a20e);});});}exports[_0x43df('0x35')]=function(_0x197dfe,_0x5bd640){var _0xb5876b={},_0x70e721={},_0x1236df={'count':0x0,'rows':[]};var _0x18466b=_[_0x43df('0x2e')](db[_0x43df('0x36')]['rawAttributes'],function(_0x49ca9a){return{'name':_0x49ca9a[_0x43df('0x37')],'type':_0x49ca9a['type']['key']};});_0x70e721['model']=_['map'](_0x18466b,_0x43df('0x2c'));_0x70e721[_0x43df('0x38')]=_[_0x43df('0x39')](_0x197dfe[_0x43df('0x38')]);_0x70e721['filters']=_[_0x43df('0x3a')](_0x70e721[_0x43df('0x3b')],_0x70e721['query']);_0xb5876b[_0x43df('0x3c')]=_[_0x43df('0x3a')](_0x70e721[_0x43df('0x3b')],qs[_0x43df('0x3d')](_0x197dfe[_0x43df('0x38')][_0x43df('0x3d')]));_0xb5876b['attributes']=_0xb5876b[_0x43df('0x3c')]['length']?_0xb5876b['attributes']:_0x70e721[_0x43df('0x3b')];if(!_0x197dfe[_0x43df('0x38')][_0x43df('0x3e')](_0x43df('0x3f'))){_0xb5876b[_0x43df('0x21')]=qs[_0x43df('0x21')](_0x197dfe['query'][_0x43df('0x21')]);_0xb5876b[_0x43df('0x1e')]=qs[_0x43df('0x1e')](_0x197dfe[_0x43df('0x38')][_0x43df('0x1e')]);}_0xb5876b[_0x43df('0x40')]=qs['sort'](_0x197dfe[_0x43df('0x38')]['sort']);_0xb5876b[_0x43df('0x41')]=qs[_0x43df('0x42')](_['pick'](_0x197dfe[_0x43df('0x38')],_0x70e721[_0x43df('0x42')]),_0x18466b);var _0x233989=[];var _0x309057=squel[_0x43df('0x43')]()[_0x43df('0x44')]('id')[_0x43df('0x44')](_0x43df('0x2c'))[_0x43df('0x44')](_0x43df('0x45'))['from'](_0x43df('0x46'));var _0x581ad8=squel['select']()[_0x43df('0x44')](_0x43df('0x47'))[_0x43df('0x44')]('u.fullname')[_0x43df('0x44')](_0x43df('0x48'))[_0x43df('0x49')](_0x43df('0x4a'),'ui')[_0x43df('0x4b')](_0x43df('0x4c'),'u',_0x43df('0x4d'));var _0x198715=squel[_0x43df('0x43')]()[_0x43df('0x49')](_0x43df('0x4e'),'i')['left_join'](_0x43df('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x43df('0x4b')](_0x43df('0x4c'),'o','o.id\x20=\x20i.UserId')[_0x43df('0x4b')]('whatsapp_accounts','a',_0x43df('0x50'))['left_join'](_0x43df('0x51'),'me',_0x43df('0x52'))[_0x43df('0x4b')](_0x43df('0x53'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x43df('0x4b')](_0x43df('0x46'),'t',_0x43df('0x54'));var _0x572584=squel['expr']();var _0xbd4b54=[];var _0x1ffd31=squel[_0x43df('0x55')]();var _0x4fdd9c;if(_0x197dfe[_0x43df('0x38')][_0x43df('0x56')]){_0x4fdd9c=as[_0x43df('0x57')](_0x197dfe[_0x43df('0x38')][_0x43df('0x56')]);var _0xd81944=_0x4fdd9c[_0x43df('0x58')];for(var _0x38a63c=0x0;_0x38a63c<_0x4fdd9c[_0x43df('0x59')]['length'];_0x38a63c++){var _0x6b7bd2=_0x4fdd9c[_0x43df('0x59')][_0x38a63c];var _0x1aa117='i';var _0x1946f8=_['find'](_0x18466b,[_0x43df('0x2c'),_0x6b7bd2[_0x43df('0x44')]]);if(!_0x1946f8){switch(_0x6b7bd2[_0x43df('0x44')]){case _0x43df('0x5a'):if(_0x6b7bd2[_0x43df('0x5b')]==0x1){_0x198715[_0x43df('0x5c')]('`'+_0x6b7bd2['field']+_0x43df('0x5d'));}else{_0x198715[_0x43df('0x5c')]('`'+_0x6b7bd2['field']+'`\x20>\x200');}break;case'Contact':if(_0x6b7bd2['operator']===_0x43df('0x5e')){if(_0x6b7bd2[_0x43df('0x5b')]['split']('\x20')['length']>0x1){_0x572584[_0xd81944]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x43df('0x5f')](_0x6b7bd2[_0x43df('0x5b')]),null);}else{var _0x1f7b5c='%'+_0x6b7bd2['value']+'%';_0x572584[_0xd81944](_0x43df('0x60'),_0x1f7b5c,_0x1f7b5c,_0x1f7b5c);}}else{_0x1946f8=_['find'](_0x18466b,[_0x43df('0x2c'),'ContactId']);_0x6b7bd2['field']='ContactId';_0x353f7c=as[_0x43df('0x61')](_0x1aa117,_0x1946f8[_0x43df('0x62')],_0x6b7bd2);_0x572584[_0xd81944](_0x353f7c['text'],_0x353f7c[_0x43df('0x5b')]['start'],_0x353f7c[_0x43df('0x5b')][_0x43df('0x28')]);}break;case'Tag':var _0xdf24c1=_0x6b7bd2[_0x43df('0x5b')][_0x43df('0x32')](',')[_0x43df('0x2e')](function(_0x592af1){return Number(_0x592af1);});_0xdf24c1[_0x43df('0x33')](function(_0x349a99){_0x1ffd31['or'](_0x43df('0x63'),'%,'+_0x349a99+',%');});_0xbd4b54=_[_0x43df('0x64')](_0xbd4b54,_0xdf24c1);break;case _0x43df('0x65'):if(_0x6b7bd2[_0x43df('0x66')]===_0x43df('0x5e')){_0x572584[_0xd81944](_0x43df('0x67'),'%'+_0x6b7bd2[_0x43df('0x5b')]+'%',null);}else{_0x1946f8=_[_0x43df('0x68')](_0x18466b,[_0x43df('0x2c'),_0x43df('0x69')]);_0x6b7bd2[_0x43df('0x44')]=_0x43df('0x69');_0x353f7c=as['buildExpression'](_0x1aa117,_0x1946f8['type'],_0x6b7bd2);_0x572584[_0xd81944](_0x353f7c[_0x43df('0x6a')],_0x353f7c['value'][_0x43df('0x6b')],_0x353f7c['value']['end']);}break;case _0x43df('0x6c'):_0x353f7c=as[_0x43df('0x61')]('me',null,_0x6b7bd2);_0x572584[_0xd81944](_0x353f7c[_0x43df('0x6a')],_0x353f7c[_0x43df('0x5b')][_0x43df('0x6b')],_0x353f7c[_0x43df('0x5b')][_0x43df('0x28')]);break;}}else{var _0x353f7c=as['buildExpression'](_0x1aa117,_0x1946f8[_0x43df('0x62')],_0x6b7bd2);_0x572584[_0xd81944](_0x353f7c[_0x43df('0x6a')],_0x353f7c['value'][_0x43df('0x6b')],_0x353f7c[_0x43df('0x5b')][_0x43df('0x28')]);}}}else{var _0x8d0ab8=_(_0x197dfe[_0x43df('0x38')])['keys']()[_0x43df('0x2e')](function(_0x11dcf2){return _[_0x43df('0x6d')](_0x18466b,[_0x43df('0x2c'),_0x11dcf2])?_0x11dcf2:undefined;})[_0x43df('0x6e')]()[_0x43df('0x5b')]();if(!_[_0x43df('0x6f')](_0x8d0ab8)){_0x8d0ab8[_0x43df('0x33')](function(_0x3cbe86){if(_0x3cbe86===_0x43df('0x70')){_0x198715[_0x43df('0x41')](_0x43df('0x71'),[][_0x43df('0x72')](_0x197dfe[_0x43df('0x38')][_0x3cbe86]));}else if(_0x3cbe86===_0x43df('0x73')){var _0x37ba4d=JSON[_0x43df('0x74')](_0x197dfe[_0x43df('0x38')][_0x3cbe86])[_0x43df('0x75')];var _0x387f15=JSON[_0x43df('0x74')](_0x197dfe['query'][_0x3cbe86])[_0x43df('0x76')];_0x198715[_0x43df('0x41')](_0x43df('0x77'),_0x37ba4d,_0x387f15);}else{if(_0x197dfe['query'][_0x3cbe86]===_0x43df('0x78')){_0x198715[_0x43df('0x41')]('i.'+_0x3cbe86+_0x43df('0x79'));}else{_0x198715[_0x43df('0x41')]('i.'+_0x3cbe86+'\x20=\x20?',_0x197dfe[_0x43df('0x38')][_0x3cbe86]);}}});}if(_0x197dfe[_0x43df('0x38')][_0x43df('0x7a')]){if(_0x197dfe['query']['read']==0x1){_0x198715[_0x43df('0x5c')]('`unreadMessages`\x20=\x200');}else{_0x198715['having'](_0x43df('0x7b'));}}if(_0x197dfe['query'][_0x43df('0x7c')]){_0xbd4b54=_[_0x43df('0x7d')](_0x197dfe[_0x43df('0x38')]['tag'])?_0x197dfe[_0x43df('0x38')][_0x43df('0x7c')]:new Array(_0x197dfe[_0x43df('0x38')][_0x43df('0x7c')]);_0xbd4b54[_0x43df('0x33')](function(_0xfedee8){_0x1ffd31['or'](_0x43df('0x63'),'%,'+_0xfedee8+',%');});}if(_0x197dfe[_0x43df('0x38')]['filter']){var _0x12f94a=_0x197dfe[_0x43df('0x38')][_0x43df('0x7e')][_0x43df('0x7f')]('\x5c','\x5c\x5c')[_0x43df('0x7f')](/'/g,'\x27\x27');if(qs[_0x43df('0x80')](_0x12f94a)){_0x572584['or'](_0x43df('0x81'),_0x12f94a+'%')['or'](_0x43df('0x82'),_0x12f94a+'%');}else{_0x572584['or'](_0x43df('0x83'),qs[_0x43df('0x5f')](_0x12f94a))['or'](_0x43df('0x84'),_0x12f94a+'%');}}}_0x198715['where'](_0x572584);_0x198715['group']('i.id');var _0x4745a2={'type':db[_0x43df('0x85')][_0x43df('0x86')][_0x43df('0x87')],'raw':!![]};var _0x512436=_0x198715[_0x43df('0x88')]();_0x512436[_0x43df('0x44')]('i.id');_0x512436[_0x43df('0x44')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0xb5876b[_0x43df('0x40')]){_0xb5876b[_0x43df('0x40')][_0x43df('0x33')](function(_0x36e5c6){var _0x46d62d=_0x36e5c6[0x0]===_0x43df('0x89')?_0x36e5c6[0x0]:'i.'+_0x36e5c6[0x0];_0x198715[_0x43df('0x40')](_0x46d62d,_0x36e5c6[0x1]===_0x43df('0x8a')?![]:!![]);});}if(!_[_0x43df('0x6f')](_0xbd4b54)){_0x198715[_0x43df('0x5c')](_0x1ffd31);_0x512436[_0x43df('0x41')](_0x43df('0x8b'),_0xbd4b54);}BPromise[_0x43df('0x8c')]()[_0x43df('0x26')](function(){if(!_0x4fdd9c){if(_0x197dfe[_0x43df('0x38')][_0x43df('0x70')])return;_0x512436['where'](_0x43df('0x8d'));_0x198715[_0x43df('0x41')](_0x43df('0x8d'));return;}if(_0x197dfe[_0x43df('0x8e')][_0x43df('0x8f')]!==_0x43df('0x90'))return;return _0x197dfe[_0x43df('0x8e')][_0x43df('0x91')]({'attributes':['id'],'raw':!![]})[_0x43df('0x26')](function(_0x3c18c4){if(_[_0x43df('0x6f')](_0x3c18c4)){_0x512436[_0x43df('0x41')](_0x43df('0x92'));_0x198715[_0x43df('0x41')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x512436[_0x43df('0x41')](_0x43df('0x71'),_[_0x43df('0x2e')](_0x3c18c4,'id'));_0x198715[_0x43df('0x41')]('i.WhatsappAccountId\x20IN\x20?',_[_0x43df('0x2e')](_0x3c18c4,'id'));}});})[_0x43df('0x26')](function(){if(_0x197dfe[_0x43df('0x8e')][_0x43df('0x8f')]===_0x43df('0x90')&&!_0x4fdd9c&&!_0x197dfe['query'][_0x43df('0x70')])return[];return db[_0x43df('0x93')][_0x43df('0x38')](_0x512436[_0x43df('0x94')](),_0x4745a2);})[_0x43df('0x26')](function(_0x810298){_0x1236df[_0x43df('0x20')]=_0x810298['length'];if(_0x1236df[_0x43df('0x20')]===0x0)return[];return db['sequelize'][_0x43df('0x38')](_0x309057[_0x43df('0x94')](),_0x4745a2)[_0x43df('0x26')](function(_0x1cf089){_0x233989=_[_0x43df('0x95')](_0x1cf089,'id');_0x4745a2=_[_0x43df('0x96')](_0x4745a2,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x197dfe[_0x43df('0x38')][_0x43df('0x3d')]){_0xb5876b[_0x43df('0x3c')]['forEach'](function(_0x41a03f){_0x198715[_0x43df('0x44')]('i.'+_0x41a03f);});}else{_0x198715[_0x43df('0x44')](_0x43df('0x97'),_0x43df('0x5a'));_0x198715[_0x43df('0x44')](_0x43df('0x98'),'Account.key');_0x198715[_0x43df('0x44')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x198715[_0x43df('0x44')](_0x43df('0x99'),'contactName');_0x198715['field'](_0x43df('0x9a'));_0x198715['field']('c.firstName',_0x43df('0x9b'));_0x198715[_0x43df('0x44')](_0x43df('0x9c'),_0x43df('0x9d'));_0x198715['field']('c.email',_0x43df('0x9e'));_0x198715[_0x43df('0x44')]('c.phone','Contact.phone');_0x198715[_0x43df('0x44')]('c.mobile','Contact.mobile');_0x198715[_0x43df('0x44')](_0x43df('0x9f'),_0x43df('0xa0'));_0x198715['field'](_0x43df('0xa1'),_0x43df('0xa2'));_0x198715[_0x43df('0x44')](_0x43df('0xa3'),_0x43df('0xa4'));_0x198715[_0x43df('0x44')](_0x43df('0xa5'),'TagIds');}if(_0xb5876b['limit'])_0x198715[_0x43df('0x21')](_0xb5876b[_0x43df('0x21')]);if(_0xb5876b[_0x43df('0x1e')])_0x198715[_0x43df('0x1e')](_0xb5876b[_0x43df('0x1e')]);return db[_0x43df('0x93')][_0x43df('0x38')](_0x198715['toString'](),_0x4745a2);})['then'](function(_0x38c4cd){if(_0x38c4cd[_0x43df('0xa6')]>0x0)_0x581ad8[_0x43df('0x41')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0x43df('0x2e')](_0x38c4cd,'id'));return db[_0x43df('0x93')][_0x43df('0x38')](_0x581ad8[_0x43df('0x94')](),_0x4745a2)[_0x43df('0x26')](function(_0x59886b){var _0x3b64e2=_[_0x43df('0xa7')](_0x59886b,_0x43df('0xa8'));var _0x38c35c=[];_0x38c4cd[_0x43df('0x33')](function(_0x3301c9){_0x38c35c[_0x43df('0xa9')](updateWhatsappInteraction(_0x3301c9,_0x233989,_0x3b64e2));});return BPromise[_0x43df('0xaa')](_0x38c35c);});});})[_0x43df('0x26')](function(_0x1725fa){_0x1236df[_0x43df('0xab')]=_0x1725fa;return _0x1236df;})[_0x43df('0x26')](respondWithFilteredResult(_0x5bd640,_0xb5876b))[_0x43df('0x34')](handleError(_0x5bd640,null));};exports[_0x43df('0xac')]=function(_0x425d41,_0x3ec588){var _0x2400fc={'raw':![],'where':{'id':_0x425d41[_0x43df('0xad')]['id']}},_0x3d65d4={};_0x3d65d4[_0x43df('0x3b')]=_[_0x43df('0x39')](db[_0x43df('0x36')][_0x43df('0xae')]);_0x3d65d4[_0x43df('0x38')]=_[_0x43df('0x39')](_0x425d41[_0x43df('0x38')]);_0x3d65d4[_0x43df('0x42')]=_['intersection'](_0x3d65d4['model'],_0x3d65d4['query']);_0x2400fc[_0x43df('0x3c')]=_[_0x43df('0x3a')](_0x3d65d4[_0x43df('0x3b')],qs['fields'](_0x425d41[_0x43df('0x38')]['fields']));_0x2400fc[_0x43df('0x3c')]=_0x2400fc['attributes'][_0x43df('0xa6')]?_0x2400fc[_0x43df('0x3c')]:_0x3d65d4[_0x43df('0x3b')];if(_0x425d41[_0x43df('0x38')]['includeAll']){_0x2400fc[_0x43df('0xaf')]=[{'all':!![]}];}_0x2400fc=_[_0x43df('0x96')]({},_0x2400fc,_0x425d41[_0x43df('0xb0')]);return db['WhatsappInteraction'][_0x43df('0x68')](_0x2400fc)[_0x43df('0x26')](handleEntityNotFound(_0x3ec588,null))[_0x43df('0x26')](respondWithResult(_0x3ec588,null))['catch'](handleError(_0x3ec588,null));};exports[_0x43df('0xb1')]=function(_0x3d1c79,_0x51de32){return db[_0x43df('0x36')][_0x43df('0xb1')](_0x3d1c79[_0x43df('0x6c')],{})['then'](respondWithResult(_0x51de32,0xc9))[_0x43df('0x34')](handleError(_0x51de32,null));};exports[_0x43df('0x25')]=function(_0x4cf2c1,_0x3a5501){if(_0x4cf2c1[_0x43df('0x6c')]['id']){delete _0x4cf2c1['body']['id'];}return db[_0x43df('0x36')][_0x43df('0x68')]({'where':{'id':_0x4cf2c1['params']['id']}})[_0x43df('0x26')](handleEntityNotFound(_0x3a5501,null))[_0x43df('0x26')](saveUpdates(_0x4cf2c1[_0x43df('0x6c')],null))['then'](respondWithResult(_0x3a5501,null))[_0x43df('0x34')](handleError(_0x3a5501,null));};exports[_0x43df('0x27')]=function(_0x1c3f3d,_0x3027ce){return db[_0x43df('0x36')][_0x43df('0x68')]({'where':{'id':_0x1c3f3d[_0x43df('0xad')]['id']}})['then'](handleEntityNotFound(_0x3027ce,null))[_0x43df('0x26')](removeEntity(_0x3027ce,null))['catch'](handleError(_0x3027ce,null));};exports[_0x43df('0xb2')]=function(_0x5d9078,_0x427a0c){return db[_0x43df('0x36')]['describe']()[_0x43df('0x26')](respondWithResult(_0x427a0c,null))['catch'](handleError(_0x427a0c,null));};exports[_0x43df('0xb3')]=function(_0x4646b1,_0xf94f7c,_0xda5cf2){return db[_0x43df('0xb4')]['find']({'where':{'id':_0x4646b1[_0x43df('0xad')]['id']}})[_0x43df('0x26')](handleEntityNotFound(_0xf94f7c,null))[_0x43df('0x26')](function(_0x153116){if(_0x153116){return _0x153116[_0x43df('0xb3')](_0x4646b1[_0x43df('0x6c')]['ids'],_[_0x43df('0xb5')](_0x4646b1['body'],[_0x43df('0xb6'),'id'])||{});}})['then'](respondWithResult(_0xf94f7c,null))[_0x43df('0x34')](handleError(_0xf94f7c,null));};exports[_0x43df('0xb7')]=function(_0x5d87ab,_0x58e87c,_0x3294b1){var _0x15d95c={'raw':![],'where':{}};var _0xf3a79={};var _0x2bb7c4={'count':0x0,'rows':[]};return db[_0x43df('0x36')][_0x43df('0xb8')]({'where':{'id':_0x5d87ab['params']['id']}})[_0x43df('0x26')](handleEntityNotFound(_0x58e87c,null))[_0x43df('0x26')](function(_0x19bf5f){if(_0x19bf5f){_0xf3a79[_0x43df('0x3b')]=_[_0x43df('0x39')](db['WhatsappMessage'][_0x43df('0xae')]);_0xf3a79[_0x43df('0x38')]=_[_0x43df('0x39')](_0x5d87ab[_0x43df('0x38')]);_0xf3a79[_0x43df('0x42')]=_['intersection'](_0xf3a79[_0x43df('0x3b')],_0xf3a79[_0x43df('0x38')]);_0x15d95c['attributes']=_[_0x43df('0x3a')](_0xf3a79['model'],qs[_0x43df('0x3d')](_0x5d87ab[_0x43df('0x38')][_0x43df('0x3d')]));_0x15d95c[_0x43df('0x3c')]=_0x15d95c['attributes'][_0x43df('0xa6')]?_0x15d95c[_0x43df('0x3c')]:_0xf3a79['model'];if(!_0x5d87ab['query']['hasOwnProperty'](_0x43df('0x3f'))){_0x15d95c[_0x43df('0x21')]=qs[_0x43df('0x21')](_0x5d87ab[_0x43df('0x38')][_0x43df('0x21')]);_0x15d95c['offset']=qs['offset'](_0x5d87ab[_0x43df('0x38')][_0x43df('0x1e')]);}_0x15d95c[_0x43df('0x40')]=qs['sort'](_0x5d87ab[_0x43df('0x38')][_0x43df('0xb9')]);_0x15d95c[_0x43df('0x41')]=qs[_0x43df('0x42')](_[_0x43df('0xba')](_0x5d87ab[_0x43df('0x38')],_0xf3a79['filters']));_0x15d95c[_0x43df('0x41')]['WhatsappInteractionId']=_0x19bf5f['id'];if(_0x5d87ab[_0x43df('0x38')][_0x43df('0x7e')]){_0x15d95c[_0x43df('0x41')]=_[_0x43df('0x96')](_0x15d95c[_0x43df('0x41')],{'$or':_['map'](_0x15d95c[_0x43df('0x3c')],function(_0x525b0b){var _0x23e810={};_0x23e810[_0x525b0b]={'$like':'%'+_0x5d87ab['query'][_0x43df('0x7e')]+'%'};return _0x23e810;})});}if(_0x5d87ab[_0x43df('0x38')][_0x43df('0x75')]){var _0x19072c=_0x5d87ab[_0x43df('0x38')]['$gte'][_0x43df('0x32')](',');var _0x266fa8={};_0x266fa8[_0x19072c[0x0]]={'$gte':moment(_0x19072c[0x1])[_0x43df('0xbb')](_0x43df('0xbc'))};_0x15d95c[_0x43df('0x41')]=_[_0x43df('0x96')](_0x15d95c['where'],_0x266fa8);}_0x15d95c=_['merge']({},_0x15d95c,_0x5d87ab['options']);return db[_0x43df('0xb4')][_0x43df('0x20')]({'where':_0x15d95c['where']})[_0x43df('0x26')](function(_0x26041c){_0x2bb7c4['count']=_0x26041c;if(_0x5d87ab[_0x43df('0x38')]['includeAll']){_0x15d95c['include']=[{'all':!![]}];}return db[_0x43df('0xb4')][_0x43df('0xbd')](_0x15d95c);})['then'](function(_0x4e409f){_0x2bb7c4[_0x43df('0xab')]=_0x4e409f;return _0x2bb7c4;});}})[_0x43df('0x26')](respondWithFilteredResult(_0x58e87c,_0x15d95c))[_0x43df('0x34')](handleError(_0x58e87c,null));};exports[_0x43df('0xbe')]=function(_0x410fa3,_0x2bcb03,_0x19f81d){return db['WhatsappInteraction'][_0x43df('0x68')]({'where':{'id':_0x410fa3[_0x43df('0xad')]['id']}})['then'](handleEntityNotFound(_0x2bcb03,null))['then'](function(_0x4443f7){if(_0x4443f7){return _0x4443f7['setTags'](_0x410fa3[_0x43df('0x6c')]['ids'],_[_0x43df('0xb5')](_0x410fa3['body'],['ids','id'])||{})['spread'](function(){return db[_0x43df('0xbf')][_0x43df('0xbd')]({'attributes':['id',_0x43df('0x2c'),'color'],'where':{'id':_0x410fa3[_0x43df('0x6c')]['ids']}});})[_0x43df('0x26')](function(_0xd38455){socket[_0x43df('0xc0')](_0x43df('0xc1'),{'id':Number(_0x410fa3[_0x43df('0xad')]['id']),'tags':_0xd38455||[]});return{'id':Number(_0x410fa3[_0x43df('0xad')]['id']),'tags':_0xd38455||[]};});}})['then'](respondWithResult(_0x2bcb03,null))[_0x43df('0x34')](handleError(_0x2bcb03,null));};exports[_0x43df('0xc2')]=function(_0xf6b983,_0x4a8ba0,_0x2f8cfe){return db[_0x43df('0x36')]['find']({'where':{'id':_0xf6b983[_0x43df('0xad')]['id']}})['then'](handleEntityNotFound(_0x4a8ba0,null))[_0x43df('0x26')](function(_0x3fb870){if(_0x3fb870){return _0x3fb870['removeTags'](_0xf6b983[_0x43df('0x38')]['ids']);}})[_0x43df('0x26')](respondWithStatusCode(_0x4a8ba0,null))[_0x43df('0x34')](handleError(_0x4a8ba0,null));};exports[_0x43df('0xc3')]=function(_0x454d63,_0x3c459b){var _0x2f235d=moment()[_0x43df('0xc4')]()[_0x43df('0x94')]();var _0x9b3642=path[_0x43df('0xc5')](config[_0x43df('0xc6')],_0x43df('0xc7'),_0x43df('0xc8'),'tmp');var _0x4a0d87=path[_0x43df('0xc5')](config['root'],'server','files',_0x43df('0xc9'));var _0x33258c=path[_0x43df('0xc5')](_0x9b3642,_0x2f235d);var _0x937e66=util['format']('transcript-%d-%s.zip',_0x454d63['params']['id'],_0x2f235d);var _0x4f7c9a=path[_0x43df('0xc5')](_0x9b3642,_0x937e66);var _0x2b1def=[];_0x2b1def[_0x43df('0xa9')]({'model':db[_0x43df('0x65')],'as':'User','attributes':['id',_0x43df('0x2f')],'raw':!![]});_0x2b1def[_0x43df('0xa9')]({'model':db[_0x43df('0xca')],'as':_0x43df('0xcb'),'attributes':['id',_0x43df('0xcc'),_0x43df('0xcd')],'raw':!![]});if(_0x454d63[_0x43df('0x38')]['attachments']){_0x2b1def[_0x43df('0xa9')]({'model':db[_0x43df('0xce')],'as':_0x43df('0xce'),'raw':!![]});}var _0x57e01d=[{'model':db[_0x43df('0xb4')],'as':'Messages','attributes':['id',_0x43df('0x6c'),_0x43df('0x73'),_0x43df('0xcf'),_0x43df('0xd0'),_0x43df('0x7a')],'include':_0x2b1def}];_0x57e01d[_0x43df('0xa9')]({'model':db[_0x43df('0xd1')],'as':_0x43df('0xd2'),'attributes':['id',_0x43df('0x2c')]});_0x57e01d['push']({'model':db[_0x43df('0x65')],'as':_0x43df('0xd3'),'attributes':['id',_0x43df('0x2f')]});return db[_0x43df('0x36')]['find']({'where':{'id':_0x454d63['params']['id']},'include':_0x57e01d})[_0x43df('0x26')](handleEntityNotFound(_0x3c459b,null))[_0x43df('0x26')](function(_0xf77467){if(_0xf77467){var _0x411902=_0xf77467[_0x43df('0xd4')]({'plain':!![]});fs[_0x43df('0xd5')](_0x33258c);var _0xb59569={'channel':_0x43df('0xd6'),'account':_0x411902[_0x43df('0xd2')]['name'],'agent':_0x411902[_0x43df('0xd3')]?_0x411902['Owner'][_0x43df('0x2f')]:_0x43df('0xd7'),'createdAt':moment(_0x411902[_0x43df('0x73')])[_0x43df('0xbb')](_0x43df('0xbc'))[_0x43df('0x94')](),'closedAt':_0x411902[_0x43df('0xd8')]?moment(_0x411902['closedAt'])['format'](_0x43df('0xbc'))['toString']():'','disposition':_0x411902['disposition'],'messages':_(_0x411902[_0x43df('0xd9')])[_0x43df('0x7e')]({'secret':![]})[_0x43df('0x2e')](function(_0x214fef){if(_0x214fef['Attachment']){var _0x5d7505=path[_0x43df('0xc5')](_0x4a0d87,_0x214fef[_0x43df('0xce')][_0x43df('0xda')]);if(fs[_0x43df('0xdb')](_0x5d7505)){fs[_0x43df('0xdc')](_0x5d7505)[_0x43df('0xdd')](fs[_0x43df('0xde')](path[_0x43df('0xc5')](_0x33258c,_0x214fef[_0x43df('0xce')]['basename'])));}}return{'date':moment(_0x214fef[_0x43df('0x73')])[_0x43df('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')[_0x43df('0x94')](),'sender':_0x214fef['direction']===_0x43df('0xdf')?_0x214fef[_0x43df('0x65')]?_0x214fef[_0x43df('0x65')][_0x43df('0x2f')]:_0x43df('0xe0'):_0x214fef[_0x43df('0xcb')][_0x43df('0xcc')]+(_0x214fef[_0x43df('0xcb')][_0x43df('0xcd')]?'\x20'+_0x214fef['Contact'][_0x43df('0xcd')]:''),'body':_0x214fef[_0x43df('0xce')]?_0x214fef['Attachment'][_0x43df('0xda')]:_0x214fef[_0x43df('0x6c')],'direction':_0x214fef[_0x43df('0xcf')]===_0x43df('0xdf')?'A':'C','secret':_0x214fef[_0x43df('0xd0')],'read':_0x214fef[_0x43df('0x7a')],'attachment':_0x214fef['Attachment']};})[_0x43df('0x5b')]()};return ejs['renderFile'](path['join'](config[_0x43df('0xc6')],_0x43df('0xc7'),_0x43df('0xe1'),_0x43df('0xe2')),{'interaction':_0xb59569})[_0x43df('0x26')](function(_0x5a9c74){var _0x1de95e=path[_0x43df('0xc5')](_0x33258c,_0x43df('0xe3')+_0x411902['id']+'-'+_0x2f235d+_0x43df('0xe4'));var _0x12fe78={'path':_0x1de95e,'channel':_0x43df('0xd6'),'interactionId':_0x411902['id']};return pdf[_0x43df('0xe5')](_0x5a9c74,_0x12fe78);})[_0x43df('0x26')](function(){return new BPromise(function(_0x1ba5f6,_0x2bfb86){zipdir(_0x33258c,{'saveTo':_0x4f7c9a},function(_0x4f24f3,_0x5bb877){if(_0x4f24f3)return _0x2bfb86(_0x4f24f3);return _0x1ba5f6(_0x5bb877);});})[_0x43df('0x26')](function(){return new BPromise(function(_0xcbd5b7,_0x5aea61){rimraf(_0x33258c,function(_0x1c4628){if(_0x1c4628)_0x5aea61(_0x1c4628);return _0xcbd5b7();});});})[_0x43df('0x26')](function(){return _0x3c459b[_0x43df('0xc3')](_0x4f7c9a,_0x937e66,function(_0x3f09ba){if(_0x3f09ba){console['log']('err',_0x3f09ba);}else{fs[_0x43df('0xe6')](_0x4f7c9a);}});});});}else{return _0x3c459b['sendStatus'](0xc8);}})[_0x43df('0x34')](handleError(_0x3c459b,null));}; \ No newline at end of file +var _0x410d=['attachments','transcript-%d-%s.zip','User','CmContact','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','basename','existsSync','createReadStream','pipe','out','System','renderFile','root','views','transcript-','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','request-promise','bluebird','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','defaults','redis','localhost','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','forEach','Tags','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','Contact','operator','$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?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','QueryTypes','SELECT','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','push','all','rows','show','WhatsappInteraction','includeAll','include','catch','create','params','describe','addMessage','ids','omit','findOne','WhatsappMessage','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','emit','whatsappInteractionTags:save','removeTags','download','files','tmp','join','server'];(function(_0x28823a,_0x2bc303){var _0x53f5f8=function(_0x5c96f5){while(--_0x5c96f5){_0x28823a['push'](_0x28823a['shift']());}};_0x53f5f8(++_0x2bc303);}(_0x410d,0x106));var _0xd410=function(_0xac0de1,_0x12d3d9){_0xac0de1=_0xac0de1-0x0;var _0x1c1995=_0x410d[_0xac0de1];return _0x1c1995;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd410('0x0'));var zipdir=require(_0xd410('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd410('0x2'));var moment=require('moment');var BPromise=require(_0xd410('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd410('0x4'));var sox=require(_0xd410('0x5'));var csv=require('to-csv');var ejs=require(_0xd410('0x6'));var fs=require('fs');var fs_extra=require(_0xd410('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd410('0x8'));var jsforce=require(_0xd410('0x9'));var deskjs=require(_0xd410('0xa'));var toCsv=require(_0xd410('0xb'));var querystring=require(_0xd410('0xc'));var Papa=require(_0xd410('0xd'));var Redis=require('ioredis');var authService=require(_0xd410('0xe'));var qs=require(_0xd410('0xf'));var as=require(_0xd410('0x10'));var pdf=require(_0xd410('0x11'));var hardwareService=require(_0xd410('0x12'));var logger=require(_0xd410('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd410('0x14'));var db=require(_0xd410('0x15'))['db'];config['redis']=_[_0xd410('0x16')](config[_0xd410('0x17')],{'host':_0xd410('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd410('0x17')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x50d7a9,_0x1da901){_0x1da901=_0x1da901||0xcc;return function(_0x4f8bcd){if(_0x4f8bcd){return _0x50d7a9[_0xd410('0x19')](_0x1da901);}return _0x50d7a9[_0xd410('0x1a')](_0x1da901)[_0xd410('0x1b')]();};}function respondWithResult(_0x5ce054,_0x3ee4d3){_0x3ee4d3=_0x3ee4d3||0xc8;return function(_0x31f8b3){if(_0x31f8b3){return _0x5ce054[_0xd410('0x1a')](_0x3ee4d3)[_0xd410('0x1c')](_0x31f8b3);}};}function respondWithFilteredResult(_0x2cccfe,_0x1d1676){return function(_0x3d97f3){if(_0x3d97f3){var _0x5aadec=typeof _0x1d1676['offset']==='undefined'&&typeof _0x1d1676[_0xd410('0x1d')]===_0xd410('0x1e');var _0x2e32f5=_0x3d97f3[_0xd410('0x1f')];var _0x3fd02e=_0x5aadec?0x0:_0x1d1676['offset'];var _0x3a779c=_0x5aadec?_0x3d97f3['count']:_0x1d1676[_0xd410('0x20')]+_0x1d1676[_0xd410('0x1d')];var _0x237d80;if(_0x3a779c>=_0x2e32f5){_0x3a779c=_0x2e32f5;_0x237d80=0xc8;}else{_0x237d80=0xce;}_0x2cccfe[_0xd410('0x1a')](_0x237d80);return _0x2cccfe[_0xd410('0x21')](_0xd410('0x22'),_0x3fd02e+'-'+_0x3a779c+'/'+_0x2e32f5)[_0xd410('0x1c')](_0x3d97f3);}return null;};}function patchUpdates(_0x1d4d90){return function(_0x422b33){try{jsonpatch[_0xd410('0x23')](_0x422b33,_0x1d4d90,!![]);}catch(_0x119e72){return BPromise[_0xd410('0x24')](_0x119e72);}return _0x422b33[_0xd410('0x25')]();};}function saveUpdates(_0xad347f,_0x255a9c){return function(_0x4a85b6){if(_0x4a85b6){return _0x4a85b6[_0xd410('0x26')](_0xad347f)[_0xd410('0x27')](function(_0x2369b7){return _0x2369b7;});}return null;};}function removeEntity(_0x36f2af,_0x46e59a){return function(_0xbc663a){if(_0xbc663a){return _0xbc663a[_0xd410('0x28')]()[_0xd410('0x27')](function(){_0x36f2af[_0xd410('0x1a')](0xcc)[_0xd410('0x1b')]();});}};}function handleEntityNotFound(_0x171912,_0x1228cf){return function(_0x4ea412){if(!_0x4ea412){_0x171912['sendStatus'](0x194);}return _0x4ea412;};}function handleError(_0x2793b4,_0x306742){_0x306742=_0x306742||0x1f4;return function(_0x2394cc){logger[_0xd410('0x29')](_0x2394cc[_0xd410('0x2a')]);if(_0x2394cc[_0xd410('0x2b')]){delete _0x2394cc['name'];}_0x2793b4[_0xd410('0x1a')](_0x306742)[_0xd410('0x2c')](_0x2394cc);};}function getInteractionUsers(_0x637eb6,_0x31eb17){return new BPromise(function(_0x1cc6dc,_0x44b9cf){try{if(_0x31eb17[_0x637eb6['id']]){_0x637eb6[_0xd410('0x2d')]=_[_0xd410('0x2e')](_0x31eb17[_0x637eb6['id']],function(_0x4295a6){return{'id':_0x4295a6['id'],'fullname':_0x4295a6[_0xd410('0x2f')]};});}}catch(_0x2fe833){_0x44b9cf(_0x2fe833);}_0x1cc6dc(_0x637eb6);});}function getInteractionTags(_0x672576,_0x22e4e0){return new BPromise(function(_0x274b29,_0x897ba2){try{if(_0x672576['TagIds']){_0x672576['Tags']=[];_0x672576[_0xd410('0x30')]['split'](',')[_0xd410('0x31')](function(_0x3b026b){_0x672576[_0xd410('0x32')]['push'](_0x22e4e0[_0x3b026b]);});}delete _0x672576[_0xd410('0x30')];}catch(_0x3c3359){_0x897ba2(_0x3c3359);}_0x274b29(_0x672576);});}function updateWhatsappInteraction(_0x342469,_0x391e2f,_0x18fa50){return new BPromise(function(_0x37706a,_0x3cdb55){return getInteractionUsers(_0x342469,_0x18fa50)['then'](function(_0xe89837){return getInteractionTags(_0xe89837,_0x391e2f);})[_0xd410('0x27')](function(_0x56ba40){_0x37706a(_0x56ba40);})['catch'](function(_0x4c46d9){_0x3cdb55(_0x4c46d9);});});}exports[_0xd410('0x33')]=function(_0x5a5dae,_0x90aea0){var _0x16e487={},_0x5a3863={},_0x56bec1={'count':0x0,'rows':[]};var _0x2e8e62=_[_0xd410('0x2e')](db['WhatsappInteraction'][_0xd410('0x34')],function(_0x43eaa1){return{'name':_0x43eaa1[_0xd410('0x35')],'type':_0x43eaa1[_0xd410('0x36')][_0xd410('0x37')]};});_0x5a3863[_0xd410('0x38')]=_['map'](_0x2e8e62,_0xd410('0x2b'));_0x5a3863[_0xd410('0x39')]=_[_0xd410('0x3a')](_0x5a5dae[_0xd410('0x39')]);_0x5a3863[_0xd410('0x3b')]=_[_0xd410('0x3c')](_0x5a3863['model'],_0x5a3863[_0xd410('0x39')]);_0x16e487[_0xd410('0x3d')]=_[_0xd410('0x3c')](_0x5a3863[_0xd410('0x38')],qs[_0xd410('0x3e')](_0x5a5dae[_0xd410('0x39')][_0xd410('0x3e')]));_0x16e487[_0xd410('0x3d')]=_0x16e487[_0xd410('0x3d')][_0xd410('0x3f')]?_0x16e487[_0xd410('0x3d')]:_0x5a3863[_0xd410('0x38')];if(!_0x5a5dae[_0xd410('0x39')][_0xd410('0x40')](_0xd410('0x41'))){_0x16e487[_0xd410('0x1d')]=qs[_0xd410('0x1d')](_0x5a5dae[_0xd410('0x39')][_0xd410('0x1d')]);_0x16e487['offset']=qs[_0xd410('0x20')](_0x5a5dae[_0xd410('0x39')][_0xd410('0x20')]);}_0x16e487[_0xd410('0x42')]=qs[_0xd410('0x43')](_0x5a5dae[_0xd410('0x39')]['sort']);_0x16e487[_0xd410('0x44')]=qs[_0xd410('0x3b')](_[_0xd410('0x45')](_0x5a5dae[_0xd410('0x39')],_0x5a3863[_0xd410('0x3b')]),_0x2e8e62);var _0xa175c=[];var _0x3716d7=squel[_0xd410('0x46')]()[_0xd410('0x47')]('id')[_0xd410('0x47')](_0xd410('0x2b'))['field'](_0xd410('0x48'))[_0xd410('0x49')](_0xd410('0x4a'));var _0x518755=squel['select']()[_0xd410('0x47')]('u.id')['field'](_0xd410('0x4b'))[_0xd410('0x47')](_0xd410('0x4c'))[_0xd410('0x49')](_0xd410('0x4d'),'ui')['left_join'](_0xd410('0x4e'),'u',_0xd410('0x4f'));var _0x231e33=squel[_0xd410('0x46')]()[_0xd410('0x49')]('whatsapp_interactions','i')[_0xd410('0x50')](_0xd410('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xd410('0x50')](_0xd410('0x4e'),'o',_0xd410('0x52'))[_0xd410('0x50')]('whatsapp_accounts','a',_0xd410('0x53'))[_0xd410('0x50')]('whatsapp_messages','me','me.WhatsappInteractionId\x20=\x20i.id')[_0xd410('0x50')](_0xd410('0x54'),'it',_0xd410('0x55'))[_0xd410('0x50')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x4438a8=squel[_0xd410('0x56')]();var _0x3c5689=[];var _0x1b916b=squel[_0xd410('0x56')]();var _0x23c92c;if(_0x5a5dae[_0xd410('0x39')][_0xd410('0x57')]){_0x23c92c=as[_0xd410('0x58')](_0x5a5dae[_0xd410('0x39')][_0xd410('0x57')]);var _0x67ff86=_0x23c92c[_0xd410('0x59')];for(var _0x4d3e36=0x0;_0x4d3e36<_0x23c92c[_0xd410('0x5a')][_0xd410('0x3f')];_0x4d3e36++){var _0x10acb1=_0x23c92c[_0xd410('0x5a')][_0x4d3e36];var _0xb89e6f='i';var _0x1352c2=_['find'](_0x2e8e62,[_0xd410('0x2b'),_0x10acb1[_0xd410('0x47')]]);if(!_0x1352c2){switch(_0x10acb1[_0xd410('0x47')]){case _0xd410('0x5b'):if(_0x10acb1[_0xd410('0x5c')]==0x1){_0x231e33[_0xd410('0x5d')]('`'+_0x10acb1[_0xd410('0x47')]+'`\x20=\x200');}else{_0x231e33[_0xd410('0x5d')]('`'+_0x10acb1[_0xd410('0x47')]+_0xd410('0x5e'));}break;case _0xd410('0x5f'):if(_0x10acb1[_0xd410('0x60')]===_0xd410('0x61')){if(_0x10acb1['value'][_0xd410('0x62')]('\x20')[_0xd410('0x3f')]>0x1){_0x4438a8[_0x67ff86](_0xd410('0x63'),qs[_0xd410('0x64')](_0x10acb1[_0xd410('0x5c')]),null);}else{var _0x529aff='%'+_0x10acb1[_0xd410('0x5c')]+'%';_0x4438a8[_0x67ff86](_0xd410('0x65'),_0x529aff,_0x529aff,_0x529aff);}}else{_0x1352c2=_[_0xd410('0x66')](_0x2e8e62,[_0xd410('0x2b'),_0xd410('0x67')]);_0x10acb1[_0xd410('0x47')]='ContactId';_0x230ea2=as[_0xd410('0x68')](_0xb89e6f,_0x1352c2['type'],_0x10acb1);_0x4438a8[_0x67ff86](_0x230ea2[_0xd410('0x69')],_0x230ea2[_0xd410('0x5c')][_0xd410('0x6a')],_0x230ea2[_0xd410('0x5c')]['end']);}break;case _0xd410('0x6b'):var _0x59112a=_0x10acb1[_0xd410('0x5c')][_0xd410('0x62')](',')[_0xd410('0x2e')](function(_0x221682){return Number(_0x221682);});_0x59112a['forEach'](function(_0x9302e5){_0x1b916b['or'](_0xd410('0x6c'),'%,'+_0x9302e5+',%');});_0x3c5689=_['union'](_0x3c5689,_0x59112a);break;case'User':if(_0x10acb1[_0xd410('0x60')]==='$substring'){_0x4438a8[_0x67ff86](_0xd410('0x6d'),'%'+_0x10acb1[_0xd410('0x5c')]+'%',null);}else{_0x1352c2=_['find'](_0x2e8e62,['name',_0xd410('0x6e')]);_0x10acb1['field']=_0xd410('0x6e');_0x230ea2=as[_0xd410('0x68')](_0xb89e6f,_0x1352c2[_0xd410('0x36')],_0x10acb1);_0x4438a8[_0x67ff86](_0x230ea2[_0xd410('0x69')],_0x230ea2['value'][_0xd410('0x6a')],_0x230ea2[_0xd410('0x5c')]['end']);}break;case _0xd410('0x6f'):_0x230ea2=as[_0xd410('0x68')]('me',null,_0x10acb1);_0x4438a8[_0x67ff86](_0x230ea2[_0xd410('0x69')],_0x230ea2[_0xd410('0x5c')][_0xd410('0x6a')],_0x230ea2[_0xd410('0x5c')]['end']);break;}}else{var _0x230ea2=as['buildExpression'](_0xb89e6f,_0x1352c2[_0xd410('0x36')],_0x10acb1);_0x4438a8[_0x67ff86](_0x230ea2[_0xd410('0x69')],_0x230ea2['value'][_0xd410('0x6a')],_0x230ea2['value']['end']);}}}else{var _0x4bcc93=_(_0x5a5dae['query'])[_0xd410('0x3a')]()[_0xd410('0x2e')](function(_0x17f8b5){return _[_0xd410('0x70')](_0x2e8e62,[_0xd410('0x2b'),_0x17f8b5])?_0x17f8b5:undefined;})['compact']()[_0xd410('0x5c')]();if(!_[_0xd410('0x71')](_0x4bcc93)){_0x4bcc93[_0xd410('0x31')](function(_0x2a4ec2){if(_0x2a4ec2===_0xd410('0x72')){_0x231e33[_0xd410('0x44')](_0xd410('0x73'),[][_0xd410('0x74')](_0x5a5dae[_0xd410('0x39')][_0x2a4ec2]));}else if(_0x2a4ec2===_0xd410('0x75')){var _0x1daac7=JSON[_0xd410('0x76')](_0x5a5dae[_0xd410('0x39')][_0x2a4ec2])[_0xd410('0x77')];var _0x5cec58=JSON[_0xd410('0x76')](_0x5a5dae[_0xd410('0x39')][_0x2a4ec2])[_0xd410('0x78')];_0x231e33[_0xd410('0x44')](_0xd410('0x79'),_0x1daac7,_0x5cec58);}else{if(_0x5a5dae[_0xd410('0x39')][_0x2a4ec2]==='null'){_0x231e33[_0xd410('0x44')]('i.'+_0x2a4ec2+_0xd410('0x7a'));}else{_0x231e33[_0xd410('0x44')]('i.'+_0x2a4ec2+_0xd410('0x7b'),_0x5a5dae[_0xd410('0x39')][_0x2a4ec2]);}}});}if(_0x5a5dae[_0xd410('0x39')][_0xd410('0x7c')]){if(_0x5a5dae[_0xd410('0x39')]['read']==0x1){_0x231e33[_0xd410('0x5d')](_0xd410('0x7d'));}else{_0x231e33[_0xd410('0x5d')](_0xd410('0x7e'));}}if(_0x5a5dae[_0xd410('0x39')][_0xd410('0x7f')]){_0x3c5689=_[_0xd410('0x80')](_0x5a5dae[_0xd410('0x39')][_0xd410('0x7f')])?_0x5a5dae[_0xd410('0x39')][_0xd410('0x7f')]:new Array(_0x5a5dae['query']['tag']);_0x3c5689['forEach'](function(_0x8b0e98){_0x1b916b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x8b0e98+',%');});}if(_0x5a5dae[_0xd410('0x39')][_0xd410('0x81')]){var _0x5bbc09=_0x5a5dae[_0xd410('0x39')][_0xd410('0x81')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xd410('0x82')](_0x5bbc09)){_0x4438a8['or'](_0xd410('0x83'),_0x5bbc09+'%')['or'](_0xd410('0x84'),_0x5bbc09+'%');}else{_0x4438a8['or'](_0xd410('0x85'),qs[_0xd410('0x64')](_0x5bbc09))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5bbc09+'%');}}}_0x231e33['where'](_0x4438a8);_0x231e33['group'](_0xd410('0x86'));var _0x415dbf={'type':db[_0xd410('0x87')][_0xd410('0x88')][_0xd410('0x89')],'raw':!![]};var _0xa64267=_0x231e33['clone']();_0xa64267[_0xd410('0x47')](_0xd410('0x86'));_0xa64267[_0xd410('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd410('0x5b'));if(_0x16e487[_0xd410('0x42')]){_0x16e487[_0xd410('0x42')][_0xd410('0x31')](function(_0x33066d){var _0x576b9e=_0x33066d[0x0]==='contactName'?_0x33066d[0x0]:'i.'+_0x33066d[0x0];_0x231e33[_0xd410('0x42')](_0x576b9e,_0x33066d[0x1]===_0xd410('0x8a')?![]:!![]);});}if(!_[_0xd410('0x71')](_0x3c5689)){_0x231e33[_0xd410('0x5d')](_0x1b916b);_0xa64267[_0xd410('0x44')](_0xd410('0x8b'),_0x3c5689);}BPromise[_0xd410('0x8c')]()[_0xd410('0x27')](function(){if(!_0x23c92c){if(_0x5a5dae['query'][_0xd410('0x72')])return;_0xa64267[_0xd410('0x44')](_0xd410('0x8d'));_0x231e33[_0xd410('0x44')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x5a5dae[_0xd410('0x8e')][_0xd410('0x8f')]!==_0xd410('0x90'))return;return _0x5a5dae[_0xd410('0x8e')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x4fa11a){if(_[_0xd410('0x71')](_0x4fa11a)){_0xa64267[_0xd410('0x44')](_0xd410('0x91'));_0x231e33[_0xd410('0x44')](_0xd410('0x91'));}else{_0xa64267[_0xd410('0x44')](_0xd410('0x73'),_['map'](_0x4fa11a,'id'));_0x231e33['where'](_0xd410('0x73'),_[_0xd410('0x2e')](_0x4fa11a,'id'));}});})[_0xd410('0x27')](function(){if(_0x5a5dae[_0xd410('0x8e')][_0xd410('0x8f')]===_0xd410('0x90')&&!_0x23c92c&&!_0x5a5dae['query']['WhatsappAccountId'])return[];return db[_0xd410('0x92')][_0xd410('0x39')](_0xa64267[_0xd410('0x93')](),_0x415dbf);})[_0xd410('0x27')](function(_0x17faeb){_0x56bec1[_0xd410('0x1f')]=_0x17faeb[_0xd410('0x3f')];if(_0x56bec1[_0xd410('0x1f')]===0x0)return[];return db['sequelize'][_0xd410('0x39')](_0x3716d7[_0xd410('0x93')](),_0x415dbf)[_0xd410('0x27')](function(_0x152ec3){_0xa175c=_[_0xd410('0x94')](_0x152ec3,'id');_0x415dbf=_[_0xd410('0x95')](_0x415dbf,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5a5dae[_0xd410('0x39')][_0xd410('0x3e')]){_0x16e487['attributes'][_0xd410('0x31')](function(_0x5b25ad){_0x231e33[_0xd410('0x47')]('i.'+_0x5b25ad);});}else{_0x231e33['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd410('0x5b'));_0x231e33[_0xd410('0x47')](_0xd410('0x96'),_0xd410('0x97'));_0x231e33[_0xd410('0x47')](_0xd410('0x98'),_0xd410('0x99'));_0x231e33[_0xd410('0x47')]('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');_0x231e33[_0xd410('0x47')]('i.*');_0x231e33[_0xd410('0x47')](_0xd410('0x9a'),_0xd410('0x9b'));_0x231e33['field']('c.lastName',_0xd410('0x9c'));_0x231e33[_0xd410('0x47')](_0xd410('0x9d'),_0xd410('0x9e'));_0x231e33[_0xd410('0x47')](_0xd410('0x9f'),_0xd410('0xa0'));_0x231e33[_0xd410('0x47')](_0xd410('0xa1'),'Contact.mobile');_0x231e33[_0xd410('0x47')]('c.fax',_0xd410('0xa2'));_0x231e33[_0xd410('0x47')](_0xd410('0xa3'),_0xd410('0xa4'));_0x231e33['field'](_0xd410('0xa5'),_0xd410('0xa6'));_0x231e33['field'](_0xd410('0xa7'),'TagIds');}if(_0x16e487[_0xd410('0x1d')])_0x231e33[_0xd410('0x1d')](_0x16e487[_0xd410('0x1d')]);if(_0x16e487[_0xd410('0x20')])_0x231e33['offset'](_0x16e487[_0xd410('0x20')]);return db[_0xd410('0x92')][_0xd410('0x39')](_0x231e33[_0xd410('0x93')](),_0x415dbf);})[_0xd410('0x27')](function(_0x308363){if(_0x308363['length']>0x0)_0x518755[_0xd410('0x44')](_0xd410('0xa8'),_[_0xd410('0x2e')](_0x308363,'id'));return db[_0xd410('0x92')]['query'](_0x518755[_0xd410('0x93')](),_0x415dbf)['then'](function(_0x46ad1f){var _0xad2153=_[_0xd410('0xa9')](_0x46ad1f,_0xd410('0xaa'));var _0x261039=[];_0x308363[_0xd410('0x31')](function(_0x1c2b58){_0x261039[_0xd410('0xab')](updateWhatsappInteraction(_0x1c2b58,_0xa175c,_0xad2153));});return BPromise[_0xd410('0xac')](_0x261039);});});})[_0xd410('0x27')](function(_0x71e91b){_0x56bec1[_0xd410('0xad')]=_0x71e91b;return _0x56bec1;})[_0xd410('0x27')](respondWithFilteredResult(_0x90aea0,_0x16e487))['catch'](handleError(_0x90aea0,null));};exports[_0xd410('0xae')]=function(_0x24bce2,_0x4614d3){var _0xb11c43={'raw':![],'where':{'id':_0x24bce2['params']['id']}},_0x9fdca6={};_0x9fdca6[_0xd410('0x38')]=_['keys'](db[_0xd410('0xaf')][_0xd410('0x34')]);_0x9fdca6[_0xd410('0x39')]=_[_0xd410('0x3a')](_0x24bce2['query']);_0x9fdca6[_0xd410('0x3b')]=_[_0xd410('0x3c')](_0x9fdca6['model'],_0x9fdca6[_0xd410('0x39')]);_0xb11c43[_0xd410('0x3d')]=_[_0xd410('0x3c')](_0x9fdca6['model'],qs[_0xd410('0x3e')](_0x24bce2[_0xd410('0x39')][_0xd410('0x3e')]));_0xb11c43[_0xd410('0x3d')]=_0xb11c43[_0xd410('0x3d')][_0xd410('0x3f')]?_0xb11c43[_0xd410('0x3d')]:_0x9fdca6['model'];if(_0x24bce2[_0xd410('0x39')][_0xd410('0xb0')]){_0xb11c43[_0xd410('0xb1')]=[{'all':!![]}];}_0xb11c43=_[_0xd410('0x95')]({},_0xb11c43,_0x24bce2['options']);return db[_0xd410('0xaf')][_0xd410('0x66')](_0xb11c43)['then'](handleEntityNotFound(_0x4614d3,null))[_0xd410('0x27')](respondWithResult(_0x4614d3,null))[_0xd410('0xb2')](handleError(_0x4614d3,null));};exports[_0xd410('0xb3')]=function(_0x2d6338,_0x4efe8e){return db[_0xd410('0xaf')]['create'](_0x2d6338[_0xd410('0x6f')],{})['then'](respondWithResult(_0x4efe8e,0xc9))[_0xd410('0xb2')](handleError(_0x4efe8e,null));};exports[_0xd410('0x26')]=function(_0x177151,_0x5a7f94){if(_0x177151[_0xd410('0x6f')]['id']){delete _0x177151[_0xd410('0x6f')]['id'];}return db['WhatsappInteraction'][_0xd410('0x66')]({'where':{'id':_0x177151[_0xd410('0xb4')]['id']}})['then'](handleEntityNotFound(_0x5a7f94,null))[_0xd410('0x27')](saveUpdates(_0x177151['body'],null))[_0xd410('0x27')](respondWithResult(_0x5a7f94,null))[_0xd410('0xb2')](handleError(_0x5a7f94,null));};exports[_0xd410('0x28')]=function(_0x4de2fc,_0x449289){return db[_0xd410('0xaf')][_0xd410('0x66')]({'where':{'id':_0x4de2fc['params']['id']}})[_0xd410('0x27')](handleEntityNotFound(_0x449289,null))['then'](removeEntity(_0x449289,null))['catch'](handleError(_0x449289,null));};exports[_0xd410('0xb5')]=function(_0x1cccd1,_0x4ed8bb){return db['WhatsappInteraction'][_0xd410('0xb5')]()[_0xd410('0x27')](respondWithResult(_0x4ed8bb,null))['catch'](handleError(_0x4ed8bb,null));};exports[_0xd410('0xb6')]=function(_0x2c97a1,_0x16778d,_0x2a42b7){return db['WhatsappMessage']['find']({'where':{'id':_0x2c97a1[_0xd410('0xb4')]['id']}})['then'](handleEntityNotFound(_0x16778d,null))[_0xd410('0x27')](function(_0xa58633){if(_0xa58633){return _0xa58633['addMessage'](_0x2c97a1[_0xd410('0x6f')][_0xd410('0xb7')],_[_0xd410('0xb8')](_0x2c97a1[_0xd410('0x6f')],[_0xd410('0xb7'),'id'])||{});}})['then'](respondWithResult(_0x16778d,null))[_0xd410('0xb2')](handleError(_0x16778d,null));};exports['getMessages']=function(_0x32ded6,_0x4c703d,_0x222ef0){var _0x49dbc5={'raw':![],'where':{}};var _0x3db849={};var _0x27ebb5={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xd410('0xb9')]({'where':{'id':_0x32ded6[_0xd410('0xb4')]['id']}})['then'](handleEntityNotFound(_0x4c703d,null))['then'](function(_0xacb72b){if(_0xacb72b){_0x3db849[_0xd410('0x38')]=_[_0xd410('0x3a')](db[_0xd410('0xba')][_0xd410('0x34')]);_0x3db849[_0xd410('0x39')]=_[_0xd410('0x3a')](_0x32ded6[_0xd410('0x39')]);_0x3db849[_0xd410('0x3b')]=_['intersection'](_0x3db849['model'],_0x3db849['query']);_0x49dbc5[_0xd410('0x3d')]=_['intersection'](_0x3db849[_0xd410('0x38')],qs[_0xd410('0x3e')](_0x32ded6[_0xd410('0x39')]['fields']));_0x49dbc5['attributes']=_0x49dbc5[_0xd410('0x3d')][_0xd410('0x3f')]?_0x49dbc5[_0xd410('0x3d')]:_0x3db849['model'];if(!_0x32ded6[_0xd410('0x39')][_0xd410('0x40')]('nolimit')){_0x49dbc5['limit']=qs['limit'](_0x32ded6[_0xd410('0x39')][_0xd410('0x1d')]);_0x49dbc5['offset']=qs[_0xd410('0x20')](_0x32ded6['query'][_0xd410('0x20')]);}_0x49dbc5['order']=qs[_0xd410('0x43')](_0x32ded6['query'][_0xd410('0x43')]);_0x49dbc5['where']=qs[_0xd410('0x3b')](_[_0xd410('0x45')](_0x32ded6['query'],_0x3db849[_0xd410('0x3b')]));_0x49dbc5[_0xd410('0x44')][_0xd410('0xaa')]=_0xacb72b['id'];if(_0x32ded6[_0xd410('0x39')]['filter']){_0x49dbc5[_0xd410('0x44')]=_[_0xd410('0x95')](_0x49dbc5['where'],{'$or':_[_0xd410('0x2e')](_0x49dbc5['attributes'],function(_0x545b25){var _0x59a347={};_0x59a347[_0x545b25]={'$like':'%'+_0x32ded6[_0xd410('0x39')][_0xd410('0x81')]+'%'};return _0x59a347;})});}if(_0x32ded6['query']['$gte']){var _0x373fcb=_0x32ded6['query']['$gte']['split'](',');var _0x1b3160={};_0x1b3160[_0x373fcb[0x0]]={'$gte':moment(_0x373fcb[0x1])[_0xd410('0xbb')](_0xd410('0xbc'))};_0x49dbc5[_0xd410('0x44')]=_[_0xd410('0x95')](_0x49dbc5[_0xd410('0x44')],_0x1b3160);}_0x49dbc5=_[_0xd410('0x95')]({},_0x49dbc5,_0x32ded6['options']);return db[_0xd410('0xba')]['count']({'where':_0x49dbc5['where']})[_0xd410('0x27')](function(_0x5d3b1e){_0x27ebb5[_0xd410('0x1f')]=_0x5d3b1e;if(_0x32ded6['query'][_0xd410('0xb0')]){_0x49dbc5['include']=[{'all':!![]}];}return db[_0xd410('0xba')][_0xd410('0xbd')](_0x49dbc5);})[_0xd410('0x27')](function(_0xad95c6){_0x27ebb5['rows']=_0xad95c6;return _0x27ebb5;});}})['then'](respondWithFilteredResult(_0x4c703d,_0x49dbc5))[_0xd410('0xb2')](handleError(_0x4c703d,null));};exports[_0xd410('0xbe')]=function(_0x2f79ff,_0x3962b3,_0x195802){return db[_0xd410('0xaf')][_0xd410('0x66')]({'where':{'id':_0x2f79ff[_0xd410('0xb4')]['id']}})[_0xd410('0x27')](handleEntityNotFound(_0x3962b3,null))[_0xd410('0x27')](function(_0x22d57b){if(_0x22d57b){return _0x22d57b[_0xd410('0xbf')](_0x2f79ff[_0xd410('0x6f')][_0xd410('0xb7')],_[_0xd410('0xb8')](_0x2f79ff[_0xd410('0x6f')],[_0xd410('0xb7'),'id'])||{})['spread'](function(){return db['Tag'][_0xd410('0xbd')]({'attributes':['id',_0xd410('0x2b'),_0xd410('0x48')],'where':{'id':_0x2f79ff[_0xd410('0x6f')][_0xd410('0xb7')]}});})['then'](function(_0x27ce83){socket[_0xd410('0xc0')](_0xd410('0xc1'),{'id':Number(_0x2f79ff['params']['id']),'tags':_0x27ce83||[]});return{'id':Number(_0x2f79ff[_0xd410('0xb4')]['id']),'tags':_0x27ce83||[]};});}})[_0xd410('0x27')](respondWithResult(_0x3962b3,null))['catch'](handleError(_0x3962b3,null));};exports['removeTags']=function(_0x5a6d25,_0x3ad407,_0x22fbe0){return db[_0xd410('0xaf')][_0xd410('0x66')]({'where':{'id':_0x5a6d25[_0xd410('0xb4')]['id']}})[_0xd410('0x27')](handleEntityNotFound(_0x3ad407,null))['then'](function(_0x19f690){if(_0x19f690){return _0x19f690[_0xd410('0xc2')](_0x5a6d25['query']['ids']);}})[_0xd410('0x27')](respondWithStatusCode(_0x3ad407,null))[_0xd410('0xb2')](handleError(_0x3ad407,null));};exports[_0xd410('0xc3')]=function(_0x809b1e,_0x54a652){var _0x5fa424=moment()['unix']()[_0xd410('0x93')]();var _0x296c12=path['join'](config['root'],'server',_0xd410('0xc4'),_0xd410('0xc5'));var _0x4a489a=path[_0xd410('0xc6')](config['root'],_0xd410('0xc7'),'files',_0xd410('0xc8'));var _0x5e2bff=path[_0xd410('0xc6')](_0x296c12,_0x5fa424);var _0x12da3d=util[_0xd410('0xbb')](_0xd410('0xc9'),_0x809b1e[_0xd410('0xb4')]['id'],_0x5fa424);var _0x46e985=path['join'](_0x296c12,_0x12da3d);var _0x2c0d66=[];_0x2c0d66[_0xd410('0xab')]({'model':db['User'],'as':_0xd410('0xca'),'attributes':['id',_0xd410('0x2f')],'raw':!![]});_0x2c0d66[_0xd410('0xab')]({'model':db[_0xd410('0xcb')],'as':'Contact','attributes':['id',_0xd410('0xcc'),_0xd410('0xcd')],'raw':!![]});if(_0x809b1e['query'][_0xd410('0xc8')]){_0x2c0d66[_0xd410('0xab')]({'model':db[_0xd410('0xce')],'as':_0xd410('0xce'),'raw':!![]});}var _0x1427d0=[{'model':db[_0xd410('0xba')],'as':_0xd410('0xcf'),'attributes':['id',_0xd410('0x6f'),_0xd410('0x75'),_0xd410('0xd0'),_0xd410('0xd1'),_0xd410('0x7c')],'include':_0x2c0d66}];_0x1427d0[_0xd410('0xab')]({'model':db[_0xd410('0xd2')],'as':_0xd410('0xd3'),'attributes':['id',_0xd410('0x2b')]});_0x1427d0[_0xd410('0xab')]({'model':db[_0xd410('0xca')],'as':_0xd410('0xd4'),'attributes':['id',_0xd410('0x2f')]});return db['WhatsappInteraction'][_0xd410('0x66')]({'where':{'id':_0x809b1e['params']['id']},'include':_0x1427d0})[_0xd410('0x27')](handleEntityNotFound(_0x54a652,null))[_0xd410('0x27')](function(_0x455b79){if(_0x455b79){var _0x11dbc9=_0x455b79[_0xd410('0xd5')]({'plain':!![]});fs[_0xd410('0xd6')](_0x5e2bff);var _0x4c902={'channel':_0xd410('0xd7'),'account':_0x11dbc9[_0xd410('0xd3')][_0xd410('0x2b')],'agent':_0x11dbc9[_0xd410('0xd4')]?_0x11dbc9[_0xd410('0xd4')][_0xd410('0x2f')]:_0xd410('0xd8'),'createdAt':moment(_0x11dbc9['createdAt'])['format'](_0xd410('0xbc'))[_0xd410('0x93')](),'closedAt':_0x11dbc9['closed']?moment(_0x11dbc9['closedAt'])[_0xd410('0xbb')](_0xd410('0xbc'))['toString']():'','disposition':_0x11dbc9['disposition'],'messages':_(_0x11dbc9['Messages'])[_0xd410('0x81')]({'secret':![]})[_0xd410('0x2e')](function(_0x105dde){if(_0x105dde[_0xd410('0xce')]){var _0x317a88=path['join'](_0x4a489a,_0x105dde['Attachment'][_0xd410('0xd9')]);if(fs[_0xd410('0xda')](_0x317a88)){fs[_0xd410('0xdb')](_0x317a88)[_0xd410('0xdc')](fs['createWriteStream'](path[_0xd410('0xc6')](_0x5e2bff,_0x105dde['Attachment']['basename'])));}}return{'date':moment(_0x105dde[_0xd410('0x75')])[_0xd410('0xbb')](_0xd410('0xbc'))['toString'](),'sender':_0x105dde[_0xd410('0xd0')]===_0xd410('0xdd')?_0x105dde['User']?_0x105dde['User'][_0xd410('0x2f')]:_0xd410('0xde'):_0x105dde['Contact'][_0xd410('0xcc')]+(_0x105dde[_0xd410('0x5f')][_0xd410('0xcd')]?'\x20'+_0x105dde['Contact']['lastName']:''),'body':_0x105dde[_0xd410('0xce')]?_0x105dde[_0xd410('0xce')][_0xd410('0xd9')]:_0x105dde[_0xd410('0x6f')],'direction':_0x105dde['direction']===_0xd410('0xdd')?'A':'C','secret':_0x105dde['secret'],'read':_0x105dde[_0xd410('0x7c')],'attachment':_0x105dde['Attachment']};})[_0xd410('0x5c')]()};return ejs[_0xd410('0xdf')](path[_0xd410('0xc6')](config[_0xd410('0xe0')],_0xd410('0xc7'),_0xd410('0xe1'),'downloadInteraction.ejs'),{'interaction':_0x4c902})['then'](function(_0x136959){var _0x5046ea=path['join'](_0x5e2bff,_0xd410('0xe2')+_0x11dbc9['id']+'-'+_0x5fa424+_0xd410('0xe3'));var _0x4ea1c6={'path':_0x5046ea,'channel':_0xd410('0xd7'),'interactionId':_0x11dbc9['id']};return pdf[_0xd410('0xe4')](_0x136959,_0x4ea1c6);})[_0xd410('0x27')](function(){return new BPromise(function(_0x289e8e,_0x345c2b){zipdir(_0x5e2bff,{'saveTo':_0x46e985},function(_0x37f130,_0x2a7b3b){if(_0x37f130)return _0x345c2b(_0x37f130);return _0x289e8e(_0x2a7b3b);});})[_0xd410('0x27')](function(){return new BPromise(function(_0x2699dc,_0x2537ea){rimraf(_0x5e2bff,function(_0x4c907e){if(_0x4c907e)_0x2537ea(_0x4c907e);return _0x2699dc();});});})[_0xd410('0x27')](function(){return _0x54a652[_0xd410('0xc3')](_0x46e985,_0x12da3d,function(_0x15b406){if(_0x15b406){console[_0xd410('0xe5')](_0xd410('0xe6'),_0x15b406);}else{fs['unlinkSync'](_0x46e985);}});});});}else{return _0x54a652['sendStatus'](0xc8);}})['catch'](handleError(_0x54a652,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index a06396d..2662037 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 _0xf69b=['unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x599804,_0x3a5fc0){var _0x5760a6=function(_0x4ad159){while(--_0x4ad159){_0x599804['push'](_0x599804['shift']());}};_0x5760a6(++_0x3a5fc0);}(_0xf69b,0xc8));var _0xbf69=function(_0x59cd36,_0x10adf1){_0x59cd36=_0x59cd36-0x0;var _0x20eda8=_0xf69b[_0x59cd36];return _0x20eda8;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xbf69('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xbf69('0x0'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xbf69('0x1')](0x0);var events={'afterCreate':_0xbf69('0x2'),'afterUpdate':_0xbf69('0x3'),'afterDestroy':'remove'};function emitEvent(_0x28fa1e){return function(_0x5524ad,_0x3bff4c,_0x1480a1){_0x5524ad[_0xbf69('0x4')]({'attributes':['id'],'raw':!![]})[_0xbf69('0x5')](function(_0x1af327){_0x5524ad[_0xbf69('0x6')](_0xbf69('0x7'),_0x1af327[_0xbf69('0x8')](function(_0xd7c347){return{'id':_0xd7c347['id']};}));return WhatsappMessage[_0xbf69('0x9')]({'where':{'WhatsappInteractionId':_0x5524ad['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2fbfa6){_0x5524ad[_0xbf69('0x6')](_0xbf69('0xa'),_0x2fbfa6['length']);WhatsappInteractionEvents[_0xbf69('0xb')](_0x28fa1e+':'+_0x5524ad['id'],_0x5524ad);WhatsappInteractionEvents[_0xbf69('0xb')](_0x28fa1e,_0x5524ad);_0x1480a1(null);})[_0xbf69('0xc')](_0x1480a1(null));};}for(var e in events){if(events[_0xbf69('0xd')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xbf69('0xe')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x9000=['save','update','remove','getUsers','setDataValue','Users','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x279e39,_0x8a6cac){var _0x3a43c7=function(_0x50cfa6){while(--_0x50cfa6){_0x279e39['push'](_0x279e39['shift']());}};_0x3a43c7(++_0x8a6cac);}(_0x9000,0x19e));var _0x0900=function(_0x2b76de,_0x2c174c){_0x2b76de=_0x2b76de-0x0;var _0x4bbf3e=_0x9000[_0x2b76de];return _0x4bbf3e;};'use strict';var EventEmitter=require(_0x0900('0x0'));var WhatsappInteraction=require(_0x0900('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x0900('0x1'))['db'][_0x0900('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x0900('0x3')](0x0);var events={'afterCreate':_0x0900('0x4'),'afterUpdate':_0x0900('0x5'),'afterDestroy':_0x0900('0x6')};function emitEvent(_0x31100b){return function(_0x3f77e6,_0x32c996,_0x50b1ad){_0x3f77e6[_0x0900('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5c4b2e){_0x3f77e6[_0x0900('0x8')](_0x0900('0x9'),_0x5c4b2e['map'](function(_0x5c13a1){return{'id':_0x5c13a1['id']};}));return WhatsappMessage[_0x0900('0xa')]({'where':{'WhatsappInteractionId':_0x3f77e6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0900('0xb')](function(_0x2c8efa){_0x3f77e6[_0x0900('0x8')](_0x0900('0xc'),_0x2c8efa[_0x0900('0xd')]);WhatsappInteractionEvents['emit'](_0x31100b+':'+_0x3f77e6['id'],_0x3f77e6);WhatsappInteractionEvents[_0x0900('0xe')](_0x31100b,_0x3f77e6);_0x50b1ad(null);})[_0x0900('0xf')](_0x50b1ad(null));};}for(var e in events){if(events[_0x0900('0x10')](e)){var event=events[e];WhatsappInteraction[_0x0900('0x11')](e,emitEvent(event));}}module[_0x0900('0x12')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 3def263..558b8f5 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 _0x2efb=['WhatsappInteraction','whatsapp_interactions','closed','closedAt','format','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2efb,0x105));var _0xb2ef=function(_0x358101,_0x35c349){_0x358101=_0x358101-0x0;var _0x5b4158=_0x2efb[_0x358101];return _0x5b4158;};'use strict';var _=require(_0xb2ef('0x0'));var util=require(_0xb2ef('0x1'));var logger=require('../../config/logger')(_0xb2ef('0x2'));var moment=require(_0xb2ef('0x3'));var BPromise=require(_0xb2ef('0x4'));var rp=require(_0xb2ef('0x5'));var fs=require('fs');var path=require(_0xb2ef('0x6'));var rimraf=require(_0xb2ef('0x7'));var config=require(_0xb2ef('0x8'));var attributes=require(_0xb2ef('0x9'));module[_0xb2ef('0xa')]=function(_0x55709d,_0x14bbe7){return _0x55709d['define'](_0xb2ef('0xb'),attributes,{'tableName':_0xb2ef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x414e64,_0x64418f,_0x5486e7){if(_0x414e64['changed'](_0xb2ef('0xd'))){_0x414e64[_0xb2ef('0xe')]=moment()[_0xb2ef('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5486e7(null,_0x414e64);}}});}; \ No newline at end of file +var _0x5aeb=['WhatsappInteraction','changed','closed','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5aeb,0xc5));var _0xb5ae=function(_0xc81c69,_0xabf860){_0xc81c69=_0xc81c69-0x0;var _0x442519=_0x5aeb[_0xc81c69];return _0x442519;};'use strict';var _=require(_0xb5ae('0x0'));var util=require(_0xb5ae('0x1'));var logger=require(_0xb5ae('0x2'))(_0xb5ae('0x3'));var moment=require(_0xb5ae('0x4'));var BPromise=require(_0xb5ae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5ae('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0xb2ab62,_0x5e4b2f){return _0xb2ab62['define'](_0xb5ae('0x7'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34834e,_0x486a15,_0xd78b8c){if(_0x34834e[_0xb5ae('0x8')](_0xb5ae('0x9'))){_0x34834e[_0xb5ae('0xa')]=moment()[_0xb5ae('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0xd78b8c(null,_0x34834e);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index ed28858..eb8edb6 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 _0x54f0=['request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateWhatsappInteraction','update','body','options','raw','where','attributes','limit','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s'];(function(_0xdc0c40,_0x18a854){var _0x12e045=function(_0x5dba33){while(--_0x5dba33){_0xdc0c40['push'](_0xdc0c40['shift']());}};_0x12e045(++_0x18a854);}(_0x54f0,0x1c3));var _0x054f=function(_0x1f10f8,_0x3df17e){_0x1f10f8=_0x1f10f8-0x0;var _0xdc191f=_0x54f0[_0x1f10f8];return _0xdc191f;};'use strict';var _=require(_0x054f('0x0'));var util=require(_0x054f('0x1'));var moment=require(_0x054f('0x2'));var BPromise=require(_0x054f('0x3'));var rs=require(_0x054f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x054f('0x5'))['db'];var utils=require(_0x054f('0x6'));var logger=require(_0x054f('0x7'))(_0x054f('0x8'));var config=require(_0x054f('0x9'));var jayson=require(_0x054f('0xa'));var client=jayson[_0x054f('0xb')][_0x054f('0xc')]({'port':0x232a});config[_0x054f('0xd')]=_[_0x054f('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x054f('0xf'))(new Redis(config['redis']));require(_0x054f('0x10'))[_0x054f('0x11')](socket);function respondWithRpcPromise(_0x41481d,_0x4ada40,_0x236dc7){return new BPromise(function(_0x4922da,_0x51f6ae){return client[_0x054f('0x12')](_0x41481d,_0x236dc7)[_0x054f('0x13')](function(_0x920f38){logger[_0x054f('0x14')](_0x054f('0x15'),_0x4ada40,_0x054f('0x16'));logger[_0x054f('0x17')](_0x054f('0x18'),_0x4ada40,_0x054f('0x16'),JSON[_0x054f('0x19')](_0x920f38));if(_0x920f38['error']){if(_0x920f38[_0x054f('0x1a')]['code']===0x1f4){logger[_0x054f('0x1a')]('WhatsappInteraction,\x20%s,\x20%s',_0x4ada40,_0x920f38[_0x054f('0x1a')][_0x054f('0x1b')]);return _0x51f6ae(_0x920f38[_0x054f('0x1a')][_0x054f('0x1b')]);}logger[_0x054f('0x1a')](_0x054f('0x15'),_0x4ada40,_0x920f38[_0x054f('0x1a')][_0x054f('0x1b')]);return _0x4922da(_0x920f38['error'][_0x054f('0x1b')]);}else{logger['info'](_0x054f('0x15'),_0x4ada40,_0x054f('0x16'));_0x4922da(_0x920f38['result']['message']);}})[_0x054f('0x1c')](function(_0x2bcc9e){logger[_0x054f('0x1a')](_0x054f('0x15'),_0x4ada40,_0x2bcc9e);_0x51f6ae(_0x2bcc9e);});});}exports[_0x054f('0x1d')]=function(_0x478723){var _0x133a17=this;return new Promise(function(_0x37af77,_0x16d345){return db['WhatsappInteraction'][_0x054f('0x1e')](_0x478723[_0x054f('0x1f')],{'raw':_0x478723[_0x054f('0x20')]?_0x478723[_0x054f('0x20')][_0x054f('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x478723[_0x054f('0x20')]?_0x478723[_0x054f('0x20')][_0x054f('0x22')]||null:null,'attributes':_0x478723[_0x054f('0x20')]?_0x478723[_0x054f('0x20')][_0x054f('0x23')]||null:null,'limit':_0x478723[_0x054f('0x20')]?_0x478723[_0x054f('0x20')][_0x054f('0x24')]||null:null})[_0x054f('0x13')](function(_0x379b37){logger[_0x054f('0x14')]('UpdateWhatsappInteraction',_0x478723);logger['debug'](_0x054f('0x1d'),_0x478723,JSON[_0x054f('0x19')](_0x379b37));_0x37af77(_0x379b37);})[_0x054f('0x1c')](function(_0x499520){logger[_0x054f('0x1a')]('UpdateWhatsappInteraction',_0x499520['message'],_0x478723);_0x16d345(_0x133a17[_0x054f('0x1a')](0x1f4,_0x499520['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x3997e9){return new Promise(function(_0x403445,_0x9d34fc){return db['WhatsappInteraction'][_0x054f('0x25')]({'where':_0x3997e9[_0x054f('0x20')]?_0x3997e9[_0x054f('0x20')]['where']||null:null})[_0x054f('0x13')](function(_0x5703a6){if(_0x5703a6){return _0x5703a6[_0x054f('0x26')](_0x3997e9[_0x054f('0x1f')][_0x054f('0x27')],_[_0x054f('0x28')](_0x3997e9[_0x054f('0x1f')],[_0x054f('0x27'),'id'])||{});}})[_0x054f('0x29')](function(_0x4bdd47){logger['info'](_0x054f('0x2a'),_0x3997e9);logger[_0x054f('0x17')]('AddTags',_0x3997e9,JSON[_0x054f('0x19')](_0x4bdd47));_0x403445(_0x4bdd47);})[_0x054f('0x1c')](function(_0x123b23){logger[_0x054f('0x1a')](_0x054f('0x2a'),_0x123b23['message'],_0x3997e9);_0x9d34fc(_this[_0x054f('0x1a')](0x1f4,_0x123b23['message']));});});}; \ No newline at end of file +var _0xc659=['ids','spread','AddTags','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./whatsappInteraction.socket','register','request','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','where','attributes','limit','then','find','addTags'];(function(_0x5f12d8,_0x224220){var _0xa86be7=function(_0x38c5ef){while(--_0x38c5ef){_0x5f12d8['push'](_0x5f12d8['shift']());}};_0xa86be7(++_0x224220);}(_0xc659,0x1ed));var _0x9c65=function(_0x5caa02,_0x3106fd){_0x5caa02=_0x5caa02-0x0;var _0x562d4e=_0xc659[_0x5caa02];return _0x562d4e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9c65('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9c65('0x1'));var logger=require(_0x9c65('0x2'))(_0x9c65('0x3'));var config=require(_0x9c65('0x4'));var jayson=require(_0x9c65('0x5'));var client=jayson[_0x9c65('0x6')]['http']({'port':0x232a});config[_0x9c65('0x7')]=_['defaults'](config[_0x9c65('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x9c65('0x8'))(new Redis(config['redis']));require(_0x9c65('0x9'))[_0x9c65('0xa')](socket);function respondWithRpcPromise(_0x408532,_0x4ab497,_0x909c80){return new BPromise(function(_0x9b0a3b,_0x36c30f){return client[_0x9c65('0xb')](_0x408532,_0x909c80)['then'](function(_0x5934b1){logger[_0x9c65('0xc')]('WhatsappInteraction,\x20%s,\x20%s',_0x4ab497,_0x9c65('0xd'));logger[_0x9c65('0xe')](_0x9c65('0xf'),_0x4ab497,_0x9c65('0xd'),JSON[_0x9c65('0x10')](_0x5934b1));if(_0x5934b1[_0x9c65('0x11')]){if(_0x5934b1[_0x9c65('0x11')]['code']===0x1f4){logger[_0x9c65('0x11')](_0x9c65('0x12'),_0x4ab497,_0x5934b1['error'][_0x9c65('0x13')]);return _0x36c30f(_0x5934b1[_0x9c65('0x11')][_0x9c65('0x13')]);}logger[_0x9c65('0x11')](_0x9c65('0x12'),_0x4ab497,_0x5934b1[_0x9c65('0x11')][_0x9c65('0x13')]);return _0x9b0a3b(_0x5934b1['error'][_0x9c65('0x13')]);}else{logger[_0x9c65('0xc')]('WhatsappInteraction,\x20%s,\x20%s',_0x4ab497,'request\x20sent');_0x9b0a3b(_0x5934b1[_0x9c65('0x14')][_0x9c65('0x13')]);}})[_0x9c65('0x15')](function(_0x2cd75a){logger[_0x9c65('0x11')](_0x9c65('0x12'),_0x4ab497,_0x2cd75a);_0x36c30f(_0x2cd75a);});});}exports[_0x9c65('0x16')]=function(_0x473047){var _0x1b3f97=this;return new Promise(function(_0x488d69,_0x48ef54){return db[_0x9c65('0x17')]['update'](_0x473047[_0x9c65('0x18')],{'raw':_0x473047['options']?_0x473047[_0x9c65('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x473047['options']?_0x473047[_0x9c65('0x19')][_0x9c65('0x1a')]||null:null,'attributes':_0x473047['options']?_0x473047[_0x9c65('0x19')][_0x9c65('0x1b')]||null:null,'limit':_0x473047[_0x9c65('0x19')]?_0x473047['options'][_0x9c65('0x1c')]||null:null})[_0x9c65('0x1d')](function(_0x275f82){logger[_0x9c65('0xc')](_0x9c65('0x16'),_0x473047);logger[_0x9c65('0xe')](_0x9c65('0x16'),_0x473047,JSON[_0x9c65('0x10')](_0x275f82));_0x488d69(_0x275f82);})[_0x9c65('0x15')](function(_0x7374a){logger[_0x9c65('0x11')]('UpdateWhatsappInteraction',_0x7374a[_0x9c65('0x13')],_0x473047);_0x48ef54(_0x1b3f97[_0x9c65('0x11')](0x1f4,_0x7374a[_0x9c65('0x13')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x5b6435){return new Promise(function(_0x54c2ca,_0x9255e){return db[_0x9c65('0x17')][_0x9c65('0x1e')]({'where':_0x5b6435['options']?_0x5b6435[_0x9c65('0x19')][_0x9c65('0x1a')]||null:null})[_0x9c65('0x1d')](function(_0x57c85f){if(_0x57c85f){return _0x57c85f[_0x9c65('0x1f')](_0x5b6435[_0x9c65('0x18')]['ids'],_['omit'](_0x5b6435[_0x9c65('0x18')],[_0x9c65('0x20'),'id'])||{});}})[_0x9c65('0x21')](function(_0x2385c9){logger[_0x9c65('0xc')]('AddTags',_0x5b6435);logger[_0x9c65('0xe')]('AddTags',_0x5b6435,JSON[_0x9c65('0x10')](_0x2385c9));_0x54c2ca(_0x2385c9);})[_0x9c65('0x15')](function(_0x594395){logger[_0x9c65('0x11')](_0x9c65('0x22'),_0x594395[_0x9c65('0x13')],_0x5b6435);_0x9255e(_this[_0x9c65('0x11')](0x1f4,_0x594395[_0x9c65('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index cd83672..47e97e9 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 _0x4e81=['./whatsappInteraction.events','remove','emit','register','length'];(function(_0x578a8c,_0x3dc781){var _0x356d25=function(_0x2f4187){while(--_0x2f4187){_0x578a8c['push'](_0x578a8c['shift']());}};_0x356d25(++_0x3dc781);}(_0x4e81,0xeb));var _0x14e8=function(_0x3d4ef1,_0x5a957c){_0x3d4ef1=_0x3d4ef1-0x0;var _0x409423=_0x4e81[_0x3d4ef1];return _0x409423;};'use strict';var WhatsappInteractionEvents=require(_0x14e8('0x0'));var events=['save',_0x14e8('0x1'),'update'];function createListener(_0x1b059c,_0x1caaa0){return function(_0x3af7ed){_0x1caaa0[_0x14e8('0x2')](_0x1b059c,_0x3af7ed);};}function removeListener(_0x52161a,_0x4e2600){return function(){WhatsappInteractionEvents['removeListener'](_0x52161a,_0x4e2600);};}exports[_0x14e8('0x3')]=function(_0x557ee3){for(var _0x388bf5=0x0,_0x1b23fc=events[_0x14e8('0x4')];_0x388bf5<_0x1b23fc;_0x388bf5++){var _0x36869b=events[_0x388bf5];var _0x23a425=createListener('whatsappInteraction:'+_0x36869b,_0x557ee3);WhatsappInteractionEvents['on'](_0x36869b,_0x23a425);}}; \ No newline at end of file +var _0x309a=['length','./whatsappInteraction.events','save','remove','emit','register'];(function(_0x590b7f,_0x4eee19){var _0x5b8f4c=function(_0x425b65){while(--_0x425b65){_0x590b7f['push'](_0x590b7f['shift']());}};_0x5b8f4c(++_0x4eee19);}(_0x309a,0x109));var _0xa309=function(_0x548891,_0x5498d8){_0x548891=_0x548891-0x0;var _0x2d8f46=_0x309a[_0x548891];return _0x2d8f46;};'use strict';var WhatsappInteractionEvents=require(_0xa309('0x0'));var events=[_0xa309('0x1'),_0xa309('0x2'),'update'];function createListener(_0x58e660,_0x1bcf20){return function(_0xea581b){_0x1bcf20[_0xa309('0x3')](_0x58e660,_0xea581b);};}function removeListener(_0x12a203,_0x1da5a9){return function(){WhatsappInteractionEvents['removeListener'](_0x12a203,_0x1da5a9);};}exports[_0xa309('0x4')]=function(_0x533dc5){for(var _0x596f6a=0x0,_0x190df8=events[_0xa309('0x5')];_0x596f6a<_0x190df8;_0x596f6a++){var _0x4df46d=events[_0x596f6a];var _0x15d478=createListener('whatsappInteraction:'+_0x4df46d,_0x533dc5);WhatsappInteractionEvents['on'](_0x4df46d,_0x15d478);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 5a3ae03..463e253 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 _0x43ef=['put','/:id/accept','/:id/reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/:id','show','tracked','whatsapp','whatsappmessage:create','create','post','status'];(function(_0x5ee00a,_0x2edb91){var _0xb00528=function(_0x2d6548){while(--_0x2d6548){_0x5ee00a['push'](_0x5ee00a['shift']());}};_0xb00528(++_0x2edb91);}(_0x43ef,0xe6));var _0xf43e=function(_0x36d72b,_0x59ebac){_0x36d72b=_0x36d72b-0x0;var _0x3abd92=_0x43ef[_0x36d72b];return _0x3abd92;};'use strict';var multer=require('multer');var util=require(_0xf43e('0x0'));var path=require(_0xf43e('0x1'));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(_0xf43e('0x8'));router[_0xf43e('0x9')]('/',auth[_0xf43e('0xa')](),controller[_0xf43e('0xb')]);router[_0xf43e('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xf43e('0xc'),auth['isAuthenticated'](),controller[_0xf43e('0xd')]);router['post']('/',auth[_0xf43e('0xa')](),interaction[_0xf43e('0xe')](_0xf43e('0xf'),_0xf43e('0x10')),controller[_0xf43e('0x11')]);router[_0xf43e('0x12')]('/:id/status',controller[_0xf43e('0x13')]);router[_0xf43e('0x14')]('/:id',auth[_0xf43e('0xa')](),controller['update']);router[_0xf43e('0x14')](_0xf43e('0x15'),auth[_0xf43e('0xa')](),controller['accept']);router[_0xf43e('0x14')](_0xf43e('0x16'),auth[_0xf43e('0xa')](),controller['reject']);router[_0xf43e('0x17')]('/:id',auth[_0xf43e('0xa')](),controller['destroy']);module[_0xf43e('0x18')]=router; \ No newline at end of file +var _0x2cab=['describe','/:id','show','post','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe'];(function(_0xf46bd9,_0x322826){var _0x2763c3=function(_0x564f74){while(--_0x564f74){_0xf46bd9['push'](_0xf46bd9['shift']());}};_0x2763c3(++_0x322826);}(_0x2cab,0x101));var _0xb2ca=function(_0x12a275,_0x31c510){_0x12a275=_0x12a275-0x0;var _0x2e63f4=_0x2cab[_0x12a275];return _0x2e63f4;};'use strict';var multer=require(_0xb2ca('0x0'));var util=require(_0xb2ca('0x1'));var path=require('path');var timeout=require(_0xb2ca('0x2'));var express=require(_0xb2ca('0x3'));var router=express[_0xb2ca('0x4')]();var fs_extra=require(_0xb2ca('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb2ca('0x6'));var config=require(_0xb2ca('0x7'));var controller=require(_0xb2ca('0x8'));router[_0xb2ca('0x9')]('/',auth[_0xb2ca('0xa')](),controller[_0xb2ca('0xb')]);router[_0xb2ca('0x9')](_0xb2ca('0xc'),auth[_0xb2ca('0xa')](),controller[_0xb2ca('0xd')]);router[_0xb2ca('0x9')](_0xb2ca('0xe'),auth['isAuthenticated'](),controller[_0xb2ca('0xf')]);router[_0xb2ca('0x10')]('/',auth[_0xb2ca('0xa')](),interaction['tracked'](_0xb2ca('0x11'),_0xb2ca('0x12')),controller[_0xb2ca('0x13')]);router[_0xb2ca('0x10')](_0xb2ca('0x14'),controller[_0xb2ca('0x15')]);router[_0xb2ca('0x16')]('/:id',auth[_0xb2ca('0xa')](),controller[_0xb2ca('0x17')]);router[_0xb2ca('0x16')](_0xb2ca('0x18'),auth['isAuthenticated'](),controller['accept']);router[_0xb2ca('0x16')]('/:id/reject',auth[_0xb2ca('0xa')](),controller['reject']);router[_0xb2ca('0x19')](_0xb2ca('0xe'),auth[_0xb2ca('0xa')](),controller[_0xb2ca('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 4e0105b..aef4a9a 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 _0x0830=['sequelize','exports','medium','ENUM','out','STRING','BOOLEAN','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0830,0xd0));var _0x0083=function(_0x142ec2,_0x5bb03d){_0x142ec2=_0x142ec2-0x0;var _0x45ef4e=_0x0830[_0x142ec2];return _0x45ef4e;};'use strict';var Sequelize=require(_0x0083('0x0'));module[_0x0083('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0083('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0083('0x3')]('in',_0x0083('0x4')),'defaultValue':_0x0083('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x0083('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x0083('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0083('0x5')]},'providerResponse':{'type':Sequelize[_0x0083('0x7')]}}; \ No newline at end of file +var _0x10f9=['medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0x54e1c6,_0x2aaf27){var _0x460a01=function(_0xf2bc45){while(--_0xf2bc45){_0x54e1c6['push'](_0x54e1c6['shift']());}};_0x460a01(++_0x2aaf27);}(_0x10f9,0x69));var _0x910f=function(_0x12998d,_0x31bb7a){_0x12998d=_0x12998d-0x0;var _0x480756=_0x10f9[_0x12998d];return _0x480756;};'use strict';var Sequelize=require(_0x910f('0x0'));module[_0x910f('0x1')]={'body':{'type':Sequelize[_0x910f('0x2')](_0x910f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x910f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x910f('0x5')]('in',_0x910f('0x6')),'defaultValue':_0x910f('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x910f('0x7')]},'readAt':{'type':Sequelize[_0x910f('0x8')]},'secret':{'type':Sequelize[_0x910f('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x910f('0x7')]},'providerResponse':{'type':Sequelize[_0x910f('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 3674ff0..c4ab1e4 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 _0xdd68=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','stack','name','send','index','map','WhatsappMessage','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','options','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','update','isNil','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','User','agent','fullname','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT','contact','email','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x19cafe,_0x2de3a8){var _0x2d614d=function(_0x446d9d){while(--_0x446d9d){_0x19cafe['push'](_0x19cafe['shift']());}};_0x2d614d(++_0x2de3a8);}(_0xdd68,0x196));var _0x8dd6=function(_0x155c64,_0x26ff95){_0x155c64=_0x155c64-0x0;var _0x1f154a=_0xdd68[_0x155c64];return _0x1f154a;};'use strict';var emlformat=require(_0x8dd6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8dd6('0x1'));var jsonpatch=require(_0x8dd6('0x2'));var rp=require(_0x8dd6('0x3'));var moment=require(_0x8dd6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8dd6('0x5'));var util=require(_0x8dd6('0x6'));var path=require('path');var sox=require(_0x8dd6('0x7'));var csv=require(_0x8dd6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8dd6('0x9'));var _=require('lodash');var squel=require(_0x8dd6('0xa'));var crypto=require('crypto');var jsforce=require(_0x8dd6('0xb'));var deskjs=require(_0x8dd6('0xc'));var toCsv=require(_0x8dd6('0x8'));var querystring=require('querystring');var Papa=require(_0x8dd6('0xd'));var Redis=require(_0x8dd6('0xe'));var authService=require(_0x8dd6('0xf'));var qs=require(_0x8dd6('0x10'));var as=require(_0x8dd6('0x11'));var hardwareService=require(_0x8dd6('0x12'));var logger=require(_0x8dd6('0x13'))(_0x8dd6('0x14'));var utils=require(_0x8dd6('0x15'));var config=require(_0x8dd6('0x16'));var licenseUtil=require(_0x8dd6('0x17'));var db=require(_0x8dd6('0x18'))['db'];config[_0x8dd6('0x19')]=_['defaults'](config[_0x8dd6('0x19')],{'host':_0x8dd6('0x1a'),'port':0x18eb});var socket=require(_0x8dd6('0x1b'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0x8dd6('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x8dd6('0x1d')]({'port':0x232c});var client9002=jayson[_0x8dd6('0x1e')][_0x8dd6('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x469c11,_0x124e1d,_0x45902a,_0x31e123){return new BPromise(function(_0x3e2fb5,_0x3f4cca){var _0x5496cc=_0x31e123||client;return _0x5496cc[_0x8dd6('0x1f')](_0x469c11,_0x45902a)[_0x8dd6('0x20')](function(_0x267d23){logger[_0x8dd6('0x21')](_0x8dd6('0x22'),_0x124e1d,_0x8dd6('0x23'));logger[_0x8dd6('0x24')](_0x8dd6('0x25'),_0x124e1d,'request\x20sent',JSON[_0x8dd6('0x26')](_0x267d23));if(_0x267d23[_0x8dd6('0x27')]){if(_0x267d23['error'][_0x8dd6('0x28')]===0x1f4){logger[_0x8dd6('0x27')](_0x8dd6('0x22'),_0x124e1d,_0x267d23[_0x8dd6('0x27')]['message']);return _0x3f4cca(_0x267d23['error']['message']);}logger[_0x8dd6('0x27')](_0x8dd6('0x22'),_0x124e1d,_0x267d23['error'][_0x8dd6('0x29')]);return _0x3e2fb5(_0x267d23[_0x8dd6('0x27')][_0x8dd6('0x29')]);}else{logger[_0x8dd6('0x21')](_0x8dd6('0x22'),_0x124e1d,'request\x20sent');_0x3e2fb5(_0x267d23[_0x8dd6('0x2a')][_0x8dd6('0x29')]);}})['catch'](function(_0x50f513){logger[_0x8dd6('0x27')](_0x8dd6('0x22'),_0x124e1d,_0x50f513);_0x3f4cca(_0x50f513);});});}function respondWithStatusCode(_0x47c113,_0x2d3205){_0x2d3205=_0x2d3205||0xcc;return function(_0x3e05fa){if(_0x3e05fa){return _0x47c113[_0x8dd6('0x2b')](_0x2d3205);}return _0x47c113[_0x8dd6('0x2c')](_0x2d3205)[_0x8dd6('0x2d')]();};}function respondWithResult(_0x5b77f2,_0x46d855){_0x46d855=_0x46d855||0xc8;return function(_0x1df316){if(_0x1df316){return _0x5b77f2['status'](_0x46d855)['json'](_0x1df316);}};}function respondWithFilteredResult(_0x25eba7,_0x3f4975){return function(_0x4328c4){if(_0x4328c4){var _0x44c282=typeof _0x3f4975[_0x8dd6('0x2e')]===_0x8dd6('0x2f')&&typeof _0x3f4975[_0x8dd6('0x30')]===_0x8dd6('0x2f');var _0x35d45e=_0x4328c4[_0x8dd6('0x31')];var _0x15a0f6=_0x44c282?0x0:_0x3f4975[_0x8dd6('0x2e')];var _0x1aff19=_0x44c282?_0x4328c4[_0x8dd6('0x31')]:_0x3f4975[_0x8dd6('0x2e')]+_0x3f4975[_0x8dd6('0x30')];var _0x2e20d7;if(_0x1aff19>=_0x35d45e){_0x1aff19=_0x35d45e;_0x2e20d7=0xc8;}else{_0x2e20d7=0xce;}_0x25eba7[_0x8dd6('0x2c')](_0x2e20d7);return _0x25eba7[_0x8dd6('0x32')](_0x8dd6('0x33'),_0x15a0f6+'-'+_0x1aff19+'/'+_0x35d45e)[_0x8dd6('0x34')](_0x4328c4);}return null;};}function patchUpdates(_0x444582){return function(_0x59c8fb){try{jsonpatch[_0x8dd6('0x35')](_0x59c8fb,_0x444582,!![]);}catch(_0x390983){return BPromise[_0x8dd6('0x36')](_0x390983);}return _0x59c8fb[_0x8dd6('0x37')]();};}function saveUpdates(_0x536748,_0x30980c){return function(_0x5f3e73){if(_0x5f3e73){return _0x5f3e73['update'](_0x536748)[_0x8dd6('0x20')](function(_0x2cc1ba){return _0x2cc1ba;});}return null;};}function removeEntity(_0x4e4813,_0x2dd779){return function(_0x21634a){if(_0x21634a){return _0x21634a[_0x8dd6('0x38')]()[_0x8dd6('0x20')](function(){_0x4e4813[_0x8dd6('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfc40b0,_0x2eb3bc){return function(_0x15cf1f){if(!_0x15cf1f){_0xfc40b0[_0x8dd6('0x2b')](0x194);}return _0x15cf1f;};}function handleError(_0x463f14,_0xe65f3){_0xe65f3=_0xe65f3||0x1f4;return function(_0x2f12e7){logger['error'](_0x2f12e7[_0x8dd6('0x39')]);if(_0x2f12e7[_0x8dd6('0x3a')]){delete _0x2f12e7[_0x8dd6('0x3a')];}_0x463f14[_0x8dd6('0x2c')](_0xe65f3)[_0x8dd6('0x3b')](_0x2f12e7);};}exports[_0x8dd6('0x3c')]=function(_0x4b5ea7,_0x2f9593){var _0x3f4596={},_0x1f48ae={},_0x154c68={'count':0x0,'rows':[]};var _0x13c841=_[_0x8dd6('0x3d')](db[_0x8dd6('0x3e')]['rawAttributes'],function(_0x1b3f5d){return{'name':_0x1b3f5d[_0x8dd6('0x3f')],'type':_0x1b3f5d[_0x8dd6('0x40')]['key']};});_0x1f48ae[_0x8dd6('0x41')]=_['map'](_0x13c841,_0x8dd6('0x3a'));_0x1f48ae[_0x8dd6('0x42')]=_[_0x8dd6('0x43')](_0x4b5ea7[_0x8dd6('0x42')]);_0x1f48ae['filters']=_[_0x8dd6('0x44')](_0x1f48ae[_0x8dd6('0x41')],_0x1f48ae[_0x8dd6('0x42')]);_0x3f4596[_0x8dd6('0x45')]=_[_0x8dd6('0x44')](_0x1f48ae[_0x8dd6('0x41')],qs[_0x8dd6('0x46')](_0x4b5ea7[_0x8dd6('0x42')][_0x8dd6('0x46')]));_0x3f4596['attributes']=_0x3f4596[_0x8dd6('0x45')][_0x8dd6('0x47')]?_0x3f4596[_0x8dd6('0x45')]:_0x1f48ae[_0x8dd6('0x41')];if(!_0x4b5ea7[_0x8dd6('0x42')][_0x8dd6('0x48')](_0x8dd6('0x49'))){_0x3f4596[_0x8dd6('0x30')]=qs[_0x8dd6('0x30')](_0x4b5ea7[_0x8dd6('0x42')]['limit']);_0x3f4596[_0x8dd6('0x2e')]=qs['offset'](_0x4b5ea7[_0x8dd6('0x42')][_0x8dd6('0x2e')]);}_0x3f4596['order']=qs[_0x8dd6('0x4a')](_0x4b5ea7[_0x8dd6('0x42')][_0x8dd6('0x4a')]);_0x3f4596[_0x8dd6('0x4b')]=qs[_0x8dd6('0x4c')](_[_0x8dd6('0x4d')](_0x4b5ea7['query'],_0x1f48ae[_0x8dd6('0x4c')]),_0x13c841);if(_0x4b5ea7['query'][_0x8dd6('0x4e')]){_0x3f4596[_0x8dd6('0x4b')]=_['merge'](_0x3f4596[_0x8dd6('0x4b')],{'$or':_['map'](_0x13c841,function(_0x5d802b){if(_0x5d802b[_0x8dd6('0x40')]!=='VIRTUAL'){var _0xc56d53={};_0xc56d53[_0x5d802b[_0x8dd6('0x3a')]]={'$like':'%'+_0x4b5ea7[_0x8dd6('0x42')][_0x8dd6('0x4e')]+'%'};return _0xc56d53;}})});}_0x3f4596=_['merge']({},_0x3f4596,_0x4b5ea7[_0x8dd6('0x4f')]);var _0x11cbe3={'where':_0x3f4596[_0x8dd6('0x4b')]};return db[_0x8dd6('0x3e')][_0x8dd6('0x31')](_0x11cbe3)[_0x8dd6('0x20')](function(_0x3fe6b1){_0x154c68[_0x8dd6('0x31')]=_0x3fe6b1;if(_0x4b5ea7['query'][_0x8dd6('0x50')]){_0x3f4596[_0x8dd6('0x51')]=[{'all':!![]}];}return db[_0x8dd6('0x3e')]['findAll'](_0x3f4596);})['then'](function(_0x2c9283){_0x154c68[_0x8dd6('0x52')]=_0x2c9283;return _0x154c68;})[_0x8dd6('0x20')](respondWithFilteredResult(_0x2f9593,_0x3f4596))['catch'](handleError(_0x2f9593,null));};exports[_0x8dd6('0x53')]=function(_0x2ea4fd,_0x5e5fc4){var _0x5bbcec={'raw':!![],'where':{'id':_0x2ea4fd[_0x8dd6('0x54')]['id']}},_0x5db266={};_0x5db266['model']=_[_0x8dd6('0x43')](db['WhatsappMessage'][_0x8dd6('0x55')]);_0x5db266[_0x8dd6('0x42')]=_[_0x8dd6('0x43')](_0x2ea4fd['query']);_0x5db266[_0x8dd6('0x4c')]=_[_0x8dd6('0x44')](_0x5db266[_0x8dd6('0x41')],_0x5db266[_0x8dd6('0x42')]);_0x5bbcec[_0x8dd6('0x45')]=_[_0x8dd6('0x44')](_0x5db266[_0x8dd6('0x41')],qs[_0x8dd6('0x46')](_0x2ea4fd[_0x8dd6('0x42')][_0x8dd6('0x46')]));_0x5bbcec[_0x8dd6('0x45')]=_0x5bbcec['attributes'][_0x8dd6('0x47')]?_0x5bbcec['attributes']:_0x5db266[_0x8dd6('0x41')];if(_0x2ea4fd[_0x8dd6('0x42')][_0x8dd6('0x50')]){_0x5bbcec['include']=[{'all':!![]}];}_0x5bbcec=_['merge']({},_0x5bbcec,_0x2ea4fd[_0x8dd6('0x4f')]);return db[_0x8dd6('0x3e')][_0x8dd6('0x56')](_0x5bbcec)[_0x8dd6('0x20')](handleEntityNotFound(_0x5e5fc4,null))[_0x8dd6('0x20')](respondWithResult(_0x5e5fc4,null))[_0x8dd6('0x57')](handleError(_0x5e5fc4,null));};exports[_0x8dd6('0x58')]=function(_0xa9b598,_0x2e9e81){return db['WhatsappMessage'][_0x8dd6('0x58')](_0xa9b598[_0x8dd6('0x59')],{})['then'](respondWithResult(_0x2e9e81,0xc9))['catch'](handleError(_0x2e9e81,null));};exports['update']=function(_0x592978,_0x264c73){if(_0x592978[_0x8dd6('0x59')]['id']){delete _0x592978[_0x8dd6('0x59')]['id'];}return db['WhatsappMessage'][_0x8dd6('0x56')]({'where':{'id':_0x592978[_0x8dd6('0x54')]['id']}})[_0x8dd6('0x20')](handleEntityNotFound(_0x264c73,null))[_0x8dd6('0x20')](saveUpdates(_0x592978[_0x8dd6('0x59')],null))[_0x8dd6('0x20')](respondWithResult(_0x264c73,null))['catch'](handleError(_0x264c73,null));};exports['destroy']=function(_0x45c3f8,_0x3585ca){return db[_0x8dd6('0x3e')][_0x8dd6('0x56')]({'where':{'id':_0x45c3f8['params']['id']}})[_0x8dd6('0x20')](handleEntityNotFound(_0x3585ca,null))['then'](removeEntity(_0x3585ca,null))[_0x8dd6('0x57')](handleError(_0x3585ca,null));};exports['describe']=function(_0x278a3a,_0x5aa36e){return db['WhatsappMessage']['describe']()['then'](respondWithResult(_0x5aa36e,null))[_0x8dd6('0x57')](handleError(_0x5aa36e,null));};var interaction_log=require(_0x8dd6('0x13'))(_0x8dd6('0x5a'));exports['accept']=function(_0x2ce69e,_0x573578,_0x5e7dad){var _0x246f1a={'agent':{},'channel':_0x8dd6('0x5b')};if(_0x2ce69e[_0x8dd6('0x59')]['id']){delete _0x2ce69e[_0x8dd6('0x59')]['id'];}_0x2ce69e[_0x8dd6('0x59')][_0x8dd6('0x5c')]=!![];_0x2ce69e[_0x8dd6('0x59')][_0x8dd6('0x5d')]=moment()[_0x8dd6('0x5e')](_0x8dd6('0x5f'));_0x2ce69e[_0x8dd6('0x59')]['UserId']=_0x2ce69e[_0x8dd6('0x59')][_0x8dd6('0x60')]||_0x2ce69e[_0x8dd6('0x61')]['id'];_0x246f1a['agent']['id']=_0x2ce69e[_0x8dd6('0x59')]['UserId'];return db[_0x8dd6('0x3e')]['find']({'where':{'id':_0x2ce69e[_0x8dd6('0x54')]['id'],'UserId':null}})[_0x8dd6('0x20')](handleEntityNotFound(_0x573578,null))['then'](saveUpdates(_0x2ce69e[_0x8dd6('0x59')],null))[_0x8dd6('0x20')](function(_0x22036c){if(_0x22036c){_0x246f1a[_0x8dd6('0x29')]=_0x22036c[_0x8dd6('0x62')]({'plain':!![]});return db[_0x8dd6('0x63')]['find']({'where':{'id':_0x22036c[_0x8dd6('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x573578,null))['then'](function(_0x3006ce){if(_0x3006ce){return _0x3006ce[_0x8dd6('0x65')]({'UserId':_0x2ce69e[_0x8dd6('0x59')][_0x8dd6('0x60')],'read1stAt':_[_0x8dd6('0x66')](_0x3006ce[_0x8dd6('0x67')])?moment()[_0x8dd6('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x8dd6('0x20')](function(_0xbfa42e){if(_0xbfa42e){_0x246f1a[_0x8dd6('0x68')]=_0xbfa42e['get']({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2ce69e[_0x8dd6('0x61')]['id'],_0x2ce69e[_0x8dd6('0x61')][_0x8dd6('0x3a')],_0x2ce69e[_0x8dd6('0x61')]['role'],_0x246f1a[_0x8dd6('0x68')]['id'],_0x2ce69e[_0x8dd6('0x59')]?JSON[_0x8dd6('0x26')](_0x2ce69e[_0x8dd6('0x59')]):_0x8dd6('0x69'));return respondWithRpcPromise(_0x8dd6('0x6a'),_0x8dd6('0x6b'),_0x246f1a);}return null;})[_0x8dd6('0x20')](function(_0x4b2480){var _0x56acab=_0x8dd6('0x6c')+_0x4b2480['message']['ContactId'];return db[_0x8dd6('0x6d')][_0x8dd6('0x42')](_0x56acab,{'type':db[_0x8dd6('0x6e')][_0x8dd6('0x6f')]['SELECT'],'raw':!![]})[_0x8dd6('0x20')](function(_0xb79b9a){return _0xb79b9a;});})[_0x8dd6('0x20')](function(_0x397129){if(_0x397129){_0x246f1a[_0x8dd6('0x29')]['contact']=_0x397129[0x0];if(!_0x2ce69e['body'][_0x8dd6('0x60')])return;return db[_0x8dd6('0x70')][_0x8dd6('0x56')]({'where':{'id':_0x2ce69e['body']['UserId'],'role':_0x8dd6('0x71')},'attributes':['id',_0x8dd6('0x3a'),_0x8dd6('0x72'),'email',_0x8dd6('0x73')],'raw':!![]});}return null;})[_0x8dd6('0x20')](function(_0x836713){if(!_0x836713)return null;_0x246f1a['message'][_0x8dd6('0x71')]=_0x836713;return _0x246f1a;})[_0x8dd6('0x20')](function(_0x27ba59){if(_0x27ba59){if(_0x2ce69e[_0x8dd6('0x59')][_0x8dd6('0x74')]){_0x246f1a[_0x8dd6('0x29')][_0x8dd6('0x75')]=util[_0x8dd6('0x5e')](_0x8dd6('0x76'),_0x2ce69e['user'][_0x8dd6('0x3a')]);_0x246f1a['message'][_0x8dd6('0x77')]=_0x246f1a[_0x8dd6('0x77')];_0x246f1a[_0x8dd6('0x29')][_0x8dd6('0x78')]=_0x8dd6('0x79');return respondWithRpcPromise(_0x8dd6('0x7a'),_0x8dd6('0x7a'),{'event':_0x8dd6('0x7b'),'message':_0x246f1a[_0x8dd6('0x29')]},client9002)[_0x8dd6('0x20')](function(){return _0x246f1a;});}return _0x246f1a;}return null;})[_0x8dd6('0x20')](respondWithResult(_0x573578,null))['catch'](handleError(_0x573578,null));};var interaction_log=require(_0x8dd6('0x13'))(_0x8dd6('0x5a'));exports['reject']=function(_0x3dd0a1,_0x3c0977,_0x302103){var _0xafbc5b={'agent':{},'channel':_0x8dd6('0x5b')};if(_0x3dd0a1[_0x8dd6('0x59')]['id']){delete _0x3dd0a1[_0x8dd6('0x59')]['id'];}_0x3dd0a1[_0x8dd6('0x59')]['UserId']=_0x3dd0a1[_0x8dd6('0x59')][_0x8dd6('0x60')]||_0x3dd0a1[_0x8dd6('0x61')]['id'];_0xafbc5b['agent']['id']=_0x3dd0a1[_0x8dd6('0x59')][_0x8dd6('0x60')];return db['WhatsappMessage'][_0x8dd6('0x56')]({'where':{'id':_0x3dd0a1['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c0977,null))[_0x8dd6('0x20')](function(_0x5acf86){if(_0x5acf86){_0xafbc5b[_0x8dd6('0x29')]=_0x5acf86['get']({'plain':!![]});return db[_0x8dd6('0x63')][_0x8dd6('0x56')]({'where':{'id':_0x5acf86['WhatsappInteractionId']}});}return null;})[_0x8dd6('0x20')](handleEntityNotFound(_0x3c0977,null))[_0x8dd6('0x20')](function(_0x33ae8d){if(_0x33ae8d){_0xafbc5b[_0x8dd6('0x68')]=_0x33ae8d[_0x8dd6('0x62')]({'plain':!![]});interaction_log[_0x8dd6('0x21')](_0x8dd6('0x7c'),_0x3dd0a1[_0x8dd6('0x61')]['id'],_0x3dd0a1[_0x8dd6('0x61')][_0x8dd6('0x3a')],_0x3dd0a1[_0x8dd6('0x61')][_0x8dd6('0x7d')],_0xafbc5b[_0x8dd6('0x68')]['id'],_0x3dd0a1[_0x8dd6('0x59')]?JSON[_0x8dd6('0x26')](_0x3dd0a1['body']):_0x8dd6('0x69'));return respondWithRpcPromise(_0x8dd6('0x7e'),_0x8dd6('0x7f'),_0xafbc5b);}return null;})[_0x8dd6('0x20')](function(_0x969f81){var _0x256ef3=_0x8dd6('0x6c')+_0x969f81[_0x8dd6('0x29')]['ContactId'];return db[_0x8dd6('0x6d')][_0x8dd6('0x42')](_0x256ef3,{'type':db[_0x8dd6('0x6e')][_0x8dd6('0x6f')][_0x8dd6('0x80')],'raw':!![]})['then'](function(_0x568ced){return _0x568ced;});})['then'](function(_0x423a96){if(_0x423a96){_0xafbc5b[_0x8dd6('0x29')][_0x8dd6('0x81')]=_0x423a96[0x0];if(!_0x3dd0a1[_0x8dd6('0x59')][_0x8dd6('0x60')])return;return db[_0x8dd6('0x70')][_0x8dd6('0x56')]({'where':{'id':_0x3dd0a1[_0x8dd6('0x59')][_0x8dd6('0x60')],'role':_0x8dd6('0x71')},'attributes':['id','name',_0x8dd6('0x72'),_0x8dd6('0x82'),_0x8dd6('0x73')],'raw':!![]});}return null;})[_0x8dd6('0x20')](function(_0x4bfb1f){if(!_0x4bfb1f)return null;_0xafbc5b[_0x8dd6('0x29')][_0x8dd6('0x71')]=_0x4bfb1f;return _0xafbc5b;})['then'](function(_0x5949dd){if(_0x5949dd){_0x5949dd[_0x8dd6('0x29')][_0x8dd6('0x75')]=util[_0x8dd6('0x5e')]('SIP/%s',_0x3dd0a1[_0x8dd6('0x61')][_0x8dd6('0x3a')]);_0x5949dd[_0x8dd6('0x29')][_0x8dd6('0x77')]=_0xafbc5b['channel'];_0x5949dd[_0x8dd6('0x29')][_0x8dd6('0x78')]='reject';respondWithRpcPromise(_0x8dd6('0x7a'),_0x8dd6('0x7a'),{'event':_0x8dd6('0x83'),'message':_0x5949dd[_0x8dd6('0x29')]},client9002);return _0xafbc5b;}return null;})[_0x8dd6('0x20')](respondWithResult(_0x3c0977,null))[_0x8dd6('0x57')](handleError(_0x3c0977,null));};exports['status']=function(_0x55678a,_0x2657ac,_0x23c2b4){if(_0x55678a[_0x8dd6('0x59')]['id']){delete _0x55678a['body']['id'];}var _0x20db6e;return db['WhatsappMessage'][_0x8dd6('0x56')]({'where':{'id':_0x55678a['params']['id']}})[_0x8dd6('0x20')](handleEntityNotFound(_0x2657ac,null))[_0x8dd6('0x20')](function(_0x5d7bf8){if(_0x5d7bf8){_0x20db6e=_0x5d7bf8;return db[_0x8dd6('0x84')][_0x8dd6('0x56')]({'where':{'id':_0x5d7bf8['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x2657ac,null))[_0x8dd6('0x20')](function(_0x582186){if(_0x582186){logger[_0x8dd6('0x24')](_0x8dd6('0x85'),_0x8dd6('0x2c'),_0x8dd6('0x86'),_0x582186[_0x8dd6('0x40')],util[_0x8dd6('0x87')](_0x55678a[_0x8dd6('0x59')],{'showHidden':![],'depth':null}));switch(_0x582186[_0x8dd6('0x40')]){case _0x8dd6('0x88'):if(_0x55678a[_0x8dd6('0x59')][_0x8dd6('0x89')]&&_0x55678a['body'][_0x8dd6('0x89')]===_0x20db6e[_0x8dd6('0x8a')]&&_0x55678a['body'][_0x8dd6('0x8b')]&&_0x55678a[_0x8dd6('0x59')][_0x8dd6('0x8b')]===_0x8dd6('0x5c')){return _0x20db6e[_0x8dd6('0x65')]({'read':!![]});}else{logger[_0x8dd6('0x27')](_0x8dd6('0x8c'),_0x8dd6('0x2c'),_0x8dd6('0x88'),util[_0x8dd6('0x87')](_0x55678a[_0x8dd6('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x20db6e;}})['then'](respondWithResult(_0x2657ac,null))[_0x8dd6('0x57')](handleError(_0x2657ac,null));}; \ No newline at end of file +var _0xa6cd=['debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','end','stack','name','send','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','rows','params','merge','find','create','update','body','destroy','describe','accept','whatsapp','read','format','UserId','user','agent','get','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','User','email','internal','interface','SIP/%s','channel','EventManager','acceptmessage','whatsapp-interactions','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','messageId','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x3485de,_0x319486){var _0x21551f=function(_0x239f28){while(--_0x239f28){_0x3485de['push'](_0x3485de['shift']());}};_0x21551f(++_0x319486);}(_0xa6cd,0x64));var _0xda6c=function(_0x22d19b,_0x2ae63c){_0x22d19b=_0x22d19b-0x0;var _0x220d85=_0xa6cd[_0x22d19b];return _0x220d85;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda6c('0x0'));var zipdir=require(_0xda6c('0x1'));var jsonpatch=require(_0xda6c('0x2'));var rp=require(_0xda6c('0x3'));var moment=require(_0xda6c('0x4'));var BPromise=require(_0xda6c('0x5'));var Mustache=require(_0xda6c('0x6'));var util=require(_0xda6c('0x7'));var path=require(_0xda6c('0x8'));var sox=require(_0xda6c('0x9'));var csv=require(_0xda6c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda6c('0xb'));var squel=require('squel');var crypto=require(_0xda6c('0xc'));var jsforce=require(_0xda6c('0xd'));var deskjs=require(_0xda6c('0xe'));var toCsv=require(_0xda6c('0xa'));var querystring=require(_0xda6c('0xf'));var Papa=require('papaparse');var Redis=require(_0xda6c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xda6c('0x11'));var as=require(_0xda6c('0x12'));var hardwareService=require(_0xda6c('0x13'));var logger=require(_0xda6c('0x14'))(_0xda6c('0x15'));var utils=require(_0xda6c('0x16'));var config=require(_0xda6c('0x17'));var licenseUtil=require(_0xda6c('0x18'));var db=require(_0xda6c('0x19'))['db'];config[_0xda6c('0x1a')]=_[_0xda6c('0x1b')](config[_0xda6c('0x1a')],{'host':_0xda6c('0x1c'),'port':0x18eb});var socket=require(_0xda6c('0x1d'))(new Redis(config[_0xda6c('0x1a')]));require(_0xda6c('0x1e'))[_0xda6c('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xda6c('0x20')][_0xda6c('0x21')]({'port':0x232c});var client9002=jayson[_0xda6c('0x20')][_0xda6c('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x571db6,_0x400a19,_0x221f33,_0x3efebc){return new BPromise(function(_0x4adb29,_0x5b8a6f){var _0xf5b7bd=_0x3efebc||client;return _0xf5b7bd[_0xda6c('0x22')](_0x571db6,_0x221f33)[_0xda6c('0x23')](function(_0x54ebb0){logger[_0xda6c('0x24')](_0xda6c('0x25'),_0x400a19,_0xda6c('0x26'));logger[_0xda6c('0x27')](_0xda6c('0x28'),_0x400a19,_0xda6c('0x26'),JSON['stringify'](_0x54ebb0));if(_0x54ebb0[_0xda6c('0x29')]){if(_0x54ebb0['error'][_0xda6c('0x2a')]===0x1f4){logger[_0xda6c('0x29')](_0xda6c('0x25'),_0x400a19,_0x54ebb0[_0xda6c('0x29')][_0xda6c('0x2b')]);return _0x5b8a6f(_0x54ebb0[_0xda6c('0x29')]['message']);}logger[_0xda6c('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x400a19,_0x54ebb0[_0xda6c('0x29')][_0xda6c('0x2b')]);return _0x4adb29(_0x54ebb0['error'][_0xda6c('0x2b')]);}else{logger[_0xda6c('0x24')](_0xda6c('0x25'),_0x400a19,_0xda6c('0x26'));_0x4adb29(_0x54ebb0[_0xda6c('0x2c')][_0xda6c('0x2b')]);}})[_0xda6c('0x2d')](function(_0x20786e){logger[_0xda6c('0x29')](_0xda6c('0x25'),_0x400a19,_0x20786e);_0x5b8a6f(_0x20786e);});});}function respondWithStatusCode(_0xba8296,_0xe6634a){_0xe6634a=_0xe6634a||0xcc;return function(_0x264786){if(_0x264786){return _0xba8296[_0xda6c('0x2e')](_0xe6634a);}return _0xba8296[_0xda6c('0x2f')](_0xe6634a)['end']();};}function respondWithResult(_0xcb0a0f,_0x40ea75){_0x40ea75=_0x40ea75||0xc8;return function(_0x4d259c){if(_0x4d259c){return _0xcb0a0f['status'](_0x40ea75)[_0xda6c('0x30')](_0x4d259c);}};}function respondWithFilteredResult(_0x5c37cb,_0x529260){return function(_0x2f9efb){if(_0x2f9efb){var _0x43aacf=typeof _0x529260['offset']===_0xda6c('0x31')&&typeof _0x529260[_0xda6c('0x32')]===_0xda6c('0x31');var _0xe59127=_0x2f9efb['count'];var _0x151af9=_0x43aacf?0x0:_0x529260[_0xda6c('0x33')];var _0x23aa9a=_0x43aacf?_0x2f9efb[_0xda6c('0x34')]:_0x529260[_0xda6c('0x33')]+_0x529260[_0xda6c('0x32')];var _0x1f0cd9;if(_0x23aa9a>=_0xe59127){_0x23aa9a=_0xe59127;_0x1f0cd9=0xc8;}else{_0x1f0cd9=0xce;}_0x5c37cb[_0xda6c('0x2f')](_0x1f0cd9);return _0x5c37cb[_0xda6c('0x35')](_0xda6c('0x36'),_0x151af9+'-'+_0x23aa9a+'/'+_0xe59127)[_0xda6c('0x30')](_0x2f9efb);}return null;};}function patchUpdates(_0x5061a7){return function(_0x53b2dd){try{jsonpatch[_0xda6c('0x37')](_0x53b2dd,_0x5061a7,!![]);}catch(_0x28452c){return BPromise[_0xda6c('0x38')](_0x28452c);}return _0x53b2dd[_0xda6c('0x39')]();};}function saveUpdates(_0x134387,_0x313c56){return function(_0xdbbd2f){if(_0xdbbd2f){return _0xdbbd2f['update'](_0x134387)[_0xda6c('0x23')](function(_0x365f66){return _0x365f66;});}return null;};}function removeEntity(_0x1ca14b,_0x53d097){return function(_0x2ee662){if(_0x2ee662){return _0x2ee662['destroy']()[_0xda6c('0x23')](function(){_0x1ca14b[_0xda6c('0x2f')](0xcc)[_0xda6c('0x3a')]();});}};}function handleEntityNotFound(_0x43bbc3,_0x1815e0){return function(_0x58da2e){if(!_0x58da2e){_0x43bbc3[_0xda6c('0x2e')](0x194);}return _0x58da2e;};}function handleError(_0x274688,_0x5c5ec0){_0x5c5ec0=_0x5c5ec0||0x1f4;return function(_0x3260ee){logger[_0xda6c('0x29')](_0x3260ee[_0xda6c('0x3b')]);if(_0x3260ee[_0xda6c('0x3c')]){delete _0x3260ee[_0xda6c('0x3c')];}_0x274688[_0xda6c('0x2f')](_0x5c5ec0)[_0xda6c('0x3d')](_0x3260ee);};}exports['index']=function(_0x2a8593,_0x5cef1a){var _0x4df6bd={},_0x5c5ed3={},_0x433b6e={'count':0x0,'rows':[]};var _0x10f3fa=_[_0xda6c('0x3e')](db[_0xda6c('0x3f')][_0xda6c('0x40')],function(_0x1f5208){return{'name':_0x1f5208[_0xda6c('0x41')],'type':_0x1f5208[_0xda6c('0x42')][_0xda6c('0x43')]};});_0x5c5ed3[_0xda6c('0x44')]=_[_0xda6c('0x3e')](_0x10f3fa,_0xda6c('0x3c'));_0x5c5ed3['query']=_[_0xda6c('0x45')](_0x2a8593[_0xda6c('0x46')]);_0x5c5ed3[_0xda6c('0x47')]=_['intersection'](_0x5c5ed3[_0xda6c('0x44')],_0x5c5ed3['query']);_0x4df6bd[_0xda6c('0x48')]=_[_0xda6c('0x49')](_0x5c5ed3[_0xda6c('0x44')],qs[_0xda6c('0x4a')](_0x2a8593[_0xda6c('0x46')]['fields']));_0x4df6bd['attributes']=_0x4df6bd[_0xda6c('0x48')][_0xda6c('0x4b')]?_0x4df6bd['attributes']:_0x5c5ed3[_0xda6c('0x44')];if(!_0x2a8593['query']['hasOwnProperty'](_0xda6c('0x4c'))){_0x4df6bd['limit']=qs[_0xda6c('0x32')](_0x2a8593[_0xda6c('0x46')][_0xda6c('0x32')]);_0x4df6bd[_0xda6c('0x33')]=qs['offset'](_0x2a8593[_0xda6c('0x46')][_0xda6c('0x33')]);}_0x4df6bd[_0xda6c('0x4d')]=qs[_0xda6c('0x4e')](_0x2a8593[_0xda6c('0x46')][_0xda6c('0x4e')]);_0x4df6bd[_0xda6c('0x4f')]=qs[_0xda6c('0x47')](_['pick'](_0x2a8593[_0xda6c('0x46')],_0x5c5ed3['filters']),_0x10f3fa);if(_0x2a8593[_0xda6c('0x46')][_0xda6c('0x50')]){_0x4df6bd[_0xda6c('0x4f')]=_['merge'](_0x4df6bd['where'],{'$or':_[_0xda6c('0x3e')](_0x10f3fa,function(_0x3e1d2a){if(_0x3e1d2a['type']!==_0xda6c('0x51')){var _0x24904b={};_0x24904b[_0x3e1d2a[_0xda6c('0x3c')]]={'$like':'%'+_0x2a8593[_0xda6c('0x46')]['filter']+'%'};return _0x24904b;}})});}_0x4df6bd=_['merge']({},_0x4df6bd,_0x2a8593[_0xda6c('0x52')]);var _0x387fe3={'where':_0x4df6bd[_0xda6c('0x4f')]};return db[_0xda6c('0x3f')]['count'](_0x387fe3)[_0xda6c('0x23')](function(_0x1ca9bd){_0x433b6e[_0xda6c('0x34')]=_0x1ca9bd;if(_0x2a8593[_0xda6c('0x46')][_0xda6c('0x53')]){_0x4df6bd[_0xda6c('0x54')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x4df6bd);})['then'](function(_0x44ee02){_0x433b6e[_0xda6c('0x55')]=_0x44ee02;return _0x433b6e;})[_0xda6c('0x23')](respondWithFilteredResult(_0x5cef1a,_0x4df6bd))[_0xda6c('0x2d')](handleError(_0x5cef1a,null));};exports['show']=function(_0x4921ef,_0x570b5f){var _0x3c7458={'raw':!![],'where':{'id':_0x4921ef[_0xda6c('0x56')]['id']}},_0x19dab7={};_0x19dab7[_0xda6c('0x44')]=_[_0xda6c('0x45')](db[_0xda6c('0x3f')][_0xda6c('0x40')]);_0x19dab7[_0xda6c('0x46')]=_['keys'](_0x4921ef['query']);_0x19dab7['filters']=_[_0xda6c('0x49')](_0x19dab7['model'],_0x19dab7[_0xda6c('0x46')]);_0x3c7458[_0xda6c('0x48')]=_[_0xda6c('0x49')](_0x19dab7['model'],qs[_0xda6c('0x4a')](_0x4921ef[_0xda6c('0x46')]['fields']));_0x3c7458[_0xda6c('0x48')]=_0x3c7458[_0xda6c('0x48')][_0xda6c('0x4b')]?_0x3c7458[_0xda6c('0x48')]:_0x19dab7[_0xda6c('0x44')];if(_0x4921ef[_0xda6c('0x46')][_0xda6c('0x53')]){_0x3c7458['include']=[{'all':!![]}];}_0x3c7458=_[_0xda6c('0x57')]({},_0x3c7458,_0x4921ef[_0xda6c('0x52')]);return db[_0xda6c('0x3f')][_0xda6c('0x58')](_0x3c7458)['then'](handleEntityNotFound(_0x570b5f,null))[_0xda6c('0x23')](respondWithResult(_0x570b5f,null))['catch'](handleError(_0x570b5f,null));};exports[_0xda6c('0x59')]=function(_0x39d7fb,_0x563683){return db[_0xda6c('0x3f')][_0xda6c('0x59')](_0x39d7fb['body'],{})[_0xda6c('0x23')](respondWithResult(_0x563683,0xc9))[_0xda6c('0x2d')](handleError(_0x563683,null));};exports[_0xda6c('0x5a')]=function(_0x314c93,_0x18f8d1){if(_0x314c93[_0xda6c('0x5b')]['id']){delete _0x314c93[_0xda6c('0x5b')]['id'];}return db['WhatsappMessage'][_0xda6c('0x58')]({'where':{'id':_0x314c93[_0xda6c('0x56')]['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x18f8d1,null))[_0xda6c('0x23')](saveUpdates(_0x314c93[_0xda6c('0x5b')],null))[_0xda6c('0x23')](respondWithResult(_0x18f8d1,null))[_0xda6c('0x2d')](handleError(_0x18f8d1,null));};exports[_0xda6c('0x5c')]=function(_0x118721,_0x4816ec){return db['WhatsappMessage'][_0xda6c('0x58')]({'where':{'id':_0x118721['params']['id']}})['then'](handleEntityNotFound(_0x4816ec,null))[_0xda6c('0x23')](removeEntity(_0x4816ec,null))[_0xda6c('0x2d')](handleError(_0x4816ec,null));};exports['describe']=function(_0x10a516,_0xb67289){return db['WhatsappMessage'][_0xda6c('0x5d')]()[_0xda6c('0x23')](respondWithResult(_0xb67289,null))[_0xda6c('0x2d')](handleError(_0xb67289,null));};var interaction_log=require(_0xda6c('0x14'))('whatsapp-interactions');exports[_0xda6c('0x5e')]=function(_0x19f035,_0x2553ce,_0x2cf182){var _0x1872f6={'agent':{},'channel':_0xda6c('0x5f')};if(_0x19f035[_0xda6c('0x5b')]['id']){delete _0x19f035[_0xda6c('0x5b')]['id'];}_0x19f035['body'][_0xda6c('0x60')]=!![];_0x19f035['body']['readAt']=moment()[_0xda6c('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x19f035[_0xda6c('0x5b')][_0xda6c('0x62')]=_0x19f035[_0xda6c('0x5b')][_0xda6c('0x62')]||_0x19f035[_0xda6c('0x63')]['id'];_0x1872f6[_0xda6c('0x64')]['id']=_0x19f035[_0xda6c('0x5b')][_0xda6c('0x62')];return db[_0xda6c('0x3f')][_0xda6c('0x58')]({'where':{'id':_0x19f035['params']['id'],'UserId':null}})[_0xda6c('0x23')](handleEntityNotFound(_0x2553ce,null))[_0xda6c('0x23')](saveUpdates(_0x19f035[_0xda6c('0x5b')],null))[_0xda6c('0x23')](function(_0x4d98ce){if(_0x4d98ce){_0x1872f6[_0xda6c('0x2b')]=_0x4d98ce[_0xda6c('0x65')]({'plain':!![]});return db['WhatsappInteraction'][_0xda6c('0x58')]({'where':{'id':_0x4d98ce[_0xda6c('0x66')]}});}return null;})[_0xda6c('0x23')](handleEntityNotFound(_0x2553ce,null))[_0xda6c('0x23')](function(_0x1e44a1){if(_0x1e44a1){return _0x1e44a1['update']({'UserId':_0x19f035['body'][_0xda6c('0x62')],'read1stAt':_[_0xda6c('0x67')](_0x1e44a1[_0xda6c('0x68')])?moment()[_0xda6c('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xda6c('0x23')](function(_0x4710a1){if(_0x4710a1){_0x1872f6[_0xda6c('0x69')]=_0x4710a1[_0xda6c('0x65')]({'plain':!![]});interaction_log[_0xda6c('0x24')](_0xda6c('0x6a'),_0x19f035[_0xda6c('0x63')]['id'],_0x19f035['user']['name'],_0x19f035[_0xda6c('0x63')][_0xda6c('0x6b')],_0x1872f6[_0xda6c('0x69')]['id'],_0x19f035[_0xda6c('0x5b')]?JSON['stringify'](_0x19f035[_0xda6c('0x5b')]):_0xda6c('0x6c'));return respondWithRpcPromise(_0xda6c('0x6d'),_0xda6c('0x6e'),_0x1872f6);}return null;})[_0xda6c('0x23')](function(_0x38faca){var _0x3c0232='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x38faca[_0xda6c('0x2b')][_0xda6c('0x6f')];return db[_0xda6c('0x70')][_0xda6c('0x46')](_0x3c0232,{'type':db[_0xda6c('0x71')][_0xda6c('0x72')]['SELECT'],'raw':!![]})[_0xda6c('0x23')](function(_0x3cb9e4){return _0x3cb9e4;});})[_0xda6c('0x23')](function(_0x3b7822){if(_0x3b7822){_0x1872f6[_0xda6c('0x2b')][_0xda6c('0x73')]=_0x3b7822[0x0];if(!_0x19f035[_0xda6c('0x5b')]['UserId'])return;return db[_0xda6c('0x74')][_0xda6c('0x58')]({'where':{'id':_0x19f035[_0xda6c('0x5b')][_0xda6c('0x62')],'role':_0xda6c('0x64')},'attributes':['id',_0xda6c('0x3c'),'fullname',_0xda6c('0x75'),_0xda6c('0x76')],'raw':!![]});}return null;})['then'](function(_0x3f4482){if(!_0x3f4482)return null;_0x1872f6['message'][_0xda6c('0x64')]=_0x3f4482;return _0x1872f6;})[_0xda6c('0x23')](function(_0x20375d){if(_0x20375d){if(_0x19f035[_0xda6c('0x5b')]['manual']){_0x1872f6[_0xda6c('0x2b')][_0xda6c('0x77')]=util[_0xda6c('0x61')](_0xda6c('0x78'),_0x19f035['user'][_0xda6c('0x3c')]);_0x1872f6['message']['channel']=_0x1872f6[_0xda6c('0x79')];_0x1872f6['message']['event']=_0xda6c('0x5e');return respondWithRpcPromise(_0xda6c('0x7a'),_0xda6c('0x7a'),{'event':_0xda6c('0x7b'),'message':_0x1872f6[_0xda6c('0x2b')]},client9002)[_0xda6c('0x23')](function(){return _0x1872f6;});}return _0x1872f6;}return null;})[_0xda6c('0x23')](respondWithResult(_0x2553ce,null))['catch'](handleError(_0x2553ce,null));};var interaction_log=require('../../config/logger')(_0xda6c('0x7c'));exports['reject']=function(_0x163ac8,_0x1ddd07,_0x4890e9){var _0x3e6fc3={'agent':{},'channel':_0xda6c('0x5f')};if(_0x163ac8['body']['id']){delete _0x163ac8['body']['id'];}_0x163ac8['body'][_0xda6c('0x62')]=_0x163ac8[_0xda6c('0x5b')][_0xda6c('0x62')]||_0x163ac8[_0xda6c('0x63')]['id'];_0x3e6fc3[_0xda6c('0x64')]['id']=_0x163ac8[_0xda6c('0x5b')][_0xda6c('0x62')];return db[_0xda6c('0x3f')]['find']({'where':{'id':_0x163ac8[_0xda6c('0x56')]['id'],'UserId':null}})[_0xda6c('0x23')](handleEntityNotFound(_0x1ddd07,null))['then'](function(_0x344d87){if(_0x344d87){_0x3e6fc3['message']=_0x344d87[_0xda6c('0x65')]({'plain':!![]});return db[_0xda6c('0x7d')]['find']({'where':{'id':_0x344d87[_0xda6c('0x66')]}});}return null;})[_0xda6c('0x23')](handleEntityNotFound(_0x1ddd07,null))['then'](function(_0x33ea67){if(_0x33ea67){_0x3e6fc3[_0xda6c('0x69')]=_0x33ea67[_0xda6c('0x65')]({'plain':!![]});interaction_log[_0xda6c('0x24')](_0xda6c('0x7e'),_0x163ac8[_0xda6c('0x63')]['id'],_0x163ac8[_0xda6c('0x63')][_0xda6c('0x3c')],_0x163ac8[_0xda6c('0x63')][_0xda6c('0x6b')],_0x3e6fc3[_0xda6c('0x69')]['id'],_0x163ac8[_0xda6c('0x5b')]?JSON[_0xda6c('0x7f')](_0x163ac8[_0xda6c('0x5b')]):_0xda6c('0x6c'));return respondWithRpcPromise('RejectMessage',_0xda6c('0x80'),_0x3e6fc3);}return null;})[_0xda6c('0x23')](function(_0xb877f7){var _0x37df99=_0xda6c('0x81')+_0xb877f7[_0xda6c('0x2b')][_0xda6c('0x6f')];return db[_0xda6c('0x70')][_0xda6c('0x46')](_0x37df99,{'type':db[_0xda6c('0x71')]['QueryTypes']['SELECT'],'raw':!![]})[_0xda6c('0x23')](function(_0x1f0265){return _0x1f0265;});})[_0xda6c('0x23')](function(_0x1fab03){if(_0x1fab03){_0x3e6fc3[_0xda6c('0x2b')][_0xda6c('0x73')]=_0x1fab03[0x0];if(!_0x163ac8['body'][_0xda6c('0x62')])return;return db[_0xda6c('0x74')][_0xda6c('0x58')]({'where':{'id':_0x163ac8[_0xda6c('0x5b')][_0xda6c('0x62')],'role':'agent'},'attributes':['id',_0xda6c('0x3c'),_0xda6c('0x82'),_0xda6c('0x75'),_0xda6c('0x76')],'raw':!![]});}return null;})['then'](function(_0xeadad1){if(!_0xeadad1)return null;_0x3e6fc3['message'][_0xda6c('0x64')]=_0xeadad1;return _0x3e6fc3;})[_0xda6c('0x23')](function(_0x52bc79){if(_0x52bc79){_0x52bc79['message']['interface']=util[_0xda6c('0x61')](_0xda6c('0x78'),_0x163ac8['user']['name']);_0x52bc79['message']['channel']=_0x3e6fc3[_0xda6c('0x79')];_0x52bc79[_0xda6c('0x2b')]['event']=_0xda6c('0x38');respondWithRpcPromise(_0xda6c('0x7a'),_0xda6c('0x7a'),{'event':_0xda6c('0x83'),'message':_0x52bc79['message']},client9002);return _0x3e6fc3;}return null;})['then'](respondWithResult(_0x1ddd07,null))[_0xda6c('0x2d')](handleError(_0x1ddd07,null));};exports[_0xda6c('0x2f')]=function(_0x31f113,_0x2dac30,_0x4a7d16){if(_0x31f113[_0xda6c('0x5b')]['id']){delete _0x31f113[_0xda6c('0x5b')]['id'];}var _0x5d3eb4;return db['WhatsappMessage'][_0xda6c('0x58')]({'where':{'id':_0x31f113[_0xda6c('0x56')]['id']}})[_0xda6c('0x23')](handleEntityNotFound(_0x2dac30,null))[_0xda6c('0x23')](function(_0x16af0f){if(_0x16af0f){_0x5d3eb4=_0x16af0f;return db['WhatsappAccount'][_0xda6c('0x58')]({'where':{'id':_0x16af0f[_0xda6c('0x84')]}});}})['then'](handleEntityNotFound(_0x2dac30,null))[_0xda6c('0x23')](function(_0x5d237f){if(_0x5d237f){logger[_0xda6c('0x27')](_0xda6c('0x85'),_0xda6c('0x2f'),_0xda6c('0x86'),_0x5d237f['type'],util[_0xda6c('0x87')](_0x31f113[_0xda6c('0x5b')],{'showHidden':![],'depth':null}));switch(_0x5d237f[_0xda6c('0x42')]){case'twilio':if(_0x31f113[_0xda6c('0x5b')]['MessageSid']&&_0x31f113[_0xda6c('0x5b')]['MessageSid']===_0x5d3eb4[_0xda6c('0x88')]&&_0x31f113[_0xda6c('0x5b')]['MessageStatus']&&_0x31f113[_0xda6c('0x5b')]['MessageStatus']===_0xda6c('0x60')){return _0x5d3eb4[_0xda6c('0x5a')]({'read':!![]});}else{logger[_0xda6c('0x29')](_0xda6c('0x89'),_0xda6c('0x2f'),_0xda6c('0x8a'),util[_0xda6c('0x87')](_0x31f113[_0xda6c('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x5d3eb4;}})['then'](respondWithResult(_0x2dac30,null))['catch'](handleError(_0x2dac30,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index df771c6..dc7ea10 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 _0xd547=['hook','WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2197c3,_0x310b38){var _0x120c87=function(_0x32b0bb){while(--_0x32b0bb){_0x2197c3['push'](_0x2197c3['shift']());}};_0x120c87(++_0x310b38);}(_0xd547,0x1c1));var _0x7d54=function(_0x472caf,_0x42c3d5){_0x472caf=_0x472caf-0x0;var _0x16cd58=_0xd547[_0x472caf];return _0x16cd58;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0x7d54('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x7d54('0x1')](0x0);var events={'afterCreate':_0x7d54('0x2'),'afterUpdate':_0x7d54('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4ab00b){return function(_0x21c23f,_0x5d21c1,_0x22ea09){WhatsappMessageEvents['emit'](_0x4ab00b+':'+_0x21c23f['id'],_0x21c23f);WhatsappMessageEvents[_0x7d54('0x4')](_0x4ab00b,_0x21c23f);_0x22ea09(null);};}for(var e in events){if(events[_0x7d54('0x5')](e)){var event=events[e];WhatsappMessage[_0x7d54('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x4e81=['emit','hook','exports','events','../../mysqldb','WhatsappMessage','remove'];(function(_0x53e2ed,_0x468938){var _0x3c9461=function(_0x4e0bf8){while(--_0x4e0bf8){_0x53e2ed['push'](_0x53e2ed['shift']());}};_0x3c9461(++_0x468938);}(_0x4e81,0x1bc));var _0x14e8=function(_0x40822a,_0x582b60){_0x40822a=_0x40822a-0x0;var _0x357420=_0x4e81[_0x40822a];return _0x357420;};'use strict';var EventEmitter=require(_0x14e8('0x0'));var WhatsappMessage=require(_0x14e8('0x1'))['db'][_0x14e8('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x14e8('0x3')};function emitEvent(_0x3a988b){return function(_0x224121,_0x436444,_0x325325){WhatsappMessageEvents[_0x14e8('0x4')](_0x3a988b+':'+_0x224121['id'],_0x224121);WhatsappMessageEvents['emit'](_0x3a988b,_0x224121);_0x325325(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x14e8('0x5')](e,emitEvent(event));}}module[_0x14e8('0x6')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index b8e6d0c..42c883d 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 _0x305b=['path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','error','WhatsappAccountId','type','twilio','accountSid','authToken','phone','create','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x127a60,_0x37f33a){var _0xc1f6a3=function(_0x8ed035){while(--_0x8ed035){_0x127a60['push'](_0x127a60['shift']());}};_0xc1f6a3(++_0x37f33a);}(_0x305b,0x81));var _0xb305=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x305b[_0x2df507];return _0x1f7167;};'use strict';var _=require(_0xb305('0x0'));var util=require(_0xb305('0x1'));var logger=require(_0xb305('0x2'))('api');var moment=require(_0xb305('0x3'));var BPromise=require(_0xb305('0x4'));var rp=require(_0xb305('0x5'));var fs=require('fs');var path=require(_0xb305('0x6'));var rimraf=require(_0xb305('0x7'));var config=require(_0xb305('0x8'));var attributes=require(_0xb305('0x9'));module[_0xb305('0xa')]=function(_0x455e8e,_0xcfb947){return _0x455e8e[_0xb305('0xb')](_0xb305('0xc'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xb305('0xd')]},{'name':'fti_whatsapp_messages','fields':[_0xb305('0xe')],'type':_0xb305('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a3a62,_0x294664,_0x2d4a31){var _0x570d72=_0x455e8e['models'];var _0x51e434=_0x2a3a62['get']({'plain':!![]});if(_0x51e434[_0xb305('0x10')]['toLowerCase']()==='in'||_0x51e434[_0xb305('0x10')][_0xb305('0x11')]()===_0xb305('0x12')&&!_0x51e434[_0xb305('0x13')]&&!_[_0xb305('0x14')](_0x51e434[_0xb305('0x15')])){_0x570d72[_0xb305('0x16')][_0xb305('0x17')]({'where':{'id':_0x51e434[_0xb305('0x18')]}})[_0xb305('0x19')](function(_0x5b1fab){if(_0x5b1fab){_0x5b1fab[_0xb305('0x1a')]({'lastMsgAt':_0x51e434[_0xb305('0x1b')],'lastMsgDirection':_0x51e434['direction'][_0xb305('0x11')]()});}})['catch'](function(_0x4fb324){console[_0xb305('0x1c')](_0x4fb324);});}if(_0x51e434[_0xb305('0x10')]===_0xb305('0x12')&&!_0x51e434[_0xb305('0x13')]){var _0x5e3fe9;_0x570d72['WhatsappAccount']['find']({'where':{'id':_0x51e434[_0xb305('0x1d')]},'raw':!![]})['then'](function(_0x3c61cf){_0x5e3fe9=_0x3c61cf;if(_0x5e3fe9&&_0x5e3fe9[_0xb305('0x1e')]){switch(_0x5e3fe9[_0xb305('0x1e')]){case _0xb305('0x1f'):var _0x29cb7a=require(_0xb305('0x1f'));if(_0x5e3fe9[_0xb305('0x20')]&&_0x5e3fe9[_0xb305('0x21')]&&_0x5e3fe9[_0xb305('0x22')]){var _0x14531b=new _0x29cb7a(_0x5e3fe9[_0xb305('0x20')],_0x5e3fe9[_0xb305('0x21')]);_0x14531b['messages'][_0xb305('0x23')]({'body':_0x51e434['body'],'to':_0xb305('0x24')+_0x51e434[_0xb305('0x22')],'from':_0xb305('0x24')+_0x5e3fe9[_0xb305('0x22')],'statusCallback':_0x5e3fe9['remote']+_0xb305('0x25')+_0x51e434['id']+_0xb305('0x26')+_0x5e3fe9[_0xb305('0x27')]})[_0xb305('0x19')](function(_0x212039){if(_0x212039[_0xb305('0x28')]){return _0x2a3a62[_0xb305('0x1a')]({'messageId':_0x212039[_0xb305('0x28')]});}})['catch'](function(_0x478aca){logger[_0xb305('0x1c')](_0xb305('0x29'),'afterCreate','twilio',util['inspect'](_0x478aca,{'showHidden':![],'depth':null}));});}else{logger[_0xb305('0x1c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xb305('0x2a'),_0xb305('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})['finally'](function(){_0x2d4a31();});}else{_0x2d4a31();}}},'charset':_0xb305('0x2b'),'collate':_0xb305('0x2c')});}; \ No newline at end of file +var _0x0f37=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','path','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally'];(function(_0x3be782,_0x55efc9){var _0x3e2233=function(_0x5ce7ea){while(--_0x5ce7ea){_0x3be782['push'](_0x3be782['shift']());}};_0x3e2233(++_0x55efc9);}(_0x0f37,0x1c4));var _0x70f3=function(_0x238b73,_0x5df76f){_0x238b73=_0x238b73-0x0;var _0x5966d9=_0x0f37[_0x238b73];return _0x5966d9;};'use strict';var _=require('lodash');var util=require(_0x70f3('0x0'));var logger=require(_0x70f3('0x1'))('api');var moment=require(_0x70f3('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x70f3('0x3'));var rimraf=require('rimraf');var config=require(_0x70f3('0x4'));var attributes=require('./whatsappMessage.attributes');module[_0x70f3('0x5')]=function(_0xef78a,_0x5c9873){return _0xef78a[_0x70f3('0x6')](_0x70f3('0x7'),attributes,{'tableName':_0x70f3('0x8'),'paranoid':![],'indexes':[{'name':_0x70f3('0x9'),'fields':[_0x70f3('0x9')]},{'name':_0x70f3('0xa'),'fields':[_0x70f3('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5daace,_0x34bb0e,_0x581ac4){var _0x305ac9=_0xef78a[_0x70f3('0xc')];var _0x5ed10f=_0x5daace[_0x70f3('0xd')]({'plain':!![]});if(_0x5ed10f[_0x70f3('0xe')][_0x70f3('0xf')]()==='in'||_0x5ed10f[_0x70f3('0xe')][_0x70f3('0xf')]()===_0x70f3('0x10')&&!_0x5ed10f[_0x70f3('0x11')]&&!_[_0x70f3('0x12')](_0x5ed10f[_0x70f3('0x13')])){_0x305ac9[_0x70f3('0x14')][_0x70f3('0x15')]({'where':{'id':_0x5ed10f[_0x70f3('0x16')]}})[_0x70f3('0x17')](function(_0x15990e){if(_0x15990e){_0x15990e[_0x70f3('0x18')]({'lastMsgAt':_0x5ed10f[_0x70f3('0x19')],'lastMsgDirection':_0x5ed10f['direction'][_0x70f3('0xf')]()});}})['catch'](function(_0x46e123){console[_0x70f3('0x1a')](_0x46e123);});}if(_0x5ed10f[_0x70f3('0xe')]===_0x70f3('0x10')&&!_0x5ed10f[_0x70f3('0x11')]){var _0x9e8194;_0x305ac9[_0x70f3('0x1b')][_0x70f3('0x1c')]({'where':{'id':_0x5ed10f[_0x70f3('0x1d')]},'raw':!![]})[_0x70f3('0x17')](function(_0x434e26){_0x9e8194=_0x434e26;if(_0x9e8194&&_0x9e8194[_0x70f3('0x1e')]){switch(_0x9e8194[_0x70f3('0x1e')]){case _0x70f3('0x1f'):var _0x277166=require('twilio');if(_0x9e8194[_0x70f3('0x20')]&&_0x9e8194[_0x70f3('0x21')]&&_0x9e8194[_0x70f3('0x22')]){var _0x2dec65=new _0x277166(_0x9e8194['accountSid'],_0x9e8194[_0x70f3('0x21')]);_0x2dec65[_0x70f3('0x23')]['create']({'body':_0x5ed10f[_0x70f3('0xb')],'to':_0x70f3('0x24')+_0x5ed10f[_0x70f3('0x22')],'from':_0x70f3('0x24')+_0x9e8194['phone'],'statusCallback':_0x9e8194[_0x70f3('0x25')]+_0x70f3('0x26')+_0x5ed10f['id']+_0x70f3('0x27')+_0x9e8194[_0x70f3('0x28')]})['then'](function(_0x1018c5){if(_0x1018c5[_0x70f3('0x29')]){return _0x5daace[_0x70f3('0x18')]({'messageId':_0x1018c5[_0x70f3('0x29')]});}})[_0x70f3('0x2a')](function(_0x122368){logger[_0x70f3('0x1a')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',util[_0x70f3('0x2b')](_0x122368,{'showHidden':![],'depth':null}));});}else{logger[_0x70f3('0x1a')](_0x70f3('0x2c'),_0x70f3('0x2d'),'twilio',_0x70f3('0x2e'));}break;}}})[_0x70f3('0x2f')](function(){_0x581ac4();});}else{_0x581ac4();}}},'charset':_0x70f3('0x30'),'collate':_0x70f3('0x31')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 07d9ff0..ffcaaf4 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 _0x370d=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateWhatsappMessage','WhatsappMessage','options','raw','debug','catch','moment','bluebird'];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0x370d,0xa6));var _0xd370=function(_0x168afe,_0x49dd82){_0x168afe=_0x168afe-0x0;var _0x536e7d=_0x370d[_0x168afe];return _0x536e7d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd370('0x0'));var BPromise=require(_0xd370('0x1'));var rs=require(_0xd370('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd370('0x3'))['db'];var utils=require(_0xd370('0x4'));var logger=require('../../config/logger')(_0xd370('0x5'));var config=require(_0xd370('0x6'));var jayson=require(_0xd370('0x7'));var client=jayson[_0xd370('0x8')]['http']({'port':0x232a});config[_0xd370('0x9')]=_['defaults'](config['redis'],{'host':_0xd370('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd370('0x9')]));require(_0xd370('0xb'))[_0xd370('0xc')](socket);function respondWithRpcPromise(_0x269df8,_0x1f55d3,_0x30280){return new BPromise(function(_0x133064,_0x3138fb){return client[_0xd370('0xd')](_0x269df8,_0x30280)[_0xd370('0xe')](function(_0x3a2b0e){logger[_0xd370('0xf')](_0xd370('0x10'),_0x1f55d3,_0xd370('0x11'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1f55d3,'request\x20sent',JSON[_0xd370('0x12')](_0x3a2b0e));if(_0x3a2b0e['error']){if(_0x3a2b0e[_0xd370('0x13')][_0xd370('0x14')]===0x1f4){logger[_0xd370('0x13')](_0xd370('0x10'),_0x1f55d3,_0x3a2b0e['error'][_0xd370('0x15')]);return _0x3138fb(_0x3a2b0e[_0xd370('0x13')]['message']);}logger[_0xd370('0x13')](_0xd370('0x10'),_0x1f55d3,_0x3a2b0e[_0xd370('0x13')]['message']);return _0x133064(_0x3a2b0e[_0xd370('0x13')]['message']);}else{logger[_0xd370('0xf')](_0xd370('0x10'),_0x1f55d3,_0xd370('0x11'));_0x133064(_0x3a2b0e['result'][_0xd370('0x15')]);}})['catch'](function(_0x36f14b){logger[_0xd370('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x1f55d3,_0x36f14b);_0x3138fb(_0x36f14b);});});}exports[_0xd370('0x16')]=function(_0x576278){var _0x5d538e=this;return new Promise(function(_0xbaf367,_0x553f9b){return db[_0xd370('0x17')]['create'](_0x576278['body'],{'raw':_0x576278[_0xd370('0x18')]?_0x576278[_0xd370('0x18')][_0xd370('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5c2c02){logger[_0xd370('0xf')](_0xd370('0x16'),_0x576278);logger[_0xd370('0x1a')](_0xd370('0x16'),_0x576278,JSON[_0xd370('0x12')](_0x5c2c02));_0xbaf367(_0x5c2c02);})[_0xd370('0x1b')](function(_0x56af06){logger[_0xd370('0x13')]('CreateWhatsappMessage',_0x56af06[_0xd370('0x15')],_0x576278);_0x553f9b(_0x5d538e[_0xd370('0x13')](0x1f4,_0x56af06[_0xd370('0x15')]));});});}; \ No newline at end of file +var _0x7b4b=['error','code','message','WhatsappMessage,\x20%s,\x20%s','catch','CreateWhatsappMessage','WhatsappMessage','create','body','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x24d839,_0x12f458){var _0x40b17c=function(_0xc1d6e3){while(--_0xc1d6e3){_0x24d839['push'](_0x24d839['shift']());}};_0x40b17c(++_0x12f458);}(_0x7b4b,0x169));var _0xb7b4=function(_0x153e7d,_0x10a35f){_0x153e7d=_0x153e7d-0x0;var _0x3c22dd=_0x7b4b[_0x153e7d];return _0x3c22dd;};'use strict';var _=require(_0xb7b4('0x0'));var util=require(_0xb7b4('0x1'));var moment=require(_0xb7b4('0x2'));var BPromise=require(_0xb7b4('0x3'));var rs=require(_0xb7b4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb7b4('0x5'))(_0xb7b4('0x6'));var config=require(_0xb7b4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb7b4('0x8')][_0xb7b4('0x9')]({'port':0x232a});config[_0xb7b4('0xa')]=_[_0xb7b4('0xb')](config['redis'],{'host':_0xb7b4('0xc'),'port':0x18eb});var socket=require(_0xb7b4('0xd'))(new Redis(config[_0xb7b4('0xa')]));require(_0xb7b4('0xe'))[_0xb7b4('0xf')](socket);function respondWithRpcPromise(_0x1c0408,_0x1b788c,_0xd3793e){return new BPromise(function(_0x58ef42,_0x117644){return client[_0xb7b4('0x10')](_0x1c0408,_0xd3793e)[_0xb7b4('0x11')](function(_0x13e13d){logger[_0xb7b4('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x1b788c,_0xb7b4('0x13'));logger[_0xb7b4('0x14')](_0xb7b4('0x15'),_0x1b788c,_0xb7b4('0x13'),JSON[_0xb7b4('0x16')](_0x13e13d));if(_0x13e13d[_0xb7b4('0x17')]){if(_0x13e13d[_0xb7b4('0x17')][_0xb7b4('0x18')]===0x1f4){logger[_0xb7b4('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x1b788c,_0x13e13d['error']['message']);return _0x117644(_0x13e13d['error'][_0xb7b4('0x19')]);}logger[_0xb7b4('0x17')](_0xb7b4('0x1a'),_0x1b788c,_0x13e13d[_0xb7b4('0x17')][_0xb7b4('0x19')]);return _0x58ef42(_0x13e13d[_0xb7b4('0x17')][_0xb7b4('0x19')]);}else{logger[_0xb7b4('0x12')](_0xb7b4('0x1a'),_0x1b788c,_0xb7b4('0x13'));_0x58ef42(_0x13e13d['result'][_0xb7b4('0x19')]);}})[_0xb7b4('0x1b')](function(_0x439875){logger[_0xb7b4('0x17')](_0xb7b4('0x1a'),_0x1b788c,_0x439875);_0x117644(_0x439875);});});}exports[_0xb7b4('0x1c')]=function(_0x1f39c1){var _0x14ca51=this;return new Promise(function(_0x5dd564,_0x3550c7){return db[_0xb7b4('0x1d')][_0xb7b4('0x1e')](_0x1f39c1[_0xb7b4('0x1f')],{'raw':_0x1f39c1['options']?_0x1f39c1['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3b3658){logger['info'](_0xb7b4('0x1c'),_0x1f39c1);logger[_0xb7b4('0x14')](_0xb7b4('0x1c'),_0x1f39c1,JSON['stringify'](_0x3b3658));_0x5dd564(_0x3b3658);})[_0xb7b4('0x1b')](function(_0x44db29){logger[_0xb7b4('0x17')]('CreateWhatsappMessage',_0x44db29['message'],_0x1f39c1);_0x3550c7(_0x14ca51['error'](0x1f4,_0x44db29[_0xb7b4('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 902c801..991a170 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 _0x42c3=['emit','length','whatsappMessage:','save','update'];(function(_0x3778fc,_0xcd3c7e){var _0x3bb61b=function(_0x4ef63b){while(--_0x4ef63b){_0x3778fc['push'](_0x3778fc['shift']());}};_0x3bb61b(++_0xcd3c7e);}(_0x42c3,0x134));var _0x342c=function(_0x1e16d2,_0x25681f){_0x1e16d2=_0x1e16d2-0x0;var _0x150675=_0x42c3[_0x1e16d2];return _0x150675;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x342c('0x0'),'remove',_0x342c('0x1')];function createListener(_0x10ea9c,_0x47909c){return function(_0x5e3841){_0x47909c[_0x342c('0x2')](_0x10ea9c,_0x5e3841);};}function removeListener(_0x2588a2,_0x57e71e){return function(){WhatsappMessageEvents['removeListener'](_0x2588a2,_0x57e71e);};}exports['register']=function(_0x541008){for(var _0x459c38=0x0,_0x590cf5=events[_0x342c('0x3')];_0x459c38<_0x590cf5;_0x459c38++){var _0x4b0b40=events[_0x459c38];var _0x2a0495=createListener(_0x342c('0x4')+_0x4b0b40,_0x541008);WhatsappMessageEvents['on'](_0x4b0b40,_0x2a0495);}}; \ No newline at end of file +var _0x4f8a=['remove','update','removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x1e9713,_0x1df5a3){var _0x5830fa=function(_0x273453){while(--_0x273453){_0x1e9713['push'](_0x1e9713['shift']());}};_0x5830fa(++_0x1df5a3);}(_0x4f8a,0x16e));var _0xa4f8=function(_0xa7e872,_0x1e3c50){_0xa7e872=_0xa7e872-0x0;var _0x20b8e4=_0x4f8a[_0xa7e872];return _0x20b8e4;};'use strict';var WhatsappMessageEvents=require(_0xa4f8('0x0'));var events=[_0xa4f8('0x1'),_0xa4f8('0x2'),_0xa4f8('0x3')];function createListener(_0x323385,_0xf9cfbd){return function(_0x40aca5){_0xf9cfbd['emit'](_0x323385,_0x40aca5);};}function removeListener(_0x3f3d00,_0x4b9bab){return function(){WhatsappMessageEvents[_0xa4f8('0x4')](_0x3f3d00,_0x4b9bab);};}exports[_0xa4f8('0x5')]=function(_0x293b5b){for(var _0x42bbea=0x0,_0x4ae237=events[_0xa4f8('0x6')];_0x42bbea<_0x4ae237;_0x42bbea++){var _0x4a4eec=events[_0x42bbea];var _0x116a6f=createListener(_0xa4f8('0x7')+_0x4a4eec,_0x293b5b);WhatsappMessageEvents['on'](_0x4a4eec,_0x116a6f);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 8f4b350..a219e22 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 _0xe9c6=['post','create','addTeams','addAgents','put','update','delete','removeTeams','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x5c12c9,_0x56f463){var _0x426812=function(_0x47564d){while(--_0x47564d){_0x5c12c9['push'](_0x5c12c9['shift']());}};_0x426812(++_0x56f463);}(_0xe9c6,0x1ac));var _0x6e9c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe9c6[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x6e9c('0x0'));var util=require('util');var path=require(_0x6e9c('0x1'));var timeout=require(_0x6e9c('0x2'));var express=require(_0x6e9c('0x3'));var router=express[_0x6e9c('0x4')]();var fs_extra=require(_0x6e9c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6e9c('0x6'));var config=require(_0x6e9c('0x7'));var controller=require('./whatsappQueue.controller');router[_0x6e9c('0x8')]('/',auth[_0x6e9c('0x9')](),controller['index']);router[_0x6e9c('0x8')](_0x6e9c('0xa'),auth[_0x6e9c('0x9')](),controller[_0x6e9c('0xb')]);router[_0x6e9c('0x8')](_0x6e9c('0xc'),auth[_0x6e9c('0x9')](),controller[_0x6e9c('0xd')]);router[_0x6e9c('0x8')](_0x6e9c('0xe'),auth[_0x6e9c('0x9')](),controller[_0x6e9c('0xf')]);router[_0x6e9c('0x8')](_0x6e9c('0x10'),auth[_0x6e9c('0x9')](),controller[_0x6e9c('0x11')]);router[_0x6e9c('0x8')](_0x6e9c('0x12'),auth[_0x6e9c('0x9')](),controller[_0x6e9c('0x13')]);router[_0x6e9c('0x14')]('/',auth['isAuthenticated'](),controller[_0x6e9c('0x15')]);router[_0x6e9c('0x14')](_0x6e9c('0x10'),auth[_0x6e9c('0x9')](),controller[_0x6e9c('0x16')]);router[_0x6e9c('0x14')](_0x6e9c('0x12'),auth['isAuthenticated'](),controller[_0x6e9c('0x17')]);router[_0x6e9c('0x18')](_0x6e9c('0xc'),auth[_0x6e9c('0x9')](),controller[_0x6e9c('0x19')]);router[_0x6e9c('0x1a')](_0x6e9c('0xc'),auth[_0x6e9c('0x9')](),controller['destroy']);router[_0x6e9c('0x1a')](_0x6e9c('0x10'),auth[_0x6e9c('0x9')](),controller[_0x6e9c('0x1b')]);router[_0x6e9c('0x1a')]('/:id/users',auth[_0x6e9c('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xdfae=['addTeams','addAgents','delete','destroy','removeTeams','removeAgents','exports','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/users','getAgents','post','create','/:id/teams'];(function(_0x59b533,_0x4cdd05){var _0x1a2d7a=function(_0x49a2fa){while(--_0x49a2fa){_0x59b533['push'](_0x59b533['shift']());}};_0x1a2d7a(++_0x4cdd05);}(_0xdfae,0x18d));var _0xedfa=function(_0x188a93,_0xaf57db){_0x188a93=_0x188a93-0x0;var _0x23b40d=_0xdfae[_0x188a93];return _0x23b40d;};'use strict';var multer=require('multer');var util=require(_0xedfa('0x0'));var path=require('path');var timeout=require(_0xedfa('0x1'));var express=require(_0xedfa('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xedfa('0x3'));var config=require(_0xedfa('0x4'));var controller=require(_0xedfa('0x5'));router[_0xedfa('0x6')]('/',auth[_0xedfa('0x7')](),controller[_0xedfa('0x8')]);router[_0xedfa('0x6')](_0xedfa('0x9'),auth[_0xedfa('0x7')](),controller[_0xedfa('0xa')]);router[_0xedfa('0x6')](_0xedfa('0xb'),auth[_0xedfa('0x7')](),controller[_0xedfa('0xc')]);router[_0xedfa('0x6')]('/:id/members',auth['isAuthenticated'](),controller[_0xedfa('0xd')]);router[_0xedfa('0x6')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0xedfa('0x6')](_0xedfa('0xe'),auth[_0xedfa('0x7')](),controller[_0xedfa('0xf')]);router[_0xedfa('0x10')]('/',auth[_0xedfa('0x7')](),controller[_0xedfa('0x11')]);router[_0xedfa('0x10')](_0xedfa('0x12'),auth[_0xedfa('0x7')](),controller[_0xedfa('0x13')]);router[_0xedfa('0x10')](_0xedfa('0xe'),auth[_0xedfa('0x7')](),controller[_0xedfa('0x14')]);router['put'](_0xedfa('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xedfa('0x15')](_0xedfa('0xb'),auth['isAuthenticated'](),controller[_0xedfa('0x16')]);router[_0xedfa('0x15')]('/:id/teams',auth[_0xedfa('0x7')](),controller[_0xedfa('0x17')]);router[_0xedfa('0x15')](_0xedfa('0xe'),auth[_0xedfa('0x7')](),controller[_0xedfa('0x18')]);module[_0xedfa('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 7493eb4..4bc602e 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 _0xd957=['beepall','roundrobin','STRING','sequelize','exports','name','INTEGER','rrmemory'];(function(_0x3a2225,_0xb6600){var _0x5c8040=function(_0x2bdb09){while(--_0x2bdb09){_0x3a2225['push'](_0x3a2225['shift']());}};_0x5c8040(++_0xb6600);}(_0xd957,0x153));var _0x7d95=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd957[_0xa464c9];return _0x3d73c4;};'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 +var _0x18a9=['ENUM','rrmemory','beepall','roundrobin','STRING','name','INTEGER'];(function(_0x37905c,_0x4d0a7a){var _0x4071c7=function(_0x2c4bb7){while(--_0x2c4bb7){_0x37905c['push'](_0x37905c['shift']());}};_0x4071c7(++_0x4d0a7a);}(_0x18a9,0x15b));var _0x918a=function(_0x3c1105,_0x5c45c1){_0x3c1105=_0x3c1105-0x0;var _0x35e7ab=_0x18a9[_0x3c1105];return _0x35e7ab;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x918a('0x0')],'unique':_0x918a('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x918a('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x918a('0x3')](_0x918a('0x4'),_0x918a('0x5'),_0x918a('0x6'))},'description':{'type':Sequelize[_0x918a('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 05b31c7..c8e5351 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 _0x486b=['util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','undefined','offset','limit','Content-Range','apply','reject','save','update','then','destroy','WhatsappQueues','UserProfileResource','error','stack','send','index','map','WhatsappQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','show','params','rawAttributes','includeAll','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','order','WhatsappQueueId','findAll','User','UserId','agent','updatedAt','count','SIP','createdAt','getTeams','addTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','UserWhatsappQueue','findOrCreate','forEach','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','includes','union','value','isEmpty','removeAgents','userWhatsappQueue:remove','omit','spread','userWhatsappQueue:save','isArray','getAgents','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x486b,0x11a));var _0xb486=function(_0x46f194,_0x1831c2){_0x46f194=_0x46f194-0x0;var _0x43ca35=_0x486b[_0x46f194];return _0x43ca35;};'use strict';var emlformat=require(_0xb486('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb486('0x1'));var jsonpatch=require(_0xb486('0x2'));var rp=require(_0xb486('0x3'));var moment=require(_0xb486('0x4'));var BPromise=require(_0xb486('0x5'));var Mustache=require('mustache');var util=require(_0xb486('0x6'));var path=require(_0xb486('0x7'));var sox=require(_0xb486('0x8'));var csv=require(_0xb486('0x9'));var ejs=require(_0xb486('0xa'));var fs=require('fs');var fs_extra=require(_0xb486('0xb'));var _=require(_0xb486('0xc'));var squel=require('squel');var crypto=require(_0xb486('0xd'));var jsforce=require(_0xb486('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb486('0x9'));var querystring=require(_0xb486('0xf'));var Papa=require('papaparse');var Redis=require(_0xb486('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb486('0x11'));var as=require(_0xb486('0x12'));var hardwareService=require(_0xb486('0x13'));var logger=require(_0xb486('0x14'))(_0xb486('0x15'));var utils=require(_0xb486('0x16'));var config=require(_0xb486('0x17'));var licenseUtil=require(_0xb486('0x18'));var db=require(_0xb486('0x19'))['db'];config[_0xb486('0x1a')]=_[_0xb486('0x1b')](config[_0xb486('0x1a')],{'host':_0xb486('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb486('0x1a')]));require('./whatsappQueue.socket')[_0xb486('0x1d')](socket);function respondWithStatusCode(_0x41d262,_0xd8428a){_0xd8428a=_0xd8428a||0xcc;return function(_0x27a184){if(_0x27a184){return _0x41d262[_0xb486('0x1e')](_0xd8428a);}return _0x41d262[_0xb486('0x1f')](_0xd8428a)[_0xb486('0x20')]();};}function respondWithResult(_0x2dc2c7,_0x2901eb){_0x2901eb=_0x2901eb||0xc8;return function(_0xf4fabb){if(_0xf4fabb){return _0x2dc2c7[_0xb486('0x1f')](_0x2901eb)[_0xb486('0x21')](_0xf4fabb);}};}function respondWithFilteredResult(_0x5e60e3,_0x22ae9a){return function(_0x5b850b){if(_0x5b850b){var _0x50fcad=typeof _0x22ae9a['offset']==='undefined'&&typeof _0x22ae9a['limit']===_0xb486('0x22');var _0xc543aa=_0x5b850b['count'];var _0x24da4d=_0x50fcad?0x0:_0x22ae9a[_0xb486('0x23')];var _0x788267=_0x50fcad?_0x5b850b['count']:_0x22ae9a['offset']+_0x22ae9a[_0xb486('0x24')];var _0x51279e;if(_0x788267>=_0xc543aa){_0x788267=_0xc543aa;_0x51279e=0xc8;}else{_0x51279e=0xce;}_0x5e60e3[_0xb486('0x1f')](_0x51279e);return _0x5e60e3['set'](_0xb486('0x25'),_0x24da4d+'-'+_0x788267+'/'+_0xc543aa)['json'](_0x5b850b);}return null;};}function patchUpdates(_0x3798f9){return function(_0x213b3d){try{jsonpatch[_0xb486('0x26')](_0x213b3d,_0x3798f9,!![]);}catch(_0xf7882c){return BPromise[_0xb486('0x27')](_0xf7882c);}return _0x213b3d[_0xb486('0x28')]();};}function saveUpdates(_0x4e36b8,_0x56ddf3){return function(_0x59fa57){if(_0x59fa57){return _0x59fa57[_0xb486('0x29')](_0x4e36b8)[_0xb486('0x2a')](function(_0x40b7b1){return _0x40b7b1;});}return null;};}function removeEntity(_0x2be273,_0x1414b9){return function(_0x4f4bbe){if(_0x4f4bbe){return _0x4f4bbe[_0xb486('0x2b')]()['then'](function(){var _0x5b5997=_0x4f4bbe['get']({'plain':!![]});var _0x2d831e=_0xb486('0x2c');return db[_0xb486('0x2d')][_0xb486('0x2b')]({'where':{'type':_0x2d831e,'resourceId':_0x5b5997['id']}})[_0xb486('0x2a')](function(){return _0x4f4bbe;});})[_0xb486('0x2a')](function(){_0x2be273[_0xb486('0x1f')](0xcc)[_0xb486('0x20')]();});}};}function handleEntityNotFound(_0x4f96fe,_0x30b387){return function(_0x3b59dc){if(!_0x3b59dc){_0x4f96fe[_0xb486('0x1e')](0x194);}return _0x3b59dc;};}function handleError(_0x383dde,_0x3424c5){_0x3424c5=_0x3424c5||0x1f4;return function(_0xf411b0){logger[_0xb486('0x2e')](_0xf411b0[_0xb486('0x2f')]);if(_0xf411b0['name']){delete _0xf411b0['name'];}_0x383dde[_0xb486('0x1f')](_0x3424c5)[_0xb486('0x30')](_0xf411b0);};}exports[_0xb486('0x31')]=function(_0x3ffe15,_0x54405e){var _0x4c784e={},_0x50a3f1={},_0x549578={'count':0x0,'rows':[]};var _0x4a0af9=_[_0xb486('0x32')](db[_0xb486('0x33')]['rawAttributes'],function(_0x287441){return{'name':_0x287441[_0xb486('0x34')],'type':_0x287441[_0xb486('0x35')][_0xb486('0x36')]};});_0x50a3f1[_0xb486('0x37')]=_[_0xb486('0x32')](_0x4a0af9,'name');_0x50a3f1[_0xb486('0x38')]=_[_0xb486('0x39')](_0x3ffe15['query']);_0x50a3f1[_0xb486('0x3a')]=_[_0xb486('0x3b')](_0x50a3f1[_0xb486('0x37')],_0x50a3f1['query']);_0x4c784e[_0xb486('0x3c')]=_[_0xb486('0x3b')](_0x50a3f1[_0xb486('0x37')],qs[_0xb486('0x3d')](_0x3ffe15[_0xb486('0x38')][_0xb486('0x3d')]));_0x4c784e[_0xb486('0x3c')]=_0x4c784e['attributes'][_0xb486('0x3e')]?_0x4c784e[_0xb486('0x3c')]:_0x50a3f1[_0xb486('0x37')];if(!_0x3ffe15[_0xb486('0x38')][_0xb486('0x3f')](_0xb486('0x40'))){_0x4c784e[_0xb486('0x24')]=qs[_0xb486('0x24')](_0x3ffe15['query'][_0xb486('0x24')]);_0x4c784e[_0xb486('0x23')]=qs[_0xb486('0x23')](_0x3ffe15['query']['offset']);}_0x4c784e['order']=qs[_0xb486('0x41')](_0x3ffe15[_0xb486('0x38')][_0xb486('0x41')]);_0x4c784e[_0xb486('0x42')]=qs['filters'](_[_0xb486('0x43')](_0x3ffe15[_0xb486('0x38')],_0x50a3f1['filters']),_0x4a0af9);if(_0x3ffe15[_0xb486('0x38')][_0xb486('0x44')]){_0x4c784e[_0xb486('0x42')]=_[_0xb486('0x45')](_0x4c784e['where'],{'$or':_[_0xb486('0x32')](_0x4a0af9,function(_0x5271a2){if(_0x5271a2[_0xb486('0x35')]!==_0xb486('0x46')){var _0x424aa1={};_0x424aa1[_0x5271a2['name']]={'$like':'%'+_0x3ffe15['query'][_0xb486('0x44')]+'%'};return _0x424aa1;}})});}_0x4c784e=_[_0xb486('0x45')]({},_0x4c784e,_0x3ffe15[_0xb486('0x47')]);var _0x1ab9e1={'where':_0x4c784e[_0xb486('0x42')]};return db[_0xb486('0x33')]['count'](_0x1ab9e1)[_0xb486('0x2a')](function(_0x31489b){_0x549578['count']=_0x31489b;if(_0x3ffe15[_0xb486('0x38')]['includeAll']){_0x4c784e[_0xb486('0x48')]=[{'all':!![]}];}return db[_0xb486('0x33')]['findAll'](_0x4c784e);})[_0xb486('0x2a')](function(_0x5356c1){_0x549578['rows']=_0x5356c1;return _0x549578;})[_0xb486('0x2a')](respondWithFilteredResult(_0x54405e,_0x4c784e))[_0xb486('0x49')](handleError(_0x54405e,null));};exports[_0xb486('0x4a')]=function(_0xccb74f,_0x2df665){var _0x254a45={'raw':!![],'where':{'id':_0xccb74f[_0xb486('0x4b')]['id']}},_0x497c64={};_0x497c64[_0xb486('0x37')]=_[_0xb486('0x39')](db['WhatsappQueue'][_0xb486('0x4c')]);_0x497c64['query']=_[_0xb486('0x39')](_0xccb74f[_0xb486('0x38')]);_0x497c64[_0xb486('0x3a')]=_['intersection'](_0x497c64[_0xb486('0x37')],_0x497c64[_0xb486('0x38')]);_0x254a45[_0xb486('0x3c')]=_[_0xb486('0x3b')](_0x497c64[_0xb486('0x37')],qs[_0xb486('0x3d')](_0xccb74f[_0xb486('0x38')][_0xb486('0x3d')]));_0x254a45[_0xb486('0x3c')]=_0x254a45[_0xb486('0x3c')][_0xb486('0x3e')]?_0x254a45[_0xb486('0x3c')]:_0x497c64['model'];if(_0xccb74f[_0xb486('0x38')][_0xb486('0x4d')]){_0x254a45[_0xb486('0x48')]=[{'all':!![]}];}_0x254a45=_[_0xb486('0x45')]({},_0x254a45,_0xccb74f[_0xb486('0x47')]);return db[_0xb486('0x33')]['find'](_0x254a45)[_0xb486('0x2a')](handleEntityNotFound(_0x2df665,null))[_0xb486('0x2a')](respondWithResult(_0x2df665,null))[_0xb486('0x49')](handleError(_0x2df665,null));};exports[_0xb486('0x4e')]=function(_0x4dd746,_0x490f4c){return db[_0xb486('0x33')][_0xb486('0x4e')](_0x4dd746['body'],{})[_0xb486('0x2a')](function(_0x14f7b8){var _0x106873=_0x4dd746[_0xb486('0x4f')][_0xb486('0x50')]({'plain':!![]});if(!_0x106873)throw new Error(_0xb486('0x51'));if(_0x106873[_0xb486('0x52')]===_0xb486('0x4f')){var _0x6ab1fe=_0x14f7b8[_0xb486('0x50')]({'plain':!![]});var _0x1d2d8f=_0xb486('0x2c');return db[_0xb486('0x53')][_0xb486('0x54')]({'where':{'name':_0x1d2d8f,'userProfileId':_0x106873[_0xb486('0x55')]},'raw':!![]})['then'](function(_0x192357){if(_0x192357&&_0x192357[_0xb486('0x56')]===0x0){return db[_0xb486('0x2d')][_0xb486('0x4e')]({'name':_0x6ab1fe[_0xb486('0x57')],'resourceId':_0x6ab1fe['id'],'type':_0x192357['name'],'sectionId':_0x192357['id']},{})[_0xb486('0x2a')](function(){return _0x14f7b8;});}else{return _0x14f7b8;}})[_0xb486('0x49')](function(_0x546a6d){logger[_0xb486('0x2e')](_0xb486('0x58'),_0x546a6d);throw _0x546a6d;});}return _0x14f7b8;})[_0xb486('0x2a')](respondWithResult(_0x490f4c,0xc9))[_0xb486('0x49')](handleError(_0x490f4c,null));};exports[_0xb486('0x29')]=function(_0x2a6c5b,_0x2b615d){if(_0x2a6c5b['body']['id']){delete _0x2a6c5b['body']['id'];}return db[_0xb486('0x33')]['find']({'where':{'id':_0x2a6c5b['params']['id']}})[_0xb486('0x2a')](handleEntityNotFound(_0x2b615d,null))['then'](saveUpdates(_0x2a6c5b[_0xb486('0x59')],null))['then'](respondWithResult(_0x2b615d,null))['catch'](handleError(_0x2b615d,null));};exports['destroy']=function(_0x31afd6,_0x955e6b){return db[_0xb486('0x33')]['find']({'where':{'id':_0x31afd6[_0xb486('0x4b')]['id']}})[_0xb486('0x2a')](handleEntityNotFound(_0x955e6b,null))[_0xb486('0x2a')](removeEntity(_0x955e6b,null))['catch'](handleError(_0x955e6b,null));};exports[_0xb486('0x5a')]=function(_0x49a0fc,_0xbb6b97){return db[_0xb486('0x33')][_0xb486('0x5a')]()[_0xb486('0x2a')](respondWithResult(_0xbb6b97,null))[_0xb486('0x49')](handleError(_0xbb6b97,null));};exports[_0xb486('0x5b')]=function(_0x574c60,_0x485ccf,_0x3ab48a){var _0x510055={'raw':!![],'where':{}},_0x28ecdd={},_0x5ab3cd;return db[_0xb486('0x33')]['findOne']({'where':{'id':_0x574c60[_0xb486('0x4b')]['id']}})['then'](handleEntityNotFound(_0x485ccf,null))[_0xb486('0x2a')](function(_0x5af857){if(_0x5af857){_0x5ab3cd=_0x5af857[_0xb486('0x50')]({'plain':!![]});_0x28ecdd['model']=_[_0xb486('0x39')](db['UserWhatsappQueue']['rawAttributes']);_0x28ecdd[_0xb486('0x38')]=_['keys'](_0x574c60[_0xb486('0x38')]);_0x28ecdd[_0xb486('0x3a')]=_[_0xb486('0x3b')](_0x28ecdd[_0xb486('0x37')],_0x28ecdd[_0xb486('0x38')]);_0x510055[_0xb486('0x3c')]=_[_0xb486('0x3b')](_0x28ecdd[_0xb486('0x37')],qs[_0xb486('0x3d')](_0x574c60['query'][_0xb486('0x3d')]));_0x510055['attributes']=_0x510055[_0xb486('0x3c')][_0xb486('0x3e')]?_0x510055['attributes']:_0x28ecdd[_0xb486('0x37')];if(!_0x574c60[_0xb486('0x38')][_0xb486('0x3f')](_0xb486('0x40'))){_0x510055['limit']=qs['limit'](_0x574c60[_0xb486('0x38')][_0xb486('0x24')]);_0x510055[_0xb486('0x23')]=qs[_0xb486('0x23')](_0x574c60['query']['offset']);}_0x510055[_0xb486('0x5c')]=qs[_0xb486('0x41')](_0x574c60[_0xb486('0x38')][_0xb486('0x41')]);_0x510055[_0xb486('0x42')]=qs['filters'](_['pick'](_0x574c60['query'],_0x28ecdd[_0xb486('0x3a')]));_0x510055[_0xb486('0x42')][_0xb486('0x5d')]=_0x5af857['id'];if(_0x574c60[_0xb486('0x38')]['filter']){_0x510055[_0xb486('0x42')]=_['merge'](_0x510055[_0xb486('0x42')],{'$or':_[_0xb486('0x32')](_0x510055[_0xb486('0x3c')],function(_0x336da1){var _0x1eea36={};_0x1eea36[_0x336da1]={'$like':'%'+_0x574c60['query'][_0xb486('0x44')]+'%'};return _0x1eea36;})});}_0x510055=_[_0xb486('0x45')]({},_0x510055,_0x574c60[_0xb486('0x47')]);return db['UserWhatsappQueue'][_0xb486('0x5e')](_0x510055);}})[_0xb486('0x2a')](function(_0x3aa007){if(_0x3aa007){return db[_0xb486('0x5f')]['findAndCountAll']({'where':{'id':_['map'](_0x3aa007,_0xb486('0x60')),'role':_0xb486('0x61')},'attributes':['id','name','whatsappPause',_0xb486('0x62'),'createdAt']});}})[_0xb486('0x2a')](function(_0x58fd82){if(_0x58fd82){return{'count':_0x58fd82[_0xb486('0x63')],'rows':_['map'](_0x58fd82['rows'],function(_0x36ba79){return{'membername':_0x36ba79[_0xb486('0x57')],'UserId':_0x36ba79['id'],'queue_name':_0x5ab3cd[_0xb486('0x57')],'WhatsappQueueId':_0x5ab3cd['id'],'interface':util['format']('%s/%s',_0xb486('0x64'),_0x36ba79['name']),'penalty':0x0,'paused':_0x36ba79['whatsappPause'],'createdAt':_0x36ba79[_0xb486('0x65')],'updatedAt':_0x36ba79[_0xb486('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb486('0x2a')](respondWithFilteredResult(_0x485ccf,_0x510055))['catch'](handleError(_0x485ccf,null));};exports['getTeams']=function(_0x424328,_0x2a37a2,_0x2d94ed){var _0x3a3a30={};var _0x42b14b={};var _0x1a461a;var _0x9c3a6b;return db[_0xb486('0x33')]['findOne']({'where':{'id':_0x424328[_0xb486('0x4b')]['id']}})[_0xb486('0x2a')](handleEntityNotFound(_0x2a37a2,null))['then'](function(_0x4b1142){if(_0x4b1142){_0x1a461a=_0x4b1142;_0x42b14b[_0xb486('0x37')]=_[_0xb486('0x39')](db['Team'][_0xb486('0x4c')]);_0x42b14b[_0xb486('0x38')]=_[_0xb486('0x39')](_0x424328[_0xb486('0x38')]);_0x42b14b['filters']=_[_0xb486('0x3b')](_0x42b14b[_0xb486('0x37')],_0x42b14b[_0xb486('0x38')]);_0x3a3a30[_0xb486('0x3c')]=_[_0xb486('0x3b')](_0x42b14b[_0xb486('0x37')],qs['fields'](_0x424328[_0xb486('0x38')][_0xb486('0x3d')]));_0x3a3a30[_0xb486('0x3c')]=_0x3a3a30[_0xb486('0x3c')][_0xb486('0x3e')]?_0x3a3a30[_0xb486('0x3c')]:_0x42b14b['model'];_0x3a3a30['order']=qs[_0xb486('0x41')](_0x424328['query'][_0xb486('0x41')]);_0x3a3a30[_0xb486('0x42')]=qs[_0xb486('0x3a')](_[_0xb486('0x43')](_0x424328[_0xb486('0x38')],_0x42b14b[_0xb486('0x3a')]));if(_0x424328['query'][_0xb486('0x44')]){_0x3a3a30[_0xb486('0x42')]=_[_0xb486('0x45')](_0x3a3a30['where'],{'$or':_[_0xb486('0x32')](_0x3a3a30[_0xb486('0x3c')],function(_0x49f54d){var _0x91fa4f={};_0x91fa4f[_0x49f54d]={'$like':'%'+_0x424328[_0xb486('0x38')][_0xb486('0x44')]+'%'};return _0x91fa4f;})});}_0x3a3a30=_[_0xb486('0x45')]({},_0x3a3a30,_0x424328['options']);return _0x1a461a[_0xb486('0x66')](_0x3a3a30);}})[_0xb486('0x2a')](function(_0x173b26){if(_0x173b26){_0x9c3a6b=_0x173b26[_0xb486('0x3e')];if(!_0x424328[_0xb486('0x38')][_0xb486('0x3f')](_0xb486('0x40'))){_0x3a3a30[_0xb486('0x24')]=qs['limit'](_0x424328['query']['limit']);_0x3a3a30['offset']=qs['offset'](_0x424328[_0xb486('0x38')][_0xb486('0x23')]);}return _0x1a461a[_0xb486('0x66')](_0x3a3a30);}})[_0xb486('0x2a')](function(_0x1ea5bb){if(_0x1ea5bb){return _0x1ea5bb?{'count':_0x9c3a6b,'rows':_0x1ea5bb}:null;}})['then'](respondWithResult(_0x2a37a2,null))['catch'](handleError(_0x2a37a2,null));};exports[_0xb486('0x67')]=function(_0x58d514,_0x39a720,_0x53473d){var _0x23f32d=_0x58d514['body']['ids'];return db[_0xb486('0x68')][_0xb486('0x5e')]({'where':{'id':_0x23f32d},'attributes':['id'],'include':[{'model':db[_0xb486('0x5f')],'as':_0xb486('0x69'),'attributes':['id',_0xb486('0x57'),_0xb486('0x6a'),_0xb486('0x6b'),_0xb486('0x6c')],'raw':!![]}]})[_0xb486('0x2a')](function(_0x155d2e){if(_0x155d2e){var _0x2d30ce=_[_0xb486('0x6d')](_0x155d2e,function(_0x236c99){var _0x28b7b7=_0x236c99[_0xb486('0x50')]({'plain':!![]});return _0x28b7b7[_0xb486('0x69')];});return db[_0xb486('0x33')][_0xb486('0x54')]({'where':{'id':_0x58d514[_0xb486('0x4b')]['id']}})[_0xb486('0x2a')](function(_0x3aa5d5){return db[_0xb486('0x6e')][_0xb486('0x6f')](function(_0x16bca0){return _0x3aa5d5[_0xb486('0x67')](_0x23f32d,{'transaction':_0x16bca0})['then'](function(){return BPromise[_0xb486('0x70')](_0x2d30ce,function(_0x5d76b7){return db[_0xb486('0x71')][_0xb486('0x72')]({'where':{'UserId':_0x5d76b7['id'],'WhatsappQueueId':_0x58d514[_0xb486('0x4b')]['id']},'transaction':_0x16bca0});});})[_0xb486('0x2a')](function(){_0x2d30ce[_0xb486('0x73')](function(_0xdf9090){socket[_0xb486('0x74')]('userWhatsappQueue:save',{'UserId':_0xdf9090['id'],'WhatsappQueueId':_0x3aa5d5['id']});});});});});}})[_0xb486('0x2a')](respondWithStatusCode(_0x39a720,null))[_0xb486('0x49')](handleError(_0x39a720,null));};exports[_0xb486('0x75')]=function(_0x1a14cc,_0x33f016,_0x12c852){return db[_0xb486('0x68')][_0xb486('0x5e')]({'where':{'id':_0x1a14cc[_0xb486('0x38')][_0xb486('0x76')]},'attributes':['id'],'include':[{'model':db[_0xb486('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb486('0x2a')](handleEntityNotFound(_0x33f016,null))[_0xb486('0x2a')](function(_0x97409e){var _0x2077db=_[_0xb486('0x32')](_0x97409e,'id');var _0x827a33=[];var _0x4e515a=[];var _0x4c5f36=squel[_0xb486('0x77')]();_0x4c5f36[_0xb486('0x78')](_0xb486('0x79'))[_0xb486('0x7a')](_0xb486('0x7b'),'tq')[_0xb486('0x7c')](_0xb486('0x7d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb486('0x42')]('WhatsappQueueId\x20=\x20?',_0x1a14cc[_0xb486('0x4b')]['id']);for(var _0x3346dc=0x0;_0x3346dc<_0x97409e[_0xb486('0x3e')];_0x3346dc+=0x1){let _0x3a5620=_0x97409e[_0x3346dc];for(var _0x2ea649=0x0;_0x2ea649<_0x3a5620[_0xb486('0x69')][_0xb486('0x3e')];_0x2ea649+=0x1){let _0x550200=_0x3a5620[_0xb486('0x69')][_0x2ea649];var _0x312727=_0x4c5f36[_0xb486('0x7e')]();_0x312727[_0xb486('0x42')](_0xb486('0x7f'),_0x550200['id']);_0x4e515a[_0xb486('0x80')](db['sequelize'][_0xb486('0x38')](_0x312727['toString'](),{'type':db['sequelize'][_0xb486('0x81')]['SELECT']})['then'](function(_0x4cb06f){if(_0x4cb06f['length']===0x1){return _0x550200['id'];}else{var _0x37bdf5=_[_0xb486('0x82')](_['map'](_0x4cb06f,_0xb486('0x83')),function(_0x5158e3){return _[_0xb486('0x84')](_0x2077db,_0x5158e3);});if(_0x37bdf5){return _0x550200['id'];}}}));}}return BPromise['all'](_0x4e515a)[_0xb486('0x2a')](function(_0x1ecea1){_0x827a33=_(_0x827a33)[_0xb486('0x85')](_0x1ecea1)['compact']()[_0xb486('0x86')]();return db[_0xb486('0x33')][_0xb486('0x54')]({'where':{'id':_0x1a14cc[_0xb486('0x4b')]['id']}})[_0xb486('0x2a')](function(_0xc55950){return db['sequelize'][_0xb486('0x6f')](function(_0x502707){return _0xc55950['removeTeams'](_0x1a14cc[_0xb486('0x38')][_0xb486('0x76')],{'transaction':_0x502707})[_0xb486('0x2a')](function(){if(!_[_0xb486('0x87')](_0x827a33)){return _0xc55950[_0xb486('0x88')](_0x827a33,{'transaction':_0x502707});}})['then'](function(){_0x827a33[_0xb486('0x73')](function(_0x1eadc4){socket[_0xb486('0x74')](_0xb486('0x89'),{'UserId':_0x1eadc4,'WhatsappQueueId':_0xc55950['id']});});});});});});})[_0xb486('0x2a')](respondWithStatusCode(_0x33f016,null))[_0xb486('0x49')](handleError(_0x33f016,null));};exports['addAgents']=function(_0x7f67b4,_0x447702,_0x369598){return db[_0xb486('0x33')][_0xb486('0x54')]({'where':{'id':_0x7f67b4[_0xb486('0x4b')]['id']}})[_0xb486('0x2a')](handleEntityNotFound(_0x447702,null))[_0xb486('0x2a')](function(_0x3c1eb0){if(_0x3c1eb0){return _0x3c1eb0['addAgents'](_0x7f67b4['body']['ids'],_[_0xb486('0x8a')](_0x7f67b4['body'],[_0xb486('0x76'),'id'])||{})[_0xb486('0x8b')](function(_0x31d6b0){for(var _0x2b7fef=0x0;_0x2b7fef<_0x7f67b4[_0xb486('0x59')][_0xb486('0x76')][_0xb486('0x3e')];_0x2b7fef+=0x1){socket[_0xb486('0x74')](_0xb486('0x8c'),{'UserId':Number(_0x7f67b4[_0xb486('0x59')][_0xb486('0x76')][_0x2b7fef]),'WhatsappQueueId':Number(_0x7f67b4[_0xb486('0x4b')]['id'])});}return _0x31d6b0;});}})[_0xb486('0x2a')](respondWithResult(_0x447702,null))['catch'](handleError(_0x447702,null));};exports[_0xb486('0x88')]=function(_0x49fc30,_0x11f048,_0x49fd6e){return db[_0xb486('0x33')][_0xb486('0x54')]({'where':{'id':_0x49fc30[_0xb486('0x4b')]['id']}})[_0xb486('0x2a')](handleEntityNotFound(_0x11f048,null))[_0xb486('0x2a')](function(_0x158c4c){if(_0x158c4c){return _0x158c4c['removeAgents'](_0x49fc30[_0xb486('0x38')][_0xb486('0x76')])['then'](function(){if(_[_0xb486('0x8d')](_0x49fc30[_0xb486('0x38')][_0xb486('0x76')])){for(var _0x5f5010=0x0;_0x5f5010<_0x49fc30['query'][_0xb486('0x76')][_0xb486('0x3e')];_0x5f5010+=0x1){socket[_0xb486('0x74')](_0xb486('0x89'),{'UserId':Number(_0x49fc30[_0xb486('0x38')][_0xb486('0x76')][_0x5f5010]),'WhatsappQueueId':Number(_0x49fc30[_0xb486('0x4b')]['id'])});}}else{socket['emit'](_0xb486('0x89'),{'UserId':Number(_0x49fc30[_0xb486('0x38')][_0xb486('0x76')]),'WhatsappQueueId':Number(_0x49fc30['params']['id'])});}});}})[_0xb486('0x2a')](respondWithStatusCode(_0x11f048,null))['catch'](handleError(_0x11f048,null));};exports[_0xb486('0x8e')]=function(_0x2d3327,_0xa7dbb,_0x358990){var _0x2d270a={};var _0x48e66b={};var _0x2e7272;var _0x593dfc;return db[_0xb486('0x33')][_0xb486('0x8f')]({'where':{'id':_0x2d3327['params']['id']}})[_0xb486('0x2a')](handleEntityNotFound(_0xa7dbb,null))['then'](function(_0x46cae0){if(_0x46cae0){_0x2e7272=_0x46cae0;_0x48e66b[_0xb486('0x37')]=_[_0xb486('0x39')](db[_0xb486('0x5f')][_0xb486('0x4c')]);_0x48e66b[_0xb486('0x38')]=_['keys'](_0x2d3327[_0xb486('0x38')]);_0x48e66b[_0xb486('0x3a')]=_[_0xb486('0x3b')](_0x48e66b['model'],_0x48e66b[_0xb486('0x38')]);_0x2d270a['attributes']=_[_0xb486('0x3b')](_0x48e66b['model'],qs[_0xb486('0x3d')](_0x2d3327[_0xb486('0x38')][_0xb486('0x3d')]));_0x2d270a[_0xb486('0x3c')]=_0x2d270a[_0xb486('0x3c')][_0xb486('0x3e')]?_0x2d270a[_0xb486('0x3c')]:_0x48e66b[_0xb486('0x37')];_0x2d270a[_0xb486('0x5c')]=qs[_0xb486('0x41')](_0x2d3327[_0xb486('0x38')]['sort']);_0x2d270a[_0xb486('0x42')]=qs[_0xb486('0x3a')](_[_0xb486('0x43')](_0x2d3327[_0xb486('0x38')],_0x48e66b['filters']));if(_0x2d3327[_0xb486('0x38')][_0xb486('0x44')]){_0x2d270a[_0xb486('0x42')]=_[_0xb486('0x45')](_0x2d270a[_0xb486('0x42')],{'$or':_[_0xb486('0x32')](_0x2d270a[_0xb486('0x3c')],function(_0x5d82ce){var _0x5220f6={};_0x5220f6[_0x5d82ce]={'$like':'%'+_0x2d3327[_0xb486('0x38')]['filter']+'%'};return _0x5220f6;})});}_0x2d270a=_['merge']({},_0x2d270a,_0x2d3327[_0xb486('0x47')]);return _0x2e7272[_0xb486('0x8e')](_0x2d270a);}})[_0xb486('0x2a')](function(_0x85c6d1){if(_0x85c6d1){_0x593dfc=_0x85c6d1['length'];if(!_0x2d3327[_0xb486('0x38')][_0xb486('0x3f')]('nolimit')){_0x2d270a[_0xb486('0x24')]=qs[_0xb486('0x24')](_0x2d3327[_0xb486('0x38')]['limit']);_0x2d270a['offset']=qs[_0xb486('0x23')](_0x2d3327[_0xb486('0x38')][_0xb486('0x23')]);}return _0x2e7272[_0xb486('0x8e')](_0x2d270a);}})[_0xb486('0x2a')](function(_0x9f90bf){if(_0x9f90bf){return _0x9f90bf?{'count':_0x593dfc,'rows':_0x9f90bf}:null;}})[_0xb486('0x2a')](respondWithResult(_0xa7dbb,null))[_0xb486('0x49')](handleError(_0xa7dbb,null));}; \ No newline at end of file +var _0x15b4=['options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','order','WhatsappQueueId','UserWhatsappQueue','User','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','get','WhatsappQueues','UserProfileResource','destroy','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x15b4,0x160));var _0x415b=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x15b4[_0x4fbfd9];return _0x31dc94;};'use strict';var emlformat=require(_0x415b('0x0'));var rimraf=require(_0x415b('0x1'));var zipdir=require(_0x415b('0x2'));var jsonpatch=require(_0x415b('0x3'));var rp=require(_0x415b('0x4'));var moment=require(_0x415b('0x5'));var BPromise=require(_0x415b('0x6'));var Mustache=require(_0x415b('0x7'));var util=require('util');var path=require(_0x415b('0x8'));var sox=require('sox');var csv=require(_0x415b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x415b('0xa'));var crypto=require(_0x415b('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x415b('0x9'));var querystring=require(_0x415b('0xc'));var Papa=require(_0x415b('0xd'));var Redis=require(_0x415b('0xe'));var authService=require(_0x415b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x415b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x415b('0x11'))(_0x415b('0x12'));var utils=require(_0x415b('0x13'));var config=require(_0x415b('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x415b('0x15')]=_[_0x415b('0x16')](config['redis'],{'host':_0x415b('0x17'),'port':0x18eb});var socket=require(_0x415b('0x18'))(new Redis(config[_0x415b('0x15')]));require('./whatsappQueue.socket')[_0x415b('0x19')](socket);function respondWithStatusCode(_0x20acf0,_0x32af5e){_0x32af5e=_0x32af5e||0xcc;return function(_0x952c4c){if(_0x952c4c){return _0x20acf0[_0x415b('0x1a')](_0x32af5e);}return _0x20acf0[_0x415b('0x1b')](_0x32af5e)[_0x415b('0x1c')]();};}function respondWithResult(_0x4155ab,_0x57a81c){_0x57a81c=_0x57a81c||0xc8;return function(_0x2135b9){if(_0x2135b9){return _0x4155ab[_0x415b('0x1b')](_0x57a81c)[_0x415b('0x1d')](_0x2135b9);}};}function respondWithFilteredResult(_0x476688,_0x181f9a){return function(_0x23ec8b){if(_0x23ec8b){var _0x2db7ec=typeof _0x181f9a[_0x415b('0x1e')]===_0x415b('0x1f')&&typeof _0x181f9a[_0x415b('0x20')]==='undefined';var _0x2a0980=_0x23ec8b[_0x415b('0x21')];var _0x547664=_0x2db7ec?0x0:_0x181f9a[_0x415b('0x1e')];var _0x4fc627=_0x2db7ec?_0x23ec8b[_0x415b('0x21')]:_0x181f9a[_0x415b('0x1e')]+_0x181f9a[_0x415b('0x20')];var _0x10b20b;if(_0x4fc627>=_0x2a0980){_0x4fc627=_0x2a0980;_0x10b20b=0xc8;}else{_0x10b20b=0xce;}_0x476688[_0x415b('0x1b')](_0x10b20b);return _0x476688['set'](_0x415b('0x22'),_0x547664+'-'+_0x4fc627+'/'+_0x2a0980)[_0x415b('0x1d')](_0x23ec8b);}return null;};}function patchUpdates(_0x4e4b08){return function(_0x378fce){try{jsonpatch['apply'](_0x378fce,_0x4e4b08,!![]);}catch(_0x4e9a3d){return BPromise['reject'](_0x4e9a3d);}return _0x378fce[_0x415b('0x23')]();};}function saveUpdates(_0xec30b4,_0x49d26c){return function(_0x1f0860){if(_0x1f0860){return _0x1f0860[_0x415b('0x24')](_0xec30b4)[_0x415b('0x25')](function(_0x2e776c){return _0x2e776c;});}return null;};}function removeEntity(_0x4cc91f,_0x78a267){return function(_0x419791){if(_0x419791){return _0x419791['destroy']()[_0x415b('0x25')](function(){var _0x3d342c=_0x419791[_0x415b('0x26')]({'plain':!![]});var _0x126e38=_0x415b('0x27');return db[_0x415b('0x28')][_0x415b('0x29')]({'where':{'type':_0x126e38,'resourceId':_0x3d342c['id']}})[_0x415b('0x25')](function(){return _0x419791;});})[_0x415b('0x25')](function(){_0x4cc91f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fe639,_0x461b88){return function(_0x14be02){if(!_0x14be02){_0x2fe639['sendStatus'](0x194);}return _0x14be02;};}function handleError(_0x4eedf4,_0x1634af){_0x1634af=_0x1634af||0x1f4;return function(_0xe445d8){logger[_0x415b('0x2a')](_0xe445d8[_0x415b('0x2b')]);if(_0xe445d8[_0x415b('0x2c')]){delete _0xe445d8[_0x415b('0x2c')];}_0x4eedf4[_0x415b('0x1b')](_0x1634af)[_0x415b('0x2d')](_0xe445d8);};}exports[_0x415b('0x2e')]=function(_0x3f9a23,_0x20dc35){var _0x8e4d70={},_0x216c59={},_0x26b2ac={'count':0x0,'rows':[]};var _0x50c9c8=_[_0x415b('0x2f')](db[_0x415b('0x30')][_0x415b('0x31')],function(_0x5d524b){return{'name':_0x5d524b[_0x415b('0x32')],'type':_0x5d524b[_0x415b('0x33')][_0x415b('0x34')]};});_0x216c59[_0x415b('0x35')]=_['map'](_0x50c9c8,'name');_0x216c59[_0x415b('0x36')]=_[_0x415b('0x37')](_0x3f9a23[_0x415b('0x36')]);_0x216c59[_0x415b('0x38')]=_[_0x415b('0x39')](_0x216c59['model'],_0x216c59['query']);_0x8e4d70[_0x415b('0x3a')]=_[_0x415b('0x39')](_0x216c59[_0x415b('0x35')],qs[_0x415b('0x3b')](_0x3f9a23['query']['fields']));_0x8e4d70[_0x415b('0x3a')]=_0x8e4d70['attributes'][_0x415b('0x3c')]?_0x8e4d70[_0x415b('0x3a')]:_0x216c59[_0x415b('0x35')];if(!_0x3f9a23[_0x415b('0x36')]['hasOwnProperty'](_0x415b('0x3d'))){_0x8e4d70[_0x415b('0x20')]=qs[_0x415b('0x20')](_0x3f9a23[_0x415b('0x36')][_0x415b('0x20')]);_0x8e4d70[_0x415b('0x1e')]=qs['offset'](_0x3f9a23[_0x415b('0x36')][_0x415b('0x1e')]);}_0x8e4d70['order']=qs[_0x415b('0x3e')](_0x3f9a23[_0x415b('0x36')][_0x415b('0x3e')]);_0x8e4d70[_0x415b('0x3f')]=qs[_0x415b('0x38')](_[_0x415b('0x40')](_0x3f9a23['query'],_0x216c59[_0x415b('0x38')]),_0x50c9c8);if(_0x3f9a23[_0x415b('0x36')][_0x415b('0x41')]){_0x8e4d70[_0x415b('0x3f')]=_['merge'](_0x8e4d70[_0x415b('0x3f')],{'$or':_[_0x415b('0x2f')](_0x50c9c8,function(_0x361231){if(_0x361231[_0x415b('0x33')]!==_0x415b('0x42')){var _0x4335ea={};_0x4335ea[_0x361231[_0x415b('0x2c')]]={'$like':'%'+_0x3f9a23['query'][_0x415b('0x41')]+'%'};return _0x4335ea;}})});}_0x8e4d70=_[_0x415b('0x43')]({},_0x8e4d70,_0x3f9a23[_0x415b('0x44')]);var _0x3c6227={'where':_0x8e4d70[_0x415b('0x3f')]};return db[_0x415b('0x30')][_0x415b('0x21')](_0x3c6227)[_0x415b('0x25')](function(_0x15a48d){_0x26b2ac[_0x415b('0x21')]=_0x15a48d;if(_0x3f9a23[_0x415b('0x36')][_0x415b('0x45')]){_0x8e4d70[_0x415b('0x46')]=[{'all':!![]}];}return db[_0x415b('0x30')][_0x415b('0x47')](_0x8e4d70);})['then'](function(_0x458db6){_0x26b2ac[_0x415b('0x48')]=_0x458db6;return _0x26b2ac;})[_0x415b('0x25')](respondWithFilteredResult(_0x20dc35,_0x8e4d70))['catch'](handleError(_0x20dc35,null));};exports[_0x415b('0x49')]=function(_0x4afd3a,_0x516691){var _0x5694e7={'raw':!![],'where':{'id':_0x4afd3a[_0x415b('0x4a')]['id']}},_0x5d15b2={};_0x5d15b2[_0x415b('0x35')]=_[_0x415b('0x37')](db[_0x415b('0x30')][_0x415b('0x31')]);_0x5d15b2['query']=_[_0x415b('0x37')](_0x4afd3a[_0x415b('0x36')]);_0x5d15b2[_0x415b('0x38')]=_[_0x415b('0x39')](_0x5d15b2[_0x415b('0x35')],_0x5d15b2['query']);_0x5694e7[_0x415b('0x3a')]=_['intersection'](_0x5d15b2['model'],qs[_0x415b('0x3b')](_0x4afd3a['query'][_0x415b('0x3b')]));_0x5694e7[_0x415b('0x3a')]=_0x5694e7[_0x415b('0x3a')]['length']?_0x5694e7[_0x415b('0x3a')]:_0x5d15b2[_0x415b('0x35')];if(_0x4afd3a['query'][_0x415b('0x45')]){_0x5694e7[_0x415b('0x46')]=[{'all':!![]}];}_0x5694e7=_[_0x415b('0x43')]({},_0x5694e7,_0x4afd3a[_0x415b('0x44')]);return db[_0x415b('0x30')][_0x415b('0x4b')](_0x5694e7)[_0x415b('0x25')](handleEntityNotFound(_0x516691,null))[_0x415b('0x25')](respondWithResult(_0x516691,null))[_0x415b('0x4c')](handleError(_0x516691,null));};exports[_0x415b('0x4d')]=function(_0x46fba9,_0x412a88){return db[_0x415b('0x30')]['create'](_0x46fba9[_0x415b('0x4e')],{})[_0x415b('0x25')](function(_0x402f20){var _0x3a8f50=_0x46fba9[_0x415b('0x4f')][_0x415b('0x26')]({'plain':!![]});if(!_0x3a8f50)throw new Error(_0x415b('0x50'));if(_0x3a8f50[_0x415b('0x51')]===_0x415b('0x4f')){var _0x2fc944=_0x402f20['get']({'plain':!![]});var _0xe0a5c4=_0x415b('0x27');return db['UserProfileSection'][_0x415b('0x4b')]({'where':{'name':_0xe0a5c4,'userProfileId':_0x3a8f50[_0x415b('0x52')]},'raw':!![]})[_0x415b('0x25')](function(_0x3b7858){if(_0x3b7858&&_0x3b7858[_0x415b('0x53')]===0x0){return db['UserProfileResource'][_0x415b('0x4d')]({'name':_0x2fc944[_0x415b('0x2c')],'resourceId':_0x2fc944['id'],'type':_0x3b7858[_0x415b('0x2c')],'sectionId':_0x3b7858['id']},{})[_0x415b('0x25')](function(){return _0x402f20;});}else{return _0x402f20;}})[_0x415b('0x4c')](function(_0xcf0f73){logger[_0x415b('0x2a')](_0x415b('0x54'),_0xcf0f73);throw _0xcf0f73;});}return _0x402f20;})[_0x415b('0x25')](respondWithResult(_0x412a88,0xc9))[_0x415b('0x4c')](handleError(_0x412a88,null));};exports[_0x415b('0x24')]=function(_0x51098a,_0x121524){if(_0x51098a[_0x415b('0x4e')]['id']){delete _0x51098a[_0x415b('0x4e')]['id'];}return db[_0x415b('0x30')][_0x415b('0x4b')]({'where':{'id':_0x51098a[_0x415b('0x4a')]['id']}})[_0x415b('0x25')](handleEntityNotFound(_0x121524,null))[_0x415b('0x25')](saveUpdates(_0x51098a['body'],null))[_0x415b('0x25')](respondWithResult(_0x121524,null))['catch'](handleError(_0x121524,null));};exports[_0x415b('0x29')]=function(_0x9839c6,_0x2ac5a1){return db[_0x415b('0x30')][_0x415b('0x4b')]({'where':{'id':_0x9839c6[_0x415b('0x4a')]['id']}})[_0x415b('0x25')](handleEntityNotFound(_0x2ac5a1,null))[_0x415b('0x25')](removeEntity(_0x2ac5a1,null))['catch'](handleError(_0x2ac5a1,null));};exports['describe']=function(_0x24266f,_0x2ac763){return db[_0x415b('0x30')][_0x415b('0x55')]()['then'](respondWithResult(_0x2ac763,null))[_0x415b('0x4c')](handleError(_0x2ac763,null));};exports[_0x415b('0x56')]=function(_0x462192,_0x2c2631,_0x178899){var _0x188fbc={'raw':!![],'where':{}},_0x5729ac={},_0x5ad4b2;return db[_0x415b('0x30')][_0x415b('0x57')]({'where':{'id':_0x462192[_0x415b('0x4a')]['id']}})[_0x415b('0x25')](handleEntityNotFound(_0x2c2631,null))['then'](function(_0x4c3164){if(_0x4c3164){_0x5ad4b2=_0x4c3164['get']({'plain':!![]});_0x5729ac[_0x415b('0x35')]=_['keys'](db['UserWhatsappQueue'][_0x415b('0x31')]);_0x5729ac[_0x415b('0x36')]=_[_0x415b('0x37')](_0x462192[_0x415b('0x36')]);_0x5729ac[_0x415b('0x38')]=_['intersection'](_0x5729ac[_0x415b('0x35')],_0x5729ac[_0x415b('0x36')]);_0x188fbc[_0x415b('0x3a')]=_['intersection'](_0x5729ac['model'],qs['fields'](_0x462192[_0x415b('0x36')][_0x415b('0x3b')]));_0x188fbc[_0x415b('0x3a')]=_0x188fbc[_0x415b('0x3a')]['length']?_0x188fbc['attributes']:_0x5729ac[_0x415b('0x35')];if(!_0x462192[_0x415b('0x36')][_0x415b('0x58')](_0x415b('0x3d'))){_0x188fbc[_0x415b('0x20')]=qs[_0x415b('0x20')](_0x462192['query']['limit']);_0x188fbc[_0x415b('0x1e')]=qs[_0x415b('0x1e')](_0x462192[_0x415b('0x36')][_0x415b('0x1e')]);}_0x188fbc[_0x415b('0x59')]=qs[_0x415b('0x3e')](_0x462192['query']['sort']);_0x188fbc[_0x415b('0x3f')]=qs[_0x415b('0x38')](_['pick'](_0x462192['query'],_0x5729ac[_0x415b('0x38')]));_0x188fbc['where'][_0x415b('0x5a')]=_0x4c3164['id'];if(_0x462192[_0x415b('0x36')][_0x415b('0x41')]){_0x188fbc['where']=_[_0x415b('0x43')](_0x188fbc[_0x415b('0x3f')],{'$or':_['map'](_0x188fbc[_0x415b('0x3a')],function(_0x474692){var _0x4bc299={};_0x4bc299[_0x474692]={'$like':'%'+_0x462192['query']['filter']+'%'};return _0x4bc299;})});}_0x188fbc=_['merge']({},_0x188fbc,_0x462192[_0x415b('0x44')]);return db[_0x415b('0x5b')][_0x415b('0x47')](_0x188fbc);}})[_0x415b('0x25')](function(_0x5dc12d){if(_0x5dc12d){return db[_0x415b('0x5c')][_0x415b('0x5d')]({'where':{'id':_[_0x415b('0x2f')](_0x5dc12d,_0x415b('0x5e')),'role':'agent'},'attributes':['id',_0x415b('0x2c'),_0x415b('0x5f'),_0x415b('0x60'),_0x415b('0x61')]});}})[_0x415b('0x25')](function(_0x422f3b){if(_0x422f3b){return{'count':_0x422f3b[_0x415b('0x21')],'rows':_[_0x415b('0x2f')](_0x422f3b[_0x415b('0x48')],function(_0x2d3766){return{'membername':_0x2d3766[_0x415b('0x2c')],'UserId':_0x2d3766['id'],'queue_name':_0x5ad4b2['name'],'WhatsappQueueId':_0x5ad4b2['id'],'interface':util[_0x415b('0x62')](_0x415b('0x63'),_0x415b('0x64'),_0x2d3766['name']),'penalty':0x0,'paused':_0x2d3766[_0x415b('0x5f')],'createdAt':_0x2d3766['createdAt'],'updatedAt':_0x2d3766[_0x415b('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x415b('0x25')](respondWithFilteredResult(_0x2c2631,_0x188fbc))[_0x415b('0x4c')](handleError(_0x2c2631,null));};exports[_0x415b('0x65')]=function(_0x3f108a,_0x62243,_0x13a466){var _0x4627f1={};var _0x3fc5f6={};var _0x3f4a54;var _0x3d337d;return db['WhatsappQueue'][_0x415b('0x57')]({'where':{'id':_0x3f108a[_0x415b('0x4a')]['id']}})[_0x415b('0x25')](handleEntityNotFound(_0x62243,null))[_0x415b('0x25')](function(_0x263c4b){if(_0x263c4b){_0x3f4a54=_0x263c4b;_0x3fc5f6[_0x415b('0x35')]=_['keys'](db[_0x415b('0x66')][_0x415b('0x31')]);_0x3fc5f6[_0x415b('0x36')]=_[_0x415b('0x37')](_0x3f108a[_0x415b('0x36')]);_0x3fc5f6['filters']=_[_0x415b('0x39')](_0x3fc5f6[_0x415b('0x35')],_0x3fc5f6[_0x415b('0x36')]);_0x4627f1[_0x415b('0x3a')]=_[_0x415b('0x39')](_0x3fc5f6['model'],qs['fields'](_0x3f108a[_0x415b('0x36')][_0x415b('0x3b')]));_0x4627f1[_0x415b('0x3a')]=_0x4627f1[_0x415b('0x3a')][_0x415b('0x3c')]?_0x4627f1[_0x415b('0x3a')]:_0x3fc5f6['model'];_0x4627f1[_0x415b('0x59')]=qs['sort'](_0x3f108a[_0x415b('0x36')]['sort']);_0x4627f1[_0x415b('0x3f')]=qs[_0x415b('0x38')](_[_0x415b('0x40')](_0x3f108a[_0x415b('0x36')],_0x3fc5f6['filters']));if(_0x3f108a['query'][_0x415b('0x41')]){_0x4627f1[_0x415b('0x3f')]=_[_0x415b('0x43')](_0x4627f1[_0x415b('0x3f')],{'$or':_[_0x415b('0x2f')](_0x4627f1[_0x415b('0x3a')],function(_0x3a4e41){var _0x5f2106={};_0x5f2106[_0x3a4e41]={'$like':'%'+_0x3f108a[_0x415b('0x36')]['filter']+'%'};return _0x5f2106;})});}_0x4627f1=_[_0x415b('0x43')]({},_0x4627f1,_0x3f108a['options']);return _0x3f4a54['getTeams'](_0x4627f1);}})['then'](function(_0x97808f){if(_0x97808f){_0x3d337d=_0x97808f['length'];if(!_0x3f108a[_0x415b('0x36')][_0x415b('0x58')](_0x415b('0x3d'))){_0x4627f1['limit']=qs[_0x415b('0x20')](_0x3f108a[_0x415b('0x36')]['limit']);_0x4627f1[_0x415b('0x1e')]=qs[_0x415b('0x1e')](_0x3f108a[_0x415b('0x36')]['offset']);}return _0x3f4a54[_0x415b('0x65')](_0x4627f1);}})[_0x415b('0x25')](function(_0x22c45f){if(_0x22c45f){return _0x22c45f?{'count':_0x3d337d,'rows':_0x22c45f}:null;}})[_0x415b('0x25')](respondWithResult(_0x62243,null))[_0x415b('0x4c')](handleError(_0x62243,null));};exports[_0x415b('0x67')]=function(_0x25d0b6,_0x51e319,_0xd8aec3){var _0x16b32e=_0x25d0b6['body'][_0x415b('0x68')];return db[_0x415b('0x66')][_0x415b('0x47')]({'where':{'id':_0x16b32e},'attributes':['id'],'include':[{'model':db['User'],'as':_0x415b('0x69'),'attributes':['id','name',_0x415b('0x6a'),_0x415b('0x6b'),'interface'],'raw':!![]}]})[_0x415b('0x25')](function(_0xf89ec7){if(_0xf89ec7){var _0x509a06=_[_0x415b('0x6c')](_0xf89ec7,function(_0x1db92){var _0x242f49=_0x1db92['get']({'plain':!![]});return _0x242f49['Agents'];});return db[_0x415b('0x30')][_0x415b('0x4b')]({'where':{'id':_0x25d0b6[_0x415b('0x4a')]['id']}})[_0x415b('0x25')](function(_0x34cd80){return db[_0x415b('0x6d')][_0x415b('0x6e')](function(_0x39a436){return _0x34cd80['addTeams'](_0x16b32e,{'transaction':_0x39a436})['then'](function(){return BPromise[_0x415b('0x6f')](_0x509a06,function(_0x468b46){return db[_0x415b('0x5b')][_0x415b('0x70')]({'where':{'UserId':_0x468b46['id'],'WhatsappQueueId':_0x25d0b6[_0x415b('0x4a')]['id']},'transaction':_0x39a436});});})[_0x415b('0x25')](function(){_0x509a06[_0x415b('0x71')](function(_0x1aaff1){socket[_0x415b('0x72')](_0x415b('0x73'),{'UserId':_0x1aaff1['id'],'WhatsappQueueId':_0x34cd80['id']});});});});});}})[_0x415b('0x25')](respondWithStatusCode(_0x51e319,null))[_0x415b('0x4c')](handleError(_0x51e319,null));};exports[_0x415b('0x74')]=function(_0x1f6254,_0x23f933,_0xbf7ae){return db[_0x415b('0x66')][_0x415b('0x47')]({'where':{'id':_0x1f6254[_0x415b('0x36')][_0x415b('0x68')]},'attributes':['id'],'include':[{'model':db[_0x415b('0x5c')],'as':_0x415b('0x69'),'attributes':['id'],'raw':!![]}]})[_0x415b('0x25')](handleEntityNotFound(_0x23f933,null))[_0x415b('0x25')](function(_0x4eec87){var _0x29c634=_[_0x415b('0x2f')](_0x4eec87,'id');var _0x269d95=[];var _0x480b6e=[];var _0x390feb=squel[_0x415b('0x75')]();_0x390feb[_0x415b('0x76')](_0x415b('0x77'))[_0x415b('0x78')]('team_has_whatsapp_queues','tq')['join'](_0x415b('0x79'),'ut',_0x415b('0x7a'))['where'](_0x415b('0x7b'),_0x1f6254[_0x415b('0x4a')]['id']);for(var _0x2a31cf=0x0;_0x2a31cf<_0x4eec87[_0x415b('0x3c')];_0x2a31cf+=0x1){let _0x451f5c=_0x4eec87[_0x2a31cf];for(var _0xa188e=0x0;_0xa188e<_0x451f5c[_0x415b('0x69')][_0x415b('0x3c')];_0xa188e+=0x1){let _0x22055b=_0x451f5c[_0x415b('0x69')][_0xa188e];var _0x42ef47=_0x390feb['clone']();_0x42ef47[_0x415b('0x3f')](_0x415b('0x7c'),_0x22055b['id']);_0x480b6e['push'](db[_0x415b('0x6d')][_0x415b('0x36')](_0x42ef47[_0x415b('0x7d')](),{'type':db[_0x415b('0x6d')][_0x415b('0x7e')]['SELECT']})['then'](function(_0x4e8edf){if(_0x4e8edf[_0x415b('0x3c')]===0x1){return _0x22055b['id'];}else{var _0x57ac9d=_[_0x415b('0x7f')](_[_0x415b('0x2f')](_0x4e8edf,_0x415b('0x80')),function(_0xc63764){return _['includes'](_0x29c634,_0xc63764);});if(_0x57ac9d){return _0x22055b['id'];}}}));}}return BPromise[_0x415b('0x81')](_0x480b6e)['then'](function(_0x145590){_0x269d95=_(_0x269d95)[_0x415b('0x82')](_0x145590)[_0x415b('0x83')]()[_0x415b('0x84')]();return db[_0x415b('0x30')][_0x415b('0x4b')]({'where':{'id':_0x1f6254['params']['id']}})[_0x415b('0x25')](function(_0x313c38){return db[_0x415b('0x6d')][_0x415b('0x6e')](function(_0x33d779){return _0x313c38[_0x415b('0x74')](_0x1f6254[_0x415b('0x36')][_0x415b('0x68')],{'transaction':_0x33d779})['then'](function(){if(!_[_0x415b('0x85')](_0x269d95)){return _0x313c38[_0x415b('0x86')](_0x269d95,{'transaction':_0x33d779});}})[_0x415b('0x25')](function(){_0x269d95[_0x415b('0x71')](function(_0x32b761){socket[_0x415b('0x72')](_0x415b('0x87'),{'UserId':_0x32b761,'WhatsappQueueId':_0x313c38['id']});});});});});});})[_0x415b('0x25')](respondWithStatusCode(_0x23f933,null))['catch'](handleError(_0x23f933,null));};exports['addAgents']=function(_0x3f72b6,_0x3c6035,_0x5afb18){return db[_0x415b('0x30')][_0x415b('0x4b')]({'where':{'id':_0x3f72b6[_0x415b('0x4a')]['id']}})[_0x415b('0x25')](handleEntityNotFound(_0x3c6035,null))[_0x415b('0x25')](function(_0xabbd0e){if(_0xabbd0e){return _0xabbd0e[_0x415b('0x88')](_0x3f72b6[_0x415b('0x4e')][_0x415b('0x68')],_[_0x415b('0x89')](_0x3f72b6[_0x415b('0x4e')],[_0x415b('0x68'),'id'])||{})['spread'](function(_0x5dca8c){for(var _0x482c20=0x0;_0x482c20<_0x3f72b6[_0x415b('0x4e')]['ids'][_0x415b('0x3c')];_0x482c20+=0x1){socket[_0x415b('0x72')](_0x415b('0x73'),{'UserId':Number(_0x3f72b6[_0x415b('0x4e')][_0x415b('0x68')][_0x482c20]),'WhatsappQueueId':Number(_0x3f72b6[_0x415b('0x4a')]['id'])});}return _0x5dca8c;});}})['then'](respondWithResult(_0x3c6035,null))[_0x415b('0x4c')](handleError(_0x3c6035,null));};exports[_0x415b('0x86')]=function(_0x4349c1,_0x192159,_0x310571){return db['WhatsappQueue'][_0x415b('0x4b')]({'where':{'id':_0x4349c1[_0x415b('0x4a')]['id']}})[_0x415b('0x25')](handleEntityNotFound(_0x192159,null))[_0x415b('0x25')](function(_0x482afd){if(_0x482afd){return _0x482afd[_0x415b('0x86')](_0x4349c1[_0x415b('0x36')][_0x415b('0x68')])['then'](function(){if(_[_0x415b('0x8a')](_0x4349c1[_0x415b('0x36')][_0x415b('0x68')])){for(var _0x1954e5=0x0;_0x1954e5<_0x4349c1[_0x415b('0x36')][_0x415b('0x68')]['length'];_0x1954e5+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x4349c1[_0x415b('0x36')][_0x415b('0x68')][_0x1954e5]),'WhatsappQueueId':Number(_0x4349c1[_0x415b('0x4a')]['id'])});}}else{socket['emit'](_0x415b('0x87'),{'UserId':Number(_0x4349c1['query'][_0x415b('0x68')]),'WhatsappQueueId':Number(_0x4349c1[_0x415b('0x4a')]['id'])});}});}})[_0x415b('0x25')](respondWithStatusCode(_0x192159,null))[_0x415b('0x4c')](handleError(_0x192159,null));};exports[_0x415b('0x8b')]=function(_0x55700f,_0x2ec781,_0x556f0d){var _0x1bd0b0={};var _0x2f6024={};var _0x333eb7;var _0x2ff82b;return db['WhatsappQueue'][_0x415b('0x57')]({'where':{'id':_0x55700f[_0x415b('0x4a')]['id']}})[_0x415b('0x25')](handleEntityNotFound(_0x2ec781,null))[_0x415b('0x25')](function(_0x1a7e1a){if(_0x1a7e1a){_0x333eb7=_0x1a7e1a;_0x2f6024[_0x415b('0x35')]=_[_0x415b('0x37')](db[_0x415b('0x5c')]['rawAttributes']);_0x2f6024['query']=_['keys'](_0x55700f[_0x415b('0x36')]);_0x2f6024[_0x415b('0x38')]=_[_0x415b('0x39')](_0x2f6024[_0x415b('0x35')],_0x2f6024[_0x415b('0x36')]);_0x1bd0b0['attributes']=_[_0x415b('0x39')](_0x2f6024[_0x415b('0x35')],qs[_0x415b('0x3b')](_0x55700f[_0x415b('0x36')][_0x415b('0x3b')]));_0x1bd0b0[_0x415b('0x3a')]=_0x1bd0b0[_0x415b('0x3a')][_0x415b('0x3c')]?_0x1bd0b0[_0x415b('0x3a')]:_0x2f6024[_0x415b('0x35')];_0x1bd0b0['order']=qs[_0x415b('0x3e')](_0x55700f[_0x415b('0x36')][_0x415b('0x3e')]);_0x1bd0b0[_0x415b('0x3f')]=qs[_0x415b('0x38')](_[_0x415b('0x40')](_0x55700f[_0x415b('0x36')],_0x2f6024['filters']));if(_0x55700f[_0x415b('0x36')][_0x415b('0x41')]){_0x1bd0b0[_0x415b('0x3f')]=_['merge'](_0x1bd0b0[_0x415b('0x3f')],{'$or':_[_0x415b('0x2f')](_0x1bd0b0[_0x415b('0x3a')],function(_0x4d2627){var _0x12979e={};_0x12979e[_0x4d2627]={'$like':'%'+_0x55700f[_0x415b('0x36')]['filter']+'%'};return _0x12979e;})});}_0x1bd0b0=_[_0x415b('0x43')]({},_0x1bd0b0,_0x55700f['options']);return _0x333eb7[_0x415b('0x8b')](_0x1bd0b0);}})[_0x415b('0x25')](function(_0x5548a4){if(_0x5548a4){_0x2ff82b=_0x5548a4['length'];if(!_0x55700f[_0x415b('0x36')]['hasOwnProperty']('nolimit')){_0x1bd0b0[_0x415b('0x20')]=qs[_0x415b('0x20')](_0x55700f['query'][_0x415b('0x20')]);_0x1bd0b0['offset']=qs['offset'](_0x55700f[_0x415b('0x36')][_0x415b('0x1e')]);}return _0x333eb7[_0x415b('0x8b')](_0x1bd0b0);}})[_0x415b('0x25')](function(_0x304e25){if(_0x304e25){return _0x304e25?{'count':_0x2ff82b,'rows':_0x304e25}:null;}})[_0x415b('0x25')](respondWithResult(_0x2ec781,null))[_0x415b('0x4c')](handleError(_0x2ec781,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index b610d2b..7b2227c 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 _0x776e=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','WhatsappQueue'];(function(_0x4dfed3,_0xb1991c){var _0x249a39=function(_0x3c69d6){while(--_0x3c69d6){_0x4dfed3['push'](_0x4dfed3['shift']());}};_0x249a39(++_0xb1991c);}(_0x776e,0x136));var _0xe776=function(_0x1dfe73,_0x54965b){_0x1dfe73=_0x1dfe73-0x0;var _0x209744=_0x776e[_0x1dfe73];return _0x209744;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xe776('0x0'))['db'][_0xe776('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe776('0x2'),'afterUpdate':_0xe776('0x3'),'afterDestroy':_0xe776('0x4')};function emitEvent(_0x50e1e6){return function(_0x231a32,_0x5d3168,_0x238ccc){WhatsappQueueEvents[_0xe776('0x5')](_0x50e1e6+':'+_0x231a32['id'],_0x231a32);WhatsappQueueEvents[_0xe776('0x5')](_0x50e1e6,_0x231a32);_0x238ccc(null);};}for(var e in events){if(events[_0xe776('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xe776('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0x1e1b=['emit','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove'];(function(_0xb85b10,_0x5d5338){var _0x5d5356=function(_0x248b7a){while(--_0x248b7a){_0xb85b10['push'](_0xb85b10['shift']());}};_0x5d5356(++_0x5d5338);}(_0x1e1b,0x12f));var _0xb1e1=function(_0x4b2251,_0x393f10){_0x4b2251=_0x4b2251-0x0;var _0x5d22fb=_0x1e1b[_0x4b2251];return _0x5d22fb;};'use strict';var EventEmitter=require(_0xb1e1('0x0'));var WhatsappQueue=require(_0xb1e1('0x1'))['db'][_0xb1e1('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xb1e1('0x3')](0x0);var events={'afterCreate':_0xb1e1('0x4'),'afterUpdate':_0xb1e1('0x5'),'afterDestroy':_0xb1e1('0x6')};function emitEvent(_0x3d1811){return function(_0xc4a1c5,_0x1e4d0f,_0x45380c){WhatsappQueueEvents[_0xb1e1('0x7')](_0x3d1811+':'+_0xc4a1c5['id'],_0xc4a1c5);WhatsappQueueEvents[_0xb1e1('0x7')](_0x3d1811,_0xc4a1c5);_0x45380c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xb1e1('0x8')](e,emitEvent(event));}}module[_0xb1e1('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 9fa02cf..0960874 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 _0xacdf=['moment','bluebird','request-promise','path','rimraf','define','WhatsappQueue'];(function(_0x1d5871,_0x5edfee){var _0x3f82f3=function(_0x4f69d8){while(--_0x4f69d8){_0x1d5871['push'](_0x1d5871['shift']());}};_0x3f82f3(++_0x5edfee);}(_0xacdf,0x11f));var _0xfacd=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xacdf[_0xc8a931];return _0x28bd27;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfacd('0x0'));var BPromise=require(_0xfacd('0x1'));var rp=require(_0xfacd('0x2'));var fs=require('fs');var path=require(_0xfacd('0x3'));var rimraf=require(_0xfacd('0x4'));var config=require('../../config/environment');var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x4b1ab9,_0x282070){return _0x4b1ab9[_0xfacd('0x5')](_0xfacd('0x6'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae2f=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0xae2f,0x138));var _0xfae2=function(_0xdaab62,_0x2728ab){_0xdaab62=_0xdaab62-0x0;var _0x13d767=_0xae2f[_0xdaab62];return _0x13d767;};'use strict';var _=require('lodash');var util=require(_0xfae2('0x0'));var logger=require(_0xfae2('0x1'))('api');var moment=require(_0xfae2('0x2'));var BPromise=require(_0xfae2('0x3'));var rp=require(_0xfae2('0x4'));var fs=require('fs');var path=require(_0xfae2('0x5'));var rimraf=require('rimraf');var config=require(_0xfae2('0x6'));var attributes=require(_0xfae2('0x7'));module[_0xfae2('0x8')]=function(_0x4485a4,_0x39342e){return _0x4485a4[_0xfae2('0x9')](_0xfae2('0xa'),attributes,{'tableName':_0xfae2('0xb'),'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 db428a3..237395d 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 _0xac9e=['code','message','info','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','ShowWhatsappQueue','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','WhatsappQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x374bbb,_0x1a2762){var _0x15a2a7=function(_0xf25592){while(--_0xf25592){_0x374bbb['push'](_0x374bbb['shift']());}};_0x15a2a7(++_0x1a2762);}(_0xac9e,0x108));var _0xeac9=function(_0x2d8f77,_0x4497a7){_0x2d8f77=_0x2d8f77-0x0;var _0x5f2915=_0xac9e[_0x2d8f77];return _0x5f2915;};'use strict';var _=require(_0xeac9('0x0'));var util=require(_0xeac9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeac9('0x2'));var fs=require('fs');var Redis=require(_0xeac9('0x3'));var db=require(_0xeac9('0x4'))['db'];var utils=require(_0xeac9('0x5'));var logger=require(_0xeac9('0x6'))(_0xeac9('0x7'));var config=require(_0xeac9('0x8'));var jayson=require(_0xeac9('0x9'));var client=jayson[_0xeac9('0xa')]['http']({'port':0x232a});config['redis']=_[_0xeac9('0xb')](config[_0xeac9('0xc')],{'host':_0xeac9('0xd'),'port':0x18eb});var socket=require(_0xeac9('0xe'))(new Redis(config[_0xeac9('0xc')]));require(_0xeac9('0xf'))[_0xeac9('0x10')](socket);function respondWithRpcPromise(_0x19ee63,_0x46312d,_0x5fd8af){return new BPromise(function(_0x133a79,_0x3b6d3c){return client[_0xeac9('0x11')](_0x19ee63,_0x5fd8af)['then'](function(_0x185c1c){logger['info'](_0xeac9('0x12'),_0x46312d,'request\x20sent');logger[_0xeac9('0x13')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x46312d,_0xeac9('0x14'),JSON[_0xeac9('0x15')](_0x185c1c));if(_0x185c1c[_0xeac9('0x16')]){if(_0x185c1c[_0xeac9('0x16')][_0xeac9('0x17')]===0x1f4){logger['error'](_0xeac9('0x12'),_0x46312d,_0x185c1c[_0xeac9('0x16')][_0xeac9('0x18')]);return _0x3b6d3c(_0x185c1c[_0xeac9('0x16')]['message']);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x46312d,_0x185c1c['error']['message']);return _0x133a79(_0x185c1c[_0xeac9('0x16')][_0xeac9('0x18')]);}else{logger[_0xeac9('0x19')]('WhatsappQueue,\x20%s,\x20%s',_0x46312d,_0xeac9('0x14'));_0x133a79(_0x185c1c[_0xeac9('0x1a')][_0xeac9('0x18')]);}})['catch'](function(_0x909320){logger[_0xeac9('0x16')](_0xeac9('0x12'),_0x46312d,_0x909320);_0x3b6d3c(_0x909320);});});}exports[_0xeac9('0x1b')]=function(_0x1a58d6){var _0x721f44=this;return new Promise(function(_0x3ac419,_0xb187c0){return db[_0xeac9('0x1c')][_0xeac9('0x1d')]({'raw':_0x1a58d6[_0xeac9('0x1e')]?_0x1a58d6[_0xeac9('0x1e')][_0xeac9('0x1f')]===undefined?!![]:![]:!![],'where':_0x1a58d6[_0xeac9('0x1e')]?_0x1a58d6['options'][_0xeac9('0x20')]||null:null,'attributes':_0x1a58d6[_0xeac9('0x1e')]?_0x1a58d6[_0xeac9('0x1e')]['attributes']||null:null,'limit':_0x1a58d6[_0xeac9('0x1e')]?_0x1a58d6[_0xeac9('0x1e')][_0xeac9('0x21')]||null:null,'include':_0x1a58d6[_0xeac9('0x1e')]?_0x1a58d6[_0xeac9('0x1e')][_0xeac9('0x22')]?_[_0xeac9('0x23')](_0x1a58d6[_0xeac9('0x1e')]['include'],function(_0x4759e4){return{'model':db[_0x4759e4[_0xeac9('0x24')]],'as':_0x4759e4['as'],'attributes':_0x4759e4[_0xeac9('0x25')],'include':_0x4759e4[_0xeac9('0x22')]?_['map'](_0x4759e4[_0xeac9('0x22')],function(_0x474931){return{'model':db[_0x474931[_0xeac9('0x24')]],'as':_0x474931['as'],'attributes':_0x474931[_0xeac9('0x25')],'include':_0x474931[_0xeac9('0x22')]?_['map'](_0x474931[_0xeac9('0x22')],function(_0x2608d2){return{'model':db[_0x2608d2[_0xeac9('0x24')]],'as':_0x2608d2['as'],'attributes':_0x2608d2[_0xeac9('0x25')]};}):[]};}):[]};}):[]:[]})[_0xeac9('0x26')](function(_0x26631a){logger['info'](_0xeac9('0x1b'),_0x1a58d6);logger[_0xeac9('0x13')](_0xeac9('0x1b'),_0x1a58d6,JSON[_0xeac9('0x15')](_0x26631a));_0x3ac419(_0x26631a);})['catch'](function(_0x3ca541){logger[_0xeac9('0x16')](_0xeac9('0x1b'),_0x3ca541['message'],_0x1a58d6);_0xb187c0(_0x721f44[_0xeac9('0x16')](0x1f4,_0x3ca541['message']));});});};exports[_0xeac9('0x27')]=function(_0x5f0ac1){var _0x1c3e1b=this;return new Promise(function(_0xdb0862,_0x5a1cb4){return db[_0xeac9('0x1c')][_0xeac9('0x28')]({'raw':_0x5f0ac1['options']?_0x5f0ac1[_0xeac9('0x1e')][_0xeac9('0x1f')]===undefined?!![]:![]:!![],'where':_0x5f0ac1[_0xeac9('0x1e')]?_0x5f0ac1[_0xeac9('0x1e')][_0xeac9('0x20')]||null:null,'attributes':_0x5f0ac1[_0xeac9('0x1e')]?_0x5f0ac1['options'][_0xeac9('0x25')]||null:null,'include':_0x5f0ac1[_0xeac9('0x1e')]?_0x5f0ac1[_0xeac9('0x1e')][_0xeac9('0x22')]?_['map'](_0x5f0ac1['options']['include'],function(_0x46cfba){return{'model':db[_0x46cfba[_0xeac9('0x24')]],'as':_0x46cfba['as'],'attributes':_0x46cfba['attributes'],'include':_0x46cfba[_0xeac9('0x22')]?_['map'](_0x46cfba[_0xeac9('0x22')],function(_0x50fa67){return{'model':db[_0x50fa67[_0xeac9('0x24')]],'as':_0x50fa67['as'],'attributes':_0x50fa67[_0xeac9('0x25')],'include':_0x50fa67[_0xeac9('0x22')]?_['map'](_0x50fa67[_0xeac9('0x22')],function(_0xf7560f){return{'model':db[_0xf7560f[_0xeac9('0x24')]],'as':_0xf7560f['as'],'attributes':_0xf7560f['attributes']};}):[]};}):[]};}):[]:[]})[_0xeac9('0x26')](function(_0x40bfc3){logger[_0xeac9('0x19')]('ShowWhatsappQueue',_0x5f0ac1);logger[_0xeac9('0x13')]('ShowWhatsappQueue',_0x5f0ac1,JSON['stringify'](_0x40bfc3));_0xdb0862(_0x40bfc3);})['catch'](function(_0x365d68){logger[_0xeac9('0x16')](_0xeac9('0x27'),_0x365d68[_0xeac9('0x18')],_0x5f0ac1);_0x5a1cb4(_0x1c3e1b['error'](0x1f4,_0x365d68[_0xeac9('0x18')]));});});}; \ No newline at end of file +var _0x37d0=['error','code','message','info','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','attributes','limit','include','map','model','then','ShowWhatsappQueue','find','where','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xe6e64a,_0x8f5a0f){var _0x2c96f5=function(_0x256073){while(--_0x256073){_0xe6e64a['push'](_0xe6e64a['shift']());}};_0x2c96f5(++_0x8f5a0f);}(_0x37d0,0x1c3));var _0x037d=function(_0x10ff70,_0x58d537){_0x10ff70=_0x10ff70-0x0;var _0x52191f=_0x37d0[_0x10ff70];return _0x52191f;};'use strict';var _=require('lodash');var util=require(_0x037d('0x0'));var moment=require('moment');var BPromise=require(_0x037d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x037d('0x2'));var db=require(_0x037d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x037d('0x4'))(_0x037d('0x5'));var config=require('../../config/environment');var jayson=require(_0x037d('0x6'));var client=jayson[_0x037d('0x7')]['http']({'port':0x232a});config[_0x037d('0x8')]=_[_0x037d('0x9')](config[_0x037d('0x8')],{'host':_0x037d('0xa'),'port':0x18eb});var socket=require(_0x037d('0xb'))(new Redis(config[_0x037d('0x8')]));require('./whatsappQueue.socket')[_0x037d('0xc')](socket);function respondWithRpcPromise(_0x460336,_0x421c36,_0x49b6e9){return new BPromise(function(_0x537a9b,_0x4175d4){return client['request'](_0x460336,_0x49b6e9)['then'](function(_0x4891d5){logger['info'](_0x037d('0xd'),_0x421c36,_0x037d('0xe'));logger[_0x037d('0xf')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x421c36,_0x037d('0xe'),JSON[_0x037d('0x10')](_0x4891d5));if(_0x4891d5[_0x037d('0x11')]){if(_0x4891d5[_0x037d('0x11')][_0x037d('0x12')]===0x1f4){logger[_0x037d('0x11')](_0x037d('0xd'),_0x421c36,_0x4891d5['error']['message']);return _0x4175d4(_0x4891d5['error'][_0x037d('0x13')]);}logger[_0x037d('0x11')](_0x037d('0xd'),_0x421c36,_0x4891d5[_0x037d('0x11')][_0x037d('0x13')]);return _0x537a9b(_0x4891d5[_0x037d('0x11')][_0x037d('0x13')]);}else{logger[_0x037d('0x14')](_0x037d('0xd'),_0x421c36,_0x037d('0xe'));_0x537a9b(_0x4891d5[_0x037d('0x15')][_0x037d('0x13')]);}})[_0x037d('0x16')](function(_0x402b4e){logger[_0x037d('0x11')](_0x037d('0xd'),_0x421c36,_0x402b4e);_0x4175d4(_0x402b4e);});});}exports[_0x037d('0x17')]=function(_0x7e8bf6){var _0x415654=this;return new Promise(function(_0x14b3e4,_0x352d30){return db[_0x037d('0x18')]['findAll']({'raw':_0x7e8bf6[_0x037d('0x19')]?_0x7e8bf6[_0x037d('0x19')][_0x037d('0x1a')]===undefined?!![]:![]:!![],'where':_0x7e8bf6['options']?_0x7e8bf6[_0x037d('0x19')]['where']||null:null,'attributes':_0x7e8bf6[_0x037d('0x19')]?_0x7e8bf6[_0x037d('0x19')][_0x037d('0x1b')]||null:null,'limit':_0x7e8bf6[_0x037d('0x19')]?_0x7e8bf6[_0x037d('0x19')][_0x037d('0x1c')]||null:null,'include':_0x7e8bf6[_0x037d('0x19')]?_0x7e8bf6[_0x037d('0x19')][_0x037d('0x1d')]?_[_0x037d('0x1e')](_0x7e8bf6[_0x037d('0x19')][_0x037d('0x1d')],function(_0x287c46){return{'model':db[_0x287c46[_0x037d('0x1f')]],'as':_0x287c46['as'],'attributes':_0x287c46[_0x037d('0x1b')],'include':_0x287c46[_0x037d('0x1d')]?_[_0x037d('0x1e')](_0x287c46[_0x037d('0x1d')],function(_0x455189){return{'model':db[_0x455189['model']],'as':_0x455189['as'],'attributes':_0x455189[_0x037d('0x1b')],'include':_0x455189['include']?_[_0x037d('0x1e')](_0x455189[_0x037d('0x1d')],function(_0x2194fc){return{'model':db[_0x2194fc['model']],'as':_0x2194fc['as'],'attributes':_0x2194fc[_0x037d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x037d('0x20')](function(_0x371af2){logger[_0x037d('0x14')](_0x037d('0x17'),_0x7e8bf6);logger[_0x037d('0xf')](_0x037d('0x17'),_0x7e8bf6,JSON['stringify'](_0x371af2));_0x14b3e4(_0x371af2);})[_0x037d('0x16')](function(_0x481868){logger['error'](_0x037d('0x17'),_0x481868[_0x037d('0x13')],_0x7e8bf6);_0x352d30(_0x415654[_0x037d('0x11')](0x1f4,_0x481868[_0x037d('0x13')]));});});};exports[_0x037d('0x21')]=function(_0x53942f){var _0x1afadd=this;return new Promise(function(_0x3ee253,_0x44bfc1){return db['WhatsappQueue'][_0x037d('0x22')]({'raw':_0x53942f['options']?_0x53942f[_0x037d('0x19')][_0x037d('0x1a')]===undefined?!![]:![]:!![],'where':_0x53942f['options']?_0x53942f['options'][_0x037d('0x23')]||null:null,'attributes':_0x53942f[_0x037d('0x19')]?_0x53942f[_0x037d('0x19')][_0x037d('0x1b')]||null:null,'include':_0x53942f[_0x037d('0x19')]?_0x53942f[_0x037d('0x19')][_0x037d('0x1d')]?_['map'](_0x53942f['options'][_0x037d('0x1d')],function(_0x612182){return{'model':db[_0x612182[_0x037d('0x1f')]],'as':_0x612182['as'],'attributes':_0x612182['attributes'],'include':_0x612182[_0x037d('0x1d')]?_['map'](_0x612182[_0x037d('0x1d')],function(_0x4354f5){return{'model':db[_0x4354f5[_0x037d('0x1f')]],'as':_0x4354f5['as'],'attributes':_0x4354f5[_0x037d('0x1b')],'include':_0x4354f5[_0x037d('0x1d')]?_['map'](_0x4354f5[_0x037d('0x1d')],function(_0x309435){return{'model':db[_0x309435['model']],'as':_0x309435['as'],'attributes':_0x309435[_0x037d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5992bc){logger[_0x037d('0x14')](_0x037d('0x21'),_0x53942f);logger[_0x037d('0xf')]('ShowWhatsappQueue',_0x53942f,JSON[_0x037d('0x10')](_0x5992bc));_0x3ee253(_0x5992bc);})[_0x037d('0x16')](function(_0x19f3b9){logger[_0x037d('0x11')](_0x037d('0x21'),_0x19f3b9[_0x037d('0x13')],_0x53942f);_0x44bfc1(_0x1afadd[_0x037d('0x11')](0x1f4,_0x19f3b9[_0x037d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 81430a8..f3a4c7f 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 _0xed4c=['./whatsappQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x8b914e,_0xf26a9a){var _0x4bc20e=function(_0x9773b2){while(--_0x9773b2){_0x8b914e['push'](_0x8b914e['shift']());}};_0x4bc20e(++_0xf26a9a);}(_0xed4c,0x180));var _0xced4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xed4c[_0x14add3];return _0x4a174f;};'use strict';var WhatsappQueueEvents=require(_0xced4('0x0'));var events=[_0xced4('0x1'),_0xced4('0x2'),_0xced4('0x3')];function createListener(_0x3cd786,_0x23ea60){return function(_0x15d42e){_0x23ea60[_0xced4('0x4')](_0x3cd786,_0x15d42e);};}function removeListener(_0x4def8b,_0x537ac3){return function(){WhatsappQueueEvents[_0xced4('0x5')](_0x4def8b,_0x537ac3);};}exports[_0xced4('0x6')]=function(_0x542ff3){for(var _0x194c3f=0x0,_0x579c3e=events[_0xced4('0x7')];_0x194c3f<_0x579c3e;_0x194c3f++){var _0x22cf81=events[_0x194c3f];var _0x3e170a=createListener('whatsappQueue:'+_0x22cf81,_0x542ff3);WhatsappQueueEvents['on'](_0x22cf81,_0x3e170a);}}; \ No newline at end of file +var _0xbc1b=['emit','removeListener','length','whatsappQueue:','./whatsappQueue.events','save','remove','update'];(function(_0x4ce15a,_0x105a9d){var _0x4bd614=function(_0x28f287){while(--_0x28f287){_0x4ce15a['push'](_0x4ce15a['shift']());}};_0x4bd614(++_0x105a9d);}(_0xbc1b,0x94));var _0xbbc1=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0xbc1b[_0x836465];return _0x2150ea;};'use strict';var WhatsappQueueEvents=require(_0xbbc1('0x0'));var events=[_0xbbc1('0x1'),_0xbbc1('0x2'),_0xbbc1('0x3')];function createListener(_0x39572a,_0x3ed599){return function(_0x46d44e){_0x3ed599[_0xbbc1('0x4')](_0x39572a,_0x46d44e);};}function removeListener(_0x2070c1,_0x4d9107){return function(){WhatsappQueueEvents[_0xbbc1('0x5')](_0x2070c1,_0x4d9107);};}exports['register']=function(_0x5abda5){for(var _0x52c8e7=0x0,_0x584754=events[_0xbbc1('0x6')];_0x52c8e7<_0x584754;_0x52c8e7++){var _0x12079d=events[_0x52c8e7];var _0x1e3a99=createListener(_0xbbc1('0x7')+_0x12079d,_0x5abda5);WhatsappQueueEvents['on'](_0x12079d,_0x1e3a99);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 0bb2e6e..7eab8be 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 _0x7986=['/describe','/:id','show','post','create','put','delete','destroy','exports','multer','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated'];(function(_0x16363b,_0x55063b){var _0x5b9897=function(_0x3bcac6){while(--_0x3bcac6){_0x16363b['push'](_0x16363b['shift']());}};_0x5b9897(++_0x55063b);}(_0x7986,0x1a7));var _0x6798=function(_0x49c457,_0x15d44c){_0x49c457=_0x49c457-0x0;var _0x3ab92c=_0x7986[_0x49c457];return _0x3ab92c;};'use strict';var multer=require(_0x6798('0x0'));var util=require('util');var path=require(_0x6798('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6798('0x2')]();var fs_extra=require(_0x6798('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6798('0x4'));var config=require(_0x6798('0x5'));var controller=require(_0x6798('0x6'));router[_0x6798('0x7')]('/',auth[_0x6798('0x8')](),controller['index']);router[_0x6798('0x7')](_0x6798('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x6798('0x7')](_0x6798('0xa'),auth['isAuthenticated'](),controller[_0x6798('0xb')]);router[_0x6798('0xc')]('/',auth[_0x6798('0x8')](),controller[_0x6798('0xd')]);router[_0x6798('0xe')](_0x6798('0xa'),auth[_0x6798('0x8')](),controller['update']);router[_0x6798('0xf')](_0x6798('0xa'),auth['isAuthenticated'](),controller[_0x6798('0x10')]);module[_0x6798('0x11')]=router; \ No newline at end of file +var _0x3152=['post','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/describe','describe','get','/:id','show'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x3152,0x147));var _0x2315=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x3152[_0x3070dc];return _0x431489;};'use strict';var multer=require(_0x2315('0x0'));var util=require(_0x2315('0x1'));var path=require(_0x2315('0x2'));var timeout=require(_0x2315('0x3'));var express=require(_0x2315('0x4'));var router=express['Router']();var fs_extra=require(_0x2315('0x5'));var auth=require(_0x2315('0x6'));var interaction=require(_0x2315('0x7'));var config=require('../../config/environment');var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0x2315('0x8')](),controller[_0x2315('0x9')]);router['get'](_0x2315('0xa'),auth[_0x2315('0x8')](),controller[_0x2315('0xb')]);router[_0x2315('0xc')](_0x2315('0xd'),auth[_0x2315('0x8')](),controller[_0x2315('0xe')]);router[_0x2315('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x2315('0x8')](),controller['update']);router[_0x2315('0x10')](_0x2315('0xd'),auth['isAuthenticated'](),controller[_0x2315('0x11')]);module[_0x2315('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index de0cc37..2fbb432 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x2d051d,_0x491767){var _0x3fe854=function(_0x18b2e4){while(--_0x18b2e4){_0x2d051d['push'](_0x2d051d['shift']());}};_0x3fe854(++_0x491767);}(_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 +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x2d9566,_0x1aa421){var _0x5ce511=function(_0x1e64c7){while(--_0x1e64c7){_0x2d9566['push'](_0x2d9566['shift']());}};_0x5ce511(++_0x1aa421);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 1492b9b..8bce621 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 _0xe820=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','json','reject','save','update','then','destroy','error','name','index','WhatsappQueueReport','rawAttributes','key','map','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','describe','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x2a238a,_0x1d5054){var _0xeef802=function(_0x583637){while(--_0x583637){_0x2a238a['push'](_0x2a238a['shift']());}};_0xeef802(++_0x1d5054);}(_0xe820,0xd2));var _0x0e82=function(_0x13651d,_0x11c53a){_0x13651d=_0x13651d-0x0;var _0x572479=_0xe820[_0x13651d];return _0x572479;};'use strict';var emlformat=require(_0x0e82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0e82('0x2'));var BPromise=require(_0x0e82('0x3'));var Mustache=require(_0x0e82('0x4'));var util=require('util');var path=require(_0x0e82('0x5'));var sox=require('sox');var csv=require(_0x0e82('0x6'));var ejs=require(_0x0e82('0x7'));var fs=require('fs');var fs_extra=require(_0x0e82('0x8'));var _=require(_0x0e82('0x9'));var squel=require(_0x0e82('0xa'));var crypto=require('crypto');var jsforce=require(_0x0e82('0xb'));var deskjs=require(_0x0e82('0xc'));var toCsv=require(_0x0e82('0x6'));var querystring=require(_0x0e82('0xd'));var Papa=require(_0x0e82('0xe'));var Redis=require('ioredis');var authService=require(_0x0e82('0xf'));var qs=require(_0x0e82('0x10'));var as=require(_0x0e82('0x11'));var hardwareService=require(_0x0e82('0x12'));var logger=require(_0x0e82('0x13'))(_0x0e82('0x14'));var utils=require(_0x0e82('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0e82('0x16'));var db=require(_0x0e82('0x17'))['db'];function respondWithStatusCode(_0x21c40b,_0x1da28a){_0x1da28a=_0x1da28a||0xcc;return function(_0x166dc2){if(_0x166dc2){return _0x21c40b[_0x0e82('0x18')](_0x1da28a);}return _0x21c40b['status'](_0x1da28a)[_0x0e82('0x19')]();};}function respondWithResult(_0x5c161c,_0x48d99b){_0x48d99b=_0x48d99b||0xc8;return function(_0x1e4ddb){if(_0x1e4ddb){return _0x5c161c['status'](_0x48d99b)['json'](_0x1e4ddb);}};}function respondWithFilteredResult(_0x5a2d28,_0x3298c7){return function(_0x4d1aa0){if(_0x4d1aa0){var _0x585b9b=typeof _0x3298c7[_0x0e82('0x1a')]==='undefined'&&typeof _0x3298c7[_0x0e82('0x1b')]===_0x0e82('0x1c');var _0x233c6d=_0x4d1aa0[_0x0e82('0x1d')];var _0x53622b=_0x585b9b?0x0:_0x3298c7[_0x0e82('0x1a')];var _0x310aac=_0x585b9b?_0x4d1aa0[_0x0e82('0x1d')]:_0x3298c7[_0x0e82('0x1a')]+_0x3298c7[_0x0e82('0x1b')];var _0x1230e6;if(_0x310aac>=_0x233c6d){_0x310aac=_0x233c6d;_0x1230e6=0xc8;}else{_0x1230e6=0xce;}_0x5a2d28[_0x0e82('0x1e')](_0x1230e6);return _0x5a2d28[_0x0e82('0x1f')](_0x0e82('0x20'),_0x53622b+'-'+_0x310aac+'/'+_0x233c6d)[_0x0e82('0x21')](_0x4d1aa0);}return null;};}function patchUpdates(_0x5903c){return function(_0x493280){try{jsonpatch['apply'](_0x493280,_0x5903c,!![]);}catch(_0x294696){return BPromise[_0x0e82('0x22')](_0x294696);}return _0x493280[_0x0e82('0x23')]();};}function saveUpdates(_0xb0a31,_0xd48046){return function(_0x1bdad4){if(_0x1bdad4){return _0x1bdad4[_0x0e82('0x24')](_0xb0a31)[_0x0e82('0x25')](function(_0x56b3ad){return _0x56b3ad;});}return null;};}function removeEntity(_0x1b71b4,_0x13f023){return function(_0x3d6c28){if(_0x3d6c28){return _0x3d6c28[_0x0e82('0x26')]()['then'](function(){_0x1b71b4[_0x0e82('0x1e')](0xcc)[_0x0e82('0x19')]();});}};}function handleEntityNotFound(_0x7a9399,_0x16e11c){return function(_0x4900d3){if(!_0x4900d3){_0x7a9399[_0x0e82('0x18')](0x194);}return _0x4900d3;};}function handleError(_0x51dbcd,_0x595319){_0x595319=_0x595319||0x1f4;return function(_0x384f88){logger[_0x0e82('0x27')](_0x384f88['stack']);if(_0x384f88[_0x0e82('0x28')]){delete _0x384f88[_0x0e82('0x28')];}_0x51dbcd[_0x0e82('0x1e')](_0x595319)['send'](_0x384f88);};}exports[_0x0e82('0x29')]=function(_0x25fa4e,_0x4ee65a){var _0xabc536={},_0x59a5b6={},_0x4300f9={'count':0x0,'rows':[]};var _0x3ec302=_['map'](db[_0x0e82('0x2a')][_0x0e82('0x2b')],function(_0x661718){return{'name':_0x661718['fieldName'],'type':_0x661718['type'][_0x0e82('0x2c')]};});_0x59a5b6['model']=_[_0x0e82('0x2d')](_0x3ec302,'name');_0x59a5b6[_0x0e82('0x2e')]=_[_0x0e82('0x2f')](_0x25fa4e[_0x0e82('0x2e')]);_0x59a5b6['filters']=_[_0x0e82('0x30')](_0x59a5b6['model'],_0x59a5b6[_0x0e82('0x2e')]);_0xabc536[_0x0e82('0x31')]=_[_0x0e82('0x30')](_0x59a5b6[_0x0e82('0x32')],qs[_0x0e82('0x33')](_0x25fa4e[_0x0e82('0x2e')]['fields']));_0xabc536[_0x0e82('0x31')]=_0xabc536[_0x0e82('0x31')][_0x0e82('0x34')]?_0xabc536[_0x0e82('0x31')]:_0x59a5b6[_0x0e82('0x32')];if(!_0x25fa4e[_0x0e82('0x2e')][_0x0e82('0x35')](_0x0e82('0x36'))){_0xabc536[_0x0e82('0x1b')]=qs[_0x0e82('0x1b')](_0x25fa4e[_0x0e82('0x2e')][_0x0e82('0x1b')]);_0xabc536[_0x0e82('0x1a')]=qs[_0x0e82('0x1a')](_0x25fa4e[_0x0e82('0x2e')]['offset']);}_0xabc536[_0x0e82('0x37')]=qs[_0x0e82('0x38')](_0x25fa4e[_0x0e82('0x2e')][_0x0e82('0x38')]);_0xabc536['where']=qs[_0x0e82('0x39')](_[_0x0e82('0x3a')](_0x25fa4e['query'],_0x59a5b6[_0x0e82('0x39')]),_0x3ec302);if(_0x25fa4e['query']['filter']){_0xabc536[_0x0e82('0x3b')]=_[_0x0e82('0x3c')](_0xabc536[_0x0e82('0x3b')],{'$or':_[_0x0e82('0x2d')](_0x3ec302,function(_0x61a5ce){if(_0x61a5ce[_0x0e82('0x3d')]!==_0x0e82('0x3e')){var _0x50fed8={};_0x50fed8[_0x61a5ce['name']]={'$like':'%'+_0x25fa4e[_0x0e82('0x2e')][_0x0e82('0x3f')]+'%'};return _0x50fed8;}})});}_0xabc536=_[_0x0e82('0x3c')]({},_0xabc536,_0x25fa4e[_0x0e82('0x40')]);var _0x265872={'where':_0xabc536[_0x0e82('0x3b')]};return db[_0x0e82('0x2a')][_0x0e82('0x1d')](_0x265872)['then'](function(_0x3ba181){_0x4300f9[_0x0e82('0x1d')]=_0x3ba181;if(_0x25fa4e[_0x0e82('0x2e')][_0x0e82('0x41')]){_0xabc536[_0x0e82('0x42')]=[{'all':!![]}];}return db[_0x0e82('0x2a')][_0x0e82('0x43')](_0xabc536);})['then'](function(_0x311cb8){_0x4300f9[_0x0e82('0x44')]=_0x311cb8;return _0x4300f9;})[_0x0e82('0x25')](respondWithFilteredResult(_0x4ee65a,_0xabc536))[_0x0e82('0x45')](handleError(_0x4ee65a,null));};exports[_0x0e82('0x46')]=function(_0x423b14,_0x453cd3){var _0x50322b={'raw':!![],'where':{'id':_0x423b14['params']['id']}},_0x581764={};_0x581764['model']=_['keys'](db['WhatsappQueueReport'][_0x0e82('0x2b')]);_0x581764[_0x0e82('0x2e')]=_[_0x0e82('0x2f')](_0x423b14[_0x0e82('0x2e')]);_0x581764[_0x0e82('0x39')]=_[_0x0e82('0x30')](_0x581764[_0x0e82('0x32')],_0x581764[_0x0e82('0x2e')]);_0x50322b['attributes']=_['intersection'](_0x581764[_0x0e82('0x32')],qs[_0x0e82('0x33')](_0x423b14[_0x0e82('0x2e')][_0x0e82('0x33')]));_0x50322b[_0x0e82('0x31')]=_0x50322b[_0x0e82('0x31')][_0x0e82('0x34')]?_0x50322b[_0x0e82('0x31')]:_0x581764['model'];if(_0x423b14[_0x0e82('0x2e')]['includeAll']){_0x50322b[_0x0e82('0x42')]=[{'all':!![]}];}_0x50322b=_['merge']({},_0x50322b,_0x423b14[_0x0e82('0x40')]);return db['WhatsappQueueReport'][_0x0e82('0x47')](_0x50322b)[_0x0e82('0x25')](handleEntityNotFound(_0x453cd3,null))[_0x0e82('0x25')](respondWithResult(_0x453cd3,null))['catch'](handleError(_0x453cd3,null));};exports['create']=function(_0x331668,_0x132c45){return db[_0x0e82('0x2a')]['create'](_0x331668[_0x0e82('0x48')],{})['then'](respondWithResult(_0x132c45,0xc9))[_0x0e82('0x45')](handleError(_0x132c45,null));};exports[_0x0e82('0x24')]=function(_0x162890,_0x64406e){if(_0x162890[_0x0e82('0x48')]['id']){delete _0x162890[_0x0e82('0x48')]['id'];}return db[_0x0e82('0x2a')][_0x0e82('0x47')]({'where':{'id':_0x162890[_0x0e82('0x49')]['id']}})[_0x0e82('0x25')](handleEntityNotFound(_0x64406e,null))[_0x0e82('0x25')](saveUpdates(_0x162890[_0x0e82('0x48')],null))['then'](respondWithResult(_0x64406e,null))[_0x0e82('0x45')](handleError(_0x64406e,null));};exports[_0x0e82('0x26')]=function(_0x576726,_0x360858){return db['WhatsappQueueReport']['find']({'where':{'id':_0x576726[_0x0e82('0x49')]['id']}})['then'](handleEntityNotFound(_0x360858,null))[_0x0e82('0x25')](removeEntity(_0x360858,null))[_0x0e82('0x45')](handleError(_0x360858,null));};exports[_0x0e82('0x4a')]=function(_0x149100,_0xdbb813){return db['WhatsappQueueReport'][_0x0e82('0x4a')]()['then'](respondWithResult(_0xdbb813,null))[_0x0e82('0x45')](handleError(_0xdbb813,null));}; \ No newline at end of file +var _0x5b12=['options','includeAll','include','findAll','then','show','params','rawAttributes','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','ejs','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','undefined','count','offset','Content-Range','apply','reject','update','destroy','error','name','index','map','WhatsappQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x44719a,_0x4caa09){var _0x353591=function(_0x2b8d13){while(--_0x2b8d13){_0x44719a['push'](_0x44719a['shift']());}};_0x353591(++_0x4caa09);}(_0x5b12,0xa3));var _0x25b1=function(_0x4b9349,_0x200451){_0x4b9349=_0x4b9349-0x0;var _0x1b1d01=_0x5b12[_0x4b9349];return _0x1b1d01;};'use strict';var emlformat=require(_0x25b1('0x0'));var rimraf=require(_0x25b1('0x1'));var zipdir=require(_0x25b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25b1('0x3'));var moment=require('moment');var BPromise=require(_0x25b1('0x4'));var Mustache=require(_0x25b1('0x5'));var util=require('util');var path=require(_0x25b1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x25b1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x25b1('0x8'));var crypto=require(_0x25b1('0x9'));var jsforce=require(_0x25b1('0xa'));var deskjs=require(_0x25b1('0xb'));var toCsv=require(_0x25b1('0xc'));var querystring=require(_0x25b1('0xd'));var Papa=require(_0x25b1('0xe'));var Redis=require(_0x25b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b1('0x10'));var as=require(_0x25b1('0x11'));var hardwareService=require(_0x25b1('0x12'));var logger=require(_0x25b1('0x13'))(_0x25b1('0x14'));var utils=require(_0x25b1('0x15'));var config=require(_0x25b1('0x16'));var licenseUtil=require(_0x25b1('0x17'));var db=require(_0x25b1('0x18'))['db'];function respondWithStatusCode(_0x459070,_0xbdd348){_0xbdd348=_0xbdd348||0xcc;return function(_0x1c5421){if(_0x1c5421){return _0x459070[_0x25b1('0x19')](_0xbdd348);}return _0x459070[_0x25b1('0x1a')](_0xbdd348)[_0x25b1('0x1b')]();};}function respondWithResult(_0x76b5c4,_0x4ee40c){_0x4ee40c=_0x4ee40c||0xc8;return function(_0x2c337a){if(_0x2c337a){return _0x76b5c4[_0x25b1('0x1a')](_0x4ee40c)['json'](_0x2c337a);}};}function respondWithFilteredResult(_0xb5b9cf,_0x4bb1bb){return function(_0xe32e02){if(_0xe32e02){var _0x4a5a58=typeof _0x4bb1bb['offset']===_0x25b1('0x1c')&&typeof _0x4bb1bb['limit']===_0x25b1('0x1c');var _0x2ca567=_0xe32e02[_0x25b1('0x1d')];var _0x27ccc9=_0x4a5a58?0x0:_0x4bb1bb[_0x25b1('0x1e')];var _0x2a7d14=_0x4a5a58?_0xe32e02[_0x25b1('0x1d')]:_0x4bb1bb[_0x25b1('0x1e')]+_0x4bb1bb['limit'];var _0x4ecff1;if(_0x2a7d14>=_0x2ca567){_0x2a7d14=_0x2ca567;_0x4ecff1=0xc8;}else{_0x4ecff1=0xce;}_0xb5b9cf[_0x25b1('0x1a')](_0x4ecff1);return _0xb5b9cf['set'](_0x25b1('0x1f'),_0x27ccc9+'-'+_0x2a7d14+'/'+_0x2ca567)['json'](_0xe32e02);}return null;};}function patchUpdates(_0x3bfd7d){return function(_0x59aa37){try{jsonpatch[_0x25b1('0x20')](_0x59aa37,_0x3bfd7d,!![]);}catch(_0x529310){return BPromise[_0x25b1('0x21')](_0x529310);}return _0x59aa37['save']();};}function saveUpdates(_0x4e3f48,_0x565cfd){return function(_0x3bca9f){if(_0x3bca9f){return _0x3bca9f[_0x25b1('0x22')](_0x4e3f48)['then'](function(_0x19bab8){return _0x19bab8;});}return null;};}function removeEntity(_0x26b555,_0x1e5915){return function(_0x246acd){if(_0x246acd){return _0x246acd[_0x25b1('0x23')]()['then'](function(){_0x26b555[_0x25b1('0x1a')](0xcc)[_0x25b1('0x1b')]();});}};}function handleEntityNotFound(_0xd22469,_0x282187){return function(_0x1f37ed){if(!_0x1f37ed){_0xd22469[_0x25b1('0x19')](0x194);}return _0x1f37ed;};}function handleError(_0x5d9ed7,_0x3c05c6){_0x3c05c6=_0x3c05c6||0x1f4;return function(_0x27dd68){logger[_0x25b1('0x24')](_0x27dd68['stack']);if(_0x27dd68[_0x25b1('0x25')]){delete _0x27dd68[_0x25b1('0x25')];}_0x5d9ed7[_0x25b1('0x1a')](_0x3c05c6)['send'](_0x27dd68);};}exports[_0x25b1('0x26')]=function(_0x54ce2d,_0x19ecd1){var _0x3febb8={},_0x3a4475={},_0x293413={'count':0x0,'rows':[]};var _0x362118=_[_0x25b1('0x27')](db[_0x25b1('0x28')]['rawAttributes'],function(_0x30d455){return{'name':_0x30d455[_0x25b1('0x29')],'type':_0x30d455[_0x25b1('0x2a')][_0x25b1('0x2b')]};});_0x3a4475[_0x25b1('0x2c')]=_['map'](_0x362118,_0x25b1('0x25'));_0x3a4475[_0x25b1('0x2d')]=_[_0x25b1('0x2e')](_0x54ce2d[_0x25b1('0x2d')]);_0x3a4475[_0x25b1('0x2f')]=_['intersection'](_0x3a4475['model'],_0x3a4475[_0x25b1('0x2d')]);_0x3febb8['attributes']=_[_0x25b1('0x30')](_0x3a4475[_0x25b1('0x2c')],qs[_0x25b1('0x31')](_0x54ce2d['query']['fields']));_0x3febb8[_0x25b1('0x32')]=_0x3febb8[_0x25b1('0x32')][_0x25b1('0x33')]?_0x3febb8['attributes']:_0x3a4475[_0x25b1('0x2c')];if(!_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x34')](_0x25b1('0x35'))){_0x3febb8['limit']=qs[_0x25b1('0x36')](_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x36')]);_0x3febb8['offset']=qs['offset'](_0x54ce2d[_0x25b1('0x2d')]['offset']);}_0x3febb8[_0x25b1('0x37')]=qs[_0x25b1('0x38')](_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x38')]);_0x3febb8[_0x25b1('0x39')]=qs[_0x25b1('0x2f')](_[_0x25b1('0x3a')](_0x54ce2d[_0x25b1('0x2d')],_0x3a4475[_0x25b1('0x2f')]),_0x362118);if(_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3b')]){_0x3febb8[_0x25b1('0x39')]=_[_0x25b1('0x3c')](_0x3febb8[_0x25b1('0x39')],{'$or':_[_0x25b1('0x27')](_0x362118,function(_0x4837d5){if(_0x4837d5[_0x25b1('0x2a')]!==_0x25b1('0x3d')){var _0x53423d={};_0x53423d[_0x4837d5[_0x25b1('0x25')]]={'$like':'%'+_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3b')]+'%'};return _0x53423d;}})});}_0x3febb8=_[_0x25b1('0x3c')]({},_0x3febb8,_0x54ce2d[_0x25b1('0x3e')]);var _0x5bdefd={'where':_0x3febb8[_0x25b1('0x39')]};return db['WhatsappQueueReport'][_0x25b1('0x1d')](_0x5bdefd)['then'](function(_0x2e8747){_0x293413[_0x25b1('0x1d')]=_0x2e8747;if(_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3f')]){_0x3febb8[_0x25b1('0x40')]=[{'all':!![]}];}return db[_0x25b1('0x28')][_0x25b1('0x41')](_0x3febb8);})[_0x25b1('0x42')](function(_0x3f9754){_0x293413['rows']=_0x3f9754;return _0x293413;})[_0x25b1('0x42')](respondWithFilteredResult(_0x19ecd1,_0x3febb8))['catch'](handleError(_0x19ecd1,null));};exports[_0x25b1('0x43')]=function(_0x2f56ac,_0x4d4e32){var _0x52d3f8={'raw':!![],'where':{'id':_0x2f56ac[_0x25b1('0x44')]['id']}},_0x39b4c7={};_0x39b4c7[_0x25b1('0x2c')]=_[_0x25b1('0x2e')](db[_0x25b1('0x28')][_0x25b1('0x45')]);_0x39b4c7[_0x25b1('0x2d')]=_[_0x25b1('0x2e')](_0x2f56ac[_0x25b1('0x2d')]);_0x39b4c7[_0x25b1('0x2f')]=_[_0x25b1('0x30')](_0x39b4c7[_0x25b1('0x2c')],_0x39b4c7[_0x25b1('0x2d')]);_0x52d3f8[_0x25b1('0x32')]=_[_0x25b1('0x30')](_0x39b4c7[_0x25b1('0x2c')],qs[_0x25b1('0x31')](_0x2f56ac['query']['fields']));_0x52d3f8['attributes']=_0x52d3f8[_0x25b1('0x32')]['length']?_0x52d3f8[_0x25b1('0x32')]:_0x39b4c7['model'];if(_0x2f56ac[_0x25b1('0x2d')][_0x25b1('0x3f')]){_0x52d3f8[_0x25b1('0x40')]=[{'all':!![]}];}_0x52d3f8=_[_0x25b1('0x3c')]({},_0x52d3f8,_0x2f56ac[_0x25b1('0x3e')]);return db[_0x25b1('0x28')]['find'](_0x52d3f8)[_0x25b1('0x42')](handleEntityNotFound(_0x4d4e32,null))[_0x25b1('0x42')](respondWithResult(_0x4d4e32,null))[_0x25b1('0x46')](handleError(_0x4d4e32,null));};exports[_0x25b1('0x47')]=function(_0x58ae67,_0x489f73){return db[_0x25b1('0x28')][_0x25b1('0x47')](_0x58ae67['body'],{})[_0x25b1('0x42')](respondWithResult(_0x489f73,0xc9))['catch'](handleError(_0x489f73,null));};exports[_0x25b1('0x22')]=function(_0x4b6181,_0x543f9b){if(_0x4b6181[_0x25b1('0x48')]['id']){delete _0x4b6181[_0x25b1('0x48')]['id'];}return db[_0x25b1('0x28')][_0x25b1('0x49')]({'where':{'id':_0x4b6181['params']['id']}})[_0x25b1('0x42')](handleEntityNotFound(_0x543f9b,null))['then'](saveUpdates(_0x4b6181[_0x25b1('0x48')],null))['then'](respondWithResult(_0x543f9b,null))[_0x25b1('0x46')](handleError(_0x543f9b,null));};exports[_0x25b1('0x23')]=function(_0x1fcc79,_0x4fb92e){return db[_0x25b1('0x28')][_0x25b1('0x49')]({'where':{'id':_0x1fcc79[_0x25b1('0x44')]['id']}})[_0x25b1('0x42')](handleEntityNotFound(_0x4fb92e,null))[_0x25b1('0x42')](removeEntity(_0x4fb92e,null))[_0x25b1('0x46')](handleError(_0x4fb92e,null));};exports['describe']=function(_0x134c64,_0x133f50){return db[_0x25b1('0x28')][_0x25b1('0x4a')]()[_0x25b1('0x42')](respondWithResult(_0x133f50,null))[_0x25b1('0x46')](handleError(_0x133f50,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index da42f80..1b25ff0 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 _0x5771=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','uniqueid','lodash','util','api'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5771,0x1b9));var _0x1577=function(_0x6f1e2e,_0x313e9f){_0x6f1e2e=_0x6f1e2e-0x0;var _0x5ae23c=_0x5771[_0x6f1e2e];return _0x5ae23c;};'use strict';var _=require(_0x1577('0x0'));var util=require(_0x1577('0x1'));var logger=require('../../config/logger')(_0x1577('0x2'));var moment=require('moment');var BPromise=require(_0x1577('0x3'));var rp=require(_0x1577('0x4'));var fs=require('fs');var path=require(_0x1577('0x5'));var rimraf=require(_0x1577('0x6'));var config=require(_0x1577('0x7'));var attributes=require(_0x1577('0x8'));module['exports']=function(_0x47b9bd,_0x55dad0){return _0x47b9bd[_0x1577('0x9')](_0x1577('0xa'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x1577('0xb'),'fields':[_0x1577('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa0fa=['rimraf','../../config/environment','./whatsappQueueReport.attributes','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3068fc,_0x1b214a){var _0x12b7f3=function(_0x3e0fd3){while(--_0x3e0fd3){_0x3068fc['push'](_0x3068fc['shift']());}};_0x12b7f3(++_0x1b214a);}(_0xa0fa,0xbc));var _0xaa0f=function(_0x1a5970,_0x25ffc6){_0x1a5970=_0x1a5970-0x0;var _0x4fd7af=_0xa0fa[_0x1a5970];return _0x4fd7af;};'use strict';var _=require(_0xaa0f('0x0'));var util=require('util');var logger=require(_0xaa0f('0x1'))(_0xaa0f('0x2'));var moment=require(_0xaa0f('0x3'));var BPromise=require(_0xaa0f('0x4'));var rp=require(_0xaa0f('0x5'));var fs=require('fs');var path=require(_0xaa0f('0x6'));var rimraf=require(_0xaa0f('0x7'));var config=require(_0xaa0f('0x8'));var attributes=require(_0xaa0f('0x9'));module['exports']=function(_0x7dbdcc,_0x53b365){return _0x7dbdcc['define'](_0xaa0f('0xa'),attributes,{'tableName':_0xaa0f('0xb'),'paranoid':![],'indexes':[{'name':_0xaa0f('0xc'),'fields':[_0xaa0f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 955bce8..5b82f05 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 _0x9edd=['body','options','raw','stringify','update','where','attributes','limit','UpdateWhatsappQueueReport','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','CreateWhatsappQueueReport','WhatsappQueueReport','create'];(function(_0x59d32c,_0x306b7a){var _0x26e818=function(_0x4c3ed4){while(--_0x4c3ed4){_0x59d32c['push'](_0x59d32c['shift']());}};_0x26e818(++_0x306b7a);}(_0x9edd,0xb4));var _0xd9ed=function(_0xe18110,_0xe78b8c){_0xe18110=_0xe18110-0x0;var _0x2d86d7=_0x9edd[_0xe18110];return _0x2d86d7;};'use strict';var _=require(_0xd9ed('0x0'));var util=require(_0xd9ed('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd9ed('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9ed('0x3'))['db'];var utils=require(_0xd9ed('0x4'));var logger=require(_0xd9ed('0x5'))(_0xd9ed('0x6'));var config=require(_0xd9ed('0x7'));var jayson=require(_0xd9ed('0x8'));var client=jayson[_0xd9ed('0x9')][_0xd9ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29e6a1,_0xd6a665,_0x4238a7){return new BPromise(function(_0x461404,_0x1cc26c){return client['request'](_0x29e6a1,_0x4238a7)[_0xd9ed('0xb')](function(_0x50f03c){logger[_0xd9ed('0xc')](_0xd9ed('0xd'),_0xd6a665,'request\x20sent');logger[_0xd9ed('0xe')](_0xd9ed('0xf'),_0xd6a665,'request\x20sent',JSON['stringify'](_0x50f03c));if(_0x50f03c['error']){if(_0x50f03c[_0xd9ed('0x10')][_0xd9ed('0x11')]===0x1f4){logger[_0xd9ed('0x10')](_0xd9ed('0xd'),_0xd6a665,_0x50f03c[_0xd9ed('0x10')]['message']);return _0x1cc26c(_0x50f03c[_0xd9ed('0x10')][_0xd9ed('0x12')]);}logger['error'](_0xd9ed('0xd'),_0xd6a665,_0x50f03c[_0xd9ed('0x10')]['message']);return _0x461404(_0x50f03c['error']['message']);}else{logger[_0xd9ed('0xc')](_0xd9ed('0xd'),_0xd6a665,_0xd9ed('0x13'));_0x461404(_0x50f03c[_0xd9ed('0x14')][_0xd9ed('0x12')]);}})['catch'](function(_0x3c9294){logger[_0xd9ed('0x10')](_0xd9ed('0xd'),_0xd6a665,_0x3c9294);_0x1cc26c(_0x3c9294);});});}exports[_0xd9ed('0x15')]=function(_0x2fd7bd){var _0x296f93=this;return new Promise(function(_0x1beb79,_0x3065e5){return db[_0xd9ed('0x16')][_0xd9ed('0x17')](_0x2fd7bd[_0xd9ed('0x18')],{'raw':_0x2fd7bd[_0xd9ed('0x19')]?_0x2fd7bd[_0xd9ed('0x19')][_0xd9ed('0x1a')]===undefined?!![]:![]:!![]})[_0xd9ed('0xb')](function(_0x2551f3){logger[_0xd9ed('0xc')](_0xd9ed('0x15'),_0x2fd7bd);logger[_0xd9ed('0xe')](_0xd9ed('0x15'),_0x2fd7bd,JSON[_0xd9ed('0x1b')](_0x2551f3));_0x1beb79(_0x2551f3);})['catch'](function(_0xb16dd8){logger[_0xd9ed('0x10')]('CreateWhatsappQueueReport',_0xb16dd8[_0xd9ed('0x12')],_0x2fd7bd);_0x3065e5(_0x296f93['error'](0x1f4,_0xb16dd8[_0xd9ed('0x12')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x46f432){var _0x1f590a=this;return new Promise(function(_0x2725db,_0x246b27){return db[_0xd9ed('0x16')][_0xd9ed('0x1c')](_0x46f432['body'],{'raw':_0x46f432[_0xd9ed('0x19')]?_0x46f432[_0xd9ed('0x19')][_0xd9ed('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46f432['options']?_0x46f432[_0xd9ed('0x19')][_0xd9ed('0x1d')]||null:null,'attributes':_0x46f432[_0xd9ed('0x19')]?_0x46f432[_0xd9ed('0x19')][_0xd9ed('0x1e')]||null:null,'limit':_0x46f432[_0xd9ed('0x19')]?_0x46f432['options'][_0xd9ed('0x1f')]||null:null})[_0xd9ed('0xb')](function(_0x5ccded){logger['info']('UpdateWhatsappQueueReport',_0x46f432);logger[_0xd9ed('0xe')](_0xd9ed('0x20'),_0x46f432,JSON[_0xd9ed('0x1b')](_0x5ccded));_0x2725db(_0x5ccded);})[_0xd9ed('0x21')](function(_0x2b7751){logger['error'](_0xd9ed('0x20'),_0x2b7751['message'],_0x46f432);_0x246b27(_0x1f590a[_0xd9ed('0x10')](0x1f4,_0x2b7751[_0xd9ed('0x12')]));});});}; \ No newline at end of file +var _0x23f2=['moment','randomstring','../../config/utils','rpc','../../config/environment','client','http','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','WhatsappQueueReport','create','options','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','raw','where','attributes','limit','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x23f2,0x1a2));var _0x223f=function(_0x570692,_0x1c648c){_0x570692=_0x570692-0x0;var _0x2e3043=_0x23f2[_0x570692];return _0x2e3043;};'use strict';var _=require(_0x223f('0x0'));var util=require(_0x223f('0x1'));var moment=require(_0x223f('0x2'));var BPromise=require('bluebird');var rs=require(_0x223f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x223f('0x4'));var logger=require('../../config/logger')(_0x223f('0x5'));var config=require(_0x223f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x223f('0x7')][_0x223f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b4083,_0x2141c5,_0x44df6e){return new BPromise(function(_0x26a85a,_0x309ffc){return client['request'](_0x4b4083,_0x44df6e)[_0x223f('0x9')](function(_0x28bea4){logger['info'](_0x223f('0xa'),_0x2141c5,_0x223f('0xb'));logger[_0x223f('0xc')](_0x223f('0xd'),_0x2141c5,_0x223f('0xb'),JSON[_0x223f('0xe')](_0x28bea4));if(_0x28bea4[_0x223f('0xf')]){if(_0x28bea4[_0x223f('0xf')]['code']===0x1f4){logger[_0x223f('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2141c5,_0x28bea4[_0x223f('0xf')][_0x223f('0x10')]);return _0x309ffc(_0x28bea4[_0x223f('0xf')]['message']);}logger[_0x223f('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2141c5,_0x28bea4[_0x223f('0xf')][_0x223f('0x10')]);return _0x26a85a(_0x28bea4[_0x223f('0xf')][_0x223f('0x10')]);}else{logger[_0x223f('0x11')](_0x223f('0xa'),_0x2141c5,_0x223f('0xb'));_0x26a85a(_0x28bea4[_0x223f('0x12')][_0x223f('0x10')]);}})[_0x223f('0x13')](function(_0x33d573){logger[_0x223f('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2141c5,_0x33d573);_0x309ffc(_0x33d573);});});}exports['CreateWhatsappQueueReport']=function(_0x57c361){var _0x2af659=this;return new Promise(function(_0x241bc3,_0x5e22e3){return db[_0x223f('0x14')][_0x223f('0x15')](_0x57c361['body'],{'raw':_0x57c361[_0x223f('0x16')]?_0x57c361['options']['raw']===undefined?!![]:![]:!![]})[_0x223f('0x9')](function(_0xb03ed0){logger[_0x223f('0x11')](_0x223f('0x17'),_0x57c361);logger[_0x223f('0xc')](_0x223f('0x17'),_0x57c361,JSON[_0x223f('0xe')](_0xb03ed0));_0x241bc3(_0xb03ed0);})[_0x223f('0x13')](function(_0x52f386){logger['error'](_0x223f('0x17'),_0x52f386[_0x223f('0x10')],_0x57c361);_0x5e22e3(_0x2af659['error'](0x1f4,_0x52f386[_0x223f('0x10')]));});});};exports[_0x223f('0x18')]=function(_0x436d94){var _0x11d308=this;return new Promise(function(_0x4ff138,_0x13119e){return db['WhatsappQueueReport'][_0x223f('0x19')](_0x436d94['body'],{'raw':_0x436d94['options']?_0x436d94[_0x223f('0x16')][_0x223f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x436d94['options']?_0x436d94[_0x223f('0x16')][_0x223f('0x1b')]||null:null,'attributes':_0x436d94[_0x223f('0x16')]?_0x436d94[_0x223f('0x16')][_0x223f('0x1c')]||null:null,'limit':_0x436d94[_0x223f('0x16')]?_0x436d94[_0x223f('0x16')][_0x223f('0x1d')]||null:null})[_0x223f('0x9')](function(_0x6bb6c7){logger[_0x223f('0x11')]('UpdateWhatsappQueueReport',_0x436d94);logger[_0x223f('0xc')]('UpdateWhatsappQueueReport',_0x436d94,JSON[_0x223f('0xe')](_0x6bb6c7));_0x4ff138(_0x6bb6c7);})[_0x223f('0x13')](function(_0x3cc5d0){logger[_0x223f('0xf')](_0x223f('0x18'),_0x3cc5d0[_0x223f('0x10')],_0x436d94);_0x13119e(_0x11d308[_0x223f('0xf')](0x1f4,_0x3cc5d0[_0x223f('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index c0a58c7..0efb99c 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 _0x32e3=['get','/describe','isAuthenticated','describe','/:id','show','post','create','update','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','index'];(function(_0x545f9e,_0x2525d5){var _0x3a708d=function(_0x3e2313){while(--_0x3e2313){_0x545f9e['push'](_0x545f9e['shift']());}};_0x3a708d(++_0x2525d5);}(_0x32e3,0xbe));var _0x332e=function(_0x5b7054,_0xaf2f4f){_0x5b7054=_0x5b7054-0x0;var _0x1a7528=_0x32e3[_0x5b7054];return _0x1a7528;};'use strict';var multer=require(_0x332e('0x0'));var util=require(_0x332e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x332e('0x2')]();var fs_extra=require(_0x332e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x332e('0x4'));var config=require(_0x332e('0x5'));var controller=require(_0x332e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x332e('0x7')]);router[_0x332e('0x8')](_0x332e('0x9'),auth[_0x332e('0xa')](),controller[_0x332e('0xb')]);router[_0x332e('0x8')](_0x332e('0xc'),auth[_0x332e('0xa')](),controller[_0x332e('0xd')]);router[_0x332e('0xe')]('/',auth[_0x332e('0xa')](),controller[_0x332e('0xf')]);router['put'](_0x332e('0xc'),auth[_0x332e('0xa')](),controller[_0x332e('0x10')]);router['delete'](_0x332e('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x332e('0x11')]=router; \ No newline at end of file +var _0x94d9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','get','/:id','show','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x8ceea6,_0x23ea95){var _0x5dd6d5=function(_0x3d2624){while(--_0x3d2624){_0x8ceea6['push'](_0x8ceea6['shift']());}};_0x5dd6d5(++_0x23ea95);}(_0x94d9,0x1e0));var _0x994d=function(_0x4e3cc2,_0x5132a4){_0x4e3cc2=_0x4e3cc2-0x0;var _0x3bbce7=_0x94d9[_0x4e3cc2];return _0x3bbce7;};'use strict';var multer=require('multer');var util=require(_0x994d('0x0'));var path=require(_0x994d('0x1'));var timeout=require(_0x994d('0x2'));var express=require(_0x994d('0x3'));var router=express[_0x994d('0x4')]();var fs_extra=require(_0x994d('0x5'));var auth=require(_0x994d('0x6'));var interaction=require(_0x994d('0x7'));var config=require(_0x994d('0x8'));var controller=require(_0x994d('0x9'));router['get']('/',auth[_0x994d('0xa')](),controller['index']);router[_0x994d('0xb')]('/describe',auth[_0x994d('0xa')](),controller['describe']);router[_0x994d('0xb')](_0x994d('0xc'),auth[_0x994d('0xa')](),controller[_0x994d('0xd')]);router['post']('/',auth[_0x994d('0xa')](),controller['create']);router[_0x994d('0xe')]('/:id',auth[_0x994d('0xa')](),controller[_0x994d('0xf')]);router[_0x994d('0x10')]('/:id',auth[_0x994d('0xa')](),controller[_0x994d('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 7930cff..b11f006 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 _0x887b=['ENUM','account','agent','queue','DATE','sequelize','exports','STRING'];(function(_0x29ce14,_0x334166){var _0x48f289=function(_0x288d11){while(--_0x288d11){_0x29ce14['push'](_0x29ce14['shift']());}};_0x48f289(++_0x334166);}(_0x887b,0x185));var _0xb887=function(_0x3d77d0,_0x31645f){_0x3d77d0=_0x3d77d0-0x0;var _0x481d25=_0x887b[_0x3d77d0];return _0x481d25;};'use strict';var Sequelize=require(_0xb887('0x0'));module[_0xb887('0x1')]={'uniqueid':{'type':Sequelize[_0xb887('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb887('0x3')](_0xb887('0x4'),_0xb887('0x5'),_0xb887('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xb887('0x7')]}}; \ No newline at end of file +var _0x5ed9=['account','agent','queue','sequelize','exports','ENUM'];(function(_0xed9bbc,_0x7decd6){var _0x4bcaeb=function(_0x3abe68){while(--_0x3abe68){_0xed9bbc['push'](_0xed9bbc['shift']());}};_0x4bcaeb(++_0x7decd6);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5ed9[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x95ed('0x0'));module[_0x95ed('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x95ed('0x2')](_0x95ed('0x3'),_0x95ed('0x4'),_0x95ed('0x5')),'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 9b105f2..1cc41c3 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 _0xa533=['fields','attributes','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','length','create','body','update','find','describe','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','destroy','then','error','name','send','WhatsappTransferReport','rawAttributes','fieldName','type','key','map','keys','query','model','intersection'];(function(_0x2b5680,_0x28ba0a){var _0x5930cd=function(_0x1a95a5){while(--_0x1a95a5){_0x2b5680['push'](_0x2b5680['shift']());}};_0x5930cd(++_0x28ba0a);}(_0xa533,0x13e));var _0x3a53=function(_0xf276ef,_0x1ba14a){_0xf276ef=_0xf276ef-0x0;var _0x32026b=_0xa533[_0xf276ef];return _0x32026b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3a53('0x0'));var jsonpatch=require(_0x3a53('0x1'));var rp=require(_0x3a53('0x2'));var moment=require('moment');var BPromise=require(_0x3a53('0x3'));var Mustache=require(_0x3a53('0x4'));var util=require(_0x3a53('0x5'));var path=require(_0x3a53('0x6'));var sox=require(_0x3a53('0x7'));var csv=require(_0x3a53('0x8'));var ejs=require(_0x3a53('0x9'));var fs=require('fs');var fs_extra=require(_0x3a53('0xa'));var _=require(_0x3a53('0xb'));var squel=require(_0x3a53('0xc'));var crypto=require(_0x3a53('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3a53('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3a53('0xf'));var Redis=require(_0x3a53('0x10'));var authService=require(_0x3a53('0x11'));var qs=require(_0x3a53('0x12'));var as=require(_0x3a53('0x13'));var hardwareService=require(_0x3a53('0x14'));var logger=require(_0x3a53('0x15'))(_0x3a53('0x16'));var utils=require(_0x3a53('0x17'));var config=require(_0x3a53('0x18'));var licenseUtil=require(_0x3a53('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46721b,_0x575a1b){_0x575a1b=_0x575a1b||0xcc;return function(_0x13f863){if(_0x13f863){return _0x46721b[_0x3a53('0x1a')](_0x575a1b);}return _0x46721b[_0x3a53('0x1b')](_0x575a1b)[_0x3a53('0x1c')]();};}function respondWithResult(_0x3415f4,_0x5d0ba2){_0x5d0ba2=_0x5d0ba2||0xc8;return function(_0x9e4c1e){if(_0x9e4c1e){return _0x3415f4[_0x3a53('0x1b')](_0x5d0ba2)[_0x3a53('0x1d')](_0x9e4c1e);}};}function respondWithFilteredResult(_0x194930,_0x3d3486){return function(_0x52e0ab){if(_0x52e0ab){var _0xff58e1=typeof _0x3d3486[_0x3a53('0x1e')]===_0x3a53('0x1f')&&typeof _0x3d3486['limit']===_0x3a53('0x1f');var _0x5f4725=_0x52e0ab[_0x3a53('0x20')];var _0x24e356=_0xff58e1?0x0:_0x3d3486[_0x3a53('0x1e')];var _0x3acef8=_0xff58e1?_0x52e0ab[_0x3a53('0x20')]:_0x3d3486[_0x3a53('0x1e')]+_0x3d3486[_0x3a53('0x21')];var _0x5a4222;if(_0x3acef8>=_0x5f4725){_0x3acef8=_0x5f4725;_0x5a4222=0xc8;}else{_0x5a4222=0xce;}_0x194930[_0x3a53('0x1b')](_0x5a4222);return _0x194930[_0x3a53('0x22')]('Content-Range',_0x24e356+'-'+_0x3acef8+'/'+_0x5f4725)[_0x3a53('0x1d')](_0x52e0ab);}return null;};}function patchUpdates(_0x17d063){return function(_0x29fcb4){try{jsonpatch['apply'](_0x29fcb4,_0x17d063,!![]);}catch(_0x35acb0){return BPromise[_0x3a53('0x23')](_0x35acb0);}return _0x29fcb4[_0x3a53('0x24')]();};}function saveUpdates(_0x477e1e,_0x5dcf5f){return function(_0x3337ac){if(_0x3337ac){return _0x3337ac['update'](_0x477e1e)['then'](function(_0x5c44c6){return _0x5c44c6;});}return null;};}function removeEntity(_0x5e0be2,_0x40faec){return function(_0x2d2b45){if(_0x2d2b45){return _0x2d2b45[_0x3a53('0x25')]()[_0x3a53('0x26')](function(){_0x5e0be2[_0x3a53('0x1b')](0xcc)[_0x3a53('0x1c')]();});}};}function handleEntityNotFound(_0x521f22,_0x3bb405){return function(_0x12fe20){if(!_0x12fe20){_0x521f22['sendStatus'](0x194);}return _0x12fe20;};}function handleError(_0x5c037e,_0x3c8a45){_0x3c8a45=_0x3c8a45||0x1f4;return function(_0x5979cd){logger[_0x3a53('0x27')](_0x5979cd['stack']);if(_0x5979cd[_0x3a53('0x28')]){delete _0x5979cd[_0x3a53('0x28')];}_0x5c037e[_0x3a53('0x1b')](_0x3c8a45)[_0x3a53('0x29')](_0x5979cd);};}exports['index']=function(_0x167b35,_0x467892){var _0x236947={},_0xf87b73={},_0x5b7631={'count':0x0,'rows':[]};var _0x164626=_['map'](db[_0x3a53('0x2a')][_0x3a53('0x2b')],function(_0x5eccdb){return{'name':_0x5eccdb[_0x3a53('0x2c')],'type':_0x5eccdb[_0x3a53('0x2d')][_0x3a53('0x2e')]};});_0xf87b73['model']=_[_0x3a53('0x2f')](_0x164626,'name');_0xf87b73['query']=_[_0x3a53('0x30')](_0x167b35[_0x3a53('0x31')]);_0xf87b73['filters']=_['intersection'](_0xf87b73[_0x3a53('0x32')],_0xf87b73[_0x3a53('0x31')]);_0x236947['attributes']=_[_0x3a53('0x33')](_0xf87b73[_0x3a53('0x32')],qs[_0x3a53('0x34')](_0x167b35[_0x3a53('0x31')][_0x3a53('0x34')]));_0x236947[_0x3a53('0x35')]=_0x236947[_0x3a53('0x35')]['length']?_0x236947[_0x3a53('0x35')]:_0xf87b73['model'];if(!_0x167b35[_0x3a53('0x31')]['hasOwnProperty'](_0x3a53('0x36'))){_0x236947[_0x3a53('0x21')]=qs['limit'](_0x167b35[_0x3a53('0x31')]['limit']);_0x236947[_0x3a53('0x1e')]=qs['offset'](_0x167b35[_0x3a53('0x31')][_0x3a53('0x1e')]);}_0x236947['order']=qs[_0x3a53('0x37')](_0x167b35['query'][_0x3a53('0x37')]);_0x236947[_0x3a53('0x38')]=qs[_0x3a53('0x39')](_[_0x3a53('0x3a')](_0x167b35[_0x3a53('0x31')],_0xf87b73[_0x3a53('0x39')]),_0x164626);if(_0x167b35['query'][_0x3a53('0x3b')]){_0x236947['where']=_[_0x3a53('0x3c')](_0x236947['where'],{'$or':_['map'](_0x164626,function(_0x4066ec){if(_0x4066ec[_0x3a53('0x2d')]!==_0x3a53('0x3d')){var _0x56af02={};_0x56af02[_0x4066ec[_0x3a53('0x28')]]={'$like':'%'+_0x167b35[_0x3a53('0x31')][_0x3a53('0x3b')]+'%'};return _0x56af02;}})});}_0x236947=_[_0x3a53('0x3c')]({},_0x236947,_0x167b35[_0x3a53('0x3e')]);var _0xcacacb={'where':_0x236947[_0x3a53('0x38')]};return db[_0x3a53('0x2a')]['count'](_0xcacacb)['then'](function(_0x1b9130){_0x5b7631['count']=_0x1b9130;if(_0x167b35[_0x3a53('0x31')]['includeAll']){_0x236947[_0x3a53('0x3f')]=[{'all':!![]}];}return db[_0x3a53('0x2a')]['findAll'](_0x236947);})[_0x3a53('0x26')](function(_0x5015e5){_0x5b7631[_0x3a53('0x40')]=_0x5015e5;return _0x5b7631;})['then'](respondWithFilteredResult(_0x467892,_0x236947))[_0x3a53('0x41')](handleError(_0x467892,null));};exports[_0x3a53('0x42')]=function(_0x390883,_0x63b125){var _0x573d7b={'raw':!![],'where':{'id':_0x390883[_0x3a53('0x43')]['id']}},_0x59ec05={};_0x59ec05[_0x3a53('0x32')]=_[_0x3a53('0x30')](db[_0x3a53('0x2a')][_0x3a53('0x2b')]);_0x59ec05['query']=_[_0x3a53('0x30')](_0x390883[_0x3a53('0x31')]);_0x59ec05['filters']=_[_0x3a53('0x33')](_0x59ec05[_0x3a53('0x32')],_0x59ec05[_0x3a53('0x31')]);_0x573d7b['attributes']=_[_0x3a53('0x33')](_0x59ec05[_0x3a53('0x32')],qs['fields'](_0x390883[_0x3a53('0x31')][_0x3a53('0x34')]));_0x573d7b[_0x3a53('0x35')]=_0x573d7b[_0x3a53('0x35')][_0x3a53('0x44')]?_0x573d7b[_0x3a53('0x35')]:_0x59ec05['model'];if(_0x390883['query']['includeAll']){_0x573d7b[_0x3a53('0x3f')]=[{'all':!![]}];}_0x573d7b=_[_0x3a53('0x3c')]({},_0x573d7b,_0x390883[_0x3a53('0x3e')]);return db[_0x3a53('0x2a')]['find'](_0x573d7b)[_0x3a53('0x26')](handleEntityNotFound(_0x63b125,null))[_0x3a53('0x26')](respondWithResult(_0x63b125,null))[_0x3a53('0x41')](handleError(_0x63b125,null));};exports[_0x3a53('0x45')]=function(_0x22f72e,_0x5f56ab){return db[_0x3a53('0x2a')][_0x3a53('0x45')](_0x22f72e[_0x3a53('0x46')],{})[_0x3a53('0x26')](respondWithResult(_0x5f56ab,0xc9))[_0x3a53('0x41')](handleError(_0x5f56ab,null));};exports[_0x3a53('0x47')]=function(_0x1f524e,_0x3be523){if(_0x1f524e[_0x3a53('0x46')]['id']){delete _0x1f524e['body']['id'];}return db[_0x3a53('0x2a')][_0x3a53('0x48')]({'where':{'id':_0x1f524e[_0x3a53('0x43')]['id']}})[_0x3a53('0x26')](handleEntityNotFound(_0x3be523,null))['then'](saveUpdates(_0x1f524e[_0x3a53('0x46')],null))[_0x3a53('0x26')](respondWithResult(_0x3be523,null))[_0x3a53('0x41')](handleError(_0x3be523,null));};exports[_0x3a53('0x25')]=function(_0x71c43e,_0x683d8e){return db[_0x3a53('0x2a')][_0x3a53('0x48')]({'where':{'id':_0x71c43e[_0x3a53('0x43')]['id']}})[_0x3a53('0x26')](handleEntityNotFound(_0x683d8e,null))[_0x3a53('0x26')](removeEntity(_0x683d8e,null))['catch'](handleError(_0x683d8e,null));};exports[_0x3a53('0x49')]=function(_0xd1208b,_0xb01cca){return db[_0x3a53('0x2a')]['describe']()['then'](respondWithResult(_0xb01cca,null))[_0x3a53('0x41')](handleError(_0xb01cca,null));}; \ No newline at end of file +var _0xd3ee=['query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','rawAttributes','intersection','includeAll','options','create','body','update','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','stack','name','map','WhatsappTransferReport','type','key','model'];(function(_0x3d8d1b,_0x482d36){var _0x20aaee=function(_0x156547){while(--_0x156547){_0x3d8d1b['push'](_0x3d8d1b['shift']());}};_0x20aaee(++_0x482d36);}(_0xd3ee,0x190));var _0xed3e=function(_0x1a37e3,_0x5db8f6){_0x1a37e3=_0x1a37e3-0x0;var _0x4db78a=_0xd3ee[_0x1a37e3];return _0x4db78a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed3e('0x0'));var zipdir=require(_0xed3e('0x1'));var jsonpatch=require(_0xed3e('0x2'));var rp=require(_0xed3e('0x3'));var moment=require(_0xed3e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xed3e('0x5'));var path=require(_0xed3e('0x6'));var sox=require(_0xed3e('0x7'));var csv=require(_0xed3e('0x8'));var ejs=require(_0xed3e('0x9'));var fs=require('fs');var fs_extra=require(_0xed3e('0xa'));var _=require(_0xed3e('0xb'));var squel=require(_0xed3e('0xc'));var crypto=require(_0xed3e('0xd'));var jsforce=require(_0xed3e('0xe'));var deskjs=require(_0xed3e('0xf'));var toCsv=require(_0xed3e('0x8'));var querystring=require(_0xed3e('0x10'));var Papa=require(_0xed3e('0x11'));var Redis=require('ioredis');var authService=require(_0xed3e('0x12'));var qs=require(_0xed3e('0x13'));var as=require(_0xed3e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xed3e('0x15'));var utils=require('../../config/utils');var config=require(_0xed3e('0x16'));var licenseUtil=require(_0xed3e('0x17'));var db=require(_0xed3e('0x18'))['db'];function respondWithStatusCode(_0x1132cb,_0x2df230){_0x2df230=_0x2df230||0xcc;return function(_0x38d38e){if(_0x38d38e){return _0x1132cb[_0xed3e('0x19')](_0x2df230);}return _0x1132cb[_0xed3e('0x1a')](_0x2df230)[_0xed3e('0x1b')]();};}function respondWithResult(_0x367723,_0x33e826){_0x33e826=_0x33e826||0xc8;return function(_0x338902){if(_0x338902){return _0x367723[_0xed3e('0x1a')](_0x33e826)[_0xed3e('0x1c')](_0x338902);}};}function respondWithFilteredResult(_0x2d4f23,_0xff6e2e){return function(_0x1135ee){if(_0x1135ee){var _0x1c3db1=typeof _0xff6e2e[_0xed3e('0x1d')]===_0xed3e('0x1e')&&typeof _0xff6e2e[_0xed3e('0x1f')]===_0xed3e('0x1e');var _0x11abbf=_0x1135ee[_0xed3e('0x20')];var _0x38ad91=_0x1c3db1?0x0:_0xff6e2e['offset'];var _0xe9834f=_0x1c3db1?_0x1135ee[_0xed3e('0x20')]:_0xff6e2e[_0xed3e('0x1d')]+_0xff6e2e[_0xed3e('0x1f')];var _0x52660a;if(_0xe9834f>=_0x11abbf){_0xe9834f=_0x11abbf;_0x52660a=0xc8;}else{_0x52660a=0xce;}_0x2d4f23[_0xed3e('0x1a')](_0x52660a);return _0x2d4f23[_0xed3e('0x21')](_0xed3e('0x22'),_0x38ad91+'-'+_0xe9834f+'/'+_0x11abbf)[_0xed3e('0x1c')](_0x1135ee);}return null;};}function patchUpdates(_0x111702){return function(_0x4f885c){try{jsonpatch['apply'](_0x4f885c,_0x111702,!![]);}catch(_0x19d377){return BPromise['reject'](_0x19d377);}return _0x4f885c[_0xed3e('0x23')]();};}function saveUpdates(_0x5e4722,_0x4d4794){return function(_0x3724c2){if(_0x3724c2){return _0x3724c2['update'](_0x5e4722)[_0xed3e('0x24')](function(_0x223251){return _0x223251;});}return null;};}function removeEntity(_0x667f6f,_0x525085){return function(_0x4056de){if(_0x4056de){return _0x4056de['destroy']()[_0xed3e('0x24')](function(){_0x667f6f[_0xed3e('0x1a')](0xcc)[_0xed3e('0x1b')]();});}};}function handleEntityNotFound(_0x31fc7f,_0x26333f){return function(_0x410b04){if(!_0x410b04){_0x31fc7f['sendStatus'](0x194);}return _0x410b04;};}function handleError(_0x432b92,_0x5ac676){_0x5ac676=_0x5ac676||0x1f4;return function(_0x11b607){logger['error'](_0x11b607[_0xed3e('0x25')]);if(_0x11b607['name']){delete _0x11b607[_0xed3e('0x26')];}_0x432b92[_0xed3e('0x1a')](_0x5ac676)['send'](_0x11b607);};}exports['index']=function(_0x1cdd33,_0x2a6f15){var _0x19c55b={},_0x2be05d={},_0x14feb2={'count':0x0,'rows':[]};var _0xf768b2=_[_0xed3e('0x27')](db[_0xed3e('0x28')]['rawAttributes'],function(_0x56ed90){return{'name':_0x56ed90['fieldName'],'type':_0x56ed90[_0xed3e('0x29')][_0xed3e('0x2a')]};});_0x2be05d[_0xed3e('0x2b')]=_[_0xed3e('0x27')](_0xf768b2,'name');_0x2be05d[_0xed3e('0x2c')]=_[_0xed3e('0x2d')](_0x1cdd33[_0xed3e('0x2c')]);_0x2be05d[_0xed3e('0x2e')]=_['intersection'](_0x2be05d[_0xed3e('0x2b')],_0x2be05d[_0xed3e('0x2c')]);_0x19c55b[_0xed3e('0x2f')]=_['intersection'](_0x2be05d['model'],qs[_0xed3e('0x30')](_0x1cdd33['query'][_0xed3e('0x30')]));_0x19c55b['attributes']=_0x19c55b[_0xed3e('0x2f')][_0xed3e('0x31')]?_0x19c55b[_0xed3e('0x2f')]:_0x2be05d['model'];if(!_0x1cdd33[_0xed3e('0x2c')][_0xed3e('0x32')](_0xed3e('0x33'))){_0x19c55b[_0xed3e('0x1f')]=qs['limit'](_0x1cdd33[_0xed3e('0x2c')]['limit']);_0x19c55b['offset']=qs['offset'](_0x1cdd33[_0xed3e('0x2c')][_0xed3e('0x1d')]);}_0x19c55b[_0xed3e('0x34')]=qs[_0xed3e('0x35')](_0x1cdd33[_0xed3e('0x2c')][_0xed3e('0x35')]);_0x19c55b[_0xed3e('0x36')]=qs[_0xed3e('0x2e')](_[_0xed3e('0x37')](_0x1cdd33[_0xed3e('0x2c')],_0x2be05d[_0xed3e('0x2e')]),_0xf768b2);if(_0x1cdd33['query'][_0xed3e('0x38')]){_0x19c55b[_0xed3e('0x36')]=_[_0xed3e('0x39')](_0x19c55b['where'],{'$or':_['map'](_0xf768b2,function(_0x5053dc){if(_0x5053dc[_0xed3e('0x29')]!==_0xed3e('0x3a')){var _0x4c58a0={};_0x4c58a0[_0x5053dc['name']]={'$like':'%'+_0x1cdd33[_0xed3e('0x2c')][_0xed3e('0x38')]+'%'};return _0x4c58a0;}})});}_0x19c55b=_[_0xed3e('0x39')]({},_0x19c55b,_0x1cdd33['options']);var _0x49c2de={'where':_0x19c55b['where']};return db['WhatsappTransferReport'][_0xed3e('0x20')](_0x49c2de)[_0xed3e('0x24')](function(_0x63974f){_0x14feb2[_0xed3e('0x20')]=_0x63974f;if(_0x1cdd33[_0xed3e('0x2c')]['includeAll']){_0x19c55b[_0xed3e('0x3b')]=[{'all':!![]}];}return db[_0xed3e('0x28')][_0xed3e('0x3c')](_0x19c55b);})['then'](function(_0x40c6e5){_0x14feb2['rows']=_0x40c6e5;return _0x14feb2;})['then'](respondWithFilteredResult(_0x2a6f15,_0x19c55b))[_0xed3e('0x3d')](handleError(_0x2a6f15,null));};exports[_0xed3e('0x3e')]=function(_0x498947,_0x5e1784){var _0x3d8d4e={'raw':!![],'where':{'id':_0x498947[_0xed3e('0x3f')]['id']}},_0x4a7646={};_0x4a7646[_0xed3e('0x2b')]=_[_0xed3e('0x2d')](db[_0xed3e('0x28')][_0xed3e('0x40')]);_0x4a7646[_0xed3e('0x2c')]=_['keys'](_0x498947[_0xed3e('0x2c')]);_0x4a7646[_0xed3e('0x2e')]=_['intersection'](_0x4a7646[_0xed3e('0x2b')],_0x4a7646[_0xed3e('0x2c')]);_0x3d8d4e[_0xed3e('0x2f')]=_[_0xed3e('0x41')](_0x4a7646[_0xed3e('0x2b')],qs[_0xed3e('0x30')](_0x498947[_0xed3e('0x2c')]['fields']));_0x3d8d4e[_0xed3e('0x2f')]=_0x3d8d4e[_0xed3e('0x2f')][_0xed3e('0x31')]?_0x3d8d4e['attributes']:_0x4a7646[_0xed3e('0x2b')];if(_0x498947[_0xed3e('0x2c')][_0xed3e('0x42')]){_0x3d8d4e['include']=[{'all':!![]}];}_0x3d8d4e=_['merge']({},_0x3d8d4e,_0x498947[_0xed3e('0x43')]);return db['WhatsappTransferReport']['find'](_0x3d8d4e)[_0xed3e('0x24')](handleEntityNotFound(_0x5e1784,null))[_0xed3e('0x24')](respondWithResult(_0x5e1784,null))[_0xed3e('0x3d')](handleError(_0x5e1784,null));};exports[_0xed3e('0x44')]=function(_0x516451,_0x4149b7){return db[_0xed3e('0x28')]['create'](_0x516451[_0xed3e('0x45')],{})[_0xed3e('0x24')](respondWithResult(_0x4149b7,0xc9))['catch'](handleError(_0x4149b7,null));};exports[_0xed3e('0x46')]=function(_0x4c9d57,_0x4b5ad7){if(_0x4c9d57['body']['id']){delete _0x4c9d57[_0xed3e('0x45')]['id'];}return db[_0xed3e('0x28')][_0xed3e('0x47')]({'where':{'id':_0x4c9d57[_0xed3e('0x3f')]['id']}})[_0xed3e('0x24')](handleEntityNotFound(_0x4b5ad7,null))[_0xed3e('0x24')](saveUpdates(_0x4c9d57[_0xed3e('0x45')],null))[_0xed3e('0x24')](respondWithResult(_0x4b5ad7,null))['catch'](handleError(_0x4b5ad7,null));};exports[_0xed3e('0x48')]=function(_0x4cbcda,_0x4d97f0){return db[_0xed3e('0x28')]['find']({'where':{'id':_0x4cbcda[_0xed3e('0x3f')]['id']}})[_0xed3e('0x24')](handleEntityNotFound(_0x4d97f0,null))[_0xed3e('0x24')](removeEntity(_0x4d97f0,null))[_0xed3e('0x3d')](handleError(_0x4d97f0,null));};exports[_0xed3e('0x49')]=function(_0x24ea3f,_0x14a60c){return db[_0xed3e('0x28')]['describe']()[_0xed3e('0x24')](respondWithResult(_0x14a60c,null))[_0xed3e('0x3d')](handleError(_0x14a60c,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index c3c6bbc..bb72977 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 _0x318e=['uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport'];(function(_0x2a59d1,_0x5db775){var _0xa5633f=function(_0x140f2e){while(--_0x140f2e){_0x2a59d1['push'](_0x2a59d1['shift']());}};_0xa5633f(++_0x5db775);}(_0x318e,0x199));var _0xe318=function(_0x353a7e,_0x4243a8){_0x353a7e=_0x353a7e-0x0;var _0x28d4ca=_0x318e[_0x353a7e];return _0x28d4ca;};'use strict';var _=require(_0xe318('0x0'));var util=require(_0xe318('0x1'));var logger=require(_0xe318('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe318('0x3'));var rp=require(_0xe318('0x4'));var fs=require('fs');var path=require(_0xe318('0x5'));var rimraf=require(_0xe318('0x6'));var config=require('../../config/environment');var attributes=require(_0xe318('0x7'));module[_0xe318('0x8')]=function(_0x54c952,_0xb26564){return _0x54c952[_0xe318('0x9')](_0xe318('0xa'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xe318('0xb'),'fields':[_0xe318('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8cb9=['./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','api','moment','bluebird','path','../../config/environment'];(function(_0x1872a2,_0x2a87d8){var _0x45ce68=function(_0x548af4){while(--_0x548af4){_0x1872a2['push'](_0x1872a2['shift']());}};_0x45ce68(++_0x2a87d8);}(_0x8cb9,0xad));var _0x98cb=function(_0x54a188,_0x180f4a){_0x54a188=_0x54a188-0x0;var _0x1081c3=_0x8cb9[_0x54a188];return _0x1081c3;};'use strict';var _=require(_0x98cb('0x0'));var util=require(_0x98cb('0x1'));var logger=require('../../config/logger')(_0x98cb('0x2'));var moment=require(_0x98cb('0x3'));var BPromise=require(_0x98cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98cb('0x5'));var rimraf=require('rimraf');var config=require(_0x98cb('0x6'));var attributes=require(_0x98cb('0x7'));module[_0x98cb('0x8')]=function(_0x40dabf,_0x4f46a3){return _0x40dabf['define'](_0x98cb('0x9'),attributes,{'tableName':_0x98cb('0xa'),'paranoid':![],'indexes':[{'name':_0x98cb('0xb'),'fields':[_0x98cb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 4c32ebe..3efabaf 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 _0x85f9=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0x85f9,0x9c));var _0x985f=function(_0x22a6b3,_0x19d7ec){_0x22a6b3=_0x22a6b3-0x0;var _0xba0b16=_0x85f9[_0x22a6b3];return _0xba0b16;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x985f('0x0'));var BPromise=require(_0x985f('0x1'));var rs=require(_0x985f('0x2'));var fs=require('fs');var Redis=require(_0x985f('0x3'));var db=require(_0x985f('0x4'))['db'];var utils=require(_0x985f('0x5'));var logger=require(_0x985f('0x6'))('rpc');var config=require(_0x985f('0x7'));var jayson=require(_0x985f('0x8'));var client=jayson['client'][_0x985f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55e281,_0x236565,_0x497198){return new BPromise(function(_0x5abd6e,_0x1da67f){return client[_0x985f('0xa')](_0x55e281,_0x497198)[_0x985f('0xb')](function(_0x2eb717){logger['info'](_0x985f('0xc'),_0x236565,'request\x20sent');logger[_0x985f('0xd')](_0x985f('0xe'),_0x236565,'request\x20sent',JSON[_0x985f('0xf')](_0x2eb717));if(_0x2eb717[_0x985f('0x10')]){if(_0x2eb717[_0x985f('0x10')][_0x985f('0x11')]===0x1f4){logger[_0x985f('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x236565,_0x2eb717[_0x985f('0x10')]['message']);return _0x1da67f(_0x2eb717[_0x985f('0x10')][_0x985f('0x12')]);}logger[_0x985f('0x10')](_0x985f('0xc'),_0x236565,_0x2eb717[_0x985f('0x10')][_0x985f('0x12')]);return _0x5abd6e(_0x2eb717[_0x985f('0x10')][_0x985f('0x12')]);}else{logger[_0x985f('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x236565,_0x985f('0x14'));_0x5abd6e(_0x2eb717[_0x985f('0x15')][_0x985f('0x12')]);}})[_0x985f('0x16')](function(_0x1f51bd){logger['error'](_0x985f('0xc'),_0x236565,_0x1f51bd);_0x1da67f(_0x1f51bd);});});} \ No newline at end of file +var _0x0e74=['catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0x0e74,0xdd));var _0x40e7=function(_0x271aec,_0xfc4790){_0x271aec=_0x271aec-0x0;var _0x250491=_0x0e74[_0x271aec];return _0x250491;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x40e7('0x0'));var BPromise=require(_0x40e7('0x1'));var rs=require(_0x40e7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x40e7('0x3'));var logger=require(_0x40e7('0x4'))(_0x40e7('0x5'));var config=require(_0x40e7('0x6'));var jayson=require(_0x40e7('0x7'));var client=jayson['client'][_0x40e7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c38c,_0x28a758,_0x18324d){return new BPromise(function(_0x1b4368,_0x14ef2c){return client[_0x40e7('0x9')](_0x4c38c,_0x18324d)[_0x40e7('0xa')](function(_0xb2ba6d){logger[_0x40e7('0xb')](_0x40e7('0xc'),_0x28a758,_0x40e7('0xd'));logger[_0x40e7('0xe')](_0x40e7('0xf'),_0x28a758,'request\x20sent',JSON[_0x40e7('0x10')](_0xb2ba6d));if(_0xb2ba6d[_0x40e7('0x11')]){if(_0xb2ba6d['error'][_0x40e7('0x12')]===0x1f4){logger[_0x40e7('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x28a758,_0xb2ba6d['error']['message']);return _0x14ef2c(_0xb2ba6d[_0x40e7('0x11')][_0x40e7('0x13')]);}logger[_0x40e7('0x11')](_0x40e7('0xc'),_0x28a758,_0xb2ba6d[_0x40e7('0x11')][_0x40e7('0x13')]);return _0x1b4368(_0xb2ba6d[_0x40e7('0x11')][_0x40e7('0x13')]);}else{logger[_0x40e7('0xb')](_0x40e7('0xc'),_0x28a758,_0x40e7('0xd'));_0x1b4368(_0xb2ba6d[_0x40e7('0x14')][_0x40e7('0x13')]);}})[_0x40e7('0x15')](function(_0x420c30){logger['error'](_0x40e7('0xc'),_0x28a758,_0x420c30);_0x14ef2c(_0x420c30);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 3b6b3ff..cfda493 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfba4=['start','info','map','filter','online','name','join','Offline\x20apps:','None','seedDB','./config/seedDB','default','./config/license','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','listen','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfba4,0x6a));var _0x4fba=function(_0x533528,_0x409d05){_0x533528=_0x533528-0x0;var _0x3189f1=_0xfba4[_0x533528];return _0x3189f1;};'use strict';var _=require(_0x4fba('0x0'));var mysqldb=require(_0x4fba('0x1'));var rpc=require(_0x4fba('0x2'));var config=require(_0x4fba('0x3'));var logger=require('./config/logger')(_0x4fba('0x4'));var pm2=require(_0x4fba('0x5'));var pm2Config=require(_0x4fba('0x6'));var schedule=require(_0x4fba('0x7'));var chat=require(_0x4fba('0x8'));var whatsapp=require(_0x4fba('0x9'));var transcribe=require(_0x4fba('0xa'));function main(){return mysqldb['db']['sequelize'][_0x4fba('0xb')]()['then'](function(){return rpc[_0x4fba('0xc')]();})[_0x4fba('0xd')](function(_0x572894){logger['info'](_0x572894);return chat[_0x4fba('0xe')]();})[_0x4fba('0xd')](function(){return whatsapp['start']();})[_0x4fba('0xd')](function(){return schedule[_0x4fba('0xe')]();})[_0x4fba('0xd')](function(){return transcribe['start']();})[_0x4fba('0xd')](function(_0x20097b){logger[_0x4fba('0xf')](_0x20097b);return pm2['start'](pm2Config);})[_0x4fba('0xd')](function(_0x2e44cc){logger['info']('Online\x20apps:',_[_0x4fba('0x10')](_[_0x4fba('0x11')](_0x2e44cc,{'status':_0x4fba('0x12')}),_0x4fba('0x13'))[_0x4fba('0x14')]());logger[_0x4fba('0xf')](_0x4fba('0x15'),_['map'](_[_0x4fba('0x11')](_0x2e44cc,function(_0x9c391d){return _0x9c391d['status']!=='online';}),_0x4fba('0x13'))[_0x4fba('0x14')]()||_0x4fba('0x16'));config[_0x4fba('0x17')]&&require(_0x4fba('0x18'))[_0x4fba('0x19')]();require(_0x4fba('0x1a'))[_0x4fba('0x19')]();})['catch'](function(_0x16d350){logger[_0x4fba('0x1b')](_0x4fba('0x1c'),_0x16d350);process[_0x4fba('0x1d')](0x1);});}main(); \ No newline at end of file +var _0x9384=['filter','online','name','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','then','listen','info','start','Online\x20apps:','map'];(function(_0x39892a,_0x8dfe2f){var _0x3f0685=function(_0x36e5e4){while(--_0x36e5e4){_0x39892a['push'](_0x39892a['shift']());}};_0x3f0685(++_0x8dfe2f);}(_0x9384,0x1b2));var _0x4938=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x9384[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0x4938('0x0'));var mysqldb=require(_0x4938('0x1'));var rpc=require(_0x4938('0x2'));var config=require('./config/environment');var logger=require(_0x4938('0x3'))('app');var pm2=require(_0x4938('0x4'));var pm2Config=require(_0x4938('0x5'));var schedule=require(_0x4938('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x4938('0x7'));var transcribe=require(_0x4938('0x8'));function main(){return mysqldb['db'][_0x4938('0x9')]['sync']()[_0x4938('0xa')](function(){return rpc[_0x4938('0xb')]();})[_0x4938('0xa')](function(_0x28734c){logger[_0x4938('0xc')](_0x28734c);return chat['start']();})[_0x4938('0xa')](function(){return whatsapp[_0x4938('0xd')]();})[_0x4938('0xa')](function(){return schedule[_0x4938('0xd')]();})[_0x4938('0xa')](function(){return transcribe[_0x4938('0xd')]();})[_0x4938('0xa')](function(_0x4df0a1){logger[_0x4938('0xc')](_0x4df0a1);return pm2[_0x4938('0xd')](pm2Config);})['then'](function(_0x36028d){logger['info'](_0x4938('0xe'),_[_0x4938('0xf')](_[_0x4938('0x10')](_0x36028d,{'status':_0x4938('0x11')}),_0x4938('0x12'))[_0x4938('0x13')]());logger[_0x4938('0xc')](_0x4938('0x14'),_[_0x4938('0xf')](_['filter'](_0x36028d,function(_0xdf53c9){return _0xdf53c9[_0x4938('0x15')]!==_0x4938('0x11');}),_0x4938('0x12'))[_0x4938('0x13')]()||_0x4938('0x16'));config[_0x4938('0x17')]&&require(_0x4938('0x18'))[_0x4938('0x19')]();require('./config/license')[_0x4938('0x19')]();})[_0x4938('0x1a')](function(_0x5db022){logger[_0x4938('0x1b')](_0x4938('0x1c'),_0x5db022);process[_0x4938('0x1d')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 853e099..4d1507c 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 _0x2b28=['User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','/dashboards/general','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','apikey','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','join','promisify','sign','options','randomBytes','toString','hex','floor','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','name','permissions','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','Unmanaged.','catch','headers','authorization','Basic','authenticate','pass','Wrong\x20credentials.','startsWith','Bearer','json','query','getUuid','User','find','sub','Setting','allowedLoginAttempts','isEqual','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','minutes'];(function(_0x381fd6,_0x3e772b){var _0x4a6b49=function(_0x236063){while(--_0x236063){_0x381fd6['push'](_0x381fd6['shift']());}};_0x4a6b49(++_0x3e772b);}(_0x2b28,0x9c));var _0x82b2=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x2b28[_0x8c43de];return _0xa6591b;};'use strict';var db=require(_0x82b2('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x82b2('0x1'));var licenseUtil=require(_0x82b2('0x2'));var encryptor=require(_0x82b2('0x3'));var _=require('lodash');var jwt=require(_0x82b2('0x4'));var expressJwt=require(_0x82b2('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0x82b2('0x6'));var crypto=require(_0x82b2('0x7'));var BPromise=require(_0x82b2('0x8'));var util=require(_0x82b2('0x9'));var moment=require(_0x82b2('0xa'));var validateJwt=expressJwt({'secret':config[_0x82b2('0xb')][_0x82b2('0xc')]});var userAttributes=['id',_0x82b2('0xd'),_0x82b2('0xe'),_0x82b2('0xf'),'internal','email','userpic',_0x82b2('0x10'),'md5secret','voicePause',_0x82b2('0x11'),_0x82b2('0x12'),_0x82b2('0x13'),_0x82b2('0x14'),_0x82b2('0x15'),_0x82b2('0x16'),_0x82b2('0x17'),_0x82b2('0x18'),'lastPauseAt',_0x82b2('0x19'),_0x82b2('0x1a'),'passwordResetAt',_0x82b2('0x1b'),_0x82b2('0x1c'),_0x82b2('0x1d'),_0x82b2('0x1e'),_0x82b2('0x1f'),'phoneBarEnableDtmfTone',_0x82b2('0x20'),'phoneBarExpires',_0x82b2('0x21'),_0x82b2('0x22'),_0x82b2('0x23'),_0x82b2('0x24'),_0x82b2('0x25'),'userProfileId',_0x82b2('0x26'),_0x82b2('0x27'),_0x82b2('0x28'),_0x82b2('0x29'),'downloadOmnichannelInteractions','downloadAttachments'];exports[_0x82b2('0x2a')]=function(){return this[_0x82b2('0x2b')](!![])[_0x82b2('0x2c')](function(_0x192e89,_0x2980ae,_0x58847b){if(_0x192e89[_0x82b2('0x2d')]){_0x58847b();}else{return db[_0x82b2('0x2e')][_0x82b2('0x2f')]({'where':{'id':_0x192e89[_0x82b2('0x30')]['id']},'attributes':['id',_0x82b2('0x31'),_0x82b2('0x32')],'raw':!![]})[_0x82b2('0x33')](function(_0x5dd5ec){if(_0x5dd5ec&&_0x5dd5ec[_0x82b2('0x31')]){return _0x2980ae[_0x82b2('0x34')](_0x5dd5ec['disposition']==='unmanaged'?0x195:0x193)['json']({'message':_0x5dd5ec['disposition']===_0x82b2('0x35')?_0x82b2('0x36'):'Forbidden.'});}else{_0x58847b();}})[_0x82b2('0x37')](function(_0x203f84){_0x58847b(_0x203f84);});}});};exports['isAuthenticated']=function isAuthenticated(_0x189850){return compose()[_0x82b2('0x2c')](function(_0x576fd9,_0x4a264d,_0x32636f){var _0x43fd10;if(_0x576fd9[_0x82b2('0x38')][_0x82b2('0x39')]){if(_['startsWith'](_0x576fd9[_0x82b2('0x38')]['authorization'],_0x82b2('0x3a'))){var _0xd1e315=basicAuth(_0x576fd9);db['User']['find']({'where':{'name':_0xd1e315['name']}})[_0x82b2('0x33')](function(_0x1ec671){if(!_0x1ec671||!_0x1ec671[_0x82b2('0x3b')](_0xd1e315[_0x82b2('0x3c')])){return _0x4a264d[_0x82b2('0x34')](0x191)['json']({'message':_0x82b2('0x3d')});}_0x576fd9[_0x82b2('0x2d')]={'id':_0x1ec671['id']};_0x32636f();})[_0x82b2('0x37')](function(_0x479a50){_0x32636f(_0x479a50);});}else if(_[_0x82b2('0x3e')](_0x576fd9[_0x82b2('0x38')]['authorization'],_0x82b2('0x3f'))){validateJwt(_0x576fd9,_0x4a264d,_0x32636f);}else{if(_0x189850){_0x32636f();}else{return _0x4a264d[_0x82b2('0x34')](0x193)[_0x82b2('0x40')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x576fd9[_0x82b2('0x41')]['apikey']){try{var _0x55d4ef={'audience':hardwareConf[_0x82b2('0x42')](),'issuer':hardwareConf[_0x82b2('0x42')]()};verifyJwt(_0x576fd9[_0x82b2('0x41')]['apikey'],_0x55d4ef)[_0x82b2('0x33')](function(_0x358a23){return db[_0x82b2('0x43')][_0x82b2('0x44')]({'where':{'id':_0x358a23[_0x82b2('0x45')]}})[_0x82b2('0x33')](function(_0x2e5b7f){_0x43fd10=_0x2e5b7f;return db[_0x82b2('0x46')][_0x82b2('0x2f')]({'where':{'id':0x1},'attributes':[_0x82b2('0x47'),'blockDuration'],'raw':!![]});})['then'](function(_0x17184d){if(!_0x43fd10||!_[_0x82b2('0x48')](_0x43fd10['apiKeyNonce'],_0x358a23[_0x82b2('0x49')])){return _0x4a264d[_0x82b2('0x34')](0x191)[_0x82b2('0x40')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x43fd10[_0x82b2('0x4a')]){return _0x4a264d[_0x82b2('0x34')](0x191)[_0x82b2('0x40')]({'message':_0x82b2('0x4b')});}if(_0x43fd10[_0x82b2('0x4c')]){if(_0x17184d[_0x82b2('0x4d')]>0x0){if(moment(_0x43fd10[_0x82b2('0x4e')])['add'](_0x17184d[_0x82b2('0x4d')],_0x82b2('0x4f'))>moment()){return _0x4a264d['status'](0x191)[_0x82b2('0x40')]({'message':_0x82b2('0x4b')});}}else{return _0x4a264d[_0x82b2('0x34')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}_0x576fd9[_0x82b2('0x2d')]={'id':_0x43fd10['id']};_0x32636f();});})['catch'](function(){return _0x4a264d['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x57593c){_0x32636f(_0x57593c);}}else if(_0x189850){_0x32636f();}else{return _0x4a264d[_0x82b2('0x34')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})['use'](function(_0x2e3a16,_0xedb033,_0x2bc156){if(_0x2e3a16['user']){db[_0x82b2('0x43')][_0x82b2('0x44')]({'where':{'id':_0x2e3a16[_0x82b2('0x2d')]['id']},'attributes':userAttributes})[_0x82b2('0x33')](function(_0x16365b){if(!_0x16365b){return _0xedb033[_0x82b2('0x34')](0x194)[_0x82b2('0x40')]({'message':_0x82b2('0x50')});}_0x2e3a16[_0x82b2('0x2d')]=_0x16365b;_0x2bc156();})[_0x82b2('0x37')](function(_0x48e39e){_0x2bc156(_0x48e39e);});}else if(_0x189850){_0x2bc156();}else{return _0xedb033[_0x82b2('0x34')](0x194)[_0x82b2('0x40')]({'message':_0x82b2('0x51')});}});};exports[_0x82b2('0x52')]=function canUpdate(){return compose()['use'](function(_0x76cddc,_0x34f8d6,_0x8f09a0){return licenseUtil[_0x82b2('0x53')]()['then'](function(_0x5173a6){if(_0x5173a6[_0x82b2('0x54')]){_0x8f09a0();}else{return _0x34f8d6[_0x82b2('0x34')](0x193)['json']({'message':_0x82b2('0x55')});}})[_0x82b2('0x37')](function(_0x13f283){_0x8f09a0(_0x13f283);});});};exports['isMiddleware']=function(_0x1aebd5,_0x47799f,_0x113863){_0x1aebd5[_0x82b2('0x56')]=!![];return _0x113863();};exports[_0x82b2('0x57')]=function signToken(_0x9e49b){return signJwt(_0x9e49b);};exports[_0x82b2('0x58')]=function(_0x2f130a,_0x52adb4){if(!_0x2f130a[_0x82b2('0x2d')]){return _0x52adb4[_0x82b2('0x34')](0x194)[_0x82b2('0x40')]({'message':_0x82b2('0x59')});}var _0x5af90a={'payload':{'id':_0x2f130a['user']['id'],'role':_0x2f130a[_0x82b2('0x2d')][_0x82b2('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5af90a)[_0x82b2('0x33')](function(_0x521faf){_0x52adb4['cookie'](_0x82b2('0x5a'),_0x521faf);_0x52adb4['redirect'](_0x82b2('0x5b'));})['catch'](function(_0x1456b4){return _0x52adb4[_0x82b2('0x34')](0x1f4)['send'](_0x1456b4);});};exports['retrieveApiKey']=function(_0x3b0c18){if(_[_0x82b2('0x5c')](_0x3b0c18[_0x82b2('0x5d')])||_[_0x82b2('0x5c')](_0x3b0c18[_0x82b2('0x5e')])){return null;}else{return createJwt(_0x3b0c18);}};exports[_0x82b2('0x5f')]=function(_0x3656ef){_0x3656ef[_0x82b2('0x5d')]=generateNonce();_0x3656ef['apiKeyIat']=generateIssuedAt();return createJwt(_0x3656ef);};exports[_0x82b2('0x60')]=function(_0x59eacc,_0x4a399a){var _0x31d7b4=_0x59eacc[_0x82b2('0x41')][_0x82b2('0x61')];if(_0x31d7b4){var _0x3eb938={'nonce':_0x4a399a[_0x82b2('0x5d')],'iat':_0x4a399a[_0x82b2('0x5e')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x82b2('0x42')]()};return verifyJwt(_0x31d7b4,_0x3eb938)[_0x82b2('0x33')](function(){return generateApiKey(_0x4a399a);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x340ba3){var _0x55dfdc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x55dfdc[_0x82b2('0x62')](_0x340ba3))throw new db[(_0x82b2('0x63'))][(_0x82b2('0x64'))]('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[_0x82b2('0x65')]=function(_0x3c47dc,_0x184ff0,_0x312da7){var _0xfd174e=encryptor[_0x82b2('0x66')](_0x184ff0)[_0x82b2('0x67')](',');for(var _0x54a401=0x0;_0x54a401<_0x312da7;_0x54a401++){if(!_0xfd174e[_0x54a401])break;if(_0x3c47dc['toLowerCase']()===_0xfd174e[_0x54a401][_0x82b2('0x68')]()){var _0x45e3c0=util['format'](_0x82b2('0x69'),_0x312da7);if(_0x312da7===0x1){_0x45e3c0=_0x82b2('0x6a');}throw new db['Sequelize'][(_0x82b2('0x64'))](_0x45e3c0);}}return;};exports['updatePasswordsHistory']=function(_0x3fe1c1,_0x2ada70){var _0x15a20f=_0x2ada70?encryptor[_0x82b2('0x66')](_0x2ada70)[_0x82b2('0x67')](','):[];if(_0x15a20f[_0x82b2('0x6b')]===0x5){_0x15a20f[_0x82b2('0x6c')](-0x1,0x1);}_0x15a20f[_0x82b2('0x6d')](_0x3fe1c1);return encryptor['encryptString'](_0x15a20f[_0x82b2('0x6e')](','));};function signJwt(_0x3d0a19){var _0x34eb53=BPromise[_0x82b2('0x6f')](jwt[_0x82b2('0x70')],{'context':jwt});var _0x923062=_0x3d0a19['secret']||config[_0x82b2('0xb')][_0x82b2('0xc')];return new BPromise(function(_0x21c008,_0x10f52e){_0x34eb53(_0x3d0a19['payload'],_0x923062,_0x3d0a19[_0x82b2('0x71')])[_0x82b2('0x33')](function(_0x4986ba){_0x21c008(_0x4986ba);})[_0x82b2('0x37')](function(_0xb79166){_0x10f52e(_0xb79166);});});}function verifyJwt(_0x2370ad,_0x4cdfd6,_0x360b97){var _0x3ada32=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x37053f=_0x360b97||config['secrets'][_0x82b2('0xc')];return new BPromise(function(_0x19d001,_0x1e743c){_0x3ada32(_0x2370ad,_0x37053f,_0x4cdfd6)[_0x82b2('0x33')](function(_0x424ea4){_0x19d001(_0x424ea4);})[_0x82b2('0x37')](function(_0x2adcae){_0x1e743c(_0x2adcae);});});}function generateNonce(){return crypto[_0x82b2('0x72')](0x10)[_0x82b2('0x73')](_0x82b2('0x74'));}function generateIssuedAt(){return Math[_0x82b2('0x75')](Date['now']()/0x3e8)[_0x82b2('0x73')]();}function createJwt(_0x728028){var _0x4fddaf={'payload':{'iat':_0x728028[_0x82b2('0x5e')],'nonce':_0x728028[_0x82b2('0x5d')]},'options':{'algorithm':'HS512','subject':_0x728028['id'][_0x82b2('0x73')](),'issuer':hardwareConf[_0x82b2('0x42')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x4fddaf)[_0x82b2('0x33')](function(_0x5566d4){return{'iat':_0x728028[_0x82b2('0x5e')],'nonce':_0x728028[_0x82b2('0x5d')],'token':_0x5566d4};});} \ No newline at end of file +var _0x5f20=['API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','canUpdate','getLicense','Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','sign','secret','payload','verify','randomBytes','hex','now','toString','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','composable-middleware','crypto','bluebird','util','moment','secrets','role','fullname','name','internal','email','userpic','voicePause','chatPause','mailPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','use','user','ChatInteraction','closed','then','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','User','find','authenticate','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','blockDuration','isEqual','apiKeyNonce','nonce'];(function(_0x3186aa,_0x34c21e){var _0x2d8c36=function(_0x239e99){while(--_0x239e99){_0x3186aa['push'](_0x3186aa['shift']());}};_0x2d8c36(++_0x34c21e);}(_0x5f20,0x120));var _0x05f2=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x5f20[_0xa8883];return _0x479426;};'use strict';var db=require(_0x05f2('0x0'))['db'];var config=require(_0x05f2('0x1'));var hardwareConf=require(_0x05f2('0x2'));var licenseUtil=require(_0x05f2('0x3'));var encryptor=require(_0x05f2('0x4'));var _=require('lodash');var jwt=require(_0x05f2('0x5'));var expressJwt=require('express-jwt');var compose=require(_0x05f2('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0x05f2('0x7'));var BPromise=require(_0x05f2('0x8'));var util=require(_0x05f2('0x9'));var moment=require(_0x05f2('0xa'));var validateJwt=expressJwt({'secret':config[_0x05f2('0xb')]['session']});var userAttributes=['id',_0x05f2('0xc'),_0x05f2('0xd'),_0x05f2('0xe'),_0x05f2('0xf'),_0x05f2('0x10'),_0x05f2('0x11'),'permissions','md5secret',_0x05f2('0x12'),_0x05f2('0x13'),_0x05f2('0x14'),'faxPause',_0x05f2('0x15'),_0x05f2('0x16'),_0x05f2('0x17'),'showWebBar',_0x05f2('0x18'),_0x05f2('0x19'),_0x05f2('0x1a'),_0x05f2('0x1b'),_0x05f2('0x1c'),'alias',_0x05f2('0x1d'),'phoneBarAutoAnswerDelay','phoneBarDnd',_0x05f2('0x1e'),_0x05f2('0x1f'),'phoneBarEnableSettings',_0x05f2('0x20'),'phoneBarPrefixRequired','phoneBarRemoteControl',_0x05f2('0x21'),_0x05f2('0x22'),_0x05f2('0x23'),_0x05f2('0x24'),_0x05f2('0x25'),_0x05f2('0x26'),'wssPort',_0x05f2('0x27'),_0x05f2('0x28'),'downloadAttachments'];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0x05f2('0x29')](function(_0x368763,_0x200ec3,_0x3205d1){if(_0x368763[_0x05f2('0x2a')]){_0x3205d1();}else{return db[_0x05f2('0x2b')]['findOne']({'where':{'id':_0x368763['params']['id']},'attributes':['id',_0x05f2('0x2c'),'disposition'],'raw':!![]})[_0x05f2('0x2d')](function(_0x2e782d){if(_0x2e782d&&_0x2e782d[_0x05f2('0x2c')]){return _0x200ec3[_0x05f2('0x2e')](_0x2e782d[_0x05f2('0x2f')]===_0x05f2('0x30')?0x195:0x193)[_0x05f2('0x31')]({'message':_0x2e782d[_0x05f2('0x2f')]===_0x05f2('0x30')?_0x05f2('0x32'):_0x05f2('0x33')});}else{_0x3205d1();}})[_0x05f2('0x34')](function(_0x535c7b){_0x3205d1(_0x535c7b);});}});};exports[_0x05f2('0x35')]=function isAuthenticated(_0x15e5b9){return compose()['use'](function(_0x11bd44,_0x246394,_0x22b6e6){var _0x131507;if(_0x11bd44[_0x05f2('0x36')][_0x05f2('0x37')]){if(_[_0x05f2('0x38')](_0x11bd44[_0x05f2('0x36')]['authorization'],'Basic')){var _0x8bd079=basicAuth(_0x11bd44);db[_0x05f2('0x39')][_0x05f2('0x3a')]({'where':{'name':_0x8bd079['name']}})[_0x05f2('0x2d')](function(_0x59e1be){if(!_0x59e1be||!_0x59e1be[_0x05f2('0x3b')](_0x8bd079['pass'])){return _0x246394[_0x05f2('0x2e')](0x191)['json']({'message':_0x05f2('0x3c')});}_0x11bd44['user']={'id':_0x59e1be['id']};_0x22b6e6();})['catch'](function(_0x2d9b18){_0x22b6e6(_0x2d9b18);});}else if(_[_0x05f2('0x38')](_0x11bd44['headers'][_0x05f2('0x37')],_0x05f2('0x3d'))){validateJwt(_0x11bd44,_0x246394,_0x22b6e6);}else{if(_0x15e5b9){_0x22b6e6();}else{return _0x246394[_0x05f2('0x2e')](0x193)[_0x05f2('0x31')]({'message':_0x05f2('0x3e')});}}}else if(_0x11bd44[_0x05f2('0x3f')][_0x05f2('0x40')]){try{var _0x1f1894={'audience':hardwareConf[_0x05f2('0x41')](),'issuer':hardwareConf[_0x05f2('0x41')]()};verifyJwt(_0x11bd44[_0x05f2('0x3f')][_0x05f2('0x40')],_0x1f1894)[_0x05f2('0x2d')](function(_0x4c79b2){return db[_0x05f2('0x39')]['find']({'where':{'id':_0x4c79b2[_0x05f2('0x42')]}})['then'](function(_0x3fe2e7){_0x131507=_0x3fe2e7;return db[_0x05f2('0x43')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x05f2('0x44')],'raw':!![]});})[_0x05f2('0x2d')](function(_0x2c07b3){if(!_0x131507||!_[_0x05f2('0x45')](_0x131507[_0x05f2('0x46')],_0x4c79b2[_0x05f2('0x47')])){return _0x246394[_0x05f2('0x2e')](0x191)[_0x05f2('0x31')]({'message':_0x05f2('0x48')});}if(_0x131507[_0x05f2('0x49')]){return _0x246394[_0x05f2('0x2e')](0x191)[_0x05f2('0x31')]({'message':_0x05f2('0x4a')});}if(_0x131507[_0x05f2('0x4b')]){if(_0x2c07b3[_0x05f2('0x44')]>0x0){if(moment(_0x131507[_0x05f2('0x4c')])[_0x05f2('0x4d')](_0x2c07b3['blockDuration'],_0x05f2('0x4e'))>moment()){return _0x246394['status'](0x191)['json']({'message':_0x05f2('0x4a')});}}else{return _0x246394[_0x05f2('0x2e')](0x191)['json']({'message':_0x05f2('0x4a')});}}_0x11bd44[_0x05f2('0x2a')]={'id':_0x131507['id']};_0x22b6e6();});})[_0x05f2('0x34')](function(){return _0x246394['status'](0x191)[_0x05f2('0x31')]({'message':_0x05f2('0x4a')});});}catch(_0x224395){_0x22b6e6(_0x224395);}}else if(_0x15e5b9){_0x22b6e6();}else{return _0x246394['status'](0x193)[_0x05f2('0x31')]({'message':'Unknown\x20authorization\x20format'});}})['use'](function(_0x5eae3a,_0x75b66c,_0x17e677){if(_0x5eae3a[_0x05f2('0x2a')]){db[_0x05f2('0x39')]['find']({'where':{'id':_0x5eae3a[_0x05f2('0x2a')]['id']},'attributes':userAttributes})[_0x05f2('0x2d')](function(_0x1d7942){if(!_0x1d7942){return _0x75b66c[_0x05f2('0x2e')](0x194)[_0x05f2('0x31')]({'message':'User\x20not\x20found.'});}_0x5eae3a['user']=_0x1d7942;_0x17e677();})[_0x05f2('0x34')](function(_0xa0a38f){_0x17e677(_0xa0a38f);});}else if(_0x15e5b9){_0x17e677();}else{return _0x75b66c[_0x05f2('0x2e')](0x194)[_0x05f2('0x31')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x05f2('0x4f')]=function canUpdate(){return compose()['use'](function(_0x3db652,_0x4c1038,_0x4b9f37){return licenseUtil[_0x05f2('0x50')]()[_0x05f2('0x2d')](function(_0x1f41c7){if(_0x1f41c7['update']){_0x4b9f37();}else{return _0x4c1038[_0x05f2('0x2e')](0x193)[_0x05f2('0x31')]({'message':_0x05f2('0x51')});}})[_0x05f2('0x34')](function(_0xab805f){_0x4b9f37(_0xab805f);});});};exports[_0x05f2('0x52')]=function(_0x498065,_0x39d1bd,_0x462de7){_0x498065[_0x05f2('0x52')]=!![];return _0x462de7();};exports[_0x05f2('0x53')]=function signToken(_0x410b42){return signJwt(_0x410b42);};exports['setTokenCookie']=function(_0x1511de,_0x3b9e49){if(!_0x1511de['user']){return _0x3b9e49['status'](0x194)[_0x05f2('0x31')]({'message':_0x05f2('0x54')});}var _0x4f7b11={'payload':{'id':_0x1511de[_0x05f2('0x2a')]['id'],'role':_0x1511de['user'][_0x05f2('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4f7b11)[_0x05f2('0x2d')](function(_0x57d095){_0x3b9e49['cookie'](_0x05f2('0x55'),_0x57d095);_0x3b9e49[_0x05f2('0x56')](_0x05f2('0x57'));})['catch'](function(_0x476e4c){return _0x3b9e49['status'](0x1f4)[_0x05f2('0x58')](_0x476e4c);});};exports[_0x05f2('0x59')]=function(_0x8f9608){if(_['isNil'](_0x8f9608[_0x05f2('0x46')])||_[_0x05f2('0x5a')](_0x8f9608[_0x05f2('0x5b')])){return null;}else{return createJwt(_0x8f9608);}};exports['generateApiKey']=function(_0x129e36){_0x129e36['apiKeyNonce']=generateNonce();_0x129e36[_0x05f2('0x5b')]=generateIssuedAt();return createJwt(_0x129e36);};exports[_0x05f2('0x5c')]=function(_0x4bf4fe,_0x6dcd0){var _0x447de8=_0x4bf4fe[_0x05f2('0x3f')][_0x05f2('0x40')];if(_0x447de8){var _0x26da8a={'nonce':_0x6dcd0[_0x05f2('0x46')],'iat':_0x6dcd0[_0x05f2('0x5b')],'audience':hardwareConf[_0x05f2('0x41')](),'issuer':hardwareConf[_0x05f2('0x41')]()};return verifyJwt(_0x447de8,_0x26da8a)[_0x05f2('0x2d')](function(){return generateApiKey(_0x6dcd0);});}else{throw{'message':_0x05f2('0x5d')};}};exports[_0x05f2('0x5e')]=function(_0x1369a5){var _0x3853d2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3853d2[_0x05f2('0x5f')](_0x1369a5))throw new db[(_0x05f2('0x60'))][(_0x05f2('0x61'))]('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[_0x05f2('0x62')]=function(_0x46c78f,_0x1565a8,_0x37931d){var _0x1f073a=encryptor[_0x05f2('0x63')](_0x1565a8)[_0x05f2('0x64')](',');for(var _0x2b4818=0x0;_0x2b4818<_0x37931d;_0x2b4818++){if(!_0x1f073a[_0x2b4818])break;if(_0x46c78f[_0x05f2('0x65')]()===_0x1f073a[_0x2b4818][_0x05f2('0x65')]()){var _0x435f8f=util[_0x05f2('0x66')](_0x05f2('0x67'),_0x37931d);if(_0x37931d===0x1){_0x435f8f=_0x05f2('0x68');}throw new db[(_0x05f2('0x60'))][(_0x05f2('0x61'))](_0x435f8f);}}return;};exports[_0x05f2('0x69')]=function(_0x49833c,_0x267dc4){var _0x22d26b=_0x267dc4?encryptor[_0x05f2('0x63')](_0x267dc4)['split'](','):[];if(_0x22d26b[_0x05f2('0x6a')]===0x5){_0x22d26b[_0x05f2('0x6b')](-0x1,0x1);}_0x22d26b[_0x05f2('0x6c')](_0x49833c);return encryptor[_0x05f2('0x6d')](_0x22d26b[_0x05f2('0x6e')](','));};function signJwt(_0x1dedea){var _0x1d3fdf=BPromise[_0x05f2('0x6f')](jwt[_0x05f2('0x70')],{'context':jwt});var _0xafa5f0=_0x1dedea[_0x05f2('0x71')]||config[_0x05f2('0xb')]['session'];return new BPromise(function(_0x211852,_0x3a4798){_0x1d3fdf(_0x1dedea[_0x05f2('0x72')],_0xafa5f0,_0x1dedea['options'])[_0x05f2('0x2d')](function(_0x492bc4){_0x211852(_0x492bc4);})[_0x05f2('0x34')](function(_0x35fb1f){_0x3a4798(_0x35fb1f);});});}function verifyJwt(_0x4c0399,_0x75ac2a,_0x52545f){var _0x42ee75=BPromise['promisify'](jwt[_0x05f2('0x73')],{'context':jwt});var _0xea12b8=_0x52545f||config[_0x05f2('0xb')]['session'];return new BPromise(function(_0x15c7ce,_0x2ab592){_0x42ee75(_0x4c0399,_0xea12b8,_0x75ac2a)[_0x05f2('0x2d')](function(_0x53e7eb){_0x15c7ce(_0x53e7eb);})[_0x05f2('0x34')](function(_0xd64e8f){_0x2ab592(_0xd64e8f);});});}function generateNonce(){return crypto[_0x05f2('0x74')](0x10)['toString'](_0x05f2('0x75'));}function generateIssuedAt(){return Math['floor'](Date[_0x05f2('0x76')]()/0x3e8)[_0x05f2('0x77')]();}function createJwt(_0x4ba3b0){var _0x438be0={'payload':{'iat':_0x4ba3b0[_0x05f2('0x5b')],'nonce':_0x4ba3b0['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x4ba3b0['id'][_0x05f2('0x77')](),'issuer':hardwareConf[_0x05f2('0x41')](),'audience':hardwareConf[_0x05f2('0x41')]()}};return signJwt(_0x438be0)['then'](function(_0x2ffd09){return{'iat':_0x4ba3b0[_0x05f2('0x5b')],'nonce':_0x4ba3b0['apiKeyNonce'],'token':_0x2ffd09};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 332a27d..6a6db9e 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 _0xd281=['createReadStream','createWriteStream','data','update','binary','write','final','end','close','unlink','decryptFile','createDecipher','encryptString','secret','createCipher','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0xd281,0x168));var _0x1d28=function(_0x1c2575,_0x104102){_0x1c2575=_0x1c2575-0x0;var _0x4cb5cc=_0xd281[_0x1c2575];return _0x4cb5cc;};'use strict';var crypto=require(_0x1d28('0x0'));var fs=require('fs');var BPromise=require(_0x1d28('0x1'));var _=require(_0x1d28('0x2'));var config=require('../../config/environment');var logger=require(_0x1d28('0x3'))(_0x1d28('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x1d28('0x5')][_0x1d28('0x6')],'algorithm':_0x1d28('0x7')};const fileOptions={'algorithm':_0x1d28('0x8')};if(config[_0x1d28('0x9')]&&config[_0x1d28('0x9')][_0x1d28('0xa')]){var isSupported=isAlgorithmSupported(config[_0x1d28('0x9')][_0x1d28('0xa')]);if(isSupported){fileOptions[_0x1d28('0xa')]=config[_0x1d28('0x9')][_0x1d28('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x1d28('0xb')](',\x20');logger[_0x1d28('0xc')](config[_0x1d28('0x9')][_0x1d28('0xa')],_0x1d28('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x926c6d){return AES_SUPPORTED_RX[_0x1d28('0xe')](_0x926c6d);}function getSupportedCiphers(){return crypto[_0x1d28('0xf')]()[_0x1d28('0x10')](isASupportedCipher);}function isAlgorithmSupported(_0x152122){return getSupportedCiphers()[_0x1d28('0x11')](_0x152122)>-0x1;}function combineOptions(_0x1eaaa1){var _0x523da2={};for(var _0x236213 in fileOptions){if(fileOptions[_0x1d28('0x12')](_0x236213)){_0x523da2[_0x236213]=fileOptions[_0x236213];}}if(_0x1eaaa1){for(var _0x353dfc in _0x1eaaa1){if(_0x1eaaa1['hasOwnProperty'](_0x353dfc)){_0x523da2[_0x353dfc]=_0x1eaaa1[_0x353dfc];}}}return _0x523da2;}exports[_0x1d28('0x13')]=function(_0x4af9d5,_0x22b919,_0x1c0fab,_0x2b01f1){return new BPromise(function(_0x25dd5c,_0x30d6b8){_0x2b01f1=combineOptions(_0x2b01f1);var _0x3391e5=new Buffer(_0x1c0fab);var _0x48b7c8=fs[_0x1d28('0x14')](_0x4af9d5);var _0xd6ffae=fs[_0x1d28('0x15')](_0x22b919);var _0x20952f=crypto['createCipher'](_0x2b01f1[_0x1d28('0xa')],_0x3391e5);_0x48b7c8['on'](_0x1d28('0x16'),function(_0x3490a0){var _0x132f05=new Buffer(_0x20952f[_0x1d28('0x17')](_0x3490a0),_0x1d28('0x18'));_0xd6ffae[_0x1d28('0x19')](_0x132f05);});_0x48b7c8['on']('end',function(){try{var _0x46bd38=new Buffer(_0x20952f[_0x1d28('0x1a')]('binary'),_0x1d28('0x18'));_0xd6ffae[_0x1d28('0x19')](_0x46bd38);_0xd6ffae[_0x1d28('0x1b')]();_0xd6ffae['on'](_0x1d28('0x1c'),function(){return _0x25dd5c(_0x22b919);});}catch(_0x116adc){fs[_0x1d28('0x1d')](_0x22b919);return _0x30d6b8(_0x116adc);}});});};exports[_0x1d28('0x1e')]=function(_0x5bdf2e,_0x175dbb,_0x3d05b9,_0xfd969c){return new BPromise(function(_0x41bde0,_0x48c56c){_0xfd969c=combineOptions(_0xfd969c);var _0x42331e=new Buffer(_0x3d05b9);var _0x38602e=fs[_0x1d28('0x14')](_0x5bdf2e);var _0x503e7a=fs['createWriteStream'](_0x175dbb);var _0x3fdee6=crypto[_0x1d28('0x1f')](_0xfd969c[_0x1d28('0xa')],_0x42331e);_0x38602e['on'](_0x1d28('0x16'),function(_0x47d44a){var _0x29d105=new Buffer(_0x3fdee6[_0x1d28('0x17')](_0x47d44a),'binary');_0x503e7a[_0x1d28('0x19')](_0x29d105);});_0x38602e['on'](_0x1d28('0x1b'),function(){try{var _0x16899d=new Buffer(_0x3fdee6[_0x1d28('0x1a')](_0x1d28('0x18')),_0x1d28('0x18'));_0x503e7a[_0x1d28('0x19')](_0x16899d);_0x503e7a[_0x1d28('0x1b')]();_0x503e7a['on'](_0x1d28('0x1c'),function(){return _0x41bde0(_0x175dbb);});}catch(_0x526f31){fs[_0x1d28('0x1d')](_0x175dbb);return _0x48c56c(_0x526f31);}});});};exports[_0x1d28('0x20')]=function(_0x4e0dd4,_0x13ec88,_0x4ce18b){var _0x1d48ac=_0x4ce18b||stringOptions['algorithm'];var _0x462768=_0x13ec88||stringOptions[_0x1d28('0x21')];var _0x4284d2=crypto[_0x1d28('0x22')](_0x1d48ac,_0x462768);var _0x1a42d9=_0x4284d2[_0x1d28('0x17')](_0x4e0dd4,_0x1d28('0x23'),'base64');_0x1a42d9+=_0x4284d2[_0x1d28('0x1a')](_0x1d28('0x24'));return _0x1a42d9;};exports[_0x1d28('0x25')]=function(_0x391e67,_0xa916a9,_0x4fa5ed){var _0x2686c7=_0x4fa5ed||stringOptions[_0x1d28('0xa')];var _0x469869=_0xa916a9||stringOptions[_0x1d28('0x21')];var _0x44f63c=crypto[_0x1d28('0x1f')](_0x2686c7,_0x469869);var _0x147dcd=_0x44f63c[_0x1d28('0x17')](_0x391e67,_0x1d28('0x24'),_0x1d28('0x23'));_0x147dcd+=_0x44f63c[_0x1d28('0x1a')](_0x1d28('0x23'));return _0x147dcd;}; \ No newline at end of file +var _0x82ee=['utf8','base64','decryptString','createDecipher','bluebird','lodash','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','test','filter','indexOf','encryptFile','createReadStream','createWriteStream','createCipher','data','update','write','final','binary','end','close','unlink','decryptFile','encryptString','secret'];(function(_0x35394f,_0x55df0c){var _0x583313=function(_0x1c5e3d){while(--_0x1c5e3d){_0x35394f['push'](_0x35394f['shift']());}};_0x583313(++_0x55df0c);}(_0x82ee,0x1e0));var _0xe82e=function(_0x4871ff,_0x497e6c){_0x4871ff=_0x4871ff-0x0;var _0x8dd2cf=_0x82ee[_0x4871ff];return _0x8dd2cf;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xe82e('0x0'));var _=require(_0xe82e('0x1'));var config=require('../../config/environment');var logger=require(_0xe82e('0x2'))(_0xe82e('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xe82e('0x4')][_0xe82e('0x5')],'algorithm':_0xe82e('0x6')};const fileOptions={'algorithm':_0xe82e('0x7')};if(config[_0xe82e('0x8')]&&config[_0xe82e('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0xe82e('0x9')]=config['encrypt'][_0xe82e('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xe82e('0xa')](',\x20');logger[_0xe82e('0xb')](config[_0xe82e('0x8')][_0xe82e('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x504608){return AES_SUPPORTED_RX[_0xe82e('0xc')](_0x504608);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xe82e('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x5dff56){return getSupportedCiphers()[_0xe82e('0xe')](_0x5dff56)>-0x1;}function combineOptions(_0x15ffab){var _0x513056={};for(var _0x6d3499 in fileOptions){if(fileOptions['hasOwnProperty'](_0x6d3499)){_0x513056[_0x6d3499]=fileOptions[_0x6d3499];}}if(_0x15ffab){for(var _0x341dd9 in _0x15ffab){if(_0x15ffab['hasOwnProperty'](_0x341dd9)){_0x513056[_0x341dd9]=_0x15ffab[_0x341dd9];}}}return _0x513056;}exports[_0xe82e('0xf')]=function(_0x151622,_0x1fe9c3,_0x612fd7,_0x209afc){return new BPromise(function(_0x515da2,_0x982913){_0x209afc=combineOptions(_0x209afc);var _0xbee49a=new Buffer(_0x612fd7);var _0x104714=fs[_0xe82e('0x10')](_0x151622);var _0x4f0143=fs[_0xe82e('0x11')](_0x1fe9c3);var _0x2800b1=crypto[_0xe82e('0x12')](_0x209afc['algorithm'],_0xbee49a);_0x104714['on'](_0xe82e('0x13'),function(_0x5e0feb){var _0x4fde55=new Buffer(_0x2800b1[_0xe82e('0x14')](_0x5e0feb),'binary');_0x4f0143[_0xe82e('0x15')](_0x4fde55);});_0x104714['on']('end',function(){try{var _0x45c8d2=new Buffer(_0x2800b1[_0xe82e('0x16')](_0xe82e('0x17')),_0xe82e('0x17'));_0x4f0143[_0xe82e('0x15')](_0x45c8d2);_0x4f0143[_0xe82e('0x18')]();_0x4f0143['on'](_0xe82e('0x19'),function(){return _0x515da2(_0x1fe9c3);});}catch(_0x2e05f1){fs[_0xe82e('0x1a')](_0x1fe9c3);return _0x982913(_0x2e05f1);}});});};exports[_0xe82e('0x1b')]=function(_0x1b90e2,_0x17ab1e,_0x41c2bb,_0x454ec2){return new BPromise(function(_0x209d1f,_0x1675e8){_0x454ec2=combineOptions(_0x454ec2);var _0x1c41f5=new Buffer(_0x41c2bb);var _0x2aa8be=fs[_0xe82e('0x10')](_0x1b90e2);var _0x4d3e8d=fs['createWriteStream'](_0x17ab1e);var _0x4fbb2a=crypto['createDecipher'](_0x454ec2[_0xe82e('0x9')],_0x1c41f5);_0x2aa8be['on'](_0xe82e('0x13'),function(_0x31d0ee){var _0xad51c6=new Buffer(_0x4fbb2a[_0xe82e('0x14')](_0x31d0ee),_0xe82e('0x17'));_0x4d3e8d['write'](_0xad51c6);});_0x2aa8be['on'](_0xe82e('0x18'),function(){try{var _0x19da82=new Buffer(_0x4fbb2a[_0xe82e('0x16')]('binary'),_0xe82e('0x17'));_0x4d3e8d[_0xe82e('0x15')](_0x19da82);_0x4d3e8d['end']();_0x4d3e8d['on'](_0xe82e('0x19'),function(){return _0x209d1f(_0x17ab1e);});}catch(_0x31a455){fs[_0xe82e('0x1a')](_0x17ab1e);return _0x1675e8(_0x31a455);}});});};exports[_0xe82e('0x1c')]=function(_0x1aa34c,_0x40f266,_0x591962){var _0x375202=_0x591962||stringOptions[_0xe82e('0x9')];var _0x5005cd=_0x40f266||stringOptions[_0xe82e('0x1d')];var _0x30a40c=crypto['createCipher'](_0x375202,_0x5005cd);var _0x5e25d8=_0x30a40c[_0xe82e('0x14')](_0x1aa34c,_0xe82e('0x1e'),'base64');_0x5e25d8+=_0x30a40c[_0xe82e('0x16')](_0xe82e('0x1f'));return _0x5e25d8;};exports[_0xe82e('0x20')]=function(_0x42b289,_0x2b9fa2,_0xfc5662){var _0x5a4c85=_0xfc5662||stringOptions['algorithm'];var _0x11955e=_0x2b9fa2||stringOptions[_0xe82e('0x1d')];var _0x26c08f=crypto[_0xe82e('0x21')](_0x5a4c85,_0x11955e);var _0x1bd9ac=_0x26c08f[_0xe82e('0x14')](_0x42b289,_0xe82e('0x1f'),_0xe82e('0x1e'));_0x1bd9ac+=_0x26c08f[_0xe82e('0x16')](_0xe82e('0x1e'));return _0x1bd9ac;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 544a5eb..c2eb3e1 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 _0x5712=['lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','length','join','mkdirSync','%s%d.%s','csv','%s.%s','writeFileSync','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','exit','util','path'];(function(_0x51630f,_0x3d2e49){var _0x4ee621=function(_0x5da0d6){while(--_0x5da0d6){_0x51630f['push'](_0x51630f['shift']());}};_0x4ee621(++_0x3d2e49);}(_0x5712,0x140));var _0x2571=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x5712[_0x3bf83f];return _0x22c4a9;};'use strict';var util=require(_0x2571('0x0'));var path=require(_0x2571('0x1'));var _=require(_0x2571('0x2'));var csv=require(_0x2571('0x3'));var fs=require('fs');var BPromise=require(_0x2571('0x4'));var zipdir=require(_0x2571('0x5'));var rimraf=require(_0x2571('0x6'));var db=require(_0x2571('0x7'))['db'];var dbH=require(_0x2571('0x7'))[_0x2571('0x8')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x2571('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x2571('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x251ee6,_0x3ca885){var _0x204ecc={'status':_0x251ee6};var _0xda659a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3ca885){_0x204ecc[_0x2571('0xa')]=_0x3ca885;}return db['AnalyticExtractedReport'][_0x2571('0xb')](_0x204ecc,_0xda659a);}function main(){var _0x558992=0x1388;var _0x15650f;logger[_0x2571('0xc')](util[_0x2571('0xd')](_0x2571('0xe'),EXTRACTED_REPORT_ID,_0x2571('0xf')));return db[_0x2571('0x10')][_0x2571('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2571('0x12'),'splitSizeCsv']})['then'](function(_0x33d3ed){if(_0x33d3ed){_0x15650f=_0x33d3ed;_0x558992=_0x15650f[_0x2571('0x13')]||0x1388;}})[_0x2571('0x14')](function(){return dbH[_0x2571('0x15')][_0x2571('0x16')](util[_0x2571('0xd')](_0x2571('0x17'),QUERY),{'type':dbH[_0x2571('0x15')][_0x2571('0x18')][_0x2571('0x19')]});})[_0x2571('0x14')](function(_0x3c1a08){if(!_0x3c1a08[0x0]['num']){return analyticExtractedReport(_0x2571('0x1a'));}var _0x47b5e9=[];var _0x51425e=0x0;var _0x58cf1b=!![];if(_0x3c1a08&&_0x3c1a08['length']){var _0x18de65=_0x3c1a08[0x0][_0x2571('0x1b')]%(_0x51425e+_0x558992);if(_0x15650f[_0x2571('0x12')]){for(;_0x58cf1b;_0x51425e+=_0x558992,_0x18de65=_0x3c1a08[0x0][_0x2571('0x1b')]%(_0x51425e+_0x558992)){if(_0x18de65==0x0||_0x18de65==_0x3c1a08[0x0]['num']){_0x58cf1b=![];}_0x47b5e9[_0x2571('0x1c')](dbH[_0x2571('0x15')]['query'](util[_0x2571('0xd')](_0x2571('0x1d'),QUERY,_0x558992,_0x51425e),{'type':dbH[_0x2571('0x15')][_0x2571('0x18')][_0x2571('0x19')]}));}}else{_0x47b5e9['push'](dbH['sequelize'][_0x2571('0x16')](QUERY,{'type':dbH[_0x2571('0x15')]['QueryTypes']['SELECT']}));}}var _0x21fa16=path[_0x2571('0x1e')](PATH);var _0x2218fb=path[_0x2571('0x1f')](PATH,'.csv');var _0x2548d0=_0x15650f['split']&&_0x47b5e9[_0x2571('0x20')]>0x1;var _0x4316b1=[];if(!fs['existsSync'](path[_0x2571('0x21')](_0x21fa16,_0x2218fb))&&_0x2548d0){fs[_0x2571('0x22')](path[_0x2571('0x21')](_0x21fa16,_0x2218fb));}return BPromise['each'](_0x47b5e9,function(_0x5d455d){_0x4316b1[_0x2571('0x1c')](_0x5d455d);})[_0x2571('0x14')](function(){for(var _0xcde31f=0x0;_0xcde31f<_0x4316b1[_0x2571('0x20')];_0xcde31f+=0x1){var _0x2f5cae;var _0x246bbd=_0x4316b1[_0xcde31f];if(_0x2548d0){_0x2f5cae=path['join'](_0x21fa16,_0x2218fb,util['format'](_0x2571('0x23'),_0x2218fb,_0xcde31f,_0x2571('0x24')));}else{_0x2f5cae=path[_0x2571('0x21')](_0x21fa16,util[_0x2571('0xd')](_0x2571('0x25'),_0x2218fb,_0x2571('0x24')));}fs[_0x2571('0x26')](_0x2f5cae,csv(_0x246bbd));}})[_0x2571('0x14')](function(){if(_0x2548d0){zipdir(path[_0x2571('0x21')](_0x21fa16,_0x2218fb),{'saveTo':path[_0x2571('0x21')](_0x21fa16,util['format'](_0x2571('0x25'),_0x2218fb,_0x2571('0x27')))},function(_0x26af3c,_0x441e7d){});rimraf(path[_0x2571('0x21')](_0x21fa16,_0x2218fb),function(){});}})[_0x2571('0x14')](function(){logger['info'](util['format'](_0x2571('0x28'),EXTRACTED_REPORT_ID,_0x2571('0xf')));return analyticExtractedReport(_0x2571('0x29'),_0x2548d0?util[_0x2571('0xd')]('%s.%s',_0x2218fb,_0x2548d0?_0x2571('0x27'):_0x2571('0x24')):null);});})['catch'](function(_0x4ddb41){logger[_0x2571('0xc')](util[_0x2571('0xd')](_0x2571('0x2a'),EXTRACTED_REPORT_ID,'CSV'),util[_0x2571('0x2b')](_0x4ddb41,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2571('0x2c'));})['finally'](function(){process[_0x2571('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x705f=['then','splitSizeCsv','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','length','existsSync','join','%s%d.%s','csv','%s.%s','writeFileSync','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split'];(function(_0x48d6c2,_0x1ce5d2){var _0x39eeb1=function(_0xa992a7){while(--_0xa992a7){_0x48d6c2['push'](_0x48d6c2['shift']());}};_0x39eeb1(++_0x1ce5d2);}(_0x705f,0x75));var _0xf705=function(_0xc3f3bd,_0x20b7f5){_0xc3f3bd=_0xc3f3bd-0x0;var _0x27d0bd=_0x705f[_0xc3f3bd];return _0x27d0bd;};'use strict';var util=require('util');var path=require('path');var _=require(_0xf705('0x0'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xf705('0x1'));var zipdir=require(_0xf705('0x2'));var rimraf=require(_0xf705('0x3'));var db=require(_0xf705('0x4'))['db'];var dbH=require(_0xf705('0x4'))[_0xf705('0x5')];var logger=require(_0xf705('0x6'))(_0xf705('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xf705('0x8')][0x2]);var QUERY=process[_0xf705('0x8')][0x3];var PATH=process[_0xf705('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x48eb92,_0x51fda8){var _0xc244e3={'status':_0x48eb92};var _0x58cae9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x51fda8){_0xc244e3[_0xf705('0x9')]=_0x51fda8;}return db[_0xf705('0xa')]['update'](_0xc244e3,_0x58cae9);}function main(){var _0x4bd6fd=0x1388;var _0x1f9ab1;logger[_0xf705('0xb')](util[_0xf705('0xc')](_0xf705('0xd'),EXTRACTED_REPORT_ID,_0xf705('0xe')));return db[_0xf705('0xf')][_0xf705('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf705('0x11'),'splitSizeCsv']})[_0xf705('0x12')](function(_0x296a62){if(_0x296a62){_0x1f9ab1=_0x296a62;_0x4bd6fd=_0x1f9ab1[_0xf705('0x13')]||0x1388;}})[_0xf705('0x12')](function(){return dbH[_0xf705('0x14')]['query'](util['format'](_0xf705('0x15'),QUERY),{'type':dbH[_0xf705('0x14')][_0xf705('0x16')][_0xf705('0x17')]});})['then'](function(_0x9c7b75){if(!_0x9c7b75[0x0][_0xf705('0x18')]){return analyticExtractedReport(_0xf705('0x19'));}var _0x32f48b=[];var _0x572efc=0x0;var _0x11dcbc=!![];if(_0x9c7b75&&_0x9c7b75['length']){var _0x151091=_0x9c7b75[0x0][_0xf705('0x18')]%(_0x572efc+_0x4bd6fd);if(_0x1f9ab1['split']){for(;_0x11dcbc;_0x572efc+=_0x4bd6fd,_0x151091=_0x9c7b75[0x0][_0xf705('0x18')]%(_0x572efc+_0x4bd6fd)){if(_0x151091==0x0||_0x151091==_0x9c7b75[0x0]['num']){_0x11dcbc=![];}_0x32f48b[_0xf705('0x1a')](dbH['sequelize']['query'](util[_0xf705('0xc')](_0xf705('0x1b'),QUERY,_0x4bd6fd,_0x572efc),{'type':dbH[_0xf705('0x14')]['QueryTypes'][_0xf705('0x17')]}));}}else{_0x32f48b[_0xf705('0x1a')](dbH[_0xf705('0x14')]['query'](QUERY,{'type':dbH[_0xf705('0x14')]['QueryTypes']['SELECT']}));}}var _0x2fb99e=path[_0xf705('0x1c')](PATH);var _0x2a2fb7=path[_0xf705('0x1d')](PATH,_0xf705('0x1e'));var _0x3f29c0=_0x1f9ab1[_0xf705('0x11')]&&_0x32f48b[_0xf705('0x1f')]>0x1;var _0x424d4e=[];if(!fs[_0xf705('0x20')](path[_0xf705('0x21')](_0x2fb99e,_0x2a2fb7))&&_0x3f29c0){fs['mkdirSync'](path[_0xf705('0x21')](_0x2fb99e,_0x2a2fb7));}return BPromise['each'](_0x32f48b,function(_0x23bb4a){_0x424d4e['push'](_0x23bb4a);})['then'](function(){for(var _0x8a4c48=0x0;_0x8a4c48<_0x424d4e[_0xf705('0x1f')];_0x8a4c48+=0x1){var _0x593180;var _0x4f5435=_0x424d4e[_0x8a4c48];if(_0x3f29c0){_0x593180=path[_0xf705('0x21')](_0x2fb99e,_0x2a2fb7,util[_0xf705('0xc')](_0xf705('0x22'),_0x2a2fb7,_0x8a4c48,_0xf705('0x23')));}else{_0x593180=path[_0xf705('0x21')](_0x2fb99e,util['format'](_0xf705('0x24'),_0x2a2fb7,_0xf705('0x23')));}fs[_0xf705('0x25')](_0x593180,csv(_0x4f5435));}})['then'](function(){if(_0x3f29c0){zipdir(path['join'](_0x2fb99e,_0x2a2fb7),{'saveTo':path['join'](_0x2fb99e,util['format'](_0xf705('0x24'),_0x2a2fb7,'zip'))},function(_0x58189f,_0x29ac24){});rimraf(path[_0xf705('0x21')](_0x2fb99e,_0x2a2fb7),function(){});}})[_0xf705('0x12')](function(){logger[_0xf705('0xb')](util[_0xf705('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xf705('0x26'),_0x3f29c0?util[_0xf705('0xc')](_0xf705('0x24'),_0x2a2fb7,_0x3f29c0?_0xf705('0x27'):_0xf705('0x23')):null);});})[_0xf705('0x28')](function(_0x3837c1){logger[_0xf705('0xb')](util['format'](_0xf705('0x29'),EXTRACTED_REPORT_ID,'CSV'),util[_0xf705('0x2a')](_0x3837c1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xf705('0x2b')](function(){process[_0xf705('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index ea1ebbf..6df1360 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 _0xcbeb=['/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','end','createPdfFromHTML','createPdfKitDocument','catch','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','pick','toString','value','fill','length','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','before','footer','Arial','black','right','num','Empty','basename','.pdf','join','%s.%s','pdf','Setting','find','splitSizePdf','split','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','existsSync','mkdirSync','all','then','flatten','%s%d.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xcbeb,0x112));var _0xbcbe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcbeb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbcbe('0x0'));var fs=require('fs');var util=require(_0xbcbe('0x1'));var path=require(_0xbcbe('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0xbcbe('0x3'));var PdfPrinter=require(_0xbcbe('0x4'));var zipdir=require(_0xbcbe('0x5'));var rimraf=require(_0xbcbe('0x6'));var JSDOM=require(_0xbcbe('0x7'))[_0xbcbe('0x8')];var window=new JSDOM('')[_0xbcbe('0x9')];var db=require(_0xbcbe('0xa'))['db'];var dbH=require(_0xbcbe('0xa'))['dbH'];var logger=require(_0xbcbe('0xb'))(_0xbcbe('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xbcbe('0xd')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbcbe('0xd')][0x5];var FORMAT=_0xbcbe('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4c1089,_0x523544){var _0x2a6a89={'status':_0x4c1089};var _0x3af072={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x523544){_0x2a6a89[_0xbcbe('0xf')]=_0x523544;}return db['AnalyticExtractedReport'][_0xbcbe('0x10')](_0x2a6a89,_0x3af072);}function getHeaders(_0x207723){return _[_0xbcbe('0x11')](_0x207723,function(_0x506081){return{'text':_0x506081,'style':'tableHeader'};});}function getRows(_0x3b6b91,_0x4598a3){return _['map'](_0x4598a3,function(_0x277a85){return _(_0x277a85)[_0xbcbe('0x12')](_0x3b6b91)[_0xbcbe('0x11')](function(_0x52a595){return _0x52a595?_[_0xbcbe('0x13')](_0x52a595):'';})[_0xbcbe('0x14')]();});}function createTable(_0x4e86bd,_0x25cb38){var _0x1f85b5={'widths':_[_0xbcbe('0x15')](Array(_0x4e86bd[_0xbcbe('0x16')]),0x91),'heights':function(_0x3dfff5){return _0x3dfff5===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4d4a03=getHeaders(_0x4e86bd);_0x1f85b5[_0xbcbe('0x17')][_0xbcbe('0x18')](_0x4d4a03);var _0xecc1b3=getRows(_0x4e86bd,_0x25cb38);_0x1f85b5[_0xbcbe('0x17')]=_0x1f85b5[_0xbcbe('0x17')][_0xbcbe('0x19')](_0xecc1b3);return _0x1f85b5;}function createTables(_0xc59c12){var _0x469dd1=[];var _0x261936=_[_0xbcbe('0x1a')](Object[_0xbcbe('0x1b')](_0xc59c12[0x0]),0x5);_0x261936[_0xbcbe('0x1c')](function(_0x1c64a4){_0x469dd1[_0xbcbe('0x18')](createTable(_0x1c64a4,_0xc59c12));});return _0x469dd1;}function getPDFDocDefinition(_0x359d39){var _0x4dd4da=util[_0xbcbe('0x1d')](_0xbcbe('0x1e'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xbcbe('0x1f')])[_0xbcbe('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0xbcbe('0x20')])[_0xbcbe('0x1d')](FORMAT));var _0x445c16=[];for(var _0x378206=0x0;_0x378206<_0x359d39[_0xbcbe('0x16')];_0x378206++){var _0x3319b8=[];if(_0x378206===0x0){_0x3319b8['push']({'text':_0x4dd4da,'style':'header'});}var _0x4f3dd0={'table':_0x359d39[_0x378206]};if(_0x378206>0x0){_0x4f3dd0['pageBreak']=_0xbcbe('0x21');_0x4f3dd0['margin']=[0x0,0x46,0x0,0x0];}_0x3319b8[_0xbcbe('0x18')](_0x4f3dd0);_0x445c16[_0xbcbe('0x18')](_0x3319b8);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x445c16,'footer':function(_0x46c465,_0x466287){return{'text':_0x46c465[_0xbcbe('0x13')]()+'\x20/\x20'+_0x466287,'style':_0xbcbe('0x22')};},'defaultStyle':{'font':_0xbcbe('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbcbe('0x24')},'footer':{'alignment':_0xbcbe('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x509cd1){var _0x1bb1ba=0x1388;var _0x314d7a;if(!_0x509cd1[0x0][_0xbcbe('0x26')]){return analyticExtractedReport(_0xbcbe('0x27'));}var _0x184d62=[];var _0x3242be=0x0;var _0x5910c7=!![];var _0x4f2d96=path['dirname'](PATH);var _0x327a82=path[_0xbcbe('0x28')](PATH,_0xbcbe('0x29'));var _0x5044b5=path[_0xbcbe('0x2a')](_0x4f2d96,util[_0xbcbe('0x1d')](_0xbcbe('0x2b'),_0x327a82,_0xbcbe('0x2c')));var _0x615bc7=![];return db[_0xbcbe('0x2d')][_0xbcbe('0x2e')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xbcbe('0x2f')]})['then'](function(_0x464deb){if(_0x464deb){_0x314d7a=_0x464deb;_0x1bb1ba=_0x314d7a[_0xbcbe('0x2f')]||0x3e8;}})['then'](function(){if(_0x509cd1&&_0x509cd1[_0xbcbe('0x16')]){var _0x357bd2=_0x509cd1[0x0][_0xbcbe('0x26')]%(_0x3242be+_0x1bb1ba);if(_0x314d7a[_0xbcbe('0x30')]){for(;_0x5910c7;_0x3242be+=_0x1bb1ba,_0x357bd2=_0x509cd1[0x0][_0xbcbe('0x26')]%(_0x3242be+_0x1bb1ba)){if(_0x357bd2==0x0||_0x357bd2==_0x509cd1[0x0]['num']){_0x5910c7=![];}_0x184d62[_0xbcbe('0x18')](dbH['sequelize'][_0xbcbe('0x31')](util[_0xbcbe('0x1d')](_0xbcbe('0x32'),QUERY,_0x1bb1ba,_0x3242be),{'type':dbH[_0xbcbe('0x33')][_0xbcbe('0x34')]['SELECT']}));}}else{_0x184d62[_0xbcbe('0x18')](dbH[_0xbcbe('0x33')]['query'](QUERY,{'type':dbH['sequelize'][_0xbcbe('0x34')]['SELECT']}));}}_0x615bc7=_0x314d7a[_0xbcbe('0x30')]&&_0x184d62[_0xbcbe('0x16')]>0x1;if(!fs[_0xbcbe('0x35')](path[_0xbcbe('0x2a')](_0x4f2d96,_0x327a82))&&_0x615bc7){fs[_0xbcbe('0x36')](path[_0xbcbe('0x2a')](_0x4f2d96,_0x327a82));}return Promise[_0xbcbe('0x37')](_0x184d62);})[_0xbcbe('0x38')](function(_0x3c1c1d){return createTables(_[_0xbcbe('0x39')](_0x3c1c1d));})[_0xbcbe('0x38')](function(_0x51b3a3){var _0x1c483a=getPDFDocDefinition(_0x51b3a3);var _0x8042e6=getPDFPrinter();var _0xa291b3=_0x8042e6['createPdfKitDocument'](_0x1c483a);if(_0x615bc7)_0x5044b5=path[_0xbcbe('0x2a')](_0x4f2d96,_0x327a82,util[_0xbcbe('0x1d')](_0xbcbe('0x3a'),_0x327a82,index,_0xbcbe('0x2c')));return writePDFDocument(_0xa291b3,_0x5044b5);})[_0xbcbe('0x38')](function(){if(!_0x615bc7)return;zipdir(path[_0xbcbe('0x2a')](_0x4f2d96,_0x327a82),{'saveTo':path['join'](_0x4f2d96,util[_0xbcbe('0x1d')]('%s.%s',_0x327a82,_0xbcbe('0x3b')))},function(_0x146640){if(_0x146640)throw _0x146640;return;});})[_0xbcbe('0x38')](function(){if(!_0x615bc7)return;rimraf(path[_0xbcbe('0x2a')](_0x4f2d96,_0x327a82),function(){});})[_0xbcbe('0x38')](function(){logger[_0xbcbe('0x3c')](util[_0xbcbe('0x1d')](_0xbcbe('0x3d'),EXTRACTED_REPORT_ID,_0xbcbe('0x3e')));return analyticExtractedReport('Completed',_0x615bc7?util[_0xbcbe('0x1d')](_0xbcbe('0x2b'),_0x327a82,_0x615bc7?_0xbcbe('0x3b'):_0xbcbe('0x2c')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xbcbe('0x3c')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0xbcbe('0x3f')][_0xbcbe('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbcbe('0x38')](function(_0x4fcdcd){EXTRACTED_REPORT=_0x4fcdcd;return dbH[_0xbcbe('0x33')][_0xbcbe('0x31')](util[_0xbcbe('0x1d')](_0xbcbe('0x41'),QUERY),{'type':dbH[_0xbcbe('0x33')]['QueryTypes'][_0xbcbe('0x42')]});})['then'](extractReport)['catch'](function(_0x5c4fc9){logger[_0xbcbe('0x3c')](util['format'](_0xbcbe('0x43'),EXTRACTED_REPORT_ID,_0xbcbe('0x44')),util[_0xbcbe('0x45')](_0x5c4fc9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbcbe('0x46'));})[_0xbcbe('0x47')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3977ba=new PdfPrinter({'Arial':{'normal':__dirname+_0xbcbe('0x48'),'bold':__dirname+_0xbcbe('0x49'),'italics':__dirname+_0xbcbe('0x4a'),'bolditalics':__dirname+_0xbcbe('0x4b')}});return _0x3977ba;}function getPDFDocDefinitionFromHTML(_0x216ef9,_0x4d6361){var _0x4524b3=util[_0xbcbe('0x1d')](_0xbcbe('0x4c'),_0x4d6361[_0xbcbe('0x4d')],_0x4d6361['interactionId']);var _0x3efa8c=moment()[_0xbcbe('0x1d')]('YYYY-MM-DD')[_0xbcbe('0x13')]();var _0x805130=htmlToPdfmake(_0x216ef9,{'window':window,'tableAutoSize':!![]});return{'content':[_0x805130],'defaultStyle':{'font':_0xbcbe('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xbcbe('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xbcbe('0x4e')}},'header':function(){return[{'text':_0xbcbe('0x4f'),'style':'header'}];},'footer':function(_0x16052c,_0xf08afb){return[{'text':util[_0xbcbe('0x1d')](_0xbcbe('0x50'),_0x4524b3,_0x16052c,_0xf08afb,_0x3efa8c),'style':'footer'}];}};}function writePDFDocument(_0x4c0c5c,_0x2a5be7){return new Promise(function(_0x344cc5,_0x5e6f8d){var _0x295a4a=_0x4c0c5c['pipe'](fs[_0xbcbe('0x51')](_0x2a5be7));_0x295a4a['on'](_0xbcbe('0x52'),function(){_0x344cc5(_0xbcbe('0x52'));});_0x295a4a['on']('error',function(_0x4332ea){_0x5e6f8d(_0x4332ea);});_0x4c0c5c[_0xbcbe('0x53')]();});}exports[_0xbcbe('0x54')]=function(_0x30a515,_0xd54111){var _0x31cf5d=getPDFPrinter();var _0x19e115=getPDFDocDefinitionFromHTML(_0x30a515,_0xd54111);var _0x33b3cc=_0x31cf5d[_0xbcbe('0x55')](_0x19e115);return writePDFDocument(_0x33b3cc,_0xd54111[_0xbcbe('0x2')])[_0xbcbe('0x56')](function(_0x5359ad){throw _0x5359ad;});}; \ No newline at end of file +var _0x31af=['%s\x20#%d','channel','interactionId','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','path','lodash','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','length','auto','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','pageBreak','before','margin','landscape','footer','Arial','black','num','Empty','basename','.pdf','join','%s.%s','pdf','find','split','splitSizePdf','then','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','mkdirSync','all','flatten','createPdfKitDocument','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf'];(function(_0x50f6e5,_0x151ccb){var _0x5988c5=function(_0x490a93){while(--_0x490a93){_0x50f6e5['push'](_0x50f6e5['shift']());}};_0x5988c5(++_0x151ccb);}(_0x31af,0x157));var _0xf31a=function(_0x572505,_0x22cf24){_0x572505=_0x572505-0x0;var _0x2cc11d=_0x31af[_0x572505];return _0x2cc11d;};'use strict';var _=require(_0xf31a('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0xf31a('0x1'));var PdfPrinter=require(_0xf31a('0x2'));var zipdir=require(_0xf31a('0x3'));var rimraf=require(_0xf31a('0x4'));var JSDOM=require(_0xf31a('0x5'))['JSDOM'];var window=new JSDOM('')['window'];var db=require(_0xf31a('0x6'))['db'];var dbH=require(_0xf31a('0x6'))[_0xf31a('0x7')];var logger=require(_0xf31a('0x8'))(_0xf31a('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xf31a('0xa')][0x2]);var QUERY=process[_0xf31a('0xa')][0x3];var PATH=process['argv'][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf31a('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2ff0ab,_0x4fed89){var _0x13f378={'status':_0x2ff0ab};var _0x5d5323={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4fed89){_0x13f378['savename']=_0x4fed89;}return db[_0xf31a('0xc')][_0xf31a('0xd')](_0x13f378,_0x5d5323);}function getHeaders(_0x1797ed){return _[_0xf31a('0xe')](_0x1797ed,function(_0x4b5132){return{'text':_0x4b5132,'style':_0xf31a('0xf')};});}function getRows(_0x45cee0,_0x4c44d6){return _[_0xf31a('0xe')](_0x4c44d6,function(_0x3ee440){return _(_0x3ee440)[_0xf31a('0x10')](_0x45cee0)[_0xf31a('0xe')](function(_0x4cd13a){return _0x4cd13a?_[_0xf31a('0x11')](_0x4cd13a):'';})[_0xf31a('0x12')]();});}function createTable(_0x54346d,_0x20800f){var _0x426fb3={'widths':_['fill'](Array(_0x54346d[_0xf31a('0x13')]),0x91),'heights':function(_0xd7064b){return _0xd7064b===0x0?_0xf31a('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x541398=getHeaders(_0x54346d);_0x426fb3[_0xf31a('0x15')][_0xf31a('0x16')](_0x541398);var _0x27bbf1=getRows(_0x54346d,_0x20800f);_0x426fb3[_0xf31a('0x15')]=_0x426fb3[_0xf31a('0x15')][_0xf31a('0x17')](_0x27bbf1);return _0x426fb3;}function createTables(_0x1f2b4b){var _0x9ca820=[];var _0x1f9b13=_[_0xf31a('0x18')](Object[_0xf31a('0x19')](_0x1f2b4b[0x0]),0x5);_0x1f9b13[_0xf31a('0x1a')](function(_0x549354){_0x9ca820[_0xf31a('0x16')](createTable(_0x549354,_0x1f2b4b));});return _0x9ca820;}function getPDFDocDefinition(_0x1f9745){var _0x3d4f03=util[_0xf31a('0x1b')](_0xf31a('0x1c'),NAME,EXTRACTED_REPORT[_0xf31a('0x1d')],moment(EXTRACTED_REPORT['startDate'])[_0xf31a('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0xf31a('0x1e')])['format'](FORMAT));var _0x26da15=[];for(var _0x1e7030=0x0;_0x1e7030<_0x1f9745[_0xf31a('0x13')];_0x1e7030++){var _0x434cf5=[];if(_0x1e7030===0x0){_0x434cf5['push']({'text':_0x3d4f03,'style':_0xf31a('0x1f')});}var _0x535248={'table':_0x1f9745[_0x1e7030]};if(_0x1e7030>0x0){_0x535248[_0xf31a('0x20')]=_0xf31a('0x21');_0x535248[_0xf31a('0x22')]=[0x0,0x46,0x0,0x0];}_0x434cf5[_0xf31a('0x16')](_0x535248);_0x26da15['push'](_0x434cf5);}return{'pageSize':'A4','pageOrientation':_0xf31a('0x23'),'content':_0x26da15,'footer':function(_0x5a618b,_0x41346d){return{'text':_0x5a618b[_0xf31a('0x11')]()+'\x20/\x20'+_0x41346d,'style':_0xf31a('0x24')};},'defaultStyle':{'font':_0xf31a('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xf31a('0x26')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x300970){var _0x14a2a2=0x1388;var _0x3f6b1f;if(!_0x300970[0x0][_0xf31a('0x27')]){return analyticExtractedReport(_0xf31a('0x28'));}var _0x5abe1a=[];var _0x3d0a9c=0x0;var _0x305dd0=!![];var _0x1ed5f9=path['dirname'](PATH);var _0x15a74e=path[_0xf31a('0x29')](PATH,_0xf31a('0x2a'));var _0x26e25d=path[_0xf31a('0x2b')](_0x1ed5f9,util['format'](_0xf31a('0x2c'),_0x15a74e,_0xf31a('0x2d')));var _0x18a1b9=![];return db['Setting'][_0xf31a('0x2e')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf31a('0x2f'),_0xf31a('0x30')]})[_0xf31a('0x31')](function(_0x53f27a){if(_0x53f27a){_0x3f6b1f=_0x53f27a;_0x14a2a2=_0x3f6b1f[_0xf31a('0x30')]||0x3e8;}})[_0xf31a('0x31')](function(){if(_0x300970&&_0x300970['length']){var _0x5176de=_0x300970[0x0][_0xf31a('0x27')]%(_0x3d0a9c+_0x14a2a2);if(_0x3f6b1f['split']){for(;_0x305dd0;_0x3d0a9c+=_0x14a2a2,_0x5176de=_0x300970[0x0][_0xf31a('0x27')]%(_0x3d0a9c+_0x14a2a2)){if(_0x5176de==0x0||_0x5176de==_0x300970[0x0][_0xf31a('0x27')]){_0x305dd0=![];}_0x5abe1a['push'](dbH[_0xf31a('0x32')][_0xf31a('0x33')](util['format'](_0xf31a('0x34'),QUERY,_0x14a2a2,_0x3d0a9c),{'type':dbH[_0xf31a('0x32')]['QueryTypes'][_0xf31a('0x35')]}));}}else{_0x5abe1a[_0xf31a('0x16')](dbH[_0xf31a('0x32')][_0xf31a('0x33')](QUERY,{'type':dbH[_0xf31a('0x32')]['QueryTypes']['SELECT']}));}}_0x18a1b9=_0x3f6b1f[_0xf31a('0x2f')]&&_0x5abe1a[_0xf31a('0x13')]>0x1;if(!fs['existsSync'](path[_0xf31a('0x2b')](_0x1ed5f9,_0x15a74e))&&_0x18a1b9){fs[_0xf31a('0x36')](path[_0xf31a('0x2b')](_0x1ed5f9,_0x15a74e));}return Promise[_0xf31a('0x37')](_0x5abe1a);})[_0xf31a('0x31')](function(_0x34796d){return createTables(_[_0xf31a('0x38')](_0x34796d));})[_0xf31a('0x31')](function(_0x370997){var _0x38537c=getPDFDocDefinition(_0x370997);var _0x6e5f4f=getPDFPrinter();var _0x3f67b2=_0x6e5f4f[_0xf31a('0x39')](_0x38537c);if(_0x18a1b9)_0x26e25d=path[_0xf31a('0x2b')](_0x1ed5f9,_0x15a74e,util[_0xf31a('0x1b')]('%s%d.%s',_0x15a74e,index,'pdf'));return writePDFDocument(_0x3f67b2,_0x26e25d);})[_0xf31a('0x31')](function(){if(!_0x18a1b9)return;zipdir(path['join'](_0x1ed5f9,_0x15a74e),{'saveTo':path[_0xf31a('0x2b')](_0x1ed5f9,util[_0xf31a('0x1b')](_0xf31a('0x2c'),_0x15a74e,_0xf31a('0x3a')))},function(_0x5e27be){if(_0x5e27be)throw _0x5e27be;return;});})[_0xf31a('0x31')](function(){if(!_0x18a1b9)return;rimraf(path[_0xf31a('0x2b')](_0x1ed5f9,_0x15a74e),function(){});})['then'](function(){logger[_0xf31a('0x3b')](util[_0xf31a('0x1b')](_0xf31a('0x3c'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xf31a('0x3d'),_0x18a1b9?util[_0xf31a('0x1b')](_0xf31a('0x2c'),_0x15a74e,_0x18a1b9?_0xf31a('0x3a'):'pdf'):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xf31a('0x3b')](util[_0xf31a('0x1b')](_0xf31a('0x3e'),EXTRACTED_REPORT_ID,_0xf31a('0x3f')));return db[_0xf31a('0xc')][_0xf31a('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf31a('0x31')](function(_0x107d7e){EXTRACTED_REPORT=_0x107d7e;return dbH[_0xf31a('0x32')][_0xf31a('0x33')](util[_0xf31a('0x1b')](_0xf31a('0x41'),QUERY),{'type':dbH[_0xf31a('0x32')]['QueryTypes']['SELECT']});})[_0xf31a('0x31')](extractReport)[_0xf31a('0x42')](function(_0x2232b8){logger[_0xf31a('0x3b')](util['format'](_0xf31a('0x43'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x2232b8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xf31a('0x44')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x190e09=new PdfPrinter({'Arial':{'normal':__dirname+_0xf31a('0x45'),'bold':__dirname+_0xf31a('0x46'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xf31a('0x47')}});return _0x190e09;}function getPDFDocDefinitionFromHTML(_0x4a82f3,_0x207fb3){var _0x1e79eb=util[_0xf31a('0x1b')](_0xf31a('0x48'),_0x207fb3[_0xf31a('0x49')],_0x207fb3[_0xf31a('0x4a')]);var _0x453cc6=moment()['format']('YYYY-MM-DD')[_0xf31a('0x11')]();var _0x54bcd3=htmlToPdfmake(_0x4a82f3,{'window':window,'tableAutoSize':!![]});return{'content':[_0x54bcd3],'defaultStyle':{'font':_0xf31a('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xf31a('0x4b'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xf31a('0x4b'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xf31a('0x4c'),'style':'header'}];},'footer':function(_0x4ec760,_0x31579e){return[{'text':util[_0xf31a('0x1b')](_0xf31a('0x4d'),_0x1e79eb,_0x4ec760,_0x31579e,_0x453cc6),'style':_0xf31a('0x24')}];}};}function writePDFDocument(_0x3119fd,_0x484988){return new Promise(function(_0x3abb89,_0x2f4bc3){var _0x345cab=_0x3119fd[_0xf31a('0x4e')](fs[_0xf31a('0x4f')](_0x484988));_0x345cab['on']('finish',function(){_0x3abb89(_0xf31a('0x50'));});_0x345cab['on'](_0xf31a('0x51'),function(_0x30011c){_0x2f4bc3(_0x30011c);});_0x3119fd['end']();});}exports['createPdfFromHTML']=function(_0x3942ff,_0x28cb55){var _0x32c0fa=getPDFPrinter();var _0x2e8e45=getPDFDocDefinitionFromHTML(_0x3942ff,_0x28cb55);var _0x3c2161=_0x32c0fa[_0xf31a('0x39')](_0x2e8e45);return writePDFDocument(_0x3c2161,_0x28cb55[_0xf31a('0x52')])[_0xf31a('0x42')](function(_0x548abe){throw _0x548abe;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 4838bfe..6456176 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 _0xf198=['../../mysqldb','analytics','argv','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','num','Empty','length','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','split','existsSync','join','mkdirSync','each','xlsx','%s.%s','binary','format','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','path','lodash','json2xls','bluebird','rimraf'];(function(_0x183872,_0x34220e){var _0x478356=function(_0x1026a3){while(--_0x1026a3){_0x183872['push'](_0x183872['shift']());}};_0x478356(++_0x34220e);}(_0xf198,0xe0));var _0x8f19=function(_0x55c16b,_0x36ebba){_0x55c16b=_0x55c16b-0x0;var _0x5ec0ab=_0xf198[_0x55c16b];return _0x5ec0ab;};'use strict';var util=require(_0x8f19('0x0'));var path=require(_0x8f19('0x1'));var _=require(_0x8f19('0x2'));var fs=require('fs');var json2xls=require(_0x8f19('0x3'));var BPromise=require(_0x8f19('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x8f19('0x5'));var db=require(_0x8f19('0x6'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')(_0x8f19('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x8f19('0x8')][0x3];var PATH=process[_0x8f19('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1006b3,_0x4f2fa1){var _0x20be5f={'status':_0x1006b3};var _0xf0b687={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4f2fa1){_0x20be5f['savename']=_0x4f2fa1;}return db['AnalyticExtractedReport'][_0x8f19('0x9')](_0x20be5f,_0xf0b687);}function main(){var _0x136789=0x1388;var _0x5d26cc;logger[_0x8f19('0xa')](util['format'](_0x8f19('0xb'),EXTRACTED_REPORT_ID,_0x8f19('0xc')));return db['Setting'][_0x8f19('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x8f19('0xe')]})[_0x8f19('0xf')](function(_0x581b0c){if(_0x581b0c){_0x5d26cc=_0x581b0c;_0x136789=_0x5d26cc[_0x8f19('0xe')]||0x1388;}})[_0x8f19('0xf')](function(){return dbH['sequelize']['query'](util['format'](_0x8f19('0x10'),QUERY),{'type':dbH[_0x8f19('0x11')][_0x8f19('0x12')]['SELECT']});})[_0x8f19('0xf')](function(_0x10a4b6){if(!_0x10a4b6[0x0][_0x8f19('0x13')]){return analyticExtractedReport(_0x8f19('0x14'));}var _0x135741=[];var _0x4137be=0x0;var _0x59c93f=!![];if(_0x5d26cc['split']){if(_0x10a4b6&&_0x10a4b6[_0x8f19('0x15')]){var _0x4d671b=_0x10a4b6[0x0][_0x8f19('0x13')]%(_0x4137be+_0x136789);for(;_0x59c93f;_0x4137be+=_0x136789,_0x4d671b=_0x10a4b6[0x0][_0x8f19('0x13')]%(_0x4137be+_0x136789)){if(_0x4d671b==0x0||_0x4d671b==_0x10a4b6[0x0][_0x8f19('0x13')]){_0x59c93f=![];}_0x135741[_0x8f19('0x16')](dbH['sequelize'][_0x8f19('0x17')](util['format'](_0x8f19('0x18'),QUERY,_0x136789,_0x4137be),{'type':dbH[_0x8f19('0x11')][_0x8f19('0x12')][_0x8f19('0x19')]}));}}}else{_0x135741['push'](dbH[_0x8f19('0x11')]['query'](QUERY,{'type':dbH[_0x8f19('0x11')][_0x8f19('0x12')]['SELECT']}));}var _0x52dd83=path[_0x8f19('0x1a')](PATH);var _0x3317ee=path[_0x8f19('0x1b')](PATH,_0x8f19('0x1c'));var _0x21d99b=_0x5d26cc[_0x8f19('0x1d')]&&_0x135741[_0x8f19('0x15')]>0x1;var _0x417a00=[];if(!fs[_0x8f19('0x1e')](path[_0x8f19('0x1f')](_0x52dd83,_0x3317ee))&&_0x21d99b){fs[_0x8f19('0x20')](path[_0x8f19('0x1f')](_0x52dd83,_0x3317ee));}return BPromise[_0x8f19('0x21')](_0x135741,function(_0x552263){_0x417a00[_0x8f19('0x16')](_0x552263);})[_0x8f19('0xf')](function(){for(var _0x5b0ef6=0x0;_0x5b0ef6<_0x417a00[_0x8f19('0x15')];_0x5b0ef6+=0x1){var _0x2d539f;var _0x3d0e31=_0x417a00[_0x5b0ef6];if(_0x21d99b){_0x2d539f=path['join'](_0x52dd83,_0x3317ee,util['format']('%s%d.%s',_0x3317ee,_0x5b0ef6,_0x8f19('0x22')));}else{_0x2d539f=path['join'](_0x52dd83,util['format'](_0x8f19('0x23'),_0x3317ee,_0x8f19('0x22')));}fs['writeFileSync'](_0x2d539f,json2xls(_0x3d0e31),_0x8f19('0x24'));}})['then'](function(){if(_0x21d99b){zipdir(path[_0x8f19('0x1f')](_0x52dd83,_0x3317ee),{'saveTo':path[_0x8f19('0x1f')](_0x52dd83,util[_0x8f19('0x25')](_0x8f19('0x23'),_0x3317ee,_0x8f19('0x26')))},function(_0x3b1d97,_0x46d579){});rimraf(path[_0x8f19('0x1f')](_0x52dd83,_0x3317ee),function(){});}})['then'](function(){logger[_0x8f19('0xa')](util[_0x8f19('0x25')](_0x8f19('0x27'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x8f19('0x28'),_0x21d99b?util[_0x8f19('0x25')]('%s.%s',_0x3317ee,_0x21d99b?_0x8f19('0x26'):_0x8f19('0x22')):null);});})[_0x8f19('0x29')](function(_0x11912d){logger[_0x8f19('0xa')](util[_0x8f19('0x25')](_0x8f19('0x2a'),EXTRACTED_REPORT_ID,_0x8f19('0xc')),util[_0x8f19('0x2b')](_0x11912d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x8f19('0x2c')](function(){process[_0x8f19('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x6d9a=['savename','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','sequelize','query','QueryTypes','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv'];(function(_0x140202,_0x4245c7){var _0x3037c2=function(_0x525d19){while(--_0x525d19){_0x140202['push'](_0x140202['shift']());}};_0x3037c2(++_0x4245c7);}(_0x6d9a,0xf8));var _0xa6d9=function(_0x4d55e3,_0x23684e){_0x4d55e3=_0x4d55e3-0x0;var _0x468009=_0x6d9a[_0x4d55e3];return _0x468009;};'use strict';var util=require(_0xa6d9('0x0'));var path=require(_0xa6d9('0x1'));var _=require(_0xa6d9('0x2'));var fs=require('fs');var json2xls=require(_0xa6d9('0x3'));var BPromise=require(_0xa6d9('0x4'));var zipdir=require(_0xa6d9('0x5'));var rimraf=require(_0xa6d9('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0xa6d9('0x7'))[_0xa6d9('0x8')];var logger=require(_0xa6d9('0x9'))(_0xa6d9('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xa6d9('0xb')][0x3];var PATH=process[_0xa6d9('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4969ff,_0x16f789){var _0x1ea3ae={'status':_0x4969ff};var _0x4088ad={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x16f789){_0x1ea3ae[_0xa6d9('0xc')]=_0x16f789;}return db['AnalyticExtractedReport'][_0xa6d9('0xd')](_0x1ea3ae,_0x4088ad);}function main(){var _0x4bdac9=0x1388;var _0x4fb23b;logger['info'](util[_0xa6d9('0xe')](_0xa6d9('0xf'),EXTRACTED_REPORT_ID,_0xa6d9('0x10')));return db[_0xa6d9('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa6d9('0x12'),_0xa6d9('0x13')]})[_0xa6d9('0x14')](function(_0x1076a6){if(_0x1076a6){_0x4fb23b=_0x1076a6;_0x4bdac9=_0x4fb23b[_0xa6d9('0x13')]||0x1388;}})['then'](function(){return dbH[_0xa6d9('0x15')][_0xa6d9('0x16')](util[_0xa6d9('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0xa6d9('0x17')]['SELECT']});})[_0xa6d9('0x14')](function(_0x162aea){if(!_0x162aea[0x0][_0xa6d9('0x18')]){return analyticExtractedReport(_0xa6d9('0x19'));}var _0x2a7108=[];var _0x5cdae2=0x0;var _0x26c919=!![];if(_0x4fb23b['split']){if(_0x162aea&&_0x162aea[_0xa6d9('0x1a')]){var _0x512f98=_0x162aea[0x0][_0xa6d9('0x18')]%(_0x5cdae2+_0x4bdac9);for(;_0x26c919;_0x5cdae2+=_0x4bdac9,_0x512f98=_0x162aea[0x0][_0xa6d9('0x18')]%(_0x5cdae2+_0x4bdac9)){if(_0x512f98==0x0||_0x512f98==_0x162aea[0x0][_0xa6d9('0x18')]){_0x26c919=![];}_0x2a7108[_0xa6d9('0x1b')](dbH[_0xa6d9('0x15')][_0xa6d9('0x16')](util[_0xa6d9('0xe')](_0xa6d9('0x1c'),QUERY,_0x4bdac9,_0x5cdae2),{'type':dbH[_0xa6d9('0x15')][_0xa6d9('0x17')][_0xa6d9('0x1d')]}));}}}else{_0x2a7108['push'](dbH[_0xa6d9('0x15')][_0xa6d9('0x16')](QUERY,{'type':dbH[_0xa6d9('0x15')][_0xa6d9('0x17')][_0xa6d9('0x1d')]}));}var _0x890fcf=path[_0xa6d9('0x1e')](PATH);var _0x5ddae2=path[_0xa6d9('0x1f')](PATH,_0xa6d9('0x20'));var _0x20fd2c=_0x4fb23b['split']&&_0x2a7108[_0xa6d9('0x1a')]>0x1;var _0x389b13=[];if(!fs[_0xa6d9('0x21')](path[_0xa6d9('0x22')](_0x890fcf,_0x5ddae2))&&_0x20fd2c){fs[_0xa6d9('0x23')](path['join'](_0x890fcf,_0x5ddae2));}return BPromise[_0xa6d9('0x24')](_0x2a7108,function(_0x231513){_0x389b13[_0xa6d9('0x1b')](_0x231513);})['then'](function(){for(var _0x5558b8=0x0;_0x5558b8<_0x389b13['length'];_0x5558b8+=0x1){var _0x4c530d;var _0x3fd64e=_0x389b13[_0x5558b8];if(_0x20fd2c){_0x4c530d=path[_0xa6d9('0x22')](_0x890fcf,_0x5ddae2,util[_0xa6d9('0xe')](_0xa6d9('0x25'),_0x5ddae2,_0x5558b8,_0xa6d9('0x26')));}else{_0x4c530d=path[_0xa6d9('0x22')](_0x890fcf,util['format'](_0xa6d9('0x27'),_0x5ddae2,_0xa6d9('0x26')));}fs[_0xa6d9('0x28')](_0x4c530d,json2xls(_0x3fd64e),_0xa6d9('0x29'));}})[_0xa6d9('0x14')](function(){if(_0x20fd2c){zipdir(path[_0xa6d9('0x22')](_0x890fcf,_0x5ddae2),{'saveTo':path[_0xa6d9('0x22')](_0x890fcf,util[_0xa6d9('0xe')](_0xa6d9('0x27'),_0x5ddae2,_0xa6d9('0x2a')))},function(_0x559246,_0x36409b){});rimraf(path['join'](_0x890fcf,_0x5ddae2),function(){});}})[_0xa6d9('0x14')](function(){logger[_0xa6d9('0x2b')](util[_0xa6d9('0xe')](_0xa6d9('0x2c'),EXTRACTED_REPORT_ID,_0xa6d9('0x10')));return analyticExtractedReport(_0xa6d9('0x2d'),_0x20fd2c?util[_0xa6d9('0xe')]('%s.%s',_0x5ddae2,_0x20fd2c?_0xa6d9('0x2a'):_0xa6d9('0x26')):null);});})[_0xa6d9('0x2e')](function(_0x144fe6){logger[_0xa6d9('0x2b')](util[_0xa6d9('0xe')](_0xa6d9('0x2f'),EXTRACTED_REPORT_ID,_0xa6d9('0x10')),util[_0xa6d9('0x30')](_0x144fe6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa6d9('0x31'));})[_0xa6d9('0x32')](function(){process[_0xa6d9('0x33')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index b41bcd8..ef5d8be 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 _0x4312=['XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','catch','error','rewrite','lodash','util','Interval','intervals','models','VoiceExtension','findAll','IntervalId','then','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','VoiceExtensionId','CDR(routeid)=','context','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','updatedAt','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer'];(function(_0x9271d4,_0x4fe4bb){var _0x1387cb=function(_0x1acde6){while(--_0x1acde6){_0x9271d4['push'](_0x9271d4['shift']());}};_0x1387cb(++_0x4fe4bb);}(_0x4312,0x9c));var _0x2431=function(_0x1fcb67,_0x70fb6c){_0x1fcb67=_0x1fcb67-0x0;var _0x17a001=_0x4312[_0x1fcb67];return _0x17a001;};'use strict';var _=require(_0x2431('0x0'));var util=require(_0x2431('0x1'));function rewrite(_0xd9961d,_0x22cedb){var _0x36cc73=this;return _0xd9961d['models'][_0x2431('0x2')]['findAll']({'raw':!![]})['then'](function(_0x173bfd){_0x36cc73[_0x2431('0x3')]=_0x173bfd;return _0xd9961d[_0x2431('0x4')][_0x2431('0x5')][_0x2431('0x6')]({'where':{'IntervalId':_0x22cedb[_0x2431('0x7')]},'raw':!![]});})[_0x2431('0x8')](function(_0x2a3133){return _0xd9961d[_0x2431('0x4')][_0x2431('0x5')][_0x2431('0x6')]({'where':{'exten':{'$in':_[_0x2431('0x9')](_[_0x2431('0xa')](_0x2a3133,'exten'))}},'order':[{'raw':_0x2431('0xb')}],'raw':!![]});})[_0x2431('0x8')](function(_0x4d07db){var _0x910068=_[_0x2431('0xc')](_0x4d07db,{'priority':'1'});var _0x2b0555=_[_0x2431('0xc')](_0x4d07db,{'isApp':0x1});var _0x1e7e3b=_[_0x2431('0xd')](_0x2b0555,_0x2431('0xe'));var _0x49fcda=[_0x2431('0xf'),'playback'];var _0x4a12bf=[];var _0x389458=[];for(var _0x55d84c in _0x1e7e3b){if(_0x1e7e3b['hasOwnProperty'](_0x55d84c)){_0x36cc73[_0x2431('0x10')]=0x2;_0x36cc73[_0x2431('0x11')]=[];_0x36cc73[_0x2431('0x12')]=_[_0x2431('0x13')](_0x910068,{'exten':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0xe')]});_0x36cc73['extensions'][_0x2431('0x14')]({'type':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x15')],'app':_0x2431('0x16'),'appdata':util[_0x2431('0x17')](_0x2431('0x18'),_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x15')]),'context':_0x1e7e3b[_0x55d84c][0x0]['context'],'exten':_0x1e7e3b[_0x55d84c][0x0]['exten'],'priority':_0x36cc73[_0x2431('0x10')]++,'VoiceExtensionId':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x19')]});if(_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x15')]==='inbound'){_0x36cc73['extensions'][_0x2431('0x14')]({'type':_0x1e7e3b[_0x55d84c][0x0]['type'],'app':_0x2431('0x16'),'appdata':_0x2431('0x1a')+_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x19')],'context':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x1b')],'exten':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0xe')],'priority':_0x36cc73[_0x2431('0x10')]++,'VoiceExtensionId':_0x1e7e3b[_0x55d84c][0x0]['VoiceExtensionId']});}else if(_0x1e7e3b[_0x55d84c][0x0]['type']===_0x2431('0x1c')){if(_0x36cc73[_0x2431('0x12')]){_0x36cc73[_0x2431('0x11')][_0x2431('0x14')]({'type':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x15')],'app':_0x2431('0x16'),'appdata':_0x2431('0x1d')+(_0x36cc73[_0x2431('0x12')][_0x2431('0x1e')]?'${EXTEN:'+_0x36cc73['extension'][_0x2431('0x1e')]+'}':_0x2431('0x1f')),'context':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x1b')],'exten':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0xe')],'priority':_0x36cc73['priority']++,'VoiceExtensionId':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x19')]});}_0x36cc73[_0x2431('0x11')][_0x2431('0x14')]({'type':_0x1e7e3b[_0x55d84c][0x0]['type'],'app':_0x2431('0x16'),'appdata':_0x2431('0x1a')+_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x19')],'context':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x1b')],'exten':_0x1e7e3b[_0x55d84c][0x0]['exten'],'priority':_0x36cc73[_0x2431('0x10')]++,'VoiceExtensionId':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x19')]});var _0x125e55=_0x36cc73['priority']++;_0x36cc73['extensions'][_0x2431('0x14')]({'type':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x15')],'app':_0x2431('0x20'),'appdata':_0x2431('0x21')+(_0x125e55+0x2)+'):Goto('+(_0x125e55+0x1)+')','context':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x1b')],'exten':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0xe')],'priority':_0x125e55,'VoiceExtensionId':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x19')]});if(_0x36cc73['extension']){_0x36cc73['extensions'][_0x2431('0x14')]({'type':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x15')],'app':_0x2431('0x16'),'appdata':_0x36cc73[_0x2431('0x12')][_0x2431('0x1e')]?_0x2431('0x22')+_0x36cc73[_0x2431('0x12')][_0x2431('0x1e')]+'}':_0x2431('0x23'),'context':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x1b')],'exten':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0xe')],'priority':_0x36cc73[_0x2431('0x10')]++,'VoiceExtensionId':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x19')]});}_0x36cc73[_0x2431('0x11')][_0x2431('0x14')]({'type':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x15')],'app':_0x2431('0x16'),'appdata':_0x2431('0x24')+_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x19')],'context':_0x1e7e3b[_0x55d84c][0x0]['context'],'exten':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0xe')],'priority':_0x36cc73[_0x2431('0x10')]++,'VoiceExtensionId':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x19')]});if(_0x36cc73['extension']&&_0x36cc73['extension'][_0x2431('0x25')](_0x2431('0x26'))&&_0x36cc73[_0x2431('0x12')][_0x2431('0x26')]!==_0x2431('0x27')){_0x36cc73['extensions']['push']({'type':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x15')],'app':_0x2431('0x16'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x1b')],'exten':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0xe')],'priority':_0x36cc73[_0x2431('0x10')]++,'VoiceExtensionId':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x19')]});_0x36cc73['extensions'][_0x2431('0x14')]({'type':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x15')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x36cc73[_0x2431('0x12')][_0x2431('0x26')]||_0x2431('0x28'),'context':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x1b')],'exten':_0x1e7e3b[_0x55d84c][0x0]['exten'],'priority':_0x36cc73[_0x2431('0x10')]++,'VoiceExtensionId':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x19')]});}}_0x36cc73['extensions'][_0x2431('0x14')]({'type':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x15')],'app':'Set','appdata':_0x2431('0x29'),'context':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x1b')],'exten':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0xe')],'priority':_0x36cc73[_0x2431('0x10')]++,'VoiceExtensionId':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x19')]});_0x36cc73[_0x2431('0x11')][_0x2431('0x14')]({'type':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x15')],'app':_0x2431('0x16'),'appdata':_0x2431('0x2a'),'context':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x1b')],'exten':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0xe')],'priority':_0x36cc73[_0x2431('0x10')]++,'VoiceExtensionId':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x19')]});_0x36cc73[_0x2431('0x11')]['push']({'type':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x15')],'app':_0x2431('0x16'),'appdata':_0x2431('0x2b'),'context':_0x1e7e3b[_0x55d84c][0x0]['context'],'exten':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0xe')],'priority':_0x36cc73[_0x2431('0x10')]++,'VoiceExtensionId':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x19')]});for(var _0xed3852=0x0,_0x272ab3=0x0;_0xed3852<_0x1e7e3b[_0x55d84c][_0x2431('0x2c')];_0xed3852+=0x1,_0x272ab3=0x0){var _0x428213=_0x1e7e3b[_0x55d84c][_0xed3852];if(_0x428213['type']){_0x428213[_0x2431('0x15')]=_0x428213[_0x2431('0x15')]['toLowerCase']();}var _0x20897f=[];var _0x346ad8=[];delete _0x428213['id'];delete _0x428213['createdAt'];delete _0x428213[_0x2431('0x2d')];var _0x1e1b76=_0x428213[_0x2431('0x2e')]!=='*,*,*,*'?[_0x428213[_0x2431('0x2e')]]:_0x428213['IntervalId']?_['map'](_[_0x2431('0xc')](_0x36cc73[_0x2431('0x3')],{'IntervalId':_0x428213[_0x2431('0x7')]}),_0x2431('0x2e')):[];if(_0x428213[_0x2431('0x25')](_0x2431('0x2f'))){if(_0x428213[_0x2431('0x2f')]&&_0x428213[_0x2431('0x2f')]!=='--'){_0x20897f[_0x2431('0x14')]({'type':_0x428213['type'],'app':_0x2431('0x16'),'appdata':_0x2431('0x30')+_0x428213[_0x2431('0x2f')],'context':_0x428213[_0x2431('0x1b')],'exten':_0x428213[_0x2431('0xe')],'priority':_0x1e1b76[_0x2431('0x2c')]+_0x36cc73[_0x2431('0x10')]+_0x272ab3++,'VoiceExtensionId':_0x428213[_0x2431('0x19')]});}}if(_0x428213[_0x2431('0x15')]===_0x2431('0x1c')&&_0x428213[_0x2431('0x25')](_0x2431('0x31'))){if(_0x428213[_0x2431('0x31')]){_0x20897f['push']({'type':_0x428213[_0x2431('0x15')],'app':_0x2431('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x428213[_0x2431('0x31')]+')','context':_0x428213['context'],'exten':_0x428213[_0x2431('0xe')],'priority':_0x1e1b76[_0x2431('0x2c')]+_0x36cc73[_0x2431('0x10')]+_0x272ab3++,'VoiceExtensionId':_0x428213['VoiceExtensionId']});}else{_0x20897f[_0x2431('0x14')]({'type':_0x428213[_0x2431('0x15')],'app':_0x2431('0x20'),'appdata':_0x2431('0x32'),'context':_0x428213[_0x2431('0x1b')],'exten':_0x428213[_0x2431('0xe')],'priority':_0x1e1b76['length']+_0x36cc73[_0x2431('0x10')]+_0x272ab3++,'VoiceExtensionId':_0x428213[_0x2431('0x19')]});}}if(_0x428213[_0x2431('0x25')](_0x2431('0x33'))){if(_0x49fcda[_0x2431('0x34')](_0x428213[_0x2431('0x35')][_0x2431('0x36')]())>=0x0&&_0x428213[_0x2431('0x37')]!=='custom'){if(_0x428213[_0x2431('0x33')]){_0x20897f['push']({'type':_0x428213['type'],'app':'ExecIf','appdata':_0x2431('0x38'),'context':_0x428213['context'],'exten':_0x428213['exten'],'priority':_0x1e1b76[_0x2431('0x2c')]+_0x36cc73['priority']+_0x272ab3++,'VoiceExtensionId':_0x428213[_0x2431('0x19')]});_0x20897f[_0x2431('0x14')]({'type':_0x428213[_0x2431('0x15')],'app':'Set','appdata':_0x2431('0x39'),'context':_0x428213[_0x2431('0x1b')],'exten':_0x428213[_0x2431('0xe')],'priority':_0x1e1b76[_0x2431('0x2c')]+_0x36cc73[_0x2431('0x10')]+_0x272ab3++,'VoiceExtensionId':_0x428213[_0x2431('0x19')]});}else{_0x20897f['push']({'type':_0x428213[_0x2431('0x15')],'app':_0x2431('0x20'),'appdata':_0x2431('0x3a'),'context':_0x428213[_0x2431('0x1b')],'exten':_0x428213[_0x2431('0xe')],'priority':_0x1e1b76['length']+_0x36cc73['priority']+_0x272ab3++,'VoiceExtensionId':_0x428213['VoiceExtensionId']});_0x20897f[_0x2431('0x14')]({'type':_0x428213['type'],'app':_0x2431('0x16'),'appdata':_0x2431('0x3b'),'context':_0x428213[_0x2431('0x1b')],'exten':_0x428213[_0x2431('0xe')],'priority':_0x1e1b76['length']+_0x36cc73[_0x2431('0x10')]+_0x272ab3++,'VoiceExtensionId':_0x428213[_0x2431('0x19')]});}}}for(var _0x63fbb6=0x0;_0x63fbb6<_0x1e1b76[_0x2431('0x2c')];_0x63fbb6+=0x1){var _0x24b96c=_0x36cc73[_0x2431('0x10')]+_0x1e1b76['length'];var _0x2e17a7=_0x63fbb6===_0x1e1b76[_0x2431('0x2c')]-0x1?_0x36cc73['priority']+_0x20897f[_0x2431('0x2c')]+_0x346ad8['length']+0x2:_0x36cc73[_0x2431('0x10')]+_0x63fbb6+0x1;_0x20897f[_0x2431('0x3c')](_0x63fbb6,0x0,{'type':_0x428213[_0x2431('0x15')],'app':_0x2431('0x3d'),'appdata':_0x1e1b76[_0x63fbb6]+'?'+_0x428213[_0x2431('0x1b')]+_0x2431('0x3e')+_0x24b96c+':'+_0x428213[_0x2431('0x1b')]+_0x2431('0x3e')+_0x2e17a7,'exten':_0x428213[_0x2431('0xe')],'context':_0x428213[_0x2431('0x1b')],'priority':_0x36cc73[_0x2431('0x10')]+_0x63fbb6,'VoiceExtensionId':_0x1e7e3b[_0x55d84c][0x0]['VoiceExtensionId']});}_0x428213['priority']=_0x20897f[_0x2431('0x2c')]?_[_0x2431('0x3f')](_0x20897f)[_0x2431('0x10')]+0x1:_0x36cc73[_0x2431('0x10')];_0x36cc73[_0x2431('0x10')]=(_0x346ad8[_0x2431('0x2c')]?_[_0x2431('0x3f')](_0x346ad8)[_0x2431('0x10')]:_0x428213[_0x2431('0x10')])+0x1;_0x36cc73['extensions']=_[_0x2431('0x40')](_0x36cc73[_0x2431('0x11')],_0x20897f,[_0x428213],_0x346ad8);}_0x36cc73['extensions'][_0x2431('0x14')]({'type':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x15')],'app':_0x2431('0x41'),'exten':_0x1e7e3b[_0x55d84c][0x0]['exten'],'context':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x1b')],'priority':_0x36cc73[_0x2431('0x10')],'VoiceExtensionId':_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x19')]});_0x4a12bf[_0x2431('0x14')](_0x1e7e3b[_0x55d84c][0x0][_0x2431('0x19')]);_0x389458=_[_0x2431('0x40')](_0x389458,_0x36cc73[_0x2431('0x11')]);}}return _0xd9961d[_0x2431('0x42')](function(_0x13a7be){return _0xd9961d[_0x2431('0x4')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x4a12bf}},'transaction':_0x13a7be})['then'](function(_0x1ef7ea){return _0xd9961d[_0x2431('0x4')][_0x2431('0x5')][_0x2431('0x43')](_['sortBy'](_0x389458,_0x2431('0x10')),{'transaction':_0x13a7be});});});})[_0x2431('0x44')](function(_0x15cb7c){console[_0x2431('0x45')](_0x15cb7c);});}exports[_0x2431('0x46')]=rewrite; \ No newline at end of file +var _0x5fb3=['updatedAt','interval','*,*,*,*','tag','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','destroy','bulkCreate','sortBy','catch','lodash','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt'];(function(_0x5baa5e,_0xeebb46){var _0x1504a3=function(_0x380fb1){while(--_0x380fb1){_0x5baa5e['push'](_0x5baa5e['shift']());}};_0x1504a3(++_0xeebb46);}(_0x5fb3,0x1bd));var _0x35fb=function(_0x5960d2,_0x572552){_0x5960d2=_0x5960d2-0x0;var _0xf40191=_0x5fb3[_0x5960d2];return _0xf40191;};'use strict';var _=require(_0x35fb('0x0'));var util=require('util');function rewrite(_0x4bf00f,_0xc10a0b){var _0x1ce853=this;return _0x4bf00f[_0x35fb('0x1')][_0x35fb('0x2')][_0x35fb('0x3')]({'raw':!![]})[_0x35fb('0x4')](function(_0x10f571){_0x1ce853[_0x35fb('0x5')]=_0x10f571;return _0x4bf00f[_0x35fb('0x1')][_0x35fb('0x6')]['findAll']({'where':{'IntervalId':_0xc10a0b[_0x35fb('0x7')]},'raw':!![]});})[_0x35fb('0x4')](function(_0x3cb533){return _0x4bf00f['models']['VoiceExtension'][_0x35fb('0x3')]({'where':{'exten':{'$in':_[_0x35fb('0x8')](_[_0x35fb('0x9')](_0x3cb533,'exten'))}},'order':[{'raw':_0x35fb('0xa')}],'raw':!![]});})['then'](function(_0x156dde){var _0x236fd5=_[_0x35fb('0xb')](_0x156dde,{'priority':'1'});var _0x17ea7a=_[_0x35fb('0xb')](_0x156dde,{'isApp':0x1});var _0x39bb9d=_[_0x35fb('0xc')](_0x17ea7a,_0x35fb('0xd'));var _0x4e489b=['queue',_0x35fb('0xe')];var _0x34434a=[];var _0x12b130=[];for(var _0x4b7b2d in _0x39bb9d){if(_0x39bb9d[_0x35fb('0xf')](_0x4b7b2d)){_0x1ce853[_0x35fb('0x10')]=0x2;_0x1ce853[_0x35fb('0x11')]=[];_0x1ce853[_0x35fb('0x12')]=_[_0x35fb('0x13')](_0x236fd5,{'exten':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0xd')]});_0x1ce853[_0x35fb('0x11')][_0x35fb('0x14')]({'type':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x15')],'app':_0x35fb('0x16'),'appdata':util[_0x35fb('0x17')](_0x35fb('0x18'),_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x15')]),'context':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x19')],'exten':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0xd')],'priority':_0x1ce853[_0x35fb('0x10')]++,'VoiceExtensionId':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x1a')]});if(_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x15')]===_0x35fb('0x1b')){_0x1ce853['extensions'][_0x35fb('0x14')]({'type':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x15')],'app':'Set','appdata':_0x35fb('0x1c')+_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x1a')],'context':_0x39bb9d[_0x4b7b2d][0x0]['context'],'exten':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0xd')],'priority':_0x1ce853[_0x35fb('0x10')]++,'VoiceExtensionId':_0x39bb9d[_0x4b7b2d][0x0]['VoiceExtensionId']});}else if(_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x15')]===_0x35fb('0x1d')){if(_0x1ce853['extension']){_0x1ce853[_0x35fb('0x11')][_0x35fb('0x14')]({'type':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x15')],'app':_0x35fb('0x16'),'appdata':_0x35fb('0x1e')+(_0x1ce853[_0x35fb('0x12')][_0x35fb('0x1f')]?_0x35fb('0x20')+_0x1ce853[_0x35fb('0x12')]['cutdigits']+'}':_0x35fb('0x21')),'context':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x19')],'exten':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0xd')],'priority':_0x1ce853[_0x35fb('0x10')]++,'VoiceExtensionId':_0x39bb9d[_0x4b7b2d][0x0]['VoiceExtensionId']});}_0x1ce853[_0x35fb('0x11')]['push']({'type':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x15')],'app':_0x35fb('0x16'),'appdata':_0x35fb('0x1c')+_0x39bb9d[_0x4b7b2d][0x0]['VoiceExtensionId'],'context':_0x39bb9d[_0x4b7b2d][0x0]['context'],'exten':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0xd')],'priority':_0x1ce853['priority']++,'VoiceExtensionId':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x1a')]});var _0x286f12=_0x1ce853[_0x35fb('0x10')]++;_0x1ce853[_0x35fb('0x11')]['push']({'type':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x15')],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x286f12+0x2)+'):Goto('+(_0x286f12+0x1)+')','context':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x19')],'exten':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0xd')],'priority':_0x286f12,'VoiceExtensionId':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x1a')]});if(_0x1ce853[_0x35fb('0x12')]){_0x1ce853['extensions'][_0x35fb('0x14')]({'type':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x15')],'app':_0x35fb('0x16'),'appdata':_0x1ce853[_0x35fb('0x12')][_0x35fb('0x1f')]?_0x35fb('0x22')+_0x1ce853[_0x35fb('0x12')][_0x35fb('0x1f')]+'}':_0x35fb('0x23'),'context':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x19')],'exten':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0xd')],'priority':_0x1ce853[_0x35fb('0x10')]++,'VoiceExtensionId':_0x39bb9d[_0x4b7b2d][0x0]['VoiceExtensionId']});}_0x1ce853[_0x35fb('0x11')]['push']({'type':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x15')],'app':_0x35fb('0x16'),'appdata':_0x35fb('0x24')+_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x1a')],'context':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x19')],'exten':_0x39bb9d[_0x4b7b2d][0x0]['exten'],'priority':_0x1ce853[_0x35fb('0x10')]++,'VoiceExtensionId':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x1a')]});if(_0x1ce853[_0x35fb('0x12')]&&_0x1ce853[_0x35fb('0x12')]['hasOwnProperty'](_0x35fb('0x25'))&&_0x1ce853[_0x35fb('0x12')]['recordingFormat']!==_0x35fb('0x26')){_0x1ce853[_0x35fb('0x11')]['push']({'type':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x15')],'app':'Set','appdata':_0x35fb('0x27'),'context':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x19')],'exten':_0x39bb9d[_0x4b7b2d][0x0]['exten'],'priority':_0x1ce853['priority']++,'VoiceExtensionId':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x1a')]});_0x1ce853[_0x35fb('0x11')][_0x35fb('0x14')]({'type':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x15')],'app':_0x35fb('0x16'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x1ce853['extension'][_0x35fb('0x25')]||'wav','context':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x19')],'exten':_0x39bb9d[_0x4b7b2d][0x0]['exten'],'priority':_0x1ce853[_0x35fb('0x10')]++,'VoiceExtensionId':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x1a')]});}}_0x1ce853[_0x35fb('0x11')][_0x35fb('0x14')]({'type':_0x39bb9d[_0x4b7b2d][0x0]['type'],'app':_0x35fb('0x16'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x19')],'exten':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0xd')],'priority':_0x1ce853[_0x35fb('0x10')]++,'VoiceExtensionId':_0x39bb9d[_0x4b7b2d][0x0]['VoiceExtensionId']});_0x1ce853[_0x35fb('0x11')]['push']({'type':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x15')],'app':_0x35fb('0x16'),'appdata':_0x35fb('0x28'),'context':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x19')],'exten':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0xd')],'priority':_0x1ce853[_0x35fb('0x10')]++,'VoiceExtensionId':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x1a')]});_0x1ce853['extensions'][_0x35fb('0x14')]({'type':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x15')],'app':_0x35fb('0x16'),'appdata':_0x35fb('0x29'),'context':_0x39bb9d[_0x4b7b2d][0x0]['context'],'exten':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0xd')],'priority':_0x1ce853[_0x35fb('0x10')]++,'VoiceExtensionId':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x1a')]});for(var _0x4afd20=0x0,_0x4ccdda=0x0;_0x4afd20<_0x39bb9d[_0x4b7b2d][_0x35fb('0x2a')];_0x4afd20+=0x1,_0x4ccdda=0x0){var _0x2985ec=_0x39bb9d[_0x4b7b2d][_0x4afd20];if(_0x2985ec['type']){_0x2985ec['type']=_0x2985ec[_0x35fb('0x15')][_0x35fb('0x2b')]();}var _0x19fd49=[];var _0x178751=[];delete _0x2985ec['id'];delete _0x2985ec[_0x35fb('0x2c')];delete _0x2985ec[_0x35fb('0x2d')];var _0x5b852d=_0x2985ec[_0x35fb('0x2e')]!==_0x35fb('0x2f')?[_0x2985ec[_0x35fb('0x2e')]]:_0x2985ec[_0x35fb('0x7')]?_[_0x35fb('0x9')](_[_0x35fb('0xb')](_0x1ce853[_0x35fb('0x5')],{'IntervalId':_0x2985ec['IntervalId']}),'interval'):[];if(_0x2985ec[_0x35fb('0xf')](_0x35fb('0x30'))){if(_0x2985ec[_0x35fb('0x30')]&&_0x2985ec[_0x35fb('0x30')]!=='--'){_0x19fd49[_0x35fb('0x14')]({'type':_0x2985ec[_0x35fb('0x15')],'app':_0x35fb('0x16'),'appdata':'CDR(tag)='+_0x2985ec['tag'],'context':_0x2985ec[_0x35fb('0x19')],'exten':_0x2985ec['exten'],'priority':_0x5b852d['length']+_0x1ce853[_0x35fb('0x10')]+_0x4ccdda++,'VoiceExtensionId':_0x2985ec[_0x35fb('0x1a')]});}}if(_0x2985ec[_0x35fb('0x15')]===_0x35fb('0x1d')&&_0x2985ec['hasOwnProperty']('callerID')){if(_0x2985ec[_0x35fb('0x31')]){_0x19fd49['push']({'type':_0x2985ec[_0x35fb('0x15')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x2985ec[_0x35fb('0x31')]+')','context':_0x2985ec['context'],'exten':_0x2985ec['exten'],'priority':_0x5b852d[_0x35fb('0x2a')]+_0x1ce853[_0x35fb('0x10')]+_0x4ccdda++,'VoiceExtensionId':_0x2985ec[_0x35fb('0x1a')]});}else{_0x19fd49['push']({'type':_0x2985ec[_0x35fb('0x15')],'app':_0x35fb('0x32'),'appdata':_0x35fb('0x33'),'context':_0x2985ec[_0x35fb('0x19')],'exten':_0x2985ec['exten'],'priority':_0x5b852d[_0x35fb('0x2a')]+_0x1ce853['priority']+_0x4ccdda++,'VoiceExtensionId':_0x2985ec['VoiceExtensionId']});}}if(_0x2985ec[_0x35fb('0xf')]('answer')){if(_0x4e489b[_0x35fb('0x34')](_0x2985ec[_0x35fb('0x35')][_0x35fb('0x2b')]())>=0x0&&_0x2985ec[_0x35fb('0x36')]!==_0x35fb('0x37')){if(_0x2985ec[_0x35fb('0x38')]){_0x19fd49[_0x35fb('0x14')]({'type':_0x2985ec[_0x35fb('0x15')],'app':_0x35fb('0x32'),'appdata':_0x35fb('0x39'),'context':_0x2985ec[_0x35fb('0x19')],'exten':_0x2985ec['exten'],'priority':_0x5b852d[_0x35fb('0x2a')]+_0x1ce853[_0x35fb('0x10')]+_0x4ccdda++,'VoiceExtensionId':_0x2985ec[_0x35fb('0x1a')]});_0x19fd49['push']({'type':_0x2985ec[_0x35fb('0x15')],'app':_0x35fb('0x16'),'appdata':_0x35fb('0x3a'),'context':_0x2985ec['context'],'exten':_0x2985ec[_0x35fb('0xd')],'priority':_0x5b852d[_0x35fb('0x2a')]+_0x1ce853[_0x35fb('0x10')]+_0x4ccdda++,'VoiceExtensionId':_0x2985ec[_0x35fb('0x1a')]});}else{_0x19fd49[_0x35fb('0x14')]({'type':_0x2985ec[_0x35fb('0x15')],'app':_0x35fb('0x32'),'appdata':_0x35fb('0x3b'),'context':_0x2985ec[_0x35fb('0x19')],'exten':_0x2985ec[_0x35fb('0xd')],'priority':_0x5b852d[_0x35fb('0x2a')]+_0x1ce853['priority']+_0x4ccdda++,'VoiceExtensionId':_0x2985ec[_0x35fb('0x1a')]});_0x19fd49['push']({'type':_0x2985ec[_0x35fb('0x15')],'app':_0x35fb('0x16'),'appdata':_0x35fb('0x3c'),'context':_0x2985ec['context'],'exten':_0x2985ec[_0x35fb('0xd')],'priority':_0x5b852d[_0x35fb('0x2a')]+_0x1ce853[_0x35fb('0x10')]+_0x4ccdda++,'VoiceExtensionId':_0x2985ec['VoiceExtensionId']});}}}for(var _0x46cecf=0x0;_0x46cecf<_0x5b852d[_0x35fb('0x2a')];_0x46cecf+=0x1){var _0x37620d=_0x1ce853['priority']+_0x5b852d[_0x35fb('0x2a')];var _0x13d164=_0x46cecf===_0x5b852d[_0x35fb('0x2a')]-0x1?_0x1ce853[_0x35fb('0x10')]+_0x19fd49['length']+_0x178751['length']+0x2:_0x1ce853[_0x35fb('0x10')]+_0x46cecf+0x1;_0x19fd49[_0x35fb('0x3d')](_0x46cecf,0x0,{'type':_0x2985ec['type'],'app':_0x35fb('0x3e'),'appdata':_0x5b852d[_0x46cecf]+'?'+_0x2985ec[_0x35fb('0x19')]+_0x35fb('0x3f')+_0x37620d+':'+_0x2985ec[_0x35fb('0x19')]+_0x35fb('0x3f')+_0x13d164,'exten':_0x2985ec[_0x35fb('0xd')],'context':_0x2985ec[_0x35fb('0x19')],'priority':_0x1ce853['priority']+_0x46cecf,'VoiceExtensionId':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x1a')]});}_0x2985ec[_0x35fb('0x10')]=_0x19fd49[_0x35fb('0x2a')]?_[_0x35fb('0x40')](_0x19fd49)[_0x35fb('0x10')]+0x1:_0x1ce853['priority'];_0x1ce853['priority']=(_0x178751[_0x35fb('0x2a')]?_[_0x35fb('0x40')](_0x178751)[_0x35fb('0x10')]:_0x2985ec[_0x35fb('0x10')])+0x1;_0x1ce853[_0x35fb('0x11')]=_['concat'](_0x1ce853[_0x35fb('0x11')],_0x19fd49,[_0x2985ec],_0x178751);}_0x1ce853['extensions'][_0x35fb('0x14')]({'type':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x15')],'app':'Hangup','exten':_0x39bb9d[_0x4b7b2d][0x0]['exten'],'context':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x19')],'priority':_0x1ce853['priority'],'VoiceExtensionId':_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x1a')]});_0x34434a[_0x35fb('0x14')](_0x39bb9d[_0x4b7b2d][0x0][_0x35fb('0x1a')]);_0x12b130=_[_0x35fb('0x41')](_0x12b130,_0x1ce853[_0x35fb('0x11')]);}}return _0x4bf00f['transaction'](function(_0x4400cb){return _0x4bf00f[_0x35fb('0x1')][_0x35fb('0x6')][_0x35fb('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x34434a}},'transaction':_0x4400cb})['then'](function(_0x47e540){return _0x4bf00f[_0x35fb('0x1')][_0x35fb('0x6')][_0x35fb('0x43')](_[_0x35fb('0x44')](_0x12b130,_0x35fb('0x10')),{'transaction':_0x4400cb});});});})[_0x35fb('0x45')](function(_0x4d015d){console['error'](_0x4d015d);});}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 8de9caa..1df27ee 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 _0xc876=['push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','fromQuery','ContactId','createdAt','updatedAt','field','phone','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','select','cm_hopper','\x20=\x20?','scheduledAt','cm_contacts','ListId\x20=\x20?','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','calleridnum','into','cm_hopper_black','str','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','BlackLists','get','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','CSV\x20import\x20process\x20stopped!','resolve','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','lodash','squel','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','contact','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','duplicate','CmContact','create','then'];(function(_0x184ecb,_0x2a91a3){var _0x1f63a0=function(_0x508d1){while(--_0x508d1){_0x184ecb['push'](_0x184ecb['shift']());}};_0x1f63a0(++_0x2a91a3);}(_0xc876,0x117));var _0x6c87=function(_0x4374d8,_0x196396){_0x4374d8=_0x4374d8-0x0;var _0x1fdb9c=_0xc876[_0x4374d8];return _0x1fdb9c;};'use strict';var BPromise=require(_0x6c87('0x0'));var util=require('util');var _=require(_0x6c87('0x1'));var fs=require('fs');var squel=require(_0x6c87('0x2'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0x6c87('0x3'))['db'];var config=require(_0x6c87('0x4'));var logger=require(_0x6c87('0x5'))(_0x6c87('0x6'));config['redis']=_[_0x6c87('0x7')](config[_0x6c87('0x8')],{'host':_0x6c87('0x9'),'port':0x18eb});var socket=require(_0x6c87('0xa'))(new Redis(config[_0x6c87('0x8')]));require(_0x6c87('0xb'))[_0x6c87('0xc')](socket);try{if(!process[_0x6c87('0xd')][0x2]||process[_0x6c87('0xd')][0x2]===_0x6c87('0xe')||process[_0x6c87('0xd')][0x2]===_0x6c87('0xf')){throw new Error(_0x6c87('0x10'));}var FILEPATH=process[_0x6c87('0xd')][0x2];if(!process[_0x6c87('0xd')][0x3]||process[_0x6c87('0xd')][0x3]===_0x6c87('0xe')||process[_0x6c87('0xd')][0x3]===_0x6c87('0xf')||!process[_0x6c87('0xd')][0x4]||process[_0x6c87('0xd')][0x4]==='undefined'||process[_0x6c87('0xd')][0x4]===_0x6c87('0xf')){throw new Error(_0x6c87('0x11'));}var FIELDS=_[_0x6c87('0x12')](process[_0x6c87('0xd')][0x3][_0x6c87('0x13')](','),process[_0x6c87('0xd')][0x4]['split'](','));if(!process[_0x6c87('0xd')][0x5]||process[_0x6c87('0xd')][0x5]===_0x6c87('0xe')||process[_0x6c87('0xd')][0x5]===_0x6c87('0xf')){throw new Error(_0x6c87('0x14'));}var LISTID=process[_0x6c87('0xd')][0x5];var COMPANYID=process[_0x6c87('0xd')][0x6]&&process[_0x6c87('0xd')][0x6]!=='undefined'&&process[_0x6c87('0xd')][0x6]!==_0x6c87('0xf')?process[_0x6c87('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x6c87('0xd')][0x7]!==_0x6c87('0xe')&&process['argv'][0x7]!=='null'?process[_0x6c87('0xd')][0x7]:null;if(!process['argv'][0x8]||process[_0x6c87('0xd')][0x8]===_0x6c87('0xe')||process[_0x6c87('0xd')][0x8]===_0x6c87('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x6c87('0xd')][0x8];}catch(_0x5bf9d1){logger['error'](_0x5bf9d1);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(_0x4669e7,_0x1b8f0d,_0x5d8194,_0x1b5617){var _0x49a071={'message':_0x1b8f0d};_0x49a071[_0x4669e7]=!![];if(_0x5d8194){_0x49a071[_0x6c87('0x15')]=_0x5d8194;}if(_0x1b5617){_0x49a071['index']=_0x1b5617;}return _0x49a071;}function isEmail(_0xb64839){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))*$/[_0x6c87('0x16')](_0xb64839);}function checkRow(_0x59f1a1,_0x3af799,_0x7176ce){return new BPromise(function(_0x14df7c,_0x5912fd){if(_[_0x6c87('0x17')](_0x59f1a1)){return _0x5912fd(handleCheckRowError(_0x6c87('0x18'),_0x6c87('0x19'),null,_0x7176ce));}if(_0x59f1a1[_0x6c87('0x1a')]&&_0x59f1a1[_0x6c87('0x1a')][_0x6c87('0x1b')]){var _0x18d1dd=_[_0x6c87('0x1c')](_0x59f1a1['errors'],_0x6c87('0x1d'))[_0x6c87('0x1e')](';');return _0x5912fd(handleCheckRowError(_0x6c87('0x18'),_0x18d1dd,null,_0x7176ce));}var _0x487bd7={};for(var _0x425f75 in FIELDS){if(FIELDS[_0x6c87('0x1f')](_0x425f75)&&FIELDS[_0x425f75]){_0x487bd7[_0x425f75]=_0x59f1a1[_0x6c87('0x20')][0x0][FIELDS[_0x425f75]]||_0x59f1a1[_0x6c87('0x20')][0x0]['\ufeff'+FIELDS[_0x425f75]];}}if(!_0x487bd7[_0x6c87('0x21')]){return _0x5912fd(handleCheckRowError(_0x6c87('0x18'),'firstName\x20not\x20specified!',null,_0x7176ce));}if(!_0x487bd7['phone']){return _0x5912fd(handleCheckRowError(_0x6c87('0x18'),_0x6c87('0x22'),null,_0x7176ce));}if(_0x487bd7[_0x6c87('0x23')]){var _0x5ca473=moment(_0x487bd7['birthDate'],_0x6c87('0x24'));if(!_0x5ca473[_0x6c87('0x25')]()){return _0x5912fd(handleCheckRowError(_0x6c87('0x18'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x7176ce));}}if(_0x487bd7['email']){if(!isEmail(_0x487bd7[_0x6c87('0x26')])){return _0x5912fd(handleCheckRowError(_0x6c87('0x18'),_0x6c87('0x27'),null,_0x7176ce));}}_0x487bd7[_0x6c87('0x28')]=LISTID;_0x487bd7['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6c87('0x1b')]&&_0x3af799){var _0x213300={};for(var _0x3382be=0x0,_0x26263a=DUPLICATES[_0x6c87('0x1b')];_0x3382be<_0x26263a;_0x3382be+=0x1){_0x213300[DUPLICATES[_0x3382be]]=_0x487bd7[DUPLICATES[_0x3382be]];}var _0x69b880=_['find'](_0x3af799,_0x213300);if(_0x69b880){return _0x5912fd(handleCheckRowError(_0x6c87('0x29'),'Duplicate\x20Contact',_0x69b880,_0x7176ce));}}return db[_0x6c87('0x2a')][_0x6c87('0x2b')](_0x487bd7,{'raw':!![],'hooks':![],'fields':_['keys'](_0x487bd7)})[_0x6c87('0x2c')](function(_0x5545f3){if(DUPLICATES&&DUPLICATES[_0x6c87('0x1b')]&&_0x3af799){_0x3af799[_0x6c87('0x2d')](_[_0x6c87('0x2e')](_0x487bd7,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5545f3['id'];return _0x14df7c();})[_0x6c87('0x2f')](function(_0x377018){return _0x5912fd(handleCheckRowError(_0x6c87('0x18'),_0x6c87('0x30')+(_0x377018[_0x6c87('0x1d')]||JSON[_0x6c87('0x31')](_0x377018)),null,_0x7176ce));});});}function checkHopper(){function _0x439454(){return function(_0x410977){logger[_0x6c87('0x18')](_0x6c87('0x32'),_0x6c87('0x33'),util[_0x6c87('0x34')](_0x410977,{'showHidden':![],'depth':null}));};}var _0x365ca9=function(_0x1fbbae,_0x20f9eb){var _0x29f66f=squel[_0x6c87('0x35')]()['into']('cm_hopper')[_0x6c87('0x36')](['phone','scheduledAt',_0x6c87('0x37'),'ListId',_0x20f9eb,_0x6c87('0x38'),_0x6c87('0x39')],squel['select']()[_0x6c87('0x3a')]('phone',_0x6c87('0x3b'))[_0x6c87('0x3a')](_0x6c87('0x3c'),'scheduledAt')[_0x6c87('0x3a')]('id','ContactId')['field'](LISTID[_0x6c87('0x3d')](),_0x6c87('0x28'))['field'](_0x1fbbae['id'][_0x6c87('0x3d')](),_0x20f9eb)[_0x6c87('0x3a')](_0x6c87('0x3c'),_0x6c87('0x38'))[_0x6c87('0x3a')]('NOW()',_0x6c87('0x39'))[_0x6c87('0x3e')]('cm_contacts')[_0x6c87('0x3f')](_0x6c87('0x40'))[_0x6c87('0x3f')]('ListId\x20=\x20?',LISTID['toString']())[_0x6c87('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0x6c87('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6c87('0x41')]()['field'](_0x6c87('0x3b'))[_0x6c87('0x3e')](_0x6c87('0x42'))['where'](_0x20f9eb+_0x6c87('0x43'),_0x1fbbae['id'][_0x6c87('0x3d')]())))[_0x6c87('0x3d')]();return _0x29f66f;};var _0x2d6715=function(_0x253d11,_0x5d45a7){var _0x401a5c=squel['insert']()['into'](_0x6c87('0x42'))[_0x6c87('0x36')]([_0x6c87('0x3b'),_0x6c87('0x44'),_0x6c87('0x37'),_0x6c87('0x28'),_0x5d45a7,_0x6c87('0x38'),_0x6c87('0x39')],squel['select']()[_0x6c87('0x3a')](_0x6c87('0x3b'),'phone')[_0x6c87('0x3a')](_0x6c87('0x3c'),_0x6c87('0x44'))['field']('id',_0x6c87('0x37'))[_0x6c87('0x3a')](LISTID[_0x6c87('0x3d')](),_0x6c87('0x28'))[_0x6c87('0x3a')](_0x253d11['id']['toString'](),_0x5d45a7)['field'](_0x6c87('0x3c'),_0x6c87('0x38'))[_0x6c87('0x3a')](_0x6c87('0x3c'),_0x6c87('0x39'))[_0x6c87('0x3e')](_0x6c87('0x45'))[_0x6c87('0x3f')](_0x6c87('0x40'))[_0x6c87('0x3f')](_0x6c87('0x46'),LISTID['toString']())[_0x6c87('0x3f')](_0x6c87('0x47'),squel['str'](hopperContacts))[_0x6c87('0x3f')](_0x6c87('0x48'))[_0x6c87('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6c87('0x41')]()[_0x6c87('0x3a')](_0x6c87('0x49'))[_0x6c87('0x3e')]('cm_hopper_final')[_0x6c87('0x3f')](_0x5d45a7+'\x20=\x20?',_0x253d11['id'][_0x6c87('0x3d')]()))[_0x6c87('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6c87('0x41')]()[_0x6c87('0x3a')](_0x6c87('0x3b'))[_0x6c87('0x3e')](_0x6c87('0x42'))[_0x6c87('0x3f')](_0x5d45a7+_0x6c87('0x43'),_0x253d11['id']['toString']())))[_0x6c87('0x3d')]();return _0x401a5c;};function _0x22baf5(_0x1562fa,_0x96f930){var _0x309dcb=squel[_0x6c87('0x35')]()['into']('cm_hopper')[_0x6c87('0x36')]([_0x6c87('0x3b'),_0x6c87('0x44'),_0x6c87('0x37'),_0x6c87('0x28'),_0x96f930,'createdAt',_0x6c87('0x39')],squel[_0x6c87('0x41')]()[_0x6c87('0x3a')]('phone',_0x6c87('0x3b'))['field'](_0x6c87('0x3c'),_0x6c87('0x44'))[_0x6c87('0x3a')]('id',_0x6c87('0x37'))[_0x6c87('0x3a')](LISTID[_0x6c87('0x3d')](),_0x6c87('0x28'))[_0x6c87('0x3a')](_0x1562fa['id']['toString'](),_0x96f930)[_0x6c87('0x3a')](_0x6c87('0x3c'),_0x6c87('0x38'))['field'](_0x6c87('0x3c'),'updatedAt')[_0x6c87('0x3e')](_0x6c87('0x45'))[_0x6c87('0x3f')](_0x6c87('0x40'))[_0x6c87('0x3f')](_0x6c87('0x46'),LISTID[_0x6c87('0x3d')]())[_0x6c87('0x3f')](_0x6c87('0x47'),squel['str'](hopperContacts))[_0x6c87('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0x6c87('0x3d')]();return _0x309dcb;}function _0x406f1f(_0x3c6a85,_0x770b65){var _0x17dd37=squel[_0x6c87('0x35')]()[_0x6c87('0x4a')](_0x6c87('0x4b'))[_0x6c87('0x36')]([_0x6c87('0x3b'),_0x6c87('0x37'),_0x6c87('0x28'),_0x770b65,_0x6c87('0x38'),_0x6c87('0x39')],squel['select']()['field'](_0x6c87('0x3b'),_0x6c87('0x3b'))[_0x6c87('0x3a')]('id',_0x6c87('0x37'))[_0x6c87('0x3a')](LISTID[_0x6c87('0x3d')](),_0x6c87('0x28'))[_0x6c87('0x3a')](_0x3c6a85['id'][_0x6c87('0x3d')](),_0x770b65)[_0x6c87('0x3a')](_0x6c87('0x3c'),_0x6c87('0x38'))[_0x6c87('0x3a')](_0x6c87('0x3c'),_0x6c87('0x39'))['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x6c87('0x3f')](_0x6c87('0x46'),LISTID[_0x6c87('0x3d')]())[_0x6c87('0x3f')](_0x6c87('0x47'),squel[_0x6c87('0x4c')](hopperContacts))['where'](_0x6c87('0x48')))['toString']();return _0x17dd37;}return db[_0x6c87('0x4d')][_0x6c87('0x4e')]({'where':{'type':_0x6c87('0x4f')},'attributes':['id',_0x6c87('0x50')],'include':[{'model':db[_0x6c87('0x51')],'as':_0x6c87('0x52'),'where':{'id':LISTID}}]})[_0x6c87('0x2c')](function(_0x33be1e){var _0x3b6cb7=[];if(_0x33be1e){var _0x4c5879;for(var _0x43c0cc=0x0,_0x5da4dd;_0x43c0cc<_0x33be1e[_0x6c87('0x1b')];_0x43c0cc+=0x1){_0x5da4dd=_0x33be1e[_0x43c0cc]['get']({'plain':!![]});switch(_0x5da4dd[_0x6c87('0x50')]){case _0x6c87('0x53'):_0x3b6cb7['push'](db['sequelize'][_0x6c87('0x54')](_0x2d6715(_0x5da4dd,_0x6c87('0x55')))[_0x6c87('0x2c')](function(){})['catch'](_0x439454()));break;case _0x6c87('0x56'):_0x3b6cb7[_0x6c87('0x2d')](db['sequelize'][_0x6c87('0x54')](_0x365ca9(_0x5da4dd,_0x6c87('0x55')))[_0x6c87('0x2c')](function(){})[_0x6c87('0x2f')](_0x439454()));break;default:_0x3b6cb7[_0x6c87('0x2d')](db[_0x6c87('0x57')][_0x6c87('0x54')](_0x22baf5(_0x5da4dd,'VoiceQueueId'))[_0x6c87('0x2c')](function(){})[_0x6c87('0x2f')](_0x439454()));}}}return _0x3b6cb7;})[_0x6c87('0x58')]()[_0x6c87('0x2c')](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0x6c87('0x4f')},'attributes':['id'],'include':[{'model':db[_0x6c87('0x51')],'as':_0x6c87('0x59'),'where':{'id':LISTID}}]})[_0x6c87('0x2c')](function(_0x2551d1){var _0x3fd8e0=[];if(_0x2551d1){var _0x1dfcbc;for(var _0x183bf8=0x0,_0x58213f;_0x183bf8<_0x2551d1[_0x6c87('0x1b')];_0x183bf8+=0x1){_0x58213f=_0x2551d1[_0x183bf8][_0x6c87('0x5a')]({'plain':!![]});_0x3fd8e0[_0x6c87('0x2d')](db[_0x6c87('0x57')][_0x6c87('0x54')](_0x406f1f(_0x58213f,'VoiceQueueId'))[_0x6c87('0x2c')](function(){})['catch'](_0x439454()));}}return _0x3fd8e0;})[_0x6c87('0x58')]();})['then'](function(){return db[_0x6c87('0x5b')][_0x6c87('0x4e')]({'attributes':['id',_0x6c87('0x50')],'include':[{'model':db['CmList'],'as':_0x6c87('0x52'),'where':{'id':LISTID}}]})[_0x6c87('0x2c')](function(_0x386833){var _0x1cbac5=[];if(_0x386833){for(var _0x4c99b0=0x0,_0xfff3e9;_0x4c99b0<_0x386833[_0x6c87('0x1b')];_0x4c99b0+=0x1){_0xfff3e9=_0x386833[_0x4c99b0][_0x6c87('0x5a')]({'plain':!![]});switch(_0xfff3e9[_0x6c87('0x50')]){case _0x6c87('0x53'):_0x1cbac5[_0x6c87('0x2d')](db[_0x6c87('0x57')]['query'](_0x2d6715(_0xfff3e9,_0x6c87('0x5c')))[_0x6c87('0x2c')](function(){})['catch'](_0x439454()));break;case _0x6c87('0x56'):_0x1cbac5['push'](db[_0x6c87('0x57')][_0x6c87('0x54')](_0x365ca9(_0xfff3e9,_0x6c87('0x5c')))[_0x6c87('0x2c')](function(){})[_0x6c87('0x2f')](_0x439454()));break;default:_0x1cbac5[_0x6c87('0x2d')](db[_0x6c87('0x57')]['query'](_0x22baf5(_0xfff3e9,'CampaignId'))[_0x6c87('0x2c')](function(){})[_0x6c87('0x2f')](_0x439454()));}}}return _0x1cbac5;})[_0x6c87('0x58')]();})[_0x6c87('0x2c')](function(){return db[_0x6c87('0x5b')][_0x6c87('0x4e')]({'attributes':['id'],'include':[{'model':db[_0x6c87('0x51')],'as':_0x6c87('0x59'),'where':{'id':LISTID}}]})[_0x6c87('0x2c')](function(_0xb7d080){var _0x2b5012=[];if(_0xb7d080){for(var _0x1ab844=0x0,_0x4527ea;_0x1ab844<_0xb7d080[_0x6c87('0x1b')];_0x1ab844+=0x1){_0x4527ea=_0xb7d080[_0x1ab844]['get']({'plain':!![]});_0x2b5012[_0x6c87('0x2d')](db[_0x6c87('0x57')][_0x6c87('0x54')](_0x406f1f(_0x4527ea,_0x6c87('0x5c')))[_0x6c87('0x2c')](function(){})[_0x6c87('0x2f')](_0x439454()));}}return _0x2b5012;})[_0x6c87('0x58')]();})['catch'](function(_0x11075a){logger[_0x6c87('0x18')](_0x6c87('0x5d'),_0x6c87('0x5e'),_0x11075a[_0x6c87('0x1d')]);});}var processPromises=function(_0x3641be){return BPromise['all'](promises)[_0x6c87('0x2c')](function(_0x4e2a38){})[_0x6c87('0x2f')](function(_0x389f5b){logger[_0x6c87('0x18')](_0x6c87('0x5f'),JSON['stringify'](_0x389f5b));})['finally'](function(){socket[_0x6c87('0x60')](_0x6c87('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3641be){return _0x3641be['resume']();}});};var endCsv=function(){return BPromise['resolve']()[_0x6c87('0x2c')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x6c87('0x62')](FILEPATH);}catch(_0x597615){logger[_0x6c87('0x18')](_0x6c87('0x63'),JSON[_0x6c87('0x31')](_0x597615));}finally{process[_0x6c87('0x64')](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0x6c87('0x65'));endCsv();});function main(){return BPromise[_0x6c87('0x66')]()[_0x6c87('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x6c87('0x2a')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x4c431d){var _0x1cbd0b=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x6c87('0x67')](_0x1cbd0b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1598e7,_0x1bc243){total+=0x1;var _0x2e03f5=total;promises[_0x6c87('0x2d')](checkRow(_0x1598e7,_0x4c431d,_0x2e03f5)[_0x6c87('0x2c')](function(){success+=0x1;})['catch'](function(_0x2e3b9f){if(_0x2e3b9f[_0x6c87('0x18')]){errors+=0x1;delete _0x2e3b9f[_0x6c87('0x18')];}else if(_0x2e3b9f[_0x6c87('0x29')]){duplicates+=0x1;delete _0x2e3b9f['duplicate'];}rows[_0x6c87('0x2d')](_0x2e3b9f);}));if(total%0xc8===0x0){_0x1bc243[_0x6c87('0x68')]();return processPromises(_0x1bc243);}},'complete':function(){return processPromises()[_0x6c87('0x2c')](function(){logger[_0x6c87('0x69')](_0x6c87('0x6a'));endCsv();});},'error':function(_0x580d62,_0x33d72d){logger[_0x6c87('0x69')](_0x6c87('0x6b'),JSON['stringify'](_0x580d62));endCsv();}});})[_0x6c87('0x2f')](function(_0x1dd2a7){logger[_0x6c87('0x18')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x6c87('0x31')](_0x1dd2a7));});}main(); \ No newline at end of file +var _0x2712=['parse','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','phone','phone\x20not\x20specified!','birthDate','isValid','email','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','cm_contacts','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','outbound','CampaignId','Campaign','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!'];(function(_0x3cb83f,_0x2bc6dd){var _0x105d68=function(_0x18bd0f){while(--_0x18bd0f){_0x3cb83f['push'](_0x3cb83f['shift']());}};_0x105d68(++_0x2bc6dd);}(_0x2712,0xe9));var _0x2271=function(_0x51f492,_0x1f71e5){_0x51f492=_0x51f492-0x0;var _0x292892=_0x2712[_0x51f492];return _0x292892;};'use strict';var BPromise=require(_0x2271('0x0'));var util=require(_0x2271('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x2271('0x2'));var Papa=require(_0x2271('0x3'));var Redis=require(_0x2271('0x4'));var db=require(_0x2271('0x5'))['db'];var config=require(_0x2271('0x6'));var logger=require(_0x2271('0x7'))(_0x2271('0x8'));config[_0x2271('0x9')]=_[_0x2271('0xa')](config[_0x2271('0x9')],{'host':_0x2271('0xb'),'port':0x18eb});var socket=require(_0x2271('0xc'))(new Redis(config['redis']));require(_0x2271('0xd'))[_0x2271('0xe')](socket);try{if(!process[_0x2271('0xf')][0x2]||process[_0x2271('0xf')][0x2]===_0x2271('0x10')||process[_0x2271('0xf')][0x2]==='null'){throw new Error(_0x2271('0x11'));}var FILEPATH=process[_0x2271('0xf')][0x2];if(!process[_0x2271('0xf')][0x3]||process[_0x2271('0xf')][0x3]==='undefined'||process[_0x2271('0xf')][0x3]==='null'||!process[_0x2271('0xf')][0x4]||process[_0x2271('0xf')][0x4]===_0x2271('0x10')||process['argv'][0x4]===_0x2271('0x12')){throw new Error(_0x2271('0x13'));}var FIELDS=_[_0x2271('0x14')](process[_0x2271('0xf')][0x3][_0x2271('0x15')](','),process[_0x2271('0xf')][0x4][_0x2271('0x15')](','));if(!process[_0x2271('0xf')][0x5]||process[_0x2271('0xf')][0x5]===_0x2271('0x10')||process[_0x2271('0xf')][0x5]===_0x2271('0x12')){throw new Error(_0x2271('0x16'));}var LISTID=process[_0x2271('0xf')][0x5];var COMPANYID=process[_0x2271('0xf')][0x6]&&process[_0x2271('0xf')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x2271('0x12')?process[_0x2271('0xf')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x2271('0xf')][0x7]!==_0x2271('0x10')&&process['argv'][0x7]!==_0x2271('0x12')?process[_0x2271('0xf')][0x7]:null;if(!process['argv'][0x8]||process[_0x2271('0xf')][0x8]===_0x2271('0x10')||process[_0x2271('0xf')][0x8]===_0x2271('0x12')){throw new Error(_0x2271('0x17'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x39cfb7){logger[_0x2271('0x18')](_0x39cfb7);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(_0x5c6376,_0x499cae,_0x33f803,_0x5d221b){var _0x3147f3={'message':_0x499cae};_0x3147f3[_0x5c6376]=!![];if(_0x33f803){_0x3147f3[_0x2271('0x19')]=_0x33f803;}if(_0x5d221b){_0x3147f3[_0x2271('0x1a')]=_0x5d221b;}return _0x3147f3;}function isEmail(_0x4553c2){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))*$/[_0x2271('0x1b')](_0x4553c2);}function checkRow(_0x1538c6,_0x4c77b9,_0x2c452c){return new BPromise(function(_0x5af477,_0x13b8f6){if(_[_0x2271('0x1c')](_0x1538c6)){return _0x13b8f6(handleCheckRowError(_0x2271('0x18'),_0x2271('0x1d'),null,_0x2c452c));}if(_0x1538c6[_0x2271('0x1e')]&&_0x1538c6[_0x2271('0x1e')][_0x2271('0x1f')]){var _0x4ed813=_[_0x2271('0x20')](_0x1538c6[_0x2271('0x1e')],_0x2271('0x21'))[_0x2271('0x22')](';');return _0x13b8f6(handleCheckRowError(_0x2271('0x18'),_0x4ed813,null,_0x2c452c));}var _0x22058a={};for(var _0x3e2d83 in FIELDS){if(FIELDS['hasOwnProperty'](_0x3e2d83)&&FIELDS[_0x3e2d83]){_0x22058a[_0x3e2d83]=_0x1538c6[_0x2271('0x23')][0x0][FIELDS[_0x3e2d83]]||_0x1538c6[_0x2271('0x23')][0x0]['\ufeff'+FIELDS[_0x3e2d83]];}}if(!_0x22058a['firstName']){return _0x13b8f6(handleCheckRowError(_0x2271('0x18'),'firstName\x20not\x20specified!',null,_0x2c452c));}if(!_0x22058a[_0x2271('0x24')]){return _0x13b8f6(handleCheckRowError(_0x2271('0x18'),_0x2271('0x25'),null,_0x2c452c));}if(_0x22058a['birthDate']){var _0x4789e9=moment(_0x22058a[_0x2271('0x26')],'YYYY-MM-DD');if(!_0x4789e9[_0x2271('0x27')]()){return _0x13b8f6(handleCheckRowError(_0x2271('0x18'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x2c452c));}}if(_0x22058a['email']){if(!isEmail(_0x22058a[_0x2271('0x28')])){return _0x13b8f6(handleCheckRowError(_0x2271('0x18'),'email\x20format\x20is\x20not\x20valid!',null,_0x2c452c));}}_0x22058a[_0x2271('0x29')]=LISTID;_0x22058a[_0x2271('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x2271('0x1f')]&&_0x4c77b9){var _0x38a4fa={};for(var _0x2ebc98=0x0,_0x146b37=DUPLICATES[_0x2271('0x1f')];_0x2ebc98<_0x146b37;_0x2ebc98+=0x1){_0x38a4fa[DUPLICATES[_0x2ebc98]]=_0x22058a[DUPLICATES[_0x2ebc98]];}var _0x4c13c3=_[_0x2271('0x2b')](_0x4c77b9,_0x38a4fa);if(_0x4c13c3){return _0x13b8f6(handleCheckRowError(_0x2271('0x2c'),_0x2271('0x2d'),_0x4c13c3,_0x2c452c));}}return db[_0x2271('0x2e')][_0x2271('0x2f')](_0x22058a,{'raw':!![],'hooks':![],'fields':_['keys'](_0x22058a)})[_0x2271('0x30')](function(_0x173f81){if(DUPLICATES&&DUPLICATES[_0x2271('0x1f')]&&_0x4c77b9){_0x4c77b9[_0x2271('0x31')](_[_0x2271('0x32')](_0x22058a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x173f81['id'];return _0x5af477();})[_0x2271('0x33')](function(_0x1aff2f){return _0x13b8f6(handleCheckRowError(_0x2271('0x18'),_0x2271('0x34')+(_0x1aff2f[_0x2271('0x21')]||JSON[_0x2271('0x35')](_0x1aff2f)),null,_0x2c452c));});});}function checkHopper(){function _0x2f2f45(){return function(_0x4175df){logger[_0x2271('0x18')](_0x2271('0x36'),_0x2271('0x37'),util['inspect'](_0x4175df,{'showHidden':![],'depth':null}));};}var _0x21a126=function(_0x42b785,_0x2f5491){var _0x1eef31=squel[_0x2271('0x38')]()[_0x2271('0x39')](_0x2271('0x3a'))[_0x2271('0x3b')]([_0x2271('0x24'),_0x2271('0x3c'),_0x2271('0x3d'),'ListId',_0x2f5491,_0x2271('0x3e'),_0x2271('0x3f')],squel[_0x2271('0x40')]()[_0x2271('0x41')]('phone',_0x2271('0x24'))[_0x2271('0x41')](_0x2271('0x42'),_0x2271('0x3c'))[_0x2271('0x41')]('id',_0x2271('0x3d'))['field'](LISTID[_0x2271('0x43')](),'ListId')['field'](_0x42b785['id'][_0x2271('0x43')](),_0x2f5491)[_0x2271('0x41')](_0x2271('0x42'),_0x2271('0x3e'))['field']('NOW()',_0x2271('0x3f'))[_0x2271('0x44')]('cm_contacts')[_0x2271('0x45')](_0x2271('0x46'))['where'](_0x2271('0x47'),LISTID['toString']())[_0x2271('0x45')](_0x2271('0x48'))[_0x2271('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0x2271('0x40')]()[_0x2271('0x41')](_0x2271('0x24'))[_0x2271('0x44')]('cm_hopper')[_0x2271('0x45')](_0x2f5491+_0x2271('0x49'),_0x42b785['id'][_0x2271('0x43')]())))[_0x2271('0x43')]();return _0x1eef31;};var _0x54639c=function(_0x5f19c8,_0x524d59){var _0x43e9a8=squel['insert']()[_0x2271('0x39')](_0x2271('0x3a'))[_0x2271('0x3b')](['phone',_0x2271('0x3c'),_0x2271('0x3d'),_0x2271('0x29'),_0x524d59,'createdAt',_0x2271('0x3f')],squel[_0x2271('0x40')]()[_0x2271('0x41')](_0x2271('0x24'),_0x2271('0x24'))[_0x2271('0x41')](_0x2271('0x42'),_0x2271('0x3c'))[_0x2271('0x41')]('id','ContactId')[_0x2271('0x41')](LISTID['toString'](),_0x2271('0x29'))[_0x2271('0x41')](_0x5f19c8['id'][_0x2271('0x43')](),_0x524d59)[_0x2271('0x41')](_0x2271('0x42'),_0x2271('0x3e'))[_0x2271('0x41')](_0x2271('0x42'),_0x2271('0x3f'))['from'](_0x2271('0x4a'))[_0x2271('0x45')](_0x2271('0x46'))['where'](_0x2271('0x47'),LISTID['toString']())[_0x2271('0x45')]('id\x20IN\x20?',squel[_0x2271('0x4b')](hopperContacts))[_0x2271('0x45')](_0x2271('0x48'))[_0x2271('0x45')](_0x2271('0x4c'),squel[_0x2271('0x40')]()[_0x2271('0x41')](_0x2271('0x4d'))['from'](_0x2271('0x4e'))[_0x2271('0x45')](_0x524d59+_0x2271('0x49'),_0x5f19c8['id'][_0x2271('0x43')]()))[_0x2271('0x45')](_0x2271('0x4c'),squel[_0x2271('0x40')]()[_0x2271('0x41')]('phone')[_0x2271('0x44')](_0x2271('0x3a'))[_0x2271('0x45')](_0x524d59+_0x2271('0x49'),_0x5f19c8['id'][_0x2271('0x43')]())))['toString']();return _0x43e9a8;};function _0xfcf6b2(_0x239120,_0x3df9dd){var _0x49988d=squel[_0x2271('0x38')]()[_0x2271('0x39')](_0x2271('0x3a'))[_0x2271('0x3b')](['phone',_0x2271('0x3c'),'ContactId',_0x2271('0x29'),_0x3df9dd,'createdAt',_0x2271('0x3f')],squel['select']()[_0x2271('0x41')]('phone',_0x2271('0x24'))['field'](_0x2271('0x42'),'scheduledAt')[_0x2271('0x41')]('id',_0x2271('0x3d'))[_0x2271('0x41')](LISTID[_0x2271('0x43')](),_0x2271('0x29'))[_0x2271('0x41')](_0x239120['id'][_0x2271('0x43')](),_0x3df9dd)[_0x2271('0x41')](_0x2271('0x42'),_0x2271('0x3e'))[_0x2271('0x41')](_0x2271('0x42'),_0x2271('0x3f'))[_0x2271('0x44')](_0x2271('0x4a'))[_0x2271('0x45')](_0x2271('0x46'))[_0x2271('0x45')]('ListId\x20=\x20?',LISTID['toString']())[_0x2271('0x45')](_0x2271('0x4f'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x49988d;}function _0xd75e3b(_0xe431e1,_0x491fda){var _0x58298d=squel[_0x2271('0x38')]()[_0x2271('0x39')](_0x2271('0x50'))['fromQuery']([_0x2271('0x24'),_0x2271('0x3d'),_0x2271('0x29'),_0x491fda,_0x2271('0x3e'),_0x2271('0x3f')],squel[_0x2271('0x40')]()[_0x2271('0x41')](_0x2271('0x24'),_0x2271('0x24'))[_0x2271('0x41')]('id',_0x2271('0x3d'))[_0x2271('0x41')](LISTID[_0x2271('0x43')](),_0x2271('0x29'))[_0x2271('0x41')](_0xe431e1['id'][_0x2271('0x43')](),_0x491fda)['field'](_0x2271('0x42'),_0x2271('0x3e'))[_0x2271('0x41')]('NOW()',_0x2271('0x3f'))['from'](_0x2271('0x4a'))[_0x2271('0x45')](_0x2271('0x46'))[_0x2271('0x45')]('ListId\x20=\x20?',LISTID['toString']())[_0x2271('0x45')]('id\x20IN\x20?',squel[_0x2271('0x4b')](hopperContacts))[_0x2271('0x45')](_0x2271('0x48')))[_0x2271('0x43')]();return _0x58298d;}return db[_0x2271('0x51')][_0x2271('0x52')]({'where':{'type':'outbound'},'attributes':['id',_0x2271('0x53')],'include':[{'model':db[_0x2271('0x54')],'as':_0x2271('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x153ec1){var _0x4da877=[];if(_0x153ec1){var _0x11474f;for(var _0x4901b8=0x0,_0x39cad5;_0x4901b8<_0x153ec1[_0x2271('0x1f')];_0x4901b8+=0x1){_0x39cad5=_0x153ec1[_0x4901b8][_0x2271('0x56')]({'plain':!![]});switch(_0x39cad5[_0x2271('0x53')]){case _0x2271('0x57'):_0x4da877[_0x2271('0x31')](db[_0x2271('0x58')][_0x2271('0x59')](_0x54639c(_0x39cad5,_0x2271('0x5a')))[_0x2271('0x30')](function(){})[_0x2271('0x33')](_0x2f2f45()));break;case _0x2271('0x5b'):_0x4da877['push'](db['sequelize'][_0x2271('0x59')](_0x21a126(_0x39cad5,'VoiceQueueId'))[_0x2271('0x30')](function(){})[_0x2271('0x33')](_0x2f2f45()));break;default:_0x4da877[_0x2271('0x31')](db[_0x2271('0x58')][_0x2271('0x59')](_0xfcf6b2(_0x39cad5,_0x2271('0x5a')))[_0x2271('0x30')](function(){})['catch'](_0x2f2f45()));}}}return _0x4da877;})[_0x2271('0x5c')]()[_0x2271('0x30')](function(){return db[_0x2271('0x51')][_0x2271('0x52')]({'where':{'type':_0x2271('0x5d')},'attributes':['id'],'include':[{'model':db[_0x2271('0x54')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x2271('0x30')](function(_0x1e9e30){var _0x8b742b=[];if(_0x1e9e30){var _0x22bea3;for(var _0x4067b4=0x0,_0x2a0a18;_0x4067b4<_0x1e9e30[_0x2271('0x1f')];_0x4067b4+=0x1){_0x2a0a18=_0x1e9e30[_0x4067b4][_0x2271('0x56')]({'plain':!![]});_0x8b742b['push'](db[_0x2271('0x58')][_0x2271('0x59')](_0xd75e3b(_0x2a0a18,'VoiceQueueId'))[_0x2271('0x30')](function(){})[_0x2271('0x33')](_0x2f2f45()));}}return _0x8b742b;})[_0x2271('0x5c')]();})['then'](function(){return db['Campaign'][_0x2271('0x52')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x2271('0x55'),'where':{'id':LISTID}}]})[_0x2271('0x30')](function(_0x285a65){var _0x318f87=[];if(_0x285a65){for(var _0x4f5ebf=0x0,_0x1d1855;_0x4f5ebf<_0x285a65['length'];_0x4f5ebf+=0x1){_0x1d1855=_0x285a65[_0x4f5ebf][_0x2271('0x56')]({'plain':!![]});switch(_0x1d1855[_0x2271('0x53')]){case'always':_0x318f87[_0x2271('0x31')](db[_0x2271('0x58')]['query'](_0x54639c(_0x1d1855,'CampaignId'))[_0x2271('0x30')](function(){})[_0x2271('0x33')](_0x2f2f45()));break;case _0x2271('0x5b'):_0x318f87[_0x2271('0x31')](db[_0x2271('0x58')][_0x2271('0x59')](_0x21a126(_0x1d1855,_0x2271('0x5e')))['then'](function(){})[_0x2271('0x33')](_0x2f2f45()));break;default:_0x318f87[_0x2271('0x31')](db[_0x2271('0x58')][_0x2271('0x59')](_0xfcf6b2(_0x1d1855,_0x2271('0x5e')))[_0x2271('0x30')](function(){})[_0x2271('0x33')](_0x2f2f45()));}}}return _0x318f87;})[_0x2271('0x5c')]();})['then'](function(){return db[_0x2271('0x5f')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x2271('0x54')],'as':_0x2271('0x60'),'where':{'id':LISTID}}]})['then'](function(_0x3677b7){var _0x17b2c6=[];if(_0x3677b7){for(var _0x52dff4=0x0,_0xcc4198;_0x52dff4<_0x3677b7[_0x2271('0x1f')];_0x52dff4+=0x1){_0xcc4198=_0x3677b7[_0x52dff4]['get']({'plain':!![]});_0x17b2c6[_0x2271('0x31')](db[_0x2271('0x58')]['query'](_0xd75e3b(_0xcc4198,'CampaignId'))[_0x2271('0x30')](function(){})[_0x2271('0x33')](_0x2f2f45()));}}return _0x17b2c6;})['all']();})[_0x2271('0x33')](function(_0x59d09e){logger[_0x2271('0x18')](_0x2271('0x61'),_0x2271('0x62'),_0x59d09e[_0x2271('0x21')]);});}var processPromises=function(_0x21d1ea){return BPromise[_0x2271('0x5c')](promises)[_0x2271('0x30')](function(_0x1116ef){})[_0x2271('0x33')](function(_0x5e4177){logger[_0x2271('0x18')](_0x2271('0x63'),JSON[_0x2271('0x35')](_0x5e4177));})[_0x2271('0x64')](function(){socket['emit'](_0x2271('0x65')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x21d1ea){return _0x21d1ea[_0x2271('0x66')]();}});};var endCsv=function(){return BPromise[_0x2271('0x67')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x2271('0x30')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x2271('0x68')](FILEPATH);}catch(_0x5d3907){logger['error'](_0x2271('0x69'),JSON[_0x2271('0x35')](_0x5d3907));}finally{process[_0x2271('0x6a')](0x0);}});};process['on'](_0x2271('0x6b'),function(){logger['info'](_0x2271('0x6c'));endCsv();});function main(){return BPromise[_0x2271('0x67')]()[_0x2271('0x30')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x2271('0x15')](',');return db[_0x2271('0x2e')][_0x2271('0x52')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x48e643){var _0x1d3d45=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x2271('0x6d')](_0x1d3d45,{'header':!![],'skipEmptyLines':!![],'step':function(_0x47220c,_0x2e64aa){total+=0x1;var _0x143b73=total;promises[_0x2271('0x31')](checkRow(_0x47220c,_0x48e643,_0x143b73)[_0x2271('0x30')](function(){success+=0x1;})[_0x2271('0x33')](function(_0x1105cf){if(_0x1105cf['error']){errors+=0x1;delete _0x1105cf[_0x2271('0x18')];}else if(_0x1105cf[_0x2271('0x2c')]){duplicates+=0x1;delete _0x1105cf[_0x2271('0x2c')];}rows[_0x2271('0x31')](_0x1105cf);}));if(total%0xc8===0x0){_0x2e64aa['pause']();return processPromises(_0x2e64aa);}},'complete':function(){return processPromises()[_0x2271('0x30')](function(){logger[_0x2271('0x6e')](_0x2271('0x6f'));endCsv();});},'error':function(_0x39d3cc,_0x2de78f){logger[_0x2271('0x6e')](_0x2271('0x70'),JSON[_0x2271('0x35')](_0x39d3cc));endCsv();}});})[_0x2271('0x33')](function(_0x2dee96){logger[_0x2271('0x18')](_0x2271('0x71'),JSON[_0x2271('0x35')](_0x2dee96));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 30aeee4..47ff550 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 _0xdafc=['CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','util','squel','ioredis','../../../mysqldb','../../../config/environment','import','defaults','redis','localhost','socket.io-emitter','format','test','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.priority','cm_contacts.UserId','into','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','select','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.createdAt','cm_hopper_black','ListId','fields','ListId\x20=\x20?','\x20=\x20?','keys','CompanyId','insert',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','catch','main','send','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','createReadStream','data','length','rows','hasOwnProperty','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','SystemRow','appendFileSync','emit','contact:import:','abort','step','duplicates','cm_contacts_'];(function(_0x4a3c76,_0x437b4a){var _0x3879e7=function(_0x45f21d){while(--_0x45f21d){_0x4a3c76['push'](_0x4a3c76['shift']());}};_0x3879e7(++_0x437b4a);}(_0xdafc,0x1a6));var _0xcdaf=function(_0x25d422,_0x5bc393){_0x25d422=_0x25d422-0x0;var _0x23e361=_0xdafc[_0x25d422];return _0x23e361;};'use strict';var fs=require('fs');var path=require(_0xcdaf('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0xcdaf('0x1'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0xcdaf('0x2'));var Redis=require(_0xcdaf('0x3'));var db=require(_0xcdaf('0x4'))['db'];var config=require(_0xcdaf('0x5'));var logger=require('../../../config/logger')(_0xcdaf('0x6'));config['redis']=_[_0xcdaf('0x7')](config[_0xcdaf('0x8')],{'host':_0xcdaf('0x9'),'port':0x18eb});var socket=require(_0xcdaf('0xa'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xcdaf('0xb')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x2b39d6){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))*$/[_0xcdaf('0xc')](_0x2b39d6);}function selectNotIn(_0xd24786,_0xac816d,_0x42ee88,_0x5e957e,_0x2b40a3){return squel['select']()[_0xcdaf('0xd')](_0xcdaf('0xe'))[_0xcdaf('0xf')](_0x5e957e)[_0xcdaf('0x10')](_0xac816d,null,_0xac816d+_0xcdaf('0x11')+_0x5e957e+'.'+_0x42ee88)[_0xcdaf('0x12')](_0x5e957e+'.'+_0x42ee88+_0xcdaf('0x13')+_0xd24786+'.'+_0x42ee88)[_0xcdaf('0x12')](_0xac816d+_0xcdaf('0x14')+_0x2b40a3['join']()+')');}function insertCmHopper(_0x197983,_0x50ccca,_0x37bb07,_0x30117d,_0x14c5a1){var _0x1493bc=[_0xcdaf('0x15'),'cm_contacts.scheduledat',_0xcdaf('0x16'),_0xcdaf('0x17'),_0x50ccca+'.'+_0x30117d,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xcdaf('0x18'),_0xcdaf('0x19'),'\x22'+_0x14c5a1+'\x22'];return squel['insert']()[_0xcdaf('0x1a')]('cm_hopper')[_0xcdaf('0x1b')]([_0xcdaf('0xe'),_0xcdaf('0x1c'),_0xcdaf('0x1d'),'ListId',_0x30117d,_0xcdaf('0x1e'),_0xcdaf('0x1f'),_0xcdaf('0x20'),_0xcdaf('0x21'),'recallme'],squel[_0xcdaf('0x22')]()['fields'](_0x1493bc)['from'](_0x50ccca)[_0xcdaf('0x10')](_0xcdaf('0x23'),null,_0xcdaf('0x24')+_0x50ccca+_0xcdaf('0x25'))['join'](_0x37bb07,null,_0x37bb07+'.id\x20=\x20'+_0x50ccca+'.'+_0x30117d)['where'](_0x50ccca+_0xcdaf('0x26'),_0x197983)[_0xcdaf('0x12')](_0xcdaf('0x27'),NOW)[_0xcdaf('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x50ccca,_0x37bb07,_0x30117d,_0xcdaf('0x28'),[_0xcdaf('0x29'),'\x22onlyIfOpen\x22']))[_0xcdaf('0x12')](_0xcdaf('0x2a'),selectNotIn(_0x50ccca,_0x37bb07,_0x30117d,_0xcdaf('0x28'),[_0xcdaf('0x29')])))[_0xcdaf('0x2b')]();}function insertCmHopperBlack(_0x123140,_0x37472a,_0xaf2a50,_0x47d00e){var _0x31e57b=[_0xcdaf('0x15'),'cm_contacts.id',_0xcdaf('0x17'),_0x37472a+'.'+_0x47d00e,_0xcdaf('0x2c'),'cm_contacts.updatedAt'];return squel['insert']()[_0xcdaf('0x1a')](_0xcdaf('0x2d'))[_0xcdaf('0x1b')]([_0xcdaf('0xe'),_0xcdaf('0x1d'),_0xcdaf('0x2e'),_0x47d00e,_0xcdaf('0x1e'),_0xcdaf('0x1f')],squel[_0xcdaf('0x22')]()[_0xcdaf('0x2f')](_0x31e57b)['from'](_0x37472a)[_0xcdaf('0x10')](_0xcdaf('0x23'),null,_0xcdaf('0x24')+_0x37472a+'.CmListId')['join'](_0xaf2a50,null,_0xaf2a50+_0xcdaf('0x11')+_0x37472a+'.'+_0x47d00e)[_0xcdaf('0x12')](_0x37472a+_0xcdaf('0x26'),_0x123140)[_0xcdaf('0x12')](_0xcdaf('0x27'),NOW)['where'](_0xcdaf('0x2a'),squel[_0xcdaf('0x22')]()[_0xcdaf('0xd')]('phone')[_0xcdaf('0xf')](_0xcdaf('0x2d'))['where'](_0xcdaf('0x30'),_0x123140)[_0xcdaf('0x12')](_0x47d00e+_0xcdaf('0x31'),_0x37472a+'.'+_0x47d00e)))['toString']();}function insertCmContact(_0x322598,_0x181690,_0x265932,_0x4dd85e){var _0x45d507=_['concat'](_[_0xcdaf('0x32')](_0x4dd85e),['ListId',_0xcdaf('0x33'),'createdAt',_0xcdaf('0x1f')]);return squel[_0xcdaf('0x34')]()[_0xcdaf('0x1a')](_0xcdaf('0x23'))[_0xcdaf('0x1b')](_0x45d507,squel['select']()['fields'](_0x45d507)[_0xcdaf('0xf')](_0x181690)[_0xcdaf('0x12')]('('+_0x265932[_0xcdaf('0x10')](',')+_0xcdaf('0x35'),squel[_0xcdaf('0x22')]()[_0xcdaf('0x2f')](_0x265932)[_0xcdaf('0xf')](_0xcdaf('0x23'))[_0xcdaf('0x12')](_0xcdaf('0x30'),_0x322598)[_0xcdaf('0x12')](_0xcdaf('0x36')))['where'](_0xcdaf('0x37'),squel[_0xcdaf('0x22')]()[_0xcdaf('0xd')](_0xcdaf('0x38'),'min_id')[_0xcdaf('0xf')](_0x181690)[_0xcdaf('0x39')](_0x265932[_0xcdaf('0x10')](','))))[_0xcdaf('0x2b')]();}function handleStop(){logger[_0xcdaf('0x3a')](_0xcdaf('0x3b'));stopped=!![];}function handleUncaughtException(_0x251bcd){logger[_0xcdaf('0x3c')](_0x251bcd[_0xcdaf('0x3d')]);process[_0xcdaf('0x3e')](0x1);}function handleError(_0x4d46e3,_0x2281db){stats[_0xcdaf('0x3f')][_0xcdaf('0x40')]({'name':_0x2281db[_0xcdaf('0x41')],'message':_0x2281db[_0xcdaf('0x3d')],'row':_0x4d46e3});}function handleQuery(_0x1691b3){logger[_0xcdaf('0x3a')](_0x1691b3);return db[_0xcdaf('0x42')]['query'](_0x1691b3)['spread'](function(_0x1c0dd1){results[_0xcdaf('0x40')](_0x1c0dd1);})[_0xcdaf('0x43')](function(_0x5ceb5b){logger[_0xcdaf('0x3c')](_0x5ceb5b['message']);});}function main(_0x4aaf99,_0x59eeb8,_0x2fa890,_0x3322d1){logger[_0xcdaf('0x3a')](_0xcdaf('0x44'),_0x4aaf99,JSON['stringify'](_0x59eeb8));process[_0xcdaf('0x45')]('start');var _0x4db2a8=_0x59eeb8[_0xcdaf('0x46')];var _0x4b3e9d=_0x59eeb8[_0xcdaf('0x47')];var _0x2020bc=path[_0xcdaf('0x10')](config[_0xcdaf('0x48')],_0xcdaf('0x49'),_0x4b3e9d+_0xcdaf('0x4a'));var _0x3d076d=_['keys'](_0x4db2a8)[_0xcdaf('0x10')]();logger['info'](_0xcdaf('0x4b'),_0x3d076d);fs[_0xcdaf('0x4c')](_0x2020bc,_0x3d076d+'\x0a');Papa['parse'](fs[_0xcdaf('0x4d')](_0x4aaf99),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5a148f,_0x476681){try{for(var _0x59f334=0x0,_0x297c0d=[];_0x59f334<_0x5a148f[_0xcdaf('0x4e')][_0xcdaf('0x4f')];_0x59f334++){stats[_0xcdaf('0x50')]+=0x1;if(_0x5a148f[_0xcdaf('0x3f')][_0x59f334]){handleError(_0x5a148f[_0xcdaf('0x4e')][_0x59f334],_0x5a148f[_0xcdaf('0x3f')][_0x59f334]);}else{var _0x1cd0c3=[];for(var _0x28b7a7 in _0x4db2a8){if(_0x4db2a8[_0xcdaf('0x51')](_0x28b7a7)){if(_0x5a148f[_0xcdaf('0x4e')][_0x59f334][_0x4db2a8[_0x28b7a7]]){var _0x2222e2=_['trim'](_0x5a148f['data'][_0x59f334][_0x4db2a8[_0x28b7a7]][_0xcdaf('0x52')](/"/g,'\x27'));switch(_0x28b7a7){case _0xcdaf('0x1c'):var _0x5917d8=moment(_0x2222e2,_0xcdaf('0x53'),!![]);if(_0x5917d8[_0xcdaf('0x54')]()){_0x297c0d[_0xcdaf('0x40')]('\x22'+_0x2222e2+'\x22');}else{_0x1cd0c3[_0xcdaf('0x40')](_0xcdaf('0x55'));}break;case _0xcdaf('0x20'):var _0x2e65a7=parseInt(_0x2222e2);_0x2222e2=_[_0xcdaf('0x56')](_0x2e65a7)||_0x2e65a7<0x0||_0x2e65a7>0x4?_0x3322d1?0x3:0x2:_0x2e65a7;_0x297c0d[_0xcdaf('0x40')]('\x22'+_0x2222e2+'\x22');break;case _0xcdaf('0x21'):var _0x33136f=parseInt(_0x2222e2);if(_['isNumber'](_0x33136f)&&_[_0xcdaf('0x57')](_0x2fa890,_0x33136f)){_0x297c0d[_0xcdaf('0x40')]('\x22'+_0x33136f+'\x22');}else{_0x1cd0c3[_0xcdaf('0x40')](_0xcdaf('0x58'));}break;case _0xcdaf('0x59'):if(isEmail(_0x2222e2)){_0x297c0d['push']('\x22'+_0x2222e2+'\x22');}else{_0x1cd0c3['push'](_0xcdaf('0x5a'));}break;case _0xcdaf('0x5b'):var _0x424f15=moment(_0x2222e2,_0xcdaf('0x5c'),!![]);if(_0x424f15[_0xcdaf('0x54')]()){_0x297c0d[_0xcdaf('0x40')]('\x22'+_0x2222e2+'\x22');}else{_0x1cd0c3[_0xcdaf('0x40')](_0xcdaf('0x5d'));}break;default:_0x297c0d[_0xcdaf('0x40')]('\x22'+_0x2222e2+'\x22');}}else{switch(_0x28b7a7){case'firstName':case _0xcdaf('0xe'):_0x1cd0c3[_0xcdaf('0x40')](_0x28b7a7+'\x20not\x20specified');break;default:_0x297c0d[_0xcdaf('0x40')]('\x22\x22');}}}}if(_0x1cd0c3['length']){handleError(_0x5a148f[_0xcdaf('0x4e')][_0x59f334],{'code':_0xcdaf('0x5e'),'message':_0x1cd0c3[_0xcdaf('0x10')]()});}else{fs[_0xcdaf('0x5f')](_0x2020bc,_0x297c0d[_0xcdaf('0x10')]()+'\x0a');}_0x297c0d=[];}if(!(stats[_0xcdaf('0x50')]%0xc8)){socket[_0xcdaf('0x60')](_0xcdaf('0x61')+_0x4b3e9d,stats);stats[_0xcdaf('0x3f')]=[];}}if(stopped){logger[_0xcdaf('0x3a')]('Abort\x20parser');_0x476681[_0xcdaf('0x62')]();}}catch(_0x465f2c){handleError(_0x5a148f[_0xcdaf('0x4e')][_0x59f334],{'code':'SystemError','message':_0x465f2c['message']});logger[_0xcdaf('0x3c')](_0xcdaf('0x63'),_0x465f2c[_0xcdaf('0x3d')]);}},'complete':function(){try{var _0x268893=[];var _0x56d23d=_0xcdaf('0x23');if(_0x59eeb8['duplicates']&&_0x59eeb8[_0xcdaf('0x64')][_0xcdaf('0x4f')]){_0x56d23d=_0xcdaf('0x65')+_0x4b3e9d;_0x268893[_0xcdaf('0x40')](_0xcdaf('0x66')+_0x56d23d+'\x20LIKE\x20cm_contacts;');}var _0x49221c=util[_0xcdaf('0xb')](_0xcdaf('0x67'),_0x2020bc,_0x56d23d,_0x3d076d,_0x59eeb8[_0xcdaf('0x2e')],_0x59eeb8[_0xcdaf('0x33')]||null,NOW,NOW);if(_['isNil'](_0x4db2a8[_0xcdaf('0x1c')])){_0x49221c+=_0xcdaf('0x68');}_0x268893['push'](_0x49221c);if(_0x59eeb8[_0xcdaf('0x64')]&&_0x59eeb8[_0xcdaf('0x64')][_0xcdaf('0x4f')]){_0x268893[_0xcdaf('0x40')](insertCmContact(_0x59eeb8[_0xcdaf('0x2e')],_0x56d23d,_0x59eeb8['duplicates'],_0x4db2a8));_0x268893[_0xcdaf('0x40')](_0xcdaf('0x69')+_0x56d23d+';');}_0x268893[_0xcdaf('0x40')](insertCmHopper(_0x59eeb8[_0xcdaf('0x2e')],_0xcdaf('0x6a'),_0xcdaf('0x6b'),'VoiceQueueId',_0x3322d1));_0x268893[_0xcdaf('0x40')](insertCmHopperBlack(_0x59eeb8[_0xcdaf('0x2e')],_0xcdaf('0x6c'),_0xcdaf('0x6b'),_0xcdaf('0x6d')));_0x268893[_0xcdaf('0x40')](insertCmHopper(_0x59eeb8[_0xcdaf('0x2e')],_0xcdaf('0x6e'),_0xcdaf('0x6f'),_0xcdaf('0x70'),_0x3322d1));_0x268893[_0xcdaf('0x40')](insertCmHopperBlack(_0x59eeb8[_0xcdaf('0x2e')],_0xcdaf('0x71'),_0xcdaf('0x6f'),_0xcdaf('0x70')));BPromise[_0xcdaf('0x72')](_0x268893,handleQuery)['then'](function(_0x2bf59b){stats[_0xcdaf('0x73')]=!![];stats['affectedRows']=_0x59eeb8[_0xcdaf('0x64')]&&_0x59eeb8['duplicates'][_0xcdaf('0x4f')]?results[0x2][_0xcdaf('0x74')]:results[0x0][_0xcdaf('0x74')];socket[_0xcdaf('0x60')](_0xcdaf('0x61')+_0x4b3e9d,stats);fs[_0xcdaf('0x75')](_0x4aaf99);fs[_0xcdaf('0x75')](_0x2020bc);process[_0xcdaf('0x3e')](0x0);})[_0xcdaf('0x43')](function(_0x3a1891){logger['error'](_0x3a1891['message']);process['exit'](0x1);});}catch(_0x534ea1){logger[_0xcdaf('0x3c')](_0xcdaf('0x76'),_0x534ea1[_0xcdaf('0x3d')]);process[_0xcdaf('0x3e')](0x1);}},'error':function(_0x2ba09a,_0x39dc3c,_0x32402c,_0x4955e8){throw new Error(_0x4955e8);}});}function validate(){if(process[_0xcdaf('0x77')]&&process[_0xcdaf('0x77')][_0xcdaf('0x4f')]<0x4){throw new Error(_0xcdaf('0x78'));}var _0x57c90d=path['join'](config['root'],'server/files/tmp',process[_0xcdaf('0x77')][0x2]);if(!fs[_0xcdaf('0x79')](_0x57c90d)){throw new Error(_0xcdaf('0x7a'));}var _0xa61eed={};try{_0xa61eed=JSON[_0xcdaf('0x7b')](process[_0xcdaf('0x77')][0x3]);if(!_0xa61eed[_0xcdaf('0x46')]){throw new Error(_0xcdaf('0x7c'));}if(!_0xa61eed[_0xcdaf('0x46')][_0xcdaf('0xe')]){throw new Error('phone\x20is\x20mandatory');}if(!_0xa61eed['binding']['firstName']){throw new Error(_0xcdaf('0x7d'));}var _0x33f082=0x0;if(_0xa61eed[_0xcdaf('0x46')]['UserId']){_0x33f082=0x1;}if(!_0xa61eed[_0xcdaf('0x2e')]){throw new Error(_0xcdaf('0x7e'));}}catch(_0x3dbe46){throw new Error(_0xcdaf('0x7f'));}var _0x158271=[];try{_0x158271=_[_0xcdaf('0x80')](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x5b7272){logger[_0xcdaf('0x3a')](_0xcdaf('0x81'));}main(_0x57c90d,_0xa61eed,_0x158271,_0x33f082);}validate();process['on'](_0xcdaf('0x82'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0xccad=['each','then','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','defaults','localhost','redis','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','createdAt','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','\x22always\x22','cm_contacts.ListId','cm_contacts.createdAt','cm_hopper_black','updatedAt','ListId\x20=\x20?','\x20=\x20?','toString','concat','keys','ListId','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','info','Received\x20SIGINT','exit','code','spread','catch','error','message','main','stringify','start','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','createReadStream','data','length','errors','hasOwnProperty','replace','push','priority','isNaN','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','SystemRow','appendFileSync','rows','emit','contact:import:','abort','SystemError','duplicates','cm_contacts_','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','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId'];(function(_0x1b612f,_0x8dac64){var _0x3af369=function(_0x27cdb3){while(--_0x27cdb3){_0x1b612f['push'](_0x1b612f['shift']());}};_0x3af369(++_0x8dac64);}(_0xccad,0x10b));var _0xdcca=function(_0x2ee790,_0x5a8661){_0x2ee790=_0x2ee790-0x0;var _0x5a54a5=_0xccad[_0x2ee790];return _0x5a54a5;};'use strict';var fs=require('fs');var path=require(_0xdcca('0x0'));var _=require(_0xdcca('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require('bluebird');var moment=require(_0xdcca('0x2'));var squel=require(_0xdcca('0x3'));var Redis=require(_0xdcca('0x4'));var db=require(_0xdcca('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0xdcca('0x6'))(_0xdcca('0x7'));config['redis']=_[_0xdcca('0x8')](config['redis'],{'host':_0xdcca('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdcca('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xdcca('0xb')](_0xdcca('0xc'));function isEmail(_0x3dc5de){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))*$/[_0xdcca('0xd')](_0x3dc5de);}function selectNotIn(_0x35c058,_0xebb227,_0x28871b,_0x564158,_0x2c8838){return squel['select']()[_0xdcca('0xe')](_0xdcca('0xf'))[_0xdcca('0x10')](_0x564158)[_0xdcca('0x11')](_0xebb227,null,_0xebb227+_0xdcca('0x12')+_0x564158+'.'+_0x28871b)['where'](_0x564158+'.'+_0x28871b+_0xdcca('0x13')+_0x35c058+'.'+_0x28871b)[_0xdcca('0x14')](_0xebb227+_0xdcca('0x15')+_0x2c8838[_0xdcca('0x11')]()+')');}function insertCmHopper(_0x12aad6,_0x3268a5,_0x402d55,_0x366317,_0x4a054f){var _0xf7e01a=[_0xdcca('0x16'),'cm_contacts.scheduledat',_0xdcca('0x17'),'cm_contacts.ListId',_0x3268a5+'.'+_0x366317,'cm_contacts.createdAt',_0xdcca('0x18'),_0xdcca('0x19'),_0xdcca('0x1a'),'\x22'+_0x4a054f+'\x22'];return squel['insert']()[_0xdcca('0x1b')](_0xdcca('0x1c'))[_0xdcca('0x1d')](['phone',_0xdcca('0x1e'),'ContactId','ListId',_0x366317,_0xdcca('0x1f'),'updatedAt','priority','UserId',_0xdcca('0x20')],squel[_0xdcca('0x21')]()[_0xdcca('0x22')](_0xf7e01a)[_0xdcca('0x10')](_0x3268a5)['join'](_0xdcca('0x23'),null,_0xdcca('0x24')+_0x3268a5+_0xdcca('0x25'))[_0xdcca('0x11')](_0x402d55,null,_0x402d55+_0xdcca('0x12')+_0x3268a5+'.'+_0x366317)['where'](_0x3268a5+'.CmListId\x20=\x20?',_0x12aad6)['where'](_0xdcca('0x26'),NOW)[_0xdcca('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3268a5,_0x402d55,_0x366317,_0xdcca('0x1c'),['\x22always\x22',_0xdcca('0x27')]))[_0xdcca('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3268a5,_0x402d55,_0x366317,_0xdcca('0x1c'),[_0xdcca('0x28')])))['toString']();}function insertCmHopperBlack(_0x489a6b,_0x2921e0,_0x503dd3,_0x2a77db){var _0x2f6251=['cm_contacts.phone','cm_contacts.id',_0xdcca('0x29'),_0x2921e0+'.'+_0x2a77db,_0xdcca('0x2a'),_0xdcca('0x18')];return squel['insert']()[_0xdcca('0x1b')](_0xdcca('0x2b'))[_0xdcca('0x1d')](['phone','ContactId','ListId',_0x2a77db,'createdAt',_0xdcca('0x2c')],squel['select']()[_0xdcca('0x22')](_0x2f6251)[_0xdcca('0x10')](_0x2921e0)[_0xdcca('0x11')](_0xdcca('0x23'),null,'cm_contacts.ListId\x20=\x20'+_0x2921e0+_0xdcca('0x25'))[_0xdcca('0x11')](_0x503dd3,null,_0x503dd3+_0xdcca('0x12')+_0x2921e0+'.'+_0x2a77db)[_0xdcca('0x14')](_0x2921e0+'.CmListId\x20=\x20?',_0x489a6b)[_0xdcca('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xdcca('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xdcca('0xe')](_0xdcca('0xf'))[_0xdcca('0x10')](_0xdcca('0x2b'))[_0xdcca('0x14')](_0xdcca('0x2d'),_0x489a6b)[_0xdcca('0x14')](_0x2a77db+_0xdcca('0x2e'),_0x2921e0+'.'+_0x2a77db)))[_0xdcca('0x2f')]();}function insertCmContact(_0x2bca4f,_0x25a0c3,_0x12f2f6,_0xa736c7){var _0x5ac733=_[_0xdcca('0x30')](_[_0xdcca('0x31')](_0xa736c7),[_0xdcca('0x32'),_0xdcca('0x33'),_0xdcca('0x1f'),_0xdcca('0x2c')]);return squel['insert']()[_0xdcca('0x1b')]('cm_contacts')[_0xdcca('0x1d')](_0x5ac733,squel[_0xdcca('0x21')]()[_0xdcca('0x22')](_0x5ac733)['from'](_0x25a0c3)[_0xdcca('0x14')]('('+_0x12f2f6['join'](',')+_0xdcca('0x34'),squel[_0xdcca('0x21')]()[_0xdcca('0x22')](_0x12f2f6)[_0xdcca('0x10')](_0xdcca('0x23'))[_0xdcca('0x14')](_0xdcca('0x2d'),_0x2bca4f)[_0xdcca('0x14')](_0xdcca('0x35')))[_0xdcca('0x14')]('id\x20IN\x20?',squel[_0xdcca('0x21')]()['field'](_0xdcca('0x36'),_0xdcca('0x37'))['from'](_0x25a0c3)['group'](_0x12f2f6['join'](','))))['toString']();}function handleStop(){logger[_0xdcca('0x38')](_0xdcca('0x39'));stopped=!![];}function handleUncaughtException(_0x2069e8){logger['error'](_0x2069e8['message']);process[_0xdcca('0x3a')](0x1);}function handleError(_0x165021,_0x1b6b62){stats['errors']['push']({'name':_0x1b6b62[_0xdcca('0x3b')],'message':_0x1b6b62['message'],'row':_0x165021});}function handleQuery(_0x316825){logger[_0xdcca('0x38')](_0x316825);return db['sequelize']['query'](_0x316825)[_0xdcca('0x3c')](function(_0x137654){results['push'](_0x137654);})[_0xdcca('0x3d')](function(_0x2c9d7d){logger[_0xdcca('0x3e')](_0x2c9d7d[_0xdcca('0x3f')]);});}function main(_0x1eba3e,_0x4ee99a,_0x397c86,_0x324793){logger[_0xdcca('0x38')](_0xdcca('0x40'),_0x1eba3e,JSON[_0xdcca('0x41')](_0x4ee99a));process['send'](_0xdcca('0x42'));var _0xecfed3=_0x4ee99a['binding'];var _0xd31747=_0x4ee99a[_0xdcca('0x43')];var _0x26e6d7=path[_0xdcca('0x11')](config[_0xdcca('0x44')],_0xdcca('0x45'),_0xd31747+_0xdcca('0x46'));var _0x893734=_[_0xdcca('0x31')](_0xecfed3)['join']();logger['info'](_0xdcca('0x47'),_0x893734);fs[_0xdcca('0x48')](_0x26e6d7,_0x893734+'\x0a');Papa['parse'](fs[_0xdcca('0x49')](_0x1eba3e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x19fd68,_0xd562fd){try{for(var _0x41ad51=0x0,_0x283c17=[];_0x41ad51<_0x19fd68[_0xdcca('0x4a')][_0xdcca('0x4b')];_0x41ad51++){stats['rows']+=0x1;if(_0x19fd68['errors'][_0x41ad51]){handleError(_0x19fd68[_0xdcca('0x4a')][_0x41ad51],_0x19fd68[_0xdcca('0x4c')][_0x41ad51]);}else{var _0x7e978c=[];for(var _0x234c5d in _0xecfed3){if(_0xecfed3[_0xdcca('0x4d')](_0x234c5d)){if(_0x19fd68[_0xdcca('0x4a')][_0x41ad51][_0xecfed3[_0x234c5d]]){var _0x4d6855=_['trim'](_0x19fd68[_0xdcca('0x4a')][_0x41ad51][_0xecfed3[_0x234c5d]][_0xdcca('0x4e')](/"/g,'\x27'));switch(_0x234c5d){case _0xdcca('0x1e'):var _0x357008=moment(_0x4d6855,_0xdcca('0xc'),!![]);if(_0x357008['isValid']()){_0x283c17[_0xdcca('0x4f')]('\x22'+_0x4d6855+'\x22');}else{_0x7e978c['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xdcca('0x50'):var _0x3f12e0=parseInt(_0x4d6855);_0x4d6855=_[_0xdcca('0x51')](_0x3f12e0)||_0x3f12e0<0x0||_0x3f12e0>0x4?_0x324793?0x3:0x2:_0x3f12e0;_0x283c17['push']('\x22'+_0x4d6855+'\x22');break;case'UserId':var _0x31b98f=parseInt(_0x4d6855);if(_[_0xdcca('0x52')](_0x31b98f)&&_['includes'](_0x397c86,_0x31b98f)){_0x283c17[_0xdcca('0x4f')]('\x22'+_0x31b98f+'\x22');}else{_0x7e978c[_0xdcca('0x4f')](_0xdcca('0x53'));}break;case'email':if(isEmail(_0x4d6855)){_0x283c17[_0xdcca('0x4f')]('\x22'+_0x4d6855+'\x22');}else{_0x7e978c[_0xdcca('0x4f')](_0xdcca('0x54'));}break;case _0xdcca('0x55'):var _0x2fbd9a=moment(_0x4d6855,'YYYY-MM-DD',!![]);if(_0x2fbd9a[_0xdcca('0x56')]()){_0x283c17[_0xdcca('0x4f')]('\x22'+_0x4d6855+'\x22');}else{_0x7e978c[_0xdcca('0x4f')](_0xdcca('0x57'));}break;default:_0x283c17[_0xdcca('0x4f')]('\x22'+_0x4d6855+'\x22');}}else{switch(_0x234c5d){case'firstName':case _0xdcca('0xf'):_0x7e978c[_0xdcca('0x4f')](_0x234c5d+'\x20not\x20specified');break;default:_0x283c17[_0xdcca('0x4f')]('\x22\x22');}}}}if(_0x7e978c[_0xdcca('0x4b')]){handleError(_0x19fd68['data'][_0x41ad51],{'code':_0xdcca('0x58'),'message':_0x7e978c[_0xdcca('0x11')]()});}else{fs[_0xdcca('0x59')](_0x26e6d7,_0x283c17['join']()+'\x0a');}_0x283c17=[];}if(!(stats[_0xdcca('0x5a')]%0xc8)){socket[_0xdcca('0x5b')](_0xdcca('0x5c')+_0xd31747,stats);stats[_0xdcca('0x4c')]=[];}}if(stopped){logger[_0xdcca('0x38')]('Abort\x20parser');_0xd562fd[_0xdcca('0x5d')]();}}catch(_0x4ae2df){handleError(_0x19fd68[_0xdcca('0x4a')][_0x41ad51],{'code':_0xdcca('0x5e'),'message':_0x4ae2df[_0xdcca('0x3f')]});logger[_0xdcca('0x3e')]('step',_0x4ae2df['message']);}},'complete':function(){try{var _0xf2ed8e=[];var _0x56f8f3='cm_contacts';if(_0x4ee99a[_0xdcca('0x5f')]&&_0x4ee99a[_0xdcca('0x5f')][_0xdcca('0x4b')]){_0x56f8f3=_0xdcca('0x60')+_0xd31747;_0xf2ed8e['push']('CREATE\x20TABLE\x20'+_0x56f8f3+'\x20LIKE\x20cm_contacts;');}var _0x2776b4=util[_0xdcca('0xb')](_0xdcca('0x61'),_0x26e6d7,_0x56f8f3,_0x893734,_0x4ee99a[_0xdcca('0x32')],_0x4ee99a[_0xdcca('0x33')]||null,NOW,NOW);if(_[_0xdcca('0x62')](_0xecfed3['scheduledat'])){_0x2776b4+=_0xdcca('0x63');}_0xf2ed8e[_0xdcca('0x4f')](_0x2776b4);if(_0x4ee99a['duplicates']&&_0x4ee99a[_0xdcca('0x5f')][_0xdcca('0x4b')]){_0xf2ed8e[_0xdcca('0x4f')](insertCmContact(_0x4ee99a[_0xdcca('0x32')],_0x56f8f3,_0x4ee99a['duplicates'],_0xecfed3));_0xf2ed8e[_0xdcca('0x4f')](_0xdcca('0x64')+_0x56f8f3+';');}_0xf2ed8e[_0xdcca('0x4f')](insertCmHopper(_0x4ee99a['ListId'],_0xdcca('0x65'),_0xdcca('0x66'),'VoiceQueueId',_0x324793));_0xf2ed8e[_0xdcca('0x4f')](insertCmHopperBlack(_0x4ee99a[_0xdcca('0x32')],'voice_queues_has_cm_blacklists',_0xdcca('0x66'),_0xdcca('0x67')));_0xf2ed8e[_0xdcca('0x4f')](insertCmHopper(_0x4ee99a[_0xdcca('0x32')],_0xdcca('0x68'),_0xdcca('0x69'),'CampaignId',_0x324793));_0xf2ed8e[_0xdcca('0x4f')](insertCmHopperBlack(_0x4ee99a[_0xdcca('0x32')],_0xdcca('0x6a'),_0xdcca('0x69'),_0xdcca('0x6b')));BPromise[_0xdcca('0x6c')](_0xf2ed8e,handleQuery)[_0xdcca('0x6d')](function(_0x2506fc){stats['finish']=!![];stats[_0xdcca('0x6e')]=_0x4ee99a[_0xdcca('0x5f')]&&_0x4ee99a[_0xdcca('0x5f')]['length']?results[0x2][_0xdcca('0x6e')]:results[0x0][_0xdcca('0x6e')];socket[_0xdcca('0x5b')](_0xdcca('0x5c')+_0xd31747,stats);fs['unlink'](_0x1eba3e);fs[_0xdcca('0x6f')](_0x26e6d7);process[_0xdcca('0x3a')](0x0);})[_0xdcca('0x3d')](function(_0x1dddd7){logger[_0xdcca('0x3e')](_0x1dddd7[_0xdcca('0x3f')]);process[_0xdcca('0x3a')](0x1);});}catch(_0xa71e8){logger[_0xdcca('0x3e')](_0xdcca('0x70'),_0xa71e8[_0xdcca('0x3f')]);process[_0xdcca('0x3a')](0x1);}},'error':function(_0x4c7256,_0x317d56,_0x2dac5d,_0x49712d){throw new Error(_0x49712d);}});}function validate(){if(process[_0xdcca('0x71')]&&process[_0xdcca('0x71')][_0xdcca('0x4b')]<0x4){throw new Error(_0xdcca('0x72'));}var _0x559611=path[_0xdcca('0x11')](config[_0xdcca('0x44')],_0xdcca('0x45'),process[_0xdcca('0x71')][0x2]);if(!fs['existsSync'](_0x559611)){throw new Error(_0xdcca('0x73'));}var _0x29555f={};try{_0x29555f=JSON['parse'](process['argv'][0x3]);if(!_0x29555f[_0xdcca('0x74')]){throw new Error(_0xdcca('0x75'));}if(!_0x29555f[_0xdcca('0x74')]['phone']){throw new Error(_0xdcca('0x76'));}if(!_0x29555f[_0xdcca('0x74')][_0xdcca('0x77')]){throw new Error(_0xdcca('0x78'));}var _0x4274ef=0x0;if(_0x29555f[_0xdcca('0x74')]['UserId']){_0x4274ef=0x1;}if(!_0x29555f[_0xdcca('0x32')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x67b7c7){throw new Error('body\x20id\x20mandatory');}var _0x1bdfb8=[];try{_0x1bdfb8=_[_0xdcca('0x79')](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x3ae767){logger[_0xdcca('0x38')](_0xdcca('0x7a'));}main(_0x559611,_0x29555f,_0x1bdfb8,_0x4274ef);}validate();process['on'](_0xdcca('0x7b'),handleStop);process['on'](_0xdcca('0x7c'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index fdce898..74dd74e 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3011=['Member\x20Name','membername','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','queue','variable','destcalleridnum','getDescriptions','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','agentconnectAt','Agent\x20Complete','Hold\x20Time','holdtime','Talk\x20Time','outbound','Called\x20Number'];(function(_0x373f3c,_0x44e12b){var _0x555326=function(_0x5dd8d9){while(--_0x5dd8d9){_0x373f3c['push'](_0x373f3c['shift']());}};_0x555326(++_0x44e12b);}(_0x3011,0xed));var _0x1301=function(_0x267319,_0x1f73e1){_0x267319=_0x267319-0x0;var _0x7c1f12=_0x3011[_0x267319];return _0x7c1f12;};'use strict';exports[_0x1301('0x0')]=function(_0x521db2,_0x34661f){var _0x3d70d3=[{'type':_0x1301('0x1'),'content':_0x1301('0x2'),'variableName':null}];switch(_0x521db2[_0x1301('0x3')]()){case _0x1301('0x4'):switch(_0x34661f[_0x1301('0x3')]()){case'inbound':_0x3d70d3[_0x1301('0x5')]({'type':'variable','content':'','variableName':_0x1301('0x6')});_0x3d70d3[_0x1301('0x5')]({'type':'variable','content':'','variableName':'calleridnum'});break;case'outbound':_0x3d70d3['push']({'type':_0x1301('0x1'),'content':'Outbound\x20Call','variableName':null});_0x3d70d3[_0x1301('0x5')]({'type':_0x1301('0x7'),'content':'','variableName':_0x1301('0x8')});break;}}return _0x3d70d3;};exports[_0x1301('0x9')]=function(_0x53c815,_0x47dd67){var _0x520402=[];switch(_0x53c815[_0x1301('0x3')]()){case _0x1301('0x4'):switch(_0x47dd67['toLowerCase']()){case'inbound':_0x520402=[{'type':_0x1301('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x1301('0xa'),'content':'','key':_0x1301('0xb'),'keyType':_0x1301('0x7'),'variableName':'calleridnum'},{'type':_0x1301('0xa'),'content':'','key':_0x1301('0xc'),'keyType':'variable','variableName':_0x1301('0xd')},{'type':'keyValue','content':'','key':_0x1301('0xe'),'keyType':_0x1301('0x7'),'variableName':_0x1301('0xf')},{'type':_0x1301('0xa'),'content':'','key':'Queue','keyType':_0x1301('0x7'),'variableName':'queue'},{'type':_0x1301('0xa'),'content':'','key':_0x1301('0x10'),'keyType':_0x1301('0x7'),'variableName':_0x1301('0x11')},{'type':_0x1301('0xa'),'content':'','key':_0x1301('0x12'),'keyType':_0x1301('0x7'),'variableName':_0x1301('0x13')},{'type':'string','content':_0x1301('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x1301('0xa'),'content':'','key':_0x1301('0x15'),'keyType':_0x1301('0x7'),'variableName':'destcalleridname'},{'type':'keyValue','content':'','key':'Agent\x20Number','keyType':_0x1301('0x7'),'variableName':_0x1301('0x8')},{'type':_0x1301('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x1301('0xa'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':_0x1301('0x13')},{'type':'keyValue','content':'','key':'Agent\x20Connect','keyType':_0x1301('0x7'),'variableName':_0x1301('0x16')},{'type':_0x1301('0xa'),'content':'','key':_0x1301('0x17'),'keyType':_0x1301('0x7'),'variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':_0x1301('0x18'),'keyType':_0x1301('0x7'),'variableName':_0x1301('0x19')},{'type':_0x1301('0xa'),'content':'','key':_0x1301('0x1a'),'keyType':_0x1301('0x7'),'variableName':'talktime'}];break;case _0x1301('0x1b'):_0x520402=[{'type':_0x1301('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x1301('0xa'),'content':'','key':_0x1301('0x1c'),'keyType':_0x1301('0x7'),'keyContent':'','variableName':_0x1301('0x8')},{'type':'keyValue','content':'','key':_0x1301('0x1d'),'keyType':_0x1301('0x7'),'keyContent':'','variableName':_0x1301('0x1e')},{'type':'keyValue','content':'','key':_0x1301('0x10'),'keyType':_0x1301('0x7'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0x1301('0x12'),'keyType':'variable','keyContent':'','variableName':'starttime'},{'type':_0x1301('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x1301('0xa'),'content':'','key':'Answer\x20Time','keyType':_0x1301('0x7'),'keyContent':'','variableName':_0x1301('0x1f')},{'type':'keyValue','content':'','key':_0x1301('0x20'),'keyType':'variable','keyContent':'','variableName':_0x1301('0x21')},{'type':_0x1301('0xa'),'content':'','key':_0x1301('0x22'),'keyType':_0x1301('0x7'),'keyContent':'','variableName':_0x1301('0x23')},{'type':_0x1301('0xa'),'content':'','key':_0x1301('0x24'),'keyType':'variable','keyContent':'','variableName':_0x1301('0x25')}];break;}}return _0x520402;}; \ No newline at end of file +var _0x1829=['outbound','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','calleridnum','calleridname','Call\x20To','destexten','Queue','UniqueId','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','talktime','Called\x20Number','membername','uniqueid','Date','starttime','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','push','variable','queue'];(function(_0x3bc44d,_0x47f40a){var _0x5e9b5b=function(_0x46492d){while(--_0x46492d){_0x3bc44d['push'](_0x3bc44d['shift']());}};_0x5e9b5b(++_0x47f40a);}(_0x1829,0xf9));var _0x9182=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x1829[_0x4fbfd9];return _0x31dc94;};'use strict';exports[_0x9182('0x0')]=function(_0x4f6c15,_0x341791){var _0x53bda0=[{'type':_0x9182('0x1'),'content':_0x9182('0x2'),'variableName':null}];switch(_0x4f6c15['toLowerCase']()){case _0x9182('0x3'):switch(_0x341791[_0x9182('0x4')]()){case _0x9182('0x5'):_0x53bda0[_0x9182('0x6')]({'type':_0x9182('0x7'),'content':'','variableName':_0x9182('0x8')});_0x53bda0[_0x9182('0x6')]({'type':_0x9182('0x7'),'content':'','variableName':'calleridnum'});break;case _0x9182('0x9'):_0x53bda0[_0x9182('0x6')]({'type':_0x9182('0x1'),'content':_0x9182('0xa'),'variableName':null});_0x53bda0['push']({'type':_0x9182('0x7'),'content':'','variableName':_0x9182('0xb')});break;}}return _0x53bda0;};exports['getDescriptions']=function(_0x3f29ad,_0xb259f3){var _0x384a9b=[];switch(_0x3f29ad['toLowerCase']()){case'voice':switch(_0xb259f3[_0x9182('0x4')]()){case _0x9182('0x5'):_0x384a9b=[{'type':_0x9182('0x1'),'content':_0x9182('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x9182('0xd'),'content':'','key':'Caller\x20Number','keyType':_0x9182('0x7'),'variableName':_0x9182('0xe')},{'type':_0x9182('0xd'),'content':'','key':'Caller\x20Name','keyType':_0x9182('0x7'),'variableName':_0x9182('0xf')},{'type':_0x9182('0xd'),'content':'','key':_0x9182('0x10'),'keyType':_0x9182('0x7'),'variableName':_0x9182('0x11')},{'type':'keyValue','content':'','key':_0x9182('0x12'),'keyType':_0x9182('0x7'),'variableName':_0x9182('0x8')},{'type':_0x9182('0xd'),'content':'','key':_0x9182('0x13'),'keyType':'variable','variableName':'uniqueid'},{'type':_0x9182('0xd'),'content':'','key':'Date','keyType':_0x9182('0x7'),'variableName':_0x9182('0x14')},{'type':_0x9182('0x1'),'content':_0x9182('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0x9182('0xd'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':_0x9182('0x16')},{'type':_0x9182('0xd'),'content':'','key':_0x9182('0x17'),'keyType':'variable','variableName':_0x9182('0xb')},{'type':'string','content':_0x9182('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x9182('0xd'),'content':'','key':_0x9182('0x19'),'keyType':_0x9182('0x7'),'variableName':_0x9182('0x14')},{'type':_0x9182('0xd'),'content':'','key':_0x9182('0x1a'),'keyType':_0x9182('0x7'),'variableName':_0x9182('0x1b')},{'type':_0x9182('0xd'),'content':'','key':_0x9182('0x1c'),'keyType':_0x9182('0x7'),'variableName':_0x9182('0x1d')},{'type':_0x9182('0xd'),'content':'','key':'Hold\x20Time','keyType':_0x9182('0x7'),'variableName':'holdtime'},{'type':_0x9182('0xd'),'content':'','key':'Talk\x20Time','keyType':_0x9182('0x7'),'variableName':_0x9182('0x1e')}];break;case'outbound':_0x384a9b=[{'type':'string','content':_0x9182('0xc'),'variableName':null},{'type':_0x9182('0xd'),'content':'','key':_0x9182('0x1f'),'keyType':_0x9182('0x7'),'keyContent':'','variableName':_0x9182('0xb')},{'type':_0x9182('0xd'),'content':'','key':'Member\x20Name','keyType':_0x9182('0x7'),'keyContent':'','variableName':_0x9182('0x20')},{'type':_0x9182('0xd'),'content':'','key':'UniqueId','keyType':_0x9182('0x7'),'keyContent':'','variableName':_0x9182('0x21')},{'type':_0x9182('0xd'),'content':'','key':_0x9182('0x22'),'keyType':_0x9182('0x7'),'keyContent':'','variableName':_0x9182('0x23')},{'type':_0x9182('0x1'),'content':_0x9182('0x18')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':_0x9182('0x7'),'keyContent':'','variableName':_0x9182('0x24')},{'type':_0x9182('0xd'),'content':'','key':_0x9182('0x25'),'keyType':_0x9182('0x7'),'keyContent':'','variableName':_0x9182('0x26')},{'type':_0x9182('0xd'),'content':'','key':_0x9182('0x27'),'keyType':_0x9182('0x7'),'keyContent':'','variableName':_0x9182('0x28')},{'type':_0x9182('0xd'),'content':'','key':_0x9182('0x29'),'keyType':'variable','keyContent':'','variableName':_0x9182('0x2a')}];break;}}return _0x384a9b;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index cea0223..4260cca 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc13d=['upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','findOne','update','then','catch','query','omit','body','html','phone','lodash','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions'];(function(_0x1d0e92,_0x10dc56){var _0x3716eb=function(_0x4a9f10){while(--_0x4a9f10){_0x1d0e92['push'](_0x1d0e92['shift']());}};_0x3716eb(++_0x10dc56);}(_0xc13d,0x15b));var _0xdc13=function(_0x4e8573,_0x12cc02){_0x4e8573=_0x4e8573-0x0;var _0x1113f5=_0xc13d[_0x4e8573];return _0x1113f5;};'use strict';var _=require(_0xdc13('0x0'));var db=require(_0xdc13('0x1'))['db'];var loggers={'openchannel':require(_0xdc13('0x2'))(_0xdc13('0x3')),'mail':require(_0xdc13('0x2'))('mail-interactions'),'fax':require(_0xdc13('0x2'))(_0xdc13('0x4')),'sms':require(_0xdc13('0x2'))('sms-interactions'),'chat':require(_0xdc13('0x2'))('chat-interactions'),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0x2908e3,_0x39768f,_0x2c8063){if(_0x2908e3&&_0x2908e3[_[_0xdc13('0x5')](_0x2c8063)+_0xdc13('0x6')]){return _0x2908e3[_[_0xdc13('0x5')](_0x2c8063)+_0xdc13('0x6')];}else if(_0x2908e3&&_0x2908e3['id']){return _0x2908e3['id'];}else if(_0x39768f&&_0x39768f['id']){return _0x39768f['id'];}else{return _0xdc13('0x7');}}function log(_0x613fd9,_0x3bf2ae,_0x166732,_0x3aac71,_0x1c13e3,_0x57db1b){loggers[_0x1c13e3[_0xdc13('0x8')]()][_0x613fd9](_0xdc13('0x9'),_0x57db1b[_0xdc13('0xa')](),_0x3bf2ae?_0x3bf2ae['id']:null,_0x3bf2ae?_0x3bf2ae[_0xdc13('0xb')]:null,_0x3bf2ae?_0x3bf2ae['role']:null,getInteractionId(_0x166732,_0x3aac71,_0x1c13e3),_0x166732?JSON[_0xdc13('0xc')](_0x166732):'null');}function updateUser(_0x44e3b2,_0x34a6ce,_0x17943,_0x9e1492,_0x384ab4){db[_['upperFirst'](_0x9e1492)+'Interaction'][_0xdc13('0xd')]({'where':{'id':getInteractionId(_0x34a6ce,_0x17943,_0x9e1492)}})['then'](function(_0x207b25){if(_0x207b25){return _0x207b25[_0xdc13('0xe')]({'UserId':_0x44e3b2?_0x44e3b2['id']:null});}})[_0xdc13('0xf')](function(_0x796a23){if(_0x796a23){log('info',_0x44e3b2,_0x34a6ce,_0x17943,_0x9e1492,_0x384ab4);}})[_0xdc13('0x10')](function(){log('error',_0x44e3b2,_0x34a6ce,_0x17943,_0x9e1492,_0x384ab4);});}exports['tracked']=function(_0x580643,_0x43b9b1){return function(_0x54c628,_0x565ed2,_0x55535a){var _0x47cd17=_0x54c628['user'];var _0x5dc447={};var _0xed943d=_0x54c628[_0xdc13('0x11')];if(_0x5dc447){_0x5dc447=_['clone'](_0x54c628['body']);_0x5dc447=_[_0xdc13('0x12')](_0x5dc447,[_0xdc13('0x13'),_0xdc13('0x14'),_0xdc13('0x15'),'fax','mobile']);}updateUser(_0x47cd17,_0x5dc447,_0xed943d,_0x580643,_0x43b9b1);_0x55535a(null);};}; \ No newline at end of file +var _0x3ea9=['whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','null','Interaction','findOne','then','update','info','catch','user','clone','body','omit','html','phone','mobile','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions'];(function(_0x33ccca,_0x89a328){var _0x1d199d=function(_0x225399){while(--_0x225399){_0x33ccca['push'](_0x33ccca['shift']());}};_0x1d199d(++_0x89a328);}(_0x3ea9,0xac));var _0x93ea=function(_0x1514be,_0x171c2b){_0x1514be=_0x1514be-0x0;var _0x1b75f9=_0x3ea9[_0x1514be];return _0x1b75f9;};'use strict';var _=require(_0x93ea('0x0'));var db=require(_0x93ea('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x93ea('0x2')),'mail':require(_0x93ea('0x3'))(_0x93ea('0x4')),'fax':require(_0x93ea('0x3'))(_0x93ea('0x5')),'sms':require(_0x93ea('0x3'))(_0x93ea('0x6')),'chat':require(_0x93ea('0x3'))(_0x93ea('0x7')),'whatsapp':require(_0x93ea('0x3'))(_0x93ea('0x8'))};function getInteractionId(_0x25cd5c,_0x27328f,_0x567ea3){if(_0x25cd5c&&_0x25cd5c[_[_0x93ea('0x9')](_0x567ea3)+'InteractionId']){return _0x25cd5c[_[_0x93ea('0x9')](_0x567ea3)+_0x93ea('0xa')];}else if(_0x25cd5c&&_0x25cd5c['id']){return _0x25cd5c['id'];}else if(_0x27328f&&_0x27328f['id']){return _0x27328f['id'];}else{return _0x93ea('0xb');}}function log(_0x299a64,_0x394e3a,_0x2fa1dd,_0x34563d,_0x34cac7,_0x1a8122){loggers[_0x34cac7[_0x93ea('0xc')]()][_0x299a64](_0x93ea('0xd'),_0x1a8122[_0x93ea('0xe')](),_0x394e3a?_0x394e3a['id']:null,_0x394e3a?_0x394e3a['name']:null,_0x394e3a?_0x394e3a['role']:null,getInteractionId(_0x2fa1dd,_0x34563d,_0x34cac7),_0x2fa1dd?JSON[_0x93ea('0xf')](_0x2fa1dd):_0x93ea('0x10'));}function updateUser(_0xfba072,_0x595de4,_0x8412d5,_0x3889b8,_0x2230a2){db[_['upperFirst'](_0x3889b8)+_0x93ea('0x11')][_0x93ea('0x12')]({'where':{'id':getInteractionId(_0x595de4,_0x8412d5,_0x3889b8)}})[_0x93ea('0x13')](function(_0x175a38){if(_0x175a38){return _0x175a38[_0x93ea('0x14')]({'UserId':_0xfba072?_0xfba072['id']:null});}})[_0x93ea('0x13')](function(_0x2cd8a9){if(_0x2cd8a9){log(_0x93ea('0x15'),_0xfba072,_0x595de4,_0x8412d5,_0x3889b8,_0x2230a2);}})[_0x93ea('0x16')](function(){log('error',_0xfba072,_0x595de4,_0x8412d5,_0x3889b8,_0x2230a2);});}exports['tracked']=function(_0x1abc74,_0x134ebe){return function(_0x14e3cc,_0x2d97e9,_0x6ed529){var _0x5fd695=_0x14e3cc[_0x93ea('0x17')];var _0x102b52={};var _0x83d068=_0x14e3cc['query'];if(_0x102b52){_0x102b52=_[_0x93ea('0x18')](_0x14e3cc[_0x93ea('0x19')]);_0x102b52=_[_0x93ea('0x1a')](_0x102b52,[_0x93ea('0x19'),_0x93ea('0x1b'),_0x93ea('0x1c'),'fax',_0x93ea('0x1d')]);}updateUser(_0x5fd695,_0x102b52,_0x83d068,_0x1abc74,_0x134ebe);_0x6ed529(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 6a651ca..70bee7e 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f5d=['user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','base64','utf8','parse','hasOwnProperty','use','License','findOne','count','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin'];(function(_0x2a287a,_0xb5245b){var _0x3dab48=function(_0x1c677b){while(--_0x1c677b){_0x2a287a['push'](_0x2a287a['shift']());}};_0x3dab48(++_0xb5245b);}(_0x3f5d,0x11a));var _0xd3f5=function(_0x23c998,_0x54dae5){_0x23c998=_0x23c998-0x0;var _0x10f9a7=_0x3f5d[_0x23c998];return _0x10f9a7;};'use strict';var crypto=require(_0xd3f5('0x0'));var util=require(_0xd3f5('0x1'));var compose=require(_0xd3f5('0x2'));var db=require(_0xd3f5('0x3'))['db'];var config=require(_0xd3f5('0x4'));function getValueFromLicense(_0x2d8e12,_0x2245d3){if(_0x2d8e12&&_0x2245d3){if(_0x2245d3[_0xd3f5('0x5')]&&_0x2245d3[_0xd3f5('0x6')]){var _0x4c1113=_0x2245d3[_0xd3f5('0x5')];var _0x5232be=_0x2245d3[_0xd3f5('0x6')];var _0x2f980c=_0x4c1113[_0xd3f5('0x7')]('-')[0x4];var _0x40b7c5=_0x4c1113[_0xd3f5('0x7')]('-')[0x0];var _0x245295=crypto['createDecipher'](_0xd3f5('0x8'),util[_0xd3f5('0x9')](_0xd3f5('0xa'),_0x2f980c,_0x4c1113,_0x40b7c5));var _0x86dbc3=_0x245295['update'](_0x5232be,_0xd3f5('0xb'),_0xd3f5('0xc'));_0x86dbc3+=_0x245295['final'](_0xd3f5('0xc'));var _0x459905=JSON[_0xd3f5('0xd')](_0x86dbc3);return _0x459905[_0xd3f5('0xe')](_0x2d8e12)?_0x459905[_0x2d8e12]:null;}}return null;}function isLimit(_0x18ca2a,_0x50a9cc,_0x54d100,_0x269881){var _0x2dbc77=_0x50a9cc;return compose()[_0xd3f5('0xf')](function(_0x32efc8,_0x57179f,_0x60ac3a){return db[_0xd3f5('0x10')][_0xd3f5('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x255574){var _0x2dea8f=getValueFromLicense(_0x18ca2a,_0x255574);return _0x2dea8f?_0x2dea8f:_0x2dbc77;})['then'](function(_0x2df58c){_0x2dbc77=_0x2df58c;return _0x54d100[_0xd3f5('0x12')](_0x269881);})[_0xd3f5('0x13')](function(_0x445f6d){if(_0x445f6d>=_0x2dbc77){return _0x57179f[_0xd3f5('0x14')](0x193)[_0xd3f5('0x15')]({'message':util[_0xd3f5('0x9')](_0xd3f5('0x16'),_0x18ca2a)});}_0x60ac3a();})['catch'](function(_0x1aae63){_0x60ac3a(_0x1aae63);});});}function isUserLimit(){return isLimit(_0xd3f5('0x17'),0x1,db[_0xd3f5('0x18')],{'where':{'$or':[{'role':_0xd3f5('0x19')},{'role':_0xd3f5('0x1a')}]}});}exports[_0xd3f5('0x1b')]=isUserLimit; \ No newline at end of file +var _0xee07=['user','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','update','base64','utf8','final','parse','hasOwnProperty','use','License','count','then','json','catch','users','User','admin'];(function(_0xe1d15d,_0x2cac6a){var _0x439bc2=function(_0x2323f7){while(--_0x2323f7){_0xe1d15d['push'](_0xe1d15d['shift']());}};_0x439bc2(++_0x2cac6a);}(_0xee07,0x16d));var _0x7ee0=function(_0x2e7769,_0x36772d){_0x2e7769=_0x2e7769-0x0;var _0x98272e=_0xee07[_0x2e7769];return _0x98272e;};'use strict';var crypto=require('crypto');var util=require(_0x7ee0('0x0'));var compose=require(_0x7ee0('0x1'));var db=require(_0x7ee0('0x2'))['db'];var config=require(_0x7ee0('0x3'));function getValueFromLicense(_0x4f2d4f,_0x4e8186){if(_0x4f2d4f&&_0x4e8186){if(_0x4e8186[_0x7ee0('0x4')]&&_0x4e8186[_0x7ee0('0x5')]){var _0x2c8eda=_0x4e8186['data1'];var _0x44682b=_0x4e8186[_0x7ee0('0x5')];var _0x47960e=_0x2c8eda[_0x7ee0('0x6')]('-')[0x4];var _0x2da82e=_0x2c8eda[_0x7ee0('0x6')]('-')[0x0];var _0x1c4128=crypto[_0x7ee0('0x7')](_0x7ee0('0x8'),util[_0x7ee0('0x9')]('%s:%s:%s',_0x47960e,_0x2c8eda,_0x2da82e));var _0x5423dd=_0x1c4128[_0x7ee0('0xa')](_0x44682b,_0x7ee0('0xb'),_0x7ee0('0xc'));_0x5423dd+=_0x1c4128[_0x7ee0('0xd')](_0x7ee0('0xc'));var _0x565fff=JSON[_0x7ee0('0xe')](_0x5423dd);return _0x565fff[_0x7ee0('0xf')](_0x4f2d4f)?_0x565fff[_0x4f2d4f]:null;}}return null;}function isLimit(_0x34a4b1,_0x3200a0,_0x128ae6,_0x1b8b79){var _0x293534=_0x3200a0;return compose()[_0x7ee0('0x10')](function(_0x49bc9d,_0x2cdd5c,_0x33141f){return db[_0x7ee0('0x11')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x3905e5){var _0x4a1fe6=getValueFromLicense(_0x34a4b1,_0x3905e5);return _0x4a1fe6?_0x4a1fe6:_0x293534;})['then'](function(_0x56299b){_0x293534=_0x56299b;return _0x128ae6[_0x7ee0('0x12')](_0x1b8b79);})[_0x7ee0('0x13')](function(_0x3ca9a4){if(_0x3ca9a4>=_0x293534){return _0x2cdd5c['status'](0x193)[_0x7ee0('0x14')]({'message':util[_0x7ee0('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x34a4b1)});}_0x33141f();})[_0x7ee0('0x15')](function(_0x5a891e){_0x33141f(_0x5a891e);});});}function isUserLimit(){return isLimit(_0x7ee0('0x16'),0x1,db[_0x7ee0('0x17')],{'where':{'$or':[{'role':_0x7ee0('0x18')},{'role':_0x7ee0('0x19')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 18a8e89..73ecda8 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 _0xf7b7=['castTo','CAST(','field','\x20AS\x20','text','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$eq','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','>\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','utcOffset','minutes','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','slice','forEach','shift','indexOf','conditions','push','buildExpression','DATE','$between','value','includes','$gt','$lte','operator','add','days','format','YYYY-MM-DD'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xf7b7,0x128));var _0x7f7b=function(_0x3dfd14,_0x58db53){_0x3dfd14=_0x3dfd14-0x0;var _0x5071b4=_0xf7b7[_0x3dfd14];return _0x5071b4;};'use strict';var _=require(_0x7f7b('0x0'));var moment=require(_0x7f7b('0x1'));exports[_0x7f7b('0x2')]=function(_0x3418af){var _0x187a9c={'conditions':[]};_0x187a9c[_0x7f7b('0x3')]=_[_0x7f7b('0x4')](_0x3418af,_0x7f7b('0x5'))?'or':_0x7f7b('0x6');var _0x3fd686=_0x3418af[_0x7f7b('0x7')](_0x7f7b('0x8'),'')[_0x7f7b('0x7')](_0x7f7b('0x5'),'')[_0x7f7b('0x9')]('||');for(var _0x439ace=0x0;_0x439ace<_0x3fd686['length'];_0x439ace++){var _0x43e39e=_0x3fd686[_0x439ace][_0x7f7b('0x9')](':=');var _0x3a8157=_0x43e39e[0x0];var _0x3beef3=_0x43e39e[_0x7f7b('0xa')](0x1);_0x3beef3[_0x7f7b('0xb')](function(_0x13aea8){var _0xe4bef1=_0x13aea8[_0x7f7b('0x9')]('[')[_0x7f7b('0xc')]();var _0x4aa3f8=_0x13aea8['match'](/\[(.*?)\]/g);_0x4aa3f8[_0x7f7b('0xb')](function(_0x57daf1){var _0x1838d2=_0x57daf1['split']('[')['filter'](function(_0x441181){return _0x441181[_0x7f7b('0xd')](']')>-0x1;})['map'](function(_0xe3e18b){return _0xe3e18b[_0x7f7b('0x9')](']')[0x0];})[0x0];_0x187a9c[_0x7f7b('0xe')][_0x7f7b('0xf')]({'field':_0x3a8157,'operator':_0xe4bef1,'value':_0x1838d2});});});}return _0x187a9c;};exports[_0x7f7b('0x10')]=function(_0x1ad8b8,_0x47608d,_0xda7e8b){var _0x50ffdd={};if(_0x47608d===_0x7f7b('0x11')){if(_0xda7e8b['operator']==='$eq'){_0xda7e8b['operator']=_0x7f7b('0x12');_0xda7e8b[_0x7f7b('0x13')]+=','+_0xda7e8b['value'];}else if(_[_0x7f7b('0x14')]([_0x7f7b('0x15'),_0x7f7b('0x16')],_0xda7e8b[_0x7f7b('0x17')])){_0xda7e8b[_0x7f7b('0x13')]=moment(_0xda7e8b[_0x7f7b('0x13')])[_0x7f7b('0x18')](0x1,_0x7f7b('0x19'))[_0x7f7b('0x1a')](_0x7f7b('0x1b'));}}if(_0xda7e8b[_0x7f7b('0x1c')]){_0x47608d=_0xda7e8b[_0x7f7b('0x1c')];_0x50ffdd['text']=_0x7f7b('0x1d')+_0x1ad8b8+'.'+_0xda7e8b[_0x7f7b('0x1e')]+_0x7f7b('0x1f')+_0xda7e8b[_0x7f7b('0x1c')]+')\x20'+parseOperator(_0xda7e8b[_0x7f7b('0x17')]);}else{_0x50ffdd[_0x7f7b('0x20')]=_0x1ad8b8+'.'+_0xda7e8b[_0x7f7b('0x1e')]+'\x20'+parseOperator(_0xda7e8b[_0x7f7b('0x17')]);}if(_[_0x7f7b('0x14')]([_0x7f7b('0x21'),_0x7f7b('0x22')],_0xda7e8b['operator']))_0x50ffdd['text']='('+_0x50ffdd[_0x7f7b('0x20')]+_0x7f7b('0x23')+_0x1ad8b8+'.'+_0xda7e8b['field']+_0x7f7b('0x24');_0x50ffdd[_0x7f7b('0x13')]=parseValue(_0x47608d,_0xda7e8b[_0x7f7b('0x17')],_0xda7e8b[_0x7f7b('0x13')]);return _0x50ffdd;};function parseOperator(_0x4fb058){var _0x2e04ec;switch(_0x4fb058){case _0x7f7b('0x25'):_0x2e04ec=_0x7f7b('0x26');break;case'$notIn':_0x2e04ec='NOT\x20IN\x20?';break;case _0x7f7b('0x27'):_0x2e04ec=_0x7f7b('0x28');break;case _0x7f7b('0x21'):_0x2e04ec=_0x7f7b('0x29');break;case _0x7f7b('0x2a'):case _0x7f7b('0x2b'):case _0x7f7b('0x2c'):_0x2e04ec='LIKE\x20?';break;case _0x7f7b('0x2d'):_0x2e04ec=_0x7f7b('0x2e');break;case _0x7f7b('0x15'):_0x2e04ec=_0x7f7b('0x2f');break;case'$lte':_0x2e04ec=_0x7f7b('0x30');break;case'$gte':_0x2e04ec=_0x7f7b('0x31');break;case'$between':_0x2e04ec=_0x7f7b('0x32');break;}return _0x2e04ec;}function parseValue(_0x3cafbd,_0xbf3021,_0x3f5516){var _0x29d70f={'start':undefined,'end':undefined};switch(_0xbf3021){case _0x7f7b('0x25'):case _0x7f7b('0x22'):_0x29d70f[_0x7f7b('0x33')]=_0x3f5516['split'](',');break;case _0x7f7b('0x2a'):_0x29d70f[_0x7f7b('0x33')]='%'+_0x3f5516+'%';break;case _0x7f7b('0x2b'):_0x29d70f[_0x7f7b('0x33')]=_0x3f5516+'%';break;case _0x7f7b('0x2c'):_0x29d70f['start']='%'+_0x3f5516;break;case _0x7f7b('0x12'):var _0x1109c1=_0x3f5516[_0x7f7b('0x9')](',');var _0x3f5516=_0x1109c1['shift']();var _0x15721a=_0x1109c1['pop']();if(_0x3cafbd==='DATE'){_0x3f5516=moment(_0x3f5516)[_0x7f7b('0x34')](0x0,!![])['format']();_0x15721a=moment(_0x15721a)[_0x7f7b('0x34')](0x0,!![])[_0x7f7b('0x18')](0x17,'hours')[_0x7f7b('0x18')](0x3b,_0x7f7b('0x35'))[_0x7f7b('0x18')](0x3b,'seconds')['format']();}_0x29d70f={'start':_0x3f5516,'end':_0x15721a};break;default:_0x29d70f['start']=_0x3f5516;break;}return _0x29d70f;} \ No newline at end of file +var _0x26a4=['seconds','lodash','moment','parseSearch','sqlOperator','startsWith','and','[$and]','replace','split','length','slice','forEach','shift','match','filter','indexOf','map','conditions','push','DATE','operator','$eq','$between','$gt','$lte','value','add','format','castTo','text','\x20AS\x20','field','includes','\x20OR\x20','$in','$notIn','NOT\x20IN\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','$gte','>=\x20?','start','pop','hours','minutes'];(function(_0x188ecd,_0x4b9cc5){var _0x2d2839=function(_0x4e8d13){while(--_0x4e8d13){_0x188ecd['push'](_0x188ecd['shift']());}};_0x2d2839(++_0x4b9cc5);}(_0x26a4,0x13f));var _0x426a=function(_0x594b91,_0x157fb3){_0x594b91=_0x594b91-0x0;var _0xe82cb1=_0x26a4[_0x594b91];return _0xe82cb1;};'use strict';var _=require(_0x426a('0x0'));var moment=require(_0x426a('0x1'));exports[_0x426a('0x2')]=function(_0x558a02){var _0x3ba8b5={'conditions':[]};_0x3ba8b5[_0x426a('0x3')]=_[_0x426a('0x4')](_0x558a02,'[$or]')?'or':_0x426a('0x5');var _0x194d55=_0x558a02['replace'](_0x426a('0x6'),'')[_0x426a('0x7')]('[$or]','')[_0x426a('0x8')]('||');for(var _0x41ecf6=0x0;_0x41ecf6<_0x194d55[_0x426a('0x9')];_0x41ecf6++){var _0x538bf5=_0x194d55[_0x41ecf6][_0x426a('0x8')](':=');var _0x29bbe6=_0x538bf5[0x0];var _0xbf0a8a=_0x538bf5[_0x426a('0xa')](0x1);_0xbf0a8a[_0x426a('0xb')](function(_0x49dab2){var _0x2e16b1=_0x49dab2[_0x426a('0x8')]('[')[_0x426a('0xc')]();var _0x160fbd=_0x49dab2[_0x426a('0xd')](/\[(.*?)\]/g);_0x160fbd[_0x426a('0xb')](function(_0x29b90f){var _0x27c72b=_0x29b90f[_0x426a('0x8')]('[')[_0x426a('0xe')](function(_0xf4d803){return _0xf4d803[_0x426a('0xf')](']')>-0x1;})[_0x426a('0x10')](function(_0x90d0af){return _0x90d0af[_0x426a('0x8')](']')[0x0];})[0x0];_0x3ba8b5[_0x426a('0x11')][_0x426a('0x12')]({'field':_0x29bbe6,'operator':_0x2e16b1,'value':_0x27c72b});});});}return _0x3ba8b5;};exports['buildExpression']=function(_0x49a154,_0x335b66,_0x32dee9){var _0x376c5a={};if(_0x335b66===_0x426a('0x13')){if(_0x32dee9[_0x426a('0x14')]===_0x426a('0x15')){_0x32dee9['operator']=_0x426a('0x16');_0x32dee9['value']+=','+_0x32dee9['value'];}else if(_['includes']([_0x426a('0x17'),_0x426a('0x18')],_0x32dee9[_0x426a('0x14')])){_0x32dee9['value']=moment(_0x32dee9[_0x426a('0x19')])[_0x426a('0x1a')](0x1,'days')[_0x426a('0x1b')]('YYYY-MM-DD');}}if(_0x32dee9['castTo']){_0x335b66=_0x32dee9[_0x426a('0x1c')];_0x376c5a[_0x426a('0x1d')]='CAST('+_0x49a154+'.'+_0x32dee9['field']+_0x426a('0x1e')+_0x32dee9[_0x426a('0x1c')]+')\x20'+parseOperator(_0x32dee9[_0x426a('0x14')]);}else{_0x376c5a[_0x426a('0x1d')]=_0x49a154+'.'+_0x32dee9[_0x426a('0x1f')]+'\x20'+parseOperator(_0x32dee9[_0x426a('0x14')]);}if(_[_0x426a('0x20')](['$ne','$notIn'],_0x32dee9[_0x426a('0x14')]))_0x376c5a[_0x426a('0x1d')]='('+_0x376c5a[_0x426a('0x1d')]+_0x426a('0x21')+_0x49a154+'.'+_0x32dee9[_0x426a('0x1f')]+'\x20IS\x20NULL)';_0x376c5a[_0x426a('0x19')]=parseValue(_0x335b66,_0x32dee9[_0x426a('0x14')],_0x32dee9[_0x426a('0x19')]);return _0x376c5a;};function parseOperator(_0x576383){var _0x5d400d;switch(_0x576383){case _0x426a('0x22'):_0x5d400d='IN\x20?';break;case _0x426a('0x23'):_0x5d400d=_0x426a('0x24');break;case _0x426a('0x15'):_0x5d400d='=\x20?';break;case _0x426a('0x25'):_0x5d400d=_0x426a('0x26');break;case _0x426a('0x27'):case _0x426a('0x28'):case _0x426a('0x29'):_0x5d400d=_0x426a('0x2a');break;case _0x426a('0x2b'):_0x5d400d=_0x426a('0x2c');break;case _0x426a('0x17'):_0x5d400d='>\x20?';break;case _0x426a('0x18'):_0x5d400d=_0x426a('0x2d');break;case _0x426a('0x2e'):_0x5d400d=_0x426a('0x2f');break;case _0x426a('0x16'):_0x5d400d='BETWEEN\x20?\x20AND\x20?';break;}return _0x5d400d;}function parseValue(_0x404162,_0x416428,_0x195a83){var _0xfe6beb={'start':undefined,'end':undefined};switch(_0x416428){case _0x426a('0x22'):case _0x426a('0x23'):_0xfe6beb[_0x426a('0x30')]=_0x195a83[_0x426a('0x8')](',');break;case _0x426a('0x27'):_0xfe6beb[_0x426a('0x30')]='%'+_0x195a83+'%';break;case'$startsWith':_0xfe6beb[_0x426a('0x30')]=_0x195a83+'%';break;case _0x426a('0x29'):_0xfe6beb['start']='%'+_0x195a83;break;case _0x426a('0x16'):var _0x27e244=_0x195a83[_0x426a('0x8')](',');var _0x195a83=_0x27e244[_0x426a('0xc')]();var _0x4a247a=_0x27e244[_0x426a('0x31')]();if(_0x404162===_0x426a('0x13')){_0x195a83=moment(_0x195a83)['utcOffset'](0x0,!![])[_0x426a('0x1b')]();_0x4a247a=moment(_0x4a247a)['utcOffset'](0x0,!![])[_0x426a('0x1a')](0x17,_0x426a('0x32'))[_0x426a('0x1a')](0x3b,_0x426a('0x33'))[_0x426a('0x1a')](0x3b,_0x426a('0x34'))[_0x426a('0x1b')]();}_0xfe6beb={'start':_0x195a83,'end':_0x4a247a};break;default:_0xfe6beb['start']=_0x195a83;break;}return _0xfe6beb;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index da207d3..c36fca2 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 _0x35ff=['split','filters','isEmpty','forOwn','find','DATE','isPlainObject','format','$lte','YYYY-MM-DD','subtract','name','isArray','limit','sort','map','priority','cast','col','unsigned','DESC','ASC','omit','length','isObject','isString','unset','hasOwnProperty','match','^[+]?[0-9]*$','replace','includes','push','join','getOptions','$id','query','model','attributes','intersection','nolimit','offset','order','where','pick','filter','merge','VIRTUAL','lower','lodash','sequelize','parse','keys','fields'];(function(_0x3a4e55,_0x171dab){var _0x4c2d50=function(_0x48b6df){while(--_0x48b6df){_0x3a4e55['push'](_0x3a4e55['shift']());}};_0x4c2d50(++_0x171dab);}(_0x35ff,0x13f));var _0xf35f=function(_0xa4d8fc,_0xc7c934){_0xa4d8fc=_0xa4d8fc-0x0;var _0x304c0e=_0x35ff[_0xa4d8fc];return _0x304c0e;};'use strict';var _=require(_0xf35f('0x0'));var sequelize=require(_0xf35f('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x50a95d){var _0x3b9fb9=['ne'];try{var _0x585be9=JSON[_0xf35f('0x2')](_0x50a95d);var _0x1859a6=Object[_0xf35f('0x3')](_0x585be9)[0x0];return _0x3b9fb9['includes'](_0x1859a6);}catch(_0x4f4e07){return![];}}function getOperatorValue(_0x6955d3){var _0x3e98a1=JSON['parse'](_0x6955d3);var _0x5befea=Object['keys'](_0x3e98a1)[0x0];var _0xd46d95=_0x3e98a1[_0x5befea];return{['$'+_0x5befea]:_0xd46d95};}exports[_0xf35f('0x4')]=function(_0x402843){var _0x5cec14=null;if(_0x402843){_0x5cec14=_0x402843[_0xf35f('0x5')](',');}return _0x5cec14;};exports[_0xf35f('0x6')]=function(_0x2e3940,_0xf8346){var _0x35b2e5={};if(!_[_0xf35f('0x7')](_0x2e3940)){_[_0xf35f('0x8')](_0x2e3940,function(_0x446eaf,_0x2d889d){try{if(_0xf8346){var _0x28f5d2=_[_0xf35f('0x9')](_0xf8346,{'name':_0x2d889d})||{};if(hasSequelizeOperator(_0x446eaf)){_0x35b2e5[_0x2d889d]=getOperatorValue(_0x446eaf);}else if(_0x28f5d2['type']===_0xf35f('0xa')&&_[_0xf35f('0xb')](_0x446eaf)){var _0x43b1ff=JSON[_0xf35f('0x2')](_0x446eaf);var _0xae8e0c={'$gte':moment(moment(_0x43b1ff['$gte'])[_0xf35f('0xc')]('YYYY-MM-DD'))['utc']()[_0xf35f('0xc')](),'$lte':moment(moment(_0x43b1ff[_0xf35f('0xd')])[_0xf35f('0xc')](_0xf35f('0xe')))['utc']()[_0xf35f('0xf')](0x1,'s')[_0xf35f('0xc')]()};_0x35b2e5[_0x2d889d]=_0xae8e0c;}else if(_0x28f5d2[_0xf35f('0x10')]==='uniqueid'){_0x35b2e5[_0x2d889d]=_0x446eaf;}else{_0x35b2e5[_0x2d889d]=_['isArray'](_0x446eaf)?_0x446eaf:JSON[_0xf35f('0x2')](_0x446eaf);}}else{_0x35b2e5[_0x2d889d]=_[_0xf35f('0x11')](_0x446eaf)?_0x446eaf:JSON[_0xf35f('0x2')](_0x446eaf);}}catch(_0x268b89){_0x35b2e5[_0x2d889d]=_0x446eaf['split'](',');}});}return _0x35b2e5;};exports[_0xf35f('0x12')]=function(_0x3cd8c3){_0x3cd8c3=parseInt(_0x3cd8c3,0xa);if(!_0x3cd8c3||_0x3cd8c3<0x0){_0x3cd8c3=LIMIT_VALUE;}return _0x3cd8c3;};exports['offset']=function(_0x486e3e){_0x486e3e=parseInt(_0x486e3e,0xa);if(!_0x486e3e||_0x486e3e<0x0){_0x486e3e=0x0;}return _0x486e3e;};exports[_0xf35f('0x13')]=function(_0x10ec27){var _0x818d2c,_0x22e72d=null;if(_0x10ec27){_0x818d2c=_0x10ec27['split'](',');_0x22e72d=_[_0xf35f('0x14')](_0x818d2c,function(_0x51af32){if(_0x51af32['indexOf']('-')===0x0){return[_0x51af32===_0xf35f('0x15')?sequelize[_0xf35f('0x16')](sequelize[_0xf35f('0x17')](_0xf35f('0x15')),_0xf35f('0x18')):_0x51af32['substr'](0x1),_0xf35f('0x19')];}else{return[_0x51af32===_0xf35f('0x15')?sequelize[_0xf35f('0x16')](sequelize['col'](_0xf35f('0x15')),'unsigned'):_0x51af32,_0xf35f('0x1a')];}});}return _0x22e72d;};exports[_0xf35f('0x1b')]=function(_0x5a3e96,_0x37575a){if(_[_0xf35f('0x7')](_0x5a3e96)){return _0x5a3e96;}if(_[_0xf35f('0x11')](_0x5a3e96)){for(var _0x3d34a3=0x0;_0x3d34a3<_0x5a3e96[_0xf35f('0x1c')];_0x3d34a3+=0x1){_0x5a3e96[_0x3d34a3]=this[_0xf35f('0x1b')](_0x5a3e96[_0x3d34a3],_0x37575a);}return _0x5a3e96;}if(!_[_0xf35f('0x1d')](_0x5a3e96)){return _0x5a3e96;}if(_[_0xf35f('0x1e')](_0x37575a)){_0x37575a=[_0x37575a];}if(!_[_0xf35f('0x11')](_0x37575a)){return _0x5a3e96;}for(var _0x41991f=0x0;_0x41991f<_0x37575a['length'];_0x41991f+=0x1){_[_0xf35f('0x1f')](_0x5a3e96,_0x37575a[_0x41991f]);}for(var _0x271953 in _0x5a3e96){if(_0x5a3e96[_0xf35f('0x20')](_0x271953)){_0x5a3e96[_0x271953]=this[_0xf35f('0x1b')](_0x5a3e96[_0x271953],_0x37575a);}}return _0x5a3e96;};exports['isNumeric']=function(_0x29c5da){return _0x29c5da[_0xf35f('0x21')](RegExp(_0xf35f('0x22')))?!![]:![];};exports['isEmail']=function(_0x3f1f65){return _0x3f1f65[_0xf35f('0x21')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x484bd3){var _0x2becd7=[];_0x484bd3[_0xf35f('0x5')](/[ ,]+/)['forEach'](function(_0x23337d){_0x23337d=_0x23337d[_0xf35f('0x23')](/([^:]")"+/g,'$1');_0x23337d='+'+_0x23337d+'*';if(_0x23337d[_0xf35f('0x24')]('@'))_0x23337d='\x22'+_0x23337d+'\x22';_0x2becd7[_0xf35f('0x25')](_0x23337d);});return _0x2becd7[_0xf35f('0x26')]('\x20');};exports[_0xf35f('0x27')]=function(_0x48f87f,_0x12fd13,_0x2aacad){var _0x1b69e3={},_0x28acd1={};if(_0x12fd13['query'][_0xf35f('0x28')]){_0x12fd13['query']['id']=_0x12fd13[_0xf35f('0x29')][_0xf35f('0x28')];delete _0x12fd13[_0xf35f('0x29')][_0xf35f('0x28')];}_0x1b69e3['model']=_[_0xf35f('0x14')](_0x48f87f,_0xf35f('0x10'));_0x1b69e3[_0xf35f('0x29')]=_['keys'](_0x12fd13['query']);_0x1b69e3[_0xf35f('0x6')]=_['intersection'](_0x1b69e3[_0xf35f('0x2a')],_0x1b69e3['query']);_0x28acd1[_0xf35f('0x2b')]=_[_0xf35f('0x2c')](_0x1b69e3[_0xf35f('0x2a')],this[_0xf35f('0x4')](_0x12fd13[_0xf35f('0x29')]['fields']));_0x28acd1[_0xf35f('0x2b')]=_0x28acd1[_0xf35f('0x2b')][_0xf35f('0x1c')]?_0x28acd1[_0xf35f('0x2b')]:_0x1b69e3[_0xf35f('0x2a')];if(!_0x12fd13[_0xf35f('0x29')][_0xf35f('0x20')](_0xf35f('0x2d'))){_0x28acd1['limit']=this[_0xf35f('0x12')](_0x12fd13[_0xf35f('0x29')][_0xf35f('0x12')]);_0x28acd1['offset']=this[_0xf35f('0x2e')](_0x12fd13[_0xf35f('0x29')][_0xf35f('0x2e')]);}_0x28acd1[_0xf35f('0x2f')]=this[_0xf35f('0x13')](_0x12fd13[_0xf35f('0x29')][_0xf35f('0x13')]);_0x28acd1[_0xf35f('0x30')]=this[_0xf35f('0x6')](_[_0xf35f('0x31')](_0x12fd13[_0xf35f('0x29')],_0x1b69e3[_0xf35f('0x6')]),_0x48f87f);if(_0x12fd13[_0xf35f('0x29')][_0xf35f('0x32')]){_0x28acd1['where']=_[_0xf35f('0x33')](_0x28acd1[_0xf35f('0x30')],{'$or':_[_0xf35f('0x14')](_0x48f87f,function(_0x153938){if(_0x153938['type']!==_0xf35f('0x34')){if(_0x2aacad){return sequelize[_0xf35f('0x30')](sequelize['fn'](_0xf35f('0x35'),sequelize[_0xf35f('0x17')](_0x153938[_0xf35f('0x10')])),{'$like':sequelize['fn'](_0xf35f('0x35'),'%'+_0x12fd13[_0xf35f('0x29')][_0xf35f('0x32')]+'%')});}else{var _0x2a856c={};_0x2a856c[_0x153938[_0xf35f('0x10')]]={'$like':'%'+_0x12fd13[_0xf35f('0x29')][_0xf35f('0x32')]+'%'};return _0x2a856c;}}})});}_0x28acd1=_[_0xf35f('0x33')]({},_0x28acd1,_0x12fd13['options']);return _0x28acd1;}; \ No newline at end of file +var _0xbbb6=['filter','merge','type','VIRTUAL','options','lodash','moment','parse','keys','includes','fields','filters','isEmpty','forOwn','DATE','isPlainObject','$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','isArray','split','limit','offset','sort','map','priority','substr','DESC','cast','col','unsigned','ASC','omit','length','isString','unset','hasOwnProperty','isNumeric','match','push','join','$id','query','intersection','attributes','model','nolimit','where'];(function(_0x1b3224,_0x3351d9){var _0x5dae4f=function(_0x22894a){while(--_0x22894a){_0x1b3224['push'](_0x1b3224['shift']());}};_0x5dae4f(++_0x3351d9);}(_0xbbb6,0x13d));var _0x6bbb=function(_0x5734e1,_0x3e1d75){_0x5734e1=_0x5734e1-0x0;var _0x22c784=_0xbbb6[_0x5734e1];return _0x22c784;};'use strict';var _=require(_0x6bbb('0x0'));var sequelize=require('sequelize');var moment=require(_0x6bbb('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xca6723){var _0x265118=['ne'];try{var _0x47f3da=JSON[_0x6bbb('0x2')](_0xca6723);var _0x5ead18=Object[_0x6bbb('0x3')](_0x47f3da)[0x0];return _0x265118[_0x6bbb('0x4')](_0x5ead18);}catch(_0x5df9c9){return![];}}function getOperatorValue(_0x10265d){var _0x51efeb=JSON['parse'](_0x10265d);var _0x25d60a=Object[_0x6bbb('0x3')](_0x51efeb)[0x0];var _0xe7c216=_0x51efeb[_0x25d60a];return{['$'+_0x25d60a]:_0xe7c216};}exports[_0x6bbb('0x5')]=function(_0x556ebd){var _0x42446f=null;if(_0x556ebd){_0x42446f=_0x556ebd['split'](',');}return _0x42446f;};exports[_0x6bbb('0x6')]=function(_0x156fe7,_0x1bb2e1){var _0x595c80={};if(!_[_0x6bbb('0x7')](_0x156fe7)){_[_0x6bbb('0x8')](_0x156fe7,function(_0x5f206a,_0x2f2b2d){try{if(_0x1bb2e1){var _0x37b050=_['find'](_0x1bb2e1,{'name':_0x2f2b2d})||{};if(hasSequelizeOperator(_0x5f206a)){_0x595c80[_0x2f2b2d]=getOperatorValue(_0x5f206a);}else if(_0x37b050['type']===_0x6bbb('0x9')&&_[_0x6bbb('0xa')](_0x5f206a)){var _0x52f352=JSON[_0x6bbb('0x2')](_0x5f206a);var _0x36003d={'$gte':moment(moment(_0x52f352[_0x6bbb('0xb')])[_0x6bbb('0xc')]('YYYY-MM-DD'))[_0x6bbb('0xd')]()[_0x6bbb('0xc')](),'$lte':moment(moment(_0x52f352[_0x6bbb('0xe')])[_0x6bbb('0xc')](_0x6bbb('0xf')))[_0x6bbb('0xd')]()[_0x6bbb('0x10')](0x1,'s')[_0x6bbb('0xc')]()};_0x595c80[_0x2f2b2d]=_0x36003d;}else if(_0x37b050[_0x6bbb('0x11')]==='uniqueid'){_0x595c80[_0x2f2b2d]=_0x5f206a;}else{_0x595c80[_0x2f2b2d]=_[_0x6bbb('0x12')](_0x5f206a)?_0x5f206a:JSON[_0x6bbb('0x2')](_0x5f206a);}}else{_0x595c80[_0x2f2b2d]=_['isArray'](_0x5f206a)?_0x5f206a:JSON[_0x6bbb('0x2')](_0x5f206a);}}catch(_0x1d3c33){_0x595c80[_0x2f2b2d]=_0x5f206a[_0x6bbb('0x13')](',');}});}return _0x595c80;};exports[_0x6bbb('0x14')]=function(_0x45a8d0){_0x45a8d0=parseInt(_0x45a8d0,0xa);if(!_0x45a8d0||_0x45a8d0<0x0){_0x45a8d0=LIMIT_VALUE;}return _0x45a8d0;};exports[_0x6bbb('0x15')]=function(_0x376b81){_0x376b81=parseInt(_0x376b81,0xa);if(!_0x376b81||_0x376b81<0x0){_0x376b81=0x0;}return _0x376b81;};exports[_0x6bbb('0x16')]=function(_0x25327a){var _0x57e6fb,_0x4db56e=null;if(_0x25327a){_0x57e6fb=_0x25327a['split'](',');_0x4db56e=_[_0x6bbb('0x17')](_0x57e6fb,function(_0x42323b){if(_0x42323b['indexOf']('-')===0x0){return[_0x42323b==='priority'?sequelize['cast'](sequelize['col'](_0x6bbb('0x18')),'unsigned'):_0x42323b[_0x6bbb('0x19')](0x1),_0x6bbb('0x1a')];}else{return[_0x42323b==='priority'?sequelize[_0x6bbb('0x1b')](sequelize[_0x6bbb('0x1c')](_0x6bbb('0x18')),_0x6bbb('0x1d')):_0x42323b,_0x6bbb('0x1e')];}});}return _0x4db56e;};exports[_0x6bbb('0x1f')]=function(_0x331949,_0x2ff566){if(_[_0x6bbb('0x7')](_0x331949)){return _0x331949;}if(_[_0x6bbb('0x12')](_0x331949)){for(var _0x5263f9=0x0;_0x5263f9<_0x331949[_0x6bbb('0x20')];_0x5263f9+=0x1){_0x331949[_0x5263f9]=this[_0x6bbb('0x1f')](_0x331949[_0x5263f9],_0x2ff566);}return _0x331949;}if(!_['isObject'](_0x331949)){return _0x331949;}if(_[_0x6bbb('0x21')](_0x2ff566)){_0x2ff566=[_0x2ff566];}if(!_[_0x6bbb('0x12')](_0x2ff566)){return _0x331949;}for(var _0x44938b=0x0;_0x44938b<_0x2ff566['length'];_0x44938b+=0x1){_[_0x6bbb('0x22')](_0x331949,_0x2ff566[_0x44938b]);}for(var _0x3f3042 in _0x331949){if(_0x331949[_0x6bbb('0x23')](_0x3f3042)){_0x331949[_0x3f3042]=this['omit'](_0x331949[_0x3f3042],_0x2ff566);}}return _0x331949;};exports[_0x6bbb('0x24')]=function(_0x336291){return _0x336291[_0x6bbb('0x25')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x451178){return _0x451178[_0x6bbb('0x25')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x4e7cf7){var _0x545753=[];_0x4e7cf7['split'](/[ ,]+/)['forEach'](function(_0x59b615){_0x59b615=_0x59b615['replace'](/([^:]")"+/g,'$1');_0x59b615='+'+_0x59b615+'*';if(_0x59b615[_0x6bbb('0x4')]('@'))_0x59b615='\x22'+_0x59b615+'\x22';_0x545753[_0x6bbb('0x26')](_0x59b615);});return _0x545753[_0x6bbb('0x27')]('\x20');};exports['getOptions']=function(_0x263a51,_0x2f0ce9,_0x3e3cf2){var _0x5188c6={},_0x4b3934={};if(_0x2f0ce9['query'][_0x6bbb('0x28')]){_0x2f0ce9[_0x6bbb('0x29')]['id']=_0x2f0ce9[_0x6bbb('0x29')][_0x6bbb('0x28')];delete _0x2f0ce9[_0x6bbb('0x29')]['$id'];}_0x5188c6['model']=_['map'](_0x263a51,_0x6bbb('0x11'));_0x5188c6[_0x6bbb('0x29')]=_[_0x6bbb('0x3')](_0x2f0ce9[_0x6bbb('0x29')]);_0x5188c6[_0x6bbb('0x6')]=_[_0x6bbb('0x2a')](_0x5188c6['model'],_0x5188c6['query']);_0x4b3934[_0x6bbb('0x2b')]=_['intersection'](_0x5188c6[_0x6bbb('0x2c')],this[_0x6bbb('0x5')](_0x2f0ce9[_0x6bbb('0x29')]['fields']));_0x4b3934['attributes']=_0x4b3934[_0x6bbb('0x2b')][_0x6bbb('0x20')]?_0x4b3934[_0x6bbb('0x2b')]:_0x5188c6['model'];if(!_0x2f0ce9[_0x6bbb('0x29')]['hasOwnProperty'](_0x6bbb('0x2d'))){_0x4b3934[_0x6bbb('0x14')]=this['limit'](_0x2f0ce9[_0x6bbb('0x29')]['limit']);_0x4b3934[_0x6bbb('0x15')]=this[_0x6bbb('0x15')](_0x2f0ce9[_0x6bbb('0x29')][_0x6bbb('0x15')]);}_0x4b3934['order']=this[_0x6bbb('0x16')](_0x2f0ce9[_0x6bbb('0x29')]['sort']);_0x4b3934[_0x6bbb('0x2e')]=this[_0x6bbb('0x6')](_['pick'](_0x2f0ce9[_0x6bbb('0x29')],_0x5188c6['filters']),_0x263a51);if(_0x2f0ce9[_0x6bbb('0x29')][_0x6bbb('0x2f')]){_0x4b3934[_0x6bbb('0x2e')]=_[_0x6bbb('0x30')](_0x4b3934[_0x6bbb('0x2e')],{'$or':_[_0x6bbb('0x17')](_0x263a51,function(_0x232c83){if(_0x232c83[_0x6bbb('0x31')]!==_0x6bbb('0x32')){if(_0x3e3cf2){return sequelize[_0x6bbb('0x2e')](sequelize['fn']('lower',sequelize[_0x6bbb('0x1c')](_0x232c83[_0x6bbb('0x11')])),{'$like':sequelize['fn']('lower','%'+_0x2f0ce9[_0x6bbb('0x29')][_0x6bbb('0x2f')]+'%')});}else{var _0x3d8cfd={};_0x3d8cfd[_0x232c83['name']]={'$like':'%'+_0x2f0ce9[_0x6bbb('0x29')][_0x6bbb('0x2f')]+'%'};return _0x3d8cfd;}}})});}_0x4b3934=_[_0x6bbb('0x30')]({},_0x4b3934,_0x2f0ce9[_0x6bbb('0x33')]);return _0x4b3934;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 541fbe1..78e0e62 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x093a=['moment','./environment','../mysqldb','get','env','production','set','appPath','root','public','development','test','join','client','use','json\x20replacer','toISOString','split','static','views','/server/views','html','ejs','renderFile','view\x20engine','urlencoded','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','path','passport','cors'];(function(_0x1336da,_0x67954f){var _0x579353=function(_0x3589c3){while(--_0x3589c3){_0x1336da['push'](_0x1336da['shift']());}};_0x579353(++_0x67954f);}(_0x093a,0x1e2));var _0xa093=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0x093a[_0x35fb56];return _0x2fd52c;};'use strict';var express=require(_0xa093('0x0'));var favicon=require(_0xa093('0x1'));var bodyParser=require(_0xa093('0x2'));var methodOverride=require(_0xa093('0x3'));var cookieParser=require(_0xa093('0x4'));var errorHandler=require('errorhandler');var path=require(_0xa093('0x5'));var passport=require(_0xa093('0x6'));var cors=require(_0xa093('0x7'));var moment=require(_0xa093('0x8'));var config=require(_0xa093('0x9'));var db=require(_0xa093('0xa'))['db'];exports['default']=function(_0x5d636d){var _0x3a430e=_0x5d636d[_0xa093('0xb')](_0xa093('0xc'));if(_0x3a430e===_0xa093('0xd')){_0x5d636d[_0xa093('0xe')](_0xa093('0xf'),path['join'](config[_0xa093('0x10')],_0xa093('0x11')));}if(_0x3a430e===_0xa093('0x12')||_0x3a430e===_0xa093('0x13')){_0x5d636d[_0xa093('0xe')](_0xa093('0xf'),path[_0xa093('0x14')](config[_0xa093('0x10')],_0xa093('0x15')));_0x5d636d[_0xa093('0x16')](errorHandler());}_0x5d636d['set'](_0xa093('0x17'),function(_0x1e8cd6,_0x137696){if(this[_0x1e8cd6]instanceof Date){_0x137696=this[_0x1e8cd6][_0xa093('0x18')]()[_0xa093('0x19')]('.')[0x0]+'Z';}return _0x137696;});_0x5d636d[_0xa093('0x16')](express[_0xa093('0x1a')](_0x5d636d[_0xa093('0xb')](_0xa093('0xf'))));_0x5d636d[_0xa093('0xe')](_0xa093('0x1b'),config['root']+_0xa093('0x1c'));_0x5d636d['engine'](_0xa093('0x1d'),require(_0xa093('0x1e'))[_0xa093('0x1f')]);_0x5d636d[_0xa093('0xe')](_0xa093('0x20'),_0xa093('0x1d'));_0x5d636d[_0xa093('0x16')](bodyParser[_0xa093('0x21')]({'limit':'50mb','extended':!![]}));_0x5d636d[_0xa093('0x16')](bodyParser['json']({'limit':'50mb'}));_0x5d636d[_0xa093('0x16')](cors());_0x5d636d[_0xa093('0x16')](methodOverride());_0x5d636d['use'](cookieParser());_0x5d636d[_0xa093('0x16')](passport[_0xa093('0x22')]());}; \ No newline at end of file +var _0x2b1a=['/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','../mysqldb','default','get','production','appPath','join','root','public','development','test','set','client','use','json\x20replacer','split','views'];(function(_0x525f73,_0x5cf7e6){var _0xbc7f27=function(_0x28c9c3){while(--_0x28c9c3){_0x525f73['push'](_0x525f73['shift']());}};_0xbc7f27(++_0x5cf7e6);}(_0x2b1a,0x172));var _0xa2b1=function(_0x387d90,_0x3811c2){_0x387d90=_0x387d90-0x0;var _0x1666cb=_0x2b1a[_0x387d90];return _0x1666cb;};'use strict';var express=require(_0xa2b1('0x0'));var favicon=require(_0xa2b1('0x1'));var bodyParser=require(_0xa2b1('0x2'));var methodOverride=require(_0xa2b1('0x3'));var cookieParser=require(_0xa2b1('0x4'));var errorHandler=require(_0xa2b1('0x5'));var path=require(_0xa2b1('0x6'));var passport=require(_0xa2b1('0x7'));var cors=require(_0xa2b1('0x8'));var moment=require(_0xa2b1('0x9'));var config=require('./environment');var db=require(_0xa2b1('0xa'))['db'];exports[_0xa2b1('0xb')]=function(_0x59e83e){var _0x3ba158=_0x59e83e[_0xa2b1('0xc')]('env');if(_0x3ba158===_0xa2b1('0xd')){_0x59e83e['set'](_0xa2b1('0xe'),path[_0xa2b1('0xf')](config[_0xa2b1('0x10')],_0xa2b1('0x11')));}if(_0x3ba158===_0xa2b1('0x12')||_0x3ba158===_0xa2b1('0x13')){_0x59e83e[_0xa2b1('0x14')]('appPath',path[_0xa2b1('0xf')](config[_0xa2b1('0x10')],_0xa2b1('0x15')));_0x59e83e[_0xa2b1('0x16')](errorHandler());}_0x59e83e[_0xa2b1('0x14')](_0xa2b1('0x17'),function(_0x314f35,_0x1dd322){if(this[_0x314f35]instanceof Date){_0x1dd322=this[_0x314f35]['toISOString']()[_0xa2b1('0x18')]('.')[0x0]+'Z';}return _0x1dd322;});_0x59e83e[_0xa2b1('0x16')](express['static'](_0x59e83e[_0xa2b1('0xc')](_0xa2b1('0xe'))));_0x59e83e['set'](_0xa2b1('0x19'),config['root']+_0xa2b1('0x1a'));_0x59e83e[_0xa2b1('0x1b')](_0xa2b1('0x1c'),require(_0xa2b1('0x1d'))[_0xa2b1('0x1e')]);_0x59e83e[_0xa2b1('0x14')](_0xa2b1('0x1f'),'html');_0x59e83e[_0xa2b1('0x16')](bodyParser[_0xa2b1('0x20')]({'limit':_0xa2b1('0x21'),'extended':!![]}));_0x59e83e['use'](bodyParser[_0xa2b1('0x22')]({'limit':_0xa2b1('0x21')}));_0x59e83e['use'](cors());_0x59e83e['use'](methodOverride());_0x59e83e[_0xa2b1('0x16')](cookieParser());_0x59e83e[_0xa2b1('0x16')](passport[_0xa2b1('0x23')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 80343e0..e816217 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 _0xc22b=['digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','update','substring','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','createHash','md5'];(function(_0x57df15,_0x5658ed){var _0x2263ff=function(_0x560d9d){while(--_0x560d9d){_0x57df15['push'](_0x57df15['shift']());}};_0x2263ff(++_0x5658ed);}(_0xc22b,0x194));var _0xbc22=function(_0xc9ff3,_0x321ef7){_0xc9ff3=_0xc9ff3-0x0;var _0x27e462=_0xc22b[_0xc9ff3];return _0x27e462;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xbc22('0x0'));var machine=require(_0xbc22('0x1'));var exec=require(_0xbc22('0x2'))[_0xbc22('0x3')];var config=require(_0xbc22('0x4'));function getInterfaces(){var _0x55a984=[];var _0x3e3070=os[_0xbc22('0x5')]();var _0x5f1824=_['orderBy'](_[_0xbc22('0x6')](_0x3e3070));for(var _0x4c2d0d=0x0;_0x4c2d0d<_0x5f1824[_0xbc22('0x7')];_0x4c2d0d++){var _0x465349=_0x3e3070[_0x5f1824[_0x4c2d0d]][_0xbc22('0x8')](function(_0x14accb){return _0x14accb[_0xbc22('0x9')]===_0xbc22('0xa')&&_0x14accb[_0xbc22('0xb')]===![];});_0x55a984=_0x55a984[_0xbc22('0xc')](_0x465349);}return _0x55a984;}function getFirstInterface(){var _0xb88600=_[_0xbc22('0xd')](getInterfaces());return{'macAddress':_0xb88600&&_0xb88600[_0xbc22('0xe')]?_0xb88600[_0xbc22('0xe')]:_0xbc22('0xf'),'ipAddress':_0xb88600&&_0xb88600[_0xbc22('0x10')]?_0xb88600[_0xbc22('0x10')]:_0xbc22('0x11')};}exports[_0xbc22('0x12')]=getFirstInterface;function getCPUhash(){var _0x225051=_[_0xbc22('0x13')](os[_0xbc22('0x14')]()[_0xbc22('0x15')](function(_0x275c0e){return _0x275c0e[_0xbc22('0x16')];}))['join'](':');return crypto[_0xbc22('0x17')](_0xbc22('0x18'))['update'](_0x225051)[_0xbc22('0x19')](_0xbc22('0x1a'));}exports[_0xbc22('0x1b')]=function(){var _0x5e0b11=os[_0xbc22('0x1c')]();var _0x6c9264=/[0-9a-f-]{36}/;if(config[_0xbc22('0x1d')]&&_0x6c9264[_0xbc22('0x1e')](config['licenseToken'])){return config['licenseToken'];}else if(_0x5e0b11===_0xbc22('0x1f')){return exec(_0xbc22('0x20'),{'encoding':_0xbc22('0x21')})['replace']('\x0d\x0a','');}else{var _0x203bac=getFirstInterface();var _0x23d291=getCPUhash();var _0x4ce979=_0x23d291+'|'+os[_0xbc22('0x22')]()+'|'+_0x203bac[_0xbc22('0x23')]+'|'+_0x203bac[_0xbc22('0x24')];var _0x3701cf=crypto[_0xbc22('0x17')]('md5')[_0xbc22('0x25')](_0x4ce979)[_0xbc22('0x19')]('hex');return _0x3701cf[_0xbc22('0x26')](0x0,0x8)+'-'+_0x3701cf[_0xbc22('0x26')](0x8,0xc)+'-'+_0x3701cf[_0xbc22('0x26')](0xc,0x10)+'-'+_0x3701cf['substring'](0x10,0x14)+'-'+_0x3701cf['substring'](0x14);}}; \ No newline at end of file +var _0x4ae7=['mac','address','127.0.0.1','getFirstInterface','cpus','map','model','join','md5','digest','getUuid','platform','licenseToken','test','win32','utf8','replace','macAddress','ipAddress','createHash','update','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','head'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4ae7,0x82));var _0x74ae=function(_0xaeb259,_0x132cf9){_0xaeb259=_0xaeb259-0x0;var _0x96525a=_0x4ae7[_0xaeb259];return _0x96525a;};'use strict';var _=require(_0x74ae('0x0'));var os=require('os');var crypto=require(_0x74ae('0x1'));var machine=require(_0x74ae('0x2'));var exec=require(_0x74ae('0x3'))[_0x74ae('0x4')];var config=require(_0x74ae('0x5'));function getInterfaces(){var _0x357248=[];var _0x4bbdb7=os[_0x74ae('0x6')]();var _0x23c2f1=_[_0x74ae('0x7')](_[_0x74ae('0x8')](_0x4bbdb7));for(var _0x37b22c=0x0;_0x37b22c<_0x23c2f1[_0x74ae('0x9')];_0x37b22c++){var _0x2ad12f=_0x4bbdb7[_0x23c2f1[_0x37b22c]][_0x74ae('0xa')](function(_0x462f50){return _0x462f50['family']===_0x74ae('0xb')&&_0x462f50[_0x74ae('0xc')]===![];});_0x357248=_0x357248['concat'](_0x2ad12f);}return _0x357248;}function getFirstInterface(){var _0x54cf74=_[_0x74ae('0xd')](getInterfaces());return{'macAddress':_0x54cf74&&_0x54cf74[_0x74ae('0xe')]?_0x54cf74[_0x74ae('0xe')]:'00:00:00:00:00:00','ipAddress':_0x54cf74&&_0x54cf74[_0x74ae('0xf')]?_0x54cf74[_0x74ae('0xf')]:_0x74ae('0x10')};}exports[_0x74ae('0x11')]=getFirstInterface;function getCPUhash(){var _0x4441f6=_[_0x74ae('0x7')](os[_0x74ae('0x12')]()[_0x74ae('0x13')](function(_0x4b62ae){return _0x4b62ae[_0x74ae('0x14')];}))[_0x74ae('0x15')](':');return crypto['createHash'](_0x74ae('0x16'))['update'](_0x4441f6)[_0x74ae('0x17')]('hex');}exports[_0x74ae('0x18')]=function(){var _0x8e3725=os[_0x74ae('0x19')]();var _0x52f87e=/[0-9a-f-]{36}/;if(config[_0x74ae('0x1a')]&&_0x52f87e[_0x74ae('0x1b')](config[_0x74ae('0x1a')])){return config[_0x74ae('0x1a')];}else if(_0x8e3725===_0x74ae('0x1c')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x74ae('0x1d')})[_0x74ae('0x1e')]('\x0d\x0a','');}else{var _0x530fbd=getFirstInterface();var _0x3eacae=getCPUhash();var _0x2f25cb=_0x3eacae+'|'+os['hostname']()+'|'+_0x530fbd[_0x74ae('0x1f')]+'|'+_0x530fbd[_0x74ae('0x20')];var _0x1f6c44=crypto[_0x74ae('0x21')](_0x74ae('0x16'))[_0x74ae('0x22')](_0x2f25cb)[_0x74ae('0x17')]('hex');return _0x1f6c44['substring'](0x0,0x8)+'-'+_0x1f6c44[_0x74ae('0x23')](0x8,0xc)+'-'+_0x1f6c44[_0x74ae('0x23')](0xc,0x10)+'-'+_0x1f6c44[_0x74ae('0x23')](0x10,0x14)+'-'+_0x1f6c44[_0x74ae('0x23')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index a56b5dc..0e492fa 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 _0x66ef=['then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','update','diff','days','DEMO\x20START\x20AT\x20%s','error','finally','getUuid','License','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET'];(function(_0x3f602f,_0x56b053){var _0x41912c=function(_0x56a218){while(--_0x56a218){_0x3f602f['push'](_0x3f602f['shift']());}};_0x41912c(++_0x56b053);}(_0x66ef,0x19e));var _0xf66e=function(_0x1ae6f6,_0x5aafb2){_0x1ae6f6=_0x1ae6f6-0x0;var _0x17578d=_0x66ef[_0x1ae6f6];return _0x17578d;};'use strict';var util=require(_0xf66e('0x0'));var moment=require(_0xf66e('0x1'));var rp=require(_0xf66e('0x2'));var BPromise=require(_0xf66e('0x3'));var pkginfo=require(_0xf66e('0x4'))(module,_0xf66e('0x5'));var db=require(_0xf66e('0x6'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xf66e('0x7'));var logger=require('../logger')(_0xf66e('0x8'));var HOST=_0xf66e('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3a2b46){return new BPromise(function(_0x17b39f,_0x27e443){var _0x5bbb16=util[_0xf66e('0xa')](_0xf66e('0xb'),HOST,_0x3a2b46,module[_0xf66e('0xc')]['version']);if(oldToken){_0x5bbb16=util[_0xf66e('0xa')](_0xf66e('0xd'),HOST,_0x3a2b46,module[_0xf66e('0xc')][_0xf66e('0x5')],oldToken);}var _0x8e3f73={'uri':_0x5bbb16,'method':_0xf66e('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x8e3f73)[_0xf66e('0xf')](function(_0x5a288a){_0x17b39f(_0x5a288a);})[_0xf66e('0x10')](function(_0x284bc4){_0x27e443(_0x284bc4);});});}function manageLicense(_0x3c227f,_0x2294e6){var _0xde84ef=_0x2294e6[_0xf66e('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0xde84ef[_0xf66e('0x12')]!==_0x3c227f&&!_0xde84ef[_0xf66e('0x13')]){oldToken=_0xde84ef['data1'];}httpRequest(_0x3c227f)[_0xf66e('0xf')](function(_0x5ace57){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5ace57[_0xf66e('0x14')]){isOldTokenSent=![];if(!_0xde84ef[_0xf66e('0x8')]&&_0xde84ef[_0xf66e('0x8')]!=_0x5ace57[_0xf66e('0x8')]||_0xde84ef[_0xf66e('0x8')]&&_0xde84ef[_0xf66e('0x13')]){logger[_0xf66e('0x15')](_0xf66e('0x16'));}if(_0xde84ef[_0xf66e('0x8')]&&!_0xde84ef[_0xf66e('0x13')]&&_0xde84ef[_0xf66e('0x8')]!=_0x5ace57[_0xf66e('0x8')]){logger['info'](_0xf66e('0x17'));}if(_0xde84ef[_0xf66e('0x8')]&&!_0xde84ef[_0xf66e('0x13')]&&_0xde84ef['license']==_0x5ace57[_0xf66e('0x8')]){return _0x2294e6;}return _0x2294e6['update']({'data1':_0x3c227f,'data2':null,'license':_0x5ace57[_0xf66e('0x8')]});}else{if(_0x5ace57[_0xf66e('0x8')]||_0xde84ef['license']){if(!_0xde84ef['data2']){if(_0xde84ef['data1']==_0x3c227f){GRAY_PERIOD_REASON=_0xf66e('0x18');logger[_0xf66e('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xf66e('0x19');logger[_0xf66e('0x15')](_0xf66e('0x1a'),_0xde84ef[_0xf66e('0x12')],_0x3c227f);}logger[_0xf66e('0x15')](_0xf66e('0x1b'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0xf66e('0x1c')));return _0x2294e6[_0xf66e('0x1d')]({'data2':encryptor['encryptString'](moment()[_0xf66e('0xa')](_0xf66e('0x1c')))});}else{if(moment()[_0xf66e('0x1e')](encryptor['decryptString'](_0xde84ef['data2']),_0xf66e('0x1f'))>DAYS){logger[_0xf66e('0x15')](_0xf66e('0x20'),moment()[_0xf66e('0xa')](_0xf66e('0x1c')));isOldTokenSent=![];return _0x2294e6[_0xf66e('0x1d')]({'data1':_0x3c227f,'data2':null,'license':null});}}}else{if(_0xde84ef[_0xf66e('0x12')]!=_0x3c227f){logger[_0xf66e('0x15')](_0xf66e('0x1a'),_0xde84ef[_0xf66e('0x12')],_0x3c227f);return _0x2294e6[_0xf66e('0x1d')]({'data1':_0x3c227f,'data2':null,'license':null});}}}return _0x2294e6;})[_0xf66e('0xf')](function(_0x56838e){_0x2294e6=_0x56838e;})[_0xf66e('0x10')](function(_0x53ebbb){logger[_0xf66e('0x21')](_0x53ebbb['message']);})[_0xf66e('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0xf66e('0x23')](),_0x2294e6);},TIME);});}function defaultLicense(){var _0x1bd34e=hardware[_0xf66e('0x23')]();if(_0x1bd34e){return db[_0xf66e('0x24')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x1bd34e}})['spread'](function(_0x2713c3,_0x167b53){logger['info'](_0xf66e('0x25'),_0x1bd34e);manageLicense(_0x1bd34e,_0x2713c3);})[_0xf66e('0x10')](function(_0x1c1f73){logger[_0xf66e('0x21')](_0x1c1f73['message']);});}}exports[_0xf66e('0x26')]=defaultLicense; \ No newline at end of file +var _0x331f=['SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','../logger','exports','format','GET','then','catch','get','data2','data1','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','diff','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid','findOrCreate'];(function(_0x302f93,_0x35550f){var _0x28a0ab=function(_0x564e3a){while(--_0x564e3a){_0x302f93['push'](_0x302f93['shift']());}};_0x28a0ab(++_0x35550f);}(_0x331f,0x1f0));var _0xf331=function(_0x552ec1,_0x65c220){_0x552ec1=_0x552ec1-0x0;var _0x35ec67=_0x331f[_0x552ec1];return _0x35ec67;};'use strict';var util=require(_0xf331('0x0'));var moment=require(_0xf331('0x1'));var rp=require(_0xf331('0x2'));var BPromise=require(_0xf331('0x3'));var pkginfo=require(_0xf331('0x4'))(module,_0xf331('0x5'));var db=require(_0xf331('0x6'))['db'];var encryptor=require(_0xf331('0x7'));var hardware=require('./hardware');var logger=require(_0xf331('0x8'))('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x40df34){return new BPromise(function(_0x37e3fb,_0xd6bfe4){var _0x2f9b70=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x40df34,module[_0xf331('0x9')][_0xf331('0x5')]);if(oldToken){_0x2f9b70=util[_0xf331('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x40df34,module['exports'][_0xf331('0x5')],oldToken);}var _0x530fa4={'uri':_0x2f9b70,'method':_0xf331('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x530fa4)[_0xf331('0xc')](function(_0x162c0b){_0x37e3fb(_0x162c0b);})[_0xf331('0xd')](function(_0x1a51aa){_0xd6bfe4(_0x1a51aa);});});}function manageLicense(_0x7024b7,_0xb668c5){var _0x141dce=_0xb668c5[_0xf331('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x141dce['data1']!==_0x7024b7&&!_0x141dce[_0xf331('0xf')]){oldToken=_0x141dce[_0xf331('0x10')];}httpRequest(_0x7024b7)[_0xf331('0xc')](function(_0x2a236f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2a236f['active']){isOldTokenSent=![];if(!_0x141dce[_0xf331('0x11')]&&_0x141dce[_0xf331('0x11')]!=_0x2a236f[_0xf331('0x11')]||_0x141dce[_0xf331('0x11')]&&_0x141dce[_0xf331('0xf')]){logger[_0xf331('0x12')](_0xf331('0x13'));}if(_0x141dce[_0xf331('0x11')]&&!_0x141dce['data2']&&_0x141dce['license']!=_0x2a236f[_0xf331('0x11')]){logger[_0xf331('0x12')](_0xf331('0x14'));}if(_0x141dce[_0xf331('0x11')]&&!_0x141dce['data2']&&_0x141dce[_0xf331('0x11')]==_0x2a236f[_0xf331('0x11')]){return _0xb668c5;}return _0xb668c5['update']({'data1':_0x7024b7,'data2':null,'license':_0x2a236f[_0xf331('0x11')]});}else{if(_0x2a236f['license']||_0x141dce[_0xf331('0x11')]){if(!_0x141dce[_0xf331('0xf')]){if(_0x141dce['data1']==_0x7024b7){GRAY_PERIOD_REASON=_0xf331('0x15');logger[_0xf331('0x12')](_0xf331('0x16'));}else{GRAY_PERIOD_REASON=_0xf331('0x17');logger[_0xf331('0x12')](_0xf331('0x18'),_0x141dce[_0xf331('0x10')],_0x7024b7);}logger[_0xf331('0x12')](_0xf331('0x19'),GRAY_PERIOD_REASON[_0xf331('0x1a')](),moment()[_0xf331('0xa')](_0xf331('0x1b')));return _0xb668c5[_0xf331('0x1c')]({'data2':encryptor['encryptString'](moment()['format'](_0xf331('0x1b')))});}else{if(moment()[_0xf331('0x1d')](encryptor['decryptString'](_0x141dce[_0xf331('0xf')]),_0xf331('0x1e'))>DAYS){logger[_0xf331('0x12')](_0xf331('0x1f'),moment()[_0xf331('0xa')](_0xf331('0x1b')));isOldTokenSent=![];return _0xb668c5[_0xf331('0x1c')]({'data1':_0x7024b7,'data2':null,'license':null});}}}else{if(_0x141dce[_0xf331('0x10')]!=_0x7024b7){logger[_0xf331('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x141dce[_0xf331('0x10')],_0x7024b7);return _0xb668c5['update']({'data1':_0x7024b7,'data2':null,'license':null});}}}return _0xb668c5;})[_0xf331('0xc')](function(_0x891cd5){_0xb668c5=_0x891cd5;})[_0xf331('0xd')](function(_0x4c29b5){logger[_0xf331('0x20')](_0x4c29b5[_0xf331('0x21')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0xb668c5);},TIME);});}function defaultLicense(){var _0x5786ae=hardware[_0xf331('0x22')]();if(_0x5786ae){return db['License'][_0xf331('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x5786ae}})['spread'](function(_0x2aae74,_0x4707d1){logger[_0xf331('0x12')](_0xf331('0x24'),_0x5786ae);manageLicense(_0x5786ae,_0x2aae74);})[_0xf331('0xd')](function(_0x7684ef){logger[_0xf331('0x20')](_0x7684ef[_0xf331('0x21')]);});}}exports[_0xf331('0x25')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 46f0499..ab72b13 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 _0xc3f0=['License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','data2','split','decryptString','format','%s:%s:%s','parse','machineUuid','gray','deadline','days','grayReason','changed','message','User','findAll','sequelize','COUNT','col','role','count','admin','user','telephone','telephones','forEach','pick'];(function(_0x5e21a4,_0x152eae){var _0xcb25b5=function(_0x29d8c3){while(--_0x29d8c3){_0x5e21a4['push'](_0x5e21a4['shift']());}};_0xcb25b5(++_0x152eae);}(_0xc3f0,0x8f));var _0x0c3f=function(_0x376186,_0x13bd0e){_0x376186=_0x376186-0x0;var _0x340b3e=_0xc3f0[_0x376186];return _0x340b3e;};'use strict';var util=require(_0x0c3f('0x0'));var _=require(_0x0c3f('0x1'));var moment=require(_0x0c3f('0x2'));var BPromise=require(_0x0c3f('0x3'));var hardware=require(_0x0c3f('0x4'));var encryptor=require(_0x0c3f('0x5'));var db=require(_0x0c3f('0x6'))['db'];const demoLicense={'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':![],'description':_0x0c3f('0x7'),'machineUuid':hardware[_0x0c3f('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x0c3f('0x9'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x376c0a){return new BPromise(function(_0x3af6a2,_0x5e7212){return db[_0x0c3f('0xa')][_0x0c3f('0xb')](_[_0x0c3f('0xc')](_0x376c0a,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x4fe55a){return checkLicense(_0x4fe55a,null);})[_0x0c3f('0xd')](function(_0x265d74){_0x3af6a2(_0x265d74);return;})[_0x0c3f('0xe')](function(_0x5079d3){_0x5e7212(_0x5079d3);});});}function checkLicense(_0x53cf8c,_0x583062){if(!_0x53cf8c){demoLicense[_0x0c3f('0xf')]=_0x53cf8c[_0x0c3f('0x10')];return demoLicense;}try{var _0x4e6f39=_0x583062||_0x53cf8c[_0x0c3f('0x11')];if(_[_0x0c3f('0x12')](_0x4e6f39)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x33e12c=_0x53cf8c[_0x0c3f('0x10')];var _0x47f00c=_0x53cf8c[_0x0c3f('0x13')];var _0x302ba7=_0x33e12c['split']('-')[0x4];var _0x525474=_0x33e12c[_0x0c3f('0x14')]('-')[0x0];var _0x4d2b93=encryptor[_0x0c3f('0x15')](_0x4e6f39,util[_0x0c3f('0x16')](_0x0c3f('0x17'),_0x302ba7,_0x33e12c,_0x525474));var _0x3047d7=JSON[_0x0c3f('0x18')](_0x4d2b93);_0x3047d7['demo']=![];_0x3047d7[_0x0c3f('0xf')]=_0x33e12c;_0x3047d7[_0x0c3f('0x19')]=hardware[_0x0c3f('0x8')]();if(_0x47f00c){var _0xe99674=encryptor[_0x0c3f('0x15')](_0x47f00c);_0x3047d7[_0x0c3f('0x1a')]=_0xe99674;_0x3047d7[_0x0c3f('0x1b')]=moment(_0xe99674)['add'](0x7,_0x0c3f('0x1c'))[_0x0c3f('0x16')]();_0x3047d7[_0x0c3f('0x1d')]=_0x3047d7[_0x0c3f('0xf')]!=_0x3047d7[_0x0c3f('0x19')]?_0x0c3f('0x1e'):'disabled';}return _0x3047d7;}catch(_0x53e5fc){breakingLicense[_0x0c3f('0xf')]=_0x53cf8c[_0x0c3f('0x10')];breakingLicense[_0x0c3f('0x1f')]=_0x53e5fc['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x27c181,_0x5e9e53){getLicense()['then'](function(_0x53dbb9){return db[_0x0c3f('0x20')][_0x0c3f('0x21')]({'attributes':['role',[db[_0x0c3f('0x22')]['fn'](_0x0c3f('0x23'),db[_0x0c3f('0x22')][_0x0c3f('0x24')](_0x0c3f('0x25'))),_0x0c3f('0x26')]],'group':_0x0c3f('0x25'),'where':{'role':{'$or':[_0x0c3f('0x27'),_0x0c3f('0x28'),_0x0c3f('0x29')]}},'raw':!![]})[_0x0c3f('0xd')](function(_0x351307){var _0x4258ca={'user':_0x53dbb9['users']||0x0,'telephone':_0x53dbb9[_0x0c3f('0x2a')]||0x0};_0x351307[_0x0c3f('0x2b')](function(_0x2ed3f0){var _0x5cffc9=_0x2ed3f0[_0x0c3f('0x25')]==='admin'?_0x0c3f('0x28'):_0x2ed3f0[_0x0c3f('0x25')];_0x4258ca[_0x5cffc9]-=_0x2ed3f0[_0x0c3f('0x26')];if(_0x4258ca[_0x5cffc9]<0x0)_0x4258ca[_0x5cffc9]=0x0;});_0x27c181(_0x4258ca);return;});})[_0x0c3f('0xe')](function(_0x45acc3){_0x5e9e53(_0x45acc3);});});}function checkUserLimits(_0x375702){return new BPromise(function(_0x49c375,_0xc5f840){getLimits()[_0x0c3f('0xd')](function(_0x152205){var _0x27ec57=_[_0x0c3f('0x2c')](_['countBy'](_0x375702,'role'),['admin',_0x0c3f('0x28'),_0x0c3f('0x29')]);var _0x324e08=(_0x27ec57['admin']||0x0)+(_0x27ec57['user']||0x0);var _0x5adcfc=_0x27ec57['telephone']||0x0;if(_0x324e08>_0x152205['user'])return _0xc5f840(_0x0c3f('0x2d'));if(_0x5adcfc>_0x152205[_0x0c3f('0x29')])return _0xc5f840('License\x20limit\x20reached\x20for\x20telephones');return _0x49c375();})[_0x0c3f('0xe')](function(_0xdfa0e1){_0xc5f840(_0xdfa0e1);});});}module[_0x0c3f('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xa2ca=['Demo\x20license','Breaking\x20license','getUuid','License','find','then','catch','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','demo','uuid','machineUuid','gray','deadline','add','days','grayReason','changed','message','User','findAll','role','sequelize','COUNT','admin','user','telephone','users','telephones','count','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z'];(function(_0x118481,_0x204650){var _0x493415=function(_0x29eb7a){while(--_0x29eb7a){_0x118481['push'](_0x118481['shift']());}};_0x493415(++_0x204650);}(_0xa2ca,0xae));var _0xaa2c=function(_0x4533a2,_0x3f88b1){_0x4533a2=_0x4533a2-0x0;var _0x24ddb1=_0xa2ca[_0x4533a2];return _0x24ddb1;};'use strict';var util=require(_0xaa2c('0x0'));var _=require('lodash');var moment=require(_0xaa2c('0x1'));var BPromise=require('bluebird');var hardware=require(_0xaa2c('0x2'));var encryptor=require(_0xaa2c('0x3'));var db=require(_0xaa2c('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xaa2c('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xaa2c('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xaa2c('0x7'),'machineUuid':hardware[_0xaa2c('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x170fb3){return new BPromise(function(_0x317313,_0x54d6d5){return db[_0xaa2c('0x9')][_0xaa2c('0xa')](_['defaults'](_0x170fb3,{'raw':!![],'where':{'id':0x1}}))[_0xaa2c('0xb')](function(_0x2a702b){return checkLicense(_0x2a702b,null);})['then'](function(_0x1ac043){_0x317313(_0x1ac043);return;})[_0xaa2c('0xc')](function(_0x385568){_0x54d6d5(_0x385568);});});}function checkLicense(_0x45dda5,_0x263ce1){if(!_0x45dda5){demoLicense['uuid']=_0x45dda5[_0xaa2c('0xd')];return demoLicense;}try{var _0x1103ee=_0x263ce1||_0x45dda5['license'];if(_[_0xaa2c('0xe')](_0x1103ee)){throw new Error(_0xaa2c('0xf'));}var _0x150a93=_0x45dda5[_0xaa2c('0xd')];var _0x5a7d2d=_0x45dda5[_0xaa2c('0x10')];var _0x4d8f38=_0x150a93[_0xaa2c('0x11')]('-')[0x4];var _0x1731b8=_0x150a93['split']('-')[0x0];var _0x5541f5=encryptor[_0xaa2c('0x12')](_0x1103ee,util[_0xaa2c('0x13')]('%s:%s:%s',_0x4d8f38,_0x150a93,_0x1731b8));var _0x1870cd=JSON['parse'](_0x5541f5);_0x1870cd[_0xaa2c('0x14')]=![];_0x1870cd[_0xaa2c('0x15')]=_0x150a93;_0x1870cd[_0xaa2c('0x16')]=hardware['getUuid']();if(_0x5a7d2d){var _0x5103a1=encryptor['decryptString'](_0x5a7d2d);_0x1870cd[_0xaa2c('0x17')]=_0x5103a1;_0x1870cd[_0xaa2c('0x18')]=moment(_0x5103a1)[_0xaa2c('0x19')](0x7,_0xaa2c('0x1a'))[_0xaa2c('0x13')]();_0x1870cd[_0xaa2c('0x1b')]=_0x1870cd[_0xaa2c('0x15')]!=_0x1870cd[_0xaa2c('0x16')]?_0xaa2c('0x1c'):'disabled';}return _0x1870cd;}catch(_0x3cf0f){breakingLicense[_0xaa2c('0x15')]=_0x45dda5['data1'];breakingLicense[_0xaa2c('0x1d')]=_0x3cf0f[_0xaa2c('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xe322c0,_0x37fa42){getLicense()['then'](function(_0x4492b8){return db[_0xaa2c('0x1e')][_0xaa2c('0x1f')]({'attributes':[_0xaa2c('0x20'),[db[_0xaa2c('0x21')]['fn'](_0xaa2c('0x22'),db['sequelize']['col'](_0xaa2c('0x20'))),'count']],'group':_0xaa2c('0x20'),'where':{'role':{'$or':[_0xaa2c('0x23'),_0xaa2c('0x24'),_0xaa2c('0x25')]}},'raw':!![]})[_0xaa2c('0xb')](function(_0x111aad){var _0x4b44a1={'user':_0x4492b8[_0xaa2c('0x26')]||0x0,'telephone':_0x4492b8[_0xaa2c('0x27')]||0x0};_0x111aad['forEach'](function(_0x3bc7b2){var _0x3b065c=_0x3bc7b2[_0xaa2c('0x20')]===_0xaa2c('0x23')?_0xaa2c('0x24'):_0x3bc7b2[_0xaa2c('0x20')];_0x4b44a1[_0x3b065c]-=_0x3bc7b2[_0xaa2c('0x28')];if(_0x4b44a1[_0x3b065c]<0x0)_0x4b44a1[_0x3b065c]=0x0;});_0xe322c0(_0x4b44a1);return;});})[_0xaa2c('0xc')](function(_0x57954a){_0x37fa42(_0x57954a);});});}function checkUserLimits(_0x38388d){return new BPromise(function(_0x24b0cf,_0x45b87d){getLimits()[_0xaa2c('0xb')](function(_0x5aa516){var _0x1fbe84=_[_0xaa2c('0x29')](_[_0xaa2c('0x2a')](_0x38388d,_0xaa2c('0x20')),['admin',_0xaa2c('0x24'),_0xaa2c('0x25')]);var _0x4583de=(_0x1fbe84['admin']||0x0)+(_0x1fbe84[_0xaa2c('0x24')]||0x0);var _0xcbdcc4=_0x1fbe84[_0xaa2c('0x25')]||0x0;if(_0x4583de>_0x5aa516[_0xaa2c('0x24')])return _0x45b87d('License\x20limit\x20reached\x20for\x20users');if(_0xcbdcc4>_0x5aa516[_0xaa2c('0x25')])return _0x45b87d(_0xaa2c('0x2b'));return _0x24b0cf();})[_0xaa2c('0xc')](function(_0x2756a8){_0x45b87d(_0x2756a8);});});}module[_0xaa2c('0x2c')]={'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 65283e1..09d83f8 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 _0x5c3c=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x2390bd,_0x212fbd){var _0x3a969d=function(_0x3dd049){while(--_0x3dd049){_0x2390bd['push'](_0x2390bd['shift']());}};_0x3a969d(++_0x212fbd);}(_0x5c3c,0x132));var _0xc5c3=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x5c3c[_0x424a9a];return _0xa7831c;};'use strict';module[_0xc5c3('0x0')]={'DOMAIN':_0xc5c3('0x1'),'SESSION_SECRET':_0xc5c3('0x2'),'GOOGLE_ID':_0xc5c3('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x5464=['secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x55c9ea,_0xf80189){var _0x59d18e=function(_0x55ec90){while(--_0x55ec90){_0x55c9ea['push'](_0x55c9ea['shift']());}};_0x59d18e(++_0xf80189);}(_0x5464,0x15d));var _0x4546=function(_0x31c698,_0x1b2034){_0x31c698=_0x31c698-0x0;var _0x9ac382=_0x5464[_0x31c698];return _0x9ac382;};'use strict';module[_0x4546('0x0')]={'DOMAIN':_0x4546('0x1'),'SESSION_SECRET':_0x4546('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x4546('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 00e486c..cf3981c 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa34c=['util','path','join','/var','format','%s-%s.log','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','%s-%s','error','transports','File','info','Console','env','debugLevel'];(function(_0x188360,_0x3d93f8){var _0x1fbe6d=function(_0x3d9d32){while(--_0x3d9d32){_0x188360['push'](_0x188360['shift']());}};_0x1fbe6d(++_0x3d93f8);}(_0xa34c,0x111));var _0xca34=function(_0x159730,_0x339700){_0x159730=_0x159730-0x0;var _0x81d72d=_0xa34c[_0x159730];return _0x81d72d;};'use strict';var moment=require('moment');var winston=require('winston');var util=require(_0xca34('0x0'));var path=require(_0xca34('0x1'));var debugLevel='INFO';function filename(_0x50bafa,_0x1a6943){return path[_0xca34('0x2')](_0xca34('0x3'),'log','xcally',util[_0xca34('0x4')](_0xca34('0x5'),_0x50bafa,_0x1a6943));}function formatter(_0x3e44e2,_0x14a870){_0x14a870[_0xca34('0x6')]=_0x14a870[_0xca34('0x6')][_0xca34('0x7')](/@@{/g,_0xca34('0x8'))['replace'](/}@@/g,'}}}')[_0xca34('0x7')](/@{/g,'{{')[_0xca34('0x7')](/}@/g,'}}');return util[_0xca34('0x4')](_0xca34('0x9'),moment()[_0xca34('0x4')](_0xca34('0xa')),_0x14a870['level'][_0xca34('0xb')](),_0x3e44e2,_0x14a870[_0xca34('0x6')]);}module[_0xca34('0xc')]=function(_0x428c2f){return new winston['Logger']({'transports':[new winston['transports']['File']({'name':util[_0xca34('0x4')](_0xca34('0xd'),_0x428c2f,_0xca34('0xe')),'filename':filename(_0x428c2f,_0xca34('0xe')),'level':_0xca34('0xe'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x28fb4e){return formatter(_0x428c2f,_0x28fb4e);}}),new winston[(_0xca34('0xf'))][(_0xca34('0x10'))]({'name':util[_0xca34('0x4')](_0xca34('0xd'),_0x428c2f,_0xca34('0x11')),'filename':filename(_0x428c2f,_0xca34('0x11')),'level':_0xca34('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xd989b5){return formatter(_0x428c2f,_0xd989b5);}}),new winston[(_0xca34('0xf'))][(_0xca34('0x12'))]({'level':process[_0xca34('0x13')][_0xca34('0x14')]||debugLevel,'json':![],'formatter':function(_0x4ba74d){return formatter(_0x428c2f,_0x4ba74d);}})]});}; \ No newline at end of file +var _0xbddf=['%s-%s','info','env','debugLevel','moment','winston','util','INFO','/var','log','xcally','}}}','replace','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','exports','Logger','transports','File','error'];(function(_0x2495cd,_0x596e32){var _0x5e489b=function(_0xb5031f){while(--_0xb5031f){_0x2495cd['push'](_0x2495cd['shift']());}};_0x5e489b(++_0x596e32);}(_0xbddf,0x12f));var _0xfbdd=function(_0x2d59ec,_0x4ad8f2){_0x2d59ec=_0x2d59ec-0x0;var _0x46a352=_0xbddf[_0x2d59ec];return _0x46a352;};'use strict';var moment=require(_0xfbdd('0x0'));var winston=require(_0xfbdd('0x1'));var util=require(_0xfbdd('0x2'));var path=require('path');var debugLevel=_0xfbdd('0x3');function filename(_0x2c8c4b,_0x58779e){return path['join'](_0xfbdd('0x4'),_0xfbdd('0x5'),_0xfbdd('0x6'),util['format']('%s-%s.log',_0x2c8c4b,_0x58779e));}function formatter(_0x1b98ec,_0x42b0c1){_0x42b0c1['message']=_0x42b0c1['message']['replace'](/@@{/g,'{{{')['replace'](/}@@/g,_0xfbdd('0x7'))[_0xfbdd('0x8')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xfbdd('0x9')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xfbdd('0x9')](_0xfbdd('0xa')),_0x42b0c1[_0xfbdd('0xb')][_0xfbdd('0xc')](),_0x1b98ec,_0x42b0c1[_0xfbdd('0xd')]);}module[_0xfbdd('0xe')]=function(_0x3d29c9){return new winston[(_0xfbdd('0xf'))]({'transports':[new winston[(_0xfbdd('0x10'))][(_0xfbdd('0x11'))]({'name':util[_0xfbdd('0x9')]('%s-%s',_0x3d29c9,_0xfbdd('0x12')),'filename':filename(_0x3d29c9,_0xfbdd('0x12')),'level':_0xfbdd('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x49e96c){return formatter(_0x3d29c9,_0x49e96c);}}),new winston[(_0xfbdd('0x10'))]['File']({'name':util[_0xfbdd('0x9')](_0xfbdd('0x13'),_0x3d29c9,_0xfbdd('0x14')),'filename':filename(_0x3d29c9,_0xfbdd('0x14')),'level':_0xfbdd('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4182f3){return formatter(_0x3d29c9,_0x4182f3);}}),new winston[(_0xfbdd('0x10'))]['Console']({'level':process[_0xfbdd('0x15')][_0xfbdd('0x16')]||debugLevel,'json':![],'formatter':function(_0x2ea26c){return formatter(_0x3d29c9,_0x2ea26c);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 624e493..d8bd6c4 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 _0x26a0=['../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi'];(function(_0x18b931,_0x2cad1d){var _0x114958=function(_0x445b4f){while(--_0x445b4f){_0x18b931['push'](_0x18b931['shift']());}};_0x114958(++_0x2cad1d);}(_0x26a0,0x119));var _0x026a=function(_0x2f30f6,_0x1bb680){_0x2f30f6=_0x2f30f6-0x0;var _0x4995ed=_0x26a0[_0x2f30f6];return _0x4995ed;};'use strict';var path=require(_0x026a('0x0'));var os=require('os');var config={'apps':[{'name':_0x026a('0x1'),'script':path[_0x026a('0x2')](__dirname,_0x026a('0x3'))},{'name':_0x026a('0x4'),'script':path[_0x026a('0x2')](__dirname,_0x026a('0x5'))},{'name':_0x026a('0x6'),'script':path[_0x026a('0x2')](__dirname,'../../services/agi/index.js')},{'name':'email','script':path[_0x026a('0x2')](__dirname,_0x026a('0x7'))},{'name':_0x026a('0x8'),'script':path[_0x026a('0x2')](__dirname,_0x026a('0x9'))},{'name':_0x026a('0xa'),'script':path[_0x026a('0x2')](__dirname,_0x026a('0xb'))}]};module['exports']=config; \ No newline at end of file +var _0xd14c=['agi','email','../../services/email/index.js','routing','xdr','exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js'];(function(_0x2393c0,_0x5d5d61){var _0x188aa9=function(_0x330de9){while(--_0x330de9){_0x2393c0['push'](_0x2393c0['shift']());}};_0x188aa9(++_0x5d5d61);}(_0xd14c,0x16e));var _0xcd14=function(_0x3e6707,_0x37475e){_0x3e6707=_0x3e6707-0x0;var _0x12b38d=_0xd14c[_0x3e6707];return _0x12b38d;};'use strict';var path=require(_0xcd14('0x0'));var os=require('os');var config={'apps':[{'name':_0xcd14('0x1'),'script':path[_0xcd14('0x2')](__dirname,_0xcd14('0x3'))},{'name':_0xcd14('0x4'),'script':path['join'](__dirname,_0xcd14('0x5'))},{'name':_0xcd14('0x6'),'script':path[_0xcd14('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0xcd14('0x7'),'script':path[_0xcd14('0x2')](__dirname,_0xcd14('0x8'))},{'name':_0xcd14('0x9'),'script':path[_0xcd14('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0xcd14('0xa'),'script':path[_0xcd14('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0xcd14('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 629ce4b..574fad3 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 _0xae09=['stop','restart','list','describe','delete','dump','saved','pm2','connect','connected','start','then','disconnect'];(function(_0x3ce508,_0x9d2899){var _0x4297bf=function(_0x177989){while(--_0x177989){_0x3ce508['push'](_0x3ce508['shift']());}};_0x4297bf(++_0x9d2899);}(_0xae09,0x7c));var _0x9ae0=function(_0x3676b7,_0x52675c){_0x3676b7=_0x3676b7-0x0;var _0x13aee5=_0xae09[_0x3676b7];return _0x13aee5;};'use strict';var pm2=require(_0x9ae0('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x1ae9ea,_0x5b29f0){return pm2[_0x9ae0('0x1')](function(_0x36f39f){if(_0x36f39f){return _0x5b29f0(_0x36f39f);}return _0x1ae9ea(_0x9ae0('0x2'));});});};exports[_0x9ae0('0x3')]=function(_0x5188b0){return connect()[_0x9ae0('0x4')](function(){return new BPromise(function(_0x3bfb4e,_0x5634ce){return pm2['start'](_0x5188b0,function(_0x378781,_0x51d24d){if(_0x378781){return _0x5634ce(_0x378781);}pm2[_0x9ae0('0x5')]();return _0x3bfb4e(_0x51d24d);});});});};exports['stop']=function(_0x405e96){return connect()[_0x9ae0('0x4')](function(){return new BPromise(function(_0x51cfa4,_0x1149da){return pm2[_0x9ae0('0x6')](_0x405e96,function(_0x5cd4c7,_0x2e277c){if(_0x5cd4c7){return _0x1149da(_0x5cd4c7);}pm2[_0x9ae0('0x5')]();return _0x51cfa4(_0x2e277c);});});});};exports[_0x9ae0('0x7')]=function(_0x2e011b){return connect()[_0x9ae0('0x4')](function(){return new BPromise(function(_0x5aa78a,_0x4b7c8f){return pm2[_0x9ae0('0x7')](_0x2e011b,function(_0x397d37,_0x19e492){if(_0x397d37){return _0x4b7c8f(_0x397d37);}pm2['disconnect']();return _0x5aa78a(_0x19e492);});});});};exports['list']=function(){return connect()[_0x9ae0('0x4')](function(){return new BPromise(function(_0x332476,_0x8bd8c1){return pm2[_0x9ae0('0x8')](function(_0x42be93,_0x63999d){if(_0x42be93){return _0x8bd8c1(_0x42be93);}pm2['disconnect']();return _0x332476(_0x63999d);});});});};exports[_0x9ae0('0x9')]=function(_0x573ba3){return connect()[_0x9ae0('0x4')](function(){return new BPromise(function(_0x5e0710,_0x319e9c){return pm2[_0x9ae0('0x9')](_0x573ba3,function(_0x5e52b6,_0x3aad31){if(_0x5e52b6){return _0x319e9c(_0x5e52b6);}pm2[_0x9ae0('0x5')]();return _0x5e0710(_0x3aad31);});});});};exports[_0x9ae0('0xa')]=function(_0x3a4cdc){return connect()[_0x9ae0('0x4')](function(){return new BPromise(function(_0x5ee0b8,_0x39b7da){return pm2['delete'](_0x3a4cdc,function(_0x1aca7a,_0x4e68f9){if(_0x1aca7a){return _0x39b7da(_0x1aca7a);}pm2['disconnect']();return _0x5ee0b8(_0x4e68f9);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x9b7134,_0x519481){return pm2[_0x9ae0('0xb')](function(_0x55f2fc){if(_0x55f2fc){return _0x519481(_0x55f2fc);}return _0x9b7134(_0x9ae0('0xc'));});});});}; \ No newline at end of file +var _0x9cb2=['disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird','connect','connected','start','then'];(function(_0x3005d5,_0xf588c7){var _0x547c7e=function(_0x4514dc){while(--_0x4514dc){_0x3005d5['push'](_0x3005d5['shift']());}};_0x547c7e(++_0xf588c7);}(_0x9cb2,0x14a));var _0x29cb=function(_0x359b45,_0x40f922){_0x359b45=_0x359b45-0x0;var _0x4798a0=_0x9cb2[_0x359b45];return _0x4798a0;};'use strict';var pm2=require(_0x29cb('0x0'));var BPromise=require(_0x29cb('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x31c64b,_0x4d66f1){return pm2[_0x29cb('0x2')](function(_0x44ab3f){if(_0x44ab3f){return _0x4d66f1(_0x44ab3f);}return _0x31c64b(_0x29cb('0x3'));});});};exports[_0x29cb('0x4')]=function(_0x51a08a){return connect()[_0x29cb('0x5')](function(){return new BPromise(function(_0x171dd3,_0x325f7a){return pm2[_0x29cb('0x4')](_0x51a08a,function(_0x4e2363,_0x5066e4){if(_0x4e2363){return _0x325f7a(_0x4e2363);}pm2[_0x29cb('0x6')]();return _0x171dd3(_0x5066e4);});});});};exports[_0x29cb('0x7')]=function(_0x4f2a2a){return connect()[_0x29cb('0x5')](function(){return new BPromise(function(_0x151148,_0x1ac3f1){return pm2[_0x29cb('0x7')](_0x4f2a2a,function(_0x27a4b3,_0x263c97){if(_0x27a4b3){return _0x1ac3f1(_0x27a4b3);}pm2[_0x29cb('0x6')]();return _0x151148(_0x263c97);});});});};exports[_0x29cb('0x8')]=function(_0x160d8b){return connect()['then'](function(){return new BPromise(function(_0x2bd45b,_0x58a429){return pm2[_0x29cb('0x8')](_0x160d8b,function(_0x543fbb,_0x527c31){if(_0x543fbb){return _0x58a429(_0x543fbb);}pm2['disconnect']();return _0x2bd45b(_0x527c31);});});});};exports[_0x29cb('0x9')]=function(){return connect()[_0x29cb('0x5')](function(){return new BPromise(function(_0x22d109,_0x452f3e){return pm2[_0x29cb('0x9')](function(_0x28417a,_0x13f8c6){if(_0x28417a){return _0x452f3e(_0x28417a);}pm2[_0x29cb('0x6')]();return _0x22d109(_0x13f8c6);});});});};exports[_0x29cb('0xa')]=function(_0x218a5c){return connect()[_0x29cb('0x5')](function(){return new BPromise(function(_0x815f2b,_0x21316b){return pm2['describe'](_0x218a5c,function(_0x303668,_0x1a99ed){if(_0x303668){return _0x21316b(_0x303668);}pm2[_0x29cb('0x6')]();return _0x815f2b(_0x1a99ed);});});});};exports[_0x29cb('0xb')]=function(_0x65ac90){return connect()[_0x29cb('0x5')](function(){return new BPromise(function(_0x3c157b,_0x44089e){return pm2[_0x29cb('0xb')](_0x65ac90,function(_0x3497be,_0x24d39c){if(_0x3497be){return _0x44089e(_0x3497be);}pm2[_0x29cb('0x6')]();return _0x3c157b(_0x24d39c);});});});};exports[_0x29cb('0xc')]=function(){return connect()[_0x29cb('0x5')](function(){return new BPromise(function(_0x46ffba,_0x45415e){return pm2[_0x29cb('0xc')](function(_0x33b439){if(_0x33b439){return _0x45415e(_0x33b439);}return _0x46ffba(_0x29cb('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 4980325..b1c8325 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 _0xdbf2=['info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','inspect','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','then','ChatInteraction','findAll','chatTimeout','minutes','length','map'];(function(_0x1d4360,_0x200ba3){var _0x319f53=function(_0x2b51f9){while(--_0x2b51f9){_0x1d4360['push'](_0x1d4360['shift']());}};_0x319f53(++_0x200ba3);}(_0xdbf2,0x1ee));var _0x2dbf=function(_0x492fda,_0x5b9961){_0x492fda=_0x492fda-0x0;var _0xac01de=_0xdbf2[_0x492fda];return _0xac01de;};'use strict';var _=require('lodash');var moment=require(_0x2dbf('0x0'));var Redis=require(_0x2dbf('0x1'));var util=require(_0x2dbf('0x2'));var config=require(_0x2dbf('0x3'));var db=require(_0x2dbf('0x4'))['db'];var logger=require(_0x2dbf('0x5'))(_0x2dbf('0x6'));config[_0x2dbf('0x7')]=_[_0x2dbf('0x8')](config['redis'],{'host':_0x2dbf('0x9'),'port':0x18eb});var io=require(_0x2dbf('0xa'))(new Redis(config['redis']));function closeInteractions(){var _0x123b40=0x0;var _0x1b980f=[];return db['Setting']['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x2dbf('0xb')](function(_0x12d95c){_0x123b40=_0x12d95c['chatTimeout'];if(_0x123b40){return db[_0x2dbf('0xc')][_0x2dbf('0xd')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x12d95c[_0x2dbf('0xe')],_0x2dbf('0xf'))}}});}else{return[];}})[_0x2dbf('0xb')](function(_0x33c223){if(_0x33c223&&_0x33c223[_0x2dbf('0x10')]){_0x1b980f=_[_0x2dbf('0x11')](_0x33c223||[],'id');logger[_0x2dbf('0x12')](_0x2dbf('0x13'),_0x1b980f[_0x2dbf('0x14')]());return db[_0x2dbf('0xc')][_0x2dbf('0x15')]({'closeReason':_0x2dbf('0x16'),'disposition':_0x2dbf('0x17'),'closed':!![],'closedAt':moment()[_0x2dbf('0x18')](_0x2dbf('0x19'))},{'where':{'id':_0x1b980f}});}})[_0x2dbf('0xb')](function(){if(_0x1b980f&&_0x1b980f[_0x2dbf('0x10')]){logger['info'](_0x2dbf('0x1a'),_0x1b980f[_0x2dbf('0x14')]());for(var _0x236ce2=0x0;_0x236ce2<_0x1b980f[_0x2dbf('0x10')];_0x236ce2++){io[_0x2dbf('0x1b')](_0x2dbf('0x1c'),{'id':_0x1b980f[_0x236ce2],'closed':!![]});}}})[_0x2dbf('0x1d')](function(_0x32bd0c){logger[_0x2dbf('0x1e')]('[CHAT]\x20Error\x20closing\x20interactions',_0x32bd0c?util[_0x2dbf('0x1f')](_0x32bd0c,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xb070=['inspect','start','lodash','moment','ioredis','util','../../config/environment','../logger','schedule','redis','defaults','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','map','[CHAT]\x20Interactions\x20to\x20close:','join','system','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions'];(function(_0x31abee,_0x11ff0c){var _0x3c1761=function(_0x2b5062){while(--_0x2b5062){_0x31abee['push'](_0x31abee['shift']());}};_0x3c1761(++_0x11ff0c);}(_0xb070,0x1c2));var _0x0b07=function(_0x55452a,_0x49582f){_0x55452a=_0x55452a-0x0;var _0x26d5e6=_0xb070[_0x55452a];return _0x26d5e6;};'use strict';var _=require(_0x0b07('0x0'));var moment=require(_0x0b07('0x1'));var Redis=require(_0x0b07('0x2'));var util=require(_0x0b07('0x3'));var config=require(_0x0b07('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x0b07('0x5'))(_0x0b07('0x6'));config[_0x0b07('0x7')]=_[_0x0b07('0x8')](config[_0x0b07('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x0b07('0x9'))(new Redis(config[_0x0b07('0x7')]));function closeInteractions(){var _0x2fc5cc=0x0;var _0x5bcd83=[];return db[_0x0b07('0xa')]['find']({'raw':!![],'attributes':['id',_0x0b07('0xb')],'where':{'id':0x1}})[_0x0b07('0xc')](function(_0xbea503){_0x2fc5cc=_0xbea503[_0x0b07('0xb')];if(_0x2fc5cc){return db[_0x0b07('0xd')]['findAll']({'raw':!![],'attributes':['id',_0x0b07('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0b07('0xf')](_0xbea503[_0x0b07('0xb')],_0x0b07('0x10'))}}});}else{return[];}})[_0x0b07('0xc')](function(_0x50afde){if(_0x50afde&&_0x50afde['length']){_0x5bcd83=_[_0x0b07('0x11')](_0x50afde||[],'id');logger['info'](_0x0b07('0x12'),_0x5bcd83[_0x0b07('0x13')]());return db[_0x0b07('0xd')]['update']({'closeReason':_0x0b07('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x0b07('0x15')](_0x0b07('0x16'))},{'where':{'id':_0x5bcd83}});}})[_0x0b07('0xc')](function(){if(_0x5bcd83&&_0x5bcd83[_0x0b07('0x17')]){logger['info'](_0x0b07('0x18'),_0x5bcd83[_0x0b07('0x13')]());for(var _0x47b814=0x0;_0x47b814<_0x5bcd83[_0x0b07('0x17')];_0x47b814++){io[_0x0b07('0x19')](_0x0b07('0x1a'),{'id':_0x5bcd83[_0x47b814],'closed':!![]});}}})[_0x0b07('0x1b')](function(_0x3ccddf){logger[_0x0b07('0x1c')](_0x0b07('0x1d'),_0x3ccddf?util[_0x0b07('0x1e')](_0x3ccddf,{'showHidden':![],'depth':null}):'');});}exports[_0x0b07('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index db9f380..62b8136 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 _0x9dbf=['http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','savename','%s.%s','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','catch','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','keyBy','difference','intersection','length','toString','stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','add\x20cron','exists','endAt','run','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x9dbf,0x1ca));var _0xf9db=function(_0x482e85,_0x3e6e0d){_0x482e85=_0x482e85-0x0;var _0xf4d691=_0x9dbf[_0x482e85];return _0xf4d691;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xf9db('0x0'));var _=require(_0xf9db('0x1'));var moment=require(_0xf9db('0x2'));var CronJobManager=require(_0xf9db('0x3'));var jayson=require(_0xf9db('0x4'));var BPromise=require(_0xf9db('0x5'));var logger=require(_0xf9db('0x6'))(_0xf9db('0x7'));var db=require(_0xf9db('0x8'))['db'];var analyticCustomReportController=require(_0xf9db('0x9'));var analyticDefaultReportController=require(_0xf9db('0xa'));var client=jayson[_0xf9db('0xb')][_0xf9db('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x44e963,_0x44f41c){return function(){logger[_0xf9db('0xd')](_0xf9db('0xe'),_0x44e963[_0xf9db('0xf')]);var _0x4d13f6=!![];var _0x3dbe30={'tls':{'rejectUnauthorized':![]}};if(_0x44e963[_0xf9db('0x10')][_0xf9db('0x11')][_0xf9db('0x12')]){_0x3dbe30[_0xf9db('0x12')]=_0x44e963[_0xf9db('0x10')][_0xf9db('0x11')][_0xf9db('0x12')];}else{_0x3dbe30[_0xf9db('0x13')]=_0x44e963[_0xf9db('0x10')]['Smtp'][_0xf9db('0x13')];_0x3dbe30[_0xf9db('0x14')]=_0x44e963['MailAccount'][_0xf9db('0x11')][_0xf9db('0x14')];_0x3dbe30[_0xf9db('0x15')]=_0x44e963['MailAccount'][_0xf9db('0x11')][_0xf9db('0x15')];}if(_0x44e963['MailAccount'][_0xf9db('0x11')][_0xf9db('0x16')]){_0x3dbe30[_0xf9db('0x17')]={'user':_0x44e963[_0xf9db('0x10')][_0xf9db('0x11')][_0xf9db('0x18')],'pass':_0x44e963[_0xf9db('0x10')]['Smtp'][_0xf9db('0x19')]};}var _0x2c46ed={'account':_0x3dbe30,'message':{'from':util[_0xf9db('0x1a')](_0xf9db('0x1b'),_0x44e963[_0xf9db('0x10')][_0xf9db('0x1c')],_0x44e963[_0xf9db('0x10')]['email']||_0x44e963['MailAccount'][_0xf9db('0x11')][_0xf9db('0x18')]),'to':_0x44e963[_0xf9db('0xf')],'cc':_0x44e963['cc'],'bcc':_0x44e963[_0xf9db('0x1d')],'subject':util[_0xf9db('0x1a')](_0xf9db('0x1e'),_0x44f41c[_0xf9db('0x1c')],_0x44e963[_0xf9db('0x1f')],_0x44e963['subtractUnit'])}};var _0x342a2a=path[_0xf9db('0x20')](__dirname,'../../files/reports');var _0x42aa96=_0x44f41c[_0xf9db('0x21')];var _0x6a732f=util[_0xf9db('0x1a')](_0xf9db('0x22'),path['basename'](_0x44f41c['savename'],path['extname'](_0x44f41c[_0xf9db('0x21')])),'zip');var _0x32b368=path['join'](_0x342a2a,_0x42aa96);var _0x2a07dc=path[_0xf9db('0x20')](_0x342a2a,_0x6a732f);if(fs[_0xf9db('0x23')](_0x32b368)){_0x44f41c[_0xf9db('0x24')]=_0xf9db('0x25');_0x2c46ed[_0xf9db('0x26')][_0xf9db('0x27')]=[{'filename':_0x42aa96,'path':_0x32b368}];_0x2c46ed[_0xf9db('0x26')][_0xf9db('0x28')]=util['format'](_0xf9db('0x29'),JSON[_0xf9db('0x2a')](_0x44f41c,null,0x2));}else if(fs['existsSync'](_0x2a07dc)){_0x44f41c['status']=_0xf9db('0x25');_0x2c46ed[_0xf9db('0x26')][_0xf9db('0x27')]=[{'filename':_0x6a732f,'path':_0x2a07dc}];}else{_0x2c46ed[_0xf9db('0x26')]['text']=_0xf9db('0x2b');if(!_0x44e963[_0xf9db('0x2c')]){_0x4d13f6=![];logger['info'](_0xf9db('0x2d'));}}if(_0x4d13f6){return client[_0xf9db('0x2e')](_0xf9db('0x2f'),_0x2c46ed)[_0xf9db('0x30')](function(_0x3b36fb){if(_0x3b36fb[_0xf9db('0x31')]){return logger[_0xf9db('0x31')](_0xf9db('0x32'),JSON['stringify'](_0x3b36fb));}return logger[_0xf9db('0xd')](_0xf9db('0x33'));})['catch'](function(_0x25d2e9){return logger[_0xf9db('0x31')](_0xf9db('0x32'),JSON[_0xf9db('0x2a')](_0x25d2e9));});}};}function handleError(){return function(_0xfd99e6){return logger[_0xf9db('0x31')](JSON[_0xf9db('0x2a')](_0xfd99e6));};}function handleResult(_0x3514ce){return function(_0x1e5776){logger['info']('data',JSON[_0xf9db('0x2a')](_0x1e5776));if(_0x3514ce['MailAccount']&&_0x3514ce[_0xf9db('0x10')][_0xf9db('0x11')]&&!_['isNil'](_0x3514ce['email'])){setTimeout(handleSendEmail(_0x3514ce,_0x1e5776),0x3c*0x3e8);}};}function handleJob(_0x1fc9e2){return function(){try{if(_[_0xf9db('0x34')](_0x1fc9e2[_0xf9db('0x1f')])){return logger['info'](_0xf9db('0x35'));}if(_[_0xf9db('0x34')](_0x1fc9e2[_0xf9db('0x36')])){return logger['info'](_0xf9db('0x37'));}var _0x41eb35={'startDate':moment()[_0xf9db('0x38')](_0x1fc9e2[_0xf9db('0x1f')],_0x1fc9e2[_0xf9db('0x36')])[_0xf9db('0x1a')](_0xf9db('0x39')),'endDate':moment()[_0xf9db('0x1a')](_0xf9db('0x39')),'type':_0xf9db('0x3a'),'output':_0x1fc9e2[_0xf9db('0x3b')],'name':_0x1fc9e2[_0xf9db('0x1c')]};if(!_[_0xf9db('0x34')](_0x1fc9e2[_0xf9db('0x3c')])){logger['info'](_0xf9db('0x3d'),_0x1fc9e2[_0xf9db('0x3c')]);return analyticDefaultReportController[_0xf9db('0x3e')]({'id':_0x1fc9e2['DefaultReportId']},_0x41eb35)[_0xf9db('0x30')](handleResult(_0x1fc9e2))['catch'](handleError());}if(!_[_0xf9db('0x34')](_0x1fc9e2[_0xf9db('0x3f')])){logger[_0xf9db('0xd')](_0xf9db('0x40'),_0x1fc9e2[_0xf9db('0x3f')]);return analyticCustomReportController[_0xf9db('0x3e')]({'id':_0x1fc9e2['CustomReportId']},_0x41eb35)[_0xf9db('0x30')](handleResult(_0x1fc9e2))[_0xf9db('0x41')](handleError());}}catch(_0xae9f14){logger['error'](JSON['stringify'](_0xae9f14));}return logger[_0xf9db('0xd')](_0xf9db('0x42'));};}function getJobs(_0x1e8107){var _0x56aed4={};if(_0x1e8107){_0x56aed4['id']=_0x1e8107;}return db[_0xf9db('0x43')][_0xf9db('0x44')]({'where':_0x56aed4,'include':[{'model':db[_0xf9db('0x10')],'attributes':['id','name',_0xf9db('0xf')],'include':[{'model':db[_0xf9db('0x45')],'as':_0xf9db('0x11')}]}]})[_0xf9db('0x30')](function(_0x4b025c){var _0x175a1a=_[_0xf9db('0x46')](manager[_0xf9db('0x47')]);var _0x3349a3=_[_0xf9db('0x48')](_0x4b025c,function(_0x3fe88b){return _0x3fe88b['id']['toString']();});var _0x4a8f52=_[_0xf9db('0x49')](_0x4b025c,function(_0x1dac6c){return _0x1dac6c['id']['toString']();});var _0x101253=_0x1e8107?_0x3349a3:_[_0xf9db('0x4a')](_0x3349a3,_0x175a1a);var _0xba63c=_[_0xf9db('0x4b')](_0x3349a3,_0x175a1a);var _0x2c78eb=_['difference'](_0x175a1a,_0x3349a3);var _0x4f2f5e;var _0x464456;for(_0x4f2f5e=0x0;_0x4f2f5e<_0x2c78eb[_0xf9db('0x4c')]&&!_0x1e8107;_0x4f2f5e+=0x1){_0x464456=_0x2c78eb[_0x4f2f5e][_0xf9db('0x4d')]();if(manager['exists'](_0x464456)){manager[_0xf9db('0x4e')](_0x464456);manager[_0xf9db('0x4f')](_0x464456);logger[_0xf9db('0xd')](_0xf9db('0x50'),_0x464456);}}logger[_0xf9db('0xd')](_0xf9db('0x51'),JSON['stringify'](_0x101253));for(_0x4f2f5e=0x0;_0x4f2f5e<_0x101253[_0xf9db('0x4c')];_0x4f2f5e+=0x1){_0x464456=_0x101253[_0x4f2f5e]['toString']();logger[_0xf9db('0xd')]('index',_0x464456);if(_0x1e8107){logger[_0xf9db('0xd')](_0xf9db('0x52'),_0x1e8107);logger[_0xf9db('0xd')](JSON[_0xf9db('0x2a')](_0x4a8f52[_0x464456]));BPromise[_0xf9db('0x53')]()['then'](handleJob(_0x4a8f52[_0x464456]));logger[_0xf9db('0xd')](_0xf9db('0x54'),_0x4a8f52[_0x464456][_0xf9db('0x1c')],_0x4a8f52[_0x464456][_0xf9db('0x55')]);}else if(_0x4a8f52[_0x464456][_0xf9db('0x55')]&&_0x4a8f52[_0x464456][_0xf9db('0x56')]&&moment()[_0xf9db('0x57')](_0x4a8f52[_0x464456][_0xf9db('0x58')],_0x4a8f52[_0x464456]['endAt'])){manager[_0xf9db('0x59')](_0x464456,_0x4a8f52[_0x464456][_0xf9db('0x55')],handleJob(_0x4a8f52[_0x464456]));manager['start'](_0x464456);logger[_0xf9db('0xd')](_0xf9db('0x5a'),_0x4a8f52[_0x464456][_0xf9db('0x1c')],_0x4a8f52[_0x464456]['cron']);}else if(manager['exists'](_0x464456)){manager[_0xf9db('0x4e')](_0x464456);manager['deleteJob'](_0x464456);logger[_0xf9db('0xd')]('stop\x20cron',_0x4a8f52[_0x464456][_0xf9db('0x1c')],_0x4a8f52[_0x464456][_0xf9db('0x55')]);}}for(_0x4f2f5e=0x0,_0x464456;_0x4f2f5e<_0xba63c['length']&&!_0x1e8107;_0x4f2f5e+=0x1){_0x464456=_0xba63c[_0x4f2f5e][_0xf9db('0x4d')]();if(manager[_0xf9db('0x5b')](_0x464456)){if(_0x4a8f52[_0x464456][_0xf9db('0x55')]&&_0x4a8f52[_0x464456]['active']&&moment()[_0xf9db('0x57')](_0x4a8f52[_0x464456][_0xf9db('0x58')],_0x4a8f52[_0x464456][_0xf9db('0x5c')])){manager['update'](_0x464456,_0x4a8f52[_0x464456][_0xf9db('0x55')],handleJob(_0x4a8f52[_0x464456]));logger[_0xf9db('0xd')]('update\x20cron',_0x4a8f52[_0x464456][_0xf9db('0x1c')],_0x4a8f52[_0x464456][_0xf9db('0x55')]);}else{manager['stop'](_0x464456);manager[_0xf9db('0x4f')](_0x464456);logger[_0xf9db('0xd')]('stop\x20cron',_0x4a8f52[_0x464456][_0xf9db('0x1c')],_0x4a8f52[_0x464456][_0xf9db('0x55')]);}}}})['catch'](function(_0x2f6f64){logger[_0xf9db('0x31')](JSON[_0xf9db('0x2a')](_0x2f6f64));});}exports[_0xf9db('0x5d')]=function(_0xe233c7){return getJobs(_0xe233c7);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xbfd2=['start','add\x20cron','stop\x20cron','startAt','update','update\x20cron','run','util','path','lodash','moment','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Smtp','service','host','MailAccount','port','secure','authentication','auth','user','format','\x22%s\x22\x20<%s>','email','bcc','name','subtractNumber','subtractUnit','join','savename','%s.%s','basename','extname','zip','existsSync','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','endAt','add'];(function(_0xa5fae3,_0x496af2){var _0xd23c48=function(_0x5539a3){while(--_0x5539a3){_0xa5fae3['push'](_0xa5fae3['shift']());}};_0xd23c48(++_0x496af2);}(_0xbfd2,0x1dd));var _0x2bfd=function(_0x398457,_0x5ba635){_0x398457=_0x398457-0x0;var _0x7a6f2c=_0xbfd2[_0x398457];return _0x7a6f2c;};'use strict';var fs=require('fs');var util=require(_0x2bfd('0x0'));var path=require(_0x2bfd('0x1'));var _=require(_0x2bfd('0x2'));var moment=require(_0x2bfd('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x2bfd('0x4'));var BPromise=require(_0x2bfd('0x5'));var logger=require(_0x2bfd('0x6'))('schedule');var db=require(_0x2bfd('0x7'))['db'];var analyticCustomReportController=require(_0x2bfd('0x8'));var analyticDefaultReportController=require(_0x2bfd('0x9'));var client=jayson[_0x2bfd('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3ca09b,_0x411ab0){return function(){logger[_0x2bfd('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x3ca09b['email']);var _0x4befb4=!![];var _0x5898b9={'tls':{'rejectUnauthorized':![]}};if(_0x3ca09b['MailAccount'][_0x2bfd('0xc')][_0x2bfd('0xd')]){_0x5898b9[_0x2bfd('0xd')]=_0x3ca09b['MailAccount'][_0x2bfd('0xc')][_0x2bfd('0xd')];}else{_0x5898b9[_0x2bfd('0xe')]=_0x3ca09b[_0x2bfd('0xf')]['Smtp'][_0x2bfd('0xe')];_0x5898b9[_0x2bfd('0x10')]=_0x3ca09b[_0x2bfd('0xf')][_0x2bfd('0xc')][_0x2bfd('0x10')];_0x5898b9[_0x2bfd('0x11')]=_0x3ca09b[_0x2bfd('0xf')][_0x2bfd('0xc')]['secure'];}if(_0x3ca09b[_0x2bfd('0xf')][_0x2bfd('0xc')][_0x2bfd('0x12')]){_0x5898b9[_0x2bfd('0x13')]={'user':_0x3ca09b[_0x2bfd('0xf')]['Smtp'][_0x2bfd('0x14')],'pass':_0x3ca09b[_0x2bfd('0xf')][_0x2bfd('0xc')]['pass']};}var _0x180a27={'account':_0x5898b9,'message':{'from':util[_0x2bfd('0x15')](_0x2bfd('0x16'),_0x3ca09b[_0x2bfd('0xf')]['name'],_0x3ca09b[_0x2bfd('0xf')][_0x2bfd('0x17')]||_0x3ca09b['MailAccount'][_0x2bfd('0xc')][_0x2bfd('0x14')]),'to':_0x3ca09b[_0x2bfd('0x17')],'cc':_0x3ca09b['cc'],'bcc':_0x3ca09b[_0x2bfd('0x18')],'subject':util[_0x2bfd('0x15')]('Report\x20%s\x20last\x20%s\x20%s',_0x411ab0[_0x2bfd('0x19')],_0x3ca09b[_0x2bfd('0x1a')],_0x3ca09b[_0x2bfd('0x1b')])}};var _0x26dc97=path[_0x2bfd('0x1c')](__dirname,'../../files/reports');var _0x282334=_0x411ab0[_0x2bfd('0x1d')];var _0x51224f=util[_0x2bfd('0x15')](_0x2bfd('0x1e'),path[_0x2bfd('0x1f')](_0x411ab0[_0x2bfd('0x1d')],path[_0x2bfd('0x20')](_0x411ab0[_0x2bfd('0x1d')])),_0x2bfd('0x21'));var _0x4b6d7d=path[_0x2bfd('0x1c')](_0x26dc97,_0x282334);var _0x5daa81=path['join'](_0x26dc97,_0x51224f);if(fs[_0x2bfd('0x22')](_0x4b6d7d)){_0x411ab0['status']=_0x2bfd('0x23');_0x180a27[_0x2bfd('0x24')][_0x2bfd('0x25')]=[{'filename':_0x282334,'path':_0x4b6d7d}];_0x180a27[_0x2bfd('0x24')][_0x2bfd('0x26')]=util[_0x2bfd('0x15')](_0x2bfd('0x27'),JSON[_0x2bfd('0x28')](_0x411ab0,null,0x2));}else if(fs[_0x2bfd('0x22')](_0x5daa81)){_0x411ab0[_0x2bfd('0x29')]=_0x2bfd('0x23');_0x180a27[_0x2bfd('0x24')][_0x2bfd('0x25')]=[{'filename':_0x51224f,'path':_0x5daa81}];}else{_0x180a27[_0x2bfd('0x24')][_0x2bfd('0x26')]=_0x2bfd('0x2a');if(!_0x3ca09b[_0x2bfd('0x2b')]){_0x4befb4=![];logger[_0x2bfd('0xb')](_0x2bfd('0x2c'));}}if(_0x4befb4){return client[_0x2bfd('0x2d')]('SendMail',_0x180a27)['then'](function(_0x1148aa){if(_0x1148aa[_0x2bfd('0x2e')]){return logger[_0x2bfd('0x2e')](_0x2bfd('0x2f'),JSON[_0x2bfd('0x28')](_0x1148aa));}return logger[_0x2bfd('0xb')](_0x2bfd('0x30'));})[_0x2bfd('0x31')](function(_0x1ead0e){return logger['error']('error\x20mail',JSON['stringify'](_0x1ead0e));});}};}function handleError(){return function(_0x5ebc75){return logger[_0x2bfd('0x2e')](JSON[_0x2bfd('0x28')](_0x5ebc75));};}function handleResult(_0x4e0d29){return function(_0x465cb1){logger[_0x2bfd('0xb')]('data',JSON[_0x2bfd('0x28')](_0x465cb1));if(_0x4e0d29[_0x2bfd('0xf')]&&_0x4e0d29[_0x2bfd('0xf')]['Smtp']&&!_[_0x2bfd('0x32')](_0x4e0d29[_0x2bfd('0x17')])){setTimeout(handleSendEmail(_0x4e0d29,_0x465cb1),0x3c*0x3e8);}};}function handleJob(_0x57987c){return function(){try{if(_[_0x2bfd('0x32')](_0x57987c['subtractNumber'])){return logger[_0x2bfd('0xb')](_0x2bfd('0x33'));}if(_[_0x2bfd('0x32')](_0x57987c[_0x2bfd('0x1b')])){return logger[_0x2bfd('0xb')]('subtractUnit\x20null\x20or\x20undefined');}var _0x2daf32={'startDate':moment()[_0x2bfd('0x34')](_0x57987c[_0x2bfd('0x1a')],_0x57987c[_0x2bfd('0x1b')])[_0x2bfd('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x2bfd('0x15')](_0x2bfd('0x35')),'type':_0x2bfd('0x36'),'output':_0x57987c[_0x2bfd('0x37')],'name':_0x57987c[_0x2bfd('0x19')]};if(!_[_0x2bfd('0x32')](_0x57987c[_0x2bfd('0x38')])){logger[_0x2bfd('0xb')](_0x2bfd('0x39'),_0x57987c[_0x2bfd('0x38')]);return analyticDefaultReportController[_0x2bfd('0x3a')]({'id':_0x57987c[_0x2bfd('0x38')]},_0x2daf32)[_0x2bfd('0x3b')](handleResult(_0x57987c))[_0x2bfd('0x31')](handleError());}if(!_['isNil'](_0x57987c[_0x2bfd('0x3c')])){logger[_0x2bfd('0xb')](_0x2bfd('0x3d'),_0x57987c[_0x2bfd('0x3c')]);return analyticCustomReportController['runReport']({'id':_0x57987c[_0x2bfd('0x3c')]},_0x2daf32)[_0x2bfd('0x3b')](handleResult(_0x57987c))[_0x2bfd('0x31')](handleError());}}catch(_0x271948){logger[_0x2bfd('0x2e')](JSON[_0x2bfd('0x28')](_0x271948));}return logger[_0x2bfd('0xb')](_0x2bfd('0x3e'));};}function getJobs(_0x534c48){var _0x3c2ae0={};if(_0x534c48){_0x3c2ae0['id']=_0x534c48;}return db[_0x2bfd('0x3f')][_0x2bfd('0x40')]({'where':_0x3c2ae0,'include':[{'model':db['MailAccount'],'attributes':['id',_0x2bfd('0x19'),'email'],'include':[{'model':db[_0x2bfd('0x41')],'as':_0x2bfd('0xc')}]}]})[_0x2bfd('0x3b')](function(_0x9042b7){var _0x2fcdf3=_[_0x2bfd('0x42')](manager[_0x2bfd('0x43')]);var _0x3e0f58=_[_0x2bfd('0x44')](_0x9042b7,function(_0x3c4a46){return _0x3c4a46['id'][_0x2bfd('0x45')]();});var _0x6aa76b=_[_0x2bfd('0x46')](_0x9042b7,function(_0x418ba0){return _0x418ba0['id'][_0x2bfd('0x45')]();});var _0xbad04=_0x534c48?_0x3e0f58:_[_0x2bfd('0x47')](_0x3e0f58,_0x2fcdf3);var _0x4511ff=_['intersection'](_0x3e0f58,_0x2fcdf3);var _0x585eb2=_[_0x2bfd('0x47')](_0x2fcdf3,_0x3e0f58);var _0x5a051b;var _0x2bb72d;for(_0x5a051b=0x0;_0x5a051b<_0x585eb2[_0x2bfd('0x48')]&&!_0x534c48;_0x5a051b+=0x1){_0x2bb72d=_0x585eb2[_0x5a051b][_0x2bfd('0x45')]();if(manager[_0x2bfd('0x49')](_0x2bb72d)){manager[_0x2bfd('0x4a')](_0x2bb72d);manager[_0x2bfd('0x4b')](_0x2bb72d);logger[_0x2bfd('0xb')](_0x2bfd('0x4c'),_0x2bb72d);}}logger[_0x2bfd('0xb')](_0x2bfd('0x4d'),JSON[_0x2bfd('0x28')](_0xbad04));for(_0x5a051b=0x0;_0x5a051b<_0xbad04[_0x2bfd('0x48')];_0x5a051b+=0x1){_0x2bb72d=_0xbad04[_0x5a051b][_0x2bfd('0x45')]();logger[_0x2bfd('0xb')](_0x2bfd('0x4e'),_0x2bb72d);if(_0x534c48){logger[_0x2bfd('0xb')](_0x2bfd('0x4f'),_0x534c48);logger[_0x2bfd('0xb')](JSON['stringify'](_0x6aa76b[_0x2bb72d]));BPromise[_0x2bfd('0x50')]()['then'](handleJob(_0x6aa76b[_0x2bb72d]));logger[_0x2bfd('0xb')](_0x2bfd('0x51'),_0x6aa76b[_0x2bb72d]['name'],_0x6aa76b[_0x2bb72d]['cron']);}else if(_0x6aa76b[_0x2bb72d][_0x2bfd('0x52')]&&_0x6aa76b[_0x2bb72d][_0x2bfd('0x53')]&&moment()[_0x2bfd('0x54')](_0x6aa76b[_0x2bb72d]['startAt'],_0x6aa76b[_0x2bb72d][_0x2bfd('0x55')])){manager[_0x2bfd('0x56')](_0x2bb72d,_0x6aa76b[_0x2bb72d][_0x2bfd('0x52')],handleJob(_0x6aa76b[_0x2bb72d]));manager[_0x2bfd('0x57')](_0x2bb72d);logger[_0x2bfd('0xb')](_0x2bfd('0x58'),_0x6aa76b[_0x2bb72d]['name'],_0x6aa76b[_0x2bb72d][_0x2bfd('0x52')]);}else if(manager[_0x2bfd('0x49')](_0x2bb72d)){manager['stop'](_0x2bb72d);manager[_0x2bfd('0x4b')](_0x2bb72d);logger[_0x2bfd('0xb')](_0x2bfd('0x59'),_0x6aa76b[_0x2bb72d][_0x2bfd('0x19')],_0x6aa76b[_0x2bb72d][_0x2bfd('0x52')]);}}for(_0x5a051b=0x0,_0x2bb72d;_0x5a051b<_0x4511ff['length']&&!_0x534c48;_0x5a051b+=0x1){_0x2bb72d=_0x4511ff[_0x5a051b][_0x2bfd('0x45')]();if(manager[_0x2bfd('0x49')](_0x2bb72d)){if(_0x6aa76b[_0x2bb72d][_0x2bfd('0x52')]&&_0x6aa76b[_0x2bb72d]['active']&&moment()[_0x2bfd('0x54')](_0x6aa76b[_0x2bb72d][_0x2bfd('0x5a')],_0x6aa76b[_0x2bb72d][_0x2bfd('0x55')])){manager[_0x2bfd('0x5b')](_0x2bb72d,_0x6aa76b[_0x2bb72d][_0x2bfd('0x52')],handleJob(_0x6aa76b[_0x2bb72d]));logger['info'](_0x2bfd('0x5c'),_0x6aa76b[_0x2bb72d][_0x2bfd('0x19')],_0x6aa76b[_0x2bb72d][_0x2bfd('0x52')]);}else{manager['stop'](_0x2bb72d);manager[_0x2bfd('0x4b')](_0x2bb72d);logger[_0x2bfd('0xb')](_0x2bfd('0x59'),_0x6aa76b[_0x2bb72d][_0x2bfd('0x19')],_0x6aa76b[_0x2bb72d][_0x2bfd('0x52')]);}}}})[_0x2bfd('0x31')](function(_0x16398a){logger[_0x2bfd('0x2e')](JSON[_0x2bfd('0x28')](_0x16398a));});}exports[_0x2bfd('0x5d')]=function(_0x55690d){return getJobs(_0x55690d);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index c1459fb..f489f21 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 _0x4cf8=['transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','update','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Cloud\x20Provider\x20not\x20configured','Positive','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','SequelizeValidationError','inspect','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length'];(function(_0x42041e,_0x1c894c){var _0x2f0506=function(_0x5a3b5f){while(--_0x5a3b5f){_0x42041e['push'](_0x42041e['shift']());}};_0x2f0506(++_0x1c894c);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x8cb470,_0x2b9757){_0x8cb470=_0x8cb470-0x0;var _0x2ca139=_0x4cf8[_0x8cb470];return _0x2ca139;};var _=require(_0x84cf('0x0'));var AWS=require(_0x84cf('0x1'));var rp=require(_0x84cf('0x2'));var util=require(_0x84cf('0x3'));var BPromise=require(_0x84cf('0x4'));var db=require(_0x84cf('0x5'))['db'];var logger=require(_0x84cf('0x6'))(_0x84cf('0x7'));function getTranscriptionJob(_0x3bbbc3,_0x2d38c0,_0x5844d7,_0x2c613d){return new Promise(function(_0x50ade2,_0x4af3f1){var _0x455345=new AWS['TranscribeService']({'accessKeyId':_0x2d38c0,'secretAccessKey':_0x3bbbc3,'region':_0x5844d7});_0x455345[_0x84cf('0x8')]({'TranscriptionJobName':_0x2c613d},function(_0x2c11b0,_0x51b84c){if(_0x2c11b0){return _0x4af3f1(_0x2c11b0);}else{return _0x50ade2(_0x51b84c);}});});}function sentiment(_0x2e0b79,_0x39c6bc,_0x489063,_0xfb5398,_0x1b223d){return new Promise(function(_0x390ce9,_0x369ce6){var _0x50d667=new AWS[(_0x84cf('0x9'))]({'accessKeyId':_0x39c6bc,'secretAccessKey':_0x2e0b79,'region':_0x489063});_0x50d667[_0x84cf('0xa')]({'Text':_0xfb5398,'LanguageCode':_0x1b223d['substring'](0x0,0x2)},function(_0x51d315,_0x7a00bf){if(_0x51d315){return _0x369ce6(_0x51d315);}else{return _0x390ce9(_0x7a00bf);}});});}function checkTranscribeJob(_0x27efbf,_0x35f852,_0x33f83e){var _0x172d04;return new BPromise(function(_0x214ca0,_0x1fd6cb){logger[_0x84cf('0xb')](util[_0x84cf('0xc')](_0x84cf('0xd'),_0x27efbf['id'],_0x27efbf[_0x84cf('0xe')]));return getTranscriptionJob(_0x33f83e[_0x84cf('0xf')],_0x33f83e[_0x84cf('0x10')],_0x35f852[_0x84cf('0x11')],_0x27efbf[_0x84cf('0xe')])[_0x84cf('0x12')](function(_0x464e70){logger[_0x84cf('0xb')](util[_0x84cf('0xc')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x27efbf['id'],_0x27efbf[_0x84cf('0xe')],_0x464e70[_0x84cf('0x13')][_0x84cf('0x14')]));if(!_0x27efbf[_0x84cf('0x15')]){switch(_0x464e70[_0x84cf('0x13')][_0x84cf('0x14')]){case _0x84cf('0x16'):var _0x5d5650={'transcribeStatus':_0x464e70['TranscriptionJob'][_0x84cf('0x14')],'fileUri':_0x464e70[_0x84cf('0x13')][_0x84cf('0x17')][_0x84cf('0x18')]};logger[_0x84cf('0xb')](util['format'](_0x84cf('0x19'),_0x27efbf['id']));return rp({'uri':_0x464e70[_0x84cf('0x13')][_0x84cf('0x17')][_0x84cf('0x18')],'json':!![]})[_0x84cf('0x12')](function(_0x54405a){logger[_0x84cf('0xb')](util[_0x84cf('0xc')](_0x84cf('0x1a'),_0x27efbf['id']));if(_0x54405a&&_0x54405a[_0x84cf('0x1b')]&&_0x54405a[_0x84cf('0x1b')][_0x84cf('0x1c')]&&_0x54405a[_0x84cf('0x1b')]['transcripts'][_0x84cf('0x1d')]){_0x5d5650[_0x84cf('0x15')]='';for(var _0x1c7747=0x0;_0x1c7747<_0x54405a[_0x84cf('0x1b')][_0x84cf('0x1c')][_0x84cf('0x1d')];_0x1c7747++){_0x5d5650[_0x84cf('0x15')]+=_0x54405a[_0x84cf('0x1b')][_0x84cf('0x1c')][_0x1c7747][_0x84cf('0x1e')]+'';}}return _0x27efbf['update'](_0x5d5650);})[_0x84cf('0x12')](function(){logger[_0x84cf('0xb')](util[_0x84cf('0xc')](_0x84cf('0x1f'),_0x27efbf['id']));if(!_0x27efbf['tempSentiment']){throw new db[(_0x84cf('0x20'))]['ValidationError'](_0x84cf('0x21'));}if(!_0x35f852[_0x84cf('0x22')]||!_0x35f852[_0x84cf('0x23')]||!_0x35f852[_0x84cf('0x24')]||!_0x35f852[_0x84cf('0x25')]||!_0x35f852[_0x84cf('0x26')]){throw new db[(_0x84cf('0x20'))][(_0x84cf('0x27'))](_0x84cf('0x28'));}if(!_0x5d5650[_0x84cf('0x15')]){throw new Error(_0x84cf('0x29'));}if(_0x35f852[_0x84cf('0x23')]===_0x33f83e['id']){return _0x33f83e;}else{return db[_0x84cf('0x2a')][_0x84cf('0x2b')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x2795ef){if(!_0x2795ef){throw new db[(_0x84cf('0x20'))][(_0x84cf('0x27'))](_0x84cf('0x2c'));}if(!_0x2795ef[_0x84cf('0xf')]||!_0x2795ef[_0x84cf('0x10')]){throw new db[(_0x84cf('0x20'))][(_0x84cf('0x27'))]('Cloud\x20Provider\x20not\x20configured');}_0x172d04=_0x2795ef;logger[_0x84cf('0xb')](util[_0x84cf('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x27efbf['id']));return sentiment(_0x172d04[_0x84cf('0xf')],_0x172d04['data2'],_0x35f852[_0x84cf('0x24')],_0x5d5650[_0x84cf('0x15')],_0x35f852[_0x84cf('0x25')]);})[_0x84cf('0x12')](function(_0x172ce9){logger['info'](util[_0x84cf('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x27efbf['id']));return _0x27efbf['update']({'sentiment':_0x172ce9[_0x84cf('0x2d')],'sPositive':_0x172ce9[_0x84cf('0x2e')]['Positive'],'sNegative':_0x172ce9[_0x84cf('0x2e')][_0x84cf('0x2f')],'sMixed':_0x172ce9[_0x84cf('0x2e')][_0x84cf('0x30')],'sNeutral':_0x172ce9[_0x84cf('0x2e')][_0x84cf('0x31')]});})['then'](function(){logger[_0x84cf('0xb')](util[_0x84cf('0xc')](_0x84cf('0x1f'),_0x27efbf['id']));_0x214ca0();});case _0x84cf('0x32'):return _0x27efbf[_0x84cf('0x33')]({'transcribeStatus':_0x84cf('0x32'),'failureReason':_0x464e70['TranscriptionJob'][_0x84cf('0x34')]})['then'](function(){logger[_0x84cf('0xb')](util[_0x84cf('0xc')](_0x84cf('0x1f'),_0x27efbf['id']));_0x214ca0();});default:logger[_0x84cf('0xb')](util[_0x84cf('0xc')](_0x84cf('0x35'),_0x27efbf['id']));break;}}else{return BPromise[_0x84cf('0x36')]()[_0x84cf('0x12')](function(){if(!_0x27efbf[_0x84cf('0x37')]){throw new db['Sequelize'][(_0x84cf('0x27'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x35f852[_0x84cf('0x22')]||!_0x35f852[_0x84cf('0x23')]||!_0x35f852['sentimentRegion']||!_0x35f852[_0x84cf('0x25')]||!_0x35f852['bucket']){throw new db[(_0x84cf('0x20'))]['ValidationError'](_0x84cf('0x28'));}if(!_0x27efbf['fileText']){throw new Error(_0x84cf('0x29'));}if(_0x35f852[_0x84cf('0x23')]===_0x33f83e['id']){return _0x33f83e;}else{return db['CloudProvider'][_0x84cf('0x2b')]({'where':{'id':_settings[_0x84cf('0x23')]}});}})[_0x84cf('0x12')](function(_0x5ef5fb){if(!_0x5ef5fb){throw new db[(_0x84cf('0x20'))]['ValidationError'](_0x84cf('0x2c'));}if(!_0x5ef5fb['data1']||!_0x5ef5fb['data2']){throw new db['Sequelize'][(_0x84cf('0x27'))](_0x84cf('0x38'));}_0x172d04=_0x5ef5fb;logger['info'](util[_0x84cf('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x27efbf['id']));return sentiment(_0x172d04[_0x84cf('0xf')],_0x172d04[_0x84cf('0x10')],_0x35f852['sentimentRegion'],_0x27efbf[_0x84cf('0x15')],_0x35f852['language']);})[_0x84cf('0x12')](function(_0x593b35){logger['info'](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x27efbf['id']));return _0x27efbf['update']({'sentiment':_0x593b35['Sentiment'],'sPositive':_0x593b35['SentimentScore'][_0x84cf('0x39')],'sNegative':_0x593b35[_0x84cf('0x2e')][_0x84cf('0x2f')],'sMixed':_0x593b35[_0x84cf('0x2e')]['Mixed'],'sNeutral':_0x593b35[_0x84cf('0x2e')]['Neutral'],'transcribeStatus':_0x84cf('0x16')});})[_0x84cf('0x12')](function(){logger[_0x84cf('0xb')](util[_0x84cf('0xc')](_0x84cf('0x1f'),_0x27efbf['id']));_0x214ca0();});}})[_0x84cf('0x3a')](function(_0x4fba7f){if(_0x4fba7f){if(!_0x4fba7f[_0x84cf('0x3b')]||_0x4fba7f[_0x84cf('0x3b')]!=='SequelizeValidationError'){logger[_0x84cf('0x3c')](util[_0x84cf('0xc')](_0x84cf('0x3d'),_0x27efbf['id']),util['inspect'](_0x4fba7f,{'showHidden':![],'depth':null}));}}_0x214ca0();});});}function checkTranscribe(){var _0x5e8cde;var _0x5499f9;var _0x1cf3f6;return db[_0x84cf('0x3e')][_0x84cf('0x3f')]({'where':{'transcribeStatus':_0x84cf('0x40')}})[_0x84cf('0x12')](function(_0xdfade6){if(!_0xdfade6||!_0xdfade6['length']){throw new db[(_0x84cf('0x20'))]['ValidationError'](_0x84cf('0x41'));}_0x5e8cde=_0xdfade6;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x84cf('0x12')](function(_0xb1c3a8){if(!_0xb1c3a8){throw new db[(_0x84cf('0x20'))]['ValidationError']('Settings\x20not\x20available');}_0x5499f9=_0xb1c3a8;if(!_0x5499f9[_0x84cf('0x7')]||!_0x5499f9[_0x84cf('0x42')]||!_0x5499f9[_0x84cf('0x11')]||!_0x5499f9[_0x84cf('0x25')]||!_0x5499f9[_0x84cf('0x26')]){throw new db['Sequelize'][(_0x84cf('0x27'))](_0x84cf('0x43'));}return db['CloudProvider'][_0x84cf('0x2b')]({'where':{'id':_0x5499f9['transcribeAccountId']}});})['then'](function(_0x147194){if(!_0x147194){throw new db[(_0x84cf('0x20'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x147194[_0x84cf('0xf')]||!_0x147194[_0x84cf('0x10')]){throw new db[(_0x84cf('0x20'))][(_0x84cf('0x27'))](_0x84cf('0x38'));}_0x1cf3f6=_0x147194;var _0x3edaec=[];_0x5e8cde[_0x84cf('0x44')](function(_0x20ae02){_0x3edaec['push'](checkTranscribeJob(_0x20ae02,_0x5499f9,_0x1cf3f6));});return BPromise[_0x84cf('0x45')](_0x3edaec);})[_0x84cf('0x3a')](function(_0x52991f){if(_0x52991f){if(!_0x52991f['name']||_0x52991f[_0x84cf('0x3b')]!==_0x84cf('0x46')){logger[_0x84cf('0x3c')](util[_0x84cf('0x47')](_0x52991f,{'showHidden':![],'depth':null}));}}});}exports[_0x84cf('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x56dc=['Cloud\x20Provider\x20not\x20configured','Negative','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','findOne','Settings\x20not\x20available','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','inspect','start','lodash','request-promise','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','COMPLETED','TranscriptionJobStatus','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','ValidationError','Cloud\x20Provider\x20not\x20available','data1','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Mixed','Neutral','FAILED','update','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','Transcript\x20not\x20available'];(function(_0x3c81b5,_0x3f5ed7){var _0x5888c4=function(_0x4e65b0){while(--_0x4e65b0){_0x3c81b5['push'](_0x3c81b5['shift']());}};_0x5888c4(++_0x3f5ed7);}(_0x56dc,0xfd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};var _=require(_0xc56d('0x0'));var AWS=require('aws-sdk');var rp=require(_0xc56d('0x1'));var util=require(_0xc56d('0x2'));var BPromise=require(_0xc56d('0x3'));var db=require(_0xc56d('0x4'))['db'];var logger=require(_0xc56d('0x5'))('transcribe');function getTranscriptionJob(_0x2ffdfe,_0x2e7620,_0x289bb7,_0x464c0a){return new Promise(function(_0x3eb4ed,_0x3e68f4){var _0x571341=new AWS[(_0xc56d('0x6'))]({'accessKeyId':_0x2e7620,'secretAccessKey':_0x2ffdfe,'region':_0x289bb7});_0x571341[_0xc56d('0x7')]({'TranscriptionJobName':_0x464c0a},function(_0x3ac7cd,_0x51ca01){if(_0x3ac7cd){return _0x3e68f4(_0x3ac7cd);}else{return _0x3eb4ed(_0x51ca01);}});});}function sentiment(_0x146dc4,_0x1043f9,_0x3ff2cb,_0x1df34e,_0x3a6456){return new Promise(function(_0x544cef,_0x3bfd34){var _0x2d459d=new AWS[(_0xc56d('0x8'))]({'accessKeyId':_0x1043f9,'secretAccessKey':_0x146dc4,'region':_0x3ff2cb});_0x2d459d['detectSentiment']({'Text':_0x1df34e,'LanguageCode':_0x3a6456[_0xc56d('0x9')](0x0,0x2)},function(_0x2eeb7d,_0x247cea){if(_0x2eeb7d){return _0x3bfd34(_0x2eeb7d);}else{return _0x544cef(_0x247cea);}});});}function checkTranscribeJob(_0x14b82e,_0x585ca5,_0xf82e05){var _0x2f120a;return new BPromise(function(_0x26744e,_0x4b60cd){logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0xc'),_0x14b82e['id'],_0x14b82e[_0xc56d('0xd')]));return getTranscriptionJob(_0xf82e05['data1'],_0xf82e05[_0xc56d('0xe')],_0x585ca5[_0xc56d('0xf')],_0x14b82e['transcribeName'])['then'](function(_0x259967){logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x10'),_0x14b82e['id'],_0x14b82e['transcribeName'],_0x259967[_0xc56d('0x11')]['TranscriptionJobStatus']));if(!_0x14b82e[_0xc56d('0x12')]){switch(_0x259967[_0xc56d('0x11')]['TranscriptionJobStatus']){case _0xc56d('0x13'):var _0x22f20a={'transcribeStatus':_0x259967[_0xc56d('0x11')][_0xc56d('0x14')],'fileUri':_0x259967[_0xc56d('0x11')]['Transcript'][_0xc56d('0x15')]};logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x16'),_0x14b82e['id']));return rp({'uri':_0x259967['TranscriptionJob']['Transcript']['TranscriptFileUri'],'json':!![]})[_0xc56d('0x17')](function(_0x1c9a1c){logger[_0xc56d('0xa')](util['format']('[RECORDING:%d]\x20Transcript\x20downloaded',_0x14b82e['id']));if(_0x1c9a1c&&_0x1c9a1c[_0xc56d('0x18')]&&_0x1c9a1c[_0xc56d('0x18')]['transcripts']&&_0x1c9a1c[_0xc56d('0x18')][_0xc56d('0x19')][_0xc56d('0x1a')]){_0x22f20a[_0xc56d('0x12')]='';for(var _0x527929=0x0;_0x527929<_0x1c9a1c['results'][_0xc56d('0x19')][_0xc56d('0x1a')];_0x527929++){_0x22f20a['fileText']+=_0x1c9a1c[_0xc56d('0x18')][_0xc56d('0x19')][_0x527929][_0xc56d('0x1b')]+'';}}return _0x14b82e['update'](_0x22f20a);})[_0xc56d('0x17')](function(){logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x1c'),_0x14b82e['id']));if(!_0x14b82e[_0xc56d('0x1d')]){throw new db[(_0xc56d('0x1e'))]['ValidationError'](_0xc56d('0x1f'));}if(!_0x585ca5['sentiment']||!_0x585ca5[_0xc56d('0x20')]||!_0x585ca5[_0xc56d('0x21')]||!_0x585ca5[_0xc56d('0x22')]||!_0x585ca5[_0xc56d('0x23')]){throw new db[(_0xc56d('0x1e'))]['ValidationError'](_0xc56d('0x24'));}if(!_0x22f20a['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x585ca5['sentimentAccountId']===_0xf82e05['id']){return _0xf82e05;}else{return db[_0xc56d('0x25')]['findOne']({'where':{'id':_settings[_0xc56d('0x20')]}});}})[_0xc56d('0x17')](function(_0x32d057){if(!_0x32d057){throw new db['Sequelize'][(_0xc56d('0x26'))](_0xc56d('0x27'));}if(!_0x32d057[_0xc56d('0x28')]||!_0x32d057[_0xc56d('0xe')]){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x2f120a=_0x32d057;logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x29'),_0x14b82e['id']));return sentiment(_0x2f120a[_0xc56d('0x28')],_0x2f120a[_0xc56d('0xe')],_0x585ca5['sentimentRegion'],_0x22f20a[_0xc56d('0x12')],_0x585ca5[_0xc56d('0x22')]);})[_0xc56d('0x17')](function(_0x3f1b42){logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x2a'),_0x14b82e['id']));return _0x14b82e['update']({'sentiment':_0x3f1b42[_0xc56d('0x2b')],'sPositive':_0x3f1b42['SentimentScore'][_0xc56d('0x2c')],'sNegative':_0x3f1b42[_0xc56d('0x2d')]['Negative'],'sMixed':_0x3f1b42[_0xc56d('0x2d')][_0xc56d('0x2e')],'sNeutral':_0x3f1b42[_0xc56d('0x2d')][_0xc56d('0x2f')]});})[_0xc56d('0x17')](function(){logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x1c'),_0x14b82e['id']));_0x26744e();});case _0xc56d('0x30'):return _0x14b82e[_0xc56d('0x31')]({'transcribeStatus':_0xc56d('0x30'),'failureReason':_0x259967[_0xc56d('0x11')][_0xc56d('0x32')]})[_0xc56d('0x17')](function(){logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x1c'),_0x14b82e['id']));_0x26744e();});default:logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x33'),_0x14b82e['id']));break;}}else{return BPromise[_0xc56d('0x34')]()[_0xc56d('0x17')](function(){if(!_0x14b82e[_0xc56d('0x1d')]){throw new db[(_0xc56d('0x1e'))][(_0xc56d('0x26'))](_0xc56d('0x1f'));}if(!_0x585ca5[_0xc56d('0x35')]||!_0x585ca5[_0xc56d('0x20')]||!_0x585ca5[_0xc56d('0x21')]||!_0x585ca5['language']||!_0x585ca5[_0xc56d('0x23')]){throw new db[(_0xc56d('0x1e'))][(_0xc56d('0x26'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x14b82e['fileText']){throw new Error(_0xc56d('0x36'));}if(_0x585ca5['sentimentAccountId']===_0xf82e05['id']){return _0xf82e05;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x1bb678){if(!_0x1bb678){throw new db[(_0xc56d('0x1e'))][(_0xc56d('0x26'))](_0xc56d('0x27'));}if(!_0x1bb678[_0xc56d('0x28')]||!_0x1bb678[_0xc56d('0xe')]){throw new db[(_0xc56d('0x1e'))][(_0xc56d('0x26'))](_0xc56d('0x37'));}_0x2f120a=_0x1bb678;logger[_0xc56d('0xa')](util['format'](_0xc56d('0x29'),_0x14b82e['id']));return sentiment(_0x2f120a[_0xc56d('0x28')],_0x2f120a[_0xc56d('0xe')],_0x585ca5['sentimentRegion'],_0x14b82e[_0xc56d('0x12')],_0x585ca5[_0xc56d('0x22')]);})[_0xc56d('0x17')](function(_0x12e5c2){logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x2a'),_0x14b82e['id']));return _0x14b82e[_0xc56d('0x31')]({'sentiment':_0x12e5c2['Sentiment'],'sPositive':_0x12e5c2[_0xc56d('0x2d')][_0xc56d('0x2c')],'sNegative':_0x12e5c2[_0xc56d('0x2d')][_0xc56d('0x38')],'sMixed':_0x12e5c2[_0xc56d('0x2d')][_0xc56d('0x2e')],'sNeutral':_0x12e5c2[_0xc56d('0x2d')]['Neutral'],'transcribeStatus':_0xc56d('0x13')});})[_0xc56d('0x17')](function(){logger[_0xc56d('0xa')](util['format'](_0xc56d('0x1c'),_0x14b82e['id']));_0x26744e();});}})[_0xc56d('0x39')](function(_0x2b79b7){if(_0x2b79b7){if(!_0x2b79b7[_0xc56d('0x3a')]||_0x2b79b7[_0xc56d('0x3a')]!==_0xc56d('0x3b')){logger[_0xc56d('0x3c')](util['format'](_0xc56d('0x3d'),_0x14b82e['id']),util['inspect'](_0x2b79b7,{'showHidden':![],'depth':null}));}}_0x26744e();});});}function checkTranscribe(){var _0x3ed7b9;var _0x3d39ee;var _0x5280d1;return db[_0xc56d('0x3e')][_0xc56d('0x3f')]({'where':{'transcribeStatus':_0xc56d('0x40')}})['then'](function(_0x21e643){if(!_0x21e643||!_0x21e643[_0xc56d('0x1a')]){throw new db[(_0xc56d('0x1e'))]['ValidationError'](_0xc56d('0x41'));}_0x3ed7b9=_0x21e643;return db[_0xc56d('0x42')][_0xc56d('0x43')]({'where':{'id':0x1}});})[_0xc56d('0x17')](function(_0x4451a5){if(!_0x4451a5){throw new db['Sequelize'][(_0xc56d('0x26'))](_0xc56d('0x44'));}_0x3d39ee=_0x4451a5;if(!_0x3d39ee[_0xc56d('0x45')]||!_0x3d39ee[_0xc56d('0x46')]||!_0x3d39ee[_0xc56d('0xf')]||!_0x3d39ee[_0xc56d('0x22')]||!_0x3d39ee['bucket']){throw new db['Sequelize'][(_0xc56d('0x26'))](_0xc56d('0x47'));}return db[_0xc56d('0x25')][_0xc56d('0x43')]({'where':{'id':_0x3d39ee['transcribeAccountId']}});})[_0xc56d('0x17')](function(_0xa54d26){if(!_0xa54d26){throw new db[(_0xc56d('0x1e'))][(_0xc56d('0x26'))](_0xc56d('0x27'));}if(!_0xa54d26['data1']||!_0xa54d26[_0xc56d('0xe')]){throw new db[(_0xc56d('0x1e'))][(_0xc56d('0x26'))]('Cloud\x20Provider\x20not\x20configured');}_0x5280d1=_0xa54d26;var _0x1f2bd7=[];_0x3ed7b9[_0xc56d('0x48')](function(_0x4f6d64){_0x1f2bd7[_0xc56d('0x49')](checkTranscribeJob(_0x4f6d64,_0x3d39ee,_0x5280d1));});return BPromise[_0xc56d('0x4a')](_0x1f2bd7);})[_0xc56d('0x39')](function(_0x4bb37c){if(_0x4bb37c){if(!_0x4bb37c[_0xc56d('0x3a')]||_0x4bb37c[_0xc56d('0x3a')]!==_0xc56d('0x3b')){logger[_0xc56d('0x3c')](util[_0xc56d('0x4b')](_0x4bb37c,{'showHidden':![],'depth':null}));}}});}exports[_0xc56d('0x4c')]=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 854aec8..089243d 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 _0xd36c=['emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','length','info','join','system','timeout','format','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x3f809b,_0x52fb1a){var _0x595526=function(_0x1244d4){while(--_0x1244d4){_0x3f809b['push'](_0x3f809b['shift']());}};_0x595526(++_0x52fb1a);}(_0xd36c,0x1a6));var _0xcd36=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xd36c[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xcd36('0x0'));var moment=require(_0xcd36('0x1'));var Redis=require(_0xcd36('0x2'));var util=require(_0xcd36('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')('schedule');config[_0xcd36('0x4')]=_[_0xcd36('0x5')](config[_0xcd36('0x4')],{'host':_0xcd36('0x6'),'port':0x18eb});var io=require(_0xcd36('0x7'))(new Redis(config[_0xcd36('0x4')]));function closeInteractions(){var _0x1230d5=[];return db[_0xcd36('0x8')][_0xcd36('0x9')]({'raw':!![],'attributes':['id',_0xcd36('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xcd36('0xb')](0x18,'hours')}}})['then'](function(_0x170231){if(_0x170231&&_0x170231[_0xcd36('0xc')]){_0x1230d5=_['map'](_0x170231||[],'id');logger[_0xcd36('0xd')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x1230d5[_0xcd36('0xe')]());return db[_0xcd36('0x8')]['update']({'closeReason':_0xcd36('0xf'),'disposition':_0xcd36('0x10'),'closed':!![],'closedAt':moment()[_0xcd36('0x11')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1230d5}});}})[_0xcd36('0x12')](function(){if(_0x1230d5&&_0x1230d5[_0xcd36('0xc')]){logger[_0xcd36('0xd')](_0xcd36('0x13'),_0x1230d5[_0xcd36('0xe')]());for(var _0x3478e6=0x0;_0x3478e6<_0x1230d5[_0xcd36('0xc')];_0x3478e6++){io[_0xcd36('0x14')]('whatsappInteraction:update',{'id':_0x1230d5[_0x3478e6],'closed':!![]});}}})[_0xcd36('0x15')](function(_0x228e3c){logger[_0xcd36('0x16')](_0xcd36('0x17'),_0x228e3c?util[_0xcd36('0x18')](_0x228e3c,{'showHidden':![],'depth':null}):'');});}exports[_0xcd36('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x1ab2=['WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost'];(function(_0x5b2dcf,_0x294dee){var _0x370b38=function(_0x221eb4){while(--_0x221eb4){_0x5b2dcf['push'](_0x5b2dcf['shift']());}};_0x370b38(++_0x294dee);}(_0x1ab2,0x157));var _0x21ab=function(_0x37890b,_0x1112c0){_0x37890b=_0x37890b-0x0;var _0x38ec23=_0x1ab2[_0x37890b];return _0x38ec23;};'use strict';var _=require(_0x21ab('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x21ab('0x1'));var config=require(_0x21ab('0x2'));var db=require(_0x21ab('0x3'))['db'];var logger=require(_0x21ab('0x4'))(_0x21ab('0x5'));config['redis']=_[_0x21ab('0x6')](config[_0x21ab('0x7')],{'host':_0x21ab('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x21ab('0x7')]));function closeInteractions(){var _0x587fc2=[];return db[_0x21ab('0x9')][_0x21ab('0xa')]({'raw':!![],'attributes':['id',_0x21ab('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x21ab('0xc')](0x18,_0x21ab('0xd'))}}})[_0x21ab('0xe')](function(_0x155f72){if(_0x155f72&&_0x155f72[_0x21ab('0xf')]){_0x587fc2=_[_0x21ab('0x10')](_0x155f72||[],'id');logger[_0x21ab('0x11')](_0x21ab('0x12'),_0x587fc2[_0x21ab('0x13')]());return db[_0x21ab('0x9')][_0x21ab('0x14')]({'closeReason':_0x21ab('0x15'),'disposition':_0x21ab('0x16'),'closed':!![],'closedAt':moment()[_0x21ab('0x17')](_0x21ab('0x18'))},{'where':{'id':_0x587fc2}});}})['then'](function(){if(_0x587fc2&&_0x587fc2[_0x21ab('0xf')]){logger['info'](_0x21ab('0x19'),_0x587fc2['join']());for(var _0x40c78b=0x0;_0x40c78b<_0x587fc2[_0x21ab('0xf')];_0x40c78b++){io[_0x21ab('0x1a')](_0x21ab('0x1b'),{'id':_0x587fc2[_0x40c78b],'closed':!![]});}}})[_0x21ab('0x1c')](function(_0x285ec6){logger['error'](_0x21ab('0x1d'),_0x285ec6?util[_0x21ab('0x1e')](_0x285ec6,{'showHidden':![],'depth':null}):'');});}exports[_0x21ab('0x1f')]=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 dfc1e39..e655dc4 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7398=['../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','push','CmContact','destroy','bulkCreate','then','finished\x20populating','CmHopper','hopper1','log','contacts2','hopper2','catch','util'];(function(_0x4dcf20,_0x5092cd){var _0xe34a53=function(_0x1315b9){while(--_0x1315b9){_0x4dcf20['push'](_0x4dcf20['shift']());}};_0xe34a53(++_0x5092cd);}(_0x7398,0x168));var _0x8739=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7398[_0x2641f9];return _0x585741;};'use strict';var util=require(_0x8739('0x0'));var db=require(_0x8739('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x8739('0x2')+i,'lastName':_0x8739('0x3')+i,'phone':0xf879fb460+i,'email':_0x8739('0x4')+i+_0x8739('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x8739('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8739('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x8739('0x7')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x8739('0x4')+i+_0x8739('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x8739('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8739('0x6')](),'updatedAt':Date[_0x8739('0x6')]()});}db[_0x8739('0x8')][_0x8739('0x9')]({'where':{}})['then'](function(){return db['CmContact'][_0x8739('0xa')](contacts);})[_0x8739('0xb')](function(){console['log'](_0x8739('0xc'),'contacts1');return db[_0x8739('0xd')][_0x8739('0x9')]({'where':{}});})[_0x8739('0xb')](function(){return db[_0x8739('0xd')][_0x8739('0xa')](hopper);})[_0x8739('0xb')](function(){console['log'](_0x8739('0xc'),_0x8739('0xe'));return db[_0x8739('0x8')]['bulkCreate'](contacts2);})[_0x8739('0xb')](function(){console[_0x8739('0xf')](_0x8739('0xc'),_0x8739('0x10'));return db[_0x8739('0xd')]['bulkCreate'](hopper2);})[_0x8739('0xb')](function(){console[_0x8739('0xf')](_0x8739('0xc'),_0x8739('0x11'));})[_0x8739('0x12')](function(_0x414feb){console[_0x8739('0xf')](_0x414feb);}); \ No newline at end of file +var _0x4fc5=['catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact','destroy','then','finished\x20populating','contacts1','CmHopper','bulkCreate','log','contacts2','hopper2'];(function(_0x445da9,_0x9b3e20){var _0x408f3e=function(_0x164d26){while(--_0x164d26){_0x445da9['push'](_0x445da9['shift']());}};_0x408f3e(++_0x9b3e20);}(_0x4fc5,0x10b));var _0x54fc=function(_0x5b1370,_0x5beac4){_0x5b1370=_0x5b1370-0x0;var _0xf5075d=_0x4fc5[_0x5b1370];return _0xf5075d;};'use strict';var util=require(_0x54fc('0x0'));var db=require(_0x54fc('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x54fc('0x2')]({'id':i,'firstName':_0x54fc('0x3')+i,'lastName':_0x54fc('0x4')+i,'phone':0xf879fb460+i,'email':_0x54fc('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x54fc('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x54fc('0x6')](),'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[_0x54fc('0x2')]({'id':i,'firstName':_0x54fc('0x3')+i,'lastName':_0x54fc('0x4')+i,'phone':0xf879fb460+i,'email':_0x54fc('0x5')+i+_0x54fc('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x54fc('0x2')]({'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[_0x54fc('0x6')]()});}db[_0x54fc('0x8')][_0x54fc('0x9')]({'where':{}})[_0x54fc('0xa')](function(){return db[_0x54fc('0x8')]['bulkCreate'](contacts);})['then'](function(){console['log'](_0x54fc('0xb'),_0x54fc('0xc'));return db['CmHopper'][_0x54fc('0x9')]({'where':{}});})[_0x54fc('0xa')](function(){return db[_0x54fc('0xd')][_0x54fc('0xe')](hopper);})['then'](function(){console['log'](_0x54fc('0xb'),'hopper1');return db['CmContact'][_0x54fc('0xe')](contacts2);})[_0x54fc('0xa')](function(){console[_0x54fc('0xf')](_0x54fc('0xb'),_0x54fc('0x10'));return db['CmHopper'][_0x54fc('0xe')](hopper2);})['then'](function(){console[_0x54fc('0xf')](_0x54fc('0xb'),_0x54fc('0x11'));})[_0x54fc('0x12')](function(_0x4035f2){console[_0x54fc('0xf')](_0x4035f2);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index b80e93b..77100b6 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7aca=['add\x20user','log','util','format','%s%s','agent','%s%s@xcally.com','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7aca,0xb6));var _0xa7ac=function(_0x2c9aab,_0xba855b){_0x2c9aab=_0x2c9aab-0x0;var _0x312b1e=_0x7aca[_0x2c9aab];return _0x312b1e;};'use strict';var util=require(_0xa7ac('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xa7ac('0x1')](_0xa7ac('0x2'),_0xa7ac('0x3'),i),'fullname':util[_0xa7ac('0x1')]('%s%s',_0xa7ac('0x3'),i),'email':util[_0xa7ac('0x1')](_0xa7ac('0x4'),_0xa7ac('0x3'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0xa7ac('0x5'),'transport':[_0xa7ac('0x6'),'ws',_0xa7ac('0x7')],'disallow':[_0xa7ac('0x8')],'allow':[_0xa7ac('0x9')],'defaultuser':util[_0xa7ac('0x1')](_0xa7ac('0x2'),_0xa7ac('0x3'),i),'encryption':'yes','avpf':_0xa7ac('0xa'),'force_avp':_0xa7ac('0xa'),'icesupport':_0xa7ac('0xa'),'dtlsenable':_0xa7ac('0xa'),'dtlsverify':'no','dtlscertfile':_0xa7ac('0xb'),'dtlsprivatekey':_0xa7ac('0xc'),'dtlssetup':_0xa7ac('0xd'),'callerid':util[_0xa7ac('0x1')](_0xa7ac('0xe'),util[_0xa7ac('0x1')](_0xa7ac('0x2'),_0xa7ac('0x3'),i),0xfa0+i)});}db['User']['bulkCreate'](users)[_0xa7ac('0xf')](function(){console['log'](_0xa7ac('0x10'));})['catch'](function(_0x71da33){console[_0xa7ac('0x11')](_0x71da33);}); \ No newline at end of file +var _0xb6d2=['/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','log','add\x20user','catch','util','push','format','agent','%s%s','%s%s@xcally.com','password','friend','all','yes'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xb6d2,0x14c));var _0x2b6d=function(_0x3b6746,_0xeae4a5){_0x3b6746=_0x3b6746-0x0;var _0x5b97a2=_0xb6d2[_0x3b6746];return _0x5b97a2;};'use strict';var util=require(_0x2b6d('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x2b6d('0x1')]({'name':util[_0x2b6d('0x2')]('%s%s',_0x2b6d('0x3'),i),'fullname':util[_0x2b6d('0x2')](_0x2b6d('0x4'),'agent',i),'email':util[_0x2b6d('0x2')](_0x2b6d('0x5'),'agent',i),'role':_0x2b6d('0x3'),'password':_0x2b6d('0x6'),'internal':0xfa0+i,'type':_0x2b6d('0x7'),'transport':['udp','ws','wss'],'disallow':[_0x2b6d('0x8')],'allow':['ulaw'],'defaultuser':util[_0x2b6d('0x2')](_0x2b6d('0x4'),_0x2b6d('0x3'),i),'encryption':_0x2b6d('0x9'),'avpf':_0x2b6d('0x9'),'force_avp':_0x2b6d('0x9'),'icesupport':_0x2b6d('0x9'),'dtlsenable':_0x2b6d('0x9'),'dtlsverify':'no','dtlscertfile':_0x2b6d('0xa'),'dtlsprivatekey':_0x2b6d('0xb'),'dtlssetup':_0x2b6d('0xc'),'callerid':util[_0x2b6d('0x2')]('\x22%s\x22\x20<%s>',util[_0x2b6d('0x2')]('%s%s',_0x2b6d('0x3'),i),0xfa0+i)});}db[_0x2b6d('0xd')][_0x2b6d('0xe')](users)[_0x2b6d('0xf')](function(){console[_0x2b6d('0x10')](_0x2b6d('0x11'));})[_0x2b6d('0x12')](function(_0x4bd0b5){console['log'](_0x4bd0b5);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index b50aac7..686d1dc 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f3d=['WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','User','where','format','%s:queue:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','OpenchannelInteractions','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','Campaign','user','MailQueues','OpenchannelQueue','Telephones','Trunk','getVoiceQueues','getChatQueues','getOpenchannelQueues','all','length','voice','chat','fax','sms','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','address','disconnect','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','OpenchannelQueues'];(function(_0x39b7c,_0x4c5919){var _0x1d4fb6=function(_0x1fba04){while(--_0x1fba04){_0x39b7c['push'](_0x39b7c['shift']());}};_0x1d4fb6(++_0x4c5919);}(_0x4f3d,0x171));var _0xd4f3=function(_0x33610,_0x56c6ab){_0x33610=_0x33610-0x0;var _0x2941ad=_0x4f3d[_0x33610];return _0x2941ad;};'use strict';var _=require(_0xd4f3('0x0'));var util=require('util');var BPromise=require(_0xd4f3('0x1'));var db=require(_0xd4f3('0x2'))['db'];var config=require(_0xd4f3('0x3'));var queryQueues={'attributes':['id',_0xd4f3('0x4')],'include':[{'as':_0xd4f3('0x5'),'model':db['User'],'attributes':['id',_0xd4f3('0x4'),_0xd4f3('0x6')],'raw':!![],'where':{'role':_0xd4f3('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xd4f3('0x4')],'where':{'role':_0xd4f3('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xd4f3('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xd4f3('0x4')],'where':{'role':_0xd4f3('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xd4f3('0x9')],'where':{'type':_0xd4f3('0xa')}};function getAssociatedResources(_0x25ad5d,_0x167d2a,_0x39a19b){return db[_0xd4f3('0xb')][_0xd4f3('0xc')]({'where':{'name':_0x25ad5d,'userProfileId':_0x167d2a},'raw':!![]})[_0xd4f3('0xd')](function(_0x4915eb){if(_0x4915eb){if(_0x4915eb[_0xd4f3('0xe')]){switch(_0x25ad5d){case _0xd4f3('0xf'):case'ChatQueues':case _0xd4f3('0x10'):case _0xd4f3('0x11'):case'MailQueues':case _0xd4f3('0x12'):case _0xd4f3('0x13'):return db[_0x39a19b]['findAll'](queryQueues);case'Telephones':return db[_0x39a19b][_0xd4f3('0x14')](queryTelephones);case _0xd4f3('0x15'):return db[_0x39a19b]['findAll'](queryTrunks);case _0xd4f3('0x16'):return db[_0x39a19b][_0xd4f3('0x14')](queryCampaigns);}}else{return db[_0xd4f3('0x17')][_0xd4f3('0x14')]({'attributes':['resourceId'],'where':{'sectionId':_0x4915eb['id']},'raw':!![]})[_0xd4f3('0xd')](function(_0x113e7c){if(_0x113e7c){var _0xdee08d={'where':{'id':_[_0xd4f3('0x18')](_0x113e7c,_0xd4f3('0x19'))},'raw':!![]};switch(_0x39a19b){case _0xd4f3('0x1a'):_0xdee08d[_0xd4f3('0x1b')][_0xd4f3('0x6')]=_0xd4f3('0x8');break;case'Campaign':_0xdee08d[_0xd4f3('0x1b')]['type']=_0xd4f3('0xa');break;}return db[_0x39a19b][_0xd4f3('0x14')](_0xdee08d);}else{return[];}});}}else{return[];}})[_0xd4f3('0xd')](function(_0x408e15){return _0x408e15;});}function joinOrLeaveQueues(_0x150793,_0x445f76,_0x4b3d8c,_0x474f45){_0x150793[_0x445f76](util[_0xd4f3('0x1c')](_0xd4f3('0x1d'),_0x4b3d8c,_0x474f45[_0xd4f3('0x4')]));if(_0x474f45[_0xd4f3('0x5')]){for(var _0x5b8e6d=0x0;_0x5b8e6d<_0x474f45['Agents']['length'];_0x5b8e6d+=0x1){_0x150793[_0x445f76](util['format']('user:%s',_0x474f45[_0xd4f3('0x5')][_0x5b8e6d][_0xd4f3('0x4')]));}}}function joinOrLeave(_0x4c4a22,_0x20473f,_0x375885){var _0x4f38cd;if(_0x4c4a22[_0xd4f3('0x1e')][_0xd4f3('0x1f')]['id']){db[_0xd4f3('0x1a')][_0xd4f3('0x20')]({'attributes':['id',_0xd4f3('0x4'),_0xd4f3('0x6'),_0xd4f3('0x21')],'where':{'id':_0x4c4a22['handshake'][_0xd4f3('0x1f')]['id']},'include':[{'model':db[_0xd4f3('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xd4f3('0x23')],'as':_0xd4f3('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xd4f3('0x25')],'as':_0xd4f3('0x26'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xd4f3('0x27'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xd4f3('0x28'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x152426){if(_0x152426){_0x4f38cd=_0x152426;_0x4c4a22[_0x20473f](util['format'](_0xd4f3('0x29'),_0x152426[_0xd4f3('0x4')]));var _0x5a41a5=[];switch(_0x152426[_0xd4f3('0x6')]){case _0xd4f3('0x2a'):_0x4c4a22[_0x20473f](_0xd4f3('0x2b'));_0x4c4a22[_0x20473f](_0xd4f3('0x2c'));if(queryQueues[_0xd4f3('0x2d')](_0xd4f3('0x2e'))){delete queryQueues[_0xd4f3('0x2e')];}_0x5a41a5[_0xd4f3('0x2f')](db[_0xd4f3('0x30')][_0xd4f3('0x14')](queryQueues));_0x5a41a5[_0xd4f3('0x2f')](db[_0xd4f3('0x31')]['findAll'](queryQueues));_0x5a41a5[_0xd4f3('0x2f')](db[_0xd4f3('0x32')]['findAll'](queryQueues));_0x5a41a5[_0xd4f3('0x2f')](db[_0xd4f3('0x33')][_0xd4f3('0x14')](queryQueues));_0x5a41a5[_0xd4f3('0x2f')](db[_0xd4f3('0x34')]['findAll'](queryQueues));_0x5a41a5['push'](db['OpenchannelQueue'][_0xd4f3('0x14')](queryQueues));_0x5a41a5[_0xd4f3('0x2f')](db['WhatsappQueue'][_0xd4f3('0x14')](queryQueues));_0x5a41a5['push'](db[_0xd4f3('0x1a')][_0xd4f3('0x14')](queryTelephones));_0x5a41a5[_0xd4f3('0x2f')](db['Trunk'][_0xd4f3('0x14')](queryTrunks));_0x5a41a5['push'](db[_0xd4f3('0x35')][_0xd4f3('0x14')](queryCampaigns));_0x5a41a5[_0xd4f3('0x2f')](db['User'][_0xd4f3('0x14')](queryAgents));break;case _0xd4f3('0x36'):_0x4c4a22[_0x20473f](_0xd4f3('0x2b'));_0x4c4a22[_0x20473f](_0xd4f3('0x2c'));_0x5a41a5[_0xd4f3('0x2f')](getAssociatedResources(_0xd4f3('0xf'),_0x152426[_0xd4f3('0x21')],_0xd4f3('0x30')));_0x5a41a5[_0xd4f3('0x2f')](getAssociatedResources('ChatQueues',_0x152426[_0xd4f3('0x21')],_0xd4f3('0x31')));_0x5a41a5['push'](getAssociatedResources('FaxQueues',_0x152426[_0xd4f3('0x21')],_0xd4f3('0x32')));_0x5a41a5[_0xd4f3('0x2f')](getAssociatedResources('SmsQueues',_0x152426[_0xd4f3('0x21')],_0xd4f3('0x33')));_0x5a41a5[_0xd4f3('0x2f')](getAssociatedResources(_0xd4f3('0x37'),_0x152426[_0xd4f3('0x21')],_0xd4f3('0x34')));_0x5a41a5['push'](getAssociatedResources(_0xd4f3('0x12'),_0x152426[_0xd4f3('0x21')],_0xd4f3('0x38')));_0x5a41a5[_0xd4f3('0x2f')](getAssociatedResources(_0xd4f3('0x13'),_0x152426[_0xd4f3('0x21')],'WhatsappQueue'));_0x5a41a5[_0xd4f3('0x2f')](getAssociatedResources(_0xd4f3('0x39'),_0x152426[_0xd4f3('0x21')],_0xd4f3('0x1a')));_0x5a41a5[_0xd4f3('0x2f')](getAssociatedResources('Trunks',_0x152426[_0xd4f3('0x21')],_0xd4f3('0x3a')));_0x5a41a5[_0xd4f3('0x2f')](getAssociatedResources(_0xd4f3('0x16'),_0x152426[_0xd4f3('0x21')],_0xd4f3('0x35')));_0x5a41a5['push'](db[_0xd4f3('0x1a')]['findAll'](queryAgents));break;case _0xd4f3('0x7'):_0x4c4a22[_0x20473f](_0xd4f3('0x2b'));_0x4c4a22[_0x20473f](_0xd4f3('0x2c'));_0x5a41a5[_0xd4f3('0x2f')](_0x152426[_0xd4f3('0x3b')]({'attributes':['id',_0xd4f3('0x4')]}));_0x5a41a5[_0xd4f3('0x2f')](_0x152426[_0xd4f3('0x3c')]({'attributes':['id',_0xd4f3('0x4')]}));_0x5a41a5[_0xd4f3('0x2f')](_0x152426['getFaxQueues']({'attributes':['id',_0xd4f3('0x4')]}));_0x5a41a5[_0xd4f3('0x2f')](_0x152426['getSmsQueues']({'attributes':['id',_0xd4f3('0x4')]}));_0x5a41a5[_0xd4f3('0x2f')](_0x152426['getMailQueues']({'attributes':['id','name']}));_0x5a41a5[_0xd4f3('0x2f')](_0x152426[_0xd4f3('0x3d')]({'attributes':['id',_0xd4f3('0x4')]}));_0x5a41a5[_0xd4f3('0x2f')](_0x152426['getWhatsappQueues']({'attributes':['id',_0xd4f3('0x4')]}));break;}return BPromise[_0xd4f3('0x3e')](_0x5a41a5);}})[_0xd4f3('0xd')](function(_0x11792d){if(_0x11792d&&_0x11792d[_0xd4f3('0x3f')]){for(var _0x2ecbb4=0x0;_0x2ecbb4<_0x11792d[_0xd4f3('0x3f')];_0x2ecbb4+=0x1){for(var _0x142f1f=0x0;_0x142f1f<_0x11792d[_0x2ecbb4][_0xd4f3('0x3f')];_0x142f1f+=0x1){switch(_0x2ecbb4){case 0x0:joinOrLeaveQueues(_0x4c4a22,_0x20473f,_0xd4f3('0x40'),_0x11792d[_0x2ecbb4][_0x142f1f]);break;case 0x1:joinOrLeaveQueues(_0x4c4a22,_0x20473f,_0xd4f3('0x41'),_0x11792d[_0x2ecbb4][_0x142f1f]);break;case 0x2:joinOrLeaveQueues(_0x4c4a22,_0x20473f,_0xd4f3('0x42'),_0x11792d[_0x2ecbb4][_0x142f1f]);break;case 0x3:joinOrLeaveQueues(_0x4c4a22,_0x20473f,_0xd4f3('0x43'),_0x11792d[_0x2ecbb4][_0x142f1f]);break;case 0x4:joinOrLeaveQueues(_0x4c4a22,_0x20473f,'mail',_0x11792d[_0x2ecbb4][_0x142f1f]);break;case 0x5:joinOrLeaveQueues(_0x4c4a22,_0x20473f,_0xd4f3('0x44'),_0x11792d[_0x2ecbb4][_0x142f1f]);break;case 0x6:joinOrLeaveQueues(_0x4c4a22,_0x20473f,'whatsapp',_0x11792d[_0x2ecbb4][_0x142f1f]);break;case 0x7:if(_0x4f38cd[_0xd4f3('0x6')]!==_0xd4f3('0x7'))_0x4c4a22[_0x20473f](util['format'](_0xd4f3('0x45'),_0x11792d[_0x2ecbb4][_0x142f1f]['name']));break;case 0x8:if(_0x4f38cd[_0xd4f3('0x6')]!==_0xd4f3('0x7'))_0x4c4a22[_0x20473f](util['format'](_0xd4f3('0x46'),_0x11792d[_0x2ecbb4][_0x142f1f][_0xd4f3('0x4')]));break;case 0x9:if(_0x4f38cd[_0xd4f3('0x6')]!=='agent')_0x4c4a22[_0x20473f](util[_0xd4f3('0x1c')](_0xd4f3('0x47'),_0x11792d[_0x2ecbb4][_0x142f1f][_0xd4f3('0x9')],_0x11792d[_0x2ecbb4][_0x142f1f]['name']));break;case 0xa:_0x4c4a22[_0x20473f](util['format']('user:%s',_0x11792d[_0x2ecbb4][_0x142f1f][_0xd4f3('0x4')]));break;}}}}})['then'](function(){if(_0x20473f===_0xd4f3('0x48')){var _0x19b01b=_['map'](_0x4f38cd[_0xd4f3('0x49')],'id');return _0x4f38cd[_0xd4f3('0x4a')](_0x19b01b)[_0xd4f3('0xd')](function(){for(var _0x597c9a=0x0;_0x597c9a<_0x19b01b[_0xd4f3('0x3f')];_0x597c9a+=0x1){_0x375885[_0xd4f3('0x4b')](_0xd4f3('0x4c'),{'ChatInteractionId':Number(_0x19b01b[_0x597c9a]),'UserId':Number(_0x4f38cd['id'])});}});}})['then'](function(){if(_0x20473f===_0xd4f3('0x48')){var _0x19a8bf=_[_0xd4f3('0x18')](_0x4f38cd[_0xd4f3('0x24')],'id');return _0x4f38cd['removeMailInteractions'](_0x19a8bf)[_0xd4f3('0xd')](function(){for(var _0x2c6f96=0x0;_0x2c6f96<_0x19a8bf['length'];_0x2c6f96+=0x1){_0x375885[_0xd4f3('0x4b')](_0xd4f3('0x4d'),{'MailInteractionId':Number(_0x19a8bf[_0x2c6f96]),'UserId':Number(_0x4f38cd['id'])});}});}})[_0xd4f3('0xd')](function(){if(_0x20473f===_0xd4f3('0x48')){var _0x300671=_[_0xd4f3('0x18')](_0x4f38cd[_0xd4f3('0x26')],'id');return _0x4f38cd['removeFaxInteractions'](_0x300671)[_0xd4f3('0xd')](function(){for(var _0x3b820a=0x0;_0x3b820a<_0x300671[_0xd4f3('0x3f')];_0x3b820a+=0x1){_0x375885[_0xd4f3('0x4b')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x300671[_0x3b820a]),'UserId':Number(_0x4f38cd['id'])});}});}})[_0xd4f3('0xd')](function(){if(_0x20473f===_0xd4f3('0x48')){var _0x205e54=_[_0xd4f3('0x18')](_0x4f38cd[_0xd4f3('0x4e')],'id');return _0x4f38cd[_0xd4f3('0x4f')](_0x205e54)[_0xd4f3('0xd')](function(){for(var _0x400856=0x0;_0x400856<_0x205e54[_0xd4f3('0x3f')];_0x400856+=0x1){_0x375885[_0xd4f3('0x4b')](_0xd4f3('0x50'),{'SmsInteractionId':Number(_0x205e54[_0x400856]),'UserId':Number(_0x4f38cd['id'])});}});}})[_0xd4f3('0xd')](function(){if(_0x20473f==='leave'){var _0xd66d53=_['map'](_0x4f38cd[_0xd4f3('0x27')],'id');return _0x4f38cd['removeOpenchannelInteractions'](_0xd66d53)[_0xd4f3('0xd')](function(){for(var _0x512c72=0x0;_0x512c72<_0xd66d53['length'];_0x512c72+=0x1){_0x375885[_0xd4f3('0x4b')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0xd66d53[_0x512c72]),'UserId':Number(_0x4f38cd['id'])});}});}})[_0xd4f3('0xd')](function(){if(_0x20473f==='leave'){var _0x3df7d6=_[_0xd4f3('0x18')](_0x4f38cd[_0xd4f3('0x28')],'id');return _0x4f38cd['removeWhatsappInteractions'](_0x3df7d6)['then'](function(){for(var _0x2eb5f0=0x0;_0x2eb5f0<_0x3df7d6[_0xd4f3('0x3f')];_0x2eb5f0+=0x1){_0x375885[_0xd4f3('0x4b')](_0xd4f3('0x51'),{'WhatsappInteractionId':Number(_0x3df7d6[_0x2eb5f0]),'UserId':Number(_0x4f38cd['id'])});}});}})[_0xd4f3('0x52')](function(_0x4b0a9c){_0x4c4a22[_0xd4f3('0x53')](_0x4b0a9c);});}}function onDisconnect(_0x4f1550,_0x2aee21){joinOrLeave(_0x4f1550,_0xd4f3('0x48'),_0x2aee21);}function onConnect(_0x57af32){joinOrLeave(_0x57af32,_0xd4f3('0x54'));}exports[_0xd4f3('0x55')]=function(_0x21438c){_0x21438c['on'](_0xd4f3('0x56'),function(_0x49d77a){_0x49d77a[_0xd4f3('0x57')](0x0);_0x49d77a['address']=_0x49d77a[_0xd4f3('0x58')]['connection'][_0xd4f3('0x59')]+':'+_0x49d77a[_0xd4f3('0x58')][_0xd4f3('0x56')][_0xd4f3('0x5a')];_0x49d77a[_0xd4f3('0x5b')]=new Date();_0x49d77a['log']=function(_0xc77e75){console['log'](_0xd4f3('0x5c')+_0x49d77a[_0xd4f3('0x5d')][_0xd4f3('0x4')]+'['+_0x49d77a[_0xd4f3('0x5e')]+']',_0xc77e75);};_0x49d77a['on'](_0xd4f3('0x5f'),function(){onDisconnect(_0x49d77a,_0x21438c);_0x49d77a['log']('DISCONNECTED');});onConnect(_0x49d77a);_0x49d77a[_0xd4f3('0x53')](_0xd4f3('0x60'));});}; \ No newline at end of file +var _0x1af1=['connection','remotePort','connectedAt','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','UserProfileResource','resourceId','then','map','where','telephone','Campaign','type','format','%s:queue:%s','length','user:%s','handshake','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','SmsQueue','WhatsappQueue','Telephones','Trunk','IvrCampaigns','agent','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','sms','mail','whatsapp','telephone:%s','campaign:%s:%s','leave','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','address','request','remoteAddress'];(function(_0x1b423d,_0x4bc4b8){var _0x5d37ce=function(_0xc5e930){while(--_0xc5e930){_0x1b423d['push'](_0x1b423d['shift']());}};_0x5d37ce(++_0x4bc4b8);}(_0x1af1,0x133));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 BPromise=require(_0x11af('0x2'));var db=require(_0x11af('0x3'))['db'];var config=require(_0x11af('0x4'));var queryQueues={'attributes':['id',_0x11af('0x5')],'include':[{'as':_0x11af('0x6'),'model':db[_0x11af('0x7')],'attributes':['id',_0x11af('0x5'),_0x11af('0x8')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x11af('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x11af('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x11af('0x5'),'type'],'where':{'type':_0x11af('0x9')}};function getAssociatedResources(_0x4c8bf1,_0x3d8d3f,_0x23b31a){return db[_0x11af('0xa')][_0x11af('0xb')]({'where':{'name':_0x4c8bf1,'userProfileId':_0x3d8d3f},'raw':!![]})['then'](function(_0x4214bd){if(_0x4214bd){if(_0x4214bd[_0x11af('0xc')]){switch(_0x4c8bf1){case _0x11af('0xd'):case _0x11af('0xe'):case _0x11af('0xf'):case _0x11af('0x10'):case _0x11af('0x11'):case _0x11af('0x12'):case _0x11af('0x13'):return db[_0x23b31a][_0x11af('0x14')](queryQueues);case'Telephones':return db[_0x23b31a][_0x11af('0x14')](queryTelephones);case _0x11af('0x15'):return db[_0x23b31a][_0x11af('0x14')](queryTrunks);case'IvrCampaigns':return db[_0x23b31a][_0x11af('0x14')](queryCampaigns);}}else{return db[_0x11af('0x16')]['findAll']({'attributes':[_0x11af('0x17')],'where':{'sectionId':_0x4214bd['id']},'raw':!![]})[_0x11af('0x18')](function(_0x2292c8){if(_0x2292c8){var _0x23ed21={'where':{'id':_[_0x11af('0x19')](_0x2292c8,_0x11af('0x17'))},'raw':!![]};switch(_0x23b31a){case _0x11af('0x7'):_0x23ed21[_0x11af('0x1a')][_0x11af('0x8')]=_0x11af('0x1b');break;case _0x11af('0x1c'):_0x23ed21[_0x11af('0x1a')][_0x11af('0x1d')]=_0x11af('0x9');break;}return db[_0x23b31a][_0x11af('0x14')](_0x23ed21);}else{return[];}});}}else{return[];}})[_0x11af('0x18')](function(_0x66ef3f){return _0x66ef3f;});}function joinOrLeaveQueues(_0xa557f7,_0x2a1de1,_0x1ffbda,_0x55940a){_0xa557f7[_0x2a1de1](util[_0x11af('0x1e')](_0x11af('0x1f'),_0x1ffbda,_0x55940a['name']));if(_0x55940a[_0x11af('0x6')]){for(var _0x204333=0x0;_0x204333<_0x55940a[_0x11af('0x6')][_0x11af('0x20')];_0x204333+=0x1){_0xa557f7[_0x2a1de1](util['format'](_0x11af('0x21'),_0x55940a[_0x11af('0x6')][_0x204333][_0x11af('0x5')]));}}}function joinOrLeave(_0x1d56ca,_0x514ea8,_0x8eeed){var _0x61a534;if(_0x1d56ca[_0x11af('0x22')]['query']['id']){db[_0x11af('0x7')]['find']({'attributes':['id','name','role',_0x11af('0x23')],'where':{'id':_0x1d56ca[_0x11af('0x22')][_0x11af('0x24')]['id']},'include':[{'model':db[_0x11af('0x25')],'as':_0x11af('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x11af('0x27')],'as':_0x11af('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x11af('0x29')],'as':_0x11af('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x11af('0x2b')],'as':_0x11af('0x2c'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x11af('0x2d'),'attributes':['id'],'raw':!![]},{'model':db[_0x11af('0x2e')],'as':_0x11af('0x2f'),'attributes':['id'],'raw':!![]}]})[_0x11af('0x18')](function(_0xfc1d23){if(_0xfc1d23){_0x61a534=_0xfc1d23;_0x1d56ca[_0x514ea8](util[_0x11af('0x1e')](_0x11af('0x21'),_0xfc1d23['name']));var _0x3b047c=[];switch(_0xfc1d23[_0x11af('0x8')]){case _0x11af('0x30'):_0x1d56ca[_0x514ea8](_0x11af('0x31'));_0x1d56ca[_0x514ea8](_0x11af('0x32'));if(queryQueues[_0x11af('0x33')](_0x11af('0x34'))){delete queryQueues['include'];}_0x3b047c[_0x11af('0x35')](db[_0x11af('0x36')][_0x11af('0x14')](queryQueues));_0x3b047c[_0x11af('0x35')](db[_0x11af('0x37')]['findAll'](queryQueues));_0x3b047c[_0x11af('0x35')](db[_0x11af('0x38')]['findAll'](queryQueues));_0x3b047c[_0x11af('0x35')](db['SmsQueue'][_0x11af('0x14')](queryQueues));_0x3b047c[_0x11af('0x35')](db[_0x11af('0x39')][_0x11af('0x14')](queryQueues));_0x3b047c['push'](db[_0x11af('0x3a')][_0x11af('0x14')](queryQueues));_0x3b047c[_0x11af('0x35')](db['WhatsappQueue']['findAll'](queryQueues));_0x3b047c['push'](db[_0x11af('0x7')][_0x11af('0x14')](queryTelephones));_0x3b047c['push'](db['Trunk'][_0x11af('0x14')](queryTrunks));_0x3b047c[_0x11af('0x35')](db['Campaign'][_0x11af('0x14')](queryCampaigns));_0x3b047c[_0x11af('0x35')](db[_0x11af('0x7')][_0x11af('0x14')](queryAgents));break;case'user':_0x1d56ca[_0x514ea8](_0x11af('0x31'));_0x1d56ca[_0x514ea8](_0x11af('0x32'));_0x3b047c[_0x11af('0x35')](getAssociatedResources(_0x11af('0xd'),_0xfc1d23['userProfileId'],_0x11af('0x36')));_0x3b047c[_0x11af('0x35')](getAssociatedResources(_0x11af('0xe'),_0xfc1d23['userProfileId'],_0x11af('0x37')));_0x3b047c[_0x11af('0x35')](getAssociatedResources(_0x11af('0xf'),_0xfc1d23['userProfileId'],_0x11af('0x38')));_0x3b047c[_0x11af('0x35')](getAssociatedResources('SmsQueues',_0xfc1d23['userProfileId'],_0x11af('0x3b')));_0x3b047c['push'](getAssociatedResources('MailQueues',_0xfc1d23['userProfileId'],_0x11af('0x39')));_0x3b047c[_0x11af('0x35')](getAssociatedResources(_0x11af('0x12'),_0xfc1d23['userProfileId'],'OpenchannelQueue'));_0x3b047c[_0x11af('0x35')](getAssociatedResources(_0x11af('0x13'),_0xfc1d23[_0x11af('0x23')],_0x11af('0x3c')));_0x3b047c[_0x11af('0x35')](getAssociatedResources(_0x11af('0x3d'),_0xfc1d23['userProfileId'],_0x11af('0x7')));_0x3b047c[_0x11af('0x35')](getAssociatedResources(_0x11af('0x15'),_0xfc1d23[_0x11af('0x23')],_0x11af('0x3e')));_0x3b047c[_0x11af('0x35')](getAssociatedResources(_0x11af('0x3f'),_0xfc1d23[_0x11af('0x23')],_0x11af('0x1c')));_0x3b047c[_0x11af('0x35')](db['User']['findAll'](queryAgents));break;case _0x11af('0x40'):_0x1d56ca[_0x514ea8](_0x11af('0x31'));_0x1d56ca[_0x514ea8]('voice:outbound');_0x3b047c['push'](_0xfc1d23['getVoiceQueues']({'attributes':['id','name']}));_0x3b047c['push'](_0xfc1d23[_0x11af('0x41')]({'attributes':['id',_0x11af('0x5')]}));_0x3b047c['push'](_0xfc1d23[_0x11af('0x42')]({'attributes':['id',_0x11af('0x5')]}));_0x3b047c[_0x11af('0x35')](_0xfc1d23[_0x11af('0x43')]({'attributes':['id','name']}));_0x3b047c[_0x11af('0x35')](_0xfc1d23[_0x11af('0x44')]({'attributes':['id','name']}));_0x3b047c[_0x11af('0x35')](_0xfc1d23[_0x11af('0x45')]({'attributes':['id','name']}));_0x3b047c[_0x11af('0x35')](_0xfc1d23[_0x11af('0x46')]({'attributes':['id',_0x11af('0x5')]}));break;}return BPromise[_0x11af('0x47')](_0x3b047c);}})[_0x11af('0x18')](function(_0x2cbeb3){if(_0x2cbeb3&&_0x2cbeb3[_0x11af('0x20')]){for(var _0x11c10e=0x0;_0x11c10e<_0x2cbeb3[_0x11af('0x20')];_0x11c10e+=0x1){for(var _0x22e8d8=0x0;_0x22e8d8<_0x2cbeb3[_0x11c10e][_0x11af('0x20')];_0x22e8d8+=0x1){switch(_0x11c10e){case 0x0:joinOrLeaveQueues(_0x1d56ca,_0x514ea8,'voice',_0x2cbeb3[_0x11c10e][_0x22e8d8]);break;case 0x1:joinOrLeaveQueues(_0x1d56ca,_0x514ea8,_0x11af('0x48'),_0x2cbeb3[_0x11c10e][_0x22e8d8]);break;case 0x2:joinOrLeaveQueues(_0x1d56ca,_0x514ea8,_0x11af('0x49'),_0x2cbeb3[_0x11c10e][_0x22e8d8]);break;case 0x3:joinOrLeaveQueues(_0x1d56ca,_0x514ea8,_0x11af('0x4a'),_0x2cbeb3[_0x11c10e][_0x22e8d8]);break;case 0x4:joinOrLeaveQueues(_0x1d56ca,_0x514ea8,_0x11af('0x4b'),_0x2cbeb3[_0x11c10e][_0x22e8d8]);break;case 0x5:joinOrLeaveQueues(_0x1d56ca,_0x514ea8,'openchannel',_0x2cbeb3[_0x11c10e][_0x22e8d8]);break;case 0x6:joinOrLeaveQueues(_0x1d56ca,_0x514ea8,_0x11af('0x4c'),_0x2cbeb3[_0x11c10e][_0x22e8d8]);break;case 0x7:if(_0x61a534[_0x11af('0x8')]!==_0x11af('0x40'))_0x1d56ca[_0x514ea8](util[_0x11af('0x1e')](_0x11af('0x4d'),_0x2cbeb3[_0x11c10e][_0x22e8d8][_0x11af('0x5')]));break;case 0x8:if(_0x61a534['role']!==_0x11af('0x40'))_0x1d56ca[_0x514ea8](util['format']('trunk:%s',_0x2cbeb3[_0x11c10e][_0x22e8d8][_0x11af('0x5')]));break;case 0x9:if(_0x61a534[_0x11af('0x8')]!==_0x11af('0x40'))_0x1d56ca[_0x514ea8](util[_0x11af('0x1e')](_0x11af('0x4e'),_0x2cbeb3[_0x11c10e][_0x22e8d8]['type'],_0x2cbeb3[_0x11c10e][_0x22e8d8]['name']));break;case 0xa:_0x1d56ca[_0x514ea8](util[_0x11af('0x1e')](_0x11af('0x21'),_0x2cbeb3[_0x11c10e][_0x22e8d8][_0x11af('0x5')]));break;}}}}})[_0x11af('0x18')](function(){if(_0x514ea8===_0x11af('0x4f')){var _0x149aa3=_[_0x11af('0x19')](_0x61a534[_0x11af('0x26')],'id');return _0x61a534[_0x11af('0x50')](_0x149aa3)[_0x11af('0x18')](function(){for(var _0x2fe470=0x0;_0x2fe470<_0x149aa3['length'];_0x2fe470+=0x1){_0x8eeed[_0x11af('0x51')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x149aa3[_0x2fe470]),'UserId':Number(_0x61a534['id'])});}});}})[_0x11af('0x18')](function(){if(_0x514ea8===_0x11af('0x4f')){var _0x361ce4=_[_0x11af('0x19')](_0x61a534[_0x11af('0x28')],'id');return _0x61a534[_0x11af('0x52')](_0x361ce4)[_0x11af('0x18')](function(){for(var _0x512dd1=0x0;_0x512dd1<_0x361ce4[_0x11af('0x20')];_0x512dd1+=0x1){_0x8eeed[_0x11af('0x51')](_0x11af('0x53'),{'MailInteractionId':Number(_0x361ce4[_0x512dd1]),'UserId':Number(_0x61a534['id'])});}});}})[_0x11af('0x18')](function(){if(_0x514ea8===_0x11af('0x4f')){var _0x41906c=_['map'](_0x61a534[_0x11af('0x2a')],'id');return _0x61a534[_0x11af('0x54')](_0x41906c)[_0x11af('0x18')](function(){for(var _0x1b0518=0x0;_0x1b0518<_0x41906c['length'];_0x1b0518+=0x1){_0x8eeed[_0x11af('0x51')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x41906c[_0x1b0518]),'UserId':Number(_0x61a534['id'])});}});}})[_0x11af('0x18')](function(){if(_0x514ea8===_0x11af('0x4f')){var _0x5b98a6=_['map'](_0x61a534[_0x11af('0x2c')],'id');return _0x61a534[_0x11af('0x55')](_0x5b98a6)[_0x11af('0x18')](function(){for(var _0x33a236=0x0;_0x33a236<_0x5b98a6[_0x11af('0x20')];_0x33a236+=0x1){_0x8eeed[_0x11af('0x51')](_0x11af('0x56'),{'SmsInteractionId':Number(_0x5b98a6[_0x33a236]),'UserId':Number(_0x61a534['id'])});}});}})[_0x11af('0x18')](function(){if(_0x514ea8===_0x11af('0x4f')){var _0x75594b=_[_0x11af('0x19')](_0x61a534['OpenchannelInteractions'],'id');return _0x61a534[_0x11af('0x57')](_0x75594b)[_0x11af('0x18')](function(){for(var _0x4ec540=0x0;_0x4ec540<_0x75594b[_0x11af('0x20')];_0x4ec540+=0x1){_0x8eeed[_0x11af('0x51')](_0x11af('0x58'),{'OpenchannelInteractionId':Number(_0x75594b[_0x4ec540]),'UserId':Number(_0x61a534['id'])});}});}})[_0x11af('0x18')](function(){if(_0x514ea8===_0x11af('0x4f')){var _0x4fbf1b=_[_0x11af('0x19')](_0x61a534['WhatsappInteractions'],'id');return _0x61a534[_0x11af('0x59')](_0x4fbf1b)[_0x11af('0x18')](function(){for(var _0x12d098=0x0;_0x12d098<_0x4fbf1b[_0x11af('0x20')];_0x12d098+=0x1){_0x8eeed[_0x11af('0x51')](_0x11af('0x5a'),{'WhatsappInteractionId':Number(_0x4fbf1b[_0x12d098]),'UserId':Number(_0x61a534['id'])});}});}})['catch'](function(_0x29f2f7){_0x1d56ca[_0x11af('0x5b')](_0x29f2f7);});}}function onDisconnect(_0x169bb3,_0x22c3c8){joinOrLeave(_0x169bb3,_0x11af('0x4f'),_0x22c3c8);}function onConnect(_0x1174b2){joinOrLeave(_0x1174b2,_0x11af('0x5c'));}exports[_0x11af('0x5d')]=function(_0x46e4ad){_0x46e4ad['on']('connection',function(_0x1a35e1){_0x1a35e1['setMaxListeners'](0x0);_0x1a35e1[_0x11af('0x5e')]=_0x1a35e1[_0x11af('0x5f')]['connection'][_0x11af('0x60')]+':'+_0x1a35e1[_0x11af('0x5f')][_0x11af('0x61')][_0x11af('0x62')];_0x1a35e1[_0x11af('0x63')]=new Date();_0x1a35e1['log']=function(_0x3add15){console[_0x11af('0x5b')]('SocketIO\x20'+_0x1a35e1['nsp'][_0x11af('0x5')]+'['+_0x1a35e1[_0x11af('0x5e')]+']',_0x3add15);};_0x1a35e1['on']('disconnect',function(){onDisconnect(_0x1a35e1,_0x46e4ad);_0x1a35e1[_0x11af('0x5b')]('DISCONNECTED');});onConnect(_0x1a35e1);_0x1a35e1[_0x11af('0x5b')](_0x11af('0x64'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 924cccb..642b494 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 _0xfb41=['OpenchannelInteraction','OpenchannelMessage','EventManager','info','Trigger,\x20%s','error','code','get','channel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','then','contact','UserId','name','fullname','internal','format','SIP/%s','agent','catch','outgoingmessage','query','SELECT','closed','User','find','interface','default','length','model','hook','callback','condition','util','../../mysqldb','../logger','triggers','lodash','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','FaxInteraction','Fax','Mail','MailInteraction','MailMessage','Openchannel'];(function(_0x2acbce,_0x1bba43){var _0x5f0461=function(_0x4e918b){while(--_0x4e918b){_0x2acbce['push'](_0x2acbce['shift']());}};_0x5f0461(++_0x1bba43);}(_0xfb41,0x12b));var _0x1fb4=function(_0x248fc8,_0x121ebf){_0x248fc8=_0x248fc8-0x0;var _0x1ec5d1=_0xfb41[_0x248fc8];return _0x1ec5d1;};'use strict';var util=require(_0x1fb4('0x0'));var db=require(_0x1fb4('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0x1fb4('0x2'))(_0x1fb4('0x3'));var _=require(_0x1fb4('0x4'));var client=jayson[_0x1fb4('0x5')][_0x1fb4('0x6')]({'port':0x232a});var triggers=[{'channel':_0x1fb4('0x7'),'model':_0x1fb4('0x8'),'event':_0x1fb4('0x9'),'condition':_0x1fb4('0xa'),'callback':afterCreate},{'channel':'Chat','model':_0x1fb4('0x8'),'event':_0x1fb4('0xb'),'condition':_0x1fb4('0xc'),'callback':afterUpdate},{'channel':_0x1fb4('0x7'),'model':_0x1fb4('0xd'),'event':_0x1fb4('0x9'),'condition':_0x1fb4('0xe'),'callback':afterCreateMessage},{'channel':_0x1fb4('0xf'),'model':'SmsInteraction','event':_0x1fb4('0x9'),'condition':_0x1fb4('0xa'),'callback':afterCreate},{'channel':_0x1fb4('0xf'),'model':_0x1fb4('0x10'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x1fb4('0xf'),'model':'SmsMessage','event':_0x1fb4('0x9'),'condition':_0x1fb4('0xe'),'callback':afterCreateMessage},{'channel':_0x1fb4('0x11'),'model':_0x1fb4('0x12'),'event':_0x1fb4('0x9'),'condition':_0x1fb4('0xa'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x1fb4('0x12'),'event':'afterUpdate','condition':_0x1fb4('0xc'),'callback':afterUpdate},{'channel':_0x1fb4('0x11'),'model':_0x1fb4('0x13'),'event':'afterCreate','condition':_0x1fb4('0xe'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x1fb4('0x14'),'event':_0x1fb4('0x9'),'condition':_0x1fb4('0xa'),'callback':afterCreate},{'channel':_0x1fb4('0x15'),'model':_0x1fb4('0x14'),'event':_0x1fb4('0xb'),'condition':_0x1fb4('0xc'),'callback':afterUpdate},{'channel':_0x1fb4('0x15'),'model':'FaxMessage','event':_0x1fb4('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x1fb4('0x16'),'model':_0x1fb4('0x17'),'event':_0x1fb4('0x9'),'condition':_0x1fb4('0xa'),'callback':afterCreate},{'channel':_0x1fb4('0x16'),'model':_0x1fb4('0x17'),'event':'afterUpdate','condition':_0x1fb4('0xc'),'callback':afterUpdate},{'channel':'Mail','model':_0x1fb4('0x18'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x1fb4('0x19'),'model':_0x1fb4('0x1a'),'event':_0x1fb4('0x9'),'condition':_0x1fb4('0xa'),'callback':afterCreate},{'channel':'Openchannel','model':_0x1fb4('0x1a'),'event':_0x1fb4('0xb'),'condition':_0x1fb4('0xc'),'callback':afterUpdate},{'channel':_0x1fb4('0x19'),'model':_0x1fb4('0x1b'),'event':_0x1fb4('0x9'),'condition':_0x1fb4('0xe'),'callback':afterCreateMessage}];function request(_0x4cd4f2){return client['request'](_0x1fb4('0x1c'),_0x4cd4f2)['then'](function(_0x3468e6){logger[_0x1fb4('0x1d')](_0x1fb4('0x1e'),_0x1fb4('0x1c'),_0x3468e6);if(_0x3468e6['error']){if(_0x3468e6[_0x1fb4('0x1f')][_0x1fb4('0x20')]===0x1f4){logger[_0x1fb4('0x1f')]('Trigger,\x20%s',_0x1fb4('0x1c'),_0x3468e6[_0x1fb4('0x1f')]);}}})['catch'](function(_0x302b42){logger[_0x1fb4('0x1f')](_0x1fb4('0x1e'),'EventManager',_0x302b42);});}function afterCreateMessage(_0x1dee76,_0x4dfbab){return function(_0x322f6a,_0x37d20f){_0x322f6a=_0x322f6a[_0x1fb4('0x21')]({'plain':!![]});_0x322f6a[_0x1fb4('0x22')]=_0x1dee76;_0x322f6a[_0x1fb4('0x23')]=_0x322f6a[_0x1fb4('0x24')];var _0xb834fc=_0x1fb4('0x25')+_0x322f6a[_0x1fb4('0x26')];return db[_0x1fb4('0x27')]['query'](_0xb834fc,{'type':db[_0x1fb4('0x28')][_0x1fb4('0x29')]['SELECT'],'raw':!![]})[_0x1fb4('0x2a')](function(_0x292dd0){return _0x292dd0;})[_0x1fb4('0x2a')](function(_0x372faa){if(_0x372faa){_0x322f6a[_0x1fb4('0x2b')]=_0x372faa[0x0];}if(_0x322f6a[_0x1fb4('0x2c')]){return db['User']['find']({'where':{'id':_0x322f6a[_0x1fb4('0x2c')]},'attributes':['id',_0x1fb4('0x2d'),_0x1fb4('0x2e'),'email',_0x1fb4('0x2f')],'raw':!![]})['then'](function(_0x32b607){_0x322f6a['interface']=util[_0x1fb4('0x30')](_0x1fb4('0x31'),_0x32b607[_0x1fb4('0x2d')]);_0x322f6a[_0x1fb4('0x22')]=_0x1dee76;_0x322f6a[_0x1fb4('0x32')]=_0x32b607;return request({'event':'incomingmessage','message':_0x322f6a});})[_0x1fb4('0x33')](function(_0x544db5){console['error'](_0x544db5);});}else{return request({'event':_0x1fb4('0x34'),'message':_0x322f6a});}});};}function afterCreate(_0x1eea2f,_0x23ea4e){return function(_0x378f96,_0x49e7b1){_0x378f96=_0x378f96[_0x1fb4('0x21')]({'plain':!![]});_0x378f96['channel']=_0x1eea2f;_0x378f96['event']='opened';var _0x46340b=_0x1fb4('0x25')+_0x378f96[_0x1fb4('0x26')];return db[_0x1fb4('0x27')][_0x1fb4('0x35')](_0x46340b,{'type':db[_0x1fb4('0x28')][_0x1fb4('0x29')][_0x1fb4('0x36')],'raw':!![]})[_0x1fb4('0x2a')](function(_0x2b2b06){return _0x2b2b06;})['then'](function(_0x378c6c){if(_0x378c6c){_0x378f96[_0x1fb4('0x2b')]=_0x378c6c[0x0];}return request({'event':_0x23ea4e,'message':_0x378f96});});};}function afterUpdate(_0x5458ef,_0xd7acf3){return function(_0x567341,_0x3cf3a6){if(_0x567341['changed']('closed')&&_0x567341['closed']){_0x567341=_0x567341['get']({'plain':!![]});_0x567341['channel']=_0x5458ef;_0x567341[_0x1fb4('0x23')]=_0x1fb4('0x37');var _0x43d331='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x567341[_0x1fb4('0x26')];return db[_0x1fb4('0x27')][_0x1fb4('0x35')](_0x43d331,{'type':db[_0x1fb4('0x28')][_0x1fb4('0x29')]['SELECT'],'raw':!![]})[_0x1fb4('0x2a')](function(_0x5c512a){return _0x5c512a;})[_0x1fb4('0x2a')](function(_0x217fe3){if(_0x217fe3){_0x567341[_0x1fb4('0x2b')]=_0x217fe3[0x0];}if(_0x567341[_0x1fb4('0x2c')]){return db[_0x1fb4('0x38')][_0x1fb4('0x39')]({'where':{'id':_0x567341[_0x1fb4('0x2c')]},'attributes':['id',_0x1fb4('0x2d'),'fullname','email',_0x1fb4('0x2f')],'raw':!![]})[_0x1fb4('0x2a')](function(_0x3a7131){_0x567341[_0x1fb4('0x3a')]=util[_0x1fb4('0x30')](_0x1fb4('0x31'),_0x3a7131['name']);_0x567341[_0x1fb4('0x32')]=_0x3a7131;return request({'event':_0xd7acf3,'message':_0x567341});})[_0x1fb4('0x33')](function(_0x34a18a){console[_0x1fb4('0x1f')](_0x34a18a);});}else{return request({'event':_0xd7acf3,'message':_0x567341});}});}};}exports[_0x1fb4('0x3b')]=function(){for(var _0x19f8b6=0x0;_0x19f8b6=_0x523e54['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x423b88(_0x5d78d8);})[_0x5f8d('0x13')](function(_0x354e56){_0x239997(_0x354e56);});});}; \ No newline at end of file +var _0xa219=['bluebird','../mysqldb','./license/util','mail','fax','sms','whatsapp','getChannels','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','User','count','then','agents','lodash'];(function(_0x104b35,_0x13f218){var _0x55584d=function(_0x2bbb71){while(--_0x2bbb71){_0x104b35['push'](_0x104b35['shift']());}};_0x55584d(++_0x13f218);}(_0xa219,0xe3));var _0x9a21=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0xa219[_0x59d0cc];return _0x2ae79f;};'use strict';var _=require(_0x9a21('0x0'));var BPromise=require(_0x9a21('0x1'));var db=require(_0x9a21('0x2'))['db'];var util=require(_0x9a21('0x3'));var channels=['voice',_0x9a21('0x4'),'chat',_0x9a21('0x5'),_0x9a21('0x6'),_0x9a21('0x7'),'openchannel'];exports[_0x9a21('0x8')]=function(){return channels;};exports['isValidChannel']=function(_0x59f794){_0x59f794=_0x59f794['toLowerCase']();return _[_0x9a21('0x9')](channels,_0x59f794);};exports[_0x9a21('0xa')]=function(_0x142740,_0x5ca80b,_0x4712b8,_0x274bbd){var _0x1f4ac1={'loginAttempts':_0x5ca80b,'blocked':_0x4712b8};if(!_[_0x9a21('0xb')](_0x274bbd)){_0x1f4ac1[_0x9a21('0xc')]=_0x274bbd;}return _0x142740[_0x9a21('0xd')](_0x1f4ac1);};exports[_0x9a21('0xe')]=function(_0x254f8b){return new BPromise(function(_0x5c3c28,_0x172461){var _0x47cb9d=0x0;if(_0x254f8b['role']!=='agent'){_0x5c3c28(_0x254f8b);}db[_0x9a21('0xf')][_0x9a21('0x10')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x254f8b['id']}}})[_0x9a21('0x11')](function(_0x5daf0d){_0x47cb9d=_0x5daf0d;return util[_0x9a21('0xe')]();})[_0x9a21('0x11')](function(_0x4dff91){if(_0x4dff91&&_0x4dff91['agents']&&_0x47cb9d>=_0x4dff91[_0x9a21('0x12')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x5c3c28(_0x254f8b);})['catch'](function(_0x3bcdba){_0x172461(_0x3bcdba);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 0293786..6fc89fe 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d41=['status','exports','404'];(function(_0x445ddd,_0x3bf4d5){var _0x105823=function(_0x44e5b0){while(--_0x44e5b0){_0x445ddd['push'](_0x445ddd['shift']());}};_0x105823(++_0x3bf4d5);}(_0x2d41,0xd6));var _0x12d4=function(_0x10cee6,_0x195912){_0x10cee6=_0x10cee6-0x0;var _0x3f1d65=_0x2d41[_0x10cee6];return _0x3f1d65;};'use strict';module[_0x12d4('0x0')][0x194]=function pageNotFound(_0x33ecb1,_0x507729){var _0x44c055=_0x12d4('0x1');var _0x2ede89=0x194;var _0xa5d04={'status':_0x2ede89};_0x507729[_0x12d4('0x2')](_0xa5d04['status']);_0x507729['render'](_0x44c055,{},function(_0x3e0707,_0x17ca88){if(_0x3e0707){return _0x507729[_0x12d4('0x2')](_0xa5d04[_0x12d4('0x2')])['json'](_0xa5d04);}_0x507729['send'](_0x17ca88);});}; \ No newline at end of file +var _0xa74e=['render','json','send','exports','404','status'];(function(_0x4e264a,_0x2c1aba){var _0x1d399a=function(_0x26a50f){while(--_0x26a50f){_0x4e264a['push'](_0x4e264a['shift']());}};_0x1d399a(++_0x2c1aba);}(_0xa74e,0x8d));var _0xea74=function(_0x5b7c83,_0x6f0445){_0x5b7c83=_0x5b7c83-0x0;var _0x153434=_0xa74e[_0x5b7c83];return _0x153434;};'use strict';module[_0xea74('0x0')][0x194]=function pageNotFound(_0x9bb887,_0x487d7a){var _0x573f4b=_0xea74('0x1');var _0x137a1c=0x194;var _0x1b95c6={'status':_0x137a1c};_0x487d7a['status'](_0x1b95c6[_0xea74('0x2')]);_0x487d7a[_0xea74('0x3')](_0x573f4b,{},function(_0x319b72,_0x21e45b){if(_0x319b72){return _0x487d7a['status'](_0x1b95c6[_0xea74('0x2')])[_0xea74('0x4')](_0x1b95c6);}_0x487d7a[_0xea74('0x5')](_0x21e45b);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 54cdbcd..2dc4456 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x835d=['CmHopper','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','TeamVoiceQueue','BlackLists','Messages','mailboxuser','mailbox','VoiceCallReport','uniqueid','AgentReports','Contact','ContactId','MailAccountId','Imap','Smtp','Dispositions','CannedAnswer','Answers','Interactions','List','ListId','TemplateId','user_has_mail_accounts','Agents','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','Attachment','Attachments','ChatWebsiteId','ChatOfflineMessageId','restrict','Items','FaxAccount','Disposition','FaxAccountId','mandatoryDispositionPauseId','FaxQueue','TagId','fax_interaction_has_tags','Tags','FaxInteractionId','Interaction','AttachmentId','team_has_fax_queues','Teams','SmsAccountId','Applications','SmsMessage','SmsInteractionId','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatMessage','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','CompanyId','Company','cm_contact_has_tags','CampaignId','OwnerId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','AnyCondition','Fields','MetricId','SalesforceAccount','Configurations','AccountId','SalesforceField','Subjects','SubjectId','SalesforceConfiguration','Descriptions','FieldId','Subject','Description','DescriptionId','Field','VariableId','SugarcrmAccount','SugarcrmField','int_desk_configuration_has_tags','ZendeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowAccount','Dynamics365Configuration','FreshsalesConfiguration','FromId','SessionId','ProjectId','VoiceQueues','TrunkId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromAccount','ToChatQueueId','FromFaxAccountId','FromAgent','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','exports','../config/environment','sequelize','jstz','determine','defaultsDeep','xcall','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','motion2','xC@LL1234','utf8mb4','database','username','password','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceDialReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','Cdr','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../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','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','hasOne','VoiceMail','cascade','hasMany','Recordings','UserId','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','HopperHistory','OpenchannelInteraction','ChatInteraction','ChatInteractions','SmsInteractions','MailInteractions','WhatsappInteractions','SenderId','belongsTo','userProfileId','belongsToMany','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','FaxInteractions','OpenchannelInteractions','user_has_openchannel_interactions','VoiceQueue','MailQueues','ChatQueues','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','user_has_voice_prefixes','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','WhatsappAccounts','SquareProject','SquareProjects','user_has_square_projects','ChanSpyId','Sounds','moh_has_sounds','UserVoiceQueueRt','Members','VoiceQueueId'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x835d,0xac));var _0xd835=function(_0x3a9fab,_0x1b116d){_0x3a9fab=_0x3a9fab-0x0;var _0x4ad549=_0x835d[_0x3a9fab];return _0x4ad549;};'use strict';var config=require(_0xd835('0x0'));var Sequelize=require(_0xd835('0x1'));var _=require('lodash');var jstz=require(_0xd835('0x2'));var timezone=jstz[_0xd835('0x3')]();config['sequelize']=_[_0xd835('0x4')](config[_0xd835('0x1')],{'database':'motion2','username':_0xd835('0x5'),'password':'xC@LL1234','options':{'host':_0xd835('0x6'),'port':0xcea,'dialect':_0xd835('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xd835('0x8')](),'define':{'charset':_0xd835('0x9'),'collate':_0xd835('0xa')}}});config[_0xd835('0xb')]=_[_0xd835('0x4')](config[_0xd835('0xb')],{'database':_0xd835('0xc'),'username':'xcall','password':_0xd835('0xd'),'options':{'host':_0xd835('0x6'),'port':0xcea,'dialect':_0xd835('0x7'),'dialectOptions':{'charset':_0xd835('0xe')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xd835('0x9'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd835('0x1')][_0xd835('0xf')],config[_0xd835('0x1')][_0xd835('0x10')],config[_0xd835('0x1')][_0xd835('0x11')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd835('0xb')][_0xd835('0xf')],config[_0xd835('0xb')][_0xd835('0x10')],config['sequelizeHistory'][_0xd835('0x11')],config[_0xd835('0xb')]['options'])};db[_0xd835('0x12')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x14'));db[_0xd835('0x15')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x16'));db[_0xd835('0x17')]=db[_0xd835('0x1')]['import'](_0xd835('0x18'));db[_0xd835('0x19')]=db['sequelize'][_0xd835('0x13')](_0xd835('0x1a'));db[_0xd835('0x1b')]=db[_0xd835('0x1')]['import'](_0xd835('0x1c'));db['VoiceQueue']=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x1d'));db[_0xd835('0x1e')]=db[_0xd835('0x1')]['import'](_0xd835('0x1f'));db[_0xd835('0x20')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0xd835('0x1')]['import'](_0xd835('0x21'));db[_0xd835('0x22')]=db['sequelize'][_0xd835('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0xd835('0x1')]['import']('../api/voiceCallReport/voiceCallReport.model');db[_0xd835('0x23')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db[_0xd835('0x1')][_0xd835('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db[_0xd835('0x1')]['import'](_0xd835('0x24'));db[_0xd835('0x25')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x26'));db[_0xd835('0x27')]=db['sequelize']['import'](_0xd835('0x28'));db[_0xd835('0x29')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x2a'));db['UserVoiceQueueRt']=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x2b'));db[_0xd835('0x2c')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x2d'));db[_0xd835('0x2e')]=db[_0xd835('0x1')]['import'](_0xd835('0x2f'));db[_0xd835('0x30')]=db[_0xd835('0x1')]['import'](_0xd835('0x31'));db['UserFaxQueue']=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x32'));db[_0xd835('0x33')]=db[_0xd835('0x1')]['import'](_0xd835('0x34'));db[_0xd835('0x35')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xd835('0x36')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x37'));db[_0xd835('0x38')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x39'));db[_0xd835('0x3a')]=db['sequelize']['import'](_0xd835('0x3b'));db[_0xd835('0x3c')]=db[_0xd835('0x1')]['import'](_0xd835('0x3d'));db[_0xd835('0x3e')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/mailQueue/mailQueue.model');db[_0xd835('0x3f')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x40'));db[_0xd835('0x41')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x42'));db[_0xd835('0x43')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x44'));db[_0xd835('0x45')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x46'));db[_0xd835('0x47')]=db['sequelize'][_0xd835('0x13')](_0xd835('0x48'));db[_0xd835('0x49')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x4a'));db[_0xd835('0x4b')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x4c'));db[_0xd835('0x4d')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/faxApplication/faxApplication.model');db[_0xd835('0x4e')]=db[_0xd835('0x1')]['import'](_0xd835('0x4f'));db[_0xd835('0x50')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x51'));db['FaxQueue']=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x52'));db[_0xd835('0x53')]=db['sequelize'][_0xd835('0x13')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x54'));db[_0xd835('0x55')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x56'));db[_0xd835('0x57')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x58'));db['SmsMessage']=db[_0xd835('0x1')]['import']('../api/smsMessage/smsMessage.model');db[_0xd835('0x59')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x5a'));db[_0xd835('0x5b')]=db[_0xd835('0x1')]['import'](_0xd835('0x5c'));db[_0xd835('0x5d')]=db[_0xd835('0x1')]['import'](_0xd835('0x5e'));db['OpenchannelInteraction']=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x5f'));db[_0xd835('0x60')]=db['sequelize']['import'](_0xd835('0x61'));db[_0xd835('0x62')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0xd835('0x63')]=db['sequelize'][_0xd835('0x13')](_0xd835('0x64'));db[_0xd835('0x65')]=db['sequelize']['import'](_0xd835('0x66'));db[_0xd835('0x67')]=db[_0xd835('0x1')]['import'](_0xd835('0x68'));db['ChatInteraction']=db[_0xd835('0x1')]['import'](_0xd835('0x69'));db['ChatMessage']=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x6a'));db[_0xd835('0x6b')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x6c'));db[_0xd835('0x6d')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/chatQueue/chatQueue.model');db[_0xd835('0x6e')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x6f'));db[_0xd835('0x70')]=db[_0xd835('0x1')]['import'](_0xd835('0x71'));db[_0xd835('0x72')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x73'));db['CmContact']=db[_0xd835('0x1')]['import'](_0xd835('0x74'));db['CmHopper']=db[_0xd835('0x1')]['import'](_0xd835('0x75'));db[_0xd835('0x76')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x77'));db['CmHopperFinal']=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x78'));db[_0xd835('0x79')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xd835('0x7a')]=db['sequelize'][_0xd835('0x13')](_0xd835('0x7b'));db[_0xd835('0x7c')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x7d'));db[_0xd835('0x7e')]=db[_0xd835('0x1')]['import'](_0xd835('0x7f'));db[_0xd835('0x80')]=db['sequelize'][_0xd835('0x13')](_0xd835('0x81'));db['CannedAnswer']=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x82'));db['Disposition']=db[_0xd835('0x1')][_0xd835('0x13')]('../api/disposition/disposition.model');db[_0xd835('0x83')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x84'));db[_0xd835('0x85')]=db['sequelize'][_0xd835('0x13')](_0xd835('0x86'));db[_0xd835('0x87')]=db[_0xd835('0x1')]['import']('../api/pause/pause.model');db[_0xd835('0x88')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0xd835('0x1')]['import'](_0xd835('0x89'));db[_0xd835('0x8a')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x8b'));db[_0xd835('0x8c')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x8d'));db[_0xd835('0x8e')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x8f'));db[_0xd835('0x90')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x91'));db[_0xd835('0x92')]=db['sequelize'][_0xd835('0x13')](_0xd835('0x93'));db[_0xd835('0x94')]=db['sequelize'][_0xd835('0x13')](_0xd835('0x95'));db[_0xd835('0x96')]=db[_0xd835('0x1')]['import'](_0xd835('0x97'));db[_0xd835('0x98')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x99'));db[_0xd835('0x9a')]=db[_0xd835('0x1')]['import'](_0xd835('0x9b'));db[_0xd835('0x9c')]=db['sequelize']['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xd835('0x9d')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x9e'));db[_0xd835('0x9f')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xa0'));db[_0xd835('0xa1')]=db[_0xd835('0x1')]['import']('../api/analyticFieldReport/analyticFieldReport.model');db[_0xd835('0xa2')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xa3'));db['SalesforceAccount']=db['sequelize'][_0xd835('0x13')](_0xd835('0xa4'));db['SalesforceConfiguration']=db[_0xd835('0x1')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db['sequelize']['import']('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db[_0xd835('0x1')][_0xd835('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xd835('0xa5')]=db[_0xd835('0x1')]['import'](_0xd835('0xa6'));db['SugarcrmField']=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xa7'));db[_0xd835('0xa8')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xa9'));db[_0xd835('0xaa')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xd835('0xab')]=db['sequelize']['import'](_0xd835('0xac'));db[_0xd835('0xad')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/intZohoAccount/intZohoAccount.model');db[_0xd835('0xae')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xaf'));db[_0xd835('0xb0')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xb1'));db['ZendeskAccount']=db['sequelize'][_0xd835('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db['sequelize'][_0xd835('0x13')](_0xd835('0xb2'));db[_0xd835('0xb3')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0xd835('0x1')]['import'](_0xd835('0xb4'));db[_0xd835('0xb5')]=db[_0xd835('0x1')]['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0xd835('0x1')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0xd835('0xb6')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xb7'));db[_0xd835('0xb8')]=db[_0xd835('0x1')]['import'](_0xd835('0xb9'));db[_0xd835('0xba')]=db['sequelize'][_0xd835('0x13')]('../api/intVtigerField/intVtigerField.model');db['ServicenowAccount']=db['sequelize']['import'](_0xd835('0xbb'));db[_0xd835('0xbc')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xbd'));db[_0xd835('0xbe')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xbf'));db[_0xd835('0xc0')]=db['sequelize'][_0xd835('0x13')](_0xd835('0xc1'));db['Dynamics365Configuration']=db['sequelize'][_0xd835('0x13')](_0xd835('0xc2'));db[_0xd835('0xc3')]=db[_0xd835('0x1')]['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0xd835('0xc4')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xc5'));db['FreshsalesConfiguration']=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xc6'));db[_0xd835('0xc7')]=db[_0xd835('0x1')]['import'](_0xd835('0xc8'));db[_0xd835('0x96')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/integration/integration.model');db[_0xd835('0xc9')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xca'));db[_0xd835('0xcb')]=db['sequelize']['import'](_0xd835('0xcc'));db[_0xd835('0xcd')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xce'));db[_0xd835('0xcf')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xd0'));db[_0xd835('0xd1')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xd2'));db[_0xd835('0xd3')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xd835('0xd4')]=db['sequelize'][_0xd835('0x13')]('../api/smsQueueReport/smsQueueReport.model');db[_0xd835('0xd5')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xd6'));db['SquareDetailsReport']=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xd7'));db[_0xd835('0xd8')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xd9'));db[_0xd835('0xda')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xdb'));db[_0xd835('0xdc')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xdd'));db['SquareProject']=db['sequelize'][_0xd835('0x13')]('../api/squareProject/squareProject.model');db[_0xd835('0xde')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xdf'));db[_0xd835('0xe0')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/squareMessage/squareMessage.model');db[_0xd835('0xe1')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xe2'));db[_0xd835('0xe3')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xe4'));db[_0xd835('0xe5')]=db['sequelize'][_0xd835('0x13')]('../api/campaign/campaign.model');db[_0xd835('0xe6')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xe7'));db['Attachment']=db[_0xd835('0x1')]['import'](_0xd835('0xe8'));db['Plugin']=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xe9'));db[_0xd835('0xea')]=db['sequelize'][_0xd835('0x13')]('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db['sequelize']['import'](_0xd835('0xeb'));db[_0xd835('0xec')]=db['sequelize']['import']('../api/faxTransferReport/faxTransferReport.model');db[_0xd835('0xed')]=db['sequelize'][_0xd835('0x13')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xd835('0xee')]=db['sequelize'][_0xd835('0x13')](_0xd835('0xef'));db[_0xd835('0xf0')]=db[_0xd835('0x1')]['import'](_0xd835('0xf1'));db[_0xd835('0xf2')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xf3'));db[_0xd835('0xf4')]=db[_0xd835('0x1')]['import'](_0xd835('0xf5'));db[_0xd835('0xf6')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/userProfileSection/userProfileSection.model');db[_0xd835('0xf7')]=db['sequelize']['import']('../api/userProfileResource/userProfileResource.model');db[_0xd835('0xf8')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xf9'));db[_0xd835('0xfa')]=db['sequelize']['import'](_0xd835('0xfb'));db['WhatsappApplication']=db[_0xd835('0x1')]['import']('../api/whatsappApplication/whatsappApplication.model');db[_0xd835('0xfc')]=db['sequelize'][_0xd835('0x13')](_0xd835('0xfd'));db[_0xd835('0xfe')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0xff'));db[_0xd835('0x100')]=db['sequelize'][_0xd835('0x13')](_0xd835('0x101'));db[_0xd835('0x102')]=db[_0xd835('0x1')][_0xd835('0x13')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xd835('0x103')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x104'));db[_0xd835('0x105')]=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x106'));db['TeamVoiceQueue']=db[_0xd835('0x1')][_0xd835('0x13')](_0xd835('0x107'));db[_0xd835('0x12')][_0xd835('0x108')](db[_0xd835('0x109')],{'as':_0xd835('0x109'),'onDelete':_0xd835('0x10a'),'foreignKey':'UserId'});db[_0xd835('0x12')][_0xd835('0x10b')](db['VoiceRecording'],{'as':_0xd835('0x10c'),'foreignKey':_0xd835('0x10d')});db[_0xd835('0x12')][_0xd835('0x10b')](db['UserVoiceQueueRt'],{'as':_0xd835('0x10e'),'foreignKey':_0xd835('0x10d')});db[_0xd835('0x12')][_0xd835('0x10b')](db[_0xd835('0x19')],{'as':_0xd835('0x10f'),'onDelete':'cascade','hooks':!![]});db[_0xd835('0x12')][_0xd835('0x10b')](db[_0xd835('0x110')],{'as':_0xd835('0x111'),'foreignKey':_0xd835('0x10d')});db[_0xd835('0x12')][_0xd835('0x10b')](db[_0xd835('0x79')],{'as':_0xd835('0x112'),'foreignKey':_0xd835('0x10d')});db['User']['hasMany'](db[_0xd835('0x7a')],{'as':'ReportAgentPreview','foreignKey':_0xd835('0x10d')});db[_0xd835('0x12')][_0xd835('0x10b')](db[_0xd835('0x113')],{'as':'OpenchannelInteractions','foreignKey':_0xd835('0x10d')});db[_0xd835('0x12')][_0xd835('0x10b')](db[_0xd835('0x114')],{'as':_0xd835('0x115'),'foreignKey':'UserId'});db['User'][_0xd835('0x10b')](db[_0xd835('0x57')],{'as':_0xd835('0x116'),'foreignKey':'UserId'});db['User'][_0xd835('0x10b')](db[_0xd835('0x4e')],{'as':'FaxInteractions','foreignKey':'UserId'});db[_0xd835('0x12')][_0xd835('0x10b')](db[_0xd835('0x41')],{'as':_0xd835('0x117'),'foreignKey':'UserId'});db[_0xd835('0x12')][_0xd835('0x10b')](db[_0xd835('0xfc')],{'as':_0xd835('0x118'),'foreignKey':'UserId'});db[_0xd835('0x12')][_0xd835('0x10b')](db[_0xd835('0xf8')],{'as':'UserNotifications','foreignKey':_0xd835('0x119')});db[_0xd835('0x12')][_0xd835('0x11a')](db['UserProfile'],{'as':_0xd835('0xf4'),'foreignKey':_0xd835('0x11b')});db[_0xd835('0x12')][_0xd835('0x11c')](db[_0xd835('0x6e')],{'as':'Groups','through':_0xd835('0x11d')});db['User'][_0xd835('0x11c')](db[_0xd835('0x11e')],{'as':_0xd835('0x11f'),'through':_0xd835('0x120')});db[_0xd835('0x12')][_0xd835('0x11c')](db[_0xd835('0xf0')],{'as':_0xd835('0x121'),'through':_0xd835('0x122')});db[_0xd835('0x12')][_0xd835('0x11c')](db['Team'],{'through':_0xd835('0x123')});db['User'][_0xd835('0x11c')](db['MailInteraction'],{'as':_0xd835('0x117'),'through':'user_has_mail_interactions'});db['User'][_0xd835('0x11c')](db[_0xd835('0x114')],{'as':_0xd835('0x115'),'through':'user_has_chat_interactions'});db[_0xd835('0x12')][_0xd835('0x11c')](db[_0xd835('0x4e')],{'as':_0xd835('0x124'),'through':'user_has_fax_interactions'});db[_0xd835('0x12')][_0xd835('0x11c')](db['SmsInteraction'],{'as':_0xd835('0x116'),'through':'user_has_sms_interactions'});db[_0xd835('0x12')][_0xd835('0x11c')](db[_0xd835('0x113')],{'as':_0xd835('0x125'),'through':_0xd835('0x126')});db[_0xd835('0x12')][_0xd835('0x11c')](db['WhatsappInteraction'],{'as':_0xd835('0x118'),'through':'user_has_whatsapp_interactions'});db[_0xd835('0x12')][_0xd835('0x11c')](db[_0xd835('0x127')],{'as':'VoiceQueues','through':_0xd835('0x2c'),'required':![]});db[_0xd835('0x12')][_0xd835('0x11c')](db[_0xd835('0x3e')],{'as':_0xd835('0x128'),'through':_0xd835('0x30'),'required':![]});db[_0xd835('0x12')]['belongsToMany'](db['ChatQueue'],{'as':_0xd835('0x129'),'through':_0xd835('0x2e'),'required':![],'hooks':!![]});db[_0xd835('0x12')][_0xd835('0x11c')](db['FaxQueue'],{'as':_0xd835('0x12a'),'through':_0xd835('0x12b'),'required':![]});db['User'][_0xd835('0x11c')](db[_0xd835('0x59')],{'as':_0xd835('0x12c'),'through':_0xd835('0x33'),'required':![]});db[_0xd835('0x12')][_0xd835('0x11c')](db[_0xd835('0x62')],{'as':_0xd835('0x12d'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0xd835('0x11c')](db[_0xd835('0x103')],{'as':_0xd835('0x12e'),'through':'UserWhatsappQueue','required':![]});db[_0xd835('0x12')][_0xd835('0x11c')](db[_0xd835('0xf0')],{'through':_0xd835('0x122')});db[_0xd835('0x12')][_0xd835('0x11c')](db[_0xd835('0xf2')],{'as':'VoicePrefixes','through':_0xd835('0x12f'),'required':![]});db[_0xd835('0x12')][_0xd835('0x11c')](db[_0xd835('0x63')],{'as':_0xd835('0x130'),'through':'user_has_chat_websites'});db['User'][_0xd835('0x11c')](db['FaxAccount'],{'as':_0xd835('0x131'),'through':_0xd835('0x132')});db[_0xd835('0x12')][_0xd835('0x11c')](db[_0xd835('0x3c')],{'as':_0xd835('0x133'),'through':'user_has_mail_accounts'});db[_0xd835('0x12')][_0xd835('0x11c')](db[_0xd835('0x5b')],{'as':_0xd835('0x134'),'through':_0xd835('0x135')});db[_0xd835('0x12')][_0xd835('0x11c')](db[_0xd835('0x136')],{'as':'SmsAccounts','through':_0xd835('0x137')});db[_0xd835('0x12')]['belongsToMany'](db[_0xd835('0xfa')],{'as':_0xd835('0x138'),'through':'user_has_whatsapp_accounts'});db[_0xd835('0x12')][_0xd835('0x11c')](db[_0xd835('0x139')],{'as':_0xd835('0x13a'),'through':_0xd835('0x13b')});db[_0xd835('0x15')]['hasMany'](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x13c')});db[_0xd835('0x17')][_0xd835('0x10b')](db['VoiceExtension'],{'onDelete':_0xd835('0x10a')});db[_0xd835('0x19')]['hasMany'](db[_0xd835('0x19')],{'as':'Applications','onDelete':_0xd835('0x10a')});db['VoiceMusicOnHold'][_0xd835('0x11c')](db['Sound'],{'as':_0xd835('0x13d'),'through':_0xd835('0x13e')});db[_0xd835('0x127')]['hasMany'](db[_0xd835('0x13f')],{'as':_0xd835('0x140'),'foreignKey':_0xd835('0x141')});db[_0xd835('0x127')][_0xd835('0x10b')](db[_0xd835('0x142')],{'as':_0xd835('0x143'),'foreignKey':'VoiceQueueId'});db[_0xd835('0x127')][_0xd835('0x10b')](db[_0xd835('0x110')],{'as':_0xd835('0x111'),'foreignKey':_0xd835('0x141')});db[_0xd835('0x127')]['hasMany'](db[_0xd835('0x79')],{'as':_0xd835('0x144'),'foreignKey':'VoiceQueueId'});db[_0xd835('0x127')][_0xd835('0x10b')](db[_0xd835('0x7a')],{'as':_0xd835('0x7a'),'foreignKey':_0xd835('0x141')});db[_0xd835('0x127')][_0xd835('0x10b')](db[_0xd835('0x76')],{'as':_0xd835('0x145'),'foreignKey':_0xd835('0x141')});db[_0xd835('0x127')][_0xd835('0x10b')](db[_0xd835('0xd3')],{'as':_0xd835('0x146'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xd835('0x11a')](db[_0xd835('0x27')],{'as':_0xd835('0x27'),'foreignKey':'TrunkId'});db[_0xd835('0x127')][_0xd835('0x11a')](db[_0xd835('0x27')],{'as':_0xd835('0x147'),'foreignKey':_0xd835('0x148')});db['VoiceQueue'][_0xd835('0x11a')](db[_0xd835('0x85')],{'as':'Interval','foreignKey':_0xd835('0x149')});db[_0xd835('0x127')][_0xd835('0x11a')](db[_0xd835('0x87')],{'as':_0xd835('0x14a'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue']['belongsToMany'](db[_0xd835('0xf0')],{'as':_0xd835('0x121'),'through':'voice_queues_has_cm_lists'});db[_0xd835('0x127')]['belongsToMany'](db[_0xd835('0x12')],{'as':'Agents','through':_0xd835('0x2c')});db[_0xd835('0x127')][_0xd835('0x11c')](db[_0xd835('0xe1')],{'as':'Teams','through':_0xd835('0x14b')});db['VoiceQueue'][_0xd835('0x11c')](db[_0xd835('0xf0')],{'as':_0xd835('0x14c'),'through':'voice_queues_has_cm_blacklists'});db[_0xd835('0x1e')][_0xd835('0x11a')](db['User'],{'as':_0xd835('0x12'),'foreignKey':_0xd835('0x10d')});db['ScreenRecording'][_0xd835('0x11a')](db[_0xd835('0x12')],{'as':_0xd835('0x12'),'foreignKey':_0xd835('0x10d')});db[_0xd835('0x109')][_0xd835('0x10b')](db[_0xd835('0x22')],{'as':_0xd835('0x14d'),'onDelete':'cascade','foreignKey':_0xd835('0x14e'),'sourceKey':'mailbox'});db[_0xd835('0x22')][_0xd835('0x11a')](db[_0xd835('0x109')],{'foreignKey':_0xd835('0x14e'),'targetKey':_0xd835('0x14f')});db[_0xd835('0x150')][_0xd835('0x10b')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0xd835('0x151'),'constraints':![]});db['VoiceCallReport']['hasMany'](db['VoiceAgentReport'],{'as':_0xd835('0x152'),'foreignKey':_0xd835('0x151'),'constraints':![]});db[_0xd835('0x150')][_0xd835('0x11a')](db[_0xd835('0x12')],{'as':_0xd835('0x12'),'foreignKey':_0xd835('0x10d')});db['VoiceCallReport'][_0xd835('0x11a')](db['CmContact'],{'as':_0xd835('0x153'),'foreignKey':_0xd835('0x154')});db['MailServerIn'][_0xd835('0x11a')](db[_0xd835('0x3c')],{'as':_0xd835('0x3c'),'foreignKey':_0xd835('0x155')});db[_0xd835('0x3a')][_0xd835('0x11a')](db[_0xd835('0x3c')],{'as':_0xd835('0x3c'),'foreignKey':'MailAccountId'});db[_0xd835('0x3c')][_0xd835('0x108')](db[_0xd835('0x38')],{'as':_0xd835('0x156'),'onDelete':_0xd835('0x10a')});db[_0xd835('0x3c')][_0xd835('0x108')](db[_0xd835('0x3a')],{'as':_0xd835('0x157'),'onDelete':_0xd835('0x10a')});db[_0xd835('0x3c')]['hasMany'](db['Disposition'],{'as':_0xd835('0x158'),'foreignKey':_0xd835('0x155'),'onDelete':_0xd835('0x10a')});db[_0xd835('0x3c')][_0xd835('0x10b')](db[_0xd835('0x159')],{'as':_0xd835('0x15a'),'foreignKey':_0xd835('0x155')});db[_0xd835('0x3c')][_0xd835('0x10b')](db[_0xd835('0x43')],{'as':_0xd835('0x14d'),'foreignKey':_0xd835('0x155')});db[_0xd835('0x3c')][_0xd835('0x10b')](db[_0xd835('0x41')],{'as':_0xd835('0x15b')});db[_0xd835('0x3c')][_0xd835('0x10b')](db[_0xd835('0x45')],{'as':'Applications'});db[_0xd835('0x3c')][_0xd835('0x11a')](db[_0xd835('0xf0')],{'as':_0xd835('0x15c'),'foreignKey':_0xd835('0x15d')});db[_0xd835('0x3c')][_0xd835('0x11a')](db[_0xd835('0x90')],{'as':_0xd835('0x90'),'foreignKey':_0xd835('0x15e')});db[_0xd835('0x3c')][_0xd835('0x11a')](db[_0xd835('0x87')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xd835('0x3c')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xd835('0x15f')});db[_0xd835('0x3e')][_0xd835('0x11c')](db['User'],{'as':_0xd835('0x160'),'through':'UserMailQueue'});db['MailQueue'][_0xd835('0x11c')](db[_0xd835('0xe1')],{'through':_0xd835('0x161'),'as':'Teams'});db[_0xd835('0x41')][_0xd835('0x10b')](db[_0xd835('0x43')],{'as':_0xd835('0x14d'),'onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x162')});db[_0xd835('0x41')][_0xd835('0x11a')](db['MailAccount'],{'as':_0xd835('0x163'),'foreignKey':_0xd835('0x155')});db['MailInteraction'][_0xd835('0x11a')](db['CmContact'],{'as':_0xd835('0x153'),'foreignKey':'ContactId'});db[_0xd835('0x41')][_0xd835('0x11a')](db[_0xd835('0x12')],{'as':_0xd835('0x164'),'foreignKey':_0xd835('0x10d')});db['MailInteraction'][_0xd835('0x11c')](db[_0xd835('0x8e')],{'through':_0xd835('0x165'),'as':'Tags'});db[_0xd835('0x41')][_0xd835('0x11c')](db[_0xd835('0x8e')],{'through':_0xd835('0x165'),'as':_0xd835('0x166')});db[_0xd835('0x41')][_0xd835('0x11c')](db[_0xd835('0x12')],{'as':_0xd835('0x167'),'through':_0xd835('0x168'),'foreignKey':_0xd835('0x162')});db['MailMessage'][_0xd835('0x10b')](db[_0xd835('0x169')],{'as':_0xd835('0x16a'),'onDelete':_0xd835('0x10a')});db[_0xd835('0x43')][_0xd835('0x11a')](db[_0xd835('0x12')],{'as':_0xd835('0x12')});db[_0xd835('0x43')]['belongsTo'](db[_0xd835('0x11e')],{'onDelete':_0xd835('0x10a'),'as':_0xd835('0x153')});db['MailMessage'][_0xd835('0x11a')](db['MailInteraction'],{'as':'Interaction','foreignKey':'MailInteractionId'});db[_0xd835('0x43')][_0xd835('0x11a')](db[_0xd835('0x3c')],{'as':_0xd835('0x163'),'foreignKey':_0xd835('0x155')});db['MailMessage'][_0xd835('0x11a')](db['ChatWebsite'],{'as':'ChatWebsite','foreignKey':_0xd835('0x16b')});db['MailMessage'][_0xd835('0x11a')](db['ChatOfflineMessage'],{'as':_0xd835('0x6b'),'foreignKey':_0xd835('0x16c')});db['MailApplication'][_0xd835('0x11a')](db[_0xd835('0x12')],{'onDelete':'restrict'});db[_0xd835('0x45')][_0xd835('0x11a')](db[_0xd835('0x3e')],{'onDelete':'restrict'});db[_0xd835('0x45')][_0xd835('0x11a')](db[_0xd835('0x3c')],{'onDelete':_0xd835('0x16d')});db[_0xd835('0x45')][_0xd835('0x11a')](db[_0xd835('0x85')],{'onDelete':_0xd835('0x16d'),'foreignKey':_0xd835('0x149')});db[_0xd835('0x45')][_0xd835('0x11a')](db[_0xd835('0x8e')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db[_0xd835('0x3c')],{});db[_0xd835('0x47')][_0xd835('0x11a')](db[_0xd835('0xf0')],{'as':_0xd835('0x15c'),'foreignKey':_0xd835('0x15d')});db[_0xd835('0x47')][_0xd835('0x11a')](db[_0xd835('0x11e')],{'as':_0xd835('0x153'),'foreignKey':_0xd835('0x154')});db[_0xd835('0x47')][_0xd835('0x11a')](db[_0xd835('0x41')],{});db[_0xd835('0x47')][_0xd835('0x11a')](db[_0xd835('0x43')],{});db['MailQueueReport'][_0xd835('0x11a')](db[_0xd835('0x12')],{});db[_0xd835('0x47')][_0xd835('0x11a')](db['MailQueue'],{});db[_0xd835('0x49')][_0xd835('0x10b')](db[_0xd835('0x4b')],{'as':_0xd835('0x16e'),'onDelete':'cascade'});db[_0xd835('0x16f')][_0xd835('0x10b')](db[_0xd835('0x170')],{'as':_0xd835('0x158'),'foreignKey':'FaxAccountId','onDelete':_0xd835('0x10a')});db[_0xd835('0x16f')][_0xd835('0x10b')](db[_0xd835('0x159')],{'as':_0xd835('0x15a'),'foreignKey':_0xd835('0x171')});db[_0xd835('0x16f')][_0xd835('0x10b')](db[_0xd835('0x4e')],{'as':_0xd835('0x15b')});db['FaxAccount'][_0xd835('0x10b')](db[_0xd835('0x4d')],{'as':'Applications'});db[_0xd835('0x16f')]['hasMany'](db['VoiceExtension'],{'as':'Exntensions','onDelete':_0xd835('0x10a')});db[_0xd835('0x16f')][_0xd835('0x10b')](db[_0xd835('0x50')],{'as':_0xd835('0x14d')});db[_0xd835('0x16f')]['belongsTo'](db[_0xd835('0x27')],{'as':_0xd835('0x27')});db[_0xd835('0x16f')]['belongsTo'](db[_0xd835('0xf0')],{'as':'List','foreignKey':'ListId'});db[_0xd835('0x16f')]['belongsTo'](db[_0xd835('0x87')],{'as':_0xd835('0x14a'),'foreignKey':_0xd835('0x172')});db[_0xd835('0x16f')][_0xd835('0x11c')](db[_0xd835('0x12')],{'as':_0xd835('0x160'),'through':'user_has_fax_accounts'});db[_0xd835('0x4d')][_0xd835('0x11a')](db['User'],{'onDelete':_0xd835('0x16d')});db[_0xd835('0x4d')]['belongsTo'](db[_0xd835('0x173')],{'onDelete':_0xd835('0x16d')});db[_0xd835('0x4d')][_0xd835('0x11a')](db[_0xd835('0x16f')],{'onDelete':'restrict'});db[_0xd835('0x4d')][_0xd835('0x11a')](db[_0xd835('0x8e')],{'onDelete':_0xd835('0x16d'),'foreignKey':_0xd835('0x174')});db['FaxInteraction']['hasMany'](db[_0xd835('0x50')],{'as':_0xd835('0x14d'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db[_0xd835('0x4e')]['belongsTo'](db[_0xd835('0x16f')],{'as':_0xd835('0x163'),'foreignKey':'FaxAccountId'});db['FaxInteraction']['belongsTo'](db[_0xd835('0x11e')],{'as':'Contact','foreignKey':_0xd835('0x154')});db[_0xd835('0x4e')]['belongsTo'](db[_0xd835('0x12')],{'as':_0xd835('0x164'),'foreignKey':_0xd835('0x10d')});db[_0xd835('0x4e')][_0xd835('0x11c')](db['Tag'],{'through':_0xd835('0x175'),'as':_0xd835('0x176')});db[_0xd835('0x4e')]['belongsToMany'](db['Tag'],{'through':_0xd835('0x175'),'as':'ThroughTags'});db[_0xd835('0x4e')]['belongsToMany'](db['User'],{'as':_0xd835('0x167'),'through':'user_has_fax_interactions','foreignKey':_0xd835('0x177')});db[_0xd835('0x50')][_0xd835('0x11a')](db[_0xd835('0x12')],{'onDelete':'cascade','as':'User'});db[_0xd835('0x50')][_0xd835('0x11a')](db[_0xd835('0x4e')],{'as':_0xd835('0x178'),'foreignKey':_0xd835('0x177')});db[_0xd835('0x50')]['belongsTo'](db[_0xd835('0x11e')],{'onDelete':_0xd835('0x10a'),'as':_0xd835('0x153')});db[_0xd835('0x50')][_0xd835('0x11a')](db[_0xd835('0x169')],{'as':'Attachment','foreignKey':_0xd835('0x179')});db[_0xd835('0x50')]['belongsTo'](db[_0xd835('0x16f')],{'as':_0xd835('0x163'),'foreignKey':_0xd835('0x171')});db['FaxQueue'][_0xd835('0x11c')](db[_0xd835('0x12')],{'as':'Agents','through':_0xd835('0x12b')});db[_0xd835('0x173')][_0xd835('0x11c')](db[_0xd835('0xe1')],{'through':_0xd835('0x17a'),'as':_0xd835('0x17b')});db[_0xd835('0x53')]['belongsTo'](db[_0xd835('0x16f')],{});db[_0xd835('0x53')][_0xd835('0x11a')](db[_0xd835('0xf0')],{'as':_0xd835('0x15c'),'foreignKey':_0xd835('0x15d')});db[_0xd835('0x53')]['belongsTo'](db[_0xd835('0x11e')],{'as':_0xd835('0x153'),'foreignKey':_0xd835('0x154')});db[_0xd835('0x53')][_0xd835('0x11a')](db['FaxInteraction'],{});db[_0xd835('0x53')]['belongsTo'](db[_0xd835('0x50')],{});db[_0xd835('0x53')][_0xd835('0x11a')](db[_0xd835('0x12')],{});db[_0xd835('0x53')][_0xd835('0x11a')](db[_0xd835('0x173')],{});db[_0xd835('0x136')]['hasMany'](db[_0xd835('0x170')],{'as':_0xd835('0x158'),'foreignKey':'SmsAccountId','onDelete':'cascade'});db[_0xd835('0x136')][_0xd835('0x10b')](db['CannedAnswer'],{'as':_0xd835('0x15a'),'foreignKey':_0xd835('0x17c')});db['SmsAccount'][_0xd835('0x10b')](db['SmsMessage'],{'as':'Messages','foreignKey':'SmsAccountId'});db[_0xd835('0x136')][_0xd835('0x10b')](db[_0xd835('0x57')],{'as':'Interactions'});db[_0xd835('0x136')][_0xd835('0x10b')](db['SmsApplication'],{'as':_0xd835('0x17d')});db['SmsAccount']['belongsTo'](db[_0xd835('0xf0')],{'as':_0xd835('0x15c'),'foreignKey':'ListId'});db[_0xd835('0x136')]['belongsTo'](db[_0xd835('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0xd835('0x172')});db[_0xd835('0x136')]['belongsToMany'](db[_0xd835('0x12')],{'as':_0xd835('0x160'),'through':_0xd835('0x137')});db[_0xd835('0x55')][_0xd835('0x11a')](db[_0xd835('0x12')],{'onDelete':'restrict'});db['SmsApplication'][_0xd835('0x11a')](db[_0xd835('0x59')],{'onDelete':_0xd835('0x16d')});db[_0xd835('0x55')][_0xd835('0x11a')](db[_0xd835('0x136')],{'onDelete':_0xd835('0x16d')});db[_0xd835('0x55')][_0xd835('0x11a')](db['Interval'],{'onDelete':_0xd835('0x16d'),'foreignKey':_0xd835('0x149')});db[_0xd835('0x55')][_0xd835('0x11a')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xd835('0x57')]['hasMany'](db[_0xd835('0x17e')],{'as':_0xd835('0x14d'),'onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x17f')});db[_0xd835('0x57')][_0xd835('0x11a')](db[_0xd835('0x136')],{'as':'Account','foreignKey':_0xd835('0x17c')});db[_0xd835('0x57')]['belongsTo'](db[_0xd835('0x11e')],{'as':_0xd835('0x153'),'foreignKey':_0xd835('0x154')});db[_0xd835('0x57')][_0xd835('0x11a')](db[_0xd835('0x12')],{'as':'Owner','foreignKey':_0xd835('0x10d')});db[_0xd835('0x57')]['belongsToMany'](db[_0xd835('0x8e')],{'through':'sms_interaction_has_tags','as':_0xd835('0x176')});db[_0xd835('0x57')]['belongsToMany'](db[_0xd835('0x8e')],{'through':'sms_interaction_has_tags','as':_0xd835('0x166')});db[_0xd835('0x57')][_0xd835('0x11c')](db['User'],{'as':_0xd835('0x167'),'through':_0xd835('0x180'),'foreignKey':_0xd835('0x17f')});db[_0xd835('0x17e')][_0xd835('0x11a')](db[_0xd835('0x12')],{'as':_0xd835('0x12')});db[_0xd835('0x17e')][_0xd835('0x11a')](db['CmContact'],{'onDelete':_0xd835('0x10a'),'as':'Contact'});db[_0xd835('0x17e')][_0xd835('0x11a')](db['SmsInteraction'],{'onDelete':_0xd835('0x10a'),'as':_0xd835('0x178'),'foreignKey':_0xd835('0x17f')});db[_0xd835('0x17e')][_0xd835('0x11a')](db['SmsAccount'],{'as':'Account','foreignKey':'SmsAccountId'});db[_0xd835('0x59')][_0xd835('0x11c')](db[_0xd835('0x12')],{'as':_0xd835('0x160'),'through':_0xd835('0x33'),'foreignKey':_0xd835('0x181')});db[_0xd835('0x59')]['belongsToMany'](db[_0xd835('0xe1')],{'through':_0xd835('0x182'),'as':_0xd835('0x17b')});db[_0xd835('0x5b')][_0xd835('0x10b')](db[_0xd835('0x170')],{'as':_0xd835('0x158'),'foreignKey':_0xd835('0x183'),'onDelete':_0xd835('0x10a')});db['OpenchannelAccount'][_0xd835('0x10b')](db['CannedAnswer'],{'as':_0xd835('0x15a'),'foreignKey':_0xd835('0x183')});db['OpenchannelAccount'][_0xd835('0x10b')](db[_0xd835('0x113')],{'as':'Interactions','foreignKey':_0xd835('0x183')});db[_0xd835('0x5b')][_0xd835('0x10b')](db['OpenchannelMessage'],{'as':_0xd835('0x14d'),'foreignKey':_0xd835('0x183')});db[_0xd835('0x5b')]['hasMany'](db['OpenchannelApplication'],{'as':_0xd835('0x17d'),'foreignKey':_0xd835('0x183')});db[_0xd835('0x5b')]['belongsTo'](db[_0xd835('0xf0')],{'as':'List','foreignKey':_0xd835('0x15d')});db[_0xd835('0x5b')]['belongsTo'](db[_0xd835('0x87')],{'as':_0xd835('0x14a'),'foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount']['belongsToMany'](db[_0xd835('0x12')],{'as':_0xd835('0x160'),'through':_0xd835('0x135')});db['OpenchannelApplication'][_0xd835('0x11a')](db[_0xd835('0x12')],{'onDelete':_0xd835('0x16d')});db[_0xd835('0x5d')][_0xd835('0x11a')](db[_0xd835('0x62')],{'onDelete':_0xd835('0x16d'),'foreignKey':_0xd835('0x184')});db[_0xd835('0x5d')][_0xd835('0x11a')](db[_0xd835('0x5b')],{'onDelete':'restrict','foreignKey':_0xd835('0x183')});db[_0xd835('0x5d')][_0xd835('0x11a')](db[_0xd835('0x85')],{'onDelete':_0xd835('0x16d'),'foreignKey':_0xd835('0x149')});db[_0xd835('0x5d')][_0xd835('0x11a')](db[_0xd835('0x8e')],{'onDelete':'restrict','foreignKey':_0xd835('0x174')});db['OpenchannelInteraction'][_0xd835('0x10b')](db[_0xd835('0x60')],{'as':_0xd835('0x14d'),'onDelete':_0xd835('0x10a'),'foreignKey':'OpenchannelInteractionId'});db[_0xd835('0x113')][_0xd835('0x11a')](db[_0xd835('0x5b')],{'as':_0xd835('0x163'),'foreignKey':_0xd835('0x183')});db[_0xd835('0x113')][_0xd835('0x11a')](db[_0xd835('0x11e')],{'as':'Contact','foreignKey':_0xd835('0x154')});db[_0xd835('0x113')][_0xd835('0x11a')](db[_0xd835('0x12')],{'as':_0xd835('0x164'),'foreignKey':_0xd835('0x10d')});db[_0xd835('0x113')][_0xd835('0x11c')](db[_0xd835('0x8e')],{'through':_0xd835('0x185'),'as':_0xd835('0x176')});db[_0xd835('0x113')][_0xd835('0x11c')](db[_0xd835('0x8e')],{'through':'openchannel_interaction_has_tags','as':_0xd835('0x166')});db[_0xd835('0x113')][_0xd835('0x11c')](db[_0xd835('0x12')],{'as':'Users','through':_0xd835('0x126'),'foreignKey':_0xd835('0x186')});db[_0xd835('0x60')][_0xd835('0x11a')](db[_0xd835('0x12')],{'onDelete':_0xd835('0x10a'),'as':_0xd835('0x12')});db[_0xd835('0x60')]['belongsTo'](db[_0xd835('0x11e')],{'onDelete':_0xd835('0x10a'),'as':'Contact'});db[_0xd835('0x60')][_0xd835('0x11a')](db[_0xd835('0x113')],{'onDelete':_0xd835('0x10a'),'as':_0xd835('0x178'),'foreignKey':_0xd835('0x186')});db[_0xd835('0x60')][_0xd835('0x11a')](db[_0xd835('0x169')],{'as':_0xd835('0x169'),'foreignKey':_0xd835('0x179')});db[_0xd835('0x60')][_0xd835('0x11a')](db[_0xd835('0x5b')],{'as':'Account','foreignKey':_0xd835('0x183')});db[_0xd835('0x62')][_0xd835('0x11c')](db['User'],{'as':_0xd835('0x160'),'through':_0xd835('0x35'),'foreignKey':_0xd835('0x184')});db[_0xd835('0x62')][_0xd835('0x11c')](db[_0xd835('0xe1')],{'through':_0xd835('0x187'),'as':_0xd835('0x17b')});db[_0xd835('0x63')][_0xd835('0x10b')](db[_0xd835('0x170')],{'as':_0xd835('0x158'),'foreignKey':_0xd835('0x16b'),'onDelete':_0xd835('0x10a')});db['ChatWebsite']['hasMany'](db[_0xd835('0x159')],{'as':_0xd835('0x15a'),'foreignKey':_0xd835('0x16b')});db[_0xd835('0x63')][_0xd835('0x10b')](db[_0xd835('0x70')],{'as':_0xd835('0x188')});db[_0xd835('0x63')][_0xd835('0x10b')](db[_0xd835('0x114')],{'as':_0xd835('0x15b')});db['ChatWebsite']['hasMany'](db['ChatApplication'],{'as':_0xd835('0x17d')});db[_0xd835('0x63')][_0xd835('0x10b')](db['ChatMessage'],{'as':_0xd835('0x14d')});db[_0xd835('0x63')]['belongsTo'](db[_0xd835('0xf0')],{'as':_0xd835('0x15c'),'foreignKey':_0xd835('0x15d')});db['ChatWebsite'][_0xd835('0x11a')](db[_0xd835('0x85')],{'as':_0xd835('0x85'),'foreignKey':_0xd835('0x149')});db['ChatWebsite']['belongsTo'](db[_0xd835('0x3c')],{'as':_0xd835('0x3c'),'foreignKey':_0xd835('0x155')});db['ChatWebsite'][_0xd835('0x11a')](db[_0xd835('0x87')],{'as':_0xd835('0x14a'),'foreignKey':_0xd835('0x172')});db[_0xd835('0x63')][_0xd835('0x11c')](db[_0xd835('0x12')],{'as':_0xd835('0x160'),'through':'user_has_chat_websites'});db[_0xd835('0x65')][_0xd835('0x11a')](db[_0xd835('0x5b')],{});db[_0xd835('0x65')][_0xd835('0x11a')](db[_0xd835('0xf0')],{'as':'List','foreignKey':'ListId'});db[_0xd835('0x65')][_0xd835('0x11a')](db['CmContact'],{'as':_0xd835('0x153'),'foreignKey':_0xd835('0x154')});db['OpenchannelQueueReport']['belongsTo'](db[_0xd835('0x113')],{});db[_0xd835('0x65')][_0xd835('0x11a')](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0xd835('0x11a')](db[_0xd835('0x12')],{});db[_0xd835('0x65')][_0xd835('0x11a')](db['OpenchannelQueue'],{});db['ChatApplication'][_0xd835('0x11a')](db['User'],{'as':_0xd835('0x189'),'foreignKey':_0xd835('0x10d'),'onDelete':_0xd835('0x16d')});db['ChatApplication'][_0xd835('0x11a')](db[_0xd835('0x6d')],{'as':_0xd835('0x18a'),'foreignKey':_0xd835('0x18b'),'onDelete':_0xd835('0x16d')});db[_0xd835('0x67')][_0xd835('0x11a')](db['ChatWebsite'],{'as':_0xd835('0x18c'),'foreignKey':_0xd835('0x16b'),'onDelete':_0xd835('0x16d')});db[_0xd835('0x67')][_0xd835('0x11a')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xd835('0x114')]['hasMany'](db[_0xd835('0x18d')],{'as':_0xd835('0x14d'),'onDelete':'cascade','foreignKey':_0xd835('0x18e')});db[_0xd835('0x114')]['belongsTo'](db[_0xd835('0x63')],{'as':_0xd835('0x163'),'foreignKey':_0xd835('0x16b')});db[_0xd835('0x114')][_0xd835('0x11a')](db[_0xd835('0x11e')],{'as':'Contact','foreignKey':_0xd835('0x154')});db[_0xd835('0x114')][_0xd835('0x11a')](db[_0xd835('0x12')],{'as':'Owner','foreignKey':'UserId'});db[_0xd835('0x114')][_0xd835('0x11c')](db['Tag'],{'through':_0xd835('0x18f'),'as':_0xd835('0x176')});db[_0xd835('0x114')]['belongsToMany'](db[_0xd835('0x8e')],{'through':_0xd835('0x18f'),'as':_0xd835('0x166')});db[_0xd835('0x114')][_0xd835('0x11c')](db[_0xd835('0x12')],{'as':'Users','through':_0xd835('0x190'),'foreignKey':_0xd835('0x18e')});db[_0xd835('0x18d')][_0xd835('0x11a')](db[_0xd835('0x12')],{'onDelete':_0xd835('0x10a'),'as':_0xd835('0x12')});db[_0xd835('0x18d')][_0xd835('0x11a')](db[_0xd835('0x11e')],{'onDelete':_0xd835('0x10a'),'as':_0xd835('0x153'),'foreignKey':_0xd835('0x154')});db['ChatMessage'][_0xd835('0x11a')](db[_0xd835('0x114')],{'onDelete':_0xd835('0x10a'),'as':_0xd835('0x178'),'foreignKey':'ChatInteractionId'});db[_0xd835('0x18d')][_0xd835('0x11a')](db['Attachment'],{'as':'Attachment','foreignKey':_0xd835('0x179')});db[_0xd835('0x18d')][_0xd835('0x11a')](db[_0xd835('0x63')],{'as':_0xd835('0x163'),'foreignKey':_0xd835('0x16b')});db[_0xd835('0x6b')][_0xd835('0x10b')](db[_0xd835('0x169')],{'as':_0xd835('0x16a'),'foreignKey':_0xd835('0x16c'),'onDelete':_0xd835('0x10a'),'hooks':!![]});db[_0xd835('0x6b')][_0xd835('0x11a')](db[_0xd835('0x11e')],{'onDelete':_0xd835('0x10a'),'as':_0xd835('0x153'),'foreignKey':'ContactId'});db[_0xd835('0x6b')][_0xd835('0x11a')](db['ChatWebsite'],{'as':_0xd835('0x163'),'foreignKey':_0xd835('0x16b')});db['ChatQueue']['belongsToMany'](db['User'],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db[_0xd835('0x6d')][_0xd835('0x11c')](db[_0xd835('0xe1')],{'through':_0xd835('0x191'),'as':_0xd835('0x17b')});db[_0xd835('0x6e')][_0xd835('0x10b')](db[_0xd835('0xcd')],{'as':_0xd835('0x14d'),'foreignKey':_0xd835('0x192'),'onDelete':_0xd835('0x10a')});db[_0xd835('0x6e')][_0xd835('0x11c')](db['User'],{'as':_0xd835('0x140'),'through':_0xd835('0x11d')});db[_0xd835('0x70')][_0xd835('0x11a')](db[_0xd835('0x63')],{'as':_0xd835('0x18c'),'foreignKey':_0xd835('0x16b')});db[_0xd835('0x72')][_0xd835('0x10b')](db['CmContact'],{'as':_0xd835('0x11f'),'foreignKey':_0xd835('0x193')});db[_0xd835('0x11e')][_0xd835('0x10b')](db['CmHopper'],{'as':_0xd835('0x143'),'foreignKey':_0xd835('0x154')});db[_0xd835('0x11e')]['hasMany'](db['CmHopperFinal'],{'as':_0xd835('0x111'),'foreignKey':_0xd835('0x154')});db[_0xd835('0x11e')][_0xd835('0x10b')](db[_0xd835('0x79')],{'as':_0xd835('0x144'),'foreignKey':_0xd835('0x154')});db[_0xd835('0x11e')]['hasMany'](db[_0xd835('0x7a')],{'as':_0xd835('0x7a'),'foreignKey':'ContactId'});db[_0xd835('0x11e')][_0xd835('0x10b')](db[_0xd835('0xd3')],{'as':_0xd835('0x146'),'foreignKey':'ContactId'});db['CmContact']['hasMany'](db[_0xd835('0x113')],{'as':_0xd835('0x125'),'foreignKey':'ContactId','onDelete':_0xd835('0x16d')});db[_0xd835('0x11e')][_0xd835('0x10b')](db[_0xd835('0x114')],{'as':_0xd835('0x115'),'foreignKey':'ContactId','onDelete':_0xd835('0x16d')});db[_0xd835('0x11e')]['hasMany'](db[_0xd835('0x57')],{'as':_0xd835('0x116'),'foreignKey':'ContactId','onDelete':_0xd835('0x16d')});db['CmContact'][_0xd835('0x10b')](db[_0xd835('0x4e')],{'as':_0xd835('0x124'),'foreignKey':'ContactId','onDelete':_0xd835('0x16d')});db['CmContact'][_0xd835('0x10b')](db['MailInteraction'],{'as':_0xd835('0x117'),'foreignKey':_0xd835('0x154'),'onDelete':_0xd835('0x16d')});db[_0xd835('0x11e')]['belongsTo'](db[_0xd835('0x72')],{'as':_0xd835('0x194'),'foreignKey':_0xd835('0x193')});db[_0xd835('0x11e')]['belongsTo'](db[_0xd835('0xf0')],{'as':_0xd835('0x15c'),'foreignKey':_0xd835('0x15d'),'onDelete':_0xd835('0x10a')});db[_0xd835('0x11e')]['belongsToMany'](db[_0xd835('0x12')],{'as':'Users','through':_0xd835('0x120')});db['CmContact'][_0xd835('0x11c')](db['Tag'],{'as':'Tags','through':'cm_contact_has_tags'});db[_0xd835('0x11e')][_0xd835('0x11c')](db[_0xd835('0x8e')],{'through':_0xd835('0x195'),'as':'ThroughTags'});db[_0xd835('0x142')][_0xd835('0x11a')](db['CmContact'],{'as':_0xd835('0x153'),'foreignKey':_0xd835('0x154'),'onDelete':_0xd835('0x10a')});db[_0xd835('0x142')][_0xd835('0x11a')](db[_0xd835('0xf0')],{'as':_0xd835('0x15c'),'foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0xd835('0x11a')](db['User'],{'as':_0xd835('0x189'),'foreignKey':'UserId'});db[_0xd835('0x142')][_0xd835('0x11a')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0xd835('0x141'),'onDelete':_0xd835('0x10a')});db['CmHopper']['belongsTo'](db[_0xd835('0xe5')],{'as':_0xd835('0xe5'),'foreignKey':_0xd835('0x196'),'onDelete':_0xd835('0x10a')});db[_0xd835('0x142')]['belongsTo'](db[_0xd835('0x12')],{'as':_0xd835('0x164'),'foreignKey':_0xd835('0x197')});db[_0xd835('0x76')]['belongsTo'](db[_0xd835('0x11e')],{'as':'Contact','foreignKey':_0xd835('0x154'),'onDelete':_0xd835('0x10a')});db[_0xd835('0x76')]['belongsTo'](db[_0xd835('0xf0')],{'as':_0xd835('0x15c'),'foreignKey':_0xd835('0x15d'),'onDelete':_0xd835('0x10a')});db[_0xd835('0x76')][_0xd835('0x11a')](db['VoiceQueue'],{'as':_0xd835('0x18a'),'foreignKey':_0xd835('0x141'),'onDelete':_0xd835('0x10a')});db[_0xd835('0x76')][_0xd835('0x11a')](db[_0xd835('0xe5')],{'as':_0xd835('0xe5'),'foreignKey':_0xd835('0x196'),'onDelete':_0xd835('0x10a')});db['Automation'][_0xd835('0x10b')](db[_0xd835('0x83')],{'as':{'plural':'All','singular':_0xd835('0x198')},'foreignKey':_0xd835('0x199'),'onDelete':_0xd835('0x10a'),'hooks':!![]});db[_0xd835('0x80')][_0xd835('0x10b')](db['Condition'],{'as':{'plural':_0xd835('0x19a'),'singular':_0xd835('0x19b')},'foreignKey':_0xd835('0x19c'),'onDelete':'cascade','hooks':!![]});db[_0xd835('0x80')]['hasMany'](db[_0xd835('0x7e')],{'as':_0xd835('0x19d'),'foreignKey':_0xd835('0x19e'),'onDelete':_0xd835('0x10a'),'hooks':!![]});db['Disposition'][_0xd835('0x10b')](db[_0xd835('0x170')],{'as':_0xd835('0x158'),'foreignKey':_0xd835('0x19f'),'onDelete':_0xd835('0x10a')});db['Interval'][_0xd835('0x10b')](db['Interval'],{'as':_0xd835('0x1a0'),'foreignKey':_0xd835('0x149'),'onDelete':_0xd835('0x10a'),'hooks':!![],'required':![]});db[_0xd835('0x85')][_0xd835('0x10b')](db['VoiceExtension'],{'as':_0xd835('0x10f'),'foreignKey':'IntervalId','onDelete':_0xd835('0x16d')});db[_0xd835('0x85')][_0xd835('0x10b')](db[_0xd835('0x45')],{'as':_0xd835('0x1a1'),'foreignKey':_0xd835('0x149')});db[_0xd835('0x85')][_0xd835('0x10b')](db['ChatApplication'],{'as':_0xd835('0x1a2'),'foreignKey':'IntervalId'});db[_0xd835('0x85')][_0xd835('0x10b')](db[_0xd835('0x4d')],{'as':_0xd835('0x1a3'),'foreignKey':_0xd835('0x149')});db[_0xd835('0x85')][_0xd835('0x10b')](db[_0xd835('0x55')],{'as':_0xd835('0x1a4'),'foreignKey':_0xd835('0x149')});db[_0xd835('0x8a')][_0xd835('0x11a')](db[_0xd835('0x3c')],{});db[_0xd835('0x8a')][_0xd835('0x11a')](db['AnalyticDefaultReport'],{'foreignKey':_0xd835('0x1a5')});db[_0xd835('0x8a')][_0xd835('0x11a')](db[_0xd835('0x9a')],{'foreignKey':_0xd835('0x1a6')});db[_0xd835('0x8c')][_0xd835('0x11c')](db[_0xd835('0x1b')],{'as':_0xd835('0x1a7'),'through':_0xd835('0x13e'),'onDelete':_0xd835('0x16d')});db['Tag'][_0xd835('0x11c')](db[_0xd835('0x11e')],{'through':_0xd835('0x195')});db['Tag']['belongsToMany'](db[_0xd835('0x114')],{'through':_0xd835('0x18f')});db[_0xd835('0x8e')]['belongsToMany'](db['MailInteraction'],{'through':_0xd835('0x165')});db[_0xd835('0x8e')][_0xd835('0x11c')](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0xd835('0x8e')]['belongsToMany'](db[_0xd835('0x4e')],{'through':'fax_interaction_has_tags'});db[_0xd835('0x8e')][_0xd835('0x11c')](db[_0xd835('0x113')],{'through':'openchannel_interaction_has_tags'});db[_0xd835('0x8e')][_0xd835('0x11c')](db[_0xd835('0xfc')],{'through':_0xd835('0x1a8')});db[_0xd835('0x92')]['hasMany'](db['Condition'],{'as':{'plural':_0xd835('0x1a9'),'singular':_0xd835('0x1aa')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db['Trigger'][_0xd835('0x10b')](db['Condition'],{'as':{'plural':'AnyConditions','singular':_0xd835('0x1ab')},'foreignKey':'TriggerAnyId','onDelete':_0xd835('0x10a'),'hooks':!![]});db['Trigger'][_0xd835('0x10b')](db[_0xd835('0x7e')],{'as':_0xd835('0x19d'),'foreignKey':'TriggerId','onDelete':_0xd835('0x10a'),'hooks':!![]});db[_0xd835('0x9a')][_0xd835('0x10b')](db['AnalyticFieldReport'],{'as':_0xd835('0x1ac'),'onDelete':_0xd835('0x10a'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xd835('0x9c')]['hasMany'](db['AnalyticFieldReport'],{'as':_0xd835('0x1ac'),'onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x1a5')});db[_0xd835('0x9f')][_0xd835('0x10b')](db['AnalyticFieldReport'],{'as':_0xd835('0x1ac'),'onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x1ad')});db[_0xd835('0xa1')][_0xd835('0x11a')](db[_0xd835('0x9f')],{'foreignKey':_0xd835('0x1ad')});db[_0xd835('0x1ae')][_0xd835('0x10b')](db['SalesforceConfiguration'],{'as':_0xd835('0x1af'),'onDelete':'cascade','foreignKey':_0xd835('0x1b0')});db['SalesforceConfiguration']['hasMany'](db[_0xd835('0x1b1')],{'as':_0xd835('0x1b2'),'onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x1b3')});db[_0xd835('0x1b4')][_0xd835('0x10b')](db[_0xd835('0x1b1')],{'as':_0xd835('0x1b5'),'onDelete':_0xd835('0x10a'),'foreignKey':'DescriptionId'});db[_0xd835('0x1b4')]['hasMany'](db['SalesforceField'],{'as':_0xd835('0x1ac'),'onDelete':'cascade','foreignKey':_0xd835('0x1b6')});db['SalesforceConfiguration'][_0xd835('0x11a')](db[_0xd835('0x1ae')],{'as':_0xd835('0x163'),'foreignKey':'AccountId'});db['SalesforceField']['hasMany'](db[_0xd835('0x1b1')],{'as':_0xd835('0x1b7'),'foreignKey':_0xd835('0x1b3')});db[_0xd835('0x1b1')]['hasMany'](db[_0xd835('0x1b1')],{'as':_0xd835('0x1b8'),'foreignKey':_0xd835('0x1b9')});db[_0xd835('0x1b1')][_0xd835('0x10b')](db[_0xd835('0x1b1')],{'as':_0xd835('0x1ba'),'foreignKey':_0xd835('0x1b6')});db[_0xd835('0x1b1')][_0xd835('0x11a')](db[_0xd835('0x94')],{'as':_0xd835('0x94'),'foreignKey':_0xd835('0x1bb')});db[_0xd835('0x1bc')][_0xd835('0x10b')](db[_0xd835('0xa5')],{'as':_0xd835('0x1af'),'onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x1b0')});db[_0xd835('0xa5')][_0xd835('0x10b')](db[_0xd835('0x1bd')],{'as':_0xd835('0x1b2'),'onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x1b3')});db['SugarcrmConfiguration'][_0xd835('0x10b')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0xd835('0x10a'),'foreignKey':'DescriptionId'});db[_0xd835('0xa5')][_0xd835('0x10b')](db[_0xd835('0x1bd')],{'as':_0xd835('0x1ac'),'onDelete':_0xd835('0x10a'),'foreignKey':'FieldId'});db[_0xd835('0xa5')]['belongsTo'](db[_0xd835('0x1bc')],{'as':_0xd835('0x163'),'foreignKey':_0xd835('0x1b0')});db[_0xd835('0x1bd')]['hasMany'](db['SugarcrmField'],{'as':_0xd835('0x1b7'),'foreignKey':_0xd835('0x1b3')});db['SugarcrmField'][_0xd835('0x10b')](db[_0xd835('0x1bd')],{'as':_0xd835('0x1b8'),'foreignKey':_0xd835('0x1b9')});db[_0xd835('0x1bd')]['hasMany'](db[_0xd835('0x1bd')],{'as':'Field','foreignKey':_0xd835('0x1b6')});db['SugarcrmField'][_0xd835('0x11a')](db[_0xd835('0x94')],{'as':'Variable','foreignKey':_0xd835('0x1bb')});db[_0xd835('0xa8')][_0xd835('0x10b')](db[_0xd835('0xaa')],{'as':_0xd835('0x1af'),'onDelete':_0xd835('0x10a'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xd835('0x10b')](db[_0xd835('0xab')],{'as':_0xd835('0x1b2'),'onDelete':'cascade','foreignKey':_0xd835('0x1b3')});db[_0xd835('0xaa')][_0xd835('0x10b')](db[_0xd835('0xab')],{'as':_0xd835('0x1b5'),'onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x1b9')});db['DeskConfiguration'][_0xd835('0x10b')](db[_0xd835('0xab')],{'as':_0xd835('0x1ac'),'onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x1b6')});db[_0xd835('0xaa')][_0xd835('0x11a')](db[_0xd835('0xa8')],{'as':_0xd835('0x163'),'foreignKey':_0xd835('0x1b0')});db[_0xd835('0xaa')][_0xd835('0x11c')](db['Tag'],{'through':_0xd835('0x1be')});db['DeskField']['hasMany'](db[_0xd835('0xab')],{'as':_0xd835('0x1b7'),'foreignKey':_0xd835('0x1b3')});db[_0xd835('0xab')]['hasMany'](db[_0xd835('0xab')],{'as':_0xd835('0x1b8'),'foreignKey':_0xd835('0x1b9')});db[_0xd835('0xab')][_0xd835('0x10b')](db['DeskField'],{'as':_0xd835('0x1ba'),'foreignKey':_0xd835('0x1b6')});db[_0xd835('0xab')][_0xd835('0x11a')](db[_0xd835('0x94')],{'as':_0xd835('0x94'),'foreignKey':_0xd835('0x1bb')});db[_0xd835('0xad')][_0xd835('0x10b')](db['ZohoConfiguration'],{'as':_0xd835('0x1af'),'onDelete':_0xd835('0x10a'),'foreignKey':'AccountId'});db[_0xd835('0xae')][_0xd835('0x10b')](db[_0xd835('0xb0')],{'as':_0xd835('0x1b2'),'onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x1b3')});db[_0xd835('0xae')][_0xd835('0x10b')](db[_0xd835('0xb0')],{'as':'Descriptions','onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x1b9')});db[_0xd835('0xae')][_0xd835('0x10b')](db[_0xd835('0xb0')],{'as':'Fields','onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x1b6')});db[_0xd835('0xae')][_0xd835('0x11a')](db[_0xd835('0xad')],{'as':_0xd835('0x163'),'foreignKey':_0xd835('0x1b0')});db['ZohoField']['hasMany'](db[_0xd835('0xb0')],{'as':_0xd835('0x1b7'),'foreignKey':_0xd835('0x1b3')});db[_0xd835('0xb0')][_0xd835('0x10b')](db[_0xd835('0xb0')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xd835('0xb0')][_0xd835('0x10b')](db[_0xd835('0xb0')],{'as':_0xd835('0x1ba'),'foreignKey':'FieldId'});db[_0xd835('0xb0')][_0xd835('0x11a')](db[_0xd835('0x94')],{'as':_0xd835('0x94'),'foreignKey':_0xd835('0x1bb')});db[_0xd835('0x1bf')][_0xd835('0x10b')](db['ZendeskConfiguration'],{'as':_0xd835('0x1af'),'onDelete':'cascade','foreignKey':_0xd835('0x1b0')});db[_0xd835('0x1c0')][_0xd835('0x10b')](db[_0xd835('0xb3')],{'as':_0xd835('0x1b2'),'foreignKey':'SubjectId'});db['ZendeskConfiguration']['hasMany'](db[_0xd835('0xb3')],{'as':'Descriptions','foreignKey':_0xd835('0x1b9')});db[_0xd835('0x1c0')][_0xd835('0x10b')](db[_0xd835('0xb3')],{'as':'Fields','foreignKey':_0xd835('0x1b6')});db[_0xd835('0x1c0')]['belongsTo'](db[_0xd835('0x1bf')],{'as':_0xd835('0x163'),'foreignKey':'AccountId'});db[_0xd835('0x1c0')]['belongsToMany'](db[_0xd835('0x8e')],{'through':_0xd835('0x1c1')});db[_0xd835('0xb3')]['hasMany'](db[_0xd835('0xb3')],{'as':'Subject','foreignKey':_0xd835('0x1b3')});db[_0xd835('0xb3')][_0xd835('0x10b')](db[_0xd835('0xb3')],{'as':_0xd835('0x1b8'),'foreignKey':_0xd835('0x1b9')});db[_0xd835('0xb3')][_0xd835('0x10b')](db['ZendeskField'],{'as':_0xd835('0x1ba'),'foreignKey':_0xd835('0x1b6')});db['ZendeskField'][_0xd835('0x11a')](db['Variable'],{'as':_0xd835('0x94'),'foreignKey':_0xd835('0x1bb')});db[_0xd835('0x1c2')][_0xd835('0x10b')](db['FreshdeskConfiguration'],{'as':_0xd835('0x1af'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xd835('0xb5')][_0xd835('0x10b')](db[_0xd835('0x1c3')],{'as':_0xd835('0x1b2'),'onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x1b3')});db['FreshdeskConfiguration'][_0xd835('0x10b')](db[_0xd835('0x1c3')],{'as':_0xd835('0x1b5'),'onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x1b9')});db['FreshdeskConfiguration'][_0xd835('0x10b')](db[_0xd835('0x1c3')],{'as':'Fields','onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x1b6')});db[_0xd835('0xb5')][_0xd835('0x11a')](db[_0xd835('0x1c2')],{'as':_0xd835('0x163'),'foreignKey':_0xd835('0x1b0')});db[_0xd835('0xb5')][_0xd835('0x11c')](db[_0xd835('0x8e')],{'through':_0xd835('0x1c4')});db['FreshdeskField'][_0xd835('0x10b')](db[_0xd835('0x1c3')],{'as':_0xd835('0x1b7'),'foreignKey':'SubjectId'});db[_0xd835('0x1c3')][_0xd835('0x10b')](db['FreshdeskField'],{'as':'Description','foreignKey':_0xd835('0x1b9')});db['FreshdeskField'][_0xd835('0x10b')](db[_0xd835('0x1c3')],{'as':_0xd835('0x1ba'),'foreignKey':_0xd835('0x1b6')});db[_0xd835('0x1c3')][_0xd835('0x11a')](db[_0xd835('0x94')],{'as':_0xd835('0x94'),'foreignKey':_0xd835('0x1bb')});db[_0xd835('0xb6')][_0xd835('0x10b')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xd835('0xb8')]['hasMany'](db[_0xd835('0xba')],{'as':_0xd835('0x1b2'),'foreignKey':_0xd835('0x1b3')});db[_0xd835('0xb8')]['hasMany'](db[_0xd835('0xba')],{'as':_0xd835('0x1b5'),'foreignKey':_0xd835('0x1b9')});db[_0xd835('0xb8')][_0xd835('0x10b')](db['VtigerField'],{'as':_0xd835('0x1ac'),'foreignKey':'FieldId'});db[_0xd835('0xb8')][_0xd835('0x11a')](db[_0xd835('0xb6')],{'as':_0xd835('0x163'),'foreignKey':_0xd835('0x1b0')});db[_0xd835('0xba')][_0xd835('0x10b')](db[_0xd835('0xba')],{'as':_0xd835('0x1b7'),'foreignKey':'SubjectId'});db['VtigerField'][_0xd835('0x10b')](db[_0xd835('0xba')],{'as':_0xd835('0x1b8'),'foreignKey':_0xd835('0x1b9')});db[_0xd835('0xba')][_0xd835('0x10b')](db[_0xd835('0xba')],{'as':_0xd835('0x1ba'),'foreignKey':_0xd835('0x1b6')});db[_0xd835('0xba')][_0xd835('0x11a')](db[_0xd835('0x94')],{'as':_0xd835('0x94'),'foreignKey':'VariableId'});db['ServicenowAccount'][_0xd835('0x10b')](db['ServicenowConfiguration'],{'as':_0xd835('0x1af'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xd835('0xbc')][_0xd835('0x10b')](db[_0xd835('0xbe')],{'as':_0xd835('0x1b2'),'foreignKey':_0xd835('0x1b3')});db['ServicenowConfiguration']['hasMany'](db[_0xd835('0xbe')],{'as':_0xd835('0x1b5'),'foreignKey':_0xd835('0x1b9')});db[_0xd835('0xbc')]['hasMany'](db[_0xd835('0xbe')],{'as':_0xd835('0x1ac'),'foreignKey':_0xd835('0x1b6')});db[_0xd835('0xbc')]['belongsTo'](db[_0xd835('0x1c5')],{'as':_0xd835('0x163'),'foreignKey':_0xd835('0x1b0')});db[_0xd835('0xbe')][_0xd835('0x10b')](db[_0xd835('0xbe')],{'as':_0xd835('0x1b7'),'foreignKey':_0xd835('0x1b3')});db[_0xd835('0xbe')][_0xd835('0x10b')](db['ServicenowField'],{'as':'Description','foreignKey':_0xd835('0x1b9')});db[_0xd835('0xbe')][_0xd835('0x10b')](db[_0xd835('0xbe')],{'as':'Field','foreignKey':_0xd835('0x1b6')});db[_0xd835('0xbe')]['belongsTo'](db[_0xd835('0x94')],{'as':_0xd835('0x94'),'foreignKey':_0xd835('0x1bb')});db[_0xd835('0xc0')][_0xd835('0x10b')](db[_0xd835('0x1c6')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xd835('0x1b0')});db['Dynamics365Configuration'][_0xd835('0x10b')](db[_0xd835('0xc3')],{'as':_0xd835('0x1b2'),'onDelete':_0xd835('0x10a'),'foreignKey':'SubjectId'});db[_0xd835('0x1c6')][_0xd835('0x10b')](db[_0xd835('0xc3')],{'as':'Descriptions','onDelete':_0xd835('0x10a'),'foreignKey':'DescriptionId'});db[_0xd835('0x1c6')][_0xd835('0x10b')](db[_0xd835('0xc3')],{'as':_0xd835('0x1ac'),'onDelete':_0xd835('0x10a'),'foreignKey':'FieldId'});db[_0xd835('0x1c6')][_0xd835('0x11a')](db[_0xd835('0xc0')],{'as':'Account','foreignKey':_0xd835('0x1b0')});db['Dynamics365Field'][_0xd835('0x10b')](db[_0xd835('0xc3')],{'as':'Subject','foreignKey':_0xd835('0x1b3')});db[_0xd835('0xc3')]['hasMany'](db[_0xd835('0xc3')],{'as':_0xd835('0x1b8'),'foreignKey':_0xd835('0x1b9')});db[_0xd835('0xc3')][_0xd835('0x10b')](db['Dynamics365Field'],{'as':_0xd835('0x1ba'),'foreignKey':_0xd835('0x1b6')});db[_0xd835('0xc3')][_0xd835('0x11a')](db['Variable'],{'as':'Variable','foreignKey':_0xd835('0x1bb')});db[_0xd835('0xc4')][_0xd835('0x10b')](db['FreshsalesConfiguration'],{'as':_0xd835('0x1af'),'onDelete':_0xd835('0x10a'),'foreignKey':'AccountId'});db[_0xd835('0x1c7')][_0xd835('0x10b')](db[_0xd835('0xc7')],{'as':_0xd835('0x1b2'),'foreignKey':_0xd835('0x1b3')});db[_0xd835('0x1c7')]['hasMany'](db[_0xd835('0xc7')],{'as':_0xd835('0x1b5'),'foreignKey':'DescriptionId'});db[_0xd835('0x1c7')][_0xd835('0x10b')](db[_0xd835('0xc7')],{'as':'Fields','foreignKey':_0xd835('0x1b6')});db[_0xd835('0x1c7')][_0xd835('0x11a')](db[_0xd835('0xc4')],{'as':_0xd835('0x163'),'foreignKey':_0xd835('0x1b0')});db['FreshsalesField'][_0xd835('0x10b')](db['FreshsalesField'],{'as':_0xd835('0x1b7'),'foreignKey':_0xd835('0x1b3')});db[_0xd835('0xc7')][_0xd835('0x10b')](db[_0xd835('0xc7')],{'as':_0xd835('0x1b8'),'foreignKey':'DescriptionId'});db['FreshsalesField'][_0xd835('0x10b')](db['FreshsalesField'],{'as':_0xd835('0x1ba'),'foreignKey':_0xd835('0x1b6')});db[_0xd835('0xc7')][_0xd835('0x11a')](db[_0xd835('0x94')],{'as':_0xd835('0x94'),'foreignKey':_0xd835('0x1bb')});db['ChatQueueReport']['belongsTo'](db[_0xd835('0x63')],{});db[_0xd835('0xcb')][_0xd835('0x11a')](db[_0xd835('0xf0')],{'as':_0xd835('0x15c'),'foreignKey':_0xd835('0x15d')});db[_0xd835('0xcb')][_0xd835('0x11a')](db[_0xd835('0x11e')],{'as':_0xd835('0x153'),'foreignKey':_0xd835('0x154')});db[_0xd835('0xcb')][_0xd835('0x11a')](db[_0xd835('0x114')],{});db[_0xd835('0xcb')][_0xd835('0x11a')](db[_0xd835('0x18d')],{});db[_0xd835('0xcb')][_0xd835('0x11a')](db[_0xd835('0x12')],{});db['ChatQueueReport'][_0xd835('0x11a')](db[_0xd835('0x6d')],{});db[_0xd835('0xcd')][_0xd835('0x11a')](db['User'],{'onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x1c8')});db[_0xd835('0xcd')][_0xd835('0x11a')](db[_0xd835('0x12')],{'onDelete':_0xd835('0x10a'),'foreignKey':'ToId'});db['JscriptySessionReport'][_0xd835('0x10b')](db[_0xd835('0xd1')],{'foreignKey':_0xd835('0x1c9'),'onDelete':_0xd835('0x10a')});db[_0xd835('0xd3')][_0xd835('0x10b')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xd835('0xd4')]['belongsTo'](db[_0xd835('0x136')],{});db[_0xd835('0xd4')]['belongsTo'](db[_0xd835('0xf0')],{'as':_0xd835('0x15c'),'foreignKey':_0xd835('0x15d')});db['SmsQueueReport']['belongsTo'](db[_0xd835('0x11e')],{'as':_0xd835('0x153'),'foreignKey':_0xd835('0x154')});db['SmsQueueReport']['belongsTo'](db[_0xd835('0x57')],{});db['SmsQueueReport']['belongsTo'](db[_0xd835('0x17e')],{});db[_0xd835('0xd4')]['belongsTo'](db['User'],{});db[_0xd835('0xd4')][_0xd835('0x11a')](db[_0xd835('0x59')],{});db['JscriptyProject']['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0xd835('0x1ca')});db[_0xd835('0xd8')][_0xd835('0x10b')](db['JscriptyQuestionReport'],{'foreignKey':_0xd835('0x1ca')});db[_0xd835('0xd8')][_0xd835('0x10b')](db[_0xd835('0xcf')],{'foreignKey':_0xd835('0x1ca')});db[_0xd835('0x139')][_0xd835('0x11c')](db['User'],{'as':_0xd835('0x167'),'through':'user_has_square_projects'});db['Team'][_0xd835('0x11c')](db['User'],{'as':_0xd835('0x160'),'through':_0xd835('0x123')});db[_0xd835('0xe1')]['belongsToMany'](db[_0xd835('0x127')],{'through':_0xd835('0x14b'),'as':_0xd835('0x1cb')});db[_0xd835('0xe1')]['belongsToMany'](db[_0xd835('0x3e')],{'through':_0xd835('0x161'),'as':_0xd835('0x128')});db[_0xd835('0xe1')][_0xd835('0x11c')](db[_0xd835('0x6d')],{'through':_0xd835('0x191'),'as':_0xd835('0x129')});db[_0xd835('0xe1')][_0xd835('0x11c')](db['FaxQueue'],{'through':_0xd835('0x17a'),'as':_0xd835('0x12a')});db['Team'][_0xd835('0x11c')](db[_0xd835('0x59')],{'through':_0xd835('0x182'),'as':_0xd835('0x12c')});db[_0xd835('0xe1')][_0xd835('0x11c')](db[_0xd835('0x62')],{'through':'team_has_openchannel_queues','as':_0xd835('0x12d')});db[_0xd835('0xe1')][_0xd835('0x11c')](db[_0xd835('0x103')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0xd835('0xe5')][_0xd835('0x10b')](db[_0xd835('0x142')],{'as':_0xd835('0x143'),'foreignKey':_0xd835('0x196')});db[_0xd835('0xe5')][_0xd835('0x10b')](db[_0xd835('0x110')],{'as':_0xd835('0x111'),'foreignKey':_0xd835('0x196')});db[_0xd835('0xe5')][_0xd835('0x10b')](db[_0xd835('0x79')],{'as':'HopperHistories','foreignKey':_0xd835('0x196')});db[_0xd835('0xe5')][_0xd835('0x10b')](db[_0xd835('0x76')],{'as':_0xd835('0x145'),'foreignKey':_0xd835('0x196')});db['Campaign'][_0xd835('0x11a')](db[_0xd835('0x27')],{'as':_0xd835('0x27'),'foreignKey':_0xd835('0x1cc')});db[_0xd835('0xe5')]['belongsTo'](db[_0xd835('0x27')],{'as':_0xd835('0x147'),'foreignKey':'TrunkBackupId'});db[_0xd835('0xe5')][_0xd835('0x11a')](db['Interval'],{'as':_0xd835('0x85'),'foreignKey':_0xd835('0x149')});db[_0xd835('0xe5')][_0xd835('0x11a')](db['SquareProject'],{'as':_0xd835('0x139'),'foreignKey':_0xd835('0x1cd')});db[_0xd835('0xe5')][_0xd835('0x11c')](db[_0xd835('0xf0')],{'as':_0xd835('0x121'),'through':_0xd835('0x1ce')});db[_0xd835('0xe5')][_0xd835('0x11c')](db['CmList'],{'as':'BlackLists','through':_0xd835('0x1cf')});db['Attachment']['belongsTo'](db[_0xd835('0x6b')],{'as':_0xd835('0x6b'),'foreignKey':_0xd835('0x16c')});db[_0xd835('0xea')][_0xd835('0x11a')](db['MailMessage'],{});db[_0xd835('0xea')]['belongsTo'](db['MailInteraction'],{});db[_0xd835('0xea')]['belongsTo'](db[_0xd835('0x3c')],{'foreignKey':_0xd835('0x1d0'),'as':'FromAccount'});db[_0xd835('0xea')][_0xd835('0x11a')](db[_0xd835('0x12')],{'foreignKey':_0xd835('0x1d1'),'as':'FromAgent'});db[_0xd835('0xea')]['belongsTo'](db[_0xd835('0x12')],{'foreignKey':_0xd835('0x1d2'),'as':_0xd835('0x1d3')});db['MailTransferReport'][_0xd835('0x11a')](db[_0xd835('0x3e')],{'foreignKey':_0xd835('0x1d4'),'as':_0xd835('0x1d5')});db[_0xd835('0xea')][_0xd835('0x11a')](db[_0xd835('0x3c')],{'foreignKey':_0xd835('0x1d6'),'as':_0xd835('0x1d7')});db[_0xd835('0x1d8')]['belongsTo'](db[_0xd835('0x18d')],{});db['ChatTransferReport']['belongsTo'](db[_0xd835('0x114')],{});db[_0xd835('0x1d8')][_0xd835('0x11a')](db[_0xd835('0x63')],{'foreignKey':_0xd835('0x1d9'),'as':_0xd835('0x1da')});db[_0xd835('0x1d8')][_0xd835('0x11a')](db['User'],{'foreignKey':_0xd835('0x1d1'),'as':'FromAgent'});db[_0xd835('0x1d8')][_0xd835('0x11a')](db[_0xd835('0x12')],{'foreignKey':_0xd835('0x1d2'),'as':_0xd835('0x1d3')});db[_0xd835('0x1d8')][_0xd835('0x11a')](db[_0xd835('0x6d')],{'foreignKey':_0xd835('0x1db'),'as':_0xd835('0x1d5')});db['ChatTransferReport'][_0xd835('0x11a')](db[_0xd835('0x63')],{'foreignKey':'ToChatWebsiteId','as':_0xd835('0x1d7')});db[_0xd835('0xec')][_0xd835('0x11a')](db[_0xd835('0x50')],{});db[_0xd835('0xec')]['belongsTo'](db[_0xd835('0x4e')],{});db[_0xd835('0xec')][_0xd835('0x11a')](db[_0xd835('0x16f')],{'foreignKey':_0xd835('0x1dc'),'as':_0xd835('0x1da')});db[_0xd835('0xec')][_0xd835('0x11a')](db[_0xd835('0x12')],{'foreignKey':_0xd835('0x1d1'),'as':_0xd835('0x1dd')});db[_0xd835('0xec')][_0xd835('0x11a')](db['User'],{'foreignKey':_0xd835('0x1d2'),'as':_0xd835('0x1d3')});db[_0xd835('0xec')]['belongsTo'](db[_0xd835('0x173')],{'foreignKey':_0xd835('0x1de'),'as':_0xd835('0x1d5')});db[_0xd835('0xec')][_0xd835('0x11a')](db[_0xd835('0x16f')],{'foreignKey':_0xd835('0x1df'),'as':_0xd835('0x1d7')});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelMessage'],{});db[_0xd835('0xed')][_0xd835('0x11a')](db[_0xd835('0x113')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0xd835('0x5b')],{'foreignKey':_0xd835('0x1e0'),'as':_0xd835('0x1da')});db[_0xd835('0xed')][_0xd835('0x11a')](db[_0xd835('0x12')],{'foreignKey':'FromUserId','as':_0xd835('0x1dd')});db[_0xd835('0xed')][_0xd835('0x11a')](db[_0xd835('0x12')],{'foreignKey':_0xd835('0x1d2'),'as':'ToAgent'});db[_0xd835('0xed')][_0xd835('0x11a')](db[_0xd835('0x62')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db['OpenchannelTransferReport']['belongsTo'](db[_0xd835('0x5b')],{'foreignKey':_0xd835('0x1e1'),'as':'ToAccount'});db['SmsTransferReport'][_0xd835('0x11a')](db[_0xd835('0x17e')],{});db[_0xd835('0xee')][_0xd835('0x11a')](db[_0xd835('0x57')],{});db[_0xd835('0xee')][_0xd835('0x11a')](db[_0xd835('0x136')],{'foreignKey':_0xd835('0x1e2'),'as':_0xd835('0x1da')});db[_0xd835('0xee')][_0xd835('0x11a')](db[_0xd835('0x12')],{'foreignKey':_0xd835('0x1d1'),'as':_0xd835('0x1dd')});db['SmsTransferReport'][_0xd835('0x11a')](db[_0xd835('0x12')],{'foreignKey':_0xd835('0x1d2'),'as':_0xd835('0x1d3')});db[_0xd835('0xee')][_0xd835('0x11a')](db[_0xd835('0x59')],{'foreignKey':'ToSmsQueueId','as':_0xd835('0x1d5')});db[_0xd835('0xee')][_0xd835('0x11a')](db['SmsAccount'],{'foreignKey':_0xd835('0x1e3'),'as':_0xd835('0x1d7')});db[_0xd835('0xf0')][_0xd835('0x10b')](db[_0xd835('0x170')],{'as':_0xd835('0x158'),'foreignKey':'ListId','onDelete':_0xd835('0x10a')});db[_0xd835('0xf0')]['hasMany'](db[_0xd835('0x7c')],{'as':_0xd835('0x1e4'),'foreignKey':_0xd835('0x15d')});db['CmList']['hasMany'](db[_0xd835('0x11e')],{'as':_0xd835('0x11f'),'onDelete':_0xd835('0x10a'),'foreignKey':_0xd835('0x15d')});db['CmList']['hasMany'](db[_0xd835('0x110')],{'as':_0xd835('0x111'),'foreignKey':_0xd835('0x15d')});db['CmList'][_0xd835('0x10b')](db[_0xd835('0x79')],{'as':_0xd835('0x112'),'foreignKey':_0xd835('0x15d')});db['CmList']['hasMany'](db[_0xd835('0x7a')],{'as':_0xd835('0x7a'),'foreignKey':'ListId'});db[_0xd835('0xf0')]['belongsToMany'](db[_0xd835('0x127')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db['CmList'][_0xd835('0x11c')](db[_0xd835('0x12')],{'as':_0xd835('0x160'),'through':_0xd835('0x122')});db[_0xd835('0xf2')][_0xd835('0x10b')](db[_0xd835('0x19')],{'as':_0xd835('0x10f'),'onDelete':'cascade'});db[_0xd835('0xf2')]['belongsToMany'](db[_0xd835('0x12')],{'as':_0xd835('0x160'),'through':_0xd835('0x12f')});db[_0xd835('0xf4')]['hasMany'](db[_0xd835('0x12')],{'as':_0xd835('0x167'),'foreignKey':_0xd835('0x11b')});db[_0xd835('0xf4')]['hasMany'](db[_0xd835('0xf6')],{'as':'UserProfileSections','foreignKey':_0xd835('0x11b'),'onDelete':_0xd835('0x10a')});db['UserProfileSection'][_0xd835('0x10b')](db[_0xd835('0xf7')],{'as':'Resources','foreignKey':_0xd835('0x1e5'),'onDelete':_0xd835('0x10a')});db['WhatsappAccount']['hasMany'](db[_0xd835('0x170')],{'as':_0xd835('0x158'),'foreignKey':_0xd835('0x1e6'),'onDelete':_0xd835('0x10a')});db['WhatsappAccount'][_0xd835('0x10b')](db[_0xd835('0x159')],{'as':_0xd835('0x15a'),'foreignKey':_0xd835('0x1e6')});db[_0xd835('0xfa')][_0xd835('0x10b')](db[_0xd835('0xfe')],{'as':_0xd835('0x14d'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0xd835('0x10b')](db[_0xd835('0xfc')],{'as':_0xd835('0x15b')});db[_0xd835('0xfa')]['hasMany'](db[_0xd835('0x1e7')],{'as':_0xd835('0x17d')});db[_0xd835('0xfa')][_0xd835('0x11a')](db['CmList'],{'as':_0xd835('0x15c'),'foreignKey':_0xd835('0x15d')});db[_0xd835('0xfa')]['belongsTo'](db['Pause'],{'as':_0xd835('0x14a'),'foreignKey':_0xd835('0x172')});db[_0xd835('0xfa')][_0xd835('0x11c')](db[_0xd835('0x12')],{'as':'Agents','through':'user_has_whatsapp_accounts'});db[_0xd835('0x1e7')]['belongsTo'](db[_0xd835('0x12')],{'onDelete':'restrict'});db[_0xd835('0x1e7')]['belongsTo'](db[_0xd835('0x103')],{'onDelete':_0xd835('0x16d')});db[_0xd835('0x1e7')][_0xd835('0x11a')](db[_0xd835('0xfa')],{'onDelete':_0xd835('0x16d')});db[_0xd835('0x1e7')][_0xd835('0x11a')](db[_0xd835('0x85')],{'onDelete':_0xd835('0x16d'),'foreignKey':_0xd835('0x149')});db[_0xd835('0x1e7')][_0xd835('0x11a')](db[_0xd835('0x8e')],{'onDelete':'restrict','foreignKey':_0xd835('0x174')});db[_0xd835('0xfc')]['hasMany'](db[_0xd835('0xfe')],{'as':'Messages','onDelete':_0xd835('0x10a'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0xd835('0x11a')](db[_0xd835('0xfa')],{'as':_0xd835('0x163'),'foreignKey':'WhatsappAccountId'});db[_0xd835('0xfc')]['belongsTo'](db[_0xd835('0x11e')],{'as':_0xd835('0x153'),'foreignKey':_0xd835('0x154')});db[_0xd835('0xfc')]['belongsTo'](db[_0xd835('0x12')],{'as':'Owner','foreignKey':'UserId'});db[_0xd835('0xfc')]['belongsToMany'](db['Tag'],{'through':_0xd835('0x1a8'),'as':_0xd835('0x176')});db[_0xd835('0xfc')][_0xd835('0x11c')](db['Tag'],{'through':_0xd835('0x1a8'),'as':_0xd835('0x166')});db[_0xd835('0xfc')][_0xd835('0x11c')](db[_0xd835('0x12')],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':_0xd835('0x1e8')});db[_0xd835('0xfe')][_0xd835('0x11a')](db['User'],{'as':_0xd835('0x12')});db[_0xd835('0xfe')]['belongsTo'](db[_0xd835('0x11e')],{'onDelete':_0xd835('0x10a'),'as':_0xd835('0x153')});db[_0xd835('0xfe')][_0xd835('0x11a')](db[_0xd835('0xfc')],{'onDelete':_0xd835('0x10a'),'as':_0xd835('0x178'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage']['belongsTo'](db['WhatsappAccount'],{'as':_0xd835('0x163'),'foreignKey':_0xd835('0x1e6')});db[_0xd835('0x100')][_0xd835('0x11a')](db[_0xd835('0xfa')],{});db[_0xd835('0x100')][_0xd835('0x11a')](db[_0xd835('0xf0')],{'as':'List','foreignKey':_0xd835('0x15d')});db['WhatsappQueueReport'][_0xd835('0x11a')](db[_0xd835('0x11e')],{'as':_0xd835('0x153'),'foreignKey':_0xd835('0x154')});db['WhatsappQueueReport']['belongsTo'](db[_0xd835('0xfc')],{});db[_0xd835('0x100')]['belongsTo'](db[_0xd835('0x103')],{});db[_0xd835('0x100')][_0xd835('0x11a')](db[_0xd835('0xfe')],{});db[_0xd835('0x100')][_0xd835('0x11a')](db[_0xd835('0x12')],{});db[_0xd835('0x102')][_0xd835('0x11a')](db[_0xd835('0xfe')],{});db[_0xd835('0x102')][_0xd835('0x11a')](db[_0xd835('0xfc')],{});db['WhatsappTransferReport'][_0xd835('0x11a')](db[_0xd835('0xfa')],{'foreignKey':_0xd835('0x1e9'),'as':_0xd835('0x1da')});db[_0xd835('0x102')][_0xd835('0x11a')](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db['WhatsappTransferReport']['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0xd835('0x1ea'),'as':_0xd835('0x1d5')});db['WhatsappTransferReport'][_0xd835('0x11a')](db['User'],{'foreignKey':_0xd835('0x1d1'),'as':_0xd835('0x1dd')});db[_0xd835('0x102')][_0xd835('0x11a')](db[_0xd835('0x12')],{'foreignKey':'ToUserId','as':_0xd835('0x1d3')});db[_0xd835('0x103')][_0xd835('0x11c')](db[_0xd835('0x12')],{'as':_0xd835('0x160'),'through':_0xd835('0x36'),'foreignKey':_0xd835('0x1eb')});db[_0xd835('0x103')][_0xd835('0x11c')](db['Team'],{'through':_0xd835('0x1ec'),'as':_0xd835('0x17b')});module[_0xd835('0x1ed')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xb552=['FreshdeskAccount','FreshdeskConfiguration','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','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../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','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','hasOne','cascade','hasMany','Recordings','UserId','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteraction','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','belongsTo','Groups','chat_group_has_users','belongsToMany','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueue','FaxQueues','UserFaxQueue','SmsQueues','WhatsappQueues','VoicePrefix','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','IntervalId','Pause','mandatoryDispositionPause','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','Imap','Dispositions','Interactions','Applications','List','ListId','Template','TemplateId','Agents','team_has_mail_queues','MailInteractionId','Tags','mail_interaction_has_tags','ThroughTags','Users','Interaction','Account','ChatWebsiteId','ChatOfflineMessageId','restrict','Items','FaxAccountId','mandatoryDispositionPauseId','user_has_fax_accounts','FaxInteractionId','Owner','Attachment','AttachmentId','team_has_fax_queues','FaxQueueReport','Answers','SmsAccountId','SmsMessage','TagId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','team_has_openchannel_queues','ProactiveActions','OpenchannelQueueReport','Queue','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','Contacts','CompanyId','Hoppers','ChatInteractions','CmCompany','Company','cm_contact_has_tags','Agent','Campaign','CampaignId','OwnerId','All','OneAll','Any','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','DefaultReportId','Mohs','fax_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','CustomReportId','Fields','MetricId','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','VariableId','SugarcrmAccount','Field','DeskConfiguration','int_desk_configuration_has_tags','Description','int_zendesk_configuration_has_tags','ChatQueueReport','FromId','SessionId','ProjectId','ChatQueues','OpenchannelQueues','WhatsappQueue','SquareProjectId','campaigns_has_cm_lists','FromAccount','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToAccount','FromAgent','ToChatQueueId','FromFaxAccountId','ToFaxQueueId','ToQueue','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','userProfileId','UserProfileSection','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','exports','../config/environment','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','database','options','sequelizeHistory','username','password','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','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','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','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','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/pause/pause.model','Cdr','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','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','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xb552,0x133));var _0x2b55=function(_0x1e7548,_0x5da5a4){_0x1e7548=_0x1e7548-0x0;var _0x48c3ec=_0xb552[_0x1e7548];return _0x48c3ec;};'use strict';var config=require(_0x2b55('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0x2b55('0x1'));var timezone=jstz[_0x2b55('0x2')]();config[_0x2b55('0x3')]=_[_0x2b55('0x4')](config[_0x2b55('0x3')],{'database':_0x2b55('0x5'),'username':_0x2b55('0x6'),'password':_0x2b55('0x7'),'options':{'host':_0x2b55('0x8'),'port':0xcea,'dialect':_0x2b55('0x9'),'dialectOptions':{'charset':_0x2b55('0xa')},'logging':![],'timezone':timezone[_0x2b55('0xb')](),'define':{'charset':'utf8','collate':_0x2b55('0xc')}}});config['sequelizeHistory']=_[_0x2b55('0x4')](config['sequelizeHistory'],{'database':_0x2b55('0x5'),'username':_0x2b55('0x6'),'password':_0x2b55('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x2b55('0x9'),'dialectOptions':{'charset':_0x2b55('0xa')},'logging':![],'timezone':timezone[_0x2b55('0xb')](),'define':{'charset':'utf8','collate':_0x2b55('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2b55('0x3')][_0x2b55('0xd')],config['sequelize']['username'],config[_0x2b55('0x3')]['password'],config['sequelize'][_0x2b55('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2b55('0xf')][_0x2b55('0xd')],config[_0x2b55('0xf')][_0x2b55('0x10')],config[_0x2b55('0xf')][_0x2b55('0x11')],config[_0x2b55('0xf')][_0x2b55('0xe')])};db[_0x2b55('0x12')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x14'));db['VoiceChanSpy']=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x15'));db[_0x2b55('0x16')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x17'));db[_0x2b55('0x18')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x19'));db['VoiceMusicOnHold']=db[_0x2b55('0x3')]['import'](_0x2b55('0x1a'));db[_0x2b55('0x1b')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x1c'));db[_0x2b55('0x1d')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x1e'));db[_0x2b55('0x1f')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x20'));db[_0x2b55('0x21')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x22'));db[_0x2b55('0x23')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x24'));db[_0x2b55('0x25')]=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/voiceCallReport/voiceCallReport.model');db[_0x2b55('0x26')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x27'));db[_0x2b55('0x28')]=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x29'));db[_0x2b55('0x2a')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x2b'));db[_0x2b55('0x2c')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x2d'));db[_0x2b55('0x2e')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x2f'));db[_0x2b55('0x30')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x31'));db[_0x2b55('0x32')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x33'));db[_0x2b55('0x34')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x35'));db[_0x2b55('0x36')]=db[_0x2b55('0x3')]['import']('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x37'));db[_0x2b55('0x38')]=db[_0x2b55('0x3')]['import'](_0x2b55('0x39'));db[_0x2b55('0x3a')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x3b'));db[_0x2b55('0x3c')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x3d'));db[_0x2b55('0x3e')]=db[_0x2b55('0x3')]['import']('../api/mailServerIn/mailServerIn.model');db[_0x2b55('0x3f')]=db[_0x2b55('0x3')]['import'](_0x2b55('0x40'));db[_0x2b55('0x41')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x42'));db['MailQueue']=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/mailQueue/mailQueue.model');db[_0x2b55('0x43')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x44'));db[_0x2b55('0x45')]=db[_0x2b55('0x3')]['import']('../api/mailInteraction/mailInteraction.model');db[_0x2b55('0x46')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x47'));db[_0x2b55('0x48')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x49'));db[_0x2b55('0x4a')]=db[_0x2b55('0x3')]['import'](_0x2b55('0x4b'));db[_0x2b55('0x4c')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x4d'));db[_0x2b55('0x4e')]=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/dashboardItem/dashboardItem.model');db[_0x2b55('0x4f')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x50'));db[_0x2b55('0x51')]=db['sequelize'][_0x2b55('0x13')]('../api/faxApplication/faxApplication.model');db[_0x2b55('0x52')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x53'));db[_0x2b55('0x54')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x55'));db[_0x2b55('0x56')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x57'));db['FaxQueueReport']=db['sequelize']['import'](_0x2b55('0x58'));db[_0x2b55('0x59')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x5a'));db[_0x2b55('0x5b')]=db[_0x2b55('0x3')]['import'](_0x2b55('0x5c'));db[_0x2b55('0x5d')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x5e'));db['SmsMessage']=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x5f'));db[_0x2b55('0x60')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x61'));db[_0x2b55('0x62')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x63'));db[_0x2b55('0x64')]=db[_0x2b55('0x3')]['import'](_0x2b55('0x65'));db[_0x2b55('0x66')]=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x2b55('0x67')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x68'));db[_0x2b55('0x69')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x6a'));db[_0x2b55('0x6b')]=db[_0x2b55('0x3')]['import'](_0x2b55('0x6c'));db['OpenchannelQueueReport']=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x2b55('0x6d')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x6e'));db['ChatInteraction']=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x6f'));db[_0x2b55('0x70')]=db[_0x2b55('0x3')]['import']('../api/chatMessage/chatMessage.model');db[_0x2b55('0x71')]=db[_0x2b55('0x3')]['import'](_0x2b55('0x72'));db[_0x2b55('0x73')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x74'));db[_0x2b55('0x75')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x76'));db[_0x2b55('0x77')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x78'));db['CmCompany']=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x79'));db[_0x2b55('0x7a')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x7b'));db[_0x2b55('0x7c')]=db[_0x2b55('0x3')]['import']('../api/cmHopper/cmHopper.model');db[_0x2b55('0x7d')]=db[_0x2b55('0x3')]['import'](_0x2b55('0x7e'));db[_0x2b55('0x7f')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x80'));db[_0x2b55('0x81')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x82'));db[_0x2b55('0x83')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x84'));db[_0x2b55('0x85')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x86'));db[_0x2b55('0x87')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x88'));db[_0x2b55('0x89')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x8a'));db[_0x2b55('0x8b')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x8c'));db[_0x2b55('0x8d')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x8e'));db[_0x2b55('0x8f')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x90'));db[_0x2b55('0x91')]=db[_0x2b55('0x3')]['import']('../api/interval/interval.model');db['Pause']=db[_0x2b55('0x3')]['import'](_0x2b55('0x92'));db[_0x2b55('0x93')]=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/cdr/cdr.model');db[_0x2b55('0x94')]=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x2b55('0x95')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x96'));db[_0x2b55('0x97')]=db[_0x2b55('0x3')]['import'](_0x2b55('0x98'));db[_0x2b55('0x99')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x9a'));db['Template']=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/template/template.model');db[_0x2b55('0x9b')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x9c'));db[_0x2b55('0x9d')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x9e'));db['Integration']=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x9f'));db['IntegrationReport']=db[_0x2b55('0x3')]['import']('../api/integrationReport/integrationReport.model');db[_0x2b55('0xa0')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xa1'));db[_0x2b55('0xa2')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xa3'));db['AnalyticExtractedReport']=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xa4'));db[_0x2b55('0xa5')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xa6'));db[_0x2b55('0xa7')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xa8'));db[_0x2b55('0xa9')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xaa'));db[_0x2b55('0xab')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xac'));db['SalesforceConfiguration']=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xad'));db[_0x2b55('0xae')]=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db[_0x2b55('0x3')]['import'](_0x2b55('0xaf'));db[_0x2b55('0xb0')]=db[_0x2b55('0x3')]['import'](_0x2b55('0xb1'));db[_0x2b55('0xb2')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xb3'));db[_0x2b55('0xb4')]=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db[_0x2b55('0x3')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x2b55('0xb5')]=db['sequelize'][_0x2b55('0x13')]('../api/intDeskField/intDeskField.model');db[_0x2b55('0xb6')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0xb7'));db[_0x2b55('0xb8')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xb9'));db[_0x2b55('0xba')]=db[_0x2b55('0x3')]['import'](_0x2b55('0xbb'));db[_0x2b55('0xbc')]=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x2b55('0xbd')]=db[_0x2b55('0x3')]['import'](_0x2b55('0xbe'));db[_0x2b55('0xbf')]=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/intZendeskField/intZendeskField.model');db[_0x2b55('0xc0')]=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x2b55('0xc1')]=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x2b55('0xc2')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xc3'));db[_0x2b55('0xc4')]=db[_0x2b55('0x3')]['import'](_0x2b55('0xc5'));db[_0x2b55('0xc6')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0xc7'));db[_0x2b55('0xc8')]=db[_0x2b55('0x3')]['import'](_0x2b55('0xc9'));db[_0x2b55('0xca')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xcb'));db[_0x2b55('0xcc')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xcd'));db[_0x2b55('0xce')]=db[_0x2b55('0x3')]['import'](_0x2b55('0xcf'));db[_0x2b55('0xd0')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xd1'));db[_0x2b55('0xd2')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xd3'));db[_0x2b55('0xd4')]=db[_0x2b55('0x3')]['import'](_0x2b55('0xd5'));db[_0x2b55('0xd6')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xd7'));db[_0x2b55('0xd8')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xd9'));db[_0x2b55('0xda')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0xdb'));db['Integration']=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x9f'));db['Network']=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xdc'));db['ChatQueueReport']=db['sequelize'][_0x2b55('0x13')](_0x2b55('0xdd'));db[_0x2b55('0xde')]=db['sequelize'][_0x2b55('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x2b55('0xdf')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xe0'));db[_0x2b55('0xe1')]=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x2b55('0xe2')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0xe3'));db[_0x2b55('0xe4')]=db[_0x2b55('0x3')]['import'](_0x2b55('0xe5'));db[_0x2b55('0xe6')]=db[_0x2b55('0x3')]['import'](_0x2b55('0xe7'));db[_0x2b55('0xe8')]=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/squareReportDetail/squareReportDetail.model');db[_0x2b55('0xe9')]=db['sequelize'][_0x2b55('0x13')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0x2b55('0x3')]['import'](_0x2b55('0xea'));db[_0x2b55('0xeb')]=db[_0x2b55('0x3')]['import'](_0x2b55('0xec'));db[_0x2b55('0xed')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0xee'));db[_0x2b55('0xef')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xf0'));db[_0x2b55('0xf1')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xf2'));db[_0x2b55('0xf3')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xf4'));db[_0x2b55('0xf5')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xf6'));db['Campaign']=db[_0x2b55('0x3')]['import'](_0x2b55('0xf7'));db['Migration']=db['sequelize'][_0x2b55('0x13')](_0x2b55('0xf8'));db['Attachment']=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xf9'));db[_0x2b55('0xfa')]=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/plugin/plugin.model');db[_0x2b55('0xfb')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0xfc'));db[_0x2b55('0xfd')]=db['sequelize']['import'](_0x2b55('0xfe'));db[_0x2b55('0xff')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x100'));db[_0x2b55('0x101')]=db[_0x2b55('0x3')]['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x2b55('0x102')]=db[_0x2b55('0x3')][_0x2b55('0x13')]('../api/smsTransferReport/smsTransferReport.model');db[_0x2b55('0x103')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x104'));db['VoicePrefix']=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x105'));db[_0x2b55('0x106')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x107'));db['UserProfileSection']=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x108'));db[_0x2b55('0x109')]=db['sequelize'][_0x2b55('0x13')]('../api/userProfileResource/userProfileResource.model');db[_0x2b55('0x10a')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x10b'));db[_0x2b55('0x10c')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x10d'));db[_0x2b55('0x10e')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x10f'));db['WhatsappInteraction']=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x110'));db[_0x2b55('0x111')]=db[_0x2b55('0x3')]['import'](_0x2b55('0x112'));db['WhatsappQueueReport']=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x113'));db[_0x2b55('0x114')]=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x115'));db['WhatsappQueue']=db[_0x2b55('0x3')][_0x2b55('0x13')](_0x2b55('0x116'));db[_0x2b55('0x117')]=db['sequelize'][_0x2b55('0x13')](_0x2b55('0x118'));db[_0x2b55('0x119')]=db['sequelize']['import'](_0x2b55('0x11a'));db[_0x2b55('0x12')][_0x2b55('0x11b')](db[_0x2b55('0x21')],{'as':_0x2b55('0x21'),'onDelete':_0x2b55('0x11c'),'foreignKey':'UserId'});db['User'][_0x2b55('0x11d')](db[_0x2b55('0x1d')],{'as':_0x2b55('0x11e'),'foreignKey':_0x2b55('0x11f')});db[_0x2b55('0x12')][_0x2b55('0x11d')](db['UserVoiceQueueRt'],{'as':_0x2b55('0x120'),'foreignKey':'UserId'});db[_0x2b55('0x12')]['hasMany'](db['VoiceExtension'],{'as':_0x2b55('0x121'),'onDelete':_0x2b55('0x11c'),'hooks':!![]});db[_0x2b55('0x12')]['hasMany'](db[_0x2b55('0x7f')],{'as':_0x2b55('0x122'),'foreignKey':'UserId'});db[_0x2b55('0x12')][_0x2b55('0x11d')](db[_0x2b55('0x81')],{'as':_0x2b55('0x123'),'foreignKey':_0x2b55('0x11f')});db[_0x2b55('0x12')][_0x2b55('0x11d')](db[_0x2b55('0x83')],{'as':_0x2b55('0x83'),'foreignKey':_0x2b55('0x11f')});db['User'][_0x2b55('0x11d')](db['OpenchannelInteraction'],{'as':_0x2b55('0x124'),'foreignKey':_0x2b55('0x11f')});db[_0x2b55('0x12')][_0x2b55('0x11d')](db[_0x2b55('0x125')],{'as':'ChatInteractions','foreignKey':_0x2b55('0x11f')});db[_0x2b55('0x12')][_0x2b55('0x11d')](db['SmsInteraction'],{'as':_0x2b55('0x126'),'foreignKey':_0x2b55('0x11f')});db[_0x2b55('0x12')][_0x2b55('0x11d')](db[_0x2b55('0x52')],{'as':_0x2b55('0x127'),'foreignKey':_0x2b55('0x11f')});db[_0x2b55('0x12')]['hasMany'](db[_0x2b55('0x45')],{'as':_0x2b55('0x128'),'foreignKey':_0x2b55('0x11f')});db[_0x2b55('0x12')][_0x2b55('0x11d')](db[_0x2b55('0x129')],{'as':_0x2b55('0x12a'),'foreignKey':_0x2b55('0x11f')});db[_0x2b55('0x12')][_0x2b55('0x11d')](db[_0x2b55('0x10a')],{'as':_0x2b55('0x12b'),'foreignKey':'SenderId'});db[_0x2b55('0x12')][_0x2b55('0x12c')](db[_0x2b55('0x106')],{'as':_0x2b55('0x106'),'foreignKey':'userProfileId'});db[_0x2b55('0x12')]['belongsToMany'](db[_0x2b55('0x75')],{'as':_0x2b55('0x12d'),'through':_0x2b55('0x12e')});db[_0x2b55('0x12')][_0x2b55('0x12f')](db[_0x2b55('0x7a')],{'as':'Contacts','through':_0x2b55('0x130')});db['User'][_0x2b55('0x12f')](db['CmList'],{'as':_0x2b55('0x131'),'through':_0x2b55('0x132')});db[_0x2b55('0x12')][_0x2b55('0x12f')](db[_0x2b55('0xf3')],{'through':_0x2b55('0x133')});db[_0x2b55('0x12')]['belongsToMany'](db[_0x2b55('0x45')],{'as':'MailInteractions','through':_0x2b55('0x134')});db[_0x2b55('0x12')][_0x2b55('0x12f')](db['ChatInteraction'],{'as':'ChatInteractions','through':_0x2b55('0x135')});db['User'][_0x2b55('0x12f')](db[_0x2b55('0x52')],{'as':_0x2b55('0x127'),'through':'user_has_fax_interactions'});db[_0x2b55('0x12')][_0x2b55('0x12f')](db[_0x2b55('0x5d')],{'as':_0x2b55('0x126'),'through':_0x2b55('0x136')});db[_0x2b55('0x12')][_0x2b55('0x12f')](db[_0x2b55('0x66')],{'as':_0x2b55('0x124'),'through':_0x2b55('0x137')});db[_0x2b55('0x12')][_0x2b55('0x12f')](db[_0x2b55('0x129')],{'as':_0x2b55('0x12a'),'through':_0x2b55('0x138')});db['User']['belongsToMany'](db[_0x2b55('0x1b')],{'as':_0x2b55('0x139'),'through':_0x2b55('0x32'),'required':![]});db[_0x2b55('0x12')][_0x2b55('0x12f')](db[_0x2b55('0x13a')],{'as':'MailQueues','through':_0x2b55('0x36'),'required':![]});db[_0x2b55('0x12')][_0x2b55('0x12f')](db['ChatQueue'],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0x2b55('0x12')][_0x2b55('0x12f')](db[_0x2b55('0x56')],{'as':_0x2b55('0x13b'),'through':_0x2b55('0x13c'),'required':![]});db[_0x2b55('0x12')][_0x2b55('0x12f')](db['SmsQueue'],{'as':_0x2b55('0x13d'),'through':_0x2b55('0x38'),'required':![]});db[_0x2b55('0x12')][_0x2b55('0x12f')](db[_0x2b55('0x69')],{'as':'OpenchannelQueues','through':_0x2b55('0x3a'),'required':![]});db[_0x2b55('0x12')][_0x2b55('0x12f')](db['WhatsappQueue'],{'as':_0x2b55('0x13e'),'through':'UserWhatsappQueue','required':![]});db[_0x2b55('0x12')][_0x2b55('0x12f')](db[_0x2b55('0x103')],{'through':'cm_user_has_lists'});db[_0x2b55('0x12')][_0x2b55('0x12f')](db[_0x2b55('0x13f')],{'as':_0x2b55('0x140'),'through':_0x2b55('0x141'),'required':![]});db[_0x2b55('0x12')][_0x2b55('0x12f')](db[_0x2b55('0x6b')],{'as':_0x2b55('0x142'),'through':_0x2b55('0x143')});db[_0x2b55('0x12')]['belongsToMany'](db[_0x2b55('0x4f')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0x2b55('0x12')][_0x2b55('0x12f')](db[_0x2b55('0x41')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0x2b55('0x12')][_0x2b55('0x12f')](db[_0x2b55('0x62')],{'as':'OpenchannelAccounts','through':_0x2b55('0x144')});db[_0x2b55('0x12')][_0x2b55('0x12f')](db['SmsAccount'],{'as':_0x2b55('0x145'),'through':_0x2b55('0x146')});db[_0x2b55('0x12')]['belongsToMany'](db[_0x2b55('0x10c')],{'as':_0x2b55('0x147'),'through':_0x2b55('0x148')});db[_0x2b55('0x12')][_0x2b55('0x12f')](db[_0x2b55('0xed')],{'as':'SquareProjects','through':_0x2b55('0x149')});db['VoiceChanSpy']['hasMany'](db[_0x2b55('0x18')],{'as':_0x2b55('0x14a'),'onDelete':'cascade','foreignKey':_0x2b55('0x14b')});db[_0x2b55('0x16')][_0x2b55('0x11d')](db['VoiceExtension'],{'onDelete':'cascade'});db[_0x2b55('0x18')][_0x2b55('0x11d')](db['VoiceExtension'],{'as':'Applications','onDelete':_0x2b55('0x11c')});db[_0x2b55('0x14c')][_0x2b55('0x12f')](db[_0x2b55('0x97')],{'as':_0x2b55('0x14d'),'through':_0x2b55('0x14e')});db[_0x2b55('0x1b')]['hasMany'](db[_0x2b55('0x30')],{'as':_0x2b55('0x14f'),'foreignKey':_0x2b55('0x150')});db[_0x2b55('0x1b')][_0x2b55('0x11d')](db[_0x2b55('0x7c')],{'as':'Hoppers','foreignKey':_0x2b55('0x150')});db[_0x2b55('0x1b')]['hasMany'](db['CmHopperFinal'],{'as':_0x2b55('0x122'),'foreignKey':_0x2b55('0x150')});db[_0x2b55('0x1b')][_0x2b55('0x11d')](db[_0x2b55('0x81')],{'as':_0x2b55('0x151'),'foreignKey':_0x2b55('0x150')});db['VoiceQueue'][_0x2b55('0x11d')](db[_0x2b55('0x83')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0x2b55('0x1b')][_0x2b55('0x11d')](db['CmHopperBlack'],{'as':_0x2b55('0x152'),'foreignKey':'VoiceQueueId'});db[_0x2b55('0x1b')][_0x2b55('0x11d')](db[_0x2b55('0xe2')],{'as':_0x2b55('0x153'),'foreignKey':_0x2b55('0x150')});db['VoiceQueue'][_0x2b55('0x12c')](db[_0x2b55('0x2c')],{'as':_0x2b55('0x2c'),'foreignKey':_0x2b55('0x154')});db[_0x2b55('0x1b')]['belongsTo'](db[_0x2b55('0x2c')],{'as':_0x2b55('0x155'),'foreignKey':'TrunkBackupId'});db[_0x2b55('0x1b')]['belongsTo'](db[_0x2b55('0x91')],{'as':_0x2b55('0x91'),'foreignKey':_0x2b55('0x156')});db[_0x2b55('0x1b')][_0x2b55('0x12c')](db[_0x2b55('0x157')],{'as':_0x2b55('0x158'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0x2b55('0x12f')](db['CmList'],{'as':_0x2b55('0x131'),'through':'voice_queues_has_cm_lists'});db[_0x2b55('0x1b')][_0x2b55('0x12f')](db['User'],{'as':'Agents','through':_0x2b55('0x32')});db[_0x2b55('0x1b')][_0x2b55('0x12f')](db[_0x2b55('0xf3')],{'as':_0x2b55('0x159'),'through':_0x2b55('0x119')});db[_0x2b55('0x1b')][_0x2b55('0x12f')](db[_0x2b55('0x103')],{'as':_0x2b55('0x15a'),'through':_0x2b55('0x15b')});db[_0x2b55('0x1d')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'as':'User','foreignKey':_0x2b55('0x11f')});db[_0x2b55('0x1f')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'as':'User','foreignKey':_0x2b55('0x11f')});db[_0x2b55('0x21')]['hasMany'](db[_0x2b55('0x23')],{'as':_0x2b55('0x15c'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x15d'),'sourceKey':'mailbox'});db[_0x2b55('0x23')]['belongsTo'](db[_0x2b55('0x21')],{'foreignKey':'mailboxuser','targetKey':'mailbox'});db[_0x2b55('0x25')][_0x2b55('0x11d')](db[_0x2b55('0x15e')],{'as':_0x2b55('0x15f'),'foreignKey':_0x2b55('0x160'),'constraints':![]});db[_0x2b55('0x25')][_0x2b55('0x11d')](db[_0x2b55('0x28')],{'as':_0x2b55('0x161'),'foreignKey':_0x2b55('0x160'),'constraints':![]});db['VoiceCallReport'][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'as':_0x2b55('0x12'),'foreignKey':_0x2b55('0x11f')});db[_0x2b55('0x25')][_0x2b55('0x12c')](db[_0x2b55('0x7a')],{'as':_0x2b55('0x162'),'foreignKey':_0x2b55('0x163')});db['MailServerIn'][_0x2b55('0x12c')](db['MailAccount'],{'as':_0x2b55('0x41'),'foreignKey':'MailAccountId'});db[_0x2b55('0x3f')][_0x2b55('0x12c')](db['MailAccount'],{'as':_0x2b55('0x41'),'foreignKey':_0x2b55('0x164')});db[_0x2b55('0x41')][_0x2b55('0x11b')](db[_0x2b55('0x3e')],{'as':_0x2b55('0x165'),'onDelete':'cascade'});db[_0x2b55('0x41')]['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x2b55('0x11c')});db[_0x2b55('0x41')]['hasMany'](db[_0x2b55('0x8d')],{'as':_0x2b55('0x166'),'foreignKey':'MailAccountId','onDelete':_0x2b55('0x11c')});db[_0x2b55('0x41')][_0x2b55('0x11d')](db['CannedAnswer'],{'as':'Answers','foreignKey':'MailAccountId'});db[_0x2b55('0x41')][_0x2b55('0x11d')](db['MailMessage'],{'as':_0x2b55('0x15c'),'foreignKey':_0x2b55('0x164')});db[_0x2b55('0x41')]['hasMany'](db[_0x2b55('0x45')],{'as':_0x2b55('0x167')});db[_0x2b55('0x41')][_0x2b55('0x11d')](db['MailApplication'],{'as':_0x2b55('0x168')});db[_0x2b55('0x41')][_0x2b55('0x12c')](db['CmList'],{'as':_0x2b55('0x169'),'foreignKey':_0x2b55('0x16a')});db[_0x2b55('0x41')][_0x2b55('0x12c')](db[_0x2b55('0x16b')],{'as':_0x2b55('0x16b'),'foreignKey':_0x2b55('0x16c')});db[_0x2b55('0x41')][_0x2b55('0x12c')](db[_0x2b55('0x157')],{'as':_0x2b55('0x158'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x2b55('0x41')][_0x2b55('0x12f')](db[_0x2b55('0x12')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0x2b55('0x13a')][_0x2b55('0x12f')](db['User'],{'as':_0x2b55('0x16d'),'through':_0x2b55('0x36')});db[_0x2b55('0x13a')]['belongsToMany'](db['Team'],{'through':_0x2b55('0x16e'),'as':_0x2b55('0x159')});db[_0x2b55('0x45')][_0x2b55('0x11d')](db[_0x2b55('0x46')],{'as':'Messages','onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x16f')});db[_0x2b55('0x45')][_0x2b55('0x12c')](db['MailAccount'],{'as':'Account','foreignKey':_0x2b55('0x164')});db['MailInteraction'][_0x2b55('0x12c')](db[_0x2b55('0x7a')],{'as':_0x2b55('0x162'),'foreignKey':_0x2b55('0x163')});db[_0x2b55('0x45')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'as':'Owner','foreignKey':_0x2b55('0x11f')});db[_0x2b55('0x45')][_0x2b55('0x12f')](db[_0x2b55('0x99')],{'through':'mail_interaction_has_tags','as':_0x2b55('0x170')});db['MailInteraction']['belongsToMany'](db[_0x2b55('0x99')],{'through':_0x2b55('0x171'),'as':_0x2b55('0x172')});db['MailInteraction'][_0x2b55('0x12f')](db[_0x2b55('0x12')],{'as':_0x2b55('0x173'),'through':'user_has_mail_interactions','foreignKey':_0x2b55('0x16f')});db[_0x2b55('0x46')][_0x2b55('0x11d')](db['Attachment'],{'as':'Attachments','onDelete':_0x2b55('0x11c')});db[_0x2b55('0x46')][_0x2b55('0x12c')](db['User'],{'as':_0x2b55('0x12')});db[_0x2b55('0x46')]['belongsTo'](db[_0x2b55('0x7a')],{'onDelete':'cascade','as':_0x2b55('0x162')});db[_0x2b55('0x46')][_0x2b55('0x12c')](db[_0x2b55('0x45')],{'as':_0x2b55('0x174'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x2b55('0x12c')](db[_0x2b55('0x41')],{'as':_0x2b55('0x175'),'foreignKey':'MailAccountId'});db[_0x2b55('0x46')][_0x2b55('0x12c')](db['ChatWebsite'],{'as':_0x2b55('0x6b'),'foreignKey':_0x2b55('0x176')});db[_0x2b55('0x46')][_0x2b55('0x12c')](db[_0x2b55('0x71')],{'as':_0x2b55('0x71'),'foreignKey':_0x2b55('0x177')});db[_0x2b55('0x48')]['belongsTo'](db[_0x2b55('0x12')],{'onDelete':_0x2b55('0x178')});db[_0x2b55('0x48')][_0x2b55('0x12c')](db[_0x2b55('0x13a')],{'onDelete':_0x2b55('0x178')});db[_0x2b55('0x48')][_0x2b55('0x12c')](db[_0x2b55('0x41')],{'onDelete':_0x2b55('0x178')});db[_0x2b55('0x48')][_0x2b55('0x12c')](db[_0x2b55('0x91')],{'onDelete':_0x2b55('0x178'),'foreignKey':'IntervalId'});db['MailApplication'][_0x2b55('0x12c')](db[_0x2b55('0x99')],{'onDelete':_0x2b55('0x178'),'foreignKey':'TagId'});db[_0x2b55('0x4a')][_0x2b55('0x12c')](db[_0x2b55('0x41')],{});db[_0x2b55('0x4a')]['belongsTo'](db[_0x2b55('0x103')],{'as':'List','foreignKey':_0x2b55('0x16a')});db[_0x2b55('0x4a')][_0x2b55('0x12c')](db[_0x2b55('0x7a')],{'as':'Contact','foreignKey':_0x2b55('0x163')});db[_0x2b55('0x4a')][_0x2b55('0x12c')](db[_0x2b55('0x45')],{});db['MailQueueReport'][_0x2b55('0x12c')](db[_0x2b55('0x46')],{});db[_0x2b55('0x4a')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{});db['MailQueueReport'][_0x2b55('0x12c')](db[_0x2b55('0x13a')],{});db[_0x2b55('0x4c')][_0x2b55('0x11d')](db['DashboardItem'],{'as':_0x2b55('0x179'),'onDelete':'cascade'});db[_0x2b55('0x4f')][_0x2b55('0x11d')](db[_0x2b55('0x8d')],{'as':_0x2b55('0x166'),'foreignKey':_0x2b55('0x17a'),'onDelete':_0x2b55('0x11c')});db[_0x2b55('0x4f')][_0x2b55('0x11d')](db[_0x2b55('0x8b')],{'as':'Answers','foreignKey':_0x2b55('0x17a')});db[_0x2b55('0x4f')][_0x2b55('0x11d')](db[_0x2b55('0x52')],{'as':_0x2b55('0x167')});db[_0x2b55('0x4f')]['hasMany'](db['FaxApplication'],{'as':_0x2b55('0x168')});db['FaxAccount'][_0x2b55('0x11d')](db['VoiceExtension'],{'as':'Exntensions','onDelete':_0x2b55('0x11c')});db[_0x2b55('0x4f')][_0x2b55('0x11d')](db[_0x2b55('0x54')],{'as':_0x2b55('0x15c')});db['FaxAccount'][_0x2b55('0x12c')](db[_0x2b55('0x2c')],{'as':'Trunk'});db[_0x2b55('0x4f')]['belongsTo'](db['CmList'],{'as':_0x2b55('0x169'),'foreignKey':'ListId'});db[_0x2b55('0x4f')]['belongsTo'](db[_0x2b55('0x157')],{'as':'mandatoryDispositionPause','foreignKey':_0x2b55('0x17b')});db['FaxAccount'][_0x2b55('0x12f')](db[_0x2b55('0x12')],{'as':_0x2b55('0x16d'),'through':_0x2b55('0x17c')});db[_0x2b55('0x51')][_0x2b55('0x12c')](db['User'],{'onDelete':_0x2b55('0x178')});db[_0x2b55('0x51')][_0x2b55('0x12c')](db[_0x2b55('0x56')],{'onDelete':_0x2b55('0x178')});db[_0x2b55('0x51')][_0x2b55('0x12c')](db[_0x2b55('0x4f')],{'onDelete':_0x2b55('0x178')});db[_0x2b55('0x51')][_0x2b55('0x12c')](db['Tag'],{'onDelete':_0x2b55('0x178'),'foreignKey':'TagId'});db[_0x2b55('0x52')][_0x2b55('0x11d')](db[_0x2b55('0x54')],{'as':'Messages','onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x17d')});db['FaxInteraction'][_0x2b55('0x12c')](db[_0x2b55('0x4f')],{'as':'Account','foreignKey':_0x2b55('0x17a')});db['FaxInteraction'][_0x2b55('0x12c')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x2b55('0x52')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'as':_0x2b55('0x17e'),'foreignKey':_0x2b55('0x11f')});db[_0x2b55('0x52')]['belongsToMany'](db['Tag'],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0x2b55('0x52')][_0x2b55('0x12f')](db[_0x2b55('0x99')],{'through':'fax_interaction_has_tags','as':_0x2b55('0x172')});db[_0x2b55('0x52')][_0x2b55('0x12f')](db['User'],{'as':_0x2b55('0x173'),'through':'user_has_fax_interactions','foreignKey':_0x2b55('0x17d')});db[_0x2b55('0x54')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'onDelete':_0x2b55('0x11c'),'as':_0x2b55('0x12')});db[_0x2b55('0x54')][_0x2b55('0x12c')](db[_0x2b55('0x52')],{'as':_0x2b55('0x174'),'foreignKey':_0x2b55('0x17d')});db[_0x2b55('0x54')][_0x2b55('0x12c')](db[_0x2b55('0x7a')],{'onDelete':_0x2b55('0x11c'),'as':'Contact'});db[_0x2b55('0x54')][_0x2b55('0x12c')](db[_0x2b55('0x17f')],{'as':'Attachment','foreignKey':_0x2b55('0x180')});db[_0x2b55('0x54')][_0x2b55('0x12c')](db['FaxAccount'],{'as':_0x2b55('0x175'),'foreignKey':_0x2b55('0x17a')});db[_0x2b55('0x56')][_0x2b55('0x12f')](db[_0x2b55('0x12')],{'as':_0x2b55('0x16d'),'through':'UserFaxQueue'});db['FaxQueue'][_0x2b55('0x12f')](db[_0x2b55('0xf3')],{'through':_0x2b55('0x181'),'as':_0x2b55('0x159')});db[_0x2b55('0x182')]['belongsTo'](db[_0x2b55('0x4f')],{});db[_0x2b55('0x182')][_0x2b55('0x12c')](db[_0x2b55('0x103')],{'as':_0x2b55('0x169'),'foreignKey':'ListId'});db[_0x2b55('0x182')][_0x2b55('0x12c')](db[_0x2b55('0x7a')],{'as':_0x2b55('0x162'),'foreignKey':'ContactId'});db['FaxQueueReport'][_0x2b55('0x12c')](db[_0x2b55('0x52')],{});db[_0x2b55('0x182')][_0x2b55('0x12c')](db[_0x2b55('0x54')],{});db[_0x2b55('0x182')][_0x2b55('0x12c')](db['User'],{});db[_0x2b55('0x182')]['belongsTo'](db[_0x2b55('0x56')],{});db[_0x2b55('0x59')]['hasMany'](db[_0x2b55('0x8d')],{'as':_0x2b55('0x166'),'foreignKey':'SmsAccountId','onDelete':'cascade'});db['SmsAccount'][_0x2b55('0x11d')](db[_0x2b55('0x8b')],{'as':_0x2b55('0x183'),'foreignKey':_0x2b55('0x184')});db[_0x2b55('0x59')]['hasMany'](db[_0x2b55('0x185')],{'as':_0x2b55('0x15c'),'foreignKey':_0x2b55('0x184')});db[_0x2b55('0x59')][_0x2b55('0x11d')](db['SmsInteraction'],{'as':'Interactions'});db['SmsAccount'][_0x2b55('0x11d')](db['SmsApplication'],{'as':_0x2b55('0x168')});db[_0x2b55('0x59')]['belongsTo'](db[_0x2b55('0x103')],{'as':_0x2b55('0x169'),'foreignKey':'ListId'});db[_0x2b55('0x59')]['belongsTo'](db[_0x2b55('0x157')],{'as':_0x2b55('0x158'),'foreignKey':_0x2b55('0x17b')});db[_0x2b55('0x59')][_0x2b55('0x12f')](db[_0x2b55('0x12')],{'as':'Agents','through':_0x2b55('0x146')});db[_0x2b55('0x5b')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'onDelete':_0x2b55('0x178')});db[_0x2b55('0x5b')][_0x2b55('0x12c')](db[_0x2b55('0x60')],{'onDelete':_0x2b55('0x178')});db[_0x2b55('0x5b')][_0x2b55('0x12c')](db[_0x2b55('0x59')],{'onDelete':_0x2b55('0x178')});db[_0x2b55('0x5b')][_0x2b55('0x12c')](db[_0x2b55('0x91')],{'onDelete':_0x2b55('0x178'),'foreignKey':_0x2b55('0x156')});db['SmsApplication'][_0x2b55('0x12c')](db[_0x2b55('0x99')],{'onDelete':_0x2b55('0x178'),'foreignKey':_0x2b55('0x186')});db[_0x2b55('0x5d')][_0x2b55('0x11d')](db[_0x2b55('0x185')],{'as':_0x2b55('0x15c'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x187')});db[_0x2b55('0x5d')]['belongsTo'](db[_0x2b55('0x59')],{'as':_0x2b55('0x175'),'foreignKey':_0x2b55('0x184')});db['SmsInteraction'][_0x2b55('0x12c')](db['CmContact'],{'as':_0x2b55('0x162'),'foreignKey':_0x2b55('0x163')});db[_0x2b55('0x5d')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'as':'Owner','foreignKey':_0x2b55('0x11f')});db['SmsInteraction'][_0x2b55('0x12f')](db[_0x2b55('0x99')],{'through':_0x2b55('0x188'),'as':_0x2b55('0x170')});db['SmsInteraction'][_0x2b55('0x12f')](db[_0x2b55('0x99')],{'through':_0x2b55('0x188'),'as':_0x2b55('0x172')});db['SmsInteraction'][_0x2b55('0x12f')](db['User'],{'as':'Users','through':_0x2b55('0x136'),'foreignKey':_0x2b55('0x187')});db[_0x2b55('0x185')]['belongsTo'](db[_0x2b55('0x12')],{'as':_0x2b55('0x12')});db['SmsMessage'][_0x2b55('0x12c')](db['CmContact'],{'onDelete':_0x2b55('0x11c'),'as':_0x2b55('0x162')});db[_0x2b55('0x185')]['belongsTo'](db[_0x2b55('0x5d')],{'onDelete':_0x2b55('0x11c'),'as':_0x2b55('0x174'),'foreignKey':_0x2b55('0x187')});db[_0x2b55('0x185')][_0x2b55('0x12c')](db[_0x2b55('0x59')],{'as':_0x2b55('0x175'),'foreignKey':_0x2b55('0x184')});db[_0x2b55('0x60')]['belongsToMany'](db['User'],{'as':_0x2b55('0x16d'),'through':_0x2b55('0x38'),'foreignKey':_0x2b55('0x189')});db['SmsQueue'][_0x2b55('0x12f')](db[_0x2b55('0xf3')],{'through':_0x2b55('0x18a'),'as':_0x2b55('0x159')});db[_0x2b55('0x62')]['hasMany'](db[_0x2b55('0x8d')],{'as':_0x2b55('0x166'),'foreignKey':_0x2b55('0x18b'),'onDelete':'cascade'});db[_0x2b55('0x62')][_0x2b55('0x11d')](db[_0x2b55('0x8b')],{'as':_0x2b55('0x183'),'foreignKey':_0x2b55('0x18b')});db['OpenchannelAccount'][_0x2b55('0x11d')](db['OpenchannelInteraction'],{'as':_0x2b55('0x167'),'foreignKey':_0x2b55('0x18b')});db[_0x2b55('0x62')][_0x2b55('0x11d')](db[_0x2b55('0x67')],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db[_0x2b55('0x62')][_0x2b55('0x11d')](db[_0x2b55('0x64')],{'as':_0x2b55('0x168'),'foreignKey':_0x2b55('0x18b')});db[_0x2b55('0x62')][_0x2b55('0x12c')](db[_0x2b55('0x103')],{'as':'List','foreignKey':_0x2b55('0x16a')});db[_0x2b55('0x62')]['belongsTo'](db[_0x2b55('0x157')],{'as':_0x2b55('0x158'),'foreignKey':_0x2b55('0x17b')});db[_0x2b55('0x62')][_0x2b55('0x12f')](db[_0x2b55('0x12')],{'as':_0x2b55('0x16d'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'onDelete':'restrict'});db[_0x2b55('0x64')][_0x2b55('0x12c')](db[_0x2b55('0x69')],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db[_0x2b55('0x64')][_0x2b55('0x12c')](db[_0x2b55('0x62')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0x2b55('0x64')][_0x2b55('0x12c')](db[_0x2b55('0x91')],{'onDelete':_0x2b55('0x178'),'foreignKey':_0x2b55('0x156')});db['OpenchannelApplication']['belongsTo'](db[_0x2b55('0x99')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x2b55('0x66')][_0x2b55('0x11d')](db[_0x2b55('0x67')],{'as':_0x2b55('0x15c'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x18c')});db[_0x2b55('0x66')][_0x2b55('0x12c')](db[_0x2b55('0x62')],{'as':_0x2b55('0x175'),'foreignKey':'OpenchannelAccountId'});db[_0x2b55('0x66')]['belongsTo'](db[_0x2b55('0x7a')],{'as':'Contact','foreignKey':'ContactId'});db[_0x2b55('0x66')]['belongsTo'](db[_0x2b55('0x12')],{'as':_0x2b55('0x17e'),'foreignKey':'UserId'});db[_0x2b55('0x66')][_0x2b55('0x12f')](db[_0x2b55('0x99')],{'through':_0x2b55('0x18d'),'as':_0x2b55('0x170')});db['OpenchannelInteraction'][_0x2b55('0x12f')](db[_0x2b55('0x99')],{'through':_0x2b55('0x18d'),'as':_0x2b55('0x172')});db[_0x2b55('0x66')][_0x2b55('0x12f')](db[_0x2b55('0x12')],{'as':_0x2b55('0x173'),'through':_0x2b55('0x137'),'foreignKey':_0x2b55('0x18c')});db['OpenchannelMessage'][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'onDelete':_0x2b55('0x11c'),'as':_0x2b55('0x12')});db['OpenchannelMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x2b55('0x11c'),'as':'Contact'});db[_0x2b55('0x67')][_0x2b55('0x12c')](db[_0x2b55('0x66')],{'onDelete':_0x2b55('0x11c'),'as':_0x2b55('0x174'),'foreignKey':_0x2b55('0x18c')});db['OpenchannelMessage'][_0x2b55('0x12c')](db[_0x2b55('0x17f')],{'as':_0x2b55('0x17f'),'foreignKey':_0x2b55('0x180')});db[_0x2b55('0x67')]['belongsTo'](db[_0x2b55('0x62')],{'as':_0x2b55('0x175'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue']['belongsToMany'](db[_0x2b55('0x12')],{'as':_0x2b55('0x16d'),'through':_0x2b55('0x3a'),'foreignKey':_0x2b55('0x18e')});db[_0x2b55('0x69')][_0x2b55('0x12f')](db[_0x2b55('0xf3')],{'through':_0x2b55('0x18f'),'as':'Teams'});db[_0x2b55('0x6b')][_0x2b55('0x11d')](db[_0x2b55('0x8d')],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0x2b55('0x11c')});db[_0x2b55('0x6b')][_0x2b55('0x11d')](db[_0x2b55('0x8b')],{'as':_0x2b55('0x183'),'foreignKey':'ChatWebsiteId'});db[_0x2b55('0x6b')][_0x2b55('0x11d')](db[_0x2b55('0x77')],{'as':_0x2b55('0x190')});db[_0x2b55('0x6b')][_0x2b55('0x11d')](db[_0x2b55('0x125')],{'as':'Interactions'});db[_0x2b55('0x6b')][_0x2b55('0x11d')](db[_0x2b55('0x6d')],{'as':_0x2b55('0x168')});db[_0x2b55('0x6b')][_0x2b55('0x11d')](db[_0x2b55('0x70')],{'as':'Messages'});db[_0x2b55('0x6b')][_0x2b55('0x12c')](db[_0x2b55('0x103')],{'as':_0x2b55('0x169'),'foreignKey':_0x2b55('0x16a')});db[_0x2b55('0x6b')][_0x2b55('0x12c')](db[_0x2b55('0x91')],{'as':_0x2b55('0x91'),'foreignKey':_0x2b55('0x156')});db[_0x2b55('0x6b')][_0x2b55('0x12c')](db[_0x2b55('0x41')],{'as':'MailAccount','foreignKey':_0x2b55('0x164')});db[_0x2b55('0x6b')][_0x2b55('0x12c')](db[_0x2b55('0x157')],{'as':'mandatoryDispositionPause','foreignKey':_0x2b55('0x17b')});db[_0x2b55('0x6b')][_0x2b55('0x12f')](db[_0x2b55('0x12')],{'as':_0x2b55('0x16d'),'through':_0x2b55('0x143')});db[_0x2b55('0x191')][_0x2b55('0x12c')](db[_0x2b55('0x62')],{});db[_0x2b55('0x191')][_0x2b55('0x12c')](db[_0x2b55('0x103')],{'as':_0x2b55('0x169'),'foreignKey':_0x2b55('0x16a')});db[_0x2b55('0x191')][_0x2b55('0x12c')](db[_0x2b55('0x7a')],{'as':_0x2b55('0x162'),'foreignKey':'ContactId'});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x2b55('0x191')][_0x2b55('0x12c')](db['OpenchannelMessage'],{});db['OpenchannelQueueReport']['belongsTo'](db['User'],{});db[_0x2b55('0x191')][_0x2b55('0x12c')](db[_0x2b55('0x69')],{});db[_0x2b55('0x6d')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'as':'Agent','foreignKey':'UserId','onDelete':'restrict'});db['ChatApplication'][_0x2b55('0x12c')](db['ChatQueue'],{'as':_0x2b55('0x192'),'foreignKey':'ChatQueueId','onDelete':_0x2b55('0x178')});db[_0x2b55('0x6d')]['belongsTo'](db[_0x2b55('0x6b')],{'as':_0x2b55('0x193'),'foreignKey':_0x2b55('0x176'),'onDelete':_0x2b55('0x178')});db[_0x2b55('0x6d')]['belongsTo'](db['Tag'],{'onDelete':_0x2b55('0x178'),'foreignKey':'TagId'});db['ChatInteraction'][_0x2b55('0x11d')](db[_0x2b55('0x70')],{'as':_0x2b55('0x15c'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x194')});db['ChatInteraction'][_0x2b55('0x12c')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x2b55('0x176')});db[_0x2b55('0x125')][_0x2b55('0x12c')](db[_0x2b55('0x7a')],{'as':_0x2b55('0x162'),'foreignKey':'ContactId'});db['ChatInteraction']['belongsTo'](db[_0x2b55('0x12')],{'as':'Owner','foreignKey':'UserId'});db['ChatInteraction']['belongsToMany'](db[_0x2b55('0x99')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0x2b55('0x125')][_0x2b55('0x12f')](db[_0x2b55('0x99')],{'through':_0x2b55('0x195'),'as':_0x2b55('0x172')});db[_0x2b55('0x125')][_0x2b55('0x12f')](db[_0x2b55('0x12')],{'as':'Users','through':_0x2b55('0x135'),'foreignKey':_0x2b55('0x194')});db['ChatMessage']['belongsTo'](db[_0x2b55('0x12')],{'onDelete':'cascade','as':_0x2b55('0x12')});db[_0x2b55('0x70')][_0x2b55('0x12c')](db['CmContact'],{'onDelete':_0x2b55('0x11c'),'as':_0x2b55('0x162'),'foreignKey':_0x2b55('0x163')});db[_0x2b55('0x70')]['belongsTo'](db[_0x2b55('0x125')],{'onDelete':'cascade','as':_0x2b55('0x174'),'foreignKey':_0x2b55('0x194')});db[_0x2b55('0x70')]['belongsTo'](db[_0x2b55('0x17f')],{'as':_0x2b55('0x17f'),'foreignKey':_0x2b55('0x180')});db['ChatMessage'][_0x2b55('0x12c')](db[_0x2b55('0x6b')],{'as':'Account','foreignKey':_0x2b55('0x176')});db[_0x2b55('0x71')]['hasMany'](db[_0x2b55('0x17f')],{'as':_0x2b55('0x196'),'foreignKey':'ChatOfflineMessageId','onDelete':'cascade','hooks':!![]});db[_0x2b55('0x71')][_0x2b55('0x12c')](db[_0x2b55('0x7a')],{'onDelete':_0x2b55('0x11c'),'as':_0x2b55('0x162'),'foreignKey':_0x2b55('0x163')});db[_0x2b55('0x71')][_0x2b55('0x12c')](db[_0x2b55('0x6b')],{'as':'Account','foreignKey':_0x2b55('0x176')});db[_0x2b55('0x73')]['belongsToMany'](db[_0x2b55('0x12')],{'as':_0x2b55('0x16d'),'through':_0x2b55('0x34'),'hooks':!![]});db[_0x2b55('0x73')][_0x2b55('0x12f')](db[_0x2b55('0xf3')],{'through':'team_has_chat_queues','as':'Teams'});db['ChatGroup'][_0x2b55('0x11d')](db[_0x2b55('0xde')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0x2b55('0x11c')});db[_0x2b55('0x75')]['belongsToMany'](db['User'],{'as':_0x2b55('0x14f'),'through':_0x2b55('0x12e')});db[_0x2b55('0x77')]['belongsTo'](db['ChatWebsite'],{'as':_0x2b55('0x193'),'foreignKey':_0x2b55('0x176')});db['CmCompany']['hasMany'](db[_0x2b55('0x7a')],{'as':_0x2b55('0x197'),'foreignKey':_0x2b55('0x198')});db['CmContact'][_0x2b55('0x11d')](db['CmHopper'],{'as':_0x2b55('0x199'),'foreignKey':'ContactId'});db[_0x2b55('0x7a')][_0x2b55('0x11d')](db['CmHopperFinal'],{'as':_0x2b55('0x122'),'foreignKey':'ContactId'});db['CmContact']['hasMany'](db[_0x2b55('0x81')],{'as':_0x2b55('0x151'),'foreignKey':_0x2b55('0x163')});db['CmContact'][_0x2b55('0x11d')](db[_0x2b55('0x83')],{'as':_0x2b55('0x83'),'foreignKey':_0x2b55('0x163')});db[_0x2b55('0x7a')][_0x2b55('0x11d')](db[_0x2b55('0xe2')],{'as':_0x2b55('0x153'),'foreignKey':_0x2b55('0x163')});db[_0x2b55('0x7a')]['hasMany'](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x2b55('0x178')});db['CmContact'][_0x2b55('0x11d')](db[_0x2b55('0x125')],{'as':_0x2b55('0x19a'),'foreignKey':_0x2b55('0x163'),'onDelete':_0x2b55('0x178')});db[_0x2b55('0x7a')][_0x2b55('0x11d')](db[_0x2b55('0x5d')],{'as':_0x2b55('0x126'),'foreignKey':_0x2b55('0x163'),'onDelete':_0x2b55('0x178')});db[_0x2b55('0x7a')]['hasMany'](db['FaxInteraction'],{'as':_0x2b55('0x127'),'foreignKey':_0x2b55('0x163'),'onDelete':_0x2b55('0x178')});db[_0x2b55('0x7a')][_0x2b55('0x11d')](db[_0x2b55('0x45')],{'as':_0x2b55('0x128'),'foreignKey':_0x2b55('0x163'),'onDelete':_0x2b55('0x178')});db[_0x2b55('0x7a')][_0x2b55('0x12c')](db[_0x2b55('0x19b')],{'as':_0x2b55('0x19c'),'foreignKey':_0x2b55('0x198')});db[_0x2b55('0x7a')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x2b55('0x16a'),'onDelete':_0x2b55('0x11c')});db[_0x2b55('0x7a')][_0x2b55('0x12f')](db[_0x2b55('0x12')],{'as':_0x2b55('0x173'),'through':'cm_user_has_contacts'});db[_0x2b55('0x7a')][_0x2b55('0x12f')](db[_0x2b55('0x99')],{'as':_0x2b55('0x170'),'through':_0x2b55('0x19d')});db[_0x2b55('0x7a')][_0x2b55('0x12f')](db[_0x2b55('0x99')],{'through':'cm_contact_has_tags','as':_0x2b55('0x172')});db[_0x2b55('0x7c')]['belongsTo'](db['CmContact'],{'as':_0x2b55('0x162'),'foreignKey':'ContactId','onDelete':_0x2b55('0x11c')});db['CmHopper'][_0x2b55('0x12c')](db[_0x2b55('0x103')],{'as':'List','foreignKey':_0x2b55('0x16a'),'onDelete':_0x2b55('0x11c')});db['CmHopper'][_0x2b55('0x12c')](db['User'],{'as':_0x2b55('0x19e'),'foreignKey':_0x2b55('0x11f')});db[_0x2b55('0x7c')][_0x2b55('0x12c')](db[_0x2b55('0x1b')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x2b55('0x7c')][_0x2b55('0x12c')](db[_0x2b55('0x19f')],{'as':_0x2b55('0x19f'),'foreignKey':_0x2b55('0x1a0'),'onDelete':'cascade'});db[_0x2b55('0x7c')]['belongsTo'](db[_0x2b55('0x12')],{'as':_0x2b55('0x17e'),'foreignKey':_0x2b55('0x1a1')});db[_0x2b55('0x7d')][_0x2b55('0x12c')](db[_0x2b55('0x7a')],{'as':_0x2b55('0x162'),'foreignKey':_0x2b55('0x163'),'onDelete':'cascade'});db[_0x2b55('0x7d')][_0x2b55('0x12c')](db[_0x2b55('0x103')],{'as':'List','foreignKey':_0x2b55('0x16a'),'onDelete':_0x2b55('0x11c')});db[_0x2b55('0x7d')][_0x2b55('0x12c')](db[_0x2b55('0x1b')],{'as':_0x2b55('0x192'),'foreignKey':_0x2b55('0x150'),'onDelete':_0x2b55('0x11c')});db['CmHopperBlack']['belongsTo'](db['Campaign'],{'as':_0x2b55('0x19f'),'foreignKey':_0x2b55('0x1a0'),'onDelete':_0x2b55('0x11c')});db['Automation'][_0x2b55('0x11d')](db['Condition'],{'as':{'plural':_0x2b55('0x1a2'),'singular':_0x2b55('0x1a3')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x2b55('0x89')]['hasMany'](db[_0x2b55('0x8f')],{'as':{'plural':_0x2b55('0x1a4'),'singular':'OneAny'},'foreignKey':_0x2b55('0x1a5'),'onDelete':_0x2b55('0x11c'),'hooks':!![]});db[_0x2b55('0x89')][_0x2b55('0x11d')](db[_0x2b55('0x87')],{'as':_0x2b55('0x1a6'),'foreignKey':_0x2b55('0x1a7'),'onDelete':'cascade','hooks':!![]});db[_0x2b55('0x8d')][_0x2b55('0x11d')](db[_0x2b55('0x8d')],{'as':'Dispositions','foreignKey':_0x2b55('0x1a8'),'onDelete':'cascade'});db[_0x2b55('0x91')][_0x2b55('0x11d')](db[_0x2b55('0x91')],{'as':_0x2b55('0x1a9'),'foreignKey':'IntervalId','onDelete':_0x2b55('0x11c'),'hooks':!![],'required':![]});db['Interval'][_0x2b55('0x11d')](db[_0x2b55('0x18')],{'as':'Extensions','foreignKey':_0x2b55('0x156'),'onDelete':_0x2b55('0x178')});db[_0x2b55('0x91')]['hasMany'](db[_0x2b55('0x48')],{'as':_0x2b55('0x1aa'),'foreignKey':'IntervalId'});db[_0x2b55('0x91')][_0x2b55('0x11d')](db[_0x2b55('0x6d')],{'as':_0x2b55('0x1ab'),'foreignKey':_0x2b55('0x156')});db[_0x2b55('0x91')][_0x2b55('0x11d')](db[_0x2b55('0x51')],{'as':_0x2b55('0x1ac'),'foreignKey':_0x2b55('0x156')});db[_0x2b55('0x91')][_0x2b55('0x11d')](db[_0x2b55('0x5b')],{'as':'SmsApplications','foreignKey':_0x2b55('0x156')});db[_0x2b55('0x95')][_0x2b55('0x12c')](db['MailAccount'],{});db[_0x2b55('0x95')][_0x2b55('0x12c')](db['AnalyticDefaultReport'],{'foreignKey':_0x2b55('0x1ad')});db[_0x2b55('0x95')][_0x2b55('0x12c')](db[_0x2b55('0xa0')],{'foreignKey':'CustomReportId'});db[_0x2b55('0x97')][_0x2b55('0x12f')](db[_0x2b55('0x14c')],{'as':_0x2b55('0x1ae'),'through':_0x2b55('0x14e'),'onDelete':'restrict'});db[_0x2b55('0x99')][_0x2b55('0x12f')](db[_0x2b55('0x7a')],{'through':_0x2b55('0x19d')});db[_0x2b55('0x99')][_0x2b55('0x12f')](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db[_0x2b55('0x99')][_0x2b55('0x12f')](db['MailInteraction'],{'through':_0x2b55('0x171')});db[_0x2b55('0x99')][_0x2b55('0x12f')](db[_0x2b55('0x5d')],{'through':_0x2b55('0x188')});db[_0x2b55('0x99')][_0x2b55('0x12f')](db[_0x2b55('0x52')],{'through':_0x2b55('0x1af')});db[_0x2b55('0x99')][_0x2b55('0x12f')](db[_0x2b55('0x66')],{'through':_0x2b55('0x18d')});db[_0x2b55('0x99')][_0x2b55('0x12f')](db[_0x2b55('0x129')],{'through':_0x2b55('0x1b0')});db['Trigger'][_0x2b55('0x11d')](db[_0x2b55('0x8f')],{'as':{'plural':_0x2b55('0x1b1'),'singular':_0x2b55('0x1b2')},'foreignKey':_0x2b55('0x1b3'),'onDelete':_0x2b55('0x11c'),'hooks':!![]});db[_0x2b55('0x9b')][_0x2b55('0x11d')](db[_0x2b55('0x8f')],{'as':{'plural':_0x2b55('0x1b4'),'singular':'AnyCondition'},'foreignKey':_0x2b55('0x1b5'),'onDelete':'cascade','hooks':!![]});db[_0x2b55('0x9b')][_0x2b55('0x11d')](db['Action'],{'as':'Actions','foreignKey':_0x2b55('0x1b6'),'onDelete':_0x2b55('0x11c'),'hooks':!![]});db[_0x2b55('0xa0')][_0x2b55('0x11d')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1b7'),'hooks':!![]});db['AnalyticDefaultReport'][_0x2b55('0x11d')](db[_0x2b55('0xa7')],{'as':_0x2b55('0x1b8'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1ad')});db[_0x2b55('0xa5')][_0x2b55('0x11d')](db[_0x2b55('0xa7')],{'as':_0x2b55('0x1b8'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1b9')});db[_0x2b55('0xa7')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':_0x2b55('0x1b9')});db[_0x2b55('0xab')][_0x2b55('0x11d')](db[_0x2b55('0x1ba')],{'as':_0x2b55('0x1bb'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1bc')});db[_0x2b55('0x1ba')]['hasMany'](db[_0x2b55('0xae')],{'as':_0x2b55('0x1bd'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1be')});db[_0x2b55('0x1ba')][_0x2b55('0x11d')](db[_0x2b55('0xae')],{'as':_0x2b55('0x1bf'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1c0')});db[_0x2b55('0x1ba')][_0x2b55('0x11d')](db[_0x2b55('0xae')],{'as':'Fields','onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1c1')});db[_0x2b55('0x1ba')][_0x2b55('0x12c')](db[_0x2b55('0xab')],{'as':_0x2b55('0x175'),'foreignKey':'AccountId'});db[_0x2b55('0xae')][_0x2b55('0x11d')](db[_0x2b55('0xae')],{'as':_0x2b55('0x1c2'),'foreignKey':_0x2b55('0x1be')});db['SalesforceField'][_0x2b55('0x11d')](db[_0x2b55('0xae')],{'as':'Description','foreignKey':_0x2b55('0x1c0')});db[_0x2b55('0xae')][_0x2b55('0x11d')](db[_0x2b55('0xae')],{'as':'Field','foreignKey':_0x2b55('0x1c1')});db[_0x2b55('0xae')][_0x2b55('0x12c')](db['Variable'],{'as':_0x2b55('0x9d'),'foreignKey':_0x2b55('0x1c3')});db[_0x2b55('0x1c4')][_0x2b55('0x11d')](db[_0x2b55('0xb0')],{'as':_0x2b55('0x1bb'),'onDelete':_0x2b55('0x11c'),'foreignKey':'AccountId'});db['SugarcrmConfiguration'][_0x2b55('0x11d')](db[_0x2b55('0xb2')],{'as':_0x2b55('0x1bd'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1be')});db[_0x2b55('0xb0')][_0x2b55('0x11d')](db[_0x2b55('0xb2')],{'as':_0x2b55('0x1bf'),'onDelete':_0x2b55('0x11c'),'foreignKey':'DescriptionId'});db[_0x2b55('0xb0')]['hasMany'](db[_0x2b55('0xb2')],{'as':_0x2b55('0x1b8'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1c1')});db[_0x2b55('0xb0')][_0x2b55('0x12c')](db[_0x2b55('0x1c4')],{'as':'Account','foreignKey':'AccountId'});db[_0x2b55('0xb2')][_0x2b55('0x11d')](db[_0x2b55('0xb2')],{'as':_0x2b55('0x1c2'),'foreignKey':'SubjectId'});db[_0x2b55('0xb2')][_0x2b55('0x11d')](db['SugarcrmField'],{'as':'Description','foreignKey':_0x2b55('0x1c0')});db[_0x2b55('0xb2')]['hasMany'](db[_0x2b55('0xb2')],{'as':_0x2b55('0x1c5'),'foreignKey':'FieldId'});db[_0x2b55('0xb2')]['belongsTo'](db[_0x2b55('0x9d')],{'as':_0x2b55('0x9d'),'foreignKey':_0x2b55('0x1c3')});db['DeskAccount']['hasMany'](db[_0x2b55('0x1c6')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x2b55('0x1bc')});db['DeskConfiguration'][_0x2b55('0x11d')](db[_0x2b55('0xb5')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x2b55('0x1be')});db[_0x2b55('0x1c6')][_0x2b55('0x11d')](db['DeskField'],{'as':_0x2b55('0x1bf'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1c0')});db[_0x2b55('0x1c6')][_0x2b55('0x11d')](db[_0x2b55('0xb5')],{'as':'Fields','onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1c1')});db[_0x2b55('0x1c6')][_0x2b55('0x12c')](db['DeskAccount'],{'as':_0x2b55('0x175'),'foreignKey':_0x2b55('0x1bc')});db[_0x2b55('0x1c6')]['belongsToMany'](db[_0x2b55('0x99')],{'through':_0x2b55('0x1c7')});db[_0x2b55('0xb5')][_0x2b55('0x11d')](db[_0x2b55('0xb5')],{'as':_0x2b55('0x1c2'),'foreignKey':_0x2b55('0x1be')});db['DeskField'][_0x2b55('0x11d')](db[_0x2b55('0xb5')],{'as':_0x2b55('0x1c8'),'foreignKey':_0x2b55('0x1c0')});db[_0x2b55('0xb5')][_0x2b55('0x11d')](db[_0x2b55('0xb5')],{'as':_0x2b55('0x1c5'),'foreignKey':_0x2b55('0x1c1')});db[_0x2b55('0xb5')][_0x2b55('0x12c')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['ZohoAccount'][_0x2b55('0x11d')](db[_0x2b55('0xb8')],{'as':_0x2b55('0x1bb'),'onDelete':'cascade','foreignKey':_0x2b55('0x1bc')});db[_0x2b55('0xb8')][_0x2b55('0x11d')](db[_0x2b55('0xba')],{'as':_0x2b55('0x1bd'),'onDelete':_0x2b55('0x11c'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0x2b55('0x11d')](db[_0x2b55('0xba')],{'as':'Descriptions','onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1c0')});db[_0x2b55('0xb8')][_0x2b55('0x11d')](db[_0x2b55('0xba')],{'as':_0x2b55('0x1b8'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1c1')});db['ZohoConfiguration'][_0x2b55('0x12c')](db['ZohoAccount'],{'as':_0x2b55('0x175'),'foreignKey':'AccountId'});db[_0x2b55('0xba')][_0x2b55('0x11d')](db[_0x2b55('0xba')],{'as':_0x2b55('0x1c2'),'foreignKey':_0x2b55('0x1be')});db[_0x2b55('0xba')]['hasMany'](db[_0x2b55('0xba')],{'as':'Description','foreignKey':_0x2b55('0x1c0')});db[_0x2b55('0xba')][_0x2b55('0x11d')](db[_0x2b55('0xba')],{'as':_0x2b55('0x1c5'),'foreignKey':_0x2b55('0x1c1')});db[_0x2b55('0xba')][_0x2b55('0x12c')](db[_0x2b55('0x9d')],{'as':'Variable','foreignKey':'VariableId'});db[_0x2b55('0xbc')][_0x2b55('0x11d')](db['ZendeskConfiguration'],{'as':_0x2b55('0x1bb'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1bc')});db[_0x2b55('0xbd')][_0x2b55('0x11d')](db[_0x2b55('0xbf')],{'as':_0x2b55('0x1bd'),'foreignKey':_0x2b55('0x1be')});db['ZendeskConfiguration'][_0x2b55('0x11d')](db[_0x2b55('0xbf')],{'as':'Descriptions','foreignKey':_0x2b55('0x1c0')});db[_0x2b55('0xbd')][_0x2b55('0x11d')](db[_0x2b55('0xbf')],{'as':_0x2b55('0x1b8'),'foreignKey':'FieldId'});db[_0x2b55('0xbd')]['belongsTo'](db['ZendeskAccount'],{'as':_0x2b55('0x175'),'foreignKey':'AccountId'});db[_0x2b55('0xbd')][_0x2b55('0x12f')](db[_0x2b55('0x99')],{'through':_0x2b55('0x1c9')});db[_0x2b55('0xbf')]['hasMany'](db[_0x2b55('0xbf')],{'as':_0x2b55('0x1c2'),'foreignKey':_0x2b55('0x1be')});db['ZendeskField'][_0x2b55('0x11d')](db['ZendeskField'],{'as':'Description','foreignKey':_0x2b55('0x1c0')});db[_0x2b55('0xbf')][_0x2b55('0x11d')](db[_0x2b55('0xbf')],{'as':_0x2b55('0x1c5'),'foreignKey':_0x2b55('0x1c1')});db[_0x2b55('0xbf')][_0x2b55('0x12c')](db['Variable'],{'as':_0x2b55('0x9d'),'foreignKey':_0x2b55('0x1c3')});db[_0x2b55('0xc0')][_0x2b55('0x11d')](db[_0x2b55('0xc1')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x2b55('0x1bc')});db['FreshdeskConfiguration'][_0x2b55('0x11d')](db['FreshdeskField'],{'as':_0x2b55('0x1bd'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1be')});db[_0x2b55('0xc1')]['hasMany'](db[_0x2b55('0xc2')],{'as':_0x2b55('0x1bf'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0x2b55('0x11d')](db[_0x2b55('0xc2')],{'as':_0x2b55('0x1b8'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1c1')});db['FreshdeskConfiguration']['belongsTo'](db[_0x2b55('0xc0')],{'as':_0x2b55('0x175'),'foreignKey':_0x2b55('0x1bc')});db[_0x2b55('0xc1')][_0x2b55('0x12f')](db[_0x2b55('0x99')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x2b55('0xc2')]['hasMany'](db[_0x2b55('0xc2')],{'as':_0x2b55('0x1c2'),'foreignKey':_0x2b55('0x1be')});db[_0x2b55('0xc2')][_0x2b55('0x11d')](db[_0x2b55('0xc2')],{'as':'Description','foreignKey':_0x2b55('0x1c0')});db[_0x2b55('0xc2')][_0x2b55('0x11d')](db['FreshdeskField'],{'as':_0x2b55('0x1c5'),'foreignKey':'FieldId'});db['FreshdeskField'][_0x2b55('0x12c')](db[_0x2b55('0x9d')],{'as':_0x2b55('0x9d'),'foreignKey':_0x2b55('0x1c3')});db[_0x2b55('0xc4')]['hasMany'](db['VtigerConfiguration'],{'as':_0x2b55('0x1bb'),'onDelete':_0x2b55('0x11c'),'foreignKey':'AccountId'});db['VtigerConfiguration'][_0x2b55('0x11d')](db[_0x2b55('0xc8')],{'as':'Subjects','foreignKey':_0x2b55('0x1be')});db['VtigerConfiguration'][_0x2b55('0x11d')](db[_0x2b55('0xc8')],{'as':_0x2b55('0x1bf'),'foreignKey':_0x2b55('0x1c0')});db[_0x2b55('0xc6')][_0x2b55('0x11d')](db[_0x2b55('0xc8')],{'as':'Fields','foreignKey':_0x2b55('0x1c1')});db[_0x2b55('0xc6')][_0x2b55('0x12c')](db[_0x2b55('0xc4')],{'as':_0x2b55('0x175'),'foreignKey':'AccountId'});db['VtigerField'][_0x2b55('0x11d')](db[_0x2b55('0xc8')],{'as':_0x2b55('0x1c2'),'foreignKey':'SubjectId'});db['VtigerField']['hasMany'](db[_0x2b55('0xc8')],{'as':_0x2b55('0x1c8'),'foreignKey':_0x2b55('0x1c0')});db[_0x2b55('0xc8')][_0x2b55('0x11d')](db[_0x2b55('0xc8')],{'as':_0x2b55('0x1c5'),'foreignKey':_0x2b55('0x1c1')});db['VtigerField'][_0x2b55('0x12c')](db[_0x2b55('0x9d')],{'as':_0x2b55('0x9d'),'foreignKey':'VariableId'});db['ServicenowAccount'][_0x2b55('0x11d')](db[_0x2b55('0xcc')],{'as':_0x2b55('0x1bb'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1bc')});db[_0x2b55('0xcc')][_0x2b55('0x11d')](db[_0x2b55('0xce')],{'as':'Subjects','foreignKey':_0x2b55('0x1be')});db[_0x2b55('0xcc')][_0x2b55('0x11d')](db[_0x2b55('0xce')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x2b55('0xcc')]['hasMany'](db[_0x2b55('0xce')],{'as':_0x2b55('0x1b8'),'foreignKey':'FieldId'});db[_0x2b55('0xcc')][_0x2b55('0x12c')](db[_0x2b55('0xca')],{'as':_0x2b55('0x175'),'foreignKey':_0x2b55('0x1bc')});db['ServicenowField'][_0x2b55('0x11d')](db['ServicenowField'],{'as':_0x2b55('0x1c2'),'foreignKey':_0x2b55('0x1be')});db[_0x2b55('0xce')][_0x2b55('0x11d')](db['ServicenowField'],{'as':_0x2b55('0x1c8'),'foreignKey':_0x2b55('0x1c0')});db[_0x2b55('0xce')][_0x2b55('0x11d')](db['ServicenowField'],{'as':_0x2b55('0x1c5'),'foreignKey':_0x2b55('0x1c1')});db[_0x2b55('0xce')][_0x2b55('0x12c')](db['Variable'],{'as':'Variable','foreignKey':_0x2b55('0x1c3')});db[_0x2b55('0xd0')]['hasMany'](db['Dynamics365Configuration'],{'as':_0x2b55('0x1bb'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1bc')});db['Dynamics365Configuration']['hasMany'](db[_0x2b55('0xd4')],{'as':'Subjects','onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1be')});db[_0x2b55('0xd2')][_0x2b55('0x11d')](db[_0x2b55('0xd4')],{'as':_0x2b55('0x1bf'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x1c0')});db[_0x2b55('0xd2')][_0x2b55('0x11d')](db[_0x2b55('0xd4')],{'as':'Fields','onDelete':_0x2b55('0x11c'),'foreignKey':'FieldId'});db['Dynamics365Configuration'][_0x2b55('0x12c')](db[_0x2b55('0xd0')],{'as':_0x2b55('0x175'),'foreignKey':_0x2b55('0x1bc')});db[_0x2b55('0xd4')]['hasMany'](db[_0x2b55('0xd4')],{'as':'Subject','foreignKey':_0x2b55('0x1be')});db['Dynamics365Field']['hasMany'](db[_0x2b55('0xd4')],{'as':_0x2b55('0x1c8'),'foreignKey':'DescriptionId'});db['Dynamics365Field'][_0x2b55('0x11d')](db[_0x2b55('0xd4')],{'as':_0x2b55('0x1c5'),'foreignKey':'FieldId'});db[_0x2b55('0xd4')][_0x2b55('0x12c')](db['Variable'],{'as':_0x2b55('0x9d'),'foreignKey':'VariableId'});db['FreshsalesAccount'][_0x2b55('0x11d')](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x2b55('0x1bc')});db['FreshsalesConfiguration'][_0x2b55('0x11d')](db[_0x2b55('0xda')],{'as':_0x2b55('0x1bd'),'foreignKey':'SubjectId'});db[_0x2b55('0xd8')][_0x2b55('0x11d')](db[_0x2b55('0xda')],{'as':_0x2b55('0x1bf'),'foreignKey':_0x2b55('0x1c0')});db['FreshsalesConfiguration']['hasMany'](db[_0x2b55('0xda')],{'as':_0x2b55('0x1b8'),'foreignKey':_0x2b55('0x1c1')});db[_0x2b55('0xd8')][_0x2b55('0x12c')](db['FreshsalesAccount'],{'as':_0x2b55('0x175'),'foreignKey':_0x2b55('0x1bc')});db['FreshsalesField'][_0x2b55('0x11d')](db[_0x2b55('0xda')],{'as':_0x2b55('0x1c2'),'foreignKey':_0x2b55('0x1be')});db[_0x2b55('0xda')][_0x2b55('0x11d')](db[_0x2b55('0xda')],{'as':_0x2b55('0x1c8'),'foreignKey':_0x2b55('0x1c0')});db[_0x2b55('0xda')]['hasMany'](db[_0x2b55('0xda')],{'as':_0x2b55('0x1c5'),'foreignKey':_0x2b55('0x1c1')});db[_0x2b55('0xda')][_0x2b55('0x12c')](db[_0x2b55('0x9d')],{'as':_0x2b55('0x9d'),'foreignKey':_0x2b55('0x1c3')});db['ChatQueueReport'][_0x2b55('0x12c')](db['ChatWebsite'],{});db['ChatQueueReport'][_0x2b55('0x12c')](db[_0x2b55('0x103')],{'as':_0x2b55('0x169'),'foreignKey':_0x2b55('0x16a')});db[_0x2b55('0x1ca')][_0x2b55('0x12c')](db['CmContact'],{'as':_0x2b55('0x162'),'foreignKey':_0x2b55('0x163')});db[_0x2b55('0x1ca')][_0x2b55('0x12c')](db['ChatInteraction'],{});db[_0x2b55('0x1ca')][_0x2b55('0x12c')](db[_0x2b55('0x70')],{});db[_0x2b55('0x1ca')]['belongsTo'](db['User'],{});db[_0x2b55('0x1ca')]['belongsTo'](db[_0x2b55('0x73')],{});db['ChatInternalMessage'][_0x2b55('0x12c')](db['User'],{'onDelete':'cascade','foreignKey':_0x2b55('0x1cb')});db[_0x2b55('0xde')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'onDelete':_0x2b55('0x11c'),'foreignKey':'ToId'});db[_0x2b55('0xe2')]['hasMany'](db[_0x2b55('0xe1')],{'foreignKey':_0x2b55('0x1cc'),'onDelete':_0x2b55('0x11c')});db[_0x2b55('0xe2')][_0x2b55('0x11d')](db[_0x2b55('0xdf')],{'foreignKey':_0x2b55('0x1cc'),'onDelete':_0x2b55('0x11c')});db[_0x2b55('0xe4')][_0x2b55('0x12c')](db['SmsAccount'],{});db[_0x2b55('0xe4')]['belongsTo'](db[_0x2b55('0x103')],{'as':'List','foreignKey':_0x2b55('0x16a')});db[_0x2b55('0xe4')][_0x2b55('0x12c')](db[_0x2b55('0x7a')],{'as':_0x2b55('0x162'),'foreignKey':_0x2b55('0x163')});db[_0x2b55('0xe4')]['belongsTo'](db[_0x2b55('0x5d')],{});db['SmsQueueReport'][_0x2b55('0x12c')](db[_0x2b55('0x185')],{});db[_0x2b55('0xe4')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{});db[_0x2b55('0xe4')][_0x2b55('0x12c')](db[_0x2b55('0x60')],{});db['JscriptyProject'][_0x2b55('0x11d')](db[_0x2b55('0xe2')],{'foreignKey':_0x2b55('0x1cd')});db[_0x2b55('0xe9')][_0x2b55('0x11d')](db[_0x2b55('0xe1')],{'foreignKey':_0x2b55('0x1cd')});db[_0x2b55('0xe9')][_0x2b55('0x11d')](db[_0x2b55('0xdf')],{'foreignKey':_0x2b55('0x1cd')});db[_0x2b55('0xed')][_0x2b55('0x12f')](db[_0x2b55('0x12')],{'as':_0x2b55('0x173'),'through':_0x2b55('0x149')});db['Team'][_0x2b55('0x12f')](db[_0x2b55('0x12')],{'as':_0x2b55('0x16d'),'through':'user_has_teams'});db[_0x2b55('0xf3')][_0x2b55('0x12f')](db[_0x2b55('0x1b')],{'through':_0x2b55('0x119'),'as':_0x2b55('0x139')});db[_0x2b55('0xf3')][_0x2b55('0x12f')](db[_0x2b55('0x13a')],{'through':_0x2b55('0x16e'),'as':'MailQueues'});db[_0x2b55('0xf3')][_0x2b55('0x12f')](db[_0x2b55('0x73')],{'through':'team_has_chat_queues','as':_0x2b55('0x1ce')});db[_0x2b55('0xf3')][_0x2b55('0x12f')](db[_0x2b55('0x56')],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0x2b55('0xf3')][_0x2b55('0x12f')](db[_0x2b55('0x60')],{'through':_0x2b55('0x18a'),'as':'SmsQueues'});db['Team']['belongsToMany'](db['OpenchannelQueue'],{'through':_0x2b55('0x18f'),'as':_0x2b55('0x1cf')});db[_0x2b55('0xf3')][_0x2b55('0x12f')](db[_0x2b55('0x1d0')],{'through':'team_has_whatsapp_queues','as':_0x2b55('0x13e')});db[_0x2b55('0x19f')]['hasMany'](db[_0x2b55('0x7c')],{'as':'Hoppers','foreignKey':_0x2b55('0x1a0')});db[_0x2b55('0x19f')][_0x2b55('0x11d')](db[_0x2b55('0x7f')],{'as':'HopperFinals','foreignKey':_0x2b55('0x1a0')});db[_0x2b55('0x19f')][_0x2b55('0x11d')](db[_0x2b55('0x81')],{'as':_0x2b55('0x151'),'foreignKey':'CampaignId'});db['Campaign'][_0x2b55('0x11d')](db[_0x2b55('0x7d')],{'as':_0x2b55('0x152'),'foreignKey':_0x2b55('0x1a0')});db[_0x2b55('0x19f')][_0x2b55('0x12c')](db[_0x2b55('0x2c')],{'as':_0x2b55('0x2c'),'foreignKey':_0x2b55('0x154')});db['Campaign'][_0x2b55('0x12c')](db['Trunk'],{'as':_0x2b55('0x155'),'foreignKey':'TrunkBackupId'});db[_0x2b55('0x19f')][_0x2b55('0x12c')](db[_0x2b55('0x91')],{'as':_0x2b55('0x91'),'foreignKey':_0x2b55('0x156')});db['Campaign'][_0x2b55('0x12c')](db['SquareProject'],{'as':'SquareProject','foreignKey':_0x2b55('0x1d1')});db[_0x2b55('0x19f')][_0x2b55('0x12f')](db[_0x2b55('0x103')],{'as':_0x2b55('0x131'),'through':_0x2b55('0x1d2')});db[_0x2b55('0x19f')][_0x2b55('0x12f')](db[_0x2b55('0x103')],{'as':_0x2b55('0x15a'),'through':'campaigns_has_cm_blacklists'});db[_0x2b55('0x17f')][_0x2b55('0x12c')](db[_0x2b55('0x71')],{'as':_0x2b55('0x71'),'foreignKey':'ChatOfflineMessageId'});db['MailTransferReport'][_0x2b55('0x12c')](db[_0x2b55('0x46')],{});db[_0x2b55('0xfb')][_0x2b55('0x12c')](db['MailInteraction'],{});db['MailTransferReport']['belongsTo'](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0x2b55('0x1d3')});db['MailTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x2b55('0x1d4'),'as':'FromAgent'});db['MailTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x2b55('0x1d5'),'as':_0x2b55('0x1d6')});db[_0x2b55('0xfb')][_0x2b55('0x12c')](db[_0x2b55('0x13a')],{'foreignKey':_0x2b55('0x1d7'),'as':'ToQueue'});db[_0x2b55('0xfb')][_0x2b55('0x12c')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0x2b55('0x1d8')});db[_0x2b55('0xfd')][_0x2b55('0x12c')](db[_0x2b55('0x70')],{});db[_0x2b55('0xfd')]['belongsTo'](db['ChatInteraction'],{});db['ChatTransferReport'][_0x2b55('0x12c')](db[_0x2b55('0x6b')],{'foreignKey':'FromChatWebsiteId','as':_0x2b55('0x1d3')});db[_0x2b55('0xfd')][_0x2b55('0x12c')](db['User'],{'foreignKey':_0x2b55('0x1d4'),'as':_0x2b55('0x1d9')});db[_0x2b55('0xfd')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'foreignKey':_0x2b55('0x1d5'),'as':_0x2b55('0x1d6')});db['ChatTransferReport'][_0x2b55('0x12c')](db[_0x2b55('0x73')],{'foreignKey':_0x2b55('0x1da'),'as':'ToQueue'});db[_0x2b55('0xfd')][_0x2b55('0x12c')](db[_0x2b55('0x6b')],{'foreignKey':'ToChatWebsiteId','as':'ToAccount'});db['FaxTransferReport'][_0x2b55('0x12c')](db[_0x2b55('0x54')],{});db[_0x2b55('0xff')]['belongsTo'](db[_0x2b55('0x52')],{});db[_0x2b55('0xff')][_0x2b55('0x12c')](db[_0x2b55('0x4f')],{'foreignKey':_0x2b55('0x1db'),'as':_0x2b55('0x1d3')});db['FaxTransferReport'][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x2b55('0xff')]['belongsTo'](db[_0x2b55('0x12')],{'foreignKey':'ToUserId','as':_0x2b55('0x1d6')});db[_0x2b55('0xff')][_0x2b55('0x12c')](db[_0x2b55('0x56')],{'foreignKey':_0x2b55('0x1dc'),'as':_0x2b55('0x1dd')});db[_0x2b55('0xff')]['belongsTo'](db[_0x2b55('0x4f')],{'foreignKey':_0x2b55('0x1de'),'as':_0x2b55('0x1d8')});db[_0x2b55('0x101')][_0x2b55('0x12c')](db['OpenchannelMessage'],{});db[_0x2b55('0x101')][_0x2b55('0x12c')](db[_0x2b55('0x66')],{});db[_0x2b55('0x101')][_0x2b55('0x12c')](db[_0x2b55('0x62')],{'foreignKey':'FromOpenchannelAccountId','as':'FromAccount'});db[_0x2b55('0x101')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'foreignKey':_0x2b55('0x1d4'),'as':_0x2b55('0x1d9')});db[_0x2b55('0x101')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'foreignKey':_0x2b55('0x1d5'),'as':_0x2b55('0x1d6')});db['OpenchannelTransferReport'][_0x2b55('0x12c')](db[_0x2b55('0x69')],{'foreignKey':_0x2b55('0x1df'),'as':'ToQueue'});db[_0x2b55('0x101')][_0x2b55('0x12c')](db[_0x2b55('0x62')],{'foreignKey':_0x2b55('0x1e0'),'as':'ToAccount'});db[_0x2b55('0x102')][_0x2b55('0x12c')](db[_0x2b55('0x185')],{});db['SmsTransferReport'][_0x2b55('0x12c')](db[_0x2b55('0x5d')],{});db['SmsTransferReport'][_0x2b55('0x12c')](db[_0x2b55('0x59')],{'foreignKey':'FromSmsAccountId','as':_0x2b55('0x1d3')});db[_0x2b55('0x102')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'foreignKey':_0x2b55('0x1d4'),'as':_0x2b55('0x1d9')});db[_0x2b55('0x102')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'foreignKey':_0x2b55('0x1d5'),'as':_0x2b55('0x1d6')});db['SmsTransferReport'][_0x2b55('0x12c')](db[_0x2b55('0x60')],{'foreignKey':_0x2b55('0x1e1'),'as':_0x2b55('0x1dd')});db[_0x2b55('0x102')][_0x2b55('0x12c')](db[_0x2b55('0x59')],{'foreignKey':_0x2b55('0x1e2'),'as':_0x2b55('0x1d8')});db[_0x2b55('0x103')][_0x2b55('0x11d')](db[_0x2b55('0x8d')],{'as':_0x2b55('0x166'),'foreignKey':'ListId','onDelete':_0x2b55('0x11c')});db[_0x2b55('0x103')]['hasMany'](db['CmCustomField'],{'as':_0x2b55('0x1e3'),'foreignKey':_0x2b55('0x16a')});db[_0x2b55('0x103')][_0x2b55('0x11d')](db[_0x2b55('0x7a')],{'as':_0x2b55('0x197'),'onDelete':_0x2b55('0x11c'),'foreignKey':_0x2b55('0x16a')});db[_0x2b55('0x103')][_0x2b55('0x11d')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'ListId'});db['CmList'][_0x2b55('0x11d')](db[_0x2b55('0x81')],{'as':_0x2b55('0x123'),'foreignKey':_0x2b55('0x16a')});db[_0x2b55('0x103')]['hasMany'](db[_0x2b55('0x83')],{'as':_0x2b55('0x83'),'foreignKey':_0x2b55('0x16a')});db['CmList']['belongsToMany'](db[_0x2b55('0x1b')],{'as':_0x2b55('0x1e4'),'through':_0x2b55('0x1e5')});db[_0x2b55('0x103')]['belongsToMany'](db[_0x2b55('0x12')],{'as':'Agents','through':'cm_user_has_lists'});db[_0x2b55('0x13f')][_0x2b55('0x11d')](db[_0x2b55('0x18')],{'as':'Extensions','onDelete':'cascade'});db[_0x2b55('0x13f')][_0x2b55('0x12f')](db[_0x2b55('0x12')],{'as':_0x2b55('0x16d'),'through':_0x2b55('0x141')});db[_0x2b55('0x106')]['hasMany'](db[_0x2b55('0x12')],{'as':'Users','foreignKey':_0x2b55('0x1e6')});db['UserProfile'][_0x2b55('0x11d')](db[_0x2b55('0x1e7')],{'as':_0x2b55('0x1e8'),'foreignKey':_0x2b55('0x1e6'),'onDelete':'cascade'});db['UserProfileSection'][_0x2b55('0x11d')](db[_0x2b55('0x109')],{'as':'Resources','foreignKey':_0x2b55('0x1e9'),'onDelete':_0x2b55('0x11c')});db[_0x2b55('0x10c')]['hasMany'](db[_0x2b55('0x8d')],{'as':_0x2b55('0x166'),'foreignKey':_0x2b55('0x1ea'),'onDelete':'cascade'});db[_0x2b55('0x10c')][_0x2b55('0x11d')](db[_0x2b55('0x8b')],{'as':'Answers','foreignKey':_0x2b55('0x1ea')});db[_0x2b55('0x10c')][_0x2b55('0x11d')](db[_0x2b55('0x111')],{'as':_0x2b55('0x15c'),'foreignKey':'WhatsappAccountId'});db[_0x2b55('0x10c')][_0x2b55('0x11d')](db[_0x2b55('0x129')],{'as':_0x2b55('0x167')});db['WhatsappAccount']['hasMany'](db[_0x2b55('0x10e')],{'as':'Applications'});db[_0x2b55('0x10c')][_0x2b55('0x12c')](db[_0x2b55('0x103')],{'as':'List','foreignKey':_0x2b55('0x16a')});db[_0x2b55('0x10c')][_0x2b55('0x12c')](db[_0x2b55('0x157')],{'as':'mandatoryDispositionPause','foreignKey':_0x2b55('0x17b')});db[_0x2b55('0x10c')][_0x2b55('0x12f')](db[_0x2b55('0x12')],{'as':_0x2b55('0x16d'),'through':_0x2b55('0x148')});db['WhatsappApplication'][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'onDelete':_0x2b55('0x178')});db[_0x2b55('0x10e')][_0x2b55('0x12c')](db['WhatsappQueue'],{'onDelete':'restrict'});db['WhatsappApplication'][_0x2b55('0x12c')](db[_0x2b55('0x10c')],{'onDelete':_0x2b55('0x178')});db[_0x2b55('0x10e')][_0x2b55('0x12c')](db[_0x2b55('0x91')],{'onDelete':_0x2b55('0x178'),'foreignKey':_0x2b55('0x156')});db[_0x2b55('0x10e')][_0x2b55('0x12c')](db[_0x2b55('0x99')],{'onDelete':_0x2b55('0x178'),'foreignKey':_0x2b55('0x186')});db[_0x2b55('0x129')]['hasMany'](db[_0x2b55('0x111')],{'as':'Messages','onDelete':_0x2b55('0x11c'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0x2b55('0x12c')](db['WhatsappAccount'],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0x2b55('0x129')][_0x2b55('0x12c')](db[_0x2b55('0x7a')],{'as':_0x2b55('0x162'),'foreignKey':_0x2b55('0x163')});db['WhatsappInteraction']['belongsTo'](db[_0x2b55('0x12')],{'as':_0x2b55('0x17e'),'foreignKey':_0x2b55('0x11f')});db[_0x2b55('0x129')]['belongsToMany'](db[_0x2b55('0x99')],{'through':_0x2b55('0x1b0'),'as':_0x2b55('0x170')});db['WhatsappInteraction']['belongsToMany'](db[_0x2b55('0x99')],{'through':_0x2b55('0x1b0'),'as':_0x2b55('0x172')});db[_0x2b55('0x129')][_0x2b55('0x12f')](db[_0x2b55('0x12')],{'as':_0x2b55('0x173'),'through':'user_has_whatsapp_interactions','foreignKey':_0x2b55('0x1eb')});db[_0x2b55('0x111')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'as':_0x2b55('0x12')});db[_0x2b55('0x111')][_0x2b55('0x12c')](db[_0x2b55('0x7a')],{'onDelete':_0x2b55('0x11c'),'as':_0x2b55('0x162')});db[_0x2b55('0x111')][_0x2b55('0x12c')](db[_0x2b55('0x129')],{'onDelete':'cascade','as':_0x2b55('0x174'),'foreignKey':_0x2b55('0x1eb')});db['WhatsappMessage'][_0x2b55('0x12c')](db[_0x2b55('0x10c')],{'as':_0x2b55('0x175'),'foreignKey':_0x2b55('0x1ea')});db[_0x2b55('0x1ec')][_0x2b55('0x12c')](db[_0x2b55('0x10c')],{});db[_0x2b55('0x1ec')]['belongsTo'](db['CmList'],{'as':_0x2b55('0x169'),'foreignKey':_0x2b55('0x16a')});db[_0x2b55('0x1ec')][_0x2b55('0x12c')](db[_0x2b55('0x7a')],{'as':_0x2b55('0x162'),'foreignKey':'ContactId'});db[_0x2b55('0x1ec')]['belongsTo'](db[_0x2b55('0x129')],{});db[_0x2b55('0x1ec')][_0x2b55('0x12c')](db[_0x2b55('0x1d0')],{});db[_0x2b55('0x1ec')][_0x2b55('0x12c')](db['WhatsappMessage'],{});db[_0x2b55('0x1ec')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{});db[_0x2b55('0x114')][_0x2b55('0x12c')](db[_0x2b55('0x111')],{});db['WhatsappTransferReport'][_0x2b55('0x12c')](db[_0x2b55('0x129')],{});db[_0x2b55('0x114')][_0x2b55('0x12c')](db[_0x2b55('0x10c')],{'foreignKey':_0x2b55('0x1ed'),'as':'FromAccount'});db[_0x2b55('0x114')][_0x2b55('0x12c')](db['WhatsappAccount'],{'foreignKey':_0x2b55('0x1ee'),'as':_0x2b55('0x1d8')});db[_0x2b55('0x114')]['belongsTo'](db[_0x2b55('0x1d0')],{'foreignKey':_0x2b55('0x1ef'),'as':_0x2b55('0x1dd')});db[_0x2b55('0x114')][_0x2b55('0x12c')](db[_0x2b55('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x2b55('0x114')][_0x2b55('0x12c')](db['User'],{'foreignKey':'ToUserId','as':_0x2b55('0x1d6')});db[_0x2b55('0x1d0')][_0x2b55('0x12f')](db[_0x2b55('0x12')],{'as':'Agents','through':_0x2b55('0x3c'),'foreignKey':_0x2b55('0x1f0')});db[_0x2b55('0x1d0')][_0x2b55('0x12f')](db[_0x2b55('0xf3')],{'through':_0x2b55('0x1f1'),'as':'Teams'});module[_0x2b55('0x1f2')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 003a030..3575510 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd781=['./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareRecording','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','/api/auth/google','./api/authGoogle','./api/jira','/api/rpc','/api/version','/api/pm2','./api/pm2','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','appPath','/index.html','password','lastName','mobile','email','clientId','clientSecret','code','tenantId','token','channelSecret','accessToken','authToken','consumerKey','consumerSecret','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','key','pass','accountSid','dsn','oldPassword','isPlainObject','isArray','isString','replace','@@{','}@@','includes','path','express','express-winston','./errors','./config/environment','./config/logger','api','auth','default','use','logger','body','\x20body=%s','format','method','headers','x-forwarded-for','remoteAddress','url','statusCode','user','name','role','inspect','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','responseTime','device','other','agent_name','test','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./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/mailInteraction','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','./api/schedule','/api/sounds','/api/tags','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings'];(function(_0x46df63,_0x5cbc34){var _0x236616=function(_0x3281ba){while(--_0x3281ba){_0x46df63['push'](_0x46df63['shift']());}};_0x236616(++_0x5cbc34);}(_0xd781,0x1b4));var _0x1d78=function(_0x49d9f4,_0x185ec9){_0x49d9f4=_0x49d9f4-0x0;var _0x7dd54c=_0xd781[_0x49d9f4];return _0x7dd54c;};'use strict';var _=require('lodash');var path=require(_0x1d78('0x0'));var express=require(_0x1d78('0x1'));var ewinston=require(_0x1d78('0x2'));var util=require('util');var errors=require(_0x1d78('0x3'));var config=require(_0x1d78('0x4'));var logger=require(_0x1d78('0x5'))(_0x1d78('0x6'));var authLogger=require('./config/logger')(_0x1d78('0x7'));exports[_0x1d78('0x8')]=function(_0x310582){_0x310582[_0x1d78('0x9')](ewinston[_0x1d78('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x4b3d34,_0x4ed6a7){var _0x1a547e='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x4b3d34[_0x1d78('0xb')])){_0x1a547e+=_0x1d78('0xc');var _0x212268=_0x4b3d34[_0x1d78('0xb')];maskSensitiveData(_0x212268);}return util[_0x1d78('0xd')](_0x1a547e,_0x4b3d34[_0x1d78('0xe')],_0x4b3d34[_0x1d78('0xf')][_0x1d78('0x10')]?_0x4b3d34[_0x1d78('0xf')][_0x1d78('0x10')]:_0x4b3d34['connection'][_0x1d78('0x11')]||_0x4b3d34['ip'],_0x4b3d34[_0x1d78('0x12')],_0x4ed6a7[_0x1d78('0x13')],_0x4ed6a7['responseTime'],_0x4b3d34['user']?_0x4b3d34[_0x1d78('0x14')]['id']:null,_0x4b3d34[_0x1d78('0x14')]?_0x4b3d34[_0x1d78('0x14')][_0x1d78('0x15')]:null,_0x4b3d34['user']?_0x4b3d34[_0x1d78('0x14')][_0x1d78('0x16')]:null,_0x212268?util[_0x1d78('0x17')](_0x212268,![],null):'');}}));_0x310582[_0x1d78('0x9')](ewinston[_0x1d78('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x428b40,_0x10f28d){var _0x169710='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x428b40[_0x1d78('0xb')]&&_0x428b40[_0x1d78('0xb')]['device']&&_0x428b40[_0x1d78('0xb')][_0x1d78('0x18')]){_0x169710=_0x1d78('0x19');}return util[_0x1d78('0xd')](_0x169710,_0x428b40['method'],_0x428b40['headers'][_0x1d78('0x10')]?_0x428b40['headers'][_0x1d78('0x10')]:_0x428b40[_0x1d78('0x1a')][_0x1d78('0x11')]||_0x428b40['ip'],_0x428b40[_0x1d78('0x12')],_0x10f28d[_0x1d78('0x13')],_0x10f28d[_0x1d78('0x1b')],_0x428b40['user']?_0x428b40['user']['id']:null,_0x428b40[_0x1d78('0x14')]?_0x428b40[_0x1d78('0x14')][_0x1d78('0x15')]:null,_0x428b40[_0x1d78('0x14')]?_0x428b40[_0x1d78('0x14')][_0x1d78('0x16')]:null,_0x428b40['body']&&_0x428b40[_0x1d78('0xb')][_0x1d78('0x1c')]?_0x428b40[_0x1d78('0xb')][_0x1d78('0x1c')]:_0x1d78('0x1d'),_0x428b40[_0x1d78('0xb')]&&_0x428b40[_0x1d78('0xb')][_0x1d78('0x18')]?_0x428b40['body'][_0x1d78('0x18')]:'',_0x428b40[_0x1d78('0xb')]&&_0x428b40[_0x1d78('0xb')][_0x1d78('0x1e')]?_0x428b40[_0x1d78('0xb')]['agent_name']:'');},'ignoreRoute':function(_0x30c6b4){var _0x1a442c=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1a442c[_0x1d78('0x1f')](_0x30c6b4[_0x1d78('0x12')]);}}));_0x310582[_0x1d78('0x9')](_0x1d78('0x20'),require(_0x1d78('0x21')));_0x310582['use']('/api/voice/chanspy',require(_0x1d78('0x22')));_0x310582[_0x1d78('0x9')](_0x1d78('0x23'),require(_0x1d78('0x24')));_0x310582['use']('/api/voice/extensions',require(_0x1d78('0x25')));_0x310582[_0x1d78('0x9')](_0x1d78('0x26'),require(_0x1d78('0x27')));_0x310582['use'](_0x1d78('0x28'),require(_0x1d78('0x29')));_0x310582[_0x1d78('0x9')](_0x1d78('0x2a'),require(_0x1d78('0x2b')));_0x310582['use'](_0x1d78('0x2c'),require('./api/screenRecording'));_0x310582[_0x1d78('0x9')](_0x1d78('0x2d'),require('./api/voiceMail'));_0x310582[_0x1d78('0x9')](_0x1d78('0x2e'),require(_0x1d78('0x2f')));_0x310582['use'](_0x1d78('0x30'),require(_0x1d78('0x31')));_0x310582[_0x1d78('0x9')]('/api/voice/dials/reports',require(_0x1d78('0x32')));_0x310582[_0x1d78('0x9')](_0x1d78('0x33'),require(_0x1d78('0x34')));_0x310582['use'](_0x1d78('0x35'),require(_0x1d78('0x36')));_0x310582[_0x1d78('0x9')](_0x1d78('0x37'),require(_0x1d78('0x38')));_0x310582[_0x1d78('0x9')](_0x1d78('0x39'),require(_0x1d78('0x3a')));_0x310582[_0x1d78('0x9')]('/api/voice/transfers/reports',require(_0x1d78('0x3b')));_0x310582[_0x1d78('0x9')](_0x1d78('0x3c'),require(_0x1d78('0x3d')));_0x310582[_0x1d78('0x9')](_0x1d78('0x3e'),require(_0x1d78('0x3f')));_0x310582[_0x1d78('0x9')](_0x1d78('0x40'),require(_0x1d78('0x41')));_0x310582['use'](_0x1d78('0x42'),require(_0x1d78('0x43')));_0x310582[_0x1d78('0x9')]('/api/mail/interactions',require(_0x1d78('0x44')));_0x310582[_0x1d78('0x9')]('/api/mail/messages',require('./api/mailMessage'));_0x310582[_0x1d78('0x9')](_0x1d78('0x45'),require('./api/mailApplication'));_0x310582[_0x1d78('0x9')](_0x1d78('0x46'),require(_0x1d78('0x47')));_0x310582[_0x1d78('0x9')](_0x1d78('0x48'),require('./api/dashboard'));_0x310582['use'](_0x1d78('0x49'),require(_0x1d78('0x4a')));_0x310582[_0x1d78('0x9')](_0x1d78('0x4b'),require(_0x1d78('0x4c')));_0x310582[_0x1d78('0x9')](_0x1d78('0x4d'),require(_0x1d78('0x4e')));_0x310582[_0x1d78('0x9')](_0x1d78('0x4f'),require(_0x1d78('0x50')));_0x310582[_0x1d78('0x9')](_0x1d78('0x51'),require('./api/faxMessage'));_0x310582[_0x1d78('0x9')](_0x1d78('0x52'),require(_0x1d78('0x53')));_0x310582[_0x1d78('0x9')](_0x1d78('0x54'),require('./api/faxQueueReport'));_0x310582[_0x1d78('0x9')]('/api/sms/accounts',require('./api/smsAccount'));_0x310582[_0x1d78('0x9')](_0x1d78('0x55'),require(_0x1d78('0x56')));_0x310582['use'](_0x1d78('0x57'),require(_0x1d78('0x58')));_0x310582[_0x1d78('0x9')](_0x1d78('0x59'),require(_0x1d78('0x5a')));_0x310582[_0x1d78('0x9')](_0x1d78('0x5b'),require(_0x1d78('0x5c')));_0x310582[_0x1d78('0x9')](_0x1d78('0x5d'),require(_0x1d78('0x5e')));_0x310582['use'](_0x1d78('0x5f'),require(_0x1d78('0x60')));_0x310582[_0x1d78('0x9')](_0x1d78('0x61'),require('./api/openchannelInteraction'));_0x310582['use'](_0x1d78('0x62'),require(_0x1d78('0x63')));_0x310582[_0x1d78('0x9')](_0x1d78('0x64'),require('./api/openchannelQueue'));_0x310582[_0x1d78('0x9')](_0x1d78('0x65'),require('./api/chatWebsite'));_0x310582['use'](_0x1d78('0x66'),require(_0x1d78('0x67')));_0x310582[_0x1d78('0x9')](_0x1d78('0x68'),require(_0x1d78('0x69')));_0x310582[_0x1d78('0x9')](_0x1d78('0x6a'),require('./api/chatInteraction'));_0x310582[_0x1d78('0x9')](_0x1d78('0x6b'),require(_0x1d78('0x6c')));_0x310582['use'](_0x1d78('0x6d'),require(_0x1d78('0x6e')));_0x310582['use'](_0x1d78('0x6f'),require(_0x1d78('0x70')));_0x310582[_0x1d78('0x9')](_0x1d78('0x71'),require(_0x1d78('0x72')));_0x310582[_0x1d78('0x9')]('/api/chat/proactive_actions',require(_0x1d78('0x73')));_0x310582['use']('/api/cm/companies',require('./api/cmCompany'));_0x310582[_0x1d78('0x9')](_0x1d78('0x74'),require(_0x1d78('0x75')));_0x310582[_0x1d78('0x9')](_0x1d78('0x76'),require(_0x1d78('0x77')));_0x310582[_0x1d78('0x9')](_0x1d78('0x78'),require(_0x1d78('0x79')));_0x310582[_0x1d78('0x9')](_0x1d78('0x7a'),require(_0x1d78('0x7b')));_0x310582['use']('/api/cm/hopper_history',require(_0x1d78('0x7c')));_0x310582['use'](_0x1d78('0x7d'),require('./api/cmCustomField'));_0x310582[_0x1d78('0x9')](_0x1d78('0x7e'),require(_0x1d78('0x7f')));_0x310582[_0x1d78('0x9')](_0x1d78('0x80'),require(_0x1d78('0x81')));_0x310582[_0x1d78('0x9')]('/api/canned_answers',require(_0x1d78('0x82')));_0x310582[_0x1d78('0x9')](_0x1d78('0x83'),require(_0x1d78('0x84')));_0x310582[_0x1d78('0x9')]('/api/conditions',require(_0x1d78('0x85')));_0x310582[_0x1d78('0x9')](_0x1d78('0x86'),require(_0x1d78('0x87')));_0x310582['use'](_0x1d78('0x88'),require(_0x1d78('0x89')));_0x310582[_0x1d78('0x9')](_0x1d78('0x8a'),require(_0x1d78('0x8b')));_0x310582[_0x1d78('0x9')]('/api/voiceQueuesLog',require(_0x1d78('0x8c')));_0x310582[_0x1d78('0x9')]('/api/schedules',require(_0x1d78('0x8d')));_0x310582[_0x1d78('0x9')](_0x1d78('0x8e'),require('./api/sound'));_0x310582[_0x1d78('0x9')](_0x1d78('0x8f'),require('./api/tag'));_0x310582[_0x1d78('0x9')](_0x1d78('0x90'),require(_0x1d78('0x91')));_0x310582[_0x1d78('0x9')](_0x1d78('0x92'),require(_0x1d78('0x93')));_0x310582[_0x1d78('0x9')](_0x1d78('0x94'),require(_0x1d78('0x95')));_0x310582['use']('/api/integrations',require(_0x1d78('0x96')));_0x310582[_0x1d78('0x9')](_0x1d78('0x97'),require('./api/integrationReport'));_0x310582[_0x1d78('0x9')](_0x1d78('0x98'),require(_0x1d78('0x99')));_0x310582[_0x1d78('0x9')]('/api/analytics/default_reports',require(_0x1d78('0x9a')));_0x310582['use'](_0x1d78('0x9b'),require(_0x1d78('0x9c')));_0x310582[_0x1d78('0x9')]('/api/analytics/metrics',require(_0x1d78('0x9d')));_0x310582[_0x1d78('0x9')](_0x1d78('0x9e'),require(_0x1d78('0x9f')));_0x310582[_0x1d78('0x9')](_0x1d78('0xa0'),require(_0x1d78('0xa1')));_0x310582[_0x1d78('0x9')](_0x1d78('0xa2'),require('./api/intSalesforceAccount'));_0x310582['use'](_0x1d78('0xa3'),require(_0x1d78('0xa4')));_0x310582['use'](_0x1d78('0xa5'),require(_0x1d78('0xa6')));_0x310582['use'](_0x1d78('0xa7'),require(_0x1d78('0xa8')));_0x310582[_0x1d78('0x9')](_0x1d78('0xa9'),require(_0x1d78('0xaa')));_0x310582[_0x1d78('0x9')]('/api/integrations/sugarcrm/fields',require(_0x1d78('0xab')));_0x310582[_0x1d78('0x9')](_0x1d78('0xac'),require(_0x1d78('0xad')));_0x310582['use'](_0x1d78('0xae'),require('./api/intDeskConfiguration'));_0x310582[_0x1d78('0x9')](_0x1d78('0xaf'),require(_0x1d78('0xb0')));_0x310582[_0x1d78('0x9')](_0x1d78('0xb1'),require(_0x1d78('0xb2')));_0x310582['use'](_0x1d78('0xb3'),require(_0x1d78('0xb4')));_0x310582[_0x1d78('0x9')](_0x1d78('0xb5'),require(_0x1d78('0xb6')));_0x310582[_0x1d78('0x9')]('/api/integrations/zendesk/accounts',require(_0x1d78('0xb7')));_0x310582[_0x1d78('0x9')](_0x1d78('0xb8'),require(_0x1d78('0xb9')));_0x310582[_0x1d78('0x9')](_0x1d78('0xba'),require(_0x1d78('0xbb')));_0x310582['use']('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x310582[_0x1d78('0x9')]('/api/integrations/freshdesk/configurations',require(_0x1d78('0xbc')));_0x310582[_0x1d78('0x9')](_0x1d78('0xbd'),require(_0x1d78('0xbe')));_0x310582[_0x1d78('0x9')](_0x1d78('0xbf'),require(_0x1d78('0xc0')));_0x310582['use'](_0x1d78('0xc1'),require(_0x1d78('0xc2')));_0x310582[_0x1d78('0x9')](_0x1d78('0xc3'),require(_0x1d78('0xc4')));_0x310582['use']('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x310582[_0x1d78('0x9')]('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x310582[_0x1d78('0x9')](_0x1d78('0xc5'),require(_0x1d78('0xc6')));_0x310582['use'](_0x1d78('0xc7'),require(_0x1d78('0xc8')));_0x310582['use'](_0x1d78('0xc9'),require(_0x1d78('0xca')));_0x310582[_0x1d78('0x9')](_0x1d78('0xcb'),require(_0x1d78('0xcc')));_0x310582[_0x1d78('0x9')](_0x1d78('0xcd'),require(_0x1d78('0xce')));_0x310582[_0x1d78('0x9')](_0x1d78('0xcf'),require('./api/intFreshsalesConfiguration'));_0x310582[_0x1d78('0x9')](_0x1d78('0xd0'),require(_0x1d78('0xd1')));_0x310582[_0x1d78('0x9')]('/api/networks',require(_0x1d78('0xd2')));_0x310582['use'](_0x1d78('0xd3'),require(_0x1d78('0xd4')));_0x310582['use']('/api/chat/internal/messages',require(_0x1d78('0xd5')));_0x310582[_0x1d78('0x9')](_0x1d78('0xd6'),require(_0x1d78('0xd7')));_0x310582['use']('/api/jscripty/questions/reports',require(_0x1d78('0xd8')));_0x310582[_0x1d78('0x9')](_0x1d78('0xd9'),require(_0x1d78('0xda')));_0x310582[_0x1d78('0x9')]('/api/sms/reports/queue',require(_0x1d78('0xdb')));_0x310582[_0x1d78('0x9')](_0x1d78('0xdc'),require('./api/squareReport'));_0x310582[_0x1d78('0x9')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x310582[_0x1d78('0x9')](_0x1d78('0xdd'),require(_0x1d78('0xde')));_0x310582[_0x1d78('0x9')](_0x1d78('0xdf'),require(_0x1d78('0xe0')));_0x310582[_0x1d78('0x9')](_0x1d78('0xe1'),require(_0x1d78('0xe2')));_0x310582[_0x1d78('0x9')]('/api/square/projects',require('./api/squareProject'));_0x310582['use']('/api/square/recordings',require(_0x1d78('0xe3')));_0x310582[_0x1d78('0x9')]('/api/square/messages',require('./api/squareMessage'));_0x310582[_0x1d78('0x9')](_0x1d78('0xe4'),require(_0x1d78('0xe5')));_0x310582[_0x1d78('0x9')](_0x1d78('0xe6'),require(_0x1d78('0xe7')));_0x310582['use'](_0x1d78('0xe8'),require(_0x1d78('0xe9')));_0x310582[_0x1d78('0x9')](_0x1d78('0xea'),require(_0x1d78('0xeb')));_0x310582[_0x1d78('0x9')](_0x1d78('0xec'),require(_0x1d78('0xed')));_0x310582['use'](_0x1d78('0xee'),require(_0x1d78('0xef')));_0x310582['use'](_0x1d78('0xf0'),require(_0x1d78('0xf1')));_0x310582[_0x1d78('0x9')](_0x1d78('0xf2'),require(_0x1d78('0xf3')));_0x310582[_0x1d78('0x9')](_0x1d78('0xf4'),require(_0x1d78('0xf5')));_0x310582['use'](_0x1d78('0xf6'),require(_0x1d78('0xf7')));_0x310582[_0x1d78('0x9')](_0x1d78('0xf8'),require(_0x1d78('0xf9')));_0x310582[_0x1d78('0x9')](_0x1d78('0xfa'),require(_0x1d78('0xfb')));_0x310582[_0x1d78('0x9')]('/api/voice/prefixes',require(_0x1d78('0xfc')));_0x310582[_0x1d78('0x9')](_0x1d78('0xfd'),require(_0x1d78('0xfe')));_0x310582['use'](_0x1d78('0xff'),require(_0x1d78('0x100')));_0x310582[_0x1d78('0x9')](_0x1d78('0x101'),require(_0x1d78('0x102')));_0x310582[_0x1d78('0x9')](_0x1d78('0x103'),require('./api/userNotification'));_0x310582[_0x1d78('0x9')](_0x1d78('0x104'),require(_0x1d78('0x105')));_0x310582['use'](_0x1d78('0x106'),require(_0x1d78('0x107')));_0x310582['use'](_0x1d78('0x108'),require('./api/whatsappInteraction'));_0x310582['use'](_0x1d78('0x109'),require(_0x1d78('0x10a')));_0x310582[_0x1d78('0x9')](_0x1d78('0x10b'),require(_0x1d78('0x10c')));_0x310582[_0x1d78('0x9')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x310582['use'](_0x1d78('0x10d'),require(_0x1d78('0x10e')));_0x310582['use'](_0x1d78('0x10f'),require(_0x1d78('0x110')));_0x310582[_0x1d78('0x9')](_0x1d78('0x111'),require(_0x1d78('0x112')));_0x310582['use'](_0x1d78('0x113'),require('./api/authLocal'));_0x310582[_0x1d78('0x9')](_0x1d78('0x114'),require(_0x1d78('0x115')));_0x310582[_0x1d78('0x9')]('/api/jira',require(_0x1d78('0x116')));_0x310582[_0x1d78('0x9')](_0x1d78('0x117'),require('./api/rpc'));_0x310582[_0x1d78('0x9')](_0x1d78('0x118'),require('./api/version'));_0x310582[_0x1d78('0x9')]('/api/system',require('./api/system'));_0x310582[_0x1d78('0x9')](_0x1d78('0x119'),require(_0x1d78('0x11a')));_0x310582[_0x1d78('0x9')]('/api/webbar',require('./api/webbar'));_0x310582[_0x1d78('0x9')](_0x1d78('0x11b'),express[_0x1d78('0x11c')](path[_0x1d78('0x11d')](config[_0x1d78('0x11e')],_0x1d78('0x11b'))));_0x310582[_0x1d78('0x9')](_0x1d78('0x11f'),express[_0x1d78('0x11c')](path[_0x1d78('0x11d')](config['root'],_0x1d78('0x11f'))));_0x310582[_0x1d78('0x9')](_0x1d78('0x120'),express[_0x1d78('0x11c')](path[_0x1d78('0x11d')](config[_0x1d78('0x11e')],_0x1d78('0x120'))));_0x310582['use'](_0x1d78('0x121'),express[_0x1d78('0x11c')](path['join'](config['root'],_0x1d78('0x122'),_0x1d78('0x123'))));_0x310582[_0x1d78('0x9')]('/plugins',express[_0x1d78('0x11c')](path[_0x1d78('0x11d')](config[_0x1d78('0x11e')],_0x1d78('0x124'))));_0x310582[_0x1d78('0x125')](_0x1d78('0x126'))[_0x1d78('0x127')](errors[0x194]);_0x310582[_0x1d78('0x125')]('/*')[_0x1d78('0x127')](function(_0xbd6f54,_0x13e09f){_0x13e09f['sendFile'](path['resolve'](_0x310582['get'](_0x1d78('0x128'))+_0x1d78('0x129')));});};var sensitiveFields=['username',_0x1d78('0x12a'),'newPassword','apiKey','firstName',_0x1d78('0x12b'),'street','phone',_0x1d78('0x12c'),'fax',_0x1d78('0x12d'),_0x1d78('0x12e'),_0x1d78('0x12f'),'securityToken',_0x1d78('0x130'),'accessKey',_0x1d78('0x131'),_0x1d78('0x132'),_0x1d78('0x133'),_0x1d78('0x134'),'accessTokenSecret',_0x1d78('0x135'),_0x1d78('0x136'),_0x1d78('0x137'),_0x1d78('0x138'),'calleridname','calleridnum',_0x1d78('0x139'),_0x1d78('0x13a'),_0x1d78('0x13b'),_0x1d78('0x13c'),_0x1d78('0x13d'),'secretaccesskey',_0x1d78('0x13e'),_0x1d78('0x14'),_0x1d78('0x13f'),_0x1d78('0x140'),'localstationid',_0x1d78('0x141'),'secret','registry',_0x1d78('0x142')];function maskSensitiveData(_0x4d98c3){var _0x250288=/(?!^)[\s\S](?!$)/g;if(!_[_0x1d78('0x143')](_0x4d98c3))return;for(var _0x37983b in _0x4d98c3){if(_[_0x1d78('0x144')](_0x4d98c3[_0x37983b])){for(var _0x2c905e=0x0;_0x2c905e<_0x4d98c3[_0x37983b]['length'];_0x2c905e++){maskSensitiveData(_0x4d98c3[_0x37983b][_0x2c905e]);}}else if(_[_0x1d78('0x143')](_0x4d98c3[_0x37983b])){maskSensitiveData(_0x4d98c3[_0x37983b]);}else if(_[_0x1d78('0x145')](_0x4d98c3[_0x37983b])){_0x4d98c3[_0x37983b]=_0x4d98c3[_0x37983b][_0x1d78('0x146')](/{{{/g,_0x1d78('0x147'))['replace'](/}}}/g,_0x1d78('0x148'))[_0x1d78('0x146')](/{{/g,'@{')[_0x1d78('0x146')](/}}/g,'}@');if(_[_0x1d78('0x149')](sensitiveFields,_0x37983b)){_0x4d98c3[_0x37983b]=_0x4d98c3[_0x37983b]['replace'](_0x250288,'*');}}}} \ No newline at end of file +var _0x89ee=['/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatGroup','./api/chatProactiveAction','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','/api/sounds','/api/tags','./api/tag','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./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/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/plugin','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','static','root','/www','join','/demo','/snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','newPassword','apiKey','lastName','street','mobile','email','clientId','securityToken','code','accessKey','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','key','pass','accountSid','localstationid','dsn','registry','oldPassword','isPlainObject','isString','@@{','replace','includes','path','express-winston','util','./errors','./config/environment','./config/logger','api','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','/api/mail/messages','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications'];(function(_0x200c4f,_0x13b3ff){var _0x28588c=function(_0x168a65){while(--_0x168a65){_0x200c4f['push'](_0x200c4f['shift']());}};_0x28588c(++_0x13b3ff);}(_0x89ee,0xd9));var _0xe89e=function(_0x589f2e,_0x5df7c9){_0x589f2e=_0x589f2e-0x0;var _0xd3233f=_0x89ee[_0x589f2e];return _0xd3233f;};'use strict';var _=require('lodash');var path=require(_0xe89e('0x0'));var express=require('express');var ewinston=require(_0xe89e('0x1'));var util=require(_0xe89e('0x2'));var errors=require(_0xe89e('0x3'));var config=require(_0xe89e('0x4'));var logger=require(_0xe89e('0x5'))(_0xe89e('0x6'));var authLogger=require(_0xe89e('0x5'))('auth');exports['default']=function(_0x339b34){_0x339b34[_0xe89e('0x7')](ewinston[_0xe89e('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x371220,_0x182805){var _0x5161fd=_0xe89e('0x9');if(!_[_0xe89e('0xa')](_0x371220[_0xe89e('0xb')])){_0x5161fd+=_0xe89e('0xc');var _0x13aae8=_0x371220[_0xe89e('0xb')];maskSensitiveData(_0x13aae8);}return util[_0xe89e('0xd')](_0x5161fd,_0x371220['method'],_0x371220[_0xe89e('0xe')][_0xe89e('0xf')]?_0x371220[_0xe89e('0xe')]['x-forwarded-for']:_0x371220[_0xe89e('0x10')][_0xe89e('0x11')]||_0x371220['ip'],_0x371220[_0xe89e('0x12')],_0x182805[_0xe89e('0x13')],_0x182805[_0xe89e('0x14')],_0x371220['user']?_0x371220[_0xe89e('0x15')]['id']:null,_0x371220[_0xe89e('0x15')]?_0x371220[_0xe89e('0x15')][_0xe89e('0x16')]:null,_0x371220[_0xe89e('0x15')]?_0x371220[_0xe89e('0x15')][_0xe89e('0x17')]:null,_0x13aae8?util[_0xe89e('0x18')](_0x13aae8,![],null):'');}}));_0x339b34[_0xe89e('0x7')](ewinston[_0xe89e('0x8')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x108def,_0x3abb9f){var _0x52baac='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x108def[_0xe89e('0xb')]&&_0x108def['body'][_0xe89e('0x19')]&&_0x108def[_0xe89e('0xb')][_0xe89e('0x1a')]){_0x52baac=_0xe89e('0x1b');}return util['format'](_0x52baac,_0x108def['method'],_0x108def[_0xe89e('0xe')]['x-forwarded-for']?_0x108def['headers']['x-forwarded-for']:_0x108def[_0xe89e('0x10')][_0xe89e('0x11')]||_0x108def['ip'],_0x108def['url'],_0x3abb9f[_0xe89e('0x13')],_0x3abb9f[_0xe89e('0x14')],_0x108def[_0xe89e('0x15')]?_0x108def['user']['id']:null,_0x108def[_0xe89e('0x15')]?_0x108def['user'][_0xe89e('0x16')]:null,_0x108def['user']?_0x108def[_0xe89e('0x15')]['role']:null,_0x108def[_0xe89e('0xb')]&&_0x108def[_0xe89e('0xb')][_0xe89e('0x19')]?_0x108def['body'][_0xe89e('0x19')]:_0xe89e('0x1c'),_0x108def[_0xe89e('0xb')]&&_0x108def[_0xe89e('0xb')][_0xe89e('0x1a')]?_0x108def[_0xe89e('0xb')][_0xe89e('0x1a')]:'',_0x108def[_0xe89e('0xb')]&&_0x108def[_0xe89e('0xb')]['agent_name']?_0x108def[_0xe89e('0xb')]['agent_name']:'');},'ignoreRoute':function(_0x28eebd){var _0x5b010b=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5b010b['test'](_0x28eebd[_0xe89e('0x12')]);}}));_0x339b34[_0xe89e('0x7')](_0xe89e('0x1d'),require(_0xe89e('0x1e')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x1f'),require(_0xe89e('0x20')));_0x339b34['use'](_0xe89e('0x21'),require(_0xe89e('0x22')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x23'),require(_0xe89e('0x24')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x25'),require(_0xe89e('0x26')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x27'),require('./api/voiceQueue'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x28'),require(_0xe89e('0x29')));_0x339b34['use'](_0xe89e('0x2a'),require(_0xe89e('0x2b')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x2c'),require('./api/voiceMail'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x2d'),require('./api/voiceMailMessage'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x2e'),require(_0xe89e('0x2f')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x30'),require(_0xe89e('0x31')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x32'),require(_0xe89e('0x33')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x34'),require('./api/voiceQueueReport'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x35'),require(_0xe89e('0x36')));_0x339b34[_0xe89e('0x7')]('/api/trunks',require(_0xe89e('0x37')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x38'),require('./api/voiceTransferReport'));_0x339b34['use'](_0xe89e('0x39'),require('./api/mailServerOut'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x3a'),require('./api/mailAccount'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x3b'),require(_0xe89e('0x3c')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x3d'),require('./api/mailSubstatus'));_0x339b34['use'](_0xe89e('0x3e'),require('./api/mailInteraction'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x3f'),require('./api/mailMessage'));_0x339b34[_0xe89e('0x7')]('/api/mail/applications',require(_0xe89e('0x40')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x41'),require('./api/mailQueueReport'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x42'),require(_0xe89e('0x43')));_0x339b34['use'](_0xe89e('0x44'),require(_0xe89e('0x45')));_0x339b34['use'](_0xe89e('0x46'),require(_0xe89e('0x47')));_0x339b34['use'](_0xe89e('0x48'),require(_0xe89e('0x49')));_0x339b34['use'](_0xe89e('0x4a'),require('./api/faxInteraction'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x4b'),require('./api/faxMessage'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x4c'),require(_0xe89e('0x4d')));_0x339b34[_0xe89e('0x7')]('/api/fax/reports/queue',require(_0xe89e('0x4e')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x4f'),require(_0xe89e('0x50')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x51'),require('./api/smsApplication'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x52'),require(_0xe89e('0x53')));_0x339b34['use'](_0xe89e('0x54'),require(_0xe89e('0x55')));_0x339b34[_0xe89e('0x7')]('/api/sms/queues',require('./api/smsQueue'));_0x339b34[_0xe89e('0x7')]('/api/openchannel/accounts',require(_0xe89e('0x56')));_0x339b34['use'](_0xe89e('0x57'),require(_0xe89e('0x58')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x59'),require(_0xe89e('0x5a')));_0x339b34[_0xe89e('0x7')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x5b'),require(_0xe89e('0x5c')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x5d'),require(_0xe89e('0x5e')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x5f'),require('./api/openchannelQueueReport'));_0x339b34['use'](_0xe89e('0x60'),require('./api/chatApplication'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x61'),require(_0xe89e('0x62')));_0x339b34['use'](_0xe89e('0x63'),require(_0xe89e('0x64')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x65'),require('./api/chatOfflineMessage'));_0x339b34['use'](_0xe89e('0x66'),require('./api/chatQueue'));_0x339b34['use']('/api/chat/groups',require(_0xe89e('0x67')));_0x339b34['use']('/api/chat/proactive_actions',require(_0xe89e('0x68')));_0x339b34[_0xe89e('0x7')]('/api/cm/companies',require('./api/cmCompany'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x69'),require(_0xe89e('0x6a')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x6b'),require(_0xe89e('0x6c')));_0x339b34[_0xe89e('0x7')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x6d'),require(_0xe89e('0x6e')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x6f'),require('./api/cmHopperHistory'));_0x339b34['use']('/api/cm/custom_fields',require('./api/cmCustomField'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x70'),require(_0xe89e('0x71')));_0x339b34['use'](_0xe89e('0x72'),require(_0xe89e('0x73')));_0x339b34[_0xe89e('0x7')]('/api/canned_answers',require(_0xe89e('0x74')));_0x339b34['use'](_0xe89e('0x75'),require('./api/disposition'));_0x339b34['use'](_0xe89e('0x76'),require(_0xe89e('0x77')));_0x339b34['use'](_0xe89e('0x78'),require(_0xe89e('0x79')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x7a'),require(_0xe89e('0x7b')));_0x339b34['use'](_0xe89e('0x7c'),require(_0xe89e('0x7d')));_0x339b34[_0xe89e('0x7')]('/api/voiceQueuesLog',require(_0xe89e('0x7e')));_0x339b34['use'](_0xe89e('0x7f'),require('./api/schedule'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x80'),require('./api/sound'));_0x339b34['use'](_0xe89e('0x81'),require(_0xe89e('0x82')));_0x339b34[_0xe89e('0x7')]('/api/templates',require(_0xe89e('0x83')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x84'),require(_0xe89e('0x85')));_0x339b34[_0xe89e('0x7')]('/api/variables',require(_0xe89e('0x86')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x87'),require('./api/integration'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x88'),require(_0xe89e('0x89')));_0x339b34[_0xe89e('0x7')]('/api/analytics/custom_reports',require(_0xe89e('0x8a')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x8b'),require(_0xe89e('0x8c')));_0x339b34['use']('/api/analytics/extracted_reports',require(_0xe89e('0x8d')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x8e'),require(_0xe89e('0x8f')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x90'),require(_0xe89e('0x91')));_0x339b34['use'](_0xe89e('0x92'),require(_0xe89e('0x93')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x94'),require(_0xe89e('0x95')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x96'),require(_0xe89e('0x97')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x98'),require(_0xe89e('0x99')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x9a'),require(_0xe89e('0x9b')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x9c'),require(_0xe89e('0x9d')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x9e'),require(_0xe89e('0x9f')));_0x339b34[_0xe89e('0x7')]('/api/integrations/desk/accounts',require(_0xe89e('0xa0')));_0x339b34[_0xe89e('0x7')]('/api/integrations/desk/configurations',require(_0xe89e('0xa1')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xa2'),require(_0xe89e('0xa3')));_0x339b34[_0xe89e('0x7')]('/api/integrations/zoho/accounts',require(_0xe89e('0xa4')));_0x339b34[_0xe89e('0x7')]('/api/integrations/zoho/configurations',require(_0xe89e('0xa5')));_0x339b34['use'](_0xe89e('0xa6'),require('./api/intZohoField'));_0x339b34[_0xe89e('0x7')](_0xe89e('0xa7'),require(_0xe89e('0xa8')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xa9'),require(_0xe89e('0xaa')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xab'),require(_0xe89e('0xac')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xad'),require(_0xe89e('0xae')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xaf'),require(_0xe89e('0xb0')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xb1'),require(_0xe89e('0xb2')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xb3'),require('./api/intVtigerAccount'));_0x339b34[_0xe89e('0x7')](_0xe89e('0xb4'),require(_0xe89e('0xb5')));_0x339b34[_0xe89e('0x7')]('/api/integrations/vtiger/fields',require(_0xe89e('0xb6')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xb7'),require(_0xe89e('0xb8')));_0x339b34['use'](_0xe89e('0xb9'),require(_0xe89e('0xba')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xbb'),require(_0xe89e('0xbc')));_0x339b34[_0xe89e('0x7')]('/api/integrations/dynamics365/accounts',require(_0xe89e('0xbd')));_0x339b34['use'](_0xe89e('0xbe'),require('./api/intDynamics365Configuration'));_0x339b34[_0xe89e('0x7')](_0xe89e('0xbf'),require(_0xe89e('0xc0')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xc1'),require('./api/intFreshsalesAccount'));_0x339b34[_0xe89e('0x7')]('/api/integrations/freshsales/configurations',require(_0xe89e('0xc2')));_0x339b34[_0xe89e('0x7')]('/api/integrations/freshsales/fields',require(_0xe89e('0xc3')));_0x339b34['use'](_0xe89e('0xc4'),require(_0xe89e('0xc5')));_0x339b34['use']('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x339b34[_0xe89e('0x7')](_0xe89e('0xc6'),require('./api/chatInternalMessage'));_0x339b34[_0xe89e('0x7')](_0xe89e('0xc7'),require(_0xe89e('0xc8')));_0x339b34[_0xe89e('0x7')]('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x339b34[_0xe89e('0x7')]('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x339b34[_0xe89e('0x7')](_0xe89e('0xc9'),require(_0xe89e('0xca')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xcb'),require(_0xe89e('0xcc')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xcd'),require(_0xe89e('0xce')));_0x339b34[_0xe89e('0x7')]('/api/jscripty/projects',require(_0xe89e('0xcf')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xd0'),require('./api/setting'));_0x339b34[_0xe89e('0x7')](_0xe89e('0xd1'),require(_0xe89e('0xd2')));_0x339b34[_0xe89e('0x7')]('/api/square/projects',require('./api/squareProject'));_0x339b34['use']('/api/square/recordings',require(_0xe89e('0xd3')));_0x339b34['use']('/api/square/messages',require(_0xe89e('0xd4')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xd5'),require(_0xe89e('0xd6')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xd7'),require(_0xe89e('0xd8')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xd9'),require(_0xe89e('0xda')));_0x339b34[_0xe89e('0x7')]('/api/migrations',require(_0xe89e('0xdb')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xdc'),require('./api/attachment'));_0x339b34[_0xe89e('0x7')]('/api/plugins',require(_0xe89e('0xdd')));_0x339b34[_0xe89e('0x7')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x339b34[_0xe89e('0x7')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x339b34[_0xe89e('0x7')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x339b34[_0xe89e('0x7')]('/api/openchannel/reports/transfer',require(_0xe89e('0xde')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xdf'),require(_0xe89e('0xe0')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xe1'),require(_0xe89e('0xe2')));_0x339b34['use'](_0xe89e('0xe3'),require('./api/voicePrefix'));_0x339b34[_0xe89e('0x7')](_0xe89e('0xe4'),require(_0xe89e('0xe5')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xe6'),require(_0xe89e('0xe7')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xe8'),require(_0xe89e('0xe9')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xea'),require(_0xe89e('0xeb')));_0x339b34['use']('/api/whatsapp/accounts',require(_0xe89e('0xec')));_0x339b34[_0xe89e('0x7')]('/api/whatsapp/applications',require(_0xe89e('0xed')));_0x339b34['use'](_0xe89e('0xee'),require('./api/whatsappInteraction'));_0x339b34[_0xe89e('0x7')](_0xe89e('0xef'),require(_0xe89e('0xf0')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xf1'),require(_0xe89e('0xf2')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xf3'),require(_0xe89e('0xf4')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xf5'),require(_0xe89e('0xf6')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xf7'),require('./api/cloudProvider'));_0x339b34[_0xe89e('0x7')](_0xe89e('0xf8'),require(_0xe89e('0xf9')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xfa'),require(_0xe89e('0xfb')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xfc'),require(_0xe89e('0xfd')));_0x339b34[_0xe89e('0x7')](_0xe89e('0xfe'),require(_0xe89e('0xff')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x100'),require('./api/rpc'));_0x339b34[_0xe89e('0x7')](_0xe89e('0x101'),require(_0xe89e('0x102')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x103'),require(_0xe89e('0x104')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x105'),require(_0xe89e('0x106')));_0x339b34['use'](_0xe89e('0x107'),require('./api/webbar'));_0x339b34[_0xe89e('0x7')]('/apidoc',express[_0xe89e('0x108')](path['join'](config[_0xe89e('0x109')],'/apidoc')));_0x339b34[_0xe89e('0x7')](_0xe89e('0x10a'),express['static'](path[_0xe89e('0x10b')](config[_0xe89e('0x109')],_0xe89e('0x10a'))));_0x339b34['use'](_0xe89e('0x10c'),express[_0xe89e('0x108')](path[_0xe89e('0x10b')](config['root'],_0xe89e('0x10c'))));_0x339b34[_0xe89e('0x7')](_0xe89e('0x10d'),express[_0xe89e('0x108')](path[_0xe89e('0x10b')](config[_0xe89e('0x109')],'snippet',_0xe89e('0x10e'))));_0x339b34[_0xe89e('0x7')](_0xe89e('0x10f'),express[_0xe89e('0x108')](path[_0xe89e('0x10b')](config[_0xe89e('0x109')],_0xe89e('0x110'))));_0x339b34[_0xe89e('0x111')](_0xe89e('0x112'))[_0xe89e('0x113')](errors[0x194]);_0x339b34[_0xe89e('0x111')]('/*')[_0xe89e('0x113')](function(_0x31a32d,_0x5856ac){_0x5856ac[_0xe89e('0x114')](path[_0xe89e('0x115')](_0x339b34[_0xe89e('0x113')](_0xe89e('0x116'))+'/index.html'));});};var sensitiveFields=['username','password',_0xe89e('0x117'),_0xe89e('0x118'),'firstName',_0xe89e('0x119'),_0xe89e('0x11a'),'phone',_0xe89e('0x11b'),'fax',_0xe89e('0x11c'),_0xe89e('0x11d'),'clientSecret',_0xe89e('0x11e'),_0xe89e('0x11f'),_0xe89e('0x120'),'tenantId',_0xe89e('0x121'),_0xe89e('0x122'),_0xe89e('0x123'),_0xe89e('0x124'),_0xe89e('0x125'),_0xe89e('0x126'),_0xe89e('0x127'),_0xe89e('0x128'),'calleridname',_0xe89e('0x129'),_0xe89e('0x12a'),_0xe89e('0x12b'),_0xe89e('0x12c'),_0xe89e('0x12d'),'accesskeyid','secretaccesskey',_0xe89e('0x12e'),_0xe89e('0x15'),_0xe89e('0x12f'),_0xe89e('0x130'),_0xe89e('0x131'),_0xe89e('0x132'),'secret',_0xe89e('0x133'),_0xe89e('0x134')];function maskSensitiveData(_0x4e5f2b){var _0x787d66=/(?!^)[\s\S](?!$)/g;if(!_[_0xe89e('0x135')](_0x4e5f2b))return;for(var _0x397499 in _0x4e5f2b){if(_['isArray'](_0x4e5f2b[_0x397499])){for(var _0xd13ff7=0x0;_0xd13ff7<_0x4e5f2b[_0x397499]['length'];_0xd13ff7++){maskSensitiveData(_0x4e5f2b[_0x397499][_0xd13ff7]);}}else if(_[_0xe89e('0x135')](_0x4e5f2b[_0x397499])){maskSensitiveData(_0x4e5f2b[_0x397499]);}else if(_[_0xe89e('0x136')](_0x4e5f2b[_0x397499])){_0x4e5f2b[_0x397499]=_0x4e5f2b[_0x397499]['replace'](/{{{/g,_0xe89e('0x137'))[_0xe89e('0x138')](/}}}/g,'}@@')[_0xe89e('0x138')](/{{/g,'@{')[_0xe89e('0x138')](/}}/g,'}@');if(_[_0xe89e('0x139')](sensitiveFields,_0x397499)){_0x4e5f2b[_0x397499]=_0x4e5f2b[_0x397499]['replace'](_0x787d66,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 2e718e3..41da8fc 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bce=['../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/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!','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceCallReport/voiceCallReport.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/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x0bce,0xef));var _0xe0bc=function(_0x223b0c,_0x371c5a){_0x223b0c=_0x223b0c-0x0;var _0x4ce5ed=_0x0bce[_0x223b0c];return _0x4ce5ed;};'use strict';var jayson=require(_0xe0bc('0x0'));var BPromise=require(_0xe0bc('0x1'));var _=require(_0xe0bc('0x2'));var config=require(_0xe0bc('0x3'));exports[_0xe0bc('0x4')]=function(){return new BPromise(function(_0x2de20e,_0xb813af){var _0x44e78e={};_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x6')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require('../api/voiceExtension/voiceExtension.rpc'));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require('../api/voiceQueue/voiceQueue.rpc'));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require('../api/voiceRecording/voiceRecording.rpc'));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x7')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x8')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x9')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0xa')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0xb')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0xc')));_0x44e78e=_['merge'](_0x44e78e,require(_0xe0bc('0xd')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0xe')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0xf')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require('../api/mailAccount/mailAccount.rpc'));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x10')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x11')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require('../api/mailMessage/mailMessage.rpc'));_0x44e78e=_['merge'](_0x44e78e,require('../api/mailApplication/mailApplication.rpc'));_0x44e78e=_['merge'](_0x44e78e,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x44e78e=_['merge'](_0x44e78e,require(_0xe0bc('0x12')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x13')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require('../api/faxInteraction/faxInteraction.rpc'));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require('../api/faxMessage/faxMessage.rpc'));_0x44e78e=_['merge'](_0x44e78e,require(_0xe0bc('0x14')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x15')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require('../api/smsAccount/smsAccount.rpc'));_0x44e78e=_['merge'](_0x44e78e,require(_0xe0bc('0x16')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x17')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x18')));_0x44e78e=_['merge'](_0x44e78e,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x19')));_0x44e78e=_['merge'](_0x44e78e,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x1a')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x1b')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require('../api/chatInteraction/chatInteraction.rpc'));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x1c')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x1d')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x1e')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x1f')));_0x44e78e=_['merge'](_0x44e78e,require(_0xe0bc('0x20')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x21')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require('../api/interval/interval.rpc'));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require('../api/pause/pause.rpc'));_0x44e78e=_['merge'](_0x44e78e,require(_0xe0bc('0x22')));_0x44e78e=_['merge'](_0x44e78e,require(_0xe0bc('0x23')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x24')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x25')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x26')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x27')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x28')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x29')));_0x44e78e=_['merge'](_0x44e78e,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x44e78e=_['merge'](_0x44e78e,require(_0xe0bc('0x2a')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x2b')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x2c')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x2d')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x2e')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x2f')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x30')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require('../api/squareReport/squareReport.rpc'));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x31')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x32')));_0x44e78e=_['merge'](_0x44e78e,require(_0xe0bc('0x33')));_0x44e78e=_['merge'](_0x44e78e,require(_0xe0bc('0x34')));_0x44e78e=_['merge'](_0x44e78e,require(_0xe0bc('0x35')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x36')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x37')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x38')));_0x44e78e=_['merge'](_0x44e78e,require(_0xe0bc('0x39')));_0x44e78e=_['merge'](_0x44e78e,require(_0xe0bc('0x3a')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x44e78e=_['merge'](_0x44e78e,require(_0xe0bc('0x3b')));_0x44e78e=_['merge'](_0x44e78e,require(_0xe0bc('0x3c')));_0x44e78e=_[_0xe0bc('0x5')](_0x44e78e,require(_0xe0bc('0x3d')));var _0x671000=jayson[_0xe0bc('0x3e')](_0x44e78e)[_0xe0bc('0x3f')]();var _0x28a20d=config[_0xe0bc('0x40')][_0xe0bc('0x41')]||config['port']+0x1;var _0x430cf0=config[_0xe0bc('0x40')]['ip']||_0xe0bc('0x42');_0x671000['on']('error',function(_0x1cf1bd){return _0xb813af(_0x1cf1bd);});_0x671000['listen'](_0x28a20d,_0x430cf0,function(){console[_0xe0bc('0x43')](_0xe0bc('0x44'),_0x430cf0,_0x28a20d);require('../config/triggers')[_0xe0bc('0x45')]();return _0x2de20e(_0xe0bc('0x46')+_0x430cf0+':'+_0x28a20d);});});}; \ No newline at end of file +var _0x7f61=['../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','lodash','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc'];(function(_0xc86baf,_0x2ffba2){var _0xab4b1f=function(_0x27404e){while(--_0x27404e){_0xc86baf['push'](_0xc86baf['shift']());}};_0xab4b1f(++_0x2ffba2);}(_0x7f61,0xe0));var _0x17f6=function(_0xcd4bb6,_0x455c0b){_0xcd4bb6=_0xcd4bb6-0x0;var _0x50d8b9=_0x7f61[_0xcd4bb6];return _0x50d8b9;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var _=require(_0x17f6('0x0'));var config=require('../config/environment');exports['listen']=function(){return new BPromise(function(_0x1f5faf,_0x395913){var _0x2c1ad8={};_0x2c1ad8=_['merge'](_0x2c1ad8,require('../api/user/user.rpc'));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x2')));_0x2c1ad8=_['merge'](_0x2c1ad8,require('../api/voiceQueue/voiceQueue.rpc'));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x3')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x4')));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x5')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x6')));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x7')));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x8')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require('../api/trunk/trunk.rpc'));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x9')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0xa')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0xb')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require('../api/mailQueue/mailQueue.rpc'));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require('../api/mailInteraction/mailInteraction.rpc'));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require('../api/mailMessage/mailMessage.rpc'));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require('../api/mailApplication/mailApplication.rpc'));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0xc')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0xd')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0xe')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require('../api/faxInteraction/faxInteraction.rpc'));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0xf')));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x10')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x11')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x12')));_0x2c1ad8=_['merge'](_0x2c1ad8,require('../api/smsMessage/smsMessage.rpc'));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x13')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x14')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x15')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x16')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x17')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x18')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x19')));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x1a')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require('../api/chatQueue/chatQueue.rpc'));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x1b')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x1c')));_0x2c1ad8=_['merge'](_0x2c1ad8,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x1d')));_0x2c1ad8=_['merge'](_0x2c1ad8,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x1e')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x1f')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require('../api/sound/sound.rpc'));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x20')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x21')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x22')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x23')));_0x2c1ad8=_['merge'](_0x2c1ad8,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x2c1ad8=_['merge'](_0x2c1ad8,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x24')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x25')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x26')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x27')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x28')));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x29')));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x2a')));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x2b')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x2c')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x2d')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x2e')));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x2f')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x30')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require('../api/squareRecording/squareRecording.rpc'));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x31')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x32')));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x33')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x34')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x35')));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x36')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x37')));_0x2c1ad8=_['merge'](_0x2c1ad8,require(_0x17f6('0x38')));_0x2c1ad8=_[_0x17f6('0x1')](_0x2c1ad8,require(_0x17f6('0x39')));var _0x4198b4=jayson[_0x17f6('0x3a')](_0x2c1ad8)[_0x17f6('0x3b')]();var _0x250ab0=config[_0x17f6('0x3c')][_0x17f6('0x3d')]||config['port']+0x1;var _0xc841f2=config[_0x17f6('0x3c')]['ip']||'localhost';_0x4198b4['on'](_0x17f6('0x3e'),function(_0x5054ba){return _0x395913(_0x5054ba);});_0x4198b4[_0x17f6('0x3f')](_0x250ab0,_0xc841f2,function(){console[_0x17f6('0x40')](_0x17f6('0x41'),_0xc841f2,_0x250ab0);require(_0x17f6('0x42'))[_0x17f6('0x43')]();return _0x1f5faf('RPC\x20listening\x20on\x20'+_0xc841f2+':'+_0x250ab0);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index a3eb0b0..b4ad5c0 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 _0xcded=['isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','label','exports','lodash','events','./reply','./error','setEncoding','utf8','setTimeout','headers','emit','ready','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','substring','no\x20code','result=','indexOf','startsWith','split','length','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','function','write','inherits','prototype','sendRequest','ANSWER','beep','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec'];(function(_0x39fe14,_0x4b3234){var _0x3fc247=function(_0x5f2e5e){while(--_0x5f2e5e){_0x39fe14['push'](_0x39fe14['shift']());}};_0x3fc247(++_0x4b3234);}(_0xcded,0x64));var _0xdcde=function(_0x5027b1,_0x1409a5){_0x5027b1=_0x5027b1-0x0;var _0x4a46cf=_0xcded[_0x5027b1];return _0x4a46cf;};'use strict';var util=require('util');var _=require(_0xdcde('0x0'));var EventEmitter=require(_0xdcde('0x1'))['EventEmitter'];var AGIReply=require(_0xdcde('0x2'));var AGIError=require(_0xdcde('0x3'));function AGIChannel(_0x46f43b){var _0x3b26a3=this,_0x140613=new AGIReply(),_0x2e72f2=![],_0x40d2ad={};EventEmitter['call'](_0x3b26a3);_0x46f43b[_0xdcde('0x4')](_0xdcde('0x5'));_0x46f43b[_0xdcde('0x6')](0x8*0x3c*0x3c*0x3e8);_0x140613[_0xdcde('0x4')](_0xdcde('0x5'));_0x140613['on'](_0xdcde('0x7'),function(_0x1131c0){for(var _0x10e160 in _0x1131c0){_0x3b26a3[_0x10e160]=_0x1131c0[_0x10e160];}_0x3b26a3[_0xdcde('0x8')](_0xdcde('0x9'));});_0x140613['on']('line',function(_0x2aa24a){if(_0x2aa24a[_0xdcde('0xa')]()==_0xdcde('0xb')){_0x3b26a3['emit']('hangup');return;}if(_0x2aa24a['substring'](0x0,0xb)==_0xdcde('0xc')){_0x2e72f2=!![];}if(_0x2e72f2){_0x40d2ad['rx']+=_0x2aa24a+'\x0a';if(_0x2aa24a[_0xdcde('0xd')](_0xdcde('0xe'))!=-0x1){_0x2e72f2=![];}}else{_0x40d2ad['rx']=_0x2aa24a;}if(_0x2e72f2){return;}if(typeof _0x40d2ad['cb']=='function'){var _0xd32096=_0x40d2ad['rx'][_0xdcde('0xf')](0x0,0x3),_0x310d61=null,_0x595776=null;_0xd32096=parseInt(_0xd32096);if(isNaN(_0xd32096)){_0x40d2ad['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xdcde('0x10')});return;}if(_0xd32096!=0xc8){_0x40d2ad['cb'](null,{'code':_0xd32096,'result':-0x1,'extra':'KO'});return;}_0x310d61=_0x40d2ad['rx'][_0xdcde('0xf')](0x4)['replace'](_0xdcde('0x11'),'');if(_0x310d61[_0xdcde('0x12')]('\x20')!=-0x1){_0x310d61=_0x310d61['substr'](0x0,_0x310d61[_0xdcde('0x12')]('\x20'));}if(_[_0xdcde('0x13')](_0x310d61,'-1')){_0x310d61=parseInt(_0x310d61);}_0x595776=_0x40d2ad['rx'][_0xdcde('0x14')]('\x20');if(_0x595776[_0xdcde('0x15')]==0x3){_0x595776=_0x595776[0x2][_0xdcde('0xf')](0x1,_0x595776[0x2][_0xdcde('0x15')]-0x1);}else if(_0x595776[_0xdcde('0x15')]>0x3){var _0x397743=/\((.+)\)/;var _0x4ba275=_0x40d2ad['rx']['match'](_0x397743);if(_0x4ba275){_0x595776=_0x4ba275[0x1];}else{_0x595776=null;}}else{_0x595776=null;}_0x40d2ad['cb'](null,{'code':_0xd32096,'result':_0x310d61,'extra':_0x595776});}});_0x46f43b['on'](_0xdcde('0x16'),function(_0x525876){_0x3b26a3[_0xdcde('0x8')](_0xdcde('0x16'),new AGIError(_0xdcde('0x17'),_0x525876['code']));});_0x46f43b['on'](_0xdcde('0x18'),function(){_0x3b26a3[_0xdcde('0x8')](_0xdcde('0x18'),new AGIError(_0xdcde('0x19')));});_0x46f43b['on']('timeout',function(){_0x3b26a3[_0xdcde('0x8')](_0xdcde('0x1a'),new AGIError(_0xdcde('0x1b')));_0x46f43b[_0xdcde('0x1c')]();});_0x46f43b[_0xdcde('0x1d')](_0x140613);this['command']=function(_0x5b2ed4,_0x54c67d){var _0x5b2ed4=_0x5b2ed4||'',_0x54c67d=typeof _0x54c67d==_0xdcde('0x1e')?_0x54c67d:new Function();_0x40d2ad={'tx':_0x5b2ed4,'rx':'','cb':_0x54c67d};_0x46f43b[_0xdcde('0x1f')](_0x5b2ed4+'\x0a');},this['close']=function(){_0x46f43b[_0xdcde('0x1c')]();};}util[_0xdcde('0x20')](AGIChannel,EventEmitter);AGIChannel[_0xdcde('0x21')][_0xdcde('0x22')]=function(_0x5911d6){return this['command']['sync'](this,_0x5911d6);};AGIChannel[_0xdcde('0x21')]['answer']=function(){return this[_0xdcde('0x22')](_0xdcde('0x23'));};AGIChannel['prototype']['getData']=function(_0x42145b,_0xcb6ddc,_0x27f57f){_0x42145b=_0x42145b===undefined?_0xdcde('0x24'):_0x42145b;_0xcb6ddc=_0xcb6ddc===undefined?'5':_0xcb6ddc;_0x27f57f=_0x27f57f===undefined?'1':_0x27f57f;return this[_0xdcde('0x22')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x42145b,_0xcb6ddc*0x3e8,_0x27f57f));};AGIChannel[_0xdcde('0x21')][_0xdcde('0x25')]=function(_0xf8e724){_0xf8e724=_0xf8e724||_0xdcde('0x26');return this['sendRequest'](util[_0xdcde('0x27')](_0xdcde('0x28'),_0xf8e724));};AGIChannel[_0xdcde('0x21')][_0xdcde('0x29')]=function(_0x4c371e,_0x510fca){if(_[_0xdcde('0x2a')](_0x510fca)){return this[_0xdcde('0x22')](util[_0xdcde('0x27')](_0xdcde('0x2b'),_0x4c371e,_0x510fca[_0xdcde('0x2c')](',')));}return this[_0xdcde('0x22')](util[_0xdcde('0x27')](_0xdcde('0x2b'),_0x4c371e,_0x510fca));};AGIChannel[_0xdcde('0x21')]['setContext']=function(_0x4cd303){return this['sendRequest'](util[_0xdcde('0x27')](_0xdcde('0x2d'),_0x4cd303));};AGIChannel[_0xdcde('0x21')]['setExtension']=function(_0x512c52){return this[_0xdcde('0x22')](util[_0xdcde('0x27')](_0xdcde('0x2e'),_0x512c52));};AGIChannel[_0xdcde('0x21')]['setPriority']=function(_0x36b18c){return this[_0xdcde('0x22')](util[_0xdcde('0x27')](_0xdcde('0x2f'),_0x36b18c));};AGIChannel[_0xdcde('0x21')]['hangup']=function(){return this[_0xdcde('0x22')]('HANGUP');};AGIChannel[_0xdcde('0x21')][_0xdcde('0x30')]=function(_0x1db1e4,_0x36592a){var _0xa4d46a=_['isBoolean'](_0x36592a)||_[_0xdcde('0x31')](_0x36592a)?_0x36592a[_0xdcde('0x32')]():_0x36592a;return this[_0xdcde('0x22')](util[_0xdcde('0x27')](_0xdcde('0x33'),_0x1db1e4,_0xa4d46a?_0xa4d46a[_0xdcde('0x32')]()[_0xdcde('0x34')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xdcde('0x35')]=function(_0x1522e5,_0x2c406d){return this[_0xdcde('0x22')](util[_0xdcde('0x27')](_0xdcde('0x36'),_0x1522e5,_0x2c406d));};AGIChannel[_0xdcde('0x21')][_0xdcde('0x37')]=function(_0x80ad1c,_0x2a551e){return this[_0xdcde('0x22')](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x80ad1c,_0x2a551e));};AGIChannel[_0xdcde('0x21')]['sayPhonetic']=function(_0x6d8fe4,_0x5bafcb){return this[_0xdcde('0x22')](util['format'](_0xdcde('0x38'),_0x6d8fe4,_0x5bafcb));};AGIChannel[_0xdcde('0x21')][_0xdcde('0x39')]=function(_0x2967e3,_0x58ddb9,_0x167b5a){_0x58ddb9=_0x58ddb9||this[_0xdcde('0x3a')];_0x167b5a=_0x167b5a||0x1;this['setContext'](_0x2967e3);this[_0xdcde('0x3b')](_0x58ddb9);this[_0xdcde('0x3c')](_0x167b5a);return this[_0xdcde('0x25')](util[_0xdcde('0x27')](_0xdcde('0x3d'),_0x2967e3,_0x58ddb9,_0x167b5a));};AGIChannel[_0xdcde('0x21')][_0xdcde('0x3e')]=function(_0x2ee1f2){return this[_0xdcde('0x22')](util[_0xdcde('0x27')]('GET\x20VARIABLE\x20\x22%s\x22',_0x2ee1f2));};AGIChannel[_0xdcde('0x21')][_0xdcde('0x3f')]=function(_0x6f1e66,_0x23174c,_0x246bbc,_0x4c4a0d,_0x35f68c,_0x2f1f1f){_0x23174c=_0x23174c||'wav';_0x246bbc=_0x246bbc||'';_0x4c4a0d=_0x4c4a0d===undefined?-0x1:_0x4c4a0d==='-1'?-0x1:_0x4c4a0d*0x3e8;_0x35f68c=_0x35f68c===undefined?'':'s='+_0x35f68c;_0x2f1f1f=_0x2f1f1f?'BEEP':'';return this[_0xdcde('0x22')](util[_0xdcde('0x27')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x6f1e66,_0x23174c,_0x246bbc,_0x4c4a0d,_0x2f1f1f,_0x35f68c));};AGIChannel['prototype'][_0xdcde('0x40')]=function(_0x43dbf1,_0xd2dc18){_0xd2dc18=_0xd2dc18||'';return this['sendRequest'](util[_0xdcde('0x27')](_0xdcde('0x41'),_0x43dbf1,_0xd2dc18));};AGIChannel['prototype'][_0xdcde('0x42')]=function(_0x40e89b){return this['exec']('AGI',_0x40e89b);};AGIChannel['prototype'][_0xdcde('0x43')]=function(_0x5cd625){return this['exec'](_0xdcde('0x44'),_0x5cd625);};AGIChannel[_0xdcde('0x21')][_0xdcde('0x16')]=function(_0xfc535b,_0x3e4b88){this[_0xdcde('0x25')](util[_0xdcde('0x27')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0xfc535b['id'],_0xfc535b[_0xdcde('0x45')],_0x3e4b88));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xdcde('0x46')]=AGIChannel; \ No newline at end of file +var _0x1b5b=['setTimeout','emit','ready','line','toLowerCase','hangup','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','result=','indexOf','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','write','inherits','sendRequest','sync','prototype','getData','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','EXEC\x20%s\x20%s','join','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setContext','GOTO\x20%s\x20%s\x20%s','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','exec','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8'];(function(_0x16b513,_0x5ce8ca){var _0x1fcf5b=function(_0x49bb9a){while(--_0x49bb9a){_0x16b513['push'](_0x16b513['shift']());}};_0x1fcf5b(++_0x5ce8ca);}(_0x1b5b,0x11b));var _0xb1b5=function(_0x48b5e0,_0xb3826){_0x48b5e0=_0x48b5e0-0x0;var _0x4287ea=_0x1b5b[_0x48b5e0];return _0x4287ea;};'use strict';var util=require(_0xb1b5('0x0'));var _=require(_0xb1b5('0x1'));var EventEmitter=require(_0xb1b5('0x2'))[_0xb1b5('0x3')];var AGIReply=require(_0xb1b5('0x4'));var AGIError=require(_0xb1b5('0x5'));function AGIChannel(_0x42f073){var _0x52b374=this,_0x4a2819=new AGIReply(),_0x2e2a60=![],_0x30ab2e={};EventEmitter[_0xb1b5('0x6')](_0x52b374);_0x42f073[_0xb1b5('0x7')](_0xb1b5('0x8'));_0x42f073[_0xb1b5('0x9')](0x8*0x3c*0x3c*0x3e8);_0x4a2819[_0xb1b5('0x7')](_0xb1b5('0x8'));_0x4a2819['on']('headers',function(_0x577b3e){for(var _0x41400b in _0x577b3e){_0x52b374[_0x41400b]=_0x577b3e[_0x41400b];}_0x52b374[_0xb1b5('0xa')](_0xb1b5('0xb'));});_0x4a2819['on'](_0xb1b5('0xc'),function(_0x1503f9){if(_0x1503f9[_0xb1b5('0xd')]()=='hangup'){_0x52b374[_0xb1b5('0xa')](_0xb1b5('0xe'));return;}if(_0x1503f9['substring'](0x0,0xb)=='520-Invalid'){_0x2e2a60=!![];}if(_0x2e2a60){_0x30ab2e['rx']+=_0x1503f9+'\x0a';if(_0x1503f9[_0xb1b5('0xf')](_0xb1b5('0x10'))!=-0x1){_0x2e2a60=![];}}else{_0x30ab2e['rx']=_0x1503f9;}if(_0x2e2a60){return;}if(typeof _0x30ab2e['cb']==_0xb1b5('0x11')){var _0x537710=_0x30ab2e['rx'][_0xb1b5('0x12')](0x0,0x3),_0x2f831a=null,_0x5dd143=null;_0x537710=parseInt(_0x537710);if(isNaN(_0x537710)){_0x30ab2e['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xb1b5('0x13')});return;}if(_0x537710!=0xc8){_0x30ab2e['cb'](null,{'code':_0x537710,'result':-0x1,'extra':'KO'});return;}_0x2f831a=_0x30ab2e['rx'][_0xb1b5('0x12')](0x4)[_0xb1b5('0x14')](_0xb1b5('0x15'),'');if(_0x2f831a['indexOf']('\x20')!=-0x1){_0x2f831a=_0x2f831a['substr'](0x0,_0x2f831a[_0xb1b5('0x16')]('\x20'));}if(_[_0xb1b5('0x17')](_0x2f831a,'-1')){_0x2f831a=parseInt(_0x2f831a);}_0x5dd143=_0x30ab2e['rx'][_0xb1b5('0x18')]('\x20');if(_0x5dd143[_0xb1b5('0x19')]==0x3){_0x5dd143=_0x5dd143[0x2][_0xb1b5('0x12')](0x1,_0x5dd143[0x2][_0xb1b5('0x19')]-0x1);}else if(_0x5dd143[_0xb1b5('0x19')]>0x3){var _0x2e1a61=/\((.+)\)/;var _0x2b21f8=_0x30ab2e['rx'][_0xb1b5('0x1a')](_0x2e1a61);if(_0x2b21f8){_0x5dd143=_0x2b21f8[0x1];}else{_0x5dd143=null;}}else{_0x5dd143=null;}_0x30ab2e['cb'](null,{'code':_0x537710,'result':_0x2f831a,'extra':_0x5dd143});}});_0x42f073['on'](_0xb1b5('0x1b'),function(_0x37abbe){_0x52b374[_0xb1b5('0xa')](_0xb1b5('0x1b'),new AGIError('E_AGI_SOCKET_ERROR',_0x37abbe[_0xb1b5('0x1c')]));});_0x42f073['on'](_0xb1b5('0x1d'),function(){_0x52b374[_0xb1b5('0xa')]('close',new AGIError(_0xb1b5('0x1e')));});_0x42f073['on'](_0xb1b5('0x1f'),function(){_0x52b374[_0xb1b5('0xa')]('timeout',new AGIError(_0xb1b5('0x20')));_0x42f073[_0xb1b5('0x21')]();});_0x42f073['pipe'](_0x4a2819);this['command']=function(_0x31231d,_0x471d04){var _0x31231d=_0x31231d||'',_0x471d04=typeof _0x471d04==_0xb1b5('0x11')?_0x471d04:new Function();_0x30ab2e={'tx':_0x31231d,'rx':'','cb':_0x471d04};_0x42f073[_0xb1b5('0x22')](_0x31231d+'\x0a');},this[_0xb1b5('0x1d')]=function(){_0x42f073[_0xb1b5('0x21')]();};}util[_0xb1b5('0x23')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xb1b5('0x24')]=function(_0x4a06e7){return this['command'][_0xb1b5('0x25')](this,_0x4a06e7);};AGIChannel['prototype']['answer']=function(){return this[_0xb1b5('0x24')]('ANSWER');};AGIChannel[_0xb1b5('0x26')][_0xb1b5('0x27')]=function(_0x5da665,_0x2a6c9a,_0x4b96e7){_0x5da665=_0x5da665===undefined?'beep':_0x5da665;_0x2a6c9a=_0x2a6c9a===undefined?'5':_0x2a6c9a;_0x4b96e7=_0x4b96e7===undefined?'1':_0x4b96e7;return this[_0xb1b5('0x24')](util[_0xb1b5('0x28')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x5da665,_0x2a6c9a*0x3e8,_0x4b96e7));};AGIChannel[_0xb1b5('0x26')][_0xb1b5('0x29')]=function(_0x1980c1){_0x1980c1=_0x1980c1||_0xb1b5('0x2a');return this['sendRequest'](util[_0xb1b5('0x28')](_0xb1b5('0x2b'),_0x1980c1));};AGIChannel['prototype']['exec']=function(_0x48e218,_0x2774bf){if(_['isArray'](_0x2774bf)){return this[_0xb1b5('0x24')](util['format'](_0xb1b5('0x2c'),_0x48e218,_0x2774bf[_0xb1b5('0x2d')](',')));}return this['sendRequest'](util[_0xb1b5('0x28')](_0xb1b5('0x2c'),_0x48e218,_0x2774bf));};AGIChannel[_0xb1b5('0x26')]['setContext']=function(_0x45c778){return this['sendRequest'](util[_0xb1b5('0x28')]('SET\x20CONTEXT\x20%s',_0x45c778));};AGIChannel[_0xb1b5('0x26')][_0xb1b5('0x2e')]=function(_0x571dfa){return this[_0xb1b5('0x24')](util[_0xb1b5('0x28')](_0xb1b5('0x2f'),_0x571dfa));};AGIChannel['prototype'][_0xb1b5('0x30')]=function(_0x1accee){return this[_0xb1b5('0x24')](util['format'](_0xb1b5('0x31'),_0x1accee));};AGIChannel['prototype']['hangup']=function(){return this['sendRequest'](_0xb1b5('0x32'));};AGIChannel[_0xb1b5('0x26')][_0xb1b5('0x33')]=function(_0x3114cc,_0x228cd3){var _0x2981dc=_[_0xb1b5('0x34')](_0x228cd3)||_[_0xb1b5('0x35')](_0x228cd3)?_0x228cd3['toString']():_0x228cd3;return this['sendRequest'](util[_0xb1b5('0x28')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x3114cc,_0x2981dc?_0x2981dc[_0xb1b5('0x36')]()[_0xb1b5('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xb1b5('0x26')][_0xb1b5('0x37')]=function(_0x1c508c,_0x541cc5){return this['sendRequest'](util['format'](_0xb1b5('0x38'),_0x1c508c,_0x541cc5));};AGIChannel[_0xb1b5('0x26')][_0xb1b5('0x39')]=function(_0x15f57d,_0x52a448){return this['sendRequest'](util[_0xb1b5('0x28')]('SAY\x20DIGITS\x20%s\x20%s',_0x15f57d,_0x52a448));};AGIChannel['prototype']['sayPhonetic']=function(_0x5cc4d3,_0x4dd975){return this[_0xb1b5('0x24')](util[_0xb1b5('0x28')](_0xb1b5('0x3a'),_0x5cc4d3,_0x4dd975));};AGIChannel[_0xb1b5('0x26')][_0xb1b5('0x3b')]=function(_0x5247b7,_0x3e540c,_0x26cec0){_0x3e540c=_0x3e540c||this['extension'];_0x26cec0=_0x26cec0||0x1;this[_0xb1b5('0x3c')](_0x5247b7);this[_0xb1b5('0x2e')](_0x3e540c);this[_0xb1b5('0x30')](_0x26cec0);return this[_0xb1b5('0x29')](util['format'](_0xb1b5('0x3d'),_0x5247b7,_0x3e540c,_0x26cec0));};AGIChannel['prototype']['getVariable']=function(_0x160b15){return this[_0xb1b5('0x24')](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x160b15));};AGIChannel[_0xb1b5('0x26')][_0xb1b5('0x3e')]=function(_0x363b7b,_0x3e1eb7,_0x53f5a0,_0x4cd30d,_0x1246ba,_0x31e6b0){_0x3e1eb7=_0x3e1eb7||_0xb1b5('0x3f');_0x53f5a0=_0x53f5a0||'';_0x4cd30d=_0x4cd30d===undefined?-0x1:_0x4cd30d==='-1'?-0x1:_0x4cd30d*0x3e8;_0x1246ba=_0x1246ba===undefined?'':'s='+_0x1246ba;_0x31e6b0=_0x31e6b0?_0xb1b5('0x40'):'';return this[_0xb1b5('0x24')](util[_0xb1b5('0x28')](_0xb1b5('0x41'),_0x363b7b,_0x3e1eb7,_0x53f5a0,_0x4cd30d,_0x31e6b0,_0x1246ba));};AGIChannel['prototype'][_0xb1b5('0x42')]=function(_0x236522,_0x20ca02){_0x20ca02=_0x20ca02||'';return this[_0xb1b5('0x24')](util[_0xb1b5('0x28')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x236522,_0x20ca02));};AGIChannel['prototype'][_0xb1b5('0x43')]=function(_0x401dcd){return this[_0xb1b5('0x44')]('AGI',_0x401dcd);};AGIChannel['prototype'][_0xb1b5('0x45')]=function(_0x225985){return this[_0xb1b5('0x44')]('WAIT',_0x225985);};AGIChannel[_0xb1b5('0x26')][_0xb1b5('0x1b')]=function(_0x4456d9,_0x526857){this[_0xb1b5('0x29')](util[_0xb1b5('0x28')](_0xb1b5('0x46'),_0x4456d9['id'],_0x4456d9[_0xb1b5('0x47')],_0x526857));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xb1b5('0x48')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 0d9fb48..330c9e3 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 _0x441e=['Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','name','util'];(function(_0x516255,_0x51c5ae){var _0x1a6b6e=function(_0x515870){while(--_0x515870){_0x516255['push'](_0x516255['shift']());}};_0x1a6b6e(++_0x51c5ae);}(_0x441e,0x1df));var _0xe441=function(_0x279d4a,_0x3cdf4d){_0x279d4a=_0x279d4a-0x0;var _0x2f8ab6=_0x441e[_0x279d4a];return _0x2f8ab6;};'use strict';var util=require(_0xe441('0x0'));var error={'E_AGI_UNDEFINED':_0xe441('0x1'),'E_AGI_ARGUMENT_PORT':_0xe441('0x2'),'E_AGI_SERVER_ERROR':_0xe441('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xe441('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xe441('0x5'),'E_AGI_SOCKET_ERROR':_0xe441('0x6'),'E_AGI_SOCKET_CLOSE':_0xe441('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xe441('0x8'),'E_AGI_COMMAND_EMPTY':_0xe441('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xe441('0xa'),'E_AGI_IVR_ENTRY':_0xe441('0xb')};function AGIError(_0x462fd7){var _0x462fd7=_0x462fd7||null,_0x2be343=_0x2be343||[],_0x582397=0x1,_0x221455='';if(!error[_0x462fd7]){_0x462fd7=_0xe441('0xc');}_0x2be343[_0xe441('0xd')](error[_0x462fd7]);while(arguments[_0x582397]){_0x2be343['push'](arguments[_0x582397]);_0x582397++;}_0x221455=util[_0xe441('0xe')]['apply'](util,_0x2be343);this['message']=_0x221455;this[_0xe441('0xf')]=_0x462fd7;}module['exports']=AGIError; \ No newline at end of file +var _0x870d=['name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply'];(function(_0x5eb35a,_0x23da94){var _0x1e37c0=function(_0x27865e){while(--_0x27865e){_0x5eb35a['push'](_0x5eb35a['shift']());}};_0x1e37c0(++_0x23da94);}(_0x870d,0x189));var _0xd870=function(_0x565937,_0x2d1c71){_0x565937=_0x565937-0x0;var _0xfcb6a6=_0x870d[_0x565937];return _0xfcb6a6;};'use strict';var util=require(_0xd870('0x0'));var error={'E_AGI_UNDEFINED':_0xd870('0x1'),'E_AGI_ARGUMENT_PORT':_0xd870('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xd870('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xd870('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xd870('0x5'),'E_AGI_SOCKET_ERROR':_0xd870('0x6'),'E_AGI_SOCKET_CLOSE':_0xd870('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xd870('0x8'),'E_AGI_COMMAND_EMPTY':_0xd870('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xd870('0xa'),'E_AGI_IVR_ENTRY':_0xd870('0xb')};function AGIError(_0x39345a){var _0x39345a=_0x39345a||null,_0x4dc2b3=_0x4dc2b3||[],_0x30fd41=0x1,_0x5a306b='';if(!error[_0x39345a]){_0x39345a=_0xd870('0xc');}_0x4dc2b3[_0xd870('0xd')](error[_0x39345a]);while(arguments[_0x30fd41]){_0x4dc2b3['push'](arguments[_0x30fd41]);_0x30fd41++;}_0x5a306b=util['format'][_0xd870('0xe')](util,_0x4dc2b3);this['message']=_0x5a306b;this[_0xd870('0xf')]=_0x39345a;}module[_0xd870('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 5ab294e..b32be61 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 _0xeea5=['target','default','agicommand','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','push','size','relations','getVertex','traverseBFS','info','stop\x20traverse','length','condition','vswitch'];(function(_0x42bf9e,_0x54a2f0){var _0x48b8f0=function(_0x3fbd67){while(--_0x3fbd67){_0x42bf9e['push'](_0x42bf9e['shift']());}};_0x48b8f0(++_0x54a2f0);}(_0xeea5,0x1b0));var _0x5eea=function(_0x420ec2,_0x442b6d){_0x420ec2=_0x420ec2-0x0;var _0x4555e3=_0xeea5[_0x420ec2];return _0x4555e3;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')(_0x5eea('0x0'));var verticesWithRetry=[_0x5eea('0x1'),_0x5eea('0x2'),_0x5eea('0x3')];var Graph=function(){this[_0x5eea('0x4')]={};this[_0x5eea('0x5')]={};this[_0x5eea('0x6')]=0x0;};Graph['prototype']['addVertex']=function(_0x2fc355){this[_0x5eea('0x4')][_0x2fc355['id']]=_0x2fc355;this[_0x5eea('0x5')][_0x2fc355['id']]=[];};Graph[_0x5eea('0x7')]['addEdge']=function(_0x3eb040,_0x384b00,_0x144770){this[_0x5eea('0x5')][_0x3eb040][_0x5eea('0x8')]({'target':_0x384b00,'condition':_0x144770});this['numberOfEdges']+=0x1;};Graph[_0x5eea('0x7')][_0x5eea('0x9')]=function(){return _['size'](this[_0x5eea('0x4')]);};Graph[_0x5eea('0x7')][_0x5eea('0xa')]=function(){return this['numberOfEdges'];};Graph[_0x5eea('0x7')][_0x5eea('0xb')]=function(_0x122b90){return this[_0x5eea('0x4')][_0x122b90];};Graph[_0x5eea('0x7')][_0x5eea('0xc')]=function(_0x2f01d9,_0x1ca2a3){if(!this[_0x5eea('0x4')][_0x2f01d9]){return logger['info']('no\x20vertex\x20found');}var _0x3c93d8=_0x1ca2a3(this[_0x5eea('0x4')][_0x2f01d9]);if(!_0x3c93d8){return logger[_0x5eea('0xd')](_0x5eea('0xe'));}if(this[_0x5eea('0x5')][_0x2f01d9]['length']===0x0){return logger['info']('no\x20edge/s\x20available');}for(var _0x55e265=0x0,_0x4bd3b6=[],_0x2ac323=![];_0x55e265\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','root','agicommand','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','value','then','catch','createSquareReport','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','traverseBFS','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','response','code','result','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','isUndefined','agicommand\x20not\x20found','[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','extension','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]'];(function(_0x9e85c9,_0x126f63){var _0x3861a0=function(_0x5e3271){while(--_0x5e3271){_0x9e85c9['push'](_0x9e85c9['shift']());}};_0x3861a0(++_0x126f63);}(_0x8cc1,0xb5));var _0x18cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8cc1[_0x3dd15e];return _0x231fd0;};'use strict';var parser=require(_0x18cc('0x0'));var _=require(_0x18cc('0x1'));var syncho=require('syncho');var util=require(_0x18cc('0x2'));var moment=require(_0x18cc('0x3'));var config=require(_0x18cc('0x4'));var logger=require(_0x18cc('0x5'))('agi');var utilLicense=require(_0x18cc('0x6'));var rpc=require(_0x18cc('0x7'));var mailRpc=require(_0x18cc('0x8'));var Graph=require('./graph');var Vertices=require(_0x18cc('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x18cc('0xa')]=_[_0x18cc('0xb')](config[_0x18cc('0xa')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0xa35478){process[_0x18cc('0xc')](function(){syncho(function(){try{setChannelVariables(_0xa35478);agiHandler(_0xa35478);}catch(_0x22ab9e){logger[_0x18cc('0xd')](_0x22ab9e['stack']);}});});}function listeningHandler(){console[_0x18cc('0xe')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x18cc('0xa')][_0x18cc('0xf')]);logger[_0x18cc('0x10')](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x18cc('0xa')]['ip'],config[_0x18cc('0xa')]['port']));}function errorHandler(_0x1e10b2){if(_0x1e10b2&&_0x1e10b2[_0x18cc('0x11')]&&_0x1e10b2[_0x18cc('0x12')]){logger[_0x18cc('0xd')](util[_0x18cc('0x13')]('[%s]\x20%s',_0x1e10b2[_0x18cc('0x11')],_0x1e10b2[_0x18cc('0x12')]));}else{logger[_0x18cc('0xd')](util[_0x18cc('0x13')](_0x18cc('0x14'),_0x1e10b2['stack']));}}function closeHandler(){logger[_0x18cc('0x10')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x18cc('0x15')],this['calleridname'],this[_0x18cc('0x16')],this[_0x18cc('0x17')],this['uniqueid']));try{createSquareReport(this);}catch(_0x3b0a60){logger[_0x18cc('0xd')](_0x3b0a60[_0x18cc('0x18')]);}}function timeoutHandler(){logger[_0x18cc('0x10')](util[_0x18cc('0x13')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x18cc('0x15')],this[_0x18cc('0x19')],this[_0x18cc('0x16')],this[_0x18cc('0x17')],this[_0x18cc('0x1a')]));}function hangupHandler(){logger[_0x18cc('0x10')](util[_0x18cc('0x13')](_0x18cc('0x1b'),this[_0x18cc('0x15')],this[_0x18cc('0x19')],this[_0x18cc('0x16')],this[_0x18cc('0x17')],this[_0x18cc('0x1a')]));this[_0x18cc('0x1c')]=!![];}function getRoot(_0x1d3da5){return parser[_0x18cc('0x1d')](_0x1d3da5,{'object':!![]})['mxGraphModel'][_0x18cc('0x1e')];}function addVertex(_0x276b88,_0x13881e,_0x1afe9e){_0x13881e[_0x18cc('0x1f')]=_0x1afe9e;if(_0x13881e['hasOwnProperty'](_0x18cc('0x20'))){_0x13881e[_0x18cc('0x21')]=parseInt(_0x13881e[_0x18cc('0x20')],0xa);}_0x276b88[_0x18cc('0x22')](_['omit'](_0x13881e,_0x18cc('0x23')));}function initGraph(_0xfd1ac9,_0x6ed531){var _0x3234ff=new Graph();for(var _0x1cfc00 in _0xfd1ac9){if(_0xfd1ac9['hasOwnProperty'](_0x1cfc00)){if(_[_0x18cc('0x24')](_0xfd1ac9[_0x1cfc00])){for(var _0x3d42df=0x0;_0x3d42df<_0xfd1ac9[_0x1cfc00][_0x18cc('0x25')];_0x3d42df+=0x1){addVertex(_0x3234ff,_0xfd1ac9[_0x1cfc00][_0x3d42df],_0x1cfc00);}}else{addVertex(_0x3234ff,_0xfd1ac9[_0x1cfc00],_0x1cfc00);}}}for(var _0x302cbd=0x0;_0x302cbd<_0x6ed531['length'];_0x302cbd+=0x1){if(_0x6ed531[_0x302cbd][_0x18cc('0x26')]&&_0x6ed531[_0x302cbd][_0x18cc('0x27')]){_0x3234ff['addEdge'](_0x6ed531[_0x302cbd]['source'],_0x6ed531[_0x302cbd]['target'],_0x6ed531[_0x302cbd][_0x18cc('0x28')]);}}return _0x3234ff;}function getSquareProject(_0x16751e,_0x4d4733){rpc['getSquareProject'](_0x16751e)[_0x18cc('0x29')](function(_0x20382c){_0x4d4733(null,_0x20382c);})[_0x18cc('0x2a')](function(_0x49181f){_0x4d4733(null,_0x49181f);});}function createSquareReport(_0x51c9c3,_0x30a6a5){rpc[_0x18cc('0x2b')](_0x51c9c3)['then'](function(_0x239bce){if(_0x30a6a5){_0x30a6a5(null,_0x239bce);}})['catch'](function(_0x4e5f25){if(_0x30a6a5){_0x30a6a5(null,_0x4e5f25);}});}function setChannelVariables(_0x27bcaf){for(var _0x24c55d in _0x27bcaf){if(_0x27bcaf['hasOwnProperty'](_0x24c55d)){if(_0x24c55d['indexOf'](_0x18cc('0x2c'))===0x0){_0x27bcaf[_0x24c55d[_0x18cc('0x2d')](0x4)]=_0x27bcaf[_0x24c55d];delete _0x27bcaf[_0x24c55d];}}}}function getLogFromObject(_0x66bf85){return util[_0x18cc('0x2e')](_0x66bf85,{'showHidden':![],'depth':null});}function agiHandler(_0x53a83e){var _0x6ce04c,_0x47a1a8,_0x2951c1,_0x209a27,_0x4a0be2;logger[_0x18cc('0x2f')](_0x18cc('0x30'),JSON[_0x18cc('0x31')](_0x53a83e,null,0x2));logger[_0x18cc('0x10')](util[_0x18cc('0x13')](_0x18cc('0x32'),_0x53a83e[_0x18cc('0x15')],_0x53a83e[_0x18cc('0x19')],_0x53a83e[_0x18cc('0x16')],_0x53a83e['dnid'],_0x53a83e['uniqueid']));_0x53a83e['on'](_0x18cc('0xd'),errorHandler);_0x53a83e['on'](_0x18cc('0x33'),closeHandler);_0x53a83e['on'](_0x18cc('0x34'),timeoutHandler);_0x53a83e[_0x18cc('0x1c')]=![];_0x53a83e['on']('hangup',hangupHandler);var _0x112e50=getSquareProject[_0x18cc('0x35')](null,_0x53a83e[_0x18cc('0x15')]);if(_0x112e50){if(_0x112e50[_0x18cc('0x36')]){_0x6ce04c=getRoot(_0x112e50['production']);if(_0x6ce04c&&_0x6ce04c[_0x18cc('0x37')]){logger[_0x18cc('0x2f')]('root',JSON[_0x18cc('0x31')](_0x6ce04c,null,0x2));_0x53a83e[_0x18cc('0x38')]=moment()['format'](_0x18cc('0x39'));_0x47a1a8=initGraph(_[_0x18cc('0x3a')](_0x6ce04c,_0x18cc('0x23')),_0x6ce04c[_0x18cc('0x23')]);_0x2951c1=new Vertices(_0x53a83e,rpc,mailRpc);logger[_0x18cc('0x10')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x53a83e[_0x18cc('0x15')],_0x53a83e[_0x18cc('0x19')],_0x53a83e['callerid'],_0x53a83e['dnid'],_0x53a83e[_0x18cc('0x1a')]));_0x47a1a8[_0x18cc('0x3b')](_0x6ce04c['start']['id'],function(_0x115697){try{_0x115697=_0x2951c1['clear'](_0x115697);logger[_0x18cc('0x2f')](_0x18cc('0x3c'),JSON[_0x18cc('0x31')](_0x115697,null,0x2));if(_0x115697[_0x18cc('0x1f')]===_0x18cc('0x3d')){logger[_0x18cc('0x10')](_0x18cc('0x3e'));_0x53a83e[_0x18cc('0x3f')]=_0x115697[_0x18cc('0x3f')]||_0x53a83e[_0x18cc('0x3f')];_0x53a83e['extension']=_0x115697['extension'];_0x53a83e[_0x18cc('0x40')]=_0x115697[_0x18cc('0x40')]?_0x115697[_0x18cc('0x40')]-0x1:0x1;return null;}else if(_0x115697&&_0x2951c1[_0x115697['agicommand']]){_0x4a0be2=_0x2951c1[_0x115697[_0x18cc('0x1f')]](_0x115697);logger[_0x18cc('0x10')](_0x18cc('0x41'),JSON[_0x18cc('0x31')](_0x4a0be2,null,0x2));if(_0x4a0be2&&_0x4a0be2[_0x18cc('0x42')]===AGI_CODE_SUCCESS&&_0x4a0be2[_0x18cc('0x43')]!==AGI_RESULT_ERROR&&!_0x53a83e[_0x18cc('0x1c')]){logger[_0x18cc('0x2f')](_0x18cc('0x41'),getLogFromObject(_0x4a0be2));return _['isUndefined'](_0x4a0be2['result'])?null:_0x4a0be2[_0x18cc('0x43')][_0x18cc('0x44')]();}else{logger[_0x18cc('0xd')](_0x18cc('0x41'),getLogFromObject(_0x4a0be2));return null;}}else{logger[_0x18cc('0xd')]('agicommand\x20not\x20found');return null;}}catch(_0x5c54ab){logger[_0x18cc('0xd')](_0x5c54ab['stack']);return null;}});if(_0x6ce04c[_0x18cc('0x45')]){logger['info'](util[_0x18cc('0x13')](_0x18cc('0x46'),_0x53a83e[_0x18cc('0x15')],_0x53a83e[_0x18cc('0x19')],_0x53a83e[_0x18cc('0x16')],_0x53a83e[_0x18cc('0x17')],_0x53a83e['uniqueid']));_0x47a1a8['traverseBFS'](_0x6ce04c[_0x18cc('0x45')]['id'],function(_0x9c2bba){try{_0x9c2bba=_0x2951c1[_0x18cc('0x47')](_0x9c2bba);logger[_0x18cc('0x2f')](_0x18cc('0x3c'),JSON['stringify'](_0x9c2bba,null,0x2));if(_0x9c2bba&&_0x2951c1[_0x9c2bba['agicommand']]){_0x4a0be2=_0x2951c1[_0x9c2bba[_0x18cc('0x1f')]](_0x9c2bba);if(_0x4a0be2){logger[_0x18cc('0x2f')]('response',getLogFromObject(_0x4a0be2));return _[_0x18cc('0x48')](_0x4a0be2['result'])?null:_0x4a0be2[_0x18cc('0x43')]['toString']();}else{logger[_0x18cc('0xd')](_0x18cc('0x41'),getLogFromObject(_0x4a0be2));return null;}}else{logger['error'](_0x18cc('0x49'));return null;}}catch(_0x46b44b){logger[_0x18cc('0xd')](_0x46b44b[_0x18cc('0x18')]);return null;}});}logger['info'](util['format'](_0x18cc('0x4a'),_0x53a83e[_0x18cc('0x15')],_0x53a83e[_0x18cc('0x19')],_0x53a83e[_0x18cc('0x16')],_0x53a83e['dnid'],_0x53a83e[_0x18cc('0x1a')]));logger[_0x18cc('0x10')](util['format'](_0x18cc('0x4b'),_0x53a83e[_0x18cc('0x3f')],_0x53a83e[_0x18cc('0x4c')],parseInt(_0x53a83e['priority'],0xa)+0x1));_0x53a83e[_0x18cc('0x4d')](_0x53a83e[_0x18cc('0x3f')],_0x53a83e['extension'],parseInt(_0x53a83e['priority'],0xa)+0x1);_0x53a83e[_0x18cc('0x33')]();}}else{logger[_0x18cc('0xd')](util[_0x18cc('0x13')](_0x18cc('0x4e'),_0x53a83e[_0x18cc('0x15')]));_0x53a83e[_0x18cc('0x4d')](_0x53a83e[_0x18cc('0x3f')],_0x53a83e['extension'],parseInt(_0x53a83e[_0x18cc('0x40')],0xa)+0x1);_0x53a83e['close']();}}else{logger[_0x18cc('0xd')](util[_0x18cc('0x13')](_0x18cc('0x4f'),_0x53a83e[_0x18cc('0x15')]));_0x53a83e[_0x18cc('0x4d')](_0x53a83e['context'],_0x53a83e['extension'],parseInt(_0x53a83e[_0x18cc('0x40')],0xa)+0x1);_0x53a83e[_0x18cc('0x33')]();}}function main(){var _0x2d5efb;return utilLicense[_0x18cc('0x50')]()[_0x18cc('0x29')](function(_0x1a8b3f){if(_0x1a8b3f){if(_0x1a8b3f[_0x18cc('0x51')]){if(_0x1a8b3f[_0x18cc('0x52')]&&_0x1a8b3f[_0x18cc('0x52')]>0x0){logger[_0x18cc('0x10')](util['format'](_0x18cc('0x53'),_0x1a8b3f[_0x18cc('0x52')]));_0x2d5efb=_0x1a8b3f['callysquare'];}else{logger[_0x18cc('0x10')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x18cc('0x10')](_0x18cc('0x54'));_0x2d5efb=-0x1;}}})[_0x18cc('0x2a')](function(_0x43ff4c){logger[_0x18cc('0xd')](_0x18cc('0x55'),_0x43ff4c['stack']);})[_0x18cc('0x45')](function(){var _0x5ae53e=require(_0x18cc('0x56'))(config['agi']['port'],config['agi']['ip'],_0x2d5efb);_0x5ae53e['on']('error',errorHandler);_0x5ae53e['on'](_0x18cc('0x57'),listeningHandler);_0x5ae53e['on'](_0x18cc('0x58'),connectionHandler);_0x5ae53e['on'](_0x18cc('0x33'),closeHandler);});}main(); \ No newline at end of file +var _0xb805=['agi','../../config/license/util','./rpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','message','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','evtHangup','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','substring','inspect','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','production','start','root','stringify','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','isUndefined','result','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','finally','./server','listening','connection','moment','../../config/environment','../../config/logger'];(function(_0x2d588c,_0x46e768){var _0x464354=function(_0x5f154e){while(--_0x5f154e){_0x2d588c['push'](_0x2d588c['shift']());}};_0x464354(++_0x46e768);}(_0xb805,0xa7));var _0x5b80=function(_0x1079f4,_0x20a675){_0x1079f4=_0x1079f4-0x0;var _0x2e4222=_0xb805[_0x1079f4];return _0x2e4222;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require('syncho');var util=require('util');var moment=require(_0x5b80('0x0'));var config=require(_0x5b80('0x1'));var logger=require(_0x5b80('0x2'))(_0x5b80('0x3'));var utilLicense=require(_0x5b80('0x4'));var rpc=require(_0x5b80('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0x5b80('0x6'));var Vertices=require(_0x5b80('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x5b80('0x3')]=_[_0x5b80('0x8')](config['agi'],{'ip':_0x5b80('0x9'),'port':0x11dd});function connectionHandler(_0x5c7aea){process[_0x5b80('0xa')](function(){syncho(function(){try{setChannelVariables(_0x5c7aea);agiHandler(_0x5c7aea);}catch(_0x2bf481){logger[_0x5b80('0xb')](_0x2bf481['stack']);}});});}function listeningHandler(){console[_0x5b80('0xc')](_0x5b80('0xd'),config[_0x5b80('0x3')][_0x5b80('0xe')]);logger[_0x5b80('0xf')](util[_0x5b80('0x10')](_0x5b80('0x11'),config[_0x5b80('0x3')]['ip'],config[_0x5b80('0x3')][_0x5b80('0xe')]));}function errorHandler(_0x3ad6f4){if(_0x3ad6f4&&_0x3ad6f4[_0x5b80('0x12')]&&_0x3ad6f4['message']){logger[_0x5b80('0xb')](util[_0x5b80('0x10')](_0x5b80('0x13'),_0x3ad6f4[_0x5b80('0x12')],_0x3ad6f4[_0x5b80('0x14')]));}else{logger[_0x5b80('0xb')](util[_0x5b80('0x10')](_0x5b80('0x15'),_0x3ad6f4[_0x5b80('0x16')]));}}function closeHandler(){logger[_0x5b80('0xf')](util[_0x5b80('0x10')](_0x5b80('0x17'),this['arg_1'],this[_0x5b80('0x18')],this[_0x5b80('0x19')],this[_0x5b80('0x1a')],this[_0x5b80('0x1b')]));try{createSquareReport(this);}catch(_0x20d804){logger[_0x5b80('0xb')](_0x20d804[_0x5b80('0x16')]);}}function timeoutHandler(){logger[_0x5b80('0xf')](util[_0x5b80('0x10')](_0x5b80('0x1c'),this[_0x5b80('0x1d')],this['calleridname'],this[_0x5b80('0x19')],this['dnid'],this[_0x5b80('0x1b')]));}function hangupHandler(){logger[_0x5b80('0xf')](util[_0x5b80('0x10')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x5b80('0x18')],this[_0x5b80('0x19')],this[_0x5b80('0x1a')],this[_0x5b80('0x1b')]));this[_0x5b80('0x1e')]=!![];}function getRoot(_0x212c58){return parser['toJson'](_0x212c58,{'object':!![]})['mxGraphModel']['root'];}function addVertex(_0x5a9e66,_0x2a55fa,_0xcc2708){_0x2a55fa[_0x5b80('0x1f')]=_0xcc2708;if(_0x2a55fa[_0x5b80('0x20')]('retry')){_0x2a55fa[_0x5b80('0x21')]=parseInt(_0x2a55fa[_0x5b80('0x22')],0xa);}_0x5a9e66[_0x5b80('0x23')](_[_0x5b80('0x24')](_0x2a55fa,_0x5b80('0x25')));}function initGraph(_0x1e1f6f,_0x52a5e5){var _0x591260=new Graph();for(var _0x5e503b in _0x1e1f6f){if(_0x1e1f6f[_0x5b80('0x20')](_0x5e503b)){if(_[_0x5b80('0x26')](_0x1e1f6f[_0x5e503b])){for(var _0x3cf564=0x0;_0x3cf564<_0x1e1f6f[_0x5e503b]['length'];_0x3cf564+=0x1){addVertex(_0x591260,_0x1e1f6f[_0x5e503b][_0x3cf564],_0x5e503b);}}else{addVertex(_0x591260,_0x1e1f6f[_0x5e503b],_0x5e503b);}}}for(var _0x44ae79=0x0;_0x44ae79<_0x52a5e5['length'];_0x44ae79+=0x1){if(_0x52a5e5[_0x44ae79][_0x5b80('0x27')]&&_0x52a5e5[_0x44ae79][_0x5b80('0x28')]){_0x591260[_0x5b80('0x29')](_0x52a5e5[_0x44ae79][_0x5b80('0x27')],_0x52a5e5[_0x44ae79]['target'],_0x52a5e5[_0x44ae79][_0x5b80('0x2a')]);}}return _0x591260;}function getSquareProject(_0x209ca5,_0x3cbfea){rpc[_0x5b80('0x2b')](_0x209ca5)[_0x5b80('0x2c')](function(_0x3dfa93){_0x3cbfea(null,_0x3dfa93);})[_0x5b80('0x2d')](function(_0x555107){_0x3cbfea(null,_0x555107);});}function createSquareReport(_0x436e0b,_0x4f537f){rpc[_0x5b80('0x2e')](_0x436e0b)['then'](function(_0x42ac80){if(_0x4f537f){_0x4f537f(null,_0x42ac80);}})['catch'](function(_0x30b574){if(_0x4f537f){_0x4f537f(null,_0x30b574);}});}function setChannelVariables(_0x2bd758){for(var _0x23f3f3 in _0x2bd758){if(_0x2bd758[_0x5b80('0x20')](_0x23f3f3)){if(_0x23f3f3[_0x5b80('0x2f')]('agi_')===0x0){_0x2bd758[_0x23f3f3[_0x5b80('0x30')](0x4)]=_0x2bd758[_0x23f3f3];delete _0x2bd758[_0x23f3f3];}}}}function getLogFromObject(_0x1a8ec4){return util[_0x5b80('0x31')](_0x1a8ec4,{'showHidden':![],'depth':null});}function agiHandler(_0x283b4b){var _0x339c69,_0x912f1c,_0x3513e4,_0x4e20ef,_0x2a0b0b;logger[_0x5b80('0x32')](_0x5b80('0x33'),JSON['stringify'](_0x283b4b,null,0x2));logger['info'](util[_0x5b80('0x10')](_0x5b80('0x34'),_0x283b4b['arg_1'],_0x283b4b[_0x5b80('0x18')],_0x283b4b[_0x5b80('0x19')],_0x283b4b[_0x5b80('0x1a')],_0x283b4b[_0x5b80('0x1b')]));_0x283b4b['on'](_0x5b80('0xb'),errorHandler);_0x283b4b['on'](_0x5b80('0x35'),closeHandler);_0x283b4b['on'](_0x5b80('0x36'),timeoutHandler);_0x283b4b[_0x5b80('0x1e')]=![];_0x283b4b['on']('hangup',hangupHandler);var _0x5aa632=getSquareProject['sync'](null,_0x283b4b[_0x5b80('0x1d')]);if(_0x5aa632){if(_0x5aa632[_0x5b80('0x37')]){_0x339c69=getRoot(_0x5aa632[_0x5b80('0x37')]);if(_0x339c69&&_0x339c69[_0x5b80('0x38')]){logger['debug'](_0x5b80('0x39'),JSON[_0x5b80('0x3a')](_0x339c69,null,0x2));_0x283b4b[_0x5b80('0x3b')]=moment()[_0x5b80('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x912f1c=initGraph(_[_0x5b80('0x24')](_0x339c69,_0x5b80('0x25')),_0x339c69[_0x5b80('0x25')]);_0x3513e4=new Vertices(_0x283b4b,rpc,mailRpc);logger[_0x5b80('0xf')](util[_0x5b80('0x10')](_0x5b80('0x3c'),_0x283b4b[_0x5b80('0x1d')],_0x283b4b['calleridname'],_0x283b4b['callerid'],_0x283b4b[_0x5b80('0x1a')],_0x283b4b[_0x5b80('0x1b')]));_0x912f1c['traverseBFS'](_0x339c69[_0x5b80('0x38')]['id'],function(_0x5e9e69){try{_0x5e9e69=_0x3513e4[_0x5b80('0x3d')](_0x5e9e69);logger[_0x5b80('0x32')](_0x5b80('0x3e'),JSON[_0x5b80('0x3a')](_0x5e9e69,null,0x2));if(_0x5e9e69[_0x5b80('0x1f')]==='gotoc'){logger['info'](_0x5b80('0x3f'));_0x283b4b['context']=_0x5e9e69['context']||_0x283b4b[_0x5b80('0x40')];_0x283b4b[_0x5b80('0x41')]=_0x5e9e69[_0x5b80('0x41')];_0x283b4b['priority']=_0x5e9e69['priority']?_0x5e9e69[_0x5b80('0x42')]-0x1:0x1;return null;}else if(_0x5e9e69&&_0x3513e4[_0x5e9e69[_0x5b80('0x1f')]]){_0x2a0b0b=_0x3513e4[_0x5e9e69[_0x5b80('0x1f')]](_0x5e9e69);logger['info'](_0x5b80('0x43'),JSON[_0x5b80('0x3a')](_0x2a0b0b,null,0x2));if(_0x2a0b0b&&_0x2a0b0b[_0x5b80('0x44')]===AGI_CODE_SUCCESS&&_0x2a0b0b['result']!==AGI_RESULT_ERROR&&!_0x283b4b[_0x5b80('0x1e')]){logger[_0x5b80('0x32')]('response',getLogFromObject(_0x2a0b0b));return _[_0x5b80('0x45')](_0x2a0b0b['result'])?null:_0x2a0b0b[_0x5b80('0x46')][_0x5b80('0x47')]();}else{logger['error'](_0x5b80('0x43'),getLogFromObject(_0x2a0b0b));return null;}}else{logger[_0x5b80('0xb')](_0x5b80('0x48'));return null;}}catch(_0x492104){logger[_0x5b80('0xb')](_0x492104[_0x5b80('0x16')]);return null;}});if(_0x339c69['finally']){logger[_0x5b80('0xf')](util[_0x5b80('0x10')](_0x5b80('0x49'),_0x283b4b['arg_1'],_0x283b4b['calleridname'],_0x283b4b[_0x5b80('0x19')],_0x283b4b['dnid'],_0x283b4b[_0x5b80('0x1b')]));_0x912f1c[_0x5b80('0x4a')](_0x339c69['finally']['id'],function(_0x5af1bb){try{_0x5af1bb=_0x3513e4[_0x5b80('0x3d')](_0x5af1bb);logger[_0x5b80('0x32')](_0x5b80('0x3e'),JSON[_0x5b80('0x3a')](_0x5af1bb,null,0x2));if(_0x5af1bb&&_0x3513e4[_0x5af1bb[_0x5b80('0x1f')]]){_0x2a0b0b=_0x3513e4[_0x5af1bb[_0x5b80('0x1f')]](_0x5af1bb);if(_0x2a0b0b){logger[_0x5b80('0x32')]('response',getLogFromObject(_0x2a0b0b));return _[_0x5b80('0x45')](_0x2a0b0b[_0x5b80('0x46')])?null:_0x2a0b0b[_0x5b80('0x46')][_0x5b80('0x47')]();}else{logger[_0x5b80('0xb')](_0x5b80('0x43'),getLogFromObject(_0x2a0b0b));return null;}}else{logger['error'](_0x5b80('0x48'));return null;}}catch(_0xfc712e){logger['error'](_0xfc712e[_0x5b80('0x16')]);return null;}});}logger[_0x5b80('0xf')](util[_0x5b80('0x10')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x283b4b[_0x5b80('0x1d')],_0x283b4b[_0x5b80('0x18')],_0x283b4b[_0x5b80('0x19')],_0x283b4b[_0x5b80('0x1a')],_0x283b4b['uniqueid']));logger[_0x5b80('0xf')](util[_0x5b80('0x10')](_0x5b80('0x4b'),_0x283b4b['context'],_0x283b4b['extension'],parseInt(_0x283b4b[_0x5b80('0x42')],0xa)+0x1));_0x283b4b[_0x5b80('0x4c')](_0x283b4b[_0x5b80('0x40')],_0x283b4b['extension'],parseInt(_0x283b4b[_0x5b80('0x42')],0xa)+0x1);_0x283b4b[_0x5b80('0x35')]();}}else{logger[_0x5b80('0xb')](util[_0x5b80('0x10')](_0x5b80('0x4d'),_0x283b4b[_0x5b80('0x1d')]));_0x283b4b[_0x5b80('0x4c')](_0x283b4b[_0x5b80('0x40')],_0x283b4b[_0x5b80('0x41')],parseInt(_0x283b4b[_0x5b80('0x42')],0xa)+0x1);_0x283b4b['close']();}}else{logger[_0x5b80('0xb')](util[_0x5b80('0x10')]('Project\x20%s\x20not\x20found',_0x283b4b[_0x5b80('0x1d')]));_0x283b4b['continueAt'](_0x283b4b[_0x5b80('0x40')],_0x283b4b['extension'],parseInt(_0x283b4b[_0x5b80('0x42')],0xa)+0x1);_0x283b4b['close']();}}function main(){var _0x272073;return utilLicense[_0x5b80('0x4e')]()[_0x5b80('0x2c')](function(_0x242379){if(_0x242379){if(_0x242379['voice']){if(_0x242379[_0x5b80('0x4f')]&&_0x242379[_0x5b80('0x4f')]>0x0){logger['info'](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x242379['callysquare']));_0x272073=_0x242379['callysquare'];}else{logger[_0x5b80('0xf')](_0x5b80('0x50'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x272073=-0x1;}}})[_0x5b80('0x2d')](function(_0x295fcb){logger['error']('[LICENSE]',_0x295fcb[_0x5b80('0x16')]);})[_0x5b80('0x51')](function(){var _0x36a811=require(_0x5b80('0x52'))(config['agi'][_0x5b80('0xe')],config[_0x5b80('0x3')]['ip'],_0x272073);_0x36a811['on'](_0x5b80('0xb'),errorHandler);_0x36a811['on'](_0x5b80('0x53'),listeningHandler);_0x36a811['on'](_0x5b80('0x54'),connectionHandler);_0x36a811['on'](_0x5b80('0x35'),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 b846f2f..b32a122 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 _0x4d08=['catch','sendMailMessage','bluebird','jayson/promise','client','http','request','then','error','message','result'];(function(_0x34aeb9,_0x504be5){var _0x5a770e=function(_0x2e3d1b){while(--_0x2e3d1b){_0x34aeb9['push'](_0x34aeb9['shift']());}};_0x5a770e(++_0x504be5);}(_0x4d08,0xf4));var _0x84d0=function(_0x2136d5,_0x4b0479){_0x2136d5=_0x2136d5-0x0;var _0x3bee2e=_0x4d08[_0x2136d5];return _0x3bee2e;};'use strict';var BPromise=require(_0x84d0('0x0'));var jayson=require(_0x84d0('0x1'));var client=jayson[_0x84d0('0x2')][_0x84d0('0x3')]({'port':0x232b});function request(_0x5eaa24,_0x4e1a27){return new BPromise(function(_0xf63450,_0x20ecd6){return client[_0x84d0('0x4')](_0x5eaa24,_0x4e1a27)[_0x84d0('0x5')](function(_0x147aa9){if(_0x147aa9[_0x84d0('0x6')]){return _0x20ecd6(_0x147aa9[_0x84d0('0x6')][_0x84d0('0x7')]);}else{return _0xf63450(_0x147aa9[_0x84d0('0x8')]);}})[_0x84d0('0x9')](function(_0xef904e){return _0x20ecd6(_0xef904e);});});}exports[_0x84d0('0xa')]=function(_0x1cadf4,_0x1ab952){return request('SendMail',{'account':_0x1cadf4,'message':_0x1ab952});}; \ No newline at end of file +var _0x0e7e=['SendMail','bluebird','jayson/promise','request','then','error','message','result','sendMailMessage'];(function(_0x1c3b65,_0x1e5afb){var _0x248e18=function(_0x5071a8){while(--_0x5071a8){_0x1c3b65['push'](_0x1c3b65['shift']());}};_0x248e18(++_0x1e5afb);}(_0x0e7e,0x10f));var _0xe0e7=function(_0x40227e,_0x2a1c52){_0x40227e=_0x40227e-0x0;var _0x419728=_0x0e7e[_0x40227e];return _0x419728;};'use strict';var BPromise=require(_0xe0e7('0x0'));var jayson=require(_0xe0e7('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x1863ae,_0x4a1ae8){return new BPromise(function(_0x6bf0be,_0x24a597){return client[_0xe0e7('0x2')](_0x1863ae,_0x4a1ae8)[_0xe0e7('0x3')](function(_0x4f70a4){if(_0x4f70a4[_0xe0e7('0x4')]){return _0x24a597(_0x4f70a4['error'][_0xe0e7('0x5')]);}else{return _0x6bf0be(_0x4f70a4[_0xe0e7('0x6')]);}})['catch'](function(_0x4e617){return _0x24a597(_0x4e617);});});}exports[_0xe0e7('0x7')]=function(_0x103c82,_0x5972eb){return request(_0xe0e7('0x8'),{'account':_0x103c82,'message':_0x5972eb});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index a6445b8..5d5c7b3 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 _0x62ac=['split','indexOf','slice','emit','exports','util','stream','Transform','_localBuffer','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','substring','length'];(function(_0x4790ae,_0x534430){var _0x58b4bf=function(_0x50b933){while(--_0x50b933){_0x4790ae['push'](_0x4790ae['shift']());}};_0x58b4bf(++_0x534430);}(_0x62ac,0xc8));var _0xc62a=function(_0x34473f,_0x2b9c5c){_0x34473f=_0x34473f-0x0;var _0x25cf6f=_0x62ac[_0x34473f];return _0x25cf6f;};'use strict';var util=require(_0xc62a('0x0'));var Transform=require(_0xc62a('0x1'))[_0xc62a('0x2')];function AGIReply(_0x290e7e){Transform['call'](this,_0x290e7e);this[_0xc62a('0x3')]='';this[_0xc62a('0x4')]=![];}util[_0xc62a('0x5')](AGIReply,Transform);AGIReply[_0xc62a('0x6')]['_transform']=function(_0x2b8aa8,_0x2e2b55,_0xc83a22){var _0x3423cd='\x0a',_0x5f59a2=['\x0a\x0a',_0xc62a('0x7')],_0x3b7813=-0x1,_0x1cb425=-0x1,_0x161a57='',_0x5b7ab8=0x0,_0x52ad02='',_0x29f311='';this[_0xc62a('0x3')]+=_0x2b8aa8['toString']();_0x52ad02=this[_0xc62a('0x3')];if(!this[_0xc62a('0x4')]){_0x5b7ab8=0x0;while(_0x5f59a2[_0x5b7ab8]){while((_0x1cb425=_0x52ad02['indexOf'](_0x5f59a2[_0x5b7ab8]))!=-0x1){_0x161a57=_0x5f59a2[_0x5b7ab8];_0x29f311=_0x52ad02['substring'](0x0,_0x1cb425);_0x52ad02=_0x52ad02[_0xc62a('0x8')](_0x1cb425+_0x161a57[_0xc62a('0x9')]);var _0x22c6be=_0x29f311[_0xc62a('0xa')](_0x3423cd),_0x32ecae=0x0,_0xe34750={},_0x4ad04e='',_0x43c9e1='',_0x25d078=-0x1;while(_0x22c6be[_0x32ecae]){_0x25d078=_0x22c6be[_0x32ecae][_0xc62a('0xb')](':');if(_0x25d078!=-0x1){_0x4ad04e=_0x22c6be[_0x32ecae][_0xc62a('0xc')](0x0,_0x25d078)['trim']();_0x43c9e1=_0x22c6be[_0x32ecae][_0xc62a('0xc')](_0x25d078+0x1)['trim']();if(_0x4ad04e[_0xc62a('0x9')]>0x0){_0xe34750[_0x4ad04e]=_0x43c9e1;}}else{}_0x32ecae++;}this[_0xc62a('0xd')]('headers',_0xe34750);this['_inBody']=!![];}_0x5b7ab8++;}this[_0xc62a('0x3')]=_0x52ad02;}else{while((_0x3b7813=_0x52ad02[_0xc62a('0xb')](_0x3423cd))!=-0x1){_0x29f311=_0x52ad02[_0xc62a('0x8')](0x0,_0x3b7813);this[_0xc62a('0xd')]('line',_0x29f311);_0x52ad02=_0x52ad02[_0xc62a('0x8')](_0x3b7813+_0x3423cd[_0xc62a('0x9')]);}this[_0xc62a('0x3')]=_0x52ad02;}_0xc83a22();};module[_0xc62a('0xe')]=AGIReply; \ No newline at end of file +var _0xecb6=['substring','length','split','slice','trim','emit','line','exports','util','stream','call','_localBuffer','inherits','_transform','\x0d\x0a\x0d\x0a','toString','_inBody','indexOf'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xecb6,0xaa));var _0x6ecb=function(_0x3f6ed6,_0x51616c){_0x3f6ed6=_0x3f6ed6-0x0;var _0x400ffb=_0xecb6[_0x3f6ed6];return _0x400ffb;};'use strict';var util=require(_0x6ecb('0x0'));var Transform=require(_0x6ecb('0x1'))['Transform'];function AGIReply(_0x20ee08){Transform[_0x6ecb('0x2')](this,_0x20ee08);this[_0x6ecb('0x3')]='';this['_inBody']=![];}util[_0x6ecb('0x4')](AGIReply,Transform);AGIReply['prototype'][_0x6ecb('0x5')]=function(_0x5b6d45,_0x35f6ec,_0x45220b){var _0x59da7a='\x0a',_0x33c244=['\x0a\x0a',_0x6ecb('0x6')],_0x837f09=-0x1,_0x40580f=-0x1,_0x3b3ce9='',_0x261cc1=0x0,_0x50b268='',_0xfe6d18='';this[_0x6ecb('0x3')]+=_0x5b6d45[_0x6ecb('0x7')]();_0x50b268=this[_0x6ecb('0x3')];if(!this[_0x6ecb('0x8')]){_0x261cc1=0x0;while(_0x33c244[_0x261cc1]){while((_0x40580f=_0x50b268[_0x6ecb('0x9')](_0x33c244[_0x261cc1]))!=-0x1){_0x3b3ce9=_0x33c244[_0x261cc1];_0xfe6d18=_0x50b268['substring'](0x0,_0x40580f);_0x50b268=_0x50b268[_0x6ecb('0xa')](_0x40580f+_0x3b3ce9[_0x6ecb('0xb')]);var _0x57e3dc=_0xfe6d18[_0x6ecb('0xc')](_0x59da7a),_0x2c19a1=0x0,_0x1a0492={},_0xe559a4='',_0x1336bc='',_0x5dc9b6=-0x1;while(_0x57e3dc[_0x2c19a1]){_0x5dc9b6=_0x57e3dc[_0x2c19a1][_0x6ecb('0x9')](':');if(_0x5dc9b6!=-0x1){_0xe559a4=_0x57e3dc[_0x2c19a1][_0x6ecb('0xd')](0x0,_0x5dc9b6)[_0x6ecb('0xe')]();_0x1336bc=_0x57e3dc[_0x2c19a1][_0x6ecb('0xd')](_0x5dc9b6+0x1)[_0x6ecb('0xe')]();if(_0xe559a4[_0x6ecb('0xb')]>0x0){_0x1a0492[_0xe559a4]=_0x1336bc;}}else{}_0x2c19a1++;}this[_0x6ecb('0xf')]('headers',_0x1a0492);this['_inBody']=!![];}_0x261cc1++;}this[_0x6ecb('0x3')]=_0x50b268;}else{while((_0x837f09=_0x50b268['indexOf'](_0x59da7a))!=-0x1){_0xfe6d18=_0x50b268[_0x6ecb('0xa')](0x0,_0x837f09);this[_0x6ecb('0xf')](_0x6ecb('0x10'),_0xfe6d18);_0x50b268=_0x50b268[_0x6ecb('0xa')](_0x837f09+_0x59da7a[_0x6ecb('0xb')]);}this[_0x6ecb('0x3')]=_0x50b268;}_0x45220b();};module[_0x6ecb('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 129ed15..4290b8f 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 _0xdf9f=['LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','http','request','then','error','message','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','dsn','getUserById','ShowUser','getTrunkById','getSoundById','ShowSound','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','arg_1','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','ShowPause','agentLogin'];(function(_0x116379,_0x473c1f){var _0xab5eae=function(_0xd74251){while(--_0xd74251){_0x116379['push'](_0x116379['shift']());}};_0xab5eae(++_0x473c1f);}(_0xdf9f,0x10f));var _0xfdf9=function(_0x196ad2,_0x148011){_0x196ad2=_0x196ad2-0x0;var _0x533331=_0xdf9f[_0x196ad2];return _0x533331;};'use strict';var BPromise=require(_0xfdf9('0x0'));var moment=require(_0xfdf9('0x1'));var _=require('lodash');var util=require('util');var jayson=require('jayson/promise');var client=jayson['client'][_0xfdf9('0x2')]({'port':0x2329});function request(_0x3a62d7,_0x5de216){return new BPromise(function(_0x435833,_0x5c070a){return client[_0xfdf9('0x3')](_0x3a62d7,_0x5de216)[_0xfdf9('0x4')](function(_0x34c536){if(_0x34c536[_0xfdf9('0x5')]){return _0x5c070a(_0x34c536[_0xfdf9('0x5')][_0xfdf9('0x6')]);}else{return _0x435833(_0x34c536['result']);}})[_0xfdf9('0x7')](function(_0x1ab791){return _0x5c070a(_0x1ab791);});});}exports[_0xfdf9('0x8')]=function(_0x111514){return request(_0xfdf9('0x9'),{'options':{'raw':![],'where':{'name':_0x111514},'attributes':[_0xfdf9('0xa')]}});};exports[_0xfdf9('0xb')]=function(_0x1dd223){return request(_0xfdf9('0xc'),{'options':{'raw':![],'where':{'id':_0x1dd223},'include':[{'model':_0xfdf9('0xd'),'as':_0xfdf9('0xe')}],'attributes':['id',_0xfdf9('0xf'),'email']}});};exports[_0xfdf9('0x10')]=function(_0x287c6c){return request(_0xfdf9('0x9'),{'options':{'where':{'id':_0x287c6c},'attributes':['name']}});};exports[_0xfdf9('0x11')]=function(_0x3e9de0){return request(_0xfdf9('0x12'),{'options':{'where':{'id':_0x3e9de0},'attributes':[_0xfdf9('0xf')]}});};exports[_0xfdf9('0x13')]=function(_0x342366){return request('ShowVariable',{'options':{'where':{'id':_0x342366},'attributes':[_0xfdf9('0xf')]}});};exports[_0xfdf9('0x14')]=function(_0x4daa9d){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x4daa9d},'attributes':[_0xfdf9('0x15')]}});};exports[_0xfdf9('0x16')]=function(_0x531981){return request(_0xfdf9('0x17'),{'options':{'where':{'id':_0x531981},'attributes':[_0xfdf9('0xf')]}});};exports[_0xfdf9('0x18')]=function(_0x14a1c5){return request('ShowTrunk',{'options':{'where':{'id':_0x14a1c5},'attributes':[_0xfdf9('0xf')]}});};exports[_0xfdf9('0x19')]=function(_0x581a5f){return request(_0xfdf9('0x1a'),{'options':{'where':{'id':_0x581a5f},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x3fa0b2){return request(_0xfdf9('0x1b'),{'options':{'raw':![],'where':{'id':_0x3fa0b2},'include':[{'model':_0xfdf9('0x1c'),'as':_0xfdf9('0x1d')}]}});};exports[_0xfdf9('0x1e')]=function(_0x4024f1){return request('ShowSmsAccount',{'options':{'where':{'id':_0x4024f1},'attributes':['id',_0xfdf9('0xf')]}});};exports[_0xfdf9('0x1f')]=function(_0x306f30){return request(_0xfdf9('0x20'),{'body':_0x306f30});};exports[_0xfdf9('0x21')]=function(_0x20fab1){return request('CreateSquareDetailsReport',{'body':_0x20fab1});};exports['createSquareReport']=function(_0x51b4e2){return request('CreateSquareReport',{'body':_['merge'](_0x51b4e2,{'project_name':_0x51b4e2[_0xfdf9('0x22')],'prev_project_name':_0x51b4e2['arg_2']||'','is_subproject':_0x51b4e2['arg_2']?!![]:![],'leaveAt':moment()[_0xfdf9('0x23')](_0xfdf9('0x24'))})});};exports[_0xfdf9('0x25')]=function(_0x2ee834){return request('CreateSquareRecording',{'body':_0x2ee834});};exports[_0xfdf9('0x26')]=function(_0x62c930){return request(_0xfdf9('0x27'),{'body':_0x62c930});};exports[_0xfdf9('0x28')]=function(_0xc54335){return request(_0xfdf9('0x29'),{'options':{'raw':![],'where':{'phone':_0xc54335[_0xfdf9('0x2a')],'ListId':_0xc54335[_0xfdf9('0x2b')]}}})['then'](function(_0x499d46){if(_0x499d46){return _0x499d46;}return request(_0xfdf9('0x2c'),{'body':_0xc54335});});};exports['getPauseById']=function(_0x38bf2c){return request(_0xfdf9('0x2d'),{'options':{'where':{'id':_0x38bf2c},'attributes':[_0xfdf9('0xf')]}});};exports[_0xfdf9('0x2e')]=function(_0x149f63,_0x5ce6e3){return request(_0xfdf9('0x2f'),{'body':{'interface':_0x5ce6e3},'options':{'where':_0x149f63}});};exports[_0xfdf9('0x30')]=function(_0x3b04e8,_0x5da765,_0x5a50fc){return request(_0xfdf9('0x31'),{'body':{'type':_0x5da765,'uniqueid':_0x5a50fc},'options':{'where':_0x3b04e8}});};exports['agentUnpause']=function(_0x4a6aec){return request(_0xfdf9('0x32'),{'body':{},'options':{'where':_0x4a6aec}});};exports[_0xfdf9('0x33')]=function(_0x808b57){return request(_0xfdf9('0x34'),{'body':{},'options':{'where':_0x808b57}});}; \ No newline at end of file +var _0xf432=['ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSquareDetailsReport','CreateSquareDetailsReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','moment','lodash','jayson/promise','client','http','request','then','error','message','catch','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','getSoundById'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf432,0x17a));var _0x2f43=function(_0x5d815b,_0x4c422d){_0x5d815b=_0x5d815b-0x0;var _0x5440a9=_0xf432[_0x5d815b];return _0x5440a9;};'use strict';var BPromise=require('bluebird');var moment=require(_0x2f43('0x0'));var _=require(_0x2f43('0x1'));var util=require('util');var jayson=require(_0x2f43('0x2'));var client=jayson[_0x2f43('0x3')][_0x2f43('0x4')]({'port':0x2329});function request(_0x1733e7,_0x1b39ab){return new BPromise(function(_0x1ed2be,_0x8ce475){return client[_0x2f43('0x5')](_0x1733e7,_0x1b39ab)[_0x2f43('0x6')](function(_0x36d714){if(_0x36d714[_0x2f43('0x7')]){return _0x8ce475(_0x36d714[_0x2f43('0x7')][_0x2f43('0x8')]);}else{return _0x1ed2be(_0x36d714['result']);}})[_0x2f43('0x9')](function(_0x3fe0f7){return _0x8ce475(_0x3fe0f7);});});}exports[_0x2f43('0xa')]=function(_0x2e6efe){return request(_0x2f43('0xb'),{'options':{'raw':![],'where':{'name':_0x2e6efe},'attributes':['production']}});};exports[_0x2f43('0xc')]=function(_0x159129){return request(_0x2f43('0xd'),{'options':{'raw':![],'where':{'id':_0x159129},'include':[{'model':_0x2f43('0xe'),'as':_0x2f43('0xf')}],'attributes':['id',_0x2f43('0x10'),_0x2f43('0x11')]}});};exports[_0x2f43('0x12')]=function(_0x1f1944){return request(_0x2f43('0xb'),{'options':{'where':{'id':_0x1f1944},'attributes':[_0x2f43('0x10')]}});};exports[_0x2f43('0x13')]=function(_0x42928b){return request(_0x2f43('0x14'),{'options':{'where':{'id':_0x42928b},'attributes':['name']}});};exports['getVariableById']=function(_0xb712f7){return request('ShowVariable',{'options':{'where':{'id':_0xb712f7},'attributes':[_0x2f43('0x10')]}});};exports[_0x2f43('0x15')]=function(_0x236cde){return request(_0x2f43('0x16'),{'options':{'where':{'id':_0x236cde},'attributes':[_0x2f43('0x17')]}});};exports[_0x2f43('0x18')]=function(_0x2301e0){return request(_0x2f43('0x19'),{'options':{'where':{'id':_0x2301e0},'attributes':[_0x2f43('0x10')]}});};exports[_0x2f43('0x1a')]=function(_0x1e9560){return request('ShowTrunk',{'options':{'where':{'id':_0x1e9560},'attributes':[_0x2f43('0x10')]}});};exports[_0x2f43('0x1b')]=function(_0x1e2a05){return request(_0x2f43('0x1c'),{'options':{'where':{'id':_0x1e2a05},'attributes':[_0x2f43('0x1d')]}});};exports[_0x2f43('0x1e')]=function(_0x16fd75){return request(_0x2f43('0x1f'),{'options':{'raw':![],'where':{'id':_0x16fd75},'include':[{'model':_0x2f43('0x20'),'as':_0x2f43('0x21')}]}});};exports[_0x2f43('0x22')]=function(_0x285507){return request(_0x2f43('0x23'),{'options':{'where':{'id':_0x285507},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x26e2cd){return request('CreateSmsMessage',{'body':_0x26e2cd});};exports[_0x2f43('0x24')]=function(_0x4735ed){return request(_0x2f43('0x25'),{'body':_0x4735ed});};exports['createSquareReport']=function(_0xe0b88){return request('CreateSquareReport',{'body':_[_0x2f43('0x26')](_0xe0b88,{'project_name':_0xe0b88[_0x2f43('0x27')],'prev_project_name':_0xe0b88[_0x2f43('0x28')]||'','is_subproject':_0xe0b88[_0x2f43('0x28')]?!![]:![],'leaveAt':moment()[_0x2f43('0x29')](_0x2f43('0x2a'))})});};exports['createSquareRecording']=function(_0x3e2c34){return request(_0x2f43('0x2b'),{'body':_0x3e2c34});};exports[_0x2f43('0x2c')]=function(_0x443ac6){return request(_0x2f43('0x2d'),{'body':_0x443ac6});};exports[_0x2f43('0x2e')]=function(_0x46e5cc){return request(_0x2f43('0x2f'),{'options':{'raw':![],'where':{'phone':_0x46e5cc[_0x2f43('0x30')],'ListId':_0x46e5cc['ListId']}}})[_0x2f43('0x6')](function(_0x3d11f5){if(_0x3d11f5){return _0x3d11f5;}return request(_0x2f43('0x31'),{'body':_0x46e5cc});});};exports[_0x2f43('0x32')]=function(_0xbbb031){return request(_0x2f43('0x33'),{'options':{'where':{'id':_0xbbb031},'attributes':[_0x2f43('0x10')]}});};exports[_0x2f43('0x34')]=function(_0x9d5173,_0xd3682e){return request(_0x2f43('0x35'),{'body':{'interface':_0xd3682e},'options':{'where':_0x9d5173}});};exports[_0x2f43('0x36')]=function(_0x40870c,_0x57f6c4,_0x5909f7){return request(_0x2f43('0x37'),{'body':{'type':_0x57f6c4,'uniqueid':_0x5909f7},'options':{'where':_0x40870c}});};exports[_0x2f43('0x38')]=function(_0xa1e646){return request('UnpauseUser',{'body':{},'options':{'where':_0xa1e646}});};exports[_0x2f43('0x39')]=function(_0x44b9ea){return request('LogoutUser',{'body':{},'options':{'where':_0x44b9ea}});}; \ 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 6f1aa2d..4ffbebd 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 _0x06f4=['./polly','./lex'];(function(_0x3c70a4,_0x5f2560){var _0x3f0108=function(_0x5663c2){while(--_0x5663c2){_0x3c70a4['push'](_0x3c70a4['shift']());}};_0x3f0108(++_0x5f2560);}(_0x06f4,0x136));var _0x406f=function(_0x1dfb09,_0x4294e6){_0x1dfb09=_0x1dfb09-0x0;var _0x2c221a=_0x06f4[_0x1dfb09];return _0x2c221a;};var polly=require(_0x406f('0x0'));var lex=require(_0x406f('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xd206=['./lex','./polly'];(function(_0x482372,_0x40f56b){var _0x55fbea=function(_0x43d38d){while(--_0x43d38d){_0x482372['push'](_0x482372['shift']());}};_0x55fbea(++_0x40f56b);}(_0xd206,0x107));var _0x6d20=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xd206[_0x45b034];return _0x509cb0;};var polly=require(_0x6d20('0x0'));var lex=require(_0x6d20('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index cf5edc8..b862111 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 _0x6f7a=['./lib/api','exports'];(function(_0x37b634,_0x4ecc0d){var _0x16a85d=function(_0x7cb6bc){while(--_0x7cb6bc){_0x37b634['push'](_0x37b634['shift']());}};_0x16a85d(++_0x4ecc0d);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x2433ff,_0x3eabe7){_0x2433ff=_0x2433ff-0x0;var _0x42013e=_0x6f7a[_0x2433ff];return _0x42013e;};'use strict';var lex=require(_0xa6f7('0x0'));module[_0xa6f7('0x1')]=function(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8){return lex(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8);}; \ No newline at end of file +var _0x9354=['exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9354,0x96));var _0x4935=function(_0x177cc9,_0x3f6fdd){_0x177cc9=_0x177cc9-0x0;var _0x2fe577=_0x9354[_0x177cc9];return _0x2fe577;};'use strict';var lex=require('./lib/api');module[_0x4935('0x0')]=function(_0xc3c1f3,_0x4896da,_0x263dd5,_0x2a4993,_0x29d1eb,_0x280bbc){return lex(_0xc3c1f3,_0x4896da,_0x263dd5,_0x2a4993,_0x29d1eb,_0x280bbc);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 72e8e7d..f29390e 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(_0x2a4e52,_0x50ee4f){var _0xaf45af=function(_0xfcef45){while(--_0xfcef45){_0x2a4e52['push'](_0x2a4e52['shift']());}};_0xaf45af(++_0x50ee4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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(_0x18e12b,_0x2a9ca5){var _0x38e780=function(_0x307b11){while(--_0x307b11){_0x18e12b['push'](_0x18e12b['shift']());}};_0x38e780(++_0x2a9ca5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 2b99100..75f1941 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 _0xa66d=['./lib/api'];(function(_0x56975f,_0x3a1a97){var _0x63b52a=function(_0x247c37){while(--_0x247c37){_0x56975f['push'](_0x56975f['shift']());}};_0x63b52a(++_0x3a1a97);}(_0xa66d,0xf8));var _0xda66=function(_0x58f647,_0x55b47f){_0x58f647=_0x58f647-0x0;var _0x474fa2=_0xa66d[_0x58f647];return _0x474fa2;};'use strict';var polly=require(_0xda66('0x0'));module['exports']=function(_0x462093,_0x215cbb,_0x21cbb7,_0x44c698,_0x52a8c7,_0x4facdb,_0x4a0fc3){return polly(_0x462093,_0x215cbb,_0x21cbb7,_0x44c698,_0x52a8c7,_0x4facdb,_0x4a0fc3);}; \ No newline at end of file +var _0x85f8=['exports','./lib/api'];(function(_0x4e371d,_0x3b7447){var _0x4e6be3=function(_0x3a7331){while(--_0x3a7331){_0x4e371d['push'](_0x4e371d['shift']());}};_0x4e6be3(++_0x3b7447);}(_0x85f8,0x11f));var _0x885f=function(_0x4a861a,_0x2f4b27){_0x4a861a=_0x4a861a-0x0;var _0x2133ce=_0x85f8[_0x4a861a];return _0x2133ce;};'use strict';var polly=require(_0x885f('0x0'));module[_0x885f('0x1')]=function(_0x14a717,_0x184fc7,_0x13ee04,_0x49e6e0,_0xc06172,_0x9efc3e,_0x224881){return polly(_0x14a717,_0x184fc7,_0x13ee04,_0x49e6e0,_0xc06172,_0x9efc3e,_0x224881);}; \ 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 509b37b..d0fbb50 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 _0xe783=['Polly','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x3fb225,_0x47d95d){var _0x5122d3=function(_0xa489cc){while(--_0xa489cc){_0x3fb225['push'](_0x3fb225['shift']());}};_0x5122d3(++_0x47d95d);}(_0xe783,0xf4));var _0x3e78=function(_0x4aaf51,_0xff8752){_0x4aaf51=_0x4aaf51-0x0;var _0x499df4=_0xe783[_0x4aaf51];return _0x499df4;};'use strict';var fs=require('fs');var path=require(_0x3e78('0x0'));var BPromise=require(_0x3e78('0x1'));var rs=require(_0x3e78('0x2'));var AWS=require(_0x3e78('0x3'));function pollyResult(_0x7d4931,_0x4ee178,_0x15033b){return new BPromise(function(_0x3a2439,_0x4f96ad){_0x7d4931[_0x3e78('0x4')](_0x4ee178,function(_0x279056,_0x2a1f7b){if(_0x279056){_0x4f96ad(_0x279056);}else if(_0x2a1f7b){if(_0x2a1f7b[_0x3e78('0x5')]instanceof Buffer){fs[_0x3e78('0x6')](_0x15033b,_0x2a1f7b[_0x3e78('0x5')],function(_0x301fb2){if(_0x301fb2){_0x4f96ad(_0x301fb2);}else{_0x3a2439();}});}else{_0x4f96ad(new Error(_0x3e78('0x7')));}}else{_0x4f96ad(new Error(_0x3e78('0x8')));}});});}module['exports']=function(_0x3cc182,_0x3a007c,_0x209091,_0x538164,_0x2539a6,_0x3208e3,_0xacafde){var _0x58a2ee=new AWS[(_0x3e78('0x9'))]({'accessKeyId':_0x3cc182,'secretAccessKey':_0x3a007c,'region':_0x209091});var _0x54b297={'Text':_0x2539a6,'TextType':_0x3208e3||'text','OutputFormat':_0x3e78('0xa'),'VoiceId':_0x538164};return pollyResult(_0x58a2ee,_0x54b297,_0xacafde);}; \ No newline at end of file +var _0x671d=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x671d,0x155));var _0xd671=function(_0x2dd849,_0x3bd1bf){_0x2dd849=_0x2dd849-0x0;var _0x38ba4e=_0x671d[_0x2dd849];return _0x38ba4e;};'use strict';var fs=require('fs');var path=require(_0xd671('0x0'));var BPromise=require(_0xd671('0x1'));var rs=require(_0xd671('0x2'));var AWS=require(_0xd671('0x3'));function pollyResult(_0x2f6b53,_0x4378c3,_0x4c63bb){return new BPromise(function(_0x2822a0,_0x2bd49b){_0x2f6b53[_0xd671('0x4')](_0x4378c3,function(_0x477df9,_0x1998af){if(_0x477df9){_0x2bd49b(_0x477df9);}else if(_0x1998af){if(_0x1998af[_0xd671('0x5')]instanceof Buffer){fs[_0xd671('0x6')](_0x4c63bb,_0x1998af['AudioStream'],function(_0x934c11){if(_0x934c11){_0x2bd49b(_0x934c11);}else{_0x2822a0();}});}else{_0x2bd49b(new Error(_0xd671('0x7')));}}else{_0x2bd49b(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xd671('0x8')]=function(_0x5801c3,_0x134989,_0x305eb9,_0x2189f3,_0x320a70,_0x25bc4d,_0x55a788){var _0x22740a=new AWS[(_0xd671('0x9'))]({'accessKeyId':_0x5801c3,'secretAccessKey':_0x134989,'region':_0x305eb9});var _0x30999c={'Text':_0x320a70,'TextType':_0x25bc4d||_0xd671('0xa'),'OutputFormat':_0xd671('0xb'),'VoiceId':_0x2189f3};return pollyResult(_0x22740a,_0x30999c,_0x55a788);}; \ 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 ecf58ac..d2eceac 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 _0x381c=['./lib/api','exports'];(function(_0xf3b06f,_0x489959){var _0x531640=function(_0x50f1ba){while(--_0x50f1ba){_0xf3b06f['push'](_0xf3b06f['shift']());}};_0x531640(++_0x489959);}(_0x381c,0x1aa));var _0xc381=function(_0x23b73e,_0x1d3c0a){_0x23b73e=_0x23b73e-0x0;var _0xca717c=_0x381c[_0x23b73e];return _0xca717c;};'use strict';var asr=require(_0xc381('0x0'));module[_0xc381('0x1')]=function(_0x172e4a,_0x580fb6,_0x2f88cf,_0xce00de){return asr(_0x172e4a,_0x580fb6,_0x2f88cf);}; \ No newline at end of file +var _0x34ba=['./lib/api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34ba,0x19e));var _0xa34b=function(_0x44774c,_0x28dcf6){_0x44774c=_0x44774c-0x0;var _0x27a337=_0x34ba[_0x44774c];return _0x27a337;};'use strict';var asr=require(_0xa34b('0x0'));module['exports']=function(_0x14d217,_0xb8bfed,_0x10c356,_0x4a445a){return asr(_0x14d217,_0xb8bfed,_0x10c356);}; \ 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 bd5e087..689b55e 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 _0xb2b3=['key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x408b05,_0x37d13c){var _0x47d5dd=function(_0x5cf6de){while(--_0x5cf6de){_0x408b05['push'](_0x408b05['shift']());}};_0x47d5dd(++_0x37d13c);}(_0xb2b3,0x71));var _0x3b2b=function(_0x408271,_0x3185a2){_0x408271=_0x408271-0x0;var _0x278f98=_0xb2b3[_0x408271];return _0x278f98;};'use strict';var url=require(_0x3b2b('0x0'));var BPromise=require(_0x3b2b('0x1'));var fs=require('fs');var host=_0x3b2b('0x2');module[_0x3b2b('0x3')]=function(_0xf005ed,_0x3de73b,_0x2059f0){return new BPromise(function(_0x4dad94,_0x3eff63){var _0x222c10;if(typeof _0xf005ed!==_0x3b2b('0x4')||_0xf005ed[_0x3b2b('0x5')]===0x0){return _0x3eff63(_0x3b2b('0x6'));}if(typeof _0x3de73b!==_0x3b2b('0x4')||_0x3de73b[_0x3b2b('0x5')]===0x0){return _0x3eff63(_0x3b2b('0x7'));}if(typeof _0x2059f0!==_0x3b2b('0x8')&&(typeof _0x2059f0!==_0x3b2b('0x4')||_0x2059f0[_0x3b2b('0x5')]===0x0)){return _0x3eff63(_0x3b2b('0x9'));}try{_0x222c10=fs['readFileSync'](_0xf005ed)[_0x3b2b('0xa')](_0x3b2b('0xb'));}catch(_0xd2f168){return _0x3eff63(_0xd2f168);}return _0x4dad94({'method':_0x3b2b('0xc'),'uri':host+_0x3b2b('0xd')+_0x3de73b,'body':{'config':{'encoding':_0x3b2b('0xe'),'sampleRateHertz':'8000','languageCode':_0x2059f0},'audio':{'content':_0x222c10}},'json':!![]});});}; \ No newline at end of file +var _0x0a9a=['POST','8000','bluebird','exports','length','filepath\x20should\x20be\x20a\x20string','string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x0a9a,0x183));var _0xa0a9=function(_0x75eda6,_0x2f71ac){_0x75eda6=_0x75eda6-0x0;var _0x4fa022=_0x0a9a[_0x75eda6];return _0x4fa022;};'use strict';var url=require('url');var BPromise=require(_0xa0a9('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xa0a9('0x1')]=function(_0x3cff22,_0x34801b,_0x49162f){return new BPromise(function(_0x4ba993,_0x317a94){var _0x360be5;if(typeof _0x3cff22!=='string'||_0x3cff22[_0xa0a9('0x2')]===0x0){return _0x317a94(_0xa0a9('0x3'));}if(typeof _0x34801b!==_0xa0a9('0x4')||_0x34801b[_0xa0a9('0x2')]===0x0){return _0x317a94('key\x20should\x20be\x20a\x20string');}if(typeof _0x49162f!==_0xa0a9('0x5')&&(typeof _0x49162f!=='string'||_0x49162f[_0xa0a9('0x2')]===0x0)){return _0x317a94(_0xa0a9('0x6'));}try{_0x360be5=fs[_0xa0a9('0x7')](_0x3cff22)[_0xa0a9('0x8')]('base64');}catch(_0x2ba0ac){return _0x317a94(_0x2ba0ac);}return _0x4ba993({'method':_0xa0a9('0x9'),'uri':host+'/v1/speech:recognize?key='+_0x34801b,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xa0a9('0xa'),'languageCode':_0x49162f},'audio':{'content':_0x360be5}},'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 a46a250..2b982e6 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 _0x0267=['exports','./asr'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x0267,0x1ed));var _0x7026=function(_0x1f1e62,_0x2897cf){_0x1f1e62=_0x1f1e62-0x0;var _0x1a24cf=_0x0267[_0x1f1e62];return _0x1a24cf;};var asr=require(_0x7026('0x0'));module[_0x7026('0x1')]={'asr':asr}; \ No newline at end of file +var _0xcc41=['exports','./asr'];(function(_0x1f57e7,_0x31455f){var _0xc38613=function(_0x3a13dc){while(--_0x3a13dc){_0x1f57e7['push'](_0x1f57e7['shift']());}};_0xc38613(++_0x31455f);}(_0xcc41,0x1ef));var _0x1cc4=function(_0x2e5405,_0x42ec09){_0x2e5405=_0x2e5405-0x0;var _0x2f0270=_0xcc41[_0x2e5405];return _0x2f0270;};var asr=require(_0x1cc4('0x0'));module[_0x1cc4('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 d0b9adc..6961b22 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 _0x2e4c=['input','audioConfig','MP3','text:synthesize','POST','.mp3','from','writeFile','.wav','777','googleCloudTTS\x20path','split','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','writeFileSync','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','replace','sessionPath','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20confidence','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','bluebird','http','https','path','request-promise','randomstring','sox','url','parse','util','./aws','./google','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','unlink','download\x20error','https:','get','end','transcode','wav','error\x20convert','start','resolve','tmp','generate','base64','then','chmodSync','toString','googleCloudTTS','?key=','ssml'];(function(_0x36f465,_0x4689e6){var _0xc1a53=function(_0x318cc6){while(--_0x318cc6){_0x36f465['push'](_0x36f465['shift']());}};_0xc1a53(++_0x4689e6);}(_0x2e4c,0x16e));var _0xc2e4=function(_0x628eee,_0x3f3fba){_0x628eee=_0x628eee-0x0;var _0x447718=_0x2e4c[_0x628eee];return _0x447718;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xc2e4('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xc2e4('0x1'));var https=require(_0xc2e4('0x2'));var md5=require('md5');var path=require(_0xc2e4('0x3'));var querystring=require('querystring');var rp=require(_0xc2e4('0x4'));var rs=require(_0xc2e4('0x5'));var sox=require(_0xc2e4('0x6'));var tts=require('google-tts-api');var urlParse=require(_0xc2e4('0x7'))[_0xc2e4('0x8')];var util=require(_0xc2e4('0x9'));var aws=require(_0xc2e4('0xa'));var google=require(_0xc2e4('0xb'));var sestek=require('./sestek');var tilde=require(_0xc2e4('0xc'));var logger=require(_0xc2e4('0xd'))(_0xc2e4('0xe'));var ISPEECH_API=_0xc2e4('0xf');function downloadFile(_0x40bc5f,_0x2c2088){return new BPromise(function(_0x4f5ff4,_0x1f3853){var _0x12f031=urlParse(_0x40bc5f);var _0x4a51fe=_0x12f031[_0xc2e4('0x10')]==='https:'?https:http;var _0x56a4cf={'host':_0x12f031[_0xc2e4('0x11')],'path':_0x12f031['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4a51fe['get'](_0x56a4cf,function(_0x444a19){if(_0x444a19[_0xc2e4('0x12')]!==0xc8){logger[_0xc2e4('0x13')](_0xc2e4('0x14')+_0x40bc5f+_0xc2e4('0x15')+_0x444a19[_0xc2e4('0x12')]+'\x20('+_0x444a19['statusMessage']+')');_0x1f3853(new Error(_0xc2e4('0x14')+_0x40bc5f+_0xc2e4('0x15')+_0x444a19[_0xc2e4('0x12')]+'\x20('+_0x444a19[_0xc2e4('0x16')]+')'));return;}var _0x3aaeea=fs['createWriteStream'](_0x2c2088);_0x3aaeea['on'](_0xc2e4('0x17'),function(){logger[_0xc2e4('0x18')](_0xc2e4('0x19'));_0x3aaeea['close'](_0x4f5ff4);});_0x3aaeea['on'](_0xc2e4('0x13'),function(_0x1c2a11){fs[_0xc2e4('0x1a')](_0x2c2088);logger[_0xc2e4('0x13')](_0xc2e4('0x1b'),_0x1c2a11);_0x1f3853(_0x1c2a11);});_0x444a19['pipe'](_0x3aaeea);})['on'](_0xc2e4('0x13'),function(_0x5addb7){logger['error'](_0x5addb7);_0x1f3853(_0x5addb7);})['end']();});}function uploadFile(_0x4d2518){return new BPromise(function(_0x2f9007,_0x5bf944){var _0x1cac77=urlParse(_0x4d2518);var _0x35b21d=_0x1cac77[_0xc2e4('0x10')]===_0xc2e4('0x1c')?https:http;var _0x31b09f={'host':_0x1cac77['host'],'path':_0x1cac77[_0xc2e4('0x3')],'headers':{'user-agent':'WHAT_EVER'}};_0x35b21d[_0xc2e4('0x1d')](_0x31b09f,function(_0x20548d){if(_0x20548d[_0xc2e4('0x12')]!==0xc8){_0x5bf944(new Error(_0xc2e4('0x14')+_0x4d2518+_0xc2e4('0x15')+_0x20548d[_0xc2e4('0x12')]+'\x20('+_0x20548d[_0xc2e4('0x16')]+')'));return;}var _0x5b03e1='';_0x20548d['on']('data',function(_0x559907){_0x5b03e1+=_0x559907;});_0x20548d['on'](_0xc2e4('0x1e'),function(){_0x2f9007(_0x5b03e1);});})['on'](_0xc2e4('0x13'),function(_0x35705a){_0x5bf944(_0x35705a);})[_0xc2e4('0x1e')]();});}function convertFile(_0xce8b62,_0x136664){return new BPromise(function(_0x324d65,_0x2449b2){var _0x5649da=sox[_0xc2e4('0x1f')](_0xce8b62,_0x136664,{'sampleRate':0x1f40,'format':_0xc2e4('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5649da['on'](_0xc2e4('0x13'),function(_0x406121){logger[_0xc2e4('0x13')](_0xc2e4('0x21'),_0x406121);_0x2449b2(_0x406121);});_0x5649da['on'](_0xc2e4('0x1e'),function(){logger[_0xc2e4('0x18')]('finish\x20to\x20convert');_0x324d65();});_0x5649da[_0xc2e4('0x22')]();});}function base64Decode(_0x216720,_0x518b75){var _0x598b77=path[_0xc2e4('0x23')](__dirname,_0xc2e4('0x24'),rs[_0xc2e4('0x25')](0x4)+'.wav');fs['writeFileSync'](_0x598b77,_0x216720,_0xc2e4('0x26'));return convertFile(_0x598b77,_0x518b75)[_0xc2e4('0x27')](function(){try{fs[_0xc2e4('0x1a')](_0x598b77);fs[_0xc2e4('0x28')](_0x518b75,'777');}catch(_0x2c4be2){logger['error'](_0x2c4be2);}return _0x518b75['split']('.')[0x0];});}function base64Encode(_0x182483){var _0x380f0e=fs['readFileSync'](_0x182483);return new Buffer(_0x380f0e)[_0xc2e4('0x29')](_0xc2e4('0x26'));}exports[_0xc2e4('0x2a')]=function(_0xd5a667,_0x216e8b,_0x5287c8,_0x29b88d,_0x192501,_0x2b5f18){var _0x5b6412,_0x4fc17a;var _0x51ff15='https://texttospeech.googleapis.com/v1/';var _0x25f3dd=_0xc2e4('0x2b')+_0xd5a667;var _0x5b478f={};if(_0x216e8b===_0xc2e4('0x2c')){_0x5b478f[_0xc2e4('0x2d')]={'ssml':_0x5287c8};}else{_0x5b478f[_0xc2e4('0x2d')]={'text':_0x5287c8};};_0x5b478f['voice']={'languageCode':_0x29b88d,'ssmlGender':_0x192501};_0x5b478f[_0xc2e4('0x2e')]={'audioEncoding':_0xc2e4('0x2f'),'sampleRateHertz':0x1f40};var _0x4dad3e={'url':_0x51ff15+_0xc2e4('0x30')+_0x25f3dd,'method':_0xc2e4('0x31'),'json':!![],'body':_0x5b478f};return rp(_0x4dad3e)[_0xc2e4('0x27')](function(_0x22aba9){return new BPromise(function(_0x5a50d9,_0x123a4a){_0x5b6412=path[_0xc2e4('0x23')](__dirname,'tmp',rs[_0xc2e4('0x25')](0x4)+_0xc2e4('0x32'));var _0xf32c03=Buffer[_0xc2e4('0x33')](_0x22aba9['audioContent'],_0xc2e4('0x26'));return fs[_0xc2e4('0x34')](_0x5b6412,_0xf32c03,function(_0x2fb79c){_0x123a4a(_0x2fb79c);},function(_0x240062){fs[_0xc2e4('0x28')](_0x5b6412,'777');_0x5a50d9(_0x240062);});});})['then'](function(_0x1a84ff){_0x4fc17a=path[_0xc2e4('0x23')](__dirname,'tmp',rs['generate'](0x4)+_0xc2e4('0x35'));return convertFile(_0x5b6412,_0x4fc17a);})[_0xc2e4('0x27')](function(){try{fs[_0xc2e4('0x1a')](_0x5b6412);fs[_0xc2e4('0x28')](_0x4fc17a,_0xc2e4('0x36'));}catch(_0x2e1a65){logger[_0xc2e4('0x13')](_0x2e1a65);}logger['info'](_0xc2e4('0x37'),_0x4fc17a['split']('.')[0x0]);return _0x4fc17a[_0xc2e4('0x38')]('.')[0x0];});};exports[_0xc2e4('0x39')]=function(_0x3885b7,_0x16ce7d){var _0x335301='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x599014,_0x18a46f;var _0x5907e4;var _0x1760e8={'encoding':_0xc2e4('0x3a'),'method':'POST','timeout':0x2710,'url':_0x335301,'headers':{'Content-Type':_0xc2e4('0x3b')},'body':_0xc2e4('0x3c')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON[_0xc2e4('0x3d')]([_0x3885b7,_0x16ce7d||'en',![],_0xc2e4('0x3e')]),null,_0xc2e4('0x3f')]]]))};return rp(_0x1760e8)[_0xc2e4('0x27')](function(_0x89e724){try{_0x5907e4=eval(_0x89e724[_0xc2e4('0x40')](0x5))[0x0][0x2];}catch(_0x4cbb0f){throw new Error(_0xc2e4('0x41')+_0x89e724[_0xc2e4('0x42')]);}if(!_0x5907e4){if(_0x3885b7[_0xc2e4('0x43')]>0xc8){throw new Error(_0xc2e4('0x44'));}else{throw new Error(_0xc2e4('0x45')+_0x16ce7d+'\x22\x20might\x20not\x20exist');}}try{_0x5907e4=eval(_0x5907e4)[0x0];}catch(_0x2d9399){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xc2e4('0x42')]);}const _0x26a3c8=_0x5907e4;_0x599014=path[_0xc2e4('0x23')](__dirname,'tmp',rs[_0xc2e4('0x25')](0x4)+'.mp3');fs[_0xc2e4('0x46')](_0x599014,_0x5907e4,{'encoding':_0xc2e4('0x26')});_0x18a46f=path['resolve'](__dirname,_0xc2e4('0x24'),rs['generate'](0x4)+_0xc2e4('0x35'));return convertFile(_0x599014,_0x18a46f);})['then'](function(){try{fs[_0xc2e4('0x1a')](_0x599014);fs[_0xc2e4('0x28')](_0x18a46f,_0xc2e4('0x36'));}catch(_0x565694){logger['error'](_0x565694);}logger[_0xc2e4('0x18')](_0xc2e4('0x47'),_0x18a46f[_0xc2e4('0x38')]('.')[0x0]);return _0x18a46f['split']('.')[0x0];});};exports[_0xc2e4('0x48')]=function(_0x5066b2,_0x5c5790,_0x22abb7){return google['asr'](_0x5066b2,_0x5c5790,_0x22abb7)['then'](function(_0x1eb2e6){logger[_0xc2e4('0x18')](_0x1eb2e6[_0xc2e4('0x49')]);return rp(_0x1eb2e6);})[_0xc2e4('0x27')](function(_0x280495){var _0x2fa856='';var _0x4d5aab=0x0;try{fs[_0xc2e4('0x1a')](_0x5066b2);}catch(_0x29d80f){logger[_0xc2e4('0x13')](_0x29d80f);}if(_0x280495&&_0x280495[_0xc2e4('0x4a')]){_0x2fa856=_0x280495[_0xc2e4('0x4a')][_0xc2e4('0x4b')](function(_0x4a5814){return _0x4a5814&&_0x4a5814['alternatives'][0x0]&&_0x4a5814[_0xc2e4('0x4c')][0x0]['transcript']?_0x4a5814[_0xc2e4('0x4c')][0x0][_0xc2e4('0x4d')]:'';})[_0xc2e4('0x4e')]('\x0a');_0x4d5aab=_0x280495['results']['map'](function(_0x590821){return _0x590821&&_0x590821['alternatives'][0x0]&&_0x590821['alternatives'][0x0]['confidence']?_0x590821[_0xc2e4('0x4c')][0x0][_0xc2e4('0x4f')]:0x0;})[_0xc2e4('0x4e')]('\x0a');}logger[_0xc2e4('0x18')](_0xc2e4('0x50'),_0x2fa856);logger[_0xc2e4('0x18')](_0xc2e4('0x51'),_0x4d5aab);return{'transcript':_0x2fa856,'confidence':_0x4d5aab};})[_0xc2e4('0x52')](function(_0x989f54){logger[_0xc2e4('0x13')](_0xc2e4('0x53'),_0x989f54[_0xc2e4('0x12')],_0x989f54[_0xc2e4('0x54')],_0x989f54[_0xc2e4('0x55')]);});};exports[_0xc2e4('0x56')]=function(_0x1cb890,_0x42847e,_0x5ceb7c,_0x356040){var _0x590dc8=apiai(_0x42847e,{'language':_0x356040||'en'});return _0x590dc8[_0xc2e4('0x57')](_0x5ceb7c,{'sessionId':md5(_0x1cb890)})[_0xc2e4('0x27')](function(_0x446f77){logger[_0xc2e4('0x18')](JSON[_0xc2e4('0x3d')](_0x446f77));return{'source':_0x446f77[_0xc2e4('0x58')][_0xc2e4('0x59')],'resolvedQuery':_0x446f77[_0xc2e4('0x58')][_0xc2e4('0x5a')],'action':_0x446f77[_0xc2e4('0x58')][_0xc2e4('0x5b')],'actionIncomplete':_0x446f77['result'][_0xc2e4('0x5c')],'speech':_0x446f77[_0xc2e4('0x58')][_0xc2e4('0x5d')][_0xc2e4('0x5e')],'score':_0x446f77[_0xc2e4('0x58')][_0xc2e4('0x5f')],'statusCode':_0x446f77[_0xc2e4('0x60')][_0xc2e4('0x61')],'endConversation':_0x446f77[_0xc2e4('0x58')][_0xc2e4('0x62')][_0xc2e4('0x63')]||![],'isFallbackIntent':_0x446f77[_0xc2e4('0x58')][_0xc2e4('0x62')][_0xc2e4('0x64')]};});};exports['googleDialogflowV2']=function(_0x39cb4d,_0x287542,_0x5ef63a,_0x9223a8,_0x4df49b,_0x500641){var _0x54542b=_0x9223a8[_0xc2e4('0x65')](/\\n/g,'\x0a');var _0x194c6f={'credentials':{'private_key':_0x54542b,'client_email':_0x5ef63a}};var _0x367562=new dialogflow['SessionsClient'](_0x194c6f);var _0x7f45b0=_0x367562[_0xc2e4('0x66')](_0x287542,md5(_0x39cb4d));var _0xbbe485={'session':_0x7f45b0,'queryInput':{'text':{'text':_0x4df49b,'languageCode':_0x500641}}};return _0x367562['detectIntent'](_0xbbe485)['then'](function(_0x14d507){if(_0x14d507&&_0x14d507[_0xc2e4('0x43')]){logger['info'](_0xc2e4('0x67'),JSON[_0xc2e4('0x3d')](_0x14d507));var _0x50e7c5=_0x14d507[0x0];if(_0x50e7c5){var _0xebc9bc={'action':_0x50e7c5[_0xc2e4('0x68')][_0xc2e4('0x5b')],'allRequiredParamsPresent':_0x50e7c5['queryResult']['allRequiredParamsPresent'],'endConversation':_0x50e7c5[_0xc2e4('0x68')][_0xc2e4('0x69')]&&_0x50e7c5[_0xc2e4('0x68')][_0xc2e4('0x69')][_0xc2e4('0x6a')]?_0x50e7c5[_0xc2e4('0x68')][_0xc2e4('0x69')][_0xc2e4('0x6a')][_0xc2e4('0x6b')][_0xc2e4('0x6c')]:![],'fulfillmentText':_0x50e7c5['queryResult'][_0xc2e4('0x6d')],'intentName':_0x50e7c5[_0xc2e4('0x68')][_0xc2e4('0x6e')][_0xc2e4('0x54')],'intentDisplayName':_0x50e7c5[_0xc2e4('0x68')][_0xc2e4('0x6e')][_0xc2e4('0x6f')],'isFallbackIntent':_0x50e7c5[_0xc2e4('0x68')][_0xc2e4('0x6e')][_0xc2e4('0x70')],'languageCode':_0x50e7c5[_0xc2e4('0x68')][_0xc2e4('0x71')],'queryText':_0x50e7c5['queryResult']['queryText'],'responseId':_0x50e7c5[_0xc2e4('0x72')],'score':_0x50e7c5['queryResult'][_0xc2e4('0x73')],'speech':_0x50e7c5['queryResult'][_0xc2e4('0x6d')],'providerResponse':JSON['stringify'](_0x14d507)};return _0xebc9bc;}}});};exports[_0xc2e4('0x74')]=function(_0x54d5a8,_0x2b11a6,_0x46360a,_0x383a34){return tilde[_0xc2e4('0x75')](_0x54d5a8,_0x2b11a6,_0x46360a,_0x383a34)[_0xc2e4('0x27')](function(_0x29b4b2){try{fs[_0xc2e4('0x1a')](_0x54d5a8);}catch(_0x31e6b0){logger[_0xc2e4('0x13')](_0x31e6b0);}logger[_0xc2e4('0x18')]('Tilde\x20ASR\x20transcription',_0x29b4b2[_0xc2e4('0x4d')]);logger[_0xc2e4('0x18')](_0xc2e4('0x76'),_0x29b4b2[_0xc2e4('0x4f')]);return _0x29b4b2;});};exports['awsPolly']=function(_0x481d29,_0x239e01,_0x4cd4cf,_0x596ce0,_0x4a75b0,_0x5b32dd){var _0x295218=path['resolve'](__dirname,_0xc2e4('0x24'),rs['generate'](0x4)+'.mp3');var _0xf251a0;return aws['polly'](_0x481d29,_0x239e01,_0x4cd4cf,_0x596ce0,_0x4a75b0,_0x5b32dd,_0x295218)[_0xc2e4('0x27')](function(){_0xf251a0=path['resolve'](__dirname,_0xc2e4('0x24'),rs[_0xc2e4('0x25')](0x4)+_0xc2e4('0x35'));return convertFile(_0x295218,_0xf251a0);})['then'](function(){try{fs[_0xc2e4('0x1a')](_0x295218);fs['chmodSync'](_0xf251a0,'777');}catch(_0x4b0794){logger['error'](_0x4b0794);}return _0xf251a0['split']('.')[0x0];});};exports[_0xc2e4('0x77')]=function(_0x46389e,_0x64e652,_0x1163fe,_0x586c94,_0x50205f,_0xadc219){return aws[_0xc2e4('0x78')](_0x46389e,_0x64e652,_0x1163fe,_0x586c94,_0x50205f,_0xadc219)[_0xc2e4('0x27')](function(_0x3b9b72){logger[_0xc2e4('0x18')](JSON[_0xc2e4('0x3d')](_0x3b9b72));return _0x3b9b72;});};exports[_0xc2e4('0x79')]=function(_0x4aa249,_0x41433c,_0x5f3c4c,_0x24cec8){var _0x3756f2=util[_0xc2e4('0x7a')](_0xc2e4('0x7b'),ISPEECH_API,_0x4aa249,encodeURIComponent(_0x41433c),_0x5f3c4c,_0x24cec8);var _0x138235=path['resolve'](__dirname,_0xc2e4('0x24'),rs[_0xc2e4('0x25')](0x4)+_0xc2e4('0x32'));var _0x505066;return downloadFile(_0x3756f2,_0x138235)[_0xc2e4('0x27')](function(){_0x505066=path[_0xc2e4('0x23')](__dirname,_0xc2e4('0x24'),rs[_0xc2e4('0x25')](0x4)+_0xc2e4('0x35'));return convertFile(_0x138235,_0x505066);})[_0xc2e4('0x27')](function(){try{fs[_0xc2e4('0x1a')](_0x138235);fs['chmodSync'](_0x505066,_0xc2e4('0x36'));}catch(_0x35e5a6){logger[_0xc2e4('0x13')](_0x35e5a6);}return _0x505066['split']('.')[0x0];});};exports[_0xc2e4('0x7c')]=function(_0x9e5952,_0x24c9c7,_0x4780be,_0x51ac75){var _0x7b86cb=util[_0xc2e4('0x7a')](_0xc2e4('0x7d'),ISPEECH_API,_0x24c9c7,_0x4780be,base64Encode(_0x9e5952),_0x51ac75?util['format'](_0xc2e4('0x7e'),encodeURIComponent(_0x51ac75)):_0xc2e4('0x7f'));return uploadFile(_0x7b86cb)[_0xc2e4('0x27')](function(_0x27855a){return querystring[_0xc2e4('0x8')](_0x27855a);});};exports[_0xc2e4('0x80')]=function(_0x1c6878,_0x4dd468){return sestek[_0xc2e4('0x81')](_0x1c6878,_0x4dd468)[_0xc2e4('0x27')](function(_0x24cb90){logger[_0xc2e4('0x18')](JSON[_0xc2e4('0x3d')](_0x24cb90));var _0x164981={'speech':_0x24cb90[_0xc2e4('0x82')],'action':_0x24cb90[_0xc2e4('0x83')]?_0x24cb90['channelData'][_0xc2e4('0x84')]:undefined,'actiondata':_0x24cb90[_0xc2e4('0x83')]?_0x24cb90[_0xc2e4('0x83')][_0xc2e4('0x85')]:undefined};if(_0x24cb90[_0xc2e4('0x83')]&&_0x24cb90[_0xc2e4('0x83')][_0xc2e4('0x86')]){return base64Decode(_0x24cb90[_0xc2e4('0x83')][_0xc2e4('0x86')][_0xc2e4('0x87')],path[_0xc2e4('0x23')](__dirname,_0xc2e4('0x24'),rs[_0xc2e4('0x25')](0x4)+_0xc2e4('0x35')))[_0xc2e4('0x27')](function(_0x37f287){_0x164981['audiofile']=_0x37f287;return _0x164981;});}return _0x164981;});};exports[_0xc2e4('0x88')]=function(){return __dirname;}; \ No newline at end of file +var _0x8b91=['./tilde','../../../config/logger','agi','protocol','https:','host','path','WHAT_EVER','error','request\x20to\x20','statusCode','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','end','get','data','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','then','chmodSync','777','readFileSync','?key=','input','voice','audioConfig','MP3','text:synthesize','.mp3','from','writeFile','googleCloudTTS\x20path','split','googleTTS','utf8','POST','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','lang\x20\x22','googleASR','asr','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','md5','request-promise','randomstring','sox','google-tts-api','url','parse','./aws','./google','./sestek'];(function(_0x2861bb,_0x43826b){var _0x204145=function(_0xaf0730){while(--_0xaf0730){_0x2861bb['push'](_0x2861bb['shift']());}};_0x204145(++_0x43826b);}(_0x8b91,0x102));var _0x18b9=function(_0x15c168,_0x637939){_0x15c168=_0x15c168-0x0;var _0x217d1e=_0x8b91[_0x15c168];return _0x217d1e;};'use strict';var apiai=require(_0x18b9('0x0'));var BPromise=require(_0x18b9('0x1'));var dialogflow=require(_0x18b9('0x2'));var fs=require('fs');var http=require(_0x18b9('0x3'));var https=require('https');var md5=require(_0x18b9('0x4'));var path=require('path');var querystring=require('querystring');var rp=require(_0x18b9('0x5'));var rs=require(_0x18b9('0x6'));var sox=require(_0x18b9('0x7'));var tts=require(_0x18b9('0x8'));var urlParse=require(_0x18b9('0x9'))[_0x18b9('0xa')];var util=require('util');var aws=require(_0x18b9('0xb'));var google=require(_0x18b9('0xc'));var sestek=require(_0x18b9('0xd'));var tilde=require(_0x18b9('0xe'));var logger=require(_0x18b9('0xf'))(_0x18b9('0x10'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x2e48d4,_0x1a930c){return new BPromise(function(_0x4eddec,_0x433da6){var _0xab7793=urlParse(_0x2e48d4);var _0x5433d7=_0xab7793[_0x18b9('0x11')]===_0x18b9('0x12')?https:http;var _0x58de05={'host':_0xab7793[_0x18b9('0x13')],'path':_0xab7793[_0x18b9('0x14')],'headers':{'user-agent':_0x18b9('0x15')}};_0x5433d7['get'](_0x58de05,function(_0x132adf){if(_0x132adf['statusCode']!==0xc8){logger[_0x18b9('0x16')](_0x18b9('0x17')+_0x2e48d4+'\x20failed,\x20status\x20code\x20=\x20'+_0x132adf[_0x18b9('0x18')]+'\x20('+_0x132adf[_0x18b9('0x19')]+')');_0x433da6(new Error('request\x20to\x20'+_0x2e48d4+_0x18b9('0x1a')+_0x132adf['statusCode']+'\x20('+_0x132adf['statusMessage']+')'));return;}var _0x533673=fs[_0x18b9('0x1b')](_0x1a930c);_0x533673['on'](_0x18b9('0x1c'),function(){logger['info'](_0x18b9('0x1d'));_0x533673[_0x18b9('0x1e')](_0x4eddec);});_0x533673['on'](_0x18b9('0x16'),function(_0x3abe2d){fs[_0x18b9('0x1f')](_0x1a930c);logger[_0x18b9('0x16')](_0x18b9('0x20'),_0x3abe2d);_0x433da6(_0x3abe2d);});_0x132adf['pipe'](_0x533673);})['on'](_0x18b9('0x16'),function(_0x37daad){logger[_0x18b9('0x16')](_0x37daad);_0x433da6(_0x37daad);})[_0x18b9('0x21')]();});}function uploadFile(_0x335e7d){return new BPromise(function(_0x3eed4c,_0x4eb8e1){var _0x3db9b7=urlParse(_0x335e7d);var _0x4b41f5=_0x3db9b7[_0x18b9('0x11')]===_0x18b9('0x12')?https:http;var _0x42198a={'host':_0x3db9b7['host'],'path':_0x3db9b7[_0x18b9('0x14')],'headers':{'user-agent':'WHAT_EVER'}};_0x4b41f5[_0x18b9('0x22')](_0x42198a,function(_0x4a71c6){if(_0x4a71c6[_0x18b9('0x18')]!==0xc8){_0x4eb8e1(new Error(_0x18b9('0x17')+_0x335e7d+'\x20failed,\x20status\x20code\x20=\x20'+_0x4a71c6['statusCode']+'\x20('+_0x4a71c6[_0x18b9('0x19')]+')'));return;}var _0x185153='';_0x4a71c6['on'](_0x18b9('0x23'),function(_0x5d97d2){_0x185153+=_0x5d97d2;});_0x4a71c6['on'](_0x18b9('0x21'),function(){_0x3eed4c(_0x185153);});})['on'](_0x18b9('0x16'),function(_0x3fbbdb){_0x4eb8e1(_0x3fbbdb);})[_0x18b9('0x21')]();});}function convertFile(_0xc5b0fb,_0x38c727){return new BPromise(function(_0x33e083,_0x55ef2e){var _0x1df63f=sox[_0x18b9('0x24')](_0xc5b0fb,_0x38c727,{'sampleRate':0x1f40,'format':_0x18b9('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1df63f['on'](_0x18b9('0x16'),function(_0x29fbe5){logger[_0x18b9('0x16')](_0x18b9('0x26'),_0x29fbe5);_0x55ef2e(_0x29fbe5);});_0x1df63f['on'](_0x18b9('0x21'),function(){logger[_0x18b9('0x27')](_0x18b9('0x28'));_0x33e083();});_0x1df63f[_0x18b9('0x29')]();});}function base64Decode(_0x32a979,_0x201f34){var _0x3aa0b0=path[_0x18b9('0x2a')](__dirname,_0x18b9('0x2b'),rs[_0x18b9('0x2c')](0x4)+_0x18b9('0x2d'));fs[_0x18b9('0x2e')](_0x3aa0b0,_0x32a979,'base64');return convertFile(_0x3aa0b0,_0x201f34)[_0x18b9('0x2f')](function(){try{fs['unlink'](_0x3aa0b0);fs[_0x18b9('0x30')](_0x201f34,_0x18b9('0x31'));}catch(_0x1750ab){logger['error'](_0x1750ab);}return _0x201f34['split']('.')[0x0];});}function base64Encode(_0x497371){var _0x9bf70c=fs[_0x18b9('0x32')](_0x497371);return new Buffer(_0x9bf70c)['toString']('base64');}exports['googleCloudTTS']=function(_0x51f495,_0x34c009,_0x4f9146,_0x75367c,_0x5875a6,_0x1e0310){var _0xec894d,_0x5d1ff3;var _0x4eb76d='https://texttospeech.googleapis.com/v1/';var _0x1864a3=_0x18b9('0x33')+_0x51f495;var _0x4af0e0={};if(_0x34c009==='ssml'){_0x4af0e0[_0x18b9('0x34')]={'ssml':_0x4f9146};}else{_0x4af0e0[_0x18b9('0x34')]={'text':_0x4f9146};};_0x4af0e0[_0x18b9('0x35')]={'languageCode':_0x75367c,'ssmlGender':_0x5875a6};_0x4af0e0[_0x18b9('0x36')]={'audioEncoding':_0x18b9('0x37'),'sampleRateHertz':0x1f40};var _0x10d195={'url':_0x4eb76d+_0x18b9('0x38')+_0x1864a3,'method':'POST','json':!![],'body':_0x4af0e0};return rp(_0x10d195)[_0x18b9('0x2f')](function(_0x554156){return new BPromise(function(_0x4e0684,_0x289ffd){_0xec894d=path['resolve'](__dirname,'tmp',rs[_0x18b9('0x2c')](0x4)+_0x18b9('0x39'));var _0x50a6d8=Buffer[_0x18b9('0x3a')](_0x554156['audioContent'],'base64');return fs[_0x18b9('0x3b')](_0xec894d,_0x50a6d8,function(_0x11cd51){_0x289ffd(_0x11cd51);},function(_0x4645c8){fs['chmodSync'](_0xec894d,_0x18b9('0x31'));_0x4e0684(_0x4645c8);});});})['then'](function(_0x11d327){_0x5d1ff3=path[_0x18b9('0x2a')](__dirname,_0x18b9('0x2b'),rs[_0x18b9('0x2c')](0x4)+_0x18b9('0x2d'));return convertFile(_0xec894d,_0x5d1ff3);})[_0x18b9('0x2f')](function(){try{fs[_0x18b9('0x1f')](_0xec894d);fs['chmodSync'](_0x5d1ff3,'777');}catch(_0x164cf5){logger['error'](_0x164cf5);}logger[_0x18b9('0x27')](_0x18b9('0x3c'),_0x5d1ff3[_0x18b9('0x3d')]('.')[0x0]);return _0x5d1ff3[_0x18b9('0x3d')]('.')[0x0];});};exports[_0x18b9('0x3e')]=function(_0x21e7e0,_0x294e56){var _0x2aeb35='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x5656b3,_0x247512;var _0x47ed7e;var _0x4a7951={'encoding':_0x18b9('0x3f'),'method':_0x18b9('0x40'),'timeout':0x2710,'url':_0x2aeb35,'headers':{'Content-Type':_0x18b9('0x41')},'body':_0x18b9('0x42')+encodeURIComponent(JSON[_0x18b9('0x43')]([[[_0x18b9('0x44'),JSON[_0x18b9('0x43')]([_0x21e7e0,_0x294e56||'en',![],_0x18b9('0x45')]),null,'generic']]]))};return rp(_0x4a7951)['then'](function(_0x4b5249){try{_0x47ed7e=eval(_0x4b5249['slice'](0x5))[0x0][0x2];}catch(_0x463b14){throw new Error('parse\x20response\x20failed:\x0a'+_0x4b5249[_0x18b9('0x23')]);}if(!_0x47ed7e){if(_0x21e7e0['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x18b9('0x46')+_0x294e56+'\x22\x20might\x20not\x20exist');}}try{_0x47ed7e=eval(_0x47ed7e)[0x0];}catch(_0x2e2a8f){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x18b9('0x23')]);}const _0x117072=_0x47ed7e;_0x5656b3=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x18b9('0x39'));fs[_0x18b9('0x2e')](_0x5656b3,_0x47ed7e,{'encoding':'base64'});_0x247512=path[_0x18b9('0x2a')](__dirname,_0x18b9('0x2b'),rs['generate'](0x4)+_0x18b9('0x2d'));return convertFile(_0x5656b3,_0x247512);})['then'](function(){try{fs[_0x18b9('0x1f')](_0x5656b3);fs[_0x18b9('0x30')](_0x247512,_0x18b9('0x31'));}catch(_0x38e12b){logger[_0x18b9('0x16')](_0x38e12b);}logger[_0x18b9('0x27')]('goggleTTS\x20path',_0x247512[_0x18b9('0x3d')]('.')[0x0]);return _0x247512[_0x18b9('0x3d')]('.')[0x0];});};exports[_0x18b9('0x47')]=function(_0x42876b,_0x2b614b,_0x834bce){return google[_0x18b9('0x48')](_0x42876b,_0x2b614b,_0x834bce)['then'](function(_0x1e003c){logger[_0x18b9('0x27')](_0x1e003c['uri']);return rp(_0x1e003c);})['then'](function(_0x2ec069){var _0x3ddd8f='';var _0x427a39=0x0;try{fs[_0x18b9('0x1f')](_0x42876b);}catch(_0x5a96d0){logger[_0x18b9('0x16')](_0x5a96d0);}if(_0x2ec069&&_0x2ec069['results']){_0x3ddd8f=_0x2ec069[_0x18b9('0x49')][_0x18b9('0x4a')](function(_0x1a9834){return _0x1a9834&&_0x1a9834[_0x18b9('0x4b')][0x0]&&_0x1a9834[_0x18b9('0x4b')][0x0][_0x18b9('0x4c')]?_0x1a9834[_0x18b9('0x4b')][0x0][_0x18b9('0x4c')]:'';})['join']('\x0a');_0x427a39=_0x2ec069[_0x18b9('0x49')][_0x18b9('0x4a')](function(_0x1cfe18){return _0x1cfe18&&_0x1cfe18[_0x18b9('0x4b')][0x0]&&_0x1cfe18[_0x18b9('0x4b')][0x0][_0x18b9('0x4d')]?_0x1cfe18['alternatives'][0x0][_0x18b9('0x4d')]:0x0;})[_0x18b9('0x4e')]('\x0a');}logger[_0x18b9('0x27')](_0x18b9('0x4f'),_0x3ddd8f);logger[_0x18b9('0x27')]('googleASR\x20confidence',_0x427a39);return{'transcript':_0x3ddd8f,'confidence':_0x427a39};})[_0x18b9('0x50')](function(_0x1f7296){logger[_0x18b9('0x16')](_0x18b9('0x51'),_0x1f7296['statusCode'],_0x1f7296[_0x18b9('0x52')],_0x1f7296[_0x18b9('0x53')]);});};exports['googleDialogflow']=function(_0x5d63ba,_0x167f5a,_0x507642,_0x432cd6){var _0x13aa84=apiai(_0x167f5a,{'language':_0x432cd6||'en'});return _0x13aa84[_0x18b9('0x54')](_0x507642,{'sessionId':md5(_0x5d63ba)})[_0x18b9('0x2f')](function(_0x4f2f40){logger['info'](JSON['stringify'](_0x4f2f40));return{'source':_0x4f2f40[_0x18b9('0x55')][_0x18b9('0x56')],'resolvedQuery':_0x4f2f40[_0x18b9('0x55')][_0x18b9('0x57')],'action':_0x4f2f40[_0x18b9('0x55')]['action'],'actionIncomplete':_0x4f2f40[_0x18b9('0x55')][_0x18b9('0x58')],'speech':_0x4f2f40['result'][_0x18b9('0x59')][_0x18b9('0x5a')],'score':_0x4f2f40[_0x18b9('0x55')][_0x18b9('0x5b')],'statusCode':_0x4f2f40[_0x18b9('0x5c')]['code'],'endConversation':_0x4f2f40[_0x18b9('0x55')][_0x18b9('0x5d')][_0x18b9('0x5e')]||![],'isFallbackIntent':_0x4f2f40[_0x18b9('0x55')][_0x18b9('0x5d')]['isFallbackIntent']};});};exports[_0x18b9('0x5f')]=function(_0x4ed600,_0x5f016e,_0x4bdd6d,_0x1feafb,_0x27aa57,_0x587cb6){var _0x74ca=_0x1feafb[_0x18b9('0x60')](/\\n/g,'\x0a');var _0xccf58f={'credentials':{'private_key':_0x74ca,'client_email':_0x4bdd6d}};var _0x2b45f3=new dialogflow[(_0x18b9('0x61'))](_0xccf58f);var _0x5cca14=_0x2b45f3[_0x18b9('0x62')](_0x5f016e,md5(_0x4ed600));var _0x1bbc1e={'session':_0x5cca14,'queryInput':{'text':{'text':_0x27aa57,'languageCode':_0x587cb6}}};return _0x2b45f3[_0x18b9('0x63')](_0x1bbc1e)[_0x18b9('0x2f')](function(_0x15903d){if(_0x15903d&&_0x15903d[_0x18b9('0x64')]){logger[_0x18b9('0x27')](_0x18b9('0x65'),JSON[_0x18b9('0x43')](_0x15903d));var _0x58f2c7=_0x15903d[0x0];if(_0x58f2c7){var _0x36d928={'action':_0x58f2c7[_0x18b9('0x66')][_0x18b9('0x67')],'allRequiredParamsPresent':_0x58f2c7[_0x18b9('0x66')][_0x18b9('0x68')],'endConversation':_0x58f2c7[_0x18b9('0x66')]['diagnosticInfo']&&_0x58f2c7[_0x18b9('0x66')][_0x18b9('0x69')][_0x18b9('0x6a')]?_0x58f2c7['queryResult']['diagnosticInfo'][_0x18b9('0x6a')][_0x18b9('0x6b')][_0x18b9('0x6c')]:![],'fulfillmentText':_0x58f2c7[_0x18b9('0x66')][_0x18b9('0x6d')],'intentName':_0x58f2c7[_0x18b9('0x66')]['intent'][_0x18b9('0x52')],'intentDisplayName':_0x58f2c7[_0x18b9('0x66')][_0x18b9('0x6e')][_0x18b9('0x6f')],'isFallbackIntent':_0x58f2c7[_0x18b9('0x66')]['intent'][_0x18b9('0x70')],'languageCode':_0x58f2c7[_0x18b9('0x66')][_0x18b9('0x71')],'queryText':_0x58f2c7[_0x18b9('0x66')][_0x18b9('0x72')],'responseId':_0x58f2c7[_0x18b9('0x73')],'score':_0x58f2c7['queryResult'][_0x18b9('0x74')],'speech':_0x58f2c7['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x18b9('0x43')](_0x15903d)};return _0x36d928;}}});};exports['tildeASR']=function(_0x426128,_0x505738,_0x539958,_0x234015){return tilde[_0x18b9('0x48')](_0x426128,_0x505738,_0x539958,_0x234015)['then'](function(_0x246dac){try{fs[_0x18b9('0x1f')](_0x426128);}catch(_0x26d6a3){logger[_0x18b9('0x16')](_0x26d6a3);}logger[_0x18b9('0x27')](_0x18b9('0x75'),_0x246dac[_0x18b9('0x4c')]);logger['info'](_0x18b9('0x76'),_0x246dac[_0x18b9('0x4d')]);return _0x246dac;});};exports['awsPolly']=function(_0x54235c,_0x3c9ca6,_0x4586a0,_0x2bd46d,_0x4ee1fb,_0x3a1102){var _0x4efc8e=path['resolve'](__dirname,_0x18b9('0x2b'),rs['generate'](0x4)+_0x18b9('0x39'));var _0x2cac07;return aws['polly'](_0x54235c,_0x3c9ca6,_0x4586a0,_0x2bd46d,_0x4ee1fb,_0x3a1102,_0x4efc8e)[_0x18b9('0x2f')](function(){_0x2cac07=path['resolve'](__dirname,_0x18b9('0x2b'),rs['generate'](0x4)+_0x18b9('0x2d'));return convertFile(_0x4efc8e,_0x2cac07);})[_0x18b9('0x2f')](function(){try{fs[_0x18b9('0x1f')](_0x4efc8e);fs[_0x18b9('0x30')](_0x2cac07,_0x18b9('0x31'));}catch(_0x515547){logger['error'](_0x515547);}return _0x2cac07[_0x18b9('0x3d')]('.')[0x0];});};exports[_0x18b9('0x77')]=function(_0x1e6f28,_0x4fef1d,_0x55d8a3,_0x483473,_0x4b427c,_0x5d7885){return aws[_0x18b9('0x78')](_0x1e6f28,_0x4fef1d,_0x55d8a3,_0x483473,_0x4b427c,_0x5d7885)['then'](function(_0x13b8d0){logger['info'](JSON[_0x18b9('0x43')](_0x13b8d0));return _0x13b8d0;});};exports['ispeechTTS']=function(_0x437049,_0x4f2cf7,_0x229fe3,_0x33737d){var _0x5e4e89=util[_0x18b9('0x79')](_0x18b9('0x7a'),ISPEECH_API,_0x437049,encodeURIComponent(_0x4f2cf7),_0x229fe3,_0x33737d);var _0xb589cf=path[_0x18b9('0x2a')](__dirname,_0x18b9('0x2b'),rs['generate'](0x4)+'.mp3');var _0x3d32c5;return downloadFile(_0x5e4e89,_0xb589cf)['then'](function(){_0x3d32c5=path[_0x18b9('0x2a')](__dirname,_0x18b9('0x2b'),rs[_0x18b9('0x2c')](0x4)+'.wav');return convertFile(_0xb589cf,_0x3d32c5);})['then'](function(){try{fs[_0x18b9('0x1f')](_0xb589cf);fs[_0x18b9('0x30')](_0x3d32c5,_0x18b9('0x31'));}catch(_0x5f19e1){logger[_0x18b9('0x16')](_0x5f19e1);}return _0x3d32c5['split']('.')[0x0];});};exports[_0x18b9('0x7b')]=function(_0x149d21,_0x917e08,_0x575c26,_0x31510f){var _0x14f2cf=util[_0x18b9('0x79')](_0x18b9('0x7c'),ISPEECH_API,_0x917e08,_0x575c26,base64Encode(_0x149d21),_0x31510f?util[_0x18b9('0x79')](_0x18b9('0x7d'),encodeURIComponent(_0x31510f)):'freeform=3');return uploadFile(_0x14f2cf)['then'](function(_0x55ba6f){return querystring[_0x18b9('0xa')](_0x55ba6f);});};exports[_0x18b9('0x7e')]=function(_0x36a323,_0x3c079a){return sestek[_0x18b9('0x7f')](_0x36a323,_0x3c079a)[_0x18b9('0x2f')](function(_0x72453a){logger['info'](JSON[_0x18b9('0x43')](_0x72453a));var _0x2c7b09={'speech':_0x72453a[_0x18b9('0x80')],'action':_0x72453a[_0x18b9('0x81')]?_0x72453a[_0x18b9('0x81')][_0x18b9('0x82')]:undefined,'actiondata':_0x72453a[_0x18b9('0x81')]?_0x72453a[_0x18b9('0x81')][_0x18b9('0x83')]:undefined};if(_0x72453a[_0x18b9('0x81')]&&_0x72453a[_0x18b9('0x81')][_0x18b9('0x84')]){return base64Decode(_0x72453a['channelData'][_0x18b9('0x84')][_0x18b9('0x85')],path[_0x18b9('0x2a')](__dirname,_0x18b9('0x2b'),rs[_0x18b9('0x2c')](0x4)+_0x18b9('0x2d')))[_0x18b9('0x2f')](function(_0x17a8c5){_0x2c7b09[_0x18b9('0x86')]=_0x17a8c5;return _0x2c7b09;});}return _0x2c7b09;});};exports[_0x18b9('0x87')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 9eee657..295fe04 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 _0x78d6=['exports','./nda'];(function(_0x4f3ab0,_0x496741){var _0x385641=function(_0x58c43d){while(--_0x58c43d){_0x4f3ab0['push'](_0x4f3ab0['shift']());}};_0x385641(++_0x496741);}(_0x78d6,0x13d));var _0x678d=function(_0x18d862,_0x1c7bd8){_0x18d862=_0x18d862-0x0;var _0x27489d=_0x78d6[_0x18d862];return _0x27489d;};var nda=require(_0x678d('0x0'));module[_0x678d('0x1')]={'nda':nda}; \ No newline at end of file +var _0xd4c2=['exports','./nda'];(function(_0x19d57e,_0x47c3ed){var _0x355c60=function(_0x9a130f){while(--_0x9a130f){_0x19d57e['push'](_0x19d57e['shift']());}};_0x355c60(++_0x47c3ed);}(_0xd4c2,0x15d));var _0x2d4c=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xd4c2[_0x4a53d];return _0x27410e;};var nda=require(_0x2d4c('0x0'));module[_0x2d4c('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 705a2c1..69b0124 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 _0x85b5=['callerid','calleridname','extension','Bearer\x20','project','body','channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','request-promise','url','agi','POST','ndauth_url','/token','password','resolve','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid'];(function(_0x4b9cfc,_0x4a561a){var _0x419e90=function(_0x432649){while(--_0x432649){_0x4b9cfc['push'](_0x4b9cfc['shift']());}};_0x419e90(++_0x4a561a);}(_0x85b5,0x7f));var _0x585b=function(_0x260472,_0x340634){_0x260472=_0x260472-0x0;var _0x2fbb6d=_0x85b5[_0x260472];return _0x2fbb6d;};'use strict';var rp=require(_0x585b('0x0'));var url=require(_0x585b('0x1'));var logger=require('../../../../../config/logger')(_0x585b('0x2'));module['exports']=function(_0x18ab39,_0x5a7ff0){var _0x4d5064={'method':_0x585b('0x3'),'uri':url['resolve'](_0x5a7ff0[_0x585b('0x4')],_0x585b('0x5')),'form':{'grant_type':_0x585b('0x6'),'username':_0x5a7ff0['username'],'password':_0x5a7ff0[_0x585b('0x6')]},'json':!![]};return rp(_0x4d5064)['then'](function(_0x432e2d){var _0x2f8895={'method':_0x585b('0x3'),'uri':url[_0x585b('0x7')](_0x5a7ff0['ndassistant_url'],_0x585b('0x8')),'body':{'type':_0x5a7ff0[_0x585b('0x9')]||_0x585b('0xa'),'channelId':_0x585b('0xb'),'conversation':{'id':_0x18ab39[_0x585b('0xc')]},'from':{'id':_0x18ab39[_0x585b('0xd')],'name':_0x18ab39[_0x585b('0xe')]},'recipient':{'id':_0x18ab39['dnid'],'name':_0x18ab39[_0x585b('0xf')]},'text':_0x5a7ff0['text'],'channelData':{}},'headers':{'Authorization':_0x585b('0x10')+_0x432e2d['access_token']},'json':!![]};if(_0x5a7ff0[_0x585b('0x11')]){_0x2f8895[_0x585b('0x12')][_0x585b('0x13')]['ProjectName']=_0x5a7ff0[_0x585b('0x11')];}if(_0x5a7ff0[_0x585b('0x14')]=='1'){_0x2f8895[_0x585b('0x12')][_0x585b('0x13')][_0x585b('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x585b('0x16')};}if(_0x5a7ff0[_0x585b('0x17')]){_0x2f8895['body'][_0x585b('0x13')][_0x585b('0x18')]=_0x5a7ff0['custom_action'];if(_0x5a7ff0['custom_action_data']){_0x2f8895[_0x585b('0x12')]['channelData']['CustomActionData']=_0x5a7ff0[_0x585b('0x19')];}}logger[_0x585b('0x1a')](JSON[_0x585b('0x1b')](_0x2f8895));return rp(_0x2f8895);});}; \ No newline at end of file +var _0x85de=['request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','password','username','then','POST','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','calleridname','extension','Bearer\x20','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','stringify'];(function(_0x27f390,_0x1d5ade){var _0x3274ff=function(_0x5f2c99){while(--_0x5f2c99){_0x27f390['push'](_0x27f390['shift']());}};_0x3274ff(++_0x1d5ade);}(_0x85de,0x1f0));var _0xe85d=function(_0xa7d8c3,_0x46ff3a){_0xa7d8c3=_0xa7d8c3-0x0;var _0xb38061=_0x85de[_0xa7d8c3];return _0xb38061;};'use strict';var rp=require(_0xe85d('0x0'));var url=require(_0xe85d('0x1'));var logger=require(_0xe85d('0x2'))(_0xe85d('0x3'));module[_0xe85d('0x4')]=function(_0x57970c,_0x3e4fb5){var _0x559802={'method':'POST','uri':url[_0xe85d('0x5')](_0x3e4fb5[_0xe85d('0x6')],'/token'),'form':{'grant_type':_0xe85d('0x7'),'username':_0x3e4fb5[_0xe85d('0x8')],'password':_0x3e4fb5[_0xe85d('0x7')]},'json':!![]};return rp(_0x559802)[_0xe85d('0x9')](function(_0x4608f4){var _0x888738={'method':_0xe85d('0xa'),'uri':url[_0xe85d('0x5')](_0x3e4fb5['ndassistant_url'],_0xe85d('0xb')),'body':{'type':_0x3e4fb5[_0xe85d('0xc')]||_0xe85d('0xd'),'channelId':_0xe85d('0xe'),'conversation':{'id':_0x57970c[_0xe85d('0xf')]},'from':{'id':_0x57970c['callerid'],'name':_0x57970c[_0xe85d('0x10')]},'recipient':{'id':_0x57970c['dnid'],'name':_0x57970c[_0xe85d('0x11')]},'text':_0x3e4fb5['text'],'channelData':{}},'headers':{'Authorization':_0xe85d('0x12')+_0x4608f4['access_token']},'json':!![]};if(_0x3e4fb5[_0xe85d('0x13')]){_0x888738[_0xe85d('0x14')][_0xe85d('0x15')][_0xe85d('0x16')]=_0x3e4fb5[_0xe85d('0x13')];}if(_0x3e4fb5[_0xe85d('0x17')]=='1'){_0x888738[_0xe85d('0x14')]['channelData'][_0xe85d('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe85d('0x19')};}if(_0x3e4fb5['custom_action']){_0x888738[_0xe85d('0x14')][_0xe85d('0x15')][_0xe85d('0x1a')]=_0x3e4fb5[_0xe85d('0x1b')];if(_0x3e4fb5[_0xe85d('0x1c')]){_0x888738[_0xe85d('0x14')][_0xe85d('0x15')][_0xe85d('0x1d')]=_0x3e4fb5[_0xe85d('0x1c')];}}logger['info'](JSON[_0xe85d('0x1e')](_0x888738));return rp(_0x888738);});}; \ 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 1966c47..ad0a689 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 _0x1b78=['exports'];(function(_0x5beeeb,_0x1e93f8){var _0x595f77=function(_0x281a87){while(--_0x281a87){_0x5beeeb['push'](_0x5beeeb['shift']());}};_0x595f77(++_0x1e93f8);}(_0x1b78,0x1bc));var _0x81b7=function(_0x3083f3,_0x4c1e0c){_0x3083f3=_0x3083f3-0x0;var _0x5cd0d5=_0x1b78[_0x3083f3];return _0x5cd0d5;};'use strict';var asr=require('./lib/api');module[_0x81b7('0x0')]=function(_0x2cf724,_0x1bf366,_0x3c15a9,_0x39d425){return asr(_0x2cf724,_0x1bf366,_0x3c15a9,_0x39d425);}; \ No newline at end of file +var _0x6031=['./lib/api','exports'];(function(_0x472276,_0xa37f3b){var _0xdd2b80=function(_0x57455f){while(--_0x57455f){_0x472276['push'](_0x472276['shift']());}};_0xdd2b80(++_0xa37f3b);}(_0x6031,0x9a));var _0x1603=function(_0x11067b,_0x202502){_0x11067b=_0x11067b-0x0;var _0x2ed5b3=_0x6031[_0x11067b];return _0x2ed5b3;};'use strict';var asr=require(_0x1603('0x0'));module[_0x1603('0x1')]=function(_0x62c3ae,_0x2541b4,_0x3642ee,_0xcecc04){return asr(_0x62c3ae,_0x2541b4,_0x3642ee,_0xcecc04);}; \ 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 0d5c547..0aa5c50 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 _0xac79=['hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','message','bluebird','crypto','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data','send','close','EOS','error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses'];(function(_0x26e6dc,_0x5c4058){var _0x4b5d1d=function(_0x1c02e8){while(--_0x1c02e8){_0x26e6dc['push'](_0x26e6dc['shift']());}};_0x4b5d1d(++_0x5c4058);}(_0xac79,0x1ec));var _0x9ac7=function(_0x75ab92,_0x4a90a3){_0x75ab92=_0x75ab92-0x0;var _0x4e6863=_0xac79[_0x75ab92];return _0x4e6863;};'use strict';var BPromise=require(_0x9ac7('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x9ac7('0x1'));var logger=require('../../../../../../config/logger')(_0x9ac7('0x2'));module[_0x9ac7('0x3')]=function(_0x44dcfc,_0x1bb2a2,_0x2e9043,_0x17b497){return new BPromise(function(_0x264f38,_0x445620){logger[_0x9ac7('0x4')](_0x9ac7('0x5'),_0x17b497||_0x9ac7('0x6'));var _0xf61033=new WebSocket(_0x17b497||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x2f76b6='';var _0x23bf56='0';var _0x127423='1';var _0x3423f0=_0x9ac7('0x7');function _0x166f53(_0x223d47){var _0x57b1e5=crypto[_0x9ac7('0x8')](_0x9ac7('0x9'));_0x57b1e5[_0x9ac7('0xa')](_0x223d47);return _0x57b1e5['digest'](_0x9ac7('0xb'));}function _0x3e9997(){try{logger['info'](_0x9ac7('0xc'));var _0x50b409=moment()[_0x9ac7('0xd')]();var _0x2f8464=_0x166f53(_0x50b409+_0x1bb2a2+_0x2e9043);_0xf61033['send'](JSON[_0x9ac7('0xe')]({'appID':_0x1bb2a2,'timestamp':_0x50b409,'appKey':_0x2f8464}));var _0x2e70e4=fs[_0x9ac7('0xf')](_0x44dcfc);_0x2e70e4['on'](_0x9ac7('0x10'),function(_0x5edf73){_0xf61033[_0x9ac7('0x11')](_0x5edf73);});_0x2e70e4['on'](_0x9ac7('0x12'),function(){_0xf61033['send'](_0x9ac7('0x13'));});}catch(_0x1cbf18){logger[_0x9ac7('0x14')]('Tilde\x20ASR\x20send\x20error',JSON[_0x9ac7('0xe')](_0x1cbf18));_0xf61033[_0x9ac7('0x15')]();}}function _0x4ebe59(_0x4b770a){try{if(_0x4b770a){var _0x2c5a7e=JSON[_0x9ac7('0x16')](_0x4b770a);switch(_0x2c5a7e['status']){case 0x0:if(_0x2c5a7e['result']){if(_0x2c5a7e[_0x9ac7('0x17')][_0x9ac7('0x18')]){logger[_0x9ac7('0x4')](_0x9ac7('0x19'),JSON[_0x9ac7('0xe')](_0x2c5a7e['result'][_0x9ac7('0x1a')]));_0x2f76b6=_0x2c5a7e[_0x9ac7('0x17')][_0x9ac7('0x1a')][0x0]['transcript'];_0x23bf56=_0x2c5a7e[_0x9ac7('0x17')][_0x9ac7('0x1a')][0x0][_0x9ac7('0x1b')];_0x127423='0';_0x3423f0=_0x9ac7('0x1c');_0xf61033[_0x9ac7('0x15')]();}}break;case 0x1:logger[_0x9ac7('0x4')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x127423='1';_0x3423f0=_0x9ac7('0x7');break;case 0x2:logger[_0x9ac7('0x4')](_0x9ac7('0x1d'));_0x127423='2';_0x3423f0=_0x9ac7('0x1d');break;case 0x9:logger[_0x9ac7('0x4')](_0x9ac7('0x1e'));_0x127423='9';_0x3423f0='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0x9ac7('0x1f'));_0x127423='10';_0x3423f0=_0x9ac7('0x1f');break;case 0xb:logger[_0x9ac7('0x4')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x127423='11';_0x3423f0='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x5ca6c7){logger[_0x9ac7('0x14')](_0x9ac7('0x20'),JSON[_0x9ac7('0xe')](_0x5ca6c7));_0xf61033['terminate']();}}function _0x151557(){logger[_0x9ac7('0x4')](_0x9ac7('0x21'));_0x264f38({'transcript':_0x2f76b6,'confidence':_0x23bf56,'status':_0x127423,'status_message':_0x3423f0});}function _0x1fac80(_0x2d246d){logger[_0x9ac7('0x14')](_0x9ac7('0x22'));if(!_[_0x9ac7('0x23')](_0x2d246d)){logger['error'](_['isObject'](_0x2d246d)?JSON[_0x9ac7('0xe')](_0x2d246d):_0x2d246d);}}_0xf61033['on']('open',_0x3e9997);_0xf61033['on'](_0x9ac7('0x24'),_0x4ebe59);_0xf61033['on'](_0x9ac7('0x12'),_0x151557);_0xf61033['on'](_0x9ac7('0x14'),_0x1fac80);});}; \ No newline at end of file +var _0xb3ba=['isObject','open','message','lodash','moment','crypto','../../../../../../config/logger','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data','send','close','error','Tilde\x20ASR\x20send\x20error','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','terminate','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','isNil'];(function(_0x1d2f72,_0x48523e){var _0x2d954d=function(_0xbf4006){while(--_0xbf4006){_0x1d2f72['push'](_0x1d2f72['shift']());}};_0x2d954d(++_0x48523e);}(_0xb3ba,0xb7));var _0xab3b=function(_0x54f471,_0x2e35ad){_0x54f471=_0x54f471-0x0;var _0x57ddee=_0xb3ba[_0x54f471];return _0x57ddee;};'use strict';var BPromise=require('bluebird');var _=require(_0xab3b('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xab3b('0x1'));var crypto=require(_0xab3b('0x2'));var logger=require(_0xab3b('0x3'))('agi');module['exports']=function(_0xd04db1,_0x1fae35,_0x2421a0,_0x3fa278){return new BPromise(function(_0x2f065b,_0xb0c490){logger[_0xab3b('0x4')](_0xab3b('0x5'),_0x3fa278||_0xab3b('0x6'));var _0x5d37e=new WebSocket(_0x3fa278||_0xab3b('0x6'),{'perMessageDeflate':![]});var _0x5672c1='';var _0xc03265='0';var _0x5737ab='1';var _0x5df119='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x42f937(_0x7aea83){var _0x53f969=crypto['createHash']('sha1');_0x53f969[_0xab3b('0x7')](_0x7aea83);return _0x53f969[_0xab3b('0x8')](_0xab3b('0x9'));}function _0x23cf8c(){try{logger[_0xab3b('0x4')](_0xab3b('0xa'));var _0x10d776=moment()[_0xab3b('0xb')]();var _0x4b04c6=_0x42f937(_0x10d776+_0x1fae35+_0x2421a0);_0x5d37e['send'](JSON[_0xab3b('0xc')]({'appID':_0x1fae35,'timestamp':_0x10d776,'appKey':_0x4b04c6}));var _0x1a9e13=fs[_0xab3b('0xd')](_0xd04db1);_0x1a9e13['on'](_0xab3b('0xe'),function(_0x3de77c){_0x5d37e[_0xab3b('0xf')](_0x3de77c);});_0x1a9e13['on'](_0xab3b('0x10'),function(){_0x5d37e[_0xab3b('0xf')]('EOS');});}catch(_0xf8f71){logger[_0xab3b('0x11')](_0xab3b('0x12'),JSON[_0xab3b('0xc')](_0xf8f71));_0x5d37e['terminate']();}}function _0x1431b5(_0x219d3a){try{if(_0x219d3a){var _0x3ee280=JSON[_0xab3b('0x13')](_0x219d3a);switch(_0x3ee280[_0xab3b('0x14')]){case 0x0:if(_0x3ee280[_0xab3b('0x15')]){if(_0x3ee280[_0xab3b('0x15')]['final']){logger[_0xab3b('0x4')](_0xab3b('0x16'),JSON['stringify'](_0x3ee280[_0xab3b('0x15')][_0xab3b('0x17')]));_0x5672c1=_0x3ee280[_0xab3b('0x15')][_0xab3b('0x17')][0x0][_0xab3b('0x18')];_0xc03265=_0x3ee280[_0xab3b('0x15')][_0xab3b('0x17')][0x0]['likelihood'];_0x5737ab='0';_0x5df119='Success.';_0x5d37e[_0xab3b('0x19')]();}}break;case 0x1:logger[_0xab3b('0x4')](_0xab3b('0x1a'));_0x5737ab='1';_0x5df119=_0xab3b('0x1a');break;case 0x2:logger['info'](_0xab3b('0x1b'));_0x5737ab='2';_0x5df119=_0xab3b('0x1b');break;case 0x9:logger[_0xab3b('0x4')](_0xab3b('0x1c'));_0x5737ab='9';_0x5df119='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xab3b('0x4')](_0xab3b('0x1d'));_0x5737ab='10';_0x5df119='Authentication\x20failed.';break;case 0xb:logger[_0xab3b('0x4')](_0xab3b('0x1e'));_0x5737ab='11';_0x5df119=_0xab3b('0x1e');}}}catch(_0x4e46f6){logger[_0xab3b('0x11')](_0xab3b('0x1f'),JSON['stringify'](_0x4e46f6));_0x5d37e[_0xab3b('0x19')]();}}function _0x4677be(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x2f065b({'transcript':_0x5672c1,'confidence':_0xc03265,'status':_0x5737ab,'status_message':_0x5df119});}function _0x33c5f3(_0x2b58ce){logger[_0xab3b('0x11')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xab3b('0x20')](_0x2b58ce)){logger[_0xab3b('0x11')](_[_0xab3b('0x21')](_0x2b58ce)?JSON[_0xab3b('0xc')](_0x2b58ce):_0x2b58ce);}}_0x5d37e['on'](_0xab3b('0x22'),_0x23cf8c);_0x5d37e['on'](_0xab3b('0x23'),_0x1431b5);_0x5d37e['on'](_0xab3b('0x10'),_0x4677be);_0x5d37e['on']('error',_0x33c5f3);});}; \ 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 2439862..3e826fa 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 _0x5cf9=['exports'];(function(_0x11749e,_0x5d6131){var _0x351dad=function(_0x5f3aca){while(--_0x5f3aca){_0x11749e['push'](_0x11749e['shift']());}};_0x351dad(++_0x5d6131);}(_0x5cf9,0x71));var _0x95cf=function(_0x4efce3,_0x3f63b9){_0x4efce3=_0x4efce3-0x0;var _0x4031f3=_0x5cf9[_0x4efce3];return _0x4031f3;};var asr=require('./asr');module[_0x95cf('0x0')]={'asr':asr}; \ No newline at end of file +var _0x7041=['exports'];(function(_0xcd5a3d,_0x3c5b33){var _0xd43207=function(_0x17d976){while(--_0x17d976){_0xcd5a3d['push'](_0xcd5a3d['shift']());}};_0xd43207(++_0x3c5b33);}(_0x7041,0x177));var _0x1704=function(_0x9784b0,_0x2be373){_0x9784b0=_0x9784b0-0x0;var _0x7a90ca=_0x7041[_0x9784b0];return _0x7a90ca;};var asr=require('./asr');module[_0x1704('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 7ef4492..34a4063 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 _0x12f7=['./error','./channel','call','E_AGI_ARGUMENT_PORT','emit','listening','connection','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_MAXCONNECTION','destroy','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0x12f7,0x147));var _0x712f=function(_0x14e9ca,_0x378f24){_0x14e9ca=_0x14e9ca-0x0;var _0x3814be=_0x12f7[_0x14e9ca];return _0x3814be;};'use strict';var util=require(_0x712f('0x0'));var net=require(_0x712f('0x1'));var EventEmitter=require(_0x712f('0x2'))['EventEmitter'];var AGIError=require(_0x712f('0x3'));var AGIChannel=require(_0x712f('0x4'));var AGIServer=function(_0x564dfa,_0x3e4f23,_0x115a0e){var _0x3eae86=this,_0x564dfa=_0x564dfa||0x11dd,_0x3e4f23=_0x3e4f23||'127.0.0.1',_0x53f12e=null,_0x3b2bf7=0x0;EventEmitter[_0x712f('0x5')](_0x3eae86);function _0x2ea8fb(){if(!_0x564dfa){_0x3eae86['emit']('error',new AGIError(_0x712f('0x6')));return![];}_0x53f12e=net['createServer']();_0x53f12e['listen'](_0x564dfa,_0x3e4f23);_0x53f12e['on']('listening',function(){_0x3eae86[_0x712f('0x7')](_0x712f('0x8'));});_0x53f12e['on'](_0x712f('0x9'),function(_0x25148f){_0x53f12e[_0x712f('0xa')](function(_0x5dbb8d,_0x2889fd){if(_0x5dbb8d){_0x3eae86[_0x712f('0x7')](_0x712f('0xb'),new AGIError(_0x712f('0xc'),_0x5dbb8d));}else if(_0x115a0e&&_0x115a0e<0x0){_0x3eae86[_0x712f('0x7')]('error',new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x25148f['destroy']();}else if(_0x115a0e&&_0x115a0e>0x0&&_0x115a0e<_0x2889fd){_0x3b2bf7+=0x1;_0x3eae86['emit'](_0x712f('0xb'),new AGIError(_0x712f('0xd'),_0x3b2bf7));_0x25148f[_0x712f('0xe')]();}else{var _0x409794=new AGIChannel(_0x25148f);_0x409794['on'](_0x712f('0xf'),function(){_0x3eae86[_0x712f('0x7')](_0x712f('0x9'),_0x409794);});}});});_0x53f12e['on'](_0x712f('0xb'),function(_0x1573b9){_0x3eae86[_0x712f('0x7')]('error',new AGIError(_0x712f('0xc'),_0x1573b9[_0x712f('0x10')]));});_0x53f12e['on']('close',function(){_0x3eae86['emit'](_0x712f('0x11'),new AGIError(_0x712f('0x12')));});}process[_0x712f('0x13')](function(){_0x2ea8fb();});};util[_0x712f('0x14')](AGIServer,EventEmitter);module[_0x712f('0x15')]=function(_0x5080bf,_0x9363a1,_0x378401){return new AGIServer(_0x5080bf,_0x9363a1,_0x378401);}; \ No newline at end of file +var _0x7543=['./channel','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','code','close','nextTick','inherits','util','EventEmitter'];(function(_0x33c7df,_0x1e50e9){var _0x584ec4=function(_0x55a88b){while(--_0x55a88b){_0x33c7df['push'](_0x33c7df['shift']());}};_0x584ec4(++_0x1e50e9);}(_0x7543,0x154));var _0x3754=function(_0xd41dc1,_0x24aaaa){_0xd41dc1=_0xd41dc1-0x0;var _0x14465a=_0x7543[_0xd41dc1];return _0x14465a;};'use strict';var util=require(_0x3754('0x0'));var net=require('net');var EventEmitter=require('events')[_0x3754('0x1')];var AGIError=require('./error');var AGIChannel=require(_0x3754('0x2'));var AGIServer=function(_0x2b8c3b,_0x37c3b7,_0x43a72a){var _0x5ad273=this,_0x2b8c3b=_0x2b8c3b||0x11dd,_0x37c3b7=_0x37c3b7||'127.0.0.1',_0x3b104f=null,_0x17cbff=0x0;EventEmitter[_0x3754('0x3')](_0x5ad273);function _0x170c0d(){if(!_0x2b8c3b){_0x5ad273[_0x3754('0x4')](_0x3754('0x5'),new AGIError(_0x3754('0x6')));return![];}_0x3b104f=net[_0x3754('0x7')]();_0x3b104f['listen'](_0x2b8c3b,_0x37c3b7);_0x3b104f['on'](_0x3754('0x8'),function(){_0x5ad273[_0x3754('0x4')]('listening');});_0x3b104f['on'](_0x3754('0x9'),function(_0x3a7cdc){_0x3b104f['getConnections'](function(_0x5adcc8,_0x650d22){if(_0x5adcc8){_0x5ad273[_0x3754('0x4')](_0x3754('0x5'),new AGIError(_0x3754('0xa'),_0x5adcc8));}else if(_0x43a72a&&_0x43a72a<0x0){_0x5ad273[_0x3754('0x4')](_0x3754('0x5'),new AGIError(_0x3754('0xb')));_0x3a7cdc['destroy']();}else if(_0x43a72a&&_0x43a72a>0x0&&_0x43a72a<_0x650d22){_0x17cbff+=0x1;_0x5ad273[_0x3754('0x4')](_0x3754('0x5'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x17cbff));_0x3a7cdc[_0x3754('0xc')]();}else{var _0x37bc62=new AGIChannel(_0x3a7cdc);_0x37bc62['on'](_0x3754('0xd'),function(){_0x5ad273[_0x3754('0x4')]('connection',_0x37bc62);});}});});_0x3b104f['on'](_0x3754('0x5'),function(_0x402461){_0x5ad273['emit'](_0x3754('0x5'),new AGIError('E_AGI_SERVER_ERROR',_0x402461[_0x3754('0xe')]));});_0x3b104f['on'](_0x3754('0xf'),function(){_0x5ad273[_0x3754('0x4')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x3754('0x10')](function(){_0x170c0d();});};util[_0x3754('0x11')](AGIServer,EventEmitter);module['exports']=function(_0x90a1f8,_0x10f2d1,_0x5e0e28){return new AGIServer(_0x90a1f8,_0x10f2d1,_0x5e0e28);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 7a529d1..41244c4 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 _0xebc0=['bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','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','trunk_name','no\x20trunk\x20selected','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','getSound','no\x20file\x20audio\x20found','getData','response','toString','test','mindigit','maxdigit','hiddendigitsnum','hiddendigitspos','substr','generate','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','isString','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','beep','gotoc','continueAt','context','gotoif','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','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','ispeechTTS','ispeech\x20TTS\x20is\x20unreachable','login','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','agentLogout','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','forEach','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20selected','file_id','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','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','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','command','sh\x20command:\x20%s\x20result\x20no\x20stored','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','unlink','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','util','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','/var/opt/motion2/server/files','menu','getdigits','channel','rpc','mailRpc','getVariable','getVariableById','then','name','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','getPause','agentPause','agent','error','agentUnpause','agentLogin','%s/%s@from-sip/n','LOCAL','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','timeout','number','includes','POST','PUT','method','toUpperCase','body','rawBody','parse','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','isPlainObject','%s.%s','setVariable','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','exec','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','no\x20text\x20configured','MRCPSynth','sestektts','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','%s[%s][%s]','variable\x20%s\x20set','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20private_key\x20configured','no\x20anguage\x20configured'];(function(_0x1c56ba,_0x48a284){var _0x199972=function(_0xcd708d){while(--_0xcd708d){_0x1c56ba['push'](_0x1c56ba['shift']());}};_0x199972(++_0x48a284);}(_0xebc0,0xe5));var _0x0ebc=function(_0x1411fe,_0x364eea){_0x1411fe=_0x1411fe-0x0;var _0x736b3e=_0xebc0[_0x1411fe];return _0x736b3e;};'use strict';var fs=require('fs');var path=require(_0x0ebc('0x0'));var util=require(_0x0ebc('0x1'));var _=require(_0x0ebc('0x2'));var sh=require('shelljs');var odbc=require(_0x0ebc('0x3'))();var rs=require(_0x0ebc('0x4'));var moment=require(_0x0ebc('0x5'));var Mustache=require(_0x0ebc('0x6'));var rp=require(_0x0ebc('0x7'));var logger=require(_0x0ebc('0x8'))(_0x0ebc('0x9'));var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH=_0x0ebc('0xa');var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=[_0x0ebc('0xb'),_0x0ebc('0xc'),'getsecretdigits'];var AGIVertices=function(_0x5bed1d,_0x5c39cf,_0xf1b94f){this[_0x0ebc('0xd')]=_0x5bed1d;this[_0x0ebc('0xe')]=_0x5c39cf;this[_0x0ebc('0xf')]=_0xf1b94f;};AGIVertices['prototype'][_0x0ebc('0x10')]=function(_0xc67edb,_0x46af2d){this[_0x0ebc('0xe')][_0x0ebc('0x11')](_0xc67edb)[_0x0ebc('0x12')](function(_0x45c806){_0x46af2d(null,_0x45c806?_0x45c806[_0x0ebc('0x13')]:![]);})[_0x0ebc('0x14')](function(_0x12814d){_0x46af2d(_0x12814d);});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x16')]=function(_0x4b9580,_0x1bdfdc){this[_0x0ebc('0xe')][_0x0ebc('0x17')](_0x4b9580)[_0x0ebc('0x12')](function(_0x334b39){_0x1bdfdc(null,_0x334b39?_0x334b39[_0x0ebc('0x13')]:![]);})[_0x0ebc('0x14')](function(_0x38af7c){_0x1bdfdc(_0x38af7c);});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x18')]=function(_0x3cc3e3,_0x189a05){this['rpc'][_0x0ebc('0x19')](_0x3cc3e3)[_0x0ebc('0x12')](function(_0x395ad1){_0x189a05(null,_0x395ad1?_0x395ad1[_0x0ebc('0x13')]:![]);})[_0x0ebc('0x14')](function(_0x5ca7a1){_0x189a05(_0x5ca7a1);});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x1a')]=function(_0x1ddf3f,_0x21c9cb){this[_0x0ebc('0xe')][_0x0ebc('0x1b')](_0x1ddf3f)['then'](function(_0x60bd85){_0x21c9cb(null,_0x60bd85?_0x60bd85[_0x0ebc('0x1c')]:![]);})[_0x0ebc('0x14')](function(_0x3c875f){_0x21c9cb(_0x3c875f);});};AGIVertices['prototype']['getUser']=function(_0x1e8e38,_0x319dc4){this[_0x0ebc('0xe')][_0x0ebc('0x1d')](_0x1e8e38)[_0x0ebc('0x12')](function(_0x34f1cb){_0x319dc4(null,_0x34f1cb?_0x34f1cb[_0x0ebc('0x13')]:![]);})[_0x0ebc('0x14')](function(_0x4c11dc){_0x319dc4(_0x4c11dc);});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x1e')]=function(_0x391ecd,_0x1ac377){this[_0x0ebc('0xe')][_0x0ebc('0x1f')](_0x391ecd)[_0x0ebc('0x12')](function(_0x405a55){_0x1ac377(null,_0x405a55?_0x405a55[_0x0ebc('0x13')]:![]);})[_0x0ebc('0x14')](function(_0x213f78){_0x1ac377(_0x213f78);});};AGIVertices[_0x0ebc('0x15')]['getSound']=function(_0x3a8f62,_0x2f8fdb){var _0x47a7dc=this;this[_0x0ebc('0xe')]['getSoundById'](_0x3a8f62)[_0x0ebc('0x12')](function(_0x5c3be8){_0x2f8fdb(null,_0x5c3be8?_0x47a7dc[_0x0ebc('0x20')](_0x5c3be8['save_name']):![]);})[_0x0ebc('0x14')](function(_0x47c900){_0x2f8fdb(_0x47c900);});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x21')]=function(_0x1d64d8,_0x111d1a){this[_0x0ebc('0xe')][_0x0ebc('0x22')](_0x1d64d8)[_0x0ebc('0x12')](function(_0x1f2513){_0x111d1a(null,_0x1f2513?_0x1f2513:![]);})[_0x0ebc('0x14')](function(_0x352e3a){_0x111d1a(_0x352e3a);});};AGIVertices['prototype']['sendMailMessage']=function(_0x1c63ce,_0x40e69d,_0x6eae7b){this['mailRpc'][_0x0ebc('0x23')](_0x1c63ce,_0x40e69d)['then'](function(){_0x6eae7b(null);})['catch'](function(_0x4996dc){_0x6eae7b(_0x4996dc);});};AGIVertices['prototype'][_0x0ebc('0x24')]=function(_0x3e13d8,_0xb34d83){this[_0x0ebc('0xe')][_0x0ebc('0x25')](_0x3e13d8)[_0x0ebc('0x12')](function(_0x23669f){if(_0x23669f){if(_0x23669f['IntervalId']){_0xb34d83(null,[_0x23669f['interval']]);}else{_0xb34d83(null,_[_0x0ebc('0x26')](_0x23669f[_0x0ebc('0x27')],_0x0ebc('0x28')));}}else{_0xb34d83(null,![]);}})[_0x0ebc('0x14')](function(_0x4bbf13){_0xb34d83(_0x4bbf13);});};AGIVertices['prototype'][_0x0ebc('0x20')]=function(_0x1823e3){return util[_0x0ebc('0x29')](_0x0ebc('0x2a'),FILES_PATH,_0x1823e3);};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x2b')]=function(_0x1f2aef,_0x5c3823,_0x2d34d1){odbc[_0x0ebc('0x2c')](_0x1f2aef,function(_0x481e53){if(_0x481e53){logger['error'](_0x0ebc('0x2d'),_0x481e53);_0x2d34d1(_0x481e53);}else{logger[_0x0ebc('0x2e')](_0x0ebc('0x2f'));odbc[_0x0ebc('0x30')](_0x5c3823,function(_0x1263a7,_0x357cca){if(_0x1263a7){logger[_0x0ebc('0x2e')](_0x0ebc('0x31'),_0x5c3823);_0x2d34d1(_0x1263a7);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x5c3823);odbc['close'](function(_0x570934){if(_0x570934){logger['error'](_0x0ebc('0x32'),_0x570934);}_0x2d34d1(null,_0x357cca);});}});}});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x33')]=function(_0x5b44ba,_0x54dda1){this[_0x0ebc('0xe')][_0x0ebc('0x34')](_0x5b44ba)['then'](function(_0x3b3250){_0x54dda1(null,_0x3b3250?_0x3b3250:![]);})['catch'](function(_0x20123a){_0x54dda1(_0x20123a);});};AGIVertices['prototype']['createSmsMessage']=function(_0x1b821e,_0x4d7e2a){this[_0x0ebc('0xe')][_0x0ebc('0x35')](_0x1b821e)[_0x0ebc('0x12')](function(_0x2a4a04){_0x4d7e2a(null,_0x2a4a04);})[_0x0ebc('0x14')](function(_0x2568d8){_0x4d7e2a(_0x2568d8);});};AGIVertices['prototype'][_0x0ebc('0x36')]=function(_0xec2049,_0x476516,_0x3d7039){this[_0x0ebc('0xe')][_0x0ebc('0x36')]({'uniqueid':this[_0x0ebc('0xd')]['uniqueid'],'node':_0xec2049['label'],'application':_0xec2049[_0x0ebc('0x37')],'data':_0x476516||null,'project_name':this[_0x0ebc('0xd')][_0x0ebc('0x38')],'callerid':this[_0x0ebc('0xd')][_0x0ebc('0x39')]})[_0x0ebc('0x12')](function(_0x2b1eaa){if(_0x3d7039){_0x3d7039(null,_0x2b1eaa);}})[_0x0ebc('0x14')](function(_0x51dd10){if(_0x3d7039){_0x3d7039(_0x51dd10);}});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x3a')]=function(_0x3f1eaf,_0x246a85,_0x59a14c,_0x5615f4){this['rpc'][_0x0ebc('0x3a')]({'uniqueid':this[_0x0ebc('0xd')][_0x0ebc('0x3b')],'callerid':this[_0x0ebc('0xd')][_0x0ebc('0x39')],'calleridname':this[_0x0ebc('0xd')][_0x0ebc('0x3c')],'context':this[_0x0ebc('0xd')]['context'],'extension':this[_0x0ebc('0xd')]['extension'],'priority':this[_0x0ebc('0xd')][_0x0ebc('0x3d')],'accountcode':this[_0x0ebc('0xd')]['accountcode'],'dnid':this[_0x0ebc('0xd')][_0x0ebc('0x3e')],'projectName':this[_0x0ebc('0xd')][_0x0ebc('0x38')],'saveName':_0x246a85,'filename':_0x3f1eaf[_0x0ebc('0x3f')]||_0x246a85,'savePath':_0x59a14c})[_0x0ebc('0x12')](function(_0x5c1ac7){_0x5615f4(null,_0x5c1ac7);})[_0x0ebc('0x14')](function(_0x30bdf4){_0x5615f4(_0x30bdf4);});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x40')]=function(_0x5a2d09,_0x47f3b7,_0x47dba1,_0x3337a6,_0x3e9d47){this['rpc'][_0x0ebc('0x40')]({'uniqueid':this['channel'][_0x0ebc('0x3b')],'body':_0x5a2d09,'direction':_0x47f3b7,'providerName':_0x47dba1,'providerResponse':_0x3337a6})[_0x0ebc('0x12')](function(_0x14e31f){if(_0x3e9d47){_0x3e9d47(null,_0x14e31f);}})[_0x0ebc('0x14')](function(_0x49988e){if(_0x3e9d47){_0x3e9d47(_0x49988e);}});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x41')]=function(_0x1e84d5,_0x38fb0d){this[_0x0ebc('0xe')][_0x0ebc('0x41')]({'firstName':_[_0x0ebc('0x42')](_0x1e84d5[_0x0ebc('0x13')])||_[_0x0ebc('0x43')](_0x1e84d5['name'])?_0x0ebc('0x44')+Math[_0x0ebc('0x45')]():_0x1e84d5[_0x0ebc('0x13')],'lastName':_[_0x0ebc('0x42')](_0x1e84d5[_0x0ebc('0x46')])||_[_0x0ebc('0x43')](_0x1e84d5[_0x0ebc('0x46')])?null:_0x1e84d5['lastName'],'phone':_0x1e84d5[_0x0ebc('0x47')],'ListId':_0x1e84d5[_0x0ebc('0x48')],'scheduledat':_0x1e84d5[_0x0ebc('0x49')],'callbackUniqueid':this[_0x0ebc('0xd')][_0x0ebc('0x3b')],'tags':_0x0ebc('0x4a'),'description':_0x0ebc('0x4b')+_0x1e84d5['scheduledAt']['toString'](),'priority':_0x1e84d5['callback_priority']})['then'](function(_0x2ffb96){_0x38fb0d(null,_0x2ffb96);})[_0x0ebc('0x14')](function(_0x1f296f){_0x38fb0d(_0x1f296f);});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x4c')]=function(_0x27c552,_0x3f6045){this[_0x0ebc('0xe')]['getPauseById'](_0x27c552)['then'](function(_0x17cd4c){_0x3f6045(null,_0x17cd4c?_0x17cd4c[_0x0ebc('0x13')]:![]);})['catch'](function(_0x25d3d2){_0x3f6045(_0x25d3d2);});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x4d')]=function(_0x13d74a,_0x147dfb,_0x474052){var _0x4f8624={'role':_0x0ebc('0x4e')};_0x4f8624[_0x13d74a]=this['channel'][_0x0ebc('0x39')];this['rpc'][_0x0ebc('0x4d')](_0x4f8624,_0x147dfb,this[_0x0ebc('0xd')]['uniqueid'])['then'](function(_0x57a288){_0x474052(null,_[_0x0ebc('0x43')](_0x57a288)?![]:!![]);})['catch'](function(_0xbb1c38){logger[_0x0ebc('0x4f')](_0xbb1c38);_0x474052(null,![]);});};AGIVertices['prototype'][_0x0ebc('0x50')]=function(_0x108acd,_0x2d2850){var _0x5918f4={'role':_0x0ebc('0x4e')};_0x5918f4[_0x108acd]=this[_0x0ebc('0xd')][_0x0ebc('0x39')];this['rpc'][_0x0ebc('0x50')](_0x5918f4)[_0x0ebc('0x12')](function(_0x4c731a){_0x2d2850(null,_[_0x0ebc('0x43')](_0x4c731a)?![]:!![]);})[_0x0ebc('0x14')](function(_0x30a342){logger[_0x0ebc('0x4f')](_0x30a342);_0x2d2850(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x5a543b,_0x3beb6a){var _0x1711dc={'role':_0x0ebc('0x4e')};_0x1711dc[_0x5a543b]=this[_0x0ebc('0xd')]['callerid'];this['rpc']['agentLogout'](_0x1711dc)[_0x0ebc('0x12')](function(_0x443438){_0x3beb6a(null,_['isNil'](_0x443438)?![]:!![]);})[_0x0ebc('0x14')](function(_0x46f4c4){logger[_0x0ebc('0x4f')](_0x46f4c4);_0x3beb6a(null,![]);});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x51')]=function(_0x1bf5f7,_0x53da63){var _0xd37d41={'role':_0x0ebc('0x4e')};_0xd37d41[_0x1bf5f7]=this[_0x0ebc('0xd')][_0x0ebc('0x39')];var _0x1032fd=_0x1bf5f7!='internal'?util[_0x0ebc('0x29')](_0x0ebc('0x52'),_0x0ebc('0x53'),this[_0x0ebc('0xd')][_0x0ebc('0x39')]):undefined;this['rpc'][_0x0ebc('0x51')](_0xd37d41,_0x1032fd)['then'](function(_0x17b161){_0x53da63(null,_['isNil'](_0x17b161)?![]:!![]);})[_0x0ebc('0x14')](function(_0x58d14b){logger[_0x0ebc('0x4f')](_0x58d14b);_0x53da63(null,![]);});};AGIVertices[_0x0ebc('0x15')]['shellCommand']=function(_0x3b2c73,_0x30a298){sh['exec'](_[_0x0ebc('0x54')](_0x3b2c73),function(_0x1d7f20,_0x3abb28){var _0x752e0b=_0x3abb28[_0x0ebc('0x55')](/(\r\n|\n|\r)/gm,'');_0x30a298(null,_0x752e0b);});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x56')]=function(_0x5be1ec,_0x20a1ad){scripts[_0x0ebc('0x56')](_0x5be1ec[_0x0ebc('0x57')],_0x5be1ec['google_cloud_tts_text_type']||_0x0ebc('0x58'),_0x5be1ec[_0x0ebc('0x58')],_0x5be1ec[_0x0ebc('0x59')]||_0x0ebc('0x5a'),_0x5be1ec[_0x0ebc('0x5b')]||_0x0ebc('0x5c'),_0x5be1ec[_0x0ebc('0x5d')]||_0x0ebc('0x5e'))[_0x0ebc('0x12')](function(_0x5bd3f7){_0x20a1ad(null,_0x5bd3f7);})[_0x0ebc('0x14')](function(_0x26e5b3){_0x20a1ad(_0x26e5b3);});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x5f')]=function(_0x481e50,_0x38c6a6){scripts[_0x0ebc('0x5f')](_0x481e50[_0x0ebc('0x58')],_0x481e50[_0x0ebc('0x60')]||'en',0x1)[_0x0ebc('0x12')](function(_0x56d201){_0x38c6a6(null,_0x56d201);})['catch'](function(_0x4063e4){_0x38c6a6(_0x4063e4);});};AGIVertices[_0x0ebc('0x15')]['restAPI']=function(_0x22c946,_0x4bcf7a){var _0x5bc1c9={'uri':_0x22c946[_0x0ebc('0x61')],'method':_0x22c946['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x22c946[_0x0ebc('0x62')])===_0x0ebc('0x63')&&parseInt(_0x22c946[_0x0ebc('0x62')])>=0x1?parseInt(_0x22c946['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x0ebc('0x64')]([_0x0ebc('0x65'),_0x0ebc('0x66')],_0x5bc1c9[_0x0ebc('0x67')][_0x0ebc('0x68')]())){try{_0x5bc1c9[_0x0ebc('0x69')]=_0x22c946[_0x0ebc('0x6a')]?JSON[_0x0ebc('0x6b')](_0x22c946[_0x0ebc('0x6a')]):{};}catch(_0x51153e){logger[_0x0ebc('0x4f')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x51153e);}}try{_0x5bc1c9[_0x0ebc('0x6c')]=_0x22c946[_0x0ebc('0x6d')]?JSON[_0x0ebc('0x6b')](_0x22c946[_0x0ebc('0x6d')]):{};}catch(_0x1c5ec7){logger[_0x0ebc('0x4f')](_0x0ebc('0x6e'),_0x1c5ec7);}if(_0x22c946[_0x0ebc('0x6f')]){try{var _0x14717a=require(_0x22c946[_0x0ebc('0x6f')])['sync'](this,_0x5bc1c9);_0x5bc1c9[_0x0ebc('0x70')]=Mustache[_0x0ebc('0x71')](_0x22c946[_0x0ebc('0x61')],_0x14717a,{},['$$','$$']);if(_0x5bc1c9[_0x0ebc('0x6c')]){_0x5bc1c9[_0x0ebc('0x6c')]=JSON['parse'](Mustache['render'](JSON[_0x0ebc('0x72')](_0x5bc1c9[_0x0ebc('0x6c')]),_0x14717a,{},['$$','$$']));}if(_0x5bc1c9[_0x0ebc('0x69')]){_0x5bc1c9[_0x0ebc('0x69')]=JSON[_0x0ebc('0x6b')](Mustache[_0x0ebc('0x71')](JSON[_0x0ebc('0x72')](_0x5bc1c9[_0x0ebc('0x69')]),_0x14717a,{},['$$','$$']));}}catch(_0x3b0e1c){logger[_0x0ebc('0x4f')](_0x0ebc('0x73'),_0x3b0e1c);}}rp(_0x5bc1c9)['then'](function(_0x5f3f51){var _0x3f2721={'statusCode':_0x5f3f51[_0x0ebc('0x74')]||0xc8,'statusMessage':_0x5f3f51[_0x0ebc('0x75')]||'OK','headers':_0x5f3f51[_0x0ebc('0x6c')]||{},'body':_0x5f3f51[_0x0ebc('0x69')]||{}};_0x4bcf7a(null,_0x3f2721);})[_0x0ebc('0x14')](function(_0x3bc910){var _0x3db2ad={'statusCode':_0x3bc910['statusCode']||0x1f4,'statusMessage':_0x3bc910[_0x0ebc('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x3bc910[_0x0ebc('0x77')][_0x0ebc('0x6c')]||{},'body':_0x3bc910['options'][_0x0ebc('0x69')]||{}};_0x4bcf7a(null,_0x3db2ad);});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x78')]=function(_0x168c89,_0x550bb9){scripts['googleDialogflow'](this[_0x0ebc('0xd')][_0x0ebc('0x3b')],_0x168c89[_0x0ebc('0x79')],_0x168c89['text'],_0x168c89[_0x0ebc('0x7a')]||'en')[_0x0ebc('0x12')](function(_0x555633){_0x550bb9(null,_0x555633);})[_0x0ebc('0x14')](function(_0x26a2f4){_0x550bb9(_0x26a2f4);});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x7b')]=function(_0x364790,_0x56de6c){scripts['googleDialogflowV2'](this['channel'][_0x0ebc('0x3b')],_0x364790[_0x0ebc('0x7c')],_0x364790[_0x0ebc('0x7d')],_0x364790[_0x0ebc('0x7e')],_0x364790[_0x0ebc('0x58')],_0x364790[_0x0ebc('0x7f')]||'en')[_0x0ebc('0x12')](function(_0x37fe1c){_0x56de6c(null,_0x37fe1c);})['catch'](function(_0x553932){_0x56de6c(_0x553932);});};AGIVertices['prototype']['sestekNDA']=function(_0x4575c6,_0x30947e){scripts[_0x0ebc('0x80')](this[_0x0ebc('0xd')],_0x4575c6)[_0x0ebc('0x12')](function(_0x46209b){_0x30947e(null,_0x46209b);})[_0x0ebc('0x14')](function(_0x2917db){_0x30947e(_0x2917db);});};AGIVertices[_0x0ebc('0x15')]['ispeechTTS']=function(_0x21afc1,_0x24edb8){scripts['ispeechTTS'](_0x21afc1[_0x0ebc('0x79')],_0x21afc1[_0x0ebc('0x58')],_0x21afc1[_0x0ebc('0x81')]||_0x0ebc('0x5a'),_0x21afc1[_0x0ebc('0x82')])[_0x0ebc('0x12')](function(_0x5100ad){_0x24edb8(null,_0x5100ad);})['catch'](function(_0x53cc56){_0x24edb8(_0x53cc56);});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x83')]=function(_0x39e58e,_0x3326d0,_0x352b1c){scripts['ispeechASR'](_0x3326d0,_0x39e58e[_0x0ebc('0x79')],_0x39e58e[_0x0ebc('0x84')]||'en-US',this[_0x0ebc('0x85')](_0x39e58e[_0x0ebc('0x86')])?_0x39e58e[_0x0ebc('0x86')]:undefined)['then'](function(_0x4202ad){_0x352b1c(null,_0x4202ad);})[_0x0ebc('0x14')](function(_0x6979ee){_0x352b1c(_0x6979ee);});};AGIVertices[_0x0ebc('0x15')]['awsPolly']=function(_0xd500e1,_0x185287){scripts[_0x0ebc('0x87')](_0xd500e1[_0x0ebc('0x88')],_0xd500e1[_0x0ebc('0x89')],_0xd500e1[_0x0ebc('0x8a')],_0xd500e1[_0x0ebc('0x8b')]||_0x0ebc('0x8c'),_0xd500e1[_0x0ebc('0x58')],_0xd500e1[_0x0ebc('0x8d')]||_0x0ebc('0x58'))[_0x0ebc('0x12')](function(_0x3ee5db){_0x185287(null,_0x3ee5db);})['catch'](function(_0x109d09){_0x185287(_0x109d09);});};AGIVertices['prototype'][_0x0ebc('0x8e')]=function(_0x5146df,_0xc1f667){scripts[_0x0ebc('0x8e')](this[_0x0ebc('0xd')][_0x0ebc('0x3b')],_0x5146df[_0x0ebc('0x88')],_0x5146df['aws_secret_access_key'],_0x5146df[_0x0ebc('0x8f')],_0x5146df['text'],_0x5146df[_0x0ebc('0x90')])[_0x0ebc('0x12')](function(_0x36ae8f){_0xc1f667(null,_0x36ae8f);})['catch'](function(_0x48b65d){_0xc1f667(_0x48b65d);});};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x91')]=function(_0x220109,_0x372f7d,_0x3f833a){scripts[_0x0ebc('0x91')](_0x372f7d,_0x220109[_0x0ebc('0x79')],_0x220109[_0x0ebc('0x92')]||_0x0ebc('0x5a'))[_0x0ebc('0x12')](function(_0x2f0b09){_0x3f833a(null,_0x2f0b09);})[_0x0ebc('0x14')](function(_0x5188a5){_0x3f833a(_0x5188a5);});};AGIVertices[_0x0ebc('0x15')]['tildeASR']=function(_0x2908f2,_0x35921f,_0x244519){scripts[_0x0ebc('0x93')](_0x35921f,_0x2908f2[_0x0ebc('0x94')],_0x2908f2[_0x0ebc('0x95')],_0x2908f2[_0x0ebc('0x70')])[_0x0ebc('0x12')](function(_0x449b10){_0x244519(null,_0x449b10);})[_0x0ebc('0x14')](function(_0xd82f41){_0x244519(_0xd82f41);});};AGIVertices[_0x0ebc('0x15')]['clear']=function(_0x22afca){var _0x2c37aa=_[_0x0ebc('0x64')](verticesWithRetry,_0x22afca[_0x0ebc('0x37')])?_0x22afca:_['clone'](_0x22afca);for(var _0x33d755 in _0x2c37aa){if(_0x2c37aa[_0x0ebc('0x96')](_0x33d755)){if(_0x2c37aa[_0x33d755]&&_['isString'](_0x2c37aa[_0x33d755])){if(_['includes'](recursiveMapAttributes,_0x33d755)){_0x2c37aa[_0x33d755]=this[_0x0ebc('0x97')](_0x2c37aa[_0x33d755]);}else{_0x2c37aa[_0x33d755]=this[_0x0ebc('0x98')](_0x2c37aa[_0x33d755]);}}}}return _0x2c37aa;};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x99')]=function(_0x298dea){for(var _0x48c0c9 in _0x298dea){if(_0x298dea[_0x0ebc('0x96')](_0x48c0c9)){if(_['isPlainObject'](_0x298dea[_0x48c0c9])){this['recursiveNodeIndex'](_0x298dea[_0x48c0c9]);}else if(_[_0x0ebc('0x9a')](_0x298dea[_0x48c0c9])){for(var _0x4b63d3=0x0;_0x4b63d3<_0x298dea[_0x48c0c9][_0x0ebc('0x9b')];_0x4b63d3++){this[_0x0ebc('0x99')](_0x298dea[_0x48c0c9][_0x4b63d3]);}}else if(_['isString'](_0x298dea[_0x48c0c9])){_0x298dea[_0x48c0c9]=this[_0x0ebc('0x98')](_0x298dea[_0x48c0c9]);}}}};AGIVertices['prototype'][_0x0ebc('0x9c')]=function(_0x4cab1b,_0x217517){for(var _0x2858ce in _0x4cab1b){if(_0x4cab1b['hasOwnProperty'](_0x2858ce)){if(_[_0x0ebc('0x9d')](_0x4cab1b[_0x2858ce])){if(!_[_0x0ebc('0x42')](_0x4cab1b[_0x2858ce])){this['saveRestApiResult'](_0x4cab1b[_0x2858ce],util[_0x0ebc('0x29')](_0x0ebc('0x9e'),_0x217517,_0x2858ce));}}else if(_['isArray'](_0x4cab1b[_0x2858ce])){for(var _0x44aa41=0x0;_0x44aa41<_0x4cab1b[_0x2858ce]['length'];_0x44aa41++){this['saveRestApiResult'](_0x4cab1b[_0x2858ce][_0x44aa41],util[_0x0ebc('0x29')](_0x0ebc('0x9e'),_0x217517,_0x2858ce+'['+_0x44aa41+']'));}}else{if(!_[_0x0ebc('0x43')](_0x4cab1b[_0x2858ce])){this[_0x0ebc('0xd')][_0x0ebc('0x9f')](util[_0x0ebc('0x29')](_0x0ebc('0x9e'),_0x217517,_0x2858ce),_0x4cab1b[_0x2858ce]);}}}}};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x97')]=function(_0x7a9960){try{var _0x13e397=JSON[_0x0ebc('0x6b')](_0x7a9960);this[_0x0ebc('0x99')](_0x13e397);return JSON[_0x0ebc('0x72')](_0x13e397);}catch(_0x179945){return this[_0x0ebc('0x98')](_0x7a9960);}};AGIVertices['prototype'][_0x0ebc('0x98')]=function(_0x20fc73){var _0x3603a7=_0x20fc73[_0x0ebc('0xa0')]('{');for(var _0x1d7eda=0x1;_0x1d7eda<_0x3603a7['length'];_0x1d7eda+=0x1){var _0x4e814c=_0x3603a7[_0x1d7eda][_0x0ebc('0xa0')]('}');if(_0x4e814c[_0x0ebc('0x9b')]>0x1){_0x20fc73=_0x20fc73['replaceAll']('{'+_0x4e814c[0x0]+'}',this[_0x0ebc('0xd')][_0x0ebc('0x10')](_0x4e814c[0x0])[_0x0ebc('0xa1')]||_0x4e814c[0x0]);}}if(_0x3603a7[_0x0ebc('0x9b')]===0x1){return _0x20fc73['toString']();}return this[_0x0ebc('0x98')](_0x20fc73);};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0xa2')]=function(_0x301dd3,_0x3fb4a1){var _0x402064=this[_0x0ebc('0xd')]['getVariable'](_0x301dd3);if(_0x402064[_0x0ebc('0xa3')]===-0x1){return _0x402064;}logger[_0x0ebc('0x2e')](util['format'](_0x0ebc('0xa4'),_0x3fb4a1,_0x402064[_0x0ebc('0xa1')]));return this[_0x0ebc('0xd')]['setVariable'](_0x3fb4a1,_0x402064['extra']);};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x85')]=function(_0x4b6722){return _0x4b6722&&_0x4b6722!=='0'&&_0x4b6722!=='-1'&&_0x4b6722!=='';};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0xa5')]=function(_0x5d8bf9){this[_0x0ebc('0x36')][_0x0ebc('0xa6')](this,_0x5d8bf9,'-');_0x5d8bf9[_0x0ebc('0xa7')]=_0x5d8bf9[_0x0ebc('0xa5')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0xa8')]=function(_0x1caaba){logger[_0x0ebc('0x2e')](util['format'](_0x0ebc('0xa9'),_0x1caaba['label']));if(!this[_0x0ebc('0x85')](_0x1caaba[_0x0ebc('0x58')])){return this[_0x0ebc('0xd')][_0x0ebc('0xaa')]('no\x20text\x20configured');}var _0x13348c='\x22'+_0x1caaba['text']+'\x22';if(this['isConfigured'](_0x1caaba[_0x0ebc('0x77')])){_0x13348c+=','+_0x1caaba['options'];}var _0x1454b0=this[_0x0ebc('0xd')][_0x0ebc('0xab')]('MRCPSynth',_0x13348c);if(_0x1454b0[_0x0ebc('0xa3')]===-0x1){return _0x1454b0;}return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0xac'),_0x13348c));};AGIVertices['prototype'][_0x0ebc('0xad')]=function(_0x4f91ed){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0xae'),_0x4f91ed[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0x4f91ed[_0x0ebc('0xb0')])){return this['channel'][_0x0ebc('0xaa')]('no\x20grammar\x20configured');}var _0x5b2fa3=_0x4f91ed[_0x0ebc('0xb0')];if(this['isConfigured'](_0x4f91ed[_0x0ebc('0x77')])){_0x5b2fa3+=','+_0x4f91ed[_0x0ebc('0x77')];}var _0x413838=this[_0x0ebc('0xd')][_0x0ebc('0xab')](_0x0ebc('0xb1'),_0x5b2fa3);if(_0x413838[_0x0ebc('0xa3')]===-0x1){return _0x413838;}var _0x18728e=this[_0x0ebc('0xa2')](_0x0ebc('0xb2'),_0x0ebc('0xb3'));if(_0x18728e[_0x0ebc('0xa3')]===-0x1){return _0x18728e;}var _0x138efb=this['getAndSetVariable'](_0x0ebc('0xb4'),_0x0ebc('0xb5'));if(_0x138efb[_0x0ebc('0xa3')]===-0x1){return _0x138efb;}var _0x30350d=this[_0x0ebc('0xa2')](_0x0ebc('0xb6'),_0x0ebc('0xb7'));if(_0x30350d[_0x0ebc('0xa3')]===-0x1){return _0x30350d;}return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5b2fa3));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x9')]=function(_0x4563a3){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0xb8'),_0x4563a3['label']));return this[_0x0ebc('0xd')]['agi']([_0x4563a3['command'],_0x4563a3[_0x0ebc('0xb9')]]);};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0xba')]=function(_0x2acf34){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0xbb'),_0x2acf34[_0x0ebc('0xaf')]));if(this['isConfigured'](_0x2acf34['timeout'])){logger['info'](util[_0x0ebc('0x29')](_0x0ebc('0xbc'),_0x2acf34[_0x0ebc('0x62')]));var _0x154b59=this[_0x0ebc('0xd')][_0x0ebc('0xbd')](_0x2acf34[_0x0ebc('0x62')]);if(_0x154b59['result']===-0x1){return _0x154b59;}}return this[_0x0ebc('0xd')][_0x0ebc('0xba')]();};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x4a')]=function(_0x3f31ce){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0xbe'),_0x3f31ce[_0x0ebc('0xaf')]));if(!this['isConfigured'](_0x3f31ce[_0x0ebc('0x48')])){return this['channel'][_0x0ebc('0x4f')](_0x3f31ce,'no\x20list\x20selected');}_0x3f31ce[_0x0ebc('0x49')]=moment();if(this[_0x0ebc('0x85')](_0x3f31ce[_0x0ebc('0xbf')])){_0x3f31ce[_0x0ebc('0x49')]=moment()[_0x0ebc('0xc0')](_0x3f31ce[_0x0ebc('0xbf')],_0x0ebc('0xc1'));}if(!this[_0x0ebc('0x85')](_0x3f31ce[_0x0ebc('0xc2')])){_0x3f31ce[_0x0ebc('0xc2')]=0x2;}this[_0x0ebc('0x41')]['sync'](this,_0x3f31ce);return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0xc3'),_0x3f31ce[_0x0ebc('0x47')],_0x3f31ce[_0x0ebc('0x48')],_0x3f31ce[_0x0ebc('0x49')]));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0xc4')]=function(_0x494a09){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0xc5'),_0x494a09[_0x0ebc('0xaf')]));var _0x5122f9=this[_0x0ebc('0xd')][_0x0ebc('0xab')](_0x494a09[_0x0ebc('0xc6')],_0x494a09['options']);if(_0x5122f9[_0x0ebc('0xa3')]===-0x1){return _0x5122f9;}return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')]('Executed\x20command\x20%s\x20%s',_0x494a09['application'],_0x494a09[_0x0ebc('0x77')]));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0xc7')]=function(_0x22932c){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x22932c[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0x22932c[_0x0ebc('0x58')])){return this['channel'][_0x0ebc('0xaa')](_0x0ebc('0xc8'));}var _0x57518b='\x22'+_0x22932c['text']+'\x22';if(this[_0x0ebc('0x85')](_0x22932c[_0x0ebc('0x77')])){_0x57518b+=','+_0x22932c['options'];}var _0xf4a29e=this['channel']['exec'](_0x0ebc('0xc9'),_0x57518b);if(_0xf4a29e[_0x0ebc('0xa3')]===-0x1){return _0xf4a29e;}return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util['format'](_0x0ebc('0xac'),_0x57518b));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0xca')]=function(_0xfde363){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0xfde363[_0x0ebc('0xaf')]));if(!this['isConfigured'](_0xfde363[_0x0ebc('0x58')])){return this['channel'][_0x0ebc('0xaa')](_0x0ebc('0xc8'));}var _0x4e5d45='\x22'+_0xfde363['text']+'\x22';if(this[_0x0ebc('0x85')](_0xfde363['options'])){_0x4e5d45+=','+_0xfde363[_0x0ebc('0x77')];}var _0xfec9f6=this[_0x0ebc('0xd')]['exec'](_0x0ebc('0xc9'),_0x4e5d45);if(_0xfec9f6[_0x0ebc('0xa3')]===-0x1){return _0xfec9f6;}return this['channel'][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0xac'),_0x4e5d45));};AGIVertices[_0x0ebc('0x15')]['lumenvoxasr']=function(_0x19127d){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0xcb'),_0x19127d[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0x19127d[_0x0ebc('0xb0')])){return this[_0x0ebc('0xd')]['noop']('no\x20grammar\x20configured');}var _0x235639=_0x19127d[_0x0ebc('0xb0')];if(this[_0x0ebc('0x85')](_0x19127d[_0x0ebc('0x77')])){_0x235639+=','+_0x19127d[_0x0ebc('0x77')];}var _0x4e1534=this[_0x0ebc('0xd')][_0x0ebc('0xab')](_0x0ebc('0xb1'),_0x235639);if(_0x4e1534[_0x0ebc('0xa3')]===-0x1){return _0x4e1534;}var _0x34854e=this['getAndSetVariable'](_0x0ebc('0xb2'),_0x0ebc('0xcc'));if(_0x34854e[_0x0ebc('0xa3')]===-0x1){return _0x34854e;}var _0x30734f=this['getAndSetVariable'](_0x0ebc('0xb4'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x30734f[_0x0ebc('0xa3')]===-0x1){return _0x30734f;}var _0x58c16e=this[_0x0ebc('0xa2')](_0x0ebc('0xb6'),_0x0ebc('0xcd'));if(_0x58c16e['result']===-0x1){return _0x58c16e;}return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0xce'),_0x235639));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0xcf')]=function(_0x578176){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x578176[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0x578176[_0x0ebc('0xb0')])){return this['channel'][_0x0ebc('0xaa')]('no\x20grammar\x20configured');}var _0x4ab8e6=_0x578176['grammar'];if(this[_0x0ebc('0x85')](_0x578176['options'])){_0x4ab8e6+=','+_0x578176['options'];}var _0x4f43ba=this[_0x0ebc('0xd')]['exec']('MRCPRecog',_0x4ab8e6);if(_0x4f43ba[_0x0ebc('0xa3')]===-0x1){return _0x4f43ba;}var _0x2a3c34=this[_0x0ebc('0xa2')](_0x0ebc('0xb2'),_0x0ebc('0xd0'));if(_0x2a3c34[_0x0ebc('0xa3')]===-0x1){return _0x2a3c34;}var _0x3634a0=this[_0x0ebc('0xa2')](_0x0ebc('0xb4'),_0x0ebc('0xd1'));if(_0x3634a0[_0x0ebc('0xa3')]===-0x1){return _0x3634a0;}var _0x47e7d9=this[_0x0ebc('0xa2')]('RECOG_INSTANCE()',_0x0ebc('0xd2'));if(_0x47e7d9[_0x0ebc('0xa3')]===-0x1){return _0x47e7d9;}return this[_0x0ebc('0xd')]['noop'](util[_0x0ebc('0x29')](_0x0ebc('0xce'),_0x4ab8e6));};AGIVertices['prototype'][_0x0ebc('0xd3')]=function(_0x4056b7){logger[_0x0ebc('0x2e')](util['format'](_0x0ebc('0xd4'),_0x4056b7[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0x4056b7[_0x0ebc('0xd5')])){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x4056b7,_0x0ebc('0xd6'));}var _0x581e56=this[_0x0ebc('0x1a')][_0x0ebc('0xa6')](this,_0x4056b7[_0x0ebc('0xd5')]);if(!_0x581e56){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x4056b7,_0x0ebc('0xd7'));}if(!this[_0x0ebc('0x85')](_0x4056b7['query'])){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x4056b7,'no\x20query\x20configured');}var _0x3c963f=_0x4056b7[_0x0ebc('0x30')][_0x0ebc('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0xd8'),_0x3c963f));var _0x2f4e4b=this[_0x0ebc('0x2b')][_0x0ebc('0xa6')](this,_0x581e56,_0x3c963f);this['createSquareDetailsReport'][_0x0ebc('0xa6')](this,_0x4056b7,_0x3c963f);if(!this[_0x0ebc('0x85')](_0x4056b7[_0x0ebc('0xd9')])){return this[_0x0ebc('0xd')]['noop'](_0x0ebc('0xda'));}var _0x2143fe=this[_0x0ebc('0x10')][_0x0ebc('0xa6')](this,_0x4056b7[_0x0ebc('0xd9')]);if(!_0x2143fe){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x4056b7,_0x0ebc('0xdb'));}var _0x555103=this;_0x2f4e4b['forEach'](function(_0x4471b5,_0x15784e){Object[_0x0ebc('0xdc')](_0x4471b5)['forEach'](function(_0x1f9801){_0x555103['channel']['setVariable'](util['format'](_0x0ebc('0xdd'),_0x2143fe,_0x15784e,_0x1f9801),_0x4471b5[_0x1f9801]);});});this[_0x0ebc('0xd')]['setVariable'](util[_0x0ebc('0x29')]('%s_ROWS_COUNT',_0x2143fe),_0x2f4e4b[_0x0ebc('0x9b')]);return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0xde'),_0x2143fe));};AGIVertices[_0x0ebc('0x15')]['dial']=function(_0xccf991){logger['debug'](util[_0x0ebc('0x29')](_0x0ebc('0xdf'),_0xccf991[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0xccf991[_0x0ebc('0xe0')])){return this[_0x0ebc('0xd')]['error'](_0xccf991,'no\x20user\x20selected');}var _0x2044aa=this[_0x0ebc('0xe1')][_0x0ebc('0xa6')](this,_0xccf991[_0x0ebc('0xe0')]);if(!_0x2044aa){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0xccf991,_0x0ebc('0xe2'));}var _0x401708=this[_0x0ebc('0xd')][_0x0ebc('0xab')](_0x0ebc('0xe3'),[util[_0x0ebc('0x29')](_0x0ebc('0xe4'),_0x2044aa),_0xccf991[_0x0ebc('0x62')],_0xccf991[_0x0ebc('0xe5')],_0xccf991['url']]);if(_0x401708[_0x0ebc('0xa3')]===-0x1){return _0x401708;}return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0xe6'),_0x0ebc('0xe3')));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0xe7')]=function(_0x28a386){logger['info'](util[_0x0ebc('0x29')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x28a386[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0x28a386['key'])){return this['channel'][_0x0ebc('0xaa')](_0x0ebc('0xe8'));}if(!this[_0x0ebc('0x85')](_0x28a386[_0x0ebc('0x58')])){return this[_0x0ebc('0xd')]['noop']('no\x20text\x20configured');}this[_0x0ebc('0xd')]['bot']=!![];this[_0x0ebc('0x36')](_0x28a386);this['createSquareMessage'](_0x28a386[_0x0ebc('0x58')],'in','','');this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')]('Trying\x20Dialogflow:\x20%s',_0x28a386[_0x0ebc('0x58')]));var _0x362c0e=this['googleDialogflow'][_0x0ebc('0xa6')](this,_0x28a386);if(_0x362c0e){for(var _0x33b5d4 in _0x362c0e){if(_0x362c0e[_0x0ebc('0x96')](_0x33b5d4)){this[_0x0ebc('0xd')][_0x0ebc('0x9f')](util[_0x0ebc('0x29')](_0x0ebc('0xe9'),_0x33b5d4[_0x0ebc('0x68')]()),_0x362c0e[_0x33b5d4]);}}this[_0x0ebc('0x40')](_0x362c0e['speech'],_0x0ebc('0xea'),_0x0ebc('0xe7'),'');return this['channel'][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0xeb'),_0x362c0e[_0x0ebc('0xec')]));}return this[_0x0ebc('0xd')]['error'](_0x28a386,_0x0ebc('0xed'));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0xee')]=function(_0x3cf464){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0xef'),_0x3cf464[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0x3cf464['dialogflowV2_project_id'])){return this[_0x0ebc('0xd')]['noop']('no\x20project_id\x20configured');}if(!this[_0x0ebc('0x85')](_0x3cf464[_0x0ebc('0x7d')])){return this[_0x0ebc('0xd')][_0x0ebc('0xaa')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x3cf464[_0x0ebc('0x7e')])){return this['channel'][_0x0ebc('0xaa')](_0x0ebc('0xf0'));}if(!this[_0x0ebc('0x85')](_0x3cf464[_0x0ebc('0x7f')])){return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](_0x0ebc('0xf1'));}if(!this[_0x0ebc('0x85')](_0x3cf464[_0x0ebc('0x58')])){return this['channel'][_0x0ebc('0xaa')](_0x0ebc('0xc8'));}this[_0x0ebc('0xd')][_0x0ebc('0xf2')]=!![];this['createSquareDetailsReport'](_0x3cf464);this[_0x0ebc('0x40')](_0x3cf464[_0x0ebc('0x58')],'in','','');this['channel'][_0x0ebc('0xaa')](util['format'](_0x0ebc('0xf3'),_0x3cf464[_0x0ebc('0x58')]));var _0x2d1060=this[_0x0ebc('0x7b')][_0x0ebc('0xa6')](this,_0x3cf464);if(_0x2d1060){for(var _0x4cc8df in _0x2d1060){if(_0x2d1060[_0x0ebc('0x96')](_0x4cc8df)){if(_0x4cc8df!==_0x0ebc('0xf4')){this[_0x0ebc('0xd')][_0x0ebc('0x9f')](util[_0x0ebc('0x29')]('DIALOGFLOW_%s',_0x4cc8df['toUpperCase']()),_0x2d1060[_0x4cc8df]);}}}this['createSquareMessage'](_0x2d1060[_0x0ebc('0xec')],_0x0ebc('0xea'),_0x0ebc('0xee'),_0x2d1060[_0x0ebc('0xf4')]);return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0xf5'),_0x2d1060[_0x0ebc('0xec')]));}return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x3cf464,_0x0ebc('0xf6'));};AGIVertices[_0x0ebc('0x15')]['sesteknda']=function(_0x156269){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0xf7'),_0x156269['label']));if(!this[_0x0ebc('0x85')](_0x156269[_0x0ebc('0xf8')])){return this[_0x0ebc('0xd')]['noop'](_0x0ebc('0xf9'));}if(!this[_0x0ebc('0x85')](_0x156269[_0x0ebc('0xfa')])){return this[_0x0ebc('0xd')][_0x0ebc('0xaa')]('no\x20username\x20configured');}if(!this[_0x0ebc('0x85')](_0x156269[_0x0ebc('0xfb')])){return this[_0x0ebc('0xd')]['noop'](_0x0ebc('0xfc'));}if(!this['isConfigured'](_0x156269[_0x0ebc('0xfd')])){return this[_0x0ebc('0xd')]['noop'](_0x0ebc('0xc8'));}this['channel'][_0x0ebc('0xf2')]=!![];this[_0x0ebc('0x36')](_0x156269);this[_0x0ebc('0x40')](_0x156269[_0x0ebc('0x58')],'in','','');this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')]('Trying\x20SestekNDA:\x20%s',_0x156269['text']));var _0x4a22b1=this[_0x0ebc('0x80')][_0x0ebc('0xa6')](this,_0x156269);if(_0x4a22b1){for(var _0x1c7ab0 in _0x4a22b1){if(_0x4a22b1[_0x0ebc('0x96')](_0x1c7ab0)){this[_0x0ebc('0xd')][_0x0ebc('0x9f')](util[_0x0ebc('0x29')](_0x0ebc('0xfe'),_0x1c7ab0['toUpperCase']()),_0x4a22b1[_0x1c7ab0]);}}this[_0x0ebc('0x40')](_0x4a22b1[_0x0ebc('0xec')],_0x0ebc('0xea'),_0x0ebc('0xff'),'');if(_0x4a22b1[_0x0ebc('0x100')]){this[_0x0ebc('0xd')]['noop'](util[_0x0ebc('0x29')](_0x0ebc('0x101'),_0x4a22b1[_0x0ebc('0x100')]));var _0x1dc56b=this['channel'][_0x0ebc('0x102')](_0x4a22b1[_0x0ebc('0x100')]);try{fs['unlink'](_0x4a22b1['audiofile']+_0x0ebc('0x103'));}catch(_0x105c7a){logger[_0x0ebc('0x4f')](_0x105c7a);}return _0x1dc56b;}else{return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util['format'](_0x0ebc('0x104'),_0x4a22b1[_0x0ebc('0xec')]));}}return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x156269,_0x0ebc('0x105'));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x106')]=function(_0x3cbd8c){logger[_0x0ebc('0x2e')](util['format'](_0x0ebc('0x107'),_0x3cbd8c[_0x0ebc('0xaf')]));return this[_0x0ebc('0xd')][_0x0ebc('0xaa')]('end');};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x108')]=function(_0x3007d8){logger['info'](util[_0x0ebc('0x29')](_0x0ebc('0x109'),_0x3007d8[_0x0ebc('0xaf')]));var _0x4bab83='';if(_0x3007d8['trunk_id']){if(!this['isConfigured'](_0x3007d8[_0x0ebc('0x10a')])){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x3007d8,'no\x20trunk\x20selected');}else{var _0x5370f9=parseInt(_0x3007d8[_0x0ebc('0x10a')],0xa);if(isNaN(_0x5370f9)){_0x4bab83=_0x3007d8[_0x0ebc('0x10a')];}else{_0x4bab83=this[_0x0ebc('0x1e')][_0x0ebc('0xa6')](this,_0x3007d8[_0x0ebc('0x10a')]);if(!_0x4bab83){return this[_0x0ebc('0xd')]['error'](_0x3007d8,'no\x20trunk\x20found');}}}}else if(_0x3007d8[_0x0ebc('0x10b')]){_0x4bab83=_0x3007d8[_0x0ebc('0x10b')];}else{return this['channel'][_0x0ebc('0x4f')](_0x3007d8,_0x0ebc('0x10c'));}var _0x40516c=this[_0x0ebc('0xd')][_0x0ebc('0xab')](_0x0ebc('0xe3'),[util[_0x0ebc('0x29')]('SIP/%s/%s',_0x4bab83,_0x3007d8['phone']),_0x3007d8[_0x0ebc('0x62')],_0x3007d8['opts'],_0x3007d8['url']]);if(_0x40516c['result']===-0x1){return _0x40516c;}return this['channel'][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0xe6'),'DIAL'));};AGIVertices['prototype']['finally']=function(_0x4b280f){logger['info'](util[_0x0ebc('0x29')](_0x0ebc('0x10d'),_0x4b280f['label']));return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](_0x0ebc('0x10e'));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0xc')]=function(_0x58ffb1){logger[_0x0ebc('0x2e')](util['format'](_0x0ebc('0x10f'),_0x58ffb1[_0x0ebc('0xaf')]));if(_0x58ffb1[_0x0ebc('0xa7')]===0x0){return this[_0x0ebc('0xa5')](_0x58ffb1);}_0x58ffb1[_0x0ebc('0xa7')]-=0x1;if(!this['isConfigured'](_0x58ffb1['file_id'])){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x58ffb1,'no\x20file\x20audio\x20selected');}var _0x25c509=this[_0x0ebc('0x110')][_0x0ebc('0xa6')](this,_0x58ffb1['file_id']);if(!_0x25c509){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x58ffb1,_0x0ebc('0x111'));}if(!this[_0x0ebc('0x85')](_0x58ffb1[_0x0ebc('0xd9')])){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x0ebc('0xda'));}var _0x6477e2=this[_0x0ebc('0xd')][_0x0ebc('0x112')](_0x25c509,_0x58ffb1[_0x0ebc('0x113')],_0x58ffb1['maxdigit']);var _0x4de02a=_0x6477e2['result']?_0x6477e2[_0x0ebc('0xa3')][_0x0ebc('0x114')]():'';logger[_0x0ebc('0x2e')](_0x0ebc('0x115'),JSON[_0x0ebc('0x72')](_0x6477e2));if(_0x6477e2[_0x0ebc('0xa3')]===-0x1){this['createSquareDetailsReport'][_0x0ebc('0xa6')](this,_0x58ffb1,_0x4de02a);return _0x6477e2;}else if(_0x6477e2[_0x0ebc('0xa1')]===_0x0ebc('0x62')){_0x6477e2[_0x0ebc('0xa3')]=_0x4de02a[_0x0ebc('0x9b')]>=parseInt(_0x58ffb1[_0x0ebc('0x116')])?'x':'i';}else{_0x6477e2[_0x0ebc('0xa3')]=_0x4de02a['length']>=parseInt(_0x58ffb1[_0x0ebc('0x116')])&&_0x4de02a[_0x0ebc('0x9b')]<=parseInt(_0x58ffb1[_0x0ebc('0x117')])?'x':'i';}var _0x467a4e=this[_0x0ebc('0x10')][_0x0ebc('0xa6')](this,_0x58ffb1[_0x0ebc('0xd9')]);if(!_0x467a4e){return this['channel']['error'](_0x58ffb1,_0x0ebc('0xdb'));}this['channel'][_0x0ebc('0x9f')](_0x467a4e,_0x4de02a);if(this[_0x0ebc('0x85')](_0x58ffb1[_0x0ebc('0x118')])){var _0x874c72=parseInt(_0x58ffb1[_0x0ebc('0x118')],0xa);var _0x1d8635=rs['generate']({'charset':'*','length':_0x874c72});var _0x4847b8=_0x4de02a[_0x0ebc('0x9b')];if(_0x4847b8>0x0){if(_0x4847b8>_0x874c72){this[_0x0ebc('0x36')][_0x0ebc('0xa6')](this,_0x58ffb1,_0x58ffb1[_0x0ebc('0x119')]==='first'?_0x1d8635+_0x4de02a[_0x0ebc('0x11a')](_0x874c72):_0x4de02a[_0x0ebc('0x11a')](0x0,_0x4847b8-_0x874c72)+_0x1d8635);}else{this['createSquareDetailsReport'][_0x0ebc('0xa6')](this,_0x58ffb1,rs[_0x0ebc('0x11b')]({'charset':'*','length':_0x4847b8}));}}else{this[_0x0ebc('0x36')][_0x0ebc('0xa6')](this,_0x58ffb1,'');}}else{this[_0x0ebc('0x36')][_0x0ebc('0xa6')](this,_0x58ffb1,_0x4de02a);}return _0x6477e2;};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x11c')]=function(_0x5c937d){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x11d'),_0x5c937d[_0x0ebc('0xaf')]));return this[_0x0ebc('0xc')](_0x5c937d);};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x11e')]=function(_0x233c0b){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x11f'),_0x233c0b[_0x0ebc('0xaf')]));this[_0x0ebc('0x36')][_0x0ebc('0xa6')](this,_0x233c0b,_0x233c0b[_0x0ebc('0x120')]);return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util['format'](_0x0ebc('0x121'),_0x233c0b[_0x0ebc('0x120')]));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x122')]=function(_0x1d7325){logger[_0x0ebc('0x2e')](util['format'](_0x0ebc('0x123'),_0x1d7325[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0x1d7325[_0x0ebc('0x88')])||!this['isConfigured'](_0x1d7325[_0x0ebc('0x89')])){return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](_0x0ebc('0x124'));}if(!this[_0x0ebc('0x85')](_0x1d7325[_0x0ebc('0x58')])){return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](_0x0ebc('0xc8'));}this[_0x0ebc('0xd')]['noop'](util[_0x0ebc('0x29')](_0x0ebc('0x125'),_0x1d7325[_0x0ebc('0x58')]));var _0x31bb7f=this[_0x0ebc('0x87')][_0x0ebc('0xa6')](this,_0x1d7325);if(_0x31bb7f){this['channel'][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0x126'),_0x31bb7f));var _0x2456c2=this['channel']['streamFile'](_0x31bb7f);try{fs['unlink'](_0x31bb7f+_0x0ebc('0x103'));}catch(_0x4e220c){logger[_0x0ebc('0x4f')](_0x4e220c);}return _0x2456c2;}return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x1d7325,_0x0ebc('0x127'));};AGIVertices['prototype'][_0x0ebc('0x128')]=function(_0x1daab4){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x1daab4[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0x1daab4[_0x0ebc('0x88')])||!this[_0x0ebc('0x85')](_0x1daab4[_0x0ebc('0x89')])){return this[_0x0ebc('0xd')]['noop'](_0x0ebc('0x124'));}if(!this['isConfigured'](_0x1daab4[_0x0ebc('0x90')])){return this[_0x0ebc('0xd')]['noop'](_0x0ebc('0x129'));}if(!this[_0x0ebc('0x85')](_0x1daab4['text'])){return this['channel'][_0x0ebc('0xaa')](_0x0ebc('0xc8'));}this[_0x0ebc('0xd')][_0x0ebc('0xf2')]=!![];this[_0x0ebc('0x36')](_0x1daab4);this[_0x0ebc('0x40')](_0x1daab4[_0x0ebc('0x58')],'in','','');this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')]('Trying\x20Amazon\x20Lex:\x20%s',_0x1daab4[_0x0ebc('0x58')]));var _0x32a676=this[_0x0ebc('0x8e')][_0x0ebc('0xa6')](this,_0x1daab4);if(_0x32a676){for(var _0x1d45a0 in _0x32a676){if(_0x32a676[_0x0ebc('0x96')](_0x1d45a0)&&_[_0x0ebc('0x12a')](_0x32a676[_0x1d45a0])){this['channel']['setVariable'](util[_0x0ebc('0x29')](_0x0ebc('0x12b'),_0x1d45a0['toUpperCase']()),_0x32a676[_0x1d45a0]);}}if(_['isNil'](_0x32a676['message'])){return this[_0x0ebc('0xd')][_0x0ebc('0xaa')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x0ebc('0x40')](_0x32a676['message'],'out',_0x0ebc('0x12c'),'');return this[_0x0ebc('0xd')]['noop'](util[_0x0ebc('0x29')](_0x0ebc('0x12d'),_0x32a676[_0x0ebc('0x76')]));}}return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x1daab4,_0x0ebc('0x12e'));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x12f')]=function(_0x4e64f1){logger['info'](util[_0x0ebc('0x29')](_0x0ebc('0x130'),_0x4e64f1['label'],_0x4e64f1[_0x0ebc('0x62')]));if(!this[_0x0ebc('0x85')](_0x4e64f1[_0x0ebc('0x79')])){return this[_0x0ebc('0xd')]['noop'](_0x0ebc('0xe8'));}var _0x3541eb=_0x0ebc('0x131');var _0x44b721=util[_0x0ebc('0x29')]('%s/recordings/%s',FILES_PATH,rs[_0x0ebc('0x11b')](0x4));var _0x50ed16=util['format'](_0x0ebc('0x9e'),_0x44b721,_0x3541eb);var _0x5e1517=!![];if(_0x4e64f1['beep']===_0x0ebc('0x132')){_0x5e1517=![];}var _0x5ea068=this['channel'][_0x0ebc('0x133')](_0x44b721,_0x3541eb,_0x4e64f1[_0x0ebc('0x134')],_0x4e64f1[_0x0ebc('0x62')],undefined,_0x5e1517);if(_0x5ea068[_0x0ebc('0xa3')]!==-0x1){this['channel']['noop'](util[_0x0ebc('0x29')](_0x0ebc('0x135'),_0x50ed16));var _0x28f6eb=this[_0x0ebc('0x91')][_0x0ebc('0xa6')](this,_0x4e64f1,_0x50ed16);if(_0x28f6eb){for(var _0x1fe323 in _0x28f6eb){if(_0x28f6eb[_0x0ebc('0x96')](_0x1fe323)){this[_0x0ebc('0xd')][_0x0ebc('0x9f')](util['format'](_0x0ebc('0x136'),_0x1fe323['toUpperCase']()),_0x28f6eb[_0x1fe323]);}}return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')]('GoogleASR\x20Result\x20%s',JSON[_0x0ebc('0x72')](_0x28f6eb)));}}return _0x5ea068;};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x137')]=function(_0x46f69e){logger['info'](util[_0x0ebc('0x29')](_0x0ebc('0x138'),_0x46f69e[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0x46f69e[_0x0ebc('0x94')])){return this[_0x0ebc('0xd')]['noop'](_0x0ebc('0x139'));}if(!this['isConfigured'](_0x46f69e[_0x0ebc('0x95')])){return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](_0x0ebc('0x13a'));}var _0x211d3c='wav';var _0x158d9f=util[_0x0ebc('0x29')](_0x0ebc('0x13b'),FILES_PATH,rs[_0x0ebc('0x11b')](0x4));var _0x4755d=util[_0x0ebc('0x29')](_0x0ebc('0x9e'),_0x158d9f,_0x211d3c);var _0x2e0df3=!![];if(_0x46f69e[_0x0ebc('0x13c')]==='NOBEEP'){_0x2e0df3=![];}var _0x2bd53d=this[_0x0ebc('0xd')][_0x0ebc('0x133')](_0x158d9f,_0x211d3c,_0x46f69e[_0x0ebc('0x134')],_0x46f69e[_0x0ebc('0x62')],undefined,_0x2e0df3);if(_0x2bd53d[_0x0ebc('0xa3')]!==-0x1){this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util['format']('tilde\x20%s\x20file\x20created',_0x4755d));var _0x592888=this[_0x0ebc('0x93')][_0x0ebc('0xa6')](this,_0x46f69e,_0x4755d);if(_0x592888){for(var _0x497532 in _0x592888){if(_0x592888[_0x0ebc('0x96')](_0x497532)){this['channel']['setVariable'](util['format']('TILDE_ASR_%s',_0x497532['toUpperCase']()),_0x592888[_0x497532]);}}return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')]('TildeASR\x20Result\x20%s',JSON[_0x0ebc('0x72')](_0x592888)));}}return _0x2bd53d;};AGIVertices['prototype'][_0x0ebc('0x13d')]=function(_0x4f21ae){logger['info'](util[_0x0ebc('0x29')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x4f21ae[_0x0ebc('0xaf')]));return this[_0x0ebc('0xd')][_0x0ebc('0x13e')](_0x4f21ae[_0x0ebc('0x13f')],_0x4f21ae['extension'],_0x4f21ae[_0x0ebc('0x3d')]);};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x140')]=function(_0x23eb01){logger['info'](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x23eb01['label']));if(!this[_0x0ebc('0x85')](_0x23eb01[_0x0ebc('0x141')])){return this['channel'][_0x0ebc('0x4f')](_0x23eb01,'no\x20condition\x20configured');}try{var _0x2f5ce9=eval(_0x23eb01['condition'])?_0x0ebc('0x142'):_0x0ebc('0x143');this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util['format'](_0x0ebc('0x144'),_0x23eb01[_0x0ebc('0x141')],_0x2f5ce9));return{'code':0xc8,'result':_0x2f5ce9};}catch(_0x545fa7){return{'code':0xc8,'result':_0x0ebc('0x143')};}};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x145')]=function(_0xda5213){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x146'),_0xda5213[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0xda5213[_0x0ebc('0x147')])){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0xda5213,'no\x20interval\x20configured');}var _0x565b51=this[_0x0ebc('0x24')][_0x0ebc('0xa6')](this,_0xda5213[_0x0ebc('0x147')]);if(!_0x565b51){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0xda5213,'no\x20intervals\x20found');}for(var _0x819880=0x0;_0x819880<_0x565b51[_0x0ebc('0x9b')];_0x819880+=0x1){var _0x4096e2=this['channel'][_0x0ebc('0x10')](util[_0x0ebc('0x29')](_0x0ebc('0x148'),_0x565b51[_0x819880]));if(_0x4096e2[_0x0ebc('0xa3')]===-0x1){return _0x4096e2;}logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x149'),_0x565b51[_0x819880],_0x4096e2[_0x0ebc('0xa1')]));if(_0x4096e2[_0x0ebc('0xa1')]===_0x0ebc('0x142')){logger[_0x0ebc('0x2e')](util['format'](_0x0ebc('0x149'),_0x565b51[_0x819880],_0x0ebc('0x142')));this[_0x0ebc('0xd')]['noop'](util[_0x0ebc('0x29')](_0x0ebc('0x149'),_0x565b51[_0x819880],_0x0ebc('0x142')));return{'code':0xc8,'result':'true'};}else{logger[_0x0ebc('0x2e')](util['format']('IFTIME\x20%s\x20%s',_0x565b51[_0x819880],_0x0ebc('0x143')));this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util['format'](_0x0ebc('0x149'),_0x565b51[_0x819880],_0x0ebc('0x143')));}}return{'code':0xc8,'result':_0x0ebc('0x143')};};AGIVertices['prototype']['hangup']=function(_0x43af93){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x14a'),_0x43af93[_0x0ebc('0xaf')]));return this[_0x0ebc('0xd')]['hangup']();};AGIVertices[_0x0ebc('0x15')]['ispeechasr']=function(_0x23b195){logger[_0x0ebc('0x2e')](util['format'](_0x0ebc('0x14b'),_0x23b195['label']));if(!this[_0x0ebc('0x85')](_0x23b195[_0x0ebc('0x79')])){return this['channel'][_0x0ebc('0xaa')](_0x0ebc('0xe8'));}var _0x434446=_0x0ebc('0x131');var _0x4dba45=util['format'](_0x0ebc('0x13b'),FILES_PATH,rs[_0x0ebc('0x11b')](0x4));var _0x146454=util[_0x0ebc('0x29')](_0x0ebc('0x9e'),_0x4dba45,_0x434446);var _0x3023eb=!![];if(_0x23b195[_0x0ebc('0x13c')]===_0x0ebc('0x132')){_0x3023eb=![];}var _0x58a753=this[_0x0ebc('0xd')][_0x0ebc('0x133')](_0x4dba45,_0x434446,_0x23b195[_0x0ebc('0x134')],_0x23b195[_0x0ebc('0x62')],undefined,_0x3023eb);if(_0x58a753['result']!==-0x1){this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util['format'](_0x0ebc('0x14c'),_0x146454));var _0x590528=this['ispeechASR'][_0x0ebc('0xa6')](this,_0x23b195,_0x146454);if(_0x590528){for(var _0x447539 in _0x590528){if(_0x590528[_0x0ebc('0x96')](_0x447539)){this[_0x0ebc('0xd')]['setVariable'](util[_0x0ebc('0x29')](_0x0ebc('0x14d'),_0x447539[_0x0ebc('0x68')]()),_0x590528[_0x447539]);}}return this['channel'][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0x14e'),JSON[_0x0ebc('0x72')](_0x590528)));}}return _0x58a753;};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x14f')]=function(_0x37f176){logger['info'](util[_0x0ebc('0x29')](_0x0ebc('0x150'),_0x37f176['label']));if(!this['isConfigured'](_0x37f176['key'])){return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](_0x0ebc('0xe8'));}if(!this[_0x0ebc('0x85')](_0x37f176[_0x0ebc('0x58')])){return this[_0x0ebc('0xd')][_0x0ebc('0xaa')]('no\x20text\x20configured');}this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util['format'](_0x0ebc('0x151'),_0x37f176[_0x0ebc('0x58')]));var _0x71ba18=this[_0x0ebc('0x152')]['sync'](this,_0x37f176);if(_0x71ba18){this[_0x0ebc('0xd')]['noop'](util['format'](_0x0ebc('0x14c'),_0x71ba18));var _0x4d0c18=this[_0x0ebc('0xd')]['streamFile'](_0x71ba18,_0x37f176[_0x0ebc('0x134')]);try{fs['unlink'](_0x71ba18+_0x0ebc('0x103'));}catch(_0x5e50d2){logger[_0x0ebc('0x4f')](_0x5e50d2);}return _0x4d0c18;}return this['channel'][_0x0ebc('0x4f')](_0x37f176,_0x0ebc('0x153'));};AGIVertices['prototype'][_0x0ebc('0x154')]=function(_0x1c7eca){logger['info'](util[_0x0ebc('0x29')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x1c7eca[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0x1c7eca['findBy'])){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x1c7eca,_0x0ebc('0x155'));}logger[_0x0ebc('0x2e')](util['format'](_0x0ebc('0x156'),this[_0x0ebc('0xd')][_0x0ebc('0x39')],_0x1c7eca[_0x0ebc('0x157')]));var _0x41a153=this[_0x0ebc('0x51')]['sync'](this,_0x1c7eca[_0x0ebc('0x157')]);if(_0x41a153){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x158'),this['channel']['callerid'],_0x1c7eca[_0x0ebc('0x157')]));this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util['format'](_0x0ebc('0x158'),this[_0x0ebc('0xd')][_0x0ebc('0x39')],_0x1c7eca['findBy']));return{'code':0xc8,'result':_0x0ebc('0x159')};}else{logger['info'](util['format'](_0x0ebc('0x15a'),this[_0x0ebc('0xd')]['callerid'],_0x1c7eca[_0x0ebc('0x157')]));this[_0x0ebc('0xd')]['noop'](util['format'](_0x0ebc('0x15a'),this[_0x0ebc('0xd')][_0x0ebc('0x39')],_0x1c7eca[_0x0ebc('0x157')]));return{'code':0xc8,'result':_0x0ebc('0x15b')};}};AGIVertices[_0x0ebc('0x15')]['logout']=function(_0x3aef2b){logger[_0x0ebc('0x2e')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x3aef2b['label']));if(!this[_0x0ebc('0x85')](_0x3aef2b['findBy'])){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x3aef2b,_0x0ebc('0x155'));}logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x156'),this[_0x0ebc('0xd')][_0x0ebc('0x39')],_0x3aef2b[_0x0ebc('0x157')]));var _0x490091=this[_0x0ebc('0x15c')][_0x0ebc('0xa6')](this,_0x3aef2b['findBy']);if(_0x490091){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x158'),this[_0x0ebc('0xd')][_0x0ebc('0x39')],_0x3aef2b[_0x0ebc('0x157')]));this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0ebc('0xd')][_0x0ebc('0x39')],_0x3aef2b[_0x0ebc('0x157')]));return{'code':0xc8,'result':_0x0ebc('0x159')};}else{logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x15a'),this[_0x0ebc('0xd')][_0x0ebc('0x39')],_0x3aef2b[_0x0ebc('0x157')]));this['channel']['noop'](util[_0x0ebc('0x29')](_0x0ebc('0x15a'),this['channel'][_0x0ebc('0x39')],_0x3aef2b[_0x0ebc('0x157')]));return{'code':0xc8,'result':_0x0ebc('0x15b')};}};AGIVertices[_0x0ebc('0x15')]['math']=function(_0x88f39){logger[_0x0ebc('0x2e')](util['format'](_0x0ebc('0x15d'),_0x88f39[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0x88f39[_0x0ebc('0x15e')])){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x88f39,_0x0ebc('0x15f'));}this['channel'][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0x160'),_0x88f39['operation']));var _0x533bfd=eval(_0x88f39['operation']);if(!this['isConfigured'](_0x88f39[_0x0ebc('0xd9')])){return this['channel']['noop'](_0x0ebc('0xda'));}var _0x4bda09=this[_0x0ebc('0x10')][_0x0ebc('0xa6')](this,_0x88f39[_0x0ebc('0xd9')]);if(!_0x4bda09){return this['channel']['error'](_0x88f39,_0x0ebc('0xdb'));}if(_[_0x0ebc('0x9a')](_0x533bfd)){var _0xe19db3=this;_0x533bfd[_0x0ebc('0x161')](function(_0x325bf5,_0x3dcc6c){_0xe19db3['channel']['setVariable'](util[_0x0ebc('0x29')](_0x0ebc('0x162'),_0x4bda09,_0x3dcc6c),_0x325bf5);});return this[_0x0ebc('0xd')]['noop'](util[_0x0ebc('0x29')](_0x0ebc('0x163'),_0x4bda09));}else{return this[_0x0ebc('0xd')]['setVariable'](_0x4bda09,_0x533bfd);}};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0xb')]=function(_0x116eb5){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x116eb5[_0x0ebc('0xaf')]));if(_0x116eb5[_0x0ebc('0xa7')]===0x0){return this[_0x0ebc('0xa5')](_0x116eb5);}_0x116eb5[_0x0ebc('0xa7')]-=0x1;if(!this[_0x0ebc('0x85')](_0x116eb5['file_id'])){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x116eb5,_0x0ebc('0x164'));}var _0x5d69a4=this['getSound'][_0x0ebc('0xa6')](this,_0x116eb5[_0x0ebc('0x165')]);if(!_0x5d69a4){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x116eb5,'no\x20file\x20audio\x20found');}var _0x1caa4b=this[_0x0ebc('0xd')][_0x0ebc('0x112')](_0x5d69a4,_0x116eb5[_0x0ebc('0x113')],_0x116eb5[_0x0ebc('0x166')]);var _0x2f4969=_0x1caa4b[_0x0ebc('0xa3')];if(_0x1caa4b[_0x0ebc('0xa3')]===-0x1){this[_0x0ebc('0x36')][_0x0ebc('0xa6')](this,_0x116eb5,'-1');return _0x1caa4b;}else if(_0x1caa4b[_0x0ebc('0xa1')]===_0x0ebc('0x62')){_0x1caa4b[_0x0ebc('0xa3')]=_0x1caa4b[_0x0ebc('0xa3')]['length']>0x0?_0x1caa4b[_0x0ebc('0xa3')]:'t';}else if(_['isEmpty'](_0x1caa4b[_0x0ebc('0xa3')])){_0x1caa4b[_0x0ebc('0xa3')]='#';_0x2f4969='#';}if(!this[_0x0ebc('0x85')](_0x116eb5[_0x0ebc('0xd9')])){this[_0x0ebc('0xd')][_0x0ebc('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x45af92=this['getVariable'][_0x0ebc('0xa6')](this,_0x116eb5[_0x0ebc('0xd9')]);if(!_0x45af92){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x116eb5,_0x0ebc('0xdb'));}this[_0x0ebc('0xd')][_0x0ebc('0x9f')](_0x45af92,_0x2f4969);}this[_0x0ebc('0x36')][_0x0ebc('0xa6')](this,_0x116eb5,_0x2f4969);return _0x1caa4b;};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0xaa')]=function(_0x2053df){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x167'),_0x2053df[_0x0ebc('0xaf')]));return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](_0x2053df[_0x0ebc('0x168')]||_0x2053df['label']);};AGIVertices['prototype']['pause']=function(_0x80173e){logger['info'](util[_0x0ebc('0x29')](_0x0ebc('0x169'),_0x80173e[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0x80173e[_0x0ebc('0x157')])){return this['channel']['error'](_0x80173e,_0x0ebc('0x155'));}logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x156'),this[_0x0ebc('0xd')][_0x0ebc('0x39')],_0x80173e[_0x0ebc('0x157')]));var _0x6032e4=this['getPause'][_0x0ebc('0xa6')](this,_0x80173e[_0x0ebc('0x16a')]);var _0x22beb3=this[_0x0ebc('0x4d')]['sync'](this,_0x80173e['findBy'],_0x6032e4);if(_0x22beb3){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x158'),this[_0x0ebc('0xd')][_0x0ebc('0x39')],_0x80173e['findBy']));this['channel'][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0x158'),this[_0x0ebc('0xd')][_0x0ebc('0x39')],_0x80173e[_0x0ebc('0x157')]));return{'code':0xc8,'result':_0x0ebc('0x159')};}else{logger['info'](util[_0x0ebc('0x29')](_0x0ebc('0x15a'),this[_0x0ebc('0xd')][_0x0ebc('0x39')],_0x80173e[_0x0ebc('0x157')]));this['channel'][_0x0ebc('0xaa')](util[_0x0ebc('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x0ebc('0x39')],_0x80173e['findBy']));return{'code':0xc8,'result':_0x0ebc('0x15b')};}};AGIVertices['prototype']['playback']=function(_0x514155){logger['info'](util[_0x0ebc('0x29')](_0x0ebc('0x16b'),_0x514155['label']));if(!this[_0x0ebc('0x85')](_0x514155[_0x0ebc('0x165')])){return this[_0x0ebc('0xd')]['error'](_0x514155,_0x0ebc('0x164'));}var _0x4ecf8e=this[_0x0ebc('0x110')]['sync'](this,_0x514155[_0x0ebc('0x165')]);if(!_0x4ecf8e){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x514155,'no\x20file\x20audio\x20found');}var _0x5bf92a=this[_0x0ebc('0xd')]['exec'](_0x0ebc('0x16c'),[_0x4ecf8e,_0x514155[_0x0ebc('0xe5')]]);if(_0x5bf92a[_0x0ebc('0xa3')]===-0x1){return _0x5bf92a;}return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util['format'](_0x0ebc('0x16d'),_0x0ebc('0x16c'),_0x4ecf8e));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x16e')]=function(_0x3cf81b){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x3cf81b['label']));if(!this[_0x0ebc('0x85')](_0x3cf81b[_0x0ebc('0x16f')])){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x3cf81b,_0x0ebc('0x170'));}var _0x5bbfee='';var _0x3b17fd=parseInt(_0x3cf81b[_0x0ebc('0x16f')],0xa);if(isNaN(_0x3b17fd)){_0x5bbfee=_0x3cf81b[_0x0ebc('0x16f')];}else{_0x5bbfee=this['getVoiceQueue']['sync'](this,_0x3cf81b['queue_id']);if(!_0x5bbfee){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x3cf81b,_0x0ebc('0x171'));}}var _0x5aa6d2='';if(this[_0x0ebc('0x85')](_0x3cf81b[_0x0ebc('0x165')])){var _0x927695=this[_0x0ebc('0x110')][_0x0ebc('0xa6')](this,_0x3cf81b[_0x0ebc('0x165')]);if(_0x927695){_0x5aa6d2=_0x927695;}}this[_0x0ebc('0x36')]['sync'](this,_0x3cf81b,_0x5bbfee);if(_0x3cf81b[_0x0ebc('0xe5')][_0x0ebc('0x172')]('x')<0x0){_0x3cf81b[_0x0ebc('0xe5')]+='x';}if(_0x3cf81b[_0x0ebc('0xe5')][_0x0ebc('0x172')]('X')<0x0){_0x3cf81b[_0x0ebc('0xe5')]+='X';}this[_0x0ebc('0xd')][_0x0ebc('0x9f')]('XMCS-QUEUE',_0x5bbfee?_0x5bbfee[_0x0ebc('0x173')]():'');var _0x2c6de5=this['channel']['exec'](_0x0ebc('0x174'),[_0x5bbfee,_0x3cf81b['opts'],_0x3cf81b[_0x0ebc('0x61')],_0x5aa6d2,_0x3cf81b[_0x0ebc('0x62')],_0x3cf81b['agi'],_0x3cf81b[_0x0ebc('0x175')],_0x3cf81b[_0x0ebc('0x176')],'',_0x3cf81b[_0x0ebc('0x177')]]);if(_0x2c6de5[_0x0ebc('0xa3')]===-0x1){return _0x2c6de5;}return this['channel'][_0x0ebc('0xaa')](util['format']('Executed\x20command\x20%s\x20%s','QUEUE',_0x5bbfee));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x178')]=function(_0x1197da){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x179'),_0x1197da[_0x0ebc('0xaf')]));var _0x535188=_0x1197da[_0x0ebc('0x17a')]||_0x0ebc('0x131');var _0x501a80=util['format']('%s_%s',this['channel']['uniqueid'],rs[_0x0ebc('0x11b')](0x5));var _0x40cf3c=util[_0x0ebc('0x29')]('%s/recordings/%s.%s',FILES_PATH,_0x501a80,_0x535188);var _0x1d6334=util[_0x0ebc('0x29')]('%s/recordings/%s',FILES_PATH,_0x501a80);this[_0x0ebc('0x3a')][_0x0ebc('0xa6')](this,_0x1197da,_0x501a80,_0x40cf3c);this[_0x0ebc('0xd')][_0x0ebc('0x9f')](_0x0ebc('0x17b'),_0x501a80);logger[_0x0ebc('0x2e')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x1d6334,_0x535188,_0x1197da[_0x0ebc('0x17c')],_0x1197da['timeout']);return this[_0x0ebc('0xd')]['recordFile'](_0x1d6334,_0x535188,_0x1197da[_0x0ebc('0x17c')],_0x1197da[_0x0ebc('0x62')],undefined,!![]);};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x17d')]=function(_0x4478f6){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x17e'),_0x4478f6[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0x4478f6[_0x0ebc('0x61')])){return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](_0x0ebc('0x17f'));}var _0x1f00cf=this[_0x0ebc('0x180')]['sync'](this,_0x4478f6);logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x181'),util[_0x0ebc('0x182')](_0x1f00cf,{'showHidden':![],'depth':null})));if(!this[_0x0ebc('0x85')](_0x4478f6['variable_id'])){return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](_0x0ebc('0x183'));}var _0x466fda=this[_0x0ebc('0x10')][_0x0ebc('0xa6')](this,_0x4478f6[_0x0ebc('0xd9')]);if(!_0x466fda){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x4478f6,_0x0ebc('0xdb'));}this[_0x0ebc('0xd')][_0x0ebc('0x9f')](util['format'](_0x0ebc('0x184'),_0x466fda),_0x1f00cf[_0x0ebc('0x74')]?_0x1f00cf[_0x0ebc('0x74')]:_0x0ebc('0x185'));this['channel']['setVariable'](util[_0x0ebc('0x29')](_0x0ebc('0x186'),_0x466fda),_0x1f00cf[_0x0ebc('0x75')]?_0x1f00cf['statusMessage']:'OK');if(_0x1f00cf[_0x0ebc('0x69')]){try{this[_0x0ebc('0x9c')](_0x1f00cf[_0x0ebc('0x69')],_0x466fda);}catch(_0x230753){logger[_0x0ebc('0x4f')](util[_0x0ebc('0x29')](_0x0ebc('0x187'),_0x466fda));}}return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')]('variable\x20%s\x20set',_0x466fda));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x188')]=function(_0x5acb5e){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x189'),_0x5acb5e[_0x0ebc('0xaf')]));return this['channel'][_0x0ebc('0x18a')](_0x5acb5e['digits'][_0x0ebc('0x55')](/\s+/g,''),_0x5acb5e[_0x0ebc('0x17c')]);};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x18b')]=function(_0x132944){logger[_0x0ebc('0x2e')](util['format'](_0x0ebc('0x18c'),_0x132944['label']));return this[_0x0ebc('0xd')][_0x0ebc('0x18d')](_0x132944[_0x0ebc('0x63')][_0x0ebc('0x55')](/\s+/g,''),_0x132944[_0x0ebc('0x17c')]);};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x18e')]=function(_0xb85acf){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x18f'),_0xb85acf[_0x0ebc('0xaf')]));return this[_0x0ebc('0xd')][_0x0ebc('0x190')](_0xb85acf[_0x0ebc('0x58')],_0xb85acf[_0x0ebc('0x17c')]);};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x191')]=function(_0x544b78){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x544b78[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0x544b78[_0x0ebc('0x192')])){return this['channel'][_0x0ebc('0xaa')]('no\x20mail\x20account\x20configured');}var _0x2478e1=this['getMailAccount'][_0x0ebc('0xa6')](this,_0x544b78['account_id']);if(!_0x2478e1||!_0x2478e1[_0x0ebc('0x193')]){return this['channel'][_0x0ebc('0x4f')](_0x544b78,_0x0ebc('0x194'));}var _0x54410c={'from':util[_0x0ebc('0x29')](_0x0ebc('0x195'),_0x2478e1['name'],_0x2478e1[_0x0ebc('0x196')]||_0x2478e1['Smtp'][_0x0ebc('0x197')]),'to':_0x544b78['to']||'','cc':_0x544b78['cc']||'','bcc':_0x544b78[_0x0ebc('0x198')]||'','subject':_0x544b78[_0x0ebc('0x199')],'html':_0x544b78[_0x0ebc('0x58')],'text':_0x544b78[_0x0ebc('0x58')]};var _0x75eb73={'tls':{'rejectUnauthorized':![]}};if(_0x2478e1['Smtp']['service']){_0x75eb73[_0x0ebc('0x19a')]=_0x2478e1[_0x0ebc('0x193')][_0x0ebc('0x19a')];}else{_0x75eb73[_0x0ebc('0x19b')]=_0x2478e1[_0x0ebc('0x193')][_0x0ebc('0x19b')];_0x75eb73[_0x0ebc('0x19c')]=_0x2478e1[_0x0ebc('0x193')][_0x0ebc('0x19c')];_0x75eb73[_0x0ebc('0x19d')]=_0x2478e1['Smtp'][_0x0ebc('0x19d')];}if(_0x2478e1[_0x0ebc('0x193')][_0x0ebc('0x19e')]){_0x75eb73[_0x0ebc('0x19f')]={'user':_0x2478e1[_0x0ebc('0x193')]['user'],'pass':_0x2478e1[_0x0ebc('0x193')][_0x0ebc('0x1a0')]};}if(this[_0x0ebc('0x85')](_0x544b78[_0x0ebc('0x1a1')])){}logger[_0x0ebc('0x1a2')](_0x0ebc('0x1a3'),JSON[_0x0ebc('0x72')](_0x54410c));this[_0x0ebc('0x36')][_0x0ebc('0xa6')](this,_0x544b78,_0x544b78[_0x0ebc('0x192')]);this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0x1a4'),_0x2478e1[_0x0ebc('0x13')]));this[_0x0ebc('0x23')][_0x0ebc('0xa6')](this,_0x75eb73,_0x54410c);return this['channel'][_0x0ebc('0xaa')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x1a5')]=function(_0x505605){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x1a6'),_0x505605['label']));return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](_0x0ebc('0x1a7'));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x1a8')]=function(_0x14cdc0){logger[_0x0ebc('0x2e')](util['format'](_0x0ebc('0x1a9'),_0x14cdc0[_0x0ebc('0xaf')]));if(!this[_0x0ebc('0x85')](_0x14cdc0[_0x0ebc('0x1aa')])){return this[_0x0ebc('0xd')][_0x0ebc('0xaa')]('no\x20sms\x20account\x20configured');}var _0x432f2a=this[_0x0ebc('0x33')][_0x0ebc('0xa6')](this,_0x14cdc0[_0x0ebc('0x1aa')]);if(!_0x432f2a){return this['channel'][_0x0ebc('0x4f')](_0x14cdc0,_0x0ebc('0x1ab'));}var _0x467036={'body':_0x14cdc0[_0x0ebc('0x1ac')],'phone':_0x14cdc0['to']||'','SmsAccountId':_0x432f2a['id']};logger[_0x0ebc('0x1a2')](_0x0ebc('0x1ad'),JSON[_0x0ebc('0x72')](_0x467036));this[_0x0ebc('0x36')][_0x0ebc('0xa6')](this,_0x14cdc0,_0x14cdc0[_0x0ebc('0x1aa')]);this['channel']['noop'](util['format'](_0x0ebc('0x1ae'),_0x432f2a['name']));this[_0x0ebc('0x35')][_0x0ebc('0xa6')](this,_0x467036);return this['channel']['noop'](_0x0ebc('0x1af'));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x1b0')]=function(_0xbcb5ce){logger['info'](util[_0x0ebc('0x29')](_0x0ebc('0x1b1'),_0xbcb5ce['label']));if(!this[_0x0ebc('0x85')](_0xbcb5ce[_0x0ebc('0xd9')])){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0xbcb5ce,_0x0ebc('0x1b2'));}var _0x133e43=this[_0x0ebc('0x10')][_0x0ebc('0xa6')](this,_0xbcb5ce[_0x0ebc('0xd9')]);if(!_0x133e43){return this[_0x0ebc('0xd')]['error'](_0xbcb5ce,_0x0ebc('0xdb'));}return this['channel'][_0x0ebc('0x9f')](_0x133e43,_0xbcb5ce[_0x0ebc('0x1b3')]);};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x1b4')]=function(_0x52a36a){logger['info'](util['format'](_0x0ebc('0x1b5'),_0x52a36a['label']));this[_0x0ebc('0xd')][_0x0ebc('0xaa')](_0x0ebc('0x1b6'));if(_0x52a36a['answer']==='yes'){this[_0x0ebc('0xd')][_0x0ebc('0xaa')](_0x0ebc('0x1b7'));return this['channel']['answer']();}return this[_0x0ebc('0xd')]['noop'](_0x0ebc('0x1b8'));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x1b9')]=function(_0x1628e7){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x1628e7[_0x0ebc('0xaf')]));if(!this['isConfigured'](_0x1628e7[_0x0ebc('0x1ba')])){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x1628e7,'no\x20subproject\x20selected');}var _0x4d4e65=this[_0x0ebc('0x18')][_0x0ebc('0xa6')](this,_0x1628e7[_0x0ebc('0x1ba')]);if(!this[_0x0ebc('0x85')](_0x4d4e65)){return this[_0x0ebc('0xd')]['error'](_0x1628e7,util['format'](_0x0ebc('0x1bb'),_0x1628e7[_0x0ebc('0x1ba')]));}if(_0x4d4e65===this[_0x0ebc('0xd')][_0x0ebc('0x38')]){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x1628e7,_0x0ebc('0x1bc'));}this[_0x0ebc('0x36')][_0x0ebc('0xa6')](this,_0x1628e7,_0x4d4e65);var _0xb488cf=this[_0x0ebc('0xd')][_0x0ebc('0xab')](_0x0ebc('0x1bd'),util[_0x0ebc('0x29')](_0x0ebc('0x1be'),config[_0x0ebc('0x9')][_0x0ebc('0x19b')]||_0x0ebc('0x1bf'),_0x4d4e65,this['channel'][_0x0ebc('0x38')]));if(_0xb488cf[_0x0ebc('0xa3')]===-0x1){return _0xb488cf;}return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util['format'](_0x0ebc('0x16d'),_0x0ebc('0x1bd'),_0x4d4e65));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x1c0')]=function(_0x3a9eb5){logger['info'](util[_0x0ebc('0x29')](_0x0ebc('0x1c1'),_0x3a9eb5['label']));var _0x75e251=this[_0x0ebc('0x1c2')]['sync'](this,_0x3a9eb5['command']);this[_0x0ebc('0x36')][_0x0ebc('0xa6')](this,_0x3a9eb5,_0x3a9eb5[_0x0ebc('0x1c3')]);if(this[_0x0ebc('0x85')](_0x3a9eb5[_0x0ebc('0xd9')])){var _0x3b0e8b=this[_0x0ebc('0x10')][_0x0ebc('0xa6')](this,_0x3a9eb5['variable_id']);if(_0x3b0e8b){this[_0x0ebc('0xd')]['setVariable'](_0x3b0e8b,_0x75e251);return this[_0x0ebc('0xd')]['noop'](util[_0x0ebc('0x29')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x3a9eb5[_0x0ebc('0x1c3')],_0x3b0e8b));}}return this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0x1c4'),_0x3a9eb5['command']));};AGIVertices[_0x0ebc('0x15')]['google_cloud_tts']=function(_0x1f35c5){logger['info'](util[_0x0ebc('0x29')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x1f35c5[_0x0ebc('0xaf')]));_0x1f35c5[_0x0ebc('0x58')]=_0x1f35c5[_0x0ebc('0x58')][_0x0ebc('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0ebc('0x85')](_0x1f35c5[_0x0ebc('0x57')])){return this['channel'][_0x0ebc('0xaa')](_0x0ebc('0x1c5'));}if(!this[_0x0ebc('0x85')](_0x1f35c5[_0x0ebc('0x58')])){return this['channel']['noop'](_0x0ebc('0xc8'));}this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0x1c6'),_0x1f35c5['text']));var _0x460c5a=this[_0x0ebc('0x56')]['sync'](this,_0x1f35c5);if(_0x460c5a){this[_0x0ebc('0xd')]['noop'](util[_0x0ebc('0x29')](_0x0ebc('0x1c7'),_0x460c5a));var _0x48811b=this['channel'][_0x0ebc('0x102')](_0x460c5a);try{fs[_0x0ebc('0x1c8')](_0x460c5a+'.wav');}catch(_0x4ae0e4){logger[_0x0ebc('0x4f')](_0x4ae0e4);}return _0x48811b;}return this['channel'][_0x0ebc('0x4f')](_0x1f35c5,_0x0ebc('0x1c9'));};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x1ca')]=function(_0x3ba898){logger['info'](util[_0x0ebc('0x29')](_0x0ebc('0x1cb'),_0x3ba898[_0x0ebc('0xaf')]));_0x3ba898[_0x0ebc('0x58')]=_0x3ba898[_0x0ebc('0x58')][_0x0ebc('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0ebc('0x85')](_0x3ba898[_0x0ebc('0x58')])){return this['channel']['noop'](_0x0ebc('0xc8'));}this[_0x0ebc('0xd')][_0x0ebc('0xaa')](util['format'](_0x0ebc('0x1cc'),_0x3ba898[_0x0ebc('0x58')]));var _0x20c126=this[_0x0ebc('0x5f')][_0x0ebc('0xa6')](this,_0x3ba898);if(_0x20c126){this['channel'][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0x1cd'),_0x20c126));var _0x38f5c5=this[_0x0ebc('0xd')][_0x0ebc('0x102')](_0x20c126);try{fs[_0x0ebc('0x1c8')](_0x20c126+_0x0ebc('0x103'));}catch(_0x10ba4e){logger[_0x0ebc('0x4f')](_0x10ba4e);}return _0x38f5c5;}return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x3ba898,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x0ebc('0x1ce')]=function(_0xb93adb){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x1cf'),_0xb93adb['label']));if(!this['isConfigured'](_0xb93adb[_0x0ebc('0x157')])){return this[_0x0ebc('0xd')]['error'](_0xb93adb,'no\x20find\x20by\x20configured');}logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x156'),this['channel'][_0x0ebc('0x39')],_0xb93adb[_0x0ebc('0x157')]));var _0x533de6=this['agentUnpause']['sync'](this,_0xb93adb[_0x0ebc('0x157')]);if(_0x533de6){logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0xb93adb[_0x0ebc('0x157')]));this['channel'][_0x0ebc('0xaa')](util[_0x0ebc('0x29')](_0x0ebc('0x158'),this[_0x0ebc('0xd')][_0x0ebc('0x39')],_0xb93adb[_0x0ebc('0x157')]));return{'code':0xc8,'result':_0x0ebc('0x159')};}else{logger[_0x0ebc('0x2e')](util[_0x0ebc('0x29')](_0x0ebc('0x15a'),this['channel'][_0x0ebc('0x39')],_0xb93adb[_0x0ebc('0x157')]));this['channel']['noop'](util[_0x0ebc('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0ebc('0xd')][_0x0ebc('0x39')],_0xb93adb[_0x0ebc('0x157')]));return{'code':0xc8,'result':_0x0ebc('0x15b')};}};AGIVertices[_0x0ebc('0x15')][_0x0ebc('0x1d0')]=function(_0x1fc168){logger['info'](util[_0x0ebc('0x29')](_0x0ebc('0x1d1'),_0x1fc168[_0x0ebc('0xaf')]));var _0x3f4dd0=this[_0x0ebc('0xd')]['exec'](_0x0ebc('0x1d2'),[_0x1fc168[_0x0ebc('0x1d3')],_0x1fc168[_0x0ebc('0x77')]]);if(_0x3f4dd0[_0x0ebc('0xa3')]===-0x1){return _0x3f4dd0;}return this['channel']['noop'](util[_0x0ebc('0x29')]('Executed\x20command\x20%s\x20%s',_0x0ebc('0x1d2'),_0x1fc168[_0x0ebc('0x1d3')]));};AGIVertices['prototype'][_0x0ebc('0x1d4')]=function(_0x336851){logger['info'](util[_0x0ebc('0x29')](_0x0ebc('0x1d5'),_0x336851[_0x0ebc('0xaf')]));if(!this['isConfigured'](_0x336851[_0x0ebc('0xd9')])){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x336851,_0x0ebc('0x1b2'));}var _0x517a73=this['getVariable'][_0x0ebc('0xa6')](this,_0x336851[_0x0ebc('0xd9')]);if(!_0x517a73){return this[_0x0ebc('0xd')][_0x0ebc('0x4f')](_0x336851,_0x0ebc('0xdb'));}var _0x50bf31=this[_0x0ebc('0xd')][_0x0ebc('0x10')](_0x517a73);return{'code':0xc8,'result':_0x50bf31['extra']?_0x50bf31[_0x0ebc('0xa1')]:'-'};};String[_0x0ebc('0x15')]['replaceAll']=function(_0x55c57a,_0x477db3){return this['split'](_0x55c57a)['join'](_0x477db3);};module[_0x0ebc('0x1d6')]=AGIVertices; \ No newline at end of file +var _0xd1bd=['isNil','callback_','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','headers','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','tildeASR','appid','clear','agicommand','clone','hasOwnProperty','isString','includes','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','isPlainObject','%s.%s','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','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','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','DIAL','SIP/%s','opts','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','DIALOGFLOW_%s','speech','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20password\x20configured','ndassistant_url','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','substr','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','Enter\x20in\x20GOTO\x20(%s)\x20block','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','failure','no\x20operation\x20configured','operation','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','agentPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','Smtp','no\x20mail\x20account\x20found','email','user','bcc','service','host','port','secure','auth','pass','sendMail\x20message','account_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','path','util','lodash','shelljs','odbc','moment','mustache','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','map','Intervals','interval','format','getQueryOdbc','open','error','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xd1bd,0x184));var _0xdd1b=function(_0x18bd2a,_0x3f93f0){_0x18bd2a=_0x18bd2a-0x0;var _0x546f18=_0xd1bd[_0x18bd2a];return _0x546f18;};'use strict';var fs=require('fs');var path=require(_0xdd1b('0x0'));var util=require(_0xdd1b('0x1'));var _=require(_0xdd1b('0x2'));var sh=require(_0xdd1b('0x3'));var odbc=require(_0xdd1b('0x4'))();var rs=require('randomstring');var moment=require(_0xdd1b('0x5'));var Mustache=require(_0xdd1b('0x6'));var rp=require('request-promise');var logger=require(_0xdd1b('0x7'))(_0xdd1b('0x8'));var config=require(_0xdd1b('0x9'));var scripts=require('./scripts');var FILES_PATH=_0xdd1b('0xa');var recursiveMapAttributes=[_0xdd1b('0xb'),_0xdd1b('0xc')];var verticesWithRetry=[_0xdd1b('0xd'),_0xdd1b('0xe'),_0xdd1b('0xf')];var AGIVertices=function(_0x547012,_0x94bef1,_0x16240b){this[_0xdd1b('0x10')]=_0x547012;this[_0xdd1b('0x11')]=_0x94bef1;this[_0xdd1b('0x12')]=_0x16240b;};AGIVertices[_0xdd1b('0x13')]['getVariable']=function(_0x3d0650,_0x599956){this[_0xdd1b('0x11')]['getVariableById'](_0x3d0650)['then'](function(_0x6831a3){_0x599956(null,_0x6831a3?_0x6831a3[_0xdd1b('0x14')]:![]);})[_0xdd1b('0x15')](function(_0x2ecff8){_0x599956(_0x2ecff8);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x16')]=function(_0x25b70a,_0x3e041d){this[_0xdd1b('0x11')][_0xdd1b('0x17')](_0x25b70a)[_0xdd1b('0x18')](function(_0x1cf7ad){_0x3e041d(null,_0x1cf7ad?_0x1cf7ad['name']:![]);})[_0xdd1b('0x15')](function(_0x39de1a){_0x3e041d(_0x39de1a);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x19')]=function(_0x20d7e3,_0x588dfd){this[_0xdd1b('0x11')]['getSquareProjectById'](_0x20d7e3)[_0xdd1b('0x18')](function(_0xd36475){_0x588dfd(null,_0xd36475?_0xd36475[_0xdd1b('0x14')]:![]);})['catch'](function(_0xf0e7c2){_0x588dfd(_0xf0e7c2);});};AGIVertices['prototype'][_0xdd1b('0x1a')]=function(_0x2386c2,_0x21ed00){this[_0xdd1b('0x11')][_0xdd1b('0x1b')](_0x2386c2)[_0xdd1b('0x18')](function(_0x538526){_0x21ed00(null,_0x538526?_0x538526[_0xdd1b('0x1c')]:![]);})['catch'](function(_0x2b59b7){_0x21ed00(_0x2b59b7);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x1d')]=function(_0x22c61b,_0x3056aa){this[_0xdd1b('0x11')][_0xdd1b('0x1e')](_0x22c61b)[_0xdd1b('0x18')](function(_0x5e1601){_0x3056aa(null,_0x5e1601?_0x5e1601['name']:![]);})[_0xdd1b('0x15')](function(_0x33fe6c){_0x3056aa(_0x33fe6c);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x1f')]=function(_0x2e399f,_0x2174a2){this[_0xdd1b('0x11')][_0xdd1b('0x20')](_0x2e399f)[_0xdd1b('0x18')](function(_0x18f15e){_0x2174a2(null,_0x18f15e?_0x18f15e[_0xdd1b('0x14')]:![]);})['catch'](function(_0x46b072){_0x2174a2(_0x46b072);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x21')]=function(_0xfd8ceb,_0x3e5c82){var _0x5bf67e=this;this['rpc'][_0xdd1b('0x22')](_0xfd8ceb)[_0xdd1b('0x18')](function(_0x205bc1){_0x3e5c82(null,_0x205bc1?_0x5bf67e[_0xdd1b('0x23')](_0x205bc1['save_name']):![]);})[_0xdd1b('0x15')](function(_0x62aa3e){_0x3e5c82(_0x62aa3e);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x24')]=function(_0x113e7b,_0x29f15a){this[_0xdd1b('0x11')][_0xdd1b('0x25')](_0x113e7b)[_0xdd1b('0x18')](function(_0x59a1c7){_0x29f15a(null,_0x59a1c7?_0x59a1c7:![]);})[_0xdd1b('0x15')](function(_0x181f27){_0x29f15a(_0x181f27);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x26')]=function(_0x4429f4,_0x58b86d,_0x3a1f18){this['mailRpc'][_0xdd1b('0x26')](_0x4429f4,_0x58b86d)[_0xdd1b('0x18')](function(){_0x3a1f18(null);})['catch'](function(_0x29e7a5){_0x3a1f18(_0x29e7a5);});};AGIVertices['prototype'][_0xdd1b('0x27')]=function(_0x1796f9,_0x2e1315){this[_0xdd1b('0x11')][_0xdd1b('0x28')](_0x1796f9)[_0xdd1b('0x18')](function(_0x587286){if(_0x587286){if(_0x587286['IntervalId']){_0x2e1315(null,[_0x587286['interval']]);}else{_0x2e1315(null,_[_0xdd1b('0x29')](_0x587286[_0xdd1b('0x2a')],_0xdd1b('0x2b')));}}else{_0x2e1315(null,![]);}})[_0xdd1b('0x15')](function(_0x1ff68e){_0x2e1315(_0x1ff68e);});};AGIVertices[_0xdd1b('0x13')]['getSoundPath']=function(_0x477ed3){return util[_0xdd1b('0x2c')]('%s/sounds/converted/%s',FILES_PATH,_0x477ed3);};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x2d')]=function(_0x21b93b,_0x39ee37,_0x24faf4){odbc[_0xdd1b('0x2e')](_0x21b93b,function(_0x59548f){if(_0x59548f){logger[_0xdd1b('0x2f')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x59548f);_0x24faf4(_0x59548f);}else{logger[_0xdd1b('0x30')]('ODBC\x20connection\x20successfully');odbc['query'](_0x39ee37,function(_0x241b5d,_0x2d5b73){if(_0x241b5d){logger[_0xdd1b('0x30')](_0xdd1b('0x31'),_0x39ee37);_0x24faf4(_0x241b5d);}else{logger['info'](_0xdd1b('0x32'),_0x39ee37);odbc[_0xdd1b('0x33')](function(_0x512981){if(_0x512981){logger[_0xdd1b('0x2f')](_0xdd1b('0x34'),_0x512981);}_0x24faf4(null,_0x2d5b73);});}});}});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x35')]=function(_0x1049d0,_0x13e5d6){this['rpc']['getSmsAccountById'](_0x1049d0)[_0xdd1b('0x18')](function(_0x33a320){_0x13e5d6(null,_0x33a320?_0x33a320:![]);})[_0xdd1b('0x15')](function(_0x23c440){_0x13e5d6(_0x23c440);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x36')]=function(_0x32386c,_0x111c8a){this['rpc'][_0xdd1b('0x36')](_0x32386c)[_0xdd1b('0x18')](function(_0x4d705f){_0x111c8a(null,_0x4d705f);})[_0xdd1b('0x15')](function(_0x54497e){_0x111c8a(_0x54497e);});};AGIVertices[_0xdd1b('0x13')]['createSquareDetailsReport']=function(_0x211782,_0x217a47,_0x21fb20){this[_0xdd1b('0x11')][_0xdd1b('0x37')]({'uniqueid':this['channel']['uniqueid'],'node':_0x211782['label'],'application':_0x211782['agicommand'],'data':_0x217a47||null,'project_name':this['channel'][_0xdd1b('0x38')],'callerid':this[_0xdd1b('0x10')][_0xdd1b('0x39')]})[_0xdd1b('0x18')](function(_0x104c14){if(_0x21fb20){_0x21fb20(null,_0x104c14);}})['catch'](function(_0x41bd0e){if(_0x21fb20){_0x21fb20(_0x41bd0e);}});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x3a')]=function(_0x562418,_0x5d5ff2,_0x4f6ddf,_0x1d3cd4){this[_0xdd1b('0x11')][_0xdd1b('0x3a')]({'uniqueid':this[_0xdd1b('0x10')][_0xdd1b('0x3b')],'callerid':this[_0xdd1b('0x10')][_0xdd1b('0x39')],'calleridname':this[_0xdd1b('0x10')][_0xdd1b('0x3c')],'context':this[_0xdd1b('0x10')][_0xdd1b('0x3d')],'extension':this[_0xdd1b('0x10')]['extension'],'priority':this[_0xdd1b('0x10')][_0xdd1b('0x3e')],'accountcode':this[_0xdd1b('0x10')][_0xdd1b('0x3f')],'dnid':this[_0xdd1b('0x10')]['dnid'],'projectName':this[_0xdd1b('0x10')][_0xdd1b('0x38')],'saveName':_0x5d5ff2,'filename':_0x562418[_0xdd1b('0x40')]||_0x5d5ff2,'savePath':_0x4f6ddf})['then'](function(_0x217ac2){_0x1d3cd4(null,_0x217ac2);})['catch'](function(_0x513783){_0x1d3cd4(_0x513783);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x41')]=function(_0x597125,_0x564123,_0x4119e7,_0x4533e6,_0x516032){this['rpc'][_0xdd1b('0x41')]({'uniqueid':this[_0xdd1b('0x10')][_0xdd1b('0x3b')],'body':_0x597125,'direction':_0x564123,'providerName':_0x4119e7,'providerResponse':_0x4533e6})['then'](function(_0x3b04fb){if(_0x516032){_0x516032(null,_0x3b04fb);}})['catch'](function(_0x3f5b49){if(_0x516032){_0x516032(_0x3f5b49);}});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x42')]=function(_0x45cb2e,_0x235893){this[_0xdd1b('0x11')][_0xdd1b('0x42')]({'firstName':_[_0xdd1b('0x43')](_0x45cb2e[_0xdd1b('0x14')])||_[_0xdd1b('0x44')](_0x45cb2e[_0xdd1b('0x14')])?_0xdd1b('0x45')+Math['random']():_0x45cb2e[_0xdd1b('0x14')],'lastName':_['isEmpty'](_0x45cb2e[_0xdd1b('0x46')])||_[_0xdd1b('0x44')](_0x45cb2e[_0xdd1b('0x46')])?null:_0x45cb2e['lastName'],'phone':_0x45cb2e[_0xdd1b('0x47')],'ListId':_0x45cb2e[_0xdd1b('0x48')],'scheduledat':_0x45cb2e['scheduledAt'],'callbackUniqueid':this[_0xdd1b('0x10')][_0xdd1b('0x3b')],'tags':_0xdd1b('0x49'),'description':_0xdd1b('0x4a')+_0x45cb2e[_0xdd1b('0x4b')][_0xdd1b('0x4c')](),'priority':_0x45cb2e[_0xdd1b('0x4d')]})[_0xdd1b('0x18')](function(_0x4052c0){_0x235893(null,_0x4052c0);})[_0xdd1b('0x15')](function(_0x17e37d){_0x235893(_0x17e37d);});};AGIVertices['prototype'][_0xdd1b('0x4e')]=function(_0x5bfa01,_0x2fce77){this['rpc'][_0xdd1b('0x4f')](_0x5bfa01)['then'](function(_0x5659e8){_0x2fce77(null,_0x5659e8?_0x5659e8[_0xdd1b('0x14')]:![]);})[_0xdd1b('0x15')](function(_0x209409){_0x2fce77(_0x209409);});};AGIVertices[_0xdd1b('0x13')]['agentPause']=function(_0x1eb060,_0x6e8ff4,_0x19d96f){var _0x52f586={'role':_0xdd1b('0x50')};_0x52f586[_0x1eb060]=this[_0xdd1b('0x10')]['callerid'];this['rpc']['agentPause'](_0x52f586,_0x6e8ff4,this['channel'][_0xdd1b('0x3b')])[_0xdd1b('0x18')](function(_0x4ff056){_0x19d96f(null,_[_0xdd1b('0x44')](_0x4ff056)?![]:!![]);})[_0xdd1b('0x15')](function(_0x4ae959){logger['error'](_0x4ae959);_0x19d96f(null,![]);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x51')]=function(_0x3918e6,_0x396d1c){var _0x307d39={'role':_0xdd1b('0x50')};_0x307d39[_0x3918e6]=this[_0xdd1b('0x10')][_0xdd1b('0x39')];this[_0xdd1b('0x11')][_0xdd1b('0x51')](_0x307d39)[_0xdd1b('0x18')](function(_0xedb772){_0x396d1c(null,_[_0xdd1b('0x44')](_0xedb772)?![]:!![]);})[_0xdd1b('0x15')](function(_0x12c966){logger['error'](_0x12c966);_0x396d1c(null,![]);});};AGIVertices['prototype'][_0xdd1b('0x52')]=function(_0x4e6b7e,_0x33cdd6){var _0x59a9ea={'role':'agent'};_0x59a9ea[_0x4e6b7e]=this[_0xdd1b('0x10')]['callerid'];this[_0xdd1b('0x11')]['agentLogout'](_0x59a9ea)[_0xdd1b('0x18')](function(_0x183a27){_0x33cdd6(null,_['isNil'](_0x183a27)?![]:!![]);})[_0xdd1b('0x15')](function(_0x2a7dbb){logger['error'](_0x2a7dbb);_0x33cdd6(null,![]);});};AGIVertices['prototype'][_0xdd1b('0x53')]=function(_0x72bcf1,_0x3a3663){var _0x1bd371={'role':_0xdd1b('0x50')};_0x1bd371[_0x72bcf1]=this[_0xdd1b('0x10')][_0xdd1b('0x39')];var _0x48318d=_0x72bcf1!='internal'?util[_0xdd1b('0x2c')](_0xdd1b('0x54'),_0xdd1b('0x55'),this[_0xdd1b('0x10')][_0xdd1b('0x39')]):undefined;this[_0xdd1b('0x11')][_0xdd1b('0x53')](_0x1bd371,_0x48318d)[_0xdd1b('0x18')](function(_0x4bf237){_0x3a3663(null,_[_0xdd1b('0x44')](_0x4bf237)?![]:!![]);})[_0xdd1b('0x15')](function(_0x56ead8){logger[_0xdd1b('0x2f')](_0x56ead8);_0x3a3663(null,![]);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x56')]=function(_0xd84b03,_0x1ca771){sh[_0xdd1b('0x57')](_[_0xdd1b('0x58')](_0xd84b03),function(_0x50c5c9,_0x31c34e){var _0x59b273=_0x31c34e[_0xdd1b('0x59')](/(\r\n|\n|\r)/gm,'');_0x1ca771(null,_0x59b273);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x5a')]=function(_0x5b538f,_0x5f9d6b){scripts[_0xdd1b('0x5a')](_0x5b538f[_0xdd1b('0x5b')],_0x5b538f[_0xdd1b('0x5c')]||_0xdd1b('0x5d'),_0x5b538f[_0xdd1b('0x5d')],_0x5b538f[_0xdd1b('0x5e')]||_0xdd1b('0x5f'),_0x5b538f[_0xdd1b('0x60')]||_0xdd1b('0x61'),_0x5b538f[_0xdd1b('0x62')]||_0xdd1b('0x63'))['then'](function(_0x569b63){_0x5f9d6b(null,_0x569b63);})['catch'](function(_0x281658){_0x5f9d6b(_0x281658);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x64')]=function(_0x47187a,_0x1b64c9){scripts['googleTTS'](_0x47187a['text'],_0x47187a[_0xdd1b('0x65')]||'en',0x1)[_0xdd1b('0x18')](function(_0x4cb75a){_0x1b64c9(null,_0x4cb75a);})[_0xdd1b('0x15')](function(_0x28a173){_0x1b64c9(_0x28a173);});};AGIVertices['prototype'][_0xdd1b('0x66')]=function(_0x3adb3c,_0x5c0863){var _0x3cf0e3={'uri':_0x3adb3c[_0xdd1b('0x67')],'method':_0x3adb3c[_0xdd1b('0x68')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3adb3c['timeout'])==='number'&&parseInt(_0x3adb3c[_0xdd1b('0x69')])>=0x1?parseInt(_0x3adb3c[_0xdd1b('0x69')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST',_0xdd1b('0x6a')],_0x3cf0e3['method'][_0xdd1b('0x6b')]())){try{_0x3cf0e3['body']=_0x3adb3c[_0xdd1b('0xc')]?JSON[_0xdd1b('0x6c')](_0x3adb3c['rawBody']):{};}catch(_0x5c9964){logger[_0xdd1b('0x2f')](_0xdd1b('0x6d'),_0x5c9964);}}try{_0x3cf0e3['headers']=_0x3adb3c[_0xdd1b('0xb')]?JSON[_0xdd1b('0x6c')](_0x3adb3c[_0xdd1b('0xb')]):{};}catch(_0x273167){logger[_0xdd1b('0x2f')](_0xdd1b('0x6e'),_0x273167);}if(_0x3adb3c[_0xdd1b('0x6f')]){try{var _0x3e7d74=require(_0x3adb3c[_0xdd1b('0x6f')])[_0xdd1b('0x70')](this,_0x3cf0e3);_0x3cf0e3[_0xdd1b('0x71')]=Mustache['render'](_0x3adb3c['url'],_0x3e7d74,{},['$$','$$']);if(_0x3cf0e3[_0xdd1b('0x72')]){_0x3cf0e3[_0xdd1b('0x72')]=JSON[_0xdd1b('0x6c')](Mustache[_0xdd1b('0x73')](JSON[_0xdd1b('0x74')](_0x3cf0e3['headers']),_0x3e7d74,{},['$$','$$']));}if(_0x3cf0e3[_0xdd1b('0x75')]){_0x3cf0e3[_0xdd1b('0x75')]=JSON[_0xdd1b('0x6c')](Mustache[_0xdd1b('0x73')](JSON[_0xdd1b('0x74')](_0x3cf0e3[_0xdd1b('0x75')]),_0x3e7d74,{},['$$','$$']));}}catch(_0x4a3083){logger['error'](_0xdd1b('0x76'),_0x4a3083);}}rp(_0x3cf0e3)[_0xdd1b('0x18')](function(_0x55eb8b){var _0x1293c6={'statusCode':_0x55eb8b['statusCode']||0xc8,'statusMessage':_0x55eb8b[_0xdd1b('0x77')]||'OK','headers':_0x55eb8b[_0xdd1b('0x72')]||{},'body':_0x55eb8b[_0xdd1b('0x75')]||{}};_0x5c0863(null,_0x1293c6);})[_0xdd1b('0x15')](function(_0x56c923){var _0x18352e={'statusCode':_0x56c923[_0xdd1b('0x78')]||0x1f4,'statusMessage':_0x56c923['message']||_0xdd1b('0x79'),'headers':_0x56c923[_0xdd1b('0x7a')]['headers']||{},'body':_0x56c923[_0xdd1b('0x7a')][_0xdd1b('0x75')]||{}};_0x5c0863(null,_0x18352e);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x7b')]=function(_0x2a18c3,_0x1f5285){scripts[_0xdd1b('0x7b')](this[_0xdd1b('0x10')][_0xdd1b('0x3b')],_0x2a18c3[_0xdd1b('0x7c')],_0x2a18c3[_0xdd1b('0x5d')],_0x2a18c3[_0xdd1b('0x7d')]||'en')['then'](function(_0x2d8b49){_0x1f5285(null,_0x2d8b49);})[_0xdd1b('0x15')](function(_0x90eaf5){_0x1f5285(_0x90eaf5);});};AGIVertices[_0xdd1b('0x13')]['googleDialogflowV2']=function(_0x85ff5e,_0x4cf9cc){scripts[_0xdd1b('0x7e')](this['channel'][_0xdd1b('0x3b')],_0x85ff5e[_0xdd1b('0x7f')],_0x85ff5e[_0xdd1b('0x80')],_0x85ff5e[_0xdd1b('0x81')],_0x85ff5e['text'],_0x85ff5e[_0xdd1b('0x82')]||'en')[_0xdd1b('0x18')](function(_0x10d36d){_0x4cf9cc(null,_0x10d36d);})[_0xdd1b('0x15')](function(_0x2505fb){_0x4cf9cc(_0x2505fb);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x83')]=function(_0x495ebe,_0x97df66){scripts[_0xdd1b('0x83')](this[_0xdd1b('0x10')],_0x495ebe)[_0xdd1b('0x18')](function(_0x3345f2){_0x97df66(null,_0x3345f2);})[_0xdd1b('0x15')](function(_0x3a8f82){_0x97df66(_0x3a8f82);});};AGIVertices['prototype']['ispeechTTS']=function(_0x1fadd5,_0x515650){scripts[_0xdd1b('0x84')](_0x1fadd5['key'],_0x1fadd5[_0xdd1b('0x5d')],_0x1fadd5['ispeech_tts_language']||_0xdd1b('0x5f'),_0x1fadd5[_0xdd1b('0x85')])[_0xdd1b('0x18')](function(_0xffd76){_0x515650(null,_0xffd76);})[_0xdd1b('0x15')](function(_0xfd7ad7){_0x515650(_0xfd7ad7);});};AGIVertices[_0xdd1b('0x13')]['ispeechASR']=function(_0x3bf2d2,_0x3060d2,_0x2952b3){scripts[_0xdd1b('0x86')](_0x3060d2,_0x3bf2d2[_0xdd1b('0x7c')],_0x3bf2d2[_0xdd1b('0x87')]||'en-US',this['isConfigured'](_0x3bf2d2['model'])?_0x3bf2d2[_0xdd1b('0x88')]:undefined)[_0xdd1b('0x18')](function(_0x5215e5){_0x2952b3(null,_0x5215e5);})['catch'](function(_0x67780){_0x2952b3(_0x67780);});};AGIVertices['prototype'][_0xdd1b('0x89')]=function(_0x3088d4,_0x4eab82){scripts[_0xdd1b('0x89')](_0x3088d4[_0xdd1b('0x8a')],_0x3088d4[_0xdd1b('0x8b')],_0x3088d4[_0xdd1b('0x8c')],_0x3088d4[_0xdd1b('0x8d')]||_0xdd1b('0x8e'),_0x3088d4[_0xdd1b('0x5d')],_0x3088d4[_0xdd1b('0x8f')]||_0xdd1b('0x5d'))['then'](function(_0xbbef4a){_0x4eab82(null,_0xbbef4a);})[_0xdd1b('0x15')](function(_0x5030dd){_0x4eab82(_0x5030dd);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x90')]=function(_0x470f31,_0x41ffe2){scripts[_0xdd1b('0x90')](this['channel'][_0xdd1b('0x3b')],_0x470f31[_0xdd1b('0x8a')],_0x470f31[_0xdd1b('0x8b')],_0x470f31[_0xdd1b('0x91')],_0x470f31[_0xdd1b('0x5d')],_0x470f31['aws_bot_name'])['then'](function(_0x4c234c){_0x41ffe2(null,_0x4c234c);})[_0xdd1b('0x15')](function(_0xf493e){_0x41ffe2(_0xf493e);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x92')]=function(_0x55ed5a,_0xe9b165,_0x4aec05){scripts[_0xdd1b('0x92')](_0xe9b165,_0x55ed5a[_0xdd1b('0x7c')],_0x55ed5a['google_asr_language']||'en-US')[_0xdd1b('0x18')](function(_0x579e79){_0x4aec05(null,_0x579e79);})[_0xdd1b('0x15')](function(_0x81ce0f){_0x4aec05(_0x81ce0f);});};AGIVertices['prototype']['tildeASR']=function(_0x50413b,_0x4c80b0,_0x43bf5e){scripts[_0xdd1b('0x93')](_0x4c80b0,_0x50413b[_0xdd1b('0x94')],_0x50413b['appsecret'],_0x50413b['uri'])[_0xdd1b('0x18')](function(_0xb87ede){_0x43bf5e(null,_0xb87ede);})[_0xdd1b('0x15')](function(_0x3f6611){_0x43bf5e(_0x3f6611);});};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x95')]=function(_0xd8390f){var _0x7af50f=_['includes'](verticesWithRetry,_0xd8390f[_0xdd1b('0x96')])?_0xd8390f:_[_0xdd1b('0x97')](_0xd8390f);for(var _0x35aaec in _0x7af50f){if(_0x7af50f[_0xdd1b('0x98')](_0x35aaec)){if(_0x7af50f[_0x35aaec]&&_[_0xdd1b('0x99')](_0x7af50f[_0x35aaec])){if(_[_0xdd1b('0x9a')](recursiveMapAttributes,_0x35aaec)){_0x7af50f[_0x35aaec]=this[_0xdd1b('0x9b')](_0x7af50f[_0x35aaec]);}else{_0x7af50f[_0x35aaec]=this[_0xdd1b('0x9c')](_0x7af50f[_0x35aaec]);}}}}return _0x7af50f;};AGIVertices[_0xdd1b('0x13')]['recursiveNodeIndex']=function(_0x311df2){for(var _0x5d2959 in _0x311df2){if(_0x311df2['hasOwnProperty'](_0x5d2959)){if(_['isPlainObject'](_0x311df2[_0x5d2959])){this[_0xdd1b('0x9d')](_0x311df2[_0x5d2959]);}else if(_[_0xdd1b('0x9e')](_0x311df2[_0x5d2959])){for(var _0x488ac2=0x0;_0x488ac2<_0x311df2[_0x5d2959][_0xdd1b('0x9f')];_0x488ac2++){this[_0xdd1b('0x9d')](_0x311df2[_0x5d2959][_0x488ac2]);}}else if(_[_0xdd1b('0x99')](_0x311df2[_0x5d2959])){_0x311df2[_0x5d2959]=this[_0xdd1b('0x9c')](_0x311df2[_0x5d2959]);}}}};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0xa0')]=function(_0x117fa7,_0x1c561c){for(var _0x18e34a in _0x117fa7){if(_0x117fa7[_0xdd1b('0x98')](_0x18e34a)){if(_[_0xdd1b('0xa1')](_0x117fa7[_0x18e34a])){if(!_[_0xdd1b('0x43')](_0x117fa7[_0x18e34a])){this[_0xdd1b('0xa0')](_0x117fa7[_0x18e34a],util[_0xdd1b('0x2c')]('%s.%s',_0x1c561c,_0x18e34a));}}else if(_[_0xdd1b('0x9e')](_0x117fa7[_0x18e34a])){for(var _0x45c0cd=0x0;_0x45c0cd<_0x117fa7[_0x18e34a]['length'];_0x45c0cd++){this['saveRestApiResult'](_0x117fa7[_0x18e34a][_0x45c0cd],util[_0xdd1b('0x2c')](_0xdd1b('0xa2'),_0x1c561c,_0x18e34a+'['+_0x45c0cd+']'));}}else{if(!_[_0xdd1b('0x44')](_0x117fa7[_0x18e34a])){this['channel'][_0xdd1b('0xa3')](util['format'](_0xdd1b('0xa2'),_0x1c561c,_0x18e34a),_0x117fa7[_0x18e34a]);}}}}};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x9b')]=function(_0x48e7ce){try{var _0x379375=JSON[_0xdd1b('0x6c')](_0x48e7ce);this[_0xdd1b('0x9d')](_0x379375);return JSON[_0xdd1b('0x74')](_0x379375);}catch(_0x532949){return this[_0xdd1b('0x9c')](_0x48e7ce);}};AGIVertices['prototype'][_0xdd1b('0x9c')]=function(_0x313fed){var _0x31c0e4=_0x313fed[_0xdd1b('0xa4')]('{');for(var _0x3811a5=0x1;_0x3811a5<_0x31c0e4[_0xdd1b('0x9f')];_0x3811a5+=0x1){var _0x2f9881=_0x31c0e4[_0x3811a5][_0xdd1b('0xa4')]('}');if(_0x2f9881['length']>0x1){_0x313fed=_0x313fed[_0xdd1b('0xa5')]('{'+_0x2f9881[0x0]+'}',this[_0xdd1b('0x10')][_0xdd1b('0xa6')](_0x2f9881[0x0])[_0xdd1b('0xa7')]||_0x2f9881[0x0]);}}if(_0x31c0e4['length']===0x1){return _0x313fed[_0xdd1b('0x4c')]();}return this[_0xdd1b('0x9c')](_0x313fed);};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0xa8')]=function(_0xf8f395,_0x57ad90){var _0x470af7=this[_0xdd1b('0x10')][_0xdd1b('0xa6')](_0xf8f395);if(_0x470af7[_0xdd1b('0xa9')]===-0x1){return _0x470af7;}logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0xaa'),_0x57ad90,_0x470af7[_0xdd1b('0xa7')]));return this[_0xdd1b('0x10')][_0xdd1b('0xa3')](_0x57ad90,_0x470af7[_0xdd1b('0xa7')]);};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0xab')]=function(_0x515577){return _0x515577&&_0x515577!=='0'&&_0x515577!=='-1'&&_0x515577!=='';};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0xac')]=function(_0x3b435a){this[_0xdd1b('0x37')][_0xdd1b('0x70')](this,_0x3b435a,'-');_0x3b435a['retry']=_0x3b435a[_0xdd1b('0xac')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x173232){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0xad'),_0x173232[_0xdd1b('0xae')]));if(!this['isConfigured'](_0x173232[_0xdd1b('0x5d')])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0xb0'));}var _0x3d8ab8='\x22'+_0x173232[_0xdd1b('0x5d')]+'\x22';if(this['isConfigured'](_0x173232[_0xdd1b('0x7a')])){_0x3d8ab8+=','+_0x173232[_0xdd1b('0x7a')];}var _0x37db46=this[_0xdd1b('0x10')]['exec'](_0xdd1b('0xb1'),_0x3d8ab8);if(_0x37db46['result']===-0x1){return _0x37db46;}return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x3d8ab8));};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0xb2')]=function(_0x1904bd){logger['info'](util[_0xdd1b('0x2c')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x1904bd[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x1904bd[_0xdd1b('0xb3')])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0xb4'));}var _0x27e7fd=_0x1904bd['grammar'];if(this['isConfigured'](_0x1904bd[_0xdd1b('0x7a')])){_0x27e7fd+=','+_0x1904bd[_0xdd1b('0x7a')];}var _0x373b39=this[_0xdd1b('0x10')][_0xdd1b('0x57')](_0xdd1b('0xb5'),_0x27e7fd);if(_0x373b39[_0xdd1b('0xa9')]===-0x1){return _0x373b39;}var _0x582ebd=this[_0xdd1b('0xa8')]('RECOG_CONFIDENCE()',_0xdd1b('0xb6'));if(_0x582ebd[_0xdd1b('0xa9')]===-0x1){return _0x582ebd;}var _0x6aa610=this[_0xdd1b('0xa8')](_0xdd1b('0xb7'),_0xdd1b('0xb8'));if(_0x6aa610[_0xdd1b('0xa9')]===-0x1){return _0x6aa610;}var _0x1b93d0=this[_0xdd1b('0xa8')](_0xdd1b('0xb9'),_0xdd1b('0xba'));if(_0x1b93d0[_0xdd1b('0xa9')]===-0x1){return _0x1b93d0;}return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')]('Executed\x20command\x20MRCPRecog\x20%s',_0x27e7fd));};AGIVertices['prototype']['agi']=function(_0x546862){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0xbb'),_0x546862[_0xdd1b('0xae')]));return this[_0xdd1b('0x10')][_0xdd1b('0x8')]([_0x546862[_0xdd1b('0xbc')],_0x546862[_0xdd1b('0xbd')]]);};AGIVertices['prototype'][_0xdd1b('0xbe')]=function(_0x5c37b1){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0xbf'),_0x5c37b1[_0xdd1b('0xae')]));if(this['isConfigured'](_0x5c37b1['timeout'])){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0xc0'),_0x5c37b1[_0xdd1b('0x69')]));var _0xbf9848=this[_0xdd1b('0x10')][_0xdd1b('0xc1')](_0x5c37b1[_0xdd1b('0x69')]);if(_0xbf9848[_0xdd1b('0xa9')]===-0x1){return _0xbf9848;}}return this['channel']['answer']();};AGIVertices[_0xdd1b('0x13')]['callback']=function(_0x5489ec){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0xc2'),_0x5489ec[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x5489ec[_0xdd1b('0x48')])){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x5489ec,_0xdd1b('0xc3'));}_0x5489ec[_0xdd1b('0x4b')]=moment();if(this[_0xdd1b('0xab')](_0x5489ec[_0xdd1b('0xc4')])){_0x5489ec[_0xdd1b('0x4b')]=moment()['add'](_0x5489ec[_0xdd1b('0xc4')],'minutes');}if(!this[_0xdd1b('0xab')](_0x5489ec[_0xdd1b('0x4d')])){_0x5489ec[_0xdd1b('0x4d')]=0x2;}this[_0xdd1b('0x42')][_0xdd1b('0x70')](this,_0x5489ec);return this['channel'][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0xc5'),_0x5489ec['phone'],_0x5489ec[_0xdd1b('0x48')],_0x5489ec[_0xdd1b('0x4b')]));};AGIVertices[_0xdd1b('0x13')]['custom_app']=function(_0x429fcf){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0xc6'),_0x429fcf[_0xdd1b('0xae')]));var _0x243eab=this[_0xdd1b('0x10')][_0xdd1b('0x57')](_0x429fcf[_0xdd1b('0xc7')],_0x429fcf[_0xdd1b('0x7a')]);if(_0x243eab['result']===-0x1){return _0x243eab;}return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util['format'](_0xdd1b('0xc8'),_0x429fcf[_0xdd1b('0xc7')],_0x429fcf[_0xdd1b('0x7a')]));};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0xc9')]=function(_0x759448){logger['info'](util[_0xdd1b('0x2c')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x759448[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x759448[_0xdd1b('0x5d')])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')]('no\x20text\x20configured');}var _0x4ecde6='\x22'+_0x759448[_0xdd1b('0x5d')]+'\x22';if(this[_0xdd1b('0xab')](_0x759448[_0xdd1b('0x7a')])){_0x4ecde6+=','+_0x759448[_0xdd1b('0x7a')];}var _0x42406b=this[_0xdd1b('0x10')][_0xdd1b('0x57')](_0xdd1b('0xb1'),_0x4ecde6);if(_0x42406b[_0xdd1b('0xa9')]===-0x1){return _0x42406b;}return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4ecde6));};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0xca')]=function(_0x414d84){logger['info'](util[_0xdd1b('0x2c')](_0xdd1b('0xcb'),_0x414d84[_0xdd1b('0xae')]));if(!this['isConfigured'](_0x414d84[_0xdd1b('0x5d')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x958c82='\x22'+_0x414d84['text']+'\x22';if(this[_0xdd1b('0xab')](_0x414d84[_0xdd1b('0x7a')])){_0x958c82+=','+_0x414d84['options'];}var _0x50ce12=this[_0xdd1b('0x10')][_0xdd1b('0x57')](_0xdd1b('0xb1'),_0x958c82);if(_0x50ce12['result']===-0x1){return _0x50ce12;}return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x958c82));};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0xcc')]=function(_0x64a945){logger['info'](util[_0xdd1b('0x2c')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x64a945[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x64a945[_0xdd1b('0xb3')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x3ef641=_0x64a945[_0xdd1b('0xb3')];if(this[_0xdd1b('0xab')](_0x64a945[_0xdd1b('0x7a')])){_0x3ef641+=','+_0x64a945['options'];}var _0x310d0d=this[_0xdd1b('0x10')][_0xdd1b('0x57')]('MRCPRecog',_0x3ef641);if(_0x310d0d[_0xdd1b('0xa9')]===-0x1){return _0x310d0d;}var _0x1cd46f=this[_0xdd1b('0xa8')](_0xdd1b('0xcd'),_0xdd1b('0xce'));if(_0x1cd46f['result']===-0x1){return _0x1cd46f;}var _0x253b5a=this[_0xdd1b('0xa8')](_0xdd1b('0xb7'),_0xdd1b('0xcf'));if(_0x253b5a[_0xdd1b('0xa9')]===-0x1){return _0x253b5a;}var _0x4a0872=this[_0xdd1b('0xa8')](_0xdd1b('0xb9'),_0xdd1b('0xd0'));if(_0x4a0872[_0xdd1b('0xa9')]===-0x1){return _0x4a0872;}return this['channel'][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0xd1'),_0x3ef641));};AGIVertices[_0xdd1b('0x13')]['sestekasr']=function(_0x4b0561){logger['info'](util[_0xdd1b('0x2c')](_0xdd1b('0xd2'),_0x4b0561[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x4b0561[_0xdd1b('0xb3')])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0xb4'));}var _0x183117=_0x4b0561[_0xdd1b('0xb3')];if(this[_0xdd1b('0xab')](_0x4b0561[_0xdd1b('0x7a')])){_0x183117+=','+_0x4b0561[_0xdd1b('0x7a')];}var _0x3473b4=this[_0xdd1b('0x10')][_0xdd1b('0x57')](_0xdd1b('0xb5'),_0x183117);if(_0x3473b4[_0xdd1b('0xa9')]===-0x1){return _0x3473b4;}var _0x163318=this[_0xdd1b('0xa8')]('RECOG_CONFIDENCE()',_0xdd1b('0xd3'));if(_0x163318[_0xdd1b('0xa9')]===-0x1){return _0x163318;}var _0x41cde0=this[_0xdd1b('0xa8')](_0xdd1b('0xb7'),'SESTEK_ASR_TRANSCRIPT');if(_0x41cde0[_0xdd1b('0xa9')]===-0x1){return _0x41cde0;}var _0x18a86f=this['getAndSetVariable'](_0xdd1b('0xb9'),'SESTEK_ASR_INSTANCE');if(_0x18a86f[_0xdd1b('0xa9')]===-0x1){return _0x18a86f;}return this['channel'][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')]('Executed\x20command\x20MRCPRecog\x20%s',_0x183117));};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0xd4')]=function(_0x40c0b0){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0xd5'),_0x40c0b0['label']));if(!this[_0xdd1b('0xab')](_0x40c0b0[_0xdd1b('0xd6')])){return this['channel'][_0xdd1b('0x2f')](_0x40c0b0,_0xdd1b('0xd7'));}var _0x471793=this[_0xdd1b('0x1a')][_0xdd1b('0x70')](this,_0x40c0b0['odbc_id']);if(!_0x471793){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x40c0b0,_0xdd1b('0xd8'));}if(!this[_0xdd1b('0xab')](_0x40c0b0[_0xdd1b('0xd9')])){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x40c0b0,_0xdd1b('0xda'));}var _0x4e5524=_0x40c0b0[_0xdd1b('0xd9')][_0xdd1b('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util['format'](_0xdd1b('0xdb'),_0x4e5524));var _0x133bca=this['getQueryOdbc'][_0xdd1b('0x70')](this,_0x471793,_0x4e5524);this['createSquareDetailsReport']['sync'](this,_0x40c0b0,_0x4e5524);if(!this[_0xdd1b('0xab')](_0x40c0b0[_0xdd1b('0xdc')])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1edb8d=this[_0xdd1b('0xa6')]['sync'](this,_0x40c0b0[_0xdd1b('0xdc')]);if(!_0x1edb8d){return this['channel'][_0xdd1b('0x2f')](_0x40c0b0,_0xdd1b('0xdd'));}var _0x1de853=this;_0x133bca[_0xdd1b('0xde')](function(_0x2efde3,_0x3e34ee){Object[_0xdd1b('0xdf')](_0x2efde3)['forEach'](function(_0x2e57b8){_0x1de853[_0xdd1b('0x10')][_0xdd1b('0xa3')](util['format'](_0xdd1b('0xe0'),_0x1edb8d,_0x3e34ee,_0x2e57b8),_0x2efde3[_0x2e57b8]);});});this[_0xdd1b('0x10')]['setVariable'](util[_0xdd1b('0x2c')](_0xdd1b('0xe1'),_0x1edb8d),_0x133bca['length']);return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util['format'](_0xdd1b('0xe2'),_0x1edb8d));};AGIVertices['prototype'][_0xdd1b('0xe3')]=function(_0x232efa){logger[_0xdd1b('0xe4')](util['format'](_0xdd1b('0xe5'),_0x232efa['label']));if(!this[_0xdd1b('0xab')](_0x232efa['sip_id'])){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x232efa,_0xdd1b('0xe6'));}var _0x4c403c=this['getUser'][_0xdd1b('0x70')](this,_0x232efa[_0xdd1b('0xe7')]);if(!_0x4c403c){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x232efa,'no\x20user\x20found');}var _0x67eff8=this['channel'][_0xdd1b('0x57')](_0xdd1b('0xe8'),[util['format'](_0xdd1b('0xe9'),_0x4c403c),_0x232efa[_0xdd1b('0x69')],_0x232efa[_0xdd1b('0xea')],_0x232efa[_0xdd1b('0x67')]]);if(_0x67eff8[_0xdd1b('0xa9')]===-0x1){return _0x67eff8;}return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0xdd1b('0x13')]['dialogflow']=function(_0x37068b){logger['info'](util[_0xdd1b('0x2c')](_0xdd1b('0xeb'),_0x37068b['label']));if(!this[_0xdd1b('0xab')](_0x37068b[_0xdd1b('0x7c')])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0xec'));}if(!this[_0xdd1b('0xab')](_0x37068b['text'])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0xb0'));}this['channel']['bot']=!![];this[_0xdd1b('0x37')](_0x37068b);this['createSquareMessage'](_0x37068b[_0xdd1b('0x5d')],'in','','');this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')]('Trying\x20Dialogflow:\x20%s',_0x37068b[_0xdd1b('0x5d')]));var _0x104313=this[_0xdd1b('0x7b')][_0xdd1b('0x70')](this,_0x37068b);if(_0x104313){for(var _0x13ade7 in _0x104313){if(_0x104313[_0xdd1b('0x98')](_0x13ade7)){this[_0xdd1b('0x10')][_0xdd1b('0xa3')](util[_0xdd1b('0x2c')](_0xdd1b('0xed'),_0x13ade7['toUpperCase']()),_0x104313[_0x13ade7]);}}this[_0xdd1b('0x41')](_0x104313[_0xdd1b('0xee')],'out',_0xdd1b('0xef'),'');return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0xf0'),_0x104313[_0xdd1b('0xee')]));}return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x37068b,_0xdd1b('0xf1'));};AGIVertices['prototype'][_0xdd1b('0xf2')]=function(_0x276413){logger[_0xdd1b('0x30')](util['format'](_0xdd1b('0xf3'),_0x276413[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x276413[_0xdd1b('0x7f')])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0xf4'));}if(!this[_0xdd1b('0xab')](_0x276413[_0xdd1b('0x80')])){return this['channel'][_0xdd1b('0xaf')](_0xdd1b('0xf5'));}if(!this[_0xdd1b('0xab')](_0x276413[_0xdd1b('0x81')])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0xf6'));}if(!this[_0xdd1b('0xab')](_0x276413['dialogflowV2_language'])){return this[_0xdd1b('0x10')]['noop'](_0xdd1b('0xf7'));}if(!this[_0xdd1b('0xab')](_0x276413[_0xdd1b('0x5d')])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0xb0'));}this[_0xdd1b('0x10')][_0xdd1b('0xf8')]=!![];this[_0xdd1b('0x37')](_0x276413);this['createSquareMessage'](_0x276413[_0xdd1b('0x5d')],'in','','');this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util['format'](_0xdd1b('0xf9'),_0x276413[_0xdd1b('0x5d')]));var _0x1fa8d2=this[_0xdd1b('0x7e')][_0xdd1b('0x70')](this,_0x276413);if(_0x1fa8d2){for(var _0x1e756d in _0x1fa8d2){if(_0x1fa8d2[_0xdd1b('0x98')](_0x1e756d)){if(_0x1e756d!==_0xdd1b('0xfa')){this[_0xdd1b('0x10')][_0xdd1b('0xa3')](util[_0xdd1b('0x2c')]('DIALOGFLOW_%s',_0x1e756d['toUpperCase']()),_0x1fa8d2[_0x1e756d]);}}}this[_0xdd1b('0x41')](_0x1fa8d2[_0xdd1b('0xee')],_0xdd1b('0xfb'),_0xdd1b('0xf2'),_0x1fa8d2[_0xdd1b('0xfa')]);return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0xfc'),_0x1fa8d2[_0xdd1b('0xee')]));}return this['channel'][_0xdd1b('0x2f')](_0x276413,_0xdd1b('0xfd'));};AGIVertices['prototype'][_0xdd1b('0xfe')]=function(_0x42e5fb){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x42e5fb[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x42e5fb[_0xdd1b('0xff')])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0x100'));}if(!this['isConfigured'](_0x42e5fb['username'])){return this['channel'][_0xdd1b('0xaf')]('no\x20username\x20configured');}if(!this[_0xdd1b('0xab')](_0x42e5fb['password'])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0x101'));}if(!this[_0xdd1b('0xab')](_0x42e5fb[_0xdd1b('0x102')])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0xb0'));}this[_0xdd1b('0x10')][_0xdd1b('0xf8')]=!![];this['createSquareDetailsReport'](_0x42e5fb);this[_0xdd1b('0x41')](_0x42e5fb[_0xdd1b('0x5d')],'in','','');this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util['format']('Trying\x20SestekNDA:\x20%s',_0x42e5fb[_0xdd1b('0x5d')]));var _0x38ad44=this[_0xdd1b('0x83')][_0xdd1b('0x70')](this,_0x42e5fb);if(_0x38ad44){for(var _0x5c4a41 in _0x38ad44){if(_0x38ad44[_0xdd1b('0x98')](_0x5c4a41)){this[_0xdd1b('0x10')]['setVariable'](util[_0xdd1b('0x2c')]('SESTEK_NDA_%s',_0x5c4a41[_0xdd1b('0x6b')]()),_0x38ad44[_0x5c4a41]);}}this[_0xdd1b('0x41')](_0x38ad44['speech'],_0xdd1b('0xfb'),_0xdd1b('0xfe'),'');if(_0x38ad44[_0xdd1b('0x103')]){this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x38ad44[_0xdd1b('0x103')]));var _0x30550c=this[_0xdd1b('0x10')][_0xdd1b('0x104')](_0x38ad44[_0xdd1b('0x103')]);try{fs[_0xdd1b('0x105')](_0x38ad44[_0xdd1b('0x103')]+_0xdd1b('0x106'));}catch(_0xedb575){logger[_0xdd1b('0x2f')](_0xedb575);}return _0x30550c;}else{return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0x107'),_0x38ad44[_0xdd1b('0xee')]));}}return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x42e5fb,_0xdd1b('0x108'));};AGIVertices['prototype'][_0xdd1b('0x109')]=function(_0x5a0d49){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x10a'),_0x5a0d49[_0xdd1b('0xae')]));return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0x109'));};AGIVertices['prototype']['ext_dial']=function(_0x13130c){logger['info'](util[_0xdd1b('0x2c')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x13130c[_0xdd1b('0xae')]));var _0x24aca6='';if(_0x13130c[_0xdd1b('0x10b')]){if(!this[_0xdd1b('0xab')](_0x13130c['trunk_id'])){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x13130c,_0xdd1b('0x10c'));}else{var _0x52f802=parseInt(_0x13130c[_0xdd1b('0x10b')],0xa);if(isNaN(_0x52f802)){_0x24aca6=_0x13130c[_0xdd1b('0x10b')];}else{_0x24aca6=this['getTrunk'][_0xdd1b('0x70')](this,_0x13130c['trunk_id']);if(!_0x24aca6){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x13130c,_0xdd1b('0x10d'));}}}}else if(_0x13130c[_0xdd1b('0x10e')]){_0x24aca6=_0x13130c[_0xdd1b('0x10e')];}else{return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x13130c,_0xdd1b('0x10c'));}var _0x4eacd0=this['channel']['exec'](_0xdd1b('0xe8'),[util['format'](_0xdd1b('0x10f'),_0x24aca6,_0x13130c[_0xdd1b('0x47')]),_0x13130c[_0xdd1b('0x69')],_0x13130c['opts'],_0x13130c[_0xdd1b('0x67')]]);if(_0x4eacd0[_0xdd1b('0xa9')]===-0x1){return _0x4eacd0;}return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0x110'),_0xdd1b('0xe8')));};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x111')]=function(_0x548c58){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x112'),_0x548c58[_0xdd1b('0xae')]));return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0x111'));};AGIVertices['prototype'][_0xdd1b('0xe')]=function(_0x333253){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x333253[_0xdd1b('0xae')]));if(_0x333253[_0xdd1b('0x113')]===0x0){return this[_0xdd1b('0xac')](_0x333253);}_0x333253[_0xdd1b('0x113')]-=0x1;if(!this[_0xdd1b('0xab')](_0x333253[_0xdd1b('0x114')])){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x333253,_0xdd1b('0x115'));}var _0x5b0848=this[_0xdd1b('0x21')][_0xdd1b('0x70')](this,_0x333253[_0xdd1b('0x114')]);if(!_0x5b0848){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x333253,_0xdd1b('0x116'));}if(!this['isConfigured'](_0x333253[_0xdd1b('0xdc')])){return this['channel'][_0xdd1b('0x2f')](_0xdd1b('0x117'));}var _0x400ace=this[_0xdd1b('0x10')][_0xdd1b('0x118')](_0x5b0848,_0x333253[_0xdd1b('0x119')],_0x333253[_0xdd1b('0x11a')]);var _0x30210a=_0x400ace[_0xdd1b('0xa9')]?_0x400ace['result'][_0xdd1b('0x4c')]():'';logger['info'](_0xdd1b('0x11b'),JSON['stringify'](_0x400ace));if(_0x400ace[_0xdd1b('0xa9')]===-0x1){this['createSquareDetailsReport'][_0xdd1b('0x70')](this,_0x333253,_0x30210a);return _0x400ace;}else if(_0x400ace[_0xdd1b('0xa7')]===_0xdd1b('0x69')){_0x400ace[_0xdd1b('0xa9')]=_0x30210a[_0xdd1b('0x9f')]>=parseInt(_0x333253[_0xdd1b('0x11c')])?'x':'i';}else{_0x400ace[_0xdd1b('0xa9')]=_0x30210a[_0xdd1b('0x9f')]>=parseInt(_0x333253['mindigit'])&&_0x30210a[_0xdd1b('0x9f')]<=parseInt(_0x333253[_0xdd1b('0x11a')])?'x':'i';}var _0x2bbb37=this[_0xdd1b('0xa6')]['sync'](this,_0x333253[_0xdd1b('0xdc')]);if(!_0x2bbb37){return this['channel']['error'](_0x333253,'no\x20variable\x20found');}this[_0xdd1b('0x10')][_0xdd1b('0xa3')](_0x2bbb37,_0x30210a);if(this[_0xdd1b('0xab')](_0x333253[_0xdd1b('0x11d')])){var _0x446a17=parseInt(_0x333253['hiddendigitsnum'],0xa);var _0x2a6881=rs[_0xdd1b('0x11e')]({'charset':'*','length':_0x446a17});var _0x2939fe=_0x30210a[_0xdd1b('0x9f')];if(_0x2939fe>0x0){if(_0x2939fe>_0x446a17){this[_0xdd1b('0x37')][_0xdd1b('0x70')](this,_0x333253,_0x333253['hiddendigitspos']==='first'?_0x2a6881+_0x30210a['substr'](_0x446a17):_0x30210a[_0xdd1b('0x11f')](0x0,_0x2939fe-_0x446a17)+_0x2a6881);}else{this['createSquareDetailsReport'][_0xdd1b('0x70')](this,_0x333253,rs[_0xdd1b('0x11e')]({'charset':'*','length':_0x2939fe}));}}else{this[_0xdd1b('0x37')][_0xdd1b('0x70')](this,_0x333253,'');}}else{this[_0xdd1b('0x37')][_0xdd1b('0x70')](this,_0x333253,_0x30210a);}return _0x400ace;};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0xf')]=function(_0x534099){logger['info'](util[_0xdd1b('0x2c')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x534099[_0xdd1b('0xae')]));return this['getdigits'](_0x534099);};AGIVertices['prototype']['goal']=function(_0xb38d46){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0xb38d46[_0xdd1b('0xae')]));this[_0xdd1b('0x37')][_0xdd1b('0x70')](this,_0xb38d46,_0xb38d46['goalname']);return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0x120'),_0xb38d46['goalname']));};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x121')]=function(_0x171ab0){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x122'),_0x171ab0[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x171ab0[_0xdd1b('0x8a')])||!this[_0xdd1b('0xab')](_0x171ab0['aws_secret_access_key'])){return this[_0xdd1b('0x10')]['noop'](_0xdd1b('0x123'));}if(!this[_0xdd1b('0xab')](_0x171ab0[_0xdd1b('0x5d')])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0xb0'));}this['channel']['noop'](util[_0xdd1b('0x2c')](_0xdd1b('0x124'),_0x171ab0['text']));var _0x46fe30=this[_0xdd1b('0x89')]['sync'](this,_0x171ab0);if(_0x46fe30){this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0x125'),_0x46fe30));var _0x476332=this['channel'][_0xdd1b('0x104')](_0x46fe30);try{fs[_0xdd1b('0x105')](_0x46fe30+_0xdd1b('0x106'));}catch(_0x327df3){logger['error'](_0x327df3);}return _0x476332;}return this[_0xdd1b('0x10')]['error'](_0x171ab0,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xdd1b('0x13')]['awslex']=function(_0x184730){logger['info'](util[_0xdd1b('0x2c')](_0xdd1b('0x126'),_0x184730['label']));if(!this[_0xdd1b('0xab')](_0x184730[_0xdd1b('0x8a')])||!this[_0xdd1b('0xab')](_0x184730[_0xdd1b('0x8b')])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0x123'));}if(!this[_0xdd1b('0xab')](_0x184730[_0xdd1b('0x127')])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0x128'));}if(!this['isConfigured'](_0x184730[_0xdd1b('0x5d')])){return this[_0xdd1b('0x10')]['noop'](_0xdd1b('0xb0'));}this[_0xdd1b('0x10')]['bot']=!![];this[_0xdd1b('0x37')](_0x184730);this[_0xdd1b('0x41')](_0x184730[_0xdd1b('0x5d')],'in','','');this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0x129'),_0x184730[_0xdd1b('0x5d')]));var _0x228468=this['awsLex'][_0xdd1b('0x70')](this,_0x184730);if(_0x228468){for(var _0x447522 in _0x228468){if(_0x228468[_0xdd1b('0x98')](_0x447522)&&_[_0xdd1b('0x99')](_0x228468[_0x447522])){this[_0xdd1b('0x10')][_0xdd1b('0xa3')](util['format'](_0xdd1b('0x12a'),_0x447522[_0xdd1b('0x6b')]()),_0x228468[_0x447522]);}}if(_[_0xdd1b('0x44')](_0x228468[_0xdd1b('0x12b')])){return this['channel']['noop'](_0xdd1b('0x12c'));}else{this[_0xdd1b('0x41')](_0x228468['message'],_0xdd1b('0xfb'),_0xdd1b('0x12d'),'');return this[_0xdd1b('0x10')]['noop'](util[_0xdd1b('0x2c')](_0xdd1b('0x12e'),_0x228468[_0xdd1b('0x12b')]));}}return this['channel'][_0xdd1b('0x2f')](_0x184730,_0xdd1b('0x12f'));};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x130')]=function(_0xd8a87f){logger[_0xdd1b('0x30')](util['format'](_0xdd1b('0x131'),_0xd8a87f['label'],_0xd8a87f['timeout']));if(!this[_0xdd1b('0xab')](_0xd8a87f['key'])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0xec'));}var _0x2b5ba3=_0xdd1b('0x132');var _0x1fc4e0=util['format'](_0xdd1b('0x133'),FILES_PATH,rs['generate'](0x4));var _0x51b20b=util[_0xdd1b('0x2c')](_0xdd1b('0xa2'),_0x1fc4e0,_0x2b5ba3);var _0x378baa=!![];if(_0xd8a87f[_0xdd1b('0x134')]===_0xdd1b('0x135')){_0x378baa=![];}var _0xc2e75c=this[_0xdd1b('0x10')]['recordFile'](_0x1fc4e0,_0x2b5ba3,_0xd8a87f[_0xdd1b('0x136')],_0xd8a87f['timeout'],undefined,_0x378baa);if(_0xc2e75c[_0xdd1b('0xa9')]!==-0x1){this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0x137'),_0x51b20b));var _0x3d9039=this[_0xdd1b('0x92')][_0xdd1b('0x70')](this,_0xd8a87f,_0x51b20b);if(_0x3d9039){for(var _0x2b869f in _0x3d9039){if(_0x3d9039[_0xdd1b('0x98')](_0x2b869f)){this['channel'][_0xdd1b('0xa3')](util['format'](_0xdd1b('0x138'),_0x2b869f['toUpperCase']()),_0x3d9039[_0x2b869f]);}}return this['channel'][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')]('GoogleASR\x20Result\x20%s',JSON[_0xdd1b('0x74')](_0x3d9039)));}}return _0xc2e75c;};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x139')]=function(_0x93126){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x13a'),_0x93126[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x93126[_0xdd1b('0x94')])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0x13b'));}if(!this[_0xdd1b('0xab')](_0x93126['appsecret'])){return this['channel'][_0xdd1b('0xaf')]('no\x20appsecret\x20configured');}var _0x5ef6a3=_0xdd1b('0x132');var _0x346a53=util['format'](_0xdd1b('0x133'),FILES_PATH,rs['generate'](0x4));var _0x1caea9=util[_0xdd1b('0x2c')](_0xdd1b('0xa2'),_0x346a53,_0x5ef6a3);var _0x2ce490=!![];if(_0x93126[_0xdd1b('0x134')]===_0xdd1b('0x135')){_0x2ce490=![];}var _0x229f6b=this[_0xdd1b('0x10')][_0xdd1b('0x13c')](_0x346a53,_0x5ef6a3,_0x93126[_0xdd1b('0x136')],_0x93126[_0xdd1b('0x69')],undefined,_0x2ce490);if(_0x229f6b[_0xdd1b('0xa9')]!==-0x1){this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0x13d'),_0x1caea9));var _0x179ec9=this[_0xdd1b('0x93')][_0xdd1b('0x70')](this,_0x93126,_0x1caea9);if(_0x179ec9){for(var _0x5af159 in _0x179ec9){if(_0x179ec9[_0xdd1b('0x98')](_0x5af159)){this[_0xdd1b('0x10')][_0xdd1b('0xa3')](util[_0xdd1b('0x2c')](_0xdd1b('0x13e'),_0x5af159[_0xdd1b('0x6b')]()),_0x179ec9[_0x5af159]);}}return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')]('TildeASR\x20Result\x20%s',JSON[_0xdd1b('0x74')](_0x179ec9)));}}return _0x229f6b;};AGIVertices[_0xdd1b('0x13')]['gotoc']=function(_0x13c82d){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x13f'),_0x13c82d[_0xdd1b('0xae')]));return this[_0xdd1b('0x10')]['continueAt'](_0x13c82d[_0xdd1b('0x3d')],_0x13c82d[_0xdd1b('0x140')],_0x13c82d['priority']);};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x141')]=function(_0x22d27c){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x142'),_0x22d27c[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x22d27c[_0xdd1b('0x143')])){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x22d27c,_0xdd1b('0x144'));}try{var _0x459d06=eval(_0x22d27c[_0xdd1b('0x143')])?_0xdd1b('0x145'):_0xdd1b('0x146');this['channel'][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')]('EVAL\x20CONDITION\x20%s\x20%s',_0x22d27c[_0xdd1b('0x143')],_0x459d06));return{'code':0xc8,'result':_0x459d06};}catch(_0x51e9d6){return{'code':0xc8,'result':_0xdd1b('0x146')};}};AGIVertices[_0xdd1b('0x13')]['gotoiftime']=function(_0x377ad4){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x147'),_0x377ad4['label']));if(!this['isConfigured'](_0x377ad4[_0xdd1b('0x148')])){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x377ad4,'no\x20interval\x20configured');}var _0x1ca012=this[_0xdd1b('0x27')]['sync'](this,_0x377ad4['interval_id']);if(!_0x1ca012){return this[_0xdd1b('0x10')]['error'](_0x377ad4,_0xdd1b('0x149'));}for(var _0x39d85c=0x0;_0x39d85c<_0x1ca012[_0xdd1b('0x9f')];_0x39d85c+=0x1){var _0x45c0b7=this[_0xdd1b('0x10')][_0xdd1b('0xa6')](util[_0xdd1b('0x2c')](_0xdd1b('0x14a'),_0x1ca012[_0x39d85c]));if(_0x45c0b7[_0xdd1b('0xa9')]===-0x1){return _0x45c0b7;}logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x14b'),_0x1ca012[_0x39d85c],_0x45c0b7['extra']));if(_0x45c0b7[_0xdd1b('0xa7')]===_0xdd1b('0x145')){logger[_0xdd1b('0x30')](util['format'](_0xdd1b('0x14b'),_0x1ca012[_0x39d85c],_0xdd1b('0x145')));this['channel'][_0xdd1b('0xaf')](util['format'](_0xdd1b('0x14b'),_0x1ca012[_0x39d85c],_0xdd1b('0x145')));return{'code':0xc8,'result':_0xdd1b('0x145')};}else{logger[_0xdd1b('0x30')](util['format'](_0xdd1b('0x14b'),_0x1ca012[_0x39d85c],_0xdd1b('0x146')));this[_0xdd1b('0x10')]['noop'](util[_0xdd1b('0x2c')](_0xdd1b('0x14b'),_0x1ca012[_0x39d85c],'false'));}}return{'code':0xc8,'result':_0xdd1b('0x146')};};AGIVertices[_0xdd1b('0x13')]['hangup']=function(_0x23f5e9){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x23f5e9[_0xdd1b('0xae')]));return this[_0xdd1b('0x10')]['hangup']();};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x14c')]=function(_0x8f9405){logger['info'](util['format'](_0xdd1b('0x14d'),_0x8f9405[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x8f9405['key'])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0xec'));}var _0x5d12ec=_0xdd1b('0x132');var _0x3afa0e=util[_0xdd1b('0x2c')](_0xdd1b('0x133'),FILES_PATH,rs[_0xdd1b('0x11e')](0x4));var _0x42ce02=util[_0xdd1b('0x2c')](_0xdd1b('0xa2'),_0x3afa0e,_0x5d12ec);var _0x54f54b=!![];if(_0x8f9405['beep']===_0xdd1b('0x135')){_0x54f54b=![];}var _0x42de23=this['channel'][_0xdd1b('0x13c')](_0x3afa0e,_0x5d12ec,_0x8f9405[_0xdd1b('0x136')],_0x8f9405[_0xdd1b('0x69')],undefined,_0x54f54b);if(_0x42de23[_0xdd1b('0xa9')]!==-0x1){this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0x14e'),_0x42ce02));var _0x3fdea5=this['ispeechASR']['sync'](this,_0x8f9405,_0x42ce02);if(_0x3fdea5){for(var _0x446db0 in _0x3fdea5){if(_0x3fdea5['hasOwnProperty'](_0x446db0)){this[_0xdd1b('0x10')]['setVariable'](util[_0xdd1b('0x2c')](_0xdd1b('0x14f'),_0x446db0[_0xdd1b('0x6b')]()),_0x3fdea5[_0x446db0]);}}return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')]('IspeechASR\x20Result\x20%s',JSON[_0xdd1b('0x74')](_0x3fdea5)));}}return _0x42de23;};AGIVertices['prototype'][_0xdd1b('0x150')]=function(_0x500a57){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x151'),_0x500a57['label']));if(!this['isConfigured'](_0x500a57['key'])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0xec'));}if(!this[_0xdd1b('0xab')](_0x500a57['text'])){return this[_0xdd1b('0x10')]['noop']('no\x20text\x20configured');}this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x500a57[_0xdd1b('0x5d')]));var _0xca8987=this['ispeechTTS'][_0xdd1b('0x70')](this,_0x500a57);if(_0xca8987){this[_0xdd1b('0x10')]['noop'](util[_0xdd1b('0x2c')](_0xdd1b('0x14e'),_0xca8987));var _0x4967f7=this[_0xdd1b('0x10')][_0xdd1b('0x104')](_0xca8987,_0x500a57['intKey']);try{fs[_0xdd1b('0x105')](_0xca8987+'.wav');}catch(_0x16824d){logger[_0xdd1b('0x2f')](_0x16824d);}return _0x4967f7;}return this['channel'][_0xdd1b('0x2f')](_0x500a57,_0xdd1b('0x152'));};AGIVertices['prototype'][_0xdd1b('0x153')]=function(_0x45550b){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x154'),_0x45550b[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x45550b['findBy'])){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x45550b,_0xdd1b('0x155'));}logger['info'](util[_0xdd1b('0x2c')](_0xdd1b('0x156'),this[_0xdd1b('0x10')][_0xdd1b('0x39')],_0x45550b[_0xdd1b('0x157')]));var _0x53a037=this[_0xdd1b('0x53')]['sync'](this,_0x45550b['findBy']);if(_0x53a037){logger[_0xdd1b('0x30')](util['format'](_0xdd1b('0x158'),this[_0xdd1b('0x10')]['callerid'],_0x45550b[_0xdd1b('0x157')]));this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0x158'),this[_0xdd1b('0x10')]['callerid'],_0x45550b[_0xdd1b('0x157')]));return{'code':0xc8,'result':_0xdd1b('0x159')};}else{logger[_0xdd1b('0x30')](util['format'](_0xdd1b('0x15a'),this[_0xdd1b('0x10')]['callerid'],_0x45550b[_0xdd1b('0x157')]));this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x45550b['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xdd1b('0x15b')]=function(_0x135a6f){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x135a6f[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x135a6f[_0xdd1b('0x157')])){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x135a6f,'no\x20find\x20by\x20configured');}logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x156'),this[_0xdd1b('0x10')]['callerid'],_0x135a6f[_0xdd1b('0x157')]));var _0x12dd40=this[_0xdd1b('0x52')][_0xdd1b('0x70')](this,_0x135a6f[_0xdd1b('0x157')]);if(_0x12dd40){logger['info'](util[_0xdd1b('0x2c')](_0xdd1b('0x158'),this['channel'][_0xdd1b('0x39')],_0x135a6f[_0xdd1b('0x157')]));this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0x158'),this[_0xdd1b('0x10')][_0xdd1b('0x39')],_0x135a6f[_0xdd1b('0x157')]));return{'code':0xc8,'result':_0xdd1b('0x159')};}else{logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x15a'),this['channel'][_0xdd1b('0x39')],_0x135a6f['findBy']));this[_0xdd1b('0x10')]['noop'](util[_0xdd1b('0x2c')](_0xdd1b('0x15a'),this[_0xdd1b('0x10')][_0xdd1b('0x39')],_0x135a6f[_0xdd1b('0x157')]));return{'code':0xc8,'result':_0xdd1b('0x15c')};}};AGIVertices['prototype']['math']=function(_0x4cfc12){logger['info'](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x4cfc12[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x4cfc12['operation'])){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x4cfc12,_0xdd1b('0x15d'));}this['channel']['noop'](util['format']('math\x20%s',_0x4cfc12['operation']));var _0x1eb2ec=eval(_0x4cfc12[_0xdd1b('0x15e')]);if(!this[_0xdd1b('0xab')](_0x4cfc12[_0xdd1b('0xdc')])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1d651a=this['getVariable'][_0xdd1b('0x70')](this,_0x4cfc12['variable_id']);if(!_0x1d651a){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x4cfc12,_0xdd1b('0xdd'));}if(_[_0xdd1b('0x9e')](_0x1eb2ec)){var _0x31cfde=this;_0x1eb2ec['forEach'](function(_0x761c0f,_0x1598bf){_0x31cfde[_0xdd1b('0x10')]['setVariable'](util[_0xdd1b('0x2c')](_0xdd1b('0x15f'),_0x1d651a,_0x1598bf),_0x761c0f);});return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')]('variable\x20%s[key]\x20set',_0x1d651a));}else{return this[_0xdd1b('0x10')][_0xdd1b('0xa3')](_0x1d651a,_0x1eb2ec);}};AGIVertices['prototype'][_0xdd1b('0xd')]=function(_0x8b10d8){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x160'),_0x8b10d8[_0xdd1b('0xae')]));if(_0x8b10d8[_0xdd1b('0x113')]===0x0){return this[_0xdd1b('0xac')](_0x8b10d8);}_0x8b10d8['retry']-=0x1;if(!this['isConfigured'](_0x8b10d8[_0xdd1b('0x114')])){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x8b10d8,_0xdd1b('0x115'));}var _0x2b81db=this[_0xdd1b('0x21')][_0xdd1b('0x70')](this,_0x8b10d8[_0xdd1b('0x114')]);if(!_0x2b81db){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x8b10d8,'no\x20file\x20audio\x20found');}var _0x38e7cf=this[_0xdd1b('0x10')][_0xdd1b('0x118')](_0x2b81db,_0x8b10d8[_0xdd1b('0x119')],_0x8b10d8[_0xdd1b('0x161')]);var _0x35a997=_0x38e7cf['result'];if(_0x38e7cf['result']===-0x1){this[_0xdd1b('0x37')][_0xdd1b('0x70')](this,_0x8b10d8,'-1');return _0x38e7cf;}else if(_0x38e7cf[_0xdd1b('0xa7')]===_0xdd1b('0x69')){_0x38e7cf[_0xdd1b('0xa9')]=_0x38e7cf[_0xdd1b('0xa9')][_0xdd1b('0x9f')]>0x0?_0x38e7cf['result']:'t';}else if(_[_0xdd1b('0x43')](_0x38e7cf[_0xdd1b('0xa9')])){_0x38e7cf[_0xdd1b('0xa9')]='#';_0x35a997='#';}if(!this[_0xdd1b('0xab')](_0x8b10d8[_0xdd1b('0xdc')])){this[_0xdd1b('0x10')][_0xdd1b('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x1445bf=this[_0xdd1b('0xa6')][_0xdd1b('0x70')](this,_0x8b10d8[_0xdd1b('0xdc')]);if(!_0x1445bf){return this['channel'][_0xdd1b('0x2f')](_0x8b10d8,'no\x20variable\x20found');}this[_0xdd1b('0x10')]['setVariable'](_0x1445bf,_0x35a997);}this[_0xdd1b('0x37')][_0xdd1b('0x70')](this,_0x8b10d8,_0x35a997);return _0x38e7cf;};AGIVertices['prototype'][_0xdd1b('0xaf')]=function(_0x2c933b){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x162'),_0x2c933b['label']));return this['channel'][_0xdd1b('0xaf')](_0x2c933b[_0xdd1b('0x163')]||_0x2c933b[_0xdd1b('0xae')]);};AGIVertices['prototype'][_0xdd1b('0x164')]=function(_0x408fe2){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x165'),_0x408fe2['label']));if(!this[_0xdd1b('0xab')](_0x408fe2['findBy'])){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x408fe2,_0xdd1b('0x155'));}logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x156'),this[_0xdd1b('0x10')][_0xdd1b('0x39')],_0x408fe2[_0xdd1b('0x157')]));var _0x45001a=this[_0xdd1b('0x4e')]['sync'](this,_0x408fe2[_0xdd1b('0x166')]);var _0x111e83=this[_0xdd1b('0x167')][_0xdd1b('0x70')](this,_0x408fe2[_0xdd1b('0x157')],_0x45001a);if(_0x111e83){logger[_0xdd1b('0x30')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xdd1b('0x10')]['callerid'],_0x408fe2['findBy']));this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0x158'),this[_0xdd1b('0x10')][_0xdd1b('0x39')],_0x408fe2[_0xdd1b('0x157')]));return{'code':0xc8,'result':'success'};}else{logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x15a'),this[_0xdd1b('0x10')]['callerid'],_0x408fe2[_0xdd1b('0x157')]));this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0x158'),this[_0xdd1b('0x10')]['callerid'],_0x408fe2['findBy']));return{'code':0xc8,'result':_0xdd1b('0x15c')};}};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x168')]=function(_0x55a32e){logger[_0xdd1b('0x30')](util['format'](_0xdd1b('0x169'),_0x55a32e['label']));if(!this['isConfigured'](_0x55a32e[_0xdd1b('0x114')])){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x55a32e,_0xdd1b('0x115'));}var _0x5ed588=this[_0xdd1b('0x21')][_0xdd1b('0x70')](this,_0x55a32e[_0xdd1b('0x114')]);if(!_0x5ed588){return this[_0xdd1b('0x10')]['error'](_0x55a32e,_0xdd1b('0x116'));}var _0x2ac164=this[_0xdd1b('0x10')]['exec'](_0xdd1b('0x16a'),[_0x5ed588,_0x55a32e[_0xdd1b('0xea')]]);if(_0x2ac164[_0xdd1b('0xa9')]===-0x1){return _0x2ac164;}return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0xc8'),_0xdd1b('0x16a'),_0x5ed588));};AGIVertices['prototype'][_0xdd1b('0x16b')]=function(_0x2d17af){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x16c'),_0x2d17af[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x2d17af[_0xdd1b('0x16d')])){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x2d17af,'no\x20queue\x20selected');}var _0x356be9='';var _0x52938d=parseInt(_0x2d17af['queue_id'],0xa);if(isNaN(_0x52938d)){_0x356be9=_0x2d17af[_0xdd1b('0x16d')];}else{_0x356be9=this[_0xdd1b('0x16')][_0xdd1b('0x70')](this,_0x2d17af[_0xdd1b('0x16d')]);if(!_0x356be9){return this['channel'][_0xdd1b('0x2f')](_0x2d17af,'no\x20queue\x20found');}}var _0x47131e='';if(this[_0xdd1b('0xab')](_0x2d17af[_0xdd1b('0x114')])){var _0xffb5f9=this[_0xdd1b('0x21')][_0xdd1b('0x70')](this,_0x2d17af[_0xdd1b('0x114')]);if(_0xffb5f9){_0x47131e=_0xffb5f9;}}this['createSquareDetailsReport'][_0xdd1b('0x70')](this,_0x2d17af,_0x356be9);if(_0x2d17af['opts'][_0xdd1b('0x16e')]('x')<0x0){_0x2d17af['opts']+='x';}if(_0x2d17af[_0xdd1b('0xea')][_0xdd1b('0x16e')]('X')<0x0){_0x2d17af['opts']+='X';}this[_0xdd1b('0x10')][_0xdd1b('0xa3')](_0xdd1b('0x16f'),_0x356be9?_0x356be9[_0xdd1b('0x170')]():'');var _0x1d060e=this['channel']['exec'](_0xdd1b('0x171'),[_0x356be9,_0x2d17af[_0xdd1b('0xea')],_0x2d17af['url'],_0x47131e,_0x2d17af[_0xdd1b('0x69')],_0x2d17af[_0xdd1b('0x8')],_0x2d17af[_0xdd1b('0x172')],_0x2d17af[_0xdd1b('0x173')],'',_0x2d17af[_0xdd1b('0x174')]]);if(_0x1d060e['result']===-0x1){return _0x1d060e;}return this[_0xdd1b('0x10')]['noop'](util[_0xdd1b('0x2c')]('Executed\x20command\x20%s\x20%s',_0xdd1b('0x171'),_0x356be9));};AGIVertices['prototype']['record']=function(_0x274558){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x274558['label']));var _0x448031=_0x274558[_0xdd1b('0x175')]||_0xdd1b('0x132');var _0x3be05c=util[_0xdd1b('0x2c')](_0xdd1b('0x176'),this[_0xdd1b('0x10')]['uniqueid'],rs[_0xdd1b('0x11e')](0x5));var _0x5b283d=util[_0xdd1b('0x2c')](_0xdd1b('0x177'),FILES_PATH,_0x3be05c,_0x448031);var _0x14c1b5=util[_0xdd1b('0x2c')](_0xdd1b('0x133'),FILES_PATH,_0x3be05c);this[_0xdd1b('0x3a')][_0xdd1b('0x70')](this,_0x274558,_0x3be05c,_0x5b283d);this[_0xdd1b('0x10')][_0xdd1b('0xa3')](_0xdd1b('0x178'),_0x3be05c);logger[_0xdd1b('0x30')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x14c1b5,_0x448031,_0x274558[_0xdd1b('0x179')],_0x274558[_0xdd1b('0x69')]);return this[_0xdd1b('0x10')][_0xdd1b('0x13c')](_0x14c1b5,_0x448031,_0x274558[_0xdd1b('0x179')],_0x274558[_0xdd1b('0x69')],undefined,!![]);};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x17a')]=function(_0x1d34b7){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x17b'),_0x1d34b7['label']));if(!this[_0xdd1b('0xab')](_0x1d34b7['url'])){return this['channel'][_0xdd1b('0xaf')](_0xdd1b('0x17c'));}var _0x30a66a=this[_0xdd1b('0x66')]['sync'](this,_0x1d34b7);logger[_0xdd1b('0x30')](util['format'](_0xdd1b('0x17d'),util[_0xdd1b('0x17e')](_0x30a66a,{'showHidden':![],'depth':null})));if(!this[_0xdd1b('0xab')](_0x1d34b7['variable_id'])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0x17f'));}var _0x20b539=this['getVariable'][_0xdd1b('0x70')](this,_0x1d34b7[_0xdd1b('0xdc')]);if(!_0x20b539){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x1d34b7,_0xdd1b('0xdd'));}this[_0xdd1b('0x10')][_0xdd1b('0xa3')](util[_0xdd1b('0x2c')](_0xdd1b('0x180'),_0x20b539),_0x30a66a[_0xdd1b('0x78')]?_0x30a66a[_0xdd1b('0x78')]:_0xdd1b('0x181'));this[_0xdd1b('0x10')]['setVariable'](util[_0xdd1b('0x2c')](_0xdd1b('0x182'),_0x20b539),_0x30a66a['statusMessage']?_0x30a66a['statusMessage']:'OK');if(_0x30a66a['body']){try{this[_0xdd1b('0xa0')](_0x30a66a['body'],_0x20b539);}catch(_0x4db08f){logger[_0xdd1b('0x2f')](util[_0xdd1b('0x2c')](_0xdd1b('0x183'),_0x20b539));}}return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0xe2'),_0x20b539));};AGIVertices['prototype'][_0xdd1b('0x184')]=function(_0x2e2878){logger[_0xdd1b('0x30')](util['format'](_0xdd1b('0x185'),_0x2e2878['label']));return this[_0xdd1b('0x10')][_0xdd1b('0x186')](_0x2e2878['digits'][_0xdd1b('0x59')](/\s+/g,''),_0x2e2878[_0xdd1b('0x179')]);};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x187')]=function(_0x11d473){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x11d473[_0xdd1b('0xae')]));return this[_0xdd1b('0x10')][_0xdd1b('0x188')](_0x11d473[_0xdd1b('0x189')][_0xdd1b('0x59')](/\s+/g,''),_0x11d473['escape_digits']);};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x18a')]=function(_0x35dc0f){logger[_0xdd1b('0x30')](util['format'](_0xdd1b('0x18b'),_0x35dc0f[_0xdd1b('0xae')]));return this[_0xdd1b('0x10')][_0xdd1b('0x18c')](_0x35dc0f['text'],_0x35dc0f[_0xdd1b('0x179')]);};AGIVertices['prototype']['sendMail']=function(_0x4c1e2a){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x18d'),_0x4c1e2a[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x4c1e2a['account_id'])){return this[_0xdd1b('0x10')][_0xdd1b('0xaf')]('no\x20mail\x20account\x20configured');}var _0x512f33=this[_0xdd1b('0x24')]['sync'](this,_0x4c1e2a['account_id']);if(!_0x512f33||!_0x512f33[_0xdd1b('0x18e')]){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x4c1e2a,_0xdd1b('0x18f'));}var _0x409c4c={'from':util[_0xdd1b('0x2c')]('\x22%s\x22\x20<%s>',_0x512f33['name'],_0x512f33[_0xdd1b('0x190')]||_0x512f33['Smtp'][_0xdd1b('0x191')]),'to':_0x4c1e2a['to']||'','cc':_0x4c1e2a['cc']||'','bcc':_0x4c1e2a[_0xdd1b('0x192')]||'','subject':_0x4c1e2a['subject'],'html':_0x4c1e2a[_0xdd1b('0x5d')],'text':_0x4c1e2a[_0xdd1b('0x5d')]};var _0xb3b3a6={'tls':{'rejectUnauthorized':![]}};if(_0x512f33[_0xdd1b('0x18e')][_0xdd1b('0x193')]){_0xb3b3a6[_0xdd1b('0x193')]=_0x512f33[_0xdd1b('0x18e')][_0xdd1b('0x193')];}else{_0xb3b3a6[_0xdd1b('0x194')]=_0x512f33[_0xdd1b('0x18e')][_0xdd1b('0x194')];_0xb3b3a6[_0xdd1b('0x195')]=_0x512f33['Smtp']['port'];_0xb3b3a6[_0xdd1b('0x196')]=_0x512f33[_0xdd1b('0x18e')]['secure'];}if(_0x512f33[_0xdd1b('0x18e')]['authentication']){_0xb3b3a6[_0xdd1b('0x197')]={'user':_0x512f33[_0xdd1b('0x18e')]['user'],'pass':_0x512f33[_0xdd1b('0x18e')][_0xdd1b('0x198')]};}if(this[_0xdd1b('0xab')](_0x4c1e2a['template_id'])){}logger['debug'](_0xdd1b('0x199'),JSON[_0xdd1b('0x74')](_0x409c4c));this[_0xdd1b('0x37')][_0xdd1b('0x70')](this,_0x4c1e2a,_0x4c1e2a[_0xdd1b('0x19a')]);this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0x19b'),_0x512f33[_0xdd1b('0x14')]));this[_0xdd1b('0x26')][_0xdd1b('0x70')](this,_0xb3b3a6,_0x409c4c);return this[_0xdd1b('0x10')]['noop'](_0xdd1b('0x19c'));};AGIVertices['prototype'][_0xdd1b('0x19d')]=function(_0xbd4b46){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x19e'),_0xbd4b46['label']));return this[_0xdd1b('0x10')][_0xdd1b('0xaf')](_0xdd1b('0x19f'));};AGIVertices[_0xdd1b('0x13')]['sendSMS']=function(_0x5f4c1c){logger['info'](util[_0xdd1b('0x2c')](_0xdd1b('0x1a0'),_0x5f4c1c[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x5f4c1c['sms_account_id'])){return this[_0xdd1b('0x10')]['noop'](_0xdd1b('0x1a1'));}var _0xb30632=this[_0xdd1b('0x35')][_0xdd1b('0x70')](this,_0x5f4c1c[_0xdd1b('0x1a2')]);if(!_0xb30632){return this['channel'][_0xdd1b('0x2f')](_0x5f4c1c,_0xdd1b('0x1a3'));}var _0x1a07d0={'body':_0x5f4c1c['sms_text'],'phone':_0x5f4c1c['to']||'','SmsAccountId':_0xb30632['id']};logger[_0xdd1b('0xe4')](_0xdd1b('0x1a4'),JSON[_0xdd1b('0x74')](_0x1a07d0));this[_0xdd1b('0x37')][_0xdd1b('0x70')](this,_0x5f4c1c,_0x5f4c1c[_0xdd1b('0x1a2')]);this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0x1a5'),_0xb30632[_0xdd1b('0x14')]));this[_0xdd1b('0x36')][_0xdd1b('0x70')](this,_0x1a07d0);return this[_0xdd1b('0x10')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xdd1b('0x1a6')]=function(_0x16a3ff){logger[_0xdd1b('0x30')](util['format'](_0xdd1b('0x1a7'),_0x16a3ff[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x16a3ff['variable_id'])){return this[_0xdd1b('0x10')]['error'](_0x16a3ff,_0xdd1b('0x1a8'));}var _0x15b030=this[_0xdd1b('0xa6')][_0xdd1b('0x70')](this,_0x16a3ff['variable_id']);if(!_0x15b030){return this[_0xdd1b('0x10')]['error'](_0x16a3ff,_0xdd1b('0xdd'));}return this[_0xdd1b('0x10')][_0xdd1b('0xa3')](_0x15b030,_0x16a3ff[_0xdd1b('0x1a9')]);};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x1aa')]=function(_0x39baaa){logger['info'](util[_0xdd1b('0x2c')](_0xdd1b('0x1ab'),_0x39baaa[_0xdd1b('0xae')]));this[_0xdd1b('0x10')]['noop'](_0xdd1b('0x1ac'));if(_0x39baaa[_0xdd1b('0xbe')]===_0xdd1b('0x1ad')){this[_0xdd1b('0x10')]['noop']('Answer');return this['channel'][_0xdd1b('0xbe')]();}return this[_0xdd1b('0x10')][_0xdd1b('0xaf')]('Skipped\x20Answer');};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x1ae')]=function(_0x43ce75){logger[_0xdd1b('0x30')](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x43ce75['label']));if(!this[_0xdd1b('0xab')](_0x43ce75[_0xdd1b('0x1af')])){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x43ce75,_0xdd1b('0x1b0'));}var _0x11b74d=this['getSquareProject'][_0xdd1b('0x70')](this,_0x43ce75[_0xdd1b('0x1af')]);if(!this[_0xdd1b('0xab')](_0x11b74d)){return this[_0xdd1b('0x10')]['error'](_0x43ce75,util[_0xdd1b('0x2c')](_0xdd1b('0x1b1'),_0x43ce75['project_id']));}if(_0x11b74d===this[_0xdd1b('0x10')][_0xdd1b('0x38')]){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x43ce75,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xdd1b('0x37')][_0xdd1b('0x70')](this,_0x43ce75,_0x11b74d);var _0xbeb615=this['channel'][_0xdd1b('0x57')](_0xdd1b('0x1b2'),util[_0xdd1b('0x2c')](_0xdd1b('0x1b3'),config[_0xdd1b('0x8')][_0xdd1b('0x194')]||'127.0.0.1',_0x11b74d,this[_0xdd1b('0x10')][_0xdd1b('0x38')]));if(_0xbeb615[_0xdd1b('0xa9')]===-0x1){return _0xbeb615;}return this['channel'][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0xc8'),_0xdd1b('0x1b2'),_0x11b74d));};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x1b4')]=function(_0x202dab){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x1b5'),_0x202dab['label']));var _0x2eba86=this[_0xdd1b('0x56')][_0xdd1b('0x70')](this,_0x202dab['command']);this[_0xdd1b('0x37')][_0xdd1b('0x70')](this,_0x202dab,_0x202dab['command']);if(this[_0xdd1b('0xab')](_0x202dab[_0xdd1b('0xdc')])){var _0x15ce44=this[_0xdd1b('0xa6')][_0xdd1b('0x70')](this,_0x202dab[_0xdd1b('0xdc')]);if(_0x15ce44){this[_0xdd1b('0x10')][_0xdd1b('0xa3')](_0x15ce44,_0x2eba86);return this[_0xdd1b('0x10')]['noop'](util[_0xdd1b('0x2c')](_0xdd1b('0x1b6'),_0x202dab[_0xdd1b('0xbc')],_0x15ce44));}}return this['channel']['noop'](util[_0xdd1b('0x2c')](_0xdd1b('0x1b7'),_0x202dab[_0xdd1b('0xbc')]));};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x1b8')]=function(_0x316ea9){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x316ea9[_0xdd1b('0xae')]));_0x316ea9[_0xdd1b('0x5d')]=_0x316ea9[_0xdd1b('0x5d')][_0xdd1b('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x316ea9['apiKey'])){return this['channel']['noop'](_0xdd1b('0x1b9'));}if(!this['isConfigured'](_0x316ea9['text'])){return this[_0xdd1b('0x10')]['noop'](_0xdd1b('0xb0'));}this['channel'][_0xdd1b('0xaf')](util['format'](_0xdd1b('0x1ba'),_0x316ea9['text']));var _0x190dcd=this[_0xdd1b('0x5a')][_0xdd1b('0x70')](this,_0x316ea9);if(_0x190dcd){this['channel']['noop'](util[_0xdd1b('0x2c')](_0xdd1b('0x1bb'),_0x190dcd));var _0x240961=this[_0xdd1b('0x10')][_0xdd1b('0x104')](_0x190dcd);try{fs[_0xdd1b('0x105')](_0x190dcd+_0xdd1b('0x106'));}catch(_0x138466){logger['error'](_0x138466);}return _0x240961;}return this['channel'][_0xdd1b('0x2f')](_0x316ea9,_0xdd1b('0x1bc'));};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x1bd')]=function(_0x4f7694){logger[_0xdd1b('0x30')](util['format'](_0xdd1b('0x1be'),_0x4f7694[_0xdd1b('0xae')]));_0x4f7694[_0xdd1b('0x5d')]=_0x4f7694[_0xdd1b('0x5d')][_0xdd1b('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xdd1b('0xab')](_0x4f7694[_0xdd1b('0x5d')])){return this['channel'][_0xdd1b('0xaf')](_0xdd1b('0xb0'));}this['channel'][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0x1bf'),_0x4f7694[_0xdd1b('0x5d')]));var _0x3e06be=this['googleTTS'][_0xdd1b('0x70')](this,_0x4f7694);if(_0x3e06be){this[_0xdd1b('0x10')]['noop'](util[_0xdd1b('0x2c')](_0xdd1b('0x1c0'),_0x3e06be));var _0x599aa6=this[_0xdd1b('0x10')][_0xdd1b('0x104')](_0x3e06be);try{fs[_0xdd1b('0x105')](_0x3e06be+_0xdd1b('0x106'));}catch(_0x195c4f){logger[_0xdd1b('0x2f')](_0x195c4f);}return _0x599aa6;}return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x4f7694,_0xdd1b('0x1c1'));};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x1c2')]=function(_0x33de43){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x33de43[_0xdd1b('0xae')]));if(!this[_0xdd1b('0xab')](_0x33de43['findBy'])){return this[_0xdd1b('0x10')]['error'](_0x33de43,_0xdd1b('0x155'));}logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x156'),this[_0xdd1b('0x10')]['callerid'],_0x33de43[_0xdd1b('0x157')]));var _0x3ce904=this[_0xdd1b('0x51')][_0xdd1b('0x70')](this,_0x33de43[_0xdd1b('0x157')]);if(_0x3ce904){logger['info'](util[_0xdd1b('0x2c')](_0xdd1b('0x158'),this[_0xdd1b('0x10')][_0xdd1b('0x39')],_0x33de43[_0xdd1b('0x157')]));this[_0xdd1b('0x10')]['noop'](util[_0xdd1b('0x2c')](_0xdd1b('0x158'),this[_0xdd1b('0x10')][_0xdd1b('0x39')],_0x33de43['findBy']));return{'code':0xc8,'result':_0xdd1b('0x159')};}else{logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x15a'),this['channel'][_0xdd1b('0x39')],_0x33de43['findBy']));this[_0xdd1b('0x10')][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0x15a'),this[_0xdd1b('0x10')][_0xdd1b('0x39')],_0x33de43[_0xdd1b('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xdd1b('0x13')][_0xdd1b('0x1c3')]=function(_0x5c1099){logger['info'](util[_0xdd1b('0x2c')](_0xdd1b('0x1c4'),_0x5c1099[_0xdd1b('0xae')]));var _0x3b4417=this[_0xdd1b('0x10')][_0xdd1b('0x57')](_0xdd1b('0x1c5'),[_0x5c1099['mailbox'],_0x5c1099[_0xdd1b('0x7a')]]);if(_0x3b4417[_0xdd1b('0xa9')]===-0x1){return _0x3b4417;}return this['channel'][_0xdd1b('0xaf')](util[_0xdd1b('0x2c')](_0xdd1b('0xc8'),_0xdd1b('0x1c5'),_0x5c1099['mailbox']));};AGIVertices[_0xdd1b('0x13')]['vswitch']=function(_0x276be7){logger[_0xdd1b('0x30')](util[_0xdd1b('0x2c')](_0xdd1b('0x1c6'),_0x276be7['label']));if(!this[_0xdd1b('0xab')](_0x276be7[_0xdd1b('0xdc')])){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x276be7,_0xdd1b('0x1a8'));}var _0x3d37d7=this['getVariable'][_0xdd1b('0x70')](this,_0x276be7['variable_id']);if(!_0x3d37d7){return this[_0xdd1b('0x10')][_0xdd1b('0x2f')](_0x276be7,_0xdd1b('0xdd'));}var _0x8ece90=this[_0xdd1b('0x10')][_0xdd1b('0xa6')](_0x3d37d7);return{'code':0xc8,'result':_0x8ece90[_0xdd1b('0xa7')]?_0x8ece90[_0xdd1b('0xa7')]:'-'};};String[_0xdd1b('0x13')][_0xdd1b('0xa5')]=function(_0x2ec8cb,_0x423e0a){return this['split'](_0x2ec8cb)[_0xdd1b('0x1c7')](_0x423e0a);};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 86eb5d2..2816f7c 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 _0x85ca=['syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','error','message','stopAcw','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','syncAttendedTransfer','transfereeuniqueid','secondtransfereruniqueid','isNil','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','bind','hangup'];(function(_0x2e5964,_0x14c2b9){var _0x5bc534=function(_0x1eff6c){while(--_0x1eff6c){_0x2e5964['push'](_0x2e5964['shift']());}};_0x5bc534(++_0x14c2b9);}(_0x85ca,0x9f));var _0xa85c=function(_0x2d6563,_0xd20e26){_0x2d6563=_0x2d6563-0x0;var _0x51610b=_0x85ca[_0x2d6563];return _0x51610b;};'use strict';var util=require(_0xa85c('0x0'));var _=require('lodash');var moment=require('moment');var ami=require(_0xa85c('0x1'));var logger=require('../../../config/logger')(_0xa85c('0x2'));var RpcUser=require(_0xa85c('0x3'));var RpcVoiceAgentReport=require(_0xa85c('0x4'));function Acw(_0x378684){this[_0xa85c('0x5')]=_0x378684[_0xa85c('0x5')];this[_0xa85c('0x6')]=_0x378684[_0xa85c('0x6')];this[_0xa85c('0x7')]=_0x378684[_0xa85c('0x7')];this[_0xa85c('0x8')]={};ami['on'](_0xa85c('0x9'),this[_0xa85c('0xa')]['bind'](this));ami['on'](_0xa85c('0xb'),this[_0xa85c('0xc')][_0xa85c('0xd')](this));ami['on'](_0xa85c('0xe'),this[_0xa85c('0xf')][_0xa85c('0xd')](this));ami['on'](_0xa85c('0x10'),this[_0xa85c('0x11')][_0xa85c('0xd')](this));ami['on'](_0xa85c('0x12'),this['syncAttendedTransfer'][_0xa85c('0xd')](this));ami['on'](_0xa85c('0x13'),this[_0xa85c('0x14')][_0xa85c('0xd')](this));ami['on'](_0xa85c('0x15'),this[_0xa85c('0x16')][_0xa85c('0xd')](this));}function getDiff(_0x46c439){var _0x4a6e69=moment()['milliseconds'](0x0);var _0xd86b6d=moment(_0x46c439)[_0xa85c('0x17')](0x0);return _0x4a6e69[_0xa85c('0x18')](_0xd86b6d,_0xa85c('0x19'));}Acw[_0xa85c('0x1a')][_0xa85c('0x1b')]=function(_0x4d6fad){try{var _0x1e89bc=this;var _0x1275e9=this[_0xa85c('0x8')][_0x4d6fad][_0xa85c('0x1c')];var _0x44aeb0=this[_0xa85c('0x8')][_0x4d6fad][_0xa85c('0x1d')];var _0x5e62ee=this[_0xa85c('0x5')][_0x44aeb0];var _0x315a72=![];var _0x169a16=_0xa85c('0x1e');if(_0x5e62ee['mandatoryDisposition']){if(_0x5e62ee['mandatoryDispositionPause']['name']){_0x315a72=!![];_0x169a16=_0x5e62ee[_0xa85c('0x1f')][_0xa85c('0x20')];}}ami['Action']({'action':_0xa85c('0x21'),'interface':_0x1275e9,'paused':!![],'reason':_0x169a16})[_0xa85c('0x22')](function(_0x1cba6b){if(_0x1e89bc[_0xa85c('0x6')][_0x1275e9]){return RpcUser[_0xa85c('0x23')](_0x1e89bc[_0xa85c('0x6')][_0x1275e9]['id'])[_0xa85c('0x22')](function(_0x56cdfa){if(_0x56cdfa&&!_0x56cdfa[_0xa85c('0x24')]){logger[_0xa85c('0x25')](_0xa85c('0x26'),_0x4d6fad,_0x1275e9,_0x44aeb0);var _0x572a01=_0x1e89bc[_0xa85c('0x8')][_0x4d6fad][_0xa85c('0x27')]&&_0x1e89bc[_0xa85c('0x8')][_0x4d6fad]['destlinkedid']?_0x1e89bc[_0xa85c('0x8')][_0x4d6fad][_0xa85c('0x28')]:_0x4d6fad;return RpcUser['savePause'](_0x1e89bc[_0xa85c('0x6')][_0x1275e9],_0x169a16,_0x572a01)[_0xa85c('0x22')](function(_0x3f426c){if(!_0x315a72){_0x1e89bc['timers'][_0x1275e9]={};logger[_0xa85c('0x25')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x4d6fad,_0x1e89bc[_0xa85c('0x5')][_0x44aeb0][_0xa85c('0x29')],_0x1275e9,_0x44aeb0);_0x1e89bc[_0xa85c('0x7')][_0x1275e9]['timer']=setTimeout(_0x1e89bc['stopAcw'][_0xa85c('0xd')](_0x1e89bc,_0x1275e9),_0x1e89bc[_0xa85c('0x5')][_0x44aeb0][_0xa85c('0x29')]*0x3e8);_0x1e89bc[_0xa85c('0x7')][_0x1275e9][_0xa85c('0x2a')]=moment()[_0xa85c('0x2b')](_0xa85c('0x2c'));_0x1e89bc[_0xa85c('0x7')][_0x1275e9][_0xa85c('0x2d')]=_0x4d6fad;_0x1e89bc[_0xa85c('0x7')][_0x1275e9][_0xa85c('0x1d')]=_0x44aeb0;_0x1e89bc[_0xa85c('0x7')][_0x1275e9][_0xa85c('0x2e')]=function(){var _0x434109=getDiff(_0x1e89bc['timers'][_0x1275e9]['lastPauseAt']);clearTimeout(_0x1e89bc[_0xa85c('0x7')][_0x1275e9][_0xa85c('0x2f')]);_0x1e89bc[_0xa85c('0x7')][_0x1275e9][_0xa85c('0x2f')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x434109},_0x1e89bc[_0xa85c('0x7')][_0x1275e9]['uniqueid'],_0x1275e9)[_0xa85c('0x22')](function(_0x4f2300){logger[_0xa85c('0x25')]('[%s][UPDATE][ACWTIME:%s]',_0x4d6fad,_0x434109,_0x4f2300);})[_0xa85c('0x30')](function(_0x128f20){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x4d6fad,_0x128f20);});delete _0x1e89bc[_0xa85c('0x7')][_0x1275e9];};}});}else{logger[_0xa85c('0x25')](_0xa85c('0x31'),_0x4d6fad,_0x1275e9,_0x44aeb0);}});}})[_0xa85c('0x30')](function(_0x348dcf){logger['error'](_0xa85c('0x32'),_0x4d6fad,_0x1e89bc[_0xa85c('0x5')][_0x44aeb0][_0xa85c('0x29')],_0x1275e9,_0x44aeb0);})[_0xa85c('0x33')](function(){delete _0x1e89bc[_0xa85c('0x8')][_0x4d6fad];});}catch(_0x2c9dd6){logger[_0xa85c('0x34')]('[ACW][START]\x20%s',_0x2c9dd6[_0xa85c('0x35')]);}};Acw[_0xa85c('0x1a')][_0xa85c('0x36')]=function(_0x2d220f){try{var _0x4b659a=this;if(_0x4b659a[_0xa85c('0x7')][_0x2d220f]){_0x4b659a[_0xa85c('0x7')][_0x2d220f][_0xa85c('0x2f')]=![];var _0x218552=_0x4b659a[_0xa85c('0x7')][_0x2d220f][_0xa85c('0x2d')];var _0x27623f=_0x4b659a['timers'][_0x2d220f][_0xa85c('0x1d')];var _0x356354=_0x4b659a[_0xa85c('0x5')][_0x27623f][_0xa85c('0x29')];logger[_0xa85c('0x25')]('[%s][TIMER][STOP][AGENT:%s]',_0x218552,_0x2d220f);RpcUser[_0xa85c('0x37')](this[_0xa85c('0x6')][_0x2d220f]);RpcVoiceAgentReport[_0xa85c('0x38')]({'acwtime':_0x356354,'agentacw':!![]},_0x218552,_0x2d220f)[_0xa85c('0x22')](function(_0x4a9c1){logger[_0xa85c('0x25')](_0xa85c('0x39'),_0x218552,_0x356354,_0x4a9c1);})[_0xa85c('0x30')](function(_0x2faa74){logger[_0xa85c('0x34')]('[%s][UPDATE][ERRORS:%s]',_0x218552,_0x2faa74);});}else{logger[_0xa85c('0x34')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x2d220f);if(_0x4b659a['timers']){logger[_0xa85c('0x25')](_0xa85c('0x3a'),JSON[_0xa85c('0x3b')](_0x4b659a['timers']));}}}catch(_0x8211da){logger[_0xa85c('0x34')](_0xa85c('0x3c'),_0x8211da[_0xa85c('0x35')]);}};Acw[_0xa85c('0x1a')]['syncAgentConnect']=function(_0x1932b9){try{if(this[_0xa85c('0x5')][_0x1932b9[_0xa85c('0x1d')]]&&(this[_0xa85c('0x5')][_0x1932b9[_0xa85c('0x1d')]][_0xa85c('0x2')]||this[_0xa85c('0x5')][_0x1932b9[_0xa85c('0x1d')]][_0xa85c('0x3d')])){if(this[_0xa85c('0x6')][_0x1932b9[_0xa85c('0x1c')]]){this[_0xa85c('0x8')][_0x1932b9['uniqueid']]={'queue':_0x1932b9[_0xa85c('0x1d')],'interface':_0x1932b9['interface'],'destlinkedid':_0x1932b9[_0xa85c('0x28')]};}}}catch(_0x1cfb57){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x1cfb57[_0xa85c('0x35')]);}};Acw[_0xa85c('0x1a')][_0xa85c('0x16')]=function(_0x491c0c){try{if(this[_0xa85c('0x5')][_0x491c0c[_0xa85c('0x1d')]]&&(this[_0xa85c('0x5')][_0x491c0c['queue']][_0xa85c('0x2')]||this['voiceQueues'][_0x491c0c[_0xa85c('0x1d')]][_0xa85c('0x3d')])){if(this[_0xa85c('0x6')][_0x491c0c[_0xa85c('0x1c')]]){this[_0xa85c('0x8')][_0x491c0c[_0xa85c('0x2d')]]={'queue':_0x491c0c[_0xa85c('0x1d')],'interface':_0x491c0c[_0xa85c('0x1c')]};}}}catch(_0x4774f5){logger['error'](_0xa85c('0x3e'),_0x4774f5[_0xa85c('0x35')]);}};Acw[_0xa85c('0x1a')]['syncHangupRequest']=function(_0xa06777){try{if(this[_0xa85c('0x8')][_0xa06777[_0xa85c('0x2d')]]&&_[_0xa85c('0x3f')](this[_0xa85c('0x8')][_0xa06777['uniqueid']][_0xa85c('0x27')])){logger[_0xa85c('0x25')](_0xa85c('0x40'),_0xa06777[_0xa85c('0x2d')]);this[_0xa85c('0x1b')](_0xa06777['uniqueid']);}else if(this[_0xa85c('0x8')][_0xa06777[_0xa85c('0x41')]]&&_[_0xa85c('0x3f')](this['channels'][_0xa06777['linkedid']][_0xa85c('0x27')])){logger['info'](_0xa85c('0x42'),_0xa06777['linkedid']);this[_0xa85c('0x1b')](_0xa06777[_0xa85c('0x41')]);}}catch(_0xb4f2d6){logger[_0xa85c('0x34')](_0xa85c('0x43'),_0xb4f2d6[_0xa85c('0x35')]);}};Acw[_0xa85c('0x1a')][_0xa85c('0xf')]=function(_0x2ab664){try{if(this[_0xa85c('0x8')][_0x2ab664[_0xa85c('0x2d')]]&&this[_0xa85c('0x8')][_0x2ab664[_0xa85c('0x2d')]]['attended']){logger[_0xa85c('0x25')](_0xa85c('0x44'),_0x2ab664[_0xa85c('0x2d')]);this[_0xa85c('0x1b')](_0x2ab664[_0xa85c('0x2d')]);}else if(this[_0xa85c('0x8')][_0x2ab664['linkedid']]&&this['channels'][_0x2ab664['linkedid']][_0xa85c('0x27')]){logger[_0xa85c('0x25')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x2ab664[_0xa85c('0x41')]);this['startAcw'](_0x2ab664['linkedid']);}}catch(_0x244ec3){logger['error']('[ACW][syncHangup]\x20%s',_0x244ec3[_0xa85c('0x35')]);}};Acw[_0xa85c('0x1a')][_0xa85c('0x45')]=function(_0x114833){try{if(!_['isNil'](this[_0xa85c('0x8')][_0x114833[_0xa85c('0x46')]])){this['startAcw'](_0x114833[_0xa85c('0x46')]);if(this[_0xa85c('0x8')][_0x114833[_0xa85c('0x47')]]){this[_0xa85c('0x8')][_0x114833['secondtransfereruniqueid']][_0xa85c('0x27')]=!![];this[_0xa85c('0x8')][_0x114833['transfertargetuniqueid']]=this[_0xa85c('0x8')][_0x114833[_0xa85c('0x47')]];delete this['channels'][_0x114833['secondtransfereruniqueid']];}}else if(!_[_0xa85c('0x48')](this[_0xa85c('0x8')][_0x114833[_0xa85c('0x49')]])){this['startAcw'](_0x114833[_0xa85c('0x49')]);if(this[_0xa85c('0x8')][_0x114833[_0xa85c('0x4a')]]){this[_0xa85c('0x8')][_0x114833[_0xa85c('0x4a')]]['attended']=!![];this[_0xa85c('0x8')][_0x114833[_0xa85c('0x46')]]=this[_0xa85c('0x8')][_0x114833[_0xa85c('0x4a')]];delete this[_0xa85c('0x8')][_0x114833[_0xa85c('0x4a')]];}}}catch(_0x461dc9){logger[_0xa85c('0x34')](_0xa85c('0x4b'),_0x461dc9[_0xa85c('0x35')]);}};Acw['prototype'][_0xa85c('0x14')]=function(_0x453dc4){try{if(this[_0xa85c('0x8')][_0x453dc4[_0xa85c('0x4c')]]){logger[_0xa85c('0x25')](_0xa85c('0x4d'),JSON[_0xa85c('0x3b')](_0x453dc4[_0xa85c('0x4c')]));this[_0xa85c('0x1b')](_0x453dc4[_0xa85c('0x4c')]);}else if(this[_0xa85c('0x8')][_0x453dc4[_0xa85c('0x4e')]]){logger[_0xa85c('0x25')]('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x453dc4[_0xa85c('0x4e')]));this[_0xa85c('0x1b')](_0x453dc4[_0xa85c('0x4e')]);}}catch(_0x2733bc){logger['error'](_0xa85c('0x4f'),_0x2733bc[_0xa85c('0x35')]);}};Acw[_0xa85c('0x1a')]['syncAgentRingNoAnswer']=function(_0x255766){try{if(this[_0xa85c('0x5')][_0x255766[_0xa85c('0x1d')]]&&this['voiceQueues'][_0x255766[_0xa85c('0x1d')]][_0xa85c('0x50')]===_0xa85c('0x51')){if(this[_0xa85c('0x6')][_0x255766[_0xa85c('0x1c')]]){logger['info'](_0xa85c('0x52'),_0x255766[_0xa85c('0x2d')],_0x255766[_0xa85c('0x1c')],_0x255766[_0xa85c('0x1d')]);return RpcUser[_0xa85c('0x53')](this['agents'][_0x255766[_0xa85c('0x1c')]],_0xa85c('0x54'),_0x255766[_0xa85c('0x2d')]);}}}catch(_0x30eea1){logger[_0xa85c('0x34')](_0xa85c('0x55'),_0x30eea1[_0xa85c('0x35')]);}};module[_0xa85c('0x56')]=Acw; \ No newline at end of file +var _0x7b02=['interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][TIMERS]','stringify','message','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','transfertargetuniqueid','secondtransfereruniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','seconds','prototype','startAcw','channels'];(function(_0x30786c,_0x35df5a){var _0x928e0a=function(_0x4b0859){while(--_0x4b0859){_0x30786c['push'](_0x30786c['shift']());}};_0x928e0a(++_0x35df5a);}(_0x7b02,0x152));var _0x27b0=function(_0x2d92c8,_0x5efacd){_0x2d92c8=_0x2d92c8-0x0;var _0x2c49cb=_0x7b02[_0x2d92c8];return _0x2c49cb;};'use strict';var util=require(_0x27b0('0x0'));var _=require(_0x27b0('0x1'));var moment=require('moment');var ami=require(_0x27b0('0x2'));var logger=require('../../../config/logger')(_0x27b0('0x3'));var RpcUser=require(_0x27b0('0x4'));var RpcVoiceAgentReport=require(_0x27b0('0x5'));function Acw(_0x224b3c){this[_0x27b0('0x6')]=_0x224b3c['voiceQueues'];this[_0x27b0('0x7')]=_0x224b3c[_0x27b0('0x7')];this[_0x27b0('0x8')]=_0x224b3c[_0x27b0('0x8')];this['channels']={};ami['on'](_0x27b0('0x9'),this['syncAgentConnect'][_0x27b0('0xa')](this));ami['on'](_0x27b0('0xb'),this[_0x27b0('0xc')][_0x27b0('0xa')](this));ami['on'](_0x27b0('0xd'),this[_0x27b0('0xe')][_0x27b0('0xa')](this));ami['on'](_0x27b0('0xf'),this[_0x27b0('0x10')][_0x27b0('0xa')](this));ami['on']('attendedtransfer',this[_0x27b0('0x11')][_0x27b0('0xa')](this));ami['on'](_0x27b0('0x12'),this['syncBlindTransfer'][_0x27b0('0xa')](this));ami['on'](_0x27b0('0x13'),this[_0x27b0('0x14')][_0x27b0('0xa')](this));}function getDiff(_0x281fcc){var _0xa9ca6c=moment()['milliseconds'](0x0);var _0x5a3631=moment(_0x281fcc)['milliseconds'](0x0);return _0xa9ca6c[_0x27b0('0x15')](_0x5a3631,_0x27b0('0x16'));}Acw[_0x27b0('0x17')][_0x27b0('0x18')]=function(_0x2f446f){try{var _0xdadebc=this;var _0x1c286f=this[_0x27b0('0x19')][_0x2f446f][_0x27b0('0x1a')];var _0x1bf895=this['channels'][_0x2f446f][_0x27b0('0x1b')];var _0x5c15d4=this[_0x27b0('0x6')][_0x1bf895];var _0xbf4dd5=![];var _0x952dde=_0x27b0('0x1c');if(_0x5c15d4[_0x27b0('0x1d')]){if(_0x5c15d4[_0x27b0('0x1e')][_0x27b0('0x1f')]){_0xbf4dd5=!![];_0x952dde=_0x5c15d4[_0x27b0('0x1e')][_0x27b0('0x1f')];}}ami['Action']({'action':_0x27b0('0x20'),'interface':_0x1c286f,'paused':!![],'reason':_0x952dde})[_0x27b0('0x21')](function(_0x1748d0){if(_0xdadebc[_0x27b0('0x7')][_0x1c286f]){return RpcUser[_0x27b0('0x22')](_0xdadebc['agents'][_0x1c286f]['id'])[_0x27b0('0x21')](function(_0x104a71){if(_0x104a71&&!_0x104a71[_0x27b0('0x23')]){logger[_0x27b0('0x24')](_0x27b0('0x25'),_0x2f446f,_0x1c286f,_0x1bf895);var _0x24f36c=_0xdadebc['channels'][_0x2f446f][_0x27b0('0x26')]&&_0xdadebc[_0x27b0('0x19')][_0x2f446f]['destlinkedid']?_0xdadebc['channels'][_0x2f446f][_0x27b0('0x27')]:_0x2f446f;return RpcUser[_0x27b0('0x28')](_0xdadebc['agents'][_0x1c286f],_0x952dde,_0x24f36c)[_0x27b0('0x21')](function(_0x1439be){if(!_0xbf4dd5){_0xdadebc[_0x27b0('0x8')][_0x1c286f]={};logger[_0x27b0('0x24')](_0x27b0('0x29'),_0x2f446f,_0xdadebc[_0x27b0('0x6')][_0x1bf895][_0x27b0('0x2a')],_0x1c286f,_0x1bf895);_0xdadebc[_0x27b0('0x8')][_0x1c286f][_0x27b0('0x2b')]=setTimeout(_0xdadebc[_0x27b0('0x2c')]['bind'](_0xdadebc,_0x1c286f),_0xdadebc['voiceQueues'][_0x1bf895]['acwTimeout']*0x3e8);_0xdadebc[_0x27b0('0x8')][_0x1c286f][_0x27b0('0x2d')]=moment()[_0x27b0('0x2e')](_0x27b0('0x2f'));_0xdadebc['timers'][_0x1c286f][_0x27b0('0x30')]=_0x2f446f;_0xdadebc[_0x27b0('0x8')][_0x1c286f]['queue']=_0x1bf895;_0xdadebc[_0x27b0('0x8')][_0x1c286f][_0x27b0('0x31')]=function(){var _0x29a68f=getDiff(_0xdadebc[_0x27b0('0x8')][_0x1c286f][_0x27b0('0x2d')]);clearTimeout(_0xdadebc[_0x27b0('0x8')][_0x1c286f][_0x27b0('0x2b')]);_0xdadebc[_0x27b0('0x8')][_0x1c286f][_0x27b0('0x2b')]=![];RpcVoiceAgentReport[_0x27b0('0x32')]({'acwtime':_0x29a68f},_0xdadebc[_0x27b0('0x8')][_0x1c286f]['uniqueid'],_0x1c286f)[_0x27b0('0x21')](function(_0x2a7527){logger[_0x27b0('0x24')](_0x27b0('0x33'),_0x2f446f,_0x29a68f,_0x2a7527);})[_0x27b0('0x34')](function(_0x27bb82){logger['error'](_0x27b0('0x35'),_0x2f446f,_0x27bb82);});delete _0xdadebc['timers'][_0x1c286f];};}});}else{logger[_0x27b0('0x24')](_0x27b0('0x36'),_0x2f446f,_0x1c286f,_0x1bf895);}});}})[_0x27b0('0x34')](function(_0x16fd11){logger[_0x27b0('0x37')](_0x27b0('0x29'),_0x2f446f,_0xdadebc[_0x27b0('0x6')][_0x1bf895][_0x27b0('0x2a')],_0x1c286f,_0x1bf895);})[_0x27b0('0x38')](function(){delete _0xdadebc[_0x27b0('0x19')][_0x2f446f];});}catch(_0x4dfffd){logger[_0x27b0('0x37')](_0x27b0('0x39'),_0x4dfffd['message']);}};Acw[_0x27b0('0x17')][_0x27b0('0x2c')]=function(_0x4c401d){try{var _0x16a74f=this;if(_0x16a74f['timers'][_0x4c401d]){_0x16a74f[_0x27b0('0x8')][_0x4c401d][_0x27b0('0x2b')]=![];var _0x34fc0e=_0x16a74f[_0x27b0('0x8')][_0x4c401d][_0x27b0('0x30')];var _0x5979f5=_0x16a74f['timers'][_0x4c401d][_0x27b0('0x1b')];var _0x108f7b=_0x16a74f[_0x27b0('0x6')][_0x5979f5][_0x27b0('0x2a')];logger['info'](_0x27b0('0x3a'),_0x34fc0e,_0x4c401d);RpcUser[_0x27b0('0x3b')](this[_0x27b0('0x7')][_0x4c401d]);RpcVoiceAgentReport[_0x27b0('0x32')]({'acwtime':_0x108f7b,'agentacw':!![]},_0x34fc0e,_0x4c401d)[_0x27b0('0x21')](function(_0x3fdbed){logger[_0x27b0('0x24')](_0x27b0('0x33'),_0x34fc0e,_0x108f7b,_0x3fdbed);})['catch'](function(_0x43a64d){logger[_0x27b0('0x37')](_0x27b0('0x35'),_0x34fc0e,_0x43a64d);});}else{logger[_0x27b0('0x37')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x4c401d);if(_0x16a74f[_0x27b0('0x8')]){logger['info'](_0x27b0('0x3c'),JSON[_0x27b0('0x3d')](_0x16a74f['timers']));}}}catch(_0x3fa4e2){logger[_0x27b0('0x37')]('[ACW][STOP]\x20%s',_0x3fa4e2[_0x27b0('0x3e')]);}};Acw[_0x27b0('0x17')][_0x27b0('0x3f')]=function(_0x1513de){try{if(this[_0x27b0('0x6')][_0x1513de['queue']]&&(this[_0x27b0('0x6')][_0x1513de['queue']][_0x27b0('0x3')]||this['voiceQueues'][_0x1513de['queue']][_0x27b0('0x1d')])){if(this[_0x27b0('0x7')][_0x1513de[_0x27b0('0x1a')]]){this[_0x27b0('0x19')][_0x1513de['uniqueid']]={'queue':_0x1513de[_0x27b0('0x1b')],'interface':_0x1513de[_0x27b0('0x1a')],'destlinkedid':_0x1513de[_0x27b0('0x27')]};}}}catch(_0x16ed45){logger[_0x27b0('0x37')](_0x27b0('0x40'),_0x16ed45['message']);}};Acw[_0x27b0('0x17')][_0x27b0('0x14')]=function(_0x4b7628){try{if(this['voiceQueues'][_0x4b7628['queue']]&&(this[_0x27b0('0x6')][_0x4b7628[_0x27b0('0x1b')]][_0x27b0('0x3')]||this[_0x27b0('0x6')][_0x4b7628[_0x27b0('0x1b')]][_0x27b0('0x1d')])){if(this[_0x27b0('0x7')][_0x4b7628[_0x27b0('0x1a')]]){this[_0x27b0('0x19')][_0x4b7628[_0x27b0('0x30')]]={'queue':_0x4b7628[_0x27b0('0x1b')],'interface':_0x4b7628['interface']};}}}catch(_0x36bf69){logger[_0x27b0('0x37')](_0x27b0('0x41'),_0x36bf69[_0x27b0('0x3e')]);}};Acw['prototype'][_0x27b0('0xc')]=function(_0x2908bc){try{if(this[_0x27b0('0x19')][_0x2908bc[_0x27b0('0x30')]]&&_[_0x27b0('0x42')](this[_0x27b0('0x19')][_0x2908bc['uniqueid']][_0x27b0('0x26')])){logger['info'](_0x27b0('0x43'),_0x2908bc[_0x27b0('0x30')]);this[_0x27b0('0x18')](_0x2908bc[_0x27b0('0x30')]);}else if(this[_0x27b0('0x19')][_0x2908bc[_0x27b0('0x44')]]&&_['isUndefined'](this['channels'][_0x2908bc['linkedid']][_0x27b0('0x26')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x2908bc[_0x27b0('0x44')]);this[_0x27b0('0x18')](_0x2908bc[_0x27b0('0x44')]);}}catch(_0x49fb73){logger[_0x27b0('0x37')](_0x27b0('0x45'),_0x49fb73[_0x27b0('0x3e')]);}};Acw[_0x27b0('0x17')][_0x27b0('0xe')]=function(_0x6769e6){try{if(this['channels'][_0x6769e6[_0x27b0('0x30')]]&&this[_0x27b0('0x19')][_0x6769e6[_0x27b0('0x30')]][_0x27b0('0x26')]){logger[_0x27b0('0x24')](_0x27b0('0x46'),_0x6769e6[_0x27b0('0x30')]);this['startAcw'](_0x6769e6[_0x27b0('0x30')]);}else if(this[_0x27b0('0x19')][_0x6769e6['linkedid']]&&this['channels'][_0x6769e6[_0x27b0('0x44')]]['attended']){logger[_0x27b0('0x24')](_0x27b0('0x47'),_0x6769e6[_0x27b0('0x44')]);this[_0x27b0('0x18')](_0x6769e6[_0x27b0('0x44')]);}}catch(_0x45ec26){logger['error'](_0x27b0('0x48'),_0x45ec26['message']);}};Acw[_0x27b0('0x17')][_0x27b0('0x11')]=function(_0x1da7e6){try{if(!_[_0x27b0('0x49')](this[_0x27b0('0x19')][_0x1da7e6[_0x27b0('0x4a')]])){this[_0x27b0('0x18')](_0x1da7e6[_0x27b0('0x4a')]);if(this[_0x27b0('0x19')][_0x1da7e6['secondtransfereruniqueid']]){this[_0x27b0('0x19')][_0x1da7e6['secondtransfereruniqueid']][_0x27b0('0x26')]=!![];this[_0x27b0('0x19')][_0x1da7e6[_0x27b0('0x4b')]]=this[_0x27b0('0x19')][_0x1da7e6['secondtransfereruniqueid']];delete this[_0x27b0('0x19')][_0x1da7e6[_0x27b0('0x4c')]];}}else if(!_['isNil'](this[_0x27b0('0x19')][_0x1da7e6[_0x27b0('0x4b')]])){this['startAcw'](_0x1da7e6[_0x27b0('0x4b')]);if(this[_0x27b0('0x19')][_0x1da7e6['origtransfereruniqueid']]){this['channels'][_0x1da7e6['origtransfereruniqueid']][_0x27b0('0x26')]=!![];this[_0x27b0('0x19')][_0x1da7e6[_0x27b0('0x4a')]]=this[_0x27b0('0x19')][_0x1da7e6[_0x27b0('0x4d')]];delete this[_0x27b0('0x19')][_0x1da7e6[_0x27b0('0x4d')]];}}}catch(_0x3cf67c){logger[_0x27b0('0x37')](_0x27b0('0x4e'),_0x3cf67c['message']);}};Acw[_0x27b0('0x17')][_0x27b0('0x4f')]=function(_0x42c9fe){try{if(this[_0x27b0('0x19')][_0x42c9fe['transfereruniqueid']]){logger[_0x27b0('0x24')](_0x27b0('0x50'),JSON[_0x27b0('0x3d')](_0x42c9fe[_0x27b0('0x51')]));this[_0x27b0('0x18')](_0x42c9fe[_0x27b0('0x51')]);}else if(this[_0x27b0('0x19')][_0x42c9fe[_0x27b0('0x52')]]){logger['info'](_0x27b0('0x53'),JSON['stringify'](_0x42c9fe['transfererlinkedid']));this[_0x27b0('0x18')](_0x42c9fe[_0x27b0('0x52')]);}}catch(_0x1845a8){logger[_0x27b0('0x37')](_0x27b0('0x54'),_0x1845a8[_0x27b0('0x3e')]);}};Acw[_0x27b0('0x17')]['syncAgentRingNoAnswer']=function(_0xdeeb6a){try{if(this[_0x27b0('0x6')][_0xdeeb6a[_0x27b0('0x1b')]]&&this[_0x27b0('0x6')][_0xdeeb6a['queue']][_0x27b0('0x55')]===_0x27b0('0x56')){if(this['agents'][_0xdeeb6a[_0x27b0('0x1a')]]){logger[_0x27b0('0x24')](_0x27b0('0x57'),_0xdeeb6a['uniqueid'],_0xdeeb6a[_0x27b0('0x1a')],_0xdeeb6a['queue']);return RpcUser[_0x27b0('0x28')](this['agents'][_0xdeeb6a[_0x27b0('0x1a')]],_0x27b0('0x58'),_0xdeeb6a[_0x27b0('0x30')]);}}}catch(_0x2817f5){logger[_0x27b0('0x37')](_0x27b0('0x59'),_0x2817f5[_0x27b0('0x3e')]);}};module[_0x27b0('0x5a')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 631b4ec..f194129 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 _0x6da0=['once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','ami','../../config/environment','asterisk','port','password','promisify','action','format','username','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x5c7525,_0x39490f){var _0x2e2ec8=function(_0x20d59a){while(--_0x20d59a){_0x5c7525['push'](_0x5c7525['shift']());}};_0x2e2ec8(++_0x39490f);}(_0x6da0,0xc6));var _0x06da=function(_0x46e9dd,_0x150ee4){_0x46e9dd=_0x46e9dd-0x0;var _0x27e525=_0x6da0[_0x46e9dd];return _0x27e525;};'use strict';var Manager=require(_0x06da('0x0'));var BPromise=require(_0x06da('0x1'));var moment=require(_0x06da('0x2'));var util=require(_0x06da('0x3'));var _=require(_0x06da('0x4'));var logger=require(_0x06da('0x5'))(_0x06da('0x6'));var config=require(_0x06da('0x7'));var ami=new Manager(config[_0x06da('0x8')][_0x06da('0x9')],config[_0x06da('0x8')]['ip'],config[_0x06da('0x8')]['username'],config[_0x06da('0x8')][_0x06da('0xa')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0x06da('0xb')](ami[_0x06da('0xc')]);function error(_0x53c0c0){logger['error'](util[_0x06da('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x06da('0x8')][_0x06da('0xe')],config[_0x06da('0x8')]['ip'],config['asterisk'][_0x06da('0x9')],util[_0x06da('0xf')](_0x53c0c0,![],null)));}function close(){logger[_0x06da('0x10')](util[_0x06da('0xd')](_0x06da('0x11'),config[_0x06da('0x8')][_0x06da('0xe')],config['asterisk']['ip'],config[_0x06da('0x8')]['port']));}ami[_0x06da('0x12')]=function(){return function(){return ami[_0x06da('0x13')]({'action':_0x06da('0x14')});};};ami[_0x06da('0x15')]=function(){return function(){return ami[_0x06da('0x13')]({'action':_0x06da('0x16')});};};ami[_0x06da('0x17')]=function(){return function(){return ami['Action']({'action':_0x06da('0x18')});};};ami[_0x06da('0x19')]=function(){return function(){return ami[_0x06da('0x13')]({'action':_0x06da('0x1a')});};};ami[_0x06da('0x1b')]=function(){return function(){return ami[_0x06da('0x13')]({'action':'coreshowchannels'});};};function connect(_0x5601dd){logger[_0x06da('0x1c')](util[_0x06da('0xd')](_0x06da('0x1d'),config['asterisk'][_0x06da('0xe')],config['asterisk']['ip'],config[_0x06da('0x8')][_0x06da('0x9')]));ami[_0x06da('0x1e')](_0x06da('0x10'),error);ami['once']('close',close);}ami['on'](_0x06da('0x1f'),connect);ami['on'](_0x06da('0x20'),function(_0xb07e81){logger[_0x06da('0x1c')](util[_0x06da('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x06da('0x8')][_0x06da('0xe')],config['asterisk']['ip'],config[_0x06da('0x8')]['port'],util[_0x06da('0xf')](_0xb07e81,![],null)));});ami['on'](_0x06da('0x21'),function(_0x40fa0a){logger[_0x06da('0x1c')](util[_0x06da('0xd')](_0x06da('0x22'),config[_0x06da('0x8')][_0x06da('0xe')],config[_0x06da('0x8')]['ip'],config[_0x06da('0x8')][_0x06da('0x9')]));return BPromise[_0x06da('0x23')]()[_0x06da('0x24')](ami['actionSipShowRegistry']())[_0x06da('0x24')](ami[_0x06da('0x15')]())[_0x06da('0x24')](ami['actionSipPeerStatus']())['then'](ami[_0x06da('0x19')]())['then'](ami['actionCoreShowChannels']())[_0x06da('0x25')](function(_0x31cefb){console['log'](_0x31cefb);});});ami[_0x06da('0x1e')]('error',error);ami[_0x06da('0x1e')]('close',close);module['exports']=ami; \ No newline at end of file +var _0x442d=['actionSipShowRegistry','Action','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','coreshowchannels','info','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','actionCoreShowChannels','exports','asterisk-manager','bluebird','moment','util','lodash','ami','asterisk','port','username','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x501fd6,_0x8d4e78){var _0x39b7d6=function(_0x15ce6a){while(--_0x15ce6a){_0x501fd6['push'](_0x501fd6['shift']());}};_0x39b7d6(++_0x8d4e78);}(_0x442d,0xf8));var _0xd442=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x442d[_0x710815];return _0x5b3b89;};'use strict';var Manager=require(_0xd442('0x0'));var BPromise=require(_0xd442('0x1'));var moment=require(_0xd442('0x2'));var util=require(_0xd442('0x3'));var _=require(_0xd442('0x4'));var logger=require('../../config/logger')(_0xd442('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0xd442('0x6')][_0xd442('0x7')],config[_0xd442('0x6')]['ip'],config['asterisk'][_0xd442('0x8')],config['asterisk'][_0xd442('0x9')],!![]);ami[_0xd442('0xa')]();ami['Action']=BPromise[_0xd442('0xb')](ami[_0xd442('0xc')]);function error(_0x437ec3){logger[_0xd442('0xd')](util[_0xd442('0xe')](_0xd442('0xf'),config['asterisk'][_0xd442('0x8')],config[_0xd442('0x6')]['ip'],config['asterisk'][_0xd442('0x7')],util[_0xd442('0x10')](_0x437ec3,![],null)));}function close(){logger[_0xd442('0xd')](util[_0xd442('0xe')](_0xd442('0x11'),config[_0xd442('0x6')][_0xd442('0x8')],config[_0xd442('0x6')]['ip'],config[_0xd442('0x6')]['port']));}ami[_0xd442('0x12')]=function(){return function(){return ami[_0xd442('0x13')]({'action':_0xd442('0x14')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xd442('0x13')]({'action':_0xd442('0x15')});};};ami[_0xd442('0x16')]=function(){return function(){return ami[_0xd442('0x13')]({'action':_0xd442('0x17')});};};ami[_0xd442('0x18')]=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xd442('0x13')]({'action':_0xd442('0x19')});};};function connect(_0x41186e){logger[_0xd442('0x1a')](util[_0xd442('0xe')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config['asterisk']['username'],config[_0xd442('0x6')]['ip'],config[_0xd442('0x6')][_0xd442('0x7')]));ami[_0xd442('0x1b')]('error',error);ami[_0xd442('0x1b')](_0xd442('0x1c'),close);}ami['on'](_0xd442('0x1d'),connect);ami['on'](_0xd442('0x1e'),function(_0x1c973e){logger['info'](util[_0xd442('0xe')](_0xd442('0x1f'),config[_0xd442('0x6')][_0xd442('0x8')],config[_0xd442('0x6')]['ip'],config[_0xd442('0x6')]['port'],util['inspect'](_0x1c973e,![],null)));});ami['on']('fullybooted',function(_0x254f19){logger['info'](util['format'](_0xd442('0x20'),config[_0xd442('0x6')]['username'],config[_0xd442('0x6')]['ip'],config[_0xd442('0x6')]['port']));return BPromise[_0xd442('0x21')]()[_0xd442('0x22')](ami['actionSipShowRegistry']())['then'](ami[_0xd442('0x23')]())[_0xd442('0x22')](ami[_0xd442('0x16')]())[_0xd442('0x22')](ami[_0xd442('0x18')]())[_0xd442('0x22')](ami[_0xd442('0x24')]())['catch'](function(_0x28c8c4){console['log'](_0x28c8c4);});});ami[_0xd442('0x1b')](_0xd442('0xd'),error);ami['once'](_0xd442('0x1c'),close);module[_0xd442('0x25')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index de0697d..a5cf99e 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 _0xda3f=['then','rpc','memberReport','error','message','result','catch','exports','bluebird','../../config/logger','Request','request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xda3f,0xec));var _0xfda3=function(_0x2f1a5e,_0x33050e){_0x2f1a5e=_0x2f1a5e-0x0;var _0x1f8fb9=_0xda3f[_0x2f1a5e];return _0x1f8fb9;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('ami');var client=jayson['client']['http']({'port':0x2329});client[_0xfda3('0x2')]=function(_0x581693,_0x36dc71){return new BPromise(function(_0x22187d,_0x516500){return client[_0xfda3('0x3')](_0x581693,_0x36dc71)[_0xfda3('0x4')](function(_0x47e7e2){logger['debug'](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x36dc71,_0x47e7e2);if(_0x47e7e2[_0xfda3('0x7')]){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')],_0x36dc71);return _0x516500(_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')]);}else{return _0x22187d(_0x47e7e2[_0xfda3('0x9')]);}})[_0xfda3('0xa')](function(_0x4d7841){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x4d7841,_0x36dc71);return _0x516500(_0x4d7841);});});};module[_0xfda3('0xb')]=client; \ No newline at end of file +var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x416cdc,_0x213b87){var _0x1931ce=function(_0x1dc762){while(--_0x1dc762){_0x416cdc['push'](_0x416cdc['shift']());}};_0x1931ce(++_0x213b87);}(_0xac4a,0x13f));var _0xaac4=function(_0x2dcb04,_0x4ed30c){_0x2dcb04=_0x2dcb04-0x0;var _0x26350f=_0xac4a[_0x2dcb04];return _0x26350f;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index ef90ae4..4e1e649 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 _0xe10f=['originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','exports','util','lodash','moment','isNil','string','voiceQueue','name','Contact','phone','lastName','number','queue','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum'];(function(_0x2088a9,_0xb4e821){var _0x711531=function(_0x970759){while(--_0x970759){_0x2088a9['push'](_0x2088a9['shift']());}};_0x711531(++_0xb4e821);}(_0xe10f,0xe3));var _0xfe10=function(_0x48280a,_0x4803f9){_0x48280a=_0x48280a-0x0;var _0x5176ac=_0xe10f[_0x48280a];return _0x5176ac;};'use strict';var util=require(_0xfe10('0x0'));var _=require(_0xfe10('0x1'));var moment=require(_0xfe10('0x2'));function checkNameSurname(_0x558b31,_0x4af981,_0x571b72){var _0x52d156='';if(!_[_0xfe10('0x3')](_0x4af981)&&'string'===typeof _0x4af981){_0x52d156+=_0x4af981;}if(!_[_0xfe10('0x3')](_0x571b72)&&_0xfe10('0x4')===typeof _0x571b72){_0x52d156+='\x20'+_0x571b72;}if(_0x52d156!==''){return _0x52d156;}return _0x558b31;}function Action(_0x4fd7d4,_0x560e05,_0x400a8e){this[_0xfe10('0x5')]=_0x4fd7d4;this['uniqueid']=_0x400a8e||undefined;this[_0xfe10('0x6')]=checkNameSurname(_0x560e05[_0xfe10('0x7')][_0xfe10('0x8')],_0x560e05[_0xfe10('0x7')]['firstName'],_0x560e05[_0xfe10('0x7')][_0xfe10('0x9')]);this[_0xfe10('0xa')]=_0x560e05[_0xfe10('0x7')][_0xfe10('0x8')];this[_0xfe10('0xb')]=_0x4fd7d4[_0xfe10('0x6')];this['active']=_0x560e05['active']||![];this['type']=_0x4fd7d4[_0xfe10('0xc')];this['dialQueueTimeout']=_0x4fd7d4['dialQueueTimeout']||0x3;this[_0xfe10('0xd')]=_0x560e05[_0xfe10('0xd')];this[_0xfe10('0xe')]=_0x560e05[_0xfe10('0xe')];this['countcongestionretry']=_0x560e05[_0xfe10('0xf')];this[_0xfe10('0x10')]=_0x560e05[_0xfe10('0x10')];this[_0xfe10('0x11')]=_0x560e05[_0xfe10('0x11')];this[_0xfe10('0x12')]=_0x560e05[_0xfe10('0x12')];this[_0xfe10('0x13')]=_0x560e05[_0xfe10('0x13')];this[_0xfe10('0x14')]=_0x560e05[_0xfe10('0x14')];this['countagentrejectretry']=_0x560e05[_0xfe10('0x15')];this[_0xfe10('0x16')]=_0x560e05['ContactId'];this[_0xfe10('0x17')]=_0x560e05[_0xfe10('0x17')];this['UserId']=_0x560e05[_0xfe10('0x18')];this[_0xfe10('0x19')]=_0x560e05[_0xfe10('0x19')];this[_0xfe10('0x1a')]=_0x560e05[_0xfe10('0x1a')];this[_0xfe10('0x1b')]=_0x560e05['id'];this[_0xfe10('0x1c')]=_0x560e05[_0xfe10('0x7')][_0xfe10('0x1d')]||'';this['starttime']=moment()[_0xfe10('0x1e')](_0xfe10('0x1f'));this['callback']=_0x560e05[_0xfe10('0x20')];this['callbackuniqueid']=_0x560e05[_0xfe10('0x21')];this[_0xfe10('0x22')]=_0x560e05[_0xfe10('0x22')];this[_0xfe10('0x23')]=_0x560e05[_0xfe10('0x23')];this[_0xfe10('0x24')]='';this[_0xfe10('0x25')]='';}Action[_0xfe10('0x26')][_0xfe10('0x27')]=function(){return util[_0xfe10('0x1e')](_0xfe10('0x28'),this[_0xfe10('0x6')],this['voiceQueue'][_0xfe10('0x29')]>0x0?this[_0xfe10('0xa')][_0xfe10('0x2a')](this['voiceQueue']['dialCutDigit']):this[_0xfe10('0xa')]);};Action[_0xfe10('0x26')]['getQueue']=function(){return this['queue'];};module[_0xfe10('0x2b')]=Action; \ No newline at end of file +var _0x886a=['idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','exports','util','lodash','moment','isNil','voiceQueue','name','Contact','phone','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','VoiceQueueId','CampaignId'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0x886a,0x169));var _0xa886=function(_0x15ec4e,_0x40b7e0){_0x15ec4e=_0x15ec4e-0x0;var _0xb5e5dd=_0x886a[_0x15ec4e];return _0xb5e5dd;};'use strict';var util=require(_0xa886('0x0'));var _=require(_0xa886('0x1'));var moment=require(_0xa886('0x2'));function checkNameSurname(_0x2b224f,_0x492a7c,_0x4d9f95){var _0x36e51e='';if(!_['isNil'](_0x492a7c)&&'string'===typeof _0x492a7c){_0x36e51e+=_0x492a7c;}if(!_[_0xa886('0x3')](_0x4d9f95)&&'string'===typeof _0x4d9f95){_0x36e51e+='\x20'+_0x4d9f95;}if(_0x36e51e!==''){return _0x36e51e;}return _0x2b224f;}function Action(_0x302e16,_0x14d965,_0x1b7937){this[_0xa886('0x4')]=_0x302e16;this['uniqueid']=_0x1b7937||undefined;this[_0xa886('0x5')]=checkNameSurname(_0x14d965[_0xa886('0x6')][_0xa886('0x7')],_0x14d965[_0xa886('0x6')][_0xa886('0x8')],_0x14d965['Contact'][_0xa886('0x9')]);this['number']=_0x14d965[_0xa886('0x6')][_0xa886('0x7')];this[_0xa886('0xa')]=_0x302e16[_0xa886('0x5')];this[_0xa886('0xb')]=_0x14d965[_0xa886('0xb')]||![];this[_0xa886('0xc')]=_0x302e16['type'];this[_0xa886('0xd')]=_0x302e16[_0xa886('0xd')]||0x3;this[_0xa886('0xe')]=_0x14d965[_0xa886('0xe')];this[_0xa886('0xf')]=_0x14d965[_0xa886('0xf')];this[_0xa886('0x10')]=_0x14d965[_0xa886('0x10')];this['countnoanswerretry']=_0x14d965['countnoanswerretry'];this[_0xa886('0x11')]=_0x14d965[_0xa886('0x11')];this['countdropretry']=_0x14d965[_0xa886('0x12')];this['countabandonedretry']=_0x14d965[_0xa886('0x13')];this[_0xa886('0x14')]=_0x14d965[_0xa886('0x14')];this[_0xa886('0x15')]=_0x14d965['countagentrejectretry'];this[_0xa886('0x16')]=_0x14d965[_0xa886('0x16')];this['ListId']=_0x14d965[_0xa886('0x17')];this['UserId']=_0x14d965['UserId'];this['VoiceQueueId']=_0x14d965[_0xa886('0x18')];this['CampaignId']=_0x14d965[_0xa886('0x19')];this[_0xa886('0x1a')]=_0x14d965['id'];this[_0xa886('0x1b')]=_0x14d965[_0xa886('0x6')][_0xa886('0x8')]||'';this[_0xa886('0x1c')]=moment()[_0xa886('0x1d')](_0xa886('0x1e'));this[_0xa886('0x1f')]=_0x14d965['callback'];this[_0xa886('0x20')]=_0x14d965['callbackuniqueid'];this[_0xa886('0x21')]=_0x14d965[_0xa886('0x21')];this[_0xa886('0x22')]=_0x14d965[_0xa886('0x22')];this[_0xa886('0x23')]='';this[_0xa886('0x24')]='';}Action[_0xa886('0x25')][_0xa886('0x26')]=function(){return util[_0xa886('0x1d')](_0xa886('0x27'),this[_0xa886('0x5')],this[_0xa886('0x4')][_0xa886('0x28')]>0x0?this[_0xa886('0x29')]['substring'](this[_0xa886('0x4')][_0xa886('0x28')]):this['number']);};Action[_0xa886('0x25')]['getQueue']=function(){return this[_0xa886('0xa')];};module[_0xa886('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 22b6819..3eb9c96 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 _0xe28c=['countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','endtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x11185e,_0x348fc3){var _0x2c1de7=function(_0x1c8b64){while(--_0x1c8b64){_0x11185e['push'](_0x11185e['shift']());}};_0x2c1de7(++_0x348fc3);}(_0xe28c,0x1b9));var _0xce28=function(_0x3a9635,_0x1ab817){_0x3a9635=_0x3a9635-0x0;var _0x10d08c=_0xe28c[_0x3a9635];return _0x10d08c;};'use strict';var util=require(_0xce28('0x0'));var _=require(_0xce28('0x1'));var moment=require(_0xce28('0x2'));function getSeconds(_0x53c416,_0x2b2356){var _0x387b38=moment(_0x53c416)[_0xce28('0x3')](0x0);var _0x1a67ab=moment(_0x2b2356)[_0xce28('0x3')](0x0);return _0x387b38[_0xce28('0x4')](_0x1a67ab,_0xce28('0x5'));}function AgentComplete(_0xbe8f8f,_0xe5d197){this[_0xce28('0x6')]=0x4;this[_0xce28('0x7')]='Answer';this[_0xce28('0x8')]=_0xbe8f8f[_0xce28('0x8')];this['type']=_0xbe8f8f[_0xce28('0x9')];this[_0xce28('0xa')]=_0xbe8f8f[_0xce28('0x9')]==='outbound'?'queue':_0xbe8f8f[_0xce28('0x9')];this['countbusyretry']=_0xbe8f8f['countbusyretry'];this[_0xce28('0xb')]=_0xbe8f8f['countcongestionretry'];this[_0xce28('0xc')]=_0xbe8f8f[_0xce28('0xc')];this[_0xce28('0xd')]=_0xbe8f8f[_0xce28('0xe')]+_0xbe8f8f[_0xce28('0xb')]+_0xbe8f8f[_0xce28('0xc')]+_0xbe8f8f[_0xce28('0xf')]+_0xbe8f8f[_0xce28('0x10')]+_0xbe8f8f[_0xce28('0x11')]+_0xbe8f8f[_0xce28('0x12')]+_0xbe8f8f[_0xce28('0x13')];this['countnosuchnumberretry']=_0xbe8f8f[_0xce28('0xf')];this[_0xce28('0x10')]=_0xbe8f8f[_0xce28('0x10')];this[_0xce28('0x11')]=_0xbe8f8f['countabandonedretry'];this[_0xce28('0x12')]=_0xbe8f8f[_0xce28('0x12')];this[_0xce28('0x13')]=_0xbe8f8f[_0xce28('0x13')];this[_0xce28('0x14')]=_0xe5d197[_0xce28('0x14')];this[_0xce28('0x15')]=_0xbe8f8f[_0xce28('0x16')];this[_0xce28('0x17')]=_0xbe8f8f[_0xce28('0x18')];this['starttime']=_0xbe8f8f[_0xce28('0x19')];this['responsetime']=_0xbe8f8f[_0xce28('0x1a')];this['answertime']=_0xbe8f8f[_0xce28('0x1b')];this['endtime']=moment()['format'](_0xce28('0x1c'));this['ringtime']=getSeconds(_0xbe8f8f[_0xce28('0x1a')],_0xbe8f8f[_0xce28('0x19')]);this[_0xce28('0x1d')]=getSeconds(_0xbe8f8f['answertime'],_0xbe8f8f[_0xce28('0x1a')]);this[_0xce28('0x1e')]=getSeconds(this[_0xce28('0x1f')],_0xbe8f8f[_0xce28('0x1b')]);this[_0xce28('0x20')]=_0xe5d197['queue'];this['membername']=_0xe5d197[_0xce28('0x21')];this[_0xce28('0x22')]=_0xe5d197[_0xce28('0x22')];this[_0xce28('0x23')]=_0xbe8f8f[_0xce28('0x23')];this[_0xce28('0x24')]=_0xbe8f8f[_0xce28('0x24')];this[_0xce28('0x25')]=_0xbe8f8f[_0xce28('0x25')];this['recallme']=_0xbe8f8f[_0xce28('0x26')];this[_0xce28('0x27')]=_0xbe8f8f[_0xce28('0x27')];this['ListId']=_0xbe8f8f['ListId'];this[_0xce28('0x28')]=_0xbe8f8f[_0xce28('0x28')];this[_0xce28('0x29')]=_0xbe8f8f[_0xce28('0x29')];this[_0xce28('0x2a')]=_0xbe8f8f[_0xce28('0x2a')];this[_0xce28('0x2b')]=_0xbe8f8f[_0xce28('0x2b')]||'';this['originatecalleridname']=_0xbe8f8f[_0xce28('0x2c')]||'';}module[_0xce28('0x2d')]=AgentComplete; \ No newline at end of file +var _0xf9f6=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xf9f6,0x118));var _0x6f9f=function(_0x2d344f,_0x25fa84){_0x2d344f=_0x2d344f-0x0;var _0x2e796b=_0xf9f6[_0x2d344f];return _0x2e796b;};'use strict';var util=require(_0x6f9f('0x0'));var _=require(_0x6f9f('0x1'));var moment=require(_0x6f9f('0x2'));function getSeconds(_0x2d5c2f,_0x2a5e5d){var _0x120f05=moment(_0x2d5c2f)[_0x6f9f('0x3')](0x0);var _0x144e5d=moment(_0x2a5e5d)[_0x6f9f('0x3')](0x0);return _0x120f05[_0x6f9f('0x4')](_0x144e5d,_0x6f9f('0x5'));}function AgentComplete(_0x55638d,_0x55cb9f){this[_0x6f9f('0x6')]=0x4;this[_0x6f9f('0x7')]=_0x6f9f('0x8');this[_0x6f9f('0x9')]=_0x55638d['scheduledat'];this[_0x6f9f('0xa')]=_0x55638d['type'];this[_0x6f9f('0xb')]=_0x55638d[_0x6f9f('0xa')]==='outbound'?_0x6f9f('0xc'):_0x55638d[_0x6f9f('0xa')];this[_0x6f9f('0xd')]=_0x55638d[_0x6f9f('0xd')];this[_0x6f9f('0xe')]=_0x55638d[_0x6f9f('0xe')];this[_0x6f9f('0xf')]=_0x55638d['countnoanswerretry'];this[_0x6f9f('0x10')]=_0x55638d[_0x6f9f('0xd')]+_0x55638d['countcongestionretry']+_0x55638d[_0x6f9f('0xf')]+_0x55638d['countnosuchnumberretry']+_0x55638d[_0x6f9f('0x11')]+_0x55638d[_0x6f9f('0x12')]+_0x55638d['countmachineretry']+_0x55638d[_0x6f9f('0x13')];this['countnosuchnumberretry']=_0x55638d['countnosuchnumberretry'];this[_0x6f9f('0x11')]=_0x55638d[_0x6f9f('0x11')];this[_0x6f9f('0x12')]=_0x55638d[_0x6f9f('0x12')];this[_0x6f9f('0x14')]=_0x55638d[_0x6f9f('0x14')];this[_0x6f9f('0x13')]=_0x55638d[_0x6f9f('0x13')];this[_0x6f9f('0x15')]=_0x55cb9f[_0x6f9f('0x15')];this[_0x6f9f('0x16')]=_0x55638d[_0x6f9f('0x17')];this[_0x6f9f('0x18')]=_0x55638d['number'];this[_0x6f9f('0x19')]=_0x55638d[_0x6f9f('0x19')];this[_0x6f9f('0x1a')]=_0x55638d['responsetime'];this[_0x6f9f('0x1b')]=_0x55638d[_0x6f9f('0x1b')];this[_0x6f9f('0x1c')]=moment()[_0x6f9f('0x1d')](_0x6f9f('0x1e'));this[_0x6f9f('0x1f')]=getSeconds(_0x55638d['responsetime'],_0x55638d[_0x6f9f('0x19')]);this['holdtime']=getSeconds(_0x55638d['answertime'],_0x55638d[_0x6f9f('0x1a')]);this[_0x6f9f('0x20')]=getSeconds(this[_0x6f9f('0x1c')],_0x55638d['answertime']);this[_0x6f9f('0xc')]=_0x55cb9f[_0x6f9f('0xc')];this[_0x6f9f('0x21')]=_0x55cb9f[_0x6f9f('0x21')];this[_0x6f9f('0x22')]=_0x55cb9f[_0x6f9f('0x22')];this[_0x6f9f('0x23')]=_0x55638d['callback'];this[_0x6f9f('0x24')]=_0x55638d[_0x6f9f('0x24')];this[_0x6f9f('0x25')]=_0x55638d[_0x6f9f('0x25')];this[_0x6f9f('0x26')]=_0x55638d[_0x6f9f('0x26')];this[_0x6f9f('0x27')]=_0x55638d['ContactId'];this[_0x6f9f('0x28')]=_0x55638d[_0x6f9f('0x28')];this['UserId']=_0x55638d[_0x6f9f('0x29')];this['VoiceQueueId']=_0x55638d[_0x6f9f('0x2a')];this[_0x6f9f('0x2b')]=_0x55638d['CampaignId'];this[_0x6f9f('0x2c')]=_0x55638d[_0x6f9f('0x2c')]||'';this['originatecalleridname']=_0x55638d[_0x6f9f('0x2d')]||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 850a1ec..0df429e 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 _0x5ad3=['holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','queue','calleridname','calleridnum','starttime','responsetime','endtime'];(function(_0x33eca6,_0x891651){var _0x1ada39=function(_0x31ab8c){while(--_0x31ab8c){_0x33eca6['push'](_0x33eca6['shift']());}};_0x1ada39(++_0x891651);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x45cd59,_0x5be7c0){_0x45cd59=_0x45cd59-0x0;var _0x39541a=_0x5ad3[_0x45cd59];return _0x39541a;};'use strict';var util=require(_0x35ad('0x0'));var _=require(_0x35ad('0x1'));var moment=require(_0x35ad('0x2'));function getSeconds(_0x2a45b7,_0x5543d1){var _0x468072=moment(_0x2a45b7)[_0x35ad('0x3')](0x0);var _0xc77352=moment(_0x5543d1)[_0x35ad('0x3')](0x0);return _0x468072[_0x35ad('0x4')](_0xc77352,_0x35ad('0x5'));}function Final(_0x729a01){this[_0x35ad('0x6')]=_0x729a01[_0x35ad('0x6')];this[_0x35ad('0x7')]=_0x729a01['scheduledat'];this[_0x35ad('0x8')]=_0x729a01[_0x35ad('0x8')];this[_0x35ad('0x9')]=_0x729a01['type']===_0x35ad('0xa')?'queue':_0x729a01['type'];this[_0x35ad('0xb')]=_0x729a01[_0x35ad('0xb')];this['countcongestionretry']=_0x729a01[_0x35ad('0xc')];this[_0x35ad('0xd')]=_0x729a01['countnoanswerretry'];this['countglobal']=_0x729a01[_0x35ad('0xb')]+_0x729a01[_0x35ad('0xc')]+_0x729a01['countnoanswerretry']+_0x729a01[_0x35ad('0xe')]+_0x729a01[_0x35ad('0xf')]+_0x729a01['countabandonedretry']+_0x729a01['countmachineretry']+_0x729a01[_0x35ad('0x10')];this[_0x35ad('0xe')]=_0x729a01[_0x35ad('0xe')];this['countdropretry']=_0x729a01[_0x35ad('0xf')];this[_0x35ad('0x11')]=_0x729a01['countabandonedretry'];this[_0x35ad('0x12')]=_0x729a01['countmachineretry'];this['countagentrejectretry']=_0x729a01[_0x35ad('0x10')];this[_0x35ad('0x13')]=_0x729a01[_0x35ad('0x13')];this['calleridname']=_0x729a01[_0x35ad('0x14')];this[_0x35ad('0x15')]=_0x729a01[_0x35ad('0x15')];this[_0x35ad('0x16')]=_0x729a01[_0x35ad('0x16')];this[_0x35ad('0x17')]=_0x729a01['responsetime'];this[_0x35ad('0x18')]=_0x729a01[_0x35ad('0x17')];this['ringtime']=_0x729a01['ringtime']||0x0;this[_0x35ad('0x19')]=_0x729a01[_0x35ad('0x19')]||0x0;this['talktime']=_0x729a01[_0x35ad('0x1a')]||0x0;this[_0x35ad('0x1b')]=_0x729a01['callback'];this[_0x35ad('0x1c')]=_0x729a01[_0x35ad('0x1c')];this[_0x35ad('0x1d')]=_0x729a01[_0x35ad('0x1d')];this[_0x35ad('0x1e')]=_0x729a01[_0x35ad('0x1e')];this[_0x35ad('0x1f')]=_0x729a01[_0x35ad('0x1f')];this[_0x35ad('0x20')]=_0x729a01[_0x35ad('0x20')];this['UserId']=_0x729a01[_0x35ad('0x21')];this[_0x35ad('0x22')]=_0x729a01['VoiceQueueId'];this[_0x35ad('0x23')]=_0x729a01[_0x35ad('0x23')];this[_0x35ad('0x24')]=_0x729a01[_0x35ad('0x24')]||'';this[_0x35ad('0x25')]=_0x729a01['originatecalleridname']||'';}module[_0x35ad('0x26')]=Final; \ No newline at end of file +var _0xbfe8=['countagentrejectretry','countabandonedretry','countmachineretry','calleridname','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x5d26bd,_0x3f13c7){var _0x69f246=function(_0x3b8539){while(--_0x3b8539){_0x5d26bd['push'](_0x5d26bd['shift']());}};_0x69f246(++_0x3f13c7);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x2a32a3,_0xfaa409){_0x2a32a3=_0x2a32a3-0x0;var _0x4d874c=_0xbfe8[_0x2a32a3];return _0x4d874c;};'use strict';var util=require('util');var _=require(_0x8bfe('0x0'));var moment=require('moment');function getSeconds(_0x1fd32c,_0x39d664){var _0x56fddf=moment(_0x1fd32c)['milliseconds'](0x0);var _0x101fc1=moment(_0x39d664)[_0x8bfe('0x1')](0x0);return _0x56fddf['diff'](_0x101fc1,_0x8bfe('0x2'));}function Final(_0x1deab0){this[_0x8bfe('0x3')]=_0x1deab0['uniqueid'];this[_0x8bfe('0x4')]=_0x1deab0[_0x8bfe('0x4')];this[_0x8bfe('0x5')]=_0x1deab0[_0x8bfe('0x5')];this[_0x8bfe('0x6')]=_0x1deab0[_0x8bfe('0x5')]===_0x8bfe('0x7')?_0x8bfe('0x8'):_0x1deab0[_0x8bfe('0x5')];this[_0x8bfe('0x9')]=_0x1deab0[_0x8bfe('0x9')];this[_0x8bfe('0xa')]=_0x1deab0[_0x8bfe('0xa')];this[_0x8bfe('0xb')]=_0x1deab0[_0x8bfe('0xb')];this['countglobal']=_0x1deab0[_0x8bfe('0x9')]+_0x1deab0['countcongestionretry']+_0x1deab0[_0x8bfe('0xb')]+_0x1deab0[_0x8bfe('0xc')]+_0x1deab0[_0x8bfe('0xd')]+_0x1deab0['countabandonedretry']+_0x1deab0['countmachineretry']+_0x1deab0[_0x8bfe('0xe')];this[_0x8bfe('0xc')]=_0x1deab0[_0x8bfe('0xc')];this[_0x8bfe('0xd')]=_0x1deab0[_0x8bfe('0xd')];this['countabandonedretry']=_0x1deab0[_0x8bfe('0xf')];this[_0x8bfe('0x10')]=_0x1deab0['countmachineretry'];this[_0x8bfe('0xe')]=_0x1deab0[_0x8bfe('0xe')];this[_0x8bfe('0x8')]=_0x1deab0['queue'];this['calleridname']=_0x1deab0[_0x8bfe('0x11')];this['calleridnum']=_0x1deab0['calleridnum'];this[_0x8bfe('0x12')]=_0x1deab0[_0x8bfe('0x12')];this[_0x8bfe('0x13')]=_0x1deab0[_0x8bfe('0x13')];this[_0x8bfe('0x14')]=_0x1deab0[_0x8bfe('0x13')];this[_0x8bfe('0x15')]=_0x1deab0['ringtime']||0x0;this[_0x8bfe('0x16')]=_0x1deab0['holdtime']||0x0;this[_0x8bfe('0x17')]=_0x1deab0[_0x8bfe('0x17')]||0x0;this[_0x8bfe('0x18')]=_0x1deab0['callback'];this['callbackuniqueid']=_0x1deab0[_0x8bfe('0x19')];this['callbackat']=_0x1deab0['callbackat'];this[_0x8bfe('0x1a')]=_0x1deab0['recallme'];this[_0x8bfe('0x1b')]=_0x1deab0['ContactId'];this[_0x8bfe('0x1c')]=_0x1deab0[_0x8bfe('0x1c')];this[_0x8bfe('0x1d')]=_0x1deab0[_0x8bfe('0x1d')];this['VoiceQueueId']=_0x1deab0[_0x8bfe('0x1e')];this[_0x8bfe('0x1f')]=_0x1deab0['CampaignId'];this[_0x8bfe('0x20')]=_0x1deab0[_0x8bfe('0x20')]||'';this[_0x8bfe('0x21')]=_0x1deab0[_0x8bfe('0x21')]||'';}module[_0x8bfe('0x22')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 13c46a0..6b4c18e 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 _0x1aa3=['util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','ringtime','talktime','endtime','queue','membername','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports'];(function(_0x101d7b,_0x20f180){var _0x5952df=function(_0x42049e){while(--_0x42049e){_0x101d7b['push'](_0x101d7b['shift']());}};_0x5952df(++_0x20f180);}(_0x1aa3,0x195));var _0x31aa=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0x1aa3[_0x261b8a];return _0x3455e8;};'use strict';var util=require(_0x31aa('0x0'));var _=require(_0x31aa('0x1'));var moment=require(_0x31aa('0x2'));function getSeconds(_0xee7138,_0xf85312){var _0x52dfeb=moment(_0xee7138)[_0x31aa('0x3')](0x0);var _0x45e5d8=moment(_0xf85312)[_0x31aa('0x3')](0x0);return _0x52dfeb[_0x31aa('0x4')](_0x45e5d8,_0x31aa('0x5'));}function Hangup(_0x474993,_0x3632ac){this[_0x31aa('0x6')]=0x4;this[_0x31aa('0x7')]=_0x31aa('0x8');this[_0x31aa('0x9')]=_0x474993['scheduledat'];this['type']=_0x474993[_0x31aa('0xa')];this[_0x31aa('0xb')]=_0x474993['type']===_0x31aa('0xc')?'queue':_0x474993[_0x31aa('0xa')];this[_0x31aa('0xd')]=_0x474993[_0x31aa('0xd')];this['countcongestionretry']=_0x474993[_0x31aa('0xe')];this[_0x31aa('0xf')]=_0x474993[_0x31aa('0xf')];this[_0x31aa('0x10')]=_0x474993[_0x31aa('0xd')]+_0x474993[_0x31aa('0xe')]+_0x474993[_0x31aa('0xf')]+_0x474993[_0x31aa('0x11')]+_0x474993[_0x31aa('0x12')]+_0x474993[_0x31aa('0x13')]+_0x474993[_0x31aa('0x14')]+_0x474993[_0x31aa('0x15')];this[_0x31aa('0x11')]=_0x474993[_0x31aa('0x11')];this[_0x31aa('0x12')]=_0x474993[_0x31aa('0x12')];this['countabandonedretry']=_0x474993[_0x31aa('0x13')];this[_0x31aa('0x14')]=_0x474993['countmachineretry'];this[_0x31aa('0x15')]=_0x474993[_0x31aa('0x15')];this[_0x31aa('0x16')]=_0x3632ac['uniqueid'];this[_0x31aa('0x17')]=_0x474993[_0x31aa('0x18')];this[_0x31aa('0x19')]=_0x474993[_0x31aa('0x1a')];this[_0x31aa('0x1b')]=_0x474993[_0x31aa('0x1b')];this[_0x31aa('0x1c')]=_0x474993[_0x31aa('0x1c')];this['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x31aa('0x1d')]=getSeconds(_0x474993[_0x31aa('0x1c')],_0x474993[_0x31aa('0x1b')]);this['holdtime']=0x0;this[_0x31aa('0x1e')]=getSeconds(this[_0x31aa('0x1f')],_0x474993[_0x31aa('0x1c')]);this[_0x31aa('0x20')]=_0x474993['queue'];this[_0x31aa('0x21')]='IVR';this['reason']=_0x3632ac[_0x31aa('0x22')];this[_0x31aa('0x23')]=_0x474993['callback'];this['callbackuniqueid']=_0x474993[_0x31aa('0x24')];this[_0x31aa('0x25')]=_0x474993[_0x31aa('0x25')];this[_0x31aa('0x26')]=_0x474993[_0x31aa('0x26')];this[_0x31aa('0x27')]=_0x474993[_0x31aa('0x27')];this['ListId']=_0x474993[_0x31aa('0x28')];this['UserId']=_0x474993[_0x31aa('0x29')];this[_0x31aa('0x2a')]=_0x474993[_0x31aa('0x2a')];this[_0x31aa('0x2b')]=_0x474993[_0x31aa('0x2b')];}module[_0x31aa('0x2c')]=Hangup; \ No newline at end of file +var _0x37b5=['responsetime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','number','starttime'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x37b5,0x90));var _0x537b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x37b5[_0x14add3];return _0x4a174f;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x537b('0x0'));function getSeconds(_0x447e1e,_0x8c3a84){var _0x17b0bc=moment(_0x447e1e)[_0x537b('0x1')](0x0);var _0x108238=moment(_0x8c3a84)[_0x537b('0x1')](0x0);return _0x17b0bc[_0x537b('0x2')](_0x108238,_0x537b('0x3'));}function Hangup(_0x14cf64,_0x2ccab5){this[_0x537b('0x4')]=0x4;this[_0x537b('0x5')]=_0x537b('0x6');this['scheduledat']=_0x14cf64[_0x537b('0x7')];this[_0x537b('0x8')]=_0x14cf64[_0x537b('0x8')];this[_0x537b('0x9')]=_0x14cf64['type']===_0x537b('0xa')?_0x537b('0xb'):_0x14cf64[_0x537b('0x8')];this[_0x537b('0xc')]=_0x14cf64[_0x537b('0xc')];this['countcongestionretry']=_0x14cf64['countcongestionretry'];this[_0x537b('0xd')]=_0x14cf64[_0x537b('0xd')];this[_0x537b('0xe')]=_0x14cf64[_0x537b('0xc')]+_0x14cf64['countcongestionretry']+_0x14cf64[_0x537b('0xd')]+_0x14cf64[_0x537b('0xf')]+_0x14cf64[_0x537b('0x10')]+_0x14cf64['countabandonedretry']+_0x14cf64['countmachineretry']+_0x14cf64['countagentrejectretry'];this['countnosuchnumberretry']=_0x14cf64[_0x537b('0xf')];this['countdropretry']=_0x14cf64['countdropretry'];this[_0x537b('0x11')]=_0x14cf64[_0x537b('0x11')];this[_0x537b('0x12')]=_0x14cf64[_0x537b('0x12')];this[_0x537b('0x13')]=_0x14cf64['countagentrejectretry'];this[_0x537b('0x14')]=_0x2ccab5[_0x537b('0x14')];this[_0x537b('0x15')]=_0x14cf64['name'];this['calleridnum']=_0x14cf64[_0x537b('0x16')];this[_0x537b('0x17')]=_0x14cf64[_0x537b('0x17')];this[_0x537b('0x18')]=_0x14cf64[_0x537b('0x18')];this['endtime']=moment()['format'](_0x537b('0x19'));this[_0x537b('0x1a')]=getSeconds(_0x14cf64[_0x537b('0x18')],_0x14cf64[_0x537b('0x17')]);this[_0x537b('0x1b')]=0x0;this[_0x537b('0x1c')]=getSeconds(this['endtime'],_0x14cf64[_0x537b('0x18')]);this['queue']=_0x14cf64[_0x537b('0xb')];this[_0x537b('0x1d')]='IVR';this[_0x537b('0x1e')]=_0x2ccab5[_0x537b('0x1f')];this[_0x537b('0x20')]=_0x14cf64[_0x537b('0x20')];this[_0x537b('0x21')]=_0x14cf64[_0x537b('0x21')];this[_0x537b('0x22')]=_0x14cf64['callbackat'];this[_0x537b('0x23')]=_0x14cf64[_0x537b('0x23')];this[_0x537b('0x24')]=_0x14cf64[_0x537b('0x24')];this[_0x537b('0x25')]=_0x14cf64[_0x537b('0x25')];this['UserId']=_0x14cf64[_0x537b('0x26')];this[_0x537b('0x27')]=_0x14cf64[_0x537b('0x27')];this[_0x537b('0x28')]=_0x14cf64['CampaignId'];}module[_0x537b('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index bfadc9a..7ba107e 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 _0x50ca=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry'];(function(_0x21ce76,_0x5ae34b){var _0x259a92=function(_0x20a352){while(--_0x20a352){_0x21ce76['push'](_0x21ce76['shift']());}};_0x259a92(++_0x5ae34b);}(_0x50ca,0x19e));var _0xa50c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x50ca[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0xa50c('0x0'));var _=require(_0xa50c('0x1'));var moment=require(_0xa50c('0x2'));function getSeconds(_0x1e4f32,_0x4db2ce){var _0x59c42e=moment(_0x1e4f32)[_0xa50c('0x3')](0x0);var _0x64c7cf=moment(_0x4db2ce)[_0xa50c('0x3')](0x0);return _0x59c42e[_0xa50c('0x4')](_0x64c7cf,'seconds');}function History(_0x512c25){this[_0xa50c('0x5')]=_0x512c25[_0xa50c('0x5')];this[_0xa50c('0x6')]=_0x512c25['scheduledat']||undefined;this[_0xa50c('0x7')]=_0x512c25[_0xa50c('0x7')];this[_0xa50c('0x8')]=_0x512c25[_0xa50c('0x7')]===_0xa50c('0x9')?_0xa50c('0xa'):_0x512c25[_0xa50c('0x7')];this[_0xa50c('0xb')]=_0x512c25[_0xa50c('0xb')];this['countcongestionretry']=_0x512c25['countcongestionretry'];this[_0xa50c('0xc')]=_0x512c25[_0xa50c('0xc')];this[_0xa50c('0xd')]=_0x512c25['countbusyretry']+_0x512c25[_0xa50c('0xe')]+_0x512c25[_0xa50c('0xc')]+_0x512c25[_0xa50c('0xf')]+_0x512c25[_0xa50c('0x10')]+_0x512c25[_0xa50c('0x11')]+_0x512c25[_0xa50c('0x12')]+_0x512c25[_0xa50c('0x13')];this[_0xa50c('0xf')]=_0x512c25[_0xa50c('0xf')];this[_0xa50c('0x10')]=_0x512c25[_0xa50c('0x10')];this[_0xa50c('0x11')]=_0x512c25[_0xa50c('0x11')];this[_0xa50c('0x12')]=_0x512c25[_0xa50c('0x12')];this[_0xa50c('0x13')]=_0x512c25[_0xa50c('0x13')];this[_0xa50c('0xa')]=_0x512c25[_0xa50c('0xa')];this[_0xa50c('0x14')]=_0x512c25[_0xa50c('0x15')];this[_0xa50c('0x16')]=_0x512c25[_0xa50c('0x17')];this[_0xa50c('0x18')]=_0x512c25[_0xa50c('0x18')];this[_0xa50c('0x19')]=_0x512c25['responsetime'];this['endtime']=_0x512c25['responsetime'];this[_0xa50c('0x1a')]=getSeconds(_0x512c25[_0xa50c('0x19')],_0x512c25[_0xa50c('0x18')]);this[_0xa50c('0x1b')]=0x0;this[_0xa50c('0x1c')]=0x0;this[_0xa50c('0x1d')]=_0x512c25['callback'];this[_0xa50c('0x1e')]=_0x512c25[_0xa50c('0x1e')];this['callbackat']=_0x512c25['callbackat'];this[_0xa50c('0x1f')]=_0x512c25['recallme'];this[_0xa50c('0x20')]=_0x512c25[_0xa50c('0x20')];this['ListId']=_0x512c25[_0xa50c('0x21')];this[_0xa50c('0x22')]=_0x512c25['UserId'];this['VoiceQueueId']=_0x512c25[_0xa50c('0x23')];this['CampaignId']=_0x512c25['CampaignId'];this['originatecalleridnum']=_0x512c25[_0xa50c('0x24')]||'';this[_0xa50c('0x25')]=_0x512c25[_0xa50c('0x25')]||'';}module[_0xa50c('0x26')]=History; \ No newline at end of file +var _0x42d9=['responsetime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','milliseconds','diff','seconds','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x42d9,0x160));var _0x942d=function(_0x5f2668,_0x29630f){_0x5f2668=_0x5f2668-0x0;var _0x42df13=_0x42d9[_0x5f2668];return _0x42df13;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x478981,_0x42b2fb){var _0x42bd9e=moment(_0x478981)['milliseconds'](0x0);var _0x299436=moment(_0x42b2fb)[_0x942d('0x0')](0x0);return _0x42bd9e[_0x942d('0x1')](_0x299436,_0x942d('0x2'));}function History(_0x1d1e4b){this[_0x942d('0x3')]=_0x1d1e4b[_0x942d('0x3')];this['scheduledat']=_0x1d1e4b['scheduledat']||undefined;this[_0x942d('0x4')]=_0x1d1e4b['type'];this[_0x942d('0x5')]=_0x1d1e4b['type']===_0x942d('0x6')?_0x942d('0x7'):_0x1d1e4b[_0x942d('0x4')];this[_0x942d('0x8')]=_0x1d1e4b[_0x942d('0x8')];this['countcongestionretry']=_0x1d1e4b['countcongestionretry'];this[_0x942d('0x9')]=_0x1d1e4b[_0x942d('0x9')];this[_0x942d('0xa')]=_0x1d1e4b['countbusyretry']+_0x1d1e4b[_0x942d('0xb')]+_0x1d1e4b[_0x942d('0x9')]+_0x1d1e4b[_0x942d('0xc')]+_0x1d1e4b[_0x942d('0xd')]+_0x1d1e4b['countabandonedretry']+_0x1d1e4b[_0x942d('0xe')]+_0x1d1e4b['countagentrejectretry'];this[_0x942d('0xc')]=_0x1d1e4b[_0x942d('0xc')];this[_0x942d('0xd')]=_0x1d1e4b['countdropretry'];this[_0x942d('0xf')]=_0x1d1e4b['countabandonedretry'];this[_0x942d('0xe')]=_0x1d1e4b[_0x942d('0xe')];this['countagentrejectretry']=_0x1d1e4b[_0x942d('0x10')];this[_0x942d('0x7')]=_0x1d1e4b[_0x942d('0x7')];this[_0x942d('0x11')]=_0x1d1e4b[_0x942d('0x12')];this[_0x942d('0x13')]=_0x1d1e4b[_0x942d('0x14')];this[_0x942d('0x15')]=_0x1d1e4b[_0x942d('0x15')];this[_0x942d('0x16')]=_0x1d1e4b['responsetime'];this['endtime']=_0x1d1e4b[_0x942d('0x16')];this['ringtime']=getSeconds(_0x1d1e4b[_0x942d('0x16')],_0x1d1e4b['starttime']);this[_0x942d('0x17')]=0x0;this['talktime']=0x0;this[_0x942d('0x18')]=_0x1d1e4b[_0x942d('0x18')];this[_0x942d('0x19')]=_0x1d1e4b[_0x942d('0x19')];this[_0x942d('0x1a')]=_0x1d1e4b[_0x942d('0x1a')];this[_0x942d('0x1b')]=_0x1d1e4b[_0x942d('0x1b')];this[_0x942d('0x1c')]=_0x1d1e4b['ContactId'];this[_0x942d('0x1d')]=_0x1d1e4b['ListId'];this[_0x942d('0x1e')]=_0x1d1e4b['UserId'];this[_0x942d('0x1f')]=_0x1d1e4b[_0x942d('0x1f')];this['CampaignId']=_0x1d1e4b['CampaignId'];this[_0x942d('0x20')]=_0x1d1e4b['originatecalleridnum']||'';this[_0x942d('0x21')]=_0x1d1e4b[_0x942d('0x21')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index ca869bb..ef55fe3 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 _0xd139=['loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','SIP/%s','unmonitored','isNil','amdstatus','exten','value','HANGUP','HangupInAMD','membername','AMD','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','dialAMDActive','MACHINE','uniqueid','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncAgentComplete][createHistory][0]','reason\x2019\x20machine....','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','dropreason','TIMEOUT','countglobal','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','[booked][RR][finaly]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','Action','command','iftime\x20%s,%s','interval','timezones','indexOf','true','all','some','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','dialMethod','handlePower','power','dialPowerLevel','predictive','launchHandleIvr','handleIvr','loggedIn','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','[syncCampaigns]','pow','replace','random','match','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','substring','trim','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','[CatchErlangB]','agentBusyFactor','outboundQueuePauses','busyFactor','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','dialRecallMeTimeout','Agent','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','dialOrderByScheduledAt','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','util','lodash','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./final','./agentComplete','./queueCallerAbandon','./hangup','env','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','stringify','milliseconds','diff','seconds','type','outbound','strategy','answered','available','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','voice:queue:%s','ivr','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','predictiveIntervalAvgHoldtime','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','merge','clearing\x20variable\x20start\x20progressive','startPredictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','uniqueId','[uniqueid]','clearZombieChannels','[actions]','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','resolve','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined'];(function(_0x5ec3f0,_0x113dc1){var _0x13fcb6=function(_0x5e2c68){while(--_0x5e2c68){_0x5ec3f0['push'](_0x5ec3f0['shift']());}};_0x13fcb6(++_0x113dc1);}(_0xd139,0x14e));var _0x9d13=function(_0x22b490,_0x3a50d0){_0x22b490=_0x22b490-0x0;var _0x2700c9=_0xd139[_0x22b490];return _0x2700c9;};'use strict';var util=require(_0x9d13('0x0'));var _=require(_0x9d13('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x9d13('0x2'));var rr=require('rr');var md5=require(_0x9d13('0x3'));var Redis=require(_0x9d13('0x4'));var ut=require(_0x9d13('0x5'));var config=require(_0x9d13('0x6'));var logger=require(_0x9d13('0x7'))(_0x9d13('0x8'));var loggerBooked=require('../../../config/logger')(_0x9d13('0x9'));var loggerPredictive=require(_0x9d13('0x7'))('predictive');var loggerPredictiveCalls=require(_0x9d13('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x9d13('0x7'))('syncQueueSummary');var ami=require('../ami');config['redis']=_[_0x9d13('0xa')](config[_0x9d13('0xb')],{'host':_0x9d13('0xc'),'port':0x18eb});var io=require(_0x9d13('0xd'))(new Redis(config[_0x9d13('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x9d13('0xe'));var cmHopperBlack=require(_0x9d13('0xf'));var voiceQueueRt=require(_0x9d13('0x10'));var Action=require('./action');var History=require('./history');var Final=require(_0x9d13('0x11'));var AgentComplete=require(_0x9d13('0x12'));var QueueCallerAbandon=require(_0x9d13('0x13'));var Hangup=require(_0x9d13('0x14'));var ipAgi=process[_0x9d13('0x15')]['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':_0x9d13('0x16'),'roundrobin':_0x9d13('0x17')};var Sequence=function(){};Sequence[_0x9d13('0x18')][_0x9d13('0x19')]=function(_0x235c7f){this[_0x9d13('0x1a')]=this[_0x9d13('0x1a')]?this['tail'][_0x9d13('0x1b')](_0x235c7f):_0x235c7f();};function Dialer(_0x1b473e,_0x16a77b){this[_0x9d13('0x1c')]=new Sequence();this[_0x9d13('0x1d')]=_0x16a77b;this[_0x9d13('0x1e')]=_0x1b473e[_0x9d13('0x1e')];this[_0x9d13('0x1f')]=_0x1b473e[_0x9d13('0x1f')];this[_0x9d13('0x20')]=_0x1b473e[_0x9d13('0x20')];this[_0x9d13('0x21')]=_0x1b473e[_0x9d13('0x21')];this['maxNumberOriginate']=config[_0x9d13('0x22')]||0x2;this[_0x9d13('0x23')]={};this[_0x9d13('0x24')]={};this[_0x9d13('0x25')]={};this['uniqueId']={};this['optionPredictive']={};this['startPredictive']={};this[_0x9d13('0x26')]={};this[_0x9d13('0x27')]={};this[_0x9d13('0x28')]={};this[_0x9d13('0x29')]={};ami['on'](_0x9d13('0x2a'),this[_0x9d13('0x2b')][_0x9d13('0x2c')](this));ami['on'](_0x9d13('0x2d'),this['syncQueueCallerAbandon'][_0x9d13('0x2c')](this));ami['on'](_0x9d13('0x2e'),this[_0x9d13('0x2f')][_0x9d13('0x2c')](this));ami['on']('agentcomplete',this[_0x9d13('0x30')]['bind'](this));ami['on'](_0x9d13('0x31'),this[_0x9d13('0x32')][_0x9d13('0x2c')](this));ami['on'](_0x9d13('0x33'),this[_0x9d13('0x34')][_0x9d13('0x2c')](this));ami['on'](_0x9d13('0x35'),this[_0x9d13('0x36')]['bind'](this));ami['on'](_0x9d13('0x37'),this['syncVarSet'][_0x9d13('0x2c')](this));ami['on'](_0x9d13('0x38'),this[_0x9d13('0x39')][_0x9d13('0x2c')](this));ami['on'](_0x9d13('0x3a'),this[_0x9d13('0x3b')][_0x9d13('0x2c')](this));this[_0x9d13('0x3c')]();this[_0x9d13('0x3d')]();}function isNotNull(_0x1412ca){return _0x1412ca!==null&&!_[_0x9d13('0x3e')](_0x1412ca);}function checkIsLoggedIn(_0x21e35a,_0x523e5e){return function(){if(_0x523e5e<=0x0){_0x21e35a[_0x9d13('0x3f')]='AGENTS_NOT_LOGGED';throw _0x21e35a[_0x9d13('0x40')]+_0x9d13('0x41');}};}function isActive(_0x50a25e){return _0x50a25e;}function checkIsActive(_0x80ac08,_0x106aae){return function(){if(!isActive(_0x106aae)){_0x80ac08['message']='NOT_ACTIVE';throw _0x80ac08['name']+_0x9d13('0x42');}};}function checkInterval(_0x5ad0a9){return function(){if(!isNotNull(_0x5ad0a9[_0x9d13('0x43')])){_0x5ad0a9[_0x9d13('0x3f')]=_0x9d13('0x44');throw _0x5ad0a9['name']+_0x9d13('0x45');}if(!isNotNull(_0x5ad0a9[_0x9d13('0x43')][_0x9d13('0x46')])){_0x5ad0a9[_0x9d13('0x3f')]='INTERVAL_IS_NULL';throw _0x5ad0a9['name']+_0x9d13('0x45');}if(!isNotNull(_[_0x9d13('0x47')](_0x5ad0a9['Interval'][_0x9d13('0x46')]))){_0x5ad0a9[_0x9d13('0x3f')]=_0x9d13('0x44');throw _0x5ad0a9[_0x9d13('0x40')]+_0x9d13('0x45');}};}function msgResponse(_0x304f6e,_0x40c030,_0x5d3c2b){return{'action':_0x304f6e,'response':_0x40c030,'message':_0x5d3c2b,'stack':_0x5d3c2b};}function myreject(_0x465b97){return function(_0x5eed61){return _0x465b97(msgResponse('[ifTime][Action]','Error',JSON[_0x9d13('0x48')](_0x5eed61)));};}function getSeconds(_0x472803,_0x3f1c01){var _0x2c0fac=moment(_0x472803)[_0x9d13('0x49')](0x0);var _0x4b32d8=moment(_0x3f1c01)[_0x9d13('0x49')](0x0);return _0x2c0fac[_0x9d13('0x4a')](_0x4b32d8,_0x9d13('0x4b'));}function emit(_0x2bad38,_0x41ae16,_0x9e47b3){io['to'](_0x2bad38)['emit'](_0x41ae16,_0x9e47b3);}function emitVoiceQueueSummary(_0x3f2bb9){if(_0x3f2bb9[_0x9d13('0x4c')]===_0x9d13('0x4d')){var _0x547a6b={'id':_0x3f2bb9['id'],'name':_0x3f2bb9['name'],'strategy':_0x3f2bb9[_0x9d13('0x4e')],'answered':_0x3f2bb9[_0x9d13('0x4f')],'available':_0x3f2bb9[_0x9d13('0x50')],'loggedIn':_0x3f2bb9['loggedIn'],'pTalking':_0x3f2bb9[_0x9d13('0x51')],'sumBillable':_0x3f2bb9[_0x9d13('0x52')],'sumDuration':_0x3f2bb9['sumDuration'],'sumHoldTime':_0x3f2bb9[_0x9d13('0x53')]||0x0,'talking':_0x3f2bb9[_0x9d13('0x54')],'total':_0x3f2bb9[_0x9d13('0x55')],'type':_0x3f2bb9[_0x9d13('0x4c')],'unmanaged':_0x3f2bb9[_0x9d13('0x56')],'abandoned':_0x3f2bb9[_0x9d13('0x57')],'waiting':_0x3f2bb9[_0x9d13('0x58')],'loggedInDb':_0x3f2bb9[_0x9d13('0x59')],'dialActive':_0x3f2bb9[_0x9d13('0x5a')],'dialMethod':_0x3f2bb9['dialMethod'],'dialOriginateCallerIdName':_0x3f2bb9[_0x9d13('0x5b')],'dialOriginateCallerIdNumber':_0x3f2bb9[_0x9d13('0x5c')],'dialOriginateTimeout':_0x3f2bb9[_0x9d13('0x5d')],'dialPrefix':_0x3f2bb9[_0x9d13('0x5e')],'outboundAnswerAgiCallsDay':_0x3f2bb9[_0x9d13('0x5f')],'outboundAnswerCallsDay':_0x3f2bb9[_0x9d13('0x60')],'outboundBlacklistCallsDay':_0x3f2bb9[_0x9d13('0x61')],'outboundBusyCallsDay':_0x3f2bb9['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x3f2bb9[_0x9d13('0x62')],'outboundDropCallsDayACS':_0x3f2bb9[_0x9d13('0x63')],'outboundDropCallsDayCallersExit':_0x3f2bb9[_0x9d13('0x64')],'outboundDropCallsDayTimeout':_0x3f2bb9[_0x9d13('0x65')],'outboundNoAnswerCallsDay':_0x3f2bb9[_0x9d13('0x66')],'outboundNoSuchCallsDay':_0x3f2bb9[_0x9d13('0x67')],'outboundOriginateFailureCallsDay':_0x3f2bb9['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x3f2bb9['outboundReCallsDay'],'outboundRejectCallsDay':_0x3f2bb9[_0x9d13('0x68')],'outboundUnknownCallsDay':_0x3f2bb9['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x3f2bb9[_0x9d13('0x69')],'predictiveIntervalAvgHoldtime':_0x3f2bb9['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3f2bb9[_0x9d13('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x3f2bb9[_0x9d13('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x3f2bb9[_0x9d13('0x6c')],'predictiveIntervalErlangCalls':_0x3f2bb9[_0x9d13('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x3f2bb9[_0x9d13('0x6e')],'predictiveIntervalHitRate':_0x3f2bb9['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x3f2bb9[_0x9d13('0x6f')],'predictiveIntervalPauses':_0x3f2bb9[_0x9d13('0x70')],'predictiveIntervalAvailable':_0x3f2bb9[_0x9d13('0x71')],'predictiveIntervalTotalCalls':_0x3f2bb9[_0x9d13('0x72')],'message':_0x3f2bb9[_0x9d13('0x3f')],'originated':_0x3f2bb9[_0x9d13('0x73')],'erlangCalls':_0x3f2bb9[_0x9d13('0x74')],'erlangCallToSecond':_0x3f2bb9[_0x9d13('0x75')],'erlangAbandonmentRate':_0x3f2bb9[_0x9d13('0x76')],'erlangBusyFactor':_0x3f2bb9[_0x9d13('0x77')],'startPredictive':_0x3f2bb9['startPredictive'],'startProgressive':_0x3f2bb9['startProgressive']};if(_0x3f2bb9[_0x9d13('0x78')]){_0x547a6b[_0x9d13('0x78')]={'id':_0x3f2bb9['Trunk']['id'],'name':_0x3f2bb9[_0x9d13('0x78')]['name'],'active':_0x3f2bb9[_0x9d13('0x78')][_0x9d13('0x79')],'callerid':_0x3f2bb9['Trunk']['callerid']};}if(_0x3f2bb9[_0x9d13('0x43')]){_0x547a6b[_0x9d13('0x43')]={'id':_0x3f2bb9[_0x9d13('0x43')]['id'],'name':_0x3f2bb9[_0x9d13('0x43')][_0x9d13('0x40')]};}var _0x70514d=md5(JSON[_0x9d13('0x48')](_0x547a6b));if(_0x3f2bb9[_0x9d13('0x3')]!==_0x70514d){_0x3f2bb9[_0x9d13('0x3')]=_0x70514d;emit(util['format'](_0x9d13('0x7a'),_0x547a6b['name']),'voice_queue:save',_0x547a6b);}}}function emitCampaignSummary(_0x1208b3){if(_0x1208b3['type']===_0x9d13('0x7b')){emit(util[_0x9d13('0x7c')](_0x9d13('0x7d'),_0x1208b3[_0x9d13('0x40')]),_0x9d13('0x7e'),_0x1208b3);}}function checkGetDataPredictive(_0xcce1c9){if(isNotNull(_0xcce1c9)&&!_['isEmpty'](_0xcce1c9)){loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x80'));loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x81'),_0xcce1c9[_0x9d13('0x72')]);loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x82'),_0xcce1c9['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x83'),_0xcce1c9[_0x9d13('0x6c')]);loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x84'),_0xcce1c9[_0x9d13('0x6b')]);loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x85'),_0xcce1c9[_0x9d13('0x86')]);loggerPredictive[_0x9d13('0x7f')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xcce1c9[_0x9d13('0x6a')]);loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x87'));if(_0xcce1c9['predictiveIntervalTotalCalls']>0x0){if(!_[_0x9d13('0x3e')](_0xcce1c9['predictiveIntervalAvgTalktime'])&&_0xcce1c9['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x9d13('0x7f')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x9d13('0x3e')](_0xcce1c9[_0x9d13('0x86')])&&_0xcce1c9[_0x9d13('0x86')]>0x0){return!![];}loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x88'));}else{loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x89'));}}else{loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x8a'));}return![];}function mergeDataErlangB(_0x4bf9bd){return function(_0x89bbfa){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x8b'),_0x89bbfa[_0x9d13('0x74')]);loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x8c'),_0x89bbfa[_0x9d13('0x75')]);loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x8d'),_0x89bbfa[_0x9d13('0x76')]);loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x8e'),_0x89bbfa[_0x9d13('0x77')]);loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x8d'),_0x89bbfa[_0x9d13('0x76')]);loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x87'));_[_0x9d13('0x8f')](_0x4bf9bd,_0x89bbfa);};}function getDiff(_0x50e8f4){var _0x4b4e41=moment()[_0x9d13('0x49')](0x0);var _0x5d284d=moment(_0x50e8f4)[_0x9d13('0x49')](0x0);return _0x4b4e41[_0x9d13('0x4a')](_0x5d284d,_0x9d13('0x4b'));}function ifInterval(_0x113c9b,_0x3caa94){if(_['isUndefined'](_0x3caa94)){return![];}return getDiff(_0x3caa94)<_0x113c9b*0x3c;}function freeVariablesPredictive(_0x43afe1){if(isNotNull(_0x43afe1)){if(!_['isUndefined'](_0x43afe1[_0x9d13('0x26')])){_0x43afe1['startProgressive']=undefined;loggerPredictive[_0x9d13('0x7f')](_0x43afe1[_0x9d13('0x40')],_0x9d13('0x90'));}if(!_[_0x9d13('0x3e')](_0x43afe1[_0x9d13('0x91')])){_0x43afe1[_0x9d13('0x91')]=undefined;loggerPredictive[_0x9d13('0x7f')](_0x43afe1[_0x9d13('0x40')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x9d13('0x3e')](_0x43afe1[_0x9d13('0x92')])){clearInterval(_0x43afe1['handlePredictive']);_0x43afe1['handlePredictive']=undefined;loggerPredictive[_0x9d13('0x7f')](_0x43afe1[_0x9d13('0x40')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0xd67f19,_0x461845){if(_0x461845===0x0){return 0x0;}var _0x4bf0c5=0x1;for(var _0x35f1f5=0x1;_0x35f1f5<=_0x461845;_0x35f1f5+=0x1){_0x4bf0c5=0x1+_0x4bf0c5*_0x35f1f5/_0xd67f19;}return 0x1/_0x4bf0c5;}function isVoiceQueueOutbound(_0x5099f8){return _0x5099f8===_0x9d13('0x4d');}function isNotPreview(_0x5858d3){return _0x5858d3!==_0x9d13('0x1d');}function isCampaignIvr(_0x219e0b){return _0x219e0b===_0x9d13('0x7b');}function getCallerId(_0x37fd13,_0x383340,_0x1f5723){if(!_['isUndefined'](_0x1f5723)&&typeof _0x1f5723===_0x9d13('0x93')&&!_['isEmpty'](_0x1f5723)){if(!_[_0x9d13('0x3e')](_0x383340)&&typeof _0x383340==='string'&&!_[_0x9d13('0x47')](_0x383340)){return util[_0x9d13('0x7c')](_0x9d13('0x94'),_0x383340,_0x1f5723);}return util[_0x9d13('0x7c')]('\x22%s\x22\x20<%s>',_0x1f5723,_0x1f5723);}if(!_['isUndefined'](_0x37fd13)&&typeof _0x37fd13===_0x9d13('0x93')&&!_[_0x9d13('0x47')](_0x37fd13)){return _0x37fd13;}return _0x9d13('0x95');}function loggerCatchQueueSummary(_0x38a388,_0x2239c3){return function(_0x48c02b){freeVariablesPredictive(_0x2239c3);emitVoiceQueueSummary(_0x2239c3);emitCampaignSummary(_0x2239c3);loggerSyncQueueSummary['error'](_0x38a388,util['inspect'](_0x48c02b,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4cec4b,_0x1d12b9){return function(_0x1452f3){loggerPredictive[_0x9d13('0x96')](_0x1d12b9[_0x9d13('0x40')],_0x4cec4b);loggerPredictive[_0x9d13('0x96')](_0x1452f3['stack']);freeVariablesPredictive(_0x1d12b9);};}function loggerCatch(_0x2966bd){return function(_0x2b1b8e){logger[_0x9d13('0x96')](_0x2966bd,util[_0x9d13('0x97')](_0x2b1b8e,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1dc59b){return _0x1dc59b&&!_[_0x9d13('0x3e')](_0x1dc59b)&&_0x1dc59b[_0x9d13('0x98')]>0x0;}function decremetOriginate(_0x32b94b){if(!_[_0x9d13('0x3e')](_0x32b94b)&&_0x32b94b!==null){if(typeof _0x32b94b[_0x9d13('0x73')]!==_0x9d13('0x99')){if(_0x32b94b[_0x9d13('0x73')]>0x0){_0x32b94b[_0x9d13('0x73')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x9d13('0x96')](_0x9d13('0x9a'));}}function checkContactLowerLimitOriginate(_0x3e1337,_0x3f9cba,_0x2b028a){if(_0x3f9cba>_0x2b028a){for(var _0x14cb01=0x0;_0x14cb01<_0x3f9cba-_0x2b028a;_0x14cb01+=0x1){decremetOriginate(_0x3e1337);}}}function loggerGetContactDialer(_0x37872b,_0x40a8c7,_0x591451){return function(_0x29f1c6){checkContactLowerLimitOriginate(_0x40a8c7,_0x591451,0x0);logger[_0x9d13('0x96')](_0x37872b,util['inspect'](_0x29f1c6,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5ca6db){return function(_0x27c58a){if(isNotNull(_0x27c58a)&&isNotNull(_0x27c58a[0x0])){if(_0x27c58a[0x0][_0x9d13('0x9b')]>0x0){_0x5ca6db[_0x9d13('0x3f')]=_0x9d13('0x9c');logger[_0x9d13('0x7f')](_0x9d13('0x9d')+_0x5ca6db[_0x9d13('0x40')],_0x27c58a[0x0][_0x9d13('0x9b')],_0x9d13('0x9e'));}else{_0x5ca6db[_0x9d13('0x3f')]=_0x9d13('0x9f');logger[_0x9d13('0x7f')](_0x9d13('0xa0')+_0x5ca6db[_0x9d13('0x40')]);}}};}function notSendMessagesQueue(_0x115c74){if(_0x115c74['sendMessageOneNotActive']){freeVariablesPredictive(_0x115c74);if(_0x115c74['originated']===0x0&&_0x115c74[_0x9d13('0x54')]===0x0&&_0x115c74[_0x9d13('0x58')]===0x0&&(_0x115c74[_0x9d13('0x51')]||0x0)===0x0){_0x115c74[_0x9d13('0xa1')]=![];_0x115c74[_0x9d13('0x50')]=0x0;_0x115c74['message']=_0x9d13('0xa2');loggerSyncQueueSummary[_0x9d13('0x96')](_0x9d13('0xa3'),_0x115c74[_0x9d13('0x40')],_0x9d13('0xa4'));}else{_0x115c74['message']=_0x9d13('0xa5');loggerSyncQueueSummary['error'](_0x9d13('0xa3'),_0x115c74[_0x9d13('0x40')],_0x9d13('0xa6'));}emitVoiceQueueSummary(_0x115c74);}}function notSendMessagesCampaign(_0x19ae19){if(_0x19ae19[_0x9d13('0xa1')]){if(_0x19ae19[_0x9d13('0x73')]===0x0){_0x19ae19['sendMessageOneNotActive']=![];_0x19ae19['message']=_0x9d13('0xa2');loggerSyncQueueSummary['error'](_0x9d13('0xa7'),_0x19ae19[_0x9d13('0x40')],'is\x20not\x20active');}else{_0x19ae19[_0x9d13('0x3f')]=_0x9d13('0xa5');loggerSyncQueueSummary[_0x9d13('0x96')](_0x9d13('0xa7'),_0x19ae19['name'],_0x9d13('0xa6'));}emitCampaignSummary(_0x19ae19);}}function createObjHistory(_0x12c8af,_0x5ddf75,_0x443a46,_0x429266,_0x174d06){_0x12c8af[_0x9d13('0x3f')]=_0x443a46;var _0x5e1ffd=new Action(_0x12c8af,_0x5ddf75);var _0x430dbc=new History(_0x5e1ffd);_0x430dbc[_0x9d13('0xa8')]=_0x429266;_0x430dbc[_0x9d13('0xa9')]=_0x174d06;_0x430dbc[_0x9d13('0xaa')]=_0x5e1ffd[_0x9d13('0xab')];return _0x430dbc;}Dialer[_0x9d13('0x18')][_0x9d13('0x3d')]=function(){var _0x5e0594=this;setInterval(function(){_0x5e0594['clearZombieChannels'](_0x5e0594[_0x9d13('0xac')],_0x9d13('0xad'));_0x5e0594[_0x9d13('0xae')](_0x5e0594['actions'],_0x9d13('0xaf'));},0x32c8);};Dialer[_0x9d13('0x18')][_0x9d13('0xae')]=function(_0x1c4c91,_0x1634db){var _0xe42291=this;for(var _0x539ccb in _0x1c4c91){if(typeof _0x1c4c91[_0x539ccb]!==_0x9d13('0x99')){this[_0x9d13('0x1c')][_0x9d13('0x19')](function(){if(!_['isNil'](_0x1c4c91[_0x539ccb])){return ami['Action']({'action':_0x9d13('0xb0'),'channel':_0x1c4c91[_0x539ccb][_0x9d13('0xb1')]})[_0x9d13('0xb2')](function(_0x427f0e){if(_0x427f0e['message']===_0x9d13('0xb3')){setTimeout(function(){if(_0x1c4c91[_0x539ccb]&&_0x1c4c91[_0x539ccb]['type']!==_0x9d13('0x7b')){_0xe42291[_0x9d13('0xb4')](_0xe42291[_0x9d13('0x1e')][_0x1c4c91[_0x539ccb][_0x9d13('0xb5')]]);logger[_0x9d13('0x96')](_0x9d13('0xb6'),_0x1634db,_0x539ccb,_0x1c4c91[_0x539ccb]['queue']);delete _0x1c4c91[_0x539ccb];}if(_0x1c4c91[_0x539ccb]&&_0x1c4c91[_0x539ccb][_0x9d13('0x4c')]===_0x9d13('0x7b')){_0xe42291[_0x9d13('0xb4')](_0xe42291[_0x9d13('0x1f')][_0x1c4c91[_0x539ccb][_0x9d13('0xb5')]]);logger['error']('[Dialer][checkChannel][ivr]',_0x1634db,_0x539ccb,_0x1c4c91[_0x539ccb]['queue']);delete _0x1c4c91[_0x539ccb];}},0x2328);}});}});}}};Dialer['prototype'][_0x9d13('0xb7')]=function(_0x2445a6){return BPromise['resolve']()[_0x9d13('0xb8')](cmHopper[_0x9d13('0xb7')](_0x2445a6))[_0x9d13('0xb2')](loggerCatch(_0x9d13('0xb9')));};Dialer[_0x9d13('0x18')][_0x9d13('0xba')]=function(_0x370271){return BPromise['resolve']()[_0x9d13('0xb8')](cmHopperBlack[_0x9d13('0xba')](_0x370271))[_0x9d13('0xb2')](loggerCatch(_0x9d13('0xbb')));};Dialer[_0x9d13('0x18')][_0x9d13('0xbc')]=function(_0x16c5a6){return BPromise['resolve']()[_0x9d13('0xb8')](cmHopperBlack[_0x9d13('0xbc')](_0x16c5a6))[_0x9d13('0xb2')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype'][_0x9d13('0xbd')]=function(_0x34d667){return BPromise['resolve']()[_0x9d13('0xb8')](cmHopperHistory[_0x9d13('0xbe')](_0x34d667))['catch'](loggerCatch(_0x9d13('0xbf')));};Dialer[_0x9d13('0x18')][_0x9d13('0xc0')]=function(_0xf661ce){return BPromise[_0x9d13('0xc1')]()[_0x9d13('0xb8')](cmHopper['rescheduleContact'](_0xf661ce))[_0x9d13('0xb2')](loggerCatch(_0x9d13('0xc2')));};Dialer[_0x9d13('0x18')][_0x9d13('0xc3')]=function(_0x5dbdeb,_0x25e138,_0x25edb6){return BPromise['resolve']()[_0x9d13('0xb8')](cmHopper[_0x9d13('0xc3')](_0x5dbdeb,_0x25e138,_0x25edb6))[_0x9d13('0xb2')](loggerCatch(_0x9d13('0xc4')));};Dialer[_0x9d13('0x18')][_0x9d13('0xc5')]=function(_0x739d10,_0x56fddd,_0x40bb13,_0x5bd541,_0x32c78b){return BPromise[_0x9d13('0xc1')]()[_0x9d13('0xb8')](cmHopper[_0x9d13('0xc5')](_0x739d10,_0x56fddd,_0x40bb13,_0x5bd541))[_0x9d13('0xb2')](function(_0xaf67eb){_0x32c78b[_0x9d13('0xc6')]-=_0x40bb13;_0x32c78b[_0x9d13('0xc6')]=_0x32c78b['temp']>0x0?_0x32c78b['temp']:0x0;loggerCatch('[getContactDialer]\x20')(_0xaf67eb);});};Dialer['prototype'][_0x9d13('0xc7')]=function(_0x26c05e,_0x20f348,_0x49890b,_0x14f7b3){return BPromise[_0x9d13('0xc1')]()[_0x9d13('0xb8')](cmHopper[_0x9d13('0xc7')](_0x26c05e,_0x20f348,_0x49890b))[_0x9d13('0xb2')](function(_0x2aff7b){_0x14f7b3[_0x9d13('0xc6')]-=_0x20f348;_0x14f7b3['temp']=_0x14f7b3[_0x9d13('0xc6')]>0x0?_0x14f7b3[_0x9d13('0xc6')]:0x0;loggerCatch(_0x9d13('0xc8'))(_0x2aff7b);});};Dialer[_0x9d13('0x18')][_0x9d13('0xc9')]=function(_0x568188){return BPromise['resolve']()[_0x9d13('0xb8')](voiceQueueRt[_0x9d13('0xc9')](_0x568188))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x9d13('0x18')][_0x9d13('0xca')]=function(_0x3561db){return BPromise['resolve']()[_0x9d13('0xb8')](cmHopper[_0x9d13('0xca')](_0x3561db))[_0x9d13('0xb2')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0x9d13('0xcb')]=function(_0x37ded7){return BPromise[_0x9d13('0xc1')]()['then'](cmHopperHistory[_0x9d13('0xcb')](_0x37ded7))[_0x9d13('0xb2')](loggerCatch(_0x9d13('0xcc')));};Dialer[_0x9d13('0x18')][_0x9d13('0xb4')]=function(_0x1d6015){if(!_[_0x9d13('0x3e')](_0x1d6015)&&_0x1d6015!==null){if(typeof _0x1d6015['originated']!==_0x9d13('0x99')){if(_0x1d6015[_0x9d13('0x73')]>0x0){_0x1d6015[_0x9d13('0x73')]-=0x1;}else{logger[_0x9d13('0x96')](_0x9d13('0xcd'));}}}else{logger[_0x9d13('0x96')](_0x9d13('0xce'));}};Dialer[_0x9d13('0x18')][_0x9d13('0xcf')]=function(_0x16b987,_0x551a89){var _0x5cb9ff=this;return function(_0x408a42){_0x5cb9ff[_0x9d13('0xb4')](_0x551a89);logger[_0x9d13('0x96')](_0x16b987,util[_0x9d13('0x97')](_0x408a42,{'showHidden':![],'depth':null}));};};Dialer[_0x9d13('0x18')][_0x9d13('0xd0')]=function(_0x5c30ff,_0x1f172a,_0x1ad9c3){var _0x5cd9d2={'state':0x19,'statedesc':_0x9d13('0xd1')};this['updateOriginated'](_0x1f172a);this[_0x9d13('0xd2')](_['merge'](_0x5cd9d2,_[_0x9d13('0xd3')](_0x1ad9c3,[_0x9d13('0xd4'),_0x9d13('0xd5'),_0x9d13('0xd6'),_0x9d13('0xd7'),_0x9d13('0xd8')])),_0x9d13('0xd9'),_0x9d13('0xda'));logger[_0x9d13('0x96')](_0x5c30ff);};Dialer['prototype'][_0x9d13('0xdb')]=function(_0x5f0bc2){return _0x5f0bc2===_0x9d13('0xdc');};Dialer['prototype']['isTrunkReachable']=function(_0x42ff2f){return!_[_0x9d13('0x3e')](_0x42ff2f)&&_0x42ff2f&&!_[_0x9d13('0x3e')](_0x42ff2f[_0x9d13('0x40')])&&!_['isUndefined'](_0x42ff2f[_0x9d13('0x79')])&&_0x42ff2f[_0x9d13('0x79')]&&(this[_0x9d13('0x21')][util['format'](_0x9d13('0xdd'),_0x42ff2f[_0x9d13('0x40')])][_0x9d13('0xb0')]==='reachable'||this[_0x9d13('0x21')][util[_0x9d13('0x7c')](_0x9d13('0xdd'),_0x42ff2f[_0x9d13('0x40')])]['status']===_0x9d13('0xde'));};Dialer[_0x9d13('0x18')][_0x9d13('0xd2')]=function(_0x252d55,_0x3f5347,_0x4dbfc8){this[_0x9d13('0xcb')](_0x252d55)[_0x9d13('0xb2')](loggerCatch(_0x3f5347));this['moveContactManagedDialer'](_0x252d55)[_0x9d13('0xb2')](loggerCatch(_0x4dbfc8));};Dialer[_0x9d13('0x18')]['syncVarSet']=function(_0x5ae1fe){var _0x59b932=this[_0x9d13('0xac')][_0x5ae1fe['uniqueid']];var _0x13773e;if(!_['isNil'](_0x5ae1fe)&&!_[_0x9d13('0xdf')](_0x5ae1fe['variable'])&&!_[_0x9d13('0xdf')](_0x5ae1fe['variable'][_0x9d13('0xe0')])&&_0x5ae1fe[_0x9d13('0xe1')]==='xcally-motion-dialer'&&_0x59b932){if(_0x59b932[_0x9d13('0x4c')]!==_0x9d13('0x7b')&&this['voiceQueues'][_0x59b932[_0x9d13('0xb5')]]['dialAMDActive']&&_0x5ae1fe[_0x9d13('0xe2')]===_0x9d13('0xe3')){delete this[_0x9d13('0xac')][_0x5ae1fe['uniqueid']];this['updateOriginated'](this[_0x9d13('0x1e')][_0x59b932[_0x9d13('0xb5')]]);this['voiceQueues'][_0x59b932[_0x9d13('0xb5')]]['outboundAnswerCallsDay']+=0x1;this[_0x9d13('0x1e')][_0x59b932[_0x9d13('0xb5')]][_0x9d13('0x5f')]+=0x1;_0x13773e=new Hangup(_0x59b932,_0x5ae1fe);_0x13773e[_0x9d13('0xa8')]=0x12;_0x13773e[_0x9d13('0xa9')]=_0x9d13('0xe4');_0x13773e[_0x9d13('0xe5')]=_0x9d13('0xe6');ami[_0x9d13('0xe7')](_0x9d13('0xe8'),ut[_0x9d13('0xe9')](_0x13773e,_0x9d13('0xea')));this[_0x9d13('0xd2')](_0x13773e,_0x9d13('0xeb'),'[syncHangupInAMD]');}if(_0x59b932[_0x9d13('0x4c')]!==_0x9d13('0x7b')&&this[_0x9d13('0x1e')][_0x59b932['queue']][_0x9d13('0xec')]&&_0x5ae1fe['value']===_0x9d13('0xed')){var _0x584c34=this;return new BPromise(function(_0x4ab4a4,_0x225173){delete _0x584c34[_0x9d13('0xac')][_0x5ae1fe[_0x9d13('0xee')]];_0x584c34[_0x9d13('0xb4')](_0x584c34[_0x9d13('0x1e')][_0x59b932[_0x9d13('0xb5')]]);_0x584c34[_0x9d13('0x1e')][_0x59b932[_0x9d13('0xb5')]]['outboundAnswerCallsDay']+=0x1;_0x584c34[_0x9d13('0x1e')][_0x59b932[_0x9d13('0xb5')]][_0x9d13('0x5f')]+=0x1;var _0x3fb426=_0x584c34[_0x9d13('0x1e')][_0x59b932[_0x9d13('0xb5')]];var _0x3a7f37=new Hangup(_0x59b932,_0x5ae1fe);_0x3a7f37[_0x9d13('0xa8')]=0x13;_0x3a7f37[_0x9d13('0xa9')]='Machine';_0x3a7f37['membername']='AMD';_0x3a7f37['countmachineretry']+=0x1;_0x3a7f37['countglobal']+=0x1;_0x3a7f37[_0x9d13('0xea')]=!![];ami[_0x9d13('0xe7')](_0x9d13('0xe8'),ut[_0x9d13('0xe9')](_0x3a7f37,_0x9d13('0xea')));_0x584c34['createHistory'](_0x3a7f37)[_0x9d13('0xb2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x3a7f37[_0x9d13('0xef')]+_0x3a7f37[_0x9d13('0xf0')]+_0x3a7f37[_0x9d13('0xf1')]+_0x3a7f37[_0x9d13('0xf2')]+_0x3a7f37[_0x9d13('0xf3')]+_0x3a7f37[_0x9d13('0xf4')]+_0x3a7f37[_0x9d13('0xf5')]+_0x3a7f37[_0x9d13('0xf6')]>=_0x3fb426[_0x9d13('0xf7')]){_0x584c34[_0x9d13('0xf8')](_0x3a7f37,_0x4ab4a4,_0x225173,_0x9d13('0xf9'));}else{if(_0x3a7f37['countmachineretry']>=_0x3fb426[_0x9d13('0xfa')]){_0x584c34[_0x9d13('0xfb')](_0x3a7f37,_0x4ab4a4,_0x225173,'reason\x2019\x20machine....');}else{_0x584c34['rescheduleContact']({'active':![],'countmachineretry':_0x3a7f37[_0x9d13('0xf5')],'scheduledat':moment()[_0x9d13('0xfc')](_0x3fb426[_0x9d13('0xfd')],_0x9d13('0xfe'))[_0x9d13('0x7c')](_0x9d13('0xff')),'ContactId':_0x3a7f37[_0x9d13('0xd4')],'ListId':_0x3a7f37['ListId'],'VoiceQueueId':_0x3a7f37['VoiceQueueId']||undefined,'CampaignId':_0x3a7f37['CampaignId']||undefined})[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x100')));_0x4ab4a4({'reschedule':0x1});}}});}if(_0x59b932[_0x9d13('0x4c')]===_0x9d13('0x7b')&&this[_0x9d13('0x1f')][_0x59b932[_0x9d13('0xb5')]][_0x9d13('0xec')]&&_0x5ae1fe[_0x9d13('0xe2')]===_0x9d13('0xe3')){delete this['uniqueId'][_0x5ae1fe[_0x9d13('0xee')]];this[_0x9d13('0xb4')](this[_0x9d13('0x1f')][_0x59b932['queue']]);_0x13773e=new Hangup(_0x59b932,_0x5ae1fe);_0x13773e[_0x9d13('0xa8')]=0x12;_0x13773e['statedesc']=_0x9d13('0xe4');_0x13773e['membername']=_0x9d13('0xe6');ami['emit']('custom:amd',ut[_0x9d13('0xe9')](_0x13773e,'amd'));this[_0x9d13('0xd2')](_0x13773e,_0x9d13('0x101'),'[syncHangupInAMDIvr]');}if(_0x59b932[_0x9d13('0x4c')]===_0x9d13('0x7b')&&this[_0x9d13('0x1f')][_0x59b932['queue']][_0x9d13('0xec')]&&_0x5ae1fe[_0x9d13('0xe2')]==='MACHINE'){var _0x584c34=this;return new BPromise(function(_0x40987b,_0x47a135){delete _0x584c34[_0x9d13('0xac')][_0x5ae1fe[_0x9d13('0xee')]];_0x584c34[_0x9d13('0xb4')](_0x584c34[_0x9d13('0x1f')][_0x59b932[_0x9d13('0xb5')]]);_0x584c34[_0x9d13('0x1f')][_0x59b932[_0x9d13('0xb5')]][_0x9d13('0x60')]+=0x1;_0x584c34[_0x9d13('0x1f')][_0x59b932[_0x9d13('0xb5')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x14c2b7=_0x584c34['campaigns'][_0x59b932['queue']];var _0x23e6b9=new Hangup(_0x59b932,_0x5ae1fe);_0x23e6b9[_0x9d13('0xa8')]=0x13;_0x23e6b9[_0x9d13('0xa9')]='Machine';_0x23e6b9[_0x9d13('0xe5')]=_0x9d13('0xe6');_0x23e6b9[_0x9d13('0xf5')]+=0x1;_0x23e6b9['countglobal']+=0x1;_0x23e6b9['amd']=!![];ami[_0x9d13('0xe7')](_0x9d13('0xe8'),ut[_0x9d13('0xe9')](_0x23e6b9,'amd'));_0x584c34[_0x9d13('0xcb')](_0x23e6b9)['catch'](loggerCatch(_0x9d13('0x102')));if(_0x23e6b9[_0x9d13('0xef')]+_0x23e6b9[_0x9d13('0xf0')]+_0x23e6b9[_0x9d13('0xf1')]+_0x23e6b9[_0x9d13('0xf2')]+_0x23e6b9['countdropretry']+_0x23e6b9['countabandonedretry']+_0x23e6b9[_0x9d13('0xf5')]+_0x23e6b9[_0x9d13('0xf6')]>=_0x14c2b7['dialGlobalMaxRetry']){_0x584c34[_0x9d13('0xf8')](_0x23e6b9,_0x40987b,_0x47a135,'reason19\x20machine....');}else{if(_0x23e6b9['countmachineretry']>=_0x14c2b7['dialMachineMaxRetry']){_0x584c34['createStateFinal'](_0x23e6b9,_0x40987b,_0x47a135,_0x9d13('0x103'));}else{_0x584c34[_0x9d13('0xc0')]({'active':![],'countmachineretry':_0x23e6b9['countmachineretry'],'scheduledat':moment()[_0x9d13('0xfc')](_0x14c2b7[_0x9d13('0xfd')],_0x9d13('0xfe'))[_0x9d13('0x7c')](_0x9d13('0xff')),'ContactId':_0x23e6b9[_0x9d13('0xd4')],'ListId':_0x23e6b9[_0x9d13('0xd5')],'VoiceQueueId':_0x23e6b9['VoiceQueueId']||undefined,'CampaignId':_0x23e6b9['CampaignId']||undefined})['catch'](loggerCatch(_0x9d13('0x100')));_0x40987b({'reschedule':0x1});}}});}}};Dialer[_0x9d13('0x18')][_0x9d13('0x34')]=function(_0x186fd5){var _0x53acde=this['uniqueId'][_0x186fd5[_0x9d13('0xee')]];var _0x5d3488=this;var _0x4f54d1;if(_0x53acde&&_0x53acde[_0x9d13('0x4c')]===_0x9d13('0x7b')){delete this[_0x9d13('0xac')][_0x186fd5[_0x9d13('0xee')]];this[_0x9d13('0xb4')](this[_0x9d13('0x1f')][_0x53acde[_0x9d13('0xb5')]]);this['campaigns'][_0x53acde[_0x9d13('0xb5')]]['ivrAnswerCallsDay']+=0x1;_0x4f54d1=new Hangup(_0x53acde,_0x186fd5);this[_0x9d13('0xcb')](_0x4f54d1)[_0x9d13('0xb2')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x9d13('0xca')](_0x4f54d1)['catch'](loggerCatch(_0x9d13('0x104')));}if(_0x53acde&&_0x53acde[_0x9d13('0x4c')]!==_0x9d13('0x7b')&&isNotNull(this['voiceQueues'][_0x53acde[_0x9d13('0xb5')]][_0x9d13('0x105')])){delete this[_0x9d13('0xac')][_0x186fd5[_0x9d13('0xee')]];this['updateOriginated'](this[_0x9d13('0x1e')][_0x53acde[_0x9d13('0xb5')]]);this[_0x9d13('0x1e')][_0x53acde['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x53acde[_0x9d13('0xb5')]][_0x9d13('0x5f')]+=0x1;_0x4f54d1=new Hangup(_0x53acde,_0x186fd5);_0x4f54d1[_0x9d13('0xa8')]=0x10;_0x4f54d1[_0x9d13('0xa9')]=_0x9d13('0x106');_0x4f54d1[_0x9d13('0xe5')]=_0x9d13('0x107');this[_0x9d13('0xcb')](_0x4f54d1)[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x108')));this['moveContactManagedDialer'](_0x4f54d1)['catch'](loggerCatch(_0x9d13('0x104')));}if(_0x53acde&&_0x53acde[_0x9d13('0x4c')]!==_0x9d13('0x7b')&&!isNotNull(this[_0x9d13('0x1e')][_0x53acde[_0x9d13('0xb5')]][_0x9d13('0x105')])){delete this['uniqueId'][_0x186fd5['uniqueid']];this[_0x9d13('0xb4')](this['voiceQueues'][_0x53acde[_0x9d13('0xb5')]]);this[_0x9d13('0x1e')][_0x53acde['queue']]['outboundUnknownCallsDay']+=0x1;_0x4f54d1=new Hangup(_0x53acde,_0x186fd5);_0x4f54d1[_0x9d13('0xa8')]=0xc;_0x4f54d1[_0x9d13('0xa9')]=_0x186fd5['cause-txt'];_0x4f54d1[_0x9d13('0xe5')]=_0x9d13('0x109');this[_0x9d13('0xcb')](_0x4f54d1)[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x108')));this[_0x9d13('0xca')](_0x4f54d1)[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x104')));}};Dialer[_0x9d13('0x18')][_0x9d13('0x30')]=function(_0x1b56b6){var _0x4f253d=this[_0x9d13('0xac')][_0x1b56b6[_0x9d13('0xee')]];var _0x570213=this;if(this[_0x9d13('0x1e')][_0x1b56b6[_0x9d13('0xb5')]]){if(_0x4f253d&&_0x4f253d[_0x9d13('0x4c')]!==_0x9d13('0x7b')){delete this[_0x9d13('0xac')][_0x1b56b6['uniqueid']];this[_0x9d13('0x1e')][_0x1b56b6[_0x9d13('0xb5')]][_0x9d13('0x60')]+=0x1;var _0x354a21=new AgentComplete(_0x4f253d,_0x1b56b6);if(_0x1b56b6[_0x9d13('0x10a')]===_0x9d13('0x10b')){_0x354a21[_0x9d13('0x10c')]=this['voiceQueues'][_0x1b56b6[_0x9d13('0xb5')]][_0x9d13('0x10d')]&&this[_0x9d13('0x1e')][_0x1b56b6[_0x9d13('0xb5')]][_0x9d13('0x10e')]?moment()[_0x9d13('0x7c')](_0x9d13('0xff')):undefined;}this[_0x9d13('0xcb')](_0x354a21)['catch'](loggerCatch(_0x9d13('0x10f')));this[_0x9d13('0xca')](_0x354a21)[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x110')));}}};Dialer[_0x9d13('0x18')][_0x9d13('0x2b')]=function(_0x3bed96){if(this[_0x9d13('0x1e')][_0x3bed96['queue']]){if(this[_0x9d13('0xac')][_0x3bed96[_0x9d13('0xee')]]&&this[_0x9d13('0xac')][_0x3bed96[_0x9d13('0xee')]][_0x9d13('0x4c')]!==_0x9d13('0x7b')){this[_0x9d13('0xb4')](this['voiceQueues'][_0x3bed96[_0x9d13('0xb5')]]);this[_0x9d13('0xac')][_0x3bed96[_0x9d13('0xee')]][_0x9d13('0x111')]=moment()[_0x9d13('0x7c')](_0x9d13('0xff'));}}};Dialer[_0x9d13('0x18')][_0x9d13('0x112')]=function(_0x480be7){this[_0x9d13('0xcb')](_0x480be7)['catch'](loggerCatch(_0x9d13('0x10f')));this[_0x9d13('0xca')](_0x480be7)[_0x9d13('0xb2')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x9d13('0x18')][_0x9d13('0x113')]=function(_0x38c950){var _0x163c08=this['uniqueId'][_0x38c950[_0x9d13('0xee')]];var _0x4c4508=this;if(this[_0x9d13('0x1e')][_0x38c950[_0x9d13('0xb5')]]){if(_0x163c08&&_0x163c08[_0x9d13('0x4c')]!=='ivr'){delete this['uniqueId'][_0x38c950[_0x9d13('0xee')]];this[_0x9d13('0xb4')](this[_0x9d13('0x1e')][_0x38c950['queue']]);_0x163c08[_0x9d13('0x114')]=moment()['format'](_0x9d13('0xff'));var _0xb3ec5e=new QueueCallerAbandon(_0x163c08,_0x38c950);if(getSeconds(_0x163c08[_0x9d13('0x114')],_0x163c08[_0x9d13('0x115')])>=_0x163c08[_0x9d13('0x116')]){this[_0x9d13('0x1e')][_0x38c950[_0x9d13('0xb5')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x9d13('0x1e')][_0x38c950[_0x9d13('0xb5')]][_0x9d13('0x65')]+=0x1;this[_0x9d13('0x1e')][_0x38c950[_0x9d13('0xb5')]][_0x9d13('0x6e')]+=0x1;_0xb3ec5e['state']=0xa;_0xb3ec5e[_0x9d13('0xa9')]='Drop';_0xb3ec5e[_0x9d13('0x117')]=_0x9d13('0x118');_0xb3ec5e[_0x9d13('0x10c')]=this['voiceQueues'][_0x38c950['queue']][_0x9d13('0x10d')]?moment()[_0x9d13('0x7c')](_0x9d13('0xff')):undefined;_0xb3ec5e[_0x9d13('0xf3')]+=0x1;_0xb3ec5e[_0x9d13('0x119')]+=0x1;if(_0xb3ec5e[_0x9d13('0xf3')]>=this['voiceQueues'][_0x38c950['queue']][_0x9d13('0x11a')]){this[_0x9d13('0x112')](_0xb3ec5e);}else{this[_0x9d13('0xc0')]({'active':![],'countdropretry':_0xb3ec5e[_0x9d13('0xf3')],'scheduledat':moment()[_0x9d13('0xfc')](this[_0x9d13('0x1e')][_0x38c950[_0x9d13('0xb5')]][_0x9d13('0x11b')],_0x9d13('0xfe'))[_0x9d13('0x7c')](_0x9d13('0xff')),'ContactId':_0x163c08[_0x9d13('0xd4')],'ListId':_0x163c08[_0x9d13('0xd5')],'VoiceQueueId':_0x163c08[_0x9d13('0xd7')]||undefined,'CampaignId':_0x163c08[_0x9d13('0xd8')]||undefined})['catch'](loggerCatch(_0x9d13('0x11c')));var _0x239f16=new History(_0xb3ec5e);_0x239f16[_0x9d13('0xa8')]=0xa;_0x239f16['statedesc']=_0x9d13('0x11d');_0x239f16['starttime']=moment()[_0x9d13('0x7c')](_0x9d13('0xff'));_0x239f16[_0x9d13('0xaa')]=_0x239f16[_0x9d13('0xab')];_0x239f16[_0x9d13('0x11e')]=_0xb3ec5e[_0x9d13('0x11e')];_0x239f16['calleridnum']=_0xb3ec5e[_0x9d13('0x11f')];this[_0x9d13('0xcb')](_0x239f16)[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x120')));}}else{this['voiceQueues'][_0x38c950[_0x9d13('0xb5')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x9d13('0x1e')][_0x38c950[_0x9d13('0xb5')]][_0x9d13('0x64')]+=0x1;_0xb3ec5e[_0x9d13('0xa8')]=0xb;_0xb3ec5e['statedesc']='Abandoned';_0xb3ec5e[_0x9d13('0x117')]=_0x9d13('0x121');_0xb3ec5e[_0x9d13('0xf4')]+=0x1;_0xb3ec5e[_0x9d13('0x119')]+=0x1;if(_0xb3ec5e['countabandonedretry']>=this['voiceQueues'][_0x38c950[_0x9d13('0xb5')]][_0x9d13('0x122')]){this[_0x9d13('0x112')](_0xb3ec5e);}else{this[_0x9d13('0xc0')]({'active':![],'countabandonedretry':_0xb3ec5e['countabandonedretry'],'scheduledat':moment()[_0x9d13('0xfc')](this['voiceQueues'][_0x38c950['queue']][_0x9d13('0x123')],_0x9d13('0xfe'))[_0x9d13('0x7c')](_0x9d13('0xff')),'ContactId':_0x163c08[_0x9d13('0xd4')],'ListId':_0x163c08[_0x9d13('0xd5')],'VoiceQueueId':_0x163c08['VoiceQueueId']||undefined,'CampaignId':_0x163c08[_0x9d13('0xd8')]||undefined})[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x124')));var _0x239f16=new History(_0xb3ec5e);_0x239f16['state']=0xb;_0x239f16[_0x9d13('0xa9')]=_0x9d13('0x125');_0x239f16[_0x9d13('0xab')]=moment()[_0x9d13('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0x239f16[_0x9d13('0xaa')]=_0x239f16[_0x9d13('0xab')];_0x239f16[_0x9d13('0x11e')]=_0xb3ec5e[_0x9d13('0x11e')];_0x239f16[_0x9d13('0x11f')]=_0xb3ec5e['calleridnum'];this[_0x9d13('0xcb')](_0x239f16)[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x126')));}}}}};Dialer[_0x9d13('0x18')][_0x9d13('0x36')]=function(_0x5ea567){if(this[_0x9d13('0x24')][_0x5ea567['uniqueid']]){this['actions'][_0x5ea567['uniqueid']]['channel']=_0x5ea567[_0x9d13('0xb1')];}if(this['uniqueId'][_0x5ea567['uniqueid']]){this['uniqueId'][_0x5ea567[_0x9d13('0xee')]][_0x9d13('0xb1')]=_0x5ea567[_0x9d13('0xb1')];}};Dialer[_0x9d13('0x18')][_0x9d13('0x39')]=function(_0x22b1e9){if(strategy[this[_0x9d13('0x1e')][this[_0x9d13('0x24')][_0x22b1e9[_0x9d13('0x127')]][_0x9d13('0xb5')]][_0x9d13('0x4e')]]===_0x9d13('0x17')){if(this['actions'][_0x22b1e9[_0x9d13('0x127')]]&&_['isNil'](this[_0x9d13('0x24')][_0x22b1e9[_0x9d13('0x127')]][_0x9d13('0x128')])&&_0x22b1e9[_0x9d13('0xb0')]==='1'&&_0x22b1e9[_0x9d13('0x129')]==='0'){if(this[_0x9d13('0x20')][_0x22b1e9[_0x9d13('0x12a')]]){if(!this[_0x9d13('0x20')][_0x22b1e9[_0x9d13('0x12a')]]['locked']){this[_0x9d13('0x20')][_0x22b1e9[_0x9d13('0x12a')]][_0x9d13('0x128')]=!![];this[_0x9d13('0x24')][_0x22b1e9[_0x9d13('0x127')]][_0x9d13('0x128')]=!![];this[_0x9d13('0x24')][_0x22b1e9[_0x9d13('0x127')]]['stateinterface']=_0x22b1e9['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0x9d13('0x24')][_0x22b1e9['actionid']][_0x9d13('0xb5')]][_0x9d13('0x4e')]]||_0x9d13('0x16'))===_0x9d13('0x16')){if(this[_0x9d13('0x24')][_0x22b1e9[_0x9d13('0x127')]]){if(this[_0x9d13('0x20')][_0x22b1e9['stateinterface']]){this['actions'][_0x22b1e9[_0x9d13('0x127')]][_0x9d13('0x12a')]=_0x22b1e9[_0x9d13('0x12a')];if(_[_0x9d13('0xdf')](this[_0x9d13('0x28')][this[_0x9d13('0x24')][_0x22b1e9[_0x9d13('0x127')]]['queue']])){this[_0x9d13('0x28')][this['actions'][_0x22b1e9[_0x9d13('0x127')]][_0x9d13('0xb5')]]=[];}this[_0x9d13('0x28')][this[_0x9d13('0x24')][_0x22b1e9[_0x9d13('0x127')]][_0x9d13('0xb5')]][_0x9d13('0x12b')](_['merge'](_[_0x9d13('0xd3')](this['actions'][_0x22b1e9[_0x9d13('0x127')]],['idHopper',_0x9d13('0x12a')]),{'status':_0x22b1e9[_0x9d13('0xb0')],'paused':_0x22b1e9['paused']}));}}}};function unlockQueueStatus(_0x4a2c16,_0xee899e){setTimeout(function(){if(_[_0x9d13('0x3e')](_0x4a2c16[_0x9d13('0x12c')])){loggerBooked[_0x9d13('0x96')](_0x9d13('0x12d'),_0xee899e);}_0x4a2c16['queueStatusComplete']=!![];loggerBooked[_0x9d13('0x7f')](_0x9d13('0x12e'),_0xee899e,JSON[_0x9d13('0x48')](_['pick'](_0x4a2c16,[_0x9d13('0x40'),_0x9d13('0x12c')])));},0x1f3);}Dialer['prototype'][_0x9d13('0x3b')]=function(_0x59a6c6){var _0x2223c4=this;var _0x5c727a=_0x2223c4[_0x9d13('0x1e')][_0x2223c4[_0x9d13('0x24')][_0x59a6c6[_0x9d13('0x127')]][_0x9d13('0xb5')]];if(strategy[this[_0x9d13('0x1e')][this[_0x9d13('0x24')][_0x59a6c6[_0x9d13('0x127')]][_0x9d13('0xb5')]][_0x9d13('0x4e')]]===_0x9d13('0x17')){if(this[_0x9d13('0x24')][_0x59a6c6[_0x9d13('0x127')]]&&this[_0x9d13('0x24')][_0x59a6c6[_0x9d13('0x127')]][_0x9d13('0x12a')]){this['preview'][_0x9d13('0x12f')](this[_0x9d13('0x24')][_0x59a6c6[_0x9d13('0x127')]][_0x9d13('0x130')],this[_0x9d13('0x24')][_0x59a6c6[_0x9d13('0x127')]]['stateinterface'])['catch'](function(_0x25589e){logger[_0x9d13('0x96')](_0x9d13('0x131'),util['inspect'](_0x25589e,{'showHidden':![],'depth':null}));})['finally'](function(){_0x2223c4[_0x9d13('0xb4')](_0x2223c4[_0x9d13('0x1e')][_0x2223c4['actions'][_0x59a6c6[_0x9d13('0x127')]]['queue']]);_0x2223c4['agents'][_0x2223c4[_0x9d13('0x24')][_0x59a6c6[_0x9d13('0x127')]][_0x9d13('0x12a')]][_0x9d13('0x128')]=![];delete _0x2223c4['actions'][_0x59a6c6[_0x9d13('0x127')]];unlockQueueStatus(_0x5c727a);});}else{this[_0x9d13('0xb4')](this[_0x9d13('0x1e')][this[_0x9d13('0x24')][_0x59a6c6['actionid']]['queue']]);this[_0x9d13('0xc0')]({'active':![],'ContactId':this[_0x9d13('0x24')][_0x59a6c6[_0x9d13('0x127')]][_0x9d13('0xd4')],'ListId':this['actions'][_0x59a6c6[_0x9d13('0x127')]][_0x9d13('0xd5')],'VoiceQueueId':this[_0x9d13('0x24')][_0x59a6c6[_0x9d13('0x127')]][_0x9d13('0xd7')]||undefined,'CampaignId':this['actions'][_0x59a6c6[_0x9d13('0x127')]][_0x9d13('0xd8')]||undefined})[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x132')));delete this['actions'][_0x59a6c6[_0x9d13('0x127')]];unlockQueueStatus(_0x5c727a);}}else if((strategy[this[_0x9d13('0x1e')][this[_0x9d13('0x24')][_0x59a6c6[_0x9d13('0x127')]]['queue']][_0x9d13('0x4e')]]||_0x9d13('0x16'))===_0x9d13('0x16')){var _0x102e79;if(this['actions'][_0x59a6c6['actionid']]&&!_[_0x9d13('0x47')](this[_0x9d13('0x28')][this[_0x9d13('0x24')][_0x59a6c6[_0x9d13('0x127')]][_0x9d13('0xb5')]])){if(this[_0x9d13('0x29')][_0x2223c4[_0x9d13('0x24')][_0x59a6c6[_0x9d13('0x127')]][_0x9d13('0xb5')]]){this[_0x9d13('0x29')][_0x2223c4['actions'][_0x59a6c6['actionid']]['queue']]=this[_0x9d13('0x29')][this[_0x9d13('0x24')][_0x59a6c6[_0x9d13('0x127')]][_0x9d13('0xb5')]]?this[_0x9d13('0x29')][this['actions'][_0x59a6c6[_0x9d13('0x127')]]['queue']]:this['queueBooked'][this[_0x9d13('0x24')][_0x59a6c6[_0x9d13('0x127')]][_0x9d13('0xb5')]]?this[_0x9d13('0x28')][this[_0x9d13('0x24')][_0x59a6c6[_0x9d13('0x127')]]['queue']][_0x9d13('0x133')]||0x0:0x0;}this[_0x9d13('0x28')][this['actions'][_0x59a6c6[_0x9d13('0x127')]][_0x9d13('0xb5')]][_0x9d13('0x133')]=this[_0x9d13('0x29')][this[_0x9d13('0x24')][_0x59a6c6[_0x9d13('0x127')]][_0x9d13('0xb5')]];for(var _0xb7be60=0x0;_0xb7be60=0x0;})[_0x9d13('0xb2')](myreject(_0x767766)));}}else{_0xd49d4e[_0x9d13('0x12b')](ami[_0x9d13('0x149')]({'action':'command','command':util[_0x9d13('0x7c')]('iftime\x20%s,%s',_0x178c93,!_['isUndefined'](config[_0x9d13('0x14d')][_0x39e9f9])?_0x39e9f9:'')})['then'](function(_0x210d4e){return _0x210d4e['content']['indexOf'](_0x9d13('0x14f'))>=0x0;})[_0x9d13('0xb2')](myreject(_0x767766)));}BPromise[_0x9d13('0x150')](_0xd49d4e)[_0x9d13('0xb8')](function(_0x2b8bef){var _0x442d52=_[_0x9d13('0x151')](_0x2b8bef);if(_0x442d52){return _0x2d38f2(_0x442d52);}else{_0x2158b8[_0x9d13('0x3f')]=_0x3d5272?'GLOBAL_INTERVAL_IS_OVERTIME':_0x9d13('0x152');return _0x767766(msgResponse('[ifTime][promiseAll]',_0x9d13('0x144'),_0x9d13('0x153')+_0x3d5272+'\x20'+_0x5bd66a+_0x9d13('0x154')+util[_0x9d13('0x97')](_0x178c93,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x39e9f9));}})['catch'](function(_0xcff95d){return _0x767766(msgResponse(_0x9d13('0x142'),'Failure',JSON['stringify'](_0xcff95d)));});});};Dialer['prototype']['checkDialMethod']=function(_0x22350d){var _0x57b80c=this;return function(){switch(_0x22350d[_0x9d13('0x155')]){case'progressive':freeVariablesPredictive(_0x22350d);_0x57b80c[_0x9d13('0x156')](_0x22350d,0x1);break;case _0x9d13('0x157'):freeVariablesPredictive(_0x22350d);_0x57b80c[_0x9d13('0x156')](_0x22350d,_0x22350d[_0x9d13('0x158')]);break;case _0x9d13('0x159'):_0x57b80c[_0x9d13('0x159')](_0x22350d);break;case _0x9d13('0x9'):freeVariablesPredictive(_0x22350d);_0x57b80c[_0x9d13('0x156')](_0x22350d,0x1);break;default:freeVariablesPredictive(_0x22350d);logger[_0x9d13('0x96')]('Queue',_0x22350d[_0x9d13('0x40')],'method\x20not\x20recognized');}};};Dialer[_0x9d13('0x18')][_0x9d13('0x15a')]=function(_0x5006e7){var _0x2b8bb1=this;return function(){_0x2b8bb1[_0x9d13('0x15b')](_0x5006e7);};};Dialer[_0x9d13('0x18')][_0x9d13('0x32')]=function(_0x4ad227){var _0x30ac27=this;if(isNotPreview(_0x4ad227[_0x9d13('0x155')])){if(isVoiceQueueOutbound(_0x4ad227[_0x9d13('0x4c')])&&isActive(_0x4ad227[_0x9d13('0x5a')])){_0x4ad227[_0x9d13('0xa1')]=!![];BPromise[_0x9d13('0xc1')]()[_0x9d13('0xb8')](checkIsLoggedIn(_0x4ad227,_0x4ad227[_0x9d13('0x15c')]))[_0x9d13('0xb8')](checkIsActive(_0x4ad227,_0x4ad227[_0x9d13('0x5a')]))[_0x9d13('0xb8')](checkInterval(_0x4ad227))[_0x9d13('0xb8')](_0x30ac27[_0x9d13('0x13d')](_0x4ad227))[_0x9d13('0xb8')](_0x30ac27[_0x9d13('0x141')](_0x4ad227[_0x9d13('0x15d')],_0x4ad227[_0x9d13('0x15e')],_0x4ad227[_0x9d13('0x40')],_0x4ad227))[_0x9d13('0xb8')](_0x30ac27[_0x9d13('0x143')](_0x4ad227[_0x9d13('0x43')],_0x4ad227['dialTimezone'],_0x4ad227[_0x9d13('0x40')],_0x4ad227))['then'](_0x30ac27[_0x9d13('0x15f')](_0x4ad227))[_0x9d13('0xb2')](loggerCatchQueueSummary(_0x9d13('0x160'),_0x4ad227));}else{notSendMessagesQueue(_0x4ad227);}}else{freeVariablesPredictive(_0x4ad227);}};Dialer[_0x9d13('0x18')]['syncCampaigns']=function(){var _0x2a7d0d=this;var _0x2965de;for(var _0x42f371 in this['campaigns']){if(typeof this['campaigns'][_0x42f371]!==_0x9d13('0x99')){_0x2965de=this[_0x9d13('0x1f')][_0x42f371];if(isCampaignIvr(_0x2965de[_0x9d13('0x4c')])&&isActive(_0x2965de[_0x9d13('0x79')])){_0x2965de[_0x9d13('0xa1')]=!![];BPromise[_0x9d13('0xc1')]()[_0x9d13('0xb8')](checkIsActive(_0x2965de,_0x2965de[_0x9d13('0x79')]))[_0x9d13('0xb8')](checkInterval(_0x2965de))[_0x9d13('0xb8')](_0x2a7d0d[_0x9d13('0x13d')](_0x2965de))['then'](_0x2a7d0d[_0x9d13('0x141')](_0x2965de[_0x9d13('0x15d')],_0x2965de['dialTimezone'],_0x2965de[_0x9d13('0x40')],_0x2965de))[_0x9d13('0xb8')](_0x2a7d0d['checkIfTimeIntervals'](_0x2965de[_0x9d13('0x43')],_0x2965de[_0x9d13('0x15e')],_0x2965de[_0x9d13('0x40')],_0x2965de))['then'](_0x2a7d0d['launchHandleIvr'](_0x2965de))['catch'](loggerCatchQueueSummary(_0x9d13('0x161'),_0x2965de));}else{notSendMessagesCampaign(_0x2965de);}}}};function getCallerIdRandom(_0xb237e7,_0x37412a){var _0x398151;var _0x22459b;var _0x27eff0;if(_0x37412a<=0x0){_0x37412a=0x1;}_0x398151=new RegExp('\x5cw{0,'+_0x37412a+'}$');_0x22459b=Math[_0x9d13('0x162')](0xa,_0x37412a-0x1);_0x27eff0=Math['pow'](0xa,_0x37412a)-0x1;return util[_0x9d13('0x7c')]('%s',_[_0x9d13('0x163')](_0xb237e7,_0x398151,_[_0x9d13('0x164')](_0x22459b,_0x27eff0)));}function extractCalleridName(_0x2ab445){var _0x404d40=_0x2ab445[_0x9d13('0x165')](/"(.*?)"/);return _0x404d40?_0x404d40[0x1]:_0x2ab445;}function extractCalleridNumber(_0x4f3a83){var _0x2e11ff=_0x4f3a83[_0x9d13('0x165')](/<(.*?)>/);return _0x2e11ff?_0x2e11ff[0x1]:_0x4f3a83;}Dialer[_0x9d13('0x18')]['actionOriginate']=function(_0x39cf13,_0x78d5a8){var _0x9f6b7=this;var _0x3225c6=uuid['v4']();this[_0x9d13('0x24')][_0x3225c6]=new Action(_0x39cf13,_0x78d5a8,_0x3225c6);return new BPromise(function(_0x107c8c,_0x10e02c){if(_[_0x9d13('0x3e')](_0x39cf13)&&typeof _0x39cf13!==_0x9d13('0x166')){return _0x10e02c(msgResponse('originate','Failure',_0x9d13('0x167')));}if(_[_0x9d13('0x3e')](_0x78d5a8[_0x9d13('0x168')][_0x9d13('0x169')])||_0x78d5a8[_0x9d13('0x168')][_0x9d13('0x169')]===null){return _0x10e02c(msgResponse(_0x9d13('0x16a'),'Failure','contact\x20is\x20undefine'));}var _0x5e4719={'XMD-CALLERID':_0x9f6b7['actions'][_0x3225c6][_0x9d13('0x16b')](),'XMD-AGI':_0x39cf13[_0x9d13('0x105')]?util[_0x9d13('0x7c')](_0x9d13('0x16c'),ipAgi,_0x39cf13[_0x9d13('0x105')]):_0x9d13('0x16d'),'XMD-AGIAFTER':_0x39cf13[_0x9d13('0x10d')]?util[_0x9d13('0x7c')](_0x9d13('0x16c'),ipAgi,_0x39cf13[_0x9d13('0x10d')]):_0x9d13('0x16d'),'XMD-QUEUE':_0x39cf13[_0x9d13('0x4c')]===_0x9d13('0x4d')?util['format'](_0x9d13('0x16e'),_0x39cf13['name'],_0x39cf13[_0x9d13('0x16f')]||'',_0x39cf13[_0x9d13('0x10e')]?'c':'',_0x39cf13[_0x9d13('0x116')]||0x3):_0x9d13('0x16d'),'XMD-CONTACTID':_0x78d5a8['ContactId'],'XMD-CDRTYPE':_0x9d13('0x8'),'CALLERID(all)':_0x9f6b7[_0x9d13('0x24')][_0x3225c6]['getCaller'](),'XMD-AMD':_0x39cf13['dialAMDActive']?_0x9d13('0x170'):_0x9d13('0x16d'),'XMD-DESTINATION':_0x9d13('0x171')};if(_0x39cf13[_0x9d13('0xec')]){_0x5e4719['XMD-AMDINITIALSILENCE']=_0x39cf13[_0x9d13('0x172')]||0x9c4;_0x5e4719[_0x9d13('0x173')]=_0x39cf13['dialAMDGreeting']||0x5dc;_0x5e4719['XMD-AMDAFTERGREETINGSILENCE']=_0x39cf13[_0x9d13('0x174')]||0x320;_0x5e4719[_0x9d13('0x175')]=_0x39cf13[_0x9d13('0x176')]||0x1388;_0x5e4719[_0x9d13('0x177')]=_0x39cf13[_0x9d13('0x178')]||0x64;_0x5e4719[_0x9d13('0x179')]=_0x39cf13[_0x9d13('0x17a')]||0x32;_0x5e4719['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x39cf13[_0x9d13('0x17b')]||0x3;_0x5e4719[_0x9d13('0x17c')]=_0x39cf13[_0x9d13('0x17d')]||0x100;_0x5e4719[_0x9d13('0x17e')]=_0x39cf13[_0x9d13('0x17f')]||0x1388;}if(_0x39cf13['type']===_0x9d13('0x4d')){_0x5e4719['XMD-VOICEQUEUEID']=_0x78d5a8['VoiceQueueId'];}else{_0x5e4719['XMD-CAMPAIGNID']=_0x78d5a8[_0x9d13('0xd8')];}for(var _0x3f978c in _0x78d5a8['Contact']){if(typeof _0x78d5a8[_0x9d13('0x168')][_0x3f978c]!==_0x9d13('0x99')){if(isNotNull(_0x78d5a8[_0x9d13('0x168')][_0x3f978c])&&_0x3f978c!=='id'&&_0x3f978c!==_0x9d13('0x180')&&_0x3f978c!==_0x9d13('0x181')&&_0x3f978c!==_0x9d13('0x182')){_0x5e4719[util[_0x9d13('0x7c')](_0x9d13('0x183'),_0x9d13('0x184'),_[_0x9d13('0x185')](_0x3f978c))]=_0x78d5a8[_0x9d13('0x168')][_0x3f978c];}}}var _0x126aa4=_0x9f6b7['isTrunkReachable'](_0x39cf13[_0x9d13('0x78')])?getCallerId(_0x39cf13[_0x9d13('0x78')][_0x9d13('0x186')],_0x39cf13[_0x9d13('0x5b')],_0x39cf13[_0x9d13('0x187')]>0x0?getCallerIdRandom(_0x39cf13[_0x9d13('0x5c')],_0x39cf13[_0x9d13('0x187')]):_0x39cf13[_0x9d13('0x5c')]):getCallerId(_[_0x9d13('0xdf')](_0x39cf13[_0x9d13('0x188')])?_0x39cf13[_0x9d13('0x78')][_0x9d13('0x186')]:_0x39cf13['TrunkBackup']['callerid'],_0x39cf13[_0x9d13('0x5b')],_0x39cf13['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x39cf13[_0x9d13('0x5c')],_0x39cf13['dialRandomLastDigitCallerIdNumber']):_0x39cf13[_0x9d13('0x5c')]);if(_0x126aa4){_0x5e4719[_0x9d13('0x189')]=_0x9f6b7['actions'][_0x3225c6][_0x9d13('0x18a')]=extractCalleridName(_0x126aa4);_0x5e4719['XMD-ORIGINATECALLERIDNUM']=_0x9f6b7[_0x9d13('0x24')][_0x3225c6][_0x9d13('0x18b')]=extractCalleridNumber(_0x126aa4);}return ami[_0x9d13('0x149')]({'actionid':_0x3225c6,'action':_0x9d13('0x16a'),'channel':_0x9f6b7[_0x9d13('0x13e')](_0x39cf13[_0x9d13('0x78')])?util['format'](_0x9d13('0x18c'),_0x39cf13[_0x9d13('0x78')][_0x9d13('0x40')],isNotNull(_0x39cf13[_0x9d13('0x5e')])?_0x39cf13['dialPrefix']['trim']()||'':'',_0x39cf13[_0x9d13('0x18d')]>0x0?_0x78d5a8[_0x9d13('0x168')]['phone'][_0x9d13('0x18e')](_0x39cf13[_0x9d13('0x18d')]):_0x78d5a8[_0x9d13('0x168')][_0x9d13('0x169')]):util[_0x9d13('0x7c')](_0x9d13('0x18c'),_['isNil'](_0x39cf13['TrunkBackup'])?_0x39cf13[_0x9d13('0x78')]['name']:_0x39cf13[_0x9d13('0x188')][_0x9d13('0x40')],isNotNull(_0x39cf13[_0x9d13('0x5e')])?_0x39cf13['dialPrefix'][_0x9d13('0x18f')]()||'':'',_0x39cf13['dialCutDigit']>0x0?_0x78d5a8[_0x9d13('0x168')][_0x9d13('0x169')]['substring'](_0x39cf13[_0x9d13('0x18d')]):_0x78d5a8[_0x9d13('0x168')][_0x9d13('0x169')]),'callerid':_0x126aa4,'Exten':_0x9d13('0x171'),'Context':_0x9d13('0x190'),'Priority':'1','variable':_0x5e4719,'timeout':(_0x39cf13[_0x9d13('0x5d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3225c6})[_0x9d13('0xb8')](function(_0x15a592){return _0x107c8c(_0x15a592);})[_0x9d13('0xb2')](function(_0x2ea894){_0x39cf13[_0x9d13('0x191')]+=0x1;var _0xe6c34a=new History(_0x9f6b7[_0x9d13('0x24')][_0x3225c6]);logger[_0x9d13('0x96')](util[_0x9d13('0x7c')](_0x9d13('0x192'),JSON[_0x9d13('0x48')](_0x2ea894)));_0xe6c34a['state']=0xe;_0xe6c34a['statedesc']='OriginateError';_0xe6c34a[_0x9d13('0xab')]=moment()[_0x9d13('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0xe6c34a[_0x9d13('0xaa')]=_0xe6c34a[_0x9d13('0xab')];_0x9f6b7[_0x9d13('0xcb')](_0xe6c34a)[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x193')));_0x9f6b7[_0x9d13('0xca')](_0xe6c34a)[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x193')))[_0x9d13('0x1b')](function(){delete _0x9f6b7['actions'][_0x3225c6];return _0x10e02c(msgResponse(_0x9d13('0x16a'),_0x9d13('0x194'),'originate\x20action\x20Error'));});});});};Dialer[_0x9d13('0x18')][_0x9d13('0x2f')]=function(_0x56df62){var _0x1eef4c=this[_0x9d13('0x24')][_0x56df62[_0x9d13('0x127')]];if(_0x1eef4c){delete this[_0x9d13('0x24')][_0x56df62[_0x9d13('0x127')]];_0x1eef4c[_0x9d13('0x115')]=moment()[_0x9d13('0x7c')](_0x9d13('0xff'));var _0x3d79ea=_0x1eef4c[_0x9d13('0x4c')]===_0x9d13('0x7b')?this[_0x9d13('0x1f')][_0x1eef4c[_0x9d13('0xb5')]]:this[_0x9d13('0x1e')][_0x1eef4c[_0x9d13('0x195')]()];if(!this[_0x9d13('0xdb')](_0x56df62[_0x9d13('0x196')])){this[_0x9d13('0xb4')](_0x3d79ea);return this[_0x9d13('0x197')](_0x1eef4c,_0x3d79ea,_0x56df62)[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x198')));}this[_0x9d13('0xac')][_0x56df62[_0x9d13('0xee')]]=_0x1eef4c;}};Dialer[_0x9d13('0x18')][_0x9d13('0x199')]=function(_0x2977b5,_0xbc9754,_0xc8a876){var _0xa11b45=new History(_0xbc9754);if(_0xa11b45[_0x9d13('0xef')]+_0xa11b45[_0x9d13('0xf0')]+_0xa11b45['countnoanswerretry']+_0xa11b45[_0x9d13('0xf2')]+_0xa11b45[_0x9d13('0xf3')]+_0xa11b45['countabandonedretry']+_0xa11b45[_0x9d13('0xf5')]+_0xa11b45[_0x9d13('0xf6')]>=_0xc8a876[_0x9d13('0xf7')]-0x1){return!![];}switch(_0x2977b5){case 0x3:if(_0xa11b45['countnoanswerretry']>=_0xc8a876[_0x9d13('0x19a')]-0x1){return!![];}this[_0x9d13('0xc0')]({'active':![],'countnoanswerretry':_0xa11b45[_0x9d13('0xf1')]+=0x1,'scheduledat':moment()[_0x9d13('0xfc')](_0xc8a876[_0x9d13('0x19b')],'minutes')[_0x9d13('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa11b45[_0x9d13('0xd4')],'ListId':_0xa11b45[_0x9d13('0xd5')],'VoiceQueueId':_0xa11b45[_0x9d13('0xd7')]||undefined,'CampaignId':_0xa11b45['CampaignId']||undefined})[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x19c')));break;case 0x5:if(_0xa11b45[_0x9d13('0xef')]>=_0xc8a876[_0x9d13('0x19d')]-0x1){return!![];}this[_0x9d13('0xc0')]({'active':![],'countbusyretry':_0xa11b45[_0x9d13('0xef')]+=0x1,'scheduledat':moment()[_0x9d13('0xfc')](_0xc8a876[_0x9d13('0x19e')],_0x9d13('0xfe'))[_0x9d13('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa11b45['ContactId'],'ListId':_0xa11b45[_0x9d13('0xd5')],'VoiceQueueId':_0xa11b45[_0x9d13('0xd7')]||undefined,'CampaignId':_0xa11b45['CampaignId']||undefined})['catch'](loggerCatch(_0x9d13('0x19f')));break;case 0x8:if(_0xa11b45[_0x9d13('0xf0')]>=_0xc8a876['dialCongestionMaxRetry']-0x1){return!![];}this[_0x9d13('0xc0')]({'active':![],'countcongestionretry':_0xa11b45[_0x9d13('0xf0')]+=0x1,'scheduledat':moment()[_0x9d13('0xfc')](_0xc8a876[_0x9d13('0x1a0')],_0x9d13('0xfe'))[_0x9d13('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa11b45[_0x9d13('0xd4')],'ListId':_0xa11b45['ListId'],'VoiceQueueId':_0xa11b45['VoiceQueueId']||undefined,'CampaignId':_0xa11b45['CampaignId']||undefined})[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x1a1')));break;case 0x0:if(_0xa11b45['countnosuchnumberretry']>=_0xc8a876['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x9d13('0xc0')]({'active':![],'countnosuchnumberretry':_0xa11b45['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x9d13('0xfc')](_0xc8a876[_0x9d13('0x1a2')],'minutes')[_0x9d13('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa11b45[_0x9d13('0xd4')],'ListId':_0xa11b45['ListId'],'VoiceQueueId':_0xa11b45[_0x9d13('0xd7')]||undefined,'CampaignId':_0xa11b45[_0x9d13('0xd8')]||undefined})[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x1a3')));}break;case 0xa:if(_0xa11b45['countdropretry']>=_0xc8a876['dialDropMaxRetry']-0x1){return!![];}this[_0x9d13('0xc0')]({'active':![],'countdropretry':_0xa11b45['countdropretry']+=0x1,'scheduledat':moment()[_0x9d13('0xfc')](_0xc8a876[_0x9d13('0x11b')],_0x9d13('0xfe'))['format'](_0x9d13('0xff')),'ContactId':_0xa11b45[_0x9d13('0xd4')],'ListId':_0xa11b45[_0x9d13('0xd5')],'VoiceQueueId':_0xa11b45[_0x9d13('0xd7')]||undefined,'CampaignId':_0xa11b45['CampaignId']||undefined})[_0x9d13('0xb2')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0xa11b45[_0x9d13('0xf4')]>=_0xc8a876[_0x9d13('0x122')]-0x1){return!![];}this[_0x9d13('0xc0')]({'active':![],'countabandonedretry':_0xa11b45[_0x9d13('0xf4')]+=0x1,'scheduledat':moment()[_0x9d13('0xfc')](_0xc8a876[_0x9d13('0x123')],_0x9d13('0xfe'))[_0x9d13('0x7c')](_0x9d13('0xff')),'ContactId':_0xa11b45[_0x9d13('0xd4')],'ListId':_0xa11b45['ListId'],'VoiceQueueId':_0xa11b45['VoiceQueueId']||undefined,'CampaignId':_0xa11b45['CampaignId']||undefined})[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x124')));break;case 0x13:if(_0xa11b45[_0x9d13('0xf5')]>=_0xc8a876[_0x9d13('0xfa')]-0x1){return!![];}this[_0x9d13('0xc0')]({'active':![],'countmachineretry':_0xa11b45['countmachineretry']+=0x1,'scheduledat':moment()[_0x9d13('0xfc')](_0xc8a876[_0x9d13('0xfd')],_0x9d13('0xfe'))[_0x9d13('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa11b45[_0x9d13('0xd4')],'ListId':_0xa11b45[_0x9d13('0xd5')],'VoiceQueueId':_0xa11b45[_0x9d13('0xd7')]||undefined,'CampaignId':_0xa11b45[_0x9d13('0xd8')]||undefined})['catch'](loggerCatch(_0x9d13('0x100')));break;case 0x14:if(_0xa11b45['countagentrejectretry']>=_0xc8a876[_0x9d13('0x1a4')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0xa11b45[_0x9d13('0xf6')]+=0x1,'scheduledat':moment()[_0x9d13('0xfc')](_0xc8a876[_0x9d13('0x1a5')],'minutes')[_0x9d13('0x7c')](_0x9d13('0xff')),'ContactId':_0xa11b45[_0x9d13('0xd4')],'ListId':_0xa11b45['ListId'],'VoiceQueueId':_0xa11b45['VoiceQueueId']||undefined,'CampaignId':_0xa11b45[_0x9d13('0xd8')]||undefined})['catch'](loggerCatch(_0x9d13('0x1a6')));break;default:return!![];}};Dialer[_0x9d13('0x18')][_0x9d13('0x197')]=function(_0x6d72e0,_0x2f5f14,_0xeaf932){var _0x1dfe6d=this;var _0xb98a48=new History(_0x6d72e0);return new BPromise(function(_0x47d3ff,_0x427903){if(_[_0x9d13('0x3e')](_0x2f5f14)&&typeof _0x2f5f14!=='object'){return _0x427903(msgResponse('[callProgressDetecting]','Failure',_0x9d13('0x1a7')));}if(_[_0x9d13('0x3e')](_0xeaf932)&&typeof _0xeaf932!==_0x9d13('0x166')){return _0x427903(msgResponse('[callProgressDetecting]',_0x9d13('0x144'),_0x9d13('0x1a8')));}switch(_0xeaf932['reason']){case'0':_0x2f5f14[_0x9d13('0x67')]+=0x1;_0xb98a48[_0x9d13('0xa8')]=0x0;_0xb98a48[_0x9d13('0xa9')]=_0x9d13('0x1a9');_0xb98a48[_0x9d13('0xf2')]+=0x1;_0xb98a48[_0x9d13('0x119')]+=0x1;ami[_0x9d13('0xe7')]('custom:agentnosuchnumber',ut[_0x9d13('0xe9')](_0x6d72e0,'nosuchnumber'));_0x1dfe6d[_0x9d13('0xcb')](_0xb98a48)['catch'](loggerCatch(_0x9d13('0x102')));if(_0x1dfe6d[_0x9d13('0x199')](0x0,_0x6d72e0,_0x2f5f14)){if(_0xb98a48['countnosuchnumberretry']>=_0x2f5f14[_0x9d13('0x1aa')]){_0x1dfe6d[_0x9d13('0xfb')](_0xb98a48,_0x47d3ff,_0x427903,_0x9d13('0x1ab'));}else{_0x1dfe6d[_0x9d13('0xf8')](_0xb98a48,_0x47d3ff,_0x427903,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x2f5f14['outboundNoAnswerCallsDay']+=0x1;_0xb98a48[_0x9d13('0xa8')]=0x3;_0xb98a48[_0x9d13('0xa9')]=_0x9d13('0x1ac');_0xb98a48[_0x9d13('0xf1')]+=0x1;_0xb98a48[_0x9d13('0x119')]+=0x1;ami['emit']('custom:agentnoanswer',ut[_0x9d13('0xe9')](_0x6d72e0,'noanswer'));_0x1dfe6d[_0x9d13('0xcb')](_0xb98a48)[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x1ad')));if(_0x1dfe6d[_0x9d13('0x199')](0x3,_0x6d72e0,_0x2f5f14)){if(_0xb98a48[_0x9d13('0xf1')]>=_0x2f5f14[_0x9d13('0x19a')]){_0x1dfe6d[_0x9d13('0xfb')](_0xb98a48,_0x47d3ff,_0x427903,'reason\x203\x20ringing\x20no\x20answer');}else{_0x1dfe6d[_0x9d13('0xf8')](_0xb98a48,_0x47d3ff,_0x427903,_0x9d13('0x1ae'));}}break;case'5':_0x2f5f14[_0x9d13('0x1af')]+=0x1;_0xb98a48[_0x9d13('0xa8')]=0x5;_0xb98a48[_0x9d13('0xa9')]=_0x9d13('0x1b0');_0xb98a48[_0x9d13('0xef')]+=0x1;_0xb98a48[_0x9d13('0x119')]+=0x1;ami['emit']('custom:agentbusy',ut[_0x9d13('0xe9')](_0x6d72e0,_0x9d13('0x1b1')));_0x1dfe6d['createHistory'](_0xb98a48)[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x1b2')));if(_0x1dfe6d[_0x9d13('0x199')](0x5,_0x6d72e0,_0x2f5f14)){if(_0xb98a48[_0x9d13('0xef')]>=_0x2f5f14[_0x9d13('0x19d')]){_0x1dfe6d[_0x9d13('0xfb')](_0xb98a48,_0x47d3ff,_0x427903,'reason\x205\x20busy');}else{_0x1dfe6d[_0x9d13('0xf8')](_0xb98a48,_0x47d3ff,_0x427903,_0x9d13('0x1b3'));}}break;case'8':_0x2f5f14[_0x9d13('0x62')]+=0x1;_0xb98a48['state']=0x8;_0xb98a48['statedesc']=_0x9d13('0x1b4');_0xb98a48[_0x9d13('0xf0')]+=0x1;_0xb98a48[_0x9d13('0x119')]+=0x1;ami[_0x9d13('0xe7')](_0x9d13('0x1b5'),ut[_0x9d13('0xe9')](_0x6d72e0,_0x9d13('0x1b6')));_0x1dfe6d[_0x9d13('0xcb')](_0xb98a48)['catch'](loggerCatch(_0x9d13('0x1b7')));if(_0x1dfe6d[_0x9d13('0x199')](0x8,_0x6d72e0,_0x2f5f14)){if(_0xb98a48['countcongestionretry']>=_0x2f5f14[_0x9d13('0x1b8')]){_0x1dfe6d['createStateFinal'](_0xb98a48,_0x47d3ff,_0x427903,'reason\x208\x20congestion');}else{_0x1dfe6d[_0x9d13('0xf8')](_0xb98a48,_0x47d3ff,_0x427903,_0x9d13('0x1b9'));}}break;case'11':_0x2f5f14[_0x9d13('0x1ba')]+=0x1;_0xb98a48[_0x9d13('0xa8')]=0xb;_0xb98a48[_0x9d13('0xa9')]=_0x9d13('0x125');_0xb98a48[_0x9d13('0xf4')]+=0x1;_0xb98a48['countglobal']+=0x1;_0x1dfe6d[_0x9d13('0xcb')](_0xb98a48)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x1dfe6d[_0x9d13('0x199')](0xb,_0x6d72e0,_0x2f5f14)){if(_0xb98a48[_0x9d13('0xf4')]>=_0x2f5f14[_0x9d13('0x122')]){_0x1dfe6d[_0x9d13('0xfb')](_0xb98a48,_0x47d3ff,_0x427903,_0x9d13('0x1bb'));}else{_0x1dfe6d['stateGlobal'](_0xb98a48,_0x47d3ff,_0x427903,'reason\x2011\x20abandoned');}}break;case'20':_0x2f5f14[_0x9d13('0x68')]+=0x1;_0xb98a48[_0x9d13('0xa8')]=0x14;_0xb98a48[_0x9d13('0xa9')]=_0x9d13('0x1bc');_0xb98a48[_0x9d13('0xf6')]+=0x1;_0xb98a48['countglobal']+=0x1;ami['emit'](_0x9d13('0x1bd'),ut['buildObj'](_0x6d72e0,_0x9d13('0x1be')));_0x1dfe6d[_0x9d13('0xcb')](_0xb98a48)[_0x9d13('0xb2')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x1dfe6d[_0x9d13('0x199')](0x14,_0x6d72e0,_0x2f5f14)){if(_0xb98a48[_0x9d13('0xf6')]>=_0x2f5f14[_0x9d13('0x1a4')]){_0x1dfe6d[_0x9d13('0xfb')](_0xb98a48,_0x47d3ff,_0x427903,_0x9d13('0x1bf'));}else{_0x1dfe6d[_0x9d13('0xf8')](_0xb98a48,_0x47d3ff,_0x427903,_0x9d13('0x1bf'));}}break;default:_0x2f5f14['outboundUnknownCallsDay']+=0x1;_0xb98a48[_0x9d13('0xa8')]=0xc;_0xb98a48[_0x9d13('0xa9')]=_0xeaf932[_0x9d13('0x10a')];_0x1dfe6d[_0x9d13('0xcb')](_0xb98a48)[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x1c0')));if(_0x1dfe6d[_0x9d13('0x199')](_0xeaf932['reason'],_0x6d72e0,_0x2f5f14)){if(_0xb98a48[_0x9d13('0xef')]+_0xb98a48[_0x9d13('0xf0')]+_0xb98a48[_0x9d13('0xf1')]+_0xb98a48[_0x9d13('0xf2')]+_0xb98a48[_0x9d13('0xf3')]+_0xb98a48['countabandonedretry']+_0xb98a48['countmachineretry']+_0xb98a48[_0x9d13('0xf6')]>=_0x2f5f14[_0x9d13('0xf7')]){_0x1dfe6d[_0x9d13('0xf8')](_0xb98a48,_0x47d3ff,_0x427903,_0xeaf932[_0x9d13('0x10a')]);}else{_0x1dfe6d[_0x9d13('0xfb')](_0xb98a48,_0x47d3ff,_0x427903,_0xeaf932[_0x9d13('0x10a')]);}}}});};Dialer[_0x9d13('0x18')][_0x9d13('0xf8')]=function(_0x12835d,_0x201dbf,_0x348c9b,_0xcd1534){var _0x5932d8=new Final(_0x12835d);_0x5932d8[_0x9d13('0xa8')]=0xf;_0x5932d8[_0x9d13('0xa9')]=_0x9d13('0x1c1');this[_0x9d13('0xfb')](_0x5932d8,_0x201dbf,_0x348c9b,_0xcd1534);};Dialer[_0x9d13('0x18')][_0x9d13('0xfb')]=function(_0x9297af,_0x1cf31b,_0x330704,_0x2fee05){this[_0x9d13('0xca')](_0x9297af)[_0x9d13('0xb8')](function(){return _0x1cf31b(msgResponse(_0x9d13('0x1c2'),_0x9d13('0xdc'),_0x2fee05));})[_0x9d13('0xb2')](function(){return _0x330704(msgResponse(_0x9d13('0x1c3'),_0x9d13('0x144'),'contact\x20not\x20moved'));});};Dialer[_0x9d13('0x18')][_0x9d13('0x159')]=function(_0x565aea){var _0x3542ee=_0x565aea[_0x9d13('0x1c4')]/0x64;var _0x33b311=_0x565aea['outboundDropCallsDayTimeout']/(_0x565aea['outboundDropCallsDayTimeout']+_0x565aea['outboundAnswerCallsDay']);var _0x5989e2=Math[_0x9d13('0x1c5')](_0x565aea[_0x9d13('0x71')]*(_0x565aea[_0x9d13('0x1c6')]/0x64));var _0x5ba073=Math[_0x9d13('0x1c5')](_0x565aea[_0x9d13('0x71')]*(_0x565aea[_0x9d13('0x1c7')]/0x64));var _0x590c1a=_0x565aea['available']+_0x565aea['talking'];var _0x3c6b2c=Math[_0x9d13('0x1c8')](_0x565aea[_0x9d13('0x74')]*_0x565aea['erlangAbandonmentRate']*_0x565aea[_0x9d13('0x1c9')]*_0x565aea[_0x9d13('0x6f')]);if(_[_0x9d13('0x3e')](_0x565aea[_0x9d13('0x26')])){if(!_['isUndefined'](_0x565aea['startPredictive'])){_0x565aea[_0x9d13('0x91')]=undefined;loggerPredictive[_0x9d13('0x96')](_0x9d13('0x1ca'),_0x9d13('0x1cb'));}if(!_[_0x9d13('0x3e')](_0x565aea[_0x9d13('0x92')])){loggerPredictive['error'](_0x9d13('0x1ca'),_0x9d13('0x1cc'));clearInterval(_0x565aea[_0x9d13('0x92')]);_0x565aea[_0x9d13('0x92')]=undefined;}_0x565aea[_0x9d13('0x26')]=moment()[_0x9d13('0x7c')](_0x9d13('0xff'));loggerPredictive[_0x9d13('0x7f')](_0x565aea[_0x9d13('0x40')],'collection\x20data\x20in\x20progressive\x20at',_0x565aea[_0x9d13('0x26')]);this[_0x9d13('0x156')](_0x565aea,0x1);}else if(ifInterval(_0x565aea[_0x9d13('0x1cd')],_0x565aea[_0x9d13('0x26')])){this[_0x9d13('0x156')](_0x565aea,0x1);loggerPredictiveCalls['info'](_0x9d13('0x1ce'),_0x565aea[_0x9d13('0x26')],_0x565aea['name']);_0x565aea[_0x9d13('0x74')]=0x0;_0x565aea[_0x9d13('0x6e')]=0x0;}else if(_0x3542ee<_0x33b311&&_0x565aea[_0x9d13('0x1cf')]===_0x9d13('0x1d0')){freeVariablesPredictive(_0x565aea);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x9d13('0x1d1'),_0x33b311,_0x9d13('0x26'),_0x565aea['name']);}else if(_0x3c6b2c<_0x565aea['predictiveIntervalErlangCallsDroppedCalls']&&_0x565aea[_0x9d13('0x1cf')]==='dropRate'){freeVariablesPredictive(_0x565aea);loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x1d2'),_0x9d13('0x1d3'),_0x3c6b2c,_0x9d13('0x1d4'),_0x565aea['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x565aea[_0x9d13('0x40')]);}else if(!ifInterval(_0x565aea[_0x9d13('0x1cd')],_0x565aea[_0x9d13('0x26')])&&_[_0x9d13('0x3e')](_0x565aea[_0x9d13('0x91')])&&!_[_0x9d13('0x3e')](_0x565aea[_0x9d13('0x26')])){_0x565aea[_0x9d13('0x91')]=moment()[_0x9d13('0x7c')](_0x9d13('0xff'));loggerPredictive[_0x9d13('0x7f')](_0x565aea[_0x9d13('0x40')],_0x9d13('0x1d5'),_0x565aea[_0x9d13('0x91')]);this['averageHandleTime'](_0x565aea[_0x9d13('0x1cd')])[_0x9d13('0xb8')](this[_0x9d13('0x1d6')](_0x565aea))['then'](mergeDataErlangB(_0x565aea))[_0x9d13('0xb8')](this[_0x9d13('0x1d7')](_0x565aea))[_0x9d13('0xb2')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x565aea));}else if(!ifInterval(_0x565aea[_0x9d13('0x1cd')],_0x565aea[_0x9d13('0x91')])){_0x565aea[_0x9d13('0x6e')]=0x0;_0x565aea[_0x9d13('0x91')]=moment()[_0x9d13('0x7c')](_0x9d13('0xff'));loggerPredictive['info'](_0x565aea[_0x9d13('0x40')],_0x9d13('0x1d8'),_0x565aea['startPredictive']);clearInterval(_0x565aea[_0x9d13('0x92')]);_0x565aea[_0x9d13('0x92')]=undefined;this[_0x9d13('0xbd')](_0x565aea['dialPredictiveInterval'])[_0x9d13('0xb8')](this[_0x9d13('0x1d6')](_0x565aea))[_0x9d13('0xb8')](mergeDataErlangB(_0x565aea))[_0x9d13('0xb8')](this[_0x9d13('0x1d7')](_0x565aea))[_0x9d13('0xb2')](loggerCatchPredictive(_0x9d13('0x1d9'),_0x565aea));}else if(_0x565aea[_0x9d13('0x71')]&&_0x590c1a<_0x565aea['predictiveIntervalAvailable']-_0x5ba073){freeVariablesPredictive(_0x565aea);loggerPredictive['info'](_0x565aea['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x590c1a,_0x9d13('0x1da'),_0x565aea[_0x9d13('0x71')],'-',_0x5ba073,'=',_0x565aea['predictiveIntervalAvailable']-_0x5ba073,')');}else if(_0x565aea[_0x9d13('0x71')]&&_0x590c1a>_0x565aea['predictiveIntervalAvailable']+_0x5989e2){freeVariablesPredictive(_0x565aea);loggerPredictive[_0x9d13('0x7f')](_0x565aea[_0x9d13('0x40')],_0x9d13('0x1db'),_0x590c1a,_0x9d13('0x1dc'),_0x565aea[_0x9d13('0x71')],'+',_0x5989e2,'=',_0x565aea[_0x9d13('0x71')]+_0x5989e2,')');}};Dialer[_0x9d13('0x18')][_0x9d13('0x1d6')]=function(_0x17202f){var _0x24bb56=this;return function(_0x5e7dbc){return new BPromise(function(_0x24c0ce,_0x8945d6){_['merge'](_0x17202f,_0x5e7dbc[0x0]);if(checkGetDataPredictive(_0x5e7dbc[0x0])){var _0x136f49=_0x17202f['predictiveIntervalAvailable']=_0x17202f[_0x9d13('0x54')]+_0x17202f['available'];var _0x49ee52=_0x17202f[_0x9d13('0x1cd')]*0x3c;var _0x12be24=_0x5e7dbc[0x0][_0x9d13('0x6a')]+_0x5e7dbc[0x0][_0x9d13('0x86')];var _0x366d76=(_0x5e7dbc[0x0]['predictiveIntervalAnsweredCalls']+_0x5e7dbc[0x0][_0x9d13('0x6c')]+_0x5e7dbc[0x0][_0x9d13('0x6b')])/_0x5e7dbc[0x0]['predictiveIntervalTotalCalls'];_0x17202f['predictiveIntervalHitRate']=_0x366d76>0x0?_0x366d76:0x1;switch(_0x17202f[_0x9d13('0x1cf')]){case _0x9d13('0x1d0'):var _0x4301b0=_0x17202f[_0x9d13('0x1c4')]/0x64;return _0x24bb56['abandonmentRate'](_0x136f49,_0x49ee52,_0x12be24,_0x366d76,_0x4301b0)[_0x9d13('0xb8')](function(_0x19e55f){return _0x24c0ce(_0x19e55f);});case'agentBusyFactor':var _0x409ae3=_0x17202f[_0x9d13('0x1c4')]/0x64;return _0x24bb56['busyFactor'](_0x136f49,_0x49ee52,_0x12be24,_0x366d76,_0x409ae3)[_0x9d13('0xb8')](function(_0x13b27c){return _0x24c0ce(_0x13b27c);});default:return _0x8945d6(msgResponse(_0x9d13('0x1dd'),_0x9d13('0x144'),_0x9d13('0x1de')));}}else{return _0x8945d6(msgResponse(_0x9d13('0x1dd'),_0x9d13('0x144'),_0x9d13('0x1df')));}});};};Dialer['prototype'][_0x9d13('0x1e0')]=function(_0x266a2e){var _0x238493=this;return function(_0x333c3c){return new BPromise(function(_0x5f2f6a,_0x150a8e){_[_0x9d13('0x8f')](_0x266a2e,_0x333c3c[0x0]);if(checkGetDataPredictive(_0x333c3c[0x0])){loggerPredictive['info'](JSON[_0x9d13('0x48')](_0x333c3c[0x0]));if(_0x266a2e[_0x9d13('0x1cf')]===_0x9d13('0x1d0')){return _0x238493[_0x9d13('0xc9')](_0x266a2e['id'])['then'](function(_0x3cc765){var _0x44bc24=_0x266a2e['loggedIn']-_0x3cc765[0x0]['outboundQueuePauses'];var _0x149834=_0x266a2e[_0x9d13('0x1cd')]*0x3c;var _0x4fe005=_0x333c3c[0x0][_0x9d13('0x6a')]+_0x333c3c[0x0][_0x9d13('0x86')];var _0x5c666d=(_0x333c3c[0x0][_0x9d13('0x69')]+_0x333c3c[0x0][_0x9d13('0x6c')]+_0x333c3c[0x0][_0x9d13('0x6b')])/_0x333c3c[0x0][_0x9d13('0x72')];var _0x1a0b9c=_0x266a2e[_0x9d13('0x1c4')]/0x64;_0x266a2e['predictiveIntervalPauses']=_0x3cc765[0x0]['outboundQueuePauses']||0x0;_0x266a2e[_0x9d13('0x1c9')]=_0x5c666d>0x0?_0x5c666d:0x1;return _0x238493['abandonmentRate'](_0x44bc24,_0x149834,_0x4fe005,_0x5c666d,_0x1a0b9c);})[_0x9d13('0xb8')](function(_0x17d07e){return _0x5f2f6a(_0x17d07e);})[_0x9d13('0xb2')](function(_0x29d719){return _0x150a8e(msgResponse(_0x9d13('0x1e1'),_0x9d13('0x144'),JSON[_0x9d13('0x48')](_0x29d719)));});}if(_0x266a2e[_0x9d13('0x1cf')]===_0x9d13('0x1e2')){return _0x238493['getVoiceQueueRtPauses'](_0x266a2e['id'])[_0x9d13('0xb8')](function(_0x4b79c8){var _0x51da28=_0x266a2e[_0x9d13('0x15c')]-_0x4b79c8[0x0][_0x9d13('0x1e3')];var _0x41f1e3=_0x266a2e[_0x9d13('0x1cd')]*0x3c;var _0x553fb7=_0x333c3c[0x0][_0x9d13('0x6a')]+_0x333c3c[0x0][_0x9d13('0x86')];var _0x572984=(_0x333c3c[0x0]['predictiveIntervalAnsweredCalls']+_0x333c3c[0x0][_0x9d13('0x6c')]+_0x333c3c[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x333c3c[0x0][_0x9d13('0x72')];var _0x175942=_0x266a2e[_0x9d13('0x1c4')]/0x64;_0x266a2e[_0x9d13('0x70')]=_0x4b79c8[0x0][_0x9d13('0x1e3')]||0x0;_0x266a2e['predictiveIntervalHitRate']=_0x572984>0x0?_0x572984:0x1;return _0x238493[_0x9d13('0x1e4')](_0x51da28,_0x41f1e3,_0x553fb7,_0x572984,_0x175942);})[_0x9d13('0xb8')](function(_0x32b71f){return _0x5f2f6a(_0x32b71f);})[_0x9d13('0xb2')](function(_0x286ae4){return _0x150a8e(msgResponse(_0x9d13('0x1e1'),_0x9d13('0x144'),JSON['stringify'](_0x286ae4)));});}}else{return _0x150a8e(msgResponse(_0x9d13('0x1dd'),_0x9d13('0x144'),'check\x20failure'));}});};};Dialer[_0x9d13('0x18')][_0x9d13('0x1d7')]=function(_0x5289f1){var _0x277a17=this;return function(){var _0x24e29f=0x0;var _0x1c7135=Math[_0x9d13('0x1c8')](_0x5289f1[_0x9d13('0x75')]*0x3e8);if(_0x1c7135>0x0){_0x1c7135=_0x1c7135<0x64?0x64:_0x1c7135;loggerPredictive['info'](_0x5289f1[_0x9d13('0x40')],'one\x20call\x20every:',_0x1c7135,_0x9d13('0x49'));_0x5289f1[_0x9d13('0x92')]=setInterval(function(){_0x277a17[_0x9d13('0x92')](_0x5289f1);loggerPredictiveCalls['info'](_0x9d13('0x1e5'),_0x24e29f+=0x1);},_0x1c7135);}else{loggerPredictive[_0x9d13('0x7f')](_0x5289f1[_0x9d13('0x40')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0x9d13('0x1e6')]=function(_0x4cfef7,_0x4c3fbe){var _0x2a8d70=this;return function(_0x50610b){if(_[_0x9d13('0x47')](_0x50610b)){if(_['isNil'](_0x4c3fbe[_0x9d13('0xd6')])||!_0x4c3fbe[_0x9d13('0x1e7')]){if(_0x4cfef7[_0x9d13('0x155')]==='booked'){_0x4cfef7[_0x9d13('0x12c')]=_['isUndefined'](_0x4cfef7[_0x9d13('0x12c')])?!![]:_0x4cfef7[_0x9d13('0x12c')];var _0x14b1c9=uuid['v4']();_0x2a8d70['actions'][_0x14b1c9]=new Action(_0x4cfef7,_0x4c3fbe,_0x14b1c9);loggerBooked['info'](_0x9d13('0x1e8'),_0x14b1c9,_0x9d13('0x1e9'),JSON[_0x9d13('0x48')](_0x4cfef7[_0x9d13('0x12c')]),_0x9d13('0x1ea'),_0x4cfef7[_0x9d13('0x40')]);if(_0x4cfef7[_0x9d13('0x12c')]){_0x4cfef7['queueStatusComplete']=![];_0x2a8d70[_0x9d13('0x28')][_0x2a8d70[_0x9d13('0x24')][_0x14b1c9][_0x9d13('0xb5')]]=[];ami[_0x9d13('0x149')]({'actionid':_0x14b1c9,'action':'queuestatus','queue':_0x4cfef7[_0x9d13('0x40')]})[_0x9d13('0xb2')](function(){_0x2a8d70[_0x9d13('0xb4')](_0x4cfef7);_0x2a8d70['rescheduleContact']({'active':![],'ContactId':_0x2a8d70[_0x9d13('0x24')][_0x14b1c9][_0x9d13('0xd4')],'ListId':_0x2a8d70[_0x9d13('0x24')][_0x14b1c9][_0x9d13('0xd5')],'VoiceQueueId':_0x2a8d70[_0x9d13('0x24')][_0x14b1c9][_0x9d13('0xd7')]||undefined,'CampaignId':_0x2a8d70['actions'][_0x14b1c9]['CampaignId']||undefined})[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x1eb')));delete _0x2a8d70[_0x9d13('0x24')][_0x14b1c9];});}else{loggerBooked[_0x9d13('0x7f')](_0x9d13('0x1ec'),JSON[_0x9d13('0x48')](_0x4cfef7['queueStatusComplete']),_0x9d13('0x1ea'),_0x4cfef7[_0x9d13('0x40')]);_0x2a8d70[_0x9d13('0xb4')](_0x4cfef7);_0x2a8d70[_0x9d13('0xc0')]({'active':![],'ContactId':_0x2a8d70[_0x9d13('0x24')][_0x14b1c9][_0x9d13('0xd4')],'ListId':_0x2a8d70[_0x9d13('0x24')][_0x14b1c9]['ListId'],'VoiceQueueId':_0x2a8d70[_0x9d13('0x24')][_0x14b1c9]['VoiceQueueId']||undefined,'CampaignId':_0x2a8d70[_0x9d13('0x24')][_0x14b1c9][_0x9d13('0xd8')]||undefined})[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x1eb')));delete _0x2a8d70['actions'][_0x14b1c9];}}else{return _0x2a8d70[_0x9d13('0x1ed')](_0x4cfef7,_0x4c3fbe);}}else{if(getDiff(_0x4c3fbe['scheduledat'])<_0x4cfef7[_0x9d13('0x1ee')]*0x3c){if(_0x4c3fbe[_0x9d13('0x1ef')]&&!_0x4c3fbe[_0x9d13('0x1ef')][_0x9d13('0x1f0')]){_0x2a8d70[_0x9d13('0x1d')][_0x9d13('0x12f')](_0x4c3fbe['id'])[_0x9d13('0x1b')](function(){_0x2a8d70[_0x9d13('0xb4')](_0x4cfef7);});}else{_0x2a8d70[_0x9d13('0xc3')]({'active':![]},_0x4c3fbe['id'],0x1)[_0x9d13('0x1b')](function(){_0x2a8d70[_0x9d13('0xb4')](_0x4cfef7);});}}else{_0x4cfef7[_0x9d13('0x1f1')]+=0x1;_0x2a8d70[_0x9d13('0xb4')](_0x4cfef7);if(_0x4cfef7[_0x9d13('0x1f2')]){_0x2a8d70[_0x9d13('0xc0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4c3fbe[_0x9d13('0xd4')],'ListId':_0x4c3fbe[_0x9d13('0xd5')],'VoiceQueueId':_0x4c3fbe[_0x9d13('0xd7')]||undefined,'CampaignId':_0x4c3fbe[_0x9d13('0xd8')]||undefined})[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x1f3')));_0x2a8d70[_0x9d13('0xcb')](createObjHistory(_0x4cfef7,_0x4c3fbe,_0x9d13('0x1f4'),0x17,'RecallInQueue'))[_0x9d13('0xb2')](loggerCatch(_0x9d13('0x1f5')));}else{_0x2a8d70[_0x9d13('0xd2')](createObjHistory(_0x4cfef7,_0x4c3fbe,_0x9d13('0x1f6'),0x16,_0x9d13('0x1f7')),_0x9d13('0x1f8'),_0x9d13('0x1f9'));}}}}else{_0x4cfef7['outboundBlacklistCallsDay']+=0x1;_0x2a8d70[_0x9d13('0xd2')](createObjHistory(_0x4cfef7,_0x4c3fbe,'BLACKLIST',0xd,_0x9d13('0x1fa')),_0x9d13('0x1fb'),_0x9d13('0x1fc'));throw _0x9d13('0x1fd');}};};Dialer[_0x9d13('0x18')][_0x9d13('0x15b')]=function(_0x7978c){var _0x4d6f43=this;var _0x204b93=_0x7978c[_0x9d13('0x1fe')]-_0x7978c[_0x9d13('0x73')]-_0x7978c[_0x9d13('0xc6')];emitCampaignSummary(_0x7978c);if(_0x204b93>0x0){if(_0x204b93>this[_0x9d13('0x22')]){_0x204b93=this['maxNumberOriginate'];}_0x7978c[_0x9d13('0xc6')]+=_0x204b93;this[_0x9d13('0xc7')](_0x7978c['id'],_0x204b93,_0x7978c['dialOrderByScheduledAt'],_0x7978c)[_0x9d13('0xb8')](function(_0x556801){_0x7978c['temp']-=_0x204b93;_0x7978c[_0x9d13('0xc6')]=_0x7978c[_0x9d13('0xc6')]>0x0?_0x7978c[_0x9d13('0xc6')]:0x0;if(!checkContactEmpty(_0x556801)){_0x7978c[_0x9d13('0x3f')]=_0x9d13('0x9f');logger['info'](_0x9d13('0x1ff')+_0x7978c[_0x9d13('0x40')]);}else{_0x7978c[_0x9d13('0x73')]+=_0x556801['length'];_0x7978c[_0x9d13('0x3f')]=_0x9d13('0x200');for(var _0x65330c=0x0;_0x65330c<_0x556801['length'];_0x65330c+=0x1){_0x7978c['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x556801[_0x65330c])||_[_0x9d13('0xdf')](_0x556801[_0x65330c][_0x9d13('0x168')])||_['isNil'](_0x556801[_0x65330c]['Contact']['phone'])){_0x4d6f43[_0x9d13('0xd0')](_0x9d13('0x201'),_0x7978c,_0x556801[_0x65330c]);}else{_0x4d6f43['checkIsBlackListIvr'](_['pick'](_0x556801[_0x65330c],[_0x9d13('0xd8'),_0x9d13('0x202')]))['then'](_0x4d6f43['checkContactBlack'](_0x7978c,_0x556801[_0x65330c]))['catch'](_0x4d6f43[_0x9d13('0xcf')](_0x9d13('0x203'),_0x7978c));}}}})[_0x9d13('0xb2')](loggerGetContactDialer(_0x9d13('0x204'),_0x7978c,_0x204b93));}};Dialer['prototype'][_0x9d13('0x156')]=function(_0x142d06,_0x1e62be){var _0x2bb90a=this;var _0x12a2eb=[];var _0x68cfc7=_0x1e62be>=0x1?_0x1e62be:0x1;if(_0x142d06[_0x9d13('0x155')]==='booked'){_0x68cfc7=0x1;}var _0x271321=Math[_0x9d13('0x1c8')](_0x142d06[_0x9d13('0x50')]*_0x68cfc7)-_0x142d06[_0x9d13('0x73')]-_0x142d06[_0x9d13('0xc6')];emitVoiceQueueSummary(_0x142d06);if(_0x142d06[_0x9d13('0x205')]>0x0){var _0x31e109=_0x142d06['dialLimitQueue']-_0x142d06[_0x9d13('0x73')]-_0x142d06[_0x9d13('0x54')]-_0x142d06['temp']-_0x142d06['pTalking'];if(_0x271321>_0x31e109){_0x271321=_0x31e109;}}if(_0x271321>0x0){if(_0x142d06[_0x9d13('0x155')]===_0x9d13('0x9')){_0x271321=0x1;}if(_0x271321>this[_0x9d13('0x22')]){_0x271321=this[_0x9d13('0x22')];}_0x142d06[_0x9d13('0xc6')]+=_0x271321;for(var _0x59f5b2 in this['agents']){if(typeof this[_0x9d13('0x20')][_0x59f5b2]!==_0x9d13('0x99')){if(this[_0x9d13('0x20')][_0x59f5b2]['state']===_0x9d13('0x206')&&this[_0x9d13('0x20')][_0x59f5b2]['status']===_0x9d13('0x207')){_0x12a2eb[_0x9d13('0x12b')](this[_0x9d13('0x20')][_0x59f5b2]['id']);}}}this[_0x9d13('0xc5')](_0x142d06['id'],_0x12a2eb,_0x271321,_0x142d06[_0x9d13('0x208')],_0x142d06)[_0x9d13('0xb8')](function(_0x3664e0){_0x142d06[_0x9d13('0xc6')]-=_0x271321;_0x142d06[_0x9d13('0xc6')]=_0x142d06[_0x9d13('0xc6')]>0x0?_0x142d06['temp']:0x0;if(!checkContactEmpty(_0x3664e0)){_0x2bb90a['countReScheduled'](_0x142d06)['then'](sendMessageReschedule(_0x142d06))['catch'](loggerCatch(_0x9d13('0xb9')));}else{_0x142d06[_0x9d13('0x73')]+=_0x3664e0[_0x9d13('0x98')];_0x142d06['message']=_0x142d06[_0x9d13('0x155')]===_0x9d13('0x9')?_0x9d13('0x170'):'RUNNING';for(var _0x4e7843=0x0;_0x4e7843<_0x3664e0[_0x9d13('0x98')];_0x4e7843+=0x1){if(_[_0x9d13('0xdf')](_0x3664e0[_0x4e7843])||_[_0x9d13('0xdf')](_0x3664e0[_0x4e7843][_0x9d13('0x168')])||_[_0x9d13('0xdf')](_0x3664e0[_0x4e7843]['Contact'][_0x9d13('0x169')])){_0x2bb90a[_0x9d13('0xd0')](_0x9d13('0x201'),_0x142d06,_0x3664e0[_0x4e7843]);}else{_0x2bb90a[_0x9d13('0xba')](_['pick'](_0x3664e0[_0x4e7843],[_0x9d13('0xd7'),_0x9d13('0x202')]))[_0x9d13('0xb8')](_0x2bb90a[_0x9d13('0x1e6')](_0x142d06,_0x3664e0[_0x4e7843]))[_0x9d13('0xb2')](_0x2bb90a[_0x9d13('0xcf')](_0x9d13('0x201'),_0x142d06));}}}})['catch'](loggerGetContactDialer(_0x9d13('0x209'),_0x142d06,_0x271321));}};Dialer[_0x9d13('0x18')][_0x9d13('0x92')]=function(_0x4714dc){if(_0x4714dc[_0x9d13('0x205')]>0x0){var _0x318034=_0x4714dc['dialLimitQueue']-_0x4714dc[_0x9d13('0x73')]-_0x4714dc[_0x9d13('0x54')];if(_0x318034>0x0){this[_0x9d13('0x20a')](_0x4714dc);}else{loggerPredictiveCalls[_0x9d13('0x7f')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x4714dc);}};Dialer[_0x9d13('0x18')][_0x9d13('0x20a')]=function(_0x3bdd05){var _0x22a26e=this;var _0x28030e=[];_0x3bdd05[_0x9d13('0x73')]+=0x1;for(var _0x34f430 in this[_0x9d13('0x20')]){if(typeof this['agents'][_0x34f430]!==_0x9d13('0x99')){if(this[_0x9d13('0x20')][_0x34f430][_0x9d13('0xa8')]===_0x9d13('0x206')&&this[_0x9d13('0x20')][_0x34f430][_0x9d13('0xb0')]===_0x9d13('0x207')){_0x28030e[_0x9d13('0x12b')](this['agents'][_0x34f430]['id']);}}}this[_0x9d13('0xc5')](_0x3bdd05['id'],_0x28030e,0x1,_0x3bdd05['dialOrderByScheduledAt'],_0x3bdd05)['then'](function(_0x27048f){if(!checkContactEmpty(_0x27048f)){checkContactLowerLimitOriginate(_0x3bdd05,0x1,0x0);_0x22a26e[_0x9d13('0xb7')](_0x3bdd05)[_0x9d13('0xb8')](sendMessageReschedule(_0x3bdd05))[_0x9d13('0xb2')](loggerCatch('[countReScheduled]\x20'));}else{_0x3bdd05[_0x9d13('0x3f')]=_0x9d13('0x200');if(_[_0x9d13('0xdf')](_0x27048f[0x0])||_[_0x9d13('0xdf')](_0x27048f[0x0][_0x9d13('0x168')])||_['isNil'](_0x27048f[0x0][_0x9d13('0x168')][_0x9d13('0x169')])){_0x22a26e[_0x9d13('0xd0')](_0x9d13('0x201'),_0x3bdd05,_0x27048f[0x0]);}else{_0x22a26e[_0x9d13('0xba')](_[_0x9d13('0xd3')](_0x27048f[0x0],[_0x9d13('0xd7'),_0x9d13('0x202')]))[_0x9d13('0xb8')](_0x22a26e[_0x9d13('0x1e6')](_0x3bdd05,_0x27048f[0x0]))[_0x9d13('0xb2')](_0x22a26e[_0x9d13('0xcf')](_0x9d13('0x20b'),_0x3bdd05));}}})[_0x9d13('0xb2')](loggerGetContactDialer(_0x9d13('0x20c'),_0x3bdd05,0x1));emitVoiceQueueSummary(_0x3bdd05);};Dialer['prototype'][_0x9d13('0x20d')]=function(_0x5b975d,_0x2ef55f,_0x4125ae,_0x151391,_0x408a4d,_0x3ac399){loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x20e'));loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x20f'),_0x5b975d);loggerPredictive['info'](_0x9d13('0x210'),_0x2ef55f);loggerPredictive[_0x9d13('0x7f')]('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',_0x4125ae);loggerPredictive[_0x9d13('0x7f')]('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',_0x151391);loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x211'),_0x408a4d);loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x87'));return new BPromise(function(_0x4becce,_0x6bdc8a){if(_0x5b975d<=0x0||isNaN(_0x5b975d)){return _0x6bdc8a(msgResponse(_0x9d13('0x212'),_0x9d13('0x194'),_0x9d13('0x213')+_0x5b975d));}if(_0x4125ae<=0x0||isNaN(_0x4125ae)){return _0x6bdc8a(msgResponse(_0x9d13('0x212'),_0x9d13('0x194'),'Ts\x20=\x20'+_0x4125ae));}if(_0x151391<=0x0||isNaN(_0x151391)){return _0x6bdc8a(msgResponse('[abandonmentRate]','Error',_0x9d13('0x214')+_0x151391));}if(_0x2ef55f<=0x0||isNaN(_0x2ef55f)){return _0x6bdc8a(msgResponse(_0x9d13('0x212'),_0x9d13('0x194'),_0x9d13('0x215')+_0x2ef55f));}if(_0x408a4d<=0x0||isNaN(_0x408a4d)){return _0x6bdc8a(msgResponse('[abandonmentRate]','Error',_0x9d13('0x216')+_0x408a4d));}_0x3ac399=_0x3ac399||0x0;var _0x4e683a=0x1/_0x4125ae;var _0x56f38c=0x0;var _0x23af37=0x0;var _0x4b25d6=0x0;var _0x4806b7=0x0;for(var _0x422ed1=0x0;_0x4b25d6<_0x408a4d;_0x422ed1+=0x1){_0x23af37=_0x422ed1/_0x2ef55f;_0x56f38c=(_0x151391*_0x23af37+_0x3ac399)/_0x4e683a;_0x4b25d6=erlangb(_0x56f38c,_0x5b975d);_0x4806b7=_0x56f38c/_0x5b975d*(0x1-erlangb(_0x56f38c,_0x5b975d));}return _0x4becce({'erlangCalls':_0x422ed1,'erlangCallToSecond':_0x2ef55f/_0x422ed1,'erlangAbandonmentRate':_0x4b25d6,'erlangBusyFactor':_0x4806b7});});};Dialer['prototype'][_0x9d13('0x1e4')]=function(_0x4db09b,_0x57eda8,_0x671680,_0x33594b,_0x2b48cc,_0x344783){loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x217'));loggerPredictive[_0x9d13('0x7f')]('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',_0x4db09b);loggerPredictive['info'](_0x9d13('0x210'),_0x57eda8);loggerPredictive[_0x9d13('0x7f')](_0x9d13('0x218'),_0x671680);loggerPredictive['info'](_0x9d13('0x219'),_0x33594b);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2b48cc);loggerPredictive[_0x9d13('0x7f')]('---------------------------');return new BPromise(function(_0x3bdaa7,_0x12b2dd){if(_0x4db09b<=0x0||isNaN(_0x4db09b)){return _0x12b2dd(msgResponse(_0x9d13('0x21a'),_0x9d13('0x194'),_0x9d13('0x213')+_0x4db09b));}if(_0x671680<=0x0||isNaN(_0x671680)){return _0x12b2dd(msgResponse(_0x9d13('0x21a'),_0x9d13('0x194'),_0x9d13('0x21b')+_0x671680));}if(_0x33594b<=0x0||isNaN(_0x33594b)){return _0x12b2dd(msgResponse(_0x9d13('0x21a'),_0x9d13('0x194'),_0x9d13('0x214')+_0x33594b));}if(_0x57eda8<=0x0||isNaN(_0x57eda8)){return _0x12b2dd(msgResponse('[busyFactor]',_0x9d13('0x194'),_0x9d13('0x215')+_0x57eda8));}if(_0x2b48cc<=0x0||isNaN(_0x2b48cc)){return _0x12b2dd(msgResponse('[busyFactor]',_0x9d13('0x194'),_0x9d13('0x21c')+_0x2b48cc));}_0x344783=_0x344783||0x0;var _0x5142a6=0x1/_0x671680;var _0x469538=0x0;var _0x53b850=0x0;var _0x545c1f=0x0;var _0x19afd5=0x0;for(var _0x3975b3=0x0;_0x19afd5<_0x2b48cc;_0x3975b3+=0x1){_0x53b850=_0x3975b3/_0x57eda8;_0x469538=(_0x33594b*_0x53b850+_0x344783)/_0x5142a6;_0x545c1f=erlangb(_0x469538,_0x4db09b);_0x19afd5=_0x469538/_0x4db09b*(0x1-erlangb(_0x469538,_0x4db09b));}return _0x3bdaa7({'erlangCalls':_0x3975b3,'erlangCallToSecond':_0x57eda8/_0x3975b3,'erlangAbandonmentRate':_0x545c1f,'erlangBusyFactor':_0x19afd5});});};module['exports']=Dialer; \ No newline at end of file +var _0x7dc2=['---------\x20ErlangB\x20---------','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','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','undefined','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','pTalking','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','loopClearZombieChannels','uniqueId','[uniqueid]','clearZombieChannels','[actions]','Action','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','resolve','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','then','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','notFound','saveInDb','merge','pick','ListId','VoiceQueueId','CampaignId','[emptyContact]','Success','isTrunkReachable','SIP/%s','status','reachable','uniqueid','isNil','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','MACHINE','Machine','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countbusyretry','countcongestionretry','countnoanswerretry','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','cause-txt','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','queueCallerAbandonCreateState','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','strategy','locked','paused','stateinterface','queueBooked','push','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','interval','content','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','predictive','booked','Queue','method\x20not\x20recognized','handleIvr','dialGlobalInterval','dialTimezone','syncCampaigns','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','actionOriginate','voiceQueue\x20is\x20undefine','phone','Contact','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','ACTIVE','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','updatedAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','createStateFinal','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','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','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','emptyContact','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[countReScheduled]\x20','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\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','bluebird','uuid','moment','md5','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','./action','./history','./final','./agentComplete','./hangup','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','ivrOriginated','agentconnect','bind','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','Interval','Intervals','isEmpty','Error','stringify','diff','seconds','emit','type','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x7dc2,0x19d));var _0x27dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7dc2[_0x20a584];return _0x4b41a8;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x27dc('0x0'));var uuid=require(_0x27dc('0x1'));var moment=require(_0x27dc('0x2'));var rr=require('rr');var md5=require(_0x27dc('0x3'));var Redis=require('ioredis');var ut=require(_0x27dc('0x4'));var config=require(_0x27dc('0x5'));var logger=require('../../../config/logger')(_0x27dc('0x6'));var loggerBooked=require(_0x27dc('0x7'))('booked');var loggerPredictive=require(_0x27dc('0x7'))('predictive');var loggerPredictiveCalls=require(_0x27dc('0x7'))(_0x27dc('0x8'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x27dc('0x9'));var ami=require(_0x27dc('0xa'));config[_0x27dc('0xb')]=_[_0x27dc('0xc')](config['redis'],{'host':_0x27dc('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x27dc('0xb')]));var cmHopper=require(_0x27dc('0xe'));var cmHopperHistory=require(_0x27dc('0xf'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x27dc('0x10'));var History=require(_0x27dc('0x11'));var Final=require(_0x27dc('0x12'));var AgentComplete=require(_0x27dc('0x13'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x27dc('0x14'));var ipAgi=process['env'][_0x27dc('0x15')]||'127.0.0.1';var strategy={'rrmemory':_0x27dc('0x16'),'roundrobin':_0x27dc('0x17')};var Sequence=function(){};Sequence[_0x27dc('0x18')][_0x27dc('0x19')]=function(_0x5c4d00){this[_0x27dc('0x1a')]=this[_0x27dc('0x1a')]?this[_0x27dc('0x1a')][_0x27dc('0x1b')](_0x5c4d00):_0x5c4d00();};function Dialer(_0x3afdfd,_0x5d0c9d){this[_0x27dc('0x1c')]=new Sequence();this[_0x27dc('0x1d')]=_0x5d0c9d;this[_0x27dc('0x1e')]=_0x3afdfd[_0x27dc('0x1e')];this['campaigns']=_0x3afdfd[_0x27dc('0x1f')];this[_0x27dc('0x20')]=_0x3afdfd[_0x27dc('0x20')];this[_0x27dc('0x21')]=_0x3afdfd[_0x27dc('0x21')];this[_0x27dc('0x22')]=config[_0x27dc('0x22')]||0x2;this[_0x27dc('0x23')]={};this[_0x27dc('0x24')]={};this[_0x27dc('0x25')]={};this['uniqueId']={};this[_0x27dc('0x26')]={};this[_0x27dc('0x27')]={};this['startProgressive']={};this[_0x27dc('0x28')]={};this['queueBooked']={};this['queueBookedRR']={};ami['on'](_0x27dc('0x29'),this['syncAgentConnect'][_0x27dc('0x2a')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x27dc('0x2a')](this));ami['on']('originateresponse',this[_0x27dc('0x2b')]['bind'](this));ami['on'](_0x27dc('0x2c'),this[_0x27dc('0x2d')][_0x27dc('0x2a')](this));ami['on'](_0x27dc('0x2e'),this['syncQueueSummary'][_0x27dc('0x2a')](this));ami['on']('hangup',this['syncHangup'][_0x27dc('0x2a')](this));ami['on'](_0x27dc('0x2f'),this['syncNewExten'][_0x27dc('0x2a')](this));ami['on'](_0x27dc('0x30'),this[_0x27dc('0x31')][_0x27dc('0x2a')](this));ami['on'](_0x27dc('0x32'),this[_0x27dc('0x33')][_0x27dc('0x2a')](this));ami['on'](_0x27dc('0x34'),this[_0x27dc('0x35')][_0x27dc('0x2a')](this));this[_0x27dc('0x36')]();this['loopClearZombieChannels']();}function isNotNull(_0xdaf7cb){return _0xdaf7cb!==null&&!_[_0x27dc('0x37')](_0xdaf7cb);}function checkIsLoggedIn(_0x4a2fe6,_0x14a8a1){return function(){if(_0x14a8a1<=0x0){_0x4a2fe6[_0x27dc('0x38')]=_0x27dc('0x39');throw _0x4a2fe6[_0x27dc('0x3a')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x3edb8c){return _0x3edb8c;}function checkIsActive(_0x291ec8,_0x392112){return function(){if(!isActive(_0x392112)){_0x291ec8['message']=_0x27dc('0x3b');throw _0x291ec8[_0x27dc('0x3a')]+_0x27dc('0x3c');}};}function checkInterval(_0x331074){return function(){if(!isNotNull(_0x331074['Interval'])){_0x331074[_0x27dc('0x38')]=_0x27dc('0x3d');throw _0x331074[_0x27dc('0x3a')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x331074[_0x27dc('0x3e')][_0x27dc('0x3f')])){_0x331074[_0x27dc('0x38')]=_0x27dc('0x3d');throw _0x331074[_0x27dc('0x3a')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x27dc('0x40')](_0x331074[_0x27dc('0x3e')][_0x27dc('0x3f')]))){_0x331074[_0x27dc('0x38')]=_0x27dc('0x3d');throw _0x331074['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x2d6e00,_0x35fbda,_0x2f0228){return{'action':_0x2d6e00,'response':_0x35fbda,'message':_0x2f0228,'stack':_0x2f0228};}function myreject(_0x11d738){return function(_0x52973a){return _0x11d738(msgResponse('[ifTime][Action]',_0x27dc('0x41'),JSON[_0x27dc('0x42')](_0x52973a)));};}function getSeconds(_0x9b49b5,_0x55ac93){var _0x1059d1=moment(_0x9b49b5)['milliseconds'](0x0);var _0x40a204=moment(_0x55ac93)['milliseconds'](0x0);return _0x1059d1[_0x27dc('0x43')](_0x40a204,_0x27dc('0x44'));}function emit(_0xa84c4f,_0x467094,_0x3d9865){io['to'](_0xa84c4f)[_0x27dc('0x45')](_0x467094,_0x3d9865);}function emitVoiceQueueSummary(_0x1f72fc){if(_0x1f72fc[_0x27dc('0x46')]==='outbound'){var _0x3f017b={'id':_0x1f72fc['id'],'name':_0x1f72fc[_0x27dc('0x3a')],'strategy':_0x1f72fc['strategy'],'answered':_0x1f72fc[_0x27dc('0x47')],'available':_0x1f72fc[_0x27dc('0x48')],'loggedIn':_0x1f72fc[_0x27dc('0x49')],'pTalking':_0x1f72fc['pTalking'],'sumBillable':_0x1f72fc[_0x27dc('0x4a')],'sumDuration':_0x1f72fc[_0x27dc('0x4b')],'sumHoldTime':_0x1f72fc[_0x27dc('0x4c')]||0x0,'talking':_0x1f72fc[_0x27dc('0x4d')],'total':_0x1f72fc['total'],'type':_0x1f72fc[_0x27dc('0x46')],'unmanaged':_0x1f72fc[_0x27dc('0x4e')],'abandoned':_0x1f72fc[_0x27dc('0x4f')],'waiting':_0x1f72fc[_0x27dc('0x50')],'loggedInDb':_0x1f72fc[_0x27dc('0x51')],'dialActive':_0x1f72fc[_0x27dc('0x52')],'dialMethod':_0x1f72fc['dialMethod'],'dialOriginateCallerIdName':_0x1f72fc['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1f72fc['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x1f72fc[_0x27dc('0x53')],'dialPrefix':_0x1f72fc[_0x27dc('0x54')],'outboundAnswerAgiCallsDay':_0x1f72fc[_0x27dc('0x55')],'outboundAnswerCallsDay':_0x1f72fc[_0x27dc('0x56')],'outboundBlacklistCallsDay':_0x1f72fc['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x1f72fc['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x1f72fc[_0x27dc('0x57')],'outboundDropCallsDayACS':_0x1f72fc['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1f72fc[_0x27dc('0x58')],'outboundDropCallsDayTimeout':_0x1f72fc[_0x27dc('0x59')],'outboundNoAnswerCallsDay':_0x1f72fc[_0x27dc('0x5a')],'outboundNoSuchCallsDay':_0x1f72fc['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x1f72fc[_0x27dc('0x5b')],'outboundReCallsDay':_0x1f72fc[_0x27dc('0x5c')],'outboundRejectCallsDay':_0x1f72fc[_0x27dc('0x5d')],'outboundUnknownCallsDay':_0x1f72fc[_0x27dc('0x5e')],'predictiveIntervalAnsweredCalls':_0x1f72fc['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x1f72fc[_0x27dc('0x5f')],'predictiveIntervalAvgTalktime':_0x1f72fc[_0x27dc('0x60')],'predictiveIntervalDroppedCallsCallersExit':_0x1f72fc['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x1f72fc[_0x27dc('0x61')],'predictiveIntervalErlangCalls':_0x1f72fc[_0x27dc('0x62')],'predictiveIntervalErlangCallsDroppedCalls':_0x1f72fc[_0x27dc('0x63')],'predictiveIntervalHitRate':_0x1f72fc[_0x27dc('0x64')],'predictiveIntervalMultiplicativeFactor':_0x1f72fc[_0x27dc('0x65')],'predictiveIntervalPauses':_0x1f72fc[_0x27dc('0x66')],'predictiveIntervalAvailable':_0x1f72fc[_0x27dc('0x67')],'predictiveIntervalTotalCalls':_0x1f72fc[_0x27dc('0x68')],'message':_0x1f72fc[_0x27dc('0x38')],'originated':_0x1f72fc['originated'],'erlangCalls':_0x1f72fc[_0x27dc('0x69')],'erlangCallToSecond':_0x1f72fc['erlangCallToSecond'],'erlangAbandonmentRate':_0x1f72fc[_0x27dc('0x6a')],'erlangBusyFactor':_0x1f72fc[_0x27dc('0x6b')],'startPredictive':_0x1f72fc[_0x27dc('0x27')],'startProgressive':_0x1f72fc[_0x27dc('0x6c')]};if(_0x1f72fc[_0x27dc('0x6d')]){_0x3f017b['Trunk']={'id':_0x1f72fc[_0x27dc('0x6d')]['id'],'name':_0x1f72fc[_0x27dc('0x6d')][_0x27dc('0x3a')],'active':_0x1f72fc[_0x27dc('0x6d')][_0x27dc('0x6e')],'callerid':_0x1f72fc[_0x27dc('0x6d')][_0x27dc('0x6f')]};}if(_0x1f72fc[_0x27dc('0x3e')]){_0x3f017b[_0x27dc('0x3e')]={'id':_0x1f72fc['Interval']['id'],'name':_0x1f72fc['Interval'][_0x27dc('0x3a')]};}var _0x37517d=md5(JSON['stringify'](_0x3f017b));if(_0x1f72fc[_0x27dc('0x3')]!==_0x37517d){_0x1f72fc[_0x27dc('0x3')]=_0x37517d;emit(util['format']('voice:queue:%s',_0x3f017b['name']),_0x27dc('0x70'),_0x3f017b);}}}function emitCampaignSummary(_0x5872fc){if(_0x5872fc['type']===_0x27dc('0x71')){emit(util[_0x27dc('0x72')](_0x27dc('0x73'),_0x5872fc['name']),_0x27dc('0x74'),_0x5872fc);}}function checkGetDataPredictive(_0x15f2fb){if(isNotNull(_0x15f2fb)&&!_['isEmpty'](_0x15f2fb)){loggerPredictive[_0x27dc('0x75')](_0x27dc('0x76'));loggerPredictive['info'](_0x27dc('0x77'),_0x15f2fb[_0x27dc('0x68')]);loggerPredictive[_0x27dc('0x75')](_0x27dc('0x78'),_0x15f2fb[_0x27dc('0x79')]);loggerPredictive[_0x27dc('0x75')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x15f2fb[_0x27dc('0x61')]);loggerPredictive[_0x27dc('0x75')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x15f2fb[_0x27dc('0x7a')]);loggerPredictive[_0x27dc('0x75')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x15f2fb[_0x27dc('0x5f')]);loggerPredictive['info'](_0x27dc('0x7b'),_0x15f2fb[_0x27dc('0x60')]);loggerPredictive['info'](_0x27dc('0x7c'));if(_0x15f2fb[_0x27dc('0x68')]>0x0){if(!_[_0x27dc('0x37')](_0x15f2fb[_0x27dc('0x60')])&&_0x15f2fb['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info'](_0x27dc('0x7d'));if(!_[_0x27dc('0x37')](_0x15f2fb['predictiveIntervalAvgHoldtime'])&&_0x15f2fb[_0x27dc('0x5f')]>0x0){return!![];}loggerPredictive['info'](_0x27dc('0x7e'));}else{loggerPredictive[_0x27dc('0x75')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x27dc('0x75')](_0x27dc('0x7f'));}return![];}function mergeDataErlangB(_0x2af980){return function(_0x3428db){loggerPredictive['info'](_0x27dc('0x80'));loggerPredictive[_0x27dc('0x75')](_0x27dc('0x81'),_0x3428db[_0x27dc('0x69')]);loggerPredictive[_0x27dc('0x75')](_0x27dc('0x82'),_0x3428db[_0x27dc('0x83')]);loggerPredictive[_0x27dc('0x75')](_0x27dc('0x84'),_0x3428db[_0x27dc('0x6a')]);loggerPredictive[_0x27dc('0x75')](_0x27dc('0x85'),_0x3428db[_0x27dc('0x6b')]);loggerPredictive[_0x27dc('0x75')](_0x27dc('0x84'),_0x3428db[_0x27dc('0x6a')]);loggerPredictive['info'](_0x27dc('0x7c'));_['merge'](_0x2af980,_0x3428db);};}function getDiff(_0x1b3506){var _0x193121=moment()['milliseconds'](0x0);var _0x250207=moment(_0x1b3506)['milliseconds'](0x0);return _0x193121['diff'](_0x250207,_0x27dc('0x44'));}function ifInterval(_0x313620,_0x3653e5){if(_[_0x27dc('0x37')](_0x3653e5)){return![];}return getDiff(_0x3653e5)<_0x313620*0x3c;}function freeVariablesPredictive(_0x1ecae8){if(isNotNull(_0x1ecae8)){if(!_['isUndefined'](_0x1ecae8[_0x27dc('0x6c')])){_0x1ecae8[_0x27dc('0x6c')]=undefined;loggerPredictive[_0x27dc('0x75')](_0x1ecae8[_0x27dc('0x3a')],_0x27dc('0x86'));}if(!_[_0x27dc('0x37')](_0x1ecae8[_0x27dc('0x27')])){_0x1ecae8['startPredictive']=undefined;loggerPredictive[_0x27dc('0x75')](_0x1ecae8[_0x27dc('0x3a')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x27dc('0x37')](_0x1ecae8[_0x27dc('0x87')])){clearInterval(_0x1ecae8[_0x27dc('0x87')]);_0x1ecae8[_0x27dc('0x87')]=undefined;loggerPredictive[_0x27dc('0x75')](_0x1ecae8['name'],_0x27dc('0x88'));}}}function erlangb(_0x913268,_0x43f827){if(_0x43f827===0x0){return 0x0;}var _0x431fbe=0x1;for(var _0x307d4c=0x1;_0x307d4c<=_0x43f827;_0x307d4c+=0x1){_0x431fbe=0x1+_0x431fbe*_0x307d4c/_0x913268;}return 0x1/_0x431fbe;}function isVoiceQueueOutbound(_0x27ece3){return _0x27ece3===_0x27dc('0x89');}function isNotPreview(_0x4b220e){return _0x4b220e!==_0x27dc('0x1d');}function isCampaignIvr(_0x1cf296){return _0x1cf296===_0x27dc('0x71');}function getCallerId(_0x3aea3e,_0xe37871,_0x2face6){if(!_[_0x27dc('0x37')](_0x2face6)&&typeof _0x2face6===_0x27dc('0x8a')&&!_[_0x27dc('0x40')](_0x2face6)){if(!_[_0x27dc('0x37')](_0xe37871)&&typeof _0xe37871===_0x27dc('0x8a')&&!_['isEmpty'](_0xe37871)){return util[_0x27dc('0x72')](_0x27dc('0x8b'),_0xe37871,_0x2face6);}return util[_0x27dc('0x72')]('\x22%s\x22\x20<%s>',_0x2face6,_0x2face6);}if(!_[_0x27dc('0x37')](_0x3aea3e)&&typeof _0x3aea3e===_0x27dc('0x8a')&&!_[_0x27dc('0x40')](_0x3aea3e)){return _0x3aea3e;}return _0x27dc('0x8c');}function loggerCatchQueueSummary(_0x303452,_0x18a0fa){return function(_0x44177b){freeVariablesPredictive(_0x18a0fa);emitVoiceQueueSummary(_0x18a0fa);emitCampaignSummary(_0x18a0fa);loggerSyncQueueSummary[_0x27dc('0x8d')](_0x303452,util[_0x27dc('0x8e')](_0x44177b,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1d818f,_0x207ab6){return function(_0x290e28){loggerPredictive[_0x27dc('0x8d')](_0x207ab6[_0x27dc('0x3a')],_0x1d818f);loggerPredictive[_0x27dc('0x8d')](_0x290e28[_0x27dc('0x8f')]);freeVariablesPredictive(_0x207ab6);};}function loggerCatch(_0x2220f6){return function(_0x121fc5){logger[_0x27dc('0x8d')](_0x2220f6,util[_0x27dc('0x8e')](_0x121fc5,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2c241b){return _0x2c241b&&!_[_0x27dc('0x37')](_0x2c241b)&&_0x2c241b['length']>0x0;}function decremetOriginate(_0x4e6cc0){if(!_[_0x27dc('0x37')](_0x4e6cc0)&&_0x4e6cc0!==null){if(typeof _0x4e6cc0['originated']!==_0x27dc('0x90')){if(_0x4e6cc0[_0x27dc('0x91')]>0x0){_0x4e6cc0['originated']-=0x1;}else{logger['error'](_0x27dc('0x92'));}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x211b64,_0x41f0d1,_0x2cfd09){if(_0x41f0d1>_0x2cfd09){for(var _0x2c923e=0x0;_0x2c923e<_0x41f0d1-_0x2cfd09;_0x2c923e+=0x1){decremetOriginate(_0x211b64);}}}function loggerGetContactDialer(_0x5c885b,_0x540b5b,_0x1d1cde){return function(_0x1bc831){checkContactLowerLimitOriginate(_0x540b5b,_0x1d1cde,0x0);logger['error'](_0x5c885b,util['inspect'](_0x1bc831,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x31559c){return function(_0x133b36){if(isNotNull(_0x133b36)&&isNotNull(_0x133b36[0x0])){if(_0x133b36[0x0]['contactsRescheduled']>0x0){_0x31559c[_0x27dc('0x38')]=_0x27dc('0x93');logger['info'](_0x27dc('0x94')+_0x31559c[_0x27dc('0x3a')],_0x133b36[0x0][_0x27dc('0x95')],'contacts');}else{_0x31559c['message']=_0x27dc('0x96');logger['info'](_0x27dc('0x97')+_0x31559c['name']);}}};}function notSendMessagesQueue(_0x4c3344){if(_0x4c3344['sendMessageOneNotActive']){freeVariablesPredictive(_0x4c3344);if(_0x4c3344[_0x27dc('0x91')]===0x0&&_0x4c3344[_0x27dc('0x4d')]===0x0&&_0x4c3344['waiting']===0x0&&(_0x4c3344[_0x27dc('0x98')]||0x0)===0x0){_0x4c3344[_0x27dc('0x99')]=![];_0x4c3344[_0x27dc('0x48')]=0x0;_0x4c3344[_0x27dc('0x38')]=_0x27dc('0x3b');loggerSyncQueueSummary[_0x27dc('0x8d')](_0x27dc('0x9a'),_0x4c3344[_0x27dc('0x3a')],_0x27dc('0x9b'));}else{_0x4c3344['message']=_0x27dc('0x9c');loggerSyncQueueSummary['error'](_0x27dc('0x9a'),_0x4c3344[_0x27dc('0x3a')],_0x27dc('0x9d'));}emitVoiceQueueSummary(_0x4c3344);}}function notSendMessagesCampaign(_0x4e9858){if(_0x4e9858[_0x27dc('0x99')]){if(_0x4e9858['originated']===0x0){_0x4e9858[_0x27dc('0x99')]=![];_0x4e9858[_0x27dc('0x38')]=_0x27dc('0x3b');loggerSyncQueueSummary['error'](_0x27dc('0x9e'),_0x4e9858[_0x27dc('0x3a')],'is\x20not\x20active');}else{_0x4e9858[_0x27dc('0x38')]=_0x27dc('0x9c');loggerSyncQueueSummary[_0x27dc('0x8d')](_0x27dc('0x9e'),_0x4e9858[_0x27dc('0x3a')],'is\x20disactive');}emitCampaignSummary(_0x4e9858);}}function createObjHistory(_0x30a9b3,_0x5a797b,_0x4d5a91,_0x2afa44,_0x1b03f3){_0x30a9b3[_0x27dc('0x38')]=_0x4d5a91;var _0x1efd7=new Action(_0x30a9b3,_0x5a797b);var _0x4f402d=new History(_0x1efd7);_0x4f402d[_0x27dc('0x9f')]=_0x2afa44;_0x4f402d[_0x27dc('0xa0')]=_0x1b03f3;_0x4f402d[_0x27dc('0xa1')]=_0x1efd7['starttime'];return _0x4f402d;}Dialer[_0x27dc('0x18')][_0x27dc('0xa2')]=function(){var _0xee8f18=this;setInterval(function(){_0xee8f18['clearZombieChannels'](_0xee8f18[_0x27dc('0xa3')],_0x27dc('0xa4'));_0xee8f18[_0x27dc('0xa5')](_0xee8f18[_0x27dc('0x24')],_0x27dc('0xa6'));},0x32c8);};Dialer[_0x27dc('0x18')]['clearZombieChannels']=function(_0x5e11c1,_0x38b7fb){var _0x1480c9=this;for(var _0x5d0d8b in _0x5e11c1){if(typeof _0x5e11c1[_0x5d0d8b]!==_0x27dc('0x90')){this[_0x27dc('0x1c')][_0x27dc('0x19')](function(){if(!_['isNil'](_0x5e11c1[_0x5d0d8b])){return ami[_0x27dc('0xa7')]({'action':'status','channel':_0x5e11c1[_0x5d0d8b]['channel']})[_0x27dc('0xa8')](function(_0x1da4e6){if(_0x1da4e6['message']===_0x27dc('0xa9')){setTimeout(function(){if(_0x5e11c1[_0x5d0d8b]&&_0x5e11c1[_0x5d0d8b]['type']!=='ivr'){_0x1480c9[_0x27dc('0xaa')](_0x1480c9[_0x27dc('0x1e')][_0x5e11c1[_0x5d0d8b][_0x27dc('0xab')]]);logger['error'](_0x27dc('0xac'),_0x38b7fb,_0x5d0d8b,_0x5e11c1[_0x5d0d8b][_0x27dc('0xab')]);delete _0x5e11c1[_0x5d0d8b];}if(_0x5e11c1[_0x5d0d8b]&&_0x5e11c1[_0x5d0d8b][_0x27dc('0x46')]===_0x27dc('0x71')){_0x1480c9['updateOriginated'](_0x1480c9['campaigns'][_0x5e11c1[_0x5d0d8b][_0x27dc('0xab')]]);logger[_0x27dc('0x8d')]('[Dialer][checkChannel][ivr]',_0x38b7fb,_0x5d0d8b,_0x5e11c1[_0x5d0d8b][_0x27dc('0xab')]);delete _0x5e11c1[_0x5d0d8b];}},0x2328);}});}});}}};Dialer['prototype'][_0x27dc('0xad')]=function(_0x40aed8){return BPromise[_0x27dc('0xae')]()['then'](cmHopper[_0x27dc('0xad')](_0x40aed8))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x27dc('0x18')][_0x27dc('0xaf')]=function(_0x700cae){return BPromise[_0x27dc('0xae')]()['then'](cmHopperBlack[_0x27dc('0xaf')](_0x700cae))[_0x27dc('0xa8')](loggerCatch(_0x27dc('0xb0')));};Dialer[_0x27dc('0x18')][_0x27dc('0xb1')]=function(_0x2631c0){return BPromise[_0x27dc('0xae')]()[_0x27dc('0xb2')](cmHopperBlack[_0x27dc('0xb1')](_0x2631c0))['catch'](loggerCatch(_0x27dc('0xb3')));};Dialer[_0x27dc('0x18')][_0x27dc('0xb4')]=function(_0x2705ea){return BPromise[_0x27dc('0xae')]()[_0x27dc('0xb2')](cmHopperHistory[_0x27dc('0xb5')](_0x2705ea))['catch'](loggerCatch(_0x27dc('0xb6')));};Dialer[_0x27dc('0x18')]['rescheduleContact']=function(_0x5543d0){return BPromise[_0x27dc('0xae')]()['then'](cmHopper[_0x27dc('0xb7')](_0x5543d0))[_0x27dc('0xa8')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x27dc('0x18')][_0x27dc('0xb8')]=function(_0x2a7b9c,_0x478a30,_0x19390d){return BPromise[_0x27dc('0xae')]()[_0x27dc('0xb2')](cmHopper['unlockContact'](_0x2a7b9c,_0x478a30,_0x19390d))['catch'](loggerCatch(_0x27dc('0xb9')));};Dialer['prototype'][_0x27dc('0xba')]=function(_0xd41c28,_0x4def88,_0x11c76a,_0x2a3709,_0x5a7b10){return BPromise[_0x27dc('0xae')]()[_0x27dc('0xb2')](cmHopper[_0x27dc('0xba')](_0xd41c28,_0x4def88,_0x11c76a,_0x2a3709))['catch'](function(_0x15bd8c){_0x5a7b10[_0x27dc('0xbb')]-=_0x11c76a;_0x5a7b10[_0x27dc('0xbb')]=_0x5a7b10[_0x27dc('0xbb')]>0x0?_0x5a7b10[_0x27dc('0xbb')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x15bd8c);});};Dialer[_0x27dc('0x18')][_0x27dc('0xbc')]=function(_0x1af032,_0x23ae65,_0x4c7a1e,_0x4d9e12){return BPromise[_0x27dc('0xae')]()[_0x27dc('0xb2')](cmHopper['getContactDialerIvr'](_0x1af032,_0x23ae65,_0x4c7a1e))[_0x27dc('0xa8')](function(_0x513151){_0x4d9e12['temp']-=_0x23ae65;_0x4d9e12[_0x27dc('0xbb')]=_0x4d9e12[_0x27dc('0xbb')]>0x0?_0x4d9e12[_0x27dc('0xbb')]:0x0;loggerCatch(_0x27dc('0xbd'))(_0x513151);});};Dialer[_0x27dc('0x18')][_0x27dc('0xbe')]=function(_0x545594){return BPromise[_0x27dc('0xae')]()[_0x27dc('0xb2')](voiceQueueRt[_0x27dc('0xbe')](_0x545594))[_0x27dc('0xa8')](loggerCatch(_0x27dc('0xbf')));};Dialer[_0x27dc('0x18')][_0x27dc('0xc0')]=function(_0x3c947f){return BPromise[_0x27dc('0xae')]()[_0x27dc('0xb2')](cmHopper['moveContactManagedDialer'](_0x3c947f))[_0x27dc('0xa8')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0x27dc('0xc1')]=function(_0x8eb58){return BPromise[_0x27dc('0xae')]()[_0x27dc('0xb2')](cmHopperHistory[_0x27dc('0xc1')](_0x8eb58))[_0x27dc('0xa8')](loggerCatch(_0x27dc('0xc2')));};Dialer['prototype'][_0x27dc('0xaa')]=function(_0x311693){if(!_[_0x27dc('0x37')](_0x311693)&&_0x311693!==null){if(typeof _0x311693[_0x27dc('0x91')]!==_0x27dc('0x90')){if(_0x311693[_0x27dc('0x91')]>0x0){_0x311693[_0x27dc('0x91')]-=0x1;}else{logger[_0x27dc('0x8d')](_0x27dc('0xc3'));}}}else{logger[_0x27dc('0x8d')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x27dc('0x18')][_0x27dc('0xc4')]=function(_0x315ab3,_0xbb3183){var _0x500938=this;return function(_0x490d0f){_0x500938[_0x27dc('0xaa')](_0xbb3183);logger['error'](_0x315ab3,util[_0x27dc('0x8e')](_0x490d0f,{'showHidden':![],'depth':null}));};};Dialer[_0x27dc('0x18')]['emptyContact']=function(_0x4211f2,_0x9fde3d,_0x54f875){var _0x2a4921={'state':0x19,'statedesc':_0x27dc('0xc5')};this[_0x27dc('0xaa')](_0x9fde3d);this[_0x27dc('0xc6')](_[_0x27dc('0xc7')](_0x2a4921,_[_0x27dc('0xc8')](_0x54f875,['ContactId',_0x27dc('0xc9'),'UserId',_0x27dc('0xca'),_0x27dc('0xcb')])),'[emptyContact][createHistory]',_0x27dc('0xcc'));logger[_0x27dc('0x8d')](_0x4211f2);};Dialer['prototype']['isSuccess']=function(_0x1d451d){return _0x1d451d===_0x27dc('0xcd');};Dialer['prototype'][_0x27dc('0xce')]=function(_0x5180a6){return!_['isUndefined'](_0x5180a6)&&_0x5180a6&&!_[_0x27dc('0x37')](_0x5180a6['name'])&&!_[_0x27dc('0x37')](_0x5180a6[_0x27dc('0x6e')])&&_0x5180a6[_0x27dc('0x6e')]&&(this[_0x27dc('0x21')][util[_0x27dc('0x72')](_0x27dc('0xcf'),_0x5180a6[_0x27dc('0x3a')])][_0x27dc('0xd0')]===_0x27dc('0xd1')||this[_0x27dc('0x21')][util[_0x27dc('0x72')](_0x27dc('0xcf'),_0x5180a6[_0x27dc('0x3a')])][_0x27dc('0xd0')]==='unmonitored');};Dialer[_0x27dc('0x18')][_0x27dc('0xc6')]=function(_0x5867ae,_0x2ed75a,_0x3fbfc7){this['createHistory'](_0x5867ae)[_0x27dc('0xa8')](loggerCatch(_0x2ed75a));this[_0x27dc('0xc0')](_0x5867ae)[_0x27dc('0xa8')](loggerCatch(_0x3fbfc7));};Dialer[_0x27dc('0x18')][_0x27dc('0x31')]=function(_0x54af7a){var _0x28d4d9=this[_0x27dc('0xa3')][_0x54af7a[_0x27dc('0xd2')]];var _0x19bcf9;if(!_[_0x27dc('0xd3')](_0x54af7a)&&!_[_0x27dc('0xd3')](_0x54af7a[_0x27dc('0xd4')])&&!_[_0x27dc('0xd3')](_0x54af7a['variable']['amdstatus'])&&_0x54af7a[_0x27dc('0xd5')]===_0x27dc('0xd6')&&_0x28d4d9){if(_0x28d4d9[_0x27dc('0x46')]!==_0x27dc('0x71')&&this['voiceQueues'][_0x28d4d9[_0x27dc('0xab')]][_0x27dc('0xd7')]&&_0x54af7a[_0x27dc('0xd8')]===_0x27dc('0xd9')){delete this['uniqueId'][_0x54af7a['uniqueid']];this[_0x27dc('0xaa')](this[_0x27dc('0x1e')][_0x28d4d9[_0x27dc('0xab')]]);this[_0x27dc('0x1e')][_0x28d4d9[_0x27dc('0xab')]][_0x27dc('0x56')]+=0x1;this[_0x27dc('0x1e')][_0x28d4d9[_0x27dc('0xab')]][_0x27dc('0x55')]+=0x1;_0x19bcf9=new Hangup(_0x28d4d9,_0x54af7a);_0x19bcf9['state']=0x12;_0x19bcf9[_0x27dc('0xa0')]=_0x27dc('0xda');_0x19bcf9[_0x27dc('0xdb')]=_0x27dc('0xdc');ami[_0x27dc('0x45')](_0x27dc('0xdd'),ut[_0x27dc('0xde')](_0x19bcf9,'amd'));this[_0x27dc('0xc6')](_0x19bcf9,_0x27dc('0xdf'),'[syncHangupInAMD]');}if(_0x28d4d9[_0x27dc('0x46')]!=='ivr'&&this['voiceQueues'][_0x28d4d9['queue']]['dialAMDActive']&&_0x54af7a[_0x27dc('0xd8')]===_0x27dc('0xe0')){var _0x136508=this;return new BPromise(function(_0x1d3c07,_0x2c069d){delete _0x136508['uniqueId'][_0x54af7a[_0x27dc('0xd2')]];_0x136508[_0x27dc('0xaa')](_0x136508[_0x27dc('0x1e')][_0x28d4d9[_0x27dc('0xab')]]);_0x136508['voiceQueues'][_0x28d4d9[_0x27dc('0xab')]][_0x27dc('0x56')]+=0x1;_0x136508['voiceQueues'][_0x28d4d9['queue']][_0x27dc('0x55')]+=0x1;var _0x4cd5ca=_0x136508[_0x27dc('0x1e')][_0x28d4d9[_0x27dc('0xab')]];var _0x194287=new Hangup(_0x28d4d9,_0x54af7a);_0x194287[_0x27dc('0x9f')]=0x13;_0x194287[_0x27dc('0xa0')]=_0x27dc('0xe1');_0x194287[_0x27dc('0xdb')]='AMD';_0x194287[_0x27dc('0xe2')]+=0x1;_0x194287[_0x27dc('0xe3')]+=0x1;_0x194287[_0x27dc('0xe4')]=!![];ami[_0x27dc('0x45')](_0x27dc('0xdd'),ut['buildObj'](_0x194287,_0x27dc('0xe4')));_0x136508[_0x27dc('0xc1')](_0x194287)[_0x27dc('0xa8')](loggerCatch(_0x27dc('0xe5')));if(_0x194287['countbusyretry']+_0x194287['countcongestionretry']+_0x194287['countnoanswerretry']+_0x194287[_0x27dc('0xe6')]+_0x194287[_0x27dc('0xe7')]+_0x194287[_0x27dc('0xe8')]+_0x194287[_0x27dc('0xe2')]+_0x194287[_0x27dc('0xe9')]>=_0x4cd5ca[_0x27dc('0xea')]){_0x136508[_0x27dc('0xeb')](_0x194287,_0x1d3c07,_0x2c069d,_0x27dc('0xec'));}else{if(_0x194287[_0x27dc('0xe2')]>=_0x4cd5ca[_0x27dc('0xed')]){_0x136508['createStateFinal'](_0x194287,_0x1d3c07,_0x2c069d,_0x27dc('0xee'));}else{_0x136508[_0x27dc('0xb7')]({'active':![],'countmachineretry':_0x194287['countmachineretry'],'scheduledat':moment()[_0x27dc('0xef')](_0x4cd5ca[_0x27dc('0xf0')],_0x27dc('0xf1'))[_0x27dc('0x72')](_0x27dc('0xf2')),'ContactId':_0x194287[_0x27dc('0xf3')],'ListId':_0x194287['ListId'],'VoiceQueueId':_0x194287[_0x27dc('0xca')]||undefined,'CampaignId':_0x194287[_0x27dc('0xcb')]||undefined})[_0x27dc('0xa8')](loggerCatch(_0x27dc('0xf4')));_0x1d3c07({'reschedule':0x1});}}});}if(_0x28d4d9[_0x27dc('0x46')]==='ivr'&&this[_0x27dc('0x1f')][_0x28d4d9[_0x27dc('0xab')]][_0x27dc('0xd7')]&&_0x54af7a[_0x27dc('0xd8')]==='HANGUP'){delete this['uniqueId'][_0x54af7a['uniqueid']];this[_0x27dc('0xaa')](this[_0x27dc('0x1f')][_0x28d4d9[_0x27dc('0xab')]]);_0x19bcf9=new Hangup(_0x28d4d9,_0x54af7a);_0x19bcf9[_0x27dc('0x9f')]=0x12;_0x19bcf9[_0x27dc('0xa0')]=_0x27dc('0xda');_0x19bcf9[_0x27dc('0xdb')]='AMD';ami[_0x27dc('0x45')](_0x27dc('0xdd'),ut['buildObj'](_0x19bcf9,_0x27dc('0xe4')));this[_0x27dc('0xc6')](_0x19bcf9,_0x27dc('0xf5'),_0x27dc('0xf6'));}if(_0x28d4d9['type']==='ivr'&&this[_0x27dc('0x1f')][_0x28d4d9[_0x27dc('0xab')]][_0x27dc('0xd7')]&&_0x54af7a[_0x27dc('0xd8')]===_0x27dc('0xe0')){var _0x136508=this;return new BPromise(function(_0x2c4d21,_0x37a833){delete _0x136508[_0x27dc('0xa3')][_0x54af7a[_0x27dc('0xd2')]];_0x136508[_0x27dc('0xaa')](_0x136508[_0x27dc('0x1f')][_0x28d4d9[_0x27dc('0xab')]]);_0x136508['campaigns'][_0x28d4d9[_0x27dc('0xab')]][_0x27dc('0x56')]+=0x1;_0x136508['campaigns'][_0x28d4d9[_0x27dc('0xab')]][_0x27dc('0x55')]+=0x1;var _0x572b71=_0x136508[_0x27dc('0x1f')][_0x28d4d9[_0x27dc('0xab')]];var _0x2b65a9=new Hangup(_0x28d4d9,_0x54af7a);_0x2b65a9['state']=0x13;_0x2b65a9[_0x27dc('0xa0')]=_0x27dc('0xe1');_0x2b65a9['membername']=_0x27dc('0xdc');_0x2b65a9['countmachineretry']+=0x1;_0x2b65a9[_0x27dc('0xe3')]+=0x1;_0x2b65a9[_0x27dc('0xe4')]=!![];ami['emit'](_0x27dc('0xdd'),ut[_0x27dc('0xde')](_0x2b65a9,'amd'));_0x136508[_0x27dc('0xc1')](_0x2b65a9)['catch'](loggerCatch(_0x27dc('0xe5')));if(_0x2b65a9[_0x27dc('0xf7')]+_0x2b65a9[_0x27dc('0xf8')]+_0x2b65a9[_0x27dc('0xf9')]+_0x2b65a9[_0x27dc('0xe6')]+_0x2b65a9[_0x27dc('0xe7')]+_0x2b65a9[_0x27dc('0xe8')]+_0x2b65a9[_0x27dc('0xe2')]+_0x2b65a9[_0x27dc('0xe9')]>=_0x572b71[_0x27dc('0xea')]){_0x136508[_0x27dc('0xeb')](_0x2b65a9,_0x2c4d21,_0x37a833,_0x27dc('0xec'));}else{if(_0x2b65a9['countmachineretry']>=_0x572b71[_0x27dc('0xed')]){_0x136508['createStateFinal'](_0x2b65a9,_0x2c4d21,_0x37a833,_0x27dc('0xee'));}else{_0x136508[_0x27dc('0xb7')]({'active':![],'countmachineretry':_0x2b65a9[_0x27dc('0xe2')],'scheduledat':moment()[_0x27dc('0xef')](_0x572b71[_0x27dc('0xf0')],_0x27dc('0xf1'))[_0x27dc('0x72')](_0x27dc('0xf2')),'ContactId':_0x2b65a9[_0x27dc('0xf3')],'ListId':_0x2b65a9['ListId'],'VoiceQueueId':_0x2b65a9[_0x27dc('0xca')]||undefined,'CampaignId':_0x2b65a9[_0x27dc('0xcb')]||undefined})[_0x27dc('0xa8')](loggerCatch(_0x27dc('0xf4')));_0x2c4d21({'reschedule':0x1});}}});}}};Dialer[_0x27dc('0x18')][_0x27dc('0xfa')]=function(_0x4931b7){var _0x55bc06=this['uniqueId'][_0x4931b7[_0x27dc('0xd2')]];var _0x20eba0=this;var _0xa4f545;if(_0x55bc06&&_0x55bc06[_0x27dc('0x46')]===_0x27dc('0x71')){delete this[_0x27dc('0xa3')][_0x4931b7[_0x27dc('0xd2')]];this[_0x27dc('0xaa')](this[_0x27dc('0x1f')][_0x55bc06[_0x27dc('0xab')]]);this[_0x27dc('0x1f')][_0x55bc06['queue']][_0x27dc('0xfb')]+=0x1;_0xa4f545=new Hangup(_0x55bc06,_0x4931b7);this['createHistory'](_0xa4f545)['catch'](loggerCatch(_0x27dc('0xfc')));this[_0x27dc('0xc0')](_0xa4f545)[_0x27dc('0xa8')](loggerCatch(_0x27dc('0xfd')));}if(_0x55bc06&&_0x55bc06[_0x27dc('0x46')]!==_0x27dc('0x71')&&isNotNull(this['voiceQueues'][_0x55bc06[_0x27dc('0xab')]][_0x27dc('0xfe')])){delete this[_0x27dc('0xa3')][_0x4931b7['uniqueid']];this[_0x27dc('0xaa')](this[_0x27dc('0x1e')][_0x55bc06['queue']]);this[_0x27dc('0x1e')][_0x55bc06['queue']][_0x27dc('0x56')]+=0x1;this[_0x27dc('0x1e')][_0x55bc06[_0x27dc('0xab')]][_0x27dc('0x55')]+=0x1;_0xa4f545=new Hangup(_0x55bc06,_0x4931b7);_0xa4f545[_0x27dc('0x9f')]=0x10;_0xa4f545['statedesc']='AnswerAGI';_0xa4f545[_0x27dc('0xdb')]='AGI';this['createHistory'](_0xa4f545)[_0x27dc('0xa8')](loggerCatch(_0x27dc('0xfc')));this['moveContactManagedDialer'](_0xa4f545)['catch'](loggerCatch(_0x27dc('0xfd')));}if(_0x55bc06&&_0x55bc06[_0x27dc('0x46')]!==_0x27dc('0x71')&&!isNotNull(this['voiceQueues'][_0x55bc06[_0x27dc('0xab')]][_0x27dc('0xfe')])){delete this[_0x27dc('0xa3')][_0x4931b7[_0x27dc('0xd2')]];this[_0x27dc('0xaa')](this[_0x27dc('0x1e')][_0x55bc06[_0x27dc('0xab')]]);this['voiceQueues'][_0x55bc06[_0x27dc('0xab')]][_0x27dc('0x5e')]+=0x1;_0xa4f545=new Hangup(_0x55bc06,_0x4931b7);_0xa4f545[_0x27dc('0x9f')]=0xc;_0xa4f545[_0x27dc('0xa0')]=_0x4931b7[_0x27dc('0xff')];_0xa4f545[_0x27dc('0xdb')]='Unknow';this[_0x27dc('0xc1')](_0xa4f545)[_0x27dc('0xa8')](loggerCatch(_0x27dc('0xfc')));this[_0x27dc('0xc0')](_0xa4f545)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype']['syncAgentComplete']=function(_0x8f1379){var _0x409816=this[_0x27dc('0xa3')][_0x8f1379[_0x27dc('0xd2')]];var _0x1f4642=this;if(this[_0x27dc('0x1e')][_0x8f1379[_0x27dc('0xab')]]){if(_0x409816&&_0x409816[_0x27dc('0x46')]!==_0x27dc('0x71')){delete this['uniqueId'][_0x8f1379[_0x27dc('0xd2')]];this[_0x27dc('0x1e')][_0x8f1379[_0x27dc('0xab')]][_0x27dc('0x56')]+=0x1;var _0x32a826=new AgentComplete(_0x409816,_0x8f1379);if(_0x8f1379['reason']==='agent'){_0x32a826[_0x27dc('0x100')]=this[_0x27dc('0x1e')][_0x8f1379[_0x27dc('0xab')]][_0x27dc('0x101')]&&this['voiceQueues'][_0x8f1379['queue']]['dialAgiAfterHangupAgent']?moment()['format'](_0x27dc('0xf2')):undefined;}this[_0x27dc('0xc1')](_0x32a826)['catch'](loggerCatch(_0x27dc('0x102')));this[_0x27dc('0xc0')](_0x32a826)['catch'](loggerCatch(_0x27dc('0x103')));}}};Dialer[_0x27dc('0x18')][_0x27dc('0x104')]=function(_0x303c90){if(this[_0x27dc('0x1e')][_0x303c90[_0x27dc('0xab')]]){if(this[_0x27dc('0xa3')][_0x303c90[_0x27dc('0xd2')]]&&this[_0x27dc('0xa3')][_0x303c90[_0x27dc('0xd2')]][_0x27dc('0x46')]!==_0x27dc('0x71')){this[_0x27dc('0xaa')](this[_0x27dc('0x1e')][_0x303c90['queue']]);this['uniqueId'][_0x303c90[_0x27dc('0xd2')]][_0x27dc('0x105')]=moment()[_0x27dc('0x72')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x27dc('0x18')]['queueCallerAbandonCreateState']=function(_0x3e9547){this[_0x27dc('0xc1')](_0x3e9547)['catch'](loggerCatch(_0x27dc('0x102')));this[_0x27dc('0xc0')](_0x3e9547)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x27dc('0x18')][_0x27dc('0x106')]=function(_0x29f12c){var _0x1bb023=this[_0x27dc('0xa3')][_0x29f12c[_0x27dc('0xd2')]];var _0x37dd1=this;if(this[_0x27dc('0x1e')][_0x29f12c[_0x27dc('0xab')]]){if(_0x1bb023&&_0x1bb023[_0x27dc('0x46')]!==_0x27dc('0x71')){delete this[_0x27dc('0xa3')][_0x29f12c['uniqueid']];this[_0x27dc('0xaa')](this[_0x27dc('0x1e')][_0x29f12c[_0x27dc('0xab')]]);_0x1bb023[_0x27dc('0x107')]=moment()[_0x27dc('0x72')](_0x27dc('0xf2'));var _0x153160=new QueueCallerAbandon(_0x1bb023,_0x29f12c);if(getSeconds(_0x1bb023['droptime'],_0x1bb023[_0x27dc('0x108')])>=_0x1bb023[_0x27dc('0x109')]){this[_0x27dc('0x1e')][_0x29f12c[_0x27dc('0xab')]][_0x27dc('0x61')]+=0x1;this[_0x27dc('0x1e')][_0x29f12c[_0x27dc('0xab')]][_0x27dc('0x59')]+=0x1;this[_0x27dc('0x1e')][_0x29f12c['queue']][_0x27dc('0x63')]+=0x1;_0x153160[_0x27dc('0x9f')]=0xa;_0x153160[_0x27dc('0xa0')]=_0x27dc('0x10a');_0x153160[_0x27dc('0x10b')]=_0x27dc('0x10c');_0x153160['agiafterat']=this['voiceQueues'][_0x29f12c[_0x27dc('0xab')]]['dialQueueProject2']?moment()[_0x27dc('0x72')](_0x27dc('0xf2')):undefined;_0x153160[_0x27dc('0xe7')]+=0x1;_0x153160[_0x27dc('0xe3')]+=0x1;if(_0x153160[_0x27dc('0xe7')]>=this[_0x27dc('0x1e')][_0x29f12c[_0x27dc('0xab')]][_0x27dc('0x10d')]){this[_0x27dc('0x10e')](_0x153160);}else{this[_0x27dc('0xb7')]({'active':![],'countdropretry':_0x153160[_0x27dc('0xe7')],'scheduledat':moment()[_0x27dc('0xef')](this[_0x27dc('0x1e')][_0x29f12c[_0x27dc('0xab')]]['dialDropRetryFrequency'],_0x27dc('0xf1'))['format'](_0x27dc('0xf2')),'ContactId':_0x1bb023[_0x27dc('0xf3')],'ListId':_0x1bb023[_0x27dc('0xc9')],'VoiceQueueId':_0x1bb023['VoiceQueueId']||undefined,'CampaignId':_0x1bb023[_0x27dc('0xcb')]||undefined})[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x10f')));var _0x30d93d=new History(_0x153160);_0x30d93d['state']=0xa;_0x30d93d[_0x27dc('0xa0')]='Drop';_0x30d93d[_0x27dc('0x110')]=moment()['format'](_0x27dc('0xf2'));_0x30d93d[_0x27dc('0xa1')]=_0x30d93d['starttime'];_0x30d93d[_0x27dc('0x111')]=_0x153160[_0x27dc('0x111')];_0x30d93d[_0x27dc('0x112')]=_0x153160[_0x27dc('0x112')];this[_0x27dc('0xc1')](_0x30d93d)[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x113')));}}else{this[_0x27dc('0x1e')][_0x29f12c[_0x27dc('0xab')]][_0x27dc('0x7a')]+=0x1;this[_0x27dc('0x1e')][_0x29f12c[_0x27dc('0xab')]]['outboundDropCallsDayCallersExit']+=0x1;_0x153160[_0x27dc('0x9f')]=0xb;_0x153160[_0x27dc('0xa0')]=_0x27dc('0x114');_0x153160[_0x27dc('0x10b')]='CALLEREXIT';_0x153160['countabandonedretry']+=0x1;_0x153160[_0x27dc('0xe3')]+=0x1;if(_0x153160['countabandonedretry']>=this[_0x27dc('0x1e')][_0x29f12c[_0x27dc('0xab')]][_0x27dc('0x115')]){this['queueCallerAbandonCreateState'](_0x153160);}else{this[_0x27dc('0xb7')]({'active':![],'countabandonedretry':_0x153160['countabandonedretry'],'scheduledat':moment()['add'](this['voiceQueues'][_0x29f12c['queue']][_0x27dc('0x116')],_0x27dc('0xf1'))['format'](_0x27dc('0xf2')),'ContactId':_0x1bb023[_0x27dc('0xf3')],'ListId':_0x1bb023[_0x27dc('0xc9')],'VoiceQueueId':_0x1bb023['VoiceQueueId']||undefined,'CampaignId':_0x1bb023[_0x27dc('0xcb')]||undefined})['catch'](loggerCatch(_0x27dc('0x117')));var _0x30d93d=new History(_0x153160);_0x30d93d['state']=0xb;_0x30d93d['statedesc']='Abandoned';_0x30d93d[_0x27dc('0x110')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x30d93d[_0x27dc('0xa1')]=_0x30d93d[_0x27dc('0x110')];_0x30d93d['calleridname']=_0x153160[_0x27dc('0x111')];_0x30d93d[_0x27dc('0x112')]=_0x153160[_0x27dc('0x112')];this[_0x27dc('0xc1')](_0x30d93d)['catch'](loggerCatch(_0x27dc('0x118')));}}}}};Dialer['prototype'][_0x27dc('0x119')]=function(_0x1103ab){if(this[_0x27dc('0x24')][_0x1103ab[_0x27dc('0xd2')]]){this[_0x27dc('0x24')][_0x1103ab['uniqueid']][_0x27dc('0x11a')]=_0x1103ab[_0x27dc('0x11a')];}if(this[_0x27dc('0xa3')][_0x1103ab[_0x27dc('0xd2')]]){this['uniqueId'][_0x1103ab[_0x27dc('0xd2')]][_0x27dc('0x11a')]=_0x1103ab[_0x27dc('0x11a')];}};Dialer[_0x27dc('0x18')]['syncQueueMember']=function(_0x1fa24d){if(strategy[this[_0x27dc('0x1e')][this[_0x27dc('0x24')][_0x1fa24d[_0x27dc('0x11b')]]['queue']][_0x27dc('0x11c')]]==='roundrobin'){if(this['actions'][_0x1fa24d[_0x27dc('0x11b')]]&&_[_0x27dc('0xd3')](this[_0x27dc('0x24')][_0x1fa24d[_0x27dc('0x11b')]][_0x27dc('0x11d')])&&_0x1fa24d[_0x27dc('0xd0')]==='1'&&_0x1fa24d[_0x27dc('0x11e')]==='0'){if(this[_0x27dc('0x20')][_0x1fa24d['stateinterface']]){if(!this['agents'][_0x1fa24d[_0x27dc('0x11f')]][_0x27dc('0x11d')]){this[_0x27dc('0x20')][_0x1fa24d[_0x27dc('0x11f')]][_0x27dc('0x11d')]=!![];this[_0x27dc('0x24')][_0x1fa24d[_0x27dc('0x11b')]][_0x27dc('0x11d')]=!![];this['actions'][_0x1fa24d[_0x27dc('0x11b')]][_0x27dc('0x11f')]=_0x1fa24d['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0x27dc('0x24')][_0x1fa24d[_0x27dc('0x11b')]][_0x27dc('0xab')]][_0x27dc('0x11c')]]||'rrmemory')===_0x27dc('0x16')){if(this['actions'][_0x1fa24d['actionid']]){if(this['agents'][_0x1fa24d[_0x27dc('0x11f')]]){this[_0x27dc('0x24')][_0x1fa24d[_0x27dc('0x11b')]][_0x27dc('0x11f')]=_0x1fa24d[_0x27dc('0x11f')];if(_[_0x27dc('0xd3')](this['queueBooked'][this['actions'][_0x1fa24d[_0x27dc('0x11b')]][_0x27dc('0xab')]])){this[_0x27dc('0x120')][this[_0x27dc('0x24')][_0x1fa24d[_0x27dc('0x11b')]][_0x27dc('0xab')]]=[];}this[_0x27dc('0x120')][this['actions'][_0x1fa24d['actionid']][_0x27dc('0xab')]][_0x27dc('0x121')](_['merge'](_[_0x27dc('0xc8')](this[_0x27dc('0x24')][_0x1fa24d[_0x27dc('0x11b')]],[_0x27dc('0x122'),_0x27dc('0x11f')]),{'status':_0x1fa24d['status'],'paused':_0x1fa24d[_0x27dc('0x11e')]}));}}}};function unlockQueueStatus(_0x20aa00,_0x10ce7b){setTimeout(function(){if(_[_0x27dc('0x37')](_0x20aa00['queueStatusComplete'])){loggerBooked[_0x27dc('0x8d')](_0x27dc('0x123'),_0x10ce7b);}_0x20aa00[_0x27dc('0x124')]=!![];loggerBooked[_0x27dc('0x75')](_0x27dc('0x125'),_0x10ce7b,JSON[_0x27dc('0x42')](_[_0x27dc('0xc8')](_0x20aa00,[_0x27dc('0x3a'),_0x27dc('0x124')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x42ed62){var _0x3f34b1=this;var _0x5cb25f=_0x3f34b1[_0x27dc('0x1e')][_0x3f34b1[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0xab')]];if(strategy[this[_0x27dc('0x1e')][this[_0x27dc('0x24')][_0x42ed62['actionid']][_0x27dc('0xab')]][_0x27dc('0x11c')]]===_0x27dc('0x17')){if(this[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]]&&this[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0x11f')]){this[_0x27dc('0x1d')][_0x27dc('0x126')](this['actions'][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0x122')],this[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0x11f')])['catch'](function(_0x3cc7b9){logger[_0x27dc('0x8d')](_0x27dc('0x127'),util[_0x27dc('0x8e')](_0x3cc7b9,{'showHidden':![],'depth':null}));})[_0x27dc('0x1b')](function(){_0x3f34b1[_0x27dc('0xaa')](_0x3f34b1[_0x27dc('0x1e')][_0x3f34b1[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0xab')]]);_0x3f34b1['agents'][_0x3f34b1[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0x11f')]][_0x27dc('0x11d')]=![];delete _0x3f34b1[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]];unlockQueueStatus(_0x5cb25f);});}else{this[_0x27dc('0xaa')](this[_0x27dc('0x1e')][this[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0xab')]]);this[_0x27dc('0xb7')]({'active':![],'ContactId':this[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0xf3')],'ListId':this['actions'][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0xc9')],'VoiceQueueId':this[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0xca')]||undefined,'CampaignId':this[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0xcb')]||undefined})[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x128')));delete this[_0x27dc('0x24')][_0x42ed62['actionid']];unlockQueueStatus(_0x5cb25f);}}else if((strategy[this[_0x27dc('0x1e')][this[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]]['queue']]['strategy']]||_0x27dc('0x16'))===_0x27dc('0x16')){var _0x216446;if(this[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]]&&!_[_0x27dc('0x40')](this[_0x27dc('0x120')][this[_0x27dc('0x24')][_0x42ed62['actionid']][_0x27dc('0xab')]])){if(this['queueBookedRR'][_0x3f34b1[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0xab')]]){this['queueBookedRR'][_0x3f34b1[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0xab')]]=this['queueBookedRR'][this[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]]['queue']]?this[_0x27dc('0x129')][this[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0xab')]]:this[_0x27dc('0x120')][this[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0xab')]]?this[_0x27dc('0x120')][this[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0xab')]][_0x27dc('0x12a')]||0x0:0x0;}this[_0x27dc('0x120')][this[_0x27dc('0x24')][_0x42ed62['actionid']][_0x27dc('0xab')]][_0x27dc('0x12a')]=this[_0x27dc('0x129')][this[_0x27dc('0x24')][_0x42ed62[_0x27dc('0x11b')]][_0x27dc('0xab')]];for(var _0x2020eb=0x0;_0x2020eb=0x0;})[_0x27dc('0xa8')](myreject(_0x213d29)));}}else{_0x240a2b[_0x27dc('0x121')](ami[_0x27dc('0xa7')]({'action':_0x27dc('0x142'),'command':util[_0x27dc('0x72')]('iftime\x20%s,%s',_0x5836c5,!_[_0x27dc('0x37')](config['timezones'][_0xd9c892])?_0xd9c892:'')})[_0x27dc('0xb2')](function(_0x12c79e){return _0x12c79e[_0x27dc('0x144')]['indexOf'](_0x27dc('0x145'))>=0x0;})[_0x27dc('0xa8')](myreject(_0x213d29)));}BPromise[_0x27dc('0x146')](_0x240a2b)['then'](function(_0x61c487){var _0x545b1a=_[_0x27dc('0x147')](_0x61c487);if(_0x545b1a){return _0x1408de(_0x545b1a);}else{_0x56fe01[_0x27dc('0x38')]=_0x37a2db?_0x27dc('0x148'):_0x27dc('0x149');return _0x213d29(msgResponse(_0x27dc('0x14a'),_0x27dc('0x13c'),_0x27dc('0x14b')+_0x37a2db+'\x20'+_0x145b7a+_0x27dc('0x14c')+util[_0x27dc('0x8e')](_0x5836c5,{'showHidden':![],'depth':null})+_0x27dc('0x14d')+_0xd9c892));}})['catch'](function(_0x357429){return _0x213d29(msgResponse('ifTime',_0x27dc('0x13c'),JSON[_0x27dc('0x42')](_0x357429)));});});};Dialer['prototype'][_0x27dc('0x14e')]=function(_0x17b4b0){var _0x2db58b=this;return function(){switch(_0x17b4b0[_0x27dc('0x14f')]){case _0x27dc('0x150'):freeVariablesPredictive(_0x17b4b0);_0x2db58b[_0x27dc('0x151')](_0x17b4b0,0x1);break;case _0x27dc('0x152'):freeVariablesPredictive(_0x17b4b0);_0x2db58b[_0x27dc('0x151')](_0x17b4b0,_0x17b4b0[_0x27dc('0x153')]);break;case _0x27dc('0x154'):_0x2db58b[_0x27dc('0x154')](_0x17b4b0);break;case _0x27dc('0x155'):freeVariablesPredictive(_0x17b4b0);_0x2db58b['handlePower'](_0x17b4b0,0x1);break;default:freeVariablesPredictive(_0x17b4b0);logger[_0x27dc('0x8d')](_0x27dc('0x156'),_0x17b4b0['name'],_0x27dc('0x157'));}};};Dialer[_0x27dc('0x18')]['launchHandleIvr']=function(_0x56dbbc){var _0x4a4434=this;return function(){_0x4a4434[_0x27dc('0x158')](_0x56dbbc);};};Dialer[_0x27dc('0x18')][_0x27dc('0x9')]=function(_0x49a7c8){var _0x248840=this;if(isNotPreview(_0x49a7c8['dialMethod'])){if(isVoiceQueueOutbound(_0x49a7c8[_0x27dc('0x46')])&&isActive(_0x49a7c8[_0x27dc('0x52')])){_0x49a7c8[_0x27dc('0x99')]=!![];BPromise[_0x27dc('0xae')]()['then'](checkIsLoggedIn(_0x49a7c8,_0x49a7c8[_0x27dc('0x49')]))[_0x27dc('0xb2')](checkIsActive(_0x49a7c8,_0x49a7c8['dialActive']))['then'](checkInterval(_0x49a7c8))['then'](_0x248840[_0x27dc('0x135')](_0x49a7c8))[_0x27dc('0xb2')](_0x248840[_0x27dc('0x138')](_0x49a7c8[_0x27dc('0x159')],_0x49a7c8[_0x27dc('0x15a')],_0x49a7c8[_0x27dc('0x3a')],_0x49a7c8))[_0x27dc('0xb2')](_0x248840['checkIfTimeIntervals'](_0x49a7c8[_0x27dc('0x3e')],_0x49a7c8[_0x27dc('0x15a')],_0x49a7c8[_0x27dc('0x3a')],_0x49a7c8))['then'](_0x248840['checkDialMethod'](_0x49a7c8))[_0x27dc('0xa8')](loggerCatchQueueSummary('[syncQueueSummary]',_0x49a7c8));}else{notSendMessagesQueue(_0x49a7c8);}}else{freeVariablesPredictive(_0x49a7c8);}};Dialer[_0x27dc('0x18')][_0x27dc('0x15b')]=function(){var _0x101d2f=this;var _0x20fe58;for(var _0x45041b in this['campaigns']){if(typeof this['campaigns'][_0x45041b]!==_0x27dc('0x90')){_0x20fe58=this[_0x27dc('0x1f')][_0x45041b];if(isCampaignIvr(_0x20fe58['type'])&&isActive(_0x20fe58['active'])){_0x20fe58['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x27dc('0xb2')](checkIsActive(_0x20fe58,_0x20fe58['active']))[_0x27dc('0xb2')](checkInterval(_0x20fe58))[_0x27dc('0xb2')](_0x101d2f[_0x27dc('0x135')](_0x20fe58))[_0x27dc('0xb2')](_0x101d2f[_0x27dc('0x138')](_0x20fe58[_0x27dc('0x159')],_0x20fe58[_0x27dc('0x15a')],_0x20fe58[_0x27dc('0x3a')],_0x20fe58))['then'](_0x101d2f[_0x27dc('0x13a')](_0x20fe58[_0x27dc('0x3e')],_0x20fe58[_0x27dc('0x15a')],_0x20fe58[_0x27dc('0x3a')],_0x20fe58))['then'](_0x101d2f[_0x27dc('0x15c')](_0x20fe58))[_0x27dc('0xa8')](loggerCatchQueueSummary(_0x27dc('0x15d'),_0x20fe58));}else{notSendMessagesCampaign(_0x20fe58);}}}};function getCallerIdRandom(_0x60563d,_0x44ce85){var _0x379b9a;var _0x365a4a;var _0x3c0d6a;if(_0x44ce85<=0x0){_0x44ce85=0x1;}_0x379b9a=new RegExp(_0x27dc('0x15e')+_0x44ce85+'}$');_0x365a4a=Math[_0x27dc('0x15f')](0xa,_0x44ce85-0x1);_0x3c0d6a=Math[_0x27dc('0x15f')](0xa,_0x44ce85)-0x1;return util['format']('%s',_[_0x27dc('0x160')](_0x60563d,_0x379b9a,_[_0x27dc('0x161')](_0x365a4a,_0x3c0d6a)));}function extractCalleridName(_0xb79f8f){var _0x3767ba=_0xb79f8f['match'](/"(.*?)"/);return _0x3767ba?_0x3767ba[0x1]:_0xb79f8f;}function extractCalleridNumber(_0x4aefc3){var _0x11ef63=_0x4aefc3['match'](/<(.*?)>/);return _0x11ef63?_0x11ef63[0x1]:_0x4aefc3;}Dialer[_0x27dc('0x18')][_0x27dc('0x162')]=function(_0x54e55f,_0x2748ff){var _0x490e36=this;var _0x5acb8d=uuid['v4']();this['actions'][_0x5acb8d]=new Action(_0x54e55f,_0x2748ff,_0x5acb8d);return new BPromise(function(_0x30bc2f,_0x261c5f){if(_['isUndefined'](_0x54e55f)&&typeof _0x54e55f!=='object'){return _0x261c5f(msgResponse('originate','Failure',_0x27dc('0x163')));}if(_[_0x27dc('0x37')](_0x2748ff['Contact'][_0x27dc('0x164')])||_0x2748ff[_0x27dc('0x165')]['phone']===null){return _0x261c5f(msgResponse(_0x27dc('0x166'),_0x27dc('0x13c'),_0x27dc('0x167')));}var _0x35e6f9={'XMD-CALLERID':_0x490e36['actions'][_0x5acb8d][_0x27dc('0x168')](),'XMD-AGI':_0x54e55f['dialQueueProject']?util[_0x27dc('0x72')](_0x27dc('0x169'),ipAgi,_0x54e55f[_0x27dc('0xfe')]):_0x27dc('0x16a'),'XMD-AGIAFTER':_0x54e55f[_0x27dc('0x101')]?util[_0x27dc('0x72')](_0x27dc('0x169'),ipAgi,_0x54e55f[_0x27dc('0x101')]):_0x27dc('0x16a'),'XMD-QUEUE':_0x54e55f[_0x27dc('0x46')]===_0x27dc('0x89')?util['format'](_0x27dc('0x16b'),_0x54e55f[_0x27dc('0x3a')],_0x54e55f[_0x27dc('0x16c')]||'',_0x54e55f[_0x27dc('0x16d')]?'c':'',_0x54e55f['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x2748ff['ContactId'],'XMD-CDRTYPE':_0x27dc('0x6'),'CALLERID(all)':_0x490e36['actions'][_0x5acb8d][_0x27dc('0x168')](),'XMD-AMD':_0x54e55f[_0x27dc('0xd7')]?_0x27dc('0x16e'):'NONE','XMD-DESTINATION':_0x27dc('0xd6')};if(_0x54e55f['dialAMDActive']){_0x35e6f9['XMD-AMDINITIALSILENCE']=_0x54e55f['dialAMDInitialSilence']||0x9c4;_0x35e6f9[_0x27dc('0x16f')]=_0x54e55f['dialAMDGreeting']||0x5dc;_0x35e6f9[_0x27dc('0x170')]=_0x54e55f[_0x27dc('0x171')]||0x320;_0x35e6f9[_0x27dc('0x172')]=_0x54e55f[_0x27dc('0x173')]||0x1388;_0x35e6f9[_0x27dc('0x174')]=_0x54e55f[_0x27dc('0x175')]||0x64;_0x35e6f9[_0x27dc('0x176')]=_0x54e55f[_0x27dc('0x177')]||0x32;_0x35e6f9['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x54e55f[_0x27dc('0x178')]||0x3;_0x35e6f9[_0x27dc('0x179')]=_0x54e55f[_0x27dc('0x17a')]||0x100;_0x35e6f9[_0x27dc('0x17b')]=_0x54e55f[_0x27dc('0x17c')]||0x1388;}if(_0x54e55f[_0x27dc('0x46')]===_0x27dc('0x89')){_0x35e6f9[_0x27dc('0x17d')]=_0x2748ff['VoiceQueueId'];}else{_0x35e6f9[_0x27dc('0x17e')]=_0x2748ff[_0x27dc('0xcb')];}for(var _0x577d70 in _0x2748ff[_0x27dc('0x165')]){if(typeof _0x2748ff[_0x27dc('0x165')][_0x577d70]!==_0x27dc('0x90')){if(isNotNull(_0x2748ff[_0x27dc('0x165')][_0x577d70])&&_0x577d70!=='id'&&_0x577d70!==_0x27dc('0x17f')&&_0x577d70!=='createdAt'&&_0x577d70!==_0x27dc('0x180')){_0x35e6f9[util['format'](_0x27dc('0x181'),_0x27dc('0x182'),_[_0x27dc('0x183')](_0x577d70))]=_0x2748ff[_0x27dc('0x165')][_0x577d70];}}}var _0x46b9d6=_0x490e36[_0x27dc('0xce')](_0x54e55f[_0x27dc('0x6d')])?getCallerId(_0x54e55f[_0x27dc('0x6d')][_0x27dc('0x6f')],_0x54e55f[_0x27dc('0x184')],_0x54e55f['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x54e55f[_0x27dc('0x185')],_0x54e55f['dialRandomLastDigitCallerIdNumber']):_0x54e55f[_0x27dc('0x185')]):getCallerId(_[_0x27dc('0xd3')](_0x54e55f[_0x27dc('0x136')])?_0x54e55f[_0x27dc('0x6d')]['callerid']:_0x54e55f['TrunkBackup'][_0x27dc('0x6f')],_0x54e55f[_0x27dc('0x184')],_0x54e55f['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x54e55f['dialOriginateCallerIdNumber'],_0x54e55f[_0x27dc('0x186')]):_0x54e55f[_0x27dc('0x185')]);if(_0x46b9d6){_0x35e6f9[_0x27dc('0x187')]=_0x490e36[_0x27dc('0x24')][_0x5acb8d][_0x27dc('0x188')]=extractCalleridName(_0x46b9d6);_0x35e6f9['XMD-ORIGINATECALLERIDNUM']=_0x490e36[_0x27dc('0x24')][_0x5acb8d][_0x27dc('0x189')]=extractCalleridNumber(_0x46b9d6);}return ami[_0x27dc('0xa7')]({'actionid':_0x5acb8d,'action':_0x27dc('0x166'),'channel':_0x490e36[_0x27dc('0xce')](_0x54e55f[_0x27dc('0x6d')])?util[_0x27dc('0x72')](_0x27dc('0x18a'),_0x54e55f['Trunk'][_0x27dc('0x3a')],isNotNull(_0x54e55f['dialPrefix'])?_0x54e55f[_0x27dc('0x54')][_0x27dc('0x18b')]()||'':'',_0x54e55f[_0x27dc('0x18c')]>0x0?_0x2748ff[_0x27dc('0x165')][_0x27dc('0x164')][_0x27dc('0x18d')](_0x54e55f[_0x27dc('0x18c')]):_0x2748ff[_0x27dc('0x165')][_0x27dc('0x164')]):util[_0x27dc('0x72')](_0x27dc('0x18a'),_['isNil'](_0x54e55f[_0x27dc('0x136')])?_0x54e55f[_0x27dc('0x6d')][_0x27dc('0x3a')]:_0x54e55f[_0x27dc('0x136')][_0x27dc('0x3a')],isNotNull(_0x54e55f['dialPrefix'])?_0x54e55f['dialPrefix'][_0x27dc('0x18b')]()||'':'',_0x54e55f['dialCutDigit']>0x0?_0x2748ff[_0x27dc('0x165')][_0x27dc('0x164')][_0x27dc('0x18d')](_0x54e55f[_0x27dc('0x18c')]):_0x2748ff[_0x27dc('0x165')][_0x27dc('0x164')]),'callerid':_0x46b9d6,'Exten':_0x27dc('0xd6'),'Context':_0x27dc('0x18e'),'Priority':'1','variable':_0x35e6f9,'timeout':(_0x54e55f['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x5acb8d})[_0x27dc('0xb2')](function(_0x22c349){return _0x30bc2f(_0x22c349);})[_0x27dc('0xa8')](function(_0x50ffc3){_0x54e55f[_0x27dc('0x5b')]+=0x1;var _0x2a32be=new History(_0x490e36[_0x27dc('0x24')][_0x5acb8d]);logger[_0x27dc('0x8d')](util[_0x27dc('0x72')](_0x27dc('0x18f'),JSON[_0x27dc('0x42')](_0x50ffc3)));_0x2a32be[_0x27dc('0x9f')]=0xe;_0x2a32be['statedesc']=_0x27dc('0x190');_0x2a32be[_0x27dc('0x110')]=moment()[_0x27dc('0x72')]('YYYY-MM-DD\x20HH:mm:ss');_0x2a32be['endtime']=_0x2a32be[_0x27dc('0x110')];_0x490e36[_0x27dc('0xc1')](_0x2a32be)[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x191')));_0x490e36['moveContactManagedDialer'](_0x2a32be)['catch'](loggerCatch(_0x27dc('0x191')))['finally'](function(){delete _0x490e36[_0x27dc('0x24')][_0x5acb8d];return _0x261c5f(msgResponse(_0x27dc('0x166'),_0x27dc('0x41'),_0x27dc('0x192')));});});});};Dialer[_0x27dc('0x18')][_0x27dc('0x2b')]=function(_0x2ef223){var _0x489cec=this['actions'][_0x2ef223[_0x27dc('0x11b')]];if(_0x489cec){delete this[_0x27dc('0x24')][_0x2ef223['actionid']];_0x489cec[_0x27dc('0x108')]=moment()[_0x27dc('0x72')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4a6a81=_0x489cec[_0x27dc('0x46')]===_0x27dc('0x71')?this[_0x27dc('0x1f')][_0x489cec[_0x27dc('0xab')]]:this[_0x27dc('0x1e')][_0x489cec[_0x27dc('0x193')]()];if(!this[_0x27dc('0x194')](_0x2ef223[_0x27dc('0x195')])){this[_0x27dc('0xaa')](_0x4a6a81);return this[_0x27dc('0x196')](_0x489cec,_0x4a6a81,_0x2ef223)[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x197')));}this[_0x27dc('0xa3')][_0x2ef223[_0x27dc('0xd2')]]=_0x489cec;}};Dialer[_0x27dc('0x18')][_0x27dc('0x198')]=function(_0x132cc7,_0x3b722f,_0x6f3380){var _0x17ea49=new History(_0x3b722f);if(_0x17ea49[_0x27dc('0xf7')]+_0x17ea49[_0x27dc('0xf8')]+_0x17ea49[_0x27dc('0xf9')]+_0x17ea49[_0x27dc('0xe6')]+_0x17ea49['countdropretry']+_0x17ea49[_0x27dc('0xe8')]+_0x17ea49[_0x27dc('0xe2')]+_0x17ea49[_0x27dc('0xe9')]>=_0x6f3380['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x132cc7){case 0x3:if(_0x17ea49[_0x27dc('0xf9')]>=_0x6f3380[_0x27dc('0x199')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x17ea49[_0x27dc('0xf9')]+=0x1,'scheduledat':moment()['add'](_0x6f3380[_0x27dc('0x19a')],_0x27dc('0xf1'))[_0x27dc('0x72')](_0x27dc('0xf2')),'ContactId':_0x17ea49[_0x27dc('0xf3')],'ListId':_0x17ea49[_0x27dc('0xc9')],'VoiceQueueId':_0x17ea49[_0x27dc('0xca')]||undefined,'CampaignId':_0x17ea49['CampaignId']||undefined})[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x19b')));break;case 0x5:if(_0x17ea49['countbusyretry']>=_0x6f3380[_0x27dc('0x19c')]-0x1){return!![];}this[_0x27dc('0xb7')]({'active':![],'countbusyretry':_0x17ea49['countbusyretry']+=0x1,'scheduledat':moment()[_0x27dc('0xef')](_0x6f3380['dialBusyRetryFrequency'],'minutes')[_0x27dc('0x72')](_0x27dc('0xf2')),'ContactId':_0x17ea49[_0x27dc('0xf3')],'ListId':_0x17ea49[_0x27dc('0xc9')],'VoiceQueueId':_0x17ea49[_0x27dc('0xca')]||undefined,'CampaignId':_0x17ea49[_0x27dc('0xcb')]||undefined})[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x19d')));break;case 0x8:if(_0x17ea49['countcongestionretry']>=_0x6f3380['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x17ea49['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x6f3380['dialCongestionRetryFrequency'],_0x27dc('0xf1'))[_0x27dc('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17ea49['ContactId'],'ListId':_0x17ea49['ListId'],'VoiceQueueId':_0x17ea49[_0x27dc('0xca')]||undefined,'CampaignId':_0x17ea49[_0x27dc('0xcb')]||undefined})['catch'](loggerCatch(_0x27dc('0x19e')));break;case 0x0:if(_0x17ea49[_0x27dc('0xe6')]>=_0x6f3380['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x27dc('0xb7')]({'active':![],'countnosuchnumberretry':_0x17ea49['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x6f3380[_0x27dc('0x19f')],_0x27dc('0xf1'))['format'](_0x27dc('0xf2')),'ContactId':_0x17ea49[_0x27dc('0xf3')],'ListId':_0x17ea49[_0x27dc('0xc9')],'VoiceQueueId':_0x17ea49[_0x27dc('0xca')]||undefined,'CampaignId':_0x17ea49[_0x27dc('0xcb')]||undefined})[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x1a0')));}break;case 0xa:if(_0x17ea49[_0x27dc('0xe7')]>=_0x6f3380[_0x27dc('0x10d')]-0x1){return!![];}this[_0x27dc('0xb7')]({'active':![],'countdropretry':_0x17ea49['countdropretry']+=0x1,'scheduledat':moment()[_0x27dc('0xef')](_0x6f3380[_0x27dc('0x1a1')],_0x27dc('0xf1'))[_0x27dc('0x72')](_0x27dc('0xf2')),'ContactId':_0x17ea49[_0x27dc('0xf3')],'ListId':_0x17ea49[_0x27dc('0xc9')],'VoiceQueueId':_0x17ea49[_0x27dc('0xca')]||undefined,'CampaignId':_0x17ea49[_0x27dc('0xcb')]||undefined})[_0x27dc('0xa8')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x17ea49['countabandonedretry']>=_0x6f3380[_0x27dc('0x115')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x17ea49[_0x27dc('0xe8')]+=0x1,'scheduledat':moment()[_0x27dc('0xef')](_0x6f3380['dialAbandonedRetryFrequency'],_0x27dc('0xf1'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17ea49[_0x27dc('0xf3')],'ListId':_0x17ea49[_0x27dc('0xc9')],'VoiceQueueId':_0x17ea49[_0x27dc('0xca')]||undefined,'CampaignId':_0x17ea49[_0x27dc('0xcb')]||undefined})[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x117')));break;case 0x13:if(_0x17ea49[_0x27dc('0xe2')]>=_0x6f3380[_0x27dc('0xed')]-0x1){return!![];}this[_0x27dc('0xb7')]({'active':![],'countmachineretry':_0x17ea49[_0x27dc('0xe2')]+=0x1,'scheduledat':moment()[_0x27dc('0xef')](_0x6f3380[_0x27dc('0xf0')],_0x27dc('0xf1'))[_0x27dc('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17ea49[_0x27dc('0xf3')],'ListId':_0x17ea49[_0x27dc('0xc9')],'VoiceQueueId':_0x17ea49[_0x27dc('0xca')]||undefined,'CampaignId':_0x17ea49[_0x27dc('0xcb')]||undefined})[_0x27dc('0xa8')](loggerCatch(_0x27dc('0xf4')));break;case 0x14:if(_0x17ea49[_0x27dc('0xe9')]>=_0x6f3380[_0x27dc('0x1a2')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x17ea49[_0x27dc('0xe9')]+=0x1,'scheduledat':moment()[_0x27dc('0xef')](_0x6f3380[_0x27dc('0x1a3')],_0x27dc('0xf1'))[_0x27dc('0x72')](_0x27dc('0xf2')),'ContactId':_0x17ea49[_0x27dc('0xf3')],'ListId':_0x17ea49['ListId'],'VoiceQueueId':_0x17ea49[_0x27dc('0xca')]||undefined,'CampaignId':_0x17ea49['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x27dc('0x18')][_0x27dc('0x196')]=function(_0x2a465b,_0xdb5161,_0x7c88fe){var _0x2826eb=this;var _0x559a7a=new History(_0x2a465b);return new BPromise(function(_0x3ddc65,_0x309bcf){if(_[_0x27dc('0x37')](_0xdb5161)&&typeof _0xdb5161!==_0x27dc('0x1a4')){return _0x309bcf(msgResponse(_0x27dc('0x1a5'),_0x27dc('0x13c'),_0x27dc('0x1a6')));}if(_[_0x27dc('0x37')](_0x7c88fe)&&typeof _0x7c88fe!=='object'){return _0x309bcf(msgResponse(_0x27dc('0x1a5'),'Failure',_0x27dc('0x1a7')));}switch(_0x7c88fe[_0x27dc('0x1a8')]){case'0':_0xdb5161['outboundNoSuchCallsDay']+=0x1;_0x559a7a[_0x27dc('0x9f')]=0x0;_0x559a7a[_0x27dc('0xa0')]='NoSuchNumber';_0x559a7a[_0x27dc('0xe6')]+=0x1;_0x559a7a[_0x27dc('0xe3')]+=0x1;ami[_0x27dc('0x45')](_0x27dc('0x1a9'),ut[_0x27dc('0xde')](_0x2a465b,_0x27dc('0x1aa')));_0x2826eb[_0x27dc('0xc1')](_0x559a7a)[_0x27dc('0xa8')](loggerCatch(_0x27dc('0xe5')));if(_0x2826eb['checkRetriveMax'](0x0,_0x2a465b,_0xdb5161)){if(_0x559a7a[_0x27dc('0xe6')]>=_0xdb5161[_0x27dc('0x1ab')]){_0x2826eb[_0x27dc('0x1ac')](_0x559a7a,_0x3ddc65,_0x309bcf,'reason\x200\x20no\x20such\x20number....');}else{_0x2826eb[_0x27dc('0xeb')](_0x559a7a,_0x3ddc65,_0x309bcf,_0x27dc('0x1ad'));}}break;case'3':_0xdb5161[_0x27dc('0x5a')]+=0x1;_0x559a7a[_0x27dc('0x9f')]=0x3;_0x559a7a[_0x27dc('0xa0')]='NoAnswer';_0x559a7a['countnoanswerretry']+=0x1;_0x559a7a[_0x27dc('0xe3')]+=0x1;ami[_0x27dc('0x45')](_0x27dc('0x1ae'),ut[_0x27dc('0xde')](_0x2a465b,_0x27dc('0x1af')));_0x2826eb['createHistory'](_0x559a7a)[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x1b0')));if(_0x2826eb[_0x27dc('0x198')](0x3,_0x2a465b,_0xdb5161)){if(_0x559a7a[_0x27dc('0xf9')]>=_0xdb5161[_0x27dc('0x199')]){_0x2826eb[_0x27dc('0x1ac')](_0x559a7a,_0x3ddc65,_0x309bcf,_0x27dc('0x1b1'));}else{_0x2826eb[_0x27dc('0xeb')](_0x559a7a,_0x3ddc65,_0x309bcf,_0x27dc('0x1b1'));}}break;case'5':_0xdb5161[_0x27dc('0x1b2')]+=0x1;_0x559a7a[_0x27dc('0x9f')]=0x5;_0x559a7a[_0x27dc('0xa0')]=_0x27dc('0x1b3');_0x559a7a[_0x27dc('0xf7')]+=0x1;_0x559a7a[_0x27dc('0xe3')]+=0x1;ami[_0x27dc('0x45')](_0x27dc('0x1b4'),ut[_0x27dc('0xde')](_0x2a465b,_0x27dc('0x1b5')));_0x2826eb[_0x27dc('0xc1')](_0x559a7a)[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x1b6')));if(_0x2826eb[_0x27dc('0x198')](0x5,_0x2a465b,_0xdb5161)){if(_0x559a7a[_0x27dc('0xf7')]>=_0xdb5161[_0x27dc('0x19c')]){_0x2826eb[_0x27dc('0x1ac')](_0x559a7a,_0x3ddc65,_0x309bcf,_0x27dc('0x1b7'));}else{_0x2826eb[_0x27dc('0xeb')](_0x559a7a,_0x3ddc65,_0x309bcf,'reason\x205\x20busy');}}break;case'8':_0xdb5161['outboundCongestionCallsDay']+=0x1;_0x559a7a[_0x27dc('0x9f')]=0x8;_0x559a7a['statedesc']=_0x27dc('0x1b8');_0x559a7a['countcongestionretry']+=0x1;_0x559a7a[_0x27dc('0xe3')]+=0x1;ami['emit'](_0x27dc('0x1b9'),ut['buildObj'](_0x2a465b,'congestion'));_0x2826eb[_0x27dc('0xc1')](_0x559a7a)[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x1ba')));if(_0x2826eb[_0x27dc('0x198')](0x8,_0x2a465b,_0xdb5161)){if(_0x559a7a[_0x27dc('0xf8')]>=_0xdb5161['dialCongestionMaxRetry']){_0x2826eb[_0x27dc('0x1ac')](_0x559a7a,_0x3ddc65,_0x309bcf,_0x27dc('0x1bb'));}else{_0x2826eb[_0x27dc('0xeb')](_0x559a7a,_0x3ddc65,_0x309bcf,'reason\x208\x20congestion');}}break;case'11':_0xdb5161['outboundAbandonedCallsDay']+=0x1;_0x559a7a[_0x27dc('0x9f')]=0xb;_0x559a7a['statedesc']=_0x27dc('0x114');_0x559a7a['countabandonedretry']+=0x1;_0x559a7a[_0x27dc('0xe3')]+=0x1;_0x2826eb[_0x27dc('0xc1')](_0x559a7a)[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x118')));if(_0x2826eb[_0x27dc('0x198')](0xb,_0x2a465b,_0xdb5161)){if(_0x559a7a[_0x27dc('0xe8')]>=_0xdb5161[_0x27dc('0x115')]){_0x2826eb[_0x27dc('0x1ac')](_0x559a7a,_0x3ddc65,_0x309bcf,'reason\x2011\x20abandoned');}else{_0x2826eb['stateGlobal'](_0x559a7a,_0x3ddc65,_0x309bcf,_0x27dc('0x1bc'));}}break;case'20':_0xdb5161[_0x27dc('0x5d')]+=0x1;_0x559a7a['state']=0x14;_0x559a7a[_0x27dc('0xa0')]='AgentReject';_0x559a7a['countagentrejectretry']+=0x1;_0x559a7a[_0x27dc('0xe3')]+=0x1;ami[_0x27dc('0x45')](_0x27dc('0x1bd'),ut[_0x27dc('0xde')](_0x2a465b,_0x27dc('0x1be')));_0x2826eb[_0x27dc('0xc1')](_0x559a7a)[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x1bf')));if(_0x2826eb[_0x27dc('0x198')](0x14,_0x2a465b,_0xdb5161)){if(_0x559a7a['countagentrejectretry']>=_0xdb5161[_0x27dc('0x1a2')]){_0x2826eb[_0x27dc('0x1ac')](_0x559a7a,_0x3ddc65,_0x309bcf,_0x27dc('0x1c0'));}else{_0x2826eb['stateGlobal'](_0x559a7a,_0x3ddc65,_0x309bcf,_0x27dc('0x1c0'));}}break;default:_0xdb5161[_0x27dc('0x5e')]+=0x1;_0x559a7a['state']=0xc;_0x559a7a['statedesc']=_0x7c88fe[_0x27dc('0x1a8')];_0x2826eb[_0x27dc('0xc1')](_0x559a7a)[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x1c1')));if(_0x2826eb[_0x27dc('0x198')](_0x7c88fe[_0x27dc('0x1a8')],_0x2a465b,_0xdb5161)){if(_0x559a7a[_0x27dc('0xf7')]+_0x559a7a[_0x27dc('0xf8')]+_0x559a7a[_0x27dc('0xf9')]+_0x559a7a[_0x27dc('0xe6')]+_0x559a7a['countdropretry']+_0x559a7a[_0x27dc('0xe8')]+_0x559a7a['countmachineretry']+_0x559a7a[_0x27dc('0xe9')]>=_0xdb5161[_0x27dc('0xea')]){_0x2826eb[_0x27dc('0xeb')](_0x559a7a,_0x3ddc65,_0x309bcf,_0x7c88fe[_0x27dc('0x1a8')]);}else{_0x2826eb[_0x27dc('0x1ac')](_0x559a7a,_0x3ddc65,_0x309bcf,_0x7c88fe[_0x27dc('0x1a8')]);}}}});};Dialer['prototype'][_0x27dc('0xeb')]=function(_0x5ad01f,_0x46ace6,_0xe17be2,_0x153cc3){var _0x320bd5=new Final(_0x5ad01f);_0x320bd5[_0x27dc('0x9f')]=0xf;_0x320bd5[_0x27dc('0xa0')]='Global';this[_0x27dc('0x1ac')](_0x320bd5,_0x46ace6,_0xe17be2,_0x153cc3);};Dialer['prototype']['createStateFinal']=function(_0xef2648,_0x26a8a2,_0x51ea73,_0x49f530){this['moveContactManagedDialer'](_0xef2648)[_0x27dc('0xb2')](function(){return _0x26a8a2(msgResponse(_0x27dc('0x1a5'),'Success',_0x49f530));})[_0x27dc('0xa8')](function(){return _0x51ea73(msgResponse(_0x27dc('0x1c2'),_0x27dc('0x13c'),_0x27dc('0x1c3')));});};Dialer[_0x27dc('0x18')][_0x27dc('0x154')]=function(_0x4ef51e){var _0x43e6b9=_0x4ef51e[_0x27dc('0x1c4')]/0x64;var _0x4fe6b5=_0x4ef51e['outboundDropCallsDayTimeout']/(_0x4ef51e[_0x27dc('0x59')]+_0x4ef51e[_0x27dc('0x56')]);var _0x53ad12=Math[_0x27dc('0x1c5')](_0x4ef51e['predictiveIntervalAvailable']*(_0x4ef51e[_0x27dc('0x1c6')]/0x64));var _0x58764d=Math['round'](_0x4ef51e[_0x27dc('0x67')]*(_0x4ef51e[_0x27dc('0x1c7')]/0x64));var _0x1045d9=_0x4ef51e[_0x27dc('0x48')]+_0x4ef51e[_0x27dc('0x4d')];var _0x3870e5=Math[_0x27dc('0x1c8')](_0x4ef51e[_0x27dc('0x69')]*_0x4ef51e[_0x27dc('0x6a')]*_0x4ef51e[_0x27dc('0x64')]*_0x4ef51e[_0x27dc('0x65')]);if(_['isUndefined'](_0x4ef51e['startProgressive'])){if(!_[_0x27dc('0x37')](_0x4ef51e['startPredictive'])){_0x4ef51e[_0x27dc('0x27')]=undefined;loggerPredictive[_0x27dc('0x8d')](_0x27dc('0x1c9'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x4ef51e[_0x27dc('0x87')])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0x27dc('0x1ca'));clearInterval(_0x4ef51e[_0x27dc('0x87')]);_0x4ef51e[_0x27dc('0x87')]=undefined;}_0x4ef51e[_0x27dc('0x6c')]=moment()[_0x27dc('0x72')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x4ef51e['name'],'collection\x20data\x20in\x20progressive\x20at',_0x4ef51e[_0x27dc('0x6c')]);this[_0x27dc('0x151')](_0x4ef51e,0x1);}else if(ifInterval(_0x4ef51e[_0x27dc('0x1cb')],_0x4ef51e['startProgressive'])){this[_0x27dc('0x151')](_0x4ef51e,0x1);loggerPredictiveCalls[_0x27dc('0x75')](_0x27dc('0x1cc'),_0x4ef51e[_0x27dc('0x6c')],_0x4ef51e[_0x27dc('0x3a')]);_0x4ef51e[_0x27dc('0x69')]=0x0;_0x4ef51e[_0x27dc('0x63')]=0x0;}else if(_0x43e6b9<_0x4fe6b5&&_0x4ef51e['dialPredictiveOptimization']===_0x27dc('0x1cd')){freeVariablesPredictive(_0x4ef51e);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x4fe6b5,_0x27dc('0x6c'),_0x4ef51e[_0x27dc('0x3a')]);}else if(_0x3870e5<_0x4ef51e['predictiveIntervalErlangCallsDroppedCalls']&&_0x4ef51e[_0x27dc('0x1ce')]===_0x27dc('0x1cd')){freeVariablesPredictive(_0x4ef51e);loggerPredictive[_0x27dc('0x75')](_0x27dc('0x1cf'),_0x27dc('0x1d0'),_0x3870e5,_0x27dc('0x1d1'),_0x4ef51e['predictiveIntervalErlangCallsDroppedCalls'],_0x27dc('0x6c'),_0x4ef51e[_0x27dc('0x3a')]);}else if(!ifInterval(_0x4ef51e[_0x27dc('0x1cb')],_0x4ef51e[_0x27dc('0x6c')])&&_[_0x27dc('0x37')](_0x4ef51e[_0x27dc('0x27')])&&!_[_0x27dc('0x37')](_0x4ef51e[_0x27dc('0x6c')])){_0x4ef51e[_0x27dc('0x27')]=moment()[_0x27dc('0x72')](_0x27dc('0xf2'));loggerPredictive[_0x27dc('0x75')](_0x4ef51e[_0x27dc('0x3a')],'started\x20in\x20predictive\x20at',_0x4ef51e[_0x27dc('0x27')]);this[_0x27dc('0xb4')](_0x4ef51e['dialPredictiveInterval'])[_0x27dc('0xb2')](this[_0x27dc('0x1d2')](_0x4ef51e))[_0x27dc('0xb2')](mergeDataErlangB(_0x4ef51e))[_0x27dc('0xb2')](this[_0x27dc('0x1d3')](_0x4ef51e))[_0x27dc('0xa8')](loggerCatchPredictive(_0x27dc('0x1d4'),_0x4ef51e));}else if(!ifInterval(_0x4ef51e[_0x27dc('0x1cb')],_0x4ef51e['startPredictive'])){_0x4ef51e[_0x27dc('0x63')]=0x0;_0x4ef51e['startPredictive']=moment()[_0x27dc('0x72')](_0x27dc('0xf2'));loggerPredictive[_0x27dc('0x75')](_0x4ef51e[_0x27dc('0x3a')],_0x27dc('0x1d5'),_0x4ef51e['startPredictive']);clearInterval(_0x4ef51e[_0x27dc('0x87')]);_0x4ef51e['handlePredictive']=undefined;this[_0x27dc('0xb4')](_0x4ef51e[_0x27dc('0x1cb')])[_0x27dc('0xb2')](this[_0x27dc('0x1d2')](_0x4ef51e))[_0x27dc('0xb2')](mergeDataErlangB(_0x4ef51e))[_0x27dc('0xb2')](this['startMethodPredictive'](_0x4ef51e))[_0x27dc('0xa8')](loggerCatchPredictive(_0x27dc('0x1d6'),_0x4ef51e));}else if(_0x4ef51e[_0x27dc('0x67')]&&_0x1045d9<_0x4ef51e[_0x27dc('0x67')]-_0x58764d){freeVariablesPredictive(_0x4ef51e);loggerPredictive[_0x27dc('0x75')](_0x4ef51e[_0x27dc('0x3a')],_0x27dc('0x1d7'),_0x1045d9,_0x27dc('0x1d8'),_0x4ef51e['predictiveIntervalAvailable'],'-',_0x58764d,'=',_0x4ef51e[_0x27dc('0x67')]-_0x58764d,')');}else if(_0x4ef51e['predictiveIntervalAvailable']&&_0x1045d9>_0x4ef51e[_0x27dc('0x67')]+_0x53ad12){freeVariablesPredictive(_0x4ef51e);loggerPredictive[_0x27dc('0x75')](_0x4ef51e[_0x27dc('0x3a')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1045d9,_0x27dc('0x1d9'),_0x4ef51e[_0x27dc('0x67')],'+',_0x53ad12,'=',_0x4ef51e[_0x27dc('0x67')]+_0x53ad12,')');}};Dialer['prototype']['getDataPredictive']=function(_0x2b63d2){var _0x2233aa=this;return function(_0x31d763){return new BPromise(function(_0x77f50b,_0x48468d){_[_0x27dc('0xc7')](_0x2b63d2,_0x31d763[0x0]);if(checkGetDataPredictive(_0x31d763[0x0])){var _0x20dfcd=_0x2b63d2[_0x27dc('0x67')]=_0x2b63d2[_0x27dc('0x4d')]+_0x2b63d2[_0x27dc('0x48')];var _0x1e1dae=_0x2b63d2[_0x27dc('0x1cb')]*0x3c;var _0xfdf9ee=_0x31d763[0x0][_0x27dc('0x60')]+_0x31d763[0x0][_0x27dc('0x5f')];var _0x808152=(_0x31d763[0x0][_0x27dc('0x79')]+_0x31d763[0x0][_0x27dc('0x61')]+_0x31d763[0x0][_0x27dc('0x7a')])/_0x31d763[0x0]['predictiveIntervalTotalCalls'];_0x2b63d2[_0x27dc('0x64')]=_0x808152>0x0?_0x808152:0x1;switch(_0x2b63d2[_0x27dc('0x1ce')]){case'dropRate':var _0x5cc24e=_0x2b63d2[_0x27dc('0x1c4')]/0x64;return _0x2233aa[_0x27dc('0x1da')](_0x20dfcd,_0x1e1dae,_0xfdf9ee,_0x808152,_0x5cc24e)['then'](function(_0x4cd5aa){return _0x77f50b(_0x4cd5aa);});case _0x27dc('0x1db'):var _0x1c94ec=_0x2b63d2[_0x27dc('0x1c4')]/0x64;return _0x2233aa[_0x27dc('0x1dc')](_0x20dfcd,_0x1e1dae,_0xfdf9ee,_0x808152,_0x1c94ec)['then'](function(_0x1f700d){return _0x77f50b(_0x1f700d);});default:return _0x48468d(msgResponse(_0x27dc('0x1dd'),_0x27dc('0x13c'),_0x27dc('0x1de')));}}else{return _0x48468d(msgResponse(_0x27dc('0x1dd'),_0x27dc('0x13c'),_0x27dc('0x1df')));}});};};Dialer[_0x27dc('0x18')][_0x27dc('0x1e0')]=function(_0x57a39d){var _0x4da4b1=this;return function(_0x1ee1b2){return new BPromise(function(_0x3fe161,_0x256a82){_[_0x27dc('0xc7')](_0x57a39d,_0x1ee1b2[0x0]);if(checkGetDataPredictive(_0x1ee1b2[0x0])){loggerPredictive[_0x27dc('0x75')](JSON[_0x27dc('0x42')](_0x1ee1b2[0x0]));if(_0x57a39d[_0x27dc('0x1ce')]===_0x27dc('0x1cd')){return _0x4da4b1[_0x27dc('0xbe')](_0x57a39d['id'])['then'](function(_0x34a319){var _0x2751bf=_0x57a39d['loggedIn']-_0x34a319[0x0]['outboundQueuePauses'];var _0xd5dc8f=_0x57a39d[_0x27dc('0x1cb')]*0x3c;var _0x312953=_0x1ee1b2[0x0][_0x27dc('0x60')]+_0x1ee1b2[0x0][_0x27dc('0x5f')];var _0x209fad=(_0x1ee1b2[0x0][_0x27dc('0x79')]+_0x1ee1b2[0x0][_0x27dc('0x61')]+_0x1ee1b2[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1ee1b2[0x0][_0x27dc('0x68')];var _0x79872a=_0x57a39d[_0x27dc('0x1c4')]/0x64;_0x57a39d[_0x27dc('0x66')]=_0x34a319[0x0][_0x27dc('0x1e1')]||0x0;_0x57a39d[_0x27dc('0x64')]=_0x209fad>0x0?_0x209fad:0x1;return _0x4da4b1[_0x27dc('0x1da')](_0x2751bf,_0xd5dc8f,_0x312953,_0x209fad,_0x79872a);})[_0x27dc('0xb2')](function(_0x509b42){return _0x3fe161(_0x509b42);})[_0x27dc('0xa8')](function(_0x3d18c7){return _0x256a82(msgResponse('[CatchErlangB]',_0x27dc('0x13c'),JSON['stringify'](_0x3d18c7)));});}if(_0x57a39d['dialPredictiveOptimization']==='agentBusyFactor'){return _0x4da4b1[_0x27dc('0xbe')](_0x57a39d['id'])[_0x27dc('0xb2')](function(_0x2b4869){var _0x1186c2=_0x57a39d[_0x27dc('0x49')]-_0x2b4869[0x0][_0x27dc('0x1e1')];var _0x350454=_0x57a39d[_0x27dc('0x1cb')]*0x3c;var _0x4fb31a=_0x1ee1b2[0x0][_0x27dc('0x60')]+_0x1ee1b2[0x0][_0x27dc('0x5f')];var _0x124c0d=(_0x1ee1b2[0x0][_0x27dc('0x79')]+_0x1ee1b2[0x0][_0x27dc('0x61')]+_0x1ee1b2[0x0][_0x27dc('0x7a')])/_0x1ee1b2[0x0]['predictiveIntervalTotalCalls'];var _0x305b55=_0x57a39d['dialPredictiveOptimizationPercentage']/0x64;_0x57a39d[_0x27dc('0x66')]=_0x2b4869[0x0][_0x27dc('0x1e1')]||0x0;_0x57a39d[_0x27dc('0x64')]=_0x124c0d>0x0?_0x124c0d:0x1;return _0x4da4b1[_0x27dc('0x1dc')](_0x1186c2,_0x350454,_0x4fb31a,_0x124c0d,_0x305b55);})[_0x27dc('0xb2')](function(_0x26095e){return _0x3fe161(_0x26095e);})[_0x27dc('0xa8')](function(_0x703eb6){return _0x256a82(msgResponse(_0x27dc('0x1e2'),_0x27dc('0x13c'),JSON[_0x27dc('0x42')](_0x703eb6)));});}}else{return _0x256a82(msgResponse(_0x27dc('0x1dd'),'Failure',_0x27dc('0x1df')));}});};};Dialer[_0x27dc('0x18')][_0x27dc('0x1d3')]=function(_0x319e22){var _0x54a1d9=this;return function(){var _0x117ce8=0x0;var _0x102786=Math[_0x27dc('0x1c8')](_0x319e22[_0x27dc('0x83')]*0x3e8);if(_0x102786>0x0){_0x102786=_0x102786<0x64?0x64:_0x102786;loggerPredictive[_0x27dc('0x75')](_0x319e22['name'],_0x27dc('0x1e3'),_0x102786,_0x27dc('0x1e4'));_0x319e22['handlePredictive']=setInterval(function(){_0x54a1d9[_0x27dc('0x87')](_0x319e22);loggerPredictiveCalls['info'](_0x27dc('0x1e5'),_0x117ce8+=0x1);},_0x102786);}else{loggerPredictive[_0x27dc('0x75')](_0x319e22[_0x27dc('0x3a')],_0x27dc('0x1e6'));}};};Dialer[_0x27dc('0x18')][_0x27dc('0x1e7')]=function(_0x4d156b,_0x23ab52){var _0x51108f=this;return function(_0x2c0b92){if(_['isEmpty'](_0x2c0b92)){if(_[_0x27dc('0xd3')](_0x23ab52['UserId'])||!_0x23ab52[_0x27dc('0x1e8')]){if(_0x4d156b[_0x27dc('0x14f')]==='booked'){_0x4d156b[_0x27dc('0x124')]=_[_0x27dc('0x37')](_0x4d156b[_0x27dc('0x124')])?!![]:_0x4d156b[_0x27dc('0x124')];var _0xc21509=uuid['v4']();_0x51108f[_0x27dc('0x24')][_0xc21509]=new Action(_0x4d156b,_0x23ab52,_0xc21509);loggerBooked['info'](_0x27dc('0x1e9'),_0xc21509,_0x27dc('0x1ea'),JSON[_0x27dc('0x42')](_0x4d156b[_0x27dc('0x124')]),_0x27dc('0x1eb'),_0x4d156b[_0x27dc('0x3a')]);if(_0x4d156b['queueStatusComplete']){_0x4d156b[_0x27dc('0x124')]=![];_0x51108f[_0x27dc('0x120')][_0x51108f[_0x27dc('0x24')][_0xc21509][_0x27dc('0xab')]]=[];ami[_0x27dc('0xa7')]({'actionid':_0xc21509,'action':_0x27dc('0x1ec'),'queue':_0x4d156b[_0x27dc('0x3a')]})[_0x27dc('0xa8')](function(){_0x51108f[_0x27dc('0xaa')](_0x4d156b);_0x51108f[_0x27dc('0xb7')]({'active':![],'ContactId':_0x51108f[_0x27dc('0x24')][_0xc21509]['ContactId'],'ListId':_0x51108f[_0x27dc('0x24')][_0xc21509]['ListId'],'VoiceQueueId':_0x51108f[_0x27dc('0x24')][_0xc21509][_0x27dc('0xca')]||undefined,'CampaignId':_0x51108f['actions'][_0xc21509][_0x27dc('0xcb')]||undefined})[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x1ed')));delete _0x51108f[_0x27dc('0x24')][_0xc21509];});}else{loggerBooked[_0x27dc('0x75')](_0x27dc('0x1ee'),JSON[_0x27dc('0x42')](_0x4d156b[_0x27dc('0x124')]),_0x27dc('0x1eb'),_0x4d156b['name']);_0x51108f[_0x27dc('0xaa')](_0x4d156b);_0x51108f['rescheduleContact']({'active':![],'ContactId':_0x51108f[_0x27dc('0x24')][_0xc21509][_0x27dc('0xf3')],'ListId':_0x51108f[_0x27dc('0x24')][_0xc21509]['ListId'],'VoiceQueueId':_0x51108f[_0x27dc('0x24')][_0xc21509][_0x27dc('0xca')]||undefined,'CampaignId':_0x51108f[_0x27dc('0x24')][_0xc21509][_0x27dc('0xcb')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x51108f['actions'][_0xc21509];}}else{return _0x51108f[_0x27dc('0x162')](_0x4d156b,_0x23ab52);}}else{if(getDiff(_0x23ab52[_0x27dc('0x1ef')])<_0x4d156b['dialRecallMeTimeout']*0x3c){if(_0x23ab52[_0x27dc('0x1f0')]&&!_0x23ab52[_0x27dc('0x1f0')][_0x27dc('0x1f1')]){_0x51108f['preview'][_0x27dc('0x126')](_0x23ab52['id'])[_0x27dc('0x1b')](function(){_0x51108f[_0x27dc('0xaa')](_0x4d156b);});}else{_0x51108f['unlockContact']({'active':![]},_0x23ab52['id'],0x1)[_0x27dc('0x1b')](function(){_0x51108f['updateOriginated'](_0x4d156b);});}}else{_0x4d156b[_0x27dc('0x5c')]+=0x1;_0x51108f[_0x27dc('0xaa')](_0x4d156b);if(_0x4d156b[_0x27dc('0x1f2')]){_0x51108f[_0x27dc('0xb7')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x23ab52['ContactId'],'ListId':_0x23ab52[_0x27dc('0xc9')],'VoiceQueueId':_0x23ab52['VoiceQueueId']||undefined,'CampaignId':_0x23ab52[_0x27dc('0xcb')]||undefined})[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x1f3')));_0x51108f['createHistory'](createObjHistory(_0x4d156b,_0x23ab52,_0x27dc('0x1f4'),0x17,_0x27dc('0x1f5')))['catch'](loggerCatch(_0x27dc('0x1f6')));}else{_0x51108f[_0x27dc('0xc6')](createObjHistory(_0x4d156b,_0x23ab52,_0x27dc('0x1f7'),0x16,_0x27dc('0x1f8')),_0x27dc('0x1f9'),'[Originate][HistoryRecallClose]');}}}}else{_0x4d156b[_0x27dc('0x1fa')]+=0x1;_0x51108f[_0x27dc('0xc6')](createObjHistory(_0x4d156b,_0x23ab52,'BLACKLIST',0xd,_0x27dc('0x1fb')),_0x27dc('0x1fc'),_0x27dc('0x1fd'));throw'inBlackList';}};};Dialer[_0x27dc('0x18')][_0x27dc('0x158')]=function(_0x89cc5c){var _0x1d58b8=this;var _0x315d9c=_0x89cc5c[_0x27dc('0x1fe')]-_0x89cc5c[_0x27dc('0x91')]-_0x89cc5c['temp'];emitCampaignSummary(_0x89cc5c);if(_0x315d9c>0x0){if(_0x315d9c>this['maxNumberOriginate']){_0x315d9c=this[_0x27dc('0x22')];}_0x89cc5c[_0x27dc('0xbb')]+=_0x315d9c;this['getContactDialerIvr'](_0x89cc5c['id'],_0x315d9c,_0x89cc5c[_0x27dc('0x1ff')],_0x89cc5c)[_0x27dc('0xb2')](function(_0x4c1b26){_0x89cc5c[_0x27dc('0xbb')]-=_0x315d9c;_0x89cc5c[_0x27dc('0xbb')]=_0x89cc5c[_0x27dc('0xbb')]>0x0?_0x89cc5c[_0x27dc('0xbb')]:0x0;if(!checkContactEmpty(_0x4c1b26)){_0x89cc5c[_0x27dc('0x38')]=_0x27dc('0x96');logger['info'](_0x27dc('0x200')+_0x89cc5c[_0x27dc('0x3a')]);}else{_0x89cc5c[_0x27dc('0x91')]+=_0x4c1b26[_0x27dc('0x12b')];_0x89cc5c[_0x27dc('0x38')]=_0x27dc('0x201');for(var _0x66e002=0x0;_0x66e002<_0x4c1b26[_0x27dc('0x12b')];_0x66e002+=0x1){_0x89cc5c[_0x27dc('0x202')]+=0x1;if(_[_0x27dc('0xd3')](_0x4c1b26[_0x66e002])||_['isNil'](_0x4c1b26[_0x66e002]['Contact'])||_['isNil'](_0x4c1b26[_0x66e002][_0x27dc('0x165')][_0x27dc('0x164')])){_0x1d58b8['emptyContact'](_0x27dc('0x203'),_0x89cc5c,_0x4c1b26[_0x66e002]);}else{_0x1d58b8['checkIsBlackListIvr'](_[_0x27dc('0xc8')](_0x4c1b26[_0x66e002],[_0x27dc('0xcb'),_0x27dc('0x204')]))[_0x27dc('0xb2')](_0x1d58b8[_0x27dc('0x1e7')](_0x89cc5c,_0x4c1b26[_0x66e002]))[_0x27dc('0xa8')](_0x1d58b8[_0x27dc('0xc4')](_0x27dc('0x205'),_0x89cc5c));}}}})['catch'](loggerGetContactDialer(_0x27dc('0x206'),_0x89cc5c,_0x315d9c));}};Dialer[_0x27dc('0x18')][_0x27dc('0x151')]=function(_0x5c00f7,_0x89cbf3){var _0x2fc48f=this;var _0x3c6d18=[];var _0x168f75=_0x89cbf3>=0x1?_0x89cbf3:0x1;if(_0x5c00f7[_0x27dc('0x14f')]===_0x27dc('0x155')){_0x168f75=0x1;}var _0x40117e=Math[_0x27dc('0x1c8')](_0x5c00f7['available']*_0x168f75)-_0x5c00f7['originated']-_0x5c00f7[_0x27dc('0xbb')];emitVoiceQueueSummary(_0x5c00f7);if(_0x5c00f7[_0x27dc('0x207')]>0x0){var _0x32f76c=_0x5c00f7[_0x27dc('0x207')]-_0x5c00f7[_0x27dc('0x91')]-_0x5c00f7[_0x27dc('0x4d')]-_0x5c00f7[_0x27dc('0xbb')]-_0x5c00f7['pTalking'];if(_0x40117e>_0x32f76c){_0x40117e=_0x32f76c;}}if(_0x40117e>0x0){if(_0x5c00f7[_0x27dc('0x14f')]===_0x27dc('0x155')){_0x40117e=0x1;}if(_0x40117e>this[_0x27dc('0x22')]){_0x40117e=this[_0x27dc('0x22')];}_0x5c00f7[_0x27dc('0xbb')]+=_0x40117e;for(var _0x5a9305 in this[_0x27dc('0x20')]){if(typeof this[_0x27dc('0x20')][_0x5a9305]!==_0x27dc('0x90')){if(this[_0x27dc('0x20')][_0x5a9305][_0x27dc('0x9f')]===_0x27dc('0x208')&&this[_0x27dc('0x20')][_0x5a9305]['status']===_0x27dc('0xd1')){_0x3c6d18['push'](this[_0x27dc('0x20')][_0x5a9305]['id']);}}}this[_0x27dc('0xba')](_0x5c00f7['id'],_0x3c6d18,_0x40117e,_0x5c00f7[_0x27dc('0x1ff')],_0x5c00f7)[_0x27dc('0xb2')](function(_0x20bc7c){_0x5c00f7[_0x27dc('0xbb')]-=_0x40117e;_0x5c00f7[_0x27dc('0xbb')]=_0x5c00f7[_0x27dc('0xbb')]>0x0?_0x5c00f7[_0x27dc('0xbb')]:0x0;if(!checkContactEmpty(_0x20bc7c)){_0x2fc48f[_0x27dc('0xad')](_0x5c00f7)[_0x27dc('0xb2')](sendMessageReschedule(_0x5c00f7))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x5c00f7[_0x27dc('0x91')]+=_0x20bc7c[_0x27dc('0x12b')];_0x5c00f7[_0x27dc('0x38')]=_0x5c00f7[_0x27dc('0x14f')]==='booked'?'ACTIVE':_0x27dc('0x201');for(var _0x28211c=0x0;_0x28211c<_0x20bc7c[_0x27dc('0x12b')];_0x28211c+=0x1){if(_[_0x27dc('0xd3')](_0x20bc7c[_0x28211c])||_[_0x27dc('0xd3')](_0x20bc7c[_0x28211c][_0x27dc('0x165')])||_[_0x27dc('0xd3')](_0x20bc7c[_0x28211c][_0x27dc('0x165')]['phone'])){_0x2fc48f[_0x27dc('0x209')]('[actionOriginate]\x20',_0x5c00f7,_0x20bc7c[_0x28211c]);}else{_0x2fc48f[_0x27dc('0xaf')](_[_0x27dc('0xc8')](_0x20bc7c[_0x28211c],[_0x27dc('0xca'),'Contact.phone']))[_0x27dc('0xb2')](_0x2fc48f['checkContactBlack'](_0x5c00f7,_0x20bc7c[_0x28211c]))['catch'](_0x2fc48f[_0x27dc('0xc4')]('[actionOriginate]\x20',_0x5c00f7));}}}})[_0x27dc('0xa8')](loggerGetContactDialer(_0x27dc('0x20a'),_0x5c00f7,_0x40117e));}};Dialer['prototype'][_0x27dc('0x87')]=function(_0x4bcea1){if(_0x4bcea1[_0x27dc('0x207')]>0x0){var _0x3698a3=_0x4bcea1[_0x27dc('0x207')]-_0x4bcea1['originated']-_0x4bcea1[_0x27dc('0x4d')];if(_0x3698a3>0x0){this[_0x27dc('0x20b')](_0x4bcea1);}else{loggerPredictiveCalls[_0x27dc('0x75')](_0x27dc('0x20c'));}}else{this['tryOriginatePredictive'](_0x4bcea1);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x335ff9){var _0xac59ff=this;var _0x6a25a8=[];_0x335ff9[_0x27dc('0x91')]+=0x1;for(var _0x2f0854 in this[_0x27dc('0x20')]){if(typeof this[_0x27dc('0x20')][_0x2f0854]!==_0x27dc('0x90')){if(this['agents'][_0x2f0854][_0x27dc('0x9f')]===_0x27dc('0x208')&&this[_0x27dc('0x20')][_0x2f0854][_0x27dc('0xd0')]==='reachable'){_0x6a25a8[_0x27dc('0x121')](this[_0x27dc('0x20')][_0x2f0854]['id']);}}}this['getContactDialer'](_0x335ff9['id'],_0x6a25a8,0x1,_0x335ff9[_0x27dc('0x1ff')],_0x335ff9)[_0x27dc('0xb2')](function(_0x1bc181){if(!checkContactEmpty(_0x1bc181)){checkContactLowerLimitOriginate(_0x335ff9,0x1,0x0);_0xac59ff[_0x27dc('0xad')](_0x335ff9)[_0x27dc('0xb2')](sendMessageReschedule(_0x335ff9))[_0x27dc('0xa8')](loggerCatch(_0x27dc('0x20d')));}else{_0x335ff9['message']=_0x27dc('0x201');if(_[_0x27dc('0xd3')](_0x1bc181[0x0])||_[_0x27dc('0xd3')](_0x1bc181[0x0][_0x27dc('0x165')])||_[_0x27dc('0xd3')](_0x1bc181[0x0][_0x27dc('0x165')]['phone'])){_0xac59ff['emptyContact'](_0x27dc('0x203'),_0x335ff9,_0x1bc181[0x0]);}else{_0xac59ff[_0x27dc('0xaf')](_['pick'](_0x1bc181[0x0],[_0x27dc('0xca'),_0x27dc('0x204')]))['then'](_0xac59ff[_0x27dc('0x1e7')](_0x335ff9,_0x1bc181[0x0]))['catch'](_0xac59ff[_0x27dc('0xc4')](_0x27dc('0x20e'),_0x335ff9));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x335ff9,0x1));emitVoiceQueueSummary(_0x335ff9);};Dialer[_0x27dc('0x18')]['abandonmentRate']=function(_0x25bd6a,_0x4d10af,_0x58d7d3,_0x2e39a6,_0x53fdcd,_0x1e6c0d){loggerPredictive[_0x27dc('0x75')](_0x27dc('0x20f'));loggerPredictive[_0x27dc('0x75')](_0x27dc('0x210'),_0x25bd6a);loggerPredictive[_0x27dc('0x75')](_0x27dc('0x211'),_0x4d10af);loggerPredictive[_0x27dc('0x75')](_0x27dc('0x212'),_0x58d7d3);loggerPredictive[_0x27dc('0x75')](_0x27dc('0x213'),_0x2e39a6);loggerPredictive['info'](_0x27dc('0x214'),_0x53fdcd);loggerPredictive[_0x27dc('0x75')]('---------------------------');return new BPromise(function(_0x27aedb,_0x195b07){if(_0x25bd6a<=0x0||isNaN(_0x25bd6a)){return _0x195b07(msgResponse(_0x27dc('0x215'),_0x27dc('0x41'),_0x27dc('0x216')+_0x25bd6a));}if(_0x58d7d3<=0x0||isNaN(_0x58d7d3)){return _0x195b07(msgResponse(_0x27dc('0x215'),_0x27dc('0x41'),_0x27dc('0x217')+_0x58d7d3));}if(_0x2e39a6<=0x0||isNaN(_0x2e39a6)){return _0x195b07(msgResponse(_0x27dc('0x215'),'Error',_0x27dc('0x218')+_0x2e39a6));}if(_0x4d10af<=0x0||isNaN(_0x4d10af)){return _0x195b07(msgResponse(_0x27dc('0x215'),_0x27dc('0x41'),'interval\x20=\x20'+_0x4d10af));}if(_0x53fdcd<=0x0||isNaN(_0x53fdcd)){return _0x195b07(msgResponse(_0x27dc('0x215'),_0x27dc('0x41'),_0x27dc('0x219')+_0x53fdcd));}_0x1e6c0d=_0x1e6c0d||0x0;var _0x1aabc=0x1/_0x58d7d3;var _0x38acfb=0x0;var _0x35ce20=0x0;var _0x1c3e8d=0x0;var _0x21ecfa=0x0;for(var _0x121b64=0x0;_0x1c3e8d<_0x53fdcd;_0x121b64+=0x1){_0x35ce20=_0x121b64/_0x4d10af;_0x38acfb=(_0x2e39a6*_0x35ce20+_0x1e6c0d)/_0x1aabc;_0x1c3e8d=erlangb(_0x38acfb,_0x25bd6a);_0x21ecfa=_0x38acfb/_0x25bd6a*(0x1-erlangb(_0x38acfb,_0x25bd6a));}return _0x27aedb({'erlangCalls':_0x121b64,'erlangCallToSecond':_0x4d10af/_0x121b64,'erlangAbandonmentRate':_0x1c3e8d,'erlangBusyFactor':_0x21ecfa});});};Dialer['prototype']['busyFactor']=function(_0x1e0620,_0x32527e,_0x21c980,_0x34989b,_0x4a1af2,_0x149f5c){loggerPredictive[_0x27dc('0x75')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x27dc('0x75')](_0x27dc('0x210'),_0x1e0620);loggerPredictive[_0x27dc('0x75')](_0x27dc('0x211'),_0x32527e);loggerPredictive['info'](_0x27dc('0x212'),_0x21c980);loggerPredictive[_0x27dc('0x75')](_0x27dc('0x213'),_0x34989b);loggerPredictive['info'](_0x27dc('0x21a'),_0x4a1af2);loggerPredictive[_0x27dc('0x75')]('---------------------------');return new BPromise(function(_0x4b3b5f,_0x246587){if(_0x1e0620<=0x0||isNaN(_0x1e0620)){return _0x246587(msgResponse('[busyFactor]','Error','m\x20=\x20'+_0x1e0620));}if(_0x21c980<=0x0||isNaN(_0x21c980)){return _0x246587(msgResponse(_0x27dc('0x21b'),_0x27dc('0x41'),_0x27dc('0x217')+_0x21c980));}if(_0x34989b<=0x0||isNaN(_0x34989b)){return _0x246587(msgResponse(_0x27dc('0x21b'),_0x27dc('0x41'),_0x27dc('0x218')+_0x34989b));}if(_0x32527e<=0x0||isNaN(_0x32527e)){return _0x246587(msgResponse('[busyFactor]',_0x27dc('0x41'),'interval\x20=\x20'+_0x32527e));}if(_0x4a1af2<=0x0||isNaN(_0x4a1af2)){return _0x246587(msgResponse(_0x27dc('0x21b'),_0x27dc('0x41'),_0x27dc('0x21c')+_0x4a1af2));}_0x149f5c=_0x149f5c||0x0;var _0x30c67f=0x1/_0x21c980;var _0x3be92f=0x0;var _0x36e3f8=0x0;var _0x4e07f8=0x0;var _0x116f0f=0x0;for(var _0x220c56=0x0;_0x116f0f<_0x4a1af2;_0x220c56+=0x1){_0x36e3f8=_0x220c56/_0x32527e;_0x3be92f=(_0x34989b*_0x36e3f8+_0x149f5c)/_0x30c67f;_0x4e07f8=erlangb(_0x3be92f,_0x1e0620);_0x116f0f=_0x3be92f/_0x1e0620*(0x1-erlangb(_0x3be92f,_0x1e0620));}return _0x4b3b5f({'erlangCalls':_0x220c56,'erlangCallToSecond':_0x32527e/_0x220c56,'erlangAbandonmentRate':_0x4e07f8,'erlangBusyFactor':_0x116f0f});});};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 0bd095b..3bae744 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 _0xda3a=['number','starttime','responsetime','droptime','endtime','ringtime','talktime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','calleridnum'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda3a,0xab));var _0xada3=function(_0x2723ed,_0x18877c){_0x2723ed=_0x2723ed-0x0;var _0x47ee53=_0xda3a[_0x2723ed];return _0x47ee53;};'use strict';var util=require(_0xada3('0x0'));var _=require('lodash');var moment=require(_0xada3('0x1'));function getSeconds(_0x12cb26,_0x36612c){var _0x4b1fee=moment(_0x12cb26)['milliseconds'](0x0);var _0x4b1c24=moment(_0x36612c)['milliseconds'](0x0);return _0x4b1fee[_0xada3('0x2')](_0x4b1c24,'seconds');}function QueueCallerAbandon(_0x11ce4d,_0x40fc88){this[_0xada3('0x3')]=_0x11ce4d['scheduledat'];this[_0xada3('0x4')]=_0x11ce4d['type'];this[_0xada3('0x5')]=_0x11ce4d['type']===_0xada3('0x6')?_0xada3('0x7'):_0x11ce4d[_0xada3('0x4')];this['countbusyretry']=_0x11ce4d[_0xada3('0x8')];this[_0xada3('0x9')]=_0x11ce4d[_0xada3('0x9')];this[_0xada3('0xa')]=_0x11ce4d[_0xada3('0xa')];this['countglobal']=_0x11ce4d[_0xada3('0x8')]+_0x11ce4d[_0xada3('0x9')]+_0x11ce4d['countnoanswerretry']+_0x11ce4d[_0xada3('0xb')]+_0x11ce4d[_0xada3('0xc')]+_0x11ce4d['countabandonedretry']+_0x11ce4d[_0xada3('0xd')]+_0x11ce4d[_0xada3('0xe')];this[_0xada3('0xb')]=_0x11ce4d[_0xada3('0xb')];this[_0xada3('0xc')]=_0x11ce4d['countdropretry'];this[_0xada3('0xf')]=_0x11ce4d[_0xada3('0xf')];this[_0xada3('0xd')]=_0x11ce4d['countmachineretry'];this[_0xada3('0xe')]=_0x11ce4d[_0xada3('0xe')];this[_0xada3('0x10')]=_0x40fc88[_0xada3('0x10')];this[_0xada3('0x11')]=_0x11ce4d['name'];this[_0xada3('0x12')]=_0x11ce4d[_0xada3('0x13')];this[_0xada3('0x14')]=_0x11ce4d[_0xada3('0x14')];this[_0xada3('0x15')]=_0x11ce4d[_0xada3('0x15')];this[_0xada3('0x16')]=_0x11ce4d[_0xada3('0x16')];this[_0xada3('0x17')]=this[_0xada3('0x16')];this[_0xada3('0x18')]=getSeconds(_0x11ce4d[_0xada3('0x15')],_0x11ce4d['starttime']);this['holdtime']=getSeconds(this['droptime'],_0x11ce4d['responsetime']);this[_0xada3('0x19')]=0x0;this[_0xada3('0x7')]=_0x40fc88[_0xada3('0x7')];this[_0xada3('0x1a')]=_0x40fc88['connectedlinename'];this['reason']=_0x40fc88[_0xada3('0x1b')];this[_0xada3('0x1c')]=_0x11ce4d[_0xada3('0x1c')];this[_0xada3('0x1d')]=_0x11ce4d[_0xada3('0x1d')];this['callbackat']=_0x11ce4d['callbackat'];this['recallme']=_0x11ce4d[_0xada3('0x1e')];this[_0xada3('0x1f')]=_0x11ce4d[_0xada3('0x1f')];this[_0xada3('0x20')]=_0x11ce4d['ListId'];this[_0xada3('0x21')]=_0x11ce4d[_0xada3('0x21')];this[_0xada3('0x22')]=_0x11ce4d[_0xada3('0x22')];this[_0xada3('0x23')]=_0x11ce4d[_0xada3('0x23')];this[_0xada3('0x24')]=_0x11ce4d[_0xada3('0x24')]||'';this['originatecalleridname']=_0x11ce4d[_0xada3('0x25')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x845a=['talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','holdtime','droptime'];(function(_0x235bce,_0x516860){var _0x1bbc9a=function(_0x1dbb36){while(--_0x1dbb36){_0x235bce['push'](_0x235bce['shift']());}};_0x1bbc9a(++_0x516860);}(_0x845a,0x1d2));var _0xa845=function(_0xfafc6e,_0x320b2f){_0xfafc6e=_0xfafc6e-0x0;var _0x3c3766=_0x845a[_0xfafc6e];return _0x3c3766;};'use strict';var util=require(_0xa845('0x0'));var _=require(_0xa845('0x1'));var moment=require(_0xa845('0x2'));function getSeconds(_0x261d6b,_0x132615){var _0x621191=moment(_0x261d6b)[_0xa845('0x3')](0x0);var _0x57e6a2=moment(_0x132615)[_0xa845('0x3')](0x0);return _0x621191[_0xa845('0x4')](_0x57e6a2,_0xa845('0x5'));}function QueueCallerAbandon(_0x5eaea2,_0x19061b){this['scheduledat']=_0x5eaea2['scheduledat'];this[_0xa845('0x6')]=_0x5eaea2[_0xa845('0x6')];this[_0xa845('0x7')]=_0x5eaea2[_0xa845('0x6')]===_0xa845('0x8')?_0xa845('0x9'):_0x5eaea2[_0xa845('0x6')];this[_0xa845('0xa')]=_0x5eaea2['countbusyretry'];this[_0xa845('0xb')]=_0x5eaea2['countcongestionretry'];this[_0xa845('0xc')]=_0x5eaea2['countnoanswerretry'];this['countglobal']=_0x5eaea2[_0xa845('0xa')]+_0x5eaea2[_0xa845('0xb')]+_0x5eaea2[_0xa845('0xc')]+_0x5eaea2[_0xa845('0xd')]+_0x5eaea2['countdropretry']+_0x5eaea2[_0xa845('0xe')]+_0x5eaea2[_0xa845('0xf')]+_0x5eaea2['countagentrejectretry'];this[_0xa845('0xd')]=_0x5eaea2['countnosuchnumberretry'];this[_0xa845('0x10')]=_0x5eaea2[_0xa845('0x10')];this[_0xa845('0xe')]=_0x5eaea2[_0xa845('0xe')];this[_0xa845('0xf')]=_0x5eaea2[_0xa845('0xf')];this[_0xa845('0x11')]=_0x5eaea2[_0xa845('0x11')];this[_0xa845('0x12')]=_0x19061b[_0xa845('0x12')];this['calleridname']=_0x5eaea2[_0xa845('0x13')];this[_0xa845('0x14')]=_0x5eaea2[_0xa845('0x15')];this[_0xa845('0x16')]=_0x5eaea2['starttime'];this[_0xa845('0x17')]=_0x5eaea2[_0xa845('0x17')];this['droptime']=_0x5eaea2['droptime'];this['endtime']=this['droptime'];this['ringtime']=getSeconds(_0x5eaea2[_0xa845('0x17')],_0x5eaea2[_0xa845('0x16')]);this[_0xa845('0x18')]=getSeconds(this[_0xa845('0x19')],_0x5eaea2[_0xa845('0x17')]);this[_0xa845('0x1a')]=0x0;this[_0xa845('0x9')]=_0x19061b[_0xa845('0x9')];this[_0xa845('0x1b')]=_0x19061b['connectedlinename'];this[_0xa845('0x1c')]=_0x19061b[_0xa845('0x1c')];this[_0xa845('0x1d')]=_0x5eaea2[_0xa845('0x1d')];this['callbackuniqueid']=_0x5eaea2[_0xa845('0x1e')];this[_0xa845('0x1f')]=_0x5eaea2[_0xa845('0x1f')];this[_0xa845('0x20')]=_0x5eaea2['recallme'];this[_0xa845('0x21')]=_0x5eaea2[_0xa845('0x21')];this[_0xa845('0x22')]=_0x5eaea2['ListId'];this[_0xa845('0x23')]=_0x5eaea2[_0xa845('0x23')];this[_0xa845('0x24')]=_0x5eaea2[_0xa845('0x24')];this[_0xa845('0x25')]=_0x5eaea2[_0xa845('0x25')];this['originatecalleridnum']=_0x5eaea2[_0xa845('0x26')]||'';this[_0xa845('0x27')]=_0x5eaea2[_0xa845('0x27')]||'';}module[_0xa845('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index a0a3c4c..b47acaf 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(_0x2b3956,_0x586f67){var _0x465b48=function(_0x57dae1){while(--_0x57dae1){_0x2b3956['push'](_0x2b3956['shift']());}};_0x465b48(++_0x586f67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x7ee44,_0x2e0bdf){var _0x184617=function(_0x51f8a4){while(--_0x51f8a4){_0x7ee44['push'](_0x7ee44['shift']());}};_0x184617(++_0x2e0bdf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 5bac88d..531492c 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 _0x4fbb=['uuid','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./channel','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','bind','varset','newstate','syncNewState','newexten','faxstatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','syncVarSet','variable','value','channelstate','channelstatedesc','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','create','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','stringify','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','message','Fax\x20failed','checkAfterSend','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','checkTrunk','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','bluebird'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0x4fbb,0x6b));var _0xb4fb=function(_0x3fa1d8,_0x1f5bb3){_0x3fa1d8=_0x3fa1d8-0x0;var _0x266d52=_0x4fbb[_0x3fa1d8];return _0x266d52;};'use strict';var util=require(_0xb4fb('0x0'));var _=require('lodash');var BPromise=require(_0xb4fb('0x1'));var uuid=require(_0xb4fb('0x2'));var moment=require(_0xb4fb('0x3'));var path=require(_0xb4fb('0x4'));var tiff2pdf=require(_0xb4fb('0x5'));var gs=require('./util/gs');var logger=require(_0xb4fb('0x6'))(_0xb4fb('0x7'));var ami=require(_0xb4fb('0x8'));var rpcDb=require('./rpcDb');var Channel=require(_0xb4fb('0x9'));var ut=require('./util/util');var Action=require(_0xb4fb('0xa'));var faxAccount=require(_0xb4fb('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require(_0xb4fb('0xc'));function Fax(_0x53b098){this[_0xb4fb('0xd')]={};this[_0xb4fb('0xe')]=_0x53b098['faxAccounts'];this[_0xb4fb('0xf')]=_0x53b098[_0xb4fb('0xf')];this[_0xb4fb('0x10')]={};ami['on']('newchannel',this[_0xb4fb('0x11')][_0xb4fb('0x12')](this));ami['on'](_0xb4fb('0x13'),this['syncVarSet'][_0xb4fb('0x12')](this));ami['on'](_0xb4fb('0x14'),this[_0xb4fb('0x15')][_0xb4fb('0x12')](this));ami['on'](_0xb4fb('0x16'),this['syncNewExten']['bind'](this));ami['on'](_0xb4fb('0x17'),this['syncFaxStatus']['bind'](this));ami['on']('receivefax',this[_0xb4fb('0x18')][_0xb4fb('0x12')](this));ami['on'](_0xb4fb('0x19'),this[_0xb4fb('0x1a')][_0xb4fb('0x12')](this));ami['on'](_0xb4fb('0x1b'),this[_0xb4fb('0x1c')]['bind'](this));}Fax['prototype']['syncNewchannel']=function(_0x1fae20){if(_0x1fae20[_0xb4fb('0x1d')]===_0xb4fb('0x1e')){for(var _0x147fb4 in this[_0xb4fb('0xe')]){if(this['faxAccounts'][_0xb4fb('0x1f')](_0x147fb4)){if(_0x1fae20[_0xb4fb('0x20')]===this[_0xb4fb('0xe')][_0x147fb4][_0xb4fb('0x21')]){this[_0xb4fb('0xd')][_0x1fae20[_0xb4fb('0x22')]]={};this[_0xb4fb('0xd')][_0x1fae20[_0xb4fb('0x22')]][_0xb4fb('0x23')]=_0x1fae20[_0xb4fb('0x23')];this[_0xb4fb('0xd')][_0x1fae20['uniqueid']]['id']=this[_0xb4fb('0xe')][_0x147fb4]['id'];this[_0xb4fb('0xd')][_0x1fae20[_0xb4fb('0x22')]][_0xb4fb('0x24')]=this[_0xb4fb('0xe')][_0x147fb4][_0xb4fb('0x24')];logger[_0xb4fb('0x25')](_0x1fae20[_0xb4fb('0x22')],_0xb4fb('0x26'));}}}}if(this['actions'][_0x1fae20[_0xb4fb('0x22')]]){this[_0xb4fb('0xd')][_0x1fae20[_0xb4fb('0x22')]]={};this[_0xb4fb('0xd')][_0x1fae20[_0xb4fb('0x22')]][_0xb4fb('0x23')]=_0x1fae20[_0xb4fb('0x23')];logger[_0xb4fb('0x25')](_0x1fae20[_0xb4fb('0x22')],_0xb4fb('0x26'));}};Fax[_0xb4fb('0x27')][_0xb4fb('0x28')]=function(_0x45c38b){if(this[_0xb4fb('0xd')][_0x45c38b[_0xb4fb('0x22')]]){for(var _0x59977f in _0x45c38b[_0xb4fb('0x29')]){if(_0x45c38b[_0xb4fb('0x29')][_0xb4fb('0x1f')](_0x59977f)){this['channels'][_0x45c38b['uniqueid']][_0x59977f]=_0x45c38b[_0xb4fb('0x2a')];}}}};Fax[_0xb4fb('0x27')]['syncNewState']=function(_0x495442){if(this['channels'][_0x495442['uniqueid']]){this['channels'][_0x495442[_0xb4fb('0x22')]][_0xb4fb('0x2b')]=_0x495442[_0xb4fb('0x2b')];this[_0xb4fb('0xd')][_0x495442[_0xb4fb('0x22')]][_0xb4fb('0x2c')]=_0x495442[_0xb4fb('0x2c')];}};Fax[_0xb4fb('0x27')]['syncNewExten']=function(_0x53bd04){if(this[_0xb4fb('0xd')][_0x53bd04[_0xb4fb('0x22')]]){for(var _0x12fabf in _0x53bd04[_0xb4fb('0x29')]){if(_0x53bd04[_0xb4fb('0x29')]['hasOwnProperty'](_0x12fabf)){this[_0xb4fb('0xd')][_0x53bd04['uniqueid']][_0x12fabf]=_0x53bd04[_0xb4fb('0x2a')];}}}};Fax[_0xb4fb('0x27')]['syncFaxStatus']=function(_0x411632){if(this[_0xb4fb('0xd')][_0x411632[_0xb4fb('0x22')]]){this['channels'][_0x411632[_0xb4fb('0x22')]]['operation']=_0x411632[_0xb4fb('0x2d')];this[_0xb4fb('0xd')][_0x411632[_0xb4fb('0x22')]][_0xb4fb('0x2e')]=_0x411632['status'];this['channels'][_0x411632[_0xb4fb('0x22')]][_0xb4fb('0x21')]=_0x411632[_0xb4fb('0x21')];this[_0xb4fb('0xd')][_0x411632[_0xb4fb('0x22')]]['filename']=_0x411632[_0xb4fb('0x2f')];logger[_0xb4fb('0x25')](_0x411632[_0xb4fb('0x22')],'\x20syncFaxStatus\x20');}};Fax[_0xb4fb('0x27')][_0xb4fb('0x18')]=function(_0xd62515){var _0xbd436d=this;if(this['channels'][_0xd62515['uniqueid']]){var _0x5136b9=this[_0xb4fb('0xd')][_0xd62515[_0xb4fb('0x22')]]['id'];this['channels'][_0xd62515['uniqueid']][_0xb4fb('0x30')]=_0xd62515[_0xb4fb('0x30')];this[_0xb4fb('0xd')][_0xd62515[_0xb4fb('0x22')]][_0xb4fb('0x31')]=_0xd62515['pagestransferred'];this[_0xb4fb('0xd')][_0xd62515[_0xb4fb('0x22')]][_0xb4fb('0x21')]=_0xd62515[_0xb4fb('0x21')];this['channels'][_0xd62515[_0xb4fb('0x22')]][_0xb4fb('0x32')]=_0xd62515[_0xb4fb('0x32')];this[_0xb4fb('0xd')][_0xd62515[_0xb4fb('0x22')]][_0xb4fb('0x33')]=_0xd62515[_0xb4fb('0x33')];this[_0xb4fb('0xd')][_0xd62515[_0xb4fb('0x22')]][_0xb4fb('0x2f')]=_0xd62515[_0xb4fb('0x2f')];this[_0xb4fb('0xd')][_0xd62515[_0xb4fb('0x22')]][_0xb4fb('0x34')]=_0xd62515[_0xb4fb('0x34')];if(this['channels'][_0xd62515[_0xb4fb('0x22')]][_0xb4fb('0x31')]>0x0){tiff2pdf(_0xd62515['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x58adf0){logger[_0xb4fb('0x25')](_0xd62515[_0xb4fb('0x22')],'\x20result\x20conversion\x20file\x20',_0x58adf0['message']);attachment[_0xb4fb('0x35')]({'name':path[_0xb4fb('0x36')](_0xd62515[_0xb4fb('0x2f')])[_0xb4fb('0x24')],'basename':path[_0xb4fb('0x36')](_0xd62515['filename'])[_0xb4fb('0x24')]+_0xb4fb('0x37'),'type':_0xb4fb('0x38')})[_0xb4fb('0x39')](function(_0x1b9345){faxAccount['notify'](_0x5136b9,{'from':_0xd62515['calleridnum'],'mapKey':_0xb4fb('0x7'),'body':path[_0xb4fb('0x36')](_0xd62515['filename'])[_0xb4fb('0x24')]+_0xb4fb('0x37'),'AttachmentId':_0x1b9345['id']})[_0xb4fb('0x3a')](function(_0x5bcd5f){logger[_0xb4fb('0x3b')](_0xd62515[_0xb4fb('0x22')],_0xb4fb('0x3c'),JSON[_0xb4fb('0x3d')](_0x5bcd5f));});})['catch'](function(_0xf3996b){logger[_0xb4fb('0x3b')](_0xd62515['uniqueid'],'\x20receiveFax\x20',JSON[_0xb4fb('0x3d')](_0xf3996b));});});}logger[_0xb4fb('0x25')](_0xd62515[_0xb4fb('0x22')],'\x20receiveFax\x20');}};Fax[_0xb4fb('0x27')]['syncOriginateResponse']=function(_0x1d223a){if(this['actions'][_0x1d223a[_0xb4fb('0x22')]]){_['merge'](this[_0xb4fb('0xd')][_0x1d223a[_0xb4fb('0x22')]],_[_0xb4fb('0x3e')](_0x1d223a,[_0xb4fb('0x3f'),_0xb4fb('0x40')]));}};function updateStatus(_0xad1bb0){if(_0xad1bb0[_0xb4fb('0x41')]){faxMessage['update'](_0xad1bb0[_0xb4fb('0x41')],{'failMessage':_0xb4fb('0x42')})[_0xb4fb('0x39')](function(_0x28b2f9){ut['logger']('[Fax][Message][Error][Updated]',_0x28b2f9);})[_0xb4fb('0x3a')](function(_0xed19c4){ut[_0xb4fb('0x43')](_0xb4fb('0x44'),_0xed19c4);});}else{ut['logger'](_0xb4fb('0x45'));}}Fax[_0xb4fb('0x27')][_0xb4fb('0x46')]=function(_0x163ca1,_0x335498,_0x1d221f){var _0x3d0f75=this;var _0x555f9f={};if(_0x335498){_0x555f9f={'read':_0x335498};}else{_0x555f9f={'failMessage':_0x1d221f};}if(this[_0xb4fb('0x10')][_0x163ca1][_0xb4fb('0x41')]){faxMessage['update'](this['actions'][_0x163ca1][_0xb4fb('0x41')],_0x555f9f)[_0xb4fb('0x39')](function(_0x451c35){ut['logger']('[Fax][Message][Updated]',_0x451c35);})['catch'](function(_0x26027f){ut[_0xb4fb('0x43')](_0xb4fb('0x47'),_0x26027f);})['finally'](function(){delete _0x3d0f75[_0xb4fb('0xd')][_0x163ca1];delete _0x3d0f75['actions'][_0x163ca1];});}else{ut[_0xb4fb('0x43')]('[Fax][Message][NoUpdate2]');delete this[_0xb4fb('0xd')][_0x163ca1];delete this[_0xb4fb('0x10')][_0x163ca1];}};Fax[_0xb4fb('0x27')]['syncHangup']=function(_0x571a36){var _0x2cdddf=this;if(this[_0xb4fb('0xd')][_0x571a36[_0xb4fb('0x22')]]){if(this['actions'][_0x571a36['uniqueid']]){this['channels'][_0x571a36['uniqueid']]['id']=this[_0xb4fb('0x10')][_0x571a36[_0xb4fb('0x22')]]['id'];this[_0xb4fb('0xd')][_0x571a36[_0xb4fb('0x22')]][_0xb4fb('0x24')]=this[_0xb4fb('0x10')][_0x571a36[_0xb4fb('0x22')]][_0xb4fb('0x24')];}logger['info'](_0x571a36['uniqueid'],this[_0xb4fb('0x10')][_0x571a36[_0xb4fb('0x22')]]?_0xb4fb('0x48'):'\x20hangup\x20faxRiceive\x20',JSON[_0xb4fb('0x3d')](this[_0xb4fb('0xd')][_0x571a36['uniqueid']]));if(this[_0xb4fb('0x10')][_0x571a36[_0xb4fb('0x22')]]){if(this[_0xb4fb('0xd')][_0x571a36[_0xb4fb('0x22')]][_0xb4fb('0x49')]>0x0&&this[_0xb4fb('0xd')][_0x571a36[_0xb4fb('0x22')]][_0xb4fb('0x17')]===_0xb4fb('0x4a')){this['updateStatus'](_0x571a36['uniqueid'],!![]);}else{this['updateStatus'](_0x571a36[_0xb4fb('0x22')],![],this[_0xb4fb('0xd')][_0x571a36[_0xb4fb('0x22')]][_0xb4fb('0x4b')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x571a36[_0xb4fb('0x22')]]['faxstatusstring']:_0xb4fb('0x4c'));}}}};Fax[_0xb4fb('0x27')]['send']=function(_0x2cda22){var _0x4867a9=this;return new BPromise(function(_0xe9b361,_0x28f4b2){_0x4867a9[_0xb4fb('0x4d')](_0x2cda22,_0x4867a9[_0xb4fb('0xe')][_0x2cda22[_0xb4fb('0x4e')]])[_0xb4fb('0x39')](function(_0x5caf23){ut[_0xb4fb('0x43')](_0xb4fb('0x4f'),_0x5caf23);_0xe9b361(ut['message'](_0xb4fb('0x50')));})['catch'](function(_0x2d54a3){ut[_0xb4fb('0x43')](_0xb4fb('0x51'),_0x2d54a3);updateStatus(_0x2cda22);_0x28f4b2(ut[_0xb4fb('0x52')](_0xb4fb('0x53')));});});};Fax[_0xb4fb('0x27')][_0xb4fb('0x54')]=function(_0x3b55ec){var _0x30eb50=this;return new BPromise(function(_0x1e903f,_0x3a18ba){var _0x5b85fe=_0x30eb50['checkTrunk'](_0x30eb50[_0xb4fb('0xe')][_0x3b55ec[_0xb4fb('0x4e')]]['Trunk'],_0x3b55ec);if(_0x5b85fe[_0xb4fb('0x55')]){_0x1e903f(ut[_0xb4fb('0x52')](_0xb4fb('0x56')));}else{_0x3a18ba(ut[_0xb4fb('0x52')](_0x5b85fe[_0xb4fb('0x52')]));}});};function originate(_0x37a17e,_0x4757d1,_0x156dbc){return new BPromise(function(_0x35fc67,_0x375b41){if(_0x156dbc){var _0x4a7fc2=util[_0xb4fb('0x57')](_0xb4fb('0x58'),path[_0xb4fb('0x36')](_0x37a17e[_0xb4fb('0x4')])[_0xb4fb('0x24')],_0x37a17e[_0xb4fb('0x4')]);gs[_0xb4fb('0x59')](_0x4a7fc2)['then'](function(){_0x37a17e['path']=util[_0xb4fb('0x57')](_0xb4fb('0x5a'),path[_0xb4fb('0x36')](_0x37a17e[_0xb4fb('0x4')])[_0xb4fb('0x5b')],path[_0xb4fb('0x36')](_0x37a17e[_0xb4fb('0x4')])['name']);_0x4757d1[_0xb4fb('0x5c')]=_0x37a17e[_0xb4fb('0x4')];ut[_0xb4fb('0x43')](_0xb4fb('0x5d'),'');ami[_0xb4fb('0x5e')](ut[_0xb4fb('0x5f')](_0x37a17e,_0x4757d1))['then'](function(_0x6e062a){_0x35fc67(_0x6e062a);})['catch'](function(_0x351052){_0x375b41(_0x351052);});})[_0xb4fb('0x3a')](function(_0xea5bb9){_0x375b41(_0xea5bb9);});}else{ami[_0xb4fb('0x5e')](ut[_0xb4fb('0x5f')](_0x37a17e,_0x4757d1))['then'](function(_0x5729b3){_0x35fc67(_0x5729b3);})[_0xb4fb('0x3a')](function(_0x12a4e4){_0x375b41(_0x12a4e4);});}});}Fax[_0xb4fb('0x27')][_0xb4fb('0x4d')]=function(_0x256b00,_0x3305d2){var _0x8c3f52=this;return new BPromise(function(_0x28e89d,_0x5dcab7){var _0x311556=uuid['v4']();var _0x108b1d=ut[_0xb4fb('0x60')](_0x256b00,_0x3305d2);_0x8c3f52[_0xb4fb('0x10')][_0x311556]=new Action(_0x311556,_0x3305d2,_0x256b00);var _0x413871=_0x8c3f52[_0xb4fb('0x10')][_0x311556];if(path['parse'](_0x256b00[_0xb4fb('0x4')])[_0xb4fb('0x61')]===_0xb4fb('0x37')){originate(_0x413871,_0x108b1d,!![])['then'](function(_0x42b852){_0x28e89d(_0x42b852);})[_0xb4fb('0x3a')](function(_0x24fdc0){_0x5dcab7(_0x24fdc0);});}else{originate(_0x413871,_0x108b1d,![])[_0xb4fb('0x39')](function(_0x155c0d){_0x28e89d(_0x155c0d);})['catch'](function(_0x2490fe){_0x5dcab7(_0x2490fe);});}});};Fax['prototype'][_0xb4fb('0x62')]=function(_0x4fae94){return!_['isNil'](_0x4fae94)&&!_[_0xb4fb('0x63')](_0x4fae94[_0xb4fb('0x24')])&&!_[_0xb4fb('0x63')](_0x4fae94[_0xb4fb('0x64')])&&_0x4fae94['active']&&!_[_0xb4fb('0x63')](this['trunks'][util[_0xb4fb('0x57')](_0xb4fb('0x65'),_0x4fae94['name'])])&&!_[_0xb4fb('0x63')](this[_0xb4fb('0xf')][util[_0xb4fb('0x57')](_0xb4fb('0x65'),_0x4fae94[_0xb4fb('0x24')])]['status'])&&(this[_0xb4fb('0xf')][util[_0xb4fb('0x57')]('SIP/%s',_0x4fae94[_0xb4fb('0x24')])][_0xb4fb('0x2e')]==='reachable'||this[_0xb4fb('0xf')][util[_0xb4fb('0x57')](_0xb4fb('0x65'),_0x4fae94[_0xb4fb('0x24')])][_0xb4fb('0x2e')]==='unmonitored');};Fax[_0xb4fb('0x27')][_0xb4fb('0x66')]=function(_0x5b3681,_0x49f25a){if(!this[_0xb4fb('0x62')](_0x5b3681)){ut[_0xb4fb('0x43')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_['isNil'](_0x5b3681)?'':_0x5b3681[_0xb4fb('0x24')]+_0xb4fb('0x67'));return{'isValid':![],'message':_0xb4fb('0x68')};}if(_[_0xb4fb('0x63')](_0x49f25a[_0xb4fb('0x7')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xb4fb('0x3d')](_0x49f25a));return{'isValid':![],'message':_0xb4fb('0x69')};}if(_[_0xb4fb('0x63')](_0x49f25a[_0xb4fb('0x4')])){ut[_0xb4fb('0x43')](_0xb4fb('0x6a'),JSON[_0xb4fb('0x3d')](_0x49f25a));return{'isValid':![],'message':_0xb4fb('0x6b')};}return{'isValid':!![],'message':_0xb4fb('0x6c')};};module['exports']=Fax; \ No newline at end of file +var _0xbc04=['Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','tiff2pdf','../../../config/logger','fax','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','filename','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','name','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','actions','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','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','path','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','.pdf','isTrunkReachable','isNil','active','SIP/%s','unmonitored','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]'];(function(_0xb591e,_0x268858){var _0x1c386d=function(_0x39d39a){while(--_0x39d39a){_0xb591e['push'](_0xb591e['shift']());}};_0x1c386d(++_0x268858);}(_0xbc04,0x7e));var _0x4bc0=function(_0x1a4465,_0x4b15bb){_0x1a4465=_0x1a4465-0x0;var _0x3282ae=_0xbc04[_0x1a4465];return _0x3282ae;};'use strict';var util=require(_0x4bc0('0x0'));var _=require(_0x4bc0('0x1'));var BPromise=require(_0x4bc0('0x2'));var uuid=require(_0x4bc0('0x3'));var moment=require(_0x4bc0('0x4'));var path=require('path');var tiff2pdf=require(_0x4bc0('0x5'));var gs=require('./util/gs');var logger=require(_0x4bc0('0x6'))(_0x4bc0('0x7'));var ami=require('../ami');var rpcDb=require(_0x4bc0('0x8'));var Channel=require(_0x4bc0('0x9'));var ut=require('./util/util');var Action=require(_0x4bc0('0xa'));var faxAccount=require(_0x4bc0('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x4bc0('0xc'));function Fax(_0x10bec5){this['channels']={};this[_0x4bc0('0xd')]=_0x10bec5['faxAccounts'];this[_0x4bc0('0xe')]=_0x10bec5[_0x4bc0('0xe')];this['actions']={};ami['on']('newchannel',this[_0x4bc0('0xf')][_0x4bc0('0x10')](this));ami['on'](_0x4bc0('0x11'),this[_0x4bc0('0x12')][_0x4bc0('0x10')](this));ami['on'](_0x4bc0('0x13'),this[_0x4bc0('0x14')]['bind'](this));ami['on'](_0x4bc0('0x15'),this[_0x4bc0('0x16')]['bind'](this));ami['on'](_0x4bc0('0x17'),this[_0x4bc0('0x18')]['bind'](this));ami['on'](_0x4bc0('0x19'),this[_0x4bc0('0x1a')][_0x4bc0('0x10')](this));ami['on'](_0x4bc0('0x1b'),this['syncHangup'][_0x4bc0('0x10')](this));ami['on'](_0x4bc0('0x1c'),this[_0x4bc0('0x1d')]['bind'](this));}Fax[_0x4bc0('0x1e')][_0x4bc0('0xf')]=function(_0x17a456){if(_0x17a456[_0x4bc0('0x1f')]==='from-voip-provider'){for(var _0xa9826b in this[_0x4bc0('0xd')]){if(this[_0x4bc0('0xd')][_0x4bc0('0x20')](_0xa9826b)){if(_0x17a456[_0x4bc0('0x21')]===this[_0x4bc0('0xd')][_0xa9826b][_0x4bc0('0x22')]){this[_0x4bc0('0x23')][_0x17a456[_0x4bc0('0x24')]]={};this['channels'][_0x17a456[_0x4bc0('0x24')]][_0x4bc0('0x25')]=_0x17a456[_0x4bc0('0x25')];this['channels'][_0x17a456['uniqueid']]['id']=this[_0x4bc0('0xd')][_0xa9826b]['id'];this['channels'][_0x17a456[_0x4bc0('0x24')]]['name']=this[_0x4bc0('0xd')][_0xa9826b]['name'];logger[_0x4bc0('0x26')](_0x17a456[_0x4bc0('0x24')],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x17a456[_0x4bc0('0x24')]]){this['channels'][_0x17a456['uniqueid']]={};this[_0x4bc0('0x23')][_0x17a456[_0x4bc0('0x24')]][_0x4bc0('0x25')]=_0x17a456[_0x4bc0('0x25')];logger[_0x4bc0('0x26')](_0x17a456['uniqueid'],_0x4bc0('0x27'));}};Fax[_0x4bc0('0x1e')]['syncVarSet']=function(_0x10aece){if(this[_0x4bc0('0x23')][_0x10aece[_0x4bc0('0x24')]]){for(var _0x129e94 in _0x10aece['variable']){if(_0x10aece[_0x4bc0('0x28')]['hasOwnProperty'](_0x129e94)){this[_0x4bc0('0x23')][_0x10aece[_0x4bc0('0x24')]][_0x129e94]=_0x10aece[_0x4bc0('0x29')];}}}};Fax['prototype'][_0x4bc0('0x14')]=function(_0x3943a0){if(this[_0x4bc0('0x23')][_0x3943a0[_0x4bc0('0x24')]]){this[_0x4bc0('0x23')][_0x3943a0[_0x4bc0('0x24')]][_0x4bc0('0x2a')]=_0x3943a0[_0x4bc0('0x2a')];this[_0x4bc0('0x23')][_0x3943a0[_0x4bc0('0x24')]]['channelstatedesc']=_0x3943a0[_0x4bc0('0x2b')];}};Fax['prototype'][_0x4bc0('0x16')]=function(_0x10ff57){if(this[_0x4bc0('0x23')][_0x10ff57[_0x4bc0('0x24')]]){for(var _0x2800ee in _0x10ff57[_0x4bc0('0x28')]){if(_0x10ff57[_0x4bc0('0x28')][_0x4bc0('0x20')](_0x2800ee)){this['channels'][_0x10ff57['uniqueid']][_0x2800ee]=_0x10ff57[_0x4bc0('0x29')];}}}};Fax['prototype'][_0x4bc0('0x18')]=function(_0x302ab9){if(this['channels'][_0x302ab9[_0x4bc0('0x24')]]){this[_0x4bc0('0x23')][_0x302ab9['uniqueid']][_0x4bc0('0x2c')]=_0x302ab9[_0x4bc0('0x2c')];this[_0x4bc0('0x23')][_0x302ab9['uniqueid']][_0x4bc0('0x2d')]=_0x302ab9[_0x4bc0('0x2d')];this[_0x4bc0('0x23')][_0x302ab9[_0x4bc0('0x24')]]['localstationid']=_0x302ab9[_0x4bc0('0x22')];this[_0x4bc0('0x23')][_0x302ab9['uniqueid']]['filename']=_0x302ab9['filename'];logger['info'](_0x302ab9[_0x4bc0('0x24')],_0x4bc0('0x2e'));}};Fax['prototype'][_0x4bc0('0x1a')]=function(_0x1e44b0){var _0x1ee06c=this;if(this[_0x4bc0('0x23')][_0x1e44b0[_0x4bc0('0x24')]]){var _0x15d3ac=this['channels'][_0x1e44b0['uniqueid']]['id'];this[_0x4bc0('0x23')][_0x1e44b0[_0x4bc0('0x24')]][_0x4bc0('0x2f')]=_0x1e44b0[_0x4bc0('0x2f')];this[_0x4bc0('0x23')][_0x1e44b0['uniqueid']][_0x4bc0('0x30')]=_0x1e44b0['pagestransferred'];this['channels'][_0x1e44b0['uniqueid']][_0x4bc0('0x22')]=_0x1e44b0['localstationid'];this[_0x4bc0('0x23')][_0x1e44b0[_0x4bc0('0x24')]][_0x4bc0('0x31')]=_0x1e44b0['resolution'];this['channels'][_0x1e44b0['uniqueid']][_0x4bc0('0x32')]=_0x1e44b0['transferrate'];this['channels'][_0x1e44b0['uniqueid']][_0x4bc0('0x33')]=_0x1e44b0[_0x4bc0('0x33')];this[_0x4bc0('0x23')][_0x1e44b0[_0x4bc0('0x24')]]['calleridnum']=_0x1e44b0[_0x4bc0('0x34')];if(this[_0x4bc0('0x23')][_0x1e44b0['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x1e44b0[_0x4bc0('0x33')],'/var/opt/motion2/server/files/attachments/',function(_0x564356){logger['info'](_0x1e44b0['uniqueid'],_0x4bc0('0x35'),_0x564356[_0x4bc0('0x36')]);attachment[_0x4bc0('0x37')]({'name':path[_0x4bc0('0x38')](_0x1e44b0[_0x4bc0('0x33')])['name'],'basename':path[_0x4bc0('0x38')](_0x1e44b0['filename'])[_0x4bc0('0x39')]+'.pdf','type':_0x4bc0('0x3a')})[_0x4bc0('0x3b')](function(_0x2ce280){faxAccount[_0x4bc0('0x3c')](_0x15d3ac,{'from':_0x1e44b0[_0x4bc0('0x34')],'mapKey':_0x4bc0('0x7'),'body':path['parse'](_0x1e44b0[_0x4bc0('0x33')])[_0x4bc0('0x39')]+'.pdf','AttachmentId':_0x2ce280['id']})[_0x4bc0('0x3d')](function(_0x9d0799){logger[_0x4bc0('0x3e')](_0x1e44b0[_0x4bc0('0x24')],_0x4bc0('0x3f'),JSON[_0x4bc0('0x40')](_0x9d0799));});})[_0x4bc0('0x3d')](function(_0xe2acf1){logger[_0x4bc0('0x3e')](_0x1e44b0[_0x4bc0('0x24')],_0x4bc0('0x41'),JSON['stringify'](_0xe2acf1));});});}logger['info'](_0x1e44b0['uniqueid'],_0x4bc0('0x41'));}};Fax[_0x4bc0('0x1e')][_0x4bc0('0x1d')]=function(_0x813cad){if(this[_0x4bc0('0x42')][_0x813cad[_0x4bc0('0x24')]]){_[_0x4bc0('0x43')](this[_0x4bc0('0x23')][_0x813cad[_0x4bc0('0x24')]],_[_0x4bc0('0x44')](_0x813cad,[_0x4bc0('0x45'),_0x4bc0('0x46')]));}};function updateStatus(_0x2da6e5){if(_0x2da6e5[_0x4bc0('0x47')]){faxMessage[_0x4bc0('0x48')](_0x2da6e5[_0x4bc0('0x47')],{'failMessage':_0x4bc0('0x49')})[_0x4bc0('0x3b')](function(_0x42c293){ut[_0x4bc0('0x4a')]('[Fax][Message][Error][Updated]',_0x42c293);})[_0x4bc0('0x3d')](function(_0x11e7c0){ut['logger'](_0x4bc0('0x4b'),_0x11e7c0);});}else{ut[_0x4bc0('0x4a')](_0x4bc0('0x4c'));}}Fax[_0x4bc0('0x1e')][_0x4bc0('0x4d')]=function(_0x49fe58,_0x163fc6,_0x2c5a3d){var _0x58a341=this;var _0x22cd21={};if(_0x163fc6){_0x22cd21={'read':_0x163fc6};}else{_0x22cd21={'failMessage':_0x2c5a3d};}if(this[_0x4bc0('0x42')][_0x49fe58][_0x4bc0('0x47')]){faxMessage[_0x4bc0('0x48')](this[_0x4bc0('0x42')][_0x49fe58]['AttachmentId'],_0x22cd21)[_0x4bc0('0x3b')](function(_0x5de99e){ut[_0x4bc0('0x4a')](_0x4bc0('0x4e'),_0x5de99e);})[_0x4bc0('0x3d')](function(_0x3adf8c){ut['logger'](_0x4bc0('0x4f'),_0x3adf8c);})[_0x4bc0('0x50')](function(){delete _0x58a341[_0x4bc0('0x23')][_0x49fe58];delete _0x58a341[_0x4bc0('0x42')][_0x49fe58];});}else{ut[_0x4bc0('0x4a')](_0x4bc0('0x51'));delete this[_0x4bc0('0x23')][_0x49fe58];delete this['actions'][_0x49fe58];}};Fax[_0x4bc0('0x1e')][_0x4bc0('0x52')]=function(_0x1cccbb){var _0x2c6cf8=this;if(this[_0x4bc0('0x23')][_0x1cccbb[_0x4bc0('0x24')]]){if(this[_0x4bc0('0x42')][_0x1cccbb[_0x4bc0('0x24')]]){this[_0x4bc0('0x23')][_0x1cccbb[_0x4bc0('0x24')]]['id']=this[_0x4bc0('0x42')][_0x1cccbb[_0x4bc0('0x24')]]['id'];this[_0x4bc0('0x23')][_0x1cccbb[_0x4bc0('0x24')]][_0x4bc0('0x39')]=this[_0x4bc0('0x42')][_0x1cccbb[_0x4bc0('0x24')]][_0x4bc0('0x39')];}logger[_0x4bc0('0x26')](_0x1cccbb[_0x4bc0('0x24')],this['actions'][_0x1cccbb[_0x4bc0('0x24')]]?_0x4bc0('0x53'):_0x4bc0('0x54'),JSON['stringify'](this[_0x4bc0('0x23')][_0x1cccbb[_0x4bc0('0x24')]]));if(this['actions'][_0x1cccbb[_0x4bc0('0x24')]]){if(this[_0x4bc0('0x23')][_0x1cccbb[_0x4bc0('0x24')]]['faxpages']>0x0&&this['channels'][_0x1cccbb[_0x4bc0('0x24')]][_0x4bc0('0x17')]==='SUCCESS'){this[_0x4bc0('0x4d')](_0x1cccbb[_0x4bc0('0x24')],!![]);}else{this['updateStatus'](_0x1cccbb[_0x4bc0('0x24')],![],this[_0x4bc0('0x23')][_0x1cccbb[_0x4bc0('0x24')]][_0x4bc0('0x55')]?_0x4bc0('0x56')+this[_0x4bc0('0x23')][_0x1cccbb[_0x4bc0('0x24')]][_0x4bc0('0x55')]:_0x4bc0('0x57'));}}}};Fax[_0x4bc0('0x1e')][_0x4bc0('0x58')]=function(_0x58463a){var _0x579aab=this;return new BPromise(function(_0x37dfdc,_0x30a79c){_0x579aab[_0x4bc0('0x59')](_0x58463a,_0x579aab['faxAccounts'][_0x58463a[_0x4bc0('0x5a')]])['then'](function(_0x280db4){ut[_0x4bc0('0x4a')](_0x4bc0('0x5b'),_0x280db4);_0x37dfdc(ut[_0x4bc0('0x36')]('Fax\x20received'));})[_0x4bc0('0x3d')](function(_0x37b6e5){ut[_0x4bc0('0x4a')](_0x4bc0('0x5c'),_0x37b6e5);updateStatus(_0x58463a);_0x30a79c(ut[_0x4bc0('0x36')]('Fax\x20failed'));});});};Fax[_0x4bc0('0x1e')][_0x4bc0('0x5d')]=function(_0x31b891){var _0xd5ed68=this;return new BPromise(function(_0x2c8f49,_0x30bcaf){var _0x45c230=_0xd5ed68[_0x4bc0('0x5e')](_0xd5ed68[_0x4bc0('0xd')][_0x31b891[_0x4bc0('0x5a')]][_0x4bc0('0x5f')],_0x31b891);if(_0x45c230[_0x4bc0('0x60')]){_0x2c8f49(ut['message'](_0x4bc0('0x61')));}else{_0x30bcaf(ut[_0x4bc0('0x36')](_0x45c230['message']));}});};function originate(_0x358492,_0x5d5217,_0x548017){return new BPromise(function(_0x4597fd,_0x42e62c){if(_0x548017){var _0x4827a8=util[_0x4bc0('0x62')](_0x4bc0('0x63'),path[_0x4bc0('0x38')](_0x358492[_0x4bc0('0x64')])[_0x4bc0('0x39')],_0x358492['path']);gs[_0x4bc0('0x65')](_0x4827a8)[_0x4bc0('0x3b')](function(){_0x358492[_0x4bc0('0x64')]=util[_0x4bc0('0x62')](_0x4bc0('0x66'),path[_0x4bc0('0x38')](_0x358492[_0x4bc0('0x64')])[_0x4bc0('0x67')],path[_0x4bc0('0x38')](_0x358492[_0x4bc0('0x64')])[_0x4bc0('0x39')]);_0x5d5217[_0x4bc0('0x68')]=_0x358492[_0x4bc0('0x64')];ut[_0x4bc0('0x4a')](_0x4bc0('0x69'),'');ami[_0x4bc0('0x6a')](ut[_0x4bc0('0x6b')](_0x358492,_0x5d5217))[_0x4bc0('0x3b')](function(_0x3a48a9){_0x4597fd(_0x3a48a9);})['catch'](function(_0x386bd4){_0x42e62c(_0x386bd4);});})[_0x4bc0('0x3d')](function(_0x4d7058){_0x42e62c(_0x4d7058);});}else{ami[_0x4bc0('0x6a')](ut[_0x4bc0('0x6b')](_0x358492,_0x5d5217))[_0x4bc0('0x3b')](function(_0x196ef2){_0x4597fd(_0x196ef2);})[_0x4bc0('0x3d')](function(_0x1d2e40){_0x42e62c(_0x1d2e40);});}});}Fax[_0x4bc0('0x1e')]['execOriginate']=function(_0x1141c1,_0x3adef6){var _0x52672c=this;return new BPromise(function(_0x5ae0ab,_0xfdd604){var _0x4d351a=uuid['v4']();var _0x5c1573=ut[_0x4bc0('0x6c')](_0x1141c1,_0x3adef6);_0x52672c[_0x4bc0('0x42')][_0x4d351a]=new Action(_0x4d351a,_0x3adef6,_0x1141c1);var _0x6c02cb=_0x52672c[_0x4bc0('0x42')][_0x4d351a];if(path[_0x4bc0('0x38')](_0x1141c1[_0x4bc0('0x64')])[_0x4bc0('0x6d')]===_0x4bc0('0x6e')){originate(_0x6c02cb,_0x5c1573,!![])['then'](function(_0x47b98b){_0x5ae0ab(_0x47b98b);})[_0x4bc0('0x3d')](function(_0x121810){_0xfdd604(_0x121810);});}else{originate(_0x6c02cb,_0x5c1573,![])['then'](function(_0x136196){_0x5ae0ab(_0x136196);})[_0x4bc0('0x3d')](function(_0x3e2445){_0xfdd604(_0x3e2445);});}});};Fax[_0x4bc0('0x1e')][_0x4bc0('0x6f')]=function(_0x55ca7d){return!_[_0x4bc0('0x70')](_0x55ca7d)&&!_[_0x4bc0('0x70')](_0x55ca7d[_0x4bc0('0x39')])&&!_[_0x4bc0('0x70')](_0x55ca7d[_0x4bc0('0x71')])&&_0x55ca7d['active']&&!_['isNil'](this[_0x4bc0('0xe')][util[_0x4bc0('0x62')]('SIP/%s',_0x55ca7d[_0x4bc0('0x39')])])&&!_['isNil'](this[_0x4bc0('0xe')][util[_0x4bc0('0x62')](_0x4bc0('0x72'),_0x55ca7d[_0x4bc0('0x39')])]['status'])&&(this[_0x4bc0('0xe')][util[_0x4bc0('0x62')](_0x4bc0('0x72'),_0x55ca7d['name'])]['status']==='reachable'||this['trunks'][util[_0x4bc0('0x62')](_0x4bc0('0x72'),_0x55ca7d[_0x4bc0('0x39')])][_0x4bc0('0x2d')]===_0x4bc0('0x73'));};Fax['prototype'][_0x4bc0('0x5e')]=function(_0x54d118,_0x28c7a2){if(!this[_0x4bc0('0x6f')](_0x54d118)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x4bc0('0x70')](_0x54d118)?'':_0x54d118[_0x4bc0('0x39')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x4bc0('0x74')};}if(_['isNil'](_0x28c7a2[_0x4bc0('0x7')])){ut[_0x4bc0('0x4a')](_0x4bc0('0x75'),JSON[_0x4bc0('0x40')](_0x28c7a2));return{'isValid':![],'message':_0x4bc0('0x76')};}if(_[_0x4bc0('0x70')](_0x28c7a2[_0x4bc0('0x64')])){ut[_0x4bc0('0x4a')](_0x4bc0('0x77'),JSON[_0x4bc0('0x40')](_0x28c7a2));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x4bc0('0x78')};};module[_0x4bc0('0x79')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 5f7cbcb..6f83aee 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 _0x2daf=['then','[Notify]\x20','util','preview','lodash','../rpc/faxAccount','notify','resolve'];(function(_0x414d14,_0x1dd3bf){var _0x4e003c=function(_0x23dda7){while(--_0x23dda7){_0x414d14['push'](_0x414d14['shift']());}};_0x4e003c(++_0x1dd3bf);}(_0x2daf,0xca));var _0xf2da=function(_0x1786e0,_0x19dc8c){_0x1786e0=_0x1786e0-0x0;var _0x4a6229=_0x2daf[_0x1786e0];return _0x4a6229;};'use strict';var util=require(_0xf2da('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0xf2da('0x1'));var _=require(_0xf2da('0x2'));var faxAccount=require(_0xf2da('0x3'));function loggerCatch(_0x3176fb){return function(_0x4c012e){logger['error'](_0x3176fb,util['inspect'](_0x4c012e,{'showHidden':![],'depth':null}));};}exports[_0xf2da('0x4')]=function(_0x1d811f,_0x1eddbe){return BPromise[_0xf2da('0x5')]()[_0xf2da('0x6')](faxAccount['notify'](_0x1d811f,_0x1eddbe))['catch'](loggerCatch(_0xf2da('0x7')));}; \ No newline at end of file +var _0xc660=['then','catch','preview','lodash','notify','resolve'];(function(_0x526fef,_0x24d8b8){var _0x5a1e4=function(_0x3105a6){while(--_0x3105a6){_0x526fef['push'](_0x526fef['shift']());}};_0x5a1e4(++_0x24d8b8);}(_0xc660,0x1ee));var _0x0c66=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xc660[_0x17d9e3];return _0x14192d;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x0c66('0x0'));var _=require(_0x0c66('0x1'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x3c6167){return function(_0x1140a3){logger['error'](_0x3c6167,util['inspect'](_0x1140a3,{'showHidden':![],'depth':null}));};}exports[_0x0c66('0x2')]=function(_0x205b2b,_0x288960){return BPromise[_0x0c66('0x3')]()[_0x0c66('0x4')](faxAccount[_0x0c66('0x2')](_0x205b2b,_0x288960))[_0x0c66('0x5')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index a27973f..698c21b 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 _0xcccc=['fax','bluebird','child_process','exec','execute','info','inspect','util','../../../../config/logger'];(function(_0x25445f,_0x14192a){var _0x5da2fe=function(_0x248857){while(--_0x248857){_0x25445f['push'](_0x25445f['shift']());}};_0x5da2fe(++_0x14192a);}(_0xcccc,0x73));var _0xcccc=function(_0x4108e9,_0x58da63){_0x4108e9=_0x4108e9-0x0;var _0x369cc4=_0xcccc[_0x4108e9];return _0x369cc4;};'use strict';var util=require(_0xcccc('0x0'));var logger=require(_0xcccc('0x1'))(_0xcccc('0x2'));var BPromise=require(_0xcccc('0x3'));var exec=require(_0xcccc('0x4'))[_0xcccc('0x5')];exports[_0xcccc('0x6')]=function(_0x530eaa){return new BPromise(function(_0x1221eb,_0x369da7){exec(_0x530eaa,function(_0x14e84a,_0x84b2b6,_0x5b7f08){logger[_0xcccc('0x7')]('Exec\x20gs',_0x84b2b6);if(_0x14e84a){logger['info']('Exec\x20gs','\x20Error\x20:',util[_0xcccc('0x8')](_0x14e84a,{'showHidden':![],'depth':null}),_0x84b2b6,_0x5b7f08);_0x369da7(_0x14e84a);}_0x1221eb(_0x84b2b6);});});}; \ No newline at end of file +var _0xbe52=['../../../../config/logger','fax','bluebird','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util'];(function(_0x2b2d47,_0xaf108b){var _0x403aa1=function(_0x4e3855){while(--_0x4e3855){_0x2b2d47['push'](_0x2b2d47['shift']());}};_0x403aa1(++_0xaf108b);}(_0xbe52,0x167));var _0x2be5=function(_0x39ac98,_0x2485c0){_0x39ac98=_0x39ac98-0x0;var _0x5c8478=_0xbe52[_0x39ac98];return _0x5c8478;};'use strict';var util=require(_0x2be5('0x0'));var logger=require(_0x2be5('0x1'))(_0x2be5('0x2'));var BPromise=require(_0x2be5('0x3'));var exec=require('child_process')[_0x2be5('0x4')];exports[_0x2be5('0x5')]=function(_0x5aaee4){return new BPromise(function(_0x2f7502,_0x328e2d){exec(_0x5aaee4,function(_0x2ccbe1,_0x5f34c1,_0x277519){logger[_0x2be5('0x6')]('Exec\x20gs',_0x5f34c1);if(_0x2ccbe1){logger['info'](_0x2be5('0x7'),_0x2be5('0x8'),util[_0x2be5('0x9')](_0x2ccbe1,{'showHidden':![],'depth':null}),_0x5f34c1,_0x277519);_0x328e2d(_0x2ccbe1);}_0x2f7502(_0x5f34c1);});});}; \ 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 53a9181..c1882f5 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 _0xf8b9=['variablesAction','uniqueid','originate','from-sip','format','\x22%s\x22\x20<%s>','util','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0xf8b9,0x11a));var _0x9f8b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf8b9[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x9f8b('0x0'));var _=require('lodash');var moment=require('moment');var logger=require('../../../../config/logger')('fax');exports[_0x9f8b('0x1')]=function(_0x335149){return{'message':_0x335149};};exports[_0x9f8b('0x2')]=function(_0x610397,_0x3461d5){logger[_0x9f8b('0x3')](_0x610397,util[_0x9f8b('0x4')](_0x3461d5,{'showHidden':![],'depth':null}));};exports[_0x9f8b('0x5')]=function(_0xd935bf,_0x2c5649){var _0x5baf99={'XMF-ECM':_0x2c5649[_0x9f8b('0x6')],'XMF-HEADERINFO':_0x2c5649[_0x9f8b('0x7')],'XMF-MINRATE':_0x2c5649[_0x9f8b('0x8')],'XMF-MAXRATE':_0x2c5649[_0x9f8b('0x9')],'XMF-MODEM':util['format'](_0x9f8b('0xa'),_0x2c5649[_0x9f8b('0xb')]),'XMF-GATEWAY':_0x2c5649[_0x9f8b('0xc')],'XMF-FAXDETECT':_0x2c5649[_0x9f8b('0xd')],'XMF-T38TIMEOUT':_0x2c5649[_0x9f8b('0xe')],'XMF-LOCALSTATIONID':_0x2c5649[_0x9f8b('0xf')],'XMF-PATH':_0xd935bf[_0x9f8b('0x10')]};return _0x5baf99;};exports[_0x9f8b('0x11')]=function(_0x37ad82,_0x358dcd){return{'actionid':_0x37ad82[_0x9f8b('0x12')],'action':_0x9f8b('0x13'),'channel':_0x37ad82['channel'],'Exten':'xcally-motion-fax','Context':_0x9f8b('0x14'),'Priority':'1','callerid':util[_0x9f8b('0x15')](_0x9f8b('0x16'),_0x37ad82[_0x9f8b('0x7')]?_0x37ad82[_0x9f8b('0x7')]:'',_0x37ad82[_0x9f8b('0xf')]),'variable':_0x358dcd,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x37ad82[_0x9f8b('0x12')]};}; \ No newline at end of file +var _0x20e1=['\x22%s\x22\x20<%s>','localstationid','util','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','t38timeout','path','uniqueid','xcally-motion-fax','from-sip'];(function(_0x3dbe4b,_0x488095){var _0x15a3cf=function(_0x423971){while(--_0x423971){_0x3dbe4b['push'](_0x3dbe4b['shift']());}};_0x15a3cf(++_0x488095);}(_0x20e1,0x122));var _0x120e=function(_0x41d6c7,_0xc0db02){_0x41d6c7=_0x41d6c7-0x0;var _0x36ed7d=_0x20e1[_0x41d6c7];return _0x36ed7d;};'use strict';var util=require(_0x120e('0x0'));var _=require('lodash');var moment=require(_0x120e('0x1'));var logger=require(_0x120e('0x2'))(_0x120e('0x3'));exports[_0x120e('0x4')]=function(_0x3e0ddc){return{'message':_0x3e0ddc};};exports[_0x120e('0x5')]=function(_0x612588,_0x23d0b6){logger[_0x120e('0x6')](_0x612588,util[_0x120e('0x7')](_0x23d0b6,{'showHidden':![],'depth':null}));};exports[_0x120e('0x8')]=function(_0x5e1a27,_0x5825e5){var _0x15a1d9={'XMF-ECM':_0x5825e5[_0x120e('0x9')],'XMF-HEADERINFO':_0x5825e5[_0x120e('0xa')],'XMF-MINRATE':_0x5825e5[_0x120e('0xb')],'XMF-MAXRATE':_0x5825e5[_0x120e('0xc')],'XMF-MODEM':util[_0x120e('0xd')](_0x120e('0xe'),_0x5825e5[_0x120e('0xf')]),'XMF-GATEWAY':_0x5825e5[_0x120e('0x10')],'XMF-FAXDETECT':_0x5825e5['faxdetect'],'XMF-T38TIMEOUT':_0x5825e5[_0x120e('0x11')],'XMF-LOCALSTATIONID':_0x5825e5['localstationid'],'XMF-PATH':_0x5e1a27[_0x120e('0x12')]};return _0x15a1d9;};exports['variablesAction']=function(_0x12e87e,_0x323969){return{'actionid':_0x12e87e[_0x120e('0x13')],'action':'originate','channel':_0x12e87e['channel'],'Exten':_0x120e('0x14'),'Context':_0x120e('0x15'),'Priority':'1','callerid':util[_0x120e('0xd')](_0x120e('0x16'),_0x12e87e['headerinfo']?_0x12e87e['headerinfo']:'',_0x12e87e[_0x120e('0x17')]),'variable':_0x323969,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x12e87e['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index f612c71..c314a95 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 _0x3fff=['getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','log','listen','sync','bluebird','moment','./realtime','./report','./trigger','./dialer','./preview','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts'];(function(_0x5a8f9c,_0x434973){var _0x314180=function(_0x1406af){while(--_0x1406af){_0x5a8f9c['push'](_0x5a8f9c['shift']());}};_0x314180(++_0x434973);}(_0x3fff,0x16a));var _0xf3ff=function(_0x2e617d,_0x17c590){_0x2e617d=_0x2e617d-0x0;var _0x34c295=_0x3fff[_0x2e617d];return _0x34c295;};'use strict';var BPromise=require(_0xf3ff('0x0'));var util=require('util');var moment=require(_0xf3ff('0x1'));var server=require('./server');var Realtime=require(_0xf3ff('0x2'));var Report=require(_0xf3ff('0x3'));var Acw=require('./acw');var Trigger=require(_0xf3ff('0x4'));var Dialer=require(_0xf3ff('0x5'));var Preview=require(_0xf3ff('0x6'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require(_0xf3ff('0x7'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xf3ff('0x8'));var trunk=require(_0xf3ff('0x9'));var trigger=require(_0xf3ff('0xa'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0xf3ff('0xb'));var faxAccount=require(_0xf3ff('0xc'));var zendesk=require(_0xf3ff('0xd'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xf3ff('0xe'));var freshdesk=require(_0xf3ff('0xf'));var desk=require(_0xf3ff('0x10'));var zoho=require(_0xf3ff('0x11'));var vtiger=require(_0xf3ff('0x12'));var freshsales=require(_0xf3ff('0x13'));var servicenow=require(_0xf3ff('0x14'));var dynamics365=require(_0xf3ff('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xf3ff('0x16')](_0xf3ff('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xf3ff('0x16')](_0xf3ff('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xf3ff('0x18')]()[_0xf3ff('0x19')](user[_0xf3ff('0x1a')]())[_0xf3ff('0x19')](realtime[_0xf3ff('0x1b')]())[_0xf3ff('0x19')](user[_0xf3ff('0x1c')]())[_0xf3ff('0x19')](realtime['initTelephones']())[_0xf3ff('0x19')](trunk[_0xf3ff('0x1d')]())[_0xf3ff('0x19')](realtime[_0xf3ff('0x1e')]())[_0xf3ff('0x19')](voiceQueue[_0xf3ff('0x1f')]())[_0xf3ff('0x19')](realtime[_0xf3ff('0x20')]())[_0xf3ff('0x19')](trigger[_0xf3ff('0x21')]())[_0xf3ff('0x19')](realtime[_0xf3ff('0x22')]())[_0xf3ff('0x19')](template[_0xf3ff('0x23')]())[_0xf3ff('0x19')](realtime['initTemplates']())[_0xf3ff('0x19')](zendesk[_0xf3ff('0x24')]())['then'](realtime[_0xf3ff('0x25')]())[_0xf3ff('0x19')](salesforce[_0xf3ff('0x26')]())[_0xf3ff('0x19')](realtime[_0xf3ff('0x27')]())[_0xf3ff('0x19')](sugarcrm[_0xf3ff('0x28')]())[_0xf3ff('0x19')](realtime[_0xf3ff('0x29')]())['then'](freshdesk[_0xf3ff('0x2a')]())[_0xf3ff('0x19')](realtime['initFreshdeskAccounts']())[_0xf3ff('0x19')](desk[_0xf3ff('0x2b')]())[_0xf3ff('0x19')](realtime[_0xf3ff('0x2c')]())['then'](zoho[_0xf3ff('0x2d')]())[_0xf3ff('0x19')](realtime[_0xf3ff('0x2e')]())['then'](vtiger['getVtigerAccounts']())[_0xf3ff('0x19')](realtime[_0xf3ff('0x2f')]())[_0xf3ff('0x19')](freshsales['getFreshsalesAccounts']())[_0xf3ff('0x19')](realtime[_0xf3ff('0x30')]())[_0xf3ff('0x19')](servicenow[_0xf3ff('0x31')]())[_0xf3ff('0x19')](realtime[_0xf3ff('0x32')]())['then'](dynamics365[_0xf3ff('0x33')]())['then'](realtime[_0xf3ff('0x34')]())[_0xf3ff('0x19')](campaign['getCampaigns']())[_0xf3ff('0x19')](realtime['initCampaigns']())['then'](voiceExtension[_0xf3ff('0x35')]())[_0xf3ff('0x19')](realtime['initVoiceExtensions']())[_0xf3ff('0x19')](faxAccount[_0xf3ff('0x36')]())[_0xf3ff('0x19')](realtime[_0xf3ff('0x37')]())[_0xf3ff('0x19')](function(){return realtime;});}function initParams(){return BPromise[_0xf3ff('0x18')]()[_0xf3ff('0x19')](voiceQueueReport[_0xf3ff('0x38')]())['then'](realtime[_0xf3ff('0x39')]())[_0xf3ff('0x19')](cmHopperHistory[_0xf3ff('0x3a')]())[_0xf3ff('0x19')](realtime[_0xf3ff('0x3b')]())[_0xf3ff('0x19')](cmHopperHistory[_0xf3ff('0x3c')]())[_0xf3ff('0x19')](realtime[_0xf3ff('0x3d')]())[_0xf3ff('0x19')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0xf3ff('0x3e')]())['then'](function(_0x48e1c4){})[_0xf3ff('0x3f')](function(_0x6a32f2){console[_0xf3ff('0x40')](_0x6a32f2);});}function main(){return server[_0xf3ff('0x41')](realtime,preview,fax)[_0xf3ff('0x19')](function(_0x2a101c){return initRealtime();})[_0xf3ff('0x19')](function(){return initParams();})[_0xf3ff('0x19')](function(){report[_0xf3ff('0x42')]();setInterval(initRealtime,0x1388);})[_0xf3ff('0x3f')](function(_0x48ba4f){console[_0xf3ff('0x40')](_0x48ba4f);});}main(); \ No newline at end of file +var _0x8cde=['./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','get','hour','resolve','then','getAgents','getTelephones','getTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getVoiceExtensions','initVoiceQueueReports','getVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','log','listen','bluebird','util','./server','./realtime','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger'];(function(_0x28baf4,_0x154b4a){var _0x4764e1=function(_0x53dd57){while(--_0x53dd57){_0x28baf4['push'](_0x28baf4['shift']());}};_0x4764e1(++_0x154b4a);}(_0x8cde,0xf6));var _0xe8cd=function(_0xa223ad,_0x5a574b){_0xa223ad=_0xa223ad-0x0;var _0x306d47=_0x8cde[_0xa223ad];return _0x306d47;};'use strict';var BPromise=require(_0xe8cd('0x0'));var util=require(_0xe8cd('0x1'));var moment=require('moment');var server=require(_0xe8cd('0x2'));var Realtime=require(_0xe8cd('0x3'));var Report=require('./report');var Acw=require(_0xe8cd('0x4'));var Trigger=require('./trigger');var Dialer=require(_0xe8cd('0x5'));var Preview=require(_0xe8cd('0x6'));var Fax=require(_0xe8cd('0x7'));var user=require(_0xe8cd('0x8'));var voiceQueue=require(_0xe8cd('0x9'));var voiceQueueReport=require(_0xe8cd('0xa'));var voiceCallReport=require(_0xe8cd('0xb'));var trunk=require(_0xe8cd('0xc'));var trigger=require(_0xe8cd('0xd'));var template=require(_0xe8cd('0xe'));var cmHopperHistory=require(_0xe8cd('0xf'));var campaign=require(_0xe8cd('0x10'));var voiceExtension=require(_0xe8cd('0x11'));var faxAccount=require(_0xe8cd('0x12'));var zendesk=require(_0xe8cd('0x13'));var salesforce=require(_0xe8cd('0x14'));var sugarcrm=require(_0xe8cd('0x15'));var freshdesk=require(_0xe8cd('0x16'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xe8cd('0x17'));var freshsales=require(_0xe8cd('0x18'));var servicenow=require(_0xe8cd('0x19'));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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xe8cd('0x1a')](_0xe8cd('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xe8cd('0x1a')](_0xe8cd('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xe8cd('0x1c')]()[_0xe8cd('0x1d')](user[_0xe8cd('0x1e')]())[_0xe8cd('0x1d')](realtime['initAgents']())[_0xe8cd('0x1d')](user[_0xe8cd('0x1f')]())['then'](realtime['initTelephones']())[_0xe8cd('0x1d')](trunk[_0xe8cd('0x20')]())[_0xe8cd('0x1d')](realtime['initTrunks']())[_0xe8cd('0x1d')](voiceQueue['getVoiceQueues']())[_0xe8cd('0x1d')](realtime[_0xe8cd('0x21')]())[_0xe8cd('0x1d')](trigger[_0xe8cd('0x22')]())[_0xe8cd('0x1d')](realtime[_0xe8cd('0x23')]())['then'](template[_0xe8cd('0x24')]())[_0xe8cd('0x1d')](realtime[_0xe8cd('0x25')]())[_0xe8cd('0x1d')](zendesk['getZendeskAccounts']())['then'](realtime[_0xe8cd('0x26')]())[_0xe8cd('0x1d')](salesforce[_0xe8cd('0x27')]())[_0xe8cd('0x1d')](realtime[_0xe8cd('0x28')]())[_0xe8cd('0x1d')](sugarcrm[_0xe8cd('0x29')]())[_0xe8cd('0x1d')](realtime[_0xe8cd('0x2a')]())[_0xe8cd('0x1d')](freshdesk[_0xe8cd('0x2b')]())[_0xe8cd('0x1d')](realtime[_0xe8cd('0x2c')]())['then'](desk[_0xe8cd('0x2d')]())[_0xe8cd('0x1d')](realtime[_0xe8cd('0x2e')]())['then'](zoho[_0xe8cd('0x2f')]())['then'](realtime[_0xe8cd('0x30')]())['then'](vtiger[_0xe8cd('0x31')]())[_0xe8cd('0x1d')](realtime[_0xe8cd('0x32')]())['then'](freshsales[_0xe8cd('0x33')]())[_0xe8cd('0x1d')](realtime[_0xe8cd('0x34')]())[_0xe8cd('0x1d')](servicenow[_0xe8cd('0x35')]())[_0xe8cd('0x1d')](realtime[_0xe8cd('0x36')]())[_0xe8cd('0x1d')](dynamics365[_0xe8cd('0x37')]())[_0xe8cd('0x1d')](realtime[_0xe8cd('0x38')]())[_0xe8cd('0x1d')](campaign['getCampaigns']())['then'](realtime['initCampaigns']())[_0xe8cd('0x1d')](voiceExtension[_0xe8cd('0x39')]())['then'](realtime['initVoiceExtensions']())[_0xe8cd('0x1d')](faxAccount['getFaxAccounts']())[_0xe8cd('0x1d')](realtime['initFaxAccounts']())[_0xe8cd('0x1d')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xe8cd('0x1d')](voiceQueueReport['getVoiceQueueReports']())[_0xe8cd('0x1d')](realtime[_0xe8cd('0x3a')]())[_0xe8cd('0x1d')](cmHopperHistory[_0xe8cd('0x3b')]())['then'](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0xe8cd('0x1d')](realtime[_0xe8cd('0x3c')]())['then'](voiceCallReport[_0xe8cd('0x3d')]())[_0xe8cd('0x1d')](realtime['initVoiceCallReports']())[_0xe8cd('0x1d')](function(_0xb621e9){})[_0xe8cd('0x3e')](function(_0x4762fd){console[_0xe8cd('0x3f')](_0x4762fd);});}function main(){return server[_0xe8cd('0x40')](realtime,preview,fax)[_0xe8cd('0x1d')](function(_0x1ac1e9){return initRealtime();})[_0xe8cd('0x1d')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xe8cd('0x3e')](function(_0x19d263){console[_0xe8cd('0x3f')](_0x19d263);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 3e5143d..0b85600 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 _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x592307,_0x2b8719){var _0x244eb8=function(_0x3e7c78){while(--_0x3e7c78){_0x592307['push'](_0x592307['shift']());}};_0x244eb8(++_0x2b8719);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file +var _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x41c842,_0x3865f6){var _0x15ee6b=function(_0x2505f5){while(--_0x2505f5){_0x41c842['push'](_0x41c842['shift']());}};_0x15ee6b(++_0x3865f6);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('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 5675a5d..1235ab2 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 _0x7255=['dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry'];(function(_0x30e639,_0x19f3c4){var _0x5259b8=function(_0x5e23f5){while(--_0x5e23f5){_0x30e639['push'](_0x30e639['shift']());}};_0x5259b8(++_0x19f3c4);}(_0x7255,0x19e));var _0x5725=function(_0x5b29d2,_0x4eeae4){_0x5b29d2=_0x5b29d2-0x0;var _0x4107a5=_0x7255[_0x5b29d2];return _0x4107a5;};'use strict';function Campaign(_0x2ad94d){this['id']=_0x2ad94d['id']||0x0;this[_0x5725('0x0')]=_0x2ad94d[_0x5725('0x0')]||'';this[_0x5725('0x1')]=_0x2ad94d[_0x5725('0x1')]||_0x5725('0x2');this['originated']=0x0;this['temp']=0x0;this[_0x5725('0x3')]=0x0;this[_0x5725('0x4')]=0x0;this[_0x5725('0x5')]='';this[_0x5725('0x6')]=!![];this[_0x5725('0x7')]=_0x2ad94d[_0x5725('0x7')];this['limitCalls']=_0x2ad94d['limitCalls'];this[_0x5725('0x8')]=_0x2ad94d[_0x5725('0x8')]||null;this[_0x5725('0x9')]=_0x2ad94d['dialGlobalInterval']?_0x2ad94d['dialGlobalInterval']:null;this[_0x5725('0xa')]=_0x2ad94d['dialOriginateCallerIdName'];this[_0x5725('0xb')]=_0x2ad94d[_0x5725('0xb')];this['dialOriginateTimeout']=_0x2ad94d[_0x5725('0xc')]||0x1e;this[_0x5725('0xd')]=_0x2ad94d[_0x5725('0xd')];this[_0x5725('0xe')]=_0x2ad94d[_0x5725('0xe')];this['dialBusyMaxRetry']=_0x2ad94d[_0x5725('0xf')];this[_0x5725('0x10')]=_0x2ad94d['dialBusyRetryFrequency'];this[_0x5725('0x11')]=_0x2ad94d[_0x5725('0x11')];this[_0x5725('0x12')]=_0x2ad94d[_0x5725('0x12')];this[_0x5725('0x13')]=_0x2ad94d['dialGlobalMaxRetry'];this[_0x5725('0x14')]=_0x2ad94d[_0x5725('0x14')]||0x3;this[_0x5725('0x15')]=_0x2ad94d['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x2ad94d[_0x5725('0x16')]||0x3;this[_0x5725('0x17')]=_0x2ad94d[_0x5725('0x17')]||0x96;this[_0x5725('0x18')]=_0x2ad94d[_0x5725('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x2ad94d[_0x5725('0x19')]||0x96;this[_0x5725('0x1a')]=_0x2ad94d[_0x5725('0x1a')]||0x3;this['dialMachineRetryFrequency']=_0x2ad94d['dialMachineRetryFrequency']||0x96;this[_0x5725('0x1b')]=_0x2ad94d[_0x5725('0x1b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2ad94d[_0x5725('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0x2ad94d[_0x5725('0x1d')]||'DESC';this[_0x5725('0x1e')]=_0x2ad94d['dialPrefix']||undefined;this[_0x5725('0x1f')]=_0x2ad94d[_0x5725('0x1f')]||undefined;this[_0x5725('0x20')]=_0x2ad94d[_0x5725('0x20')]||undefined;this[_0x5725('0x21')]=_0x2ad94d[_0x5725('0x21')]?_0x2ad94d[_0x5725('0x21')]:undefined;this[_0x5725('0x22')]=_0x2ad94d[_0x5725('0x22')]?_0x2ad94d[_0x5725('0x22')]:undefined;this[_0x5725('0x23')]=_0x2ad94d[_0x5725('0x23')]?_0x2ad94d[_0x5725('0x23')]:undefined;this[_0x5725('0x24')]=_0x2ad94d[_0x5725('0x24')]?_0x2ad94d[_0x5725('0x24')]:undefined;this[_0x5725('0x25')]=_0x2ad94d[_0x5725('0x24')]?_0x2ad94d[_0x5725('0x24')][_0x5725('0x0')]:undefined;this['dialAMDActive']=_0x2ad94d[_0x5725('0x26')]||![];this[_0x5725('0x27')]=_0x2ad94d['dialAMDInitialSilence'];this[_0x5725('0x28')]=_0x2ad94d[_0x5725('0x28')];this[_0x5725('0x29')]=_0x2ad94d[_0x5725('0x29')];this[_0x5725('0x2a')]=_0x2ad94d['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x2ad94d[_0x5725('0x2b')];this[_0x5725('0x2c')]=_0x2ad94d[_0x5725('0x2c')];this[_0x5725('0x2d')]=_0x2ad94d[_0x5725('0x2d')];this[_0x5725('0x2e')]=_0x2ad94d[_0x5725('0x2e')];this[_0x5725('0x2f')]=_0x2ad94d[_0x5725('0x2f')];}module[_0x5725('0x30')]=Campaign; \ No newline at end of file +var _0x9b83=['dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x9b83,0x1ec));var _0x39b8=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x9b83[_0x2f9467];return _0x39894c;};'use strict';function Campaign(_0x41e741){this['id']=_0x41e741['id']||0x0;this[_0x39b8('0x0')]=_0x41e741[_0x39b8('0x0')]||'';this[_0x39b8('0x1')]=_0x41e741[_0x39b8('0x1')]||'campaign';this[_0x39b8('0x2')]=0x0;this[_0x39b8('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x39b8('0x4')]=0x0;this['message']='';this[_0x39b8('0x5')]=!![];this[_0x39b8('0x6')]=_0x41e741[_0x39b8('0x6')];this[_0x39b8('0x7')]=_0x41e741[_0x39b8('0x7')];this[_0x39b8('0x8')]=_0x41e741[_0x39b8('0x8')]||null;this[_0x39b8('0x9')]=_0x41e741[_0x39b8('0x9')]?_0x41e741[_0x39b8('0x9')]:null;this['dialOriginateCallerIdName']=_0x41e741[_0x39b8('0xa')];this['dialOriginateCallerIdNumber']=_0x41e741[_0x39b8('0xb')];this[_0x39b8('0xc')]=_0x41e741['dialOriginateTimeout']||0x1e;this[_0x39b8('0xd')]=_0x41e741[_0x39b8('0xd')];this[_0x39b8('0xe')]=_0x41e741[_0x39b8('0xe')];this[_0x39b8('0xf')]=_0x41e741['dialBusyMaxRetry'];this[_0x39b8('0x10')]=_0x41e741[_0x39b8('0x10')];this[_0x39b8('0x11')]=_0x41e741['dialNoAnswerMaxRetry'];this[_0x39b8('0x12')]=_0x41e741[_0x39b8('0x12')];this[_0x39b8('0x13')]=_0x41e741[_0x39b8('0x13')];this[_0x39b8('0x14')]=_0x41e741[_0x39b8('0x14')]||0x3;this[_0x39b8('0x15')]=_0x41e741[_0x39b8('0x15')]||0x96;this[_0x39b8('0x16')]=_0x41e741['dialDropMaxRetry']||0x3;this[_0x39b8('0x17')]=_0x41e741[_0x39b8('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x41e741['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x41e741[_0x39b8('0x18')]||0x96;this[_0x39b8('0x19')]=_0x41e741[_0x39b8('0x19')]||0x3;this['dialMachineRetryFrequency']=_0x41e741[_0x39b8('0x1a')]||0x96;this['dialAgentRejectMaxRetry']=_0x41e741[_0x39b8('0x1b')]||0x3;this[_0x39b8('0x1c')]=_0x41e741[_0x39b8('0x1c')]||0x96;this[_0x39b8('0x1d')]=_0x41e741[_0x39b8('0x1d')]||_0x39b8('0x1e');this[_0x39b8('0x1f')]=_0x41e741[_0x39b8('0x1f')]||undefined;this[_0x39b8('0x20')]=_0x41e741['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x39b8('0x21')]=_0x41e741[_0x39b8('0x21')]||undefined;this[_0x39b8('0x22')]=_0x41e741[_0x39b8('0x22')]?_0x41e741['TrunkBackup']:undefined;this[_0x39b8('0x23')]=_0x41e741['Trunk']?_0x41e741[_0x39b8('0x23')]:undefined;this['Interval']=_0x41e741['Interval']?_0x41e741[_0x39b8('0x24')]:undefined;this[_0x39b8('0x25')]=_0x41e741['SquareProject']?_0x41e741[_0x39b8('0x25')]:undefined;this[_0x39b8('0x26')]=_0x41e741[_0x39b8('0x25')]?_0x41e741[_0x39b8('0x25')][_0x39b8('0x0')]:undefined;this[_0x39b8('0x27')]=_0x41e741['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x41e741[_0x39b8('0x28')];this[_0x39b8('0x29')]=_0x41e741[_0x39b8('0x29')];this[_0x39b8('0x2a')]=_0x41e741[_0x39b8('0x2a')];this[_0x39b8('0x2b')]=_0x41e741[_0x39b8('0x2b')];this[_0x39b8('0x2c')]=_0x41e741[_0x39b8('0x2c')];this[_0x39b8('0x2d')]=_0x41e741['dialAMDBetweenWordsSilence'];this[_0x39b8('0x2e')]=_0x41e741['dialAMDMaximumNumberOfWords'];this[_0x39b8('0x2f')]=_0x41e741[_0x39b8('0x2f')];this[_0x39b8('0x30')]=_0x41e741['dialAMDMaximumWordLength'];}module[_0x39b8('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 f336a2b..2d3e3db 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 _0x349e=['queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','linkedid','answertime','unmanaged','abandoned','lastdata','duration','billableseconds','holdtime','type','disposition','monitor','monitorFilename'];(function(_0x18b344,_0x271f68){var _0x5ef6bb=function(_0x3345b3){while(--_0x3345b3){_0x18b344['push'](_0x18b344['shift']());}};_0x5ef6bb(++_0x271f68);}(_0x349e,0xcb));var _0xe349=function(_0x15f6d9,_0xe94efe){_0x15f6d9=_0x15f6d9-0x0;var _0x568ab9=_0x349e[_0x15f6d9];return _0x568ab9;};'use strict';function Channel(){this[_0xe349('0x0')]=null;this[_0xe349('0x1')]='';this[_0xe349('0x2')]='';this[_0xe349('0x3')]=0x0;this[_0xe349('0x4')]='';this[_0xe349('0x5')]=undefined;this[_0xe349('0x6')]=undefined;this[_0xe349('0x7')]=0x0;this[_0xe349('0x8')]='';this['uniqueid']=0x0;this[_0xe349('0x9')]=0x0;this['exten']=0x0;this['answered']=![];this[_0xe349('0xa')]=null;this['endtime']=null;this[_0xe349('0xb')]=![];this[_0xe349('0xc')]=![];this['lastapplication']='';this[_0xe349('0xd')]='';this[_0xe349('0xe')]=0x0;this[_0xe349('0xf')]=0x0;this[_0xe349('0x10')]=0x0;this[_0xe349('0x11')]=null;this['tag']=null;this[_0xe349('0x12')]=null;this[_0xe349('0x13')]=![];this[_0xe349('0x14')]=null;this[_0xe349('0x15')]=null;this[_0xe349('0x16')]=[];this[_0xe349('0x17')]=undefined;this[_0xe349('0x18')]=undefined;this[_0xe349('0x19')]=undefined;this[_0xe349('0x1a')]=0x0;}module[_0xe349('0x1b')]=Channel; \ No newline at end of file +var _0xa1cc=['connectedlinename','context','linkedid','exten','answered','answertime','abandoned','lastapplication','lastdata','type','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','transferType','exports','starttime','channel','destinationchannel','calleridname','connectedlinenum'];(function(_0x3d118a,_0xc2c0d7){var _0xbdfbf3=function(_0x555085){while(--_0x555085){_0x3d118a['push'](_0x3d118a['shift']());}};_0xbdfbf3(++_0xc2c0d7);}(_0xa1cc,0x10f));var _0xca1c=function(_0x58c094,_0xdbf48f){_0x58c094=_0x58c094-0x0;var _0x21c64a=_0xa1cc[_0x58c094];return _0x21c64a;};'use strict';function Channel(){this[_0xca1c('0x0')]=null;this[_0xca1c('0x1')]='';this[_0xca1c('0x2')]='';this['calleridnum']=0x0;this[_0xca1c('0x3')]='';this[_0xca1c('0x4')]=undefined;this[_0xca1c('0x5')]=undefined;this['accountcode']=0x0;this[_0xca1c('0x6')]='';this['uniqueid']=0x0;this[_0xca1c('0x7')]=0x0;this[_0xca1c('0x8')]=0x0;this[_0xca1c('0x9')]=![];this[_0xca1c('0xa')]=null;this['endtime']=null;this['unmanaged']=![];this[_0xca1c('0xb')]=![];this[_0xca1c('0xc')]='';this[_0xca1c('0xd')]='';this['duration']=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0xca1c('0xe')]=null;this['tag']=null;this[_0xca1c('0xf')]=null;this[_0xca1c('0x10')]=![];this[_0xca1c('0x11')]=null;this[_0xca1c('0x12')]=null;this[_0xca1c('0x13')]=[];this['transfercalleridnum']=undefined;this[_0xca1c('0x14')]=undefined;this[_0xca1c('0x15')]=undefined;this['mohtime']=0x0;}module[_0xca1c('0x16')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index dcc50a9..97ffe3c 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 _0x89ab=['exports','name','username','remoteUri','authType','password','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x468392,_0x5cf1db){var _0x2bfcc0=function(_0x47e4a3){while(--_0x47e4a3){_0x468392['push'](_0x468392['shift']());}};_0x2bfcc0(++_0x5cf1db);}(_0x89ab,0x18d));var _0xb89a=function(_0x54311a,_0x44a401){_0x54311a=_0x54311a-0x0;var _0x5f5ad4=_0x89ab[_0x54311a];return _0x5f5ad4;};'use strict';function DeskAccount(_0x4f4f22){this['id']=_0x4f4f22['id']||0x0;this['name']=_0x4f4f22[_0xb89a('0x0')]||'';this[_0xb89a('0x1')]=_0x4f4f22['username']||'';this[_0xb89a('0x2')]=_0x4f4f22['remoteUri']||'';this[_0xb89a('0x3')]=_0x4f4f22[_0xb89a('0x3')]||'';this[_0xb89a('0x4')]=_0x4f4f22[_0xb89a('0x4')]||'';this['consumerKey']=_0x4f4f22['consumerKey']||'';this['consumerSecret']=_0x4f4f22[_0xb89a('0x5')]||'';this[_0xb89a('0x6')]=_0x4f4f22[_0xb89a('0x6')]||'';this[_0xb89a('0x7')]=_0x4f4f22[_0xb89a('0x7')]||'';this[_0xb89a('0x8')]=_0x4f4f22[_0xb89a('0x8')]||'';this[_0xb89a('0x9')]=_0x4f4f22[_0xb89a('0x9')]||'';this[_0xb89a('0xa')]=_0x4f4f22[_0xb89a('0xa')]||{};}module[_0xb89a('0xb')]=DeskAccount; \ No newline at end of file +var _0xb137=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name'];(function(_0x1e37c7,_0x4c4472){var _0x214c9c=function(_0x112c7f){while(--_0x112c7f){_0x1e37c7['push'](_0x1e37c7['shift']());}};_0x214c9c(++_0x4c4472);}(_0xb137,0x17f));var _0x7b13=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xb137[_0x40220a];return _0x3903cc;};'use strict';function DeskAccount(_0x164026){this['id']=_0x164026['id']||0x0;this['name']=_0x164026[_0x7b13('0x0')]||'';this[_0x7b13('0x1')]=_0x164026[_0x7b13('0x1')]||'';this['remoteUri']=_0x164026[_0x7b13('0x2')]||'';this[_0x7b13('0x3')]=_0x164026[_0x7b13('0x3')]||'';this[_0x7b13('0x4')]=_0x164026[_0x7b13('0x4')]||'';this[_0x7b13('0x5')]=_0x164026[_0x7b13('0x5')]||'';this[_0x7b13('0x6')]=_0x164026[_0x7b13('0x6')]||'';this[_0x7b13('0x7')]=_0x164026['token']||'';this[_0x7b13('0x8')]=_0x164026[_0x7b13('0x8')]||'';this[_0x7b13('0x9')]=_0x164026[_0x7b13('0x9')]||'';this[_0x7b13('0xa')]=_0x164026[_0x7b13('0xa')]||'';this[_0x7b13('0xb')]=_0x164026[_0x7b13('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 9322c53..a755ed2 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 _0x702d=['remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password'];(function(_0x7a4263,_0x1d8fe4){var _0x2f5121=function(_0x5aaa32){while(--_0x5aaa32){_0x7a4263['push'](_0x7a4263['shift']());}};_0x2f5121(++_0x1d8fe4);}(_0x702d,0x147));var _0xd702=function(_0x3ca000,_0x8c93b2){_0x3ca000=_0x3ca000-0x0;var _0x5b2d69=_0x702d[_0x3ca000];return _0x5b2d69;};'use strict';function Dynamics365Account(_0x14de3f){this['id']=_0x14de3f['id']||0x0;this[_0xd702('0x0')]=_0x14de3f[_0xd702('0x0')]||'';this[_0xd702('0x1')]=_0x14de3f[_0xd702('0x1')]||'';this['password']=_0x14de3f[_0xd702('0x2')]||'';this[_0xd702('0x3')]=_0x14de3f[_0xd702('0x3')]||'';this[_0xd702('0x4')]=_0x14de3f['tenantId']||'';this[_0xd702('0x5')]=_0x14de3f['clientId']||'';this[_0xd702('0x6')]=_0x14de3f[_0xd702('0x6')]||{};this[_0xd702('0x7')]=_0x14de3f['serverUrl']||'';this[_0xd702('0x8')]=_0x14de3f['Configurations']||{};}module[_0xd702('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xda3f=['clientId','serverUrl','Configurations','exports','name','password','remoteUri','tenantId'];(function(_0x32e6cb,_0x436508){var _0xfbded9=function(_0x49e961){while(--_0x49e961){_0x32e6cb['push'](_0x32e6cb['shift']());}};_0xfbded9(++_0x436508);}(_0xda3f,0xec));var _0xfda3=function(_0x86ba30,_0x320aa0){_0x86ba30=_0x86ba30-0x0;var _0x2e52e8=_0xda3f[_0x86ba30];return _0x2e52e8;};'use strict';function Dynamics365Account(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['username']=_0x33f0ce['username']||'';this['password']=_0x33f0ce[_0xfda3('0x1')]||'';this['remoteUri']=_0x33f0ce[_0xfda3('0x2')]||'';this[_0xfda3('0x3')]=_0x33f0ce['tenantId']||'';this[_0xfda3('0x4')]=_0x33f0ce[_0xfda3('0x4')]||'';this['clientSecret']=_0x33f0ce['clientSecret']||{};this[_0xfda3('0x5')]=_0x33f0ce[_0xfda3('0x5')]||'';this[_0xfda3('0x6')]=_0x33f0ce[_0xfda3('0x6')]||{};}module[_0xfda3('0x7')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 7304159..1a94b18 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 _0x799d=['v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem'];(function(_0x4d061f,_0x59e6b5){var _0x5b4971=function(_0x4a954c){while(--_0x4a954c){_0x4d061f['push'](_0x4d061f['shift']());}};_0x5b4971(++_0x59e6b5);}(_0x799d,0x1b2));var _0xd799=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x799d[_0x413feb];return _0x40ee88;};'use strict';function FaxAccount(_0x21a347){this['id']=_0x21a347['id']||0x0;this['name']=_0x21a347[_0xd799('0x0')]||'';this[_0xd799('0x1')]=_0x21a347['description'];this[_0xd799('0x2')]=_0x21a347[_0xd799('0x2')];this['headerinfo']=_0x21a347[_0xd799('0x3')];this[_0xd799('0x4')]=_0x21a347[_0xd799('0x4')];this[_0xd799('0x5')]=_0x21a347['minrate']||0x960;this[_0xd799('0x6')]=_0x21a347[_0xd799('0x6')]||0x3840;this['modem']=_0x21a347[_0xd799('0x7')]||_0xd799('0x8');this[_0xd799('0x9')]=_0x21a347['gateway']||'no';this[_0xd799('0xa')]=_0x21a347[_0xd799('0xa')]||'no';this[_0xd799('0xb')]=_0x21a347[_0xd799('0xb')]||0x1388;this['tech']=_0x21a347[_0xd799('0xc')]||'SIP';this[_0xd799('0xd')]=_0x21a347['Trunk']?_0x21a347[_0xd799('0xd')]:undefined;this[_0xd799('0xe')]=_0x21a347[_0xd799('0xe')];this[_0xd799('0xf')]=_0x21a347[_0xd799('0xf')];}module[_0xd799('0x10')]=FaxAccount; \ No newline at end of file +var _0x77c1=['ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description'];(function(_0x287a47,_0x2f731c){var _0x3fb726=function(_0xbedc33){while(--_0xbedc33){_0x287a47['push'](_0x287a47['shift']());}};_0x3fb726(++_0x2f731c);}(_0x77c1,0x130));var _0x177c=function(_0x299f30,_0xb31366){_0x299f30=_0x299f30-0x0;var _0x10036c=_0x77c1[_0x299f30];return _0x10036c;};'use strict';function FaxAccount(_0x2ddc68){this['id']=_0x2ddc68['id']||0x0;this[_0x177c('0x0')]=_0x2ddc68['name']||'';this[_0x177c('0x1')]=_0x2ddc68[_0x177c('0x1')];this[_0x177c('0x2')]=_0x2ddc68[_0x177c('0x2')];this[_0x177c('0x3')]=_0x2ddc68[_0x177c('0x3')];this[_0x177c('0x4')]=_0x2ddc68[_0x177c('0x4')];this[_0x177c('0x5')]=_0x2ddc68[_0x177c('0x5')]||0x960;this[_0x177c('0x6')]=_0x2ddc68[_0x177c('0x6')]||0x3840;this['modem']=_0x2ddc68[_0x177c('0x7')]||_0x177c('0x8');this['gateway']=_0x2ddc68[_0x177c('0x9')]||'no';this[_0x177c('0xa')]=_0x2ddc68[_0x177c('0xa')]||'no';this[_0x177c('0xb')]=_0x2ddc68[_0x177c('0xb')]||0x1388;this[_0x177c('0xc')]=_0x2ddc68[_0x177c('0xc')]||_0x177c('0xd');this[_0x177c('0xe')]=_0x2ddc68[_0x177c('0xe')]?_0x2ddc68[_0x177c('0xe')]:undefined;this['ListId']=_0x2ddc68[_0x177c('0xf')];this[_0x177c('0x10')]=_0x2ddc68['key'];}module[_0x177c('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 400ab59..471172b 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 _0xa1f7=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x2d905,_0x505ae4){var _0xc4cc9c=function(_0x1d55ce){while(--_0x1d55ce){_0x2d905['push'](_0x2d905['shift']());}};_0xc4cc9c(++_0x505ae4);}(_0xa1f7,0x13d));var _0x7a1f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa1f7[_0x3dd15e];return _0x231fd0;};'use strict';function FreshdeskAccount(_0x330d3b){this['id']=_0x330d3b['id']||0x0;this[_0x7a1f('0x0')]=_0x330d3b[_0x7a1f('0x0')]||'';this['username']=_0x330d3b[_0x7a1f('0x1')]||'';this[_0x7a1f('0x2')]=_0x330d3b[_0x7a1f('0x3')]||'';this[_0x7a1f('0x4')]=_0x330d3b[_0x7a1f('0x4')]||'';this[_0x7a1f('0x5')]=_0x330d3b['serverUrl']||'';this[_0x7a1f('0x6')]=_0x330d3b[_0x7a1f('0x6')]||{};}module[_0x7a1f('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x2e3d=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x7e269,_0x1049df){var _0xaf2fb9=function(_0x190c93){while(--_0x190c93){_0x7e269['push'](_0x7e269['shift']());}};_0xaf2fb9(++_0x1049df);}(_0x2e3d,0x162));var _0xd2e3=function(_0x1c0f63,_0x7b25c2){_0x1c0f63=_0x1c0f63-0x0;var _0x2a25a4=_0x2e3d[_0x1c0f63];return _0x2a25a4;};'use strict';function FreshdeskAccount(_0x47b899){this['id']=_0x47b899['id']||0x0;this[_0xd2e3('0x0')]=_0x47b899[_0xd2e3('0x0')]||'';this['username']=_0x47b899[_0xd2e3('0x1')]||'';this[_0xd2e3('0x2')]=_0x47b899[_0xd2e3('0x3')]||'';this[_0xd2e3('0x4')]=_0x47b899[_0xd2e3('0x4')]||'';this[_0xd2e3('0x5')]=_0x47b899['serverUrl']||'';this[_0xd2e3('0x6')]=_0x47b899['Configurations']||{};}module[_0xd2e3('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 54ad295..1525787 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 _0x379e=['exports','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x379e,0x104));var _0xe379=function(_0x87629,_0x20f55d){_0x87629=_0x87629-0x0;var _0x4730a7=_0x379e[_0x87629];return _0x4730a7;};'use strict';function FreshsalesAccount(_0x2ad2d4){this['id']=_0x2ad2d4['id']||0x0;this['name']=_0x2ad2d4['name']||'';this['username']=_0x2ad2d4[_0xe379('0x0')]||'';this[_0xe379('0x1')]=_0x2ad2d4[_0xe379('0x2')]||'';this[_0xe379('0x3')]=_0x2ad2d4[_0xe379('0x3')]||'';this[_0xe379('0x4')]=_0x2ad2d4[_0xe379('0x4')]||'';this['Configurations']=_0x2ad2d4[_0xe379('0x5')]||{};}module[_0xe379('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x1298=['Configurations','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x402756,_0x4c2695){var _0x4091d4=function(_0x50d309){while(--_0x50d309){_0x402756['push'](_0x402756['shift']());}};_0x4091d4(++_0x4c2695);}(_0x1298,0x19e));var _0x8129=function(_0x951951,_0x494607){_0x951951=_0x951951-0x0;var _0x4bc6ad=_0x1298[_0x951951];return _0x4bc6ad;};'use strict';function FreshsalesAccount(_0x211e78){this['id']=_0x211e78['id']||0x0;this[_0x8129('0x0')]=_0x211e78['name']||'';this[_0x8129('0x1')]=_0x211e78[_0x8129('0x1')]||'';this[_0x8129('0x2')]=_0x211e78[_0x8129('0x3')]||'';this[_0x8129('0x4')]=_0x211e78[_0x8129('0x4')]||'';this[_0x8129('0x5')]=_0x211e78['serverUrl']||'';this[_0x8129('0x6')]=_0x211e78[_0x8129('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index b7195c8..db054b9 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 _0x7c6a=['variables','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','context','holdtime','lastAssignedTo'];(function(_0x53ac44,_0x4a9ce0){var _0xac66c2=function(_0x3042cb){while(--_0x3042cb){_0x53ac44['push'](_0x53ac44['shift']());}};_0xac66c2(++_0x4a9ce0);}(_0x7c6a,0x113));var _0xa7c6=function(_0x14dbe2,_0xe4b4f8){_0x14dbe2=_0x14dbe2-0x0;var _0x100e5b=_0x7c6a[_0x14dbe2];return _0x100e5b;};'use strict';function QueueReport(){this['type']=_0xa7c6('0x0');this[_0xa7c6('0x1')]='';this[_0xa7c6('0x2')]='';this[_0xa7c6('0x3')]='';this[_0xa7c6('0x4')]='';this['queuecallerjoinAt']=null;this[_0xa7c6('0x5')]=null;this[_0xa7c6('0x6')]=0x1;this[_0xa7c6('0x7')]=0x1;this[_0xa7c6('0x8')]=![];this[_0xa7c6('0x9')]=null;this[_0xa7c6('0xa')]=![];this[_0xa7c6('0xb')]=null;this[_0xa7c6('0xc')]=![];this['queuecallerexitAt']=null;this[_0xa7c6('0xd')]=0x1;this[_0xa7c6('0xe')]='';this[_0xa7c6('0xf')]='';this['connectedlinename']='';this['accountcode']='';this[_0xa7c6('0x10')]='';this['exten']='';this['priority']='';this[_0xa7c6('0x11')]=0x0;this['assigned']=![];this[_0xa7c6('0x12')]='';this['mohtime']=0x0;this[_0xa7c6('0x13')]={};}module[_0xa7c6('0x14')]=QueueReport; \ No newline at end of file +var _0x73b5=['inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','context','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','exports','type'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0x73b5,0x72));var _0x573b=function(_0x2e5d39,_0x41f201){_0x2e5d39=_0x2e5d39-0x0;var _0x17812a=_0x73b5[_0x2e5d39];return _0x17812a;};'use strict';function QueueReport(){this[_0x573b('0x0')]=_0x573b('0x1');this[_0x573b('0x2')]='';this[_0x573b('0x3')]='';this[_0x573b('0x4')]='';this[_0x573b('0x5')]='';this[_0x573b('0x6')]=null;this[_0x573b('0x7')]=null;this[_0x573b('0x8')]=0x1;this['count']=0x1;this[_0x573b('0x9')]=![];this[_0x573b('0xa')]=null;this['queuecallercomplete']=![];this[_0x573b('0xb')]=null;this[_0x573b('0xc')]=![];this[_0x573b('0xd')]=null;this['originalposition']=0x1;this[_0x573b('0xe')]='';this['connectedlinenum']='';this['connectedlinename']='';this['accountcode']='';this[_0x573b('0xf')]='';this[_0x573b('0x10')]='';this[_0x573b('0x11')]='';this[_0x573b('0x12')]=0x0;this[_0x573b('0x13')]=![];this[_0x573b('0x14')]='';this[_0x573b('0x15')]=0x0;this['variables']={};}module[_0x573b('0x16')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index cddf87b..617539e 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 _0xc3f3=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations'];(function(_0x284ed1,_0x39d6aa){var _0x224064=function(_0x3d1d05){while(--_0x3d1d05){_0x284ed1['push'](_0x284ed1['shift']());}};_0x224064(++_0x39d6aa);}(_0xc3f3,0xd2));var _0x3c3f=function(_0x5046cc,_0x35d01a){_0x5046cc=_0x5046cc-0x0;var _0x2acf26=_0xc3f3[_0x5046cc];return _0x2acf26;};'use strict';function SalesforceAccount(_0x15b194){this['id']=_0x15b194['id']||0x0;this[_0x3c3f('0x0')]=_0x15b194[_0x3c3f('0x0')]||'';this[_0x3c3f('0x1')]=_0x15b194[_0x3c3f('0x1')]||'';this[_0x3c3f('0x2')]=_0x15b194[_0x3c3f('0x2')]||'';this[_0x3c3f('0x3')]=_0x15b194[_0x3c3f('0x3')]||'';this[_0x3c3f('0x4')]=_0x15b194[_0x3c3f('0x4')]||'';this[_0x3c3f('0x5')]=_0x15b194[_0x3c3f('0x5')]||'';this[_0x3c3f('0x6')]=_0x15b194[_0x3c3f('0x6')]||'';this[_0x3c3f('0x7')]=_0x15b194[_0x3c3f('0x7')]||'integrationTab';this[_0x3c3f('0x8')]=_0x15b194[_0x3c3f('0x8')]||'';this['Configurations']=_0x15b194[_0x3c3f('0x9')]||{};}module[_0x3c3f('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xcfa8=['clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId'];(function(_0x247f66,_0x1d4b11){var _0xd2fc1f=function(_0x3ec7f9){while(--_0x3ec7f9){_0x247f66['push'](_0x247f66['shift']());}};_0xd2fc1f(++_0x1d4b11);}(_0xcfa8,0xdf));var _0x8cfa=function(_0x4f1925,_0x47b4f4){_0x4f1925=_0x4f1925-0x0;var _0xaffa26=_0xcfa8[_0x4f1925];return _0xaffa26;};'use strict';function SalesforceAccount(_0x44f46a){this['id']=_0x44f46a['id']||0x0;this[_0x8cfa('0x0')]=_0x44f46a['name']||'';this[_0x8cfa('0x1')]=_0x44f46a[_0x8cfa('0x1')]||'';this[_0x8cfa('0x2')]=_0x44f46a[_0x8cfa('0x2')]||'';this['password']=_0x44f46a[_0x8cfa('0x3')]||'';this['clientId']=_0x44f46a[_0x8cfa('0x4')]||'';this[_0x8cfa('0x5')]=_0x44f46a[_0x8cfa('0x5')]||'';this[_0x8cfa('0x6')]=_0x44f46a[_0x8cfa('0x6')]||'';this[_0x8cfa('0x7')]=_0x44f46a[_0x8cfa('0x7')]||_0x8cfa('0x8');this[_0x8cfa('0x9')]=_0x44f46a['serverUrl']||'';this['Configurations']=_0x44f46a[_0x8cfa('0xa')]||{};}module[_0x8cfa('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 727ce5b..8a5a3dd 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 _0x52aa=['serverUrl','username','password','remoteUri'];(function(_0xe323e3,_0x110473){var _0x208a43=function(_0x18695c){while(--_0x18695c){_0xe323e3['push'](_0xe323e3['shift']());}};_0x208a43(++_0x110473);}(_0x52aa,0xc9));var _0xa52a=function(_0x36c8a9,_0x75a6e7){_0x36c8a9=_0x36c8a9-0x0;var _0x223186=_0x52aa[_0x36c8a9];return _0x223186;};'use strict';function ServicenowAccount(_0x55e58d){this['id']=_0x55e58d['id']||0x0;this['name']=_0x55e58d['name']||'';this[_0xa52a('0x0')]=_0x55e58d['username']||'';this[_0xa52a('0x1')]=_0x55e58d[_0xa52a('0x1')]||'';this[_0xa52a('0x2')]=_0x55e58d[_0xa52a('0x2')]||'';this[_0xa52a('0x3')]=_0x55e58d[_0xa52a('0x3')]||'';this['Configurations']=_0x55e58d['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x6f4f=['name','username','password','remoteUri','Configurations','exports'];(function(_0x3773d7,_0x32ed42){var _0x995994=function(_0x58df8d){while(--_0x58df8d){_0x3773d7['push'](_0x3773d7['shift']());}};_0x995994(++_0x32ed42);}(_0x6f4f,0x156));var _0xf6f4=function(_0x5bb0c5,_0x58e513){_0x5bb0c5=_0x5bb0c5-0x0;var _0x2a5336=_0x6f4f[_0x5bb0c5];return _0x2a5336;};'use strict';function ServicenowAccount(_0x48dc4c){this['id']=_0x48dc4c['id']||0x0;this[_0xf6f4('0x0')]=_0x48dc4c[_0xf6f4('0x0')]||'';this['username']=_0x48dc4c[_0xf6f4('0x1')]||'';this[_0xf6f4('0x2')]=_0x48dc4c[_0xf6f4('0x2')]||'';this[_0xf6f4('0x3')]=_0x48dc4c[_0xf6f4('0x3')]||'';this['serverUrl']=_0x48dc4c['serverUrl']||'';this[_0xf6f4('0x4')]=_0x48dc4c[_0xf6f4('0x4')]||{};}module[_0xf6f4('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index e67cb94..1339428 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 _0x47d1=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x468b23,_0x458fc8){var _0x12f52c=function(_0x1f5efc){while(--_0x1f5efc){_0x468b23['push'](_0x468b23['shift']());}};_0x12f52c(++_0x458fc8);}(_0x47d1,0x164));var _0x147d=function(_0x57c8bd,_0x15e7d1){_0x57c8bd=_0x57c8bd-0x0;var _0x5ce1ca=_0x47d1[_0x57c8bd];return _0x5ce1ca;};'use strict';function SugarcrmAccount(_0x3b8fad){this['id']=_0x3b8fad['id']||0x0;this[_0x147d('0x0')]=_0x3b8fad[_0x147d('0x0')]||'';this[_0x147d('0x1')]=_0x3b8fad[_0x147d('0x1')]||'';this[_0x147d('0x2')]=_0x3b8fad[_0x147d('0x2')]||'';this['remoteUri']=_0x3b8fad[_0x147d('0x3')]||'';this[_0x147d('0x4')]=_0x3b8fad['serverUrl']||'';this[_0x147d('0x5')]=_0x3b8fad[_0x147d('0x5')]||{};}module[_0x147d('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x5170=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x2c9d92,_0x3d43fc){var _0x1f30b9=function(_0x3abfbe){while(--_0x3abfbe){_0x2c9d92['push'](_0x2c9d92['shift']());}};_0x1f30b9(++_0x3d43fc);}(_0x5170,0x10b));var _0x0517=function(_0x36079c,_0x58254b){_0x36079c=_0x36079c-0x0;var _0x126aae=_0x5170[_0x36079c];return _0x126aae;};'use strict';function SugarcrmAccount(_0x1043d1){this['id']=_0x1043d1['id']||0x0;this[_0x0517('0x0')]=_0x1043d1['name']||'';this['username']=_0x1043d1[_0x0517('0x1')]||'';this[_0x0517('0x2')]=_0x1043d1['password']||'';this[_0x0517('0x3')]=_0x1043d1[_0x0517('0x3')]||'';this[_0x0517('0x4')]=_0x1043d1['serverUrl']||'';this[_0x0517('0x5')]=_0x1043d1[_0x0517('0x5')]||{};}module[_0x0517('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index e868151..5765ce2 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 _0x6474=['exports','name','state','stateTime','status','unknown','address'];(function(_0x53c3f2,_0x274d14){var _0x1756b5=function(_0x42407a){while(--_0x42407a){_0x53c3f2['push'](_0x53c3f2['shift']());}};_0x1756b5(++_0x274d14);}(_0x6474,0x1f2));var _0x4647=function(_0xcb23cb,_0x400832){_0xcb23cb=_0xcb23cb-0x0;var _0x37662e=_0x6474[_0xcb23cb];return _0x37662e;};'use strict';function Telephone(_0x5eaf16){this['id']=_0x5eaf16['id']||0x0;this['name']=_0x5eaf16[_0x4647('0x0')]||'';this['accountcode']=_0x5eaf16['accountcode']||'';this[_0x4647('0x1')]='unknown';this[_0x4647('0x2')]=0x0;this[_0x4647('0x3')]=_0x4647('0x4');this[_0x4647('0x5')]='';}module[_0x4647('0x6')]=Telephone; \ No newline at end of file +var _0xd983=['unknown','address','exports','name','accountcode','stateTime','status'];(function(_0x5dae65,_0x1874d0){var _0x4dcd2b=function(_0x29d2a3){while(--_0x29d2a3){_0x5dae65['push'](_0x5dae65['shift']());}};_0x4dcd2b(++_0x1874d0);}(_0xd983,0x1df));var _0x3d98=function(_0x274088,_0x17b85f){_0x274088=_0x274088-0x0;var _0x261740=_0xd983[_0x274088];return _0x261740;};'use strict';function Telephone(_0x3838c2){this['id']=_0x3838c2['id']||0x0;this[_0x3d98('0x0')]=_0x3838c2[_0x3d98('0x0')]||'';this[_0x3d98('0x1')]=_0x3838c2[_0x3d98('0x1')]||'';this['state']='unknown';this[_0x3d98('0x2')]=0x0;this[_0x3d98('0x3')]=_0x3d98('0x4');this[_0x3d98('0x5')]='';}module[_0x3d98('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 80ba407..a2f5dd7 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(_0x2783b3,_0x191baf){var _0x461d3a=function(_0x2e49d3){while(--_0x2e49d3){_0x2783b3['push'](_0x2783b3['shift']());}};_0x461d3a(++_0x191baf);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x3b7768,_0x52bf3a){var _0xa15bea=function(_0x23a5aa){while(--_0x23a5aa){_0x3b7768['push'](_0x3b7768['shift']());}};_0xa15bea(++_0x52bf3a);}(_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 diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index c4ce3ba..ae1cdf2 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x168638,_0x55e699){var _0x4b780b=function(_0x32c18e){while(--_0x32c18e){_0x168638['push'](_0x168638['shift']());}};_0x4b780b(++_0x55e699);}(_0xb10b,0x12a));var _0xbb10=function(_0x5754c1,_0x564a97){_0x5754c1=_0x5754c1-0x0;var _0x242cef=_0xb10b[_0x5754c1];return _0x242cef;};'use strict';function Trigger(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'voice';this[_0xbb10('0x2')]=_0x13ce8d[_0xbb10('0x2')]||![];this[_0xbb10('0x3')]=_0x13ce8d[_0xbb10('0x3')]||[];this[_0xbb10('0x4')]=_0x13ce8d[_0xbb10('0x4')]||[];this['Actions']=_0x13ce8d[_0xbb10('0x5')]||[];}module[_0xbb10('0x6')]=Trigger; \ No newline at end of file +var _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x553ee8,_0x5e2f6a){var _0x90f4f5=function(_0x40425a){while(--_0x40425a){_0x553ee8['push'](_0x553ee8['shift']());}};_0x90f4f5(++_0x5e2f6a);}(_0xda2d,0x102));var _0xdda2=function(_0x254dc4,_0x1be066){_0x254dc4=_0x254dc4-0x0;var _0x69d123=_0xda2d[_0x254dc4];return _0x69d123;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 42878f4..752bbd4 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 _0x5481=['defaultuser','exports','active','name','unknown','status','registry','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address'];(function(_0x11e2e6,_0x2e9231){var _0x5a638c=function(_0x38f182){while(--_0x38f182){_0x11e2e6['push'](_0x11e2e6['shift']());}};_0x5a638c(++_0x2e9231);}(_0x5481,0xf2));var _0x1548=function(_0xc7bb6e,_0x2900c3){_0xc7bb6e=_0xc7bb6e-0x0;var _0x2a6291=_0x5481[_0xc7bb6e];return _0x2a6291;};'use strict';function Trunk(_0xcf0ec8){this['id']=_0xcf0ec8['id']||0x0;this[_0x1548('0x0')]=_0xcf0ec8['active']||![];this[_0x1548('0x1')]=_0xcf0ec8[_0x1548('0x1')]||'';this['state']=_0x1548('0x2');this['stateTime']=0x0;this[_0x1548('0x3')]=_0x1548('0x2');this[_0x1548('0x4')]=_0xcf0ec8[_0x1548('0x4')]&&_0xcf0ec8[_0x1548('0x4')]['indexOf'](':')?_0xcf0ec8['registry'][_0x1548('0x5')](':')[0x0]:'';this[_0x1548('0x6')]='';this[_0x1548('0x7')]='';this[_0x1548('0x8')]='';this[_0x1548('0x9')]='';this[_0x1548('0xa')]='';this[_0x1548('0xb')]=_0x1548('0x2');this[_0x1548('0xc')]='';this[_0x1548('0xd')]='';this[_0x1548('0xe')]=_0xcf0ec8[_0x1548('0xe')]||'';}module[_0x1548('0xf')]=Trunk; \ No newline at end of file +var _0x3bbc=['state','stateTime','status','unknown','registry','host','port','domain','domainport','refresh','registrationtime','address','defaultuser','exports','active','name'];(function(_0x25392e,_0x3ec5d9){var _0x5b09c5=function(_0x154619){while(--_0x154619){_0x25392e['push'](_0x25392e['shift']());}};_0x5b09c5(++_0x3ec5d9);}(_0x3bbc,0x1de));var _0xc3bb=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3bbc[_0x3bf83f];return _0x22c4a9;};'use strict';function Trunk(_0x1b9799){this['id']=_0x1b9799['id']||0x0;this[_0xc3bb('0x0')]=_0x1b9799['active']||![];this[_0xc3bb('0x1')]=_0x1b9799['name']||'';this[_0xc3bb('0x2')]='unknown';this[_0xc3bb('0x3')]=0x0;this[_0xc3bb('0x4')]=_0xc3bb('0x5');this[_0xc3bb('0x6')]=_0x1b9799[_0xc3bb('0x6')]&&_0x1b9799['registry']['indexOf'](':')?_0x1b9799[_0xc3bb('0x6')]['split'](':')[0x0]:'';this[_0xc3bb('0x7')]='';this[_0xc3bb('0x8')]='';this[_0xc3bb('0x9')]='';this[_0xc3bb('0xa')]='';this[_0xc3bb('0xb')]='';this['stateRegistry']=_0xc3bb('0x5');this[_0xc3bb('0xc')]='';this[_0xc3bb('0xd')]='';this[_0xc3bb('0xe')]=_0x1b9799[_0xc3bb('0xe')]||'';}module[_0xc3bb('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 249af14..c63e261 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 _0xa092=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa092,0x185));var _0x2a09=function(_0x374ff6,_0x30546f){_0x374ff6=_0x374ff6-0x0;var _0x58203b=_0xa092[_0x374ff6];return _0x58203b;};'use strict';function voiceExtension(_0xfad5d6){this['id']=_0xfad5d6['id']||0x0;this['exten']=_0xfad5d6[_0x2a09('0x0')]||'';this[_0x2a09('0x1')]=_0xfad5d6[_0x2a09('0x1')]||'none';this[_0x2a09('0x2')]=_0xfad5d6['mandatoryDisposition']||![];}module[_0x2a09('0x3')]=voiceExtension; \ No newline at end of file +var _0x9670=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x5b18d5,_0x1023e0){var _0x3e3aa0=function(_0x3b2717){while(--_0x3b2717){_0x5b18d5['push'](_0x5b18d5['shift']());}};_0x3e3aa0(++_0x1023e0);}(_0x9670,0x1a9));var _0x0967=function(_0x44d424,_0x33b31d){_0x44d424=_0x44d424-0x0;var _0x16e4d5=_0x9670[_0x44d424];return _0x16e4d5;};'use strict';function voiceExtension(_0x39ac6c){this['id']=_0x39ac6c['id']||0x0;this[_0x0967('0x0')]=_0x39ac6c[_0x0967('0x0')]||'';this[_0x0967('0x1')]=_0x39ac6c['recordingFormat']||_0x0967('0x2');this['mandatoryDisposition']=_0x39ac6c[_0x0967('0x3')]||![];}module[_0x0967('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 35622b4..c0bea49 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 _0xe666=['dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundReCallsDay','outboundAbandonedDay','startProgressive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','busy','unavailable','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','type','inbound','waiting','talking','answered','sumDuration','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe666,0x189));var _0x6e66=function(_0x4accd7,_0x344a24){_0x4accd7=_0x4accd7-0x0;var _0x207891=_0xe666[_0x4accd7];return _0x207891;};'use strict';var statusDesc=[_0x6e66('0x0'),'not_inuse','inuse',_0x6e66('0x1'),'invalid',_0x6e66('0x2'),'ringing',_0x6e66('0x3'),'onhold'];var monitorFormat={'wav':_0x6e66('0x4'),'wav49':_0x6e66('0x5'),'gsm':_0x6e66('0x6')};var strategy={'rrmemory':_0x6e66('0x7'),'roundrobin':_0x6e66('0x8')};function VoiceQueue(_0x4db3ea){this['id']=_0x4db3ea['id']||0x0;this['name']=_0x4db3ea['name']||'';this['monitor_format']=_0x4db3ea['monitor_format']||'';this[_0x6e66('0x9')]=_0x4db3ea[_0x6e66('0x9')]||_0x6e66('0xa');this[_0x6e66('0xb')]=0x0;this[_0x6e66('0xc')]=0x0;this['total']=0x0;this[_0x6e66('0xd')]=0x0;this[_0x6e66('0xe')]=0x0;this['sumHoldTime']=0x0;this[_0x6e66('0xf')]=0x0;this['unmanaged']=0x0;this[_0x6e66('0x10')]=0x0;this[_0x6e66('0x11')]=0x0;this[_0x6e66('0x12')]=0x0;this[_0x6e66('0x13')]=_0x4db3ea['acw']||![];this[_0x6e66('0x14')]=_0x4db3ea[_0x6e66('0x14')]||0xa;this[_0x6e66('0x15')]=_0x4db3ea[_0x6e66('0x15')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x6e66('0x16')]=0x0;this[_0x6e66('0x17')]=0x0;this[_0x6e66('0x18')]=_0x4db3ea[_0x6e66('0x18')]||null;this['dialGlobalInterval']=_0x4db3ea[_0x6e66('0x19')]?_0x4db3ea['dialGlobalInterval']:null;this[_0x6e66('0x1a')]=_0x4db3ea[_0x6e66('0x1a')];this[_0x6e66('0x1b')]=_0x4db3ea[_0x6e66('0x1b')]||_0x6e66('0x1c');this[_0x6e66('0x1d')]=_0x4db3ea[_0x6e66('0x1d')]||0x0;this[_0x6e66('0x1e')]=_0x4db3ea[_0x6e66('0x1e')]||0x0;this[_0x6e66('0x1f')]=_0x4db3ea[_0x6e66('0x1f')]||0x1;this[_0x6e66('0x20')]=_0x4db3ea[_0x6e66('0x20')]||_0x6e66('0x21');this['dialPredictiveOptimizationPercentage']=_0x4db3ea[_0x6e66('0x22')]||0.03;this[_0x6e66('0x23')]=_0x4db3ea['dialPredictiveInterval']||0x258;this[_0x6e66('0x24')]=_0x4db3ea['dialOriginateCallerIdName']||_0x6e66('0x25');this[_0x6e66('0x26')]=_0x4db3ea[_0x6e66('0x26')]||_0x6e66('0x25');this[_0x6e66('0x27')]=_0x4db3ea['dialOriginateTimeout']||0x1e;this[_0x6e66('0x28')]=_0x4db3ea['dialQueueOptions']||_0x6e66('0x29');this[_0x6e66('0x2a')]=_0x4db3ea['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x4db3ea[_0x6e66('0x2b')]||undefined;this['dialCongestionMaxRetry']=_0x4db3ea[_0x6e66('0x2c')]||0x3;this[_0x6e66('0x2d')]=_0x4db3ea['dialCongestionRetryFrequency']||0x96;this[_0x6e66('0x2e')]=_0x4db3ea[_0x6e66('0x2e')]||0x3;this[_0x6e66('0x2f')]=_0x4db3ea[_0x6e66('0x2f')]||0x96;this['dialNoAnswerMaxRetry']=_0x4db3ea[_0x6e66('0x30')]||0x3;this['dialNoAnswerRetryFrequency']=_0x4db3ea[_0x6e66('0x31')]||0x96;this[_0x6e66('0x32')]=_0x4db3ea[_0x6e66('0x32')]||0x3;this[_0x6e66('0x33')]=_0x4db3ea[_0x6e66('0x33')]||0x96;this[_0x6e66('0x34')]=_0x4db3ea[_0x6e66('0x34')]||0x3;this['dialDropRetryFrequency']=_0x4db3ea[_0x6e66('0x35')]||0x96;this[_0x6e66('0x36')]=_0x4db3ea[_0x6e66('0x36')]||0x3;this[_0x6e66('0x37')]=_0x4db3ea['dialAbandonedRetryFrequency']||0x96;this[_0x6e66('0x38')]=_0x4db3ea[_0x6e66('0x38')]||0x3;this[_0x6e66('0x39')]=_0x4db3ea[_0x6e66('0x39')]||0x96;this['dialAgentRejectMaxRetry']=_0x4db3ea[_0x6e66('0x3a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x4db3ea[_0x6e66('0x3b')]||0x96;this['dialGlobalMaxRetry']=_0x4db3ea[_0x6e66('0x3c')]||0x4;this[_0x6e66('0x3d')]=_0x4db3ea[_0x6e66('0x3d')]?_0x4db3ea[_0x6e66('0x3d')]:undefined;this[_0x6e66('0x3e')]=_0x4db3ea[_0x6e66('0x3e')]?_0x4db3ea['TrunkBackup']:undefined;this['dialPrefix']=_0x4db3ea[_0x6e66('0x3f')]||undefined;this[_0x6e66('0x40')]=_0x4db3ea['Interval']?_0x4db3ea[_0x6e66('0x40')]:undefined;this[_0x6e66('0x41')]=_0x4db3ea[_0x6e66('0x41')]||'DESC';this[_0x6e66('0x42')]=_0x4db3ea[_0x6e66('0x42')]||undefined;this[_0x6e66('0x43')]=_0x4db3ea[_0x6e66('0x43')]||undefined;this[_0x6e66('0x44')]=strategy[_0x4db3ea['strategy']]||_0x6e66('0x7');this[_0x6e66('0x45')]=!![];this[_0x6e66('0x46')]=_0x4db3ea['dialAMDActive']||![];this[_0x6e66('0x47')]=_0x4db3ea[_0x6e66('0x47')];this['dialAMDGreeting']=_0x4db3ea['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x4db3ea['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x4db3ea[_0x6e66('0x48')];this[_0x6e66('0x49')]=_0x4db3ea[_0x6e66('0x49')];this[_0x6e66('0x4a')]=_0x4db3ea[_0x6e66('0x4a')];this[_0x6e66('0x4b')]=_0x4db3ea['dialAMDMaximumNumberOfWords'];this[_0x6e66('0x4c')]=_0x4db3ea[_0x6e66('0x4c')];this[_0x6e66('0x4d')]=_0x4db3ea[_0x6e66('0x4d')];this[_0x6e66('0x4e')]=0x0;this[_0x6e66('0x4f')]=0x0;this[_0x6e66('0x50')]=_0x4db3ea[_0x6e66('0x50')];this[_0x6e66('0x51')]=0x0;this[_0x6e66('0x52')]=0x0;this[_0x6e66('0x53')]=0x0;this[_0x6e66('0x54')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x6e66('0x55')]=0x0;this[_0x6e66('0x56')]=0x0;this[_0x6e66('0x57')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x6e66('0x58')]=0x0;this[_0x6e66('0x59')]=0x0;this[_0x6e66('0x5a')]=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this[_0x6e66('0x5b')]=1.05;this[_0x6e66('0x5c')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x6e66('0x5d')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x6e66('0x5e')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x6e66('0x5f')]=0x0;this[_0x6e66('0x60')]=_0x4db3ea['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x6e66('0x61')]=_0x4db3ea[_0x6e66('0x62')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0x6e66('0x63')]=0x0;this[_0x6e66('0x64')]=0x0;this['erlangBusyFactor']=0x0;this[_0x6e66('0x65')]=_0x4db3ea[_0x6e66('0x65')]||0x1e;this['dialRecallInQueue']=_0x4db3ea[_0x6e66('0x66')]||![];this[_0x6e66('0x67')]=_0x4db3ea['dialQueueProject2']||undefined;this[_0x6e66('0x68')]=_0x4db3ea[_0x6e66('0x68')]||![];this[_0x6e66('0x69')]=_0x4db3ea['dialAgiAfterHangupAgent']||![];this[_0x6e66('0x6a')]=monitorFormat[_0x4db3ea['monitor_format']]?monitorFormat[_0x4db3ea[_0x6e66('0x6a')]]:undefined;this[_0x6e66('0x6b')]=_0x4db3ea['mandatoryDisposition']||![];this[_0x6e66('0x6c')]=_0x4db3ea[_0x6e66('0x6c')]?_0x4db3ea[_0x6e66('0x6c')]:undefined;}module[_0x6e66('0x6d')]=VoiceQueue; \ No newline at end of file +var _0x6194=['predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','invalid','ringing','ringinuse','wav','wav49','rrmemory','name','monitor_format','type','waiting','talking','total','answered','sumDuration','sumBillable','unmanaged','abandoned','loggedIn','available','acw','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor'];(function(_0x4b4b1a,_0x276dd5){var _0x5056ec=function(_0x362ac7){while(--_0x362ac7){_0x4b4b1a['push'](_0x4b4b1a['shift']());}};_0x5056ec(++_0x276dd5);}(_0x6194,0x173));var _0x4619=function(_0x567d04,_0x3d13a1){_0x567d04=_0x567d04-0x0;var _0x58ee79=_0x6194[_0x567d04];return _0x58ee79;};'use strict';var statusDesc=['unknown',_0x4619('0x0'),_0x4619('0x1'),'busy',_0x4619('0x2'),'unavailable',_0x4619('0x3'),_0x4619('0x4'),'onhold'];var monitorFormat={'wav':_0x4619('0x5'),'wav49':_0x4619('0x6'),'gsm':'gsm'};var strategy={'rrmemory':_0x4619('0x7'),'roundrobin':'roundrobin'};function VoiceQueue(_0x12426d){this['id']=_0x12426d['id']||0x0;this['name']=_0x12426d[_0x4619('0x8')]||'';this[_0x4619('0x9')]=_0x12426d[_0x4619('0x9')]||'';this[_0x4619('0xa')]=_0x12426d[_0x4619('0xa')]||'inbound';this[_0x4619('0xb')]=0x0;this[_0x4619('0xc')]=0x0;this[_0x4619('0xd')]=0x0;this[_0x4619('0xe')]=0x0;this[_0x4619('0xf')]=0x0;this['sumHoldTime']=0x0;this[_0x4619('0x10')]=0x0;this[_0x4619('0x11')]=0x0;this[_0x4619('0x12')]=0x0;this[_0x4619('0x13')]=0x0;this[_0x4619('0x14')]=0x0;this[_0x4619('0x15')]=_0x12426d[_0x4619('0x15')]||![];this['acwTimeout']=_0x12426d['acwTimeout']||0xa;this['autopause']=_0x12426d['autopause']||'no';this[_0x4619('0x16')]=!![];this[_0x4619('0x17')]='';this[_0x4619('0x18')]=0x0;this[_0x4619('0x19')]=0x0;this['dialTimezone']=_0x12426d[_0x4619('0x1a')]||null;this['dialGlobalInterval']=_0x12426d[_0x4619('0x1b')]?_0x12426d[_0x4619('0x1b')]:null;this[_0x4619('0x1c')]=_0x12426d[_0x4619('0x1c')];this[_0x4619('0x1d')]=_0x12426d[_0x4619('0x1d')]||_0x4619('0x1e');this['dialLimitChannel']=_0x12426d[_0x4619('0x1f')]||0x0;this['dialLimitQueue']=_0x12426d[_0x4619('0x20')]||0x0;this[_0x4619('0x21')]=_0x12426d[_0x4619('0x21')]||0x1;this[_0x4619('0x22')]=_0x12426d['dialPredictiveOptimization']||_0x4619('0x23');this['dialPredictiveOptimizationPercentage']=_0x12426d[_0x4619('0x24')]||0.03;this['dialPredictiveInterval']=_0x12426d[_0x4619('0x25')]||0x258;this[_0x4619('0x26')]=_0x12426d[_0x4619('0x26')]||'anonymous';this[_0x4619('0x27')]=_0x12426d[_0x4619('0x27')]||_0x4619('0x28');this[_0x4619('0x29')]=_0x12426d[_0x4619('0x29')]||0x1e;this['dialQueueOptions']=_0x12426d[_0x4619('0x2a')]||_0x4619('0x2b');this[_0x4619('0x2c')]=_0x12426d[_0x4619('0x2c')]||0x3;this['dialQueueProject']=_0x12426d['dialQueueProject']||undefined;this[_0x4619('0x2d')]=_0x12426d[_0x4619('0x2d')]||0x3;this[_0x4619('0x2e')]=_0x12426d['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x12426d['dialBusyMaxRetry']||0x3;this[_0x4619('0x2f')]=_0x12426d[_0x4619('0x2f')]||0x96;this[_0x4619('0x30')]=_0x12426d['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x12426d[_0x4619('0x31')]||0x96;this[_0x4619('0x32')]=_0x12426d[_0x4619('0x32')]||0x3;this[_0x4619('0x33')]=_0x12426d[_0x4619('0x33')]||0x96;this[_0x4619('0x34')]=_0x12426d[_0x4619('0x34')]||0x3;this[_0x4619('0x35')]=_0x12426d[_0x4619('0x35')]||0x96;this['dialAbandonedMaxRetry']=_0x12426d[_0x4619('0x36')]||0x3;this[_0x4619('0x37')]=_0x12426d[_0x4619('0x37')]||0x96;this['dialMachineMaxRetry']=_0x12426d[_0x4619('0x38')]||0x3;this[_0x4619('0x39')]=_0x12426d[_0x4619('0x39')]||0x96;this['dialAgentRejectMaxRetry']=_0x12426d[_0x4619('0x3a')]||0x3;this[_0x4619('0x3b')]=_0x12426d[_0x4619('0x3b')]||0x96;this[_0x4619('0x3c')]=_0x12426d[_0x4619('0x3c')]||0x4;this[_0x4619('0x3d')]=_0x12426d[_0x4619('0x3d')]?_0x12426d[_0x4619('0x3d')]:undefined;this['TrunkBackup']=_0x12426d['TrunkBackup']?_0x12426d[_0x4619('0x3e')]:undefined;this[_0x4619('0x3f')]=_0x12426d['dialPrefix']||undefined;this[_0x4619('0x40')]=_0x12426d['Interval']?_0x12426d[_0x4619('0x40')]:undefined;this['dialOrderByScheduledAt']=_0x12426d['dialOrderByScheduledAt']||_0x4619('0x41');this[_0x4619('0x42')]=_0x12426d[_0x4619('0x42')]||undefined;this[_0x4619('0x43')]=_0x12426d[_0x4619('0x43')]||undefined;this[_0x4619('0x44')]=strategy[_0x12426d[_0x4619('0x44')]]||'rrmemory';this['queueStatusComplete']=!![];this['dialAMDActive']=_0x12426d['dialAMDActive']||![];this[_0x4619('0x45')]=_0x12426d['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x12426d['dialAMDGreeting'];this[_0x4619('0x46')]=_0x12426d[_0x4619('0x46')];this[_0x4619('0x47')]=_0x12426d[_0x4619('0x47')];this['dialAMDMinWordLength']=_0x12426d['dialAMDMinWordLength'];this[_0x4619('0x48')]=_0x12426d[_0x4619('0x48')];this[_0x4619('0x49')]=_0x12426d[_0x4619('0x49')];this[_0x4619('0x4a')]=_0x12426d[_0x4619('0x4a')];this['dialAMDMaximumWordLength']=_0x12426d[_0x4619('0x4b')];this[_0x4619('0x4c')]=0x0;this['pTalking']=0x0;this['timeout']=_0x12426d[_0x4619('0x4d')];this[_0x4619('0x4e')]=0x0;this[_0x4619('0x4f')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x4619('0x50')]=0x0;this[_0x4619('0x51')]=0x0;this[_0x4619('0x52')]=0x0;this[_0x4619('0x53')]=0x0;this[_0x4619('0x54')]=0x0;this[_0x4619('0x55')]=0x0;this[_0x4619('0x56')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x4619('0x57')]=0x0;this[_0x4619('0x58')]=0x0;this[_0x4619('0x59')]=0x0;this[_0x4619('0x5a')]=undefined;this['startPredictive']=undefined;this[_0x4619('0x5b')]=undefined;this[_0x4619('0x5c')]=1.05;this[_0x4619('0x5d')]=0x0;this[_0x4619('0x5e')]=0x0;this[_0x4619('0x5f')]=0x0;this[_0x4619('0x60')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x4619('0x61')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x4619('0x62')]=0x0;this[_0x4619('0x63')]=_0x12426d[_0x4619('0x64')]||0x14;this[_0x4619('0x65')]=_0x12426d[_0x4619('0x64')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x4619('0x66')]=0x0;this[_0x4619('0x67')]=0x1;this[_0x4619('0x68')]=0x0;this[_0x4619('0x69')]=0x0;this[_0x4619('0x6a')]=0x0;this[_0x4619('0x6b')]=0x0;this[_0x4619('0x6c')]=_0x12426d[_0x4619('0x6c')]||0x1e;this[_0x4619('0x6d')]=_0x12426d[_0x4619('0x6d')]||![];this[_0x4619('0x6e')]=_0x12426d['dialQueueProject2']||undefined;this[_0x4619('0x6f')]=_0x12426d[_0x4619('0x6f')]||![];this[_0x4619('0x70')]=_0x12426d[_0x4619('0x70')]||![];this[_0x4619('0x9')]=monitorFormat[_0x12426d[_0x4619('0x9')]]?monitorFormat[_0x12426d[_0x4619('0x9')]]:undefined;this[_0x4619('0x71')]=_0x12426d[_0x4619('0x71')]||![];this[_0x4619('0x72')]=_0x12426d[_0x4619('0x72')]?_0x12426d['mandatoryDispositionPause']:undefined;}module[_0x4619('0x73')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index c4a0c46..1fbb9d6 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 _0x6e06=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x59a591,_0xc9132b){var _0x325ff9=function(_0x1e06f5){while(--_0x1e06f5){_0x59a591['push'](_0x59a591['shift']());}};_0x325ff9(++_0xc9132b);}(_0x6e06,0x10d));var _0x66e0=function(_0x16da8f,_0x4ddb80){_0x16da8f=_0x16da8f-0x0;var _0xd5dca8=_0x6e06[_0x16da8f];return _0xd5dca8;};'use strict';function VtigerAccount(_0x4be7a9){this['id']=_0x4be7a9['id']||0x0;this[_0x66e0('0x0')]=_0x4be7a9[_0x66e0('0x0')]||'';this[_0x66e0('0x1')]=_0x4be7a9[_0x66e0('0x1')]||'';this['accessKey']=_0x4be7a9[_0x66e0('0x2')]||'';this[_0x66e0('0x3')]=_0x4be7a9[_0x66e0('0x3')]||'';this[_0x66e0('0x4')]=_0x4be7a9[_0x66e0('0x4')]||'';this[_0x66e0('0x5')]=_0x4be7a9[_0x66e0('0x5')]||{};}module[_0x66e0('0x6')]=VtigerAccount; \ No newline at end of file +var _0x02d4=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x4c9316,_0x5c7f6f){var _0x146aad=function(_0x4fa179){while(--_0x4fa179){_0x4c9316['push'](_0x4c9316['shift']());}};_0x146aad(++_0x5c7f6f);}(_0x02d4,0x1ca));var _0x402d=function(_0x10492c,_0x5f4911){_0x10492c=_0x10492c-0x0;var _0x49850f=_0x02d4[_0x10492c];return _0x49850f;};'use strict';function VtigerAccount(_0x31cb7d){this['id']=_0x31cb7d['id']||0x0;this[_0x402d('0x0')]=_0x31cb7d['name']||'';this['username']=_0x31cb7d[_0x402d('0x1')]||'';this['accessKey']=_0x31cb7d[_0x402d('0x2')]||'';this[_0x402d('0x3')]=_0x31cb7d[_0x402d('0x3')]||'';this[_0x402d('0x4')]=_0x31cb7d[_0x402d('0x4')]||'';this[_0x402d('0x5')]=_0x31cb7d[_0x402d('0x5')]||{};}module[_0x402d('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 67dbb4a..e6c2011 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 _0x4db2=['name','username','password','remoteUri','authType','type','serverUrl','Configurations','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4db2,0xcf));var _0x24db=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x4db2[_0x540dcb];return _0x49353c;};'use strict';function ZendeskAccount(_0x4f2edf){this['id']=_0x4f2edf['id']||0x0;this['name']=_0x4f2edf[_0x24db('0x0')]||'';this['username']=_0x4f2edf[_0x24db('0x1')]||'';this[_0x24db('0x2')]=_0x4f2edf['password']||'';this['token']=_0x4f2edf['token']||'';this[_0x24db('0x3')]=_0x4f2edf[_0x24db('0x3')]||'';this[_0x24db('0x4')]=_0x4f2edf[_0x24db('0x4')]||'';this[_0x24db('0x5')]=_0x4f2edf[_0x24db('0x5')]||'integrationTab';this[_0x24db('0x6')]=_0x4f2edf['serverUrl']||'';this[_0x24db('0x7')]=_0x4f2edf[_0x24db('0x7')]||{};}module[_0x24db('0x8')]=ZendeskAccount; \ No newline at end of file +var _0x7aa2=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0x7aa2,0x12c));var _0x27aa=function(_0x59f97a,_0x511696){_0x59f97a=_0x59f97a-0x0;var _0x411b33=_0x7aa2[_0x59f97a];return _0x411b33;};'use strict';function ZendeskAccount(_0x453c12){this['id']=_0x453c12['id']||0x0;this['name']=_0x453c12[_0x27aa('0x0')]||'';this[_0x27aa('0x1')]=_0x453c12[_0x27aa('0x1')]||'';this[_0x27aa('0x2')]=_0x453c12[_0x27aa('0x2')]||'';this[_0x27aa('0x3')]=_0x453c12[_0x27aa('0x3')]||'';this[_0x27aa('0x4')]=_0x453c12[_0x27aa('0x4')]||'';this[_0x27aa('0x5')]=_0x453c12[_0x27aa('0x5')]||'';this[_0x27aa('0x6')]=_0x453c12['type']||_0x27aa('0x7');this[_0x27aa('0x8')]=_0x453c12['serverUrl']||'';this[_0x27aa('0x9')]=_0x453c12[_0x27aa('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index dae5d0c..e6dfb38 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 _0xeace=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x460698,_0x5a4a1a){var _0x4b39e7=function(_0x1ffae6){while(--_0x1ffae6){_0x460698['push'](_0x460698['shift']());}};_0x4b39e7(++_0x5a4a1a);}(_0xeace,0x64));var _0xeeac=function(_0x55d631,_0x431039){_0x55d631=_0x55d631-0x0;var _0x32278a=_0xeace[_0x55d631];return _0x32278a;};'use strict';function ZohoAccount(_0xc4a1dd){this['id']=_0xc4a1dd['id']||0x0;this['name']=_0xc4a1dd['name']||'';this[_0xeeac('0x0')]=_0xc4a1dd[_0xeeac('0x0')]||'';this[_0xeeac('0x1')]=_0xc4a1dd[_0xeeac('0x1')]||'';this[_0xeeac('0x2')]=_0xc4a1dd[_0xeeac('0x2')]||'';this[_0xeeac('0x3')]=_0xc4a1dd[_0xeeac('0x3')]||'';this[_0xeeac('0x4')]=_0xc4a1dd['clientSecret']||'';this[_0xeeac('0x5')]=_0xc4a1dd[_0xeeac('0x5')]||'';this['code']=_0xc4a1dd[_0xeeac('0x6')]||'';this[_0xeeac('0x7')]=_0xc4a1dd[_0xeeac('0x7')]||'';this[_0xeeac('0x8')]=_0xc4a1dd[_0xeeac('0x8')]||{};}module[_0xeeac('0x9')]=ZohoAccount; \ No newline at end of file +var _0xebaf=['description','host','zone','clientId','serverUrl','code','refreshToken','Configurations','exports','name'];(function(_0x4fe5e3,_0x23f888){var _0x27152d=function(_0x5164ef){while(--_0x5164ef){_0x4fe5e3['push'](_0x4fe5e3['shift']());}};_0x27152d(++_0x23f888);}(_0xebaf,0x18f));var _0xfeba=function(_0x49691f,_0x300f5c){_0x49691f=_0x49691f-0x0;var _0x2a7130=_0xebaf[_0x49691f];return _0x2a7130;};'use strict';function ZohoAccount(_0x17482a){this['id']=_0x17482a['id']||0x0;this[_0xfeba('0x0')]=_0x17482a[_0xfeba('0x0')]||'';this['description']=_0x17482a[_0xfeba('0x1')]||'';this['host']=_0x17482a[_0xfeba('0x2')]||'';this['zone']=_0x17482a[_0xfeba('0x3')]||'';this[_0xfeba('0x4')]=_0x17482a['clientId']||'';this['clientSecret']=_0x17482a['clientSecret']||'';this[_0xfeba('0x5')]=_0x17482a[_0xfeba('0x5')]||'';this[_0xfeba('0x6')]=_0x17482a[_0xfeba('0x6')]||'';this[_0xfeba('0x7')]=_0x17482a[_0xfeba('0x7')]||'';this[_0xfeba('0x8')]=_0x17482a[_0xfeba('0x8')]||{};}module[_0xfeba('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 82bd277..59029b2 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 _0x4515=['VoiceQueueId','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','number','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','firstName','lastName','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','UserId'];(function(_0x4b705b,_0xac7fd8){var _0x56fb74=function(_0x54fe79){while(--_0x54fe79){_0x4b705b['push'](_0x4b705b['shift']());}};_0x56fb74(++_0xac7fd8);}(_0x4515,0xc5));var _0x5451=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4515[_0x20a584];return _0x4b41a8;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x56613a,_0x32d4df,_0x54d550){var _0xc9895e='';if(!_[_0x5451('0x0')](_0x32d4df)&&'string'===typeof _0x32d4df){_0xc9895e+=_0x32d4df;}if(!_['isNil'](_0x54d550)&&_0x5451('0x1')===typeof _0x54d550){_0xc9895e+='\x20'+_0x54d550;}if(_0xc9895e!==''){return _0xc9895e;}return _0x56613a;}function Action(_0x23a84b,_0x2bdbbd,_0x118d84,_0x5062fe,_0x292f41){this[_0x5451('0x2')]=_0x118d84||undefined;this[_0x5451('0x3')]=_0x23a84b['id'];this[_0x5451('0x4')]=_0x2bdbbd[_0x5451('0x5')];this[_0x5451('0x6')]=_0x2bdbbd['type'];this[_0x5451('0x7')]='queue';this['dialAnswer']=![];this[_0x5451('0x8')]=_[_0x5451('0x0')](_0x23a84b[_0x5451('0x9')])?undefined:_0x23a84b['Agent'][_0x5451('0x5')];this[_0x5451('0xa')]=this[_0x5451('0x8')]?util['format'](_0x5451('0xb'),this[_0x5451('0x8')]):_0x5062fe||undefined;this[_0x5451('0xc')]=checkNameSurname(_0x23a84b[_0x5451('0xd')]['phone'],_0x23a84b[_0x5451('0xd')][_0x5451('0xe')],_0x23a84b['Contact'][_0x5451('0xf')]);this['active']=_0x23a84b['active']||![];this['calleridnum']=_0x23a84b['Contact'][_0x5451('0x10')];this[_0x5451('0x11')]=_0x23a84b['scheduledat'];this[_0x5451('0x12')]=_0x23a84b['countbusyretry']||0x0;this[_0x5451('0x13')]=_0x23a84b[_0x5451('0x13')]||0x0;this[_0x5451('0x14')]=_0x23a84b['countnoanswerretry']||0x0;this['countglobal']=(_0x23a84b['countbusyretry']||0x0)+(_0x23a84b[_0x5451('0x13')]||0x0)+(_0x23a84b[_0x5451('0x14')]||0x0)+(_0x23a84b['countnosuchnumberretry']||0x0)+(_0x23a84b[_0x5451('0x15')]||0x0)+(_0x23a84b[_0x5451('0x16')]||0x0)+(_0x23a84b[_0x5451('0x17')]||0x0)+(_0x23a84b[_0x5451('0x18')]||0x0);this[_0x5451('0x19')]=_0x23a84b[_0x5451('0x19')]||0x0;this[_0x5451('0x15')]=_0x23a84b[_0x5451('0x15')]||0x0;this[_0x5451('0x16')]=_0x23a84b[_0x5451('0x16')]||0x0;this[_0x5451('0x17')]=_0x23a84b[_0x5451('0x17')]||0x0;this[_0x5451('0x18')]=_0x23a84b[_0x5451('0x18')]||0x0;this[_0x5451('0x1a')]=_0x23a84b['callback'];this['callbackuniqueid']=_0x23a84b[_0x5451('0x1b')];this[_0x5451('0x1c')]=_0x23a84b[_0x5451('0x1c')];this[_0x5451('0x1d')]=_0x23a84b[_0x5451('0x1d')];this['ContactId']=_0x23a84b['ContactId'];this['ListId']=_0x23a84b['ListId'];this[_0x5451('0x1e')]=_[_0x5451('0x0')](_0x23a84b[_0x5451('0x9')])?_0x23a84b[_0x5451('0x1e')]:_0x23a84b[_0x5451('0x9')]['id'];this[_0x5451('0x1f')]=_0x23a84b[_0x5451('0x1f')];this['originatecalleridnum']='';this[_0x5451('0x20')]='';}Action[_0x5451('0x21')][_0x5451('0x22')]=function(){return util[_0x5451('0x23')](_0x5451('0x24'),this[_0x5451('0xc')],this[_0x5451('0x25')]);};module['exports']=Action; \ No newline at end of file +var _0x8199=['lodash','moment','isNil','string','uniqueid','queue','name','type','dialAnswer','membername','Agent','format','calleridname','phone','firstName','Contact','lastName','active','calleridnum','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','number'];(function(_0x4dbb4b,_0x5b7477){var _0x497148=function(_0x58cf0e){while(--_0x58cf0e){_0x4dbb4b['push'](_0x4dbb4b['shift']());}};_0x497148(++_0x5b7477);}(_0x8199,0xc3));var _0x9819=function(_0x5390a9,_0x33c4c4){_0x5390a9=_0x5390a9-0x0;var _0x5e223c=_0x8199[_0x5390a9];return _0x5e223c;};'use strict';var util=require('util');var _=require(_0x9819('0x0'));var moment=require(_0x9819('0x1'));function checkNameSurname(_0x4f3625,_0x40dcd5,_0x4ab48f){var _0x229f0c='';if(!_['isNil'](_0x40dcd5)&&'string'===typeof _0x40dcd5){_0x229f0c+=_0x40dcd5;}if(!_[_0x9819('0x2')](_0x4ab48f)&&_0x9819('0x3')===typeof _0x4ab48f){_0x229f0c+='\x20'+_0x4ab48f;}if(_0x229f0c!==''){return _0x229f0c;}return _0x4f3625;}function Action(_0x977d7f,_0x135d7f,_0x11cae8,_0x485b31,_0x2648b7){this[_0x9819('0x4')]=_0x11cae8||undefined;this['idContact']=_0x977d7f['id'];this[_0x9819('0x5')]=_0x135d7f[_0x9819('0x6')];this['type']=_0x135d7f[_0x9819('0x7')];this['campaigntype']=_0x9819('0x5');this[_0x9819('0x8')]=![];this[_0x9819('0x9')]=_[_0x9819('0x2')](_0x977d7f[_0x9819('0xa')])?undefined:_0x977d7f[_0x9819('0xa')]['name'];this['channelAgent']=this[_0x9819('0x9')]?util[_0x9819('0xb')]('SIP/%s',this[_0x9819('0x9')]):_0x485b31||undefined;this[_0x9819('0xc')]=checkNameSurname(_0x977d7f['Contact'][_0x9819('0xd')],_0x977d7f['Contact'][_0x9819('0xe')],_0x977d7f[_0x9819('0xf')][_0x9819('0x10')]);this[_0x9819('0x11')]=_0x977d7f['active']||![];this[_0x9819('0x12')]=_0x977d7f['Contact'][_0x9819('0xd')];this['scheduledat']=_0x977d7f['scheduledat'];this['countbusyretry']=_0x977d7f[_0x9819('0x13')]||0x0;this[_0x9819('0x14')]=_0x977d7f[_0x9819('0x14')]||0x0;this[_0x9819('0x15')]=_0x977d7f[_0x9819('0x15')]||0x0;this[_0x9819('0x16')]=(_0x977d7f[_0x9819('0x13')]||0x0)+(_0x977d7f[_0x9819('0x14')]||0x0)+(_0x977d7f['countnoanswerretry']||0x0)+(_0x977d7f[_0x9819('0x17')]||0x0)+(_0x977d7f['countdropretry']||0x0)+(_0x977d7f[_0x9819('0x18')]||0x0)+(_0x977d7f[_0x9819('0x19')]||0x0)+(_0x977d7f['countagentrejectretry']||0x0);this[_0x9819('0x17')]=_0x977d7f['countnosuchnumberretry']||0x0;this[_0x9819('0x1a')]=_0x977d7f[_0x9819('0x1a')]||0x0;this[_0x9819('0x18')]=_0x977d7f['countabandonedretry']||0x0;this[_0x9819('0x19')]=_0x977d7f[_0x9819('0x19')]||0x0;this['countagentrejectretry']=_0x977d7f[_0x9819('0x1b')]||0x0;this['callback']=_0x977d7f[_0x9819('0x1c')];this[_0x9819('0x1d')]=_0x977d7f[_0x9819('0x1d')];this[_0x9819('0x1e')]=_0x977d7f[_0x9819('0x1e')];this[_0x9819('0x1f')]=_0x977d7f[_0x9819('0x1f')];this['ContactId']=_0x977d7f[_0x9819('0x20')];this[_0x9819('0x21')]=_0x977d7f[_0x9819('0x21')];this[_0x9819('0x22')]=_[_0x9819('0x2')](_0x977d7f[_0x9819('0xa')])?_0x977d7f['UserId']:_0x977d7f[_0x9819('0xa')]['id'];this['VoiceQueueId']=_0x977d7f['VoiceQueueId'];this[_0x9819('0x23')]='';this[_0x9819('0x24')]='';}Action['prototype']['getCaller']=function(){return util['format'](_0x9819('0x25'),this['calleridname'],this[_0x9819('0x26')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 107a600..f2adafa 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 _0x3203=['campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','phone','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','variablesAction','channelAgent','destconnectedlinenum','user:%s','user:agentconnect','accountcode','calleridnum','OriginateError','actionid','logLookAgent','responsetime','isFailure','response','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','syncHangupRequest','addVariable','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','md5','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./util/util','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','hanguprequest','dialend','newexten','syncNewExten','attendedtransfer','syncAttendedTransfer','loopCampaigns','emit','answered','available','pTalking','sumDuration','sumHoldTime','talking','type','unmanaged','abandoned','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','name','active','Interval','stringify','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','outbound','dialActive','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','status','channel','catch','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','size','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','loggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','decrementTalkink','[16]','totalGlobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumBillable','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','cloneAction','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','execRun','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign'];(function(_0x2d23b0,_0x296921){var _0x244b89=function(_0x24eb73){while(--_0x24eb73){_0x2d23b0['push'](_0x2d23b0['shift']());}};_0x244b89(++_0x296921);}(_0x3203,0x1a0));var _0x3320=function(_0x32c012,_0xe3c576){_0x32c012=_0x32c012-0x0;var _0x48562e=_0x3203[_0x32c012];return _0x48562e;};'use strict';var util=require(_0x3320('0x0'));var _=require(_0x3320('0x1'));var BPromise=require(_0x3320('0x2'));var uuid=require(_0x3320('0x3'));var moment=require('moment');var md5=require(_0x3320('0x4'));var Redis=require(_0x3320('0x5'));var config=require(_0x3320('0x6'));var logger=require('../../../config/logger')(_0x3320('0x7'));var loggerAction=require(_0x3320('0x8'))(_0x3320('0x9'));var ami=require(_0x3320('0xa'));var rpcDb=require(_0x3320('0xb'));var Action=require('./action');var ut=require(_0x3320('0xc'));config[_0x3320('0xd')]=_['defaults'](config[_0x3320('0xd')],{'host':_0x3320('0xe'),'port':0x18eb});var io=require(_0x3320('0xf'))(new Redis(config[_0x3320('0xd')]));var Sequence=function(){};Sequence[_0x3320('0x10')][_0x3320('0x11')]=function(_0x25be35){this['tail']=this[_0x3320('0x12')]?this[_0x3320('0x12')][_0x3320('0x13')](_0x25be35):_0x25be35();};function Preview(_0x59b1e1){this[_0x3320('0x14')]=new Sequence();this[_0x3320('0x15')]=_0x59b1e1[_0x3320('0x16')];this[_0x3320('0x17')]=_0x59b1e1[_0x3320('0x17')];this[_0x3320('0x18')]={};this[_0x3320('0x19')]=_0x59b1e1['agents'];this[_0x3320('0x1a')]=0x0;ami['on'](_0x3320('0x1b'),this[_0x3320('0x1c')][_0x3320('0x1d')](this));ami['on'](_0x3320('0x1e'),this['syncHangup'][_0x3320('0x1d')](this));ami['on'](_0x3320('0x1f'),this['syncHangupRequest']['bind'](this));ami['on'](_0x3320('0x20'),this['syncDialEnd']['bind'](this));ami['on'](_0x3320('0x21'),this[_0x3320('0x22')][_0x3320('0x1d')](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0x3320('0x23'),this[_0x3320('0x24')][_0x3320('0x1d')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));this[_0x3320('0x25')](this['campaignsPreview']);}function emit(_0x4182b2,_0x153344,_0x2a63c3){io['to'](_0x4182b2)[_0x3320('0x26')](_0x153344,_0x2a63c3);}function emitCampaignPreview(_0x46a4cd){if(_0x46a4cd['type']==='outbound'){var _0x5ef294={'id':_0x46a4cd['id'],'name':_0x46a4cd['name'],'strategy':_0x46a4cd['strategy'],'answered':_0x46a4cd[_0x3320('0x27')],'available':_0x46a4cd[_0x3320('0x28')],'loggedIn':_0x46a4cd['loggedIn'],'pTalking':_0x46a4cd[_0x3320('0x29')],'sumBillable':_0x46a4cd['sumBillable'],'sumDuration':_0x46a4cd[_0x3320('0x2a')],'sumHoldTime':_0x46a4cd[_0x3320('0x2b')]||0x0,'talking':_0x46a4cd[_0x3320('0x2c')],'total':_0x46a4cd['total'],'type':_0x46a4cd[_0x3320('0x2d')],'unmanaged':_0x46a4cd[_0x3320('0x2e')],'abandoned':_0x46a4cd[_0x3320('0x2f')],'waiting':_0x46a4cd['waiting'],'loggedInDb':_0x46a4cd['loggedInDb'],'dialActive':_0x46a4cd['dialActive'],'dialMethod':_0x46a4cd[_0x3320('0x30')],'dialOriginateCallerIdName':_0x46a4cd[_0x3320('0x31')],'dialOriginateCallerIdNumber':_0x46a4cd[_0x3320('0x32')],'dialOriginateTimeout':_0x46a4cd[_0x3320('0x33')],'dialPrefix':_0x46a4cd[_0x3320('0x34')],'outboundAnswerAgiCallsDay':_0x46a4cd[_0x3320('0x35')],'outboundAnswerCallsDay':_0x46a4cd['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x46a4cd[_0x3320('0x36')],'outboundBusyCallsDay':_0x46a4cd['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x46a4cd[_0x3320('0x37')],'outboundDropCallsDayACS':_0x46a4cd[_0x3320('0x38')],'outboundDropCallsDayCallersExit':_0x46a4cd[_0x3320('0x39')],'outboundDropCallsDayTimeout':_0x46a4cd[_0x3320('0x3a')],'outboundNoAnswerCallsDay':_0x46a4cd[_0x3320('0x3b')],'outboundNoSuchCallsDay':_0x46a4cd['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x46a4cd['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x46a4cd[_0x3320('0x3c')],'outboundRejectCallsDay':_0x46a4cd[_0x3320('0x3d')],'outboundUnknownCallsDay':_0x46a4cd[_0x3320('0x3e')],'outboundAbandonedCallsDay':_0x46a4cd[_0x3320('0x3f')],'predictiveIntervalAnsweredCalls':_0x46a4cd[_0x3320('0x40')],'predictiveIntervalAvgHoldtime':_0x46a4cd[_0x3320('0x41')],'predictiveIntervalAvgTalktime':_0x46a4cd[_0x3320('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x46a4cd[_0x3320('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x46a4cd['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x46a4cd['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x46a4cd[_0x3320('0x44')],'predictiveIntervalHitRate':_0x46a4cd[_0x3320('0x45')],'predictiveIntervalMultiplicativeFactor':_0x46a4cd[_0x3320('0x46')],'predictiveIntervalPauses':_0x46a4cd[_0x3320('0x47')],'predictiveIntervalAvailable':_0x46a4cd[_0x3320('0x48')],'predictiveIntervalTotalCalls':_0x46a4cd[_0x3320('0x49')],'message':_0x46a4cd[_0x3320('0x4a')],'originated':_0x46a4cd[_0x3320('0x4b')],'erlangCalls':_0x46a4cd[_0x3320('0x4c')],'erlangCallToSecond':_0x46a4cd[_0x3320('0x4d')],'erlangAbandonmentRate':_0x46a4cd[_0x3320('0x4e')],'erlangBusyFactor':_0x46a4cd[_0x3320('0x4f')],'startPredictive':_0x46a4cd['startPredictive'],'startProgressive':_0x46a4cd[_0x3320('0x50')]};if(_0x46a4cd['Trunk']){_0x5ef294[_0x3320('0x51')]={'id':_0x46a4cd['Trunk']['id'],'name':_0x46a4cd[_0x3320('0x51')][_0x3320('0x52')],'active':_0x46a4cd[_0x3320('0x51')][_0x3320('0x53')],'callerid':_0x46a4cd[_0x3320('0x51')]['callerid']};}if(_0x46a4cd['Interval']){_0x5ef294[_0x3320('0x54')]={'id':_0x46a4cd['Interval']['id'],'name':_0x46a4cd[_0x3320('0x54')][_0x3320('0x52')]};}var _0x3e2725=md5(JSON[_0x3320('0x55')](_0x5ef294));if(_0x46a4cd[_0x3320('0x4')]!==_0x3e2725){_0x46a4cd[_0x3320('0x4')]=_0x3e2725;emit(util['format']('voice:queue:%s',_0x5ef294[_0x3320('0x52')]),_0x3320('0x56'),_0x5ef294);}}}function emitVoiceQueueChannelRemove(_0x334612){logger[_0x3320('0x57')](_0x3320('0x58'),JSON['stringify'](_0x334612));emit(util['format'](_0x3320('0x59'),_0x334612[_0x3320('0x52')]),'voice_queue_channel:remove',_0x334612);io[_0x3320('0x26')]('voice_queue_presence:remove',_0x334612);}function notSendMessagesQueue(_0x4c9115){if(_0x4c9115['sendMessageOneNotActive']){if(_0x4c9115[_0x3320('0x4b')]===0x0&&_0x4c9115[_0x3320('0x29')]===0x0){_0x4c9115[_0x3320('0x5a')]=![];_0x4c9115[_0x3320('0x28')]=0x0;_0x4c9115['paused']=0x0;_0x4c9115[_0x3320('0x4a')]=_0x3320('0x5b');ut[_0x3320('0x5c')](_0x3320('0x5d'),_0x4c9115[_0x3320('0x52')]+_0x3320('0x5e'));}else{_0x4c9115[_0x3320('0x4a')]=_0x3320('0x5f');ut[_0x3320('0x5c')](_0x3320('0x5d'),_0x4c9115[_0x3320('0x52')]+_0x3320('0x60'));}emitCampaignPreview(_0x4c9115);}}Preview[_0x3320('0x10')][_0x3320('0x25')]=function(){var _0x43984b=this;setInterval(function(){_0x43984b[_0x3320('0x61')]();},0x7cf);};Preview['prototype'][_0x3320('0x61')]=function(){var _0x1fada5=this[_0x3320('0x15')];this[_0x3320('0x1a')]+=0x1;for(var _0x11e0c1 in _0x1fada5){if(_0x1fada5[_0x3320('0x62')](_0x11e0c1)&&(_0x1fada5[_0x11e0c1][_0x3320('0x30')]===_0x3320('0x7')||_0x1fada5[_0x11e0c1][_0x3320('0x30')]===_0x3320('0x63'))&&_0x1fada5[_0x11e0c1]['type']==='outbound'){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this[_0x3320('0x64')]();}}if(_0x1fada5['hasOwnProperty'](_0x11e0c1)&&_0x1fada5[_0x11e0c1][_0x3320('0x30')]===_0x3320('0x7')&&_0x1fada5[_0x11e0c1][_0x3320('0x2d')]===_0x3320('0x65')){if(_0x1fada5[_0x11e0c1][_0x3320('0x66')]){this['setMessage'](_0x1fada5[_0x11e0c1]);this[_0x3320('0x67')](_0x1fada5[_0x11e0c1]);}else{notSendMessagesQueue(_0x1fada5[_0x11e0c1]);}}}};Preview[_0x3320('0x10')][_0x3320('0x68')]=function(_0x457869){var _0x54dd2b=this;this[_0x3320('0x14')]['enqueue'](function(){if(!_[_0x3320('0x69')](_0x54dd2b[_0x3320('0x18')][_0x457869])){loggerAction['info'](_0x3320('0x6a'),_0x457869,'Queue',_0x54dd2b[_0x3320('0x18')][_0x457869][_0x3320('0x6b')],_0x3320('0x6c'),JSON[_0x3320('0x55')](_0x54dd2b[_0x3320('0x15')][_0x54dd2b[_0x3320('0x18')][_0x457869][_0x3320('0x6b')]][_0x3320('0x4b')]),_0x3320('0x6d'),JSON['stringify'](_0x54dd2b['campaignsPreview'][_0x54dd2b[_0x3320('0x18')][_0x457869][_0x3320('0x6b')]]['pTalking']),JSON[_0x3320('0x55')](_0x54dd2b[_0x3320('0x18')][_0x457869][_0x3320('0x6e')]),JSON[_0x3320('0x55')](_[_0x3320('0x6f')](_0x54dd2b[_0x3320('0x18')][_0x457869],[_0x3320('0x70'),_0x3320('0x71'),_0x3320('0x72'),'ListId'])));return ami['Action']({'action':_0x3320('0x73'),'channel':_0x54dd2b['actions'][_0x457869][_0x3320('0x74')]})[_0x3320('0x75')](function(_0x2a4d68){if(_0x2a4d68[_0x3320('0x4a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x54dd2b[_0x3320('0x18')][_0x457869]){ut[_0x3320('0x76')](_0x54dd2b[_0x3320('0x15')][_0x54dd2b[_0x3320('0x18')][_0x457869][_0x3320('0x6b')]],_0x3320('0x77'));if(_0x54dd2b[_0x3320('0x18')][_0x457869][_0x3320('0x6e')]===!![]){ut['decrementTalkink'](_0x54dd2b[_0x3320('0x15')][_0x54dd2b[_0x3320('0x18')][_0x457869][_0x3320('0x6b')]],_0x3320('0x77'));ut[_0x3320('0x78')](_0x3320('0x79')+_0x457869,_0x54dd2b[_0x3320('0x18')][_0x457869]['queue']);}ut[_0x3320('0x78')]('[Dialer][checkChannel][Preview]'+_0x457869,_0x54dd2b[_0x3320('0x18')][_0x457869]['queue']);delete _0x54dd2b[_0x3320('0x18')][_0x457869];}},0x2328);}});}});};Preview[_0x3320('0x10')][_0x3320('0x64')]=function(){var _0x46220c=this;loggerAction[_0x3320('0x57')](_0x3320('0x7a'),_[_0x3320('0x7b')](this[_0x3320('0x18')]));for(var _0x3be442 in this[_0x3320('0x18')]){if(_0x46220c[_0x3320('0x18')][_0x3320('0x62')](_0x3be442)){_0x46220c[_0x3320('0x68')](_0x3be442);}}};Preview['prototype'][_0x3320('0x67')]=function(_0x6d8410){var _0x2a4e8d=this;rpcDb['getContactRecallMe'](_0x6d8410['id'],ut['agentReadyId'](this[_0x3320('0x19')]))[_0x3320('0x7c')](function(_0x17931a){if(!_[_0x3320('0x69')](_0x17931a)){for(var _0xf7a53a=0x0;_0xf7a53a<_0x17931a[_0x3320('0x7d')];_0xf7a53a+=0x1){if(ut['getDiff'](_0x17931a[_0xf7a53a][_0x3320('0x7e')])<_0x6d8410[_0x3320('0x7f')]*0x3c){if(_0x17931a[_0xf7a53a][_0x3320('0x80')]&&!_0x17931a[_0xf7a53a][_0x3320('0x80')][_0x3320('0x81')]){_0x2a4e8d[_0x3320('0x82')](_0x17931a[_0xf7a53a]['id'])['then'](ut['logger2']('[RecallMe]'))['catch'](ut[_0x3320('0x83')](_0x3320('0x84')));}else{rpcDb[_0x3320('0x85')](_0x17931a[_0xf7a53a]['id']);}}else{var _0x18825c=new Action(_0x17931a[_0xf7a53a],_0x6d8410);_0x18825c[_0x3320('0x86')]=moment()[_0x3320('0x87')](_0x3320('0x88'));_0x6d8410[_0x3320('0x3c')]+=0x1;ut['logCustomer'](_0x18825c,0x17,_0x3320('0x89'));if(_0x6d8410[_0x3320('0x8a')]){rpcDb[_0x3320('0x8b')](ut['createBody'](_0x17931a[_0xf7a53a]));rpcDb[_0x3320('0x8c')](_0x18825c,_0x3320('0x8d'));}else{ut[_0x3320('0x8e')](_0x18825c,0x16,_0x3320('0x8f'));rpcDb[_0x3320('0x8c')](_0x18825c,_0x3320('0x90'));rpcDb[_0x3320('0x91')](_0x18825c,_0x3320('0x90'));}}}}})[_0x3320('0x75')](ut['logger2'](_0x3320('0x92')));};Preview['prototype'][_0x3320('0x93')]=function(_0x1fc6b4){_0x1fc6b4['sendMessageOneNotActive']=!![];if(ut[_0x3320('0x94')](_0x1fc6b4[_0x3320('0x95')])){_0x1fc6b4[_0x3320('0x4a')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x3320('0x96')](_0x1fc6b4['dialActive'])){_0x1fc6b4['message']=_0x3320('0x5b');}else if(!this[_0x3320('0x97')](_0x1fc6b4[_0x3320('0x51')])){if(!this[_0x3320('0x97')](_0x1fc6b4[_0x3320('0x98')])){_0x1fc6b4['message']=_0x3320('0x99');}else{_0x1fc6b4['message']=_0x3320('0x9a');}}else{_0x1fc6b4[_0x3320('0x4a')]=_0x3320('0x9a');}emitCampaignPreview(_0x1fc6b4);};Preview[_0x3320('0x10')][_0x3320('0x9b')]=function(_0x148a81,_0x4e00a2,_0x397042){var _0x176158=this;var _0x2b3d56=this['actions'][_0x4e00a2];var _0x41845c=this[_0x3320('0x15')][_0x2b3d56[_0x3320('0x6b')]];var _0x5401e7;if(_0x41845c){switch(_0x397042){case'1':_0x41845c[_0x3320('0x9c')]+=0x1;_0x2b3d56[_0x3320('0x9d')]+=0x1;_0x2b3d56[_0x3320('0x9e')]=ut['totalGlobal'](_0x2b3d56);ut['logCustomer'](_0x2b3d56,0x0,_0x3320('0x9f'));ami[_0x3320('0x26')](_0x3320('0xa0'),ut[_0x3320('0xa1')](_0x2b3d56,_0x3320('0xa2')));rpcDb[_0x3320('0x8c')](_0x2b3d56,_0x3320('0xa3'));if(ut['totalGlobal'](_0x2b3d56)>=_0x41845c['dialGlobalMaxRetry']){_0x5401e7=ut['cloneAction'](_0x2b3d56,0xf,_0x3320('0xa4'));rpcDb[_0x3320('0x91')](_0x5401e7,_0x3320('0xa5'));}else{if(_0x2b3d56[_0x3320('0x9d')]>=_0x41845c['dialNoSuchNumberMaxRetry']){rpcDb[_0x3320('0x91')](_0x2b3d56,_0x3320('0xa5'));}else{rpcDb[_0x3320('0xa6')](ut[_0x3320('0xa7')](_0x2b3d56,_0x3320('0x9d'),_0x41845c[_0x3320('0xa8')]),_0x2b3d56[_0x3320('0xa9')],_0x2b3d56[_0x3320('0xaa')]);}}delete this[_0x3320('0x18')][_0x148a81[_0x3320('0xab')]];break;case _0x3320('0xac'):var _0x3dd004=moment()[_0x3320('0x87')](_0x3320('0x88'));_0x2b3d56['responsetime']=_0x3dd004;_0x2b3d56[_0x3320('0xad')]=_0x3dd004;_0x2b3d56['dialAnswer']=!![];_0x41845c[_0x3320('0x29')]+=0x1;logger[_0x3320('0x57')](_0x3320('0xae'),_0x2b3d56[_0x3320('0xaf')],'\x20Queue',_0x41845c[_0x3320('0x52')],'pTalking:\x20',_0x41845c[_0x3320('0x29')]);ami[_0x3320('0x26')]('custom:agentconnect',ut[_0x3320('0xa1')](_0x2b3d56,_0x3320('0xb0'),this[_0x3320('0x15')][_0x2b3d56[_0x3320('0x6b')]]));if(_0x41845c[_0x3320('0xb1')]){ami['emit'](_0x3320('0xb2'),ut[_0x3320('0xb3')](_0x2b3d56));}break;case'16':ami[_0x3320('0x26')](_0x3320('0xb4'),ut[_0x3320('0xa1')](_0x2b3d56,_0x3320('0xb5'),this[_0x3320('0x15')][_0x2b3d56[_0x3320('0x6b')]]));emitVoiceQueueChannelRemove(ut[_0x3320('0xa1')](_0x2b3d56,_0x3320('0xb5')));_0x41845c[_0x3320('0xb6')]+=0x1;_0x41845c[_0x3320('0xb7')]+=0x1;_0x41845c[_0x3320('0x27')]+=0x1;ut[_0x3320('0xb8')](_0x41845c,_0x3320('0xb9'));_0x2b3d56[_0x3320('0x9e')]=ut[_0x3320('0xba')](_0x2b3d56);ut['logCustomer'](_0x2b3d56,0x4,_0x3320('0xbb'));rpcDb[_0x3320('0x8c')](_0x2b3d56,_0x3320('0xbc'));rpcDb[_0x3320('0x91')](_0x2b3d56,_0x3320('0xbd'));rpcDb[_0x3320('0xbe')](_0x2b3d56);_0x41845c[_0x3320('0x2a')]+=_0x2b3d56['talktime'];_0x41845c[_0x3320('0xbf')]+=_0x2b3d56[_0x3320('0xc0')];logger[_0x3320('0x57')](_0x3320('0xc1'),_0x2b3d56[_0x3320('0xaf')],_0x3320('0xc2'),_0x41845c[_0x3320('0x52')],_0x3320('0x6d'),_0x41845c[_0x3320('0x29')]);delete this[_0x3320('0x18')][_0x148a81[_0x3320('0xab')]];break;case _0x3320('0xc3'):_0x41845c[_0x3320('0xc4')]+=0x1;_0x2b3d56['countbusyretry']+=0x1;_0x2b3d56[_0x3320('0x9e')]=ut[_0x3320('0xba')](_0x2b3d56);ut[_0x3320('0x8e')](_0x2b3d56,0x5,_0x3320('0xc5'));ami[_0x3320('0x26')](_0x3320('0xc6'),ut['buildObj'](_0x2b3d56,_0x3320('0xc7')));rpcDb[_0x3320('0x8c')](_0x2b3d56,_0x3320('0xc8'));if(ut[_0x3320('0xba')](_0x2b3d56)>=_0x41845c[_0x3320('0xc9')]){_0x5401e7=ut['cloneAction'](_0x2b3d56,0xf,_0x3320('0xa4'));rpcDb[_0x3320('0x91')](_0x5401e7,_0x3320('0xca'));}else{if(_0x2b3d56[_0x3320('0xcb')]>=_0x41845c[_0x3320('0xcc')]){rpcDb[_0x3320('0x91')](_0x2b3d56,_0x3320('0xc8'));}else{rpcDb[_0x3320('0xa6')](ut[_0x3320('0xa7')](_0x2b3d56,'countbusyretry',_0x41845c[_0x3320('0xcd')]),_0x2b3d56[_0x3320('0xa9')],_0x2b3d56[_0x3320('0xaa')]);}}break;case'NOANSWER':_0x41845c[_0x3320('0x3b')]+=0x1;_0x2b3d56[_0x3320('0xce')]+=0x1;_0x2b3d56[_0x3320('0x9e')]=ut[_0x3320('0xba')](_0x2b3d56);ut[_0x3320('0x8e')](_0x2b3d56,0x3,_0x3320('0xcf'));ami[_0x3320('0x26')](_0x3320('0xd0'),ut['buildObj'](_0x2b3d56,'noanswer'));rpcDb[_0x3320('0x8c')](_0x2b3d56,_0x3320('0xd1'));if(ut[_0x3320('0xba')](_0x2b3d56)>=_0x41845c[_0x3320('0xc9')]){_0x5401e7=ut[_0x3320('0xd2')](_0x2b3d56,0xf,_0x3320('0xa4'));rpcDb['createCustomerFinal'](_0x5401e7,_0x3320('0xd3'));}else{if(_0x2b3d56[_0x3320('0xce')]>=_0x41845c[_0x3320('0xd4')]){rpcDb[_0x3320('0x91')](_0x2b3d56,_0x3320('0xd1'));}else{rpcDb[_0x3320('0xa6')](ut[_0x3320('0xa7')](_0x2b3d56,_0x3320('0xce'),_0x41845c[_0x3320('0xd5')]),_0x2b3d56[_0x3320('0xa9')],_0x2b3d56['activeContact']);}}break;case'CONGESTION':_0x41845c[_0x3320('0x37')]+=0x1;_0x2b3d56[_0x3320('0xd6')]+=0x1;_0x2b3d56[_0x3320('0x9e')]=ut['totalGlobal'](_0x2b3d56);ut[_0x3320('0x8e')](_0x2b3d56,0x8,'Congestion');ami[_0x3320('0x26')](_0x3320('0xd7'),ut['buildObj'](_0x2b3d56,_0x3320('0xd8')));rpcDb[_0x3320('0x8c')](_0x2b3d56,_0x3320('0xd9'));if(ut[_0x3320('0xba')](_0x2b3d56)>=_0x41845c[_0x3320('0xc9')]){_0x5401e7=ut[_0x3320('0xd2')](_0x2b3d56,0xf,'Global');rpcDb['createCustomerFinal'](_0x5401e7,_0x3320('0xda'));}else{if(_0x2b3d56[_0x3320('0xd6')]>=_0x41845c['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x2b3d56,_0x3320('0xd9'));}else{rpcDb[_0x3320('0xa6')](ut[_0x3320('0xa7')](_0x2b3d56,'countcongestionretry',_0x41845c[_0x3320('0xcd')]),_0x2b3d56[_0x3320('0xa9')],_0x2b3d56[_0x3320('0xaa')]);}}break;case'CANCEL':_0x41845c[_0x3320('0x3d')]+=0x1;_0x2b3d56[_0x3320('0xdb')]+=0x1;_0x2b3d56[_0x3320('0x9e')]=ut[_0x3320('0xba')](_0x2b3d56);ut[_0x3320('0x8e')](_0x2b3d56,0x14,_0x3320('0xdc'));ami[_0x3320('0x26')](_0x3320('0xdd'),ut[_0x3320('0xa1')](_0x2b3d56,'agentreject'));rpcDb[_0x3320('0x8c')](_0x2b3d56,_0x3320('0xde'));if(ut[_0x3320('0xba')](_0x2b3d56)>=_0x41845c['dialGlobalMaxRetry']){_0x5401e7=ut[_0x3320('0xd2')](_0x2b3d56,0x14,_0x3320('0xdc'));rpcDb['createCustomerFinal'](_0x5401e7,_0x3320('0xdf'));}else{if(_0x2b3d56['countagentrejectretry']>=_0x41845c[_0x3320('0xe0')]){rpcDb[_0x3320('0x91')](_0x2b3d56,_0x3320('0xdf'));}else{rpcDb[_0x3320('0xa6')](ut[_0x3320('0xa7')](_0x2b3d56,_0x3320('0xdb'),_0x41845c['dialAgentRejectRetryFrequency']),_0x2b3d56[_0x3320('0xa9')],_0x2b3d56['activeContact']);}}break;case _0x3320('0xe1'):_0x41845c[_0x3320('0x3f')]+=0x1;_0x2b3d56[_0x3320('0xe2')]+=0x1;_0x2b3d56[_0x3320('0x9e')]=ut['totalGlobal'](_0x2b3d56);ut[_0x3320('0x8e')](_0x2b3d56,0xb,_0x3320('0xe3'));rpcDb[_0x3320('0x8c')](_0x2b3d56,_0x3320('0xe4'));if(ut[_0x3320('0xba')](_0x2b3d56)>=_0x41845c[_0x3320('0xc9')]){_0x5401e7=ut[_0x3320('0xd2')](_0x2b3d56,0xf,_0x3320('0xa4'));rpcDb[_0x3320('0x91')](_0x5401e7,_0x3320('0xe4'));}else{if(_0x2b3d56[_0x3320('0xe5')]>=_0x41845c[_0x3320('0xe6')]){rpcDb[_0x3320('0x91')](_0x2b3d56,_0x3320('0xe4'));}else{rpcDb[_0x3320('0xa6')](ut[_0x3320('0xa7')](_0x2b3d56,_0x3320('0xe2'),_0x41845c[_0x3320('0xe7')]),_0x2b3d56[_0x3320('0xa9')],_0x2b3d56['activeContact']);}}break;case'18':_0x41845c[_0x3320('0x3e')]+=0x1;_0x2b3d56[_0x3320('0xe8')]+=0x1;_0x2b3d56[_0x3320('0x9e')]=ut[_0x3320('0xba')](_0x2b3d56);ut['logCustomer'](_0x2b3d56,0x12,_0x148a81[_0x3320('0xe9')]||_0x148a81[_0x3320('0xea')]);ami[_0x3320('0x26')](_0x3320('0xeb'),ut[_0x3320('0xa1')](_0x2b3d56,_0x3320('0xec')));rpcDb[_0x3320('0x8c')](_0x2b3d56,_0x3320('0xed'));if(ut[_0x3320('0xba')](_0x2b3d56)>=_0x41845c[_0x3320('0xc9')]){_0x5401e7=ut[_0x3320('0xd2')](_0x2b3d56,0xf,_0x3320('0xa4'));rpcDb[_0x3320('0x91')](_0x5401e7,_0x3320('0xed'));}else{rpcDb[_0x3320('0x91')](_0x2b3d56,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0x3320('0x18')][_0x148a81[_0x3320('0xab')]];break;case'19':_0x41845c[_0x3320('0x3e')]+=0x1;_0x2b3d56[_0x3320('0x9e')]=ut['totalGlobal'](_0x2b3d56);ut[_0x3320('0x8e')](_0x2b3d56,0x13,_0x148a81[_0x3320('0xe9')]||_0x148a81[_0x3320('0xea')]);ami[_0x3320('0x26')](_0x3320('0xeb'),ut[_0x3320('0xa1')](_0x2b3d56,'amd'));rpcDb['createCustomerHistory'](_0x2b3d56,_0x3320('0xee'));if(ut[_0x3320('0xba')](_0x2b3d56)>=_0x41845c[_0x3320('0xc9')]){_0x5401e7=ut[_0x3320('0xd2')](_0x2b3d56,0xf,_0x3320('0xa4'));rpcDb[_0x3320('0x91')](_0x5401e7,_0x3320('0xee'));}else{rpcDb[_0x3320('0x91')](_0x2b3d56,'[callProgressDetectingCustomer][machine]');}delete this['actions'][_0x148a81[_0x3320('0xab')]];break;default:if(_0x2b3d56[_0x3320('0x6e')]){ut[_0x3320('0xb8')](_0x41845c,'[default]');ut[_0x3320('0x78')](_0x3320('0xef')+_0x41845c[_0x3320('0x52')],_0x148a81);}_0x41845c[_0x3320('0x3e')]+=0x1;_0x2b3d56[_0x3320('0x9e')]=ut[_0x3320('0xba')](_0x2b3d56);ut[_0x3320('0x8e')](_0x2b3d56,0xc,_0x148a81[_0x3320('0xe9')]||_0x148a81[_0x3320('0xea')]);rpcDb[_0x3320('0x8c')](_0x2b3d56,_0x3320('0xf0'));if(ut['totalGlobal'](_0x2b3d56)>=_0x41845c[_0x3320('0xc9')]){_0x5401e7=ut[_0x3320('0xd2')](_0x2b3d56,0xf,_0x3320('0xa4'));rpcDb['createCustomerFinal'](_0x5401e7,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x3320('0x91')](_0x2b3d56,_0x3320('0xf1'));}delete this[_0x3320('0x18')][_0x148a81[_0x3320('0xab')]];}if(!(_0x2b3d56['dialAnswer']&&_0x397042==='16')){ut['updateOriginated'](_0x41845c,'[callProgressDetectingCustomer]');logger[_0x3320('0x57')](_0x3320('0xf2'),_0x2b3d56[_0x3320('0xaf')],'\x20Queue',_0x41845c[_0x3320('0x52')],_0x3320('0x6c'),_0x41845c[_0x3320('0x4b')]);}if(_0x397042!==_0x3320('0xac')){delete this[_0x3320('0x18')][_0x148a81[_0x3320('0xab')]];delete this['actions'][_0x148a81[_0x3320('0xf3')]];}}};Preview['prototype'][_0x3320('0xf4')]=function(_0x2a88aa,_0x2128b9,_0x49f747){if(_[_0x3320('0xf5')](_0x2128b9)&&'object'!==typeof _0x2128b9){return;}if(_[_0x3320('0xf5')](_0x49f747)&&_0x3320('0xf6')!==typeof _0x49f747){return;}switch(_0x49f747[_0x3320('0xf7')]){case'0':ut[_0x3320('0xf8')](_0x2a88aa,0x0,_0x3320('0x9f'));rpcDb['createAgentHistory'](_0x2a88aa,_0x3320('0xf9'));break;case'3':ut[_0x3320('0xf8')](_0x2a88aa,0x3,'NoAnswer');rpcDb[_0x3320('0xfa')](_0x2a88aa,_0x3320('0xfb'));break;case'5':ut[_0x3320('0xf8')](_0x2a88aa,0x5,'Busy');rpcDb[_0x3320('0xfa')](_0x2a88aa,_0x3320('0xfc'));break;case'8':ut['logAgent'](_0x2a88aa,0x8,_0x3320('0xfd'));rpcDb[_0x3320('0xfa')](_0x2a88aa,_0x3320('0xfe'));break;case'22':ut['logAgent'](_0x2a88aa,0x16,_0x3320('0xff'));rpcDb['createAgentHistory'](_0x2a88aa,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x3320('0xf8')](_0x2a88aa,0xc,_0x49f747[_0x3320('0xf7')]);rpcDb[_0x3320('0xfa')](_0x2a88aa,'[callProgressDetectingAgent][logCongestion]');}ut[_0x3320('0x76')](_0x2128b9,_0x3320('0x100'));logger['info'](_0x3320('0x101'),_0x2a88aa[_0x3320('0xaf')],_0x3320('0xc2'),_0x2128b9[_0x3320('0x52')],'originated:\x20',_0x2128b9[_0x3320('0x4b')]);delete this['actions'][_0x2a88aa[_0x3320('0xaf')]];};Preview[_0x3320('0x10')][_0x3320('0x102')]=function(_0x38d143,_0x1daa73,_0x99eefb,_0x59c35f,_0x29f112){var _0x55decb=this;return new BPromise(function(_0x8e0e9e,_0x10201c){if(_[_0x3320('0x69')](_0x1daa73)||_[_0x3320('0x69')](_0x1daa73['Contact'])||_[_0x3320('0x69')](_0x1daa73[_0x3320('0x103')]['phone'])||_[_0x3320('0x69')](_0x1daa73['VoiceQueueId'])){_0x10201c(ut[_0x3320('0x4a')](_0x3320('0x104'),_0x59c35f,_0x29f112));return;}var _0x415a5c=uuid['v4']();var _0x17132f=_0x55decb[_0x3320('0x15')][_0x1daa73[_0x3320('0x105')][_0x3320('0x52')]];var _0x132c3b=_0x99eefb?_0x55decb['agents'][_0x99eefb]['id']:undefined;_0x55decb[_0x3320('0x18')][_0x415a5c]=new Action(_0x1daa73,_0x17132f,_0x415a5c,_0x99eefb,_0x132c3b);var _0x468c07=_0x55decb[_0x3320('0x18')][_0x415a5c];_0x468c07[_0x3320('0xa9')]=_0x59c35f;_0x468c07[_0x3320('0xaa')]=_0x29f112;_0x468c07[_0x3320('0x106')]=_0x99eefb;if(_[_0x3320('0x107')](_0x38d143)){_0x55decb['execCall'](_0x468c07,_0x17132f,_0x1daa73,_0x99eefb)['then'](function(_0xbc8163){logger[_0x3320('0x57')](_0x3320('0x108'),_0x3320('0x109')+_0x468c07[_0x3320('0x6b')]+_0x3320('0x10a')+_0x468c07[_0x3320('0x10b')],JSON['stringify'](_0xbc8163));ami['emit'](_0x3320('0x10c'),ut[_0x3320('0xa1')](_0x468c07,_0x3320('0x10d'),_0x55decb['campaignsPreview'][_0x468c07[_0x3320('0x6b')]]));_0x8e0e9e(ut[_0x3320('0x4a')](_0x3320('0x10e')));})['catch'](function(_0x20425b){ut[_0x3320('0x5c')]('[Preview][execCall][failure]',_0x20425b);_0x10201c(ut[_0x3320('0x4a')](_0x3320('0x10f'),_0x59c35f,_0x29f112));});}else{_0x17132f[_0x3320('0x36')]+=0x1;ut['logBlacklist'](_0x468c07);rpcDb[_0x3320('0x110')](_0x468c07,_0x3320('0x111'));delete _0x55decb[_0x3320('0x18')][_0x415a5c];_0x10201c(ut[_0x3320('0x4a')](_0x3320('0x112'),_0x59c35f,_0x29f112));}});};Preview[_0x3320('0x10')]['isTrunkReachable']=function(_0x797f8b){return!_[_0x3320('0x69')](_0x797f8b)&&!_[_0x3320('0x69')](_0x797f8b[_0x3320('0x52')])&&!_[_0x3320('0x69')](_0x797f8b[_0x3320('0x53')])&&_0x797f8b[_0x3320('0x53')]&&!_[_0x3320('0x69')](this[_0x3320('0x17')][util['format'](_0x3320('0x113'),_0x797f8b[_0x3320('0x52')])])&&!_['isNil'](this[_0x3320('0x17')][util[_0x3320('0x87')]('SIP/%s',_0x797f8b[_0x3320('0x52')])][_0x3320('0x73')])&&(this[_0x3320('0x17')][util['format'](_0x3320('0x113'),_0x797f8b[_0x3320('0x52')])]['status']===_0x3320('0x114')||this[_0x3320('0x17')][util['format'](_0x3320('0x113'),_0x797f8b[_0x3320('0x52')])][_0x3320('0x73')]==='unmonitored');};Preview['prototype'][_0x3320('0x82')]=function(_0xb91969,_0xaa309d){var _0x21cf18=this;return new BPromise(function(_0x142f7d,_0x22d339){_0x21cf18[_0x3320('0x115')](_0xb91969,_0xaa309d)[_0x3320('0x7c')](function(_0x14de55){_0x142f7d(_[_0x3320('0x6f')](_0x14de55,[_0x3320('0x4a')]));})['catch'](function(_0x85745b){if(_0x85745b['unlock']){rpcDb[_0x3320('0x116')](_0xb91969);}if(_0x85745b['active']){rpcDb['disableContact'](_0xb91969);}_0x22d339(_[_0x3320('0x6f')](_0x85745b,[_0x3320('0x4a')]));});});};Preview[_0x3320('0x10')][_0x3320('0x115')]=function(_0xa73e08,_0x5ebb24){var _0x528025=this;return new BPromise(function(_0x15a268,_0xd7d896){var _0x2b6a71,_0x2db58e;rpcDb[_0x3320('0x117')](_0xa73e08)['then'](function(_0x460e27){if(!_['isNil'](_0x460e27[0x0])){_0x2db58e=_0x460e27[0x0][_0x3320('0x118')]?![]:!![];_0x2b6a71=_0x460e27[0x0][_0x3320('0x118')]?!![]:![];_0x2b6a71=_0x5ebb24?!![]:_0x2b6a71;}var _0x3a7f0a=_0x528025[_0x3320('0x119')](_0x460e27);if(_0x3a7f0a[_0x3320('0x11a')]){rpcDb[_0x3320('0x11b')](_['pick'](_0x460e27[0x0],[_0x3320('0x72'),_0x3320('0x11c')]))[_0x3320('0x7c')](function(_0x1001a0){_0x528025[_0x3320('0x102')](_0x1001a0,_0x460e27[0x0],_0x5ebb24,_0x2db58e,_0x2b6a71)[_0x3320('0x7c')](function(_0x13be78){_0x15a268(_0x13be78);})[_0x3320('0x75')](function(_0x2f138c){_0xd7d896(_0x2f138c);});})[_0x3320('0x75')](function(_0x371535){ut[_0x3320('0x5c')]('[Preview][checkIsBlackList]',_0x371535);_0xd7d896(ut[_0x3320('0x4a')]('Call\x20unsuccessful',_0x2db58e,_0x2b6a71));});}else{_0xd7d896(ut[_0x3320('0x4a')](_0x3a7f0a[_0x3320('0x4a')],_0x2db58e,_0x2b6a71));}})[_0x3320('0x75')](function(_0x197018){ut[_0x3320('0x5c')]('[Preview][getContactPreview]',_0x197018);_0xd7d896(ut[_0x3320('0x4a')](_0x3320('0x11d'),![],!![]));});});};Preview[_0x3320('0x10')][_0x3320('0x119')]=function(_0x34d3f2){if(_[_0x3320('0x69')](_0x34d3f2)||_[_0x3320('0x107')](_0x34d3f2)||!_[_0x3320('0x69')](_0x34d3f2[0x0][_0x3320('0x80')])&&_['isNil'](_0x34d3f2[0x0][_0x3320('0x80')][_0x3320('0x52')])){ut[_0x3320('0x5c')](_0x3320('0x11e'),_0x34d3f2);return{'isValid':![],'message':_0x3320('0x11f')};}var _0x3d2284=this[_0x3320('0x15')][_0x34d3f2[0x0][_0x3320('0x105')][_0x3320('0x52')]];_0x3d2284[_0x3320('0x4a')]=_0x3320('0x9a');if(_[_0x3320('0x69')](_0x3d2284)){ut[_0x3320('0x5c')](_0x3320('0x120'),_0x3d2284);return{'isValid':![],'message':_0x3320('0x121')};}if(!this[_0x3320('0x97')](_0x3d2284[_0x3320('0x51')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x3320('0x122')+_0x3d2284[_0x3320('0x52')]+_0x3320('0x123'));if(!this[_0x3320('0x97')](_0x3d2284[_0x3320('0x98')])){ut[_0x3320('0x5c')](_0x3320('0x124'),_0x3d2284['name']+_0x3320('0x125'));return{'isValid':![],'message':_0x3320('0x126')};}}if(!ut['isActive'](_0x3d2284['dialActive'])){ut['logger'](_0x3320('0x127'),_0x3d2284[_0x3320('0x52')]+_0x3320('0x128'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x3d2284['name']+_0x3320('0x128')};}return{'isValid':!![],'message':_0x3320('0x129')};};Preview['prototype'][_0x3320('0x12a')]=function(_0x3d6887,_0x9a29ac,_0x44ca3e,_0x45be71){var _0x19bb15=this;return new BPromise(function(_0x4a70ea,_0x1c78d3){var _0x57935e=_0x3d6887[_0x3320('0xaf')];var _0x3a249d=_0x19bb15['isTrunkReachable'](_0x9a29ac['Trunk'])?util[_0x3320('0x87')](_0x3320('0x12b'),_0x9a29ac['Trunk']['name'],_['isNil'](_0x9a29ac[_0x3320('0x34')])?'':_0x9a29ac[_0x3320('0x34')][_0x3320('0x12c')]()||'',_0x9a29ac[_0x3320('0x12d')]>0x0?_0x44ca3e[_0x3320('0x103')]['phone'][_0x3320('0x12e')](_0x9a29ac[_0x3320('0x12d')]):_0x44ca3e['Contact'][_0x3320('0x12f')]):util['format']('SIP/%s/%s%s',_[_0x3320('0x69')](_0x9a29ac[_0x3320('0x98')])?_0x9a29ac['Trunk'][_0x3320('0x52')]:_0x9a29ac[_0x3320('0x98')][_0x3320('0x52')],_[_0x3320('0x69')](_0x9a29ac['dialPrefix'])?'':_0x9a29ac[_0x3320('0x34')]['trim']()||'',_0x9a29ac['dialCutDigit']>0x0?_0x44ca3e['Contact']['phone'][_0x3320('0x12e')](_0x9a29ac[_0x3320('0x12d')]):_0x44ca3e['Contact'][_0x3320('0x12f')]);var _0x5d67fc=_0x19bb15[_0x3320('0x97')](_0x9a29ac['Trunk'])?ut[_0x3320('0x130')](_0x9a29ac['Trunk'][_0x3320('0x131')],_0x9a29ac['dialOriginateCallerIdName'],_0x9a29ac[_0x3320('0x132')]>0x0?ut[_0x3320('0x133')](_0x9a29ac['dialOriginateCallerIdNumber'],_0x9a29ac[_0x3320('0x132')]):_0x9a29ac[_0x3320('0x32')]):ut[_0x3320('0x130')](_['isNil'](_0x9a29ac[_0x3320('0x98')])?_0x9a29ac['Trunk']['callerid']:_0x9a29ac['TrunkBackup'][_0x3320('0x131')],_0x9a29ac[_0x3320('0x31')],_0x9a29ac[_0x3320('0x132')]>0x0?ut[_0x3320('0x133')](_0x9a29ac[_0x3320('0x32')],_0x9a29ac[_0x3320('0x132')]):_0x9a29ac[_0x3320('0x32')]);if(_0x5d67fc){_0x3d6887[_0x3320('0x134')]=ut[_0x3320('0x135')](_0x5d67fc);_0x3d6887[_0x3320('0x136')]=ut[_0x3320('0x137')](_0x5d67fc);}var _0x5dfd4d=ut[_0x3320('0x138')](_0x9a29ac,_0x44ca3e,_0x3a249d,_0x5d67fc,_0x57935e,_0x3d6887);_[_0x3320('0x139')](_0x3d6887,ut['toLowerVariables'](_0x5dfd4d));_0x3d6887[_0x3320('0x86')]=moment()[_0x3320('0x87')](_0x3320('0x88'));ami['Action'](ut[_0x3320('0x13a')](_0x3d6887,_0x9a29ac,_0x5dfd4d,_0x3d6887[_0x3320('0xaa')],_0x45be71))['then'](function(_0x360e08){var _0x195ff9=_0x3d6887[_0x3320('0x13b')];if(!_[_0x3320('0x69')](_0x195ff9)){if(!_['isNil'](_0x19bb15[_0x3320('0x19')][_0x195ff9])){_0x19bb15[_0x3320('0x19')][_0x195ff9][_0x3320('0x13c')]=_0x3d6887['calleridnum'];emit(util['format'](_0x3320('0x13d'),_0x19bb15[_0x3320('0x19')][_0x195ff9][_0x3320('0x52')]),_0x3320('0x13e'),{'destaccountcode':_0x19bb15[_0x3320('0x19')][_0x195ff9][_0x3320('0x13f')],'destconnectedlinenum':_0x3d6887[_0x3320('0x140')]});}}_0x9a29ac[_0x3320('0x4b')]+=0x1;logger[_0x3320('0x57')]('[originated][increment]',_0x57935e,_0x3320('0xc2'),_0x9a29ac[_0x3320('0x52')],_0x3320('0x6c'),_0x9a29ac['originated']);_0x4a70ea(_0x360e08);})[_0x3320('0x75')](function(_0x35728d){ut[_0x3320('0xf8')](_0x3d6887,0xe,_0x3320('0x141'));rpcDb[_0x3320('0xfa')](_0x3d6887,'[originateFailure][logOriginateFailure]');_0x1c78d3(_0x35728d);});});};Preview['prototype'][_0x3320('0x22')]=function(_0x1f2029){if(this['actions'][_0x1f2029[_0x3320('0xab')]]){this['actions'][_0x1f2029[_0x3320('0xab')]][_0x3320('0x74')]=_0x1f2029[_0x3320('0x74')];}};Preview[_0x3320('0x10')]['syncOriginateResponse']=function(_0x3b9600){var _0x36b4d3=this;var _0x399b0b=this[_0x3320('0x18')][_0x3b9600[_0x3320('0x142')]];if(_0x399b0b){if(_0x399b0b[_0x3320('0x106')]&&this[_0x3320('0x19')][_0x399b0b['lookAgent']]){ut[_0x3320('0x143')](_0x399b0b,this[_0x3320('0x19')][_0x399b0b[_0x3320('0x106')]][_0x3320('0x52')],this[_0x3320('0x19')][_0x399b0b[_0x3320('0x106')]]['id']);}var _0x1dfab0=_['clone'](_0x399b0b);_0x1dfab0[_0x3320('0x144')]=moment()[_0x3320('0x87')](_0x3320('0x88'));var _0xaa802a=_0x36b4d3[_0x3320('0x15')][_0x399b0b[_0x3320('0x6b')]];if(ut[_0x3320('0x145')](_0x3b9600[_0x3320('0x146')])){if(_0x399b0b[_0x3320('0xa9')]){rpcDb[_0x3320('0x116')](_0x399b0b[_0x3320('0x10b')]);}if(_0x399b0b['activeContact']){rpcDb[_0x3320('0x85')](_0x399b0b[_0x3320('0x10b')]);}ami[_0x3320('0x26')](_0x3320('0x147'),ut[_0x3320('0xa1')](_0x399b0b,'rejected',this[_0x3320('0x15')][_0x399b0b[_0x3320('0x6b')]]));this['callProgressDetectingAgent'](_0x1dfab0,_0xaa802a,_0x3b9600);}else{_0x399b0b['starttime']=moment()[_0x3320('0x87')](_0x3320('0x88'));ut[_0x3320('0xf8')](_0x1dfab0,0x4,'Answer');rpcDb[_0x3320('0xfa')](_0x1dfab0,_0x3320('0x148'));}}};Preview[_0x3320('0x10')][_0x3320('0x149')]=function(_0x404602){var _0x11daa4=this;var _0x3f04c0=this[_0x3320('0x18')][_0x404602[_0x3320('0xab')]];var _0x37bfe2;if(_0x3f04c0){_0x37bfe2=this[_0x3320('0x15')][_0x3f04c0[_0x3320('0x6b')]];logger[_0x3320('0x57')](_0x3320('0x14a'),_0x404602[_0x3320('0xab')],'\x20Queue',_0x37bfe2['name'],_0x3320('0x6d'),_0x37bfe2[_0x3320('0x29')]);}if(this[_0x3320('0x18')][_0x404602[_0x3320('0xab')]]&&_0x404602[_0x3320('0xab')]!==_0x404602[_0x3320('0xaf')]){if(_0x404602[_0x3320('0x14b')]==='16'&&this[_0x3320('0x18')][_0x404602[_0x3320('0xab')]][_0x3320('0x6e')]){this[_0x3320('0x9b')](_0x404602,_0x404602[_0x3320('0xab')],_0x404602[_0x3320('0x14b')]);}else if(this[_0x3320('0x18')][_0x404602[_0x3320('0xab')]][_0x3320('0x6e')]){logger[_0x3320('0x57')](_0x3320('0x14c'),_0x404602['linkedid'],_0x404602[_0x3320('0x14b')],'\x20Queue',_0x37bfe2[_0x3320('0x52')],_0x3320('0x6d'),_0x37bfe2['pTalking']);this[_0x3320('0x9b')](_0x404602,_0x404602[_0x3320('0xab')],_0x404602['cause']);}}else if(_0x3f04c0&&_[_0x3320('0x69')](_0x3f04c0[_0x3320('0x14d')])&&_0x37bfe2[_0x3320('0x14e')]&&_0x404602[_0x3320('0xab')]===_0x404602[_0x3320('0xaf')]&&_[_0x3320('0x69')](_0x404602['reason'])&&_0x404602[_0x3320('0x14b')]==='16'&&_0x404602[_0x3320('0x14f')]==='6'&&_[_0x3320('0xf5')](_0x3f04c0[_0x3320('0x150')])){if(_0x3f04c0[_0x3320('0xa9')]){rpcDb[_0x3320('0x116')](_0x3f04c0['idContact']);}if(_0x3f04c0[_0x3320('0xaa')]){rpcDb[_0x3320('0x85')](_0x3f04c0[_0x3320('0x10b')]);}_0x404602[_0x3320('0xf7')]='22';this[_0x3320('0xf4')](_0x3f04c0,_0x37bfe2,_0x404602);}else if(_0x3f04c0&&_0x3f04c0[_0x3320('0x150')]){if(_0x404602['cause']==='16'&&this['actions'][_0x404602['linkedid']][_0x3320('0x6e')]){logger[_0x3320('0x57')](_0x3320('0x151'),_0x404602['linkedid'],_0x404602[_0x3320('0x14b')],'\x20Queue',_0x37bfe2[_0x3320('0x52')],'pTalking:\x20',_0x37bfe2[_0x3320('0x29')]);this[_0x3320('0x9b')](_0x404602,_0x404602[_0x3320('0xab')],_0x404602['cause']);}else if(this['actions'][_0x404602[_0x3320('0xab')]][_0x3320('0x6e')]){logger[_0x3320('0x57')](_0x3320('0x14c'),_0x404602[_0x3320('0xab')],_0x404602[_0x3320('0x14b')],_0x3320('0xc2'),_0x37bfe2[_0x3320('0x52')],_0x3320('0x6d'),_0x37bfe2[_0x3320('0x29')]);this[_0x3320('0x9b')](_0x404602,_0x404602[_0x3320('0xab')],_0x404602[_0x3320('0x14b')]);}}};Preview['prototype'][_0x3320('0x152')]=function(_0x401943){if(this[_0x3320('0x18')][_0x401943[_0x3320('0xf3')]]&&_0x401943[_0x3320('0xf3')]!==_0x401943[_0x3320('0x153')]){this[_0x3320('0x9b')](_0x401943,_0x401943[_0x3320('0xf3')],_0x401943[_0x3320('0xea')]);}};Preview[_0x3320('0x10')][_0x3320('0x154')]=function(_0x19e96d){if(this['actions'][_0x19e96d['linkedid']]&&_0x19e96d[_0x3320('0xab')]!==_0x19e96d[_0x3320('0xaf')]&&!this[_0x3320('0x18')][_0x19e96d[_0x3320('0xab')]][_0x3320('0x6e')]){if(_0x19e96d[_0x3320('0x14b')]==='1'){this['callProgressDetectingCustomer'](_0x19e96d,_0x19e96d[_0x3320('0xab')],_0x19e96d['cause']);}}};Preview[_0x3320('0x10')][_0x3320('0x155')]=function(_0x1c4a54,_0xe75003,_0x1a5aff){if(this['actions'][_0x1c4a54]){if(_[_0x3320('0x69')](this[_0x3320('0x18')][_0x1c4a54]['variables'])){this['actions'][_0x1c4a54]['variables']={};}this[_0x3320('0x18')][_0x1c4a54]['variables'][_0xe75003]=_0x1a5aff;}};Preview['prototype'][_0x3320('0x156')]=function(_0x3bd6b5){try{if(!_[_0x3320('0x69')](_0x3bd6b5)){if(ut[_0x3320('0x157')](_[_0x3320('0x158')](_0x3bd6b5['variable'])[0x0])){this['addVariable'](_0x3bd6b5['uniqueid'],_[_0x3320('0x158')](_0x3bd6b5[_0x3320('0x159')])[0x0],_0x3bd6b5[_0x3320('0x15a')]);}}}catch(_0x3737f1){logger[_0x3320('0x15b')](_0x3320('0x15c'),util[_0x3320('0x15d')](_0x3737f1,{'showHidden':![],'depth':null}));}};Preview[_0x3320('0x10')]['syncAttendedTransfer']=function(_0xb533a5){if(_0xb533a5){if(this['actions'][_0xb533a5[_0x3320('0x15e')]]){this[_0x3320('0x18')][_0xb533a5['transfertargetlinkedid']][_0x3320('0x150')]=!![];}}};Preview[_0x3320('0x10')]['syncBlindTransfer']=function(_0x458fff){if(_0x458fff){if(this[_0x3320('0x18')][_0x458fff[_0x3320('0x15f')]]){this[_0x3320('0x18')][_0x458fff['transfererlinkedid']]['transfer']=!![];}}};module[_0x3320('0x160')]=Preview; \ No newline at end of file +var _0x4a69=['dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','callerid','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','destconnectedlinenum','user:%s','calleridnum','actionid','lookAgent','logLookAgent','clone','response','rejected','callProgressDetectingAgent','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','variables','syncVarSet','filterKey','keys','variable','value','inspect','transfertargetlinkedid','transfer','util','lodash','bluebird','uuid','moment','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','./util/util','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','hangup','syncHangup','bind','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','name','available','loggedIn','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','\x20is\x20disactive','loopCampaigns','syncCampaigns','hasOwnProperty','dialMethod','booked','outbound','clearZombieChannels','preview','setMessage','recallMe','prototype','clearZombieChannel','isNil','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','starttime','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','buildAcw','custom:agentcomplete','complete','answered','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','\x20Queue','BUSY','countbusyretry','countglobal','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialBusyMaxRetry','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','[callProgressDetectingCustomer][logCongestion]','countagentrejectretry','custom:agentreject','agentreject','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','isUndefined','object','logAgent','createAgentHistory','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','Queue','isEmpty','execCall','[Preview][execCall][success]','idContact','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x4a69,0x183));var _0x94a6=function(_0x3cf150,_0x178cb5){_0x3cf150=_0x3cf150-0x0;var _0x931f8b=_0x4a69[_0x3cf150];return _0x931f8b;};'use strict';var util=require(_0x94a6('0x0'));var _=require(_0x94a6('0x1'));var BPromise=require(_0x94a6('0x2'));var uuid=require(_0x94a6('0x3'));var moment=require(_0x94a6('0x4'));var md5=require('md5');var Redis=require(_0x94a6('0x5'));var config=require(_0x94a6('0x6'));var logger=require(_0x94a6('0x7'))('preview');var loggerAction=require(_0x94a6('0x7'))(_0x94a6('0x8'));var ami=require(_0x94a6('0x9'));var rpcDb=require(_0x94a6('0xa'));var Action=require('./action');var ut=require(_0x94a6('0xb'));config[_0x94a6('0xc')]=_['defaults'](config[_0x94a6('0xc')],{'host':_0x94a6('0xd'),'port':0x18eb});var io=require(_0x94a6('0xe'))(new Redis(config[_0x94a6('0xc')]));var Sequence=function(){};Sequence['prototype'][_0x94a6('0xf')]=function(_0x5ccb69){this['tail']=this['tail']?this[_0x94a6('0x10')][_0x94a6('0x11')](_0x5ccb69):_0x5ccb69();};function Preview(_0x57182d){this[_0x94a6('0x12')]=new Sequence();this[_0x94a6('0x13')]=_0x57182d[_0x94a6('0x14')];this['trunks']=_0x57182d[_0x94a6('0x15')];this[_0x94a6('0x16')]={};this[_0x94a6('0x17')]=_0x57182d[_0x94a6('0x17')];this[_0x94a6('0x18')]=0x0;ami['on'](_0x94a6('0x19'),this['syncOriginateResponse']['bind'](this));ami['on'](_0x94a6('0x1a'),this[_0x94a6('0x1b')][_0x94a6('0x1c')](this));ami['on']('hanguprequest',this[_0x94a6('0x1d')][_0x94a6('0x1c')](this));ami['on'](_0x94a6('0x1e'),this[_0x94a6('0x1f')][_0x94a6('0x1c')](this));ami['on'](_0x94a6('0x20'),this[_0x94a6('0x21')]['bind'](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0x94a6('0x22'),this[_0x94a6('0x23')]['bind'](this));ami['on'](_0x94a6('0x24'),this[_0x94a6('0x25')]['bind'](this));this['loopCampaigns'](this[_0x94a6('0x13')]);}function emit(_0x25099b,_0x45cff1,_0x164fd7){io['to'](_0x25099b)[_0x94a6('0x26')](_0x45cff1,_0x164fd7);}function emitCampaignPreview(_0x512e7f){if(_0x512e7f[_0x94a6('0x27')]==='outbound'){var _0x14c1a6={'id':_0x512e7f['id'],'name':_0x512e7f[_0x94a6('0x28')],'strategy':_0x512e7f['strategy'],'answered':_0x512e7f['answered'],'available':_0x512e7f[_0x94a6('0x29')],'loggedIn':_0x512e7f[_0x94a6('0x2a')],'pTalking':_0x512e7f['pTalking'],'sumBillable':_0x512e7f['sumBillable'],'sumDuration':_0x512e7f[_0x94a6('0x2b')],'sumHoldTime':_0x512e7f['sumHoldTime']||0x0,'talking':_0x512e7f[_0x94a6('0x2c')],'total':_0x512e7f[_0x94a6('0x2d')],'type':_0x512e7f[_0x94a6('0x27')],'unmanaged':_0x512e7f[_0x94a6('0x2e')],'abandoned':_0x512e7f[_0x94a6('0x2f')],'waiting':_0x512e7f[_0x94a6('0x30')],'loggedInDb':_0x512e7f[_0x94a6('0x31')],'dialActive':_0x512e7f[_0x94a6('0x32')],'dialMethod':_0x512e7f['dialMethod'],'dialOriginateCallerIdName':_0x512e7f['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x512e7f[_0x94a6('0x33')],'dialOriginateTimeout':_0x512e7f[_0x94a6('0x34')],'dialPrefix':_0x512e7f['dialPrefix'],'outboundAnswerAgiCallsDay':_0x512e7f['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x512e7f[_0x94a6('0x35')],'outboundBlacklistCallsDay':_0x512e7f[_0x94a6('0x36')],'outboundBusyCallsDay':_0x512e7f[_0x94a6('0x37')],'outboundCongestionCallsDay':_0x512e7f[_0x94a6('0x38')],'outboundDropCallsDayACS':_0x512e7f[_0x94a6('0x39')],'outboundDropCallsDayCallersExit':_0x512e7f[_0x94a6('0x3a')],'outboundDropCallsDayTimeout':_0x512e7f[_0x94a6('0x3b')],'outboundNoAnswerCallsDay':_0x512e7f['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x512e7f['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x512e7f[_0x94a6('0x3c')],'outboundReCallsDay':_0x512e7f[_0x94a6('0x3d')],'outboundRejectCallsDay':_0x512e7f[_0x94a6('0x3e')],'outboundUnknownCallsDay':_0x512e7f[_0x94a6('0x3f')],'outboundAbandonedCallsDay':_0x512e7f[_0x94a6('0x40')],'predictiveIntervalAnsweredCalls':_0x512e7f[_0x94a6('0x41')],'predictiveIntervalAvgHoldtime':_0x512e7f[_0x94a6('0x42')],'predictiveIntervalAvgTalktime':_0x512e7f[_0x94a6('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x512e7f['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x512e7f['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x512e7f[_0x94a6('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x512e7f[_0x94a6('0x45')],'predictiveIntervalHitRate':_0x512e7f[_0x94a6('0x46')],'predictiveIntervalMultiplicativeFactor':_0x512e7f[_0x94a6('0x47')],'predictiveIntervalPauses':_0x512e7f[_0x94a6('0x48')],'predictiveIntervalAvailable':_0x512e7f[_0x94a6('0x49')],'predictiveIntervalTotalCalls':_0x512e7f['predictiveIntervalTotalCalls'],'message':_0x512e7f[_0x94a6('0x4a')],'originated':_0x512e7f['originated'],'erlangCalls':_0x512e7f[_0x94a6('0x4b')],'erlangCallToSecond':_0x512e7f[_0x94a6('0x4c')],'erlangAbandonmentRate':_0x512e7f['erlangAbandonmentRate'],'erlangBusyFactor':_0x512e7f[_0x94a6('0x4d')],'startPredictive':_0x512e7f[_0x94a6('0x4e')],'startProgressive':_0x512e7f[_0x94a6('0x4f')]};if(_0x512e7f['Trunk']){_0x14c1a6['Trunk']={'id':_0x512e7f[_0x94a6('0x50')]['id'],'name':_0x512e7f[_0x94a6('0x50')][_0x94a6('0x28')],'active':_0x512e7f['Trunk'][_0x94a6('0x51')],'callerid':_0x512e7f['Trunk']['callerid']};}if(_0x512e7f['Interval']){_0x14c1a6[_0x94a6('0x52')]={'id':_0x512e7f['Interval']['id'],'name':_0x512e7f['Interval'][_0x94a6('0x28')]};}var _0x4b3685=md5(JSON[_0x94a6('0x53')](_0x14c1a6));if(_0x512e7f['md5']!==_0x4b3685){_0x512e7f[_0x94a6('0x54')]=_0x4b3685;emit(util[_0x94a6('0x55')](_0x94a6('0x56'),_0x14c1a6[_0x94a6('0x28')]),_0x94a6('0x57'),_0x14c1a6);}}}function emitVoiceQueueChannelRemove(_0x2c6b83){logger[_0x94a6('0x58')](_0x94a6('0x59'),JSON[_0x94a6('0x53')](_0x2c6b83));emit(util[_0x94a6('0x55')](_0x94a6('0x56'),_0x2c6b83['name']),_0x94a6('0x5a'),_0x2c6b83);io[_0x94a6('0x26')](_0x94a6('0x5b'),_0x2c6b83);}function notSendMessagesQueue(_0x5f371c){if(_0x5f371c[_0x94a6('0x5c')]){if(_0x5f371c[_0x94a6('0x5d')]===0x0&&_0x5f371c[_0x94a6('0x5e')]===0x0){_0x5f371c[_0x94a6('0x5c')]=![];_0x5f371c[_0x94a6('0x29')]=0x0;_0x5f371c[_0x94a6('0x5f')]=0x0;_0x5f371c[_0x94a6('0x4a')]=_0x94a6('0x60');ut[_0x94a6('0x61')](_0x94a6('0x62'),_0x5f371c['name']+'\x20is\x20not\x20active');}else{_0x5f371c[_0x94a6('0x4a')]=_0x94a6('0x63');ut[_0x94a6('0x61')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x5f371c[_0x94a6('0x28')]+_0x94a6('0x64'));}emitCampaignPreview(_0x5f371c);}}Preview['prototype'][_0x94a6('0x65')]=function(){var _0x57830b=this;setInterval(function(){_0x57830b[_0x94a6('0x66')]();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x49ad39=this[_0x94a6('0x13')];this['clockClearZombieChannels']+=0x1;for(var _0x232147 in _0x49ad39){if(_0x49ad39[_0x94a6('0x67')](_0x232147)&&(_0x49ad39[_0x232147][_0x94a6('0x68')]==='preview'||_0x49ad39[_0x232147]['dialMethod']===_0x94a6('0x69'))&&_0x49ad39[_0x232147][_0x94a6('0x27')]===_0x94a6('0x6a')){if(this[_0x94a6('0x18')]>0x7){this[_0x94a6('0x18')]=0x0;this[_0x94a6('0x6b')]();}}if(_0x49ad39[_0x94a6('0x67')](_0x232147)&&_0x49ad39[_0x232147][_0x94a6('0x68')]===_0x94a6('0x6c')&&_0x49ad39[_0x232147][_0x94a6('0x27')]===_0x94a6('0x6a')){if(_0x49ad39[_0x232147][_0x94a6('0x32')]){this[_0x94a6('0x6d')](_0x49ad39[_0x232147]);this[_0x94a6('0x6e')](_0x49ad39[_0x232147]);}else{notSendMessagesQueue(_0x49ad39[_0x232147]);}}}};Preview[_0x94a6('0x6f')][_0x94a6('0x70')]=function(_0x556094){var _0x507491=this;this['sequence'][_0x94a6('0xf')](function(){if(!_[_0x94a6('0x71')](_0x507491[_0x94a6('0x16')][_0x556094])){loggerAction[_0x94a6('0x58')](_0x94a6('0x72'),_0x556094,'Queue',_0x507491[_0x94a6('0x16')][_0x556094][_0x94a6('0x73')],_0x94a6('0x74'),JSON[_0x94a6('0x53')](_0x507491[_0x94a6('0x13')][_0x507491[_0x94a6('0x16')][_0x556094]['queue']][_0x94a6('0x5d')]),_0x94a6('0x75'),JSON[_0x94a6('0x53')](_0x507491[_0x94a6('0x13')][_0x507491['actions'][_0x556094][_0x94a6('0x73')]][_0x94a6('0x5e')]),JSON[_0x94a6('0x53')](_0x507491[_0x94a6('0x16')][_0x556094][_0x94a6('0x76')]),JSON['stringify'](_[_0x94a6('0x77')](_0x507491[_0x94a6('0x16')][_0x556094],[_0x94a6('0x78'),_0x94a6('0x79'),_0x94a6('0x7a'),_0x94a6('0x7b')])));return ami[_0x94a6('0x7c')]({'action':_0x94a6('0x7d'),'channel':_0x507491['actions'][_0x556094][_0x94a6('0x7e')]})[_0x94a6('0x7f')](function(_0x34e758){if(_0x34e758[_0x94a6('0x4a')]===_0x94a6('0x80')){setTimeout(function(){if(_0x507491[_0x94a6('0x16')][_0x556094]){ut['updateOriginated'](_0x507491[_0x94a6('0x13')][_0x507491[_0x94a6('0x16')][_0x556094][_0x94a6('0x73')]],_0x94a6('0x81'));if(_0x507491[_0x94a6('0x16')][_0x556094][_0x94a6('0x76')]===!![]){ut[_0x94a6('0x82')](_0x507491[_0x94a6('0x13')][_0x507491[_0x94a6('0x16')][_0x556094][_0x94a6('0x73')]],_0x94a6('0x81'));ut[_0x94a6('0x83')](_0x94a6('0x84')+_0x556094,_0x507491['actions'][_0x556094][_0x94a6('0x73')]);}ut[_0x94a6('0x83')](_0x94a6('0x85')+_0x556094,_0x507491[_0x94a6('0x16')][_0x556094]['queue']);delete _0x507491[_0x94a6('0x16')][_0x556094];}},0x2328);}});}});};Preview[_0x94a6('0x6f')][_0x94a6('0x6b')]=function(){var _0x1fa2c8=this;loggerAction[_0x94a6('0x58')](_0x94a6('0x86'),_[_0x94a6('0x87')](this['actions']));for(var _0x280a82 in this['actions']){if(_0x1fa2c8['actions']['hasOwnProperty'](_0x280a82)){_0x1fa2c8[_0x94a6('0x70')](_0x280a82);}}};Preview[_0x94a6('0x6f')][_0x94a6('0x6e')]=function(_0x305585){var _0x2d31fa=this;rpcDb[_0x94a6('0x88')](_0x305585['id'],ut[_0x94a6('0x89')](this[_0x94a6('0x17')]))[_0x94a6('0x8a')](function(_0x327536){if(!_[_0x94a6('0x71')](_0x327536)){for(var _0x4e8bb6=0x0;_0x4e8bb6<_0x327536['length'];_0x4e8bb6+=0x1){if(ut['getDiff'](_0x327536[_0x4e8bb6][_0x94a6('0x8b')])<_0x305585[_0x94a6('0x8c')]*0x3c){if(_0x327536[_0x4e8bb6][_0x94a6('0x8d')]&&!_0x327536[_0x4e8bb6][_0x94a6('0x8d')]['voicePause']){_0x2d31fa[_0x94a6('0x8e')](_0x327536[_0x4e8bb6]['id'])['then'](ut[_0x94a6('0x8f')](_0x94a6('0x90')))[_0x94a6('0x7f')](ut['logger2'](_0x94a6('0x90')));}else{rpcDb[_0x94a6('0x91')](_0x327536[_0x4e8bb6]['id']);}}else{var _0x2d6968=new Action(_0x327536[_0x4e8bb6],_0x305585);_0x2d6968[_0x94a6('0x92')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x305585[_0x94a6('0x3d')]+=0x1;ut[_0x94a6('0x93')](_0x2d6968,0x17,_0x94a6('0x94'));if(_0x305585[_0x94a6('0x95')]){rpcDb[_0x94a6('0x96')](ut[_0x94a6('0x97')](_0x327536[_0x4e8bb6]));rpcDb[_0x94a6('0x98')](_0x2d6968,_0x94a6('0x99'));}else{ut[_0x94a6('0x93')](_0x2d6968,0x16,_0x94a6('0x9a'));rpcDb[_0x94a6('0x98')](_0x2d6968,_0x94a6('0x9b'));rpcDb[_0x94a6('0x9c')](_0x2d6968,'[HistoryRecallClose]');}}}}})[_0x94a6('0x7f')](ut[_0x94a6('0x8f')](_0x94a6('0x9d')));};Preview[_0x94a6('0x6f')][_0x94a6('0x6d')]=function(_0x2db7cc){_0x2db7cc['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x2db7cc[_0x94a6('0x2a')])){_0x2db7cc[_0x94a6('0x4a')]=_0x94a6('0x9e');}else if(!ut[_0x94a6('0x9f')](_0x2db7cc['dialActive'])){_0x2db7cc['message']='NOT_ACTIVE';}else if(!this[_0x94a6('0xa0')](_0x2db7cc[_0x94a6('0x50')])){if(!this['isTrunkReachable'](_0x2db7cc['TrunkBackup'])){_0x2db7cc[_0x94a6('0x4a')]=_0x94a6('0xa1');}else{_0x2db7cc[_0x94a6('0x4a')]=_0x94a6('0xa2');}}else{_0x2db7cc[_0x94a6('0x4a')]='ACTIVE';}emitCampaignPreview(_0x2db7cc);};Preview[_0x94a6('0x6f')][_0x94a6('0xa3')]=function(_0x233964,_0x2a97b3,_0x117f75){var _0x4e25b1=this;var _0x4f3fa6=this[_0x94a6('0x16')][_0x2a97b3];var _0x458336=this[_0x94a6('0x13')][_0x4f3fa6['queue']];var _0x4e2f31;if(_0x458336){switch(_0x117f75){case'1':_0x458336[_0x94a6('0xa4')]+=0x1;_0x4f3fa6[_0x94a6('0xa5')]+=0x1;_0x4f3fa6['countglobal']=ut[_0x94a6('0xa6')](_0x4f3fa6);ut[_0x94a6('0x93')](_0x4f3fa6,0x0,_0x94a6('0xa7'));ami[_0x94a6('0x26')](_0x94a6('0xa8'),ut[_0x94a6('0xa9')](_0x4f3fa6,_0x94a6('0xaa')));rpcDb[_0x94a6('0x98')](_0x4f3fa6,_0x94a6('0xab'));if(ut[_0x94a6('0xa6')](_0x4f3fa6)>=_0x458336[_0x94a6('0xac')]){_0x4e2f31=ut[_0x94a6('0xad')](_0x4f3fa6,0xf,_0x94a6('0xae'));rpcDb[_0x94a6('0x9c')](_0x4e2f31,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x4f3fa6[_0x94a6('0xa5')]>=_0x458336[_0x94a6('0xaf')]){rpcDb[_0x94a6('0x9c')](_0x4f3fa6,_0x94a6('0xb0'));}else{rpcDb[_0x94a6('0xb1')](ut[_0x94a6('0xb2')](_0x4f3fa6,'countnosuchnumberretry',_0x458336[_0x94a6('0xb3')]),_0x4f3fa6[_0x94a6('0xb4')],_0x4f3fa6[_0x94a6('0xb5')]);}}delete this[_0x94a6('0x16')][_0x233964[_0x94a6('0xb6')]];break;case _0x94a6('0xb7'):var _0x5ced21=moment()[_0x94a6('0x55')](_0x94a6('0xb8'));_0x4f3fa6[_0x94a6('0xb9')]=_0x5ced21;_0x4f3fa6['answertime']=_0x5ced21;_0x4f3fa6[_0x94a6('0x76')]=!![];_0x458336['pTalking']+=0x1;logger[_0x94a6('0x58')](_0x94a6('0xba'),_0x4f3fa6[_0x94a6('0xbb')],'\x20Queue',_0x458336[_0x94a6('0x28')],_0x94a6('0x75'),_0x458336['pTalking']);ami[_0x94a6('0x26')](_0x94a6('0xbc'),ut['buildObj'](_0x4f3fa6,_0x94a6('0xbd'),this[_0x94a6('0x13')][_0x4f3fa6['queue']]));if(_0x458336['acw']){ami[_0x94a6('0x26')]('custom:agentConnectPreview',ut[_0x94a6('0xbe')](_0x4f3fa6));}break;case'16':ami['emit'](_0x94a6('0xbf'),ut[_0x94a6('0xa9')](_0x4f3fa6,_0x94a6('0xc0'),this[_0x94a6('0x13')][_0x4f3fa6[_0x94a6('0x73')]]));emitVoiceQueueChannelRemove(ut[_0x94a6('0xa9')](_0x4f3fa6,'complete'));_0x458336[_0x94a6('0x35')]+=0x1;_0x458336[_0x94a6('0x2d')]+=0x1;_0x458336[_0x94a6('0xc1')]+=0x1;ut['decrementTalkink'](_0x458336,'[16]');_0x4f3fa6['countglobal']=ut[_0x94a6('0xa6')](_0x4f3fa6);ut['logCustomer'](_0x4f3fa6,0x4,'Answer');rpcDb['createCustomerHistory'](_0x4f3fa6,_0x94a6('0xc2'));rpcDb[_0x94a6('0x9c')](_0x4f3fa6,_0x94a6('0xc3'));rpcDb[_0x94a6('0xc4')](_0x4f3fa6);_0x458336['sumDuration']+=_0x4f3fa6[_0x94a6('0xc5')];_0x458336[_0x94a6('0xc6')]+=_0x4f3fa6[_0x94a6('0xc5')];logger[_0x94a6('0x58')]('[syncHangup][talking][decrement]',_0x4f3fa6[_0x94a6('0xbb')],_0x94a6('0xc7'),_0x458336[_0x94a6('0x28')],'pTalking:\x20',_0x458336[_0x94a6('0x5e')]);delete this[_0x94a6('0x16')][_0x233964[_0x94a6('0xb6')]];break;case _0x94a6('0xc8'):_0x458336[_0x94a6('0x37')]+=0x1;_0x4f3fa6[_0x94a6('0xc9')]+=0x1;_0x4f3fa6[_0x94a6('0xca')]=ut[_0x94a6('0xa6')](_0x4f3fa6);ut[_0x94a6('0x93')](_0x4f3fa6,0x5,_0x94a6('0xcb'));ami[_0x94a6('0x26')](_0x94a6('0xcc'),ut[_0x94a6('0xa9')](_0x4f3fa6,_0x94a6('0xcd')));rpcDb[_0x94a6('0x98')](_0x4f3fa6,_0x94a6('0xce'));if(ut[_0x94a6('0xa6')](_0x4f3fa6)>=_0x458336[_0x94a6('0xac')]){_0x4e2f31=ut['cloneAction'](_0x4f3fa6,0xf,'Global');rpcDb[_0x94a6('0x9c')](_0x4e2f31,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x4f3fa6[_0x94a6('0xc9')]>=_0x458336[_0x94a6('0xcf')]){rpcDb[_0x94a6('0x9c')](_0x4f3fa6,_0x94a6('0xce'));}else{rpcDb[_0x94a6('0xb1')](ut['scheduledAt'](_0x4f3fa6,'countbusyretry',_0x458336['dialBusyRetryFrequency']),_0x4f3fa6[_0x94a6('0xb4')],_0x4f3fa6[_0x94a6('0xb5')]);}}break;case _0x94a6('0xd0'):_0x458336['outboundNoAnswerCallsDay']+=0x1;_0x4f3fa6[_0x94a6('0xd1')]+=0x1;_0x4f3fa6[_0x94a6('0xca')]=ut['totalGlobal'](_0x4f3fa6);ut[_0x94a6('0x93')](_0x4f3fa6,0x3,_0x94a6('0xd2'));ami[_0x94a6('0x26')](_0x94a6('0xd3'),ut[_0x94a6('0xa9')](_0x4f3fa6,_0x94a6('0xd4')));rpcDb[_0x94a6('0x98')](_0x4f3fa6,_0x94a6('0xd5'));if(ut[_0x94a6('0xa6')](_0x4f3fa6)>=_0x458336[_0x94a6('0xac')]){_0x4e2f31=ut[_0x94a6('0xad')](_0x4f3fa6,0xf,'Global');rpcDb[_0x94a6('0x9c')](_0x4e2f31,_0x94a6('0xd6'));}else{if(_0x4f3fa6[_0x94a6('0xd1')]>=_0x458336[_0x94a6('0xd7')]){rpcDb['createCustomerFinal'](_0x4f3fa6,_0x94a6('0xd5'));}else{rpcDb['rescheduleContact'](ut[_0x94a6('0xb2')](_0x4f3fa6,_0x94a6('0xd1'),_0x458336[_0x94a6('0xd8')]),_0x4f3fa6['unlockAgent'],_0x4f3fa6[_0x94a6('0xb5')]);}}break;case'CONGESTION':_0x458336['outboundCongestionCallsDay']+=0x1;_0x4f3fa6[_0x94a6('0xd9')]+=0x1;_0x4f3fa6[_0x94a6('0xca')]=ut[_0x94a6('0xa6')](_0x4f3fa6);ut[_0x94a6('0x93')](_0x4f3fa6,0x8,'Congestion');ami[_0x94a6('0x26')](_0x94a6('0xda'),ut[_0x94a6('0xa9')](_0x4f3fa6,_0x94a6('0xdb')));rpcDb[_0x94a6('0x98')](_0x4f3fa6,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x4f3fa6)>=_0x458336['dialGlobalMaxRetry']){_0x4e2f31=ut['cloneAction'](_0x4f3fa6,0xf,'Global');rpcDb[_0x94a6('0x9c')](_0x4e2f31,_0x94a6('0xdc'));}else{if(_0x4f3fa6[_0x94a6('0xd9')]>=_0x458336['dialCongestionMaxRetry']){rpcDb[_0x94a6('0x9c')](_0x4f3fa6,_0x94a6('0xdd'));}else{rpcDb['rescheduleContact'](ut[_0x94a6('0xb2')](_0x4f3fa6,_0x94a6('0xd9'),_0x458336['dialBusyRetryFrequency']),_0x4f3fa6[_0x94a6('0xb4')],_0x4f3fa6['activeContact']);}}break;case'CANCEL':_0x458336['outboundRejectCallsDay']+=0x1;_0x4f3fa6[_0x94a6('0xde')]+=0x1;_0x4f3fa6[_0x94a6('0xca')]=ut[_0x94a6('0xa6')](_0x4f3fa6);ut[_0x94a6('0x93')](_0x4f3fa6,0x14,'AgentReject');ami['emit'](_0x94a6('0xdf'),ut[_0x94a6('0xa9')](_0x4f3fa6,_0x94a6('0xe0')));rpcDb[_0x94a6('0x98')](_0x4f3fa6,'[syncHangupRequest][logAgentReject]');if(ut[_0x94a6('0xa6')](_0x4f3fa6)>=_0x458336['dialGlobalMaxRetry']){_0x4e2f31=ut[_0x94a6('0xad')](_0x4f3fa6,0x14,_0x94a6('0xe1'));rpcDb[_0x94a6('0x9c')](_0x4e2f31,_0x94a6('0xe2'));}else{if(_0x4f3fa6['countagentrejectretry']>=_0x458336[_0x94a6('0xe3')]){rpcDb[_0x94a6('0x9c')](_0x4f3fa6,_0x94a6('0xe2'));}else{rpcDb[_0x94a6('0xb1')](ut[_0x94a6('0xb2')](_0x4f3fa6,_0x94a6('0xde'),_0x458336[_0x94a6('0xe4')]),_0x4f3fa6[_0x94a6('0xb4')],_0x4f3fa6[_0x94a6('0xb5')]);}}break;case _0x94a6('0xe5'):_0x458336['outboundAbandonedCallsDay']+=0x1;_0x4f3fa6['countabandonedretry']+=0x1;_0x4f3fa6['countglobal']=ut[_0x94a6('0xa6')](_0x4f3fa6);ut[_0x94a6('0x93')](_0x4f3fa6,0xb,_0x94a6('0xe6'));rpcDb[_0x94a6('0x98')](_0x4f3fa6,_0x94a6('0xe7'));if(ut[_0x94a6('0xa6')](_0x4f3fa6)>=_0x458336[_0x94a6('0xac')]){_0x4e2f31=ut[_0x94a6('0xad')](_0x4f3fa6,0xf,'Global');rpcDb[_0x94a6('0x9c')](_0x4e2f31,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x4f3fa6[_0x94a6('0xe8')]>=_0x458336[_0x94a6('0xe9')]){rpcDb[_0x94a6('0x9c')](_0x4f3fa6,_0x94a6('0xe7'));}else{rpcDb[_0x94a6('0xb1')](ut[_0x94a6('0xb2')](_0x4f3fa6,_0x94a6('0xea'),_0x458336['dialAbandonedRetryFrequency']),_0x4f3fa6[_0x94a6('0xb4')],_0x4f3fa6[_0x94a6('0xb5')]);}}break;case'18':_0x458336[_0x94a6('0x3f')]+=0x1;_0x4f3fa6[_0x94a6('0xeb')]+=0x1;_0x4f3fa6[_0x94a6('0xca')]=ut['totalGlobal'](_0x4f3fa6);ut[_0x94a6('0x93')](_0x4f3fa6,0x12,_0x233964[_0x94a6('0xec')]||_0x233964['dialstatus']);ami[_0x94a6('0x26')](_0x94a6('0xed'),ut[_0x94a6('0xa9')](_0x4f3fa6,_0x94a6('0xee')));rpcDb[_0x94a6('0x98')](_0x4f3fa6,_0x94a6('0xef'));if(ut['totalGlobal'](_0x4f3fa6)>=_0x458336[_0x94a6('0xac')]){_0x4e2f31=ut[_0x94a6('0xad')](_0x4f3fa6,0xf,_0x94a6('0xae'));rpcDb[_0x94a6('0x9c')](_0x4e2f31,_0x94a6('0xef'));}else{rpcDb[_0x94a6('0x9c')](_0x4f3fa6,_0x94a6('0xef'));}delete this[_0x94a6('0x16')][_0x233964[_0x94a6('0xb6')]];break;case'19':_0x458336[_0x94a6('0x3f')]+=0x1;_0x4f3fa6[_0x94a6('0xca')]=ut[_0x94a6('0xa6')](_0x4f3fa6);ut[_0x94a6('0x93')](_0x4f3fa6,0x13,_0x233964['cause-txt']||_0x233964[_0x94a6('0xf0')]);ami[_0x94a6('0x26')](_0x94a6('0xed'),ut[_0x94a6('0xa9')](_0x4f3fa6,_0x94a6('0xee')));rpcDb[_0x94a6('0x98')](_0x4f3fa6,'[callProgressDetectingCustomer][machine]');if(ut['totalGlobal'](_0x4f3fa6)>=_0x458336['dialGlobalMaxRetry']){_0x4e2f31=ut[_0x94a6('0xad')](_0x4f3fa6,0xf,'Global');rpcDb[_0x94a6('0x9c')](_0x4e2f31,'[callProgressDetectingCustomer][machine]');}else{rpcDb['createCustomerFinal'](_0x4f3fa6,'[callProgressDetectingCustomer][machine]');}delete this[_0x94a6('0x16')][_0x233964[_0x94a6('0xb6')]];break;default:if(_0x4f3fa6[_0x94a6('0x76')]){ut[_0x94a6('0x82')](_0x458336,_0x94a6('0xf1'));ut[_0x94a6('0x83')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x458336[_0x94a6('0x28')],_0x233964);}_0x458336[_0x94a6('0x3f')]+=0x1;_0x4f3fa6[_0x94a6('0xca')]=ut[_0x94a6('0xa6')](_0x4f3fa6);ut[_0x94a6('0x93')](_0x4f3fa6,0xc,_0x233964['cause-txt']||_0x233964[_0x94a6('0xf0')]);rpcDb['createCustomerHistory'](_0x4f3fa6,_0x94a6('0xf2'));if(ut[_0x94a6('0xa6')](_0x4f3fa6)>=_0x458336[_0x94a6('0xac')]){_0x4e2f31=ut['cloneAction'](_0x4f3fa6,0xf,_0x94a6('0xae'));rpcDb[_0x94a6('0x9c')](_0x4e2f31,_0x94a6('0xf3'));}else{rpcDb[_0x94a6('0x9c')](_0x4f3fa6,_0x94a6('0xf3'));}delete this['actions'][_0x233964[_0x94a6('0xb6')]];}if(!(_0x4f3fa6['dialAnswer']&&_0x117f75==='16')){ut[_0x94a6('0xf4')](_0x458336,'[callProgressDetectingCustomer]');logger[_0x94a6('0x58')](_0x94a6('0xf5'),_0x4f3fa6[_0x94a6('0xbb')],_0x94a6('0xc7'),_0x458336[_0x94a6('0x28')],'originated:\x20',_0x458336[_0x94a6('0x5d')]);}if(_0x117f75!=='ANSWER'){delete this[_0x94a6('0x16')][_0x233964[_0x94a6('0xb6')]];delete this['actions'][_0x233964['destlinkedid']];}}};Preview[_0x94a6('0x6f')]['callProgressDetectingAgent']=function(_0x1ff4d2,_0x48870b,_0x274a4f){if(_[_0x94a6('0xf6')](_0x48870b)&&_0x94a6('0xf7')!==typeof _0x48870b){return;}if(_[_0x94a6('0xf6')](_0x274a4f)&&'object'!==typeof _0x274a4f){return;}switch(_0x274a4f['reason']){case'0':ut[_0x94a6('0xf8')](_0x1ff4d2,0x0,_0x94a6('0xa7'));rpcDb[_0x94a6('0xf9')](_0x1ff4d2,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x1ff4d2,0x3,'NoAnswer');rpcDb[_0x94a6('0xf9')](_0x1ff4d2,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x94a6('0xf8')](_0x1ff4d2,0x5,_0x94a6('0xcb'));rpcDb[_0x94a6('0xf9')](_0x1ff4d2,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x1ff4d2,0x8,_0x94a6('0xfa'));rpcDb['createAgentHistory'](_0x1ff4d2,_0x94a6('0xfb'));break;case'22':ut['logAgent'](_0x1ff4d2,0x16,_0x94a6('0xfc'));rpcDb[_0x94a6('0xf9')](_0x1ff4d2,_0x94a6('0xfd'));break;default:ut[_0x94a6('0xf8')](_0x1ff4d2,0xc,_0x274a4f[_0x94a6('0xfe')]);rpcDb[_0x94a6('0xf9')](_0x1ff4d2,_0x94a6('0xfb'));}ut[_0x94a6('0xf4')](_0x48870b,_0x94a6('0xff'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x1ff4d2[_0x94a6('0xbb')],'\x20Queue',_0x48870b['name'],_0x94a6('0x74'),_0x48870b['originated']);delete this[_0x94a6('0x16')][_0x1ff4d2[_0x94a6('0xbb')]];};Preview['prototype']['checkInBlack']=function(_0x41bd46,_0x1b5d7c,_0x5af229,_0x40f33f,_0x342fb){var _0x167970=this;return new BPromise(function(_0x3ee4fb,_0xc50fd3){if(_['isNil'](_0x1b5d7c)||_['isNil'](_0x1b5d7c[_0x94a6('0x100')])||_['isNil'](_0x1b5d7c[_0x94a6('0x100')][_0x94a6('0x101')])||_[_0x94a6('0x71')](_0x1b5d7c['VoiceQueueId'])){_0xc50fd3(ut['message'](_0x94a6('0x102'),_0x40f33f,_0x342fb));return;}var _0x462666=uuid['v4']();var _0x1567fa=_0x167970[_0x94a6('0x13')][_0x1b5d7c[_0x94a6('0x103')][_0x94a6('0x28')]];var _0x36460b=_0x5af229?_0x167970['agents'][_0x5af229]['id']:undefined;_0x167970[_0x94a6('0x16')][_0x462666]=new Action(_0x1b5d7c,_0x1567fa,_0x462666,_0x5af229,_0x36460b);var _0x324e01=_0x167970[_0x94a6('0x16')][_0x462666];_0x324e01[_0x94a6('0xb4')]=_0x40f33f;_0x324e01[_0x94a6('0xb5')]=_0x342fb;_0x324e01['lookAgent']=_0x5af229;if(_[_0x94a6('0x104')](_0x41bd46)){_0x167970[_0x94a6('0x105')](_0x324e01,_0x1567fa,_0x1b5d7c,_0x5af229)[_0x94a6('0x8a')](function(_0x45e3b6){logger['info'](_0x94a6('0x106'),'Queue:\x20'+_0x324e01[_0x94a6('0x73')]+'\x20IdHopper:\x20'+_0x324e01[_0x94a6('0x107')],JSON[_0x94a6('0x53')](_0x45e3b6));ami[_0x94a6('0x26')](_0x94a6('0x108'),ut[_0x94a6('0xa9')](_0x324e01,_0x94a6('0x109'),_0x167970[_0x94a6('0x13')][_0x324e01[_0x94a6('0x73')]]));_0x3ee4fb(ut[_0x94a6('0x4a')]('Calling'));})[_0x94a6('0x7f')](function(_0x2d6d4e){ut[_0x94a6('0x61')](_0x94a6('0x10a'),_0x2d6d4e);_0xc50fd3(ut[_0x94a6('0x4a')](_0x94a6('0x10b'),_0x40f33f,_0x342fb));});}else{_0x1567fa[_0x94a6('0x36')]+=0x1;ut[_0x94a6('0x10c')](_0x324e01);rpcDb['createHistory'](_0x324e01,_0x94a6('0x10d'));delete _0x167970['actions'][_0x462666];_0xc50fd3(ut[_0x94a6('0x4a')](_0x94a6('0x10e'),_0x40f33f,_0x342fb));}});};Preview[_0x94a6('0x6f')][_0x94a6('0xa0')]=function(_0x556ce3){return!_[_0x94a6('0x71')](_0x556ce3)&&!_[_0x94a6('0x71')](_0x556ce3[_0x94a6('0x28')])&&!_['isNil'](_0x556ce3[_0x94a6('0x51')])&&_0x556ce3[_0x94a6('0x51')]&&!_[_0x94a6('0x71')](this[_0x94a6('0x15')][util[_0x94a6('0x55')]('SIP/%s',_0x556ce3[_0x94a6('0x28')])])&&!_[_0x94a6('0x71')](this['trunks'][util[_0x94a6('0x55')](_0x94a6('0x10f'),_0x556ce3['name'])]['status'])&&(this[_0x94a6('0x15')][util[_0x94a6('0x55')]('SIP/%s',_0x556ce3[_0x94a6('0x28')])][_0x94a6('0x7d')]===_0x94a6('0x110')||this['trunks'][util[_0x94a6('0x55')]('SIP/%s',_0x556ce3['name'])]['status']===_0x94a6('0x111'));};Preview['prototype'][_0x94a6('0x8e')]=function(_0x584d70,_0x8be464){var _0x3132a5=this;return new BPromise(function(_0x2fd0d5,_0x410629){_0x3132a5[_0x94a6('0x112')](_0x584d70,_0x8be464)[_0x94a6('0x8a')](function(_0x345c08){_0x2fd0d5(_['pick'](_0x345c08,['message']));})['catch'](function(_0x3e80d8){if(_0x3e80d8[_0x94a6('0x113')]){rpcDb[_0x94a6('0x114')](_0x584d70);}if(_0x3e80d8[_0x94a6('0x51')]){rpcDb['disableContact'](_0x584d70);}_0x410629(_[_0x94a6('0x77')](_0x3e80d8,[_0x94a6('0x4a')]));});});};Preview['prototype']['execRun']=function(_0x384d3b,_0x4e8cef){var _0x510731=this;return new BPromise(function(_0x1135a4,_0x5c095e){var _0x314a92,_0x9d50a7;rpcDb['getContactPreview'](_0x384d3b)['then'](function(_0x2a1636){if(!_[_0x94a6('0x71')](_0x2a1636[0x0])){_0x9d50a7=_0x2a1636[0x0]['recallme']?![]:!![];_0x314a92=_0x2a1636[0x0][_0x94a6('0x115')]?!![]:![];_0x314a92=_0x4e8cef?!![]:_0x314a92;}var _0x3fac81=_0x510731[_0x94a6('0x116')](_0x2a1636);if(_0x3fac81[_0x94a6('0x117')]){rpcDb[_0x94a6('0x118')](_[_0x94a6('0x77')](_0x2a1636[0x0],[_0x94a6('0x7a'),_0x94a6('0x119')]))[_0x94a6('0x8a')](function(_0x27429d){_0x510731[_0x94a6('0x11a')](_0x27429d,_0x2a1636[0x0],_0x4e8cef,_0x9d50a7,_0x314a92)[_0x94a6('0x8a')](function(_0x489d5a){_0x1135a4(_0x489d5a);})[_0x94a6('0x7f')](function(_0x1b3204){_0x5c095e(_0x1b3204);});})['catch'](function(_0x5e6c5c){ut[_0x94a6('0x61')](_0x94a6('0x11b'),_0x5e6c5c);_0x5c095e(ut[_0x94a6('0x4a')]('Call\x20unsuccessful',_0x9d50a7,_0x314a92));});}else{_0x5c095e(ut[_0x94a6('0x4a')](_0x3fac81[_0x94a6('0x4a')],_0x9d50a7,_0x314a92));}})['catch'](function(_0xda5bab){ut[_0x94a6('0x61')](_0x94a6('0x11c'),_0xda5bab);_0x5c095e(ut[_0x94a6('0x4a')](_0x94a6('0x11d'),![],!![]));});});};Preview[_0x94a6('0x6f')][_0x94a6('0x116')]=function(_0x67b22c){if(_['isNil'](_0x67b22c)||_['isEmpty'](_0x67b22c)||!_['isNil'](_0x67b22c[0x0][_0x94a6('0x8d')])&&_[_0x94a6('0x71')](_0x67b22c[0x0][_0x94a6('0x8d')][_0x94a6('0x28')])){ut[_0x94a6('0x61')](_0x94a6('0x11e'),_0x67b22c);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x2c1c7c=this[_0x94a6('0x13')][_0x67b22c[0x0][_0x94a6('0x103')][_0x94a6('0x28')]];_0x2c1c7c[_0x94a6('0x4a')]=_0x94a6('0xa2');if(_[_0x94a6('0x71')](_0x2c1c7c)){ut['logger'](_0x94a6('0x11f'),_0x2c1c7c);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x94a6('0xa0')](_0x2c1c7c[_0x94a6('0x50')])){ut[_0x94a6('0x61')](_0x94a6('0x120'),_0x94a6('0x121')+_0x2c1c7c[_0x94a6('0x28')]+_0x94a6('0x122'));if(!this[_0x94a6('0xa0')](_0x2c1c7c[_0x94a6('0x123')])){ut[_0x94a6('0x61')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x2c1c7c[_0x94a6('0x28')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x94a6('0x124')};}}if(!ut['isActive'](_0x2c1c7c['dialActive'])){ut[_0x94a6('0x61')](_0x94a6('0x125'),_0x2c1c7c[_0x94a6('0x28')]+_0x94a6('0x126'));return{'isValid':![],'message':_0x94a6('0x121')+_0x2c1c7c['name']+_0x94a6('0x126')};}return{'isValid':!![],'message':_0x94a6('0x127')};};Preview[_0x94a6('0x6f')][_0x94a6('0x105')]=function(_0x15c2ea,_0x34ea57,_0x58bea4,_0x3b84f0){var _0x4defe3=this;return new BPromise(function(_0x2cb0a5,_0x566f6b){var _0x7840cb=_0x15c2ea[_0x94a6('0xbb')];var _0x189cd1=_0x4defe3['isTrunkReachable'](_0x34ea57[_0x94a6('0x50')])?util['format'](_0x94a6('0x128'),_0x34ea57['Trunk'][_0x94a6('0x28')],_[_0x94a6('0x71')](_0x34ea57[_0x94a6('0x129')])?'':_0x34ea57[_0x94a6('0x129')][_0x94a6('0x12a')]()||'',_0x34ea57[_0x94a6('0x12b')]>0x0?_0x58bea4[_0x94a6('0x100')][_0x94a6('0x101')][_0x94a6('0x12c')](_0x34ea57[_0x94a6('0x12b')]):_0x58bea4[_0x94a6('0x100')][_0x94a6('0x101')]):util[_0x94a6('0x55')](_0x94a6('0x128'),_[_0x94a6('0x71')](_0x34ea57['TrunkBackup'])?_0x34ea57['Trunk'][_0x94a6('0x28')]:_0x34ea57[_0x94a6('0x123')][_0x94a6('0x28')],_[_0x94a6('0x71')](_0x34ea57[_0x94a6('0x129')])?'':_0x34ea57[_0x94a6('0x129')]['trim']()||'',_0x34ea57[_0x94a6('0x12b')]>0x0?_0x58bea4[_0x94a6('0x100')][_0x94a6('0x101')][_0x94a6('0x12c')](_0x34ea57[_0x94a6('0x12b')]):_0x58bea4['Contact']['phone']);var _0x4d39d4=_0x4defe3[_0x94a6('0xa0')](_0x34ea57[_0x94a6('0x50')])?ut[_0x94a6('0x12d')](_0x34ea57['Trunk']['callerid'],_0x34ea57[_0x94a6('0x12e')],_0x34ea57[_0x94a6('0x12f')]>0x0?ut[_0x94a6('0x130')](_0x34ea57[_0x94a6('0x33')],_0x34ea57['dialRandomLastDigitCallerIdNumber']):_0x34ea57[_0x94a6('0x33')]):ut[_0x94a6('0x12d')](_['isNil'](_0x34ea57['TrunkBackup'])?_0x34ea57[_0x94a6('0x50')][_0x94a6('0x131')]:_0x34ea57[_0x94a6('0x123')]['callerid'],_0x34ea57['dialOriginateCallerIdName'],_0x34ea57[_0x94a6('0x12f')]>0x0?ut[_0x94a6('0x130')](_0x34ea57['dialOriginateCallerIdNumber'],_0x34ea57[_0x94a6('0x12f')]):_0x34ea57['dialOriginateCallerIdNumber']);if(_0x4d39d4){_0x15c2ea[_0x94a6('0x132')]=ut[_0x94a6('0x133')](_0x4d39d4);_0x15c2ea[_0x94a6('0x134')]=ut[_0x94a6('0x135')](_0x4d39d4);}var _0x3c539f=ut[_0x94a6('0x136')](_0x34ea57,_0x58bea4,_0x189cd1,_0x4d39d4,_0x7840cb,_0x15c2ea);_['merge'](_0x15c2ea,ut[_0x94a6('0x137')](_0x3c539f));_0x15c2ea[_0x94a6('0x92')]=moment()[_0x94a6('0x55')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x94a6('0x7c')](ut[_0x94a6('0x138')](_0x15c2ea,_0x34ea57,_0x3c539f,_0x15c2ea[_0x94a6('0xb5')],_0x3b84f0))[_0x94a6('0x8a')](function(_0xe38ff1){var _0x5131e5=_0x15c2ea['channelAgent'];if(!_['isNil'](_0x5131e5)){if(!_[_0x94a6('0x71')](_0x4defe3[_0x94a6('0x17')][_0x5131e5])){_0x4defe3['agents'][_0x5131e5][_0x94a6('0x139')]=_0x15c2ea['calleridnum'];emit(util[_0x94a6('0x55')](_0x94a6('0x13a'),_0x4defe3[_0x94a6('0x17')][_0x5131e5][_0x94a6('0x28')]),'user:agentconnect',{'destaccountcode':_0x4defe3[_0x94a6('0x17')][_0x5131e5]['accountcode'],'destconnectedlinenum':_0x15c2ea[_0x94a6('0x13b')]});}}_0x34ea57[_0x94a6('0x5d')]+=0x1;logger[_0x94a6('0x58')]('[originated][increment]',_0x7840cb,_0x94a6('0xc7'),_0x34ea57[_0x94a6('0x28')],_0x94a6('0x74'),_0x34ea57[_0x94a6('0x5d')]);_0x2cb0a5(_0xe38ff1);})[_0x94a6('0x7f')](function(_0x3555cb){ut[_0x94a6('0xf8')](_0x15c2ea,0xe,'OriginateError');rpcDb[_0x94a6('0xf9')](_0x15c2ea,'[originateFailure][logOriginateFailure]');_0x566f6b(_0x3555cb);});});};Preview[_0x94a6('0x6f')]['syncNewExten']=function(_0x550ab4){if(this['actions'][_0x550ab4[_0x94a6('0xb6')]]){this[_0x94a6('0x16')][_0x550ab4[_0x94a6('0xb6')]]['channel']=_0x550ab4['channel'];}};Preview[_0x94a6('0x6f')]['syncOriginateResponse']=function(_0xc6e216){var _0x1734f4=this;var _0x25223c=this[_0x94a6('0x16')][_0xc6e216[_0x94a6('0x13c')]];if(_0x25223c){if(_0x25223c[_0x94a6('0x13d')]&&this['agents'][_0x25223c[_0x94a6('0x13d')]]){ut[_0x94a6('0x13e')](_0x25223c,this[_0x94a6('0x17')][_0x25223c[_0x94a6('0x13d')]][_0x94a6('0x28')],this['agents'][_0x25223c[_0x94a6('0x13d')]]['id']);}var _0x40227f=_[_0x94a6('0x13f')](_0x25223c);_0x40227f[_0x94a6('0xb9')]=moment()['format'](_0x94a6('0xb8'));var _0x5e0cad=_0x1734f4[_0x94a6('0x13')][_0x25223c['queue']];if(ut['isFailure'](_0xc6e216[_0x94a6('0x140')])){if(_0x25223c[_0x94a6('0xb4')]){rpcDb[_0x94a6('0x114')](_0x25223c['idContact']);}if(_0x25223c[_0x94a6('0xb5')]){rpcDb[_0x94a6('0x91')](_0x25223c[_0x94a6('0x107')]);}ami[_0x94a6('0x26')]('custom:agentringnoanswer',ut[_0x94a6('0xa9')](_0x25223c,_0x94a6('0x141'),this[_0x94a6('0x13')][_0x25223c[_0x94a6('0x73')]]));this[_0x94a6('0x142')](_0x40227f,_0x5e0cad,_0xc6e216);}else{_0x25223c[_0x94a6('0x92')]=moment()[_0x94a6('0x55')]('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x40227f,0x4,_0x94a6('0x143'));rpcDb[_0x94a6('0xf9')](_0x40227f,_0x94a6('0x144'));}}};Preview[_0x94a6('0x6f')]['syncHangup']=function(_0x399e42){var _0x1743db=this;var _0x19175a=this[_0x94a6('0x16')][_0x399e42[_0x94a6('0xb6')]];var _0x37dc82;if(_0x19175a){_0x37dc82=this[_0x94a6('0x13')][_0x19175a['queue']];logger[_0x94a6('0x58')](_0x94a6('0x145'),_0x399e42[_0x94a6('0xb6')],_0x94a6('0xc7'),_0x37dc82[_0x94a6('0x28')],_0x94a6('0x75'),_0x37dc82[_0x94a6('0x5e')]);}if(this['actions'][_0x399e42[_0x94a6('0xb6')]]&&_0x399e42[_0x94a6('0xb6')]!==_0x399e42[_0x94a6('0xbb')]){if(_0x399e42[_0x94a6('0x146')]==='16'&&this[_0x94a6('0x16')][_0x399e42[_0x94a6('0xb6')]]['dialAnswer']){this[_0x94a6('0xa3')](_0x399e42,_0x399e42[_0x94a6('0xb6')],_0x399e42['cause']);}else if(this['actions'][_0x399e42[_0x94a6('0xb6')]][_0x94a6('0x76')]){logger[_0x94a6('0x58')](_0x94a6('0x147'),_0x399e42[_0x94a6('0xb6')],_0x399e42['cause'],_0x94a6('0xc7'),_0x37dc82['name'],_0x94a6('0x75'),_0x37dc82['pTalking']);this[_0x94a6('0xa3')](_0x399e42,_0x399e42[_0x94a6('0xb6')],_0x399e42[_0x94a6('0x146')]);}}else if(_0x19175a&&_[_0x94a6('0x71')](_0x19175a['statedesc'])&&_0x37dc82[_0x94a6('0x148')]&&_0x399e42[_0x94a6('0xb6')]===_0x399e42['uniqueid']&&_[_0x94a6('0x71')](_0x399e42[_0x94a6('0xfe')])&&_0x399e42[_0x94a6('0x146')]==='16'&&_0x399e42[_0x94a6('0x149')]==='6'&&_[_0x94a6('0xf6')](_0x19175a['transfer'])){if(_0x19175a['unlockAgent']){rpcDb[_0x94a6('0x114')](_0x19175a['idContact']);}if(_0x19175a[_0x94a6('0xb5')]){rpcDb[_0x94a6('0x91')](_0x19175a[_0x94a6('0x107')]);}_0x399e42[_0x94a6('0xfe')]='22';this[_0x94a6('0x142')](_0x19175a,_0x37dc82,_0x399e42);}else if(_0x19175a&&_0x19175a['transfer']){if(_0x399e42[_0x94a6('0x146')]==='16'&&this[_0x94a6('0x16')][_0x399e42['linkedid']]['dialAnswer']){logger[_0x94a6('0x58')](_0x94a6('0x14a'),_0x399e42[_0x94a6('0xb6')],_0x399e42[_0x94a6('0x146')],'\x20Queue',_0x37dc82['name'],'pTalking:\x20',_0x37dc82[_0x94a6('0x5e')]);this['callProgressDetectingCustomer'](_0x399e42,_0x399e42[_0x94a6('0xb6')],_0x399e42['cause']);}else if(this[_0x94a6('0x16')][_0x399e42[_0x94a6('0xb6')]]['dialAnswer']){logger[_0x94a6('0x58')](_0x94a6('0x147'),_0x399e42['linkedid'],_0x399e42['cause'],_0x94a6('0xc7'),_0x37dc82[_0x94a6('0x28')],_0x94a6('0x75'),_0x37dc82[_0x94a6('0x5e')]);this[_0x94a6('0xa3')](_0x399e42,_0x399e42[_0x94a6('0xb6')],_0x399e42[_0x94a6('0x146')]);}}};Preview['prototype'][_0x94a6('0x1f')]=function(_0xf0962d){if(this[_0x94a6('0x16')][_0xf0962d[_0x94a6('0x14b')]]&&_0xf0962d[_0x94a6('0x14b')]!==_0xf0962d[_0x94a6('0x14c')]){this[_0x94a6('0xa3')](_0xf0962d,_0xf0962d[_0x94a6('0x14b')],_0xf0962d[_0x94a6('0xf0')]);}};Preview[_0x94a6('0x6f')][_0x94a6('0x1d')]=function(_0x49a32b){if(this[_0x94a6('0x16')][_0x49a32b['linkedid']]&&_0x49a32b[_0x94a6('0xb6')]!==_0x49a32b[_0x94a6('0xbb')]&&!this[_0x94a6('0x16')][_0x49a32b[_0x94a6('0xb6')]][_0x94a6('0x76')]){if(_0x49a32b['cause']==='1'){this[_0x94a6('0xa3')](_0x49a32b,_0x49a32b[_0x94a6('0xb6')],_0x49a32b[_0x94a6('0x146')]);}}};Preview[_0x94a6('0x6f')][_0x94a6('0x14d')]=function(_0xd1e22d,_0x58f3c2,_0x4ca8e2){if(this['actions'][_0xd1e22d]){if(_[_0x94a6('0x71')](this['actions'][_0xd1e22d][_0x94a6('0x14e')])){this[_0x94a6('0x16')][_0xd1e22d]['variables']={};}this[_0x94a6('0x16')][_0xd1e22d]['variables'][_0x58f3c2]=_0x4ca8e2;}};Preview[_0x94a6('0x6f')][_0x94a6('0x14f')]=function(_0x3499d9){try{if(!_['isNil'](_0x3499d9)){if(ut[_0x94a6('0x150')](_[_0x94a6('0x151')](_0x3499d9[_0x94a6('0x152')])[0x0])){this[_0x94a6('0x14d')](_0x3499d9['uniqueid'],_[_0x94a6('0x151')](_0x3499d9['variable'])[0x0],_0x3499d9[_0x94a6('0x153')]);}}}catch(_0x159443){logger['error']('[syncVarSet][Preview]',util[_0x94a6('0x154')](_0x159443,{'showHidden':![],'depth':null}));}};Preview[_0x94a6('0x6f')][_0x94a6('0x23')]=function(_0x43debc){if(_0x43debc){if(this[_0x94a6('0x16')][_0x43debc[_0x94a6('0x155')]]){this[_0x94a6('0x16')][_0x43debc['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0x94a6('0x6f')][_0x94a6('0x25')]=function(_0xeaaf3c){if(_0xeaaf3c){if(this[_0x94a6('0x16')][_0xeaaf3c['transfererlinkedid']]){this[_0x94a6('0x16')][_0xeaaf3c['transfererlinkedid']][_0x94a6('0x156')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index dcab185..14f92d3 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 _0x9961=['membername','context','from-sip','exten','assigned','lastAssignedTo','queuecallerexitreason','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContact','[rescheduleContactInQueue]\x20','util','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','inspect','resolve','createHistory','[createHistory]\x20','then','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallercomplete','endtime','connectedlinename'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9961,0x14a));var _0x1996=function(_0x24d515,_0x238fc1){_0x24d515=_0x24d515-0x0;var _0x3dcccc=_0x9961[_0x24d515];return _0x3dcccc;};'use strict';var util=require(_0x1996('0x0'));var BPromise=require(_0x1996('0x1'));var logger=require('../../../config/logger')(_0x1996('0x2'));var _=require(_0x1996('0x3'));var cmHopper=require(_0x1996('0x4'));var cmHopperFinal=require(_0x1996('0x5'));var cmHopperHistory=require(_0x1996('0x6'));var cmHopperBlack=require(_0x1996('0x7'));var voiceQueueRt=require(_0x1996('0x8'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x1996('0x9'));function loggerCatch(_0x459e8f){return function(_0x3f2a6d){logger['error'](_0x459e8f,util[_0x1996('0xa')](_0x3f2a6d,{'showHidden':![],'depth':null}));};}function create(_0x167010){return BPromise[_0x1996('0xb')]()['then'](cmHopperHistory[_0x1996('0xc')](_0x167010))['catch'](loggerCatch(_0x1996('0xd')));}function createAgent(_0x1fb052){return BPromise['resolve']()[_0x1996('0xe')](agentReportPreview[_0x1996('0xc')](_0x1fb052))[_0x1996('0xf')](loggerCatch(_0x1996('0xd')));}function moveContact(_0x381831){return BPromise['resolve']()['then'](cmHopper[_0x1996('0x10')](_0x381831,!![]))[_0x1996('0xf')](loggerCatch(_0x1996('0x11')));}exports['checkIsBlackList']=function(_0x50fbd6){return BPromise[_0x1996('0xb')]()[_0x1996('0xe')](cmHopperBlack[_0x1996('0x12')](_0x50fbd6))[_0x1996('0xf')](loggerCatch(_0x1996('0x13')));};exports[_0x1996('0x14')]=function(_0x3a02ea){return BPromise['resolve']()[_0x1996('0xe')](cmHopper[_0x1996('0x14')](_0x3a02ea))[_0x1996('0xf')](loggerCatch(_0x1996('0x15')));};exports[_0x1996('0xc')]=function(_0x349c55,_0x223cd9){create(_0x349c55)[_0x1996('0xf')](loggerCatch(_0x223cd9));moveContact(_0x349c55)[_0x1996('0xf')](loggerCatch(_0x223cd9));};exports[_0x1996('0x16')]=function(_0x57c3db,_0x135a0b){createAgent(_0x57c3db)[_0x1996('0xf')](loggerCatch(_0x135a0b));};exports['createCustomerHistory']=function(_0x48a226,_0x4a9e7e){create(_0x48a226)[_0x1996('0xf')](loggerCatch(_0x4a9e7e));};exports[_0x1996('0x17')]=function(_0x32c2b7,_0x2b4d1a){moveContact(_0x32c2b7)[_0x1996('0xf')](loggerCatch(_0x2b4d1a));};exports['rescheduleContact']=function(_0x3a92bf,_0x233dd8,_0x391a99){if(_0x233dd8){_0x3a92bf[_0x1996('0x18')]=null;}if(_0x391a99){_0x3a92bf['active']=![];}return BPromise['resolve']()[_0x1996('0xe')](cmHopper['rescheduleContact'](_0x3a92bf))[_0x1996('0xf')](loggerCatch(_0x1996('0x19')));};exports[_0x1996('0x1a')]=function(_0x955b99){return BPromise[_0x1996('0xb')]()[_0x1996('0xe')](cmHopper[_0x1996('0x1a')](_0x955b99))[_0x1996('0xf')](loggerCatch(_0x1996('0x1b')));};exports[_0x1996('0x1c')]=function(_0x2f04c8){return BPromise[_0x1996('0xb')]()[_0x1996('0xe')](cmHopper['unlockContact']({'UserId':null},_0x2f04c8,0x1))['catch'](loggerCatch(_0x1996('0x1d')));};exports['disableContact']=function(_0x3dd0c9){return BPromise[_0x1996('0xb')]()[_0x1996('0xe')](cmHopper[_0x1996('0x1c')]({'active':![]},_0x3dd0c9,0x1))[_0x1996('0xf')](loggerCatch(_0x1996('0x1e')));};exports[_0x1996('0x1f')]=function(_0x1c17b7){var _0x26f31d={};_0x26f31d[_0x1996('0x20')]=_0x1c17b7[_0x1996('0x20')];_0x26f31d[_0x1996('0x21')]=_0x1c17b7[_0x1996('0x21')];_0x26f31d[_0x1996('0x22')]=_0x1c17b7[_0x1996('0x22')];_0x26f31d[_0x1996('0x23')]=_0x1c17b7[_0x1996('0x23')];_0x26f31d['queue']=_0x1c17b7[_0x1996('0x24')];_0x26f31d['queuecallerjoinAt']=_0x1c17b7['answertime'];_0x26f31d['queuecallerleaveAt']=_0x1c17b7[_0x1996('0x25')];_0x26f31d[_0x1996('0x26')]=0x1;_0x26f31d['queuecallercompleteAt']=_0x1c17b7[_0x1996('0x27')];_0x26f31d[_0x1996('0x28')]=_0x1c17b7[_0x1996('0x29')];_0x26f31d[_0x1996('0x2a')]=_0x1996('0x2b');_0x26f31d[_0x1996('0x2c')]='xcally-motion-preview';_0x26f31d['holdtime']=0x0;_0x26f31d[_0x1996('0x2d')]=0x1;_0x26f31d[_0x1996('0x2e')]=_0x1c17b7[_0x1996('0x29')];_0x26f31d[_0x1996('0x2f')]='COMPLETED';return BPromise[_0x1996('0xb')]()['then'](voiceQueueReport['create'](_0x26f31d))[_0x1996('0xf')](loggerCatch(_0x1996('0x30')));};exports[_0x1996('0x31')]=function(_0x312698,_0x451d80){return BPromise[_0x1996('0xb')]()[_0x1996('0xe')](cmHopper['getContactRecallMe'](_0x312698,_0x451d80))['catch'](loggerCatch(_0x1996('0x32')));};exports['rescheduleContactInQueue']=function(_0x1941d4){return BPromise[_0x1996('0xb')]()[_0x1996('0xe')](cmHopper[_0x1996('0x33')](_0x1941d4,!![],!![]))[_0x1996('0xf')](loggerCatch(_0x1996('0x34')));}; \ No newline at end of file +var _0x2546=['unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','inspect','resolve','[createHistory]\x20','then','createHistory','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20'];(function(_0xba9bdd,_0x1e9d47){var _0x1b105c=function(_0x2d3d99){while(--_0x2d3d99){_0xba9bdd['push'](_0xba9bdd['shift']());}};_0x1b105c(++_0x1e9d47);}(_0x2546,0x1e6));var _0x6254=function(_0x528bd3,_0x2849b8){_0x528bd3=_0x528bd3-0x0;var _0x476a88=_0x2546[_0x528bd3];return _0x476a88;};'use strict';var util=require(_0x6254('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x6254('0x1'));var _=require('lodash');var cmHopper=require(_0x6254('0x2'));var cmHopperFinal=require(_0x6254('0x3'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x6254('0x4'));var voiceQueueRt=require(_0x6254('0x5'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x42bc0a){return function(_0x3f5843){logger['error'](_0x42bc0a,util[_0x6254('0x6')](_0x3f5843,{'showHidden':![],'depth':null}));};}function create(_0x4e535b){return BPromise[_0x6254('0x7')]()['then'](cmHopperHistory['createHistory'](_0x4e535b))['catch'](loggerCatch(_0x6254('0x8')));}function createAgent(_0x5f1d66){return BPromise[_0x6254('0x7')]()[_0x6254('0x9')](agentReportPreview[_0x6254('0xa')](_0x5f1d66))[_0x6254('0xb')](loggerCatch(_0x6254('0x8')));}function moveContact(_0x3bf026){return BPromise[_0x6254('0x7')]()['then'](cmHopper['moveContactManagedDialer'](_0x3bf026,!![]))[_0x6254('0xb')](loggerCatch(_0x6254('0xc')));}exports[_0x6254('0xd')]=function(_0x298829){return BPromise['resolve']()[_0x6254('0x9')](cmHopperBlack[_0x6254('0xd')](_0x298829))[_0x6254('0xb')](loggerCatch(_0x6254('0xe')));};exports[_0x6254('0xf')]=function(_0x530d8c){return BPromise['resolve']()[_0x6254('0x9')](cmHopper['getContactPreview'](_0x530d8c))['catch'](loggerCatch(_0x6254('0x10')));};exports['createHistory']=function(_0x1be9db,_0x10c45c){create(_0x1be9db)[_0x6254('0xb')](loggerCatch(_0x10c45c));moveContact(_0x1be9db)['catch'](loggerCatch(_0x10c45c));};exports[_0x6254('0x11')]=function(_0x151af8,_0xfbd619){createAgent(_0x151af8)[_0x6254('0xb')](loggerCatch(_0xfbd619));};exports['createCustomerHistory']=function(_0x2a7d1d,_0x3a5d36){create(_0x2a7d1d)[_0x6254('0xb')](loggerCatch(_0x3a5d36));};exports['createCustomerFinal']=function(_0x19b280,_0x2d7c7d){moveContact(_0x19b280)['catch'](loggerCatch(_0x2d7c7d));};exports[_0x6254('0x12')]=function(_0x2644a9,_0x20af9a,_0x491a41){if(_0x20af9a){_0x2644a9[_0x6254('0x13')]=null;}if(_0x491a41){_0x2644a9[_0x6254('0x14')]=![];}return BPromise[_0x6254('0x7')]()[_0x6254('0x9')](cmHopper['rescheduleContact'](_0x2644a9))[_0x6254('0xb')](loggerCatch(_0x6254('0x15')));};exports[_0x6254('0x16')]=function(_0x1a3656){return BPromise[_0x6254('0x7')]()[_0x6254('0x9')](cmHopper[_0x6254('0x16')](_0x1a3656))['catch'](loggerCatch(_0x6254('0x17')));};exports[_0x6254('0x18')]=function(_0x4cfd57){return BPromise[_0x6254('0x7')]()[_0x6254('0x9')](cmHopper[_0x6254('0x18')]({'UserId':null},_0x4cfd57,0x1))[_0x6254('0xb')](loggerCatch(_0x6254('0x19')));};exports[_0x6254('0x1a')]=function(_0x475ef0){return BPromise[_0x6254('0x7')]()['then'](cmHopper[_0x6254('0x18')]({'active':![]},_0x475ef0,0x1))['catch'](loggerCatch(_0x6254('0x1b')));};exports[_0x6254('0x1c')]=function(_0x12a119){var _0x354db8={};_0x354db8[_0x6254('0x1d')]=_0x12a119[_0x6254('0x1d')];_0x354db8[_0x6254('0x1e')]=_0x12a119[_0x6254('0x1e')];_0x354db8[_0x6254('0x1f')]=_0x12a119['calleridnum'];_0x354db8['calleridname']=_0x12a119['calleridname'];_0x354db8[_0x6254('0x20')]=_0x12a119[_0x6254('0x20')];_0x354db8[_0x6254('0x21')]=_0x12a119[_0x6254('0x22')];_0x354db8[_0x6254('0x23')]=_0x12a119[_0x6254('0x22')];_0x354db8[_0x6254('0x24')]=0x1;_0x354db8[_0x6254('0x25')]=_0x12a119['endtime'];_0x354db8[_0x6254('0x26')]=_0x12a119[_0x6254('0x27')];_0x354db8[_0x6254('0x28')]='from-sip';_0x354db8[_0x6254('0x29')]=_0x6254('0x2a');_0x354db8[_0x6254('0x2b')]=0x0;_0x354db8[_0x6254('0x2c')]=0x1;_0x354db8['lastAssignedTo']=_0x12a119[_0x6254('0x27')];_0x354db8['queuecallerexitreason']=_0x6254('0x2d');return BPromise['resolve']()[_0x6254('0x9')](voiceQueueReport['create'](_0x354db8))[_0x6254('0xb')](loggerCatch(_0x6254('0x2e')));};exports['getContactRecallMe']=function(_0x2f862a,_0x3cb67c){return BPromise['resolve']()['then'](cmHopper[_0x6254('0x2f')](_0x2f862a,_0x3cb67c))[_0x6254('0xb')](loggerCatch(_0x6254('0x30')));};exports[_0x6254('0x31')]=function(_0x4f5e4e){return BPromise[_0x6254('0x7')]()[_0x6254('0x9')](cmHopper['rescheduleContact'](_0x4f5e4e,!![],!![]))[_0x6254('0xb')](loggerCatch(_0x6254('0x32')));}; \ 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 fb2adce..0f9bf19 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 _0x7b3b=['add','minutes','ContactId','ListId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','interface','mandatoryDisposition','buildAcw','not_inuse','status','reachable','getDiff','createBody','idContact','queue','dialAnswer','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','util','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','logger2','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','statedesc','Blacklist','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','state','starttime','membername','UserId','logCustomer','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','originate','channelAgent','from-sip','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','scheduledat'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0x7b3b,0x14d));var _0xb7b3=function(_0x1edc4d,_0x34a32c){_0x1edc4d=_0x1edc4d-0x0;var _0x52a171=_0x7b3b[_0x1edc4d];return _0x52a171;};'use strict';var util=require(_0xb7b3('0x0'));var _=require('lodash');var moment=require(_0xb7b3('0x1'));var logger=require('../../../../config/logger')(_0xb7b3('0x2'));var ipAgi=process[_0xb7b3('0x3')][_0xb7b3('0x4')]||_0xb7b3('0x5');function getSeconds(_0x58badf,_0xda21cc){var _0x57e114=moment(_0x58badf)['milliseconds'](0x0);var _0x3a6399=moment(_0xda21cc)[_0xb7b3('0x6')](0x0);return _0x57e114[_0xb7b3('0x7')](_0x3a6399,_0xb7b3('0x8'));}exports[_0xb7b3('0x9')]=function(_0x4c5f5a){return function(_0x2c307f){logger[_0xb7b3('0xa')](_0x4c5f5a,util[_0xb7b3('0xb')](_0x2c307f,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x3f9c47,_0x13bd73){logger[_0xb7b3('0xc')](_0x3f9c47,util[_0xb7b3('0xb')](_0x13bd73,{'showHidden':![],'depth':null}));};exports[_0xb7b3('0xd')]=function(_0x2d2dca,_0x1d03f9){logger[_0xb7b3('0xa')](_0x2d2dca,util[_0xb7b3('0xb')](_0x1d03f9,{'showHidden':![],'depth':null}));};exports[_0xb7b3('0xe')]=function(_0x19c2ee){return function(_0x447382){logger[_0xb7b3('0xc')](_0x19c2ee,util['inspect'](_0x447382,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x149ecf,_0x2c3099,_0x1328bd){return{'message':_0x149ecf,'unlock':_0x2c3099,'active':_0x1328bd};};exports['getCallerId']=function(_0x2a949a,_0x178f90,_0x28e8b1){if(!_[_0xb7b3('0xf')](_0x28e8b1)&&_0xb7b3('0x10')===typeof _0x28e8b1&&!_['isEmpty'](_0x28e8b1)){if(!_[_0xb7b3('0xf')](_0x178f90)&&_0xb7b3('0x10')===typeof _0x178f90&&!_[_0xb7b3('0x11')](_0x178f90)){return util['format'](_0xb7b3('0x12'),_0x178f90,_0x28e8b1);}return util[_0xb7b3('0x13')](_0xb7b3('0x12'),_0x28e8b1,_0x28e8b1);}if(!_['isUndefined'](_0x2a949a)&&_0xb7b3('0x10')===typeof _0x2a949a&&!_[_0xb7b3('0x11')](_0x2a949a)){return _0x2a949a;}return _0xb7b3('0x14');};exports[_0xb7b3('0x15')]=function(_0x2a7a33){if(_[_0xb7b3('0x16')](_0x2a7a33)){return![];}return _0x2a7a33;};exports[_0xb7b3('0x17')]=function(_0x29d62f,_0x384b29,_0x154bdd,_0x7dc6f,_0x593cdc,_0x73095){var _0x841e60={'XMD-QUEUE':_0x384b29['Queue']?_0x384b29[_0xb7b3('0x18')][_0xb7b3('0x19')]:'','XMD-CALLERID':_0x7dc6f,'XMD-CALLERID-PREVIEW':_0x73095?util[_0xb7b3('0x13')](_0xb7b3('0x12'),_0x73095[_0xb7b3('0x1a')],_0x73095[_0xb7b3('0x1b')]):_0x7dc6f,'XMD-DIALID':_0x593cdc,'XMD-CONTACTID':_0x384b29['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x7dc6f,'XMD-VOICEQUEUEID':_0x384b29[_0xb7b3('0x1c')],'XMD-DIALCHANNEL':_0x154bdd,'XMD-DIALTIMEOUT':_0x29d62f[_0xb7b3('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xb7b3('0x13')](_0xb7b3('0x1e'),_0x29d62f[_0xb7b3('0x1f')]?'g':'',_[_0xb7b3('0x11')](_0x29d62f['monitor_format'])?'':_0xb7b3('0x20')),'XMD-DIALURL':_0x29d62f[_0xb7b3('0x21')]||'','XMD-AGI':_0x29d62f[_0xb7b3('0x22')]?util[_0xb7b3('0x13')](_0xb7b3('0x23'),ipAgi,_0x29d62f['dialQueueProject']):_0xb7b3('0x24'),'XMD-AGIAFTER':_0x29d62f[_0xb7b3('0x1f')]?util[_0xb7b3('0x13')](_0xb7b3('0x23'),ipAgi,_0x29d62f[_0xb7b3('0x1f')]):_0xb7b3('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x73095?_0x73095[_0xb7b3('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x73095?_0x73095['originatecalleridname']:'','XMD-DESTINATION':_0xb7b3('0x26')};if(!_[_0xb7b3('0x11')](_0x29d62f['monitor_format'])){_0x841e60[util[_0xb7b3('0x13')]('%s',_0xb7b3('0x27'))]=_0x29d62f[_0xb7b3('0x28')];_0x841e60[util[_0xb7b3('0x13')]('%s',_0xb7b3('0x29'))]=_0x593cdc;}if(_0x384b29&&_0x384b29[_0xb7b3('0x2a')]){for(var _0x78bf2a in _0x384b29[_0xb7b3('0x2a')]){if(_0x384b29['Contact'][_0xb7b3('0x2b')](_0x78bf2a)){if(!_[_0xb7b3('0x16')](_0x384b29[_0xb7b3('0x2a')][_0x78bf2a])&&_0x78bf2a!=='id'&&_0x78bf2a!=='tags'&&_0x78bf2a!==_0xb7b3('0x2c')&&_0x78bf2a!==_0xb7b3('0x2d')){_0x841e60[util[_0xb7b3('0x13')](_0xb7b3('0x2e'),_0xb7b3('0x2f'),_[_0xb7b3('0x30')](_0x78bf2a))]=_0x384b29[_0xb7b3('0x2a')][_0x78bf2a];}}}}return _0x841e60;};exports[_0xb7b3('0x31')]=function(_0x592dc9){var _0xc4c1a8={};for(var _0x1f27f0 in _0x592dc9){if(_0x592dc9[_0xb7b3('0x2b')](_0x1f27f0)){_0xc4c1a8[util['format']('%s',_['toLower'](_0x1f27f0))]=_0x592dc9[_0x1f27f0];}}return{'variables':_0xc4c1a8};};exports[_0xb7b3('0x32')]=function(_0x44c547,_0x3b2f18){if(!_[_0xb7b3('0x16')](_0x44c547)){if(_0x44c547[_0xb7b3('0x2b')](_0xb7b3('0x33'))){if(_0x44c547[_0xb7b3('0x33')]>0x0){_0x44c547[_0xb7b3('0x33')]-=0x1;}else{logger['error'](_0xb7b3('0x34'),_0x3b2f18);}}}else{logger['error'](_0xb7b3('0x35'),_0x3b2f18);}};exports[_0xb7b3('0x36')]=function(_0x320cb8){var _0x14dd20=moment()[_0xb7b3('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x320cb8['state']=0xd;_0x320cb8[_0xb7b3('0x37')]=_0xb7b3('0x38');_0x320cb8['starttime']=_0x14dd20;_0x320cb8[_0xb7b3('0x39')]=_0x14dd20;_0x320cb8[_0xb7b3('0x3a')]=_0x14dd20;};exports[_0xb7b3('0x3b')]=function(_0x1e97bf,_0x3ef7df,_0x27b412){var _0x394573=moment()[_0xb7b3('0x13')](_0xb7b3('0x3c'));_0x1e97bf[_0xb7b3('0x3d')]=_0x3ef7df;_0x1e97bf['statedesc']=_0x27b412;_0x1e97bf[_0xb7b3('0x39')]=_0x394573;_0x1e97bf['ringtime']=getSeconds(_0x1e97bf['responsetime'],_0x1e97bf[_0xb7b3('0x3e')]);};exports['logLookAgent']=function(_0x7b9d0d,_0x5b3811,_0x2fa07b){_0x7b9d0d[_0xb7b3('0x3f')]=_0x5b3811;_0x7b9d0d[_0xb7b3('0x40')]=_0x2fa07b;};exports[_0xb7b3('0x41')]=function(_0x1bf8b3,_0x4f3066,_0x77da61){var _0x2bd69f=moment()[_0xb7b3('0x13')](_0xb7b3('0x3c'));_0x1bf8b3[_0xb7b3('0x3d')]=_0x4f3066;_0x1bf8b3['statedesc']=_0x77da61;_0x1bf8b3[_0xb7b3('0x39')]=_0x1bf8b3[_0xb7b3('0x39')]?_0x1bf8b3['responsetime']:_0x2bd69f;_0x1bf8b3[_0xb7b3('0x3a')]=_0x1bf8b3[_0xb7b3('0x3a')]?_0x1bf8b3[_0xb7b3('0x3a')]:_0x2bd69f;_0x1bf8b3['ringtime']=getSeconds(_0x1bf8b3[_0xb7b3('0x39')]||0x0,_0x1bf8b3[_0xb7b3('0x3e')]||0x0);_0x1bf8b3[_0xb7b3('0x42')]=_0x1bf8b3[_0xb7b3('0x43')]?getSeconds(_0x1bf8b3[_0xb7b3('0x3a')],_0x1bf8b3['answertime']):0x0;};exports['isFailure']=function(_0x57461a){return _0x57461a===_0xb7b3('0x44');};exports[_0xb7b3('0x45')]=function(_0x49f326,_0x5cd236,_0x11cda3,_0x3cc121,_0x16885e){var _0x1ea2a6=_0x3cc121?_0xb7b3('0x46'):_0x49f326[_0xb7b3('0x1a')];_0x1ea2a6=_0x16885e?_0xb7b3('0x47'):_0x1ea2a6;return{'actionid':_0x49f326['uniqueid'],'action':_0xb7b3('0x48'),'channel':_0x49f326[_0xb7b3('0x49')],'callerid':util[_0xb7b3('0x13')](_0xb7b3('0x12'),_0x1ea2a6,_0x49f326[_0xb7b3('0x1b')]),'Exten':'xcally-motion-preview','Context':_0xb7b3('0x4a'),'Priority':'1','variable':_0x11cda3,'timeout':(_0x5cd236['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x49f326[_0xb7b3('0x4b')]};};exports[_0xb7b3('0x4c')]=function(_0x48c6f8){return _0x48c6f8[_0xb7b3('0x4d')]+_0x48c6f8[_0xb7b3('0x4e')]+_0x48c6f8[_0xb7b3('0x4f')]+_0x48c6f8[_0xb7b3('0x50')]+_0x48c6f8[_0xb7b3('0x51')];};exports[_0xb7b3('0x52')]=function(_0x1b15b3){var _0x21e798=_['clone'](_0x1b15b3);_0x21e798[_0xb7b3('0x3d')]=0xf;_0x21e798['statedesc']=_0xb7b3('0x53');return _0x21e798;};exports[_0xb7b3('0x54')]=function(_0x1f8068,_0x28b6ca,_0x303c51){var _0x1de549={};_0x1de549[_0x28b6ca]=_0x1f8068[_0x28b6ca];_0x1de549[_0xb7b3('0x55')]=![];_0x1de549[_0xb7b3('0x56')]=moment()[_0xb7b3('0x57')](_0x303c51,_0xb7b3('0x58'))[_0xb7b3('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x1de549['ContactId']=_0x1f8068[_0xb7b3('0x59')];_0x1de549[_0xb7b3('0x5a')]=_0x1f8068['ListId'];_0x1de549[_0xb7b3('0x1c')]=_0x1f8068['VoiceQueueId']||undefined;return _0x1de549;};exports[_0xb7b3('0x5b')]=function(_0x2e0366,_0x5efa6f){if(!_['isNil'](_0x2e0366)){if(_0x2e0366['pTalking']>0x0){_0x2e0366['pTalking']-=0x1;}else{logger[_0xb7b3('0xa')](_0x5efa6f,_0xb7b3('0x5c'));}}else{logger[_0xb7b3('0xa')](_0x5efa6f,_0xb7b3('0x5d'));}};exports[_0xb7b3('0x5e')]=function(_0x114df3){if(_0x114df3<=0x0){return!![];}return![];};exports[_0xb7b3('0x5f')]=function(_0xbe14a4,_0x3d7096,_0x1d24d8){_0xbe14a4[_0xb7b3('0x60')]=_0x3d7096;_0xbe14a4[_0xb7b3('0x19')]=_0xbe14a4['queue'];_0xbe14a4[_0xb7b3('0x61')]=_0xbe14a4[_0xb7b3('0x49')];if(_0x1d24d8){_0xbe14a4[_0xb7b3('0x62')]=_0x1d24d8[_0xb7b3('0x62')];}return _0xbe14a4;};exports[_0xb7b3('0x63')]=function(_0x341ece){var _0x5f16de={};_0x5f16de['queue']=_0x341ece['queue'];_0x5f16de['interface']=_0x341ece[_0xb7b3('0x49')];_0x5f16de[_0xb7b3('0x4b')]=_0x341ece[_0xb7b3('0x4b')];return _0x5f16de;};exports['agentReadyId']=function(_0x462ae5){var _0x50369c=[];for(var _0x3df150 in _0x462ae5){if(_0x462ae5[_0xb7b3('0x2b')](_0x3df150)){if(!_[_0xb7b3('0x16')](_0x462ae5[_0x3df150])&&_0x462ae5[_0x3df150][_0xb7b3('0x3d')]===_0xb7b3('0x64')&&_0x462ae5[_0x3df150][_0xb7b3('0x65')]===_0xb7b3('0x66')){_0x50369c['push'](_0x462ae5[_0x3df150]['id']);}}}return _0x50369c;};exports[_0xb7b3('0x67')]=function(_0x2c1b28){var _0x2b86bd=moment()[_0xb7b3('0x6')](0x0);var _0x39e937=moment(_0x2c1b28)['milliseconds'](0x0);return _0x2b86bd[_0xb7b3('0x7')](_0x39e937,_0xb7b3('0x8'));};exports[_0xb7b3('0x68')]=function(_0x2a22d6){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2a22d6[_0xb7b3('0x59')],'ListId':_0x2a22d6[_0xb7b3('0x5a')],'VoiceQueueId':_0x2a22d6[_0xb7b3('0x1c')]||undefined,'CampaignId':_0x2a22d6['CampaignId']||undefined};};exports['filterKey']=function(_0x5185a1){if(_0x5185a1===_0xb7b3('0x4b')||_0x5185a1===_0xb7b3('0x69')||_0x5185a1===_0xb7b3('0x6a')||_0x5185a1==='type'||_0x5185a1==='campaigntype'||_0x5185a1===_0xb7b3('0x6b')||_0x5185a1===_0xb7b3('0x3f')||_0x5185a1===_0xb7b3('0x49')||_0x5185a1==='calleridname'||_0x5185a1===_0xb7b3('0x55')||_0x5185a1===_0xb7b3('0x1b')||_0x5185a1===_0xb7b3('0x56')||_0x5185a1===_0xb7b3('0x4d')||_0x5185a1==='countcongestionretry'||_0x5185a1===_0xb7b3('0x4f')||_0x5185a1==='countglobal'||_0x5185a1==='callback'||_0x5185a1===_0xb7b3('0x6c')||_0x5185a1===_0xb7b3('0x6d')||_0x5185a1===_0xb7b3('0x6e')||_0x5185a1===_0xb7b3('0x59')||_0x5185a1===_0xb7b3('0x5a')||_0x5185a1==='UserId'||_0x5185a1===_0xb7b3('0x1c')||_0x5185a1===_0xb7b3('0x6f')||_0x5185a1===_0xb7b3('0x70')||_0x5185a1===_0xb7b3('0x71')||_0x5185a1===_0xb7b3('0x72')||_0x5185a1===_0xb7b3('0x73')||_0x5185a1===_0xb7b3('0x74')||_0x5185a1===_0xb7b3('0x75')||_0x5185a1===_0xb7b3('0x76')||_0x5185a1==='xmd-dialid'||_0x5185a1===_0xb7b3('0x77')||_0x5185a1===_0xb7b3('0x78')||_0x5185a1===_0xb7b3('0x79')||_0x5185a1===_0xb7b3('0x7a')||_0x5185a1==='xmd-agiafter'||_0x5185a1===_0xb7b3('0x7b')||_0x5185a1===_0xb7b3('0x7c')||_0x5185a1==='rtpaudioqosbridged'||_0x5185a1===_0xb7b3('0x7d')||_0x5185a1===_0xb7b3('0x7e')||_0x5185a1===_0xb7b3('0x7f')||_0x5185a1==='rtpaudioqoslossbridged'||_0x5185a1===_0xb7b3('0x80')||_0x5185a1===_0xb7b3('0x81')||_0x5185a1==='rtpaudioqos'||_0x5185a1===_0xb7b3('0x82')||_0x5185a1===_0xb7b3('0x7d')||_0x5185a1==='rtpaudioqosjitterbridged'||_0x5185a1===_0xb7b3('0x7f')||_0x5185a1===_0xb7b3('0x83')||_0x5185a1===_0xb7b3('0x80')||_0x5185a1===_0xb7b3('0x81')||_0x5185a1===_0xb7b3('0x84')||_0x5185a1===_0xb7b3('0x85')||_0x5185a1===_0xb7b3('0x3d')||_0x5185a1===_0xb7b3('0x37')){return![];}return!![];};exports[_0xb7b3('0x86')]=function(_0xd30867,_0x3a9e53){var _0x4571ed,_0x1cccf6,_0x4b906e;if(_0x3a9e53<=0x0){_0x3a9e53=0x1;}_0x4571ed=new RegExp(_0xb7b3('0x87')+_0x3a9e53+'}$');_0x1cccf6=Math[_0xb7b3('0x88')](0xa,_0x3a9e53-0x1);_0x4b906e=Math[_0xb7b3('0x88')](0xa,_0x3a9e53)-0x1;return util[_0xb7b3('0x13')]('%s',_[_0xb7b3('0x89')](_0xd30867,_0x4571ed,_[_0xb7b3('0x8a')](_0x1cccf6,_0x4b906e)));};exports['extractCalleridName']=function(_0xc93f3){var _0x2e21dc=_0xc93f3[_0xb7b3('0x8b')](/"(.*?)"/);return _0x2e21dc?_0x2e21dc[0x1]:_0xc93f3;};exports['extractCalleridNumber']=function(_0x41db14){var _0x2dec6b=_0x41db14['match'](/<(.*?)>/);return _0x2dec6b?_0x2dec6b[0x1]:_0x41db14;}; \ No newline at end of file +var _0xbbb6=['dialer','VoiceQueueId','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','membername','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnosuchnumberretry','cloneAction','clone','Global','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','buildAcw','not_inuse','status','getDiff','createBody','idContact','type','campaigntype','dialAnswer','scheduledat','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','inspect','logger','info','loggerError','message','getCallerId','string','isEmpty','format','\x22%s\x22\x20<%s>','isUndefined','isActive','isNil','addVariables','name','calleridname','ContactId'];(function(_0x11a53c,_0x486647){var _0x119348=function(_0x416318){while(--_0x416318){_0x11a53c['push'](_0x11a53c['shift']());}};_0x119348(++_0x486647);}(_0xbbb6,0xf7));var _0x6bbb=function(_0x1d873a,_0x7c445e){_0x1d873a=_0x1d873a-0x0;var _0x4cea22=_0xbbb6[_0x1d873a];return _0x4cea22;};'use strict';var util=require(_0x6bbb('0x0'));var _=require(_0x6bbb('0x1'));var moment=require(_0x6bbb('0x2'));var logger=require(_0x6bbb('0x3'))('preview');var ipAgi=process['env'][_0x6bbb('0x4')]||_0x6bbb('0x5');function getSeconds(_0x26f9f1,_0xe75ef){var _0x18dcb7=moment(_0x26f9f1)[_0x6bbb('0x6')](0x0);var _0x484143=moment(_0xe75ef)[_0x6bbb('0x6')](0x0);return _0x18dcb7[_0x6bbb('0x7')](_0x484143,_0x6bbb('0x8'));}exports['loggerCatch']=function(_0x5ca0f4){return function(_0xc2ee51){logger[_0x6bbb('0x9')](_0x5ca0f4,util[_0x6bbb('0xa')](_0xc2ee51,{'showHidden':![],'depth':null}));};};exports[_0x6bbb('0xb')]=function(_0x4754ef,_0x50b962){logger[_0x6bbb('0xc')](_0x4754ef,util['inspect'](_0x50b962,{'showHidden':![],'depth':null}));};exports[_0x6bbb('0xd')]=function(_0x2283f7,_0x559de4){logger[_0x6bbb('0x9')](_0x2283f7,util[_0x6bbb('0xa')](_0x559de4,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x52a6bd){return function(_0x5b80b0){logger[_0x6bbb('0xc')](_0x52a6bd,util[_0x6bbb('0xa')](_0x5b80b0,{'showHidden':![],'depth':null}));};};exports[_0x6bbb('0xe')]=function(_0x4aa72e,_0x294ff3,_0x5e6f23){return{'message':_0x4aa72e,'unlock':_0x294ff3,'active':_0x5e6f23};};exports[_0x6bbb('0xf')]=function(_0x130058,_0x2d8d9e,_0x5355a4){if(!_['isUndefined'](_0x5355a4)&&_0x6bbb('0x10')===typeof _0x5355a4&&!_['isEmpty'](_0x5355a4)){if(!_['isUndefined'](_0x2d8d9e)&&_0x6bbb('0x10')===typeof _0x2d8d9e&&!_[_0x6bbb('0x11')](_0x2d8d9e)){return util[_0x6bbb('0x12')](_0x6bbb('0x13'),_0x2d8d9e,_0x5355a4);}return util[_0x6bbb('0x12')](_0x6bbb('0x13'),_0x5355a4,_0x5355a4);}if(!_[_0x6bbb('0x14')](_0x130058)&&'string'===typeof _0x130058&&!_['isEmpty'](_0x130058)){return _0x130058;}return'\x22\x22\x20<>';};exports[_0x6bbb('0x15')]=function(_0x4e4417){if(_[_0x6bbb('0x16')](_0x4e4417)){return![];}return _0x4e4417;};exports[_0x6bbb('0x17')]=function(_0x45f7b1,_0x5337ab,_0x234192,_0xc86ad0,_0xba0b8b,_0x50aa07){var _0x1f173a={'XMD-QUEUE':_0x5337ab['Queue']?_0x5337ab['Queue'][_0x6bbb('0x18')]:'','XMD-CALLERID':_0xc86ad0,'XMD-CALLERID-PREVIEW':_0x50aa07?util[_0x6bbb('0x12')](_0x6bbb('0x13'),_0x50aa07[_0x6bbb('0x19')],_0x50aa07['calleridnum']):_0xc86ad0,'XMD-DIALID':_0xba0b8b,'XMD-CONTACTID':_0x5337ab[_0x6bbb('0x1a')],'XMD-CDRTYPE':_0x6bbb('0x1b'),'CALLERID(all)':_0xc86ad0,'XMD-VOICEQUEUEID':_0x5337ab[_0x6bbb('0x1c')],'XMD-DIALCHANNEL':_0x234192,'XMD-DIALTIMEOUT':_0x45f7b1['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x6bbb('0x12')]('\x22rtTxX%s%s\x22',_0x45f7b1[_0x6bbb('0x1d')]?'g':'',_[_0x6bbb('0x11')](_0x45f7b1[_0x6bbb('0x1e')])?'':_0x6bbb('0x1f')),'XMD-DIALURL':_0x45f7b1[_0x6bbb('0x20')]||'','XMD-AGI':_0x45f7b1['dialQueueProject']?util[_0x6bbb('0x12')](_0x6bbb('0x21'),ipAgi,_0x45f7b1[_0x6bbb('0x22')]):_0x6bbb('0x23'),'XMD-AGIAFTER':_0x45f7b1[_0x6bbb('0x1d')]?util['format'](_0x6bbb('0x21'),ipAgi,_0x45f7b1['dialQueueProject2']):_0x6bbb('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x50aa07?_0x50aa07['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x50aa07?_0x50aa07[_0x6bbb('0x24')]:'','XMD-DESTINATION':_0x6bbb('0x25')};if(!_['isEmpty'](_0x45f7b1[_0x6bbb('0x1e')])){_0x1f173a[util[_0x6bbb('0x12')]('%s',_0x6bbb('0x26'))]=_0x45f7b1[_0x6bbb('0x1e')];_0x1f173a[util[_0x6bbb('0x12')]('%s',_0x6bbb('0x27'))]=_0xba0b8b;}if(_0x5337ab&&_0x5337ab[_0x6bbb('0x28')]){for(var _0x513fe1 in _0x5337ab['Contact']){if(_0x5337ab['Contact'][_0x6bbb('0x29')](_0x513fe1)){if(!_[_0x6bbb('0x16')](_0x5337ab[_0x6bbb('0x28')][_0x513fe1])&&_0x513fe1!=='id'&&_0x513fe1!==_0x6bbb('0x2a')&&_0x513fe1!==_0x6bbb('0x2b')&&_0x513fe1!=='updatedAt'){_0x1f173a[util['format'](_0x6bbb('0x2c'),_0x6bbb('0x2d'),_['toUpper'](_0x513fe1))]=_0x5337ab[_0x6bbb('0x28')][_0x513fe1];}}}}return _0x1f173a;};exports[_0x6bbb('0x2e')]=function(_0x4f47dc){var _0x5509c7={};for(var _0x869c37 in _0x4f47dc){if(_0x4f47dc[_0x6bbb('0x29')](_0x869c37)){_0x5509c7[util[_0x6bbb('0x12')]('%s',_[_0x6bbb('0x2f')](_0x869c37))]=_0x4f47dc[_0x869c37];}}return{'variables':_0x5509c7};};exports['updateOriginated']=function(_0x3acee6,_0x2a3f4b){if(!_[_0x6bbb('0x16')](_0x3acee6)){if(_0x3acee6[_0x6bbb('0x29')](_0x6bbb('0x30'))){if(_0x3acee6[_0x6bbb('0x30')]>0x0){_0x3acee6['originated']-=0x1;}else{logger['error'](_0x6bbb('0x31'),_0x2a3f4b);}}}else{logger['error'](_0x6bbb('0x32'),_0x2a3f4b);}};exports[_0x6bbb('0x33')]=function(_0x48c8fa){var _0x1637f2=moment()[_0x6bbb('0x12')](_0x6bbb('0x34'));_0x48c8fa[_0x6bbb('0x35')]=0xd;_0x48c8fa[_0x6bbb('0x36')]=_0x6bbb('0x37');_0x48c8fa[_0x6bbb('0x38')]=_0x1637f2;_0x48c8fa[_0x6bbb('0x39')]=_0x1637f2;_0x48c8fa[_0x6bbb('0x3a')]=_0x1637f2;};exports[_0x6bbb('0x3b')]=function(_0x4a103a,_0x1a8bcd,_0x4838d5){var _0xb93510=moment()['format'](_0x6bbb('0x34'));_0x4a103a['state']=_0x1a8bcd;_0x4a103a[_0x6bbb('0x36')]=_0x4838d5;_0x4a103a[_0x6bbb('0x39')]=_0xb93510;_0x4a103a[_0x6bbb('0x3c')]=getSeconds(_0x4a103a['responsetime'],_0x4a103a[_0x6bbb('0x38')]);};exports['logLookAgent']=function(_0x1df80c,_0x334008,_0x1cdce5){_0x1df80c[_0x6bbb('0x3d')]=_0x334008;_0x1df80c['UserId']=_0x1cdce5;};exports['logCustomer']=function(_0x24b0ff,_0x3ef478,_0x3355bb){var _0x579f3e=moment()[_0x6bbb('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x24b0ff['state']=_0x3ef478;_0x24b0ff['statedesc']=_0x3355bb;_0x24b0ff[_0x6bbb('0x39')]=_0x24b0ff[_0x6bbb('0x39')]?_0x24b0ff[_0x6bbb('0x39')]:_0x579f3e;_0x24b0ff[_0x6bbb('0x3a')]=_0x24b0ff[_0x6bbb('0x3a')]?_0x24b0ff[_0x6bbb('0x3a')]:_0x579f3e;_0x24b0ff[_0x6bbb('0x3c')]=getSeconds(_0x24b0ff[_0x6bbb('0x39')]||0x0,_0x24b0ff[_0x6bbb('0x38')]||0x0);_0x24b0ff[_0x6bbb('0x3e')]=_0x24b0ff['answertime']?getSeconds(_0x24b0ff[_0x6bbb('0x3a')],_0x24b0ff[_0x6bbb('0x3f')]):0x0;};exports[_0x6bbb('0x40')]=function(_0x2bc435){return _0x2bc435===_0x6bbb('0x41');};exports[_0x6bbb('0x42')]=function(_0x581bde,_0x31cf85,_0x66e5b8,_0x43b7c5,_0x392aab){var _0xd8cf5a=_0x43b7c5?'RECALL':_0x581bde['calleridname'];_0xd8cf5a=_0x392aab?_0x6bbb('0x43'):_0xd8cf5a;return{'actionid':_0x581bde[_0x6bbb('0x44')],'action':_0x6bbb('0x45'),'channel':_0x581bde[_0x6bbb('0x46')],'callerid':util[_0x6bbb('0x12')]('\x22%s\x22\x20<%s>',_0xd8cf5a,_0x581bde[_0x6bbb('0x47')]),'Exten':'xcally-motion-preview','Context':_0x6bbb('0x48'),'Priority':'1','variable':_0x66e5b8,'timeout':(_0x31cf85[_0x6bbb('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x581bde[_0x6bbb('0x44')]};};exports[_0x6bbb('0x4a')]=function(_0xe4fa7b){return _0xe4fa7b[_0x6bbb('0x4b')]+_0xe4fa7b[_0x6bbb('0x4c')]+_0xe4fa7b['countnoanswerretry']+_0xe4fa7b['countagentrejectretry']+_0xe4fa7b[_0x6bbb('0x4d')];};exports[_0x6bbb('0x4e')]=function(_0x4430a4){var _0x2a9080=_[_0x6bbb('0x4f')](_0x4430a4);_0x2a9080[_0x6bbb('0x35')]=0xf;_0x2a9080[_0x6bbb('0x36')]=_0x6bbb('0x50');return _0x2a9080;};exports['scheduledAt']=function(_0x49ad3d,_0x36bece,_0x26d1c0){var _0x56be74={};_0x56be74[_0x36bece]=_0x49ad3d[_0x36bece];_0x56be74[_0x6bbb('0x51')]=![];_0x56be74['scheduledat']=moment()[_0x6bbb('0x52')](_0x26d1c0,_0x6bbb('0x53'))[_0x6bbb('0x12')](_0x6bbb('0x34'));_0x56be74[_0x6bbb('0x1a')]=_0x49ad3d[_0x6bbb('0x1a')];_0x56be74[_0x6bbb('0x54')]=_0x49ad3d['ListId'];_0x56be74['VoiceQueueId']=_0x49ad3d[_0x6bbb('0x1c')]||undefined;return _0x56be74;};exports[_0x6bbb('0x55')]=function(_0x347251,_0x1d4616){if(!_[_0x6bbb('0x16')](_0x347251)){if(_0x347251['pTalking']>0x0){_0x347251[_0x6bbb('0x56')]-=0x1;}else{logger['error'](_0x1d4616,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x6bbb('0x9')](_0x1d4616,_0x6bbb('0x57'));}};exports['IsNotLoggedIn']=function(_0x5b9dd2){if(_0x5b9dd2<=0x0){return!![];}return![];};exports[_0x6bbb('0x58')]=function(_0x4827d4,_0xe9ae15,_0x25d27b){_0x4827d4[_0x6bbb('0x59')]=_0xe9ae15;_0x4827d4[_0x6bbb('0x18')]=_0x4827d4[_0x6bbb('0x5a')];_0x4827d4[_0x6bbb('0x5b')]=_0x4827d4[_0x6bbb('0x46')];if(_0x25d27b){_0x4827d4['mandatoryDisposition']=_0x25d27b['mandatoryDisposition'];}return _0x4827d4;};exports[_0x6bbb('0x5c')]=function(_0x327cc1){var _0xc36369={};_0xc36369[_0x6bbb('0x5a')]=_0x327cc1['queue'];_0xc36369[_0x6bbb('0x5b')]=_0x327cc1['channelAgent'];_0xc36369['uniqueid']=_0x327cc1[_0x6bbb('0x44')];return _0xc36369;};exports['agentReadyId']=function(_0x2e942c){var _0x4dffbe=[];for(var _0x2b052b in _0x2e942c){if(_0x2e942c[_0x6bbb('0x29')](_0x2b052b)){if(!_[_0x6bbb('0x16')](_0x2e942c[_0x2b052b])&&_0x2e942c[_0x2b052b]['state']===_0x6bbb('0x5d')&&_0x2e942c[_0x2b052b][_0x6bbb('0x5e')]==='reachable'){_0x4dffbe['push'](_0x2e942c[_0x2b052b]['id']);}}}return _0x4dffbe;};exports[_0x6bbb('0x5f')]=function(_0x391e47){var _0x4ab27b=moment()[_0x6bbb('0x6')](0x0);var _0x36b9b0=moment(_0x391e47)[_0x6bbb('0x6')](0x0);return _0x4ab27b['diff'](_0x36b9b0,_0x6bbb('0x8'));};exports[_0x6bbb('0x60')]=function(_0x4563fe){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4563fe[_0x6bbb('0x1a')],'ListId':_0x4563fe['ListId'],'VoiceQueueId':_0x4563fe[_0x6bbb('0x1c')]||undefined,'CampaignId':_0x4563fe['CampaignId']||undefined};};exports['filterKey']=function(_0x2f046e){if(_0x2f046e==='uniqueid'||_0x2f046e===_0x6bbb('0x61')||_0x2f046e===_0x6bbb('0x5a')||_0x2f046e===_0x6bbb('0x62')||_0x2f046e===_0x6bbb('0x63')||_0x2f046e===_0x6bbb('0x64')||_0x2f046e==='membername'||_0x2f046e===_0x6bbb('0x46')||_0x2f046e===_0x6bbb('0x19')||_0x2f046e===_0x6bbb('0x51')||_0x2f046e===_0x6bbb('0x47')||_0x2f046e===_0x6bbb('0x65')||_0x2f046e===_0x6bbb('0x4b')||_0x2f046e===_0x6bbb('0x4c')||_0x2f046e===_0x6bbb('0x66')||_0x2f046e===_0x6bbb('0x67')||_0x2f046e===_0x6bbb('0x68')||_0x2f046e===_0x6bbb('0x69')||_0x2f046e===_0x6bbb('0x6a')||_0x2f046e===_0x6bbb('0x6b')||_0x2f046e===_0x6bbb('0x1a')||_0x2f046e===_0x6bbb('0x54')||_0x2f046e===_0x6bbb('0x6c')||_0x2f046e===_0x6bbb('0x1c')||_0x2f046e===_0x6bbb('0x6d')||_0x2f046e===_0x6bbb('0x6e')||_0x2f046e===_0x6bbb('0x6f')||_0x2f046e==='xmd-phone'||_0x2f046e===_0x6bbb('0x70')||_0x2f046e===_0x6bbb('0x71')||_0x2f046e==='xmd-dialtimeout'||_0x2f046e===_0x6bbb('0x72')||_0x2f046e==='xmd-dialid'||_0x2f046e===_0x6bbb('0x73')||_0x2f046e===_0x6bbb('0x74')||_0x2f046e===_0x6bbb('0x75')||_0x2f046e===_0x6bbb('0x76')||_0x2f046e==='xmd-agiafter'||_0x2f046e===_0x6bbb('0x77')||_0x2f046e===_0x6bbb('0x78')||_0x2f046e===_0x6bbb('0x79')||_0x2f046e===_0x6bbb('0x7a')||_0x2f046e===_0x6bbb('0x7b')||_0x2f046e===_0x6bbb('0x7c')||_0x2f046e===_0x6bbb('0x7d')||_0x2f046e===_0x6bbb('0x7e')||_0x2f046e==='rtpaudioqosrttbridged'||_0x2f046e===_0x6bbb('0x78')||_0x2f046e===_0x6bbb('0x79')||_0x2f046e===_0x6bbb('0x7a')||_0x2f046e===_0x6bbb('0x7b')||_0x2f046e==='rtpaudioqosloss'||_0x2f046e===_0x6bbb('0x7d')||_0x2f046e==='rtpaudioqosrtt'||_0x2f046e==='rtpaudioqosrttbridged'||_0x2f046e===_0x6bbb('0x7f')||_0x2f046e===_0x6bbb('0x80')||_0x2f046e===_0x6bbb('0x35')||_0x2f046e==='statedesc'){return![];}return!![];};exports[_0x6bbb('0x81')]=function(_0x20ac0c,_0x1021ac){var _0x3a62ff,_0x18ec1c,_0x7f6cbf;if(_0x1021ac<=0x0){_0x1021ac=0x1;}_0x3a62ff=new RegExp(_0x6bbb('0x82')+_0x1021ac+'}$');_0x18ec1c=Math[_0x6bbb('0x83')](0xa,_0x1021ac-0x1);_0x7f6cbf=Math[_0x6bbb('0x83')](0xa,_0x1021ac)-0x1;return util[_0x6bbb('0x12')]('%s',_[_0x6bbb('0x84')](_0x20ac0c,_0x3a62ff,_[_0x6bbb('0x85')](_0x18ec1c,_0x7f6cbf)));};exports[_0x6bbb('0x86')]=function(_0x40dd31){var _0x1adb5e=_0x40dd31[_0x6bbb('0x87')](/"(.*?)"/);return _0x1adb5e?_0x1adb5e[0x1]:_0x40dd31;};exports[_0x6bbb('0x88')]=function(_0x24d3da){var _0xfd7f1b=_0x24d3da[_0x6bbb('0x87')](/<(.*?)>/);return _0xfd7f1b?_0xfd7f1b[0x1]:_0x24d3da;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 4c0644e..ccad25f 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 _0x4964=['queuepause','reload','voicechannel','queueadd','string','number','boolean','queueremove'];(function(_0x264653,_0x194fec){var _0x12dd72=function(_0x212c61){while(--_0x212c61){_0x264653['push'](_0x264653['shift']());}};_0x12dd72(++_0x194fec);}(_0x4964,0x1bb));var _0x4496=function(_0x1a6fae,_0x35ebd7){_0x1a6fae=_0x1a6fae-0x0;var _0x12099c=_0x4964[_0x1a6fae];return _0x12099c;};'use strict';exports[_0x4496('0x0')]={'queue':{'type':_0x4496('0x1'),'required':!![]},'interface':{'type':_0x4496('0x1'),'required':!![]},'membername':{'type':_0x4496('0x1'),'required':!![]},'penalty':{'type':_0x4496('0x2'),'required':![]},'paused':{'type':_0x4496('0x3'),'required':![]}};exports[_0x4496('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x4496('0x1'),'required':!![]}};exports[_0x4496('0x5')]={'interface':{'type':_0x4496('0x1'),'required':!![]},'paused':{'type':_0x4496('0x3')},'reason':{'type':_0x4496('0x1'),'required':![]}};exports[_0x4496('0x6')]={'module':{'type':_0x4496('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x4496('0x1'),'required':!![]}};exports[_0x4496('0x7')]={'uniqueid':{'type':_0x4496('0x1'),'required':!![]},'filename':{'type':_0x4496('0x1')},'format':{'type':_0x4496('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x4496('0x1'),'required':!![]},'exten':{'type':_0x4496('0x1'),'required':!![]},'context':{'type':_0x4496('0x1')}}; \ No newline at end of file +var _0x2b09=['queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x445f97,_0x5bc5cc){var _0x5b27fb=function(_0x3facdf){while(--_0x3facdf){_0x445f97['push'](_0x445f97['shift']());}};_0x5b27fb(++_0x5bc5cc);}(_0x2b09,0x1ae));var _0x92b0=function(_0x35909b,_0x38afd9){_0x35909b=_0x35909b-0x0;var _0x1d9022=_0x2b09[_0x35909b];return _0x1d9022;};'use strict';exports[_0x92b0('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x92b0('0x1'),'required':!![]},'penalty':{'type':_0x92b0('0x2'),'required':![]},'paused':{'type':_0x92b0('0x3'),'required':![]}};exports[_0x92b0('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x92b0('0x1'),'required':!![]}};exports[_0x92b0('0x5')]={'interface':{'type':_0x92b0('0x1'),'required':!![]},'paused':{'type':_0x92b0('0x3')},'reason':{'type':_0x92b0('0x1'),'required':![]}};exports[_0x92b0('0x6')]={'module':{'type':'string','required':![]}};exports[_0x92b0('0x7')]={'uniqueid':{'type':_0x92b0('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x92b0('0x1')},'format':{'type':_0x92b0('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x92b0('0x8')]={'uniqueid':{'type':_0x92b0('0x1'),'required':!![]}};exports[_0x92b0('0x9')]={'uniqueid':{'type':_0x92b0('0x1'),'required':!![]},'exten':{'type':_0x92b0('0x1'),'required':!![]},'context':{'type':_0x92b0('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 8db0e89..9748c89 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 _0x609a=['outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','prototype','mergeFromDatabase','length','SIP/%s','isUndefined','initTelephones','telephones','initTrunks','initTriggers','initTemplates','initSalesforceAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','initVoiceCallReports','duration','disposition','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','faxAccounts','bluebird','lodash','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','agents','trunks','voiceQueues','triggers','templates','outbound','channels','queueChannels'];(function(_0x39941c,_0x4ad1bb){var _0x52d9c7=function(_0x4e107e){while(--_0x4e107e){_0x39941c['push'](_0x39941c['shift']());}};_0x52d9c7(++_0x4ad1bb);}(_0x609a,0x11c));var _0xa609=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x609a[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0xa609('0x0'));var util=require('util');var _=require(_0xa609('0x1'));var moment=require('moment');var Agent=require(_0xa609('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0xa609('0x3'));var VoiceQueue=require(_0xa609('0x4'));var Trigger=require(_0xa609('0x5'));var Template=require(_0xa609('0x6'));var Campaign=require(_0xa609('0x7'));var VoiceExtension=require(_0xa609('0x8'));var ZendeskAccount=require(_0xa609('0x9'));var SalesforceAccount=require(_0xa609('0xa'));var FreshdeskAccount=require(_0xa609('0xb'));var SugarcrmAccount=require(_0xa609('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xa609('0xd'));var VtigerAccount=require(_0xa609('0xe'));var ServicenowAccount=require(_0xa609('0xf'));var Dynamics365Account=require(_0xa609('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xa609('0x11')]={};this['telephones']={};this[_0xa609('0x12')]={};this[_0xa609('0x13')]={};this[_0xa609('0x14')]={};this['campaigns']={};this[_0xa609('0x15')]={};this[_0xa609('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xa609('0x17')]={};this[_0xa609('0x18')]={};this[_0xa609('0x19')]={};this['timers']={};this[_0xa609('0x1a')]={};this[_0xa609('0x1b')]={};this[_0xa609('0x1c')]={};this[_0xa609('0x1d')]={};this['freshdeskAccounts']={};this[_0xa609('0x1e')]={};this[_0xa609('0x1f')]={};this[_0xa609('0x20')]={};this[_0xa609('0x21')]={};this[_0xa609('0x22')]={};this[_0xa609('0x23')]={};this['faxAccounts']={};};function freeIsNotKey(_0x23b060,_0x5a5b09,_0x27790b){var _0x1c7fca=_[_0xa609('0x24')](_0x23b060,function(_0x4e5723,_0x47ff9c){return _0x4e5723[_0x27790b];});for(var _0x19465d in _0x5a5b09){if(_0x5a5b09[_0xa609('0x25')](_0x19465d)){if(!_0x1c7fca[_0x19465d]){delete _0x5a5b09[_0x19465d];}}}}function freeIsNotKeySip(_0x142edc,_0x3eedb4){var _0x8612ed=_[_0xa609('0x24')](_0x142edc,function(_0x645809,_0x461cb7){return util[_0xa609('0x26')]('SIP/%s',_0x645809[_0xa609('0x27')]);});for(var _0x5d826d in _0x3eedb4){if(_0x3eedb4[_0xa609('0x25')](_0x5d826d)){if(!_0x8612ed[_0x5d826d]){delete _0x3eedb4[_0x5d826d];}}}}function freeIsNotKeyAgent(_0x420c02,_0x8bbbd9){var _0xee457e=_[_0xa609('0x24')](_0x420c02,function(_0x4ed845,_0x35944a){var _0x3b6226=_[_0xa609('0x28')](_0x4ed845[_0xa609('0x29')])?util[_0xa609('0x26')]('SIP/%s',_0x4ed845[_0xa609('0x27')]):_0x4ed845[_0xa609('0x29')];return _0x3b6226;});for(var _0x591500 in _0x8bbbd9){if(_0x8bbbd9[_0xa609('0x25')](_0x591500)){if(!_0xee457e[_0x591500]){delete _0x8bbbd9[_0x591500];}}}}function clearVoiceCallReports(_0x3eeee4){_0x3eeee4[_0xa609('0x2a')]=0x0;_0x3eeee4[_0xa609('0x2b')]=0x0;_0x3eeee4[_0xa609('0x2c')]=0x0;_0x3eeee4[_0xa609('0x2d')]=0x0;_0x3eeee4[_0xa609('0x2e')]=0x0;}function clearCampaigns(_0x3ceb80){if(!_['isEmpty'](_0x3ceb80)){for(var _0x1801a4 in _0x3ceb80){if(_0x3ceb80[_0xa609('0x25')](_0x1801a4)){_0x3ceb80[_0x1801a4][_0xa609('0x2f')]=0x0;_0x3ceb80[_0x1801a4][_0xa609('0x30')]=0x0;}}}}function clearVoiceQueues(_0x141c9b){if(!_[_0xa609('0x31')](_0x141c9b)){for(var _0x2f0285 in _0x141c9b){if(_0x141c9b[_0xa609('0x25')](_0x2f0285)){_0x141c9b[_0x2f0285][_0xa609('0x2a')]=0x0;_0x141c9b[_0x2f0285][_0xa609('0x2b')]=0x0;_0x141c9b[_0x2f0285][_0xa609('0x32')]=0x0;_0x141c9b[_0x2f0285][_0xa609('0x33')]=0x0;_0x141c9b[_0x2f0285]['sumHoldTime']=0x0;_0x141c9b[_0x2f0285][_0xa609('0x2d')]=0x0;_0x141c9b[_0x2f0285][_0xa609('0x2e')]=0x0;_0x141c9b[_0x2f0285][_0xa609('0x34')]=0x0;_0x141c9b[_0x2f0285][_0xa609('0x35')]=0x0;_0x141c9b[_0x2f0285]['outboundBusyCallsDay']=0x0;_0x141c9b[_0x2f0285][_0xa609('0x36')]=0x0;_0x141c9b[_0x2f0285][_0xa609('0x37')]=0x0;_0x141c9b[_0x2f0285][_0xa609('0x38')]=0x0;_0x141c9b[_0x2f0285]['outboundDropCallsDayTimeout']=0x0;_0x141c9b[_0x2f0285][_0xa609('0x39')]=0x0;_0x141c9b[_0x2f0285][_0xa609('0x3a')]=0x0;_0x141c9b[_0x2f0285][_0xa609('0x3b')]=0x0;_0x141c9b[_0x2f0285][_0xa609('0x3c')]=0x0;_0x141c9b[_0x2f0285]['outboundReCallsDay']=0x0;_0x141c9b[_0x2f0285][_0xa609('0x34')]=0x0;_0x141c9b[_0x2f0285]['outboundAnswerCallsDay']=0x0;_0x141c9b[_0x2f0285]['queueStatusComplete']=!![];}}}}Realtime[_0xa609('0x3d')][_0xa609('0x3e')]=function(_0x5806c4,_0x435f5b){for(var _0xb01439 in _0x435f5b){if(_0x5806c4['hasOwnProperty'](_0xb01439)){_0x5806c4[_0xb01439]=_0x435f5b[_0xb01439];}}};Realtime[_0xa609('0x3d')]['initAgents']=function(){var _0x31eec0=this;return function(_0x5dbf43){if(_0x5dbf43){freeIsNotKeyAgent(_0x5dbf43,_0x31eec0[_0xa609('0x11')]);for(var _0x163090=0x0,_0xbe792={},_0x2cfc32={};_0x163090<_0x5dbf43[_0xa609('0x3f')];_0x163090+=0x1){_0xbe792=_0x5dbf43[_0x163090];var _0x94111d=_[_0xa609('0x28')](_0xbe792[_0xa609('0x29')])?util[_0xa609('0x26')](_0xa609('0x40'),_0xbe792[_0xa609('0x27')]):_0xbe792[_0xa609('0x29')];if(_[_0xa609('0x41')](_0x31eec0['agents'][_0x94111d])){_0x31eec0[_0xa609('0x11')][_0x94111d]=new Agent(_0xbe792);}else{_0x31eec0[_0xa609('0x3e')](_0x31eec0[_0xa609('0x11')][_0x94111d],_0xbe792);}}}return _0x31eec0[_0xa609('0x11')];};};Realtime[_0xa609('0x3d')][_0xa609('0x42')]=function(){var _0x277b5c=this;return function(_0x5a7e43){if(_0x5a7e43){freeIsNotKeySip(_0x5a7e43,_0x277b5c[_0xa609('0x43')]);for(var _0xdccf03=0x0,_0x478bb4={},_0x3bcfce={};_0xdccf03<_0x5a7e43[_0xa609('0x3f')];_0xdccf03+=0x1){_0x478bb4=_0x5a7e43[_0xdccf03];if(_[_0xa609('0x41')](_0x277b5c[_0xa609('0x43')][util[_0xa609('0x26')]('SIP/%s',_0x478bb4[_0xa609('0x27')])])){_0x277b5c[_0xa609('0x43')][util[_0xa609('0x26')](_0xa609('0x40'),_0x478bb4['name'])]=new Telephone(_0x478bb4);}else{_0x277b5c[_0xa609('0x3e')](_0x277b5c[_0xa609('0x43')][util['format'](_0xa609('0x40'),_0x478bb4[_0xa609('0x27')])],_0x478bb4);}}}return _0x277b5c['telephones'];};};Realtime[_0xa609('0x3d')][_0xa609('0x44')]=function(){var _0x96d346=this;return function(_0x3bba6b){if(_0x3bba6b){freeIsNotKeySip(_0x3bba6b,_0x96d346[_0xa609('0x12')]);for(var _0x57a34b=0x0,_0x18e63d={},_0xfa81bc={};_0x57a34b<_0x3bba6b[_0xa609('0x3f')];_0x57a34b+=0x1){_0x18e63d=_0x3bba6b[_0x57a34b];if(_[_0xa609('0x41')](_0x96d346[_0xa609('0x12')][util[_0xa609('0x26')](_0xa609('0x40'),_0x18e63d[_0xa609('0x27')])])){_0x96d346[_0xa609('0x12')][util[_0xa609('0x26')](_0xa609('0x40'),_0x18e63d[_0xa609('0x27')])]=new Trunk(_0x18e63d);}else{_0x96d346[_0xa609('0x3e')](_0x96d346[_0xa609('0x12')][util[_0xa609('0x26')](_0xa609('0x40'),_0x18e63d[_0xa609('0x27')])],_0x18e63d);}}}return _0x96d346['trunks'];};};Realtime[_0xa609('0x3d')]['initVoiceQueues']=function(){var _0xf84d49=this;return function(_0x150f92){if(_0x150f92){freeIsNotKey(_0x150f92,_0xf84d49[_0xa609('0x13')],_0xa609('0x27'));for(var _0xd7cc25=0x0,_0x29340e={},_0x213493={};_0xd7cc25<_0x150f92[_0xa609('0x3f')];_0xd7cc25+=0x1){_0x29340e=_0x150f92[_0xd7cc25];if(_['isUndefined'](_0xf84d49[_0xa609('0x13')][_0x29340e[_0xa609('0x27')]])){_0xf84d49[_0xa609('0x13')][_0x29340e['name']]=new VoiceQueue(_0x29340e);}else{_0xf84d49[_0xa609('0x3e')](_0xf84d49[_0xa609('0x13')][_0x29340e[_0xa609('0x27')]],_0x29340e);}}}return _0xf84d49['voiceQueues'];};};Realtime[_0xa609('0x3d')][_0xa609('0x45')]=function(){var _0x42b314=this;return function(_0x37f439){if(_0x37f439){freeIsNotKey(_0x37f439,_0x42b314[_0xa609('0x14')],'id');for(var _0x135460=0x0,_0x23d0e8={},_0x25bc71={};_0x135460<_0x37f439[_0xa609('0x3f')];_0x135460+=0x1){_0x23d0e8=_0x37f439[_0x135460];if(_['isUndefined'](_0x42b314[_0xa609('0x14')][_0x23d0e8['id']])){_0x42b314[_0xa609('0x14')][_0x23d0e8['id']]=new Trigger(_0x23d0e8);}else{_0x42b314[_0xa609('0x3e')](_0x42b314['triggers'][_0x23d0e8['id']],_0x23d0e8);}}}return _0x42b314[_0xa609('0x14')];};};Realtime[_0xa609('0x3d')][_0xa609('0x46')]=function(){var _0x40d07b=this;return function(_0x206249){if(_0x206249){freeIsNotKey(_0x206249,_0x40d07b[_0xa609('0x15')],'id');for(var _0x7f1461=0x0,_0x40f2b5={},_0x116109={};_0x7f1461<_0x206249[_0xa609('0x3f')];_0x7f1461+=0x1){_0x40f2b5=_0x206249[_0x7f1461];if(_[_0xa609('0x41')](_0x40d07b['templates'][_0x40f2b5['id']])){_0x40d07b[_0xa609('0x15')][_0x40f2b5['id']]=new Template(_0x40f2b5);}else{_0x40d07b[_0xa609('0x3e')](_0x40d07b['templates'][_0x40f2b5['id']],_0x40f2b5);}}}return _0x40d07b[_0xa609('0x15')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x56e06d=this;return function(_0x2dafc2){if(_0x2dafc2){freeIsNotKey(_0x2dafc2,_0x56e06d[_0xa609('0x1b')],'id');for(var _0x39326c=0x0,_0x5bb561={},_0x2debed={};_0x39326c<_0x2dafc2['length'];_0x39326c+=0x1){_0x5bb561=_0x2dafc2[_0x39326c];if(_[_0xa609('0x41')](_0x56e06d[_0xa609('0x1b')][_0x5bb561['id']])){_0x56e06d[_0xa609('0x1b')][_0x5bb561['id']]=new ZendeskAccount(_0x5bb561);}else{_0x56e06d[_0xa609('0x3e')](_0x56e06d[_0xa609('0x1b')][_0x5bb561['id']],_0x5bb561);}}}return _0x56e06d[_0xa609('0x1b')];};};Realtime[_0xa609('0x3d')][_0xa609('0x47')]=function(){var _0x555549=this;return function(_0x4a480f){if(_0x4a480f){freeIsNotKey(_0x4a480f,_0x555549[_0xa609('0x1c')],'id');for(var _0x4b8d3a=0x0,_0x4e07cc={},_0x55d1d0={};_0x4b8d3a<_0x4a480f['length'];_0x4b8d3a+=0x1){_0x4e07cc=_0x4a480f[_0x4b8d3a];if(_['isUndefined'](_0x555549['salesforceAccounts'][_0x4e07cc['id']])){_0x555549[_0xa609('0x1c')][_0x4e07cc['id']]=new SalesforceAccount(_0x4e07cc);}else{_0x555549[_0xa609('0x3e')](_0x555549[_0xa609('0x1c')][_0x4e07cc['id']],_0x4e07cc);}}}return _0x555549['salesforceAccounts'];};};Realtime[_0xa609('0x3d')]['initFreshdeskAccounts']=function(){var _0x191be3=this;return function(_0x5f0fe0){if(_0x5f0fe0){freeIsNotKey(_0x5f0fe0,_0x191be3['freshdeskAccounts'],'id');for(var _0x5c000d=0x0,_0x2e1d56={},_0x28dd58={};_0x5c000d<_0x5f0fe0['length'];_0x5c000d+=0x1){_0x2e1d56=_0x5f0fe0[_0x5c000d];if(_['isUndefined'](_0x191be3['freshdeskAccounts'][_0x2e1d56['id']])){_0x191be3['freshdeskAccounts'][_0x2e1d56['id']]=new FreshdeskAccount(_0x2e1d56);}else{_0x191be3[_0xa609('0x3e')](_0x191be3[_0xa609('0x48')][_0x2e1d56['id']],_0x2e1d56);}}}return _0x191be3[_0xa609('0x48')];};};Realtime[_0xa609('0x3d')][_0xa609('0x49')]=function(){var _0x4c024a=this;return function(_0x3f083d){if(_0x3f083d){freeIsNotKey(_0x3f083d,_0x4c024a[_0xa609('0x1e')],'id');for(var _0x3d2642=0x0,_0x27a0b1={},_0x17e5c2={};_0x3d2642<_0x3f083d['length'];_0x3d2642+=0x1){_0x27a0b1=_0x3f083d[_0x3d2642];if(_[_0xa609('0x41')](_0x4c024a[_0xa609('0x1e')][_0x27a0b1['id']])){_0x4c024a[_0xa609('0x1e')][_0x27a0b1['id']]=new ZohoAccount(_0x27a0b1);}else{_0x4c024a[_0xa609('0x3e')](_0x4c024a['zohoAccounts'][_0x27a0b1['id']],_0x27a0b1);}}}return _0x4c024a[_0xa609('0x1e')];};};Realtime[_0xa609('0x3d')][_0xa609('0x4a')]=function(){var _0x1d3271=this;return function(_0x457836){if(_0x457836){freeIsNotKey(_0x457836,_0x1d3271[_0xa609('0x1f')],'id');for(var _0x325539=0x0,_0x498e8d={},_0x5e8f6f={};_0x325539<_0x457836[_0xa609('0x3f')];_0x325539+=0x1){_0x498e8d=_0x457836[_0x325539];if(_[_0xa609('0x41')](_0x1d3271[_0xa609('0x1f')][_0x498e8d['id']])){_0x1d3271['deskAccounts'][_0x498e8d['id']]=new DeskAccount(_0x498e8d);}else{_0x1d3271[_0xa609('0x3e')](_0x1d3271[_0xa609('0x1f')][_0x498e8d['id']],_0x498e8d);}}}return _0x1d3271[_0xa609('0x1f')];};};Realtime[_0xa609('0x3d')][_0xa609('0x4b')]=function(){var _0x265edf=this;return function(_0xa06749){if(_0xa06749){freeIsNotKey(_0xa06749,_0x265edf[_0xa609('0x1d')],'id');for(var _0xeb70b2=0x0,_0x3aa319={},_0x38aa93={};_0xeb70b2<_0xa06749['length'];_0xeb70b2+=0x1){_0x3aa319=_0xa06749[_0xeb70b2];if(_[_0xa609('0x41')](_0x265edf[_0xa609('0x1d')][_0x3aa319['id']])){_0x265edf[_0xa609('0x1d')][_0x3aa319['id']]=new SugarcrmAccount(_0x3aa319);}else{_0x265edf[_0xa609('0x3e')](_0x265edf[_0xa609('0x1d')][_0x3aa319['id']],_0x3aa319);}}}return _0x265edf[_0xa609('0x1d')];};};Realtime['prototype']['initVtigerAccounts']=function(){var _0x304978=this;return function(_0x3d54e1){if(_0x3d54e1){freeIsNotKey(_0x3d54e1,_0x304978[_0xa609('0x20')],'id');for(var _0x18327b=0x0,_0x308978={},_0xe80950={};_0x18327b<_0x3d54e1['length'];_0x18327b+=0x1){_0x308978=_0x3d54e1[_0x18327b];if(_[_0xa609('0x41')](_0x304978[_0xa609('0x20')][_0x308978['id']])){_0x304978[_0xa609('0x20')][_0x308978['id']]=new VtigerAccount(_0x308978);}else{_0x304978[_0xa609('0x3e')](_0x304978[_0xa609('0x20')][_0x308978['id']],_0x308978);}}}return _0x304978['vtigerAccounts'];};};Realtime['prototype'][_0xa609('0x4c')]=function(){var _0xf82ff=this;return function(_0x366e90){if(_0x366e90){freeIsNotKey(_0x366e90,_0xf82ff[_0xa609('0x21')],'id');for(var _0x251f99=0x0,_0x122df3={},_0x26716e={};_0x251f99<_0x366e90[_0xa609('0x3f')];_0x251f99+=0x1){_0x122df3=_0x366e90[_0x251f99];if(_[_0xa609('0x41')](_0xf82ff[_0xa609('0x21')][_0x122df3['id']])){_0xf82ff[_0xa609('0x21')][_0x122df3['id']]=new ServicenowAccount(_0x122df3);}else{_0xf82ff[_0xa609('0x3e')](_0xf82ff[_0xa609('0x21')][_0x122df3['id']],_0x122df3);}}}return _0xf82ff['servicenowAccounts'];};};Realtime[_0xa609('0x3d')]['initDynamics365Accounts']=function(){var _0x37bf33=this;return function(_0x51e23a){if(_0x51e23a){freeIsNotKey(_0x51e23a,_0x37bf33[_0xa609('0x22')],'id');for(var _0x4e899a=0x0,_0x2db80e={},_0x583d66={};_0x4e899a<_0x51e23a['length'];_0x4e899a+=0x1){_0x2db80e=_0x51e23a[_0x4e899a];if(_[_0xa609('0x41')](_0x37bf33[_0xa609('0x22')][_0x2db80e['id']])){_0x37bf33[_0xa609('0x22')][_0x2db80e['id']]=new Dynamics365Account(_0x2db80e);}else{_0x37bf33['mergeFromDatabase'](_0x37bf33[_0xa609('0x22')][_0x2db80e['id']],_0x2db80e);}}}return _0x37bf33[_0xa609('0x22')];};};Realtime[_0xa609('0x3d')][_0xa609('0x4d')]=function(){var _0x36f553=this;return function(_0x5e55a3){if(_0x5e55a3){freeIsNotKey(_0x5e55a3,_0x36f553['freshsalesAccounts'],'id');for(var _0x315f17=0x0,_0x45a0d3={},_0xe1c3d6={};_0x315f17<_0x5e55a3['length'];_0x315f17+=0x1){_0x45a0d3=_0x5e55a3[_0x315f17];if(_[_0xa609('0x41')](_0x36f553[_0xa609('0x23')][_0x45a0d3['id']])){_0x36f553[_0xa609('0x23')][_0x45a0d3['id']]=new FreshsalesAccount(_0x45a0d3);}else{_0x36f553[_0xa609('0x3e')](_0x36f553[_0xa609('0x23')][_0x45a0d3['id']],_0x45a0d3);}}}return _0x36f553[_0xa609('0x23')];};};Realtime[_0xa609('0x3d')][_0xa609('0x4e')]=function(){var _0x33f6ee=this;return function(_0x56e8bb){for(var _0x2095b8=0x0;_0x2095b8<_0x56e8bb[_0xa609('0x3f')];_0x2095b8+=0x1){_['merge'](_0x33f6ee[_0xa609('0x13')][_0x56e8bb[_0x2095b8][_0xa609('0x27')]],_0x56e8bb[_0x2095b8]);}return _0x33f6ee[_0xa609('0x13')];};};Realtime[_0xa609('0x3d')]['initVoiceQueueReports']=function(){var _0x49bad2=this;return function(_0x4544b0){clearVoiceQueues(_0x49bad2[_0xa609('0x13')]);if(_0x4544b0){_0x4544b0=_['groupBy'](_0x4544b0,_0xa609('0x4f'));for(var _0x2cda75 in _0x4544b0){if(_0x4544b0[_0xa609('0x25')](_0x2cda75)){var _0x584cfb={};for(var _0x327438=0x0;_0x327438<_0x4544b0[_0x2cda75][_0xa609('0x3f')];_0x327438+=0x1){var _0x579df6=_0x4544b0[_0x2cda75][_0x327438][_0xa609('0x50')];if(_0x49bad2[_0xa609('0x13')][_0x579df6]){if(_0x4544b0[_0x2cda75][_0x327438][_0xa609('0x51')]){_0x49bad2[_0xa609('0x13')][_0x579df6][_0xa609('0x32')]+=0x1;}if(_0x4544b0[_0x2cda75][_0x327438][_0xa609('0x52')]){_0x49bad2[_0xa609('0x13')][_0x579df6][_0xa609('0x33')]+=0x1;}_0x49bad2[_0xa609('0x13')][_0x579df6]['sumHoldTime']+=moment(_0x4544b0[_0x2cda75][_0x327438][_0xa609('0x53')])[_0xa609('0x54')](moment(_0x4544b0[_0x2cda75][_0x327438][_0xa609('0x55')]),_0xa609('0x56'))||0x0;if(_0x327438===_0x4544b0[_0x2cda75][_0xa609('0x3f')]-0x1){_0x49bad2[_0xa609('0x13')][_0x579df6]['sumDuration']+=moment(_0x4544b0[_0x2cda75][_0x327438][_0xa609('0x57')]||_0x4544b0[_0x2cda75][_0x327438]['queuecallerabandonAt']||_0x4544b0[_0x2cda75][_0x327438][_0xa609('0x58')])[_0xa609('0x54')](moment(_0x4544b0[_0x2cda75][_0x327438][_0xa609('0x55')]),'seconds')||0x0;_0x49bad2[_0xa609('0x13')][_0x579df6][_0xa609('0x2a')]+=0x1;if(_0x4544b0[_0x2cda75][_0x327438]['queuecallercomplete']){_0x49bad2[_0xa609('0x13')][_0x579df6][_0xa609('0x2b')]+=0x1;_0x49bad2[_0xa609('0x13')][_0x579df6][_0xa609('0x2e')]+=moment(_0x4544b0[_0x2cda75][_0x327438][_0xa609('0x57')])[_0xa609('0x54')](moment(_0x4544b0[_0x2cda75][_0x327438]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x49bad2[_0xa609('0x13')][_0x579df6][_0xa609('0x2d')]+=_0x49bad2[_0xa609('0x13')][_0x579df6][_0xa609('0x2c')]||0x0;}}}}}}return _0x49bad2[_0xa609('0x13')];};};Realtime[_0xa609('0x3d')][_0xa609('0x59')]=function(){var _0xb7f4be=this;return function(_0x5dfc0a){clearVoiceCallReports(_0xb7f4be[_0xa609('0x16')]);if(_0x5dfc0a){for(var _0xeb09e7=0x0;_0xeb09e7<_0x5dfc0a['length'];_0xeb09e7+=0x1){_0xb7f4be[_0xa609('0x16')][_0xa609('0x2a')]+=0x1;_0xb7f4be[_0xa609('0x16')][_0xa609('0x2d')]+=_0x5dfc0a[_0xeb09e7][_0xa609('0x5a')];if(_0x5dfc0a[_0xeb09e7][_0xa609('0x5b')]==='ANSWERED'){_0xb7f4be[_0xa609('0x16')][_0xa609('0x2b')]+=0x1;_0xb7f4be['outbound'][_0xa609('0x2c')]+=_0x5dfc0a[_0xeb09e7][_0xa609('0x5a')]-_0x5dfc0a[_0xeb09e7][_0xa609('0x5c')]||0x0;_0xb7f4be[_0xa609('0x16')][_0xa609('0x2e')]+=_0x5dfc0a[_0xeb09e7][_0xa609('0x5c')];}}}return _0xb7f4be[_0xa609('0x16')];};};Realtime[_0xa609('0x3d')][_0xa609('0x5d')]=function(){var _0x3032e7=this;return function(_0x588d78){if(_0x588d78){freeIsNotKey(_0x588d78,_0x3032e7[_0xa609('0x5e')],_0xa609('0x27'));for(var _0x2a8516=0x0,_0x166817={};_0x2a8516<_0x588d78[_0xa609('0x3f')];_0x2a8516+=0x1){_0x166817=_0x588d78[_0x2a8516];if(_[_0xa609('0x41')](_0x3032e7['campaigns'][_0x166817[_0xa609('0x27')]])){_0x3032e7['campaigns'][_0x166817[_0xa609('0x27')]]=new Campaign(_0x166817);}else{_0x3032e7[_0xa609('0x3e')](_0x3032e7[_0xa609('0x5e')][_0x166817['name']],_0x166817);_0x3032e7[_0xa609('0x5e')][_0x166817['name']][_0xa609('0x5f')]=_0x166817[_0xa609('0x60')]?_0x166817[_0xa609('0x60')][_0xa609('0x27')]:undefined;}}}return _0x3032e7[_0xa609('0x5e')];};};Realtime[_0xa609('0x3d')][_0xa609('0x61')]=function(){var _0x374781=this;return function(_0x639645){if(_0x639645){freeIsNotKey(_0x639645,_0x374781['voiceExtensions'],'id');for(var _0x1f1286=0x0,_0x598aaa={};_0x1f1286<_0x639645['length'];_0x1f1286+=0x1){_0x598aaa=_0x639645[_0x1f1286];if(_[_0xa609('0x41')](_0x374781[_0xa609('0x62')][_0x598aaa['id']])){_0x374781['voiceExtensions'][_0x598aaa['id']]=new VoiceExtension(_0x598aaa);}else{_0x374781[_0xa609('0x3e')](_0x374781['voiceExtensions'][_0x598aaa['id']],_0x598aaa);}}}return _0x374781['voiceExtensions'];};};Realtime[_0xa609('0x3d')][_0xa609('0x63')]=function(){var _0x3a6c0b=this;return function(_0x3ab1f3){clearCampaigns(_0x3a6c0b['campaigns']);for(var _0x215f73=0x0;_0x215f73<_0x3ab1f3['length'];_0x215f73+=0x1){_[_0xa609('0x64')](_0x3a6c0b[_0xa609('0x5e')][_0x3ab1f3[_0x215f73]['name']],_0x3ab1f3[_0x215f73]);}return _0x3a6c0b['campaigns'];};};Realtime['prototype'][_0xa609('0x65')]=function(){var _0x259c1d=this;return function(_0x5623f6){if(_0x5623f6){freeIsNotKey(_0x5623f6,_0x259c1d['faxAccounts'],'id');for(var _0x474ce3=0x0,_0x36bf73={},_0x2bdcd5={};_0x474ce3<_0x5623f6[_0xa609('0x3f')];_0x474ce3+=0x1){_0x36bf73=_0x5623f6[_0x474ce3];if(_[_0xa609('0x41')](_0x259c1d[_0xa609('0x66')][_0x36bf73['id']])){_0x259c1d[_0xa609('0x66')][_0x36bf73['id']]=new FaxAccount(_0x36bf73);}else{_0x259c1d[_0xa609('0x3e')](_0x259c1d[_0xa609('0x66')][_0x36bf73['id']],_0x36bf73);}}}return _0x259c1d['faxAccounts'];};};module['exports']=Realtime; \ No newline at end of file +var _0xcc55=['initTriggers','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','queuecallerexit','unmanaged','queuecallerabandon','diff','seconds','queuecallerexitAt','queuecallercompleteAt','queuecallerleaveAt','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/salesforceAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','mapKeys','format','SIP/%s','isNil','interface','name','total','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','queueStatusComplete','prototype','mergeFromDatabase','isUndefined','initTelephones','length','initVoiceQueues'];(function(_0x3121cc,_0xd1dbf9){var _0x553b40=function(_0x42ffd0){while(--_0x42ffd0){_0x3121cc['push'](_0x3121cc['shift']());}};_0x553b40(++_0xd1dbf9);}(_0xcc55,0x80));var _0x5cc5=function(_0x2b7ba5,_0x1ccdc8){_0x2b7ba5=_0x2b7ba5-0x0;var _0x2a52f8=_0xcc55[_0x2b7ba5];return _0x2a52f8;};'use strict';var BPromise=require(_0x5cc5('0x0'));var util=require(_0x5cc5('0x1'));var _=require('lodash');var moment=require(_0x5cc5('0x2'));var Agent=require(_0x5cc5('0x3'));var Telephone=require(_0x5cc5('0x4'));var Trunk=require(_0x5cc5('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5cc5('0x6'));var Template=require(_0x5cc5('0x7'));var Campaign=require(_0x5cc5('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x5cc5('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x5cc5('0xa'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x5cc5('0xb'));var ServicenowAccount=require(_0x5cc5('0xc'));var Dynamics365Account=require(_0x5cc5('0xd'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x5cc5('0xe')]={};this[_0x5cc5('0xf')]={};this[_0x5cc5('0x10')]={};this[_0x5cc5('0x11')]={};this[_0x5cc5('0x12')]={};this[_0x5cc5('0x13')]={};this[_0x5cc5('0x14')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x5cc5('0x15')]={};this[_0x5cc5('0x16')]={};this[_0x5cc5('0x17')]={};this[_0x5cc5('0x18')]={};this[_0x5cc5('0x19')]={};this['settings']={};this['zendeskAccounts']={};this[_0x5cc5('0x1a')]={};this[_0x5cc5('0x1b')]={};this[_0x5cc5('0x1c')]={};this[_0x5cc5('0x1d')]={};this[_0x5cc5('0x1e')]={};this[_0x5cc5('0x1f')]={};this[_0x5cc5('0x20')]={};this[_0x5cc5('0x21')]={};this[_0x5cc5('0x22')]={};this[_0x5cc5('0x23')]={};};function freeIsNotKey(_0xd523fb,_0xd22711,_0x3d3e9c){var _0x49dbfc=_['mapKeys'](_0xd523fb,function(_0x2f9bda,_0x5a12e5){return _0x2f9bda[_0x3d3e9c];});for(var _0x5e0bb6 in _0xd22711){if(_0xd22711[_0x5cc5('0x24')](_0x5e0bb6)){if(!_0x49dbfc[_0x5e0bb6]){delete _0xd22711[_0x5e0bb6];}}}}function freeIsNotKeySip(_0x1a5322,_0x1f44ab){var _0x23650d=_[_0x5cc5('0x25')](_0x1a5322,function(_0xb2c116,_0x2887ab){return util[_0x5cc5('0x26')](_0x5cc5('0x27'),_0xb2c116['name']);});for(var _0x520724 in _0x1f44ab){if(_0x1f44ab[_0x5cc5('0x24')](_0x520724)){if(!_0x23650d[_0x520724]){delete _0x1f44ab[_0x520724];}}}}function freeIsNotKeyAgent(_0x17b0d9,_0x388b8e){var _0x3d570f=_[_0x5cc5('0x25')](_0x17b0d9,function(_0x27f1a1,_0x18cac3){var _0x1a6a64=_[_0x5cc5('0x28')](_0x27f1a1[_0x5cc5('0x29')])?util[_0x5cc5('0x26')](_0x5cc5('0x27'),_0x27f1a1[_0x5cc5('0x2a')]):_0x27f1a1['interface'];return _0x1a6a64;});for(var _0x3a6508 in _0x388b8e){if(_0x388b8e[_0x5cc5('0x24')](_0x3a6508)){if(!_0x3d570f[_0x3a6508]){delete _0x388b8e[_0x3a6508];}}}}function clearVoiceCallReports(_0x39156b){_0x39156b[_0x5cc5('0x2b')]=0x0;_0x39156b[_0x5cc5('0x2c')]=0x0;_0x39156b['sumHoldTime']=0x0;_0x39156b[_0x5cc5('0x2d')]=0x0;_0x39156b[_0x5cc5('0x2e')]=0x0;}function clearCampaigns(_0x25f280){if(!_[_0x5cc5('0x2f')](_0x25f280)){for(var _0x40fde9 in _0x25f280){if(_0x25f280[_0x5cc5('0x24')](_0x40fde9)){_0x25f280[_0x40fde9][_0x5cc5('0x30')]=0x0;_0x25f280[_0x40fde9]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x3142fe){if(!_[_0x5cc5('0x2f')](_0x3142fe)){for(var _0x3da093 in _0x3142fe){if(_0x3142fe[_0x5cc5('0x24')](_0x3da093)){_0x3142fe[_0x3da093][_0x5cc5('0x2b')]=0x0;_0x3142fe[_0x3da093][_0x5cc5('0x2c')]=0x0;_0x3142fe[_0x3da093]['unmanaged']=0x0;_0x3142fe[_0x3da093][_0x5cc5('0x31')]=0x0;_0x3142fe[_0x3da093][_0x5cc5('0x32')]=0x0;_0x3142fe[_0x3da093][_0x5cc5('0x2d')]=0x0;_0x3142fe[_0x3da093][_0x5cc5('0x2e')]=0x0;_0x3142fe[_0x3da093][_0x5cc5('0x33')]=0x0;_0x3142fe[_0x3da093]['outboundNoAnswerCallsDay']=0x0;_0x3142fe[_0x3da093][_0x5cc5('0x34')]=0x0;_0x3142fe[_0x3da093][_0x5cc5('0x35')]=0x0;_0x3142fe[_0x3da093][_0x5cc5('0x36')]=0x0;_0x3142fe[_0x3da093][_0x5cc5('0x37')]=0x0;_0x3142fe[_0x3da093][_0x5cc5('0x38')]=0x0;_0x3142fe[_0x3da093]['outboundDropCallsDayCallersExit']=0x0;_0x3142fe[_0x3da093]['outboundBlacklistCallsDay']=0x0;_0x3142fe[_0x3da093]['outboundOriginateFailureCallsDay']=0x0;_0x3142fe[_0x3da093]['outboundRejectCallsDay']=0x0;_0x3142fe[_0x3da093]['outboundReCallsDay']=0x0;_0x3142fe[_0x3da093]['outboundAnswerAgiCallsDay']=0x0;_0x3142fe[_0x3da093]['outboundAnswerCallsDay']=0x0;_0x3142fe[_0x3da093][_0x5cc5('0x39')]=!![];}}}}Realtime[_0x5cc5('0x3a')][_0x5cc5('0x3b')]=function(_0x18112b,_0x31a47b){for(var _0x4fb7ad in _0x31a47b){if(_0x18112b[_0x5cc5('0x24')](_0x4fb7ad)){_0x18112b[_0x4fb7ad]=_0x31a47b[_0x4fb7ad];}}};Realtime[_0x5cc5('0x3a')]['initAgents']=function(){var _0x1900aa=this;return function(_0x444ff5){if(_0x444ff5){freeIsNotKeyAgent(_0x444ff5,_0x1900aa[_0x5cc5('0xe')]);for(var _0x2a7bf9=0x0,_0x449929={},_0x2d07bc={};_0x2a7bf9<_0x444ff5['length'];_0x2a7bf9+=0x1){_0x449929=_0x444ff5[_0x2a7bf9];var _0x281dfe=_['isNil'](_0x449929[_0x5cc5('0x29')])?util[_0x5cc5('0x26')](_0x5cc5('0x27'),_0x449929['name']):_0x449929[_0x5cc5('0x29')];if(_[_0x5cc5('0x3c')](_0x1900aa['agents'][_0x281dfe])){_0x1900aa['agents'][_0x281dfe]=new Agent(_0x449929);}else{_0x1900aa['mergeFromDatabase'](_0x1900aa[_0x5cc5('0xe')][_0x281dfe],_0x449929);}}}return _0x1900aa[_0x5cc5('0xe')];};};Realtime[_0x5cc5('0x3a')][_0x5cc5('0x3d')]=function(){var _0x100a66=this;return function(_0x462ebc){if(_0x462ebc){freeIsNotKeySip(_0x462ebc,_0x100a66[_0x5cc5('0xf')]);for(var _0x43a2f6=0x0,_0x9a0155={},_0x59ed60={};_0x43a2f6<_0x462ebc[_0x5cc5('0x3e')];_0x43a2f6+=0x1){_0x9a0155=_0x462ebc[_0x43a2f6];if(_[_0x5cc5('0x3c')](_0x100a66['telephones'][util[_0x5cc5('0x26')](_0x5cc5('0x27'),_0x9a0155[_0x5cc5('0x2a')])])){_0x100a66[_0x5cc5('0xf')][util['format'](_0x5cc5('0x27'),_0x9a0155['name'])]=new Telephone(_0x9a0155);}else{_0x100a66['mergeFromDatabase'](_0x100a66[_0x5cc5('0xf')][util[_0x5cc5('0x26')]('SIP/%s',_0x9a0155[_0x5cc5('0x2a')])],_0x9a0155);}}}return _0x100a66[_0x5cc5('0xf')];};};Realtime[_0x5cc5('0x3a')]['initTrunks']=function(){var _0x35dcd7=this;return function(_0x240f2c){if(_0x240f2c){freeIsNotKeySip(_0x240f2c,_0x35dcd7[_0x5cc5('0x10')]);for(var _0x3239de=0x0,_0x2929a0={},_0x6e29c6={};_0x3239de<_0x240f2c[_0x5cc5('0x3e')];_0x3239de+=0x1){_0x2929a0=_0x240f2c[_0x3239de];if(_[_0x5cc5('0x3c')](_0x35dcd7[_0x5cc5('0x10')][util[_0x5cc5('0x26')](_0x5cc5('0x27'),_0x2929a0['name'])])){_0x35dcd7[_0x5cc5('0x10')][util[_0x5cc5('0x26')](_0x5cc5('0x27'),_0x2929a0[_0x5cc5('0x2a')])]=new Trunk(_0x2929a0);}else{_0x35dcd7['mergeFromDatabase'](_0x35dcd7[_0x5cc5('0x10')][util[_0x5cc5('0x26')](_0x5cc5('0x27'),_0x2929a0[_0x5cc5('0x2a')])],_0x2929a0);}}}return _0x35dcd7[_0x5cc5('0x10')];};};Realtime['prototype'][_0x5cc5('0x3f')]=function(){var _0x18d986=this;return function(_0x2c319f){if(_0x2c319f){freeIsNotKey(_0x2c319f,_0x18d986[_0x5cc5('0x11')],_0x5cc5('0x2a'));for(var _0x592577=0x0,_0x5f2acc={},_0x1dd92b={};_0x592577<_0x2c319f[_0x5cc5('0x3e')];_0x592577+=0x1){_0x5f2acc=_0x2c319f[_0x592577];if(_['isUndefined'](_0x18d986[_0x5cc5('0x11')][_0x5f2acc[_0x5cc5('0x2a')]])){_0x18d986[_0x5cc5('0x11')][_0x5f2acc[_0x5cc5('0x2a')]]=new VoiceQueue(_0x5f2acc);}else{_0x18d986[_0x5cc5('0x3b')](_0x18d986['voiceQueues'][_0x5f2acc[_0x5cc5('0x2a')]],_0x5f2acc);}}}return _0x18d986[_0x5cc5('0x11')];};};Realtime[_0x5cc5('0x3a')][_0x5cc5('0x40')]=function(){var _0x1cb796=this;return function(_0x41a468){if(_0x41a468){freeIsNotKey(_0x41a468,_0x1cb796[_0x5cc5('0x12')],'id');for(var _0x5b6c61=0x0,_0x11a51e={},_0x1406cb={};_0x5b6c61<_0x41a468[_0x5cc5('0x3e')];_0x5b6c61+=0x1){_0x11a51e=_0x41a468[_0x5b6c61];if(_[_0x5cc5('0x3c')](_0x1cb796[_0x5cc5('0x12')][_0x11a51e['id']])){_0x1cb796[_0x5cc5('0x12')][_0x11a51e['id']]=new Trigger(_0x11a51e);}else{_0x1cb796[_0x5cc5('0x3b')](_0x1cb796['triggers'][_0x11a51e['id']],_0x11a51e);}}}return _0x1cb796[_0x5cc5('0x12')];};};Realtime[_0x5cc5('0x3a')]['initTemplates']=function(){var _0x3d0cca=this;return function(_0x2b155d){if(_0x2b155d){freeIsNotKey(_0x2b155d,_0x3d0cca[_0x5cc5('0x14')],'id');for(var _0x22b695=0x0,_0x49668f={},_0x8b7c1f={};_0x22b695<_0x2b155d['length'];_0x22b695+=0x1){_0x49668f=_0x2b155d[_0x22b695];if(_[_0x5cc5('0x3c')](_0x3d0cca[_0x5cc5('0x14')][_0x49668f['id']])){_0x3d0cca['templates'][_0x49668f['id']]=new Template(_0x49668f);}else{_0x3d0cca['mergeFromDatabase'](_0x3d0cca['templates'][_0x49668f['id']],_0x49668f);}}}return _0x3d0cca[_0x5cc5('0x14')];};};Realtime['prototype'][_0x5cc5('0x41')]=function(){var _0x64e6b1=this;return function(_0x7ac494){if(_0x7ac494){freeIsNotKey(_0x7ac494,_0x64e6b1[_0x5cc5('0x42')],'id');for(var _0x451579=0x0,_0x264d46={},_0x44baba={};_0x451579<_0x7ac494['length'];_0x451579+=0x1){_0x264d46=_0x7ac494[_0x451579];if(_['isUndefined'](_0x64e6b1[_0x5cc5('0x42')][_0x264d46['id']])){_0x64e6b1['zendeskAccounts'][_0x264d46['id']]=new ZendeskAccount(_0x264d46);}else{_0x64e6b1[_0x5cc5('0x3b')](_0x64e6b1[_0x5cc5('0x42')][_0x264d46['id']],_0x264d46);}}}return _0x64e6b1['zendeskAccounts'];};};Realtime['prototype'][_0x5cc5('0x43')]=function(){var _0x556d5e=this;return function(_0x1bbe3e){if(_0x1bbe3e){freeIsNotKey(_0x1bbe3e,_0x556d5e[_0x5cc5('0x1a')],'id');for(var _0x3a7919=0x0,_0x3e7a0f={},_0x1d19d9={};_0x3a7919<_0x1bbe3e[_0x5cc5('0x3e')];_0x3a7919+=0x1){_0x3e7a0f=_0x1bbe3e[_0x3a7919];if(_[_0x5cc5('0x3c')](_0x556d5e[_0x5cc5('0x1a')][_0x3e7a0f['id']])){_0x556d5e[_0x5cc5('0x1a')][_0x3e7a0f['id']]=new SalesforceAccount(_0x3e7a0f);}else{_0x556d5e['mergeFromDatabase'](_0x556d5e[_0x5cc5('0x1a')][_0x3e7a0f['id']],_0x3e7a0f);}}}return _0x556d5e[_0x5cc5('0x1a')];};};Realtime[_0x5cc5('0x3a')][_0x5cc5('0x44')]=function(){var _0xae68e6=this;return function(_0x5d9fd3){if(_0x5d9fd3){freeIsNotKey(_0x5d9fd3,_0xae68e6['freshdeskAccounts'],'id');for(var _0x4179ed=0x0,_0x8d0cae={},_0x363508={};_0x4179ed<_0x5d9fd3[_0x5cc5('0x3e')];_0x4179ed+=0x1){_0x8d0cae=_0x5d9fd3[_0x4179ed];if(_[_0x5cc5('0x3c')](_0xae68e6[_0x5cc5('0x1c')][_0x8d0cae['id']])){_0xae68e6[_0x5cc5('0x1c')][_0x8d0cae['id']]=new FreshdeskAccount(_0x8d0cae);}else{_0xae68e6[_0x5cc5('0x3b')](_0xae68e6[_0x5cc5('0x1c')][_0x8d0cae['id']],_0x8d0cae);}}}return _0xae68e6[_0x5cc5('0x1c')];};};Realtime[_0x5cc5('0x3a')]['initZohoAccounts']=function(){var _0x4bcbff=this;return function(_0xe1ffb9){if(_0xe1ffb9){freeIsNotKey(_0xe1ffb9,_0x4bcbff[_0x5cc5('0x1d')],'id');for(var _0x4f12b5=0x0,_0x2c0b12={},_0x54d247={};_0x4f12b5<_0xe1ffb9[_0x5cc5('0x3e')];_0x4f12b5+=0x1){_0x2c0b12=_0xe1ffb9[_0x4f12b5];if(_[_0x5cc5('0x3c')](_0x4bcbff[_0x5cc5('0x1d')][_0x2c0b12['id']])){_0x4bcbff[_0x5cc5('0x1d')][_0x2c0b12['id']]=new ZohoAccount(_0x2c0b12);}else{_0x4bcbff[_0x5cc5('0x3b')](_0x4bcbff[_0x5cc5('0x1d')][_0x2c0b12['id']],_0x2c0b12);}}}return _0x4bcbff[_0x5cc5('0x1d')];};};Realtime[_0x5cc5('0x3a')][_0x5cc5('0x45')]=function(){var _0x568ba0=this;return function(_0xfbb161){if(_0xfbb161){freeIsNotKey(_0xfbb161,_0x568ba0['deskAccounts'],'id');for(var _0x1cedb3=0x0,_0x29f047={},_0x576b8b={};_0x1cedb3<_0xfbb161[_0x5cc5('0x3e')];_0x1cedb3+=0x1){_0x29f047=_0xfbb161[_0x1cedb3];if(_[_0x5cc5('0x3c')](_0x568ba0[_0x5cc5('0x1e')][_0x29f047['id']])){_0x568ba0[_0x5cc5('0x1e')][_0x29f047['id']]=new DeskAccount(_0x29f047);}else{_0x568ba0[_0x5cc5('0x3b')](_0x568ba0[_0x5cc5('0x1e')][_0x29f047['id']],_0x29f047);}}}return _0x568ba0[_0x5cc5('0x1e')];};};Realtime[_0x5cc5('0x3a')]['initSugarcrmAccounts']=function(){var _0x48f72a=this;return function(_0x35ff44){if(_0x35ff44){freeIsNotKey(_0x35ff44,_0x48f72a[_0x5cc5('0x1b')],'id');for(var _0x13806e=0x0,_0x1c0ac8={},_0x5ac990={};_0x13806e<_0x35ff44[_0x5cc5('0x3e')];_0x13806e+=0x1){_0x1c0ac8=_0x35ff44[_0x13806e];if(_[_0x5cc5('0x3c')](_0x48f72a[_0x5cc5('0x1b')][_0x1c0ac8['id']])){_0x48f72a['sugarcrmAccounts'][_0x1c0ac8['id']]=new SugarcrmAccount(_0x1c0ac8);}else{_0x48f72a[_0x5cc5('0x3b')](_0x48f72a['sugarcrmAccounts'][_0x1c0ac8['id']],_0x1c0ac8);}}}return _0x48f72a[_0x5cc5('0x1b')];};};Realtime['prototype']['initVtigerAccounts']=function(){var _0x43a19c=this;return function(_0x1421f1){if(_0x1421f1){freeIsNotKey(_0x1421f1,_0x43a19c[_0x5cc5('0x1f')],'id');for(var _0x40357f=0x0,_0xba15aa={},_0x12bc97={};_0x40357f<_0x1421f1[_0x5cc5('0x3e')];_0x40357f+=0x1){_0xba15aa=_0x1421f1[_0x40357f];if(_[_0x5cc5('0x3c')](_0x43a19c[_0x5cc5('0x1f')][_0xba15aa['id']])){_0x43a19c['vtigerAccounts'][_0xba15aa['id']]=new VtigerAccount(_0xba15aa);}else{_0x43a19c[_0x5cc5('0x3b')](_0x43a19c[_0x5cc5('0x1f')][_0xba15aa['id']],_0xba15aa);}}}return _0x43a19c[_0x5cc5('0x1f')];};};Realtime['prototype'][_0x5cc5('0x46')]=function(){var _0x1397ec=this;return function(_0x1f9747){if(_0x1f9747){freeIsNotKey(_0x1f9747,_0x1397ec[_0x5cc5('0x20')],'id');for(var _0x29e58a=0x0,_0x111fc4={},_0x4a1737={};_0x29e58a<_0x1f9747['length'];_0x29e58a+=0x1){_0x111fc4=_0x1f9747[_0x29e58a];if(_[_0x5cc5('0x3c')](_0x1397ec[_0x5cc5('0x20')][_0x111fc4['id']])){_0x1397ec[_0x5cc5('0x20')][_0x111fc4['id']]=new ServicenowAccount(_0x111fc4);}else{_0x1397ec['mergeFromDatabase'](_0x1397ec[_0x5cc5('0x20')][_0x111fc4['id']],_0x111fc4);}}}return _0x1397ec['servicenowAccounts'];};};Realtime[_0x5cc5('0x3a')][_0x5cc5('0x47')]=function(){var _0x26e8af=this;return function(_0x5c8506){if(_0x5c8506){freeIsNotKey(_0x5c8506,_0x26e8af[_0x5cc5('0x21')],'id');for(var _0x5cbc45=0x0,_0x3f41a1={},_0x5eadd5={};_0x5cbc45<_0x5c8506['length'];_0x5cbc45+=0x1){_0x3f41a1=_0x5c8506[_0x5cbc45];if(_[_0x5cc5('0x3c')](_0x26e8af[_0x5cc5('0x21')][_0x3f41a1['id']])){_0x26e8af[_0x5cc5('0x21')][_0x3f41a1['id']]=new Dynamics365Account(_0x3f41a1);}else{_0x26e8af[_0x5cc5('0x3b')](_0x26e8af['dynamics365Accounts'][_0x3f41a1['id']],_0x3f41a1);}}}return _0x26e8af[_0x5cc5('0x21')];};};Realtime[_0x5cc5('0x3a')][_0x5cc5('0x48')]=function(){var _0x5a2a91=this;return function(_0x14b890){if(_0x14b890){freeIsNotKey(_0x14b890,_0x5a2a91[_0x5cc5('0x22')],'id');for(var _0xd7c58a=0x0,_0x5ea452={},_0x2167d2={};_0xd7c58a<_0x14b890[_0x5cc5('0x3e')];_0xd7c58a+=0x1){_0x5ea452=_0x14b890[_0xd7c58a];if(_[_0x5cc5('0x3c')](_0x5a2a91[_0x5cc5('0x22')][_0x5ea452['id']])){_0x5a2a91[_0x5cc5('0x22')][_0x5ea452['id']]=new FreshsalesAccount(_0x5ea452);}else{_0x5a2a91[_0x5cc5('0x3b')](_0x5a2a91[_0x5cc5('0x22')][_0x5ea452['id']],_0x5ea452);}}}return _0x5a2a91[_0x5cc5('0x22')];};};Realtime[_0x5cc5('0x3a')][_0x5cc5('0x49')]=function(){var _0x4c9680=this;return function(_0x46ef2b){for(var _0x41af8b=0x0;_0x41af8b<_0x46ef2b[_0x5cc5('0x3e')];_0x41af8b+=0x1){_[_0x5cc5('0x4a')](_0x4c9680[_0x5cc5('0x11')][_0x46ef2b[_0x41af8b][_0x5cc5('0x2a')]],_0x46ef2b[_0x41af8b]);}return _0x4c9680[_0x5cc5('0x11')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x58aae4=this;return function(_0x16c402){clearVoiceQueues(_0x58aae4[_0x5cc5('0x11')]);if(_0x16c402){_0x16c402=_[_0x5cc5('0x4b')](_0x16c402,'uniqueid');for(var _0x765110 in _0x16c402){if(_0x16c402[_0x5cc5('0x24')](_0x765110)){var _0x3417fd={};for(var _0x4c7508=0x0;_0x4c7508<_0x16c402[_0x765110][_0x5cc5('0x3e')];_0x4c7508+=0x1){var _0x43cf03=_0x16c402[_0x765110][_0x4c7508]['queue'];if(_0x58aae4['voiceQueues'][_0x43cf03]){if(_0x16c402[_0x765110][_0x4c7508][_0x5cc5('0x4c')]){_0x58aae4[_0x5cc5('0x11')][_0x43cf03][_0x5cc5('0x4d')]+=0x1;}if(_0x16c402[_0x765110][_0x4c7508][_0x5cc5('0x4e')]){_0x58aae4[_0x5cc5('0x11')][_0x43cf03][_0x5cc5('0x31')]+=0x1;}_0x58aae4[_0x5cc5('0x11')][_0x43cf03]['sumHoldTime']+=moment(_0x16c402[_0x765110][_0x4c7508]['queuecallerleaveAt'])[_0x5cc5('0x4f')](moment(_0x16c402[_0x765110][_0x4c7508]['queuecallerjoinAt']),_0x5cc5('0x50'))||0x0;if(_0x4c7508===_0x16c402[_0x765110][_0x5cc5('0x3e')]-0x1){_0x58aae4[_0x5cc5('0x11')][_0x43cf03][_0x5cc5('0x2d')]+=moment(_0x16c402[_0x765110][_0x4c7508]['queuecallercompleteAt']||_0x16c402[_0x765110][_0x4c7508]['queuecallerabandonAt']||_0x16c402[_0x765110][_0x4c7508][_0x5cc5('0x51')])[_0x5cc5('0x4f')](moment(_0x16c402[_0x765110][_0x4c7508]['queuecallerjoinAt']),_0x5cc5('0x50'))||0x0;_0x58aae4['voiceQueues'][_0x43cf03][_0x5cc5('0x2b')]+=0x1;if(_0x16c402[_0x765110][_0x4c7508]['queuecallercomplete']){_0x58aae4['voiceQueues'][_0x43cf03]['answered']+=0x1;_0x58aae4[_0x5cc5('0x11')][_0x43cf03][_0x5cc5('0x2e')]+=moment(_0x16c402[_0x765110][_0x4c7508][_0x5cc5('0x52')])['diff'](moment(_0x16c402[_0x765110][_0x4c7508][_0x5cc5('0x53')]),_0x5cc5('0x50'))||0x0;}}else{_0x58aae4[_0x5cc5('0x11')][_0x43cf03][_0x5cc5('0x2d')]+=_0x58aae4[_0x5cc5('0x11')][_0x43cf03][_0x5cc5('0x32')]||0x0;}}}}}}return _0x58aae4[_0x5cc5('0x11')];};};Realtime['prototype']['initVoiceCallReports']=function(){var _0x2031a9=this;return function(_0x188674){clearVoiceCallReports(_0x2031a9['outbound']);if(_0x188674){for(var _0x5a4c97=0x0;_0x5a4c97<_0x188674[_0x5cc5('0x3e')];_0x5a4c97+=0x1){_0x2031a9[_0x5cc5('0x54')][_0x5cc5('0x2b')]+=0x1;_0x2031a9[_0x5cc5('0x54')]['sumDuration']+=_0x188674[_0x5a4c97][_0x5cc5('0x55')];if(_0x188674[_0x5a4c97][_0x5cc5('0x56')]===_0x5cc5('0x57')){_0x2031a9[_0x5cc5('0x54')][_0x5cc5('0x2c')]+=0x1;_0x2031a9[_0x5cc5('0x54')][_0x5cc5('0x32')]+=_0x188674[_0x5a4c97][_0x5cc5('0x55')]-_0x188674[_0x5a4c97]['billableseconds']||0x0;_0x2031a9[_0x5cc5('0x54')][_0x5cc5('0x2e')]+=_0x188674[_0x5a4c97][_0x5cc5('0x58')];}}}return _0x2031a9['outbound'];};};Realtime[_0x5cc5('0x3a')][_0x5cc5('0x59')]=function(){var _0x457cae=this;return function(_0x2dfee3){if(_0x2dfee3){freeIsNotKey(_0x2dfee3,_0x457cae[_0x5cc5('0x13')],_0x5cc5('0x2a'));for(var _0x43934a=0x0,_0xd23a78={};_0x43934a<_0x2dfee3[_0x5cc5('0x3e')];_0x43934a+=0x1){_0xd23a78=_0x2dfee3[_0x43934a];if(_[_0x5cc5('0x3c')](_0x457cae[_0x5cc5('0x13')][_0xd23a78['name']])){_0x457cae[_0x5cc5('0x13')][_0xd23a78[_0x5cc5('0x2a')]]=new Campaign(_0xd23a78);}else{_0x457cae[_0x5cc5('0x3b')](_0x457cae[_0x5cc5('0x13')][_0xd23a78[_0x5cc5('0x2a')]],_0xd23a78);_0x457cae[_0x5cc5('0x13')][_0xd23a78[_0x5cc5('0x2a')]][_0x5cc5('0x5a')]=_0xd23a78[_0x5cc5('0x5b')]?_0xd23a78[_0x5cc5('0x5b')]['name']:undefined;}}}return _0x457cae[_0x5cc5('0x13')];};};Realtime[_0x5cc5('0x3a')][_0x5cc5('0x5c')]=function(){var _0xc653e9=this;return function(_0x34ac73){if(_0x34ac73){freeIsNotKey(_0x34ac73,_0xc653e9[_0x5cc5('0x15')],'id');for(var _0x4556d1=0x0,_0x5b1be0={};_0x4556d1<_0x34ac73['length'];_0x4556d1+=0x1){_0x5b1be0=_0x34ac73[_0x4556d1];if(_[_0x5cc5('0x3c')](_0xc653e9[_0x5cc5('0x15')][_0x5b1be0['id']])){_0xc653e9[_0x5cc5('0x15')][_0x5b1be0['id']]=new VoiceExtension(_0x5b1be0);}else{_0xc653e9['mergeFromDatabase'](_0xc653e9[_0x5cc5('0x15')][_0x5b1be0['id']],_0x5b1be0);}}}return _0xc653e9['voiceExtensions'];};};Realtime['prototype'][_0x5cc5('0x5d')]=function(){var _0x52a900=this;return function(_0x1ca829){clearCampaigns(_0x52a900[_0x5cc5('0x13')]);for(var _0x219f30=0x0;_0x219f30<_0x1ca829['length'];_0x219f30+=0x1){_['merge'](_0x52a900[_0x5cc5('0x13')][_0x1ca829[_0x219f30][_0x5cc5('0x2a')]],_0x1ca829[_0x219f30]);}return _0x52a900['campaigns'];};};Realtime['prototype'][_0x5cc5('0x5e')]=function(){var _0x311902=this;return function(_0x4b483c){if(_0x4b483c){freeIsNotKey(_0x4b483c,_0x311902[_0x5cc5('0x23')],'id');for(var _0x1f4e49=0x0,_0x4f6e75={},_0x313a79={};_0x1f4e49<_0x4b483c[_0x5cc5('0x3e')];_0x1f4e49+=0x1){_0x4f6e75=_0x4b483c[_0x1f4e49];if(_[_0x5cc5('0x3c')](_0x311902[_0x5cc5('0x23')][_0x4f6e75['id']])){_0x311902[_0x5cc5('0x23')][_0x4f6e75['id']]=new FaxAccount(_0x4f6e75);}else{_0x311902[_0x5cc5('0x3b')](_0x311902['faxAccounts'][_0x4f6e75['id']],_0x4f6e75);}}}return _0x311902[_0x5cc5('0x23')];};};module[_0x5cc5('0x5f')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index efc348d..9daf007 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 _0x6f51=['accountcode','name','find','SIP/%s','assigned','lastAssignedTo','isNil','format','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','match','destination','exten','type','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','channel','disposition','ANSWERED','connectedlinenum','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','create','monitor','monitors','length','monitorFilename','createdAt','connectedlinename','xcally-motion-dialer','startsWith','indexOf','mobile','phone','substring','lastIndexOf','membername','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent'];(function(_0x3f6123,_0x283617){var _0x532579=function(_0xdddf91){while(--_0xdddf91){_0x3f6123['push'](_0x3f6123['shift']());}};_0x532579(++_0x283617);}(_0x6f51,0x13e));var _0x16f5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6f51[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x16f5('0x0'));var moment=require(_0x16f5('0x1'));var util=require(_0x16f5('0x2'));var config=require(_0x16f5('0x3'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0x16f5('0x4'));var RpcVoiceCallReport=require(_0x16f5('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x16f5('0x6'));var RpcVoiceQueueReport=require(_0x16f5('0x7'));var RpcVoiceRecording=require(_0x16f5('0x8'));var RpcVoiceTransferReport=require(_0x16f5('0x9'));var VoiceQueueReport=require(_0x16f5('0xa'));var VoiceCallReport=require(_0x16f5('0xb'));var VoiceAgentReport=require(_0x16f5('0xc'));var VoiceDialReport=require(_0x16f5('0xd'));var UserReport=require(_0x16f5('0xe'));function Report(_0x1b3d60){this['realtime']=_0x1b3d60;this[_0x16f5('0xf')]=_0x1b3d60[_0x16f5('0xf')];this['telephones']=_0x1b3d60[_0x16f5('0x10')];}Report[_0x16f5('0x11')]['sync']=function(_0x45a42b){var _0x53744b=new VoiceQueueReport(this['realtime']);var _0x276466=new VoiceAgentReport(this['realtime']);var _0x465474=new VoiceDialReport(this[_0x16f5('0x12')]);var _0xbdee85=new VoiceCallReport(this[_0x16f5('0x12')]);var _0x1c0f2b=new UserReport(this[_0x16f5('0x12')]);if(config[_0x16f5('0x13')]&&config['xdr'][_0x16f5('0x14')]){ami['on'](_0x16f5('0x15'),this[_0x16f5('0x16')][_0x16f5('0x17')](this));ami['on']('custom:voiceCallReport',this[_0x16f5('0x18')]['bind'](this));ami['on'](_0x16f5('0x19'),this[_0x16f5('0x1a')][_0x16f5('0x17')](this));ami['on'](_0x16f5('0x1b'),this[_0x16f5('0x1c')][_0x16f5('0x17')](this));ami['on'](_0x16f5('0x1d'),this[_0x16f5('0x1e')][_0x16f5('0x17')](this));ami['on'](_0x16f5('0x1f'),this[_0x16f5('0x20')]['bind'](this));}};Report[_0x16f5('0x11')][_0x16f5('0x21')]=function(_0x2d7ad2){var _0x4ecfc3;_0x4ecfc3=_['find'](this[_0x16f5('0xf')],function(_0x365325){return _0x365325[_0x16f5('0x22')]==_0x2d7ad2||_0x365325[_0x16f5('0x23')]==_0x2d7ad2;});if(_['isNil'](_0x4ecfc3)){var _0x47a92d=_[_0x16f5('0x24')](this[_0x16f5('0x10')],function(_0x38ff88){return _0x38ff88[_0x16f5('0x22')]==_0x2d7ad2||_0x38ff88[_0x16f5('0x23')]==_0x2d7ad2;});if(_0x47a92d){_0x4ecfc3=_[_0x16f5('0x24')](this[_0x16f5('0xf')],function(_0x162d11){return _0x162d11['interface']==util['format'](_0x16f5('0x25'),_0x47a92d[_0x16f5('0x23')]);});}}return _0x4ecfc3;};Report[_0x16f5('0x11')][_0x16f5('0x16')]=function(_0x4a72ab){for(var _0x3fe4c5=0x0;_0x3fe4c5<_0x4a72ab['length'];_0x3fe4c5+=0x1){var _0x2e6673=this[_0x16f5('0x21')](_0x4a72ab[_0x3fe4c5]['connectedlinenum']);if(_0x2e6673){_0x4a72ab[_0x3fe4c5][_0x16f5('0x22')]=_0x2e6673['accountcode'];_0x4a72ab[_0x3fe4c5][_0x16f5('0x26')]=!![];_0x4a72ab[_0x3fe4c5][_0x16f5('0x27')]=_0x2e6673[_0x16f5('0x23')];_0x4a72ab[_0x3fe4c5]['interface']=_[_0x16f5('0x28')](_0x2e6673['interface'])?util[_0x16f5('0x29')](_0x16f5('0x25'),_0x2e6673[_0x16f5('0x23')]):_0x2e6673[_0x16f5('0x2a')];if(_0x4a72ab[_0x3fe4c5][_0x16f5('0x2b')]){_0x4a72ab[_0x3fe4c5][_0x16f5('0x2c')]=moment()['format'](_0x16f5('0x2d'));}if(_0x4a72ab[_0x3fe4c5]['queuecallerexit']){_0x4a72ab[_0x3fe4c5][_0x16f5('0x2e')]=moment()[_0x16f5('0x29')](_0x16f5('0x2d'));}RpcMemberReport[_0x16f5('0x16')](_0x4a72ab[_0x3fe4c5]);}RpcVoiceQueueReport['create'](_0x4a72ab[_0x3fe4c5]);}};function extractCalleridNumber(_0x4a4e57){var _0x27163a=_0x4a4e57[_0x16f5('0x2f')](/<(.*?)>/);return _0x27163a?_0x27163a[0x1]:_0x4a4e57;}Report[_0x16f5('0x11')][_0x16f5('0x18')]=function(_0x39c7e0){_0x39c7e0[_0x16f5('0x30')]=_0x39c7e0['destination']||_0x39c7e0[_0x16f5('0x31')];if(_0x39c7e0[_0x16f5('0x32')]=='dialer'){_0x39c7e0[_0x16f5('0x33')]=_0x16f5('0x34');_0x39c7e0[_0x16f5('0x35')]=_0x39c7e0[_0x16f5('0x34')];if(_0x39c7e0[_0x16f5('0x36')]==_0x16f5('0x37')){_0x39c7e0[_0x16f5('0x22')]='';_0x39c7e0['destination']=extractCalleridNumber(_0x39c7e0[_0x16f5('0x38')]);}else if(_0x39c7e0['context']==_0x16f5('0x39')){if(_0x39c7e0[_0x16f5('0x30')]==_0x16f5('0x3a')){_0x39c7e0['destination']=extractCalleridNumber(_0x39c7e0[_0x16f5('0x3b')]);_0x39c7e0[_0x16f5('0x3c')]=_0x39c7e0[_0x16f5('0x3d')];_0x39c7e0['destinationchannel']=[_0x39c7e0[_0x16f5('0x3e')],_0x39c7e0['channel']=_0x39c7e0['destinationchannel']][0x0];_0x39c7e0[_0x16f5('0x38')]=_0x39c7e0[_0x16f5('0x3b')];}else{_0x39c7e0[_0x16f5('0x30')]=_0x39c7e0[_0x16f5('0x3c')];_0x39c7e0[_0x16f5('0x3c')]=_0x39c7e0['originatecalleridnum'];if(_0x39c7e0[_0x16f5('0x3f')]==_0x16f5('0x40')){_0x39c7e0['accountcode']=_0x39c7e0[_0x16f5('0x41')];}else{_0x39c7e0[_0x16f5('0x22')]='';}}}}else{_0x39c7e0[_0x16f5('0x38')]=util[_0x16f5('0x29')]('\x22%s\x22\x20<%s>',_0x39c7e0[_0x16f5('0x42')],_0x39c7e0[_0x16f5('0x3c')]);}if(RpcVoiceTransferReport[_0x16f5('0x43')][_0x39c7e0[_0x16f5('0x44')]]){var _0x38542a=RpcVoiceTransferReport[_0x16f5('0x43')][_0x39c7e0[_0x16f5('0x44')]];_0x38542a[_0x16f5('0x45')]=_0x39c7e0[_0x16f5('0x46')];RpcVoiceTransferReport['blindTransfer'](_0x38542a);delete RpcVoiceTransferReport[_0x16f5('0x43')][_0x39c7e0[_0x16f5('0x44')]];}RpcVoiceCallReport[_0x16f5('0x47')](_0x39c7e0);if(_0x39c7e0[_0x16f5('0x48')]){for(var _0x169054=0x0;_0x169054<_0x39c7e0[_0x16f5('0x49')][_0x16f5('0x4a')];_0x169054+=0x1){_0x39c7e0[_0x16f5('0x4b')]=_0x39c7e0['monitors'][_0x169054]['filename'];_0x39c7e0[_0x16f5('0x4c')]=_0x39c7e0[_0x16f5('0x49')][_0x169054][_0x16f5('0x4c')];if(_0x39c7e0[_0x16f5('0x31')]==_0x16f5('0x3a')){_0x39c7e0[_0x16f5('0x3c')]=_0x39c7e0[_0x16f5('0x41')];_0x39c7e0['calleridname']=_0x39c7e0['connectedlinename'];_0x39c7e0['connectedlinenum']=_0x39c7e0[_0x16f5('0x22')];_0x39c7e0[_0x16f5('0x4d')]=_0x39c7e0['membername'];_0x39c7e0['exten']=_0x39c7e0['originatecalleridnum'];}else if(_0x39c7e0[_0x16f5('0x31')]==_0x16f5('0x4e')){_0x39c7e0['calleridnum']=_0x39c7e0['destination'];_0x39c7e0['exten']=_0x39c7e0[_0x16f5('0x3d')];}RpcVoiceRecording['create'](_0x39c7e0);}}};Report[_0x16f5('0x11')][_0x16f5('0x1a')]=function(_0x288dbf){if(_['isArray'](_0x288dbf)){_0x288dbf['forEach'](function(_0x2539f3){RpcVoiceAgentReport['create'](_0x2539f3);});}else{RpcVoiceAgentReport[_0x16f5('0x47')](_0x288dbf);}};Report[_0x16f5('0x11')][_0x16f5('0x1c')]=function(_0x3153c3){RpcVoiceDialReport[_0x16f5('0x47')](_0x3153c3);var _0x20569f;var _0x3e6bf2;var _0x2fa20b=_0x3153c3[_0x16f5('0x3e')];if(_[_0x16f5('0x4f')](_0x2fa20b,'Local')){_0x3e6bf2=_0x2fa20b['substring'](_0x2fa20b[_0x16f5('0x50')]('/')+0x1,_0x2fa20b['indexOf']('@'));_0x20569f=_['find'](this['agents'],function(_0x241e6e){return _0x241e6e[_0x16f5('0x51')]==_0x3e6bf2||_0x241e6e[_0x16f5('0x52')]==_0x3e6bf2||_0x241e6e[_0x16f5('0x22')]==_0x3e6bf2;});}else{_0x3e6bf2=_0x2fa20b[_0x16f5('0x53')](_0x2fa20b[_0x16f5('0x50')]('/')+0x1,_0x2fa20b[_0x16f5('0x54')]('-'));_0x20569f=this['findAgent'](_0x3e6bf2);}if(_0x20569f){_0x3153c3[_0x16f5('0x2a')]=_[_0x16f5('0x28')](_0x20569f['interface'])?util['format']('SIP/%s',_0x20569f[_0x16f5('0x23')]):_0x20569f[_0x16f5('0x2a')];_0x3153c3[_0x16f5('0x55')]=_0x20569f[_0x16f5('0x23')];_0x3153c3[_0x16f5('0x22')]=_0x20569f[_0x16f5('0x22')];RpcMemberReport[_0x16f5('0x1c')](_0x3153c3);}};Report[_0x16f5('0x11')][_0x16f5('0x1e')]=function(_0x1aee3a){RpcVoiceTransferReport[_0x16f5('0x43')][_0x1aee3a[_0x16f5('0x56')]]=_0x1aee3a;};Report[_0x16f5('0x11')][_0x16f5('0x20')]=function(_0x460590){RpcVoiceTransferReport[_0x16f5('0x20')](_0x460590);};module[_0x16f5('0x57')]=Report; \ No newline at end of file +var _0x8d73=['interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridnum','originatecalleridnum','destinationchannel','channel','calleridpreview','disposition','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','uniqueid','monitor','monitors','monitorFilename','connectedlinename','xcally-motion-dialer','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','membername','transfererlinkedid','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','isNil','telephones','name','format','SIP/%s','length','connectedlinenum','assigned'];(function(_0x5351cd,_0x218c6d){var _0x39c1e7=function(_0x15230c){while(--_0x15230c){_0x5351cd['push'](_0x5351cd['shift']());}};_0x39c1e7(++_0x218c6d);}(_0x8d73,0xdc));var _0x38d7=function(_0x3491f5,_0x222f0c){_0x3491f5=_0x3491f5-0x0;var _0x26e38a=_0x8d73[_0x3491f5];return _0x26e38a;};'use strict';var _=require(_0x38d7('0x0'));var moment=require(_0x38d7('0x1'));var util=require(_0x38d7('0x2'));var config=require(_0x38d7('0x3'));var ami=require(_0x38d7('0x4'));var RpcVoiceAgentReport=require(_0x38d7('0x5'));var RpcVoiceCallReport=require(_0x38d7('0x6'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x38d7('0x7'));var RpcVoiceQueueReport=require(_0x38d7('0x8'));var RpcVoiceRecording=require(_0x38d7('0x9'));var RpcVoiceTransferReport=require(_0x38d7('0xa'));var VoiceQueueReport=require(_0x38d7('0xb'));var VoiceCallReport=require(_0x38d7('0xc'));var VoiceAgentReport=require(_0x38d7('0xd'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x38d7('0xe'));function Report(_0x395e6a){this[_0x38d7('0xf')]=_0x395e6a;this[_0x38d7('0x10')]=_0x395e6a[_0x38d7('0x10')];this['telephones']=_0x395e6a['telephones'];}Report[_0x38d7('0x11')][_0x38d7('0x12')]=function(_0x179b1a){var _0x1db768=new VoiceQueueReport(this['realtime']);var _0x3ebbbc=new VoiceAgentReport(this[_0x38d7('0xf')]);var _0x40faa4=new VoiceDialReport(this[_0x38d7('0xf')]);var _0x23ede4=new VoiceCallReport(this[_0x38d7('0xf')]);var _0x47dd2b=new UserReport(this[_0x38d7('0xf')]);if(config[_0x38d7('0x13')]&&config[_0x38d7('0x13')][_0x38d7('0x14')]){ami['on'](_0x38d7('0x15'),this[_0x38d7('0x16')][_0x38d7('0x17')](this));ami['on'](_0x38d7('0x18'),this[_0x38d7('0x19')][_0x38d7('0x17')](this));ami['on'](_0x38d7('0x1a'),this[_0x38d7('0x1b')]['bind'](this));ami['on']('custom:voiceDialReport',this[_0x38d7('0x1c')][_0x38d7('0x17')](this));ami['on'](_0x38d7('0x1d'),this[_0x38d7('0x1e')][_0x38d7('0x17')](this));ami['on'](_0x38d7('0x1f'),this[_0x38d7('0x20')][_0x38d7('0x17')](this));}};Report[_0x38d7('0x11')][_0x38d7('0x21')]=function(_0x490fe8){var _0x42e317;_0x42e317=_[_0x38d7('0x22')](this[_0x38d7('0x10')],function(_0x1cd111){return _0x1cd111[_0x38d7('0x23')]==_0x490fe8||_0x1cd111['name']==_0x490fe8;});if(_[_0x38d7('0x24')](_0x42e317)){var _0x913a75=_['find'](this[_0x38d7('0x25')],function(_0x301691){return _0x301691[_0x38d7('0x23')]==_0x490fe8||_0x301691[_0x38d7('0x26')]==_0x490fe8;});if(_0x913a75){_0x42e317=_[_0x38d7('0x22')](this[_0x38d7('0x10')],function(_0x44f7e9){return _0x44f7e9['interface']==util[_0x38d7('0x27')](_0x38d7('0x28'),_0x913a75[_0x38d7('0x26')]);});}}return _0x42e317;};Report[_0x38d7('0x11')]['voiceQueueReport']=function(_0x45313e){for(var _0x3c547c=0x0;_0x3c547c<_0x45313e[_0x38d7('0x29')];_0x3c547c+=0x1){var _0x12f429=this[_0x38d7('0x21')](_0x45313e[_0x3c547c][_0x38d7('0x2a')]);if(_0x12f429){_0x45313e[_0x3c547c][_0x38d7('0x23')]=_0x12f429[_0x38d7('0x23')];_0x45313e[_0x3c547c][_0x38d7('0x2b')]=!![];_0x45313e[_0x3c547c]['lastAssignedTo']=_0x12f429[_0x38d7('0x26')];_0x45313e[_0x3c547c][_0x38d7('0x2c')]=_[_0x38d7('0x24')](_0x12f429['interface'])?util[_0x38d7('0x27')]('SIP/%s',_0x12f429[_0x38d7('0x26')]):_0x12f429['interface'];if(_0x45313e[_0x3c547c][_0x38d7('0x2d')]){_0x45313e[_0x3c547c][_0x38d7('0x2e')]=moment()[_0x38d7('0x27')](_0x38d7('0x2f'));}if(_0x45313e[_0x3c547c][_0x38d7('0x30')]){_0x45313e[_0x3c547c][_0x38d7('0x31')]=moment()['format'](_0x38d7('0x2f'));}RpcMemberReport['voiceQueueReport'](_0x45313e[_0x3c547c]);}RpcVoiceQueueReport[_0x38d7('0x32')](_0x45313e[_0x3c547c]);}};function extractCalleridNumber(_0x3a54b3){var _0x27b7f7=_0x3a54b3['match'](/<(.*?)>/);return _0x27b7f7?_0x27b7f7[0x1]:_0x3a54b3;}Report['prototype'][_0x38d7('0x19')]=function(_0x5202c4){_0x5202c4[_0x38d7('0x33')]=_0x5202c4[_0x38d7('0x33')]||_0x5202c4[_0x38d7('0x34')];if(_0x5202c4[_0x38d7('0x35')]==_0x38d7('0x36')){_0x5202c4[_0x38d7('0x37')]=_0x38d7('0x38');_0x5202c4[_0x38d7('0x39')]=_0x5202c4['queue'];if(_0x5202c4[_0x38d7('0x3a')]==_0x38d7('0x3b')){_0x5202c4[_0x38d7('0x23')]='';_0x5202c4[_0x38d7('0x33')]=extractCalleridNumber(_0x5202c4[_0x38d7('0x3c')]);}else if(_0x5202c4[_0x38d7('0x3a')]==_0x38d7('0x3d')){if(_0x5202c4[_0x38d7('0x33')]==_0x38d7('0x3e')){_0x5202c4[_0x38d7('0x33')]=extractCalleridNumber(_0x5202c4['calleridpreview']);_0x5202c4[_0x38d7('0x3f')]=_0x5202c4[_0x38d7('0x40')];_0x5202c4[_0x38d7('0x41')]=[_0x5202c4[_0x38d7('0x42')],_0x5202c4['channel']=_0x5202c4[_0x38d7('0x41')]][0x0];_0x5202c4[_0x38d7('0x3c')]=_0x5202c4[_0x38d7('0x43')];}else{_0x5202c4[_0x38d7('0x33')]=_0x5202c4[_0x38d7('0x3f')];_0x5202c4['calleridnum']=_0x5202c4[_0x38d7('0x40')];if(_0x5202c4[_0x38d7('0x44')]=='ANSWERED'){_0x5202c4[_0x38d7('0x23')]=_0x5202c4['connectedlinenum'];}else{_0x5202c4[_0x38d7('0x23')]='';}}}}else{_0x5202c4[_0x38d7('0x3c')]=util[_0x38d7('0x27')](_0x38d7('0x45'),_0x5202c4[_0x38d7('0x46')],_0x5202c4[_0x38d7('0x3f')]);}if(RpcVoiceTransferReport[_0x38d7('0x47')][_0x5202c4[_0x38d7('0x48')]]){var _0x57584c=RpcVoiceTransferReport[_0x38d7('0x47')][_0x5202c4[_0x38d7('0x48')]];_0x57584c['transfereelinkedid']=_0x5202c4[_0x38d7('0x49')];RpcVoiceTransferReport[_0x38d7('0x1e')](_0x57584c);delete RpcVoiceTransferReport[_0x38d7('0x47')][_0x5202c4[_0x38d7('0x48')]];}RpcVoiceCallReport[_0x38d7('0x32')](_0x5202c4);if(_0x5202c4[_0x38d7('0x4a')]){for(var _0x3f0831=0x0;_0x3f0831<_0x5202c4[_0x38d7('0x4b')]['length'];_0x3f0831+=0x1){_0x5202c4[_0x38d7('0x4c')]=_0x5202c4['monitors'][_0x3f0831]['filename'];_0x5202c4['createdAt']=_0x5202c4[_0x38d7('0x4b')][_0x3f0831]['createdAt'];if(_0x5202c4[_0x38d7('0x34')]==_0x38d7('0x3e')){_0x5202c4[_0x38d7('0x3f')]=_0x5202c4[_0x38d7('0x2a')];_0x5202c4[_0x38d7('0x46')]=_0x5202c4['connectedlinename'];_0x5202c4[_0x38d7('0x2a')]=_0x5202c4[_0x38d7('0x23')];_0x5202c4[_0x38d7('0x4d')]=_0x5202c4['membername'];_0x5202c4[_0x38d7('0x34')]=_0x5202c4['originatecalleridnum'];}else if(_0x5202c4[_0x38d7('0x34')]==_0x38d7('0x4e')){_0x5202c4[_0x38d7('0x3f')]=_0x5202c4[_0x38d7('0x33')];_0x5202c4[_0x38d7('0x34')]=_0x5202c4[_0x38d7('0x40')];}RpcVoiceRecording[_0x38d7('0x32')](_0x5202c4);}}};Report['prototype'][_0x38d7('0x1b')]=function(_0x482697){if(_['isArray'](_0x482697)){_0x482697[_0x38d7('0x4f')](function(_0x45471c){RpcVoiceAgentReport[_0x38d7('0x32')](_0x45471c);});}else{RpcVoiceAgentReport[_0x38d7('0x32')](_0x482697);}};Report[_0x38d7('0x11')][_0x38d7('0x1c')]=function(_0x43d33d){RpcVoiceDialReport['create'](_0x43d33d);var _0x1e578e;var _0x302e56;var _0x2bf833=_0x43d33d[_0x38d7('0x42')];if(_[_0x38d7('0x50')](_0x2bf833,'Local')){_0x302e56=_0x2bf833[_0x38d7('0x51')](_0x2bf833[_0x38d7('0x52')]('/')+0x1,_0x2bf833['indexOf']('@'));_0x1e578e=_[_0x38d7('0x22')](this['agents'],function(_0x521a33){return _0x521a33[_0x38d7('0x53')]==_0x302e56||_0x521a33[_0x38d7('0x54')]==_0x302e56||_0x521a33['accountcode']==_0x302e56;});}else{_0x302e56=_0x2bf833[_0x38d7('0x51')](_0x2bf833[_0x38d7('0x52')]('/')+0x1,_0x2bf833[_0x38d7('0x55')]('-'));_0x1e578e=this['findAgent'](_0x302e56);}if(_0x1e578e){_0x43d33d[_0x38d7('0x2c')]=_[_0x38d7('0x24')](_0x1e578e[_0x38d7('0x2c')])?util[_0x38d7('0x27')]('SIP/%s',_0x1e578e[_0x38d7('0x26')]):_0x1e578e[_0x38d7('0x2c')];_0x43d33d[_0x38d7('0x56')]=_0x1e578e[_0x38d7('0x26')];_0x43d33d['accountcode']=_0x1e578e[_0x38d7('0x23')];RpcMemberReport[_0x38d7('0x1c')](_0x43d33d);}};Report[_0x38d7('0x11')]['blindTransfer']=function(_0x55d83f){RpcVoiceTransferReport[_0x38d7('0x47')][_0x55d83f[_0x38d7('0x57')]]=_0x55d83f;};Report[_0x38d7('0x11')][_0x38d7('0x20')]=function(_0x4ce3d6){RpcVoiceTransferReport['attendedTransfer'](_0x4ce3d6);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index d1ba251..a7f6b8c 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 _0x4df5=['actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','local','toLowerCase','inuse','device','stateTime','toNumber','updateStatusRealtime','telephone:%s','telephone:save','startsWith','Local','substring','indexOf','phone','accountcode','peerstatus','address','[userReport][peerstatus]','peer','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','../ami','redis','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','username','debug','[userReport][registry]','inspect','find','stateRegistry','state','omit','event'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4df5,0x140));var _0x54df=function(_0x57ac48,_0x283032){_0x57ac48=_0x57ac48-0x0;var _0x13f026=_0x4df5[_0x57ac48];return _0x13f026;};'use strict';var _=require(_0x54df('0x0'));var moment=require(_0x54df('0x1'));var util=require(_0x54df('0x2'));var Redis=require(_0x54df('0x3'));var BPromise=require(_0x54df('0x4'));var config=require(_0x54df('0x5'));var logger=require(_0x54df('0x6'))('ami');var ami=require(_0x54df('0x7'));config[_0x54df('0x8')]=_['defaults'](config[_0x54df('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x54df('0x8')]));function UserReport(_0x1ea6e3){this[_0x54df('0x9')]=_0x1ea6e3[_0x54df('0x9')];this['agents']=_0x1ea6e3[_0x54df('0xa')];this[_0x54df('0xb')]=_0x1ea6e3[_0x54df('0xb')];ami['on'](_0x54df('0xc'),this[_0x54df('0xd')][_0x54df('0xe')](this));ami['on']('registry',this[_0x54df('0xd')][_0x54df('0xe')](this));ami['on'](_0x54df('0xf'),this[_0x54df('0x10')][_0x54df('0xe')](this));ami['on']('peerstatus',this['syncPeerStatus'][_0x54df('0xe')](this));return this[_0x54df('0x11')]();}function showSipRegistrations(){Promise[_0x54df('0x12')]()[_0x54df('0x13')](ami[_0x54df('0x14')]())[_0x54df('0x15')](function(_0x184c1b){logger[_0x54df('0x16')](_0x54df('0x17'),util['inspect'](_0x184c1b,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x54df('0x12')]()[_0x54df('0x13')](ami['actionDeviceStateList']())[_0x54df('0x15')](function(_0x63af08){logger[_0x54df('0x16')](_0x54df('0x18'),util['inspect'](_0x63af08,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x54df('0x13')](ami[_0x54df('0x19')]())['catch'](function(_0x4c0bef){logger[_0x54df('0x16')](_0x54df('0x1a'),util['inspect'](_0x4c0bef,{'showHidden':![],'depth':null}));});}UserReport[_0x54df('0x1b')][_0x54df('0x11')]=function(){setInterval(function(){BPromise[_0x54df('0x12')]()[_0x54df('0x13')](showSipRegistrations())[_0x54df('0x13')](listDeviceStates())[_0x54df('0x13')](showPeersStatus());},0x32c8);};UserReport['prototype']['isNotNull']=function(_0x3a9639){return _0x3a9639!==null&&!_[_0x54df('0x1c')](_0x3a9639);};UserReport[_0x54df('0x1b')]['emit']=function(_0xd6d78c,_0x59b32d,_0x5913e7){io['to'](_0xd6d78c)[_0x54df('0x1d')](_0x59b32d,_0x5913e7);};UserReport[_0x54df('0x1b')][_0x54df('0xd')]=function(_0x2c96a9){try{if(this[_0x54df('0x1e')](_0x2c96a9)){logger['info']('[userReport][registry]\x20registry:%s\x20state:%s',_0x2c96a9[_0x54df('0x1f')],_0x2c96a9['state']);logger[_0x54df('0x20')](_0x54df('0x21'),util[_0x54df('0x22')](_0x2c96a9,{'showHidden':![],'depth':null}));var _0x40ec5f=_[_0x54df('0x23')](this[_0x54df('0x9')],{'defaultuser':_0x2c96a9[_0x54df('0x1f')]});if(_0x40ec5f){_0x2c96a9[_0x54df('0x24')]=_0x2c96a9[_0x54df('0x25')];_['merge'](_0x40ec5f,_[_0x54df('0x26')](_0x2c96a9,[_0x54df('0x27'),_0x54df('0x28'),_0x54df('0x1f'),_0x54df('0x25')]));logger['debug'](_0x54df('0x29'),util[_0x54df('0x22')](_0x40ec5f,{'showHidden':![],'depth':null}));this['emit'](util[_0x54df('0x2a')](_0x54df('0x2b'),_0x40ec5f[_0x54df('0x2c')]),_0x54df('0x2d'),_0x40ec5f);}}}catch(_0x2b188b){logger[_0x54df('0x16')](_0x54df('0x21'),util['inspect'](_0x2b188b,{'showHidden':![],'depth':null}));}};UserReport[_0x54df('0x1b')][_0x54df('0x10')]=function(_0x441ba5){try{if(this['isNotNull'](_0x441ba5)){logger[_0x54df('0x2e')](_0x54df('0x2f'),_0x441ba5['device'],_0x441ba5[_0x54df('0x25')]);logger[_0x54df('0x20')](_0x54df('0x30'),util[_0x54df('0x22')](_0x441ba5,{'showHidden':![],'depth':null}));if(this[_0x54df('0xa')][_0x441ba5['device']]){if(!this[_0x54df('0xa')][_0x441ba5['device']][_0x54df('0x31')]||_0x441ba5['state'][_0x54df('0x32')]()==_0x54df('0x33')){this[_0x54df('0xa')][_0x441ba5[_0x54df('0x34')]][_0x54df('0x31')]=![];if(this[_0x54df('0xa')][_0x441ba5[_0x54df('0x34')]][_0x54df('0x25')]!==_0x441ba5[_0x54df('0x25')][_0x54df('0x32')]()){this[_0x54df('0xa')][_0x441ba5[_0x54df('0x34')]][_0x54df('0x35')]=_[_0x54df('0x36')](moment()[_0x54df('0x2a')]('x'));}this['agents'][_0x441ba5[_0x54df('0x34')]][_0x54df('0x25')]=_0x441ba5[_0x54df('0x25')][_0x54df('0x32')]();this[_0x54df('0xa')][_0x441ba5[_0x54df('0x34')]][_0x54df('0x37')](_0x441ba5);}}else if(this[_0x54df('0xb')][_0x441ba5[_0x54df('0x34')]]){if(this['telephones'][_0x441ba5[_0x54df('0x34')]]['state']!==_0x441ba5['state'][_0x54df('0x32')]()){this[_0x54df('0xb')][_0x441ba5[_0x54df('0x34')]][_0x54df('0x35')]=_[_0x54df('0x36')](moment()[_0x54df('0x2a')]('x'));}this[_0x54df('0xb')][_0x441ba5[_0x54df('0x34')]][_0x54df('0x25')]=_0x441ba5[_0x54df('0x25')][_0x54df('0x32')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x54df('0x22')](this[_0x54df('0xb')][_0x441ba5[_0x54df('0x34')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x54df('0x2a')](_0x54df('0x38'),this[_0x54df('0xb')][_0x441ba5['device']][_0x54df('0x2c')]),_0x54df('0x39'),this[_0x54df('0xb')][_0x441ba5['device']]);}else if(this[_0x54df('0x9')][_0x441ba5['device']]){if(this[_0x54df('0x9')][_0x441ba5[_0x54df('0x34')]][_0x54df('0x25')]!==_0x441ba5[_0x54df('0x25')][_0x54df('0x32')]()){this[_0x54df('0x9')][_0x441ba5['device']][_0x54df('0x35')]=_[_0x54df('0x36')](moment()[_0x54df('0x2a')]('x'));}this[_0x54df('0x9')][_0x441ba5['device']]['state']=_0x441ba5['state']['toLowerCase']();logger[_0x54df('0x20')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0x54df('0x22')](this[_0x54df('0x9')][_0x441ba5[_0x54df('0x34')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x54df('0x2a')](_0x54df('0x2b'),this[_0x54df('0x9')][_0x441ba5['device']][_0x54df('0x2c')]),_0x54df('0x2d'),this[_0x54df('0x9')][_0x441ba5['device']]);}else if(_[_0x54df('0x3a')](_0x441ba5['device'],_0x54df('0x3b'))){var _0x5d63b7=_0x441ba5[_0x54df('0x34')];var _0x992717=_0x5d63b7[_0x54df('0x3c')](_0x5d63b7['indexOf']('/')+0x1,_0x5d63b7[_0x54df('0x3d')]('@'));var _0x24bcbb=_[_0x54df('0x23')](this['agents'],function(_0xca1e9b){return _0xca1e9b['mobile']==_0x992717||_0xca1e9b[_0x54df('0x3e')]==_0x992717||_0xca1e9b[_0x54df('0x3f')]==_0x992717;});if(_0x24bcbb){if(_0x24bcbb[_0x54df('0x25')]!==_0x441ba5[_0x54df('0x25')][_0x54df('0x32')]()){_0x24bcbb['stateTime']=_[_0x54df('0x36')](moment()['format']('x'));}_0x24bcbb[_0x54df('0x25')]=_0x441ba5[_0x54df('0x25')][_0x54df('0x32')]();_0x24bcbb[_0x54df('0x31')]=!![];_0x24bcbb[_0x54df('0x37')](_0x441ba5);}}}}catch(_0x2d9530){logger[_0x54df('0x16')](_0x54df('0x30'),util[_0x54df('0x22')](_0x2d9530,{'showHidden':![],'depth':null}));}};UserReport[_0x54df('0x1b')]['syncPeerStatus']=function(_0x3120a7){try{if(this[_0x54df('0x1e')](_0x3120a7)&&this[_0x54df('0x1e')](_0x3120a7[_0x54df('0x40')])){logger['info']('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x3120a7['peer'],_0x3120a7[_0x54df('0x41')],_0x3120a7[_0x54df('0x40')]);logger[_0x54df('0x20')](_0x54df('0x42'),util[_0x54df('0x22')](_0x3120a7,{'showHidden':![],'depth':null}));if(this['agents'][_0x3120a7[_0x54df('0x43')]]){if(!this[_0x54df('0xa')][_0x3120a7[_0x54df('0x43')]]['local']||_0x3120a7[_0x54df('0x40')][_0x54df('0x32')]()==_0x54df('0x44')){this['agents'][_0x3120a7['peer']][_0x54df('0x31')]=![];this[_0x54df('0xa')][_0x3120a7[_0x54df('0x43')]][_0x54df('0x45')]=_0x3120a7['peerstatus'][_0x54df('0x32')]();this['agents'][_0x3120a7['peer']][_0x54df('0x41')]=_0x3120a7[_0x54df('0x41')];this[_0x54df('0xa')][_0x3120a7[_0x54df('0x43')]]['updateStatusRealtime'](_0x3120a7);}}else if(this[_0x54df('0xb')][_0x3120a7[_0x54df('0x43')]]){this[_0x54df('0xb')][_0x3120a7['peer']]['status']=_0x3120a7[_0x54df('0x40')]['toLowerCase']();this['telephones'][_0x3120a7['peer']][_0x54df('0x41')]=_0x3120a7[_0x54df('0x41')];logger[_0x54df('0x20')](_0x54df('0x46'),util['inspect'](this['telephones'][_0x3120a7['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0x54df('0x2a')](_0x54df('0x38'),this[_0x54df('0xb')][_0x3120a7[_0x54df('0x43')]]['name']),_0x54df('0x39'),this['telephones'][_0x3120a7[_0x54df('0x43')]]);}else if(this[_0x54df('0x9')][_0x3120a7[_0x54df('0x43')]]){this['trunks'][_0x3120a7['peer']][_0x54df('0x45')]=_0x3120a7[_0x54df('0x40')][_0x54df('0x32')]();this[_0x54df('0x9')][_0x3120a7[_0x54df('0x43')]][_0x54df('0x41')]=_0x3120a7[_0x54df('0x41')];logger[_0x54df('0x20')](_0x54df('0x47'),util[_0x54df('0x22')](this['trunks'][_0x3120a7[_0x54df('0x43')]],{'showHidden':![],'depth':null}));this[_0x54df('0x1d')](util['format']('trunk:%s',this['trunks'][_0x3120a7[_0x54df('0x43')]][_0x54df('0x2c')]),_0x54df('0x2d'),this[_0x54df('0x9')][_0x3120a7[_0x54df('0x43')]]);}}}catch(_0x369ea2){logger[_0x54df('0x16')](_0x54df('0x42'),util[_0x54df('0x22')](_0x369ea2,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x27bf=['syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','error','inspect','actionDeviceStateList','actionSipPeerStatus','catch','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','info','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','[userReport][registry]','find','username','stateRegistry','merge','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','emit','format','trunk:%s','name','trunk:save','device','[userReport][devicestatechange]','agents','local','toLowerCase','inuse','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','startsWith','Local','substring','indexOf','phone','accountcode','address','peer','registered','status','updateStatusRealtime','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','trunks','telephones'];(function(_0x8051d7,_0x263ba9){var _0x3fb835=function(_0x3605a6){while(--_0x3605a6){_0x8051d7['push'](_0x8051d7['shift']());}};_0x3fb835(++_0x263ba9);}(_0x27bf,0x126));var _0xf27b=function(_0x4cc1bd,_0x3b02dc){_0x4cc1bd=_0x4cc1bd-0x0;var _0x166c92=_0x27bf[_0x4cc1bd];return _0x166c92;};'use strict';var _=require(_0xf27b('0x0'));var moment=require(_0xf27b('0x1'));var util=require(_0xf27b('0x2'));var Redis=require(_0xf27b('0x3'));var BPromise=require(_0xf27b('0x4'));var config=require(_0xf27b('0x5'));var logger=require(_0xf27b('0x6'))(_0xf27b('0x7'));var ami=require(_0xf27b('0x8'));config['redis']=_['defaults'](config[_0xf27b('0x9')],{'host':_0xf27b('0xa'),'port':0x18eb});var io=require(_0xf27b('0xb'))(new Redis(config[_0xf27b('0x9')]));function UserReport(_0x4d3354){this[_0xf27b('0xc')]=_0x4d3354['trunks'];this['agents']=_0x4d3354['agents'];this[_0xf27b('0xd')]=_0x4d3354[_0xf27b('0xd')];ami['on']('registryentry',this[_0xf27b('0xe')][_0xf27b('0xf')](this));ami['on'](_0xf27b('0x10'),this[_0xf27b('0xe')][_0xf27b('0xf')](this));ami['on'](_0xf27b('0x11'),this[_0xf27b('0x12')][_0xf27b('0xf')](this));ami['on'](_0xf27b('0x13'),this[_0xf27b('0x14')][_0xf27b('0xf')](this));return this[_0xf27b('0x15')]();}function showSipRegistrations(){Promise[_0xf27b('0x16')]()[_0xf27b('0x17')](ami[_0xf27b('0x18')]())['catch'](function(_0x30643f){logger[_0xf27b('0x19')]('[userReport][sipshowregistry]',util[_0xf27b('0x1a')](_0x30643f,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xf27b('0x16')]()[_0xf27b('0x17')](ami[_0xf27b('0x1b')]())['catch'](function(_0x6814ec){logger['error']('[userReport][devicestatelist]',util['inspect'](_0x6814ec,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()['then'](ami[_0xf27b('0x1c')]())[_0xf27b('0x1d')](function(_0x4fc83b){logger[_0xf27b('0x19')](_0xf27b('0x1e'),util[_0xf27b('0x1a')](_0x4fc83b,{'showHidden':![],'depth':null}));});}UserReport[_0xf27b('0x1f')][_0xf27b('0x15')]=function(){setInterval(function(){BPromise['resolve']()[_0xf27b('0x17')](showSipRegistrations())['then'](listDeviceStates())[_0xf27b('0x17')](showPeersStatus());},0x32c8);};UserReport[_0xf27b('0x1f')][_0xf27b('0x20')]=function(_0x10e5a1){return _0x10e5a1!==null&&!_[_0xf27b('0x21')](_0x10e5a1);};UserReport[_0xf27b('0x1f')]['emit']=function(_0x4e1331,_0x4f0495,_0x1ba52d){io['to'](_0x4e1331)['emit'](_0x4f0495,_0x1ba52d);};UserReport[_0xf27b('0x1f')]['syncRegistry']=function(_0x43d519){try{if(this[_0xf27b('0x20')](_0x43d519)){logger[_0xf27b('0x22')](_0xf27b('0x23'),_0x43d519['username'],_0x43d519[_0xf27b('0x24')]);logger[_0xf27b('0x25')](_0xf27b('0x26'),util[_0xf27b('0x1a')](_0x43d519,{'showHidden':![],'depth':null}));var _0x4e95ef=_[_0xf27b('0x27')](this[_0xf27b('0xc')],{'defaultuser':_0x43d519[_0xf27b('0x28')]});if(_0x4e95ef){_0x43d519[_0xf27b('0x29')]=_0x43d519[_0xf27b('0x24')];_[_0xf27b('0x2a')](_0x4e95ef,_['omit'](_0x43d519,[_0xf27b('0x2b'),_0xf27b('0x2c'),'username','state']));logger[_0xf27b('0x25')](_0xf27b('0x2d'),util[_0xf27b('0x1a')](_0x4e95ef,{'showHidden':![],'depth':null}));this[_0xf27b('0x2e')](util[_0xf27b('0x2f')](_0xf27b('0x30'),_0x4e95ef[_0xf27b('0x31')]),_0xf27b('0x32'),_0x4e95ef);}}}catch(_0x3088f2){logger['error']('[userReport][registry]',util[_0xf27b('0x1a')](_0x3088f2,{'showHidden':![],'depth':null}));}};UserReport[_0xf27b('0x1f')][_0xf27b('0x12')]=function(_0x117c13){try{if(this[_0xf27b('0x20')](_0x117c13)){logger[_0xf27b('0x22')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x117c13[_0xf27b('0x33')],_0x117c13['state']);logger[_0xf27b('0x25')](_0xf27b('0x34'),util[_0xf27b('0x1a')](_0x117c13,{'showHidden':![],'depth':null}));if(this[_0xf27b('0x35')][_0x117c13[_0xf27b('0x33')]]){if(!this['agents'][_0x117c13[_0xf27b('0x33')]][_0xf27b('0x36')]||_0x117c13['state'][_0xf27b('0x37')]()==_0xf27b('0x38')){this[_0xf27b('0x35')][_0x117c13[_0xf27b('0x33')]][_0xf27b('0x36')]=![];if(this['agents'][_0x117c13[_0xf27b('0x33')]][_0xf27b('0x24')]!==_0x117c13[_0xf27b('0x24')][_0xf27b('0x37')]()){this[_0xf27b('0x35')][_0x117c13[_0xf27b('0x33')]][_0xf27b('0x39')]=_[_0xf27b('0x3a')](moment()[_0xf27b('0x2f')]('x'));}this['agents'][_0x117c13[_0xf27b('0x33')]][_0xf27b('0x24')]=_0x117c13[_0xf27b('0x24')][_0xf27b('0x37')]();this[_0xf27b('0x35')][_0x117c13[_0xf27b('0x33')]]['updateStatusRealtime'](_0x117c13);}}else if(this[_0xf27b('0xd')][_0x117c13[_0xf27b('0x33')]]){if(this[_0xf27b('0xd')][_0x117c13[_0xf27b('0x33')]][_0xf27b('0x24')]!==_0x117c13[_0xf27b('0x24')][_0xf27b('0x37')]()){this[_0xf27b('0xd')][_0x117c13['device']]['stateTime']=_[_0xf27b('0x3a')](moment()[_0xf27b('0x2f')]('x'));}this[_0xf27b('0xd')][_0x117c13['device']][_0xf27b('0x24')]=_0x117c13[_0xf27b('0x24')][_0xf27b('0x37')]();logger[_0xf27b('0x25')](_0xf27b('0x3b'),util[_0xf27b('0x1a')](this['telephones'][_0x117c13[_0xf27b('0x33')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xf27b('0x2f')](_0xf27b('0x3c'),this[_0xf27b('0xd')][_0x117c13['device']][_0xf27b('0x31')]),'telephone:save',this[_0xf27b('0xd')][_0x117c13['device']]);}else if(this['trunks'][_0x117c13[_0xf27b('0x33')]]){if(this['trunks'][_0x117c13[_0xf27b('0x33')]][_0xf27b('0x24')]!==_0x117c13[_0xf27b('0x24')][_0xf27b('0x37')]()){this[_0xf27b('0xc')][_0x117c13[_0xf27b('0x33')]][_0xf27b('0x39')]=_[_0xf27b('0x3a')](moment()[_0xf27b('0x2f')]('x'));}this['trunks'][_0x117c13[_0xf27b('0x33')]][_0xf27b('0x24')]=_0x117c13[_0xf27b('0x24')]['toLowerCase']();logger[_0xf27b('0x25')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this['trunks'][_0x117c13[_0xf27b('0x33')]],{'showHidden':![],'depth':null}));this[_0xf27b('0x2e')](util['format'](_0xf27b('0x30'),this['trunks'][_0x117c13[_0xf27b('0x33')]][_0xf27b('0x31')]),_0xf27b('0x32'),this[_0xf27b('0xc')][_0x117c13[_0xf27b('0x33')]]);}else if(_[_0xf27b('0x3d')](_0x117c13[_0xf27b('0x33')],_0xf27b('0x3e'))){var _0x2672a5=_0x117c13[_0xf27b('0x33')];var _0x5d4b7f=_0x2672a5[_0xf27b('0x3f')](_0x2672a5['indexOf']('/')+0x1,_0x2672a5[_0xf27b('0x40')]('@'));var _0xfa7768=_[_0xf27b('0x27')](this['agents'],function(_0x3180fe){return _0x3180fe['mobile']==_0x5d4b7f||_0x3180fe[_0xf27b('0x41')]==_0x5d4b7f||_0x3180fe[_0xf27b('0x42')]==_0x5d4b7f;});if(_0xfa7768){if(_0xfa7768[_0xf27b('0x24')]!==_0x117c13[_0xf27b('0x24')][_0xf27b('0x37')]()){_0xfa7768[_0xf27b('0x39')]=_[_0xf27b('0x3a')](moment()[_0xf27b('0x2f')]('x'));}_0xfa7768[_0xf27b('0x24')]=_0x117c13['state'][_0xf27b('0x37')]();_0xfa7768[_0xf27b('0x36')]=!![];_0xfa7768['updateStatusRealtime'](_0x117c13);}}}}catch(_0x2e62cd){logger[_0xf27b('0x19')](_0xf27b('0x34'),util['inspect'](_0x2e62cd,{'showHidden':![],'depth':null}));}};UserReport[_0xf27b('0x1f')][_0xf27b('0x14')]=function(_0x1c9919){try{if(this[_0xf27b('0x20')](_0x1c9919)&&this[_0xf27b('0x20')](_0x1c9919['peerstatus'])){logger['info']('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x1c9919['peer'],_0x1c9919[_0xf27b('0x43')],_0x1c9919['peerstatus']);logger[_0xf27b('0x25')]('[userReport][peerstatus]',util[_0xf27b('0x1a')](_0x1c9919,{'showHidden':![],'depth':null}));if(this['agents'][_0x1c9919[_0xf27b('0x44')]]){if(!this['agents'][_0x1c9919[_0xf27b('0x44')]][_0xf27b('0x36')]||_0x1c9919['peerstatus'][_0xf27b('0x37')]()==_0xf27b('0x45')){this['agents'][_0x1c9919[_0xf27b('0x44')]][_0xf27b('0x36')]=![];this['agents'][_0x1c9919['peer']][_0xf27b('0x46')]=_0x1c9919['peerstatus'][_0xf27b('0x37')]();this[_0xf27b('0x35')][_0x1c9919['peer']][_0xf27b('0x43')]=_0x1c9919[_0xf27b('0x43')];this['agents'][_0x1c9919[_0xf27b('0x44')]][_0xf27b('0x47')](_0x1c9919);}}else if(this['telephones'][_0x1c9919[_0xf27b('0x44')]]){this[_0xf27b('0xd')][_0x1c9919[_0xf27b('0x44')]][_0xf27b('0x46')]=_0x1c9919[_0xf27b('0x13')][_0xf27b('0x37')]();this[_0xf27b('0xd')][_0x1c9919[_0xf27b('0x44')]][_0xf27b('0x43')]=_0x1c9919['address'];logger[_0xf27b('0x25')](_0xf27b('0x48'),util[_0xf27b('0x1a')](this['telephones'][_0x1c9919[_0xf27b('0x44')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xf27b('0x2f')](_0xf27b('0x3c'),this[_0xf27b('0xd')][_0x1c9919[_0xf27b('0x44')]]['name']),_0xf27b('0x49'),this[_0xf27b('0xd')][_0x1c9919['peer']]);}else if(this[_0xf27b('0xc')][_0x1c9919['peer']]){this['trunks'][_0x1c9919['peer']][_0xf27b('0x46')]=_0x1c9919[_0xf27b('0x13')][_0xf27b('0x37')]();this[_0xf27b('0xc')][_0x1c9919[_0xf27b('0x44')]][_0xf27b('0x43')]=_0x1c9919[_0xf27b('0x43')];logger[_0xf27b('0x25')](_0xf27b('0x4a'),util[_0xf27b('0x1a')](this['trunks'][_0x1c9919[_0xf27b('0x44')]],{'showHidden':![],'depth':null}));this[_0xf27b('0x2e')](util[_0xf27b('0x2f')]('trunk:%s',this['trunks'][_0x1c9919[_0xf27b('0x44')]][_0xf27b('0x31')]),_0xf27b('0x32'),this[_0xf27b('0xc')][_0x1c9919['peer']]);}}}catch(_0x23a691){logger[_0xf27b('0x19')](_0xf27b('0x4b'),util[_0xf27b('0x1a')](_0x23a691,{'showHidden':![],'depth':null}));}};module[_0xf27b('0x4c')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index bd0c8d5..0249235 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=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','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','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user: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','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','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:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0xefee3b,_0x1c09ff){var _0x380bf0=function(_0x477aeb){while(--_0x477aeb){_0xefee3b['push'](_0xefee3b['shift']());}};_0x380bf0(++_0x1c09ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','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','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user: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','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','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:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x4af81f,_0x49161f){var _0x3eaaaf=function(_0x46b0d5){while(--_0x46b0d5){_0x4af81f['push'](_0x4af81f['shift']());}};_0x3eaaaf(++_0x49161f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index ba7f850..22b8464 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 _0x4fbc=['monitorFilename','find','isNil','monitors','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','syncMixMonitorFilename','value','xmd-phone','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','destinationchannel','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','transferconnectedlinenum','origtransfereruniqueid','origtransfererlinkedid','some','transferType','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','moment','util','path','ioredis','../../../config/environment','../../../config/logger','../rpc/setting','unknown','not_inuse','inuse','invalid','ringing','ringinuse','onhold','set','queue','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','bind','newexten','syncNewExten','newchannel','syncNewChannel','newstate','syncNewState','hangup','syncHangup','newcallerid','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','isUndefined','prototype','emit','isNotNull','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','keys','from-sip','channel','split','exten','xcally-motion-preview','format','user:%s','name','user:agentconnect','connectedlinenum','[%s][voiceCallReport][newcallerid]','inspect','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','pick','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','subtract','duration','seconds','disposition','includes','lastapplication','lastdata','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','diff','connectedlinename','membername','UserId','routealias','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','.WAV'];(function(_0x3c5e54,_0x2b991b){var _0x3ae1f3=function(_0x43f80f){while(--_0x43f80f){_0x3c5e54['push'](_0x3c5e54['shift']());}};_0x3ae1f3(++_0x2b991b);}(_0x4fbc,0x129));var _0xc4fb=function(_0x59e8f5,_0x4a7be4){_0x59e8f5=_0x59e8f5-0x0;var _0x171415=_0x4fbc[_0x59e8f5];return _0x171415;};'use strict';var BPromise=require(_0xc4fb('0x0'));var _=require('lodash');var moment=require(_0xc4fb('0x1'));var util=require(_0xc4fb('0x2'));var path=require(_0xc4fb('0x3'));var Redis=require(_0xc4fb('0x4'));var config=require(_0xc4fb('0x5'));var logger=require(_0xc4fb('0x6'))('ami');var ami=require('../ami');var Channel=require('../model/channel');var RpcSetting=require(_0xc4fb('0x7'));var statusDesc=[_0xc4fb('0x8'),_0xc4fb('0x9'),_0xc4fb('0xa'),'busy',_0xc4fb('0xb'),'unavailable',_0xc4fb('0xc'),_0xc4fb('0xd'),_0xc4fb('0xe')];var applications=[_0xc4fb('0xf'),_0xc4fb('0x10'),'agi',_0xc4fb('0x11'),_0xc4fb('0x12'),_0xc4fb('0x13')];var dispositions=[_0xc4fb('0x14'),_0xc4fb('0x15'),'FAILED','NO\x20ANSWER','NO\x20ANSWER','NO\x20ANSWER',_0xc4fb('0x16'),_0xc4fb('0x17'),_0xc4fb('0x15'),_0xc4fb('0x15'),_0xc4fb('0x15')];var actions={};config[_0xc4fb('0x18')]=_[_0xc4fb('0x19')](config[_0xc4fb('0x18')],{'host':_0xc4fb('0x1a'),'port':0x18eb});var io=require(_0xc4fb('0x1b'))(new Redis(config[_0xc4fb('0x18')]));function VoiceCallReport(_0x1747a7){this[_0xc4fb('0x1c')]=_0x1747a7[_0xc4fb('0x1c')];this['agents']=_0x1747a7[_0xc4fb('0x1d')];this[_0xc4fb('0x1e')]={};ami['on']('coreshowchannel',this['syncNewExten'][_0xc4fb('0x1f')](this));ami['on'](_0xc4fb('0x20'),this[_0xc4fb('0x21')][_0xc4fb('0x1f')](this));ami['on'](_0xc4fb('0x22'),this[_0xc4fb('0x23')]['bind'](this));ami['on'](_0xc4fb('0x24'),this[_0xc4fb('0x25')][_0xc4fb('0x1f')](this));ami['on']('varset',this['syncVarSet'][_0xc4fb('0x1f')](this));ami['on'](_0xc4fb('0x26'),this[_0xc4fb('0x27')][_0xc4fb('0x1f')](this));ami['on'](_0xc4fb('0x28'),this['syncNewCallerId'][_0xc4fb('0x1f')](this));ami['on']('attendedtransfer',this[_0xc4fb('0x29')][_0xc4fb('0x1f')](this));ami['on'](_0xc4fb('0x2a'),this[_0xc4fb('0x2b')][_0xc4fb('0x1f')](this));ami['on'](_0xc4fb('0x2c'),this[_0xc4fb('0x2d')][_0xc4fb('0x1f')](this));ami['on']('musiconholdstop',this[_0xc4fb('0x2e')]['bind'](this));try{logger[_0xc4fb('0x2f')](_0xc4fb('0x30'));ami[_0xc4fb('0x31')]();}catch(_0x303b51){logger[_0xc4fb('0x32')](_0xc4fb('0x33'),util['inspect'](_0x303b51,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype']['isNotNull']=function(_0x517b94){return _0x517b94!==null&&!_[_0xc4fb('0x34')](_0x517b94);};VoiceCallReport[_0xc4fb('0x35')]['emit']=function(_0x139886,_0x453654,_0x1d7363){io['to'](_0x139886)[_0xc4fb('0x36')](_0x453654,_0x1d7363);};VoiceCallReport[_0xc4fb('0x35')]['syncNewCallerId']=function(_0x45f911){try{if(this[_0xc4fb('0x37')](_0x45f911)){logger[_0xc4fb('0x2f')](_0xc4fb('0x38'),_0x45f911[_0xc4fb('0x39')],_0x45f911[_0xc4fb('0x3a')],_0x45f911[_0xc4fb('0x3b')]);logger[_0xc4fb('0x3c')](_0xc4fb('0x3d'),_0x45f911[_0xc4fb('0x39')],util['inspect'](_0x45f911,{'showHidden':![],'depth':null}));if(_0x45f911[_0xc4fb('0x39')]===_0x45f911[_0xc4fb('0x3e')]){if(!_[_0xc4fb('0x34')](this[_0xc4fb('0x1c')][_0x45f911['uniqueid']])){_[_0xc4fb('0x3f')](this[_0xc4fb('0x1c')][_0x45f911[_0xc4fb('0x39')]],_['pick'](_0x45f911,_[_0xc4fb('0x40')](this[_0xc4fb('0x1c')][_0x45f911[_0xc4fb('0x39')]])));}}if(_0x45f911['context']===_0xc4fb('0x41')){if(this[_0xc4fb('0x1d')][_0x45f911[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]]){if(_0x45f911[_0xc4fb('0x44')]==_0xc4fb('0x45')){this[_0xc4fb('0x1d')][_0x45f911[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]]['destconnectedlinenum']=_0x45f911['connectedlinenum'];this[_0xc4fb('0x36')](util[_0xc4fb('0x46')](_0xc4fb('0x47'),this[_0xc4fb('0x1d')][_0x45f911[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]][_0xc4fb('0x48')]),_0xc4fb('0x49'),{'destaccountcode':this[_0xc4fb('0x1d')][_0x45f911[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x45f911[_0xc4fb('0x4a')]});}}}}}catch(_0x1c0040){logger[_0xc4fb('0x32')](_0xc4fb('0x4b'),_0x45f911['uniqueid'],util[_0xc4fb('0x4c')](_0x1c0040,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc4fb('0x35')][_0xc4fb('0x23')]=function(_0xe68934){try{if(this['isNotNull'](_0xe68934)){logger[_0xc4fb('0x3c')](_0xc4fb('0x4d'),_0xe68934[_0xc4fb('0x39')],util[_0xc4fb('0x4c')](_0xe68934,{'showHidden':![],'depth':null}));if(_0xe68934['uniqueid']===_0xe68934['linkedid']&&_0xe68934[_0xc4fb('0x42')]!=_0xc4fb('0x4e')){if(_[_0xc4fb('0x34')](this['channels'][_0xe68934[_0xc4fb('0x39')]])){logger['info'](_0xc4fb('0x4f'),_0xe68934[_0xc4fb('0x39')],_0xe68934[_0xc4fb('0x50')],_0xe68934[_0xc4fb('0x44')]);this[_0xc4fb('0x1c')][_0xe68934[_0xc4fb('0x39')]]=new Channel();this['channels'][_0xe68934[_0xc4fb('0x39')]][_0xc4fb('0x51')]=moment()['format'](_0xc4fb('0x52'));this[_0xc4fb('0x1c')][_0xe68934[_0xc4fb('0x39')]]['disposition']=dispositions[_[_0xc4fb('0x53')](_0xe68934[_0xc4fb('0x54')])];_[_0xc4fb('0x3f')](this[_0xc4fb('0x1c')][_0xe68934[_0xc4fb('0x39')]],_[_0xc4fb('0x55')](_0xe68934,_[_0xc4fb('0x40')](this[_0xc4fb('0x1c')][_0xe68934[_0xc4fb('0x39')]])));if(_0xe68934[_0xc4fb('0x50')]===_0xc4fb('0x41')){if(this[_0xc4fb('0x1d')][_0xe68934[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]]){if(_['isUndefined'](this['agents'][_0xe68934['channel'][_0xc4fb('0x43')]('-')[0x0]]['destconnectedlinenum'])){this[_0xc4fb('0x1d')][_0xe68934[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]][_0xc4fb('0x56')]=_0xe68934[_0xc4fb('0x44')];logger['debug'](_0xc4fb('0x57'),_0xe68934[_0xc4fb('0x39')],util[_0xc4fb('0x4c')]({'destaccountcode':this['agents'][_0xe68934[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]][_0xc4fb('0x58')],'destconnectedlinenum':_0xe68934[_0xc4fb('0x44')]},{'showHidden':![],'depth':null}));this[_0xc4fb('0x36')](util[_0xc4fb('0x46')](_0xc4fb('0x47'),this[_0xc4fb('0x1d')][_0xe68934[_0xc4fb('0x42')]['split']('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0xc4fb('0x1d')][_0xe68934[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]][_0xc4fb('0x58')],'destconnectedlinenum':_0xe68934[_0xc4fb('0x44')]});}}}}}}}catch(_0xa42481){logger[_0xc4fb('0x32')](_0xc4fb('0x59'),_0xe68934[_0xc4fb('0x39')],util['inspect'](_0xa42481,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc4fb('0x35')][_0xc4fb('0x21')]=function(_0x51f290){try{if(this[_0xc4fb('0x37')](_0x51f290)){logger['debug'](_0xc4fb('0x5a'),_0x51f290[_0xc4fb('0x39')],util['inspect'](_0x51f290,{'showHidden':![],'depth':null}));if(_0x51f290[_0xc4fb('0x39')]===_0x51f290[_0xc4fb('0x3e')]&&_0x51f290[_0xc4fb('0x44')]!='h'&&_0x51f290[_0xc4fb('0x42')]!=_0xc4fb('0x4e')){_0x51f290[_0xc4fb('0x5b')]=_0x51f290[_0xc4fb('0x5b')][_0xc4fb('0x5c')]();_0x51f290[_0xc4fb('0x5d')]=_0x51f290[_0xc4fb('0x5e')]&&_0x51f290[_0xc4fb('0x5e')][_0xc4fb('0x5f')](_0xc4fb('0x60'))?_0x51f290['appdata']:(_0x51f290['appdata']||_0x51f290[_0xc4fb('0x5d')])[_0xc4fb('0x5c')]();logger[_0xc4fb('0x2f')](_0xc4fb('0x61'),_0x51f290[_0xc4fb('0x39')],_0x51f290[_0xc4fb('0x5b')],_0x51f290[_0xc4fb('0x5d')]);if(_['isUndefined'](this['channels'][_0x51f290[_0xc4fb('0x39')]])){this[_0xc4fb('0x1c')][_0x51f290[_0xc4fb('0x39')]]=new Channel();this['channels'][_0x51f290['uniqueid']]['starttime']=_0x51f290['duration']?moment()[_0xc4fb('0x62')](moment[_0xc4fb('0x63')](_0x51f290[_0xc4fb('0x63')])[_0xc4fb('0x64')](),_0xc4fb('0x64'))[_0xc4fb('0x46')]('YYYY-MM-DD\x20HH:mm:ss'):moment()['format'](_0xc4fb('0x52'));this[_0xc4fb('0x1c')][_0x51f290[_0xc4fb('0x39')]][_0xc4fb('0x65')]='NO\x20ANSWER';}_[_0xc4fb('0x3f')](this[_0xc4fb('0x1c')][_0x51f290[_0xc4fb('0x39')]],_[_0xc4fb('0x55')](_0x51f290,_[_0xc4fb('0x40')](this[_0xc4fb('0x1c')][_0x51f290['uniqueid']])));if(_[_0xc4fb('0x66')](applications,_0x51f290[_0xc4fb('0x5b')])){this['channels'][_0x51f290[_0xc4fb('0x39')]][_0xc4fb('0x67')]=_0x51f290['application'];this[_0xc4fb('0x1c')][_0x51f290[_0xc4fb('0x39')]][_0xc4fb('0x68')]=_0x51f290['applicationdata'];if(_0x51f290[_0xc4fb('0x5b')]==='set'&&_['startsWith'](_0x51f290[_0xc4fb('0x5d')][_0xc4fb('0x5c')](),'cdr(')){var _0x41fdb6=_0x51f290['applicationdata'][_0xc4fb('0x43')]('=');var _0x11f7fe=_0x41fdb6[0x0][_0xc4fb('0x5c')]()[_0xc4fb('0x69')](/cdr\((.*)\)/);if(_0x11f7fe){this[_0xc4fb('0x1c')][_0x51f290[_0xc4fb('0x39')]][_0x11f7fe[0x1]]=_0x41fdb6[0x1];}}else if(_0x51f290['application']==='queue'){this['channels'][_0x51f290['uniqueid']][_0xc4fb('0x10')]=_0x51f290[_0xc4fb('0x5d')][_0xc4fb('0x43')](',')[0x0];}}}}}catch(_0x7759d3){logger['error'](_0xc4fb('0x6a'),_0x51f290[_0xc4fb('0x39')],util[_0xc4fb('0x4c')](_0x7759d3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc4fb('0x35')][_0xc4fb('0x25')]=function(_0x4a3918){try{if(this[_0xc4fb('0x37')](_0x4a3918)){logger['info'](_0xc4fb('0x6b'),_0x4a3918['uniqueid'],_0x4a3918[_0xc4fb('0x3e')],_0x4a3918[_0xc4fb('0x3a')],_0x4a3918['calleridnum']);logger[_0xc4fb('0x3c')](_0xc4fb('0x6c'),_0x4a3918[_0xc4fb('0x39')],util[_0xc4fb('0x4c')](_0x4a3918,{'showHidden':![],'depth':null}));if(_0x4a3918[_0xc4fb('0x39')]!==_0x4a3918['linkedid']){if(this[_0xc4fb('0x1c')][_0x4a3918[_0xc4fb('0x3e')]]){if(_0x4a3918[_0xc4fb('0x54')]==='6'){if(!this[_0xc4fb('0x1c')][_0x4a3918[_0xc4fb('0x3e')]][_0xc4fb('0x6d')]){var _0x2f7fb0=moment();this['channels'][_0x4a3918[_0xc4fb('0x3e')]]['answered']=!![];this[_0xc4fb('0x1c')][_0x4a3918[_0xc4fb('0x3e')]][_0xc4fb('0x6e')]=_0x2f7fb0[_0xc4fb('0x46')](_0xc4fb('0x52'));if(this[_0xc4fb('0x1c')][_0x4a3918['linkedid']][_0xc4fb('0x51')]){this[_0xc4fb('0x1c')][_0x4a3918[_0xc4fb('0x3e')]]['holdtime']=_0x2f7fb0[_0xc4fb('0x6f')](this[_0xc4fb('0x1c')][_0x4a3918[_0xc4fb('0x3e')]][_0xc4fb('0x51')],_0xc4fb('0x64'));}}this[_0xc4fb('0x1c')][_0x4a3918[_0xc4fb('0x3e')]][_0xc4fb('0x3e')]=_0x4a3918[_0xc4fb('0x39')];if(_0x4a3918[_0xc4fb('0x3b')]!=='xcally-motion-preview'){this[_0xc4fb('0x1c')][_0x4a3918[_0xc4fb('0x3e')]][_0xc4fb('0x4a')]=_0x4a3918[_0xc4fb('0x3b')];}this[_0xc4fb('0x1c')][_0x4a3918[_0xc4fb('0x3e')]][_0xc4fb('0x70')]=_0x4a3918['calleridname'];this[_0xc4fb('0x1c')][_0x4a3918[_0xc4fb('0x3e')]]['destinationchannel']=_0x4a3918[_0xc4fb('0x42')];this[_0xc4fb('0x1c')][_0x4a3918[_0xc4fb('0x3e')]][_0xc4fb('0x65')]=dispositions[_[_0xc4fb('0x53')](_0x4a3918[_0xc4fb('0x54')])];if(this['agents'][_0x4a3918[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]]){this['channels'][_0x4a3918[_0xc4fb('0x3e')]]['UserId']=this[_0xc4fb('0x1d')][_0x4a3918[_0xc4fb('0x42')]['split']('-')[0x0]]['id'];this['channels'][_0x4a3918[_0xc4fb('0x3e')]][_0xc4fb('0x71')]=this[_0xc4fb('0x1d')][_0x4a3918[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]]['name'];}}}}else{if(this['channels'][_0x4a3918[_0xc4fb('0x39')]]){if(_0x4a3918[_0xc4fb('0x54')]==='6'){if(this[_0xc4fb('0x1d')][_0x4a3918['channel']['split']('-')[0x0]]){this[_0xc4fb('0x1c')][_0x4a3918[_0xc4fb('0x39')]][_0xc4fb('0x72')]=this[_0xc4fb('0x1d')][_0x4a3918[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]]['id'];this[_0xc4fb('0x1c')][_0x4a3918[_0xc4fb('0x39')]][_0xc4fb('0x71')]=this['agents'][_0x4a3918[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]][_0xc4fb('0x48')];}}}}if(_0x4a3918[_0xc4fb('0x54')]==='6'&&_0x4a3918[_0xc4fb('0x50')]===_0xc4fb('0x41')){if(this[_0xc4fb('0x1d')][_0x4a3918[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]]){this[_0xc4fb('0x1d')][_0x4a3918[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]][_0xc4fb('0x56')]=_0x4a3918[_0xc4fb('0x44')];var _0x3c49f3;if(this['channels'][_0x4a3918[_0xc4fb('0x39')]])_0x3c49f3=this[_0xc4fb('0x1c')][_0x4a3918[_0xc4fb('0x39')]][_0xc4fb('0x73')];else if(this['channels'][_0x4a3918['linkedid']])_0x3c49f3=this['channels'][_0x4a3918['linkedid']][_0xc4fb('0x73')];logger[_0xc4fb('0x3c')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x4a3918[_0xc4fb('0x39')],util[_0xc4fb('0x4c')]({'destaccountcode':this['agents'][_0x4a3918[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]][_0xc4fb('0x58')],'destconnectedlinenum':_0x4a3918[_0xc4fb('0x44')],'routealias':_0x3c49f3},{'showHidden':![],'depth':null}));this['emit'](util[_0xc4fb('0x46')](_0xc4fb('0x47'),this[_0xc4fb('0x1d')][_0x4a3918['channel'][_0xc4fb('0x43')]('-')[0x0]][_0xc4fb('0x48')]),_0xc4fb('0x49'),{'destaccountcode':this[_0xc4fb('0x1d')][_0x4a3918[_0xc4fb('0x42')]['split']('-')[0x0]][_0xc4fb('0x58')],'destconnectedlinenum':_0x4a3918[_0xc4fb('0x44')],'routealias':_0x3c49f3});}}}}catch(_0x53ee56){logger[_0xc4fb('0x32')](_0xc4fb('0x74'),_0x4a3918[_0xc4fb('0x39')],util[_0xc4fb('0x4c')](_0x53ee56,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc4fb('0x35')]['syncMixMonitorFilename']=function(_0x11d3c4,_0x2bb7b4){try{if(this[_0xc4fb('0x1c')][_0x11d3c4]){logger[_0xc4fb('0x2f')](_0xc4fb('0x75'),_0x11d3c4,_0x2bb7b4);this[_0xc4fb('0x1c')][_0x11d3c4]['monitor']=!![];if(_[_0xc4fb('0x76')](_0x2bb7b4,_0xc4fb('0x77'))){_0x2bb7b4=_0x2bb7b4['replace'](_0xc4fb('0x77'),_0xc4fb('0x78'));}this[_0xc4fb('0x1c')][_0x11d3c4][_0xc4fb('0x79')]=_0x2bb7b4;var _0x131664=_[_0xc4fb('0x7a')](this[_0xc4fb('0x1c')][_0x11d3c4]['monitors'],{'filename':_0x2bb7b4});if(_[_0xc4fb('0x7b')](_0x131664)){this[_0xc4fb('0x1c')][_0x11d3c4][_0xc4fb('0x7c')]['push']({'filename':_0x2bb7b4,'createdAt':moment()[_0xc4fb('0x46')](_0xc4fb('0x52')),'mixmonitorid':'','status':_0xc4fb('0x7d')});}}}catch(_0x5a7523){logger[_0xc4fb('0x32')](_0xc4fb('0x7e'),_0x11d3c4,util[_0xc4fb('0x4c')](_0x5a7523,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc4fb('0x35')]['syncVarSet']=function(_0xd348bb){try{if(this[_0xc4fb('0x37')](_0xd348bb)){logger[_0xc4fb('0x3c')](_0xc4fb('0x7f'),_0xd348bb[_0xc4fb('0x39')],util[_0xc4fb('0x4c')](_0xd348bb,{'showHidden':![],'depth':null}));if(this['channels'][_0xd348bb[_0xc4fb('0x39')]]&&_0xd348bb['channel']!=_0xc4fb('0x4e')){if(this['isNotNull'](_0xd348bb[_0xc4fb('0x80')])){if(this[_0xc4fb('0x37')](_0xd348bb[_0xc4fb('0x80')][_0xc4fb('0x81')])){logger['info'](_0xc4fb('0x82'),_0xd348bb['uniqueid'],_0xd348bb['value']);this[_0xc4fb('0x83')](_0xd348bb[_0xc4fb('0x39')],_0xd348bb[_0xc4fb('0x84')]);}else if(this[_0xc4fb('0x37')](_0xd348bb[_0xc4fb('0x80')][_0xc4fb('0x85')])){logger[_0xc4fb('0x2f')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0xd348bb[_0xc4fb('0x39')],_0xd348bb['value']);this[_0xc4fb('0x1c')][_0xd348bb[_0xc4fb('0x39')]]['calleridnum']=_0xd348bb[_0xc4fb('0x84')];}else if(this['isNotNull'](_0xd348bb[_0xc4fb('0x80')][_0xc4fb('0x86')])){logger['info'](_0xc4fb('0x87'),_0xd348bb[_0xc4fb('0x39')],_0xd348bb[_0xc4fb('0x84')]);this[_0xc4fb('0x1c')][_0xd348bb['uniqueid']][_0xc4fb('0x88')]=_0xd348bb['value'];}else if(this[_0xc4fb('0x37')](_0xd348bb[_0xc4fb('0x80')][_0xc4fb('0x89')])){logger['info'](_0xc4fb('0x8a'),_0xd348bb[_0xc4fb('0x39')],_0xd348bb[_0xc4fb('0x84')]);this[_0xc4fb('0x1c')][_0xd348bb[_0xc4fb('0x39')]][_0xc4fb('0x8b')]=_0xd348bb[_0xc4fb('0x84')];}else if(this['isNotNull'](_0xd348bb[_0xc4fb('0x80')][_0xc4fb('0x8c')])){logger[_0xc4fb('0x2f')](_0xc4fb('0x8d'),_0xd348bb[_0xc4fb('0x39')],_0xd348bb['value']['split'](',')[0x0]);this[_0xc4fb('0x1c')][_0xd348bb[_0xc4fb('0x39')]]['queue']=_0xd348bb[_0xc4fb('0x84')][_0xc4fb('0x43')](',')[0x0];}else if(this[_0xc4fb('0x37')](_0xd348bb[_0xc4fb('0x80')][_0xc4fb('0x8e')])){logger[_0xc4fb('0x2f')](_0xc4fb('0x8f'),_0xd348bb['uniqueid'],_0xd348bb['value']);this[_0xc4fb('0x1c')][_0xd348bb['uniqueid']][_0xc4fb('0x90')]=_0xd348bb[_0xc4fb('0x84')];}else if(this[_0xc4fb('0x37')](_0xd348bb['variable']['xmd-destination'])){logger[_0xc4fb('0x2f')](_0xc4fb('0x91'),_0xd348bb[_0xc4fb('0x39')],_0xd348bb[_0xc4fb('0x84')]);this[_0xc4fb('0x1c')][_0xd348bb['uniqueid']][_0xc4fb('0x92')]=_0xd348bb[_0xc4fb('0x84')];}else if(this[_0xc4fb('0x37')](_0xd348bb[_0xc4fb('0x80')][_0xc4fb('0x93')])){logger[_0xc4fb('0x2f')](_0xc4fb('0x94'),_0xd348bb[_0xc4fb('0x39')],_0xd348bb[_0xc4fb('0x84')]);this[_0xc4fb('0x1c')][_0xd348bb[_0xc4fb('0x39')]][_0xc4fb('0x95')]=_0xd348bb[_0xc4fb('0x84')];}else if(this[_0xc4fb('0x37')](_0xd348bb[_0xc4fb('0x80')][_0xc4fb('0x96')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0xd348bb['uniqueid'],_0xd348bb[_0xc4fb('0x84')]);this[_0xc4fb('0x1c')][_0xd348bb[_0xc4fb('0x39')]]['queue']=_0xd348bb[_0xc4fb('0x84')];}else if(this[_0xc4fb('0x37')](_0xd348bb['variable'][_0xc4fb('0x97')])){logger[_0xc4fb('0x2f')](_0xc4fb('0x98'),_0xd348bb[_0xc4fb('0x39')],_0xd348bb[_0xc4fb('0x84')]);this[_0xc4fb('0x1c')][_0xd348bb[_0xc4fb('0x39')]][_0xc4fb('0x99')]=_0xd348bb[_0xc4fb('0x84')];}}}else if(this[_0xc4fb('0x37')](_0xd348bb['variable']['mixmonitor_filename'])){if(_0xd348bb[_0xc4fb('0x84')]){var _0x2d4d2a=path[_0xc4fb('0x9a')](_0xd348bb['value'])['name'];logger[_0xc4fb('0x2f')](_0xc4fb('0x82'),_0x2d4d2a,_0xd348bb[_0xc4fb('0x84')]);this['syncMixMonitorFilename'](_0x2d4d2a,_0xd348bb[_0xc4fb('0x84')]);}}else if(this['channels'][_0xd348bb[_0xc4fb('0x3e')]]){if(this[_0xc4fb('0x37')](_0xd348bb[_0xc4fb('0x80')])){if(this['isNotNull'](_0xd348bb[_0xc4fb('0x80')][_0xc4fb('0x97')])){logger[_0xc4fb('0x2f')](_0xc4fb('0x98'),_0xd348bb[_0xc4fb('0x3e')],_0xd348bb['value']);this[_0xc4fb('0x1c')][_0xd348bb[_0xc4fb('0x3e')]][_0xc4fb('0x9b')]=_0xd348bb[_0xc4fb('0x84')];}}}}}catch(_0x500727){logger['error'](_0xc4fb('0x9c'),_0xd348bb['uniqueid'],util[_0xc4fb('0x4c')](_0x500727,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc4fb('0x35')][_0xc4fb('0x27')]=function(_0x1bad08){try{if(this['isNotNull'](_0x1bad08)){logger[_0xc4fb('0x3c')]('[%s][voiceCallReport][hangup]\x20event:',_0x1bad08[_0xc4fb('0x39')],util[_0xc4fb('0x4c')](_0x1bad08,{'showHidden':![],'depth':null}));if(this[_0xc4fb('0x1c')][_0x1bad08['uniqueid']]){logger['info'](_0xc4fb('0x9d'),_0x1bad08['uniqueid'],_0x1bad08[_0xc4fb('0x9e')]);var _0x499a54=moment();this['channels'][_0x1bad08[_0xc4fb('0x39')]][_0xc4fb('0x9f')]=_0x499a54[_0xc4fb('0x46')](_0xc4fb('0x52'));this['channels'][_0x1bad08[_0xc4fb('0x39')]][_0xc4fb('0x63')]=_0x499a54['diff'](this[_0xc4fb('0x1c')][_0x1bad08[_0xc4fb('0x39')]]['starttime'],'seconds');if(this[_0xc4fb('0x1c')][_0x1bad08[_0xc4fb('0x39')]][_0xc4fb('0x6d')]){this['channels'][_0x1bad08[_0xc4fb('0x39')]][_0xc4fb('0xa0')]=_0x499a54[_0xc4fb('0x6f')](this[_0xc4fb('0x1c')][_0x1bad08['uniqueid']]['answertime'],_0xc4fb('0x64'));this['channels'][_0x1bad08['uniqueid']]['holdtime']=this[_0xc4fb('0x1c')][_0x1bad08[_0xc4fb('0x39')]][_0xc4fb('0x63')]-this[_0xc4fb('0x1c')][_0x1bad08['uniqueid']][_0xc4fb('0xa0')];}if(_0x1bad08[_0xc4fb('0x50')]==='from-sip'){if(this[_0xc4fb('0x1d')][_0x1bad08[_0xc4fb('0x42')]['split']('-')[0x0]]){this[_0xc4fb('0x1d')][_0x1bad08[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]]=_[_0xc4fb('0xa1')](this[_0xc4fb('0x1d')][_0x1bad08[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]],[_0xc4fb('0x56')]);logger[_0xc4fb('0x3c')](_0xc4fb('0xa2'),_0x1bad08['uniqueid'],util[_0xc4fb('0x4c')]({'id':this[_0xc4fb('0x1d')][_0x1bad08[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x1bad08['channel'][_0xc4fb('0x43')]('-')[0x0]][_0xc4fb('0x58')]},{'showHidden':![],'depth':null}));this[_0xc4fb('0x36')](util[_0xc4fb('0x46')](_0xc4fb('0x47'),this[_0xc4fb('0x1d')][_0x1bad08[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]][_0xc4fb('0x48')]),_0xc4fb('0xa3'),{'id':this[_0xc4fb('0x1d')][_0x1bad08[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]]['id'],'destaccountcode':this[_0xc4fb('0x1d')][_0x1bad08[_0xc4fb('0x42')][_0xc4fb('0x43')]('-')[0x0]][_0xc4fb('0x58')]});}}var _0x132024=this;Promise[_0xc4fb('0xa4')]()[_0xc4fb('0xa5')](function(){var _0x14eee0=_0x132024[_0xc4fb('0x1c')][_0x1bad08['uniqueid']];if(typeof _0x14eee0['transferType']==='undefined')return;if(_[_0xc4fb('0xa6')](_0x14eee0[_0xc4fb('0x7c')]))return;return RpcSetting[_0xc4fb('0xa7')]()[_0xc4fb('0xa5')](function(_0x530d77){if(!_0x530d77[_0xc4fb('0xa8')])return;return Promise[_0xc4fb('0xa4')]()[_0xc4fb('0xa5')](function(){return ami[_0xc4fb('0xa9')]({'action':_0xc4fb('0xaa'),'channel':_0x14eee0[_0xc4fb('0x42')]})[_0xc4fb('0xab')](function(){});})[_0xc4fb('0xa5')](function(){return ami[_0xc4fb('0xa9')]({'action':'StopMixMonitor','channel':_0x14eee0[_0xc4fb('0xac')]})[_0xc4fb('0xab')](function(){})['finally'](function(){var _0x584a34=_0x132024[_0xc4fb('0x1d')][_0x14eee0[_0xc4fb('0xac')][_0xc4fb('0x43')]('-')[0x0]];if(!_0x584a34)return;io[_0xc4fb('0x36')]('webbar:stopmonitors',{'agentId':_0x584a34['id'],'uniqueid':_0x14eee0[_0xc4fb('0x39')]});});});});})[_0xc4fb('0xa5')](function(){if(_0x1bad08[_0xc4fb('0xad')]===_0xc4fb('0xae')){_0x132024[_0xc4fb('0x1e')][_0x1bad08[_0xc4fb('0x39')]]=_0x132024[_0xc4fb('0x1c')][_0x1bad08[_0xc4fb('0x39')]];}else{if(_0x132024[_0xc4fb('0x1c')][_0x1bad08[_0xc4fb('0x39')]][_0xc4fb('0x8b')]===_0xc4fb('0xaf')&&_0x132024['blindTransfers'][_0x1bad08[_0xc4fb('0x39')]]){_0x132024[_0xc4fb('0x1c')][_0x1bad08['uniqueid']][_0xc4fb('0x39')]=[_0x132024[_0xc4fb('0x1c')][_0x1bad08[_0xc4fb('0x39')]][_0xc4fb('0x3e')],_0x132024['channels'][_0x1bad08['uniqueid']][_0xc4fb('0x3e')]=_0x132024[_0xc4fb('0x1c')][_0x1bad08[_0xc4fb('0x39')]][_0xc4fb('0x39')]][0x0];delete _0x132024[_0xc4fb('0x1e')][_0x1bad08[_0xc4fb('0x39')]];}}logger['debug'](_0xc4fb('0xb0'),_0x1bad08['uniqueid'],util[_0xc4fb('0x4c')](_0x132024[_0xc4fb('0x1c')][_0x1bad08[_0xc4fb('0x39')]],{'showHidden':![],'depth':null}));ami[_0xc4fb('0x36')](_0xc4fb('0xb1'),_0x132024[_0xc4fb('0x1c')][_0x1bad08['uniqueid']]);delete _0x132024[_0xc4fb('0x1c')][_0x1bad08[_0xc4fb('0x39')]];});}}}catch(_0x25dbef){logger[_0xc4fb('0x32')]('[%s][voiceCallReport][hangup]',_0x1bad08[_0xc4fb('0x39')],util[_0xc4fb('0x4c')](_0x25dbef,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc4fb('0x35')]['syncAttendedTransfer']=function(_0x49daa5){try{if(this[_0xc4fb('0x37')](_0x49daa5)){logger[_0xc4fb('0x2f')](_0xc4fb('0xb2'),_0x49daa5['uniqueid'],_0x49daa5[_0xc4fb('0xb3')],_0x49daa5['transfertargetcalleridnum']);logger['debug'](_0xc4fb('0xb4'),_0x49daa5['uniqueid'],util['inspect'](_0x49daa5,{'showHidden':![],'depth':null}));if(this['channels'][_0x49daa5[_0xc4fb('0xb5')]]){this[_0xc4fb('0x1c')][_0x49daa5[_0xc4fb('0xb5')]]['transfercalleridnum']=_0x49daa5[_0xc4fb('0xb3')];this['channels'][_0x49daa5['transfereeuniqueid']]['transferconnectedlinenum']=_0x49daa5[_0xc4fb('0xb6')];if(this[_0xc4fb('0x1c')][_0x49daa5[_0xc4fb('0xb7')]]){var _0x4f450c=this[_0xc4fb('0x1c')][_0x49daa5['secondtransfereruniqueid']];this[_0xc4fb('0x1c')][_0x49daa5[_0xc4fb('0xb7')]]=this[_0xc4fb('0x1c')][_0x49daa5[_0xc4fb('0xb5')]];this[_0xc4fb('0x1c')][_0x49daa5['transfereeuniqueid']]=_0x4f450c;}}else if(this[_0xc4fb('0x1c')][_0x49daa5[_0xc4fb('0xb8')]]){this[_0xc4fb('0x1c')][_0x49daa5[_0xc4fb('0xb8')]][_0xc4fb('0xb9')]=_0x49daa5[_0xc4fb('0xb3')];this[_0xc4fb('0x1c')][_0x49daa5[_0xc4fb('0xb8')]][_0xc4fb('0xba')]=_0x49daa5[_0xc4fb('0xb6')];if(this['channels'][_0x49daa5[_0xc4fb('0xbb')]]){var _0x4f450c=this['channels'][_0x49daa5[_0xc4fb('0xbb')]];this['channels'][_0x49daa5[_0xc4fb('0xbb')]]=this['channels'][_0x49daa5[_0xc4fb('0xb8')]];this['channels'][_0x49daa5[_0xc4fb('0xb8')]]=_0x4f450c;}}if((this[_0xc4fb('0x1c')][_0x49daa5[_0xc4fb('0xbb')]]||this[_0xc4fb('0x1c')][_0x49daa5[_0xc4fb('0xbc')]])&&this[_0xc4fb('0x1c')][_0x49daa5['secondtransfereruniqueid']]){var _0x1fea29=_[_0xc4fb('0xbd')]([this[_0xc4fb('0x1c')][_0x49daa5[_0xc4fb('0xbb')]],this[_0xc4fb('0x1c')][_0x49daa5[_0xc4fb('0xbc')]],this[_0xc4fb('0x1c')][_0x49daa5[_0xc4fb('0xb7')]]],function(_0x5f38b2){return _0x5f38b2&&_0x5f38b2[_0xc4fb('0x8b')]==='outbound'&&_0x5f38b2['routeid'];});if(_0x1fea29){if(this[_0xc4fb('0x1c')][_0x49daa5[_0xc4fb('0xbb')]])this['channels'][_0x49daa5[_0xc4fb('0xbb')]][_0xc4fb('0xbe')]=_0xc4fb('0xbf');if(this[_0xc4fb('0x1c')][_0x49daa5[_0xc4fb('0xbc')]])this['channels'][_0x49daa5[_0xc4fb('0xbc')]][_0xc4fb('0xbe')]=_0xc4fb('0xbf');this[_0xc4fb('0x1c')][_0x49daa5[_0xc4fb('0xb7')]][_0xc4fb('0xbe')]=_0xc4fb('0xbf');}}}}catch(_0x3de71d){logger['error'](_0xc4fb('0xc0'),_0x49daa5[_0xc4fb('0x39')],util[_0xc4fb('0x4c')](_0x3de71d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc4fb('0x35')][_0xc4fb('0x2b')]=function(_0x4b6ce5){try{if(this[_0xc4fb('0x37')](_0x4b6ce5)){logger[_0xc4fb('0x2f')](_0xc4fb('0xc1'),_0x4b6ce5[_0xc4fb('0x39')],_0x4b6ce5[_0xc4fb('0xc2')],_0x4b6ce5[_0xc4fb('0xc3')]);logger['debug'](_0xc4fb('0xc4'),_0x4b6ce5[_0xc4fb('0x39')],util['inspect'](_0x4b6ce5,{'showHidden':![],'depth':null}));if(this[_0xc4fb('0x1c')][_0x4b6ce5[_0xc4fb('0xb5')]]){this['channels'][_0x4b6ce5['transfereeuniqueid']][_0xc4fb('0xb9')]=_0x4b6ce5[_0xc4fb('0xc2')];this[_0xc4fb('0x1c')][_0x4b6ce5[_0xc4fb('0xb5')]][_0xc4fb('0xba')]=_0x4b6ce5[_0xc4fb('0xc3')];this[_0xc4fb('0x1c')][_0x4b6ce5[_0xc4fb('0xb5')]][_0xc4fb('0xbe')]=_0xc4fb('0xc5');this['syncHangup']({'event':_0xc4fb('0xae'),'uniqueid':_0x4b6ce5[_0xc4fb('0xb5')],'context':_0x4b6ce5['context'],'channel':_0x4b6ce5[_0xc4fb('0xc6')]});}else{this[_0xc4fb('0x1c')][_0x4b6ce5[_0xc4fb('0xc7')]][_0xc4fb('0xbe')]=_0xc4fb('0xc5');}}}catch(_0x551aa2){logger[_0xc4fb('0x32')](_0xc4fb('0xc8'),_0x4b6ce5['uniqueid'],util['inspect'](_0x551aa2,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc4fb('0x2d')]=function(_0x4460df){try{if(this[_0xc4fb('0x37')](_0x4460df)){logger['debug']('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x4460df['uniqueid'],util[_0xc4fb('0x4c')](_0x4460df,{'showHidden':![],'depth':null}));if(this['channels'][_0x4460df[_0xc4fb('0x39')]]){if(!_['isNil'](this[_0xc4fb('0x1c')][_0x4460df[_0xc4fb('0x39')]][_0xc4fb('0x6e')])){this[_0xc4fb('0x1c')][_0x4460df[_0xc4fb('0x39')]][_0xc4fb('0xc9')]=moment()[_0xc4fb('0x46')](_0xc4fb('0x52'));logger[_0xc4fb('0x2f')](_0xc4fb('0xca'),_0x4460df[_0xc4fb('0x39')],this[_0xc4fb('0x1c')][_0x4460df[_0xc4fb('0x39')]]['mohstarttime']);}}}}catch(_0x51f62a){logger[_0xc4fb('0x32')](_0xc4fb('0xcb'),_0x4460df[_0xc4fb('0x39')],util['inspect'](_0x51f62a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc4fb('0x35')][_0xc4fb('0x2e')]=function(_0x1eddc3){try{if(this[_0xc4fb('0x37')](_0x1eddc3)){logger[_0xc4fb('0x3c')](_0xc4fb('0xcc'),_0x1eddc3['uniqueid'],util[_0xc4fb('0x4c')](_0x1eddc3,{'showHidden':![],'depth':null}));if(this[_0xc4fb('0x1c')][_0x1eddc3[_0xc4fb('0x39')]]){if(!_[_0xc4fb('0x7b')](this[_0xc4fb('0x1c')][_0x1eddc3[_0xc4fb('0x39')]]['mohstarttime'])){this[_0xc4fb('0x1c')][_0x1eddc3[_0xc4fb('0x39')]][_0xc4fb('0xcd')]+=moment()[_0xc4fb('0xce')](0x0)[_0xc4fb('0x6f')](this[_0xc4fb('0x1c')][_0x1eddc3[_0xc4fb('0x39')]]['mohstarttime'],_0xc4fb('0x64'));logger[_0xc4fb('0x2f')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x1eddc3[_0xc4fb('0x39')],this[_0xc4fb('0x1c')][_0x1eddc3[_0xc4fb('0x39')]][_0xc4fb('0xcd')]);delete this['channels'][_0x1eddc3[_0xc4fb('0x39')]][_0xc4fb('0xc9')];}}}}catch(_0x116db1){logger['error'](_0xc4fb('0xcf'),_0x1eddc3[_0xc4fb('0x39')],util[_0xc4fb('0x4c')](_0x116db1,{'showHidden':![],'depth':null}));}};module[_0xc4fb('0xd0')]=VoiceCallReport; \ No newline at end of file +var _0x9193=['pick','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:%s','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','cdr(','match','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20event:','answered','holdtime','connectedlinename','destinationchannel','toNumber','UserId','routealias','accountcode','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','OutgoingSpoolFailed','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','sipcalluniqueid','parse','sipcallid','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','diff','billableseconds','answertime','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','undefined','isEmpty','getSettings','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','some','origtransfererlinkedid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','queue','agi','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','varset','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','isUndefined','keys','context','from-sip','channel','exten','split','destconnectedlinenum','connectedlinenum','format','name','user:agentconnect','[%s][voiceCallReport][newchannel]\x20event:','info','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','disposition','channelstate','merge'];(function(_0x5a3f92,_0x23e7df){var _0x467063=function(_0x387be4){while(--_0x387be4){_0x5a3f92['push'](_0x5a3f92['shift']());}};_0x467063(++_0x23e7df);}(_0x9193,0x7e));var _0x3919=function(_0x587ba2,_0x42eb40){_0x587ba2=_0x587ba2-0x0;var _0x50ec73=_0x9193[_0x587ba2];return _0x50ec73;};'use strict';var BPromise=require(_0x3919('0x0'));var _=require(_0x3919('0x1'));var moment=require(_0x3919('0x2'));var util=require(_0x3919('0x3'));var path=require(_0x3919('0x4'));var Redis=require(_0x3919('0x5'));var config=require(_0x3919('0x6'));var logger=require(_0x3919('0x7'))('ami');var ami=require(_0x3919('0x8'));var Channel=require(_0x3919('0x9'));var RpcSetting=require(_0x3919('0xa'));var statusDesc=[_0x3919('0xb'),_0x3919('0xc'),_0x3919('0xd'),_0x3919('0xe'),_0x3919('0xf'),_0x3919('0x10'),_0x3919('0x11'),_0x3919('0x12'),_0x3919('0x13')];var applications=[_0x3919('0x14'),_0x3919('0x15'),_0x3919('0x16'),'dial',_0x3919('0x17'),_0x3919('0x18')];var dispositions=['NO\x20ANSWER',_0x3919('0x19'),_0x3919('0x19'),_0x3919('0x1a'),_0x3919('0x1a'),_0x3919('0x1a'),_0x3919('0x1b'),_0x3919('0x1c'),_0x3919('0x19'),_0x3919('0x19'),_0x3919('0x19')];var actions={};config[_0x3919('0x1d')]=_['defaults'](config[_0x3919('0x1d')],{'host':_0x3919('0x1e'),'port':0x18eb});var io=require(_0x3919('0x1f'))(new Redis(config[_0x3919('0x1d')]));function VoiceCallReport(_0x15f866){this[_0x3919('0x20')]=_0x15f866[_0x3919('0x20')];this[_0x3919('0x21')]=_0x15f866[_0x3919('0x21')];this[_0x3919('0x22')]={};ami['on'](_0x3919('0x23'),this[_0x3919('0x24')][_0x3919('0x25')](this));ami['on'](_0x3919('0x26'),this[_0x3919('0x24')][_0x3919('0x25')](this));ami['on'](_0x3919('0x27'),this[_0x3919('0x28')][_0x3919('0x25')](this));ami['on'](_0x3919('0x29'),this['syncNewState'][_0x3919('0x25')](this));ami['on'](_0x3919('0x2a'),this['syncVarSet']['bind'](this));ami['on'](_0x3919('0x2b'),this[_0x3919('0x2c')][_0x3919('0x25')](this));ami['on'](_0x3919('0x2d'),this[_0x3919('0x2e')][_0x3919('0x25')](this));ami['on'](_0x3919('0x2f'),this[_0x3919('0x30')][_0x3919('0x25')](this));ami['on'](_0x3919('0x31'),this[_0x3919('0x32')][_0x3919('0x25')](this));ami['on'](_0x3919('0x33'),this[_0x3919('0x34')]['bind'](this));ami['on'](_0x3919('0x35'),this[_0x3919('0x36')][_0x3919('0x25')](this));try{logger['info'](_0x3919('0x37'));ami[_0x3919('0x38')]();}catch(_0x1cedc3){logger[_0x3919('0x39')](_0x3919('0x3a'),util[_0x3919('0x3b')](_0x1cedc3,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x3919('0x3c')][_0x3919('0x3d')]=function(_0xd07104){return _0xd07104!==null&&!_['isUndefined'](_0xd07104);};VoiceCallReport[_0x3919('0x3c')][_0x3919('0x3e')]=function(_0x3847b2,_0x55a3dc,_0x3d09f3){io['to'](_0x3847b2)[_0x3919('0x3e')](_0x55a3dc,_0x3d09f3);};VoiceCallReport[_0x3919('0x3c')][_0x3919('0x2e')]=function(_0x3e5487){try{if(this[_0x3919('0x3d')](_0x3e5487)){logger['info'](_0x3919('0x3f'),_0x3e5487[_0x3919('0x40')],_0x3e5487[_0x3919('0x41')],_0x3e5487[_0x3919('0x42')]);logger[_0x3919('0x43')](_0x3919('0x44'),_0x3e5487['uniqueid'],util[_0x3919('0x3b')](_0x3e5487,{'showHidden':![],'depth':null}));if(_0x3e5487[_0x3919('0x40')]===_0x3e5487[_0x3919('0x45')]){if(!_[_0x3919('0x46')](this['channels'][_0x3e5487[_0x3919('0x40')]])){_['merge'](this[_0x3919('0x20')][_0x3e5487[_0x3919('0x40')]],_['pick'](_0x3e5487,_[_0x3919('0x47')](this['channels'][_0x3e5487['uniqueid']])));}}if(_0x3e5487[_0x3919('0x48')]===_0x3919('0x49')){if(this[_0x3919('0x21')][_0x3e5487[_0x3919('0x4a')]['split']('-')[0x0]]){if(_0x3e5487[_0x3919('0x4b')]=='xcally-motion-preview'){this[_0x3919('0x21')][_0x3e5487[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]][_0x3919('0x4d')]=_0x3e5487[_0x3919('0x4e')];this['emit'](util[_0x3919('0x4f')]('user:%s',this[_0x3919('0x21')][_0x3e5487[_0x3919('0x4a')]['split']('-')[0x0]][_0x3919('0x50')]),_0x3919('0x51'),{'destaccountcode':this[_0x3919('0x21')][_0x3e5487['channel'][_0x3919('0x4c')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3e5487[_0x3919('0x4e')]});}}}}}catch(_0x3fea28){logger[_0x3919('0x39')]('[%s][voiceCallReport][newcallerid]',_0x3e5487[_0x3919('0x40')],util[_0x3919('0x3b')](_0x3fea28,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3919('0x3c')][_0x3919('0x28')]=function(_0x579271){try{if(this[_0x3919('0x3d')](_0x579271)){logger[_0x3919('0x43')](_0x3919('0x52'),_0x579271['uniqueid'],util['inspect'](_0x579271,{'showHidden':![],'depth':null}));if(_0x579271[_0x3919('0x40')]===_0x579271[_0x3919('0x45')]&&_0x579271[_0x3919('0x4a')]!='OutgoingSpoolFailed'){if(_[_0x3919('0x46')](this[_0x3919('0x20')][_0x579271[_0x3919('0x40')]])){logger[_0x3919('0x53')](_0x3919('0x54'),_0x579271['uniqueid'],_0x579271[_0x3919('0x48')],_0x579271['exten']);this[_0x3919('0x20')][_0x579271['uniqueid']]=new Channel();this['channels'][_0x579271[_0x3919('0x40')]][_0x3919('0x55')]=moment()[_0x3919('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x579271[_0x3919('0x40')]][_0x3919('0x56')]=dispositions[_['toNumber'](_0x579271[_0x3919('0x57')])];_[_0x3919('0x58')](this['channels'][_0x579271[_0x3919('0x40')]],_[_0x3919('0x59')](_0x579271,_[_0x3919('0x47')](this['channels'][_0x579271[_0x3919('0x40')]])));if(_0x579271[_0x3919('0x48')]==='from-sip'){if(this[_0x3919('0x21')][_0x579271['channel'][_0x3919('0x4c')]('-')[0x0]]){if(_['isUndefined'](this[_0x3919('0x21')][_0x579271[_0x3919('0x4a')]['split']('-')[0x0]][_0x3919('0x4d')])){this[_0x3919('0x21')][_0x579271[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]][_0x3919('0x4d')]=_0x579271[_0x3919('0x4b')];logger[_0x3919('0x43')](_0x3919('0x5a'),_0x579271['uniqueid'],util[_0x3919('0x3b')]({'destaccountcode':this[_0x3919('0x21')][_0x579271['channel'][_0x3919('0x4c')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x579271[_0x3919('0x4b')]},{'showHidden':![],'depth':null}));this[_0x3919('0x3e')](util['format'](_0x3919('0x5b'),this[_0x3919('0x21')][_0x579271[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]][_0x3919('0x50')]),'user:agentconnect',{'destaccountcode':this[_0x3919('0x21')][_0x579271['channel'][_0x3919('0x4c')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x579271[_0x3919('0x4b')]});}}}}}}}catch(_0x1ab5d9){logger['error'](_0x3919('0x5c'),_0x579271[_0x3919('0x40')],util['inspect'](_0x1ab5d9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3919('0x3c')]['syncNewExten']=function(_0x3c6920){try{if(this[_0x3919('0x3d')](_0x3c6920)){logger['debug'](_0x3919('0x5d'),_0x3c6920[_0x3919('0x40')],util[_0x3919('0x3b')](_0x3c6920,{'showHidden':![],'depth':null}));if(_0x3c6920[_0x3919('0x40')]===_0x3c6920['linkedid']&&_0x3c6920[_0x3919('0x4b')]!='h'&&_0x3c6920['channel']!='OutgoingSpoolFailed'){_0x3c6920[_0x3919('0x5e')]=_0x3c6920[_0x3919('0x5e')][_0x3919('0x5f')]();_0x3c6920[_0x3919('0x60')]=_0x3c6920[_0x3919('0x61')]&&_0x3c6920[_0x3919('0x61')][_0x3919('0x62')](_0x3919('0x63'))?_0x3c6920[_0x3919('0x61')]:(_0x3c6920['appdata']||_0x3c6920['applicationdata'])[_0x3919('0x5f')]();logger[_0x3919('0x53')](_0x3919('0x64'),_0x3c6920[_0x3919('0x40')],_0x3c6920[_0x3919('0x5e')],_0x3c6920[_0x3919('0x60')]);if(_[_0x3919('0x46')](this[_0x3919('0x20')][_0x3c6920[_0x3919('0x40')]])){this['channels'][_0x3c6920[_0x3919('0x40')]]=new Channel();this['channels'][_0x3c6920[_0x3919('0x40')]][_0x3919('0x55')]=_0x3c6920[_0x3919('0x65')]?moment()['subtract'](moment['duration'](_0x3c6920['duration'])[_0x3919('0x66')](),_0x3919('0x66'))['format'](_0x3919('0x67')):moment()[_0x3919('0x4f')](_0x3919('0x67'));this[_0x3919('0x20')][_0x3c6920['uniqueid']][_0x3919('0x56')]=_0x3919('0x1a');}_[_0x3919('0x58')](this['channels'][_0x3c6920[_0x3919('0x40')]],_[_0x3919('0x59')](_0x3c6920,_[_0x3919('0x47')](this['channels'][_0x3c6920[_0x3919('0x40')]])));if(_[_0x3919('0x68')](applications,_0x3c6920[_0x3919('0x5e')])){this[_0x3919('0x20')][_0x3c6920[_0x3919('0x40')]][_0x3919('0x69')]=_0x3c6920[_0x3919('0x5e')];this['channels'][_0x3c6920[_0x3919('0x40')]][_0x3919('0x6a')]=_0x3c6920[_0x3919('0x60')];if(_0x3c6920[_0x3919('0x5e')]===_0x3919('0x14')&&_[_0x3919('0x62')](_0x3c6920[_0x3919('0x60')][_0x3919('0x5f')](),_0x3919('0x6b'))){var _0x247062=_0x3c6920[_0x3919('0x60')][_0x3919('0x4c')]('=');var _0x43ffd6=_0x247062[0x0][_0x3919('0x5f')]()[_0x3919('0x6c')](/cdr\((.*)\)/);if(_0x43ffd6){this[_0x3919('0x20')][_0x3c6920[_0x3919('0x40')]][_0x43ffd6[0x1]]=_0x247062[0x1];}}else if(_0x3c6920['application']===_0x3919('0x15')){this[_0x3919('0x20')][_0x3c6920['uniqueid']]['queue']=_0x3c6920[_0x3919('0x60')][_0x3919('0x4c')](',')[0x0];}}}}}catch(_0x724871){logger[_0x3919('0x39')](_0x3919('0x6d'),_0x3c6920[_0x3919('0x40')],util[_0x3919('0x3b')](_0x724871,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3919('0x3c')][_0x3919('0x6e')]=function(_0x19937e){try{if(this[_0x3919('0x3d')](_0x19937e)){logger[_0x3919('0x53')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x19937e[_0x3919('0x40')],_0x19937e[_0x3919('0x45')],_0x19937e[_0x3919('0x41')],_0x19937e[_0x3919('0x42')]);logger['debug'](_0x3919('0x6f'),_0x19937e[_0x3919('0x40')],util[_0x3919('0x3b')](_0x19937e,{'showHidden':![],'depth':null}));if(_0x19937e[_0x3919('0x40')]!==_0x19937e[_0x3919('0x45')]){if(this[_0x3919('0x20')][_0x19937e[_0x3919('0x45')]]){if(_0x19937e[_0x3919('0x57')]==='6'){if(!this[_0x3919('0x20')][_0x19937e['linkedid']][_0x3919('0x70')]){var _0x337b59=moment();this[_0x3919('0x20')][_0x19937e[_0x3919('0x45')]][_0x3919('0x70')]=!![];this[_0x3919('0x20')][_0x19937e[_0x3919('0x45')]]['answertime']=_0x337b59[_0x3919('0x4f')](_0x3919('0x67'));if(this[_0x3919('0x20')][_0x19937e['linkedid']][_0x3919('0x55')]){this['channels'][_0x19937e[_0x3919('0x45')]][_0x3919('0x71')]=_0x337b59['diff'](this[_0x3919('0x20')][_0x19937e['linkedid']][_0x3919('0x55')],'seconds');}}this[_0x3919('0x20')][_0x19937e[_0x3919('0x45')]][_0x3919('0x45')]=_0x19937e[_0x3919('0x40')];if(_0x19937e['calleridnum']!=='xcally-motion-preview'){this['channels'][_0x19937e[_0x3919('0x45')]]['connectedlinenum']=_0x19937e[_0x3919('0x42')];}this['channels'][_0x19937e[_0x3919('0x45')]][_0x3919('0x72')]=_0x19937e[_0x3919('0x41')];this['channels'][_0x19937e[_0x3919('0x45')]][_0x3919('0x73')]=_0x19937e[_0x3919('0x4a')];this[_0x3919('0x20')][_0x19937e[_0x3919('0x45')]][_0x3919('0x56')]=dispositions[_[_0x3919('0x74')](_0x19937e['channelstate'])];if(this['agents'][_0x19937e[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]]){this[_0x3919('0x20')][_0x19937e[_0x3919('0x45')]][_0x3919('0x75')]=this[_0x3919('0x21')][_0x19937e[_0x3919('0x4a')]['split']('-')[0x0]]['id'];this[_0x3919('0x20')][_0x19937e['linkedid']]['membername']=this[_0x3919('0x21')][_0x19937e[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]]['name'];}}}}else{if(this[_0x3919('0x20')][_0x19937e[_0x3919('0x40')]]){if(_0x19937e[_0x3919('0x57')]==='6'){if(this[_0x3919('0x21')][_0x19937e[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]]){this['channels'][_0x19937e[_0x3919('0x40')]][_0x3919('0x75')]=this[_0x3919('0x21')][_0x19937e[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]]['id'];this[_0x3919('0x20')][_0x19937e[_0x3919('0x40')]]['membername']=this['agents'][_0x19937e[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]][_0x3919('0x50')];}}}}if(_0x19937e[_0x3919('0x57')]==='6'&&_0x19937e[_0x3919('0x48')]==='from-sip'){if(this[_0x3919('0x21')][_0x19937e[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]]){this[_0x3919('0x21')][_0x19937e[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]]['destconnectedlinenum']=_0x19937e[_0x3919('0x4b')];var _0x5a5918;if(this[_0x3919('0x20')][_0x19937e[_0x3919('0x40')]])_0x5a5918=this[_0x3919('0x20')][_0x19937e[_0x3919('0x40')]][_0x3919('0x76')];else if(this[_0x3919('0x20')][_0x19937e['linkedid']])_0x5a5918=this[_0x3919('0x20')][_0x19937e[_0x3919('0x45')]][_0x3919('0x76')];logger['debug']('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x19937e['uniqueid'],util[_0x3919('0x3b')]({'destaccountcode':this['agents'][_0x19937e[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]][_0x3919('0x77')],'destconnectedlinenum':_0x19937e[_0x3919('0x4b')],'routealias':_0x5a5918},{'showHidden':![],'depth':null}));this[_0x3919('0x3e')](util[_0x3919('0x4f')]('user:%s',this[_0x3919('0x21')][_0x19937e[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]][_0x3919('0x50')]),_0x3919('0x51'),{'destaccountcode':this[_0x3919('0x21')][_0x19937e[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x19937e[_0x3919('0x4b')],'routealias':_0x5a5918});}}}}catch(_0x3836e1){logger['error'](_0x3919('0x78'),_0x19937e[_0x3919('0x40')],util[_0x3919('0x3b')](_0x3836e1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3919('0x3c')][_0x3919('0x79')]=function(_0x71b2b6,_0x4ebe42){try{if(this[_0x3919('0x20')][_0x71b2b6]){logger[_0x3919('0x53')](_0x3919('0x7a'),_0x71b2b6,_0x4ebe42);this[_0x3919('0x20')][_0x71b2b6][_0x3919('0x7b')]=!![];if(_[_0x3919('0x7c')](_0x4ebe42,_0x3919('0x7d'))){_0x4ebe42=_0x4ebe42[_0x3919('0x7e')](_0x3919('0x7d'),_0x3919('0x7f'));}this['channels'][_0x71b2b6]['monitorFilename']=_0x4ebe42;var _0x5ba7ef=_[_0x3919('0x80')](this[_0x3919('0x20')][_0x71b2b6][_0x3919('0x81')],{'filename':_0x4ebe42});if(_['isNil'](_0x5ba7ef)){this[_0x3919('0x20')][_0x71b2b6]['monitors'][_0x3919('0x82')]({'filename':_0x4ebe42,'createdAt':moment()['format'](_0x3919('0x67')),'mixmonitorid':'','status':_0x3919('0x83')});}}}catch(_0x3b67e9){logger[_0x3919('0x39')](_0x3919('0x84'),_0x71b2b6,util[_0x3919('0x3b')](_0x3b67e9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3919('0x3c')]['syncVarSet']=function(_0x1e948d){try{if(this['isNotNull'](_0x1e948d)){logger[_0x3919('0x43')](_0x3919('0x85'),_0x1e948d['uniqueid'],util[_0x3919('0x3b')](_0x1e948d,{'showHidden':![],'depth':null}));if(this[_0x3919('0x20')][_0x1e948d[_0x3919('0x40')]]&&_0x1e948d[_0x3919('0x4a')]!=_0x3919('0x86')){if(this[_0x3919('0x3d')](_0x1e948d[_0x3919('0x87')])){if(this['isNotNull'](_0x1e948d['variable'][_0x3919('0x88')])){logger['info'](_0x3919('0x89'),_0x1e948d['uniqueid'],_0x1e948d['value']);this['syncMixMonitorFilename'](_0x1e948d[_0x3919('0x40')],_0x1e948d[_0x3919('0x8a')]);}else if(this['isNotNull'](_0x1e948d[_0x3919('0x87')][_0x3919('0x8b')])){logger[_0x3919('0x53')](_0x3919('0x8c'),_0x1e948d['uniqueid'],_0x1e948d['value']);this[_0x3919('0x20')][_0x1e948d['uniqueid']][_0x3919('0x42')]=_0x1e948d['value'];}else if(this['isNotNull'](_0x1e948d[_0x3919('0x87')][_0x3919('0x8d')])){logger[_0x3919('0x53')](_0x3919('0x8e'),_0x1e948d[_0x3919('0x40')],_0x1e948d[_0x3919('0x8a')]);this[_0x3919('0x20')][_0x1e948d[_0x3919('0x40')]][_0x3919('0x8f')]=_0x1e948d['value'];}else if(this[_0x3919('0x3d')](_0x1e948d[_0x3919('0x87')][_0x3919('0x90')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x1e948d[_0x3919('0x40')],_0x1e948d[_0x3919('0x8a')]);this[_0x3919('0x20')][_0x1e948d['uniqueid']][_0x3919('0x91')]=_0x1e948d[_0x3919('0x8a')];}else if(this[_0x3919('0x3d')](_0x1e948d[_0x3919('0x87')][_0x3919('0x92')])){logger[_0x3919('0x53')](_0x3919('0x93'),_0x1e948d[_0x3919('0x40')],_0x1e948d[_0x3919('0x8a')][_0x3919('0x4c')](',')[0x0]);this[_0x3919('0x20')][_0x1e948d[_0x3919('0x40')]]['queue']=_0x1e948d[_0x3919('0x8a')][_0x3919('0x4c')](',')[0x0];}else if(this['isNotNull'](_0x1e948d['variable'][_0x3919('0x94')])){logger[_0x3919('0x53')](_0x3919('0x95'),_0x1e948d['uniqueid'],_0x1e948d['value']);this[_0x3919('0x20')][_0x1e948d[_0x3919('0x40')]][_0x3919('0x96')]=_0x1e948d[_0x3919('0x8a')];}else if(this[_0x3919('0x3d')](_0x1e948d[_0x3919('0x87')]['xmd-destination'])){logger[_0x3919('0x53')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x1e948d[_0x3919('0x40')],_0x1e948d['value']);this[_0x3919('0x20')][_0x1e948d[_0x3919('0x40')]][_0x3919('0x97')]=_0x1e948d['value'];}else if(this['isNotNull'](_0x1e948d[_0x3919('0x87')][_0x3919('0x98')])){logger[_0x3919('0x53')](_0x3919('0x99'),_0x1e948d[_0x3919('0x40')],_0x1e948d['value']);this[_0x3919('0x20')][_0x1e948d['uniqueid']]['calleridpreview']=_0x1e948d[_0x3919('0x8a')];}else if(this[_0x3919('0x3d')](_0x1e948d[_0x3919('0x87')][_0x3919('0x9a')])){logger[_0x3919('0x53')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x1e948d[_0x3919('0x40')],_0x1e948d['value']);this[_0x3919('0x20')][_0x1e948d[_0x3919('0x40')]][_0x3919('0x15')]=_0x1e948d['value'];}else if(this['isNotNull'](_0x1e948d['variable']['sipcallid'])){logger[_0x3919('0x53')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x1e948d[_0x3919('0x40')],_0x1e948d[_0x3919('0x8a')]);this['channels'][_0x1e948d[_0x3919('0x40')]][_0x3919('0x9b')]=_0x1e948d['value'];}}}else if(this['isNotNull'](_0x1e948d[_0x3919('0x87')]['mixmonitor_filename'])){if(_0x1e948d[_0x3919('0x8a')]){var _0x1d7fda=path[_0x3919('0x9c')](_0x1e948d['value'])[_0x3919('0x50')];logger[_0x3919('0x53')](_0x3919('0x89'),_0x1d7fda,_0x1e948d[_0x3919('0x8a')]);this[_0x3919('0x79')](_0x1d7fda,_0x1e948d[_0x3919('0x8a')]);}}else if(this['channels'][_0x1e948d['linkedid']]){if(this[_0x3919('0x3d')](_0x1e948d[_0x3919('0x87')])){if(this[_0x3919('0x3d')](_0x1e948d[_0x3919('0x87')][_0x3919('0x9d')])){logger[_0x3919('0x53')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x1e948d['linkedid'],_0x1e948d[_0x3919('0x8a')]);this[_0x3919('0x20')][_0x1e948d[_0x3919('0x45')]][_0x3919('0x9e')]=_0x1e948d[_0x3919('0x8a')];}}}}}catch(_0x4a2b27){logger[_0x3919('0x39')](_0x3919('0x9f'),_0x1e948d['uniqueid'],util[_0x3919('0x3b')](_0x4a2b27,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3919('0x3c')]['syncHangup']=function(_0x2c8ab3){try{if(this[_0x3919('0x3d')](_0x2c8ab3)){logger['debug']('[%s][voiceCallReport][hangup]\x20event:',_0x2c8ab3['uniqueid'],util[_0x3919('0x3b')](_0x2c8ab3,{'showHidden':![],'depth':null}));if(this[_0x3919('0x20')][_0x2c8ab3[_0x3919('0x40')]]){logger[_0x3919('0x53')](_0x3919('0xa0'),_0x2c8ab3[_0x3919('0x40')],_0x2c8ab3[_0x3919('0xa1')]);var _0xe5583d=moment();this['channels'][_0x2c8ab3[_0x3919('0x40')]][_0x3919('0xa2')]=_0xe5583d['format'](_0x3919('0x67'));this[_0x3919('0x20')][_0x2c8ab3[_0x3919('0x40')]][_0x3919('0x65')]=_0xe5583d[_0x3919('0xa3')](this[_0x3919('0x20')][_0x2c8ab3[_0x3919('0x40')]][_0x3919('0x55')],_0x3919('0x66'));if(this[_0x3919('0x20')][_0x2c8ab3[_0x3919('0x40')]]['answered']){this['channels'][_0x2c8ab3[_0x3919('0x40')]][_0x3919('0xa4')]=_0xe5583d[_0x3919('0xa3')](this[_0x3919('0x20')][_0x2c8ab3[_0x3919('0x40')]][_0x3919('0xa5')],'seconds');this[_0x3919('0x20')][_0x2c8ab3[_0x3919('0x40')]][_0x3919('0x71')]=this['channels'][_0x2c8ab3[_0x3919('0x40')]]['duration']-this[_0x3919('0x20')][_0x2c8ab3['uniqueid']][_0x3919('0xa4')];}if(_0x2c8ab3[_0x3919('0x48')]==='from-sip'){if(this['agents'][_0x2c8ab3[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]]){this[_0x3919('0x21')][_0x2c8ab3[_0x3919('0x4a')]['split']('-')[0x0]]=_[_0x3919('0xa6')](this['agents'][_0x2c8ab3[_0x3919('0x4a')]['split']('-')[0x0]],[_0x3919('0x4d')]);logger[_0x3919('0x43')](_0x3919('0xa7'),_0x2c8ab3['uniqueid'],util['inspect']({'id':this[_0x3919('0x21')][_0x2c8ab3[_0x3919('0x4a')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x3919('0x21')][_0x2c8ab3[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]][_0x3919('0x77')]},{'showHidden':![],'depth':null}));this[_0x3919('0x3e')](util[_0x3919('0x4f')](_0x3919('0x5b'),this['agents'][_0x2c8ab3[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]]['name']),_0x3919('0xa8'),{'id':this[_0x3919('0x21')][_0x2c8ab3[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]]['id'],'destaccountcode':this[_0x3919('0x21')][_0x2c8ab3[_0x3919('0x4a')][_0x3919('0x4c')]('-')[0x0]][_0x3919('0x77')]});}}var _0xc04193=this;Promise[_0x3919('0xa9')]()[_0x3919('0xaa')](function(){var _0x18519f=_0xc04193[_0x3919('0x20')][_0x2c8ab3[_0x3919('0x40')]];if(typeof _0x18519f[_0x3919('0xab')]===_0x3919('0xac'))return;if(_[_0x3919('0xad')](_0x18519f[_0x3919('0x81')]))return;return RpcSetting[_0x3919('0xae')]()[_0x3919('0xaa')](function(_0x2b3dae){if(!_0x2b3dae['stopRecordingOnTransfer'])return;return Promise[_0x3919('0xa9')]()['then'](function(){return ami[_0x3919('0xaf')]({'action':_0x3919('0xb0'),'channel':_0x18519f[_0x3919('0x4a')]})[_0x3919('0xb1')](function(){});})[_0x3919('0xaa')](function(){return ami['Action']({'action':_0x3919('0xb0'),'channel':_0x18519f[_0x3919('0x73')]})[_0x3919('0xb1')](function(){})[_0x3919('0xb2')](function(){var _0x5c723a=_0xc04193[_0x3919('0x21')][_0x18519f[_0x3919('0x73')]['split']('-')[0x0]];if(!_0x5c723a)return;io['emit'](_0x3919('0xb3'),{'agentId':_0x5c723a['id'],'uniqueid':_0x18519f[_0x3919('0x40')]});});});});})[_0x3919('0xaa')](function(){if(_0x2c8ab3[_0x3919('0xb4')]===_0x3919('0xb5')){_0xc04193[_0x3919('0x22')][_0x2c8ab3[_0x3919('0x40')]]=_0xc04193[_0x3919('0x20')][_0x2c8ab3['uniqueid']];}else{if(_0xc04193['channels'][_0x2c8ab3[_0x3919('0x40')]][_0x3919('0x91')]===_0x3919('0xb6')&&_0xc04193['blindTransfers'][_0x2c8ab3[_0x3919('0x40')]]){_0xc04193['channels'][_0x2c8ab3[_0x3919('0x40')]][_0x3919('0x40')]=[_0xc04193[_0x3919('0x20')][_0x2c8ab3['uniqueid']][_0x3919('0x45')],_0xc04193[_0x3919('0x20')][_0x2c8ab3[_0x3919('0x40')]][_0x3919('0x45')]=_0xc04193[_0x3919('0x20')][_0x2c8ab3[_0x3919('0x40')]][_0x3919('0x40')]][0x0];delete _0xc04193[_0x3919('0x22')][_0x2c8ab3[_0x3919('0x40')]];}}logger[_0x3919('0x43')](_0x3919('0xb7'),_0x2c8ab3[_0x3919('0x40')],util[_0x3919('0x3b')](_0xc04193[_0x3919('0x20')][_0x2c8ab3[_0x3919('0x40')]],{'showHidden':![],'depth':null}));ami[_0x3919('0x3e')](_0x3919('0xb8'),_0xc04193[_0x3919('0x20')][_0x2c8ab3[_0x3919('0x40')]]);delete _0xc04193[_0x3919('0x20')][_0x2c8ab3[_0x3919('0x40')]];});}}}catch(_0x3e6564){logger['error'](_0x3919('0xb9'),_0x2c8ab3['uniqueid'],util[_0x3919('0x3b')](_0x3e6564,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncAttendedTransfer']=function(_0x3fde7f){try{if(this[_0x3919('0x3d')](_0x3fde7f)){logger[_0x3919('0x53')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x3fde7f['uniqueid'],_0x3fde7f[_0x3919('0xba')],_0x3fde7f[_0x3919('0xbb')]);logger[_0x3919('0x43')](_0x3919('0xbc'),_0x3fde7f[_0x3919('0x40')],util[_0x3919('0x3b')](_0x3fde7f,{'showHidden':![],'depth':null}));if(this[_0x3919('0x20')][_0x3fde7f[_0x3919('0xbd')]]){this[_0x3919('0x20')][_0x3fde7f[_0x3919('0xbd')]][_0x3919('0xbe')]=_0x3fde7f[_0x3919('0xba')];this[_0x3919('0x20')][_0x3fde7f[_0x3919('0xbd')]][_0x3919('0xbf')]=_0x3fde7f[_0x3919('0xbb')];if(this['channels'][_0x3fde7f[_0x3919('0xc0')]]){var _0x4f990e=this['channels'][_0x3fde7f[_0x3919('0xc0')]];this[_0x3919('0x20')][_0x3fde7f['secondtransfereruniqueid']]=this[_0x3919('0x20')][_0x3fde7f[_0x3919('0xbd')]];this[_0x3919('0x20')][_0x3fde7f[_0x3919('0xbd')]]=_0x4f990e;}}else if(this['channels'][_0x3fde7f['transfertargetuniqueid']]){this[_0x3919('0x20')][_0x3fde7f[_0x3919('0xc1')]][_0x3919('0xbe')]=_0x3fde7f[_0x3919('0xba')];this[_0x3919('0x20')][_0x3fde7f['transfertargetuniqueid']][_0x3919('0xbf')]=_0x3fde7f[_0x3919('0xbb')];if(this['channels'][_0x3fde7f[_0x3919('0xc2')]]){var _0x4f990e=this[_0x3919('0x20')][_0x3fde7f[_0x3919('0xc2')]];this[_0x3919('0x20')][_0x3fde7f['origtransfereruniqueid']]=this[_0x3919('0x20')][_0x3fde7f[_0x3919('0xc1')]];this[_0x3919('0x20')][_0x3fde7f[_0x3919('0xc1')]]=_0x4f990e;}}if((this[_0x3919('0x20')][_0x3fde7f[_0x3919('0xc2')]]||this['channels'][_0x3fde7f['origtransfererlinkedid']])&&this[_0x3919('0x20')][_0x3fde7f['secondtransfereruniqueid']]){var _0x5552c8=_[_0x3919('0xc3')]([this[_0x3919('0x20')][_0x3fde7f[_0x3919('0xc2')]],this[_0x3919('0x20')][_0x3fde7f[_0x3919('0xc4')]],this[_0x3919('0x20')][_0x3fde7f[_0x3919('0xc0')]]],function(_0x392e49){return _0x392e49&&_0x392e49[_0x3919('0x91')]===_0x3919('0xb6')&&_0x392e49['routeid'];});if(_0x5552c8){if(this['channels'][_0x3fde7f[_0x3919('0xc2')]])this['channels'][_0x3fde7f['origtransfereruniqueid']][_0x3919('0xab')]='ATTENDED';if(this[_0x3919('0x20')][_0x3fde7f[_0x3919('0xc4')]])this[_0x3919('0x20')][_0x3fde7f[_0x3919('0xc4')]]['transferType']='ATTENDED';this['channels'][_0x3fde7f[_0x3919('0xc0')]][_0x3919('0xab')]=_0x3919('0xc5');}}}}catch(_0x4ebd3b){logger[_0x3919('0x39')](_0x3919('0xc6'),_0x3fde7f[_0x3919('0x40')],util[_0x3919('0x3b')](_0x4ebd3b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x3919('0x32')]=function(_0x5a9fde){try{if(this[_0x3919('0x3d')](_0x5a9fde)){logger['info'](_0x3919('0xc7'),_0x5a9fde[_0x3919('0x40')],_0x5a9fde[_0x3919('0xc8')],_0x5a9fde[_0x3919('0xc9')]);logger['debug'](_0x3919('0xca'),_0x5a9fde[_0x3919('0x40')],util[_0x3919('0x3b')](_0x5a9fde,{'showHidden':![],'depth':null}));if(this[_0x3919('0x20')][_0x5a9fde[_0x3919('0xbd')]]){this[_0x3919('0x20')][_0x5a9fde['transfereeuniqueid']][_0x3919('0xbe')]=_0x5a9fde[_0x3919('0xc8')];this[_0x3919('0x20')][_0x5a9fde[_0x3919('0xbd')]][_0x3919('0xbf')]=_0x5a9fde['extension'];this[_0x3919('0x20')][_0x5a9fde['transfereeuniqueid']][_0x3919('0xab')]=_0x3919('0xcb');this['syncHangup']({'event':_0x3919('0xb5'),'uniqueid':_0x5a9fde[_0x3919('0xbd')],'context':_0x5a9fde[_0x3919('0x48')],'channel':_0x5a9fde[_0x3919('0xcc')]});}else{this[_0x3919('0x20')][_0x5a9fde[_0x3919('0xcd')]]['transferType']=_0x3919('0xcb');}}}catch(_0x42d079){logger[_0x3919('0x39')](_0x3919('0xce'),_0x5a9fde['uniqueid'],util[_0x3919('0x3b')](_0x42d079,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3919('0x3c')][_0x3919('0x34')]=function(_0x370ae3){try{if(this['isNotNull'](_0x370ae3)){logger['debug'](_0x3919('0xcf'),_0x370ae3[_0x3919('0x40')],util[_0x3919('0x3b')](_0x370ae3,{'showHidden':![],'depth':null}));if(this['channels'][_0x370ae3[_0x3919('0x40')]]){if(!_[_0x3919('0xd0')](this[_0x3919('0x20')][_0x370ae3[_0x3919('0x40')]][_0x3919('0xa5')])){this[_0x3919('0x20')][_0x370ae3[_0x3919('0x40')]][_0x3919('0xd1')]=moment()[_0x3919('0x4f')](_0x3919('0x67'));logger['info'](_0x3919('0xd2'),_0x370ae3[_0x3919('0x40')],this['channels'][_0x370ae3[_0x3919('0x40')]][_0x3919('0xd1')]);}}}}catch(_0x28cef8){logger[_0x3919('0x39')]('[%s][voiceCallReport][musiconholdstart]',_0x370ae3[_0x3919('0x40')],util[_0x3919('0x3b')](_0x28cef8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3919('0x3c')][_0x3919('0x36')]=function(_0x3d3ae6){try{if(this[_0x3919('0x3d')](_0x3d3ae6)){logger['debug']('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x3d3ae6[_0x3919('0x40')],util['inspect'](_0x3d3ae6,{'showHidden':![],'depth':null}));if(this[_0x3919('0x20')][_0x3d3ae6[_0x3919('0x40')]]){if(!_[_0x3919('0xd0')](this[_0x3919('0x20')][_0x3d3ae6[_0x3919('0x40')]][_0x3919('0xd1')])){this[_0x3919('0x20')][_0x3d3ae6[_0x3919('0x40')]][_0x3919('0xd3')]+=moment()['milliseconds'](0x0)[_0x3919('0xa3')](this['channels'][_0x3d3ae6[_0x3919('0x40')]]['mohstarttime'],_0x3919('0x66'));logger['info'](_0x3919('0xd4'),_0x3d3ae6['uniqueid'],this['channels'][_0x3d3ae6[_0x3919('0x40')]][_0x3919('0xd3')]);delete this['channels'][_0x3d3ae6[_0x3919('0x40')]]['mohstarttime'];}}}}catch(_0x55e888){logger[_0x3919('0x39')](_0x3919('0xd5'),_0x3d3ae6['uniqueid'],util[_0x3919('0x3b')](_0x55e888,{'showHidden':![],'depth':null}));}};module[_0x3919('0xd6')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 6bc3fdb..66fff0d 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd68e=['prototype','isNotNull','emit','[%s][voiceDialReport][dialbegin]\x20event:','inspect','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','lastIndexOf','channel','omit','event','privilege','info','membername','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','variable','value','outboundrouteid','isUndefined','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','sipuri','bridgepeer','memberinterface','memberlastcall','memberpenalty','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','cause-txt','endtime','duration','diff','starttime','seconds','total','answered','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceDialReport][newexten]','exports','lodash','ioredis','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','outbound','applications','variables','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','syncNewExten','hangup'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd68e,0x145));var _0xed68=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xd68e[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xed68('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0xed68('0x1'));var config=require('../../../config/environment');var logger=require(_0xed68('0x2'))(_0xed68('0x3'));var ami=require(_0xed68('0x4'));config['redis']=_['defaults'](config[_0xed68('0x5')],{'host':_0xed68('0x6'),'port':0x18eb});var io=require(_0xed68('0x7'))(new Redis(config['redis']));function VoiceDialReport(_0x2f28fe){this[_0xed68('0x8')]=_0x2f28fe['outboundChannels'];this[_0xed68('0x9')]=_0x2f28fe[_0xed68('0x9')];this[_0xed68('0xa')]={};this[_0xed68('0xb')]={};ami['on']('dialbegin',this[_0xed68('0xc')][_0xed68('0xd')](this));ami['on'](_0xed68('0xe'),this[_0xed68('0xf')][_0xed68('0xd')](this));ami['on'](_0xed68('0x10'),this[_0xed68('0x11')][_0xed68('0xd')](this));ami['on']('newexten',this[_0xed68('0x12')][_0xed68('0xd')](this));ami['on'](_0xed68('0x13'),this['syncHangup'][_0xed68('0xd')](this));}VoiceDialReport[_0xed68('0x14')][_0xed68('0x15')]=function(_0x2d6c36){return _0x2d6c36!==null&&!_['isUndefined'](_0x2d6c36);};VoiceDialReport[_0xed68('0x14')][_0xed68('0x16')]=function(_0x451b06,_0x485576,_0x5ca82c){io['to'](_0x451b06)[_0xed68('0x16')](_0x485576,_0x5ca82c);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x4092ab){try{if(this[_0xed68('0x15')](_0x4092ab)){logger['debug'](_0xed68('0x17'),_0x4092ab['uniqueid'],util[_0xed68('0x18')](_0x4092ab,{'showHidden':![],'depth':null}));if(this[_0xed68('0x8')][_0x4092ab[_0xed68('0x19')]]){_[_0xed68('0x1a')](this['channels'][_0x4092ab[_0xed68('0x19')]],{'starttime':moment()[_0xed68('0x1b')](_0xed68('0x1c')),'lastevent':_0xed68('0x1d'),'interface':_0x4092ab['channel'][_0xed68('0x1e')](0x0,_0x4092ab['channel'][_0xed68('0x1f')]('-')),'membername':_0x4092ab[_0xed68('0x20')][_0xed68('0x1e')](_0x4092ab[_0xed68('0x20')][_0xed68('0x1f')]('/')+0x1,_0x4092ab[_0xed68('0x20')][_0xed68('0x1f')]('-'))},_[_0xed68('0x21')](_0x4092ab,[_0xed68('0x22'),_0xed68('0x23')]));logger[_0xed68('0x24')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x4092ab['uniqueid'],this[_0xed68('0x8')][_0x4092ab['uniqueid']][_0xed68('0x25')],this[_0xed68('0x8')][_0x4092ab['uniqueid']]['interface']);logger['debug'](_0xed68('0x26'),_0x4092ab[_0xed68('0x19')],util[_0xed68('0x18')](this[_0xed68('0x8')][_0x4092ab[_0xed68('0x19')]],{'showHidden':![],'depth':null}));if(this[_0xed68('0xa')][_0x4092ab[_0xed68('0x19')]])_[_0xed68('0x1a')](this[_0xed68('0x8')][_0x4092ab['uniqueid']],this[_0xed68('0xa')][_0x4092ab[_0xed68('0x19')]]);this[_0xed68('0x16')](_0xed68('0x27'),'voice_outbound_channel:save',this[_0xed68('0x8')][_0x4092ab[_0xed68('0x19')]]);logger[_0xed68('0x28')](_0xed68('0x29'),_0x4092ab[_0xed68('0x19')],util[_0xed68('0x18')](this[_0xed68('0x8')][_0x4092ab[_0xed68('0x19')]],{'showHidden':![],'depth':null}));ami[_0xed68('0x16')](_0xed68('0x2a'),this[_0xed68('0x8')][_0x4092ab[_0xed68('0x19')]]);}}}catch(_0x12d7ef){logger[_0xed68('0x2b')](_0xed68('0x2c'),_0x4092ab['uniqueid'],util[_0xed68('0x18')](_0x12d7ef,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xed68('0x14')][_0xed68('0xf')]=function(_0x4c54e3){try{if(this[_0xed68('0x15')](_0x4c54e3)){logger[_0xed68('0x28')]('[%s][voiceDialReport][dialend]\x20event:',_0x4c54e3[_0xed68('0x19')],util[_0xed68('0x18')](_0x4c54e3,{'showHidden':![],'depth':null}));if(this[_0xed68('0x8')][_0x4c54e3['uniqueid']]){this[_0xed68('0x8')][_0x4c54e3[_0xed68('0x19')]]['dialstatus']=_0x4c54e3['dialstatus'];if(_0x4c54e3[_0xed68('0x2d')]===_0xed68('0x2e')){this[_0xed68('0x8')][_0x4c54e3['uniqueid']][_0xed68('0x2f')]=_0x4c54e3[_0xed68('0x2f')];this[_0xed68('0x8')][_0x4c54e3[_0xed68('0x19')]][_0xed68('0x30')]=_0x4c54e3['connectedlinename'];this[_0xed68('0x8')][_0x4c54e3['uniqueid']][_0xed68('0x31')]=moment()[_0xed68('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xed68('0x8')][_0x4c54e3[_0xed68('0x19')]][_0xed68('0x32')]=_0xed68('0x33');logger['info'](_0xed68('0x34'),_0x4c54e3[_0xed68('0x19')],_0x4c54e3[_0xed68('0x20')][_0xed68('0x1e')](_0x4c54e3[_0xed68('0x20')][_0xed68('0x1f')]('/')+0x1,_0x4c54e3[_0xed68('0x20')][_0xed68('0x1f')]('-')));logger[_0xed68('0x28')](_0xed68('0x35'),_0x4c54e3[_0xed68('0x19')],util['inspect'](this[_0xed68('0x8')][_0x4c54e3[_0xed68('0x19')]],{'showHidden':![],'depth':null}));ami[_0xed68('0x16')](_0xed68('0x36'),this[_0xed68('0x8')][_0x4c54e3[_0xed68('0x19')]]);}logger['debug']('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x4c54e3[_0xed68('0x19')],util[_0xed68('0x18')](this['channels'][_0x4c54e3['uniqueid']],{'showHidden':![],'depth':null}));this[_0xed68('0x16')](_0xed68('0x27'),'voice_outbound_channel:save',this['channels'][_0x4c54e3[_0xed68('0x19')]]);}}}catch(_0x1b633b){logger['error'](_0xed68('0x37'),_0x4c54e3[_0xed68('0x19')],util[_0xed68('0x18')](_0x1b633b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xed68('0x14')][_0xed68('0x11')]=function(_0x5b5ca2){try{if(this[_0xed68('0x15')](_0x5b5ca2)){logger['debug'](_0xed68('0x38'),_0x5b5ca2['uniqueid'],util[_0xed68('0x18')](_0x5b5ca2,{'showHidden':![],'depth':null}));this[_0xed68('0x39')](_0x5b5ca2[_0xed68('0x19')],_['keys'](_0x5b5ca2[_0xed68('0x3a')])[0x0],_0x5b5ca2[_0xed68('0x3b')]);if(this[_0xed68('0x15')](_0x5b5ca2['variable'])&&this['isNotNull'](_0x5b5ca2[_0xed68('0x3a')][_0xed68('0x3c')])){if(_[_0xed68('0x3d')](this[_0xed68('0x8')][_0x5b5ca2[_0xed68('0x19')]])){this['channels'][_0x5b5ca2[_0xed68('0x19')]]={'routeId':_0x5b5ca2[_0xed68('0x3b')],'variables':this[_0xed68('0xb')][_0x5b5ca2[_0xed68('0x19')]]};logger[_0xed68('0x24')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x5b5ca2[_0xed68('0x19')],_0x5b5ca2[_0xed68('0x3a')][_0xed68('0x3c')],_['keys'](_0x5b5ca2[_0xed68('0x3a')])[0x0],_0x5b5ca2[_0xed68('0x3b')]);logger[_0xed68('0x28')](_0xed68('0x3e'),_0x5b5ca2['uniqueid'],util[_0xed68('0x18')](this['channels'][_0x5b5ca2[_0xed68('0x19')]],{'showHidden':![],'depth':null}));this[_0xed68('0x16')]('voice:outbound',_0xed68('0x3f'),this['channels'][_0x5b5ca2[_0xed68('0x19')]]);}}}}catch(_0x480d94){logger['error']('[%s][voiceDialReport][varset]',_0x5b5ca2[_0xed68('0x19')],util[_0xed68('0x18')](_0x480d94,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xed68('0x14')][_0xed68('0x39')]=function(_0x417cdc,_0x76d2b6,_0x1bea04){var _0x514058=[_0xed68('0x40'),_0xed68('0x41'),_0xed68('0x42'),_0xed68('0x43'),_0xed68('0x44'),_0xed68('0x45'),'rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid',_0xed68('0x46'),_0xed68('0x47'),'bridgepvtcallid','membercalls','memberdynamic',_0xed68('0x48'),_0xed68('0x49'),_0xed68('0x25'),_0xed68('0x4a'),'memberrealtime'];if(!_[_0xed68('0x4b')](_0x76d2b6)&&!_[_0xed68('0x4c')](_0x514058,_0x76d2b6)){if(_['isUndefined'](this[_0xed68('0xb')][_0x417cdc])){this['variables'][_0x417cdc]={};}this['variables'][_0x417cdc][_0x76d2b6]=_0x1bea04;}};VoiceDialReport['prototype']['syncHangup']=function(_0x4faade){try{if(this[_0xed68('0x15')](_0x4faade)){logger['debug'](_0xed68('0x4d'),_0x4faade[_0xed68('0x19')],util[_0xed68('0x18')](_0x4faade,{'showHidden':![],'depth':null}));if(this[_0xed68('0x8')][_0x4faade[_0xed68('0x19')]]){logger[_0xed68('0x24')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x4faade['uniqueid'],_0x4faade[_0xed68('0x4e')]);this['channels'][_0x4faade[_0xed68('0x19')]][_0xed68('0x4f')]=moment()[_0xed68('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xed68('0x8')][_0x4faade[_0xed68('0x19')]][_0xed68('0x50')]=moment(this['channels'][_0x4faade[_0xed68('0x19')]][_0xed68('0x4f')])[_0xed68('0x51')](this[_0xed68('0x8')][_0x4faade['uniqueid']][_0xed68('0x52')],_0xed68('0x53'));this[_0xed68('0x8')][_0x4faade[_0xed68('0x19')]][_0xed68('0x32')]='complete';this['outbound'][_0xed68('0x54')]+=0x1;if(this[_0xed68('0x8')][_0x4faade[_0xed68('0x19')]][_0xed68('0x31')]){this['outbound'][_0xed68('0x55')]+=0x1;this[_0xed68('0x8')][_0x4faade[_0xed68('0x19')]][_0xed68('0x56')]=moment(this['channels'][_0x4faade[_0xed68('0x19')]][_0xed68('0x31')])[_0xed68('0x51')](this[_0xed68('0x8')][_0x4faade[_0xed68('0x19')]]['starttime'],_0xed68('0x53'));this[_0xed68('0x8')][_0x4faade['uniqueid']][_0xed68('0x57')]=moment(this['channels'][_0x4faade['uniqueid']][_0xed68('0x4f')])['diff'](this[_0xed68('0x8')][_0x4faade[_0xed68('0x19')]][_0xed68('0x31')],_0xed68('0x53'));this[_0xed68('0x9')][_0xed68('0x58')]+=this[_0xed68('0x8')][_0x4faade[_0xed68('0x19')]]['holdtime']||0x0;this['outbound'][_0xed68('0x59')]+=this[_0xed68('0x8')][_0x4faade['uniqueid']]['billableseconds'];}this[_0xed68('0x9')][_0xed68('0x5a')]+=this[_0xed68('0x8')][_0x4faade[_0xed68('0x19')]]['duration'];logger[_0xed68('0x28')](_0xed68('0x5b'),_0x4faade[_0xed68('0x19')],util[_0xed68('0x18')](this[_0xed68('0x8')][_0x4faade[_0xed68('0x19')]],{'showHidden':![],'depth':null}));ami[_0xed68('0x16')](_0xed68('0x5c'),this[_0xed68('0x8')][_0x4faade[_0xed68('0x19')]]);logger[_0xed68('0x28')](_0xed68('0x5d'),_0x4faade[_0xed68('0x19')],util[_0xed68('0x18')](this[_0xed68('0x8')][_0x4faade[_0xed68('0x19')]],{'showHidden':![],'depth':null}));ami['emit'](_0xed68('0x5e'),this['channels'][_0x4faade[_0xed68('0x19')]]);logger[_0xed68('0x28')](_0xed68('0x5f'),_0x4faade[_0xed68('0x19')],util[_0xed68('0x18')](this['channels'][_0x4faade[_0xed68('0x19')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound','voice_outbound:save',this['outbound']);logger['info'](_0xed68('0x60'),JSON[_0xed68('0x61')](this[_0xed68('0x8')][_0x4faade[_0xed68('0x19')]]));logger[_0xed68('0x28')](_0xed68('0x62'),_0x4faade['uniqueid'],util[_0xed68('0x18')](this[_0xed68('0x8')][_0x4faade['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0xed68('0x27'),_0xed68('0x63'),this[_0xed68('0x8')][_0x4faade['uniqueid']]);delete this[_0xed68('0x8')][_0x4faade['uniqueid']];}else if(this['channels'][_0x4faade[_0xed68('0x64')]]){this[_0xed68('0x8')][_0x4faade['linkedid']][_0xed68('0x19')]=this[_0xed68('0x8')][_0x4faade[_0xed68('0x64')]][_0xed68('0x65')];}if(this[_0xed68('0xb')][_0x4faade[_0xed68('0x19')]]){delete this[_0xed68('0xb')][_0x4faade[_0xed68('0x19')]];}}}catch(_0x5171cc){logger[_0xed68('0x2b')]('[%s][voiceDialReport][hangup]',_0x4faade[_0xed68('0x19')],util[_0xed68('0x18')](_0x5171cc,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xed68('0x14')][_0xed68('0x12')]=function(_0x449b84){try{if(this[_0xed68('0x15')](_0x449b84)){logger['debug'](_0xed68('0x66'),_0x449b84[_0xed68('0x19')],util[_0xed68('0x18')](_0x449b84,{'showHidden':![],'depth':null}));if(_0x449b84[_0xed68('0x67')][_0xed68('0x68')]()===_0xed68('0x69')){_0x449b84[_0xed68('0x6a')]=(_0x449b84[_0xed68('0x6b')]||_0x449b84[_0xed68('0x6a')])[_0xed68('0x68')]();if(_[_0xed68('0x6c')](_0x449b84[_0xed68('0x6a')],_0xed68('0x6d'))){if(_[_0xed68('0x3d')](this[_0xed68('0xa')][_0x449b84['uniqueid']]))this[_0xed68('0xa')][_0x449b84['uniqueid']]={};logger[_0xed68('0x24')](_0xed68('0x6e'),_0x449b84[_0xed68('0x19')],_0x449b84[_0xed68('0x67')],_0x449b84[_0xed68('0x6a')]);var _0x4ef243=_0x449b84['applicationdata'][_0xed68('0x6f')]('=');var _0x6ab39e=_0x4ef243[0x0][_0xed68('0x70')](/cdr\((.*)\)/);if(_0x6ab39e)this['applications'][_0x449b84[_0xed68('0x19')]][_0x6ab39e[0x1]]=_0x4ef243[0x1];}}}}catch(_0x303122){logger[_0xed68('0x2b')](_0xed68('0x71'),_0x449b84['uniqueid'],util[_0xed68('0x18')](_0x303122,{'showHidden':![],'depth':null}));}};module[_0xed68('0x72')]=VoiceDialReport; \ No newline at end of file +var _0x88f6=['called','channel','lastIndexOf','event','membername','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','merge','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','dialstatus','ANSWER','connectedlinenum','answertime','info','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','substring','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','keys','variable','isUndefined','value','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','[%s][voiceDialReport][hangup]\x20event:','duration','diff','starttime','seconds','complete','total','answered','holdtime','billableseconds','endtime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','linkedid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','defaults','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','bind','dialend','syncDialEnd','varset','syncVarSet','newexten','syncNewExten','isNotNull','prototype','emit','syncDialBegin','debug','uniqueid','inspect','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0x88f6,0x137));var _0x688f=function(_0x3f66f8,_0x5c6f73){_0x3f66f8=_0x3f66f8-0x0;var _0x1d00f4=_0x88f6[_0x3f66f8];return _0x1d00f4;};'use strict';var _=require(_0x688f('0x0'));var moment=require(_0x688f('0x1'));var util=require('util');var Redis=require(_0x688f('0x2'));var config=require(_0x688f('0x3'));var logger=require(_0x688f('0x4'))('ami');var ami=require('../ami');config['redis']=_[_0x688f('0x5')](config[_0x688f('0x6')],{'host':_0x688f('0x7'),'port':0x18eb});var io=require(_0x688f('0x8'))(new Redis(config[_0x688f('0x6')]));function VoiceDialReport(_0x231e1f){this[_0x688f('0x9')]=_0x231e1f[_0x688f('0xa')];this['outbound']=_0x231e1f[_0x688f('0xb')];this[_0x688f('0xc')]={};this[_0x688f('0xd')]={};ami['on'](_0x688f('0xe'),this['syncDialBegin'][_0x688f('0xf')](this));ami['on'](_0x688f('0x10'),this[_0x688f('0x11')][_0x688f('0xf')](this));ami['on'](_0x688f('0x12'),this[_0x688f('0x13')][_0x688f('0xf')](this));ami['on'](_0x688f('0x14'),this[_0x688f('0x15')][_0x688f('0xf')](this));ami['on']('hangup',this['syncHangup'][_0x688f('0xf')](this));}VoiceDialReport['prototype'][_0x688f('0x16')]=function(_0x2ec082){return _0x2ec082!==null&&!_['isUndefined'](_0x2ec082);};VoiceDialReport[_0x688f('0x17')][_0x688f('0x18')]=function(_0x5b9223,_0x1ddf94,_0x2cb49d){io['to'](_0x5b9223)[_0x688f('0x18')](_0x1ddf94,_0x2cb49d);};VoiceDialReport[_0x688f('0x17')][_0x688f('0x19')]=function(_0x486055){try{if(this['isNotNull'](_0x486055)){logger[_0x688f('0x1a')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x486055[_0x688f('0x1b')],util[_0x688f('0x1c')](_0x486055,{'showHidden':![],'depth':null}));if(this['channels'][_0x486055[_0x688f('0x1b')]]){_['merge'](this[_0x688f('0x9')][_0x486055[_0x688f('0x1b')]],{'starttime':moment()[_0x688f('0x1d')](_0x688f('0x1e')),'lastevent':_0x688f('0x1f'),'interface':_0x486055[_0x688f('0x20')]['substring'](0x0,_0x486055[_0x688f('0x20')][_0x688f('0x21')]('-')),'membername':_0x486055['channel']['substring'](_0x486055['channel'][_0x688f('0x21')]('/')+0x1,_0x486055['channel'][_0x688f('0x21')]('-'))},_['omit'](_0x486055,[_0x688f('0x22'),'privilege']));logger['info']('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x486055[_0x688f('0x1b')],this[_0x688f('0x9')][_0x486055[_0x688f('0x1b')]][_0x688f('0x23')],this['channels'][_0x486055[_0x688f('0x1b')]]['interface']);logger[_0x688f('0x1a')](_0x688f('0x24'),_0x486055[_0x688f('0x1b')],util['inspect'](this['channels'][_0x486055['uniqueid']],{'showHidden':![],'depth':null}));if(this['applications'][_0x486055[_0x688f('0x1b')]])_[_0x688f('0x25')](this[_0x688f('0x9')][_0x486055[_0x688f('0x1b')]],this[_0x688f('0xc')][_0x486055[_0x688f('0x1b')]]);this[_0x688f('0x18')](_0x688f('0x26'),_0x688f('0x27'),this[_0x688f('0x9')][_0x486055[_0x688f('0x1b')]]);logger['debug'](_0x688f('0x28'),_0x486055[_0x688f('0x1b')],util[_0x688f('0x1c')](this[_0x688f('0x9')][_0x486055[_0x688f('0x1b')]],{'showHidden':![],'depth':null}));ami['emit'](_0x688f('0x29'),this[_0x688f('0x9')][_0x486055[_0x688f('0x1b')]]);}}}catch(_0x5726de){logger[_0x688f('0x2a')]('[%s][voiceDialReport][dialbegin]',_0x486055[_0x688f('0x1b')],util[_0x688f('0x1c')](_0x5726de,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x688f('0x11')]=function(_0x1478b9){try{if(this[_0x688f('0x16')](_0x1478b9)){logger[_0x688f('0x1a')]('[%s][voiceDialReport][dialend]\x20event:',_0x1478b9[_0x688f('0x1b')],util[_0x688f('0x1c')](_0x1478b9,{'showHidden':![],'depth':null}));if(this[_0x688f('0x9')][_0x1478b9[_0x688f('0x1b')]]){this[_0x688f('0x9')][_0x1478b9[_0x688f('0x1b')]][_0x688f('0x2b')]=_0x1478b9[_0x688f('0x2b')];if(_0x1478b9[_0x688f('0x2b')]===_0x688f('0x2c')){this[_0x688f('0x9')][_0x1478b9[_0x688f('0x1b')]][_0x688f('0x2d')]=_0x1478b9['connectedlinenum'];this[_0x688f('0x9')][_0x1478b9[_0x688f('0x1b')]]['connectedlinename']=_0x1478b9['connectedlinename'];this[_0x688f('0x9')][_0x1478b9[_0x688f('0x1b')]][_0x688f('0x2e')]=moment()[_0x688f('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x688f('0x9')][_0x1478b9['uniqueid']]['lastevent']='connect';logger[_0x688f('0x2f')](_0x688f('0x30'),_0x1478b9[_0x688f('0x1b')],_0x1478b9[_0x688f('0x20')][_0x688f('0x31')](_0x1478b9[_0x688f('0x20')]['lastIndexOf']('/')+0x1,_0x1478b9[_0x688f('0x20')][_0x688f('0x21')]('-')));logger['debug'](_0x688f('0x32'),_0x1478b9['uniqueid'],util[_0x688f('0x1c')](this[_0x688f('0x9')][_0x1478b9[_0x688f('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x688f('0x18')](_0x688f('0x33'),this[_0x688f('0x9')][_0x1478b9[_0x688f('0x1b')]]);}logger['debug'](_0x688f('0x34'),_0x1478b9['uniqueid'],util[_0x688f('0x1c')](this[_0x688f('0x9')][_0x1478b9['uniqueid']],{'showHidden':![],'depth':null}));this[_0x688f('0x18')](_0x688f('0x26'),_0x688f('0x27'),this[_0x688f('0x9')][_0x1478b9[_0x688f('0x1b')]]);}}}catch(_0x33e063){logger[_0x688f('0x2a')](_0x688f('0x35'),_0x1478b9[_0x688f('0x1b')],util[_0x688f('0x1c')](_0x33e063,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x688f('0x13')]=function(_0x545558){try{if(this['isNotNull'](_0x545558)){logger[_0x688f('0x1a')]('[%s][voiceDialReport][varset]\x20event:',_0x545558[_0x688f('0x1b')],util[_0x688f('0x1c')](_0x545558,{'showHidden':![],'depth':null}));this['addVariable'](_0x545558['uniqueid'],_[_0x688f('0x36')](_0x545558[_0x688f('0x37')])[0x0],_0x545558['value']);if(this['isNotNull'](_0x545558[_0x688f('0x37')])&&this['isNotNull'](_0x545558[_0x688f('0x37')]['outboundrouteid'])){if(_[_0x688f('0x38')](this[_0x688f('0x9')][_0x545558[_0x688f('0x1b')]])){this[_0x688f('0x9')][_0x545558['uniqueid']]={'routeId':_0x545558[_0x688f('0x39')],'variables':this[_0x688f('0xd')][_0x545558[_0x688f('0x1b')]]};logger[_0x688f('0x2f')](_0x688f('0x3a'),_0x545558['uniqueid'],_0x545558[_0x688f('0x37')][_0x688f('0x3b')],_[_0x688f('0x36')](_0x545558['variable'])[0x0],_0x545558[_0x688f('0x39')]);logger[_0x688f('0x1a')](_0x688f('0x3c'),_0x545558['uniqueid'],util['inspect'](this[_0x688f('0x9')][_0x545558[_0x688f('0x1b')]],{'showHidden':![],'depth':null}));this[_0x688f('0x18')](_0x688f('0x26'),_0x688f('0x27'),this['channels'][_0x545558[_0x688f('0x1b')]]);}}}}catch(_0x1b9034){logger[_0x688f('0x2a')]('[%s][voiceDialReport][varset]',_0x545558[_0x688f('0x1b')],util[_0x688f('0x1c')](_0x1b9034,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x688f('0x17')][_0x688f('0x3d')]=function(_0x14da9b,_0x4e3ad2,_0x1ef1ba){var _0x4e804e=[_0x688f('0x3e'),_0x688f('0x3f'),_0x688f('0x40'),_0x688f('0x41'),_0x688f('0x42'),_0x688f('0x43'),'rtpaudioqosrtt',_0x688f('0x44'),'sipcallid',_0x688f('0x45'),'bridgepeer',_0x688f('0x46'),_0x688f('0x47'),'memberdynamic',_0x688f('0x48'),_0x688f('0x49'),_0x688f('0x23'),_0x688f('0x4a'),_0x688f('0x4b')];if(!_[_0x688f('0x4c')](_0x4e3ad2)&&!_[_0x688f('0x4d')](_0x4e804e,_0x4e3ad2)){if(_[_0x688f('0x38')](this['variables'][_0x14da9b])){this[_0x688f('0xd')][_0x14da9b]={};}this['variables'][_0x14da9b][_0x4e3ad2]=_0x1ef1ba;}};VoiceDialReport[_0x688f('0x17')][_0x688f('0x4e')]=function(_0x133bee){try{if(this[_0x688f('0x16')](_0x133bee)){logger['debug'](_0x688f('0x4f'),_0x133bee['uniqueid'],util[_0x688f('0x1c')](_0x133bee,{'showHidden':![],'depth':null}));if(this[_0x688f('0x9')][_0x133bee[_0x688f('0x1b')]]){logger['info']('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x133bee['uniqueid'],_0x133bee['cause-txt']);this[_0x688f('0x9')][_0x133bee['uniqueid']]['endtime']=moment()[_0x688f('0x1d')](_0x688f('0x1e'));this[_0x688f('0x9')][_0x133bee[_0x688f('0x1b')]][_0x688f('0x50')]=moment(this['channels'][_0x133bee[_0x688f('0x1b')]]['endtime'])[_0x688f('0x51')](this['channels'][_0x133bee[_0x688f('0x1b')]][_0x688f('0x52')],_0x688f('0x53'));this[_0x688f('0x9')][_0x133bee[_0x688f('0x1b')]]['lastevent']=_0x688f('0x54');this[_0x688f('0xb')][_0x688f('0x55')]+=0x1;if(this['channels'][_0x133bee[_0x688f('0x1b')]][_0x688f('0x2e')]){this['outbound'][_0x688f('0x56')]+=0x1;this['channels'][_0x133bee['uniqueid']][_0x688f('0x57')]=moment(this[_0x688f('0x9')][_0x133bee['uniqueid']][_0x688f('0x2e')])[_0x688f('0x51')](this[_0x688f('0x9')][_0x133bee[_0x688f('0x1b')]]['starttime'],'seconds');this['channels'][_0x133bee['uniqueid']][_0x688f('0x58')]=moment(this['channels'][_0x133bee[_0x688f('0x1b')]][_0x688f('0x59')])['diff'](this['channels'][_0x133bee[_0x688f('0x1b')]][_0x688f('0x2e')],_0x688f('0x53'));this['outbound']['sumHoldTime']+=this[_0x688f('0x9')][_0x133bee[_0x688f('0x1b')]][_0x688f('0x57')]||0x0;this[_0x688f('0xb')][_0x688f('0x5a')]+=this[_0x688f('0x9')][_0x133bee[_0x688f('0x1b')]][_0x688f('0x58')];}this['outbound'][_0x688f('0x5b')]+=this[_0x688f('0x9')][_0x133bee[_0x688f('0x1b')]][_0x688f('0x50')];logger[_0x688f('0x1a')](_0x688f('0x5c'),_0x133bee[_0x688f('0x1b')],util['inspect'](this['channels'][_0x133bee[_0x688f('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x688f('0x18')](_0x688f('0x5d'),this[_0x688f('0x9')][_0x133bee[_0x688f('0x1b')]]);logger[_0x688f('0x1a')](_0x688f('0x5e'),_0x133bee['uniqueid'],util[_0x688f('0x1c')](this[_0x688f('0x9')][_0x133bee[_0x688f('0x1b')]],{'showHidden':![],'depth':null}));ami['emit'](_0x688f('0x5f'),this['channels'][_0x133bee[_0x688f('0x1b')]]);logger[_0x688f('0x1a')](_0x688f('0x60'),_0x133bee[_0x688f('0x1b')],util[_0x688f('0x1c')](this['channels'][_0x133bee[_0x688f('0x1b')]],{'showHidden':![],'depth':null}));this[_0x688f('0x18')]('voice:outbound',_0x688f('0x61'),this[_0x688f('0xb')]);logger['info']('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x688f('0x62')](this['channels'][_0x133bee['uniqueid']]));logger[_0x688f('0x1a')](_0x688f('0x63'),_0x133bee[_0x688f('0x1b')],util[_0x688f('0x1c')](this[_0x688f('0x9')][_0x133bee[_0x688f('0x1b')]],{'showHidden':![],'depth':null}));this['emit'](_0x688f('0x26'),'voice_outbound_channel:remove',this[_0x688f('0x9')][_0x133bee['uniqueid']]);delete this[_0x688f('0x9')][_0x133bee[_0x688f('0x1b')]];}else if(this[_0x688f('0x9')][_0x133bee['linkedid']]){this[_0x688f('0x9')][_0x133bee[_0x688f('0x64')]][_0x688f('0x1b')]=this[_0x688f('0x9')][_0x133bee['linkedid']]['destuniqueid'];}if(this['variables'][_0x133bee[_0x688f('0x1b')]]){delete this[_0x688f('0xd')][_0x133bee[_0x688f('0x1b')]];}}}catch(_0xcd67d2){logger[_0x688f('0x2a')](_0x688f('0x65'),_0x133bee[_0x688f('0x1b')],util['inspect'](_0xcd67d2,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x688f('0x15')]=function(_0x173566){try{if(this['isNotNull'](_0x173566)){logger[_0x688f('0x1a')](_0x688f('0x66'),_0x173566[_0x688f('0x1b')],util[_0x688f('0x1c')](_0x173566,{'showHidden':![],'depth':null}));if(_0x173566[_0x688f('0x67')][_0x688f('0x68')]()===_0x688f('0x69')){_0x173566[_0x688f('0x6a')]=(_0x173566[_0x688f('0x6b')]||_0x173566[_0x688f('0x6a')])[_0x688f('0x68')]();if(_[_0x688f('0x6c')](_0x173566[_0x688f('0x6a')],_0x688f('0x6d'))){if(_[_0x688f('0x38')](this[_0x688f('0xc')][_0x173566[_0x688f('0x1b')]]))this[_0x688f('0xc')][_0x173566[_0x688f('0x1b')]]={};logger['info'](_0x688f('0x6e'),_0x173566['uniqueid'],_0x173566[_0x688f('0x67')],_0x173566[_0x688f('0x6a')]);var _0x15785c=_0x173566[_0x688f('0x6a')]['split']('=');var _0x2256c8=_0x15785c[0x0][_0x688f('0x6f')](/cdr\((.*)\)/);if(_0x2256c8)this[_0x688f('0xc')][_0x173566[_0x688f('0x1b')]][_0x2256c8[0x1]]=_0x15785c[0x1];}}}}catch(_0x1349be){logger[_0x688f('0x2a')](_0x688f('0x70'),_0x173566[_0x688f('0x1b')],util[_0x688f('0x1c')](_0x1349be,{'showHidden':![],'depth':null}));}};module[_0x688f('0x71')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index a17954c..fdab4ff 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25a3=['bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceQueueReport][hangup]','abandoned','diff','length','sumDuration','milliseconds','total','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','origtransfererexten','origtransfereruniqueid','transfertargetuniqueid','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][newexten]\x20event:','application','toLowerCase','set','appdata','applicationdata','cdr(','match','[%s][voiceQueueReport][newexten]','lodash','moment','util','ioredis','../../../config/logger','ami','../ami','redis','defaults','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','newexten','syncNewExten','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','originated','hasOwnProperty','talking','pTalking','waiting','unlockRR','clearZombieChannels','switch','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','[%s][voiceQueueReport][checkQueueReport]','variables','[%s][voiceQueueReport][checkVariables]','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','inspect','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_presence:remove','type','strategy','answered','available','sumBillable','sumHoldTime','unmanaged','Trunk','active','Interval','md5',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','queuesummary','[voiceQueueReport][queuesummary]','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','toNumber','callers','loggedIn','loggedin','emitVoiceQueueSummary','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','inbound','queuecallerjoinAt','position','count','routealias','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerjoin]','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','local/','linkedid','queuecallerexitAt','seconds','FORWARDTRANSFER','transfertype','FORWARD','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','[%s][voiceQueueReport][varset]','addVariable','value','variable','queuestatus','CONTINUE','lastevent','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x25a3,0x121));var _0x325a=function(_0x40d37d,_0x537149){_0x40d37d=_0x40d37d-0x0;var _0x3a978a=_0x25a3[_0x40d37d];return _0x3a978a;};'use strict';var _=require(_0x325a('0x0'));var moment=require(_0x325a('0x1'));var util=require(_0x325a('0x2'));var md5=require('md5');var Redis=require(_0x325a('0x3'));var config=require('../../../config/environment');var logger=require(_0x325a('0x4'))(_0x325a('0x5'));var ami=require(_0x325a('0x6'));var QueueReport=require('../model/queueReport');config[_0x325a('0x7')]=_[_0x325a('0x8')](config[_0x325a('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x325a('0x7')]));var Sequence=function(){};Sequence[_0x325a('0x9')][_0x325a('0xa')]=function(_0x33f09a){this['tail']=this['tail']?this[_0x325a('0xb')][_0x325a('0xc')](_0x33f09a):_0x33f09a();};function VoiceQueueReport(_0x5623f6){this[_0x325a('0xd')]=new Sequence();this[_0x325a('0xe')]={};this[_0x325a('0xf')]=_0x5623f6['agents'];this[_0x325a('0x10')]=_0x5623f6[_0x325a('0x11')];this['voiceQueues']=_0x5623f6[_0x325a('0x12')];this[_0x325a('0x13')]=!![];this[_0x325a('0x14')]=_0x5623f6[_0x325a('0x14')];this['variables']={};ami['on']('queuesummary',this[_0x325a('0x15')]['bind'](this));ami['on'](_0x325a('0x16'),this[_0x325a('0x17')][_0x325a('0x18')](this));ami['on'](_0x325a('0x19'),this[_0x325a('0x1a')][_0x325a('0x18')](this));ami['on'](_0x325a('0x1b'),this[_0x325a('0x1c')][_0x325a('0x18')](this));ami['on'](_0x325a('0x1d'),this[_0x325a('0x1e')][_0x325a('0x18')](this));ami['on'](_0x325a('0x1f'),this[_0x325a('0x20')]['bind'](this));ami['on'](_0x325a('0x21'),this[_0x325a('0x22')]['bind'](this));ami['on'](_0x325a('0x23'),this[_0x325a('0x24')][_0x325a('0x18')](this));ami['on'](_0x325a('0x25'),this[_0x325a('0x26')][_0x325a('0x18')](this));ami['on'](_0x325a('0x27'),this[_0x325a('0x28')][_0x325a('0x18')](this));ami['on'](_0x325a('0x29'),this[_0x325a('0x2a')][_0x325a('0x18')](this));ami['on']('musiconholdstart',this[_0x325a('0x2b')][_0x325a('0x18')](this));ami['on'](_0x325a('0x2c'),this[_0x325a('0x2d')][_0x325a('0x18')](this));ami['on'](_0x325a('0x2e'),this['syncAttendedTransfer'][_0x325a('0x18')](this));ami['on']('blindtransfer',this[_0x325a('0x2f')][_0x325a('0x18')](this));this[_0x325a('0x30')]();this[_0x325a('0x31')]();}function clearChannels(_0x1e15cc){if(!_['isEmpty'](_0x1e15cc)){for(var _0x29543e in _0x1e15cc){if(_0x1e15cc['hasOwnProperty'](_0x29543e)){delete _0x1e15cc[_0x29543e];}}}}function clearCampaigns(_0x13e86b){if(!_[_0x325a('0x32')](_0x13e86b)){for(var _0x41d0d2 in _0x13e86b){if(_0x13e86b['hasOwnProperty'](_0x41d0d2)){_0x13e86b[_0x41d0d2][_0x325a('0x33')]=0x0;}}}}function clearVoiceQueues(_0x33bfc0){if(!_[_0x325a('0x32')](_0x33bfc0)){for(var _0x473d91 in _0x33bfc0){if(_0x33bfc0[_0x325a('0x34')](_0x473d91)){_0x33bfc0[_0x473d91][_0x325a('0x33')]=0x0;_0x33bfc0[_0x473d91][_0x325a('0x35')]=0x0;_0x33bfc0[_0x473d91][_0x325a('0x36')]=0x0;_0x33bfc0[_0x473d91][_0x325a('0x37')]=0x0;_0x33bfc0[_0x473d91]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x201e01){if(!_[_0x325a('0x32')](_0x201e01)){for(var _0xb10b39 in _0x201e01){if(_0x201e01[_0x325a('0x34')](_0xb10b39)){_0x201e01[_0xb10b39][_0x325a('0x38')]=!![];}}}}VoiceQueueReport['prototype'][_0x325a('0x39')]=function(){var _0x4b1e46=this;for(var _0x34ef69 in this[_0x325a('0x10')]){if(this['channels'][_0x325a('0x34')](_0x34ef69)&&!this[_0x325a('0x10')][_0x34ef69][_0x325a('0x3a')]){this[_0x325a('0xd')]['enqueue'](function(){if(!_[_0x325a('0x3b')](_0x4b1e46[_0x325a('0x10')][_0x34ef69])){return ami[_0x325a('0x3c')]({'action':_0x325a('0x3d'),'channel':_0x4b1e46['channels'][_0x34ef69][_0x325a('0x3e')]})[_0x325a('0x3f')](function(_0x28a95a){if(_0x28a95a[_0x325a('0x40')]===_0x325a('0x41')){setTimeout(function(){if(_0x4b1e46[_0x325a('0x10')][_0x34ef69]){delete _0x4b1e46['channels'][_0x34ef69];logger[_0x325a('0x42')](_0x325a('0x43'),_0x34ef69,util['inspect'](_0x28a95a,{'showHidden':![],'depth':null}));}if(_0x4b1e46[_0x325a('0xe')][_0x34ef69]){delete _0x4b1e46[_0x325a('0xe')][_0x34ef69];logger['error'](_0x325a('0x44'),_0x34ef69,util['inspect'](_0x28a95a,{'showHidden':![],'depth':null}));}if(_0x4b1e46[_0x325a('0x45')][_0x34ef69]){delete _0x4b1e46[_0x325a('0x45')][_0x34ef69];logger[_0x325a('0x42')](_0x325a('0x46'),_0x34ef69,util['inspect'](_0x28a95a,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x325a('0x9')]['syncFullyBooted']=function(){logger[_0x325a('0x42')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this['channels']);this[_0x325a('0x47')](this[_0x325a('0xe')]);clearAgentBooked(this[_0x325a('0xf')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x325a('0x14')]);};VoiceQueueReport['prototype'][_0x325a('0x47')]=function(_0x445da7){var _0xc264e3=this;if(!_[_0x325a('0x32')](_0x445da7)){for(var _0x3877c6 in _0x445da7){if(_0x445da7[_0x325a('0x34')](_0x3877c6)){_0xc264e3[_0x325a('0x48')](_0x445da7[_0x3877c6],_0x325a('0x49'));delete _0x445da7[_0x3877c6];}}}};VoiceQueueReport['prototype'][_0x325a('0x4a')]=function(_0x2bd552,_0x936890,_0x46cda7){io['to'](_0x2bd552)[_0x325a('0x4a')](_0x936890,_0x46cda7);};VoiceQueueReport[_0x325a('0x9')][_0x325a('0x4b')]=function(_0x145c1f,_0x3dcbfe){logger['debug'](_0x325a('0x4c')+_0x3dcbfe+_0x325a('0x4d'),_0x145c1f[_0x325a('0x4e')],util[_0x325a('0x4f')](_0x145c1f,{'showHidden':![],'depth':null}));this[_0x325a('0x4a')](util[_0x325a('0x50')](_0x325a('0x51'),_0x145c1f[_0x325a('0x52')]),_0x325a('0x53'),_0x145c1f);io[_0x325a('0x4a')](_0x325a('0x54'),_0x145c1f);};VoiceQueueReport['prototype'][_0x325a('0x48')]=function(_0x301f6c,_0x415825){logger[_0x325a('0x55')](_0x325a('0x4c')+_0x415825+_0x325a('0x56'),_0x301f6c['uniqueid'],util[_0x325a('0x4f')](_0x301f6c,{'showHidden':![],'depth':null}));this[_0x325a('0x4a')](util[_0x325a('0x50')](_0x325a('0x51'),_0x301f6c[_0x325a('0x52')]),'voice_queue_channel:remove',_0x301f6c);io[_0x325a('0x4a')](_0x325a('0x57'),_0x301f6c);};VoiceQueueReport[_0x325a('0x9')]['emitVoiceQueueSummary']=function(_0x3c0db5,_0x348a89){if(_0x3c0db5[_0x325a('0x58')]==='inbound'){var _0x5802d9={'id':_0x3c0db5['id'],'name':_0x3c0db5[_0x325a('0x52')],'strategy':_0x3c0db5[_0x325a('0x59')],'answered':_0x3c0db5[_0x325a('0x5a')],'available':_0x3c0db5[_0x325a('0x5b')],'loggedIn':_0x3c0db5['loggedIn'],'pTalking':_0x3c0db5[_0x325a('0x36')],'sumBillable':_0x3c0db5[_0x325a('0x5c')],'sumDuration':_0x3c0db5['sumDuration'],'sumHoldTime':_0x3c0db5[_0x325a('0x5d')]||0x0,'talking':_0x3c0db5[_0x325a('0x35')],'total':_0x3c0db5['total'],'type':_0x3c0db5[_0x325a('0x58')],'unmanaged':_0x3c0db5[_0x325a('0x5e')],'abandoned':_0x3c0db5['abandoned'],'waiting':_0x3c0db5[_0x325a('0x37')]};if(_0x3c0db5['Trunk']){_0x5802d9['Trunk']={'id':_0x3c0db5[_0x325a('0x5f')]['id'],'name':_0x3c0db5[_0x325a('0x5f')][_0x325a('0x52')],'active':_0x3c0db5['Trunk'][_0x325a('0x60')],'callerid':_0x3c0db5[_0x325a('0x5f')]['callerid']};}if(_0x3c0db5['Interval']){_0x5802d9[_0x325a('0x61')]={'id':_0x3c0db5[_0x325a('0x61')]['id'],'name':_0x3c0db5['Interval'][_0x325a('0x52')]};}var _0x4ab88b=md5(JSON['stringify'](_0x5802d9));if(_0x3c0db5['md5']!==_0x4ab88b){_0x3c0db5[_0x325a('0x62')]=_0x4ab88b;logger[_0x325a('0x55')]('[voiceQueueReport]['+_0x348a89+_0x325a('0x63'),util[_0x325a('0x4f')](_0x5802d9,{'showHidden':![],'depth':null}));this['emit'](util[_0x325a('0x50')](_0x325a('0x51'),_0x5802d9[_0x325a('0x52')]),_0x325a('0x64'),_0x5802d9);}}};VoiceQueueReport[_0x325a('0x9')][_0x325a('0x65')]=function(_0x47d8ea){return _0x47d8ea!==null&&!_[_0x325a('0x66')](_0x47d8ea);};VoiceQueueReport[_0x325a('0x9')]['loopQueueShow']=function(){var _0x189b23=this;setInterval(function(){_0x189b23['clearZombieChannels']();ami[_0x325a('0x3c')]({'action':_0x325a('0x67')})[_0x325a('0x3f')](function(_0x454aca){logger[_0x325a('0x42')](_0x325a('0x68'),util[_0x325a('0x4f')](_0x454aca,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x325a('0x9')][_0x325a('0x30')]=function(){var _0x344e18=this;setInterval(function(){if(_0x344e18['flagQueueSummary']){return ami[_0x325a('0x3c')]({'action':_0x325a('0x69')})['then'](function(_0x33524b){_0x344e18[_0x325a('0x13')]=![];})[_0x325a('0x3f')](function(_0x1b2a80){logger[_0x325a('0x42')](_0x325a('0x6a'),util[_0x325a('0x4f')](_0x1b2a80,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x325a('0x9')][_0x325a('0x15')]=function(_0xc022fd){try{if(this[_0x325a('0x65')](_0xc022fd)&&this[_0x325a('0x65')](_0xc022fd[_0x325a('0x6b')])){logger[_0x325a('0x55')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x325a('0x4f')](_0xc022fd,{'showHidden':![],'depth':null}));if(this[_0x325a('0x12')][_0xc022fd[_0x325a('0x6b')]]){logger[_0x325a('0x6c')](_0x325a('0x6d'),_0xc022fd[_0x325a('0x6b')]);var _0x29902c=_[_0x325a('0x6e')](this[_0x325a('0x10')],_0x325a('0x6b'))[_0xc022fd[_0x325a('0x6b')]]||0x0;var _0x1f8fbd=_0x29902c-_0xc022fd['callers'];if(this[_0x325a('0x12')][_0xc022fd[_0x325a('0x6b')]]['waiting']!==_[_0x325a('0x6f')](_0xc022fd[_0x325a('0x70')])||this[_0x325a('0x12')][_0xc022fd['queue']][_0x325a('0x71')]!==_[_0x325a('0x6f')](_0xc022fd[_0x325a('0x72')])||this[_0x325a('0x12')][_0xc022fd[_0x325a('0x6b')]][_0x325a('0x5b')]!==_[_0x325a('0x6f')](_0xc022fd[_0x325a('0x5b')])||this[_0x325a('0x12')][_0xc022fd['queue']][_0x325a('0x35')]!==_0x1f8fbd){this[_0x325a('0x12')][_0xc022fd[_0x325a('0x6b')]][_0x325a('0x37')]=_[_0x325a('0x6f')](_0xc022fd[_0x325a('0x70')]);this[_0x325a('0x12')][_0xc022fd[_0x325a('0x6b')]][_0x325a('0x71')]=_[_0x325a('0x6f')](_0xc022fd[_0x325a('0x72')]);this[_0x325a('0x12')][_0xc022fd[_0x325a('0x6b')]][_0x325a('0x5b')]=_['toNumber'](_0xc022fd[_0x325a('0x5b')]);this[_0x325a('0x12')][_0xc022fd['queue']][_0x325a('0x35')]=_0x1f8fbd>0x0?_0x1f8fbd:0x0;this[_0x325a('0x12')][_0xc022fd[_0x325a('0x6b')]][_0x325a('0x35')]=this[_0x325a('0x12')][_0xc022fd[_0x325a('0x6b')]]['talking']>_[_0x325a('0x6f')](_0xc022fd[_0x325a('0x72')])?_[_0x325a('0x6f')](_0xc022fd[_0x325a('0x72')]):this[_0x325a('0x12')][_0xc022fd['queue']][_0x325a('0x35')];this[_0x325a('0x73')](this['voiceQueues'][_0xc022fd['queue']],_0x325a('0x69'));}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x325a('0x4f')](this[_0x325a('0x12')][_0xc022fd['queue']],{'showHidden':![],'depth':null}));ami[_0x325a('0x4a')](_0x325a('0x74'),this['voiceQueues'][_0xc022fd[_0x325a('0x6b')]]);}}}catch(_0x5bdd3b){logger[_0x325a('0x42')](_0x325a('0x6a'),util[_0x325a('0x4f')](_0x5bdd3b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x325a('0x9')][_0x325a('0x17')]=function(_0x19e743){logger['debug'](_0x325a('0x75'),util[_0x325a('0x4f')](_0x19e743,{'showHidden':![],'depth':null}));this[_0x325a('0x13')]=!![];};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x5e2d3b){try{if(this[_0x325a('0x65')](_0x5e2d3b)){logger[_0x325a('0x55')]('[%s][voiceQueueReport][queuecallerjoin]',_0x5e2d3b[_0x325a('0x4e')],util[_0x325a('0x4f')](_0x5e2d3b,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x325a('0xe')][_0x5e2d3b['uniqueid']]))this[_0x325a('0xe')][_0x5e2d3b[_0x325a('0x4e')]]=[];if(_[_0x325a('0x66')](this[_0x325a('0x10')][_0x5e2d3b[_0x325a('0x4e')]]))this[_0x325a('0x10')][_0x5e2d3b[_0x325a('0x4e')]]={};var _0xa910f2=new QueueReport();_0xa910f2[_0x325a('0x52')]=_0x5e2d3b[_0x325a('0x6b')];_0xa910f2[_0x325a('0x58')]=this[_0x325a('0x12')][_0xa910f2[_0x325a('0x52')]]&&this['voiceQueues'][_0xa910f2[_0x325a('0x52')]][_0x325a('0x58')]?this['voiceQueues'][_0xa910f2[_0x325a('0x52')]][_0x325a('0x58')]||_0x325a('0x76'):'inbound';_0xa910f2['queue']=_0x5e2d3b[_0x325a('0x6b')];_0xa910f2[_0x325a('0x77')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xa910f2[_0x325a('0x78')]=_0x5e2d3b[_0x325a('0x78')];_0xa910f2[_0x325a('0x79')]=_0x5e2d3b['count'];_0xa910f2[_0x325a('0x4e')]=_0x5e2d3b[_0x325a('0x4e')];_0xa910f2['routealias']=this[_0x325a('0x10')][_0x5e2d3b[_0x325a('0x4e')]][_0x325a('0x7a')];logger[_0x325a('0x6c')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0xa910f2[_0x325a('0x52')],_0xa910f2[_0x325a('0x58')]);_[_0x325a('0x7b')](_0xa910f2,_[_0x325a('0x7c')](_0x5e2d3b,_[_0x325a('0x7d')](_0xa910f2)));this[_0x325a('0xe')][_0x5e2d3b[_0x325a('0x4e')]][_0x325a('0x7e')](_0xa910f2);this['channels'][_0x5e2d3b['uniqueid']]=_0xa910f2;this[_0x325a('0x4b')](_0xa910f2,'queuecallerjoin');}}catch(_0x25af14){logger[_0x325a('0x42')](_0x325a('0x7f'),_0x5e2d3b[_0x325a('0x4e')],util[_0x325a('0x4f')](_0x25af14,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x325a('0x9')][_0x325a('0x1c')]=function(_0x1e941e){try{if(this[_0x325a('0x65')](_0x1e941e)){logger[_0x325a('0x55')](_0x325a('0x80'),_0x1e941e[_0x325a('0x4e')],util['inspect'](_0x1e941e,{'showHidden':![],'depth':null}));if(this[_0x325a('0xe')][_0x1e941e['uniqueid']]){var _0x4fad6b=_[_0x325a('0x81')](this[_0x325a('0xe')][_0x1e941e[_0x325a('0x4e')]]);_0x4fad6b[_0x325a('0x82')]=![];_0x4fad6b[_0x325a('0x83')]=null;_0x4fad6b[_0x325a('0x84')]=_0x1e941e[_0x325a('0x84')];_0x4fad6b[_0x325a('0x85')]=_0x1e941e[_0x325a('0x85')];_0x4fad6b[_0x325a('0x1b')]=!![];_0x4fad6b[_0x325a('0x86')]=moment()['format'](_0x325a('0x87'));_0x4fad6b[_0x325a('0x88')]='ABANDONED';_0x4fad6b[_0x325a('0x89')]=null;logger['info'](_0x325a('0x8a'),_0x4fad6b[_0x325a('0x52')],_0x4fad6b[_0x325a('0x58')]);this['channels'][_0x1e941e['uniqueid']]=_0x4fad6b;this['emitVoiceQueueChannelRemove'](_0x4fad6b,_0x325a('0x1b'));}}}catch(_0x4678b4){logger[_0x325a('0x42')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1e941e[_0x325a('0x4e')],util[_0x325a('0x4f')](_0x4678b4,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x4e1c94){try{if(this['isNotNull'](_0x4e1c94)){logger[_0x325a('0x55')](_0x325a('0x8b'),_0x4e1c94[_0x325a('0x4e')],util['inspect'](_0x4e1c94,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4e1c94[_0x325a('0x4e')]]){var _0x35f248=_[_0x325a('0x81')](this[_0x325a('0xe')][_0x4e1c94[_0x325a('0x4e')]]);_0x35f248[_0x325a('0x8c')]=moment()['format'](_0x325a('0x87'));_0x35f248[_0x325a('0x8d')]=_0x4e1c94[_0x325a('0x8d')];_0x35f248['connectedlinename']=_0x4e1c94['connectedlinename'];logger[_0x325a('0x6c')](_0x325a('0x8e'),_0x35f248[_0x325a('0x52')],_0x35f248[_0x325a('0x58')],_0x4e1c94[_0x325a('0x8d')],_0x4e1c94['connectedlinename']);this[_0x325a('0x10')][_0x4e1c94[_0x325a('0x4e')]]=_0x35f248;this[_0x325a('0x4b')](_0x35f248,'queuecallerleave');}}}catch(_0x164e76){logger['error'](_0x325a('0x8b'),_0x4e1c94[_0x325a('0x4e')],util['inspect'](_0x164e76,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x325a('0x9')][_0x325a('0x22')]=function(_0x496445){try{if(this[_0x325a('0x65')](_0x496445)){logger[_0x325a('0x55')](_0x325a('0x8f'),_0x496445[_0x325a('0x4e')],util[_0x325a('0x4f')](_0x496445,{'showHidden':![],'depth':null}));if(this[_0x325a('0xe')][_0x496445[_0x325a('0x4e')]]){var _0x2dd784=_[_0x325a('0x81')](this[_0x325a('0xe')][_0x496445[_0x325a('0x4e')]]);_0x2dd784[_0x325a('0x82')]=!![];_0x2dd784[_0x325a('0x88')]=_0x325a('0x90');logger[_0x325a('0x6c')](_0x325a('0x91'),_0x2dd784[_0x325a('0x52')],_0x2dd784[_0x325a('0x58')]);}}}catch(_0x14e069){logger['error'](_0x325a('0x8f'),_0x496445[_0x325a('0x4e')],util[_0x325a('0x4f')](_0x14e069,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x325a('0x9')][_0x325a('0x20')]=function(_0xb204e1){try{if(this[_0x325a('0x65')](_0xb204e1)){logger['debug'](_0x325a('0x92'),_0xb204e1[_0x325a('0x4e')],util[_0x325a('0x4f')](_0xb204e1,{'showHidden':![],'depth':null}));if(this[_0x325a('0xe')][_0xb204e1[_0x325a('0x4e')]]){var _0x3d194c=_[_0x325a('0x81')](this[_0x325a('0xe')][_0xb204e1[_0x325a('0x4e')]]);_0x3d194c[_0x325a('0x1b')]=![];_0x3d194c[_0x325a('0x86')]=null;_0x3d194c[_0x325a('0x93')]=!![];_0x3d194c[_0x325a('0x89')]=_0xb204e1[_0x325a('0x94')];_0x3d194c[_0x325a('0x84')]=_0xb204e1['holdtime'];_0x3d194c[_0x325a('0x82')]=!![];_0x3d194c[_0x325a('0x95')]=![];_0x3d194c['queuecallerexitAt']=null;if(!_0x3d194c[_0x325a('0x96')]){if(_0xb204e1[_0x325a('0x97')]=='transfer'){_0x3d194c[_0x325a('0x88')]=_0x325a('0x98');logger[_0x325a('0x6c')](_0x325a('0x99'),_0x3d194c['name'],_0x3d194c[_0x325a('0x58')]);}else{if(_[_0x325a('0x9a')](_0xb204e1[_0x325a('0x3e')]['toLowerCase'](),_0x325a('0x9b'))){if(this['queueReports'][_0xb204e1[_0x325a('0x9c')]]){var _0x538df5=_['last'](this[_0x325a('0xe')][_0xb204e1[_0x325a('0x9c')]]);_0x538df5['queuecallercomplete']=![];_0x538df5['queuecallerexit']=!![];_0x538df5[_0x325a('0x9d')]=moment(_0x3d194c[_0x325a('0x77')])['add'](_0xb204e1[_0x325a('0x84')],_0x325a('0x9e'))[_0x325a('0x50')](_0x325a('0x87'));_0x538df5['queuecallerexitreason']=_0x325a('0x9f');_0x538df5[_0x325a('0x96')]=!![];_0x538df5[_0x325a('0xa0')]=_0x325a('0xa1');_0x538df5['transferexten']=_0xb204e1[_0x325a('0xa2')];_0x538df5[_0x325a('0xa3')]=_0xb204e1[_0x325a('0x4e')];logger[_0x325a('0x6c')](_0x325a('0xa4'),_0x538df5[_0x325a('0x52')],_0x538df5[_0x325a('0x58')]);var _0x3f9baa=this[_0x325a('0xe')][_0xb204e1[_0x325a('0x9c')]];this[_0x325a('0xe')][_0xb204e1['linkedid']]=this[_0x325a('0xe')][_0xb204e1['uniqueid']];this[_0x325a('0xe')][_0xb204e1[_0x325a('0x4e')]]=_0x3f9baa;}}else{_0x3d194c[_0x325a('0x88')]=_0x325a('0xa5')+_0xb204e1[_0x325a('0x97')]['toUpperCase']();logger[_0x325a('0x6c')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x3d194c[_0x325a('0x52')],_0x3d194c[_0x325a('0x58')],_0x3d194c['queuecallerexitreason']);}}}this[_0x325a('0x10')][_0xb204e1['uniqueid']]=_0x3d194c;this[_0x325a('0x48')](_0x3d194c,_0x325a('0x1f'));}}}catch(_0x2b6ede){logger[_0x325a('0x42')](_0x325a('0x92'),_0xb204e1['uniqueid'],util[_0x325a('0x4f')](_0x2b6ede,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x325a('0x9')][_0x325a('0x24')]=function(_0x5a1491){try{if(this[_0x325a('0x65')](_0x5a1491)){logger[_0x325a('0x55')](_0x325a('0xa6'),_0x5a1491[_0x325a('0x4e')],util[_0x325a('0x4f')](_0x5a1491,{'showHidden':![],'depth':null}));this[_0x325a('0xa7')](_0x5a1491[_0x325a('0x4e')],_[_0x325a('0x7d')](_0x5a1491['variable'])[0x0],_0x5a1491[_0x325a('0xa8')]);if(this[_0x325a('0xe')][_0x5a1491[_0x325a('0x4e')]]){var _0x49924e=_[_0x325a('0x81')](this[_0x325a('0xe')][_0x5a1491['uniqueid']]);if(_0x49924e){if(this[_0x325a('0x65')](_0x5a1491['variable'])&&this['isNotNull'](_0x5a1491[_0x325a('0xa9')][_0x325a('0xaa')])){switch(_0x5a1491[_0x325a('0xa8')]){case _0x325a('0xab'):_0x49924e[_0x325a('0x95')]=![];_0x49924e[_0x325a('0x9d')]=null;break;case'TIMEOUT':_0x49924e[_0x325a('0xac')]='timeout';_0x49924e['queuecallerexit']=!![];_0x49924e[_0x325a('0x9d')]=moment()[_0x325a('0x50')](_0x325a('0x87'));_0x49924e[_0x325a('0x8c')]=moment()[_0x325a('0x50')](_0x325a('0x87'));logger[_0x325a('0x55')](_0x325a('0xad'),_0x5a1491[_0x325a('0x4e')],util['inspect'](_0x49924e,{'showHidden':![],'depth':null}));ami[_0x325a('0x4a')](_0x325a('0xae'),_0x49924e);break;default:_0x49924e[_0x325a('0x95')]=!![];_0x49924e[_0x325a('0x9d')]=moment()[_0x325a('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x49924e[_0x325a('0x8c')]=moment()['format'](_0x325a('0x87'));}_0x49924e[_0x325a('0x1b')]=![];_0x49924e['queuecallerabandonAt']=null;_0x49924e['queuecallerexitreason']=_0x5a1491[_0x325a('0xa8')];this[_0x325a('0x10')][_0x5a1491['uniqueid']]=_0x49924e;this[_0x325a('0x48')](_0x49924e,_0x325a('0x23'));}else if(this[_0x325a('0x65')](_0x5a1491[_0x325a('0xa9')])&&this[_0x325a('0x65')](_0x5a1491[_0x325a('0xa9')][_0x325a('0xaf')])){if(!_0x49924e[_0x325a('0x1b')]){_0x49924e[_0x325a('0x95')]=!![];_0x49924e['queuecallerexitAt']=moment()[_0x325a('0x50')](_0x325a('0x87'));_0x49924e[_0x325a('0x88')]=_0x325a('0xb0');_0x49924e['queuecallerleaveAt']=moment()['format'](_0x325a('0x87'));this[_0x325a('0x10')][_0x5a1491[_0x325a('0x4e')]]=_0x49924e;}}logger[_0x325a('0x6c')](_0x325a('0xb1'),_0x5a1491[_0x325a('0x4e')],_0x49924e[_0x325a('0x52')],_0x49924e[_0x325a('0x58')],_[_0x325a('0x7d')](_0x5a1491['variable'])[0x0],_0x5a1491[_0x325a('0xa8')]);_0x49924e[_0x325a('0x45')]=this['variables'][_0x5a1491[_0x325a('0x4e')]];}}}}catch(_0xf39773){logger[_0x325a('0x42')]('[%s][voiceQueueReport][varset]',_0x5a1491[_0x325a('0x4e')],util[_0x325a('0x4f')](_0xf39773,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x19223d,_0x3e599c,_0x34d948){var _0x1d8b80=[_0x325a('0xb2'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x325a('0xb3'),_0x325a('0xb4'),_0x325a('0xb5'),_0x325a('0xb6'),_0x325a('0xb7'),'sipcallid','sipuri',_0x325a('0xb8'),_0x325a('0xb9'),_0x325a('0xba'),_0x325a('0xbb'),'memberinterface',_0x325a('0xbc'),_0x325a('0x94'),_0x325a('0xbd'),_0x325a('0xbe')];if(!_[_0x325a('0x3b')](_0x3e599c)&&!_[_0x325a('0xbf')](_0x1d8b80,_0x3e599c)){if(_[_0x325a('0x66')](this['variables'][_0x19223d])){this[_0x325a('0x45')][_0x19223d]={};}this[_0x325a('0x45')][_0x19223d][_0x3e599c]=_0x34d948;}};VoiceQueueReport[_0x325a('0x9')]['syncHangup']=function(_0x3007f6){try{if(this[_0x325a('0x65')](_0x3007f6)){logger[_0x325a('0x55')](_0x325a('0xc0'),_0x3007f6['uniqueid'],util[_0x325a('0x4f')](_0x3007f6,{'showHidden':![],'depth':null}));if(this[_0x325a('0xe')][_0x3007f6[_0x325a('0x4e')]]){for(var _0xd494d8=0x0,_0x208c7e={};_0xd494d80x0?_0x4503c6:0x0;this['voiceQueues'][_0x1e6f5a[_0xdd52('0x67')]]['talking']=this[_0xdd52('0x12')][_0x1e6f5a[_0xdd52('0x67')]][_0xdd52('0x31')]>_[_0xdd52('0x6a')](_0x1e6f5a[_0xdd52('0x6c')])?_[_0xdd52('0x6a')](_0x1e6f5a[_0xdd52('0x6c')]):this[_0xdd52('0x12')][_0x1e6f5a[_0xdd52('0x67')]][_0xdd52('0x31')];this['emitVoiceQueueSummary'](this[_0xdd52('0x12')][_0x1e6f5a[_0xdd52('0x67')]],_0xdd52('0x65'));}logger[_0xdd52('0x45')](_0xdd52('0x6d'),util[_0xdd52('0x3e')](this[_0xdd52('0x12')][_0x1e6f5a[_0xdd52('0x67')]],{'showHidden':![],'depth':null}));ami[_0xdd52('0x44')]('custom:queuesummary',this[_0xdd52('0x12')][_0x1e6f5a[_0xdd52('0x67')]]);}}}catch(_0xbf8b05){logger[_0xdd52('0x3d')]('[voiceQueueReport][queuesummary]',util[_0xdd52('0x3e')](_0xbf8b05,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xdd52('0x6e')]=function(_0x37ceb6){logger[_0xdd52('0x45')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xdd52('0x3e')](_0x37ceb6,{'showHidden':![],'depth':null}));this[_0xdd52('0x13')]=!![];};VoiceQueueReport[_0xdd52('0xa')][_0xdd52('0x1a')]=function(_0x609566){try{if(this[_0xdd52('0x61')](_0x609566)){logger['debug'](_0xdd52('0x6f'),_0x609566[_0xdd52('0x48')],util[_0xdd52('0x3e')](_0x609566,{'showHidden':![],'depth':null}));if(_[_0xdd52('0x62')](this['queueReports'][_0x609566[_0xdd52('0x48')]]))this[_0xdd52('0xf')][_0x609566[_0xdd52('0x48')]]=[];if(_[_0xdd52('0x62')](this[_0xdd52('0x11')][_0x609566[_0xdd52('0x48')]]))this[_0xdd52('0x11')][_0x609566['uniqueid']]={};var _0x2a8130=new QueueReport();_0x2a8130[_0xdd52('0x4b')]=_0x609566['queue'];_0x2a8130['type']=this['voiceQueues'][_0x2a8130[_0xdd52('0x4b')]]&&this[_0xdd52('0x12')][_0x2a8130[_0xdd52('0x4b')]][_0xdd52('0x57')]?this[_0xdd52('0x12')][_0x2a8130[_0xdd52('0x4b')]][_0xdd52('0x57')]||'inbound':_0xdd52('0x70');_0x2a8130['queue']=_0x609566[_0xdd52('0x67')];_0x2a8130[_0xdd52('0x71')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2a8130[_0xdd52('0x72')]=_0x609566['position'];_0x2a8130[_0xdd52('0x73')]=_0x609566[_0xdd52('0x73')];_0x2a8130[_0xdd52('0x48')]=_0x609566['uniqueid'];_0x2a8130[_0xdd52('0x74')]=this[_0xdd52('0x11')][_0x609566['uniqueid']][_0xdd52('0x74')];logger[_0xdd52('0x75')](_0xdd52('0x76'),_0x2a8130[_0xdd52('0x4b')],_0x2a8130[_0xdd52('0x57')]);_[_0xdd52('0x77')](_0x2a8130,_['pick'](_0x609566,_['keys'](_0x2a8130)));this[_0xdd52('0xf')][_0x609566['uniqueid']][_0xdd52('0x78')](_0x2a8130);this[_0xdd52('0x11')][_0x609566[_0xdd52('0x48')]]=_0x2a8130;this[_0xdd52('0x79')](_0x2a8130,'queuecallerjoin');}}catch(_0x58be5a){logger[_0xdd52('0x3d')]('[%s][voiceQueueReport][queuecallerjoin]',_0x609566[_0xdd52('0x48')],util[_0xdd52('0x3e')](_0x58be5a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xdd52('0x1c')]=function(_0x29bd93){try{if(this[_0xdd52('0x61')](_0x29bd93)){logger['debug'](_0xdd52('0x7a'),_0x29bd93[_0xdd52('0x48')],util[_0xdd52('0x3e')](_0x29bd93,{'showHidden':![],'depth':null}));if(this[_0xdd52('0xf')][_0x29bd93[_0xdd52('0x48')]]){var _0x12fb1b=_[_0xdd52('0x7b')](this[_0xdd52('0xf')][_0x29bd93[_0xdd52('0x48')]]);_0x12fb1b[_0xdd52('0x7c')]=![];_0x12fb1b[_0xdd52('0x7d')]=null;_0x12fb1b['holdtime']=_0x29bd93[_0xdd52('0x7e')];_0x12fb1b[_0xdd52('0x7f')]=_0x29bd93[_0xdd52('0x7f')];_0x12fb1b[_0xdd52('0x1b')]=!![];_0x12fb1b[_0xdd52('0x80')]=moment()[_0xdd52('0x49')](_0xdd52('0x81'));_0x12fb1b[_0xdd52('0x82')]=_0xdd52('0x83');_0x12fb1b[_0xdd52('0x84')]=null;logger[_0xdd52('0x75')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x12fb1b[_0xdd52('0x4b')],_0x12fb1b[_0xdd52('0x57')]);this[_0xdd52('0x11')][_0x29bd93[_0xdd52('0x48')]]=_0x12fb1b;this[_0xdd52('0x42')](_0x12fb1b,_0xdd52('0x1b'));}}}catch(_0x38f9c0){logger[_0xdd52('0x3d')](_0xdd52('0x7a'),_0x29bd93['uniqueid'],util['inspect'](_0x38f9c0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdd52('0xa')]['syncQueueCallerLeave']=function(_0x199857){try{if(this[_0xdd52('0x61')](_0x199857)){logger['debug'](_0xdd52('0x85'),_0x199857['uniqueid'],util['inspect'](_0x199857,{'showHidden':![],'depth':null}));if(this[_0xdd52('0xf')][_0x199857[_0xdd52('0x48')]]){var _0x4086d9=_[_0xdd52('0x7b')](this[_0xdd52('0xf')][_0x199857[_0xdd52('0x48')]]);_0x4086d9[_0xdd52('0x86')]=moment()[_0xdd52('0x49')](_0xdd52('0x81'));_0x4086d9[_0xdd52('0x87')]=_0x199857[_0xdd52('0x87')];_0x4086d9['connectedlinename']=_0x199857['connectedlinename'];logger[_0xdd52('0x75')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x4086d9['name'],_0x4086d9['type'],_0x199857[_0xdd52('0x87')],_0x199857['connectedlinename']);this[_0xdd52('0x11')][_0x199857['uniqueid']]=_0x4086d9;this[_0xdd52('0x79')](_0x4086d9,'queuecallerleave');}}}catch(_0x127b24){logger[_0xdd52('0x3d')](_0xdd52('0x85'),_0x199857[_0xdd52('0x48')],util[_0xdd52('0x3e')](_0x127b24,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xdd52('0x20')]=function(_0x296395){try{if(this['isNotNull'](_0x296395)){logger['debug'](_0xdd52('0x88'),_0x296395[_0xdd52('0x48')],util['inspect'](_0x296395,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x296395[_0xdd52('0x48')]]){var _0x93cfde=_[_0xdd52('0x7b')](this['queueReports'][_0x296395[_0xdd52('0x48')]]);_0x93cfde[_0xdd52('0x7c')]=!![];_0x93cfde['queuecallerexitreason']=_0xdd52('0x89');logger['info'](_0xdd52('0x8a'),_0x93cfde[_0xdd52('0x4b')],_0x93cfde['type']);}}}catch(_0x22580e){logger[_0xdd52('0x3d')](_0xdd52('0x88'),_0x296395[_0xdd52('0x48')],util[_0xdd52('0x3e')](_0x22580e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xdd52('0x1e')]=function(_0x4fd998){try{if(this[_0xdd52('0x61')](_0x4fd998)){logger[_0xdd52('0x45')](_0xdd52('0x8b'),_0x4fd998[_0xdd52('0x48')],util['inspect'](_0x4fd998,{'showHidden':![],'depth':null}));if(this[_0xdd52('0xf')][_0x4fd998[_0xdd52('0x48')]]){var _0x287af4=_[_0xdd52('0x7b')](this[_0xdd52('0xf')][_0x4fd998[_0xdd52('0x48')]]);_0x287af4[_0xdd52('0x1b')]=![];_0x287af4[_0xdd52('0x80')]=null;_0x287af4['assigned']=!![];_0x287af4[_0xdd52('0x84')]=_0x4fd998[_0xdd52('0x8c')];_0x287af4['holdtime']=_0x4fd998[_0xdd52('0x7e')];_0x287af4[_0xdd52('0x7c')]=!![];_0x287af4[_0xdd52('0x8d')]=![];_0x287af4[_0xdd52('0x8e')]=null;if(!_0x287af4[_0xdd52('0x8f')]){if(_0x4fd998[_0xdd52('0x90')]==_0xdd52('0x8f')){_0x287af4[_0xdd52('0x82')]=_0xdd52('0x91');logger['info'](_0xdd52('0x92'),_0x287af4['name'],_0x287af4['type']);}else{if(_['startsWith'](_0x4fd998[_0xdd52('0x39')][_0xdd52('0x93')](),'local/')){if(this['queueReports'][_0x4fd998['linkedid']]){var _0x2f3627=_[_0xdd52('0x7b')](this['queueReports'][_0x4fd998[_0xdd52('0x94')]]);_0x2f3627['queuecallercomplete']=![];_0x2f3627[_0xdd52('0x8d')]=!![];_0x2f3627[_0xdd52('0x8e')]=moment(_0x287af4[_0xdd52('0x71')])['add'](_0x4fd998[_0xdd52('0x7e')],'seconds')[_0xdd52('0x49')](_0xdd52('0x81'));_0x2f3627[_0xdd52('0x82')]=_0xdd52('0x95');_0x2f3627[_0xdd52('0x8f')]=!![];_0x2f3627[_0xdd52('0x96')]=_0xdd52('0x97');_0x2f3627[_0xdd52('0x98')]=_0x4fd998[_0xdd52('0x99')];_0x2f3627[_0xdd52('0x9a')]=_0x4fd998[_0xdd52('0x48')];logger[_0xdd52('0x75')](_0xdd52('0x9b'),_0x2f3627[_0xdd52('0x4b')],_0x2f3627[_0xdd52('0x57')]);var _0x199df6=this[_0xdd52('0xf')][_0x4fd998[_0xdd52('0x94')]];this[_0xdd52('0xf')][_0x4fd998[_0xdd52('0x94')]]=this[_0xdd52('0xf')][_0x4fd998[_0xdd52('0x48')]];this[_0xdd52('0xf')][_0x4fd998[_0xdd52('0x48')]]=_0x199df6;}}else{_0x287af4[_0xdd52('0x82')]=_0xdd52('0x9c')+_0x4fd998[_0xdd52('0x90')]['toUpperCase']();logger[_0xdd52('0x75')](_0xdd52('0x9d'),_0x287af4['name'],_0x287af4[_0xdd52('0x57')],_0x287af4[_0xdd52('0x82')]);}}}this[_0xdd52('0x11')][_0x4fd998[_0xdd52('0x48')]]=_0x287af4;this[_0xdd52('0x42')](_0x287af4,_0xdd52('0x9e'));}}}catch(_0x2dabde){logger[_0xdd52('0x3d')](_0xdd52('0x8b'),_0x4fd998[_0xdd52('0x48')],util['inspect'](_0x2dabde,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdd52('0xa')][_0xdd52('0x22')]=function(_0x1f12a2){try{if(this[_0xdd52('0x61')](_0x1f12a2)){logger[_0xdd52('0x45')](_0xdd52('0x9f'),_0x1f12a2['uniqueid'],util[_0xdd52('0x3e')](_0x1f12a2,{'showHidden':![],'depth':null}));this['addVariable'](_0x1f12a2[_0xdd52('0x48')],_['keys'](_0x1f12a2['variable'])[0x0],_0x1f12a2[_0xdd52('0xa0')]);if(this[_0xdd52('0xf')][_0x1f12a2[_0xdd52('0x48')]]){var _0x29cab8=_['last'](this[_0xdd52('0xf')][_0x1f12a2[_0xdd52('0x48')]]);if(_0x29cab8){if(this[_0xdd52('0x61')](_0x1f12a2[_0xdd52('0xa1')])&&this[_0xdd52('0x61')](_0x1f12a2['variable'][_0xdd52('0xa2')])){switch(_0x1f12a2['value']){case _0xdd52('0xa3'):_0x29cab8[_0xdd52('0x8d')]=![];_0x29cab8[_0xdd52('0x8e')]=null;break;case _0xdd52('0xa4'):_0x29cab8[_0xdd52('0xa5')]=_0xdd52('0xa6');_0x29cab8[_0xdd52('0x8d')]=!![];_0x29cab8[_0xdd52('0x8e')]=moment()['format'](_0xdd52('0x81'));_0x29cab8['queuecallerleaveAt']=moment()[_0xdd52('0x49')](_0xdd52('0x81'));logger['debug'](_0xdd52('0xa7'),_0x1f12a2[_0xdd52('0x48')],util[_0xdd52('0x3e')](_0x29cab8,{'showHidden':![],'depth':null}));ami[_0xdd52('0x44')]('custom:timeout',_0x29cab8);break;default:_0x29cab8[_0xdd52('0x8d')]=!![];_0x29cab8['queuecallerexitAt']=moment()['format'](_0xdd52('0x81'));_0x29cab8[_0xdd52('0x86')]=moment()[_0xdd52('0x49')]('YYYY-MM-DD\x20HH:mm:ss');}_0x29cab8[_0xdd52('0x1b')]=![];_0x29cab8[_0xdd52('0x80')]=null;_0x29cab8[_0xdd52('0x82')]=_0x1f12a2['value'];this[_0xdd52('0x11')][_0x1f12a2['uniqueid']]=_0x29cab8;this['emitVoiceQueueChannelRemove'](_0x29cab8,_0xdd52('0x21'));}else if(this[_0xdd52('0x61')](_0x1f12a2[_0xdd52('0xa1')])&&this['isNotNull'](_0x1f12a2[_0xdd52('0xa1')][_0xdd52('0xa8')])){if(!_0x29cab8['queuecallerabandon']){_0x29cab8[_0xdd52('0x8d')]=!![];_0x29cab8[_0xdd52('0x8e')]=moment()[_0xdd52('0x49')](_0xdd52('0x81'));_0x29cab8[_0xdd52('0x82')]=_0xdd52('0xa9');_0x29cab8[_0xdd52('0x86')]=moment()[_0xdd52('0x49')](_0xdd52('0x81'));this['channels'][_0x1f12a2[_0xdd52('0x48')]]=_0x29cab8;}}logger[_0xdd52('0x75')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x1f12a2[_0xdd52('0x48')],_0x29cab8[_0xdd52('0x4b')],_0x29cab8[_0xdd52('0x57')],_[_0xdd52('0xaa')](_0x1f12a2[_0xdd52('0xa1')])[0x0],_0x1f12a2[_0xdd52('0xa0')]);_0x29cab8[_0xdd52('0x15')]=this['variables'][_0x1f12a2[_0xdd52('0x48')]];}}}}catch(_0x3716aa){logger['error']('[%s][voiceQueueReport][varset]',_0x1f12a2['uniqueid'],util[_0xdd52('0x3e')](_0x3716aa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdd52('0xa')]['addVariable']=function(_0x5092a0,_0xe5338a,_0x10a647){var _0x3d4e98=['rtpaudioqos',_0xdd52('0xab'),_0xdd52('0xac'),_0xdd52('0xad'),'rtpaudioqosloss',_0xdd52('0xae'),_0xdd52('0xaf'),_0xdd52('0xb0'),_0xdd52('0xb1'),_0xdd52('0xb2'),_0xdd52('0xb3'),_0xdd52('0xb4'),'membercalls',_0xdd52('0xb5'),'memberinterface',_0xdd52('0xb6'),_0xdd52('0x8c'),_0xdd52('0xb7'),_0xdd52('0xb8')];if(!_[_0xdd52('0x36')](_0xe5338a)&&!_[_0xdd52('0xb9')](_0x3d4e98,_0xe5338a)){if(_[_0xdd52('0x62')](this[_0xdd52('0x15')][_0x5092a0])){this[_0xdd52('0x15')][_0x5092a0]={};}this[_0xdd52('0x15')][_0x5092a0][_0xe5338a]=_0x10a647;}};VoiceQueueReport[_0xdd52('0xa')]['syncHangup']=function(_0x3c4ae3){try{if(this['isNotNull'](_0x3c4ae3)){logger[_0xdd52('0x45')](_0xdd52('0xba'),_0x3c4ae3['uniqueid'],util['inspect'](_0x3c4ae3,{'showHidden':![],'depth':null}));if(this[_0xdd52('0xf')][_0x3c4ae3['uniqueid']]){for(var _0x4fc862=0x0,_0x78a8be={};_0x4fc862=0x0?moment(_0x39f50a[_0xe778('0x16')])[_0xe778('0xb')](_0x39f50a[_0xe778('0x15')],_0xe778('0xc')):null,'data1':_0xe778('0x17'),'data2':_0x39f50a[_0xe778('0x11')],'data3':_0x39f50a[_0xe778('0x18')],'data4':_0x39f50a[_0xe778('0x19')]||null,'role':'agent','internal':_0x39f50a[_0xe778('0x11')]?_[_0xe778('0x12')](_0x39f50a[_0xe778('0x11')]):undefined,'uniqueid':_0x39f50a[_0xe778('0x1a')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x49d2=['voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','voice','lastAssignedTo','interface','format','SIP/%s','queuecallerleaveAt','diff','seconds','calleridnum','exten','queue','accountcode','uniqueid','membername','starttime','endtime','dialstring','agent','toNumber','lodash','util','../client'];(function(_0x514a11,_0x11769e){var _0x42b9be=function(_0x188e53){while(--_0x188e53){_0x514a11['push'](_0x514a11['shift']());}};_0x42b9be(++_0x11769e);}(_0x49d2,0x101));var _0x249d=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0x49d2[_0x79cd47];return _0x3b9484;};'use strict';var moment=require('moment');var _=require(_0x249d('0x0'));var util=require(_0x249d('0x1'));var client=require(_0x249d('0x2'));exports[_0x249d('0x3')]=function(_0x14c029){var _0x241d5f=_0x14c029[_0x249d('0x4')]||_0x14c029[_0x249d('0x5')];return client['Request'](_0x249d('0x6'),{'body':{'channel':_0x249d('0x7'),'membername':_0x14c029[_0x249d('0x8')],'interface':_['isNil'](_0x14c029[_0x249d('0x9')])?util[_0x249d('0xa')](_0x249d('0xb'),_0x14c029[_0x249d('0x8')]):_0x14c029[_0x249d('0x9')],'type':'TALKING','enterAt':_0x14c029[_0x249d('0xc')],'exitAt':_0x241d5f,'duration':moment(_0x241d5f)[_0x249d('0xd')](_0x14c029[_0x249d('0xc')],_0x249d('0xe')),'data1':'inbound','data2':_0x14c029[_0x249d('0xf')],'data3':_0x14c029[_0x249d('0x10')],'data4':null,'data5':_0x14c029[_0x249d('0x11')],'role':'agent','internal':_0x14c029[_0x249d('0x12')]?_['toNumber'](_0x14c029[_0x249d('0x12')]):undefined,'uniqueid':_0x14c029[_0x249d('0x13')]},'log':_0x249d('0x6')});};exports['voiceDialReport']=function(_0x7b47de){return client['Request']('CreateMemberReport',{'body':{'channel':_0x249d('0x7'),'membername':_0x7b47de[_0x249d('0x14')],'interface':_0x7b47de[_0x249d('0x9')],'type':'TALKING','enterAt':_0x7b47de[_0x249d('0x15')],'exitAt':_0x7b47de[_0x249d('0x16')],'duration':moment(_0x7b47de[_0x249d('0x16')])['diff'](_0x7b47de[_0x249d('0x15')],_0x249d('0xe'))>=0x0?moment(_0x7b47de[_0x249d('0x16')])[_0x249d('0xd')](_0x7b47de[_0x249d('0x15')],_0x249d('0xe')):null,'data1':'outbound','data2':_0x7b47de[_0x249d('0x12')],'data3':_0x7b47de['exten'],'data4':_0x7b47de[_0x249d('0x17')]||null,'role':_0x249d('0x18'),'internal':_0x7b47de[_0x249d('0x12')]?_[_0x249d('0x19')](_0x7b47de[_0x249d('0x12')]):undefined,'uniqueid':_0x7b47de[_0x249d('0x13')]},'log':_0x249d('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index cd37434..3f79ffb 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 _0xb48d=['../client','Request','stopRecordingOnTransfer','GetSettings'];(function(_0x5e8528,_0x27755f){var _0x5c32e3=function(_0x53d6cb){while(--_0x53d6cb){_0x5e8528['push'](_0x5e8528['shift']());}};_0x5c32e3(++_0x27755f);}(_0xb48d,0x194));var _0xdb48=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xb48d[_0x3fba9f];return _0x192cf1;};'use strict';var client=require(_0xdb48('0x0'));exports['getSettings']=function(){return client[_0xdb48('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xdb48('0x2')]},'log':_0xdb48('0x3')});}; \ No newline at end of file +var _0xa1aa=['GetSettings','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x502006,_0x5c93cd){var _0xa2c0dd=function(_0x1fca26){while(--_0x1fca26){_0x502006['push'](_0x502006['shift']());}};_0xa2c0dd(++_0x5c93cd);}(_0xa1aa,0x19b));var _0xaa1a=function(_0x18a71c,_0x617d18){_0x18a71c=_0x18a71c-0x0;var _0x564a01=_0xa1aa[_0x18a71c];return _0x564a01;};'use strict';var client=require('../client');exports[_0xaa1a('0x0')]=function(){return client[_0xaa1a('0x1')](_0xaa1a('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xaa1a('0x3')]},'log':_0xaa1a('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 42d4740..6a79d86 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 _0x15fe=['../client','getTemplates','name','GetTemplate'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0x15fe,0x158));var _0xe15f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x15fe[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xe15f('0x0'));exports[_0xe15f('0x1')]=function(_0x372592){return function(_0x3d46ae){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xe15f('0x2'),'html']},'log':_0xe15f('0x3')});};}; \ No newline at end of file +var _0xdb84=['GetTemplate','name','html','getTemplates','Request'];(function(_0x11d684,_0x4d4123){var _0x78a301=function(_0x1a1966){while(--_0x1a1966){_0x11d684['push'](_0x11d684['shift']());}};_0x78a301(++_0x4d4123);}(_0xdb84,0xa8));var _0x4db8=function(_0x287ed0,_0x2b709a){_0x287ed0=_0x287ed0-0x0;var _0x3bb397=_0xdb84[_0x287ed0];return _0x3bb397;};'use strict';var client=require('../client');exports[_0x4db8('0x0')]=function(_0x46ca70){return function(_0x566868){return client[_0x4db8('0x1')](_0x4db8('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4db8('0x3'),_0x4db8('0x4')]},'log':_0x4db8('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 48b3d4e..9ff05f8 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 _0xc30c=['GetTrigger','name','status','Condition','AllConditions','value','AnyConditions','operator','Action','action','data2','data4','data6','data7','../client','getTriggers','Request'];(function(_0x1f62c3,_0x1ff95b){var _0x385c1c=function(_0x1db580){while(--_0x1db580){_0x1f62c3['push'](_0x1f62c3['shift']());}};_0x385c1c(++_0x1ff95b);}(_0xc30c,0x12f));var _0xcc30=function(_0x33500d,_0x408f01){_0x33500d=_0x33500d-0x0;var _0x34b5a0=_0xc30c[_0x33500d];return _0x34b5a0;};'use strict';var client=require(_0xcc30('0x0'));exports[_0xcc30('0x1')]=function(_0x63b1e2){return function(_0x397ccf){return client[_0xcc30('0x2')](_0xcc30('0x3'),{'options':{'raw':![],'attributes':['id',_0xcc30('0x4'),'channel',_0xcc30('0x5')],'include':[{'model':_0xcc30('0x6'),'as':_0xcc30('0x7'),'attributes':['id','field','operator',_0xcc30('0x8')]},{'model':_0xcc30('0x6'),'as':_0xcc30('0x9'),'attributes':['id','field',_0xcc30('0xa'),'value']},{'model':_0xcc30('0xb'),'as':'Actions','attributes':['id',_0xcc30('0xc'),'data1',_0xcc30('0xd'),'data3',_0xcc30('0xe'),'data5',_0xcc30('0xf'),_0xcc30('0x10')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x4813=['data6','data7','GetTrigger','status','Condition','AllConditions','operator','value','AnyConditions','field','Action','Actions','action','data1','data2','data4','data5'];(function(_0x15ad31,_0x31d3f8){var _0xd07157=function(_0x3e1f60){while(--_0x3e1f60){_0x15ad31['push'](_0x15ad31['shift']());}};_0xd07157(++_0x31d3f8);}(_0x4813,0x189));var _0x3481=function(_0x23fee7,_0x284202){_0x23fee7=_0x23fee7-0x0;var _0x276d57=_0x4813[_0x23fee7];return _0x276d57;};'use strict';var client=require('../client');exports['getTriggers']=function(_0xe32a28){return function(_0x3ea43f){return client['Request'](_0x3481('0x0'),{'options':{'raw':![],'attributes':['id','name','channel',_0x3481('0x1')],'include':[{'model':_0x3481('0x2'),'as':_0x3481('0x3'),'attributes':['id','field',_0x3481('0x4'),_0x3481('0x5')]},{'model':'Condition','as':_0x3481('0x6'),'attributes':['id',_0x3481('0x7'),_0x3481('0x4'),_0x3481('0x5')]},{'model':_0x3481('0x8'),'as':_0x3481('0x9'),'attributes':['id',_0x3481('0xa'),_0x3481('0xb'),_0x3481('0xc'),'data3',_0x3481('0xd'),_0x3481('0xe'),_0x3481('0xf'),_0x3481('0x10')]}]},'log':_0x3481('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index e7acdd9..f6eb946 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 _0x7c53=['defaultuser','../client','Request','GetTrunk','name','registry'];(function(_0x449cb2,_0x5efb41){var _0x251d51=function(_0x556629){while(--_0x556629){_0x449cb2['push'](_0x449cb2['shift']());}};_0x251d51(++_0x5efb41);}(_0x7c53,0xbb));var _0x37c5=function(_0x2e3821,_0x23549d){_0x2e3821=_0x2e3821-0x0;var _0x29427d=_0x7c53[_0x2e3821];return _0x29427d;};'use strict';var client=require(_0x37c5('0x0'));exports['getTrunks']=function(_0x585720){return function(_0x5d68df){return client[_0x37c5('0x1')](_0x37c5('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x37c5('0x3'),_0x37c5('0x4'),_0x37c5('0x5')]},'log':_0x37c5('0x2')});};}; \ No newline at end of file +var _0x3890=['Request','GetTrunk','name','registry','defaultuser','../client'];(function(_0x21f001,_0x316d61){var _0x24ef50=function(_0x574ee2){while(--_0x574ee2){_0x21f001['push'](_0x21f001['shift']());}};_0x24ef50(++_0x316d61);}(_0x3890,0x161));var _0x0389=function(_0x46253d,_0x5c571d){_0x46253d=_0x46253d-0x0;var _0x241c3c=_0x3890[_0x46253d];return _0x241c3c;};'use strict';var client=require(_0x0389('0x0'));exports['getTrunks']=function(_0x30da5e){return function(_0x1baf0d){return client[_0x0389('0x1')](_0x0389('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x0389('0x3'),_0x0389('0x4'),_0x0389('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 95ce862..462d513 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 _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x525d49,_0x1a53a1){var _0x2e9c77=function(_0x5edd27){while(--_0x5edd27){_0x525d49['push'](_0x525d49['shift']());}};_0x2e9c77(++_0x1a53a1);}(_0xedd9,0xfc));var _0x9edd=function(_0x45313f,_0x46caf4){_0x45313f=_0x45313f-0x0;var _0x402910=_0xedd9[_0x45313f];return _0x402910;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file +var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0xac12b,_0x3f0dfa){var _0x5d1fd3=function(_0x493e6b){while(--_0x493e6b){_0xac12b['push'](_0xac12b['shift']());}};_0x5d1fd3(++_0x3f0dfa);}(_0x70e0,0x17b));var _0x070e=function(_0xb1598a,_0x5dae78){_0xb1598a=_0xb1598a-0x0;var _0x2db947=_0x70e0[_0xb1598a];return _0x2db947;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index a746343..c9cc156 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 _0x0770=['CreateVoiceAgentReport','update','Request'];(function(_0xf43a56,_0x23a09d){var _0x373f29=function(_0x1dac7a){while(--_0x1dac7a){_0xf43a56['push'](_0xf43a56['shift']());}};_0x373f29(++_0x23a09d);}(_0x0770,0x119));var _0x0077=function(_0x3ce8c9,_0x2ccfaa){_0x3ce8c9=_0x3ce8c9-0x0;var _0x184215=_0x0770[_0x3ce8c9];return _0x184215;};'use strict';var client=require('../client');exports['create']=function(_0x5f4367){return client[_0x0077('0x0')](_0x0077('0x1'),{'body':_0x5f4367,'log':'CreateVoiceAgentReport'});};exports[_0x0077('0x2')]=function(_0x18df75,_0x439a47,_0x5606b1){return client[_0x0077('0x0')]('UpdateVoiceAgentReport',{'body':_0x18df75,'options':{'where':{'uniqueid':_0x439a47,'interface':_0x5606b1,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xab4e=['CreateVoiceAgentReport','Request','UpdateVoiceAgentReport','create'];(function(_0x955896,_0x224088){var _0x31aabb=function(_0x111910){while(--_0x111910){_0x955896['push'](_0x955896['shift']());}};_0x31aabb(++_0x224088);}(_0xab4e,0x1bf));var _0xeab4=function(_0x2bb253,_0x2b4097){_0x2bb253=_0x2bb253-0x0;var _0x22ef01=_0xab4e[_0x2bb253];return _0x22ef01;};'use strict';var client=require('../client');exports[_0xeab4('0x0')]=function(_0x34daf4){return client['Request'](_0xeab4('0x1'),{'body':_0x34daf4,'log':_0xeab4('0x1')});};exports['update']=function(_0x50fd92,_0x38ff64,_0x189345){return client[_0xeab4('0x2')]('UpdateVoiceAgentReport',{'body':_0x50fd92,'options':{'where':{'uniqueid':_0x38ff64,'interface':_0x189345,'agentcomplete':!![]}},'log':_0xeab4('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 681bfa9..d140eba 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 _0x642d=['GetVoiceCallReports','util','../client','Request','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','billableseconds'];(function(_0x5a91d9,_0x47cedb){var _0x5275e2=function(_0x15de79){while(--_0x15de79){_0x5a91d9['push'](_0x5a91d9['shift']());}};_0x5275e2(++_0x47cedb);}(_0x642d,0x144));var _0xd642=function(_0x17cfe5,_0x485773){_0x17cfe5=_0x17cfe5-0x0;var _0x3db55b=_0x642d[_0x17cfe5];return _0x3db55b;};'use strict';var moment=require('moment');var util=require(_0xd642('0x0'));var _=require('lodash');var client=require(_0xd642('0x1'));exports['create']=function(_0x1744ee){return client[_0xd642('0x2')]('CreateVoiceCallReport',{'body':_['merge'](_0x1744ee,{'source':_0x1744ee[_0xd642('0x3')],'destinationcontext':_0x1744ee[_0xd642('0x4')],'callerid':_0x1744ee[_0xd642('0x5')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0xd642('0x6')]=function(){return function(){return client[_0xd642('0x2')](_0xd642('0x7'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xd642('0x8')](_0xd642('0x9'))[_0xd642('0xa')](_0xd642('0xb')),moment()[_0xd642('0xc')]('day')[_0xd642('0xa')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xd642('0xd'),_0xd642('0xe'),'duration',_0xd642('0xf')]},'log':_0xd642('0x10')});};}; \ No newline at end of file +var _0x495d=['moment','util','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','startOf','format','YYYY-MM-DD\x20HH:mm:ss','day','disposition','duration','GetVoiceCallReports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x495d,0xb0));var _0xd495=function(_0x1c06ef,_0x40b60b){_0x1c06ef=_0x1c06ef-0x0;var _0x52eaef=_0x495d[_0x1c06ef];return _0x52eaef;};'use strict';var moment=require(_0xd495('0x0'));var util=require(_0xd495('0x1'));var _=require('lodash');var client=require('../client');exports[_0xd495('0x2')]=function(_0x598e83){return client[_0xd495('0x3')](_0xd495('0x4'),{'body':_[_0xd495('0x5')](_0x598e83,{'source':_0x598e83[_0xd495('0x6')],'destinationcontext':_0x598e83[_0xd495('0x7')],'callerid':_0x598e83[_0xd495('0x8')],'amaflags':'DOCUMENTATION'}),'log':_0xd495('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0xd495('0x3')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xd495('0x9')]('day')[_0xd495('0xa')](_0xd495('0xb')),moment()['endOf'](_0xd495('0xc'))[_0xd495('0xa')](_0xd495('0xb'))]}},'attributes':['type',_0xd495('0xd'),_0xd495('0xe'),'billableseconds']},'log':_0xd495('0xf')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index fb917f5..1afe9be 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 _0x8cf1=['CreateVoiceDialReport','../client','create'];(function(_0x318666,_0x58de8f){var _0x251b10=function(_0x43d92f){while(--_0x43d92f){_0x318666['push'](_0x318666['shift']());}};_0x251b10(++_0x58de8f);}(_0x8cf1,0x166));var _0x18cf=function(_0x386434,_0x6d186a){_0x386434=_0x386434-0x0;var _0x5e5ba7=_0x8cf1[_0x386434];return _0x5e5ba7;};'use strict';var client=require(_0x18cf('0x0'));exports[_0x18cf('0x1')]=function(_0x2d0b52){return client['Request'](_0x18cf('0x2'),{'body':_0x2d0b52,'log':_0x18cf('0x2')});}; \ No newline at end of file +var _0x15a9=['Request','CreateVoiceDialReport','../client','create'];(function(_0x151262,_0x3ee27b){var _0x1ca4e0=function(_0x33f837){while(--_0x33f837){_0x151262['push'](_0x151262['shift']());}};_0x1ca4e0(++_0x3ee27b);}(_0x15a9,0x152));var _0x915a=function(_0x15b278,_0x468425){_0x15b278=_0x15b278-0x0;var _0x4b2ab9=_0x15a9[_0x15b278];return _0x4b2ab9;};'use strict';var client=require(_0x915a('0x0'));exports[_0x915a('0x1')]=function(_0x2042c7){return client[_0x915a('0x2')](_0x915a('0x3'),{'body':_0x2042c7,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index f27836a..46dac22 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 _0xeea4=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x5447aa,_0x3afc00){var _0xb21e53=function(_0x2d05f6){while(--_0x2d05f6){_0x5447aa['push'](_0x5447aa['shift']());}};_0xb21e53(++_0x3afc00);}(_0xeea4,0x19e));var _0x4eea=function(_0x4880a0,_0x4a2fb3){_0x4880a0=_0x4880a0-0x0;var _0x1ed7a7=_0xeea4[_0x4880a0];return _0x1ed7a7;};'use strict';var client=require(_0x4eea('0x0'));exports[_0x4eea('0x1')]=function(){return function(){return client[_0x4eea('0x2')](_0x4eea('0x3'),{'options':{'raw':!![],'attributes':['id',_0x4eea('0x4'),_0x4eea('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x4eea('0x1')});};}; \ No newline at end of file +var _0x1094=['getVoiceExtensions','GetVoiceExtension','recordingFormat','../client'];(function(_0x20beae,_0x5eac6d){var _0xf5725=function(_0x926a3b){while(--_0x926a3b){_0x20beae['push'](_0x20beae['shift']());}};_0xf5725(++_0x5eac6d);}(_0x1094,0x143));var _0x4109=function(_0x1d60d0,_0x2cfa88){_0x1d60d0=_0x1d60d0-0x0;var _0x1a0917=_0x1094[_0x1d60d0];return _0x1a0917;};'use strict';var client=require(_0x4109('0x0'));exports[_0x4109('0x1')]=function(){return function(){return client['Request'](_0x4109('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0x4109('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x4109('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 8e972a2..8d66b5a 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 _0xaddc=['Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','Pause','mandatoryDispositionPause','name','TrunkBackup','active'];(function(_0x4b6cc8,_0x355e5b){var _0x5c4743=function(_0x68d0f6){while(--_0x68d0f6){_0x4b6cc8['push'](_0x4b6cc8['shift']());}};_0x5c4743(++_0x355e5b);}(_0xaddc,0x166));var _0xcadd=function(_0xab9db6,_0x5792de){_0xab9db6=_0xab9db6-0x0;var _0x261ee2=_0xaddc[_0xab9db6];return _0x261ee2;};'use strict';var client=require(_0xcadd('0x0'));exports[_0xcadd('0x1')]=function(){return function(){return client[_0xcadd('0x2')](_0xcadd('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xcadd('0x4'),_0xcadd('0x5'),_0xcadd('0x6'),_0xcadd('0x7'),_0xcadd('0x8'),_0xcadd('0x9'),_0xcadd('0xa'),_0xcadd('0xb'),'dialLimitQueue',_0xcadd('0xc'),_0xcadd('0xd'),_0xcadd('0xe'),_0xcadd('0xf'),_0xcadd('0x10'),_0xcadd('0x11'),_0xcadd('0x12'),_0xcadd('0x13'),'dialQueueTimeout',_0xcadd('0x14'),_0xcadd('0x15'),_0xcadd('0x16'),_0xcadd('0x17'),'dialBusyRetryFrequency',_0xcadd('0x18'),_0xcadd('0x19'),_0xcadd('0x1a'),_0xcadd('0x1b'),_0xcadd('0x1c'),_0xcadd('0x1d'),_0xcadd('0x1e'),_0xcadd('0x1f'),_0xcadd('0x20'),_0xcadd('0x21'),_0xcadd('0x22'),_0xcadd('0x23'),'dialAMDMinWordLength',_0xcadd('0x24'),'dialAMDMaximumNumberOfWords',_0xcadd('0x25'),_0xcadd('0x26'),_0xcadd('0x27'),_0xcadd('0x28'),_0xcadd('0x29'),_0xcadd('0x2a'),_0xcadd('0x2b'),_0xcadd('0x2c'),_0xcadd('0x2d'),_0xcadd('0x7'),_0xcadd('0x2e'),_0xcadd('0x2f'),_0xcadd('0x30'),_0xcadd('0x31'),'dialNoSuchNumberRetryFrequency',_0xcadd('0x32'),_0xcadd('0x33'),_0xcadd('0x34'),_0xcadd('0x35'),_0xcadd('0x36'),_0xcadd('0x37'),_0xcadd('0x38'),_0xcadd('0x39'),_0xcadd('0x3a'),_0xcadd('0x3b'),_0xcadd('0x3c')],'include':[{'model':_0xcadd('0x3d'),'as':'Trunk','attributes':['id','name',_0xcadd('0x3e'),'active']},{'model':_0xcadd('0x3f'),'as':_0xcadd('0x40'),'attributes':['id',_0xcadd('0x41')]},{'model':_0xcadd('0x3d'),'as':_0xcadd('0x42'),'attributes':['id',_0xcadd('0x41'),'callerid',_0xcadd('0x43')]},{'model':_0xcadd('0x44'),'as':_0xcadd('0x44'),'attributes':['id',_0xcadd('0x41')],'include':[{'model':_0xcadd('0x44'),'as':_0xcadd('0x45'),'attributes':['id','name',_0xcadd('0x46')]}]}]},'log':_0xcadd('0x1')});};}; \ No newline at end of file +var _0xdcc2=['callerid','Pause','TrunkBackup','active','Interval','Intervals','interval','getVoiceQueues','name','acwTimeout','autopause','type','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xdcc2,0xb2));var _0x2dcc=function(_0x4bd249,_0x34fe12){_0x4bd249=_0x4bd249-0x0;var _0x5d5448=_0xdcc2[_0x4bd249];return _0x5d5448;};'use strict';var client=require('../client');exports[_0x2dcc('0x0')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x2dcc('0x1'),'acw',_0x2dcc('0x2'),_0x2dcc('0x3'),'monitor_format',_0x2dcc('0x4'),'dialActive','dialMethod',_0x2dcc('0x5'),'dialLimitQueue',_0x2dcc('0x6'),'dialPredictiveOptimization',_0x2dcc('0x7'),_0x2dcc('0x8'),_0x2dcc('0x9'),_0x2dcc('0xa'),_0x2dcc('0xb'),'dialQueueOptions',_0x2dcc('0xc'),'dialQueueProject',_0x2dcc('0xd'),_0x2dcc('0xe'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x2dcc('0xf'),_0x2dcc('0x10'),_0x2dcc('0x11'),'dialTimezone',_0x2dcc('0x12'),_0x2dcc('0x13'),_0x2dcc('0x14'),'dialAMDActive',_0x2dcc('0x15'),'dialAMDGreeting',_0x2dcc('0x16'),'dialAMDTotalAnalysisTime',_0x2dcc('0x17'),_0x2dcc('0x18'),_0x2dcc('0x19'),_0x2dcc('0x1a'),_0x2dcc('0x1b'),_0x2dcc('0x1c'),_0x2dcc('0x1d'),_0x2dcc('0x1e'),'dialOrderByScheduledAt',_0x2dcc('0x1f'),_0x2dcc('0x20'),_0x2dcc('0x21'),_0x2dcc('0x22'),_0x2dcc('0x23'),_0x2dcc('0x24'),_0x2dcc('0x25'),_0x2dcc('0x26'),_0x2dcc('0x27'),_0x2dcc('0x28'),_0x2dcc('0x29'),'dialAbandonedMaxRetry',_0x2dcc('0x2a'),_0x2dcc('0x2b'),_0x2dcc('0x2c'),_0x2dcc('0x2d'),'dialAgentRejectRetryFrequency',_0x2dcc('0x2e'),_0x2dcc('0x2f'),_0x2dcc('0x30')],'include':[{'model':_0x2dcc('0x31'),'as':_0x2dcc('0x31'),'attributes':['id',_0x2dcc('0x1'),_0x2dcc('0x32'),'active']},{'model':_0x2dcc('0x33'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0x2dcc('0x31'),'as':_0x2dcc('0x34'),'attributes':['id',_0x2dcc('0x1'),'callerid',_0x2dcc('0x35')]},{'model':_0x2dcc('0x36'),'as':_0x2dcc('0x36'),'attributes':['id',_0x2dcc('0x1')],'include':[{'model':'Interval','as':_0x2dcc('0x37'),'attributes':['id',_0x2dcc('0x1'),_0x2dcc('0x38')]}]}]},'log':_0x2dcc('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 9e16b23..b94c24c 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(_0x3e1a0e,_0xe310c1){var _0x1d115c=function(_0x378d54){while(--_0x378d54){_0x3e1a0e['push'](_0x3e1a0e['shift']());}};_0x1d115c(++_0xe310c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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(_0x15aa4a,_0x4d472a){var _0x40454c=function(_0x531087){while(--_0x531087){_0x15aa4a['push'](_0x15aa4a['shift']());}};_0x40454c(++_0x4d472a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 0db5893..17ecf56 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 _0xd055=['../client','getVoiceQueueRtPauses','Request'];(function(_0xf6074f,_0x40fe18){var _0x4c6c10=function(_0x499c8b){while(--_0x499c8b){_0xf6074f['push'](_0xf6074f['shift']());}};_0x4c6c10(++_0x40fe18);}(_0xd055,0x111));var _0x5d05=function(_0x550ac4,_0x1f0436){_0x550ac4=_0x550ac4-0x0;var _0x3b1091=_0xd055[_0x550ac4];return _0x3b1091;};'use strict';var client=require(_0x5d05('0x0'));exports[_0x5d05('0x1')]=function(_0x294ecd){return function(){return client[_0x5d05('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x294ecd,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x8b72=['getVoiceQueueRtPauses','Request','../client'];(function(_0x45c981,_0x2ad2d4){var _0x4f62c8=function(_0x55209b){while(--_0x55209b){_0x45c981['push'](_0x45c981['shift']());}};_0x4f62c8(++_0x2ad2d4);}(_0x8b72,0x89));var _0x28b7=function(_0x2743d3,_0x501919){_0x2743d3=_0x2743d3-0x0;var _0x4beae3=_0x8b72[_0x2743d3];return _0x4beae3;};'use strict';var client=require(_0x28b7('0x0'));exports[_0x28b7('0x1')]=function(_0x381d08){return function(){return client[_0x28b7('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x381d08,'paused':!![]},'raw':!![]},'log':_0x28b7('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 11dec45..df6edf6 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x1703d4,_0x346ae7){var _0x13800b=function(_0x414b3d){while(--_0x414b3d){_0x1703d4['push'](_0x1703d4['shift']());}};_0x13800b(++_0x346ae7);}(_0x7a54,0x106));var _0x47a5=function(_0x209c8e,_0x1b7391){_0x209c8e=_0x209c8e-0x0;var _0x1f2223=_0x7a54[_0x209c8e];return _0x1f2223;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x3eb254,_0xadd1c3){var _0x5da5bb=function(_0x42547a){while(--_0x42547a){_0x3eb254['push'](_0x3eb254['shift']());}};_0x5da5bb(++_0xadd1c3);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 4f8b721..09d56fe 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 _0x59e3=['context','extension','attendedTransfer','result','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal'];(function(_0x52df6e,_0x3dc3fe){var _0x2248c0=function(_0x22692b){while(--_0x22692b){_0x52df6e['push'](_0x52df6e['shift']());}};_0x2248c0(++_0x3dc3fe);}(_0x59e3,0xd6));var _0x359e=function(_0x4c83a4,_0x1cbc7d){_0x4c83a4=_0x4c83a4-0x0;var _0x4f9e42=_0x59e3[_0x4c83a4];return _0x4f9e42;};'use strict';var client=require(_0x359e('0x0'));exports[_0x359e('0x1')]={};exports[_0x359e('0x2')]=function(_0x30182c){return client[_0x359e('0x3')](_0x359e('0x4'),{'body':{'result':_0x30182c['result'],'transfererchannel':_0x30182c[_0x359e('0x5')],'transferercalleridnum':_0x30182c[_0x359e('0x6')],'transferercalleridname':_0x30182c[_0x359e('0x7')],'transfererconnectedlinenum':_0x30182c['transfererconnectedlinenum'],'transfererconnectedlinename':_0x30182c['transfererconnectedlinename'],'transfereraccountcode':_0x30182c[_0x359e('0x8')],'transferercontext':_0x30182c[_0x359e('0x9')],'transfererexten':_0x30182c[_0x359e('0xa')],'transfererlinkedid':_0x30182c[_0x359e('0xb')],'transfereechannel':_0x30182c[_0x359e('0xc')],'transfereecalleridnum':_0x30182c[_0x359e('0xd')],'transfereecalleridname':_0x30182c[_0x359e('0xe')],'transfereeconnectedlinenum':_0x30182c['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x30182c['transfereeconnectedlinename'],'transfereeaccountcode':_0x30182c[_0x359e('0xf')],'transfereecontext':_0x30182c[_0x359e('0x10')],'transfereeexten':_0x30182c[_0x359e('0x11')],'transfereelinkedid':_0x30182c[_0x359e('0x12')],'isexternal':_0x30182c[_0x359e('0x13')],'context':_0x30182c[_0x359e('0x14')],'extension':_0x30182c[_0x359e('0x15')],'type':'blind'},'log':_0x359e('0x4')});};exports[_0x359e('0x16')]=function(_0x297d34){return client[_0x359e('0x3')](_0x359e('0x4'),{'body':{'result':_0x297d34[_0x359e('0x17')],'transfererchannel':_0x297d34['origtransfererchannel'],'transferercalleridnum':_0x297d34[_0x359e('0x18')],'transferercalleridname':_0x297d34[_0x359e('0x19')],'transfererconnectedlinenum':_0x297d34[_0x359e('0x1a')],'transfererconnectedlinename':_0x297d34[_0x359e('0x1b')],'transfereraccountcode':_0x297d34[_0x359e('0x1c')],'transferercontext':_0x297d34['secondtransferercontext'],'transfererexten':_0x297d34[_0x359e('0x1d')],'transfererlinkedid':_0x297d34['origtransfererlinkedid'],'transfereechannel':_0x297d34[_0x359e('0x1e')],'transfereecalleridnum':_0x297d34[_0x359e('0x1f')],'transfereecalleridname':_0x297d34[_0x359e('0x20')],'transfereeconnectedlinenum':_0x297d34[_0x359e('0x21')],'transfereeconnectedlinename':_0x297d34[_0x359e('0x22')],'transfereeaccountcode':_0x297d34[_0x359e('0x23')],'transfereecontext':_0x297d34[_0x359e('0x24')],'transfereeexten':_0x297d34['transfertargetexten'],'transfereelinkedid':_0x297d34[_0x359e('0x25')],'isexternal':_0x297d34['isexternal'],'context':_0x297d34['origtransferercontext'],'extension':_0x297d34['origtransfererexten'],'type':_0x359e('0x26')},'log':_0x359e('0x4')});}; \ No newline at end of file +var _0xf04f=['transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','Request','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x55ce6e,_0x34d72e){var _0x5b26ad=function(_0x2b4d9e){while(--_0x2b4d9e){_0x55ce6e['push'](_0x55ce6e['shift']());}};_0x5b26ad(++_0x34d72e);}(_0xf04f,0x181));var _0xff04=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0xf04f[_0x2ca9d4];return _0x258956;};'use strict';var client=require(_0xff04('0x0'));exports[_0xff04('0x1')]={};exports['blindTransfer']=function(_0x12669b){return client[_0xff04('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x12669b[_0xff04('0x3')],'transfererchannel':_0x12669b[_0xff04('0x4')],'transferercalleridnum':_0x12669b[_0xff04('0x5')],'transferercalleridname':_0x12669b[_0xff04('0x6')],'transfererconnectedlinenum':_0x12669b[_0xff04('0x7')],'transfererconnectedlinename':_0x12669b[_0xff04('0x8')],'transfereraccountcode':_0x12669b['transfereraccountcode'],'transferercontext':_0x12669b[_0xff04('0x9')],'transfererexten':_0x12669b[_0xff04('0xa')],'transfererlinkedid':_0x12669b[_0xff04('0xb')],'transfereechannel':_0x12669b[_0xff04('0xc')],'transfereecalleridnum':_0x12669b[_0xff04('0xd')],'transfereecalleridname':_0x12669b['transfereecalleridname'],'transfereeconnectedlinenum':_0x12669b[_0xff04('0xe')],'transfereeconnectedlinename':_0x12669b[_0xff04('0xf')],'transfereeaccountcode':_0x12669b['transfereeaccountcode'],'transfereecontext':_0x12669b[_0xff04('0x10')],'transfereeexten':_0x12669b[_0xff04('0x11')],'transfereelinkedid':_0x12669b[_0xff04('0x12')],'isexternal':_0x12669b[_0xff04('0x13')],'context':_0x12669b[_0xff04('0x14')],'extension':_0x12669b[_0xff04('0x15')],'type':_0xff04('0x16')},'log':'CreateVoiceTransferReport'});};exports[_0xff04('0x17')]=function(_0x43fe8f){return client[_0xff04('0x2')](_0xff04('0x18'),{'body':{'result':_0x43fe8f[_0xff04('0x3')],'transfererchannel':_0x43fe8f[_0xff04('0x19')],'transferercalleridnum':_0x43fe8f[_0xff04('0x1a')],'transferercalleridname':_0x43fe8f[_0xff04('0x1b')],'transfererconnectedlinenum':_0x43fe8f[_0xff04('0x1c')],'transfererconnectedlinename':_0x43fe8f[_0xff04('0x1d')],'transfereraccountcode':_0x43fe8f[_0xff04('0x1e')],'transferercontext':_0x43fe8f[_0xff04('0x1f')],'transfererexten':_0x43fe8f[_0xff04('0x20')],'transfererlinkedid':_0x43fe8f['origtransfererlinkedid'],'transfereechannel':_0x43fe8f['transfertargetchannel'],'transfereecalleridnum':_0x43fe8f[_0xff04('0x21')],'transfereecalleridname':_0x43fe8f[_0xff04('0x22')],'transfereeconnectedlinenum':_0x43fe8f[_0xff04('0x23')],'transfereeconnectedlinename':_0x43fe8f[_0xff04('0x24')],'transfereeaccountcode':_0x43fe8f['transfertargetaccountcode'],'transfereecontext':_0x43fe8f[_0xff04('0x25')],'transfereeexten':_0x43fe8f['transfertargetexten'],'transfereelinkedid':_0x43fe8f[_0xff04('0x26')],'isexternal':_0x43fe8f['isexternal'],'context':_0x43fe8f[_0xff04('0x27')],'extension':_0x43fe8f[_0xff04('0x28')],'type':_0xff04('0x29')},'log':_0xff04('0x18')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 5c1c052..230644e 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 _0x0a6b=['asterisk','ami\x20disconnected','pick','keys','module','Action','then','message','catch','isConnected','username','join','command','action','content','hasOwnProperty','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','find','omit','undefined','values','voicechannel','validate','map','uniqueid','channel','format','%s.%s','filename','wav','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','channels','resolve','StopMixMonitor','destinationchannel','stop','toLowerCase','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelhangup','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','checkAfterSend','http','listen','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','bluebird','../../../config/environment','../properties','../ami','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error'];(function(_0x499430,_0x344a19){var _0x1bf7e9=function(_0x57d42c){while(--_0x57d42c){_0x499430['push'](_0x499430['shift']());}};_0x1bf7e9(++_0x344a19);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x487ee4,_0x3d3e66){_0x487ee4=_0x487ee4-0x0;var _0x3b0877=_0x0a6b[_0x487ee4];return _0x3b0877;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require(_0xb0a6('0x1'));var moment=require('moment');var config=require(_0xb0a6('0x2'));var properties=require(_0xb0a6('0x3'));var ami=require(_0xb0a6('0x4'));exports['listen']=function(_0x102ecd,_0x4cc3ae,_0xbbdf89){return new BPromise(function(_0x415e9e,_0x5e2d2d){var _0x11cd5b={'QueuePause':function(_0x24515c){return new Promise(function(_0x2a8516,_0x530c05){var _0x47c553=util['format'](_0xb0a6('0x5'),_0xb0a6('0x6'),_0x24515c[_0xb0a6('0x7')]);if(_0x102ecd[_0xb0a6('0x8')]&&_0x102ecd['timers'][_0x47c553]&&_0x102ecd[_0xb0a6('0x8')][_0x47c553][_0xb0a6('0x9')]){_0x102ecd['timers'][_0x47c553][_0xb0a6('0xa')]();}if(_0x102ecd[_0xb0a6('0xb')][_0x47c553]){_0x102ecd[_0xb0a6('0xb')][_0x47c553][_0xb0a6('0xc')]({'statePause':_0x24515c[_0xb0a6('0xd')]?!![]:![]});}_0x2a8516({'code':0xc8,'message':_0xb0a6('0xe')});});},'Reload':function(_0x3d607f){var _0x425b97=this;return new Promise(function(_0x392f48,_0x151387){if(ami['isConnected']()==![]){return _0x151387(_0x425b97[_0xb0a6('0xf')](0x1f4,[config['asterisk']['ip'],config[_0xb0a6('0x10')]['username'],_0xb0a6('0x11')]['join']('\x20')));}_0x3d607f=_[_0xb0a6('0x12')](_0x3d607f,_[_0xb0a6('0x13')](properties[_0xb0a6('0x14')]));_0x3d607f['action']='Reload';return ami[_0xb0a6('0x15')](_0x3d607f)[_0xb0a6('0x16')](function(_0x59bc9c){_0x392f48({'code':0xc8,'message':_0x59bc9c[_0xb0a6('0x17')]});})[_0xb0a6('0x18')](function(_0x13a1c8){_0x151387(_0x425b97['error'](0x1f5,_0x13a1c8[_0xb0a6('0x17')]));});});},'Command':function(_0x883503){var _0x372457=this;return new Promise(function(_0xdc5de1,_0x4406d0){if(ami[_0xb0a6('0x19')]()==![]){return _0x4406d0(_0x372457['error'](0x1f4,[config[_0xb0a6('0x10')]['ip'],config[_0xb0a6('0x10')][_0xb0a6('0x1a')],_0xb0a6('0x11')][_0xb0a6('0x1b')]('\x20')));}_0x883503=_[_0xb0a6('0x12')](_0x883503,_0xb0a6('0x1c'));_0x883503[_0xb0a6('0x1d')]='Command';return ami[_0xb0a6('0x15')](_0x883503)['then'](function(_0x1322ec){_0xdc5de1({'code':0xc8,'message':_0x1322ec[_0xb0a6('0x1e')]});})['catch'](function(_0x4aa68d){_0x4406d0(_0x372457[_0xb0a6('0xf')](0x1f5,_0x4aa68d[_0xb0a6('0x17')]));});});},'VoiceQueues':function(_0x5eb0ed){return new Promise(function(_0x3ea787,_0x24574a){var _0x259f47=[];for(var _0x5b19c1 in _0x102ecd['voiceQueues']){if(_0x102ecd['voiceQueues'][_0xb0a6('0x1f')](_0x5b19c1)){var _0x1e9947=_0x102ecd[_0xb0a6('0x20')][_0x5b19c1];var _0x58d923={'id':_0x1e9947['id'],'name':_0x1e9947[_0xb0a6('0x7')],'strategy':_0x1e9947[_0xb0a6('0x21')],'answered':_0x1e9947[_0xb0a6('0x22')],'available':_0x1e9947[_0xb0a6('0x23')],'loggedIn':_0x1e9947[_0xb0a6('0x24')],'pTalking':_0x1e9947[_0xb0a6('0x25')],'sumBillable':_0x1e9947[_0xb0a6('0x26')],'sumDuration':_0x1e9947[_0xb0a6('0x27')],'sumHoldTime':_0x1e9947[_0xb0a6('0x28')]||0x0,'talking':_0x1e9947['talking'],'total':_0x1e9947[_0xb0a6('0x29')],'type':_0x1e9947[_0xb0a6('0x2a')],'unmanaged':_0x1e9947[_0xb0a6('0x2b')],'abandoned':_0x1e9947['abandoned'],'waiting':_0x1e9947[_0xb0a6('0x2c')],'loggedInDb':_0x1e9947['loggedInDb']};if(_0x1e9947[_0xb0a6('0x2a')]===_0xb0a6('0x2d')){_0x58d923[_0xb0a6('0x2e')]=_0x1e9947[_0xb0a6('0x2e')];_0x58d923[_0xb0a6('0x2f')]=_0x1e9947[_0xb0a6('0x2f')];_0x58d923[_0xb0a6('0x30')]=_0x1e9947[_0xb0a6('0x30')];_0x58d923[_0xb0a6('0x31')]=_0x1e9947[_0xb0a6('0x31')];_0x58d923['dialOriginateTimeout']=_0x1e9947['dialOriginateTimeout'];_0x58d923[_0xb0a6('0x32')]=_0x1e9947[_0xb0a6('0x32')];_0x58d923[_0xb0a6('0x33')]=_0x1e9947[_0xb0a6('0x33')];_0x58d923[_0xb0a6('0x34')]=_0x1e9947[_0xb0a6('0x34')];_0x58d923[_0xb0a6('0x35')]=_0x1e9947[_0xb0a6('0x35')];_0x58d923['outboundBlacklistCallsDay']=_0x1e9947[_0xb0a6('0x36')];_0x58d923[_0xb0a6('0x37')]=_0x1e9947['outboundBusyCallsDay'];_0x58d923[_0xb0a6('0x38')]=_0x1e9947[_0xb0a6('0x38')];_0x58d923['outboundDropCallsDayACS']=_0x1e9947['outboundDropCallsDayACS'];_0x58d923[_0xb0a6('0x39')]=_0x1e9947[_0xb0a6('0x39')];_0x58d923[_0xb0a6('0x3a')]=_0x1e9947[_0xb0a6('0x3a')];_0x58d923[_0xb0a6('0x3b')]=_0x1e9947[_0xb0a6('0x3b')];_0x58d923['outboundNoSuchCallsDay']=_0x1e9947[_0xb0a6('0x3c')];_0x58d923['outboundOriginateFailureCallsDay']=_0x1e9947[_0xb0a6('0x3d')];_0x58d923[_0xb0a6('0x3e')]=_0x1e9947['outboundReCallsDay'];_0x58d923['outboundRejectCallsDay']=_0x1e9947['outboundRejectCallsDay'];_0x58d923[_0xb0a6('0x3f')]=_0x1e9947[_0xb0a6('0x3f')];_0x58d923[_0xb0a6('0x40')]=_0x1e9947[_0xb0a6('0x40')];_0x58d923[_0xb0a6('0x41')]=_0x1e9947['predictiveIntervalAvgHoldtime'];_0x58d923[_0xb0a6('0x42')]=_0x1e9947[_0xb0a6('0x42')];_0x58d923[_0xb0a6('0x43')]=_0x1e9947[_0xb0a6('0x43')];_0x58d923['predictiveIntervalDroppedCallsTimeout']=_0x1e9947[_0xb0a6('0x44')];_0x58d923[_0xb0a6('0x45')]=_0x1e9947[_0xb0a6('0x45')];_0x58d923[_0xb0a6('0x46')]=_0x1e9947[_0xb0a6('0x46')];_0x58d923['predictiveIntervalHitRate']=_0x1e9947['predictiveIntervalHitRate'];_0x58d923[_0xb0a6('0x47')]=_0x1e9947[_0xb0a6('0x47')];_0x58d923[_0xb0a6('0x48')]=_0x1e9947[_0xb0a6('0x48')];_0x58d923[_0xb0a6('0x49')]=_0x1e9947[_0xb0a6('0x49')];_0x58d923[_0xb0a6('0x4a')]=_0x1e9947[_0xb0a6('0x4a')];_0x58d923['message']=_0x1e9947[_0xb0a6('0x17')];_0x58d923[_0xb0a6('0x4b')]=_0x1e9947[_0xb0a6('0x4b')];_0x58d923[_0xb0a6('0x4c')]=_0x1e9947[_0xb0a6('0x4c')];_0x58d923['erlangCallToSecond']=_0x1e9947[_0xb0a6('0x4d')];_0x58d923['erlangAbandonmentRate']=_0x1e9947[_0xb0a6('0x4e')];_0x58d923['erlangBusyFactor']=_0x1e9947[_0xb0a6('0x4f')];_0x58d923['startPredictive']=_0x1e9947[_0xb0a6('0x50')];_0x58d923[_0xb0a6('0x51')]=_0x1e9947[_0xb0a6('0x51')];}if(_0x1e9947[_0xb0a6('0x52')]){_0x58d923[_0xb0a6('0x52')]={'id':_0x1e9947[_0xb0a6('0x52')]['id'],'name':_0x1e9947[_0xb0a6('0x52')][_0xb0a6('0x7')],'active':_0x1e9947[_0xb0a6('0x52')][_0xb0a6('0x53')],'callerid':_0x1e9947[_0xb0a6('0x52')][_0xb0a6('0x54')]};}if(_0x1e9947['Interval']){_0x58d923[_0xb0a6('0x55')]={'id':_0x1e9947[_0xb0a6('0x55')]['id'],'name':_0x1e9947['Interval'][_0xb0a6('0x7')]};}_0x259f47['push'](_0x58d923);}}_0x3ea787({'count':_0x259f47[_0xb0a6('0x56')],'rows':_0x259f47});});},'UpdateVoiceQueue':function(_0x34df60){return new Promise(function(_0x2ef974,_0x4e29ad){var _0x74a665=_[_0xb0a6('0x57')](_0x102ecd[_0xb0a6('0x20')],{'id':parseInt(_0x34df60['id'])});var _0x29b7ec=_[_0xb0a6('0x58')](_0x34df60,['id']);if(_0x74a665){for(var _0x2cb5f6 in _0x29b7ec){if(typeof _0x29b7ec[_0x2cb5f6]!==_0xb0a6('0x59')&&typeof _0x74a665[_0x2cb5f6]!==_0xb0a6('0x59')){_0x74a665[_0x2cb5f6]=_0x29b7ec[_0x2cb5f6];}}_0x2ef974(_0x74a665);}else{_0x4e29ad();}});},'VoiceChannels':function(_0x5a87a2){return new Promise(function(_0x256be3,_0x38644a){var _0x47645a=_[_0xb0a6('0x5a')](_0x102ecd['channels']);_0x256be3({'count':_0x47645a['length'],'rows':_0x47645a});});},'VoiceChannelMixMonitor':function(_0x51bd2e){var _0x5b8dd3=this;return new Promise(function(_0x4fb43a,_0x5dd778){if(ami['isConnected']()==![]){return _0x5dd778(_0x5b8dd3[_0xb0a6('0xf')](0x1f4,[config[_0xb0a6('0x10')]['ip'],config[_0xb0a6('0x10')][_0xb0a6('0x1a')],_0xb0a6('0x11')][_0xb0a6('0x1b')]('\x20')));}var _0x13e34c=schema(properties[_0xb0a6('0x5b')])[_0xb0a6('0x5c')](_0x51bd2e);if(_0x13e34c[_0xb0a6('0x56')]>0x0){return _0x5dd778(_0x5b8dd3[_0xb0a6('0xf')](0x1f4,_[_0xb0a6('0x5d')](_0x13e34c,_0xb0a6('0x17'))[_0xb0a6('0x1b')](',\x20')));}var _0x3871ed=_[_0xb0a6('0x57')](_0x102ecd['channels'],{'uniqueid':_0x51bd2e[_0xb0a6('0x5e')]});if(_0x3871ed&&_0x3871ed[_0xb0a6('0x5f')]){var _0x1a628a=util[_0xb0a6('0x60')](_0xb0a6('0x61'),_0x51bd2e[_0xb0a6('0x62')]||_0x51bd2e[_0xb0a6('0x5e')],_0x51bd2e[_0xb0a6('0x60')]||_0xb0a6('0x63'));return ami['Action']({'action':'MixMonitor','channel':_0x3871ed[_0xb0a6('0x5f')],'file':_0x1a628a,'options':_0xb0a6('0x64')})[_0xb0a6('0x16')](function(_0x549c69){var _0x3504e8=_['find'](_0x3871ed[_0xb0a6('0x65')],{'filename':_0xb0a6('0x66')+_0x1a628a['toLowerCase']()});if(_[_0xb0a6('0x67')](_0x3504e8)){_0x3871ed[_0xb0a6('0x65')]['push']({'filename':_0xb0a6('0x66')+_0x1a628a['toLowerCase'](),'createdAt':moment()[_0xb0a6('0x60')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x549c69[_0xb0a6('0x68')],'status':_0xb0a6('0x69')});}else{_0x3504e8['mixmonitorid']=_0x549c69[_0xb0a6('0x68')];_0x3504e8[_0xb0a6('0x6a')]=_0xb0a6('0x69');}_0x4fb43a({'code':0xc8,'message':[_0x51bd2e[_0xb0a6('0x5e')],_0xb0a6('0x6b'),_0x549c69['mixmonitorid']][_0xb0a6('0x1b')]('\x20'),'mixmonitorid':_0x549c69['mixmonitorid']});})[_0xb0a6('0x18')](function(_0x569ce3){_0x5dd778(_0x5b8dd3['error'](0x1f5,[_0x51bd2e[_0xb0a6('0x5e')],_0x569ce3[_0xb0a6('0x17')]['toLowerCase']()][_0xb0a6('0x1b')]('\x20')));});}else{return _0x5dd778(_0x5b8dd3['error'](0x1f5,_0xb0a6('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x3a8d71){var _0xd9eec6=this;return new Promise(function(_0x229666,_0x59fb5a){if(ami[_0xb0a6('0x19')]()==![]){return _0x59fb5a(_0xd9eec6[_0xb0a6('0xf')](0x1f4,[config[_0xb0a6('0x10')]['ip'],config[_0xb0a6('0x10')][_0xb0a6('0x1a')],_0xb0a6('0x11')]['join']('\x20')));}var _0x4e6072=schema(properties[_0xb0a6('0x5b')])['validate'](_0x3a8d71);if(_0x4e6072[_0xb0a6('0x56')]>0x0){return _0x59fb5a(_0xd9eec6[_0xb0a6('0xf')](0x1f4,_[_0xb0a6('0x5d')](_0x4e6072,'message')[_0xb0a6('0x1b')](',\x20')));}var _0x2eae42=_['find'](_0x102ecd[_0xb0a6('0x6d')],{'uniqueid':_0x3a8d71[_0xb0a6('0x5e')]});if(_0x2eae42){return BPromise[_0xb0a6('0x6e')]()[_0xb0a6('0x16')](function(){if(_0x2eae42[_0xb0a6('0x5f')]){return ami['Action']({'action':_0xb0a6('0x6f'),'channel':_0x2eae42[_0xb0a6('0x5f')],'mixmonitorid':_0x3a8d71['mixmonitorid']})[_0xb0a6('0x18')](function(_0x3f197a){});}})[_0xb0a6('0x16')](function(){if(_0x2eae42[_0xb0a6('0x70')]){return ami[_0xb0a6('0x15')]({'action':_0xb0a6('0x6f'),'channel':_0x2eae42[_0xb0a6('0x70')],'mixmonitorid':_0x3a8d71[_0xb0a6('0x68')]})[_0xb0a6('0x18')](function(_0x112ba1){});}})[_0xb0a6('0x16')](function(_0x1046e){var _0x53c9e9=_[_0xb0a6('0x57')](_0x2eae42['monitors'],{'mixmonitorid':_0x3a8d71[_0xb0a6('0x68')]});if(_0x53c9e9){_0x53c9e9[_0xb0a6('0x6a')]=_0xb0a6('0x71');}})[_0xb0a6('0x16')](function(){var _0x49ea98=util[_0xb0a6('0x60')](_0xb0a6('0x61'),_0x3a8d71[_0xb0a6('0x62')]||_0x3a8d71[_0xb0a6('0x5e')],_0x3a8d71[_0xb0a6('0x60')]||_0xb0a6('0x63'));var _0x35dd17=_[_0xb0a6('0x57')](_0x2eae42[_0xb0a6('0x65')],{'filename':_0xb0a6('0x66')+_0x49ea98[_0xb0a6('0x72')]()});if(_0x35dd17){_0x35dd17[_0xb0a6('0x6a')]=_0xb0a6('0x71');}})[_0xb0a6('0x16')](function(){_0x229666({'code':0xc8,'message':[_0x3a8d71[_0xb0a6('0x5e')],_0xb0a6('0x73')][_0xb0a6('0x1b')]('\x20')});})[_0xb0a6('0x18')](function(_0x4bafe5){_0x59fb5a(_0xd9eec6[_0xb0a6('0xf')](0x1f5,[_0x3a8d71[_0xb0a6('0x5e')],_0x4bafe5[_0xb0a6('0x17')][_0xb0a6('0x72')]()][_0xb0a6('0x1b')]('\x20')));});}else{return _0x59fb5a(_0xd9eec6[_0xb0a6('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x49a7fa){return new Promise(function(_0x1b343f,_0x229442){var _0xf7f5f1=_[_0xb0a6('0x5a')](_0x102ecd['queueChannels']);_0x1b343f({'count':_0xf7f5f1[_0xb0a6('0x56')],'rows':_0xf7f5f1});});},'VoiceQueuesChannel':function(_0x17ed27){var _0x38fd56=this;return new Promise(function(_0x1069fe,_0x3143de){var _0x265a02=schema(properties[_0xb0a6('0x74')])['validate'](_0x17ed27);if(_0x265a02[_0xb0a6('0x56')]>0x0){return _0x3143de(_0x38fd56[_0xb0a6('0xf')](0x1f4,_['map'](_0x265a02,'message')[_0xb0a6('0x1b')](',\x20')));}var _0x4aa3a3=_[_0xb0a6('0x57')](_0x102ecd[_0xb0a6('0x75')],{'uniqueid':_0x17ed27[_0xb0a6('0x5e')]});if(_0x4aa3a3){_0x1069fe(_0x4aa3a3);}else{return _0x3143de(_0x38fd56[_0xb0a6('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x173e2b){var _0x5c77b6=this;return new Promise(function(_0x3b3272,_0x35ef32){if(ami['isConnected']()==![]){return _0x35ef32(_0x5c77b6['error'](0x1f4,[config[_0xb0a6('0x10')]['ip'],config[_0xb0a6('0x10')][_0xb0a6('0x1a')],'ami\x20disconnected']['join']('\x20')));}var _0x567fd9=schema(properties[_0xb0a6('0x76')])['validate'](_0x173e2b);if(_0x567fd9[_0xb0a6('0x56')]>0x0){return _0x35ef32(_0x5c77b6[_0xb0a6('0xf')](0x1f4,_[_0xb0a6('0x5d')](_0x567fd9,'message')[_0xb0a6('0x1b')](',\x20')));}var _0x165787=_[_0xb0a6('0x57')](_0x102ecd[_0xb0a6('0x75')],{'uniqueid':_0x173e2b[_0xb0a6('0x5e')]});if(_0x165787&&_0x165787[_0xb0a6('0x5f')]){return ami[_0xb0a6('0x15')]({'action':'Hangup','channel':_0x165787['channel']})[_0xb0a6('0x16')](function(_0x310aca){_0x3b3272({'code':0xc8,'message':[_0x173e2b[_0xb0a6('0x5e')],_0x310aca[_0xb0a6('0x17')]['toLowerCase']()]['join']('\x20')});})[_0xb0a6('0x18')](function(_0x336d67){_0x35ef32(_0x5c77b6[_0xb0a6('0xf')](0x1f5,[_0x173e2b[_0xb0a6('0x5e')],_0x336d67[_0xb0a6('0x17')]['toLowerCase']()][_0xb0a6('0x1b')]('\x20')));});}else{return _0x35ef32(_0x5c77b6[_0xb0a6('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x177101){var _0x1e8395=this;return new Promise(function(_0x1dc58c,_0x42634d){if(ami[_0xb0a6('0x19')]()==![]){return _0x42634d(_0x1e8395[_0xb0a6('0xf')](0x1f4,[config['asterisk']['ip'],config[_0xb0a6('0x10')][_0xb0a6('0x1a')],_0xb0a6('0x11')][_0xb0a6('0x1b')]('\x20')));}var _0x34b2f3=schema(properties['voicequeuechannelredirect'])['validate'](_0x177101);if(_0x34b2f3[_0xb0a6('0x56')]>0x0){return _0x42634d(_0x1e8395['error'](0x1f4,_[_0xb0a6('0x5d')](_0x34b2f3,'message')[_0xb0a6('0x1b')](',\x20')));}var _0x5717b4=_[_0xb0a6('0x57')](_0x102ecd[_0xb0a6('0x75')],{'uniqueid':_0x177101[_0xb0a6('0x5e')]});if(_0x5717b4&&_0x5717b4[_0xb0a6('0x5f')]){return ami[_0xb0a6('0x15')]({'action':_0xb0a6('0x77'),'channel':_0x5717b4[_0xb0a6('0x5f')],'exten':_0x177101[_0xb0a6('0x78')],'context':_0x177101[_0xb0a6('0x79')]||_0x5717b4[_0xb0a6('0x79')],'priority':0x1})['then'](function(_0x48ae58){_0x1dc58c({'code':0xc8,'message':[_0x177101['uniqueid'],_0x48ae58[_0xb0a6('0x17')][_0xb0a6('0x72')]()][_0xb0a6('0x1b')]('\x20')});})[_0xb0a6('0x18')](function(_0x51b473){_0x42634d(_0x1e8395[_0xb0a6('0xf')](0x1f5,[_0x177101[_0xb0a6('0x5e')],_0x51b473[_0xb0a6('0x17')][_0xb0a6('0x72')]()][_0xb0a6('0x1b')]('\x20')));});}else{return _0x42634d(_0x1e8395['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3d0933){return new Promise(function(_0x33fd7e,_0x16987b){var _0x1f0679=_[_0xb0a6('0x5a')](_0x102ecd[_0xb0a6('0xb')]);_0x33fd7e({'count':_0x1f0679['length'],'rows':_0x1f0679});});},'Telephones':function(_0x5817ac){return new Promise(function(_0x482c07,_0x292189){var _0x40cd4d=_[_0xb0a6('0x5a')](_0x102ecd[_0xb0a6('0x7a')]);_0x482c07({'count':_0x40cd4d[_0xb0a6('0x56')],'rows':_0x40cd4d});});},'Trunks':function(_0x167303){return new Promise(function(_0xb2e56,_0x554df7){var _0x1bd0ec=_[_0xb0a6('0x5a')](_0x102ecd[_0xb0a6('0x7b')]);_0xb2e56({'count':_0x1bd0ec[_0xb0a6('0x56')],'rows':_0x1bd0ec});});},'OutboundChannels':function(_0x420373){return new Promise(function(_0x449b28,_0x5c20de){var _0x25ccb3=_[_0xb0a6('0x5a')](_0x102ecd[_0xb0a6('0x7c')]);_0x449b28({'count':_0x25ccb3[_0xb0a6('0x56')],'rows':_0x25ccb3});});},'Outbound':function(_0x46e4cd){return new Promise(function(_0x1dbf28,_0x1afa65){_0x1dbf28(_0x102ecd['outbound']);});},'Campaigns':function(_0x45d2e){return new Promise(function(_0x51eec3,_0xe43851){var _0x5e5c45=_[_0xb0a6('0x5a')](_0x102ecd[_0xb0a6('0x7d')]);_0x51eec3({'count':_0x5e5c45[_0xb0a6('0x56')],'rows':_0x5e5c45});});},'VoiceQueuesPreview':function(_0x463773){var _0x40dbac=this;return new Promise(function(_0x99fbff,_0x20c9d9){_0x4cc3ae[_0xb0a6('0x7e')](_0x463773['id'])['then'](function(_0x24620e){_0x99fbff({'code':0xc8,'message':_0x24620e[_0xb0a6('0x17')]});})['catch'](function(_0x18bca8){_0x20c9d9(_0x40dbac[_0xb0a6('0xf')](0x1f4,_0x18bca8['message']));});});},'EventManager':function(_0x490f61){var _0x13cdd9=this;return new Promise(function(_0x5cc789,_0x3b4130){if(!_0x490f61[_0xb0a6('0x7f')]){return _0x3b4130(_0x13cdd9[_0xb0a6('0xf')](0x1f4,_0xb0a6('0x80')));}ami[_0xb0a6('0x81')](_0xb0a6('0x82')+_0x490f61['event'],_0x490f61[_0xb0a6('0x17')]);_0x5cc789({'code':0xc8,'message':_0x490f61});});},'FaxAccounts':function(_0x412888){return new Promise(function(_0x5f29a2,_0x4fbdba){var _0xc729cd=_[_0xb0a6('0x5a')](_0x102ecd[_0xb0a6('0x83')]);_0x5f29a2({'count':_0xc729cd[_0xb0a6('0x56')],'rows':_0xc729cd});});},'SendFax':function(_0x281665){var _0x3322d9=this;return new Promise(function(_0x47d4f7,_0x1ae3d8){_0xbbdf89['send'](_0x281665)[_0xb0a6('0x16')](function(_0x22b44f){_0x47d4f7({'code':0xc8,'message':_0x22b44f[_0xb0a6('0x17')]});})['catch'](function(_0x579f57){_0x1ae3d8(_0x3322d9['error'](0x1f4,_0x579f57[_0xb0a6('0x17')]));});});},'CheckAfterSend':function(_0xf07039){var _0x34a64c=this;return new Promise(function(_0x361c0c,_0x2c639e){_0xbbdf89[_0xb0a6('0x84')](_0xf07039)[_0xb0a6('0x16')](function(_0x102f30){_0x361c0c({'code':0xc8,'message':_0x102f30[_0xb0a6('0x17')]});})[_0xb0a6('0x18')](function(_0x7e0357){_0x2c639e(_0x34a64c[_0xb0a6('0xf')](0x1f4,_0x7e0357[_0xb0a6('0x17')]));});});}};var _0x2c5d71=jayson['server'](_0x11cd5b)[_0xb0a6('0x85')]();_0x2c5d71['on']('error',function(_0x29bebb){return _0x5e2d2d(_0x29bebb);});_0x2c5d71[_0xb0a6('0x86')](0x232a,'127.0.0.1',function(){console[_0xb0a6('0x87')](_0xb0a6('0x88'),0x232a);return _0x415e9e(_0xb0a6('0x89')+0x232a);});});}; \ No newline at end of file +var _0x9fd4=['sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','channel','filename','uniqueid','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','Channel\x20doesn\x27t\x20exist','destinationchannel','StopMixMonitor','stop','%s.%s','wav','status','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelredirect','exten','context','trunks','outboundChannels','run','custom:','event','faxAccounts','send','server','listen','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','format','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','answered','loggedIn','pTalking'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x9fd4,0x16c));var _0x49fd=function(_0x104377,_0x54b94c){_0x104377=_0x104377-0x0;var _0x1fac22=_0x9fd4[_0x104377];return _0x1fac22;};'use strict';var _=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var jayson=require(_0x49fd('0x2'));var schema=require(_0x49fd('0x3'));var BPromise=require(_0x49fd('0x4'));var moment=require(_0x49fd('0x5'));var config=require(_0x49fd('0x6'));var properties=require(_0x49fd('0x7'));var ami=require(_0x49fd('0x8'));exports['listen']=function(_0x481f6a,_0x3b4b46,_0x42fdc7){return new BPromise(function(_0x1bc16e,_0x9353cd){var _0x48b999={'QueuePause':function(_0x14bb94){return new Promise(function(_0x461ac1,_0x36f605){var _0x3bf3fd=util[_0x49fd('0x9')]('%s/%s',_0x49fd('0xa'),_0x14bb94[_0x49fd('0xb')]);if(_0x481f6a[_0x49fd('0xc')]&&_0x481f6a[_0x49fd('0xc')][_0x3bf3fd]&&_0x481f6a[_0x49fd('0xc')][_0x3bf3fd][_0x49fd('0xd')]){_0x481f6a[_0x49fd('0xc')][_0x3bf3fd]['updateAcw']();}if(_0x481f6a[_0x49fd('0xe')][_0x3bf3fd]){_0x481f6a[_0x49fd('0xe')][_0x3bf3fd][_0x49fd('0xf')]({'statePause':_0x14bb94[_0x49fd('0x10')]?!![]:![]});}_0x461ac1({'code':0xc8,'message':_0x49fd('0x11')});});},'Reload':function(_0x206bd8){var _0x26f2c1=this;return new Promise(function(_0x3fa518,_0x1d900b){if(ami[_0x49fd('0x12')]()==![]){return _0x1d900b(_0x26f2c1[_0x49fd('0x13')](0x1f4,[config[_0x49fd('0x14')]['ip'],config[_0x49fd('0x14')][_0x49fd('0x15')],_0x49fd('0x16')][_0x49fd('0x17')]('\x20')));}_0x206bd8=_[_0x49fd('0x18')](_0x206bd8,_[_0x49fd('0x19')](properties[_0x49fd('0x1a')]));_0x206bd8[_0x49fd('0x1b')]=_0x49fd('0x1c');return ami[_0x49fd('0x1d')](_0x206bd8)[_0x49fd('0x1e')](function(_0x475eee){_0x3fa518({'code':0xc8,'message':_0x475eee[_0x49fd('0x1f')]});})[_0x49fd('0x20')](function(_0x598793){_0x1d900b(_0x26f2c1[_0x49fd('0x13')](0x1f5,_0x598793[_0x49fd('0x1f')]));});});},'Command':function(_0x59a407){var _0x5c323a=this;return new Promise(function(_0x449c9a,_0x53cbd1){if(ami[_0x49fd('0x12')]()==![]){return _0x53cbd1(_0x5c323a[_0x49fd('0x13')](0x1f4,[config['asterisk']['ip'],config[_0x49fd('0x14')][_0x49fd('0x15')],'ami\x20disconnected'][_0x49fd('0x17')]('\x20')));}_0x59a407=_[_0x49fd('0x18')](_0x59a407,_0x49fd('0x21'));_0x59a407[_0x49fd('0x1b')]=_0x49fd('0x22');return ami[_0x49fd('0x1d')](_0x59a407)['then'](function(_0x46019d){_0x449c9a({'code':0xc8,'message':_0x46019d[_0x49fd('0x23')]});})[_0x49fd('0x20')](function(_0x4bf811){_0x53cbd1(_0x5c323a[_0x49fd('0x13')](0x1f5,_0x4bf811[_0x49fd('0x1f')]));});});},'VoiceQueues':function(_0x146d55){return new Promise(function(_0x4bff4c,_0x597161){var _0x497469=[];for(var _0x13c5a8 in _0x481f6a[_0x49fd('0x24')]){if(_0x481f6a[_0x49fd('0x24')][_0x49fd('0x25')](_0x13c5a8)){var _0x9587b9=_0x481f6a[_0x49fd('0x24')][_0x13c5a8];var _0x20873e={'id':_0x9587b9['id'],'name':_0x9587b9[_0x49fd('0xb')],'strategy':_0x9587b9['strategy'],'answered':_0x9587b9[_0x49fd('0x26')],'available':_0x9587b9['available'],'loggedIn':_0x9587b9[_0x49fd('0x27')],'pTalking':_0x9587b9[_0x49fd('0x28')],'sumBillable':_0x9587b9['sumBillable'],'sumDuration':_0x9587b9[_0x49fd('0x29')],'sumHoldTime':_0x9587b9[_0x49fd('0x2a')]||0x0,'talking':_0x9587b9[_0x49fd('0x2b')],'total':_0x9587b9[_0x49fd('0x2c')],'type':_0x9587b9[_0x49fd('0x2d')],'unmanaged':_0x9587b9[_0x49fd('0x2e')],'abandoned':_0x9587b9[_0x49fd('0x2f')],'waiting':_0x9587b9[_0x49fd('0x30')],'loggedInDb':_0x9587b9['loggedInDb']};if(_0x9587b9[_0x49fd('0x2d')]==='outbound'){_0x20873e[_0x49fd('0x31')]=_0x9587b9['dialActive'];_0x20873e[_0x49fd('0x32')]=_0x9587b9[_0x49fd('0x32')];_0x20873e[_0x49fd('0x33')]=_0x9587b9['dialOriginateCallerIdName'];_0x20873e['dialOriginateCallerIdNumber']=_0x9587b9['dialOriginateCallerIdNumber'];_0x20873e[_0x49fd('0x34')]=_0x9587b9[_0x49fd('0x34')];_0x20873e['dialPrefix']=_0x9587b9[_0x49fd('0x35')];_0x20873e['temp']=_0x9587b9['temp'];_0x20873e[_0x49fd('0x36')]=_0x9587b9[_0x49fd('0x36')];_0x20873e[_0x49fd('0x37')]=_0x9587b9[_0x49fd('0x37')];_0x20873e[_0x49fd('0x38')]=_0x9587b9['outboundBlacklistCallsDay'];_0x20873e['outboundBusyCallsDay']=_0x9587b9[_0x49fd('0x39')];_0x20873e[_0x49fd('0x3a')]=_0x9587b9[_0x49fd('0x3a')];_0x20873e[_0x49fd('0x3b')]=_0x9587b9['outboundDropCallsDayACS'];_0x20873e[_0x49fd('0x3c')]=_0x9587b9[_0x49fd('0x3c')];_0x20873e[_0x49fd('0x3d')]=_0x9587b9[_0x49fd('0x3d')];_0x20873e[_0x49fd('0x3e')]=_0x9587b9[_0x49fd('0x3e')];_0x20873e[_0x49fd('0x3f')]=_0x9587b9[_0x49fd('0x3f')];_0x20873e[_0x49fd('0x40')]=_0x9587b9[_0x49fd('0x40')];_0x20873e[_0x49fd('0x41')]=_0x9587b9['outboundReCallsDay'];_0x20873e[_0x49fd('0x42')]=_0x9587b9[_0x49fd('0x42')];_0x20873e[_0x49fd('0x43')]=_0x9587b9[_0x49fd('0x43')];_0x20873e[_0x49fd('0x44')]=_0x9587b9[_0x49fd('0x44')];_0x20873e[_0x49fd('0x45')]=_0x9587b9[_0x49fd('0x45')];_0x20873e[_0x49fd('0x46')]=_0x9587b9['predictiveIntervalAvgTalktime'];_0x20873e[_0x49fd('0x47')]=_0x9587b9['predictiveIntervalDroppedCallsCallersExit'];_0x20873e[_0x49fd('0x48')]=_0x9587b9[_0x49fd('0x48')];_0x20873e['predictiveIntervalErlangCalls']=_0x9587b9[_0x49fd('0x49')];_0x20873e[_0x49fd('0x4a')]=_0x9587b9['predictiveIntervalErlangCallsDroppedCalls'];_0x20873e[_0x49fd('0x4b')]=_0x9587b9['predictiveIntervalHitRate'];_0x20873e['predictiveIntervalMultiplicativeFactor']=_0x9587b9['predictiveIntervalMultiplicativeFactor'];_0x20873e[_0x49fd('0x4c')]=_0x9587b9[_0x49fd('0x4c')];_0x20873e[_0x49fd('0x4d')]=_0x9587b9[_0x49fd('0x4d')];_0x20873e['predictiveIntervalTotalCalls']=_0x9587b9[_0x49fd('0x4e')];_0x20873e[_0x49fd('0x1f')]=_0x9587b9[_0x49fd('0x1f')];_0x20873e[_0x49fd('0x4f')]=_0x9587b9[_0x49fd('0x4f')];_0x20873e[_0x49fd('0x50')]=_0x9587b9[_0x49fd('0x50')];_0x20873e[_0x49fd('0x51')]=_0x9587b9['erlangCallToSecond'];_0x20873e[_0x49fd('0x52')]=_0x9587b9[_0x49fd('0x52')];_0x20873e['erlangBusyFactor']=_0x9587b9[_0x49fd('0x53')];_0x20873e[_0x49fd('0x54')]=_0x9587b9['startPredictive'];_0x20873e[_0x49fd('0x55')]=_0x9587b9['startProgressive'];}if(_0x9587b9[_0x49fd('0x56')]){_0x20873e[_0x49fd('0x56')]={'id':_0x9587b9[_0x49fd('0x56')]['id'],'name':_0x9587b9[_0x49fd('0x56')]['name'],'active':_0x9587b9['Trunk'][_0x49fd('0x57')],'callerid':_0x9587b9['Trunk'][_0x49fd('0x58')]};}if(_0x9587b9[_0x49fd('0x59')]){_0x20873e[_0x49fd('0x59')]={'id':_0x9587b9[_0x49fd('0x59')]['id'],'name':_0x9587b9['Interval'][_0x49fd('0xb')]};}_0x497469[_0x49fd('0x5a')](_0x20873e);}}_0x4bff4c({'count':_0x497469[_0x49fd('0x5b')],'rows':_0x497469});});},'UpdateVoiceQueue':function(_0x8d4b0b){return new Promise(function(_0x24705e,_0x30937f){var _0x231c08=_[_0x49fd('0x5c')](_0x481f6a[_0x49fd('0x24')],{'id':parseInt(_0x8d4b0b['id'])});var _0xa4a3b7=_[_0x49fd('0x5d')](_0x8d4b0b,['id']);if(_0x231c08){for(var _0x312344 in _0xa4a3b7){if(typeof _0xa4a3b7[_0x312344]!==_0x49fd('0x5e')&&typeof _0x231c08[_0x312344]!==_0x49fd('0x5e')){_0x231c08[_0x312344]=_0xa4a3b7[_0x312344];}}_0x24705e(_0x231c08);}else{_0x30937f();}});},'VoiceChannels':function(_0x58c7eb){return new Promise(function(_0x4fc625,_0x6960ad){var _0xa3518f=_[_0x49fd('0x5f')](_0x481f6a[_0x49fd('0x60')]);_0x4fc625({'count':_0xa3518f['length'],'rows':_0xa3518f});});},'VoiceChannelMixMonitor':function(_0x23e5f2){var _0x3ae66a=this;return new Promise(function(_0x4b28fa,_0x341728){if(ami[_0x49fd('0x12')]()==![]){return _0x341728(_0x3ae66a[_0x49fd('0x13')](0x1f4,[config[_0x49fd('0x14')]['ip'],config[_0x49fd('0x14')][_0x49fd('0x15')],_0x49fd('0x16')][_0x49fd('0x17')]('\x20')));}var _0x215b76=schema(properties[_0x49fd('0x61')])[_0x49fd('0x3')](_0x23e5f2);if(_0x215b76['length']>0x0){return _0x341728(_0x3ae66a[_0x49fd('0x13')](0x1f4,_[_0x49fd('0x62')](_0x215b76,_0x49fd('0x1f'))[_0x49fd('0x17')](',\x20')));}var _0x23457c=_[_0x49fd('0x5c')](_0x481f6a['channels'],{'uniqueid':_0x23e5f2['uniqueid']});if(_0x23457c&&_0x23457c[_0x49fd('0x63')]){var _0x765bca=util[_0x49fd('0x9')]('%s.%s',_0x23e5f2[_0x49fd('0x64')]||_0x23e5f2[_0x49fd('0x65')],_0x23e5f2['format']||'wav');return ami['Action']({'action':_0x49fd('0x66'),'channel':_0x23457c['channel'],'file':_0x765bca,'options':'ai(mixmonitorid)'})['then'](function(_0x37860b){var _0x46d467=_[_0x49fd('0x5c')](_0x23457c[_0x49fd('0x67')],{'filename':_0x49fd('0x68')+_0x765bca[_0x49fd('0x69')]()});if(_[_0x49fd('0x6a')](_0x46d467)){_0x23457c[_0x49fd('0x67')][_0x49fd('0x5a')]({'filename':_0x49fd('0x68')+_0x765bca['toLowerCase'](),'createdAt':moment()[_0x49fd('0x9')](_0x49fd('0x6b')),'mixmonitorid':_0x37860b[_0x49fd('0x6c')],'status':_0x49fd('0x6d')});}else{_0x46d467[_0x49fd('0x6c')]=_0x37860b[_0x49fd('0x6c')];_0x46d467['status']=_0x49fd('0x6d');}_0x4b28fa({'code':0xc8,'message':[_0x23e5f2[_0x49fd('0x65')],'MixMonitor\x20Success',_0x37860b['mixmonitorid']][_0x49fd('0x17')]('\x20'),'mixmonitorid':_0x37860b['mixmonitorid']});})[_0x49fd('0x20')](function(_0x575bc5){_0x341728(_0x3ae66a[_0x49fd('0x13')](0x1f5,[_0x23e5f2['uniqueid'],_0x575bc5[_0x49fd('0x1f')][_0x49fd('0x69')]()]['join']('\x20')));});}else{return _0x341728(_0x3ae66a[_0x49fd('0x13')](0x1f5,_0x49fd('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0x275a68){var _0x40f3bc=this;return new Promise(function(_0x1b7992,_0x41da82){if(ami[_0x49fd('0x12')]()==![]){return _0x41da82(_0x40f3bc[_0x49fd('0x13')](0x1f4,[config['asterisk']['ip'],config[_0x49fd('0x14')][_0x49fd('0x15')],_0x49fd('0x16')]['join']('\x20')));}var _0x34613d=schema(properties[_0x49fd('0x61')])[_0x49fd('0x3')](_0x275a68);if(_0x34613d[_0x49fd('0x5b')]>0x0){return _0x41da82(_0x40f3bc[_0x49fd('0x13')](0x1f4,_[_0x49fd('0x62')](_0x34613d,_0x49fd('0x1f'))[_0x49fd('0x17')](',\x20')));}var _0x61d98c=_['find'](_0x481f6a[_0x49fd('0x60')],{'uniqueid':_0x275a68[_0x49fd('0x65')]});if(_0x61d98c){return BPromise['resolve']()[_0x49fd('0x1e')](function(){if(_0x61d98c[_0x49fd('0x63')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x61d98c['channel'],'mixmonitorid':_0x275a68[_0x49fd('0x6c')]})[_0x49fd('0x20')](function(_0x410bbe){});}})[_0x49fd('0x1e')](function(){if(_0x61d98c[_0x49fd('0x6f')]){return ami['Action']({'action':_0x49fd('0x70'),'channel':_0x61d98c['destinationchannel'],'mixmonitorid':_0x275a68[_0x49fd('0x6c')]})['catch'](function(_0x1e5279){});}})[_0x49fd('0x1e')](function(_0x234e2a){var _0x1cd930=_['find'](_0x61d98c[_0x49fd('0x67')],{'mixmonitorid':_0x275a68[_0x49fd('0x6c')]});if(_0x1cd930){_0x1cd930['status']=_0x49fd('0x71');}})[_0x49fd('0x1e')](function(){var _0xc3cddd=util['format'](_0x49fd('0x72'),_0x275a68[_0x49fd('0x64')]||_0x275a68[_0x49fd('0x65')],_0x275a68[_0x49fd('0x9')]||_0x49fd('0x73'));var _0x330c6d=_['find'](_0x61d98c['monitors'],{'filename':_0x49fd('0x68')+_0xc3cddd[_0x49fd('0x69')]()});if(_0x330c6d){_0x330c6d[_0x49fd('0x74')]=_0x49fd('0x71');}})[_0x49fd('0x1e')](function(){_0x1b7992({'code':0xc8,'message':[_0x275a68[_0x49fd('0x65')],_0x49fd('0x75')][_0x49fd('0x17')]('\x20')});})[_0x49fd('0x20')](function(_0x3cb9e9){_0x41da82(_0x40f3bc[_0x49fd('0x13')](0x1f5,[_0x275a68[_0x49fd('0x65')],_0x3cb9e9[_0x49fd('0x1f')]['toLowerCase']()][_0x49fd('0x17')]('\x20')));});}else{return _0x41da82(_0x40f3bc[_0x49fd('0x13')](0x1f5,_0x49fd('0x6e')));}});},'VoiceQueuesChannels':function(_0x561e58){return new Promise(function(_0x545603,_0x3a9985){var _0x1be81d=_[_0x49fd('0x5f')](_0x481f6a['queueChannels']);_0x545603({'count':_0x1be81d[_0x49fd('0x5b')],'rows':_0x1be81d});});},'VoiceQueuesChannel':function(_0x161767){var _0x162b84=this;return new Promise(function(_0x3ce72c,_0x1a3555){var _0x24ad9f=schema(properties[_0x49fd('0x76')])['validate'](_0x161767);if(_0x24ad9f['length']>0x0){return _0x1a3555(_0x162b84[_0x49fd('0x13')](0x1f4,_['map'](_0x24ad9f,_0x49fd('0x1f'))['join'](',\x20')));}var _0x593346=_['find'](_0x481f6a[_0x49fd('0x77')],{'uniqueid':_0x161767[_0x49fd('0x65')]});if(_0x593346){_0x3ce72c(_0x593346);}else{return _0x1a3555(_0x162b84['error'](0x1f5,_0x49fd('0x6e')));}});},'VoiceQueuesChannelHangup':function(_0x3bca7b){var _0x4c3a12=this;return new Promise(function(_0x67f0f5,_0x2ba14a){if(ami['isConnected']()==![]){return _0x2ba14a(_0x4c3a12[_0x49fd('0x13')](0x1f4,[config['asterisk']['ip'],config[_0x49fd('0x14')][_0x49fd('0x15')],'ami\x20disconnected'][_0x49fd('0x17')]('\x20')));}var _0x27132c=schema(properties['voicequeuechannelhangup'])[_0x49fd('0x3')](_0x3bca7b);if(_0x27132c[_0x49fd('0x5b')]>0x0){return _0x2ba14a(_0x4c3a12[_0x49fd('0x13')](0x1f4,_[_0x49fd('0x62')](_0x27132c,_0x49fd('0x1f'))[_0x49fd('0x17')](',\x20')));}var _0x1ffd5f=_[_0x49fd('0x5c')](_0x481f6a['queueChannels'],{'uniqueid':_0x3bca7b['uniqueid']});if(_0x1ffd5f&&_0x1ffd5f[_0x49fd('0x63')]){return ami[_0x49fd('0x1d')]({'action':'Hangup','channel':_0x1ffd5f[_0x49fd('0x63')]})[_0x49fd('0x1e')](function(_0x5a2794){_0x67f0f5({'code':0xc8,'message':[_0x3bca7b[_0x49fd('0x65')],_0x5a2794[_0x49fd('0x1f')][_0x49fd('0x69')]()][_0x49fd('0x17')]('\x20')});})['catch'](function(_0x33c908){_0x2ba14a(_0x4c3a12[_0x49fd('0x13')](0x1f5,[_0x3bca7b[_0x49fd('0x65')],_0x33c908[_0x49fd('0x1f')][_0x49fd('0x69')]()][_0x49fd('0x17')]('\x20')));});}else{return _0x2ba14a(_0x4c3a12[_0x49fd('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x1d04d5){var _0x31dec5=this;return new Promise(function(_0x3c86dc,_0x373ce0){if(ami[_0x49fd('0x12')]()==![]){return _0x373ce0(_0x31dec5[_0x49fd('0x13')](0x1f4,[config[_0x49fd('0x14')]['ip'],config[_0x49fd('0x14')][_0x49fd('0x15')],_0x49fd('0x16')][_0x49fd('0x17')]('\x20')));}var _0x40c089=schema(properties[_0x49fd('0x78')])[_0x49fd('0x3')](_0x1d04d5);if(_0x40c089[_0x49fd('0x5b')]>0x0){return _0x373ce0(_0x31dec5[_0x49fd('0x13')](0x1f4,_[_0x49fd('0x62')](_0x40c089,_0x49fd('0x1f'))[_0x49fd('0x17')](',\x20')));}var _0x1ba291=_['find'](_0x481f6a[_0x49fd('0x77')],{'uniqueid':_0x1d04d5['uniqueid']});if(_0x1ba291&&_0x1ba291[_0x49fd('0x63')]){return ami[_0x49fd('0x1d')]({'action':'Redirect','channel':_0x1ba291['channel'],'exten':_0x1d04d5[_0x49fd('0x79')],'context':_0x1d04d5[_0x49fd('0x7a')]||_0x1ba291[_0x49fd('0x7a')],'priority':0x1})['then'](function(_0x1c0136){_0x3c86dc({'code':0xc8,'message':[_0x1d04d5['uniqueid'],_0x1c0136[_0x49fd('0x1f')][_0x49fd('0x69')]()]['join']('\x20')});})['catch'](function(_0x51afb5){_0x373ce0(_0x31dec5[_0x49fd('0x13')](0x1f5,[_0x1d04d5['uniqueid'],_0x51afb5[_0x49fd('0x1f')][_0x49fd('0x69')]()][_0x49fd('0x17')]('\x20')));});}else{return _0x373ce0(_0x31dec5['error'](0x1f5,_0x49fd('0x6e')));}});},'Agents':function(_0x5b49e8){return new Promise(function(_0xceaa75,_0x24315e){var _0x58d948=_[_0x49fd('0x5f')](_0x481f6a[_0x49fd('0xe')]);_0xceaa75({'count':_0x58d948[_0x49fd('0x5b')],'rows':_0x58d948});});},'Telephones':function(_0x5e73a7){return new Promise(function(_0x1f3678,_0x3b91d0){var _0x3f063e=_[_0x49fd('0x5f')](_0x481f6a['telephones']);_0x1f3678({'count':_0x3f063e[_0x49fd('0x5b')],'rows':_0x3f063e});});},'Trunks':function(_0x268029){return new Promise(function(_0x9fbe94,_0x232f6f){var _0x5ec8ac=_['values'](_0x481f6a[_0x49fd('0x7b')]);_0x9fbe94({'count':_0x5ec8ac['length'],'rows':_0x5ec8ac});});},'OutboundChannels':function(_0x365d33){return new Promise(function(_0x3b2ac0,_0x377d62){var _0x25457f=_['values'](_0x481f6a[_0x49fd('0x7c')]);_0x3b2ac0({'count':_0x25457f[_0x49fd('0x5b')],'rows':_0x25457f});});},'Outbound':function(_0x574e8a){return new Promise(function(_0x557189,_0x20f97d){_0x557189(_0x481f6a['outbound']);});},'Campaigns':function(_0x2b506c){return new Promise(function(_0x30c38c,_0x2a4af6){var _0x4dc0bd=_[_0x49fd('0x5f')](_0x481f6a['campaigns']);_0x30c38c({'count':_0x4dc0bd[_0x49fd('0x5b')],'rows':_0x4dc0bd});});},'VoiceQueuesPreview':function(_0x5d638d){var _0x156f8e=this;return new Promise(function(_0x5f02fa,_0x5c28d7){_0x3b4b46[_0x49fd('0x7d')](_0x5d638d['id'])['then'](function(_0x36f200){_0x5f02fa({'code':0xc8,'message':_0x36f200[_0x49fd('0x1f')]});})[_0x49fd('0x20')](function(_0x5e1943){_0x5c28d7(_0x156f8e[_0x49fd('0x13')](0x1f4,_0x5e1943['message']));});});},'EventManager':function(_0x1deda5){var _0x59a9e8=this;return new Promise(function(_0x25bb21,_0x4b53d0){if(!_0x1deda5['event']){return _0x4b53d0(_0x59a9e8['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x49fd('0x7e')+_0x1deda5[_0x49fd('0x7f')],_0x1deda5[_0x49fd('0x1f')]);_0x25bb21({'code':0xc8,'message':_0x1deda5});});},'FaxAccounts':function(_0x5a6c59){return new Promise(function(_0x78a4de,_0x40d20e){var _0x20326b=_['values'](_0x481f6a[_0x49fd('0x80')]);_0x78a4de({'count':_0x20326b['length'],'rows':_0x20326b});});},'SendFax':function(_0x574fdc){var _0x485396=this;return new Promise(function(_0xd23a0a,_0x148a2b){_0x42fdc7[_0x49fd('0x81')](_0x574fdc)[_0x49fd('0x1e')](function(_0x232bab){_0xd23a0a({'code':0xc8,'message':_0x232bab[_0x49fd('0x1f')]});})[_0x49fd('0x20')](function(_0x265b81){_0x148a2b(_0x485396['error'](0x1f4,_0x265b81[_0x49fd('0x1f')]));});});},'CheckAfterSend':function(_0x11b242){var _0x4997e6=this;return new Promise(function(_0x30c14a,_0x47bba4){_0x42fdc7['checkAfterSend'](_0x11b242)[_0x49fd('0x1e')](function(_0x206543){_0x30c14a({'code':0xc8,'message':_0x206543['message']});})[_0x49fd('0x20')](function(_0xe9596f){_0x47bba4(_0x4997e6[_0x49fd('0x13')](0x1f4,_0xe9596f[_0x49fd('0x1f')]));});});}};var _0x45153b=jayson[_0x49fd('0x82')](_0x48b999)['http']();_0x45153b['on']('error',function(_0x549914){return _0x9353cd(_0x549914);});_0x45153b[_0x49fd('0x83')](0x232a,'127.0.0.1',function(){console[_0x49fd('0x84')](_0x49fd('0x85'),0x232a);return _0x1bc16e(_0x49fd('0x86')+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 56ba2db..cc12e11 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 _0x7990=['data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','','Unknown','destcalleridname','then','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','toLowerCase','lodash','bluebird','ioredis','util','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','xmd-contactid','ListId','data3','split','phone','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','scheduledAt','updatedAt','union','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Contact\x20not\x20found'];(function(_0x50392,_0x5f2c41){var _0x11d87b=function(_0x1fe92b){while(--_0x1fe92b){_0x50392['push'](_0x50392['shift']());}};_0x11d87b(++_0x5f2c41);}(_0x7990,0xda));var _0x0799=function(_0x5dffbe,_0xbef794){_0x5dffbe=_0x5dffbe-0x0;var _0x320860=_0x7990[_0x5dffbe];return _0x320860;};'use strict';var _=require(_0x0799('0x0'));var BPromise=require(_0x0799('0x1'));var Redis=require(_0x0799('0x2'));var util=require(_0x0799('0x3'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x0799('0x4'));var cmContactRpc=require(_0x0799('0x5'));config[_0x0799('0x6')]=_[_0x0799('0x7')](config[_0x0799('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x0799('0x8'))(new Redis(config[_0x0799('0x6')]));function emit(_0x303661,_0x389d1e,_0x45a530,_0x55b8a1,_0x1ccd69){logger[_0x0799('0x9')](_0x0799('0xa'),_0x303661,_0x389d1e['id'],_0x45a530,_0x55b8a1,JSON[_0x0799('0xb')](_0x1ccd69));io['to'](_0x45a530)[_0x0799('0xc')](_0x55b8a1,_0x1ccd69);}exports[_0x0799('0xd')]=function(_0x422597,_0x12fc6c,_0xe8bd53,_0x1e2866){var _0x4f2981,_0x2cdf93;var _0x3290ae={};var _0x2d8c66=Number(_0xe8bd53[_0x0799('0xe')]);var _0x2442e3=_0xe8bd53['data2']?Boolean(Number(_0xe8bd53[_0x0799('0xf')])):![];var _0x1ffd6e;if(_0x1e2866[_0x0799('0x10')]){_0x3290ae['id']=_0x1e2866['xmd-contactid'];}if(!_0x3290ae['id']){_0x3290ae[_0x0799('0x11')]=_0x2d8c66;_0x1ffd6e=_0xe8bd53['data3']&&_0xe8bd53[_0x0799('0x12')]!=='0'?_0xe8bd53[_0x0799('0x12')][_0x0799('0x13')](','):[_0x0799('0x14')];_0x3290ae['$or']=_[_0x0799('0x15')](_0x1ffd6e,function(_0x101a7e){var _0x16e2b1={};_0x16e2b1[_0x101a7e]=_0x1e2866[_0x0799('0x16')]?_0x1e2866[_0x0799('0x17')]:_0x1e2866[_0x0799('0x18')];return _0x16e2b1;});}var _0x52e753=['id',_0x0799('0x19'),_0x0799('0x1a'),_0x0799('0x14'),_0x0799('0x1b'),_0x0799('0x1c'),_0x0799('0x11'),'createdAt',_0x0799('0x1d'),_0x0799('0x1e')];var _0x7e987a=_[_0x0799('0x1f')](_0x52e753,_0x1ffd6e);BPromise['resolve']()['then'](cmContactRpc['getContacts']({'attributes':_0x7e987a,'where':_0x3290ae}))['then'](function(_0xc12812){_0x2cdf93=_0xc12812;if(!_[_0x0799('0x20')](_0x2cdf93)){if(_0x2cdf93[_0x0799('0x21')]===0x1){_0x4f2981=_0x2cdf93[0x0];logger[_0x0799('0x9')](_0x0799('0x22'),_0x1e2866[_0x0799('0x23')],_0x12fc6c['id'],_0x4f2981['id']);}else{logger['info']('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x1e2866[_0x0799('0x23')],_0x12fc6c['id'],_[_0x0799('0x15')](_0x2cdf93,'id')['join'](','));}return;}else{logger[_0x0799('0x9')](_0x0799('0x24'),_0x1e2866[_0x0799('0x23')],_0x12fc6c['id']);var _0x400069={'ListId':_0x2d8c66};var _0x459e4b=_0xe8bd53[_0x0799('0x25')]&&_0xe8bd53[_0x0799('0x25')]!=='0'?_0xe8bd53['data4']:_0x0799('0x14');if(_0x2442e3){logger[_0x0799('0x9')](_0x0799('0x26'),_0x1e2866[_0x0799('0x23')],_0x12fc6c['id']);_0x400069[_0x459e4b]=_[_0x0799('0x27')](_0x1e2866[_0x0799('0x16')])?_0x1e2866[_0x0799('0x18')]:_0x1e2866[_0x0799('0x17')];if(_[_0x0799('0x27')](_0x1e2866[_0x0799('0x16')])){_0x400069[_0x0799('0x19')]=_0x1e2866['calleridname']&&_0x1e2866[_0x0799('0x28')]!==_0x0799('0x29')?_0x1e2866['calleridname']:_0x0799('0x2a');}else{_0x400069['firstName']=_0x1e2866[_0x0799('0x2b')]&&_0x1e2866['destcalleridname']!==_0x0799('0x29')?_0x1e2866['destcalleridname']:_0x0799('0x2a');}return BPromise['resolve']()[_0x0799('0x2c')](cmContactRpc[_0x0799('0x2d')](_0x400069))[_0x0799('0x2c')](function(_0x4a49a5){_0x4f2981=_0x4a49a5;_0x2cdf93[_0x0799('0x2e')](_0x4a49a5);if(_0x4f2981){logger['info'](_0x0799('0x2f'),_0x1e2866[_0x0799('0x23')],_0x12fc6c['id'],_0x4f2981['id']);}return;});}else{logger[_0x0799('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x1e2866['uniqueid'],_0x12fc6c['id']);_0x400069[_0x459e4b]=_['isNil'](_0x1e2866[_0x0799('0x16')])?_0x1e2866[_0x0799('0x18')]:_0x1e2866[_0x0799('0x17')];if(_[_0x0799('0x27')](_0x1e2866[_0x0799('0x16')])){_0x400069[_0x0799('0x19')]=_0x1e2866['calleridname']&&_0x1e2866[_0x0799('0x28')]!==_0x0799('0x29')?_0x1e2866[_0x0799('0x28')]:'Unknown';}else{_0x400069['firstName']=_0x1e2866['destcalleridname']&&_0x1e2866[_0x0799('0x2b')]!==_0x0799('0x29')?_0x1e2866[_0x0799('0x2b')]:'Unknown';}_0x4f2981=_0x400069;_0x2cdf93[_0x0799('0x2e')](_0x400069);return;}}})[_0x0799('0x2c')](function(){if(_0x422597){emit(_0x1e2866['uniqueid'],_0x12fc6c,util[_0x0799('0x30')](_0x0799('0x31'),_0x422597['name']),util['format']('trigger:%s',_0xe8bd53['action'][_0x0799('0x32')]()),{'evt':_['merge'](_0x1e2866,{'autoCreate':_0x2442e3}),'contact':_0x4f2981===undefined?{}:_0x4f2981,'contacts':_0x2cdf93['length']===0x0?undefined:_0x2cdf93});}});}; \ No newline at end of file +var _0xa5c7=['lastName','mobile','fax','createdAt','scheduledAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','destcalleridnum','isNil','','calleridname','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','uniqueid','[CM][%s][%s]\x20Autocreate\x20disabled','Unknown','format','user:%s','name','trigger:%s','action','toLowerCase','merge','bluebird','util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','xmd-contactid','ListId','data3','split','phone','map','routeId','calleridnum','firstName'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xa5c7,0x91));var _0x7a5c=function(_0x334bb9,_0x2c9ff5){_0x334bb9=_0x334bb9-0x0;var _0x904185=_0xa5c7[_0x334bb9];return _0x904185;};'use strict';var _=require('lodash');var BPromise=require(_0x7a5c('0x0'));var Redis=require('ioredis');var util=require(_0x7a5c('0x1'));var config=require(_0x7a5c('0x2'));var logger=require(_0x7a5c('0x3'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0x7a5c('0x4')]=_[_0x7a5c('0x5')](config[_0x7a5c('0x4')],{'host':_0x7a5c('0x6'),'port':0x18eb});var io=require(_0x7a5c('0x7'))(new Redis(config[_0x7a5c('0x4')]));function emit(_0x142293,_0x1dcad7,_0x5dc88a,_0x46b92f,_0x88b36a){logger[_0x7a5c('0x8')](_0x7a5c('0x9'),_0x142293,_0x1dcad7['id'],_0x5dc88a,_0x46b92f,JSON[_0x7a5c('0xa')](_0x88b36a));io['to'](_0x5dc88a)['emit'](_0x46b92f,_0x88b36a);}exports[_0x7a5c('0xb')]=function(_0x34d93d,_0x2249f6,_0x10cc9d,_0x38e495){var _0x2a1c1a,_0x527e25;var _0x29fca9={};var _0x1cf181=Number(_0x10cc9d[_0x7a5c('0xc')]);var _0x5aae03=_0x10cc9d[_0x7a5c('0xd')]?Boolean(Number(_0x10cc9d[_0x7a5c('0xd')])):![];var _0x31c424;if(_0x38e495[_0x7a5c('0xe')]){_0x29fca9['id']=_0x38e495['xmd-contactid'];}if(!_0x29fca9['id']){_0x29fca9[_0x7a5c('0xf')]=_0x1cf181;_0x31c424=_0x10cc9d['data3']&&_0x10cc9d[_0x7a5c('0x10')]!=='0'?_0x10cc9d[_0x7a5c('0x10')][_0x7a5c('0x11')](','):[_0x7a5c('0x12')];_0x29fca9['$or']=_[_0x7a5c('0x13')](_0x31c424,function(_0x37f4f9){var _0x244758={};_0x244758[_0x37f4f9]=_0x38e495[_0x7a5c('0x14')]?_0x38e495['destcalleridnum']:_0x38e495[_0x7a5c('0x15')];return _0x244758;});}var _0x537217=['id',_0x7a5c('0x16'),_0x7a5c('0x17'),_0x7a5c('0x12'),_0x7a5c('0x18'),_0x7a5c('0x19'),_0x7a5c('0xf'),_0x7a5c('0x1a'),_0x7a5c('0x1b'),'updatedAt'];var _0x4b654d=_[_0x7a5c('0x1c')](_0x537217,_0x31c424);BPromise[_0x7a5c('0x1d')]()[_0x7a5c('0x1e')](cmContactRpc[_0x7a5c('0x1f')]({'attributes':_0x4b654d,'where':_0x29fca9}))['then'](function(_0x486a92){_0x527e25=_0x486a92;if(!_[_0x7a5c('0x20')](_0x527e25)){if(_0x527e25[_0x7a5c('0x21')]===0x1){_0x2a1c1a=_0x527e25[0x0];logger[_0x7a5c('0x8')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x38e495['uniqueid'],_0x2249f6['id'],_0x2a1c1a['id']);}else{logger[_0x7a5c('0x8')](_0x7a5c('0x22'),_0x38e495['uniqueid'],_0x2249f6['id'],_[_0x7a5c('0x13')](_0x527e25,'id')[_0x7a5c('0x23')](','));}return;}else{logger['info'](_0x7a5c('0x24'),_0x38e495['uniqueid'],_0x2249f6['id']);var _0x5b9fb9={'ListId':_0x1cf181};var _0x3af226=_0x10cc9d['data4']&&_0x10cc9d[_0x7a5c('0x25')]!=='0'?_0x10cc9d[_0x7a5c('0x25')]:_0x7a5c('0x12');if(_0x5aae03){logger[_0x7a5c('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x38e495['uniqueid'],_0x2249f6['id']);_0x5b9fb9[_0x3af226]=_['isNil'](_0x38e495[_0x7a5c('0x14')])?_0x38e495['calleridnum']:_0x38e495[_0x7a5c('0x26')];if(_[_0x7a5c('0x27')](_0x38e495[_0x7a5c('0x14')])){_0x5b9fb9[_0x7a5c('0x16')]=_0x38e495['calleridname']&&_0x38e495['calleridname']!==_0x7a5c('0x28')?_0x38e495[_0x7a5c('0x29')]:'Unknown';}else{_0x5b9fb9[_0x7a5c('0x16')]=_0x38e495['destcalleridname']&&_0x38e495[_0x7a5c('0x2a')]!==_0x7a5c('0x28')?_0x38e495[_0x7a5c('0x2a')]:'Unknown';}return BPromise[_0x7a5c('0x1d')]()[_0x7a5c('0x1e')](cmContactRpc[_0x7a5c('0x2b')](_0x5b9fb9))[_0x7a5c('0x1e')](function(_0x449d43){_0x2a1c1a=_0x449d43;_0x527e25[_0x7a5c('0x2c')](_0x449d43);if(_0x2a1c1a){logger[_0x7a5c('0x8')](_0x7a5c('0x2d'),_0x38e495[_0x7a5c('0x2e')],_0x2249f6['id'],_0x2a1c1a['id']);}return;});}else{logger[_0x7a5c('0x8')](_0x7a5c('0x2f'),_0x38e495['uniqueid'],_0x2249f6['id']);_0x5b9fb9[_0x3af226]=_['isNil'](_0x38e495[_0x7a5c('0x14')])?_0x38e495[_0x7a5c('0x15')]:_0x38e495[_0x7a5c('0x26')];if(_[_0x7a5c('0x27')](_0x38e495[_0x7a5c('0x14')])){_0x5b9fb9[_0x7a5c('0x16')]=_0x38e495[_0x7a5c('0x29')]&&_0x38e495['calleridname']!==''?_0x38e495['calleridname']:_0x7a5c('0x30');}else{_0x5b9fb9[_0x7a5c('0x16')]=_0x38e495[_0x7a5c('0x2a')]&&_0x38e495[_0x7a5c('0x2a')]!==_0x7a5c('0x28')?_0x38e495[_0x7a5c('0x2a')]:'Unknown';}_0x2a1c1a=_0x5b9fb9;_0x527e25[_0x7a5c('0x2c')](_0x5b9fb9);return;}}})['then'](function(){if(_0x34d93d){emit(_0x38e495[_0x7a5c('0x2e')],_0x2249f6,util[_0x7a5c('0x31')](_0x7a5c('0x32'),_0x34d93d[_0x7a5c('0x33')]),util[_0x7a5c('0x31')](_0x7a5c('0x34'),_0x10cc9d[_0x7a5c('0x35')][_0x7a5c('0x36')]()),{'evt':_[_0x7a5c('0x37')](_0x38e495,{'autoCreate':_0x5aae03}),'contact':_0x2a1c1a===undefined?{}:_0x2a1c1a,'contacts':_0x527e25[_0x7a5c('0x21')]===0x0?undefined:_0x527e25});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 6ab595e..e0614d8 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 _0x27e8=['util','lodash','ioredis','./urlforward','./script','../../../config/logger','defaults','redis','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:outgoingmessage','custom:rejectmessage','prototype','emit','stringify','clone','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','toLowerCase','contactmanager','motionbar','browser','templates','data2','render','html','template\x20not\x20found','url','uri','buildUri','data3','isNil','data4','location','uriLocation','windowWidth','data5','windowHeight','data6','winapp','winApplication','winArguments','format','name','trigger:%s:%s','action','data1','user:%s','trigger:%s','exec','integration','accounts','queue','urlforward','script','parse','query','replace','every','AllConditions','checkConditions','channel','AnyConditions','length','some','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','routeId'];(function(_0x5eda83,_0x3ed09f){var _0x542a29=function(_0x27591e){while(--_0x27591e){_0x5eda83['push'](_0x5eda83['shift']());}};_0x542a29(++_0x3ed09f);}(_0x27e8,0x15c));var _0x827e=function(_0x5277c0,_0x39a3d3){_0x5277c0=_0x5277c0-0x0;var _0x43d6e7=_0x27e8[_0x5277c0];return _0x43d6e7;};'use strict';var util=require(_0x827e('0x0'));var _=require(_0x827e('0x1'));var url=require('url');var Mustache=require('mustache');var Redis=require(_0x827e('0x2'));var urlforward=require(_0x827e('0x3'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0x827e('0x4'));var config=require('../../../config/environment');var logger=require(_0x827e('0x5'))('trigger');var ami=require('../ami');config['redis']=_[_0x827e('0x6')](config[_0x827e('0x7')],{'host':_0x827e('0x8'),'port':0x18eb});var io=require(_0x827e('0x9'))(new Redis(config[_0x827e('0x7')]));var operators={'equals':function(_0xbc20ae,_0x568f18){return _0xbc20ae==_0x568f18;},'not_equals':function(_0x3f8255,_0x3cb0ed){return _0x3f8255!=_0x3cb0ed;}};var barAndWebActions=[_0x827e('0xa'),'url','winapp'];function Trigger(_0x17f430){this[_0x827e('0xb')]=_0x17f430['triggers'];this[_0x827e('0xc')]=_0x17f430[_0x827e('0xc')];this['voiceQueues']=_0x17f430[_0x827e('0xd')];this['templates']=_0x17f430['templates'];this[_0x827e('0xe')]=_0x17f430['voiceExtensions'];this['zendeskAccounts']=_0x17f430[_0x827e('0xf')];this['freshdeskAccounts']=_0x17f430[_0x827e('0x10')];this[_0x827e('0x11')]=_0x17f430['salesforceAccounts'];this['sugarcrmAccounts']=_0x17f430[_0x827e('0x12')];this[_0x827e('0x13')]=_0x17f430['zohoAccounts'];this[_0x827e('0x14')]=_0x17f430[_0x827e('0x14')];this['vtigerAccounts']=_0x17f430[_0x827e('0x15')];this['servicenowAccounts']=_0x17f430[_0x827e('0x16')];this[_0x827e('0x17')]=_0x17f430['dynamics365Accounts'];this['freshsalesAccounts']=_0x17f430[_0x827e('0x18')];this['accounts']={'zendesk':this[_0x827e('0xf')],'salesforce':this[_0x827e('0x11')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x827e('0x12')],'zoho':this[_0x827e('0x13')],'desk':this[_0x827e('0x14')],'vtiger':this[_0x827e('0x15')],'dynamics365':this[_0x827e('0x17')],'freshsales':this[_0x827e('0x18')],'servicenow':this[_0x827e('0x16')]};ami['on'](_0x827e('0x19'),this[_0x827e('0x1a')][_0x827e('0x1b')](this));ami['on'](_0x827e('0x1c'),this['syncCustomEvent'][_0x827e('0x1b')](this));ami['on'](_0x827e('0x1d'),this['syncCustomEvent'][_0x827e('0x1b')](this));ami['on']('custom:agentcomplete',this[_0x827e('0x1a')][_0x827e('0x1b')](this));ami['on']('custom:agentnosuchnumber',this[_0x827e('0x1a')][_0x827e('0x1b')](this));ami['on'](_0x827e('0x1e'),this['syncCustomEvent'][_0x827e('0x1b')](this));ami['on'](_0x827e('0x1f'),this[_0x827e('0x1a')]['bind'](this));ami['on'](_0x827e('0x20'),this['syncCustomEvent']['bind'](this));ami['on'](_0x827e('0x21'),this[_0x827e('0x1a')][_0x827e('0x1b')](this));ami['on'](_0x827e('0x22'),this[_0x827e('0x1a')][_0x827e('0x1b')](this));ami['on'](_0x827e('0x23'),this[_0x827e('0x1a')]['bind'](this));ami['on'](_0x827e('0x24'),this[_0x827e('0x1a')][_0x827e('0x1b')](this));ami['on']('custom:dialbegin',this[_0x827e('0x25')]['bind'](this));ami['on'](_0x827e('0x26'),this[_0x827e('0x25')][_0x827e('0x1b')](this));ami['on']('custom:dialend',this[_0x827e('0x25')][_0x827e('0x1b')](this));ami['on'](_0x827e('0x27'),this[_0x827e('0x1a')]['bind'](this));ami['on'](_0x827e('0x28'),this[_0x827e('0x1a')]['bind'](this));ami['on']('custom:incomingmessage',this[_0x827e('0x1a')][_0x827e('0x1b')](this));ami['on'](_0x827e('0x29'),this[_0x827e('0x1a')][_0x827e('0x1b')](this));ami['on']('custom:acceptmessage',this[_0x827e('0x1a')][_0x827e('0x1b')](this));ami['on'](_0x827e('0x2a'),this[_0x827e('0x1a')][_0x827e('0x1b')](this));}Trigger[_0x827e('0x2b')][_0x827e('0x2c')]=function(_0x264340,_0x3cf2b7,_0xab36c8){logger['info'](_0x264340,_0x3cf2b7,JSON[_0x827e('0x2d')](_0xab36c8));io['to'](_0x264340)['emit'](_0x3cf2b7,_0xab36c8);};Trigger[_0x827e('0x2b')][_0x827e('0x1a')]=function(_0x2cfe38){var _0x9c265f=_[_0x827e('0x2e')](_0x2cfe38);this[_0x827e('0x2f')](_0x9c265f);};Trigger[_0x827e('0x2b')]['syncAgentDial']=function(_0x350017){if(this[_0x827e('0xc')][_0x350017[_0x827e('0x30')]]){this[_0x827e('0x1a')](_0x350017);}};Trigger[_0x827e('0x2b')]['checkTriggers']=function(_0x1a45d6){var _0x5a7338;for(var _0x5d9204 in this[_0x827e('0xb')]){if(this[_0x827e('0xb')][_0x827e('0x31')](_0x5d9204)){if(this[_0x827e('0xb')][_0x5d9204][_0x827e('0x32')]){_0x5a7338=this[_0x827e('0x33')](this[_0x827e('0xb')][_0x5d9204],_0x1a45d6);if(_0x5a7338){_[_0x827e('0x34')](_0x1a45d6,_0x1a45d6[_0x827e('0x35')]);for(var _0x47a0b5=0x0,_0x45e49a,_0x48a92c,_0x47a1a4;_0x47a0b50x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x547005,_0x48649f){var _0x54e31e=function(_0x158f57){while(--_0x158f57){_0x547005['push'](_0x547005['shift']());}};_0x54e31e(++_0x48649f);}(_0x3e74,0x175));var _0x43e7=function(_0x55f7df,_0x307618){_0x55f7df=_0x55f7df-0x0;var _0x4824a2=_0x3e74[_0x55f7df];return _0x4824a2;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 54ae126..0eddeba 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 _0xa8f4=['getString','Subjects','Descriptions','/contacts(','Fields','phonecall','phonecalls','assign','callDirection','queue','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','stripTrailingSlash','serverUrl','unmanaged','remoteUri','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','ticketId',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','POST','username','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','outbound','destcalleridnum','calleridnum','/systemusers(','4.0','headers','lastIndexOf','enduserId','toLowerCase','replace','%2b','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','includes','picklist','type','nameField','customField','idField','substring','indexOf','content','ticketType','incidents'];(function(_0x343090,_0x433a80){var _0x3ff3e8=function(_0x16c811){while(--_0x16c811){_0x343090['push'](_0x343090['shift']());}};_0x3ff3e8(++_0x433a80);}(_0xa8f4,0x13e));var _0x4a8f=function(_0x38ef0d,_0x3333d2){_0x38ef0d=_0x38ef0d-0x0;var _0x5aa5d8=_0xa8f4[_0x38ef0d];return _0x5aa5d8;};'use strict';var _=require('lodash');var BPromise=require(_0x4a8f('0x0'));var rp=require(_0x4a8f('0x1'));var util=require(_0x4a8f('0x2'));var intUtil=require('./util');var md5=require(_0x4a8f('0x3'));var Redis=require(_0x4a8f('0x4'));var logger=require(_0x4a8f('0x5'))(_0x4a8f('0x6'));var config=require(_0x4a8f('0x7'));config['redis']=_[_0x4a8f('0x8')](config[_0x4a8f('0x9')],{'host':_0x4a8f('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4a8f('0x9')]));function getAuthToken(_0x437188,_0x22230f,_0x6688ea){var _0xa2fd2a={'method':_0x4a8f('0xb'),'uri':_0x22230f,'form':{'client_id':_0x437188['clientId'],'resource':_0x437188['remoteUri'],'username':_0x437188[_0x4a8f('0xc')],'password':_0x437188[_0x4a8f('0xd')],'grant_type':_0x4a8f('0xd'),'client_secret':_0x437188['clientSecret']},'json':!![]};return rp(_0xa2fd2a)[_0x4a8f('0xe')](function(_0x324a56){return _0x324a56[_0x4a8f('0xf')];})[_0x4a8f('0x10')](function(_0x199b77){logger[_0x4a8f('0x11')]('['+[_0x6688ea[_0x4a8f('0x12')]()]+_0x4a8f('0x13'));return _0x199b77[_0x4a8f('0x14')];});}function getUser(_0x5fe280,_0x143267,_0x56067c,_0x15d27b,_0x2c3f18,_0x2dee31){return new BPromise(function(_0x41c8e4,_0x44660f){return getAuthToken(_0x143267,_0x15d27b,_0x2dee31)[_0x4a8f('0xe')](function(_0x47cdc3){var _0x5decda={'method':_0x4a8f('0x15'),'uri':_0x2c3f18+_0x4a8f('0x16'),'headers':{'Authorization':_0x4a8f('0x17')+_0x47cdc3,'OData-Version':'4.0'},'json':!![]};return rp(_0x5decda);})[_0x4a8f('0xe')](function(_0x37e9cd){var _0x2df9b5=_0x37e9cd[_0x4a8f('0x18')];var _0x242f8f=![];var _0x38f2c3=null;if(!_[_0x4a8f('0x19')](_0x56067c)){if(intUtil[_0x4a8f('0x1a')](_0x56067c[_0x4a8f('0x1b')])){_0x5fe280[_0x4a8f('0x1c')]=_0x56067c[_0x4a8f('0x1b')];for(_0x38f2c3=0x0;_0x38f2c3<_0x2df9b5[_0x4a8f('0x1d')];_0x38f2c3++){if(_0x2df9b5[_0x38f2c3][_0x4a8f('0x1e')]===_0x56067c[_0x4a8f('0x1b')]&&!_0x2df9b5[_0x38f2c3][_0x4a8f('0x1f')]){_0x242f8f=!![];logger[_0x4a8f('0x20')]('['+[_0x2dee31[_0x4a8f('0x12')]()]+']\x20Agent\x20found\x20'+_0x2df9b5[_0x38f2c3][_0x4a8f('0x21')]+'!');_0x5fe280[_0x4a8f('0x22')]=_0x2df9b5[_0x38f2c3]['systemuserid'];}}}}if(!_0x242f8f){logger[_0x4a8f('0x20')]('['+[_0x2dee31[_0x4a8f('0x12')]()]+_0x4a8f('0x23'));_0x5fe280['userEmail']=_0x143267[_0x4a8f('0xc')];for(_0x38f2c3=0x0;_0x38f2c3<_0x2df9b5[_0x4a8f('0x1d')];_0x38f2c3++){if(_0x2df9b5[_0x38f2c3]['internalemailaddress']===_0x143267['username']){_0x5fe280[_0x4a8f('0x22')]=_0x2df9b5[_0x38f2c3][_0x4a8f('0x21')];}}}_0x41c8e4(_0x5fe280);})[_0x4a8f('0x10')](function(_0x3dce22){_0x44660f(_0x3dce22[_0x4a8f('0x14')]);});});}function createEndUser(_0x371a83,_0x4de4a6,_0xef4696,_0x3e2984,_0x2be814,_0x69c53e){return new BPromise(function(_0x209c9f,_0x4c2b1d){return getAuthToken(_0x4de4a6,_0xef4696,_0x69c53e)['then'](function(_0x59a27b){var _0x271de7=_0x69c53e['toLowerCase']()===_0x4a8f('0x24')?_0x2be814[_0x4a8f('0x25')]:_0x2be814[_0x4a8f('0x26')];var _0x535ea9={'method':_0x4a8f('0xb'),'uri':_0x3e2984+'contacts','body':{'telephone1':_0x271de7,'fullname':_0x271de7,'firstname':_0x271de7,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x4a8f('0x27')+_0x371a83['userId']+')'},'headers':{'Authorization':_0x4a8f('0x17')+_0x59a27b,'OData-Version':_0x4a8f('0x28')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x535ea9);})[_0x4a8f('0xe')](function(_0x2bea37){var _0x5a2ed7=_0x2bea37[_0x4a8f('0x29')]['odata-entityid'];var _0x3a2bd5=_0x5a2ed7['substring'](_0x5a2ed7[_0x4a8f('0x2a')]('(')+0x1,_0x5a2ed7[_0x4a8f('0x2a')](')'));_0x371a83[_0x4a8f('0x2b')]=_0x3a2bd5;_0x209c9f(_0x371a83);})[_0x4a8f('0x10')](function(_0x120409){_0x4c2b1d(_0x120409[_0x4a8f('0x14')]);});});}function getEndUser(_0x148e8a,_0x381954,_0x345e95,_0x3c9aec,_0x33cfb0,_0x41b66a){return new BPromise(function(_0x321efb,_0x584a3b){var _0x740627=_0x41b66a[_0x4a8f('0x2c')]()===_0x4a8f('0x24')?_0x33cfb0[_0x4a8f('0x25')]:_0x33cfb0[_0x4a8f('0x26')];return getAuthToken(_0x381954,_0x345e95,_0x41b66a)['then'](function(_0x5e364a){var _0x54985c={'method':'GET','uri':_0x3c9aec+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x740627[_0x4a8f('0x2d')]('+',_0x4a8f('0x2e'))+'\x27','headers':{'Authorization':_0x4a8f('0x17')+_0x5e364a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x54985c);})[_0x4a8f('0xe')](function(_0x226a48){var _0x42f352=null;if(_0x226a48){var _0x5bb7f8=_0x226a48[_0x4a8f('0x18')];var _0x25b8bf=![];for(_0x42f352=0x0;_0x42f352<_0x5bb7f8[_0x4a8f('0x1d')];_0x42f352++){if(_0x5bb7f8[_0x42f352][_0x4a8f('0x2f')]===_0x740627){_0x25b8bf=!![];_0x148e8a[_0x4a8f('0x2b')]=_0x5bb7f8[_0x42f352][_0x4a8f('0x30')];}}if(_0x25b8bf){_0x321efb(_0x148e8a);}else{return createEndUser(_0x148e8a,_0x381954,_0x345e95,_0x3c9aec,_0x33cfb0,_0x41b66a)[_0x4a8f('0xe')](function(_0x3f0d8e){logger[_0x4a8f('0x20')]('['+[_0x41b66a['toUpperCase']()]+_0x4a8f('0x31'),_0x3f0d8e[_0x4a8f('0x2b')]);_0x321efb(_0x3f0d8e);});}}else{return createEndUser(_0x148e8a,_0x381954,_0x345e95,_0x3c9aec,_0x33cfb0,_0x41b66a)[_0x4a8f('0xe')](function(_0x5b4e3d){logger[_0x4a8f('0x20')]('['+[_0x41b66a[_0x4a8f('0x12')]()]+_0x4a8f('0x32'),_0x5b4e3d['enduserId']);_0x321efb(_0x5b4e3d);});}});});}function getCustomFields(_0x591d31,_0x149408,_0x264cc2){var _0xda6003={};if(_0x591d31[_0x4a8f('0x1d')]>0x0){_['forEach'](_0x591d31,function(_0xb99ddb){if(_[_0x4a8f('0x33')](['string',_0x4a8f('0x34')],_0xb99ddb[_0x4a8f('0x35')])&&_0xb99ddb[_0x4a8f('0x36')]&&!_0xb99ddb[_0x4a8f('0x37')]){var _0x57bf81=_0xb99ddb[_0x4a8f('0x38')][_0x4a8f('0x2c')]();var _0x165224=_0x57bf81[_0x4a8f('0x39')](0x0,_0x57bf81[_0x4a8f('0x3a')]('_'));var _0x40f6b2=_0x57bf81[_0x4a8f('0x39')](_0x57bf81['indexOf']('_')+0x1);if(_0x165224===_0x264cc2){_0xda6003[_0x40f6b2]=_0xb99ddb[_0x4a8f('0x3b')];}}});}return _0xda6003;}function getTicket(_0x28eec5,_0x93513b,_0x2861e2,_0x492e8d,_0x5a1c7b,_0x2b8443,_0x417333){return new BPromise(function(_0x4b7f59,_0x45edc8){var _0x520c36;return getAuthToken(_0x93513b,_0x2861e2,_0x417333)[_0x4a8f('0xe')](function(_0x4fb38a){if(_0x2b8443[_0x4a8f('0x3c')]==='incident'){_0x520c36={'method':_0x4a8f('0xb'),'uri':_0x492e8d+_0x4a8f('0x3d'),'body':Object['assign']({},{'title':intUtil[_0x4a8f('0x3e')](_0x2b8443[_0x4a8f('0x3f')],_0x5a1c7b,'\x20'),'description':intUtil['getString'](_0x2b8443[_0x4a8f('0x40')],_0x5a1c7b,'\x0a'),'customerid_contact@odata.bind':_0x4a8f('0x41')+_0x28eec5[_0x4a8f('0x2b')]+')','ownerid@odata.bind':_0x4a8f('0x27')+_0x28eec5[_0x4a8f('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x2b8443[_0x4a8f('0x42')],_0x5a1c7b,_0x2b8443[_0x4a8f('0x3c')])),'headers':{'Authorization':'Bearer\x20'+_0x4fb38a,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2b8443['ticketType']===_0x4a8f('0x43')){_0x520c36={'method':_0x4a8f('0xb'),'uri':_0x492e8d+_0x4a8f('0x44'),'body':Object[_0x4a8f('0x45')]({},{'subject':intUtil[_0x4a8f('0x3e')](_0x2b8443[_0x4a8f('0x3f')],_0x5a1c7b,'\x20'),'phonenumber':String(_0x5a1c7b[_0x4a8f('0x26')]),'description':intUtil[_0x4a8f('0x3e')](_0x2b8443[_0x4a8f('0x40')],_0x5a1c7b,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4a8f('0x41')+_0x28eec5[_0x4a8f('0x2b')]+')','ownerid@odata.bind':_0x4a8f('0x27')+_0x28eec5['userId']+')','directioncode':_0x28eec5[_0x4a8f('0x46')]===_0x4a8f('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x4a8f('0x27')+_0x28eec5['userId']+')','participationtypemask':_0x28eec5[_0x4a8f('0x46')]===_0x4a8f('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0x4a8f('0x41')+_0x28eec5['enduserId']+')','participationtypemask':_0x28eec5[_0x4a8f('0x46')]==='queue'?0x1:0x2}]},getCustomFields(_0x2b8443[_0x4a8f('0x42')],_0x5a1c7b,_0x2b8443[_0x4a8f('0x3c')])),'headers':{'Authorization':'Bearer\x20'+_0x4fb38a,'OData-Version':_0x4a8f('0x28')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x520c36);})[_0x4a8f('0xe')](function(_0x582c16){var _0x2e4f08=_0x582c16[_0x4a8f('0x29')]['odata-entityid'];var _0x281c0f=_0x2e4f08[_0x4a8f('0x39')](_0x2e4f08[_0x4a8f('0x2a')]('(')+0x1,_0x2e4f08[_0x4a8f('0x2a')](')'));_0x28eec5['ticketId']=_0x281c0f;_0x4b7f59(_0x28eec5);})['catch'](function(_0x583f6f){_0x45edc8(_0x583f6f[_0x4a8f('0x14')]);});});}function emit(_0x2b586d,_0x22cde0,_0x5aceff,_0x17a085){var _0x5cf261={'uri':util[_0x4a8f('0x48')](_0x4a8f('0x49'),_0x2b586d,_0x5aceff,_0x17a085)};io['to'](util['format']('user:%s',_0x22cde0))['emit']('trigger:browser:url',_0x5cf261);}exports['cs']=function(_0x15bf38,_0x241064,_0x280211,_0x5b9669,_0x238193,_0x47ae94,_0x502478,_0x1b84e3){var _0x5b3d96={};_0x47ae94['remoteUri']=intUtil[_0x4a8f('0x4a')](_0x47ae94['remoteUri']);_0x47ae94[_0x4a8f('0x4b')]=intUtil[_0x4a8f('0x4a')](_0x47ae94[_0x4a8f('0x4b')]);_0x5b3d96[_0x4a8f('0x46')]=_0x1b84e3===_0x4a8f('0x47')||_0x1b84e3===_0x4a8f('0x4c')?'queue':_0x4a8f('0x24');var _0x4d136d=util[_0x4a8f('0x48')]('%s/api/data/v9.0/',_0x47ae94[_0x4a8f('0x4d')]);var _0x5de1ef=util[_0x4a8f('0x48')](_0x4a8f('0x4e'),_0x47ae94['tenantId']);var _0x301854=util['format'](_0x4a8f('0x4f'),_0x47ae94[_0x4a8f('0x4b')],_0x241064[_0x4a8f('0x50')],md5(_0x241064['uniqueid']));if(_0x238193&&_0x238193[_0x4a8f('0x51')]){logger[_0x4a8f('0x20')](_0x4a8f('0x52'),_0x4a8f('0x53'));_0x241064[_0x4a8f('0x54')]=_0x301854;}else if(_0x502478&&_0x502478[_0x4a8f('0x55')]&&_0x502478[_0x4a8f('0x55')]!==_0x4a8f('0x56')){logger['info'](_0x4a8f('0x57'),'Recording\x20is\x20enabled!');_0x241064['recordingURL']=_0x301854;}else{_0x241064[_0x4a8f('0x54')]='';}return getUser(_0x5b3d96,_0x47ae94,_0x5b9669,_0x5de1ef,_0x4d136d,_0x1b84e3)[_0x4a8f('0xe')](function(_0x54156a){logger[_0x4a8f('0x20')]('['+_0x1b84e3[_0x4a8f('0x12')]()+']\x20The\x20User\x20ID\x20is:',_0x54156a[_0x4a8f('0x22')]);logger[_0x4a8f('0x20')]('['+_0x1b84e3['toUpperCase']()+_0x4a8f('0x58'),_0x54156a[_0x4a8f('0x1c')]);return getEndUser(_0x54156a,_0x47ae94,_0x5de1ef,_0x4d136d,_0x241064,_0x1b84e3);})[_0x4a8f('0xe')](function(_0x26fba2){logger[_0x4a8f('0x20')]('['+_0x1b84e3[_0x4a8f('0x12')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x26fba2[_0x4a8f('0x2b')]);logger[_0x4a8f('0x20')]('['+_0x1b84e3['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x241064[_0x4a8f('0x26')]);return getTicket(_0x26fba2,_0x47ae94,_0x5de1ef,_0x4d136d,_0x241064,_0x280211,_0x1b84e3);})[_0x4a8f('0xe')](function(_0x1d8989){logger[_0x4a8f('0x20')](util['format']('['+_0x1b84e3['toUpperCase']()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x280211[_0x4a8f('0x3c')],_0x1d8989['ticketId']));logger[_0x4a8f('0x20')](util[_0x4a8f('0x48')]('['+_0x1b84e3['toUpperCase']()+_0x4a8f('0x59'),_0x1b84e3));if(_0x1b84e3!==_0x4a8f('0x4c')){logger[_0x4a8f('0x20')]('['+_0x1b84e3['toUpperCase']()+']',_0x4a8f('0x5a'));emit(_0x47ae94[_0x4a8f('0x4d')],_0x5b9669[_0x4a8f('0x5b')],_0x280211[_0x4a8f('0x3c')],_0x1d8989[_0x4a8f('0x5c')]);}})[_0x4a8f('0x10')](function(_0xc9986a){logger[_0x4a8f('0x11')]('['+_0x1b84e3[_0x4a8f('0x12')]()+_0x4a8f('0x5d'),util[_0x4a8f('0x5e')](_0xc9986a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2cd0=['socket.io-emitter','POST','remoteUri','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','toLowerCase','outbound','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','destcalleridnum','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','value','telephone1','enduserId','contactid',']\x20Enduser\x20Created!','includes','string','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','getString','Subjects','Descriptions','Fields','assign','/contacts(','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','serverUrl','stripTrailingSlash','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2cd0,0xc2));var _0x02cd=function(_0x179f03,_0x4d05ab){_0x179f03=_0x179f03-0x0;var _0x2fffa2=_0x2cd0[_0x179f03];return _0x2fffa2;};'use strict';var _=require(_0x02cd('0x0'));var BPromise=require(_0x02cd('0x1'));var rp=require(_0x02cd('0x2'));var util=require(_0x02cd('0x3'));var intUtil=require(_0x02cd('0x4'));var md5=require('md5');var Redis=require(_0x02cd('0x5'));var logger=require(_0x02cd('0x6'))(_0x02cd('0x7'));var config=require(_0x02cd('0x8'));config['redis']=_['defaults'](config[_0x02cd('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x02cd('0xa'))(new Redis(config[_0x02cd('0x9')]));function getAuthToken(_0x4f9809,_0xa061b7,_0x162ad8){var _0x59124f={'method':_0x02cd('0xb'),'uri':_0xa061b7,'form':{'client_id':_0x4f9809['clientId'],'resource':_0x4f9809[_0x02cd('0xc')],'username':_0x4f9809['username'],'password':_0x4f9809[_0x02cd('0xd')],'grant_type':_0x02cd('0xd'),'client_secret':_0x4f9809[_0x02cd('0xe')]},'json':!![]};return rp(_0x59124f)[_0x02cd('0xf')](function(_0x2f219a){return _0x2f219a[_0x02cd('0x10')];})[_0x02cd('0x11')](function(_0x314bdd){logger[_0x02cd('0x12')]('['+[_0x162ad8[_0x02cd('0x13')]()]+_0x02cd('0x14'));return _0x314bdd[_0x02cd('0x15')];});}function getUser(_0x3b1204,_0x36672d,_0x1b6688,_0x3d8c3e,_0x110b09,_0x327733){return new BPromise(function(_0x59a60a,_0x296827){return getAuthToken(_0x36672d,_0x3d8c3e,_0x327733)[_0x02cd('0xf')](function(_0x3ec140){var _0x47395c={'method':_0x02cd('0x16'),'uri':_0x110b09+_0x02cd('0x17'),'headers':{'Authorization':_0x02cd('0x18')+_0x3ec140,'OData-Version':_0x02cd('0x19')},'json':!![]};return rp(_0x47395c);})['then'](function(_0x5ac57a){var _0x5dd533=_0x5ac57a['value'];var _0xba47c=![];var _0x335b51=null;if(!_['isNil'](_0x1b6688)){if(intUtil[_0x02cd('0x1a')](_0x1b6688[_0x02cd('0x1b')])){_0x3b1204[_0x02cd('0x1c')]=_0x1b6688['email'];for(_0x335b51=0x0;_0x335b51<_0x5dd533[_0x02cd('0x1d')];_0x335b51++){if(_0x5dd533[_0x335b51][_0x02cd('0x1e')]===_0x1b6688[_0x02cd('0x1b')]&&!_0x5dd533[_0x335b51][_0x02cd('0x1f')]){_0xba47c=!![];logger[_0x02cd('0x20')]('['+[_0x327733[_0x02cd('0x13')]()]+_0x02cd('0x21')+_0x5dd533[_0x335b51]['systemuserid']+'!');_0x3b1204[_0x02cd('0x22')]=_0x5dd533[_0x335b51][_0x02cd('0x23')];}}}}if(!_0xba47c){logger[_0x02cd('0x20')]('['+[_0x327733['toUpperCase']()]+_0x02cd('0x24'));_0x3b1204[_0x02cd('0x1c')]=_0x36672d[_0x02cd('0x25')];for(_0x335b51=0x0;_0x335b51<_0x5dd533[_0x02cd('0x1d')];_0x335b51++){if(_0x5dd533[_0x335b51][_0x02cd('0x1e')]===_0x36672d[_0x02cd('0x25')]){_0x3b1204[_0x02cd('0x22')]=_0x5dd533[_0x335b51][_0x02cd('0x23')];}}}_0x59a60a(_0x3b1204);})[_0x02cd('0x11')](function(_0x2c0633){_0x296827(_0x2c0633[_0x02cd('0x15')]);});});}function createEndUser(_0x49102e,_0xd4b8ff,_0x4ab7f7,_0x180db5,_0x3bb864,_0x255f09){return new BPromise(function(_0xe29fb5,_0x5b1b43){return getAuthToken(_0xd4b8ff,_0x4ab7f7,_0x255f09)['then'](function(_0x1b3b70){var _0x25ec96=_0x255f09[_0x02cd('0x26')]()===_0x02cd('0x27')?_0x3bb864['destcalleridnum']:_0x3bb864['calleridnum'];var _0x5bdac4={'method':_0x02cd('0xb'),'uri':_0x180db5+_0x02cd('0x28'),'body':{'telephone1':_0x25ec96,'fullname':_0x25ec96,'firstname':_0x25ec96,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x02cd('0x29')+_0x49102e[_0x02cd('0x22')]+')'},'headers':{'Authorization':_0x02cd('0x18')+_0x1b3b70,'OData-Version':_0x02cd('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5bdac4);})[_0x02cd('0xf')](function(_0x516296){var _0x45ab9d=_0x516296[_0x02cd('0x2a')][_0x02cd('0x2b')];var _0x20c6ee=_0x45ab9d[_0x02cd('0x2c')](_0x45ab9d[_0x02cd('0x2d')]('(')+0x1,_0x45ab9d[_0x02cd('0x2d')](')'));_0x49102e['enduserId']=_0x20c6ee;_0xe29fb5(_0x49102e);})[_0x02cd('0x11')](function(_0x26e509){_0x5b1b43(_0x26e509[_0x02cd('0x15')]);});});}function getEndUser(_0x37ff0e,_0x316657,_0x1306e5,_0x302f8f,_0x1849fb,_0x5ac469){return new BPromise(function(_0x27e0b3,_0x583342){var _0x535805=_0x5ac469[_0x02cd('0x26')]()===_0x02cd('0x27')?_0x1849fb[_0x02cd('0x2e')]:_0x1849fb[_0x02cd('0x2f')];return getAuthToken(_0x316657,_0x1306e5,_0x5ac469)[_0x02cd('0xf')](function(_0x49bdfa){var _0x2b981d={'method':_0x02cd('0x16'),'uri':_0x302f8f+_0x02cd('0x30')+_0x535805[_0x02cd('0x31')]('+',_0x02cd('0x32'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x49bdfa,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2b981d);})['then'](function(_0x81ca4e){var _0x214db7=null;if(_0x81ca4e){var _0x41a8ae=_0x81ca4e[_0x02cd('0x33')];var _0xf93956=![];for(_0x214db7=0x0;_0x214db7<_0x41a8ae[_0x02cd('0x1d')];_0x214db7++){if(_0x41a8ae[_0x214db7][_0x02cd('0x34')]===_0x535805){_0xf93956=!![];_0x37ff0e[_0x02cd('0x35')]=_0x41a8ae[_0x214db7][_0x02cd('0x36')];}}if(_0xf93956){_0x27e0b3(_0x37ff0e);}else{return createEndUser(_0x37ff0e,_0x316657,_0x1306e5,_0x302f8f,_0x1849fb,_0x5ac469)[_0x02cd('0xf')](function(_0x1bb624){logger[_0x02cd('0x20')]('['+[_0x5ac469[_0x02cd('0x13')]()]+']\x20Enduser\x20created!',_0x1bb624['enduserId']);_0x27e0b3(_0x1bb624);});}}else{return createEndUser(_0x37ff0e,_0x316657,_0x1306e5,_0x302f8f,_0x1849fb,_0x5ac469)['then'](function(_0x4c61bd){logger[_0x02cd('0x20')]('['+[_0x5ac469[_0x02cd('0x13')]()]+_0x02cd('0x37'),_0x4c61bd[_0x02cd('0x35')]);_0x27e0b3(_0x4c61bd);});}});});}function getCustomFields(_0x3e3e2d,_0x26c26a,_0xe5149d){var _0x53851d={};if(_0x3e3e2d[_0x02cd('0x1d')]>0x0){_['forEach'](_0x3e3e2d,function(_0x5dd0b5){if(_[_0x02cd('0x38')]([_0x02cd('0x39'),'picklist'],_0x5dd0b5['type'])&&_0x5dd0b5[_0x02cd('0x3a')]&&!_0x5dd0b5[_0x02cd('0x3b')]){var _0x222ff5=_0x5dd0b5[_0x02cd('0x3c')][_0x02cd('0x26')]();var _0x3e404a=_0x222ff5[_0x02cd('0x2c')](0x0,_0x222ff5[_0x02cd('0x3d')]('_'));var _0x401135=_0x222ff5['substring'](_0x222ff5['indexOf']('_')+0x1);if(_0x3e404a===_0xe5149d){_0x53851d[_0x401135]=_0x5dd0b5[_0x02cd('0x3e')];}}});}return _0x53851d;}function getTicket(_0x5a548b,_0x226c03,_0x291a00,_0xb4c756,_0x8e3a3e,_0x159663,_0x1fa3d6){return new BPromise(function(_0x2b1392,_0x3f8e95){var _0x5033e8;return getAuthToken(_0x226c03,_0x291a00,_0x1fa3d6)[_0x02cd('0xf')](function(_0x5520b0){if(_0x159663[_0x02cd('0x3f')]===_0x02cd('0x40')){_0x5033e8={'method':_0x02cd('0xb'),'uri':_0xb4c756+_0x02cd('0x41'),'body':Object['assign']({},{'title':intUtil[_0x02cd('0x42')](_0x159663[_0x02cd('0x43')],_0x8e3a3e,'\x20'),'description':intUtil['getString'](_0x159663[_0x02cd('0x44')],_0x8e3a3e,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x5a548b['enduserId']+')','ownerid@odata.bind':_0x02cd('0x29')+_0x5a548b[_0x02cd('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x159663[_0x02cd('0x45')],_0x8e3a3e,_0x159663[_0x02cd('0x3f')])),'headers':{'Authorization':'Bearer\x20'+_0x5520b0,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x159663['ticketType']==='phonecall'){_0x5033e8={'method':'POST','uri':_0xb4c756+'phonecalls','body':Object[_0x02cd('0x46')]({},{'subject':intUtil['getString'](_0x159663[_0x02cd('0x43')],_0x8e3a3e,'\x20'),'phonenumber':String(_0x8e3a3e[_0x02cd('0x2f')]),'description':intUtil[_0x02cd('0x42')](_0x159663[_0x02cd('0x44')],_0x8e3a3e,'\x0a'),'regardingobjectid_contact@odata.bind':_0x02cd('0x47')+_0x5a548b['enduserId']+')','ownerid@odata.bind':_0x02cd('0x29')+_0x5a548b['userId']+')','directioncode':_0x5a548b[_0x02cd('0x48')]===_0x02cd('0x49')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x02cd('0x29')+_0x5a548b[_0x02cd('0x22')]+')','participationtypemask':_0x5a548b[_0x02cd('0x48')]===_0x02cd('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0x02cd('0x47')+_0x5a548b[_0x02cd('0x35')]+')','participationtypemask':_0x5a548b[_0x02cd('0x48')]===_0x02cd('0x49')?0x1:0x2}]},getCustomFields(_0x159663[_0x02cd('0x45')],_0x8e3a3e,_0x159663['ticketType'])),'headers':{'Authorization':_0x02cd('0x18')+_0x5520b0,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5033e8);})[_0x02cd('0xf')](function(_0x18f994){var _0x42f6a0=_0x18f994['headers']['odata-entityid'];var _0x1aba83=_0x42f6a0[_0x02cd('0x2c')](_0x42f6a0['lastIndexOf']('(')+0x1,_0x42f6a0[_0x02cd('0x2d')](')'));_0x5a548b[_0x02cd('0x4a')]=_0x1aba83;_0x2b1392(_0x5a548b);})[_0x02cd('0x11')](function(_0x1c1451){_0x3f8e95(_0x1c1451[_0x02cd('0x15')]);});});}function emit(_0x29251d,_0x1e0789,_0x3f925b,_0x2da909){var _0x4fdeef={'uri':util[_0x02cd('0x4b')](_0x02cd('0x4c'),_0x29251d,_0x3f925b,_0x2da909)};io['to'](util[_0x02cd('0x4b')]('user:%s',_0x1e0789))[_0x02cd('0x4d')](_0x02cd('0x4e'),_0x4fdeef);}exports['cs']=function(_0x3af5ed,_0x1f27a8,_0x4ca71b,_0x5d8cf8,_0x236eb4,_0x36832f,_0x1e24ec,_0x47e169){var _0x5ef975={};_0x36832f[_0x02cd('0xc')]=intUtil['stripTrailingSlash'](_0x36832f[_0x02cd('0xc')]);_0x36832f[_0x02cd('0x4f')]=intUtil[_0x02cd('0x50')](_0x36832f[_0x02cd('0x4f')]);_0x5ef975['callDirection']=_0x47e169==='queue'||_0x47e169===_0x02cd('0x51')?_0x02cd('0x49'):_0x02cd('0x27');var _0x127959=util['format']('%s/api/data/v9.0/',_0x36832f[_0x02cd('0xc')]);var _0x32540a=util[_0x02cd('0x4b')](_0x02cd('0x52'),_0x36832f['tenantId']);var _0x282b2a=util[_0x02cd('0x4b')](_0x02cd('0x53'),_0x36832f['serverUrl'],_0x1f27a8[_0x02cd('0x54')],md5(_0x1f27a8[_0x02cd('0x54')]));if(_0x236eb4&&_0x236eb4[_0x02cd('0x55')]){logger['info'](_0x02cd('0x56'),_0x02cd('0x57'));_0x1f27a8[_0x02cd('0x58')]=_0x282b2a;}else if(_0x1e24ec&&_0x1e24ec[_0x02cd('0x59')]&&_0x1e24ec[_0x02cd('0x59')]!==_0x02cd('0x5a')){logger[_0x02cd('0x20')](_0x02cd('0x5b'),_0x02cd('0x57'));_0x1f27a8[_0x02cd('0x58')]=_0x282b2a;}else{_0x1f27a8[_0x02cd('0x58')]='';}return getUser(_0x5ef975,_0x36832f,_0x5d8cf8,_0x32540a,_0x127959,_0x47e169)[_0x02cd('0xf')](function(_0x2fb089){logger[_0x02cd('0x20')]('['+_0x47e169['toUpperCase']()+_0x02cd('0x5c'),_0x2fb089[_0x02cd('0x22')]);logger['info']('['+_0x47e169[_0x02cd('0x13')]()+_0x02cd('0x5d'),_0x2fb089[_0x02cd('0x1c')]);return getEndUser(_0x2fb089,_0x36832f,_0x32540a,_0x127959,_0x1f27a8,_0x47e169);})[_0x02cd('0xf')](function(_0x32944a){logger[_0x02cd('0x20')]('['+_0x47e169[_0x02cd('0x13')]()+_0x02cd('0x5e'),_0x32944a[_0x02cd('0x35')]);logger[_0x02cd('0x20')]('['+_0x47e169[_0x02cd('0x13')]()+_0x02cd('0x5f'),_0x1f27a8[_0x02cd('0x2f')]);return getTicket(_0x32944a,_0x36832f,_0x32540a,_0x127959,_0x1f27a8,_0x4ca71b,_0x47e169);})[_0x02cd('0xf')](function(_0x281e83){logger[_0x02cd('0x20')](util[_0x02cd('0x4b')]('['+_0x47e169[_0x02cd('0x13')]()+_0x02cd('0x60'),_0x4ca71b[_0x02cd('0x3f')],_0x281e83[_0x02cd('0x4a')]));logger[_0x02cd('0x20')](util[_0x02cd('0x4b')]('['+_0x47e169[_0x02cd('0x13')]()+_0x02cd('0x61'),_0x47e169));if(_0x47e169!==_0x02cd('0x51')){logger[_0x02cd('0x20')]('['+_0x47e169[_0x02cd('0x13')]()+']',_0x02cd('0x62'));emit(_0x36832f[_0x02cd('0xc')],_0x5d8cf8[_0x02cd('0x63')],_0x4ca71b[_0x02cd('0x3f')],_0x281e83[_0x02cd('0x4a')]);}})[_0x02cd('0x11')](function(_0x17877b){logger[_0x02cd('0x12')]('['+_0x47e169[_0x02cd('0x13')]()+_0x02cd('0x64'),util[_0x02cd('0x65')](_0x17877b,{'showHidden':!![],'depth':null}));});}; \ 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 8ee91c5..19a864b 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 _0xd05d=['lastevent','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','remoteUri','POST','info','Ticket\x20created!','%s/api/v2/agents','then','length','Agent\x20found!','find','contact','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]','GET','map','forEach','includes','string','type','nameField','customField','toLowerCase','content','toString','picklist','push','idField','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','unmanaged','monitor_format','toUpperCase'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd05d,0x171));var _0xdd05=function(_0xb0194a,_0x352a19){_0xb0194a=_0xb0194a-0x0;var _0x1bd71f=_0xd05d[_0xb0194a];return _0x1bd71f;};'use strict';var _=require('lodash');var rp=require(_0xdd05('0x0'));var md5=require(_0xdd05('0x1'));var util=require(_0xdd05('0x2'));var Redis=require(_0xdd05('0x3'));var intUtil=require(_0xdd05('0x4'));var config=require(_0xdd05('0x5'));var logger=require(_0xdd05('0x6'))('freshdesk');config[_0xdd05('0x7')]=_[_0xdd05('0x8')](config[_0xdd05('0x7')],{'host':_0xdd05('0x9'),'port':0x18eb});var io=require(_0xdd05('0xa'))(new Redis(config[_0xdd05('0x7')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x72956b,_0x750878,_0x508d78){io['to'](_0x72956b)[_0xdd05('0xb')](_0x750878,_0x508d78);}function getTicket(_0x1bd1b4,_0x53ad68,_0x530806,_0x1291ab,_0x113b43){logger['info'](_0xdd05('0xc'));var _0x10261b=_[_0xdd05('0xd')]({'responder_id':_0x53ad68['id'],'requester_id':_0x530806['id'],'name':util[_0xdd05('0xe')]('Caller\x20-\x20%s',_0x113b43[_0xdd05('0xf')]),'phone':_0x113b43[_0xdd05('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xdd05('0x11')](_0x1291ab['Subjects'],_0x113b43,'\x20'),'description':intUtil[_0xdd05('0x11')](_0x1291ab['Descriptions'],_0x113b43,_0xdd05('0x12')),'tags':getTags(_0x1291ab[_0xdd05('0x13')],_0xdd05('0x14'))},getCustomFields(_0x1291ab[_0xdd05('0x15')],_0x113b43));_0x10261b[_0xdd05('0x16')]=_[_0xdd05('0x17')](_[_0xdd05('0x18')](_0x10261b[_0xdd05('0x16')],'id'),_0xdd05('0x19'));return request({'uri':util['format']('%s/api/v2/tickets',_0x1bd1b4[_0xdd05('0x1a')]),'method':_0xdd05('0x1b'),'body':_0x10261b})['then'](function(_0x416af9){logger[_0xdd05('0x1c')](_0xdd05('0x1d'));return _0x416af9;});}function getUser(_0x21ae30,_0x3faed8){if(intUtil['validateEmail'](_0x3faed8)){return request({'uri':util[_0xdd05('0xe')](_0xdd05('0x1e'),_0x21ae30[_0xdd05('0x1a')]),'qs':{'email':_0x3faed8}})[_0xdd05('0x1f')](function(_0x32e759){if(_0x32e759[_0xdd05('0x20')]){logger[_0xdd05('0x1c')](_0xdd05('0x21'));return _[_0xdd05('0x22')](_0x32e759,function(_0x352b96){return _0x352b96[_0xdd05('0x23')][_0xdd05('0x24')]===_0x3faed8;});}else{logger[_0xdd05('0x1c')](_0xdd05('0x25'));return request({'uri':util[_0xdd05('0xe')](_0xdd05('0x26'),_0x21ae30[_0xdd05('0x1a')])})[_0xdd05('0x1f')](function(_0x509493){logger[_0xdd05('0x1c')]('Admin\x20account\x20selected.');return _0x509493;});}});}else{logger[_0xdd05('0x1c')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xdd05('0x26'),_0x21ae30[_0xdd05('0x1a')])})[_0xdd05('0x1f')](function(_0xb2589d){logger[_0xdd05('0x1c')](_0xdd05('0x27'));return _0xb2589d;});}}function getEndUser(_0x2f58ff,_0x1a5404,_0x185495){logger[_0xdd05('0x1c')](_0xdd05('0x28'),_0x185495);return request({'uri':util[_0xdd05('0xe')](_0xdd05('0x29'),_0x2f58ff[_0xdd05('0x1a')]),'qs':{'phone':_0x185495}})['then'](function(_0x1bf270){if(_0x1bf270['length']){logger[_0xdd05('0x1c')](_0xdd05('0x2a'));return _[_0xdd05('0x22')](_0x1bf270,{'phone':_0x185495});}else{logger['info'](_0xdd05('0x2b'));return request({'uri':util[_0xdd05('0xe')](_0xdd05('0x29'),_0x2f58ff[_0xdd05('0x1a')]),'method':_0xdd05('0x1b'),'body':{'name':_0x1a5404,'phone':_0x185495}})['then'](function(_0x5220c9){logger['info']('Enduser\x20created.');return _0x5220c9;});}});}function getAuth(_0x5abcd8){return util['format'](_0xdd05('0x2c'),new Buffer(_0x5abcd8[_0xdd05('0x2d')]+':X')['toString'](_0xdd05('0x2e')));}function request(_0x51d4aa){logger[_0xdd05('0x2f')](_0xdd05('0x30'),JSON['stringify'](_0x51d4aa));return rp(_[_0xdd05('0x8')](_0x51d4aa,{'method':_0xdd05('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x4a5001,_0x31c6c0){var _0x3957fe=[];if(_0x4a5001&&_0x4a5001[_0xdd05('0x20')]>0x0){_0x3957fe=_[_0xdd05('0x32')](_0x4a5001,_0x31c6c0);}return _0x3957fe;}function getCustomFields(_0x3dedb3,_0xfd38e3){var _0x229423=[];var _0x578321={'custom_fields':[]};if(_0x3dedb3[_0xdd05('0x20')]>0x0){_[_0xdd05('0x33')](_0x3dedb3,function(_0x4926fe){if(_[_0xdd05('0x34')]([_0xdd05('0x35'),'picklist'],_0x4926fe[_0xdd05('0x36')])&&_0x4926fe[_0xdd05('0x37')]&&!_0x4926fe[_0xdd05('0x38')]){_0x578321[_0x4926fe[_0xdd05('0x37')][_0xdd05('0x39')]()]=_0x4926fe[_0xdd05('0x3a')][_0xdd05('0x3b')]();}else if(_[_0xdd05('0x34')]([_0xdd05('0x35'),_0xdd05('0x3c')],_0x4926fe[_0xdd05('0x36')])&&_0x4926fe['idField']&&_0x4926fe[_0xdd05('0x38')]){_0x578321[_0xdd05('0x16')][_0xdd05('0x3d')]({'id':_0x4926fe[_0xdd05('0x3e')],'value':_0x4926fe[_0xdd05('0x3a')][_0xdd05('0x3b')]()});}else if(_0x4926fe[_0xdd05('0x36')]===_0xdd05('0x3f')&&_0x4926fe[_0xdd05('0x40')]&&_0x4926fe[_0xdd05('0x3e')]&&_0x4926fe[_0xdd05('0x38')]){_0xfd38e3[_0x4926fe[_0xdd05('0x40')]]&&_0x578321[_0xdd05('0x16')][_0xdd05('0x3d')]({'id':_0x4926fe[_0xdd05('0x3e')],'value':_0xfd38e3[_0x4926fe['variableName']][_0xdd05('0x3b')]()});}else if(_0x4926fe[_0xdd05('0x36')]==='customVariable'&&_0x4926fe[_0xdd05('0x41')]&&_0x4926fe[_0xdd05('0x41')][_0xdd05('0x14')]&&_0x4926fe['idField']&&_0x4926fe['customField']){_0xfd38e3[_0x4926fe[_0xdd05('0x41')][_0xdd05('0x14')][_0xdd05('0x39')]()]&&_0x578321[_0xdd05('0x16')][_0xdd05('0x3d')]({'id':_0x4926fe['idField'],'value':_0xfd38e3[_0x4926fe[_0xdd05('0x41')][_0xdd05('0x14')][_0xdd05('0x39')]()][_0xdd05('0x3b')]()});}});}return _0x578321;}exports[_0xdd05('0x42')]=function(_0x19c705,_0x27fc94,_0xa14724,_0x45f84e,_0x3a3a3e,_0x17c8cf){var _0x5c19cb,_0x5cd2ef;_0x17c8cf[_0xdd05('0x1a')]=intUtil[_0xdd05('0x43')](_0x17c8cf['remoteUri']);_0x17c8cf[_0xdd05('0x44')]=intUtil[_0xdd05('0x43')](_0x17c8cf[_0xdd05('0x44')]);if(_0x3a3a3e&&_0x3a3a3e['monitor_format']){logger[_0xdd05('0x1c')](_0xdd05('0x45'),_0xdd05('0x46'));_0x27fc94['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x17c8cf[_0xdd05('0x44')],_0x27fc94[_0xdd05('0x47')],md5(_0x27fc94[_0xdd05('0x47')]));}else{_0x27fc94[_0xdd05('0x48')]='';}headers[_0xdd05('0x49')]=getAuth(_0x17c8cf);return getUser(_0x17c8cf,_0x45f84e[_0xdd05('0x24')])[_0xdd05('0x1f')](function(_0x6305c8){_0x5c19cb=_0x6305c8;logger[_0xdd05('0x1c')](_0xdd05('0x4a'),_0x5c19cb['id']);return getEndUser(_0x17c8cf,_0x27fc94[_0xdd05('0xf')],_0x27fc94[_0xdd05('0x10')]);})['then'](function(_0x558e34){_0x5cd2ef=_0x558e34;logger[_0xdd05('0x1c')](_0xdd05('0x4b'),_0x5cd2ef['id']);return getTicket(_0x17c8cf,_0x5c19cb,_0x5cd2ef,_0xa14724,_0x27fc94);})['then'](function(_0x271c50){if(_0x271c50&&_0x271c50['id']){logger['info'](_0xdd05('0x1d'));logger[_0xdd05('0x1c')]('The\x20Ticket\x20ID\x20is:',_0x271c50['id']);logger['info'](_0xdd05('0x45'),_0xdd05('0x4c'));emit(util[_0xdd05('0xe')](_0xdd05('0x4d'),_0x45f84e[_0xdd05('0x14')]),_0xdd05('0x4e'),{'uri':util[_0xdd05('0xe')](_0xdd05('0x4f'),_0x17c8cf[_0xdd05('0x1a')],_0x271c50['id'])});}})[_0xdd05('0x50')](function(_0x104d3b){logger[_0xdd05('0x51')](_0xdd05('0x45'),JSON[_0xdd05('0x52')](_0x104d3b));});};exports[_0xdd05('0x53')]=function(_0x1dcab7,_0xa227b5,_0xa71c32,_0x5d576c,_0x5529ef,_0x1fef8b,_0x53ce0c){var _0x5047cc,_0x5eaeb4;_0x1fef8b['remoteUri']=intUtil[_0xdd05('0x43')](_0x1fef8b[_0xdd05('0x1a')]);_0x1fef8b[_0xdd05('0x44')]=intUtil[_0xdd05('0x43')](_0x1fef8b['serverUrl']);if(_0x53ce0c&&_0x53ce0c['recordingFormat']&&_0x53ce0c['recordingFormat']!=='none'){logger[_0xdd05('0x1c')]('[OUTBOUND]',_0xdd05('0x46'));_0xa227b5[_0xdd05('0x48')]=util[_0xdd05('0xe')](_0xdd05('0x54'),_0x1fef8b['serverUrl'],_0xa227b5['uniqueid'],md5(_0xa227b5[_0xdd05('0x47')]));}headers['Authorization']=getAuth(_0x1fef8b);return getUser(_0x1fef8b,_0x5d576c[_0xdd05('0x24')])[_0xdd05('0x1f')](function(_0x3bfed7){_0x5047cc=_0x3bfed7;logger[_0xdd05('0x1c')](_0xdd05('0x4a'),_0x5047cc['id']);return getEndUser(_0x1fef8b,_0xa227b5[_0xdd05('0x55')],_0xa227b5['destcalleridnum']);})[_0xdd05('0x1f')](function(_0x2923f){_0x5eaeb4=_0x2923f;logger[_0xdd05('0x1c')](_0xdd05('0x4b'),_0x5eaeb4['id']);return getTicket(_0x1fef8b,_0x5047cc,_0x5eaeb4,_0xa71c32,_0xa227b5);})[_0xdd05('0x1f')](function(_0x26a63e){if(_0x26a63e&&_0x26a63e['id']){logger['info'](_0xdd05('0x1d'));logger[_0xdd05('0x1c')](_0xdd05('0x56'),_0x26a63e['id']);logger[_0xdd05('0x1c')](_0xdd05('0x57'),_0xdd05('0x4c'));emit(util[_0xdd05('0xe')]('user:%s',_0x5d576c[_0xdd05('0x14')]),_0xdd05('0x4e'),{'uri':util['format'](_0xdd05('0x4f'),_0x1fef8b[_0xdd05('0x1a')],_0x26a63e['id'])});}})[_0xdd05('0x50')](function(_0x35f70a){logger[_0xdd05('0x51')](_0xdd05('0x57'),JSON[_0xdd05('0x52')](_0x35f70a));});};exports[_0xdd05('0x58')]=function(_0x50b422,_0x453962,_0x2d21f0,_0x39d647,_0x1564d9,_0x49b79d){var _0x2244bc,_0x2bc0d4;_0x49b79d[_0xdd05('0x1a')]=intUtil[_0xdd05('0x43')](_0x49b79d[_0xdd05('0x1a')]);_0x49b79d[_0xdd05('0x44')]=intUtil[_0xdd05('0x43')](_0x49b79d['serverUrl']);if(_0x1564d9&&_0x1564d9[_0xdd05('0x59')]){logger[_0xdd05('0x1c')]('['+_0x453962['lastevent'][_0xdd05('0x5a')]()+']',_0xdd05('0x46'));_0x453962[_0xdd05('0x48')]=util[_0xdd05('0xe')](_0xdd05('0x54'),_0x49b79d[_0xdd05('0x44')],_0x453962['uniqueid'],md5(_0x453962['uniqueid']));}else{_0x453962[_0xdd05('0x48')]='';}headers[_0xdd05('0x49')]=getAuth(_0x49b79d);return getUser(_0x49b79d,'')['then'](function(_0x242215){_0x2244bc=_0x242215;logger[_0xdd05('0x1c')](_0xdd05('0x4a'),_0x2244bc['id']);return getEndUser(_0x49b79d,_0x453962['calleridname'],_0x453962['calleridnum']);})[_0xdd05('0x1f')](function(_0x2e113f){_0x2bc0d4=_0x2e113f;logger[_0xdd05('0x1c')]('The\x20Enduser\x20ID\x20is:',_0x2bc0d4['id']);return getTicket(_0x49b79d,_0x2244bc,_0x2bc0d4,_0x2d21f0,_0x453962);})[_0xdd05('0x1f')](function(_0x31b820){if(_0x31b820){logger['info'](_0xdd05('0x1d'));logger[_0xdd05('0x1c')]('The\x20Ticket\x20ID\x20is:',_0x31b820['id']);}})[_0xdd05('0x50')](function(_0x574777){logger[_0xdd05('0x51')]('['+_0x453962[_0xdd05('0x5b')][_0xdd05('0x5a')]()+']',JSON['stringify'](_0x574777));});}; \ No newline at end of file +var _0x1cc6=['toString','debug','[HTTP]','stringify','defaults','GET','map','includes','string','nameField','toLowerCase','content','picklist','type','custom_fields','push','variable','variableName','idField','customVariable','Variable','customField','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','lastevent','toUpperCase','request-promise','md5','util','ioredis','./util','../../../../config/logger','redis','localhost','socket.io-emitter','application/json','emit','info','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','Tags','name','Fields','mapValues','keyBy','value','%s/api/v2/agents','remoteUri','then','length','Agent\x20found!','find','contact','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!','POST','Enduser\x20created.','Basic\x20%s','apiKey'];(function(_0x269fe3,_0x2cdbee){var _0x362b40=function(_0x4e1fc5){while(--_0x4e1fc5){_0x269fe3['push'](_0x269fe3['shift']());}};_0x362b40(++_0x2cdbee);}(_0x1cc6,0x141));var _0x61cc=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1cc6[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var rp=require(_0x61cc('0x0'));var md5=require(_0x61cc('0x1'));var util=require(_0x61cc('0x2'));var Redis=require(_0x61cc('0x3'));var intUtil=require(_0x61cc('0x4'));var config=require('../../../../config/environment');var logger=require(_0x61cc('0x5'))('freshdesk');config[_0x61cc('0x6')]=_['defaults'](config['redis'],{'host':_0x61cc('0x7'),'port':0x18eb});var io=require(_0x61cc('0x8'))(new Redis(config['redis']));var headers={'Content-Type':_0x61cc('0x9'),'Accept':_0x61cc('0x9')};function emit(_0x2a8306,_0x4eca82,_0x272197){io['to'](_0x2a8306)[_0x61cc('0xa')](_0x4eca82,_0x272197);}function getTicket(_0x508981,_0x28922d,_0x51df27,_0x441c3e,_0x2b0c52){logger[_0x61cc('0xb')]('Creating\x20new\x20ticket...');var _0x379ba9=_['merge']({'responder_id':_0x28922d['id'],'requester_id':_0x51df27['id'],'name':util[_0x61cc('0xc')](_0x61cc('0xd'),_0x2b0c52[_0x61cc('0xe')]),'phone':_0x2b0c52[_0x61cc('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x61cc('0x10')](_0x441c3e[_0x61cc('0x11')],_0x2b0c52,'\x20'),'description':intUtil[_0x61cc('0x10')](_0x441c3e[_0x61cc('0x12')],_0x2b0c52,'
'),'tags':getTags(_0x441c3e[_0x61cc('0x13')],_0x61cc('0x14'))},getCustomFields(_0x441c3e[_0x61cc('0x15')],_0x2b0c52));_0x379ba9['custom_fields']=_[_0x61cc('0x16')](_[_0x61cc('0x17')](_0x379ba9['custom_fields'],'id'),_0x61cc('0x18'));return request({'uri':util[_0x61cc('0xc')]('%s/api/v2/tickets',_0x508981['remoteUri']),'method':'POST','body':_0x379ba9})['then'](function(_0x37afb8){logger[_0x61cc('0xb')]('Ticket\x20created!');return _0x37afb8;});}function getUser(_0x431183,_0x3bcc52){if(intUtil['validateEmail'](_0x3bcc52)){return request({'uri':util['format'](_0x61cc('0x19'),_0x431183[_0x61cc('0x1a')]),'qs':{'email':_0x3bcc52}})[_0x61cc('0x1b')](function(_0x45ddc0){if(_0x45ddc0[_0x61cc('0x1c')]){logger[_0x61cc('0xb')](_0x61cc('0x1d'));return _[_0x61cc('0x1e')](_0x45ddc0,function(_0x4006a6){return _0x4006a6[_0x61cc('0x1f')]['email']===_0x3bcc52;});}else{logger[_0x61cc('0xb')](_0x61cc('0x20'));return request({'uri':util[_0x61cc('0xc')](_0x61cc('0x21'),_0x431183['remoteUri'])})['then'](function(_0x35d034){logger[_0x61cc('0xb')](_0x61cc('0x22'));return _0x35d034;});}});}else{logger[_0x61cc('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x61cc('0xc')]('%s/api/v2/agents/me',_0x431183[_0x61cc('0x1a')])})['then'](function(_0x4ca918){logger[_0x61cc('0xb')](_0x61cc('0x22'));return _0x4ca918;});}}function getEndUser(_0x3d4713,_0x2de0a7,_0x499d47){logger[_0x61cc('0xb')](_0x61cc('0x23'),_0x499d47);return request({'uri':util['format'](_0x61cc('0x24'),_0x3d4713[_0x61cc('0x1a')]),'qs':{'phone':_0x499d47}})[_0x61cc('0x1b')](function(_0x273446){if(_0x273446[_0x61cc('0x1c')]){logger[_0x61cc('0xb')](_0x61cc('0x25'));return _[_0x61cc('0x1e')](_0x273446,{'phone':_0x499d47});}else{logger['info'](_0x61cc('0x26'));return request({'uri':util[_0x61cc('0xc')](_0x61cc('0x24'),_0x3d4713['remoteUri']),'method':_0x61cc('0x27'),'body':{'name':_0x2de0a7,'phone':_0x499d47}})['then'](function(_0x1421df){logger[_0x61cc('0xb')](_0x61cc('0x28'));return _0x1421df;});}});}function getAuth(_0x46f598){return util[_0x61cc('0xc')](_0x61cc('0x29'),new Buffer(_0x46f598[_0x61cc('0x2a')]+':X')[_0x61cc('0x2b')]('base64'));}function request(_0x4a5e02){logger[_0x61cc('0x2c')](_0x61cc('0x2d'),JSON[_0x61cc('0x2e')](_0x4a5e02));return rp(_[_0x61cc('0x2f')](_0x4a5e02,{'method':_0x61cc('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x3656bb,_0x22db1b){var _0x4e80d7=[];if(_0x3656bb&&_0x3656bb[_0x61cc('0x1c')]>0x0){_0x4e80d7=_[_0x61cc('0x31')](_0x3656bb,_0x22db1b);}return _0x4e80d7;}function getCustomFields(_0x2441d4,_0x4feeb4){var _0x4f119b=[];var _0x380780={'custom_fields':[]};if(_0x2441d4[_0x61cc('0x1c')]>0x0){_['forEach'](_0x2441d4,function(_0x42ff6c){if(_[_0x61cc('0x32')]([_0x61cc('0x33'),'picklist'],_0x42ff6c['type'])&&_0x42ff6c[_0x61cc('0x34')]&&!_0x42ff6c['customField']){_0x380780[_0x42ff6c[_0x61cc('0x34')][_0x61cc('0x35')]()]=_0x42ff6c[_0x61cc('0x36')][_0x61cc('0x2b')]();}else if(_[_0x61cc('0x32')]([_0x61cc('0x33'),_0x61cc('0x37')],_0x42ff6c[_0x61cc('0x38')])&&_0x42ff6c['idField']&&_0x42ff6c['customField']){_0x380780[_0x61cc('0x39')][_0x61cc('0x3a')]({'id':_0x42ff6c['idField'],'value':_0x42ff6c[_0x61cc('0x36')][_0x61cc('0x2b')]()});}else if(_0x42ff6c['type']===_0x61cc('0x3b')&&_0x42ff6c[_0x61cc('0x3c')]&&_0x42ff6c[_0x61cc('0x3d')]&&_0x42ff6c['customField']){_0x4feeb4[_0x42ff6c[_0x61cc('0x3c')]]&&_0x380780['custom_fields'][_0x61cc('0x3a')]({'id':_0x42ff6c[_0x61cc('0x3d')],'value':_0x4feeb4[_0x42ff6c[_0x61cc('0x3c')]][_0x61cc('0x2b')]()});}else if(_0x42ff6c[_0x61cc('0x38')]===_0x61cc('0x3e')&&_0x42ff6c['Variable']&&_0x42ff6c[_0x61cc('0x3f')][_0x61cc('0x14')]&&_0x42ff6c['idField']&&_0x42ff6c[_0x61cc('0x40')]){_0x4feeb4[_0x42ff6c[_0x61cc('0x3f')][_0x61cc('0x14')]['toLowerCase']()]&&_0x380780['custom_fields'][_0x61cc('0x3a')]({'id':_0x42ff6c[_0x61cc('0x3d')],'value':_0x4feeb4[_0x42ff6c['Variable'][_0x61cc('0x14')][_0x61cc('0x35')]()]['toString']()});}});}return _0x380780;}exports['queue']=function(_0x50e2e8,_0x3c0983,_0x436d5a,_0x65f06,_0x2292f0,_0xb90493){var _0x9875a,_0x3c4bdb;_0xb90493[_0x61cc('0x1a')]=intUtil[_0x61cc('0x41')](_0xb90493['remoteUri']);_0xb90493[_0x61cc('0x42')]=intUtil[_0x61cc('0x41')](_0xb90493['serverUrl']);if(_0x2292f0&&_0x2292f0[_0x61cc('0x43')]){logger[_0x61cc('0xb')](_0x61cc('0x44'),'Recording\x20is\x20enabled!');_0x3c0983[_0x61cc('0x45')]=util[_0x61cc('0xc')](_0x61cc('0x46'),_0xb90493['serverUrl'],_0x3c0983[_0x61cc('0x47')],md5(_0x3c0983[_0x61cc('0x47')]));}else{_0x3c0983[_0x61cc('0x45')]='';}headers[_0x61cc('0x48')]=getAuth(_0xb90493);return getUser(_0xb90493,_0x65f06[_0x61cc('0x49')])[_0x61cc('0x1b')](function(_0x5d6e6d){_0x9875a=_0x5d6e6d;logger[_0x61cc('0xb')](_0x61cc('0x4a'),_0x9875a['id']);return getEndUser(_0xb90493,_0x3c0983['calleridname'],_0x3c0983[_0x61cc('0xf')]);})[_0x61cc('0x1b')](function(_0x24b3e7){_0x3c4bdb=_0x24b3e7;logger[_0x61cc('0xb')](_0x61cc('0x4b'),_0x3c4bdb['id']);return getTicket(_0xb90493,_0x9875a,_0x3c4bdb,_0x436d5a,_0x3c0983);})[_0x61cc('0x1b')](function(_0x3b91b3){if(_0x3b91b3&&_0x3b91b3['id']){logger[_0x61cc('0xb')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x3b91b3['id']);logger[_0x61cc('0xb')]('[QUEUE]',_0x61cc('0x4c'));emit(util[_0x61cc('0xc')]('user:%s',_0x65f06[_0x61cc('0x14')]),_0x61cc('0x4d'),{'uri':util['format'](_0x61cc('0x4e'),_0xb90493['remoteUri'],_0x3b91b3['id'])});}})[_0x61cc('0x4f')](function(_0x38ea2b){logger[_0x61cc('0x50')](_0x61cc('0x44'),JSON[_0x61cc('0x2e')](_0x38ea2b));});};exports['outbound']=function(_0x3367c1,_0x3ca08c,_0x45bd97,_0x4429af,_0x129941,_0x539212,_0x527f0f){var _0x36e7fc,_0x26d45f;_0x539212[_0x61cc('0x1a')]=intUtil[_0x61cc('0x41')](_0x539212['remoteUri']);_0x539212[_0x61cc('0x42')]=intUtil[_0x61cc('0x41')](_0x539212['serverUrl']);if(_0x527f0f&&_0x527f0f[_0x61cc('0x51')]&&_0x527f0f[_0x61cc('0x51')]!==_0x61cc('0x52')){logger[_0x61cc('0xb')](_0x61cc('0x53'),_0x61cc('0x54'));_0x3ca08c[_0x61cc('0x45')]=util[_0x61cc('0xc')](_0x61cc('0x46'),_0x539212[_0x61cc('0x42')],_0x3ca08c[_0x61cc('0x47')],md5(_0x3ca08c['uniqueid']));}headers['Authorization']=getAuth(_0x539212);return getUser(_0x539212,_0x4429af[_0x61cc('0x49')])[_0x61cc('0x1b')](function(_0x28511a){_0x36e7fc=_0x28511a;logger[_0x61cc('0xb')](_0x61cc('0x4a'),_0x36e7fc['id']);return getEndUser(_0x539212,_0x3ca08c[_0x61cc('0x55')],_0x3ca08c[_0x61cc('0x56')]);})[_0x61cc('0x1b')](function(_0xe3a91c){_0x26d45f=_0xe3a91c;logger[_0x61cc('0xb')](_0x61cc('0x4b'),_0x26d45f['id']);return getTicket(_0x539212,_0x36e7fc,_0x26d45f,_0x45bd97,_0x3ca08c);})[_0x61cc('0x1b')](function(_0x16b4a3){if(_0x16b4a3&&_0x16b4a3['id']){logger[_0x61cc('0xb')](_0x61cc('0x57'));logger['info'](_0x61cc('0x58'),_0x16b4a3['id']);logger[_0x61cc('0xb')](_0x61cc('0x53'),_0x61cc('0x4c'));emit(util['format']('user:%s',_0x4429af[_0x61cc('0x14')]),_0x61cc('0x4d'),{'uri':util[_0x61cc('0xc')]('%s/helpdesk/tickets/%d',_0x539212[_0x61cc('0x1a')],_0x16b4a3['id'])});}})['catch'](function(_0x50ab53){logger[_0x61cc('0x50')]('[OUTBOUND]',JSON[_0x61cc('0x2e')](_0x50ab53));});};exports['unmanaged']=function(_0x415635,_0x27f46a,_0x562a77,_0x517a27,_0x5d5485,_0x24317c){var _0x314efa,_0x4101f8;_0x24317c[_0x61cc('0x1a')]=intUtil['stripTrailingSlash'](_0x24317c[_0x61cc('0x1a')]);_0x24317c[_0x61cc('0x42')]=intUtil[_0x61cc('0x41')](_0x24317c[_0x61cc('0x42')]);if(_0x5d5485&&_0x5d5485['monitor_format']){logger[_0x61cc('0xb')]('['+_0x27f46a[_0x61cc('0x59')][_0x61cc('0x5a')]()+']',_0x61cc('0x54'));_0x27f46a['recordingURL']=util[_0x61cc('0xc')](_0x61cc('0x46'),_0x24317c[_0x61cc('0x42')],_0x27f46a[_0x61cc('0x47')],md5(_0x27f46a[_0x61cc('0x47')]));}else{_0x27f46a[_0x61cc('0x45')]='';}headers[_0x61cc('0x48')]=getAuth(_0x24317c);return getUser(_0x24317c,'')[_0x61cc('0x1b')](function(_0x2cdcf2){_0x314efa=_0x2cdcf2;logger[_0x61cc('0xb')](_0x61cc('0x4a'),_0x314efa['id']);return getEndUser(_0x24317c,_0x27f46a['calleridname'],_0x27f46a['calleridnum']);})[_0x61cc('0x1b')](function(_0x14d1c6){_0x4101f8=_0x14d1c6;logger[_0x61cc('0xb')]('The\x20Enduser\x20ID\x20is:',_0x4101f8['id']);return getTicket(_0x24317c,_0x314efa,_0x4101f8,_0x562a77,_0x27f46a);})[_0x61cc('0x1b')](function(_0x2867ad){if(_0x2867ad){logger['info'](_0x61cc('0x57'));logger['info'](_0x61cc('0x58'),_0x2867ad['id']);}})['catch'](function(_0x3bfa88){logger[_0x61cc('0x50')]('['+_0x27f46a[_0x61cc('0x59')]['toUpperCase']()+']',JSON['stringify'](_0x3bfa88));});}; \ 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 18713f0..cca0035 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 _0x1baf=['Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','catch','toUpperCase','/api/lookup?q=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','headers','/api/tasks','getString','Subjects','Descriptions','Contact','add','Task\x20created:','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','outbound','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','util','moment','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','socket.io-emitter','GET','info','Getting\x20admin\x20information','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','error','message','/api/selector/owners','Getting\x20user\x20list','then'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x1baf,0x1df));var _0xf1ba=function(_0x2c2ed0,_0x58edfa){_0x2c2ed0=_0x2c2ed0-0x0;var _0x3a5208=_0x1baf[_0x2c2ed0];return _0x3a5208;};'use strict';var _=require('lodash');var rp=require(_0xf1ba('0x0'));var md5=require('md5');var util=require(_0xf1ba('0x1'));var moment=require(_0xf1ba('0x2'));var Promise=require('bluebird');var Redis=require(_0xf1ba('0x3'));var intUtil=require(_0xf1ba('0x4'));var config=require(_0xf1ba('0x5'));var logger=require(_0xf1ba('0x6'))(_0xf1ba('0x7'));config[_0xf1ba('0x8')]=_[_0xf1ba('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf1ba('0xa'))(new Redis(config['redis']));function getAdminId(_0x20082a,_0x2b573c,_0x55d2b9,_0x4e5195){return new Promise(function(_0x57a865,_0x41746d){var _0x41eb09=![];var _0x5881ee={'method':_0xf1ba('0xb'),'uri':_0x4e5195+'/api/selector/owners','json':!![]};_0x5881ee['headers']=_0x55d2b9;logger[_0xf1ba('0xc')](_0xf1ba('0xd'));return rp(_0x5881ee)['then'](function(_0x56231f){if(_0x56231f){var _0x47cd6a=_0x56231f[_0xf1ba('0xe')];var _0x4e5389=null;for(_0x4e5389=0x0;_0x4e5389<_0x47cd6a[_0xf1ba('0xf')];_0x4e5389++){if(_0x47cd6a[_0x4e5389][_0xf1ba('0x10')]===_0x20082a[_0xf1ba('0x11')]){_0x20082a[_0xf1ba('0x12')]=_0x47cd6a[_0x4e5389]['id'];_0x41eb09=!![];}}if(_0x41eb09){logger['info']('Admin\x20found:',_0x20082a['adminId']);_0x57a865(_0x20082a);}else{_0x41746d({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x41746d({'statusCode':0x194,'message':_0xf1ba('0x13')});}})['catch'](function(_0x1f5e28){logger[_0xf1ba('0x14')]('['+[_0x2b573c['toUpperCase']()]+']',_0x1f5e28[_0xf1ba('0x15')]);_0x41746d(_0x1f5e28);});});}function getUser(_0xd40099,_0x4e7c0c,_0xd3a4fd){return function(_0x1988fc){return new Promise(function(_0x45c995,_0x28da9b){var _0x3b8bdf={'method':_0xf1ba('0xb'),'uri':_0xd3a4fd+_0xf1ba('0x16'),'json':!![]};_0x3b8bdf['headers']=_0x4e7c0c;logger['info'](_0xf1ba('0x17'));return rp(_0x3b8bdf)[_0xf1ba('0x18')](function(_0x7fd78a){if(_0x7fd78a){var _0x67f173=_0x7fd78a['users'];var _0x212042=![];var _0x3ec3bf=null;if(_0x1988fc['agentEmail']!==null){logger[_0xf1ba('0xc')](_0xf1ba('0x19'),_0x1988fc[_0xf1ba('0x1a')]);_0x1988fc[_0xf1ba('0x1b')]=_0x1988fc[_0xf1ba('0x1a')];for(_0x3ec3bf=0x0;_0x3ec3bf<_0x67f173[_0xf1ba('0xf')];_0x3ec3bf++){if(_0x67f173[_0x3ec3bf][_0xf1ba('0x10')]===_0x1988fc[_0xf1ba('0x1a')]){_0x212042=!![];_0x1988fc[_0xf1ba('0x1c')]=_0x67f173[_0x3ec3bf]['id'];logger['info'](_0xf1ba('0x1d'),_0x1988fc[_0xf1ba('0x1c')]);}}}if(!_0x212042){logger[_0xf1ba('0xc')](_0xf1ba('0x1e'));_0x1988fc[_0xf1ba('0x1b')]=_0x1988fc[_0xf1ba('0x11')];_0x1988fc['userId']=_0x1988fc[_0xf1ba('0x12')];_0x212042=!![];}if(_0x212042){_0x45c995(_0x1988fc);}else{_0x28da9b({'statusCode':0x194,'message':_0xf1ba('0x13')});}}else{_0x28da9b({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xf1ba('0x1f')](function(_0x1fee6e){logger[_0xf1ba('0x14')]('['+[_0xd40099[_0xf1ba('0x20')]()]+']',_0x1fee6e['message']);_0x28da9b(_0x1fee6e);});});};}function searchContact(_0x2c5592,_0x3174d2,_0x1c1442,_0x3f0c3b){return new Promise(function(_0x52ff74,_0x39b987){var _0x3d36a0={'method':_0xf1ba('0xb'),'headers':_0x3174d2,'uri':_0x2c5592+_0xf1ba('0x21')+_0x3f0c3b+'&f='+_0x1c1442+'&entities=contact','json':!![]};rp(_0x3d36a0)[_0xf1ba('0x18')](function(_0x284f31){var _0x5f4cc8=_[_0xf1ba('0x22')](_0x284f31[_0xf1ba('0x23')][_0xf1ba('0x23')],[_0x1c1442,_0x3f0c3b]);_0x52ff74(_0x5f4cc8);})[_0xf1ba('0x1f')](function(_0x51b89c){_0x39b987(_0x51b89c);});});}function getEndUser(_0x56d045,_0x246d5f,_0x4bedbd){return function(_0x4df033){return new Promise(function(_0x5f2721,_0x32efed){logger['info'](util[_0xf1ba('0x24')](_0xf1ba('0x25'),_0x4df033[_0xf1ba('0x26')]));searchContact(_0x4bedbd,_0x246d5f,_0xf1ba('0x27'),_0x4df033[_0xf1ba('0x26')])[_0xf1ba('0x18')](function(_0x4c86b5){if(_0x4c86b5){_0x4df033[_0xf1ba('0x28')]=_0x4c86b5['id'];logger[_0xf1ba('0xc')](_0xf1ba('0x29'),_0x4df033[_0xf1ba('0x28')]);return _0x5f2721(_0x4df033);}searchContact(_0x4bedbd,_0x246d5f,_0xf1ba('0x2a'),_0x4df033['contactNumber'])[_0xf1ba('0x18')](function(_0x333bdf){if(_0x333bdf){_0x4df033[_0xf1ba('0x28')]=_0x333bdf['id'];logger[_0xf1ba('0xc')](_0xf1ba('0x2b'),_0x4df033[_0xf1ba('0x28')]);return _0x5f2721(_0x4df033);}createEndUser(_0x4df033,_0x56d045,_0x246d5f,_0x4bedbd)[_0xf1ba('0x18')](function(_0x36ce4c){logger[_0xf1ba('0xc')](_0xf1ba('0x2c'),_0x36ce4c[_0xf1ba('0x28')]);return _0x5f2721(_0x36ce4c);});});})[_0xf1ba('0x1f')](function(_0x53e80d){_0x32efed(_0x53e80d);});});};}function createEndUser(_0x5dc053,_0x15bb8d,_0x5896b8,_0x162795){return new Promise(function(_0xbe6762,_0x581497){var _0x58dcdc=moment();var _0x45b494={'method':_0xf1ba('0x2d'),'uri':_0x162795+'/api/contacts','body':{'contact':{'last_name':_0x5dc053[_0xf1ba('0x26')],'work_number':_0x5dc053['contactNumber'],'mobile_number':_0x5dc053[_0xf1ba('0x26')],'owner_id':_0x5dc053[_0xf1ba('0x1c')],'created_at':_0x58dcdc[_0xf1ba('0x24')](_0xf1ba('0x2e'))}},'json':!![]};_0x45b494[_0xf1ba('0x2f')]=_0x5896b8;logger['info']('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x45b494)[_0xf1ba('0x18')](function(_0x7ff322){_0x5dc053[_0xf1ba('0x28')]=_0x7ff322['contact']['id'];_0xbe6762(_0x5dc053);})[_0xf1ba('0x1f')](function(_0xe44504){logger[_0xf1ba('0x14')]('['+[_0x15bb8d['toUpperCase']()]+']',_0xe44504[_0xf1ba('0x15')]);_0x581497(_0xe44504[_0xf1ba('0x15')]);});});}function getTicket(_0x4f4792,_0x28486a,_0x5a7cde,_0x2012d8,_0x465d00){return function(_0x2cbd3e){logger[_0xf1ba('0xc')]('Creating\x20new\x20task');return new Promise(function(_0xe9dac0,_0x1e9e2c){var _0x2203c2=moment();var _0x2043a7={'method':_0xf1ba('0x2d'),'uri':_0x5a7cde+_0xf1ba('0x30'),'body':{'title':intUtil[_0xf1ba('0x31')](_0x2012d8[_0xf1ba('0x32')],_0x465d00,'\x20'),'description':intUtil[_0xf1ba('0x31')](_0x2012d8[_0xf1ba('0x33')],_0x465d00,'\x0a'),'owner_id':_0x2cbd3e[_0xf1ba('0x1c')],'creater_id':_0x2cbd3e[_0xf1ba('0x12')],'targetable_id':_0x2cbd3e['endUserId'],'targetable_type':_0xf1ba('0x34'),'created_at':_0x2203c2[_0xf1ba('0x24')](_0xf1ba('0x2e')),'due_date':_0x2203c2[_0xf1ba('0x35')](0x1e,'m')[_0xf1ba('0x24')](_0xf1ba('0x2e'))},'json':!![]};_0x2043a7[_0xf1ba('0x2f')]=_0x28486a;return rp(_0x2043a7)['then'](function(_0x41c786){_0x2cbd3e['ticketId']=_0x41c786['task']['id'];logger['info'](_0xf1ba('0x36'),_0x2cbd3e[_0xf1ba('0x37')]);_0xe9dac0(_0x2cbd3e);})[_0xf1ba('0x1f')](function(_0x311c20){logger[_0xf1ba('0x14')]('['+[_0x4f4792[_0xf1ba('0x20')]()]+']',_0x311c20[_0xf1ba('0x15')]);_0x1e9e2c(_0x311c20[_0xf1ba('0x15')]);});});};}function emit(_0x1f6dc7,_0x504066,_0x16e977){var _0x52c0ec={'uri':_0x1f6dc7+_0xf1ba('0x38')+_0x16e977};io['to'](util[_0xf1ba('0x24')](_0xf1ba('0x39'),_0x504066))[_0xf1ba('0x3a')](_0xf1ba('0x3b'),_0x52c0ec);}exports['cs']=function(_0x3850df,_0x400dad,_0x58589e,_0x457dec,_0x2f184a,_0x1dcb55,_0x4dc5f9,_0xdef81c){var _0x1173b5={};var _0xc932b9={'Authorization':_0xf1ba('0x3c')+_0x1dcb55[_0xf1ba('0x3d')]};_0x1dcb55['remoteUri']=intUtil['stripTrailingSlash'](_0x1dcb55[_0xf1ba('0x3e')]);_0x1dcb55[_0xf1ba('0x3f')]=intUtil[_0xf1ba('0x40')](_0x1dcb55[_0xf1ba('0x3f')]);var _0x568403=_0x1dcb55[_0xf1ba('0x3e')];_0x1173b5[_0xf1ba('0x11')]=_0x1dcb55[_0xf1ba('0x41')];_0x1173b5[_0xf1ba('0x26')]=_0xdef81c['toLowerCase']()===_0xf1ba('0x42')?_0x400dad['destcalleridnum']:_0x400dad[_0xf1ba('0x43')];_0x1173b5[_0xf1ba('0x44')]=_0xdef81c===_0xf1ba('0x45')||_0xdef81c===_0xf1ba('0x46')?'queue':'outbound';if(_0x457dec){_0x1173b5['agentEmail']=_0x457dec['email'];}var _0x4d7046=util[_0xf1ba('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1dcb55[_0xf1ba('0x3f')],_0x400dad['uniqueid'],md5(_0x400dad[_0xf1ba('0x47')]));if(_0x2f184a&&_0x2f184a[_0xf1ba('0x48')]){logger[_0xf1ba('0xc')](_0xf1ba('0x49'),_0xf1ba('0x4a'));_0x400dad['recordingURL']=_0x4d7046;}else if(_0x4dc5f9&&_0x4dc5f9['recordingFormat']&&_0x4dc5f9[_0xf1ba('0x4b')]!==_0xf1ba('0x4c')){logger['info'](_0xf1ba('0x4d'),_0xf1ba('0x4a'));_0x400dad[_0xf1ba('0x4e')]=_0x4d7046;}else{_0x400dad[_0xf1ba('0x4e')]='';}return getAdminId(_0x1173b5,_0xdef81c,_0xc932b9,_0x568403)[_0xf1ba('0x18')](getUser(_0xdef81c,_0xc932b9,_0x568403))[_0xf1ba('0x18')](getEndUser(_0xdef81c,_0xc932b9,_0x568403))[_0xf1ba('0x18')](getTicket(_0xdef81c,_0xc932b9,_0x568403,_0x58589e,_0x400dad))['then'](function(_0x560fa0){logger['info'](util[_0xf1ba('0x24')](_0xf1ba('0x4f'),_0x560fa0[_0xf1ba('0x37')]));if(_0xdef81c!==_0xf1ba('0x46')){logger['info']('['+[_0xdef81c[_0xf1ba('0x20')]()]+']',_0xf1ba('0x50'));emit(_0x568403,_0x457dec[_0xf1ba('0x51')],_0x560fa0[_0xf1ba('0x28')]);}})[_0xf1ba('0x1f')](function(_0x53ae05){logger[_0xf1ba('0x14')]('['+[_0xdef81c[_0xf1ba('0x20')]()]+_0xf1ba('0x52'),util[_0xf1ba('0x53')](_0x53ae05,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xded5=['message','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','email','userId','User\x20found:','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','endUserId','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','emit','Token\x20token=','apiKey','remoteUri','serverUrl','username','outbound','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','md5','util','moment','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase'];(function(_0x165b5f,_0x47a9ba){var _0xf2c825=function(_0x2334d7){while(--_0x2334d7){_0x165b5f['push'](_0x165b5f['shift']());}};_0xf2c825(++_0x47a9ba);}(_0xded5,0x188));var _0x5ded=function(_0x3b1b1e,_0x298617){_0x3b1b1e=_0x3b1b1e-0x0;var _0x5d2686=_0xded5[_0x3b1b1e];return _0x5d2686;};'use strict';var _=require(_0x5ded('0x0'));var rp=require(_0x5ded('0x1'));var md5=require(_0x5ded('0x2'));var util=require(_0x5ded('0x3'));var moment=require(_0x5ded('0x4'));var Promise=require('bluebird');var Redis=require(_0x5ded('0x5'));var intUtil=require(_0x5ded('0x6'));var config=require(_0x5ded('0x7'));var logger=require('../../../../config/logger')(_0x5ded('0x8'));config[_0x5ded('0x9')]=_[_0x5ded('0xa')](config['redis'],{'host':_0x5ded('0xb'),'port':0x18eb});var io=require(_0x5ded('0xc'))(new Redis(config['redis']));function getAdminId(_0x1103b7,_0x5e70e4,_0x4041fc,_0x3ffb11){return new Promise(function(_0x2fa3db,_0x2d834d){var _0xd2a5b5=![];var _0x442358={'method':_0x5ded('0xd'),'uri':_0x3ffb11+_0x5ded('0xe'),'json':!![]};_0x442358[_0x5ded('0xf')]=_0x4041fc;logger[_0x5ded('0x10')](_0x5ded('0x11'));return rp(_0x442358)[_0x5ded('0x12')](function(_0xac7865){if(_0xac7865){var _0x195aac=_0xac7865[_0x5ded('0x13')];var _0x4b8793=null;for(_0x4b8793=0x0;_0x4b8793<_0x195aac[_0x5ded('0x14')];_0x4b8793++){if(_0x195aac[_0x4b8793]['email']===_0x1103b7[_0x5ded('0x15')]){_0x1103b7[_0x5ded('0x16')]=_0x195aac[_0x4b8793]['id'];_0xd2a5b5=!![];}}if(_0xd2a5b5){logger[_0x5ded('0x10')](_0x5ded('0x17'),_0x1103b7[_0x5ded('0x16')]);_0x2fa3db(_0x1103b7);}else{_0x2d834d({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x2d834d({'statusCode':0x194,'message':_0x5ded('0x18')});}})[_0x5ded('0x19')](function(_0x59fe09){logger[_0x5ded('0x1a')]('['+[_0x5e70e4[_0x5ded('0x1b')]()]+']',_0x59fe09[_0x5ded('0x1c')]);_0x2d834d(_0x59fe09);});});}function getUser(_0x1ad0e4,_0x548918,_0x545af6){return function(_0xa08927){return new Promise(function(_0x16d3f2,_0x2f88f6){var _0x1ff693={'method':_0x5ded('0xd'),'uri':_0x545af6+_0x5ded('0xe'),'json':!![]};_0x1ff693[_0x5ded('0xf')]=_0x548918;logger[_0x5ded('0x10')](_0x5ded('0x1d'));return rp(_0x1ff693)[_0x5ded('0x12')](function(_0x408592){if(_0x408592){var _0x11876c=_0x408592[_0x5ded('0x13')];var _0xe140c7=![];var _0x1fabac=null;if(_0xa08927['agentEmail']!==null){logger[_0x5ded('0x10')](_0x5ded('0x1e'),_0xa08927[_0x5ded('0x1f')]);_0xa08927['userEmail']=_0xa08927['agentEmail'];for(_0x1fabac=0x0;_0x1fabac<_0x11876c[_0x5ded('0x14')];_0x1fabac++){if(_0x11876c[_0x1fabac][_0x5ded('0x20')]===_0xa08927[_0x5ded('0x1f')]){_0xe140c7=!![];_0xa08927[_0x5ded('0x21')]=_0x11876c[_0x1fabac]['id'];logger[_0x5ded('0x10')](_0x5ded('0x22'),_0xa08927[_0x5ded('0x21')]);}}}if(!_0xe140c7){logger[_0x5ded('0x10')]('Admin\x20selected');_0xa08927['userEmail']=_0xa08927['adminEmail'];_0xa08927[_0x5ded('0x21')]=_0xa08927[_0x5ded('0x16')];_0xe140c7=!![];}if(_0xe140c7){_0x16d3f2(_0xa08927);}else{_0x2f88f6({'statusCode':0x194,'message':_0x5ded('0x18')});}}else{_0x2f88f6({'statusCode':0x194,'message':_0x5ded('0x18')});}})[_0x5ded('0x19')](function(_0x2cb5c9){logger['error']('['+[_0x1ad0e4[_0x5ded('0x1b')]()]+']',_0x2cb5c9[_0x5ded('0x1c')]);_0x2f88f6(_0x2cb5c9);});});};}function searchContact(_0x52e29d,_0x2f8efe,_0x510e99,_0x5672a2){return new Promise(function(_0xab43b0,_0xf25fd1){var _0x540a71={'method':_0x5ded('0xd'),'headers':_0x2f8efe,'uri':_0x52e29d+'/api/lookup?q='+_0x5672a2+_0x5ded('0x23')+_0x510e99+_0x5ded('0x24'),'json':!![]};rp(_0x540a71)[_0x5ded('0x12')](function(_0x3a5454){var _0x46a43f=_[_0x5ded('0x25')](_0x3a5454[_0x5ded('0x26')][_0x5ded('0x26')],[_0x510e99,_0x5672a2]);_0xab43b0(_0x46a43f);})[_0x5ded('0x19')](function(_0x34c6db){_0xf25fd1(_0x34c6db);});});}function getEndUser(_0x4a6e1d,_0x5b6d6d,_0x592d8f){return function(_0xfd70c3){return new Promise(function(_0x5d6923,_0x51b65d){logger[_0x5ded('0x10')](util[_0x5ded('0x27')](_0x5ded('0x28'),_0xfd70c3[_0x5ded('0x29')]));searchContact(_0x592d8f,_0x5b6d6d,'mobile_number',_0xfd70c3[_0x5ded('0x29')])[_0x5ded('0x12')](function(_0x1186dc){if(_0x1186dc){_0xfd70c3['endUserId']=_0x1186dc['id'];logger[_0x5ded('0x10')](_0x5ded('0x2a'),_0xfd70c3['endUserId']);return _0x5d6923(_0xfd70c3);}searchContact(_0x592d8f,_0x5b6d6d,_0x5ded('0x2b'),_0xfd70c3[_0x5ded('0x29')])['then'](function(_0x58c0f2){if(_0x58c0f2){_0xfd70c3['endUserId']=_0x58c0f2['id'];logger[_0x5ded('0x10')](_0x5ded('0x2c'),_0xfd70c3[_0x5ded('0x2d')]);return _0x5d6923(_0xfd70c3);}createEndUser(_0xfd70c3,_0x4a6e1d,_0x5b6d6d,_0x592d8f)[_0x5ded('0x12')](function(_0x5ad0cf){logger[_0x5ded('0x10')](_0x5ded('0x2e'),_0x5ad0cf[_0x5ded('0x2d')]);return _0x5d6923(_0x5ad0cf);});});})[_0x5ded('0x19')](function(_0x1b056b){_0x51b65d(_0x1b056b);});});};}function createEndUser(_0x27dc23,_0xf68fe,_0x134bda,_0x53d9e8){return new Promise(function(_0x117677,_0x2ed6dd){var _0x2a8274=moment();var _0x40a74d={'method':'POST','uri':_0x53d9e8+_0x5ded('0x2f'),'body':{'contact':{'last_name':_0x27dc23[_0x5ded('0x29')],'work_number':_0x27dc23[_0x5ded('0x29')],'mobile_number':_0x27dc23[_0x5ded('0x29')],'owner_id':_0x27dc23[_0x5ded('0x21')],'created_at':_0x2a8274[_0x5ded('0x27')](_0x5ded('0x30'))}},'json':!![]};_0x40a74d[_0x5ded('0xf')]=_0x134bda;logger[_0x5ded('0x10')](_0x5ded('0x31'));return rp(_0x40a74d)['then'](function(_0x34bd94){_0x27dc23[_0x5ded('0x2d')]=_0x34bd94['contact']['id'];_0x117677(_0x27dc23);})['catch'](function(_0x3638f6){logger[_0x5ded('0x1a')]('['+[_0xf68fe[_0x5ded('0x1b')]()]+']',_0x3638f6[_0x5ded('0x1c')]);_0x2ed6dd(_0x3638f6['message']);});});}function getTicket(_0x94002d,_0x5b23d8,_0x23283d,_0x210520,_0x194d36){return function(_0x596999){logger['info'](_0x5ded('0x32'));return new Promise(function(_0x1cc794,_0x486a73){var _0x4d93eb=moment();var _0x341ab6={'method':_0x5ded('0x33'),'uri':_0x23283d+_0x5ded('0x34'),'body':{'title':intUtil[_0x5ded('0x35')](_0x210520[_0x5ded('0x36')],_0x194d36,'\x20'),'description':intUtil['getString'](_0x210520[_0x5ded('0x37')],_0x194d36,'\x0a'),'owner_id':_0x596999[_0x5ded('0x21')],'creater_id':_0x596999[_0x5ded('0x16')],'targetable_id':_0x596999['endUserId'],'targetable_type':_0x5ded('0x38'),'created_at':_0x4d93eb[_0x5ded('0x27')](_0x5ded('0x30')),'due_date':_0x4d93eb[_0x5ded('0x39')](0x1e,'m')[_0x5ded('0x27')](_0x5ded('0x30'))},'json':!![]};_0x341ab6[_0x5ded('0xf')]=_0x5b23d8;return rp(_0x341ab6)[_0x5ded('0x12')](function(_0xb5fe56){_0x596999[_0x5ded('0x3a')]=_0xb5fe56[_0x5ded('0x3b')]['id'];logger['info']('Task\x20created:',_0x596999[_0x5ded('0x3a')]);_0x1cc794(_0x596999);})[_0x5ded('0x19')](function(_0x24aea2){logger['error']('['+[_0x94002d[_0x5ded('0x1b')]()]+']',_0x24aea2[_0x5ded('0x1c')]);_0x486a73(_0x24aea2[_0x5ded('0x1c')]);});});};}function emit(_0x31ecba,_0x1a626b,_0x2ad2a1){var _0xc0bf6f={'uri':_0x31ecba+'/contacts/'+_0x2ad2a1};io['to'](util[_0x5ded('0x27')]('user:%s',_0x1a626b))[_0x5ded('0x3c')]('trigger:browser:url',_0xc0bf6f);}exports['cs']=function(_0x79cd7f,_0x372b63,_0x57b78c,_0x4112df,_0x256ce2,_0x3b916c,_0x25f5e6,_0x386074){var _0x2331c3={};var _0x4cc42a={'Authorization':_0x5ded('0x3d')+_0x3b916c[_0x5ded('0x3e')]};_0x3b916c[_0x5ded('0x3f')]=intUtil['stripTrailingSlash'](_0x3b916c[_0x5ded('0x3f')]);_0x3b916c['serverUrl']=intUtil['stripTrailingSlash'](_0x3b916c[_0x5ded('0x40')]);var _0x340285=_0x3b916c[_0x5ded('0x3f')];_0x2331c3['adminEmail']=_0x3b916c[_0x5ded('0x41')];_0x2331c3[_0x5ded('0x29')]=_0x386074['toLowerCase']()===_0x5ded('0x42')?_0x372b63[_0x5ded('0x43')]:_0x372b63[_0x5ded('0x44')];_0x2331c3[_0x5ded('0x45')]=_0x386074===_0x5ded('0x46')||_0x386074==='unmanaged'?_0x5ded('0x46'):_0x5ded('0x42');if(_0x4112df){_0x2331c3[_0x5ded('0x1f')]=_0x4112df[_0x5ded('0x20')];}var _0x1ca80e=util[_0x5ded('0x27')](_0x5ded('0x47'),_0x3b916c[_0x5ded('0x40')],_0x372b63[_0x5ded('0x48')],md5(_0x372b63['uniqueid']));if(_0x256ce2&&_0x256ce2[_0x5ded('0x49')]){logger[_0x5ded('0x10')](_0x5ded('0x4a'),'Recording\x20is\x20enabled!');_0x372b63[_0x5ded('0x4b')]=_0x1ca80e;}else if(_0x25f5e6&&_0x25f5e6[_0x5ded('0x4c')]&&_0x25f5e6[_0x5ded('0x4c')]!==_0x5ded('0x4d')){logger[_0x5ded('0x10')](_0x5ded('0x4e'),_0x5ded('0x4f'));_0x372b63[_0x5ded('0x4b')]=_0x1ca80e;}else{_0x372b63[_0x5ded('0x4b')]='';}return getAdminId(_0x2331c3,_0x386074,_0x4cc42a,_0x340285)['then'](getUser(_0x386074,_0x4cc42a,_0x340285))['then'](getEndUser(_0x386074,_0x4cc42a,_0x340285))[_0x5ded('0x12')](getTicket(_0x386074,_0x4cc42a,_0x340285,_0x57b78c,_0x372b63))[_0x5ded('0x12')](function(_0x25e051){logger[_0x5ded('0x10')](util['format'](_0x5ded('0x50'),_0x25e051[_0x5ded('0x3a')]));if(_0x386074!==_0x5ded('0x51')){logger[_0x5ded('0x10')]('['+[_0x386074['toUpperCase']()]+']',_0x5ded('0x52'));emit(_0x340285,_0x4112df[_0x5ded('0x53')],_0x25e051['endUserId']);}})[_0x5ded('0x19')](function(_0x53c654){logger['error']('['+[_0x386074[_0x5ded('0x1b')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x53c654,{'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 3d26c15..98bbf59 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 _0x2660=['data1','toLowerCase','data2','find','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2660,0x131));var _0x0266=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0x2660[_0x4849f6];return _0x1a3dcd;};'use strict';var _=require('lodash');var util=require(_0x0266('0x0'));var zendesk=require(_0x0266('0x1'));var salesforce=require(_0x0266('0x2'));var sugarcrm=require(_0x0266('0x3'));var freshdesk=require(_0x0266('0x4'));var zoho=require('./zoho');var desk=require(_0x0266('0x5'));var vtiger=require(_0x0266('0x6'));var servicenow=require('./servicenow');var dynamics365=require(_0x0266('0x7'));var freshsales=require(_0x0266('0x8'));var integrations=[_0x0266('0x9'),'salesforce',_0x0266('0xa'),_0x0266('0xb'),_0x0266('0xc'),_0x0266('0xd'),_0x0266('0xe'),_0x0266('0xf'),_0x0266('0x10'),_0x0266('0x11')];exports[_0x0266('0x12')]=function(_0x436321,_0x420733,_0x3b48c3,_0x2b2cae,_0x257688,_0x1e4247){if(_0x3b48c3){if(_['includes'](integrations,_0x436321[_0x0266('0x13')][_0x0266('0x14')]())){try{var _0x183979=null;var _0x3c6044='';var _0x242753=_0x3b48c3[_0x436321[_0x0266('0x13')][_0x0266('0x14')]()];if(_0x242753){var _0x2cfa18=_0x242753[_0x436321[_0x0266('0x15')]];if(_0x2cfa18){var _0x55e1c3=_[_0x0266('0x16')](_0x2cfa18['Configurations'],{'id':parseInt(_0x436321[_0x0266('0x17')],0xa)});if(_0x55e1c3){if(_0x2b2cae){if(_0x257688&&_0x420733[_0x0266('0x18')]){_0x3c6044='queue';}else if(_0x420733['routeId']){_0x3c6044=_0x0266('0x19');}else{console[_0x0266('0x1a')](_0x0266('0x1b'),_0x420733);}}else{_0x3c6044=_0x0266('0x1c');}switch(_0x436321[_0x0266('0x13')][_0x0266('0x14')]()){case'zendesk':zendesk[_0x3c6044](_0x436321,_0x420733,_0x55e1c3,_0x2b2cae,_0x257688,_0x2cfa18,_0x1e4247);break;case'salesforce':salesforce[_0x3c6044](_0x436321,_0x420733,_0x55e1c3,_0x2b2cae,_0x257688,_0x2cfa18,_0x1e4247);break;case _0x0266('0xa'):sugarcrm[_0x3c6044](_0x436321,_0x420733,_0x55e1c3,_0x2b2cae,_0x257688,_0x2cfa18,_0x1e4247);break;case _0x0266('0xb'):freshdesk[_0x3c6044](_0x436321,_0x420733,_0x55e1c3,_0x2b2cae,_0x257688,_0x2cfa18,_0x1e4247);break;case _0x0266('0xc'):zoho[_0x3c6044](_0x436321,_0x420733,_0x55e1c3,_0x2b2cae,_0x257688,_0x2cfa18,_0x1e4247);break;case _0x0266('0xd'):desk[_0x3c6044](_0x436321,_0x420733,_0x55e1c3,_0x2b2cae,_0x257688,_0x2cfa18,_0x1e4247);break;case _0x0266('0xe'):vtiger[_0x3c6044](_0x436321,_0x420733,_0x55e1c3,_0x2b2cae,_0x257688,_0x2cfa18,_0x1e4247);break;case _0x0266('0x10'):freshsales['cs'](_0x436321,_0x420733,_0x55e1c3,_0x2b2cae,_0x257688,_0x2cfa18,_0x1e4247,_0x3c6044);break;case _0x0266('0x11'):servicenow['cs'](_0x436321,_0x420733,_0x55e1c3,_0x2b2cae,_0x257688,_0x2cfa18,_0x1e4247,_0x3c6044);break;case _0x0266('0xf'):dynamics365['cs'](_0x436321,_0x420733,_0x55e1c3,_0x2b2cae,_0x257688,_0x2cfa18,_0x1e4247,_0x3c6044);break;default:console[_0x0266('0x1a')](_0x0266('0x1d'));}}else{_0x183979=require('../../../../config/logger')(_0x436321[_0x0266('0x13')][_0x0266('0x14')]());_0x183979[_0x0266('0x1e')](_0x0266('0x1f'),util[_0x0266('0x20')](_0x0266('0x21'),_0x436321[_0x0266('0x13')]['toLowerCase'](),_0x436321[_0x0266('0x17')]));}}else{_0x183979=require(_0x0266('0x22'))(_0x436321[_0x0266('0x13')][_0x0266('0x14')]());_0x183979[_0x0266('0x1e')]('[EXEC]',util['format'](_0x0266('0x23'),_0x436321[_0x0266('0x13')][_0x0266('0x14')](),_0x436321[_0x0266('0x15')]));}}else{}}catch(_0x4cc859){console[_0x0266('0x1e')](_0x4cc859);}}}}; \ No newline at end of file +var _0x7530=['./salesforce','./sugarcrm','./zoho','./desk','./dynamics365','zendesk','sugarcrm','freshdesk','desk','freshsales','servicenow','data1','toLowerCase','data2','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','zoho','vtiger','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk'];(function(_0x52bd3c,_0x2a1b27){var _0x3575a4=function(_0x4871cd){while(--_0x4871cd){_0x52bd3c['push'](_0x52bd3c['shift']());}};_0x3575a4(++_0x2a1b27);}(_0x7530,0x15b));var _0x0753=function(_0x491cbe,_0x45c8ba){_0x491cbe=_0x491cbe-0x0;var _0x59449d=_0x7530[_0x491cbe];return _0x59449d;};'use strict';var _=require(_0x0753('0x0'));var util=require(_0x0753('0x1'));var zendesk=require(_0x0753('0x2'));var salesforce=require(_0x0753('0x3'));var sugarcrm=require(_0x0753('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0x0753('0x5'));var desk=require(_0x0753('0x6'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0x0753('0x7'));var freshsales=require('./freshsales');var integrations=[_0x0753('0x8'),'salesforce',_0x0753('0x9'),_0x0753('0xa'),'zoho',_0x0753('0xb'),'vtiger','dynamics365',_0x0753('0xc'),_0x0753('0xd')];exports['exec']=function(_0x574872,_0x11e152,_0x4513fa,_0x5934dc,_0x2cd9f8,_0x349f99){if(_0x4513fa){if(_['includes'](integrations,_0x574872[_0x0753('0xe')][_0x0753('0xf')]())){try{var _0x24e48c=null;var _0x5100f2='';var _0x38e4c5=_0x4513fa[_0x574872[_0x0753('0xe')][_0x0753('0xf')]()];if(_0x38e4c5){var _0x2cca55=_0x38e4c5[_0x574872[_0x0753('0x10')]];if(_0x2cca55){var _0x1f5413=_['find'](_0x2cca55[_0x0753('0x11')],{'id':parseInt(_0x574872[_0x0753('0x12')],0xa)});if(_0x1f5413){if(_0x5934dc){if(_0x2cd9f8&&_0x11e152[_0x0753('0x13')]){_0x5100f2=_0x0753('0x13');}else if(_0x11e152[_0x0753('0x14')]){_0x5100f2=_0x0753('0x15');}else{console[_0x0753('0x16')](_0x0753('0x17'),_0x11e152);}}else{_0x5100f2=_0x0753('0x18');}switch(_0x574872[_0x0753('0xe')]['toLowerCase']()){case _0x0753('0x8'):zendesk[_0x5100f2](_0x574872,_0x11e152,_0x1f5413,_0x5934dc,_0x2cd9f8,_0x2cca55,_0x349f99);break;case _0x0753('0x19'):salesforce[_0x5100f2](_0x574872,_0x11e152,_0x1f5413,_0x5934dc,_0x2cd9f8,_0x2cca55,_0x349f99);break;case _0x0753('0x9'):sugarcrm[_0x5100f2](_0x574872,_0x11e152,_0x1f5413,_0x5934dc,_0x2cd9f8,_0x2cca55,_0x349f99);break;case _0x0753('0xa'):freshdesk[_0x5100f2](_0x574872,_0x11e152,_0x1f5413,_0x5934dc,_0x2cd9f8,_0x2cca55,_0x349f99);break;case _0x0753('0x1a'):zoho[_0x5100f2](_0x574872,_0x11e152,_0x1f5413,_0x5934dc,_0x2cd9f8,_0x2cca55,_0x349f99);break;case _0x0753('0xb'):desk[_0x5100f2](_0x574872,_0x11e152,_0x1f5413,_0x5934dc,_0x2cd9f8,_0x2cca55,_0x349f99);break;case _0x0753('0x1b'):vtiger[_0x5100f2](_0x574872,_0x11e152,_0x1f5413,_0x5934dc,_0x2cd9f8,_0x2cca55,_0x349f99);break;case _0x0753('0xc'):freshsales['cs'](_0x574872,_0x11e152,_0x1f5413,_0x5934dc,_0x2cd9f8,_0x2cca55,_0x349f99,_0x5100f2);break;case _0x0753('0xd'):servicenow['cs'](_0x574872,_0x11e152,_0x1f5413,_0x5934dc,_0x2cd9f8,_0x2cca55,_0x349f99,_0x5100f2);break;case'dynamics365':dynamics365['cs'](_0x574872,_0x11e152,_0x1f5413,_0x5934dc,_0x2cd9f8,_0x2cca55,_0x349f99,_0x5100f2);break;default:console[_0x0753('0x16')](_0x0753('0x1c'));}}else{_0x24e48c=require(_0x0753('0x1d'))(_0x574872['data1'][_0x0753('0xf')]());_0x24e48c[_0x0753('0x1e')](_0x0753('0x1f'),util[_0x0753('0x20')](_0x0753('0x21'),_0x574872[_0x0753('0xe')][_0x0753('0xf')](),_0x574872[_0x0753('0x12')]));}}else{_0x24e48c=require(_0x0753('0x1d'))(_0x574872['data1'][_0x0753('0xf')]());_0x24e48c['error'](_0x0753('0x1f'),util[_0x0753('0x20')](_0x0753('0x22'),_0x574872[_0x0753('0xe')][_0x0753('0xf')](),_0x574872[_0x0753('0x10')]));}}else{}}catch(_0x25e7a2){console['error'](_0x25e7a2);}}}}; \ 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 0f91f69..8c85906 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 _0xe57d=['lodash','request-promise','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','endUserType','contact','lead','WhoId','account','WhatId','Case','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','find','execute','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','user_id','identity','resolve','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','additionalSearchLead','merge','additionalSearchAccount','Account','length','Lead','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','','format','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','Caller\x20-\x20%s','Company','upperFirst','includes','string','picklist','idField','content','toString','variableName','name','Variable','password','concat','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','catch','[OUTBOUND]','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.'];(function(_0x4ae6de,_0x31652f){var _0x267c26=function(_0x31cde2){while(--_0x31cde2){_0x4ae6de['push'](_0x4ae6de['shift']());}};_0x267c26(++_0x31652f);}(_0xe57d,0x186));var _0xde57=function(_0x224fd6,_0x58bb26){_0x224fd6=_0x224fd6-0x0;var _0xa56932=_0xe57d[_0x224fd6];return _0xa56932;};'use strict';var _=require(_0xde57('0x0'));var rp=require(_0xde57('0x1'));var moment=require(_0xde57('0x2'));var BPromise=require(_0xde57('0x3'));var md5=require(_0xde57('0x4'));var jsforce=require(_0xde57('0x5'));var util=require(_0xde57('0x6'));var Redis=require('ioredis');var intUtil=require(_0xde57('0x7'));var config=require(_0xde57('0x8'));var logger=require(_0xde57('0x9'))(_0xde57('0xa'));config[_0xde57('0xb')]=_['defaults'](config[_0xde57('0xb')],{'host':_0xde57('0xc'),'port':0x18eb});var io=require(_0xde57('0xd'))(new Redis(config[_0xde57('0xb')]));function emit(_0xbe82ba,_0x30054a,_0x36d79b){io['to'](_0xbe82ba)[_0xde57('0xe')](_0x30054a,_0x36d79b);}function getTicket(_0x31d3f9,_0x28c8c9,_0x4ab59a,_0x34054c,_0x1bf5ad,_0x7253f7,_0x1d0a82,_0x20ddcc){var _0x273780=Object['assign']({},{'OwnerId':_0x28c8c9['id'],'Subject':intUtil['getString'](_0x34054c[_0xde57('0xf')],_0x1bf5ad,'\x20'),'Description':intUtil[_0xde57('0x10')](_0x34054c[_0xde57('0x11')],_0x1bf5ad,'\x0a')},getCustomFields(_0x7253f7,_0x1bf5ad));if(_0x4ab59a){if(_0x34054c[_0xde57('0x12')]===_0xde57('0x13')){_0x273780[_0xde57('0x14')]=moment['utc']();_0x273780[_0xde57('0x15')]=![];_0x273780['IsRecurrence']=![];if(_0x4ab59a[_0xde57('0x16')]===_0xde57('0x17')||_0x4ab59a[_0xde57('0x16')]===_0xde57('0x18')){_0x273780[_0xde57('0x19')]=_0x4ab59a['id'];}else if(_0x4ab59a['endUserType']===_0xde57('0x1a')){_0x273780[_0xde57('0x1b')]=_0x4ab59a['id'];}}else if(_0x34054c[_0xde57('0x12')]===_0xde57('0x1c')){if(_0x4ab59a[_0xde57('0x16')]==='contact'){_0x273780['ContactId']=_0x4ab59a['id'];}else if(_0x4ab59a[_0xde57('0x16')]==='account'){_0x273780[_0xde57('0x1d')]=_0x4ab59a['id'];}else if(_0x4ab59a[_0xde57('0x16')]==='lead'&&_0x34054c['leadId']){_0x273780[_0x34054c[_0xde57('0x1e')]]=_0x4ab59a['id'];}else{logger[_0xde57('0x1f')](_0xde57('0x20'));}}}return _0x1d0a82[_0xde57('0x21')](_0x34054c[_0xde57('0x12')])[_0xde57('0x22')](_0x273780);}function getUser(_0x459a9d,_0x23bc3c,_0x3c39ef){if(!_[_0xde57('0x23')](_0x23bc3c)&&intUtil[_0xde57('0x24')](_0x23bc3c)){var _0x43ec91={'Email':_0x23bc3c};var _0x2b0c4d={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3c39ef[_0xde57('0x21')]('User')[_0xde57('0x25')](_0x43ec91,_0x2b0c4d)[_0xde57('0x26')]()['then'](function(_0x3d4976){if(_0x3d4976['length']){var _0x2b11df=_[_0xde57('0x25')](_0x3d4976,function(_0x4d5fab){return _0x4d5fab[_0xde57('0x27')]===_0x23bc3c;});if(_0x2b11df){logger[_0xde57('0x1f')](_0xde57('0x28'),_0x23bc3c);return BPromise['resolve']({'id':_0x2b11df['Id'],'name':_0x2b11df[_0xde57('0x29')]});}}else{logger[_0xde57('0x1f')](_0xde57('0x2a'),_0x23bc3c);return _0x3c39ef['identity']()[_0xde57('0x2b')](function(_0x106941){return BPromise['resolve']({'id':_0x106941[_0xde57('0x2c')],'name':_0x106941['display_name']});});}});}else{logger[_0xde57('0x1f')](_0xde57('0x2a'),_0x23bc3c);return _0x3c39ef[_0xde57('0x2d')]()[_0xde57('0x2b')](function(_0x1eea63){return BPromise[_0xde57('0x2e')]({'id':_0x1eea63[_0xde57('0x2c')],'name':_0x1eea63[_0xde57('0x2f')]});});}}function getEndUser(_0x236f26,_0x5ac350,_0x34145d,_0x31c8a2,_0x22f6ed){var _0x55ca26={'$or':{'Phone':_0x31c8a2}};var _0x1f6a05={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xde57('0x2b')](function(){logger['info'](_0xde57('0x30'),_0x31c8a2,_0x5ac350[_0xde57('0x31')]);switch(_0x5ac350[_0xde57('0x31')]){case _0xde57('0x32'):var _0x1b60c4=_[_0xde57('0x33')](_0x55ca26);if(_0x5ac350['additionalSearchContact']){var _0x4fed22={};_0x4fed22[_0x5ac350[_0xde57('0x34')]]=_0x31c8a2;_['merge'](_0x1b60c4[_0xde57('0x35')],_0x4fed22);}return _0x22f6ed['sobject'](_0xde57('0x36'))[_0xde57('0x25')](_0x1b60c4,_0x1f6a05)[_0xde57('0x26')]()[_0xde57('0x2b')](function(_0x410d99){if(_0x410d99&&_0x410d99['length']){return _0x410d99;}else{var _0x1c2fe7=_[_0xde57('0x33')](_0x55ca26);if(_0x5ac350[_0xde57('0x37')]){var _0x246649={};_0x246649[_0x5ac350[_0xde57('0x37')]]=_0x31c8a2;_[_0xde57('0x38')](_0x1c2fe7[_0xde57('0x35')],_0x246649);}return _0x22f6ed['sobject']('Lead')[_0xde57('0x25')](_0x1c2fe7,_0x1f6a05);}});case'account_contact_lead':var _0x51a54f=_[_0xde57('0x33')](_0x55ca26);if(_0x5ac350[_0xde57('0x39')]){var _0x4fed22={};_0x4fed22[_0x5ac350[_0xde57('0x39')]]=_0x31c8a2;_['merge'](_0x51a54f[_0xde57('0x35')],_0x4fed22);}return _0x22f6ed[_0xde57('0x21')](_0xde57('0x3a'))['find'](_0x51a54f,_0x1f6a05)[_0xde57('0x26')]()[_0xde57('0x2b')](function(_0x570472){if(_0x570472&&_0x570472[_0xde57('0x3b')]){return _0x570472;}else{var _0x50821e=_[_0xde57('0x33')](_0x55ca26);if(_0x5ac350[_0xde57('0x34')]){var _0x5135bc={};_0x5135bc[_0x5ac350[_0xde57('0x34')]]=_0x31c8a2;_['merge'](_0x50821e['$or'],_0x5135bc);}return _0x22f6ed['sobject'](_0xde57('0x36'))[_0xde57('0x25')](_0x50821e,_0x1f6a05)[_0xde57('0x2b')](function(_0x2768bb){if(_0x2768bb&&_0x2768bb['length']){return _0x2768bb;}else{var _0x49834e=_[_0xde57('0x33')](_0x55ca26);if(_0x5ac350['additionalSearchLead']){var _0x541366={};_0x541366[_0x5ac350[_0xde57('0x37')]]=_0x31c8a2;_[_0xde57('0x38')](_0x49834e[_0xde57('0x35')],_0x541366);}return _0x22f6ed[_0xde57('0x21')]('Lead')[_0xde57('0x25')](_0x49834e,_0x1f6a05);}});}});case _0xde57('0x17'):var _0x1b60c4=_[_0xde57('0x33')](_0x55ca26);if(_0x5ac350['additionalSearchContact']){var _0x4fed22={};_0x4fed22[_0x5ac350[_0xde57('0x34')]]=_0x31c8a2;_['merge'](_0x1b60c4[_0xde57('0x35')],_0x4fed22);}return _0x22f6ed[_0xde57('0x21')](_0xde57('0x36'))[_0xde57('0x25')](_0x1b60c4,_0x1f6a05)['execute']();case'lead':var _0x5ec902=_[_0xde57('0x33')](_0x55ca26);if(_0x5ac350[_0xde57('0x37')]){var _0x4fed22={};_0x4fed22[_0x5ac350[_0xde57('0x37')]]=_0x31c8a2;_[_0xde57('0x38')](_0x5ec902['$or'],_0x4fed22);}return _0x22f6ed[_0xde57('0x21')](_0xde57('0x3c'))[_0xde57('0x25')](_0x5ec902,_0x1f6a05);case _0xde57('0x1a'):var _0x51a54f=_[_0xde57('0x33')](_0x55ca26);if(_0x5ac350[_0xde57('0x39')]){var _0x4fed22={};_0x4fed22[_0x5ac350[_0xde57('0x39')]]=_0x31c8a2;_[_0xde57('0x38')](_0x51a54f[_0xde57('0x35')],_0x4fed22);}return _0x22f6ed[_0xde57('0x21')](_0xde57('0x3a'))['find'](_0x51a54f,_0x1f6a05);default:return null;}})[_0xde57('0x2b')](function(_0x297e27){if(_0x297e27&&_0x297e27[_0xde57('0x3b')]){var _0x500ed6=_[_0xde57('0x3d')](_0x297e27);if(_0x500ed6){return BPromise[_0xde57('0x2e')]({'id':_0x500ed6['Id'],'name':_0x500ed6[_0xde57('0x29')],'phone':_0x500ed6[_0xde57('0x3e')],'endUserType':_0x500ed6[_0xde57('0x3f')][_0xde57('0x40')][_0xde57('0x41')]()});}}})[_0xde57('0x2b')](function(_0x1379ab){if(_0x1379ab){logger[_0xde57('0x1f')](_0xde57('0x42'),_0x1379ab[_0xde57('0x16')],_0x31c8a2);return BPromise[_0xde57('0x2e')](_0x1379ab);}else{logger[_0xde57('0x1f')](_0xde57('0x43'),_0x31c8a2);var _0x32d09c={'Phone':_0x31c8a2};if(_0x5ac350[_0xde57('0x44')]){if(_0x5ac350[_0xde57('0x44')]==='contact'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x31c8a2,_0x5ac350[_0xde57('0x44')]);_0x32d09c['LastName']=_0x34145d!==_0xde57('0x45')?_0x34145d:util[_0xde57('0x46')]('Caller\x20-\x20%s',_0x31c8a2);}else if(_0x5ac350[_0xde57('0x44')]===_0xde57('0x18')){logger[_0xde57('0x1f')](_0xde57('0x47'),_0x31c8a2,_0x5ac350[_0xde57('0x44')]);_0x32d09c[_0xde57('0x48')]=_0x34145d!==''?_0x34145d:util['format'](_0xde57('0x49'),_0x31c8a2);_0x32d09c[_0xde57('0x4a')]='No\x20Company';}else if(_0x5ac350['moduleCreate']===_0xde57('0x1a')){logger[_0xde57('0x1f')](_0xde57('0x47'),_0x31c8a2,_0x5ac350[_0xde57('0x44')]);_0x32d09c['Name']=_0x34145d!==_0xde57('0x45')?_0x34145d:util[_0xde57('0x46')](_0xde57('0x49'),_0x31c8a2);}else{return null;}}return _0x22f6ed[_0xde57('0x21')](_[_0xde57('0x4b')](_0x5ac350[_0xde57('0x44')]))['create'](_0x32d09c)[_0xde57('0x2b')](function(_0x539af5){return BPromise['resolve']({'id':_0x539af5['id'],'endUserType':_0x5ac350[_0xde57('0x44')]});});}});}function getCustomFields(_0x29a0ea,_0xecc0cc){var _0x3504bf={};if(_0x29a0ea['length']>0x0){_['forEach'](_0x29a0ea,function(_0x14fe8f){if(_[_0xde57('0x4c')]([_0xde57('0x4d'),_0xde57('0x4e')],_0x14fe8f['type'])&&_0x14fe8f[_0xde57('0x4f')]){_0x3504bf[_0x14fe8f['idField']]=_0x14fe8f[_0xde57('0x50')][_0xde57('0x51')]();}else if(_0x14fe8f[_0xde57('0x40')]==='variable'&&_0x14fe8f[_0xde57('0x52')]&&_0x14fe8f[_0xde57('0x4f')]){_0xecc0cc[_0x14fe8f[_0xde57('0x52')]]&&(_0x3504bf[_0x14fe8f['idField']]=_0xecc0cc[_0x14fe8f[_0xde57('0x52')]]['toString']());}else if(_0x14fe8f[_0xde57('0x40')]==='customVariable'&&_0x14fe8f['Variable']&&_0x14fe8f['Variable'][_0xde57('0x53')]&&_0x14fe8f[_0xde57('0x4f')]){_0xecc0cc[_0x14fe8f[_0xde57('0x54')]['name'][_0xde57('0x41')]()]&&(_0x3504bf[_0x14fe8f[_0xde57('0x4f')]]=_0xecc0cc[_0x14fe8f[_0xde57('0x54')][_0xde57('0x53')][_0xde57('0x41')]()]['toString']());}});}return _0x3504bf;}function getConnection(_0xd6a60d){var _0x31ff16=_0xd6a60d[_0xde57('0x55')][_0xde57('0x56')](_0xd6a60d['securityToken']);var _0x8dfa80=new jsforce['Connection']({'oauth2':{'loginUrl':_0xd6a60d[_0xde57('0x57')]||_0xde57('0x58'),'clientId':_0xd6a60d[_0xde57('0x59')],'clientSecret':_0xd6a60d[_0xde57('0x5a')]}});return _0x8dfa80[_0xde57('0x5b')](_0xd6a60d[_0xde57('0x5c')],_0x31ff16)[_0xde57('0x2b')](function(){logger['info'](_0xde57('0x5d'));return _0x8dfa80;});}exports[_0xde57('0x5e')]=function(_0x27e941,_0x53876c,_0x4d9422,_0x1fed6b,_0x2a2fcb,_0x5c210f){var _0x29d457,_0xfa34bc,_0x303297,_0x56639b;_0x5c210f[_0xde57('0x5f')]=intUtil[_0xde57('0x60')](_0x5c210f[_0xde57('0x5f')]);_0x5c210f['remoteUri']=intUtil[_0xde57('0x60')](_0x5c210f[_0xde57('0x57')]);if(_0x2a2fcb&&_0x2a2fcb[_0xde57('0x61')]){logger[_0xde57('0x1f')](_0xde57('0x62'),'Recording\x20is\x20enabled!');_0x53876c[_0xde57('0x63')]=util[_0xde57('0x46')](_0xde57('0x64'),_0x5c210f[_0xde57('0x5f')],_0x53876c[_0xde57('0x65')],md5(_0x53876c[_0xde57('0x65')]));}else{_0x53876c[_0xde57('0x63')]='';}return getConnection(_0x5c210f)[_0xde57('0x2b')](function(_0x203b77){_0x56639b=_0x203b77;return getUser(_0x5c210f,_0x1fed6b[_0xde57('0x66')],_0x56639b);})['then'](function(_0x5d077a){_0x29d457=_0x5d077a;return getEndUser(_0x5c210f,_0x4d9422,_0x53876c[_0xde57('0x67')],_0x53876c[_0xde57('0x68')],_0x56639b);})[_0xde57('0x2b')](function(_0x4a87fc){_0xfa34bc=_0x4a87fc;return getTicket(_0x5c210f,_0x29d457,_0xfa34bc,_0x4d9422,_0x53876c,_0x4d9422[_0xde57('0x69')],_0x56639b,'queue');})['then'](function(_0x24433c){_0x303297=_0x24433c;logger[_0xde57('0x1f')](_0xde57('0x6a'),_0x303297['id']);logger[_0xde57('0x1f')](_0xde57('0x6b'),_0x303297['id'],_0x1fed6b['name'],_0x5c210f[_0xde57('0x40')]);switch(_0x5c210f[_0xde57('0x40')]){case'integrationTab':emit(util[_0xde57('0x46')](_0xde57('0x6c'),_0x1fed6b['name']),'trigger:salesforce:display',{'recordId':_0x303297['id']});break;case _0xde57('0x6d'):emit(util[_0xde57('0x46')](_0xde57('0x6c'),_0x1fed6b[_0xde57('0x53')]),_0xde57('0x6e'),{'uri':util[_0xde57('0x46')](_0xde57('0x6f'),_0x56639b[_0xde57('0x70')],_0x303297['id'])});break;default:logger[_0xde57('0x71')](_0xde57('0x72'));}})['catch'](function(_0x37e4bd){logger[_0xde57('0x71')](_0xde57('0x62'),_0x37e4bd);});};exports[_0xde57('0x73')]=function(_0x344e6f,_0xdcf4d3,_0x2b64d7,_0x30fbcb,_0x175cbb,_0x43423e,_0x59d69f){var _0x4bd19c,_0x44e482,_0x559c27,_0x2b2a20;_0x43423e[_0xde57('0x5f')]=intUtil[_0xde57('0x60')](_0x43423e[_0xde57('0x5f')]);_0x43423e[_0xde57('0x57')]=intUtil[_0xde57('0x60')](_0x43423e[_0xde57('0x57')]);if(_0x59d69f&&_0x59d69f['recordingFormat']&&_0x59d69f[_0xde57('0x74')]!==_0xde57('0x75')){logger['info']('[OUTBOUND]',_0xde57('0x76'));_0xdcf4d3[_0xde57('0x63')]=util[_0xde57('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x43423e[_0xde57('0x5f')],_0xdcf4d3[_0xde57('0x65')],md5(_0xdcf4d3[_0xde57('0x65')]));}return getConnection(_0x43423e)[_0xde57('0x2b')](function(_0x2e322f){_0x2b2a20=_0x2e322f;return getUser(_0x43423e,_0x30fbcb[_0xde57('0x66')],_0x2b2a20);})[_0xde57('0x2b')](function(_0x12c319){_0x4bd19c=_0x12c319;return getEndUser(_0x43423e,_0x2b64d7,_0xdcf4d3[_0xde57('0x77')],_0xdcf4d3[_0xde57('0x78')],_0x2b2a20);})[_0xde57('0x2b')](function(_0x20a103){_0x44e482=_0x20a103;return getTicket(_0x43423e,_0x4bd19c,_0x44e482,_0x2b64d7,_0xdcf4d3,_0x2b64d7['Fields'],_0x2b2a20,_0xde57('0x73'));})[_0xde57('0x2b')](function(_0x5e931c){_0x559c27=_0x5e931c;logger[_0xde57('0x1f')](_0xde57('0x79'),_0x559c27['id']);logger[_0xde57('0x1f')](_0xde57('0x7a'),_0x559c27['id'],_0x30fbcb[_0xde57('0x53')],_0x43423e['type']);switch(_0x43423e[_0xde57('0x40')]){case'integrationTab':emit(util[_0xde57('0x46')](_0xde57('0x6c'),_0x30fbcb[_0xde57('0x53')]),'trigger:salesforce:display',{'recordId':_0x559c27['id']});break;case _0xde57('0x6d'):emit(util[_0xde57('0x46')](_0xde57('0x6c'),_0x30fbcb[_0xde57('0x53')]),_0xde57('0x6e'),{'uri':util[_0xde57('0x46')](_0xde57('0x6f'),_0x2b2a20[_0xde57('0x70')],_0x559c27['id'])});break;default:logger[_0xde57('0x71')]('[OUTBOUND]',_0xde57('0x7b'));}})[_0xde57('0x7c')](function(_0x5bf8d2){logger[_0xde57('0x71')](_0xde57('0x7d'),_0x5bf8d2);});};exports['unmanaged']=function(_0x3f5a1c,_0x359764,_0xeae1e3,_0x7646e3,_0x46f73d,_0x49d317){var _0x1e49be,_0x5a09c9,_0x3ec5f7,_0x3a3980;_0x49d317[_0xde57('0x5f')]=intUtil[_0xde57('0x60')](_0x49d317[_0xde57('0x5f')]);_0x49d317['remoteUri']=intUtil['stripTrailingSlash'](_0x49d317[_0xde57('0x57')]);if(_0x46f73d&&_0x46f73d['monitor_format']){logger['info']('['+_0x359764[_0xde57('0x7e')][_0xde57('0x7f')]()+']',_0xde57('0x76'));_0x359764[_0xde57('0x63')]=util[_0xde57('0x46')](_0xde57('0x64'),_0x49d317[_0xde57('0x5f')],_0x359764['uniqueid'],md5(_0x359764['uniqueid']));}else{_0x359764[_0xde57('0x63')]='';}return getConnection(_0x49d317)[_0xde57('0x2b')](function(_0x494c66){_0x3a3980=_0x494c66;if(!_[_0xde57('0x23')](_0x7646e3)){return getUser(_0x49d317,_0x7646e3['name'],_0x3a3980);}else{return getUser(_0x49d317,null,_0x3a3980);}})[_0xde57('0x2b')](function(_0x51ee3c){_0x1e49be=_0x51ee3c;return getEndUser(_0x49d317,_0xeae1e3,_0x359764['calleridname'],_0x359764[_0xde57('0x68')],_0x3a3980);})['then'](function(_0x39dd29){_0x5a09c9=_0x39dd29;return getTicket(_0x49d317,_0x1e49be,_0x5a09c9,_0xeae1e3,_0x359764,_0xeae1e3[_0xde57('0x69')],_0x3a3980);})[_0xde57('0x2b')](function(_0x31e1a6){_0x3ec5f7=_0x31e1a6;logger['info']('['+_0x359764[_0xde57('0x7e')][_0xde57('0x7f')]()+_0xde57('0x80'),_0x3ec5f7['id']);logger[_0xde57('0x1f')]('['+_0x359764[_0xde57('0x7e')][_0xde57('0x7f')]()+_0xde57('0x81'),_0x49d317[_0xde57('0x40')]);})[_0xde57('0x7c')](function(_0x13df37){logger[_0xde57('0x71')]('['+_0x359764['lastevent'][_0xde57('0x7f')]()+']',_0x13df37);});}; \ No newline at end of file +var _0x991c=['lastevent',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','util','ioredis','./util','../../../../config/environment','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','ticketType','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','Case','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','User','find','execute','then','length','resolve','Name','identity','user_id','display_name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','Phone','attributes','type','toLowerCase','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','picklist','idField','toString','variable','variableName','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','isNil','toUpperCase',']\x20Ticket\x20%s\x20created.'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0x991c,0x102));var _0xc991=function(_0x12d6b0,_0x58bb9b){_0x12d6b0=_0x12d6b0-0x0;var _0x2d6b86=_0x991c[_0x12d6b0];return _0x2d6b86;};'use strict';var _=require(_0xc991('0x0'));var rp=require(_0xc991('0x1'));var moment=require(_0xc991('0x2'));var BPromise=require('bluebird');var md5=require(_0xc991('0x3'));var jsforce=require(_0xc991('0x4'));var util=require(_0xc991('0x5'));var Redis=require(_0xc991('0x6'));var intUtil=require(_0xc991('0x7'));var config=require(_0xc991('0x8'));var logger=require('../../../../config/logger')(_0xc991('0x9'));config[_0xc991('0xa')]=_[_0xc991('0xb')](config[_0xc991('0xa')],{'host':_0xc991('0xc'),'port':0x18eb});var io=require(_0xc991('0xd'))(new Redis(config['redis']));function emit(_0x322426,_0x53b6f7,_0x260669){io['to'](_0x322426)[_0xc991('0xe')](_0x53b6f7,_0x260669);}function getTicket(_0x26ea3a,_0xff727,_0x775ec9,_0x18bf56,_0x20f057,_0x99a9c6,_0x4dfe44,_0x544d4b){var _0x252125=Object[_0xc991('0xf')]({},{'OwnerId':_0xff727['id'],'Subject':intUtil[_0xc991('0x10')](_0x18bf56[_0xc991('0x11')],_0x20f057,'\x20'),'Description':intUtil['getString'](_0x18bf56['Descriptions'],_0x20f057,'\x0a')},getCustomFields(_0x99a9c6,_0x20f057));if(_0x775ec9){if(_0x18bf56[_0xc991('0x12')]==='Task'){_0x252125['ActivityDate']=moment['utc']();_0x252125[_0xc991('0x13')]=![];_0x252125[_0xc991('0x14')]=![];if(_0x775ec9[_0xc991('0x15')]===_0xc991('0x16')||_0x775ec9[_0xc991('0x15')]===_0xc991('0x17')){_0x252125[_0xc991('0x18')]=_0x775ec9['id'];}else if(_0x775ec9['endUserType']===_0xc991('0x19')){_0x252125['WhatId']=_0x775ec9['id'];}}else if(_0x18bf56['ticketType']===_0xc991('0x1a')){if(_0x775ec9[_0xc991('0x15')]===_0xc991('0x16')){_0x252125[_0xc991('0x1b')]=_0x775ec9['id'];}else if(_0x775ec9['endUserType']===_0xc991('0x19')){_0x252125[_0xc991('0x1c')]=_0x775ec9['id'];}else if(_0x775ec9[_0xc991('0x15')]===_0xc991('0x17')&&_0x18bf56[_0xc991('0x1d')]){_0x252125[_0x18bf56[_0xc991('0x1d')]]=_0x775ec9['id'];}else{logger['info'](_0xc991('0x1e'));}}}return _0x4dfe44[_0xc991('0x1f')](_0x18bf56['ticketType'])[_0xc991('0x20')](_0x252125);}function getUser(_0x5d2f42,_0x3c2ca4,_0xd40d73){if(!_['isNil'](_0x3c2ca4)&&intUtil['validateEmail'](_0x3c2ca4)){var _0x4b4213={'Email':_0x3c2ca4};var _0x5641ac={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xd40d73[_0xc991('0x1f')](_0xc991('0x21'))[_0xc991('0x22')](_0x4b4213,_0x5641ac)[_0xc991('0x23')]()[_0xc991('0x24')](function(_0x2523e5){if(_0x2523e5[_0xc991('0x25')]){var _0xf9debf=_['find'](_0x2523e5,function(_0x246664){return _0x246664['Email']===_0x3c2ca4;});if(_0xf9debf){logger['info']('Agent\x20%s\x20found.',_0x3c2ca4);return BPromise[_0xc991('0x26')]({'id':_0xf9debf['Id'],'name':_0xf9debf[_0xc991('0x27')]});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3c2ca4);return _0xd40d73[_0xc991('0x28')]()[_0xc991('0x24')](function(_0x4ccb77){return BPromise['resolve']({'id':_0x4ccb77[_0xc991('0x29')],'name':_0x4ccb77[_0xc991('0x2a')]});});}});}else{logger[_0xc991('0x2b')](_0xc991('0x2c'),_0x3c2ca4);return _0xd40d73[_0xc991('0x28')]()[_0xc991('0x24')](function(_0x267505){return BPromise[_0xc991('0x26')]({'id':_0x267505[_0xc991('0x29')],'name':_0x267505['display_name']});});}}function getEndUser(_0x141a7d,_0x337999,_0x4fb173,_0x5a3d4d,_0x2cb891){var _0x47b598={'$or':{'Phone':_0x5a3d4d}};var _0x4acc42={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xc991('0x26')]()['then'](function(){logger[_0xc991('0x2b')](_0xc991('0x2d'),_0x5a3d4d,_0x337999[_0xc991('0x2e')]);switch(_0x337999[_0xc991('0x2e')]){case _0xc991('0x2f'):var _0x3a545f=_[_0xc991('0x30')](_0x47b598);if(_0x337999[_0xc991('0x31')]){var _0x5d6ff1={};_0x5d6ff1[_0x337999[_0xc991('0x31')]]=_0x5a3d4d;_[_0xc991('0x32')](_0x3a545f['$or'],_0x5d6ff1);}return _0x2cb891[_0xc991('0x1f')](_0xc991('0x33'))[_0xc991('0x22')](_0x3a545f,_0x4acc42)[_0xc991('0x23')]()[_0xc991('0x24')](function(_0xae97b4){if(_0xae97b4&&_0xae97b4[_0xc991('0x25')]){return _0xae97b4;}else{var _0x14e2ea=_[_0xc991('0x30')](_0x47b598);if(_0x337999['additionalSearchLead']){var _0x134e9c={};_0x134e9c[_0x337999[_0xc991('0x34')]]=_0x5a3d4d;_[_0xc991('0x32')](_0x14e2ea[_0xc991('0x35')],_0x134e9c);}return _0x2cb891[_0xc991('0x1f')](_0xc991('0x36'))[_0xc991('0x22')](_0x14e2ea,_0x4acc42);}});case _0xc991('0x37'):var _0x1c3df4=_['cloneDeep'](_0x47b598);if(_0x337999[_0xc991('0x38')]){var _0x5d6ff1={};_0x5d6ff1[_0x337999['additionalSearchAccount']]=_0x5a3d4d;_['merge'](_0x1c3df4[_0xc991('0x35')],_0x5d6ff1);}return _0x2cb891[_0xc991('0x1f')](_0xc991('0x39'))[_0xc991('0x22')](_0x1c3df4,_0x4acc42)[_0xc991('0x23')]()['then'](function(_0x26235c){if(_0x26235c&&_0x26235c['length']){return _0x26235c;}else{var _0x204dd5=_[_0xc991('0x30')](_0x47b598);if(_0x337999[_0xc991('0x31')]){var _0x39a278={};_0x39a278[_0x337999['additionalSearchContact']]=_0x5a3d4d;_['merge'](_0x204dd5[_0xc991('0x35')],_0x39a278);}return _0x2cb891[_0xc991('0x1f')]('Contact')[_0xc991('0x22')](_0x204dd5,_0x4acc42)[_0xc991('0x24')](function(_0x3dbd46){if(_0x3dbd46&&_0x3dbd46['length']){return _0x3dbd46;}else{var _0x2b5418=_[_0xc991('0x30')](_0x47b598);if(_0x337999[_0xc991('0x34')]){var _0x8414e0={};_0x8414e0[_0x337999[_0xc991('0x34')]]=_0x5a3d4d;_[_0xc991('0x32')](_0x2b5418[_0xc991('0x35')],_0x8414e0);}return _0x2cb891['sobject'](_0xc991('0x36'))['find'](_0x2b5418,_0x4acc42);}});}});case'contact':var _0x3a545f=_[_0xc991('0x30')](_0x47b598);if(_0x337999[_0xc991('0x31')]){var _0x5d6ff1={};_0x5d6ff1[_0x337999[_0xc991('0x31')]]=_0x5a3d4d;_[_0xc991('0x32')](_0x3a545f['$or'],_0x5d6ff1);}return _0x2cb891[_0xc991('0x1f')](_0xc991('0x33'))[_0xc991('0x22')](_0x3a545f,_0x4acc42)[_0xc991('0x23')]();case _0xc991('0x17'):var _0x24151b=_['cloneDeep'](_0x47b598);if(_0x337999[_0xc991('0x34')]){var _0x5d6ff1={};_0x5d6ff1[_0x337999[_0xc991('0x34')]]=_0x5a3d4d;_['merge'](_0x24151b['$or'],_0x5d6ff1);}return _0x2cb891['sobject'](_0xc991('0x36'))['find'](_0x24151b,_0x4acc42);case _0xc991('0x19'):var _0x1c3df4=_['cloneDeep'](_0x47b598);if(_0x337999[_0xc991('0x38')]){var _0x5d6ff1={};_0x5d6ff1[_0x337999['additionalSearchAccount']]=_0x5a3d4d;_[_0xc991('0x32')](_0x1c3df4['$or'],_0x5d6ff1);}return _0x2cb891[_0xc991('0x1f')](_0xc991('0x39'))['find'](_0x1c3df4,_0x4acc42);default:return null;}})[_0xc991('0x24')](function(_0x42df68){if(_0x42df68&&_0x42df68[_0xc991('0x25')]){var _0x220e06=_['first'](_0x42df68);if(_0x220e06){return BPromise['resolve']({'id':_0x220e06['Id'],'name':_0x220e06[_0xc991('0x27')],'phone':_0x220e06[_0xc991('0x3a')],'endUserType':_0x220e06[_0xc991('0x3b')][_0xc991('0x3c')][_0xc991('0x3d')]()});}}})[_0xc991('0x24')](function(_0x30e46e){if(_0x30e46e){logger[_0xc991('0x2b')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x30e46e[_0xc991('0x15')],_0x5a3d4d);return BPromise[_0xc991('0x26')](_0x30e46e);}else{logger[_0xc991('0x2b')](_0xc991('0x3e'),_0x5a3d4d);var _0x1f8a1f={'Phone':_0x5a3d4d};if(_0x337999[_0xc991('0x3f')]){if(_0x337999['moduleCreate']==='contact'){logger[_0xc991('0x2b')](_0xc991('0x40'),_0x5a3d4d,_0x337999[_0xc991('0x3f')]);_0x1f8a1f['LastName']=_0x4fb173!==_0xc991('0x41')?_0x4fb173:util[_0xc991('0x42')](_0xc991('0x43'),_0x5a3d4d);}else if(_0x337999[_0xc991('0x3f')]===_0xc991('0x17')){logger[_0xc991('0x2b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5a3d4d,_0x337999[_0xc991('0x3f')]);_0x1f8a1f[_0xc991('0x44')]=_0x4fb173!==''?_0x4fb173:util[_0xc991('0x42')]('Caller\x20-\x20%s',_0x5a3d4d);_0x1f8a1f[_0xc991('0x45')]=_0xc991('0x46');}else if(_0x337999['moduleCreate']===_0xc991('0x19')){logger[_0xc991('0x2b')](_0xc991('0x40'),_0x5a3d4d,_0x337999[_0xc991('0x3f')]);_0x1f8a1f['Name']=_0x4fb173!==''?_0x4fb173:util[_0xc991('0x42')](_0xc991('0x43'),_0x5a3d4d);}else{return null;}}return _0x2cb891[_0xc991('0x1f')](_[_0xc991('0x47')](_0x337999[_0xc991('0x3f')]))[_0xc991('0x20')](_0x1f8a1f)[_0xc991('0x24')](function(_0x3f4eea){return BPromise[_0xc991('0x26')]({'id':_0x3f4eea['id'],'endUserType':_0x337999[_0xc991('0x3f')]});});}});}function getCustomFields(_0x3b981b,_0x55d13f){var _0x36365d={};if(_0x3b981b[_0xc991('0x25')]>0x0){_[_0xc991('0x48')](_0x3b981b,function(_0x5d4750){if(_[_0xc991('0x49')]([_0xc991('0x4a'),_0xc991('0x4b')],_0x5d4750[_0xc991('0x3c')])&&_0x5d4750[_0xc991('0x4c')]){_0x36365d[_0x5d4750[_0xc991('0x4c')]]=_0x5d4750['content'][_0xc991('0x4d')]();}else if(_0x5d4750['type']===_0xc991('0x4e')&&_0x5d4750[_0xc991('0x4f')]&&_0x5d4750[_0xc991('0x4c')]){_0x55d13f[_0x5d4750[_0xc991('0x4f')]]&&(_0x36365d[_0x5d4750[_0xc991('0x4c')]]=_0x55d13f[_0x5d4750[_0xc991('0x4f')]][_0xc991('0x4d')]());}else if(_0x5d4750['type']===_0xc991('0x50')&&_0x5d4750['Variable']&&_0x5d4750[_0xc991('0x51')][_0xc991('0x52')]&&_0x5d4750[_0xc991('0x4c')]){_0x55d13f[_0x5d4750[_0xc991('0x51')][_0xc991('0x52')][_0xc991('0x3d')]()]&&(_0x36365d[_0x5d4750[_0xc991('0x4c')]]=_0x55d13f[_0x5d4750[_0xc991('0x51')][_0xc991('0x52')][_0xc991('0x3d')]()][_0xc991('0x4d')]());}});}return _0x36365d;}function getConnection(_0x18a7bd){var _0x260b60=_0x18a7bd['password'][_0xc991('0x53')](_0x18a7bd[_0xc991('0x54')]);var _0x2d900f=new jsforce[(_0xc991('0x55'))]({'oauth2':{'loginUrl':_0x18a7bd[_0xc991('0x56')]||_0xc991('0x57'),'clientId':_0x18a7bd[_0xc991('0x58')],'clientSecret':_0x18a7bd[_0xc991('0x59')]}});return _0x2d900f[_0xc991('0x5a')](_0x18a7bd['username'],_0x260b60)[_0xc991('0x24')](function(){logger[_0xc991('0x2b')](_0xc991('0x5b'));return _0x2d900f;});}exports[_0xc991('0x5c')]=function(_0x3fc23f,_0x5df036,_0x40adb3,_0x387ae4,_0x12aac8,_0xe8cbe7){var _0x14bd24,_0x5a61d5,_0x5a7d29,_0x58bc14;_0xe8cbe7[_0xc991('0x5d')]=intUtil['stripTrailingSlash'](_0xe8cbe7[_0xc991('0x5d')]);_0xe8cbe7[_0xc991('0x56')]=intUtil[_0xc991('0x5e')](_0xe8cbe7['remoteUri']);if(_0x12aac8&&_0x12aac8[_0xc991('0x5f')]){logger['info'](_0xc991('0x60'),_0xc991('0x61'));_0x5df036[_0xc991('0x62')]=util['format'](_0xc991('0x63'),_0xe8cbe7[_0xc991('0x5d')],_0x5df036[_0xc991('0x64')],md5(_0x5df036[_0xc991('0x64')]));}else{_0x5df036['recordingURL']='';}return getConnection(_0xe8cbe7)[_0xc991('0x24')](function(_0xc7bed1){_0x58bc14=_0xc7bed1;return getUser(_0xe8cbe7,_0x387ae4[_0xc991('0x65')],_0x58bc14);})[_0xc991('0x24')](function(_0x21ce49){_0x14bd24=_0x21ce49;return getEndUser(_0xe8cbe7,_0x40adb3,_0x5df036[_0xc991('0x66')],_0x5df036[_0xc991('0x67')],_0x58bc14);})[_0xc991('0x24')](function(_0x1ffbda){_0x5a61d5=_0x1ffbda;return getTicket(_0xe8cbe7,_0x14bd24,_0x5a61d5,_0x40adb3,_0x5df036,_0x40adb3[_0xc991('0x68')],_0x58bc14,_0xc991('0x5c'));})[_0xc991('0x24')](function(_0x205eee){_0x5a7d29=_0x205eee;logger[_0xc991('0x2b')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x5a7d29['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x5a7d29['id'],_0x387ae4[_0xc991('0x52')],_0xe8cbe7['type']);switch(_0xe8cbe7[_0xc991('0x3c')]){case _0xc991('0x69'):emit(util[_0xc991('0x42')](_0xc991('0x6a'),_0x387ae4[_0xc991('0x52')]),_0xc991('0x6b'),{'recordId':_0x5a7d29['id']});break;case _0xc991('0x6c'):emit(util[_0xc991('0x42')]('user:%s',_0x387ae4['name']),_0xc991('0x6d'),{'uri':util['format'](_0xc991('0x6e'),_0x58bc14[_0xc991('0x6f')],_0x5a7d29['id'])});break;default:logger[_0xc991('0x70')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xc991('0x71')](function(_0x1da894){logger['error'](_0xc991('0x60'),_0x1da894);});};exports[_0xc991('0x72')]=function(_0x51259a,_0x229819,_0x2bb6c6,_0x127918,_0x3cc1e1,_0x24e36f,_0x5092a9){var _0x12b86c,_0x59a288,_0x2a0742,_0x133082;_0x24e36f[_0xc991('0x5d')]=intUtil['stripTrailingSlash'](_0x24e36f['serverUrl']);_0x24e36f[_0xc991('0x56')]=intUtil[_0xc991('0x5e')](_0x24e36f['remoteUri']);if(_0x5092a9&&_0x5092a9[_0xc991('0x73')]&&_0x5092a9['recordingFormat']!=='none'){logger[_0xc991('0x2b')](_0xc991('0x74'),_0xc991('0x61'));_0x229819[_0xc991('0x62')]=util[_0xc991('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x24e36f[_0xc991('0x5d')],_0x229819['uniqueid'],md5(_0x229819['uniqueid']));}return getConnection(_0x24e36f)[_0xc991('0x24')](function(_0x3efeb){_0x133082=_0x3efeb;return getUser(_0x24e36f,_0x127918[_0xc991('0x65')],_0x133082);})[_0xc991('0x24')](function(_0x5381b2){_0x12b86c=_0x5381b2;return getEndUser(_0x24e36f,_0x2bb6c6,_0x229819[_0xc991('0x75')],_0x229819[_0xc991('0x76')],_0x133082);})[_0xc991('0x24')](function(_0x5bbdf4){_0x59a288=_0x5bbdf4;return getTicket(_0x24e36f,_0x12b86c,_0x59a288,_0x2bb6c6,_0x229819,_0x2bb6c6['Fields'],_0x133082,_0xc991('0x72'));})[_0xc991('0x24')](function(_0x28f9db){_0x2a0742=_0x28f9db;logger[_0xc991('0x2b')](_0xc991('0x77'),_0x2a0742['id']);logger[_0xc991('0x2b')](_0xc991('0x78'),_0x2a0742['id'],_0x127918[_0xc991('0x52')],_0x24e36f[_0xc991('0x3c')]);switch(_0x24e36f[_0xc991('0x3c')]){case _0xc991('0x69'):emit(util[_0xc991('0x42')](_0xc991('0x6a'),_0x127918['name']),_0xc991('0x6b'),{'recordId':_0x2a0742['id']});break;case _0xc991('0x6c'):emit(util[_0xc991('0x42')](_0xc991('0x6a'),_0x127918[_0xc991('0x52')]),_0xc991('0x6d'),{'uri':util[_0xc991('0x42')](_0xc991('0x6e'),_0x133082[_0xc991('0x6f')],_0x2a0742['id'])});break;default:logger[_0xc991('0x70')](_0xc991('0x74'),_0xc991('0x79'));}})[_0xc991('0x71')](function(_0x36f731){logger[_0xc991('0x70')]('[OUTBOUND]',_0x36f731);});};exports[_0xc991('0x7a')]=function(_0x295f46,_0x26d179,_0xcbaf0b,_0x10a2d9,_0x32e903,_0x32d425){var _0x74b6fd,_0x2b0b5c,_0x3f4fb9,_0x1a0964;_0x32d425['serverUrl']=intUtil[_0xc991('0x5e')](_0x32d425[_0xc991('0x5d')]);_0x32d425[_0xc991('0x56')]=intUtil[_0xc991('0x5e')](_0x32d425[_0xc991('0x56')]);if(_0x32e903&&_0x32e903['monitor_format']){logger[_0xc991('0x2b')]('['+_0x26d179['lastevent']['toUpperCase']()+']',_0xc991('0x61'));_0x26d179[_0xc991('0x62')]=util['format'](_0xc991('0x63'),_0x32d425['serverUrl'],_0x26d179[_0xc991('0x64')],md5(_0x26d179['uniqueid']));}else{_0x26d179[_0xc991('0x62')]='';}return getConnection(_0x32d425)[_0xc991('0x24')](function(_0xab3efa){_0x1a0964=_0xab3efa;if(!_[_0xc991('0x7b')](_0x10a2d9)){return getUser(_0x32d425,_0x10a2d9[_0xc991('0x52')],_0x1a0964);}else{return getUser(_0x32d425,null,_0x1a0964);}})[_0xc991('0x24')](function(_0x450cfb){_0x74b6fd=_0x450cfb;return getEndUser(_0x32d425,_0xcbaf0b,_0x26d179['calleridname'],_0x26d179[_0xc991('0x67')],_0x1a0964);})['then'](function(_0xb452f5){_0x2b0b5c=_0xb452f5;return getTicket(_0x32d425,_0x74b6fd,_0x2b0b5c,_0xcbaf0b,_0x26d179,_0xcbaf0b[_0xc991('0x68')],_0x1a0964);})[_0xc991('0x24')](function(_0x17adfa){_0x3f4fb9=_0x17adfa;logger[_0xc991('0x2b')]('['+_0x26d179['lastevent'][_0xc991('0x7c')]()+_0xc991('0x7d'),_0x3f4fb9['id']);logger[_0xc991('0x2b')]('['+_0x26d179[_0xc991('0x7e')][_0xc991('0x7c')]()+_0xc991('0x7f'),_0x32d425['type']);})[_0xc991('0x71')](function(_0x3e758f){logger[_0xc991('0x70')]('['+_0x26d179[_0xc991('0x7e')]['toUpperCase']()+']',_0x3e758f);});}; \ 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 7935d14..027c9ec 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 _0xb65d=['variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident\x20-\x20','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','adminEmail','destcalleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','info','],\x20getAdminUser\x20crm','message','toUpperCase','validateEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','length','active','userId','adminId','userEmail','catch','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','true','System','endUserId','error','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','type','customField','nameField','toLowerCase','content','includes','string','idField','toString'];(function(_0x25ede0,_0x29dc39){var _0x16fc37=function(_0x13e4d1){while(--_0x13e4d1){_0x25ede0['push'](_0x25ede0['shift']());}};_0x16fc37(++_0x29dc39);}(_0xb65d,0x169));var _0xdb65=function(_0x3ceb61,_0x58f311){_0x3ceb61=_0x3ceb61-0x0;var _0x2f66b5=_0xb65d[_0x3ceb61];return _0x2f66b5;};'use strict';var _=require(_0xdb65('0x0'));var Promise=require(_0xdb65('0x1'));var rp=require(_0xdb65('0x2'));var util=require(_0xdb65('0x3'));var md5=require('md5');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xdb65('0x4'));var logger=require(_0xdb65('0x5'))(_0xdb65('0x6'));config[_0xdb65('0x7')]=_[_0xdb65('0x8')](config[_0xdb65('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdb65('0x7')]));function getAdminUser(_0x5d21d8,_0x53ab05,_0x562ee9,_0x3edbd0,_0x4777ed,_0x1b599f){return new Promise(function(_0xfab9c4,_0x29ea07){var _0x27f099={'method':_0xdb65('0x9'),'uri':_0x3edbd0+_0xdb65('0xa')+'&'+_0x4777ed+'&'+_0x1b599f,'auth':_0x53ab05,'json':!![]};return rp(_0x27f099)[_0xdb65('0xb')](function(_0x2579f0){if(_0x2579f0[_0xdb65('0xc')]['length']>0x0){_0x562ee9['adminId']=_0x2579f0['result'][0x0][_0xdb65('0xd')];}logger[_0xdb65('0xe')]('['+[_0x5d21d8['toUpperCase']()]+_0xdb65('0xf'),_0x562ee9);_0xfab9c4(_0x562ee9);})['catch'](function(_0x1f0dd8){logger['error']('['+[_0x5d21d8['toUpperCase']()]+']',_0x1f0dd8[_0xdb65('0x10')]);_0x29ea07(_0x1f0dd8[_0xdb65('0x10')]);});});}function getUser(_0x25ca99,_0x2176c2,_0x283180,_0x25e084,_0x4d0395){return function(_0x211342){logger[_0xdb65('0xe')]('['+[_0x25ca99[_0xdb65('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x211342);return new Promise(function(_0x2df401,_0x159ac1){if(intUtil[_0xdb65('0x12')](_0x211342['userEmail'])){var _0x145b64={'method':_0xdb65('0x9'),'uri':_0x283180+_0xdb65('0x13')+_0x211342['userEmail']+'&'+_0x25e084+'&'+_0x4d0395,'auth':_0x2176c2,'json':!![]};logger[_0xdb65('0xe')]('['+[_0x25ca99[_0xdb65('0x11')]()]+'],\x20getUser\x20rp\x20obj',_0x145b64);return rp(_0x145b64)[_0xdb65('0xb')](function(_0x3be9ef){logger[_0xdb65('0xe')]('['+[_0x25ca99[_0xdb65('0x11')]()]+_0xdb65('0x14'),_0x3be9ef);if(_0x3be9ef['result'][_0xdb65('0x15')]>0x0&&String(_0x3be9ef[_0xdb65('0xc')][0x0][_0xdb65('0x16')])==='true'){_0x211342[_0xdb65('0x17')]=_0x3be9ef['result'][0x0]['sys_id'];}else{_0x211342[_0xdb65('0x17')]=_0x211342[_0xdb65('0x18')];_0x211342[_0xdb65('0x19')]=_0x211342['adminEmail'];}logger[_0xdb65('0xe')]('['+[_0x25ca99[_0xdb65('0x11')]()]+'],\x20getUser\x20crm',_0x211342);_0x2df401(_0x211342);})[_0xdb65('0x1a')](function(_0x43f83e){logger['error']('['+[_0x25ca99[_0xdb65('0x11')]()]+']',_0x43f83e[_0xdb65('0x10')]);_0x159ac1(_0x43f83e[_0xdb65('0x10')]);});}else{logger[_0xdb65('0xe')]('['+[_0x25ca99[_0xdb65('0x11')]()]+']\x20using\x20admin\x20profile');_0x211342['userId']=_0x211342[_0xdb65('0x18')];_0x211342['userEmail']=_0x211342['adminEmail'];_0x2df401(_0x211342);}});};}function createEndUser(_0x19b0db,_0x56e113,_0x1dfa43,_0x889d04,_0x529329){logger[_0xdb65('0xe')]('['+[_0x19b0db[_0xdb65('0x11')]()]+_0xdb65('0x1b'),_0x1dfa43);return new Promise(function(_0x4899f2,_0x1523d9){var _0x2c3b39={'method':_0xdb65('0x1c'),'uri':_0x889d04+'sys_user?'+_0x529329,'body':{'user_name':_0x1dfa43[_0xdb65('0x1d')],'roles':'user','first_name':_0x1dfa43[_0xdb65('0x1d')],'active':_0xdb65('0x1e'),'date_format':_0xdb65('0x1f'),'phone':_0x1dfa43[_0xdb65('0x1d')]},'auth':_0x56e113,'json':!![]};return rp(_0x2c3b39)[_0xdb65('0xb')](function(_0x275d54){logger[_0xdb65('0xe')]('['+[_0x19b0db['toUpperCase']()]+'],\x20EndUser\x20schema',_0x275d54[_0xdb65('0xc')]);_0x1dfa43[_0xdb65('0x20')]=_0x275d54[_0xdb65('0xc')][_0xdb65('0xd')];_0x4899f2(_0x1dfa43);})['catch'](function(_0x6af91d){logger[_0xdb65('0x21')]('['+[_0x19b0db[_0xdb65('0x11')]()]+']',_0x6af91d[_0xdb65('0x10')]);_0x1523d9(_0x6af91d['message']);});});}function getEndUser(_0x3211c6,_0x3d25f6,_0x5d47cd,_0x1733ec,_0x406080){return function(_0x2ea829){logger['info']('['+[_0x3211c6[_0xdb65('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x2ea829);return new Promise(function(_0xd5870d,_0x13becd){var _0xca476d={'method':'GET','uri':_0x5d47cd+_0xdb65('0x22')+_0x2ea829['endUserNumber']+'&'+_0x1733ec+'&'+_0x406080,'auth':_0x3d25f6,'json':!![]};return rp(_0xca476d)['then'](function(_0x4c471a){if(_0x4c471a[_0xdb65('0xc')][_0xdb65('0x15')]>0x0){_0x2ea829[_0xdb65('0x20')]=_0x4c471a[_0xdb65('0xc')][0x0]['sys_id'];logger[_0xdb65('0xe')]('['+[_0x3211c6[_0xdb65('0x11')]()]+_0xdb65('0x23'),_0x2ea829);_0xd5870d(_0x2ea829);}else{return createEndUser(_0x3211c6,_0x3d25f6,_0x2ea829,_0x5d47cd,_0x1733ec)['then'](function(_0xc88eed){logger[_0xdb65('0xe')]('['+[_0x3211c6[_0xdb65('0x11')]()]+_0xdb65('0x24'),_0xc88eed);_0xd5870d(_0xc88eed);});}})[_0xdb65('0x1a')](function(_0x3d683f){logger[_0xdb65('0x21')]('['+[_0x3211c6[_0xdb65('0x11')]()]+']',_0x3d683f[_0xdb65('0x10')]);_0x13becd(_0x3d683f['message']);});});};}function getCustomFields(_0x1be615,_0x4e2b0a){var _0x297fb2={};if(_0x1be615[_0xdb65('0x15')]>0x0){_[_0xdb65('0x25')](_0x1be615,function(_0x315b76){if(_['includes'](['string','picklist'],_0x315b76[_0xdb65('0x26')])&&_0x315b76['nameField']&&!_0x315b76[_0xdb65('0x27')]){_0x297fb2[_0x315b76[_0xdb65('0x28')][_0xdb65('0x29')]()]=_0x315b76[_0xdb65('0x2a')]['toString']();}else if(_[_0xdb65('0x2b')]([_0xdb65('0x2c'),'picklist'],_0x315b76['type'])&&_0x315b76[_0xdb65('0x2d')]&&_0x315b76[_0xdb65('0x27')]){_0x297fb2[_0x315b76[_0xdb65('0x2d')][_0xdb65('0x29')]()]=_0x315b76['content'][_0xdb65('0x2e')]();}else if(_0x315b76[_0xdb65('0x26')]===_0xdb65('0x2f')&&_0x315b76['variableName']&&_0x315b76['idField']&&_0x315b76['customField']){_0x297fb2[_0x315b76[_0xdb65('0x2d')][_0xdb65('0x29')]()]=_0x4e2b0a[_0x315b76[_0xdb65('0x30')]][_0xdb65('0x2e')]();}else if(_0x315b76['type']===_0xdb65('0x31')&&_0x315b76[_0xdb65('0x32')]&&_0x315b76['Variable']['name']&&_0x315b76[_0xdb65('0x2d')]&&_0x315b76[_0xdb65('0x27')]){_0x297fb2[_0x315b76[_0xdb65('0x2d')][_0xdb65('0x29')]()]=_0x4e2b0a[_0x315b76[_0xdb65('0x32')][_0xdb65('0x33')]['toLowerCase']()]['toString']();}});}return _0x297fb2;}function getTicket(_0x3b602b,_0x5a1eca,_0x2e3261,_0x11f92e,_0x5ce8ec,_0x2d183e){return function(_0x177fc2){logger[_0xdb65('0xe')]('['+[_0x3b602b[_0xdb65('0x11')]()]+_0xdb65('0x34'),_0x177fc2);return new Promise(function(_0x4c4b30,_0x1d7650){var _0xb80c30=_0x3b602b[_0xdb65('0x29')]()===_0xdb65('0x35')?_0x177fc2['userId']:_0x177fc2[_0xdb65('0x20')];var _0x3eda23={'method':_0xdb65('0x1c'),'uri':_0x2e3261+_0xdb65('0x36')+'?'+_0x2d183e,'body':Object[_0xdb65('0x37')]({},{'active':'true','caller_id':_0xb80c30,'assigned_to':_0x177fc2['userId'],'short_description':intUtil[_0xdb65('0x38')](_0x11f92e[_0xdb65('0x39')],_0x5ce8ec,'\x20'),'description':intUtil[_0xdb65('0x38')](_0x11f92e[_0xdb65('0x3a')],_0x5ce8ec,'\x0a')},getCustomFields(_0x11f92e[_0xdb65('0x3b')],_0x5ce8ec)),'auth':_0x5a1eca,'json':!![]};return rp(_0x3eda23)[_0xdb65('0xb')](function(_0x10ba4a){logger[_0xdb65('0xe')]('['+[_0x3b602b[_0xdb65('0x11')]()]+_0xdb65('0x3c'),_0x10ba4a[_0xdb65('0xc')]);_0x177fc2[_0xdb65('0x3d')]=_0x10ba4a[_0xdb65('0xc')][_0xdb65('0xd')];_0x177fc2[_0xdb65('0x3e')]=_0x10ba4a[_0xdb65('0xc')][_0xdb65('0x3f')];logger[_0xdb65('0xe')]('['+[_0x3b602b[_0xdb65('0x11')]()]+_0xdb65('0x40'),_0x177fc2);_0x4c4b30(_0x177fc2);})[_0xdb65('0x1a')](function(_0x593883){logger[_0xdb65('0x21')]('['+[_0x3b602b[_0xdb65('0x11')]()]+']',_0x593883[_0xdb65('0x10')]);_0x1d7650(_0x593883[_0xdb65('0x10')]);});});};}function createRemoteTag(_0x653b9e,_0x4792bb,_0x520fe4,_0x1ea6a2){return new Promise(function(_0x44ed10,_0xd9f903){var _0x20eb7f={'method':'POST','uri':_0x520fe4+_0xdb65('0x41')+'?'+_0x1ea6a2,'body':{'short_description':_0x653b9e,'global':!![],'active':!![],'name':_0x653b9e},'auth':_0x4792bb,'json':!![]};return rp(_0x20eb7f)[_0xdb65('0xb')](function(_0x1a69fd){var _0x541b24=_0x1a69fd[_0xdb65('0xc')][_0xdb65('0xd')];_0x44ed10(_0x541b24);});});}function getRemoteTag(_0x57b56d,_0x12ff8e,_0x5a7b17,_0x31b1be,_0x17d0a4){return new Promise(function(_0x32d29d,_0xafe585){var _0x407254={'method':_0xdb65('0x9'),'uri':_0x5a7b17+_0xdb65('0x41')+_0xdb65('0x42')+_0x57b56d+'&'+_0x31b1be,'auth':_0x12ff8e,'json':!![]};return rp(_0x407254)[_0xdb65('0xb')](function(_0x471ab8){if(_0x471ab8[_0xdb65('0xc')]['length']>0x0){var _0x4e3e06=_0x471ab8[_0xdb65('0xc')][0x0][_0xdb65('0xd')];_0x32d29d(_0x4e3e06);}else{return createRemoteTag(_0x57b56d,_0x12ff8e,_0x5a7b17,_0x31b1be)['then'](function(_0x493188){_0x32d29d(_0x493188);});}});});}function assignTagToIncident(_0x33bfda,_0x507206,_0x162260,_0x304ed9,_0xd0b4){return new Promise(function(_0x2cf03d,_0x22b760){var _0x2c2cd7={'method':'POST','uri':_0x162260+'label_entry'+'?'+_0xd0b4,'body':{'label':_0x33bfda,'table':'incident','id_type':'Incident','table_key':_0x304ed9[_0xdb65('0x3d')],'title':_0xdb65('0x43')+_0x304ed9['ticketNumber'],'id_display':_0x304ed9[_0xdb65('0x3e')]},'auth':_0x507206,'json':!![]};return rp(_0x2c2cd7)[_0xdb65('0xb')](function(_0x171454){_0x2cf03d();})[_0xdb65('0x1a')](function(){_0x2cf03d();});});}function manageTags(_0x5e176e,_0x4a32d4,_0x76f5a7,_0x55c2ea,_0x5a1448,_0x14c881,_0x278817){return new Promise(function(_0x2e4441,_0x2acca1){var _0x263f9b=[];_0x4a32d4[_0xdb65('0x25')](function(_0x19f3d7){_0x263f9b['push'](getRemoteTag(_0x19f3d7,_0x76f5a7,_0x55c2ea,_0x14c881,_0x278817));});return Promise[_0xdb65('0x44')](_0x263f9b)['then'](function(_0x5ae12d){if(_0x5ae12d['length']){logger[_0xdb65('0xe')]('['+[_0x5e176e['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x5ae12d);var _0x311fe9=[];_0x5ae12d[_0xdb65('0x25')](function(_0x53e09e){_0x311fe9['push'](assignTagToIncident(_0x53e09e,_0x76f5a7,_0x55c2ea,_0x5a1448,_0x14c881));});return Promise['all'](_0x311fe9)[_0xdb65('0xb')](function(){_0x2e4441();})['catch'](function(){_0x2e4441();});}else{_0x2e4441();}});});}function getTags(_0xedd748,_0x1cba86,_0x2f08bb,_0x262257,_0x52724c,_0x2a0e96){return function(_0x573ea9){return new Promise(function(_0x39a9f8,_0x39bfd4){var _0x307430=[];var _0x48ad14=_0x262257['Tags'];if(_0x48ad14&&_0x48ad14[_0xdb65('0x15')]>0x0){_0x307430=_[_0xdb65('0x45')](_0x48ad14,_0xdb65('0x33'));}if(_0x307430[_0xdb65('0x15')]>0x0){return manageTags(_0xedd748,_0x307430,_0x1cba86,_0x2f08bb,_0x573ea9,_0x52724c,_0x2a0e96)[_0xdb65('0xb')](function(){_0x39a9f8(_0x573ea9);});}else{_0x39a9f8(_0x573ea9);}});};}function emit(_0x1237ca,_0x4f4ba6,_0x1b0a34){var _0x168dcd=_0xdb65('0x46')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xdb65('0x47')+_0xdb65('0x48');var _0x26ee29={'uri':_0x1237ca+_0xdb65('0x49')+_0x1b0a34+_0x168dcd};io['to'](util['format'](_0xdb65('0x4a'),_0x4f4ba6))[_0xdb65('0x4b')]('trigger:browser:url',_0x26ee29);}exports['cs']=function(_0xc4561b,_0x39de9c,_0x50295a,_0x136d67,_0x8a5a64,_0x3e3e2e,_0x4502ef,_0x69b08e){var _0x120947={};var _0x2c399e={'user':_0x3e3e2e[_0xdb65('0x4c')],'pass':_0x3e3e2e[_0xdb65('0x4d')]};var _0xd7883d=_0xdb65('0x4e');var _0x432ab1='sysparm_display_value=true';_0x3e3e2e[_0xdb65('0x4f')]=intUtil[_0xdb65('0x50')](_0x3e3e2e[_0xdb65('0x4f')]);_0x3e3e2e['serverUrl']=intUtil[_0xdb65('0x50')](_0x3e3e2e[_0xdb65('0x51')]);var _0x200ef1=util[_0xdb65('0x52')](_0xdb65('0x53'),_0x3e3e2e[_0xdb65('0x4f')]);_0x120947[_0xdb65('0x19')]=!_[_0xdb65('0x54')](_0x136d67)?_0x136d67[_0xdb65('0x55')]:null;_0x120947[_0xdb65('0x56')]=_0x3e3e2e['email'];_0x120947[_0xdb65('0x1d')]=_0x69b08e[_0xdb65('0x29')]()===_0xdb65('0x35')?_0x39de9c[_0xdb65('0x57')]:_0x39de9c['calleridnum'];_0x120947['callDirection']=_0x69b08e===_0xdb65('0x58')||_0x69b08e===_0xdb65('0x59')?_0xdb65('0x58'):_0xdb65('0x35');var _0x32ad7b=util['format'](_0xdb65('0x5a'),_0x3e3e2e['serverUrl'],_0x39de9c[_0xdb65('0x5b')],md5(_0x39de9c[_0xdb65('0x5b')]));if(_0x8a5a64&&_0x8a5a64[_0xdb65('0x5c')]){logger[_0xdb65('0xe')](_0xdb65('0x5d'),_0xdb65('0x5e'));_0x39de9c['recordingURL']=_0x32ad7b;}else if(_0x4502ef&&_0x4502ef['recordingFormat']&&_0x4502ef[_0xdb65('0x5f')]!==_0xdb65('0x60')){logger['info']('[OUTBOUND]',_0xdb65('0x5e'));_0x39de9c[_0xdb65('0x61')]=_0x32ad7b;}else{_0x39de9c[_0xdb65('0x61')]='';}return getAdminUser(_0x69b08e,_0x2c399e,_0x120947,_0x200ef1,_0x432ab1,_0xd7883d)[_0xdb65('0xb')](getUser(_0x69b08e,_0x2c399e,_0x200ef1,_0x432ab1,_0xd7883d))['then'](getEndUser(_0x69b08e,_0x2c399e,_0x200ef1,_0x432ab1,_0xd7883d))[_0xdb65('0xb')](getTicket(_0x69b08e,_0x2c399e,_0x200ef1,_0x50295a,_0x39de9c,_0x432ab1))[_0xdb65('0xb')](function(_0x32b7bb){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x32b7bb['ticketId']));logger[_0xdb65('0xe')](util[_0xdb65('0x52')](_0xdb65('0x62'),_0x69b08e));if(_0x69b08e!==_0xdb65('0x59')){logger[_0xdb65('0xe')]('['+[_0x69b08e[_0xdb65('0x11')]()]+']',_0xdb65('0x63'));emit(_0x3e3e2e[_0xdb65('0x4f')],_0x136d67['name'],_0x32b7bb[_0xdb65('0x3d')]);}})['catch'](function(_0x3ecfbf){logger['error']('['+[_0x69b08e[_0xdb65('0x11')]()]+_0xdb65('0x64'),util[_0xdb65('0x65')](_0x3ecfbf,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4f94=['POST','getString','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','incident','Incident','Incident\x20-\x20','ticketNumber','push','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','format','%s/api/now/table/','isNil','email','adminEmail','destcalleridnum','queue','serverUrl','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','servicenow','defaults','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','info','toUpperCase','error','message','],\x20getUser\x20input\x20crm','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','adminId','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','userId','],\x20createEndUser\x20input\x20crm','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','length','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','type','nameField','customField','toLowerCase','content','string','picklist','idField','toString','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4f94,0x16f));var _0x44f9=function(_0xacda4c,_0x3db917){_0xacda4c=_0xacda4c-0x0;var _0x5b0c59=_0x4f94[_0xacda4c];return _0x5b0c59;};'use strict';var _=require(_0x44f9('0x0'));var Promise=require(_0x44f9('0x1'));var rp=require(_0x44f9('0x2'));var util=require(_0x44f9('0x3'));var md5=require('md5');var Redis=require(_0x44f9('0x4'));var intUtil=require(_0x44f9('0x5'));var config=require(_0x44f9('0x6'));var logger=require('../../../../config/logger')(_0x44f9('0x7'));config['redis']=_[_0x44f9('0x8')](config[_0x44f9('0x9')],{'host':_0x44f9('0xa'),'port':0x18eb});var io=require(_0x44f9('0xb'))(new Redis(config[_0x44f9('0x9')]));function getAdminUser(_0x3796f0,_0x13df97,_0x5c8b74,_0x290e00,_0x5ed647,_0x5305e4){return new Promise(function(_0x281b32,_0x1c662c){var _0x35f7e7={'method':_0x44f9('0xc'),'uri':_0x290e00+_0x44f9('0xd')+'&'+_0x5ed647+'&'+_0x5305e4,'auth':_0x13df97,'json':!![]};return rp(_0x35f7e7)[_0x44f9('0xe')](function(_0x24df4a){if(_0x24df4a[_0x44f9('0xf')]['length']>0x0){_0x5c8b74['adminId']=_0x24df4a[_0x44f9('0xf')][0x0][_0x44f9('0x10')];}logger[_0x44f9('0x11')]('['+[_0x3796f0[_0x44f9('0x12')]()]+'],\x20getAdminUser\x20crm',_0x5c8b74);_0x281b32(_0x5c8b74);})['catch'](function(_0x226c1f){logger[_0x44f9('0x13')]('['+[_0x3796f0[_0x44f9('0x12')]()]+']',_0x226c1f[_0x44f9('0x14')]);_0x1c662c(_0x226c1f[_0x44f9('0x14')]);});});}function getUser(_0x241ba2,_0x2293d1,_0x1cc3e5,_0x1526a2,_0x2bafb0){return function(_0x182b53){logger[_0x44f9('0x11')]('['+[_0x241ba2[_0x44f9('0x12')]()]+_0x44f9('0x15'),_0x182b53);return new Promise(function(_0x192b44,_0x48658b){if(intUtil['validateEmail'](_0x182b53['userEmail'])){var _0x462b4b={'method':_0x44f9('0xc'),'uri':_0x1cc3e5+_0x44f9('0x16')+_0x182b53[_0x44f9('0x17')]+'&'+_0x1526a2+'&'+_0x2bafb0,'auth':_0x2293d1,'json':!![]};logger[_0x44f9('0x11')]('['+[_0x241ba2[_0x44f9('0x12')]()]+_0x44f9('0x18'),_0x462b4b);return rp(_0x462b4b)[_0x44f9('0xe')](function(_0x4f5d68){logger['info']('['+[_0x241ba2[_0x44f9('0x12')]()]+_0x44f9('0x19'),_0x4f5d68);if(_0x4f5d68[_0x44f9('0xf')]['length']>0x0&&String(_0x4f5d68[_0x44f9('0xf')][0x0][_0x44f9('0x1a')])===_0x44f9('0x1b')){_0x182b53['userId']=_0x4f5d68[_0x44f9('0xf')][0x0][_0x44f9('0x10')];}else{_0x182b53['userId']=_0x182b53[_0x44f9('0x1c')];_0x182b53[_0x44f9('0x17')]=_0x182b53['adminEmail'];}logger[_0x44f9('0x11')]('['+[_0x241ba2[_0x44f9('0x12')]()]+_0x44f9('0x1d'),_0x182b53);_0x192b44(_0x182b53);})[_0x44f9('0x1e')](function(_0x88bcda){logger[_0x44f9('0x13')]('['+[_0x241ba2[_0x44f9('0x12')]()]+']',_0x88bcda[_0x44f9('0x14')]);_0x48658b(_0x88bcda[_0x44f9('0x14')]);});}else{logger[_0x44f9('0x11')]('['+[_0x241ba2[_0x44f9('0x12')]()]+_0x44f9('0x1f'));_0x182b53[_0x44f9('0x20')]=_0x182b53[_0x44f9('0x1c')];_0x182b53[_0x44f9('0x17')]=_0x182b53['adminEmail'];_0x192b44(_0x182b53);}});};}function createEndUser(_0x44b89c,_0x271e8b,_0x3d279e,_0x18035d,_0x513878){logger['info']('['+[_0x44b89c['toUpperCase']()]+_0x44f9('0x21'),_0x3d279e);return new Promise(function(_0x59d1a9,_0x2353fe){var _0x15e745={'method':'POST','uri':_0x18035d+'sys_user?'+_0x513878,'body':{'user_name':_0x3d279e[_0x44f9('0x22')],'roles':_0x44f9('0x23'),'first_name':_0x3d279e[_0x44f9('0x22')],'active':_0x44f9('0x1b'),'date_format':_0x44f9('0x24'),'phone':_0x3d279e['endUserNumber']},'auth':_0x271e8b,'json':!![]};return rp(_0x15e745)['then'](function(_0x55243c){logger[_0x44f9('0x11')]('['+[_0x44b89c[_0x44f9('0x12')]()]+_0x44f9('0x25'),_0x55243c[_0x44f9('0xf')]);_0x3d279e[_0x44f9('0x26')]=_0x55243c[_0x44f9('0xf')]['sys_id'];_0x59d1a9(_0x3d279e);})[_0x44f9('0x1e')](function(_0x4a6640){logger[_0x44f9('0x13')]('['+[_0x44b89c[_0x44f9('0x12')]()]+']',_0x4a6640['message']);_0x2353fe(_0x4a6640[_0x44f9('0x14')]);});});}function getEndUser(_0x4e3889,_0x5d9469,_0x4caf3a,_0x58b4f3,_0x2201c2){return function(_0x51a68b){logger[_0x44f9('0x11')]('['+[_0x4e3889['toUpperCase']()]+_0x44f9('0x27'),_0x51a68b);return new Promise(function(_0x417ca8,_0x34e5db){var _0x5b9877={'method':_0x44f9('0xc'),'uri':_0x4caf3a+_0x44f9('0x28')+_0x51a68b[_0x44f9('0x22')]+'&'+_0x58b4f3+'&'+_0x2201c2,'auth':_0x5d9469,'json':!![]};return rp(_0x5b9877)[_0x44f9('0xe')](function(_0xf943e){if(_0xf943e['result'][_0x44f9('0x29')]>0x0){_0x51a68b[_0x44f9('0x26')]=_0xf943e[_0x44f9('0xf')][0x0][_0x44f9('0x10')];logger[_0x44f9('0x11')]('['+[_0x4e3889[_0x44f9('0x12')]()]+_0x44f9('0x2a'),_0x51a68b);_0x417ca8(_0x51a68b);}else{return createEndUser(_0x4e3889,_0x5d9469,_0x51a68b,_0x4caf3a,_0x58b4f3)[_0x44f9('0xe')](function(_0x5f24c1){logger[_0x44f9('0x11')]('['+[_0x4e3889[_0x44f9('0x12')]()]+_0x44f9('0x2b'),_0x5f24c1);_0x417ca8(_0x5f24c1);});}})['catch'](function(_0x214d1f){logger[_0x44f9('0x13')]('['+[_0x4e3889[_0x44f9('0x12')]()]+']',_0x214d1f[_0x44f9('0x14')]);_0x34e5db(_0x214d1f[_0x44f9('0x14')]);});});};}function getCustomFields(_0x338e08,_0x23196b){var _0x3b699b={};if(_0x338e08['length']>0x0){_[_0x44f9('0x2c')](_0x338e08,function(_0xc8f3ec){if(_[_0x44f9('0x2d')](['string','picklist'],_0xc8f3ec[_0x44f9('0x2e')])&&_0xc8f3ec[_0x44f9('0x2f')]&&!_0xc8f3ec[_0x44f9('0x30')]){_0x3b699b[_0xc8f3ec[_0x44f9('0x2f')][_0x44f9('0x31')]()]=_0xc8f3ec[_0x44f9('0x32')]['toString']();}else if(_[_0x44f9('0x2d')]([_0x44f9('0x33'),_0x44f9('0x34')],_0xc8f3ec[_0x44f9('0x2e')])&&_0xc8f3ec[_0x44f9('0x35')]&&_0xc8f3ec[_0x44f9('0x30')]){_0x3b699b[_0xc8f3ec[_0x44f9('0x35')]['toLowerCase']()]=_0xc8f3ec[_0x44f9('0x32')][_0x44f9('0x36')]();}else if(_0xc8f3ec['type']==='variable'&&_0xc8f3ec[_0x44f9('0x37')]&&_0xc8f3ec[_0x44f9('0x35')]&&_0xc8f3ec[_0x44f9('0x30')]){_0x3b699b[_0xc8f3ec[_0x44f9('0x35')][_0x44f9('0x31')]()]=_0x23196b[_0xc8f3ec[_0x44f9('0x37')]][_0x44f9('0x36')]();}else if(_0xc8f3ec[_0x44f9('0x2e')]===_0x44f9('0x38')&&_0xc8f3ec[_0x44f9('0x39')]&&_0xc8f3ec['Variable'][_0x44f9('0x3a')]&&_0xc8f3ec[_0x44f9('0x35')]&&_0xc8f3ec['customField']){_0x3b699b[_0xc8f3ec[_0x44f9('0x35')][_0x44f9('0x31')]()]=_0x23196b[_0xc8f3ec[_0x44f9('0x39')][_0x44f9('0x3a')][_0x44f9('0x31')]()][_0x44f9('0x36')]();}});}return _0x3b699b;}function getTicket(_0x2db360,_0x35709a,_0x3b8761,_0x33b1df,_0x57e63a,_0x39f7fa){return function(_0x5aef52){logger['info']('['+[_0x2db360[_0x44f9('0x12')]()]+_0x44f9('0x3b'),_0x5aef52);return new Promise(function(_0xcd828c,_0x1f77c5){var _0xcec032=_0x2db360[_0x44f9('0x31')]()===_0x44f9('0x3c')?_0x5aef52[_0x44f9('0x20')]:_0x5aef52[_0x44f9('0x26')];var _0x25601c={'method':_0x44f9('0x3d'),'uri':_0x3b8761+'incident'+'?'+_0x39f7fa,'body':Object['assign']({},{'active':'true','caller_id':_0xcec032,'assigned_to':_0x5aef52[_0x44f9('0x20')],'short_description':intUtil[_0x44f9('0x3e')](_0x33b1df['Subjects'],_0x57e63a,'\x20'),'description':intUtil[_0x44f9('0x3e')](_0x33b1df['Descriptions'],_0x57e63a,'\x0a')},getCustomFields(_0x33b1df[_0x44f9('0x3f')],_0x57e63a)),'auth':_0x35709a,'json':!![]};return rp(_0x25601c)['then'](function(_0x57739b){logger[_0x44f9('0x11')]('['+[_0x2db360['toUpperCase']()]+_0x44f9('0x40'),_0x57739b[_0x44f9('0xf')]);_0x5aef52[_0x44f9('0x41')]=_0x57739b[_0x44f9('0xf')][_0x44f9('0x10')];_0x5aef52['ticketNumber']=_0x57739b[_0x44f9('0xf')][_0x44f9('0x42')];logger['info']('['+[_0x2db360[_0x44f9('0x12')]()]+_0x44f9('0x43'),_0x5aef52);_0xcd828c(_0x5aef52);})[_0x44f9('0x1e')](function(_0x20a2e8){logger[_0x44f9('0x13')]('['+[_0x2db360[_0x44f9('0x12')]()]+']',_0x20a2e8[_0x44f9('0x14')]);_0x1f77c5(_0x20a2e8[_0x44f9('0x14')]);});});};}function createRemoteTag(_0x4aad82,_0x384fec,_0x1a4a6d,_0x52f267){return new Promise(function(_0x4bdfae,_0x327ecb){var _0x5be391={'method':'POST','uri':_0x1a4a6d+_0x44f9('0x44')+'?'+_0x52f267,'body':{'short_description':_0x4aad82,'global':!![],'active':!![],'name':_0x4aad82},'auth':_0x384fec,'json':!![]};return rp(_0x5be391)[_0x44f9('0xe')](function(_0xf80197){var _0x4bd6e3=_0xf80197[_0x44f9('0xf')][_0x44f9('0x10')];_0x4bdfae(_0x4bd6e3);});});}function getRemoteTag(_0x13ca44,_0x57d8ae,_0x361d59,_0x59da01,_0x1b4631){return new Promise(function(_0x3b7b13,_0x3c5538){var _0x52590d={'method':'GET','uri':_0x361d59+'label'+_0x44f9('0x45')+_0x13ca44+'&'+_0x59da01,'auth':_0x57d8ae,'json':!![]};return rp(_0x52590d)[_0x44f9('0xe')](function(_0x270c89){if(_0x270c89[_0x44f9('0xf')][_0x44f9('0x29')]>0x0){var _0xafd335=_0x270c89[_0x44f9('0xf')][0x0][_0x44f9('0x10')];_0x3b7b13(_0xafd335);}else{return createRemoteTag(_0x13ca44,_0x57d8ae,_0x361d59,_0x59da01)[_0x44f9('0xe')](function(_0x431ba4){_0x3b7b13(_0x431ba4);});}});});}function assignTagToIncident(_0x250f07,_0x3e0e5f,_0x1f2960,_0x2f7832,_0x13f34d){return new Promise(function(_0x49a5ab,_0x19c8fb){var _0x317741={'method':_0x44f9('0x3d'),'uri':_0x1f2960+'label_entry'+'?'+_0x13f34d,'body':{'label':_0x250f07,'table':_0x44f9('0x46'),'id_type':_0x44f9('0x47'),'table_key':_0x2f7832[_0x44f9('0x41')],'title':_0x44f9('0x48')+_0x2f7832['ticketNumber'],'id_display':_0x2f7832[_0x44f9('0x49')]},'auth':_0x3e0e5f,'json':!![]};return rp(_0x317741)[_0x44f9('0xe')](function(_0x425adf){_0x49a5ab();})[_0x44f9('0x1e')](function(){_0x49a5ab();});});}function manageTags(_0x3b411b,_0xa94043,_0x14007e,_0x3fcf2f,_0x333fe9,_0x175cf6,_0x48a20e){return new Promise(function(_0x5c7b9d,_0x52693b){var _0x5d396d=[];_0xa94043[_0x44f9('0x2c')](function(_0x261585){_0x5d396d[_0x44f9('0x4a')](getRemoteTag(_0x261585,_0x14007e,_0x3fcf2f,_0x175cf6,_0x48a20e));});return Promise[_0x44f9('0x4b')](_0x5d396d)[_0x44f9('0xe')](function(_0x4b381a){if(_0x4b381a[_0x44f9('0x29')]){logger[_0x44f9('0x11')]('['+[_0x3b411b[_0x44f9('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x4b381a);var _0x2c57bd=[];_0x4b381a['forEach'](function(_0x3cea39){_0x2c57bd[_0x44f9('0x4a')](assignTagToIncident(_0x3cea39,_0x14007e,_0x3fcf2f,_0x333fe9,_0x175cf6));});return Promise[_0x44f9('0x4b')](_0x2c57bd)[_0x44f9('0xe')](function(){_0x5c7b9d();})[_0x44f9('0x1e')](function(){_0x5c7b9d();});}else{_0x5c7b9d();}});});}function getTags(_0x31715a,_0x31da9d,_0x198cc0,_0x5f3260,_0x504688,_0x526bdb){return function(_0x49a6cf){return new Promise(function(_0x2d19ec,_0x18a854){var _0x3fe457=[];var _0x1da5e4=_0x5f3260['Tags'];if(_0x1da5e4&&_0x1da5e4[_0x44f9('0x29')]>0x0){_0x3fe457=_[_0x44f9('0x4c')](_0x1da5e4,_0x44f9('0x3a'));}if(_0x3fe457[_0x44f9('0x29')]>0x0){return manageTags(_0x31715a,_0x3fe457,_0x31da9d,_0x198cc0,_0x49a6cf,_0x504688,_0x526bdb)[_0x44f9('0xe')](function(){_0x2d19ec(_0x49a6cf);});}else{_0x2d19ec(_0x49a6cf);}});};}function emit(_0x55cc09,_0x3bfdff,_0x13710a){var _0x2962b2=_0x44f9('0x4d')+_0x44f9('0x4e')+_0x44f9('0x4f')+_0x44f9('0x50');var _0x77d9f8={'uri':_0x55cc09+_0x44f9('0x51')+_0x13710a+_0x2962b2};io['to'](util['format'](_0x44f9('0x52'),_0x3bfdff))[_0x44f9('0x53')](_0x44f9('0x54'),_0x77d9f8);}exports['cs']=function(_0x22c770,_0x378f96,_0xbd6554,_0x1bc892,_0x41c4c0,_0x5b7dc7,_0x41215e,_0x47cb8e){var _0x5aac0f={};var _0x205a88={'user':_0x5b7dc7[_0x44f9('0x55')],'pass':_0x5b7dc7[_0x44f9('0x56')]};var _0x52356c=_0x44f9('0x57');var _0x394959=_0x44f9('0x58');_0x5b7dc7[_0x44f9('0x59')]=intUtil[_0x44f9('0x5a')](_0x5b7dc7[_0x44f9('0x59')]);_0x5b7dc7['serverUrl']=intUtil[_0x44f9('0x5a')](_0x5b7dc7['serverUrl']);var _0x5a5446=util[_0x44f9('0x5b')](_0x44f9('0x5c'),_0x5b7dc7[_0x44f9('0x59')]);_0x5aac0f['userEmail']=!_[_0x44f9('0x5d')](_0x1bc892)?_0x1bc892[_0x44f9('0x5e')]:null;_0x5aac0f[_0x44f9('0x5f')]=_0x5b7dc7[_0x44f9('0x5e')];_0x5aac0f[_0x44f9('0x22')]=_0x47cb8e[_0x44f9('0x31')]()===_0x44f9('0x3c')?_0x378f96[_0x44f9('0x60')]:_0x378f96['calleridnum'];_0x5aac0f['callDirection']=_0x47cb8e===_0x44f9('0x61')||_0x47cb8e==='unmanaged'?_0x44f9('0x61'):_0x44f9('0x3c');var _0x658f97=util[_0x44f9('0x5b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5b7dc7[_0x44f9('0x62')],_0x378f96['uniqueid'],md5(_0x378f96[_0x44f9('0x63')]));if(_0x41c4c0&&_0x41c4c0['monitor_format']){logger[_0x44f9('0x11')]('[QUEUE]',_0x44f9('0x64'));_0x378f96[_0x44f9('0x65')]=_0x658f97;}else if(_0x41215e&&_0x41215e[_0x44f9('0x66')]&&_0x41215e[_0x44f9('0x66')]!==_0x44f9('0x67')){logger[_0x44f9('0x11')]('[OUTBOUND]',_0x44f9('0x64'));_0x378f96['recordingURL']=_0x658f97;}else{_0x378f96[_0x44f9('0x65')]='';}return getAdminUser(_0x47cb8e,_0x205a88,_0x5aac0f,_0x5a5446,_0x394959,_0x52356c)[_0x44f9('0xe')](getUser(_0x47cb8e,_0x205a88,_0x5a5446,_0x394959,_0x52356c))['then'](getEndUser(_0x47cb8e,_0x205a88,_0x5a5446,_0x394959,_0x52356c))['then'](getTicket(_0x47cb8e,_0x205a88,_0x5a5446,_0xbd6554,_0x378f96,_0x394959))[_0x44f9('0xe')](function(_0x4be869){logger['info'](util['format'](_0x44f9('0x68'),_0x4be869[_0x44f9('0x41')]));logger[_0x44f9('0x11')](util[_0x44f9('0x5b')]('call\x20direction:\x20%s',_0x47cb8e));if(_0x47cb8e!=='unmanaged'){logger[_0x44f9('0x11')]('['+[_0x47cb8e[_0x44f9('0x12')]()]+']',_0x44f9('0x69'));emit(_0x5b7dc7['remoteUri'],_0x1bc892[_0x44f9('0x3a')],_0x4be869[_0x44f9('0x41')]);}})['catch'](function(_0x3d2404){logger[_0x44f9('0x13')]('['+[_0x47cb8e[_0x44f9('0x12')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x44f9('0x6a')](_0x3d2404,{'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 524d098..fcac726 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 _0x31a2=['user:%s','catch','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','lastevent','toUpperCase','The\x20User\x20ID\x20is:','Inbound','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','assigned_user_id','created_by','getString','Descriptions','date_start','toISOString','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','JSON','Calls','format','Basic\x20%s','apiKey','base64','isNil','get_entry_list','Employees','user_name','then','entry_list','find','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','phone_home','set_entry','stringify','first_name','','Enduser\x20created.','[HTTP]','type','string','nameField','customField','toString','custom_fields','content','variable','customVariable','Variable','toLowerCase','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','[QUEUE]','recordingURL','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x4a3901,_0x29cfad){var _0x1e40e7=function(_0x1fa7b1){while(--_0x1fa7b1){_0x4a3901['push'](_0x4a3901['shift']());}};_0x1e40e7(++_0x29cfad);}(_0x31a2,0xf1));var _0x231a=function(_0x170c2a,_0x317514){_0x170c2a=_0x170c2a-0x0;var _0x2596ef=_0x31a2[_0x170c2a];return _0x2596ef;};'use strict';var _=require('lodash');var rp=require(_0x231a('0x0'));var BPromise=require(_0x231a('0x1'));var md5=require(_0x231a('0x2'));var util=require(_0x231a('0x3'));var Redis=require(_0x231a('0x4'));var intUtil=require(_0x231a('0x5'));var config=require(_0x231a('0x6'));var logger=require(_0x231a('0x7'))(_0x231a('0x8'));config[_0x231a('0x9')]=_['defaults'](config['redis'],{'host':_0x231a('0xa'),'port':0x18eb});var io=require(_0x231a('0xb'))(new Redis(config[_0x231a('0x9')]));var def={'method':_0x231a('0xc'),'json':!![]};function emit(_0x47589c,_0x164d46,_0x2b3f95){io['to'](_0x47589c)['emit'](_0x164d46,_0x2b3f95);}function getTicket(_0x5e9144,_0x4b69f9,_0x34ba26,_0x5ac689,_0x37fadf,_0x1e5375,_0x40b437,_0x57da63){logger[_0x231a('0xd')](_0x231a('0xe'));var _0x232381=new Date();var _0x168851=[{'name':_0x231a('0xf'),'value':intUtil['getString'](_0x5ac689['Subjects'],_0x37fadf,'\x20')},{'name':_0x231a('0x10'),'value':_0x4b69f9['id']},{'name':_0x231a('0x11'),'value':_0x4b69f9['id']},{'name':'description','value':intUtil[_0x231a('0x12')](_0x5ac689[_0x231a('0x13')],_0x37fadf,'\x0a')},{'name':_0x231a('0x14'),'value':_0x232381[_0x231a('0x15')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x231a('0x16'),'value':'0'},{'name':_0x231a('0x17'),'value':'15'},{'name':_0x231a('0x18'),'value':_0x34ba26['id']},{'name':_0x231a('0x19'),'value':_0x231a('0x1a')},{'name':_0x231a('0x1b'),'value':_0x34ba26[_0x231a('0xf')]},{'name':_0x231a('0x1c'),'value':_0x57da63}];if(_0x1e5375[_0x231a('0x1d')]){_[_0x231a('0x1e')](_0x1e5375,function(_0x391aa1){if(_0x37fadf[_0x391aa1[_0x231a('0x1f')]]){_0x168851[_0x231a('0x20')]({'name':_0x391aa1[_0x231a('0x21')],'value':_0x37fadf[_0x391aa1[_0x231a('0x1f')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x231a('0x22'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x40b437['id'],'module_name':_0x231a('0x23'),'name_value_list':_0x168851})}});}function getAuth(_0x4fb6d4){return util[_0x231a('0x24')](_0x231a('0x25'),new Buffer(_0x4fb6d4[_0x231a('0x26')]+':X')['toString'](_0x231a('0x27')));}function getServerInfo(_0x4a3cee){return request({'form':{'method':'get_server_info','input_type':_0x231a('0x22'),'response_type':_0x231a('0x22'),'rest_data':JSON['stringify']({'session':_0x4a3cee['id']})}});}function getUser(_0x11aae5,_0xfe5ce0,_0x4f48dd){if(!_[_0x231a('0x28')](_0xfe5ce0)){logger[_0x231a('0xd')]('Getting\x20agent\x20with\x20name',_0xfe5ce0);return request({'form':{'method':_0x231a('0x29'),'input_type':_0x231a('0x22'),'response_type':_0x231a('0x22'),'rest_data':JSON['stringify']({'session':_0x4f48dd['id'],'module_name':_0x231a('0x2a'),'query':util[_0x231a('0x24')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0xfe5ce0),'order_by':'','offset':'0','select_fields':['id','name',_0x231a('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x231a('0x2c')](function(_0xe310f2){if(_0xe310f2[_0x231a('0x2d')][_0x231a('0x1d')]){var _0x3d1a4e=_[_0x231a('0x2e')](_0xe310f2[_0x231a('0x2d')],function(_0x14e3be){return _0x14e3be['name_value_list'][_0x231a('0x2b')][_0x231a('0x2f')]===_0xfe5ce0;});if(_0x3d1a4e){logger[_0x231a('0xd')](_0x231a('0x30'));return BPromise[_0x231a('0x31')]({'id':_0x3d1a4e[_0x231a('0x32')]['id'][_0x231a('0x2f')],'name':_0x3d1a4e['name_value_list'][_0x231a('0xf')][_0x231a('0x2f')]});}}logger[_0x231a('0xd')](_0x231a('0x33'));return BPromise[_0x231a('0x31')]({'id':_0x4f48dd[_0x231a('0x32')][_0x231a('0x34')][_0x231a('0x2f')],'name':_0x4f48dd[_0x231a('0x32')]['user_name']['value']});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x4f48dd[_0x231a('0x32')][_0x231a('0x34')][_0x231a('0x2f')],'name':_0x4f48dd[_0x231a('0x32')][_0x231a('0x2b')][_0x231a('0x2f')]});}}function getEndUser(_0x3cbde0,_0x199cfb,_0x252964,_0x4caed5){logger[_0x231a('0xd')]('Searching\x20enduser\x20with\x20phone',_0x252964);return request({'form':{'method':_0x231a('0x29'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x4caed5['id'],'module_name':'Contacts','query':util[_0x231a('0x24')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x252964),'order_by':'','offset':'0','select_fields':['id',_0x231a('0xf'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x231a('0x2c')](function(_0x2bb314){if(_0x2bb314[_0x231a('0x2d')]['length']){var _0x6be943=_['find'](_0x2bb314[_0x231a('0x2d')],function(_0x455d51){return _0x455d51[_0x231a('0x32')][_0x231a('0x35')]['value']===_0x252964;});if(_0x6be943){logger[_0x231a('0xd')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x6be943[_0x231a('0x32')]['id'][_0x231a('0x2f')],'name':_0x6be943['name_value_list'][_0x231a('0xf')][_0x231a('0x2f')],'phone':_0x6be943[_0x231a('0x32')]['phone_home']['value']});}}else{logger[_0x231a('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x231a('0x36'),'input_type':_0x231a('0x22'),'response_type':_0x231a('0x22'),'rest_data':JSON[_0x231a('0x37')]({'session':_0x4caed5['id'],'module_name':_0x231a('0x1a'),'name_value_list':[{'name':_0x231a('0x38'),'value':_0x199cfb!==_0x231a('0x39')?_0x199cfb:util['format']('Caller\x20-\x20%s',_0x252964)},{'name':'phone_home','value':_0x252964}]})}})['then'](function(_0x4bc9b6){logger['info'](_0x231a('0x3a'));return BPromise['resolve']({'id':_0x4bc9b6['id'],'name':_0x4bc9b6[_0x231a('0x2d')][_0x231a('0x38')][_0x231a('0x2f')],'phone':_0x4bc9b6[_0x231a('0x2d')][_0x231a('0x35')][_0x231a('0x2f')]});});}});}function request(_0x4223f9){logger['debug'](_0x231a('0x3b'),JSON[_0x231a('0x37')](_0x4223f9));return rp(_['merge'](def,_0x4223f9));}function getTags(_0x1eecf4,_0x1880fe){var _0x322cd9=[];if(_0x1eecf4&&_0x1eecf4[_0x231a('0x1d')]>0x0){_0x322cd9=_['map'](_0x1eecf4,_0x1880fe);}return _0x322cd9;}function getCustomFields(_0x980a45,_0x1f4027){var _0x1026f7=[];var _0x5b4332={'custom_fields':[]};if(_0x980a45[_0x231a('0x1d')]>0x0){_[_0x231a('0x1e')](_0x980a45,function(_0x7e01d0){if(_0x7e01d0[_0x231a('0x3c')]===_0x231a('0x3d')&&_0x7e01d0[_0x231a('0x3e')]&&!_0x7e01d0[_0x231a('0x3f')]){_0x5b4332[_0x7e01d0['nameField']['toLowerCase']()]=_0x7e01d0['content'][_0x231a('0x40')]();}else if(_0x7e01d0[_0x231a('0x3c')]===_0x231a('0x3d')&&_0x7e01d0[_0x231a('0x21')]&&_0x7e01d0[_0x231a('0x3f')]){_0x5b4332[_0x231a('0x41')][_0x231a('0x20')]({'id':_0x7e01d0[_0x231a('0x21')],'value':_0x7e01d0[_0x231a('0x42')][_0x231a('0x40')]()});}else if(_0x7e01d0[_0x231a('0x3c')]===_0x231a('0x43')&&_0x7e01d0[_0x231a('0x1f')]&&_0x7e01d0[_0x231a('0x21')]&&_0x7e01d0[_0x231a('0x3f')]){_0x1f4027[_0x7e01d0[_0x231a('0x1f')]]&&_0x5b4332[_0x231a('0x41')][_0x231a('0x20')]({'id':_0x7e01d0['idField'],'value':_0x1f4027[_0x7e01d0[_0x231a('0x1f')]][_0x231a('0x40')]()});}else if(_0x7e01d0['type']===_0x231a('0x44')&&_0x7e01d0['Variable']&&_0x7e01d0[_0x231a('0x45')][_0x231a('0xf')]&&_0x7e01d0['idField']&&_0x7e01d0[_0x231a('0x3f')]){_0x1f4027[_0x7e01d0[_0x231a('0x45')][_0x231a('0xf')]['toLowerCase']()]&&_0x5b4332[_0x231a('0x41')][_0x231a('0x20')]({'id':_0x7e01d0['idField'],'value':_0x1f4027[_0x7e01d0[_0x231a('0x45')]['name'][_0x231a('0x46')]()][_0x231a('0x40')]()});}});}return _0x5b4332;}function getConnection(_0x28cd72){return request({'method':'POST','form':{'method':'login','input_type':'JSON','response_type':_0x231a('0x22'),'rest_data':JSON[_0x231a('0x37')]({'user_auth':{'user_name':_0x28cd72[_0x231a('0x47')],'password':_0x28cd72[_0x231a('0x48')],'encryption':_0x231a('0x49')},'application':_0x231a('0x4a')})}})[_0x231a('0x2c')](function(_0x12ff15){var _0x28daf4=_0x12ff15;if(_0x28daf4['id']){def[_0x231a('0x4b')]=_0x28daf4['id'];return BPromise[_0x231a('0x31')](_0x28daf4);}else{throw new Error(util[_0x231a('0x24')]('Account\x20%d\x20is\x20not\x20valid',_0x28cd72['id']));}});}function setRelationship(_0x1602b7,_0x5ecf8f,_0x466b29,_0x4666ee){return request({'form':{'method':_0x231a('0x4c'),'input_type':_0x231a('0x22'),'response_type':_0x231a('0x22'),'rest_data':JSON[_0x231a('0x37')]({'session':_0x1602b7['id'],'module_name':_0x231a('0x23'),'module_id':_0x466b29['id'],'link_field_name':_0x4666ee,'related_ids':[_0x5ecf8f['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x231a('0x4d')]=function(_0x84ac59,_0x434772,_0x2caf8c,_0x1aad41,_0x4ce8c6,_0x2bac3e){var _0x4da167,_0x3a221e,_0x17a775,_0x11dd45;_0x2bac3e[_0x231a('0x4e')]=intUtil['stripTrailingSlash'](_0x2bac3e[_0x231a('0x4e')]);_0x2bac3e['serverUrl']=intUtil[_0x231a('0x4f')](_0x2bac3e[_0x231a('0x50')]);def[_0x231a('0x51')]=util['format']('%s/service/v4_1/rest.php',_0x2bac3e['remoteUri']);if(_0x4ce8c6&&_0x4ce8c6['monitor_format']){logger['info'](_0x231a('0x52'),'Recording\x20is\x20enabled!');_0x434772[_0x231a('0x53')]=util[_0x231a('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2bac3e[_0x231a('0x50')],_0x434772['uniqueid'],md5(_0x434772[_0x231a('0x54')]));}else{_0x434772[_0x231a('0x53')]='';}return getConnection(_0x2bac3e)[_0x231a('0x2c')](function(_0x4df83b){_0x11dd45=_0x4df83b;return getUser(_0x2bac3e,_0x1aad41[_0x231a('0xf')],_0x11dd45);})['then'](function(_0x1f6c0a){_0x4da167=_0x1f6c0a;logger[_0x231a('0xd')]('The\x20User\x20ID\x20is:',_0x4da167['id']);return getEndUser(_0x2bac3e,_0x434772[_0x231a('0x55')],_0x434772[_0x231a('0x56')],_0x11dd45);})[_0x231a('0x2c')](function(_0x483e77){_0x3a221e=_0x483e77;logger[_0x231a('0xd')](_0x231a('0x57'),_0x3a221e['id']);return getTicket(_0x2bac3e,_0x4da167,_0x3a221e,_0x2caf8c,_0x434772,_0x2caf8c[_0x231a('0x58')],_0x11dd45,'Inbound');})[_0x231a('0x2c')](function(_0x249fa6){_0x17a775=_0x249fa6;logger[_0x231a('0xd')](_0x231a('0x59'));logger[_0x231a('0xd')](_0x231a('0x5a'),_0x17a775['id']);return setRelationship(_0x11dd45,_0x4da167,_0x17a775,_0x231a('0x5b'));})[_0x231a('0x2c')](function(){return setRelationship(_0x11dd45,_0x3a221e,_0x17a775,_0x231a('0x5c'));})['then'](function(){return getServerInfo(_0x11dd45);})[_0x231a('0x2c')](function(_0x139cb8){var _0x2d5500=parseInt(_0x139cb8[_0x231a('0x5d')][_0x231a('0x5e')](0x0));var _0x3e6b60=util[_0x231a('0x24')](_0x231a('0x5f'),_0x2bac3e[_0x231a('0x4e')],_0x17a775['id']);if(_0x2d5500>0x6){_0x3e6b60=util[_0x231a('0x24')](_0x231a('0x60'),_0x2bac3e['remoteUri'],_0x17a775['id']);}logger[_0x231a('0xd')](_0x231a('0x52'),_0x231a('0x61'));emit(util['format'](_0x231a('0x62'),_0x1aad41[_0x231a('0xf')]),'trigger:browser:url',{'uri':_0x3e6b60});})[_0x231a('0x63')](function(_0x1897bb){logger['error'](_0x231a('0x52'),JSON['stringify'](_0x1897bb));});};exports['outbound']=function(_0x4b4613,_0x2335fd,_0x3a736c,_0x4e30a2,_0x1fe6ea,_0x3ea8ab,_0x25b2db){var _0x439684,_0x315667,_0x3b7977,_0x3b7f9d;_0x3ea8ab['remoteUri']=intUtil[_0x231a('0x4f')](_0x3ea8ab['remoteUri']);_0x3ea8ab[_0x231a('0x50')]=intUtil[_0x231a('0x4f')](_0x3ea8ab[_0x231a('0x50')]);def[_0x231a('0x51')]=util[_0x231a('0x24')](_0x231a('0x64'),_0x3ea8ab[_0x231a('0x4e')]);if(_0x25b2db&&_0x25b2db[_0x231a('0x65')]&&_0x25b2db['recordingFormat']!==_0x231a('0x66')){logger[_0x231a('0xd')](_0x231a('0x67'),_0x231a('0x68'));_0x2335fd['recordingURL']=util[_0x231a('0x24')](_0x231a('0x69'),_0x3ea8ab[_0x231a('0x50')],_0x2335fd['uniqueid'],md5(_0x2335fd[_0x231a('0x54')]));}return getConnection(_0x3ea8ab)['then'](function(_0x178764){_0x3b7f9d=_0x178764;return getUser(_0x3ea8ab,_0x4e30a2[_0x231a('0xf')],_0x3b7f9d);})[_0x231a('0x2c')](function(_0x5adb7b){_0x439684=_0x5adb7b;logger['info']('The\x20User\x20ID\x20is:',_0x439684['id']);return getEndUser(_0x3ea8ab,_0x2335fd[_0x231a('0x6a')],_0x2335fd[_0x231a('0x6b')],_0x3b7f9d);})['then'](function(_0x25b060){_0x315667=_0x25b060;logger[_0x231a('0xd')](_0x231a('0x57'),_0x315667['id']);return getTicket(_0x3ea8ab,_0x439684,_0x315667,_0x3a736c,_0x2335fd,_0x3a736c[_0x231a('0x58')],_0x3b7f9d,_0x231a('0x6c'));})['then'](function(_0x162645){_0x3b7977=_0x162645;logger[_0x231a('0xd')]('Ticket\x20created!');logger[_0x231a('0xd')]('The\x20Ticket\x20ID\x20is:',_0x3b7977['id']);return setRelationship(_0x3b7f9d,_0x439684,_0x3b7977,_0x231a('0x5b'));})[_0x231a('0x2c')](function(){return setRelationship(_0x3b7f9d,_0x315667,_0x3b7977,'contacts');})[_0x231a('0x2c')](function(){return getServerInfo(_0x3b7f9d);})[_0x231a('0x2c')](function(_0x358c57){var _0x53b74c=parseInt(_0x358c57[_0x231a('0x5d')][_0x231a('0x5e')](0x0));var _0x17df36=util[_0x231a('0x24')](_0x231a('0x5f'),_0x3ea8ab[_0x231a('0x4e')],_0x3b7977['id']);if(_0x53b74c>0x6){_0x17df36=util[_0x231a('0x24')](_0x231a('0x60'),_0x3ea8ab['remoteUri'],_0x3b7977['id']);}logger[_0x231a('0xd')](_0x231a('0x67'),_0x231a('0x61'));emit(util[_0x231a('0x24')]('user:%s',_0x4e30a2[_0x231a('0xf')]),'trigger:browser:url',{'uri':_0x17df36});})['catch'](function(_0x4fc4f4){logger['error'](_0x231a('0x67'),JSON[_0x231a('0x37')](_0x4fc4f4));});};exports['unmanaged']=function(_0x2e4079,_0x54be7a,_0x4b529b,_0x3d4c72,_0x261bc4,_0x4499f2){var _0x53b738,_0x4fc21a,_0x365372,_0x4ec496;_0x4499f2[_0x231a('0x4e')]=intUtil['stripTrailingSlash'](_0x4499f2[_0x231a('0x4e')]);_0x4499f2[_0x231a('0x50')]=intUtil['stripTrailingSlash'](_0x4499f2[_0x231a('0x50')]);def[_0x231a('0x51')]=util[_0x231a('0x24')](_0x231a('0x64'),_0x4499f2[_0x231a('0x4e')]);if(_0x261bc4&&_0x261bc4['monitor_format']){logger['info']('['+_0x54be7a[_0x231a('0x6d')][_0x231a('0x6e')]()+']','Recording\x20is\x20enabled!');_0x54be7a[_0x231a('0x53')]=util['format'](_0x231a('0x69'),_0x4499f2[_0x231a('0x50')],_0x54be7a['uniqueid'],md5(_0x54be7a[_0x231a('0x54')]));}else{_0x54be7a[_0x231a('0x53')]='';}return getConnection(_0x4499f2)[_0x231a('0x2c')](function(_0x10c995){_0x4ec496=_0x10c995;if(!_[_0x231a('0x28')](_0x3d4c72)){return getUser(_0x4499f2,_0x3d4c72['name'],_0x4ec496);}else{return getUser(_0x4499f2,null,_0x4ec496);}})['then'](function(_0x4a0403){_0x53b738=_0x4a0403;logger['info'](_0x231a('0x6f'),_0x53b738['id']);return getEndUser(_0x4499f2,_0x54be7a[_0x231a('0x55')],_0x54be7a[_0x231a('0x56')],_0x4ec496);})[_0x231a('0x2c')](function(_0x25d424){_0x4fc21a=_0x25d424;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4fc21a['id']);return getTicket(_0x4499f2,_0x53b738,_0x4fc21a,_0x4b529b,_0x54be7a,_0x4b529b[_0x231a('0x58')],_0x4ec496,_0x231a('0x70'));})['then'](function(_0x109eea){_0x365372=_0x109eea;logger[_0x231a('0xd')](_0x231a('0x59'));logger[_0x231a('0xd')]('The\x20Ticket\x20ID\x20is:',_0x365372['id']);return setRelationship(_0x4ec496,_0x53b738,_0x365372,_0x231a('0x5b'));})[_0x231a('0x2c')](function(){return setRelationship(_0x4ec496,_0x4fc21a,_0x365372,_0x231a('0x5c'));})[_0x231a('0x2c')](function(){return getServerInfo(_0x4ec496);})[_0x231a('0x63')](function(_0x3eed26){logger['error']('['+_0x54be7a[_0x231a('0x6d')][_0x231a('0x6e')]()+']',JSON[_0x231a('0x37')](_0x3eed26));});}; \ No newline at end of file +var _0xdd99=['recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','contacts','user:%s','trigger:browser:url','uri','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','lodash','request-promise','bluebird','util','../../../../config/logger','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','Creating\x20new\x20ticket...','name','getString','created_by','description','Descriptions','date_start','toISOString','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','push','idField','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','find','entry_list','name_value_list','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','customField','nameField','toLowerCase','string','custom_fields','content','variable','customVariable','Variable','login','username','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','outbound'];(function(_0x33b93f,_0x59c41d){var _0xf8d4bb=function(_0x53b937){while(--_0x53b937){_0x33b93f['push'](_0x33b93f['shift']());}};_0xf8d4bb(++_0x59c41d);}(_0xdd99,0x82));var _0x9dd9=function(_0x4b80e2,_0x366890){_0x4b80e2=_0x4b80e2-0x0;var _0x4a3a9c=_0xdd99[_0x4b80e2];return _0x4a3a9c;};'use strict';var _=require(_0x9dd9('0x0'));var rp=require(_0x9dd9('0x1'));var BPromise=require(_0x9dd9('0x2'));var md5=require('md5');var util=require(_0x9dd9('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x9dd9('0x4'))(_0x9dd9('0x5'));config['redis']=_[_0x9dd9('0x6')](config[_0x9dd9('0x7')],{'host':_0x9dd9('0x8'),'port':0x18eb});var io=require(_0x9dd9('0x9'))(new Redis(config['redis']));var def={'method':_0x9dd9('0xa'),'json':!![]};function emit(_0x5e7e97,_0xc77acd,_0x43ab0b){io['to'](_0x5e7e97)['emit'](_0xc77acd,_0x43ab0b);}function getTicket(_0x202f25,_0x4d1586,_0x406cb1,_0x301e60,_0x34a937,_0x176b73,_0x32e994,_0x797321){logger['info'](_0x9dd9('0xb'));var _0x4249a2=new Date();var _0x6661f5=[{'name':_0x9dd9('0xc'),'value':intUtil[_0x9dd9('0xd')](_0x301e60['Subjects'],_0x34a937,'\x20')},{'name':'assigned_user_id','value':_0x4d1586['id']},{'name':_0x9dd9('0xe'),'value':_0x4d1586['id']},{'name':_0x9dd9('0xf'),'value':intUtil[_0x9dd9('0xd')](_0x301e60[_0x9dd9('0x10')],_0x34a937,'\x0a')},{'name':_0x9dd9('0x11'),'value':_0x4249a2[_0x9dd9('0x12')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x9dd9('0x13'),'value':_0x406cb1['id']},{'name':_0x9dd9('0x14'),'value':_0x9dd9('0x15')},{'name':_0x9dd9('0x16'),'value':_0x406cb1[_0x9dd9('0xc')]},{'name':_0x9dd9('0x17'),'value':_0x797321}];if(_0x176b73[_0x9dd9('0x18')]){_[_0x9dd9('0x19')](_0x176b73,function(_0x5d0491){if(_0x34a937[_0x5d0491['variableName']]){_0x6661f5[_0x9dd9('0x1a')]({'name':_0x5d0491[_0x9dd9('0x1b')],'value':_0x34a937[_0x5d0491[_0x9dd9('0x1c')]]});}});}return request({'form':{'method':_0x9dd9('0x1d'),'input_type':_0x9dd9('0x1e'),'response_type':_0x9dd9('0x1e'),'rest_data':JSON[_0x9dd9('0x1f')]({'session':_0x32e994['id'],'module_name':_0x9dd9('0x20'),'name_value_list':_0x6661f5})}});}function getAuth(_0x2d233d){return util[_0x9dd9('0x21')](_0x9dd9('0x22'),new Buffer(_0x2d233d[_0x9dd9('0x23')]+':X')[_0x9dd9('0x24')]('base64'));}function getServerInfo(_0x53916c){return request({'form':{'method':'get_server_info','input_type':_0x9dd9('0x1e'),'response_type':_0x9dd9('0x1e'),'rest_data':JSON[_0x9dd9('0x1f')]({'session':_0x53916c['id']})}});}function getUser(_0x3942bb,_0x365b5e,_0x264c20){if(!_[_0x9dd9('0x25')](_0x365b5e)){logger[_0x9dd9('0x26')](_0x9dd9('0x27'),_0x365b5e);return request({'form':{'method':_0x9dd9('0x28'),'input_type':_0x9dd9('0x1e'),'response_type':_0x9dd9('0x1e'),'rest_data':JSON['stringify']({'session':_0x264c20['id'],'module_name':_0x9dd9('0x29'),'query':util[_0x9dd9('0x21')](_0x9dd9('0x2a'),_0x365b5e),'order_by':'','offset':'0','select_fields':['id',_0x9dd9('0xc'),_0x9dd9('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x674f56){if(_0x674f56['entry_list'][_0x9dd9('0x18')]){var _0x572db1=_[_0x9dd9('0x2c')](_0x674f56[_0x9dd9('0x2d')],function(_0x2c11ac){return _0x2c11ac[_0x9dd9('0x2e')][_0x9dd9('0x2b')][_0x9dd9('0x2f')]===_0x365b5e;});if(_0x572db1){logger[_0x9dd9('0x26')](_0x9dd9('0x30'));return BPromise['resolve']({'id':_0x572db1['name_value_list']['id'][_0x9dd9('0x2f')],'name':_0x572db1['name_value_list'][_0x9dd9('0xc')][_0x9dd9('0x2f')]});}}logger[_0x9dd9('0x26')](_0x9dd9('0x31'));return BPromise[_0x9dd9('0x32')]({'id':_0x264c20[_0x9dd9('0x2e')]['user_id'][_0x9dd9('0x2f')],'name':_0x264c20['name_value_list'][_0x9dd9('0x2b')][_0x9dd9('0x2f')]});});}else{logger[_0x9dd9('0x26')](_0x9dd9('0x33'));return BPromise[_0x9dd9('0x32')]({'id':_0x264c20[_0x9dd9('0x2e')][_0x9dd9('0x34')][_0x9dd9('0x2f')],'name':_0x264c20[_0x9dd9('0x2e')]['user_name'][_0x9dd9('0x2f')]});}}function getEndUser(_0x3e77a2,_0x1f7605,_0xaaf173,_0x418950){logger[_0x9dd9('0x26')]('Searching\x20enduser\x20with\x20phone',_0xaaf173);return request({'form':{'method':_0x9dd9('0x28'),'input_type':_0x9dd9('0x1e'),'response_type':_0x9dd9('0x1e'),'rest_data':JSON['stringify']({'session':_0x418950['id'],'module_name':'Contacts','query':util[_0x9dd9('0x21')](_0x9dd9('0x35'),_0xaaf173),'order_by':'','offset':'0','select_fields':['id',_0x9dd9('0xc'),_0x9dd9('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9dd9('0x37')](function(_0x358ddb){if(_0x358ddb[_0x9dd9('0x2d')]['length']){var _0x375a80=_['find'](_0x358ddb[_0x9dd9('0x2d')],function(_0x2b44a4){return _0x2b44a4[_0x9dd9('0x2e')][_0x9dd9('0x36')]['value']===_0xaaf173;});if(_0x375a80){logger[_0x9dd9('0x26')]('Enduser\x20found!');return BPromise[_0x9dd9('0x32')]({'id':_0x375a80['name_value_list']['id'][_0x9dd9('0x2f')],'name':_0x375a80['name_value_list'][_0x9dd9('0xc')][_0x9dd9('0x2f')],'phone':_0x375a80[_0x9dd9('0x2e')]['phone_home'][_0x9dd9('0x2f')]});}}else{logger[_0x9dd9('0x26')](_0x9dd9('0x38'));return request({'form':{'method':'set_entry','input_type':_0x9dd9('0x1e'),'response_type':_0x9dd9('0x1e'),'rest_data':JSON[_0x9dd9('0x1f')]({'session':_0x418950['id'],'module_name':_0x9dd9('0x15'),'name_value_list':[{'name':_0x9dd9('0x39'),'value':_0x1f7605!==''?_0x1f7605:util[_0x9dd9('0x21')](_0x9dd9('0x3a'),_0xaaf173)},{'name':'phone_home','value':_0xaaf173}]})}})[_0x9dd9('0x37')](function(_0x19a44e){logger[_0x9dd9('0x26')](_0x9dd9('0x3b'));return BPromise[_0x9dd9('0x32')]({'id':_0x19a44e['id'],'name':_0x19a44e['entry_list'][_0x9dd9('0x39')][_0x9dd9('0x2f')],'phone':_0x19a44e[_0x9dd9('0x2d')][_0x9dd9('0x36')][_0x9dd9('0x2f')]});});}});}function request(_0x245945){logger[_0x9dd9('0x3c')](_0x9dd9('0x3d'),JSON[_0x9dd9('0x1f')](_0x245945));return rp(_[_0x9dd9('0x3e')](def,_0x245945));}function getTags(_0x140327,_0x450d2){var _0x21f6a4=[];if(_0x140327&&_0x140327[_0x9dd9('0x18')]>0x0){_0x21f6a4=_[_0x9dd9('0x3f')](_0x140327,_0x450d2);}return _0x21f6a4;}function getCustomFields(_0x1cc9c0,_0xe618e1){var _0x3fd724=[];var _0x4abc4c={'custom_fields':[]};if(_0x1cc9c0['length']>0x0){_['forEach'](_0x1cc9c0,function(_0x27a67c){if(_0x27a67c[_0x9dd9('0x40')]==='string'&&_0x27a67c['nameField']&&!_0x27a67c[_0x9dd9('0x41')]){_0x4abc4c[_0x27a67c[_0x9dd9('0x42')][_0x9dd9('0x43')]()]=_0x27a67c['content'][_0x9dd9('0x24')]();}else if(_0x27a67c[_0x9dd9('0x40')]===_0x9dd9('0x44')&&_0x27a67c[_0x9dd9('0x1b')]&&_0x27a67c['customField']){_0x4abc4c[_0x9dd9('0x45')][_0x9dd9('0x1a')]({'id':_0x27a67c[_0x9dd9('0x1b')],'value':_0x27a67c[_0x9dd9('0x46')][_0x9dd9('0x24')]()});}else if(_0x27a67c[_0x9dd9('0x40')]===_0x9dd9('0x47')&&_0x27a67c[_0x9dd9('0x1c')]&&_0x27a67c['idField']&&_0x27a67c[_0x9dd9('0x41')]){_0xe618e1[_0x27a67c['variableName']]&&_0x4abc4c[_0x9dd9('0x45')][_0x9dd9('0x1a')]({'id':_0x27a67c[_0x9dd9('0x1b')],'value':_0xe618e1[_0x27a67c[_0x9dd9('0x1c')]][_0x9dd9('0x24')]()});}else if(_0x27a67c['type']===_0x9dd9('0x48')&&_0x27a67c[_0x9dd9('0x49')]&&_0x27a67c[_0x9dd9('0x49')]['name']&&_0x27a67c['idField']&&_0x27a67c[_0x9dd9('0x41')]){_0xe618e1[_0x27a67c[_0x9dd9('0x49')]['name'][_0x9dd9('0x43')]()]&&_0x4abc4c['custom_fields'][_0x9dd9('0x1a')]({'id':_0x27a67c[_0x9dd9('0x1b')],'value':_0xe618e1[_0x27a67c['Variable'][_0x9dd9('0xc')][_0x9dd9('0x43')]()][_0x9dd9('0x24')]()});}});}return _0x4abc4c;}function getConnection(_0x361e8f){return request({'method':'POST','form':{'method':_0x9dd9('0x4a'),'input_type':_0x9dd9('0x1e'),'response_type':_0x9dd9('0x1e'),'rest_data':JSON[_0x9dd9('0x1f')]({'user_auth':{'user_name':_0x361e8f[_0x9dd9('0x4b')],'password':_0x361e8f['password'],'encryption':'PLAIN'},'application':_0x9dd9('0x4c')})}})[_0x9dd9('0x37')](function(_0x402de2){var _0x4a0a2e=_0x402de2;if(_0x4a0a2e['id']){def[_0x9dd9('0x4d')]=_0x4a0a2e['id'];return BPromise[_0x9dd9('0x32')](_0x4a0a2e);}else{throw new Error(util['format'](_0x9dd9('0x4e'),_0x361e8f['id']));}});}function setRelationship(_0x26372f,_0x169a8a,_0x7dcc1a,_0x47e43c){return request({'form':{'method':'set_relationship','input_type':_0x9dd9('0x1e'),'response_type':'JSON','rest_data':JSON[_0x9dd9('0x1f')]({'session':_0x26372f['id'],'module_name':_0x9dd9('0x20'),'module_id':_0x7dcc1a['id'],'link_field_name':_0x47e43c,'related_ids':[_0x169a8a['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x9dd9('0x4f')]=function(_0x3671a3,_0x222823,_0xb67de5,_0x2aae71,_0x143606,_0xdee38){var _0x4a2f3a,_0xf9aa12,_0x5880f2,_0x43d110;_0xdee38[_0x9dd9('0x50')]=intUtil[_0x9dd9('0x51')](_0xdee38[_0x9dd9('0x50')]);_0xdee38['serverUrl']=intUtil['stripTrailingSlash'](_0xdee38[_0x9dd9('0x52')]);def['uri']=util[_0x9dd9('0x21')](_0x9dd9('0x53'),_0xdee38[_0x9dd9('0x50')]);if(_0x143606&&_0x143606[_0x9dd9('0x54')]){logger[_0x9dd9('0x26')](_0x9dd9('0x55'),'Recording\x20is\x20enabled!');_0x222823['recordingURL']=util[_0x9dd9('0x21')](_0x9dd9('0x56'),_0xdee38[_0x9dd9('0x52')],_0x222823[_0x9dd9('0x57')],md5(_0x222823['uniqueid']));}else{_0x222823[_0x9dd9('0x58')]='';}return getConnection(_0xdee38)['then'](function(_0x4f597b){_0x43d110=_0x4f597b;return getUser(_0xdee38,_0x2aae71[_0x9dd9('0xc')],_0x43d110);})[_0x9dd9('0x37')](function(_0xc01cd9){_0x4a2f3a=_0xc01cd9;logger[_0x9dd9('0x26')](_0x9dd9('0x59'),_0x4a2f3a['id']);return getEndUser(_0xdee38,_0x222823[_0x9dd9('0x5a')],_0x222823[_0x9dd9('0x5b')],_0x43d110);})[_0x9dd9('0x37')](function(_0x14b2b2){_0xf9aa12=_0x14b2b2;logger['info']('The\x20Enduser\x20ID\x20is:',_0xf9aa12['id']);return getTicket(_0xdee38,_0x4a2f3a,_0xf9aa12,_0xb67de5,_0x222823,_0xb67de5['Fields'],_0x43d110,_0x9dd9('0x5c'));})['then'](function(_0x24d2ee){_0x5880f2=_0x24d2ee;logger[_0x9dd9('0x26')](_0x9dd9('0x5d'));logger[_0x9dd9('0x26')](_0x9dd9('0x5e'),_0x5880f2['id']);return setRelationship(_0x43d110,_0x4a2f3a,_0x5880f2,_0x9dd9('0x5f'));})[_0x9dd9('0x37')](function(){return setRelationship(_0x43d110,_0xf9aa12,_0x5880f2,'contacts');})[_0x9dd9('0x37')](function(){return getServerInfo(_0x43d110);})[_0x9dd9('0x37')](function(_0x86a1e5){var _0x2066c0=parseInt(_0x86a1e5[_0x9dd9('0x60')][_0x9dd9('0x61')](0x0));var _0x456a8a=util[_0x9dd9('0x21')](_0x9dd9('0x62'),_0xdee38['remoteUri'],_0x5880f2['id']);if(_0x2066c0>0x6){_0x456a8a=util[_0x9dd9('0x21')](_0x9dd9('0x63'),_0xdee38[_0x9dd9('0x50')],_0x5880f2['id']);}logger['info'](_0x9dd9('0x55'),_0x9dd9('0x64'));emit(util[_0x9dd9('0x21')]('user:%s',_0x2aae71[_0x9dd9('0xc')]),'trigger:browser:url',{'uri':_0x456a8a});})[_0x9dd9('0x65')](function(_0xc4580c){logger[_0x9dd9('0x66')](_0x9dd9('0x55'),JSON[_0x9dd9('0x1f')](_0xc4580c));});};exports[_0x9dd9('0x67')]=function(_0xbb4dda,_0x4de85c,_0x250405,_0x2b85d6,_0x4a26cd,_0x2e9786,_0x103e4a){var _0x13b24a,_0x492ffc,_0x26d633,_0x260a91;_0x2e9786[_0x9dd9('0x50')]=intUtil[_0x9dd9('0x51')](_0x2e9786[_0x9dd9('0x50')]);_0x2e9786['serverUrl']=intUtil[_0x9dd9('0x51')](_0x2e9786[_0x9dd9('0x52')]);def['uri']=util[_0x9dd9('0x21')](_0x9dd9('0x53'),_0x2e9786[_0x9dd9('0x50')]);if(_0x103e4a&&_0x103e4a[_0x9dd9('0x68')]&&_0x103e4a[_0x9dd9('0x68')]!==_0x9dd9('0x69')){logger[_0x9dd9('0x26')](_0x9dd9('0x6a'),_0x9dd9('0x6b'));_0x4de85c[_0x9dd9('0x58')]=util[_0x9dd9('0x21')](_0x9dd9('0x56'),_0x2e9786[_0x9dd9('0x52')],_0x4de85c[_0x9dd9('0x57')],md5(_0x4de85c[_0x9dd9('0x57')]));}return getConnection(_0x2e9786)[_0x9dd9('0x37')](function(_0x8727ad){_0x260a91=_0x8727ad;return getUser(_0x2e9786,_0x2b85d6[_0x9dd9('0xc')],_0x260a91);})[_0x9dd9('0x37')](function(_0x5dface){_0x13b24a=_0x5dface;logger[_0x9dd9('0x26')](_0x9dd9('0x59'),_0x13b24a['id']);return getEndUser(_0x2e9786,_0x4de85c[_0x9dd9('0x6c')],_0x4de85c[_0x9dd9('0x6d')],_0x260a91);})[_0x9dd9('0x37')](function(_0x59c874){_0x492ffc=_0x59c874;logger[_0x9dd9('0x26')]('The\x20Enduser\x20ID\x20is:',_0x492ffc['id']);return getTicket(_0x2e9786,_0x13b24a,_0x492ffc,_0x250405,_0x4de85c,_0x250405['Fields'],_0x260a91,'Outbound');})[_0x9dd9('0x37')](function(_0x35c2f9){_0x26d633=_0x35c2f9;logger[_0x9dd9('0x26')](_0x9dd9('0x5d'));logger['info'](_0x9dd9('0x5e'),_0x26d633['id']);return setRelationship(_0x260a91,_0x13b24a,_0x26d633,_0x9dd9('0x5f'));})[_0x9dd9('0x37')](function(){return setRelationship(_0x260a91,_0x492ffc,_0x26d633,_0x9dd9('0x6e'));})['then'](function(){return getServerInfo(_0x260a91);})['then'](function(_0x429557){var _0x450015=parseInt(_0x429557['version'][_0x9dd9('0x61')](0x0));var _0x21e231=util['format'](_0x9dd9('0x62'),_0x2e9786[_0x9dd9('0x50')],_0x26d633['id']);if(_0x450015>0x6){_0x21e231=util[_0x9dd9('0x21')](_0x9dd9('0x63'),_0x2e9786[_0x9dd9('0x50')],_0x26d633['id']);}logger[_0x9dd9('0x26')](_0x9dd9('0x6a'),_0x9dd9('0x64'));emit(util[_0x9dd9('0x21')](_0x9dd9('0x6f'),_0x2b85d6[_0x9dd9('0xc')]),_0x9dd9('0x70'),{'uri':_0x21e231});})[_0x9dd9('0x65')](function(_0x2b5f26){logger[_0x9dd9('0x66')](_0x9dd9('0x6a'),JSON[_0x9dd9('0x1f')](_0x2b5f26));});};exports['unmanaged']=function(_0x405cc6,_0x5b7fe0,_0x291363,_0xf24a57,_0xba2e7c,_0x4aa503){var _0x445b67,_0x4c2ef6,_0x28178f,_0x235194;_0x4aa503[_0x9dd9('0x50')]=intUtil[_0x9dd9('0x51')](_0x4aa503[_0x9dd9('0x50')]);_0x4aa503['serverUrl']=intUtil[_0x9dd9('0x51')](_0x4aa503[_0x9dd9('0x52')]);def[_0x9dd9('0x71')]=util[_0x9dd9('0x21')](_0x9dd9('0x53'),_0x4aa503[_0x9dd9('0x50')]);if(_0xba2e7c&&_0xba2e7c[_0x9dd9('0x54')]){logger[_0x9dd9('0x26')]('['+_0x5b7fe0[_0x9dd9('0x72')][_0x9dd9('0x73')]()+']',_0x9dd9('0x6b'));_0x5b7fe0[_0x9dd9('0x58')]=util[_0x9dd9('0x21')](_0x9dd9('0x56'),_0x4aa503['serverUrl'],_0x5b7fe0[_0x9dd9('0x57')],md5(_0x5b7fe0[_0x9dd9('0x57')]));}else{_0x5b7fe0[_0x9dd9('0x58')]='';}return getConnection(_0x4aa503)['then'](function(_0x10e480){_0x235194=_0x10e480;if(!_['isNil'](_0xf24a57)){return getUser(_0x4aa503,_0xf24a57[_0x9dd9('0xc')],_0x235194);}else{return getUser(_0x4aa503,null,_0x235194);}})[_0x9dd9('0x37')](function(_0x1988b5){_0x445b67=_0x1988b5;logger[_0x9dd9('0x26')](_0x9dd9('0x59'),_0x445b67['id']);return getEndUser(_0x4aa503,_0x5b7fe0[_0x9dd9('0x5a')],_0x5b7fe0[_0x9dd9('0x5b')],_0x235194);})['then'](function(_0x4f9c8b){_0x4c2ef6=_0x4f9c8b;logger[_0x9dd9('0x26')](_0x9dd9('0x74'),_0x4c2ef6['id']);return getTicket(_0x4aa503,_0x445b67,_0x4c2ef6,_0x291363,_0x5b7fe0,_0x291363['Fields'],_0x235194,_0x9dd9('0x5c'));})[_0x9dd9('0x37')](function(_0x56e76b){_0x28178f=_0x56e76b;logger['info'](_0x9dd9('0x5d'));logger[_0x9dd9('0x26')]('The\x20Ticket\x20ID\x20is:',_0x28178f['id']);return setRelationship(_0x235194,_0x445b67,_0x28178f,'users');})[_0x9dd9('0x37')](function(){return setRelationship(_0x235194,_0x4c2ef6,_0x28178f,'contacts');})[_0x9dd9('0x37')](function(){return getServerInfo(_0x235194);})[_0x9dd9('0x65')](function(_0x5b76d9){logger[_0x9dd9('0x66')]('['+_0x5b7fe0[_0x9dd9('0x72')][_0x9dd9('0x73')]()+']',JSON[_0x9dd9('0x1f')](_0x5b76d9));});}; \ 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 67c8ebd..ba17b14 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 _0x0251=['join','slice','substring','lastIndexOf','validateEmail','isNil','util','getString','sortBy','type','string','push','content','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s'];(function(_0x6182ff,_0x59d492){var _0x1cec22=function(_0x2e96f8){while(--_0x2e96f8){_0x6182ff['push'](_0x6182ff['shift']());}};_0x1cec22(++_0x59d492);}(_0x0251,0x66));var _0x1025=function(_0x46bf79,_0xffa7da){_0x46bf79=_0x46bf79-0x0;var _0x10dea5=_0x0251[_0x46bf79];return _0x10dea5;};'use strict';var _=require('lodash');var util=require(_0x1025('0x0'));exports[_0x1025('0x1')]=function(_0x246fbe,_0x5bfb63,_0x3f63af){var _0x334a6c=[];if(_0x246fbe['length']>0x0){var _0x4770d8=_[_0x1025('0x2')](_0x246fbe,['id']);for(var _0x207663=0x0;_0x207663<_0x4770d8['length'];_0x207663++){var _0x45dd6b=_0x4770d8[_0x207663];if(_0x45dd6b[_0x1025('0x3')]===_0x1025('0x4')){_0x334a6c[_0x1025('0x5')](_0x45dd6b[_0x1025('0x6')]);}else if(_0x45dd6b[_0x1025('0x3')]==='variable'&&_0x45dd6b[_0x1025('0x7')]){_0x5bfb63[_0x45dd6b[_0x1025('0x7')]]&&_0x334a6c[_0x1025('0x5')](_0x5bfb63[_0x45dd6b['variableName']][_0x1025('0x8')]());}else if(_0x45dd6b[_0x1025('0x3')]===_0x1025('0x9')&&_0x45dd6b['Variable']&&_0x45dd6b[_0x1025('0xa')]['name']){_0x5bfb63[_0x45dd6b[_0x1025('0xa')]['name']['toLowerCase']()]&&_0x334a6c['push'](_0x5bfb63[_0x45dd6b[_0x1025('0xa')][_0x1025('0xb')][_0x1025('0xc')]()][_0x1025('0x8')]());}else if(_0x45dd6b[_0x1025('0x3')]===_0x1025('0xd')){if(_0x45dd6b[_0x1025('0xe')]===_0x1025('0x4')&&_0x45dd6b[_0x1025('0xf')]){_0x334a6c[_0x1025('0x5')](util[_0x1025('0x10')](_0x1025('0x11'),_0x45dd6b[_0x1025('0xf')],_0x45dd6b['keyContent']));}else if(_0x45dd6b['keyType']==='variable'&&_0x45dd6b[_0x1025('0x7')]&&_0x45dd6b['key']){_0x5bfb63[_0x45dd6b['variableName']]&&_0x334a6c[_0x1025('0x5')](util[_0x1025('0x10')](_0x1025('0x11'),_0x45dd6b['key'],_0x5bfb63[_0x45dd6b[_0x1025('0x7')]]));}else if(_0x45dd6b[_0x1025('0xe')]===_0x1025('0x9')&&_0x45dd6b[_0x1025('0xa')]&&_0x45dd6b[_0x1025('0xa')][_0x1025('0xb')]&&_0x45dd6b[_0x1025('0xf')]){_0x5bfb63[_0x45dd6b[_0x1025('0xa')]['name'][_0x1025('0xc')]()]&&_0x334a6c['push'](util[_0x1025('0x10')](_0x1025('0x11'),_0x45dd6b[_0x1025('0xf')],_0x5bfb63[_0x45dd6b[_0x1025('0xa')][_0x1025('0xb')][_0x1025('0xc')]()]));}}}}return _0x334a6c[_0x1025('0x12')](_0x3f63af);};exports['stripTrailingSlash']=function(_0x370e58){var _0x191649=_0x370e58[_0x1025('0x13')](-0x1);if(_0x191649==='/'){_0x370e58=_0x370e58[_0x1025('0x14')](0x0,_0x370e58[_0x1025('0x15')](_0x191649));}return _0x370e58;};exports[_0x1025('0x16')]=function(_0xd4ac80){if(!_[_0x1025('0x17')](_0xd4ac80)&&_0xd4ac80!==''){var _0x1826bf=/^(([^<>()\[\]\\.,;:\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 _0x1826bf['test'](String(_0xd4ac80)[_0x1025('0xc')]());}else{return![];}}; \ No newline at end of file +var _0x881e=['validateEmail','isNil','test','util','getString','length','type','push','content','variable','variableName','customVariable','Variable','toLowerCase','name','toString','keyValue','keyType','string','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','substring'];(function(_0x518782,_0x2974ca){var _0x379137=function(_0xc83c71){while(--_0xc83c71){_0x518782['push'](_0x518782['shift']());}};_0x379137(++_0x2974ca);}(_0x881e,0xd3));var _0xe881=function(_0x4ececf,_0x5a0ee4){_0x4ececf=_0x4ececf-0x0;var _0x292479=_0x881e[_0x4ececf];return _0x292479;};'use strict';var _=require('lodash');var util=require(_0xe881('0x0'));exports[_0xe881('0x1')]=function(_0x5aec79,_0x59e8a2,_0x28d43d){var _0x2c04df=[];if(_0x5aec79[_0xe881('0x2')]>0x0){var _0x2cde51=_['sortBy'](_0x5aec79,['id']);for(var _0x5bd118=0x0;_0x5bd118<_0x2cde51[_0xe881('0x2')];_0x5bd118++){var _0x2b0664=_0x2cde51[_0x5bd118];if(_0x2b0664[_0xe881('0x3')]==='string'){_0x2c04df[_0xe881('0x4')](_0x2b0664[_0xe881('0x5')]);}else if(_0x2b0664[_0xe881('0x3')]===_0xe881('0x6')&&_0x2b0664['variableName']){_0x59e8a2[_0x2b0664[_0xe881('0x7')]]&&_0x2c04df['push'](_0x59e8a2[_0x2b0664[_0xe881('0x7')]]['toString']());}else if(_0x2b0664[_0xe881('0x3')]===_0xe881('0x8')&&_0x2b0664[_0xe881('0x9')]&&_0x2b0664[_0xe881('0x9')]['name']){_0x59e8a2[_0x2b0664['Variable']['name'][_0xe881('0xa')]()]&&_0x2c04df[_0xe881('0x4')](_0x59e8a2[_0x2b0664[_0xe881('0x9')][_0xe881('0xb')][_0xe881('0xa')]()][_0xe881('0xc')]());}else if(_0x2b0664[_0xe881('0x3')]===_0xe881('0xd')){if(_0x2b0664[_0xe881('0xe')]===_0xe881('0xf')&&_0x2b0664[_0xe881('0x10')]){_0x2c04df[_0xe881('0x4')](util[_0xe881('0x11')](_0xe881('0x12'),_0x2b0664[_0xe881('0x10')],_0x2b0664[_0xe881('0x13')]));}else if(_0x2b0664['keyType']===_0xe881('0x6')&&_0x2b0664['variableName']&&_0x2b0664['key']){_0x59e8a2[_0x2b0664['variableName']]&&_0x2c04df['push'](util[_0xe881('0x11')](_0xe881('0x12'),_0x2b0664['key'],_0x59e8a2[_0x2b0664[_0xe881('0x7')]]));}else if(_0x2b0664['keyType']==='customVariable'&&_0x2b0664[_0xe881('0x9')]&&_0x2b0664[_0xe881('0x9')][_0xe881('0xb')]&&_0x2b0664[_0xe881('0x10')]){_0x59e8a2[_0x2b0664['Variable'][_0xe881('0xb')][_0xe881('0xa')]()]&&_0x2c04df['push'](util[_0xe881('0x11')](_0xe881('0x12'),_0x2b0664[_0xe881('0x10')],_0x59e8a2[_0x2b0664[_0xe881('0x9')]['name'][_0xe881('0xa')]()]));}}}}return _0x2c04df[_0xe881('0x14')](_0x28d43d);};exports[_0xe881('0x15')]=function(_0xee89ef){var _0x35a194=_0xee89ef['slice'](-0x1);if(_0x35a194==='/'){_0xee89ef=_0xee89ef[_0xe881('0x16')](0x0,_0xee89ef['lastIndexOf'](_0x35a194));}return _0xee89ef;};exports[_0xe881('0x17')]=function(_0x2cc20e){if(!_[_0xe881('0x18')](_0x2cc20e)&&_0x2cc20e!==''){var _0x56f7a4=/^(([^<>()\[\]\\.,;:\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 _0x56f7a4[_0xe881('0x19')](String(_0x2cc20e)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 917c5a8..61eed18 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 _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x39aecb,_0x1b54fe){var _0x43fba8=function(_0x579656){while(--_0x579656){_0x39aecb['push'](_0x39aecb['shift']());}};_0x43fba8(++_0x1b54fe);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 5944f33..1d9c2ff 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 _0xec02=['Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','defaults','forEach','string','picklist','type','customField','nameField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','Recording\x20is\x20enabled!','Authorization','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','application/json','info','format','%s/tickets.json','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','remoteUri','Admin\x20account\x20selected.','user'];(function(_0x18b85e,_0x1a4727){var _0xdb0129=function(_0xf673c2){while(--_0xf673c2){_0x18b85e['push'](_0x18b85e['shift']());}};_0xdb0129(++_0x1a4727);}(_0xec02,0x130));var _0x2ec0=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xec02[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x2ec0('0x0'));var rp=require(_0x2ec0('0x1'));var md5=require(_0x2ec0('0x2'));var util=require('util');var Redis=require(_0x2ec0('0x3'));var intUtil=require(_0x2ec0('0x4'));var config=require(_0x2ec0('0x5'));var logger=require(_0x2ec0('0x6'))('zendesk');config[_0x2ec0('0x7')]=_['defaults'](config[_0x2ec0('0x7')],{'host':_0x2ec0('0x8'),'port':0x18eb});var io=require(_0x2ec0('0x9'))(new Redis(config['redis']));function emit(_0x59f970,_0x3b647a,_0x44be54){io['to'](_0x59f970)[_0x2ec0('0xa')](_0x3b647a,_0x44be54);}var headers={'Content-Type':_0x2ec0('0xb'),'Accept':'application/json'};function getTicket(_0x3789a5,_0x54bdfa,_0x280e8b,_0x2f372a,_0x2e975c){logger[_0x2ec0('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x2ec0('0xd')](_0x2ec0('0xe'),_0x3789a5['remoteUri']),'method':_0x2ec0('0xf'),'body':{'ticket':_[_0x2ec0('0x10')]({'requester_id':_0x280e8b['id'],'submitter_id':_0x54bdfa?_0x54bdfa['id']:undefined,'assignee_id':_0x54bdfa?_0x54bdfa['id']:undefined,'tags':getTags(_0x2f372a[_0x2ec0('0x11')],'name'),'subject':intUtil[_0x2ec0('0x12')](_0x2f372a[_0x2ec0('0x13')],_0x2e975c,'\x20'),'description':intUtil[_0x2ec0('0x12')](_0x2f372a[_0x2ec0('0x14')],_0x2e975c,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x2f372a[_0x2ec0('0x14')],_0x2e975c,'\x0a')}},getCustomFields(_0x2f372a[_0x2ec0('0x15')],_0x2e975c))}})[_0x2ec0('0x16')](function(_0x4c01a5){logger[_0x2ec0('0xc')]('Ticket\x20created!');return _0x4c01a5['ticket'];});}function getUser(_0x23fd81,_0x1a116f){if(intUtil[_0x2ec0('0x17')](_0x1a116f)){logger['info'](_0x2ec0('0x18'),_0x1a116f);return request({'uri':util['format'](_0x2ec0('0x19'),_0x23fd81['remoteUri']),'qs':{'query':util[_0x2ec0('0xd')]('type:user\x20role:agent\x20email:%s',_0x1a116f)}})[_0x2ec0('0x16')](function(_0x1ba5d7){if(_0x1ba5d7['count']){logger[_0x2ec0('0xc')](_0x2ec0('0x1a'));return _[_0x2ec0('0x1b')](_0x1ba5d7[_0x2ec0('0x1c')],{'email':_0x1a116f,'role':_0x2ec0('0x1d')});}else{logger[_0x2ec0('0xc')](_0x2ec0('0x1e'));return request({'uri':util[_0x2ec0('0xd')](_0x2ec0('0x1f'),_0x23fd81[_0x2ec0('0x20')])})[_0x2ec0('0x16')](function(_0xef7456){logger[_0x2ec0('0xc')](_0x2ec0('0x21'));return _0xef7456['user'];});}});}else{logger[_0x2ec0('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x2ec0('0x1f'),_0x23fd81[_0x2ec0('0x20')])})[_0x2ec0('0x16')](function(_0x3ba755){logger[_0x2ec0('0xc')]('Admin\x20account\x20selected.');return _0x3ba755[_0x2ec0('0x22')];});}}function getEndUser(_0x146e78,_0x5f26c1,_0x2364f8){logger[_0x2ec0('0xc')](_0x2ec0('0x23'),_0x2364f8);return request({'uri':util[_0x2ec0('0xd')]('%s/search.json',_0x146e78[_0x2ec0('0x20')]),'qs':{'query':util[_0x2ec0('0xd')](_0x2ec0('0x24'),_0x2364f8)}})[_0x2ec0('0x16')](function(_0x1aaf41){var _0x4f135e;if(_0x1aaf41[_0x2ec0('0x1c')][_0x2ec0('0x25')]){_0x1aaf41[_0x2ec0('0x1c')]=_[_0x2ec0('0x26')](_0x1aaf41[_0x2ec0('0x1c')],{'suspended':![],'role':_0x2ec0('0x27')});if(_0x1aaf41[_0x2ec0('0x1c')][_0x2ec0('0x25')]){_0x4f135e=_['first'](_0x1aaf41[_0x2ec0('0x1c')]);}}if(_0x4f135e){logger[_0x2ec0('0xc')](_0x2ec0('0x28'));return _0x4f135e;}else{logger[_0x2ec0('0xc')](_0x2ec0('0x29'));return request({'uri':util[_0x2ec0('0xd')]('%s/users.json',_0x146e78['remoteUri']),'method':_0x2ec0('0xf'),'body':{'user':{'role':_0x2ec0('0x27'),'name':util[_0x2ec0('0xd')](_0x2ec0('0x2a'),_0x5f26c1||_0x2364f8),'phone':_0x2364f8}}})[_0x2ec0('0x16')](function(_0x586993){logger['info'](_0x2ec0('0x2b'));return _0x586993['user'];});}});}function getAuth(_0x29089f){var _0x4ca07b;if(_0x29089f[_0x2ec0('0x2c')]===_0x2ec0('0x2d')){_0x4ca07b=util[_0x2ec0('0xd')](_0x2ec0('0x2e'),_0x29089f['username'],_0x29089f[_0x2ec0('0x2d')]);}else if(_0x29089f[_0x2ec0('0x2c')]===_0x2ec0('0x2f')){_0x4ca07b=util['format'](_0x2ec0('0x30'),_0x29089f[_0x2ec0('0x31')],_0x29089f[_0x2ec0('0x2f')]);}return util[_0x2ec0('0xd')](_0x2ec0('0x32'),new Buffer(_0x4ca07b)[_0x2ec0('0x33')](_0x2ec0('0x34')));}function request(_0x27cce5){logger[_0x2ec0('0x35')](_0x2ec0('0x36'),JSON[_0x2ec0('0x37')](_0x27cce5));return rp(_[_0x2ec0('0x38')](_0x27cce5,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x240fef,_0x533125){var _0x1a572c=[];if(_0x240fef&&_0x240fef['length']>0x0){_0x1a572c=_['map'](_0x240fef,_0x533125);}return _0x1a572c;}function getCustomFields(_0x235443,_0x36d965){var _0x567c1f=[];var _0x259cde={'custom_fields':[]};if(_0x235443[_0x2ec0('0x25')]>0x0){_[_0x2ec0('0x39')](_0x235443,function(_0x528473){if(_['includes']([_0x2ec0('0x3a'),_0x2ec0('0x3b')],_0x528473[_0x2ec0('0x3c')])&&_0x528473['nameField']&&!_0x528473[_0x2ec0('0x3d')]){_0x259cde[_0x528473[_0x2ec0('0x3e')][_0x2ec0('0x3f')]()]=_0x528473[_0x2ec0('0x40')][_0x2ec0('0x33')]();}else if(_['includes']([_0x2ec0('0x3a'),_0x2ec0('0x3b')],_0x528473[_0x2ec0('0x3c')])&&_0x528473[_0x2ec0('0x41')]&&_0x528473[_0x2ec0('0x3d')]){_0x259cde[_0x2ec0('0x42')][_0x2ec0('0x43')]({'id':_0x528473[_0x2ec0('0x41')],'value':_0x528473[_0x2ec0('0x40')][_0x2ec0('0x33')]()});}else if(_0x528473['type']===_0x2ec0('0x44')&&_0x528473[_0x2ec0('0x45')]&&_0x528473[_0x2ec0('0x41')]&&_0x528473[_0x2ec0('0x3d')]){_0x36d965[_0x528473[_0x2ec0('0x45')]]&&_0x259cde['custom_fields'][_0x2ec0('0x43')]({'id':_0x528473[_0x2ec0('0x41')],'value':_0x36d965[_0x528473[_0x2ec0('0x45')]][_0x2ec0('0x33')]()});}else if(_0x528473['type']===_0x2ec0('0x46')&&_0x528473['Variable']&&_0x528473[_0x2ec0('0x47')][_0x2ec0('0x48')]&&_0x528473['idField']&&_0x528473['customField']){_0x36d965[_0x528473[_0x2ec0('0x47')][_0x2ec0('0x48')]['toLowerCase']()]&&_0x259cde[_0x2ec0('0x42')][_0x2ec0('0x43')]({'id':_0x528473[_0x2ec0('0x41')],'value':_0x36d965[_0x528473[_0x2ec0('0x47')][_0x2ec0('0x48')][_0x2ec0('0x3f')]()][_0x2ec0('0x33')]()});}});}return _0x259cde;}exports[_0x2ec0('0x49')]=function(_0xe53192,_0x110f2e,_0x3a189b,_0x20e782,_0x89cd92,_0x20c7f8){var _0x59735d,_0x543bce;_0x20c7f8['remoteUri']=intUtil[_0x2ec0('0x4a')](_0x20c7f8['remoteUri']);_0x20c7f8[_0x2ec0('0x4b')]=intUtil[_0x2ec0('0x4a')](_0x20c7f8[_0x2ec0('0x4b')]);if(_0x89cd92&&_0x89cd92['monitor_format']){logger[_0x2ec0('0xc')]('[QUEUE]','Recording\x20is\x20enabled!');_0x110f2e[_0x2ec0('0x4c')]=util['format'](_0x2ec0('0x4d'),_0x20c7f8['serverUrl'],_0x110f2e[_0x2ec0('0x4e')],md5(_0x110f2e[_0x2ec0('0x4e')]));}else{_0x110f2e['recordingURL']='';}headers['Authorization']=getAuth(_0x20c7f8);return getUser(_0x20c7f8,_0x20e782[_0x2ec0('0x4f')])[_0x2ec0('0x16')](function(_0x301543){_0x59735d=_0x301543;logger[_0x2ec0('0xc')](_0x2ec0('0x50'),_0x59735d['id']);return getEndUser(_0x20c7f8,_0x110f2e[_0x2ec0('0x51')],_0x110f2e[_0x2ec0('0x52')]);})[_0x2ec0('0x16')](function(_0x16ecf7){_0x543bce=_0x16ecf7;logger[_0x2ec0('0xc')]('The\x20Enduser\x20ID\x20is:',_0x543bce['id']);return getTicket(_0x20c7f8,_0x59735d,_0x543bce,_0x3a189b,_0x110f2e);})['then'](function(_0x159c74){if(_0x159c74){logger['info'](_0x2ec0('0x53'),_0x159c74['id']);switch(_0x20c7f8[_0x2ec0('0x3c')]){case _0x2ec0('0x54'):logger[_0x2ec0('0xc')](_0x2ec0('0x55'),_0x2ec0('0x56'));return request({'uri':util['format'](_0x2ec0('0x57'),_0x20c7f8[_0x2ec0('0x20')],_0x59735d['id'],_0x159c74['id']),'method':_0x2ec0('0xf')});case _0x2ec0('0x58'):logger['info']('[QUEUE]',_0x2ec0('0x59'));emit(util['format'](_0x2ec0('0x5a'),_0x20e782[_0x2ec0('0x48')]),_0x2ec0('0x5b'),{'uri':util[_0x2ec0('0xd')](_0x2ec0('0x5c'),_0x20c7f8[_0x2ec0('0x20')][_0x2ec0('0x5d')]('/api/v2',''),_0x159c74['id'])});break;default:logger[_0x2ec0('0x5e')](_0x2ec0('0x55'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x2ec0('0x5f')](function(_0x176658){logger[_0x2ec0('0x5e')](_0x2ec0('0x60'),util[_0x2ec0('0x61')](_0x176658,{'showHidden':!![],'depth':null}));});};exports[_0x2ec0('0x62')]=function(_0x16dc9b,_0x138cbf,_0x58b6e8,_0x18318a,_0x444a79,_0x51302b,_0x522912){var _0x4253ca,_0x32ec8a;_0x51302b['remoteUri']=intUtil[_0x2ec0('0x4a')](_0x51302b[_0x2ec0('0x20')]);_0x51302b[_0x2ec0('0x4b')]=intUtil[_0x2ec0('0x4a')](_0x51302b[_0x2ec0('0x4b')]);if(_0x522912&&_0x522912['recordingFormat']&&_0x522912[_0x2ec0('0x63')]!==_0x2ec0('0x64')){logger[_0x2ec0('0xc')]('[OUTBOUND]',_0x2ec0('0x65'));_0x138cbf[_0x2ec0('0x4c')]=util[_0x2ec0('0xd')](_0x2ec0('0x4d'),_0x51302b[_0x2ec0('0x4b')],_0x138cbf['uniqueid'],md5(_0x138cbf['uniqueid']));}headers[_0x2ec0('0x66')]=getAuth(_0x51302b);return getUser(_0x51302b,_0x18318a[_0x2ec0('0x4f')])[_0x2ec0('0x16')](function(_0x423c00){_0x4253ca=_0x423c00;logger[_0x2ec0('0xc')](_0x2ec0('0x50'),_0x4253ca['id']);return getEndUser(_0x51302b,_0x138cbf['destcalleridname'],_0x138cbf[_0x2ec0('0x67')]);})['then'](function(_0x2243de){_0x32ec8a=_0x2243de;logger[_0x2ec0('0xc')](_0x2ec0('0x68'),_0x32ec8a['id']);return getTicket(_0x51302b,_0x4253ca,_0x32ec8a,_0x58b6e8,_0x138cbf);})[_0x2ec0('0x16')](function(_0x42d300){if(_0x42d300){logger[_0x2ec0('0xc')](_0x2ec0('0x53'),_0x42d300['id']);switch(_0x51302b[_0x2ec0('0x3c')]){case'integrationTab':logger['info'](_0x2ec0('0x69'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x2ec0('0xd')](_0x2ec0('0x57'),_0x51302b[_0x2ec0('0x20')],_0x4253ca['id'],_0x42d300['id']),'method':_0x2ec0('0xf')});case _0x2ec0('0x58'):logger[_0x2ec0('0xc')](_0x2ec0('0x69'),_0x2ec0('0x59'));emit(util[_0x2ec0('0xd')](_0x2ec0('0x5a'),_0x18318a[_0x2ec0('0x48')]),'trigger:browser:url',{'uri':util[_0x2ec0('0xd')](_0x2ec0('0x5c'),_0x51302b['remoteUri'][_0x2ec0('0x5d')]('/api/v2',''),_0x42d300['id'])});break;default:logger['error'](_0x2ec0('0x69'),_0x2ec0('0x6a'));}}})[_0x2ec0('0x5f')](function(_0x2814cb){logger[_0x2ec0('0x5e')](_0x2ec0('0x6b'),util['inspect'](_0x2814cb,{'showHidden':!![],'depth':null}));});};exports[_0x2ec0('0x6c')]=function(_0x53f988,_0xcd0944,_0x4580c7,_0x4c4e66,_0x593630,_0x1f6bca){var _0x58fc69,_0x2116d2;_0x1f6bca[_0x2ec0('0x20')]=intUtil[_0x2ec0('0x4a')](_0x1f6bca[_0x2ec0('0x20')]);_0x1f6bca[_0x2ec0('0x4b')]=intUtil[_0x2ec0('0x4a')](_0x1f6bca['serverUrl']);if(_0x593630&&_0x593630[_0x2ec0('0x6d')]){logger[_0x2ec0('0xc')]('['+_0xcd0944[_0x2ec0('0x6e')][_0x2ec0('0x6f')]()+']',_0x2ec0('0x65'));_0xcd0944[_0x2ec0('0x4c')]=util[_0x2ec0('0xd')](_0x2ec0('0x4d'),_0x1f6bca['serverUrl'],_0xcd0944[_0x2ec0('0x4e')],md5(_0xcd0944['uniqueid']));}else{_0xcd0944['recordingURL']='';}headers[_0x2ec0('0x66')]=getAuth(_0x1f6bca);return getUser(_0x1f6bca)[_0x2ec0('0x16')](function(_0xdb14d){_0x58fc69=_0xdb14d;logger[_0x2ec0('0xc')](_0x2ec0('0x50'),_0x58fc69['id']);return getEndUser(_0x1f6bca,_0xcd0944[_0x2ec0('0x51')],_0xcd0944['calleridnum']);})[_0x2ec0('0x16')](function(_0x222aa6){_0x2116d2=_0x222aa6;logger[_0x2ec0('0xc')]('The\x20Enduser\x20ID\x20is:',_0x2116d2['id']);return getTicket(_0x1f6bca,_0x58fc69,_0x2116d2,_0x4580c7,_0xcd0944);})[_0x2ec0('0x16')](function(_0x2ccc05){if(_0x2ccc05){logger['info']('The\x20Ticket\x20ID\x20is:',_0x2ccc05['id']);}})[_0x2ec0('0x5f')](function(_0x25f6f2){logger[_0x2ec0('0x5e')]('['+_0xcd0944[_0x2ec0('0x6e')][_0x2ec0('0x6f')]()+']'+_0x2ec0('0x70'),util[_0x2ec0('0x61')](_0x25f6f2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9c13=['%s:%s','authType','token','%s/token:%s','Basic\x20%s','toString','base64','debug','GET','map','forEach','picklist','type','nameField','customField','custom_fields','push','idField','content','variable','variableName','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridnum','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','Subjects','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','password'];(function(_0x38ee11,_0x3e776c){var _0x50364e=function(_0x1aeaf4){while(--_0x1aeaf4){_0x38ee11['push'](_0x38ee11['shift']());}};_0x50364e(++_0x3e776c);}(_0x9c13,0xa6));var _0x39c1=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0x9c13[_0x11946c];return _0x383935;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require(_0x39c1('0x0'));var intUtil=require(_0x39c1('0x1'));var config=require('../../../../config/environment');var logger=require(_0x39c1('0x2'))(_0x39c1('0x3'));config[_0x39c1('0x4')]=_[_0x39c1('0x5')](config[_0x39c1('0x4')],{'host':_0x39c1('0x6'),'port':0x18eb});var io=require(_0x39c1('0x7'))(new Redis(config[_0x39c1('0x4')]));function emit(_0x523b9e,_0x50a5cf,_0x14e947){io['to'](_0x523b9e)['emit'](_0x50a5cf,_0x14e947);}var headers={'Content-Type':_0x39c1('0x8'),'Accept':_0x39c1('0x8')};function getTicket(_0xd87175,_0x317bfd,_0x3f46ee,_0x503571,_0x20ce6e){logger[_0x39c1('0x9')](_0x39c1('0xa'));return request({'uri':util[_0x39c1('0xb')](_0x39c1('0xc'),_0xd87175[_0x39c1('0xd')]),'method':_0x39c1('0xe'),'body':{'ticket':_[_0x39c1('0xf')]({'requester_id':_0x3f46ee['id'],'submitter_id':_0x317bfd?_0x317bfd['id']:undefined,'assignee_id':_0x317bfd?_0x317bfd['id']:undefined,'tags':getTags(_0x503571[_0x39c1('0x10')],_0x39c1('0x11')),'subject':intUtil['getString'](_0x503571[_0x39c1('0x12')],_0x20ce6e,'\x20'),'description':intUtil[_0x39c1('0x13')](_0x503571[_0x39c1('0x14')],_0x20ce6e,'\x0a'),'comment':{'public':![],'body':intUtil[_0x39c1('0x13')](_0x503571[_0x39c1('0x14')],_0x20ce6e,'\x0a')}},getCustomFields(_0x503571[_0x39c1('0x15')],_0x20ce6e))}})[_0x39c1('0x16')](function(_0x3dc1b5){logger[_0x39c1('0x9')](_0x39c1('0x17'));return _0x3dc1b5[_0x39c1('0x18')];});}function getUser(_0x133b6d,_0x59e377){if(intUtil[_0x39c1('0x19')](_0x59e377)){logger['info'](_0x39c1('0x1a'),_0x59e377);return request({'uri':util[_0x39c1('0xb')]('%s/search.json',_0x133b6d[_0x39c1('0xd')]),'qs':{'query':util[_0x39c1('0xb')](_0x39c1('0x1b'),_0x59e377)}})[_0x39c1('0x16')](function(_0x58460d){if(_0x58460d[_0x39c1('0x1c')]){logger['info'](_0x39c1('0x1d'));return _['find'](_0x58460d[_0x39c1('0x1e')],{'email':_0x59e377,'role':_0x39c1('0x1f')});}else{logger[_0x39c1('0x9')](_0x39c1('0x20'));return request({'uri':util['format'](_0x39c1('0x21'),_0x133b6d['remoteUri'])})[_0x39c1('0x16')](function(_0x11e2d5){logger[_0x39c1('0x9')](_0x39c1('0x22'));return _0x11e2d5['user'];});}});}else{logger[_0x39c1('0x9')](_0x39c1('0x20'));return request({'uri':util[_0x39c1('0xb')]('%s/users/me.json',_0x133b6d[_0x39c1('0xd')])})[_0x39c1('0x16')](function(_0x121725){logger['info'](_0x39c1('0x22'));return _0x121725[_0x39c1('0x23')];});}}function getEndUser(_0x1b1215,_0x364ce1,_0x378689){logger[_0x39c1('0x9')](_0x39c1('0x24'),_0x378689);return request({'uri':util['format'](_0x39c1('0x25'),_0x1b1215['remoteUri']),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x378689)}})['then'](function(_0x2e9a1c){var _0x244567;if(_0x2e9a1c[_0x39c1('0x1e')][_0x39c1('0x26')]){_0x2e9a1c['results']=_[_0x39c1('0x27')](_0x2e9a1c[_0x39c1('0x1e')],{'suspended':![],'role':'end-user'});if(_0x2e9a1c[_0x39c1('0x1e')][_0x39c1('0x26')]){_0x244567=_[_0x39c1('0x28')](_0x2e9a1c[_0x39c1('0x1e')]);}}if(_0x244567){logger[_0x39c1('0x9')](_0x39c1('0x29'));return _0x244567;}else{logger[_0x39c1('0x9')](_0x39c1('0x2a'));return request({'uri':util[_0x39c1('0xb')](_0x39c1('0x2b'),_0x1b1215['remoteUri']),'method':_0x39c1('0xe'),'body':{'user':{'role':'end-user','name':util[_0x39c1('0xb')]('Caller\x20-\x20%s',_0x364ce1||_0x378689),'phone':_0x378689}}})[_0x39c1('0x16')](function(_0x32f746){logger['info'](_0x39c1('0x2c'));return _0x32f746[_0x39c1('0x23')];});}});}function getAuth(_0x2a0935){var _0x367bca;if(_0x2a0935['authType']===_0x39c1('0x2d')){_0x367bca=util[_0x39c1('0xb')](_0x39c1('0x2e'),_0x2a0935['username'],_0x2a0935[_0x39c1('0x2d')]);}else if(_0x2a0935[_0x39c1('0x2f')]===_0x39c1('0x30')){_0x367bca=util[_0x39c1('0xb')](_0x39c1('0x31'),_0x2a0935['username'],_0x2a0935[_0x39c1('0x30')]);}return util[_0x39c1('0xb')](_0x39c1('0x32'),new Buffer(_0x367bca)[_0x39c1('0x33')](_0x39c1('0x34')));}function request(_0x14b983){logger[_0x39c1('0x35')]('[HTTP]',JSON['stringify'](_0x14b983));return rp(_[_0x39c1('0x5')](_0x14b983,{'method':_0x39c1('0x36'),'headers':headers,'json':!![]}));}function getTags(_0xfbcca5,_0x31c06a){var _0x1b5d17=[];if(_0xfbcca5&&_0xfbcca5['length']>0x0){_0x1b5d17=_[_0x39c1('0x37')](_0xfbcca5,_0x31c06a);}return _0x1b5d17;}function getCustomFields(_0x246fe9,_0x3effb4){var _0x496368=[];var _0x515178={'custom_fields':[]};if(_0x246fe9['length']>0x0){_[_0x39c1('0x38')](_0x246fe9,function(_0x19d6eb){if(_['includes'](['string',_0x39c1('0x39')],_0x19d6eb[_0x39c1('0x3a')])&&_0x19d6eb[_0x39c1('0x3b')]&&!_0x19d6eb[_0x39c1('0x3c')]){_0x515178[_0x19d6eb[_0x39c1('0x3b')]['toLowerCase']()]=_0x19d6eb['content'][_0x39c1('0x33')]();}else if(_['includes'](['string',_0x39c1('0x39')],_0x19d6eb[_0x39c1('0x3a')])&&_0x19d6eb['idField']&&_0x19d6eb['customField']){_0x515178[_0x39c1('0x3d')][_0x39c1('0x3e')]({'id':_0x19d6eb[_0x39c1('0x3f')],'value':_0x19d6eb[_0x39c1('0x40')][_0x39c1('0x33')]()});}else if(_0x19d6eb[_0x39c1('0x3a')]===_0x39c1('0x41')&&_0x19d6eb['variableName']&&_0x19d6eb[_0x39c1('0x3f')]&&_0x19d6eb[_0x39c1('0x3c')]){_0x3effb4[_0x19d6eb[_0x39c1('0x42')]]&&_0x515178[_0x39c1('0x3d')][_0x39c1('0x3e')]({'id':_0x19d6eb[_0x39c1('0x3f')],'value':_0x3effb4[_0x19d6eb[_0x39c1('0x42')]][_0x39c1('0x33')]()});}else if(_0x19d6eb[_0x39c1('0x3a')]==='customVariable'&&_0x19d6eb[_0x39c1('0x43')]&&_0x19d6eb['Variable'][_0x39c1('0x11')]&&_0x19d6eb['idField']&&_0x19d6eb[_0x39c1('0x3c')]){_0x3effb4[_0x19d6eb[_0x39c1('0x43')]['name'][_0x39c1('0x44')]()]&&_0x515178[_0x39c1('0x3d')]['push']({'id':_0x19d6eb[_0x39c1('0x3f')],'value':_0x3effb4[_0x19d6eb[_0x39c1('0x43')][_0x39c1('0x11')]['toLowerCase']()][_0x39c1('0x33')]()});}});}return _0x515178;}exports[_0x39c1('0x45')]=function(_0x1c6a84,_0xc089c6,_0x9356c7,_0x351e75,_0x576e7f,_0x164d8f){var _0x178066,_0x40064c;_0x164d8f[_0x39c1('0xd')]=intUtil[_0x39c1('0x46')](_0x164d8f[_0x39c1('0xd')]);_0x164d8f[_0x39c1('0x47')]=intUtil['stripTrailingSlash'](_0x164d8f[_0x39c1('0x47')]);if(_0x576e7f&&_0x576e7f[_0x39c1('0x48')]){logger[_0x39c1('0x9')]('[QUEUE]','Recording\x20is\x20enabled!');_0xc089c6['recordingURL']=util[_0x39c1('0xb')](_0x39c1('0x49'),_0x164d8f[_0x39c1('0x47')],_0xc089c6[_0x39c1('0x4a')],md5(_0xc089c6[_0x39c1('0x4a')]));}else{_0xc089c6[_0x39c1('0x4b')]='';}headers[_0x39c1('0x4c')]=getAuth(_0x164d8f);return getUser(_0x164d8f,_0x351e75['email'])[_0x39c1('0x16')](function(_0x446e92){_0x178066=_0x446e92;logger[_0x39c1('0x9')]('The\x20User\x20ID\x20is:',_0x178066['id']);return getEndUser(_0x164d8f,_0xc089c6[_0x39c1('0x4d')],_0xc089c6['calleridnum']);})[_0x39c1('0x16')](function(_0x5f9349){_0x40064c=_0x5f9349;logger[_0x39c1('0x9')](_0x39c1('0x4e'),_0x40064c['id']);return getTicket(_0x164d8f,_0x178066,_0x40064c,_0x9356c7,_0xc089c6);})[_0x39c1('0x16')](function(_0x39d9ac){if(_0x39d9ac){logger['info'](_0x39c1('0x4f'),_0x39d9ac['id']);switch(_0x164d8f[_0x39c1('0x3a')]){case'integrationTab':logger[_0x39c1('0x9')](_0x39c1('0x50'),_0x39c1('0x51'));return request({'uri':util[_0x39c1('0xb')](_0x39c1('0x52'),_0x164d8f['remoteUri'],_0x178066['id'],_0x39d9ac['id']),'method':_0x39c1('0xe')});case _0x39c1('0x53'):logger[_0x39c1('0x9')]('[QUEUE]',_0x39c1('0x54'));emit(util['format']('user:%s',_0x351e75[_0x39c1('0x11')]),_0x39c1('0x55'),{'uri':util['format']('%s/agent/tickets/%s',_0x164d8f[_0x39c1('0xd')][_0x39c1('0x56')](_0x39c1('0x57'),''),_0x39d9ac['id'])});break;default:logger[_0x39c1('0x58')](_0x39c1('0x50'),_0x39c1('0x59'));}}})[_0x39c1('0x5a')](function(_0x3e977b){logger[_0x39c1('0x58')](_0x39c1('0x5b'),util[_0x39c1('0x5c')](_0x3e977b,{'showHidden':!![],'depth':null}));});};exports[_0x39c1('0x5d')]=function(_0x87b994,_0x11cce8,_0x2a5eb1,_0x4ac7e6,_0x29a54b,_0x1eaa90,_0x37a3a0){var _0x4a5fc3,_0x352e8e;_0x1eaa90[_0x39c1('0xd')]=intUtil[_0x39c1('0x46')](_0x1eaa90['remoteUri']);_0x1eaa90[_0x39c1('0x47')]=intUtil[_0x39c1('0x46')](_0x1eaa90[_0x39c1('0x47')]);if(_0x37a3a0&&_0x37a3a0['recordingFormat']&&_0x37a3a0['recordingFormat']!==_0x39c1('0x5e')){logger[_0x39c1('0x9')](_0x39c1('0x5f'),_0x39c1('0x60'));_0x11cce8['recordingURL']=util[_0x39c1('0xb')](_0x39c1('0x49'),_0x1eaa90['serverUrl'],_0x11cce8[_0x39c1('0x4a')],md5(_0x11cce8[_0x39c1('0x4a')]));}headers[_0x39c1('0x4c')]=getAuth(_0x1eaa90);return getUser(_0x1eaa90,_0x4ac7e6['email'])[_0x39c1('0x16')](function(_0x598352){_0x4a5fc3=_0x598352;logger[_0x39c1('0x9')](_0x39c1('0x61'),_0x4a5fc3['id']);return getEndUser(_0x1eaa90,_0x11cce8['destcalleridname'],_0x11cce8[_0x39c1('0x62')]);})['then'](function(_0x254c4b){_0x352e8e=_0x254c4b;logger[_0x39c1('0x9')](_0x39c1('0x4e'),_0x352e8e['id']);return getTicket(_0x1eaa90,_0x4a5fc3,_0x352e8e,_0x2a5eb1,_0x11cce8);})['then'](function(_0x2dda75){if(_0x2dda75){logger['info']('The\x20Ticket\x20ID\x20is:',_0x2dda75['id']);switch(_0x1eaa90[_0x39c1('0x3a')]){case'integrationTab':logger[_0x39c1('0x9')](_0x39c1('0x5f'),_0x39c1('0x51'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x1eaa90['remoteUri'],_0x4a5fc3['id'],_0x2dda75['id']),'method':_0x39c1('0xe')});case _0x39c1('0x53'):logger[_0x39c1('0x9')](_0x39c1('0x5f'),_0x39c1('0x54'));emit(util[_0x39c1('0xb')]('user:%s',_0x4ac7e6[_0x39c1('0x11')]),_0x39c1('0x55'),{'uri':util[_0x39c1('0xb')](_0x39c1('0x63'),_0x1eaa90['remoteUri'][_0x39c1('0x56')](_0x39c1('0x57'),''),_0x2dda75['id'])});break;default:logger['error'](_0x39c1('0x5f'),_0x39c1('0x59'));}}})[_0x39c1('0x5a')](function(_0x53fc31){logger[_0x39c1('0x58')](_0x39c1('0x64'),util[_0x39c1('0x5c')](_0x53fc31,{'showHidden':!![],'depth':null}));});};exports[_0x39c1('0x65')]=function(_0x23227e,_0x1ec8dc,_0x31d1cc,_0x3793c1,_0x31fede,_0x3285e6){var _0x2914a0,_0x2759fa;_0x3285e6[_0x39c1('0xd')]=intUtil['stripTrailingSlash'](_0x3285e6[_0x39c1('0xd')]);_0x3285e6[_0x39c1('0x47')]=intUtil['stripTrailingSlash'](_0x3285e6[_0x39c1('0x47')]);if(_0x31fede&&_0x31fede[_0x39c1('0x48')]){logger[_0x39c1('0x9')]('['+_0x1ec8dc[_0x39c1('0x66')][_0x39c1('0x67')]()+']',_0x39c1('0x60'));_0x1ec8dc[_0x39c1('0x4b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3285e6[_0x39c1('0x47')],_0x1ec8dc[_0x39c1('0x4a')],md5(_0x1ec8dc[_0x39c1('0x4a')]));}else{_0x1ec8dc['recordingURL']='';}headers['Authorization']=getAuth(_0x3285e6);return getUser(_0x3285e6)[_0x39c1('0x16')](function(_0x47de0c){_0x2914a0=_0x47de0c;logger['info'](_0x39c1('0x61'),_0x2914a0['id']);return getEndUser(_0x3285e6,_0x1ec8dc['calleridname'],_0x1ec8dc[_0x39c1('0x68')]);})[_0x39c1('0x16')](function(_0x991eeb){_0x2759fa=_0x991eeb;logger[_0x39c1('0x9')]('The\x20Enduser\x20ID\x20is:',_0x2759fa['id']);return getTicket(_0x3285e6,_0x2914a0,_0x2759fa,_0x31d1cc,_0x1ec8dc);})[_0x39c1('0x16')](function(_0x3d56a0){if(_0x3d56a0){logger['info'](_0x39c1('0x4f'),_0x3d56a0['id']);}})[_0x39c1('0x5a')](function(_0x101ff9){logger[_0x39c1('0x58')]('['+_0x1ec8dc[_0x39c1('0x66')][_0x39c1('0x67')]()+']'+_0x39c1('0x69'),util[_0x39c1('0x5c')](_0x101ff9,{'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 cdb75b9..28404f5 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 _0x7b34=['/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','format','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','connect','Call_Result','rejected','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','agentcalledAt','Inbound','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','emit','debug','[HTTP]','stringify','forEach','includes','string','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','moduleCreate','role','first_name','last_name','code','details','enduserType','startCase','The\x20failing\x20result\x20is','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri'];(function(_0x5bbc07,_0x1ac56c){var _0x4ba5bf=function(_0xe3746b){while(--_0xe3746b){_0x5bbc07['push'](_0x5bbc07['shift']());}};_0x4ba5bf(++_0x1ac56c);}(_0x7b34,0x18d));var _0x47b3=function(_0x19d13c,_0x3cbe86){_0x19d13c=_0x19d13c-0x0;var _0x174641=_0x7b34[_0x19d13c];return _0x174641;};'use strict';var _=require(_0x47b3('0x0'));var rp=require(_0x47b3('0x1'));var md5=require(_0x47b3('0x2'));var util=require(_0x47b3('0x3'));var intUtil=require(_0x47b3('0x4'));var moment=require(_0x47b3('0x5'));var Redis=require(_0x47b3('0x6'));var BPromise=require(_0x47b3('0x7'));var config=require(_0x47b3('0x8'));var logger=require(_0x47b3('0x9'))(_0x47b3('0xa'));config[_0x47b3('0xb')]=_[_0x47b3('0xc')](config[_0x47b3('0xb')],{'host':_0x47b3('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x47b3('0xb')]));function emit(_0x51e6cb,_0xb6549a,_0x3e771f){io['to'](_0x51e6cb)[_0x47b3('0xe')](_0xb6549a,_0x3e771f);}function request(_0x5497a9){logger[_0x47b3('0xf')](_0x47b3('0x10'),JSON[_0x47b3('0x11')](_0x5497a9));return rp(_0x5497a9);}function getCustomFields(_0x3fddf3,_0x4d8568){var _0x379d53={};if(_0x3fddf3['length']>0x0){_[_0x47b3('0x12')](_0x3fddf3,function(_0x44d64c){if(_[_0x47b3('0x13')]([_0x47b3('0x14'),'picklist'],_0x44d64c[_0x47b3('0x15')])&&_0x44d64c['idField']){_0x379d53[_0x44d64c[_0x47b3('0x16')]]=_0x44d64c[_0x47b3('0x17')][_0x47b3('0x18')]();}else if(_0x44d64c['type']===_0x47b3('0x19')&&_0x44d64c['variableName']&&_0x44d64c[_0x47b3('0x16')]&&_0x4d8568[_0x44d64c[_0x47b3('0x1a')]]){_0x379d53[_0x44d64c['idField']]=_0x4d8568[_0x44d64c[_0x47b3('0x1a')]][_0x47b3('0x18')]();}else if(_0x44d64c[_0x47b3('0x15')]===_0x47b3('0x1b')&&_0x44d64c[_0x47b3('0x1c')]&&_0x44d64c[_0x47b3('0x1c')][_0x47b3('0x1d')]&&_0x44d64c[_0x47b3('0x16')]&&_0x4d8568[_0x44d64c[_0x47b3('0x1c')][_0x47b3('0x1d')][_0x47b3('0x1e')]()]){_0x379d53[_0x44d64c['idField']]=_0x4d8568[_0x44d64c[_0x47b3('0x1c')][_0x47b3('0x1d')][_0x47b3('0x1e')]()][_0x47b3('0x18')]();}});}return _0x379d53;}function getName(_0x1cf939){if(_0x1cf939['indexOf']('\x20')>0x0){var _0x1abd22=_0x1cf939[_0x47b3('0x1f')](/ (.+)/);if(_0x1abd22[0x1]){return _0x1abd22;}}return[_0x1cf939,_0x1cf939];}var accountsTokens={};function getAccessToken(_0xdc78d0){return new Promise(function(_0x17ef57,_0x172c79){if(!_[_0x47b3('0x20')](accountsTokens[_0xdc78d0['id']])&&!_[_0x47b3('0x20')](accountsTokens[_0xdc78d0['id']][_0x47b3('0x21')])){if(moment()[_0x47b3('0x22')](accountsTokens[_0xdc78d0['id']][_0x47b3('0x23')])){_0x17ef57(accountsTokens[_0xdc78d0['id']][_0x47b3('0x21')]);}}var _0x2310f5;switch(_0xdc78d0[_0x47b3('0x24')]){case'US':_0x2310f5=_0x47b3('0x25');break;case'AU':_0x2310f5='https://accounts.zoho.com.au';break;case'EU':_0x2310f5=_0x47b3('0x26');break;case'IN':_0x2310f5=_0x47b3('0x27');break;case'CN':_0x2310f5=_0x47b3('0x28');break;default:_0x2310f5='https://accounts.zoho.eu';break;}var _0x33cefd={'method':_0x47b3('0x29'),'uri':_0x2310f5+_0x47b3('0x2a'),'qs':{'refresh_token':_0xdc78d0[_0x47b3('0x2b')],'client_id':_0xdc78d0[_0x47b3('0x2c')],'client_secret':_0xdc78d0[_0x47b3('0x2d')],'grant_type':_0x47b3('0x2e')},'json':!![]};return rp(_0x33cefd)[_0x47b3('0x2f')](function(_0xa2a90b){accountsTokens[_0xdc78d0['id']]={'access_token':_0xa2a90b['access_token'],'expires_in':moment()[_0x47b3('0x30')](_0xa2a90b[_0x47b3('0x23')],_0x47b3('0x31'))};_0x17ef57(_0xa2a90b[_0x47b3('0x21')]);})[_0x47b3('0x32')](function(_0x26b301){logger[_0x47b3('0x33')](_0x47b3('0x34'),_0x26b301[_0x47b3('0x35')]);_0x172c79(_0x26b301);});});}function getUser(_0xfd678b,_0x30e05c,_0x4b9e7e,_0xdb3c04){logger[_0x47b3('0x36')](_0x47b3('0x37'));return request({'method':_0x47b3('0x38'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x30e05c),'qs':{'type':_0x47b3('0x39')},'headers':{'Authorization':_0x47b3('0x3a')+_0xfd678b},'json':!![]})[_0x47b3('0x2f')](function(_0x8bd049){if(_0x8bd049[_0x47b3('0x3b')]){var _0x1ec021=-0x1;if(_[_0x47b3('0x3c')](_0x8bd049[_0x47b3('0x3b')])){if(!_['isNil'](_0xdb3c04)){_0x1ec021=_[_0x47b3('0x3d')](_0x8bd049[_0x47b3('0x3b')],function(_0x2b2757){return _0x2b2757[_0x47b3('0x3e')]===_0xdb3c04;});}if(_0x1ec021>=0x0){logger[_0x47b3('0x36')](_0x47b3('0x3f'));}else{logger[_0x47b3('0x36')]('Using\x20the\x20admin\x20account!');_0x1ec021=_[_0x47b3('0x3d')](_0x8bd049[_0x47b3('0x3b')],function(_0x2cda5a){return _0x2cda5a[_0x47b3('0x40')][_0x47b3('0x1d')]===_0x47b3('0x41');});}return _0x8bd049[_0x47b3('0x3b')][_0x1ec021];}else{if(_0x8bd049[_0x47b3('0x42')][_0x47b3('0x40')]['name']===_0x47b3('0x41')){logger[_0x47b3('0x36')](_0x47b3('0x43'));user=_0x8bd049['user'];return user;}else{logger[_0x47b3('0x33')]('The\x20failing\x20result\x20is',JSON[_0x47b3('0x11')](_0x8bd049));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x47b3('0x11')](_0x8bd049));}}}else{logger[_0x47b3('0x33')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x8bd049));throw new Error(_0x47b3('0x44')+JSON['stringify'](_0x8bd049));}})[_0x47b3('0x32')](function(_0x20690d){console[_0x47b3('0x33')](_0x20690d);});}function getZohoUser(_0x218081,_0x1cf02a){return new BPromise(function(_0x2bba65,_0x37c1c5){request(_0x218081)[_0x47b3('0x2f')](function(_0x510dd9){var _0x22b7c5=null;if(_0x510dd9){_0x22b7c5=_0x510dd9[_0x47b3('0x45')][0x0];_0x22b7c5['enduserType']=_0x1cf02a;}_0x2bba65(_0x22b7c5);})[_0x47b3('0x32')](function(_0x44c107){_0x37c1c5(_0x44c107);});});}function createEndUser(_0x401bf0,_0x30e9e2,_0x326972,_0x2aa4fe,_0x5bff41,_0x263132){var _0x326972=getName(_0x326972);return request({'method':_0x47b3('0x29'),'uri':_0x47b3('0x46')+_0x30e9e2+'/crm/v2/'+_['startCase'](_0x263132[_0x47b3('0x47')])+'s','body':{'data':[{'Last_Name':_0x326972[0x1],'First_Name':_0x326972[0x0],'Phone':_0x2aa4fe,'Owner':{'name':!_['isNil'](_0x5bff41[_0x47b3('0x48')]['name'])?_0x5bff41[_0x47b3('0x48')][_0x47b3('0x1d')]:!_[_0x47b3('0x20')](_0x5bff41[_0x47b3('0x49')])?_0x5bff41[_0x47b3('0x49')]+'\x20'+_0x5bff41['last_name']:_0x5bff41[_0x47b3('0x4a')],'id':_0x5bff41['id']}}]},'headers':{'Authorization':_0x47b3('0x3a')+_0x401bf0},'json':!![]})[_0x47b3('0x2f')](function(_0x23983){if(_0x23983&&_0x23983['data'][0x0][_0x47b3('0x4b')]==='SUCCESS'){var _0x4c085a=_0x23983[_0x47b3('0x45')][0x0][_0x47b3('0x4c')];_0x4c085a[_0x47b3('0x4d')]=_[_0x47b3('0x4e')](_0x263132[_0x47b3('0x47')])+'s';return _0x4c085a;}logger[_0x47b3('0x33')](_0x47b3('0x4f'),JSON[_0x47b3('0x11')](data));throw new Error(_0x47b3('0x50')+JSON[_0x47b3('0x11')](data));})[_0x47b3('0x32')](function(_0x4738d1){console[_0x47b3('0x51')](_0x47b3('0x52'),_0x4738d1);});}function getEndUser(_0x6a6ccd,_0x1367f2,_0x2e0b09,_0xdedf2f,_0x26974a,_0x5e7429,_0x3e31f4){var _0x2f4348={'method':_0x47b3('0x38'),'uri':'','headers':{'Authorization':_0x47b3('0x3a')+_0x6a6ccd},'json':!![]};switch(_0x3e31f4[_0x47b3('0x53')]){case _0x47b3('0x54'):_0x2f4348[_0x47b3('0x55')]=_0x47b3('0x46')+_0x1367f2+_0x47b3('0x56')+_0x26974a+'))';return getZohoUser(_0x2f4348,_0x47b3('0x57'))[_0x47b3('0x2f')](function(_0xc91616){if(_0xc91616)return _0xc91616;_0x2f4348[_0x47b3('0x55')]='https://www.zohoapis.'+_0x1367f2+_0x47b3('0x58')+_0x26974a+'))';return getZohoUser(_0x2f4348,_0x47b3('0x59'))[_0x47b3('0x2f')](function(_0x1209a5){if(_0x1209a5)return _0x1209a5;if(_0x3e31f4['moduleCreate']!=_0x47b3('0x5a')){return createEndUser(_0x6a6ccd,_0x1367f2,_0xdedf2f,_0x26974a,_0x5e7429,_0x3e31f4);}else{return{};}});});break;case _0x47b3('0x5b'):_0x2f4348[_0x47b3('0x55')]=_0x47b3('0x46')+_0x1367f2+_0x47b3('0x56')+_0x26974a+'))';return getZohoUser(_0x2f4348,_0x47b3('0x57'))[_0x47b3('0x2f')](function(_0x52db25){if(_0x52db25)return _0x52db25;if(_0x3e31f4[_0x47b3('0x47')]!=_0x47b3('0x5a')){return createEndUser(_0x6a6ccd,_0x1367f2,_0xdedf2f,_0x26974a,_0x5e7429,_0x3e31f4);}else{return{};}});break;case _0x47b3('0x5c'):_0x2f4348[_0x47b3('0x55')]=_0x47b3('0x46')+_0x1367f2+_0x47b3('0x58')+_0x26974a+'))';return getZohoUser(_0x2f4348,'Leads')['then'](function(_0x4af6aa){if(_0x4af6aa)return _0x4af6aa;if(_0x3e31f4[_0x47b3('0x47')]!=_0x47b3('0x5a')){return createEndUser(_0x6a6ccd,_0x1367f2,_0xdedf2f,_0x26974a,_0x5e7429,_0x3e31f4);}else{return{};}});break;}}function getCall(_0x1a7e19,_0x331fa8,_0x7b0352,_0x30b3be,_0x5341f3,_0x8b50c0,_0x4f38c8,_0x46ad3e){logger[_0x47b3('0x36')](_0x47b3('0x5d'));var _0x4b4110={};_0x4b4110[_0x47b3('0x5e')]={'name':!_[_0x47b3('0x20')](_0x30b3be[_0x47b3('0x48')][_0x47b3('0x1d')])&&!_['isNil'](_0x30b3be[_0x47b3('0x40')][_0x47b3('0x1d')])&&_0x30b3be[_0x47b3('0x40')][_0x47b3('0x1d')]===_0x47b3('0x5f')?_0x30b3be[_0x47b3('0x48')][_0x47b3('0x1d')]:!_[_0x47b3('0x20')](_0x30b3be['first_name'])?_0x30b3be['first_name']+'\x20'+_0x30b3be['last_name']:_0x30b3be[_0x47b3('0x4a')],'id':_0x30b3be['id']};_0x4b4110['Subject']=intUtil[_0x47b3('0x60')](_0x8b50c0['Subjects'],_0x4f38c8,'\x20');_0x4b4110['Description']=intUtil[_0x47b3('0x60')](_0x8b50c0[_0x47b3('0x61')],_0x4f38c8,'\x0a');if(_0x5341f3[_0x47b3('0x4d')]==='Contacts'){_0x4b4110[_0x47b3('0x62')]={'name':!_['isNil'](_0x5341f3[_0x47b3('0x63')])?_0x5341f3['Full_Name']:!_[_0x47b3('0x20')](_0x5341f3[_0x47b3('0x64')])?_0x5341f3[_0x47b3('0x64')]+'\x20'+_0x5341f3['Last_Name']:_0x5341f3[_0x47b3('0x65')],'id':_0x5341f3['id']};}if(_0x5341f3[_0x47b3('0x4d')]===_0x47b3('0x59')){_0x4b4110[_0x47b3('0x66')]={'name':!_['isNil'](_0x5341f3[_0x47b3('0x63')])?_0x5341f3[_0x47b3('0x63')]:!_['isNil'](_0x5341f3[_0x47b3('0x64')])?_0x5341f3[_0x47b3('0x64')]+'\x20'+_0x5341f3[_0x47b3('0x65')]:_0x5341f3[_0x47b3('0x65')],'id':_0x5341f3['id']};_0x4b4110[_0x47b3('0x67')]=_[_0x47b3('0x4e')](_0x5341f3[_0x47b3('0x4d')]);}if(_0x4f38c8[_0x47b3('0x68')]){_0x4b4110[_0x47b3('0x69')]=moment[_0x47b3('0x6a')](parseInt(_0x4f38c8[_0x47b3('0x68')])*0x3e8)[_0x47b3('0x6b')]('mm:ss');}else if(_0x4f38c8[_0x47b3('0x6c')]&&_0x4f38c8[_0x47b3('0x6d')]){_0x4b4110['Call_Duration']=moment[_0x47b3('0x6a')](moment(_0x4f38c8[_0x47b3('0x6d')],_0x47b3('0x6e'))[_0x47b3('0x6f')](moment(_0x4f38c8[_0x47b3('0x70')],_0x47b3('0x6e'))))['format'](_0x47b3('0x71'));}switch(_0x4f38c8[_0x47b3('0x72')]){case _0x47b3('0x73'):_0x4b4110['Call_Result']='Called';break;case'complete':case _0x47b3('0x74'):_0x4b4110[_0x47b3('0x75')]='Answered';break;case _0x47b3('0x76'):_0x4b4110[_0x47b3('0x75')]=_0x47b3('0x77');break;case _0x47b3('0x78'):_0x4b4110['Call_Result']=_0x47b3('0x79');break;case _0x47b3('0x7a'):_0x4b4110[_0x47b3('0x75')]='Timeout';default:}_0x4b4110[_0x47b3('0x7b')]=(_0x46ad3e==='outbound'?moment(_0x4f38c8[_0x47b3('0x70')])[_0x47b3('0x6b')](_0x47b3('0x6e')):moment(_0x4f38c8[_0x47b3('0x7c')])['format'](_0x47b3('0x6e')))||moment()['format'](_0x47b3('0x6e'));_0x4b4110['Call_Type']=_0x46ad3e||_0x47b3('0x7d');_0x4b4110=_['merge'](_0x4b4110,getCustomFields(_0x8b50c0[_0x47b3('0x7e')],_0x4f38c8));return request({'method':_0x47b3('0x29'),'uri':_0x47b3('0x46')+_0x331fa8+_0x47b3('0x7f'),'headers':{'Authorization':_0x47b3('0x3a')+_0x1a7e19},'body':{'data':[_0x4b4110]},'json':!![]})[_0x47b3('0x2f')](function(_0x32ce38){if(_0x32ce38&&_0x32ce38[_0x47b3('0x45')][0x0][_0x47b3('0x4b')]==='SUCCESS'){logger[_0x47b3('0x36')](_0x47b3('0x80'));return{'id':_0x32ce38[_0x47b3('0x45')][0x0][_0x47b3('0x4c')]['id']};}})['catch'](function(_0x2026f6){logger[_0x47b3('0x36')]('err',_0x2026f6[_0x47b3('0x35')]);console[_0x47b3('0x51')](_0x47b3('0x81'),_0x2026f6);});}exports[_0x47b3('0x82')]=function(_0x1ffaff,_0x25d7a5,_0x5b6803,_0x32e418,_0x469f39,_0x5df75f){var _0x4dab61,_0x498f2d,_0x1bdd02;_0x5df75f[_0x47b3('0x83')]=intUtil['stripTrailingSlash'](_0x5df75f[_0x47b3('0x83')]);_0x5df75f['serverUrl']=intUtil[_0x47b3('0x84')](_0x5df75f[_0x47b3('0x85')]);if(_0x469f39&&_0x469f39[_0x47b3('0x86')]){logger[_0x47b3('0x36')](_0x47b3('0x87'),_0x47b3('0x88'));_0x25d7a5[_0x47b3('0x89')]=_0x5df75f[_0x47b3('0x85')]+_0x47b3('0x8a')+_0x25d7a5[_0x47b3('0x8b')]+_0x47b3('0x8c')+md5(_0x25d7a5[_0x47b3('0x8b')]);}else{_0x25d7a5[_0x47b3('0x89')]='';}var _0x55aac2=_0x5df75f[_0x47b3('0x83')]===_0x47b3('0x8d')?'eu':_0x47b3('0x8e');return getAccessToken(_0x5df75f)[_0x47b3('0x2f')](function(_0x5a65b9){_0x1bdd02=_0x5a65b9;return getUser(_0x1bdd02,_0x55aac2,_0x5df75f,_0x32e418[_0x47b3('0x3e')]);})[_0x47b3('0x2f')](function(_0x16c453){_0x4dab61=_0x16c453;logger[_0x47b3('0x36')](_0x47b3('0x8f'),_0x4dab61['id']);return getEndUser(_0x1bdd02,_0x55aac2,_0x5df75f,_0x25d7a5[_0x47b3('0x90')],_0x25d7a5[_0x47b3('0x91')],_0x4dab61,_0x5b6803);})[_0x47b3('0x2f')](function(_0x52a7dc){_0x498f2d=_0x52a7dc;return getCall(_0x1bdd02,_0x55aac2,_0x5df75f,_0x4dab61,_0x498f2d,_0x5b6803,_0x25d7a5,_0x47b3('0x7d'));})[_0x47b3('0x2f')](function(_0x44df6e){if(_0x44df6e){logger[_0x47b3('0x36')](_0x47b3('0x92'),_0x44df6e['id']);logger['info'](_0x47b3('0x87'),_0x47b3('0x93'));emit(util[_0x47b3('0x6b')](_0x47b3('0x94'),_0x32e418[_0x47b3('0x1d')]),'trigger:browser:url',{'uri':_0x47b3('0x95')+_0x5df75f[_0x47b3('0x83')]+_0x47b3('0x96')+_0x44df6e['id']});}})[_0x47b3('0x32')](function(_0x2cc453){logger[_0x47b3('0x33')](_0x47b3('0x87'),JSON[_0x47b3('0x11')](_0x2cc453));});};exports[_0x47b3('0x97')]=function(_0x1c9921,_0x338825,_0x177571,_0x32be93,_0x28c37f,_0x8e026,_0x3b50ab){var _0x37d1b6,_0x1aaf82,_0x180a7d;_0x8e026[_0x47b3('0x83')]=intUtil[_0x47b3('0x84')](_0x8e026[_0x47b3('0x83')]);_0x8e026[_0x47b3('0x85')]=intUtil[_0x47b3('0x84')](_0x8e026['serverUrl']);if(_0x3b50ab&&_0x3b50ab[_0x47b3('0x98')]&&_0x3b50ab['recordingFormat']!==_0x47b3('0x99')){logger[_0x47b3('0x36')](_0x47b3('0x9a'),_0x47b3('0x88'));_0x338825[_0x47b3('0x89')]=_0x8e026[_0x47b3('0x85')]+_0x47b3('0x8a')+_0x338825[_0x47b3('0x8b')]+'/downloads?type=uniqueid&token='+md5(_0x338825['uniqueid']);}var _0x354e93=_0x8e026['host']===_0x47b3('0x8d')?'eu':_0x47b3('0x8e');return getAccessToken(_0x8e026)[_0x47b3('0x2f')](function(_0x3fd4bc){_0x180a7d=_0x3fd4bc;return getUser(_0x180a7d,_0x354e93,_0x8e026,_0x32be93[_0x47b3('0x3e')]);})['then'](function(_0x5a41e4){_0x37d1b6=_0x5a41e4;logger[_0x47b3('0x36')](_0x47b3('0x8f'),_0x37d1b6['id']);return getEndUser(_0x180a7d,_0x354e93,_0x8e026,_0x338825[_0x47b3('0x9b')],_0x338825[_0x47b3('0x9c')],_0x37d1b6,_0x177571);})[_0x47b3('0x2f')](function(_0x36ec3e){_0x1aaf82=_0x36ec3e;return getCall(_0x180a7d,_0x354e93,_0x8e026,_0x37d1b6,_0x1aaf82,_0x177571,_0x338825,_0x47b3('0x9d'));})['then'](function(_0x319634){if(_0x319634){logger[_0x47b3('0x36')](_0x47b3('0x92'),_0x319634['id']);logger['info']('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x47b3('0x6b')](_0x47b3('0x94'),_0x32be93[_0x47b3('0x1d')]),_0x47b3('0x9e'),{'uri':_0x47b3('0x95')+_0x8e026[_0x47b3('0x83')]+'/crm/EntityInfo.do?module=Calls&id='+_0x319634['id']});}})['catch'](function(_0x372210){logger['error'](_0x47b3('0x9a'),JSON[_0x47b3('0x11')](_0x372210));});};exports[_0x47b3('0x9f')]=function(_0x506f06,_0x206b1f,_0x2e2184,_0x586c85,_0x5cf7e7,_0x12c20f){var _0x3d3e8b,_0x28499f,_0x2d4c7e;_0x12c20f[_0x47b3('0x83')]=intUtil['stripTrailingSlash'](_0x12c20f['host']);_0x12c20f['serverUrl']=intUtil['stripTrailingSlash'](_0x12c20f[_0x47b3('0x85')]);if(_0x5cf7e7&&_0x5cf7e7[_0x47b3('0x86')]){logger[_0x47b3('0x36')]('['+_0x206b1f[_0x47b3('0x72')][_0x47b3('0xa0')]()+']','Recording\x20is\x20enabled!');_0x206b1f[_0x47b3('0x89')]=_0x12c20f['serverUrl']+_0x47b3('0x8a')+_0x206b1f[_0x47b3('0x8b')]+_0x47b3('0x8c')+md5(_0x206b1f['uniqueid']);}else{_0x206b1f[_0x47b3('0x89')]='';}var _0x14a8bf=_0x12c20f[_0x47b3('0x83')]===_0x47b3('0x8d')?'eu':'com';return getAccessToken(_0x12c20f)[_0x47b3('0x2f')](function(_0x454b18){_0x2d4c7e=_0x454b18;return getUser(_0x2d4c7e,_0x14a8bf,_0x12c20f);})[_0x47b3('0x2f')](function(_0x700f61){_0x3d3e8b=_0x700f61;logger['info'](_0x47b3('0x8f'),_0x3d3e8b['id']);return getEndUser(_0x2d4c7e,_0x14a8bf,_0x12c20f,_0x206b1f['calleridname'],_0x206b1f[_0x47b3('0x91')],_0x3d3e8b,_0x2e2184);})[_0x47b3('0x2f')](function(_0x139f3e){_0x28499f=_0x139f3e;return getCall(_0x2d4c7e,_0x14a8bf,_0x12c20f,_0x3d3e8b,_0x28499f,_0x2e2184,_0x206b1f,'Inbound');})[_0x47b3('0x2f')](function(_0x4e14ee){if(_0x4e14ee){logger[_0x47b3('0x36')](_0x47b3('0x92'),_0x4e14ee['id']);}})[_0x47b3('0x32')](function(_0x460283){logger[_0x47b3('0x33')]('['+_0x206b1f[_0x47b3('0x72')][_0x47b3('0xa0')]()+']',JSON[_0x47b3('0x11')](_0x460283));});}; \ No newline at end of file +var _0x01d3=['Contacts','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Descriptions','enduserType','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','mm:ss','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','complete','connect','Rejected','abandoned','Abandoned','timeout','outbound','starttime','agentcalledAt','Inbound','Fields','/crm/v2/Calls','details','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','unmanaged','calleridnum','toUpperCase','md5','util','./util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','isNil','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','catch','data','https://www.zohoapis.','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','startCase','log','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact'];(function(_0x3671b7,_0x14c171){var _0x55bb16=function(_0x3acb1e){while(--_0x3acb1e){_0x3671b7['push'](_0x3671b7['shift']());}};_0x55bb16(++_0x14c171);}(_0x01d3,0xdb));var _0x301d=function(_0x3c4e2f,_0x58fb74){_0x3c4e2f=_0x3c4e2f-0x0;var _0x598678=_0x01d3[_0x3c4e2f];return _0x598678;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x301d('0x0'));var util=require(_0x301d('0x1'));var intUtil=require(_0x301d('0x2'));var moment=require('moment');var Redis=require(_0x301d('0x3'));var BPromise=require(_0x301d('0x4'));var config=require(_0x301d('0x5'));var logger=require(_0x301d('0x6'))(_0x301d('0x7'));config['redis']=_[_0x301d('0x8')](config[_0x301d('0x9')],{'host':_0x301d('0xa'),'port':0x18eb});var io=require(_0x301d('0xb'))(new Redis(config[_0x301d('0x9')]));function emit(_0x49a253,_0x106c88,_0x1d8e83){io['to'](_0x49a253)[_0x301d('0xc')](_0x106c88,_0x1d8e83);}function request(_0x445d5c){logger[_0x301d('0xd')](_0x301d('0xe'),JSON[_0x301d('0xf')](_0x445d5c));return rp(_0x445d5c);}function getCustomFields(_0x10f53d,_0x107378){var _0x4e6d86={};if(_0x10f53d[_0x301d('0x10')]>0x0){_[_0x301d('0x11')](_0x10f53d,function(_0x53b139){if(_[_0x301d('0x12')]([_0x301d('0x13'),_0x301d('0x14')],_0x53b139[_0x301d('0x15')])&&_0x53b139['idField']){_0x4e6d86[_0x53b139[_0x301d('0x16')]]=_0x53b139[_0x301d('0x17')][_0x301d('0x18')]();}else if(_0x53b139[_0x301d('0x15')]===_0x301d('0x19')&&_0x53b139[_0x301d('0x1a')]&&_0x53b139[_0x301d('0x16')]&&_0x107378[_0x53b139['variableName']]){_0x4e6d86[_0x53b139[_0x301d('0x16')]]=_0x107378[_0x53b139[_0x301d('0x1a')]]['toString']();}else if(_0x53b139[_0x301d('0x15')]===_0x301d('0x1b')&&_0x53b139[_0x301d('0x1c')]&&_0x53b139[_0x301d('0x1c')][_0x301d('0x1d')]&&_0x53b139[_0x301d('0x16')]&&_0x107378[_0x53b139[_0x301d('0x1c')][_0x301d('0x1d')][_0x301d('0x1e')]()]){_0x4e6d86[_0x53b139[_0x301d('0x16')]]=_0x107378[_0x53b139[_0x301d('0x1c')][_0x301d('0x1d')][_0x301d('0x1e')]()][_0x301d('0x18')]();}});}return _0x4e6d86;}function getName(_0x5487ae){if(_0x5487ae['indexOf']('\x20')>0x0){var _0x51d0a5=_0x5487ae['split'](/ (.+)/);if(_0x51d0a5[0x1]){return _0x51d0a5;}}return[_0x5487ae,_0x5487ae];}var accountsTokens={};function getAccessToken(_0x31c94e){return new Promise(function(_0x17ee2a,_0x5948da){if(!_['isNil'](accountsTokens[_0x31c94e['id']])&&!_[_0x301d('0x1f')](accountsTokens[_0x31c94e['id']][_0x301d('0x20')])){if(moment()['isBefore'](accountsTokens[_0x31c94e['id']]['expires_in'])){_0x17ee2a(accountsTokens[_0x31c94e['id']][_0x301d('0x20')]);}}var _0x30569e;switch(_0x31c94e[_0x301d('0x21')]){case'US':_0x30569e=_0x301d('0x22');break;case'AU':_0x30569e='https://accounts.zoho.com.au';break;case'EU':_0x30569e=_0x301d('0x23');break;case'IN':_0x30569e=_0x301d('0x24');break;case'CN':_0x30569e=_0x301d('0x25');break;default:_0x30569e=_0x301d('0x23');break;}var _0x290201={'method':_0x301d('0x26'),'uri':_0x30569e+'/oauth/v2/token','qs':{'refresh_token':_0x31c94e[_0x301d('0x27')],'client_id':_0x31c94e[_0x301d('0x28')],'client_secret':_0x31c94e[_0x301d('0x29')],'grant_type':_0x301d('0x2a')},'json':!![]};return rp(_0x290201)[_0x301d('0x2b')](function(_0x23c934){accountsTokens[_0x31c94e['id']]={'access_token':_0x23c934[_0x301d('0x20')],'expires_in':moment()[_0x301d('0x2c')](_0x23c934['expires_in'],_0x301d('0x2d'))};_0x17ee2a(_0x23c934['access_token']);})['catch'](function(_0x320819){logger['error'](_0x301d('0x2e'),_0x320819[_0x301d('0x2f')]);_0x5948da(_0x320819);});});}function getUser(_0x362c68,_0x46127a,_0xb6a139,_0x5aaa61){logger[_0x301d('0x30')](_0x301d('0x31'));return request({'method':_0x301d('0x32'),'uri':util[_0x301d('0x33')]('https://www.zohoapis.%s/crm/v2/users',_0x46127a),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x362c68},'json':!![]})['then'](function(_0x1cf0bb){if(_0x1cf0bb[_0x301d('0x34')]){var _0x27c3a1=-0x1;if(_[_0x301d('0x35')](_0x1cf0bb[_0x301d('0x34')])){if(!_[_0x301d('0x1f')](_0x5aaa61)){_0x27c3a1=_[_0x301d('0x36')](_0x1cf0bb[_0x301d('0x34')],function(_0x38525f){return _0x38525f[_0x301d('0x37')]===_0x5aaa61;});}if(_0x27c3a1>=0x0){logger['info'](_0x301d('0x38'));}else{logger[_0x301d('0x30')](_0x301d('0x39'));_0x27c3a1=_[_0x301d('0x36')](_0x1cf0bb[_0x301d('0x34')],function(_0x410f0b){return _0x410f0b[_0x301d('0x3a')][_0x301d('0x1d')]===_0x301d('0x3b');});}return _0x1cf0bb[_0x301d('0x34')][_0x27c3a1];}else{if(_0x1cf0bb['user']['profile'][_0x301d('0x1d')]===_0x301d('0x3b')){logger[_0x301d('0x30')](_0x301d('0x39'));user=_0x1cf0bb[_0x301d('0x3c')];return user;}else{logger['error'](_0x301d('0x3d'),JSON[_0x301d('0xf')](_0x1cf0bb));throw new Error(_0x301d('0x3e')+JSON['stringify'](_0x1cf0bb));}}}else{logger[_0x301d('0x3f')]('The\x20failing\x20result\x20is',JSON[_0x301d('0xf')](_0x1cf0bb));throw new Error(_0x301d('0x3e')+JSON[_0x301d('0xf')](_0x1cf0bb));}})[_0x301d('0x40')](function(_0x33e803){console[_0x301d('0x3f')](_0x33e803);});}function getZohoUser(_0x32035b,_0xb0c740){return new BPromise(function(_0x4e7520,_0x114daa){request(_0x32035b)[_0x301d('0x2b')](function(_0x5d6d04){var _0x2e858f=null;if(_0x5d6d04){_0x2e858f=_0x5d6d04[_0x301d('0x41')][0x0];_0x2e858f['enduserType']=_0xb0c740;}_0x4e7520(_0x2e858f);})['catch'](function(_0x5557f8){_0x114daa(_0x5557f8);});});}function createEndUser(_0x26bd3b,_0x5b3056,_0x35047e,_0x368540,_0x30bc21,_0x15a94c){var _0x35047e=getName(_0x35047e);return request({'method':'POST','uri':_0x301d('0x42')+_0x5b3056+'/crm/v2/'+_['startCase'](_0x15a94c[_0x301d('0x43')])+'s','body':{'data':[{'Last_Name':_0x35047e[0x1],'First_Name':_0x35047e[0x0],'Phone':_0x368540,'Owner':{'name':!_['isNil'](_0x30bc21['role'][_0x301d('0x1d')])?_0x30bc21[_0x301d('0x44')][_0x301d('0x1d')]:!_[_0x301d('0x1f')](_0x30bc21[_0x301d('0x45')])?_0x30bc21[_0x301d('0x45')]+'\x20'+_0x30bc21['last_name']:_0x30bc21[_0x301d('0x46')],'id':_0x30bc21['id']}}]},'headers':{'Authorization':_0x301d('0x47')+_0x26bd3b},'json':!![]})[_0x301d('0x2b')](function(_0x411814){if(_0x411814&&_0x411814[_0x301d('0x41')][0x0][_0x301d('0x48')]===_0x301d('0x49')){var _0x5085cf=_0x411814[_0x301d('0x41')][0x0]['details'];_0x5085cf['enduserType']=_[_0x301d('0x4a')](_0x15a94c[_0x301d('0x43')])+'s';return _0x5085cf;}logger['error'](_0x301d('0x3d'),JSON[_0x301d('0xf')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0x301d('0x40')](function(_0x370241){console[_0x301d('0x4b')]('CREATE\x20ERROR',_0x370241);});}function getEndUser(_0x5acb46,_0x33cadd,_0x71c996,_0x42a316,_0x3f4a01,_0x180f3e,_0x5dcd35){var _0x135bf7={'method':_0x301d('0x32'),'uri':'','headers':{'Authorization':_0x301d('0x47')+_0x5acb46},'json':!![]};switch(_0x5dcd35['moduleSearch']){case _0x301d('0x4c'):_0x135bf7[_0x301d('0x4d')]=_0x301d('0x42')+_0x33cadd+_0x301d('0x4e')+_0x3f4a01+'))';return getZohoUser(_0x135bf7,'Contacts')[_0x301d('0x2b')](function(_0x587338){if(_0x587338)return _0x587338;_0x135bf7[_0x301d('0x4d')]='https://www.zohoapis.'+_0x33cadd+_0x301d('0x4f')+_0x3f4a01+'))';return getZohoUser(_0x135bf7,_0x301d('0x50'))[_0x301d('0x2b')](function(_0x155912){if(_0x155912)return _0x155912;if(_0x5dcd35[_0x301d('0x43')]!=_0x301d('0x51')){return createEndUser(_0x5acb46,_0x33cadd,_0x42a316,_0x3f4a01,_0x180f3e,_0x5dcd35);}else{return{};}});});break;case _0x301d('0x52'):_0x135bf7[_0x301d('0x4d')]=_0x301d('0x42')+_0x33cadd+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3f4a01+'))';return getZohoUser(_0x135bf7,_0x301d('0x53'))[_0x301d('0x2b')](function(_0x470ff9){if(_0x470ff9)return _0x470ff9;if(_0x5dcd35[_0x301d('0x43')]!='nothing'){return createEndUser(_0x5acb46,_0x33cadd,_0x42a316,_0x3f4a01,_0x180f3e,_0x5dcd35);}else{return{};}});break;case _0x301d('0x54'):_0x135bf7['uri']='https://www.zohoapis.'+_0x33cadd+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x3f4a01+'))';return getZohoUser(_0x135bf7,_0x301d('0x50'))['then'](function(_0x49a885){if(_0x49a885)return _0x49a885;if(_0x5dcd35[_0x301d('0x43')]!=_0x301d('0x51')){return createEndUser(_0x5acb46,_0x33cadd,_0x42a316,_0x3f4a01,_0x180f3e,_0x5dcd35);}else{return{};}});break;}}function getCall(_0x291384,_0x29cb7b,_0x243cb2,_0x2d4142,_0x2f2d3b,_0x1a6813,_0x46c232,_0x1f2db5){logger[_0x301d('0x30')](_0x301d('0x55'));var _0x2846a7={};_0x2846a7[_0x301d('0x56')]={'name':!_[_0x301d('0x1f')](_0x2d4142[_0x301d('0x44')][_0x301d('0x1d')])&&!_[_0x301d('0x1f')](_0x2d4142['profile'][_0x301d('0x1d')])&&_0x2d4142[_0x301d('0x3a')][_0x301d('0x1d')]===_0x301d('0x57')?_0x2d4142[_0x301d('0x44')][_0x301d('0x1d')]:!_[_0x301d('0x1f')](_0x2d4142['first_name'])?_0x2d4142[_0x301d('0x45')]+'\x20'+_0x2d4142[_0x301d('0x46')]:_0x2d4142['last_name'],'id':_0x2d4142['id']};_0x2846a7[_0x301d('0x58')]=intUtil['getString'](_0x1a6813['Subjects'],_0x46c232,'\x20');_0x2846a7['Description']=intUtil[_0x301d('0x59')](_0x1a6813[_0x301d('0x5a')],_0x46c232,'\x0a');if(_0x2f2d3b[_0x301d('0x5b')]==='Contacts'){_0x2846a7[_0x301d('0x5c')]={'name':!_['isNil'](_0x2f2d3b[_0x301d('0x5d')])?_0x2f2d3b[_0x301d('0x5d')]:!_[_0x301d('0x1f')](_0x2f2d3b[_0x301d('0x5e')])?_0x2f2d3b[_0x301d('0x5e')]+'\x20'+_0x2f2d3b[_0x301d('0x5f')]:_0x2f2d3b['Last_Name'],'id':_0x2f2d3b['id']};}if(_0x2f2d3b[_0x301d('0x5b')]==='Leads'){_0x2846a7[_0x301d('0x60')]={'name':!_[_0x301d('0x1f')](_0x2f2d3b[_0x301d('0x5d')])?_0x2f2d3b['Full_Name']:!_['isNil'](_0x2f2d3b['First_Name'])?_0x2f2d3b[_0x301d('0x5e')]+'\x20'+_0x2f2d3b[_0x301d('0x5f')]:_0x2f2d3b[_0x301d('0x5f')],'id':_0x2f2d3b['id']};_0x2846a7['$se_module']=_[_0x301d('0x4a')](_0x2f2d3b[_0x301d('0x5b')]);}if(_0x46c232[_0x301d('0x61')]){_0x2846a7[_0x301d('0x62')]=moment['utc'](parseInt(_0x46c232[_0x301d('0x61')])*0x3e8)['format'](_0x301d('0x63'));}else if(_0x46c232[_0x301d('0x64')]&&_0x46c232[_0x301d('0x65')]){_0x2846a7['Call_Duration']=moment[_0x301d('0x66')](moment(_0x46c232[_0x301d('0x65')],_0x301d('0x67'))[_0x301d('0x68')](moment(_0x46c232['starttime'],_0x301d('0x67'))))[_0x301d('0x33')](_0x301d('0x63'));}switch(_0x46c232[_0x301d('0x69')]){case _0x301d('0x6a'):_0x2846a7[_0x301d('0x6b')]='Called';break;case _0x301d('0x6c'):case _0x301d('0x6d'):_0x2846a7[_0x301d('0x6b')]='Answered';break;case'rejected':_0x2846a7['Call_Result']=_0x301d('0x6e');break;case _0x301d('0x6f'):_0x2846a7[_0x301d('0x6b')]=_0x301d('0x70');break;case _0x301d('0x71'):_0x2846a7[_0x301d('0x6b')]='Timeout';default:}_0x2846a7['Call_Start_Time']=(_0x1f2db5===_0x301d('0x72')?moment(_0x46c232[_0x301d('0x73')])[_0x301d('0x33')](_0x301d('0x67')):moment(_0x46c232[_0x301d('0x74')])['format'](_0x301d('0x67')))||moment()['format'](_0x301d('0x67'));_0x2846a7['Call_Type']=_0x1f2db5||_0x301d('0x75');_0x2846a7=_['merge'](_0x2846a7,getCustomFields(_0x1a6813[_0x301d('0x76')],_0x46c232));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x29cb7b+_0x301d('0x77'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x291384},'body':{'data':[_0x2846a7]},'json':!![]})[_0x301d('0x2b')](function(_0x2b2ba7){if(_0x2b2ba7&&_0x2b2ba7[_0x301d('0x41')][0x0][_0x301d('0x48')]===_0x301d('0x49')){logger[_0x301d('0x30')]('Call\x20created!');return{'id':_0x2b2ba7[_0x301d('0x41')][0x0][_0x301d('0x78')]['id']};}})[_0x301d('0x40')](function(_0x28718d){logger[_0x301d('0x30')](_0x301d('0x79'),_0x28718d[_0x301d('0x2f')]);console['log'](_0x301d('0x79'),_0x28718d);});}exports[_0x301d('0x7a')]=function(_0x2f4f49,_0x15d09d,_0xe9a40,_0x3bffe9,_0x2557ef,_0x4acf61){var _0x24480f,_0x2845f3,_0x405850;_0x4acf61[_0x301d('0x7b')]=intUtil[_0x301d('0x7c')](_0x4acf61['host']);_0x4acf61[_0x301d('0x7d')]=intUtil['stripTrailingSlash'](_0x4acf61['serverUrl']);if(_0x2557ef&&_0x2557ef[_0x301d('0x7e')]){logger['info'](_0x301d('0x7f'),_0x301d('0x80'));_0x15d09d['recordingURL']=_0x4acf61[_0x301d('0x7d')]+_0x301d('0x81')+_0x15d09d[_0x301d('0x82')]+_0x301d('0x83')+md5(_0x15d09d['uniqueid']);}else{_0x15d09d[_0x301d('0x84')]='';}var _0x1836e6=_0x4acf61['host']===_0x301d('0x85')?'eu':_0x301d('0x86');return getAccessToken(_0x4acf61)[_0x301d('0x2b')](function(_0x1a83d5){_0x405850=_0x1a83d5;return getUser(_0x405850,_0x1836e6,_0x4acf61,_0x3bffe9[_0x301d('0x37')]);})[_0x301d('0x2b')](function(_0x1a7735){_0x24480f=_0x1a7735;logger['info'](_0x301d('0x87'),_0x24480f['id']);return getEndUser(_0x405850,_0x1836e6,_0x4acf61,_0x15d09d[_0x301d('0x88')],_0x15d09d['calleridnum'],_0x24480f,_0xe9a40);})[_0x301d('0x2b')](function(_0x4b3318){_0x2845f3=_0x4b3318;return getCall(_0x405850,_0x1836e6,_0x4acf61,_0x24480f,_0x2845f3,_0xe9a40,_0x15d09d,_0x301d('0x75'));})[_0x301d('0x2b')](function(_0x1fdbbf){if(_0x1fdbbf){logger['info'](_0x301d('0x89'),_0x1fdbbf['id']);logger[_0x301d('0x30')](_0x301d('0x7f'),_0x301d('0x8a'));emit(util[_0x301d('0x33')](_0x301d('0x8b'),_0x3bffe9[_0x301d('0x1d')]),_0x301d('0x8c'),{'uri':_0x301d('0x8d')+_0x4acf61[_0x301d('0x7b')]+_0x301d('0x8e')+_0x1fdbbf['id']});}})[_0x301d('0x40')](function(_0x4d29e7){logger[_0x301d('0x3f')](_0x301d('0x7f'),JSON[_0x301d('0xf')](_0x4d29e7));});};exports[_0x301d('0x72')]=function(_0x99b25d,_0x163e2b,_0x456a37,_0x39eeeb,_0x163ccb,_0x412543,_0x517751){var _0xb8e07d,_0x48af01,_0x1968bc;_0x412543[_0x301d('0x7b')]=intUtil[_0x301d('0x7c')](_0x412543[_0x301d('0x7b')]);_0x412543[_0x301d('0x7d')]=intUtil[_0x301d('0x7c')](_0x412543[_0x301d('0x7d')]);if(_0x517751&&_0x517751[_0x301d('0x8f')]&&_0x517751[_0x301d('0x8f')]!=='none'){logger['info']('[OUTBOUND]',_0x301d('0x80'));_0x163e2b['recordingURL']=_0x412543[_0x301d('0x7d')]+_0x301d('0x81')+_0x163e2b[_0x301d('0x82')]+_0x301d('0x83')+md5(_0x163e2b[_0x301d('0x82')]);}var _0x1fcf00=_0x412543[_0x301d('0x7b')]===_0x301d('0x85')?'eu':_0x301d('0x86');return getAccessToken(_0x412543)[_0x301d('0x2b')](function(_0x50c078){_0x1968bc=_0x50c078;return getUser(_0x1968bc,_0x1fcf00,_0x412543,_0x39eeeb['email']);})[_0x301d('0x2b')](function(_0x53de39){_0xb8e07d=_0x53de39;logger[_0x301d('0x30')](_0x301d('0x87'),_0xb8e07d['id']);return getEndUser(_0x1968bc,_0x1fcf00,_0x412543,_0x163e2b[_0x301d('0x90')],_0x163e2b[_0x301d('0x91')],_0xb8e07d,_0x456a37);})['then'](function(_0x19a2ed){_0x48af01=_0x19a2ed;return getCall(_0x1968bc,_0x1fcf00,_0x412543,_0xb8e07d,_0x48af01,_0x456a37,_0x163e2b,_0x301d('0x92'));})[_0x301d('0x2b')](function(_0x56e0d9){if(_0x56e0d9){logger[_0x301d('0x30')](_0x301d('0x89'),_0x56e0d9['id']);logger[_0x301d('0x30')](_0x301d('0x93'),_0x301d('0x8a'));emit(util[_0x301d('0x33')](_0x301d('0x8b'),_0x39eeeb['name']),_0x301d('0x8c'),{'uri':_0x301d('0x8d')+_0x412543['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x56e0d9['id']});}})['catch'](function(_0x1ed704){logger[_0x301d('0x3f')](_0x301d('0x93'),JSON[_0x301d('0xf')](_0x1ed704));});};exports[_0x301d('0x94')]=function(_0x11452b,_0x3aee86,_0x208b6f,_0x498f44,_0x2ad6c3,_0x13e876){var _0x9b9aeb,_0x369de6,_0x27337b;_0x13e876[_0x301d('0x7b')]=intUtil['stripTrailingSlash'](_0x13e876[_0x301d('0x7b')]);_0x13e876['serverUrl']=intUtil[_0x301d('0x7c')](_0x13e876[_0x301d('0x7d')]);if(_0x2ad6c3&&_0x2ad6c3['monitor_format']){logger[_0x301d('0x30')]('['+_0x3aee86[_0x301d('0x69')]['toUpperCase']()+']',_0x301d('0x80'));_0x3aee86[_0x301d('0x84')]=_0x13e876[_0x301d('0x7d')]+_0x301d('0x81')+_0x3aee86[_0x301d('0x82')]+_0x301d('0x83')+md5(_0x3aee86[_0x301d('0x82')]);}else{_0x3aee86[_0x301d('0x84')]='';}var _0x94d487=_0x13e876[_0x301d('0x7b')]===_0x301d('0x85')?'eu':_0x301d('0x86');return getAccessToken(_0x13e876)['then'](function(_0x438cca){_0x27337b=_0x438cca;return getUser(_0x27337b,_0x94d487,_0x13e876);})[_0x301d('0x2b')](function(_0x34fe9b){_0x9b9aeb=_0x34fe9b;logger['info'](_0x301d('0x87'),_0x9b9aeb['id']);return getEndUser(_0x27337b,_0x94d487,_0x13e876,_0x3aee86['calleridname'],_0x3aee86[_0x301d('0x95')],_0x9b9aeb,_0x208b6f);})[_0x301d('0x2b')](function(_0x14a3ac){_0x369de6=_0x14a3ac;return getCall(_0x27337b,_0x94d487,_0x13e876,_0x9b9aeb,_0x369de6,_0x208b6f,_0x3aee86,'Inbound');})[_0x301d('0x2b')](function(_0x5aadcc){if(_0x5aadcc){logger['info']('The\x20Call\x20ID\x20is:',_0x5aadcc['id']);}})['catch'](function(_0x21d5b9){logger[_0x301d('0x3f')]('['+_0x3aee86[_0x301d('0x69')][_0x301d('0x96')]()+']',JSON[_0x301d('0xf')](_0x21d5b9));});}; \ 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 9c6173d..3fa411e 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 _0x5054=['Script','data3','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','data2'];(function(_0x47c1a2,_0x3fe93d){var _0x2c446e=function(_0x58a714){while(--_0x58a714){_0x47c1a2['push'](_0x47c1a2['shift']());}};_0x2c446e(++_0x3fe93d);}(_0x5054,0x132));var _0x4505=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5054[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x4505('0x0'));var sh=require(_0x4505('0x1'));var Mustache=require(_0x4505('0x2'));var logger=require(_0x4505('0x3'))(_0x4505('0x4'));exports['exec']=function(_0x36d99f,_0x179da2){var _0x45ef2a=_0x36d99f[_0x4505('0x5')]?_0x36d99f[_0x4505('0x5')]:_0x4505('0x6');var _0x27bb08=_0x36d99f[_0x4505('0x7')]?Mustache['render'](_0x36d99f[_0x4505('0x7')],_0x179da2):_0x179da2;sh[_0x4505('0x8')](_0x27bb08,function(_0x57fabc,_0x33796e,_0x3ba0a9){if(_0x57fabc!==0x0){logger[_0x4505('0x9')](util[_0x4505('0xa')](_0x4505('0xb'),_0x45ef2a,_0x27bb08,_0x57fabc,_0x3ba0a9));}else{logger['info'](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x45ef2a,_0x27bb08,_0x33796e));}});}; \ No newline at end of file +var _0xeea9=['data2','Script','data3','render','error','format','info','util','shelljs','mustache','../../../../config/logger','exec'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xeea9,0x17b));var _0x9eea=function(_0xb07424,_0x3093b0){_0xb07424=_0xb07424-0x0;var _0x45e1a2=_0xeea9[_0xb07424];return _0x45e1a2;};'use strict';var util=require(_0x9eea('0x0'));var sh=require(_0x9eea('0x1'));var Mustache=require(_0x9eea('0x2'));var logger=require(_0x9eea('0x3'))('trigger');exports[_0x9eea('0x4')]=function(_0x46ae32,_0x15ce5a){var _0x4de4d0=_0x46ae32[_0x9eea('0x5')]?_0x46ae32[_0x9eea('0x5')]:_0x9eea('0x6');var _0xfe4181=_0x46ae32[_0x9eea('0x7')]?Mustache[_0x9eea('0x8')](_0x46ae32['data3'],_0x15ce5a):_0x15ce5a;sh['exec'](_0xfe4181,function(_0x54a055,_0x4ef462,_0x1f7d94){if(_0x54a055!==0x0){logger[_0x9eea('0x9')](util[_0x9eea('0xa')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x4de4d0,_0xfe4181,_0x54a055,_0x1f7d94));}else{logger[_0x9eea('0xb')](util[_0x9eea('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x4de4d0,_0xfe4181,_0x4ef462));}});}; \ 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 66636fd..cd3b218 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 _0x5e2f=['%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','format','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','toUpperCase','data2','number','data5','headers','parse','render','data6','stack','data1','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify',',\x20request\x20body:\x20','info'];(function(_0x7d4bc3,_0x2aa2c4){var _0x1e1102=function(_0x58615c){while(--_0x58615c){_0x7d4bc3['push'](_0x7d4bc3['shift']());}};_0x1e1102(++_0x2aa2c4);}(_0x5e2f,0x165));var _0xf5e2=function(_0x2a6ab4,_0x361cb5){_0x2a6ab4=_0x2a6ab4-0x0;var _0x41ebd9=_0x5e2f[_0x2a6ab4];return _0x41ebd9;};'use strict';var rp=require(_0xf5e2('0x0'));var util=require(_0xf5e2('0x1'));var _=require(_0xf5e2('0x2'));var Mustache=require(_0xf5e2('0x3'));var logger=require(_0xf5e2('0x4'))(_0xf5e2('0x5'));exports[_0xf5e2('0x6')]=function(_0x29280d,_0x2bc94b){var _0x5cc850,_0x4b63ba;var _0x3d25d2={'method':_0x29280d['data1'][_0xf5e2('0x7')](),'uri':Mustache['render'](_0x29280d[_0xf5e2('0x8')],_0x2bc94b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x29280d['data5'])===_0xf5e2('0x9')&&parseInt(_0x29280d[_0xf5e2('0xa')])>=0x1&&parseInt(_0x29280d[_0xf5e2('0xa')])<=0xa?parseInt(_0x29280d['data5'])*0x3e8:0x5*0x3e8};try{_0x3d25d2[_0xf5e2('0xb')]=_0x29280d['data6']?JSON[_0xf5e2('0xc')](Mustache[_0xf5e2('0xd')](_0x29280d[_0xf5e2('0xe')],_0x2bc94b)):{};}catch(_0x42dde7){logger['error'](_0x42dde7[_0xf5e2('0xf')]);}switch(_0x29280d[_0xf5e2('0x10')][_0xf5e2('0x7')]()){case'GET':case _0xf5e2('0x11'):_0x5cc850=null;_0x3d25d2['qs']=_0x2bc94b;break;case _0xf5e2('0x12'):case _0xf5e2('0x13'):if(_0x29280d[_0xf5e2('0x14')]){try{_0x5cc850=JSON[_0xf5e2('0xc')](Mustache[_0xf5e2('0xd')](_0x29280d['data7'],_0x2bc94b));_0x3d25d2[_0xf5e2('0x15')]=_0x5cc850;}catch(_0x21ab78){logger[_0xf5e2('0x16')](_0x21ab78['stack']);logger[_0xf5e2('0x16')](_0xf5e2('0x17'));}}else{_0x5cc850=_0x2bc94b;_0x3d25d2[_0xf5e2('0x15')]=_0x5cc850;}break;}logger['info'](util['format'](_0xf5e2('0x18'),_0x29280d['data1'],_0x29280d[_0xf5e2('0x8')],JSON[_0xf5e2('0x19')](_0x3d25d2)));rp(_0x3d25d2)['then'](function(_0x3e4def){_0x5cc850=!_['isNil'](_0x5cc850)?_0xf5e2('0x1a')+_0x5cc850:'';_0x4b63ba=typeof _0x3e4def[_0xf5e2('0x15')]==='object'?JSON[_0xf5e2('0x19')](_0x3e4def[_0xf5e2('0x15')]):_0x3e4def[_0xf5e2('0x15')];logger[_0xf5e2('0x1b')](util['format'](_0xf5e2('0x1c'),_0x29280d['data1'],_0x29280d['data2'],_0x3e4def[_0xf5e2('0x1d')],_0x4b63ba));})[_0xf5e2('0x1e')](function(_0x3025fe){logger[_0xf5e2('0x16')](util[_0xf5e2('0x1f')](_0xf5e2('0x20'),_0x29280d[_0xf5e2('0x10')],_0x29280d['data2'],_0x3025fe[_0xf5e2('0x1d')],_0x3025fe[_0xf5e2('0x21')],_0x3025fe[_0xf5e2('0x22')]));});}; \ No newline at end of file +var _0x6cde=['util','mustache','../../../../config/logger','exec','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','error','GET','POST','PUT','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x6cde,0x14a));var _0xe6cd=function(_0x29d610,_0x1b06b6){_0x29d610=_0x29d610-0x0;var _0x4d45ae=_0x6cde[_0x29d610];return _0x4d45ae;};'use strict';var rp=require('request-promise');var util=require(_0xe6cd('0x0'));var _=require('lodash');var Mustache=require(_0xe6cd('0x1'));var logger=require(_0xe6cd('0x2'))('trigger');exports[_0xe6cd('0x3')]=function(_0x324f33,_0x138725){var _0x513beb,_0x2047b9;var _0x24cc4e={'method':_0x324f33[_0xe6cd('0x4')][_0xe6cd('0x5')](),'uri':Mustache[_0xe6cd('0x6')](_0x324f33[_0xe6cd('0x7')],_0x138725),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x324f33[_0xe6cd('0x8')])===_0xe6cd('0x9')&&parseInt(_0x324f33[_0xe6cd('0x8')])>=0x1&&parseInt(_0x324f33[_0xe6cd('0x8')])<=0xa?parseInt(_0x324f33[_0xe6cd('0x8')])*0x3e8:0x5*0x3e8};try{_0x24cc4e[_0xe6cd('0xa')]=_0x324f33[_0xe6cd('0xb')]?JSON[_0xe6cd('0xc')](Mustache['render'](_0x324f33[_0xe6cd('0xb')],_0x138725)):{};}catch(_0x5a541d){logger[_0xe6cd('0xd')](_0x5a541d['stack']);}switch(_0x324f33[_0xe6cd('0x4')]['toUpperCase']()){case _0xe6cd('0xe'):case'DELETE':_0x513beb=null;_0x24cc4e['qs']=_0x138725;break;case _0xe6cd('0xf'):case _0xe6cd('0x10'):if(_0x324f33[_0xe6cd('0x11')]){try{_0x513beb=JSON[_0xe6cd('0xc')](Mustache[_0xe6cd('0x6')](_0x324f33[_0xe6cd('0x11')],_0x138725));_0x24cc4e[_0xe6cd('0x12')]=_0x513beb;}catch(_0x1f2794){logger[_0xe6cd('0xd')](_0x1f2794[_0xe6cd('0x13')]);logger[_0xe6cd('0xd')](_0xe6cd('0x14'));}}else{_0x513beb=_0x138725;_0x24cc4e[_0xe6cd('0x12')]=_0x513beb;}break;}logger[_0xe6cd('0x15')](util[_0xe6cd('0x16')](_0xe6cd('0x17'),_0x324f33[_0xe6cd('0x4')],_0x324f33['data2'],JSON['stringify'](_0x24cc4e)));rp(_0x24cc4e)[_0xe6cd('0x18')](function(_0x153ff4){_0x513beb=!_[_0xe6cd('0x19')](_0x513beb)?',\x20request\x20body:\x20'+_0x513beb:'';_0x2047b9=typeof _0x153ff4['body']===_0xe6cd('0x1a')?JSON['stringify'](_0x153ff4[_0xe6cd('0x12')]):_0x153ff4[_0xe6cd('0x12')];logger[_0xe6cd('0x15')](util['format'](_0xe6cd('0x1b'),_0x324f33[_0xe6cd('0x4')],_0x324f33[_0xe6cd('0x7')],_0x153ff4['statusCode'],_0x2047b9));})['catch'](function(_0x46816f){logger[_0xe6cd('0xd')](util[_0xe6cd('0x16')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x324f33[_0xe6cd('0x4')],_0x324f33['data2'],_0x46816f[_0xe6cd('0x1c')],_0x46816f[_0xe6cd('0x1d')],_0x46816f['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 4f10aed..5736d7e 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 _0x6005=['bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message','result','catch','jayson/promise'];(function(_0x37fa5a,_0x4d2515){var _0x27d579=function(_0x36cb86){while(--_0x36cb86){_0x37fa5a['push'](_0x37fa5a['shift']());}};_0x27d579(++_0x4d2515);}(_0x6005,0x77));var _0x5600=function(_0x2396de,_0x2869e8){_0x2396de=_0x2396de-0x0;var _0x4cb3c3=_0x6005[_0x2396de];return _0x4cb3c3;};'use strict';var jayson=require(_0x5600('0x0'));var BPromise=require(_0x5600('0x1'));var logger=require(_0x5600('0x2'))(_0x5600('0x3'));var client=jayson[_0x5600('0x4')][_0x5600('0x5')]({'port':0x2329});client[_0x5600('0x6')]=function(_0x2a7d0f,_0x2ea443){return new BPromise(function(_0x4d4ae1,_0x55360d){return client[_0x5600('0x7')](_0x2a7d0f,_0x2ea443)[_0x5600('0x8')](function(_0x14cf6f){logger[_0x5600('0x9')](_0x5600('0xa'),_0x5600('0x3'),_0x2a7d0f,_0x2ea443,_0x14cf6f);if(_0x14cf6f[_0x5600('0xb')]){logger[_0x5600('0xb')](_0x5600('0xa'),_0x5600('0x3'),_0x2a7d0f,_0x14cf6f[_0x5600('0xb')][_0x5600('0xc')],_0x2ea443);return _0x55360d(_0x14cf6f[_0x5600('0xb')][_0x5600('0xc')]);}else{return _0x4d4ae1(_0x14cf6f[_0x5600('0xd')]);}})[_0x5600('0xe')](function(_0x355d04){logger[_0x5600('0xb')]('rpc','routing',_0x2a7d0f,_0x355d04,_0x2ea443);return _0x55360d(_0x355d04);});});};module['exports']=client; \ No newline at end of file +var _0x7780=['result','jayson/promise','../../config/logger','client','http','Request','request','then','routing','error','rpc','message'];(function(_0x518d92,_0x5a1d01){var _0x131229=function(_0x216af7){while(--_0x216af7){_0x518d92['push'](_0x518d92['shift']());}};_0x131229(++_0x5a1d01);}(_0x7780,0xa9));var _0x0778=function(_0x2ecb67,_0x8ec62d){_0x2ecb67=_0x2ecb67-0x0;var _0x168079=_0x7780[_0x2ecb67];return _0x168079;};'use strict';var jayson=require(_0x0778('0x0'));var BPromise=require('bluebird');var logger=require(_0x0778('0x1'))('routing');var client=jayson[_0x0778('0x2')][_0x0778('0x3')]({'port':0x2329});client[_0x0778('0x4')]=function(_0xf28319,_0x30b2aa){return new BPromise(function(_0x426dd8,_0x2b460b){return client[_0x0778('0x5')](_0xf28319,_0x30b2aa)[_0x0778('0x6')](function(_0x69778b){logger['debug']('rpc',_0x0778('0x7'),_0xf28319,_0x30b2aa,_0x69778b);if(_0x69778b[_0x0778('0x8')]){logger[_0x0778('0x8')](_0x0778('0x9'),'routing',_0xf28319,_0x69778b[_0x0778('0x8')][_0x0778('0xa')],_0x30b2aa);return _0x2b460b(_0x69778b[_0x0778('0x8')][_0x0778('0xa')]);}else{return _0x426dd8(_0x69778b[_0x0778('0xb')]);}})['catch'](function(_0x2551af){logger[_0x0778('0x8')](_0x0778('0x9'),_0x0778('0x7'),_0xf28319,_0x2551af,_0x30b2aa);return _0x2b460b(_0x2551af);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 447174d..4ffc098 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 _0x41b5=['listen','getSettings','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0x41b5,0x124));var _0x541b=function(_0x44ae48,_0xf6170f){_0x44ae48=_0x44ae48-0x0;var _0x851261=_0x41b5[_0x44ae48];return _0x851261;};'use strict';var BPromise=require(_0x541b('0x0'));var server=require(_0x541b('0x1'));var Realtime=require(_0x541b('0x2'));var EmailChannel=require(_0x541b('0x3'));var mailAccount=require(_0x541b('0x4'));var setting=require(_0x541b('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x541b('0x6')]()[_0x541b('0x7')](mailAccount[_0x541b('0x8')]())[_0x541b('0x7')](realtime[_0x541b('0x9')]())[_0x541b('0x7')](function(){email[_0x541b('0xa')](realtime[_0x541b('0xb')]);return realtime;});}function main(){return server[_0x541b('0xc')](realtime,email)[_0x541b('0x7')](function(){return initRealtime();})['then'](function(){return setting[_0x541b('0xd')]();})['then'](function(_0x53183a){return setInterval(initRealtime,_0x53183a['loginMailFrequency']*0x3e8);})[_0x541b('0xe')](function(_0x145024){console[_0x541b('0xf')](_0x145024);});}main(); \ No newline at end of file +var _0x0acc=['bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','then','getMailAccounts','initMailAccounts','mailAccounts','listen','loginMailFrequency','catch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0acc,0xd0));var _0xc0ac=function(_0x26bdda,_0x3ae7ec){_0x26bdda=_0x26bdda-0x0;var _0x4c4761=_0x0acc[_0x26bdda];return _0x4c4761;};'use strict';var BPromise=require(_0xc0ac('0x0'));var server=require(_0xc0ac('0x1'));var Realtime=require(_0xc0ac('0x2'));var EmailChannel=require(_0xc0ac('0x3'));var mailAccount=require(_0xc0ac('0x4'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xc0ac('0x5')]()[_0xc0ac('0x6')](mailAccount[_0xc0ac('0x7')]())[_0xc0ac('0x6')](realtime[_0xc0ac('0x8')]())[_0xc0ac('0x6')](function(){email['refresh'](realtime[_0xc0ac('0x9')]);return realtime;});}function main(){return server[_0xc0ac('0xa')](realtime,email)[_0xc0ac('0x6')](function(){return initRealtime();})['then'](function(){return setting['getSettings']();})['then'](function(_0x365f54){return setInterval(initRealtime,_0x365f54[_0xc0ac('0xb')]*0x3e8);})[_0xc0ac('0xc')](function(_0x268506){console['log'](_0x268506);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index cd2668b..4141e8c 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 _0x5384=['defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','key','active','status','Imap','messageStatus','total','stringify','emit','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','error','handleImapError','isNil','disabled','connected','messages','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','send','verifySmtp','Smtp','verify','verified','lodash','moment','md5','ioredis','../../../config/logger','email','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5384,0x17a));var _0x4538=function(_0x9d90df,_0x43ff2e){_0x9d90df=_0x9d90df-0x0;var _0x2b5252=_0x5384[_0x9d90df];return _0x2b5252;};'use strict';var _=require(_0x4538('0x0'));var moment=require(_0x4538('0x1'));var BPromise=require('bluebird');var md5=require(_0x4538('0x2'));var Redis=require(_0x4538('0x3'));var config=require('../../../config/environment');var logger=require(_0x4538('0x4'))(_0x4538('0x5'));config[_0x4538('0x6')]=_[_0x4538('0x7')](config[_0x4538('0x6')],{'host':_0x4538('0x8'),'port':0x18eb});var io=require(_0x4538('0x9'))(new Redis(config[_0x4538('0x6')]));var EmailImap=require(_0x4538('0xa'));var EmailSmtp=require(_0x4538('0xb'));var mailAccount=require(_0x4538('0xc'));var md5Accounts={};function EmailChannel(_0x6820c5){logger[_0x4538('0xd')](_0x4538('0xe'));this[_0x4538('0xf')]=_0x6820c5['mailAccounts'];this[_0x4538('0x10')]={};this[_0x4538('0x11')]=new EmailSmtp();}EmailChannel[_0x4538('0x12')]['emit']=function(_0x40f067){var _0x419d0d=this['mailAccounts'][_0x40f067];var _0xabf3ea={'id':_0x419d0d['id'],'name':_0x419d0d['name'],'key':_0x419d0d[_0x4538('0x13')],'active':_0x419d0d[_0x4538('0x14')],'Imap':{'status':_0x419d0d['Imap'][_0x4538('0x15')],'messageStatus':_0x419d0d[_0x4538('0x16')][_0x4538('0x17')],'total':_0x419d0d[_0x4538('0x16')][_0x4538('0x18')]}};if(_['isNil'](md5Accounts[_0x40f067])){md5Accounts[_0x40f067]={};}var _0x337575=md5(JSON[_0x4538('0x19')](_0xabf3ea));if(md5Accounts[_0x40f067][_0x4538('0x2')]!==_0x337575){md5Accounts[_0x40f067]['md5']=_0x337575;io[_0x4538('0x1a')](_0x4538('0x1b'),_0xabf3ea);}};EmailChannel[_0x4538('0x12')][_0x4538('0x1c')]=function(_0x387b1d){for(var _0x5cdfd3 in _0x387b1d){if(_0x387b1d[_0x4538('0x1d')](_0x5cdfd3)){if(_0x387b1d[_0x5cdfd3][_0x4538('0x16')]&&_0x387b1d[_0x5cdfd3][_0x4538('0x14')]){var _0x147b74=_0x387b1d[_0x5cdfd3][_0x4538('0x16')];if(!this['imapAccounts'][_0x4538('0x1d')](_0x147b74['id'])){this[_0x4538('0x10')][_0x147b74['id']]=new EmailImap(_0x147b74,_0x387b1d[_0x5cdfd3][_0x4538('0x5')]);this[_0x4538('0x10')][_0x147b74['id']]['on'](_0x4538('0x1e'),this[_0x4538('0x1f')][_0x4538('0x20')](this,_0x5cdfd3));this[_0x4538('0x10')][_0x147b74['id']]['on'](_0x4538('0x5'),this[_0x4538('0x21')][_0x4538('0x20')](this,_0x5cdfd3));this[_0x4538('0x10')][_0x147b74['id']]['on'](_0x4538('0x22'),this['handleImapEnd']['bind'](this,_0x5cdfd3));this['imapAccounts'][_0x147b74['id']]['on'](_0x4538('0x23'),this[_0x4538('0x24')]['bind'](this,_0x5cdfd3));}}else{if(_[_0x4538('0x25')](this[_0x4538('0xf')][_0x5cdfd3]['Imap'])){this[_0x4538('0xf')][_0x5cdfd3][_0x4538('0x16')]={};}this['mailAccounts'][_0x5cdfd3][_0x4538('0x16')][_0x4538('0x15')]=_0x4538('0x26');this['mailAccounts'][_0x5cdfd3][_0x4538('0x16')][_0x4538('0x17')]='';this[_0x4538('0x1a')](_0x5cdfd3);}}}};EmailChannel[_0x4538('0x12')]['handleImapBox']=function(_0x344f22,_0x46a551){if(this[_0x4538('0xf')][_0x344f22]){this[_0x4538('0xf')][_0x344f22][_0x4538('0x16')][_0x4538('0x15')]=_0x4538('0x27');this[_0x4538('0xf')][_0x344f22][_0x4538('0x16')][_0x4538('0x17')]=_0x46a551['name'];if(_0x46a551[_0x4538('0x28')]){this[_0x4538('0xf')][_0x344f22][_0x4538('0x16')][_0x4538('0x18')]=_0x46a551[_0x4538('0x28')]['total'];}return this[_0x4538('0x1a')](_0x344f22);}};EmailChannel[_0x4538('0x12')]['handleImapEmail']=function(_0x2ecbd5,_0x3d060d){logger[_0x4538('0xd')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x3d060d[_0x4538('0x29')],_0x3d060d['lastName'],_0x3d060d[_0x4538('0x2a')],_0x2ecbd5);if(this[_0x4538('0xf')][_0x2ecbd5]){return mailAccount[_0x4538('0x2b')](_0x2ecbd5,_0x3d060d)[_0x4538('0x2c')](function(_0x4304d0){if(_0x4304d0){logger[_0x4538('0xd')](_0x4538('0x2d'));}})[_0x4538('0x2e')](function(_0x28fb08){logger[_0x4538('0x23')](_0x4538('0x2f'),JSON[_0x4538('0x19')](_0x28fb08));});}};EmailChannel[_0x4538('0x12')][_0x4538('0x30')]=function(_0x2bd366){if(this[_0x4538('0xf')][_0x2bd366]&&this[_0x4538('0xf')][_0x2bd366]['Imap']){if(this['imapAccounts'][this[_0x4538('0xf')][_0x2bd366]['Imap']['id']]){delete this[_0x4538('0x10')][this[_0x4538('0xf')][_0x2bd366]['Imap']['id']];}this[_0x4538('0xf')][_0x2bd366][_0x4538('0x16')][_0x4538('0x31')]=moment();this[_0x4538('0x1a')](_0x2bd366);}};EmailChannel[_0x4538('0x12')][_0x4538('0x24')]=function(_0x993d4f,_0x31bb10){if(this[_0x4538('0xf')][_0x993d4f]){this['mailAccounts'][_0x993d4f][_0x4538('0x16')][_0x4538('0x15')]=_0x4538('0x23');this[_0x4538('0xf')][_0x993d4f][_0x4538('0x16')][_0x4538('0x17')]=_0x31bb10;return this[_0x4538('0x1a')](_0x993d4f);}};EmailChannel[_0x4538('0x12')]['sendMail']=function(_0x5a95b9,_0x30af2f){return this[_0x4538('0x11')][_0x4538('0x32')](_0x5a95b9,_0x30af2f);};EmailChannel[_0x4538('0x12')][_0x4538('0x33')]=function(_0x477b67){var _0x3492e2=this;if(this[_0x4538('0xf')][_0x477b67['id']]){if(_[_0x4538('0x25')](this[_0x4538('0xf')][_0x477b67['id']][_0x4538('0x34')])){this[_0x4538('0xf')][_0x477b67['id']]['Smtp']={};}this[_0x4538('0xf')][_0x477b67['id']][_0x4538('0x34')][_0x4538('0x31')]=moment();return new BPromise(function(_0x5bae81,_0x37bf0a){return _0x3492e2[_0x4538('0x11')][_0x4538('0x35')](_0x477b67)[_0x4538('0x2c')](function(_0x312d88){_0x3492e2[_0x4538('0xf')][_0x477b67['id']][_0x4538('0x34')][_0x4538('0x15')]=_0x4538('0x36');_0x3492e2['mailAccounts'][_0x477b67['id']][_0x4538('0x34')]['messageStatus']='';_0x3492e2[_0x4538('0x1a')](_0x477b67['id']);_0x5bae81(_0x312d88);})['catch'](function(_0x3cdf70){_0x3492e2[_0x4538('0xf')][_0x477b67['id']]['Smtp'][_0x4538('0x15')]=_0x4538('0x23');_0x3492e2[_0x4538('0xf')][_0x477b67['id']][_0x4538('0x34')][_0x4538('0x17')]=_0x3cdf70;_0x3492e2[_0x4538('0x1a')](_0x477b67['id']);_0x37bf0a(_0x3cdf70);});});}return this[_0x4538('0x11')]['verify'](_0x477b67);};module['exports']=EmailChannel; \ No newline at end of file +var _0x165b=['ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','smtp','emit','name','key','Imap','status','messageStatus','total','mailAccount:update','refresh','hasOwnProperty','active','imapAccounts','email','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','isNil','disabled','prototype','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','error','sendMail','send','verifySmtp','Smtp','lastSync','verify','verified','exports','lodash','moment','bluebird','md5'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x165b,0x1dc));var _0xb165=function(_0x40b4f1,_0x4c6c29){_0x40b4f1=_0x40b4f1-0x0;var _0x193304=_0x165b[_0x40b4f1];return _0x193304;};'use strict';var _=require(_0xb165('0x0'));var moment=require(_0xb165('0x1'));var BPromise=require(_0xb165('0x2'));var md5=require(_0xb165('0x3'));var Redis=require(_0xb165('0x4'));var config=require(_0xb165('0x5'));var logger=require(_0xb165('0x6'))('email');config[_0xb165('0x7')]=_[_0xb165('0x8')](config['redis'],{'host':_0xb165('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb165('0x7')]));var EmailImap=require(_0xb165('0xa'));var EmailSmtp=require(_0xb165('0xb'));var mailAccount=require(_0xb165('0xc'));var md5Accounts={};function EmailChannel(_0x391d6f){logger[_0xb165('0xd')](_0xb165('0xe'));this[_0xb165('0xf')]=_0x391d6f[_0xb165('0xf')];this['imapAccounts']={};this[_0xb165('0x10')]=new EmailSmtp();}EmailChannel['prototype'][_0xb165('0x11')]=function(_0x3b0221){var _0x4220fe=this[_0xb165('0xf')][_0x3b0221];var _0x4d0602={'id':_0x4220fe['id'],'name':_0x4220fe[_0xb165('0x12')],'key':_0x4220fe[_0xb165('0x13')],'active':_0x4220fe['active'],'Imap':{'status':_0x4220fe[_0xb165('0x14')][_0xb165('0x15')],'messageStatus':_0x4220fe[_0xb165('0x14')][_0xb165('0x16')],'total':_0x4220fe['Imap'][_0xb165('0x17')]}};if(_['isNil'](md5Accounts[_0x3b0221])){md5Accounts[_0x3b0221]={};}var _0x3717e7=md5(JSON['stringify'](_0x4d0602));if(md5Accounts[_0x3b0221][_0xb165('0x3')]!==_0x3717e7){md5Accounts[_0x3b0221]['md5']=_0x3717e7;io[_0xb165('0x11')](_0xb165('0x18'),_0x4d0602);}};EmailChannel['prototype'][_0xb165('0x19')]=function(_0x50f33f){for(var _0x50c479 in _0x50f33f){if(_0x50f33f[_0xb165('0x1a')](_0x50c479)){if(_0x50f33f[_0x50c479][_0xb165('0x14')]&&_0x50f33f[_0x50c479][_0xb165('0x1b')]){var _0x25e03a=_0x50f33f[_0x50c479]['Imap'];if(!this[_0xb165('0x1c')][_0xb165('0x1a')](_0x25e03a['id'])){this[_0xb165('0x1c')][_0x25e03a['id']]=new EmailImap(_0x25e03a,_0x50f33f[_0x50c479][_0xb165('0x1d')]);this[_0xb165('0x1c')][_0x25e03a['id']]['on'](_0xb165('0x1e'),this[_0xb165('0x1f')][_0xb165('0x20')](this,_0x50c479));this[_0xb165('0x1c')][_0x25e03a['id']]['on'](_0xb165('0x1d'),this[_0xb165('0x21')][_0xb165('0x20')](this,_0x50c479));this['imapAccounts'][_0x25e03a['id']]['on'](_0xb165('0x22'),this[_0xb165('0x23')][_0xb165('0x20')](this,_0x50c479));this[_0xb165('0x1c')][_0x25e03a['id']]['on']('error',this['handleImapError'][_0xb165('0x20')](this,_0x50c479));}}else{if(_[_0xb165('0x24')](this[_0xb165('0xf')][_0x50c479][_0xb165('0x14')])){this[_0xb165('0xf')][_0x50c479][_0xb165('0x14')]={};}this[_0xb165('0xf')][_0x50c479][_0xb165('0x14')][_0xb165('0x15')]=_0xb165('0x25');this[_0xb165('0xf')][_0x50c479]['Imap']['messageStatus']='';this[_0xb165('0x11')](_0x50c479);}}}};EmailChannel[_0xb165('0x26')][_0xb165('0x1f')]=function(_0x1829af,_0x1be863){if(this[_0xb165('0xf')][_0x1829af]){this[_0xb165('0xf')][_0x1829af][_0xb165('0x14')][_0xb165('0x15')]=_0xb165('0x27');this[_0xb165('0xf')][_0x1829af][_0xb165('0x14')][_0xb165('0x16')]=_0x1be863[_0xb165('0x12')];if(_0x1be863[_0xb165('0x28')]){this[_0xb165('0xf')][_0x1829af][_0xb165('0x14')][_0xb165('0x17')]=_0x1be863['messages'][_0xb165('0x17')];}return this[_0xb165('0x11')](_0x1829af);}};EmailChannel[_0xb165('0x26')][_0xb165('0x21')]=function(_0x18641c,_0x3c59a7){logger[_0xb165('0xd')](_0xb165('0x29'),_0x3c59a7[_0xb165('0x2a')],_0x3c59a7[_0xb165('0x2b')],_0x3c59a7[_0xb165('0x2c')],_0x18641c);if(this[_0xb165('0xf')][_0x18641c]){return mailAccount[_0xb165('0x2d')](_0x18641c,_0x3c59a7)[_0xb165('0x2e')](function(_0x2fd7e3){if(_0x2fd7e3){logger[_0xb165('0xd')](_0xb165('0x2f'));}})[_0xb165('0x30')](function(_0xedab38){logger['error'](_0xb165('0x31'),JSON[_0xb165('0x32')](_0xedab38));});}};EmailChannel[_0xb165('0x26')][_0xb165('0x23')]=function(_0x412169){if(this[_0xb165('0xf')][_0x412169]&&this[_0xb165('0xf')][_0x412169]['Imap']){if(this['imapAccounts'][this[_0xb165('0xf')][_0x412169][_0xb165('0x14')]['id']]){delete this['imapAccounts'][this[_0xb165('0xf')][_0x412169][_0xb165('0x14')]['id']];}this['mailAccounts'][_0x412169][_0xb165('0x14')]['lastSync']=moment();this[_0xb165('0x11')](_0x412169);}};EmailChannel['prototype']['handleImapError']=function(_0x2ee3bd,_0x1ba762){if(this[_0xb165('0xf')][_0x2ee3bd]){this[_0xb165('0xf')][_0x2ee3bd]['Imap']['status']=_0xb165('0x33');this[_0xb165('0xf')][_0x2ee3bd][_0xb165('0x14')][_0xb165('0x16')]=_0x1ba762;return this[_0xb165('0x11')](_0x2ee3bd);}};EmailChannel[_0xb165('0x26')][_0xb165('0x34')]=function(_0x5d53ee,_0x305859){return this['smtp'][_0xb165('0x35')](_0x5d53ee,_0x305859);};EmailChannel[_0xb165('0x26')][_0xb165('0x36')]=function(_0x12d70a){var _0xd4202=this;if(this['mailAccounts'][_0x12d70a['id']]){if(_[_0xb165('0x24')](this[_0xb165('0xf')][_0x12d70a['id']][_0xb165('0x37')])){this[_0xb165('0xf')][_0x12d70a['id']][_0xb165('0x37')]={};}this[_0xb165('0xf')][_0x12d70a['id']][_0xb165('0x37')][_0xb165('0x38')]=moment();return new BPromise(function(_0x5ec443,_0x75d2ef){return _0xd4202[_0xb165('0x10')][_0xb165('0x39')](_0x12d70a)[_0xb165('0x2e')](function(_0x20a122){_0xd4202[_0xb165('0xf')][_0x12d70a['id']]['Smtp']['status']=_0xb165('0x3a');_0xd4202['mailAccounts'][_0x12d70a['id']][_0xb165('0x37')][_0xb165('0x16')]='';_0xd4202[_0xb165('0x11')](_0x12d70a['id']);_0x5ec443(_0x20a122);})['catch'](function(_0x17820d){_0xd4202[_0xb165('0xf')][_0x12d70a['id']][_0xb165('0x37')][_0xb165('0x15')]='error';_0xd4202['mailAccounts'][_0x12d70a['id']]['Smtp']['messageStatus']=_0x17820d;_0xd4202[_0xb165('0x11')](_0x12d70a['id']);_0x75d2ef(_0x17820d);});});}return this['smtp'][_0xb165('0x39')](_0x12d70a);};module[_0xb165('0x3b')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index d65918e..7bc8a05 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 _0x5da8=['ready','handleReady','bind','end','handleEnd','error','connect','inherits','prototype','getAccount','connTimeout','authTimeout','authentication','user','password','host','port','tls','required','service','anonymous@xcally.com','openBox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchError','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','stringify','textCode','upperFirst','path','imap','lodash','randomstring','mailparser','simpleParser','events','EventEmitter','email','mailbox','INBOX','account','once'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x5da8,0x1cb));var _0x85da=function(_0x3150d6,_0xc13a4){_0x3150d6=_0x3150d6-0x0;var _0x4f78c5=_0x5da8[_0x3150d6];return _0x4f78c5;};'use strict';var fs=require('fs');var path=require(_0x85da('0x0'));var util=require('util');var Imap=require(_0x85da('0x1'));var _=require(_0x85da('0x2'));var rs=require(_0x85da('0x3'));var simpleParser=require(_0x85da('0x4'))[_0x85da('0x5')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require(_0x85da('0x6'))[_0x85da('0x7')];var utils=require('./utils');var logger=require('../../../config/logger')(_0x85da('0x8'));function EmailImap(_0x21bd0b,_0x26b423){this[_0x85da('0x9')]=_0x85da('0xa');this[_0x85da('0xb')]=this['getAccount'](_0x21bd0b,_0x26b423);this[_0x85da('0x1')]=new Imap(this[_0x85da('0xb')]);this['imap'][_0x85da('0xc')](_0x85da('0xd'),this[_0x85da('0xe')][_0x85da('0xf')](this));this['imap'][_0x85da('0xc')](_0x85da('0x10'),this[_0x85da('0x11')][_0x85da('0xf')](this));this[_0x85da('0x1')]['on'](_0x85da('0x12'),this['handleError'][_0x85da('0xf')](this));this[_0x85da('0x1')][_0x85da('0x13')]();}util[_0x85da('0x14')](EmailImap,EventEmitter);EmailImap[_0x85da('0x15')][_0x85da('0x16')]=function(_0x1992c9,_0x38f25a){var _0x29254b={'connTimeout':_0x1992c9[_0x85da('0x17')]?_0x1992c9[_0x85da('0x17')]*0x3e8:0x2710,'authTimeout':_0x1992c9[_0x85da('0x18')]?_0x1992c9[_0x85da('0x18')]*0x3e8:0x1388};if(_['isNil'](_0x1992c9['service'])){if(_0x1992c9[_0x85da('0x19')]){_0x29254b['user']=_0x1992c9[_0x85da('0x1a')];_0x29254b['password']=_0x1992c9[_0x85da('0x1b')];}_0x29254b[_0x85da('0x1c')]=_0x1992c9[_0x85da('0x1c')];_0x29254b[_0x85da('0x1d')]=_0x1992c9['port']||0x3e1;if(_0x1992c9[_0x85da('0x1e')]){_0x29254b[_0x85da('0x1e')]=!![];}else{_0x29254b[_0x85da('0x1e')]=![];_0x29254b['autotls']=_0x85da('0x1f');}}else{_0x29254b[_0x85da('0x1a')]=_0x1992c9[_0x85da('0x1a')];_0x29254b[_0x85da('0x1b')]=_0x1992c9[_0x85da('0x1b')];_0x29254b[_0x85da('0x1c')]=utils['getHost'](_0x1992c9[_0x85da('0x20')]);_0x29254b[_0x85da('0x1d')]=0x3e1;_0x29254b[_0x85da('0x1e')]=!![];}_0x29254b[_0x85da('0x8')]=_0x38f25a||_0x1992c9['user']||_0x85da('0x21');return _0x29254b;};EmailImap[_0x85da('0x15')]['handleReady']=function(){this[_0x85da('0x1')][_0x85da('0x22')](this[_0x85da('0x9')],![],this[_0x85da('0x23')]['bind'](this));};EmailImap['prototype'][_0x85da('0x23')]=function(_0x39cec5,_0x3e5f7e){if(_0x39cec5){this[_0x85da('0x24')](_0x39cec5,!![]);}else{this[_0x85da('0x25')](_0x85da('0x26'),_0x3e5f7e);this[_0x85da('0x27')]();}};EmailImap[_0x85da('0x15')][_0x85da('0x28')]=function(_0x262eac){if(_0x262eac){this[_0x85da('0x24')](_0x262eac,!![]);}else{this[_0x85da('0x1')][_0x85da('0x10')]();}};EmailImap['prototype']['readUnseen']=function(){this['imap']['search']([_0x85da('0x29')],this['handleReadUnseen']['bind'](this));};EmailImap[_0x85da('0x15')][_0x85da('0x2a')]=function(_0xda6396,_0x4f7ccf){if(_0xda6396){this[_0x85da('0x24')](_0xda6396,!![]);}else{if(_0x4f7ccf[_0x85da('0x2b')]){try{var _0x13edae=this[_0x85da('0x1')][_0x85da('0x2c')](_0x4f7ccf,{'bodies':'','markSeen':!![]});_0x13edae['on'](_0x85da('0x2d'),this['handleFetchMessage'][_0x85da('0xf')](this));_0x13edae[_0x85da('0xc')](_0x85da('0x12'),this[_0x85da('0x2e')][_0x85da('0xf')](this));_0x13edae[_0x85da('0xc')]('end',this['handleFetchEnd'][_0x85da('0xf')](this));}catch(_0x5e4f01){logger[_0x85da('0x12')](_0x5e4f01);}}else{this[_0x85da('0x1')]['closeBox'](!![],this[_0x85da('0x28')][_0x85da('0xf')](this));}}};EmailImap['prototype'][_0x85da('0x2f')]=function(_0x117002,_0x320492){_0x117002['on'](_0x85da('0x30'),this[_0x85da('0x31')]['bind'](this));_0x117002[_0x85da('0xc')](_0x85da('0x32'),this[_0x85da('0x33')][_0x85da('0xf')](this));_0x117002['once'](_0x85da('0x10'),this[_0x85da('0x34')]['bind'](this));};EmailImap[_0x85da('0x15')][_0x85da('0x31')]=function(_0x2dcc83,_0x158e70){simpleParser(_0x2dcc83,{'Iconv':Iconv},this[_0x85da('0x35')][_0x85da('0xf')](this));};EmailImap['prototype'][_0x85da('0x33')]=function(_0xe10ddb){};EmailImap[_0x85da('0x15')][_0x85da('0x34')]=function(){};EmailImap[_0x85da('0x15')][_0x85da('0x35')]=function(_0x22f4be,_0x308ff7){if(_0x22f4be){logger[_0x85da('0x12')](_0x22f4be);}else{var _0x14b241=this;utils[_0x85da('0x36')](this[_0x85da('0xb')],_0x308ff7,function(_0x438637){_0x14b241[_0x85da('0x25')](_0x85da('0x8'),_0x438637);});}};EmailImap[_0x85da('0x15')][_0x85da('0x37')]=function(){this[_0x85da('0x1')]['closeBox'](!![],this[_0x85da('0x28')]['bind'](this));};EmailImap[_0x85da('0x15')]['handleFetchError']=function(_0x1305df){this[_0x85da('0x24')](_0x1305df);this[_0x85da('0x1')]['closeBox'](!![],this['handleCloseBox'][_0x85da('0xf')](this));};EmailImap['prototype'][_0x85da('0x11')]=function(){this[_0x85da('0x25')](_0x85da('0x10'));};EmailImap['prototype'][_0x85da('0x24')]=function(_0x589617,_0x24ab49){logger['error'](_0x85da('0x24'),this[_0x85da('0xb')][_0x85da('0x8')],JSON[_0x85da('0x38')](_0x589617));var _0x223522='';if(_0x589617){if(_0x589617[_0x85da('0x39')]){_0x223522=_0x589617[_0x85da('0x39')];}else{for(var _0x47079f in _0x589617){if(_0x589617['hasOwnProperty'](_0x47079f)){_0x223522+=_[_0x85da('0x3a')](_0x47079f)+':\x20'+_0x589617[_0x47079f]+'\x0a';}}}}if(_0x24ab49){this['imap'][_0x85da('0x10')]();}else{this[_0x85da('0x25')](_0x85da('0x12'),_0x223522);this[_0x85da('0x25')](_0x85da('0x10'));}};module['exports']=EmailImap; \ No newline at end of file +var _0xb252=['lodash','randomstring','mailparser','simpleParser','iconv','events','./utils','email','mailbox','INBOX','account','ready','handleReady','bind','once','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','length','fetch','message','handleFetchError','end','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xb252,0x13d));var _0x2b25=function(_0x2cac3b,_0x5c7a98){_0x2cac3b=_0x2cac3b-0x0;var _0x54d375=_0xb252[_0x2cac3b];return _0x54d375;};'use strict';var fs=require('fs');var path=require(_0x2b25('0x0'));var util=require(_0x2b25('0x1'));var Imap=require(_0x2b25('0x2'));var _=require(_0x2b25('0x3'));var rs=require(_0x2b25('0x4'));var simpleParser=require(_0x2b25('0x5'))[_0x2b25('0x6')];var Iconv=require(_0x2b25('0x7'))['Iconv'];var EventEmitter=require(_0x2b25('0x8'))['EventEmitter'];var utils=require(_0x2b25('0x9'));var logger=require('../../../config/logger')(_0x2b25('0xa'));function EmailImap(_0x265bb3,_0x2ac9d3){this[_0x2b25('0xb')]=_0x2b25('0xc');this[_0x2b25('0xd')]=this['getAccount'](_0x265bb3,_0x2ac9d3);this[_0x2b25('0x2')]=new Imap(this[_0x2b25('0xd')]);this['imap']['once'](_0x2b25('0xe'),this[_0x2b25('0xf')][_0x2b25('0x10')](this));this[_0x2b25('0x2')][_0x2b25('0x11')]('end',this[_0x2b25('0x12')][_0x2b25('0x10')](this));this['imap']['on'](_0x2b25('0x13'),this[_0x2b25('0x14')][_0x2b25('0x10')](this));this[_0x2b25('0x2')][_0x2b25('0x15')]();}util[_0x2b25('0x16')](EmailImap,EventEmitter);EmailImap[_0x2b25('0x17')]['getAccount']=function(_0x44bc15,_0x3a98ed){var _0x2292c3={'connTimeout':_0x44bc15[_0x2b25('0x18')]?_0x44bc15[_0x2b25('0x18')]*0x3e8:0x2710,'authTimeout':_0x44bc15[_0x2b25('0x19')]?_0x44bc15[_0x2b25('0x19')]*0x3e8:0x1388};if(_[_0x2b25('0x1a')](_0x44bc15[_0x2b25('0x1b')])){if(_0x44bc15[_0x2b25('0x1c')]){_0x2292c3[_0x2b25('0x1d')]=_0x44bc15[_0x2b25('0x1d')];_0x2292c3[_0x2b25('0x1e')]=_0x44bc15[_0x2b25('0x1e')];}_0x2292c3[_0x2b25('0x1f')]=_0x44bc15[_0x2b25('0x1f')];_0x2292c3['port']=_0x44bc15[_0x2b25('0x20')]||0x3e1;if(_0x44bc15[_0x2b25('0x21')]){_0x2292c3['tls']=!![];}else{_0x2292c3[_0x2b25('0x21')]=![];_0x2292c3[_0x2b25('0x22')]='required';}}else{_0x2292c3[_0x2b25('0x1d')]=_0x44bc15[_0x2b25('0x1d')];_0x2292c3[_0x2b25('0x1e')]=_0x44bc15['password'];_0x2292c3[_0x2b25('0x1f')]=utils['getHost'](_0x44bc15[_0x2b25('0x1b')]);_0x2292c3[_0x2b25('0x20')]=0x3e1;_0x2292c3[_0x2b25('0x21')]=!![];}_0x2292c3['email']=_0x3a98ed||_0x44bc15[_0x2b25('0x1d')]||_0x2b25('0x23');return _0x2292c3;};EmailImap[_0x2b25('0x17')][_0x2b25('0xf')]=function(){this['imap'][_0x2b25('0x24')](this[_0x2b25('0xb')],![],this[_0x2b25('0x25')]['bind'](this));};EmailImap[_0x2b25('0x17')]['handleOpenBox']=function(_0x9837ec,_0x170978){if(_0x9837ec){this['handleError'](_0x9837ec,!![]);}else{this[_0x2b25('0x26')](_0x2b25('0x27'),_0x170978);this[_0x2b25('0x28')]();}};EmailImap['prototype'][_0x2b25('0x29')]=function(_0x24c85b){if(_0x24c85b){this[_0x2b25('0x14')](_0x24c85b,!![]);}else{this[_0x2b25('0x2')]['end']();}};EmailImap['prototype'][_0x2b25('0x28')]=function(){this[_0x2b25('0x2')][_0x2b25('0x2a')](['UNSEEN'],this[_0x2b25('0x2b')][_0x2b25('0x10')](this));};EmailImap[_0x2b25('0x17')][_0x2b25('0x2b')]=function(_0x1c98d0,_0x39cb76){if(_0x1c98d0){this[_0x2b25('0x14')](_0x1c98d0,!![]);}else{if(_0x39cb76[_0x2b25('0x2c')]){try{var _0xcf96aa=this[_0x2b25('0x2')][_0x2b25('0x2d')](_0x39cb76,{'bodies':'','markSeen':!![]});_0xcf96aa['on'](_0x2b25('0x2e'),this['handleFetchMessage'][_0x2b25('0x10')](this));_0xcf96aa[_0x2b25('0x11')](_0x2b25('0x13'),this[_0x2b25('0x2f')][_0x2b25('0x10')](this));_0xcf96aa['once'](_0x2b25('0x30'),this['handleFetchEnd'][_0x2b25('0x10')](this));}catch(_0x334d8b){logger[_0x2b25('0x13')](_0x334d8b);}}else{this['imap'][_0x2b25('0x31')](!![],this[_0x2b25('0x29')][_0x2b25('0x10')](this));}}};EmailImap[_0x2b25('0x17')][_0x2b25('0x32')]=function(_0x17213d,_0x2559b8){_0x17213d['on'](_0x2b25('0x33'),this[_0x2b25('0x34')]['bind'](this));_0x17213d[_0x2b25('0x11')](_0x2b25('0x35'),this[_0x2b25('0x36')][_0x2b25('0x10')](this));_0x17213d[_0x2b25('0x11')](_0x2b25('0x30'),this[_0x2b25('0x37')]['bind'](this));};EmailImap[_0x2b25('0x17')][_0x2b25('0x34')]=function(_0x5bcb5b,_0x4fd8bc){simpleParser(_0x5bcb5b,{'Iconv':Iconv},this[_0x2b25('0x38')][_0x2b25('0x10')](this));};EmailImap['prototype'][_0x2b25('0x36')]=function(_0x323fa0){};EmailImap[_0x2b25('0x17')]['handleMessageEnd']=function(){};EmailImap[_0x2b25('0x17')][_0x2b25('0x38')]=function(_0x3cd95e,_0x94b7ea){if(_0x3cd95e){logger[_0x2b25('0x13')](_0x3cd95e);}else{var _0x5c9540=this;utils[_0x2b25('0x39')](this['account'],_0x94b7ea,function(_0x1acb34){_0x5c9540[_0x2b25('0x26')](_0x2b25('0xa'),_0x1acb34);});}};EmailImap['prototype'][_0x2b25('0x3a')]=function(){this[_0x2b25('0x2')][_0x2b25('0x31')](!![],this[_0x2b25('0x29')][_0x2b25('0x10')](this));};EmailImap[_0x2b25('0x17')][_0x2b25('0x2f')]=function(_0x3cacec){this[_0x2b25('0x14')](_0x3cacec);this[_0x2b25('0x2')]['closeBox'](!![],this[_0x2b25('0x29')][_0x2b25('0x10')](this));};EmailImap[_0x2b25('0x17')][_0x2b25('0x12')]=function(){this[_0x2b25('0x26')](_0x2b25('0x30'));};EmailImap[_0x2b25('0x17')]['handleError']=function(_0x271ebd,_0x1262a2){logger[_0x2b25('0x13')](_0x2b25('0x14'),this['account'][_0x2b25('0xa')],JSON[_0x2b25('0x3b')](_0x271ebd));var _0x15731b='';if(_0x271ebd){if(_0x271ebd[_0x2b25('0x3c')]){_0x15731b=_0x271ebd[_0x2b25('0x3c')];}else{for(var _0x451ab9 in _0x271ebd){if(_0x271ebd[_0x2b25('0x3d')](_0x451ab9)){_0x15731b+=_[_0x2b25('0x3e')](_0x451ab9)+':\x20'+_0x271ebd[_0x451ab9]+'\x0a';}}}}if(_0x1262a2){this[_0x2b25('0x2')][_0x2b25('0x30')]();}else{this[_0x2b25('0x26')](_0x2b25('0x13'),_0x15731b);this[_0x2b25('0x26')](_0x2b25('0x30'));}};module[_0x2b25('0x3f')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 091c9a2..56c1e7f 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 _0x607e=['Not\x20verifired','exports','nodemailer','bluebird','send','createTransport','use','compile','sendMail','toString','prototype','verify'];(function(_0x46f62c,_0x49eb41){var _0x46d994=function(_0x225d69){while(--_0x225d69){_0x46f62c['push'](_0x46f62c['shift']());}};_0x46d994(++_0x49eb41);}(_0x607e,0xce));var _0xe607=function(_0x522d8b,_0x21f430){_0x522d8b=_0x522d8b-0x0;var _0x5e0c73=_0x607e[_0x522d8b];return _0x5e0c73;};'use strict';var nodemailer=require(_0xe607('0x0'));var BPromise=require(_0xe607('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0xe607('0x2')]=function(_0x4a64d2,_0x370c21){return new BPromise(function(_0x119745,_0x575107){var _0x30e590=nodemailer[_0xe607('0x3')](_0x4a64d2);_0x30e590[_0xe607('0x4')](_0xe607('0x5'),inlineBase64());_0x30e590[_0xe607('0x6')](_0x370c21,function(_0x28ac90,_0x1512cb){if(_0x28ac90){_0x575107(_0x28ac90[_0xe607('0x7')]());}else{_0x119745(_0x1512cb);}});});};EmailSmtp[_0xe607('0x8')][_0xe607('0x9')]=function(_0x316705){return new BPromise(function(_0x18b616,_0x5d6bc4){var _0x44e718=nodemailer[_0xe607('0x3')](_0x316705);_0x44e718[_0xe607('0x9')](function(_0x2446e8,_0x426f93){if(_0x2446e8){_0x5d6bc4(_0x2446e8[_0xe607('0x7')]());}else{if(_0x426f93){_0x18b616(_0x426f93);}else{_0x5d6bc4(_0xe607('0xa'));}}});});};module[_0xe607('0xb')]=EmailSmtp; \ No newline at end of file +var _0xbe83=['verify','Not\x20verifired','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString'];(function(_0x2776db,_0xfb2eda){var _0x572930=function(_0x5e1032){while(--_0x5e1032){_0x2776db['push'](_0x2776db['shift']());}};_0x572930(++_0xfb2eda);}(_0xbe83,0x12e));var _0x3be8=function(_0x446631,_0x1f5241){_0x446631=_0x446631-0x0;var _0x12e335=_0xbe83[_0x446631];return _0x12e335;};'use strict';var nodemailer=require(_0x3be8('0x0'));var BPromise=require(_0x3be8('0x1'));var inlineBase64=require(_0x3be8('0x2'));function EmailSmtp(){}EmailSmtp[_0x3be8('0x3')][_0x3be8('0x4')]=function(_0x16098e,_0x492434){return new BPromise(function(_0x387878,_0x5addc6){var _0x39ebe1=nodemailer[_0x3be8('0x5')](_0x16098e);_0x39ebe1[_0x3be8('0x6')](_0x3be8('0x7'),inlineBase64());_0x39ebe1[_0x3be8('0x8')](_0x492434,function(_0x1c5c3a,_0x3042c7){if(_0x1c5c3a){_0x5addc6(_0x1c5c3a[_0x3be8('0x9')]());}else{_0x387878(_0x3042c7);}});});};EmailSmtp[_0x3be8('0x3')][_0x3be8('0xa')]=function(_0x37410d){return new BPromise(function(_0x2ae50d,_0x4aca07){var _0x5896b7=nodemailer[_0x3be8('0x5')](_0x37410d);_0x5896b7[_0x3be8('0xa')](function(_0x3db6a1,_0x537edb){if(_0x3db6a1){_0x4aca07(_0x3db6a1[_0x3be8('0x9')]());}else{if(_0x537edb){_0x2ae50d(_0x537edb);}else{_0x4aca07(_0x3be8('0xb'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 20e1700..d8ac571 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 _0x2ef3=['messageId','inReplyTo','date','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','substring','indexOf','split','slice','Anonymous','isEmpty','html','test','includes','','body','textAsHtml','0x1?_0x1499c2[_0x32ef('0x12')](0x0,-0x1)['join']('\x20'):_0x298066[_0x32ef('0xe')];}return _0x32ef('0x13');}function getLastName(_0x5c3eb9){var _0x539d18=_[_0x32ef('0x8')](_0x5c3eb9['value']);if(_0x539d18&&_0x539d18[_0x32ef('0xe')]){var _0x40a6e6=_0x539d18[_0x32ef('0xe')][_0x32ef('0x11')](/\s+/);return _0x40a6e6['length']>0x1?_0x40a6e6['pop']():'';}return'';}function getMails(_0x531e30,_0x13db1a){var _0x3950e6='';for(var _0xb5aed2=0x0;_0xb5aed2<_0x13db1a['value']['length'];_0xb5aed2+=0x1){if(_0x13db1a[_0x32ef('0xd')][_0xb5aed2][_0x32ef('0x9')]!==_0x531e30){if(!_[_0x32ef('0x14')](_0x3950e6)){_0x3950e6+=',';}_0x3950e6+=_0x13db1a['value'][_0xb5aed2][_0x32ef('0xe')]||_0x13db1a[_0x32ef('0xd')][_0xb5aed2]['address']||'';_0x3950e6+='\x20<';_0x3950e6+=_0x13db1a[_0x32ef('0xd')][_0xb5aed2][_0x32ef('0x9')]?_0x13db1a[_0x32ef('0xd')][_0xb5aed2][_0x32ef('0x9')]:_0x32ef('0xa')+random[_0x32ef('0xb')](0x6)+'@xcally.com';_0x3950e6+='>';}}return _0x3950e6;}function parseEmail(_0x3c5b78,_0x5cc3ef,_0x309866){if(_0x5cc3ef[_0x32ef('0x15')]){var _0x49f2d8=/)<[^<]*)*<\/script>/gi;while(_0x49f2d8[_0x32ef('0x16')](_0x5cc3ef[_0x32ef('0x15')])){_0x5cc3ef[_0x32ef('0x15')]=_0x5cc3ef['html']['replace'](_0x49f2d8,'');}if(_0x5cc3ef[_0x32ef('0x15')][_0x32ef('0x17')](_0x32ef('0x18'))){var _0x478bef=[];_0x5cc3ef['attachments'][_0x32ef('0x19')](_0x4d584b=>{_0x478bef['push'](_0x4d584b[_0x32ef('0x1a')]);});var _0x14d4b3=/]+>/g;var _0x371540=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1dbe98=_0x5cc3ef[_0x32ef('0x15')][_0x32ef('0x1b')](_0x371540,_0x32ef('0x1c'));var _0x38aed5=_0x1dbe98[_0x32ef('0x1b')](_0x14d4b3,_0x32ef('0x1d'));for(let _0x1335e2=0x0;_0x1335e2<_0x478bef[_0x32ef('0x1e')];_0x1335e2++){var _0x5a88a5=_0x38aed5[_0x32ef('0x1b')](_0x32ef('0x1d'),'\x20[Attachment:\x20'+_0x478bef[_0x1335e2]+_0x32ef('0x1f'));_0x38aed5=_0x5a88a5;}_0x5cc3ef[_0x32ef('0x15')]=_0x38aed5;}_0x309866[_0x32ef('0x20')]=_0x5cc3ef[_0x32ef('0x15')];}else{_0x309866['body']=_0x5cc3ef[_0x32ef('0x21')];}if(_0x309866[_0x32ef('0x20')]){_0x309866[_0x32ef('0x20')]=_0x309866[_0x32ef('0x20')][_0x32ef('0x1b')](/0x0){var _0x3cac2e=[_0x32ef('0x34'),_0x32ef('0x35'),_0x32ef('0x36')];for(var _0x2f92f5=0x0;_0x2f92f5<_0x5cc3ef[_0x32ef('0x33')][_0x32ef('0x1e')];_0x2f92f5++){var _0x596d5a=_['indexOf'](_0x3cac2e,_0x5cc3ef[_0x32ef('0x33')][_0x2f92f5][_0x32ef('0x37')]);if(_0x596d5a>=0x0){_0x309866[_0x32ef('0x38')]=!![];}}}return _0x309866;}exports[_0x32ef('0x39')]=function(_0x5dca14,_0x2901a1,_0x1f323a){var _0x5d2f06={'from':getAddress(_0x2901a1[_0x32ef('0x3a')]),'firstName':getFirstName(_0x2901a1['from']),'lastName':getLastName(_0x2901a1[_0x32ef('0x3a')]),'mapKey':_0x32ef('0x6'),'message':{'from':getMails(_0x5dca14[_0x32ef('0x6')],_0x2901a1[_0x32ef('0x3a')]),'to':_0x5dca14[_0x32ef('0x6')],'cc':'','subject':_0x2901a1[_0x32ef('0x3b')]||'','messageId':_0x2901a1[_0x32ef('0x3c')],'inReplyTo':_0x2901a1[_0x32ef('0x3d')],'sentAt':moment(_0x2901a1[_0x32ef('0x3e')])[_0x32ef('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x2901a1[_0x32ef('0x15')]&&!_0x2901a1['textAsHtml']){var _0xfe9f16=_[_0x32ef('0x3f')](_0x2901a1[_0x32ef('0x26')],{'contentType':'application/ms-tnef'});if(_0xfe9f16[_0x32ef('0x1e')]){logger[_0x32ef('0x40')](util[_0x32ef('0x2a')](_0x32ef('0x41'),_0x2901a1[_0x32ef('0x3c')]));tnef[_0x32ef('0x42')](_[_0x32ef('0x43')](_0xfe9f16)['content'],function(_0x5cb6fc,_0x36252c){if(_0x36252c){_0x2901a1[_0x32ef('0x15')]=_0x36252c[_0x32ef('0x44')]||_0x32ef('0x45');if(_0x36252c[_0x32ef('0x46')]){for(var _0xd67dc9=0x0;_0xd67dc9<_0x36252c[_0x32ef('0x46')][_0x32ef('0x1e')];_0xd67dc9++){var _0xc10e7=_0x36252c[_0x32ef('0x46')][_0xd67dc9];_0x5d2f06[_0x32ef('0x23')][_0x32ef('0x26')][_0x32ef('0x31')]({'filename':_0xc10e7['Title'],'content':Buffer[_0x32ef('0x3a')](_0xc10e7[_0x32ef('0x47')])});}}}_0x1f323a(parseEmail(_0x5dca14,_0x2901a1,_0x5d2f06));});}else{_0x2901a1[_0x32ef('0x15')]=_0x32ef('0x45');_0x1f323a(parseEmail(_0x5dca14,_0x2901a1,_0x5d2f06));}}else{_0x1f323a(parseEmail(_0x5dca14,_0x2901a1,_0x5d2f06));}};exports[_0x32ef('0x48')]=function(_0x4353f0){switch(_0x4353f0){case _0x32ef('0x49'):return _0x32ef('0x4a');case _0x32ef('0x4b'):return _0x32ef('0x4c');case _0x32ef('0x4d'):return _0x32ef('0x4e');case _0x32ef('0x4f'):return _0x32ef('0x50');}return _0x32ef('0x51');}; \ No newline at end of file +var _0xd2f5=['messageId','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','parseBuffer','first','

Empty\x20message

','Attachments','Title','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','127.0.0.1','lodash','moment','randomstring','path','node-tnef','../../../config/environment','value','address','generate','@xcally.com','name','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','anonymous','html','test','replace','includes','','body','message','originTo','email','originCc','bcc','attachment-','format','%s-%s','now','writeFileSync','content','contentType','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject'];(function(_0x48029d,_0x7425d6){var _0x40141c=function(_0x34cab2){while(--_0x34cab2){_0x48029d['push'](_0x48029d['shift']());}};_0x40141c(++_0x7425d6);}(_0xd2f5,0x12e));var _0x5d2f=function(_0x3e9af2,_0x71fc77){_0x3e9af2=_0x3e9af2-0x0;var _0x175e37=_0xd2f5[_0x3e9af2];return _0x175e37;};'use strict';var _=require(_0x5d2f('0x0'));var moment=require(_0x5d2f('0x1'));var random=require(_0x5d2f('0x2'));var fs=require('fs');var path=require(_0x5d2f('0x3'));var util=require('util');var tnef=require(_0x5d2f('0x4'));var logger=require('../../../config/logger')('email');var config=require(_0x5d2f('0x5'));function getAddress(_0x436447){var _0x263891=_['head'](_0x436447[_0x5d2f('0x6')]);return _0x263891&&_0x263891[_0x5d2f('0x7')]?_0x263891[_0x5d2f('0x7')]:'anonymous'+random[_0x5d2f('0x8')](0x6)+_0x5d2f('0x9');}function getFirstName(_0x330195){var _0x485432=_['head'](_0x330195[_0x5d2f('0x6')]);if(_0x485432&&_0x485432[_0x5d2f('0xa')]){if(_0x485432['name']==_0x485432[_0x5d2f('0x7')]){return _0x485432[_0x5d2f('0xa')]['substring'](0x0,_0x485432['name'][_0x5d2f('0xb')]('@'));}var _0x458f43=_0x485432['name'][_0x5d2f('0xc')](/\s+/);return _0x458f43[_0x5d2f('0xd')]>0x1?_0x458f43[_0x5d2f('0xe')](0x0,-0x1)[_0x5d2f('0xf')]('\x20'):_0x485432[_0x5d2f('0xa')];}return _0x5d2f('0x10');}function getLastName(_0x149e68){var _0x526695=_['head'](_0x149e68['value']);if(_0x526695&&_0x526695['name']){var _0x1a76eb=_0x526695['name'][_0x5d2f('0xc')](/\s+/);return _0x1a76eb[_0x5d2f('0xd')]>0x1?_0x1a76eb[_0x5d2f('0x11')]():'';}return'';}function getMails(_0x1cd3e5,_0x53f46f){var _0x64e7e0='';for(var _0x875750=0x0;_0x875750<_0x53f46f['value'][_0x5d2f('0xd')];_0x875750+=0x1){if(_0x53f46f[_0x5d2f('0x6')][_0x875750][_0x5d2f('0x7')]!==_0x1cd3e5){if(!_[_0x5d2f('0x12')](_0x64e7e0)){_0x64e7e0+=',';}_0x64e7e0+=_0x53f46f[_0x5d2f('0x6')][_0x875750][_0x5d2f('0xa')]||_0x53f46f[_0x5d2f('0x6')][_0x875750][_0x5d2f('0x7')]||'';_0x64e7e0+='\x20<';_0x64e7e0+=_0x53f46f[_0x5d2f('0x6')][_0x875750][_0x5d2f('0x7')]?_0x53f46f[_0x5d2f('0x6')][_0x875750][_0x5d2f('0x7')]:_0x5d2f('0x13')+random['generate'](0x6)+_0x5d2f('0x9');_0x64e7e0+='>';}}return _0x64e7e0;}function parseEmail(_0x25fd87,_0x5994ba,_0x43fe3f){if(_0x5994ba[_0x5d2f('0x14')]){var _0x677173=/)<[^<]*)*<\/script>/gi;while(_0x677173[_0x5d2f('0x15')](_0x5994ba[_0x5d2f('0x14')])){_0x5994ba[_0x5d2f('0x14')]=_0x5994ba[_0x5d2f('0x14')][_0x5d2f('0x16')](_0x677173,'');}if(_0x5994ba[_0x5d2f('0x14')][_0x5d2f('0x17')](_0x5d2f('0x18'))){var _0x53bc35=[];_0x5994ba[_0x5d2f('0x19')][_0x5d2f('0x1a')](_0x355abe=>{_0x53bc35[_0x5d2f('0x1b')](_0x355abe[_0x5d2f('0x1c')]);});var _0x224827=/]+>/g;var _0x3e57df=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1e8501=_0x5994ba[_0x5d2f('0x14')]['replace'](_0x3e57df,_0x5d2f('0x1d'));var _0x208fc4=_0x1e8501['replace'](_0x224827,_0x5d2f('0x1e'));for(let _0x1a61f1=0x0;_0x1a61f1<_0x53bc35[_0x5d2f('0xd')];_0x1a61f1++){var _0x208a97=_0x208fc4[_0x5d2f('0x16')](_0x5d2f('0x1e'),'\x20[Attachment:\x20'+_0x53bc35[_0x1a61f1]+_0x5d2f('0x1f'));_0x208fc4=_0x208a97;}_0x5994ba[_0x5d2f('0x14')]=_0x208fc4;}_0x43fe3f['body']=_0x5994ba['html'];}else{_0x43fe3f['body']=_0x5994ba['textAsHtml'];}if(_0x43fe3f[_0x5d2f('0x20')]){_0x43fe3f[_0x5d2f('0x20')]=_0x43fe3f[_0x5d2f('0x20')][_0x5d2f('0x16')](/0x0){var _0x1de840=['Auto-Submitted:\x20auto-replied',_0x5d2f('0x2e'),_0x5d2f('0x2f')];for(var _0x55f0aa=0x0;_0x55f0aa<_0x5994ba[_0x5d2f('0x2d')][_0x5d2f('0xd')];_0x55f0aa++){var _0x159ba1=_[_0x5d2f('0xb')](_0x1de840,_0x5994ba['headerLines'][_0x55f0aa][_0x5d2f('0x30')]);if(_0x159ba1>=0x0){_0x43fe3f[_0x5d2f('0x31')]=!![];}}}return _0x43fe3f;}exports[_0x5d2f('0x32')]=function(_0x48bf3f,_0x57a72f,_0x5dc54e){var _0xe6d87={'from':getAddress(_0x57a72f[_0x5d2f('0x33')]),'firstName':getFirstName(_0x57a72f[_0x5d2f('0x33')]),'lastName':getLastName(_0x57a72f[_0x5d2f('0x33')]),'mapKey':_0x5d2f('0x23'),'message':{'from':getMails(_0x48bf3f[_0x5d2f('0x23')],_0x57a72f[_0x5d2f('0x33')]),'to':_0x48bf3f[_0x5d2f('0x23')],'cc':'','subject':_0x57a72f[_0x5d2f('0x34')]||'','messageId':_0x57a72f[_0x5d2f('0x35')],'inReplyTo':_0x57a72f['inReplyTo'],'sentAt':moment(_0x57a72f[_0x5d2f('0x36')])['format'](_0x5d2f('0x37')),'attach':![],'attachments':[]}};if(!_0x57a72f[_0x5d2f('0x14')]&&!_0x57a72f['textAsHtml']){var _0x48f12d=_[_0x5d2f('0x38')](_0x57a72f[_0x5d2f('0x19')],{'contentType':_0x5d2f('0x39')});if(_0x48f12d[_0x5d2f('0xd')]){logger['info'](util['format'](_0x5d2f('0x3a'),_0x57a72f[_0x5d2f('0x35')]));tnef[_0x5d2f('0x3b')](_[_0x5d2f('0x3c')](_0x48f12d)[_0x5d2f('0x2b')],function(_0x44c540,_0x4af116){if(_0x4af116){_0x57a72f[_0x5d2f('0x14')]=_0x4af116['BodyHTML']||_0x5d2f('0x3d');if(_0x4af116[_0x5d2f('0x3e')]){for(var _0x3c2319=0x0;_0x3c2319<_0x4af116[_0x5d2f('0x3e')]['length'];_0x3c2319++){var _0x3d9972=_0x4af116[_0x5d2f('0x3e')][_0x3c2319];_0xe6d87[_0x5d2f('0x21')]['attachments'][_0x5d2f('0x1b')]({'filename':_0x3d9972[_0x5d2f('0x3f')],'content':Buffer['from'](_0x3d9972['Data'])});}}}_0x5dc54e(parseEmail(_0x48bf3f,_0x57a72f,_0xe6d87));});}else{_0x57a72f[_0x5d2f('0x14')]='

Empty\x20message

';_0x5dc54e(parseEmail(_0x48bf3f,_0x57a72f,_0xe6d87));}}else{_0x5dc54e(parseEmail(_0x48bf3f,_0x57a72f,_0xe6d87));}};exports[_0x5d2f('0x40')]=function(_0x4f9ee1){switch(_0x4f9ee1){case'gmail':return _0x5d2f('0x41');case _0x5d2f('0x42'):return _0x5d2f('0x43');case _0x5d2f('0x44'):return'imap-mail.outlook.com';case _0x5d2f('0x45'):return'outlook.office365.com';}return _0x5d2f('0x46');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 6cce078..a23edcf 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 _0xfdf6=['Smtp','exports','lodash','name','Service','key','SERV','active','Imap'];(function(_0x4bce4f,_0x20a8c9){var _0x32541a=function(_0x482558){while(--_0x482558){_0x4bce4f['push'](_0x4bce4f['shift']());}};_0x32541a(++_0x20a8c9);}(_0xfdf6,0x134));var _0x6fdf=function(_0x21cbe1,_0x22b23e){_0x21cbe1=_0x21cbe1-0x0;var _0x4e342d=_0xfdf6[_0x21cbe1];return _0x4e342d;};'use strict';var _=require(_0x6fdf('0x0'));function MailAccount(_0x423761){this['id']=_0x423761['id']||0x0;this[_0x6fdf('0x1')]=_0x423761['name']||_0x6fdf('0x2');this[_0x6fdf('0x3')]=_0x423761[_0x6fdf('0x3')]||_0x6fdf('0x4');this['active']=_0x423761[_0x6fdf('0x5')]||![];this[_0x6fdf('0x6')]=_0x423761[_0x6fdf('0x6')]||[];this['Smtp']=_0x423761[_0x6fdf('0x7')]||[];}module[_0x6fdf('0x8')]=MailAccount; \ No newline at end of file +var _0xb3c0=['Service','key','SERV','active','Imap','Smtp','lodash','name'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xb3c0,0x136));var _0x0b3c=function(_0x2e3539,_0x5a3af5){_0x2e3539=_0x2e3539-0x0;var _0x28127e=_0xb3c0[_0x2e3539];return _0x28127e;};'use strict';var _=require(_0x0b3c('0x0'));function MailAccount(_0x4f0487){this['id']=_0x4f0487['id']||0x0;this[_0x0b3c('0x1')]=_0x4f0487['name']||_0x0b3c('0x2');this[_0x0b3c('0x3')]=_0x4f0487[_0x0b3c('0x3')]||_0x0b3c('0x4');this[_0x0b3c('0x5')]=_0x4f0487['active']||![];this[_0x0b3c('0x6')]=_0x4f0487[_0x0b3c('0x6')]||[];this[_0x0b3c('0x7')]=_0x4f0487[_0x0b3c('0x7')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 2e6e4ff..f0f1ced 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 _0xfa10=['mailAccounts','mapKeys','hasOwnProperty','prototype','length','merge','exports','lodash'];(function(_0xe7c3a2,_0x573ceb){var _0x13ac37=function(_0x451145){while(--_0x451145){_0xe7c3a2['push'](_0xe7c3a2['shift']());}};_0x13ac37(++_0x573ceb);}(_0xfa10,0x147));var _0x0fa1=function(_0x5923a0,_0x36f153){_0x5923a0=_0x5923a0-0x0;var _0x55fad0=_0xfa10[_0x5923a0];return _0x55fad0;};'use strict';var _=require(_0x0fa1('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x0fa1('0x1')]={};};function freeIsNotKey(_0xb1e1d1,_0x29a18a,_0x52178a){var _0x14fc89=_[_0x0fa1('0x2')](_0xb1e1d1,function(_0x1b9fd5,_0x3d80fa){return _0x1b9fd5[_0x52178a];});for(var _0x54370c in _0x29a18a){if(_0x29a18a[_0x0fa1('0x3')](_0x54370c)){if(!_0x14fc89[_0x54370c]){delete _0x29a18a[_0x54370c];}}}}Realtime[_0x0fa1('0x4')]['mergeFromDatabase']=function(_0x1a2e26,_0x1af837){for(var _0x48ca2a in _0x1af837){if(_0x1a2e26[_0x0fa1('0x3')](_0x48ca2a)){_0x1a2e26[_0x48ca2a]=_0x1af837[_0x48ca2a];}}};Realtime[_0x0fa1('0x4')]['initMailAccounts']=function(){var _0x2f3ec1=this;return function(_0x190dd9){if(_0x190dd9){freeIsNotKey(_0x190dd9,_0x2f3ec1[_0x0fa1('0x1')],'id');for(var _0x3de145=0x0,_0x6ec23c={},_0x287686={};_0x3de145<_0x190dd9[_0x0fa1('0x5')];_0x3de145+=0x1){_0x6ec23c=_0x190dd9[_0x3de145];if(_['isUndefined'](_0x2f3ec1[_0x0fa1('0x1')][_0x6ec23c['id']])){_0x2f3ec1[_0x0fa1('0x1')][_0x6ec23c['id']]=new MailAccount(_0x6ec23c);}else{_[_0x0fa1('0x6')](_0x2f3ec1[_0x0fa1('0x1')][_0x6ec23c['id']],_0x6ec23c);}}}return _0x2f3ec1['mailAccounts'];};};module[_0x0fa1('0x7')]=Realtime; \ No newline at end of file +var _0xe6ee=['mailAccounts','lodash','../model/mailAccount','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xe6ee,0x17d));var _0xee6e=function(_0x235ab5,_0x35f786){_0x235ab5=_0x235ab5-0x0;var _0x2030fb=_0xe6ee[_0x235ab5];return _0x2030fb;};'use strict';var _=require(_0xee6e('0x0'));var MailAccount=require(_0xee6e('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x472cca,_0x408ba9,_0x2b7b15){var _0x66aefb=_[_0xee6e('0x2')](_0x472cca,function(_0x3fb686,_0xb816a7){return _0x3fb686[_0x2b7b15];});for(var _0x4ca4ac in _0x408ba9){if(_0x408ba9[_0xee6e('0x3')](_0x4ca4ac)){if(!_0x66aefb[_0x4ca4ac]){delete _0x408ba9[_0x4ca4ac];}}}}Realtime[_0xee6e('0x4')][_0xee6e('0x5')]=function(_0x2225ae,_0x138564){for(var _0x2b2cf9 in _0x138564){if(_0x2225ae[_0xee6e('0x3')](_0x2b2cf9)){_0x2225ae[_0x2b2cf9]=_0x138564[_0x2b2cf9];}}};Realtime[_0xee6e('0x4')][_0xee6e('0x6')]=function(){var _0xabbb21=this;return function(_0x25f3b4){if(_0x25f3b4){freeIsNotKey(_0x25f3b4,_0xabbb21['mailAccounts'],'id');for(var _0x376fea=0x0,_0x29174e={},_0xb778c={};_0x376fea<_0x25f3b4[_0xee6e('0x7')];_0x376fea+=0x1){_0x29174e=_0x25f3b4[_0x376fea];if(_[_0xee6e('0x8')](_0xabbb21[_0xee6e('0x9')][_0x29174e['id']])){_0xabbb21['mailAccounts'][_0x29174e['id']]=new MailAccount(_0x29174e);}else{_['merge'](_0xabbb21[_0xee6e('0x9')][_0x29174e['id']],_0x29174e);}}}return _0xabbb21[_0xee6e('0x9')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 17161de..ae203de 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 _0xff01=['notify','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','service','email','active','ListId','MailServerIn','MailServerOut'];(function(_0x4db0d1,_0x5d4c4a){var _0x557191=function(_0x961720){while(--_0x961720){_0x4db0d1['push'](_0x4db0d1['shift']());}};_0x557191(++_0x5d4c4a);}(_0xff01,0xb7));var _0x1ff0=function(_0x19c8aa,_0x7248d0){_0x19c8aa=_0x19c8aa-0x0;var _0x4c5bcc=_0xff01[_0x19c8aa];return _0x4c5bcc;};'use strict';var client=require(_0x1ff0('0x0'));exports[_0x1ff0('0x1')]=function(){return function(){return client['Request'](_0x1ff0('0x2'),{'options':{'attributes':['id','name',_0x1ff0('0x3'),_0x1ff0('0x4'),_0x1ff0('0x5'),'key',_0x1ff0('0x6'),'TemplateId'],'raw':![],'include':[{'model':_0x1ff0('0x7'),'as':'Imap'},{'model':_0x1ff0('0x8'),'as':'Smtp'}]},'log':'getMailAccount'});};};exports[_0x1ff0('0x9')]=function(_0xb44d65,_0x4e5b21){return client[_0x1ff0('0xa')](_0x1ff0('0xb'),{'account':{'id':_0xb44d65},'body':_0x4e5b21,'log':_0x1ff0('0xb')});}; \ No newline at end of file +var _0x458a=['GetMailAccount','name','email','active','key','ListId','TemplateId','MailServerIn','getMailAccount','notify','Request','NotifyMailAccount','../client'];(function(_0x5aa2c8,_0x1cc3a3){var _0x42c532=function(_0x51cfc6){while(--_0x51cfc6){_0x5aa2c8['push'](_0x5aa2c8['shift']());}};_0x42c532(++_0x1cc3a3);}(_0x458a,0x110));var _0xa458=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x458a[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xa458('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0xa458('0x1'),{'options':{'attributes':['id',_0xa458('0x2'),'service',_0xa458('0x3'),_0xa458('0x4'),_0xa458('0x5'),_0xa458('0x6'),_0xa458('0x7')],'raw':![],'include':[{'model':_0xa458('0x8'),'as':'Imap'},{'model':'MailServerOut','as':'Smtp'}]},'log':_0xa458('0x9')});};};exports[_0xa458('0xa')]=function(_0x435bc7,_0x192b61){return client[_0xa458('0xb')]('NotifyMailAccount',{'account':{'id':_0x435bc7},'body':_0x192b61,'log':_0xa458('0xc')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index e121e87..f54bf40 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 _0xf6aa=['loginMailFrequency','GetSettings','../client','getSettings','Request'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xf6aa,0x1ec));var _0xaf6a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf6aa[_0x3ab51d];return _0x29a04e;};'use strict';var client=require(_0xaf6a('0x0'));exports[_0xaf6a('0x1')]=function(){return client[_0xaf6a('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xaf6a('0x3')]},'log':_0xaf6a('0x4')});}; \ No newline at end of file +var _0x240b=['getSettings','Request','ShowSetting','../client'];(function(_0x52cb4a,_0x217996){var _0x2d84e7=function(_0x1ecdb2){while(--_0x1ecdb2){_0x52cb4a['push'](_0x52cb4a['shift']());}};_0x2d84e7(++_0x217996);}(_0x240b,0xf7));var _0xb240=function(_0x488412,_0x48fd26){_0x488412=_0x488412-0x0;var _0x2115de=_0x240b[_0x488412];return _0x2115de;};'use strict';var client=require(_0xb240('0x0'));exports[_0xb240('0x1')]=function(){return client[_0xb240('0x2')](_0xb240('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'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 de2e38e..3a0d9a6 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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 0b2df1e..9788ad5 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 _0x7d1d=['express','sticky-session','../../config/environment','listen','port','socket.io','websocket','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http'];(function(_0x15b6d2,_0x3bf4be){var _0x36a1e2=function(_0x752ef0){while(--_0x752ef0){_0x15b6d2['push'](_0x15b6d2['shift']());}};_0x36a1e2(++_0x3bf4be);}(_0x7d1d,0xbb));var _0xd7d1=function(_0x3d5df9,_0x5b3623){_0x3d5df9=_0x3d5df9-0x0;var _0x50ba39=_0x7d1d[_0x3d5df9];return _0x50ba39;};'use strict';var _=require(_0xd7d1('0x0'));var http=require(_0xd7d1('0x1'));var express=require(_0xd7d1('0x2'));var sticky=require(_0xd7d1('0x3'));var Redis=require('ioredis');var config=require(_0xd7d1('0x4'));var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky[_0xd7d1('0x5')](server,config[_0xd7d1('0x6')])){var socketio=require(_0xd7d1('0x7'))(server,{'transports':[_0xd7d1('0x8'),'polling']});config[_0xd7d1('0x9')]=_[_0xd7d1('0xa')](config['redis'],{'host':_0xd7d1('0xb'),'port':0x18eb});socketio[_0xd7d1('0xc')](require(_0xd7d1('0xd'))({'pubClient':new Redis(config[_0xd7d1('0x9')]),'subClient':new Redis(config['redis'])}));require(_0xd7d1('0xe'))['default']();require(_0xd7d1('0xf'))[_0xd7d1('0x10')](socketio);require(_0xd7d1('0x11'))[_0xd7d1('0x10')](app);require('../../routes')['default'](app);}else{server['once'](_0xd7d1('0x12'),function(){console['log'](_0xd7d1('0x13'),config[_0xd7d1('0x6')]);});}exports=module[_0xd7d1('0x14')]=app; \ No newline at end of file +var _0x54d2=['defaults','localhost','../../config/triggers','default','../../config/express','../../routes','once','listening','log','exports','http','express','sticky-session','ioredis','../../config/environment','timeout','listen','port','socket.io','websocket','redis'];(function(_0x559c60,_0x2a2367){var _0x3e0047=function(_0x176da3){while(--_0x176da3){_0x559c60['push'](_0x559c60['shift']());}};_0x3e0047(++_0x2a2367);}(_0x54d2,0x73));var _0x254d=function(_0xa709ec,_0x24e57c){_0xa709ec=_0xa709ec-0x0;var _0xae5fb5=_0x54d2[_0xa709ec];return _0xae5fb5;};'use strict';var _=require('lodash');var http=require(_0x254d('0x0'));var express=require(_0x254d('0x1'));var sticky=require(_0x254d('0x2'));var Redis=require(_0x254d('0x3'));var config=require(_0x254d('0x4'));var app=express();var server=http['createServer'](app);server[_0x254d('0x5')]=0xdbba0;if(sticky[_0x254d('0x6')](server,config[_0x254d('0x7')])){var socketio=require(_0x254d('0x8'))(server,{'transports':[_0x254d('0x9'),'polling']});config[_0x254d('0xa')]=_[_0x254d('0xb')](config[_0x254d('0xa')],{'host':_0x254d('0xc'),'port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config[_0x254d('0xa')]),'subClient':new Redis(config['redis'])}));require(_0x254d('0xd'))[_0x254d('0xe')]();require('../../config/socketio')['default'](socketio);require(_0x254d('0xf'))[_0x254d('0xe')](app);require(_0x254d('0x10'))[_0x254d('0xe')](app);}else{server[_0x254d('0x11')](_0x254d('0x12'),function(){console[_0x254d('0x13')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x254d('0x7')]);});}exports=module[_0x254d('0x14')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 0853156..4e22749 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 _0xe6e8=['Request','debug','rpc','message','result','catch','error','exports','jayson/promise','bluebird','../../config/logger','routing','http'];(function(_0x132987,_0x2ff9f6){var _0x4a8073=function(_0x27bc49){while(--_0x27bc49){_0x132987['push'](_0x132987['shift']());}};_0x4a8073(++_0x2ff9f6);}(_0xe6e8,0x1dc));var _0x8e6e=function(_0x4ee491,_0x176a85){_0x4ee491=_0x4ee491-0x0;var _0x4bb176=_0xe6e8[_0x4ee491];return _0x4bb176;};'use strict';var jayson=require(_0x8e6e('0x0'));var BPromise=require(_0x8e6e('0x1'));var logger=require(_0x8e6e('0x2'))(_0x8e6e('0x3'));var client=jayson['client'][_0x8e6e('0x4')]({'port':0x2329});client[_0x8e6e('0x5')]=function(_0x5d3336,_0x1011d0){return new BPromise(function(_0x21771e,_0x3ab8c9){return client['request'](_0x5d3336,_0x1011d0)['then'](function(_0x321460){logger[_0x8e6e('0x6')](_0x8e6e('0x7'),'routing',_0x5d3336,_0x1011d0,_0x321460);if(_0x321460['error']){logger['error'](_0x8e6e('0x7'),_0x8e6e('0x3'),_0x5d3336,_0x321460['error']['message'],_0x1011d0);return _0x3ab8c9(_0x321460['error'][_0x8e6e('0x8')]);}else{return _0x21771e(_0x321460[_0x8e6e('0x9')]);}})[_0x8e6e('0xa')](function(_0x5cffff){logger[_0x8e6e('0xb')](_0x8e6e('0x7'),_0x8e6e('0x3'),_0x5d3336,_0x5cffff,_0x1011d0);return _0x3ab8c9(_0x5cffff);});});};module[_0x8e6e('0xc')]=client; \ No newline at end of file +var _0x23dc=['routing','error','message','result','exports','../../config/logger','client','Request','request','then','debug','rpc'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x23dc,0x13d));var _0xc23d=function(_0x41de5a,_0x4d385c){_0x41de5a=_0x41de5a-0x0;var _0x4b21d5=_0x23dc[_0x41de5a];return _0x4b21d5;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xc23d('0x0'))('routing');var client=jayson[_0xc23d('0x1')]['http']({'port':0x2329});client[_0xc23d('0x2')]=function(_0x41d90c,_0x1139a2){return new BPromise(function(_0x21a3b7,_0x38a39c){return client[_0xc23d('0x3')](_0x41d90c,_0x1139a2)[_0xc23d('0x4')](function(_0xc9a6ea){logger[_0xc23d('0x5')](_0xc23d('0x6'),_0xc23d('0x7'),_0x41d90c,_0x1139a2,_0xc9a6ea);if(_0xc9a6ea[_0xc23d('0x8')]){logger[_0xc23d('0x8')](_0xc23d('0x6'),'routing',_0x41d90c,_0xc9a6ea[_0xc23d('0x8')][_0xc23d('0x9')],_0x1139a2);return _0x38a39c(_0xc9a6ea['error'][_0xc23d('0x9')]);}else{return _0x21a3b7(_0xc9a6ea[_0xc23d('0xa')]);}})['catch'](function(_0x24ed72){logger[_0xc23d('0x8')]('rpc',_0xc23d('0x7'),_0x41d90c,_0x24ed72,_0x1139a2);return _0x38a39c(_0x24ed72);});});};module[_0xc23d('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index d8e4f9b..40e6a94 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 _0x9a93=['./server','./realtime','./rpc/user','./rpc/interval','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','listen','catch','log'];(function(_0x48c478,_0x36057b){var _0x185b0c=function(_0x4495bb){while(--_0x4495bb){_0x48c478['push'](_0x48c478['shift']());}};_0x185b0c(++_0x36057b);}(_0x9a93,0xc0));var _0x39a9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9a93[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require('bluebird');var server=require(_0x39a9('0x0'));var Realtime=require(_0x39a9('0x1'));var user=require(_0x39a9('0x2'));var interval=require(_0x39a9('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x39a9('0x4'));var mailQueue=require(_0x39a9('0x5'));var faxQueue=require(_0x39a9('0x6'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x39a9('0x7')]()[_0x39a9('0x8')](user[_0x39a9('0x9')]())[_0x39a9('0x8')](realtime[_0x39a9('0xa')]())[_0x39a9('0x8')](interval[_0x39a9('0xb')]())[_0x39a9('0x8')](realtime[_0x39a9('0xc')]())[_0x39a9('0x8')](openchannelQueue[_0x39a9('0xd')]())['then'](realtime['initOpenchannelQueues']())[_0x39a9('0x8')](chatQueue[_0x39a9('0xe')]())['then'](realtime[_0x39a9('0xf')]())[_0x39a9('0x8')](smsQueue['getSmsQueues']())[_0x39a9('0x8')](realtime[_0x39a9('0x10')]())[_0x39a9('0x8')](mailQueue['getMailQueues']())['then'](realtime[_0x39a9('0x11')]())[_0x39a9('0x8')](faxQueue[_0x39a9('0x12')]())[_0x39a9('0x8')](realtime[_0x39a9('0x13')]())[_0x39a9('0x8')](whatsappQueue['getWhatsappQueues']())[_0x39a9('0x8')](realtime[_0x39a9('0x14')]())[_0x39a9('0x8')](function(){return realtime;});}function main(){return server[_0x39a9('0x15')](realtime)[_0x39a9('0x8')](function(_0x81a38a){return initRealtime();})[_0x39a9('0x8')](function(_0x3a2a93){return setInterval(initRealtime,0x1388);})[_0x39a9('0x16')](function(_0x4dffed){console[_0x39a9('0x17')](_0x4dffed);});}main(); \ No newline at end of file +var _0x0919=['then','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','initAgents','getIntervals'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0x0919,0xb0));var _0x9091=function(_0x1afc73,_0x1e3ecb){_0x1afc73=_0x1afc73-0x0;var _0x23f0d2=_0x0919[_0x1afc73];return _0x23f0d2;};'use strict';var BPromise=require(_0x9091('0x0'));var server=require(_0x9091('0x1'));var Realtime=require(_0x9091('0x2'));var user=require(_0x9091('0x3'));var interval=require(_0x9091('0x4'));var openchannelQueue=require(_0x9091('0x5'));var chatQueue=require(_0x9091('0x6'));var smsQueue=require(_0x9091('0x7'));var mailQueue=require(_0x9091('0x8'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x9091('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x9091('0xa')]()['then'](user['getAgents']())['then'](realtime[_0x9091('0xb')]())['then'](interval[_0x9091('0xc')]())[_0x9091('0xd')](realtime[_0x9091('0xe')]())[_0x9091('0xd')](openchannelQueue[_0x9091('0xf')]())['then'](realtime[_0x9091('0x10')]())[_0x9091('0xd')](chatQueue[_0x9091('0x11')]())['then'](realtime[_0x9091('0x12')]())[_0x9091('0xd')](smsQueue[_0x9091('0x13')]())['then'](realtime[_0x9091('0x14')]())[_0x9091('0xd')](mailQueue[_0x9091('0x15')]())['then'](realtime['initMailQueues']())[_0x9091('0xd')](faxQueue['getFaxQueues']())[_0x9091('0xd')](realtime[_0x9091('0x16')]())['then'](whatsappQueue[_0x9091('0x17')]())[_0x9091('0xd')](realtime[_0x9091('0x18')]())[_0x9091('0xd')](function(){return realtime;});}function main(){return server[_0x9091('0x19')](realtime)['then'](function(_0x2bea4d){return initRealtime();})[_0x9091('0xd')](function(_0x3fdd79){return setInterval(initRealtime,0x1388);})['catch'](function(_0x4645bc){console[_0x9091('0x1a')](_0x4645bc);});}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 d2e7d10..88ba4c8 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x195a12,_0x558d3c){var _0x5aaf55=function(_0x2fc58b){while(--_0x2fc58b){_0x195a12['push'](_0x195a12['shift']());}};_0x5aaf55(++_0x558d3c);}(_0x326f,0xd1));var _0xf326=function(_0x4ea158,_0x223aaf){_0x4ea158=_0x4ea158-0x0;var _0x3ac7a6=_0x326f[_0x4ea158];return _0x3ac7a6;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file +var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x302f55,_0x31872f){var _0x55ca94=function(_0x477ac3){while(--_0x477ac3){_0x302f55['push'](_0x302f55['shift']());}};_0x55ca94(++_0x31872f);}(_0x814b,0x1a2));var _0xb814=function(_0x57014b,_0x360c0f){_0x57014b=_0x57014b-0x0;var _0x2b258a=_0x814b[_0x57014b];return _0x2b258a;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 093bb8f..ca0bd33 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 _0x8b2d=['result','catch','SendMail','bluebird','jayson/promise','then','error','message'];(function(_0x5e1d8a,_0x447e2d){var _0x4e6996=function(_0x2c01d1){while(--_0x2c01d1){_0x5e1d8a['push'](_0x5e1d8a['shift']());}};_0x4e6996(++_0x447e2d);}(_0x8b2d,0x1ab));var _0xd8b2=function(_0x2e334b,_0x426b6e){_0x2e334b=_0x2e334b-0x0;var _0x390570=_0x8b2d[_0x2e334b];return _0x390570;};'use strict';var BPromise=require(_0xd8b2('0x0'));var jayson=require(_0xd8b2('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x16dac8,_0x40ce28){return new BPromise(function(_0x267442,_0x141dd9){return client['request'](_0x16dac8,_0x40ce28)[_0xd8b2('0x2')](function(_0x3af182){if(_0x3af182['error']){return _0x141dd9(_0x3af182[_0xd8b2('0x3')][_0xd8b2('0x4')]);}else{return _0x267442(_0x3af182[_0xd8b2('0x5')]);}})[_0xd8b2('0x6')](function(_0x5e76b2){return _0x141dd9(_0x5e76b2);});});}exports['sendMailMessage']=function(_0x792106,_0x1aa926){return request(_0xd8b2('0x7'),{'account':_0x792106,'message':_0x1aa926});}; \ No newline at end of file +var _0x6e15=['error','message','catch','bluebird','http','request','then'];(function(_0x34ac63,_0x40f4da){var _0x44aee2=function(_0x5a1140){while(--_0x5a1140){_0x34ac63['push'](_0x34ac63['shift']());}};_0x44aee2(++_0x40f4da);}(_0x6e15,0x184));var _0x56e1=function(_0x4d493b,_0x4e79d7){_0x4d493b=_0x4d493b-0x0;var _0x372276=_0x6e15[_0x4d493b];return _0x372276;};'use strict';var BPromise=require(_0x56e1('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x56e1('0x1')]({'port':0x232b});function request(_0x5e9bc3,_0x9785d5){return new BPromise(function(_0x4019ff,_0x221a04){return client[_0x56e1('0x2')](_0x5e9bc3,_0x9785d5)[_0x56e1('0x3')](function(_0x37b6e0){if(_0x37b6e0[_0x56e1('0x4')]){return _0x221a04(_0x37b6e0[_0x56e1('0x4')][_0x56e1('0x5')]);}else{return _0x4019ff(_0x37b6e0['result']);}})[_0x56e1('0x6')](function(_0x39c6c1){return _0x221a04(_0x39c6c1);});});}exports['sendMailMessage']=function(_0x1cfbea,_0x160150){return request('SendMail',{'account':_0x1cfbea,'message':_0x160150});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 4af8391..178f41b 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 _0x17fa=['online','voicePause','chatPause','mailPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','faxPause','smsStatusTime','whatsappCurrentCapacity','busyQueue','stringify','emit','user:save','exports','moment','md5','defaults','redis','localhost','name'];(function(_0x5556bf,_0xa83a80){var _0x3dea86=function(_0x55b671){while(--_0x55b671){_0x5556bf['push'](_0x5556bf['shift']());}};_0x3dea86(++_0xa83a80);}(_0x17fa,0x190));var _0xa17f=function(_0x1a59f5,_0x2c199d){_0x1a59f5=_0x1a59f5-0x0;var _0x17e3b9=_0x17fa[_0x1a59f5];return _0x17e3b9;};'use strict';var _=require('lodash');var moment=require(_0xa17f('0x0'));var md5=require(_0xa17f('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xa17f('0x2')](config[_0xa17f('0x3')],{'host':_0xa17f('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa17f('0x3')]));function Agent(_0x1494fa){this['id']=_0x1494fa['id']||0x0;this[_0xa17f('0x5')]=_0x1494fa['name']||'';this['online']=_0x1494fa[_0xa17f('0x6')]||!![];this[_0xa17f('0x7')]=_0x1494fa[_0xa17f('0x7')]||![];this[_0xa17f('0x8')]=_0x1494fa[_0xa17f('0x8')]||![];this[_0xa17f('0x9')]=_0x1494fa[_0xa17f('0x9')]||![];this['faxPause']=_0x1494fa['faxPause']||![];this[_0xa17f('0xa')]=_0x1494fa['smsPause']||![];this[_0xa17f('0xb')]=_0x1494fa['openchannelPause']||![];this[_0xa17f('0xc')]=_0xa17f('0xd');this[_0xa17f('0xe')]=0x0;this[_0xa17f('0xf')]=_0x1494fa[_0xa17f('0xf')]||0x0;this[_0xa17f('0x10')]=0x0;this[_0xa17f('0x11')]=_0xa17f('0xd');this['mailStatusTime']=0x0;this[_0xa17f('0x12')]=_0x1494fa['mailCapacity']||0x0;this[_0xa17f('0x13')]=0x0;this[_0xa17f('0x14')]='unknown';this[_0xa17f('0x15')]=0x0;this['faxCapacity']=_0x1494fa['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0xa17f('0x16')]=_0xa17f('0xd');this['smsStatusTime']=0x0;this[_0xa17f('0x17')]=_0x1494fa[_0xa17f('0x17')]||0x0;this[_0xa17f('0x18')]=0x0;this[_0xa17f('0x19')]=_0xa17f('0xd');this[_0xa17f('0x1a')]=0x0;this['whatsappCapacity']=_0x1494fa[_0xa17f('0x1b')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0xa17f('0x1c')]='unknown';this[_0xa17f('0x1d')]=0x0;this['openchannelCapacity']=_0x1494fa[_0xa17f('0x1e')]||0x0;this[_0xa17f('0x1f')]=0x0;this[_0xa17f('0x20')]=![];this['busyQueue']=undefined;this[_0xa17f('0x1')]='';this[_0xa17f('0x21')]();}Agent[_0xa17f('0x22')][_0xa17f('0x23')]=function(_0x4410fd){if(this[_0x4410fd+_0xa17f('0x24')]>0x0){if(this[_0x4410fd+_0xa17f('0x25')]>0x0&&this[_0x4410fd+'CurrentCapacity']>=this[_0x4410fd+_0xa17f('0x25')]){return'maxcapacity';}else{return _0xa17f('0x26');}}else{return _0xa17f('0x27');}};Agent['prototype'][_0xa17f('0x21')]=function(){var _0x5c5d4e=['mail',_0xa17f('0x28'),_0xa17f('0x29'),_0xa17f('0x2a'),_0xa17f('0x2b'),_0xa17f('0x2c')];for(var _0x221a6f=0x0;_0x221a6f<_0x5c5d4e[_0xa17f('0x2d')];_0x221a6f+=0x1){var _0x1cac78=this[_0xa17f('0x23')](_0x5c5d4e[_0x221a6f]);if(this[_0x5c5d4e[_0x221a6f]+_0xa17f('0x2e')]!==_0x1cac78){this[_0x5c5d4e[_0x221a6f]+_0xa17f('0x2f')]=_[_0xa17f('0x30')](moment()[_0xa17f('0x31')]('x'));}this[_0x5c5d4e[_0x221a6f]+'Status']=_0x1cac78;}var _0x77c7d5={'id':this['id'],'name':this[_0xa17f('0x5')],'online':this[_0xa17f('0x6')],'voicePause':this[_0xa17f('0x7')],'chatPause':this['chatPause'],'mailPause':this[_0xa17f('0x9')],'smsPause':this[_0xa17f('0xa')],'faxPause':this[_0xa17f('0x32')],'openchannelPause':this[_0xa17f('0xb')],'chatStatus':this[_0xa17f('0xc')],'chatStatusTime':this[_0xa17f('0xe')],'chatCapacity':this[_0xa17f('0xf')],'chatCurrentCapacity':this[_0xa17f('0x10')],'mailStatus':this[_0xa17f('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xa17f('0x12')],'mailCurrentCapacity':this[_0xa17f('0x13')],'faxStatus':this[_0xa17f('0x14')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xa17f('0x16')],'smsStatusTime':this[_0xa17f('0x33')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xa17f('0x1a')],'whatsappCapacity':this[_0xa17f('0x1b')],'whatsappCurrentCapacity':this[_0xa17f('0x34')],'openchannelStatus':this[_0xa17f('0x1c')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xa17f('0x1e')],'openchannelCurrentCapacity':this[_0xa17f('0x1f')],'busy':this[_0xa17f('0x20')],'busyQueue':this[_0xa17f('0x35')]};var _0x13c1ca=md5(JSON[_0xa17f('0x36')](_0x77c7d5));if(this[_0xa17f('0x1')]!==_0x13c1ca){this[_0xa17f('0x1')]=_0x13c1ca;io[_0xa17f('0x37')](_0xa17f('0x38'),_0x77c7d5);}};module[_0xa17f('0x39')]=Agent; \ No newline at end of file +var _0x14d0=['openchannel','fax','sms','length','getChannelStatus','Status','StatusTime','toNumber','format','mailCurrentCapacity','faxStatusTime','whatsappStatus','busy','emit','user:save','lodash','moment','md5','defaults','redis','localhost','name','online','voicePause','chatPause','mailPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','updateRealtime','prototype','Capacity','maxcapacity','working','mail'];(function(_0x55cc90,_0x4c1338){var _0x533e13=function(_0xbfe2c){while(--_0xbfe2c){_0x55cc90['push'](_0x55cc90['shift']());}};_0x533e13(++_0x4c1338);}(_0x14d0,0x127));var _0x014d=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x14d0[_0x367e5b];return _0x4b909e;};'use strict';var _=require(_0x014d('0x0'));var moment=require(_0x014d('0x1'));var md5=require(_0x014d('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x014d('0x3')](config[_0x014d('0x4')],{'host':_0x014d('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x014d('0x4')]));function Agent(_0x4b5892){this['id']=_0x4b5892['id']||0x0;this[_0x014d('0x6')]=_0x4b5892[_0x014d('0x6')]||'';this[_0x014d('0x7')]=_0x4b5892['online']||!![];this['voicePause']=_0x4b5892[_0x014d('0x8')]||![];this[_0x014d('0x9')]=_0x4b5892[_0x014d('0x9')]||![];this[_0x014d('0xa')]=_0x4b5892['mailPause']||![];this['faxPause']=_0x4b5892['faxPause']||![];this[_0x014d('0xb')]=_0x4b5892[_0x014d('0xb')]||![];this[_0x014d('0xc')]=_0x4b5892[_0x014d('0xc')]||![];this[_0x014d('0xd')]=_0x014d('0xe');this[_0x014d('0xf')]=0x0;this[_0x014d('0x10')]=_0x4b5892[_0x014d('0x10')]||0x0;this[_0x014d('0x11')]=0x0;this[_0x014d('0x12')]=_0x014d('0xe');this[_0x014d('0x13')]=0x0;this[_0x014d('0x14')]=_0x4b5892[_0x014d('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x014d('0x15')]='unknown';this['faxStatusTime']=0x0;this[_0x014d('0x16')]=_0x4b5892['faxCapacity']||0x0;this[_0x014d('0x17')]=0x0;this[_0x014d('0x18')]=_0x014d('0xe');this[_0x014d('0x19')]=0x0;this[_0x014d('0x1a')]=_0x4b5892[_0x014d('0x1a')]||0x0;this[_0x014d('0x1b')]=0x0;this['whatsappStatus']=_0x014d('0xe');this[_0x014d('0x1c')]=0x0;this['whatsappCapacity']=_0x4b5892['whatsappCapacity']||0x0;this[_0x014d('0x1d')]=0x0;this[_0x014d('0x1e')]=_0x014d('0xe');this[_0x014d('0x1f')]=0x0;this['openchannelCapacity']=_0x4b5892[_0x014d('0x20')]||0x0;this[_0x014d('0x21')]=0x0;this['busy']=![];this[_0x014d('0x22')]=undefined;this[_0x014d('0x2')]='';this[_0x014d('0x23')]();}Agent[_0x014d('0x24')]['getChannelStatus']=function(_0x25f271){if(this[_0x25f271+'CurrentCapacity']>0x0){if(this[_0x25f271+'Capacity']>0x0&&this[_0x25f271+'CurrentCapacity']>=this[_0x25f271+_0x014d('0x25')]){return _0x014d('0x26');}else{return _0x014d('0x27');}}else{return'idle';}};Agent[_0x014d('0x24')][_0x014d('0x23')]=function(){var _0x598e37=[_0x014d('0x28'),'chat',_0x014d('0x29'),_0x014d('0x2a'),_0x014d('0x2b'),'whatsapp'];for(var _0xab5cc8=0x0;_0xab5cc8<_0x598e37[_0x014d('0x2c')];_0xab5cc8+=0x1){var _0x5a89fe=this[_0x014d('0x2d')](_0x598e37[_0xab5cc8]);if(this[_0x598e37[_0xab5cc8]+_0x014d('0x2e')]!==_0x5a89fe){this[_0x598e37[_0xab5cc8]+_0x014d('0x2f')]=_[_0x014d('0x30')](moment()[_0x014d('0x31')]('x'));}this[_0x598e37[_0xab5cc8]+_0x014d('0x2e')]=_0x5a89fe;}var _0x598a11={'id':this['id'],'name':this[_0x014d('0x6')],'online':this['online'],'voicePause':this[_0x014d('0x8')],'chatPause':this['chatPause'],'mailPause':this[_0x014d('0xa')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0x014d('0xc')],'chatStatus':this[_0x014d('0xd')],'chatStatusTime':this[_0x014d('0xf')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x014d('0x11')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x014d('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x014d('0x32')],'faxStatus':this[_0x014d('0x15')],'faxStatusTime':this[_0x014d('0x33')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x014d('0x19')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x014d('0x1b')],'whatsappStatus':this[_0x014d('0x34')],'whatsappStatusTime':this[_0x014d('0x1c')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x014d('0x1d')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x014d('0x1f')],'openchannelCapacity':this[_0x014d('0x20')],'openchannelCurrentCapacity':this[_0x014d('0x21')],'busy':this[_0x014d('0x35')],'busyQueue':this['busyQueue']};var _0x593bfc=md5(JSON['stringify'](_0x598a11));if(this[_0x014d('0x2')]!==_0x593bfc){this['md5']=_0x593bfc;io[_0x014d('0x36')](_0x014d('0x37'),_0x598a11);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 4247ae8..f8bdd40 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 _0x116f=['strategy','beepall','Agents','updateRouting','updateRealtime','mapAgentsId','map','_rr','paused','online','available','waiting','stringify','format','chat:queue:%s','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x353af4,_0x114c45){var _0x1375b0=function(_0x4db7a6){while(--_0x4db7a6){_0x353af4['push'](_0x353af4['shift']());}};_0x1375b0(++_0x114c45);}(_0x116f,0x1dc));var _0xf116=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x116f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf116('0x0'));var md5=require(_0xf116('0x1'));var util=require(_0xf116('0x2'));var Redis=require('ioredis');var config=require(_0xf116('0x3'));config[_0xf116('0x4')]=_[_0xf116('0x5')](config['redis'],{'host':_0xf116('0x6'),'port':0x18eb});var io=require(_0xf116('0x7'))(new Redis(config['redis']));function ChatQueue(_0xa14595){this['id']=_0xa14595['id']||0x0;this[_0xf116('0x8')]=_0xa14595[_0xf116('0x8')]||'';this[_0xf116('0x9')]=_0xa14595['timeout']||0xa;this[_0xf116('0xa')]=_0xa14595[_0xf116('0xa')]||_0xf116('0xb');this[_0xf116('0xc')]=_0xa14595[_0xf116('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0xf116('0xd')]();this[_0xf116('0xe')]();}ChatQueue['prototype'][_0xf116('0xd')]=function(){var _0xf124cd=this['mapAgentsId']['_rr'];this[_0xf116('0xf')]=_[_0xf116('0x10')](this[_0xf116('0xc')],'id');this['mapAgentsId'][_0xf116('0x11')]=_0xf124cd;};ChatQueue['prototype'][_0xf116('0xe')]=function(){this['loggedIn']=0x0;this[_0xf116('0x12')]=0x0;for(var _0x14c0aa=0x0;_0x14c0aa=0x0?this['available']:0x0;var _0x185cdb={'id':this['id'],'available':this[_0xf116('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xf116('0x8')],'paused':this['paused'],'waiting':this[_0xf116('0x15')]};var _0x13147d=md5(JSON[_0xf116('0x16')](_0x185cdb));if(this[_0xf116('0x1')]!==_0x13147d){this[_0xf116('0x1')]=_0x13147d;io['to'](util[_0xf116('0x17')](_0xf116('0x18'),_0x185cdb[_0xf116('0x8')]))['emit'](_0xf116('0x19'),_0x185cdb);}};module[_0xf116('0x1a')]=ChatQueue; \ No newline at end of file +var _0xf0d3=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','chatPause','available','chat:queue:%s','chat_queue:save','exports','lodash','md5','../../../config/environment','redis','socket.io-emitter','name','timeout','beepall'];(function(_0x3a8cab,_0x375ef7){var _0x2be7ad=function(_0x4a1164){while(--_0x4a1164){_0x3a8cab['push'](_0x3a8cab['shift']());}};_0x2be7ad(++_0x375ef7);}(_0xf0d3,0xd0));var _0x3f0d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf0d3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3f0d('0x0'));var md5=require(_0x3f0d('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x3f0d('0x2'));config[_0x3f0d('0x3')]=_['defaults'](config[_0x3f0d('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x3f0d('0x4'))(new Redis(config[_0x3f0d('0x3')]));function ChatQueue(_0x1358d2){this['id']=_0x1358d2['id']||0x0;this[_0x3f0d('0x5')]=_0x1358d2[_0x3f0d('0x5')]||'';this['timeout']=_0x1358d2[_0x3f0d('0x6')]||0xa;this['strategy']=_0x1358d2['strategy']||_0x3f0d('0x7');this[_0x3f0d('0x8')]=_0x1358d2[_0x3f0d('0x8')];this[_0x3f0d('0x9')]={};this[_0x3f0d('0xa')]=0x0;this[_0x3f0d('0x1')]='';this[_0x3f0d('0xb')]();this[_0x3f0d('0xc')]();}ChatQueue[_0x3f0d('0xd')][_0x3f0d('0xb')]=function(){var _0x535bec=this[_0x3f0d('0x9')]['_rr'];this[_0x3f0d('0x9')]=_['map'](this[_0x3f0d('0x8')],'id');this[_0x3f0d('0x9')][_0x3f0d('0xe')]=_0x535bec;};ChatQueue[_0x3f0d('0xd')]['updateRealtime']=function(){this[_0x3f0d('0xf')]=0x0;this[_0x3f0d('0x10')]=0x0;for(var _0x3cd257=0x0;_0x3cd257=0x0?this['available']:0x0;var _0x11f5cf={'id':this['id'],'available':this[_0x3f0d('0x14')],'loggedIn':this[_0x3f0d('0xf')],'name':this[_0x3f0d('0x5')],'paused':this[_0x3f0d('0x10')],'waiting':this['waiting']};var _0x31531b=md5(JSON['stringify'](_0x11f5cf));if(this[_0x3f0d('0x1')]!==_0x31531b){this[_0x3f0d('0x1')]=_0x31531b;io['to'](util['format'](_0x3f0d('0x15'),_0x11f5cf[_0x3f0d('0x5')]))['emit'](_0x3f0d('0x16'),_0x11f5cf);}};module[_0x3f0d('0x17')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 950528f..1ffb03c 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 _0x9410=['Agents','md5','updateRouting','updateRealtime','mapAgentsId','_rr','prototype','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy'];(function(_0x3b62a3,_0x96ddb){var _0x31533a=function(_0x4c468d){while(--_0x4c468d){_0x3b62a3['push'](_0x3b62a3['shift']());}};_0x31533a(++_0x96ddb);}(_0x9410,0x118));var _0x0941=function(_0xc81f2,_0x2aa3ca){_0xc81f2=_0xc81f2-0x0;var _0x18acde=_0x9410[_0xc81f2];return _0x18acde;};'use strict';var _=require(_0x0941('0x0'));var md5=require('md5');var util=require(_0x0941('0x1'));var Redis=require(_0x0941('0x2'));var config=require(_0x0941('0x3'));config[_0x0941('0x4')]=_[_0x0941('0x5')](config['redis'],{'host':_0x0941('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0941('0x4')]));function FaxQueue(_0x1cfa63){this['id']=_0x1cfa63['id']||0x0;this[_0x0941('0x7')]=_0x1cfa63[_0x0941('0x7')]||'';this['timeout']=_0x1cfa63[_0x0941('0x8')]||0xa;this['strategy']=_0x1cfa63[_0x0941('0x9')]||'beepall';this[_0x0941('0xa')]=_0x1cfa63[_0x0941('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x0941('0xb')]='';this[_0x0941('0xc')]();this[_0x0941('0xd')]();}FaxQueue['prototype'][_0x0941('0xc')]=function(){var _0x50a3e5=this[_0x0941('0xe')][_0x0941('0xf')];this[_0x0941('0xe')]=_['map'](this[_0x0941('0xa')],'id');this['mapAgentsId']['_rr']=_0x50a3e5;};FaxQueue[_0x0941('0x10')][_0x0941('0xd')]=function(){this[_0x0941('0x11')]=0x0;this[_0x0941('0x12')]=0x0;for(var _0x4baabe=0x0;_0x4baabe=0x0?this[_0x0941('0x16')]:0x0;var _0x32bec7={'id':this['id'],'available':this[_0x0941('0x16')],'loggedIn':this[_0x0941('0x11')],'name':this[_0x0941('0x7')],'paused':this[_0x0941('0x12')],'waiting':this['waiting']};var _0x22c131=md5(JSON[_0x0941('0x17')](_0x32bec7));if(this['md5']!==_0x22c131){this[_0x0941('0xb')]=_0x22c131;io['to'](util[_0x0941('0x18')](_0x0941('0x19'),_0x32bec7[_0x0941('0x7')]))[_0x0941('0x1a')](_0x0941('0x1b'),_0x32bec7);}};module[_0x0941('0x1c')]=FaxQueue; \ No newline at end of file +var _0x8c02=['updateRouting','mapAgentsId','_rr','updateRealtime','loggedIn','paused','length','faxPause','available','format','fax:queue:%s','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting'];(function(_0x418e42,_0x64ed45){var _0x4580cc=function(_0x477e22){while(--_0x477e22){_0x418e42['push'](_0x418e42['shift']());}};_0x4580cc(++_0x64ed45);}(_0x8c02,0x12b));var _0x28c0=function(_0xb8782b,_0x10ef34){_0xb8782b=_0xb8782b-0x0;var _0x1777fb=_0x8c02[_0xb8782b];return _0x1777fb;};'use strict';var _=require(_0x28c0('0x0'));var md5=require(_0x28c0('0x1'));var util=require(_0x28c0('0x2'));var Redis=require(_0x28c0('0x3'));var config=require(_0x28c0('0x4'));config[_0x28c0('0x5')]=_['defaults'](config[_0x28c0('0x5')],{'host':_0x28c0('0x6'),'port':0x18eb});var io=require(_0x28c0('0x7'))(new Redis(config['redis']));function FaxQueue(_0x570d16){this['id']=_0x570d16['id']||0x0;this[_0x28c0('0x8')]=_0x570d16[_0x28c0('0x8')]||'';this[_0x28c0('0x9')]=_0x570d16['timeout']||0xa;this[_0x28c0('0xa')]=_0x570d16[_0x28c0('0xa')]||'beepall';this['Agents']=_0x570d16[_0x28c0('0xb')];this['mapAgentsId']={};this[_0x28c0('0xc')]=0x0;this[_0x28c0('0x1')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue['prototype'][_0x28c0('0xd')]=function(){var _0xbba7a6=this[_0x28c0('0xe')][_0x28c0('0xf')];this[_0x28c0('0xe')]=_['map'](this[_0x28c0('0xb')],'id');this[_0x28c0('0xe')][_0x28c0('0xf')]=_0xbba7a6;};FaxQueue['prototype'][_0x28c0('0x10')]=function(){this[_0x28c0('0x11')]=0x0;this[_0x28c0('0x12')]=0x0;for(var _0x34e0f8=0x0;_0x34e0f8=0x0?this['available']:0x0;var _0x146ade={'id':this['id'],'available':this['available'],'loggedIn':this[_0x28c0('0x11')],'name':this[_0x28c0('0x8')],'paused':this[_0x28c0('0x12')],'waiting':this[_0x28c0('0xc')]};var _0x110e24=md5(JSON['stringify'](_0x146ade));if(this[_0x28c0('0x1')]!==_0x110e24){this[_0x28c0('0x1')]=_0x110e24;io['to'](util[_0x28c0('0x16')](_0x28c0('0x17'),_0x146ade[_0x28c0('0x8')]))['emit'](_0x28c0('0x18'),_0x146ade);}};module[_0x28c0('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 6df3a64..aee245f 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 _0xedbd=['Intervals','name'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xedbd,0x6b));var _0xdedb=function(_0x1aea28,_0x42d152){_0x1aea28=_0x1aea28-0x0;var _0x248d84=_0xedbd[_0x1aea28];return _0x248d84;};'use strict';function Interval(_0x465552){this['id']=_0x465552['id']||0x0;this[_0xdedb('0x0')]=_0x465552[_0xdedb('0x0')]||'';this[_0xdedb('0x1')]=_0x465552['Intervals']||{};}module['exports']=Interval; \ No newline at end of file +var _0xa559=['exports','name','Intervals'];(function(_0x1ce2ac,_0x5b81d4){var _0x2e7433=function(_0x57beff){while(--_0x57beff){_0x1ce2ac['push'](_0x1ce2ac['shift']());}};_0x2e7433(++_0x5b81d4);}(_0xa559,0xeb));var _0x9a55=function(_0x43cddd,_0x53ee83){_0x43cddd=_0x43cddd-0x0;var _0x5066c8=_0xa559[_0x43cddd];return _0x5066c8;};'use strict';function Interval(_0x45dd13){this['id']=_0x45dd13['id']||0x0;this['name']=_0x45dd13[_0x9a55('0x0')]||'';this[_0x9a55('0x1')]=_0x45dd13[_0x9a55('0x1')]||{};}module[_0x9a55('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 3334864..2b8f0d6 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 _0x9380=['paused','available','stringify','format','name','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9380,0x13c));var _0x0938=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x9380[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x0938('0x0'));var md5=require(_0x0938('0x1'));var util=require(_0x0938('0x2'));var Redis=require(_0x0938('0x3'));var config=require(_0x0938('0x4'));config['redis']=_[_0x0938('0x5')](config[_0x0938('0x6')],{'host':_0x0938('0x7'),'port':0x18eb});var io=require(_0x0938('0x8'))(new Redis(config[_0x0938('0x6')]));function MailQueue(_0x39723e){this['id']=_0x39723e['id']||0x0;this['name']=_0x39723e['name']||'';this[_0x0938('0x9')]=_0x39723e[_0x0938('0x9')]||0xa;this[_0x0938('0xa')]=_0x39723e[_0x0938('0xa')]||'beepall';this['Agents']=_0x39723e[_0x0938('0xb')];this[_0x0938('0xc')]={};this[_0x0938('0xd')]=0x0;this[_0x0938('0x1')]='';this[_0x0938('0xe')]();this[_0x0938('0xf')]();}MailQueue[_0x0938('0x10')][_0x0938('0xe')]=function(){var _0x43dc93=this[_0x0938('0xc')][_0x0938('0x11')];this[_0x0938('0xc')]=_[_0x0938('0x12')](this[_0x0938('0xb')],'id');this[_0x0938('0xc')][_0x0938('0x11')]=_0x43dc93;};MailQueue[_0x0938('0x10')][_0x0938('0xf')]=function(){this[_0x0938('0x13')]=0x0;this[_0x0938('0x14')]=0x0;for(var _0x53ff50=0x0;_0x53ff50=0x0?this[_0x0938('0x15')]:0x0;var _0x33d2ff={'id':this['id'],'available':this[_0x0938('0x15')],'loggedIn':this[_0x0938('0x13')],'name':this['name'],'paused':this[_0x0938('0x14')],'waiting':this[_0x0938('0xd')]};var _0x1e8bd2=md5(JSON[_0x0938('0x16')](_0x33d2ff));if(this['md5']!==_0x1e8bd2){this[_0x0938('0x1')]=_0x1e8bd2;io['to'](util[_0x0938('0x17')]('mail:queue:%s',_0x33d2ff[_0x0938('0x18')]))[_0x0938('0x19')](_0x0938('0x1a'),_0x33d2ff);}};module[_0x0938('0x1b')]=MailQueue; \ No newline at end of file +var _0x9062=['emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','mailPause','available','stringify','format'];(function(_0xd713d,_0x24eb9b){var _0x529488=function(_0x376c87){while(--_0x376c87){_0xd713d['push'](_0xd713d['shift']());}};_0x529488(++_0x24eb9b);}(_0x9062,0x12e));var _0x2906=function(_0x5404ab,_0x5bffe1){_0x5404ab=_0x5404ab-0x0;var _0x313817=_0x9062[_0x5404ab];return _0x313817;};'use strict';var _=require(_0x2906('0x0'));var md5=require(_0x2906('0x1'));var util=require(_0x2906('0x2'));var Redis=require(_0x2906('0x3'));var config=require(_0x2906('0x4'));config[_0x2906('0x5')]=_[_0x2906('0x6')](config[_0x2906('0x5')],{'host':_0x2906('0x7'),'port':0x18eb});var io=require(_0x2906('0x8'))(new Redis(config['redis']));function MailQueue(_0x396884){this['id']=_0x396884['id']||0x0;this[_0x2906('0x9')]=_0x396884[_0x2906('0x9')]||'';this[_0x2906('0xa')]=_0x396884[_0x2906('0xa')]||0xa;this[_0x2906('0xb')]=_0x396884[_0x2906('0xb')]||_0x2906('0xc');this[_0x2906('0xd')]=_0x396884[_0x2906('0xd')];this[_0x2906('0xe')]={};this[_0x2906('0xf')]=0x0;this[_0x2906('0x1')]='';this[_0x2906('0x10')]();this[_0x2906('0x11')]();}MailQueue[_0x2906('0x12')]['updateRouting']=function(){var _0x59545f=this[_0x2906('0xe')][_0x2906('0x13')];this['mapAgentsId']=_['map'](this[_0x2906('0xd')],'id');this['mapAgentsId'][_0x2906('0x13')]=_0x59545f;};MailQueue['prototype']['updateRealtime']=function(){this[_0x2906('0x14')]=0x0;this[_0x2906('0x15')]=0x0;for(var _0x535684=0x0;_0x535684=0x0?this[_0x2906('0x19')]:0x0;var _0x54e6a={'id':this['id'],'available':this[_0x2906('0x19')],'loggedIn':this[_0x2906('0x14')],'name':this[_0x2906('0x9')],'paused':this[_0x2906('0x15')],'waiting':this[_0x2906('0xf')]};var _0x4de845=md5(JSON[_0x2906('0x1a')](_0x54e6a));if(this[_0x2906('0x1')]!==_0x4de845){this[_0x2906('0x1')]=_0x4de845;io['to'](util[_0x2906('0x1b')]('mail:queue:%s',_0x54e6a[_0x2906('0x9')]))[_0x2906('0x1c')]('mail_queue:save',_0x54e6a);}};module[_0x2906('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index a82bd3d..2aa696d 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x326f,0xd1));var _0xf326=function(_0x421d7c,_0x223fc7){_0x421d7c=_0x421d7c-0x0;var _0x4c702c=_0x326f[_0x421d7c];return _0x4c702c;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc4aa[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 85e4eeb..aa09c85 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 _0x4b84=['exports','lodash','md5','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','online','available','paused','stringify','format','sms:queue:%s','emit','sms_queue:save'];(function(_0x5e4a8c,_0x4debb6){var _0x595307=function(_0x509668){while(--_0x509668){_0x5e4a8c['push'](_0x5e4a8c['shift']());}};_0x595307(++_0x4debb6);}(_0x4b84,0x1cc));var _0x44b8=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0x4b84[_0x4ed32d];return _0xf624df;};'use strict';var _=require(_0x44b8('0x0'));var md5=require(_0x44b8('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x44b8('0x2'));config['redis']=_['defaults'](config[_0x44b8('0x3')],{'host':_0x44b8('0x4'),'port':0x18eb});var io=require(_0x44b8('0x5'))(new Redis(config['redis']));function SmsQueue(_0x4f875e){this['id']=_0x4f875e['id']||0x0;this['name']=_0x4f875e[_0x44b8('0x6')]||'';this['timeout']=_0x4f875e[_0x44b8('0x7')]||0xa;this['strategy']=_0x4f875e[_0x44b8('0x8')]||'beepall';this['Agents']=_0x4f875e[_0x44b8('0x9')];this[_0x44b8('0xa')]={};this[_0x44b8('0xb')]=0x0;this['md5']='';this[_0x44b8('0xc')]();this[_0x44b8('0xd')]();}SmsQueue[_0x44b8('0xe')][_0x44b8('0xc')]=function(){var _0x24dd10=this[_0x44b8('0xa')][_0x44b8('0xf')];this['mapAgentsId']=_[_0x44b8('0x10')](this[_0x44b8('0x9')],'id');this['mapAgentsId'][_0x44b8('0xf')]=_0x24dd10;};SmsQueue['prototype'][_0x44b8('0xd')]=function(){this[_0x44b8('0x11')]=0x0;this['paused']=0x0;for(var _0x63e8f6=0x0;_0x63e8f6=0x0?this['available']:0x0;var _0x36743e={'id':this['id'],'available':this[_0x44b8('0x13')],'loggedIn':this['loggedIn'],'name':this[_0x44b8('0x6')],'paused':this[_0x44b8('0x14')],'waiting':this['waiting']};var _0xcce202=md5(JSON[_0x44b8('0x15')](_0x36743e));if(this[_0x44b8('0x1')]!==_0xcce202){this[_0x44b8('0x1')]=_0xcce202;io['to'](util[_0x44b8('0x16')](_0x44b8('0x17'),_0x36743e[_0x44b8('0x6')]))[_0x44b8('0x18')](_0x44b8('0x19'),_0x36743e);}};module[_0x44b8('0x1a')]=SmsQueue; \ No newline at end of file +var _0xeebe=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available','waiting','md5','emit','sms_queue:save','exports','lodash','util','../../../config/environment','redis','defaults','localhost'];(function(_0x59e60d,_0x29c76c){var _0x3ad3bb=function(_0x144c22){while(--_0x144c22){_0x59e60d['push'](_0x59e60d['shift']());}};_0x3ad3bb(++_0x29c76c);}(_0xeebe,0xff));var _0xeeeb=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xeebe[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0xeeeb('0x0'));var md5=require('md5');var util=require(_0xeeeb('0x1'));var Redis=require('ioredis');var config=require(_0xeeeb('0x2'));config[_0xeeeb('0x3')]=_[_0xeeeb('0x4')](config[_0xeeeb('0x3')],{'host':_0xeeeb('0x5'),'port':0x18eb});var io=require(_0xeeeb('0x6'))(new Redis(config[_0xeeeb('0x3')]));function SmsQueue(_0x1d5c27){this['id']=_0x1d5c27['id']||0x0;this[_0xeeeb('0x7')]=_0x1d5c27[_0xeeeb('0x7')]||'';this[_0xeeeb('0x8')]=_0x1d5c27[_0xeeeb('0x8')]||0xa;this[_0xeeeb('0x9')]=_0x1d5c27[_0xeeeb('0x9')]||_0xeeeb('0xa');this[_0xeeeb('0xb')]=_0x1d5c27[_0xeeeb('0xb')];this[_0xeeeb('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0xeeeb('0xd')]();this[_0xeeeb('0xe')]();}SmsQueue[_0xeeeb('0xf')]['updateRouting']=function(){var _0x3eb739=this[_0xeeeb('0xc')][_0xeeeb('0x10')];this['mapAgentsId']=_[_0xeeeb('0x11')](this['Agents'],'id');this['mapAgentsId'][_0xeeeb('0x10')]=_0x3eb739;};SmsQueue[_0xeeeb('0xf')][_0xeeeb('0xe')]=function(){this[_0xeeeb('0x12')]=0x0;this[_0xeeeb('0x13')]=0x0;for(var _0x1bf055=0x0;_0x1bf055=0x0?this[_0xeeeb('0x17')]:0x0;var _0x37efe6={'id':this['id'],'available':this[_0xeeeb('0x17')],'loggedIn':this[_0xeeeb('0x12')],'name':this[_0xeeeb('0x7')],'paused':this[_0xeeeb('0x13')],'waiting':this[_0xeeeb('0x18')]};var _0x434cdf=md5(JSON['stringify'](_0x37efe6));if(this[_0xeeeb('0x19')]!==_0x434cdf){this['md5']=_0x434cdf;io['to'](util['format']('sms:queue:%s',_0x37efe6['name']))[_0xeeeb('0x1a')](_0xeeeb('0x1b'),_0x37efe6);}};module[_0xeeeb('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 9c0a212..53cfeef 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 _0xf3d3=['ioredis','defaults','redis','localhost','timeout','strategy','Agents','waiting','updateRouting','prototype','mapAgentsId','map','updateRealtime','loggedIn','paused','length','online','whatsappPause','available','stringify','whatsapp:queue:%s','name','emit','exports','lodash','md5','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf3d3,0x9f));var _0x3f3d=function(_0x52a5a3,_0x3cadf7){_0x52a5a3=_0x52a5a3-0x0;var _0x57e356=_0xf3d3[_0x52a5a3];return _0x57e356;};'use strict';var _=require(_0x3f3d('0x0'));var md5=require(_0x3f3d('0x1'));var util=require(_0x3f3d('0x2'));var Redis=require(_0x3f3d('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x3f3d('0x4')](config[_0x3f3d('0x5')],{'host':_0x3f3d('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3f3d('0x5')]));function WhatsappQueue(_0x2a7d13){this['id']=_0x2a7d13['id']||0x0;this['name']=_0x2a7d13['name']||'';this[_0x3f3d('0x7')]=_0x2a7d13[_0x3f3d('0x7')]||0xa;this[_0x3f3d('0x8')]=_0x2a7d13['strategy']||'beepall';this['Agents']=_0x2a7d13[_0x3f3d('0x9')];this['mapAgentsId']={};this[_0x3f3d('0xa')]=0x0;this[_0x3f3d('0x1')]='';this[_0x3f3d('0xb')]();this['updateRealtime']();}WhatsappQueue[_0x3f3d('0xc')][_0x3f3d('0xb')]=function(){var _0x4165ae=this[_0x3f3d('0xd')]['_rr'];this[_0x3f3d('0xd')]=_[_0x3f3d('0xe')](this[_0x3f3d('0x9')],'id');this['mapAgentsId']['_rr']=_0x4165ae;};WhatsappQueue[_0x3f3d('0xc')][_0x3f3d('0xf')]=function(){this[_0x3f3d('0x10')]=0x0;this[_0x3f3d('0x11')]=0x0;for(var _0x26a405=0x0;_0x26a405=0x0?this[_0x3f3d('0x15')]:0x0;var _0x288417={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3f3d('0x10')],'name':this['name'],'paused':this[_0x3f3d('0x11')],'waiting':this[_0x3f3d('0xa')]};var _0x4060f6=md5(JSON[_0x3f3d('0x16')](_0x288417));if(this[_0x3f3d('0x1')]!==_0x4060f6){this['md5']=_0x4060f6;io['to'](util['format'](_0x3f3d('0x17'),_0x288417[_0x3f3d('0x18')]))[_0x3f3d('0x19')]('whatsapp_queue:save',_0x288417);}};module[_0x3f3d('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0xb581=['defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','map','loggedIn','paused','length','online','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','md5','util','ioredis','redis'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xb581,0xec));var _0x1b58=function(_0x538fcc,_0x2c71be){_0x538fcc=_0x538fcc-0x0;var _0x2c8894=_0xb581[_0x538fcc];return _0x2c8894;};'use strict';var _=require('lodash');var md5=require(_0x1b58('0x0'));var util=require(_0x1b58('0x1'));var Redis=require(_0x1b58('0x2'));var config=require('../../../config/environment');config[_0x1b58('0x3')]=_[_0x1b58('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1b58('0x5'))(new Redis(config[_0x1b58('0x3')]));function WhatsappQueue(_0x5b4c9e){this['id']=_0x5b4c9e['id']||0x0;this[_0x1b58('0x6')]=_0x5b4c9e[_0x1b58('0x6')]||'';this[_0x1b58('0x7')]=_0x5b4c9e[_0x1b58('0x7')]||0xa;this[_0x1b58('0x8')]=_0x5b4c9e[_0x1b58('0x8')]||'beepall';this[_0x1b58('0x9')]=_0x5b4c9e['Agents'];this[_0x1b58('0xa')]={};this[_0x1b58('0xb')]=0x0;this[_0x1b58('0x0')]='';this[_0x1b58('0xc')]();this[_0x1b58('0xd')]();}WhatsappQueue['prototype'][_0x1b58('0xc')]=function(){var _0x2d0deb=this[_0x1b58('0xa')]['_rr'];this[_0x1b58('0xa')]=_[_0x1b58('0xe')](this[_0x1b58('0x9')],'id');this[_0x1b58('0xa')]['_rr']=_0x2d0deb;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0x1b58('0xf')]=0x0;this[_0x1b58('0x10')]=0x0;for(var _0x59d913=0x0;_0x59d913=0x0?this[_0x1b58('0x13')]:0x0;var _0x280b51={'id':this['id'],'available':this[_0x1b58('0x13')],'loggedIn':this[_0x1b58('0xf')],'name':this[_0x1b58('0x6')],'paused':this['paused'],'waiting':this[_0x1b58('0xb')]};var _0x2fe4c3=md5(JSON[_0x1b58('0x14')](_0x280b51));if(this['md5']!==_0x2fe4c3){this['md5']=_0x2fe4c3;io['to'](util['format'](_0x1b58('0x15'),_0x280b51['name']))[_0x1b58('0x16')](_0x1b58('0x17'),_0x280b51);}};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 cb6109a..60cbe23 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(_0xc0ccae,_0x8379f8){var _0x579ac1=function(_0x3e85a2){while(--_0x3e85a2){_0xc0ccae['push'](_0xc0ccae['shift']());}};_0x579ac1(++_0x8379f8);}(_0xb10b,0x12a));var _0xbb10=function(_0x12a06b,_0x417b51){_0x12a06b=_0x12a06b-0x0;var _0x5d0bb8=_0xb10b[_0x12a06b];return _0x5d0bb8;};'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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 f18f94f..37554cd 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 _0xc1d3=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x2f49a2,_0x47d94a){var _0x24f5a3=function(_0x4c4178){while(--_0x4c4178){_0x2f49a2['push'](_0x2f49a2['shift']());}};_0x24f5a3(++_0x47d94a);}(_0xc1d3,0x18b));var _0x3c1d=function(_0x46def0,_0x294988){_0x46def0=_0x46def0-0x0;var _0x1d3a37=_0xc1d3[_0x46def0];return _0x1d3a37;};'use strict';var client=require('../client');exports['update']=function(_0x1bec96,_0x2d13cc){return client[_0x3c1d('0x0')](_0x3c1d('0x1'),{'body':_0x2d13cc,'options':{'where':{'id':_0x1bec96}},'log':_0x3c1d('0x2')});};exports[_0x3c1d('0x3')]=function(_0x4668ce,_0x31db41){return client['Request'](_0x3c1d('0x4'),{'body':_0x31db41,'options':{'where':{'id':_0x4668ce}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x7bdd=['Request','UpdateChatInteraction','updateChatInteraction','addTags','addTagsToChatInteraction','../client','update'];(function(_0x1e6803,_0x4c54b0){var _0x438f72=function(_0x2283f1){while(--_0x2283f1){_0x1e6803['push'](_0x1e6803['shift']());}};_0x438f72(++_0x4c54b0);}(_0x7bdd,0x140));var _0xd7bd=function(_0x3a4510,_0x36fbe6){_0x3a4510=_0x3a4510-0x0;var _0x45eea0=_0x7bdd[_0x3a4510];return _0x45eea0;};'use strict';var client=require(_0xd7bd('0x0'));exports[_0xd7bd('0x1')]=function(_0x525a76,_0x2ab496){return client[_0xd7bd('0x2')](_0xd7bd('0x3'),{'body':_0x2ab496,'options':{'where':{'id':_0x525a76}},'log':_0xd7bd('0x4')});};exports[_0xd7bd('0x5')]=function(_0x3dc915,_0x38e842){return client[_0xd7bd('0x2')]('AddTagsToChatInteraction',{'body':_0x38e842,'options':{'where':{'id':_0x3dc915}},'log':_0xd7bd('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 76dab1a..e718cbf 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 _0x5fe7=['create','CreateChatMessage','createChatMessage','../client'];(function(_0x4b6f27,_0x354f3e){var _0x2bba90=function(_0x185056){while(--_0x185056){_0x4b6f27['push'](_0x4b6f27['shift']());}};_0x2bba90(++_0x354f3e);}(_0x5fe7,0x107));var _0x75fe=function(_0x2affb0,_0x1e5503){_0x2affb0=_0x2affb0-0x0;var _0x5e1013=_0x5fe7[_0x2affb0];return _0x5e1013;};'use strict';var client=require(_0x75fe('0x0'));exports[_0x75fe('0x1')]=function(_0x1bd80f){return client['Request'](_0x75fe('0x2'),{'body':_0x1bd80f,'log':_0x75fe('0x3')});}; \ No newline at end of file +var _0x123e=['CreateChatMessage','createChatMessage','create','Request'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0x123e,0x196));var _0xe123=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x123e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xe123('0x0')]=function(_0x51b643){return client[_0xe123('0x1')](_0xe123('0x2'),{'body':_0x51b643,'log':_0xe123('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index b33fe08..f7d7f19 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 _0x770d=['../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','Agents','online','chatPause'];(function(_0x11383b,_0x30c2a0){var _0x2a27ea=function(_0x202ab0){while(--_0x202ab0){_0x11383b['push'](_0x11383b['shift']());}};_0x2a27ea(++_0x30c2a0);}(_0x770d,0x122));var _0xd770=function(_0x237b1d,_0x1706e9){_0x237b1d=_0x237b1d-0x0;var _0x27fdbe=_0x770d[_0x237b1d];return _0x27fdbe;};'use strict';var client=require(_0xd770('0x0'));exports[_0xd770('0x1')]=function(){return function(){return client[_0xd770('0x2')](_0xd770('0x3'),{'options':{'raw':![],'attributes':['id',_0xd770('0x4'),_0xd770('0x5'),_0xd770('0x6')],'include':[{'model':'User','as':_0xd770('0x7'),'attributes':['id',_0xd770('0x4'),_0xd770('0x8'),_0xd770('0x9')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x02a7=['User','Agents','online','getChatQueues','name','timeout','strategy'];(function(_0x156cbc,_0x45bddf){var _0x47b3cd=function(_0x53afea){while(--_0x53afea){_0x156cbc['push'](_0x156cbc['shift']());}};_0x47b3cd(++_0x45bddf);}(_0x02a7,0x7a));var _0x702a=function(_0x48f79e,_0x1ac3c8){_0x48f79e=_0x48f79e-0x0;var _0x4f1dc1=_0x02a7[_0x48f79e];return _0x4f1dc1;};'use strict';var client=require('../client');exports[_0x702a('0x0')]=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x702a('0x1'),_0x702a('0x2'),_0x702a('0x3')],'include':[{'model':_0x702a('0x4'),'as':_0x702a('0x5'),'attributes':['id',_0x702a('0x1'),_0x702a('0x6'),'chatPause']}]},'log':_0x702a('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index e535efb..e9f0432 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 _0x0487=['create','Request','CreateChatQueueReport','UpdateChatQueueReport','DESC','../client'];(function(_0x2cc21c,_0x4ceefa){var _0x59e4ea=function(_0x4e86d6){while(--_0x4e86d6){_0x2cc21c['push'](_0x2cc21c['shift']());}};_0x59e4ea(++_0x4ceefa);}(_0x0487,0x14f));var _0x7048=function(_0x4d8dc3,_0x585fd1){_0x4d8dc3=_0x4d8dc3-0x0;var _0x9b03d9=_0x0487[_0x4d8dc3];return _0x9b03d9;};'use strict';var client=require(_0x7048('0x0'));exports[_0x7048('0x1')]=function(_0x438ba4){return client[_0x7048('0x2')](_0x7048('0x3'),{'body':_0x438ba4,'log':_0x7048('0x3')});};exports['update']=function(_0x2adc11,_0x4e8f94){return client[_0x7048('0x2')](_0x7048('0x4'),{'body':_0x4e8f94,'options':{'where':{'uniqueid':_0x2adc11},'order':[['id',_0x7048('0x5')]],'limit':0x1},'log':_0x7048('0x4')});}; \ No newline at end of file +var _0x9de3=['../client','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x33c050,_0x52e6e5){var _0x5b0d0a=function(_0x3dfb67){while(--_0x3dfb67){_0x33c050['push'](_0x33c050['shift']());}};_0x5b0d0a(++_0x52e6e5);}(_0x9de3,0xea));var _0x39de=function(_0x10de81,_0x2ce449){_0x10de81=_0x10de81-0x0;var _0x3d02ee=_0x9de3[_0x10de81];return _0x3d02ee;};'use strict';var client=require(_0x39de('0x0'));exports['create']=function(_0x15cb04){return client[_0x39de('0x1')](_0x39de('0x2'),{'body':_0x15cb04,'log':'CreateChatQueueReport'});};exports[_0x39de('0x3')]=function(_0x515fba,_0x1010da){return client[_0x39de('0x1')](_0x39de('0x4'),{'body':_0x1010da,'options':{'where':{'uniqueid':_0x515fba},'order':[['id',_0x39de('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 4a16fb0..09d8215 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0x7a54,0x106));var _0x47a5=function(_0x43b5c7,_0x12151d){_0x43b5c7=_0x43b5c7-0x0;var _0x377081=_0x7a54[_0x43b5c7];return _0x377081;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x1e9bad,_0x43e307){var _0x48392c=function(_0x389bb1){while(--_0x389bb1){_0x1e9bad['push'](_0x1e9bad['shift']());}};_0x48392c(++_0x43e307);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 47fcc94..c3e6005 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 _0xc754=['CreateFaxMessage','createFaxMessage','Request'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xc754,0xe9));var _0x4c75=function(_0x210372,_0x6e9c32){_0x210372=_0x210372-0x0;var _0x3f1138=_0xc754[_0x210372];return _0x3f1138;};'use strict';var client=require('../client');exports['create']=function(_0x573d0b){return client[_0x4c75('0x0')](_0x4c75('0x1'),{'body':_0x573d0b,'log':_0x4c75('0x2')});}; \ No newline at end of file +var _0x6b1d=['createFaxMessage','CreateFaxMessage'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x6b1d,0xd1));var _0xd6b1=function(_0x1a6007,_0x350755){_0x1a6007=_0x1a6007-0x0;var _0x120665=_0x6b1d[_0x1a6007];return _0x120665;};'use strict';var client=require('../client');exports['create']=function(_0x5ac415){return client['Request'](_0xd6b1('0x0'),{'body':_0x5ac415,'log':_0xd6b1('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 4cd9047..1853291 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 _0xbc7b=['faxPause','getFaxQueues','../client','Request','name','timeout','strategy','online'];(function(_0x1bf41b,_0x4ad4e7){var _0x3f7a52=function(_0x226d5a){while(--_0x226d5a){_0x1bf41b['push'](_0x1bf41b['shift']());}};_0x3f7a52(++_0x4ad4e7);}(_0xbc7b,0x82));var _0xbbc7=function(_0x3fc275,_0x40b8b2){_0x3fc275=_0x3fc275-0x0;var _0x383f3a=_0xbc7b[_0x3fc275];return _0x383f3a;};'use strict';var client=require(_0xbbc7('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xbbc7('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xbbc7('0x2'),_0xbbc7('0x3'),_0xbbc7('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xbbc7('0x2'),_0xbbc7('0x5'),_0xbbc7('0x6')]}]},'log':_0xbbc7('0x7')});};}; \ No newline at end of file +var _0x363b=['name','online','faxPause','getFaxQueues','Request','GetFaxQueue','strategy','User','Agents'];(function(_0x5ac862,_0x4e833b){var _0x25bd6c=function(_0x527551){while(--_0x527551){_0x5ac862['push'](_0x5ac862['shift']());}};_0x25bd6c(++_0x4e833b);}(_0x363b,0x17d));var _0xb363=function(_0x15e06d,_0x4a6f77){_0x15e06d=_0x15e06d-0x0;var _0xdd4cde=_0x363b[_0x15e06d];return _0xdd4cde;};'use strict';var client=require('../client');exports[_0xb363('0x0')]=function(){return function(){return client[_0xb363('0x1')](_0xb363('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xb363('0x3')],'include':[{'model':_0xb363('0x4'),'as':_0xb363('0x5'),'attributes':['id',_0xb363('0x6'),_0xb363('0x7'),_0xb363('0x8')]}]},'log':_0xb363('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index bc5de6a..f7211a4 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 _0x84c8=['update','UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport'];(function(_0x2fa848,_0x3e683e){var _0x1e7976=function(_0x25fd4e){while(--_0x25fd4e){_0x2fa848['push'](_0x2fa848['shift']());}};_0x1e7976(++_0x3e683e);}(_0x84c8,0xd5));var _0x884c=function(_0x28a3ca,_0x6a989e){_0x28a3ca=_0x28a3ca-0x0;var _0xa3ad9=_0x84c8[_0x28a3ca];return _0xa3ad9;};'use strict';var client=require(_0x884c('0x0'));exports[_0x884c('0x1')]=function(_0x174f1d){return client[_0x884c('0x2')](_0x884c('0x3'),{'body':_0x174f1d,'log':_0x884c('0x3')});};exports[_0x884c('0x4')]=function(_0x51a7af,_0xccd3e0){return client[_0x884c('0x2')](_0x884c('0x5'),{'body':_0xccd3e0,'options':{'where':{'uniqueid':_0x51a7af},'order':[['id',_0x884c('0x6')]],'limit':0x1},'log':_0x884c('0x5')});}; \ No newline at end of file +var _0xeb90=['DESC','../client','create','Request','CreateFaxQueueReport','update'];(function(_0xb1aec6,_0x102c14){var _0x126bc5=function(_0x120c3c){while(--_0x120c3c){_0xb1aec6['push'](_0xb1aec6['shift']());}};_0x126bc5(++_0x102c14);}(_0xeb90,0x1b7));var _0x0eb9=function(_0x5b28c6,_0x2e5693){_0x5b28c6=_0x5b28c6-0x0;var _0x359ff7=_0xeb90[_0x5b28c6];return _0x359ff7;};'use strict';var client=require(_0x0eb9('0x0'));exports[_0x0eb9('0x1')]=function(_0xbf12b6){return client[_0x0eb9('0x2')](_0x0eb9('0x3'),{'body':_0xbf12b6,'log':'CreateFaxQueueReport'});};exports[_0x0eb9('0x4')]=function(_0x4cc336,_0x4ad6f3){return client['Request']('UpdateFaxQueueReport',{'body':_0x4ad6f3,'options':{'where':{'uniqueid':_0x4cc336},'order':[['id',_0x0eb9('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index c0c0031..12886a9 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 _0xca90=['Intervals','interval','../client','getIntervals','Request','GetInterval','name'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xca90,0xcd));var _0x0ca9=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xca90[_0xbd08b4];return _0x314f1e;};'use strict';var client=require(_0x0ca9('0x0'));exports[_0x0ca9('0x1')]=function(){return function(){return client[_0x0ca9('0x2')](_0x0ca9('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x0ca9('0x4')],'include':[{'model':'Interval','as':_0x0ca9('0x5'),'attributes':['id','name',_0x0ca9('0x6')]}]},'log':_0x0ca9('0x1')});};}; \ No newline at end of file +var _0xd63b=['getIntervals','Request','Interval','Intervals','name','interval','../client'];(function(_0x5d808c,_0x22bbf6){var _0x11d463=function(_0x4574dc){while(--_0x4574dc){_0x5d808c['push'](_0x5d808c['shift']());}};_0x11d463(++_0x22bbf6);}(_0xd63b,0xe6));var _0xbd63=function(_0x23788d,_0x7d4d67){_0x23788d=_0x23788d-0x0;var _0x16f9fe=_0xd63b[_0x23788d];return _0x16f9fe;};'use strict';var client=require(_0xbd63('0x0'));exports[_0xbd63('0x1')]=function(){return function(){return client[_0xbd63('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xbd63('0x3'),'as':_0xbd63('0x4'),'attributes':['id',_0xbd63('0x5'),_0xbd63('0x6')]}]},'log':_0xbd63('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 4fab68b..dc13f1d 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 _0x5464=['update','Request','updateMailInteraction','AddTagsToMailInteraction','../client'];(function(_0x4f0ff4,_0x5f47f8){var _0x5acc43=function(_0x208914){while(--_0x208914){_0x4f0ff4['push'](_0x4f0ff4['shift']());}};_0x5acc43(++_0x5f47f8);}(_0x5464,0x15d));var _0x4546=function(_0x2d1465,_0xa31b1f){_0x2d1465=_0x2d1465-0x0;var _0x1c35eb=_0x5464[_0x2d1465];return _0x1c35eb;};'use strict';var client=require(_0x4546('0x0'));exports[_0x4546('0x1')]=function(_0x159e14,_0x4f33fd){return client[_0x4546('0x2')]('UpdateMailInteraction',{'body':_0x4f33fd,'options':{'where':{'id':_0x159e14}},'log':_0x4546('0x3')});};exports['addTags']=function(_0x320c4d,_0x396a1d){return client[_0x4546('0x2')](_0x4546('0x4'),{'body':_0x396a1d,'options':{'where':{'id':_0x320c4d}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x160f=['UpdateMailInteraction','updateMailInteraction','addTags','Request','addTagsToChatInteraction','../client','update'];(function(_0x2c065a,_0x44e071){var _0x16dcf0=function(_0x4ef63d){while(--_0x4ef63d){_0x2c065a['push'](_0x2c065a['shift']());}};_0x16dcf0(++_0x44e071);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xf160('0x0'));exports[_0xf160('0x1')]=function(_0x2d4cde,_0x2966aa){return client['Request'](_0xf160('0x2'),{'body':_0x2966aa,'options':{'where':{'id':_0x2d4cde}},'log':_0xf160('0x3')});};exports[_0xf160('0x4')]=function(_0x3b2d7b,_0x194331){return client[_0xf160('0x5')]('AddTagsToMailInteraction',{'body':_0x194331,'options':{'where':{'id':_0x3b2d7b}},'log':_0xf160('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 262b51c..03b1cb2 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 _0x9633=['../client','create','Request'];(function(_0x774b57,_0x39cbc0){var _0x11f47f=function(_0x330172){while(--_0x330172){_0x774b57['push'](_0x774b57['shift']());}};_0x11f47f(++_0x39cbc0);}(_0x9633,0x177));var _0x3963=function(_0x221641,_0xdac853){_0x221641=_0x221641-0x0;var _0x5ca081=_0x9633[_0x221641];return _0x5ca081;};'use strict';var client=require(_0x3963('0x0'));exports[_0x3963('0x1')]=function(_0x4bb24){return client[_0x3963('0x2')]('CreateMailMessage',{'body':_0x4bb24,'log':'createMailMessage'});}; \ No newline at end of file +var _0xa204=['Request','CreateMailMessage','createMailMessage','../client'];(function(_0x929c7e,_0x38c4cc){var _0x5de099=function(_0xc4e8d8){while(--_0xc4e8d8){_0x929c7e['push'](_0x929c7e['shift']());}};_0x5de099(++_0x38c4cc);}(_0xa204,0x6b));var _0x4a20=function(_0x20b0c3,_0xd45622){_0x20b0c3=_0x20b0c3-0x0;var _0x1f556a=_0xa204[_0x20b0c3];return _0x1f556a;};'use strict';var client=require(_0x4a20('0x0'));exports['create']=function(_0x85488b){return client[_0x4a20('0x1')](_0x4a20('0x2'),{'body':_0x85488b,'log':_0x4a20('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index ffc61db..0f1cbab 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 _0x014b=['strategy','User','online','mailPause','../client','getMailQueues','Request','name','timeout'];(function(_0x2a5c50,_0x25029b){var _0x235703=function(_0x1ab118){while(--_0x1ab118){_0x2a5c50['push'](_0x2a5c50['shift']());}};_0x235703(++_0x25029b);}(_0x014b,0x13f));var _0xb014=function(_0x1ebe55,_0x17e463){_0x1ebe55=_0x1ebe55-0x0;var _0x240610=_0x014b[_0x1ebe55];return _0x240610;};'use strict';var client=require(_0xb014('0x0'));exports[_0xb014('0x1')]=function(){return function(){return client[_0xb014('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xb014('0x3'),_0xb014('0x4'),_0xb014('0x5')],'include':[{'model':_0xb014('0x6'),'as':'Agents','attributes':['id','name',_0xb014('0x7'),_0xb014('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xd86e=['Request','GetMailQueue','name','timeout','strategy','User','Agents','../client','getMailQueues'];(function(_0x5ca5bc,_0x5b8a9d){var _0x26ca86=function(_0x1ad9a6){while(--_0x1ad9a6){_0x5ca5bc['push'](_0x5ca5bc['shift']());}};_0x26ca86(++_0x5b8a9d);}(_0xd86e,0xfa));var _0xed86=function(_0x169c3b,_0x59d284){_0x169c3b=_0x169c3b-0x0;var _0x426be4=_0xd86e[_0x169c3b];return _0x426be4;};'use strict';var client=require(_0xed86('0x0'));exports[_0xed86('0x1')]=function(){return function(){return client[_0xed86('0x2')](_0xed86('0x3'),{'options':{'raw':![],'attributes':['id',_0xed86('0x4'),_0xed86('0x5'),_0xed86('0x6')],'include':[{'model':_0xed86('0x7'),'as':_0xed86('0x8'),'attributes':['id','name','online','mailPause']}]},'log':_0xed86('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 43d995c..a8dd244 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 _0xa6f0=['UpdateMailQueueReport','create','update'];(function(_0x590f0a,_0x44fb7d){var _0x289e59=function(_0x3d56f7){while(--_0x3d56f7){_0x590f0a['push'](_0x590f0a['shift']());}};_0x289e59(++_0x44fb7d);}(_0xa6f0,0xbb));var _0x0a6f=function(_0x5008c0,_0x4b612d){_0x5008c0=_0x5008c0-0x0;var _0x19a989=_0xa6f0[_0x5008c0];return _0x19a989;};'use strict';var client=require('../client');exports[_0x0a6f('0x0')]=function(_0x1b32cb){return client['Request']('CreateMailQueueReport',{'body':_0x1b32cb,'log':'CreateMailQueueReport'});};exports[_0x0a6f('0x1')]=function(_0x37a89e,_0xf42573){return client['Request'](_0x0a6f('0x2'),{'body':_0xf42573,'options':{'where':{'uniqueid':_0x37a89e},'order':[['id','DESC']],'limit':0x1},'log':_0x0a6f('0x2')});}; \ No newline at end of file +var _0xa1bc=['update','UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0x248a6f,_0x95b8d6){var _0x2fbe66=function(_0x306764){while(--_0x306764){_0x248a6f['push'](_0x248a6f['shift']());}};_0x2fbe66(++_0x95b8d6);}(_0xa1bc,0xd5));var _0xca1b=function(_0x391b49,_0xc938cf){_0x391b49=_0x391b49-0x0;var _0x457dde=_0xa1bc[_0x391b49];return _0x457dde;};'use strict';var client=require(_0xca1b('0x0'));exports[_0xca1b('0x1')]=function(_0x5944d7){return client[_0xca1b('0x2')](_0xca1b('0x3'),{'body':_0x5944d7,'log':'CreateMailQueueReport'});};exports[_0xca1b('0x4')]=function(_0x134a0a,_0x302c9e){return client[_0xca1b('0x2')](_0xca1b('0x5'),{'body':_0x302c9e,'options':{'where':{'uniqueid':_0x134a0a},'order':[['id',_0xca1b('0x6')]],'limit':0x1},'log':_0xca1b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 7c5ea59..fda966b 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 _0x4a36=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x255ceb,_0x52b2af){var _0x2fc52c=function(_0x510d64){while(--_0x510d64){_0x255ceb['push'](_0x255ceb['shift']());}};_0x2fc52c(++_0x52b2af);}(_0x4a36,0x14c));var _0x64a3=function(_0x47c271,_0x742bc8){_0x47c271=_0x47c271-0x0;var _0x21082c=_0x4a36[_0x47c271];return _0x21082c;};'use strict';var client=require(_0x64a3('0x0'));exports[_0x64a3('0x1')]=function(_0x268dbc,_0x5065ba){return client[_0x64a3('0x2')](_0x64a3('0x3'),{'body':_0x5065ba,'options':{'where':{'id':_0x268dbc}},'log':_0x64a3('0x4')});};exports[_0x64a3('0x5')]=function(_0x3b4e8d,_0x2ab287){return client['Request'](_0x64a3('0x6'),{'body':_0x2ab287,'options':{'where':{'id':_0x3b4e8d}},'log':_0x64a3('0x7')});}; \ No newline at end of file +var _0x5ab9=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','addTagsToChatInteraction','../client','update','Request'];(function(_0x362d6a,_0x253e0d){var _0x2af49e=function(_0x4a43f8){while(--_0x4a43f8){_0x362d6a['push'](_0x362d6a['shift']());}};_0x2af49e(++_0x253e0d);}(_0x5ab9,0xb3));var _0x95ab=function(_0x4fb122,_0x38df6a){_0x4fb122=_0x4fb122-0x0;var _0x78527=_0x5ab9[_0x4fb122];return _0x78527;};'use strict';var client=require(_0x95ab('0x0'));exports[_0x95ab('0x1')]=function(_0x58fc33,_0x3e022a){return client[_0x95ab('0x2')](_0x95ab('0x3'),{'body':_0x3e022a,'options':{'where':{'id':_0x58fc33}},'log':_0x95ab('0x4')});};exports[_0x95ab('0x5')]=function(_0xaec242,_0xff87b6){return client[_0x95ab('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0xff87b6,'options':{'where':{'id':_0xaec242}},'log':_0x95ab('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 37a0bbf..638301f 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 _0x6bb4=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x2d9fff,_0x9ac863){var _0x2960fa=function(_0x3b5cc5){while(--_0x3b5cc5){_0x2d9fff['push'](_0x2d9fff['shift']());}};_0x2960fa(++_0x9ac863);}(_0x6bb4,0x126));var _0x46bb=function(_0x29949a,_0x4a4340){_0x29949a=_0x29949a-0x0;var _0xd5220c=_0x6bb4[_0x29949a];return _0xd5220c;};'use strict';var client=require(_0x46bb('0x0'));exports[_0x46bb('0x1')]=function(_0x4285f7){return client['Request'](_0x46bb('0x2'),{'body':_0x4285f7,'log':_0x46bb('0x3')});}; \ No newline at end of file +var _0x4d33=['create','Request','CreateOpenchannelMessage'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4d33,0x159));var _0x34d3=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0x4d33[_0xe1b5f6];return _0x44636e;};'use strict';var client=require('../client');exports[_0x34d3('0x0')]=function(_0x4aabae){return client[_0x34d3('0x1')](_0x34d3('0x2'),{'body':_0x4aabae,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index f55062f..16ef720 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 _0x46a2=['name','User','Agents','online','openchannelPause','../client','getOpenchannelQueues'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x46a2,0xfa));var _0x246a=function(_0x4f0c2b,_0x2c9d14){_0x4f0c2b=_0x4f0c2b-0x0;var _0x526436=_0x46a2[_0x4f0c2b];return _0x526436;};'use strict';var client=require(_0x246a('0x0'));exports[_0x246a('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x246a('0x2'),'timeout','strategy'],'include':[{'model':_0x246a('0x3'),'as':_0x246a('0x4'),'attributes':['id',_0x246a('0x2'),_0x246a('0x5'),_0x246a('0x6')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xe8dc=['Request','name','timeout','User','online','../client'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0xe8dc,0x6b));var _0xce8d=function(_0x3f2fea,_0x3c4ea8){_0x3f2fea=_0x3f2fea-0x0;var _0x69a4d5=_0xe8dc[_0x3f2fea];return _0x69a4d5;};'use strict';var client=require(_0xce8d('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xce8d('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xce8d('0x2'),_0xce8d('0x3'),'strategy'],'include':[{'model':_0xce8d('0x4'),'as':'Agents','attributes':['id',_0xce8d('0x2'),_0xce8d('0x5'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 65ee35a..a9c2218 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 _0x76d2=['create','Request','update','DESC','UpdateOpenchannelQueueReport'];(function(_0xa7ab4e,_0x454cc3){var _0x41f3be=function(_0x35fdf0){while(--_0x35fdf0){_0xa7ab4e['push'](_0xa7ab4e['shift']());}};_0x41f3be(++_0x454cc3);}(_0x76d2,0x6e));var _0x276d=function(_0x6b18e,_0x16061f){_0x6b18e=_0x6b18e-0x0;var _0x4429b3=_0x76d2[_0x6b18e];return _0x4429b3;};'use strict';var client=require('../client');exports[_0x276d('0x0')]=function(_0x101d71){return client[_0x276d('0x1')]('CreateOpenchannelQueueReport',{'body':_0x101d71,'log':'CreateOpenchannelQueueReport'});};exports[_0x276d('0x2')]=function(_0x121db7,_0x59fd2f){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x59fd2f,'options':{'where':{'uniqueid':_0x121db7},'order':[['id',_0x276d('0x3')]],'limit':0x1},'log':_0x276d('0x4')});}; \ No newline at end of file +var _0x07c3=['UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x33fc41,_0x28a196){var _0x193557=function(_0x423d0c){while(--_0x423d0c){_0x33fc41['push'](_0x33fc41['shift']());}};_0x193557(++_0x28a196);}(_0x07c3,0x14b));var _0x307c=function(_0x1fd5eb,_0x235203){_0x1fd5eb=_0x1fd5eb-0x0;var _0x102365=_0x07c3[_0x1fd5eb];return _0x102365;};'use strict';var client=require(_0x307c('0x0'));exports[_0x307c('0x1')]=function(_0x1bf278){return client[_0x307c('0x2')](_0x307c('0x3'),{'body':_0x1bf278,'log':'CreateOpenchannelQueueReport'});};exports[_0x307c('0x4')]=function(_0x3aa94b,_0x5355f7){return client[_0x307c('0x2')](_0x307c('0x5'),{'body':_0x5355f7,'options':{'where':{'uniqueid':_0x3aa94b},'order':[['id',_0x307c('0x6')]],'limit':0x1},'log':_0x307c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index f587c17..1af7690 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 _0x1696=['addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x515ee9,_0x246b9b){var _0x109cc2=function(_0xa74af9){while(--_0xa74af9){_0x515ee9['push'](_0x515ee9['shift']());}};_0x109cc2(++_0x246b9b);}(_0x1696,0x79));var _0x6169=function(_0x541b3d,_0x41ef56){_0x541b3d=_0x541b3d-0x0;var _0x54f541=_0x1696[_0x541b3d];return _0x54f541;};'use strict';var client=require(_0x6169('0x0'));exports['update']=function(_0x358707,_0x42e140){return client[_0x6169('0x1')](_0x6169('0x2'),{'body':_0x42e140,'options':{'where':{'id':_0x358707}},'log':_0x6169('0x3')});};exports[_0x6169('0x4')]=function(_0x357aaf,_0x10d0ab){return client[_0x6169('0x1')]('AddTagsToSmsInteraction',{'body':_0x10d0ab,'options':{'where':{'id':_0x357aaf}},'log':_0x6169('0x5')});}; \ No newline at end of file +var _0xc7b4=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xc7b4,0x15e));var _0x4c7b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7b4[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x4c7b('0x0'));exports['update']=function(_0x6edfa6,_0x14a4c3){return client['Request'](_0x4c7b('0x1'),{'body':_0x14a4c3,'options':{'where':{'id':_0x6edfa6}},'log':_0x4c7b('0x2')});};exports[_0x4c7b('0x3')]=function(_0x2a8b1d,_0x109687){return client['Request'](_0x4c7b('0x4'),{'body':_0x109687,'options':{'where':{'id':_0x2a8b1d}},'log':_0x4c7b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 8b0f964..06dbf1f 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 _0xa912=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x419d9b,_0x1d0323){var _0x597b13=function(_0x1853ac){while(--_0x1853ac){_0x419d9b['push'](_0x419d9b['shift']());}};_0x597b13(++_0x1d0323);}(_0xa912,0x1e4));var _0x2a91=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xa912[_0x11005e];return _0x29338f;};'use strict';var client=require(_0x2a91('0x0'));exports[_0x2a91('0x1')]=function(_0x5bfb53){return client[_0x2a91('0x2')](_0x2a91('0x3'),{'body':_0x5bfb53,'log':_0x2a91('0x4')});}; \ No newline at end of file +var _0x9f09=['CreateSmsMessage','create','Request'];(function(_0x4ae24b,_0x58c9b0){var _0x573d23=function(_0x3a8f25){while(--_0x3a8f25){_0x4ae24b['push'](_0x4ae24b['shift']());}};_0x573d23(++_0x58c9b0);}(_0x9f09,0x157));var _0x99f0=function(_0x2ca024,_0x4c1321){_0x2ca024=_0x2ca024-0x0;var _0x2d5651=_0x9f09[_0x2ca024];return _0x2d5651;};'use strict';var client=require('../client');exports[_0x99f0('0x0')]=function(_0x40e42c){return client[_0x99f0('0x1')](_0x99f0('0x2'),{'body':_0x40e42c,'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 5e8f8cd..6e07f86 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 _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x8e0efd,_0x96b4e0){var _0x1a5647=function(_0xde3021){while(--_0xde3021){_0x8e0efd['push'](_0x8e0efd['shift']());}};_0x1a5647(++_0x96b4e0);}(_0xe706,0xa3));var _0x6e70=function(_0x45adb4,_0x2abb06){_0x45adb4=_0x45adb4-0x0;var _0x137296=_0xe706[_0x45adb4];return _0x137296;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x152aa1,_0x307718){var _0x1bc01a=function(_0xd3211e){while(--_0xd3211e){_0x152aa1['push'](_0x152aa1['shift']());}};_0x1bc01a(++_0x307718);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 8f2e18a..6bb16e7 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x1a68bb,_0x318df5){var _0x54c90a=function(_0x334f79){while(--_0x334f79){_0x1a68bb['push'](_0x1a68bb['shift']());}};_0x54c90a(++_0x318df5);}(_0x34e8,0x12c));var _0x834e=function(_0x1efd25,_0x5cfa88){_0x1efd25=_0x1efd25-0x0;var _0x49746c=_0x34e8[_0x1efd25];return _0x49746c;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x4e3b9c,_0x4d76a3){var _0x358b13=function(_0x2409d6){while(--_0x2409d6){_0x4e3b9c['push'](_0x4e3b9c['shift']());}};_0x358b13(++_0x4d76a3);}(_0x008c,0x188));var _0xc008=function(_0x56500a,_0x5953c7){_0x56500a=_0x56500a-0x0;var _0x333977=_0x008c[_0x56500a];return _0x333977;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 325344d..a41761d 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(_0x423184,_0x33835b){var _0x1cbe66=function(_0x2b7640){while(--_0x2b7640){_0x423184['push'](_0x423184['shift']());}};_0x1cbe66(++_0x33835b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x1474bb,_0x486735){var _0x1cea7c=function(_0xf3fe04){while(--_0xf3fe04){_0x1474bb['push'](_0x1474bb['shift']());}};_0x1cea7c(++_0x486735);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 1ad569c..57c14c7 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 _0x5b47=['addTags','Request','AddTagsToWhatsappInteraction','../client','update'];(function(_0x251597,_0x3ffa57){var _0x4c8d25=function(_0x2bc575){while(--_0x2bc575){_0x251597['push'](_0x251597['shift']());}};_0x4c8d25(++_0x3ffa57);}(_0x5b47,0x120));var _0x75b4=function(_0x11d115,_0x37c707){_0x11d115=_0x11d115-0x0;var _0x5a0583=_0x5b47[_0x11d115];return _0x5a0583;};'use strict';var client=require(_0x75b4('0x0'));exports[_0x75b4('0x1')]=function(_0x5ee71e,_0x5c0b0c){return client['Request']('UpdateWhatsappInteraction',{'body':_0x5c0b0c,'options':{'where':{'id':_0x5ee71e}},'log':'updateWhatsappInteraction'});};exports[_0x75b4('0x2')]=function(_0x42359f,_0x37497c){return client[_0x75b4('0x3')](_0x75b4('0x4'),{'body':_0x37497c,'options':{'where':{'id':_0x42359f}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0xd9fb=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','../client','update','Request'];(function(_0x2d909e,_0x1f8783){var _0x20f89e=function(_0x383d25){while(--_0x383d25){_0x2d909e['push'](_0x2d909e['shift']());}};_0x20f89e(++_0x1f8783);}(_0xd9fb,0x189));var _0xbd9f=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xd9fb[_0x9aada2];return _0x196dff;};'use strict';var client=require(_0xbd9f('0x0'));exports[_0xbd9f('0x1')]=function(_0x288314,_0x1eeb46){return client[_0xbd9f('0x2')](_0xbd9f('0x3'),{'body':_0x1eeb46,'options':{'where':{'id':_0x288314}},'log':_0xbd9f('0x4')});};exports['addTags']=function(_0x2d4213,_0xf146bc){return client['Request'](_0xbd9f('0x5'),{'body':_0xf146bc,'options':{'where':{'id':_0x2d4213}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index cf56c67..981c606 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 _0xd19b=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x2e872b,_0xcfab68){var _0xa71e27=function(_0x3044df){while(--_0x3044df){_0x2e872b['push'](_0x2e872b['shift']());}};_0xa71e27(++_0xcfab68);}(_0xd19b,0xe4));var _0xbd19=function(_0x37e845,_0x219f9f){_0x37e845=_0x37e845-0x0;var _0x59e55b=_0xd19b[_0x37e845];return _0x59e55b;};'use strict';var client=require(_0xbd19('0x0'));exports[_0xbd19('0x1')]=function(_0x2a5e4c){return client[_0xbd19('0x2')](_0xbd19('0x3'),{'body':_0x2a5e4c,'log':_0xbd19('0x4')});}; \ No newline at end of file +var _0x18c0=['../client','create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x31bcb8,_0x309e87){var _0x3d48eb=function(_0x42927a){while(--_0x42927a){_0x31bcb8['push'](_0x31bcb8['shift']());}};_0x3d48eb(++_0x309e87);}(_0x18c0,0x109));var _0x018c=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x18c0[_0x178e48];return _0x440d7e;};'use strict';var client=require(_0x018c('0x0'));exports[_0x018c('0x1')]=function(_0x26e50f){return client[_0x018c('0x2')](_0x018c('0x3'),{'body':_0x26e50f,'log':_0x018c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 5949ba8..2b8bd53 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 _0xb326=['getWhatsappQueues','GetWhatsappQueue','name','strategy','Agents','whatsappPause','../client'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0xb326,0x156));var _0x6b32=function(_0x40e249,_0x16c243){_0x40e249=_0x40e249-0x0;var _0x26d473=_0xb326[_0x40e249];return _0x26d473;};'use strict';var client=require(_0x6b32('0x0'));exports[_0x6b32('0x1')]=function(){return function(){return client['Request'](_0x6b32('0x2'),{'options':{'raw':![],'attributes':['id',_0x6b32('0x3'),'timeout',_0x6b32('0x4')],'include':[{'model':'User','as':_0x6b32('0x5'),'attributes':['id',_0x6b32('0x3'),'online',_0x6b32('0x6')]}]},'log':_0x6b32('0x1')});};}; \ No newline at end of file +var _0x1f9e=['whatsappPause','getWhatsappQueues','Request','name','timeout','strategy','User','Agents'];(function(_0x1d5e40,_0x1976ff){var _0x3e7143=function(_0x1c7753){while(--_0x1c7753){_0x1d5e40['push'](_0x1d5e40['shift']());}};_0x3e7143(++_0x1976ff);}(_0x1f9e,0x129));var _0xe1f9=function(_0x5dfc2a,_0x1a953f){_0x5dfc2a=_0x5dfc2a-0x0;var _0x3f1a71=_0x1f9e[_0x5dfc2a];return _0x3f1a71;};'use strict';var client=require('../client');exports[_0xe1f9('0x0')]=function(){return function(){return client[_0xe1f9('0x1')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xe1f9('0x2'),_0xe1f9('0x3'),_0xe1f9('0x4')],'include':[{'model':_0xe1f9('0x5'),'as':_0xe1f9('0x6'),'attributes':['id',_0xe1f9('0x2'),'online',_0xe1f9('0x7')]}]},'log':_0xe1f9('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 1b0e6d6..cdf30f2 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 _0x0891=['DESC','../client','create','CreateWhatsappQueueReport','update','Request','UpdateWhatsappQueueReport'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0891,0x71));var _0x1089=function(_0x23760a,_0x3343dc){_0x23760a=_0x23760a-0x0;var _0x5ad2f2=_0x0891[_0x23760a];return _0x5ad2f2;};'use strict';var client=require(_0x1089('0x0'));exports[_0x1089('0x1')]=function(_0x3227d3){return client['Request'](_0x1089('0x2'),{'body':_0x3227d3,'log':_0x1089('0x2')});};exports[_0x1089('0x3')]=function(_0x2c6996,_0x4be04c){return client[_0x1089('0x4')](_0x1089('0x5'),{'body':_0x4be04c,'options':{'where':{'uniqueid':_0x2c6996},'order':[['id',_0x1089('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0xdab9=['../client','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x536e77,_0x199b1f){var _0x33b236=function(_0x50e42b){while(--_0x50e42b){_0x536e77['push'](_0x536e77['shift']());}};_0x33b236(++_0x199b1f);}(_0xdab9,0x173));var _0x9dab=function(_0x25a5ab,_0x486e9b){_0x25a5ab=_0x25a5ab-0x0;var _0x445e57=_0xdab9[_0x25a5ab];return _0x445e57;};'use strict';var client=require(_0x9dab('0x0'));exports[_0x9dab('0x1')]=function(_0x1733c9){return client[_0x9dab('0x2')]('CreateWhatsappQueueReport',{'body':_0x1733c9,'log':_0x9dab('0x3')});};exports[_0x9dab('0x4')]=function(_0x58a61d,_0x29a318){return client[_0x9dab('0x2')](_0x9dab('0x5'),{'body':_0x29a318,'options':{'where':{'uniqueid':_0x58a61d},'order':[['id',_0x9dab('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 00063c2..a151810 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 _0x66de=['routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','message','join','stop','find','timeout','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stack','validate','seq-queue','../../../../config/logger'];(function(_0x243913,_0x4a98fa){var _0x440148=function(_0x57cb0b){while(--_0x57cb0b){_0x243913['push'](_0x243913['shift']());}};_0x440148(++_0x4a98fa);}(_0x66de,0xa2));var _0xe66d=function(_0x560623,_0x5c748a){_0x560623=_0x560623-0x0;var _0x2a9089=_0x66de[_0x560623];return _0x2a9089;};'use strict';var schema=require(_0xe66d('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0xe66d('0x1'));var logger=require(_0xe66d('0x2'))(_0xe66d('0x3'));var strategy=require(_0xe66d('0x4'));var queue=schema({'name':{'type':_0xe66d('0x5'),'required':!![],'message':_0xe66d('0x6')},'timeout':{'type':_0xe66d('0x7'),'message':_0xe66d('0x8')}});function writeLog(_0x196a67,_0x4bfb15,_0x3cb42e){return logger[_0xe66d('0x9')](util[_0xe66d('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x196a67,_0x4bfb15['name'],_0x3cb42e));}function handleFindAgent(_0x43dbc9){return function(_0x8f17f8){return _0x8f17f8[_0xe66d('0xb')][_0xe66d('0xc')]()===_0x43dbc9['toLowerCase']();};}exports[_0xe66d('0xd')]=function(_0x55e829,_0x21ff14,_0x3b585f,_0x25cd32){return function(_0x14a1d5){try{var _0x30ad5b={'name':_0x21ff14[0x0],'timeout':_0x21ff14[0x1]};var _0xda17ca=queue[_0xe66d('0x0')](_0x30ad5b,{'typecast':!![]});if(_0xda17ca[_0xe66d('0xe')]){logger['error'](_0xe66d('0xf'),_0x55e829,_[_0xe66d('0x10')](_0xda17ca,_0xe66d('0x11'))[_0xe66d('0x12')](',\x20'));_0x14a1d5[_0xe66d('0x13')]();}else{var _0x17c2e2=_[_0xe66d('0x14')](_0x3b585f['agents'],handleFindAgent(_0x30ad5b['name']));if(_0x17c2e2){var _0x4754dc=(_0x30ad5b[_0xe66d('0x15')]||0xa)*0x3e8;var _0x2a1a48,_0x302c11;var _0x55039b=seqqueue['createQueue'](_0x4754dc);_0x55039b['id']=_0x55e829;_0x55039b[_0xe66d('0x16')]=_0x4754dc;_0x55039b['channel']=_0x25cd32[_0xe66d('0x17')];writeLog(_0x55e829,_0x17c2e2,util['format'](_0xe66d('0x18'),_0x4754dc));_0x3b585f[_0xe66d('0x19')][_0x55e829]['on'](_0xe66d('0x1a'),function(){logger[_0xe66d('0x9')](_0xe66d('0x1b'),_0x55e829);clearTimeout(_0x302c11);_0x302c11=undefined;_0x55039b['close']();if(_0x3b585f[_0xe66d('0x19')][_0x55e829]){delete _0x3b585f[_0xe66d('0x19')][_0x55e829];}_0x14a1d5[_0xe66d('0x13')]();});_0x3b585f[_0xe66d('0x19')][_0x55e829]['on'](_0xe66d('0x1c'),function(){if(_0x3b585f[_0xe66d('0x19')][_0x55e829]){delete _0x3b585f[_0xe66d('0x19')][_0x55e829];}});_0x302c11=setTimeout(function(){logger[_0xe66d('0x9')](_0xe66d('0x1d'),_0x55e829);clearTimeout(_0x302c11);_0x55039b['close']();_0x14a1d5['next']();},_0x4754dc);strategy['agent'](_0x55039b,_0x17c2e2,_0x3b585f,_0x25cd32);}else{logger[_0xe66d('0x1e')](_0xe66d('0x1f'),_0x55e829,_0x30ad5b[_0xe66d('0xb')]);_0x14a1d5[_0xe66d('0x13')]();}}}catch(_0x11eb1d){console['log'](_0x11eb1d);logger[_0xe66d('0x1e')]('[%s][QUEUE]\x20%s',_0x55e829,_0x11eb1d[_0xe66d('0x20')]);_0x14a1d5[_0xe66d('0x13')]();}};}; \ No newline at end of file +var _0x4f4f=['atimeout','channel','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','message','join','stop','agents','timeout'];(function(_0x4f1651,_0xc4ac4f){var _0x44868e=function(_0x2a2ec1){while(--_0x2a2ec1){_0x4f1651['push'](_0x4f1651['shift']());}};_0x44868e(++_0xc4ac4f);}(_0x4f4f,0xa3));var _0xf4f4=function(_0x1dd6e7,_0x1cda2b){_0x1dd6e7=_0x1dd6e7-0x0;var _0xb53aa4=_0x4f4f[_0x1dd6e7];return _0xb53aa4;};'use strict';var schema=require(_0xf4f4('0x0'));var _=require(_0xf4f4('0x1'));var util=require(_0xf4f4('0x2'));var seqqueue=require(_0xf4f4('0x3'));var logger=require(_0xf4f4('0x4'))(_0xf4f4('0x5'));var strategy=require(_0xf4f4('0x6'));var queue=schema({'name':{'type':_0xf4f4('0x7'),'required':!![],'message':_0xf4f4('0x8')},'timeout':{'type':_0xf4f4('0x9'),'message':_0xf4f4('0xa')}});function writeLog(_0x5b01e8,_0xc2bc3a,_0x569f71){return logger['info'](util[_0xf4f4('0xb')](_0xf4f4('0xc'),_0x5b01e8,_0xc2bc3a[_0xf4f4('0xd')],_0x569f71));}function handleFindAgent(_0x2e0061){return function(_0x2c8286){return _0x2c8286[_0xf4f4('0xd')][_0xf4f4('0xe')]()===_0x2e0061[_0xf4f4('0xe')]();};}exports[_0xf4f4('0xf')]=function(_0x38e19d,_0x280a6b,_0x2cab44,_0x212a91){return function(_0x57e5e3){try{var _0x306604={'name':_0x280a6b[0x0],'timeout':_0x280a6b[0x1]};var _0x58af11=queue[_0xf4f4('0x0')](_0x306604,{'typecast':!![]});if(_0x58af11['length']){logger[_0xf4f4('0x10')]('[%s][AGENT]\x20%s',_0x38e19d,_['map'](_0x58af11,_0xf4f4('0x11'))[_0xf4f4('0x12')](',\x20'));_0x57e5e3[_0xf4f4('0x13')]();}else{var _0x59674b=_['find'](_0x2cab44[_0xf4f4('0x14')],handleFindAgent(_0x306604[_0xf4f4('0xd')]));if(_0x59674b){var _0x782683=(_0x306604[_0xf4f4('0x15')]||0xa)*0x3e8;var _0x4da339,_0x504c23;var _0x42f6df=seqqueue['createQueue'](_0x782683);_0x42f6df['id']=_0x38e19d;_0x42f6df[_0xf4f4('0x16')]=_0x782683;_0x42f6df[_0xf4f4('0x17')]=_0x212a91[_0xf4f4('0x17')];writeLog(_0x38e19d,_0x59674b,util[_0xf4f4('0xb')]('START:%s',_0x782683));_0x2cab44[_0xf4f4('0x18')][_0x38e19d]['on'](_0xf4f4('0x19'),function(){logger[_0xf4f4('0x1a')](_0xf4f4('0x1b'),_0x38e19d);clearTimeout(_0x504c23);_0x504c23=undefined;_0x42f6df[_0xf4f4('0x1c')]();if(_0x2cab44[_0xf4f4('0x18')][_0x38e19d]){delete _0x2cab44[_0xf4f4('0x18')][_0x38e19d];}_0x57e5e3['stop']();});_0x2cab44[_0xf4f4('0x18')][_0x38e19d]['on'](_0xf4f4('0x1d'),function(){if(_0x2cab44[_0xf4f4('0x18')][_0x38e19d]){delete _0x2cab44['rules'][_0x38e19d];}});_0x504c23=setTimeout(function(){logger['info'](_0xf4f4('0x1e'),_0x38e19d);clearTimeout(_0x504c23);_0x42f6df[_0xf4f4('0x1c')]();_0x57e5e3[_0xf4f4('0x1f')]();},_0x782683);strategy[_0xf4f4('0x20')](_0x42f6df,_0x59674b,_0x2cab44,_0x212a91);}else{logger[_0xf4f4('0x10')](_0xf4f4('0x21'),_0x38e19d,_0x306604[_0xf4f4('0xd')]);_0x57e5e3['stop']();}}}catch(_0x570db3){console[_0xf4f4('0x22')](_0x570db3);logger[_0xf4f4('0x10')](_0xf4f4('0x23'),_0x38e19d,_0x570db3[_0xf4f4('0x24')]);_0x57e5e3[_0xf4f4('0x13')]();}};}; \ 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 e3a7904..6dbe19b 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 _0x17b6=['body','error','finally','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','amazonlex','providerName','providerResponse','stringify','dialogState','Failed','catch','lodash','moment','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','channel','whatsapp','phone','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','Message','create','then'];(function(_0x5dd036,_0x3109a6){var _0x6b2816=function(_0x18cc49){while(--_0x18cc49){_0x5dd036['push'](_0x5dd036['shift']());}};_0x6b2816(++_0x3109a6);}(_0x17b6,0xf7));var _0x617b=function(_0x2ffd33,_0x380485){_0x2ffd33=_0x2ffd33-0x0;var _0x154e13=_0x17b6[_0x2ffd33];return _0x154e13;};'use strict';var _=require(_0x617b('0x0'));var moment=require(_0x617b('0x1'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x617b('0x2')),'openchannelMessage':require(_0x617b('0x3')),'mailMessage':require(_0x617b('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x617b('0x5')),'whatsappMessage':require(_0x617b('0x6'))};exports['consequence']=function(_0x3088f3,_0x2ca647){return function(_0x502d56){try{if(!_['isNil'](this[_0x617b('0x7')][_0x617b('0x8')])){logger['info'](_0x617b('0x9'),_0x3088f3,_0x617b('0xa'));return _0x502d56[_0x617b('0xb')]();}var _0x45271c={'ContactId':this[_0x617b('0xc')]['id'],'sentAt':moment()[_0x617b('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x617b('0xe')]==='sms'||this[_0x617b('0xe')]===_0x617b('0xf')){_0x45271c['phone']=this[_0x617b('0x7')][_0x617b('0x10')];}var _0x196ba6=this[_0x617b('0xe')];if(_0x196ba6===_0x617b('0x11')){_0x45271c[_0x617b('0x12')]=this['account']['id'];}else{_0x45271c[_['upperFirst'](_0x196ba6)+_0x617b('0x13')]=this[_0x617b('0x14')]['id'];}_0x45271c[_[_0x617b('0x15')](_0x196ba6)+_0x617b('0x16')]=this[_0x617b('0x7')]['id'];if(this[_0x617b('0x7')][_0x617b('0x17')]){var _0x47b826=_0x2ca647[0x4];if(!_[_0x617b('0x18')](_0x47b826)){_0x45271c['body']=utils[_0x617b('0x19')](_0x47b826,this);return rpc[_0x196ba6+_0x617b('0x1a')][_0x617b('0x1b')](_0x45271c)[_0x617b('0x1c')](function(_0x40ab9d){logger['info'](_0x617b('0x9'),_0x3088f3,_0x45271c[_0x617b('0x1d')]);})['catch'](function(_0x2583ad){logger[_0x617b('0x1e')](_0x617b('0x9'),_0x3088f3,JSON['stringify'](_0x2583ad));})[_0x617b('0x1f')](function(){logger[_0x617b('0x20')](_0x617b('0x21'),_0x3088f3);_0x502d56[_0x617b('0x22')]();});}else{logger[_0x617b('0x20')](_0x617b('0x23'),_0x3088f3);_0x502d56[_0x617b('0x22')]();}}else{var _0x3acd09=this;var _0x3edc07=new AWS['LexRuntime']({'accessKeyId':_0x2ca647[0x0],'secretAccessKey':_0x2ca647[0x1],'region':_0x2ca647[0x2]});var _0x24a5cf={'botAlias':_0x617b('0x24'),'botName':_0x2ca647[0x3],'inputText':this[_0x617b('0x25')][_0x617b('0x1d')],'userId':this[_0x617b('0xe')]+':'+this[_0x617b('0x7')]['id'][_0x617b('0x26')]()};_0x3edc07['postText'](_0x24a5cf,function(_0x114b35,_0x195c83){if(_0x114b35){logger[_0x617b('0x1e')](_0x617b('0x9'),_0x3088f3,_0x114b35[_0x617b('0x25')]);_0x502d56['next']();}else if(_0x195c83&&_0x195c83['message']){_0x3acd09['body'][_0x617b('0x27')]=_0x195c83;_0x45271c[_0x617b('0x1d')]=_0x195c83['message'];_0x45271c[_0x617b('0x28')]=_0x617b('0x27');_0x45271c[_0x617b('0x29')]=JSON[_0x617b('0x2a')](_0x195c83);return rpc[_0x196ba6+'Message'][_0x617b('0x1b')](_0x45271c)[_0x617b('0x1c')](function(_0x437ba7){logger[_0x617b('0x20')](_0x617b('0x9'),_0x3088f3,_0x45271c[_0x617b('0x1d')]);if(_0x195c83[_0x617b('0x2b')]==_0x617b('0x2c')){_0x502d56[_0x617b('0xb')]();}else{_0x502d56[_0x617b('0x22')]();}})[_0x617b('0x2d')](function(_0x2abf39){logger[_0x617b('0x1e')](_0x617b('0x9'),_0x3088f3,JSON[_0x617b('0x2a')](_0x2abf39));_0x502d56[_0x617b('0xb')]();});}else{_0x502d56[_0x617b('0xb')]();}});}}catch(_0x7c1b02){logger[_0x617b('0x1e')](_0x617b('0x9'),_0x3088f3,JSON[_0x617b('0x2a')](_0x7c1b02));_0x502d56[_0x617b('0x22')]();}};}; \ No newline at end of file +var _0x6635=['../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','error','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','postText','next','amazonlex','providerName','providerResponse','stringify','dialogState','Failed','catch','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage'];(function(_0x598edf,_0x1b11a0){var _0x2a8553=function(_0x455bf9){while(--_0x455bf9){_0x598edf['push'](_0x598edf['shift']());}};_0x2a8553(++_0x1b11a0);}(_0x6635,0x90));var _0x5663=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x6635[_0x3305de];return _0x3b5a84;};'use strict';var _=require('lodash');var moment=require(_0x5663('0x0'));var AWS=require(_0x5663('0x1'));var utils=require(_0x5663('0x2'));var logger=require(_0x5663('0x3'))('routing');var rpc={'chatMessage':require(_0x5663('0x4')),'openchannelMessage':require(_0x5663('0x5')),'mailMessage':require(_0x5663('0x6')),'smsMessage':require(_0x5663('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5663('0x8'))};exports[_0x5663('0x9')]=function(_0x554df4,_0x4693f6){return function(_0x29354f){try{if(!_[_0x5663('0xa')](this[_0x5663('0xb')][_0x5663('0xc')])){logger[_0x5663('0xd')]('[%s][AMAZONLEX]\x20%s',_0x554df4,_0x5663('0xe'));return _0x29354f['next']();}var _0x444adf={'ContactId':this[_0x5663('0xf')]['id'],'sentAt':moment()[_0x5663('0x10')](_0x5663('0x11')),'direction':_0x5663('0x12')};if(this[_0x5663('0x13')]==='sms'||this[_0x5663('0x13')]===_0x5663('0x14')){_0x444adf[_0x5663('0x15')]=this[_0x5663('0xb')][_0x5663('0x15')];}var _0x2fa9a2=this['channel'];if(_0x2fa9a2===_0x5663('0x16')){_0x444adf[_0x5663('0x17')]=this[_0x5663('0x18')]['id'];}else{_0x444adf[_[_0x5663('0x19')](_0x2fa9a2)+_0x5663('0x1a')]=this[_0x5663('0x18')]['id'];}_0x444adf[_[_0x5663('0x19')](_0x2fa9a2)+_0x5663('0x1b')]=this[_0x5663('0xb')]['id'];if(this['interaction'][_0x5663('0x1c')]){var _0x258c07=_0x4693f6[0x4];if(!_['isEmpty'](_0x258c07)){_0x444adf[_0x5663('0x1d')]=utils[_0x5663('0x1e')](_0x258c07,this);return rpc[_0x2fa9a2+_0x5663('0x1f')][_0x5663('0x20')](_0x444adf)[_0x5663('0x21')](function(_0x2f1d2f){logger[_0x5663('0xd')](_0x5663('0x22'),_0x554df4,_0x444adf[_0x5663('0x1d')]);})['catch'](function(_0x10c333){logger[_0x5663('0x23')](_0x5663('0x22'),_0x554df4,JSON['stringify'](_0x10c333));})['finally'](function(){logger['info'](_0x5663('0x24'),_0x554df4);_0x29354f['stop']();});}else{logger[_0x5663('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x554df4);_0x29354f[_0x5663('0x25')]();}}else{var _0x3b76f9=this;var _0x530b6b=new AWS[(_0x5663('0x26'))]({'accessKeyId':_0x4693f6[0x0],'secretAccessKey':_0x4693f6[0x1],'region':_0x4693f6[0x2]});var _0x1a1320={'botAlias':_0x5663('0x27'),'botName':_0x4693f6[0x3],'inputText':this[_0x5663('0x28')]['body'],'userId':this['channel']+':'+this[_0x5663('0xb')]['id']['toString']()};_0x530b6b[_0x5663('0x29')](_0x1a1320,function(_0x2229f0,_0x5060eb){if(_0x2229f0){logger[_0x5663('0x23')](_0x5663('0x22'),_0x554df4,_0x2229f0['message']);_0x29354f[_0x5663('0x2a')]();}else if(_0x5060eb&&_0x5060eb['message']){_0x3b76f9['body'][_0x5663('0x2b')]=_0x5060eb;_0x444adf['body']=_0x5060eb[_0x5663('0x28')];_0x444adf[_0x5663('0x2c')]='amazonlex';_0x444adf[_0x5663('0x2d')]=JSON[_0x5663('0x2e')](_0x5060eb);return rpc[_0x2fa9a2+_0x5663('0x1f')][_0x5663('0x20')](_0x444adf)['then'](function(_0x295046){logger[_0x5663('0xd')](_0x5663('0x22'),_0x554df4,_0x444adf[_0x5663('0x1d')]);if(_0x5060eb[_0x5663('0x2f')]==_0x5663('0x30')){_0x29354f[_0x5663('0x2a')]();}else{_0x29354f['stop']();}})[_0x5663('0x31')](function(_0x5087dc){logger[_0x5663('0x23')](_0x5663('0x22'),_0x554df4,JSON[_0x5663('0x2e')](_0x5087dc));_0x29354f[_0x5663('0x2a')]();});}else{_0x29354f[_0x5663('0x2a')]();}});}}catch(_0x5bec9a){logger[_0x5663('0x23')]('[%s][AMAZONLEX]\x20%s',_0x554df4,JSON[_0x5663('0x2e')](_0x5bec9a));_0x29354f[_0x5663('0x25')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 8ae4518..c833720 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 _0x64f8=['getMustacheRender','from','message','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','Smtp','service','host','port','secure','authentication','user','messageId','html','','replace','','headers','auto-replied','All','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','stop','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','Autoreply\x20already\x20sent','interaction','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x64f8,0x111));var _0x864f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x64f8[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x864f('0x0'));var logger=require('../../../../config/logger')(_0x864f('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x864f('0x2')),'mailMessage':require(_0x864f('0x3')),'smsMessage':require(_0x864f('0x4')),'faxMessage':require(_0x864f('0x5')),'whatsappMessage':require(_0x864f('0x6')),'chatInteraction':require(_0x864f('0x7')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x864f('0x8')),'faxInteraction':require(_0x864f('0x9')),'whatsappInteraction':require(_0x864f('0xa'))};var mailRpc=require(_0x864f('0xb'));exports[_0x864f('0xc')]=function(_0x3142e5,_0x5d5892,_0x2b0745,_0x12f46c){return function(_0x12bfd5){try{var _0x221808=this[_0x864f('0xd')];if(_0x221808===_0x864f('0xe')&&_0x12f46c[_0x864f('0xf')][_0x864f('0x10')]){logger[_0x864f('0x11')](_0x864f('0x12'),_0x3142e5,_0x864f('0x13'));return _0x12bfd5[_0x864f('0x14')]();}if(_0x5d5892[0x0]==='1'&&(_[_0x864f('0x15')](this['interaction'][_0x864f('0x16')])||!this['interaction']['created'])){logger[_0x864f('0x11')](_0x864f('0x12'),_0x3142e5,_0x864f('0x17'));return _0x12bfd5[_0x864f('0x14')]();}if(_0x5d5892[0x0]==='2'&&this[_0x864f('0x18')][_0x864f('0x19')]){logger['info'](_0x864f('0x1a'),_0x3142e5,_0x864f('0x1b'));return _0x12bfd5[_0x864f('0x14')]();}var _0x4ec5fb={'ContactId':this['contact']['id'],'sentAt':moment()[_0x864f('0x1c')](_0x864f('0x1d')),'direction':_0x864f('0x1e')};if(this[_0x864f('0xd')]===_0x864f('0xe')){_0x4ec5fb[_0x864f('0xf')]=utils[_0x864f('0x1f')](_0x5d5892[0x2],this);}else{_0x4ec5fb['body']=utils['getMustacheRender'](_0x5d5892[0x1],this);}if(this['message']){_0x4ec5fb['to']=this['message'][_0x864f('0x20')]||'';if(this[_0x864f('0xd')]===_0x864f('0xe')&&_0x5d5892[0x1]==='1'){_0x4ec5fb['cc']=this['message']['cc']||'';}_0x4ec5fb[_0x864f('0x20')]=this[_0x864f('0x21')]['to']||'';_0x4ec5fb[_0x864f('0x22')]=this['message'][_0x864f('0x22')]||'';_0x4ec5fb[_0x864f('0x23')]=!![];if(this['message'][_0x864f('0x24')]){_0x4ec5fb[_0x864f('0x24')]='';_0x4ec5fb['subject']+=_[_0x864f('0x25')](this[_0x864f('0x21')]['subject'],_0x864f('0x26'))?'':'Re:\x20';_0x4ec5fb[_0x864f('0x24')]+=this[_0x864f('0x21')][_0x864f('0x24')];}}if(this['channel']===_0x864f('0x27')){_0x4ec5fb[_0x864f('0x28')]=this[_0x864f('0x29')]['id'];}else{_0x4ec5fb[_[_0x864f('0x2a')](this['channel'])+_0x864f('0x2b')]=this[_0x864f('0x29')]['id'];}_0x4ec5fb[_[_0x864f('0x2a')](this[_0x864f('0xd')])+_0x864f('0x2c')]=this[_0x864f('0x18')]['id'];var _0x5773ee=this[_0x864f('0x18')];if(rpc[this[_0x864f('0xd')]+_0x864f('0x2d')]){if(this[_0x864f('0xd')]===_0x864f('0xe')){var _0x913391={'tls':{'rejectUnauthorized':![]}};if(this[_0x864f('0x29')][_0x864f('0x2e')]['service']){_0x913391[_0x864f('0x2f')]=this['account'][_0x864f('0x2e')]['service'];}else{_0x913391[_0x864f('0x30')]=this['account']['Smtp'][_0x864f('0x30')];_0x913391[_0x864f('0x31')]=this[_0x864f('0x29')]['Smtp'][_0x864f('0x31')];_0x913391[_0x864f('0x32')]=this[_0x864f('0x29')][_0x864f('0x2e')][_0x864f('0x32')];}if(this[_0x864f('0x29')][_0x864f('0x2e')][_0x864f('0x33')]){_0x913391['auth']={'user':this['account'][_0x864f('0x2e')][_0x864f('0x34')],'pass':this[_0x864f('0x29')][_0x864f('0x2e')]['pass']};}_0x4ec5fb['inReplyTo']=this[_0x864f('0x21')][_0x864f('0x35')];_0x4ec5fb[_0x864f('0x36')]=_0x864f('0x37')+_[_0x864f('0x38')](_0x4ec5fb[_0x864f('0xf')],'','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','catch','error','then','finally','update','lodash','moment'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x2b68,0x11a));var _0x82b6=function(_0x40cb9d,_0x1fb2ca){_0x40cb9d=_0x40cb9d-0x0;var _0x7c2743=_0x2b68[_0x40cb9d];return _0x7c2743;};'use strict';var _=require(_0x82b6('0x0'));var moment=require(_0x82b6('0x1'));var utils=require(_0x82b6('0x2'));var logger=require(_0x82b6('0x3'))(_0x82b6('0x4'));var rpc={'chatMessage':require(_0x82b6('0x5')),'openchannelMessage':require(_0x82b6('0x6')),'mailMessage':require(_0x82b6('0x7')),'smsMessage':require(_0x82b6('0x8')),'faxMessage':require(_0x82b6('0x9')),'whatsappMessage':require(_0x82b6('0xa')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x82b6('0xb')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x82b6('0xc')),'whatsappInteraction':require(_0x82b6('0xd'))};var mailRpc=require('../../mailRpc');exports[_0x82b6('0xe')]=function(_0x138bc8,_0x4b26a9,_0x1e40ed,_0x44fae5){return function(_0x3823c3){try{var _0x3b4109=this[_0x82b6('0xf')];if(_0x3b4109===_0x82b6('0x10')&&_0x44fae5[_0x82b6('0x11')][_0x82b6('0x12')]){logger[_0x82b6('0x13')](_0x82b6('0x14'),_0x138bc8,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x3823c3[_0x82b6('0x15')]();}if(_0x4b26a9[0x0]==='1'&&(_[_0x82b6('0x16')](this[_0x82b6('0x17')]['created'])||!this[_0x82b6('0x17')][_0x82b6('0x18')])){logger[_0x82b6('0x13')](_0x82b6('0x14'),_0x138bc8,'Autoreply\x20already\x20sent');return _0x3823c3[_0x82b6('0x15')]();}if(_0x4b26a9[0x0]==='2'&&this[_0x82b6('0x17')][_0x82b6('0x19')]){logger[_0x82b6('0x13')](_0x82b6('0x1a'),_0x138bc8,_0x82b6('0x1b'));return _0x3823c3[_0x82b6('0x15')]();}var _0x3d801b={'ContactId':this[_0x82b6('0x1c')]['id'],'sentAt':moment()['format'](_0x82b6('0x1d')),'direction':'out'};if(this[_0x82b6('0xf')]==='mail'){_0x3d801b[_0x82b6('0x11')]=utils[_0x82b6('0x1e')](_0x4b26a9[0x2],this);}else{_0x3d801b[_0x82b6('0x11')]=utils[_0x82b6('0x1e')](_0x4b26a9[0x1],this);}if(this[_0x82b6('0x1f')]){_0x3d801b['to']=this[_0x82b6('0x1f')][_0x82b6('0x20')]||'';if(this[_0x82b6('0xf')]==='mail'&&_0x4b26a9[0x1]==='1'){_0x3d801b['cc']=this['message']['cc']||'';}_0x3d801b['from']=this['message']['to']||'';_0x3d801b['phone']=this[_0x82b6('0x1f')][_0x82b6('0x21')]||'';_0x3d801b['read']=!![];if(this['message'][_0x82b6('0x22')]){_0x3d801b[_0x82b6('0x22')]='';_0x3d801b['subject']+=_['startsWith'](this[_0x82b6('0x1f')][_0x82b6('0x22')],_0x82b6('0x23'))?'':_0x82b6('0x24');_0x3d801b[_0x82b6('0x22')]+=this[_0x82b6('0x1f')][_0x82b6('0x22')];}}if(this[_0x82b6('0xf')]==='chat'){_0x3d801b[_0x82b6('0x25')]=this[_0x82b6('0x26')]['id'];}else{_0x3d801b[_[_0x82b6('0x27')](this['channel'])+_0x82b6('0x28')]=this['account']['id'];}_0x3d801b[_['upperFirst'](this[_0x82b6('0xf')])+_0x82b6('0x29')]=this['interaction']['id'];var _0x1d97f7=this['interaction'];if(rpc[this[_0x82b6('0xf')]+'Message']){if(this[_0x82b6('0xf')]===_0x82b6('0x10')){var _0x4d9a7c={'tls':{'rejectUnauthorized':![]}};if(this[_0x82b6('0x26')]['Smtp']['service']){_0x4d9a7c[_0x82b6('0x2a')]=this[_0x82b6('0x26')][_0x82b6('0x2b')]['service'];}else{_0x4d9a7c['host']=this['account']['Smtp'][_0x82b6('0x2c')];_0x4d9a7c[_0x82b6('0x2d')]=this[_0x82b6('0x26')]['Smtp'][_0x82b6('0x2d')];_0x4d9a7c[_0x82b6('0x2e')]=this[_0x82b6('0x26')]['Smtp']['secure'];}if(this[_0x82b6('0x26')][_0x82b6('0x2b')]['authentication']){_0x4d9a7c['auth']={'user':this[_0x82b6('0x26')][_0x82b6('0x2b')]['user'],'pass':this['account'][_0x82b6('0x2b')][_0x82b6('0x2f')]};}_0x3d801b[_0x82b6('0x30')]=this[_0x82b6('0x1f')][_0x82b6('0x31')];_0x3d801b[_0x82b6('0x32')]=_0x82b6('0x33')+_[_0x82b6('0x34')](_0x3d801b['body'],']+(>|$)/g,''),'priorityTrue':_0x22f6e1[0x1],'priorityFalse':_0x22f6e1[0x2]};var _0x45e322=gotoif[_0x304c('0x0')](_0x1b3b6c,{'typecast':!![]});if(_0x45e322[_0x304c('0xa')]){logger[_0x304c('0xb')]('[%s][GOTOIF]\x20%s',_0x4da936,_['map'](_0x45e322,_0x304c('0xc'))[_0x304c('0xd')](',\x20'));_0x4bf0b0[_0x304c('0xe')]();}else{try{var _0x310a4e=eval('('+_0x1b3b6c[_0x304c('0xf')]+')');var _0x59ffa4=_0x310a4e?_0x1b3b6c['priorityTrue']:_0x1b3b6c[_0x304c('0x10')];logger[_0x304c('0x11')](_0x304c('0x12'),_0x4da936,_0x1b3b6c[_0x304c('0xf')],_0x310a4e,_0x59ffa4||_0x304c('0x13'));if(_0x59ffa4){var _0x3aa74a=_[_0x304c('0x14')](_0x4bf0b0[_0x304c('0x15')](),{'p':_0x59ffa4});if(_0x3aa74a>=0x0){logger[_0x304c('0x11')](_0x304c('0x16'),_0x4da936,_0x59ffa4||_0x304c('0x13'),_0x3aa74a);_0x4bf0b0[_0x304c('0x13')](_0x3aa74a);}else{logger[_0x304c('0x11')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x4da936,_0x59ffa4||_0x304c('0x13'));_0x4bf0b0[_0x304c('0xe')]();}}else{_0x4bf0b0[_0x304c('0x13')]();}}catch(_0x246e0c){logger['error'](_0x304c('0x17'),_0x4da936,_0x246e0c['message']);_0x4bf0b0['stop']();}}}catch(_0x30950b){logger[_0x304c('0xb')]('[%s][GOTOIF]\x20%s',_0x4da936,JSON[_0x304c('0x18')](_0x30950b));_0x4bf0b0[_0x304c('0xe')]();}};}; \ No newline at end of file +var _0xace3=['findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','stop','message','stringify','validate','lodash','./utils','../../../../config/logger','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error','map','condition','priorityTrue','priorityFalse','next'];(function(_0x2053aa,_0x3df40e){var _0x30f5bb=function(_0x1b3f36){while(--_0x1b3f36){_0x2053aa['push'](_0x2053aa['shift']());}};_0x30f5bb(++_0x3df40e);}(_0xace3,0x1e6));var _0x3ace=function(_0x420e31,_0x261e2a){_0x420e31=_0x420e31-0x0;var _0x3b2151=_0xace3[_0x420e31];return _0x3b2151;};'use strict';var schema=require(_0x3ace('0x0'));var _=require(_0x3ace('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x3ace('0x2'));var logger=require(_0x3ace('0x3'))('routing');var gotoif=schema({'condition':{'type':_0x3ace('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x3ace('0x5'),'message':_0x3ace('0x6')},'priorityFalse':{'type':'number','message':_0x3ace('0x7')}});exports[_0x3ace('0x8')]=function(_0x4a3a28,_0x3ff2c8){return function(_0x139405){try{var _0xc3928a={'condition':htmlToText[_0x3ace('0x9')](utils[_0x3ace('0xa')](_0x3ff2c8[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3ff2c8[0x1],'priorityFalse':_0x3ff2c8[0x2]};var _0x1bae50=gotoif[_0x3ace('0x0')](_0xc3928a,{'typecast':!![]});if(_0x1bae50[_0x3ace('0xb')]){logger[_0x3ace('0xc')]('[%s][GOTOIF]\x20%s',_0x4a3a28,_[_0x3ace('0xd')](_0x1bae50,'message')['join'](',\x20'));_0x139405['stop']();}else{try{var _0x1f8bb5=eval('('+_0xc3928a[_0x3ace('0xe')]+')');var _0x5555bd=_0x1f8bb5?_0xc3928a[_0x3ace('0xf')]:_0xc3928a[_0x3ace('0x10')];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x4a3a28,_0xc3928a['condition'],_0x1f8bb5,_0x5555bd||_0x3ace('0x11'));if(_0x5555bd){var _0x4b7a1f=_[_0x3ace('0x12')](_0x139405[_0x3ace('0x13')](),{'p':_0x5555bd});if(_0x4b7a1f>=0x0){logger['info'](_0x3ace('0x14'),_0x4a3a28,_0x5555bd||_0x3ace('0x11'),_0x4b7a1f);_0x139405['next'](_0x4b7a1f);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x4a3a28,_0x5555bd||_0x3ace('0x11'));_0x139405[_0x3ace('0x15')]();}}else{_0x139405[_0x3ace('0x11')]();}}catch(_0x298f88){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x4a3a28,_0x298f88[_0x3ace('0x16')]);_0x139405[_0x3ace('0x15')]();}}}catch(_0x5e72f6){logger[_0x3ace('0xc')]('[%s][GOTOIF]\x20%s',_0x4a3a28,JSON[_0x3ace('0x17')](_0x5e72f6));_0x139405[_0x3ace('0x15')]();}};}; \ 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 2b0056a..8b60874 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 _0xc580=['../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','validate'];(function(_0xecab06,_0x39fc04){var _0x5781bc=function(_0x56dbe7){while(--_0x56dbe7){_0xecab06['push'](_0xecab06['shift']());}};_0x5781bc(++_0x39fc04);}(_0xc580,0x103));var _0x0c58=function(_0x42ea2b,_0x53e187){_0x42ea2b=_0x42ea2b-0x0;var _0x1cc5f1=_0xc580[_0x42ea2b];return _0x1cc5f1;};'use strict';var schema=require(_0x0c58('0x0'));var _=require('lodash');var logger=require(_0x0c58('0x1'))(_0x0c58('0x2'));var gotop=schema({'priority':{'type':_0x0c58('0x3'),'required':!![],'message':_0x0c58('0x4')}});exports[_0x0c58('0x5')]=function(_0x4b3674,_0x233b7f){return function(_0x550aeb){try{var _0x542f9a={'priority':_0x233b7f[0x0]};var _0x36260d=gotop[_0x0c58('0x0')](_0x542f9a,{'typecast':!![]});if(_0x36260d['length']){logger[_0x0c58('0x6')]('[%s][GOTOP]\x20%s',_0x4b3674,_['map'](_0x36260d,_0x0c58('0x7'))[_0x0c58('0x8')](',\x20'));_0x550aeb[_0x0c58('0x9')]();}else{logger[_0x0c58('0xa')](_0x0c58('0xb'),_0x4b3674,_0x542f9a[_0x0c58('0xc')]);if(_0x542f9a['priority']){var _0x2422e8=_[_0x0c58('0xd')](_0x550aeb[_0x0c58('0xe')](),{'p':_0x542f9a[_0x0c58('0xc')]});if(_0x2422e8>=0x0){logger[_0x0c58('0xa')](_0x0c58('0xf'),_0x4b3674,_0x542f9a[_0x0c58('0xc')]||_0x0c58('0x10'),_0x2422e8);_0x550aeb[_0x0c58('0x10')](_0x2422e8);}else{logger[_0x0c58('0xa')](_0x0c58('0x11'),_0x4b3674,_0x542f9a[_0x0c58('0xc')]||_0x0c58('0x10'));_0x550aeb['stop']();}}else{_0x550aeb[_0x0c58('0x10')]();}}}catch(_0x29c7d6){logger['error'](_0x0c58('0x12'),_0x4b3674,JSON[_0x0c58('0x13')](_0x29c7d6));_0x550aeb[_0x0c58('0x9')]();}};}; \ No newline at end of file +var _0x0391=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','next'];(function(_0x177fb0,_0x210ea7){var _0xeb5ec5=function(_0x795f6c){while(--_0x795f6c){_0x177fb0['push'](_0x177fb0['shift']());}};_0xeb5ec5(++_0x210ea7);}(_0x0391,0x1c3));var _0x1039=function(_0x4c2607,_0x4b3852){_0x4c2607=_0x4c2607-0x0;var _0x4774e6=_0x0391[_0x4c2607];return _0x4774e6;};'use strict';var schema=require(_0x1039('0x0'));var _=require(_0x1039('0x1'));var logger=require(_0x1039('0x2'))(_0x1039('0x3'));var gotop=schema({'priority':{'type':_0x1039('0x4'),'required':!![],'message':_0x1039('0x5')}});exports[_0x1039('0x6')]=function(_0x26946a,_0x534073){return function(_0x457910){try{var _0x275a44={'priority':_0x534073[0x0]};var _0x514074=gotop['validate'](_0x275a44,{'typecast':!![]});if(_0x514074[_0x1039('0x7')]){logger[_0x1039('0x8')](_0x1039('0x9'),_0x26946a,_['map'](_0x514074,'message')[_0x1039('0xa')](',\x20'));_0x457910[_0x1039('0xb')]();}else{logger[_0x1039('0xc')](_0x1039('0xd'),_0x26946a,_0x275a44[_0x1039('0xe')]);if(_0x275a44[_0x1039('0xe')]){var _0x4bc3a8=_['findIndex'](_0x457910[_0x1039('0xf')](),{'p':_0x275a44[_0x1039('0xe')]});if(_0x4bc3a8>=0x0){logger[_0x1039('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x26946a,_0x275a44['priority']||_0x1039('0x10'),_0x4bc3a8);_0x457910['next'](_0x4bc3a8);}else{logger['info'](_0x1039('0x11'),_0x26946a,_0x275a44[_0x1039('0xe')]||'next');_0x457910[_0x1039('0xb')]();}}else{_0x457910[_0x1039('0x10')]();}}}catch(_0x105471){logger[_0x1039('0x8')](_0x1039('0x9'),_0x26946a,JSON['stringify'](_0x105471));_0x457910[_0x1039('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 8fe03c9..7e8e6c1 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 _0x5276=['upperFirst','channel','InteractionId','Message','info','[%s][MESSAGE]\x20%s','next','error','stringify','stop','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','chat','ChatWebsiteId','account'];(function(_0xd89a57,_0x53e80e){var _0xb607e7=function(_0x561711){while(--_0x561711){_0xd89a57['push'](_0xd89a57['shift']());}};_0xb607e7(++_0x53e80e);}(_0x5276,0x163));var _0x6527=function(_0x50d97d,_0x7e6d8c){_0x50d97d=_0x50d97d-0x0;var _0x4e7108=_0x5276[_0x50d97d];return _0x4e7108;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x6527('0x0'))(_0x6527('0x1'));var rpc={'chatMessage':require(_0x6527('0x2')),'openchannelMessage':require(_0x6527('0x3')),'mailMessage':require(_0x6527('0x4')),'smsMessage':require(_0x6527('0x5')),'faxMessage':require(_0x6527('0x6')),'whatsappMessage':require(_0x6527('0x7'))};exports[_0x6527('0x8')]=function(_0x1009ad,_0x3deb56){return function(_0x9d7ba2){try{var _0x188c61={'body':utils['getMustacheRender'](_0x3deb56[0x0],this),'ContactId':this[_0x6527('0x9')]['id']};if(this['channel']===_0x6527('0xa')){_0x188c61[_0x6527('0xb')]=this['account']['id'];}else{_0x188c61[_['upperFirst'](this['channel'])+'AccountId']=this[_0x6527('0xc')]['id'];}_0x188c61[_[_0x6527('0xd')](this[_0x6527('0xe')])+_0x6527('0xf')]=this['interaction']['id'];if(rpc[this['channel']+_0x6527('0x10')]){return rpc[this[_0x6527('0xe')]+_0x6527('0x10')]['create'](_0x188c61)['then'](function(_0x5f2990){logger[_0x6527('0x11')](_0x6527('0x12'),_0x1009ad,_0x188c61['body']);_0x9d7ba2[_0x6527('0x13')]();})['catch'](function(_0x3b56ee){logger[_0x6527('0x14')](_0x6527('0x12'),_0x1009ad,JSON[_0x6527('0x15')](_0x3b56ee));_0x9d7ba2[_0x6527('0x16')]();});}}catch(_0x2fbcef){logger['error'](_0x6527('0x12'),_0x1009ad,JSON['stringify'](_0x2fbcef));_0x9d7ba2[_0x6527('0x16')]();}};}; \ No newline at end of file +var _0x1c19=['../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','ChatWebsiteId','account','upperFirst','channel','AccountId','interaction','Message','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils'];(function(_0x12c870,_0x482756){var _0x56f3b5=function(_0x2c1e79){while(--_0x2c1e79){_0x12c870['push'](_0x12c870['shift']());}};_0x56f3b5(++_0x482756);}(_0x1c19,0x1f2));var _0x91c1=function(_0x21a0c5,_0x586032){_0x21a0c5=_0x21a0c5-0x0;var _0x13d439=_0x1c19[_0x21a0c5];return _0x13d439;};'use strict';var _=require(_0x91c1('0x0'));var utils=require(_0x91c1('0x1'));var logger=require(_0x91c1('0x2'))('routing');var rpc={'chatMessage':require(_0x91c1('0x3')),'openchannelMessage':require(_0x91c1('0x4')),'mailMessage':require(_0x91c1('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x91c1('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x91c1('0x7')]=function(_0x64135e,_0x105260){return function(_0xc05b49){try{var _0x1a2ff5={'body':utils[_0x91c1('0x8')](_0x105260[0x0],this),'ContactId':this[_0x91c1('0x9')]['id']};if(this['channel']==='chat'){_0x1a2ff5[_0x91c1('0xa')]=this[_0x91c1('0xb')]['id'];}else{_0x1a2ff5[_[_0x91c1('0xc')](this[_0x91c1('0xd')])+_0x91c1('0xe')]=this['account']['id'];}_0x1a2ff5[_['upperFirst'](this['channel'])+'InteractionId']=this[_0x91c1('0xf')]['id'];if(rpc[this[_0x91c1('0xd')]+_0x91c1('0x10')]){return rpc[this[_0x91c1('0xd')]+_0x91c1('0x10')]['create'](_0x1a2ff5)['then'](function(_0x5f482a){logger[_0x91c1('0x11')](_0x91c1('0x12'),_0x64135e,_0x1a2ff5[_0x91c1('0x13')]);_0xc05b49[_0x91c1('0x14')]();})[_0x91c1('0x15')](function(_0x410149){logger[_0x91c1('0x16')]('[%s][MESSAGE]\x20%s',_0x64135e,JSON[_0x91c1('0x17')](_0x410149));_0xc05b49[_0x91c1('0x18')]();});}}catch(_0x5cabd3){logger[_0x91c1('0x16')](_0x91c1('0x12'),_0x64135e,JSON[_0x91c1('0x17')](_0x5cabd3));_0xc05b49[_0x91c1('0x18')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 8e0efe0..347dc62 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 _0xb323=['consequence','[%s][NOOP]\x20%s','getMustacheRender','stringify','stop','routing'];(function(_0x3b001b,_0x2f11ac){var _0x184107=function(_0x1ff834){while(--_0x1ff834){_0x3b001b['push'](_0x3b001b['shift']());}};_0x184107(++_0x2f11ac);}(_0xb323,0x179));var _0x3b32=function(_0x59bddf,_0x5ceae2){_0x59bddf=_0x59bddf-0x0;var _0x1cf222=_0xb323[_0x59bddf];return _0x1cf222;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0x3b32('0x0'));exports[_0x3b32('0x1')]=function(_0x255cb0,_0x25b4ca){return function(_0x33981c){try{logger['info'](_0x3b32('0x2'),_0x255cb0,utils[_0x3b32('0x3')](_0x25b4ca[0x0],this));_0x33981c['next']();}catch(_0x570de3){logger['error'](_0x3b32('0x2'),_0x255cb0,JSON[_0x3b32('0x4')](_0x570de3));_0x33981c[_0x3b32('0x5')]();}};}; \ No newline at end of file +var _0xe6d9=['[%s][NOOP]\x20%s','error','stringify','stop','./utils','../../../../config/logger','routing','consequence','info'];(function(_0x40b87,_0x209a34){var _0x5dfad8=function(_0x1f797d){while(--_0x1f797d){_0x40b87['push'](_0x40b87['shift']());}};_0x5dfad8(++_0x209a34);}(_0xe6d9,0x1cf));var _0x9e6d=function(_0x580a9a,_0x4e5ad6){_0x580a9a=_0x580a9a-0x0;var _0x2d4ec9=_0xe6d9[_0x580a9a];return _0x2d4ec9;};'use strict';var utils=require(_0x9e6d('0x0'));var logger=require(_0x9e6d('0x1'))(_0x9e6d('0x2'));exports[_0x9e6d('0x3')]=function(_0x1346a8,_0x6c390f){return function(_0x214071){try{logger[_0x9e6d('0x4')](_0x9e6d('0x5'),_0x1346a8,utils['getMustacheRender'](_0x6c390f[0x0],this));_0x214071['next']();}catch(_0x4b384e){logger[_0x9e6d('0x6')](_0x9e6d('0x5'),_0x1346a8,JSON[_0x9e6d('0x7')](_0x4b384e));_0x214071[_0x9e6d('0x8')]();}};}; \ 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 cb9ae29..511a96a 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 _0x1555=['%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','AccountId','WebsiteId','account','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','timeout','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','stack','validate','lodash','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','queue_id','queue','from','joinAt','clone','format','pick'];(function(_0x2050f7,_0x3833c6){var _0x219da1=function(_0x554dc1){while(--_0x554dc1){_0x2050f7['push'](_0x2050f7['shift']());}};_0x219da1(++_0x3833c6);}(_0x1555,0x81));var _0x5155=function(_0x3ec07a,_0x54f971){_0x3ec07a=_0x3ec07a-0x0;var _0x5f07b9=_0x1555[_0x3ec07a];return _0x5f07b9;};'use strict';var schema=require(_0x5155('0x0'));var _=require(_0x5155('0x1'));var util=require('util');var seqqueue=require('seq-queue');var moment=require(_0x5155('0x2'));var Redis=require(_0x5155('0x3'));var config=require(_0x5155('0x4'));var logger=require(_0x5155('0x5'))(_0x5155('0x6'));var strategy=require('./strategy');config[_0x5155('0x7')]=_[_0x5155('0x8')](config[_0x5155('0x7')],{'host':_0x5155('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5155('0x7')]));var attributes=['id',_0x5155('0xa'),'account',_0x5155('0xb'),_0x5155('0xc'),_0x5155('0xd')];function emit(_0xd4406,_0x4239bc,_0x49f1d1){io['to'](_0xd4406)['emit'](_0x4239bc,_0x49f1d1);}function emitChannelQueueInteraction(_0x23163b,_0x424e0d,_0x43067a,_0x3ecc67,_0x1bba71,_0x5579a3,_0x360cd9,_0x455757){var _0x453f21=_[_0x5155('0xe')](_0x43067a);_0x453f21[_0x5155('0xa')]=_0x455757;_0x453f21[_0x5155('0xb')]=_0x424e0d;_0x453f21['account']=_0x3ecc67;_0x453f21['id']=_0x1bba71;if(_0x5579a3){_0x360cd9[util[_0x5155('0xf')]('%sQueuesWaitingInteractions',_0x23163b)][_0x1bba71]=_[_0x5155('0x10')](_0x453f21,attributes);}else{delete _0x360cd9[util[_0x5155('0xf')](_0x5155('0x11'),_0x23163b)][_0x1bba71];}emit(util[_0x5155('0xf')](_0x5155('0x12'),_0x23163b,_0x424e0d),util[_0x5155('0xf')](_0x5155('0x13'),_0x23163b,_0x5579a3?_0x5155('0x14'):'remove'),_[_0x5155('0x10')](_0x453f21,attributes));}var rpc={'openchannelQueueReport':require(_0x5155('0x15')),'mailQueueReport':require(_0x5155('0x16')),'chatQueueReport':require(_0x5155('0x17')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x5155('0x18')),'whatsappQueueReport':require(_0x5155('0x19'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x5155('0x1a')}});function startRouting(_0x13725e,_0x44e8a0,_0x4c82ec,_0x4a863e){if(_0x13725e&&_0x44e8a0&&_0x4c82ec){_0x44e8a0[_0x5155('0x1b')]+=0x1;var _0x103e20={'uniqueid':_0x13725e,'from':_0x4c82ec['body']?_0x4c82ec[_0x5155('0x1c')][_0x5155('0xc')]:'','joinAt':moment()[_0x5155('0xf')](_0x5155('0x1d')),'ContactId':_0x4c82ec[_0x5155('0x1e')]?_0x4c82ec[_0x5155('0x1e')]['id']:null,'ListId':_0x4c82ec['list']?_0x4c82ec['list']['id']:null};_0x103e20[_[_0x5155('0x1f')](_0x4c82ec[_0x5155('0x20')])+_0x5155('0x21')]=_0x44e8a0['id']||null;_0x103e20[_[_0x5155('0x1f')](_0x4c82ec['channel'])+_0x5155('0x22')]=_0x4c82ec[_0x5155('0x23')]?_0x4c82ec['interaction']['id']:null;_0x103e20[_[_0x5155('0x1f')](_0x4c82ec[_0x5155('0x20')])+_0x5155('0x24')]=_0x4c82ec[_0x5155('0x25')]?_0x4c82ec[_0x5155('0x25')]['id']:null;_0x103e20[_['upperFirst'](_0x4c82ec[_0x5155('0x20')])+(_0x4c82ec['channel']!=='chat'?_0x5155('0x26'):_0x5155('0x27'))]=_0x4c82ec[_0x5155('0x28')]?_0x4c82ec[_0x5155('0x28')]['id']:null;logger[_0x5155('0x29')](util['format'](_0x5155('0x2a'),_0x13725e,_0x44e8a0[_0x5155('0x2b')]));emitChannelQueueInteraction(_0x4c82ec[_0x5155('0x20')],_0x44e8a0[_0x5155('0x2b')],_0x103e20,_0x4c82ec[_0x5155('0x28')][_0x5155('0x2b')],_0x4c82ec[_0x5155('0x25')]['id'],!![],_0x4a863e,_0x44e8a0['id']);if(rpc[_0x4c82ec[_0x5155('0x20')]+_0x5155('0x2c')]){return rpc[_0x4c82ec[_0x5155('0x20')]+_0x5155('0x2c')]['create'](_0x103e20)[_0x5155('0x2d')](function(_0xbec2b){logger[_0x5155('0x2e')](_0x5155('0x2f'));});}}}function stopRouting(_0x1184b9,_0x3eeb67,_0x340d28,_0x3a7c26){if(_0x1184b9&&_0x3eeb67){_0x3eeb67['waiting']-=0x1;var _0x7fd0c2={'leaveAt':moment()[_0x5155('0xf')](_0x5155('0x1d')),'acceptAt':moment()[_0x5155('0xf')](_0x5155('0x1d')),'reason':'accepted'};logger[_0x5155('0x29')](util[_0x5155('0xf')](_0x5155('0x30'),_0x1184b9,_0x3eeb67['name']));emitChannelQueueInteraction(_0x340d28[_0x5155('0x20')],_0x3eeb67[_0x5155('0x2b')],_0x340d28[_0x5155('0x1c')],_0x340d28[_0x5155('0x28')]['name'],_0x340d28['message']['id'],![],_0x3a7c26,_0x3eeb67['id']);if(rpc[_0x340d28[_0x5155('0x20')]+_0x5155('0x2c')]){return rpc[_0x340d28[_0x5155('0x20')]+'QueueReport']['update'](_0x1184b9,_0x7fd0c2)['catch'](function(_0x6d96ee){logger[_0x5155('0x2e')](_0x5155('0x31'));});}}}function endRouting(_0x3a27c8,_0x3e918d,_0x5dd195,_0x5c46dc){if(_0x3a27c8&&_0x3e918d){_0x3e918d['waiting']-=0x1;var _0x52615a={'leaveAt':moment()['format'](_0x5155('0x1d')),'exitAt':moment()[_0x5155('0xf')](_0x5155('0x1d')),'reason':'timeout'};logger[_0x5155('0x29')](util[_0x5155('0xf')](_0x5155('0x32'),_0x3a27c8,_0x3e918d['name']));emitChannelQueueInteraction(_0x5dd195[_0x5155('0x20')],_0x3e918d[_0x5155('0x2b')],_0x5dd195['body'],_0x5dd195[_0x5155('0x28')][_0x5155('0x2b')],_0x5dd195[_0x5155('0x25')]['id'],![],_0x5c46dc);if(rpc[_0x5dd195[_0x5155('0x20')]+'QueueReport']){return rpc[_0x5dd195['channel']+'QueueReport']['update'](_0x3a27c8,_0x52615a)[_0x5155('0x2d')](function(_0x3d3a2d){logger[_0x5155('0x2e')](_0x5155('0x31'));});}}}function handleFindQueue(_0x4a46d1){return function(_0x2b58ee){return _0x2b58ee[_0x5155('0x2b')][_0x5155('0x33')]()===_0x4a46d1[_0x5155('0x33')]();};}exports[_0x5155('0x34')]=function(_0x23ab54,_0x112166,_0x9315c9,_0x179648){return function(_0x103bc1){try{var _0x188f59={'name':_0x112166[0x0],'timeout':_0x112166[0x1]};var _0x2ebbd3=queue[_0x5155('0x0')](_0x188f59,{'typecast':!![]});if(_0x2ebbd3[_0x5155('0x35')]){logger[_0x5155('0x2e')](_0x5155('0x36'),_0x23ab54,_[_0x5155('0x37')](_0x2ebbd3,_0x5155('0x25'))[_0x5155('0x38')](',\x20'));_0x103bc1[_0x5155('0x39')]();}else{var _0x46fd67=_['find'](_0x9315c9[_0x179648['channel']+_0x5155('0x3a')],handleFindQueue(_0x188f59[_0x5155('0x2b')]));if(_0x46fd67){startRouting(_0x23ab54,_0x46fd67,_0x179648,_0x9315c9);var _0x323c69=(_0x46fd67[_0x5155('0x3b')]||0xa)*0x3e8;var _0x34e8ee=(_0x188f59[_0x5155('0x3b')]||0x14)*0x3e8;var _0x5c11a3,_0x28972a;if(_0x323c69>_0x34e8ee){_0x34e8ee=_0x323c69;}var _0x5b1635=seqqueue[_0x5155('0x3c')](_0x323c69);_0x5b1635['id']=_0x23ab54;_0x5b1635['atimeout']=_0x323c69;_0x5b1635[_0x5155('0x3d')]=_0x34e8ee;_0x5b1635[_0x5155('0x20')]=_0x179648[_0x5155('0x20')];_0x9315c9[_0x5155('0x3e')][_0x23ab54]['on'](_0x5155('0x3f'),function(){logger[_0x5155('0x29')](_0x5155('0x40'),_0x23ab54);stopRouting(_0x23ab54,_0x46fd67,_0x179648,_0x9315c9);clearTimeout(_0x5c11a3);_0x5c11a3=undefined;_0x5b1635[_0x5155('0x41')](!![]);if(_0x9315c9[_0x5155('0x3e')][_0x23ab54]){delete _0x9315c9[_0x5155('0x3e')][_0x23ab54];}_0x103bc1[_0x5155('0x39')]();});_0x9315c9[_0x5155('0x3e')][_0x23ab54]['on'](_0x5155('0x42'),function(){if(_0x9315c9[_0x5155('0x3e')][_0x23ab54]){delete _0x9315c9[_0x5155('0x3e')][_0x23ab54];}});_0x5c11a3=setTimeout(function(){logger[_0x5155('0x29')](_0x5155('0x43'),_0x23ab54);endRouting(_0x23ab54,_0x46fd67,_0x179648,_0x9315c9);clearTimeout(_0x5c11a3);_0x5b1635['close'](!![]);_0x103bc1[_0x5155('0x44')]();},_0x34e8ee);switch(_0x46fd67[_0x5155('0x45')]){case _0x5155('0x46'):strategy[_0x5155('0x46')](_0x5b1635,_0x46fd67,_0x9315c9,_0x179648);break;default:strategy[_0x5155('0x47')](_0x5b1635,_0x46fd67,_0x9315c9,_0x179648);}}else{logger[_0x5155('0x2e')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x23ab54,_0x188f59[_0x5155('0x2b')]);_0x103bc1[_0x5155('0x39')]();}}}catch(_0x293107){console['log'](_0x293107);logger[_0x5155('0x2e')]('[%s][QUEUE]\x20%s',_0x23ab54,_0x293107[_0x5155('0x48')]);_0x103bc1[_0x5155('0x39')]();}};}; \ No newline at end of file +var _0x90aa=['catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','find','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','log','stack','validate','lodash','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit','clone','queue','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','upperFirst','channel','QueueId','interaction','MessageId','message','chat','WebsiteId','info','name','QueueReport','create'];(function(_0x1ec5a9,_0x4efb56){var _0x2ef4fc=function(_0xc4838e){while(--_0xc4838e){_0x1ec5a9['push'](_0x1ec5a9['shift']());}};_0x2ef4fc(++_0x4efb56);}(_0x90aa,0x152));var _0xa90a=function(_0x33f4ba,_0x33f351){_0x33f4ba=_0x33f4ba-0x0;var _0x1a25bf=_0x90aa[_0x33f4ba];return _0x1a25bf;};'use strict';var schema=require(_0xa90a('0x0'));var _=require(_0xa90a('0x1'));var util=require('util');var seqqueue=require(_0xa90a('0x2'));var moment=require(_0xa90a('0x3'));var Redis=require('ioredis');var config=require(_0xa90a('0x4'));var logger=require(_0xa90a('0x5'))(_0xa90a('0x6'));var strategy=require(_0xa90a('0x7'));config[_0xa90a('0x8')]=_[_0xa90a('0x9')](config['redis'],{'host':_0xa90a('0xa'),'port':0x18eb});var io=require(_0xa90a('0xb'))(new Redis(config[_0xa90a('0x8')]));var attributes=['id',_0xa90a('0xc'),_0xa90a('0xd'),'queue',_0xa90a('0xe'),_0xa90a('0xf')];function emit(_0xd2d66c,_0x16018a,_0x43ba86){io['to'](_0xd2d66c)[_0xa90a('0x10')](_0x16018a,_0x43ba86);}function emitChannelQueueInteraction(_0x224908,_0x29cb98,_0x523309,_0x17121b,_0x3afb94,_0x1f7701,_0x12f3a9,_0x37f390){var _0x25eff0=_[_0xa90a('0x11')](_0x523309);_0x25eff0[_0xa90a('0xc')]=_0x37f390;_0x25eff0[_0xa90a('0x12')]=_0x29cb98;_0x25eff0['account']=_0x17121b;_0x25eff0['id']=_0x3afb94;if(_0x1f7701){_0x12f3a9[util[_0xa90a('0x13')](_0xa90a('0x14'),_0x224908)][_0x3afb94]=_[_0xa90a('0x15')](_0x25eff0,attributes);}else{delete _0x12f3a9[util['format'](_0xa90a('0x14'),_0x224908)][_0x3afb94];}emit(util['format'](_0xa90a('0x16'),_0x224908,_0x29cb98),util[_0xa90a('0x13')](_0xa90a('0x17'),_0x224908,_0x1f7701?_0xa90a('0x18'):_0xa90a('0x19')),_[_0xa90a('0x15')](_0x25eff0,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xa90a('0x1a')),'chatQueueReport':require(_0xa90a('0x1b')),'smsQueueReport':require(_0xa90a('0x1c')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':_0xa90a('0x1d')},'timeout':{'type':'number','message':_0xa90a('0x1e')}});function startRouting(_0x2f91b5,_0x356696,_0x216a1e,_0x53555e){if(_0x2f91b5&&_0x356696&&_0x216a1e){_0x356696[_0xa90a('0x1f')]+=0x1;var _0x5b6f83={'uniqueid':_0x2f91b5,'from':_0x216a1e['body']?_0x216a1e[_0xa90a('0x20')][_0xa90a('0xe')]:'','joinAt':moment()['format'](_0xa90a('0x21')),'ContactId':_0x216a1e['contact']?_0x216a1e[_0xa90a('0x22')]['id']:null,'ListId':_0x216a1e['list']?_0x216a1e['list']['id']:null};_0x5b6f83[_[_0xa90a('0x23')](_0x216a1e[_0xa90a('0x24')])+_0xa90a('0x25')]=_0x356696['id']||null;_0x5b6f83[_['upperFirst'](_0x216a1e[_0xa90a('0x24')])+'InteractionId']=_0x216a1e[_0xa90a('0x26')]?_0x216a1e['interaction']['id']:null;_0x5b6f83[_[_0xa90a('0x23')](_0x216a1e[_0xa90a('0x24')])+_0xa90a('0x27')]=_0x216a1e[_0xa90a('0x28')]?_0x216a1e[_0xa90a('0x28')]['id']:null;_0x5b6f83[_['upperFirst'](_0x216a1e[_0xa90a('0x24')])+(_0x216a1e[_0xa90a('0x24')]!==_0xa90a('0x29')?'AccountId':_0xa90a('0x2a'))]=_0x216a1e[_0xa90a('0xd')]?_0x216a1e[_0xa90a('0xd')]['id']:null;logger[_0xa90a('0x2b')](util[_0xa90a('0x13')]('[%s][START:QUEUE][NAME:%s]',_0x2f91b5,_0x356696[_0xa90a('0x2c')]));emitChannelQueueInteraction(_0x216a1e['channel'],_0x356696['name'],_0x5b6f83,_0x216a1e[_0xa90a('0xd')][_0xa90a('0x2c')],_0x216a1e[_0xa90a('0x28')]['id'],!![],_0x53555e,_0x356696['id']);if(rpc[_0x216a1e[_0xa90a('0x24')]+'QueueReport']){return rpc[_0x216a1e['channel']+_0xa90a('0x2d')][_0xa90a('0x2e')](_0x5b6f83)[_0xa90a('0x2f')](function(_0x5614b5){logger[_0xa90a('0x30')](_0xa90a('0x31'));});}}}function stopRouting(_0x24b12e,_0x13a877,_0x4a757d,_0x5c18a2){if(_0x24b12e&&_0x13a877){_0x13a877[_0xa90a('0x1f')]-=0x1;var _0x3a8fc4={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format'](_0xa90a('0x21')),'reason':_0xa90a('0x32')};logger[_0xa90a('0x2b')](util[_0xa90a('0x13')](_0xa90a('0x33'),_0x24b12e,_0x13a877[_0xa90a('0x2c')]));emitChannelQueueInteraction(_0x4a757d[_0xa90a('0x24')],_0x13a877[_0xa90a('0x2c')],_0x4a757d[_0xa90a('0x20')],_0x4a757d[_0xa90a('0xd')][_0xa90a('0x2c')],_0x4a757d[_0xa90a('0x28')]['id'],![],_0x5c18a2,_0x13a877['id']);if(rpc[_0x4a757d[_0xa90a('0x24')]+_0xa90a('0x2d')]){return rpc[_0x4a757d['channel']+_0xa90a('0x2d')][_0xa90a('0x34')](_0x24b12e,_0x3a8fc4)[_0xa90a('0x2f')](function(_0x1841c6){logger[_0xa90a('0x30')](_0xa90a('0x35'));});}}}function endRouting(_0x3d6bc2,_0x253a93,_0x332362,_0x53a78b){if(_0x3d6bc2&&_0x253a93){_0x253a93['waiting']-=0x1;var _0x1a26b0={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xa90a('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xa90a('0x36')};logger[_0xa90a('0x2b')](util[_0xa90a('0x13')](_0xa90a('0x37'),_0x3d6bc2,_0x253a93['name']));emitChannelQueueInteraction(_0x332362[_0xa90a('0x24')],_0x253a93[_0xa90a('0x2c')],_0x332362[_0xa90a('0x20')],_0x332362[_0xa90a('0xd')][_0xa90a('0x2c')],_0x332362[_0xa90a('0x28')]['id'],![],_0x53a78b);if(rpc[_0x332362[_0xa90a('0x24')]+_0xa90a('0x2d')]){return rpc[_0x332362[_0xa90a('0x24')]+_0xa90a('0x2d')][_0xa90a('0x34')](_0x3d6bc2,_0x1a26b0)['catch'](function(_0x55b1a9){logger[_0xa90a('0x30')](_0xa90a('0x35'));});}}}function handleFindQueue(_0x29fbd4){return function(_0x1e50a3){return _0x1e50a3[_0xa90a('0x2c')][_0xa90a('0x38')]()===_0x29fbd4[_0xa90a('0x38')]();};}exports[_0xa90a('0x39')]=function(_0x45ec2b,_0x4c2809,_0x4c5a51,_0x5dace0){return function(_0x17a349){try{var _0x6e9b77={'name':_0x4c2809[0x0],'timeout':_0x4c2809[0x1]};var _0x32324d=queue[_0xa90a('0x0')](_0x6e9b77,{'typecast':!![]});if(_0x32324d[_0xa90a('0x3a')]){logger[_0xa90a('0x30')](_0xa90a('0x3b'),_0x45ec2b,_[_0xa90a('0x3c')](_0x32324d,_0xa90a('0x28'))[_0xa90a('0x3d')](',\x20'));_0x17a349['stop']();}else{var _0x5d7847=_[_0xa90a('0x3e')](_0x4c5a51[_0x5dace0[_0xa90a('0x24')]+'Queues'],handleFindQueue(_0x6e9b77[_0xa90a('0x2c')]));if(_0x5d7847){startRouting(_0x45ec2b,_0x5d7847,_0x5dace0,_0x4c5a51);var _0x589fe4=(_0x5d7847[_0xa90a('0x36')]||0xa)*0x3e8;var _0x22977e=(_0x6e9b77['timeout']||0x14)*0x3e8;var _0x56a1e8,_0x10c705;if(_0x589fe4>_0x22977e){_0x22977e=_0x589fe4;}var _0x5a9b2b=seqqueue[_0xa90a('0x3f')](_0x589fe4);_0x5a9b2b['id']=_0x45ec2b;_0x5a9b2b[_0xa90a('0x40')]=_0x589fe4;_0x5a9b2b[_0xa90a('0x41')]=_0x22977e;_0x5a9b2b[_0xa90a('0x24')]=_0x5dace0[_0xa90a('0x24')];_0x4c5a51[_0xa90a('0x42')][_0x45ec2b]['on'](_0xa90a('0x43'),function(){logger[_0xa90a('0x2b')](_0xa90a('0x44'),_0x45ec2b);stopRouting(_0x45ec2b,_0x5d7847,_0x5dace0,_0x4c5a51);clearTimeout(_0x56a1e8);_0x56a1e8=undefined;_0x5a9b2b['close'](!![]);if(_0x4c5a51[_0xa90a('0x42')][_0x45ec2b]){delete _0x4c5a51['rules'][_0x45ec2b];}_0x17a349[_0xa90a('0x45')]();});_0x4c5a51[_0xa90a('0x42')][_0x45ec2b]['on'](_0xa90a('0x46'),function(){if(_0x4c5a51[_0xa90a('0x42')][_0x45ec2b]){delete _0x4c5a51[_0xa90a('0x42')][_0x45ec2b];}});_0x56a1e8=setTimeout(function(){logger[_0xa90a('0x2b')](_0xa90a('0x47'),_0x45ec2b);endRouting(_0x45ec2b,_0x5d7847,_0x5dace0,_0x4c5a51);clearTimeout(_0x56a1e8);_0x5a9b2b['close'](!![]);_0x17a349[_0xa90a('0x48')]();},_0x22977e);switch(_0x5d7847['strategy']){case _0xa90a('0x49'):strategy['rrmemory'](_0x5a9b2b,_0x5d7847,_0x4c5a51,_0x5dace0);break;default:strategy[_0xa90a('0x4a')](_0x5a9b2b,_0x5d7847,_0x4c5a51,_0x5dace0);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x45ec2b,_0x6e9b77[_0xa90a('0x2c')]);_0x17a349[_0xa90a('0x45')]();}}}catch(_0x2d7732){console[_0xa90a('0x4b')](_0x2d7732);logger['error'](_0xa90a('0x3b'),_0x45ec2b,_0x2d7732[_0xa90a('0x4c')]);_0x17a349[_0xa90a('0x45')]();}};}; \ 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 3635834..ad1e672 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 _0x5aeb=['channel','busy','busyQueue','showNotification','notificationId','writeLog','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','STOP','TIMEOUT','uuid','./util','routing','agent','squeue','push','handleRun','handleTimeout','bind','timeout','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable'];(function(_0x255adf,_0x1b31bb){var _0x142ff8=function(_0x3d2b60){while(--_0x3d2b60){_0x255adf['push'](_0x255adf['shift']());}};_0x142ff8(++_0x1b31bb);}(_0x5aeb,0x180));var _0xb5ae=function(_0x1cf11d,_0x5435ba){_0x1cf11d=_0x1cf11d-0x0;var _0x43212a=_0x5aeb[_0x1cf11d];return _0x43212a;};'use strict';var _=require('lodash');var uuid=require(_0xb5ae('0x0'));var util=require(_0xb5ae('0x1'));var logger=require('../../../../../config/logger')(_0xb5ae('0x2'));var Agent=function(_0xb4ceeb,_0x294a5a,_0x45b0e6,_0x3bd2e5){this['notificationId']=uuid['v4']();this['squeue']=_0xb4ceeb;this[_0xb5ae('0x3')]=_0x294a5a;this['realtime']=_0x45b0e6;this[_0xb5ae('0x2')]=_0x3bd2e5;this[_0xb5ae('0x4')][_0xb5ae('0x5')](this[_0xb5ae('0x6')]['bind'](this),this[_0xb5ae('0x7')][_0xb5ae('0x8')](this));this[_0xb5ae('0x4')]['on'](_0xb5ae('0x9'),this[_0xb5ae('0x7')][_0xb5ae('0x8')](this));this[_0xb5ae('0x4')]['on']('drained',this[_0xb5ae('0xa')][_0xb5ae('0x8')](this));};Agent[_0xb5ae('0xb')][_0xb5ae('0x5')]=function(){this[_0xb5ae('0x4')][_0xb5ae('0x5')](this['handleRun'][_0xb5ae('0x8')](this),this[_0xb5ae('0x7')][_0xb5ae('0x8')](this));};Agent[_0xb5ae('0xb')][_0xb5ae('0xa')]=function(){this[_0xb5ae('0x7')](!![]);};Agent[_0xb5ae('0xb')]['handleRun']=function(_0x4eb28a){logger[_0xb5ae('0xc')](_0xb5ae('0xd'),this['squeue']['id'],this[_0xb5ae('0x3')]['id']);if(_[_0xb5ae('0xe')](this[_0xb5ae('0xf')][_0xb5ae('0x10')][this[_0xb5ae('0x3')]['id']])){logger[_0xb5ae('0xc')](_0xb5ae('0x11'),this[_0xb5ae('0x4')]['id'],this['agent']['id']);setTimeout(this['push'][_0xb5ae('0x8')](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util[_0xb5ae('0x12')](this[_0xb5ae('0x4')]['id'],this[_0xb5ae('0xf')][_0xb5ae('0x10')][this[_0xb5ae('0x3')]['id']],this[_0xb5ae('0x4')][_0xb5ae('0x13')],![])){this[_0xb5ae('0xf')]['agents'][this[_0xb5ae('0x3')]['id']][_0xb5ae('0x14')]=!![];this[_0xb5ae('0xf')][_0xb5ae('0x10')][this[_0xb5ae('0x3')]['id']][_0xb5ae('0x15')]=undefined;util[_0xb5ae('0x16')](this[_0xb5ae('0x17')],this[_0xb5ae('0x4')]['id'],this[_0xb5ae('0xf')][_0xb5ae('0x10')][this[_0xb5ae('0x3')]['id']],null,this[_0xb5ae('0x2')]);util[_0xb5ae('0x18')](this[_0xb5ae('0x4')]['id'],this[_0xb5ae('0xf')][_0xb5ae('0x10')][this['agent']['id']],_0xb5ae('0x19')+(this['routing'][_0xb5ae('0x1a')]?_0xb5ae('0x1b'):''));}else{logger['info'](_0xb5ae('0x1c'),this[_0xb5ae('0x4')]['id'],this[_0xb5ae('0x3')]['id']);setTimeout(this['push'][_0xb5ae('0x8')](this),0x3e8);}}};Agent[_0xb5ae('0xb')][_0xb5ae('0x7')]=function(_0x22b244){if(_[_0xb5ae('0xe')](this['realtime'][_0xb5ae('0x10')][this['agent']['id']])){return logger[_0xb5ae('0xc')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xb5ae('0x4')]['id'],this['agent']['id']);}else{logger[_0xb5ae('0xc')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xb5ae('0x4')]['id'],this[_0xb5ae('0x3')]['id']);util['hideNotification'](this[_0xb5ae('0x17')],this['squeue']['id'],this[_0xb5ae('0xf')]['agents'][this[_0xb5ae('0x3')]['id']],null,this['routing']);this[_0xb5ae('0xf')][_0xb5ae('0x10')][this[_0xb5ae('0x3')]['id']][_0xb5ae('0x14')]=![];this[_0xb5ae('0xf')][_0xb5ae('0x10')][this['agent']['id']][_0xb5ae('0x15')]=undefined;util[_0xb5ae('0x18')](this[_0xb5ae('0x4')]['id'],this[_0xb5ae('0xf')][_0xb5ae('0x10')][this[_0xb5ae('0x3')]['id']],_0x22b244?_0xb5ae('0x1d'):_0xb5ae('0x1e'));}if(!_0x22b244){setTimeout(this[_0xb5ae('0x5')]['bind'](this),0x3e8);}};function agent(_0x3c129b,_0x55cb2c,_0x211821,_0x3225ed){return new Agent(_0x3c129b,_0x55cb2c,_0x211821,_0x3225ed);}module['exports']=agent; \ No newline at end of file +var _0xda46=['isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','realtime','agents','channel','busy','busyQueue','showNotification','RINGING','[%s][AGENT]\x20timeout\x20with\x20%s','writeLog','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','push','bind','handleTimeout','timeout','drained','prototype','handleDrained','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','agent'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xda46,0x118));var _0x6da4=function(_0x56ee06,_0x1558cf){_0x56ee06=_0x56ee06-0x0;var _0x20032c=_0xda46[_0x56ee06];return _0x20032c;};'use strict';var _=require('lodash');var uuid=require(_0x6da4('0x0'));var util=require(_0x6da4('0x1'));var logger=require(_0x6da4('0x2'))(_0x6da4('0x3'));var Agent=function(_0x476805,_0x7b96a0,_0x119df0,_0x32fbf2){this[_0x6da4('0x4')]=uuid['v4']();this[_0x6da4('0x5')]=_0x476805;this['agent']=_0x7b96a0;this['realtime']=_0x119df0;this['routing']=_0x32fbf2;this[_0x6da4('0x5')][_0x6da4('0x6')](this['handleRun'][_0x6da4('0x7')](this),this[_0x6da4('0x8')][_0x6da4('0x7')](this));this[_0x6da4('0x5')]['on'](_0x6da4('0x9'),this[_0x6da4('0x8')][_0x6da4('0x7')](this));this[_0x6da4('0x5')]['on'](_0x6da4('0xa'),this['handleDrained']['bind'](this));};Agent[_0x6da4('0xb')]['push']=function(){this[_0x6da4('0x5')][_0x6da4('0x6')](this['handleRun'][_0x6da4('0x7')](this),this[_0x6da4('0x8')]['bind'](this));};Agent[_0x6da4('0xb')][_0x6da4('0xc')]=function(){this[_0x6da4('0x8')](!![]);};Agent[_0x6da4('0xb')][_0x6da4('0xd')]=function(_0x377f5e){logger[_0x6da4('0xe')](_0x6da4('0xf'),this[_0x6da4('0x5')]['id'],this[_0x6da4('0x10')]['id']);if(_[_0x6da4('0x11')](this['realtime']['agents'][this[_0x6da4('0x10')]['id']])){logger[_0x6da4('0xe')](_0x6da4('0x12'),this[_0x6da4('0x5')]['id'],this[_0x6da4('0x10')]['id']);setTimeout(this[_0x6da4('0x6')][_0x6da4('0x7')](this),0x3e8);}else{if(this[_0x6da4('0x3')][_0x6da4('0x13')]||util[_0x6da4('0x14')](this[_0x6da4('0x5')]['id'],this[_0x6da4('0x15')][_0x6da4('0x16')][this['agent']['id']],this[_0x6da4('0x5')][_0x6da4('0x17')],![])){this['realtime'][_0x6da4('0x16')][this[_0x6da4('0x10')]['id']][_0x6da4('0x18')]=!![];this['realtime']['agents'][this[_0x6da4('0x10')]['id']][_0x6da4('0x19')]=undefined;util[_0x6da4('0x1a')](this['notificationId'],this[_0x6da4('0x5')]['id'],this[_0x6da4('0x15')]['agents'][this[_0x6da4('0x10')]['id']],null,this[_0x6da4('0x3')]);util['writeLog'](this['squeue']['id'],this['realtime'][_0x6da4('0x16')][this[_0x6da4('0x10')]['id']],_0x6da4('0x1b')+(this['routing'][_0x6da4('0x13')]?':FORCED':''));}else{logger['info']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x6da4('0x5')]['id'],this[_0x6da4('0x10')]['id']);setTimeout(this[_0x6da4('0x6')][_0x6da4('0x7')](this),0x3e8);}}};Agent[_0x6da4('0xb')][_0x6da4('0x8')]=function(_0x254bbf){if(_[_0x6da4('0x11')](this['realtime'][_0x6da4('0x16')][this[_0x6da4('0x10')]['id']])){return logger[_0x6da4('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x6da4('0x5')]['id'],this[_0x6da4('0x10')]['id']);}else{logger[_0x6da4('0xe')](_0x6da4('0x1c'),this[_0x6da4('0x5')]['id'],this[_0x6da4('0x10')]['id']);util['hideNotification'](this[_0x6da4('0x4')],this[_0x6da4('0x5')]['id'],this[_0x6da4('0x15')][_0x6da4('0x16')][this[_0x6da4('0x10')]['id']],null,this[_0x6da4('0x3')]);this[_0x6da4('0x15')]['agents'][this[_0x6da4('0x10')]['id']][_0x6da4('0x18')]=![];this[_0x6da4('0x15')][_0x6da4('0x16')][this[_0x6da4('0x10')]['id']][_0x6da4('0x19')]=undefined;util[_0x6da4('0x1d')](this[_0x6da4('0x5')]['id'],this[_0x6da4('0x15')][_0x6da4('0x16')][this[_0x6da4('0x10')]['id']],_0x254bbf?_0x6da4('0x1e'):_0x6da4('0x1f'));}if(!_0x254bbf){setTimeout(this[_0x6da4('0x6')][_0x6da4('0x7')](this),0x3e8);}};function agent(_0x5d5b71,_0x534dd8,_0x547e87,_0x95ac1e){return new Agent(_0x5d5b71,_0x534dd8,_0x547e87,_0x95ac1e);}module[_0x6da4('0x20')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index f3f85f4..cc8f5b5 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 _0x49c4=['realtime','squeue','push','handleRun','bind','handleTimeout','timeout','drained','prototype','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','busyQueue','name','showNotification','notificationId','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','TIMEOUT','busy','exports','lodash','./util','../../../../../config/logger','routing','queue'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x49c4,0x9b));var _0x449c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x49c4[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x449c('0x0'));var uuid=require('uuid');var util=require(_0x449c('0x1'));var logger=require(_0x449c('0x2'))(_0x449c('0x3'));var Beepall=function(_0x1d60ee,_0x2646ac,_0x16e006,_0x23314e){this['notificationId']=uuid['v4']();this['squeue']=_0x1d60ee;this[_0x449c('0x4')]=_0x2646ac;this[_0x449c('0x5')]=_0x16e006;this[_0x449c('0x3')]=_0x23314e;this[_0x449c('0x6')][_0x449c('0x7')](this[_0x449c('0x8')][_0x449c('0x9')](this),this[_0x449c('0xa')][_0x449c('0x9')](this));this[_0x449c('0x6')]['on'](_0x449c('0xb'),this[_0x449c('0xa')][_0x449c('0x9')](this));this[_0x449c('0x6')]['on'](_0x449c('0xc'),this['handleDrained']['bind'](this));};Beepall[_0x449c('0xd')][_0x449c('0x7')]=function(){this['squeue']['push'](this['handleRun'][_0x449c('0x9')](this),this[_0x449c('0xa')][_0x449c('0x9')](this));};Beepall[_0x449c('0xd')]['handleDrained']=function(_0x467eee){this['handleTimeout'](!![]);};Beepall[_0x449c('0xd')]['handleRun']=function(_0x29f653){var _0x40f876=!![];if(!_[_0x449c('0xe')](this[_0x449c('0x4')])&&!_[_0x449c('0xe')](this[_0x449c('0x4')][_0x449c('0xf')])&&this[_0x449c('0x4')][_0x449c('0xf')][_0x449c('0x10')]>0x0){for(var _0x551b31=0x0,_0x4312d9;_0x551b310x0){for(var _0x53a8db=0x0,_0x352874;_0x53a8db0x0&&_0x3199e2[_0x200f16+_0x3189('0x22')]>=_0x3199e2[_0x200f16+_0x3189('0x21')]){writeLog(_0x4bfc03,_0x3199e2,_0x200f16[_0x3189('0x23')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x5aa34a,_0x2a8308,_0x3d7d5b,_0x1be399,_0x90c31){return sendNotification(!![],_0x5aa34a,_0x2a8308,_0x3d7d5b,_0x1be399,_0x90c31);};exports[_0x3189('0x24')]=function(_0x2f7504,_0x4d453a,_0x1ab94b,_0x37b9ec,_0x4bd677){return sendNotification(![],_0x2f7504,_0x4d453a,_0x1ab94b,_0x37b9ec,_0x4bd677);};exports[_0x3189('0x25')]=writeLog; \ No newline at end of file +var _0xf2e3=['../../../../../config/logger','routing','redis','defaults','socket.io-emitter','emit','format','user:%s','name','user:save','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','message','save','remove','info','isAgentAvailable','busy','BUSY','PAUSE','hasOwnProperty','Capacity','toUpperCase','\x20MAXCAPACITY','showNotification','writeLog','lodash','../utils','mustache','ioredis','../../../../../config/environment'];(function(_0x502815,_0x34c00e){var _0x101669=function(_0x45b4d3){while(--_0x45b4d3){_0x502815['push'](_0x502815['shift']());}};_0x101669(++_0x34c00e);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xf2e3[_0x307d86];return _0x361745;};'use strict';var _=require(_0x3f2e('0x0'));var util=require('util');var utils=require(_0x3f2e('0x1'));var Mustache=require(_0x3f2e('0x2'));var Redis=require(_0x3f2e('0x3'));var config=require(_0x3f2e('0x4'));var logger=require(_0x3f2e('0x5'))(_0x3f2e('0x6'));config[_0x3f2e('0x7')]=_[_0x3f2e('0x8')](config[_0x3f2e('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x3f2e('0x9'))(new Redis(config[_0x3f2e('0x7')]));function emit(_0x3c0864,_0xdf499f,_0x12c6e7){io['to'](_0x3c0864)[_0x3f2e('0xa')](_0xdf499f,_0x12c6e7);}function sendNotification(_0x3636f6,_0x434e0c,_0x2676a7,_0x29a6cc,_0x21f22b,_0x32902a){io['to'](util[_0x3f2e('0xb')](_0x3f2e('0xc'),_0x29a6cc[_0x3f2e('0xd')]))[_0x3f2e('0xa')](_0x3f2e('0xe'),_0x29a6cc);var _0x475cd2=_0x32902a||{};var _0x39b819=_0x2676a7['split']('.');var _0x27c697={'uniqueid':_0x434e0c,'channel':_0x39b819[0x0],'id':_0x39b819[0x1],'title':_0x39b819[0x0]+_0x3f2e('0xf'),'interactionId':_0x39b819[0x2],'queue':_0x21f22b?_0x21f22b['name']:null,'sound':_0x475cd2[_0x3f2e('0x10')][_0x3f2e('0x11')],'shake':_0x475cd2[_0x3f2e('0x10')][_0x3f2e('0x12')]};try{if(!_0x475cd2[_0x3f2e('0x13')]){_0x475cd2['body']={};}if(_0x21f22b){_0x475cd2[_0x3f2e('0x13')][_0x3f2e('0x14')]=_0x21f22b;}else if(_0x475cd2[_0x3f2e('0x13')]['queue']){delete _0x475cd2[_0x3f2e('0x13')][_0x3f2e('0x14')];}_0x27c697[_0x3f2e('0x15')]=utils[_0x3f2e('0x16')](_0x475cd2[_0x3f2e('0x10')][_0x3f2e('0x17')],_0x475cd2);}catch(_0x1c2c0c){_0x27c697[_0x3f2e('0x15')]=_0x3f2e('0x18');logger[_0x3f2e('0x19')](util[_0x3f2e('0xb')]('[%s][QUEUE]\x20%s',_0x434e0c,_0x1c2c0c[_0x3f2e('0x1a')]));}io['to'](util[_0x3f2e('0xb')](_0x3f2e('0xc'),_0x29a6cc[_0x3f2e('0xd')]))[_0x3f2e('0xa')](util['format']('notification:%s',_0x3636f6?_0x3f2e('0x1b'):_0x3f2e('0x1c')),_0x27c697);}function writeLog(_0x38bbae,_0x2ac500,_0x4381e5){return logger[_0x3f2e('0x1d')](util['format']('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x38bbae,_0x2ac500[_0x3f2e('0xd')],_0x4381e5));}exports[_0x3f2e('0x1e')]=function(_0x5a66d6,_0x541292,_0x46bb1c,_0x5646f5){if(_0x541292[_0x3f2e('0x1f')]){writeLog(_0x5a66d6,_0x541292,_0x3f2e('0x20'));return![];}if(!_0x541292['online']){writeLog(_0x5a66d6,_0x541292,'OFFLINE');return![];}if(_0x541292[_0x46bb1c+'Pause']){writeLog(_0x5a66d6,_0x541292,_0x3f2e('0x21'));return![];}if(_0x5646f5&&_0x541292[_0x3f2e('0x22')](_0x46bb1c+'Capacity')&&_0x541292[_0x3f2e('0x22')](_0x46bb1c+'CurrentCapacity')){if(_0x541292[_0x46bb1c+_0x3f2e('0x23')]>0x0&&_0x541292[_0x46bb1c+'CurrentCapacity']>=_0x541292[_0x46bb1c+_0x3f2e('0x23')]){writeLog(_0x5a66d6,_0x541292,_0x46bb1c[_0x3f2e('0x24')]()+_0x3f2e('0x25'));return![];}}return!![];};exports[_0x3f2e('0x26')]=function(_0x11bad1,_0x4799d3,_0x426d68,_0x28ef64,_0x5eab38){return sendNotification(!![],_0x11bad1,_0x4799d3,_0x426d68,_0x28ef64,_0x5eab38);};exports['hideNotification']=function(_0x2b9fda,_0x1e5db4,_0x35f421,_0x22e6ad,_0x5452f5){return sendNotification(![],_0x2b9fda,_0x1e5db4,_0x35f421,_0x22e6ad,_0x5452f5);};exports[_0x3f2e('0x27')]=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 3a9f75e..e5508e0 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 _0x3189=['./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','validate','shelljs'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x3189,0xae));var _0x9318=function(_0x4a2613,_0xfe365d){_0x4a2613=_0x4a2613-0x0;var _0x4345e0=_0x3189[_0x4a2613];return _0x4345e0;};'use strict';var schema=require(_0x9318('0x0'));var sh=require(_0x9318('0x1'));var _=require('lodash');var utils=require(_0x9318('0x2'));var logger=require(_0x9318('0x3'))(_0x9318('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0x9318('0x5')}});exports['consequence']=function(_0x53a864,_0x3a559b){return function(_0xc25602){try{var _0x50b157={'command':_0x3a559b[0x0]};var _0x1175d3=system['validate'](_0x50b157,{'typecast':!![]});if(_0x1175d3['length']){logger[_0x9318('0x6')](_0x9318('0x7'),_0x53a864,_[_0x9318('0x8')](_0x1175d3,'message')[_0x9318('0x9')](',\x20'));logger[_0x9318('0xa')](_0x9318('0xb'),_0x53a864);_0xc25602[_0x9318('0xc')]();}else{var _0x58b98a=this;var _0x584ef7=utils[_0x9318('0xd')](_0x3a559b[0x0],this);logger['info'](_0x9318('0xe'),_0x53a864,_0x584ef7);sh[_0x9318('0xf')](_[_0x9318('0x10')](_0x584ef7),function(_0x5e45dd,_0x28a6b2){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x53a864,_0x5e45dd);if(_0x5e45dd==0x0){var _0x2ac258=_0x28a6b2['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x9318('0x11')](_0x3a559b[0x1])||_[_0x9318('0x12')](_0x3a559b[0x1])){logger['info'](_0x9318('0x13'),_0x53a864);_0x58b98a[_0x9318('0x14')][_0x3a559b[0x1]]=_0x2ac258;}else{logger[_0x9318('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x53a864,_0x3a559b[0x1],_0x2ac258);_0x58b98a['body'][_0x3a559b[0x1]]=_0x2ac258;}}_0xc25602[_0x9318('0xc')]();});}}catch(_0x11b380){logger['error'](_0x9318('0x7'),_0x53a864,_[_0x9318('0x15')](_0x11b380)?JSON['stringify'](_0x11b380):_0x11b380);logger[_0x9318('0xa')](_0x9318('0xb'),_0x53a864);_0xc25602[_0x9318('0xc')]();}};}; \ No newline at end of file +var _0x4169=['error','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','trim','replace','isNil','body','[%s][SYSTEM]\x20%s','stringify','shelljs','lodash','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate'];(function(_0x211831,_0x5e6e93){var _0x7b06b5=function(_0x55237b){while(--_0x55237b){_0x211831['push'](_0x211831['shift']());}};_0x7b06b5(++_0x5e6e93);}(_0x4169,0x14e));var _0x9416=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4169[_0x321bb2];return _0x9c12ed;};'use strict';var schema=require('validate');var sh=require(_0x9416('0x0'));var _=require(_0x9416('0x1'));var utils=require('./utils');var logger=require(_0x9416('0x2'))(_0x9416('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x9416('0x4')}});exports['consequence']=function(_0x32572f,_0x2c1f90){return function(_0x2acb3c){try{var _0x4143f4={'command':_0x2c1f90[0x0]};var _0x53b277=system[_0x9416('0x5')](_0x4143f4,{'typecast':!![]});if(_0x53b277['length']){logger[_0x9416('0x6')]('[%s][SYSTEM]\x20%s',_0x32572f,_[_0x9416('0x7')](_0x53b277,_0x9416('0x8'))[_0x9416('0x9')](',\x20'));logger[_0x9416('0xa')](_0x9416('0xb'),_0x32572f);_0x2acb3c[_0x9416('0xc')]();}else{var _0x3d196e=this;var _0x2101af=utils['getMustacheRender'](_0x2c1f90[0x0],this);logger[_0x9416('0xa')](_0x9416('0xd'),_0x32572f,_0x2101af);sh['exec'](_[_0x9416('0xe')](_0x2101af),function(_0x2c62fe,_0x1eff27){logger[_0x9416('0xa')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x32572f,_0x2c62fe);if(_0x2c62fe==0x0){var _0xaba84d=_0x1eff27[_0x9416('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0x9416('0x10')](_0x2c1f90[0x1])||_['isEmpty'](_0x2c1f90[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x32572f);_0x3d196e[_0x9416('0x11')][_0x2c1f90[0x1]]=_0xaba84d;}else{logger[_0x9416('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x32572f,_0x2c1f90[0x1],_0xaba84d);_0x3d196e[_0x9416('0x11')][_0x2c1f90[0x1]]=_0xaba84d;}}_0x2acb3c[_0x9416('0xc')]();});}}catch(_0x4cd31e){logger[_0x9416('0x6')](_0x9416('0x12'),_0x32572f,_['isObject'](_0x4cd31e)?JSON[_0x9416('0x13')](_0x4cd31e):_0x4cd31e);logger[_0x9416('0xa')](_0x9416('0xb'),_0x32572f);_0x2acb3c[_0x9416('0xc')]();}};}; \ 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 36f0c2f..63457f5 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 _0x3201=['lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','[%s][TAG]\x20%s','stringify','finally','validate'];(function(_0x556dbd,_0x336d04){var _0x3dc076=function(_0x1ed94e){while(--_0x1ed94e){_0x556dbd['push'](_0x556dbd['shift']());}};_0x3dc076(++_0x336d04);}(_0x3201,0x144));var _0x1320=function(_0x507965,_0x4944f4){_0x507965=_0x507965-0x0;var _0x3608fc=_0x3201[_0x507965];return _0x3608fc;};'use strict';var schema=require(_0x1320('0x0'));var _=require(_0x1320('0x1'));var rpc={'chatInteraction':require(_0x1320('0x2')),'openchannelInteraction':require(_0x1320('0x3')),'smsInteraction':require(_0x1320('0x4')),'mailInteraction':require(_0x1320('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x1320('0x6'))(_0x1320('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x1320('0x8')}});exports[_0x1320('0x9')]=function(_0xb84647,_0x52e215,_0x351344,_0x311f41){return function(_0xec5373){try{var _0x204621={'tag':_0x52e215[0x0]};var _0x34fd9f=tag['validate'](_0x204621,{'typecast':!![]});if(_0x34fd9f[_0x1320('0xa')]){logger[_0x1320('0xb')]('[%s][TAG]\x20%s',_0xb84647,_[_0x1320('0xc')](_0x34fd9f,_0x1320('0xd'))['join'](',\x20'));logger[_0x1320('0xe')](_0x1320('0xf'),_0xb84647);_0xec5373[_0x1320('0x10')]();}else{var _0x484a56={'ids':[_0x52e215[0x0]]};if(rpc[_0x311f41[_0x1320('0x11')]+_0x1320('0x12')]){rpc[_0x311f41[_0x1320('0x11')]+_0x1320('0x12')]['addTags'](_0x311f41[_0x1320('0x13')]['id'],_0x484a56)[_0x1320('0x14')](function(_0x1b99d1){logger['info'](_0x1320('0x15'),_0xb84647,_0x52e215[0x1],_0x311f41[_0x1320('0x11')],_0x311f41[_0x1320('0x13')]['id']);})['catch'](function(_0x1d7e7e){logger[_0x1320('0xb')](_0x1320('0x16'),_0xb84647,JSON[_0x1320('0x17')](_0x1d7e7e));logger[_0x1320('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xb84647);})[_0x1320('0x18')](function(){_0xec5373['next']();});}}}catch(_0x1b2afb){logger[_0x1320('0xb')]('[%s][TAG]\x20%s',_0xb84647,_['isObject'](_0x1b2afb)?JSON['stringify'](_0x1b2afb):_0x1b2afb);logger[_0x1320('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xb84647);_0xec5373[_0x1320('0x10')]();}};}; \ No newline at end of file +var _0x3db7=['interaction','catch','stringify','info','finally','[%s][TAG]\x20%s','isObject','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../../../config/logger','number','consequence','validate','error','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags'];(function(_0x25c1bd,_0x2b9085){var _0x1eea5f=function(_0x3b720c){while(--_0x3b720c){_0x25c1bd['push'](_0x25c1bd['shift']());}};_0x1eea5f(++_0x2b9085);}(_0x3db7,0x1d3));var _0x73db=function(_0x226117,_0xbd4a09){_0x226117=_0x226117-0x0;var _0x234450=_0x3db7[_0x226117];return _0x234450;};'use strict';var schema=require('validate');var _=require(_0x73db('0x0'));var rpc={'chatInteraction':require(_0x73db('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x73db('0x2')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x73db('0x3'))('routing');var tag=schema({'tag':{'type':_0x73db('0x4'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x73db('0x5')]=function(_0x7d227c,_0x305f86,_0x296431,_0x9b05aa){return function(_0x2179be){try{var _0x58405c={'tag':_0x305f86[0x0]};var _0x1adc95=tag[_0x73db('0x6')](_0x58405c,{'typecast':!![]});if(_0x1adc95['length']){logger[_0x73db('0x7')]('[%s][TAG]\x20%s',_0x7d227c,_[_0x73db('0x8')](_0x1adc95,_0x73db('0x9'))[_0x73db('0xa')](',\x20'));logger['info'](_0x73db('0xb'),_0x7d227c);_0x2179be[_0x73db('0xc')]();}else{var _0x65529f={'ids':[_0x305f86[0x0]]};if(rpc[_0x9b05aa[_0x73db('0xd')]+_0x73db('0xe')]){rpc[_0x9b05aa[_0x73db('0xd')]+_0x73db('0xe')][_0x73db('0xf')](_0x9b05aa[_0x73db('0x10')]['id'],_0x65529f)['then'](function(_0x3a593a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x7d227c,_0x305f86[0x1],_0x9b05aa[_0x73db('0xd')],_0x9b05aa[_0x73db('0x10')]['id']);})[_0x73db('0x11')](function(_0x373fb2){logger[_0x73db('0x7')]('[%s][TAG]\x20%s',_0x7d227c,JSON[_0x73db('0x12')](_0x373fb2));logger[_0x73db('0x13')](_0x73db('0xb'),_0x7d227c);})[_0x73db('0x14')](function(){_0x2179be[_0x73db('0xc')]();});}}}catch(_0x43cc27){logger[_0x73db('0x7')](_0x73db('0x15'),_0x7d227c,_[_0x73db('0x16')](_0x43cc27)?JSON[_0x73db('0x12')](_0x43cc27):_0x43cc27);logger[_0x73db('0x13')](_0x73db('0xb'),_0x7d227c);_0x2179be[_0x73db('0xc')]();}};}; \ 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 8c2884f..3151238 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x247ee1,_0x57d3fd){var _0x6f4bb5=function(_0x100e20){while(--_0x100e20){_0x247ee1['push'](_0x247ee1['shift']());}};_0x6f4bb5(++_0x57d3fd);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x211053,_0x169284){var _0x1c0896=function(_0xccfbdf){while(--_0xccfbdf){_0x211053['push'](_0x211053['shift']());}};_0x1c0896(++_0x169284);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 9b3a46c..ffdbc85 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 _0x0f69=['agent\x20not\x20found','chatQueues','available','loggedIn','mailQueues','name','paused','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','autoreply','appdata','split','push','slice','dialogflowv2','amazonlex','tag','format','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','emit','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime'];(function(_0x56fbaa,_0x3bc5a6){var _0x49fbc1=function(_0x19b08b){while(--_0x19b08b){_0x56fbaa['push'](_0x56fbaa['shift']());}};_0x49fbc1(++_0x3bc5a6);}(_0x0f69,0x6c));var _0x90f6=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x0f69[_0x2642cb];return _0xe6e41;};'use strict';var _=require('lodash');var util=require(_0x90f6('0x0'));var path=require(_0x90f6('0x1'));var fs=require('fs');var jayson=require(_0x90f6('0x2'));var BPromise=require('bluebird');var uuid=require('uuid');var config=require(_0x90f6('0x3'));var logger=require('../../../config/logger')(_0x90f6('0x4'));var rpc={'openchannelQueueReport':require(_0x90f6('0x5')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x90f6('0x6')),'smsQueueReport':require(_0x90f6('0x7')),'faxQueueReport':require(_0x90f6('0x8')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0xbcaaa1,_0x207729,_0x2542ad){return util['format']('%s.%s.%s',_0xbcaaa1,_0x207729||0x0,_0x2542ad||0x0);}function getIntervals(_0x461fdd,_0x3fe773){var _0x3543d2=[];if(!_[_0x90f6('0x9')](_0x3fe773[_0x90f6('0xa')])&&!_[_0x90f6('0x9')](_0x461fdd[_0x3fe773[_0x90f6('0xa')]])&&!_['isNil'](_0x461fdd[_0x3fe773[_0x90f6('0xa')]][_0x90f6('0xb')])){_0x3543d2=_[_0x90f6('0xc')](_0x461fdd[_0x3fe773[_0x90f6('0xa')]]['Intervals'],'interval');}else if(!_[_0x90f6('0x9')](_0x3fe773[_0x90f6('0xd')])){_0x3543d2=[_0x3fe773['interval']];}return _0x3543d2;}exports[_0x90f6('0xe')]=function(_0x178f6c){_0x178f6c[_0x90f6('0xf')]={};return new BPromise(function(_0x3882a3,_0x5030d5){var _0x59f7e4={'Start':function(_0x519c27){var _0x5a7861=this;return new Promise(function(_0x3367fb,_0x54a455){if(_0x519c27){try{var _0x44e17a=[];var _0x31e4db=getId(_0x519c27[_0x90f6('0x10')],_0x519c27[_0x90f6('0x11')]?_0x519c27[_0x90f6('0x11')]['id']:0x0,_0x519c27[_0x90f6('0x12')]?_0x519c27[_0x90f6('0x12')]['id']:0x0);if(_0x519c27[_0x90f6('0x13')]&&_[_0x90f6('0x14')](_0x519c27[_0x90f6('0x13')])&&_0x519c27[_0x90f6('0x13')][_0x90f6('0x15')]){for(var _0x41df1b=0x0;_0x41df1b<_0x519c27[_0x90f6('0x13')][_0x90f6('0x15')];_0x41df1b+=0x1){var _0x34f662=_0x519c27[_0x90f6('0x13')][_0x41df1b];if(fs[_0x90f6('0x16')](path[_0x90f6('0x17')](__dirname,_0x90f6('0x13'),_0x34f662[_0x90f6('0x18')]+'.js'))){var _0x5d3d9a=[];switch(_0x34f662['app']['toLowerCase']()){case _0x90f6('0x19'):var _0x45e118=_0x34f662[_0x90f6('0x1a')][_0x90f6('0x1b')](',');if(_0x519c27[_0x90f6('0x10')]==='mail'){_0x5d3d9a['push'](_0x45e118[0x0]);_0x5d3d9a['push'](_0x45e118[0x1]);_0x5d3d9a[_0x90f6('0x1c')](_0x45e118[_0x90f6('0x1d')](0x2,_0x45e118[_0x90f6('0x15')])[_0x90f6('0x17')](','));}else{_0x5d3d9a[_0x90f6('0x1c')](_0x45e118[0x0]);_0x5d3d9a[_0x90f6('0x1c')](_0x45e118[_0x90f6('0x1d')](0x1,_0x45e118[_0x90f6('0x15')])['join'](','));}break;case'dialogflow':var _0x2db51b=_0x34f662['appdata'][_0x90f6('0x1b')](',');_0x5d3d9a[_0x90f6('0x1c')](_0x2db51b[0x0]);_0x5d3d9a[_0x90f6('0x1c')](_0x2db51b[0x1]);_0x5d3d9a['push'](_0x2db51b['slice'](0x2,_0x2db51b[_0x90f6('0x15')])[_0x90f6('0x17')](','));break;case _0x90f6('0x1e'):var _0x2d6e6a=_0x34f662[_0x90f6('0x1a')][_0x90f6('0x1b')](',');_0x5d3d9a[_0x90f6('0x1c')](_0x2d6e6a[0x0]);_0x5d3d9a[_0x90f6('0x1c')](_0x2d6e6a[0x1]);_0x5d3d9a[_0x90f6('0x1c')](_0x2d6e6a[0x2]);_0x5d3d9a['push'](_0x2d6e6a[0x3]);_0x5d3d9a[_0x90f6('0x1c')](_0x2d6e6a[_0x90f6('0x1d')](0x4,_0x2d6e6a[_0x90f6('0x15')])['join'](','));break;case _0x90f6('0x1f'):var _0x55499e=_0x34f662[_0x90f6('0x1a')][_0x90f6('0x1b')](',');_0x5d3d9a[_0x90f6('0x1c')](_0x55499e[0x0]);_0x5d3d9a[_0x90f6('0x1c')](_0x55499e[0x1]);_0x5d3d9a[_0x90f6('0x1c')](_0x55499e[0x2]);_0x5d3d9a[_0x90f6('0x1c')](_0x55499e[0x3]);_0x5d3d9a[_0x90f6('0x1c')](_0x55499e[_0x90f6('0x1d')](0x4,_0x55499e[_0x90f6('0x15')])[_0x90f6('0x17')](','));break;case _0x90f6('0x11'):_0x5d3d9a[_0x90f6('0x1c')](_0x34f662[_0x90f6('0x1a')]);break;case _0x90f6('0x20'):_0x5d3d9a['push'](_0x34f662['TagId']);_0x5d3d9a[_0x90f6('0x1c')](_0x34f662[_0x90f6('0x1a')]);break;default:_0x5d3d9a=_[_0x90f6('0x9')](_0x34f662[_0x90f6('0x1a')])?[]:_0x34f662[_0x90f6('0x1a')][_0x90f6('0x1b')](',');}var _0x30943c={'id':util[_0x90f6('0x21')]('%s:%s:%s',_0x31e4db,_0x34f662['id'],_0x34f662['app']),'condition':require('./interval')['condition'](_0x31e4db,getIntervals(_0x178f6c[_0x90f6('0x22')],_0x34f662),_0x178f6c),'consequence':require(_0x90f6('0x23')+_0x34f662['app'])[_0x90f6('0x24')](_0x31e4db,_0x5d3d9a,_0x178f6c,_0x519c27),'p':_0x34f662['priority']||0x0};logger[_0x90f6('0x25')](_0x90f6('0x26'),_0x30943c['id'],_0x90f6('0x27'),getIntervals(_0x178f6c[_0x90f6('0x22')],_0x34f662)['join']('\x20|\x20'));_0x44e17a[_0x90f6('0x1c')](_0x30943c);}else{logger[_0x90f6('0x28')](_0x90f6('0x29'),path[_0x90f6('0x17')](__dirname,_0x90f6('0x13'),_0x34f662[_0x90f6('0x18')]+'.js'));}}_0x178f6c[_0x90f6('0xf')][_0x31e4db]=new RuleEngine(_0x44e17a);_0x178f6c['rules'][_0x31e4db]['execute'](_0x519c27,function(_0x4c35a7){logger['info'](_0x90f6('0x2a'),JSON['stringify'](_0x4c35a7['matchPath']));if(_0x178f6c[_0x90f6('0xf')][_0x31e4db]){_0x178f6c[_0x90f6('0xf')][_0x31e4db][_0x90f6('0x2b')]('complete');}});return _0x3367fb({'code':0xc8,'message':_0x519c27});}else{logger[_0x90f6('0x25')](_0x90f6('0x2c'));return _0x3367fb({'code':0xc8,'message':_0x519c27});}}catch(_0xac3bdc){logger[_0x90f6('0x28')](_0xac3bdc['stack']);return _0x54a455(_0x5a7861[_0x90f6('0x28')](0x1f4,_0xac3bdc));}}return _0x54a455(_0x90f6('0x2d'));});},'AcceptMessage':function(_0x5d23fc){var _0xb05948=this;return new Promise(function(_0x5cd4c4,_0x4117e9){if(_0x5d23fc[_0x90f6('0x2e')]&&_0x5d23fc['agent']['id']){if(_0x178f6c[_0x90f6('0x2f')][_0x5d23fc[_0x90f6('0x2e')]['id']]){_0x178f6c[_0x90f6('0x2f')][_0x5d23fc['agent']['id']][_0x90f6('0x30')]=![];_0x178f6c[_0x90f6('0x2f')][_0x5d23fc[_0x90f6('0x2e')]['id']][_0x90f6('0x31')]=undefined;}}if(_0x5d23fc[_0x90f6('0x11')]&&_0x5d23fc[_0x90f6('0x11')]['id']){try{var _0x33c6a6=getId(_0x5d23fc[_0x90f6('0x10')],_0x5d23fc['message']?_0x5d23fc[_0x90f6('0x11')]['id']:0x0,_0x5d23fc[_0x90f6('0x12')]?_0x5d23fc[_0x90f6('0x12')]['id']:0x0);if(_0x178f6c['rules'][_0x33c6a6]){_0x178f6c[_0x90f6('0xf')][_0x33c6a6]['emit'](_0x90f6('0x32'));if(rpc[_0x5d23fc['channel']+_0x90f6('0x33')]){rpc[_0x5d23fc[_0x90f6('0x10')]+_0x90f6('0x33')][_0x90f6('0x34')](_0x33c6a6,{'UserId':_0x5d23fc['message'][_0x90f6('0x35')]})[_0x90f6('0x36')](function(_0x5b1a36){logger[_0x90f6('0x28')](_0x90f6('0x37'));});}}return _0x5cd4c4({'code':0xc8,'message':_0x5d23fc});}catch(_0x3deeee){logger['error'](_0x3deeee[_0x90f6('0x38')]);return _0x4117e9(_0xb05948[_0x90f6('0x28')](0x1f4,_0x3deeee));}}logger[_0x90f6('0x28')](_0x90f6('0x39'));return _0x4117e9(_0xb05948[_0x90f6('0x28')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x26c5b9){var _0x4b8213=this;return new Promise(function(_0x66bb13,_0x3aaa68){if(_0x26c5b9[_0x90f6('0x2e')]&&_0x26c5b9[_0x90f6('0x2e')]['id']){try{if(_0x178f6c[_0x90f6('0x2f')][_0x26c5b9[_0x90f6('0x2e')]['id']]){_0x178f6c[_0x90f6('0x2f')][_0x26c5b9[_0x90f6('0x2e')]['id']][_0x90f6('0x30')]=![];_0x178f6c['agents'][_0x26c5b9[_0x90f6('0x2e')]['id']][_0x90f6('0x31')]=undefined;}return _0x66bb13({'code':0xc8,'message':_0x26c5b9});}catch(_0xfd0e1c){logger[_0x90f6('0x28')](_0xfd0e1c[_0x90f6('0x38')]);return _0x3aaa68(_0x4b8213[_0x90f6('0x28')](0x1f4,_0xfd0e1c));}}logger[_0x90f6('0x28')](_0x90f6('0x39'));return _0x3aaa68(_0x4b8213['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x2bd096){var _0x2f3eef=this;return new Promise(function(_0xbbc8ea,_0x224cb3){if(_0x2bd096[_0x90f6('0x10')]&&_0x2bd096[_0x90f6('0x12')]&&_0x2bd096['interaction']['id']){try{var _0x20a245=getId(_0x2bd096['channel'],_0x2bd096[_0x90f6('0x11')]?_0x2bd096[_0x90f6('0x11')]['id']:0x0,_0x2bd096[_0x90f6('0x12')]?_0x2bd096[_0x90f6('0x12')]['id']:0x0);if(_0x178f6c[_0x90f6('0xf')][_0x20a245]){_0x178f6c[_0x90f6('0xf')][_0x20a245]['emit'](_0x90f6('0x32'));}return _0xbbc8ea({'code':0xc8,'message':_0x2bd096});}catch(_0x2d3bdb){logger[_0x90f6('0x28')](_0x2d3bdb[_0x90f6('0x38')]);return _0x224cb3(_0x2f3eef['error'](0x1f4,_0x2d3bdb));}}logger['error'](_0x90f6('0x39'));return _0x224cb3(_0x2f3eef['error'](0x1f4,_0x90f6('0x39')));});},'AgentCapacity':function(_0x3b04a0){var _0x33bd82=this;return new Promise(function(_0x37ae46,_0x1109d7){if(_0x178f6c[_0x90f6('0x2f')][_0x90f6('0x3a')](_0x3b04a0['id'])){for(var _0x20709d in _0x3b04a0[_0x90f6('0x3b')]){if(_0x3b04a0[_0x90f6('0x3b')][_0x90f6('0x3a')](_0x20709d)){if(_0x178f6c[_0x90f6('0x2f')][_0x3b04a0['id']][_0x90f6('0x3a')](_0x20709d+_0x90f6('0x3c'))){_0x178f6c[_0x90f6('0x2f')][_0x3b04a0['id']][_0x20709d+'CurrentCapacity']=parseInt(_0x3b04a0[_0x90f6('0x3b')][_0x20709d],0xa);}}}_0x178f6c[_0x90f6('0x2f')][_0x3b04a0['id']][_0x90f6('0x3d')]();return _0x37ae46({'code':0xc8,'message':_0x178f6c[_0x90f6('0x2f')][_0x3b04a0['id']]});}else{return _0x1109d7(_0x33bd82[_0x90f6('0x28')](0x1f4,_0x90f6('0x3e')));}});},'Agents':function(_0xaa65d3){return new Promise(function(_0x27e0d0,_0x51ea25){var _0x49da46=_['values'](_0x178f6c[_0x90f6('0x2f')]);_0x27e0d0({'count':_0x49da46[_0x90f6('0x15')],'rows':_0x49da46});});},'ChatQueues':function(_0x5eb037){return new Promise(function(_0x3b78fc,_0x373d1b){var _0x3d8d47=[];for(var _0x4192b5 in _0x178f6c[_0x90f6('0x3f')]){if(_0x178f6c[_0x90f6('0x3f')][_0x90f6('0x3a')](_0x4192b5)){var _0x20657d=_0x178f6c['chatQueues'][_0x4192b5];var _0x5360dc={'id':_0x20657d['id'],'available':_0x20657d[_0x90f6('0x40')],'loggedIn':_0x20657d[_0x90f6('0x41')],'name':_0x20657d['name'],'paused':_0x20657d['paused'],'waiting':_0x20657d['waiting']};_0x3d8d47[_0x90f6('0x1c')](_0x5360dc);}}_0x3b78fc({'count':_0x3d8d47[_0x90f6('0x15')],'rows':_0x3d8d47});});},'MailQueues':function(_0x2e2349){return new Promise(function(_0x25085a,_0x24a5c6){var _0x35854a=[];for(var _0x12d44f in _0x178f6c[_0x90f6('0x42')]){if(_0x178f6c[_0x90f6('0x42')][_0x90f6('0x3a')](_0x12d44f)){var _0x12c3ab=_0x178f6c[_0x90f6('0x42')][_0x12d44f];var _0xe92080={'id':_0x12c3ab['id'],'available':_0x12c3ab[_0x90f6('0x40')],'loggedIn':_0x12c3ab[_0x90f6('0x41')],'name':_0x12c3ab[_0x90f6('0x43')],'paused':_0x12c3ab[_0x90f6('0x44')],'waiting':_0x12c3ab[_0x90f6('0x45')]};_0x35854a[_0x90f6('0x1c')](_0xe92080);}}_0x25085a({'count':_0x35854a[_0x90f6('0x15')],'rows':_0x35854a});});},'OpenchannelQueues':function(_0x180aff){return new Promise(function(_0x1c39ce,_0x2585ad){var _0x4dfa26=[];for(var _0x5dfd0c in _0x178f6c['openchannelQueues']){if(_0x178f6c[_0x90f6('0x46')]['hasOwnProperty'](_0x5dfd0c)){var _0x38eaa3=_0x178f6c[_0x90f6('0x46')][_0x5dfd0c];var _0xc43d66={'id':_0x38eaa3['id'],'available':_0x38eaa3[_0x90f6('0x40')],'loggedIn':_0x38eaa3['loggedIn'],'name':_0x38eaa3[_0x90f6('0x43')],'paused':_0x38eaa3[_0x90f6('0x44')],'waiting':_0x38eaa3[_0x90f6('0x45')]};_0x4dfa26[_0x90f6('0x1c')](_0xc43d66);}}_0x1c39ce({'count':_0x4dfa26[_0x90f6('0x15')],'rows':_0x4dfa26});});},'SmsQueues':function(_0x2519d7){return new Promise(function(_0x2a12d4,_0x24dc5f){var _0x424292=[];for(var _0x2e28a2 in _0x178f6c[_0x90f6('0x47')]){if(_0x178f6c[_0x90f6('0x47')][_0x90f6('0x3a')](_0x2e28a2)){var _0x5c92a2=_0x178f6c[_0x90f6('0x47')][_0x2e28a2];var _0x32fb3e={'id':_0x5c92a2['id'],'available':_0x5c92a2['available'],'loggedIn':_0x5c92a2[_0x90f6('0x41')],'name':_0x5c92a2[_0x90f6('0x43')],'paused':_0x5c92a2[_0x90f6('0x44')],'waiting':_0x5c92a2[_0x90f6('0x45')]};_0x424292[_0x90f6('0x1c')](_0x32fb3e);}}_0x2a12d4({'count':_0x424292[_0x90f6('0x15')],'rows':_0x424292});});},'FaxQueues':function(_0x335b3d){return new Promise(function(_0x617477,_0x56ffe9){var _0x37ea7b=[];for(var _0x402f2c in _0x178f6c[_0x90f6('0x48')]){if(_0x178f6c['faxQueues'][_0x90f6('0x3a')](_0x402f2c)){var _0x346d29=_0x178f6c['faxQueues'][_0x402f2c];var _0x111966={'id':_0x346d29['id'],'available':_0x346d29[_0x90f6('0x40')],'loggedIn':_0x346d29['loggedIn'],'name':_0x346d29[_0x90f6('0x43')],'paused':_0x346d29['paused'],'waiting':_0x346d29['waiting']};_0x37ea7b[_0x90f6('0x1c')](_0x111966);}}_0x617477({'count':_0x37ea7b[_0x90f6('0x15')],'rows':_0x37ea7b});});},'WhatsappQueues':function(_0x1f50fd){return new Promise(function(_0xa8b821,_0x1e504b){var _0x2f8db6=[];for(var _0x55d079 in _0x178f6c[_0x90f6('0x49')]){if(_0x178f6c['whatsappQueues'][_0x90f6('0x3a')](_0x55d079)){var _0x88428f=_0x178f6c['whatsappQueues'][_0x55d079];var _0x581b9f={'id':_0x88428f['id'],'available':_0x88428f['available'],'loggedIn':_0x88428f[_0x90f6('0x41')],'name':_0x88428f[_0x90f6('0x43')],'paused':_0x88428f[_0x90f6('0x44')],'waiting':_0x88428f['waiting']};_0x2f8db6[_0x90f6('0x1c')](_0x581b9f);}}_0xa8b821({'count':_0x2f8db6[_0x90f6('0x15')],'rows':_0x2f8db6});});},'ChatQueuesWaitingInteractions':function(_0x24b19f){return new Promise(function(_0x416076,_0x365698){var _0x56d44e=_[_0x90f6('0x4a')](_0x178f6c[_0x90f6('0x4b')]);_0x416076({'count':_0x56d44e[_0x90f6('0x15')],'rows':_0x56d44e});});},'MailQueuesWaitingInteractions':function(_0x13170a){return new Promise(function(_0x4de69e,_0x52421d){var _0x427abe=_['values'](_0x178f6c[_0x90f6('0x4c')]);_0x4de69e({'count':_0x427abe[_0x90f6('0x15')],'rows':_0x427abe});});},'OpenchannelQueuesWaitingInteractions':function(_0x505e97){return new Promise(function(_0x3b331d,_0x57ac59){var _0x454075=_[_0x90f6('0x4a')](_0x178f6c[_0x90f6('0x4d')]);_0x3b331d({'count':_0x454075[_0x90f6('0x15')],'rows':_0x454075});});},'SmsQueuesWaitingInteractions':function(_0xb8ba89){return new Promise(function(_0x45682e,_0x596dd0){var _0x3ac4d5=_['values'](_0x178f6c['smsQueuesWaitingInteractions']);_0x45682e({'count':_0x3ac4d5[_0x90f6('0x15')],'rows':_0x3ac4d5});});},'FaxQueuesWaitingInteractions':function(_0x53cb12){return new Promise(function(_0x1b3b34,_0x276801){var _0x36b3be=_[_0x90f6('0x4a')](_0x178f6c['faxQueuesWaitingInteractions']);_0x1b3b34({'count':_0x36b3be[_0x90f6('0x15')],'rows':_0x36b3be});});},'WhatsappQueuesWaitingInteractions':function(_0x831448){return new Promise(function(_0x991261,_0x431fe2){var _0x1d216f=_[_0x90f6('0x4a')](_0x178f6c[_0x90f6('0x4e')]);_0x991261({'count':_0x1d216f[_0x90f6('0x15')],'rows':_0x1d216f});});}};var _0x1858ce=jayson[_0x90f6('0x4f')](_0x59f7e4)[_0x90f6('0x50')]();_0x1858ce['on'](_0x90f6('0x28'),function(_0x236937){logger[_0x90f6('0x28')](JSON[_0x90f6('0x51')](_0x236937));return _0x5030d5(_0x236937);});_0x1858ce[_0x90f6('0xe')](0x232c,'127.0.0.1',function(){console[_0x90f6('0x52')](_0x90f6('0x53'),0x232c);return _0x3882a3(_0x90f6('0x54')+0x232c);});});}; \ No newline at end of file +var _0xd810=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','stringify','listen','127.0.0.1','lodash','util','jayson/promise','bluebird','../../../config/logger','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','interval','rules','channel','message','interaction','applications','length','existsSync','join','.js','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','app','consequence','priority','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','mailQueues','paused','waiting','openchannelQueues','smsQueues'];(function(_0x5def7a,_0x386e6c){var _0x1a5946=function(_0x4cace2){while(--_0x4cace2){_0x5def7a['push'](_0x5def7a['shift']());}};_0x1a5946(++_0x386e6c);}(_0xd810,0x1dd));var _0x0d81=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xd810[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require(_0x0d81('0x0'));var util=require(_0x0d81('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x0d81('0x2'));var BPromise=require(_0x0d81('0x3'));var uuid=require('uuid');var config=require('../../../config/environment');var logger=require(_0x0d81('0x4'))('routing');var rpc={'openchannelQueueReport':require(_0x0d81('0x5')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x0d81('0x6')),'smsQueueReport':require(_0x0d81('0x7')),'faxQueueReport':require(_0x0d81('0x8')),'whatsappQueueReport':require(_0x0d81('0x9'))};var RuleEngine=require(_0x0d81('0xa'));function getId(_0x11fd91,_0x1a5356,_0x43aee0){return util[_0x0d81('0xb')]('%s.%s.%s',_0x11fd91,_0x1a5356||0x0,_0x43aee0||0x0);}function getIntervals(_0x2417a5,_0x58de7f){var _0x457cee=[];if(!_[_0x0d81('0xc')](_0x58de7f['IntervalId'])&&!_[_0x0d81('0xc')](_0x2417a5[_0x58de7f[_0x0d81('0xd')]])&&!_['isNil'](_0x2417a5[_0x58de7f['IntervalId']][_0x0d81('0xe')])){_0x457cee=_['map'](_0x2417a5[_0x58de7f['IntervalId']][_0x0d81('0xe')],'interval');}else if(!_[_0x0d81('0xc')](_0x58de7f[_0x0d81('0xf')])){_0x457cee=[_0x58de7f[_0x0d81('0xf')]];}return _0x457cee;}exports['listen']=function(_0x436226){_0x436226[_0x0d81('0x10')]={};return new BPromise(function(_0x328221,_0x5ed805){var _0x3d0f74={'Start':function(_0x2967fe){var _0x1c16dd=this;return new Promise(function(_0x2ca06f,_0x237e95){if(_0x2967fe){try{var _0x27c279=[];var _0x5dfe2c=getId(_0x2967fe[_0x0d81('0x11')],_0x2967fe[_0x0d81('0x12')]?_0x2967fe[_0x0d81('0x12')]['id']:0x0,_0x2967fe[_0x0d81('0x13')]?_0x2967fe['interaction']['id']:0x0);if(_0x2967fe[_0x0d81('0x14')]&&_['isArray'](_0x2967fe[_0x0d81('0x14')])&&_0x2967fe[_0x0d81('0x14')][_0x0d81('0x15')]){for(var _0x37e74c=0x0;_0x37e74c<_0x2967fe[_0x0d81('0x14')][_0x0d81('0x15')];_0x37e74c+=0x1){var _0xedac9b=_0x2967fe[_0x0d81('0x14')][_0x37e74c];if(fs[_0x0d81('0x16')](path[_0x0d81('0x17')](__dirname,_0x0d81('0x14'),_0xedac9b['app']+_0x0d81('0x18')))){var _0x10de31=[];switch(_0xedac9b['app']['toLowerCase']()){case _0x0d81('0x19'):var _0x40d50f=_0xedac9b[_0x0d81('0x1a')][_0x0d81('0x1b')](',');if(_0x2967fe[_0x0d81('0x11')]===_0x0d81('0x1c')){_0x10de31[_0x0d81('0x1d')](_0x40d50f[0x0]);_0x10de31[_0x0d81('0x1d')](_0x40d50f[0x1]);_0x10de31['push'](_0x40d50f['slice'](0x2,_0x40d50f[_0x0d81('0x15')])[_0x0d81('0x17')](','));}else{_0x10de31['push'](_0x40d50f[0x0]);_0x10de31[_0x0d81('0x1d')](_0x40d50f[_0x0d81('0x1e')](0x1,_0x40d50f['length'])[_0x0d81('0x17')](','));}break;case _0x0d81('0x1f'):var _0x48560e=_0xedac9b[_0x0d81('0x1a')][_0x0d81('0x1b')](',');_0x10de31[_0x0d81('0x1d')](_0x48560e[0x0]);_0x10de31[_0x0d81('0x1d')](_0x48560e[0x1]);_0x10de31[_0x0d81('0x1d')](_0x48560e[_0x0d81('0x1e')](0x2,_0x48560e[_0x0d81('0x15')])[_0x0d81('0x17')](','));break;case _0x0d81('0x20'):var _0x238da2=_0xedac9b['appdata'][_0x0d81('0x1b')](',');_0x10de31['push'](_0x238da2[0x0]);_0x10de31[_0x0d81('0x1d')](_0x238da2[0x1]);_0x10de31['push'](_0x238da2[0x2]);_0x10de31[_0x0d81('0x1d')](_0x238da2[0x3]);_0x10de31[_0x0d81('0x1d')](_0x238da2[_0x0d81('0x1e')](0x4,_0x238da2[_0x0d81('0x15')])[_0x0d81('0x17')](','));break;case _0x0d81('0x21'):var _0x43cc29=_0xedac9b['appdata'][_0x0d81('0x1b')](',');_0x10de31[_0x0d81('0x1d')](_0x43cc29[0x0]);_0x10de31[_0x0d81('0x1d')](_0x43cc29[0x1]);_0x10de31[_0x0d81('0x1d')](_0x43cc29[0x2]);_0x10de31[_0x0d81('0x1d')](_0x43cc29[0x3]);_0x10de31['push'](_0x43cc29[_0x0d81('0x1e')](0x4,_0x43cc29[_0x0d81('0x15')])['join'](','));break;case _0x0d81('0x12'):_0x10de31[_0x0d81('0x1d')](_0xedac9b['appdata']);break;case _0x0d81('0x22'):_0x10de31[_0x0d81('0x1d')](_0xedac9b[_0x0d81('0x23')]);_0x10de31[_0x0d81('0x1d')](_0xedac9b[_0x0d81('0x1a')]);break;default:_0x10de31=_[_0x0d81('0xc')](_0xedac9b[_0x0d81('0x1a')])?[]:_0xedac9b[_0x0d81('0x1a')][_0x0d81('0x1b')](',');}var _0x123d7e={'id':util[_0x0d81('0xb')](_0x0d81('0x24'),_0x5dfe2c,_0xedac9b['id'],_0xedac9b['app']),'condition':require(_0x0d81('0x25'))[_0x0d81('0x26')](_0x5dfe2c,getIntervals(_0x436226[_0x0d81('0x27')],_0xedac9b),_0x436226),'consequence':require(_0x0d81('0x28')+_0xedac9b[_0x0d81('0x29')])[_0x0d81('0x2a')](_0x5dfe2c,_0x10de31,_0x436226,_0x2967fe),'p':_0xedac9b[_0x0d81('0x2b')]||0x0};logger[_0x0d81('0x2c')]('Push\x20new\x20rule',_0x123d7e['id'],_0x0d81('0x2d'),getIntervals(_0x436226['intervals'],_0xedac9b)[_0x0d81('0x17')](_0x0d81('0x2e')));_0x27c279['push'](_0x123d7e);}else{logger[_0x0d81('0x2f')](_0x0d81('0x30'),path[_0x0d81('0x17')](__dirname,_0x0d81('0x14'),_0xedac9b[_0x0d81('0x29')]+_0x0d81('0x18')));}}_0x436226[_0x0d81('0x10')][_0x5dfe2c]=new RuleEngine(_0x27c279);_0x436226[_0x0d81('0x10')][_0x5dfe2c][_0x0d81('0x31')](_0x2967fe,function(_0x3fcb73){logger[_0x0d81('0x2c')](_0x0d81('0x32'),JSON['stringify'](_0x3fcb73['matchPath']));if(_0x436226[_0x0d81('0x10')][_0x5dfe2c]){_0x436226['rules'][_0x5dfe2c][_0x0d81('0x33')](_0x0d81('0x34'));}});return _0x2ca06f({'code':0xc8,'message':_0x2967fe});}else{logger['info'](_0x0d81('0x35'));return _0x2ca06f({'code':0xc8,'message':_0x2967fe});}}catch(_0x12fbaa){logger[_0x0d81('0x2f')](_0x12fbaa[_0x0d81('0x36')]);return _0x237e95(_0x1c16dd[_0x0d81('0x2f')](0x1f4,_0x12fbaa));}}return _0x237e95(_0x0d81('0x37'));});},'AcceptMessage':function(_0x117391){var _0x28a00c=this;return new Promise(function(_0x4937da,_0x9390d2){if(_0x117391[_0x0d81('0x38')]&&_0x117391[_0x0d81('0x38')]['id']){if(_0x436226[_0x0d81('0x39')][_0x117391[_0x0d81('0x38')]['id']]){_0x436226[_0x0d81('0x39')][_0x117391[_0x0d81('0x38')]['id']][_0x0d81('0x3a')]=![];_0x436226[_0x0d81('0x39')][_0x117391[_0x0d81('0x38')]['id']][_0x0d81('0x3b')]=undefined;}}if(_0x117391[_0x0d81('0x12')]&&_0x117391['message']['id']){try{var _0x526cef=getId(_0x117391[_0x0d81('0x11')],_0x117391[_0x0d81('0x12')]?_0x117391[_0x0d81('0x12')]['id']:0x0,_0x117391[_0x0d81('0x13')]?_0x117391[_0x0d81('0x13')]['id']:0x0);if(_0x436226[_0x0d81('0x10')][_0x526cef]){_0x436226[_0x0d81('0x10')][_0x526cef]['emit'](_0x0d81('0x3c'));if(rpc[_0x117391[_0x0d81('0x11')]+_0x0d81('0x3d')]){rpc[_0x117391[_0x0d81('0x11')]+'QueueReport'][_0x0d81('0x3e')](_0x526cef,{'UserId':_0x117391['message'][_0x0d81('0x3f')]})['catch'](function(_0x3c4eb7){logger['error'](_0x0d81('0x40'));});}}return _0x4937da({'code':0xc8,'message':_0x117391});}catch(_0x2d3120){logger[_0x0d81('0x2f')](_0x2d3120['stack']);return _0x9390d2(_0x28a00c['error'](0x1f4,_0x2d3120));}}logger[_0x0d81('0x2f')](_0x0d81('0x41'));return _0x9390d2(_0x28a00c[_0x0d81('0x2f')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x3afcb6){var _0x57e9c8=this;return new Promise(function(_0x428e63,_0x2e1c4a){if(_0x3afcb6['agent']&&_0x3afcb6[_0x0d81('0x38')]['id']){try{if(_0x436226['agents'][_0x3afcb6[_0x0d81('0x38')]['id']]){_0x436226['agents'][_0x3afcb6[_0x0d81('0x38')]['id']][_0x0d81('0x3a')]=![];_0x436226[_0x0d81('0x39')][_0x3afcb6[_0x0d81('0x38')]['id']][_0x0d81('0x3b')]=undefined;}return _0x428e63({'code':0xc8,'message':_0x3afcb6});}catch(_0x226ede){logger['error'](_0x226ede[_0x0d81('0x36')]);return _0x2e1c4a(_0x57e9c8[_0x0d81('0x2f')](0x1f4,_0x226ede));}}logger[_0x0d81('0x2f')](_0x0d81('0x41'));return _0x2e1c4a(_0x57e9c8[_0x0d81('0x2f')](0x1f4,_0x0d81('0x41')));});},'AbandonInteraction':function(_0x2ac41a){var _0x1ca43b=this;return new Promise(function(_0x4b243a,_0x20969d){if(_0x2ac41a[_0x0d81('0x11')]&&_0x2ac41a[_0x0d81('0x13')]&&_0x2ac41a['interaction']['id']){try{var _0x51635c=getId(_0x2ac41a[_0x0d81('0x11')],_0x2ac41a[_0x0d81('0x12')]?_0x2ac41a['message']['id']:0x0,_0x2ac41a[_0x0d81('0x13')]?_0x2ac41a[_0x0d81('0x13')]['id']:0x0);if(_0x436226[_0x0d81('0x10')][_0x51635c]){_0x436226[_0x0d81('0x10')][_0x51635c][_0x0d81('0x33')]('end');}return _0x4b243a({'code':0xc8,'message':_0x2ac41a});}catch(_0xd4f217){logger[_0x0d81('0x2f')](_0xd4f217['stack']);return _0x20969d(_0x1ca43b['error'](0x1f4,_0xd4f217));}}logger[_0x0d81('0x2f')](_0x0d81('0x41'));return _0x20969d(_0x1ca43b[_0x0d81('0x2f')](0x1f4,_0x0d81('0x41')));});},'AgentCapacity':function(_0x430db2){var _0x457bbe=this;return new Promise(function(_0x135a45,_0x4aee18){if(_0x436226[_0x0d81('0x39')][_0x0d81('0x42')](_0x430db2['id'])){for(var _0x5fb660 in _0x430db2[_0x0d81('0x43')]){if(_0x430db2[_0x0d81('0x43')][_0x0d81('0x42')](_0x5fb660)){if(_0x436226['agents'][_0x430db2['id']][_0x0d81('0x42')](_0x5fb660+_0x0d81('0x44'))){_0x436226[_0x0d81('0x39')][_0x430db2['id']][_0x5fb660+_0x0d81('0x44')]=parseInt(_0x430db2[_0x0d81('0x43')][_0x5fb660],0xa);}}}_0x436226['agents'][_0x430db2['id']][_0x0d81('0x45')]();return _0x135a45({'code':0xc8,'message':_0x436226[_0x0d81('0x39')][_0x430db2['id']]});}else{return _0x4aee18(_0x457bbe[_0x0d81('0x2f')](0x1f4,_0x0d81('0x46')));}});},'Agents':function(_0x4330b9){return new Promise(function(_0x3a84d8,_0x1160f3){var _0x3340cc=_[_0x0d81('0x47')](_0x436226['agents']);_0x3a84d8({'count':_0x3340cc['length'],'rows':_0x3340cc});});},'ChatQueues':function(_0x2ab321){return new Promise(function(_0x4f9276,_0x2f2f9d){var _0x58be9d=[];for(var _0x12906d in _0x436226[_0x0d81('0x48')]){if(_0x436226['chatQueues']['hasOwnProperty'](_0x12906d)){var _0x34bc85=_0x436226['chatQueues'][_0x12906d];var _0x22c42b={'id':_0x34bc85['id'],'available':_0x34bc85[_0x0d81('0x49')],'loggedIn':_0x34bc85[_0x0d81('0x4a')],'name':_0x34bc85[_0x0d81('0x4b')],'paused':_0x34bc85['paused'],'waiting':_0x34bc85['waiting']};_0x58be9d[_0x0d81('0x1d')](_0x22c42b);}}_0x4f9276({'count':_0x58be9d['length'],'rows':_0x58be9d});});},'MailQueues':function(_0x30aa47){return new Promise(function(_0x3aaca3,_0x407f25){var _0x2be9a8=[];for(var _0x28083a in _0x436226[_0x0d81('0x4c')]){if(_0x436226['mailQueues'][_0x0d81('0x42')](_0x28083a)){var _0x21f4c0=_0x436226[_0x0d81('0x4c')][_0x28083a];var _0x3934cb={'id':_0x21f4c0['id'],'available':_0x21f4c0[_0x0d81('0x49')],'loggedIn':_0x21f4c0['loggedIn'],'name':_0x21f4c0[_0x0d81('0x4b')],'paused':_0x21f4c0[_0x0d81('0x4d')],'waiting':_0x21f4c0[_0x0d81('0x4e')]};_0x2be9a8[_0x0d81('0x1d')](_0x3934cb);}}_0x3aaca3({'count':_0x2be9a8[_0x0d81('0x15')],'rows':_0x2be9a8});});},'OpenchannelQueues':function(_0x5f1834){return new Promise(function(_0xbc52ca,_0x1337fe){var _0x17ab78=[];for(var _0x5703b5 in _0x436226[_0x0d81('0x4f')]){if(_0x436226['openchannelQueues'][_0x0d81('0x42')](_0x5703b5)){var _0x27d473=_0x436226[_0x0d81('0x4f')][_0x5703b5];var _0x4193f7={'id':_0x27d473['id'],'available':_0x27d473[_0x0d81('0x49')],'loggedIn':_0x27d473[_0x0d81('0x4a')],'name':_0x27d473['name'],'paused':_0x27d473['paused'],'waiting':_0x27d473[_0x0d81('0x4e')]};_0x17ab78[_0x0d81('0x1d')](_0x4193f7);}}_0xbc52ca({'count':_0x17ab78[_0x0d81('0x15')],'rows':_0x17ab78});});},'SmsQueues':function(_0x277020){return new Promise(function(_0x140c96,_0x196718){var _0x35e9cc=[];for(var _0x392028 in _0x436226[_0x0d81('0x50')]){if(_0x436226[_0x0d81('0x50')]['hasOwnProperty'](_0x392028)){var _0x39aeba=_0x436226[_0x0d81('0x50')][_0x392028];var _0x26d913={'id':_0x39aeba['id'],'available':_0x39aeba[_0x0d81('0x49')],'loggedIn':_0x39aeba[_0x0d81('0x4a')],'name':_0x39aeba[_0x0d81('0x4b')],'paused':_0x39aeba[_0x0d81('0x4d')],'waiting':_0x39aeba[_0x0d81('0x4e')]};_0x35e9cc[_0x0d81('0x1d')](_0x26d913);}}_0x140c96({'count':_0x35e9cc['length'],'rows':_0x35e9cc});});},'FaxQueues':function(_0x399396){return new Promise(function(_0x2463dc,_0x1e8c36){var _0x201744=[];for(var _0xe135df in _0x436226[_0x0d81('0x51')]){if(_0x436226[_0x0d81('0x51')][_0x0d81('0x42')](_0xe135df)){var _0x3a6ea5=_0x436226[_0x0d81('0x51')][_0xe135df];var _0x5609ac={'id':_0x3a6ea5['id'],'available':_0x3a6ea5[_0x0d81('0x49')],'loggedIn':_0x3a6ea5[_0x0d81('0x4a')],'name':_0x3a6ea5[_0x0d81('0x4b')],'paused':_0x3a6ea5[_0x0d81('0x4d')],'waiting':_0x3a6ea5[_0x0d81('0x4e')]};_0x201744[_0x0d81('0x1d')](_0x5609ac);}}_0x2463dc({'count':_0x201744[_0x0d81('0x15')],'rows':_0x201744});});},'WhatsappQueues':function(_0x607814){return new Promise(function(_0x4c6cda,_0x47cfbf){var _0x20633a=[];for(var _0x34652e in _0x436226[_0x0d81('0x52')]){if(_0x436226[_0x0d81('0x52')][_0x0d81('0x42')](_0x34652e)){var _0x199b62=_0x436226['whatsappQueues'][_0x34652e];var _0x23706c={'id':_0x199b62['id'],'available':_0x199b62[_0x0d81('0x49')],'loggedIn':_0x199b62['loggedIn'],'name':_0x199b62['name'],'paused':_0x199b62[_0x0d81('0x4d')],'waiting':_0x199b62[_0x0d81('0x4e')]};_0x20633a[_0x0d81('0x1d')](_0x23706c);}}_0x4c6cda({'count':_0x20633a['length'],'rows':_0x20633a});});},'ChatQueuesWaitingInteractions':function(_0x40faf3){return new Promise(function(_0x23e396,_0x1cdd71){var _0x1585ff=_['values'](_0x436226[_0x0d81('0x53')]);_0x23e396({'count':_0x1585ff['length'],'rows':_0x1585ff});});},'MailQueuesWaitingInteractions':function(_0xfcb51d){return new Promise(function(_0x2bcc53,_0x389225){var _0x1cf285=_[_0x0d81('0x47')](_0x436226[_0x0d81('0x54')]);_0x2bcc53({'count':_0x1cf285['length'],'rows':_0x1cf285});});},'OpenchannelQueuesWaitingInteractions':function(_0x15bec9){return new Promise(function(_0x35842e,_0x5054a7){var _0x148af3=_[_0x0d81('0x47')](_0x436226[_0x0d81('0x55')]);_0x35842e({'count':_0x148af3[_0x0d81('0x15')],'rows':_0x148af3});});},'SmsQueuesWaitingInteractions':function(_0x560268){return new Promise(function(_0x4c8be6,_0x553c69){var _0x92b2ec=_[_0x0d81('0x47')](_0x436226[_0x0d81('0x56')]);_0x4c8be6({'count':_0x92b2ec[_0x0d81('0x15')],'rows':_0x92b2ec});});},'FaxQueuesWaitingInteractions':function(_0x38077d){return new Promise(function(_0x11580c,_0x590960){var _0x25c697=_[_0x0d81('0x47')](_0x436226[_0x0d81('0x57')]);_0x11580c({'count':_0x25c697[_0x0d81('0x15')],'rows':_0x25c697});});},'WhatsappQueuesWaitingInteractions':function(_0xdf1ce3){return new Promise(function(_0x32b615,_0x406e3a){var _0x3f118b=_[_0x0d81('0x47')](_0x436226['whatsappQueuesWaitingInteractions']);_0x32b615({'count':_0x3f118b[_0x0d81('0x15')],'rows':_0x3f118b});});}};var _0x4d36f9=jayson[_0x0d81('0x58')](_0x3d0f74)[_0x0d81('0x59')]();_0x4d36f9['on'](_0x0d81('0x2f'),function(_0x61b162){logger['error'](JSON[_0x0d81('0x5a')](_0x61b162));return _0x5ed805(_0x61b162);});_0x4d36f9[_0x0d81('0x5b')](0x232c,_0x0d81('0x5c'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x328221('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 1776d28..45bd5ac 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 _0xdf77=['[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','catch','log','stack','util','bluebird','jayson/promise','lodash','client','http','request','then','error','message','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','true'];(function(_0x4d5326,_0x2975ed){var _0x73e119=function(_0x28f88c){while(--_0x28f88c){_0x4d5326['push'](_0x4d5326['shift']());}};_0x73e119(++_0x2975ed);}(_0xdf77,0x10e));var _0x7df7=function(_0x442799,_0x2cc3f2){_0x442799=_0x442799-0x0;var _0x223bbe=_0xdf77[_0x442799];return _0x223bbe;};'use strict';var util=require(_0x7df7('0x0'));var BPromise=require(_0x7df7('0x1'));var jayson=require(_0x7df7('0x2'));var _=require(_0x7df7('0x3'));var logger=require('../../../config/logger')('routing');var client=jayson[_0x7df7('0x4')][_0x7df7('0x5')]({'port':0x232a});function request(_0x112c97,_0x54620){return new BPromise(function(_0x5c8d19,_0x515335){return client[_0x7df7('0x6')](_0x112c97,_0x54620)[_0x7df7('0x7')](function(_0x2f3ebd){if(_0x2f3ebd[_0x7df7('0x8')]){return _0x515335(_0x2f3ebd[_0x7df7('0x8')][_0x7df7('0x9')]);}else{return _0x5c8d19(_0x2f3ebd['result']);}})['catch'](function(_0x301ce2){return _0x515335(_0x301ce2);});});}exports['condition']=function(_0x2a80f5,_0x20ea57,_0xdb7da7){return function(_0x76a6ba){if(_0xdb7da7[_0x7df7('0xa')]&&!_0xdb7da7[_0x7df7('0xa')][_0x2a80f5]){logger[_0x7df7('0xb')](_0x7df7('0xc'),_0x2a80f5);return _0x76a6ba[_0x7df7('0xd')]();}var _0xbdef92=[];for(var _0x297248=0x0;_0x297248<_0x20ea57[_0x7df7('0xe')];_0x297248+=0x1){_0xbdef92[_0x7df7('0xf')](request(_0x7df7('0x10'),{'command':util[_0x7df7('0x11')](_0x7df7('0x12'),_0x20ea57[_0x297248])})[_0x7df7('0x7')](function(_0x263372){return _0x263372&&_0x263372[_0x7df7('0x9')]&&_0x263372[_0x7df7('0x9')]['indexOf'](_0x7df7('0x13'))>=0x0?!![]:![];})['catch'](function(_0x44b050){logger['error'](_0x7df7('0x14'),_0x2a80f5,_0x20ea57[_0x297248]);}));}BPromise[_0x7df7('0x15')](_0xbdef92)[_0x7df7('0x7')](function(_0x58f226){var _0x4c0f81=_[_0x7df7('0x16')](_0x58f226);logger[_0x7df7('0xb')](_0x7df7('0x17'),_0x2a80f5,_0x20ea57[_0x7df7('0x18')](_0x7df7('0x19')),_0x4c0f81);_0x76a6ba['when'](_0x4c0f81);})[_0x7df7('0x1a')](function(_0x2e7d2e){console[_0x7df7('0x1b')](_0x2e7d2e);logger[_0x7df7('0x8')](_0x7df7('0x17'),_0x2a80f5,_0x20ea57[_0x7df7('0x18')]('\x20|\x20'),_0x2e7d2e[_0x7df7('0x1c')]);_0x76a6ba[_0x7df7('0xd')]();});};}; \ No newline at end of file +var _0x0d46=['when','stack','util','bluebird','lodash','../../../config/logger','http','request','then','error','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join'];(function(_0xe789d9,_0x300f89){var _0x2bda33=function(_0x57a5f6){while(--_0x57a5f6){_0xe789d9['push'](_0xe789d9['shift']());}};_0x2bda33(++_0x300f89);}(_0x0d46,0xfe));var _0x60d4=function(_0x523f2c,_0x14e5e9){_0x523f2c=_0x523f2c-0x0;var _0x1312dc=_0x0d46[_0x523f2c];return _0x1312dc;};'use strict';var util=require(_0x60d4('0x0'));var BPromise=require(_0x60d4('0x1'));var jayson=require('jayson/promise');var _=require(_0x60d4('0x2'));var logger=require(_0x60d4('0x3'))('routing');var client=jayson['client'][_0x60d4('0x4')]({'port':0x232a});function request(_0x366099,_0x36ab7e){return new BPromise(function(_0x55e1b8,_0x1d113a){return client[_0x60d4('0x5')](_0x366099,_0x36ab7e)[_0x60d4('0x6')](function(_0x4b809a){if(_0x4b809a[_0x60d4('0x7')]){return _0x1d113a(_0x4b809a[_0x60d4('0x7')]['message']);}else{return _0x55e1b8(_0x4b809a['result']);}})[_0x60d4('0x8')](function(_0x1cc871){return _0x1d113a(_0x1cc871);});});}exports[_0x60d4('0x9')]=function(_0x14d581,_0x4e9830,_0x3fb84c){return function(_0x18cbed){if(_0x3fb84c[_0x60d4('0xa')]&&!_0x3fb84c[_0x60d4('0xa')][_0x14d581]){logger[_0x60d4('0xb')](_0x60d4('0xc'),_0x14d581);return _0x18cbed[_0x60d4('0xd')]();}var _0x4abdba=[];for(var _0x328eb2=0x0;_0x328eb2<_0x4e9830[_0x60d4('0xe')];_0x328eb2+=0x1){_0x4abdba[_0x60d4('0xf')](request(_0x60d4('0x10'),{'command':util[_0x60d4('0x11')](_0x60d4('0x12'),_0x4e9830[_0x328eb2])})[_0x60d4('0x6')](function(_0x3f0feb){return _0x3f0feb&&_0x3f0feb[_0x60d4('0x13')]&&_0x3f0feb[_0x60d4('0x13')][_0x60d4('0x14')](_0x60d4('0x15'))>=0x0?!![]:![];})[_0x60d4('0x8')](function(_0x568c08){logger[_0x60d4('0x7')](_0x60d4('0x16'),_0x14d581,_0x4e9830[_0x328eb2]);}));}BPromise[_0x60d4('0x17')](_0x4abdba)['then'](function(_0x224446){var _0x1e9acd=_['some'](_0x224446);logger['info'](_0x60d4('0x18'),_0x14d581,_0x4e9830[_0x60d4('0x19')]('\x20|\x20'),_0x1e9acd);_0x18cbed[_0x60d4('0x1a')](_0x1e9acd);})['catch'](function(_0x16adae){console['log'](_0x16adae);logger[_0x60d4('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0x14d581,_0x4e9830[_0x60d4('0x19')]('\x20|\x20'),_0x16adae[_0x60d4('0x1b')]);_0x18cbed[_0x60d4('0xd')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 2a40bad..6e9ee64 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 _0x2547=['transfertargetuniqueid','clone','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','lastevent','getVoiceQueueByName','then','agentacw','agentcomplete','acw','acwtime','acwTimeout','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','timeout','holdtime','ringtime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','agentconnect','[%s][agents][agentconnect]','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','secondtransfererexten'];(function(_0x5e2358,_0x3129ed){var _0x93e209=function(_0x53dccf){while(--_0x53dccf){_0x5e2358['push'](_0x5e2358['shift']());}};_0x93e209(++_0x3129ed);}(_0x2547,0x1cd));var _0x7254=function(_0x421412,_0x3aff4c){_0x421412=_0x421412-0x0;var _0x20e82b=_0x2547[_0x421412];return _0x20e82b;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var utils=require(_0x7254('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x44b692,_0x3ea6e6){utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x4'),_0x44b692[_0x7254('0x5')],_0x44b692['channel'],_0x44b692[_0x7254('0x6')],_0x44b692[_0x7254('0x7')],_0x44b692[_0x7254('0x8')],_0x44b692[_0x7254('0x9')],_0x44b692['connectedlinenum'],_0x44b692[_0x7254('0xa')]));if(_0x44b692[_0x7254('0x6')]){utils[_0x7254('0xb')](_0x44b692['queue'])[_0x7254('0xc')](function(_0x555b2e){if(_0x555b2e){_0x44b692['type']=_0x555b2e['type'];_0x44b692[_0x7254('0xd')]=_0x44b692[_0x7254('0xe')]?_0x555b2e[_0x7254('0xf')]:![];_0x44b692[_0x7254('0x10')]=_0x44b692[_0x7254('0xd')]?_0x555b2e[_0x7254('0x11')]:0x0;}utils['request'](_0x7254('0x12'),_0x44b692);});}else{utils['request'](_0x7254('0x12'),_0x44b692);}if(_0x3ea6e6){delete transfers[_0x44b692['uniqueid']];}else{delete agents[_0x44b692[_0x7254('0x13')]];}}exports[_0x7254('0x14')]=function(_0x348d4e){try{utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x16'),_0x348d4e[_0x7254('0x5')]),_0x348d4e);agents[_0x348d4e[_0x7254('0x13')]]=_0x348d4e;agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x17')]=utils[_0x7254('0x18')]();agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0xa')]='called';agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x19')]=null;agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x1a')]=null;utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x1b'),_0x348d4e['uniqueid'],agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x7')],_0x348d4e[_0x7254('0x13')]));}catch(_0x45aa93){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x16'),_0x348d4e[_0x7254('0x5')]),_0x45aa93);}};exports[_0x7254('0x1d')]=function(_0x3b6cb6){try{if(!_[_0x7254('0x1e')](agents[_0x3b6cb6[_0x7254('0x13')]])){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x1f'),_0x3b6cb6[_0x7254('0x5')]),_0x3b6cb6);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x20'),_0x3b6cb6[_0x7254('0x5')],agents[_0x3b6cb6[_0x7254('0x13')]]['membername'],_0x3b6cb6['destuniqueid']));agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0x1d')]=!![];agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0x21')]=utils[_0x7254('0x18')]();agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0xa')]='timeout';agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0x22')]=_0x7254('0x23');agents[_0x3b6cb6['destuniqueid']][_0x7254('0x24')]=_0x3b6cb6['ringtime']?parseInt(_0x3b6cb6[_0x7254('0x25')])/0x3e8:0x0;agents[_0x3b6cb6[_0x7254('0x13')]]['talktime']=0x0;unanswered[_0x7254('0x26')](_0x3b6cb6[_0x7254('0x13')]);}}catch(_0x4f684c){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x1f'),_0x3b6cb6[_0x7254('0x5')]),_0x4f684c);}};exports[_0x7254('0x27')]=function(_0xfe02ea){try{_['forIn'](agents,function(_0x146028,_0x2dba3f){if(_0x146028['uniqueid']==_0xfe02ea[_0x7254('0x5')]&&!_[_0x7254('0x28')](unanswered,_0x146028[_0x7254('0x13')])){utils['debug'](util[_0x7254('0x3')](_0x7254('0x29'),_0xfe02ea[_0x7254('0x5')]),_0xfe02ea);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x2a'),_0xfe02ea[_0x7254('0x5')],_0x146028['membername'],_0x146028[_0x7254('0x13')]));_0x146028['agentringnoanswer']=!![];_0x146028['agentringnoanswerAt']=utils[_0x7254('0x18')]();_0x146028[_0x7254('0xa')]=_0x7254('0x2b');_0x146028[_0x7254('0x22')]=_0x7254('0x2b');_0x146028[_0x7254('0x24')]=_0xfe02ea[_0x7254('0x24')];_0x146028[_0x7254('0x2c')]=0x0;writeDB(_0x146028);}});}catch(_0x447515){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x29'),_0xfe02ea[_0x7254('0x5')]),_0x447515);}};exports[_0x7254('0x2d')]=function(_0x57a7d4){try{if(agents[_0x57a7d4[_0x7254('0x13')]]){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x2e'),_0x57a7d4[_0x7254('0x5')]),_0x57a7d4);utils['info'](util[_0x7254('0x3')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x57a7d4[_0x7254('0x5')],agents[_0x57a7d4[_0x7254('0x13')]][_0x7254('0x7')],_0x57a7d4[_0x7254('0x13')]));agents[_0x57a7d4[_0x7254('0x13')]]['agentconnectAt']=utils[_0x7254('0x18')]();agents[_0x57a7d4['destuniqueid']][_0x7254('0x19')]=_0x57a7d4[_0x7254('0x19')];agents[_0x57a7d4['destuniqueid']][_0x7254('0x1a')]=_0x57a7d4[_0x7254('0x1a')];agents[_0x57a7d4[_0x7254('0x13')]][_0x7254('0x24')]=_0x57a7d4[_0x7254('0x25')];agents[_0x57a7d4[_0x7254('0x13')]]['lastevent']=_0x7254('0x2f');_[_0x7254('0x30')](agents,function(_0x105b8c,_0x4eca7a){if(_0x105b8c[_0x7254('0x13')]!=_0x57a7d4[_0x7254('0x13')]&&_0x105b8c[_0x7254('0x5')]==_0x57a7d4['uniqueid']){_0x105b8c[_0x7254('0x2c')]=0x0;_0x105b8c[_0x7254('0x24')]=_0x57a7d4[_0x7254('0x25')];_0x105b8c[_0x7254('0x1d')]=!![];_0x105b8c[_0x7254('0x21')]=utils['now']();_0x105b8c['lastevent']=_0x7254('0x31');_0x105b8c[_0x7254('0x22')]=_0x7254('0x31');_0x105b8c[_0x7254('0x32')]=_0x57a7d4['destuniqueid'];_0x105b8c['answeredelsewheremembername']=_0x57a7d4[_0x7254('0x7')];writeDB(_0x105b8c);}});}}catch(_0x565cd8){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x2e'),_0x57a7d4[_0x7254('0x5')]),_0x565cd8);}};exports['agentcomplete']=function(_0x4adf34){try{if(!_[_0x7254('0x1e')](agents[_0x4adf34[_0x7254('0x13')]])){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x33'),_0x4adf34['uniqueid']),_0x4adf34);utils['info'](util[_0x7254('0x3')](_0x7254('0x34'),_0x4adf34[_0x7254('0x5')],agents[_0x4adf34['destuniqueid']][_0x7254('0x7')],_0x4adf34[_0x7254('0x13')]));agents[_0x4adf34['destuniqueid']][_0x7254('0xe')]=!![];agents[_0x4adf34[_0x7254('0x13')]][_0x7254('0x35')]=utils[_0x7254('0x18')]();agents[_0x4adf34['destuniqueid']][_0x7254('0x2c')]=utils[_0x7254('0x36')](agents[_0x4adf34['destuniqueid']][_0x7254('0x35')],agents[_0x4adf34[_0x7254('0x13')]][_0x7254('0x37')]);agents[_0x4adf34['destuniqueid']][_0x7254('0x22')]=_0x4adf34[_0x7254('0x22')];agents[_0x4adf34['destuniqueid']]['lastevent']=_0x7254('0x38');writeDB(agents[_0x4adf34['destuniqueid']]);}}catch(_0x2e437c){utils[_0x7254('0x1c')](util['format']('[%s][agents][agentcomplete]',_0x4adf34[_0x7254('0x5')]),_0x2e437c);}};exports[_0x7254('0x39')]=function(_0x38bcd5){try{if(!_[_0x7254('0x1e')](agents[_0x38bcd5[_0x7254('0x3a')]])){utils[_0x7254('0x15')](util['format'](_0x7254('0x3b'),_0x38bcd5['uniqueid']),_0x38bcd5);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x3c'),_0x38bcd5['uniqueid'],agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x7')],agents[_0x38bcd5[_0x7254('0x3a')]]['uniqueid']));agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x3d')]=!![];agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x3e')]=_0x7254('0x3f');agents[_0x38bcd5['transfereruniqueid']]['transferexten']=_0x38bcd5[_0x7254('0x40')];agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x41')]=agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x5')];}}catch(_0x4c6838){utils['error'](util[_0x7254('0x3')](_0x7254('0x3b'),_0x38bcd5[_0x7254('0x5')]),_0x4c6838);}};exports[_0x7254('0x42')]=function(_0x5061be){try{utils[_0x7254('0x15')](util[_0x7254('0x3')]('[%s][agents][attendedtransfer]',_0x5061be[_0x7254('0x43')]),_0x5061be);if(_0x5061be['origtransfereruniqueid']==_0x5061be[_0x7254('0x44')]){if(!_['isNil'](agents[_0x5061be[_0x7254('0x45')]])){utils['info'](util['format'](_0x7254('0x46'),_0x5061be[_0x7254('0x43')],agents[_0x5061be[_0x7254('0x45')]][_0x7254('0x7')]));agents[_0x5061be['secondtransfereruniqueid']][_0x7254('0x3d')]=!![];agents[_0x5061be['secondtransfereruniqueid']][_0x7254('0x3e')]=_0x7254('0x47');agents[_0x5061be[_0x7254('0x45')]][_0x7254('0x48')]=_0x5061be[_0x7254('0x49')];agents[_0x5061be[_0x7254('0x45')]]['transferuniqueid']=_0x5061be[_0x7254('0x43')];}if(_0x5061be[_0x7254('0x4a')]&&agents[_0x5061be[_0x7254('0x4a')]]){agents[_0x5061be[_0x7254('0x4a')]][_0x7254('0x4b')]=0x1;transfers[_0x5061be[_0x7254('0x4a')]]=_['clone'](agents[_0x5061be[_0x7254('0x4a')]]);transfers[_0x5061be[_0x7254('0x4a')]][_0x7254('0x9')]=agents[_0x5061be[_0x7254('0x45')]][_0x7254('0x9')];transfers[_0x5061be[_0x7254('0x4a')]][_0x7254('0x4c')]=agents[_0x5061be['secondtransfereruniqueid']]['calleridname'];transfers[_0x5061be[_0x7254('0x4a')]]['agentcalledAt']=utils['now']();transfers[_0x5061be[_0x7254('0x4a')]][_0x7254('0x37')]=utils[_0x7254('0x18')]();transfers[_0x5061be['transfereeuniqueid']][_0x7254('0x24')]=0x0;transfers[_0x5061be['transfereeuniqueid']][_0x7254('0x4b')]=0x2;}}else if(_0x5061be[_0x7254('0x45')]==_0x5061be[_0x7254('0x4d')]){if(!_[_0x7254('0x1e')](agents[_0x5061be[_0x7254('0x43')]])){utils['info'](util[_0x7254('0x3')](_0x7254('0x46'),_0x5061be[_0x7254('0x43')],agents[_0x5061be[_0x7254('0x43')]]['membername']));agents[_0x5061be['origtransfereruniqueid']][_0x7254('0x3d')]=!![];agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x3e')]=_0x7254('0x47');agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x48')]=_0x5061be[_0x7254('0x4e')];agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x41')]=_0x5061be[_0x7254('0x45')];}if(_0x5061be[_0x7254('0x4f')]&&agents[_0x5061be[_0x7254('0x4f')]]){agents[_0x5061be[_0x7254('0x4f')]]['agententerreason']=0x1;transfers[_0x5061be[_0x7254('0x4f')]]=_[_0x7254('0x50')](agents[_0x5061be[_0x7254('0x4f')]]);transfers[_0x5061be['transfertargetuniqueid']][_0x7254('0x9')]=agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x9')];transfers[_0x5061be[_0x7254('0x4f')]]['calleridname']=agents[_0x5061be[_0x7254('0x43')]]['calleridname'];transfers[_0x5061be[_0x7254('0x4f')]][_0x7254('0x17')]=utils[_0x7254('0x18')]();transfers[_0x5061be[_0x7254('0x4f')]]['agentconnectAt']=utils[_0x7254('0x18')]();transfers[_0x5061be['transfertargetuniqueid']][_0x7254('0x24')]=0x0;transfers[_0x5061be['transfertargetuniqueid']][_0x7254('0x4b')]=0x2;}}}catch(_0x42dc64){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x51'),_0x5061be[_0x7254('0x43')]),_0x42dc64);}};exports[_0x7254('0x52')]=function(_0x23b89a){try{utils['debug'](util[_0x7254('0x3')]('[%s][agents][hangup]',_0x23b89a[_0x7254('0x5')]),_0x23b89a);if(agents[_0x23b89a[_0x7254('0x5')]]&&agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')]===_0x7254('0x23')){if(_0x23b89a[_0x7254('0x53')]==='21'){agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')]='rejected';agents[_0x23b89a[_0x7254('0x5')]]['lastevent']=_0x7254('0x54');}utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x55'),_0x23b89a[_0x7254('0x5')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x7')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(agents[_0x23b89a[_0x7254('0x5')]]);var _0x3f7be7=unanswered[_0x7254('0x56')](_0x23b89a[_0x7254('0x5')]);if(_0x3f7be7>-0x1){unanswered[_0x7254('0x57')](_0x3f7be7,0x1);}}if(transfers[_0x23b89a[_0x7254('0x5')]]){transfers[_0x23b89a['uniqueid']]['agentcomplete']=!![];transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x35')]=utils['now']();transfers[_0x23b89a['uniqueid']]['talktime']=utils[_0x7254('0x36')](transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x35')],transfers[_0x23b89a[_0x7254('0x5')]]['agentconnectAt']);transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')]='agent';transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]=_0x7254('0x38');utils['info'](util['format'](_0x7254('0x55'),_0x23b89a[_0x7254('0x5')],transfers[_0x23b89a['uniqueid']][_0x7254('0x7')],transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')],transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(transfers[_0x23b89a['uniqueid']],!![]);}if(agents[_0x23b89a[_0x7254('0x5')]]&&agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x37')]){agents[_0x23b89a['uniqueid']][_0x7254('0xe')]=!![];agents[_0x23b89a['uniqueid']]['agentcompleteAt']=utils['now']();agents[_0x23b89a[_0x7254('0x5')]]['talktime']=utils['diffTime'](agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x35')],agents[_0x23b89a[_0x7254('0x5')]]['agentconnectAt']);agents[_0x23b89a[_0x7254('0x5')]]['reason']=agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x3d')]?'transfer':_0x7254('0x58');agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]=_0x7254('0x38');utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x55'),_0x23b89a['uniqueid'],agents[_0x23b89a[_0x7254('0x5')]]['membername'],agents[_0x23b89a['uniqueid']][_0x7254('0x22')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(agents[_0x23b89a[_0x7254('0x5')]]);}}catch(_0x54c7d5){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x59'),_0x23b89a[_0x7254('0x5')]),_0x54c7d5);}}; \ No newline at end of file +var _0xf7b4=['acw','acwtime','agentacw','acwTimeout','CreateVoiceAgentReport','destuniqueid','agentcalled','format','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','info','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','ringtime','push','queuecallerabandon','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','holdtime','talktime','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','forIn','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','agentcompleteAt','agentconnectAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferexten','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','complete','lodash','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0xf7b4,0x152));var _0x4f7b=function(_0x18947c,_0xa391b){_0x18947c=_0x18947c-0x0;var _0x5ed660=_0xf7b4[_0x18947c];return _0x5ed660;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5ccf30,_0x103165){utils['info'](util['format'](_0x4f7b('0x1'),_0x5ccf30[_0x4f7b('0x2')],_0x5ccf30[_0x4f7b('0x3')],_0x5ccf30[_0x4f7b('0x4')],_0x5ccf30[_0x4f7b('0x5')],_0x5ccf30[_0x4f7b('0x6')],_0x5ccf30[_0x4f7b('0x7')],_0x5ccf30[_0x4f7b('0x8')],_0x5ccf30[_0x4f7b('0x9')]));if(_0x5ccf30[_0x4f7b('0x4')]){utils[_0x4f7b('0xa')](_0x5ccf30[_0x4f7b('0x4')])[_0x4f7b('0xb')](function(_0x5c714d){if(_0x5c714d){_0x5ccf30[_0x4f7b('0xc')]=_0x5c714d[_0x4f7b('0xc')];_0x5ccf30['agentacw']=_0x5ccf30[_0x4f7b('0xd')]?_0x5c714d[_0x4f7b('0xe')]:![];_0x5ccf30[_0x4f7b('0xf')]=_0x5ccf30[_0x4f7b('0x10')]?_0x5c714d[_0x4f7b('0x11')]:0x0;}utils['request'](_0x4f7b('0x12'),_0x5ccf30);});}else{utils['request']('CreateVoiceAgentReport',_0x5ccf30);}if(_0x103165){delete transfers[_0x5ccf30[_0x4f7b('0x2')]];}else{delete agents[_0x5ccf30[_0x4f7b('0x13')]];}}exports[_0x4f7b('0x14')]=function(_0x41a050){try{utils['debug'](util[_0x4f7b('0x15')](_0x4f7b('0x16'),_0x41a050[_0x4f7b('0x2')]),_0x41a050);agents[_0x41a050[_0x4f7b('0x13')]]=_0x41a050;agents[_0x41a050[_0x4f7b('0x13')]][_0x4f7b('0x17')]=utils[_0x4f7b('0x18')]();agents[_0x41a050[_0x4f7b('0x13')]][_0x4f7b('0x9')]=_0x4f7b('0x19');agents[_0x41a050[_0x4f7b('0x13')]][_0x4f7b('0x8')]=null;agents[_0x41a050['destuniqueid']][_0x4f7b('0x1a')]=null;utils['info'](util['format'](_0x4f7b('0x1b'),_0x41a050[_0x4f7b('0x2')],agents[_0x41a050['destuniqueid']][_0x4f7b('0x5')],_0x41a050[_0x4f7b('0x13')]));}catch(_0x13a0f5){utils[_0x4f7b('0x1c')](util['format'](_0x4f7b('0x16'),_0x41a050['uniqueid']),_0x13a0f5);}};exports[_0x4f7b('0x1d')]=function(_0x12374b){try{if(!_[_0x4f7b('0x1e')](agents[_0x12374b[_0x4f7b('0x13')]])){utils[_0x4f7b('0x1f')](util[_0x4f7b('0x15')](_0x4f7b('0x20'),_0x12374b[_0x4f7b('0x2')]),_0x12374b);utils[_0x4f7b('0x21')](util['format'](_0x4f7b('0x22'),_0x12374b[_0x4f7b('0x2')],agents[_0x12374b[_0x4f7b('0x13')]]['membername'],_0x12374b[_0x4f7b('0x13')]));agents[_0x12374b[_0x4f7b('0x13')]]['agentringnoanswer']=!![];agents[_0x12374b[_0x4f7b('0x13')]]['agentringnoanswerAt']=utils[_0x4f7b('0x18')]();agents[_0x12374b[_0x4f7b('0x13')]][_0x4f7b('0x9')]=_0x4f7b('0x23');agents[_0x12374b[_0x4f7b('0x13')]][_0x4f7b('0x24')]=_0x4f7b('0x23');agents[_0x12374b[_0x4f7b('0x13')]]['holdtime']=_0x12374b[_0x4f7b('0x25')]?parseInt(_0x12374b[_0x4f7b('0x25')])/0x3e8:0x0;agents[_0x12374b[_0x4f7b('0x13')]]['talktime']=0x0;unanswered[_0x4f7b('0x26')](_0x12374b[_0x4f7b('0x13')]);}}catch(_0x1db684){utils[_0x4f7b('0x1c')](util[_0x4f7b('0x15')]('[%s][agents][agentringnoanswer]',_0x12374b[_0x4f7b('0x2')]),_0x1db684);}};exports[_0x4f7b('0x27')]=function(_0x9a675c){try{_['forIn'](agents,function(_0x7de561,_0x5d13a1){if(_0x7de561['uniqueid']==_0x9a675c[_0x4f7b('0x2')]&&!_['includes'](unanswered,_0x7de561[_0x4f7b('0x13')])){utils[_0x4f7b('0x1f')](util[_0x4f7b('0x15')](_0x4f7b('0x28'),_0x9a675c[_0x4f7b('0x2')]),_0x9a675c);utils[_0x4f7b('0x21')](util[_0x4f7b('0x15')](_0x4f7b('0x29'),_0x9a675c[_0x4f7b('0x2')],_0x7de561[_0x4f7b('0x5')],_0x7de561[_0x4f7b('0x13')]));_0x7de561[_0x4f7b('0x1d')]=!![];_0x7de561[_0x4f7b('0x2a')]=utils[_0x4f7b('0x18')]();_0x7de561[_0x4f7b('0x9')]=_0x4f7b('0x2b');_0x7de561[_0x4f7b('0x24')]=_0x4f7b('0x2b');_0x7de561[_0x4f7b('0x2c')]=_0x9a675c[_0x4f7b('0x2c')];_0x7de561[_0x4f7b('0x2d')]=0x0;writeDB(_0x7de561);}});}catch(_0x172235){utils['error'](util[_0x4f7b('0x15')]('[%s][agents][queuecallerabandon]',_0x9a675c[_0x4f7b('0x2')]),_0x172235);}};exports[_0x4f7b('0x2e')]=function(_0x579ad4){try{if(agents[_0x579ad4[_0x4f7b('0x13')]]){utils[_0x4f7b('0x1f')](util[_0x4f7b('0x15')]('[%s][agents][agentconnect]',_0x579ad4[_0x4f7b('0x2')]),_0x579ad4);utils[_0x4f7b('0x21')](util[_0x4f7b('0x15')](_0x4f7b('0x2f'),_0x579ad4[_0x4f7b('0x2')],agents[_0x579ad4[_0x4f7b('0x13')]][_0x4f7b('0x5')],_0x579ad4['destuniqueid']));agents[_0x579ad4[_0x4f7b('0x13')]]['agentconnectAt']=utils[_0x4f7b('0x18')]();agents[_0x579ad4[_0x4f7b('0x13')]][_0x4f7b('0x8')]=_0x579ad4['connectedlinenum'];agents[_0x579ad4[_0x4f7b('0x13')]]['connectedlinename']=_0x579ad4[_0x4f7b('0x1a')];agents[_0x579ad4[_0x4f7b('0x13')]]['holdtime']=_0x579ad4['ringtime'];agents[_0x579ad4[_0x4f7b('0x13')]]['lastevent']=_0x4f7b('0x30');_[_0x4f7b('0x31')](agents,function(_0x54f9e8,_0x1d0746){if(_0x54f9e8['destuniqueid']!=_0x579ad4['destuniqueid']&&_0x54f9e8['uniqueid']==_0x579ad4[_0x4f7b('0x2')]){_0x54f9e8[_0x4f7b('0x2d')]=0x0;_0x54f9e8[_0x4f7b('0x2c')]=_0x579ad4[_0x4f7b('0x25')];_0x54f9e8['agentringnoanswer']=!![];_0x54f9e8[_0x4f7b('0x2a')]=utils['now']();_0x54f9e8[_0x4f7b('0x9')]='answered_elsewhere';_0x54f9e8[_0x4f7b('0x24')]='answered_elsewhere';_0x54f9e8[_0x4f7b('0x32')]=_0x579ad4[_0x4f7b('0x13')];_0x54f9e8[_0x4f7b('0x33')]=_0x579ad4[_0x4f7b('0x5')];writeDB(_0x54f9e8);}});}}catch(_0x2986cd){utils[_0x4f7b('0x1c')](util[_0x4f7b('0x15')](_0x4f7b('0x34'),_0x579ad4[_0x4f7b('0x2')]),_0x2986cd);}};exports[_0x4f7b('0xd')]=function(_0x2d0be3){try{if(!_[_0x4f7b('0x1e')](agents[_0x2d0be3[_0x4f7b('0x13')]])){utils[_0x4f7b('0x1f')](util[_0x4f7b('0x15')](_0x4f7b('0x35'),_0x2d0be3[_0x4f7b('0x2')]),_0x2d0be3);utils[_0x4f7b('0x21')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2d0be3[_0x4f7b('0x2')],agents[_0x2d0be3[_0x4f7b('0x13')]][_0x4f7b('0x5')],_0x2d0be3[_0x4f7b('0x13')]));agents[_0x2d0be3['destuniqueid']]['agentcomplete']=!![];agents[_0x2d0be3[_0x4f7b('0x13')]][_0x4f7b('0x36')]=utils[_0x4f7b('0x18')]();agents[_0x2d0be3[_0x4f7b('0x13')]]['talktime']=utils['diffTime'](agents[_0x2d0be3[_0x4f7b('0x13')]][_0x4f7b('0x36')],agents[_0x2d0be3[_0x4f7b('0x13')]][_0x4f7b('0x37')]);agents[_0x2d0be3[_0x4f7b('0x13')]]['reason']=_0x2d0be3[_0x4f7b('0x24')];agents[_0x2d0be3[_0x4f7b('0x13')]][_0x4f7b('0x9')]='complete';writeDB(agents[_0x2d0be3[_0x4f7b('0x13')]]);}}catch(_0x104e7f){utils[_0x4f7b('0x1c')](util[_0x4f7b('0x15')](_0x4f7b('0x35'),_0x2d0be3[_0x4f7b('0x2')]),_0x104e7f);}};exports[_0x4f7b('0x38')]=function(_0x2e563f){try{if(!_[_0x4f7b('0x1e')](agents[_0x2e563f[_0x4f7b('0x39')]])){utils['debug'](util[_0x4f7b('0x15')](_0x4f7b('0x3a'),_0x2e563f[_0x4f7b('0x2')]),_0x2e563f);utils['info'](util[_0x4f7b('0x15')](_0x4f7b('0x3b'),_0x2e563f[_0x4f7b('0x2')],agents[_0x2e563f[_0x4f7b('0x39')]][_0x4f7b('0x5')],agents[_0x2e563f[_0x4f7b('0x39')]][_0x4f7b('0x2')]));agents[_0x2e563f[_0x4f7b('0x39')]][_0x4f7b('0x3c')]=!![];agents[_0x2e563f[_0x4f7b('0x39')]]['transfertype']=_0x4f7b('0x3d');agents[_0x2e563f[_0x4f7b('0x39')]][_0x4f7b('0x3e')]=_0x2e563f['extension'];agents[_0x2e563f[_0x4f7b('0x39')]][_0x4f7b('0x3f')]=agents[_0x2e563f[_0x4f7b('0x39')]][_0x4f7b('0x2')];}}catch(_0x3437a8){utils[_0x4f7b('0x1c')](util['format'](_0x4f7b('0x3a'),_0x2e563f[_0x4f7b('0x2')]),_0x3437a8);}};exports[_0x4f7b('0x40')]=function(_0x4c9496){try{utils[_0x4f7b('0x1f')](util[_0x4f7b('0x15')](_0x4f7b('0x41'),_0x4c9496[_0x4f7b('0x42')]),_0x4c9496);if(_0x4c9496[_0x4f7b('0x42')]==_0x4c9496[_0x4f7b('0x43')]){if(!_['isNil'](agents[_0x4c9496[_0x4f7b('0x44')]])){utils['info'](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x4c9496[_0x4f7b('0x42')],agents[_0x4c9496[_0x4f7b('0x44')]][_0x4f7b('0x5')]));agents[_0x4c9496['secondtransfereruniqueid']]['transfer']=!![];agents[_0x4c9496[_0x4f7b('0x44')]][_0x4f7b('0x45')]='ATTENDED';agents[_0x4c9496[_0x4f7b('0x44')]][_0x4f7b('0x3e')]=_0x4c9496[_0x4f7b('0x46')];agents[_0x4c9496[_0x4f7b('0x44')]]['transferuniqueid']=_0x4c9496[_0x4f7b('0x42')];}if(_0x4c9496[_0x4f7b('0x47')]&&agents[_0x4c9496[_0x4f7b('0x47')]]){agents[_0x4c9496[_0x4f7b('0x47')]][_0x4f7b('0x48')]=0x1;transfers[_0x4c9496[_0x4f7b('0x47')]]=_[_0x4f7b('0x49')](agents[_0x4c9496['transfereeuniqueid']]);transfers[_0x4c9496['transfereeuniqueid']]['calleridnum']=agents[_0x4c9496[_0x4f7b('0x44')]]['calleridnum'];transfers[_0x4c9496['transfereeuniqueid']]['calleridname']=agents[_0x4c9496['secondtransfereruniqueid']][_0x4f7b('0x4a')];transfers[_0x4c9496[_0x4f7b('0x47')]][_0x4f7b('0x17')]=utils[_0x4f7b('0x18')]();transfers[_0x4c9496[_0x4f7b('0x47')]][_0x4f7b('0x37')]=utils[_0x4f7b('0x18')]();transfers[_0x4c9496[_0x4f7b('0x47')]][_0x4f7b('0x2c')]=0x0;transfers[_0x4c9496[_0x4f7b('0x47')]][_0x4f7b('0x48')]=0x2;}}else if(_0x4c9496[_0x4f7b('0x44')]==_0x4c9496[_0x4f7b('0x4b')]){if(!_[_0x4f7b('0x1e')](agents[_0x4c9496[_0x4f7b('0x42')]])){utils[_0x4f7b('0x21')](util[_0x4f7b('0x15')](_0x4f7b('0x4c'),_0x4c9496['origtransfereruniqueid'],agents[_0x4c9496[_0x4f7b('0x42')]][_0x4f7b('0x5')]));agents[_0x4c9496[_0x4f7b('0x42')]][_0x4f7b('0x3c')]=!![];agents[_0x4c9496[_0x4f7b('0x42')]]['transfertype']='ATTENDED';agents[_0x4c9496[_0x4f7b('0x42')]]['transferexten']=_0x4c9496[_0x4f7b('0x4d')];agents[_0x4c9496[_0x4f7b('0x42')]][_0x4f7b('0x3f')]=_0x4c9496[_0x4f7b('0x44')];}if(_0x4c9496['transfertargetuniqueid']&&agents[_0x4c9496[_0x4f7b('0x4e')]]){agents[_0x4c9496[_0x4f7b('0x4e')]][_0x4f7b('0x48')]=0x1;transfers[_0x4c9496['transfertargetuniqueid']]=_['clone'](agents[_0x4c9496['transfertargetuniqueid']]);transfers[_0x4c9496[_0x4f7b('0x4e')]]['calleridnum']=agents[_0x4c9496['origtransfereruniqueid']]['calleridnum'];transfers[_0x4c9496[_0x4f7b('0x4e')]][_0x4f7b('0x4a')]=agents[_0x4c9496[_0x4f7b('0x42')]]['calleridname'];transfers[_0x4c9496[_0x4f7b('0x4e')]][_0x4f7b('0x17')]=utils['now']();transfers[_0x4c9496['transfertargetuniqueid']][_0x4f7b('0x37')]=utils[_0x4f7b('0x18')]();transfers[_0x4c9496[_0x4f7b('0x4e')]][_0x4f7b('0x2c')]=0x0;transfers[_0x4c9496['transfertargetuniqueid']][_0x4f7b('0x48')]=0x2;}}}catch(_0x40534d){utils[_0x4f7b('0x1c')](util[_0x4f7b('0x15')](_0x4f7b('0x41'),_0x4c9496[_0x4f7b('0x42')]),_0x40534d);}};exports['hangup']=function(_0x1fa0fd){try{utils[_0x4f7b('0x1f')](util[_0x4f7b('0x15')](_0x4f7b('0x4f'),_0x1fa0fd[_0x4f7b('0x2')]),_0x1fa0fd);if(agents[_0x1fa0fd['uniqueid']]&&agents[_0x1fa0fd['uniqueid']]['reason']===_0x4f7b('0x23')){if(_0x1fa0fd[_0x4f7b('0x50')]==='21'){agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x24')]=_0x4f7b('0x51');agents[_0x1fa0fd['uniqueid']][_0x4f7b('0x9')]=_0x4f7b('0x51');}utils[_0x4f7b('0x21')](util[_0x4f7b('0x15')](_0x4f7b('0x52'),_0x1fa0fd[_0x4f7b('0x2')],agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x5')],agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x24')],agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x9')]));writeDB(agents[_0x1fa0fd[_0x4f7b('0x2')]]);var _0x19e4ab=unanswered[_0x4f7b('0x53')](_0x1fa0fd[_0x4f7b('0x2')]);if(_0x19e4ab>-0x1){unanswered[_0x4f7b('0x54')](_0x19e4ab,0x1);}}if(transfers[_0x1fa0fd[_0x4f7b('0x2')]]){transfers[_0x1fa0fd['uniqueid']]['agentcomplete']=!![];transfers[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x36')]=utils[_0x4f7b('0x18')]();transfers[_0x1fa0fd[_0x4f7b('0x2')]]['talktime']=utils[_0x4f7b('0x55')](transfers[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x36')],transfers[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x37')]);transfers[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x24')]=_0x4f7b('0x56');transfers[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x9')]=_0x4f7b('0x57');utils[_0x4f7b('0x21')](util[_0x4f7b('0x15')](_0x4f7b('0x52'),_0x1fa0fd[_0x4f7b('0x2')],transfers[_0x1fa0fd['uniqueid']][_0x4f7b('0x5')],transfers[_0x1fa0fd[_0x4f7b('0x2')]]['reason'],transfers[_0x1fa0fd['uniqueid']][_0x4f7b('0x9')]));writeDB(transfers[_0x1fa0fd[_0x4f7b('0x2')]],!![]);}if(agents[_0x1fa0fd[_0x4f7b('0x2')]]&&agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x37')]){agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0xd')]=!![];agents[_0x1fa0fd['uniqueid']]['agentcompleteAt']=utils[_0x4f7b('0x18')]();agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x2d')]=utils[_0x4f7b('0x55')](agents[_0x1fa0fd['uniqueid']][_0x4f7b('0x36')],agents[_0x1fa0fd[_0x4f7b('0x2')]]['agentconnectAt']);agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x24')]=agents[_0x1fa0fd['uniqueid']]['transfer']?_0x4f7b('0x3c'):'agent';agents[_0x1fa0fd['uniqueid']]['lastevent']=_0x4f7b('0x57');utils['info'](util[_0x4f7b('0x15')](_0x4f7b('0x52'),_0x1fa0fd[_0x4f7b('0x2')],agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x5')],agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x24')],agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x9')]));writeDB(agents[_0x1fa0fd['uniqueid']]);}}catch(_0x476637){utils[_0x4f7b('0x1c')](util[_0x4f7b('0x15')](_0x4f7b('0x4f'),_0x1fa0fd[_0x4f7b('0x2')]),_0x476637);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 7d79c71..fd92687 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 _0x4e0e=['[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','now','duration','starttime','diffTime','attendedtransfer','localtwolinkedid','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','split','substring','lastIndexOf','includes','noop','lastdata','[%s][calls][newexten]','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','channel','queue','membername','calleridnum','lastevent','accountcode','getUserByInternal','then','CreateVoiceCallReport','request','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','info','context','exten','error','newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','linkedid','transfer'];(function(_0x4f96e0,_0xba4862){var _0x1dd358=function(_0x4500e0){while(--_0x4500e0){_0x4f96e0['push'](_0x4f96e0['shift']());}};_0x1dd358(++_0xba4862);}(_0x4e0e,0xb3));var _0xe4e0=function(_0x100565,_0x391826){_0x100565=_0x100565-0x0;var _0x16f041=_0x4e0e[_0x100565];return _0x16f041;};'use strict';var _=require(_0xe4e0('0x0'));var util=require(_0xe4e0('0x1'));var utils=require(_0xe4e0('0x2'));var transfers=require(_0xe4e0('0x3'));var dispositions=['NO\x20ANSWER',_0xe4e0('0x4'),'FAILED',_0xe4e0('0x5'),_0xe4e0('0x5'),_0xe4e0('0x5'),_0xe4e0('0x6'),_0xe4e0('0x7'),'FAILED','FAILED',_0xe4e0('0x4')];var channels={};function writeDB(_0x3c6a3b){var _0x23a8a6;if(transfers[_0xe4e0('0x8')][_0x3c6a3b[_0xe4e0('0x9')]]){_0x23a8a6=_0x3c6a3b['uniqueid'];_0x3c6a3b['uniqueid']=transfers[_0xe4e0('0x8')][_0x3c6a3b[_0xe4e0('0x9')]][_0xe4e0('0xa')];}utils['info'](util[_0xe4e0('0xb')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x3c6a3b[_0xe4e0('0x9')],_0x3c6a3b[_0xe4e0('0xc')],_0x3c6a3b[_0xe4e0('0xd')],_0x3c6a3b[_0xe4e0('0xe')],_0x3c6a3b['interface'],_0x3c6a3b[_0xe4e0('0xf')],_0x3c6a3b['connectedlinenum'],_0x3c6a3b[_0xe4e0('0x10')]));if(_0x3c6a3b[_0xe4e0('0x11')]){utils[_0xe4e0('0x12')](_0x3c6a3b[_0xe4e0('0x11')])[_0xe4e0('0x13')](function(_0x54b01f){if(_0x54b01f){_0x3c6a3b['UserId']=_0x54b01f['id'];}utils['request'](_0xe4e0('0x14'),_0x3c6a3b);});}else{utils[_0xe4e0('0x15')]('CreateVoiceCallReport',_0x3c6a3b);}if(channels[_0x3c6a3b[_0xe4e0('0x9')]]){delete channels[_0x3c6a3b[_0xe4e0('0x9')]];}else if(_0x23a8a6&&channels[_0x23a8a6]){delete transfers['blinds'][_0x23a8a6];delete channels[_0x23a8a6];}}exports['newchannel']=function(_0x188b71){try{utils[_0xe4e0('0x16')](util[_0xe4e0('0xb')](_0xe4e0('0x17'),_0x188b71[_0xe4e0('0x9')]),_0x188b71);if(_0x188b71[_0xe4e0('0x9')]==_0x188b71['linkedid']&&_0x188b71[_0xe4e0('0xc')]!=_0xe4e0('0x18')){utils[_0xe4e0('0x19')](util[_0xe4e0('0xb')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x188b71[_0xe4e0('0x9')],_0x188b71[_0xe4e0('0x1a')],_0x188b71[_0xe4e0('0x1b')]));channels[_0x188b71[_0xe4e0('0x9')]]={'uniqueid':_0x188b71[_0xe4e0('0x9')],'accountcode':_0x188b71[_0xe4e0('0x11')],'source':_0x188b71[_0xe4e0('0xf')],'destination':_0x188b71['exten'],'destinationcontext':_0x188b71[_0xe4e0('0x1a')],'channel':_0x188b71[_0xe4e0('0xc')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xe4e0('0x5'),'amaflags':'DOCUMENTATION'};}}catch(_0x5e2253){utils[_0xe4e0('0x1c')](util[_0xe4e0('0xb')](_0xe4e0('0x17'),_0x188b71[_0xe4e0('0x9')]),_0x5e2253);}};exports[_0xe4e0('0x1d')]=function(_0x497355){try{utils['debug'](util[_0xe4e0('0xb')](_0xe4e0('0x1e'),_0x497355[_0xe4e0('0x9')]),_0x497355);if(!_['isNil'](channels[_0x497355[_0xe4e0('0x9')]])&&_0x497355[_0xe4e0('0x1f')]==0x6){utils[_0xe4e0('0x19')](util['format'](_0xe4e0('0x20'),_0x497355['uniqueid'],_0x497355[_0xe4e0('0x1a')],_0x497355[_0xe4e0('0xc')]));if(_[_0xe4e0('0x21')](channels[_0x497355[_0xe4e0('0x9')]][_0xe4e0('0x22')])){channels[_0x497355[_0xe4e0('0x9')]][_0xe4e0('0x22')]=utils['now']();}}else if(!_['isNil'](channels[_0x497355[_0xe4e0('0x23')]])&&_0x497355[_0xe4e0('0x1f')]==0x6&&_0x497355[_0xe4e0('0x1a')]!=_0xe4e0('0x24')){utils[_0xe4e0('0x19')](util[_0xe4e0('0xb')](_0xe4e0('0x25'),_0x497355['uniqueid'],_0x497355[_0xe4e0('0x23')],_0x497355[_0xe4e0('0x1a')],_0x497355[_0xe4e0('0xc')]));channels[_0x497355[_0xe4e0('0x23')]]['accountcode']=_0x497355[_0xe4e0('0x11')];channels[_0x497355[_0xe4e0('0x23')]][_0xe4e0('0x26')]=_0x497355[_0xe4e0('0xc')];if(_[_0xe4e0('0x21')](channels[_0x497355['linkedid']][_0xe4e0('0x27')])){channels[_0x497355[_0xe4e0('0x23')]]['answertime']=utils['now']();}channels[_0x497355['linkedid']][_0xe4e0('0x28')]=dispositions[_[_0xe4e0('0x29')](_0x497355[_0xe4e0('0x1f')])]||_0xe4e0('0x6');}}catch(_0x546525){utils[_0xe4e0('0x1c')](util['format'](_0xe4e0('0x1e'),_0x497355[_0xe4e0('0x9')]),_0x546525);}};exports[_0xe4e0('0x2a')]=function(_0x27cf03){try{if(!_['isNil'](channels[_0x27cf03[_0xe4e0('0x9')]])){utils[_0xe4e0('0x16')](util['format'](_0xe4e0('0x2b'),_0x27cf03[_0xe4e0('0x9')]),_0x27cf03);if(_[_0xe4e0('0x21')](channels[_0x27cf03[_0xe4e0('0x9')]][_0xe4e0('0x2c')])){channels[_0x27cf03[_0xe4e0('0x9')]][_0xe4e0('0x2c')]=_0x27cf03[_0xe4e0('0x2d')]+'\x20<'+_0x27cf03[_0xe4e0('0xf')]+'>';}utils['info'](util[_0xe4e0('0xb')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x27cf03[_0xe4e0('0x9')],channels[_0x27cf03['uniqueid']][_0xe4e0('0x2c')],_0x27cf03[_0xe4e0('0x2e')]));channels[_0x27cf03['uniqueid']][_0xe4e0('0x2f')]=utils[_0xe4e0('0x30')]();channels[_0x27cf03[_0xe4e0('0x9')]][_0xe4e0('0x31')]=utils['diffTime'](channels[_0x27cf03[_0xe4e0('0x9')]][_0xe4e0('0x2f')],channels[_0x27cf03['uniqueid']][_0xe4e0('0x32')]);channels[_0x27cf03['uniqueid']]['billableseconds']=channels[_0x27cf03[_0xe4e0('0x9')]][_0xe4e0('0x27')]?utils[_0xe4e0('0x33')](channels[_0x27cf03['uniqueid']][_0xe4e0('0x2f')],channels[_0x27cf03[_0xe4e0('0x9')]][_0xe4e0('0x27')]):0x0;writeDB(channels[_0x27cf03['uniqueid']]);}}catch(_0x163db5){utils[_0xe4e0('0x1c')](util[_0xe4e0('0xb')](_0xe4e0('0x2b'),_0x27cf03[_0xe4e0('0x9')]),_0x163db5);}};exports[_0xe4e0('0x34')]=function(_0x5a4793){try{if(!_['isNil'](channels[_0x5a4793[_0xe4e0('0x35')]])){utils[_0xe4e0('0x16')](util[_0xe4e0('0xb')]('[%s][calls][attendedtransfer]',_0x5a4793[_0xe4e0('0x36')]),_0x5a4793);if(channels[_0x5a4793['localtwolinkedid']][_0xe4e0('0xc')]==_0x5a4793['transfereechannel']){utils['info'](util[_0xe4e0('0xb')](_0xe4e0('0x37'),_0x5a4793[_0xe4e0('0x36')],_0x5a4793[_0xe4e0('0x35')],_0x5a4793[_0xe4e0('0x38')]));channels[_0x5a4793[_0xe4e0('0x35')]]['destinationchannel']=_0x5a4793[_0xe4e0('0x38')];channels[_0x5a4793[_0xe4e0('0x35')]][_0xe4e0('0x39')]='_attended';}else if(channels[_0x5a4793[_0xe4e0('0x35')]][_0xe4e0('0xc')]=_0x5a4793[_0xe4e0('0x3a')]){utils[_0xe4e0('0x19')](util[_0xe4e0('0xb')](_0xe4e0('0x37'),_0x5a4793['origtransfereruniqueid'],_0x5a4793[_0xe4e0('0x35')],_0x5a4793['origtransfererchannel']));channels[_0x5a4793[_0xe4e0('0x35')]][_0xe4e0('0x26')]=_0x5a4793[_0xe4e0('0x3b')];channels[_0x5a4793[_0xe4e0('0x35')]][_0xe4e0('0x39')]=_0xe4e0('0x3c');}}}catch(_0x539a68){utils['error'](util['format'](_0xe4e0('0x3d'),_0x5a4793['origtransfereruniqueid']),_0x539a68);}};exports[_0xe4e0('0x3e')]=function(_0x40c5f1){try{if(!_[_0xe4e0('0x21')](channels[_0x40c5f1['uniqueid']])){utils[_0xe4e0('0x16')](util[_0xe4e0('0xb')](_0xe4e0('0x3f'),_0x40c5f1[_0xe4e0('0x9')]),_0x40c5f1);channels[_0x40c5f1[_0xe4e0('0x9')]][_0xe4e0('0x40')]=utils['now']();utils['info'](util[_0xe4e0('0xb')](_0xe4e0('0x41'),_0x40c5f1[_0xe4e0('0x9')],channels[_0x40c5f1['uniqueid']][_0xe4e0('0x40')]));}}catch(_0x3cad2f){utils[_0xe4e0('0x1c')](util[_0xe4e0('0xb')]('[%s][calls][musiconholdstart]',_0x40c5f1[_0xe4e0('0x9')]),_0x3cad2f);}};exports[_0xe4e0('0x42')]=function(_0x1d36c6){try{if(!_[_0xe4e0('0x21')](channels[_0x1d36c6['uniqueid']])){utils[_0xe4e0('0x16')](util['format']('[%s][calls][musiconholdstop]',_0x1d36c6[_0xe4e0('0x9')]),_0x1d36c6);if(!_[_0xe4e0('0x21')](channels[_0x1d36c6[_0xe4e0('0x9')]][_0xe4e0('0x40')])){channels[_0x1d36c6[_0xe4e0('0x9')]][_0xe4e0('0x43')]+=utils[_0xe4e0('0x33')](utils['now'](),channels[_0x1d36c6[_0xe4e0('0x9')]][_0xe4e0('0x40')]);utils[_0xe4e0('0x19')](util[_0xe4e0('0xb')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x1d36c6['uniqueid'],channels[_0x1d36c6[_0xe4e0('0x9')]][_0xe4e0('0x43')]));delete channels[_0x1d36c6[_0xe4e0('0x9')]]['musiconholdstartAt'];}}}catch(_0x51d966){utils['error'](util[_0xe4e0('0xb')](_0xe4e0('0x44'),_0x1d36c6[_0xe4e0('0x9')]),_0x51d966);}};exports[_0xe4e0('0x45')]=function(_0x22fb09){try{if(!_[_0xe4e0('0x21')](channels[_0x22fb09[_0xe4e0('0x9')]])){utils[_0xe4e0('0x16')](util[_0xe4e0('0xb')]('[%s][calls][varset]',_0x22fb09['uniqueid']),_0x22fb09);if(!_[_0xe4e0('0x21')](_0x22fb09[_0xe4e0('0x46')][_0xe4e0('0x47')])){utils['info'](util[_0xe4e0('0xb')](_0xe4e0('0x48'),_0x22fb09[_0xe4e0('0x9')],_0x22fb09[_0xe4e0('0x49')]));channels[_0x22fb09[_0xe4e0('0x9')]][_0xe4e0('0x4a')]=_0x22fb09[_0xe4e0('0x49')];}if(!_[_0xe4e0('0x21')](_0x22fb09[_0xe4e0('0x46')][_0xe4e0('0x4b')])){utils[_0xe4e0('0x19')](util['format'](_0xe4e0('0x4c'),_0x22fb09[_0xe4e0('0x9')],_0x22fb09[_0xe4e0('0x49')]));channels[_0x22fb09['uniqueid']][_0xe4e0('0x4d')]=_0x22fb09[_0xe4e0('0x49')];channels[_0x22fb09[_0xe4e0('0x9')]][_0xe4e0('0x2c')]='\x22'+_0x22fb09[_0xe4e0('0x49')]+_0xe4e0('0x4e')+_0x22fb09[_0xe4e0('0x49')]+'>';}if(!_[_0xe4e0('0x21')](_0x22fb09[_0xe4e0('0x46')][_0xe4e0('0x4f')])||!_[_0xe4e0('0x21')](_0x22fb09[_0xe4e0('0x46')][_0xe4e0('0x50')])){utils[_0xe4e0('0x19')](util[_0xe4e0('0xb')](_0xe4e0('0x51'),_0x22fb09[_0xe4e0('0x9')],!_[_0xe4e0('0x21')](_0x22fb09[_0xe4e0('0x46')][_0xe4e0('0x4f')])?_0xe4e0('0x4f'):'xmd-callerid',_0x22fb09[_0xe4e0('0x49')]));channels[_0x22fb09[_0xe4e0('0x9')]][_0xe4e0('0x2c')]=_0x22fb09[_0xe4e0('0x49')];}if(!_[_0xe4e0('0x21')](_0x22fb09[_0xe4e0('0x46')]['xmd-queue'])||!_[_0xe4e0('0x21')](_0x22fb09[_0xe4e0('0x46')]['xmcs-queue'])){utils[_0xe4e0('0x19')](util[_0xe4e0('0xb')](_0xe4e0('0x51'),_0x22fb09[_0xe4e0('0x9')],!_[_0xe4e0('0x21')](_0x22fb09['variable']['xmd-queue'])?_0xe4e0('0x52'):_0xe4e0('0x53'),_0x22fb09[_0xe4e0('0x49')]));channels[_0x22fb09[_0xe4e0('0x9')]][_0xe4e0('0x54')]=_0xe4e0('0x55');channels[_0x22fb09[_0xe4e0('0x9')]]['lastdata']=_0x22fb09[_0xe4e0('0x49')];channels[_0x22fb09[_0xe4e0('0x9')]][_0xe4e0('0xd')]=!![];}if(!_[_0xe4e0('0x21')](_0x22fb09['variable'][_0xe4e0('0x56')])){utils[_0xe4e0('0x19')](util[_0xe4e0('0xb')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x22fb09[_0xe4e0('0x9')],_0x22fb09['value']));channels[_0x22fb09[_0xe4e0('0x9')]]['ContactId']=_0x22fb09[_0xe4e0('0x49')];}if(!_[_0xe4e0('0x21')](_0x22fb09['variable'][_0xe4e0('0x57')])){utils['info'](util['format'](_0xe4e0('0x58'),_0x22fb09[_0xe4e0('0x9')],_0x22fb09[_0xe4e0('0x49')]));channels[_0x22fb09[_0xe4e0('0x9')]]['type']=_0x22fb09['value'];}if(!_[_0xe4e0('0x21')](_0x22fb09['variable'][_0xe4e0('0x59')])){utils[_0xe4e0('0x19')](util['format'](_0xe4e0('0x5a'),_0x22fb09['uniqueid'],_0x22fb09[_0xe4e0('0x49')]));channels[_0x22fb09[_0xe4e0('0x9')]][_0xe4e0('0x5b')]=_0x22fb09['value'];}if(!_[_0xe4e0('0x21')](_0x22fb09['variable'][_0xe4e0('0x5c')])){utils[_0xe4e0('0x19')](util['format'](_0xe4e0('0x5d'),_0x22fb09[_0xe4e0('0x9')],_0x22fb09[_0xe4e0('0x49')]));channels[_0x22fb09['uniqueid']][_0xe4e0('0x5c')]=_0x22fb09[_0xe4e0('0x49')];}}}catch(_0x465b2a){utils['error'](util[_0xe4e0('0xb')](_0xe4e0('0x5e'),_0x22fb09[_0xe4e0('0x9')]),_0x465b2a);}};exports['newexten']=function(_0x29af98){try{if(!_[_0xe4e0('0x21')](channels[_0x29af98[_0xe4e0('0x9')]])){utils['debug'](util[_0xe4e0('0xb')]('[%s][calls][newexten]',_0x29af98['uniqueid']),_0x29af98);utils['info'](util['format'](_0xe4e0('0x5f'),_0x29af98[_0xe4e0('0x9')],_0x29af98['application'],_0x29af98[_0xe4e0('0x60')]));if(_0x29af98[_0xe4e0('0x61')][_0xe4e0('0x62')]()==_0xe4e0('0x63')&&_[_0xe4e0('0x64')](_0x29af98[_0xe4e0('0x60')][_0xe4e0('0x62')](),'cdr')){var _0x2743d3=_0x29af98[_0xe4e0('0x60')][_0xe4e0('0x65')]('=');var _0x52a82f=_0x2743d3[0x0][_0xe4e0('0x66')](_0x2743d3[0x0][_0xe4e0('0x67')]('(')+0x1,_0x2743d3[0x0]['lastIndexOf'](')'));var _0x32c593=_0x2743d3[0x1];channels[_0x29af98[_0xe4e0('0x9')]][_0x52a82f]=_0x32c593;}if(!_[_0xe4e0('0x68')]([_0xe4e0('0x2a'),_0xe4e0('0x69'),'execif',_0xe4e0('0x63'),'gotoif'],_0x29af98[_0xe4e0('0x61')][_0xe4e0('0x62')]())){channels[_0x29af98[_0xe4e0('0x9')]][_0xe4e0('0x54')]=_0x29af98[_0xe4e0('0x61')];channels[_0x29af98[_0xe4e0('0x9')]][_0xe4e0('0x6a')]=_0x29af98[_0xe4e0('0x60')];}}}catch(_0xb98454){utils[_0xe4e0('0x1c')](util['format'](_0xe4e0('0x6b'),_0x29af98['uniqueid']),_0xb98454);}}; \ No newline at end of file +var _0xc579=['[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','transfertargetchannel','origtransfereruniqueid','userfield','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-phone','value','destination','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','blinds','uniqueid','transfereeuniqueid','info','format','queue','membername','calleridnum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','ANSWERED','error','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel'];(function(_0x16eeb4,_0x552216){var _0x5ee49e=function(_0x4b814b){while(--_0x4b814b){_0x16eeb4['push'](_0x16eeb4['shift']());}};_0x5ee49e(++_0x552216);}(_0xc579,0x174));var _0x9c57=function(_0x13adab,_0x26d2d2){_0x13adab=_0x13adab-0x0;var _0x2242b2=_0xc579[_0x13adab];return _0x2242b2;};'use strict';var _=require(_0x9c57('0x0'));var util=require(_0x9c57('0x1'));var utils=require(_0x9c57('0x2'));var transfers=require(_0x9c57('0x3'));var dispositions=[_0x9c57('0x4'),_0x9c57('0x5'),_0x9c57('0x5'),_0x9c57('0x4'),_0x9c57('0x4'),'NO\x20ANSWER','ANSWERED','BUSY',_0x9c57('0x5'),'FAILED',_0x9c57('0x5')];var channels={};function writeDB(_0xa833ce){var _0x4b9933;if(transfers[_0x9c57('0x6')][_0xa833ce['uniqueid']]){_0x4b9933=_0xa833ce[_0x9c57('0x7')];_0xa833ce['uniqueid']=transfers[_0x9c57('0x6')][_0xa833ce['uniqueid']][_0x9c57('0x8')];}utils[_0x9c57('0x9')](util[_0x9c57('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0xa833ce['uniqueid'],_0xa833ce['channel'],_0xa833ce[_0x9c57('0xb')],_0xa833ce[_0x9c57('0xc')],_0xa833ce['interface'],_0xa833ce[_0x9c57('0xd')],_0xa833ce['connectedlinenum'],_0xa833ce[_0x9c57('0xe')]));if(_0xa833ce[_0x9c57('0xf')]){utils[_0x9c57('0x10')](_0xa833ce['accountcode'])[_0x9c57('0x11')](function(_0x112550){if(_0x112550){_0xa833ce['UserId']=_0x112550['id'];}utils[_0x9c57('0x12')](_0x9c57('0x13'),_0xa833ce);});}else{utils[_0x9c57('0x12')](_0x9c57('0x13'),_0xa833ce);}if(channels[_0xa833ce['uniqueid']]){delete channels[_0xa833ce[_0x9c57('0x7')]];}else if(_0x4b9933&&channels[_0x4b9933]){delete transfers[_0x9c57('0x6')][_0x4b9933];delete channels[_0x4b9933];}}exports[_0x9c57('0x14')]=function(_0x1d1a5c){try{utils[_0x9c57('0x15')](util[_0x9c57('0xa')](_0x9c57('0x16'),_0x1d1a5c[_0x9c57('0x7')]),_0x1d1a5c);if(_0x1d1a5c[_0x9c57('0x7')]==_0x1d1a5c[_0x9c57('0x17')]&&_0x1d1a5c[_0x9c57('0x18')]!=_0x9c57('0x19')){utils[_0x9c57('0x9')](util[_0x9c57('0xa')](_0x9c57('0x1a'),_0x1d1a5c[_0x9c57('0x7')],_0x1d1a5c[_0x9c57('0x1b')],_0x1d1a5c['exten']));channels[_0x1d1a5c[_0x9c57('0x7')]]={'uniqueid':_0x1d1a5c[_0x9c57('0x7')],'accountcode':_0x1d1a5c['accountcode'],'source':_0x1d1a5c[_0x9c57('0xd')],'destination':_0x1d1a5c[_0x9c57('0x1c')],'destinationcontext':_0x1d1a5c[_0x9c57('0x1b')],'channel':_0x1d1a5c[_0x9c57('0x18')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9c57('0x4'),'amaflags':_0x9c57('0x1d')};}}catch(_0x345d12){utils['error'](util['format'](_0x9c57('0x16'),_0x1d1a5c[_0x9c57('0x7')]),_0x345d12);}};exports[_0x9c57('0x1e')]=function(_0x134b70){try{utils[_0x9c57('0x15')](util[_0x9c57('0xa')]('[%s][calls][newstate]',_0x134b70['uniqueid']),_0x134b70);if(!_[_0x9c57('0x1f')](channels[_0x134b70[_0x9c57('0x7')]])&&_0x134b70[_0x9c57('0x20')]==0x6){utils[_0x9c57('0x9')](util['format'](_0x9c57('0x21'),_0x134b70['uniqueid'],_0x134b70[_0x9c57('0x1b')],_0x134b70[_0x9c57('0x18')]));if(_[_0x9c57('0x1f')](channels[_0x134b70['uniqueid']][_0x9c57('0x22')])){channels[_0x134b70[_0x9c57('0x7')]][_0x9c57('0x22')]=utils[_0x9c57('0x23')]();}}else if(!_[_0x9c57('0x1f')](channels[_0x134b70['linkedid']])&&_0x134b70[_0x9c57('0x20')]==0x6&&_0x134b70['context']!=_0x9c57('0x24')){utils[_0x9c57('0x9')](util[_0x9c57('0xa')](_0x9c57('0x25'),_0x134b70[_0x9c57('0x7')],_0x134b70[_0x9c57('0x17')],_0x134b70[_0x9c57('0x1b')],_0x134b70[_0x9c57('0x18')]));channels[_0x134b70[_0x9c57('0x17')]][_0x9c57('0xf')]=_0x134b70[_0x9c57('0xf')];channels[_0x134b70[_0x9c57('0x17')]][_0x9c57('0x26')]=_0x134b70['channel'];if(_['isNil'](channels[_0x134b70[_0x9c57('0x17')]][_0x9c57('0x27')])){channels[_0x134b70[_0x9c57('0x17')]][_0x9c57('0x27')]=utils[_0x9c57('0x23')]();}channels[_0x134b70['linkedid']][_0x9c57('0x28')]=dispositions[_[_0x9c57('0x29')](_0x134b70[_0x9c57('0x20')])]||_0x9c57('0x2a');}}catch(_0x47e694){utils[_0x9c57('0x2b')](util[_0x9c57('0xa')](_0x9c57('0x2c'),_0x134b70['uniqueid']),_0x47e694);}};exports[_0x9c57('0x2d')]=function(_0x187978){try{if(!_[_0x9c57('0x1f')](channels[_0x187978['uniqueid']])){utils[_0x9c57('0x15')](util[_0x9c57('0xa')](_0x9c57('0x2e'),_0x187978[_0x9c57('0x7')]),_0x187978);if(_[_0x9c57('0x1f')](channels[_0x187978[_0x9c57('0x7')]]['callerid'])){channels[_0x187978[_0x9c57('0x7')]][_0x9c57('0x2f')]=_0x187978[_0x9c57('0x30')]+'\x20<'+_0x187978['calleridnum']+'>';}utils[_0x9c57('0x9')](util[_0x9c57('0xa')](_0x9c57('0x31'),_0x187978[_0x9c57('0x7')],channels[_0x187978[_0x9c57('0x7')]][_0x9c57('0x2f')],_0x187978[_0x9c57('0x32')]));channels[_0x187978[_0x9c57('0x7')]][_0x9c57('0x33')]=utils[_0x9c57('0x23')]();channels[_0x187978[_0x9c57('0x7')]][_0x9c57('0x34')]=utils[_0x9c57('0x35')](channels[_0x187978[_0x9c57('0x7')]][_0x9c57('0x33')],channels[_0x187978['uniqueid']][_0x9c57('0x36')]);channels[_0x187978['uniqueid']][_0x9c57('0x37')]=channels[_0x187978[_0x9c57('0x7')]][_0x9c57('0x27')]?utils[_0x9c57('0x35')](channels[_0x187978[_0x9c57('0x7')]][_0x9c57('0x33')],channels[_0x187978['uniqueid']][_0x9c57('0x27')]):0x0;writeDB(channels[_0x187978['uniqueid']]);}}catch(_0x3f37f0){utils[_0x9c57('0x2b')](util[_0x9c57('0xa')](_0x9c57('0x2e'),_0x187978['uniqueid']),_0x3f37f0);}};exports[_0x9c57('0x38')]=function(_0x385591){try{if(!_['isNil'](channels[_0x385591[_0x9c57('0x39')]])){utils[_0x9c57('0x15')](util[_0x9c57('0xa')](_0x9c57('0x3a'),_0x385591['origtransfereruniqueid']),_0x385591);if(channels[_0x385591[_0x9c57('0x39')]][_0x9c57('0x18')]==_0x385591[_0x9c57('0x3b')]){utils[_0x9c57('0x9')](util[_0x9c57('0xa')](_0x9c57('0x3c'),_0x385591['origtransfereruniqueid'],_0x385591[_0x9c57('0x39')],_0x385591[_0x9c57('0x3d')]));channels[_0x385591[_0x9c57('0x39')]]['destinationchannel']=_0x385591[_0x9c57('0x3d')];channels[_0x385591[_0x9c57('0x39')]]['userfield']=_0x9c57('0x3e');}else if(channels[_0x385591[_0x9c57('0x39')]][_0x9c57('0x18')]=_0x385591[_0x9c57('0x3f')]){utils['info'](util[_0x9c57('0xa')](_0x9c57('0x3c'),_0x385591[_0x9c57('0x40')],_0x385591[_0x9c57('0x39')],_0x385591['origtransfererchannel']));channels[_0x385591['localtwolinkedid']][_0x9c57('0x26')]=_0x385591['origtransfererchannel'];channels[_0x385591[_0x9c57('0x39')]][_0x9c57('0x41')]='_attended';}}}catch(_0x17f411){utils['error'](util[_0x9c57('0xa')]('[%s][calls][attendedtransfer]',_0x385591[_0x9c57('0x40')]),_0x17f411);}};exports[_0x9c57('0x42')]=function(_0x2057d1){try{if(!_['isNil'](channels[_0x2057d1[_0x9c57('0x7')]])){utils[_0x9c57('0x15')](util[_0x9c57('0xa')](_0x9c57('0x43'),_0x2057d1[_0x9c57('0x7')]),_0x2057d1);channels[_0x2057d1[_0x9c57('0x7')]]['musiconholdstartAt']=utils['now']();utils['info'](util[_0x9c57('0xa')](_0x9c57('0x44'),_0x2057d1['uniqueid'],channels[_0x2057d1[_0x9c57('0x7')]][_0x9c57('0x45')]));}}catch(_0x218688){utils[_0x9c57('0x2b')](util[_0x9c57('0xa')](_0x9c57('0x43'),_0x2057d1['uniqueid']),_0x218688);}};exports['musiconholdstop']=function(_0x5ede70){try{if(!_[_0x9c57('0x1f')](channels[_0x5ede70[_0x9c57('0x7')]])){utils['debug'](util['format'](_0x9c57('0x46'),_0x5ede70[_0x9c57('0x7')]),_0x5ede70);if(!_[_0x9c57('0x1f')](channels[_0x5ede70[_0x9c57('0x7')]][_0x9c57('0x45')])){channels[_0x5ede70[_0x9c57('0x7')]]['mohtime']+=utils[_0x9c57('0x35')](utils[_0x9c57('0x23')](),channels[_0x5ede70[_0x9c57('0x7')]][_0x9c57('0x45')]);utils[_0x9c57('0x9')](util[_0x9c57('0xa')](_0x9c57('0x47'),_0x5ede70[_0x9c57('0x7')],channels[_0x5ede70['uniqueid']][_0x9c57('0x48')]));delete channels[_0x5ede70[_0x9c57('0x7')]][_0x9c57('0x45')];}}}catch(_0x556c79){utils[_0x9c57('0x2b')](util[_0x9c57('0xa')]('[%s][calls][musiconholdstop]',_0x5ede70['uniqueid']),_0x556c79);}};exports[_0x9c57('0x49')]=function(_0x2a9cb5){try{if(!_[_0x9c57('0x1f')](channels[_0x2a9cb5[_0x9c57('0x7')]])){utils[_0x9c57('0x15')](util[_0x9c57('0xa')](_0x9c57('0x4a'),_0x2a9cb5[_0x9c57('0x7')]),_0x2a9cb5);if(!_[_0x9c57('0x1f')](_0x2a9cb5[_0x9c57('0x4b')][_0x9c57('0x4c')])){utils[_0x9c57('0x9')](util[_0x9c57('0xa')](_0x9c57('0x4d'),_0x2a9cb5[_0x9c57('0x7')],_0x2a9cb5['value']));channels[_0x2a9cb5[_0x9c57('0x7')]]['source']=_0x2a9cb5['value'];}if(!_[_0x9c57('0x1f')](_0x2a9cb5[_0x9c57('0x4b')][_0x9c57('0x4e')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x2a9cb5[_0x9c57('0x7')],_0x2a9cb5[_0x9c57('0x4f')]));channels[_0x2a9cb5[_0x9c57('0x7')]][_0x9c57('0x50')]=_0x2a9cb5[_0x9c57('0x4f')];channels[_0x2a9cb5[_0x9c57('0x7')]][_0x9c57('0x2f')]='\x22'+_0x2a9cb5['value']+'\x22\x20<'+_0x2a9cb5[_0x9c57('0x4f')]+'>';}if(!_[_0x9c57('0x1f')](_0x2a9cb5[_0x9c57('0x4b')][_0x9c57('0x51')])||!_[_0x9c57('0x1f')](_0x2a9cb5['variable'][_0x9c57('0x52')])){utils[_0x9c57('0x9')](util['format'](_0x9c57('0x53'),_0x2a9cb5[_0x9c57('0x7')],!_[_0x9c57('0x1f')](_0x2a9cb5['variable']['xmd-callerid-preview'])?_0x9c57('0x51'):_0x9c57('0x52'),_0x2a9cb5[_0x9c57('0x4f')]));channels[_0x2a9cb5[_0x9c57('0x7')]][_0x9c57('0x2f')]=_0x2a9cb5[_0x9c57('0x4f')];}if(!_[_0x9c57('0x1f')](_0x2a9cb5[_0x9c57('0x4b')][_0x9c57('0x54')])||!_[_0x9c57('0x1f')](_0x2a9cb5['variable'][_0x9c57('0x55')])){utils[_0x9c57('0x9')](util[_0x9c57('0xa')](_0x9c57('0x53'),_0x2a9cb5[_0x9c57('0x7')],!_[_0x9c57('0x1f')](_0x2a9cb5[_0x9c57('0x4b')]['xmd-queue'])?_0x9c57('0x54'):'xmcs-queue',_0x2a9cb5['value']));channels[_0x2a9cb5[_0x9c57('0x7')]][_0x9c57('0x56')]='Queue';channels[_0x2a9cb5[_0x9c57('0x7')]][_0x9c57('0x57')]=_0x2a9cb5[_0x9c57('0x4f')];channels[_0x2a9cb5[_0x9c57('0x7')]]['queue']=!![];}if(!_['isNil'](_0x2a9cb5[_0x9c57('0x4b')][_0x9c57('0x58')])){utils[_0x9c57('0x9')](util[_0x9c57('0xa')](_0x9c57('0x59'),_0x2a9cb5[_0x9c57('0x7')],_0x2a9cb5['value']));channels[_0x2a9cb5[_0x9c57('0x7')]][_0x9c57('0x5a')]=_0x2a9cb5[_0x9c57('0x4f')];}if(!_[_0x9c57('0x1f')](_0x2a9cb5[_0x9c57('0x4b')]['xmd-cdrtype'])){utils[_0x9c57('0x9')](util[_0x9c57('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x2a9cb5['uniqueid'],_0x2a9cb5[_0x9c57('0x4f')]));channels[_0x2a9cb5[_0x9c57('0x7')]]['type']=_0x2a9cb5['value'];}if(!_['isNil'](_0x2a9cb5[_0x9c57('0x4b')]['outboundrouteid'])){utils[_0x9c57('0x9')](util[_0x9c57('0xa')](_0x9c57('0x5b'),_0x2a9cb5[_0x9c57('0x7')],_0x2a9cb5['value']));channels[_0x2a9cb5['uniqueid']][_0x9c57('0x5c')]=_0x2a9cb5[_0x9c57('0x4f')];}if(!_['isNil'](_0x2a9cb5[_0x9c57('0x4b')][_0x9c57('0x5d')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x2a9cb5[_0x9c57('0x7')],_0x2a9cb5[_0x9c57('0x4f')]));channels[_0x2a9cb5[_0x9c57('0x7')]][_0x9c57('0x5d')]=_0x2a9cb5[_0x9c57('0x4f')];}}}catch(_0x507068){utils[_0x9c57('0x2b')](util['format'](_0x9c57('0x4a'),_0x2a9cb5[_0x9c57('0x7')]),_0x507068);}};exports[_0x9c57('0x5e')]=function(_0x3555bb){try{if(!_['isNil'](channels[_0x3555bb[_0x9c57('0x7')]])){utils[_0x9c57('0x15')](util[_0x9c57('0xa')](_0x9c57('0x5f'),_0x3555bb['uniqueid']),_0x3555bb);utils[_0x9c57('0x9')](util[_0x9c57('0xa')](_0x9c57('0x60'),_0x3555bb[_0x9c57('0x7')],_0x3555bb['application'],_0x3555bb['appdata']));if(_0x3555bb[_0x9c57('0x61')][_0x9c57('0x62')]()==_0x9c57('0x63')&&_[_0x9c57('0x64')](_0x3555bb[_0x9c57('0x65')][_0x9c57('0x62')](),_0x9c57('0x66'))){var _0x103587=_0x3555bb[_0x9c57('0x65')]['split']('=');var _0x494e61=_0x103587[0x0]['substring'](_0x103587[0x0]['lastIndexOf']('(')+0x1,_0x103587[0x0][_0x9c57('0x67')](')'));var _0x174c1c=_0x103587[0x1];channels[_0x3555bb[_0x9c57('0x7')]][_0x494e61]=_0x174c1c;}if(!_[_0x9c57('0x68')]([_0x9c57('0x2d'),_0x9c57('0x69'),_0x9c57('0x6a'),_0x9c57('0x63'),_0x9c57('0x6b')],_0x3555bb['application']['toLowerCase']())){channels[_0x3555bb[_0x9c57('0x7')]][_0x9c57('0x56')]=_0x3555bb[_0x9c57('0x61')];channels[_0x3555bb[_0x9c57('0x7')]][_0x9c57('0x57')]=_0x3555bb[_0x9c57('0x65')];}}}catch(_0x392418){utils['error'](util[_0x9c57('0xa')]('[%s][calls][newexten]',_0x3555bb[_0x9c57('0x7')]),_0x392418);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 4e181c4..e61d3cb 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 _0x0313=['error','close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','fullybooted','[core]\x20fullybooted'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0313,0x194));var _0x3031=function(_0x4f860a,_0xd8581c){_0x4f860a=_0x4f860a-0x0;var _0x34f077=_0x0313[_0x4f860a];return _0x34f077;};'use strict';var utils=require(_0x3031('0x0'));exports[_0x3031('0x1')]=function(){utils[_0x3031('0x2')](_0x3031('0x3'));};exports['shutdown']=function(){utils['info']('[core]\x20shutdown');};exports[_0x3031('0x4')]=function(){utils['info'](_0x3031('0x5'));};exports['error']=function(_0x1cad32){utils[_0x3031('0x6')]('[core]\x20error',_0x1cad32);};exports[_0x3031('0x7')]=function(){utils[_0x3031('0x2')](_0x3031('0x8'));};exports[_0x3031('0x9')]=function(_0x465bc3){}; \ No newline at end of file +var _0xaccc=['info','[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted','error','close','[core]\x20close','managerevent','./utils','connect'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xaccc,0xda));var _0xcacc=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xaccc[_0x87b0ff];return _0x3bc0b2;};'use strict';var utils=require(_0xcacc('0x0'));exports[_0xcacc('0x1')]=function(){utils[_0xcacc('0x2')](_0xcacc('0x3'));};exports[_0xcacc('0x4')]=function(){utils[_0xcacc('0x2')]('[core]\x20shutdown');};exports[_0xcacc('0x5')]=function(){utils[_0xcacc('0x2')](_0xcacc('0x6'));};exports[_0xcacc('0x7')]=function(_0x5b38c0){utils[_0xcacc('0x7')]('[core]\x20error',_0x5b38c0);};exports[_0xcacc('0x8')]=function(){utils[_0xcacc('0x2')](_0xcacc('0x9'));};exports[_0xcacc('0xa')]=function(_0x4401bf){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 574a686..702ad68 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 _0x0f20=['[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','dialstatus','ANSWER','answertime','now','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','duration','diffTime','holdtime','endtime','lodash','util','uniqueid','channel','CreateVoiceDialReport','debug','format','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr(routeid)','split','error','[%s][dials][newexten]','varset','[%s][dials][varset]','isNil','variable','outboundrouteid'];(function(_0x45632f,_0x1f01ec){var _0xe91bed=function(_0x505c5a){while(--_0x505c5a){_0x45632f['push'](_0x45632f['shift']());}};_0xe91bed(++_0x1f01ec);}(_0x0f20,0x139));var _0x00f2=function(_0x19b4de,_0x3ad4c5){_0x19b4de=_0x19b4de-0x0;var _0x44e0e4=_0x0f20[_0x19b4de];return _0x44e0e4;};'use strict';var _=require(_0x00f2('0x0'));var util=require(_0x00f2('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x1df860){utils['info'](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x1df860[_0x00f2('0x2')],_0x1df860[_0x00f2('0x3')],_0x1df860['dialstring'],_0x1df860['calleridnum'],_0x1df860['connectedlinenum'],_0x1df860['dialstatus']));utils['request'](_0x00f2('0x4'),_0x1df860);delete dials[_0x1df860['uniqueid']];}exports['newexten']=function(_0x364a13){try{utils[_0x00f2('0x5')](util[_0x00f2('0x6')]('[%s][dials][newexten]',_0x364a13[_0x00f2('0x2')]),_0x364a13);utils[_0x00f2('0x7')](util[_0x00f2('0x6')](_0x00f2('0x8'),_0x364a13[_0x00f2('0x2')],_0x364a13['application'],_0x364a13[_0x00f2('0x9')]));if(_0x364a13[_0x00f2('0xa')][_0x00f2('0xb')]()==_0x00f2('0xc')&&_[_0x00f2('0xd')](_0x364a13[_0x00f2('0x9')][_0x00f2('0xb')](),_0x00f2('0xe'))){var _0x8a5253=_0x364a13['appdata'][_0x00f2('0xf')]('=');dials[_0x364a13[_0x00f2('0x2')]]={'routeId':_0x8a5253[0x1]};}}catch(_0x55c4da){utils[_0x00f2('0x10')](util[_0x00f2('0x6')](_0x00f2('0x11'),_0x364a13[_0x00f2('0x2')]),_0x55c4da);}};exports[_0x00f2('0x12')]=function(_0x288d79){try{utils[_0x00f2('0x5')](util['format'](_0x00f2('0x13'),_0x288d79[_0x00f2('0x2')]),_0x288d79);if(!_[_0x00f2('0x14')](_0x288d79[_0x00f2('0x15')][_0x00f2('0x16')])){utils[_0x00f2('0x7')](util['format'](_0x00f2('0x17'),_0x288d79[_0x00f2('0x2')],_0x288d79[_0x00f2('0x18')]));dials[_0x288d79[_0x00f2('0x2')]]={'routeId':_0x288d79['value']};}}catch(_0x490fac){utils['error'](util[_0x00f2('0x6')](_0x00f2('0x13'),_0x288d79[_0x00f2('0x2')]),_0x490fac);}};exports[_0x00f2('0x19')]=function(_0x35786b){try{if(!_[_0x00f2('0x14')](dials[_0x35786b[_0x00f2('0x2')]])){utils[_0x00f2('0x5')](util[_0x00f2('0x6')](_0x00f2('0x1a'),_0x35786b[_0x00f2('0x2')]),_0x35786b);dials[_0x35786b[_0x00f2('0x2')]]=_[_0x00f2('0x1b')](dials[_0x35786b[_0x00f2('0x2')]],_0x35786b);dials[_0x35786b[_0x00f2('0x2')]]['starttime']=utils['now']();dials[_0x35786b[_0x00f2('0x2')]][_0x00f2('0x1c')]=_0x00f2('0x1d');utils[_0x00f2('0x7')](util['format'](_0x00f2('0x1e'),_0x35786b[_0x00f2('0x2')],dials[_0x35786b[_0x00f2('0x2')]][_0x00f2('0x1f')]));}}catch(_0x895f2c){utils[_0x00f2('0x10')](util[_0x00f2('0x6')]('[%s][dials][dialbegin]',_0x35786b[_0x00f2('0x2')]),_0x895f2c);}};exports[_0x00f2('0x20')]=function(_0x48bf5e){try{if(!_[_0x00f2('0x14')](dials[_0x48bf5e[_0x00f2('0x2')]])){utils['debug'](util[_0x00f2('0x6')](_0x00f2('0x21'),_0x48bf5e[_0x00f2('0x2')]),_0x48bf5e);dials[_0x48bf5e[_0x00f2('0x2')]][_0x00f2('0x22')]=_0x48bf5e['dialstatus'];if(_0x48bf5e[_0x00f2('0x22')]==_0x00f2('0x23')){dials[_0x48bf5e[_0x00f2('0x2')]]=_[_0x00f2('0x1b')](dials[_0x48bf5e[_0x00f2('0x2')]],_0x48bf5e);dials[_0x48bf5e[_0x00f2('0x2')]][_0x00f2('0x24')]=utils[_0x00f2('0x25')]();dials[_0x48bf5e[_0x00f2('0x2')]][_0x00f2('0x1c')]='connect';utils[_0x00f2('0x7')](util[_0x00f2('0x6')](_0x00f2('0x26'),_0x48bf5e[_0x00f2('0x2')],_0x48bf5e[_0x00f2('0x22')],dials[_0x48bf5e[_0x00f2('0x2')]]['answertime']));}else{utils['info'](util[_0x00f2('0x6')](_0x00f2('0x27'),_0x48bf5e[_0x00f2('0x2')],_0x48bf5e[_0x00f2('0x22')]));}}}catch(_0x571192){utils['error'](util[_0x00f2('0x6')](_0x00f2('0x21'),_0x48bf5e[_0x00f2('0x2')]),_0x571192);}};exports[_0x00f2('0x28')]=function(_0x3330af){try{if(!_['isNil'](dials[_0x3330af[_0x00f2('0x2')]])){utils['debug'](util[_0x00f2('0x6')](_0x00f2('0x29'),_0x3330af[_0x00f2('0x2')]),_0x3330af);utils[_0x00f2('0x7')](util[_0x00f2('0x6')](_0x00f2('0x2a'),_0x3330af['uniqueid'],_0x3330af['calleridnum'],_0x3330af[_0x00f2('0x2b')],_0x3330af['cause-txt']));dials[_0x3330af[_0x00f2('0x2')]]=_[_0x00f2('0x1b')](dials[_0x3330af['uniqueid']],{'endtime':utils[_0x00f2('0x25')](),'lastevent':'complete'});dials[_0x3330af[_0x00f2('0x2')]][_0x00f2('0x2c')]=utils[_0x00f2('0x2d')](dials[_0x3330af[_0x00f2('0x2')]]['endtime'],dials[_0x3330af['uniqueid']][_0x00f2('0x1f')]);dials[_0x3330af[_0x00f2('0x2')]][_0x00f2('0x2e')]=utils[_0x00f2('0x2d')](dials[_0x3330af[_0x00f2('0x2')]][_0x00f2('0x24')]||dials[_0x3330af[_0x00f2('0x2')]][_0x00f2('0x2f')],dials[_0x3330af[_0x00f2('0x2')]][_0x00f2('0x1f')]);dials[_0x3330af['uniqueid']]['billableseconds']=dials[_0x3330af[_0x00f2('0x2')]][_0x00f2('0x24')]?utils[_0x00f2('0x2d')](dials[_0x3330af[_0x00f2('0x2')]][_0x00f2('0x2f')],dials[_0x3330af[_0x00f2('0x2')]][_0x00f2('0x24')]):0x0;writeDB(dials[_0x3330af[_0x00f2('0x2')]]);}}catch(_0x40350b){utils[_0x00f2('0x10')](util[_0x00f2('0x6')](_0x00f2('0x29'),_0x3330af[_0x00f2('0x2')]),_0x40350b);}}; \ No newline at end of file +var _0xd8b6=['[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','info','format','uniqueid','channel','calleridnum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','appdata','application','toLowerCase','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect'];(function(_0x48fb10,_0xa50a89){var _0x534251=function(_0xcdc19e){while(--_0xcdc19e){_0x48fb10['push'](_0x48fb10['shift']());}};_0x534251(++_0xa50a89);}(_0xd8b6,0xf4));var _0x6d8b=function(_0x345344,_0x18a281){_0x345344=_0x345344-0x0;var _0x39937e=_0xd8b6[_0x345344];return _0x39937e;};'use strict';var _=require(_0x6d8b('0x0'));var util=require(_0x6d8b('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x363f43){utils[_0x6d8b('0x2')](util[_0x6d8b('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x363f43[_0x6d8b('0x4')],_0x363f43[_0x6d8b('0x5')],_0x363f43['dialstring'],_0x363f43[_0x6d8b('0x6')],_0x363f43['connectedlinenum'],_0x363f43[_0x6d8b('0x7')]));utils[_0x6d8b('0x8')](_0x6d8b('0x9'),_0x363f43);delete dials[_0x363f43[_0x6d8b('0x4')]];}exports[_0x6d8b('0xa')]=function(_0x5a731f){try{utils[_0x6d8b('0xb')](util[_0x6d8b('0x3')](_0x6d8b('0xc'),_0x5a731f['uniqueid']),_0x5a731f);utils[_0x6d8b('0x2')](util[_0x6d8b('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x5a731f[_0x6d8b('0x4')],_0x5a731f['application'],_0x5a731f[_0x6d8b('0xd')]));if(_0x5a731f[_0x6d8b('0xe')][_0x6d8b('0xf')]()=='set'&&_[_0x6d8b('0x10')](_0x5a731f[_0x6d8b('0xd')][_0x6d8b('0xf')](),_0x6d8b('0x11'))){var _0x2443f3=_0x5a731f[_0x6d8b('0xd')][_0x6d8b('0x12')]('=');dials[_0x5a731f[_0x6d8b('0x4')]]={'routeId':_0x2443f3[0x1]};}}catch(_0x11d80e){utils[_0x6d8b('0x13')](util[_0x6d8b('0x3')](_0x6d8b('0xc'),_0x5a731f[_0x6d8b('0x4')]),_0x11d80e);}};exports[_0x6d8b('0x14')]=function(_0x394986){try{utils[_0x6d8b('0xb')](util[_0x6d8b('0x3')](_0x6d8b('0x15'),_0x394986[_0x6d8b('0x4')]),_0x394986);if(!_[_0x6d8b('0x16')](_0x394986[_0x6d8b('0x17')][_0x6d8b('0x18')])){utils[_0x6d8b('0x2')](util['format'](_0x6d8b('0x19'),_0x394986[_0x6d8b('0x4')],_0x394986[_0x6d8b('0x1a')]));dials[_0x394986['uniqueid']]={'routeId':_0x394986[_0x6d8b('0x1a')]};}}catch(_0x28371a){utils[_0x6d8b('0x13')](util['format'](_0x6d8b('0x15'),_0x394986['uniqueid']),_0x28371a);}};exports['dialbegin']=function(_0x30c51a){try{if(!_[_0x6d8b('0x16')](dials[_0x30c51a[_0x6d8b('0x4')]])){utils[_0x6d8b('0xb')](util[_0x6d8b('0x3')](_0x6d8b('0x1b'),_0x30c51a[_0x6d8b('0x4')]),_0x30c51a);dials[_0x30c51a[_0x6d8b('0x4')]]=_[_0x6d8b('0x1c')](dials[_0x30c51a[_0x6d8b('0x4')]],_0x30c51a);dials[_0x30c51a[_0x6d8b('0x4')]][_0x6d8b('0x1d')]=utils[_0x6d8b('0x1e')]();dials[_0x30c51a[_0x6d8b('0x4')]][_0x6d8b('0x1f')]='called';utils['info'](util[_0x6d8b('0x3')](_0x6d8b('0x20'),_0x30c51a[_0x6d8b('0x4')],dials[_0x30c51a['uniqueid']]['starttime']));}}catch(_0x429cf0){utils['error'](util[_0x6d8b('0x3')](_0x6d8b('0x1b'),_0x30c51a[_0x6d8b('0x4')]),_0x429cf0);}};exports[_0x6d8b('0x21')]=function(_0x554c48){try{if(!_[_0x6d8b('0x16')](dials[_0x554c48[_0x6d8b('0x4')]])){utils[_0x6d8b('0xb')](util['format'](_0x6d8b('0x22'),_0x554c48['uniqueid']),_0x554c48);dials[_0x554c48[_0x6d8b('0x4')]][_0x6d8b('0x7')]=_0x554c48[_0x6d8b('0x7')];if(_0x554c48[_0x6d8b('0x7')]==_0x6d8b('0x23')){dials[_0x554c48[_0x6d8b('0x4')]]=_[_0x6d8b('0x1c')](dials[_0x554c48['uniqueid']],_0x554c48);dials[_0x554c48[_0x6d8b('0x4')]][_0x6d8b('0x24')]=utils[_0x6d8b('0x1e')]();dials[_0x554c48[_0x6d8b('0x4')]]['lastevent']='connect';utils[_0x6d8b('0x2')](util['format'](_0x6d8b('0x25'),_0x554c48[_0x6d8b('0x4')],_0x554c48[_0x6d8b('0x7')],dials[_0x554c48['uniqueid']][_0x6d8b('0x24')]));}else{utils[_0x6d8b('0x2')](util[_0x6d8b('0x3')](_0x6d8b('0x26'),_0x554c48[_0x6d8b('0x4')],_0x554c48[_0x6d8b('0x7')]));}}}catch(_0x4384ac){utils['error'](util[_0x6d8b('0x3')](_0x6d8b('0x22'),_0x554c48[_0x6d8b('0x4')]),_0x4384ac);}};exports[_0x6d8b('0x27')]=function(_0x55301c){try{if(!_['isNil'](dials[_0x55301c[_0x6d8b('0x4')]])){utils[_0x6d8b('0xb')](util[_0x6d8b('0x3')]('[%s][dials][hangup]',_0x55301c[_0x6d8b('0x4')]),_0x55301c);utils[_0x6d8b('0x2')](util[_0x6d8b('0x3')](_0x6d8b('0x28'),_0x55301c['uniqueid'],_0x55301c['calleridnum'],_0x55301c['calleridname'],_0x55301c[_0x6d8b('0x29')]));dials[_0x55301c[_0x6d8b('0x4')]]=_[_0x6d8b('0x1c')](dials[_0x55301c[_0x6d8b('0x4')]],{'endtime':utils[_0x6d8b('0x1e')](),'lastevent':'complete'});dials[_0x55301c[_0x6d8b('0x4')]][_0x6d8b('0x2a')]=utils[_0x6d8b('0x2b')](dials[_0x55301c[_0x6d8b('0x4')]][_0x6d8b('0x2c')],dials[_0x55301c[_0x6d8b('0x4')]]['starttime']);dials[_0x55301c[_0x6d8b('0x4')]][_0x6d8b('0x2d')]=utils[_0x6d8b('0x2b')](dials[_0x55301c[_0x6d8b('0x4')]]['answertime']||dials[_0x55301c[_0x6d8b('0x4')]][_0x6d8b('0x2c')],dials[_0x55301c['uniqueid']]['starttime']);dials[_0x55301c['uniqueid']][_0x6d8b('0x2e')]=dials[_0x55301c[_0x6d8b('0x4')]][_0x6d8b('0x24')]?utils['diffTime'](dials[_0x55301c['uniqueid']][_0x6d8b('0x2c')],dials[_0x55301c[_0x6d8b('0x4')]][_0x6d8b('0x24')]):0x0;writeDB(dials[_0x55301c[_0x6d8b('0x4')]]);}}catch(_0x47dd19){utils[_0x6d8b('0x13')](util[_0x6d8b('0x3')]('[%s][dials][hangup]',_0x55301c[_0x6d8b('0x4')]),_0x47dd19);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 8c2f9b1..aba28c2 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 _0xbfaa=['error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','asterisk','username','password','keepConnected','xdr','disabled','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','fullybooted'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xbfaa,0x17f));var _0xabfa=function(_0x265c81,_0x4d539a){_0x265c81=_0x265c81-0x0;var _0x3e63d1=_0xbfaa[_0x265c81];return _0x3e63d1;};var AsteriskManager=require(_0xabfa('0x0'));var config=require('../../config/environment');var utils=require(_0xabfa('0x1'));var util=require(_0xabfa('0x2'));var ami=new AsteriskManager(config['asterisk']['port'],config[_0xabfa('0x3')]['ip'],config[_0xabfa('0x3')][_0xabfa('0x4')],config[_0xabfa('0x3')][_0xabfa('0x5')],!![]);ami[_0xabfa('0x6')]();if(config[_0xabfa('0x7')]&&config[_0xabfa('0x7')][_0xabfa('0x8')]){utils[_0xabfa('0x9')]('XDR\x20DISABLED');}else{var agents=require(_0xabfa('0xa'));var calls=require(_0xabfa('0xb'));var queues=require(_0xabfa('0xc'));var recordings=require(_0xabfa('0xd'));var members=require(_0xabfa('0xe'));var dials=require('./dials.controller');var transfers=require(_0xabfa('0xf'));var core=require(_0xabfa('0x10'));ami['on']('connect',core[_0xabfa('0x11')]);ami['on']('shutdown',core['shutdown']);ami['on'](_0xabfa('0x12'),core[_0xabfa('0x12')]);ami['on'](_0xabfa('0x13'),core[_0xabfa('0x13')]);ami['on'](_0xabfa('0x14'),core['close']);ami['on']('managerevent',core[_0xabfa('0x15')]);ami['on'](_0xabfa('0x16'),function(_0x1256f8){try{utils[_0xabfa('0x17')](util[_0xabfa('0x18')](_0xabfa('0x19'),_0x1256f8[_0xabfa('0x1a')]),_0x1256f8);members[_0xabfa('0x16')](_0x1256f8);}catch(_0x3e3948){utils[_0xabfa('0x13')](util['format'](_0xabfa('0x19'),_0x1256f8[_0xabfa('0x1a')]),_0x3e3948);}});ami['on']('agentcalled',function(_0x568e7f){try{utils[_0xabfa('0x17')](util[_0xabfa('0x18')](_0xabfa('0x1b'),_0x568e7f[_0xabfa('0x1c')]),_0x568e7f);agents[_0xabfa('0x1d')](_0x568e7f);}catch(_0x2d0133){utils[_0xabfa('0x13')](util[_0xabfa('0x18')]('[%s][index][agentcalled]',_0x568e7f[_0xabfa('0x1c')]),_0x2d0133);}});ami['on'](_0xabfa('0x1e'),function(_0x5ad3a2){try{utils[_0xabfa('0x17')](util[_0xabfa('0x18')](_0xabfa('0x1f'),_0x5ad3a2[_0xabfa('0x1c')]),_0x5ad3a2);agents['agentringnoanswer'](_0x5ad3a2);}catch(_0x4943c7){utils[_0xabfa('0x13')](util[_0xabfa('0x18')](_0xabfa('0x1f'),_0x5ad3a2[_0xabfa('0x1c')]),_0x4943c7);}});ami['on'](_0xabfa('0x20'),function(_0xd84b25){try{utils[_0xabfa('0x17')](util['format'](_0xabfa('0x21'),_0xd84b25[_0xabfa('0x1c')]),_0xd84b25);agents[_0xabfa('0x20')](_0xd84b25);queues[_0xabfa('0x20')](_0xd84b25);}catch(_0x36406a){utils[_0xabfa('0x13')](util[_0xabfa('0x18')](_0xabfa('0x21'),_0xd84b25[_0xabfa('0x1c')]),_0x36406a);}});ami['on'](_0xabfa('0x22'),function(_0x47a091){try{utils['debug'](util[_0xabfa('0x18')](_0xabfa('0x23'),_0x47a091[_0xabfa('0x1c')]),_0x47a091);agents[_0xabfa('0x22')](_0x47a091);queues[_0xabfa('0x22')](_0x47a091);members[_0xabfa('0x22')](_0x47a091);}catch(_0x3fe226){utils['error'](util[_0xabfa('0x18')](_0xabfa('0x23'),_0x47a091[_0xabfa('0x1c')]),_0x3fe226);}});ami['on'](_0xabfa('0x24'),function(_0x5c4e65){try{utils['debug'](util[_0xabfa('0x18')]('[%s][index][queuecallerabandon]',_0x5c4e65[_0xabfa('0x1c')]),_0x5c4e65);agents[_0xabfa('0x24')](_0x5c4e65);queues[_0xabfa('0x24')](_0x5c4e65);}catch(_0x366ea8){utils['error'](util[_0xabfa('0x18')](_0xabfa('0x25'),_0x5c4e65[_0xabfa('0x1c')]),_0x366ea8);}});ami['on'](_0xabfa('0x26'),function(_0x3dd531){try{utils[_0xabfa('0x17')](util[_0xabfa('0x18')](_0xabfa('0x27'),_0x3dd531['uniqueid']),_0x3dd531);queues[_0xabfa('0x26')](_0x3dd531);recordings[_0xabfa('0x26')](_0x3dd531);}catch(_0x28a416){utils[_0xabfa('0x13')](util['format'](_0xabfa('0x27'),_0x3dd531[_0xabfa('0x1c')]),_0x28a416);}});ami['on']('queuecallerleave',function(_0x8817fb){try{utils[_0xabfa('0x17')](util[_0xabfa('0x18')](_0xabfa('0x28'),_0x8817fb[_0xabfa('0x1c')]),_0x8817fb);queues[_0xabfa('0x29')](_0x8817fb);}catch(_0x352aa3){utils['error'](util[_0xabfa('0x18')](_0xabfa('0x28'),_0x8817fb[_0xabfa('0x1c')]),_0x352aa3);}});ami['on'](_0xabfa('0x2a'),function(_0x5249ba){try{utils[_0xabfa('0x17')](util[_0xabfa('0x18')](_0xabfa('0x2b'),_0x5249ba[_0xabfa('0x1c')]),_0x5249ba);queues[_0xabfa('0x2a')](_0x5249ba);calls[_0xabfa('0x2a')](_0x5249ba);}catch(_0x14304c){utils['error'](util['format'](_0xabfa('0x2b'),_0x5249ba[_0xabfa('0x1c')]),_0x14304c);}});ami['on'](_0xabfa('0x2c'),function(_0x896675){try{utils[_0xabfa('0x17')](util['format'](_0xabfa('0x2d'),_0x896675[_0xabfa('0x1c')]),_0x896675);queues[_0xabfa('0x2c')](_0x896675);calls[_0xabfa('0x2c')](_0x896675);}catch(_0x3d1a92){utils['error'](util[_0xabfa('0x18')](_0xabfa('0x2d'),_0x896675[_0xabfa('0x1c')]),_0x3d1a92);}});ami['on'](_0xabfa('0x2e'),function(_0x13792e){try{utils[_0xabfa('0x17')](util[_0xabfa('0x18')](_0xabfa('0x2f'),_0x13792e[_0xabfa('0x1c')]),_0x13792e);calls['newstate'](_0x13792e);recordings[_0xabfa('0x2e')](_0x13792e);}catch(_0x5e0432){utils[_0xabfa('0x13')](util[_0xabfa('0x18')](_0xabfa('0x2f'),_0x13792e[_0xabfa('0x1c')]),_0x5e0432);}});ami['on']('hangup',function(_0x4baaf8){try{utils[_0xabfa('0x17')](util['format'](_0xabfa('0x30'),_0x4baaf8['uniqueid']),_0x4baaf8);calls[_0xabfa('0x31')](_0x4baaf8);recordings[_0xabfa('0x31')](_0x4baaf8);dials[_0xabfa('0x31')](_0x4baaf8);agents[_0xabfa('0x31')](_0x4baaf8);queues['hangup'](_0x4baaf8);}catch(_0x236ab0){utils[_0xabfa('0x13')](util[_0xabfa('0x18')](_0xabfa('0x30'),_0x4baaf8['uniqueid']),_0x236ab0);}});ami['on'](_0xabfa('0x32'),function(_0x55fbd2){try{utils[_0xabfa('0x17')](util[_0xabfa('0x18')](_0xabfa('0x33'),_0x55fbd2[_0xabfa('0x1c')]),_0x55fbd2);members[_0xabfa('0x32')](_0x55fbd2);}catch(_0x2709a3){utils[_0xabfa('0x13')](util[_0xabfa('0x18')](_0xabfa('0x33'),_0x55fbd2[_0xabfa('0x1c')]),_0x2709a3);}});ami['on']('blindtransfer',function(_0xb64d5e){try{utils['debug'](util[_0xabfa('0x18')](_0xabfa('0x34'),_0xb64d5e[_0xabfa('0x1c')]),_0xb64d5e);queues[_0xabfa('0x35')](_0xb64d5e);agents[_0xabfa('0x35')](_0xb64d5e);transfers['blindtransfer'](_0xb64d5e);}catch(_0x3196e1){utils[_0xabfa('0x13')](util['format'](_0xabfa('0x34'),_0xb64d5e['uniqueid']),_0x3196e1);}});ami['on']('attendedtransfer',function(_0xbd622f){try{utils['debug'](util['format']('[%s][index][attendedtransfer]',_0xbd622f['origtransfereruniqueid']),_0xbd622f);queues[_0xabfa('0x36')](_0xbd622f);transfers['attendedtransfer'](_0xbd622f);agents['attendedtransfer'](_0xbd622f);calls[_0xabfa('0x36')](_0xbd622f);}catch(_0x420b2d){utils[_0xabfa('0x13')](util['format'](_0xabfa('0x37'),_0xbd622f[_0xabfa('0x38')]),_0x420b2d);}});ami['on'](_0xabfa('0x39'),function(_0x2286b8){try{utils[_0xabfa('0x17')](util[_0xabfa('0x18')](_0xabfa('0x3a'),_0x2286b8['uniqueid']),_0x2286b8);queues[_0xabfa('0x39')](_0x2286b8);recordings[_0xabfa('0x39')](_0x2286b8);calls[_0xabfa('0x39')](_0x2286b8);dials[_0xabfa('0x39')](_0x2286b8);}catch(_0x5b01a3){utils[_0xabfa('0x13')](util[_0xabfa('0x18')](_0xabfa('0x3a'),_0x2286b8[_0xabfa('0x1c')]),_0x5b01a3);}});ami['on']('newexten',function(_0x3685a8){try{utils['debug'](util[_0xabfa('0x18')](_0xabfa('0x3b'),_0x3685a8[_0xabfa('0x1c')]),_0x3685a8);calls[_0xabfa('0x3c')](_0x3685a8);recordings['newexten'](_0x3685a8);dials[_0xabfa('0x3c')](_0x3685a8);}catch(_0x18ef23){utils[_0xabfa('0x13')](util['format']('[%s][index][newexten]',_0x3685a8[_0xabfa('0x1c')]),_0x18ef23);}});ami['on'](_0xabfa('0x3d'),function(_0x504422){try{utils['debug'](util['format'](_0xabfa('0x3e'),_0x504422['uniqueid']),_0x504422);calls['newchannel'](_0x504422);recordings[_0xabfa('0x3d')](_0x504422);}catch(_0x4df070){utils[_0xabfa('0x13')](util[_0xabfa('0x18')]('[%s][index][newchannel]',_0x504422[_0xabfa('0x1c')]),_0x4df070);}});ami['on'](_0xabfa('0x3f'),function(_0x18e457){try{utils[_0xabfa('0x17')](util[_0xabfa('0x18')](_0xabfa('0x40'),_0x18e457['uniqueid']),_0x18e457);dials[_0xabfa('0x3f')](_0x18e457);}catch(_0x210aed){utils[_0xabfa('0x13')](util[_0xabfa('0x18')]('[%s]dialbegin',_0x18e457[_0xabfa('0x1c')]),_0x210aed);}});ami['on']('dialend',function(_0x48cff4){try{utils[_0xabfa('0x17')](util['format']('[%s][index][dialend]',_0x48cff4[_0xabfa('0x1c')]),_0x48cff4);dials[_0xabfa('0x41')](_0x48cff4);}catch(_0x1a22ec){utils['error'](util['format'](_0xabfa('0x42'),_0x48cff4[_0xabfa('0x1c')]),_0x1a22ec);}});} \ No newline at end of file +var _0x2f5a=['varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','port','username','password','keepConnected','xdr','disabled','XDR\x20DISABLED','./calls.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','format','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid'];(function(_0x57838d,_0x4f9daa){var _0x5931ff=function(_0x213a67){while(--_0x213a67){_0x57838d['push'](_0x57838d['shift']());}};_0x5931ff(++_0x4f9daa);}(_0x2f5a,0xcd));var _0xa2f5=function(_0x1cfc39,_0x1d3913){_0x1cfc39=_0x1cfc39-0x0;var _0x957a28=_0x2f5a[_0x1cfc39];return _0x957a28;};var AsteriskManager=require(_0xa2f5('0x0'));var config=require(_0xa2f5('0x1'));var utils=require(_0xa2f5('0x2'));var util=require(_0xa2f5('0x3'));var ami=new AsteriskManager(config[_0xa2f5('0x4')][_0xa2f5('0x5')],config[_0xa2f5('0x4')]['ip'],config[_0xa2f5('0x4')][_0xa2f5('0x6')],config[_0xa2f5('0x4')][_0xa2f5('0x7')],!![]);ami[_0xa2f5('0x8')]();if(config[_0xa2f5('0x9')]&&config[_0xa2f5('0x9')][_0xa2f5('0xa')]){utils['info'](_0xa2f5('0xb'));}else{var agents=require('./agents.controller');var calls=require(_0xa2f5('0xc'));var queues=require('./queues.controller');var recordings=require(_0xa2f5('0xd'));var members=require('./members.controller');var dials=require(_0xa2f5('0xe'));var transfers=require(_0xa2f5('0xf'));var core=require(_0xa2f5('0x10'));ami['on'](_0xa2f5('0x11'),core[_0xa2f5('0x11')]);ami['on'](_0xa2f5('0x12'),core[_0xa2f5('0x12')]);ami['on']('fullybooted',core[_0xa2f5('0x13')]);ami['on']('error',core[_0xa2f5('0x14')]);ami['on']('close',core[_0xa2f5('0x15')]);ami['on'](_0xa2f5('0x16'),core[_0xa2f5('0x16')]);ami['on'](_0xa2f5('0x17'),function(_0x3ec5fb){try{utils[_0xa2f5('0x18')](util['format'](_0xa2f5('0x19'),_0x3ec5fb['device']),_0x3ec5fb);members['devicestatechange'](_0x3ec5fb);}catch(_0x51ae50){utils[_0xa2f5('0x14')](util[_0xa2f5('0x1a')](_0xa2f5('0x19'),_0x3ec5fb[_0xa2f5('0x1b')]),_0x51ae50);}});ami['on'](_0xa2f5('0x1c'),function(_0x49996d){try{utils[_0xa2f5('0x18')](util[_0xa2f5('0x1a')](_0xa2f5('0x1d'),_0x49996d['uniqueid']),_0x49996d);agents[_0xa2f5('0x1c')](_0x49996d);}catch(_0x176354){utils[_0xa2f5('0x14')](util[_0xa2f5('0x1a')]('[%s][index][agentcalled]',_0x49996d[_0xa2f5('0x1e')]),_0x176354);}});ami['on'](_0xa2f5('0x1f'),function(_0x40dd58){try{utils['debug'](util[_0xa2f5('0x1a')]('[%s][index][agentringnoanswer]',_0x40dd58['uniqueid']),_0x40dd58);agents['agentringnoanswer'](_0x40dd58);}catch(_0x1e6ad5){utils[_0xa2f5('0x14')](util['format'](_0xa2f5('0x20'),_0x40dd58[_0xa2f5('0x1e')]),_0x1e6ad5);}});ami['on'](_0xa2f5('0x21'),function(_0x39bbf4){try{utils[_0xa2f5('0x18')](util['format']('[%s][index][agentconnect]',_0x39bbf4[_0xa2f5('0x1e')]),_0x39bbf4);agents['agentconnect'](_0x39bbf4);queues[_0xa2f5('0x21')](_0x39bbf4);}catch(_0x534992){utils[_0xa2f5('0x14')](util[_0xa2f5('0x1a')]('[%s][index][agentconnect]',_0x39bbf4['uniqueid']),_0x534992);}});ami['on'](_0xa2f5('0x22'),function(_0x2ebb5f){try{utils[_0xa2f5('0x18')](util[_0xa2f5('0x1a')](_0xa2f5('0x23'),_0x2ebb5f['uniqueid']),_0x2ebb5f);agents[_0xa2f5('0x22')](_0x2ebb5f);queues[_0xa2f5('0x22')](_0x2ebb5f);members[_0xa2f5('0x22')](_0x2ebb5f);}catch(_0x351ee4){utils[_0xa2f5('0x14')](util[_0xa2f5('0x1a')](_0xa2f5('0x23'),_0x2ebb5f[_0xa2f5('0x1e')]),_0x351ee4);}});ami['on'](_0xa2f5('0x24'),function(_0x355b12){try{utils[_0xa2f5('0x18')](util['format'](_0xa2f5('0x25'),_0x355b12[_0xa2f5('0x1e')]),_0x355b12);agents[_0xa2f5('0x24')](_0x355b12);queues['queuecallerabandon'](_0x355b12);}catch(_0x1dd89d){utils[_0xa2f5('0x14')](util['format']('[%s][index][queuecallerabandon]',_0x355b12['uniqueid']),_0x1dd89d);}});ami['on'](_0xa2f5('0x26'),function(_0x5d6bd1){try{utils[_0xa2f5('0x18')](util[_0xa2f5('0x1a')](_0xa2f5('0x27'),_0x5d6bd1[_0xa2f5('0x1e')]),_0x5d6bd1);queues[_0xa2f5('0x26')](_0x5d6bd1);recordings[_0xa2f5('0x26')](_0x5d6bd1);}catch(_0x22e797){utils[_0xa2f5('0x14')](util[_0xa2f5('0x1a')](_0xa2f5('0x27'),_0x5d6bd1['uniqueid']),_0x22e797);}});ami['on'](_0xa2f5('0x28'),function(_0x32fa3c){try{utils[_0xa2f5('0x18')](util['format']('[%s][index][queuecallerleave]',_0x32fa3c[_0xa2f5('0x1e')]),_0x32fa3c);queues[_0xa2f5('0x28')](_0x32fa3c);}catch(_0x4ec4a9){utils[_0xa2f5('0x14')](util[_0xa2f5('0x1a')]('[%s][index][queuecallerleave]',_0x32fa3c[_0xa2f5('0x1e')]),_0x4ec4a9);}});ami['on'](_0xa2f5('0x29'),function(_0x43f51f){try{utils[_0xa2f5('0x18')](util[_0xa2f5('0x1a')]('[%s][index][musiconholdstart]',_0x43f51f[_0xa2f5('0x1e')]),_0x43f51f);queues[_0xa2f5('0x29')](_0x43f51f);calls[_0xa2f5('0x29')](_0x43f51f);}catch(_0x2c568e){utils[_0xa2f5('0x14')](util[_0xa2f5('0x1a')]('[%s][index][musiconholdstart]',_0x43f51f[_0xa2f5('0x1e')]),_0x2c568e);}});ami['on'](_0xa2f5('0x2a'),function(_0x496a3e){try{utils[_0xa2f5('0x18')](util['format'](_0xa2f5('0x2b'),_0x496a3e[_0xa2f5('0x1e')]),_0x496a3e);queues[_0xa2f5('0x2a')](_0x496a3e);calls[_0xa2f5('0x2a')](_0x496a3e);}catch(_0x320b1b){utils['error'](util[_0xa2f5('0x1a')](_0xa2f5('0x2b'),_0x496a3e[_0xa2f5('0x1e')]),_0x320b1b);}});ami['on'](_0xa2f5('0x2c'),function(_0x2372e1){try{utils[_0xa2f5('0x18')](util[_0xa2f5('0x1a')](_0xa2f5('0x2d'),_0x2372e1[_0xa2f5('0x1e')]),_0x2372e1);calls[_0xa2f5('0x2c')](_0x2372e1);recordings['newstate'](_0x2372e1);}catch(_0x3c6bfc){utils[_0xa2f5('0x14')](util['format'](_0xa2f5('0x2d'),_0x2372e1[_0xa2f5('0x1e')]),_0x3c6bfc);}});ami['on'](_0xa2f5('0x2e'),function(_0x59e120){try{utils[_0xa2f5('0x18')](util[_0xa2f5('0x1a')](_0xa2f5('0x2f'),_0x59e120[_0xa2f5('0x1e')]),_0x59e120);calls['hangup'](_0x59e120);recordings[_0xa2f5('0x2e')](_0x59e120);dials['hangup'](_0x59e120);agents[_0xa2f5('0x2e')](_0x59e120);queues[_0xa2f5('0x2e')](_0x59e120);}catch(_0x494e81){utils[_0xa2f5('0x14')](util[_0xa2f5('0x1a')](_0xa2f5('0x2f'),_0x59e120[_0xa2f5('0x1e')]),_0x494e81);}});ami['on'](_0xa2f5('0x30'),function(_0x334bd7){try{utils['debug'](util[_0xa2f5('0x1a')](_0xa2f5('0x31'),_0x334bd7[_0xa2f5('0x1e')]),_0x334bd7);members[_0xa2f5('0x30')](_0x334bd7);}catch(_0xcf4010){utils['error'](util['format'](_0xa2f5('0x31'),_0x334bd7[_0xa2f5('0x1e')]),_0xcf4010);}});ami['on'](_0xa2f5('0x32'),function(_0x187d26){try{utils[_0xa2f5('0x18')](util[_0xa2f5('0x1a')]('[%s][index][blindtransfer]',_0x187d26[_0xa2f5('0x1e')]),_0x187d26);queues[_0xa2f5('0x32')](_0x187d26);agents[_0xa2f5('0x32')](_0x187d26);transfers[_0xa2f5('0x32')](_0x187d26);}catch(_0x506a5e){utils['error'](util[_0xa2f5('0x1a')](_0xa2f5('0x33'),_0x187d26[_0xa2f5('0x1e')]),_0x506a5e);}});ami['on']('attendedtransfer',function(_0x3798c9){try{utils[_0xa2f5('0x18')](util['format']('[%s][index][attendedtransfer]',_0x3798c9['origtransfereruniqueid']),_0x3798c9);queues[_0xa2f5('0x34')](_0x3798c9);transfers[_0xa2f5('0x34')](_0x3798c9);agents[_0xa2f5('0x34')](_0x3798c9);calls[_0xa2f5('0x34')](_0x3798c9);}catch(_0x59a862){utils[_0xa2f5('0x14')](util[_0xa2f5('0x1a')](_0xa2f5('0x35'),_0x3798c9[_0xa2f5('0x36')]),_0x59a862);}});ami['on'](_0xa2f5('0x37'),function(_0x34507d){try{utils[_0xa2f5('0x18')](util['format'](_0xa2f5('0x38'),_0x34507d[_0xa2f5('0x1e')]),_0x34507d);queues['varset'](_0x34507d);recordings[_0xa2f5('0x37')](_0x34507d);calls[_0xa2f5('0x37')](_0x34507d);dials['varset'](_0x34507d);}catch(_0x574148){utils[_0xa2f5('0x14')](util[_0xa2f5('0x1a')](_0xa2f5('0x38'),_0x34507d['uniqueid']),_0x574148);}});ami['on'](_0xa2f5('0x39'),function(_0x4dc4c1){try{utils[_0xa2f5('0x18')](util['format']('[%s][index][newexten]',_0x4dc4c1[_0xa2f5('0x1e')]),_0x4dc4c1);calls[_0xa2f5('0x39')](_0x4dc4c1);recordings[_0xa2f5('0x39')](_0x4dc4c1);dials['newexten'](_0x4dc4c1);}catch(_0x170037){utils[_0xa2f5('0x14')](util['format'](_0xa2f5('0x3a'),_0x4dc4c1[_0xa2f5('0x1e')]),_0x170037);}});ami['on'](_0xa2f5('0x3b'),function(_0x2f94e3){try{utils[_0xa2f5('0x18')](util['format'](_0xa2f5('0x3c'),_0x2f94e3[_0xa2f5('0x1e')]),_0x2f94e3);calls[_0xa2f5('0x3b')](_0x2f94e3);recordings['newchannel'](_0x2f94e3);}catch(_0x1585f0){utils[_0xa2f5('0x14')](util[_0xa2f5('0x1a')]('[%s][index][newchannel]',_0x2f94e3[_0xa2f5('0x1e')]),_0x1585f0);}});ami['on'](_0xa2f5('0x3d'),function(_0x51454b){try{utils['debug'](util[_0xa2f5('0x1a')](_0xa2f5('0x3e'),_0x51454b[_0xa2f5('0x1e')]),_0x51454b);dials[_0xa2f5('0x3d')](_0x51454b);}catch(_0x47c40){utils[_0xa2f5('0x14')](util[_0xa2f5('0x1a')]('[%s]dialbegin',_0x51454b[_0xa2f5('0x1e')]),_0x47c40);}});ami['on'](_0xa2f5('0x3f'),function(_0x3db606){try{utils['debug'](util['format'](_0xa2f5('0x40'),_0x3db606[_0xa2f5('0x1e')]),_0x3db606);dials[_0xa2f5('0x3f')](_0x3db606);}catch(_0x4929c6){utils[_0xa2f5('0x14')](util[_0xa2f5('0x1a')](_0xa2f5('0x40'),_0x3db606[_0xa2f5('0x1e')]),_0x4929c6);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 69dd34c..a7aea0b 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 _0x6737=['then','name','internal','request','CreateMemberReport','split','catch','error','[%s][members][writeDB]','some','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','now','agent','isNil','exitAt','diffTime','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','cdr','channel','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data1','type','[%s][members][cdr]','util','./utils','Queue:','info','format','uniqueid','interface','data2','membername'];(function(_0x4aac11,_0x3bbb63){var _0x4939bd=function(_0x19ef1e){while(--_0x19ef1e){_0x4aac11['push'](_0x4aac11['shift']());}};_0x4939bd(++_0x3bbb63);}(_0x6737,0xe2));var _0x7673=function(_0x4a72f1,_0x28048d){_0x4a72f1=_0x4a72f1-0x0;var _0x1c2151=_0x6737[_0x4a72f1];return _0x1c2151;};'use strict';var _=require('lodash');var util=require(_0x7673('0x0'));var utils=require(_0x7673('0x1'));var members={};var exclude=['Local/_attended@transfer',_0x7673('0x2')];function writeDB(_0x2a9cd0){utils[_0x7673('0x3')](util[_0x7673('0x4')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x2a9cd0[_0x7673('0x5')],_0x2a9cd0[_0x7673('0x6')],_0x2a9cd0['channel'],_0x2a9cd0[_0x7673('0x7')],_0x2a9cd0[_0x7673('0x8')],_0x2a9cd0['type']));if(_0x2a9cd0['interface']){utils['getUserByInterface'](_0x2a9cd0['interface'])[_0x7673('0x9')](function(_0x5bede8){if(_0x5bede8){_0x2a9cd0[_0x7673('0x8')]=_0x5bede8[_0x7673('0xa')];_0x2a9cd0['internal']=_0x5bede8[_0x7673('0xb')];utils[_0x7673('0xc')](_0x7673('0xd'),_0x2a9cd0);}else{utils['getUserByName'](_0x2a9cd0['interface'][_0x7673('0xe')]('/')[0x1])['then'](function(_0x16b8c6){if(_0x16b8c6){_0x2a9cd0[_0x7673('0x8')]=_0x16b8c6[_0x7673('0xa')];_0x2a9cd0[_0x7673('0xb')]=_0x16b8c6[_0x7673('0xb')];utils[_0x7673('0xc')](_0x7673('0xd'),_0x2a9cd0);}});}})[_0x7673('0xf')](function(_0x1da115){utils[_0x7673('0x10')](util['format'](_0x7673('0x11'),_0x2a9cd0[_0x7673('0x5')]),_0x1da115);});}delete members[_0x2a9cd0[_0x7673('0x6')]];}function startsWith(_0x2c83d,_0x224cea){return _[_0x7673('0x12')](_0x2c83d,function(_0x2a2840){return _['startsWith'](_0x224cea,_0x2a2840);});}exports['devicestatechange']=function(_0x164d05){try{utils[_0x7673('0x13')](util['format'](_0x7673('0x14'),members[_0x164d05[_0x7673('0x15')]]?members[_0x164d05['device']][_0x7673('0x5')]:_0x164d05[_0x7673('0x15')]),_0x164d05);utils[_0x7673('0x3')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x164d05[_0x7673('0x15')]]?members[_0x164d05[_0x7673('0x15')]]['uniqueid']:_0x164d05[_0x7673('0x15')],_0x164d05[_0x7673('0x16')],_0x164d05[_0x7673('0x15')]));switch(_0x164d05[_0x7673('0x16')]){case _0x7673('0x17'):case _0x7673('0x18'):if(!startsWith(exclude,_0x164d05['device'])){members[_0x164d05['device']]={'channel':_0x7673('0x19'),'interface':_0x164d05[_0x7673('0x15')],'type':_0x7673('0x1a'),'enterAt':utils[_0x7673('0x1b')](),'role':_0x7673('0x1c')};}break;case'NOT_INUSE':if(!_[_0x7673('0x1d')](members[_0x164d05[_0x7673('0x15')]])){members[_0x164d05[_0x7673('0x15')]][_0x7673('0x1e')]=utils[_0x7673('0x1b')]();members[_0x164d05[_0x7673('0x15')]]['duration']=utils[_0x7673('0x1f')](members[_0x164d05[_0x7673('0x15')]][_0x7673('0x1e')],members[_0x164d05[_0x7673('0x15')]]['enterAt']);if(members[_0x164d05['device']][_0x7673('0x5')]){writeDB(members[_0x164d05[_0x7673('0x15')]]);}}break;default:break;}}catch(_0x291d10){utils[_0x7673('0x10')](util[_0x7673('0x4')](_0x7673('0x14'),members[_0x164d05[_0x7673('0x15')]]?members[_0x164d05['device']]['uniqueid']:_0x164d05[_0x7673('0x15')]),_0x291d10);}};exports[_0x7673('0x20')]=function(_0x1dd436){try{if(!_[_0x7673('0x1d')](members[_0x1dd436[_0x7673('0x6')]])){utils[_0x7673('0x13')](util[_0x7673('0x4')]('[%s][members][agentcomplete]',_0x1dd436['uniqueid']),_0x1dd436);utils[_0x7673('0x3')](util[_0x7673('0x4')](_0x7673('0x21'),_0x1dd436[_0x7673('0x5')],_0x1dd436['interface'],_0x1dd436[_0x7673('0x22')]));members[_0x1dd436['interface']]=_[_0x7673('0x23')](members[_0x1dd436[_0x7673('0x6')]],{'data4':_0x1dd436[_0x7673('0x22')],'uniqueid':_0x1dd436[_0x7673('0x5')]});}}catch(_0x2be805){utils[_0x7673('0x10')](util[_0x7673('0x4')](_0x7673('0x24'),_0x1dd436[_0x7673('0x5')]),_0x2be805);}};exports[_0x7673('0x25')]=function(_0x16681f){try{utils[_0x7673('0x13')](util[_0x7673('0x4')]('[%s][members][cdr]',_0x16681f[_0x7673('0x5')]),_0x16681f);if(_0x16681f[_0x7673('0x26')]){var _0x417c83=_0x16681f[_0x7673('0x26')][_0x7673('0xe')]('-')[0x0];if(!_[_0x7673('0x1d')](members[_0x417c83])){members[_0x417c83]=_[_0x7673('0x23')](members[_0x417c83],{'data1':members[_0x417c83]['data1']||_0x16681f['type'],'data2':members[_0x417c83][_0x7673('0x7')]||_0x16681f[_0x7673('0x27')],'data3':members[_0x417c83][_0x7673('0x28')]||_0x16681f[_0x7673('0x29')],'uniqueid':members[_0x417c83][_0x7673('0x5')]||_0x16681f[_0x7673('0x5')]});utils[_0x7673('0x3')](util['format'](_0x7673('0x2a'),_0x16681f[_0x7673('0x5')],members[_0x417c83]['data1'],members[_0x417c83][_0x7673('0x7')],members[_0x417c83][_0x7673('0x28')]));if(members[_0x417c83][_0x7673('0x1e')]){writeDB(members[_0x417c83]);}}}if(_0x16681f[_0x7673('0x2b')]){var _0x4ee839=_0x16681f[_0x7673('0x2b')][_0x7673('0xe')]('-')[0x0];if(!_['isNil'](members[_0x4ee839])){members[_0x4ee839]=_[_0x7673('0x23')](members[_0x4ee839],{'data1':members[_0x4ee839][_0x7673('0x2c')]||_0x16681f[_0x7673('0x2d')],'data2':members[_0x4ee839]['data2']||_0x16681f[_0x7673('0x27')],'data3':members[_0x4ee839][_0x7673('0x28')]||_0x16681f[_0x7673('0x29')],'uniqueid':members[_0x4ee839]['uniqueid']||_0x16681f['uniqueid']});utils[_0x7673('0x3')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x16681f[_0x7673('0x5')],members[_0x4ee839][_0x7673('0x2c')],members[_0x4ee839]['data2'],members[_0x4ee839][_0x7673('0x28')]));if(members[_0x4ee839][_0x7673('0x1e')]){writeDB(members[_0x4ee839]);}}}}catch(_0x2645a2){utils[_0x7673('0x10')](util[_0x7673('0x4')](_0x7673('0x2e'),_0x16681f['uniqueid']),_0x2645a2);}}; \ No newline at end of file +var _0xbfe0=['type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','[%s][members][cdr]','lodash','./utils','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','getUserByInterface','then','internal','request','CreateMemberReport','getUserByName','interface','split','membername','name','error','some','startsWith','debug','[%s][members][devicestatechange]','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','device','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','diffTime','enterAt','agentcomplete','assign','queue','[%s][members][agentcomplete]','cdr','data1'];(function(_0x1558ca,_0x421787){var _0x5156ea=function(_0x2f4779){while(--_0x2f4779){_0x1558ca['push'](_0x1558ca['shift']());}};_0x5156ea(++_0x421787);}(_0xbfe0,0x6d));var _0x0bfe=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xbfe0[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0x0bfe('0x0'));var util=require('util');var utils=require(_0x0bfe('0x1'));var members={};var exclude=[_0x0bfe('0x2'),'Queue:'];function writeDB(_0xbd4e1d){utils[_0x0bfe('0x3')](util[_0x0bfe('0x4')](_0x0bfe('0x5'),_0xbd4e1d[_0x0bfe('0x6')],_0xbd4e1d['interface'],_0xbd4e1d[_0x0bfe('0x7')],_0xbd4e1d[_0x0bfe('0x8')],_0xbd4e1d['membername'],_0xbd4e1d['type']));if(_0xbd4e1d['interface']){utils[_0x0bfe('0x9')](_0xbd4e1d['interface'])[_0x0bfe('0xa')](function(_0x3761ff){if(_0x3761ff){_0xbd4e1d['membername']=_0x3761ff['name'];_0xbd4e1d[_0x0bfe('0xb')]=_0x3761ff['internal'];utils[_0x0bfe('0xc')](_0x0bfe('0xd'),_0xbd4e1d);}else{utils[_0x0bfe('0xe')](_0xbd4e1d[_0x0bfe('0xf')][_0x0bfe('0x10')]('/')[0x1])['then'](function(_0x3abde6){if(_0x3abde6){_0xbd4e1d[_0x0bfe('0x11')]=_0x3abde6[_0x0bfe('0x12')];_0xbd4e1d[_0x0bfe('0xb')]=_0x3abde6['internal'];utils['request']('CreateMemberReport',_0xbd4e1d);}});}})['catch'](function(_0x21ba7b){utils[_0x0bfe('0x13')](util[_0x0bfe('0x4')]('[%s][members][writeDB]',_0xbd4e1d[_0x0bfe('0x6')]),_0x21ba7b);});}delete members[_0xbd4e1d[_0x0bfe('0xf')]];}function startsWith(_0x4b9355,_0x4bcb7c){return _[_0x0bfe('0x14')](_0x4b9355,function(_0x39747c){return _[_0x0bfe('0x15')](_0x4bcb7c,_0x39747c);});}exports['devicestatechange']=function(_0x540d19){try{utils[_0x0bfe('0x16')](util[_0x0bfe('0x4')](_0x0bfe('0x17'),members[_0x540d19['device']]?members[_0x540d19['device']][_0x0bfe('0x6')]:_0x540d19['device']),_0x540d19);utils[_0x0bfe('0x3')](util[_0x0bfe('0x4')](_0x0bfe('0x18'),members[_0x540d19[_0x0bfe('0x19')]]?members[_0x540d19[_0x0bfe('0x19')]]['uniqueid']:_0x540d19[_0x0bfe('0x19')],_0x540d19['state'],_0x540d19[_0x0bfe('0x19')]));switch(_0x540d19[_0x0bfe('0x1a')]){case _0x0bfe('0x1b'):case _0x0bfe('0x1c'):if(!startsWith(exclude,_0x540d19[_0x0bfe('0x19')])){members[_0x540d19[_0x0bfe('0x19')]]={'channel':_0x0bfe('0x1d'),'interface':_0x540d19[_0x0bfe('0x19')],'type':_0x0bfe('0x1e'),'enterAt':utils[_0x0bfe('0x1f')](),'role':_0x0bfe('0x20')};}break;case _0x0bfe('0x21'):if(!_[_0x0bfe('0x22')](members[_0x540d19[_0x0bfe('0x19')]])){members[_0x540d19['device']][_0x0bfe('0x23')]=utils[_0x0bfe('0x1f')]();members[_0x540d19[_0x0bfe('0x19')]]['duration']=utils[_0x0bfe('0x24')](members[_0x540d19['device']]['exitAt'],members[_0x540d19[_0x0bfe('0x19')]][_0x0bfe('0x25')]);if(members[_0x540d19[_0x0bfe('0x19')]]['uniqueid']){writeDB(members[_0x540d19['device']]);}}break;default:break;}}catch(_0x47a610){utils[_0x0bfe('0x13')](util[_0x0bfe('0x4')](_0x0bfe('0x17'),members[_0x540d19[_0x0bfe('0x19')]]?members[_0x540d19[_0x0bfe('0x19')]][_0x0bfe('0x6')]:_0x540d19[_0x0bfe('0x19')]),_0x47a610);}};exports[_0x0bfe('0x26')]=function(_0x1d260d){try{if(!_[_0x0bfe('0x22')](members[_0x1d260d[_0x0bfe('0xf')]])){utils[_0x0bfe('0x16')](util['format']('[%s][members][agentcomplete]',_0x1d260d[_0x0bfe('0x6')]),_0x1d260d);utils['info'](util[_0x0bfe('0x4')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x1d260d[_0x0bfe('0x6')],_0x1d260d[_0x0bfe('0xf')],_0x1d260d['queue']));members[_0x1d260d[_0x0bfe('0xf')]]=_[_0x0bfe('0x27')](members[_0x1d260d['interface']],{'data4':_0x1d260d[_0x0bfe('0x28')],'uniqueid':_0x1d260d[_0x0bfe('0x6')]});}}catch(_0x318db5){utils['error'](util[_0x0bfe('0x4')](_0x0bfe('0x29'),_0x1d260d[_0x0bfe('0x6')]),_0x318db5);}};exports[_0x0bfe('0x2a')]=function(_0xb0c4cf){try{utils[_0x0bfe('0x16')](util[_0x0bfe('0x4')]('[%s][members][cdr]',_0xb0c4cf[_0x0bfe('0x6')]),_0xb0c4cf);if(_0xb0c4cf[_0x0bfe('0x7')]){var _0x1ac3c1=_0xb0c4cf['channel'][_0x0bfe('0x10')]('-')[0x0];if(!_[_0x0bfe('0x22')](members[_0x1ac3c1])){members[_0x1ac3c1]=_['assign'](members[_0x1ac3c1],{'data1':members[_0x1ac3c1][_0x0bfe('0x2b')]||_0xb0c4cf[_0x0bfe('0x2c')],'data2':members[_0x1ac3c1][_0x0bfe('0x8')]||_0xb0c4cf[_0x0bfe('0x2d')],'data3':members[_0x1ac3c1][_0x0bfe('0x2e')]||_0xb0c4cf[_0x0bfe('0x2f')],'uniqueid':members[_0x1ac3c1][_0x0bfe('0x6')]||_0xb0c4cf[_0x0bfe('0x6')]});utils[_0x0bfe('0x3')](util[_0x0bfe('0x4')](_0x0bfe('0x30'),_0xb0c4cf[_0x0bfe('0x6')],members[_0x1ac3c1][_0x0bfe('0x2b')],members[_0x1ac3c1]['data2'],members[_0x1ac3c1]['data3']));if(members[_0x1ac3c1]['exitAt']){writeDB(members[_0x1ac3c1]);}}}if(_0xb0c4cf[_0x0bfe('0x31')]){var _0x5e4ba2=_0xb0c4cf[_0x0bfe('0x31')][_0x0bfe('0x10')]('-')[0x0];if(!_['isNil'](members[_0x5e4ba2])){members[_0x5e4ba2]=_[_0x0bfe('0x27')](members[_0x5e4ba2],{'data1':members[_0x5e4ba2][_0x0bfe('0x2b')]||_0xb0c4cf[_0x0bfe('0x2c')],'data2':members[_0x5e4ba2]['data2']||_0xb0c4cf['source'],'data3':members[_0x5e4ba2][_0x0bfe('0x2e')]||_0xb0c4cf[_0x0bfe('0x2f')],'uniqueid':members[_0x5e4ba2]['uniqueid']||_0xb0c4cf[_0x0bfe('0x6')]});utils[_0x0bfe('0x3')](util['format'](_0x0bfe('0x30'),_0xb0c4cf[_0x0bfe('0x6')],members[_0x5e4ba2][_0x0bfe('0x2b')],members[_0x5e4ba2]['data2'],members[_0x5e4ba2][_0x0bfe('0x2e')]));if(members[_0x5e4ba2][_0x0bfe('0x23')]){writeDB(members[_0x5e4ba2]);}}}}catch(_0x427dd7){utils[_0x0bfe('0x13')](util[_0x0bfe('0x4')](_0x0bfe('0x32'),_0xb0c4cf['uniqueid']),_0x427dd7);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 7dc1c1b..6d2a64c 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 _0xa0be=['ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transferuniqueid','transfertargetlinkedid','holdtime','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','error','isNil','debug','[%s][queues][hangup]','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','toUpperCase','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','diffTime','queuecallerleaveAt','queuecallerjoinAt','position','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','accountcode','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0xa0be,0x152));var _0xea0b=function(_0x1dd58d,_0xc571e7){_0x1dd58d=_0x1dd58d-0x0;var _0x3ff5f7=_0xa0be[_0x1dd58d];return _0x3ff5f7;};'use strict';var _=require(_0xea0b('0x0'));var util=require(_0xea0b('0x1'));var utils=require(_0xea0b('0x2'));var queues={};function writeDB(_0x1ead38){utils['info'](util[_0xea0b('0x3')](_0xea0b('0x4'),_0x1ead38[_0xea0b('0x5')],_0x1ead38[_0xea0b('0x6')],_0x1ead38[_0xea0b('0x7')],_0x1ead38[_0xea0b('0x8')],_0x1ead38[_0xea0b('0x9')],_0x1ead38['accountcode'],_0x1ead38[_0xea0b('0xa')]));if(_0x1ead38[_0xea0b('0x7')]){utils[_0xea0b('0xb')](_0x1ead38[_0xea0b('0x7')])[_0xea0b('0xc')](function(_0x3742c6){if(_0x3742c6){_0x1ead38[_0xea0b('0xd')]=_0x3742c6[_0xea0b('0xd')];}utils[_0xea0b('0xe')](_0xea0b('0xf'),_0x1ead38);});}else{utils[_0xea0b('0xe')](_0xea0b('0xf'),_0x1ead38);}if(_0x1ead38[_0xea0b('0x10')]){delete queues[_0x1ead38[_0xea0b('0x10')]];}else{delete queues[_0x1ead38['uniqueid']];}}exports[_0xea0b('0x11')]=function(_0x57101f){try{utils['debug'](util['format'](_0xea0b('0x12'),_0x57101f[_0xea0b('0x5')]),_0x57101f);utils[_0xea0b('0x13')](util[_0xea0b('0x3')](_0xea0b('0x14'),_0x57101f[_0xea0b('0x5')],_0x57101f[_0xea0b('0x7')],_0x57101f['position']));queues[_0x57101f['uniqueid']]=_[_0xea0b('0x15')](_0x57101f,{'originalposition':_0x57101f['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x1ea620){utils[_0xea0b('0x16')](util[_0xea0b('0x3')](_0xea0b('0x12'),_0x57101f[_0xea0b('0x5')]),_0x1ea620);}};exports['hangup']=function(_0x4426d7){try{if(!_[_0xea0b('0x17')](queues[_0x4426d7[_0xea0b('0x5')]])){utils[_0xea0b('0x18')](util[_0xea0b('0x3')](_0xea0b('0x19'),_0x4426d7[_0xea0b('0x5')]),_0x4426d7);if(queues[_0x4426d7[_0xea0b('0x5')]]['queuecallerleaveAt']){if(!queues[_0x4426d7[_0xea0b('0x5')]][_0xea0b('0x1a')]&&!queues[_0x4426d7[_0xea0b('0x5')]]['queuecallerexit']){queues[_0x4426d7[_0xea0b('0x5')]][_0xea0b('0x1b')]=!![];queues[_0x4426d7[_0xea0b('0x5')]][_0xea0b('0x1c')]=utils[_0xea0b('0x1d')]();queues[_0x4426d7[_0xea0b('0x5')]][_0xea0b('0xa')]=_0xea0b('0x1e');}utils[_0xea0b('0x13')](util[_0xea0b('0x3')](_0xea0b('0x1f'),_0x4426d7[_0xea0b('0x5')],queues[_0x4426d7[_0xea0b('0x5')]]['name'],queues[_0x4426d7['uniqueid']][_0xea0b('0xa')]));writeDB(queues[_0x4426d7[_0xea0b('0x5')]]);}else if(queues[_0x4426d7[_0xea0b('0x5')]][_0xea0b('0x10')]){utils[_0xea0b('0x13')](util[_0xea0b('0x3')](_0xea0b('0x20'),_0x4426d7[_0xea0b('0x5')],queues[_0x4426d7[_0xea0b('0x5')]][_0xea0b('0x21')],queues[_0x4426d7[_0xea0b('0x5')]][_0xea0b('0x10')]));queues[queues[_0x4426d7[_0xea0b('0x5')]][_0xea0b('0x10')]]=queues[_0x4426d7[_0xea0b('0x5')]];queues[queues[_0x4426d7[_0xea0b('0x5')]][_0xea0b('0x10')]][_0xea0b('0x22')]=0x2;delete queues[_0x4426d7[_0xea0b('0x5')]];}}}catch(_0x1547eb){utils['error'](util[_0xea0b('0x3')]('[%s][queues][hangup]',_0x4426d7['uniqueid']),_0x1547eb);}};exports[_0xea0b('0x23')]=function(_0xdf0422){try{utils[_0xea0b('0x18')](util[_0xea0b('0x3')](_0xea0b('0x24'),_0xdf0422['uniqueid']),_0xdf0422);if(!_[_0xea0b('0x17')](_0xdf0422[_0xea0b('0x25')][_0xea0b('0x26')])&&_0xdf0422[_0xea0b('0x27')]['toUpperCase']()!=='CONTINUE'){if(!_[_0xea0b('0x17')](queues[_0xdf0422['uniqueid']])){queues[_0xdf0422[_0xea0b('0x5')]][_0xea0b('0x1a')]=![];queues[_0xdf0422[_0xea0b('0x5')]][_0xea0b('0x28')]=null;queues[_0xdf0422[_0xea0b('0x5')]][_0xea0b('0x29')]=!![];queues[_0xdf0422[_0xea0b('0x5')]][_0xea0b('0x2a')]=utils['now']();queues[_0xdf0422[_0xea0b('0x5')]][_0xea0b('0xa')]=_0xdf0422[_0xea0b('0x27')][_0xea0b('0x2b')]();utils[_0xea0b('0x13')](util[_0xea0b('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0xdf0422[_0xea0b('0x5')],queues[_0xdf0422['uniqueid']]['name'],_0xdf0422[_0xea0b('0x27')],queues[_0xdf0422['uniqueid']][_0xea0b('0xa')]));writeDB(queues[_0xdf0422[_0xea0b('0x5')]]);}}else if(!_[_0xea0b('0x17')](_0xdf0422[_0xea0b('0x25')][_0xea0b('0x2c')])){if(!_[_0xea0b('0x17')](queues[_0xdf0422[_0xea0b('0x5')]])&&!queues[_0xdf0422[_0xea0b('0x5')]][_0xea0b('0x1a')]){queues[_0xdf0422[_0xea0b('0x5')]][_0xea0b('0x1a')]=![];queues[_0xdf0422[_0xea0b('0x5')]][_0xea0b('0x28')]=null;queues[_0xdf0422[_0xea0b('0x5')]][_0xea0b('0x29')]=!![];queues[_0xdf0422[_0xea0b('0x5')]][_0xea0b('0x2a')]=utils['now']();queues[_0xdf0422[_0xea0b('0x5')]][_0xea0b('0xa')]='EXITWITHKEY';utils[_0xea0b('0x13')](util[_0xea0b('0x3')](_0xea0b('0x2d'),_0xdf0422['uniqueid'],queues[_0xdf0422[_0xea0b('0x5')]][_0xea0b('0x21')],_0xdf0422[_0xea0b('0x27')],queues[_0xdf0422[_0xea0b('0x5')]][_0xea0b('0xa')]));}}}catch(_0xb3f11f){utils['error'](util[_0xea0b('0x3')](_0xea0b('0x24'),_0xdf0422['uniqueid']),_0xb3f11f);}};exports[_0xea0b('0x1a')]=function(_0x55603e){try{if(!_[_0xea0b('0x17')](queues[_0x55603e['uniqueid']])){utils[_0xea0b('0x18')](util[_0xea0b('0x3')](_0xea0b('0x2e'),_0x55603e[_0xea0b('0x5')]),_0x55603e);queues[_0x55603e[_0xea0b('0x5')]][_0xea0b('0x29')]=![];queues[_0x55603e['uniqueid']]['queuecallerexitAt']=null;queues[_0x55603e[_0xea0b('0x5')]][_0xea0b('0x1a')]=!![];queues[_0x55603e[_0xea0b('0x5')]][_0xea0b('0x28')]=utils[_0xea0b('0x1d')]();queues[_0x55603e[_0xea0b('0x5')]]['queuecallerexitreason']=_0xea0b('0x2f');utils[_0xea0b('0x13')](util[_0xea0b('0x3')](_0xea0b('0x30'),_0x55603e[_0xea0b('0x5')],queues[_0x55603e[_0xea0b('0x5')]][_0xea0b('0x21')],queues[_0x55603e[_0xea0b('0x5')]]['queuecallerexitreason']));}}catch(_0x3fc992){utils[_0xea0b('0x16')](util[_0xea0b('0x3')](_0xea0b('0x2e'),_0x55603e[_0xea0b('0x5')]),_0x3fc992);}};exports[_0xea0b('0x31')]=function(_0x4d308d){try{if(!_[_0xea0b('0x17')](queues[_0x4d308d['uniqueid']])){utils[_0xea0b('0x18')](util[_0xea0b('0x3')](_0xea0b('0x32'),_0x4d308d['uniqueid']),_0x4d308d);utils[_0xea0b('0x13')](util[_0xea0b('0x3')](_0xea0b('0x33'),_0x4d308d['uniqueid'],queues[_0x4d308d[_0xea0b('0x5')]][_0xea0b('0x21')],_0x4d308d[_0xea0b('0x34')],_0x4d308d['connectedlinename']));queues[_0x4d308d[_0xea0b('0x5')]][_0xea0b('0x31')]=!![];queues[_0x4d308d['uniqueid']]['queuecallerleaveAt']=utils[_0xea0b('0x1d')]();queues[_0x4d308d[_0xea0b('0x5')]]['holdtime']=utils[_0xea0b('0x35')](queues[_0x4d308d[_0xea0b('0x5')]][_0xea0b('0x36')],queues[_0x4d308d['uniqueid']][_0xea0b('0x37')]);queues[_0x4d308d[_0xea0b('0x5')]]['position']=_0x4d308d[_0xea0b('0x38')];queues[_0x4d308d[_0xea0b('0x5')]]['count']=_0x4d308d[_0xea0b('0x39')];queues[_0x4d308d[_0xea0b('0x5')]][_0xea0b('0x34')]=_0x4d308d[_0xea0b('0x34')];queues[_0x4d308d['uniqueid']]['connectedlinename']=_0x4d308d['connectedlinename'];}}catch(_0x4f6104){utils[_0xea0b('0x16')](util[_0xea0b('0x3')](_0xea0b('0x32'),_0x4d308d[_0xea0b('0x5')]),_0x4f6104);}};exports[_0xea0b('0x3a')]=function(_0x6bd245){try{if(!_['isNil'](queues[_0x6bd245['uniqueid']])){utils[_0xea0b('0x18')](util[_0xea0b('0x3')](_0xea0b('0x3b'),_0x6bd245['uniqueid']),_0x6bd245);utils[_0xea0b('0x13')](util[_0xea0b('0x3')](_0xea0b('0x3c'),_0x6bd245[_0xea0b('0x5')],queues[_0x6bd245[_0xea0b('0x5')]][_0xea0b('0x21')],_0x6bd245[_0xea0b('0x3d')],_0x6bd245['destaccountcode']));queues[_0x6bd245['uniqueid']]['queuecallerabandon']=![];queues[_0x6bd245[_0xea0b('0x5')]][_0xea0b('0x1a')]=![];queues[_0x6bd245['uniqueid']][_0xea0b('0x28')]=null;queues[_0x6bd245[_0xea0b('0x5')]][_0xea0b('0x29')]=![];queues[_0x6bd245[_0xea0b('0x5')]][_0xea0b('0xa')]=null;queues[_0x6bd245[_0xea0b('0x5')]][_0xea0b('0x2a')]=null;queues[_0x6bd245[_0xea0b('0x5')]][_0xea0b('0x3e')]=!![];queues[_0x6bd245[_0xea0b('0x5')]][_0xea0b('0x3f')]=_0x6bd245[_0xea0b('0x40')];queues[_0x6bd245[_0xea0b('0x5')]][_0xea0b('0x8')]=_0x6bd245[_0xea0b('0x3d')];}}catch(_0x2ebfcc){utils[_0xea0b('0x16')](util[_0xea0b('0x3')](_0xea0b('0x3b'),_0x6bd245[_0xea0b('0x5')]),_0x2ebfcc);}};exports[_0xea0b('0x41')]=function(_0x52660d){try{if(!_[_0xea0b('0x17')](queues[_0x52660d['uniqueid']])){if(queues[_0x52660d['uniqueid']][_0xea0b('0x36')]){utils['debug'](util[_0xea0b('0x3')](_0xea0b('0x42'),_0x52660d[_0xea0b('0x5')]),_0x52660d);queues[_0x52660d[_0xea0b('0x5')]]['queuecallerabandon']=![];queues[_0x52660d['uniqueid']]['queuecallerabandon']=![];queues[_0x52660d['uniqueid']][_0xea0b('0x28')]=null;queues[_0x52660d['uniqueid']][_0xea0b('0x29')]=![];queues[_0x52660d[_0xea0b('0x5')]][_0xea0b('0x2a')]=null;queues[_0x52660d[_0xea0b('0x5')]][_0xea0b('0x3e')]=!![];queues[_0x52660d[_0xea0b('0x5')]][_0xea0b('0x8')]=_0x52660d['membername'];queues[_0x52660d[_0xea0b('0x5')]][_0xea0b('0x1b')]=!![];queues[_0x52660d[_0xea0b('0x5')]][_0xea0b('0x1c')]=utils['now']();if(_0x52660d[_0xea0b('0x43')]==_0xea0b('0x44')){if(!queues[_0x52660d['uniqueid']][_0xea0b('0x44')]){queues[_0x52660d['uniqueid']][_0xea0b('0xa')]=_0xea0b('0x45');}}else{queues[_0x52660d[_0xea0b('0x5')]][_0xea0b('0xa')]=_0xea0b('0x46')+_0x52660d[_0xea0b('0x43')][_0xea0b('0x2b')]();}utils[_0xea0b('0x13')](util[_0xea0b('0x3')](_0xea0b('0x47'),_0x52660d[_0xea0b('0x5')],queues[_0x52660d[_0xea0b('0x5')]][_0xea0b('0x21')],_0x52660d['membername'],queues[_0x52660d[_0xea0b('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x52660d[_0xea0b('0x5')]]);}}}catch(_0x184f65){utils['error'](util[_0xea0b('0x3')](_0xea0b('0x42'),_0x52660d[_0xea0b('0x5')]),_0x184f65);}};exports[_0xea0b('0x48')]=function(_0x34f92d){try{if(!_[_0xea0b('0x17')](queues[_0x34f92d[_0xea0b('0x49')]])){utils[_0xea0b('0x18')](util[_0xea0b('0x3')]('[%s][queues][blindtransfer]',_0x34f92d[_0xea0b('0x5')]),_0x34f92d);queues[_0x34f92d[_0xea0b('0x49')]][_0xea0b('0x44')]=!![];queues[_0x34f92d[_0xea0b('0x49')]][_0xea0b('0x4a')]=_0xea0b('0x4b');queues[_0x34f92d[_0xea0b('0x49')]][_0xea0b('0x4c')]=_0x34f92d['extension'];queues[_0x34f92d[_0xea0b('0x49')]]['transferuniqueid']=_0x34f92d[_0xea0b('0x49')];queues[_0x34f92d['transfereeuniqueid']][_0xea0b('0xa')]=_0xea0b('0x4d');utils[_0xea0b('0x13')](util[_0xea0b('0x3')](_0xea0b('0x4e'),_0x34f92d['uniqueid'],queues[_0x34f92d[_0xea0b('0x49')]][_0xea0b('0x21')],_0x34f92d[_0xea0b('0x49')],_0x34f92d['extension']));}}catch(_0xc11c88){utils[_0xea0b('0x16')](util['format']('[%s][queues][blindtransfer]',_0x34f92d['uniqueid']),_0xc11c88);}};exports[_0xea0b('0x4f')]=function(_0x5d5b23){try{utils[_0xea0b('0x18')](util[_0xea0b('0x3')]('[%s][queues][attendedtransfer]',_0x5d5b23[_0xea0b('0x50')]),_0x5d5b23);if(_0x5d5b23[_0xea0b('0x50')]==_0x5d5b23[_0xea0b('0x51')]){if(!_[_0xea0b('0x17')](queues[_0x5d5b23[_0xea0b('0x52')]])){utils[_0xea0b('0x13')](util[_0xea0b('0x3')](_0xea0b('0x53'),_0x5d5b23[_0xea0b('0x50')],queues[_0x5d5b23[_0xea0b('0x52')]]['name'],_0x5d5b23[_0xea0b('0x54')]));queues[_0x5d5b23[_0xea0b('0x52')]][_0xea0b('0x44')]=!![];queues[_0x5d5b23['secondtransfererlinkedid']][_0xea0b('0x4a')]=_0xea0b('0x55');queues[_0x5d5b23[_0xea0b('0x52')]][_0xea0b('0x4c')]=_0x5d5b23[_0xea0b('0x54')];queues[_0x5d5b23[_0xea0b('0x52')]]['transferuniqueid']=_0x5d5b23[_0xea0b('0x50')];queues[_0x5d5b23[_0xea0b('0x52')]][_0xea0b('0xa')]=_0xea0b('0x56');}if(!_[_0xea0b('0x17')](queues[_0x5d5b23[_0xea0b('0x51')]])){if(_0x5d5b23[_0xea0b('0x57')]&&queues[_0x5d5b23['transfereelinkedid']]){queues[_0x5d5b23[_0xea0b('0x57')]]['queuecallerenterreason']=0x1;queues[_0x5d5b23[_0xea0b('0x49')]]=_[_0xea0b('0x58')](queues[_0x5d5b23['transfereelinkedid']]);queues[_0x5d5b23[_0xea0b('0x49')]][_0xea0b('0x10')]=_0x5d5b23[_0xea0b('0x59')];queues[_0x5d5b23['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x5d5b23[_0xea0b('0x49')]][_0xea0b('0x9')]=queues[_0x5d5b23[_0xea0b('0x52')]][_0xea0b('0x9')];queues[_0x5d5b23[_0xea0b('0x49')]]['calleridname']=queues[_0x5d5b23[_0xea0b('0x52')]][_0xea0b('0x5a')];queues[_0x5d5b23['transfereeuniqueid']][_0xea0b('0x37')]=utils[_0xea0b('0x1d')]();queues[_0x5d5b23[_0xea0b('0x49')]][_0xea0b('0x36')]=utils[_0xea0b('0x1d')]();queues[_0x5d5b23['transfereeuniqueid']]['holdtime']=0x0;queues[_0x5d5b23[_0xea0b('0x49')]][_0xea0b('0x5b')]=0x0;utils['info'](util[_0xea0b('0x3')](_0xea0b('0x5c'),_0x5d5b23['origtransfereruniqueid'],queues[_0x5d5b23[_0xea0b('0x49')]][_0xea0b('0x21')],queues[_0x5d5b23[_0xea0b('0x49')]][_0xea0b('0x9')],queues[_0x5d5b23[_0xea0b('0x49')]]['calleridname']));}else{utils[_0xea0b('0x13')](util[_0xea0b('0x3')](_0xea0b('0x5d'),_0x5d5b23[_0xea0b('0x50')],queues[_0x5d5b23[_0xea0b('0x51')]][_0xea0b('0x21')],_0x5d5b23[_0xea0b('0x52')]));queues[_0x5d5b23['origtransfererlinkedid']][_0xea0b('0x10')]=_0x5d5b23[_0xea0b('0x52')];}}}else if(_0x5d5b23[_0xea0b('0x5e')]==_0x5d5b23[_0xea0b('0x52')]){if(!_['isNil'](queues[_0x5d5b23[_0xea0b('0x51')]])){utils[_0xea0b('0x13')](util[_0xea0b('0x3')](_0xea0b('0x5f'),_0x5d5b23[_0xea0b('0x50')],queues[_0x5d5b23[_0xea0b('0x51')]]['name'],_0x5d5b23[_0xea0b('0x5e')],_0x5d5b23[_0xea0b('0x60')]));queues[_0x5d5b23[_0xea0b('0x51')]][_0xea0b('0x44')]=!![];queues[_0x5d5b23[_0xea0b('0x51')]][_0xea0b('0x4a')]=_0xea0b('0x55');queues[_0x5d5b23[_0xea0b('0x51')]]['transferexten']=_0x5d5b23[_0xea0b('0x60')];queues[_0x5d5b23[_0xea0b('0x51')]][_0xea0b('0x61')]=_0x5d5b23[_0xea0b('0x5e')];queues[_0x5d5b23['origtransfererlinkedid']][_0xea0b('0xa')]=_0xea0b('0x56');}if(!_['isNil'](queues[_0x5d5b23[_0xea0b('0x52')]])){if(_0x5d5b23[_0xea0b('0x62')]&&queues[_0x5d5b23[_0xea0b('0x62')]]){queues[_0x5d5b23[_0xea0b('0x62')]]['queuecallerenterreason']=0x1;queues[_0x5d5b23[_0xea0b('0x59')]]=_[_0xea0b('0x58')](queues[_0x5d5b23['transfertargetlinkedid']]);queues[_0x5d5b23[_0xea0b('0x59')]][_0xea0b('0x10')]=_0x5d5b23['transfertargetuniqueid'];queues[_0x5d5b23[_0xea0b('0x59')]][_0xea0b('0x22')]=0x2;queues[_0x5d5b23[_0xea0b('0x59')]]['calleridnum']=queues[_0x5d5b23['origtransfererlinkedid']]['calleridnum'];queues[_0x5d5b23['transfertargetuniqueid']][_0xea0b('0x5a')]=queues[_0x5d5b23['origtransfererlinkedid']][_0xea0b('0x5a')];queues[_0x5d5b23[_0xea0b('0x59')]]['queuecallerjoinAt']=utils[_0xea0b('0x1d')]();queues[_0x5d5b23[_0xea0b('0x59')]][_0xea0b('0x36')]=utils['now']();queues[_0x5d5b23[_0xea0b('0x59')]][_0xea0b('0x63')]=0x0;queues[_0x5d5b23[_0xea0b('0x59')]][_0xea0b('0x5b')]=0x0;utils['info'](util[_0xea0b('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x5d5b23[_0xea0b('0x50')],queues[_0x5d5b23[_0xea0b('0x59')]][_0xea0b('0x21')],queues[_0x5d5b23['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x5d5b23['transfertargetuniqueid']][_0xea0b('0x9')],queues[_0x5d5b23[_0xea0b('0x59')]][_0xea0b('0x5a')]));}else{utils[_0xea0b('0x13')](util[_0xea0b('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x5d5b23[_0xea0b('0x50')],queues[_0x5d5b23['secondtransfererlinkedid']][_0xea0b('0x21')],_0x5d5b23[_0xea0b('0x51')]));queues[_0x5d5b23[_0xea0b('0x52')]][_0xea0b('0x10')]=_0x5d5b23[_0xea0b('0x51')];}}}}catch(_0x2988e3){utils[_0xea0b('0x16')](util[_0xea0b('0x3')](_0xea0b('0x64'),_0x5d5b23[_0xea0b('0x50')]),_0x2988e3);}};exports['musiconholdstart']=function(_0x3c5d89){try{if(!_['isNil'](queues[_0x3c5d89[_0xea0b('0x5')]])){utils[_0xea0b('0x18')](util[_0xea0b('0x3')](_0xea0b('0x65'),_0x3c5d89[_0xea0b('0x5')]),_0x3c5d89);queues[_0x3c5d89[_0xea0b('0x5')]][_0xea0b('0x66')]=utils['now']();utils[_0xea0b('0x13')](util[_0xea0b('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x3c5d89[_0xea0b('0x5')],queues[_0x3c5d89[_0xea0b('0x5')]][_0xea0b('0x21')],queues[_0x3c5d89['uniqueid']][_0xea0b('0x66')]));}}catch(_0xe25bed){utils['error'](util['format'](_0xea0b('0x65'),_0x3c5d89[_0xea0b('0x5')]),_0xe25bed);}};exports[_0xea0b('0x67')]=function(_0x54a981){try{if(!_['isNil'](queues[_0x54a981['uniqueid']])){if(!_[_0xea0b('0x17')](queues[_0x54a981[_0xea0b('0x5')]][_0xea0b('0x66')])){utils['debug'](util[_0xea0b('0x3')](_0xea0b('0x68'),_0x54a981['uniqueid']),_0x54a981);queues[_0x54a981[_0xea0b('0x5')]]['mohtime']+=utils[_0xea0b('0x35')](utils[_0xea0b('0x1d')](),queues[_0x54a981[_0xea0b('0x5')]][_0xea0b('0x66')]);utils[_0xea0b('0x13')](util[_0xea0b('0x3')](_0xea0b('0x69'),_0x54a981[_0xea0b('0x5')],queues[_0x54a981['uniqueid']][_0xea0b('0x21')],queues[_0x54a981[_0xea0b('0x5')]][_0xea0b('0x5b')]));delete queues[_0x54a981[_0xea0b('0x5')]]['musiconholdstartAt'];}}}catch(_0x4c9752){utils[_0xea0b('0x16')](util[_0xea0b('0x3')](_0xea0b('0x68'),_0x54a981[_0xea0b('0x5')]),_0x4c9752);}}; \ No newline at end of file +var _0x0776=['[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','queuecallerjoinAt','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','format','[%s][queues][queuecallerjoin]','position','assign','now','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','error','debug','[%s][queues][varset]','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','name','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave'];(function(_0x252e67,_0x4f298d){var _0xe1a88f=function(_0x3d3fa7){while(--_0x3d3fa7){_0x252e67['push'](_0x252e67['shift']());}};_0xe1a88f(++_0x4f298d);}(_0x0776,0x16a));var _0x6077=function(_0xb2dfd9,_0x130626){_0xb2dfd9=_0xb2dfd9-0x0;var _0x270d3b=_0x0776[_0xb2dfd9];return _0x270d3b;};'use strict';var _=require(_0x6077('0x0'));var util=require(_0x6077('0x1'));var utils=require(_0x6077('0x2'));var queues={};function writeDB(_0x143487){utils[_0x6077('0x3')](util['format'](_0x6077('0x4'),_0x143487[_0x6077('0x5')],_0x143487['channel'],_0x143487[_0x6077('0x6')],_0x143487[_0x6077('0x7')],_0x143487['calleridnum'],_0x143487[_0x6077('0x8')],_0x143487[_0x6077('0x9')]));if(_0x143487[_0x6077('0x6')]){utils[_0x6077('0xa')](_0x143487[_0x6077('0x6')])[_0x6077('0xb')](function(_0x2ee12e){if(_0x2ee12e){_0x143487[_0x6077('0xc')]=_0x2ee12e[_0x6077('0xc')];}utils[_0x6077('0xd')](_0x6077('0xe'),_0x143487);});}else{utils[_0x6077('0xd')]('CreateVoiceQueueReport',_0x143487);}if(_0x143487['transfereduniqueid']){delete queues[_0x143487[_0x6077('0xf')]];}else{delete queues[_0x143487[_0x6077('0x5')]];}}exports[_0x6077('0x10')]=function(_0x2979be){try{utils['debug'](util[_0x6077('0x11')](_0x6077('0x12'),_0x2979be[_0x6077('0x5')]),_0x2979be);utils[_0x6077('0x3')](util[_0x6077('0x11')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x2979be[_0x6077('0x5')],_0x2979be[_0x6077('0x6')],_0x2979be[_0x6077('0x13')]));queues[_0x2979be['uniqueid']]=_[_0x6077('0x14')](_0x2979be,{'originalposition':_0x2979be[_0x6077('0x13')],'queuecallerjoinAt':utils[_0x6077('0x15')](),'mohtime':0x0});}catch(_0x49694d){utils['error'](util[_0x6077('0x11')]('[%s][queues][queuecallerjoin]',_0x2979be[_0x6077('0x5')]),_0x49694d);}};exports[_0x6077('0x16')]=function(_0x16417a){try{if(!_[_0x6077('0x17')](queues[_0x16417a[_0x6077('0x5')]])){utils['debug'](util[_0x6077('0x11')](_0x6077('0x18'),_0x16417a[_0x6077('0x5')]),_0x16417a);if(queues[_0x16417a['uniqueid']][_0x6077('0x19')]){if(!queues[_0x16417a[_0x6077('0x5')]]['queuecallerabandon']&&!queues[_0x16417a['uniqueid']][_0x6077('0x1a')]){queues[_0x16417a[_0x6077('0x5')]][_0x6077('0x1b')]=!![];queues[_0x16417a[_0x6077('0x5')]][_0x6077('0x1c')]=utils['now']();queues[_0x16417a['uniqueid']][_0x6077('0x9')]='COMPLETEDBYAGENT';}utils['info'](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x16417a['uniqueid'],queues[_0x16417a[_0x6077('0x5')]]['name'],queues[_0x16417a[_0x6077('0x5')]][_0x6077('0x9')]));writeDB(queues[_0x16417a[_0x6077('0x5')]]);}else if(queues[_0x16417a[_0x6077('0x5')]]['transfereduniqueid']){utils[_0x6077('0x3')](util[_0x6077('0x11')](_0x6077('0x1d'),_0x16417a[_0x6077('0x5')],queues[_0x16417a[_0x6077('0x5')]]['name'],queues[_0x16417a[_0x6077('0x5')]]['transfereduniqueid']));queues[queues[_0x16417a[_0x6077('0x5')]][_0x6077('0xf')]]=queues[_0x16417a['uniqueid']];queues[queues[_0x16417a['uniqueid']]['transfereduniqueid']][_0x6077('0x1e')]=0x2;delete queues[_0x16417a['uniqueid']];}}}catch(_0x231290){utils[_0x6077('0x1f')](util[_0x6077('0x11')](_0x6077('0x18'),_0x16417a['uniqueid']),_0x231290);}};exports['varset']=function(_0x38071f){try{utils[_0x6077('0x20')](util['format'](_0x6077('0x21'),_0x38071f[_0x6077('0x5')]),_0x38071f);if(!_[_0x6077('0x17')](_0x38071f[_0x6077('0x22')][_0x6077('0x23')])&&_0x38071f['value'][_0x6077('0x24')]()!==_0x6077('0x25')){if(!_['isNil'](queues[_0x38071f[_0x6077('0x5')]])){queues[_0x38071f[_0x6077('0x5')]][_0x6077('0x26')]=![];queues[_0x38071f[_0x6077('0x5')]][_0x6077('0x27')]=null;queues[_0x38071f['uniqueid']][_0x6077('0x1a')]=!![];queues[_0x38071f[_0x6077('0x5')]][_0x6077('0x28')]=utils[_0x6077('0x15')]();queues[_0x38071f[_0x6077('0x5')]][_0x6077('0x9')]=_0x38071f[_0x6077('0x29')][_0x6077('0x24')]();utils[_0x6077('0x3')](util[_0x6077('0x11')](_0x6077('0x2a'),_0x38071f[_0x6077('0x5')],queues[_0x38071f[_0x6077('0x5')]][_0x6077('0x2b')],_0x38071f[_0x6077('0x29')],queues[_0x38071f[_0x6077('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x38071f[_0x6077('0x5')]]);}}else if(!_[_0x6077('0x17')](_0x38071f[_0x6077('0x22')][_0x6077('0x2c')])){if(!_[_0x6077('0x17')](queues[_0x38071f[_0x6077('0x5')]])&&!queues[_0x38071f[_0x6077('0x5')]]['queuecallerabandon']){queues[_0x38071f['uniqueid']][_0x6077('0x26')]=![];queues[_0x38071f[_0x6077('0x5')]][_0x6077('0x27')]=null;queues[_0x38071f[_0x6077('0x5')]][_0x6077('0x1a')]=!![];queues[_0x38071f[_0x6077('0x5')]]['queuecallerexitAt']=utils[_0x6077('0x15')]();queues[_0x38071f['uniqueid']]['queuecallerexitreason']='EXITWITHKEY';utils[_0x6077('0x3')](util[_0x6077('0x11')](_0x6077('0x2d'),_0x38071f[_0x6077('0x5')],queues[_0x38071f['uniqueid']]['name'],_0x38071f['value'],queues[_0x38071f['uniqueid']][_0x6077('0x9')]));}}}catch(_0x3e693e){utils['error'](util[_0x6077('0x11')]('[%s][queues][varset]',_0x38071f[_0x6077('0x5')]),_0x3e693e);}};exports['queuecallerabandon']=function(_0x5619c3){try{if(!_['isNil'](queues[_0x5619c3[_0x6077('0x5')]])){utils['debug'](util[_0x6077('0x11')](_0x6077('0x2e'),_0x5619c3[_0x6077('0x5')]),_0x5619c3);queues[_0x5619c3[_0x6077('0x5')]][_0x6077('0x1a')]=![];queues[_0x5619c3[_0x6077('0x5')]][_0x6077('0x28')]=null;queues[_0x5619c3['uniqueid']][_0x6077('0x26')]=!![];queues[_0x5619c3[_0x6077('0x5')]][_0x6077('0x27')]=utils[_0x6077('0x15')]();queues[_0x5619c3[_0x6077('0x5')]][_0x6077('0x9')]=_0x6077('0x2f');utils['info'](util['format'](_0x6077('0x30'),_0x5619c3[_0x6077('0x5')],queues[_0x5619c3['uniqueid']][_0x6077('0x2b')],queues[_0x5619c3[_0x6077('0x5')]][_0x6077('0x9')]));}}catch(_0x43b3d3){utils[_0x6077('0x1f')](util['format']('[%s][queues][queuecallerabandon]',_0x5619c3[_0x6077('0x5')]),_0x43b3d3);}};exports[_0x6077('0x31')]=function(_0x16651e){try{if(!_[_0x6077('0x17')](queues[_0x16651e[_0x6077('0x5')]])){utils[_0x6077('0x20')](util[_0x6077('0x11')](_0x6077('0x32'),_0x16651e['uniqueid']),_0x16651e);utils['info'](util[_0x6077('0x11')](_0x6077('0x33'),_0x16651e['uniqueid'],queues[_0x16651e[_0x6077('0x5')]]['name'],_0x16651e[_0x6077('0x34')],_0x16651e[_0x6077('0x35')]));queues[_0x16651e[_0x6077('0x5')]][_0x6077('0x31')]=!![];queues[_0x16651e[_0x6077('0x5')]][_0x6077('0x19')]=utils[_0x6077('0x15')]();queues[_0x16651e[_0x6077('0x5')]][_0x6077('0x36')]=utils['diffTime'](queues[_0x16651e[_0x6077('0x5')]]['queuecallerleaveAt'],queues[_0x16651e[_0x6077('0x5')]][_0x6077('0x37')]);queues[_0x16651e[_0x6077('0x5')]][_0x6077('0x13')]=_0x16651e[_0x6077('0x13')];queues[_0x16651e[_0x6077('0x5')]][_0x6077('0x38')]=_0x16651e['count'];queues[_0x16651e[_0x6077('0x5')]][_0x6077('0x34')]=_0x16651e['connectedlinenum'];queues[_0x16651e[_0x6077('0x5')]]['connectedlinename']=_0x16651e[_0x6077('0x35')];}}catch(_0x3b24a0){utils['error'](util[_0x6077('0x11')]('[%s][queues][queuecallerleave]',_0x16651e[_0x6077('0x5')]),_0x3b24a0);}};exports['agentconnect']=function(_0x1e8cbd){try{if(!_['isNil'](queues[_0x1e8cbd[_0x6077('0x5')]])){utils[_0x6077('0x20')](util[_0x6077('0x11')](_0x6077('0x39'),_0x1e8cbd[_0x6077('0x5')]),_0x1e8cbd);utils[_0x6077('0x3')](util[_0x6077('0x11')](_0x6077('0x3a'),_0x1e8cbd[_0x6077('0x5')],queues[_0x1e8cbd[_0x6077('0x5')]]['name'],_0x1e8cbd[_0x6077('0x3b')],_0x1e8cbd['destaccountcode']));queues[_0x1e8cbd[_0x6077('0x5')]][_0x6077('0x26')]=![];queues[_0x1e8cbd[_0x6077('0x5')]][_0x6077('0x26')]=![];queues[_0x1e8cbd[_0x6077('0x5')]][_0x6077('0x27')]=null;queues[_0x1e8cbd[_0x6077('0x5')]][_0x6077('0x1a')]=![];queues[_0x1e8cbd[_0x6077('0x5')]]['queuecallerexitreason']=null;queues[_0x1e8cbd[_0x6077('0x5')]][_0x6077('0x28')]=null;queues[_0x1e8cbd['uniqueid']][_0x6077('0x3c')]=!![];queues[_0x1e8cbd['uniqueid']]['accountcode']=_0x1e8cbd[_0x6077('0x3d')];queues[_0x1e8cbd[_0x6077('0x5')]][_0x6077('0x7')]=_0x1e8cbd[_0x6077('0x3b')];}}catch(_0x495190){utils[_0x6077('0x1f')](util[_0x6077('0x11')](_0x6077('0x39'),_0x1e8cbd[_0x6077('0x5')]),_0x495190);}};exports['agentcomplete']=function(_0xb613f1){try{if(!_['isNil'](queues[_0xb613f1[_0x6077('0x5')]])){if(queues[_0xb613f1['uniqueid']]['queuecallerleaveAt']){utils['debug'](util['format']('[%s][queues][agentcomplete]',_0xb613f1[_0x6077('0x5')]),_0xb613f1);queues[_0xb613f1[_0x6077('0x5')]][_0x6077('0x26')]=![];queues[_0xb613f1[_0x6077('0x5')]][_0x6077('0x26')]=![];queues[_0xb613f1[_0x6077('0x5')]]['queuecallerabandonAt']=null;queues[_0xb613f1[_0x6077('0x5')]][_0x6077('0x1a')]=![];queues[_0xb613f1['uniqueid']][_0x6077('0x28')]=null;queues[_0xb613f1[_0x6077('0x5')]]['assigned']=!![];queues[_0xb613f1[_0x6077('0x5')]][_0x6077('0x7')]=_0xb613f1[_0x6077('0x3b')];queues[_0xb613f1[_0x6077('0x5')]]['queuecallercomplete']=!![];queues[_0xb613f1[_0x6077('0x5')]][_0x6077('0x1c')]=utils[_0x6077('0x15')]();if(_0xb613f1['reason']==_0x6077('0x3e')){if(!queues[_0xb613f1['uniqueid']]['transfer']){queues[_0xb613f1[_0x6077('0x5')]][_0x6077('0x9')]=_0x6077('0x3f');}}else{queues[_0xb613f1[_0x6077('0x5')]][_0x6077('0x9')]=_0x6077('0x40')+_0xb613f1[_0x6077('0x41')][_0x6077('0x24')]();}utils[_0x6077('0x3')](util[_0x6077('0x11')](_0x6077('0x42'),_0xb613f1[_0x6077('0x5')],queues[_0xb613f1['uniqueid']]['name'],_0xb613f1['membername'],queues[_0xb613f1[_0x6077('0x5')]][_0x6077('0x9')]));writeDB(queues[_0xb613f1[_0x6077('0x5')]]);}}}catch(_0x4be8a7){utils['error'](util[_0x6077('0x11')](_0x6077('0x43'),_0xb613f1['uniqueid']),_0x4be8a7);}};exports['blindtransfer']=function(_0x2c7143){try{if(!_[_0x6077('0x17')](queues[_0x2c7143['transfereeuniqueid']])){utils[_0x6077('0x20')](util[_0x6077('0x11')](_0x6077('0x44'),_0x2c7143[_0x6077('0x5')]),_0x2c7143);queues[_0x2c7143[_0x6077('0x45')]]['transfer']=!![];queues[_0x2c7143['transfereeuniqueid']][_0x6077('0x46')]=_0x6077('0x47');queues[_0x2c7143[_0x6077('0x45')]][_0x6077('0x48')]=_0x2c7143[_0x6077('0x49')];queues[_0x2c7143[_0x6077('0x45')]][_0x6077('0x4a')]=_0x2c7143[_0x6077('0x45')];queues[_0x2c7143[_0x6077('0x45')]][_0x6077('0x9')]=_0x6077('0x4b');utils['info'](util[_0x6077('0x11')](_0x6077('0x4c'),_0x2c7143[_0x6077('0x5')],queues[_0x2c7143['transfereeuniqueid']][_0x6077('0x2b')],_0x2c7143[_0x6077('0x45')],_0x2c7143[_0x6077('0x49')]));}}catch(_0x34c80f){utils['error'](util[_0x6077('0x11')]('[%s][queues][blindtransfer]',_0x2c7143[_0x6077('0x5')]),_0x34c80f);}};exports[_0x6077('0x4d')]=function(_0x4a636d){try{utils['debug'](util[_0x6077('0x11')]('[%s][queues][attendedtransfer]',_0x4a636d[_0x6077('0x4e')]),_0x4a636d);if(_0x4a636d['origtransfereruniqueid']==_0x4a636d['origtransfererlinkedid']){if(!_[_0x6077('0x17')](queues[_0x4a636d[_0x6077('0x4f')]])){utils[_0x6077('0x3')](util[_0x6077('0x11')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x4a636d[_0x6077('0x4e')],queues[_0x4a636d[_0x6077('0x4f')]][_0x6077('0x2b')],_0x4a636d[_0x6077('0x50')]));queues[_0x4a636d[_0x6077('0x4f')]]['transfer']=!![];queues[_0x4a636d[_0x6077('0x4f')]][_0x6077('0x46')]=_0x6077('0x51');queues[_0x4a636d[_0x6077('0x4f')]][_0x6077('0x48')]=_0x4a636d[_0x6077('0x50')];queues[_0x4a636d[_0x6077('0x4f')]][_0x6077('0x4a')]=_0x4a636d[_0x6077('0x4e')];queues[_0x4a636d['secondtransfererlinkedid']]['queuecallerexitreason']=_0x6077('0x52');}if(!_[_0x6077('0x17')](queues[_0x4a636d[_0x6077('0x53')]])){if(_0x4a636d[_0x6077('0x54')]&&queues[_0x4a636d[_0x6077('0x54')]]){queues[_0x4a636d[_0x6077('0x54')]][_0x6077('0x1e')]=0x1;queues[_0x4a636d[_0x6077('0x45')]]=_['clone'](queues[_0x4a636d[_0x6077('0x54')]]);queues[_0x4a636d['transfereeuniqueid']][_0x6077('0xf')]=_0x4a636d[_0x6077('0x55')];queues[_0x4a636d[_0x6077('0x45')]][_0x6077('0x1e')]=0x2;queues[_0x4a636d[_0x6077('0x45')]][_0x6077('0x56')]=queues[_0x4a636d[_0x6077('0x4f')]][_0x6077('0x56')];queues[_0x4a636d[_0x6077('0x45')]][_0x6077('0x57')]=queues[_0x4a636d[_0x6077('0x4f')]][_0x6077('0x57')];queues[_0x4a636d[_0x6077('0x45')]]['queuecallerjoinAt']=utils['now']();queues[_0x4a636d[_0x6077('0x45')]][_0x6077('0x19')]=utils[_0x6077('0x15')]();queues[_0x4a636d[_0x6077('0x45')]]['holdtime']=0x0;queues[_0x4a636d[_0x6077('0x45')]][_0x6077('0x58')]=0x0;utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x4a636d[_0x6077('0x4e')],queues[_0x4a636d['transfereeuniqueid']][_0x6077('0x2b')],queues[_0x4a636d[_0x6077('0x45')]][_0x6077('0x56')],queues[_0x4a636d[_0x6077('0x45')]]['calleridname']));}else{utils[_0x6077('0x3')](util[_0x6077('0x11')](_0x6077('0x59'),_0x4a636d[_0x6077('0x4e')],queues[_0x4a636d['origtransfererlinkedid']][_0x6077('0x2b')],_0x4a636d['secondtransfererlinkedid']));queues[_0x4a636d[_0x6077('0x53')]][_0x6077('0xf')]=_0x4a636d['secondtransfererlinkedid'];}}}else if(_0x4a636d[_0x6077('0x5a')]==_0x4a636d[_0x6077('0x4f')]){if(!_[_0x6077('0x17')](queues[_0x4a636d[_0x6077('0x53')]])){utils[_0x6077('0x3')](util[_0x6077('0x11')](_0x6077('0x5b'),_0x4a636d['origtransfereruniqueid'],queues[_0x4a636d[_0x6077('0x53')]][_0x6077('0x2b')],_0x4a636d[_0x6077('0x5a')],_0x4a636d[_0x6077('0x5c')]));queues[_0x4a636d['origtransfererlinkedid']][_0x6077('0x3e')]=!![];queues[_0x4a636d[_0x6077('0x53')]]['transfertype']=_0x6077('0x51');queues[_0x4a636d[_0x6077('0x53')]][_0x6077('0x48')]=_0x4a636d[_0x6077('0x5c')];queues[_0x4a636d[_0x6077('0x53')]][_0x6077('0x4a')]=_0x4a636d['secondtransfereruniqueid'];queues[_0x4a636d[_0x6077('0x53')]][_0x6077('0x9')]=_0x6077('0x52');}if(!_[_0x6077('0x17')](queues[_0x4a636d[_0x6077('0x4f')]])){if(_0x4a636d[_0x6077('0x5d')]&&queues[_0x4a636d[_0x6077('0x5d')]]){queues[_0x4a636d[_0x6077('0x5d')]]['queuecallerenterreason']=0x1;queues[_0x4a636d[_0x6077('0x55')]]=_[_0x6077('0x5e')](queues[_0x4a636d['transfertargetlinkedid']]);queues[_0x4a636d[_0x6077('0x55')]][_0x6077('0xf')]=_0x4a636d[_0x6077('0x55')];queues[_0x4a636d[_0x6077('0x55')]][_0x6077('0x1e')]=0x2;queues[_0x4a636d['transfertargetuniqueid']][_0x6077('0x56')]=queues[_0x4a636d[_0x6077('0x53')]][_0x6077('0x56')];queues[_0x4a636d[_0x6077('0x55')]][_0x6077('0x57')]=queues[_0x4a636d[_0x6077('0x53')]]['calleridname'];queues[_0x4a636d[_0x6077('0x55')]][_0x6077('0x37')]=utils[_0x6077('0x15')]();queues[_0x4a636d[_0x6077('0x55')]][_0x6077('0x19')]=utils[_0x6077('0x15')]();queues[_0x4a636d[_0x6077('0x55')]][_0x6077('0x36')]=0x0;queues[_0x4a636d['transfertargetuniqueid']][_0x6077('0x58')]=0x0;utils[_0x6077('0x3')](util[_0x6077('0x11')](_0x6077('0x5f'),_0x4a636d['origtransfereruniqueid'],queues[_0x4a636d[_0x6077('0x55')]]['name'],queues[_0x4a636d[_0x6077('0x55')]]['transfereduniqueid'],queues[_0x4a636d[_0x6077('0x55')]][_0x6077('0x56')],queues[_0x4a636d[_0x6077('0x55')]][_0x6077('0x57')]));}else{utils[_0x6077('0x3')](util[_0x6077('0x11')](_0x6077('0x59'),_0x4a636d['origtransfereruniqueid'],queues[_0x4a636d[_0x6077('0x4f')]][_0x6077('0x2b')],_0x4a636d[_0x6077('0x53')]));queues[_0x4a636d['secondtransfererlinkedid']][_0x6077('0xf')]=_0x4a636d[_0x6077('0x53')];}}}}catch(_0x1b5e90){utils[_0x6077('0x1f')](util[_0x6077('0x11')](_0x6077('0x60'),_0x4a636d[_0x6077('0x4e')]),_0x1b5e90);}};exports[_0x6077('0x61')]=function(_0x3a73d5){try{if(!_[_0x6077('0x17')](queues[_0x3a73d5[_0x6077('0x5')]])){utils[_0x6077('0x20')](util['format'](_0x6077('0x62'),_0x3a73d5[_0x6077('0x5')]),_0x3a73d5);queues[_0x3a73d5[_0x6077('0x5')]][_0x6077('0x63')]=utils['now']();utils[_0x6077('0x3')](util[_0x6077('0x11')](_0x6077('0x64'),_0x3a73d5[_0x6077('0x5')],queues[_0x3a73d5[_0x6077('0x5')]]['name'],queues[_0x3a73d5['uniqueid']][_0x6077('0x63')]));}}catch(_0xd83629){utils[_0x6077('0x1f')](util[_0x6077('0x11')](_0x6077('0x62'),_0x3a73d5[_0x6077('0x5')]),_0xd83629);}};exports['musiconholdstop']=function(_0x50e01c){try{if(!_[_0x6077('0x17')](queues[_0x50e01c[_0x6077('0x5')]])){if(!_['isNil'](queues[_0x50e01c['uniqueid']]['musiconholdstartAt'])){utils[_0x6077('0x20')](util[_0x6077('0x11')]('[%s][queues][musiconholdstop]',_0x50e01c[_0x6077('0x5')]),_0x50e01c);queues[_0x50e01c[_0x6077('0x5')]][_0x6077('0x58')]+=utils['diffTime'](utils[_0x6077('0x15')](),queues[_0x50e01c['uniqueid']][_0x6077('0x63')]);utils[_0x6077('0x3')](util[_0x6077('0x11')](_0x6077('0x65'),_0x50e01c[_0x6077('0x5')],queues[_0x50e01c[_0x6077('0x5')]][_0x6077('0x2b')],queues[_0x50e01c['uniqueid']][_0x6077('0x58')]));delete queues[_0x50e01c[_0x6077('0x5')]][_0x6077('0x63')];}}}catch(_0x3c511e){utils['error'](util['format'](_0x6077('0x66'),_0x50e01c['uniqueid']),_0x3c511e);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index cca1056..8465726 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 _0xcc53=['[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','monitors','push','error','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','context','exten','channel','newstate','[%s][recordings][newstate]','isNil','channelstate'];(function(_0x2f9ebe,_0x861cce){var _0x36cb47=function(_0x3fe8a8){while(--_0x3fe8a8){_0x2f9ebe['push'](_0x2f9ebe['shift']());}};_0x36cb47(++_0x861cce);}(_0xcc53,0xe8));var _0x3cc5=function(_0x3f98dd,_0x2d484f){_0x3f98dd=_0x3f98dd-0x0;var _0x4c56d5=_0xcc53[_0x3f98dd];return _0x4c56d5;};'use strict';var _=require(_0x3cc5('0x0'));var util=require(_0x3cc5('0x1'));var utils=require(_0x3cc5('0x2'));var recordings={};function writeDB(_0x456b4e){utils[_0x3cc5('0x3')](util[_0x3cc5('0x4')](_0x3cc5('0x5'),_0x456b4e[_0x3cc5('0x6')]));if(_0x456b4e[_0x3cc5('0x7')]){utils[_0x3cc5('0x8')](_0x456b4e[_0x3cc5('0x7')])[_0x3cc5('0x9')](function(_0x4c5270){if(_0x4c5270){_0x456b4e['membername']=_0x4c5270[_0x3cc5('0xa')];_0x456b4e[_0x3cc5('0xb')]=_0x4c5270['id'];}utils[_0x3cc5('0xc')](_0x3cc5('0xd'),_0x456b4e);});}else{utils[_0x3cc5('0xc')]('CreateVoiceRecording',_0x456b4e);}}exports['newchannel']=function(_0x3480cd){try{utils[_0x3cc5('0xe')](util[_0x3cc5('0x4')](_0x3cc5('0xf'),_0x3480cd[_0x3cc5('0x6')]),_0x3480cd);if(_0x3480cd[_0x3cc5('0x6')]==_0x3480cd[_0x3cc5('0x10')]){utils[_0x3cc5('0x3')](util[_0x3cc5('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x3480cd[_0x3cc5('0x6')],_0x3480cd[_0x3cc5('0x11')],_0x3480cd[_0x3cc5('0x12')]));recordings[_0x3480cd[_0x3cc5('0x6')]]={'uniqueid':_0x3480cd[_0x3cc5('0x6')],'accountcode':_0x3480cd[_0x3cc5('0x7')],'exten':_0x3480cd['exten'],'context':_0x3480cd['context'],'channel':_0x3480cd[_0x3cc5('0x13')],'monitors':[]};}}catch(_0x30fcb3){utils['error'](util[_0x3cc5('0x4')]('[%s][recordings][newchannel]',_0x3480cd[_0x3cc5('0x6')]),_0x30fcb3);}};exports[_0x3cc5('0x14')]=function(_0x1a5b6f){try{utils[_0x3cc5('0xe')](util[_0x3cc5('0x4')](_0x3cc5('0x15'),_0x1a5b6f[_0x3cc5('0x6')]),_0x1a5b6f);if(!_[_0x3cc5('0x16')](recordings[_0x1a5b6f[_0x3cc5('0x6')]])&&_0x1a5b6f[_0x3cc5('0x17')]==0x6){utils[_0x3cc5('0x3')](util[_0x3cc5('0x4')](_0x3cc5('0x18'),_0x1a5b6f[_0x3cc5('0x6')],_0x1a5b6f[_0x3cc5('0x11')],_0x1a5b6f[_0x3cc5('0x13')]));}else if(!_[_0x3cc5('0x16')](recordings[_0x1a5b6f[_0x3cc5('0x10')]])&&_0x1a5b6f[_0x3cc5('0x17')]==0x6&&_0x1a5b6f[_0x3cc5('0x11')]!=_0x3cc5('0x19')){utils[_0x3cc5('0x3')](util[_0x3cc5('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x1a5b6f[_0x3cc5('0x6')],_0x1a5b6f['linkedid'],_0x1a5b6f[_0x3cc5('0x11')],_0x1a5b6f['channel']));recordings[_0x1a5b6f[_0x3cc5('0x10')]][_0x3cc5('0x7')]=_0x1a5b6f['accountcode'];}}catch(_0x28f148){utils['error'](util['format']('[%s][recordings][newstate]',_0x1a5b6f[_0x3cc5('0x6')]),_0x28f148);}};exports[_0x3cc5('0x1a')]=function(_0x2f84b8){try{if(!_[_0x3cc5('0x16')](_0x2f84b8['variable'])&&!_[_0x3cc5('0x16')](_0x2f84b8[_0x3cc5('0x1b')][_0x3cc5('0x1c')])){utils['debug'](util[_0x3cc5('0x4')](_0x3cc5('0x1d'),_0x2f84b8[_0x3cc5('0x6')]),_0x2f84b8);utils[_0x3cc5('0x3')](util['format'](_0x3cc5('0x1e'),_0x2f84b8[_0x3cc5('0x6')],_0x2f84b8[_0x3cc5('0x1b')],_0x2f84b8[_0x3cc5('0x1f')]));if(_[_0x3cc5('0x20')](_0x2f84b8[_0x3cc5('0x1f')],'.wav49')){_0x2f84b8[_0x3cc5('0x1f')]=_0x2f84b8['value']['replace'](_0x3cc5('0x21'),_0x3cc5('0x22'));}if(recordings[_0x2f84b8[_0x3cc5('0x10')]]){var _0x55f6fd=_['find'](recordings[_0x2f84b8[_0x3cc5('0x10')]][_0x3cc5('0x23')],{'value':_0x2f84b8[_0x3cc5('0x1f')]});if(_[_0x3cc5('0x16')](_0x55f6fd)){recordings[_0x2f84b8[_0x3cc5('0x10')]][_0x3cc5('0x23')][_0x3cc5('0x24')]({'value':_0x2f84b8['value']});}}}}catch(_0x24c9cb){utils[_0x3cc5('0x25')](util[_0x3cc5('0x4')](_0x3cc5('0x1d'),_0x2f84b8[_0x3cc5('0x6')]),_0x24c9cb);}};exports[_0x3cc5('0x26')]=function(_0x2a8d25){try{if(!_[_0x3cc5('0x16')](recordings[_0x2a8d25[_0x3cc5('0x6')]])){utils[_0x3cc5('0xe')](util[_0x3cc5('0x4')](_0x3cc5('0x27'),_0x2a8d25[_0x3cc5('0x6')]),_0x2a8d25);utils[_0x3cc5('0x3')](util[_0x3cc5('0x4')](_0x3cc5('0x28'),_0x2a8d25[_0x3cc5('0x6')],_0x2a8d25[_0x3cc5('0x29')],_0x2a8d25['calleridname'],_0x2a8d25[_0x3cc5('0x2a')]));recordings[_0x2a8d25[_0x3cc5('0x6')]]['calleridnum']=_0x2a8d25[_0x3cc5('0x29')];recordings[_0x2a8d25[_0x3cc5('0x6')]][_0x3cc5('0x2b')]=_0x2a8d25[_0x3cc5('0x2b')];recordings[_0x2a8d25[_0x3cc5('0x6')]][_0x3cc5('0x2c')]=_0x2a8d25[_0x3cc5('0x2c')];recordings[_0x2a8d25[_0x3cc5('0x6')]][_0x3cc5('0x2d')]=_0x2a8d25[_0x3cc5('0x2d')];if(recordings[_0x2a8d25[_0x3cc5('0x6')]]['type']==_0x3cc5('0x2e')&&recordings[_0x2a8d25['uniqueid']]['accountcode']){recordings[_0x2a8d25['uniqueid']]['connectedlinenum']=recordings[_0x2a8d25[_0x3cc5('0x6')]]['accountcode'];recordings[_0x2a8d25[_0x3cc5('0x6')]][_0x3cc5('0x2d')]='';}recordings[_0x2a8d25[_0x3cc5('0x6')]][_0x3cc5('0x23')][_0x3cc5('0x2f')](function(_0x1ed2fc){var _0x31455f=_[_0x3cc5('0x30')](recordings[_0x2a8d25[_0x3cc5('0x6')]]);_0x31455f[_0x3cc5('0x1f')]=_0x1ed2fc['value'];writeDB(_0x31455f);});delete recordings[_0x2a8d25['uniqueid']];}}catch(_0x584666){utils['error'](util[_0x3cc5('0x4')]('[%s][recordings][hangup]',_0x2a8d25[_0x3cc5('0x6')]),_0x584666);}};exports[_0x3cc5('0x31')]=function(_0x4339af){try{if(!_['isNil'](recordings[_0x4339af[_0x3cc5('0x6')]])){utils['debug'](util[_0x3cc5('0x4')](_0x3cc5('0x32'),_0x4339af[_0x3cc5('0x6')]),_0x4339af);utils[_0x3cc5('0x3')](util[_0x3cc5('0x4')](_0x3cc5('0x33'),_0x4339af[_0x3cc5('0x6')],_0x4339af[_0x3cc5('0x34')],_0x4339af[_0x3cc5('0x35')]));if(_0x4339af[_0x3cc5('0x34')][_0x3cc5('0x36')]()=='set'&&_[_0x3cc5('0x37')](_0x4339af['appdata'][_0x3cc5('0x36')](),_0x3cc5('0x38'))){var _0x5c7722=_0x4339af['appdata'][_0x3cc5('0x39')]('=');var _0x5aff3e=_0x5c7722[0x0][_0x3cc5('0x3a')](_0x5c7722[0x0][_0x3cc5('0x3b')]('(')+0x1,_0x5c7722[0x0][_0x3cc5('0x3b')](')'));var _0x351000=_0x5c7722[0x1];recordings[_0x4339af[_0x3cc5('0x6')]][_0x5aff3e]=_0x351000;}}}catch(_0x3c3fd5){utils[_0x3cc5('0x25')](util['format']('[%s][recordings][newexten]',_0x4339af[_0x3cc5('0x6')]),_0x3c3fd5);}};exports[_0x3cc5('0x3c')]=function(_0x1a4734){try{if(!_[_0x3cc5('0x16')](recordings[_0x1a4734[_0x3cc5('0x6')]])){utils[_0x3cc5('0xe')](util['format'](_0x3cc5('0x3d'),_0x1a4734['uniqueid']),_0x1a4734);utils[_0x3cc5('0x3')](util['format'](_0x3cc5('0x3e'),_0x1a4734['uniqueid'],_0x1a4734[_0x3cc5('0x3f')]));recordings[_0x1a4734[_0x3cc5('0x6')]]['queue']=_0x1a4734[_0x3cc5('0x3f')];}}catch(_0x52343e){utils['error'](util['format'](_0x3cc5('0x3d'),_0x1a4734[_0x3cc5('0x6')]),_0x52343e);}}; \ No newline at end of file +var _0x8bb4=['uniqueid','linkedid','context','exten','channel','error','[%s][recordings][newchannel]','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','replace','.wav49','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','calleridname','connectedlinenum','type','outbound','connectedlinename','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','./utils','info','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','then','name','UserId','CreateVoiceRecording','newchannel','debug'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8bb4,0x11f));var _0x48bb=function(_0x3b75ec,_0x512781){_0x3b75ec=_0x3b75ec-0x0;var _0x265d2f=_0x8bb4[_0x3b75ec];return _0x265d2f;};'use strict';var _=require(_0x48bb('0x0'));var util=require('util');var utils=require(_0x48bb('0x1'));var recordings={};function writeDB(_0x3e2bb2){utils[_0x48bb('0x2')](util[_0x48bb('0x3')](_0x48bb('0x4'),_0x3e2bb2['uniqueid']));if(_0x3e2bb2[_0x48bb('0x5')]){utils[_0x48bb('0x6')](_0x3e2bb2[_0x48bb('0x5')])[_0x48bb('0x7')](function(_0x15fb05){if(_0x15fb05){_0x3e2bb2['membername']=_0x15fb05[_0x48bb('0x8')];_0x3e2bb2[_0x48bb('0x9')]=_0x15fb05['id'];}utils['request'](_0x48bb('0xa'),_0x3e2bb2);});}else{utils['request']('CreateVoiceRecording',_0x3e2bb2);}}exports[_0x48bb('0xb')]=function(_0x417b41){try{utils[_0x48bb('0xc')](util[_0x48bb('0x3')]('[%s][recordings][newchannel]',_0x417b41[_0x48bb('0xd')]),_0x417b41);if(_0x417b41[_0x48bb('0xd')]==_0x417b41[_0x48bb('0xe')]){utils[_0x48bb('0x2')](util[_0x48bb('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x417b41[_0x48bb('0xd')],_0x417b41[_0x48bb('0xf')],_0x417b41[_0x48bb('0x10')]));recordings[_0x417b41['uniqueid']]={'uniqueid':_0x417b41['uniqueid'],'accountcode':_0x417b41[_0x48bb('0x5')],'exten':_0x417b41[_0x48bb('0x10')],'context':_0x417b41[_0x48bb('0xf')],'channel':_0x417b41[_0x48bb('0x11')],'monitors':[]};}}catch(_0x1e7d72){utils[_0x48bb('0x12')](util['format'](_0x48bb('0x13'),_0x417b41[_0x48bb('0xd')]),_0x1e7d72);}};exports[_0x48bb('0x14')]=function(_0x131e88){try{utils['debug'](util['format'](_0x48bb('0x15'),_0x131e88[_0x48bb('0xd')]),_0x131e88);if(!_[_0x48bb('0x16')](recordings[_0x131e88[_0x48bb('0xd')]])&&_0x131e88[_0x48bb('0x17')]==0x6){utils[_0x48bb('0x2')](util[_0x48bb('0x3')](_0x48bb('0x18'),_0x131e88['uniqueid'],_0x131e88['context'],_0x131e88[_0x48bb('0x11')]));}else if(!_['isNil'](recordings[_0x131e88[_0x48bb('0xe')]])&&_0x131e88[_0x48bb('0x17')]==0x6&&_0x131e88[_0x48bb('0xf')]!='transfer'){utils['info'](util[_0x48bb('0x3')](_0x48bb('0x19'),_0x131e88[_0x48bb('0xd')],_0x131e88[_0x48bb('0xe')],_0x131e88[_0x48bb('0xf')],_0x131e88[_0x48bb('0x11')]));recordings[_0x131e88[_0x48bb('0xe')]]['accountcode']=_0x131e88['accountcode'];}}catch(_0x536def){utils[_0x48bb('0x12')](util[_0x48bb('0x3')]('[%s][recordings][newstate]',_0x131e88[_0x48bb('0xd')]),_0x536def);}};exports['varset']=function(_0x27d6b3){try{if(!_['isNil'](_0x27d6b3[_0x48bb('0x1a')])&&!_[_0x48bb('0x16')](_0x27d6b3['variable'][_0x48bb('0x1b')])){utils[_0x48bb('0xc')](util[_0x48bb('0x3')](_0x48bb('0x1c'),_0x27d6b3[_0x48bb('0xd')]),_0x27d6b3);utils[_0x48bb('0x2')](util[_0x48bb('0x3')](_0x48bb('0x1d'),_0x27d6b3[_0x48bb('0xd')],_0x27d6b3[_0x48bb('0x1a')],_0x27d6b3[_0x48bb('0x1e')]));if(_['endsWith'](_0x27d6b3['value'],'.wav49')){_0x27d6b3[_0x48bb('0x1e')]=_0x27d6b3[_0x48bb('0x1e')][_0x48bb('0x1f')](_0x48bb('0x20'),'.WAV');}if(recordings[_0x27d6b3[_0x48bb('0xe')]]){var _0x216b79=_[_0x48bb('0x21')](recordings[_0x27d6b3[_0x48bb('0xe')]][_0x48bb('0x22')],{'value':_0x27d6b3[_0x48bb('0x1e')]});if(_[_0x48bb('0x16')](_0x216b79)){recordings[_0x27d6b3[_0x48bb('0xe')]][_0x48bb('0x22')][_0x48bb('0x23')]({'value':_0x27d6b3[_0x48bb('0x1e')]});}}}}catch(_0x4ceca8){utils[_0x48bb('0x12')](util[_0x48bb('0x3')]('[%s][recordings][varset]',_0x27d6b3[_0x48bb('0xd')]),_0x4ceca8);}};exports[_0x48bb('0x24')]=function(_0x4699a8){try{if(!_['isNil'](recordings[_0x4699a8[_0x48bb('0xd')]])){utils[_0x48bb('0xc')](util['format'](_0x48bb('0x25'),_0x4699a8['uniqueid']),_0x4699a8);utils[_0x48bb('0x2')](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x4699a8[_0x48bb('0xd')],_0x4699a8[_0x48bb('0x26')],_0x4699a8['calleridname'],_0x4699a8['cause-txt']));recordings[_0x4699a8[_0x48bb('0xd')]][_0x48bb('0x26')]=_0x4699a8['calleridnum'];recordings[_0x4699a8['uniqueid']][_0x48bb('0x27')]=_0x4699a8['calleridname'];recordings[_0x4699a8[_0x48bb('0xd')]][_0x48bb('0x28')]=_0x4699a8[_0x48bb('0x28')];recordings[_0x4699a8[_0x48bb('0xd')]]['connectedlinename']=_0x4699a8['connectedlinename'];if(recordings[_0x4699a8[_0x48bb('0xd')]][_0x48bb('0x29')]==_0x48bb('0x2a')&&recordings[_0x4699a8[_0x48bb('0xd')]]['accountcode']){recordings[_0x4699a8['uniqueid']][_0x48bb('0x28')]=recordings[_0x4699a8['uniqueid']][_0x48bb('0x5')];recordings[_0x4699a8['uniqueid']][_0x48bb('0x2b')]='';}recordings[_0x4699a8[_0x48bb('0xd')]]['monitors']['forEach'](function(_0x607943){var _0x343466=_[_0x48bb('0x2c')](recordings[_0x4699a8[_0x48bb('0xd')]]);_0x343466[_0x48bb('0x1e')]=_0x607943[_0x48bb('0x1e')];writeDB(_0x343466);});delete recordings[_0x4699a8[_0x48bb('0xd')]];}}catch(_0x297ae1){utils[_0x48bb('0x12')](util['format'](_0x48bb('0x25'),_0x4699a8['uniqueid']),_0x297ae1);}};exports['newexten']=function(_0x4ec30c){try{if(!_[_0x48bb('0x16')](recordings[_0x4ec30c[_0x48bb('0xd')]])){utils['debug'](util[_0x48bb('0x3')](_0x48bb('0x2d'),_0x4ec30c[_0x48bb('0xd')]),_0x4ec30c);utils[_0x48bb('0x2')](util[_0x48bb('0x3')](_0x48bb('0x2e'),_0x4ec30c[_0x48bb('0xd')],_0x4ec30c[_0x48bb('0x2f')],_0x4ec30c[_0x48bb('0x30')]));if(_0x4ec30c[_0x48bb('0x2f')][_0x48bb('0x31')]()==_0x48bb('0x32')&&_[_0x48bb('0x33')](_0x4ec30c[_0x48bb('0x30')][_0x48bb('0x31')](),_0x48bb('0x34'))){var _0x653e44=_0x4ec30c[_0x48bb('0x30')][_0x48bb('0x35')]('=');var _0x442115=_0x653e44[0x0][_0x48bb('0x36')](_0x653e44[0x0][_0x48bb('0x37')]('(')+0x1,_0x653e44[0x0]['lastIndexOf'](')'));var _0x2b931a=_0x653e44[0x1];recordings[_0x4ec30c[_0x48bb('0xd')]][_0x442115]=_0x2b931a;}}}catch(_0x54e2a3){utils[_0x48bb('0x12')](util[_0x48bb('0x3')]('[%s][recordings][newexten]',_0x4ec30c[_0x48bb('0xd')]),_0x54e2a3);}};exports[_0x48bb('0x38')]=function(_0x543364){try{if(!_['isNil'](recordings[_0x543364[_0x48bb('0xd')]])){utils['debug'](util['format'](_0x48bb('0x39'),_0x543364[_0x48bb('0xd')]),_0x543364);utils[_0x48bb('0x2')](util['format'](_0x48bb('0x3a'),_0x543364[_0x48bb('0xd')],_0x543364[_0x48bb('0x3b')]));recordings[_0x543364['uniqueid']][_0x48bb('0x3b')]=_0x543364[_0x48bb('0x3b')];}}catch(_0x280e62){utils[_0x48bb('0x12')](util['format'](_0x48bb('0x39'),_0x543364[_0x48bb('0xd')]),_0x280e62);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 7ec7a33..270a0f5 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 _0xbe18=['blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','attended','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','request'];(function(_0x1af76d,_0xd6f069){var _0x53fbcc=function(_0x1d6243){while(--_0x1d6243){_0x1af76d['push'](_0x1af76d['shift']());}};_0x53fbcc(++_0xd6f069);}(_0xbe18,0x1a5));var _0x8be1=function(_0x200372,_0x5368d3){_0x200372=_0x200372-0x0;var _0x1c5401=_0xbe18[_0x200372];return _0x1c5401;};'use strict';var _=require(_0x8be1('0x0'));var util=require(_0x8be1('0x1'));var utils=require(_0x8be1('0x2'));function writeDB(_0x334b46){utils['info'](util[_0x8be1('0x3')](_0x8be1('0x4'),_0x334b46[_0x8be1('0x5')]==='attended'?_0x334b46[_0x8be1('0x6')]:_0x334b46[_0x8be1('0x7')],_0x334b46[_0x8be1('0x5')]));utils[_0x8be1('0x8')]('CreateVoiceTransferReport',_0x334b46);}exports[_0x8be1('0x9')]={};exports[_0x8be1('0xa')]=function(_0x49a0b7){try{utils[_0x8be1('0xb')](util[_0x8be1('0x3')](_0x8be1('0xc'),_0x49a0b7[_0x8be1('0x7')]),_0x49a0b7);utils[_0x8be1('0xd')](util[_0x8be1('0x3')](_0x8be1('0xe'),_0x49a0b7[_0x8be1('0x7')],_0x49a0b7[_0x8be1('0xf')],_0x49a0b7[_0x8be1('0x10')],_0x49a0b7[_0x8be1('0x11')],_0x49a0b7[_0x8be1('0x12')]));_0x49a0b7[_0x8be1('0x5')]=_0x8be1('0x13');exports['blinds'][_0x49a0b7[_0x8be1('0x14')]]=_0x49a0b7;writeDB(_0x49a0b7);}catch(_0x14ef30){utils['error'](util['format'](_0x8be1('0xc'),_0x49a0b7[_0x8be1('0x7')]),_0x14ef30);}};exports[_0x8be1('0x15')]=function(_0xc0b3a8){try{utils['debug'](util[_0x8be1('0x3')](_0x8be1('0x16'),_0xc0b3a8[_0x8be1('0x6')]),_0xc0b3a8);utils[_0x8be1('0xd')](util[_0x8be1('0x3')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xc0b3a8['origtransfereruniqueid'],_0xc0b3a8[_0x8be1('0x17')],_0xc0b3a8[_0x8be1('0x18')],_0xc0b3a8[_0x8be1('0x19')],_0xc0b3a8[_0x8be1('0x1a')]));_0xc0b3a8=_[_0x8be1('0x1b')](_0xc0b3a8,{'transfererchannel':_0xc0b3a8['origtransfererchannel'],'transferercalleridnum':_0xc0b3a8[_0x8be1('0x17')],'transferercalleridname':_0xc0b3a8[_0x8be1('0x18')],'transfererconnectedlinenum':_0xc0b3a8[_0x8be1('0x1c')],'transfererconnectedlinename':_0xc0b3a8[_0x8be1('0x1d')],'transfereraccountcode':_0xc0b3a8[_0x8be1('0x1e')],'transferercontext':_0xc0b3a8[_0x8be1('0x1f')],'transfererexten':_0xc0b3a8[_0x8be1('0x20')],'transfererlinkedid':_0xc0b3a8['origtransfererlinkedid'],'context':_0xc0b3a8[_0x8be1('0x21')],'extension':_0xc0b3a8[_0x8be1('0x22')],'type':_0x8be1('0x23')});if(_['isNil'](_0xc0b3a8['transfereechannel'])){_0xc0b3a8=_['assign'](_0xc0b3a8,{'transfereechannel':_0xc0b3a8[_0x8be1('0x24')],'transfereecalleridnum':_0xc0b3a8[_0x8be1('0x19')],'transfereecalleridname':_0xc0b3a8[_0x8be1('0x1a')],'transfereeconnectedlinenum':_0xc0b3a8[_0x8be1('0x25')],'transfereeconnectedlinename':_0xc0b3a8[_0x8be1('0x26')],'transfereeaccountcode':_0xc0b3a8['transfertargetaccountcode'],'transfereecontext':_0xc0b3a8[_0x8be1('0x27')],'transfereeexten':_0xc0b3a8[_0x8be1('0x28')],'transfereelinkedid':_0xc0b3a8[_0x8be1('0x29')]});}writeDB(_0xc0b3a8);}catch(_0x3ac3ab){utils[_0x8be1('0x2a')](util[_0x8be1('0x3')](_0x8be1('0x16'),_0xc0b3a8['origtransfereruniqueid']),_0x3ac3ab);}}; \ No newline at end of file +var _0x04af=['blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','attended','transfereechannel','transfertargetchannel','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','request'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x04af,0x70));var _0xf04a=function(_0x361da1,_0x1a6c47){_0x361da1=_0x361da1-0x0;var _0x45528d=_0x04af[_0x361da1];return _0x45528d;};'use strict';var _=require(_0xf04a('0x0'));var util=require('util');var utils=require(_0xf04a('0x1'));function writeDB(_0x4b568c){utils[_0xf04a('0x2')](util[_0xf04a('0x3')](_0xf04a('0x4'),_0x4b568c[_0xf04a('0x5')]==='attended'?_0x4b568c[_0xf04a('0x6')]:_0x4b568c['uniqueid'],_0x4b568c[_0xf04a('0x5')]));utils[_0xf04a('0x7')]('CreateVoiceTransferReport',_0x4b568c);}exports[_0xf04a('0x8')]={};exports[_0xf04a('0x9')]=function(_0x635529){try{utils[_0xf04a('0xa')](util['format'](_0xf04a('0xb'),_0x635529[_0xf04a('0xc')]),_0x635529);utils[_0xf04a('0x2')](util['format'](_0xf04a('0xd'),_0x635529['uniqueid'],_0x635529[_0xf04a('0xe')],_0x635529[_0xf04a('0xf')],_0x635529[_0xf04a('0x10')],_0x635529[_0xf04a('0x11')]));_0x635529[_0xf04a('0x5')]=_0xf04a('0x12');exports[_0xf04a('0x8')][_0x635529[_0xf04a('0x13')]]=_0x635529;writeDB(_0x635529);}catch(_0x1b2f64){utils[_0xf04a('0x14')](util[_0xf04a('0x3')](_0xf04a('0xb'),_0x635529[_0xf04a('0xc')]),_0x1b2f64);}};exports[_0xf04a('0x15')]=function(_0x533222){try{utils[_0xf04a('0xa')](util['format'](_0xf04a('0x16'),_0x533222['origtransfereruniqueid']),_0x533222);utils['info'](util[_0xf04a('0x3')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x533222[_0xf04a('0x6')],_0x533222[_0xf04a('0x17')],_0x533222[_0xf04a('0x18')],_0x533222[_0xf04a('0x19')],_0x533222[_0xf04a('0x1a')]));_0x533222=_[_0xf04a('0x1b')](_0x533222,{'transfererchannel':_0x533222[_0xf04a('0x1c')],'transferercalleridnum':_0x533222[_0xf04a('0x17')],'transferercalleridname':_0x533222[_0xf04a('0x18')],'transfererconnectedlinenum':_0x533222['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x533222[_0xf04a('0x1d')],'transfereraccountcode':_0x533222[_0xf04a('0x1e')],'transferercontext':_0x533222[_0xf04a('0x1f')],'transfererexten':_0x533222[_0xf04a('0x20')],'transfererlinkedid':_0x533222['origtransfererlinkedid'],'context':_0x533222[_0xf04a('0x21')],'extension':_0x533222['origtransfererexten'],'type':_0xf04a('0x22')});if(_['isNil'](_0x533222[_0xf04a('0x23')])){_0x533222=_['assign'](_0x533222,{'transfereechannel':_0x533222[_0xf04a('0x24')],'transfereecalleridnum':_0x533222[_0xf04a('0x19')],'transfereecalleridname':_0x533222['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x533222['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x533222['transfertargetconnectedlinename'],'transfereeaccountcode':_0x533222[_0xf04a('0x25')],'transfereecontext':_0x533222['transfertargetcontext'],'transfereeexten':_0x533222[_0xf04a('0x26')],'transfereelinkedid':_0x533222[_0xf04a('0x27')]});}writeDB(_0x533222);}catch(_0x56ea74){utils[_0xf04a('0x14')](util[_0xf04a('0x3')](_0xf04a('0x16'),_0x533222[_0xf04a('0x6')]),_0x56ea74);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 2dc5d00..29944bd 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 _0x69a2=['type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diff','sumTime','now','isAfter','isBefore','bluebird','moment','client','http','../../config/logger','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','internal','name','[utils][getUser]\x20where:%s','stringify','length','result','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue'];(function(_0x3b37d0,_0x5e3d41){var _0x4987b6=function(_0xd63e1c){while(--_0xd63e1c){_0x3b37d0['push'](_0x3b37d0['shift']());}};_0x4987b6(++_0x5e3d41);}(_0x69a2,0x106));var _0x269a=function(_0xf3e355,_0xc7b1b6){_0xf3e355=_0xf3e355-0x0;var _0x20614a=_0x69a2[_0xf3e355];return _0x20614a;};'use strict';var BPromise=require(_0x269a('0x0'));var jayson=require('jayson/promise');var moment=require(_0x269a('0x1'));var util=require('util');var client=jayson[_0x269a('0x2')][_0x269a('0x3')]({'port':0x2329});var logger=require(_0x269a('0x4'))(_0x269a('0x5'));exports[_0x269a('0x6')]=function(_0x3d415b,_0x471a1c){logger[_0x269a('0x6')](_0x3d415b,_0x471a1c?util['inspect'](_0x471a1c,{'showHidden':![],'depth':null}):'');};exports[_0x269a('0x7')]=function(_0x446458,_0x4dd6a1){logger[_0x269a('0x7')](_0x446458,_0x4dd6a1?util[_0x269a('0x8')](_0x4dd6a1,{'showHidden':![],'depth':null}):'');};exports[_0x269a('0x9')]=function(_0x2cdec5,_0x4da203){logger['error'](_0x2cdec5,_0x4da203?util[_0x269a('0x8')](_0x4da203,{'showHidden':![],'depth':null}):'');};exports[_0x269a('0xa')]=function(_0x5f4596,_0x2acaa2){return client[_0x269a('0xa')](_0x5f4596,{'body':_0x2acaa2})[_0x269a('0xb')](function(_0x34ea10){logger[_0x269a('0x7')](_0x269a('0xc'),_0x5f4596,_0x34ea10?util[_0x269a('0x8')](_0x34ea10,{'showHidden':![],'depth':null}):'');})[_0x269a('0xd')](function(_0xc63d00){logger['error']('[utils][request]\x20name:%s',_0x5f4596,_0xc63d00?util[_0x269a('0x8')](_0xc63d00,{'showHidden':![],'depth':null}):'');});};function getUser(_0x31693b){return client[_0x269a('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x269a('0xe'),_0x269a('0xf'),'interface'],'where':_0x31693b,'limit':0x1}})[_0x269a('0xb')](function(_0x3f7bd8){logger[_0x269a('0x7')](_0x269a('0x10'),JSON[_0x269a('0x11')](_0x31693b),_0x3f7bd8?util[_0x269a('0x8')](_0x3f7bd8,{'showHidden':![],'depth':null}):'');return _0x3f7bd8['result'][_0x269a('0x12')]?_0x3f7bd8[_0x269a('0x13')][0x0]:null;});}exports['getUserByInternal']=function(_0x30045f){return new BPromise(function(_0x5ad5ac,_0x35992e){if(_0x30045f){return getUser({'internal':_0x30045f})['then'](function(_0x266f06){logger[_0x269a('0x6')](_0x269a('0x14'),_0x30045f,_0x266f06?_0x269a('0x15'):_0x269a('0x16'));return _0x5ad5ac(_0x266f06);})[_0x269a('0xd')](function(_0x5a91df){logger['error'](_0x269a('0x17'),_0x5a91df?util[_0x269a('0x8')](_0x5a91df,{'showHidden':![],'depth':null}):'');return _0x5ad5ac(null);});}return _0x5ad5ac(null);});};exports[_0x269a('0x18')]=function(_0x5b6b48){return new BPromise(function(_0x15923b,_0x6ddf65){if(_0x5b6b48){return getUser({'interface':_0x5b6b48})[_0x269a('0xb')](function(_0x2ddbdb){logger[_0x269a('0x6')](_0x269a('0x19'),_0x5b6b48,_0x2ddbdb?'found':_0x269a('0x16'));return _0x15923b(_0x2ddbdb);})[_0x269a('0xd')](function(_0x36c1f6){logger[_0x269a('0x9')](_0x269a('0x1a'),_0x36c1f6?util[_0x269a('0x8')](_0x36c1f6,{'showHidden':![],'depth':null}):'');return _0x15923b(null);});}return _0x15923b(null);});};exports[_0x269a('0x1b')]=function(_0x5d6ea5){return new BPromise(function(_0x3438c4,_0x70a6ad){if(_0x5d6ea5){return getUser({'name':_0x5d6ea5})[_0x269a('0xb')](function(_0x2c4707){logger[_0x269a('0x6')](_0x269a('0x1c'),_0x5d6ea5,_0x2c4707?_0x269a('0x15'):_0x269a('0x16'));return _0x3438c4(_0x2c4707);})[_0x269a('0xd')](function(_0x27c0d0){logger[_0x269a('0x9')](_0x269a('0x1d'),_0x27c0d0?util[_0x269a('0x8')](_0x27c0d0,{'showHidden':![],'depth':null}):'');return _0x3438c4(null);});}return _0x3438c4(null);});};exports[_0x269a('0x1e')]=function(_0x71f27e){return new BPromise(function(_0x1fbb67,_0x334c14){if(_0x71f27e){return client[_0x269a('0xa')](_0x269a('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x269a('0xf'),_0x269a('0x20'),_0x269a('0x21'),_0x269a('0x22')],'where':{'name':_0x71f27e},'limit':0x1}})[_0x269a('0xb')](function(_0x2644a6){logger['debug'](_0x269a('0x23'),_0x71f27e,_0x2644a6?util[_0x269a('0x8')](_0x2644a6,{'showHidden':![],'depth':null}):'');logger[_0x269a('0x6')](_0x269a('0x24'),_0x71f27e,_0x2644a6?_0x269a('0x15'):_0x269a('0x16'));return _0x1fbb67(_0x2644a6[_0x269a('0x13')]['length']?_0x2644a6[_0x269a('0x13')][0x0]:null);})[_0x269a('0xd')](function(_0xe5b90a){logger[_0x269a('0x9')](_0x269a('0x25'),_0xe5b90a?util[_0x269a('0x8')](_0xe5b90a,{'showHidden':![],'depth':null}):'');return _0x1fbb67(null);});}return _0x1fbb67(null);});};exports[_0x269a('0x26')]=function(_0x459892,_0x271866){return moment(_0x459892)[_0x269a('0x27')](_0x271866,_0x269a('0x28'))[_0x269a('0x29')](_0x269a('0x2a'));};exports['subtractTime']=function(_0x566f81,_0x44fc61){return moment(_0x566f81)[_0x269a('0x2b')](_0x44fc61,_0x269a('0x28'))[_0x269a('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x21981b,_0x11a3d0){return moment(_0x21981b)[_0x269a('0x2c')](moment(_0x11a3d0),_0x269a('0x28'));};exports[_0x269a('0x2d')]=function(_0x5bc6e9,_0x2c008e){return parseInt(_0x5bc6e9,0xa)+parseInt(_0x2c008e,0xa);};exports[_0x269a('0x2e')]=function(){return moment()['format'](_0x269a('0x2a'));};exports[_0x269a('0x2f')]=function(_0xf7269c,_0x42e048){if(_0x42e048){return moment(_0xf7269c)[_0x269a('0x2f')](_0x42e048);}return!![];};exports[_0x269a('0x30')]=function(_0x473339,_0xae29d2){if(_0xae29d2){return moment(_0x473339)[_0x269a('0x30')](_0xae29d2);}else if(_0x473339){return!![];}return![];}; \ No newline at end of file +var _0xc7e7=['[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','sumTime','now','isAfter','isBefore','jayson/promise','moment','client','http','../../config/logger','xdr','inspect','debug','error','request','then','[utils][request]\x20name:%s','internal','name','stringify','result','length','getUserByInternal','info','found','notfound','catch','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0xc7e7,0x13a));var _0x7c7e=function(_0x349250,_0x39bc5b){_0x349250=_0x349250-0x0;var _0xa77ba9=_0xc7e7[_0x349250];return _0xa77ba9;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x7c7e('0x0'));var moment=require(_0x7c7e('0x1'));var util=require('util');var client=jayson[_0x7c7e('0x2')][_0x7c7e('0x3')]({'port':0x2329});var logger=require(_0x7c7e('0x4'))(_0x7c7e('0x5'));exports['info']=function(_0x340e4,_0x3bbe68){logger['info'](_0x340e4,_0x3bbe68?util[_0x7c7e('0x6')](_0x3bbe68,{'showHidden':![],'depth':null}):'');};exports[_0x7c7e('0x7')]=function(_0x23e0bc,_0x329ede){logger[_0x7c7e('0x7')](_0x23e0bc,_0x329ede?util['inspect'](_0x329ede,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x186bb4,_0x149db2){logger[_0x7c7e('0x8')](_0x186bb4,_0x149db2?util[_0x7c7e('0x6')](_0x149db2,{'showHidden':![],'depth':null}):'');};exports[_0x7c7e('0x9')]=function(_0x2ba07f,_0x1f464a){return client[_0x7c7e('0x9')](_0x2ba07f,{'body':_0x1f464a})[_0x7c7e('0xa')](function(_0x1011b5){logger[_0x7c7e('0x7')](_0x7c7e('0xb'),_0x2ba07f,_0x1011b5?util[_0x7c7e('0x6')](_0x1011b5,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x48195c){logger[_0x7c7e('0x8')](_0x7c7e('0xb'),_0x2ba07f,_0x48195c?util['inspect'](_0x48195c,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1050cb){return client[_0x7c7e('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x7c7e('0xc'),_0x7c7e('0xd'),'interface'],'where':_0x1050cb,'limit':0x1}})[_0x7c7e('0xa')](function(_0x53693e){logger[_0x7c7e('0x7')]('[utils][getUser]\x20where:%s',JSON[_0x7c7e('0xe')](_0x1050cb),_0x53693e?util[_0x7c7e('0x6')](_0x53693e,{'showHidden':![],'depth':null}):'');return _0x53693e[_0x7c7e('0xf')][_0x7c7e('0x10')]?_0x53693e[_0x7c7e('0xf')][0x0]:null;});}exports[_0x7c7e('0x11')]=function(_0x2a960b){return new BPromise(function(_0x36a42b,_0x17c76a){if(_0x2a960b){return getUser({'internal':_0x2a960b})[_0x7c7e('0xa')](function(_0x26026a){logger[_0x7c7e('0x12')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x2a960b,_0x26026a?_0x7c7e('0x13'):_0x7c7e('0x14'));return _0x36a42b(_0x26026a);})[_0x7c7e('0x15')](function(_0x70527a){logger[_0x7c7e('0x8')](_0x7c7e('0x16'),_0x70527a?util['inspect'](_0x70527a,{'showHidden':![],'depth':null}):'');return _0x36a42b(null);});}return _0x36a42b(null);});};exports['getUserByInterface']=function(_0x2b934d){return new BPromise(function(_0x32934c,_0x50c8a2){if(_0x2b934d){return getUser({'interface':_0x2b934d})['then'](function(_0x535bf1){logger['info'](_0x7c7e('0x17'),_0x2b934d,_0x535bf1?'found':'notfound');return _0x32934c(_0x535bf1);})['catch'](function(_0x4fb2bc){logger[_0x7c7e('0x8')]('[utils][getUserByInterface]',_0x4fb2bc?util[_0x7c7e('0x6')](_0x4fb2bc,{'showHidden':![],'depth':null}):'');return _0x32934c(null);});}return _0x32934c(null);});};exports[_0x7c7e('0x18')]=function(_0x1a8638){return new BPromise(function(_0x499f33,_0x47ee36){if(_0x1a8638){return getUser({'name':_0x1a8638})[_0x7c7e('0xa')](function(_0x38ef54){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x1a8638,_0x38ef54?'found':_0x7c7e('0x14'));return _0x499f33(_0x38ef54);})[_0x7c7e('0x15')](function(_0x2874e2){logger[_0x7c7e('0x8')]('[utils][getUserByName]',_0x2874e2?util[_0x7c7e('0x6')](_0x2874e2,{'showHidden':![],'depth':null}):'');return _0x499f33(null);});}return _0x499f33(null);});};exports[_0x7c7e('0x19')]=function(_0x3fb2ac){return new BPromise(function(_0x7333db,_0x390dd1){if(_0x3fb2ac){return client[_0x7c7e('0x9')](_0x7c7e('0x1a'),{'options':{'raw':!![],'attributes':['id',_0x7c7e('0xd'),_0x7c7e('0x1b'),'acw',_0x7c7e('0x1c')],'where':{'name':_0x3fb2ac},'limit':0x1}})['then'](function(_0x41c06f){logger['debug'](_0x7c7e('0x1d'),_0x3fb2ac,_0x41c06f?util[_0x7c7e('0x6')](_0x41c06f,{'showHidden':![],'depth':null}):'');logger[_0x7c7e('0x12')](_0x7c7e('0x1e'),_0x3fb2ac,_0x41c06f?_0x7c7e('0x13'):_0x7c7e('0x14'));return _0x7333db(_0x41c06f[_0x7c7e('0xf')][_0x7c7e('0x10')]?_0x41c06f[_0x7c7e('0xf')][0x0]:null);})['catch'](function(_0x200686){logger['error'](_0x7c7e('0x1f'),_0x200686?util[_0x7c7e('0x6')](_0x200686,{'showHidden':![],'depth':null}):'');return _0x7333db(null);});}return _0x7333db(null);});};exports['addTime']=function(_0x36a34c,_0x492489){return moment(_0x36a34c)[_0x7c7e('0x20')](_0x492489,_0x7c7e('0x21'))[_0x7c7e('0x22')](_0x7c7e('0x23'));};exports[_0x7c7e('0x24')]=function(_0x4cbb8d,_0x1de5d2){return moment(_0x4cbb8d)[_0x7c7e('0x25')](_0x1de5d2,_0x7c7e('0x21'))['format'](_0x7c7e('0x23'));};exports[_0x7c7e('0x26')]=function(_0x41458b,_0x29edc4){return moment(_0x41458b)['diff'](moment(_0x29edc4),'seconds');};exports[_0x7c7e('0x27')]=function(_0x23ea72,_0x3fb3ed){return parseInt(_0x23ea72,0xa)+parseInt(_0x3fb3ed,0xa);};exports[_0x7c7e('0x28')]=function(){return moment()[_0x7c7e('0x22')](_0x7c7e('0x23'));};exports['isAfter']=function(_0x51fc45,_0x317636){if(_0x317636){return moment(_0x51fc45)[_0x7c7e('0x29')](_0x317636);}return!![];};exports[_0x7c7e('0x2a')]=function(_0x421cc1,_0x3ffa62){if(_0x3ffa62){return moment(_0x421cc1)['isBefore'](_0x3ffa62);}else if(_0x421cc1){return!![];}return![];}; \ No newline at end of file